HOUSEPLAY.bak.js 1.6 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218
  1. /*! For license information please see HOUSEPLAY.js.LICENSE.txt */ ! function(t, e) {
  2. "object" == typeof exports && "object" == typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? exports.HOUSEPLAY = e() : t.HOUSEPLAY = e()
  3. }(window, (function() {
  4. return function(t) {
  5. var e = {};
  6. function i(n) {
  7. if (e[n]) return e[n].exports;
  8. var r = e[n] = {
  9. i: n,
  10. l: !1,
  11. exports: {}
  12. };
  13. return t[n].call(r.exports, r, r.exports, i), r.l = !0, r.exports
  14. }
  15. return i.m = t, i.c = e, i.d = function(t, e, n) {
  16. i.o(t, e) || Object.defineProperty(t, e, {
  17. enumerable: !0,
  18. get: n
  19. })
  20. }, i.r = function(t) {
  21. "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {
  22. value: "Module"
  23. }), Object.defineProperty(t, "__esModule", {
  24. value: !0
  25. })
  26. }, i.t = function(t, e) {
  27. if (1 & e && (t = i(t)), 8 & e) return t;
  28. if (4 & e && "object" == typeof t && t && t.__esModule) return t;
  29. var n = Object.create(null);
  30. if (i.r(n), Object.defineProperty(n, "default", {
  31. enumerable: !0,
  32. value: t
  33. }), 2 & e && "string" != typeof t)
  34. for (var r in t) i.d(n, r, function(e) {
  35. return t[e]
  36. }.bind(null, r));
  37. return n
  38. }, i.n = function(t) {
  39. var e = t && t.__esModule ? function() {
  40. return t.default
  41. } : function() {
  42. return t
  43. };
  44. return i.d(e, "a", e), e
  45. }, i.o = function(t, e) {
  46. return Object.prototype.hasOwnProperty.call(t, e)
  47. }, i.p = "", i(i.s = 77)
  48. }([function(t, e, i) {
  49. "use strict";
  50. // threejs
  51. }, function(t, e, i) {
  52. var n = i(0),
  53. r = i(3),
  54. o = i(5),
  55. a = i(101),
  56. s = i(102),
  57. l = i(24),
  58. u = i(15),
  59. h = i(7),
  60. c = i(25),
  61. d = i(26),
  62. p = {
  63. delBK: !0,
  64. delBKEdit: !1,
  65. isNewServerPreviewVersion: !1,
  66. isNewEditVersion: !1,
  67. isCleanUI: 0,
  68. jfedit: !1,
  69. screenshot: !1,
  70. unit_type: 0,
  71. unit_conversion_value: 1,
  72. unit_name: "m",
  73. unit_sq_name: "m²",
  74. debug: !1,
  75. isLocalVersion: !1,
  76. vrDebug: !1,
  77. fpsOn: !1,
  78. adjustCompass: !1,
  79. adjustColor: !1,
  80. newbarrage: !0,
  81. wscdn: !0,
  82. thirdCustomer: -1,
  83. version: "2.11.9-0-ga9537d5",
  84. pageTitle: "众趣科技",
  85. authorizationHeader: c.getAuthorizationHeader(),
  86. autoplay: r.valueFromHash("play", !0),
  87. logLevel: r.valueFromHash("log", 2),
  88. showLog: r.valueFromHash("db", 0),
  89. skyboxRadius: 250,
  90. modelBoundsPadding: 5,
  91. showNeighbors: !1,
  92. brand: r.valueFromHash("brand", !0),
  93. mls: r.valueFromHash("mls", 0),
  94. showHighlights: r.valueFromHash("hhl", !0),
  95. startHighlights: r.valueFromHash("hl", !1),
  96. specialEdition: r.valueFromHash("bn", 0),
  97. showTitleContainer: r.valueFromHash("title", !0),
  98. useWheel: r.valueFromHash("wh", !0),
  99. crossOrigin: "anonymous",
  100. fancierTransition: !0,
  101. wireframe: !0,
  102. skyboxWireframe: !0,
  103. modelAlpha: 1,
  104. highlightPanoSelection: !1,
  105. showSweeps: !0,
  106. showSkyboxes: !0,
  107. showMesh: !0,
  108. showFloors: !0,
  109. showFloorDuration: 300,
  110. showFloorDelay: 300,
  111. hideFloorDuration: 300,
  112. hideFloorDelay: 0,
  113. reticuleOpacityTransitionTime: 250,
  114. reticuleColor: s.yellow,
  115. markerOpacityTransitionTime: 500,
  116. guiAnimationSpeed: 250,
  117. highlightAnimationDuration: 500,
  118. barfadeAnimationDuration: 300,
  119. modelComponentLoadSpinnerDelay: 150,
  120. captureErrors: !1,
  121. maxMobileTextures: 10,
  122. startupFlyinDelay: 3e3,
  123. dollhouseDefault: {
  124. minDistance: 5,
  125. maxDistance: 50,
  126. minPolarAngle: n.Math.degToRad(10),
  127. maxPolarAngle: n.Math.degToRad(65)
  128. },
  129. hideReticuleTimeout: 1e3,
  130. titletagMaxdistance: 5,
  131. analytics: {
  132. inactivityThreshold: 30,
  133. sessionTrackingRate: .15,
  134. maxTrackedErrors: 20,
  135. sessionDurationPingFrequency: 10,
  136. sessionDurationTimeout: 15
  137. },
  138. flydown: {
  139. movementEasing: "easeInOutQuad",
  140. movementDelay: .001,
  141. rotationEasing: "easeInOutQuad",
  142. rotationDelay: .5,
  143. modelTextureDelay: .75,
  144. skyboxDelay: .75
  145. },
  146. transition: {
  147. flySpeed: .01,
  148. flyTime: 800,
  149. flytimeMaxDistanceThreshold: 5,
  150. flytimeDistanceMultiplier: 150,
  151. aimTime: 1150,
  152. aimSlowFactor: 1.5,
  153. blur: .2,
  154. movementEasing: "easeInOutQuad",
  155. blendEasing: "easeInOutQuad",
  156. fastForwardFactor: 1
  157. },
  158. show360Views: {
  159. enabled: !0,
  160. transitionTime: 1e3
  161. },
  162. quickstart: {
  163. enabled: 1 === r.valueFromHash("qs", 0),
  164. animation: 1e3,
  165. showTextDelay: 500,
  166. fadeOutDelay: 1e3,
  167. fovChange: 10
  168. },
  169. vr: {
  170. enabled: !1,
  171. option: r.valueFromHash("vr", a.CONTEXTUAL)
  172. },
  173. mattertags: {
  174. enabled: !0,
  175. enableLinking: !0,
  176. enablePanoSize: !0,
  177. startup: {
  178. hideUntilStart: !1,
  179. fadeInDuration: 500,
  180. fadeInDelay: 100
  181. },
  182. visibility: {
  183. anyDistance: !0,
  184. visibleDistance: 8,
  185. cameraClearance: .1,
  186. alphaTestLevel: .05,
  187. hideViaFloor: !0,
  188. hideOffScreenDisc: !1,
  189. hideOffScreenObject: !1
  190. },
  191. disc: {
  192. opacity: .9,
  193. disabledOpacity: .5,
  194. scale: {
  195. nearBound: 1.5,
  196. farBound: 4.8,
  197. linkFarBound: !1,
  198. linkPercent: 40,
  199. maxSize: 80,
  200. minSize: 40,
  201. baseViewportSize: 800,
  202. buildingViewportSize: 300,
  203. responsiveness: 100
  204. }
  205. },
  206. pole: {
  207. enabled: !0,
  208. height: .5,
  209. width: 2,
  210. opacity: .5,
  211. color: "white"
  212. },
  213. animation: {
  214. hoverOnClosing: !1,
  215. animInDelay: 100,
  216. animOutDelay: 50,
  217. animInTime: 200,
  218. animOutTime: 100
  219. },
  220. boardScale: {
  221. billboardScale: 1,
  222. scaleToDisc: !0,
  223. boardToDiscRatio: 1.2
  224. },
  225. navigate: {
  226. nearestPano: !0,
  227. lineOfSight: !0,
  228. reactivate: !0,
  229. aimAt: "disc",
  230. tiltTolerance: 25,
  231. rotateSpeedFactor: .6
  232. }
  233. },
  234. path: {
  235. color: s.white,
  236. colorUp: s._desat(s.white, .5),
  237. colorDown: s._darken(s.white, .35),
  238. opacity: .5,
  239. style: "ribbon",
  240. height: .025,
  241. ribbonWidth: .24,
  242. outsideHeight: .5,
  243. waypointRadius: .5,
  244. waypointIndoorRadius: .24,
  245. waypointPulse: 1e3,
  246. typ: l.BLACK,
  247. meshFree: r.valueFromHash("mf", 0),
  248. mapGuides: r.valueFromHash("guides", !0),
  249. fadeInTime: 400,
  250. fadeOutTime: 300
  251. },
  252. warp: {
  253. nearPanoDist: .1,
  254. matchCam: !1,
  255. blur: .33,
  256. fastTime: 1500,
  257. teleportTime: 1500,
  258. outsideTime: 2e3,
  259. lookAheadMax: .3,
  260. lookAheadDist: 2.5,
  261. softPushDist: .37,
  262. softPushEnd: .3,
  263. softBendAngle: 8,
  264. softBendTilt: 4,
  265. softBendEnd: .3,
  266. doBurns: r.valueFromHash("kb", !0),
  267. burnsAngle: 15,
  268. minBurnsAngle: 6,
  269. minDownAngle: -35,
  270. maxTurnPerSec: 280,
  271. maxAimPerSec: 45,
  272. minRotation: 12,
  273. maxAimRotation: 33.2,
  274. turnFriction: .2,
  275. flySpeed: .01,
  276. minWarpTime: 1200,
  277. warpInterruptionRedirectTime: 500,
  278. tourStepDelay: r.valueFromHash("st", 5e3),
  279. walkDelay: 0,
  280. walkMaxDist: 50,
  281. walkSlideShowThreshhold: 3e3,
  282. walkExtraPanosDistance: .4,
  283. timePerMeter: 800,
  284. motionLeadTime: 500,
  285. movementEasing: "easeInOutQuad",
  286. blendEasing: "easeInOutQuad",
  287. showBunny: !1,
  288. loop: r.valueFromHash("lp", !0),
  289. auto: r.valueFromHash("ts", -1),
  290. eOrder: "YXZ",
  291. stepFactor: .25,
  292. brakeStrength: 2,
  293. minBrakeAngle: .1,
  294. maxBrakeAngle: 1.8,
  295. climbEffort: 4,
  296. waitMultiplier1: 4,
  297. waitMultiplier2: 4
  298. },
  299. rotationFriction: .06,
  300. rotationAccelerationInside: 4.5,
  301. rotationAccelerationOutside: .15,
  302. rotationAfterMoveMultiplier: 60,
  303. rotationAfterMoveHistoryCount: 5,
  304. panFriction: .09,
  305. panAccelerationOutside: 60,
  306. onload: r.valueFromHash("onload", o.PANORAMA),
  307. zoomNearLimit: .1,
  308. zoomFarLimit: 10,
  309. navigation: {
  310. panoScores: !1,
  311. mouseDirection: !0,
  312. filterStrictness: .75,
  313. angleFactor: -30,
  314. directionFactor: 10,
  315. distanceFactor: -1,
  316. optionalityFactor: 3
  317. },
  318. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  319. console: r.valueFromHash("console", !1),
  320. noMeshFloorPositionOffset: new n.Vector3(0, -1.2, 0),
  321. panoramaNeighbourMaxDistance: 5,
  322. panoFloorClickRadius: .7,
  323. showScreenshotLocations: !1,
  324. showAxis: !0,
  325. showNeighbourRaycasts: !1,
  326. colorMarkerOnLoad: !1,
  327. colorMarkerByFloor: !1,
  328. tiling: {
  329. panoPreRenderRepeatDelay: 2500,
  330. panoPreRenderDelay: 500,
  331. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  332. tilingFlagNames: ["usetiles", "tiles"],
  333. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  334. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  335. overlayStyle: r.valueFromHash("tileoverlay", 0),
  336. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  337. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  338. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  339. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  340. customCompression: r.valueFromHash("tilecustcomp", 0),
  341. mobileHighQualityOverride: !1,
  342. allowUltraHighResolution: !1
  343. },
  344. zoom: {
  345. enabled: !0,
  346. max: r.valueFromHash("maxzoom", 8),
  347. min: r.valueFromHash("minzoom", 1),
  348. transitionStyle: r.valueFromHash("zoomtrans", 1),
  349. restoreTime: 500,
  350. activationThreshold: 1.1
  351. },
  352. panoramaSettings: {
  353. loading_2k: !1,
  354. screenshot_2k: !1,
  355. loading_fov82: !1,
  356. screenshot_fov82: !1
  357. }
  358. };
  359. (p = h.deepExtend(p, d, {
  360. panorama: {
  361. transitionTime: 1300,
  362. modelAlpha: 0,
  363. modelAlphaDelay: p.flydown.modelTextureDelay,
  364. modelAlphaLength: 1,
  365. skyboxOpacity: 1,
  366. skyboxOpacityDelay: p.flydown.skyboxDelay,
  367. skyboxOpacityLength: .9,
  368. fovLength: 1,
  369. fovDelay: 0,
  370. cameraMatrixDuration: .8,
  371. cameraMatrixDelay: 0,
  372. cameraMatrixEase: u.easeInCubic,
  373. reticuleOpacity: 1,
  374. markerOpacity: .6,
  375. markerOpacityOnHover: 1
  376. },
  377. dollhouse: {
  378. transitionTime: 1200,
  379. modelAlpha: 1,
  380. modelAlphaDelay: 0,
  381. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  382. skyboxOpacity: 0,
  383. skyboxOpacityDelay: 0,
  384. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  385. fovLength: 1,
  386. fovDelay: 0,
  387. cameraMatrixDuration: .8,
  388. cameraMatrixDelay: .3,
  389. cameraMatrixEase: u.easeInCubic,
  390. reticuleOpacity: 1,
  391. markerOpacity: 0,
  392. markerOpacityOnHover: 0
  393. },
  394. floorplan: {
  395. transitionTime: 1e3,
  396. modelAlpha: 1,
  397. modelAlphaDelay: 0,
  398. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  399. skyboxOpacity: 0,
  400. skyboxOpacityDelay: 0,
  401. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  402. fovLength: 1,
  403. fovDelay: 0,
  404. cameraMatrixDuration: .5,
  405. cameraMatrixDelay: 0,
  406. cameraMatrixEase: u.easeOutCubic,
  407. reticuleOpacity: 1,
  408. markerOpacity: 0,
  409. markerOpacityOnHover: 0
  410. },
  411. transitioning: {
  412. reticuleOpacity: 0
  413. },
  414. "floorplan-dollhouse": {
  415. rotationDelay: 0,
  416. rotationDuration: 1
  417. },
  418. "floorplan-panorama": {
  419. rotationDelay: .5,
  420. rotationDuration: 1
  421. },
  422. "dollhouse-panorama": {
  423. rotationDelay: .6,
  424. rotationDuration: 1
  425. },
  426. "dollhouse-floorplan": {
  427. rotationDelay: 0,
  428. rotationDuration: 1,
  429. cameraMatrixDuration: 1.05,
  430. cameraMatrixDelay: .5
  431. },
  432. "panorama-dollhouse": {
  433. rotationDelay: 0,
  434. rotationDuration: .4
  435. },
  436. "panorama-floorplan": {
  437. transitionTime: 1500,
  438. rotationDelay: 0,
  439. rotationDuration: .5
  440. }
  441. }))
  442. .path.meshFree && (p.path.typ = l.WALK), t.exports = p
  443. }, function(t, e, i) {
  444. (function(e) {
  445. var i = window.Raven;
  446. function n(t) {
  447. var r, o, a, s, l = t.split("/"),
  448. u = "[" + l[l.length - 1].replace(".js", "") + "]",
  449. h = {};
  450. if (n.consoleEnabled) {
  451. var c = function(t) {
  452. e("#debug-console")
  453. .append("<p>" + t + "</p>"), e("#debug-console")[0].scrollTop = e("#debug-console")[0].scrollHeight
  454. };
  455. r = function(t) {
  456. c(Array.prototype.slice.call(arguments)
  457. .join(" "))
  458. }, o = function(t) {
  459. c(Array.prototype.slice.call(arguments)
  460. .join(" "))
  461. }, a = function(t) {
  462. c("WARN: " + Array.prototype.slice.call(arguments)
  463. .join(" "))
  464. }, s = function(t) {
  465. c("ERROR: " + Array.prototype.slice.call(arguments)
  466. .join(" "))
  467. }
  468. } else console.debug ? (r = console.debug, o = console.info ? console.info : console.debug, a = console.warn ? console.warn : console.debug, s = console.error ? console.error : console.debug) : r = o = a = s = function() {};
  469. var d = function(t) {
  470. return [u, n.timestamp()].concat(Array.prototype.slice.call(t))
  471. },
  472. p = function(e, r) {
  473. if (i) {
  474. var o = Array.prototype.slice.call(e)
  475. .join(" ");
  476. i.captureMessage(o, {
  477. level: r,
  478. path: t,
  479. timestamp: n.timestamp()
  480. })
  481. }
  482. },
  483. f = function(e, r) {
  484. if (i) {
  485. var o = Array.prototype.slice.call(e)
  486. .join(" ");
  487. i.captureException(new Error(o), {
  488. level: r,
  489. path: t,
  490. timestamp: n.timestamp()
  491. })
  492. }
  493. };
  494. return {
  495. debug: function() {
  496. n.level >= n.levels.debug && r.appply(console, d(arguments))
  497. },
  498. info: function() {
  499. n.level >= n.levels.info && o.apply(console, d(arguments))
  500. },
  501. warn: function() {
  502. p(arguments, "warn"), n.level >= n.levels.warn && a.apply(console, d(arguments))
  503. },
  504. error: function() {
  505. f(arguments, "error"), n.level >= n.levels.error && s.apply(console, d(arguments))
  506. },
  507. v3str: function(t, e) {
  508. var i = void 0 === e ? 2 : e;
  509. return "(" + t.x.toPrecision(i) + ", " + t.y.toPrecision(i) + ", " + t.z.toPrecision(i) + ")"
  510. },
  511. eulstr: function(t, e) {
  512. var i = void 0 === e ? 2 : e;
  513. return "(" + THREE.Math.radToDeg(t.x)
  514. .toPrecision(i) + ", " + THREE.Math.radToDeg(t.y)
  515. .toPrecision(i) + ", " + THREE.Math.radToDeg(t.z)
  516. .toPrecision(i) + ' "' + t.order + '")'
  517. },
  518. time: function(t) {
  519. n.level >= n.levels.debug && (h[t] = Date.now())
  520. },
  521. timeEnd: function(t) {
  522. if (n.level >= n.levels.debug) {
  523. var e = h[t];
  524. if (!e) return;
  525. var i = (Date.now() - e) / 1e3;
  526. this.debug(t, i + "s")
  527. }
  528. }
  529. }
  530. }
  531. n.timestamp = function() {
  532. return (Date.now() - window.navigationStart) / 1e3 + "s"
  533. }, n.levels = {
  534. debug: 3,
  535. info: 2,
  536. warn: 1,
  537. error: 0
  538. }, n.level = n.levels.info, t.exports = n
  539. })
  540. .call(this, i(6))
  541. }, function(t, e, i) {
  542. (function(e) {
  543. function n(t, e) {
  544. var i = window.navigator.userAgent.match(t);
  545. return i = i ? i[1].split(e) : [], {
  546. major: parseInt(i[0]) || 0,
  547. minor: parseInt(i[1]) || 0,
  548. patch: parseInt(i[2]) || 0
  549. }
  550. }
  551. var r = i(99);
  552. t.exports = {
  553. isFullscreen: function() {
  554. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  555. },
  556. supportsFullscreen: function() {
  557. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  558. },
  559. isPointerLocked: function() {
  560. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  561. },
  562. requestFullscreen: function(t, i) {
  563. t.requestFullscreen ? t.requestFullscreen() : t.mozRequestFullScreen ? t.mozRequestFullScreen() : t.webkitRequestFullscreen ? t.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : t.msRequestFullscreen && t.msRequestFullscreen(), i && e(document)
  564. .on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  565. },
  566. requestPointerLock: function() {
  567. var t;
  568. if (document.fullscreenElement) t = document.fullscreenElement();
  569. else if (document.mozFullscreenElement) t = document.mozFullscreenElement();
  570. else if (document.mozFullScreenElement) t = document.mozFullScreenElement();
  571. else {
  572. if (!document.webkitFullscreenElement) return;
  573. t = document.webkitFullscreenElement()
  574. }
  575. t.requestPointerLock = t.requestPointerLock || t.mozRequestPointerLock || t.webkitRequestPointerLock, t.requestPointerLock(), e(document)
  576. .off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  577. },
  578. exitPointerLock: function() {
  579. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock, document.exitPointerLock()
  580. },
  581. exitFullscreen: function() {
  582. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  583. },
  584. details: function() {
  585. var t = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  586. return t ? {
  587. name: t[1],
  588. version: parseInt(t[2]),
  589. platform: navigator.platform
  590. } : {}
  591. },
  592. is: function(t) {
  593. return this.details() && this.details()
  594. .name === t
  595. },
  596. inIframe: function() {
  597. return window.parent !== window
  598. },
  599. aspectRatio: function() {
  600. var t = (window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight);
  601. return isFinite(t) ? t : 0
  602. },
  603. userAgent: function() {
  604. return window.navigator.userAgent
  605. },
  606. isMobile: function() {
  607. var t = navigator.userAgent || navigator.vendor || window.opera;
  608. return /(android|bb\d+|meego).+mobile|android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0, 4))
  609. },
  610. isWeixin: function() {
  611. return "micromessenger" == navigator.userAgent.toLowerCase()
  612. .match(/MicroMessenger/i)
  613. },
  614. isSmallScreen: function() {
  615. return screen.width / window.devicePixelRatio < 240
  616. },
  617. detectIE: function() {
  618. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  619. },
  620. detectSafari: function() {
  621. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  622. },
  623. detectFirefox: function() {
  624. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  625. },
  626. detectChrome: function() {
  627. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  628. },
  629. detectOpera: function() {
  630. return -1 !== window.navigator.userAgent.indexOf("OPR")
  631. },
  632. detectIOS: function() {
  633. var t = window.navigator.userAgent;
  634. return /iPad|iPhone|iPod/.test(t)
  635. },
  636. detectAndroid: function() {
  637. return -1 !== window.navigator.userAgent.indexOf("Android")
  638. },
  639. detectAndroidMobile: function() {
  640. var t = window.navigator.userAgent;
  641. return this.detectAndroid() && -1 !== t.indexOf("Mobile")
  642. },
  643. detectSamsungNative: function() {
  644. var t = window.navigator.userAgent;
  645. return -1 !== t.indexOf("SM-G900H") || -1 !== t.indexOf("GT-I9500") || -1 !== t.indexOf("SM-N900")
  646. },
  647. detectSamsungS6: function() {
  648. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  649. },
  650. detectHUAWEI5X: function() {
  651. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  652. },
  653. iosVersion: function() {
  654. if (!this.detectIOS()) throw new r("Did not detect an iDevice");
  655. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  656. },
  657. androidVersion: function() {
  658. if (!this.detectAndroid()) throw new r("Did not detect an Android based device");
  659. return n(/Android ((?:\d+\.?){1,3})/, ".")
  660. },
  661. valueFromCookie: function(t, e) {
  662. var i = new RegExp(t + "=([0-9a-f]+)(; ?|$)")
  663. .exec(document.cookie);
  664. if (!i) return e;
  665. var n = i[1];
  666. return "boolean" == typeof e ? "true" === n || "1" === n : "number" == typeof e ? parseFloat(n) : n
  667. },
  668. valueFromHash: function(t, e) {
  669. var i = new RegExp("[#&?]" + t + "=([^#&?]*)")
  670. .exec(window.location.href);
  671. if (!i) return e;
  672. var n = i[1];
  673. return "boolean" == typeof e ? "true" === n || "1" === n : "number" == typeof e ? parseFloat(n) : window.decodeURIComponent(n)
  674. },
  675. getAllValueFromSearch: function() {
  676. var t = window.location.search,
  677. e = {};
  678. if (-1 !== t.indexOf("?"))
  679. for (var i = t.substr(1)
  680. .split("&"), n = "", r = 0; r < i.length; r++) e[(n = i[r].split("="))[0]] = unescape(n[1]);
  681. return e
  682. },
  683. getQueryString: function(t) {
  684. var e = new RegExp("(^|&)" + t + "=([^&]*)(&|$)", "i"),
  685. i = window.location.search.substr(1)
  686. .match(e);
  687. return null != i ? decodeURI(i[2]) : null
  688. },
  689. is_weixin: function() {
  690. return !!(-1 != navigator.userAgent.toLowerCase()
  691. .indexOf("micromessenger"))
  692. },
  693. getUuid: function() {
  694. function t() {
  695. return (65536 * (1 + Math.random()) | 0)
  696. .toString(16)
  697. .substring(1)
  698. }
  699. return t() + t() + "-" + t() + "-" + t() + "-" + t() + "-" + t() + t() + t()
  700. },
  701. changeURLArg: function(t, e, i) {
  702. var n = e + "=([^&]*)",
  703. r = e + "=" + i;
  704. if (t.match(n)) {
  705. var o = "(" + e + "=)([^&]*)",
  706. a = new RegExp(o, "gi");
  707. return o = t.replace(a, r)
  708. }
  709. return t.match("[?]") ? t + "&" + r : t + "?" + r
  710. }
  711. }
  712. })
  713. .call(this, i(6))
  714. }, function(t, e, i) {
  715. "use strict";
  716. var n, r = "object" == typeof Reflect ? Reflect : null,
  717. o = r && "function" == typeof r.apply ? r.apply : function(t, e, i) {
  718. return Function.prototype.apply.call(t, e, i)
  719. };
  720. n = r && "function" == typeof r.ownKeys ? r.ownKeys : Object.getOwnPropertySymbols ? function(t) {
  721. return Object.getOwnPropertyNames(t)
  722. .concat(Object.getOwnPropertySymbols(t))
  723. } : function(t) {
  724. return Object.getOwnPropertyNames(t)
  725. };
  726. var a = Number.isNaN || function(t) {
  727. return t != t
  728. };
  729. function s() {
  730. s.init.call(this)
  731. }
  732. t.exports = s, t.exports.once = function(t, e) {
  733. return new Promise((function(i, n) {
  734. function r(i) {
  735. t.removeListener(e, o), n(i)
  736. }
  737. function o() {
  738. "function" == typeof t.removeListener && t.removeListener("error", r), i([].slice.call(arguments))
  739. }
  740. v(t, e, o, {
  741. once: !0
  742. }), "error" !== e && function(t, e, i) {
  743. "function" == typeof t.on && v(t, "error", e, i)
  744. }(t, r, {
  745. once: !0
  746. })
  747. }))
  748. }, s.EventEmitter = s, s.prototype._events = void 0, s.prototype._eventsCount = 0, s.prototype._maxListeners = void 0;
  749. var l = 10;
  750. function u(t) {
  751. if ("function" != typeof t) throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof t)
  752. }
  753. function h(t) {
  754. return void 0 === t._maxListeners ? s.defaultMaxListeners : t._maxListeners
  755. }
  756. function c(t, e, i, n) {
  757. var r, o, a;
  758. if (u(i), void 0 === (o = t._events) ? (o = t._events = Object.create(null), t._eventsCount = 0) : (void 0 !== o.newListener && (t.emit("newListener", e, i.listener ? i.listener : i), o = t._events), a = o[e]), void 0 === a) a = o[e] = i, ++t._eventsCount;
  759. else if ("function" == typeof a ? a = o[e] = n ? [i, a] : [a, i] : n ? a.unshift(i) : a.push(i), (r = h(t)) > 0 && a.length > r && !a.warned) {
  760. a.warned = !0;
  761. var s = new Error("Possible EventEmitter memory leak detected. " + a.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
  762. s.name = "MaxListenersExceededWarning", s.emitter = t, s.type = e, s.count = a.length, console && console.warn
  763. }
  764. return t
  765. }
  766. function d() {
  767. if (!this.fired) return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, 0 === arguments.length ? this.listener.call(this.target) : this.listener.apply(this.target, arguments)
  768. }
  769. function p(t, e, i) {
  770. var n = {
  771. fired: !1,
  772. wrapFn: void 0,
  773. target: t,
  774. type: e,
  775. listener: i
  776. },
  777. r = d.bind(n);
  778. return r.listener = i, n.wrapFn = r, r
  779. }
  780. function f(t, e, i) {
  781. var n = t._events;
  782. if (void 0 === n) return [];
  783. var r = n[e];
  784. return void 0 === r ? [] : "function" == typeof r ? i ? [r.listener || r] : [r] : i ? function(t) {
  785. for (var e = new Array(t.length), i = 0; i < e.length; ++i) e[i] = t[i].listener || t[i];
  786. return e
  787. }(r) : g(r, r.length)
  788. }
  789. function m(t) {
  790. var e = this._events;
  791. if (void 0 !== e) {
  792. var i = e[t];
  793. if ("function" == typeof i) return 1;
  794. if (void 0 !== i) return i.length
  795. }
  796. return 0
  797. }
  798. function g(t, e) {
  799. for (var i = new Array(e), n = 0; n < e; ++n) i[n] = t[n];
  800. return i
  801. }
  802. function v(t, e, i, n) {
  803. if ("function" == typeof t.on) n.once ? t.once(e, i) : t.on(e, i);
  804. else {
  805. if ("function" != typeof t.addEventListener) throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof t);
  806. t.addEventListener(e, (function r(o) {
  807. n.once && t.removeEventListener(e, r), i(o)
  808. }))
  809. }
  810. }
  811. Object.defineProperty(s, "defaultMaxListeners", {
  812. enumerable: !0,
  813. get: function() {
  814. return l
  815. },
  816. set: function(t) {
  817. if ("number" != typeof t || t < 0 || a(t)) throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + t + ".");
  818. l = t
  819. }
  820. }), s.init = function() {
  821. void 0 !== this._events && this._events !== Object.getPrototypeOf(this)
  822. ._events || (this._events = Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0
  823. }, s.prototype.setMaxListeners = function(t) {
  824. if ("number" != typeof t || t < 0 || a(t)) throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + t + ".");
  825. return this._maxListeners = t, this
  826. }, s.prototype.getMaxListeners = function() {
  827. return h(this)
  828. }, s.prototype.emit = function(t) {
  829. for (var e = [], i = 1; i < arguments.length; i++) e.push(arguments[i]);
  830. var n = "error" === t,
  831. r = this._events;
  832. if (void 0 !== r) n = n && void 0 === r.error;
  833. else if (!n) return !1;
  834. if (n) {
  835. var a;
  836. if (e.length > 0 && (a = e[0]), a instanceof Error) throw a;
  837. var s = new Error("Unhandled error." + (a ? " (" + a.message + ")" : ""));
  838. throw s.context = a, s
  839. }
  840. var l = r[t];
  841. if (void 0 === l) return !1;
  842. if ("function" == typeof l) o(l, this, e);
  843. else {
  844. var u = l.length,
  845. h = g(l, u);
  846. for (i = 0; i < u; ++i) o(h[i], this, e)
  847. }
  848. return !0
  849. }, s.prototype.addListener = function(t, e) {
  850. return c(this, t, e, !1)
  851. }, s.prototype.on = s.prototype.addListener, s.prototype.prependListener = function(t, e) {
  852. return c(this, t, e, !0)
  853. }, s.prototype.once = function(t, e) {
  854. return u(e), this.on(t, p(this, t, e)), this
  855. }, s.prototype.prependOnceListener = function(t, e) {
  856. return u(e), this.prependListener(t, p(this, t, e)), this
  857. }, s.prototype.removeListener = function(t, e) {
  858. var i, n, r, o, a;
  859. if (u(e), void 0 === (n = this._events)) return this;
  860. if (void 0 === (i = n[t])) return this;
  861. if (i === e || i.listener === e) 0 == --this._eventsCount ? this._events = Object.create(null) : (delete n[t], n.removeListener && this.emit("removeListener", t, i.listener || e));
  862. else if ("function" != typeof i) {
  863. for (r = -1, o = i.length - 1; o >= 0; o--)
  864. if (i[o] === e || i[o].listener === e) {
  865. a = i[o].listener, r = o;
  866. break
  867. } if (r < 0) return this;
  868. 0 === r ? i.shift() : function(t, e) {
  869. for (; e + 1 < t.length; e++) t[e] = t[e + 1];
  870. t.pop()
  871. }(i, r), 1 === i.length && (n[t] = i[0]), void 0 !== n.removeListener && this.emit("removeListener", t, a || e)
  872. }
  873. return this
  874. }, s.prototype.off = s.prototype.removeListener, s.prototype.removeAllListeners = function(t) {
  875. var e, i, n;
  876. if (void 0 === (i = this._events)) return this;
  877. if (void 0 === i.removeListener) return 0 === arguments.length ? (this._events = Object.create(null), this._eventsCount = 0) : void 0 !== i[t] && (0 == --this._eventsCount ? this._events = Object.create(null) : delete i[t]), this;
  878. if (0 === arguments.length) {
  879. var r, o = Object.keys(i);
  880. for (n = 0; n < o.length; ++n) "removeListener" !== (r = o[n]) && this.removeAllListeners(r);
  881. return this.removeAllListeners("removeListener"), this._events = Object.create(null), this._eventsCount = 0, this
  882. }
  883. if ("function" == typeof(e = i[t])) this.removeListener(t, e);
  884. else if (void 0 !== e)
  885. for (n = e.length - 1; n >= 0; n--) this.removeListener(t, e[n]);
  886. return this
  887. }, s.prototype.listeners = function(t) {
  888. return f(this, t, !0)
  889. }, s.prototype.rawListeners = function(t) {
  890. return f(this, t, !1)
  891. }, s.listenerCount = function(t, e) {
  892. return "function" == typeof t.listenerCount ? t.listenerCount(e) : m.call(t, e)
  893. }, s.prototype.listenerCount = m, s.prototype.eventNames = function() {
  894. return this._eventsCount > 0 ? n(this._events) : []
  895. }
  896. }, function(t, e, i) {
  897. var n = i(100);
  898. t.exports = {
  899. PANORAMA: "panorama",
  900. DOLLHOUSE: "dollhouse",
  901. FLOORPLAN: "floorplan",
  902. MESH: "mesh",
  903. OUTDOOR: "outdoor",
  904. TRANSITIONING: "transitioning",
  905. toInt: function(t) {
  906. switch (t) {
  907. case this.PANORAMA:
  908. return 1;
  909. case this.DOLLHOUSE:
  910. return 2;
  911. case this.FLOORPLAN:
  912. return 3;
  913. case this.OUTDOOR:
  914. return 4;
  915. case this.TRANSITIONING:
  916. return -1
  917. }
  918. throw new n("No known conversion for Viewmode to int for mode: " + t)
  919. },
  920. fromInt: function(t) {
  921. switch (t) {
  922. case "1":
  923. case 1:
  924. return this.PANORAMA;
  925. case "2":
  926. case 2:
  927. return this.DOLLHOUSE;
  928. case "3":
  929. case 3:
  930. return this.FLOORPLAN;
  931. case "4":
  932. case 4:
  933. return this.OUTDOOR
  934. }
  935. throw new n("No known conversion for int to viewmode for int: " + t)
  936. },
  937. convertWorkshopModeInt: function(t) {
  938. switch (t) {
  939. case "0":
  940. case 0:
  941. return this.PANORAMA;
  942. case "1":
  943. case 1:
  944. return this.FLOORPLAN;
  945. case "2":
  946. case 2:
  947. return this.DOLLHOUSE;
  948. case "3":
  949. case 3:
  950. return this.MESH
  951. }
  952. throw new n("No known conversion for Workshop int to viewmode for int: " + t)
  953. }
  954. }
  955. }, function(t, e, i) {
  956. // jquery 3.7.0
  957. }, function(t, e, i) {
  958. var n = i(0);
  959. t.exports = {
  960. normalizeUrl: function(t) {
  961. return t.replace("https://", "http://")
  962. },
  963. domainFromUrl: function(t) {
  964. var e = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(t);
  965. return e ? e[3] : t
  966. },
  967. average: function(t, e) {
  968. if (0 === t.length) return null;
  969. for (var i = 0, n = 0, r = 0; r < t.length; r++) {
  970. i += e ? t[r][e] : t[r], n++
  971. }
  972. return i / n
  973. },
  974. countUnique: function(t) {
  975. for (var e = {}, i = 0; i < t.length; i++) e[t[i]] = 1 + (e[t[i]] || 0);
  976. return Object.keys(e)
  977. .length
  978. },
  979. averageVectors: function(t, e) {
  980. var i = new n.Vector3;
  981. if (0 === t.length) return i;
  982. for (var r = 0, o = 0; o < t.length; o++) {
  983. var a = e ? t[o][e] : t[o];
  984. i.add(a), r++
  985. }
  986. return i.divideScalar(r)
  987. },
  988. equalLists: function(t, e) {
  989. if (t.length !== e.length) return !1;
  990. for (var i = 0; i < t.length; i++)
  991. if (t[i] !== e[i]) return !1;
  992. return !0
  993. },
  994. lowerMedian: function(t, e) {
  995. return 0 === t.length ? null : (e = e || 2, t.sort((function(t, e) {
  996. return t - e
  997. })), t[Math.floor(t.length / e)])
  998. },
  999. stableSort: function(t, e) {
  1000. return t.map((function(t, e) {
  1001. return {
  1002. value: t,
  1003. index: e
  1004. }
  1005. }))
  1006. .sort((function(t, i) {
  1007. var n = e(t.value, i.value);
  1008. return 0 !== n ? n : t.index - i.index
  1009. }))
  1010. .map((function(t) {
  1011. return t.value
  1012. }))
  1013. },
  1014. filterAll: function(t, e) {
  1015. return t.filter((function(t) {
  1016. return e.every((function(e) {
  1017. return e(t)
  1018. }))
  1019. }))
  1020. },
  1021. formatDate: function(t) {
  1022. return [t.getFullYear(), t.getMonth() + 1, t.getDate()].join("-")
  1023. },
  1024. formatDatetime: function(t) {
  1025. return [t.getFullYear(), t.getMonth() + 1, t.getDate(), t.getHours(), t.getMinutes()].join("-")
  1026. },
  1027. randomString: function(t) {
  1028. for (var e = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < t; n++) e += i.charAt(Math.floor(Math.random() * i.length));
  1029. return e
  1030. },
  1031. nth: function(t) {
  1032. return 1 == (t %= 10) ? t + "st" : 2 == t ? t + "nd" : 3 == t ? t + "rd" : t + "th"
  1033. },
  1034. extendObject: function(t, e) {
  1035. return Object.keys(e)
  1036. .forEach((function(i) {
  1037. t[i] = e[i]
  1038. })), t
  1039. },
  1040. deepExtend: function t(e) {
  1041. e = e || {};
  1042. for (var i = 1; i < arguments.length; i++) {
  1043. var n = arguments[i];
  1044. if (n)
  1045. for (var r in n) n.hasOwnProperty(r) && ("object" == typeof n[r] ? e[r] = t(e[r], n[r]) : e[r] = n[r])
  1046. }
  1047. return e
  1048. },
  1049. inherit: function(t, e) {
  1050. t.prototype = Object.create(e.prototype), t.prototype.constructor = t
  1051. },
  1052. extend: function(t, e) {
  1053. for (var i in e.prototype) t.prototype[i] = e.prototype[i]
  1054. }
  1055. }, Math.sign = function(t) {
  1056. return t < 0 ? -1 : 1
  1057. }
  1058. }, function(t, e, i) {
  1059. var n = i(15);
  1060. t.exports = {
  1061. globalDone: null,
  1062. funcs: [],
  1063. counter: 0,
  1064. uniqueID: 0,
  1065. start: function(t, e, i, r, o, a, s) {
  1066. return r = r || 0, this.funcs.push({
  1067. func: t,
  1068. current: -r * Math.abs(e),
  1069. duration: (1 - Math.max(r, 0)) * Math.abs(e),
  1070. done: i,
  1071. easing: o || n.linearTween,
  1072. cycling: e < 0,
  1073. running: !0,
  1074. debug: r < 0,
  1075. name: a || "T" + this.counter,
  1076. id: void 0 === s ? this.counter : s,
  1077. paused: !1
  1078. }), t(0, 16), this.counter += 1, t
  1079. },
  1080. trigger: function(t) {
  1081. var e = void 0 === t.delayRatio ? 0 : t.delayRatio,
  1082. i = t.func || function() {},
  1083. r = void 0 === t.duration ? 0 : t.duration;
  1084. void 0 !== t.cycling && t.cycling && (r = -Math.abs(r));
  1085. var o = t.done || null,
  1086. a = t.easing || n.linearTween,
  1087. s = t.name || "R" + this.counter,
  1088. l = void 0 === t.id ? this.counter : t.id;
  1089. return this.start(i, r, o, e, a, s, l)
  1090. },
  1091. setTimeout: function(t, e, i) {
  1092. var n = void 0 === i ? this.counter : i;
  1093. return this.trigger({
  1094. done: t,
  1095. duration: void 0 === e ? 0 : e,
  1096. name: "O" + this.counter,
  1097. id: n
  1098. })
  1099. },
  1100. pause: function() {
  1101. this.paused = !0
  1102. },
  1103. resume: function() {
  1104. this.paused = !1
  1105. },
  1106. update: function(t) {
  1107. this.funcs.forEach((function(e) {
  1108. if (!(e.paused || (e.current += 1e3 * t, e.current < 0)))
  1109. if (e.current >= e.duration && !e.cycling) {
  1110. var i = e.easing(1, 0, 1, 1);
  1111. e.func(i, 1e3 * t), e.done && e.done(), e.running = !1
  1112. } else {
  1113. var n = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  1114. (e.func(n, 1e3 * t) || !1) && (e.done && e.done(), e.running = !1)
  1115. }
  1116. }));
  1117. var e = this.funcs.length;
  1118. this.funcs = this.funcs.filter((function(t) {
  1119. return t.running
  1120. }));
  1121. var i = this.funcs.length;
  1122. if (e > 0 && 0 === i && this.globalDone) {
  1123. var n = this.globalDone;
  1124. this.globalDone = null, n()
  1125. }
  1126. },
  1127. adjustSpeed: function(t, e) {
  1128. var i = this.get(t);
  1129. i && (i.duration /= e, i.current /= e)
  1130. },
  1131. getById: function(t) {
  1132. return this.funcs.filter((function(e) {
  1133. return t === e.id
  1134. }))
  1135. },
  1136. get: function(t) {
  1137. for (var e = 0; e < this.funcs.length; e += 1)
  1138. if (this.funcs[e].func == t) return this.funcs[e];
  1139. return null
  1140. },
  1141. isRunning: function(t) {
  1142. var e = this.get(t);
  1143. return null !== e && e.running
  1144. },
  1145. countActive: function() {
  1146. for (var t = 0, e = 0; e < this.funcs.length; e += 1) t += this.funcs[e].running;
  1147. return t
  1148. },
  1149. listActive: function() {
  1150. for (var t = [], e = 0; e < this.funcs.length; e += 1) this.funcs[e].running && t.push(this.funcs[e].name);
  1151. return t
  1152. },
  1153. done: function(t) {
  1154. this.globalDone = t
  1155. },
  1156. cancelById: function(t) {
  1157. var e = void 0 === t ? 0 : t;
  1158. this.funcs = this.funcs.filter((function(t) {
  1159. return t.id !== e
  1160. }))
  1161. },
  1162. cancel: function(t) {
  1163. this.funcs = this.funcs.filter((function(e) {
  1164. return e.func !== t
  1165. }))
  1166. },
  1167. getUniqueId: function() {
  1168. return this.uniqueID -= 1, this.uniqueID
  1169. }
  1170. }
  1171. }, function(t, e, i) {
  1172. var n = i(0);
  1173. t.exports = {
  1174. convertVisionVector: function(t) {
  1175. return new n.Vector3(t.x, t.z, -t.y)
  1176. },
  1177. convertVisionQuaternion: function(t) {
  1178. return new n.Quaternion(t.x, t.z, -t.y, t.w)
  1179. .multiply((new n.Quaternion)
  1180. .setFromAxisAngle(new n.Vector3(0, 1, 0), n.Math.degToRad(90)))
  1181. },
  1182. convertVisionQuaternionAutoScene: function(t) {
  1183. return new n.Quaternion(t.x, t.y, t.z, t.w)
  1184. .multiply((new n.Quaternion)
  1185. .setFromAxisAngle(new n.Vector3(0, 1, 0), n.Math.degToRad(-90)))
  1186. },
  1187. convertWorkshopVector: function(t) {
  1188. return new n.Vector3(-t.x, t.y, t.z)
  1189. },
  1190. convertWorkshopQuaternion: function(t) {
  1191. return new n.Quaternion(-t.x, t.y, t.z, -t.w)
  1192. .multiply(new n.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0))
  1193. },
  1194. convertWorkshopPanoramaQuaternion: function(t) {
  1195. return new n.Quaternion(t.x, -t.y, -t.z, t.w)
  1196. .normalize()
  1197. .multiply((new n.Quaternion)
  1198. .setFromAxisAngle(new n.Vector3(0, 1, 0), n.Math.degToRad(270)))
  1199. },
  1200. convertWorkshopOrthoZoom: function(t) {
  1201. return -1 === t ? -1 : t / 4
  1202. },
  1203. toPrecision: function(t, e) {
  1204. var i = Math.pow(10, e);
  1205. return Math.round(t * i) / i
  1206. },
  1207. projectPositionToCanvas: function(t, e, i) {
  1208. (i = i || new n.Vector3)
  1209. .copy(t);
  1210. var r = .5 * (window.renderWidth || window.innerWidth),
  1211. o = .5 * (window.renderHeight || window.innerHeight);
  1212. return i.project(e), i.x = i.x * r + r, i.y = -i.y * o + o, i
  1213. },
  1214. convertScreenPositionToNDC: function(t, e, i) {
  1215. return (i = i || new n.Vector2)
  1216. .x = t / (window.renderWidth || window.innerWidth) * 2 - 1, i.y = -e / (window.renderHeight || window.innerHeight) * 2 + 1, i
  1217. },
  1218. constrainedTurn: function(t) {
  1219. var e = t % (2 * Math.PI);
  1220. return e > Math.PI ? e -= 2 * Math.PI : e < -Math.PI ? e += 2 * Math.PI : e
  1221. },
  1222. getFOVDotThreshold: function(t) {
  1223. return Math.cos(n.Math.degToRad(t / 2))
  1224. },
  1225. compareFloats: function(t, e) {
  1226. return Math.abs(t - e) < Number.EPSILON * Math.pow(2, 45)
  1227. },
  1228. convertWorldPositionToScreen: function(t, e) {
  1229. var i = t.clone()
  1230. .project(e),
  1231. n = (window.renderWidth || window.innerWidth) / 2,
  1232. r = (window.renderHeight || window.innerHeight) / 2;
  1233. return {
  1234. x: ~~(i.x * n + n),
  1235. y: ~~(-i.y * r + r)
  1236. }
  1237. },
  1238. getVerticesOfItemSize: function(t) {
  1239. for (var e = t.attributes.position, i = e.itemSize, r = [], o = {}, a = 0, s = e.array.length; a < s; a += i) {
  1240. var l = e.array[a],
  1241. u = e.array[a + 1],
  1242. h = e.array[a + 2],
  1243. c = "k_" + l + "_" + u + "_" + h;
  1244. void 0 === o[c] && (r.push(new n.Vector3(l, u, h)), o[c] = 1)
  1245. }
  1246. return r
  1247. },
  1248. computeWorldPositionOutCamera: function(t, e) {
  1249. var i = (t = t.clone())
  1250. .applyMatrix4(e.matrixWorldInverse)
  1251. .applyMatrix4(e.projectionMatrix),
  1252. n = Math.abs(i.x) > 1,
  1253. r = Math.abs(i.y) > 1,
  1254. o = Math.abs(i.z) > 1;
  1255. return !!(n || r || o)
  1256. },
  1257. hexToRGB: function(t) {
  1258. return "rgb(" + ((t = t.replace("#", "0x")) >> 16) + "," + (t >> 8 & 255) + "," + (255 & t) + ")"
  1259. },
  1260. RGBToHex: function(t) {
  1261. var e = t.split(/[^\d]+/);
  1262. return "#" + (e[1] << 16 | e[2] << 8 | e[3])
  1263. .toString(16)
  1264. },
  1265. toFixed: function(t, e) {
  1266. var i = (t += "")
  1267. .indexOf(".");
  1268. return t = -1 !== i ? t.substring(0, e + i + 1) : t.substring(0), parseFloat(t)
  1269. .toFixed(e)
  1270. }
  1271. }
  1272. }, function(t, e) {
  1273. t.exports = {
  1274. vector: function(t, e) {
  1275. var i = t.clone();
  1276. return e = e.clone(),
  1277. function(n) {
  1278. t.set(i.x * (1 - n) + e.x * n, i.y * (1 - n) + e.y * n, i.z * (1 - n) + e.z * n)
  1279. }
  1280. },
  1281. quaternion: function(t, e) {
  1282. var i = t.clone();
  1283. return function(n) {
  1284. t.copy(i)
  1285. .slerp(e, n)
  1286. }
  1287. },
  1288. property: function(t, e, i, n) {
  1289. var r = t[e];
  1290. return function(o) {
  1291. t[e] = r * (1 - o) + i * o, n && n(t[e])
  1292. }
  1293. },
  1294. uniform: function(t, e, i) {
  1295. var n = t.material.uniforms[e].value;
  1296. return function(r) {
  1297. t.material.uniforms[e] && (t.material.uniforms[e].value = n * (1 - r) + i * r)
  1298. }
  1299. },
  1300. matrix4: function(t, e) {
  1301. var i = t.clone();
  1302. return function(n) {
  1303. for (var r = t.elements, o = i.elements, a = e.elements, s = 0; s < 16; s++) r[s] = o[s] * (1 - n) + a[s] * n
  1304. }
  1305. },
  1306. allUniforms: function(t, e, i) {
  1307. var n = t.map(function(t) {
  1308. return this.uniform(t, e, i)
  1309. }.bind(this));
  1310. return function(t) {
  1311. n.forEach((function(e) {
  1312. e(t)
  1313. }))
  1314. }
  1315. }
  1316. }
  1317. }, function(t, e, i) {
  1318. (function(e) {
  1319. (function(n) {
  1320. function r(t, i, n) {
  1321. function a() {
  1322. o.warn("Retrying ", i), r(t, i, n)
  1323. .done(l.resolve.bind(l))
  1324. .progress(l.notify.bind(l))
  1325. .fail(l.reject.bind(l))
  1326. }
  1327. var s = function(t, e, i) {
  1328. var n = new XMLHttpRequest;
  1329. if (i && "withCredentials" in n) n.open(t, e, i);
  1330. else if ("undefined" != typeof XDomainRequest)(n = new XDomainRequest)
  1331. .open(t, e);
  1332. else {
  1333. if (i) throw "Browser does not support CORS!";
  1334. n.open(t, e)
  1335. }
  1336. return n
  1337. }(t, i, !1);
  1338. if ((n = n || {})
  1339. .retries = void 0 !== n.retries ? n.retries : 0, n.retry = void 0 !== n.retry ? n.retry : "get" === t.toLowerCase(), n.responseType)
  1340. if (["arraybuffer", "text", "json"].indexOf(n.responseType) > -1) s.responseType = n.responseType;
  1341. else {
  1342. if ("image/jpeg" !== n.responseType) throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  1343. s.responseType = "arraybuffer"
  1344. }
  1345. "json" === n.responseType && s.setRequestHeader("Accept", "application/json"), n.auth && s.setRequestHeader("Authorization", n.auth), "object" == typeof n.data && (n.data = JSON.stringify(n.data), s.setRequestHeader("Content-Type", "application/json"));
  1346. var l = e.Deferred();
  1347. return s.onreadystatechange = function(t) {
  1348. if (4 == this.readyState)
  1349. if (this.status >= 500 && this.status <= 600 && n.retry && n.retries < 3) n.retries++, setTimeout(a, 1e3);
  1350. else if (200 == this.status) {
  1351. var e = function(t, e) {
  1352. var i = t.response;
  1353. if ("json" === e && "object" != typeof i) try {
  1354. i = JSON.parse(t.responseText)
  1355. } catch (t) {
  1356. return void l.reject({
  1357. error: "Failed parsing JSON"
  1358. })
  1359. } else if ("image/jpeg" === e) {
  1360. var n = new Uint8Array(t.response),
  1361. r = new Blob([n], {
  1362. type: "image/jpeg"
  1363. }),
  1364. o = URL.createObjectURL(r);
  1365. (i = new Image)
  1366. .src = o, i.crossOrigin = "Anonymous", i.onload = function() {
  1367. URL.revokeObjectURL(o)
  1368. }
  1369. } return i
  1370. }(this, n.responseType);
  1371. l.resolve(e)
  1372. } else l.reject(this)
  1373. }, s.onprogress = function(t) {
  1374. l.notify(t)
  1375. }, s.send(n.data), l.promise()
  1376. }
  1377. var o = new(i(2))(n);
  1378. window.URL = window.URL || window.webkitURL, window.REQUEST_CACHE = window.REQUEST_CACHE || {}, G.basic = window.PREFETCHED_MODELDATA, window.PREFETCHED_MODELDATA = window.PREFETCHED_MODELDATA || {}, setTimeout((function() {
  1379. window.REQUEST_CACHE = null, window.PREFETCHED_MODELDATA = {}
  1380. }), 6e4), window.onpageshow = function(t) {
  1381. t.persisted && (window.REQUEST_CACHE = null, window.PREFETCHED_MODELDATA = {})
  1382. }, t.exports = {
  1383. get: function(t, i) {
  1384. var n, o;
  1385. if (s = void 0 === (i = i || {})
  1386. .cache || i.cache) {
  1387. var a = (n = t, window.REQUEST_CACHE ? window.REQUEST_CACHE[n] : null);
  1388. if (a) return a
  1389. }
  1390. var s = i.fetchNum;
  1391. return o = 1 === i.fetchNum && i.prefetchFrom && window.PREFETCHED_MODELDATA[i.prefetchFrom] ? e.when(window.PREFETCHED_MODELDATA[i.prefetchFrom]) : 2 === i.fetchNum && i.prefetchFrom && window.PREFETCHED_MODELDATA[i.prefetchFrom][i.prefetchFrom2] ? e.when(window.PREFETCHED_MODELDATA[i.prefetchFrom][i.prefetchFrom2]) : 3 === i.fetchNum && i.prefetchFrom && window.PREFETCHED_MODELDATA[i.prefetchFrom][i.prefetchFrom2][i.prefetchFrom3] ? e.when(window.PREFETCHED_MODELDATA[i.prefetchFrom][i.prefetchFrom2][i.prefetchFrom3]) : r("GET", t, i), s && function(t, e) {
  1392. window.REQUEST_CACHE && (window.REQUEST_CACHE[t] = e)
  1393. }(t, o), o
  1394. },
  1395. post: function(t, e) {
  1396. return r("POST", t, e)
  1397. },
  1398. patch: function(t, e) {
  1399. return r("PATCH", t, e)
  1400. },
  1401. getImage: function(t, i) {
  1402. function n() {
  1403. o.warn("Retrying ", t), s.getImage(t, i - 1)
  1404. .done(r.resolve.bind(r))
  1405. .progress(r.notify.bind(r))
  1406. .fail(r.reject.bind(r))
  1407. }
  1408. var r = e.Deferred(),
  1409. a = new Image,
  1410. s = this;
  1411. return null != i || (i = 3), a.onerror = function() {
  1412. i > 0 ? setTimeout(n, 1e3) : r.reject()
  1413. }, a.onload = function() {
  1414. r.resolve(a)
  1415. }, a.crossOrigin = "anonymous", a.src = t, r
  1416. }
  1417. }
  1418. })
  1419. .call(this, "/js/util/ajax.js")
  1420. })
  1421. .call(this, i(6))
  1422. }, function(t, e, i) {
  1423. "use strict";
  1424. var n = i(0),
  1425. r = i(1),
  1426. o = "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",
  1427. a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  1428. t.exports = {
  1429. basicTextured: {
  1430. uniforms: {
  1431. tDiffuse: {
  1432. type: "t",
  1433. value: null
  1434. },
  1435. alpha: {
  1436. type: "f",
  1437. value: 1
  1438. }
  1439. },
  1440. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  1441. fragmentShader: "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}"
  1442. },
  1443. copyCubeMap: {
  1444. uniforms: {
  1445. tDiffuse: {
  1446. type: "t",
  1447. value: null
  1448. },
  1449. alpha: {
  1450. type: "f",
  1451. value: 1
  1452. }
  1453. },
  1454. vertexShader: "varying vec3 vWorldPos;\nvoid main() {\n vWorldPos = vec3(-position.x, -position.y, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  1455. fragmentShader: "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}"
  1456. },
  1457. cube: {
  1458. uniforms: {
  1459. map: {
  1460. type: "t",
  1461. value: null
  1462. },
  1463. opacity: {
  1464. type: "f",
  1465. value: 1
  1466. }
  1467. },
  1468. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  1469. fragmentShader: a + "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"
  1470. },
  1471. model: {
  1472. uniforms: {
  1473. map: {
  1474. type: "t",
  1475. value: null
  1476. },
  1477. modelAlpha: {
  1478. type: "f",
  1479. value: r.modelAlpha
  1480. },
  1481. opacity: {
  1482. type: "f",
  1483. value: 1
  1484. },
  1485. progress: {
  1486. type: "f",
  1487. value: 0
  1488. },
  1489. blackout: {
  1490. type: "i",
  1491. value: 0
  1492. },
  1493. pano0Map: {
  1494. type: "t",
  1495. value: null
  1496. },
  1497. pano0Position: {
  1498. type: "v3",
  1499. value: new n.Vector3
  1500. },
  1501. pano0Matrix: {
  1502. type: "m4",
  1503. value: new n.Matrix4
  1504. },
  1505. pano1Map: {
  1506. type: "t",
  1507. value: null
  1508. },
  1509. pano1Position: {
  1510. type: "v3",
  1511. value: new n.Vector3
  1512. },
  1513. pano1Matrix: {
  1514. type: "m4",
  1515. value: new n.Matrix4
  1516. },
  1517. measureMode: {
  1518. type: "i",
  1519. value: 0
  1520. },
  1521. mouseAPosition: {
  1522. type: "v2",
  1523. value: new n.Vector2
  1524. },
  1525. centerT: {
  1526. type: "v3",
  1527. value: new n.Vector3
  1528. },
  1529. centerB: {
  1530. type: "v3",
  1531. value: new n.Vector3
  1532. },
  1533. virtualCameraAngle: {
  1534. type: "f",
  1535. value: 0
  1536. }
  1537. },
  1538. vertexShader: o + ["uniform vec3 pano0Position;", "uniform mat4 pano0Matrix;", "uniform vec3 pano1Position;", "uniform mat4 pano1Matrix;", "varying vec2 vUv;", "varying vec3 vWorldPosition;", "varying vec3 vWorldPosition0;", "varying vec3 vWorldPosition1;", "void main() {", "vUv = uv;", "vec4 worldPosition = modelMatrix * vec4(position, 1.0);", "vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;", "vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;", "vWorldPosition = position.xyz;", "vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;", "vWorldPosition0.x *= -1.0;", "vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;", "vWorldPosition1.x *= -1.0;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  1539. fragmentShader: a + ["uniform sampler2D map;", "uniform float modelAlpha;", "uniform float opacity;", "uniform float progress;", "uniform int blackout;", "uniform vec3 pano0Position;", "uniform samplerCube pano0Map;", "uniform vec3 pano1Position;", "uniform samplerCube pano1Map;", "uniform vec2 mouseAPosition;", "uniform vec2 mousePosition;\nuniform bool measureMode;\nuniform vec3 centerT;", "uniform vec3 centerB;", "uniform float virtualCameraAngle;", "varying vec2 vUv;", "varying vec3 vWorldPosition;", "varying vec3 vWorldPosition0;", "varying vec3 vWorldPosition1;", "void main() {", "const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);", "const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);", "const vec4 GREEN = vec4(0.0, 1.0, 0.0, 1.0);", "vec4 colorFromPanos;", "vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);", "vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);", "vec4 colorFromTexture = texture2D( map, vUv );", "if (blackout == 0) {", "colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);", "} else if (blackout == 1) {", "colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));", "colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));", "} else if (blackout == 2) {", "colorFromPanos = mix(colorFromPano0, BLACK, progress);", "} else if (blackout == 3) {", "colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));", "}", "if (measureMode && distance(mouseAPosition, gl_FragCoord.xy) < 80.0) {", "colorFromPanos = mix(colorFromPanos, colorFromTexture, 1.0);", "} else {", "colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);", "}", "vec3 centerT_vW = normalize(vec3(vWorldPosition.x - centerT.x, vWorldPosition.y - centerT.y, vWorldPosition.z - centerT.z));", "vec3 centerT_B = normalize(vec3(centerB.x - centerT.x, centerB.y - centerT.y, centerB.z - centerT.z ));", "float angle = acos(dot(centerT_vW, centerT_B));", "float cosine = cos(virtualCameraAngle);", "float cosineV = distance(centerT, centerB) / distance(centerT, vWorldPosition);", "bool condition1 = (angle < virtualCameraAngle);", "bool condition2 = (cosineV >= cosine && cosineV <= 1.0);", "if ( condition1 ) {", "colorFromPanos = mix(GREEN, colorFromPanos, 0.8);", "}", "float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);", "colorFromPanos = mix(colorFromPanos, GREY, whiteness);", "gl_FragColor = vec4(colorFromPanos.rgb, opacity);", "}"].join("\n")
  1540. },
  1541. model2: {
  1542. uniforms: {
  1543. map: {
  1544. type: "t",
  1545. value: null
  1546. },
  1547. modelAlpha: {
  1548. type: "f",
  1549. value: r.modelAlpha
  1550. },
  1551. opacity: {
  1552. type: "f",
  1553. value: 1
  1554. },
  1555. progress: {
  1556. type: "f",
  1557. value: 0
  1558. },
  1559. blackout: {
  1560. type: "i",
  1561. value: 0
  1562. },
  1563. pano0Map: {
  1564. type: "t",
  1565. value: null
  1566. },
  1567. pano0Position: {
  1568. type: "v3",
  1569. value: new n.Vector3
  1570. },
  1571. pano0Matrix: {
  1572. type: "m4",
  1573. value: new n.Matrix4
  1574. },
  1575. pano1Map: {
  1576. type: "t",
  1577. value: null
  1578. },
  1579. pano1Position: {
  1580. type: "v3",
  1581. value: new n.Vector3
  1582. },
  1583. pano1Matrix: {
  1584. type: "m4",
  1585. value: new n.Matrix4
  1586. },
  1587. hue0: {
  1588. type: "f",
  1589. value: 0
  1590. },
  1591. saturation0: {
  1592. type: "f",
  1593. value: 0
  1594. },
  1595. brightness0: {
  1596. type: "f",
  1597. value: 0
  1598. },
  1599. contrast0: {
  1600. type: "f",
  1601. value: 0
  1602. },
  1603. gamma0: {
  1604. type: "f",
  1605. value: 1
  1606. },
  1607. vibrance0: {
  1608. type: "f",
  1609. value: 0
  1610. },
  1611. balance0: {
  1612. type: "v3",
  1613. value: new n.Vector3
  1614. },
  1615. hue1: {
  1616. type: "f",
  1617. value: 0
  1618. },
  1619. saturation1: {
  1620. type: "f",
  1621. value: 0
  1622. },
  1623. brightness1: {
  1624. type: "f",
  1625. value: 0
  1626. },
  1627. contrast1: {
  1628. type: "f",
  1629. value: 0
  1630. },
  1631. gamma1: {
  1632. type: "f",
  1633. value: 1
  1634. },
  1635. vibrance1: {
  1636. type: "f",
  1637. value: 0
  1638. },
  1639. balance1: {
  1640. type: "v3",
  1641. value: new n.Vector3
  1642. },
  1643. base: {
  1644. type: "f",
  1645. value: 2
  1646. },
  1647. measureMode: {
  1648. type: "i",
  1649. value: 0
  1650. },
  1651. mouseAPosition: {
  1652. type: "v2",
  1653. value: new n.Vector2
  1654. }
  1655. },
  1656. 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",
  1657. 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;\nuniform vec2 mousePosition;\nuniform int isEditVersion;\nuniform float hue0;\nuniform float saturation0;\nuniform float brightness0;\nuniform float contrast0;\nuniform float gamma0;\nuniform float vibrance0;\nuniform float hue1;\nuniform vec3 balance0;\nuniform float saturation1;\nuniform float brightness1;\nuniform float contrast1;\nuniform float gamma1;\nuniform float vibrance1;\nuniform vec3 balance1;\nuniform float base;\n\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\n\nfloat bcolor( in float value, in float b ) {\n\treturn max(min(value * pow(base, b), 1.0), 0.0);\n}\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\tfloat hue = mix(hue0, hue1, progress);\n\tfloat gamma = mix(gamma0, gamma1, progress);\n\tfloat brightness = mix(brightness0, brightness1, progress);\n\tfloat contrast = mix(contrast0, contrast1, progress);\n\tfloat saturation = mix(saturation0, saturation1, progress);\n\tfloat vibrance = mix(vibrance0, vibrance1, progress);\n\tvec3 balance = mix(balance0, balance1, progress);\n\tgl_FragColor.r = bcolor(gl_FragColor.r, balance.x);\n\tgl_FragColor.g = bcolor(gl_FragColor.g, balance.y);\n\tgl_FragColor.b = bcolor(gl_FragColor.b, balance.z);\n\tif (hue!=0.0){\n float angle = hue * 3.14159265;\n float s = sin(angle), c = cos(angle);\n vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;\n float len = length(gl_FragColor.rgb);\n gl_FragColor.rgb = vec3(\n dot(gl_FragColor.rgb, weights.xyz),\n dot(gl_FragColor.rgb, weights.zxy),\n dot(gl_FragColor.rgb, weights.yzx)\n );\n }\n if (saturation!=0.0){\n float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;\n if (saturation > 0.0) {\n gl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));\n } else {\n gl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);\n }\n\t}\n gl_FragColor.rgb += brightness;\n if (contrast!=0.0){\n if (contrast > 0.0) {\n gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;\n } else {\n gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;\n }\n\t}\n if (vibrance!=0.0){\n float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;\n float mx = max(gl_FragColor.r, max(gl_FragColor.g, gl_FragColor.b));\n float amt = (mx - average) * (-vibrance * 3.0);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(mx), amt);\n }\n if (gamma!=1.0){\n gl_FragColor = LinearToGamma( gl_FragColor, float( gamma ) );\n }\n}\n"
  1658. },
  1659. modelOutside: {
  1660. uniforms: {
  1661. map: {
  1662. type: "t",
  1663. value: null
  1664. },
  1665. opacity: {
  1666. type: "f",
  1667. value: 1
  1668. },
  1669. brightness: {
  1670. type: "f",
  1671. value: 0
  1672. }
  1673. },
  1674. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  1675. fragmentShader: a + "uniform sampler2D map;\nuniform float opacity;\nuniform float brightness;\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"
  1676. },
  1677. ribbon: {
  1678. uniforms: {
  1679. map: {
  1680. type: "t",
  1681. value: null
  1682. },
  1683. opacity: {
  1684. type: "f",
  1685. value: 1
  1686. },
  1687. color: {
  1688. type: "c",
  1689. value: new n.Color(r.path.color)
  1690. }
  1691. },
  1692. vertexShader: o + "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",
  1693. fragmentShader: a + "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"
  1694. },
  1695. waypoint: {
  1696. uniforms: {
  1697. map: {
  1698. type: "t",
  1699. value: null
  1700. },
  1701. opacity: {
  1702. type: "f",
  1703. value: 1
  1704. },
  1705. pulse: {
  1706. type: "f",
  1707. value: 1
  1708. },
  1709. nearFade: {
  1710. type: "v2",
  1711. value: new n.Vector2(2 * r.insideNear, 2 * r.path.waypointIndoorRadius)
  1712. },
  1713. color: {
  1714. type: "c",
  1715. value: new n.Color(r.reticuleColor)
  1716. }
  1717. },
  1718. vertexShader: o + "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",
  1719. fragmentShader: a + "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"
  1720. },
  1721. modelDebug: {
  1722. uniforms: {
  1723. map: {
  1724. type: "t",
  1725. value: null
  1726. },
  1727. modelAlpha: {
  1728. type: "f",
  1729. value: r.modelAlpha
  1730. },
  1731. depthmapRatio: {
  1732. type: "f",
  1733. value: 0
  1734. },
  1735. opacity: {
  1736. type: "f",
  1737. value: 1
  1738. },
  1739. progress: {
  1740. type: "f",
  1741. value: 0
  1742. },
  1743. considerOcclusion: {
  1744. type: "i",
  1745. value: r.fancierTransition
  1746. },
  1747. highlightPanoSelection: {
  1748. type: "i",
  1749. value: 0
  1750. },
  1751. useThirdPano: {
  1752. type: "i",
  1753. value: r.useThirdPano
  1754. },
  1755. pano0Map: {
  1756. type: "t",
  1757. value: null
  1758. },
  1759. pano0Depth: {
  1760. type: "t",
  1761. value: null
  1762. },
  1763. pano0Position: {
  1764. type: "v3",
  1765. value: new n.Vector3
  1766. },
  1767. pano0Matrix: {
  1768. type: "m4",
  1769. value: new n.Matrix4
  1770. },
  1771. pano0Weight: {
  1772. type: "f",
  1773. value: r.transition.pano0Weight
  1774. },
  1775. pano1Map: {
  1776. type: "t",
  1777. value: null
  1778. },
  1779. pano1Depth: {
  1780. type: "t",
  1781. value: null
  1782. },
  1783. pano1Position: {
  1784. type: "v3",
  1785. value: new n.Vector3
  1786. },
  1787. pano1Matrix: {
  1788. type: "m4",
  1789. value: new n.Matrix4
  1790. },
  1791. pano1Weight: {
  1792. type: "f",
  1793. value: r.transition.pano1Weight
  1794. },
  1795. pano2Map: {
  1796. type: "t",
  1797. value: null
  1798. },
  1799. pano2Depth: {
  1800. type: "t",
  1801. value: null
  1802. },
  1803. pano2Position: {
  1804. type: "v3",
  1805. value: new n.Vector3
  1806. },
  1807. pano2Matrix: {
  1808. type: "m4",
  1809. value: new n.Matrix4
  1810. },
  1811. pano2Weight: {
  1812. type: "f",
  1813. value: r.transition.pano2Weight
  1814. }
  1815. },
  1816. vertexShader: o + "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",
  1817. fragmentShader: a + "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"
  1818. },
  1819. customDepth: {
  1820. uniforms: {
  1821. panoPosition: {
  1822. type: "v3",
  1823. value: new n.Vector3
  1824. }
  1825. },
  1826. vertexShader: o + "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",
  1827. fragmentShader: a + "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"
  1828. },
  1829. skysphere: {
  1830. uniforms: {
  1831. radius: {
  1832. type: "f",
  1833. value: 0
  1834. }
  1835. },
  1836. vertexShader: o + "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",
  1837. fragmentShader: a + "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"
  1838. },
  1839. tagDisc: {
  1840. uniforms: {
  1841. opacity: {
  1842. type: "f",
  1843. value: 0
  1844. },
  1845. color: {
  1846. type: "c",
  1847. value: new n.Color
  1848. },
  1849. bg: {
  1850. type: "t",
  1851. value: null
  1852. },
  1853. mask: {
  1854. type: "t",
  1855. value: null
  1856. }
  1857. },
  1858. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  1859. fragmentShader: a + "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"
  1860. }
  1861. }
  1862. }, function(t, e, i) {
  1863. "use strict";
  1864. var n = i(0),
  1865. r = i(9),
  1866. o = [];
  1867. t.exports = {
  1868. drawLine: function(t, e, i) {
  1869. var r = new n.Geometry;
  1870. r.vertices.push(t.clone()), r.vertices.push(e.clone());
  1871. var o = new n.LineBasicMaterial({
  1872. color: i
  1873. });
  1874. return new n.Line(r, o, n.LineSegments)
  1875. },
  1876. initCanvasLabel: function(t, e, i) {
  1877. var r = document.createElement("canvas"),
  1878. o = r.getContext("2d");
  1879. o.font = t.fontSize + "px " + t.fontFace;
  1880. var a = o.measureText(t.text)
  1881. .width + t.fontSize,
  1882. s = t.fontSize + t.fontSize,
  1883. l = s / 10;
  1884. r.width = a, r.height = s, o.lineWidth = 2, o.strokeStyle = e, o.fillStyle = e,
  1885. function(t, e, i, n, r, o) {
  1886. t.beginPath(), t.moveTo(e, i + o), t.lineTo(e, i + r - o), t.quadraticCurveTo(e, i + r, e + o, i + r), t.lineTo(e + n - o, i + r), t.quadraticCurveTo(e + n, i + r, e + n, i + r - o), t.lineTo(e + n, i + o), t.quadraticCurveTo(e + n, i, e + n - o, i), t.lineTo(e + o, i), t.quadraticCurveTo(e, i, e, i + o), t.stroke(), t.fill(), t.closePath()
  1887. }(o, 2, 2, a - 4, s - 4, l),
  1888. function(t, e) {
  1889. t.fillStyle = i, t.font = e.fontSize + "px " + e.fontFace, t.textAlign = "center", t.textBaseline = "middle", t.fillText(e.text, a / 2, s / 2 + 2), t.fillText(e.text, a / 2, s / 2 + 2)
  1890. }(o, t);
  1891. var u = new n.CanvasTexture(r);
  1892. return u.minFilter = n.LinearFilter, u.magFilter = n.LinearFilter, u.needsUpdate = !0, {
  1893. texture: u,
  1894. canvas: r
  1895. }
  1896. },
  1897. drawBoxHelperOfLine2: function(t, e, i) {
  1898. for (var o = r.getVerticesOfItemSize(t.geometry), a = {}, s = 0; s < o.length; ++s) {
  1899. var l = o[s];
  1900. a["v" + s] = [l.x, l.y, l.z]
  1901. }
  1902. var u = new n.LineMaterial({
  1903. color: e,
  1904. linewidth: 2,
  1905. resolution: new n.Vector2(i.width, i.height)
  1906. }),
  1907. h = [a.v0.concat(a.v1)
  1908. .concat(a.v5)
  1909. .concat(a.v4)
  1910. .concat(a.v0), a.v2.concat(a.v3)
  1911. .concat(a.v7)
  1912. .concat(a.v6)
  1913. .concat(a.v2), a.v0.concat(a.v3), a.v1.concat(a.v2), a.v5.concat(a.v6), a.v4.concat(a.v7)
  1914. ],
  1915. c = new n.Group;
  1916. for (s = 0; s < h.length; ++s) {
  1917. var d = new n.LineGeometry;
  1918. d.setPositions(h[s]);
  1919. var p = new n.Line2(d, u);
  1920. c.add(p)
  1921. }
  1922. return c
  1923. },
  1924. drawFatLine: function(t, e, i, r) {
  1925. var o = new n.LineGeometry;
  1926. o.setPositions([t.x, t.y, t.z, e.x, e.y, e.z]);
  1927. var a = new n.LineMaterial({
  1928. color: i,
  1929. linewidth: r,
  1930. resolution: new n.Vector2((window.renderWidth || window.innerWidth), (window.renderHeight || window.innerHeight))
  1931. }),
  1932. s = new n.Line2(o, a);
  1933. return s.computeLineDistances(), s.renderOrder = 99, s.scale.set(1, 1, 1), s
  1934. },
  1935. triggerLimit: function(t) {
  1936. o.push(Date.now() || (new Date)
  1937. .getTime());
  1938. return 2 === o.length && (o[1] - o[0] < t ? (o.pop(), !0) : (o.shift(), !1))
  1939. }
  1940. }
  1941. }, function(t, e) {
  1942. t.exports = function(t) {
  1943. this.message = t
  1944. }
  1945. }, function(t, e) {
  1946. var i = {
  1947. linearTween: function(t, e, i, n) {
  1948. return i * t / n + e
  1949. },
  1950. easeInQuad: function(t, e, i, n) {
  1951. return i * (t /= n) * t + e
  1952. },
  1953. easeOutQuad: function(t, e, i, n) {
  1954. return -i * (t /= n) * (t - 2) + e
  1955. },
  1956. easeInOutQuad: function(t, e, i, n) {
  1957. return (t /= n / 2) < 1 ? i / 2 * t * t + e : -i / 2 * (--t * (t - 2) - 1) + e
  1958. },
  1959. easeInCubic: function(t, e, i, n) {
  1960. return i * (t /= n) * t * t + e
  1961. },
  1962. easeOutCubic: function(t, e, i, n) {
  1963. return t /= n, i * (--t * t * t + 1) + e
  1964. },
  1965. easeInOutCubic: function(t, e, i, n) {
  1966. return (t /= n / 2) < 1 ? i / 2 * t * t * t + e : i / 2 * ((t -= 2) * t * t + 2) + e
  1967. },
  1968. easeInQuart: function(t, e, i, n) {
  1969. return i * (t /= n) * t * t * t + e
  1970. },
  1971. easeOutQuart: function(t, e, i, n) {
  1972. return t /= n, -i * (--t * t * t * t - 1) + e
  1973. },
  1974. easeInOutQuart: function(t, e, i, n) {
  1975. return (t /= n / 2) < 1 ? i / 2 * t * t * t * t + e : -i / 2 * ((t -= 2) * t * t * t - 2) + e
  1976. },
  1977. easeInQuint: function(t, e, i, n) {
  1978. return i * (t /= n) * t * t * t * t + e
  1979. },
  1980. easeOutQuint: function(t, e, i, n) {
  1981. return t /= n, i * (--t * t * t * t * t + 1) + e
  1982. },
  1983. easeInOutQuint: function(t, e, i, n) {
  1984. return (t /= n / 2) < 1 ? i / 2 * t * t * t * t * t + e : i / 2 * ((t -= 2) * t * t * t * t + 2) + e
  1985. },
  1986. easeInSine: function(t, e, i, n) {
  1987. return -i * Math.cos(t / n * (Math.PI / 2)) + i + e
  1988. },
  1989. easeOutSine: function(t, e, i, n) {
  1990. return i * Math.sin(t / n * (Math.PI / 2)) + e
  1991. },
  1992. easeInOutSine: function(t, e, i, n) {
  1993. return -i / 2 * (Math.cos(Math.PI * t / n) - 1) + e
  1994. },
  1995. easeInExpo: function(t, e, i, n) {
  1996. return i * Math.pow(2, 10 * (t / n - 1)) + e
  1997. },
  1998. easeOutExpo: function(t, e, i, n) {
  1999. return i * (1 - Math.pow(2, -10 * t / n)) + e
  2000. },
  2001. easeInOutExpo: function(t, e, i, n) {
  2002. return (t /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (t - 1)) + e : (t--, i / 2 * (2 - Math.pow(2, -10 * t)) + e)
  2003. },
  2004. easeInCirc: function(t, e, i, n) {
  2005. return t /= n, -i * (Math.sqrt(1 - t * t) - 1) + e
  2006. },
  2007. easeOutCirc: function(t, e, i, n) {
  2008. return t /= n, t--, i * Math.sqrt(1 - t * t) + e
  2009. },
  2010. easeInOutCirc: function(t, e, i, n) {
  2011. return (t /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - t * t) - 1) + e : (t -= 2, i / 2 * (Math.sqrt(1 - t * t) + 1) + e)
  2012. },
  2013. easeInElastic: function(t, e, i, n) {
  2014. var r = 1.70158,
  2015. o = 0,
  2016. a = i;
  2017. return 0 === t ? e : 1 == (t /= n) ? e + i : (o || (o = .3 * n), a < Math.abs(i) ? (a = i, r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a), -a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * n - r) * (2 * Math.PI) / o) + e)
  2018. },
  2019. easeOutElastic: function(t, e, i, n) {
  2020. var r = 1.70158,
  2021. o = 0,
  2022. a = i;
  2023. return 0 === t ? e : 1 == (t /= n) ? e + i : (o || (o = .3 * n), a < Math.abs(i) ? (a = i, r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a), a * Math.pow(2, -10 * t) * Math.sin((t * n - r) * (2 * Math.PI) / o) + i + e)
  2024. },
  2025. easeInOutElastic: function(t, e, i, n) {
  2026. var r = 1.70158,
  2027. o = 0,
  2028. a = i;
  2029. return 0 === t ? e : 2 == (t /= n / 2) ? e + i : (o || (o = n * (.3 * 1.5)), a < Math.abs(i) ? (a = i, r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a), t < 1 ? a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * n - r) * (2 * Math.PI) / o) * -.5 + e : a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * n - r) * (2 * Math.PI) / o) * .5 + i + e)
  2030. },
  2031. easeInBack: function(t, e, i, n, r) {
  2032. return void 0 === r && (r = 1.70158), i * (t /= n) * t * ((r + 1) * t - r) + e
  2033. },
  2034. easeOutBack: function(t, e, i, n, r) {
  2035. return void 0 === r && (r = 1.70158), i * ((t = t / n - 1) * t * ((r + 1) * t + r) + 1) + e
  2036. },
  2037. easeInOutBack: function(t, e, i, n, r) {
  2038. return void 0 === r && (r = 1.70158), (t /= n / 2) < 1 ? i / 2 * (t * t * ((1 + (r *= 1.525)) * t - r)) + e : i / 2 * ((t -= 2) * t * ((1 + (r *= 1.525)) * t + r) + 2) + e
  2039. },
  2040. easeOutBounce: function(t, e, i, n) {
  2041. return (t /= n) < 1 / 2.75 ? i * (7.5625 * t * t) + e : t < 2 / 2.75 ? i * (7.5625 * (t -= 1.5 / 2.75) * t + .75) + e : t < 2.5 / 2.75 ? i * (7.5625 * (t -= 2.25 / 2.75) * t + .9375) + e : i * (7.5625 * (t -= 2.625 / 2.75) * t + .984375) + e
  2042. },
  2043. easeInBounce: function(t, e, i, r) {
  2044. return i - n.easeOutBounce(r - t, 0, i, r) + e
  2045. },
  2046. easeInOutBounce: function(t, e, i, r) {
  2047. return t < r / 2 ? .5 * n.easeInBounce(2 * t, 0, i, r) + e : .5 * n.easeOutBounce(x, 2 * t - r, 0, i, r) + .5 * i + e
  2048. }
  2049. };
  2050. t.exports = i
  2051. }, function(t, e, i) {
  2052. var n = i(11),
  2053. r = i(0),
  2054. o = {};
  2055. t.exports = {
  2056. load: function(t, e, i) {
  2057. var a = o[t];
  2058. return a ? (e && setTimeout((function() {
  2059. e(a)
  2060. }), 1), a) : ((a = new r.Texture)
  2061. .sourceFile = t, o[t] = a, n.getImage(t)
  2062. .then((function(t) {
  2063. a.image = t, a.needsUpdate = !0, e && e(a)
  2064. }))
  2065. .fail(i), a)
  2066. },
  2067. loadBase64: function(t, e) {
  2068. e = e || "png";
  2069. var i = new r.Texture;
  2070. return i.image = document.createElement("img"), i.image.setAttribute("src", "data:image/" + e + ";base64," + t), i.needsUpdate = !0, i
  2071. },
  2072. loadurl: function(t) {
  2073. var e = new r.TextureLoader;
  2074. return e.setCrossOrigin(!0), e.load(t)
  2075. },
  2076. loadCanvas: function(t) {
  2077. var e = t.replace(/\s*/g, ""),
  2078. i = new RegExp("^[a-zA-Z]+$"),
  2079. n = "rgba(0,0,0,.4)",
  2080. o = "rgba(0,0,0,.4)";
  2081. (l = (s = document.createElement("canvas"))
  2082. .getContext("2d"))
  2083. .font = "100px Arial";
  2084. var a, s, l, u = l.measureText(t),
  2085. h = (a = i.test(e) ? 1.05 * u.width + 120 : u.width + 60) + 4;
  2086. (l = (s = document.createElement("canvas"))
  2087. .getContext("2d"))
  2088. .canvas.width = h, l.canvas.height = 144, l.font = "Bold 100px Arial",
  2089. function(t, e, i, r, a, s) {
  2090. t.beginPath(), t.moveTo(e + s, i), t.lineWidth = 1, t.strokeStyle = o, t.fillStyle = n, t.arcTo(e + r, i, e + r, i + a, s), t.arcTo(e + r, i + a, e, i + a, s), t.arcTo(e, i + a, e, i, s), t.arcTo(e, i, e + r, i, s), t.stroke(), t.fill(), t.closePath()
  2091. }(l, 1, 1, a + 2, 142, 30), l.fillStyle = "rgba(255,255,255, .85)", i.test(e) ? l.fillText(t, 62, 102) : l.fillText(t, 32, 102);
  2092. var c = new r.Texture(s);
  2093. return c.minFilter = r.LinearFilter, c.magFilter = r.LinearFilter, c.needsUpdate = !0, c
  2094. },
  2095. loadCanvasRe: function(t, e) {
  2096. t.replace(/\s*/g, ""), new RegExp("^[a-zA-Z]+$");
  2097. t = t || "", e = e || "Center";
  2098. var i = document.createElement("canvas"),
  2099. n = i.getContext("2d");
  2100. i.width = 256, i.height = 256;
  2101. n.font = "bold 54px Arial";
  2102. var o = n.measureText(t)
  2103. .width;
  2104. ! function(t, e, i, r, o, a, s, l) {
  2105. n.beginPath(), n.moveTo(t + o, e), n.lineWidth = a, n.strokeStyle = s, n.fillStyle = l, n.arcTo(t + i, e, t + i, e + r, o), n.arcTo(t + i, e + r, t, e + r, o), n.arcTo(t, e + r, t, e, o), n.arcTo(t, e, t + i, e, o), n.stroke(), n.fill(), n.closePath()
  2106. }(5, 87, 246, 100, 30, 0, "rgba(0,0,0,.4)", "rgba(0,0,0,.4)"), n.fillStyle = "rgba(255,255,255,.85)", n.fillText(t, (i.width - o) / 2, (i.height + 54) / 2);
  2107. var a = new r.Texture(i);
  2108. return a.needsUpdate = !0, a
  2109. },
  2110. loadCanvasIn: function(t) {
  2111. var e = 255,
  2112. i = 255,
  2113. n = 255,
  2114. o = .85,
  2115. a = "rgba(0,0,0,.4)",
  2116. s = "rgba(0,0,0,.4)";
  2117. (u = (l = document.createElement("canvas"))
  2118. .getContext("2d"))
  2119. .font = "100px Arial";
  2120. var l, u, h = u.measureText(t)
  2121. .width + 60,
  2122. c = h + 4;
  2123. (u = (l = document.createElement("canvas"))
  2124. .getContext("2d"))
  2125. .canvas.width = c, u.canvas.height = 144, u.font = "Bold 100px Arial",
  2126. function(t, e, i, n, r, o) {
  2127. t.beginPath(), t.moveTo(e + o, i), t.lineWidth = 1, t.strokeStyle = s, t.fillStyle = a, t.arcTo(e + n, i, e + n, i + r, o), t.arcTo(e + n, i + r, e, i + r, o), t.arcTo(e, i + r, e, i, o), t.arcTo(e, i, e + n, i, o), t.stroke(), t.fill(), t.closePath()
  2128. }(u, 1, 1, h + 2, 142, 30), u.fillStyle = "rgba(" + e + "," + i + "," + n + "," + o + ")", u.fillText(t, 32, 102);
  2129. var d = new r.Texture(l);
  2130. return d.minFilter = r.LinearFilter, d.magFilter = r.LinearFilter, d.needsUpdate = !0, d
  2131. },
  2132. isLoaded: function(t) {
  2133. return !!o[t]
  2134. }
  2135. }
  2136. }, function(t, e) {
  2137. t.exports = {
  2138. visibleFloor: 1,
  2139. ghostFloor: 3,
  2140. boundingSkybox: 1,
  2141. panoMarker: 2,
  2142. reticule: 3,
  2143. mattertagDisc: 1,
  2144. mattertagCutout: 2,
  2145. mattertagStem: 3,
  2146. ribbon: 100
  2147. }
  2148. }, function(t, e, i) {
  2149. var n = i(0);
  2150. t.exports = {
  2151. UP: new n.Vector3(0, 1, 0),
  2152. DOWN: new n.Vector3(0, -1, 0),
  2153. LEFT: new n.Vector3(-1, 0, 0),
  2154. RIGHT: new n.Vector3(1, 0, 0),
  2155. FORWARD: new n.Vector3(0, 0, -1),
  2156. BACK: new n.Vector3(0, 0, 1)
  2157. }
  2158. }, function(t, e, i) {
  2159. "use strict";
  2160. (function(e) {
  2161. var n, r = i(22),
  2162. o = i(3),
  2163. a = i(0),
  2164. s = i(2),
  2165. l = i(1),
  2166. u = i(17),
  2167. h = i(106),
  2168. c = i(8),
  2169. d = i(10),
  2170. p = i(11),
  2171. f = i(16),
  2172. m = i(36),
  2173. g = i(107),
  2174. v = i(55),
  2175. y = i(23),
  2176. b = i(14),
  2177. w = i(30),
  2178. x = i(4)
  2179. .EventEmitter,
  2180. M = new s("/js/objects/Panorama.js"),
  2181. T = new a.SphereBufferGeometry(.1),
  2182. S = new a.PlaneBufferGeometry(.2, .2, 1, 1),
  2183. _ = f.loadurl(r.splitUrl("./images/texture/location/location_512x512.png")),
  2184. A = f.loadurl(r.splitUrl("./images/texture/location/disable_512x512.png")),
  2185. P = parseInt(o.getQueryString("reticule"));
  2186. function C(t, e, i, n) {
  2187. if (this.model = t, this.enable = i.enable, this.id = e, this.alignmentType = i.alignmentType || h.ALIGNED, this.u = i.u || 0, this.v = i.v || 0, this.roomid = i.roomid, this.neighbourUUIDs = i.neighbours || null, this.neighbourPanos = null, this.floor = null, this.floorIndex = i.floor, this.failedLoadingAt = 0, this.maxLoadRetries = 4, this.adjustAngleEnable = i.angle_enable, this.adjustTAngleX = 0, this.adjustTAngleY = 0, this.adjustTAngleZ = 0, this.adjustAngleX = i.angle_x, this.adjustAngleY = i.angle_y, this.adjustAngleZ = i.angle_z, this.color = {
  2188. brightness: i.color.brightness,
  2189. contrast: i.color.contrast,
  2190. gamma: i.color.gamma,
  2191. hue: i.color.hue,
  2192. saturation: i.color.saturation,
  2193. vibrance: i.color.vibrance,
  2194. balance: i.color.balance
  2195. }, this.origin = i.position.clone(), this.originPosition = i.position.clone(), this.position = this.alignmentType === h.UNALIGNED ? new a.Vector3(0, -5, 0) : i.position.clone(), this.quaternion = i.quaternion.clone(), this.quaternionAutoScene = i.quaternionAutoScene.clone(), this.skyboxMesh = new a.Mesh(T), this.skyboxMesh.position.copy(this.position), this.skyboxMesh.quaternion.copy(this.quaternion), this.skyboxMesh.name = "skybox", this.skyboxMesh.visible = !1, this.skyboxMesh.updateMatrix(), this.marker = null, this.isAligned()) {
  2196. var o = this.enable ? _ : A;
  2197. this.marker = new a.Mesh(S, new a.MeshBasicMaterial({
  2198. map: o,
  2199. side: a.DoubleSide,
  2200. opacity: 1,
  2201. transparent: !0,
  2202. depthWrite: !1
  2203. })), this.marker.renderOrder = u.panoMarker, this.marker.name = "marker", this.marker.pano = this, this.marker.userData.postils = {}, this.marker.userData.default_texture = o, l.colorMarkerOnLoad && this.on("load", (function() {
  2204. this.marker.material.color.set(65280)
  2205. }))
  2206. }
  2207. this.debugColor = (new a.Color)
  2208. .setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()), this.floorPosition = i.puck ? i.puck.clone() : null, this.tiled = n, this.tiled ? this.solidSkybox = null : (this.solidSkybox = new a.Texture([null, null, null, null, null, null]), this.solidSkybox.flipY = !1, l.minimalMemoryMode && (this.solidSkybox.minFilter = a.LinearFilter, this.solidSkybox.magFilter = a.LinearFilter, this.solidSkybox.generateMipmaps = !1)), this.zoomed = !1, this.panoRenderer = null, this.qualityManager = null, this.tileDownloader = null, this.tiledPanoRenderTarget = null, this.minimumTiledPanoLoaded = !1, this.highestPartialTileRenderOpCompleted = 0, this.highestFullTileRenderOpCompleted = 0, this.shouldRedrawOnBaseLoaded = !1, this.lockUntilRenderingComplete = !1, l.colorMarkerOnLoad && this.on("load", (function() {
  2209. this.marker.material.color.set(65280)
  2210. })), 1 === P && this.marker && this.marker.visible && (this.marker.visible = !1);
  2211. var s = new a.TextureLoader;
  2212. s.setCrossOrigin(!0);
  2213. var c = s.load(r.splitUrl("./images/texture.jpg"));
  2214. if (this.vrMarker = new a.Mesh(new a.OctahedronGeometry(.1, 0), new a.MeshLambertMaterial({
  2215. color: 16777215,
  2216. transparent: !0,
  2217. opacity: .75,
  2218. map: c
  2219. })), this.vrMarker.boluoType = "vr", this.vrMarker.position.z = 1, this.vrMarker.enabled = !0, this.vrMarker.visible = !1, window.vrMarkers = window.vrMarkers || [], window.vrMarkers.push(this.vrMarker), this.marker && this.marker.add(this.vrMarker), l.showAxis && (this.skyboxMesh.add(new a.ArrowHelper(new a.Vector3(0, 1, 0), new a.Vector3(0, 0, 0), 1, 255)), this.skyboxMesh.add(new a.ArrowHelper(new a.Vector3(0, 0, 1), new a.Vector3(0, 0, 0), 1, 16711680)), this.skyboxMesh.add(new a.ArrowHelper(new a.Vector3(1, 0, 0), new a.Vector3(0, 0, 0), 1, 65280))), this.adjustAngleEnable) {
  2220. var d = new a.Quaternion;
  2221. d.setFromAxisAngle(new a.Vector3(1, 0, 0), this.adjustAngleX), this.skyboxMesh.quaternion.multiply(d);
  2222. var p = new a.Quaternion;
  2223. p.setFromAxisAngle(new a.Vector3(0, 1, 0), this.adjustAngleY), this.skyboxMesh.quaternion.multiply(p);
  2224. var f = new a.Quaternion;
  2225. f.setFromAxisAngle(new a.Vector3(0, 0, 1), this.adjustAngleZ), this.skyboxMesh.quaternion.multiply(f), this.skyboxMesh.updateMatrix(), this.skyboxMesh.updateMatrixWorld(), this.model.updateProjectedPanos()
  2226. }
  2227. if (t.rooms_real) {
  2228. var m = t.rooms_real.findIndex((function(t) {
  2229. return i.roomid == t.roomidx
  2230. })); - 1 !== m && (m = t.rooms_real[m], this.areaName = m.roomname, this.areasPoints = JSON.parse(m.kpoints), this.areaSize = m.area)
  2231. }
  2232. }
  2233. C.prototype = Object.create(x.prototype), C.prototype.enter = function() {
  2234. this.emit("enter")
  2235. }, C.prototype.exit = function() {
  2236. this.tiled ? (this.clearWaitDeferreds(), this.minimumTiledPanoLoaded = !1, this.tiledPanoRenderTarget = null, this.setZoomed(!1), this.panoRenderer.deactivateTiledPano(this), this.highestPartialTileRenderOpCompleted = 0, this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(), this.solidSkybox.loaded = !1, this.solidSkybox.version = 0), this.emit("exit")
  2237. }, C.prototype.hoverOn = function(t) {
  2238. this.marker && (c.start(d.property(this.marker.material, "opacity", l[t].markerOpacityOnHover), 250), l.navigation.panoScores & l.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  2239. }, C.prototype.hoverOff = function(t) {
  2240. this.marker && c.start(d.property(this.marker.material, "opacity", l[t].markerOpacity), 250)
  2241. }, C.prototype.build1 = function() {
  2242. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position), this.floor.addPano(this), this.floorPosition = this.floorPosition || this.raycastFloorPosition(), this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(), l.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  2243. }, C.prototype.build2 = function() {
  2244. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(), this.height = this.position.distanceTo(this.floorPosition), this.placeMarker()
  2245. }, C.prototype.updateAngleDisplay = function() {}, C.prototype.updateColorDisplay = function() {}, C.prototype.changeColor = function(t, e, i) {
  2246. "balance_R" === e ? this.color.balance.x = i / 100 : "balance_G" === e ? this.color.balance.y = i / 100 : "balance_B" === e ? this.color.balance.z = i / 100 : this.color[e] = i / 100, t.setProjectedPanos(this, this, !1)
  2247. }, C.prototype.resetColor = function(t) {
  2248. this.color.brightness = 0, this.color.contrast = 0, this.color.gamma = 1, this.color.hue = 0, this.color.saturation = 0, this.color.vibrance = 0, this.color.balance = new a.Vector3, this.updateColorDisplay(), t.setProjectedPanos(this, this, !1)
  2249. }, C.prototype.applyAllColor = function(t) {
  2250. for (var e = 0; e < t.panos.list.length; e++) t.panos.list[e].color.brightness = this.color.brightness, t.panos.list[e].color.contrast = this.color.contrast, t.panos.list[e].color.gamma = this.color.gamma, t.panos.list[e].color.hue = this.color.hue, t.panos.list[e].color.saturation = this.color.saturation, t.panos.list[e].color.vibrance = this.color.vibrance, t.panos.list[e].color.balance.copy(this.color.balance)
  2251. }, C.prototype.updateTAngleDisplay = function() {}, C.prototype.updateAngle = function(t, e) {
  2252. function i(t) {
  2253. var e = parseFloat(t);
  2254. if (!isNaN(e)) return e = Math.round(1e3 * t) / 1e3
  2255. }
  2256. if ("x" == t) {
  2257. var n = new a.Vector3(1, 0, 0);
  2258. if (0 == e)(r = new a.Quaternion)
  2259. .setFromAxisAngle(n, -this.adjustAngleX), this.skyboxMesh.quaternion.multiply(r), this.adjustAngleX = 0;
  2260. else if (1 == e) {
  2261. var r = new a.Quaternion;
  2262. null == this.adjustAngleX && (this.adjustAngleX = 0), this.adjustAngleX += .005, this.adjustAngleX = i(this.adjustAngleX), r.setFromAxisAngle(n, .005), this.skyboxMesh.quaternion.multiply(r)
  2263. } else if (2 == e) {
  2264. r = new a.Quaternion;
  2265. null == this.adjustAngleX && (this.adjustAngleX = 0), this.adjustAngleX -= .005, this.adjustAngleX = i(this.adjustAngleX), r.setFromAxisAngle(n, -.005), this.skyboxMesh.quaternion.multiply(r)
  2266. }
  2267. } else if ("y" == t) {
  2268. n = new a.Vector3(0, 1, 0);
  2269. if (0 == e)(r = new a.Quaternion)
  2270. .setFromAxisAngle(n, -this.adjustAngleY), this.skyboxMesh.quaternion.multiply(r), this.adjustAngleY = 0;
  2271. else if (1 == e) {
  2272. r = new a.Quaternion;
  2273. null == this.adjustAngleY && (this.adjustAngleY = 0), this.adjustAngleY += .005, this.adjustAngleY = i(this.adjustAngleY), r.setFromAxisAngle(n, .005), this.skyboxMesh.quaternion.multiply(r)
  2274. } else if (2 == e) {
  2275. r = new a.Quaternion;
  2276. null == this.adjustAngleY && (this.adjustAngleY = 0), this.adjustAngleY -= .005, this.adjustAngleY = i(this.adjustAngleY), r.setFromAxisAngle(n, -.005), this.skyboxMesh.quaternion.multiply(r)
  2277. }
  2278. } else if ("z" == t) {
  2279. n = new a.Vector3(0, 0, 1);
  2280. if (0 == e)(r = new a.Quaternion)
  2281. .setFromAxisAngle(n, -this.adjustAngleZ), this.skyboxMesh.quaternion.multiply(r), this.adjustAngleZ = 0;
  2282. else if (1 == e) {
  2283. r = new a.Quaternion;
  2284. null == this.adjustAngleZ && (this.adjustAngleZ = 0), this.adjustAngleZ += .005, this.adjustAngleZ = i(this.adjustAngleZ), r.setFromAxisAngle(n, .005), this.skyboxMesh.quaternion.multiply(r)
  2285. } else if (2 == e) {
  2286. r = new a.Quaternion;
  2287. null == this.adjustAngleZ && (this.adjustAngleZ = 0), this.adjustAngleZ -= .005, this.adjustAngleZ = i(this.adjustAngleZ), r.setFromAxisAngle(n, -.005), this.skyboxMesh.quaternion.multiply(r)
  2288. }
  2289. }
  2290. this.skyboxMesh.updateMatrix(), this.skyboxMesh.updateMatrixWorld(), this.model.updateProjectedPanos()
  2291. }, C.prototype.updateTAngle = function(t, e) {
  2292. function i(t) {
  2293. var e = parseFloat(t);
  2294. if (!isNaN(e)) return e = Math.round(1e3 * t) / 1e3
  2295. }
  2296. if ("" !== e) {
  2297. if ("y" == t) {
  2298. var n = new a.Vector4(0, i(e), 0, 0);
  2299. n.applyMatrix4(this.skyboxMesh.matrix), this.adjustTAngleY = i(e), this.position.setX(this.originPosition.x + n.x), this.position.setY(this.originPosition.y + n.y), this.position.setZ(this.originPosition.z + n.z), this.skyboxMesh.position.copy(this.position)
  2300. }
  2301. this.skyboxMesh.updateMatrix(), this.skyboxMesh.updateMatrixWorld(), this.model.updateProjectedPanos(), this.position.setFromMatrixPosition(this.skyboxMesh.matrixWorld)
  2302. }
  2303. }, C.prototype.update = function(t) {
  2304. this.skyboxMesh.updateMatrixWorld()
  2305. }, C.prototype.interpolateFloorPosition = function() {
  2306. var t = this.model.panos.filter(C.filters.isNeighbourPanoTo(this))
  2307. .filter((function(t) {
  2308. return !!t.floorPosition
  2309. }))
  2310. .sort(function(t, e) {
  2311. return t.position.distanceTo(this.position) - e.position.distanceTo(this.position)
  2312. }.bind(this)),
  2313. e = this.position.clone();
  2314. return t.length >= 2 ? e.y = (t[0].floorPosition.y + t[1].floorPosition.y) / 2 : e.add(l.noMeshFloorPositionOffset), e
  2315. }, C.prototype.raycastFloorPosition = function() {
  2316. M.warn("Performance warning: Raycasting to find floor position");
  2317. var t = new a.Raycaster(this.position, new a.Vector3(0, -1, 0))
  2318. .intersectObjects(this.model.colliders);
  2319. return t.length ? t[0].point : null
  2320. }, C.prototype.raycastToFindFloor = (n = [new a.Vector3(0, -1, 0), new a.Vector3(1, -1, 0), new a.Vector3(0, -1, 1), new a.Vector3(-1, -1, 0), new a.Vector3(0, -1, -1), new a.Vector3(1, 0, 0), new a.Vector3(0, 0, 1), new a.Vector3(-1, 0, 0), new a.Vector3(0, 0, -1)], function() {
  2321. for (var t = 0; t < n.length; t++) {
  2322. var e = new a.Raycaster(this.position.clone(), n[t].clone())
  2323. .intersectObjects(this.model.colliders);
  2324. if (e.length) return e[0].object.parent.parent
  2325. }
  2326. return null
  2327. }), C.prototype.placeMarker = function() {
  2328. this.marker && (this.marker.position.copy(this.floorPosition), this.marker.position.y += .05, this.marker.lookAt(new a.Vector3(0, 1, 0)
  2329. .add(this.marker.position)))
  2330. }, C.prototype.findClosestMidtpointPanoTo = function(t) {
  2331. return (new a.Vector3)
  2332. .addVectors(this.position, t.position)
  2333. .divideScalar(2), this.model.panos.find([C.filters.notIn([this, t])], [C.sortFunctions.distanceToPoint(point)])
  2334. }, C.prototype.attachToPanoRenderer = function(t) {
  2335. this.panoRenderer = t, this.panoRenderer.on(v.TileRenderSuccess, this.onTileRendered.bind(this)), this.panoRenderer.on(v.PanoRenderComplete, this.onPanoRendered.bind(this)), this.panoRenderer.on(v.TileRenderFailure, this.onTileRenderFail.bind(this)), this.panoRenderer.on(v.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  2336. };
  2337. var E = {};
  2338. C.prototype.getWaitDeferred = function(t) {
  2339. var i = E[this.id];
  2340. i || (i = {}, E[this.id] = i);
  2341. var n = i[t];
  2342. return n || (n = {
  2343. deferred: e.Deferred(),
  2344. active: !1
  2345. }, i[t] = n), n
  2346. }, C.prototype.resetWaitDeferred = function(t) {
  2347. var i = this.getWaitDeferred(t);
  2348. i.active = !1, i.deferred = e.Deferred()
  2349. }, C.prototype.clearWaitDeferreds = function() {
  2350. var t = E[this.id];
  2351. for (var i in t || (t = {}, E[this.id] = t), t)
  2352. if (t.hasOwnProperty(i)) {
  2353. var n = t[i];
  2354. n.active = !1, n.deferred = e.Deferred()
  2355. }
  2356. }, C.prototype.loadTiledPano = function() {
  2357. var t = [],
  2358. e = [];
  2359. return function(i, n, r, o, a, s) {
  2360. null != o || (o = !0), null != a || (a = !0);
  2361. var l = this.getWaitDeferred(i),
  2362. u = l.deferred,
  2363. h = null,
  2364. c = null;
  2365. if (r && ("number" == typeof r ? h = r : (h = r.hFov, c = r.vFov)), !this.isLoaded(i)) {
  2366. if (!l.active) {
  2367. if (l.active = !0, r) {
  2368. var d = w.matchingTilesInDirection(this, i, n, h, c);
  2369. t[this.id + ":" + i] = {
  2370. tileCount: 0,
  2371. targetTileCount: d
  2372. }, M.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  2373. }
  2374. e[this.id] || (e[this.id] = !0, this.on(g.LoadComplete, function(t, e) {
  2375. var i = this.getWaitDeferred(t)
  2376. .deferred;
  2377. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= t && (i.resolve(t, e), this.resetWaitDeferred(t))
  2378. }.bind(this)), this.on(g.LoadFailed, function(t) {
  2379. var e = this.getWaitDeferred(t)
  2380. .deferred;
  2381. e && "pending" === e.state() && this.highestPartialTileRenderOpCompleted >= t && (e.reject(t), this.resetWaitDeferred(t))
  2382. }.bind(this)), this.on(g.TileLoaded, function(e, i, n) {
  2383. this.id == window.firstPanoId && 512 == e && window.loadingCount++;
  2384. var r = this.getWaitDeferred(e)
  2385. .deferred;
  2386. if (r && "pending" === r.state()) {
  2387. r.notify(e, i, n);
  2388. var o = t[this.id + ":" + e];
  2389. o && (o.tileCount++, o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, e, n, !0), r.resolve(e, n), this.resetWaitDeferred(e)))
  2390. }
  2391. }.bind(this)))
  2392. }
  2393. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, c, s), this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxPanoSize(), o, a), this.panoRenderer.renderPanoTiles(this.id, n, a)
  2394. }
  2395. return u.promise()
  2396. }
  2397. }(), C.prototype.onUploadAttemptedForAllTiles = function(t, e, i) {
  2398. o.isMobile() || t === this.id && e === this.qualityManager.getPanoSize(y.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1, this.panoRenderer.resetRenderStatus(t), this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  2399. }, C.prototype.onTileRendered = function(t, e, i, n) {
  2400. t === this.id && this.emit(g.TileLoaded, e, i, n)
  2401. }, C.prototype.onPanoRendered = function(t, e, i, n) {
  2402. t === this.id && (this.minimumTiledPanoLoaded = !0, this.skybox = this.tiledPanoRenderTarget.texture, e > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = e), !n && e > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = e), this.emit("load", e), this.model.emit("load", this), this.emit(g.LoadComplete, e, i))
  2403. }, C.prototype.onTileRenderFail = function(t, e, i) {
  2404. t === this.id && this.emit(g.LoadFailed, e)
  2405. }, C.prototype.getSkyboxTexture = function() {
  2406. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  2407. }, C.prototype.isLoaded = function(t) {
  2408. if (this.tiled) {
  2409. if (t && "string" == typeof t) throw new b("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  2410. return !!this.minimumTiledPanoLoaded && (!t || this.highestPartialTileRenderOpCompleted >= t)
  2411. }
  2412. if (t && "number" == typeof t) throw new b("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  2413. return !!this.solidSkybox.high || t in this.solidSkybox
  2414. }, C.prototype.getAjustedColors = function() {
  2415. return this.color
  2416. }, C.prototype.loadCube = function(t) {
  2417. if (this.isLoaded(t)) return M.info("Skipping load of pano, already loaded"), e.when();
  2418. this.emit("loading", t), this.model.emit("loading", this);
  2419. var i = m.getCubemapUrls(this.model.urls, this.id, t),
  2420. n = i.filter((function(t) {
  2421. return !t
  2422. }));
  2423. "low" === t && n.length > 0 && (M.info("Pano", this.id, "not available in low res, loading high res right away"), t = "high", i = m.getCubemapUrls(this.model.urls, this.id, t));
  2424. var r = 0,
  2425. o = [0, 1, 2, 3, 4, 5].map(function(t, e, n) {
  2426. return p.getImage(i[e])
  2427. }.bind(this)),
  2428. a = t;
  2429. return e.when(o[0], o[1], o[2], o[3], o[4], o[5])
  2430. .then(function(t, e, i, n, r, o) {
  2431. return this.solidSkybox[a] = [t, e, i, n, r, o], "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a], this.solidSkybox.low = null), this.solidSkybox.needsUpdate = !0, this.emit("load", a), this.model.emit("load", this), this
  2432. }.bind(this), function() {
  2433. I.error("Downloading cubemap for pano", this.id, "failed"), this.failedLoadingAt = Date.now()
  2434. }.bind(this), (function() {
  2435. return e.when(++r, 6)
  2436. }))
  2437. }, C.raycastsSkipped = 0, C.raycastsDone = 0, C.prototype.findNeighourPanos = function() {
  2438. return this.model.panos.setNeighbour(this.id, this.id, !1), this.model.panos.forEach(function(t) {
  2439. if (t !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][t.id])) {
  2440. var e = this.position.distanceTo(t.position);
  2441. if (e > l.panoramaNeighbourMaxDistance) return this.model.panos.setNeighbour(this, t, !1), void C.raycastsSkipped++;
  2442. var i = t.position.clone()
  2443. .sub(this.position)
  2444. .normalize(),
  2445. n = new a.Raycaster(this.position, i.clone(), 0, e)
  2446. .intersectObjects(this.model.colliders);
  2447. C.raycastsDone++, this.model.panos.setNeighbour(this, t, 0 === n.length), l.showNeighbourRaycasts && (n.length ? this.floor.model.add(new a.ArrowHelper(i, this.position, n[0].distance, 16711680)) : this.floor.model.add(new a.ArrowHelper(i, this.position, e, 16777215, 0, 0)))
  2448. }
  2449. }.bind(this)), this.model.panos.neighbourMap[this.id]
  2450. }, C.prototype.worldPosition = function() {
  2451. return this.position
  2452. }, C.prototype.addTextSprite = function(t, e) {
  2453. this.removeTextSprite();
  2454. var i = document.createElement("canvas"),
  2455. n = i.getContext("2d");
  2456. i.width = 256, i.height = 256;
  2457. n.font = "bold 60px Arial", n.fillStyle = "white";
  2458. var r = n.measureText(t)
  2459. .width;
  2460. n.fillText(t, (i.width - r) / 2, (i.height + 60) / 2);
  2461. var o = new a.Texture(i);
  2462. o.needsUpdate = !0;
  2463. var s = new a.SpriteMaterial({
  2464. map: o,
  2465. color: e || 16428055
  2466. });
  2467. this.text3d = new a.Sprite(s), this.text3d.position.copy(this.skyboxMesh.position), this.floor.add(this.text3d)
  2468. }, C.prototype.removeTextSprite = function() {
  2469. this.text3d && (this.floor.remove(this.text3d), this.text3d = null)
  2470. }, C.prototype.removeLocationTextSprite = function() {
  2471. this.locationText && (this.floor.remove(this.locationText), this.locationText = null)
  2472. }, C.prototype.isAligned = function() {
  2473. return this.alignmentType === h.ALIGNED
  2474. }, C.filters = {
  2475. inDirection: function(t, e, i) {
  2476. return function(n) {
  2477. return n.position.clone()
  2478. .sub(t)
  2479. .normalize()
  2480. .dot(e) > i
  2481. }
  2482. },
  2483. inFloorDirection: function(t, e, i) {
  2484. return function(n) {
  2485. return n.floorPosition.clone()
  2486. .sub(t)
  2487. .normalize()
  2488. .dot(e) > i
  2489. }
  2490. },
  2491. inPanoDirection: function(t, e, i) {
  2492. return i = l.navigation.panoScores ? l.navigation.filterStrictness : i,
  2493. function(n) {
  2494. var r = n.floorPosition.clone()
  2495. .sub(t)
  2496. .normalize(),
  2497. o = n.position.clone()
  2498. .sub(t)
  2499. .normalize();
  2500. return r.dot(e) > i || o.dot(e) > i
  2501. }
  2502. },
  2503. atFloor: function(t) {
  2504. return function(e) {
  2505. return !t || e.floor === t
  2506. }
  2507. },
  2508. not: function(t) {
  2509. return function(e) {
  2510. return e != t
  2511. }
  2512. },
  2513. notIn: function(t) {
  2514. return function(e) {
  2515. return -1 === t.indexOf(e)
  2516. }
  2517. },
  2518. isLoaded: function() {
  2519. return function(t) {
  2520. return t.isLoaded()
  2521. }
  2522. },
  2523. isNotLoaded: function() {
  2524. return function(t) {
  2525. return !t.isLoaded()
  2526. }
  2527. },
  2528. isCloseEnoughTo: function(t, e) {
  2529. return function(i) {
  2530. return t.distanceTo(i.floorPosition) < e
  2531. }
  2532. },
  2533. hasMinimumHeightDifferenceTo: function(t, e) {
  2534. return function(i) {
  2535. return Math.abs(i.position.y - t.y) > e
  2536. }
  2537. },
  2538. isNotBehindNormal: function(t, e) {
  2539. var i = new a.Vector3;
  2540. return e = e.clone(),
  2541. function(n) {
  2542. return i.copy(n.position)
  2543. .sub(t)
  2544. .normalize()
  2545. .dot(e) > 0
  2546. }
  2547. },
  2548. isNeighbourPanoTo: function(t) {
  2549. return function(e) {
  2550. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  2551. }
  2552. },
  2553. isNeighbourOfNeighbourTo: function(t) {
  2554. return function(e) {
  2555. return !!t.neighbourPanos[e.id] || t.neighbourUUIDs.some((function(i) {
  2556. var n = t.model.panos.get(i);
  2557. return !!n && n.neighbourPanos[e.id]
  2558. }))
  2559. }
  2560. },
  2561. isNotRecentlyFailed: function(t) {
  2562. return function(e) {
  2563. return Date.now() - e.failedLoadingAt > t
  2564. }
  2565. },
  2566. isOnVisibleFloor: function() {
  2567. return function(t) {
  2568. return !t.floor.hidden
  2569. }
  2570. },
  2571. isPanoAligned: function() {
  2572. return function(t) {
  2573. return t.isAligned()
  2574. }
  2575. }
  2576. }, C.sortFunctions = {
  2577. distanceToPoint: function(t) {
  2578. return function(e, i) {
  2579. return e.position.distanceTo(t) - i.position.distanceTo(t)
  2580. }
  2581. },
  2582. floorDistanceToPoint: function(t) {
  2583. return function(e, i) {
  2584. return e.floorPosition.distanceTo(t) - i.floorPosition.distanceTo(t)
  2585. }
  2586. },
  2587. choose: function(t) {
  2588. return function(e, i) {
  2589. return t.id === e.id ? -1 : t.id === i.id ? 1 : 0
  2590. }
  2591. }
  2592. }, C.scoreFunctions = {
  2593. distance: function(t, e) {
  2594. return e = e || l.navigation.distanceFactor,
  2595. function(i) {
  2596. return t ? t.position.distanceTo(i.position) * e : 0
  2597. }
  2598. },
  2599. distanceSquared: function(t, e) {
  2600. return e = e || l.navigation.distanceFactor,
  2601. function(i) {
  2602. return t ? t.position.distanceToSquared(i.position) * e : 0
  2603. }
  2604. },
  2605. direction: function(t, e) {
  2606. return function(i) {
  2607. return i.position.clone()
  2608. .sub(t)
  2609. .normalize()
  2610. .dot(e) * l.navigation.directionFactor
  2611. }
  2612. },
  2613. angle: function(t, e) {
  2614. return function(i) {
  2615. return i.position.clone()
  2616. .sub(t)
  2617. .normalize()
  2618. .angleTo(e) * l.navigation.angleFactor
  2619. }
  2620. },
  2621. inFieldOfView: function(t, e) {
  2622. return function(i) {
  2623. return i.position.clone()
  2624. .sub(t)
  2625. .normalize()
  2626. .dot(e) > .75 ? 10 : -1
  2627. }
  2628. },
  2629. optionality: function(t) {
  2630. return function(e) {
  2631. return e.neighbourUUIDs.filter((function(e) {
  2632. return !(e in t.neighbourUUIDs) && e !== t.id
  2633. }))
  2634. .length * l.navigation.optionalityFactor
  2635. }
  2636. },
  2637. penalizeHeightDifferenceUnder: function(t, e) {
  2638. return function(i) {
  2639. return t.y - i.position.y < e ? -20 : 0
  2640. }
  2641. }
  2642. }, C.prototype.setZoomed = function(t) {
  2643. this.zoomed = t, this.updateSkyboxForZoomLevel()
  2644. }, C.prototype.updateSkyboxForZoomLevel = function() {
  2645. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  2646. }, C.prototype.ensureSkyboxReadyForRender = function() {
  2647. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0), this.solidSkybox.loaded = !0)
  2648. }, t.exports = C
  2649. })
  2650. .call(this, i(6))
  2651. }, function(t, e) {
  2652. t.exports = {
  2653. Move: "move",
  2654. MoveComplete: "move.complete",
  2655. ModeChanged: "mode.changed",
  2656. ModeChanging: "mode.changing",
  2657. RulersMove: "rulers.move",
  2658. PanoChosen: "pano.chosen",
  2659. warpTravelBlack: "warp.travel.black",
  2660. ClosestPanoChanging: "closest.pano.changing",
  2661. WarpStarted: "warp.started",
  2662. WarpInterrupted: "warp.interrupted",
  2663. WarpEnded: "warp.ended",
  2664. FlyingStarted: "flying.started",
  2665. FlyingInterrupted: "flying.interrupted",
  2666. FlyingEnded: "flying.ended",
  2667. Ready: "ready",
  2668. StartInside: "start.inside",
  2669. StartOutside: "start.outside",
  2670. ViewChanged: "view.changed",
  2671. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  2672. InputStart: "input.start",
  2673. EditAddTagHighlight: "edit.add.taghighlight",
  2674. ClickTag: "clickTag"
  2675. }
  2676. }, function(t, e) {
  2677. t.exports = {
  2678. ModelAdded: "model-added",
  2679. ActiveModelChanged: "active-model-changed"
  2680. }
  2681. }, function(t, e, i) {
  2682. var n = i(1);
  2683. t.exports.splitUrl = function(t) {
  2684. if (n.isLocalVersion) {
  2685. return t.split("/common/")[1] ? window.location.origin + window.location.pathname.split("index.html")[0] + "/" + t.split("/common/")[1] : window.location.origin + window.location.pathname.split("index.html")[0] + "/" + t.split("/common/")[0]
  2686. }
  2687. return t
  2688. }, t.exports.splitComUrl = function(t) {
  2689. return n.isLocalVersion ? t.split("/common/")[1] : t
  2690. }
  2691. }, function(t, e) {
  2692. t.exports = {
  2693. BASE: 1,
  2694. STANDARD: 2,
  2695. HIGH: 3,
  2696. ULTRAHIGH: 4
  2697. }
  2698. }, function(t, e, i) {
  2699. "use strict";
  2700. t.exports = {
  2701. BLACK: "black",
  2702. STD: "std",
  2703. WALK: "walk"
  2704. }
  2705. }, function(t, e, i) {
  2706. var n, o = i(3),
  2707. a = new(i(2))("js/utils/showcase");
  2708. t.exports = {
  2709. getAuthorizationHeader: function() {
  2710. var t = o.valueFromHash("auth");
  2711. if (t) return t.replace(",", " ");
  2712. var e = o.valueFromCookie("token");
  2713. return e ? "Token " + e : null
  2714. },
  2715. parseModelid: function(t) {
  2716. var e, i;
  2717. return t = t || "", i = (e = window.location.protocol + "//" + window.location.host) + "/api/player/models/" + t, {
  2718. baseurl: window.location.protocol + "//" + window.location.host,
  2719. playdir: "play",
  2720. dataroot: "data",
  2721. modelid: t,
  2722. versiondir: "",
  2723. locationpics: "",
  2724. urlBase: e,
  2725. urlModel: i,
  2726. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  2727. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  2728. }
  2729. },
  2730. getModelIDFromQueryString: function() {
  2731. return o.valueFromHash("model") || o.valueFromHash("m")
  2732. },
  2733. normalizeModeldata: function(t, e) {
  2734. return (t = JSON.parse(JSON.stringify(t)))
  2735. .scenes.forEach((function(t) {
  2736. if (t._camera && "string" == typeof t._camera) try {
  2737. t._camera = JSON.parse(t._camera)
  2738. } catch (e) {
  2739. a.warn("Unable to parse scene camera"), t._camera = null
  2740. } else "object" == typeof t._camera && a.debug("scene.camera already a JSON object");
  2741. t._camera && (t._camera._rotation && (t._camera._rotation = e.convertWorkshopQuaternion(t._camera._rotation)), t._camera._viewpoint && (t._camera._viewpoint = e.convertWorkshopVector(t._camera._viewpoint)), t._camera._zoom = e.convertWorkshopOrthoZoom(t._camera._zoom))
  2742. })), t
  2743. },
  2744. visionVersionToInt: (n = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")), function(t) {
  2745. if (!t) throw new Error("Vision version is required");
  2746. var e = n.exec(t);
  2747. if (null === e) throw new Error("String is not a vision version: " + t);
  2748. return parseInt(e[1])
  2749. }),
  2750. modelDataPromisesTiles: function(t) {
  2751. if (t.vision_version) try {
  2752. return l.visionVersionToInt(t.vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  2753. } catch (e) {
  2754. s.warn("Invalid vision version: " + t.vision_version)
  2755. }
  2756. var e = t.created ? new Date(t.created) : null;
  2757. return e && e >= r.visionTilingStartDate
  2758. }
  2759. }
  2760. }, function(t, e) {
  2761. t.exports = {
  2762. signedUrlDefaultExpireTime: 24e4,
  2763. signedUrlCheckInterval: 1e4,
  2764. signedUrlRefreshBuffer: 15e3,
  2765. dollhouseFOV: 70,
  2766. dollhouseNear: 1,
  2767. dollhouseFar: 5e3,
  2768. insideFOV: 70,
  2769. insideNear: .1,
  2770. insideFar: 5e3,
  2771. insideLookSpeed: .12,
  2772. insideLookLimitUp: 50,
  2773. insideLookLimitDown: -50,
  2774. orthoNear: 1,
  2775. orthoFar: 5e3,
  2776. orthoBase: 10,
  2777. narrowLandscapeHeight: 290,
  2778. reallyNarrowLandscapeHeight: 250,
  2779. visionTilingStartDate: new Date("8/26/2016"),
  2780. visionTilingStartVersion: "1.1.407.13667",
  2781. windowHeightHighQualityThreshold: 1200,
  2782. tourStepDelayDefault: 3500,
  2783. tourStepDelaySlideShow: 5e3,
  2784. workshopApsect: 9 / 16,
  2785. highQualityMaxZoom: 2,
  2786. ultraHighQualityMaxZoom: 1.5
  2787. }
  2788. }, function(t, e) {
  2789. t.exports = {
  2790. Move: "move",
  2791. InteractionDirect: "interaction.direct",
  2792. InteractionKey: "interaction.key",
  2793. InteractionGui: "interaction.gui",
  2794. FlyInDirection: "fly.direction",
  2795. InputStart: "input.start",
  2796. Pinch: "input.pinch",
  2797. Scroll: "input.scroll",
  2798. HideEvent: "panorama.move",
  2799. RulersMove: "rulers.move",
  2800. RulersWalk: "rulers.walk",
  2801. TtagsMove: "titletag.move",
  2802. PanoramaMove: "camera.move",
  2803. PanoramaMoveStop: "camera.move.stop"
  2804. }
  2805. }, function(t, e, i) {
  2806. (function(e) {
  2807. var n, r, o, a = i(4)
  2808. .EventEmitter,
  2809. s = i(104);
  2810. function l() {
  2811. this.uuid = "", this.sendOperationFalg = !1, this.initState = !1, this.signalState = !1, this.busyState = !1, this.busySended = !1, this.voiceFlag = !1, this.sync = !1;
  2812. var t = !1;
  2813. this.remoteControl = !1, this.syncInitState = !1, this.handelCallTimeOut = null, this.hangupType = "timeout", this.lookInstance = null;
  2814. var e = this;
  2815. Object.defineProperty(this, "busy", {
  2816. get: function() {
  2817. return t
  2818. },
  2819. set: function(i) {
  2820. if (i) {
  2821. if (e.remoteControl) return void e.emit("remote_busy");
  2822. t = !0, this.sync = !1, this.sendBusy()
  2823. } else t = !1, this.cancelBusy()
  2824. }
  2825. }), this.showTip = function() {}, this.getCurrentState = function() {}, this._handleMessage = this._handleMessage.bind(this), this._handleCall = this._handleCall.bind(this), this.callTimeHandle = null, this.userInfo = {
  2826. identity: "4",
  2827. customer: {
  2828. state: !1,
  2829. nickName: "客户",
  2830. phoneNum: "15311496327",
  2831. identity: "4",
  2832. headImg: "",
  2833. accid: ""
  2834. },
  2835. bussiness: {
  2836. state: !1,
  2837. nickName: "经纪人",
  2838. phoneNum: "18911926367",
  2839. identity: "1",
  2840. headImg: "",
  2841. accid: ""
  2842. }
  2843. }
  2844. }
  2845. l.prototype = Object.create(a.prototype), l.prototype.constructor = l, l.prototype.init = function() {
  2846. var t = this,
  2847. e = "";
  2848. if (e = "4" === this.userInfo.identity ? this.userInfo.bussiness.accid : this.userInfo.customer.accid, this.lookInstance = new s({
  2849. remoteAccid: e
  2850. }), "platform-error" === this.lookInstance.init()) throw new Error("platform-error");
  2851. return this.lookInstance.on("onData", this._handleMessage), this.lookInstance.on("onCall", this._handleCall), this.lookInstance.on("refuse", (function() {
  2852. t.emit("bussiness_busy")
  2853. })), this.lookInstance.on("hangup", (function() {
  2854. "timeout" !== t.hangupType && ("4" === t.userInfo.identity ? t.userInfo.bussiness.state = !1 : t.userInfo.customer.state = !1, t.emit("close_connect", t.userInfo), t.destory())
  2855. })), this.lookInstance.on("busy", (function() {
  2856. this.lookInstance.hangup()
  2857. })), this.signalState = !0, this.emit("init_done"), this.initState = !0, this.sendState({
  2858. type: "connectState",
  2859. state: "initdone"
  2860. }), "4" === this.userInfo.identity ? t.userInfo.customer.state = !0 : t.userInfo.bussiness.state = !0, !0
  2861. }, l.prototype._getUserinfoType = function(t, e) {
  2862. var i = t[e];
  2863. return {
  2864. nickName: i[e + "Nickname"],
  2865. headImg: i[e + "HeadImage"],
  2866. identity: i[e + "Identity"],
  2867. accid: i[e + "Accid"]
  2868. }
  2869. }, l.prototype.joinChannel = function(t, e, i) {
  2870. if (this.emit("init"), this.getCurrentState = e, t) {
  2871. var n = this._getUserinfoType(t, "bussiness"),
  2872. r = this._getUserinfoType(t, "customer");
  2873. this.userInfo.identity = t.currentIdentity, this.userInfo.bussiness = n, this.userInfo.customer = r
  2874. }
  2875. this.init()
  2876. }, l.prototype._handleCall = function() {
  2877. "4" === this.userInfo.identity ? this.userInfo.bussiness.state = !0 : this.userInfo.customer.state = !0, this.emit("identity", this.userInfo), this.emit("callsuccess"), this.emit("user_connected"), this.hangupType = "hangup", this.voiceFlag = !0
  2878. }, l.prototype._handleMessage = function(t) {
  2879. var e = JSON.parse(t);
  2880. switch (e.type) {
  2881. case "state":
  2882. this._handleState(e);
  2883. break;
  2884. case "operation":
  2885. this._handleOpertation(e);
  2886. break;
  2887. case "busy":
  2888. this._handleBusy(e)
  2889. }
  2890. }, l.prototype.setBusy = (n = null, function() {
  2891. var t = this;
  2892. null !== n ? (clearTimeout(n), n = null) : (this.sync = !1, this.sendState({
  2893. type: "busyState",
  2894. state: "busy"
  2895. }), this.busySended = !0), n = setTimeout((function() {
  2896. t.sendState({
  2897. type: "busyState",
  2898. state: "nobusy"
  2899. }), n = null, t.busySended = !1
  2900. }), 400)
  2901. }), l.prototype.sendBusy = function() {
  2902. this.busySended || (this.sync = !1, this.sendState({
  2903. type: "busyState",
  2904. state: "busy"
  2905. }), this.busySended = !0)
  2906. }, l.prototype.cancelBusy = (r = null, function() {
  2907. var t = this;
  2908. null !== r && clearTimeout(r), r = setTimeout((function() {
  2909. t.sendState({
  2910. type: "busyState",
  2911. state: "nobusy"
  2912. }), t.busySended = !1
  2913. }), 2500)
  2914. }), l.prototype.getSyncState = function() {
  2915. return this.remoteControl ? (this.emit("remote_busy"), !1) : (this.sync = !1, !0)
  2916. }, l.prototype._handleBusy = function(t) {
  2917. "busy" === t.state ? (this.remoteControl = !0, this.sync = !0) : this.remoteControl = !1
  2918. }, l.prototype._handleState = function(t) {
  2919. var e = t.data;
  2920. switch (e.type) {
  2921. case "connectState":
  2922. this._handleConnectState(e);
  2923. break;
  2924. case "busyState":
  2925. this._handleBusy(e)
  2926. }
  2927. }, l.prototype.startVoiceLink = function() {
  2928. "4" === this.userInfo.identity && this.lookInstance.call()
  2929. }, l.prototype.setStateDone = function() {
  2930. this.syncInitState && (this.sendState({
  2931. type: "connectState",
  2932. state: "initstatedone"
  2933. }), "4" !== this.userInfo.identity && (this.userInfo.customer.state = !0, this.lookInstance.accept()), this.emit("identity", this.userInfo), this.sendOperationFalg = !0)
  2934. }, l.prototype._handleConnectState = function(t) {
  2935. switch (t.state) {
  2936. case "initdone":
  2937. var e = this.getCurrentState();
  2938. this.sendState({
  2939. type: "connectState",
  2940. state: "initstate",
  2941. data: e
  2942. });
  2943. break;
  2944. case "initstate":
  2945. this.handelCallTimeOut && clearTimeout(this.handelCallTimeOut), this.syncInitState = !0, this.emit("changestate", t.data);
  2946. break;
  2947. case "initstatedone":
  2948. this.sendOperationFalg = !0, "4" === this.userInfo.identity ? this.userInfo.bussiness.state = !0 : this.userInfo.customer.state = !0, this.emit("identity", this.userInfo)
  2949. }
  2950. }, l.prototype.setMute = function(t) {
  2951. this.sendOperationFalg && (t ? this.lookInstance.mute() : this.lookInstance.unmute())
  2952. }, l.prototype._handleOpertation = function(t) {
  2953. if (this.voiceFlag) {
  2954. this.sync = !0;
  2955. var e = t.data;
  2956. this.emit("operation", e)
  2957. }
  2958. }, l.prototype.sendMessage = function(t) {
  2959. this.signalState && this.lookInstance.sendData(JSON.stringify(t))
  2960. }, l.prototype.sendState = function(t) {
  2961. var e = {
  2962. type: "state",
  2963. data: t
  2964. };
  2965. this.sendMessage(e)
  2966. }, l.prototype.sendOperationasdf = (o = null, function(t) {
  2967. var e = this;
  2968. null !== o && clearTimeout(o), o = setTimeout((function() {
  2969. e.sendOperation2remote(t)
  2970. }), 15)
  2971. }), l.prototype.sendOperation = function(t) {
  2972. if ((this.sendOperationFalg || this.voiceFlag) && "uichange" !== t.type) {
  2973. var e = {
  2974. type: "operation",
  2975. data: t
  2976. };
  2977. this.sendMessage(e)
  2978. }
  2979. }, l.prototype.destory = function() {
  2980. this.lookInstance && this.lookInstance.hangup(), this.sendOperationFalg = !1, this.busyState = !1, this.sync = !1, this.remoteControl = !1, e("#customer-info")
  2981. .find(".voice-button")
  2982. .removeClass("mute")
  2983. .addClass("unmute"), e("#proxy-info")
  2984. .find(".voice-button")
  2985. .removeClass("mute")
  2986. .addClass("unmute")
  2987. };
  2988. var u, h = (u = null, function(t) {
  2989. return null === u && (u = new l(t)), u
  2990. });
  2991. t.exports = h
  2992. })
  2993. .call(this, i(6))
  2994. }, function(t, e) {
  2995. t.exports = {
  2996. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  2997. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  2998. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  2999. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  3000. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  3001. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  3002. }
  3003. }, function(t, e, i) {
  3004. var n, r, o = i(29),
  3005. a = i(56),
  3006. s = {};
  3007. s.TILE_SIZE = 512, s.FACES_PER_PANO = 6, s.LocationOnTile = {
  3008. Center: 0,
  3009. UpperLeft: 1,
  3010. UpperRight: 2,
  3011. LowerRight: 3,
  3012. LowerLeft: 4
  3013. }, s.getTileVector = function(t, e, i, n, r, l, u, h) {
  3014. var c = t / e,
  3015. d = e / t * 2,
  3016. p = d / 2,
  3017. f = n / c * 2 - 1 + p,
  3018. m = (r = c - 1 - r) / c * 2 - 1 + p;
  3019. switch (l = l || s.LocationOnTile.Center) {
  3020. case s.LocationOnTile.UpperLeft:
  3021. f -= p, m += p, f += u * d;
  3022. break;
  3023. case s.LocationOnTile.UpperRight:
  3024. f += p, m += p, m -= u * d;
  3025. break;
  3026. case s.LocationOnTile.LowerRight:
  3027. f += p, m -= p, f -= u * d;
  3028. break;
  3029. case s.LocationOnTile.LowerLeft:
  3030. f -= p, m -= p, m += u * d;
  3031. break;
  3032. case s.LocationOnTile.Center:
  3033. }
  3034. switch (i) {
  3035. case o.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  3036. a.setVector(h, -1, m, -f);
  3037. break;
  3038. case o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  3039. a.setVector(h, 1, m, f);
  3040. break;
  3041. case o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  3042. a.setVector(h, -f, 1, -m);
  3043. break;
  3044. case o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  3045. a.setVector(h, -f, -1, m);
  3046. break;
  3047. case o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  3048. a.setVector(h, -f, m, 1);
  3049. break;
  3050. case o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  3051. a.setVector(h, f, m, -1)
  3052. }
  3053. a.normalize(h)
  3054. }, s.getFaceForTile = function(t, e) {
  3055. var i = s.TILE_SIZE;
  3056. t < s.TILE_SIZE && (i = t);
  3057. var n = Math.floor(t / i),
  3058. r = n * n;
  3059. return Math.floor(e / r)
  3060. }, s.getTileLocation = function(t, e, i) {
  3061. var n = s.TILE_SIZE;
  3062. t < s.TILE_SIZE && (n = t);
  3063. var r = s.getFaceForTile(t, e),
  3064. o = Math.floor(t / n),
  3065. a = e - r * (o * o);
  3066. i.tileX = a % o, i.tileY = Math.floor(a / o), i.face = r, i.faceTileIndex = a
  3067. }, s.getTileCountForSize = function(t) {
  3068. if (t <= s.TILE_SIZE) return s.FACES_PER_PANO;
  3069. var e = Math.floor(t / s.TILE_SIZE);
  3070. return e * e * s.FACES_PER_PANO
  3071. }, s.getRelativeDirection = (n = new a.Matrix4, r = new a.Quaternion, function(t, e) {
  3072. r.copy(t), r.inverse(), n.makeRotationFromQuaternion(r), n.applyToVector3(e), a.normalize(e)
  3073. }), s.matchingTilesInDirection = function() {
  3074. var t = new a.Vector3,
  3075. e = new a.Vector3(0, 0, -1),
  3076. i = new a.Quaternion,
  3077. n = function(t, e) {
  3078. t.push({
  3079. face: e.face,
  3080. faceTileIndex: e.faceTileIndex,
  3081. tileX: e.tileX,
  3082. tileY: e.tileY
  3083. })
  3084. },
  3085. r = function() {
  3086. var t = {
  3087. face: -1,
  3088. faceTileIndex: -1,
  3089. tileX: -1,
  3090. tileY: -1
  3091. };
  3092. return function(e, i, r) {
  3093. for (var o = s.getTileCountForSize(e), a = 0, l = 0; l < o; l++) s.getTileLocation(e, l, t), i && !i(t) || (a++, r && n(r, t));
  3094. return a
  3095. }
  3096. }();
  3097. return function(n, o, l, u, h, c) {
  3098. var d = o < s.TILE_SIZE ? o : s.TILE_SIZE;
  3099. if (s.getTileCountForSize(o), !u && !h) return r(o, null, c);
  3100. var p = !!h;
  3101. if (h = h || u, h = Math.max(0, Math.min(h, 360)), u = Math.max(0, Math.min(u, 360)), a.copyVector(l, t), s.getRelativeDirection(n.quaternion, t), p) {
  3102. i.setFromUnitVectors(t, e);
  3103. return r(o, (function(t) {
  3104. return s.isTileWithinFrustum(o, d, t.face, t.tileX, t.tileY, i, u, h)
  3105. }), c)
  3106. }
  3107. return r(o, (function(e) {
  3108. return s.isTileWithinFOV(o, d, e.face, e.tileX, e.tileY, t, u)
  3109. }), c)
  3110. }
  3111. }(), s.isTileWithinFrustum = function() {
  3112. var t = new a.Vector3;
  3113. return function(e, i, n, r, o, l, u, h) {
  3114. for (var c = Math.tan(.5 * h * a.RADIANS_PER_DEGREE), d = -c, p = Math.tan(.5 * u * a.RADIANS_PER_DEGREE), f = -p, m = s.mapFaceToCubemapFace(n), g = 0, v = 0, y = 0, b = 0, w = 0, x = s.LocationOnTile.Center; x <= s.LocationOnTile.LowerLeft; x++)
  3115. if (s.getTileVector(e, i, m, r, o, x, 0, t), a.applyQuaternionToVector(l, t), t.z >= -1e-5) 0;
  3116. else {
  3117. var M = -1 / t.z,
  3118. T = t.x * M,
  3119. S = t.y * M;
  3120. S > c ? g++ : S < d && v++, T > p ? y++ : T < f && b++, w++
  3121. } return v !== w && g !== w && y !== w && b !== w
  3122. }
  3123. }(), s.isTileWithinFOV = function() {
  3124. var t = new a.Vector3,
  3125. e = new a.Vector3(0, 1, 0),
  3126. i = new a.Vector3(1, 0, 0);
  3127. return function(n, r, o, l, u, h, c) {
  3128. var d = s.mapFaceToCubemapFace(o);
  3129. if (a.cross(h, e, i), s.getTileVector(n, r, d, l, u, s.LocationOnTile.Center, 0, t), s.isWithinFOV(t, h, c, null)) return !0;
  3130. for (var p = c / 360, f = Math.floor(1 / p), m = 0, g = 0; g < f; g++) {
  3131. for (var v = s.LocationOnTile.UpperLeft; v <= s.LocationOnTile.LowerLeft; v++)
  3132. if (s.getTileVector(n, r, d, l, u, v, m, t), s.isWithinFOV(t, h, c, null)) return !0;
  3133. m += p
  3134. }
  3135. return !1
  3136. }
  3137. }(), s.isWithinFOV = function() {
  3138. var t = new a.Vector3,
  3139. e = new a.Vector3;
  3140. return function(i, n, r, o) {
  3141. if (a.copyVector(i, e), o) {
  3142. a.copyVector(o, t), a.normalize(t);
  3143. var s = a.dot(t, i);
  3144. t.x *= s, t.y *= s, t.z *= s, a.subVector(e, t)
  3145. }
  3146. var l = r / 2 * a.RADIANS_PER_DEGREE,
  3147. u = Math.cos(l);
  3148. return a.dot(e, n) >= u
  3149. }
  3150. }(), s.mapFaceToCubemapFace = function() {
  3151. var t = {
  3152. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  3153. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  3154. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  3155. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  3156. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  3157. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  3158. };
  3159. return function(e) {
  3160. return t[e]
  3161. }
  3162. }(), s.getDirectionalFov = function() {
  3163. var t = document.documentElement.clientWidth;
  3164. return t > 0 && t < 512 ? 60 : t >= 512 && t < 1024 ? 80 : t >= 1024 && t < 2048 ? 100 : t >= 2048 && t < 4096 ? 120 : t >= 4096 ? 180 : 60
  3165. }, t.exports = s
  3166. }, function(t, e) {
  3167. t.exports = {
  3168. NONE: 0,
  3169. MIDDLE: 1,
  3170. END: 2,
  3171. BEGINNING: 3,
  3172. FADEIN: 4
  3173. }
  3174. }, function(t, e) {
  3175. t.exports = {
  3176. ZERO: 48,
  3177. ONE: 49,
  3178. TWO: 50,
  3179. THREE: 51,
  3180. FOUR: 52,
  3181. FIVE: 53,
  3182. SIX: 54,
  3183. SEVEN: 55,
  3184. EIGHT: 56,
  3185. NINE: 57,
  3186. LEFTARROW: 37,
  3187. UPARROW: 38,
  3188. RIGHTARROW: 39,
  3189. DOWNARROW: 40,
  3190. A: 65,
  3191. B: 66,
  3192. C: 67,
  3193. D: 68,
  3194. E: 69,
  3195. F: 70,
  3196. G: 71,
  3197. H: 72,
  3198. I: 73,
  3199. J: 74,
  3200. K: 75,
  3201. L: 76,
  3202. M: 77,
  3203. N: 78,
  3204. O: 79,
  3205. P: 80,
  3206. Q: 81,
  3207. R: 82,
  3208. S: 83,
  3209. T: 84,
  3210. U: 85,
  3211. V: 86,
  3212. W: 87,
  3213. X: 88,
  3214. Y: 89,
  3215. Z: 90,
  3216. SPACE: 32,
  3217. RETURN: 13,
  3218. PLUSEQUALS: 187,
  3219. DASHUNDERSCORE: 189,
  3220. OPENBRACKET: 219,
  3221. ESC: 27,
  3222. DELETE: 46
  3223. }
  3224. }, function(t, e, i) {
  3225. function n() {
  3226. this.list = [], this.index = {}, Object.defineProperty(this, "length", {
  3227. get: function() {
  3228. return this.list.length
  3229. }
  3230. })
  3231. }
  3232. new(i(2))("/js/util/IndexedCollection.js"), n.prototype.forEach = function(t) {
  3233. this.list.forEach(t)
  3234. }, n.prototype.add = function(t) {
  3235. this.list.push(t), this.index[this.getIndex(t)] = t
  3236. }, n.prototype.getIndex = function(t) {
  3237. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  3238. }, n.prototype.extend = function(t) {
  3239. for (var e = 0; e < t.length; e++) this.add(t[e])
  3240. }, n.prototype.get = function(t) {
  3241. return this.index[t]
  3242. }, n.prototype.first = function() {
  3243. return this.list[0]
  3244. }, n.prototype.last = function() {
  3245. return this.list[this.list.length - 1]
  3246. }, n.prototype.reIndex = function() {
  3247. this.index = {};
  3248. var t = this;
  3249. this.forEach((function(e) {
  3250. t.index[t.getIndex(e)] = e
  3251. }))
  3252. }, n.prototype.filter = function(t) {
  3253. var e = this.list.filter(t);
  3254. return this.reIndex(), e
  3255. }, n.prototype.reduce = function(t, e) {
  3256. return this.list.reduce(t, e)
  3257. }, n.prototype.sort = function(t) {
  3258. return this.list.sort(t)
  3259. }, n.prototype.indexOf = function(t) {
  3260. for (var e = 0; e < this.list.length; ++e)
  3261. if (this.list[e] === t) return e;
  3262. return -1
  3263. }, n.prototype.getLength = function() {
  3264. return this.list.length
  3265. }, t.exports = n
  3266. }, function(t, e) {}, function(t, e, i) {
  3267. "use strict";
  3268. (function(e) {
  3269. var n, r, o, a, s, l, u = i(0),
  3270. h = (i(2), i(1)),
  3271. c = i(7),
  3272. d = i(9),
  3273. p = i(18),
  3274. f = i(32),
  3275. m = i(27),
  3276. g = i(4)
  3277. .EventEmitter,
  3278. v = i(28),
  3279. y = i(3),
  3280. b = !1,
  3281. w = !0;
  3282. function x(t) {
  3283. this.camera = t, this.camera.controls = this, this.target = new u.Vector3(0, 0, 0), this.lookVector = new u.Vector3, this.lookSpeed = .05, this.rotationAcc = new u.Vector2, this.rotationSpeed = new u.Vector2, this.lat = 0, this.lon = 0, this.phi = 0, this.theta = 0, this.enabled = !1, this.locked = !1, this.pointer = new u.Vector2(0, 0), this.rotationHistory = [], this.rotationDifference = new u.Vector2, this.pointerDragStart = new u.Vector2(0, 0), this.pinchDistance = 0, this.moveStart = new u.Vector2, this.moveTolerance = .01, this.pointersLimit = 2, this.pointers = [], this.euler = new u.Euler, this.el = new u.Euler, this.q0 = new u.Quaternion, this.q1 = new u.Quaternion(-Math.sqrt(.5), 0, 0, Math.sqrt(.5)), this.up = new u.Vector3(0, 1, 0), this.right = new u.Vector3(0, 0, 1), this.v = new u.Vector3, this.offsetLon = 0, this.offsetLat = 0, this.q3 = new u.Quaternion, G.panoStill = !0, this.s_rotationSpeed = new u.Vector2, this.s_rotationDifference = new u.Vector3, this.s_lat = 0, this.s_lon = 0, this.handleOperation = this.handleOperation.bind(this), this.connect = v(), this.connect.on("operation", this.handleOperation), this.lockedRotationFrom = !1, this.lockedMouseWheel = !1, this.disableKeyMove = !1, this.disableKeyRotate = !1;
  3284. var e = this,
  3285. i = !1;
  3286. Object.defineProperty(this, "pointerDragOn", {
  3287. get: function() {
  3288. return i
  3289. },
  3290. set: function(t) {
  3291. i = t, e.connect.busy = t
  3292. }
  3293. })
  3294. }
  3295. function M() {
  3296. G.conf.isCleanUI || (G.d.tourIsPlaying && G.d.stopTour(), clearTimeout(n), n = null, b || (b = !0))
  3297. }
  3298. function T() {
  3299. G.conf.isCleanUI
  3300. }
  3301. function S(t) {
  3302. t && function(t) {
  3303. t && (t.preventDefault(), t.stopPropagation())
  3304. }(t)
  3305. }
  3306. x.prototype = Object.create(g.prototype), x.prototype.bindEvents = function(t) {
  3307. t.addEventListener("mousemove", this.onMouseMove.bind(this)), t.addEventListener("mousedown", this.onMouseDown.bind(this)), t.addEventListener("mouseup", this.onMouseUp.bind(this)), t.addEventListener("mouseover", function(t) {
  3308. !this.pointerDragOn || 0 !== t.which && 0 !== t.buttons || this.onMouseUp(t)
  3309. }.bind(this)), t.addEventListener("touchstart", this.onTouchStart.bind(this)), t.addEventListener("touchmove", this.onTouchMove.bind(this)), t.addEventListener("touchend", this.onTouchEnd.bind(this)), t.addEventListener("contextmenu", (function(t) {
  3310. t.preventDefault()
  3311. })), t.addEventListener("pointerdown", this.onPointerDown.bind(this)), t.addEventListener("pointerup", this.onPointerUp.bind(this)), t.addEventListener("pointerout", this.onPointerUp.bind(this)), t.addEventListener("pointercancel", this.onPointerUp.bind(this)), t.addEventListener("pointermove", this.onPointerMove.bind(this)), t.addEventListener("keydown", this.onKeyDown.bind(this)), t.addEventListener("keyup", this.onKeyUp.bind(this)), h.useWheel && (t.addEventListener("mousewheel", this.onMouseWheel.bind(this)), t.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this)))
  3312. }, x.prototype.usable = function() {
  3313. return !G.ori.flag && (h.quickstart.enabled ? this.enabled : this.enabled && !this.locked)
  3314. }, x.prototype.lookAt = function(t) {
  3315. 0 == t.x && -5 == t.y && 0 == t.z && (t.z = -1);
  3316. var e = this.camera.position.clone()
  3317. .sub(t),
  3318. i = 0;
  3319. 0 == e.x && 0 == e.y && 0 == e.z && (e.z = 1), i = Math.atan(e.z / e.x), i += e.x < 0 ? Math.PI : 0, i += e.x > 0 && e.z < 0 ? 2 * Math.PI : 0, this.lon = u.Math.radToDeg(i) + 180;
  3320. var n = Math.sqrt(e.x * e.x + e.z * e.z);
  3321. i = 0, i = Math.atan(e.y / n), this.lat = -u.Math.radToDeg(i)
  3322. }, x.prototype.play = function(t) {
  3323. w && (this.lon = t.lon, this.lat = t.lat)
  3324. }, x.prototype.record = function() {
  3325. !G.R.rtime || G.R.time.getElapsedTime() - G.R.rtime > .15 ? G.R.rtime = G.R.save({
  3326. tap: "panorama",
  3327. panoid: G.player.currentPano.id,
  3328. action: "rotate",
  3329. lon: parseFloat(this.lon.toFixed(5)),
  3330. lat: parseFloat(this.lat.toFixed(5))
  3331. }) : G.R.last = {
  3332. tap: "panorama",
  3333. panoid: G.player.currentPano.id,
  3334. action: "rotate",
  3335. lon: this.lon,
  3336. lat: this.lat,
  3337. time: G.R.time.getElapsedTime()
  3338. }
  3339. }, x.prototype.startRotationFrom = function(t, e) {
  3340. this.lockedRotationFrom || (d.convertScreenPositionToNDC(t, e, this.pointer), this.pointerDragOn = !0, this.pointerDragStart.copy(this.pointer), this.moveStart.copy(this.pointer), this.rotationHistory = [], this.rotationSpeed.set(0, 0), this.disableOri())
  3341. }, x.prototype.disableOri = function() {
  3342. G.ori.timeoutID && clearTimeout(G.ori.timeoutID), G.ori.enable = !1
  3343. }, x.prototype.onTouchStart = function(t) {
  3344. if (this.usable()) {
  3345. switch (w = !1, M(), S(t), t.preventDefault(), t.stopPropagation(), t.touches.length) {
  3346. case 1:
  3347. this.startRotationFrom(t.touches[0].clientX, t.touches[0].clientY);
  3348. break;
  3349. case 2:
  3350. var e = (t.touches[0].clientX - t.touches[1].clientX) / (window.renderWidth || window.innerWidth),
  3351. i = (t.touches[0].clientY - t.touches[1].clientY) / (window.renderHeight || window.innerHeight);
  3352. this.pinchDistance = Math.sqrt(e * e + i * i)
  3353. }
  3354. this.emit(m.InputStart, "touch")
  3355. }
  3356. }, x.prototype.onPointerDown = function(t) {
  3357. this.usable() && "touch" === t.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3358. id: t.pointerId,
  3359. clientX: t.clientX,
  3360. clientY: t.clientY
  3361. }), t.touches = this.pointers, this.onTouchStart(t), this.emit(m.InputStart, "pointer"))
  3362. }, x.prototype.onMouseDown = function(t) {
  3363. this.usable() && (w = !1, S(), M(), 0 === t.button && this.startRotationFrom(t.clientX, t.clientY), this.emit(m.InputStart, "mouse"))
  3364. }, x.prototype.updateRotation = function() {
  3365. if (this.usable() && this.pointerDragOn) {
  3366. this.camera.matrix.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this.camera.matrixWorld.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  3367. var t = new u.Vector3(this.pointerDragStart.x, this.pointerDragStart.y, -1)
  3368. .unproject(this.camera),
  3369. e = new u.Vector3(this.pointer.x, this.pointer.y, -1)
  3370. .unproject(this.camera),
  3371. i = Math.sqrt(t.x * t.x + t.z * t.z),
  3372. n = Math.sqrt(e.x * e.x + e.z * e.z),
  3373. r = Math.atan2(t.y, i),
  3374. o = Math.atan2(e.y, n);
  3375. this.rotationDifference.y = u.Math.radToDeg(r - o), t.y = 0, e.y = 0;
  3376. var a = Math.acos(t.dot(e) / t.length() / e.length());
  3377. isNaN(a) || (this.rotationDifference.x = u.Math.radToDeg(a), this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)), this.pointerDragStart.copy(this.pointer)
  3378. }
  3379. }, x.prototype.onMouseMove = function(t) {
  3380. this.usable() && (d.convertScreenPositionToNDC(t.clientX, t.clientY, this.pointer), this.pointerDragOn && (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) && this.emit(m.Move, "mouse"))
  3381. }, x.prototype.onTouchMove = function(t) {
  3382. if (this.usable()) {
  3383. switch (t.touches.length) {
  3384. case 1:
  3385. d.convertScreenPositionToNDC(t.touches[0].clientX, t.touches[0].clientY, this.pointer), this.disableOri();
  3386. break;
  3387. case 2:
  3388. var e = (t.touches[0].clientX - t.touches[1].clientX) / (window.renderWidth || window.innerWidth),
  3389. i = (t.touches[0].clientY - t.touches[1].clientY) / (window.renderHeight || window.innerHeight),
  3390. n = this.pinchDistance - Math.sqrt(e * e + i * i);
  3391. Math.abs(n) > .01 && (this.emit(m.InteractionDirect), this.emit(m.Pinch, n), this.pinchDistance -= n)
  3392. }
  3393. this.emit(m.Move, "touch")
  3394. }
  3395. }, x.prototype.onPointerMove = function(t) {
  3396. this.usable() && "touch" === t.pointerType && (this.pointers.forEach((function(e) {
  3397. t.pointerId === e.id && (e.clientX = t.clientX, e.clientY = t.clientY)
  3398. })), t.touches = this.pointers, this.onTouchMove(t))
  3399. }, x.prototype.endRotation = function() {
  3400. this.pointerDragOn = !1;
  3401. var t = c.averageVectors(this.rotationHistory);
  3402. this.rotationSpeed.set(t.x * h.rotationAfterMoveMultiplier, t.y * h.rotationAfterMoveMultiplier)
  3403. }, x.prototype.onTouchEnd = function(t) {
  3404. this.usable() && (T(), w = !0, t.preventDefault(), t.stopPropagation(), this.endRotation())
  3405. }, x.prototype.onMouseUp = function(t) {
  3406. this.usable() && (T(), w = !0, t.preventDefault(), t.stopPropagation(), this.endRotation())
  3407. }, x.prototype.onPointerUp = function(t) {
  3408. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e, i) {
  3409. t.pointerId === e.id && this.pointers.splice(i, 1)
  3410. }.bind(this)), t.touches = this.pointers, this.onTouchEnd(t))
  3411. }, x.prototype.update = function(t) {
  3412. if (null != G.frameRate && (G.frameRate < 12 ? h.rotationFriction = .6 : h.rotationFriction = .06), y.isMobile() && (t = .016, 0 != this.rotationSpeed.x && Math.abs(this.rotationSpeed.x) < 6 && (this.rotationSpeed.x = 0), 0 != this.rotationSpeed.y && Math.abs(this.rotationSpeed.y) < 6 && (this.rotationSpeed.y = 0), 0 == this.rotationSpeed.x && 0 == this.rotationSpeed.y ? G.panoStill = !0 : G.panoStill = !1), !G.R.playing)
  3413. for (this.updateRotation(), this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > h.rotationAfterMoveHistoryCount;) this.rotationHistory.shift();
  3414. var i = this.lon,
  3415. n = this.lat;
  3416. if (G.ori.flag ? (this.offsetLon += this.rotationDifference.x, this.offsetLat += this.rotationDifference.y, this.rotationSpeed.x = this.rotationSpeed.x * (1 - h.rotationFriction) + this.rotationAcc.x * h.rotationAccelerationInside, this.rotationSpeed.y = this.rotationSpeed.y * (1 - h.rotationFriction) + this.rotationAcc.y * h.rotationAccelerationInside, this.offsetLon += this.rotationSpeed.x * t, this.offsetLat += this.rotationSpeed.y * t, this.offsetLat = Math.max(h.insideLookLimitDown, Math.min(h.insideLookLimitUp, this.offsetLat)), G.ori.enable && !G.playing && (this.euler.set(G.ori.beta, G.ori.alpha, -G.ori.gamma, "YXZ"), this.q3 = this.camera.quaternion.clone(), this.q3.setFromEuler(this.euler)
  3417. .multiply(this.q1), this.q3.multiply(this.q0.setFromAxisAngle(this.right, -G.ori.orient)), this.v.set(0, 0, 1)
  3418. .applyQuaternion(this.q3), this.lat = u.Math.radToDeg(this.v.angleTo(this.up) - Math.PI / 2), this.v.set(1, 0, 0)
  3419. .applyQuaternion(this.q3), this.v.clone()
  3420. .cross(this.right)
  3421. .y > 0 ? this.lon = 360 + u.Math.radToDeg(this.v.angleTo(this.right)) : this.lon = 360 - u.Math.radToDeg(this.v.angleTo(this.right))), this.phi = u.Math.degToRad(90 - (this.lat + this.offsetLat)), this.theta = u.Math.degToRad(this.lon + this.offsetLon), this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta), this.lookVector.y = Math.cos(this.phi), this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta), this.target.copy(this.lookVector)
  3422. .add(this.camera.position), this.camera.lookAt(this.target), G.ori.enable = !0) : (t || (t = 1 / 60), this.rotationSpeed.x = this.rotationSpeed.x * (1 - h.rotationFriction) + this.rotationAcc.x * h.rotationAccelerationInside, this.rotationSpeed.y = this.rotationSpeed.y * (1 - h.rotationFriction) + this.rotationAcc.y * h.rotationAccelerationInside, this.connect.remoteControl || this.connect.sync || (this.lon += this.rotationDifference.x, this.lat += this.rotationDifference.y, this.lon += this.rotationSpeed.x * t, this.lat += this.rotationSpeed.y * t, this.sendFrameData(t), this.rotationDifference.set(0, 0)), this.lat = Math.max(h.insideLookLimitDown, Math.min(h.insideLookLimitUp, this.lat)), this.updateCamera(this.lon, this.lat)), this.rotationDifference.set(0, 0), G.R.recording && this.record(), d.compareFloats(i, this.lon) && d.compareFloats(n, this.lat) ? this.emit(m.PanoramaMoveStop) : (this.emit(m.RulersMove), this.emit(m.PanoramaMove)), "open" === e("#size-button")
  3423. .attr("openflag")) var r = this.lon,
  3424. o = this.lat;
  3425. if (G.player.mattertagManager && G.player.mattertagManager.showtitletags) {
  3426. r = this.lon, o = this.lat;
  3427. G.player.mattertagManager && (!G.player.mattertagManager.ttflying && d.compareFloats(i, r) && d.compareFloats(n, o) || this.emit(m.TtagsMove))
  3428. }
  3429. }, x.prototype.sendFrameData = (a = 0, s = new u.Vector2, l = new u.Vector2, function(t) {
  3430. (a += t) < h.connectDelay || (a = 0, Math.abs(r - this.lon) < .001 && Math.abs(o - this.lat) < .001 || (this.connect.sendOperation({
  3431. type: "pano",
  3432. lon: this.lon,
  3433. lat: this.lat,
  3434. time: Date.now(),
  3435. rotationDifference: this.rotationDifference.toArray(),
  3436. rotationSpeed: this.rotationSpeed.toArray()
  3437. }), r = this.lon, o = this.lat, s.copy(this.rotationSpeed), l.copy(this.rotationDifference)))
  3438. });
  3439. var _ = 0;
  3440. x.prototype.updateCamera = function(t, e) {
  3441. _++, this.phi = u.Math.degToRad(90 - e), this.theta = u.Math.degToRad(t), this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta), this.lookVector.y = Math.cos(this.phi), this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta), this.target.copy(this.lookVector)
  3442. .add(this.camera.position), this.camera.lookAt(this.target), 0 == _ % 6 && (_ = 0)
  3443. }, x.prototype._progressNumber = function(t, e, i) {
  3444. return t + (e - t) * i
  3445. }, x.prototype._progressRad = function(t, e, i) {
  3446. var n = 2 * Math.PI,
  3447. r = Math.PI,
  3448. o = function(t) {
  3449. return (t % n + n) % n
  3450. };
  3451. return t = o(t), (e = o(e)) - t > r ? this._progressNumber(t + n, e, i) : t - e > r ? this._progressNumber(t - n, e, i) : this._progressNumber(t, e, i)
  3452. }, x.prototype.handleOperation = function(t) {
  3453. var e = this;
  3454. if ("pano" === t.type) {
  3455. var i = t.lon,
  3456. n = t.lat;
  3457. Date.now(), t.time;
  3458. this.s_lon = i, this.s_lat = n, this.lonTweenProcess = null, this.latTweenProcess = null, this.tweenProgress && (this.tweenProgress.stop(), this.tweenProgress = null);
  3459. var r = this.lon,
  3460. o = this.lat;
  3461. h.connectDelay;
  3462. this.tweenProgress = new TWEEN.Tween({
  3463. progress: 0
  3464. })
  3465. .to({
  3466. progress: 1
  3467. }, h.animationDelay)
  3468. .easing(TWEEN.Easing.Linear.None)
  3469. .start(), this.tweenProgress.onUpdate((function(t) {
  3470. null === i && 0 === i || (e.lon = e._progressNumber(r, i, this.progress)), null === n && 0 === i || (e.lat = e._progressNumber(o, n, this.progress))
  3471. })), this.tweenProgress.onComplete((function() {
  3472. this.tweenProgress = null
  3473. })), this.s_time = t.time, this.s_rotationDifference.fromArray(t.rotationDifference), this.s_rotationSpeed.fromArray(t.rotationSpeed), this.rotationSpeed.copy(this.s_rotationSpeed)
  3474. }
  3475. }, x.prototype.onMouseWheel = function(t) {
  3476. if (!this.lockedMouseWheel && this.usable() && !G.R.playing) {
  3477. var e = t.wheelDelta || -t.detail;
  3478. this.emit(m.InteractionDirect), this.emit(m.Scroll, e)
  3479. }
  3480. }, x.prototype.onKeyDown = function(t) {
  3481. this.usable() && (t.metaKey || t.ctrlKey || (t.preventDefault(), this.handleKeyDown(t.which)))
  3482. }, x.prototype.handleKeyDown = function(t) {
  3483. var e = function(t) {
  3484. this.disableKeyMove || this.flyDirection(t)
  3485. }.bind(this),
  3486. i = function(t, e) {
  3487. this.disableKeyRotate || (this.rotationAcc[t] = e)
  3488. }.bind(this);
  3489. this.emit(m.InteractionKey);
  3490. var n = !0;
  3491. switch (t) {
  3492. case f.UPARROW:
  3493. case f.W:
  3494. e(p.FORWARD);
  3495. break;
  3496. case f.DOWNARROW:
  3497. case f.S:
  3498. e(p.BACK);
  3499. break;
  3500. case f.A:
  3501. e(p.LEFT);
  3502. break;
  3503. case f.D:
  3504. e(p.RIGHT);
  3505. break;
  3506. case f.LEFTARROW:
  3507. case f.J:
  3508. i("x", -1);
  3509. break;
  3510. case f.RIGHTARROW:
  3511. case f.L:
  3512. i("x", 1);
  3513. break;
  3514. case f.I:
  3515. i("y", 1);
  3516. break;
  3517. case f.K:
  3518. i("y", -1);
  3519. break;
  3520. default:
  3521. n = !1
  3522. }
  3523. n && this.emit(m.Move, "key")
  3524. }, x.prototype.onKeyUp = function(t) {
  3525. this.usable() && (t.preventDefault(), t.stopPropagation(), this.handleKeyUp(t.which))
  3526. }, x.prototype.handleKeyUp = function(t) {
  3527. switch (t) {
  3528. case f.LEFTARROW:
  3529. case f.J:
  3530. case f.RIGHTARROW:
  3531. case f.L:
  3532. this.rotationAcc.x = 0;
  3533. break;
  3534. case f.I:
  3535. case f.K:
  3536. this.rotationAcc.y = 0;
  3537. break;
  3538. case f.ESC:
  3539. }
  3540. }, x.prototype.reset = function() {
  3541. this.pointerDragOn = !1, this.rotationAcc.set(0, 0), this.rotationSpeed.set(0, 0), this.pointers = []
  3542. }, x.prototype.flyDirection = function(t) {
  3543. this.emit(m.FlyInDirection, t.clone())
  3544. }, x.prototype.copy = function(t) {
  3545. this.target.copy(t.target), this.lookVector.copy(t.lookVector), this.lookSpeed = t.lookSpeed, this.rotationAcc.copy(t.rotationAcc), this.rotationSpeed.copy(t.rotationSpeed), this.lat = t.lat, this.lon = t.lon, this.phi = t.phi, this.theta = t.theta, this.enabled = t.enabled, this.locked = t.locked, this.pointer.copy(t.pointer), this.rotationHistory = t.rotationHistory.slice(), this.rotationDifference.copy(t.rotationDifference), this.pointerDragOn = t.pointerDragOn, this.pointerDragStart.copy(t.pointerDragStart), this.pinchDistance = t.pinchDistance, this.moveStart.copy(t.moveStart), this.moveTolerance = t.moveTolerance, this.pointersLimit = t.pointersLimit, this.pointers = t.pointers.slice()
  3546. }, x.prototype.toJSON = function() {
  3547. return {
  3548. _viewpoint: {
  3549. x: d.toPrecision(this.camera.position.x, 4),
  3550. y: d.toPrecision(this.camera.position.y, 4),
  3551. z: d.toPrecision(this.camera.position.z, 4)
  3552. },
  3553. _rotation: {
  3554. x: d.toPrecision(this.camera.quaternion.x, 4),
  3555. y: d.toPrecision(this.camera.quaternion.y, 4),
  3556. z: d.toPrecision(this.camera.quaternion.z, 4),
  3557. w: d.toPrecision(this.camera.quaternion.w, 4)
  3558. }
  3559. }
  3560. }, x.prototype.setStateFromJSON = function(t) {
  3561. this.camera.position.copy(t._viewpoint), this.camera.quaternion.copy(t._rotation)
  3562. }, t.exports = x
  3563. })
  3564. .call(this, i(6))
  3565. }, function(t, e, i) {
  3566. var n = i(3);
  3567. function r(t) {
  3568. return s[t]
  3569. }
  3570. var o = i(29),
  3571. a = [0, 1, 2, 3, 4, 5],
  3572. s = {
  3573. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  3574. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  3575. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  3576. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  3577. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  3578. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  3579. };
  3580. t.exports = {
  3581. mapFaceToCubemapFace: r,
  3582. getCubemapUrls: function(t, e, i) {
  3583. return a.map(function(t, o) {
  3584. var a = n.isMobile() ? "mobile" : "pc";
  3585. return G.url.model + "/locations/" + a + "/" + i + "/" + e + "_" + r(t) + ".jpg"
  3586. }.bind(this))
  3587. }
  3588. }
  3589. }, function(t, e, i) {
  3590. var n = i(0),
  3591. r = i(1);
  3592. function o() {
  3593. n.PerspectiveCamera.call(this, r.insideFOV, (window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight), r.insideNear, r.insideFar), this.controls = null
  3594. }
  3595. o.prototype = Object.create(n.PerspectiveCamera.prototype), o.prototype.updateAspect = function(t) {
  3596. this.aspect = t, this.updateProjectionMatrix()
  3597. }, t.exports = o
  3598. }, function(t, e, i) {
  3599. (function(e) {
  3600. i(3);
  3601. function n(t, e, i, r, o) {
  3602. this.qualityManager = t, this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(), this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(), this.baseSize = e, this.standardSize = i, this.highSize = r, this.ultraHighSize = o, this.priorityCriteria = new n.PriorityCriteria(null, new l.Vector3(0, 0, 0), new l.Vector3(0, 0, -1), new l.Vector3(0, 0, -1)), this.directional_fov = this.getDirectionalFov()
  3603. }
  3604. var r, o, a, s, l = i(0),
  3605. u = (i(5), i(1), i(19)),
  3606. h = i(2),
  3607. c = (i(18), i(23), i(21), i(29), i(65)),
  3608. d = (i(3), i(30)),
  3609. p = i(9),
  3610. f = (i(4)
  3611. .EventEmitter, new h(e), Object.freeze({
  3612. None: 0,
  3613. DirectionalFOV: 1
  3614. }));
  3615. n.PriorityCriteria = function(t, e, i, n, r) {
  3616. this.pano = t, this.cameraPosition = (new l.Vector3)
  3617. .copy(e), this.cameraDir = (new l.Vector3)
  3618. .copy(i), this.panoSpaceDir = (new l.Vector3)
  3619. .copy(n), this.upcomingPanos = r, this.copy = function(t) {
  3620. this.pano = t.pano, this.cameraPosition.copy(t.cameraPosition), this.cameraDir.copy(t.cameraDir), this.panoSpaceDir.copy(t.panoSpaceDir), this.upcomingPanos = r
  3621. }, this.zoomingActive = !1
  3622. }, n.DIRECTIONAL_FOV_NARROW = 10, n.MAX_SCORED_PANOS_TOCONSIDER = 6, n.MAX_SCORED_PANOS_TOADD = 2, n.MAX_UPCOMING_PANOS_TOADD = 3, n.DIRECTION_SCORE_STRICTNESS = .75, n.appendQueue = function(t, e) {
  3623. if (t && e)
  3624. for (var i = 0; i < e.length; i++) t.push(e[i])
  3625. }, n.prototype.getDirectionalFov = function() {
  3626. var t = document.documentElement.clientWidth;
  3627. return t > 0 && t < 512 ? 60 : t >= 512 && t < 1024 ? 80 : t >= 1024 && t < 2048 ? 100 : t >= 2048 && t < 4096 ? 120 : t >= 4096 ? 180 : 60
  3628. }, n.prototype.updateCriteria = function(t, e, i, n) {
  3629. this.priorityCriteria.pano = t, this.priorityCriteria.cameraPosition.copy(e), this.priorityCriteria.cameraDir.copy(i), this.priorityCriteria.upcomingPanos = n, this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(), this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  3630. }, n.prototype.filterAndPrioritize = (o = [], a = [], s = [], function(t, e, i) {
  3631. this.populateNeighborPanos(this.priorityCriteria.pano, e, o), this.populateScoredPanos(this.priorityCriteria.pano, e, a, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  3632. var r = this.baseSize,
  3633. l = this.standardSize,
  3634. u = this.highSize,
  3635. h = this.ultraHighSize;
  3636. this.queueTilesForPano(t, i, this.priorityCriteria.pano, r), this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(t, this.priorityCriteria.upcomingPanos, i, r, n.MAX_UPCOMING_PANOS_TOADD), s.length = 0, this.canDownloadSize(l) && this.queueTilesInDirectionForPano(s, i, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW), n.sortPanoTiles(s, this.priorityCriteria.pano, this.priorityCriteria.cameraDir), n.appendQueue(t, s), this.queueTilesForPanos(t, a, i, r, n.MAX_SCORED_PANOS_TOADD), s.length = 0, this.canDownloadSize(u) && this.queueTilesInDirectionForPano(s, i, this.priorityCriteria.pano, u, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW), this.canDownloadSize(h) && this.queueTilesInDirectionForPano(s, i, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW), n.sortPanoTiles(s, this.priorityCriteria.pano, this.priorityCriteria.cameraDir), n.appendQueue(t, s), s.length = 0, this.canDownloadSize(l) && this.queueTilesInDirectionForPano(s, i, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, this.directional_fov), this.canDownloadSize(u) && this.queueTilesInDirectionForPano(s, i, this.priorityCriteria.pano, u, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, this.directional_fov), this.canDownloadSize(h) && this.queueTilesInDirectionForPano(s, i, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, this.directional_fov), n.sortPanoTiles(s, this.priorityCriteria.pano, this.priorityCriteria.cameraDir), n.appendQueue(t, s), this.queueTilesForPanos(t, o, i, r)
  3637. }), n.prototype.canDownloadSize = function(t) {
  3638. return this.maxNavQuality >= t || this.maxZoomQuality >= t && this.zoomingActive
  3639. }, n.prototype.populateNeighborPanos = function(t, e, i) {
  3640. (i = i || [])
  3641. .length = 0;
  3642. var n = e.getNeighbours(t),
  3643. r = 0;
  3644. for (var o in n)
  3645. if (n.hasOwnProperty(o)) {
  3646. var a = e.get(o);
  3647. if (t.id !== a.id && (i.push(a), 1 == ++r)) break
  3648. } return i
  3649. }, n.prototype.populateScoredPanos = function(t, e, i, r, o) {
  3650. (i = i || [])
  3651. .length = 0;
  3652. var a = [u.filters.inPanoDirection(t.position, r, n.DIRECTION_SCORE_STRICTNESS), u.filters.not(t)],
  3653. s = [u.scoreFunctions.distanceSquared(t), u.scoreFunctions.direction(t.position, r)],
  3654. l = e.sortByScore(a, s);
  3655. if (l)
  3656. for (var h = 0; h < l.length && h < o; h++) {
  3657. var c = l[h].pano;
  3658. i.push(c)
  3659. }
  3660. return i
  3661. }, n.prototype.queueTilesForPanos = function(t, e, i, n, r) {
  3662. for (var o = 0, a = 0; a < e.length; a++) {
  3663. var s = e[a];
  3664. if (o += this.queueTilesForPano(t, i, s, n) > 0 ? 1 : 0, r && o >= r) break
  3665. }
  3666. return o
  3667. }, n.prototype.queueTilesForPano = (r = {
  3668. filter: f.None
  3669. }, function(t, e, i, n) {
  3670. return this.filterAndQueueTileDownloadDescriptors(t, e, i, n, r)
  3671. }), n.prototype.queueTilesForPanosInDirection = function() {
  3672. var t = new l.Vector3;
  3673. return function(e, i, n, r, o, a, s, l) {
  3674. for (var u = 0, h = 0; h < n.length; h++) {
  3675. var c = n[h];
  3676. if (t.copy(c.position), t.sub(o), t.normalize(), Math.max(Math.min(a.dot(t), 1), -1) >= p.getFOVDotThreshold(s))
  3677. if (u += this.queueTilesInDirectionForPano(e, i, c, r, o, a, s) > 0 ? 1 : 0, l && u >= l) break
  3678. }
  3679. return u
  3680. }
  3681. }(), n.prototype.queueTilesInDirectionForPanos = function(t, e, i, n, r, o, a, s) {
  3682. for (var l = 0, u = 0; u < i.length; u++) {
  3683. var h = i[u];
  3684. if (l += this.queueTilesInDirectionForPano(t, e, h, n, o, a) > 0 ? 1 : 0, s && l >= s) break
  3685. }
  3686. return l
  3687. }, n.prototype.queueTilesInDirectionForPano = function() {
  3688. var t = {
  3689. filter: f.DirectionalFOV,
  3690. direction: new l.Vector3,
  3691. fov: 60
  3692. },
  3693. e = new l.Vector3;
  3694. return function(i, n, r, o, a, s, l) {
  3695. return e.copy(s), d.getRelativeDirection(r.quaternion, e), t.direction.copy(e), t.fov = l, this.filterAndQueueTileDownloadDescriptors(i, n, r, o, t)
  3696. }
  3697. }(), n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  3698. var t = [];
  3699. return function(e, i, n, r, o) {
  3700. var a = i.getTileDownloadDescriptors(n, r);
  3701. t.length = 0, this.filterTileDownloadDescriptors(n, a, t, o);
  3702. for (var s = 0, l = 0; l < t.length; l++) {
  3703. var u = t[l];
  3704. u && (e.push(u), s++)
  3705. }
  3706. return s
  3707. }
  3708. }(), n.prototype.filterTileDownloadDescriptors = (new l.Vector3, function(t, e, i, n) {
  3709. var r, o;
  3710. switch (n.filter) {
  3711. case f.DirectionalFOV:
  3712. for (r = 0; r < e.length; r++) o = e[r], d.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  3713. break;
  3714. default:
  3715. for (r = 0; r < e.length; r++) o = e[r], i.push(o)
  3716. }
  3717. for (r = 0; r < i.length; r++) o = i[r], this.canIncludeDescriptor(o) || (i[r] = null)
  3718. }), n.prototype.canIncludeDescriptor = function(t) {
  3719. return t.status !== c.Downloading && t.status !== c.Downloaded
  3720. }, n.prototype.canIncludePano = function(t, e) {
  3721. return !t.isLoaded(e)
  3722. }, n.getFOVDotThreshold = function(t) {
  3723. return Math.cos(l.Math.degToRad(t / 2))
  3724. };
  3725. var m = function() {
  3726. var t = function t(e, i) {
  3727. var n = t._panoSpaceDir,
  3728. r = t._fovThreshold,
  3729. o = t._fovThresholdNarrow,
  3730. a = Math.max(Math.min(n.dot(e.direction), 1), -1),
  3731. s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  3732. return e._dot = a, i._dot = s, a >= r && s < r ? -1 : a < r && s >= r ? 1 : a >= o && s < o ? -1 : a < o && s >= o || e.panoSize > i.panoSize ? 1 : i.panoSize > e.panoSize ? -1 : -(a - s)
  3733. };
  3734. return t._panoSpaceDir = new l.Vector3, t._fovThreshold = -1, t._fovThresholdNarrow = -1, t
  3735. }();
  3736. n.sortPanoTiles = function(t, e, i) {
  3737. m._panoSpaceDir.copy(i), d.getRelativeDirection(e.quaternion, m._panoSpaceDir), m._fovThresholdNarrow = p.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW), m._fovThreshold = p.getFOVDotThreshold(d.getDirectionalFov()), t.sort(m)
  3738. }, n.insertSortedPanoTile = function(t, e, i, r) {
  3739. m._panoSpaceDir.copy(r), d.getRelativeDirection(i.quaternion, m._panoSpaceDir), m._fovThresholdNarrow = p.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW), m._fovThreshold = p.getFOVDotThreshold(d.getDirectionalFov());
  3740. for (var o = -1, a = 0; a < t.length; a++) {
  3741. if (m(e, t[a]) <= 0) {
  3742. o = a;
  3743. break
  3744. }
  3745. }
  3746. if (-1 === o) t[t.length] = e;
  3747. else {
  3748. for (var s = t.length; s > o; s--) t[s] = t[s - 1];
  3749. t[o] = e
  3750. }
  3751. }, n.prototype.setZoomingActive = function(t) {
  3752. t !== this.zoomingActive && (this.zoomingActive = t)
  3753. }, t.exports = n
  3754. })
  3755. .call(this, "/js/tile/TilePrioritizer.js")
  3756. }, function(t, e) {
  3757. t.exports = {
  3758. BuildingType: 0,
  3759. TextOnly: 1,
  3760. ImageText: 2,
  3761. Audio: 4,
  3762. OtherModel: 5,
  3763. TextAudio: 6,
  3764. ImageTextAudio: 7,
  3765. IFrame: 8,
  3766. Tag360T1: 9,
  3767. TagTo360: 10,
  3768. Video: 11,
  3769. Title: 12,
  3770. RegionalJump: 13,
  3771. Custome: 104,
  3772. ClassifyType: {
  3773. Indoor: 1,
  3774. Building: 2
  3775. },
  3776. EW: 101,
  3777. IKEA: 102,
  3778. Pano: 9e3
  3779. }
  3780. }, function(t, e) {
  3781. t.exports = function(t) {
  3782. var e = function(e) {
  3783. t.MeshBasicMaterial.call(this), this.depthTest = !1, this.depthWrite = !1, this.transparent = !0, this.opacity = .8, this.color.setHex(e.color), this.highlight = function(t) {
  3784. this.opacity = t ? 1 : .8
  3785. }
  3786. };
  3787. (e.prototype = Object.create(t.MeshBasicMaterial.prototype))
  3788. .constructor = e;
  3789. var i = function(e) {
  3790. t.LineBasicMaterial.call(this), this.depthTest = !1, this.depthWrite = !1, this.transparent = !0, this.linewidth = 1, this.color.setHex(e.color), this.highlight = function(t) {}
  3791. };
  3792. (i.prototype = Object.create(t.LineBasicMaterial.prototype))
  3793. .constructor = i;
  3794. var n = (new t.TextureLoader)
  3795. .load("images/torus_2x.png"),
  3796. r = (new t.TextureLoader)
  3797. .load("images/arc_surface_2x.png");
  3798. n.minFilter = r.minFilter = t.LinearFilter, n.magFilter = r.magFilter = t.LinearFilter;
  3799. var o = function() {
  3800. for (var e = [{
  3801. x: 26,
  3802. y: 16
  3803. }, {
  3804. x: 26,
  3805. y: 6
  3806. }, {
  3807. x: -54,
  3808. y: 6
  3809. }, {
  3810. x: -54,
  3811. y: -6
  3812. }, {
  3813. x: 26,
  3814. y: -6
  3815. }, {
  3816. x: 26.1,
  3817. y: -16.1
  3818. }, {
  3819. x: 54,
  3820. y: 0
  3821. }], i = new t.Shape, n = 0, r = e.length; n < r; ++n) 0 === n ? i.moveTo(e[n].x, e[n].y) : i.lineTo(e[n].x, e[n].y);
  3822. return new t.ExtrudeBufferGeometry(i, {
  3823. depth: 8,
  3824. bevelEnabled: !1,
  3825. bevelSegments: 1,
  3826. steps: 1,
  3827. bevelSize: 1,
  3828. bevelThickness: 1
  3829. })
  3830. },
  3831. a = function(e) {
  3832. var i = [{
  3833. x: -84.5,
  3834. y: 21.5
  3835. }, {
  3836. x: -82.8,
  3837. y: -11.5
  3838. }, {
  3839. x: -72,
  3840. y: -2.7
  3841. }, {
  3842. x: -60.3,
  3843. y: -7.8
  3844. }, {
  3845. x: -50.2,
  3846. y: -11.9
  3847. }, {
  3848. x: -36.3,
  3849. y: -16.2
  3850. }, {
  3851. x: -24.8,
  3852. y: -18.8
  3853. }, {
  3854. x: -10.57,
  3855. y: -21.01
  3856. }, {
  3857. x: 6.4,
  3858. y: -21.74
  3859. }, {
  3860. x: 20.67,
  3861. y: -21.09
  3862. }, {
  3863. x: 35.02,
  3864. y: -18.28
  3865. }, {
  3866. x: 45.3,
  3867. y: -15.7
  3868. }, {
  3869. x: 56.5,
  3870. y: -11.5
  3871. }, {
  3872. x: 72.6,
  3873. y: -4.5
  3874. }, {
  3875. x: 83.5,
  3876. y: -13.5
  3877. }, {
  3878. x: 84.5,
  3879. y: 20.5
  3880. }, {
  3881. x: 52.5,
  3882. y: 13.1
  3883. }, {
  3884. x: 60.7,
  3885. y: 5
  3886. }, {
  3887. x: 48.38,
  3888. y: .6
  3889. }, {
  3890. x: 35.6,
  3891. y: -3.1
  3892. }, {
  3893. x: 24.7,
  3894. y: -5.2
  3895. }, {
  3896. x: 12.9,
  3897. y: -6.7
  3898. }, {
  3899. x: -1.6,
  3900. y: -7
  3901. }, {
  3902. x: -14.9,
  3903. y: -5.7
  3904. }, {
  3905. x: -27.8,
  3906. y: -3.2
  3907. }, {
  3908. x: -41.2,
  3909. y: .5
  3910. }, {
  3911. x: -50.7,
  3912. y: 3.9
  3913. }, {
  3914. x: -59.7,
  3915. y: 7.6
  3916. }, {
  3917. x: -51.8,
  3918. y: 14.4
  3919. }],
  3920. n = new t.Shape;
  3921. n.moveTo(i[0].x, i[0].y);
  3922. for (var r = 1; r < i.length; ++r) n.lineTo(i[r].x, i[r].y);
  3923. return new t.ExtrudeGeometry(n, {
  3924. depth: e,
  3925. bevelEnabled: !1,
  3926. bevelSegments: 1,
  3927. steps: 1,
  3928. bevelSize: 1,
  3929. bevelThickness: 1
  3930. })
  3931. },
  3932. s = function() {
  3933. var e = new t.PlaneBufferGeometry(4, 4),
  3934. i = new t.MeshBasicMaterial({
  3935. map: n,
  3936. side: t.DoubleSide,
  3937. transparent: !0,
  3938. depthTest: !1,
  3939. depthWrite: !1
  3940. });
  3941. return new t.Mesh(e, i)
  3942. },
  3943. l = function() {
  3944. var e = new t.PlaneBufferGeometry(2.84, .74),
  3945. i = new t.MeshBasicMaterial({
  3946. map: r,
  3947. side: t.DoubleSide,
  3948. transparent: !0,
  3949. depthTest: !1,
  3950. depthWrite: !1
  3951. });
  3952. return new t.Mesh(e, i)
  3953. },
  3954. u = function(i) {
  3955. var n = new t.Group,
  3956. r = new t.Mesh(new a(8), new e({
  3957. color: i.color
  3958. }));
  3959. r.name = i.name, r.scale.set(.01, .01, .01), r.position.set(0, -1.84, 0), r.userData.isPicker = !0, n.add(r);
  3960. var o = new s;
  3961. o.name = "Torus", o.visible = !1, n.add(o);
  3962. var u = new l;
  3963. return u.name = "ArcSurface", u.visible = !1, u.position.y -= 1.84 - .37 + .18, u.position.z += .01, n.add(u), n
  3964. };
  3965. function h(e, i) {
  3966. t.Object3D.call(this), i = void 0 !== i ? i : document, this.object = void 0, this.visible = !1, this.translationSnap = null, this.rotationSnap = null, this.space = "world", this.size = 1, this.axis = null, this.currentWorldPosition = new t.Vector3, this.clock = new t.Clock, this.delta = 0, this.MOVELOCK = {
  3967. X: {
  3968. state: !1,
  3969. crash_point: null
  3970. },
  3971. Y: {
  3972. state: !1,
  3973. crash_point: null
  3974. },
  3975. Z: {
  3976. state: !1,
  3977. crash_point: null
  3978. }
  3979. };
  3980. var n = this,
  3981. r = "translate",
  3982. o = !1,
  3983. a = {
  3984. translate: new t.TransformGizmoDIYTranslate,
  3985. rotate: new t.TransformGizmoDIYRotate
  3986. };
  3987. for (var s in this._gizmo = a, a) {
  3988. var l = a[s];
  3989. l.visible = s === r, this.add(l)
  3990. }
  3991. var u = {
  3992. type: "change"
  3993. },
  3994. h = {
  3995. type: "mouseDown"
  3996. },
  3997. c = {
  3998. type: "mouseUp",
  3999. mode: r
  4000. },
  4001. d = {
  4002. type: "objectChange"
  4003. },
  4004. p = new t.Raycaster,
  4005. f = new t.Vector2,
  4006. m = new t.Vector3,
  4007. g = new t.Vector3,
  4008. v = new t.Vector3,
  4009. y = new t.Vector3,
  4010. b = 1,
  4011. w = (new t.Matrix4, new t.Vector3),
  4012. x = new t.Matrix4,
  4013. M = new t.Vector3,
  4014. T = new t.Quaternion,
  4015. S = new t.Vector3(1, 0, 0),
  4016. _ = new t.Vector3(0, 1, 0),
  4017. A = new t.Vector3(0, 0, 1),
  4018. P = new t.Quaternion,
  4019. C = new t.Quaternion,
  4020. E = new t.Quaternion,
  4021. D = new t.Quaternion,
  4022. L = (new t.Quaternion, new t.Vector3),
  4023. O = new t.Vector3,
  4024. I = new t.Matrix4,
  4025. R = new t.Matrix4,
  4026. N = new t.Vector3,
  4027. k = new t.Vector3,
  4028. F = new t.Euler,
  4029. B = new t.Matrix4,
  4030. z = new t.Vector3,
  4031. U = new t.Euler;
  4032. function V(t) {
  4033. if (void 0 !== n.object && !0 !== o && (void 0 === t.button || 0 === t.button)) {
  4034. var e = W(t.changedTouches ? t.changedTouches[0] : t, a[r].pickers.children),
  4035. i = null;
  4036. e && (i = e.object.name, t.preventDefault()), n.axis !== i && (n.axis = i, n.update(), n.dispatchEvent(u))
  4037. }
  4038. }
  4039. function j(t) {
  4040. if (void 0 !== n.object && !0 !== o && (void 0 === t.button || 0 === t.button)) {
  4041. var e = t.changedTouches ? t.changedTouches[0] : t;
  4042. if (0 === e.button || void 0 === e.button) {
  4043. var i = W(e, a[r].pickers.children);
  4044. if (i) {
  4045. t.preventDefault(), t.stopPropagation(), n.dispatchEvent(h), n.axis = i.object.name, n.update(), w.copy(z)
  4046. .sub(k)
  4047. .normalize(), a[r].setActivePlane(n.axis, w);
  4048. var s = W(e, [a[r].activePlane]);
  4049. s && (L.copy(n.object.position), O.copy(n.object.scale), I.extractRotation(n.object.matrix), B.extractRotation(n.object.matrixWorld), R.extractRotation(n.object.parent.matrixWorld), N.setFromMatrixScale(x.getInverse(n.object.parent.matrixWorld)), g.copy(s.point));
  4050. var l = i.object,
  4051. u = n.getMode(),
  4052. c = n._gizmo[u].pickerGizmos;
  4053. if ("rotate" === u && l.userData.isPicker) {
  4054. for (var d in c) {
  4055. (p = c[d][0][0].children[0])
  4056. .visible = !1
  4057. }
  4058. l.parent.getObjectByName("Torus")
  4059. .visible = !0, l.parent.getObjectByName("ArcSurface")
  4060. .visible = !0
  4061. }
  4062. if ("translate" === u && l.userData.isPicker)
  4063. for (var d in c) {
  4064. var p = c[d][0][0];
  4065. n.axis !== d && (p.visible = !1)
  4066. }
  4067. }
  4068. }
  4069. o = !0
  4070. }
  4071. }
  4072. function H(e) {
  4073. if (void 0 !== n.object && null !== n.axis && !1 !== o && (void 0 === e.button || 0 === e.button)) {
  4074. var i = W(e.changedTouches ? e.changedTouches[0] : e, [a[r].activePlane]);
  4075. if (!1 !== i) {
  4076. if (e.preventDefault(), e.stopPropagation(), m.copy(i.point), "translate" === r) {
  4077. if (n.MOVELOCK[n.axis].state) return;
  4078. m.sub(g), m.multiply(N), "world" !== n.space && -1 === n.axis.search("XYZ") || (-1 === n.axis.search("X") && (m.x = 0), -1 === n.axis.search("Y") && (m.y = 0), -1 === n.axis.search("Z") && (m.z = 0), m.applyMatrix4(x.getInverse(R)), n.object.position.copy(L), n.object.position.add(m))
  4079. }
  4080. if ("rotate" === r) {
  4081. if (n.MOVELOCK[n.axis].state) return;
  4082. if (m.sub(k), m.multiply(N), M.copy(g)
  4083. .sub(k), M.multiply(N), "world" === n.space) {
  4084. if (v.set(Math.atan2(m.z, m.y), Math.atan2(m.x, m.z), Math.atan2(m.y, m.x)), y.set(Math.atan2(M.z, M.y), Math.atan2(M.x, M.z), Math.atan2(M.y, M.x)), T.setFromRotationMatrix(x.getInverse(R)), null !== n.rotationSnap ? (C.setFromAxisAngle(S, Math.round((v.x - y.x) / n.rotationSnap) * n.rotationSnap), E.setFromAxisAngle(_, Math.round((v.y - y.y) / n.rotationSnap) * n.rotationSnap), D.setFromAxisAngle(A, Math.round((v.z - y.z) / n.rotationSnap) * n.rotationSnap)) : (C.setFromAxisAngle(S, v.x - y.x), E.setFromAxisAngle(_, v.y - y.y), D.setFromAxisAngle(A, v.z - y.z)), P.setFromRotationMatrix(B), "X" === n.axis) {
  4085. T.multiplyQuaternions(T, C);
  4086. var s = n._gizmo[r].pickerGizmos.X[0][0].getObjectByName("ArcSurface");
  4087. (l = new t.Quaternion)
  4088. .setFromAxisAngle(A, v.x), s.quaternion.copy(l)
  4089. }
  4090. if ("Y" === n.axis) {
  4091. T.multiplyQuaternions(T, E);
  4092. s = n._gizmo[r].pickerGizmos.Y[0][0].getObjectByName("ArcSurface");
  4093. (l = new t.Quaternion)
  4094. .setFromAxisAngle(A, v.y), s.quaternion.copy(l)
  4095. }
  4096. if ("Z" === n.axis) {
  4097. T.multiplyQuaternions(T, D);
  4098. var l;
  4099. s = n._gizmo[r].pickerGizmos.Z[0][0].getObjectByName("ArcSurface");
  4100. (l = new t.Quaternion)
  4101. .setFromAxisAngle(A, v.z), s.quaternion.copy(l)
  4102. }
  4103. if (n.MOVELOCK[n.axis].state) return;
  4104. T.multiplyQuaternions(T, P), n.object.quaternion.copy(T)
  4105. }
  4106. }
  4107. n.update(), n.dispatchEvent(u), n.dispatchEvent(d)
  4108. }
  4109. }
  4110. }
  4111. function G(t) {
  4112. if (t.preventDefault(), void 0 === t.button || 0 === t.button) {
  4113. if (o && null !== n.axis) {
  4114. c.mode = r, n.dispatchEvent(c);
  4115. var e = n.getMode(),
  4116. i = n.axis,
  4117. a = n._gizmo[e].pickerGizmos;
  4118. if ("rotate" === e) {
  4119. for (var s in a) {
  4120. (l = a[s][0][0].children[0])
  4121. .visible = !0
  4122. }
  4123. a[i][0][0].getObjectByName("Torus")
  4124. .visible = !1, a[i][0][0].getObjectByName("ArcSurface")
  4125. .visible = !1
  4126. }
  4127. if ("translate" === e)
  4128. for (var s in a) {
  4129. var l = a[s][0][0];
  4130. n.axis !== s && (l.visible = !0)
  4131. }
  4132. }
  4133. o = !1, "TouchEvent" in window && t instanceof TouchEvent ? (n.axis = null, n.update(), n.dispatchEvent(u)) : V(t)
  4134. }
  4135. }
  4136. function W(t, n) {
  4137. var r = i.getBoundingClientRect(),
  4138. o = (t.clientX - r.left) / r.width,
  4139. a = (t.clientY - r.top) / r.height;
  4140. f.set(2 * o - 1, -2 * a + 1), p.setFromCamera(f, e);
  4141. var s = p.intersectObjects(n, !0);
  4142. return !!s[0] && s[0]
  4143. }
  4144. i.addEventListener("mousedown", j, !1), i.addEventListener("mousemove", V, !1), i.addEventListener("mousemove", H, !1), i.addEventListener("mouseup", G, !1), i.addEventListener("mouseout", G, !1), this.dispose = function() {
  4145. i.removeEventListener("mousedown", j), i.removeEventListener("mousemove", V), i.removeEventListener("mousemove", H), i.removeEventListener("mouseup", G), i.removeEventListener("mouseout", G)
  4146. }, this.attach = function(t) {
  4147. this.object = t, this.visible = !0, this.update()
  4148. }, this.detach = function() {
  4149. this.object = void 0, this.visible = !1, this.axis = null
  4150. }, this.getMode = function() {
  4151. return r
  4152. }, this.setMode = function(t) {
  4153. for (var e in "scale" === (r = t || r) && (n.space = "local"), a) a[e].visible = e === r;
  4154. this.update(), n.dispatchEvent(u)
  4155. }, this.setTranslationSnap = function(t) {
  4156. n.translationSnap = t
  4157. }, this.setRotationSnap = function(t) {
  4158. n.rotationSnap = t
  4159. }, this.setSize = function(t) {
  4160. n.size = t, this.update(), n.dispatchEvent(u)
  4161. }, this.setSpace = function(t) {
  4162. n.space = t, this.update(), n.dispatchEvent(u)
  4163. }, this.update = function() {
  4164. void 0 !== n.object && (n.object.updateMatrixWorld(), k.setFromMatrixPosition(n.object.matrixWorld), F.setFromRotationMatrix(x.extractRotation(n.object.matrixWorld)), e.updateMatrixWorld(), z.setFromMatrixPosition(e.matrixWorld), U.setFromRotationMatrix(x.extractRotation(e.matrixWorld)), b = k.distanceTo(z) / 6 * n.size, "Group" === n.object.type ? this.position.copy(n.currentWorldPosition) : this.position.copy(k), this.scale.set(b, b, b), e instanceof t.PerspectiveCamera ? w.copy(z)
  4165. .sub(k)
  4166. .normalize() : e instanceof t.OrthographicCamera && w.copy(z)
  4167. .normalize(), "local" === n.space ? a[r].update(F, w) : "world" === n.space && a[r].update(new t.Euler, w), a[r].highlight(n.axis))
  4168. }
  4169. }
  4170. return t.TransformGizmoDIY = function() {
  4171. this.init = function() {
  4172. t.Object3D.call(this), this.handles = new t.Object3D, this.pickers = new t.Object3D, this.planes = new t.Object3D, this.add(this.handles), this.add(this.pickers), this.add(this.planes);
  4173. var e = new t.PlaneBufferGeometry(50, 50, 2, 2),
  4174. i = new t.MeshBasicMaterial({
  4175. visible: !1,
  4176. side: t.DoubleSide
  4177. }),
  4178. n = {
  4179. XY: new t.Mesh(e, i),
  4180. YZ: new t.Mesh(e, i),
  4181. XZ: new t.Mesh(e, i)
  4182. };
  4183. for (var r in n.YZ.rotation.set(0, Math.PI / 2, 0), n.XZ.rotation.set(-Math.PI / 2, 0, 0), n) n[r].name = r, this.planes.add(n[r]), this.planes[r] = n[r];
  4184. var o = function(t, e) {
  4185. for (var i in t)
  4186. for (r = t[i].length; r--;) {
  4187. var n = t[i][r][0],
  4188. o = t[i][r][1],
  4189. a = t[i][r][2];
  4190. n.name = i, o && n.position.set(o[0], o[1], o[2]), a && n.rotation.set(a[0], a[1], a[2]), e.add(n)
  4191. }
  4192. };
  4193. o(this.handleGizmos, this.handles), o(this.pickerGizmos, this.pickers), this.traverse((function(e) {
  4194. if (e instanceof t.Mesh) {
  4195. e.updateMatrix();
  4196. var i = e.geometry.clone();
  4197. i.applyMatrix(e.matrix), e.geometry = i, e.position.set(0, 0, 0), e.rotation.set(0, 0, 0), e.scale.set(1, 1, 1)
  4198. }
  4199. }))
  4200. };
  4201. this.highlight = function(t) {
  4202. this.traverse((function(e) {
  4203. e.material && e.material.highlight && (e.name === t ? e.material.highlight(!0) : e.material.highlight(!1))
  4204. }))
  4205. }
  4206. }, t.TransformGizmoDIY.prototype = Object.create(t.Object3D.prototype), t.TransformGizmoDIY.prototype.constructor = t.TransformGizmoDIY, t.TransformGizmoDIY.prototype.update = function(t, e) {}, t.TransformGizmoDIYTranslate = function() {
  4207. t.TransformGizmoDIY.call(this);
  4208. var n = new t.BufferGeometry;
  4209. n.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, .3, 0, 0], 3));
  4210. var r = new t.Line(n, new i({
  4211. color: 65280
  4212. }));
  4213. r.userData.isLine = !0;
  4214. var a = new t.BufferGeometry;
  4215. a.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, 0, .3, 0], 3));
  4216. var s = new t.Line(a, new i({
  4217. color: 16711680
  4218. }));
  4219. s.userData.isLine = !0;
  4220. var l = new t.BufferGeometry;
  4221. l.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, 0, 0, .3], 3));
  4222. var u = new t.Line(l, new i({
  4223. color: 16776960
  4224. }));
  4225. r.userData.isLine = !0, this.handleGizmos = {
  4226. X: [
  4227. [r]
  4228. ],
  4229. Y: [
  4230. [s]
  4231. ],
  4232. Z: [
  4233. [u]
  4234. ]
  4235. };
  4236. var h = new t.Mesh(new o, new e({
  4237. visible: !0,
  4238. transparent: !0,
  4239. color: 65280
  4240. }));
  4241. h.scale.set(.01, .01, .01), h.userData.isPicker = !0;
  4242. var c = new t.Mesh(new o, new e({
  4243. visible: !0,
  4244. transparent: !0,
  4245. color: 16711680
  4246. }));
  4247. c.scale.set(.01, .01, .01), c.userData.isPicker = !0;
  4248. var d = new t.Mesh(new o, new e({
  4249. visible: !0,
  4250. transparent: !0,
  4251. color: 16776960
  4252. }));
  4253. d.scale.set(.01, .01, .01), d.userData.isPicker = !0, this.pickerGizmos = {
  4254. X: [
  4255. [h, [1.2, 0, 0],
  4256. [Math.PI / 2, 0, 0]
  4257. ]
  4258. ],
  4259. Y: [
  4260. [c, [0, 1.2, 0],
  4261. [0, 0, Math.PI / 2]
  4262. ]
  4263. ],
  4264. Z: [
  4265. [d, [0, 0, 1.2],
  4266. [Math.PI / 2, 0, Math.PI / 2]
  4267. ]
  4268. ]
  4269. }, this.setActivePlane = function(e, i) {
  4270. var n = new t.Matrix4;
  4271. i.applyMatrix4(n.getInverse(n.extractRotation(this.planes.XY.matrixWorld))), "X" === e && (this.activePlane = this.planes.XY, Math.abs(i.y) > Math.abs(i.z) && (this.activePlane = this.planes.XZ)), "Y" === e && (this.activePlane = this.planes.XY, Math.abs(i.x) > Math.abs(i.z) && (this.activePlane = this.planes.YZ)), "Z" === e && (this.activePlane = this.planes.XZ, Math.abs(i.x) > Math.abs(i.y) && (this.activePlane = this.planes.YZ)), "XYZ" === e && (this.activePlane = this.planes.XYZE), "XY" === e && (this.activePlane = this.planes.XY), "YZ" === e && (this.activePlane = this.planes.YZ), "XZ" === e && (this.activePlane = this.planes.XZ)
  4272. };
  4273. var p = new t.Vector3(1, 0, 0),
  4274. f = new t.Vector3(0, 1, 0),
  4275. m = new t.Vector3(0, 0, 1),
  4276. g = new t.Quaternion,
  4277. v = new t.Quaternion,
  4278. y = new t.Vector3(0, 1, 0);
  4279. this.update = function(e, i) {
  4280. t.TransformGizmoDIY.prototype.update.apply(this, arguments), this.traverse((function(e) {
  4281. var n;
  4282. "X" === e.name && ((n = y.copy(p)
  4283. .applyQuaternion(g)
  4284. .dot(i)) < 0 && (e.scale.x = -1), n > 0 && (e.scale.x = 1));
  4285. if ("Y" === e.name) {
  4286. var r = new t.Quaternion,
  4287. o = new t.Quaternion;
  4288. r.setFromAxisAngle(f, Math.atan2(i.x, i.z)), o.multiplyQuaternions(o, r), e.quaternion.copy(o)
  4289. }
  4290. "Z" === e.name && ((n = y.copy(m)
  4291. .applyQuaternion(v)
  4292. .dot(i)) < 0 && (e.scale.z = -1), n > 0 && (e.scale.z = 1))
  4293. }))
  4294. }, this.init()
  4295. }, t.TransformGizmoDIYTranslate.prototype = Object.create(t.TransformGizmoDIY.prototype), t.TransformGizmoDIYTranslate.prototype.constructor = t.TransformGizmoDIYTranslate, t.TransformGizmoDIYRotate = function() {
  4296. t.TransformGizmoDIY.call(this);
  4297. var e = new t.BufferGeometry;
  4298. e.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, .3, 0, 0], 3));
  4299. var n = new t.Line(e, new i({
  4300. color: 65280
  4301. }));
  4302. n.userData.isLine = !0;
  4303. var r = new t.BufferGeometry;
  4304. r.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, 0, .3, 0], 3));
  4305. var o = new t.Line(r, new i({
  4306. color: 16711680
  4307. }));
  4308. o.userData.isLine = !0;
  4309. var a = new t.BufferGeometry;
  4310. a.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, 0, 0, .3], 3));
  4311. var s = new t.Line(a, new i({
  4312. color: 16776960
  4313. }));
  4314. s.userData.isLine = !0, this.handleGizmos = {
  4315. X: [
  4316. [n]
  4317. ],
  4318. Y: [
  4319. [o]
  4320. ],
  4321. Z: [
  4322. [s]
  4323. ]
  4324. };
  4325. var l = new u({
  4326. color: 8446604,
  4327. name: "X"
  4328. }),
  4329. h = new u({
  4330. color: 15897485,
  4331. name: "Y"
  4332. }),
  4333. c = new u({
  4334. color: 16701062,
  4335. name: "Z"
  4336. });
  4337. this.pickerGizmos = {
  4338. X: [
  4339. [l, [0, 0, 0],
  4340. [0, Math.PI / 2, -3 * Math.PI / 4]
  4341. ]
  4342. ],
  4343. Y: [
  4344. [h, [0, 0, 0],
  4345. [-Math.PI / 2, 0, 0]
  4346. ]
  4347. ],
  4348. Z: [
  4349. [c, [0, 0, 0],
  4350. [0, 0, 3 * Math.PI / 4]
  4351. ]
  4352. ]
  4353. }, this.setActivePlane = function(t) {
  4354. "X" === t && (this.activePlane = this.planes.YZ), "Y" === t && (this.activePlane = this.planes.XZ), "Z" === t && (this.activePlane = this.planes.XY)
  4355. }, this.update = function(e, i) {
  4356. t.TransformGizmoDIY.prototype.update.apply(this, arguments);
  4357. this.handles, this.pickers, new t.Matrix4, new t.Euler(0, 0, 1);
  4358. var n = new t.Quaternion,
  4359. r = new t.Vector3(1, 0, 0),
  4360. o = new t.Vector3(0, 1, 0),
  4361. a = new t.Vector3(0, 0, 1),
  4362. s = new t.Quaternion,
  4363. l = (new t.Quaternion, new t.Quaternion),
  4364. u = i.clone(),
  4365. h = new t.Vector3(0, 1, 0),
  4366. c = h.copy(r)
  4367. .applyQuaternion(s)
  4368. .dot(u),
  4369. d = h.copy(a)
  4370. .applyQuaternion(l)
  4371. .dot(u);
  4372. c < 0 && 1 === this.handleGizmos.X[0][0].scale.x && (this.handleGizmos.X[0][0].scale.x = -1, this.pickerGizmos.Z[0][0].rotateZ(Math.PI / 2)), c > 0 && -1 === this.handleGizmos.X[0][0].scale.x && (this.handleGizmos.X[0][0].scale.x = 1, this.pickerGizmos.Z[0][0].rotateZ(-Math.PI / 2)), d < 0 && 1 === this.handleGizmos.Z[0][0].scale.z && (this.handleGizmos.Z[0][0].scale.z = -1, this.pickerGizmos.X[0][0].rotateZ(-Math.PI / 2)), d > 0 && -1 === this.handleGizmos.Z[0][0].scale.z && (this.handleGizmos.Z[0][0].scale.z = 1, this.pickerGizmos.X[0][0].rotateZ(Math.PI / 2));
  4373. var p = new t.Quaternion;
  4374. n = new t.Quaternion;
  4375. p.setFromAxisAngle(o, Math.atan2(u.x, u.z)), n.multiplyQuaternions(n, p), this.pickerGizmos.Y[0][0].quaternion.copy(n), this.pickerGizmos.Y[0][0].rotateX(-Math.PI / 2)
  4376. }, this.init()
  4377. }, t.TransformGizmoDIYRotate.prototype = Object.create(t.TransformGizmoDIY.prototype), t.TransformGizmoDIYRotate.prototype.constructor = t.TransformGizmoDIYRotate, h.prototype = Object.create(t.Object3D.prototype), h.prototype.constructor = h, h
  4378. }
  4379. }, function(t, e) {
  4380. t.exports = {
  4381. canbeChoosedOfMode3D: !0
  4382. }
  4383. }, function(t, e) {
  4384. t.exports = {
  4385. TagActivated: "tag.activated",
  4386. TagDismissed: "tag.dismissed",
  4387. TagNavigation: "tag.navigation"
  4388. }
  4389. }, function(t, e, i) {
  4390. var n = i(0),
  4391. r = i(12),
  4392. o = i(7);
  4393. function a(t) {
  4394. t = t || {}, G.model.enablefilter ? n.RawShaderMaterial.call(this, o.extendObject({
  4395. fragmentShader: r.model2.fragmentShader,
  4396. vertexShader: r.model2.vertexShader,
  4397. uniforms: n.UniformsUtils.clone(r.model2.uniforms),
  4398. name: "ModelTextureMaterial",
  4399. depthTest: !0,
  4400. depthWrite: !0
  4401. }, t)) : n.RawShaderMaterial.call(this, o.extendObject({
  4402. fragmentShader: r.model.fragmentShader,
  4403. vertexShader: r.model.vertexShader,
  4404. uniforms: n.UniformsUtils.clone(r.model.uniforms),
  4405. name: "ModelTextureMaterial",
  4406. depthTest: !0,
  4407. depthWrite: !0
  4408. }, t))
  4409. }
  4410. a.prototype = Object.create(n.RawShaderMaterial.prototype), a.prototype.constructor = a, a.prototype.setProjectedPanos = function(t, e, i) {
  4411. if (G.model.enablefilter) {
  4412. var n = t.getAjustedColors(),
  4413. r = e.getAjustedColors();
  4414. i && (this.uniforms.progress.value = 0), t.ensureSkyboxReadyForRender(), this.uniforms.pano0Map.value = t.getSkyboxTexture(), this.uniforms.brightness0.value = n.brightness, this.uniforms.contrast0.value = n.contrast, this.uniforms.gamma0.value = n.gamma, this.uniforms.hue0.value = n.hue, this.uniforms.saturation0.value = n.saturation, this.uniforms.vibrance0.value = n.vibrance, this.uniforms.balance0.value.copy(n.balance), this.uniforms.pano0Position.value.copy(t.position), this.uniforms.pano0Matrix.value.copy(t.skyboxMesh.matrixWorld), e.ensureSkyboxReadyForRender(), this.uniforms.pano1Map.value = e.getSkyboxTexture(), this.uniforms.brightness1.value = r.brightness, this.uniforms.contrast1.value = r.contrast, this.uniforms.gamma1.value = r.gamma, this.uniforms.hue1.value = r.hue, this.uniforms.saturation1.value = r.saturation, this.uniforms.vibrance1.value = r.vibrance, this.uniforms.balance1.value.copy(r.balance), this.uniforms.pano1Position.value.copy(e.position), this.uniforms.pano1Matrix.value.copy(e.skyboxMesh.matrixWorld)
  4415. } else i && (this.uniforms.progress.value = 0), t.ensureSkyboxReadyForRender(), this.uniforms.pano0Map.value = t.getSkyboxTexture(), this.uniforms.pano0Position.value.copy(t.position), this.uniforms.pano0Matrix.value.copy(t.skyboxMesh.matrixWorld), e.ensureSkyboxReadyForRender(), this.uniforms.pano1Map.value = e.getSkyboxTexture(), this.uniforms.pano1Position.value.copy(e.position), this.uniforms.pano1Matrix.value.copy(e.skyboxMesh.matrixWorld)
  4416. }, t.exports = a
  4417. }, function(t, e, i) {
  4418. var n = i(0),
  4419. r = i(1),
  4420. o = i(7),
  4421. a = i(10),
  4422. s = i(153),
  4423. l = i(8),
  4424. u = i(15),
  4425. h = i(17);
  4426. function c(t, e, i) {
  4427. n.Object3D.call(this), this.model = t, this.floorIndex = e, this.name = i || e + 1, this.panos = [], this.chunks = [], this.colliderBuilder = new s(3), this.collider = null, this.center = null, this.boundingBox = new n.Box3, this.size = null, this.hidden = !1, this.conservativeBoundingBox = new n.Box3, this.debugColor = 16777215 * Math.random(), this.transition = null, this.pano360Position = null
  4428. }
  4429. c.prototype = Object.create(n.Object3D.prototype), c.prototype.enter = function(t) {
  4430. this.model.setFloor(this, t)
  4431. }, c.prototype.hide = function(t) {
  4432. if (!this.hidden || this.transition) {
  4433. this.chunks.forEach((function(t) {
  4434. t.material.transparent = !0
  4435. })), l.cancel(this.transition);
  4436. var e = t ? 0 : r.hideFloorDuration + r.hideFloorDelay,
  4437. i = t ? 0 : r.hideFloorDelay / e;
  4438. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), e, function() {
  4439. this.hidden = !0
  4440. }.bind(this), i, u.easeInOutQuad)
  4441. }
  4442. }, c.prototype.show = function(t) {
  4443. if (this.hidden || this.transition) {
  4444. this.hidden = !1, l.cancel(this.transition);
  4445. var e = t ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay,
  4446. i = t ? 0 : r.showFloorDelay / e;
  4447. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), e, function() {
  4448. this.hidden || this.chunks.forEach((function(t) {
  4449. t.material.transparent = !1
  4450. }))
  4451. }.bind(this), i, u.easeInOutQuad)
  4452. }
  4453. }, c.prototype.toggle = function(t, e) {
  4454. (t = void 0 === t ? this.hidden : t) ? this.show(e): this.hide(e)
  4455. }, c.prototype.containsPoint = function(t) {
  4456. return this.collider.children.some((function(e) {
  4457. return e.geometry.boundingBox || e.geometry.computeBoundingBox(), e.geometry.boundingBox.containsPoint(t)
  4458. }))
  4459. }, c.prototype.distanceToPoint = function(t) {
  4460. var e = null,
  4461. i = 1 / 0;
  4462. return this.collider.children.forEach((function(n) {
  4463. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  4464. var r = n.geometry.boundingBox.distanceToPoint(t);
  4465. (!e || i > r) && (i = r, e = n)
  4466. })), i
  4467. }, c.prototype.addChunk = function(t) {
  4468. t.renderOrder = h.ghostFloor, this.add(t), this.chunks.push(t), this.boundingBox.union(t.geometry.boundingBox), this.size = this.boundingBox.getSize(new n.Vector3), this.colliderBuilder.add(t.geometry)
  4469. }, c.prototype.addPano = function(t) {
  4470. this.panos.push(t), this.add(t.skyboxMesh), t.marker && this.add(t.marker);
  4471. var e = new n.Vector3(1, 1, 1);
  4472. 2 == t.alignmentType && (null == this.pano360Position && (this.pano360Position = new n.Vector3((this.boundingBox.min.x + this.boundingBox.max.x) / 2, this.boundingBox.min.y - 2.1, (this.boundingBox.min.z + this.boundingBox.max.z) / 2)), t.position = this.pano360Position, t.skyboxMesh.position.copy(t.position), e = new n.Vector3(4, 4, 4));
  4473. var i = (new n.Box3)
  4474. .setFromCenterAndSize(t.position, e);
  4475. this.boundingBox.union(i)
  4476. }, c.prototype.build = function() {
  4477. this.collider = this.colliderBuilder.build(!0), this.add(this.collider), this.center = this.boundingBox.getCenter(new n.Vector3), this.conservativeBoundingBox.copy(this.boundingBox), this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map((function(t) {
  4478. return t.geometry.boundingBox.min.y
  4479. })), 5), this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map((function(t) {
  4480. return t.geometry.boundingBox.max.y
  4481. })), 5), this.colliderBuilder = null
  4482. }, c.prototype.toShortString = function() {
  4483. return o.nth(this.floorIndex + 1)
  4484. }, c.prototype.toString = function() {
  4485. return this.name
  4486. }, t.exports = c
  4487. }, function(t, e, i) {
  4488. var n = i(0),
  4489. r = i(12),
  4490. o = i(5),
  4491. a = i(43);
  4492. function s(t) {
  4493. this.materialInside = new a({
  4494. side: n.DoubleSide
  4495. }), this.materialOutside = new n.RawShaderMaterial({
  4496. fragmentShader: r.modelOutside.fragmentShader,
  4497. vertexShader: r.modelOutside.vertexShader,
  4498. uniforms: n.UniformsUtils.clone(r.modelOutside.uniforms),
  4499. side: n.FrontSide,
  4500. name: "chunkOut",
  4501. depthWrite: !0
  4502. }), n.Mesh.call(this, t.geometry, this.materialInside), this.name = t.name || "", this.textureName = t.textureName, this.meshUrl = t.meshUrl
  4503. }
  4504. s.prototype = Object.create(n.Mesh.prototype), s.prototype.setTextureMap = function(t) {
  4505. this.materialInside.uniforms.map.value = t, this.materialOutside.uniforms.map.value = t
  4506. }, s.prototype.setMode = function(t) {
  4507. var e = t === o.DOLLHOUSE || t === o.FLOORPLAN ? this.materialOutside : this.materialInside;
  4508. e.side = t === o.PANORAMA ? n.DoubleSide : n.FrontSide, e.transparent = this.material.transparent, e.uniforms.opacity.value = this.material.uniforms.opacity.value, this.material = e
  4509. }, t.exports = s
  4510. }, function(t, e, i) {
  4511. (function(n) {
  4512. var r, o, a;
  4513. o = [i(168)], void 0 === (a = "function" == typeof(r = function(t, e) {
  4514. "use strict";
  4515. var r, o = {};
  4516. return o.ByteBuffer = t, o.Long = t.Long || null, o.VERSION = "5.0.3", o.WIRE_TYPES = {}, o.WIRE_TYPES.VARINT = 0, o.WIRE_TYPES.BITS64 = 1, o.WIRE_TYPES.LDELIM = 2, o.WIRE_TYPES.STARTGROUP = 3, o.WIRE_TYPES.ENDGROUP = 4, o.WIRE_TYPES.BITS32 = 5, o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32], o.TYPES = {
  4517. int32: {
  4518. name: "int32",
  4519. wireType: o.WIRE_TYPES.VARINT,
  4520. defaultValue: 0
  4521. },
  4522. uint32: {
  4523. name: "uint32",
  4524. wireType: o.WIRE_TYPES.VARINT,
  4525. defaultValue: 0
  4526. },
  4527. sint32: {
  4528. name: "sint32",
  4529. wireType: o.WIRE_TYPES.VARINT,
  4530. defaultValue: 0
  4531. },
  4532. int64: {
  4533. name: "int64",
  4534. wireType: o.WIRE_TYPES.VARINT,
  4535. defaultValue: o.Long ? o.Long.ZERO : void 0
  4536. },
  4537. uint64: {
  4538. name: "uint64",
  4539. wireType: o.WIRE_TYPES.VARINT,
  4540. defaultValue: o.Long ? o.Long.UZERO : void 0
  4541. },
  4542. sint64: {
  4543. name: "sint64",
  4544. wireType: o.WIRE_TYPES.VARINT,
  4545. defaultValue: o.Long ? o.Long.ZERO : void 0
  4546. },
  4547. bool: {
  4548. name: "bool",
  4549. wireType: o.WIRE_TYPES.VARINT,
  4550. defaultValue: !1
  4551. },
  4552. double: {
  4553. name: "double",
  4554. wireType: o.WIRE_TYPES.BITS64,
  4555. defaultValue: 0
  4556. },
  4557. string: {
  4558. name: "string",
  4559. wireType: o.WIRE_TYPES.LDELIM,
  4560. defaultValue: ""
  4561. },
  4562. bytes: {
  4563. name: "bytes",
  4564. wireType: o.WIRE_TYPES.LDELIM,
  4565. defaultValue: null
  4566. },
  4567. fixed32: {
  4568. name: "fixed32",
  4569. wireType: o.WIRE_TYPES.BITS32,
  4570. defaultValue: 0
  4571. },
  4572. sfixed32: {
  4573. name: "sfixed32",
  4574. wireType: o.WIRE_TYPES.BITS32,
  4575. defaultValue: 0
  4576. },
  4577. fixed64: {
  4578. name: "fixed64",
  4579. wireType: o.WIRE_TYPES.BITS64,
  4580. defaultValue: o.Long ? o.Long.UZERO : void 0
  4581. },
  4582. sfixed64: {
  4583. name: "sfixed64",
  4584. wireType: o.WIRE_TYPES.BITS64,
  4585. defaultValue: o.Long ? o.Long.ZERO : void 0
  4586. },
  4587. float: {
  4588. name: "float",
  4589. wireType: o.WIRE_TYPES.BITS32,
  4590. defaultValue: 0
  4591. },
  4592. enum: {
  4593. name: "enum",
  4594. wireType: o.WIRE_TYPES.VARINT,
  4595. defaultValue: 0
  4596. },
  4597. message: {
  4598. name: "message",
  4599. wireType: o.WIRE_TYPES.LDELIM,
  4600. defaultValue: null
  4601. },
  4602. group: {
  4603. name: "group",
  4604. wireType: o.WIRE_TYPES.STARTGROUP,
  4605. defaultValue: null
  4606. }
  4607. }, o.MAP_KEY_TYPES = [o.TYPES.int32, o.TYPES.sint32, o.TYPES.sfixed32, o.TYPES.uint32, o.TYPES.fixed32, o.TYPES.int64, o.TYPES.sint64, o.TYPES.sfixed64, o.TYPES.uint64, o.TYPES.fixed64, o.TYPES.bool, o.TYPES.string, o.TYPES.bytes], o.ID_MIN = 1, o.ID_MAX = 536870911, o.convertFieldsToCamelCase = !1, o.populateAccessors = !0, o.populateDefaults = !0, o.Util = ((r = {})
  4608. .IS_NODE = !("object" != typeof n || n + "" != "[object process]" || n.browser), r.XHR = function() {
  4609. for (var t = [function() {
  4610. return new XMLHttpRequest
  4611. }, function() {
  4612. return new ActiveXObject("Msxml2.XMLHTTP")
  4613. }, function() {
  4614. return new ActiveXObject("Msxml3.XMLHTTP")
  4615. }, function() {
  4616. return new ActiveXObject("Microsoft.XMLHTTP")
  4617. }], e = null, i = 0; i < t.length; i++) {
  4618. try {
  4619. e = t[i]()
  4620. } catch (t) {
  4621. continue
  4622. }
  4623. break
  4624. }
  4625. if (!e) throw Error("XMLHttpRequest is not supported");
  4626. return e
  4627. }, r.fetch = function(t, e) {
  4628. if (e && "function" != typeof e && (e = null), r.IS_NODE) {
  4629. var n = i(170);
  4630. if (e) n.readFile(t, (function(t, i) {
  4631. e(t ? null : "" + i)
  4632. }));
  4633. else try {
  4634. return n.readFileSync(t)
  4635. } catch (t) {
  4636. return null
  4637. }
  4638. } else {
  4639. var o = r.XHR();
  4640. if (o.open("GET", t, !!e), o.setRequestHeader("Accept", "text/plain"), "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"), !e) return o.send(null), 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  4641. if (o.onreadystatechange = function() {
  4642. 4 == o.readyState && (200 == o.status || 0 == o.status && "string" == typeof o.responseText ? e(o.responseText) : e(null))
  4643. }, 4 == o.readyState) return;
  4644. o.send(null)
  4645. }
  4646. }, r.toCamelCase = function(t) {
  4647. return t.replace(/_([a-zA-Z])/g, (function(t, e) {
  4648. return e.toUpperCase()
  4649. }))
  4650. }, r), o.Lang = {
  4651. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  4652. RULE: /^(?:required|optional|repeated|map)$/,
  4653. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  4654. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  4655. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  4656. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,
  4657. FQTYPEREF: /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  4658. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  4659. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  4660. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  4661. NUMBER_OCT: /^0[0-7]+$/,
  4662. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  4663. BOOL: /^(?:true|false)$/i,
  4664. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  4665. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  4666. WHITESPACE: /\s/,
  4667. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  4668. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  4669. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  4670. }, o.DotProto = function(t, e) {
  4671. var i = {},
  4672. n = function(t) {
  4673. this.source = t + "", this.index = 0, this.line = 1, this.stack = [], this._stringOpen = null
  4674. },
  4675. r = n.prototype;
  4676. r._readString = function() {
  4677. var t = '"' === this._stringOpen ? e.STRING_DQ : e.STRING_SQ;
  4678. t.lastIndex = this.index - 1;
  4679. var i = t.exec(this.source);
  4680. if (!i) throw Error("unterminated string");
  4681. return this.index = t.lastIndex, this.stack.push(this._stringOpen), this._stringOpen = null, i[1]
  4682. }, r.next = function() {
  4683. if (this.stack.length > 0) return this.stack.shift();
  4684. if (this.index >= this.source.length) return null;
  4685. if (null !== this._stringOpen) return this._readString();
  4686. var t, i, n;
  4687. do {
  4688. for (t = !1; e.WHITESPACE.test(n = this.source.charAt(this.index));)
  4689. if ("\n" === n && ++this.line, ++this.index === this.source.length) return null;
  4690. if ("/" === this.source.charAt(this.index))
  4691. if (++this.index, "/" === this.source.charAt(this.index)) {
  4692. for (;
  4693. "\n" !== this.source.charAt(++this.index);)
  4694. if (this.index == this.source.length) return null;
  4695. ++this.index, ++this.line, t = !0
  4696. } else {
  4697. if ("*" !== (n = this.source.charAt(this.index))) return "/";
  4698. do {
  4699. if ("\n" === n && ++this.line, ++this.index === this.source.length) return null;
  4700. i = n, n = this.source.charAt(this.index)
  4701. } while ("*" !== i || "/" !== n);
  4702. ++this.index, t = !0
  4703. }
  4704. } while (t);
  4705. if (this.index === this.source.length) return null;
  4706. var r = this.index;
  4707. if (e.DELIM.lastIndex = 0, !e.DELIM.test(this.source.charAt(r++)))
  4708. for (; r < this.source.length && !e.DELIM.test(this.source.charAt(r));) ++r;
  4709. var o = this.source.substring(this.index, this.index = r);
  4710. return '"' !== o && "'" !== o || (this._stringOpen = o), o
  4711. }, r.peek = function() {
  4712. if (0 === this.stack.length) {
  4713. var t = this.next();
  4714. if (null === t) return null;
  4715. this.stack.push(t)
  4716. }
  4717. return this.stack[0]
  4718. }, r.skip = function(t) {
  4719. var e = this.next();
  4720. if (e !== t) throw Error("illegal '" + e + "', '" + t + "' expected")
  4721. }, r.omit = function(t) {
  4722. return this.peek() === t && (this.next(), !0)
  4723. }, r.toString = function() {
  4724. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  4725. }, i.Tokenizer = n;
  4726. var o = function(t) {
  4727. this.tn = new n(t), this.proto3 = !1
  4728. },
  4729. a = o.prototype;
  4730. function s(t, i) {
  4731. var n = -1,
  4732. r = 1;
  4733. if ("-" == t.charAt(0) && (r = -1, t = t.substring(1)), e.NUMBER_DEC.test(t)) n = parseInt(t);
  4734. else if (e.NUMBER_HEX.test(t)) n = parseInt(t.substring(2), 16);
  4735. else {
  4736. if (!e.NUMBER_OCT.test(t)) throw Error("illegal id value: " + (r < 0 ? "-" : "") + t);
  4737. n = parseInt(t.substring(1), 8)
  4738. }
  4739. if (n = r * n | 0, !i && n < 0) throw Error("illegal id value: " + (r < 0 ? "-" : "") + t);
  4740. return n
  4741. }
  4742. function l(t) {
  4743. var i = 1;
  4744. if ("-" == t.charAt(0) && (i = -1, t = t.substring(1)), e.NUMBER_DEC.test(t)) return i * parseInt(t, 10);
  4745. if (e.NUMBER_HEX.test(t)) return i * parseInt(t.substring(2), 16);
  4746. if (e.NUMBER_OCT.test(t)) return i * parseInt(t.substring(1), 8);
  4747. if ("inf" === t) return i * (1 / 0);
  4748. if ("nan" === t) return NaN;
  4749. if (e.NUMBER_FLT.test(t)) return i * parseFloat(t);
  4750. throw Error("illegal number value: " + (i < 0 ? "-" : "") + t)
  4751. }
  4752. function u(t, e, i) {
  4753. void 0 === t[e] ? t[e] = i : (Array.isArray(t[e]) || (t[e] = [t[e]]), t[e].push(i))
  4754. }
  4755. return a.parse = function() {
  4756. var t, i, n = {
  4757. name: "[ROOT]",
  4758. package: null,
  4759. messages: [],
  4760. enums: [],
  4761. imports: [],
  4762. options: {},
  4763. services: []
  4764. },
  4765. r = !0;
  4766. try {
  4767. for (; t = this.tn.next();) switch (t) {
  4768. case "package":
  4769. if (!r || null !== n.package) throw Error("unexpected 'package'");
  4770. if (t = this.tn.next(), !e.TYPEREF.test(t)) throw Error("illegal package name: " + t);
  4771. this.tn.skip(";"), n.package = t;
  4772. break;
  4773. case "import":
  4774. if (!r) throw Error("unexpected 'import'");
  4775. ("public" === (t = this.tn.peek()) || (i = "weak" === t)) && this.tn.next(), t = this._readString(), this.tn.skip(";"), i || n.imports.push(t);
  4776. break;
  4777. case "syntax":
  4778. if (!r) throw Error("unexpected 'syntax'");
  4779. this.tn.skip("="), "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0), this.tn.skip(";");
  4780. break;
  4781. case "message":
  4782. this._parseMessage(n, null), r = !1;
  4783. break;
  4784. case "enum":
  4785. this._parseEnum(n), r = !1;
  4786. break;
  4787. case "option":
  4788. this._parseOption(n);
  4789. break;
  4790. case "service":
  4791. this._parseService(n);
  4792. break;
  4793. case "extend":
  4794. this._parseExtend(n);
  4795. break;
  4796. default:
  4797. throw Error("unexpected '" + t + "'")
  4798. }
  4799. } catch (t) {
  4800. throw t.message = "Parse error at line " + this.tn.line + ": " + t.message, t
  4801. }
  4802. return delete n.name, n
  4803. }, o.parse = function(t) {
  4804. return new o(t)
  4805. .parse()
  4806. }, a._readString = function() {
  4807. var t, e, i = "";
  4808. do {
  4809. if ("'" !== (e = this.tn.next()) && '"' !== e) throw Error("illegal string delimiter: " + e);
  4810. i += this.tn.next(), this.tn.skip(e), t = this.tn.peek()
  4811. } while ('"' === t || '"' === t);
  4812. return i
  4813. }, a._readValue = function(t) {
  4814. var i = this.tn.peek();
  4815. if ('"' === i || "'" === i) return this._readString();
  4816. if (this.tn.next(), e.NUMBER.test(i)) return l(i);
  4817. if (e.BOOL.test(i)) return "true" === i.toLowerCase();
  4818. if (t && e.TYPEREF.test(i)) return i;
  4819. throw Error("illegal value: " + i)
  4820. }, a._parseOption = function(t, i) {
  4821. var n = this.tn.next(),
  4822. r = !1;
  4823. if ("(" === n && (r = !0, n = this.tn.next()), !e.TYPEREF.test(n)) throw Error("illegal option name: " + n);
  4824. var o = n;
  4825. r && (this.tn.skip(")"), o = "(" + o + ")", n = this.tn.peek(), e.FQTYPEREF.test(n) && (o += n, this.tn.next())), this.tn.skip("="), this._parseOptionValue(t, o), i || this.tn.skip(";")
  4826. }, a._parseOptionValue = function(t, i) {
  4827. var n = this.tn.peek();
  4828. if ("{" !== n) u(t.options, i, this._readValue(!0));
  4829. else
  4830. for (this.tn.skip("{");
  4831. "}" !== (n = this.tn.next());) {
  4832. if (!e.NAME.test(n)) throw Error("illegal option name: " + i + "." + n);
  4833. this.tn.omit(":") ? u(t.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(t, i + "." + n)
  4834. }
  4835. }, a._parseService = function(t) {
  4836. var i = this.tn.next();
  4837. if (!e.NAME.test(i)) throw Error("illegal service name at line " + this.tn.line + ": " + i);
  4838. var n = {
  4839. name: i,
  4840. rpc: {},
  4841. options: {}
  4842. };
  4843. for (this.tn.skip("{");
  4844. "}" !== (i = this.tn.next());)
  4845. if ("option" === i) this._parseOption(n);
  4846. else {
  4847. if ("rpc" !== i) throw Error("illegal service token: " + i);
  4848. this._parseServiceRPC(n)
  4849. } this.tn.omit(";"), t.services.push(n)
  4850. }, a._parseServiceRPC = function(t) {
  4851. var i = this.tn.next();
  4852. if (!e.NAME.test(i)) throw Error("illegal rpc service method name: " + i);
  4853. var n = i,
  4854. r = {
  4855. request: null,
  4856. response: null,
  4857. request_stream: !1,
  4858. response_stream: !1,
  4859. options: {}
  4860. };
  4861. if (this.tn.skip("("), "stream" === (i = this.tn.next())
  4862. .toLowerCase() && (r.request_stream = !0, i = this.tn.next()), !e.TYPEREF.test(i)) throw Error("illegal rpc service request type: " + i);
  4863. if (r.request = i, this.tn.skip(")"), "returns" !== (i = this.tn.next())
  4864. .toLowerCase()) throw Error("illegal rpc service request type delimiter: " + i);
  4865. if (this.tn.skip("("), "stream" === (i = this.tn.next())
  4866. .toLowerCase() && (r.response_stream = !0, i = this.tn.next()), r.response = i, this.tn.skip(")"), "{" === (i = this.tn.peek())) {
  4867. for (this.tn.next();
  4868. "}" !== (i = this.tn.next());) {
  4869. if ("option" !== i) throw Error("illegal rpc service token: " + i);
  4870. this._parseOption(r)
  4871. }
  4872. this.tn.omit(";")
  4873. } else this.tn.skip(";");
  4874. void 0 === t.rpc && (t.rpc = {}), t.rpc[n] = r
  4875. }, a._parseMessage = function(t, i) {
  4876. var n = !!i,
  4877. r = this.tn.next(),
  4878. o = {
  4879. name: "",
  4880. fields: [],
  4881. enums: [],
  4882. messages: [],
  4883. options: {},
  4884. services: [],
  4885. oneofs: {}
  4886. };
  4887. if (!e.NAME.test(r)) throw Error("illegal " + (n ? "group" : "message") + " name: " + r);
  4888. for (o.name = r, n && (this.tn.skip("="), i.id = s(this.tn.next()), o.isGroup = !0), "[" === (r = this.tn.peek()) && i && this._parseFieldOptions(i), this.tn.skip("{");
  4889. "}" !== (r = this.tn.next());)
  4890. if (e.RULE.test(r)) this._parseMessageField(o, r);
  4891. else if ("oneof" === r) this._parseMessageOneOf(o);
  4892. else if ("enum" === r) this._parseEnum(o);
  4893. else if ("message" === r) this._parseMessage(o);
  4894. else if ("option" === r) this._parseOption(o);
  4895. else if ("service" === r) this._parseService(o);
  4896. else if ("extensions" === r) o.hasOwnProperty("extensions") ? o.extensions = o.extensions.concat(this._parseExtensionRanges()) : o.extensions = this._parseExtensionRanges();
  4897. else if ("reserved" === r) this._parseIgnored();
  4898. else if ("extend" === r) this._parseExtend(o);
  4899. else {
  4900. if (!e.TYPEREF.test(r)) throw Error("illegal message token: " + r);
  4901. if (!this.proto3) throw Error("illegal field rule: " + r);
  4902. this._parseMessageField(o, "optional", r)
  4903. }
  4904. return this.tn.omit(";"), t.messages.push(o), o
  4905. }, a._parseIgnored = function() {
  4906. for (;
  4907. ";" !== this.tn.peek();) this.tn.next();
  4908. this.tn.skip(";")
  4909. }, a._parseMessageField = function(t, i, n) {
  4910. if (!e.RULE.test(i)) throw Error("illegal message field rule: " + i);
  4911. var r, o = {
  4912. rule: i,
  4913. type: "",
  4914. name: "",
  4915. options: {},
  4916. id: 0
  4917. };
  4918. if ("map" === i) {
  4919. if (n) throw Error("illegal type: " + n);
  4920. if (this.tn.skip("<"), r = this.tn.next(), !e.TYPE.test(r) && !e.TYPEREF.test(r)) throw Error("illegal message field type: " + r);
  4921. if (o.keytype = r, this.tn.skip(","), r = this.tn.next(), !e.TYPE.test(r) && !e.TYPEREF.test(r)) throw Error("illegal message field: " + r);
  4922. if (o.type = r, this.tn.skip(">"), r = this.tn.next(), !e.NAME.test(r)) throw Error("illegal message field name: " + r);
  4923. o.name = r, this.tn.skip("="), o.id = s(this.tn.next()), "[" === (r = this.tn.peek()) && this._parseFieldOptions(o), this.tn.skip(";")
  4924. } else if ("group" === (n = void 0 !== n ? n : this.tn.next())) {
  4925. var a = this._parseMessage(t, o);
  4926. if (!/^[A-Z]/.test(a.name)) throw Error("illegal group name: " + a.name);
  4927. o.type = a.name, o.name = a.name.toLowerCase(), this.tn.omit(";")
  4928. } else {
  4929. if (!e.TYPE.test(n) && !e.TYPEREF.test(n)) throw Error("illegal message field type: " + n);
  4930. if (o.type = n, r = this.tn.next(), !e.NAME.test(r)) throw Error("illegal message field name: " + r);
  4931. o.name = r, this.tn.skip("="), o.id = s(this.tn.next()), "[" === (r = this.tn.peek()) && this._parseFieldOptions(o), this.tn.skip(";")
  4932. }
  4933. return t.fields.push(o), o
  4934. }, a._parseMessageOneOf = function(t) {
  4935. var i = this.tn.next();
  4936. if (!e.NAME.test(i)) throw Error("illegal oneof name: " + i);
  4937. var n, r = i,
  4938. o = [];
  4939. for (this.tn.skip("{");
  4940. "}" !== (i = this.tn.next());)(n = this._parseMessageField(t, "optional", i))
  4941. .oneof = r, o.push(n.id);
  4942. this.tn.omit(";"), t.oneofs[r] = o
  4943. }, a._parseFieldOptions = function(t) {
  4944. this.tn.skip("[");
  4945. for (var e = !0;
  4946. "]" !== this.tn.peek();) e || this.tn.skip(","), this._parseOption(t, !0), e = !1;
  4947. this.tn.next()
  4948. }, a._parseEnum = function(t) {
  4949. var i = {
  4950. name: "",
  4951. values: [],
  4952. options: {}
  4953. },
  4954. n = this.tn.next();
  4955. if (!e.NAME.test(n)) throw Error("illegal name: " + n);
  4956. for (i.name = n, this.tn.skip("{");
  4957. "}" !== (n = this.tn.next());)
  4958. if ("option" === n) this._parseOption(i);
  4959. else {
  4960. if (!e.NAME.test(n)) throw Error("illegal name: " + n);
  4961. this.tn.skip("=");
  4962. var r = {
  4963. name: n,
  4964. id: s(this.tn.next(), !0)
  4965. };
  4966. "[" === (n = this.tn.peek()) && this._parseFieldOptions({
  4967. options: {}
  4968. }), this.tn.skip(";"), i.values.push(r)
  4969. } this.tn.omit(";"), t.enums.push(i)
  4970. }, a._parseExtensionRanges = function() {
  4971. var e, i, n, r = [];
  4972. do {
  4973. for (i = [];;) {
  4974. switch (e = this.tn.next()) {
  4975. case "min":
  4976. n = t.ID_MIN;
  4977. break;
  4978. case "max":
  4979. n = t.ID_MAX;
  4980. break;
  4981. default:
  4982. n = l(e)
  4983. }
  4984. if (i.push(n), 2 === i.length) break;
  4985. if ("to" !== this.tn.peek()) {
  4986. i.push(n);
  4987. break
  4988. }
  4989. this.tn.next()
  4990. }
  4991. r.push(i)
  4992. } while (this.tn.omit(","));
  4993. return this.tn.skip(";"), r
  4994. }, a._parseExtend = function(t) {
  4995. var i = this.tn.next();
  4996. if (!e.TYPEREF.test(i)) throw Error("illegal extend reference: " + i);
  4997. var n = {
  4998. ref: i,
  4999. fields: []
  5000. };
  5001. for (this.tn.skip("{");
  5002. "}" !== (i = this.tn.next());)
  5003. if (e.RULE.test(i)) this._parseMessageField(n, i);
  5004. else {
  5005. if (!e.TYPEREF.test(i)) throw Error("illegal extend token: " + i);
  5006. if (!this.proto3) throw Error("illegal field rule: " + i);
  5007. this._parseMessageField(n, "optional", i)
  5008. } return this.tn.omit(";"), t.messages.push(n), n
  5009. }, a.toString = function() {
  5010. return "Parser at line " + this.tn.line
  5011. }, i.Parser = o, i
  5012. }(o, o.Lang), o.Reflect = function(e) {
  5013. var i = {},
  5014. n = function(t, e, i) {
  5015. this.builder = t, this.parent = e, this.name = i, this.className
  5016. },
  5017. r = n.prototype;
  5018. r.fqn = function() {
  5019. for (var t = this.name, e = this; null != (e = e.parent);) t = e.name + "." + t;
  5020. return t
  5021. }, r.toString = function(t) {
  5022. return (t ? this.className + " " : "") + this.fqn()
  5023. }, r.build = function() {
  5024. throw Error(this.toString(!0) + " cannot be built directly")
  5025. }, i.T = n;
  5026. var o = function(t, e, i, r, o) {
  5027. n.call(this, t, e, i), this.className = "Namespace", this.children = [], this.options = r || {}, this.syntax = o || "proto2"
  5028. },
  5029. a = o.prototype = Object.create(n.prototype);
  5030. a.getChildren = function(t) {
  5031. if (null == (t = t || null)) return this.children.slice();
  5032. for (var e = [], i = 0, n = this.children.length; i < n; ++i) this.children[i] instanceof t && e.push(this.children[i]);
  5033. return e
  5034. }, a.addChild = function(t) {
  5035. var e;
  5036. if (e = this.getChild(t.name))
  5037. if (e instanceof h.Field && e.name !== e.originalName && null === this.getChild(e.originalName)) e.name = e.originalName;
  5038. else {
  5039. if (!(t instanceof h.Field && t.name !== t.originalName && null === this.getChild(t.originalName))) throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + t.name);
  5040. t.name = t.originalName
  5041. } this.children.push(t)
  5042. }, a.getChild = function(t) {
  5043. for (var e = "number" == typeof t ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  5044. if (this.children[i][e] === t) return this.children[i];
  5045. return null
  5046. }, a.resolve = function(t, e) {
  5047. var n, r = "string" == typeof t ? t.split(".") : t,
  5048. o = this,
  5049. a = 0;
  5050. if ("" === r[a]) {
  5051. for (; null !== o.parent;) o = o.parent;
  5052. a++
  5053. }
  5054. do {
  5055. do {
  5056. if (!(o instanceof i.Namespace)) {
  5057. o = null;
  5058. break
  5059. }
  5060. if (!(n = o.getChild(r[a])) || !(n instanceof i.T) || e && !(n instanceof i.Namespace)) {
  5061. o = null;
  5062. break
  5063. }
  5064. o = n, a++
  5065. } while (a < r.length);
  5066. if (null != o) break;
  5067. if (null !== this.parent) return this.parent.resolve(t, e)
  5068. } while (null != o);
  5069. return o
  5070. }, a.qn = function(t) {
  5071. var e = [],
  5072. n = t;
  5073. do {
  5074. e.unshift(n.name), n = n.parent
  5075. } while (null !== n);
  5076. for (var r = 1; r <= e.length; r++) {
  5077. var o = e.slice(e.length - r);
  5078. if (t === this.resolve(o, t instanceof i.Namespace)) return o.join(".")
  5079. }
  5080. return t.fqn()
  5081. }, a.build = function() {
  5082. for (var t, e = {}, i = this.children, n = 0, r = i.length; n < r; ++n)(t = i[n]) instanceof o && (e[t.name] = t.build());
  5083. return Object.defineProperty && Object.defineProperty(e, "$options", {
  5084. value: this.buildOpt()
  5085. }), e
  5086. }, a.buildOpt = function() {
  5087. for (var t = {}, e = Object.keys(this.options), i = 0, n = e.length; i < n; ++i) {
  5088. var r = e[i],
  5089. o = this.options[e[i]];
  5090. t[r] = o
  5091. }
  5092. return t
  5093. }, a.getOption = function(t) {
  5094. return void 0 === t ? this.options : void 0 !== this.options[t] ? this.options[t] : null
  5095. }, i.Namespace = o;
  5096. var s = function(t, i, n, r, o) {
  5097. if (this.type = t, this.resolvedType = i, this.isMapKey = n, this.syntax = r, this.name = o, n && e.MAP_KEY_TYPES.indexOf(t) < 0) throw Error("Invalid map key type: " + t.name)
  5098. },
  5099. l = s.prototype;
  5100. function u(t, i) {
  5101. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low == t.low && t.high == t.high) return new e.Long(t.low, t.high, void 0 === i ? t.unsigned : i);
  5102. if ("string" == typeof t) return e.Long.fromString(t, i || !1, 10);
  5103. if ("number" == typeof t) return e.Long.fromNumber(t, i || !1);
  5104. throw Error("not convertible to Long")
  5105. }
  5106. s.defaultFieldValue = function(i) {
  5107. if ("string" == typeof i && (i = e.TYPES[i]), void 0 === i.defaultValue) throw Error("default value for type " + i.name + " is not supported");
  5108. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  5109. }, l.toString = function() {
  5110. return (this.name || "") + (this.isMapKey ? "map" : "value") + " element"
  5111. }, l.verifyValue = function(i) {
  5112. var n = this;
  5113. function r(t, e) {
  5114. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + t + " (" + e + ")")
  5115. }
  5116. switch (this.type) {
  5117. case e.TYPES.int32:
  5118. case e.TYPES.sint32:
  5119. case e.TYPES.sfixed32:
  5120. return ("number" != typeof i || i == i && i % 1 != 0) && r(typeof i, "not an integer"), i > 4294967295 ? 0 | i : i;
  5121. case e.TYPES.uint32:
  5122. case e.TYPES.fixed32:
  5123. return ("number" != typeof i || i == i && i % 1 != 0) && r(typeof i, "not an integer"), i < 0 ? i >>> 0 : i;
  5124. case e.TYPES.int64:
  5125. case e.TYPES.sint64:
  5126. case e.TYPES.sfixed64:
  5127. if (e.Long) try {
  5128. return u(i, !1)
  5129. } catch (t) {
  5130. r(typeof i, t.message)
  5131. } else r(typeof i, "requires Long.js");
  5132. case e.TYPES.uint64:
  5133. case e.TYPES.fixed64:
  5134. if (e.Long) try {
  5135. return u(i, !0)
  5136. } catch (t) {
  5137. r(typeof i, t.message)
  5138. } else r(typeof i, "requires Long.js");
  5139. case e.TYPES.bool:
  5140. return "boolean" != typeof i && r(typeof i, "not a boolean"), i;
  5141. case e.TYPES.float:
  5142. case e.TYPES.double:
  5143. return "number" != typeof i && r(typeof i, "not a number"), i;
  5144. case e.TYPES.string:
  5145. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"), "" + i;
  5146. case e.TYPES.bytes:
  5147. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  5148. case e.TYPES.enum:
  5149. var o = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  5150. for (s = 0; s < o.length; s++) {
  5151. if (o[s].name == i) return o[s].id;
  5152. if (o[s].id == i) return o[s].id
  5153. }
  5154. if ("proto3" === this.syntax) return ("number" != typeof i || i == i && i % 1 != 0) && r(typeof i, "not an integer"), (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"), i;
  5155. r(i, "not a valid enum value");
  5156. case e.TYPES.group:
  5157. case e.TYPES.message:
  5158. if (i && "object" == typeof i || r(typeof i, "object expected"), i instanceof this.resolvedType.clazz) return i;
  5159. if (i instanceof e.Builder.Message) {
  5160. var a = {};
  5161. for (var s in i) i.hasOwnProperty(s) && (a[s] = i[s]);
  5162. i = a
  5163. }
  5164. return new this.resolvedType.clazz(i)
  5165. }
  5166. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  5167. }, l.calculateLength = function(i, n) {
  5168. if (null === n) return 0;
  5169. var r;
  5170. switch (this.type) {
  5171. case e.TYPES.int32:
  5172. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  5173. case e.TYPES.uint32:
  5174. return t.calculateVarint32(n);
  5175. case e.TYPES.sint32:
  5176. return t.calculateVarint32(t.zigZagEncode32(n));
  5177. case e.TYPES.fixed32:
  5178. case e.TYPES.sfixed32:
  5179. case e.TYPES.float:
  5180. return 4;
  5181. case e.TYPES.int64:
  5182. case e.TYPES.uint64:
  5183. return t.calculateVarint64(n);
  5184. case e.TYPES.sint64:
  5185. return t.calculateVarint64(t.zigZagEncode64(n));
  5186. case e.TYPES.fixed64:
  5187. case e.TYPES.sfixed64:
  5188. return 8;
  5189. case e.TYPES.bool:
  5190. return 1;
  5191. case e.TYPES.enum:
  5192. return t.calculateVarint32(n);
  5193. case e.TYPES.double:
  5194. return 8;
  5195. case e.TYPES.string:
  5196. return r = t.calculateUTF8Bytes(n), t.calculateVarint32(r) + r;
  5197. case e.TYPES.bytes:
  5198. if (n.remaining() < 0) throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  5199. return t.calculateVarint32(n.remaining()) + n.remaining();
  5200. case e.TYPES.message:
  5201. return r = this.resolvedType.calculate(n), t.calculateVarint32(r) + r;
  5202. case e.TYPES.group:
  5203. return (r = this.resolvedType.calculate(n)) + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  5204. }
  5205. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  5206. }, l.encodeValue = function(i, n, r) {
  5207. if (null === n) return r;
  5208. switch (this.type) {
  5209. case e.TYPES.int32:
  5210. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  5211. break;
  5212. case e.TYPES.uint32:
  5213. r.writeVarint32(n);
  5214. break;
  5215. case e.TYPES.sint32:
  5216. r.writeVarint32ZigZag(n);
  5217. break;
  5218. case e.TYPES.fixed32:
  5219. r.writeUint32(n);
  5220. break;
  5221. case e.TYPES.sfixed32:
  5222. r.writeInt32(n);
  5223. break;
  5224. case e.TYPES.int64:
  5225. case e.TYPES.uint64:
  5226. r.writeVarint64(n);
  5227. break;
  5228. case e.TYPES.sint64:
  5229. r.writeVarint64ZigZag(n);
  5230. break;
  5231. case e.TYPES.fixed64:
  5232. r.writeUint64(n);
  5233. break;
  5234. case e.TYPES.sfixed64:
  5235. r.writeInt64(n);
  5236. break;
  5237. case e.TYPES.bool:
  5238. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  5239. break;
  5240. case e.TYPES.enum:
  5241. r.writeVarint32(n);
  5242. break;
  5243. case e.TYPES.float:
  5244. r.writeFloat32(n);
  5245. break;
  5246. case e.TYPES.double:
  5247. r.writeFloat64(n);
  5248. break;
  5249. case e.TYPES.string:
  5250. r.writeVString(n);
  5251. break;
  5252. case e.TYPES.bytes:
  5253. if (n.remaining() < 0) throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  5254. var o = n.offset;
  5255. r.writeVarint32(n.remaining()), r.append(n), n.offset = o;
  5256. break;
  5257. case e.TYPES.message:
  5258. var a = (new t)
  5259. .LE();
  5260. this.resolvedType.encode(n, a), r.writeVarint32(a.offset), r.append(a.flip());
  5261. break;
  5262. case e.TYPES.group:
  5263. this.resolvedType.encode(n, r), r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  5264. break;
  5265. default:
  5266. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  5267. }
  5268. return r
  5269. }, l.decode = function(t, i, n) {
  5270. if (i != this.type.wireType) throw Error("Unexpected wire type for element");
  5271. var r, o;
  5272. switch (this.type) {
  5273. case e.TYPES.int32:
  5274. return 0 | t.readVarint32();
  5275. case e.TYPES.uint32:
  5276. return t.readVarint32() >>> 0;
  5277. case e.TYPES.sint32:
  5278. return 0 | t.readVarint32ZigZag();
  5279. case e.TYPES.fixed32:
  5280. return t.readUint32() >>> 0;
  5281. case e.TYPES.sfixed32:
  5282. return 0 | t.readInt32();
  5283. case e.TYPES.int64:
  5284. return t.readVarint64();
  5285. case e.TYPES.uint64:
  5286. return t.readVarint64()
  5287. .toUnsigned();
  5288. case e.TYPES.sint64:
  5289. return t.readVarint64ZigZag();
  5290. case e.TYPES.fixed64:
  5291. return t.readUint64();
  5292. case e.TYPES.sfixed64:
  5293. return t.readInt64();
  5294. case e.TYPES.bool:
  5295. return !!t.readVarint32();
  5296. case e.TYPES.enum:
  5297. return t.readVarint32();
  5298. case e.TYPES.float:
  5299. return t.readFloat();
  5300. case e.TYPES.double:
  5301. return t.readDouble();
  5302. case e.TYPES.string:
  5303. return t.readVString();
  5304. case e.TYPES.bytes:
  5305. if (o = t.readVarint32(), t.remaining() < o) throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  5306. return (r = t.clone())
  5307. .limit = r.offset + o, t.offset += o, r;
  5308. case e.TYPES.message:
  5309. return o = t.readVarint32(), this.resolvedType.decode(t, o);
  5310. case e.TYPES.group:
  5311. return this.resolvedType.decode(t, -1, n)
  5312. }
  5313. throw Error("[INTERNAL] Illegal decode type")
  5314. }, l.valueFromString = function(i) {
  5315. if (!this.isMapKey) throw Error("valueFromString() called on non-map-key element");
  5316. switch (this.type) {
  5317. case e.TYPES.int32:
  5318. case e.TYPES.sint32:
  5319. case e.TYPES.sfixed32:
  5320. case e.TYPES.uint32:
  5321. case e.TYPES.fixed32:
  5322. return this.verifyValue(parseInt(i));
  5323. case e.TYPES.int64:
  5324. case e.TYPES.sint64:
  5325. case e.TYPES.sfixed64:
  5326. case e.TYPES.uint64:
  5327. case e.TYPES.fixed64:
  5328. return this.verifyValue(i);
  5329. case e.TYPES.bool:
  5330. return "true" === i;
  5331. case e.TYPES.string:
  5332. return this.verifyValue(i);
  5333. case e.TYPES.bytes:
  5334. return t.fromBinary(i)
  5335. }
  5336. }, l.valueToString = function(t) {
  5337. if (!this.isMapKey) throw Error("valueToString() called on non-map-key element");
  5338. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  5339. }, i.Element = s;
  5340. var h = function(t, e, i, n, r, a) {
  5341. o.call(this, t, e, i, n, a), this.className = "Message", this.extensions = void 0, this.clazz = null, this.isGroup = !!r, this._fields = null, this._fieldsById = null, this._fieldsByName = null
  5342. },
  5343. c = h.prototype = Object.create(o.prototype);
  5344. function d(t, i) {
  5345. var n = i.readVarint32(),
  5346. r = 7 & n,
  5347. o = n >>> 3;
  5348. switch (r) {
  5349. case e.WIRE_TYPES.VARINT:
  5350. do {
  5351. n = i.readUint8()
  5352. } while (128 == (128 & n));
  5353. break;
  5354. case e.WIRE_TYPES.BITS64:
  5355. i.offset += 8;
  5356. break;
  5357. case e.WIRE_TYPES.LDELIM:
  5358. n = i.readVarint32(), i.offset += n;
  5359. break;
  5360. case e.WIRE_TYPES.STARTGROUP:
  5361. d(o, i);
  5362. break;
  5363. case e.WIRE_TYPES.ENDGROUP:
  5364. if (o === t) return !1;
  5365. throw Error("Illegal GROUPEND after unknown group: " + o + " (" + t + " expected)");
  5366. case e.WIRE_TYPES.BITS32:
  5367. i.offset += 4;
  5368. break;
  5369. default:
  5370. throw Error("Illegal wire type in unknown group " + t + ": " + r)
  5371. }
  5372. return !0
  5373. }
  5374. c.build = function(i) {
  5375. if (this.clazz && !i) return this.clazz;
  5376. var n = function(e, i) {
  5377. var n = i.getChildren(e.Reflect.Message.Field),
  5378. r = i.getChildren(e.Reflect.Message.OneOf),
  5379. o = function(a, s) {
  5380. e.Builder.Message.call(this);
  5381. for (var l = 0, u = r.length; l < u; ++l) this[r[l].name] = null;
  5382. for (l = 0, u = n.length; l < u; ++l) {
  5383. var h = n[l];
  5384. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null, !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  5385. }
  5386. var c;
  5387. if (arguments.length > 0)
  5388. if (1 !== arguments.length || null === a || "object" != typeof a || !("function" != typeof a.encode || a instanceof o) || Array.isArray(a) || a instanceof e.Map || t.isByteBuffer(a) || a instanceof ArrayBuffer || e.Long && a instanceof e.Long)
  5389. for (l = 0, u = arguments.length; l < u; ++l) void 0 !== (c = arguments[l]) && this.$set(n[l].name, c);
  5390. else this.$set(a)
  5391. },
  5392. a = o.prototype = Object.create(e.Builder.Message.prototype);
  5393. a.add = function(t, n, r) {
  5394. var o = i._fieldsByName[t];
  5395. if (!r) {
  5396. if (!o) throw Error(this + "#" + t + " is undefined");
  5397. if (!(o instanceof e.Reflect.Message.Field)) throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  5398. if (!o.repeated) throw Error(this + "#" + t + " is not a repeated field");
  5399. n = o.verifyValue(n, !0)
  5400. }
  5401. return null === this[t] && (this[t] = []), this[t].push(n), this
  5402. }, a.$add = a.add, a.set = function(t, n, r) {
  5403. if (t && "object" == typeof t) {
  5404. for (var o in r = n, t) t.hasOwnProperty(o) && void 0 !== (n = t[o]) && void 0 === i._oneofsByName[o] && this.$set(o, n, r);
  5405. return this
  5406. }
  5407. var a = i._fieldsByName[t];
  5408. if (r) this[t] = n;
  5409. else {
  5410. if (!a) throw Error(this + "#" + t + " is not a field: undefined");
  5411. if (!(a instanceof e.Reflect.Message.Field)) throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  5412. this[a.name] = n = a.verifyValue(n)
  5413. }
  5414. if (a && a.oneof) {
  5415. var s = this[a.oneof.name];
  5416. null !== n ? (null !== s && s !== a.name && (this[s] = null), this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  5417. }
  5418. return this
  5419. }, a.$set = a.set, a.get = function(t, n) {
  5420. if (n) return this[t];
  5421. var r = i._fieldsByName[t];
  5422. if (!(r && r instanceof e.Reflect.Message.Field)) throw Error(this + "#" + t + " is not a field: undefined");
  5423. if (!(r instanceof e.Reflect.Message.Field)) throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  5424. return this[r.name]
  5425. }, a.$get = a.get;
  5426. for (var s = 0; s < n.length; s++) {
  5427. var l = n[s];
  5428. l instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(t) {
  5429. var e = t.originalName.replace(/(_[a-zA-Z])/g, (function(t) {
  5430. return t.toUpperCase()
  5431. .replace("_", "")
  5432. }));
  5433. e = e.substring(0, 1)
  5434. .toUpperCase() + e.substring(1);
  5435. var n = t.originalName.replace(/([A-Z])/g, (function(t) {
  5436. return "_" + t
  5437. })),
  5438. r = function(e, i) {
  5439. return this[t.name] = i ? e : t.verifyValue(e), this
  5440. },
  5441. o = function() {
  5442. return this[t.name]
  5443. };
  5444. null === i.getChild("set" + e) && (a["set" + e] = r), null === i.getChild("set_" + n) && (a["set_" + n] = r), null === i.getChild("get" + e) && (a["get" + e] = o), null === i.getChild("get_" + n) && (a["get_" + n] = o)
  5445. }(l)
  5446. }
  5447. function u(i, n, r, o) {
  5448. if (null === i || "object" != typeof i) {
  5449. if (o && o instanceof e.Reflect.Enum) {
  5450. var a = e.Reflect.Enum.getName(o.object, i);
  5451. if (null !== a) return a
  5452. }
  5453. return i
  5454. }
  5455. if (t.isByteBuffer(i)) return n ? i.toBase64() : i.toBuffer();
  5456. if (e.Long.isLong(i)) return r ? i.toString() : e.Long.fromValue(i);
  5457. var s;
  5458. if (Array.isArray(i)) return s = [], i.forEach((function(t, e) {
  5459. s[e] = u(t, n, r, o)
  5460. })), s;
  5461. if (s = {}, i instanceof e.Map) {
  5462. for (var l = i.entries(), h = l.next(); !h.done; h = l.next()) s[i.keyElem.valueToString(h.value[0])] = u(h.value[1], n, r, i.valueElem.resolvedType);
  5463. return s
  5464. }
  5465. var c = i.$type,
  5466. d = void 0;
  5467. for (var p in i) i.hasOwnProperty(p) && (c && (d = c.getChild(p)) ? s[p] = u(i[p], n, r, d.resolvedType) : s[p] = u(i[p], n, r));
  5468. return s
  5469. }
  5470. return a.encode = function(e, n) {
  5471. "boolean" == typeof e && (n = e, e = void 0);
  5472. var r = !1;
  5473. e || (e = new t, r = !0);
  5474. var o = e.littleEndian;
  5475. try {
  5476. return i.encode(this, e.LE(), n), (r ? e.flip() : e)
  5477. .LE(o)
  5478. } catch (t) {
  5479. throw e.LE(o), t
  5480. }
  5481. }, o.encode = function(t, e, i) {
  5482. return new o(t)
  5483. .encode(e, i)
  5484. }, a.calculate = function() {
  5485. return i.calculate(this)
  5486. }, a.encodeDelimited = function(e, n) {
  5487. var r = !1;
  5488. e || (e = new t, r = !0);
  5489. var o = (new t)
  5490. .LE();
  5491. return i.encode(this, o, n)
  5492. .flip(), e.writeVarint32(o.remaining()), e.append(o), r ? e.flip() : e
  5493. }, a.encodeAB = function() {
  5494. try {
  5495. return this.encode()
  5496. .toArrayBuffer()
  5497. } catch (t) {
  5498. throw t.encoded && (t.encoded = t.encoded.toArrayBuffer()), t
  5499. }
  5500. }, a.toArrayBuffer = a.encodeAB, a.encodeNB = function() {
  5501. try {
  5502. return this.encode()
  5503. .toBuffer()
  5504. } catch (t) {
  5505. throw t.encoded && (t.encoded = t.encoded.toBuffer()), t
  5506. }
  5507. }, a.toBuffer = a.encodeNB, a.encode64 = function() {
  5508. try {
  5509. return this.encode()
  5510. .toBase64()
  5511. } catch (t) {
  5512. throw t.encoded && (t.encoded = t.encoded.toBase64()), t
  5513. }
  5514. }, a.toBase64 = a.encode64, a.encodeHex = function() {
  5515. try {
  5516. return this.encode()
  5517. .toHex()
  5518. } catch (t) {
  5519. throw t.encoded && (t.encoded = t.encoded.toHex()), t
  5520. }
  5521. }, a.toHex = a.encodeHex, a.toRaw = function(t, e) {
  5522. return u(this, !!t, !!e, this.$type)
  5523. }, a.encodeJSON = function() {
  5524. return JSON.stringify(u(this, !0, !0, this.$type))
  5525. }, o.decode = function(e, n, r) {
  5526. "string" == typeof n && (r = n, n = -1), "string" == typeof e ? e = t.wrap(e, r || "base64") : t.isByteBuffer(e) || (e = t.wrap(e));
  5527. var o = e.littleEndian;
  5528. try {
  5529. var a = i.decode(e.LE(), n);
  5530. return e.LE(o), a
  5531. } catch (t) {
  5532. throw e.LE(o), t
  5533. }
  5534. }, o.decodeDelimited = function(e, n) {
  5535. if ("string" == typeof e ? e = t.wrap(e, n || "base64") : t.isByteBuffer(e) || (e = t.wrap(e)), e.remaining() < 1) return null;
  5536. var r = e.offset,
  5537. o = e.readVarint32();
  5538. if (e.remaining() < o) return e.offset = r, null;
  5539. try {
  5540. var a = i.decode(e.slice(e.offset, e.offset + o)
  5541. .LE());
  5542. return e.offset += o, a
  5543. } catch (t) {
  5544. throw e.offset += o, t
  5545. }
  5546. }, o.decode64 = function(t) {
  5547. return o.decode(t, "base64")
  5548. }, o.decodeHex = function(t) {
  5549. return o.decode(t, "hex")
  5550. }, o.decodeJSON = function(t) {
  5551. return new o(JSON.parse(t))
  5552. }, a.toString = function() {
  5553. return i.toString()
  5554. }, Object.defineProperty && (Object.defineProperty(o, "$options", {
  5555. value: i.buildOpt()
  5556. }), Object.defineProperty(a, "$options", {
  5557. value: o.$options
  5558. }), Object.defineProperty(o, "$type", {
  5559. value: i
  5560. }), Object.defineProperty(a, "$type", {
  5561. value: i
  5562. })), o
  5563. }(e, this);
  5564. this._fields = [], this._fieldsById = {}, this._fieldsByName = {}, this._oneofsByName = {};
  5565. for (var r, o = 0, a = this.children.length; o < a; o++)
  5566. if ((r = this.children[o]) instanceof g || r instanceof h || r instanceof b) {
  5567. if (n.hasOwnProperty(r.name)) throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  5568. n[r.name] = r.build()
  5569. } else if (r instanceof h.Field) r.build(), this._fields.push(r), this._fieldsById[r.id] = r, this._fieldsByName[r.name] = r;
  5570. else if (r instanceof h.OneOf) this._oneofsByName[r.name] = r;
  5571. else if (!(r instanceof h.OneOf || r instanceof y)) throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  5572. return this.clazz = n
  5573. }, c.encode = function(t, e, i) {
  5574. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a) r = t[(n = this._fields[a])
  5575. .name], n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), e, t);
  5576. if (null !== o) {
  5577. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  5578. throw l.encoded = e, l
  5579. }
  5580. return e
  5581. }, c.calculate = function(t) {
  5582. for (var e, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  5583. if (i = t[(e = this._fields[r])
  5584. .name], e.required && null === i) throw Error("Missing at least one required field for " + this.toString(!0) + ": " + e);
  5585. n += e.calculate(i, t)
  5586. }
  5587. return n
  5588. }, c.decode = function(t, i, n) {
  5589. "number" != typeof i && (i = -1);
  5590. for (var r, o, a, s, l = t.offset, u = new this.clazz; t.offset < l + i || -1 === i && t.remaining() > 0;) {
  5591. if (a = (r = t.readVarint32()) >>> 3, (o = 7 & r) === e.WIRE_TYPES.ENDGROUP) {
  5592. if (a !== n) throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + a + " (" + (n ? n + " expected" : "not a group") + ")");
  5593. break
  5594. }
  5595. if (s = this._fieldsById[a]) {
  5596. if (s.repeated && !s.options.packed) u[s.name].push(s.decode(o, t));
  5597. else if (s.map) {
  5598. var h = s.decode(o, t);
  5599. u[s.name].set(h[0], h[1])
  5600. } else if (u[s.name] = s.decode(o, t), s.oneof) {
  5601. var c = u[s.oneof.name];
  5602. null !== c && c !== s.name && (u[c] = null), u[s.oneof.name] = s.name
  5603. }
  5604. } else switch (o) {
  5605. case e.WIRE_TYPES.VARINT:
  5606. t.readVarint32();
  5607. break;
  5608. case e.WIRE_TYPES.BITS32:
  5609. t.offset += 4;
  5610. break;
  5611. case e.WIRE_TYPES.BITS64:
  5612. t.offset += 8;
  5613. break;
  5614. case e.WIRE_TYPES.LDELIM:
  5615. var p = t.readVarint32();
  5616. t.offset += p;
  5617. break;
  5618. case e.WIRE_TYPES.STARTGROUP:
  5619. for (; d(a, t););
  5620. break;
  5621. default:
  5622. throw Error("Illegal wire type for unknown field " + a + " in " + this.toString(!0) + "#decode: " + o)
  5623. }
  5624. }
  5625. for (var f = 0, m = this._fields.length; f < m; ++f)
  5626. if (null === u[(s = this._fields[f])
  5627. .name])
  5628. if ("proto3" === this.syntax) u[s.name] = s.defaultValue;
  5629. else {
  5630. if (s.required) {
  5631. var g = Error("Missing at least one required field for " + this.toString(!0) + ": " + s.name);
  5632. throw g.decoded = u, g
  5633. }
  5634. e.populateDefaults && null !== s.defaultValue && (u[s.name] = s.defaultValue)
  5635. } return u
  5636. }, i.Message = h;
  5637. var p = function(t, i, r, o, a, s, l, u, c, d) {
  5638. n.call(this, t, i, s), this.className = "Message.Field", this.required = "required" === r, this.repeated = "repeated" === r, this.map = "map" === r, this.keyType = o || null, this.type = a, this.resolvedType = null, this.id = l, this.options = u || {}, this.defaultValue = null, this.oneof = c || null, this.syntax = d || "proto2", this.originalName = this.name, this.element = null, this.keyElement = null, !this.builder.options.convertFieldsToCamelCase || this instanceof h.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  5639. },
  5640. f = p.prototype = Object.create(n.prototype);
  5641. f.build = function() {
  5642. this.element = new s(this.type, this.resolvedType, !1, this.syntax, this.name), this.map && (this.keyElement = new s(this.keyType, void 0, !0, this.syntax, this.name)), "proto3" !== this.syntax || this.repeated || this.map ? void 0 !== this.options.default && (this.defaultValue = this.verifyValue(this.options.default)) : this.defaultValue = s.defaultFieldValue(this.type)
  5643. }, f.verifyValue = function(t, i) {
  5644. i = i || !1;
  5645. var n, r = this;
  5646. function o(t, e) {
  5647. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + t + " (" + e + ")")
  5648. }
  5649. if (null === t) return this.required && o(typeof t, "required"), "proto3" === this.syntax && this.type !== e.TYPES.message && o(typeof t, "proto3 field without field presence cannot be null"), null;
  5650. if (this.repeated && !i) {
  5651. Array.isArray(t) || (t = [t]);
  5652. var a = [];
  5653. for (n = 0; n < t.length; n++) a.push(this.element.verifyValue(t[n]));
  5654. return a
  5655. }
  5656. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || o(typeof t, "expected ProtoBuf.Map or raw object for map field"), new e.Map(this, t)) : (!this.repeated && Array.isArray(t) && o(typeof t, "no array expected"), this.element.verifyValue(t))
  5657. }, f.hasWirePresence = function(t, i) {
  5658. if ("proto3" !== this.syntax) return null !== t;
  5659. if (this.oneof && i[this.oneof.name] === this.name) return !0;
  5660. switch (this.type) {
  5661. case e.TYPES.int32:
  5662. case e.TYPES.sint32:
  5663. case e.TYPES.sfixed32:
  5664. case e.TYPES.uint32:
  5665. case e.TYPES.fixed32:
  5666. return 0 !== t;
  5667. case e.TYPES.int64:
  5668. case e.TYPES.sint64:
  5669. case e.TYPES.sfixed64:
  5670. case e.TYPES.uint64:
  5671. case e.TYPES.fixed64:
  5672. return 0 !== t.low || 0 !== t.high;
  5673. case e.TYPES.bool:
  5674. return t;
  5675. case e.TYPES.float:
  5676. case e.TYPES.double:
  5677. return 0 !== t;
  5678. case e.TYPES.string:
  5679. return t.length > 0;
  5680. case e.TYPES.bytes:
  5681. return t.remaining() > 0;
  5682. case e.TYPES.enum:
  5683. return 0 !== t;
  5684. case e.TYPES.message:
  5685. return null !== t;
  5686. default:
  5687. return !0
  5688. }
  5689. }, f.encode = function(i, n, r) {
  5690. if (null === this.type || "object" != typeof this.type) throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  5691. if (null === i || this.repeated && 0 == i.length) return n;
  5692. try {
  5693. var o;
  5694. if (this.repeated)
  5695. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  5696. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM), n.ensureCapacity(n.offset += 1);
  5697. var a = n.offset;
  5698. for (o = 0; o < i.length; o++) this.element.encodeValue(this.id, i[o], n);
  5699. var s = n.offset - a,
  5700. l = t.calculateVarint32(s);
  5701. if (l > 1) {
  5702. var u = n.slice(a, n.offset);
  5703. a += l - 1, n.offset = a, n.append(u)
  5704. }
  5705. n.writeVarint32(s, a - l)
  5706. } else
  5707. for (o = 0; o < i.length; o++) n.writeVarint32(this.id << 3 | this.type.wireType), this.element.encodeValue(this.id, i[o], n);
  5708. else this.map ? i.forEach((function(i, r, o) {
  5709. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  5710. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM), n.writeVarint32(a), n.writeVarint32(8 | this.keyType.wireType), this.keyElement.encodeValue(1, r, n), n.writeVarint32(16 | this.type.wireType), this.element.encodeValue(2, i, n)
  5711. }), this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType), this.element.encodeValue(this.id, i, n))
  5712. } catch (t) {
  5713. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + t + ")")
  5714. }
  5715. return n
  5716. }, f.calculate = function(i, n) {
  5717. if (i = this.verifyValue(i), null === this.type || "object" != typeof this.type) throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  5718. if (null === i || this.repeated && 0 == i.length) return 0;
  5719. var r = 0;
  5720. try {
  5721. var o, a;
  5722. if (this.repeated)
  5723. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  5724. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM), a = 0, o = 0; o < i.length; o++) a += this.element.calculateLength(this.id, i[o]);
  5725. r += t.calculateVarint32(a), r += a
  5726. } else
  5727. for (o = 0; o < i.length; o++) r += t.calculateVarint32(this.id << 3 | this.type.wireType), r += this.element.calculateLength(this.id, i[o]);
  5728. else this.map ? i.forEach((function(i, n, o) {
  5729. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  5730. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM), r += t.calculateVarint32(a), r += a
  5731. }), this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType), r += this.element.calculateLength(this.id, i))
  5732. } catch (t) {
  5733. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + t + ")")
  5734. }
  5735. return r
  5736. }, f.decode = function(t, i, n) {
  5737. var r, o;
  5738. if (!(!this.map && t == this.type.wireType || !n && this.repeated && this.options.packed && t == e.WIRE_TYPES.LDELIM || this.map && t == e.WIRE_TYPES.LDELIM)) throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  5739. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  5740. o = i.readVarint32(), o = i.offset + o;
  5741. for (var a = []; i.offset < o;) a.push(this.decode(this.type.wireType, i, !0));
  5742. return a
  5743. }
  5744. if (this.map) {
  5745. var l = s.defaultFieldValue(this.keyType);
  5746. if (r = s.defaultFieldValue(this.type), o = i.readVarint32(), i.remaining() < o) throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  5747. var u = i.clone();
  5748. for (u.limit = u.offset + o, i.offset += o; u.remaining() > 0;) {
  5749. var h = u.readVarint32();
  5750. t = 7 & h;
  5751. var c = h >>> 3;
  5752. if (1 === c) l = this.keyElement.decode(u, t, c);
  5753. else {
  5754. if (2 !== c) throw Error("Unexpected tag in map field key/value submessage");
  5755. r = this.element.decode(u, t, c)
  5756. }
  5757. }
  5758. return [l, r]
  5759. }
  5760. return this.element.decode(i, t, this.id)
  5761. }, i.Message.Field = p;
  5762. var m = function(t, e, i, n, r, o, a) {
  5763. p.call(this, t, e, i, null, n, r, o, a), this.extension
  5764. };
  5765. m.prototype = Object.create(p.prototype), i.Message.ExtensionField = m, i.Message.OneOf = function(t, e, i) {
  5766. n.call(this, t, e, i), this.fields = []
  5767. };
  5768. var g = function(t, e, i, n, r) {
  5769. o.call(this, t, e, i, n, r), this.className = "Enum", this.object = null
  5770. };
  5771. g.getName = function(t, e) {
  5772. for (var i, n = Object.keys(t), r = 0; r < n.length; ++r)
  5773. if (t[i = n[r]] === e) return i;
  5774. return null
  5775. }, (g.prototype = Object.create(o.prototype))
  5776. .build = function(t) {
  5777. if (this.object && !t) return this.object;
  5778. for (var i = new e.Builder.Enum, n = this.getChildren(g.Value), r = 0, o = n.length; r < o; ++r) i[n[r].name] = n[r].id;
  5779. return Object.defineProperty && Object.defineProperty(i, "$options", {
  5780. value: this.buildOpt(),
  5781. enumerable: !1
  5782. }), this.object = i
  5783. }, i.Enum = g;
  5784. var v = function(t, e, i, r) {
  5785. n.call(this, t, e, i), this.className = "Enum.Value", this.id = r
  5786. };
  5787. v.prototype = Object.create(n.prototype), i.Enum.Value = v;
  5788. var y = function(t, e, i, r) {
  5789. n.call(this, t, e, i), this.field = r
  5790. };
  5791. y.prototype = Object.create(n.prototype), i.Extension = y;
  5792. var b = function(t, e, i, n) {
  5793. o.call(this, t, e, i, n), this.className = "Service", this.clazz = null
  5794. };
  5795. (b.prototype = Object.create(o.prototype))
  5796. .build = function(i) {
  5797. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  5798. for (var n = function(t) {
  5799. e.Builder.Service.call(this), this.rpcImpl = t || function(t, e, i) {
  5800. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  5801. }
  5802. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++) ! function(e) {
  5803. r[e.name] = function(n, r) {
  5804. try {
  5805. try {
  5806. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  5807. } catch (t) {
  5808. if (!(t instanceof TypeError)) throw t
  5809. }
  5810. if (null === n || "object" != typeof n) throw Error("Illegal arguments");
  5811. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)), this.rpcImpl(e.fqn(), n, (function(t, n) {
  5812. if (t) r(t);
  5813. else {
  5814. null === n && (n = "");
  5815. try {
  5816. n = e.resolvedResponseType.clazz.decode(n)
  5817. } catch (t) {}
  5818. n && n instanceof e.resolvedResponseType.clazz ? r(null, n) : r(Error("Illegal response type received in service method " + i.name + "#" + e.name))
  5819. }
  5820. }))
  5821. } catch (t) {
  5822. setTimeout(r.bind(this, t), 0)
  5823. }
  5824. }, n[e.name] = function(t, i, r) {
  5825. new n(t)[e.name](i, r)
  5826. }, Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  5827. value: e.buildOpt()
  5828. }), Object.defineProperty(r[e.name], "$options", {
  5829. value: n[e.name].$options
  5830. }))
  5831. }(o[a]);
  5832. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  5833. value: i.buildOpt()
  5834. }), Object.defineProperty(r, "$options", {
  5835. value: n.$options
  5836. }), Object.defineProperty(n, "$type", {
  5837. value: i
  5838. }), Object.defineProperty(r, "$type", {
  5839. value: i
  5840. })), n
  5841. }(e, this)
  5842. }, i.Service = b;
  5843. var w = function(t, e, i, r) {
  5844. n.call(this, t, e, i), this.className = "Service.Method", this.options = r || {}
  5845. };
  5846. (w.prototype = Object.create(n.prototype))
  5847. .buildOpt = a.buildOpt, i.Service.Method = w;
  5848. var x = function(t, e, i, n, r, o, a, s) {
  5849. w.call(this, t, e, i, s), this.className = "Service.RPCMethod", this.requestName = n, this.responseName = r, this.requestStream = o, this.responseStream = a, this.resolvedRequestType = null, this.resolvedResponseType = null
  5850. };
  5851. return x.prototype = Object.create(w.prototype), i.Service.RPCMethod = x, i
  5852. }(o), o.Builder = function(t, e, n) {
  5853. var r = function(t) {
  5854. this.ns = new n.Namespace(this, null, ""), this.ptr = this.ns, this.resolved = !1, this.result = null, this.files = {}, this.importRoot = null, this.options = t || {}
  5855. },
  5856. o = r.prototype;
  5857. return r.isMessage = function(t) {
  5858. return "string" == typeof t.name && void 0 === t.values && void 0 === t.rpc
  5859. }, r.isMessageField = function(t) {
  5860. return "string" == typeof t.rule && "string" == typeof t.name && "string" == typeof t.type && void 0 !== t.id
  5861. }, r.isEnum = function(t) {
  5862. return "string" == typeof t.name && !(void 0 === t.values || !Array.isArray(t.values) || 0 === t.values.length)
  5863. }, r.isService = function(t) {
  5864. return !("string" != typeof t.name || "object" != typeof t.rpc || !t.rpc)
  5865. }, r.isExtend = function(t) {
  5866. return "string" == typeof t.ref
  5867. }, o.reset = function() {
  5868. return this.ptr = this.ns, this
  5869. }, o.define = function(t) {
  5870. if ("string" != typeof t || !e.TYPEREF.test(t)) throw Error("illegal namespace: " + t);
  5871. return t.split(".")
  5872. .forEach((function(t) {
  5873. var e = this.ptr.getChild(t);
  5874. null === e && this.ptr.addChild(e = new n.Namespace(this, this.ptr, t)), this.ptr = e
  5875. }), this), this
  5876. }, o.create = function(e) {
  5877. if (!e) return this;
  5878. if (Array.isArray(e)) {
  5879. if (0 === e.length) return this;
  5880. e = e.slice()
  5881. } else e = [e];
  5882. for (var i = [e]; i.length > 0;) {
  5883. if (e = i.pop(), !Array.isArray(e)) throw Error("not a valid namespace: " + JSON.stringify(e));
  5884. for (; e.length > 0;) {
  5885. var o = e.shift();
  5886. if (r.isMessage(o)) {
  5887. var a = new n.Message(this, this.ptr, o.name, o.options, o.isGroup, o.syntax),
  5888. s = {};
  5889. o.oneofs && Object.keys(o.oneofs)
  5890. .forEach((function(t) {
  5891. a.addChild(s[t] = new n.Message.OneOf(this, a, t))
  5892. }), this), o.fields && o.fields.forEach((function(t) {
  5893. if (null !== a.getChild(0 | t.id)) throw Error("duplicate or invalid field id in " + a.name + ": " + t.id);
  5894. if (t.options && "object" != typeof t.options) throw Error("illegal field options in " + a.name + "#" + t.name);
  5895. var e = null;
  5896. if ("string" == typeof t.oneof && !(e = s[t.oneof])) throw Error("illegal oneof in " + a.name + "#" + t.name + ": " + t.oneof);
  5897. t = new n.Message.Field(this, a, t.rule, t.keytype, t.type, t.name, t.id, t.options, e, o.syntax), e && e.fields.push(t), a.addChild(t)
  5898. }), this);
  5899. var l = [];
  5900. if (o.enums && o.enums.forEach((function(t) {
  5901. l.push(t)
  5902. })), o.messages && o.messages.forEach((function(t) {
  5903. l.push(t)
  5904. })), o.services && o.services.forEach((function(t) {
  5905. l.push(t)
  5906. })), o.extensions && ("number" == typeof o.extensions[0] ? a.extensions = [o.extensions] : a.extensions = o.extensions), this.ptr.addChild(a), l.length > 0) {
  5907. i.push(e), e = l, l = null, this.ptr = a, a = null;
  5908. continue
  5909. }
  5910. l = null
  5911. } else if (r.isEnum(o)) a = new n.Enum(this, this.ptr, o.name, o.options, o.syntax), o.values.forEach((function(t) {
  5912. a.addChild(new n.Enum.Value(this, a, t.name, t.id))
  5913. }), this), this.ptr.addChild(a);
  5914. else if (r.isService(o)) a = new n.Service(this, this.ptr, o.name, o.options), Object.keys(o.rpc)
  5915. .forEach((function(t) {
  5916. var e = o.rpc[t];
  5917. a.addChild(new n.Service.RPCMethod(this, a, t, e.request, e.response, !!e.request_stream, !!e.response_stream, e.options))
  5918. }), this), this.ptr.addChild(a);
  5919. else {
  5920. if (!r.isExtend(o)) throw Error("not a valid definition: " + JSON.stringify(o));
  5921. if (a = this.ptr.resolve(o.ref, !0)) o.fields.forEach((function(e) {
  5922. if (null !== a.getChild(0 | e.id)) throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  5923. if (a.extensions) {
  5924. var i = !1;
  5925. if (a.extensions.forEach((function(t) {
  5926. e.id >= t[0] && e.id <= t[1] && (i = !0)
  5927. })), !i) throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  5928. }
  5929. var r = e.name;
  5930. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  5931. var o = new n.Message.ExtensionField(this, a, e.rule, e.type, this.ptr.fqn() + "." + r, e.id, e.options),
  5932. s = new n.Extension(this, this.ptr, e.name, o);
  5933. o.extension = s, this.ptr.addChild(s), a.addChild(o)
  5934. }), this);
  5935. else if (!/\.?google\.protobuf\./.test(o.ref)) throw Error("extended message " + o.ref + " is not defined")
  5936. }
  5937. o = null, a = null
  5938. }
  5939. e = null, this.ptr = this.ptr.parent
  5940. }
  5941. return this.resolved = !1, this.result = null, this
  5942. }, o.import = function(e, n) {
  5943. var r = "/";
  5944. if ("string" == typeof n) {
  5945. if (t.Util.IS_NODE && (n = i(34)
  5946. .resolve(n)), !0 === this.files[n]) return this.reset();
  5947. this.files[n] = !0
  5948. } else if ("object" == typeof n) {
  5949. var o, a = n.root;
  5950. if (t.Util.IS_NODE && (a = i(34)
  5951. .resolve(a)), (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (r = "\\"), o = t.Util.IS_NODE ? i(34)
  5952. .join(a, n.file) : a + r + n.file, !0 === this.files[o]) return this.reset();
  5953. this.files[o] = !0
  5954. }
  5955. if (e.imports && e.imports.length > 0) {
  5956. var s, l = !1;
  5957. "object" == typeof n ? (this.importRoot = n.root, l = !0, s = this.importRoot, n = n.file, (s.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (r = "\\")) : "string" == typeof n ? this.importRoot ? s = this.importRoot : n.indexOf("/") >= 0 ? "" === (s = n.replace(/\/[^\/]*$/, "")) && (s = "/") : n.indexOf("\\") >= 0 ? (s = n.replace(/\\[^\\]*$/, ""), r = "\\") : s = "." : s = null;
  5958. for (var u = 0; u < e.imports.length; u++)
  5959. if ("string" == typeof e.imports[u]) {
  5960. if (!s) throw Error("cannot determine import root");
  5961. var h = e.imports[u];
  5962. if ("google/protobuf/descriptor.proto" === h) continue;
  5963. if (h = t.Util.IS_NODE ? i(34)
  5964. .join(s, h) : s + r + h, !0 === this.files[h]) continue;
  5965. /\.proto$/i.test(h) && !t.DotProto && (h = h.replace(/\.proto$/, ".json"));
  5966. var c = t.Util.fetch(h);
  5967. if (null === c) throw Error("failed to import '" + h + "' in '" + n + "': file not found");
  5968. /\.json$/i.test(h) ? this.import(JSON.parse(c + ""), h) : this.import(t.DotProto.Parser.parse(c), h)
  5969. } else n ? /\.(\w+)$/.test(n) ? this.import(e.imports[u], n.replace(/^(.+)\.(\w+)$/, (function(t, e, i) {
  5970. return e + "_import" + u + "." + i
  5971. }))) : this.import(e.imports[u], n + "_import" + u) : this.import(e.imports[u]);
  5972. l && (this.importRoot = null)
  5973. }
  5974. e.package && this.define(e.package), e.syntax && function t(e) {
  5975. e.messages && e.messages.forEach((function(i) {
  5976. i.syntax = e.syntax, t(i)
  5977. })), e.enums && e.enums.forEach((function(t) {
  5978. t.syntax = e.syntax
  5979. }))
  5980. }(e);
  5981. var d = this.ptr;
  5982. return e.options && Object.keys(e.options)
  5983. .forEach((function(t) {
  5984. d.options[t] = e.options[t]
  5985. })), e.messages && (this.create(e.messages), this.ptr = d), e.enums && (this.create(e.enums), this.ptr = d), e.services && (this.create(e.services), this.ptr = d), e.extends && this.create(e.extends), this.reset()
  5986. }, o.resolveAll = function() {
  5987. var i;
  5988. if (null == this.ptr || "object" == typeof this.ptr.type) return this;
  5989. if (this.ptr instanceof n.Namespace) this.ptr.children.forEach((function(t) {
  5990. this.ptr = t, this.resolveAll()
  5991. }), this);
  5992. else if (this.ptr instanceof n.Message.Field) {
  5993. if (e.TYPE.test(this.ptr.type)) this.ptr.type = t.TYPES[this.ptr.type];
  5994. else {
  5995. if (!e.TYPEREF.test(this.ptr.type)) throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  5996. if (!(i = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent)
  5997. .resolve(this.ptr.type, !0))) throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  5998. if (this.ptr.resolvedType = i, i instanceof n.Enum) {
  5999. if (this.ptr.type = t.TYPES.enum, "proto3" === this.ptr.syntax && "proto3" !== i.syntax) throw Error("proto3 message cannot reference proto2 enum")
  6000. } else {
  6001. if (!(i instanceof n.Message)) throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  6002. this.ptr.type = i.isGroup ? t.TYPES.group : t.TYPES.message
  6003. }
  6004. }
  6005. if (this.ptr.map) {
  6006. if (!e.TYPE.test(this.ptr.keyType)) throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  6007. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  6008. }
  6009. "proto3" === this.ptr.syntax && this.ptr.repeated && void 0 === this.ptr.options.packed && -1 !== t.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType) && (this.ptr.options.packed = !0)
  6010. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  6011. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod)) throw Error("illegal service type in " + this.ptr.toString(!0));
  6012. if (!((i = this.ptr.parent.resolve(this.ptr.requestName, !0)) && i instanceof t.Reflect.Message)) throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  6013. if (this.ptr.resolvedRequestType = i, !((i = this.ptr.parent.resolve(this.ptr.responseName, !0)) && i instanceof t.Reflect.Message)) throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  6014. this.ptr.resolvedResponseType = i
  6015. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value)) throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  6016. return this.reset()
  6017. }, o.build = function(t) {
  6018. if (this.reset(), this.resolved || (this.resolveAll(), this.resolved = !0, this.result = null), null === this.result && (this.result = this.ns.build()), !t) return this.result;
  6019. for (var e = "string" == typeof t ? t.split(".") : t, i = this.result, n = 0; n < e.length; n++) {
  6020. if (!i[e[n]]) {
  6021. i = null;
  6022. break
  6023. }
  6024. i = i[e[n]]
  6025. }
  6026. return i
  6027. }, o.lookup = function(t, e) {
  6028. return t ? this.ns.resolve(t, e) : this.ns
  6029. }, o.toString = function() {
  6030. return "Builder"
  6031. }, r.Message = function() {}, r.Enum = function() {}, r.Service = function() {}, r
  6032. }(o, o.Lang, o.Reflect), o.Map = function(t, e) {
  6033. var i = function(t, i) {
  6034. if (!t.map) throw Error("field is not a map");
  6035. if (this.field = t, this.keyElem = new e.Element(t.keyType, null, !0, t.syntax), this.valueElem = new e.Element(t.type, t.resolvedType, !1, t.syntax), this.map = {}, Object.defineProperty(this, "size", {
  6036. get: function() {
  6037. return Object.keys(this.map)
  6038. .length
  6039. }
  6040. }), i)
  6041. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  6042. var o = this.keyElem.valueFromString(n[r]),
  6043. a = this.valueElem.verifyValue(i[n[r]]);
  6044. this.map[this.keyElem.valueToString(o)] = {
  6045. key: o,
  6046. value: a
  6047. }
  6048. }
  6049. },
  6050. n = i.prototype;
  6051. function r(t) {
  6052. var e = 0;
  6053. return {
  6054. next: function() {
  6055. return e < t.length ? {
  6056. done: !1,
  6057. value: t[e++]
  6058. } : {
  6059. done: !0
  6060. }
  6061. }
  6062. }
  6063. }
  6064. return n.clear = function() {
  6065. this.map = {}
  6066. }, n.delete = function(t) {
  6067. var e = this.keyElem.valueToString(this.keyElem.verifyValue(t)),
  6068. i = e in this.map;
  6069. return delete this.map[e], i
  6070. }, n.entries = function() {
  6071. for (var t, e = [], i = Object.keys(this.map), n = 0; n < i.length; n++) e.push([(t = this.map[i[n]])
  6072. .key, t.value
  6073. ]);
  6074. return r(e)
  6075. }, n.keys = function() {
  6076. for (var t = [], e = Object.keys(this.map), i = 0; i < e.length; i++) t.push(this.map[e[i]].key);
  6077. return r(t)
  6078. }, n.values = function() {
  6079. for (var t = [], e = Object.keys(this.map), i = 0; i < e.length; i++) t.push(this.map[e[i]].value);
  6080. return r(t)
  6081. }, n.forEach = function(t, e) {
  6082. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++) t.call(e, (i = this.map[n[r]])
  6083. .value, i.key, this)
  6084. }, n.set = function(t, e) {
  6085. var i = this.keyElem.verifyValue(t),
  6086. n = this.valueElem.verifyValue(e);
  6087. return this.map[this.keyElem.valueToString(i)] = {
  6088. key: i,
  6089. value: n
  6090. }, this
  6091. }, n.get = function(t) {
  6092. var e = this.keyElem.valueToString(this.keyElem.verifyValue(t));
  6093. if (e in this.map) return this.map[e].value
  6094. }, n.has = function(t) {
  6095. return this.keyElem.valueToString(this.keyElem.verifyValue(t)) in this.map
  6096. }, i
  6097. }(0, o.Reflect), o.loadProto = function(t, e, i) {
  6098. return ("string" == typeof e || e && "string" == typeof e.file && "string" == typeof e.root) && (i = e, e = void 0), o.loadJson(o.DotProto.Parser.parse(t), e, i)
  6099. }, o.protoFromString = o.loadProto, o.loadProtoFile = function(t, e, i) {
  6100. if (e && "object" == typeof e ? (i = e, e = null) : e && "function" == typeof e || (e = null), e) return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, (function(n) {
  6101. if (null !== n) try {
  6102. e(null, o.loadProto(n, i, t))
  6103. } catch (t) {
  6104. e(t)
  6105. } else e(Error("Failed to fetch file"))
  6106. }));
  6107. var n = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  6108. return null === n ? null : o.loadProto(n, i, t)
  6109. }, o.protoFromFile = o.loadProtoFile, o.newBuilder = function(t) {
  6110. return void 0 === (t = t || {})
  6111. .convertFieldsToCamelCase && (t.convertFieldsToCamelCase = o.convertFieldsToCamelCase), void 0 === t.populateAccessors && (t.populateAccessors = o.populateAccessors), new o.Builder(t)
  6112. }, o.loadJson = function(t, e, i) {
  6113. return ("string" == typeof e || e && "string" == typeof e.file && "string" == typeof e.root) && (i = e, e = null), e && "object" == typeof e || (e = o.newBuilder()), "string" == typeof t && (t = JSON.parse(t)), e.import(t, i), e.resolveAll(), e
  6114. }, o.loadJsonFile = function(t, e, i) {
  6115. if (e && "object" == typeof e ? (i = e, e = null) : e && "function" == typeof e || (e = null), e) return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, (function(n) {
  6116. if (null !== n) try {
  6117. e(null, o.loadJson(JSON.parse(n), i, t))
  6118. } catch (t) {
  6119. e(t)
  6120. } else e(Error("Failed to fetch file"))
  6121. }));
  6122. var n = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  6123. return null === n ? null : o.loadJson(JSON.parse(n), i, t)
  6124. }, o
  6125. }) ? r.apply(e, o) : r) || (t.exports = a)
  6126. })
  6127. .call(this, i(50))
  6128. }, function(t, e, i) {
  6129. "use strict";
  6130. (function(t) {
  6131. var n = i(172),
  6132. r = i(173),
  6133. o = i(174);
  6134. function a() {
  6135. return l.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  6136. }
  6137. function s(t, e) {
  6138. if (a() < e) throw new RangeError("Invalid typed array length");
  6139. return l.TYPED_ARRAY_SUPPORT ? (t = new Uint8Array(e))
  6140. .__proto__ = l.prototype : (null === t && (t = new l(e)), t.length = e), t
  6141. }
  6142. function l(t, e, i) {
  6143. if (!(l.TYPED_ARRAY_SUPPORT || this instanceof l)) return new l(t, e, i);
  6144. if ("number" == typeof t) {
  6145. if ("string" == typeof e) throw new Error("If encoding is specified then the first argument must be a string");
  6146. return c(this, t)
  6147. }
  6148. return u(this, t, e, i)
  6149. }
  6150. function u(t, e, i, n) {
  6151. if ("number" == typeof e) throw new TypeError('"value" argument must not be a number');
  6152. return "undefined" != typeof ArrayBuffer && e instanceof ArrayBuffer ? function(t, e, i, n) {
  6153. if (e.byteLength, i < 0 || e.byteLength < i) throw new RangeError("'offset' is out of bounds");
  6154. if (e.byteLength < i + (n || 0)) throw new RangeError("'length' is out of bounds");
  6155. e = void 0 === i && void 0 === n ? new Uint8Array(e) : void 0 === n ? new Uint8Array(e, i) : new Uint8Array(e, i, n);
  6156. l.TYPED_ARRAY_SUPPORT ? (t = e)
  6157. .__proto__ = l.prototype : t = d(t, e);
  6158. return t
  6159. }(t, e, i, n) : "string" == typeof e ? function(t, e, i) {
  6160. "string" == typeof i && "" !== i || (i = "utf8");
  6161. if (!l.isEncoding(i)) throw new TypeError('"encoding" must be a valid string encoding');
  6162. var n = 0 | f(e, i),
  6163. r = (t = s(t, n))
  6164. .write(e, i);
  6165. r !== n && (t = t.slice(0, r));
  6166. return t
  6167. }(t, e, i) : function(t, e) {
  6168. if (l.isBuffer(e)) {
  6169. var i = 0 | p(e.length);
  6170. return 0 === (t = s(t, i))
  6171. .length || e.copy(t, 0, 0, i), t
  6172. }
  6173. if (e) {
  6174. if ("undefined" != typeof ArrayBuffer && e.buffer instanceof ArrayBuffer || "length" in e) return "number" != typeof e.length || (n = e.length) != n ? s(t, 0) : d(t, e);
  6175. if ("Buffer" === e.type && o(e.data)) return d(t, e.data)
  6176. }
  6177. var n;
  6178. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  6179. }(t, e)
  6180. }
  6181. function h(t) {
  6182. if ("number" != typeof t) throw new TypeError('"size" argument must be a number');
  6183. if (t < 0) throw new RangeError('"size" argument must not be negative')
  6184. }
  6185. function c(t, e) {
  6186. if (h(e), t = s(t, e < 0 ? 0 : 0 | p(e)), !l.TYPED_ARRAY_SUPPORT)
  6187. for (var i = 0; i < e; ++i) t[i] = 0;
  6188. return t
  6189. }
  6190. function d(t, e) {
  6191. var i = e.length < 0 ? 0 : 0 | p(e.length);
  6192. t = s(t, i);
  6193. for (var n = 0; n < i; n += 1) t[n] = 255 & e[n];
  6194. return t
  6195. }
  6196. function p(t) {
  6197. if (t >= a()) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + a()
  6198. .toString(16) + " bytes");
  6199. return 0 | t
  6200. }
  6201. function f(t, e) {
  6202. if (l.isBuffer(t)) return t.length;
  6203. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(t) || t instanceof ArrayBuffer)) return t.byteLength;
  6204. "string" != typeof t && (t = "" + t);
  6205. var i = t.length;
  6206. if (0 === i) return 0;
  6207. for (var n = !1;;) switch (e) {
  6208. case "ascii":
  6209. case "latin1":
  6210. case "binary":
  6211. return i;
  6212. case "utf8":
  6213. case "utf-8":
  6214. case void 0:
  6215. return U(t)
  6216. .length;
  6217. case "ucs2":
  6218. case "ucs-2":
  6219. case "utf16le":
  6220. case "utf-16le":
  6221. return 2 * i;
  6222. case "hex":
  6223. return i >>> 1;
  6224. case "base64":
  6225. return V(t)
  6226. .length;
  6227. default:
  6228. if (n) return U(t)
  6229. .length;
  6230. e = ("" + e)
  6231. .toLowerCase(), n = !0
  6232. }
  6233. }
  6234. function m(t, e, i) {
  6235. var n = !1;
  6236. if ((void 0 === e || e < 0) && (e = 0), e > this.length) return "";
  6237. if ((void 0 === i || i > this.length) && (i = this.length), i <= 0) return "";
  6238. if ((i >>>= 0) <= (e >>>= 0)) return "";
  6239. for (t || (t = "utf8");;) switch (t) {
  6240. case "hex":
  6241. return E(this, e, i);
  6242. case "utf8":
  6243. case "utf-8":
  6244. return A(this, e, i);
  6245. case "ascii":
  6246. return P(this, e, i);
  6247. case "latin1":
  6248. case "binary":
  6249. return C(this, e, i);
  6250. case "base64":
  6251. return _(this, e, i);
  6252. case "ucs2":
  6253. case "ucs-2":
  6254. case "utf16le":
  6255. case "utf-16le":
  6256. return D(this, e, i);
  6257. default:
  6258. if (n) throw new TypeError("Unknown encoding: " + t);
  6259. t = (t + "")
  6260. .toLowerCase(), n = !0
  6261. }
  6262. }
  6263. function g(t, e, i) {
  6264. var n = t[e];
  6265. t[e] = t[i], t[i] = n
  6266. }
  6267. function v(t, e, i, n, r) {
  6268. if (0 === t.length) return -1;
  6269. if ("string" == typeof i ? (n = i, i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648), i = +i, isNaN(i) && (i = r ? 0 : t.length - 1), i < 0 && (i = t.length + i), i >= t.length) {
  6270. if (r) return -1;
  6271. i = t.length - 1
  6272. } else if (i < 0) {
  6273. if (!r) return -1;
  6274. i = 0
  6275. }
  6276. if ("string" == typeof e && (e = l.from(e, n)), l.isBuffer(e)) return 0 === e.length ? -1 : y(t, e, i, n, r);
  6277. if ("number" == typeof e) return e &= 255, l.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(t, e, i) : Uint8Array.prototype.lastIndexOf.call(t, e, i) : y(t, [e], i, n, r);
  6278. throw new TypeError("val must be string, number or Buffer")
  6279. }
  6280. function y(t, e, i, n, r) {
  6281. var o, a = 1,
  6282. s = t.length,
  6283. l = e.length;
  6284. if (void 0 !== n && ("ucs2" === (n = String(n)
  6285. .toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  6286. if (t.length < 2 || e.length < 2) return -1;
  6287. a = 2, s /= 2, l /= 2, i /= 2
  6288. }
  6289. function u(t, e) {
  6290. return 1 === a ? t[e] : t.readUInt16BE(e * a)
  6291. }
  6292. if (r) {
  6293. var h = -1;
  6294. for (o = i; o < s; o++)
  6295. if (u(t, o) === u(e, -1 === h ? 0 : o - h)) {
  6296. if (-1 === h && (h = o), o - h + 1 === l) return h * a
  6297. } else -1 !== h && (o -= o - h), h = -1
  6298. } else
  6299. for (i + l > s && (i = s - l), o = i; o >= 0; o--) {
  6300. for (var c = !0, d = 0; d < l; d++)
  6301. if (u(t, o + d) !== u(e, d)) {
  6302. c = !1;
  6303. break
  6304. } if (c) return o
  6305. }
  6306. return -1
  6307. }
  6308. function b(t, e, i, n) {
  6309. i = Number(i) || 0;
  6310. var r = t.length - i;
  6311. n ? (n = Number(n)) > r && (n = r) : n = r;
  6312. var o = e.length;
  6313. if (o % 2 != 0) throw new TypeError("Invalid hex string");
  6314. n > o / 2 && (n = o / 2);
  6315. for (var a = 0; a < n; ++a) {
  6316. var s = parseInt(e.substr(2 * a, 2), 16);
  6317. if (isNaN(s)) return a;
  6318. t[i + a] = s
  6319. }
  6320. return a
  6321. }
  6322. function w(t, e, i, n) {
  6323. return j(U(e, t.length - i), t, i, n)
  6324. }
  6325. function x(t, e, i, n) {
  6326. return j(function(t) {
  6327. for (var e = [], i = 0; i < t.length; ++i) e.push(255 & t.charCodeAt(i));
  6328. return e
  6329. }(e), t, i, n)
  6330. }
  6331. function M(t, e, i, n) {
  6332. return x(t, e, i, n)
  6333. }
  6334. function T(t, e, i, n) {
  6335. return j(V(e), t, i, n)
  6336. }
  6337. function S(t, e, i, n) {
  6338. return j(function(t, e) {
  6339. for (var i, n, r, o = [], a = 0; a < t.length && !((e -= 2) < 0); ++a) i = t.charCodeAt(a), n = i >> 8, r = i % 256, o.push(r), o.push(n);
  6340. return o
  6341. }(e, t.length - i), t, i, n)
  6342. }
  6343. function _(t, e, i) {
  6344. return 0 === e && i === t.length ? n.fromByteArray(t) : n.fromByteArray(t.slice(e, i))
  6345. }
  6346. function A(t, e, i) {
  6347. i = Math.min(t.length, i);
  6348. for (var n = [], r = e; r < i;) {
  6349. var o, a, s, l, u = t[r],
  6350. h = null,
  6351. c = u > 239 ? 4 : u > 223 ? 3 : u > 191 ? 2 : 1;
  6352. if (r + c <= i) switch (c) {
  6353. case 1:
  6354. u < 128 && (h = u);
  6355. break;
  6356. case 2:
  6357. 128 == (192 & (o = t[r + 1])) && (l = (31 & u) << 6 | 63 & o) > 127 && (h = l);
  6358. break;
  6359. case 3:
  6360. o = t[r + 1], a = t[r + 2], 128 == (192 & o) && 128 == (192 & a) && (l = (15 & u) << 12 | (63 & o) << 6 | 63 & a) > 2047 && (l < 55296 || l > 57343) && (h = l);
  6361. break;
  6362. case 4:
  6363. o = t[r + 1], a = t[r + 2], s = t[r + 3], 128 == (192 & o) && 128 == (192 & a) && 128 == (192 & s) && (l = (15 & u) << 18 | (63 & o) << 12 | (63 & a) << 6 | 63 & s) > 65535 && l < 1114112 && (h = l)
  6364. }
  6365. null === h ? (h = 65533, c = 1) : h > 65535 && (h -= 65536, n.push(h >>> 10 & 1023 | 55296), h = 56320 | 1023 & h), n.push(h), r += c
  6366. }
  6367. return function(t) {
  6368. var e = t.length;
  6369. if (e <= 4096) return String.fromCharCode.apply(String, t);
  6370. var i = "",
  6371. n = 0;
  6372. for (; n < e;) i += String.fromCharCode.apply(String, t.slice(n, n += 4096));
  6373. return i
  6374. }(n)
  6375. }
  6376. e.Buffer = l, e.SlowBuffer = function(t) {
  6377. +t != t && (t = 0);
  6378. return l.alloc(+t)
  6379. }, e.INSPECT_MAX_BYTES = 50, l.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : function() {
  6380. try {
  6381. var t = new Uint8Array(1);
  6382. return t.__proto__ = {
  6383. __proto__: Uint8Array.prototype,
  6384. foo: function() {
  6385. return 42
  6386. }
  6387. }, 42 === t.foo() && "function" == typeof t.subarray && 0 === t.subarray(1, 1)
  6388. .byteLength
  6389. } catch (t) {
  6390. return !1
  6391. }
  6392. }(), e.kMaxLength = a(), l.poolSize = 8192, l._augment = function(t) {
  6393. return t.__proto__ = l.prototype, t
  6394. }, l.from = function(t, e, i) {
  6395. return u(null, t, e, i)
  6396. }, l.TYPED_ARRAY_SUPPORT && (l.prototype.__proto__ = Uint8Array.prototype, l.__proto__ = Uint8Array, "undefined" != typeof Symbol && Symbol.species && l[Symbol.species] === l && Object.defineProperty(l, Symbol.species, {
  6397. value: null,
  6398. configurable: !0
  6399. })), l.alloc = function(t, e, i) {
  6400. return function(t, e, i, n) {
  6401. return h(e), e <= 0 ? s(t, e) : void 0 !== i ? "string" == typeof n ? s(t, e)
  6402. .fill(i, n) : s(t, e)
  6403. .fill(i) : s(t, e)
  6404. }(null, t, e, i)
  6405. }, l.allocUnsafe = function(t) {
  6406. return c(null, t)
  6407. }, l.allocUnsafeSlow = function(t) {
  6408. return c(null, t)
  6409. }, l.isBuffer = function(t) {
  6410. return !(null == t || !t._isBuffer)
  6411. }, l.compare = function(t, e) {
  6412. if (!l.isBuffer(t) || !l.isBuffer(e)) throw new TypeError("Arguments must be Buffers");
  6413. if (t === e) return 0;
  6414. for (var i = t.length, n = e.length, r = 0, o = Math.min(i, n); r < o; ++r)
  6415. if (t[r] !== e[r]) {
  6416. i = t[r], n = e[r];
  6417. break
  6418. } return i < n ? -1 : n < i ? 1 : 0
  6419. }, l.isEncoding = function(t) {
  6420. switch (String(t)
  6421. .toLowerCase()) {
  6422. case "hex":
  6423. case "utf8":
  6424. case "utf-8":
  6425. case "ascii":
  6426. case "latin1":
  6427. case "binary":
  6428. case "base64":
  6429. case "ucs2":
  6430. case "ucs-2":
  6431. case "utf16le":
  6432. case "utf-16le":
  6433. return !0;
  6434. default:
  6435. return !1
  6436. }
  6437. }, l.concat = function(t, e) {
  6438. if (!o(t)) throw new TypeError('"list" argument must be an Array of Buffers');
  6439. if (0 === t.length) return l.alloc(0);
  6440. var i;
  6441. if (void 0 === e)
  6442. for (e = 0, i = 0; i < t.length; ++i) e += t[i].length;
  6443. var n = l.allocUnsafe(e),
  6444. r = 0;
  6445. for (i = 0; i < t.length; ++i) {
  6446. var a = t[i];
  6447. if (!l.isBuffer(a)) throw new TypeError('"list" argument must be an Array of Buffers');
  6448. a.copy(n, r), r += a.length
  6449. }
  6450. return n
  6451. }, l.byteLength = f, l.prototype._isBuffer = !0, l.prototype.swap16 = function() {
  6452. var t = this.length;
  6453. if (t % 2 != 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
  6454. for (var e = 0; e < t; e += 2) g(this, e, e + 1);
  6455. return this
  6456. }, l.prototype.swap32 = function() {
  6457. var t = this.length;
  6458. if (t % 4 != 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
  6459. for (var e = 0; e < t; e += 4) g(this, e, e + 3), g(this, e + 1, e + 2);
  6460. return this
  6461. }, l.prototype.swap64 = function() {
  6462. var t = this.length;
  6463. if (t % 8 != 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
  6464. for (var e = 0; e < t; e += 8) g(this, e, e + 7), g(this, e + 1, e + 6), g(this, e + 2, e + 5), g(this, e + 3, e + 4);
  6465. return this
  6466. }, l.prototype.toString = function() {
  6467. var t = 0 | this.length;
  6468. return 0 === t ? "" : 0 === arguments.length ? A(this, 0, t) : m.apply(this, arguments)
  6469. }, l.prototype.equals = function(t) {
  6470. if (!l.isBuffer(t)) throw new TypeError("Argument must be a Buffer");
  6471. return this === t || 0 === l.compare(this, t)
  6472. }, l.prototype.inspect = function() {
  6473. var t = "",
  6474. i = e.INSPECT_MAX_BYTES;
  6475. return this.length > 0 && (t = this.toString("hex", 0, i)
  6476. .match(/.{2}/g)
  6477. .join(" "), this.length > i && (t += " ... ")), "<Buffer " + t + ">"
  6478. }, l.prototype.compare = function(t, e, i, n, r) {
  6479. if (!l.isBuffer(t)) throw new TypeError("Argument must be a Buffer");
  6480. if (void 0 === e && (e = 0), void 0 === i && (i = t ? t.length : 0), void 0 === n && (n = 0), void 0 === r && (r = this.length), e < 0 || i > t.length || n < 0 || r > this.length) throw new RangeError("out of range index");
  6481. if (n >= r && e >= i) return 0;
  6482. if (n >= r) return -1;
  6483. if (e >= i) return 1;
  6484. if (this === t) return 0;
  6485. for (var o = (r >>>= 0) - (n >>>= 0), a = (i >>>= 0) - (e >>>= 0), s = Math.min(o, a), u = this.slice(n, r), h = t.slice(e, i), c = 0; c < s; ++c)
  6486. if (u[c] !== h[c]) {
  6487. o = u[c], a = h[c];
  6488. break
  6489. } return o < a ? -1 : a < o ? 1 : 0
  6490. }, l.prototype.includes = function(t, e, i) {
  6491. return -1 !== this.indexOf(t, e, i)
  6492. }, l.prototype.indexOf = function(t, e, i) {
  6493. return v(this, t, e, i, !0)
  6494. }, l.prototype.lastIndexOf = function(t, e, i) {
  6495. return v(this, t, e, i, !1)
  6496. }, l.prototype.write = function(t, e, i, n) {
  6497. if (void 0 === e) n = "utf8", i = this.length, e = 0;
  6498. else if (void 0 === i && "string" == typeof e) n = e, i = this.length, e = 0;
  6499. else {
  6500. if (!isFinite(e)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  6501. e |= 0, isFinite(i) ? (i |= 0, void 0 === n && (n = "utf8")) : (n = i, i = void 0)
  6502. }
  6503. var r = this.length - e;
  6504. if ((void 0 === i || i > r) && (i = r), t.length > 0 && (i < 0 || e < 0) || e > this.length) throw new RangeError("Attempt to write outside buffer bounds");
  6505. n || (n = "utf8");
  6506. for (var o = !1;;) switch (n) {
  6507. case "hex":
  6508. return b(this, t, e, i);
  6509. case "utf8":
  6510. case "utf-8":
  6511. return w(this, t, e, i);
  6512. case "ascii":
  6513. return x(this, t, e, i);
  6514. case "latin1":
  6515. case "binary":
  6516. return M(this, t, e, i);
  6517. case "base64":
  6518. return T(this, t, e, i);
  6519. case "ucs2":
  6520. case "ucs-2":
  6521. case "utf16le":
  6522. case "utf-16le":
  6523. return S(this, t, e, i);
  6524. default:
  6525. if (o) throw new TypeError("Unknown encoding: " + n);
  6526. n = ("" + n)
  6527. .toLowerCase(), o = !0
  6528. }
  6529. }, l.prototype.toJSON = function() {
  6530. return {
  6531. type: "Buffer",
  6532. data: Array.prototype.slice.call(this._arr || this, 0)
  6533. }
  6534. };
  6535. function P(t, e, i) {
  6536. var n = "";
  6537. i = Math.min(t.length, i);
  6538. for (var r = e; r < i; ++r) n += String.fromCharCode(127 & t[r]);
  6539. return n
  6540. }
  6541. function C(t, e, i) {
  6542. var n = "";
  6543. i = Math.min(t.length, i);
  6544. for (var r = e; r < i; ++r) n += String.fromCharCode(t[r]);
  6545. return n
  6546. }
  6547. function E(t, e, i) {
  6548. var n = t.length;
  6549. (!e || e < 0) && (e = 0), (!i || i < 0 || i > n) && (i = n);
  6550. for (var r = "", o = e; o < i; ++o) r += z(t[o]);
  6551. return r
  6552. }
  6553. function D(t, e, i) {
  6554. for (var n = t.slice(e, i), r = "", o = 0; o < n.length; o += 2) r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  6555. return r
  6556. }
  6557. function L(t, e, i) {
  6558. if (t % 1 != 0 || t < 0) throw new RangeError("offset is not uint");
  6559. if (t + e > i) throw new RangeError("Trying to access beyond buffer length")
  6560. }
  6561. function O(t, e, i, n, r, o) {
  6562. if (!l.isBuffer(t)) throw new TypeError('"buffer" argument must be a Buffer instance');
  6563. if (e > r || e < o) throw new RangeError('"value" argument is out of bounds');
  6564. if (i + n > t.length) throw new RangeError("Index out of range")
  6565. }
  6566. function I(t, e, i, n) {
  6567. e < 0 && (e = 65535 + e + 1);
  6568. for (var r = 0, o = Math.min(t.length - i, 2); r < o; ++r) t[i + r] = (e & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  6569. }
  6570. function R(t, e, i, n) {
  6571. e < 0 && (e = 4294967295 + e + 1);
  6572. for (var r = 0, o = Math.min(t.length - i, 4); r < o; ++r) t[i + r] = e >>> 8 * (n ? r : 3 - r) & 255
  6573. }
  6574. function N(t, e, i, n, r, o) {
  6575. if (i + n > t.length) throw new RangeError("Index out of range");
  6576. if (i < 0) throw new RangeError("Index out of range")
  6577. }
  6578. function k(t, e, i, n, o) {
  6579. return o || N(t, 0, i, 4), r.write(t, e, i, n, 23, 4), i + 4
  6580. }
  6581. function F(t, e, i, n, o) {
  6582. return o || N(t, 0, i, 8), r.write(t, e, i, n, 52, 8), i + 8
  6583. }
  6584. l.prototype.slice = function(t, e) {
  6585. var i, n = this.length;
  6586. if ((t = ~~t) < 0 ? (t += n) < 0 && (t = 0) : t > n && (t = n), (e = void 0 === e ? n : ~~e) < 0 ? (e += n) < 0 && (e = 0) : e > n && (e = n), e < t && (e = t), l.TYPED_ARRAY_SUPPORT)(i = this.subarray(t, e))
  6587. .__proto__ = l.prototype;
  6588. else {
  6589. var r = e - t;
  6590. i = new l(r, void 0);
  6591. for (var o = 0; o < r; ++o) i[o] = this[o + t]
  6592. }
  6593. return i
  6594. }, l.prototype.readUIntLE = function(t, e, i) {
  6595. t |= 0, e |= 0, i || L(t, e, this.length);
  6596. for (var n = this[t], r = 1, o = 0; ++o < e && (r *= 256);) n += this[t + o] * r;
  6597. return n
  6598. }, l.prototype.readUIntBE = function(t, e, i) {
  6599. t |= 0, e |= 0, i || L(t, e, this.length);
  6600. for (var n = this[t + --e], r = 1; e > 0 && (r *= 256);) n += this[t + --e] * r;
  6601. return n
  6602. }, l.prototype.readUInt8 = function(t, e) {
  6603. return e || L(t, 1, this.length), this[t]
  6604. }, l.prototype.readUInt16LE = function(t, e) {
  6605. return e || L(t, 2, this.length), this[t] | this[t + 1] << 8
  6606. }, l.prototype.readUInt16BE = function(t, e) {
  6607. return e || L(t, 2, this.length), this[t] << 8 | this[t + 1]
  6608. }, l.prototype.readUInt32LE = function(t, e) {
  6609. return e || L(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + 16777216 * this[t + 3]
  6610. }, l.prototype.readUInt32BE = function(t, e) {
  6611. return e || L(t, 4, this.length), 16777216 * this[t] + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3])
  6612. }, l.prototype.readIntLE = function(t, e, i) {
  6613. t |= 0, e |= 0, i || L(t, e, this.length);
  6614. for (var n = this[t], r = 1, o = 0; ++o < e && (r *= 256);) n += this[t + o] * r;
  6615. return n >= (r *= 128) && (n -= Math.pow(2, 8 * e)), n
  6616. }, l.prototype.readIntBE = function(t, e, i) {
  6617. t |= 0, e |= 0, i || L(t, e, this.length);
  6618. for (var n = e, r = 1, o = this[t + --n]; n > 0 && (r *= 256);) o += this[t + --n] * r;
  6619. return o >= (r *= 128) && (o -= Math.pow(2, 8 * e)), o
  6620. }, l.prototype.readInt8 = function(t, e) {
  6621. return e || L(t, 1, this.length), 128 & this[t] ? -1 * (255 - this[t] + 1) : this[t]
  6622. }, l.prototype.readInt16LE = function(t, e) {
  6623. e || L(t, 2, this.length);
  6624. var i = this[t] | this[t + 1] << 8;
  6625. return 32768 & i ? 4294901760 | i : i
  6626. }, l.prototype.readInt16BE = function(t, e) {
  6627. e || L(t, 2, this.length);
  6628. var i = this[t + 1] | this[t] << 8;
  6629. return 32768 & i ? 4294901760 | i : i
  6630. }, l.prototype.readInt32LE = function(t, e) {
  6631. return e || L(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24
  6632. }, l.prototype.readInt32BE = function(t, e) {
  6633. return e || L(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]
  6634. }, l.prototype.readFloatLE = function(t, e) {
  6635. return e || L(t, 4, this.length), r.read(this, t, !0, 23, 4)
  6636. }, l.prototype.readFloatBE = function(t, e) {
  6637. return e || L(t, 4, this.length), r.read(this, t, !1, 23, 4)
  6638. }, l.prototype.readDoubleLE = function(t, e) {
  6639. return e || L(t, 8, this.length), r.read(this, t, !0, 52, 8)
  6640. }, l.prototype.readDoubleBE = function(t, e) {
  6641. return e || L(t, 8, this.length), r.read(this, t, !1, 52, 8)
  6642. }, l.prototype.writeUIntLE = function(t, e, i, n) {
  6643. (t = +t, e |= 0, i |= 0, n) || O(this, t, e, i, Math.pow(2, 8 * i) - 1, 0);
  6644. var r = 1,
  6645. o = 0;
  6646. for (this[e] = 255 & t; ++o < i && (r *= 256);) this[e + o] = t / r & 255;
  6647. return e + i
  6648. }, l.prototype.writeUIntBE = function(t, e, i, n) {
  6649. (t = +t, e |= 0, i |= 0, n) || O(this, t, e, i, Math.pow(2, 8 * i) - 1, 0);
  6650. var r = i - 1,
  6651. o = 1;
  6652. for (this[e + r] = 255 & t; --r >= 0 && (o *= 256);) this[e + r] = t / o & 255;
  6653. return e + i
  6654. }, l.prototype.writeUInt8 = function(t, e, i) {
  6655. return t = +t, e |= 0, i || O(this, t, e, 1, 255, 0), l.TYPED_ARRAY_SUPPORT || (t = Math.floor(t)), this[e] = 255 & t, e + 1
  6656. }, l.prototype.writeUInt16LE = function(t, e, i) {
  6657. return t = +t, e |= 0, i || O(this, t, e, 2, 65535, 0), l.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t, this[e + 1] = t >>> 8) : I(this, t, e, !0), e + 2
  6658. }, l.prototype.writeUInt16BE = function(t, e, i) {
  6659. return t = +t, e |= 0, i || O(this, t, e, 2, 65535, 0), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 8, this[e + 1] = 255 & t) : I(this, t, e, !1), e + 2
  6660. }, l.prototype.writeUInt32LE = function(t, e, i) {
  6661. return t = +t, e |= 0, i || O(this, t, e, 4, 4294967295, 0), l.TYPED_ARRAY_SUPPORT ? (this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, this[e] = 255 & t) : R(this, t, e, !0), e + 4
  6662. }, l.prototype.writeUInt32BE = function(t, e, i) {
  6663. return t = +t, e |= 0, i || O(this, t, e, 4, 4294967295, 0), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t) : R(this, t, e, !1), e + 4
  6664. }, l.prototype.writeIntLE = function(t, e, i, n) {
  6665. if (t = +t, e |= 0, !n) {
  6666. var r = Math.pow(2, 8 * i - 1);
  6667. O(this, t, e, i, r - 1, -r)
  6668. }
  6669. var o = 0,
  6670. a = 1,
  6671. s = 0;
  6672. for (this[e] = 255 & t; ++o < i && (a *= 256);) t < 0 && 0 === s && 0 !== this[e + o - 1] && (s = 1), this[e + o] = (t / a >> 0) - s & 255;
  6673. return e + i
  6674. }, l.prototype.writeIntBE = function(t, e, i, n) {
  6675. if (t = +t, e |= 0, !n) {
  6676. var r = Math.pow(2, 8 * i - 1);
  6677. O(this, t, e, i, r - 1, -r)
  6678. }
  6679. var o = i - 1,
  6680. a = 1,
  6681. s = 0;
  6682. for (this[e + o] = 255 & t; --o >= 0 && (a *= 256);) t < 0 && 0 === s && 0 !== this[e + o + 1] && (s = 1), this[e + o] = (t / a >> 0) - s & 255;
  6683. return e + i
  6684. }, l.prototype.writeInt8 = function(t, e, i) {
  6685. return t = +t, e |= 0, i || O(this, t, e, 1, 127, -128), l.TYPED_ARRAY_SUPPORT || (t = Math.floor(t)), t < 0 && (t = 255 + t + 1), this[e] = 255 & t, e + 1
  6686. }, l.prototype.writeInt16LE = function(t, e, i) {
  6687. return t = +t, e |= 0, i || O(this, t, e, 2, 32767, -32768), l.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t, this[e + 1] = t >>> 8) : I(this, t, e, !0), e + 2
  6688. }, l.prototype.writeInt16BE = function(t, e, i) {
  6689. return t = +t, e |= 0, i || O(this, t, e, 2, 32767, -32768), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 8, this[e + 1] = 255 & t) : I(this, t, e, !1), e + 2
  6690. }, l.prototype.writeInt32LE = function(t, e, i) {
  6691. return t = +t, e |= 0, i || O(this, t, e, 4, 2147483647, -2147483648), l.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24) : R(this, t, e, !0), e + 4
  6692. }, l.prototype.writeInt32BE = function(t, e, i) {
  6693. return t = +t, e |= 0, i || O(this, t, e, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t) : R(this, t, e, !1), e + 4
  6694. }, l.prototype.writeFloatLE = function(t, e, i) {
  6695. return k(this, t, e, !0, i)
  6696. }, l.prototype.writeFloatBE = function(t, e, i) {
  6697. return k(this, t, e, !1, i)
  6698. }, l.prototype.writeDoubleLE = function(t, e, i) {
  6699. return F(this, t, e, !0, i)
  6700. }, l.prototype.writeDoubleBE = function(t, e, i) {
  6701. return F(this, t, e, !1, i)
  6702. }, l.prototype.copy = function(t, e, i, n) {
  6703. if (i || (i = 0), n || 0 === n || (n = this.length), e >= t.length && (e = t.length), e || (e = 0), n > 0 && n < i && (n = i), n === i) return 0;
  6704. if (0 === t.length || 0 === this.length) return 0;
  6705. if (e < 0) throw new RangeError("targetStart out of bounds");
  6706. if (i < 0 || i >= this.length) throw new RangeError("sourceStart out of bounds");
  6707. if (n < 0) throw new RangeError("sourceEnd out of bounds");
  6708. n > this.length && (n = this.length), t.length - e < n - i && (n = t.length - e + i);
  6709. var r, o = n - i;
  6710. if (this === t && i < e && e < n)
  6711. for (r = o - 1; r >= 0; --r) t[r + e] = this[r + i];
  6712. else if (o < 1e3 || !l.TYPED_ARRAY_SUPPORT)
  6713. for (r = 0; r < o; ++r) t[r + e] = this[r + i];
  6714. else Uint8Array.prototype.set.call(t, this.subarray(i, i + o), e);
  6715. return o
  6716. }, l.prototype.fill = function(t, e, i, n) {
  6717. if ("string" == typeof t) {
  6718. if ("string" == typeof e ? (n = e, e = 0, i = this.length) : "string" == typeof i && (n = i, i = this.length), 1 === t.length) {
  6719. var r = t.charCodeAt(0);
  6720. r < 256 && (t = r)
  6721. }
  6722. if (void 0 !== n && "string" != typeof n) throw new TypeError("encoding must be a string");
  6723. if ("string" == typeof n && !l.isEncoding(n)) throw new TypeError("Unknown encoding: " + n)
  6724. } else "number" == typeof t && (t &= 255);
  6725. if (e < 0 || this.length < e || this.length < i) throw new RangeError("Out of range index");
  6726. if (i <= e) return this;
  6727. var o;
  6728. if (e >>>= 0, i = void 0 === i ? this.length : i >>> 0, t || (t = 0), "number" == typeof t)
  6729. for (o = e; o < i; ++o) this[o] = t;
  6730. else {
  6731. var a = l.isBuffer(t) ? t : U(new l(t, n)
  6732. .toString()),
  6733. s = a.length;
  6734. for (o = 0; o < i - e; ++o) this[o + e] = a[o % s]
  6735. }
  6736. return this
  6737. };
  6738. var B = /[^+\/0-9A-Za-z-_]/g;
  6739. function z(t) {
  6740. return t < 16 ? "0" + t.toString(16) : t.toString(16)
  6741. }
  6742. function U(t, e) {
  6743. var i;
  6744. e = e || 1 / 0;
  6745. for (var n = t.length, r = null, o = [], a = 0; a < n; ++a) {
  6746. if ((i = t.charCodeAt(a)) > 55295 && i < 57344) {
  6747. if (!r) {
  6748. if (i > 56319) {
  6749. (e -= 3) > -1 && o.push(239, 191, 189);
  6750. continue
  6751. }
  6752. if (a + 1 === n) {
  6753. (e -= 3) > -1 && o.push(239, 191, 189);
  6754. continue
  6755. }
  6756. r = i;
  6757. continue
  6758. }
  6759. if (i < 56320) {
  6760. (e -= 3) > -1 && o.push(239, 191, 189), r = i;
  6761. continue
  6762. }
  6763. i = 65536 + (r - 55296 << 10 | i - 56320)
  6764. } else r && (e -= 3) > -1 && o.push(239, 191, 189);
  6765. if (r = null, i < 128) {
  6766. if ((e -= 1) < 0) break;
  6767. o.push(i)
  6768. } else if (i < 2048) {
  6769. if ((e -= 2) < 0) break;
  6770. o.push(i >> 6 | 192, 63 & i | 128)
  6771. } else if (i < 65536) {
  6772. if ((e -= 3) < 0) break;
  6773. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  6774. } else {
  6775. if (!(i < 1114112)) throw new Error("Invalid code point");
  6776. if ((e -= 4) < 0) break;
  6777. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  6778. }
  6779. }
  6780. return o
  6781. }
  6782. function V(t) {
  6783. return n.toByteArray(function(t) {
  6784. if ((t = function(t) {
  6785. return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "")
  6786. }(t)
  6787. .replace(B, ""))
  6788. .length < 2) return "";
  6789. for (; t.length % 4 != 0;) t += "=";
  6790. return t
  6791. }(t))
  6792. }
  6793. function j(t, e, i, n) {
  6794. for (var r = 0; r < n && !(r + i >= e.length || r >= t.length); ++r) e[r + i] = t[r];
  6795. return r
  6796. }
  6797. })
  6798. .call(this, i(171))
  6799. }, function(t, e) {
  6800. t.exports = {
  6801. ContextCreated: "scene-renderer-context-created",
  6802. AfterRender: "after-render",
  6803. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  6804. }
  6805. }, function(t, e, i) {
  6806. "use strict";
  6807. i.r(e),
  6808. function(t) {
  6809. i.d(e, "Easing", (function() {
  6810. return r
  6811. })), i.d(e, "Group", (function() {
  6812. return a
  6813. })), i.d(e, "Interpolation", (function() {
  6814. return s
  6815. })), i.d(e, "Sequence", (function() {
  6816. return l
  6817. })), i.d(e, "Tween", (function() {
  6818. return h
  6819. })), i.d(e, "VERSION", (function() {
  6820. return c
  6821. })), i.d(e, "add", (function() {
  6822. return g
  6823. })), i.d(e, "getAll", (function() {
  6824. return f
  6825. })), i.d(e, "nextId", (function() {
  6826. return d
  6827. })), i.d(e, "now", (function() {
  6828. return o
  6829. })), i.d(e, "remove", (function() {
  6830. return v
  6831. })), i.d(e, "removeAll", (function() {
  6832. return m
  6833. })), i.d(e, "update", (function() {
  6834. return y
  6835. }));
  6836. var n, r = {
  6837. Linear: {
  6838. None: function(t) {
  6839. return t
  6840. }
  6841. },
  6842. Quadratic: {
  6843. In: function(t) {
  6844. return t * t
  6845. },
  6846. Out: function(t) {
  6847. return t * (2 - t)
  6848. },
  6849. InOut: function(t) {
  6850. return (t *= 2) < 1 ? .5 * t * t : -.5 * (--t * (t - 2) - 1)
  6851. }
  6852. },
  6853. Cubic: {
  6854. In: function(t) {
  6855. return t * t * t
  6856. },
  6857. Out: function(t) {
  6858. return --t * t * t + 1
  6859. },
  6860. InOut: function(t) {
  6861. return (t *= 2) < 1 ? .5 * t * t * t : .5 * ((t -= 2) * t * t + 2)
  6862. }
  6863. },
  6864. Quartic: {
  6865. In: function(t) {
  6866. return t * t * t * t
  6867. },
  6868. Out: function(t) {
  6869. return 1 - --t * t * t * t
  6870. },
  6871. InOut: function(t) {
  6872. return (t *= 2) < 1 ? .5 * t * t * t * t : -.5 * ((t -= 2) * t * t * t - 2)
  6873. }
  6874. },
  6875. Quintic: {
  6876. In: function(t) {
  6877. return t * t * t * t * t
  6878. },
  6879. Out: function(t) {
  6880. return --t * t * t * t * t + 1
  6881. },
  6882. InOut: function(t) {
  6883. return (t *= 2) < 1 ? .5 * t * t * t * t * t : .5 * ((t -= 2) * t * t * t * t + 2)
  6884. }
  6885. },
  6886. Sinusoidal: {
  6887. In: function(t) {
  6888. return 1 - Math.cos(t * Math.PI / 2)
  6889. },
  6890. Out: function(t) {
  6891. return Math.sin(t * Math.PI / 2)
  6892. },
  6893. InOut: function(t) {
  6894. return .5 * (1 - Math.cos(Math.PI * t))
  6895. }
  6896. },
  6897. Exponential: {
  6898. In: function(t) {
  6899. return 0 === t ? 0 : Math.pow(1024, t - 1)
  6900. },
  6901. Out: function(t) {
  6902. return 1 === t ? 1 : 1 - Math.pow(2, -10 * t)
  6903. },
  6904. InOut: function(t) {
  6905. return 0 === t ? 0 : 1 === t ? 1 : (t *= 2) < 1 ? .5 * Math.pow(1024, t - 1) : .5 * (2 - Math.pow(2, -10 * (t - 1)))
  6906. }
  6907. },
  6908. Circular: {
  6909. In: function(t) {
  6910. return 1 - Math.sqrt(1 - t * t)
  6911. },
  6912. Out: function(t) {
  6913. return Math.sqrt(1 - --t * t)
  6914. },
  6915. InOut: function(t) {
  6916. return (t *= 2) < 1 ? -.5 * (Math.sqrt(1 - t * t) - 1) : .5 * (Math.sqrt(1 - (t -= 2) * t) + 1)
  6917. }
  6918. },
  6919. Elastic: {
  6920. In: function(t) {
  6921. return 0 === t ? 0 : 1 === t ? 1 : -Math.pow(2, 10 * (t - 1)) * Math.sin(5 * (t - 1.1) * Math.PI)
  6922. },
  6923. Out: function(t) {
  6924. return 0 === t ? 0 : 1 === t ? 1 : Math.pow(2, -10 * t) * Math.sin(5 * (t - .1) * Math.PI) + 1
  6925. },
  6926. InOut: function(t) {
  6927. return 0 === t ? 0 : 1 === t ? 1 : (t *= 2) < 1 ? -.5 * Math.pow(2, 10 * (t - 1)) * Math.sin(5 * (t - 1.1) * Math.PI) : .5 * Math.pow(2, -10 * (t - 1)) * Math.sin(5 * (t - 1.1) * Math.PI) + 1
  6928. }
  6929. },
  6930. Back: {
  6931. In: function(t) {
  6932. var e = 1.70158;
  6933. return t * t * ((e + 1) * t - e)
  6934. },
  6935. Out: function(t) {
  6936. var e = 1.70158;
  6937. return --t * t * ((e + 1) * t + e) + 1
  6938. },
  6939. InOut: function(t) {
  6940. var e = 2.5949095;
  6941. return (t *= 2) < 1 ? t * t * ((e + 1) * t - e) * .5 : .5 * ((t -= 2) * t * ((e + 1) * t + e) + 2)
  6942. }
  6943. },
  6944. Bounce: {
  6945. In: function(t) {
  6946. return 1 - r.Bounce.Out(1 - t)
  6947. },
  6948. Out: function(t) {
  6949. return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375
  6950. },
  6951. InOut: function(t) {
  6952. return t < .5 ? .5 * r.Bounce.In(2 * t) : .5 * r.Bounce.Out(2 * t - 1) + .5
  6953. }
  6954. }
  6955. },
  6956. o = "undefined" == typeof self && void 0 !== t && t.hrtime ? function() {
  6957. var e = t.hrtime();
  6958. return 1e3 * e[0] + e[1] / 1e6
  6959. } : "undefined" != typeof self && void 0 !== self.performance && void 0 !== self.performance.now ? self.performance.now.bind(self.performance) : void 0 !== Date.now ? Date.now : function() {
  6960. return (new Date)
  6961. .getTime()
  6962. },
  6963. a = function() {
  6964. function t() {
  6965. this._tweens = {}, this._tweensAddedDuringUpdate = {}
  6966. }
  6967. return t.prototype.getAll = function() {
  6968. var t = this;
  6969. return Object.keys(this._tweens)
  6970. .map((function(e) {
  6971. return t._tweens[e]
  6972. }))
  6973. }, t.prototype.removeAll = function() {
  6974. this._tweens = {}
  6975. }, t.prototype.add = function(t) {
  6976. this._tweens[t.getId()] = t, this._tweensAddedDuringUpdate[t.getId()] = t
  6977. }, t.prototype.remove = function(t) {
  6978. delete this._tweens[t.getId()], delete this._tweensAddedDuringUpdate[t.getId()]
  6979. }, t.prototype.update = function(t, e) {
  6980. void 0 === t && (t = o()), void 0 === e && (e = !1);
  6981. var i = Object.keys(this._tweens);
  6982. if (0 === i.length) return !1;
  6983. for (; i.length > 0;) {
  6984. this._tweensAddedDuringUpdate = {};
  6985. for (var n = 0; n < i.length; n++) {
  6986. var r = this._tweens[i[n]],
  6987. a = !e;
  6988. r && !1 === r.update(t, a) && !e && delete this._tweens[i[n]]
  6989. }
  6990. i = Object.keys(this._tweensAddedDuringUpdate)
  6991. }
  6992. return !0
  6993. }, t
  6994. }(),
  6995. s = {
  6996. Linear: function(t, e) {
  6997. var i = t.length - 1,
  6998. n = i * e,
  6999. r = Math.floor(n),
  7000. o = s.Utils.Linear;
  7001. return e < 0 ? o(t[0], t[1], n) : e > 1 ? o(t[i], t[i - 1], i - n) : o(t[r], t[r + 1 > i ? i : r + 1], n - r)
  7002. },
  7003. Bezier: function(t, e) {
  7004. for (var i = 0, n = t.length - 1, r = Math.pow, o = s.Utils.Bernstein, a = 0; a <= n; a++) i += r(1 - e, n - a) * r(e, a) * t[a] * o(n, a);
  7005. return i
  7006. },
  7007. CatmullRom: function(t, e) {
  7008. var i = t.length - 1,
  7009. n = i * e,
  7010. r = Math.floor(n),
  7011. o = s.Utils.CatmullRom;
  7012. return t[0] === t[i] ? (e < 0 && (r = Math.floor(n = i * (1 + e))), o(t[(r - 1 + i) % i], t[r], t[(r + 1) % i], t[(r + 2) % i], n - r)) : e < 0 ? t[0] - (o(t[0], t[0], t[1], t[1], -n) - t[0]) : e > 1 ? t[i] - (o(t[i], t[i], t[i - 1], t[i - 1], n - i) - t[i]) : o(t[r ? r - 1 : 0], t[r], t[i < r + 1 ? i : r + 1], t[i < r + 2 ? i : r + 2], n - r)
  7013. },
  7014. Utils: {
  7015. Linear: function(t, e, i) {
  7016. return (e - t) * i + t
  7017. },
  7018. Bernstein: function(t, e) {
  7019. var i = s.Utils.Factorial;
  7020. return i(t) / i(e) / i(t - e)
  7021. },
  7022. Factorial: (n = [1], function(t) {
  7023. var e = 1;
  7024. if (n[t]) return n[t];
  7025. for (var i = t; i > 1; i--) e *= i;
  7026. return n[t] = e, e
  7027. }),
  7028. CatmullRom: function(t, e, i, n, r) {
  7029. var o = .5 * (i - t),
  7030. a = .5 * (n - e),
  7031. s = r * r;
  7032. return (2 * e - 2 * i + o + a) * (r * s) + (-3 * e + 3 * i - 2 * o - a) * s + o * r + e
  7033. }
  7034. }
  7035. },
  7036. l = function() {
  7037. function t() {}
  7038. return t.nextId = function() {
  7039. return t._nextId++
  7040. }, t._nextId = 0, t
  7041. }(),
  7042. u = new a,
  7043. h = function() {
  7044. function t(t, e) {
  7045. void 0 === e && (e = u), this._object = t, this._group = e, this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction = r.Linear.None, this._interpolationFunction = s.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._id = l.nextId(), this._isChainStopped = !1, this._goToEnd = !1
  7046. }
  7047. return t.prototype.getId = function() {
  7048. return this._id
  7049. }, t.prototype.isPlaying = function() {
  7050. return this._isPlaying
  7051. }, t.prototype.isPaused = function() {
  7052. return this._isPaused
  7053. }, t.prototype.to = function(t, e) {
  7054. return this._valuesEnd = Object.create(t), void 0 !== e && (this._duration = e), this
  7055. }, t.prototype.duration = function(t) {
  7056. return this._duration = t, this
  7057. }, t.prototype.start = function(t) {
  7058. if (this._isPlaying) return this;
  7059. if (this._group && this._group.add(this), this._repeat = this._initialRepeat, this._reversed)
  7060. for (var e in this._reversed = !1, this._valuesStartRepeat) this._swapEndStartRepeatValues(e), this._valuesStart[e] = this._valuesStartRepeat[e];
  7061. return this._isPlaying = !0, this._isPaused = !1, this._onStartCallbackFired = !1, this._isChainStopped = !1, this._startTime = void 0 !== t ? "string" == typeof t ? o() + parseFloat(t) : t : o(), this._startTime += this._delayTime, this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat), this
  7062. }, t.prototype._setupProperties = function(t, e, i, n) {
  7063. for (var r in i) {
  7064. var o = t[r],
  7065. a = Array.isArray(o),
  7066. s = a ? "array" : typeof o,
  7067. l = !a && Array.isArray(i[r]);
  7068. if ("undefined" !== s && "function" !== s) {
  7069. if (l) {
  7070. var u = i[r];
  7071. if (0 === u.length) continue;
  7072. u = u.map(this._handleRelativeValue.bind(this, o)), i[r] = [o].concat(u)
  7073. }
  7074. if ("object" !== s && !a || !o || l) void 0 === e[r] && (e[r] = o), a || (e[r] *= 1), n[r] = l ? i[r].slice()
  7075. .reverse() : e[r] || 0;
  7076. else {
  7077. for (var h in e[r] = a ? [] : {}, o) e[r][h] = o[h];
  7078. n[r] = a ? [] : {}, this._setupProperties(o, e[r], i[r], n[r])
  7079. }
  7080. }
  7081. }
  7082. }, t.prototype.stop = function() {
  7083. return this._isChainStopped || (this._isChainStopped = !0, this.stopChainedTweens()), this._isPlaying ? (this._group && this._group.remove(this), this._isPlaying = !1, this._isPaused = !1, this._onStopCallback && this._onStopCallback(this._object), this) : this
  7084. }, t.prototype.end = function() {
  7085. return this._goToEnd = !0, this.update(1 / 0), this
  7086. }, t.prototype.pause = function(t) {
  7087. return void 0 === t && (t = o()), this._isPaused || !this._isPlaying || (this._isPaused = !0, this._pauseStart = t, this._group && this._group.remove(this)), this
  7088. }, t.prototype.resume = function(t) {
  7089. return void 0 === t && (t = o()), this._isPaused && this._isPlaying ? (this._isPaused = !1, this._startTime += t - this._pauseStart, this._pauseStart = 0, this._group && this._group.add(this), this) : this
  7090. }, t.prototype.stopChainedTweens = function() {
  7091. for (var t = 0, e = this._chainedTweens.length; t < e; t++) this._chainedTweens[t].stop();
  7092. return this
  7093. }, t.prototype.group = function(t) {
  7094. return this._group = t, this
  7095. }, t.prototype.delay = function(t) {
  7096. return this._delayTime = t, this
  7097. }, t.prototype.repeat = function(t) {
  7098. return this._initialRepeat = t, this._repeat = t, this
  7099. }, t.prototype.repeatDelay = function(t) {
  7100. return this._repeatDelayTime = t, this
  7101. }, t.prototype.yoyo = function(t) {
  7102. return this._yoyo = t, this
  7103. }, t.prototype.easing = function(t) {
  7104. return this._easingFunction = t, this
  7105. }, t.prototype.interpolation = function(t) {
  7106. return this._interpolationFunction = t, this
  7107. }, t.prototype.chain = function() {
  7108. for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
  7109. return this._chainedTweens = t, this
  7110. }, t.prototype.onStart = function(t) {
  7111. return this._onStartCallback = t, this
  7112. }, t.prototype.onUpdate = function(t) {
  7113. return this._onUpdateCallback = t, this
  7114. }, t.prototype.onRepeat = function(t) {
  7115. return this._onRepeatCallback = t, this
  7116. }, t.prototype.onComplete = function(t) {
  7117. return this._onCompleteCallback = t, this
  7118. }, t.prototype.onStop = function(t) {
  7119. return this._onStopCallback = t, this
  7120. }, t.prototype.update = function(t, e) {
  7121. if (void 0 === t && (t = o()), void 0 === e && (e = !0), this._isPaused) return !0;
  7122. var i, n, r = this._startTime + this._duration;
  7123. if (!this._goToEnd && !this._isPlaying) {
  7124. if (t > r) return !1;
  7125. e && this.start(t)
  7126. }
  7127. if (this._goToEnd = !1, t < this._startTime) return !0;
  7128. !1 === this._onStartCallbackFired && (this._onStartCallback && this._onStartCallback(this._object), this._onStartCallbackFired = !0), n = (t - this._startTime) / this._duration, n = 0 === this._duration || n > 1 ? 1 : n;
  7129. var a = this._easingFunction(n);
  7130. if (this._updateProperties(this._object, this._valuesStart, this._valuesEnd, a), this._onUpdateCallback && this._onUpdateCallback(this._object, n), 1 === n) {
  7131. if (this._repeat > 0) {
  7132. for (i in isFinite(this._repeat) && this._repeat--, this._valuesStartRepeat) this._yoyo || "string" != typeof this._valuesEnd[i] || (this._valuesStartRepeat[i] = this._valuesStartRepeat[i] + parseFloat(this._valuesEnd[i])), this._yoyo && this._swapEndStartRepeatValues(i), this._valuesStart[i] = this._valuesStartRepeat[i];
  7133. return this._yoyo && (this._reversed = !this._reversed), void 0 !== this._repeatDelayTime ? this._startTime = t + this._repeatDelayTime : this._startTime = t + this._delayTime, this._onRepeatCallback && this._onRepeatCallback(this._object), !0
  7134. }
  7135. this._onCompleteCallback && this._onCompleteCallback(this._object);
  7136. for (var s = 0, l = this._chainedTweens.length; s < l; s++) this._chainedTweens[s].start(this._startTime + this._duration);
  7137. return this._isPlaying = !1, !1
  7138. }
  7139. return !0
  7140. }, t.prototype._updateProperties = function(t, e, i, n) {
  7141. for (var r in i)
  7142. if (void 0 !== e[r]) {
  7143. var o = e[r] || 0,
  7144. a = i[r],
  7145. s = Array.isArray(t[r]),
  7146. l = Array.isArray(a);
  7147. !s && l ? t[r] = this._interpolationFunction(a, n) : "object" == typeof a && a ? this._updateProperties(t[r], o, a, n) : "number" == typeof(a = this._handleRelativeValue(o, a)) && (t[r] = o + (a - o) * n)
  7148. }
  7149. }, t.prototype._handleRelativeValue = function(t, e) {
  7150. return "string" != typeof e ? e : "+" === e.charAt(0) || "-" === e.charAt(0) ? t + parseFloat(e) : parseFloat(e)
  7151. }, t.prototype._swapEndStartRepeatValues = function(t) {
  7152. var e = this._valuesStartRepeat[t],
  7153. i = this._valuesEnd[t];
  7154. this._valuesStartRepeat[t] = "string" == typeof i ? this._valuesStartRepeat[t] + parseFloat(i) : this._valuesEnd[t], this._valuesEnd[t] = e
  7155. }, t
  7156. }(),
  7157. c = "18.6.4",
  7158. d = l.nextId,
  7159. p = u,
  7160. f = p.getAll.bind(p),
  7161. m = p.removeAll.bind(p),
  7162. g = p.add.bind(p),
  7163. v = p.remove.bind(p),
  7164. y = p.update.bind(p),
  7165. b = {
  7166. Easing: r,
  7167. Group: a,
  7168. Interpolation: s,
  7169. now: o,
  7170. Sequence: l,
  7171. nextId: d,
  7172. Tween: h,
  7173. VERSION: c,
  7174. getAll: f,
  7175. removeAll: m,
  7176. add: g,
  7177. remove: v,
  7178. update: y
  7179. };
  7180. e.default = b
  7181. }.call(this, i(50))
  7182. }, function(t, e) {
  7183. var i, n, r = t.exports = {};
  7184. function o() {
  7185. throw new Error("setTimeout has not been defined")
  7186. }
  7187. function a() {
  7188. throw new Error("clearTimeout has not been defined")
  7189. }
  7190. function s(t) {
  7191. if (i === setTimeout) return setTimeout(t, 0);
  7192. if ((i === o || !i) && setTimeout) return i = setTimeout, setTimeout(t, 0);
  7193. try {
  7194. return i(t, 0)
  7195. } catch (e) {
  7196. try {
  7197. return i.call(null, t, 0)
  7198. } catch (e) {
  7199. return i.call(this, t, 0)
  7200. }
  7201. }
  7202. }! function() {
  7203. try {
  7204. i = "function" == typeof setTimeout ? setTimeout : o
  7205. } catch (t) {
  7206. i = o
  7207. }
  7208. try {
  7209. n = "function" == typeof clearTimeout ? clearTimeout : a
  7210. } catch (t) {
  7211. n = a
  7212. }
  7213. }();
  7214. var l, u = [],
  7215. h = !1,
  7216. c = -1;
  7217. function d() {
  7218. h && l && (h = !1, l.length ? u = l.concat(u) : c = -1, u.length && p())
  7219. }
  7220. function p() {
  7221. if (!h) {
  7222. var t = s(d);
  7223. h = !0;
  7224. for (var e = u.length; e;) {
  7225. for (l = u, u = []; ++c < e;) l && l[c].run();
  7226. c = -1, e = u.length
  7227. }
  7228. l = null, h = !1,
  7229. function(t) {
  7230. if (n === clearTimeout) return clearTimeout(t);
  7231. if ((n === a || !n) && clearTimeout) return n = clearTimeout, clearTimeout(t);
  7232. try {
  7233. n(t)
  7234. } catch (e) {
  7235. try {
  7236. return n.call(null, t)
  7237. } catch (e) {
  7238. return n.call(this, t)
  7239. }
  7240. }
  7241. }(t)
  7242. }
  7243. }
  7244. function f(t, e) {
  7245. this.fun = t, this.array = e
  7246. }
  7247. function m() {}
  7248. r.nextTick = function(t) {
  7249. var e = new Array(arguments.length - 1);
  7250. if (arguments.length > 1)
  7251. for (var i = 1; i < arguments.length; i++) e[i - 1] = arguments[i];
  7252. u.push(new f(t, e)), 1 !== u.length || h || s(p)
  7253. }, f.prototype.run = function() {
  7254. this.fun.apply(null, this.array)
  7255. }, r.title = "browser", r.browser = !0, r.env = {}, r.argv = [], r.version = "", r.versions = {}, r.on = m, r.addListener = m, r.once = m, r.off = m, r.removeListener = m, r.removeAllListeners = m, r.emit = m, r.prependListener = m, r.prependOnceListener = m, r.listeners = function(t) {
  7256. return []
  7257. }, r.binding = function(t) {
  7258. throw new Error("process.binding is not supported")
  7259. }, r.cwd = function() {
  7260. return "/"
  7261. }, r.chdir = function(t) {
  7262. throw new Error("process.chdir is not supported")
  7263. }, r.umask = function() {
  7264. return 0
  7265. }
  7266. }, function(t, e, i) {
  7267. var n, r = i(0),
  7268. o = i(1),
  7269. a = i(8),
  7270. s = i(16),
  7271. l = i(10),
  7272. u = i(12),
  7273. h = i(17),
  7274. c = i(22);
  7275. i(3);
  7276. function d(t) {
  7277. var e = r.UniformsUtils.clone(u.waypoint.uniforms);
  7278. e.map.value = n, e.opacity.value = 0, e.color.value.set(o.reticuleColor);
  7279. var i = new r.PlaneBufferGeometry(.2, .2, 1, 1),
  7280. a = new r.RawShaderMaterial({
  7281. side: r.DoubleSide,
  7282. depthWrite: !1,
  7283. depthTest: !1,
  7284. transparent: !0,
  7285. vertexShader: u.waypoint.vertexShader,
  7286. fragmentShader: u.waypoint.fragmentShader,
  7287. uniforms: e,
  7288. name: "waypoint",
  7289. opacity: 0
  7290. });
  7291. r.Mesh.call(this, i, a), this.renderOrder = h.reticule, this.player = t, this.direction = new r.Vector3, this.hidden = !0, this.mouseLastMoveTime = Date.now(), this.editHidden = !1
  7292. }
  7293. n = G.conf.isCleanUI ? s.loadurl(c.splitUrl("./images/nonepointer.png")) : s.loadurl(c.splitUrl("./images/pointermain_512x512.png")), d.prototype = Object.create(r.Mesh.prototype), d.prototype.move = function(t, e, i) {
  7294. this.editHidden ? this.hidden = !0 : (this.hidden = i, this.mouseLastMoveTime = Date.now())
  7295. }, d.prototype.hide = function() {
  7296. this.hidden || (this.hidden = !0, a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  7297. }, d.prototype.show = function() {
  7298. this.hidden = !1, this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  7299. }, d.prototype.changeNormalMaterial = function() {}, d.prototype.changeCrossMaterial = function() {}, d.prototype.update = function() {
  7300. this.editHidden
  7301. }, d.prototype.updatePosition = function(t, e) {
  7302. if (!this.hidden) {
  7303. if (!e) return this.hide();
  7304. var i = e.point,
  7305. n = t.distanceTo(i),
  7306. r = 1 + .01 * n;
  7307. n < 1 && (r -= 1 - n), this.show(), this.scale.set(r, r, r), this.direction = this.direction.multiplyScalar(.8), this.direction.add(e.face.normal.clone()
  7308. .multiplyScalar(.2)), this.position.copy(i)
  7309. .add(e.face.normal.clone()
  7310. .multiplyScalar(.01)), this.lookAt(this.position.clone()
  7311. .add(this.direction))
  7312. }
  7313. }, d.prototype.writeAsMattertag = function() {
  7314. var t = Math.floor(4294967296 * (1 + Math.random()))
  7315. .toString(16) + Math.floor(16 * (1 + Math.random()))
  7316. .toString(16),
  7317. e = new Date;
  7318. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  7319. var i = {
  7320. enabled: !0,
  7321. version: "0",
  7322. created: e.toISOString(),
  7323. created_by: "APITest",
  7324. position: this.position.clone(),
  7325. stem: {
  7326. enabled: o.mattertags.pole.enabled,
  7327. direction: this.direction.multiplyScalar(o.mattertags.pole.height)
  7328. },
  7329. label: "Mattertag " + this.tagCount,
  7330. description: "Description " + t,
  7331. floor: function(t) {
  7332. if (t.currentFloor) {
  7333. var e = t.floors.indexOf(t.currentFloor);
  7334. return e > -1 ? e : void 0
  7335. }
  7336. }(this.player.model),
  7337. type: "info",
  7338. metadata: {
  7339. preferred_camera: {
  7340. mode: this.player.mode
  7341. }
  7342. }
  7343. },
  7344. n = this.player.model.addMattertag(t, i)
  7345. .build();
  7346. n && (n.disc && this.player.mattertagDiscs.push(n.disc), n.visible || n.show(o.mattertags.startup.fadeInDuration))
  7347. }, t.exports = d
  7348. }, function(t, e, i) {
  7349. "use strict";
  7350. var n = i(0),
  7351. r = i(1),
  7352. o = i(53);
  7353. function a(t) {
  7354. o.call(this, t), this.minPolarAngle = r.dollhouseDefault.minPolarAngle, this.maxPolarAngle = r.dollhouseDefault.maxPolarAngle, this.minDistance = r.dollhouseDefault.minDistance, this.maxDistance = r.dollhouseDefault.maxDistance, this.adjustedMinDistance = this.minDistance, this.adjustedMaxDistance = this.maxDistance
  7355. }
  7356. a.prototype = Object.create(o.prototype), a.prototype.pan = function(t, e) {
  7357. this.camera.updateMatrix();
  7358. var i = this.camera.position.clone()
  7359. .sub(this.target)
  7360. .length();
  7361. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180), this.panLeft(2 * t * i / (window.renderHeight || window.innerHeight)), this.panUp(-2 * e * i / (window.renderHeight || window.innerHeight))
  7362. }, a.prototype.updateZoom = function() {
  7363. return this.cameraLength *= this.scale, this.cameraLength
  7364. }, a.prototype.setZoomBounds = function(t) {
  7365. var e = t.min.distanceTo(t.max);
  7366. this.adjustedMinDistance = Math.max(Math.min(e / 2, r.dollhouseDefault.minDistance), 0), this.adjustedMaxDistance = Math.min(Math.max(e, r.dollhouseDefault.maxDistance), r.skyboxRadius), this.minDistance = this.adjustedMinDistance, this.maxDistance = this.adjustedMaxDistance
  7367. }, a.prototype.resetRanges = function(t, e) {
  7368. t ? (this.minDistance = Math.min(t, this.minDistance), this.maxDistance = Math.max(t, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance, this.maxDistance = this.adjustedMaxDistance), e ? (this.minPolarAngle = n.Math.degToRad(10), this.maxPolarAngle = n.Math.degToRad(65)) : (this.minPolarAngle = r.dollhouseDefault.minPolarAngle, this.maxPolarAngle = r.dollhouseDefault.maxPolarAngle)
  7369. }, a.prototype.toJSON = function() {
  7370. return o.prototype.toJSON.call(this)
  7371. }, t.exports = a
  7372. }, function(t, e, i) {
  7373. "use strict";
  7374. var n = i(0),
  7375. r = i(1),
  7376. o = i(7),
  7377. a = i(9),
  7378. s = i(32),
  7379. l = i(27),
  7380. u = i(4)
  7381. .EventEmitter,
  7382. h = i(28),
  7383. c = 1e-6,
  7384. d = -1,
  7385. p = 0,
  7386. f = 1,
  7387. m = 2,
  7388. g = 3,
  7389. v = 4;
  7390. function y(t) {
  7391. this.camera = t, this.camera.controls = this, this.enabled = !1, this.target = new n.Vector3, this.targetBounds = new n.Box3, this.noZoom = !1, this.zoomSpeed = 1, this.minDistance = 0, this.maxDistance = 1 / 0, this.noRotate = !1, this.noRotateUpDown = !1, this.rotateSpeed = 1, this.keyboardZoomSpeed = 0, this.noPan = !0, this.keyPanSpeed = 7, this.autoRotate = !1, this.autoRotateSpeed = 2, this.minPolarAngle = n.Math.degToRad(25), this.maxPolarAngle = n.Math.degToRad(65), this.noKeys = !1, this.rotationAcceleration = new n.Vector2, this.rotationSpeed = new n.Vector2, this.panAcceleration = new n.Vector2, this.panSpeed = new n.Vector2, this.rotateStart = new n.Vector2, this.rotateEnd = new n.Vector2, this.rotateDelta = new n.Vector2, this.panStart = new n.Vector2, this.panEnd = new n.Vector2, this.panDelta = new n.Vector2, this.panOffset = new n.Vector3, this.offset = new n.Vector3, this.dollyStart = new n.Vector2, this.dollyEnd = new n.Vector2, this.dollyDelta = new n.Vector2, this.phiDelta = 0, this.thetaDelta = 0, this.scale = 1, this.panVector = new n.Vector3, this.lastPosition = new n.Vector3, this.state = d, this.lastMoveTime = 0, this.pointersLimit = 2, this.pointers = [], this.lon = 0, this.lat = 0, this.on("touch-one-finger-start", y.touch.rotate.start), this.on("touch-one-finger-move", y.touch.rotate.move), this.on("touch-two-finger-start", y.touch.pan.start), this.on("touch-two-finger-start", y.touch.zoom.start), this.on("touch-two-finger-move", y.touch.zoom.move), this.sendData = !1, this.responseMessage = this.responseMessage.bind(this), this.connect = h(), this.connect.on("operation", this.responseMessage), this._lockedMouseWheel = !1, this.defineProperty()
  7392. }
  7393. y.prototype = Object.create(u.prototype), y.prototype.defineProperty = function() {
  7394. var t = !0,
  7395. e = this;
  7396. Object.defineProperty(this, "touchup", {
  7397. get: function() {
  7398. return t
  7399. },
  7400. set: function(i) {
  7401. t = i, e.connect.busy = !i
  7402. }
  7403. }), Object.defineProperty(this, "lockedMouseWheel", {
  7404. get: function() {
  7405. return this._lockedMouseWheel
  7406. },
  7407. set: function(t) {
  7408. this._lockedMouseWheel = t
  7409. }
  7410. })
  7411. }, y.prototype.setBounds = function(t) {
  7412. this.targetBounds = t
  7413. }, y.prototype.bindEvents = function(t) {
  7414. (t = t || document)
  7415. .addEventListener("contextmenu", (function(t) {
  7416. t.preventDefault()
  7417. })), t.addEventListener("mousedown", this.onMouseDown.bind(this)), t.addEventListener("mousemove", this.onMouseMove.bind(this)), t.addEventListener("mouseup", this.onMouseUp.bind(this)), t.addEventListener("mouseover", function(t) {
  7418. 0 !== t.which && 0 !== t.buttons || this.onMouseUp(t)
  7419. }.bind(this)), r.useWheel && (t.addEventListener("mousewheel", this.onMouseWheel.bind(this)), t.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))), t.addEventListener("touchstart", this.onTouchStart.bind(this)), t.addEventListener("touchend", this.onTouchEnd.bind(this)), t.addEventListener("touchmove", this.onTouchMove.bind(this)), t.addEventListener("pointerdown", this.onPointerDown.bind(this)), t.addEventListener("pointerup", this.onPointerUp.bind(this)), t.addEventListener("pointerout", this.onPointerUp.bind(this)), t.addEventListener("pointercancel", this.onPointerUp.bind(this)), t.addEventListener("pointermove", this.onPointerMove.bind(this)), t.addEventListener("keydown", this.onKeyDown.bind(this)), t.addEventListener("keyup", this.onKeyUp.bind(this))
  7420. }, y.prototype.isEngaged = function() {
  7421. return this.state !== d
  7422. };
  7423. var b, w, x, M, T, S, _ = null,
  7424. A = null,
  7425. P = null;
  7426. y.prototype.rotateLeft = function(t) {
  7427. void 0 === t && (t = this.getAutoRotationAngle()), this.thetaDelta -= t, 0 === this.thetaDelta && 0 === t && null === _ && this.touchup ? (_ = !0, this.emit("dollhouse-move-stop")) : 0 < this.thetaDelta ? (_ = null, .001 < this.thetaDelta ? (A = !1, this.emit("dollhouse-move")) : !1 === A && (A = !0, this.emit("dollhouse-move-stop"))) : 0 > this.thetaDelta && (_ = null, -.001 > this.thetaDelta ? (P = !1, this.emit("dollhouse-move")) : !1 === P && (P = !0, this.emit("dollhouse-move-stop")))
  7428. }, y.prototype.rotateUp = function(t) {
  7429. this.noRotateUpDown || (void 0 === t && (t = this.getAutoRotationAngle()), this.phiDelta -= t)
  7430. }, y.prototype.panLeft = function(t) {
  7431. var e = this.camera.matrix.elements;
  7432. 0 == e[0] && 0 == e[2] ? this.panOffset.set(e[0], 0, e[2]) : this.panOffset.set(e[0], 0, e[2])
  7433. .normalize(), this.panOffset.multiplyScalar(-t), this.panVector.add(this.panOffset)
  7434. }, y.prototype.panUp = function(t) {
  7435. var e = this.camera.matrix.elements;
  7436. 0 == e[4] && 0 == e[6] ? this.panOffset.set(e[4], 0, e[6]) : this.panOffset.set(e[4], 0, e[6])
  7437. .normalize(), this.panOffset.multiplyScalar(-t), this.panVector.add(this.panOffset)
  7438. }, y.prototype.dollyIn = function(t) {
  7439. void 0 === t && (t = this.getZoomScale()), G.R.recording && G.R.save({
  7440. tap: "zoom",
  7441. type: "dollhouse",
  7442. level: 1 / t
  7443. }), this.scale /= t, this.emit("dollhouse-move-stop")
  7444. }, y.prototype.dollyOut = function(t) {
  7445. void 0 === t && (t = this.getZoomScale()), G.R.recording && G.R.save({
  7446. tap: "zoom",
  7447. type: "dollhouse",
  7448. level: t
  7449. }), this.scale *= t, this.emit("dollhouse-move-stop")
  7450. }, y.prototype.lookAt = function(t, e, i) {
  7451. this.camera.position.copy(t), this.camera.quaternion.copy(i), this.target.copy(e), this.offset.copy(t)
  7452. .sub(e), this.lon = Math.atan2(this.offset.x, this.offset.z), this.lat = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y), this.cameraLength = this.offset.length()
  7453. }, y.prototype.update = function(t) {
  7454. var e, i, n, o;
  7455. if (!G.measurestarted) {
  7456. if (e = this.camera.position, this.updateFromRecord) return this.updateFromRecord = !1, void this.updateCamera(this.lon, this.lat);
  7457. this.updateFromRecord = !1, t || (t = 1 / 60), this.rotationSpeed.multiplyScalar(1 - r.rotationFriction)
  7458. .addScaledVector(this.rotationAcceleration, r.rotationAccelerationOutside * t), this.rotateLeft(-this.rotationSpeed.x), this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y), this.panSpeed.multiplyScalar(1 - r.panFriction)
  7459. .addScaledVector(this.panAcceleration, r.panAccelerationOutside * t), this.pan(-this.panSpeed.x, this.panSpeed.y), this.offset.copy(e)
  7460. .sub(this.target), i = Math.atan2(this.offset.x, this.offset.z), n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y), this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()), o = this.offset.length(), i += this.thetaDelta, n += this.phiDelta, i < 0 && (i += 2 * Math.PI), (this.connect.remoteControl || this.connect.sync) && "floorplan" !== this.type || (this.lon = i, this.lat = n, this.cameraLength = o), G.R.recording && this.record(i), this.updateCamera(this.lon, this.lat), this.connect.remoteControl || this.connect.sync || this.sendFrameData(t), this.thetaDelta = 0, this.phiDelta = 0, this.scale = 1, this.panVector.set(0, 0, 0), this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  7461. }
  7462. }, y.prototype.updateCamera = (w = new n.Vector3, function(t, e) {
  7463. "floorplan" === this.type && (t = 0, e = 0), b = this.updateZoom(), b = Math.max(this.minDistance, Math.min(this.maxDistance, b)), isNaN(t) || isNaN(e) || (e = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, e)), e = Math.max(c, Math.min(Math.PI - c, e)), w.x = b * Math.sin(e) * Math.sin(t), w.y = b * Math.cos(e), w.z = b * Math.sin(e) * Math.cos(t)), this.camera.position.copy(this.target)
  7464. .add(w), this.camera.lookAt(this.target)
  7465. }), y.prototype.sendFrameData = (S = 0, function(t) {
  7466. "dollhouse" === G.player.mode && ((S += t) < r.connectDelay || Math.abs(x - this.lon) < .001 && Math.abs(M - this.lat) < .001 && Math.abs(T - this.cameraLength) < .001 || (S = 0, this.connect.sendOperation({
  7467. type: "outside",
  7468. lon: this.lon,
  7469. lat: this.lat,
  7470. cameraLength: this.cameraLength
  7471. }), x = this.lon, M = this.lat, T = this.cameraLength))
  7472. }), y.prototype._progressNumber = function(t, e, i) {
  7473. return t + (e - t) * i
  7474. }, y.prototype._progressRad = function(t, e, i) {
  7475. var n = 2 * Math.PI,
  7476. r = Math.PI,
  7477. o = function(t) {
  7478. return (t % n + n) % n
  7479. };
  7480. return t = o(t), (e = o(e)) - t > r ? this._progressNumber(t + n, e, i) : t - e > r ? this._progressNumber(t - n, e, i) : this._progressNumber(t, e, i)
  7481. }, y.prototype.responseMessage = function(t) {
  7482. var e = this;
  7483. if ("outside" === t.type) {
  7484. var i = t.lon,
  7485. n = t.lat,
  7486. o = t.cameraLength;
  7487. this.tweenProgress && (this.tweenProgress.stop(), this.tweenProgress = null);
  7488. var a = this.lon,
  7489. s = this.lat,
  7490. l = this.cameraLength;
  7491. this.tweenProgress = new TWEEN.Tween({
  7492. progress: 0
  7493. })
  7494. .to({
  7495. progress: 1
  7496. }, r.animationDelay)
  7497. .easing(TWEEN.Easing.Linear.None)
  7498. .start(), this.tweenProgress.onUpdate((function(t) {
  7499. null === i && 0 === i || (e.lon = e._progressRad(a, i, this.progress)), null === n && 0 === i || (e.lat = e._progressNumber(s, n, this.progress)), e.cameraLength = e._progressNumber(l, o, this.progress)
  7500. })), this.tweenProgress.onComplete((function() {
  7501. this.tweenProgress = null
  7502. }))
  7503. }
  7504. }, y.prototype.getAutoRotationAngle = function(t, e) {
  7505. return {
  7506. lon: t,
  7507. lat: e
  7508. }
  7509. }, y.prototype.getAutoRotationAngle = function() {
  7510. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  7511. }, y.prototype.getZoomScale = function() {
  7512. return Math.pow(.95, this.zoomSpeed)
  7513. }, y.prototype.onMouseDown = function(t) {
  7514. if (this.enabled) {
  7515. switch (this.touchup = !1, t.preventDefault(), this.mouseDown = !0, t.button) {
  7516. case 0:
  7517. if (this.noRotate) return;
  7518. this.state = p, this.rotateStart.set(t.clientX, this.noRotateUpDown ? 0 : t.clientY), this.rotationSpeed.set(0, 0);
  7519. break;
  7520. case 1:
  7521. if (this.noZoom) return;
  7522. this.state = f, this.dollyStart.set(t.clientX, t.clientY);
  7523. break;
  7524. case 2:
  7525. if (this.noPan) return;
  7526. this.state = m, this.panStart.set(t.clientX, t.clientY)
  7527. }
  7528. this.emit(l.InputStart, "mouse")
  7529. }
  7530. }, y.prototype.play = function(t) {
  7531. this.touchup && (this.lon = t.lon, this.lat = t.lat, this.updateFromRecord = !0)
  7532. }, y.prototype.record = function(t) {
  7533. G.player.flying || G.R.rtime && !(G.R.time.getElapsedTime() - G.R.rtime > .15) || ("dollhouse" === G.player.mode ? (void 0 !== G.R.lastlon && Math.abs(this.lon - G.R.lastlon) > 3 && (this.lon < G.R.lastlon ? G.R.lon += 2 * Math.PI : G.R.lon -= 2 * Math.PI), G.R.rtime = G.R.save({
  7534. tap: "dollhouse",
  7535. lon: parseFloat((this.lon + G.R.lon)
  7536. .toFixed(5)),
  7537. lat: parseFloat(this.lat.toFixed(5)),
  7538. action: "rotate"
  7539. }), G.R.lastlon = this.lon) : "floorplan" === G.player.mode && (G.R.rtime = G.R.save({
  7540. tap: "floorplan",
  7541. lon: parseFloat(this.lon.toFixed(5)),
  7542. lat: parseFloat(this.lat.toFixed(5)),
  7543. action: "rotate"
  7544. })))
  7545. }, y.prototype.onMouseMove = function(t) {
  7546. if (this.enabled && this.mouseDown && 0 !== t.buttons) {
  7547. if (t.preventDefault(), r.delBK && "floorplan" === G.player.mode) return !1;
  7548. var e = t.currentTarget;
  7549. switch (this.state) {
  7550. case p:
  7551. if (this.noRotate) return;
  7552. this.rotateEnd.set(t.clientX, this.noRotateUpDown ? 0 : t.clientY), this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart), this.rotateLeft(2 * Math.PI * this.rotateDelta.x / e.clientWidth * this.rotateSpeed), this.rotateUp(2 * Math.PI * this.rotateDelta.y / e.clientHeight * this.rotateSpeed), this.rotateStart.copy(this.rotateEnd);
  7553. break;
  7554. case f:
  7555. if (this.noZoom) return;
  7556. this.dollyEnd.set(t.clientX, t.clientY), this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart), (this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut)
  7557. .call(this), this.dollyStart.copy(this.dollyEnd);
  7558. break;
  7559. case m:
  7560. if (this.noPan) return;
  7561. this.panEnd.set(t.clientX, t.clientY), this.panDelta.subVectors(this.panEnd, this.panStart), this.pan(this.panDelta.x, this.panDelta.y), this.panStart.copy(this.panEnd)
  7562. }
  7563. this.emit(l.Move, "mouse"), this.lastMoveTime = t.timeStamp, this.update()
  7564. }
  7565. }, y.prototype.onMouseUp = function(t) {
  7566. if (!this.enabled) return !1;
  7567. this.mouseDown = !1, this.touchup = !0, this.state = d, "mouseover" !== t.type && (t.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y), this.update(), this.rotationAcceleration.set(0, 0), this.rotateDelta.set(0, 0))
  7568. }, y.prototype.onMouseWheel = function(t) {
  7569. this._lockedMouseWheel || this.enabled && !this.noZoom && r.useWheel && !G.R.playing && (r.delBK && "floorplan" === G.player.mode || (this.emit(l.Move, "wheel"), ((t.wheelDelta || -t.detail) > 0 ? this.dollyOut : this.dollyIn)
  7570. .call(this), this.update()))
  7571. }, y.prototype.onKeyDown = function(t) {
  7572. "floorplan" !== G.player.mode && (!this.enabled || this.noKeys || t.metaKey || t.ctrlKey || (t.preventDefault(), this.handleKeyDown(t.which)))
  7573. }, y.prototype.handleKeyDown = function(t) {
  7574. var e = function(t, e) {
  7575. "y" === t ? this.noRotateUpDown ? this.keyboardZoomSpeed = e : this.rotationAcceleration.y = e : this.rotationAcceleration.x = e
  7576. }.bind(this),
  7577. i = function(t, e) {
  7578. this.panAcceleration[t] = e
  7579. }.bind(this),
  7580. n = !0;
  7581. switch (t) {
  7582. case s.UPARROW:
  7583. case s.I:
  7584. e("y", 1);
  7585. break;
  7586. case s.DOWNARROW:
  7587. case s.K:
  7588. e("y", -1);
  7589. break;
  7590. case s.LEFTARROW:
  7591. case s.J:
  7592. e("x", -1);
  7593. break;
  7594. case s.RIGHTARROW:
  7595. case s.L:
  7596. e("x", 1);
  7597. break;
  7598. case s.W:
  7599. i("y", 1);
  7600. break;
  7601. case s.S:
  7602. i("y", -1);
  7603. break;
  7604. case s.A:
  7605. i("x", -1);
  7606. break;
  7607. case s.D:
  7608. i("x", 1);
  7609. break;
  7610. default:
  7611. n = !1
  7612. }
  7613. n && this.emit(l.Move, "key")
  7614. }, y.prototype.onKeyUp = function(t) {
  7615. !this.enabled || this.noKeys || (t.preventDefault(), t.stopPropagation(), this.handleKeyUp(t.which))
  7616. }, y.prototype.handleKeyUp = function(t) {
  7617. switch (t) {
  7618. case s.I:
  7619. case s.K:
  7620. case s.UPARROW:
  7621. case s.DOWNARROW:
  7622. this.keyboardZoomSpeed = 0, this.rotationAcceleration.y = 0;
  7623. break;
  7624. case s.J:
  7625. case s.L:
  7626. case s.LEFTARROW:
  7627. case s.RIGHTARROW:
  7628. this.rotationAcceleration.x = 0;
  7629. break;
  7630. case s.S:
  7631. case s.W:
  7632. this.panAcceleration.y = 0;
  7633. break;
  7634. case s.A:
  7635. case s.D:
  7636. this.panAcceleration.x = 0
  7637. }
  7638. }, y.prototype.onTouchStart = function(t) {
  7639. if (this.enabled) {
  7640. switch (this.touchup = !1, t.preventDefault(), t.stopPropagation(), t.touches.length) {
  7641. case 1:
  7642. this.emit("touch-one-finger-start", t);
  7643. break;
  7644. case 2:
  7645. this.emit("touch-two-finger-start", t);
  7646. break;
  7647. default:
  7648. this.state = d
  7649. }
  7650. this.rotationSpeed.set(0, 0), this.emit(l.InputStart, "touch")
  7651. }
  7652. }, y.prototype.onTouchMove = function(t) {
  7653. if (this.enabled) {
  7654. if (r.delBK && "floorplan" === G.player.mode) return !1;
  7655. switch (t.preventDefault(), t.stopPropagation(), t.touches.length) {
  7656. case 1:
  7657. this.emit("touch-one-finger-move", t), this.update();
  7658. break;
  7659. case 2:
  7660. this.emit("touch-two-finger-move", t), this.update();
  7661. break;
  7662. default:
  7663. this.state = d
  7664. }
  7665. this.lastMoveTime = t.timeStamp
  7666. }
  7667. }, y.prototype.onTouchEnd = function(t) {
  7668. this.enabled && (this.emit("touch-one-finger-end", t), this.touchup = !0, this.emit("touch-two-finger-end", t), this.state = d, t.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y), this.update(), this.rotationAcceleration.set(0, 0), this.rotateDelta.set(0, 0))
  7669. }, y.prototype._progressNumber = function(t, e, i) {
  7670. return t + (e - t) * i
  7671. }, y.prototype._progressRad = function(t, e, i) {
  7672. var n = 2 * Math.PI,
  7673. r = Math.PI,
  7674. o = function(t) {
  7675. return (t % n + n) % n
  7676. };
  7677. return t = o(t), (e = o(e)) - t > r ? this._progressNumber(t + n, e, i) : t - e > r ? this._progressNumber(t - n, e, i) : this._progressNumber(t, e, i)
  7678. }, y.prototype.translateWithAnimation = function(t, e, i) {
  7679. var n = this;
  7680. this.tweenProgress && (this.tweenProgress.stop(), this.tweenProgress = null);
  7681. var r = this.lon,
  7682. o = this.lat;
  7683. this.tweenProgress = new TWEEN.Tween({
  7684. progress: 0
  7685. })
  7686. .to({
  7687. progress: 1
  7688. }, i)
  7689. .easing(TWEEN.Easing.Linear.None)
  7690. .start(), this.tweenProgress.onUpdate((function() {
  7691. null !== t && 0 !== t && (n.lon = n._progressRad(r, t, this.progress)), null !== e && 0 !== e && (n.lat = n._progressNumber(o, e, this.progress))
  7692. })), this.tweenProgress.onComplete((function() {
  7693. this.tweenProgress = null
  7694. }))
  7695. }, y.prototype.onPointerDown = function(t) {
  7696. this.enabled && ("touch" === t.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  7697. id: t.pointerId,
  7698. pageX: t.pageX,
  7699. pageY: t.pageY
  7700. }), t.touches = this.pointers, this.onTouchStart(t)), this.emit(l.InputStart, "pointer"))
  7701. }, y.prototype.onPointerMove = function(t) {
  7702. this.enabled && "touch" === t.pointerType && (this.pointers.forEach((function(e) {
  7703. t.pointerId === e.id && (e.pageX = t.pageX, e.pageY = t.pageY)
  7704. })), t.touches = this.pointers, this.onTouchMove(t))
  7705. }, y.prototype.onPointerUp = function(t) {
  7706. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e, i) {
  7707. t.pointerId === e.id && this.pointers.splice(i, 1)
  7708. }.bind(this)), t.touches = this.pointers, this.onTouchEnd(t))
  7709. }, y.prototype.reset = function() {
  7710. this.state = d, this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0), this.panSpeed.set(0, 0), this.panAcceleration.set(0, 0)
  7711. }, y.prototype.toJSON = function() {
  7712. return {
  7713. _viewpoint: {
  7714. x: a.toPrecision(this.camera.position.x, 4),
  7715. y: a.toPrecision(this.camera.position.y, 4),
  7716. z: a.toPrecision(this.camera.position.z, 4)
  7717. },
  7718. _rotation: {
  7719. x: a.toPrecision(this.camera.quaternion.x, 4),
  7720. y: a.toPrecision(this.camera.quaternion.y, 4),
  7721. z: a.toPrecision(this.camera.quaternion.z, 4),
  7722. w: a.toPrecision(this.camera.quaternion.w, 4)
  7723. }
  7724. }
  7725. }, y.touch = {
  7726. rotate: {
  7727. start: function(t) {
  7728. this.state = g, this.rotateStart.set(t.touches[0].pageX, t.touches[0].pageY)
  7729. },
  7730. move: function(t) {
  7731. if (this.state === g) {
  7732. this.emit(l.Move, "touch");
  7733. var e = t.currentTarget;
  7734. this.rotateEnd.set(t.touches[0].pageX, t.touches[0].pageY), this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart), this.rotateLeft(2 * Math.PI * this.rotateDelta.x / e.clientWidth * this.rotateSpeed), this.rotateUp(2 * Math.PI * this.rotateDelta.y / e.clientHeight * this.rotateSpeed), this.rotateStart.copy(this.rotateEnd)
  7735. }
  7736. }
  7737. },
  7738. zoom: {
  7739. start: function(t) {
  7740. this.state = v;
  7741. var e = t.touches[0].pageX - t.touches[1].pageX,
  7742. i = t.touches[0].pageY - t.touches[1].pageY,
  7743. n = Math.sqrt(e * e + i * i);
  7744. this.dollyStart.set(0, n)
  7745. },
  7746. move: function(t) {
  7747. if (this.state === v) {
  7748. this.emit(l.Move, "touch");
  7749. var e = t.touches[0].pageX - t.touches[1].pageX,
  7750. i = t.touches[0].pageY - t.touches[1].pageY,
  7751. n = Math.sqrt(e * e + i * i);
  7752. this.dollyEnd.set(0, n), this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart), this.dollyDelta.y > 0 ? this.dollyOut(1 - this.dollyDelta.y / 500) : this.dollyIn(1 + this.dollyDelta.y / 500), this.dollyStart.copy(this.dollyEnd)
  7753. }
  7754. }
  7755. },
  7756. pan: {
  7757. start: function(t) {
  7758. this.state = v, this.panStart.set(o.average(t.touches, "pageX"), o.average(t.touches, "pageY"))
  7759. },
  7760. move: function(t) {
  7761. this.state === v && (this.emit(l.Move, "touch"), this.panEnd.set(o.average(t.touches, "pageX"), o.average(t.touches, "pageY")), this.panDelta.subVectors(this.panEnd, this.panStart), this.pan(this.panDelta.x, this.panDelta.y), this.panStart.copy(this.panEnd), this.rotateDelta.set(0, 0))
  7762. }
  7763. }
  7764. }, t.exports = y
  7765. }, function(t, e, i) {
  7766. var n = i(0),
  7767. r = i(1),
  7768. o = i(53),
  7769. a = i(9),
  7770. s = i(3);
  7771. function l(t) {
  7772. o.call(this, t), this.minDistance = 20, this.maxDistance = 50, this.noRotateUpDown = !0, this.minPolarAngle = 0, this.maxPolarAngle = 0, this.absoluteScale = 1, this.currentScale = 1
  7773. }
  7774. l.prototype = Object.create(o.prototype), l.prototype.zoomToContain = function(t) {
  7775. if (r.delBK) {
  7776. var e = Math.max(t.x, t.z, t.x * this.camera.aspect, t.z * this.camera.aspect);
  7777. this.absoluteScale = e / 2 / r.orthoBase * 1.4, this.currentScale = this.absoluteScale
  7778. } else {
  7779. var i = Math.max(t.x, t.z),
  7780. n = Math.min(t.x, t.z),
  7781. o = Math.max(i, n * this.camera.aspect),
  7782. a = Math.max(n, i * this.camera.aspect);
  7783. this.absoluteScale = (s.aspectRatio() < 1 ? a : o) / 2 / r.orthoBase * 1.2, this.currentScale = this.absoluteScale
  7784. }
  7785. }, l.prototype.rotateToView = function(t, e) {
  7786. if (r.delBK) {
  7787. var i = 0;
  7788. this.rotateLeft(i), this.update(0)
  7789. } else {
  7790. i = 0;
  7791. s.aspectRatio() < 1 === t.x < t.z ? e.z > 0 && (i = Math.PI) : i = e.x > 0 ? Math.PI / 2 : -Math.PI / 2, this.rotateLeft(i)
  7792. }
  7793. }, l.prototype.pan = function(t, e) {
  7794. this.camera.updateMatrix(), this.panLeft(t * (this.camera.right - this.camera.left) / (window.renderWidth || window.innerWidth)), this.panUp(-e * (this.camera.top - this.camera.bottom) / (window.renderHeight || window.innerHeight))
  7795. }, l.prototype.updateZoom = function() {
  7796. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed, this.absoluteScale = Math.max(r.zoomNearLimit, Math.min(this.absoluteScale, r.zoomFarLimit)), this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale, this.camera.left = -r.orthoBase * this.currentScale, this.camera.right = r.orthoBase * this.currentScale, this.camera.top = r.orthoBase * this.currentScale / this.camera.aspect, this.camera.bottom = -r.orthoBase * this.currentScale / this.camera.aspect, this.camera.updateProjectionMatrix(), this.offset.length()
  7797. }, l.prototype.toJSON = function() {
  7798. var t = new n.Quaternion,
  7799. e = (new n.Quaternion)
  7800. .setFromAxisAngle(new n.Vector3(0, 1, 0), n.Math.degToRad(90)),
  7801. i = new n.Quaternion;
  7802. return function() {
  7803. var n = o.prototype.toJSON.call(this);
  7804. return t.copy(n._rotation), i.copy(e), i.multiply(t), n._rotation.x = a.toPrecision(i.x, 4), n._rotation.y = a.toPrecision(i.y, 4), n._rotation.z = a.toPrecision(i.z, 4), n._rotation.w = a.toPrecision(i.w, 4), n._zoom = a.toPrecision(this.currentScale * this.camera.aspect, 4), n
  7805. }
  7806. }(), t.exports = l
  7807. }, function(t, e) {
  7808. t.exports = {
  7809. PanoRenderComplete: "panorama.render.complete",
  7810. TileRenderFailure: "panorama.tile.render.failed",
  7811. TileRenderSuccess: "panorama.tile.render.success",
  7812. TileUploadAttempted: "panorama.tile.upload.attempted",
  7813. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles"
  7814. }
  7815. }, function(t, e) {
  7816. var i, n, r = {};
  7817. r.RADIANS_PER_DEGREE = Math.PI / 180, r.DEGREES_PER_RADIAN = 180 / Math.PI, r.Vector3 = function(t, e, i) {
  7818. this.x = t || 0, this.y = e || 0, this.z = i || 0
  7819. }, r.Matrix4 = function() {
  7820. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])
  7821. }, r.Matrix4.prototype = {
  7822. identity: function() {
  7823. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  7824. },
  7825. copy: function(t) {
  7826. return this.elements.set(t.elements), this
  7827. },
  7828. applyToVector3: function(t) {
  7829. var e = t.x,
  7830. i = t.y,
  7831. n = t.z,
  7832. r = this.elements;
  7833. return t.x = r[0] * e + r[4] * i + r[8] * n + r[12], t.y = r[1] * e + r[5] * i + r[9] * n + r[13], t.z = r[2] * e + r[6] * i + r[10] * n + r[14], this
  7834. },
  7835. getInverse: function(t, e) {
  7836. var i = this.elements,
  7837. n = t.elements,
  7838. r = n[0],
  7839. o = n[1],
  7840. a = n[2],
  7841. s = n[3],
  7842. l = n[4],
  7843. u = n[5],
  7844. h = n[6],
  7845. c = n[7],
  7846. d = n[8],
  7847. p = n[9],
  7848. f = n[10],
  7849. m = n[11],
  7850. g = n[12],
  7851. v = n[13],
  7852. y = n[14],
  7853. b = n[15],
  7854. w = p * y * c - v * f * c + v * h * m - u * y * m - p * h * b + u * f * b,
  7855. x = g * f * c - d * y * c - g * h * m + l * y * m + d * h * b - l * f * b,
  7856. M = d * v * c - g * p * c + g * u * m - l * v * m - d * u * b + l * p * b,
  7857. T = g * p * h - d * v * h - g * u * f + l * v * f + d * u * y - l * p * y,
  7858. S = r * w + o * x + a * M + s * T;
  7859. if (0 === S) {
  7860. if (e) throw new Error("MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0");
  7861. return this.identity()
  7862. }
  7863. var _ = 1 / S;
  7864. return i[0] = w * _, i[1] = (v * f * s - p * y * s - v * a * m + o * y * m + p * a * b - o * f * b) * _, i[2] = (u * y * s - v * h * s + v * a * c - o * y * c - u * a * b + o * h * b) * _, i[3] = (p * h * s - u * f * s - p * a * c + o * f * c + u * a * m - o * h * m) * _, i[4] = x * _, i[5] = (d * y * s - g * f * s + g * a * m - r * y * m - d * a * b + r * f * b) * _, i[6] = (g * h * s - l * y * s - g * a * c + r * y * c + l * a * b - r * h * b) * _, i[7] = (l * f * s - d * h * s + d * a * c - r * f * c - l * a * m + r * h * m) * _, i[8] = M * _, i[9] = (g * p * s - d * v * s - g * o * m + r * v * m + d * o * b - r * p * b) * _, i[10] = (l * v * s - g * u * s + g * o * c - r * v * c - l * o * b + r * u * b) * _, i[11] = (d * u * s - l * p * s - d * o * c + r * p * c + l * o * m - r * u * m) * _, i[12] = T * _, i[13] = (d * v * a - g * p * a + g * o * f - r * v * f - d * o * y + r * p * y) * _, i[14] = (g * u * a - l * v * a - g * o * h + r * v * h + l * o * y - r * u * y) * _, i[15] = (l * p * a - d * u * a + d * o * h - r * p * h - l * o * f + r * u * f) * _, this
  7865. },
  7866. makeRotationFromQuaternion: function(t) {
  7867. var e = this.elements,
  7868. i = t.x,
  7869. n = t.y,
  7870. r = t.z,
  7871. o = t.w,
  7872. a = i + i,
  7873. s = n + n,
  7874. l = r + r,
  7875. u = i * a,
  7876. h = i * s,
  7877. c = i * l,
  7878. d = n * s,
  7879. p = n * l,
  7880. f = r * l,
  7881. m = o * a,
  7882. g = o * s,
  7883. v = o * l;
  7884. return e[0] = 1 - (d + f), e[4] = h - v, e[8] = c + g, e[1] = h + v, e[5] = 1 - (u + f), e[9] = p - m, e[2] = c - g, e[6] = p + m, e[10] = 1 - (u + d), e[3] = 0, e[7] = 0, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, this
  7885. }
  7886. }, r.Quaternion = function(t, e, i, n) {
  7887. this._x = t || 0, this._y = e || 0, this._z = i || 0, this._w = void 0 !== n ? n : 1
  7888. }, r.Quaternion.prototype = {
  7889. get x() {
  7890. return this._x
  7891. },
  7892. set x(t) {
  7893. this._x = t
  7894. },
  7895. get y() {
  7896. return this._y
  7897. },
  7898. set y(t) {
  7899. this._y = t
  7900. },
  7901. get z() {
  7902. return this._z
  7903. },
  7904. set z(t) {
  7905. this._z = t
  7906. },
  7907. get w() {
  7908. return this._w
  7909. },
  7910. set w(t) {
  7911. this._w = t
  7912. },
  7913. copy: function(t) {
  7914. this._x = t.x, this._y = t.y, this._z = t.z, this._w = t.w
  7915. },
  7916. inverse: function() {
  7917. return this.conjugate()
  7918. .normalize()
  7919. },
  7920. conjugate: function() {
  7921. return this._x *= -1, this._y *= -1, this._z *= -1, this
  7922. },
  7923. length: function() {
  7924. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  7925. },
  7926. normalize: function() {
  7927. var t = this.length();
  7928. return 0 === t ? (this._x = 0, this._y = 0, this._z = 0, this._w = 1) : (t = 1 / t, this._x = this._x * t, this._y = this._y * t, this._z = this._z * t, this._w = this._w * t), this
  7929. },
  7930. setFromAxisAngle: function(t, e) {
  7931. var i = e / 2,
  7932. n = Math.sin(i);
  7933. return this._x = t.x * n, this._y = t.y * n, this._z = t.z * n, this._w = Math.cos(i), this
  7934. },
  7935. setFromUnitVectors: function(t, e) {
  7936. return void 0 === i && (i = new r.Vector3), (n = r.dot(t, e) + 1) < 1e-6 ? (n = 0, Math.abs(t.x) > Math.abs(t.z) ? r.setVector(i, -t.y, t.x, 0) : r.setVector(i, 0, -t.z, t.y)) : r.cross(t, e, i), this._x = i.x, this._y = i.y, this._z = i.z, this._w = n, this.normalize()
  7937. },
  7938. multiply: function(t) {
  7939. return this.multiplyQuaternions(this, t)
  7940. },
  7941. premultiply: function(t) {
  7942. return this.multiplyQuaternions(t, this)
  7943. },
  7944. multiplyQuaternions: function(t, e) {
  7945. var i = t._x,
  7946. n = t._y,
  7947. r = t._z,
  7948. o = t._w,
  7949. a = e._x,
  7950. s = e._y,
  7951. l = e._z,
  7952. u = e._w;
  7953. return this._x = i * u + o * a + n * l - r * s, this._y = n * u + o * s + r * a - i * l, this._z = r * u + o * l + i * s - n * a, this._w = o * u - i * a - n * s - r * l, this
  7954. }
  7955. }, r.convertWorkshopVector = function(t) {
  7956. return new r.Vector3(-t.x, t.y, t.z)
  7957. }, r.convertWorkshopQuaternion = function(t) {
  7958. return new r.Quaternion(-t.x, t.y, t.z, -t.w)
  7959. .multiply(new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0))
  7960. }, r.convertWorkshopOrthoZoom = function(t) {
  7961. return -1 === t ? -1 : t / 4
  7962. }, r.convertWorkshopPanoramaQuaternion = function(t) {
  7963. return new r.Quaternion(t.x, -t.y, -t.z, t.w)
  7964. .normalize()
  7965. .multiply((new r.Quaternion)
  7966. .setFromAxisAngle(new r.Vector3(0, 1, 0), 270 * r.RADIANS_PER_DEGREE))
  7967. }, r.normalize = function(t) {
  7968. var e = t.x * t.x + t.y * t.y + t.z * t.z,
  7969. i = Math.sqrt(e);
  7970. t.x /= i, t.y /= i, t.z /= i
  7971. }, r.dot = function(t, e) {
  7972. return t.x * e.x + t.y * e.y + t.z * e.z
  7973. }, r.cross = function(t, e, i) {
  7974. var n = t.x,
  7975. r = t.y,
  7976. o = t.z;
  7977. i.x = r * e.z - o * e.y, i.y = o * e.x - n * e.z, i.z = n * e.y - r * e.x
  7978. }, r.setVector = function(t, e, i, n) {
  7979. t.x = e, t.y = i, t.z = n
  7980. }, r.copyVector = function(t, e) {
  7981. e.x = t.x, e.y = t.y, e.z = t.z
  7982. }, r.addVector = function(t, e) {
  7983. t.x += e.x, t.y += e.y, t.z += e.z
  7984. }, r.subVector = function(t, e) {
  7985. t.x -= e.x, t.y -= e.y, t.z -= e.z
  7986. }, r.applyQuaternionToVector = function(t, e) {
  7987. var i = e.x,
  7988. n = e.y,
  7989. r = e.z,
  7990. o = t.x,
  7991. a = t.y,
  7992. s = t.z,
  7993. l = t.w,
  7994. u = l * i + a * r - s * n,
  7995. h = l * n + s * i - o * r,
  7996. c = l * r + o * n - a * i,
  7997. d = -o * i - a * n - s * r;
  7998. e.x = u * l + d * -o + h * -s - c * -a, e.y = h * l + d * -a + c * -o - u * -s, e.z = c * l + d * -s + u * -a - h * -o
  7999. }, r.angleBetweenVectors = function(t, e) {
  8000. return Math.acos(r.dot(t, e))
  8001. }, t.exports = r
  8002. }, function(t, e, i) {
  8003. (function(e) {
  8004. function n(t) {
  8005. o.call(this, t), this.panoId = t.panoId, this.orthoZoom = t.orthoZoom, this.floorVisibility = t.floorVisibility, this.thumbUrl = t.thumbUrl, this.name = t.name, this.isHero = t.isHero, this.script = t.script, this.cameraType = t.cameraType
  8006. }
  8007. var r = (i(0), i(2)),
  8008. o = (i(1), i(5), i(7), i(8), i(10), i(11), i(16), i(58));
  8009. i(4)
  8010. .EventEmitter, new r(e), n.prototype = Object.create(o.prototype), n.prototype.isPano = function() {
  8011. return this.panoId && "" !== this.panoId
  8012. }, t.exports = n
  8013. })
  8014. .call(this, "/js/objects/Snapshot.js")
  8015. }, function(t, e, i) {
  8016. (function(e) {
  8017. var n = i(0),
  8018. r = i(4)
  8019. .EventEmitter;
  8020. function o(t) {
  8021. t = t || {}, this.position = new n.Vector3, this.quaternion = new n.Quaternion, this.update(t)
  8022. }
  8023. n = i(0);
  8024. var a = i(2);
  8025. i(1), i(5), i(7), i(8), i(10), i(11), i(16), r = i(4)
  8026. .EventEmitter;
  8027. new a(e), o.prototype = Object.create(r.prototype), o.prototype.isValid = function() {
  8028. return !!this.cameraMode
  8029. }, o.prototype.update = function(t) {
  8030. return this.cameraMode = t.cameraMode || this.cameraMode, this.pano = t.pano || this.pano, t.position && this.position.copy(t.position), t.quaternion && this.quaternion.copy(t.quaternion), this
  8031. }, t.exports = o
  8032. })
  8033. .call(this, "/js/objects/View.js")
  8034. }, function(t, e, i) {
  8035. var n = i(0),
  8036. r = i(5),
  8037. o = i(8),
  8038. a = i(20),
  8039. s = new n.ShaderPass(n.HorizontalBlurShader),
  8040. l = new n.ShaderPass(n.VerticalBlurShader);
  8041. l.renderToScreen = !0;
  8042. var u = (window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight);
  8043. isNaN(u) && (u = 1);
  8044. var h = {
  8045. currentBlur: 0,
  8046. aspect: u,
  8047. blurStrength: 1,
  8048. hblurPass: s,
  8049. vblurPass: l,
  8050. bindEvents: function(t) {
  8051. t.on(a.ModeChanged, (function(t, e) {
  8052. t === r.PANORAMA && (o.cancel(h.blur), o.cancel(h.addBlur), o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  8053. }))
  8054. },
  8055. blur: function(t) {
  8056. h.currentBlur = 1;
  8057. var e = t * h.blurStrength;
  8058. l.uniforms.v.value = e / 512 * h.aspect, s.uniforms.h.value = e / 512
  8059. },
  8060. addBlur: function(t) {
  8061. t = Math.max(t, h.currentBlur), h.blur(t)
  8062. },
  8063. removeBlur: function(t) {
  8064. t = Math.min(1 - t, h.currentBlur), h.blur(t)
  8065. }
  8066. };
  8067. h.blur(1), t.exports = h
  8068. }, function(t, e, i) {
  8069. var n = (i(0), i(7)),
  8070. r = i(14),
  8071. o = i(21),
  8072. a = i(4)
  8073. .EventEmitter;
  8074. function s() {
  8075. this.modelMap = {}, this.activeModel = null, this.modelCount = 0, this.tileDownloader = null, this.panoRenderer = null
  8076. }
  8077. s.prototype.init = function(t, e, i) {
  8078. this.tileDownloader = t, this.panoRenderer = e, this.qualityManager = i
  8079. }, s.prototype.addModel = function(t) {
  8080. this.modelMap[t.modelid] = t, 0 === this.modelCount && this.activateModel(t.modelid), this.modelCount++, this.emit(o.ModelAdded)
  8081. }, s.prototype.activateModel = function(t) {
  8082. var e = this.modelMap[t];
  8083. if (!e) throw new r("Tried to activate invalid model!");
  8084. var i = this.activeModel;
  8085. this.activeModel = e, this.tileDownloader.setPanoData(e.panos, e.listImagePanos(), e.modelid), this.tileDownloader.setUrls(e.urls), e.panos.forEach(function(t) {
  8086. t.attachToPanoRenderer(this.panoRenderer), t.tileDownloader = this.tileDownloader, t.qualityManager = this.qualityManager
  8087. }.bind(this)), this.emit(o.ActiveModelChanged, {
  8088. oldModel: i,
  8089. model: e
  8090. })
  8091. }, s.prototype.getActiveModel = function() {
  8092. return this.activeModel
  8093. }, n.extend(s, a), t.exports = s
  8094. }, function(t, e, i) {
  8095. var n = i(0),
  8096. r = i(1);
  8097. function o() {
  8098. n.PerspectiveCamera.call(this, r.dollhouseFOV, (window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight), r.dollhouseNear, r.dollhouseFar), this.controls = null
  8099. }
  8100. o.prototype = Object.create(n.PerspectiveCamera.prototype), o.prototype.updateAspect = function(t) {
  8101. this.aspect = t, this.updateProjectionMatrix()
  8102. }, t.exports = o
  8103. }, function(t, e, i) {
  8104. var n = i(0),
  8105. r = i(1);
  8106. function o() {
  8107. var t = (window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight);
  8108. n.OrthographicCamera.call(this, -r.orthoBase, r.orthoBase, r.orthoBase / t, -r.orthoBase / t, r.orthoNear, r.orthoFar), this.controls = null, this.updateAspect(t)
  8109. }
  8110. o.prototype = Object.create(n.OrthographicCamera.prototype), o.prototype.updateAspect = function(t) {
  8111. this.aspect = t, this.top = r.orthoBase / t, this.bottom = -r.orthoBase / t, this.updateProjectionMatrix()
  8112. }, t.exports = o
  8113. }, function(t, e) {
  8114. t.exports = Object.freeze({
  8115. Standard: 0,
  8116. Slow: 1,
  8117. Retain: 2
  8118. })
  8119. }, function(t, e) {
  8120. t.exports = Object.freeze({
  8121. Show: 0,
  8122. Hide: 1,
  8123. Retain: 2
  8124. })
  8125. }, function(t, e) {
  8126. t.exports = Object.freeze({
  8127. None: 0,
  8128. Queued: 1,
  8129. ForceQueued: 2,
  8130. Downloading: 3,
  8131. Downloaded: 4,
  8132. DownloadFailed: 5
  8133. })
  8134. }, function(t, e) {
  8135. t.exports = {
  8136. STAY3D: 1,
  8137. FLYTOPANO: 2,
  8138. STARTPANO: 3
  8139. }
  8140. }, function(t, e, i) {
  8141. var n = i(0),
  8142. r = i(1),
  8143. o = null;
  8144. function a(t) {
  8145. o = this, this.player = t, this.raycaster = this.player.raycaster, this.camera = this.player.camera;
  8146. this.perspectiveCamera = new n.PerspectiveCamera(r.insideFOV, (window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight), r.insideNear, r.insideFar), this.sRender = t.sRender, this.scene = this.sRender.scene, this.lookVector = new n.Vector2, this.renderTarget = new n.WebGLRenderTarget(512, 512), this.lensMesh = null
  8147. }
  8148. a.prototype.createNewColliders = function() {
  8149. return !1
  8150. }, a.prototype.createMeasureLens = function() {
  8151. return !1
  8152. }, a.prototype.onMouseMove = function(t, e, i) {
  8153. return e.chunks.forEach((function(t) {
  8154. t.material.uniforms.mouseAPosition && t.material.uniforms.measureMode && (t.material.uniforms.mouseAPosition.value.copy(i), t.material.uniforms.measureMode.value = 1)
  8155. })), !1
  8156. }, a.prototype.show = function() {
  8157. return !1
  8158. }, a.prototype.hide = function() {
  8159. return !1
  8160. }, a.prototype.update = function() {
  8161. return !1
  8162. }, a.prototype.render = function() {
  8163. this.sRender.mesaueLensRender(o.scene, o.perspectiveCamera, o.renderTarget, !0)
  8164. }, t.exports = a
  8165. }, function(t, e, i) {
  8166. "use strict";
  8167. function n() {
  8168. this.enabled = !0
  8169. }
  8170. n.prototype.echo = function(t, e) {
  8171. this.enabled && t.apply(console, e)
  8172. }, n.prototype.log = function() {
  8173. this.echo(console.debug, arguments)
  8174. }, n.prototype.info = function() {
  8175. this.echo(console.info, arguments)
  8176. }, n.prototype.debug = function() {
  8177. this.echo(console.debug, arguments)
  8178. }, n.prototype.warn = function() {
  8179. this.echo(console.warn, arguments)
  8180. }, n.prototype.error = function() {
  8181. this.echo(console.error, arguments)
  8182. };
  8183. var r = new n;
  8184. G.ncz_my_log = r, t.exports = r
  8185. }, function(t, e, i) {
  8186. "use strict";
  8187. var n = i(0),
  8188. r = i(132);
  8189. function o(t) {
  8190. this.id = t, this.postil = null, this.settingItem = null
  8191. }
  8192. o.prototype.init = function(t) {
  8193. var e;
  8194. (this.postilEngine = {
  8195. type_1: this.createTorus,
  8196. type_2: this.createRect
  8197. }, t) || (this.settingItem = new r(this.id), 1 === this.settingItem.type && (e = 328), 2 === this.settingItem.type && (e = 320), this.postil = this.postilEngine["type_" + this.id].call(this, 8, e, "#ff0000"), this.settingItem.uuid = this.postil.uuid);
  8198. t && (this.settingItem = t, 1 === t.type && (e = 328), 2 === t.type && (e = 320), this.postil = this.postilEngine["type_" + this.id].call(this, t.fat, e, t.color), this.postil.position.copy(t.position), this.postil.scale.copy(t.scale));
  8199. return this.settingItem.uuid = this.postil.uuid, this.settingItem.position = this.postil.position, this.settingItem.scale = this.postil.scale, this.initUserData(), this.postil
  8200. }, o.prototype.initUserData = function() {
  8201. this.postil.name = "postil_" + (new Date)
  8202. .getTime(), this.postil.userData.PostilModel = this, this.postil.userData.fat = this.settingItem.fat, this.postil.userData.type = "postil", this.postil.userData.follow_mouse = !1, this.postil.userData.box_line = null, this.postil.userData.transform_control = null, this.postil.userData.setting_item = this.settingItem
  8203. }, o.prototype.createTorusTexture = function(t, e, i) {
  8204. var r = document.createElement("canvas"),
  8205. o = r.getContext("2d"),
  8206. a = 1024,
  8207. s = a * (t / e);
  8208. r.width = a * (window.devicePixelRatio ? window.devicePixelRatio : 1), r.height = a * (window.devicePixelRatio ? window.devicePixelRatio : 1), o.beginPath(), o.lineWidth = s, o.strokeStyle = i || "#ff0000", o.arc(r.width / 2, r.height / 2, (r.width - s) / 2, 0, 360, !1), o.stroke(), o.closePath(), window.devicePixelRatio && o.scale(window.devicePixelRatio, window.devicePixelRatio);
  8209. var l = new n.CanvasTexture(r);
  8210. return l.minFilter = n.LinearFilter, l.magFilter = n.LinearFilter, l
  8211. }, o.prototype.createRectTexture = function(t, e, i) {
  8212. var r = document.createElement("canvas"),
  8213. o = r.getContext("2d"),
  8214. a = 1024,
  8215. s = a * (t / e);
  8216. r.width = a * (window.devicePixelRatio ? window.devicePixelRatio : 1), r.height = a * (window.devicePixelRatio ? window.devicePixelRatio : 1), o.lineWidth = s, o.strokeStyle = i || "#ff0000", o.moveTo(0, 0), o.lineTo(r.width, 0), o.lineTo(r.width, r.height), o.lineTo(0, r.height), o.lineTo(0, 0), o.stroke(), window.devicePixelRatio && o.scale(window.devicePixelRatio, window.devicePixelRatio);
  8217. var l = new n.CanvasTexture(r);
  8218. return l.minFilter = n.LinearFilter, l.magFilter = n.LinearFilter, l
  8219. }, o.prototype.createPostilOfTexture = function(t) {
  8220. var e = new n.PlaneBufferGeometry(.5, .5),
  8221. i = new n.MeshBasicMaterial({
  8222. map: t,
  8223. side: n.DoubleSide,
  8224. transparent: !0,
  8225. depthTest: !1,
  8226. depthWrite: !1
  8227. }),
  8228. r = new n.Mesh(e, i);
  8229. return r.scale.divideScalar(2), r
  8230. }, o.prototype.createTorus = function(t, e, i) {
  8231. var n = this.createTorusTexture(t, e, i),
  8232. r = this.createPostilOfTexture(n);
  8233. return r.userData.default_scale = r.scale.clone(), r.userData.default_size = {
  8234. width: 328,
  8235. height: 328
  8236. }, r.userData.default_fat = 8, r
  8237. }, o.prototype.createRect = function(t, e, i) {
  8238. var n = this.createRectTexture(t, e, i),
  8239. r = this.createPostilOfTexture(n);
  8240. return r.userData.default_scale = r.scale.clone(), r.userData.default_size = {
  8241. width: 320,
  8242. height: 320
  8243. }, r.userData.default_fat = 8, r
  8244. }, t.exports = o
  8245. }, function(t, e) {
  8246. t.exports = {
  8247. ActionInterrupted: "action.interrupted"
  8248. }
  8249. }, function(t, e) {
  8250. t.exports = {
  8251. Normal: 0,
  8252. Audio: 1,
  8253. Video: 2,
  8254. IFrame: 3
  8255. }
  8256. }, function(t, e, i) {
  8257. (function(e) {
  8258. new(i(2))(e);
  8259. var n = {
  8260. parseIdsFromChunkName: function(t, e) {
  8261. e.floorId = n.parseFloor(t), e.roomId = n.parseRoom(t)
  8262. },
  8263. parseFloor: function(t) {
  8264. var e, i = t.match(/block_([0-9]+)/);
  8265. if (!i) return 0;
  8266. try {
  8267. e = parseInt(i[1], 10)
  8268. } catch (t) {
  8269. return 0
  8270. }
  8271. return this.getfid(e)
  8272. },
  8273. getfid: function(t) {
  8274. for (var e = G.settings.building.blocks, i = e.length || 0, n = 0; n < i; n++)
  8275. if (e[n].blockidx === t) return e[n].flooridx;
  8276. return 0
  8277. },
  8278. getflooridx: function() {
  8279. for (var t = G.model.chunks, e = 0; e < t.length; e++)
  8280. if (G.model.chunks[e].id === G.interchunkid) return this.getfid(e);
  8281. return 0
  8282. },
  8283. getrid: function(t) {
  8284. for (var e = G.settings.building.blocks, i = e.length || 0, n = 0; n < i; n++)
  8285. if (e[n].blockidx === t) return e[n].roomidx;
  8286. return 0
  8287. },
  8288. parseRoom: function(t) {
  8289. var e, i = t.match(/block_([0-9]+)/);
  8290. if (!i) return 0;
  8291. try {
  8292. e = parseInt(i[1], 10)
  8293. } catch (t) {
  8294. return 0
  8295. }
  8296. return this.getrid(e)
  8297. }
  8298. };
  8299. t.exports = n
  8300. })
  8301. .call(this, "/js/model/Chunks.js")
  8302. }, function(t, e, i) {
  8303. var n = i(4)
  8304. .EventEmitter,
  8305. r = function() {
  8306. this.audioContext = null, window.AudioContext = window.AudioContext || window.webkitAudioContext || window.mozAudioContext || window.msAudioContext, window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame, window.cancelAnimationFrame = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.msCancelAnimationFrame;
  8307. try {
  8308. this.audioContext = new AudioContext
  8309. } catch (t) {}
  8310. this.audioContext || alert("该浏览器不支持AudioContext,讲房无法正常使用!"), this.bufferList = {}, this.cellList = {}
  8311. };
  8312. r.prototype.load = function(t) {
  8313. var e = new XMLHttpRequest;
  8314. e.open("GET", t, !0), e.responseType = "arraybuffer";
  8315. var i = this;
  8316. this.audioContext && (i.cellList[t] = new o(this.audioContext)), e.onload = function() {
  8317. i.audioContext && i.audioContext.decodeAudioData(e.response, (function(e) {
  8318. e && i.cellList[t].setBuffer(e)
  8319. }))
  8320. }, e.onerror = function() {}, e.send()
  8321. }, r.prototype.getCell = function(t) {
  8322. return null !== this.cellList[t] ? this.cellList[t] : null
  8323. };
  8324. var o = function(t) {
  8325. this.audioContext = t, this.audioBuffer = null, this.source = null, this.pauseTime = 0, this.startTime = 0, this.readyState = 0, this.oncanplay = function() {}, this.audioContext && this.audioContext.addEventListener("ended", (function() {})), this._ended = this._ended.bind(this);
  8326. var e = this;
  8327. Object.defineProperty(this, "contextCurrentTime", {
  8328. get: function() {
  8329. return e.audioContext.currentTime
  8330. },
  8331. set: function(t) {
  8332. t,
  8333. e.pauseTime = t
  8334. }
  8335. }), Object.defineProperty(this, "currentTime", {
  8336. get: function() {
  8337. return e.audioContext.currentTime - e.startTime
  8338. },
  8339. set: function(t) {
  8340. t,
  8341. e.pauseTime = t
  8342. }
  8343. }), Object.defineProperty(this, "duration", {
  8344. get: function() {
  8345. return e.audioBuffer.duration
  8346. }
  8347. }), this.keeprunning = this.keeprunning.bind(this), document.body.addEventListener("touchend", this.keeprunning, !1)
  8348. };
  8349. o.prototype = Object.create(n.prototype), o.prototype.setBuffer = function(t) {
  8350. this.audioBuffer = t, this.readyState = 4, this.oncanplay()
  8351. }, o.prototype.keeprunning = function() {
  8352. if ("running" !== this.audioContext) {
  8353. var t = this;
  8354. this.audioContext.resume();
  8355. var e = setTimeout((function() {
  8356. "running" === t.audioContext.state && clearTimeout(e)
  8357. }), 0)
  8358. }
  8359. }, o.prototype.play = function() {
  8360. var t = 0;
  8361. 0 !== this.pauseTime && (t = this.pauseTime, this.pauseTime = 0);
  8362. var e = this.audioContext,
  8363. i = e.createBufferSource();
  8364. i.connect(e.destination), i.buffer = this.audioBuffer, i.start || (i.start = i.noteOn, i.stop = i.noteOff), this.source = i, this.startTime = this.contextCurrentTime, i.onended = this._ended, i.start(0, t)
  8365. }, o.prototype._ended = function() {
  8366. this.emit("play_done")
  8367. }, o.prototype.pause = function() {
  8368. null !== this.source && (this.pauseTime = this.contextCurrentTime - this.startTime, this.source.disconnect())
  8369. }, o.prototype.stop = function() {
  8370. null !== this.source && this.source.disconnect()
  8371. };
  8372. var a, s = (a = null, function() {
  8373. return null === a && (a = new r), a
  8374. });
  8375. t.exports = s
  8376. }, function(t, e, i) {
  8377. function n() {
  8378. var t = new r.SphereBufferGeometry(a.skyboxRadius, 20, 5),
  8379. e = new r.RawShaderMaterial({
  8380. fragmentShader: o.skysphere.fragmentShader,
  8381. vertexShader: o.skysphere.vertexShader,
  8382. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  8383. side: r.BackSide,
  8384. name: "skysphere"
  8385. });
  8386. e.uniforms.radius.value = t.parameters.radius, r.Mesh.call(this, t, e)
  8387. }
  8388. var r = i(0),
  8389. o = i(12),
  8390. a = i(1);
  8391. n.prototype = Object.create(r.Mesh.prototype), n.prototype.constructor = n, t.exports = n
  8392. }, function(t, e, i) {
  8393. (function(e) {
  8394. function n(t) {
  8395. t.camera && (t.camera.quaternion = r(t.camera.quaternion)), t.pano && (t.pano.quaternion = r(t.pano.quaternion))
  8396. }
  8397. function r(t) {
  8398. return t = t || new c.Quaternion, 0 === Math.abs(t.x) && 0 === Math.abs(t.y) && 0 === Math.abs(t.z) && 0 === Math.abs(t.w) && (t.w = 1), t
  8399. }
  8400. function o(t) {
  8401. return a.deserialize(t)
  8402. }
  8403. var a = i(182),
  8404. s = i(9),
  8405. l = i(3),
  8406. u = i(5),
  8407. h = i(2),
  8408. c = i(0),
  8409. d = new h(e);
  8410. t.exports = {
  8411. optionsFromString: o,
  8412. getStartCameraOptions: function(t, e, i, r) {
  8413. var a = {};
  8414. if (r || (a = function(t) {
  8415. var e = l.valueFromHash("start", ""),
  8416. i = {};
  8417. "" !== e && (d.debug("Start override found in parameters, trying to parse..."), (i = o(e) || {})
  8418. .tag = l.valueFromHash("tag", null), i.panoId && (i.pano = t.get(i.panoId)));
  8419. return i
  8420. }(e)), "" != (a = function(t) {
  8421. var e = l.valueFromHash("o", ""),
  8422. i = {};
  8423. e || (e = t.data.orientationkey);
  8424. if (e) {
  8425. var n = t.data.orientations;
  8426. if (null != n && null != n) {
  8427. var r = n.length;
  8428. for (i = 0; i < r; i++)
  8429. if (n[i].key == e) return n[i]
  8430. }
  8431. }
  8432. return i
  8433. }(t)) && a.enable) {
  8434. var h = a.location_id,
  8435. p = a.rotation,
  8436. f = e.list.length;
  8437. if (1 == a.type) {
  8438. a.mode = u.PANORAMA;
  8439. for (i = 0; i < f; i++) e.list[i].id == h && (a.pano = e.list[i], a.position = a.pano.position, a.quaternion = p);
  8440. return a.quaternion && (a.quaternion = s.convertWorkshopQuaternion(a.quaternion)), a
  8441. }
  8442. for (i = 0; i < f; i++) e.list[i].id == h && (a.pano = e.list[i], a.position = a.pano.position, a.quaternion = a.pano.quaternion);
  8443. return a
  8444. }
  8445. var m = l.valueFromHash("l", "");
  8446. if ("" != m) {
  8447. h = m, f = e.list.length;
  8448. a.mode = u.PANORAMA;
  8449. for (i = 0; i < f; i++) e.list[i].id == h && (a.pano = e.list[i], a.position = a.pano.position, a.quaternion = a.pano.quaternion);
  8450. return a.quaternion && (a.quaternion = s.convertWorkshopQuaternion(a.quaternion)), a
  8451. }
  8452. var g = function(t) {
  8453. var e = t.data.images.scenes,
  8454. i = t.settings;
  8455. if (i.jf && i.jf.enable && i.jf.dataset.length > 0) return e[0]._camera;
  8456. for (var n = 0; n < e.length; n++) {
  8457. var r = e[n];
  8458. if (null !== r.name && "总述" !== r.name) return r._camera
  8459. }
  8460. return ""
  8461. }(t);
  8462. if ("" !== g) {
  8463. h = g._locationid, f = e.list.length, p = g._rotation;
  8464. a.mode = u.PANORAMA;
  8465. for (i = 0; i < f; i++) e.list[i].id == h && (a.pano = e.list[i], 2 == g._type ? a.quaternion = a.pano.quaternionAutoScene : a.quaternion = p, a.position = a.pano.position);
  8466. if (a.quaternion) {
  8467. var v = a.quaternion;
  8468. a.quaternion = new c.Quaternion(v.x, v.y, v.z, v.w)
  8469. }
  8470. return a
  8471. }
  8472. var y = t.data.camera_start;
  8473. if (y) try {
  8474. n(y), Object.keys(y)
  8475. .length > 0 && 0 === Object.keys(a)
  8476. .length && (a.mode = u.convertWorkshopModeInt(y.mode), a.position = y.camera.position, a.quaternion = y.camera.quaternion, a.zoom = s.convertWorkshopOrthoZoom(y.camera.zoom), y.pano && (a.pano = e.get(y.pano.locationid), d.debug("Using camera_start"), d.debug("Modeldata pano: ", a.pano.quaternion), d.debug("Camera start pano: ", y.pano.quaternion)), a.mode !== u.PANORAMA && (a.floorVisibility = t.heroImage._camera.floor_visibility))
  8477. } catch (t) {
  8478. d.warn(t.message)
  8479. }
  8480. if (0 === Object.keys(a)
  8481. .length && (a = function(t, e) {
  8482. if (!t.heroImage || !t.heroImage._camera._viewpoint) return {};
  8483. var i = {},
  8484. n = t.heroImage._camera;
  8485. d.debug("Using start position from thumbnail image"), i.position = n._viewpoint, i.quaternion = n._rotation;
  8486. try {
  8487. i.mode = u.convertWorkshopModeInt(0), i.mode === u.PANORAMA ? i.pano = e.get(n._locationid) : i.floorVisibility = n.floor_visibility
  8488. } catch (t) {
  8489. d.debug(t.message)
  8490. }
  8491. return i
  8492. }(t, e)), t.outsideAllowed() || a.mode === u.PANORAMA || (a = {}), 0 === Object.keys(a)
  8493. .length) {
  8494. for (i = 0; i < e.list.length && 1 != e.list[i].alignmentType; i++);
  8495. a.pano = e.list[i], a.position = a.pano.position, a.quaternion = a.pano.quaternionAutoScene, d.info("Starting at 1st pano " + a.pano.id)
  8496. }
  8497. return a.mode = a.mode || u.PANORAMA, a.pano || (d.debug("No pano selected, choosing the closest one to player location"), a.pano = e.findClosest(a.position || i)), a.mode === u.MESH && (a.mode = u.PANORAMA, a.position = a.pano ? a.pano.position : i), a
  8498. }
  8499. }
  8500. })
  8501. .call(this, "/js/util/camera.js")
  8502. }, function(t, e) {
  8503. t.exports = {
  8504. TileDownloadSuccess: "tiledownloader.download.success",
  8505. TileDownloadFailure: "tiledownloader.download.failure",
  8506. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  8507. }
  8508. }, function(t, e, i) {
  8509. var n = i(78),
  8510. r = i(3),
  8511. o = i(1),
  8512. a = i(2);
  8513. t.exports.HousePlay = n, t.exports.Browser = r, t.exports.Config = o, t.exports.Logger = a
  8514. }, function(t, e, i) {
  8515. "use strict";
  8516. (function(e) {
  8517. window.G = {}, G.conf = {
  8518. isNewServerPreviewVersion: !1,
  8519. isNewEditVersion: !1,
  8520. isCleanUI: 0,
  8521. jfedit: !1,
  8522. screenshot: !1,
  8523. modelplaced: !0,
  8524. modelMeasure: !1,
  8525. annotation: !1,
  8526. publicity: !1
  8527. }, i(79), i(80), i(81), i(82), i(83), i(84), i(85), i(86), i(87), i(88), i(89), i(90), i(91), i(92), i(93), i(94), i(95), i(96), i(97), i(10), i(11);
  8528. var n = i(0),
  8529. r = i(98),
  8530. o = i(144),
  8531. a = i(60),
  8532. s = i(145),
  8533. l = i(5),
  8534. u = i(2),
  8535. h = i(146),
  8536. c = i(3),
  8537. d = i(1),
  8538. p = i(8),
  8539. f = i(59),
  8540. m = i(74),
  8541. g = (i(25), i(75)),
  8542. v = i(183),
  8543. y = i(4)
  8544. .EventEmitter,
  8545. b = i(184),
  8546. w = i(186),
  8547. x = i(191),
  8548. M = i(195),
  8549. T = i(196),
  8550. S = (i(42), i(198)),
  8551. _ = i(199),
  8552. A = i(48),
  8553. P = i(66),
  8554. C = i(20),
  8555. E = i(27),
  8556. D = i(201),
  8557. L = i(28)(),
  8558. O = i(202);
  8559. function I(t) {
  8560. t.stopPropagation(), t.preventDefault()
  8561. }
  8562. function R(t) {
  8563. y.defaultMaxListeners = 1e3,
  8564. function(t) {
  8565. t.addEventListener("dragenter", I, !1), t.addEventListener("dragover", I, !1)
  8566. }(t)
  8567. }
  8568. function N(t) {
  8569. ! function t(e) {
  8570. for (var i in e) "object" == typeof e[i] ? t(e[i]) : "string" == typeof e[i] && (e[i] = e[i].replace("modelcdn.3dnest.cn", "modelcdn2.3dnest.cn")
  8571. .replace("infocdn.3dnest.cn", "infocdn2.3dnest.cn")
  8572. .replace("template.3dnest.cn", "template2.3dnest.cn"))
  8573. }(t)
  8574. }
  8575. function k(t, e, i, n) {
  8576. return n.progressCallback = e, t.load(i)
  8577. .progress(F.bind(this, n))
  8578. }
  8579. function F(t, e) {
  8580. var i;
  8581. t.modelElementsToLoad = e[1], (i = t)
  8582. .totalElementsToLoad = i.modelElementsToLoad + i.panoElementsToLoad,
  8583. function(t) {
  8584. t.totalElementsLoaded++, t.totalPercentageLoaded = t.totalElementsLoaded / t.totalElementsToLoad, t.progressCallback && t.progressCallback(100 * t.totalPercentageLoaded)
  8585. }(t)
  8586. }
  8587. function B(t, e, i) {
  8588. try {
  8589. t.start(e)
  8590. } catch (t) {
  8591. throw i.modelid, (n = c.details()) && "Safari" === n.name && n.version > 500 && n.version, t
  8592. }
  8593. var n
  8594. }
  8595. u.level = d.logLevel, u.consoleEnabled = d.console;
  8596. var z = function(t) {
  8597. if (this.event = {
  8598. load: new y,
  8599. player: new y,
  8600. director: new y,
  8601. model: new y
  8602. }, this.playContainer = void 0 !== t.container ? t.container : document.getElementById("player"), this.modelId = void 0 !== t.modelId ? t.modelId : "", this.settings = void 0 !== t.settings ? t.settings : {}, this.version = void 0 !== t.version ? t.version : {}, this.siteConf = void 0 !== t.siteConf ? t.siteConf : {}, this.enterType = void 0 !== t.enterType ? t.enterType : 2, this.loadingState = !1, this.compassAngle = 0, this.lastCompassAngle = 0, this.settings.basic.menu && (d.unit_type = this.settings.basic.menu.unit_type || 0, 1 === d.unit_type && (d.unit_conversion_value = 3.28, d.unit_name = "ft", d.unit_sq_name = "ft²")), !this.modelId) return this.event.error.emit("invalid_modelid");
  8603. var e = this.settings.building.blocks;
  8604. if (e && this.settings.building)
  8605. for (var i = 0; i < e.length; i++) e[i].blockidx = parseInt(e[i].blockidx), e[i].flooridx = parseInt(e[i].flooridx), e[i].roomidx = parseInt(e[i].roomidx);
  8606. else this.settings.building.blocks = {};
  8607. G.url = G.url || {}, G.url.modelid = this.modelId, G.url.type = this.siteConf.type, window.PREFETCHED_MODELDATA = this.settings;
  8608. var n = this;
  8609. this.progStruct = {
  8610. panoElementsToLoad: 6,
  8611. modelElementsToLoad: 0,
  8612. totalElementsLoaded: 0,
  8613. totalElementsToLoad: 0,
  8614. totalPercentageLoaded: 0,
  8615. progressCallback: null
  8616. }, this.qFlag = d.quickstart.enabled, this.quickstartManager = null, this.startOptions = null, this.player = null, this.director = null, this.mattertagManager = null, this.sceneRenderer = null, this.tileDownloader = null, this.qualityManager = null, this.model = null, this.Controller = null, this.panoRenderer = null, this.quickStart = null, this.panoramaSize = new D, this.panoramaSize.on("updatePanoSize", (function(t, e, i) {
  8617. n.panoramaSize.enable && n.emit("updatePanoSize", t, e, i)
  8618. })), this.record = null, this.playType = "heighlight", R(this.playContainer);
  8619. var r, o, a = (this.modelId, r = this.version, this.settings, (o = this.siteConf)
  8620. .type, {
  8621. modelLink: o.modelpre + r.version,
  8622. infoLink: o.infopre + r.version
  8623. });
  8624. G.url.model = a.modelLink, G.url.info = a.infoLink, G.settings = this.settings || {}, N(this.settings), this._updatePanorameSize = this._updatePanorameSize.bind(this), this._emitAngle = this._emitAngle.bind(this), this._emitFloorChange = this._emitFloorChange.bind(this), this._emitSpinnerState = this._emitSpinnerState.bind(this), this._emitFlyingEnd = this._emitFlyingEnd.bind(this), this._emitHighlightsBarChange = this._emitHighlightsBarChange.bind(this), this._emitModeChange = this._emitModeChange.bind(this), this._emitMoveState = this._emitMoveState.bind(this), this._emitUpdateTour = this._emitUpdateTour.bind(this), this._emitPanoChange = this._emitPanoChange.bind(this), this._emitPnaoChosen = this._emitPnaoChosen.bind(this), this._emitStopTour = this._emitStopTour.bind(this), this._emitLoadProgress = this._emitLoadProgress.bind(this), this._emitExitMeasureActive = this._emitExitMeasureActive.bind(this), this._emitChoosedHumanModel = this._emitChoosedHumanModel.bind(this), this._emitHumanModelIsLoaded = this._emitHumanModelIsLoaded.bind(this), this._emitAddModelListItem = this._emitAddModelListItem.bind(this), this._emitDeletePutModelSuccess = this._emitDeletePutModelSuccess.bind(this), this._emitHidePutModelInfoPanel = this._emitHidePutModelInfoPanel.bind(this), this._emitShowLoaddingOfLoadPutModel = this._emitShowLoaddingOfLoadPutModel.bind(this), this._emitHideLoaddingOfLoadPutModel = this._emitHideLoaddingOfLoadPutModel.bind(this), this._emitPutModelListLoadingIsOver = this._emitPutModelListLoadingIsOver.bind(this), this._emitResetPutModelInfo = this._emitResetPutModelInfo.bind(this), this._emitSetPutModelToolsPosition = this._emitSetPutModelToolsPosition.bind(this), this._emitHidePutModelSetTools = this._emitHidePutModelSetTools.bind(this), this._emitShowPutModelSetTools = this._emitShowPutModelSetTools.bind(this), this._emitViewModeTransitioning = this._emitViewModeTransitioning.bind(this), this._emitViewModePanorama = this._emitViewModePanorama.bind(this), this._emitShowModelListPanel = this._emitShowModelListPanel.bind(this), this._emitHideModelListPanel = this._emitHideModelListPanel.bind(this), this._emitUpdatePostilShow = this._emitUpdatePostilShow.bind(this), this._emitChoosedPostil = this._emitChoosedPostil.bind(this), this._emitAddPostilItem = this._emitAddPostilItem.bind(this), this._emitUpdatePostilUI = this._emitUpdatePostilUI.bind(this), this._emitHidePostilSetTool = this._emitHidePostilSetTool.bind(this), this._emitDeletePostilSuccess = this._emitDeletePostilSuccess.bind(this), this._emitShowDeleteDialogOfPostil = this._emitShowDeleteDialogOfPostil.bind(this), this._emitShowEditPanelOfPostil = this._emitShowEditPanelOfPostil.bind(this), this._emitShowAllPostils = this._emitShowAllPostils.bind(this), this._emitHideAllPostils = this._emitHideAllPostils.bind(this), this._emitEditConfirm = this._emitEditConfirm.bind(this), this._emitChoosedWeapon = this._emitEditProbeModel.bind(this), this._emitPutProbeModelComplete = this._emitPutProbeModelComplete.bind(this), this._emitGetMeasurementInfo = this._emitGetMeasurementInfo.bind(this), this._emitAddHumanLabel = this._emitAddHumanLabel.bind(this), this._emitChoosedVirtualCamera = this._emitChoosedVirtualCamera.bind(this), this._emitHideAllHumanLabel = this._emitHideAllHumanLabel.bind(this), this._emitAddVirtualCameraLabel = this._emitAddVirtualCameraLabel.bind(this), this._emitHideAllVirtualCameraLabel = this._emitHideAllVirtualCameraLabel.bind(this), this._emitShowVirtualCameraInfo = this._emitShowVirtualCameraInfo.bind(this), this._emitHideVirtualCameraInfo = this._emitHideVirtualCameraInfo.bind(this), this._emitHideRightTools = this._emitHideRightTools.bind(this), this._emitShowRightTools = this._emitShowRightTools.bind(this), this._emitPutModelFollowMouse = this._emitPutModelFollowMouse.bind(this), this._emitPutModelFollowMouseOver = this._emitPutModelFollowMouseOver.bind(this), this._emitPutModelFollowMouseCancel = this._emitPutModelFollowMouseCancel.bind(this), this._emitQuitPutMode = this._emitQuitPutMode.bind(this), this._emitViewModeDollhouse = this._emitViewModeDollhouse.bind(this), this._emitShowVirtualHumanInfo = this._emitShowVirtualHumanInfo.bind(this), this._emitHideVirtualHumanInfo = this._emitHideVirtualHumanInfo.bind(this), this._emitHandleControlPanoramaMove = this._emitHandleControlPanoramaMove.bind(this), this._emitHandleControlDollhouseMove = this._emitHandleControlDollhouseMove.bind(this), this._emitUpateUiRoate = this._emitUpateUiRoate.bind(this), this.registryOri()
  8625. };
  8626. function U(t, e) {}(z.prototype = Object.create(y.prototype))
  8627. .start = function(t, i) {
  8628. var u = "quickstart" === t || d.quickstart.enabled,
  8629. y = null,
  8630. C = null,
  8631. E = this;
  8632. this.loadingState = !0, this.record = new O, G.R = this.record, h.initS({
  8633. url: this.modelId,
  8634. floors: c.valueFromHash("f", !0),
  8635. autoload: !1
  8636. }, this.settings)
  8637. .then((function(t) {
  8638. return E.model = t, E.model.startup_type === P.STARTPANO && (u = !0, d.quickstart.enabled = !0), E.model.loadPanos()
  8639. }))
  8640. .then((function() {
  8641. y = g.getStartCameraOptions(E.model, E.model.panos, new n.Vector3(0, 0, 0), !0), E.sceneRenderer = function(t) {
  8642. var e = new n.PerspectiveCamera,
  8643. i = new n.Scene,
  8644. r = new n.AmbientLight(16053492, 1);
  8645. i.add(r);
  8646. var o = new n.HemisphereLight(16053492, 4473924, 1);
  8647. return i.add(o), i.skybox = new m, i.add(i.skybox), i.plane = new n.Mesh(new n.PlaneBufferGeometry(1e5, 1e5), new n.RawShaderMaterial({
  8648. side: n.DoubleSide
  8649. })), i.plane.position.y = 0, i.plane.rotateX(-Math.PI / 2), i.plane.material.visible = !1, i.add(i.plane), d.showScreenshotLocations && t.data.images.forEach((function(t) {
  8650. if (t._camera && t._camera._viewpoint) {
  8651. var e = t._camera._viewpoint,
  8652. r = new n.Mesh(new n.BoxGeometry(.3, .3, .3));
  8653. r.position.copy(e.clone()), i.add(r);
  8654. var o = t._camera._viewpoint,
  8655. a = new n.Vector3(0, 0, -1)
  8656. .applyQuaternion(o);
  8657. i.add(new n.ArrowHelper(a, e.clone(), 1, 16711680))
  8658. }
  8659. })), d.showAxis && (i.add(new n.ArrowHelper(new n.Vector3(0, 1, 0), new n.Vector3(0, 0, 0), 1, 255)), i.add(new n.ArrowHelper(new n.Vector3(0, 0, 1), new n.Vector3(0, 0, 0), 1, 16711680)), i.add(new n.ArrowHelper(new n.Vector3(1, 0, 0), new n.Vector3(0, 0, 0), 1, 65280))), new w(i, e, f)
  8660. }(E.model), C = function(t, e, i, n) {
  8661. var l = t ? 1 : 1e3,
  8662. u = new M,
  8663. h = new S({
  8664. concurrentDownloads: c.valueFromHash("tileconc", 4)
  8665. }),
  8666. d = new _,
  8667. f = new a,
  8668. m = new o,
  8669. g = new r(e),
  8670. v = new s(l),
  8671. y = new T;
  8672. return u.init(f), h.init(u), d.init(i, h, u), f.init(h, d, u), f.addModel(n), i.addComponent(p), {
  8673. qualityManager: u,
  8674. panoRenderer: d,
  8675. tileDownloader: h,
  8676. player: g,
  8677. director: m,
  8678. modelManager: f,
  8679. mattertagManager: y,
  8680. displayController: v
  8681. }
  8682. }(u, y.mode, E.sceneRenderer, E.model), E.player = C.player, E.director = C.director, E.mattertagManager = C.mattertagManager, E.tileDownloader = C.tileDownloader, E.qualityManager = C.qualityManager, E.panoRenderer = C.panoRenderer, E.record.init(E.settings.jf), E.model.supportsTiles && E.tileDownloader.start(), u && y.mode !== l.PANORAMA && (u = !1), (u || y.mode === l.PANORAMA) && y.pano && E.emit("enterPoint", y.pano.id);
  8683. var t = null;
  8684. return u && (E.quickstartManager = new x(E.qualityManager, E.sceneRenderer.scene, E.sceneRenderer.camera, E.playContainer), B(E.sceneRenderer, E.playContainer, E.model), t = E.quickstartManager.load(y)
  8685. .then((function() {
  8686. E.sceneRenderer.addComponent(E.quickstartManager), d.autoplay && (E.quickStart = E.quickstartManager.startLanding()), E.sceneRenderer.once(A.AfterRender, (function() {}))
  8687. }))), E.director.sLen = E.model.getSceneLength(), E.emit("initLoading"), E.emit("startLoading", E.model, !0, u, E.settings), e.when(t)
  8688. }))
  8689. .then((function() {
  8690. return k(E.model, E._emitLoadProgress, !u, E.progStruct)
  8691. }))
  8692. .then((function() {
  8693. var e = !1;
  8694. function r() {
  8695. var t, i;
  8696. (e = !0, function(t, e, i, n) {
  8697. var r = i.qualityManager,
  8698. o = i.panoRenderer,
  8699. a = i.tileDownloader,
  8700. s = i.modelManager,
  8701. l = i.player,
  8702. u = i.director,
  8703. h = i.mattertagManager,
  8704. c = i.displayController;
  8705. e.scene.add(t), e.qualityManager = r, t.update();
  8706. var d = {
  8707. camera: e.camera,
  8708. director: u,
  8709. modelManager: s,
  8710. tileDownloader: a,
  8711. panoRenderer: o,
  8712. qualityManager: r,
  8713. mattertagManager: h,
  8714. container: n
  8715. };
  8716. l.init(d), l.setScene(e.scene), u.init(l, s), h.init(s, l, u), c.init(u, l, s, h, n), f.bindEvents(l), e.addComponent(h), e.addComponent(t), e.addComponent(l), e.addComponent(o), e.addComponent(G.R), l.mattertagManager.updateModel()
  8717. }(E.model, E.sceneRenderer, C, E.playContainer), b.init(E.director, E.player), E.sceneRenderer.started || B(E.sceneRenderer, E.playContainer, E.model), u || E.emit("endLoading", y.mode), (t = E.player, E.model, i = y, t.start(i))
  8718. .done((function() {
  8719. if (G.conf.isNewEditVersion && window.parent && (window.parent.flag = 1), G.model.panosUV.find((function(t) {
  8720. return G.player.currentPano ? G.player.currentPano.id == t.id : null
  8721. })) && E.player.currentPano) {
  8722. var t = G.player.currentPano;
  8723. E._emitPanoChange(t, 0), E._emitModeChange(null, E.player.mode), E.player.updateWarpEnded()
  8724. }
  8725. E.director.autoTour()
  8726. })), u && (E.quickstartManager.controls.locked = !1, E.player.control.copy(E.quickstartManager.controls), E.sceneRenderer.removeComponent(E.quickstartManager), E.quickstartManager.destroy()), E.model.supportsTiles) || new v(E.model, E.player)
  8727. .start();
  8728. E.registryEvent(E.model, E.play, E.director), E.panoramaSize.init(E.player.currentPano), E._initEvent(), E.emit("endLoading", y.mode), E.settings.jf && E.settings.jf.dataset && E.settings.jf.dataset.length > 0 && E.settings.jf.enable && (E.playType = "Lecture"), E.model && E.model.steeringWheel && (E.model.steeringWheel.visible = !0), E.sceneRenderer.once(A.AfterRender, (function() {
  8729. E.loadingState = !1, E.emit("afterRender"), E.player.mode === l.PANORAMA && E.model.setEntranceState(!1), E.initMeasure(), G.startEntryPage = !0, E.settings.jf && E.settings.jf.dataset && E.settings.jf.dataset.length > 0 && E.settings.jf.enable && (E.playType = "Lecture"), E.model.steeringWheel && (E.model.steeringWheel.visible = !0)
  8730. }))
  8731. }
  8732. y = g.getStartCameraOptions(E.model, E.model.panos, E.player.position), E.model.data.player_options.show3d ? E.model.startup_type === P.STARTPANO ? y.quickstart = !0 : y.quickstart = u : y.quickstart = !0;
  8733. var o = null;
  8734. if ("guid" === t) {
  8735. var a = !1;
  8736. E.connectEvent(L, {
  8737. init: "connect_init_start",
  8738. init_done: "connect_init_done",
  8739. wait_connect: "connect_wait_connect",
  8740. user_added: "connect_uesr_added",
  8741. bussiness_busy: "connect_call_refuse",
  8742. user_connected: "connect_user_addIn",
  8743. close_connect: "connect_close",
  8744. remote_busy: "connect_remote_operate_busy",
  8745. callsuccess: "connect_call_success"
  8746. }), L.on("init_done", (function() {
  8747. o = setTimeout((function() {
  8748. u ? E.quickStart.done(r) : r(), o = null
  8749. }), 1e3)
  8750. })), L.on("operation", (function(t) {
  8751. E.emit("connect_operation", t)
  8752. })), L.on("close_connect", (function(t) {
  8753. E.emit("connect_identity_update", t)
  8754. })), L.on("identity", (function(t) {
  8755. E.emit("connect_identity_update", t)
  8756. })), L.on("changestate", (function(t) {
  8757. if (o && clearTimeout(o), !e) {
  8758. var i = function(t, e) {
  8759. for (var i = null, n = e.list, r = 0; r < n.length; r++)
  8760. if (n[r].id === t) {
  8761. i = n[r];
  8762. break
  8763. } return i
  8764. }(t.location, E.model.panos);
  8765. y.mode = t.mode, y.pano = i, "panorama" === t.mode ? (y.position = t.position, y.quaternion = (new n.Quaternion)
  8766. .copy(t.rotation)) : "dollhouse" === t.mode ? (y.floorVisibility = t.floorVisibility, y.position = t.position, y.quaternion = (new n.Quaternion)
  8767. .copy(t.rotation)) : "floorplan" === t.mode && (y.floorVisibility = t.floorVisibility, y.position = t.position, y.quaternion = (new n.Quaternion)
  8768. .copy(t.rotation), y.zoom = t.zoom), a ? r() : u ? E.quickStart.done(r) : r()
  8769. }
  8770. }));
  8771. try {
  8772. u && E.quickStart.done((function() {
  8773. a = !0
  8774. })), L.joinChannel(i, E.player.getCurrentState)
  8775. } catch (t) {
  8776. t,
  8777. u ? E.quickStart.done(r) : r()
  8778. }
  8779. } else u ? E.quickStart.done(r) : r()
  8780. }))
  8781. .fail(U.bind(this))
  8782. }, z.prototype.connectEvent = function(t, e) {
  8783. function i(t, e, i) {
  8784. t.on(e, (function() {
  8785. n.emit(i)
  8786. }))
  8787. }
  8788. var n = this;
  8789. for (var r in e) i(t, r, e[r])
  8790. }, z.prototype.registryEvent = function(t, e, i) {
  8791. var n = this;
  8792. this.model.on("floor.changed", this._emitFloorChange), this.model.on("waiting", this._emitSpinnerState), this.model.on("waiting-done", this._emitSpinnerState), this.director.on("tourStop", this._emitStopTour), this.director.on("update.controls", this._emitUpdateTour), this.player.on("PanoAnimation", this._emitPanoChange), this.player.on(C.ModeChanged, this._emitModeChange), this.player.on(C.WarpEnded, (function() {
  8793. var t = n.player.currentPano;
  8794. n._emitPanoChange(t, 0)
  8795. })), this.player.on(C.FlyingEnded, this._emitFlyingEnd), this.player.on(C.Ready, (function() {})), this.player.on(C.PanoChosen, this._emitPnaoChosen), this.player.on(C.RulersMove, this._updatePanorameSize), this.player.on(E.RulersWalk, this._updatePanorameSize), this.player.on(C.EditAddTagHighlight, this._EditAddTagHighligh), this.player.on(E.MoveHighlightsBar, this._emitHighlightsBarChange), this.player.on(E.ClickHighlightsBar, this._emitHighlightsBarChange), this.player.on("hide-right-tools", this._emitHideRightTools), this.player.on("show-right-tools", this._emitShowRightTools), this.player.on("addModelListItem", this._emitAddModelListItem), this.player.on("deletePutModelSuccess", this._emitDeletePutModelSuccess), this.player.on("hidePutModelInfoPanel", this._emitHidePutModelInfoPanel), this.player.on("showLoaddingOfLoadPutModel", this._emitShowLoaddingOfLoadPutModel), this.player.on("hideLoaddingOfLoadPutModel", this._emitHideLoaddingOfLoadPutModel), this.player.on("putModelListLoadingIsOver", this._emitPutModelListLoadingIsOver), this.player.on("resetPutModelInfo", this._emitResetPutModelInfo), this.player.on("setPutModelToolsPosition", this._emitSetPutModelToolsPosition), this.player.on("hidePutModelSetTools", this._emitHidePutModelSetTools), this.player.on("showPutModelSetTools", this._emitShowPutModelSetTools), this.player.on("viewModeTransitioning", this._emitViewModeTransitioning), this.player.on("viewModePanorama", this._emitViewModePanorama), this.player.on("showModelListPanel", this._emitShowModelListPanel), this.player.on("hideModelListPanel", this._emitHideModelListPanel), this.player.on("put-model-follow-mouse", this._emitPutModelFollowMouse), this.player.on("put-model-follow-mouse-over", this._emitPutModelFollowMouseOver), this.player.on("put-model-follow-mouse-cancel", this._emitPutModelFollowMouseCancel), this.player.on("quit-put-mode", this._emitQuitPutMode), this.player.on("view-mode-dollhouse", this._emitViewModeDollhouse), this.player.on("handle-control-panorama-move", this._emitHandleControlPanoramaMove), this.player.on("handle-control-dollhouse-move", this._emitHandleControlDollhouseMove), this.player.on("choosedHumanModel", this._emitChoosedHumanModel), this.player.on("humanModelIsLoaded", this._emitHumanModelIsLoaded), this.player.on("add-human-label", this._emitAddHumanLabel), this.player.on("hide-all-human-label", this._emitHideAllHumanLabel), this.player.on("show-virtual-human-info", this._emitShowVirtualHumanInfo), this.player.on("hide-virtual-human-info", this._emitHideVirtualHumanInfo), this.player.on("choosed-weapon", this._emitChoosedWeapon), this.player.on("putProbeModelComplete", this._emitPutProbeModelComplete), this.player.on("choosed-virtual-camera", this._emitChoosedVirtualCamera), this.player.on("add-virtual-camera-label", this._emitAddVirtualCameraLabel), this.player.on("hide-all-virtual-camera-label", this._emitHideAllVirtualCameraLabel), this.player.on("show-virtual-camera-info", this._emitShowVirtualCameraInfo), this.player.on("hide-virtual-camera-info", this._emitHideVirtualCameraInfo), this.player.on("update-ui-rotate", this._emitUpateUiRoate), this.player.on("choosed-postil", this._emitChoosedPostil), this.player.on("add-postil-item", this._emitAddPostilItem), this.player.on("update-postil-ui", this._emitUpdatePostilUI), this.player.on("hide-postil-set-tool", this._emitHidePostilSetTool), this.player.on("show-delete-dialog-of-postil", this._emitShowDeleteDialogOfPostil), this.player.on("delete-postil-success", this._emitDeletePostilSuccess), this.player.on("show-edit-panel-of-postil", this._emitShowEditPanelOfPostil), this.player.on("show-all-postils", this._emitShowAllPostils), this.player.on("hide-all-postils", this._emitHideAllPostils), this.player.on("edit-confirm", this._emitEditConfirm), this.player.on("update-postil-show", this._emitUpdatePostilShow), this.player.on("get-measurement-info", this._emitGetMeasurementInfo), this.player.on("exitMeasureActive", this._emitExitMeasureActive), this.player.controls[l.PANORAMA].on("move", this._emitMoveState), this.player.controls[l.DOLLHOUSE].on("move", this._emitMoveState), this.player.controls[l.FLOORPLAN].on("move", this._emitMoveState), this.sceneRenderer.on("compass", this._emitAngle), this.record.on("recording", (function() {})), this.record.on("readyToRecord", (function() {})), this.record.on("startRecord", (function() {})), this.record.on("stopRecord", (function() {})), this.record.on("countdown", (function(t) {})), this.record.on("stopRecordCountDown", (function(t) {}));
  8796. var r = this;
  8797. this.record.on("emity", (function() {
  8798. r._emitLectureError("emity")
  8799. })), this.record.on("loadAudio", (function() {
  8800. r._emitLectureLoadAudio("load")
  8801. })), this.record.on("loadAudioDone", (function() {
  8802. r._emitLectureLoadAudio("done")
  8803. })), this.record.on("updateView", (function(t, e) {
  8804. r._emitLectureUpdate(t, e)
  8805. })), this.record.on("housedetail", (function(t) {
  8806. r._emitLectureUI("housedetail", t)
  8807. })), this.record.on("stop", (function() {
  8808. r.emit("lecture", "stop")
  8809. })), this.mattertagManager.on("tagActiveEvent", (function(t) {
  8810. r.emit("tag.active", t)
  8811. })), this.on("afterRender", this._emitFirstRender)
  8812. }, z.prototype._emitFirstRender = function() {
  8813. var t = this.player.mode,
  8814. e = this.player.currentPano;
  8815. this._emitModeChange(null, t), this._emitFlyingEnd(null, null, e, null)
  8816. }, z.prototype._emitLectureError = function(t) {
  8817. this.emit("lectureError", t)
  8818. }, z.prototype._emitLectureLoadAudio = function(t) {
  8819. this.emit("lectureLoadaudio", t)
  8820. }, z.prototype._emitLectureUpdate = function(t, e) {
  8821. this.emit("lectureUpdate", t, e)
  8822. }, z.prototype._emitLectureUI = function(t, e) {
  8823. this.emit("lecutreUI", t, e)
  8824. }, z.prototype._updatePanorameSize = function() {
  8825. this.panoramaSize.enable && this.panoramaSize.update(this.player)
  8826. }, z.prototype._updateMeasure = function() {
  8827. this.Measure.enable && this.Measure.update(this.player)
  8828. }, z.prototype._emitAngle = function(t) {
  8829. var e = {
  8830. angle: t,
  8831. director: t
  8832. };
  8833. this.model.data.orientation_correct && (e.angle += this.model.data.orientation_correct), this.angle = e.director, this.emit("compass", e)
  8834. }, z.prototype._emitHighlightsBarChange = function(t) {
  8835. this.emit("highLightsBarChange", t, this.settings)
  8836. }, z.prototype._EditAddTagHighligh = function(t) {
  8837. G.conf.isNewEditVersion && G.sendTag("data")
  8838. }, z.prototype._emitPnaoChosen = function(t) {
  8839. this.player.mode;
  8840. this.emit("panoChosen", this.player)
  8841. }, z.prototype._emitFlyingEnd = function(t, e, i, n) {
  8842. var r = {};
  8843. if (d.delBK) {
  8844. this.model.currentFloor.floorIndex;
  8845. r.floorUrl = this.model.house_type_url
  8846. }
  8847. r.showArea = this.model.floorplan_enable, d.delBK && i && i.areaName && i.areaSize && (r.areaName = i.areaName, r.areaSize = i.areaSize), this.needsUpdateRadar && (this.needsUpdateRadar = !1, r.showRadar = !0, r.pano = i), this.player.mattertagManager.ttflying = !1, this.player.mattertagManager.updatetitletags(), this.emit("flyingEnd", r), this.player.baseControls && this.player.baseControls.onFlyEnd()
  8848. }, z.prototype._emitClickTag = function(t) {
  8849. t && this.emit("clickTag", t)
  8850. }, z.prototype._emitModeChange = function(t, e) {
  8851. this._updatePanorameSize(), "panorama" === e && (this.needsUpdateRadar = !0), this.emit("modeChange", t, e)
  8852. }, z.prototype._emitPanoChange = function(t, e) {
  8853. var i = this.model.floorplan_enable;
  8854. this.emit("panoChange", {
  8855. pano: t,
  8856. time: e,
  8857. showArea: i
  8858. })
  8859. }, z.prototype._emitStopTour = function() {
  8860. this.emit("stopTour")
  8861. }, z.prototype._emitUpdateTour = function() {
  8862. this.emit("updateTour", this.director.describe())
  8863. }, z.prototype._emitSpinnerState = function() {
  8864. var t = "stopSpinner";
  8865. this.model.waitQueue.length < 0 ? t = "stopSpinner" : this.loadingState || (t = "delayStopSpinner"), this.emit("spinner", t)
  8866. }, z.prototype._emitFloorChange = function(t, e) {
  8867. var i = this.getModelScreenSize(),
  8868. n = {
  8869. mode: e,
  8870. model: this.model,
  8871. project: i,
  8872. floorIndex: t.floorIndex,
  8873. imageUrl: "floorplan" === e ? this.model.getCurrentHouseTypeImage() : ""
  8874. };
  8875. this.model.allFloorsVisible && (n.floorIndex = "all"), this.emit("floorChange", n)
  8876. }, z.prototype._emitMoveState = function() {
  8877. (this.emit("move", this.player), this._updatePanorameSize(), this.player.postilControls && this.player.postilControls.POSTIL) && (this.player.postilControls.POSTIL.userData.follow_mouse || this.player.postilControls.destroyPostilChoosedState())
  8878. }, z.prototype._emitChoosedHumanModel = function(t) {
  8879. this.emit("choosedHumanModel", t)
  8880. }, z.prototype._emitHumanModelIsLoaded = function() {
  8881. this.emit("humanModelIsLoaded", !0)
  8882. }, z.prototype._emitAddModelListItem = function(t) {
  8883. this.emit("addModelListItem", t)
  8884. }, z.prototype._emitDeletePutModelSuccess = function(t) {
  8885. this.emit("deletePutModelSuccess", t)
  8886. }, z.prototype._emitHidePutModelInfoPanel = function() {
  8887. this.emit("hidePutModelInfoPanel")
  8888. }, z.prototype._emitShowLoaddingOfLoadPutModel = function() {
  8889. this.emit("showLoaddingOfLoadPutModel")
  8890. }, z.prototype._emitHideLoaddingOfLoadPutModel = function() {
  8891. this.emit("hideLoaddingOfLoadPutModel")
  8892. }, z.prototype._emitPutModelListLoadingIsOver = function() {
  8893. this.emit("putModelListLoadingIsOver")
  8894. }, z.prototype._emitResetPutModelInfo = function(t) {
  8895. this.emit("resetPutModelInfo", t)
  8896. }, z.prototype._emitSetPutModelToolsPosition = function(t) {
  8897. this.emit("setPutModelToolsPosition", t)
  8898. }, z.prototype._emitShowPutModelSetTools = function(t) {
  8899. this.emit("showPutModelSetTools", t)
  8900. }, z.prototype._emitViewModeTransitioning = function() {
  8901. this.emit("viewModeTransitioning")
  8902. }, z.prototype._emitViewModePanorama = function() {
  8903. this.emit("viewModePanorama")
  8904. }, z.prototype._emitHidePutModelSetTools = function() {
  8905. this.emit("hidePutModelSetTools")
  8906. }, z.prototype._emitShowModelListPanel = function() {
  8907. this.emit("showModelListPanel")
  8908. }, z.prototype._emitHideModelListPanel = function() {
  8909. this.emit("hideModelListPanel")
  8910. }, z.prototype._emitChoosedPostil = function(t) {
  8911. this.emit("choosed-postil", t)
  8912. }, z.prototype._emitAddPostilItem = function(t) {
  8913. this.emit("add-postil-item", t)
  8914. }, z.prototype._emitUpdatePostilUI = function(t) {
  8915. this.emit("update-postil-ui", t)
  8916. }, z.prototype._emitHidePostilSetTool = function() {
  8917. this.emit("hide-postil-set-tool")
  8918. }, z.prototype._emitShowDeleteDialogOfPostil = function(t) {
  8919. this.emit("show-delete-dialog-of-postil", t)
  8920. }, z.prototype._emitDeletePostilSuccess = function(t) {
  8921. this.emit("delete-postil-success", t)
  8922. }, z.prototype._emitShowEditPanelOfPostil = function() {
  8923. this.emit("show-edit-panel-of-postil")
  8924. }, z.prototype._emitShowAllPostils = function(t) {
  8925. this.emit("show-all-postils", t)
  8926. }, z.prototype._emitHideAllPostils = function(t) {
  8927. this.emit("hide-all-postils", t)
  8928. }, z.prototype._emitEditConfirm = function(t) {
  8929. this.emit("edit-confirm", t)
  8930. }, z.prototype._emitEditProbeModel = function(t) {
  8931. this.emit("edit-probe-model", t)
  8932. }, z.prototype._emitPutProbeModelComplete = function(t) {
  8933. this.emit("putProbeModelComplete", t)
  8934. }, z.prototype._emitGetMeasurementInfo = function(t) {
  8935. this.emit("get-measurement-info", t)
  8936. }, z.prototype._emitAddHumanLabel = function(t) {
  8937. this.emit("add-human-label", t)
  8938. }, z.prototype._emitChoosedVirtualCamera = function(t) {
  8939. this.emit("choosed-virtual-camera", t)
  8940. }, z.prototype._emitHideAllHumanLabel = function() {
  8941. this.emit("hide-all-human-label")
  8942. }, z.prototype._emitAddVirtualCameraLabel = function(t) {
  8943. this.emit("add-virtual-camera-label", t)
  8944. }, z.prototype._emitHideAllVirtualCameraLabel = function() {
  8945. this.emit("hide-all-virtual-camera-label")
  8946. }, z.prototype._emitShowVirtualCameraInfo = function(t) {
  8947. this.emit("show-virtual-camera-info", t)
  8948. }, z.prototype._emitHideVirtualCameraInfo = function() {
  8949. this.emit("hide-virtual-camera-info")
  8950. }, z.prototype._emitHideRightTools = function() {
  8951. this.emit("hide-right-tools")
  8952. }, z.prototype._emitShowRightTools = function() {
  8953. this.emit("show-right-tools")
  8954. }, z.prototype._emitPutModelFollowMouse = function() {
  8955. this.emit("put-model-follow-mouse")
  8956. }, z.prototype._emitPutModelFollowMouseOver = function() {
  8957. this.emit("put-model-follow-mouse-over")
  8958. }, z.prototype._emitPutModelFollowMouseCancel = function() {
  8959. this.emit("put-model-follow-mouse-cancel")
  8960. }, z.prototype._emitQuitPutMode = function() {
  8961. this.emit("quit-put-mode")
  8962. }, z.prototype._emitViewModeDollhouse = function() {
  8963. this.emit("view-mode-dollhouse")
  8964. }, z.prototype._emitShowVirtualHumanInfo = function(t) {
  8965. this.emit("show-virtual-human-info", t)
  8966. }, z.prototype._emitHideVirtualHumanInfo = function() {
  8967. this.emit("hide-virtual-human-info")
  8968. }, z.prototype._emitHandleControlPanoramaMove = function() {
  8969. this.emit("handle-control-panorama-move")
  8970. }, z.prototype._emitHandleControlDollhouseMove = function() {
  8971. this.emit("handle-control-dollhouse-move")
  8972. }, z.prototype._emitUpdatePostilShow = function(t) {
  8973. this.emit("update-postil-show", t)
  8974. }, z.prototype._initEvent = function() {
  8975. this.emit("init_UI", this.model), this.emit("load_progress", 100)
  8976. }, z.prototype._emitLoadProgress = function(t) {
  8977. this.emit("load_progress", t)
  8978. }, z.prototype._emitExitMeasureActive = function() {
  8979. this.emit("exitMeasureActive")
  8980. }, z.prototype._emitUpateUiRoate = function(t) {
  8981. this.emit("upateUiRoate", t)
  8982. }, z.prototype._registryKeyEvent = function() {
  8983. var t = this;
  8984. c.isMobile() || (document.addEventListener("keydown", (function(e) {
  8985. switch (e.which) {
  8986. case Keys.ZERO:
  8987. d.debug && t.model.toggleAlpha();
  8988. break;
  8989. case Keys.ONE:
  8990. t.player.model.has360Views && !t.player.isInMode(l.TRANSITIONING) ? t.player.isInMode(l.PANORAMA) && t.player.currentPano.isAligned() || (t.player.controls[l.PANORAMA].emit(E.InteractionKey), t.director.tourIsPlaying ? t.director.stopTour() : t.player.goToLastView(!0)) : t.player.isInMode(l.PANORAMA, l.TRANSITIONING) || t.director.changeMode(l.PANORAMA, "key");
  8991. break;
  8992. case Keys.TWO:
  8993. t.model.outsideAllowed() && !t.player.isInMode(l.DOLLHOUSE, l.TRANSITIONING) && t.director.changeMode(l.DOLLHOUSE, "key");
  8994. break;
  8995. case Keys.THREE:
  8996. t.model.outsideAllowed() && !t.player.isInMode(l.FLOORPLAN, l.TRANSITIONING) && t.director.changeMode(l.FLOORPLAN, "key");
  8997. break;
  8998. case Keys.FOUR:
  8999. t.player.model.has360Views && !t.player.isInMode(l.TRANSITIONING) && (t.player.isInMode(l.PANORAMA) && !t.player.currentPano.isAligned() || (t.player.controls[l.PANORAMA].emit(E.InteractionKey), t.director.tourIsPlaying ? t.director.stopTour() : t.player.goToLastView(!1)));
  9000. break;
  9001. case Keys.SPACE:
  9002. d.debug && t.model.toggleExplode();
  9003. break;
  9004. case Keys.RETURN:
  9005. d.debug && t.model.toggleExplodeUp();
  9006. break;
  9007. case Keys.PLUSEQUALS:
  9008. t.director.player.activatePersistentZooming(!0);
  9009. break;
  9010. case Keys.DASHUNDERSCORE:
  9011. t.director.player.activatePersistentZooming(!1);
  9012. break;
  9013. case Keys.EIGHT:
  9014. t.director.player.decreaseZoomSpeed();
  9015. break;
  9016. case Keys.NINE:
  9017. t.director.player.increaseZoomSpeed()
  9018. }
  9019. return t.player && t.player.reticule.hide(), !0
  9020. })), document.addEventListener("keyup", (function(e) {
  9021. switch (e.which) {
  9022. case Keys.PLUSEQUALS:
  9023. t.director.player.deactivatePersistentZooming();
  9024. break;
  9025. case Keys.DASHUNDERSCORE:
  9026. t.director.player.deactivatePersistentZooming()
  9027. }
  9028. })))
  9029. }, z.prototype.registryOri = function() {
  9030. G.ori = {}, c.isMobile() ? G.ori.flag = !0 : G.ori.flag = !1, G.ori.isHuawei5X = c.detectHUAWEI5X(), G.ori.gamma = -1e3, G.ori.beta = -1e3, G.ori.alpha = -1e3, G.ori.enable = !0, G.ori.orient = n.Math.degToRad(window.orientation || 0), G.orientationHandler = function(t) {
  9031. t.gamma || t.beta || (t.gamma = t.x * (180 / Math.PI), t.beta = t.y * (180 / Math.PI), t.alpha = t.z * (180 / Math.PI));
  9032. var e = t.gamma,
  9033. i = t.beta,
  9034. n = t.alpha;
  9035. t.accelerationIncludingGravity && (e = 10 * event.accelerationIncludingGravity.x, i = 10 * -event.accelerationIncludingGravity.y, n = 10 * event.accelerationIncludingGravity.z), G.ori.gamma = e, G.ori.beta = i, G.ori.alpha = n
  9036. }, G.HorientationChange = function() {
  9037. G.ori.orient = n.Math.degToRad(window.orientation || 0)
  9038. }, G.HdeviceOrientation = function(t) {
  9039. var e = n.Math.degToRad(t.alpha),
  9040. i = n.Math.degToRad(t.beta),
  9041. r = n.Math.degToRad(t.gamma);
  9042. G.ori.isHuawei5X ? (-1e3 == G.ori.alpha && (G.ori.alpha = e), -1e3 == G.ori.beta && (G.ori.beta = i), -1e3 == G.ori.gamma && (G.ori.gamma = r), Math.abs(e - G.ori.alpha) > .06 && (G.ori.alpha = e), Math.abs(i - G.ori.beta) > .006 && (G.ori.beta = i), Math.abs(r - G.ori.gamma) > .006 && (G.ori.gamma = r)) : (G.ori.alpha = e, G.ori.beta = i, G.ori.gamma = r)
  9043. }, window.addEventListener("orientationchange", G.HorientationChange), window.addEventListener("deviceorientation", G.HdeviceOrientation)
  9044. }, z.prototype.getModelScreenSize = function() {
  9045. function t(t, e) {
  9046. var i = (window.renderWidth || window.innerWidth) / 2,
  9047. r = (window.renderHeight || window.innerHeight) / 2,
  9048. o = t.project(e),
  9049. a = Math.round(o.x * i + i),
  9050. s = Math.round(-o.y * r + r);
  9051. return new n.Vector2(a, s)
  9052. }
  9053. var e = this.model.boundingBox,
  9054. i = this.player.camera,
  9055. r = new n.Vector3(e.max.x, 0, e.max.z),
  9056. o = new n.Vector3(e.min.x, 0, e.min.z),
  9057. a = new n.Vector3(e.max.x, 0, e.min.z),
  9058. s = new n.Vector3(e.min.x, 0, e.max.z),
  9059. l = t(r, i),
  9060. u = t(o, i),
  9061. h = t(a, i),
  9062. c = t(s, i),
  9063. d = Math.max(l.x, u.x, h.x, c.x),
  9064. p = Math.min(l.x, u.x, h.x, c.x),
  9065. f = Math.max(l.y, u.y, h.y, c.y),
  9066. m = Math.min(l.y, u.y, h.y, c.y);
  9067. return {
  9068. width: d - p,
  9069. height: f - m,
  9070. top: m,
  9071. left: p
  9072. }
  9073. }, z.prototype.getFloorPlanParam = function() {
  9074. var t = this.getModelScreenSize(),
  9075. e = {
  9076. model: this.model,
  9077. project: t,
  9078. floorIndex: this.model.currentFloor.floorIndex
  9079. };
  9080. return this.player.currentPano && this.player.currentPano.u && (e.radar = {
  9081. uv: {
  9082. u: this.player.currentPano.u,
  9083. v: this.player.currentPano.v
  9084. },
  9085. angle: this.lastCompassAngle
  9086. }), e
  9087. }, z.prototype.loadHumanModel = function(t) {
  9088. this.player.loadHumanModel(t)
  9089. }, z.prototype.loadProbeModel = function() {
  9090. this.player.loadProbeModel(1)
  9091. }, z.prototype.selectPutModel = function(t) {
  9092. this.player.selectPutModel(t)
  9093. }, z.prototype.updatePutModelColor = function(t) {
  9094. this.player.updatePutModelColor(t)
  9095. }, z.prototype.showPutModel = function(t) {
  9096. this.player.showPutModel(t)
  9097. }, z.prototype.hidePutModel = function(t) {
  9098. this.player.hidePutModel(t)
  9099. }, z.prototype.handleClickCompleteBtn = function() {
  9100. this.player.handleClickCompleteBtn()
  9101. }, z.prototype.removePutModel = function(t) {
  9102. this.player.removePutModel(t)
  9103. }, z.prototype.getSettingsDataOfPutModel = function() {
  9104. return JSON.stringify(this.player.SETTINGS_DATA_PUT)
  9105. }, z.prototype.updateCollision = function(t) {
  9106. this.player.updateCollision(t)
  9107. }, z.prototype.loadModelList = function(t, e) {
  9108. this.player.showModelList(t, e)
  9109. }, z.prototype.showModelList = function(t) {
  9110. this.player.showModelList(t)
  9111. }, z.prototype.hideModelList = function() {
  9112. this.player.hideModelList()
  9113. }, z.prototype.updatePutModelName = function(t) {
  9114. this.player.updatePutModelName(t)
  9115. }, z.prototype.resetPutModel = function() {
  9116. this.player.resetPutModel()
  9117. }, z.prototype.updateSizeOfPutModel = function(t) {
  9118. this.player.updateSizeOfPutModel(t)
  9119. }, z.prototype.updatePutModelGroundClearance = function(t) {
  9120. this.player.updatePutModelGroundClearance(t)
  9121. }, z.prototype.updateControlOfPutModel = function(t) {
  9122. this.player.updateControlOfPutModel(t)
  9123. }, z.prototype.showHumanModelBonesNode = function() {
  9124. this.player.showHumanModelBonesNode()
  9125. }, z.prototype.bundleTranslateControlOfPutModel = function() {
  9126. this.player.bundleTranslateControlOfPutModel()
  9127. }, z.prototype.bundleRotateControlOfPutModel = function() {
  9128. this.player.bundleRotateControlOfPutModel()
  9129. }, z.prototype.virtualSetSlideStop = function(t) {
  9130. this.player.virtualSetSlideStop(t)
  9131. }, z.prototype.handleClickModelItem = function(t) {
  9132. this.player.handleClickModelItem(t)
  9133. }, z.prototype.onIntoPutMode = function() {
  9134. this.player.onIntoPutMode()
  9135. }, z.prototype.onQuitPutMode = function() {
  9136. this.player.onQuitPutMode()
  9137. }, z.prototype.onApiQuitPutMode = function() {
  9138. this.player.onApiQuitPutMode()
  9139. }, z.prototype.onIntoEditMode = function() {
  9140. this.player.onIntoEditMode()
  9141. }, z.prototype.onQuitEditMode = function() {
  9142. this.player.onQuitEditMode()
  9143. }, z.prototype.onQuitEditMeasure = function() {
  9144. this.player.onQuitEditMeasure()
  9145. }, z.prototype.onIntoEditMeasure = function() {
  9146. this.player.onIntoEditMeasure()
  9147. }, z.prototype.loadPostilModel = function(t) {
  9148. this.player.loadPostilModel(t)
  9149. }, z.prototype.updatePostilInfo = function(t) {
  9150. this.player.updatePostilInfo(t)
  9151. }, z.prototype.loadPostilsOfSave = function(t) {
  9152. this.player.loadPostilsOfSave(t)
  9153. }, z.prototype.handleDeletePostil = function(t) {
  9154. this.player.removePostil(t)
  9155. }, z.prototype.deletePostilOfConfirm = function(t) {
  9156. this.player.deletePostilOfConfirm(t)
  9157. }, z.prototype.hidePostilsOfSave = function() {
  9158. this.player.hidePostilsOfSave()
  9159. }, z.prototype.loadCameraModel = function(t) {
  9160. this.player.loadVirtualCamera(t)
  9161. }, z.prototype.updateCameraFov = function(t) {
  9162. this.player.updateVirtualCameraFov(t)
  9163. }, z.prototype.updateCameraDistance = function(t) {
  9164. this.player.updateVirtualCameraDistance(t)
  9165. }, z.prototype.updateMiniCameraPosition = function(t) {
  9166. this.player.updateMiniCameraPosition(t)
  9167. }, z.prototype.miniCameraScreenShot = function(t) {
  9168. this.player.miniCameraScreenShot(t)
  9169. }, z.prototype.changeMode = function(t) {
  9170. if (!1 === this.model.data.player_options.show3d) return !1;
  9171. "floorplan" === t && (this.lastCompassAngle = this.angle), this.director.changeMode(t)
  9172. }, z.prototype.play = function(t) {
  9173. if (this.disablePanramaSize(), "Lecture" === this.playType) this.record.pplay(t);
  9174. else if (this.settings.nestscenes && this.settings.nestscenes.scenes && this.settings.nestscenes.scenes.length > 0) {
  9175. var e = 0;
  9176. this.model.enableTagMovie && (e = 1), G.playing = !0, this.director.currentScript = e, this.director.playTour()
  9177. }
  9178. }, z.prototype.pause = function() {
  9179. "Lecture" === this.playType ? this.record.ppause() : this.settings.nestscenes && this.settings.nestscenes.scenes && this.settings.nestscenes.scenes.length > 0 && (this.director.stopTour(), G.playing = !1)
  9180. }, z.prototype.enterVR = function() {
  9181. return "panorama" === this.player.mode && (!!c.isMobile() && (this.sceneRenderer.vrEnabled = !0, G.ori.flag = !0, !0))
  9182. }, z.prototype.exitVR = function() {
  9183. this.sceneRenderer.vrEnabled = !1, G.ori.flag = !1
  9184. }, z.prototype.gotoFloor = function(t) {
  9185. "all" === t ? this.director.allFloors() : this.director.gotoFloor(t)
  9186. }, z.prototype.mute = function() {
  9187. L.setMute(!0)
  9188. }, z.prototype.unmute = function() {
  9189. L.setMute(!1)
  9190. }, z.prototype.disableTag = function() {
  9191. this.player.mattertagManager.showtitletags = !1, this.player.mattertagManager.updatetitletags(), this.player.mattertagManager.hideAllMattertags(10, 10)
  9192. }, z.prototype.enableTag = function() {
  9193. this.player.mattertagManager.showtitletags = !0, this.player.mattertagManager.updatetitletags(), this.player.mattertagManager.showAllMattertags(10, 10)
  9194. }, z.prototype.warpToPanoByTagId = function(t) {
  9195. var e = t.tagId,
  9196. i = t.openTag,
  9197. r = this,
  9198. o = this.player.model.getTagByTagid(e),
  9199. a = this.player.model.panos.index[o.data.locationid];
  9200. if (e) {
  9201. var s = o.position.clone(),
  9202. l = new n.Matrix4;
  9203. l.lookAt(a.position, s, new n.Vector3(0, 0, -1)), a.quaternion = (new n.Quaternion)
  9204. .setFromRotationMatrix(l)
  9205. }
  9206. var u = null;
  9207. i && (u = function() {
  9208. r.openTag(o)
  9209. }), this.player.warpToPanoById(o.data.locationid, a.quaternion, null, null, "black", 1, 500, u)
  9210. }, z.prototype.openTag = function(t) {
  9211. var e = this;
  9212. setTimeout((function() {
  9213. e.player.mattertagManager.openTag(t)
  9214. }), 1e3)
  9215. }, z.prototype.disablePanramaSize = function() {
  9216. this.panoramaSize.setEnable(!1)
  9217. }, z.prototype.enablePanramaSize = function() {
  9218. this.panoramaSize.setEnable(!0), this.panoramaSize.update(this.player)
  9219. }, z.prototype.initMeasure = function() {
  9220. this.player.initMeasure()
  9221. }, z.prototype.enableMeasure = function(t) {
  9222. this.player.setMeasureEnable(t)
  9223. }, z.prototype.manipulateMeasure = function(t, e, i) {
  9224. switch (t) {
  9225. case "show":
  9226. this.player.showMeasure(e);
  9227. break;
  9228. case "hide":
  9229. this.player.hideMeasure(e);
  9230. break;
  9231. case "showAll":
  9232. this.player.showAllMeasure();
  9233. break;
  9234. case "hideAll":
  9235. this.player.hideAllMeasure();
  9236. break;
  9237. case "delete":
  9238. this.player.deleteMeasure(e);
  9239. break;
  9240. case "changeName":
  9241. this.player.changeMeasureName(e, i);
  9242. break;
  9243. case "changeUnit":
  9244. this.player.changeUnit(e);
  9245. break;
  9246. case "clicked":
  9247. this.player.clickedOnMeasure(e);
  9248. break;
  9249. case "disClicked":
  9250. this.player.disOnMeasure(e);
  9251. break;
  9252. case "setAutoFit":
  9253. this.player.setAutoFit(e);
  9254. break;
  9255. case "setMeasureArea":
  9256. this.player.setMeasureArea(e)
  9257. }
  9258. }, z.prototype.gotoScenebyId = function(t) {
  9259. this.director.goToHighlight(t)
  9260. }, z.prototype.getCurrentState = function() {
  9261. return {
  9262. panoSize: this.panoramaSize.enable
  9263. }
  9264. }, z.prototype.setPlaySpeed = function(t) {
  9265. var e = "";
  9266. switch (t) {
  9267. case 1:
  9268. e = "0.3x";
  9269. break;
  9270. case 2:
  9271. e = "0.5x";
  9272. break;
  9273. case 3:
  9274. e = "1.0x";
  9275. break;
  9276. case 4:
  9277. e = "1.5x";
  9278. break;
  9279. case 5:
  9280. e = "2.0x";
  9281. break;
  9282. default:
  9283. e = "1.0x"
  9284. }
  9285. this.player.setSpeedMultiplier(e)
  9286. }, z.prototype.screenshot = function(t) {
  9287. var e = this,
  9288. i = this.player.reticule;
  9289. i.hidden = !0, i.material.uniforms.opacity.value = 0, this.model.panos.list.forEach((function(t) {
  9290. t.marker && (t.marker.material.opacity = 0)
  9291. })), setTimeout((function() {
  9292. var i = document.getElementsByTagName("canvas")[0],
  9293. n = document.createElement("canvas");
  9294. n.width = i.width, n.height = i.height;
  9295. var r = n.getContext("2d");
  9296. r.drawImage(i, 0, 0, i.width, i.height), r.scale(.5, .5), t({
  9297. img: n.toDataURL("image/png"),
  9298. location: e.player.currentPano.id,
  9299. position: {
  9300. x: e.player.camera.quaternion.x,
  9301. y: e.player.camera.quaternion.y,
  9302. z: e.player.camera.quaternion.z,
  9303. w: e.player.camera.quaternion.w
  9304. }
  9305. }), e.model.panos.list.forEach((function(t) {
  9306. t.marker && (t.marker.material.opacity = 1)
  9307. }))
  9308. }), 1e3)
  9309. }, z.prototype.gotoScene = function(t) {
  9310. var e = {},
  9311. i = t.position,
  9312. r = t.location,
  9313. o = this.model.panos.index[r];
  9314. e.pano = o;
  9315. var a = new n.Vector3(0, 0, -1);
  9316. a.applyQuaternion(i), a.add(o.position), e.lookAtPoint = a, this.player.flyToPano(e)
  9317. }, z.prototype.addModel = function(t) {
  9318. this.player.addModel(t)
  9319. }, z.prototype.setModelPose = function(t) {
  9320. this.player.addModel(t)
  9321. }, t.exports = z
  9322. })
  9323. .call(this, i(6))
  9324. }, function(t, e, i) {
  9325. ! function(t) {
  9326. "use strict";
  9327. function e(t) {
  9328. return "0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)
  9329. }
  9330. function i(t, e) {
  9331. return t & e
  9332. }
  9333. function n(t, e) {
  9334. return t | e
  9335. }
  9336. function r(t, e) {
  9337. return t ^ e
  9338. }
  9339. function o(t, e) {
  9340. return t & ~e
  9341. }
  9342. function a(t) {
  9343. if (0 == t) return -1;
  9344. var e = 0;
  9345. return 0 == (65535 & t) && (t >>= 16, e += 16), 0 == (255 & t) && (t >>= 8, e += 8), 0 == (15 & t) && (t >>= 4, e += 4), 0 == (3 & t) && (t >>= 2, e += 2), 0 == (1 & t) && ++e, e
  9346. }
  9347. function s(t) {
  9348. for (var e = 0; 0 != t;) t &= t - 1, ++e;
  9349. return e
  9350. }
  9351. var l = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  9352. function u(t) {
  9353. var e, i, n = "";
  9354. for (e = 0; e + 3 <= t.length; e += 3) i = parseInt(t.substring(e, e + 3), 16), n += l.charAt(i >> 6) + l.charAt(63 & i);
  9355. for (e + 1 == t.length ? (i = parseInt(t.substring(e, e + 1), 16), n += l.charAt(i << 2)) : e + 2 == t.length && (i = parseInt(t.substring(e, e + 2), 16), n += l.charAt(i >> 2) + l.charAt((3 & i) << 4));
  9356. (3 & n.length) > 0;) n += "=";
  9357. return n
  9358. }
  9359. function h(t) {
  9360. var i, n = "",
  9361. r = 0,
  9362. o = 0;
  9363. for (i = 0; i < t.length && "=" != t.charAt(i); ++i) {
  9364. var a = l.indexOf(t.charAt(i));
  9365. a < 0 || (0 == r ? (n += e(a >> 2), o = 3 & a, r = 1) : 1 == r ? (n += e(o << 2 | a >> 4), o = 15 & a, r = 2) : 2 == r ? (n += e(o), n += e(a >> 2), o = 3 & a, r = 3) : (n += e(o << 2 | a >> 4), n += e(15 & a), r = 0))
  9366. }
  9367. return 1 == r && (n += e(o << 2)), n
  9368. }
  9369. var c, d, p = function(t, e) {
  9370. return (p = Object.setPrototypeOf || {
  9371. __proto__: []
  9372. }
  9373. instanceof Array && function(t, e) {
  9374. t.__proto__ = e
  9375. } || function(t, e) {
  9376. for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i])
  9377. })(t, e)
  9378. },
  9379. f = function(t) {
  9380. var e;
  9381. if (void 0 === c) {
  9382. var i = "0123456789ABCDEF";
  9383. for (c = {}, e = 0; e < 16; ++e) c[i.charAt(e)] = e;
  9384. for (i = i.toLowerCase(), e = 10; e < 16; ++e) c[i.charAt(e)] = e;
  9385. for (e = 0; e < " \f\n\r\t \u2028\u2029".length; ++e) c[" \f\n\r\t \u2028\u2029".charAt(e)] = -1
  9386. }
  9387. var n = [],
  9388. r = 0,
  9389. o = 0;
  9390. for (e = 0; e < t.length; ++e) {
  9391. var a = t.charAt(e);
  9392. if ("=" == a) break;
  9393. if (-1 != (a = c[a])) {
  9394. if (void 0 === a) throw new Error("Illegal character at offset " + e);
  9395. r |= a, ++o >= 2 ? (n[n.length] = r, r = 0, o = 0) : r <<= 4
  9396. }
  9397. }
  9398. if (o) throw new Error("Hex encoding incomplete: 4 bits missing");
  9399. return n
  9400. },
  9401. m = {
  9402. decode: function(t) {
  9403. var e;
  9404. if (void 0 === d) {
  9405. for (d = Object.create(null), e = 0; e < 64; ++e) d["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)] = e;
  9406. for (e = 0; e < "= \f\n\r\t \u2028\u2029".length; ++e) d["= \f\n\r\t \u2028\u2029".charAt(e)] = -1
  9407. }
  9408. var i = [],
  9409. n = 0,
  9410. r = 0;
  9411. for (e = 0; e < t.length; ++e) {
  9412. var o = t.charAt(e);
  9413. if ("=" == o) break;
  9414. if (-1 != (o = d[o])) {
  9415. if (void 0 === o) throw new Error("Illegal character at offset " + e);
  9416. n |= o, ++r >= 4 ? (i[i.length] = n >> 16, i[i.length] = n >> 8 & 255, i[i.length] = 255 & n, n = 0, r = 0) : n <<= 6
  9417. }
  9418. }
  9419. switch (r) {
  9420. case 1:
  9421. throw new Error("Base64 encoding incomplete: at least 2 bits missing");
  9422. case 2:
  9423. i[i.length] = n >> 10;
  9424. break;
  9425. case 3:
  9426. i[i.length] = n >> 16, i[i.length] = n >> 8 & 255
  9427. }
  9428. return i
  9429. },
  9430. re: /-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,
  9431. unarmor: function(t) {
  9432. var e = m.re.exec(t);
  9433. if (e)
  9434. if (e[1]) t = e[1];
  9435. else {
  9436. if (!e[2]) throw new Error("RegExp out of sync");
  9437. t = e[2]
  9438. } return m.decode(t)
  9439. }
  9440. },
  9441. g = 1e13,
  9442. v = function() {
  9443. function t(t) {
  9444. this.buf = [+t || 0]
  9445. }
  9446. return t.prototype.mulAdd = function(t, e) {
  9447. var i, n, r = this.buf,
  9448. o = r.length;
  9449. for (i = 0; i < o; ++i)(n = r[i] * t + e) < g ? e = 0 : n -= (e = 0 | n / g) * g, r[i] = n;
  9450. e > 0 && (r[i] = e)
  9451. }, t.prototype.sub = function(t) {
  9452. var e, i, n = this.buf,
  9453. r = n.length;
  9454. for (e = 0; e < r; ++e)(i = n[e] - t) < 0 ? (i += g, t = 1) : t = 0, n[e] = i;
  9455. for (; 0 === n[n.length - 1];) n.pop()
  9456. }, t.prototype.toString = function(t) {
  9457. if (10 != (t || 10)) throw new Error("only base 10 is supported");
  9458. for (var e = this.buf, i = e[e.length - 1].toString(), n = e.length - 2; n >= 0; --n) i += (g + e[n])
  9459. .toString()
  9460. .substring(1);
  9461. return i
  9462. }, t.prototype.valueOf = function() {
  9463. for (var t = this.buf, e = 0, i = t.length - 1; i >= 0; --i) e = e * g + t[i];
  9464. return e
  9465. }, t.prototype.simplify = function() {
  9466. var t = this.buf;
  9467. return 1 == t.length ? t[0] : this
  9468. }, t
  9469. }(),
  9470. y = /^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,
  9471. b = /^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;
  9472. function w(t, e) {
  9473. return t.length > e && (t = t.substring(0, e) + "…"), t
  9474. }
  9475. var x, M = function() {
  9476. function t(e, i) {
  9477. this.hexDigits = "0123456789ABCDEF", e instanceof t ? (this.enc = e.enc, this.pos = e.pos) : (this.enc = e, this.pos = i)
  9478. }
  9479. return t.prototype.get = function(t) {
  9480. if (void 0 === t && (t = this.pos++), t >= this.enc.length) throw new Error("Requesting byte offset " + t + " on a stream of length " + this.enc.length);
  9481. return "string" == typeof this.enc ? this.enc.charCodeAt(t) : this.enc[t]
  9482. }, t.prototype.hexByte = function(t) {
  9483. return this.hexDigits.charAt(t >> 4 & 15) + this.hexDigits.charAt(15 & t)
  9484. }, t.prototype.hexDump = function(t, e, i) {
  9485. for (var n = "", r = t; r < e; ++r)
  9486. if (n += this.hexByte(this.get(r)), !0 !== i) switch (15 & r) {
  9487. case 7:
  9488. n += " ";
  9489. break;
  9490. case 15:
  9491. n += "\n";
  9492. break;
  9493. default:
  9494. n += " "
  9495. }
  9496. return n
  9497. }, t.prototype.isASCII = function(t, e) {
  9498. for (var i = t; i < e; ++i) {
  9499. var n = this.get(i);
  9500. if (n < 32 || n > 176) return !1
  9501. }
  9502. return !0
  9503. }, t.prototype.parseStringISO = function(t, e) {
  9504. for (var i = "", n = t; n < e; ++n) i += String.fromCharCode(this.get(n));
  9505. return i
  9506. }, t.prototype.parseStringUTF = function(t, e) {
  9507. for (var i = "", n = t; n < e;) {
  9508. var r = this.get(n++);
  9509. i += r < 128 ? String.fromCharCode(r) : r > 191 && r < 224 ? String.fromCharCode((31 & r) << 6 | 63 & this.get(n++)) : String.fromCharCode((15 & r) << 12 | (63 & this.get(n++)) << 6 | 63 & this.get(n++))
  9510. }
  9511. return i
  9512. }, t.prototype.parseStringBMP = function(t, e) {
  9513. for (var i, n, r = "", o = t; o < e;) i = this.get(o++), n = this.get(o++), r += String.fromCharCode(i << 8 | n);
  9514. return r
  9515. }, t.prototype.parseTime = function(t, e, i) {
  9516. var n = this.parseStringISO(t, e),
  9517. r = (i ? y : b)
  9518. .exec(n);
  9519. return r ? (i && (r[1] = +r[1], r[1] += +r[1] < 70 ? 2e3 : 1900), n = r[1] + "-" + r[2] + "-" + r[3] + " " + r[4], r[5] && (n += ":" + r[5], r[6] && (n += ":" + r[6], r[7] && (n += "." + r[7]))), r[8] && (n += " UTC", "Z" != r[8] && (n += r[8], r[9] && (n += ":" + r[9]))), n) : "Unrecognized time: " + n
  9520. }, t.prototype.parseInteger = function(t, e) {
  9521. for (var i, n = this.get(t), r = n > 127, o = r ? 255 : 0, a = ""; n == o && ++t < e;) n = this.get(t);
  9522. if (0 == (i = e - t)) return r ? -1 : 0;
  9523. if (i > 4) {
  9524. for (a = n, i <<= 3; 0 == (128 & (+a ^ o));) a = +a << 1, --i;
  9525. a = "(" + i + " bit)\n"
  9526. }
  9527. r && (n -= 256);
  9528. for (var s = new v(n), l = t + 1; l < e; ++l) s.mulAdd(256, this.get(l));
  9529. return a + s.toString()
  9530. }, t.prototype.parseBitString = function(t, e, i) {
  9531. for (var n = this.get(t), r = "(" + ((e - t - 1 << 3) - n) + " bit)\n", o = "", a = t + 1; a < e; ++a) {
  9532. for (var s = this.get(a), l = a == e - 1 ? n : 0, u = 7; u >= l; --u) o += s >> u & 1 ? "1" : "0";
  9533. if (o.length > i) return r + w(o, i)
  9534. }
  9535. return r + o
  9536. }, t.prototype.parseOctetString = function(t, e, i) {
  9537. if (this.isASCII(t, e)) return w(this.parseStringISO(t, e), i);
  9538. var n = e - t,
  9539. r = "(" + n + " byte)\n";
  9540. n > (i /= 2) && (e = t + i);
  9541. for (var o = t; o < e; ++o) r += this.hexByte(this.get(o));
  9542. return n > i && (r += "…"), r
  9543. }, t.prototype.parseOID = function(t, e, i) {
  9544. for (var n = "", r = new v, o = 0, a = t; a < e; ++a) {
  9545. var s = this.get(a);
  9546. if (r.mulAdd(128, 127 & s), o += 7, !(128 & s)) {
  9547. if ("" === n)
  9548. if ((r = r.simplify()) instanceof v) r.sub(80), n = "2." + r.toString();
  9549. else {
  9550. var l = r < 80 ? r < 40 ? 0 : 1 : 2;
  9551. n = l + "." + (r - 40 * l)
  9552. }
  9553. else n += "." + r.toString();
  9554. if (n.length > i) return w(n, i);
  9555. r = new v, o = 0
  9556. }
  9557. }
  9558. return o > 0 && (n += ".incomplete"), n
  9559. }, t
  9560. }(),
  9561. T = function() {
  9562. function t(t, e, i, n, r) {
  9563. if (!(n instanceof S)) throw new Error("Invalid tag value.");
  9564. this.stream = t, this.header = e, this.length = i, this.tag = n, this.sub = r
  9565. }
  9566. return t.prototype.typeName = function() {
  9567. switch (this.tag.tagClass) {
  9568. case 0:
  9569. switch (this.tag.tagNumber) {
  9570. case 0:
  9571. return "EOC";
  9572. case 1:
  9573. return "BOOLEAN";
  9574. case 2:
  9575. return "INTEGER";
  9576. case 3:
  9577. return "BIT_STRING";
  9578. case 4:
  9579. return "OCTET_STRING";
  9580. case 5:
  9581. return "NULL";
  9582. case 6:
  9583. return "OBJECT_IDENTIFIER";
  9584. case 7:
  9585. return "ObjectDescriptor";
  9586. case 8:
  9587. return "EXTERNAL";
  9588. case 9:
  9589. return "REAL";
  9590. case 10:
  9591. return "ENUMERATED";
  9592. case 11:
  9593. return "EMBEDDED_PDV";
  9594. case 12:
  9595. return "UTF8String";
  9596. case 16:
  9597. return "SEQUENCE";
  9598. case 17:
  9599. return "SET";
  9600. case 18:
  9601. return "NumericString";
  9602. case 19:
  9603. return "PrintableString";
  9604. case 20:
  9605. return "TeletexString";
  9606. case 21:
  9607. return "VideotexString";
  9608. case 22:
  9609. return "IA5String";
  9610. case 23:
  9611. return "UTCTime";
  9612. case 24:
  9613. return "GeneralizedTime";
  9614. case 25:
  9615. return "GraphicString";
  9616. case 26:
  9617. return "VisibleString";
  9618. case 27:
  9619. return "GeneralString";
  9620. case 28:
  9621. return "UniversalString";
  9622. case 30:
  9623. return "BMPString"
  9624. }
  9625. return "Universal_" + this.tag.tagNumber.toString();
  9626. case 1:
  9627. return "Application_" + this.tag.tagNumber.toString();
  9628. case 2:
  9629. return "[" + this.tag.tagNumber.toString() + "]";
  9630. case 3:
  9631. return "Private_" + this.tag.tagNumber.toString()
  9632. }
  9633. }, t.prototype.content = function(t) {
  9634. if (void 0 === this.tag) return null;
  9635. void 0 === t && (t = 1 / 0);
  9636. var e = this.posContent(),
  9637. i = Math.abs(this.length);
  9638. if (!this.tag.isUniversal()) return null !== this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(e, e + i, t);
  9639. switch (this.tag.tagNumber) {
  9640. case 1:
  9641. return 0 === this.stream.get(e) ? "false" : "true";
  9642. case 2:
  9643. return this.stream.parseInteger(e, e + i);
  9644. case 3:
  9645. return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseBitString(e, e + i, t);
  9646. case 4:
  9647. return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(e, e + i, t);
  9648. case 6:
  9649. return this.stream.parseOID(e, e + i, t);
  9650. case 16:
  9651. case 17:
  9652. return null !== this.sub ? "(" + this.sub.length + " elem)" : "(no elem)";
  9653. case 12:
  9654. return w(this.stream.parseStringUTF(e, e + i), t);
  9655. case 18:
  9656. case 19:
  9657. case 20:
  9658. case 21:
  9659. case 22:
  9660. case 26:
  9661. return w(this.stream.parseStringISO(e, e + i), t);
  9662. case 30:
  9663. return w(this.stream.parseStringBMP(e, e + i), t);
  9664. case 23:
  9665. case 24:
  9666. return this.stream.parseTime(e, e + i, 23 == this.tag.tagNumber)
  9667. }
  9668. return null
  9669. }, t.prototype.toString = function() {
  9670. return this.typeName() + "@" + this.stream.pos + "[header:" + this.header + ",length:" + this.length + ",sub:" + (null === this.sub ? "null" : this.sub.length) + "]"
  9671. }, t.prototype.toPrettyString = function(t) {
  9672. void 0 === t && (t = "");
  9673. var e = t + this.typeName() + " @" + this.stream.pos;
  9674. if (this.length >= 0 && (e += "+"), e += this.length, this.tag.tagConstructed ? e += " (constructed)" : !this.tag.isUniversal() || 3 != this.tag.tagNumber && 4 != this.tag.tagNumber || null === this.sub || (e += " (encapsulates)"), e += "\n", null !== this.sub) {
  9675. t += " ";
  9676. for (var i = 0, n = this.sub.length; i < n; ++i) e += this.sub[i].toPrettyString(t)
  9677. }
  9678. return e
  9679. }, t.prototype.posStart = function() {
  9680. return this.stream.pos
  9681. }, t.prototype.posContent = function() {
  9682. return this.stream.pos + this.header
  9683. }, t.prototype.posEnd = function() {
  9684. return this.stream.pos + this.header + Math.abs(this.length)
  9685. }, t.prototype.toHexString = function() {
  9686. return this.stream.hexDump(this.posStart(), this.posEnd(), !0)
  9687. }, t.decodeLength = function(t) {
  9688. var e = t.get(),
  9689. i = 127 & e;
  9690. if (i == e) return i;
  9691. if (i > 6) throw new Error("Length over 48 bits not supported at position " + (t.pos - 1));
  9692. if (0 === i) return null;
  9693. e = 0;
  9694. for (var n = 0; n < i; ++n) e = 256 * e + t.get();
  9695. return e
  9696. }, t.prototype.getHexStringValue = function() {
  9697. var t = this.toHexString(),
  9698. e = 2 * this.header,
  9699. i = 2 * this.length;
  9700. return t.substr(e, i)
  9701. }, t.decode = function(e) {
  9702. var i;
  9703. i = e instanceof M ? e : new M(e, 0);
  9704. var n = new M(i),
  9705. r = new S(i),
  9706. o = t.decodeLength(i),
  9707. a = i.pos,
  9708. s = a - n.pos,
  9709. l = null,
  9710. u = function() {
  9711. var e = [];
  9712. if (null !== o) {
  9713. for (var n = a + o; i.pos < n;) e[e.length] = t.decode(i);
  9714. if (i.pos != n) throw new Error("Content size is not correct for container starting at offset " + a)
  9715. } else try {
  9716. for (;;) {
  9717. var r = t.decode(i);
  9718. if (r.tag.isEOC()) break;
  9719. e[e.length] = r
  9720. }
  9721. o = a - i.pos
  9722. } catch (t) {
  9723. throw new Error("Exception while decoding undefined length content: " + t)
  9724. }
  9725. return e
  9726. };
  9727. if (r.tagConstructed) l = u();
  9728. else if (r.isUniversal() && (3 == r.tagNumber || 4 == r.tagNumber)) try {
  9729. if (3 == r.tagNumber && 0 != i.get()) throw new Error("BIT STRINGs with unused bits cannot encapsulate.");
  9730. l = u();
  9731. for (var h = 0; h < l.length; ++h)
  9732. if (l[h].tag.isEOC()) throw new Error("EOC is not supposed to be actual content.")
  9733. } catch (t) {
  9734. l = null
  9735. }
  9736. if (null === l) {
  9737. if (null === o) throw new Error("We can't skip over an invalid tag with undefined length at offset " + a);
  9738. i.pos = a + Math.abs(o)
  9739. }
  9740. return new t(n, s, o, r, l)
  9741. }, t
  9742. }(),
  9743. S = function() {
  9744. function t(t) {
  9745. var e = t.get();
  9746. if (this.tagClass = e >> 6, this.tagConstructed = 0 != (32 & e), this.tagNumber = 31 & e, 31 == this.tagNumber) {
  9747. var i = new v;
  9748. do {
  9749. e = t.get(), i.mulAdd(128, 127 & e)
  9750. } while (128 & e);
  9751. this.tagNumber = i.simplify()
  9752. }
  9753. }
  9754. return t.prototype.isUniversal = function() {
  9755. return 0 === this.tagClass
  9756. }, t.prototype.isEOC = function() {
  9757. return 0 === this.tagClass && 0 === this.tagNumber
  9758. }, t
  9759. }(),
  9760. _ = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997],
  9761. A = (1 << 26) / _[_.length - 1],
  9762. P = function() {
  9763. function t(t, e, i) {
  9764. null != t && ("number" == typeof t ? this.fromNumber(t, e, i) : null == e && "string" != typeof t ? this.fromString(t, 256) : this.fromString(t, e))
  9765. }
  9766. return t.prototype.toString = function(t) {
  9767. if (this.s < 0) return "-" + this.negate()
  9768. .toString(t);
  9769. var i;
  9770. if (16 == t) i = 4;
  9771. else if (8 == t) i = 3;
  9772. else if (2 == t) i = 1;
  9773. else if (32 == t) i = 5;
  9774. else {
  9775. if (4 != t) return this.toRadix(t);
  9776. i = 2
  9777. }
  9778. var n, r = (1 << i) - 1,
  9779. o = !1,
  9780. a = "",
  9781. s = this.t,
  9782. l = this.DB - s * this.DB % i;
  9783. if (s-- > 0)
  9784. for (l < this.DB && (n = this[s] >> l) > 0 && (o = !0, a = e(n)); s >= 0;) l < i ? (n = (this[s] & (1 << l) - 1) << i - l, n |= this[--s] >> (l += this.DB - i)) : (n = this[s] >> (l -= i) & r, l <= 0 && (l += this.DB, --s)), n > 0 && (o = !0), o && (a += e(n));
  9785. return o ? a : "0"
  9786. }, t.prototype.negate = function() {
  9787. var e = O();
  9788. return t.ZERO.subTo(this, e), e
  9789. }, t.prototype.abs = function() {
  9790. return this.s < 0 ? this.negate() : this
  9791. }, t.prototype.compareTo = function(t) {
  9792. var e = this.s - t.s;
  9793. if (0 != e) return e;
  9794. var i = this.t;
  9795. if (0 != (e = i - t.t)) return this.s < 0 ? -e : e;
  9796. for (; --i >= 0;)
  9797. if (0 != (e = this[i] - t[i])) return e;
  9798. return 0
  9799. }, t.prototype.bitLength = function() {
  9800. return this.t <= 0 ? 0 : this.DB * (this.t - 1) + z(this[this.t - 1] ^ this.s & this.DM)
  9801. }, t.prototype.mod = function(e) {
  9802. var i = O();
  9803. return this.abs()
  9804. .divRemTo(e, null, i), this.s < 0 && i.compareTo(t.ZERO) > 0 && e.subTo(i, i), i
  9805. }, t.prototype.modPowInt = function(t, e) {
  9806. var i;
  9807. return i = t < 256 || e.isEven() ? new E(e) : new D(e), this.exp(t, i)
  9808. }, t.prototype.clone = function() {
  9809. var t = O();
  9810. return this.copyTo(t), t
  9811. }, t.prototype.intValue = function() {
  9812. if (this.s < 0) {
  9813. if (1 == this.t) return this[0] - this.DV;
  9814. if (0 == this.t) return -1
  9815. } else {
  9816. if (1 == this.t) return this[0];
  9817. if (0 == this.t) return 0
  9818. }
  9819. return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0]
  9820. }, t.prototype.byteValue = function() {
  9821. return 0 == this.t ? this.s : this[0] << 24 >> 24
  9822. }, t.prototype.shortValue = function() {
  9823. return 0 == this.t ? this.s : this[0] << 16 >> 16
  9824. }, t.prototype.signum = function() {
  9825. return this.s < 0 ? -1 : this.t <= 0 || 1 == this.t && this[0] <= 0 ? 0 : 1
  9826. }, t.prototype.toByteArray = function() {
  9827. var t = this.t,
  9828. e = [];
  9829. e[0] = this.s;
  9830. var i, n = this.DB - t * this.DB % 8,
  9831. r = 0;
  9832. if (t-- > 0)
  9833. for (n < this.DB && (i = this[t] >> n) != (this.s & this.DM) >> n && (e[r++] = i | this.s << this.DB - n); t >= 0;) n < 8 ? (i = (this[t] & (1 << n) - 1) << 8 - n, i |= this[--t] >> (n += this.DB - 8)) : (i = this[t] >> (n -= 8) & 255, n <= 0 && (n += this.DB, --t)), 0 != (128 & i) && (i |= -256), 0 == r && (128 & this.s) != (128 & i) && ++r, (r > 0 || i != this.s) && (e[r++] = i);
  9834. return e
  9835. }, t.prototype.equals = function(t) {
  9836. return 0 == this.compareTo(t)
  9837. }, t.prototype.min = function(t) {
  9838. return this.compareTo(t) < 0 ? this : t
  9839. }, t.prototype.max = function(t) {
  9840. return this.compareTo(t) > 0 ? this : t
  9841. }, t.prototype.and = function(t) {
  9842. var e = O();
  9843. return this.bitwiseTo(t, i, e), e
  9844. }, t.prototype.or = function(t) {
  9845. var e = O();
  9846. return this.bitwiseTo(t, n, e), e
  9847. }, t.prototype.xor = function(t) {
  9848. var e = O();
  9849. return this.bitwiseTo(t, r, e), e
  9850. }, t.prototype.andNot = function(t) {
  9851. var e = O();
  9852. return this.bitwiseTo(t, o, e), e
  9853. }, t.prototype.not = function() {
  9854. for (var t = O(), e = 0; e < this.t; ++e) t[e] = this.DM & ~this[e];
  9855. return t.t = this.t, t.s = ~this.s, t
  9856. }, t.prototype.shiftLeft = function(t) {
  9857. var e = O();
  9858. return t < 0 ? this.rShiftTo(-t, e) : this.lShiftTo(t, e), e
  9859. }, t.prototype.shiftRight = function(t) {
  9860. var e = O();
  9861. return t < 0 ? this.lShiftTo(-t, e) : this.rShiftTo(t, e), e
  9862. }, t.prototype.getLowestSetBit = function() {
  9863. for (var t = 0; t < this.t; ++t)
  9864. if (0 != this[t]) return t * this.DB + a(this[t]);
  9865. return this.s < 0 ? this.t * this.DB : -1
  9866. }, t.prototype.bitCount = function() {
  9867. for (var t = 0, e = this.s & this.DM, i = 0; i < this.t; ++i) t += s(this[i] ^ e);
  9868. return t
  9869. }, t.prototype.testBit = function(t) {
  9870. var e = Math.floor(t / this.DB);
  9871. return e >= this.t ? 0 != this.s : 0 != (this[e] & 1 << t % this.DB)
  9872. }, t.prototype.setBit = function(t) {
  9873. return this.changeBit(t, n)
  9874. }, t.prototype.clearBit = function(t) {
  9875. return this.changeBit(t, o)
  9876. }, t.prototype.flipBit = function(t) {
  9877. return this.changeBit(t, r)
  9878. }, t.prototype.add = function(t) {
  9879. var e = O();
  9880. return this.addTo(t, e), e
  9881. }, t.prototype.subtract = function(t) {
  9882. var e = O();
  9883. return this.subTo(t, e), e
  9884. }, t.prototype.multiply = function(t) {
  9885. var e = O();
  9886. return this.multiplyTo(t, e), e
  9887. }, t.prototype.divide = function(t) {
  9888. var e = O();
  9889. return this.divRemTo(t, e, null), e
  9890. }, t.prototype.remainder = function(t) {
  9891. var e = O();
  9892. return this.divRemTo(t, null, e), e
  9893. }, t.prototype.divideAndRemainder = function(t) {
  9894. var e = O(),
  9895. i = O();
  9896. return this.divRemTo(t, e, i), [e, i]
  9897. }, t.prototype.modPow = function(t, e) {
  9898. var i, n, r = t.bitLength(),
  9899. o = B(1);
  9900. if (r <= 0) return o;
  9901. i = r < 18 ? 1 : r < 48 ? 3 : r < 144 ? 4 : r < 768 ? 5 : 6, n = r < 8 ? new E(e) : e.isEven() ? new L(e) : new D(e);
  9902. var a = [],
  9903. s = 3,
  9904. l = i - 1,
  9905. u = (1 << i) - 1;
  9906. if (a[1] = n.convert(this), i > 1) {
  9907. var h = O();
  9908. for (n.sqrTo(a[1], h); s <= u;) a[s] = O(), n.mulTo(h, a[s - 2], a[s]), s += 2
  9909. }
  9910. var c, d, p = t.t - 1,
  9911. f = !0,
  9912. m = O();
  9913. for (r = z(t[p]) - 1; p >= 0;) {
  9914. for (r >= l ? c = t[p] >> r - l & u : (c = (t[p] & (1 << r + 1) - 1) << l - r, p > 0 && (c |= t[p - 1] >> this.DB + r - l)), s = i; 0 == (1 & c);) c >>= 1, --s;
  9915. if ((r -= s) < 0 && (r += this.DB, --p), f) a[c].copyTo(o), f = !1;
  9916. else {
  9917. for (; s > 1;) n.sqrTo(o, m), n.sqrTo(m, o), s -= 2;
  9918. s > 0 ? n.sqrTo(o, m) : (d = o, o = m, m = d), n.mulTo(m, a[c], o)
  9919. }
  9920. for (; p >= 0 && 0 == (t[p] & 1 << r);) n.sqrTo(o, m), d = o, o = m, m = d, --r < 0 && (r = this.DB - 1, --p)
  9921. }
  9922. return n.revert(o)
  9923. }, t.prototype.modInverse = function(e) {
  9924. var i = e.isEven();
  9925. if (this.isEven() && i || 0 == e.signum()) return t.ZERO;
  9926. for (var n = e.clone(), r = this.clone(), o = B(1), a = B(0), s = B(0), l = B(1); 0 != n.signum();) {
  9927. for (; n.isEven();) n.rShiftTo(1, n), i ? (o.isEven() && a.isEven() || (o.addTo(this, o), a.subTo(e, a)), o.rShiftTo(1, o)) : a.isEven() || a.subTo(e, a), a.rShiftTo(1, a);
  9928. for (; r.isEven();) r.rShiftTo(1, r), i ? (s.isEven() && l.isEven() || (s.addTo(this, s), l.subTo(e, l)), s.rShiftTo(1, s)) : l.isEven() || l.subTo(e, l), l.rShiftTo(1, l);
  9929. n.compareTo(r) >= 0 ? (n.subTo(r, n), i && o.subTo(s, o), a.subTo(l, a)) : (r.subTo(n, r), i && s.subTo(o, s), l.subTo(a, l))
  9930. }
  9931. return 0 != r.compareTo(t.ONE) ? t.ZERO : l.compareTo(e) >= 0 ? l.subtract(e) : l.signum() < 0 ? (l.addTo(e, l), l.signum() < 0 ? l.add(e) : l) : l
  9932. }, t.prototype.pow = function(t) {
  9933. return this.exp(t, new C)
  9934. }, t.prototype.gcd = function(t) {
  9935. var e = this.s < 0 ? this.negate() : this.clone(),
  9936. i = t.s < 0 ? t.negate() : t.clone();
  9937. if (e.compareTo(i) < 0) {
  9938. var n = e;
  9939. e = i, i = n
  9940. }
  9941. var r = e.getLowestSetBit(),
  9942. o = i.getLowestSetBit();
  9943. if (o < 0) return e;
  9944. for (r < o && (o = r), o > 0 && (e.rShiftTo(o, e), i.rShiftTo(o, i)); e.signum() > 0;)(r = e.getLowestSetBit()) > 0 && e.rShiftTo(r, e), (r = i.getLowestSetBit()) > 0 && i.rShiftTo(r, i), e.compareTo(i) >= 0 ? (e.subTo(i, e), e.rShiftTo(1, e)) : (i.subTo(e, i), i.rShiftTo(1, i));
  9945. return o > 0 && i.lShiftTo(o, i), i
  9946. }, t.prototype.isProbablePrime = function(t) {
  9947. var e, i = this.abs();
  9948. if (1 == i.t && i[0] <= _[_.length - 1]) {
  9949. for (e = 0; e < _.length; ++e)
  9950. if (i[0] == _[e]) return !0;
  9951. return !1
  9952. }
  9953. if (i.isEven()) return !1;
  9954. for (e = 1; e < _.length;) {
  9955. for (var n = _[e], r = e + 1; r < _.length && n < A;) n *= _[r++];
  9956. for (n = i.modInt(n); e < r;)
  9957. if (n % _[e++] == 0) return !1
  9958. }
  9959. return i.millerRabin(t)
  9960. }, t.prototype.copyTo = function(t) {
  9961. for (var e = this.t - 1; e >= 0; --e) t[e] = this[e];
  9962. t.t = this.t, t.s = this.s
  9963. }, t.prototype.fromInt = function(t) {
  9964. this.t = 1, this.s = t < 0 ? -1 : 0, t > 0 ? this[0] = t : t < -1 ? this[0] = t + this.DV : this.t = 0
  9965. }, t.prototype.fromString = function(e, i) {
  9966. var n;
  9967. if (16 == i) n = 4;
  9968. else if (8 == i) n = 3;
  9969. else if (256 == i) n = 8;
  9970. else if (2 == i) n = 1;
  9971. else if (32 == i) n = 5;
  9972. else {
  9973. if (4 != i) return void this.fromRadix(e, i);
  9974. n = 2
  9975. }
  9976. this.t = 0, this.s = 0;
  9977. for (var r = e.length, o = !1, a = 0; --r >= 0;) {
  9978. var s = 8 == n ? 255 & +e[r] : F(e, r);
  9979. s < 0 ? "-" == e.charAt(r) && (o = !0) : (o = !1, 0 == a ? this[this.t++] = s : a + n > this.DB ? (this[this.t - 1] |= (s & (1 << this.DB - a) - 1) << a, this[this.t++] = s >> this.DB - a) : this[this.t - 1] |= s << a, (a += n) >= this.DB && (a -= this.DB))
  9980. }
  9981. 8 == n && 0 != (128 & +e[0]) && (this.s = -1, a > 0 && (this[this.t - 1] |= (1 << this.DB - a) - 1 << a)), this.clamp(), o && t.ZERO.subTo(this, this)
  9982. }, t.prototype.clamp = function() {
  9983. for (var t = this.s & this.DM; this.t > 0 && this[this.t - 1] == t;) --this.t
  9984. }, t.prototype.dlShiftTo = function(t, e) {
  9985. var i;
  9986. for (i = this.t - 1; i >= 0; --i) e[i + t] = this[i];
  9987. for (i = t - 1; i >= 0; --i) e[i] = 0;
  9988. e.t = this.t + t, e.s = this.s
  9989. }, t.prototype.drShiftTo = function(t, e) {
  9990. for (var i = t; i < this.t; ++i) e[i - t] = this[i];
  9991. e.t = Math.max(this.t - t, 0), e.s = this.s
  9992. }, t.prototype.lShiftTo = function(t, e) {
  9993. for (var i = t % this.DB, n = this.DB - i, r = (1 << n) - 1, o = Math.floor(t / this.DB), a = this.s << i & this.DM, s = this.t - 1; s >= 0; --s) e[s + o + 1] = this[s] >> n | a, a = (this[s] & r) << i;
  9994. for (s = o - 1; s >= 0; --s) e[s] = 0;
  9995. e[o] = a, e.t = this.t + o + 1, e.s = this.s, e.clamp()
  9996. }, t.prototype.rShiftTo = function(t, e) {
  9997. e.s = this.s;
  9998. var i = Math.floor(t / this.DB);
  9999. if (i >= this.t) e.t = 0;
  10000. else {
  10001. var n = t % this.DB,
  10002. r = this.DB - n,
  10003. o = (1 << n) - 1;
  10004. e[0] = this[i] >> n;
  10005. for (var a = i + 1; a < this.t; ++a) e[a - i - 1] |= (this[a] & o) << r, e[a - i] = this[a] >> n;
  10006. n > 0 && (e[this.t - i - 1] |= (this.s & o) << r), e.t = this.t - i, e.clamp()
  10007. }
  10008. }, t.prototype.subTo = function(t, e) {
  10009. for (var i = 0, n = 0, r = Math.min(t.t, this.t); i < r;) n += this[i] - t[i], e[i++] = n & this.DM, n >>= this.DB;
  10010. if (t.t < this.t) {
  10011. for (n -= t.s; i < this.t;) n += this[i], e[i++] = n & this.DM, n >>= this.DB;
  10012. n += this.s
  10013. } else {
  10014. for (n += this.s; i < t.t;) n -= t[i], e[i++] = n & this.DM, n >>= this.DB;
  10015. n -= t.s
  10016. }
  10017. e.s = n < 0 ? -1 : 0, n < -1 ? e[i++] = this.DV + n : n > 0 && (e[i++] = n), e.t = i, e.clamp()
  10018. }, t.prototype.multiplyTo = function(e, i) {
  10019. var n = this.abs(),
  10020. r = e.abs(),
  10021. o = n.t;
  10022. for (i.t = o + r.t; --o >= 0;) i[o] = 0;
  10023. for (o = 0; o < r.t; ++o) i[o + n.t] = n.am(0, r[o], i, o, 0, n.t);
  10024. i.s = 0, i.clamp(), this.s != e.s && t.ZERO.subTo(i, i)
  10025. }, t.prototype.squareTo = function(t) {
  10026. for (var e = this.abs(), i = t.t = 2 * e.t; --i >= 0;) t[i] = 0;
  10027. for (i = 0; i < e.t - 1; ++i) {
  10028. var n = e.am(i, e[i], t, 2 * i, 0, 1);
  10029. (t[i + e.t] += e.am(i + 1, 2 * e[i], t, 2 * i + 1, n, e.t - i - 1)) >= e.DV && (t[i + e.t] -= e.DV, t[i + e.t + 1] = 1)
  10030. }
  10031. t.t > 0 && (t[t.t - 1] += e.am(i, e[i], t, 2 * i, 0, 1)), t.s = 0, t.clamp()
  10032. }, t.prototype.divRemTo = function(e, i, n) {
  10033. var r = e.abs();
  10034. if (!(r.t <= 0)) {
  10035. var o = this.abs();
  10036. if (o.t < r.t) return null != i && i.fromInt(0), void(null != n && this.copyTo(n));
  10037. null == n && (n = O());
  10038. var a = O(),
  10039. s = this.s,
  10040. l = e.s,
  10041. u = this.DB - z(r[r.t - 1]);
  10042. u > 0 ? (r.lShiftTo(u, a), o.lShiftTo(u, n)) : (r.copyTo(a), o.copyTo(n));
  10043. var h = a.t,
  10044. c = a[h - 1];
  10045. if (0 != c) {
  10046. var d = c * (1 << this.F1) + (h > 1 ? a[h - 2] >> this.F2 : 0),
  10047. p = this.FV / d,
  10048. f = (1 << this.F1) / d,
  10049. m = 1 << this.F2,
  10050. g = n.t,
  10051. v = g - h,
  10052. y = null == i ? O() : i;
  10053. for (a.dlShiftTo(v, y), n.compareTo(y) >= 0 && (n[n.t++] = 1, n.subTo(y, n)), t.ONE.dlShiftTo(h, y), y.subTo(a, a); a.t < h;) a[a.t++] = 0;
  10054. for (; --v >= 0;) {
  10055. var b = n[--g] == c ? this.DM : Math.floor(n[g] * p + (n[g - 1] + m) * f);
  10056. if ((n[g] += a.am(0, b, n, v, 0, h)) < b)
  10057. for (a.dlShiftTo(v, y), n.subTo(y, n); n[g] < --b;) n.subTo(y, n)
  10058. }
  10059. null != i && (n.drShiftTo(h, i), s != l && t.ZERO.subTo(i, i)), n.t = h, n.clamp(), u > 0 && n.rShiftTo(u, n), s < 0 && t.ZERO.subTo(n, n)
  10060. }
  10061. }
  10062. }, t.prototype.invDigit = function() {
  10063. if (this.t < 1) return 0;
  10064. var t = this[0];
  10065. if (0 == (1 & t)) return 0;
  10066. var e = 3 & t;
  10067. return (e = (e = (e = (e = e * (2 - (15 & t) * e) & 15) * (2 - (255 & t) * e) & 255) * (2 - ((65535 & t) * e & 65535)) & 65535) * (2 - t * e % this.DV) % this.DV) > 0 ? this.DV - e : -e
  10068. }, t.prototype.isEven = function() {
  10069. return 0 == (this.t > 0 ? 1 & this[0] : this.s)
  10070. }, t.prototype.exp = function(e, i) {
  10071. if (e > 4294967295 || e < 1) return t.ONE;
  10072. var n = O(),
  10073. r = O(),
  10074. o = i.convert(this),
  10075. a = z(e) - 1;
  10076. for (o.copyTo(n); --a >= 0;)
  10077. if (i.sqrTo(n, r), (e & 1 << a) > 0) i.mulTo(r, o, n);
  10078. else {
  10079. var s = n;
  10080. n = r, r = s
  10081. } return i.revert(n)
  10082. }, t.prototype.chunkSize = function(t) {
  10083. return Math.floor(Math.LN2 * this.DB / Math.log(t))
  10084. }, t.prototype.toRadix = function(t) {
  10085. if (null == t && (t = 10), 0 == this.signum() || t < 2 || t > 36) return "0";
  10086. var e = this.chunkSize(t),
  10087. i = Math.pow(t, e),
  10088. n = B(i),
  10089. r = O(),
  10090. o = O(),
  10091. a = "";
  10092. for (this.divRemTo(n, r, o); r.signum() > 0;) a = (i + o.intValue())
  10093. .toString(t)
  10094. .substr(1) + a, r.divRemTo(n, r, o);
  10095. return o.intValue()
  10096. .toString(t) + a
  10097. }, t.prototype.fromRadix = function(e, i) {
  10098. this.fromInt(0), null == i && (i = 10);
  10099. for (var n = this.chunkSize(i), r = Math.pow(i, n), o = !1, a = 0, s = 0, l = 0; l < e.length; ++l) {
  10100. var u = F(e, l);
  10101. u < 0 ? "-" == e.charAt(l) && 0 == this.signum() && (o = !0) : (s = i * s + u, ++a >= n && (this.dMultiply(r), this.dAddOffset(s, 0), a = 0, s = 0))
  10102. }
  10103. a > 0 && (this.dMultiply(Math.pow(i, a)), this.dAddOffset(s, 0)), o && t.ZERO.subTo(this, this)
  10104. }, t.prototype.fromNumber = function(e, i, r) {
  10105. if ("number" == typeof i)
  10106. if (e < 2) this.fromInt(1);
  10107. else
  10108. for (this.fromNumber(e, r), this.testBit(e - 1) || this.bitwiseTo(t.ONE.shiftLeft(e - 1), n, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(i);) this.dAddOffset(2, 0), this.bitLength() > e && this.subTo(t.ONE.shiftLeft(e - 1), this);
  10109. else {
  10110. var o = [],
  10111. a = 7 & e;
  10112. o.length = 1 + (e >> 3), i.nextBytes(o), a > 0 ? o[0] &= (1 << a) - 1 : o[0] = 0, this.fromString(o, 256)
  10113. }
  10114. }, t.prototype.bitwiseTo = function(t, e, i) {
  10115. var n, r, o = Math.min(t.t, this.t);
  10116. for (n = 0; n < o; ++n) i[n] = e(this[n], t[n]);
  10117. if (t.t < this.t) {
  10118. for (r = t.s & this.DM, n = o; n < this.t; ++n) i[n] = e(this[n], r);
  10119. i.t = this.t
  10120. } else {
  10121. for (r = this.s & this.DM, n = o; n < t.t; ++n) i[n] = e(r, t[n]);
  10122. i.t = t.t
  10123. }
  10124. i.s = e(this.s, t.s), i.clamp()
  10125. }, t.prototype.changeBit = function(e, i) {
  10126. var n = t.ONE.shiftLeft(e);
  10127. return this.bitwiseTo(n, i, n), n
  10128. }, t.prototype.addTo = function(t, e) {
  10129. for (var i = 0, n = 0, r = Math.min(t.t, this.t); i < r;) n += this[i] + t[i], e[i++] = n & this.DM, n >>= this.DB;
  10130. if (t.t < this.t) {
  10131. for (n += t.s; i < this.t;) n += this[i], e[i++] = n & this.DM, n >>= this.DB;
  10132. n += this.s
  10133. } else {
  10134. for (n += this.s; i < t.t;) n += t[i], e[i++] = n & this.DM, n >>= this.DB;
  10135. n += t.s
  10136. }
  10137. e.s = n < 0 ? -1 : 0, n > 0 ? e[i++] = n : n < -1 && (e[i++] = this.DV + n), e.t = i, e.clamp()
  10138. }, t.prototype.dMultiply = function(t) {
  10139. this[this.t] = this.am(0, t - 1, this, 0, 0, this.t), ++this.t, this.clamp()
  10140. }, t.prototype.dAddOffset = function(t, e) {
  10141. if (0 != t) {
  10142. for (; this.t <= e;) this[this.t++] = 0;
  10143. for (this[e] += t; this[e] >= this.DV;) this[e] -= this.DV, ++e >= this.t && (this[this.t++] = 0), ++this[e]
  10144. }
  10145. }, t.prototype.multiplyLowerTo = function(t, e, i) {
  10146. var n = Math.min(this.t + t.t, e);
  10147. for (i.s = 0, i.t = n; n > 0;) i[--n] = 0;
  10148. for (var r = i.t - this.t; n < r; ++n) i[n + this.t] = this.am(0, t[n], i, n, 0, this.t);
  10149. for (r = Math.min(t.t, e); n < r; ++n) this.am(0, t[n], i, n, 0, e - n);
  10150. i.clamp()
  10151. }, t.prototype.multiplyUpperTo = function(t, e, i) {
  10152. --e;
  10153. var n = i.t = this.t + t.t - e;
  10154. for (i.s = 0; --n >= 0;) i[n] = 0;
  10155. for (n = Math.max(e - this.t, 0); n < t.t; ++n) i[this.t + n - e] = this.am(e - n, t[n], i, 0, 0, this.t + n - e);
  10156. i.clamp(), i.drShiftTo(1, i)
  10157. }, t.prototype.modInt = function(t) {
  10158. if (t <= 0) return 0;
  10159. var e = this.DV % t,
  10160. i = this.s < 0 ? t - 1 : 0;
  10161. if (this.t > 0)
  10162. if (0 == e) i = this[0] % t;
  10163. else
  10164. for (var n = this.t - 1; n >= 0; --n) i = (e * i + this[n]) % t;
  10165. return i
  10166. }, t.prototype.millerRabin = function(e) {
  10167. var i = this.subtract(t.ONE),
  10168. n = i.getLowestSetBit();
  10169. if (n <= 0) return !1;
  10170. var r = i.shiftRight(n);
  10171. (e = e + 1 >> 1) > _.length && (e = _.length);
  10172. for (var o = O(), a = 0; a < e; ++a) {
  10173. o.fromInt(_[Math.floor(Math.random() * _.length)]);
  10174. var s = o.modPow(r, this);
  10175. if (0 != s.compareTo(t.ONE) && 0 != s.compareTo(i)) {
  10176. for (var l = 1; l++ < n && 0 != s.compareTo(i);)
  10177. if (0 == (s = s.modPowInt(2, this))
  10178. .compareTo(t.ONE)) return !1;
  10179. if (0 != s.compareTo(i)) return !1
  10180. }
  10181. }
  10182. return !0
  10183. }, t.prototype.square = function() {
  10184. var t = O();
  10185. return this.squareTo(t), t
  10186. }, t.prototype.gcda = function(t, e) {
  10187. var i = this.s < 0 ? this.negate() : this.clone(),
  10188. n = t.s < 0 ? t.negate() : t.clone();
  10189. if (i.compareTo(n) < 0) {
  10190. var r = i;
  10191. i = n, n = r
  10192. }
  10193. var o = i.getLowestSetBit(),
  10194. a = n.getLowestSetBit();
  10195. if (a < 0) e(i);
  10196. else {
  10197. o < a && (a = o), a > 0 && (i.rShiftTo(a, i), n.rShiftTo(a, n));
  10198. var s = function() {
  10199. (o = i.getLowestSetBit()) > 0 && i.rShiftTo(o, i), (o = n.getLowestSetBit()) > 0 && n.rShiftTo(o, n), i.compareTo(n) >= 0 ? (i.subTo(n, i), i.rShiftTo(1, i)) : (n.subTo(i, n), n.rShiftTo(1, n)), i.signum() > 0 ? setTimeout(s, 0) : (a > 0 && n.lShiftTo(a, n), setTimeout((function() {
  10200. e(n)
  10201. }), 0))
  10202. };
  10203. setTimeout(s, 10)
  10204. }
  10205. }, t.prototype.fromNumberAsync = function(e, i, r, o) {
  10206. if ("number" == typeof i)
  10207. if (e < 2) this.fromInt(1);
  10208. else {
  10209. this.fromNumber(e, r), this.testBit(e - 1) || this.bitwiseTo(t.ONE.shiftLeft(e - 1), n, this), this.isEven() && this.dAddOffset(1, 0);
  10210. var a = this,
  10211. s = function() {
  10212. a.dAddOffset(2, 0), a.bitLength() > e && a.subTo(t.ONE.shiftLeft(e - 1), a), a.isProbablePrime(i) ? setTimeout((function() {
  10213. o()
  10214. }), 0) : setTimeout(s, 0)
  10215. };
  10216. setTimeout(s, 0)
  10217. }
  10218. else {
  10219. var l = [],
  10220. u = 7 & e;
  10221. l.length = 1 + (e >> 3), i.nextBytes(l), u > 0 ? l[0] &= (1 << u) - 1 : l[0] = 0, this.fromString(l, 256)
  10222. }
  10223. }, t
  10224. }(),
  10225. C = function() {
  10226. function t() {}
  10227. return t.prototype.convert = function(t) {
  10228. return t
  10229. }, t.prototype.revert = function(t) {
  10230. return t
  10231. }, t.prototype.mulTo = function(t, e, i) {
  10232. t.multiplyTo(e, i)
  10233. }, t.prototype.sqrTo = function(t, e) {
  10234. t.squareTo(e)
  10235. }, t
  10236. }(),
  10237. E = function() {
  10238. function t(t) {
  10239. this.m = t
  10240. }
  10241. return t.prototype.convert = function(t) {
  10242. return t.s < 0 || t.compareTo(this.m) >= 0 ? t.mod(this.m) : t
  10243. }, t.prototype.revert = function(t) {
  10244. return t
  10245. }, t.prototype.reduce = function(t) {
  10246. t.divRemTo(this.m, null, t)
  10247. }, t.prototype.mulTo = function(t, e, i) {
  10248. t.multiplyTo(e, i), this.reduce(i)
  10249. }, t.prototype.sqrTo = function(t, e) {
  10250. t.squareTo(e), this.reduce(e)
  10251. }, t
  10252. }(),
  10253. D = function() {
  10254. function t(t) {
  10255. this.m = t, this.mp = t.invDigit(), this.mpl = 32767 & this.mp, this.mph = this.mp >> 15, this.um = (1 << t.DB - 15) - 1, this.mt2 = 2 * t.t
  10256. }
  10257. return t.prototype.convert = function(t) {
  10258. var e = O();
  10259. return t.abs()
  10260. .dlShiftTo(this.m.t, e), e.divRemTo(this.m, null, e), t.s < 0 && e.compareTo(P.ZERO) > 0 && this.m.subTo(e, e), e
  10261. }, t.prototype.revert = function(t) {
  10262. var e = O();
  10263. return t.copyTo(e), this.reduce(e), e
  10264. }, t.prototype.reduce = function(t) {
  10265. for (; t.t <= this.mt2;) t[t.t++] = 0;
  10266. for (var e = 0; e < this.m.t; ++e) {
  10267. var i = 32767 & t[e],
  10268. n = i * this.mpl + ((i * this.mph + (t[e] >> 15) * this.mpl & this.um) << 15) & t.DM;
  10269. for (t[i = e + this.m.t] += this.m.am(0, n, t, e, 0, this.m.t); t[i] >= t.DV;) t[i] -= t.DV, t[++i]++
  10270. }
  10271. t.clamp(), t.drShiftTo(this.m.t, t), t.compareTo(this.m) >= 0 && t.subTo(this.m, t)
  10272. }, t.prototype.mulTo = function(t, e, i) {
  10273. t.multiplyTo(e, i), this.reduce(i)
  10274. }, t.prototype.sqrTo = function(t, e) {
  10275. t.squareTo(e), this.reduce(e)
  10276. }, t
  10277. }(),
  10278. L = function() {
  10279. function t(t) {
  10280. this.m = t, this.r2 = O(), this.q3 = O(), P.ONE.dlShiftTo(2 * t.t, this.r2), this.mu = this.r2.divide(t)
  10281. }
  10282. return t.prototype.convert = function(t) {
  10283. if (t.s < 0 || t.t > 2 * this.m.t) return t.mod(this.m);
  10284. if (t.compareTo(this.m) < 0) return t;
  10285. var e = O();
  10286. return t.copyTo(e), this.reduce(e), e
  10287. }, t.prototype.revert = function(t) {
  10288. return t
  10289. }, t.prototype.reduce = function(t) {
  10290. for (t.drShiftTo(this.m.t - 1, this.r2), t.t > this.m.t + 1 && (t.t = this.m.t + 1, t.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); t.compareTo(this.r2) < 0;) t.dAddOffset(1, this.m.t + 1);
  10291. for (t.subTo(this.r2, t); t.compareTo(this.m) >= 0;) t.subTo(this.m, t)
  10292. }, t.prototype.mulTo = function(t, e, i) {
  10293. t.multiplyTo(e, i), this.reduce(i)
  10294. }, t.prototype.sqrTo = function(t, e) {
  10295. t.squareTo(e), this.reduce(e)
  10296. }, t
  10297. }();
  10298. function O() {
  10299. return new P(null)
  10300. }
  10301. function I(t, e) {
  10302. return new P(t, e)
  10303. }
  10304. "Microsoft Internet Explorer" == navigator.appName ? (P.prototype.am = function(t, e, i, n, r, o) {
  10305. for (var a = 32767 & e, s = e >> 15; --o >= 0;) {
  10306. var l = 32767 & this[t],
  10307. u = this[t++] >> 15,
  10308. h = s * l + u * a;
  10309. r = ((l = a * l + ((32767 & h) << 15) + i[n] + (1073741823 & r)) >>> 30) + (h >>> 15) + s * u + (r >>> 30), i[n++] = 1073741823 & l
  10310. }
  10311. return r
  10312. }, x = 30) : "Netscape" != navigator.appName ? (P.prototype.am = function(t, e, i, n, r, o) {
  10313. for (; --o >= 0;) {
  10314. var a = e * this[t++] + i[n] + r;
  10315. r = Math.floor(a / 67108864), i[n++] = 67108863 & a
  10316. }
  10317. return r
  10318. }, x = 26) : (P.prototype.am = function(t, e, i, n, r, o) {
  10319. for (var a = 16383 & e, s = e >> 14; --o >= 0;) {
  10320. var l = 16383 & this[t],
  10321. u = this[t++] >> 14,
  10322. h = s * l + u * a;
  10323. r = ((l = a * l + ((16383 & h) << 14) + i[n] + r) >> 28) + (h >> 14) + s * u, i[n++] = 268435455 & l
  10324. }
  10325. return r
  10326. }, x = 28), P.prototype.DB = x, P.prototype.DM = (1 << x) - 1, P.prototype.DV = 1 << x, P.prototype.FV = Math.pow(2, 52), P.prototype.F1 = 52 - x, P.prototype.F2 = 2 * x - 52;
  10327. var R, N, k = [];
  10328. for (R = "0".charCodeAt(0), N = 0; N <= 9; ++N) k[R++] = N;
  10329. for (R = "a".charCodeAt(0), N = 10; N < 36; ++N) k[R++] = N;
  10330. for (R = "A".charCodeAt(0), N = 10; N < 36; ++N) k[R++] = N;
  10331. function F(t, e) {
  10332. var i = k[t.charCodeAt(e)];
  10333. return null == i ? -1 : i
  10334. }
  10335. function B(t) {
  10336. var e = O();
  10337. return e.fromInt(t), e
  10338. }
  10339. function z(t) {
  10340. var e, i = 1;
  10341. return 0 != (e = t >>> 16) && (t = e, i += 16), 0 != (e = t >> 8) && (t = e, i += 8), 0 != (e = t >> 4) && (t = e, i += 4), 0 != (e = t >> 2) && (t = e, i += 2), 0 != (e = t >> 1) && (t = e, i += 1), i
  10342. }
  10343. P.ZERO = B(0), P.ONE = B(1);
  10344. var U, V, j = function() {
  10345. function t() {
  10346. this.i = 0, this.j = 0, this.S = []
  10347. }
  10348. return t.prototype.init = function(t) {
  10349. var e, i, n;
  10350. for (e = 0; e < 256; ++e) this.S[e] = e;
  10351. for (i = 0, e = 0; e < 256; ++e) i = i + this.S[e] + t[e % t.length] & 255, n = this.S[e], this.S[e] = this.S[i], this.S[i] = n;
  10352. this.i = 0, this.j = 0
  10353. }, t.prototype.next = function() {
  10354. var t;
  10355. return this.i = this.i + 1 & 255, this.j = this.j + this.S[this.i] & 255, t = this.S[this.i], this.S[this.i] = this.S[this.j], this.S[this.j] = t, this.S[t + this.S[this.i] & 255]
  10356. }, t
  10357. }(),
  10358. H = null;
  10359. if (null == H) {
  10360. H = [], V = 0;
  10361. var G = void 0;
  10362. if (window.crypto && window.crypto.getRandomValues) {
  10363. var W = new Uint32Array(256);
  10364. for (window.crypto.getRandomValues(W), G = 0; G < W.length; ++G) H[V++] = 255 & W[G]
  10365. }
  10366. var q = function(t) {
  10367. if (this.count = this.count || 0, this.count >= 256 || V >= 256) window.removeEventListener ? window.removeEventListener("mousemove", q, !1) : window.detachEvent && window.detachEvent("onmousemove", q);
  10368. else try {
  10369. var e = t.x + t.y;
  10370. H[V++] = 255 & e, this.count += 1
  10371. } catch (t) {}
  10372. };
  10373. window.addEventListener ? window.addEventListener("mousemove", q, !1) : window.attachEvent && window.attachEvent("onmousemove", q)
  10374. }
  10375. function Y() {
  10376. if (null == U) {
  10377. for (U = new j; V < 256;) {
  10378. var t = Math.floor(65536 * Math.random());
  10379. H[V++] = 255 & t
  10380. }
  10381. for (U.init(H), V = 0; V < H.length; ++V) H[V] = 0;
  10382. V = 0
  10383. }
  10384. return U.next()
  10385. }
  10386. var X = function() {
  10387. function t() {}
  10388. return t.prototype.nextBytes = function(t) {
  10389. for (var e = 0; e < t.length; ++e) t[e] = Y()
  10390. }, t
  10391. }(),
  10392. Z = function() {
  10393. function t() {
  10394. this.n = null, this.e = 0, this.d = null, this.p = null, this.q = null, this.dmp1 = null, this.dmq1 = null, this.coeff = null
  10395. }
  10396. return t.prototype.doPublic = function(t) {
  10397. return t.modPowInt(this.e, this.n)
  10398. }, t.prototype.doPrivate = function(t) {
  10399. if (null == this.p || null == this.q) return t.modPow(this.d, this.n);
  10400. for (var e = t.mod(this.p)
  10401. .modPow(this.dmp1, this.p), i = t.mod(this.q)
  10402. .modPow(this.dmq1, this.q); e.compareTo(i) < 0;) e = e.add(this.p);
  10403. return e.subtract(i)
  10404. .multiply(this.coeff)
  10405. .mod(this.p)
  10406. .multiply(this.q)
  10407. .add(i)
  10408. }, t.prototype.setPublic = function(t, e) {
  10409. null != t && null != e && t.length > 0 && e.length > 0 && (this.n = I(t, 16), this.e = parseInt(e, 16))
  10410. }, t.prototype.encrypt = function(t) {
  10411. var e = function(t, e) {
  10412. if (e < t.length + 11) return null;
  10413. for (var i = [], n = t.length - 1; n >= 0 && e > 0;) {
  10414. var r = t.charCodeAt(n--);
  10415. r < 128 ? i[--e] = r : r > 127 && r < 2048 ? (i[--e] = 63 & r | 128, i[--e] = r >> 6 | 192) : (i[--e] = 63 & r | 128, i[--e] = r >> 6 & 63 | 128, i[--e] = r >> 12 | 224)
  10416. }
  10417. i[--e] = 0;
  10418. for (var o = new X, a = []; e > 2;) {
  10419. for (a[0] = 0; 0 == a[0];) o.nextBytes(a);
  10420. i[--e] = a[0]
  10421. }
  10422. return i[--e] = 2, i[--e] = 0, new P(i)
  10423. }(t, this.n.bitLength() + 7 >> 3);
  10424. if (null == e) return null;
  10425. var i = this.doPublic(e);
  10426. if (null == i) return null;
  10427. var n = i.toString(16);
  10428. return 0 == (1 & n.length) ? n : "0" + n
  10429. }, t.prototype.setPrivate = function(t, e, i) {
  10430. null != t && null != e && t.length > 0 && e.length > 0 && (this.n = I(t, 16), this.e = parseInt(e, 16), this.d = I(i, 16))
  10431. }, t.prototype.setPrivateEx = function(t, e, i, n, r, o, a, s) {
  10432. null != t && null != e && t.length > 0 && e.length > 0 && (this.n = I(t, 16), this.e = parseInt(e, 16), this.d = I(i, 16), this.p = I(n, 16), this.q = I(r, 16), this.dmp1 = I(o, 16), this.dmq1 = I(a, 16), this.coeff = I(s, 16))
  10433. }, t.prototype.generate = function(t, e) {
  10434. var i = new X,
  10435. n = t >> 1;
  10436. this.e = parseInt(e, 16);
  10437. for (var r = new P(e, 16);;) {
  10438. for (; this.p = new P(t - n, 1, i), 0 != this.p.subtract(P.ONE)
  10439. .gcd(r)
  10440. .compareTo(P.ONE) || !this.p.isProbablePrime(10););
  10441. for (; this.q = new P(n, 1, i), 0 != this.q.subtract(P.ONE)
  10442. .gcd(r)
  10443. .compareTo(P.ONE) || !this.q.isProbablePrime(10););
  10444. if (this.p.compareTo(this.q) <= 0) {
  10445. var o = this.p;
  10446. this.p = this.q, this.q = o
  10447. }
  10448. var a = this.p.subtract(P.ONE),
  10449. s = this.q.subtract(P.ONE),
  10450. l = a.multiply(s);
  10451. if (0 == l.gcd(r)
  10452. .compareTo(P.ONE)) {
  10453. this.n = this.p.multiply(this.q), this.d = r.modInverse(l), this.dmp1 = this.d.mod(a), this.dmq1 = this.d.mod(s), this.coeff = this.q.modInverse(this.p);
  10454. break
  10455. }
  10456. }
  10457. }, t.prototype.decrypt = function(t) {
  10458. var e = I(t, 16),
  10459. i = this.doPrivate(e);
  10460. return null == i ? null : function(t, e) {
  10461. for (var i = t.toByteArray(), n = 0; n < i.length && 0 == i[n];) ++n;
  10462. if (i.length - n != e - 1 || 2 != i[n]) return null;
  10463. for (++n; 0 != i[n];)
  10464. if (++n >= i.length) return null;
  10465. for (var r = ""; ++n < i.length;) {
  10466. var o = 255 & i[n];
  10467. o < 128 ? r += String.fromCharCode(o) : o > 191 && o < 224 ? (r += String.fromCharCode((31 & o) << 6 | 63 & i[n + 1]), ++n) : (r += String.fromCharCode((15 & o) << 12 | (63 & i[n + 1]) << 6 | 63 & i[n + 2]), n += 2)
  10468. }
  10469. return r
  10470. }(i, this.n.bitLength() + 7 >> 3)
  10471. }, t.prototype.generateAsync = function(t, e, i) {
  10472. var n = new X,
  10473. r = t >> 1;
  10474. this.e = parseInt(e, 16);
  10475. var o = new P(e, 16),
  10476. a = this,
  10477. s = function() {
  10478. var e = function() {
  10479. if (a.p.compareTo(a.q) <= 0) {
  10480. var t = a.p;
  10481. a.p = a.q, a.q = t
  10482. }
  10483. var e = a.p.subtract(P.ONE),
  10484. n = a.q.subtract(P.ONE),
  10485. r = e.multiply(n);
  10486. 0 == r.gcd(o)
  10487. .compareTo(P.ONE) ? (a.n = a.p.multiply(a.q), a.d = o.modInverse(r), a.dmp1 = a.d.mod(e), a.dmq1 = a.d.mod(n), a.coeff = a.q.modInverse(a.p), setTimeout((function() {
  10488. i()
  10489. }), 0)) : setTimeout(s, 0)
  10490. },
  10491. l = function() {
  10492. a.q = O(), a.q.fromNumberAsync(r, 1, n, (function() {
  10493. a.q.subtract(P.ONE)
  10494. .gcda(o, (function(t) {
  10495. 0 == t.compareTo(P.ONE) && a.q.isProbablePrime(10) ? setTimeout(e, 0) : setTimeout(l, 0)
  10496. }))
  10497. }))
  10498. },
  10499. u = function() {
  10500. a.p = O(), a.p.fromNumberAsync(t - r, 1, n, (function() {
  10501. a.p.subtract(P.ONE)
  10502. .gcda(o, (function(t) {
  10503. 0 == t.compareTo(P.ONE) && a.p.isProbablePrime(10) ? setTimeout(l, 0) : setTimeout(u, 0)
  10504. }))
  10505. }))
  10506. };
  10507. setTimeout(u, 0)
  10508. };
  10509. setTimeout(s, 0)
  10510. }, t.prototype.sign = function(t, e, i) {
  10511. var n = function(t, e) {
  10512. if (e < t.length + 22) return null;
  10513. for (var i = e - t.length - 6, n = "", r = 0; r < i; r += 2) n += "ff";
  10514. return I("0001" + n + "00" + t, 16)
  10515. }((K[i] || "") + e(t)
  10516. .toString(), this.n.bitLength() / 4);
  10517. if (null == n) return null;
  10518. var r = this.doPrivate(n);
  10519. if (null == r) return null;
  10520. var o = r.toString(16);
  10521. return 0 == (1 & o.length) ? o : "0" + o
  10522. }, t.prototype.verify = function(t, e, i) {
  10523. var n = I(e, 16),
  10524. r = this.doPublic(n);
  10525. return null == r ? null : function(t) {
  10526. for (var e in K)
  10527. if (K.hasOwnProperty(e)) {
  10528. var i = K[e],
  10529. n = i.length;
  10530. if (t.substr(0, n) == i) return t.substr(n)
  10531. } return t
  10532. }(r.toString(16)
  10533. .replace(/^1f+00/, "")) == i(t)
  10534. .toString()
  10535. }, t
  10536. }(),
  10537. K = {
  10538. md2: "3020300c06082a864886f70d020205000410",
  10539. md5: "3020300c06082a864886f70d020505000410",
  10540. sha1: "3021300906052b0e03021a05000414",
  10541. sha224: "302d300d06096086480165030402040500041c",
  10542. sha256: "3031300d060960864801650304020105000420",
  10543. sha384: "3041300d060960864801650304020205000430",
  10544. sha512: "3051300d060960864801650304020305000440",
  10545. ripemd160: "3021300906052b2403020105000414"
  10546. },
  10547. Q = {};
  10548. Q.lang = {
  10549. extend: function(t, e, i) {
  10550. if (!e || !t) throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");
  10551. var n = function() {};
  10552. if (n.prototype = e.prototype, t.prototype = new n, t.prototype.constructor = t, t.superclass = e.prototype, e.prototype.constructor == Object.prototype.constructor && (e.prototype.constructor = e), i) {
  10553. var r;
  10554. for (r in i) t.prototype[r] = i[r];
  10555. var o = function() {},
  10556. a = ["toString", "valueOf"];
  10557. try {
  10558. /MSIE/.test(navigator.userAgent) && (o = function(t, e) {
  10559. for (r = 0; r < a.length; r += 1) {
  10560. var i = a[r],
  10561. n = e[i];
  10562. "function" == typeof n && n != Object.prototype[i] && (t[i] = n)
  10563. }
  10564. })
  10565. } catch (t) {}
  10566. o(t.prototype, i)
  10567. }
  10568. }
  10569. };
  10570. var J = {};
  10571. void 0 !== J.asn1 && J.asn1 || (J.asn1 = {}), J.asn1.ASN1Util = new function() {
  10572. this.integerToByteHex = function(t) {
  10573. var e = t.toString(16);
  10574. return e.length % 2 == 1 && (e = "0" + e), e
  10575. }, this.bigIntToMinTwosComplementsHex = function(t) {
  10576. var e = t.toString(16);
  10577. if ("-" != e.substr(0, 1)) e.length % 2 == 1 ? e = "0" + e : e.match(/^[0-7]/) || (e = "00" + e);
  10578. else {
  10579. var i = e.substr(1)
  10580. .length;
  10581. i % 2 == 1 ? i += 1 : e.match(/^[0-7]/) || (i += 2);
  10582. for (var n = "", r = 0; r < i; r++) n += "f";
  10583. e = new P(n, 16)
  10584. .xor(t)
  10585. .add(P.ONE)
  10586. .toString(16)
  10587. .replace(/^-/, "")
  10588. }
  10589. return e
  10590. }, this.getPEMStringFromHex = function(t, e) {
  10591. return hextopem(t, e)
  10592. }, this.newObject = function(t) {
  10593. var e = J.asn1,
  10594. i = e.DERBoolean,
  10595. n = e.DERInteger,
  10596. r = e.DERBitString,
  10597. o = e.DEROctetString,
  10598. a = e.DERNull,
  10599. s = e.DERObjectIdentifier,
  10600. l = e.DEREnumerated,
  10601. u = e.DERUTF8String,
  10602. h = e.DERNumericString,
  10603. c = e.DERPrintableString,
  10604. d = e.DERTeletexString,
  10605. p = e.DERIA5String,
  10606. f = e.DERUTCTime,
  10607. m = e.DERGeneralizedTime,
  10608. g = e.DERSequence,
  10609. v = e.DERSet,
  10610. y = e.DERTaggedObject,
  10611. b = e.ASN1Util.newObject,
  10612. w = Object.keys(t);
  10613. if (1 != w.length) throw "key of param shall be only one.";
  10614. var x = w[0];
  10615. if (-1 == ":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":" + x + ":")) throw "undefined key: " + x;
  10616. if ("bool" == x) return new i(t[x]);
  10617. if ("int" == x) return new n(t[x]);
  10618. if ("bitstr" == x) return new r(t[x]);
  10619. if ("octstr" == x) return new o(t[x]);
  10620. if ("null" == x) return new a(t[x]);
  10621. if ("oid" == x) return new s(t[x]);
  10622. if ("enum" == x) return new l(t[x]);
  10623. if ("utf8str" == x) return new u(t[x]);
  10624. if ("numstr" == x) return new h(t[x]);
  10625. if ("prnstr" == x) return new c(t[x]);
  10626. if ("telstr" == x) return new d(t[x]);
  10627. if ("ia5str" == x) return new p(t[x]);
  10628. if ("utctime" == x) return new f(t[x]);
  10629. if ("gentime" == x) return new m(t[x]);
  10630. if ("seq" == x) {
  10631. for (var M = t[x], T = [], S = 0; S < M.length; S++) {
  10632. var _ = b(M[S]);
  10633. T.push(_)
  10634. }
  10635. return new g({
  10636. array: T
  10637. })
  10638. }
  10639. if ("set" == x) {
  10640. for (M = t[x], T = [], S = 0; S < M.length; S++) _ = b(M[S]), T.push(_);
  10641. return new v({
  10642. array: T
  10643. })
  10644. }
  10645. if ("tag" == x) {
  10646. var A = t[x];
  10647. if ("[object Array]" === Object.prototype.toString.call(A) && 3 == A.length) {
  10648. var P = b(A[2]);
  10649. return new y({
  10650. tag: A[0],
  10651. explicit: A[1],
  10652. obj: P
  10653. })
  10654. }
  10655. var C = {};
  10656. if (void 0 !== A.explicit && (C.explicit = A.explicit), void 0 !== A.tag && (C.tag = A.tag), void 0 === A.obj) throw "obj shall be specified for 'tag'.";
  10657. return C.obj = b(A.obj), new y(C)
  10658. }
  10659. }, this.jsonToASN1HEX = function(t) {
  10660. return this.newObject(t)
  10661. .getEncodedHex()
  10662. }
  10663. }, J.asn1.ASN1Util.oidHexToInt = function(t) {
  10664. for (var e = "", i = parseInt(t.substr(0, 2), 16), n = (e = Math.floor(i / 40) + "." + i % 40, ""), r = 2; r < t.length; r += 2) {
  10665. var o = ("00000000" + parseInt(t.substr(r, 2), 16)
  10666. .toString(2))
  10667. .slice(-8);
  10668. n += o.substr(1, 7), "0" == o.substr(0, 1) && (e = e + "." + new P(n, 2)
  10669. .toString(10), n = "")
  10670. }
  10671. return e
  10672. }, J.asn1.ASN1Util.oidIntToHex = function(t) {
  10673. var e = function(t) {
  10674. var e = t.toString(16);
  10675. return 1 == e.length && (e = "0" + e), e
  10676. },
  10677. i = function(t) {
  10678. var i = "",
  10679. n = new P(t, 10)
  10680. .toString(2),
  10681. r = 7 - n.length % 7;
  10682. 7 == r && (r = 0);
  10683. for (var o = "", a = 0; a < r; a++) o += "0";
  10684. for (n = o + n, a = 0; a < n.length - 1; a += 7) {
  10685. var s = n.substr(a, 7);
  10686. a != n.length - 7 && (s = "1" + s), i += e(parseInt(s, 2))
  10687. }
  10688. return i
  10689. };
  10690. if (!t.match(/^[0-9.]+$/)) throw "malformed oid string: " + t;
  10691. var n = "",
  10692. r = t.split("."),
  10693. o = 40 * parseInt(r[0]) + parseInt(r[1]);
  10694. n += e(o), r.splice(0, 2);
  10695. for (var a = 0; a < r.length; a++) n += i(r[a]);
  10696. return n
  10697. }, J.asn1.ASN1Object = function() {
  10698. this.getLengthHexFromValue = function() {
  10699. if (void 0 === this.hV || null == this.hV) throw "this.hV is null or undefined.";
  10700. if (this.hV.length % 2 == 1) throw "value hex must be even length: n=" + "".length + ",v=" + this.hV;
  10701. var t = this.hV.length / 2,
  10702. e = t.toString(16);
  10703. if (e.length % 2 == 1 && (e = "0" + e), t < 128) return e;
  10704. var i = e.length / 2;
  10705. if (i > 15) throw "ASN.1 length too long to represent by 8x: n = " + t.toString(16);
  10706. return (128 + i)
  10707. .toString(16) + e
  10708. }, this.getEncodedHex = function() {
  10709. return (null == this.hTLV || this.isModified) && (this.hV = this.getFreshValueHex(), this.hL = this.getLengthHexFromValue(), this.hTLV = this.hT + this.hL + this.hV, this.isModified = !1), this.hTLV
  10710. }, this.getValueHex = function() {
  10711. return this.getEncodedHex(), this.hV
  10712. }, this.getFreshValueHex = function() {
  10713. return ""
  10714. }
  10715. }, J.asn1.DERAbstractString = function(t) {
  10716. J.asn1.DERAbstractString.superclass.constructor.call(this), this.getString = function() {
  10717. return this.s
  10718. }, this.setString = function(t) {
  10719. this.hTLV = null, this.isModified = !0, this.s = t, this.hV = stohex(this.s)
  10720. }, this.setStringHex = function(t) {
  10721. this.hTLV = null, this.isModified = !0, this.s = null, this.hV = t
  10722. }, this.getFreshValueHex = function() {
  10723. return this.hV
  10724. }, void 0 !== t && ("string" == typeof t ? this.setString(t) : void 0 !== t.str ? this.setString(t.str) : void 0 !== t.hex && this.setStringHex(t.hex))
  10725. }, Q.lang.extend(J.asn1.DERAbstractString, J.asn1.ASN1Object), J.asn1.DERAbstractTime = function(t) {
  10726. J.asn1.DERAbstractTime.superclass.constructor.call(this), this.localDateToUTC = function(t) {
  10727. return utc = t.getTime() + 6e4 * t.getTimezoneOffset(), new Date(utc)
  10728. }, this.formatDate = function(t, e, i) {
  10729. var n = this.zeroPadding,
  10730. r = this.localDateToUTC(t),
  10731. o = String(r.getFullYear());
  10732. "utc" == e && (o = o.substr(2, 2));
  10733. var a = o + n(String(r.getMonth() + 1), 2) + n(String(r.getDate()), 2) + n(String(r.getHours()), 2) + n(String(r.getMinutes()), 2) + n(String(r.getSeconds()), 2);
  10734. if (!0 === i) {
  10735. var s = r.getMilliseconds();
  10736. if (0 != s) {
  10737. var l = n(String(s), 3);
  10738. a = a + "." + (l = l.replace(/[0]+$/, ""))
  10739. }
  10740. }
  10741. return a + "Z"
  10742. }, this.zeroPadding = function(t, e) {
  10743. return t.length >= e ? t : new Array(e - t.length + 1)
  10744. .join("0") + t
  10745. }, this.getString = function() {
  10746. return this.s
  10747. }, this.setString = function(t) {
  10748. this.hTLV = null, this.isModified = !0, this.s = t, this.hV = stohex(t)
  10749. }, this.setByDateValue = function(t, e, i, n, r, o) {
  10750. var a = new Date(Date.UTC(t, e - 1, i, n, r, o, 0));
  10751. this.setByDate(a)
  10752. }, this.getFreshValueHex = function() {
  10753. return this.hV
  10754. }
  10755. }, Q.lang.extend(J.asn1.DERAbstractTime, J.asn1.ASN1Object), J.asn1.DERAbstractStructured = function(t) {
  10756. J.asn1.DERAbstractString.superclass.constructor.call(this), this.setByASN1ObjectArray = function(t) {
  10757. this.hTLV = null, this.isModified = !0, this.asn1Array = t
  10758. }, this.appendASN1Object = function(t) {
  10759. this.hTLV = null, this.isModified = !0, this.asn1Array.push(t)
  10760. }, this.asn1Array = new Array, void 0 !== t && void 0 !== t.array && (this.asn1Array = t.array)
  10761. }, Q.lang.extend(J.asn1.DERAbstractStructured, J.asn1.ASN1Object), J.asn1.DERBoolean = function() {
  10762. J.asn1.DERBoolean.superclass.constructor.call(this), this.hT = "01", this.hTLV = "0101ff"
  10763. }, Q.lang.extend(J.asn1.DERBoolean, J.asn1.ASN1Object), J.asn1.DERInteger = function(t) {
  10764. J.asn1.DERInteger.superclass.constructor.call(this), this.hT = "02", this.setByBigInteger = function(t) {
  10765. this.hTLV = null, this.isModified = !0, this.hV = J.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)
  10766. }, this.setByInteger = function(t) {
  10767. var e = new P(String(t), 10);
  10768. this.setByBigInteger(e)
  10769. }, this.setValueHex = function(t) {
  10770. this.hV = t
  10771. }, this.getFreshValueHex = function() {
  10772. return this.hV
  10773. }, void 0 !== t && (void 0 !== t.bigint ? this.setByBigInteger(t.bigint) : void 0 !== t.int ? this.setByInteger(t.int) : "number" == typeof t ? this.setByInteger(t) : void 0 !== t.hex && this.setValueHex(t.hex))
  10774. }, Q.lang.extend(J.asn1.DERInteger, J.asn1.ASN1Object), J.asn1.DERBitString = function(t) {
  10775. if (void 0 !== t && void 0 !== t.obj) {
  10776. var e = J.asn1.ASN1Util.newObject(t.obj);
  10777. t.hex = "00" + e.getEncodedHex()
  10778. }
  10779. J.asn1.DERBitString.superclass.constructor.call(this), this.hT = "03", this.setHexValueIncludingUnusedBits = function(t) {
  10780. this.hTLV = null, this.isModified = !0, this.hV = t
  10781. }, this.setUnusedBitsAndHexValue = function(t, e) {
  10782. if (t < 0 || 7 < t) throw "unused bits shall be from 0 to 7: u = " + t;
  10783. var i = "0" + t;
  10784. this.hTLV = null, this.isModified = !0, this.hV = i + e
  10785. }, this.setByBinaryString = function(t) {
  10786. var e = 8 - (t = t.replace(/0+$/, ""))
  10787. .length % 8;
  10788. 8 == e && (e = 0);
  10789. for (var i = 0; i <= e; i++) t += "0";
  10790. var n = "";
  10791. for (i = 0; i < t.length - 1; i += 8) {
  10792. var r = t.substr(i, 8),
  10793. o = parseInt(r, 2)
  10794. .toString(16);
  10795. 1 == o.length && (o = "0" + o), n += o
  10796. }
  10797. this.hTLV = null, this.isModified = !0, this.hV = "0" + e + n
  10798. }, this.setByBooleanArray = function(t) {
  10799. for (var e = "", i = 0; i < t.length; i++) 1 == t[i] ? e += "1" : e += "0";
  10800. this.setByBinaryString(e)
  10801. }, this.newFalseArray = function(t) {
  10802. for (var e = new Array(t), i = 0; i < t; i++) e[i] = !1;
  10803. return e
  10804. }, this.getFreshValueHex = function() {
  10805. return this.hV
  10806. }, void 0 !== t && ("string" == typeof t && t.toLowerCase()
  10807. .match(/^[0-9a-f]+$/) ? this.setHexValueIncludingUnusedBits(t) : void 0 !== t.hex ? this.setHexValueIncludingUnusedBits(t.hex) : void 0 !== t.bin ? this.setByBinaryString(t.bin) : void 0 !== t.array && this.setByBooleanArray(t.array))
  10808. }, Q.lang.extend(J.asn1.DERBitString, J.asn1.ASN1Object), J.asn1.DEROctetString = function(t) {
  10809. if (void 0 !== t && void 0 !== t.obj) {
  10810. var e = J.asn1.ASN1Util.newObject(t.obj);
  10811. t.hex = e.getEncodedHex()
  10812. }
  10813. J.asn1.DEROctetString.superclass.constructor.call(this, t), this.hT = "04"
  10814. }, Q.lang.extend(J.asn1.DEROctetString, J.asn1.DERAbstractString), J.asn1.DERNull = function() {
  10815. J.asn1.DERNull.superclass.constructor.call(this), this.hT = "05", this.hTLV = "0500"
  10816. }, Q.lang.extend(J.asn1.DERNull, J.asn1.ASN1Object), J.asn1.DERObjectIdentifier = function(t) {
  10817. var e = function(t) {
  10818. var e = t.toString(16);
  10819. return 1 == e.length && (e = "0" + e), e
  10820. },
  10821. i = function(t) {
  10822. var i = "",
  10823. n = new P(t, 10)
  10824. .toString(2),
  10825. r = 7 - n.length % 7;
  10826. 7 == r && (r = 0);
  10827. for (var o = "", a = 0; a < r; a++) o += "0";
  10828. for (n = o + n, a = 0; a < n.length - 1; a += 7) {
  10829. var s = n.substr(a, 7);
  10830. a != n.length - 7 && (s = "1" + s), i += e(parseInt(s, 2))
  10831. }
  10832. return i
  10833. };
  10834. J.asn1.DERObjectIdentifier.superclass.constructor.call(this), this.hT = "06", this.setValueHex = function(t) {
  10835. this.hTLV = null, this.isModified = !0, this.s = null, this.hV = t
  10836. }, this.setValueOidString = function(t) {
  10837. if (!t.match(/^[0-9.]+$/)) throw "malformed oid string: " + t;
  10838. var n = "",
  10839. r = t.split("."),
  10840. o = 40 * parseInt(r[0]) + parseInt(r[1]);
  10841. n += e(o), r.splice(0, 2);
  10842. for (var a = 0; a < r.length; a++) n += i(r[a]);
  10843. this.hTLV = null, this.isModified = !0, this.s = null, this.hV = n
  10844. }, this.setValueName = function(t) {
  10845. var e = J.asn1.x509.OID.name2oid(t);
  10846. if ("" === e) throw "DERObjectIdentifier oidName undefined: " + t;
  10847. this.setValueOidString(e)
  10848. }, this.getFreshValueHex = function() {
  10849. return this.hV
  10850. }, void 0 !== t && ("string" == typeof t ? t.match(/^[0-2].[0-9.]+$/) ? this.setValueOidString(t) : this.setValueName(t) : void 0 !== t.oid ? this.setValueOidString(t.oid) : void 0 !== t.hex ? this.setValueHex(t.hex) : void 0 !== t.name && this.setValueName(t.name))
  10851. }, Q.lang.extend(J.asn1.DERObjectIdentifier, J.asn1.ASN1Object), J.asn1.DEREnumerated = function(t) {
  10852. J.asn1.DEREnumerated.superclass.constructor.call(this), this.hT = "0a", this.setByBigInteger = function(t) {
  10853. this.hTLV = null, this.isModified = !0, this.hV = J.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)
  10854. }, this.setByInteger = function(t) {
  10855. var e = new P(String(t), 10);
  10856. this.setByBigInteger(e)
  10857. }, this.setValueHex = function(t) {
  10858. this.hV = t
  10859. }, this.getFreshValueHex = function() {
  10860. return this.hV
  10861. }, void 0 !== t && (void 0 !== t.int ? this.setByInteger(t.int) : "number" == typeof t ? this.setByInteger(t) : void 0 !== t.hex && this.setValueHex(t.hex))
  10862. }, Q.lang.extend(J.asn1.DEREnumerated, J.asn1.ASN1Object), J.asn1.DERUTF8String = function(t) {
  10863. J.asn1.DERUTF8String.superclass.constructor.call(this, t), this.hT = "0c"
  10864. }, Q.lang.extend(J.asn1.DERUTF8String, J.asn1.DERAbstractString), J.asn1.DERNumericString = function(t) {
  10865. J.asn1.DERNumericString.superclass.constructor.call(this, t), this.hT = "12"
  10866. }, Q.lang.extend(J.asn1.DERNumericString, J.asn1.DERAbstractString), J.asn1.DERPrintableString = function(t) {
  10867. J.asn1.DERPrintableString.superclass.constructor.call(this, t), this.hT = "13"
  10868. }, Q.lang.extend(J.asn1.DERPrintableString, J.asn1.DERAbstractString), J.asn1.DERTeletexString = function(t) {
  10869. J.asn1.DERTeletexString.superclass.constructor.call(this, t), this.hT = "14"
  10870. }, Q.lang.extend(J.asn1.DERTeletexString, J.asn1.DERAbstractString), J.asn1.DERIA5String = function(t) {
  10871. J.asn1.DERIA5String.superclass.constructor.call(this, t), this.hT = "16"
  10872. }, Q.lang.extend(J.asn1.DERIA5String, J.asn1.DERAbstractString), J.asn1.DERUTCTime = function(t) {
  10873. J.asn1.DERUTCTime.superclass.constructor.call(this, t), this.hT = "17", this.setByDate = function(t) {
  10874. this.hTLV = null, this.isModified = !0, this.date = t, this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s)
  10875. }, this.getFreshValueHex = function() {
  10876. return void 0 === this.date && void 0 === this.s && (this.date = new Date, this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s)), this.hV
  10877. }, void 0 !== t && (void 0 !== t.str ? this.setString(t.str) : "string" == typeof t && t.match(/^[0-9]{12}Z$/) ? this.setString(t) : void 0 !== t.hex ? this.setStringHex(t.hex) : void 0 !== t.date && this.setByDate(t.date))
  10878. }, Q.lang.extend(J.asn1.DERUTCTime, J.asn1.DERAbstractTime), J.asn1.DERGeneralizedTime = function(t) {
  10879. J.asn1.DERGeneralizedTime.superclass.constructor.call(this, t), this.hT = "18", this.withMillis = !1, this.setByDate = function(t) {
  10880. this.hTLV = null, this.isModified = !0, this.date = t, this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s)
  10881. }, this.getFreshValueHex = function() {
  10882. return void 0 === this.date && void 0 === this.s && (this.date = new Date, this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s)), this.hV
  10883. }, void 0 !== t && (void 0 !== t.str ? this.setString(t.str) : "string" == typeof t && t.match(/^[0-9]{14}Z$/) ? this.setString(t) : void 0 !== t.hex ? this.setStringHex(t.hex) : void 0 !== t.date && this.setByDate(t.date), !0 === t.millis && (this.withMillis = !0))
  10884. }, Q.lang.extend(J.asn1.DERGeneralizedTime, J.asn1.DERAbstractTime), J.asn1.DERSequence = function(t) {
  10885. J.asn1.DERSequence.superclass.constructor.call(this, t), this.hT = "30", this.getFreshValueHex = function() {
  10886. for (var t = "", e = 0; e < this.asn1Array.length; e++) t += this.asn1Array[e].getEncodedHex();
  10887. return this.hV = t, this.hV
  10888. }
  10889. }, Q.lang.extend(J.asn1.DERSequence, J.asn1.DERAbstractStructured), J.asn1.DERSet = function(t) {
  10890. J.asn1.DERSet.superclass.constructor.call(this, t), this.hT = "31", this.sortFlag = !0, this.getFreshValueHex = function() {
  10891. for (var t = new Array, e = 0; e < this.asn1Array.length; e++) {
  10892. var i = this.asn1Array[e];
  10893. t.push(i.getEncodedHex())
  10894. }
  10895. return 1 == this.sortFlag && t.sort(), this.hV = t.join(""), this.hV
  10896. }, void 0 !== t && void 0 !== t.sortflag && 0 == t.sortflag && (this.sortFlag = !1)
  10897. }, Q.lang.extend(J.asn1.DERSet, J.asn1.DERAbstractStructured), J.asn1.DERTaggedObject = function(t) {
  10898. J.asn1.DERTaggedObject.superclass.constructor.call(this), this.hT = "a0", this.hV = "", this.isExplicit = !0, this.asn1Object = null, this.setASN1Object = function(t, e, i) {
  10899. this.hT = e, this.isExplicit = t, this.asn1Object = i, this.isExplicit ? (this.hV = this.asn1Object.getEncodedHex(), this.hTLV = null, this.isModified = !0) : (this.hV = null, this.hTLV = i.getEncodedHex(), this.hTLV = this.hTLV.replace(/^../, e), this.isModified = !1)
  10900. }, this.getFreshValueHex = function() {
  10901. return this.hV
  10902. }, void 0 !== t && (void 0 !== t.tag && (this.hT = t.tag), void 0 !== t.explicit && (this.isExplicit = t.explicit), void 0 !== t.obj && (this.asn1Object = t.obj, this.setASN1Object(this.isExplicit, this.hT, this.asn1Object)))
  10903. }, Q.lang.extend(J.asn1.DERTaggedObject, J.asn1.ASN1Object);
  10904. var $ = function(t) {
  10905. function e(i) {
  10906. var n = t.call(this) || this;
  10907. return i && ("string" == typeof i ? n.parseKey(i) : (e.hasPrivateKeyProperty(i) || e.hasPublicKeyProperty(i)) && n.parsePropertiesFrom(i)), n
  10908. }
  10909. return function(t, e) {
  10910. function i() {
  10911. this.constructor = t
  10912. }
  10913. p(t, e), t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, new i)
  10914. }(e, t), e.prototype.parseKey = function(t) {
  10915. try {
  10916. var e = 0,
  10917. i = 0,
  10918. n = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(t) ? f(t) : m.unarmor(t),
  10919. r = T.decode(n);
  10920. if (3 === r.sub.length && (r = r.sub[2].sub[0]), 9 === r.sub.length) {
  10921. e = r.sub[1].getHexStringValue(), this.n = I(e, 16), i = r.sub[2].getHexStringValue(), this.e = parseInt(i, 16);
  10922. var o = r.sub[3].getHexStringValue();
  10923. this.d = I(o, 16);
  10924. var a = r.sub[4].getHexStringValue();
  10925. this.p = I(a, 16);
  10926. var s = r.sub[5].getHexStringValue();
  10927. this.q = I(s, 16);
  10928. var l = r.sub[6].getHexStringValue();
  10929. this.dmp1 = I(l, 16);
  10930. var u = r.sub[7].getHexStringValue();
  10931. this.dmq1 = I(u, 16);
  10932. var h = r.sub[8].getHexStringValue();
  10933. this.coeff = I(h, 16)
  10934. } else {
  10935. if (2 !== r.sub.length) return !1;
  10936. var c = r.sub[1].sub[0];
  10937. e = c.sub[0].getHexStringValue(), this.n = I(e, 16), i = c.sub[1].getHexStringValue(), this.e = parseInt(i, 16)
  10938. }
  10939. return !0
  10940. } catch (t) {
  10941. return !1
  10942. }
  10943. }, e.prototype.getPrivateBaseKey = function() {
  10944. var t = {
  10945. array: [new J.asn1.DERInteger({
  10946. int: 0
  10947. }), new J.asn1.DERInteger({
  10948. bigint: this.n
  10949. }), new J.asn1.DERInteger({
  10950. int: this.e
  10951. }), new J.asn1.DERInteger({
  10952. bigint: this.d
  10953. }), new J.asn1.DERInteger({
  10954. bigint: this.p
  10955. }), new J.asn1.DERInteger({
  10956. bigint: this.q
  10957. }), new J.asn1.DERInteger({
  10958. bigint: this.dmp1
  10959. }), new J.asn1.DERInteger({
  10960. bigint: this.dmq1
  10961. }), new J.asn1.DERInteger({
  10962. bigint: this.coeff
  10963. })]
  10964. };
  10965. return new J.asn1.DERSequence(t)
  10966. .getEncodedHex()
  10967. }, e.prototype.getPrivateBaseKeyB64 = function() {
  10968. return u(this.getPrivateBaseKey())
  10969. }, e.prototype.getPublicBaseKey = function() {
  10970. var t = new J.asn1.DERSequence({
  10971. array: [new J.asn1.DERObjectIdentifier({
  10972. oid: "1.2.840.113549.1.1.1"
  10973. }), new J.asn1.DERNull]
  10974. }),
  10975. e = new J.asn1.DERSequence({
  10976. array: [new J.asn1.DERInteger({
  10977. bigint: this.n
  10978. }), new J.asn1.DERInteger({
  10979. int: this.e
  10980. })]
  10981. }),
  10982. i = new J.asn1.DERBitString({
  10983. hex: "00" + e.getEncodedHex()
  10984. });
  10985. return new J.asn1.DERSequence({
  10986. array: [t, i]
  10987. })
  10988. .getEncodedHex()
  10989. }, e.prototype.getPublicBaseKeyB64 = function() {
  10990. return u(this.getPublicBaseKey())
  10991. }, e.wordwrap = function(t, e) {
  10992. if (!t) return t;
  10993. var i = "(.{1," + (e = e || 64) + "})( +|$\n?)|(.{1," + e + "})";
  10994. return t.match(RegExp(i, "g"))
  10995. .join("\n")
  10996. }, e.prototype.getPrivateKey = function() {
  10997. var t = "-----BEGIN RSA PRIVATE KEY-----\n";
  10998. return t += e.wordwrap(this.getPrivateBaseKeyB64()) + "\n", t += "-----END RSA PRIVATE KEY-----"
  10999. }, e.prototype.getPublicKey = function() {
  11000. var t = "-----BEGIN PUBLIC KEY-----\n";
  11001. return t += e.wordwrap(this.getPublicBaseKeyB64()) + "\n", t += "-----END PUBLIC KEY-----"
  11002. }, e.hasPublicKeyProperty = function(t) {
  11003. return (t = t || {})
  11004. .hasOwnProperty("n") && t.hasOwnProperty("e")
  11005. }, e.hasPrivateKeyProperty = function(t) {
  11006. return (t = t || {})
  11007. .hasOwnProperty("n") && t.hasOwnProperty("e") && t.hasOwnProperty("d") && t.hasOwnProperty("p") && t.hasOwnProperty("q") && t.hasOwnProperty("dmp1") && t.hasOwnProperty("dmq1") && t.hasOwnProperty("coeff")
  11008. }, e.prototype.parsePropertiesFrom = function(t) {
  11009. this.n = t.n, this.e = t.e, t.hasOwnProperty("d") && (this.d = t.d, this.p = t.p, this.q = t.q, this.dmp1 = t.dmp1, this.dmq1 = t.dmq1, this.coeff = t.coeff)
  11010. }, e
  11011. }(Z),
  11012. tt = function() {
  11013. function t(t) {
  11014. t = t || {}, this.default_key_size = parseInt(t.default_key_size, 10) || 1024, this.default_public_exponent = t.default_public_exponent || "010001", this.log = t.log || !1, this.key = null
  11015. }
  11016. return t.prototype.setKey = function(t) {
  11017. this.log && this.key, this.key = new $(t)
  11018. }, t.prototype.setPrivateKey = function(t) {
  11019. this.setKey(t)
  11020. }, t.prototype.setPublicKey = function(t) {
  11021. this.setKey(t)
  11022. }, t.prototype.decrypt = function(t) {
  11023. try {
  11024. return this.getKey()
  11025. .decrypt(h(t))
  11026. } catch (t) {
  11027. return !1
  11028. }
  11029. }, t.prototype.encrypt = function(t) {
  11030. try {
  11031. return u(this.getKey()
  11032. .encrypt(t))
  11033. } catch (t) {
  11034. return !1
  11035. }
  11036. }, t.prototype.encryptLong = function(t) {
  11037. var e = this.getKey(),
  11038. i = (e.n.bitLength() + 7 >> 3) - 11;
  11039. try {
  11040. var n = "";
  11041. return t.length > i ? t.match(/.{1,117}/g)
  11042. .forEach((function(t) {
  11043. var i = e.encrypt(t);
  11044. n += i
  11045. })) : n = e.encrypt(t), u(n)
  11046. } catch (t) {
  11047. return !1
  11048. }
  11049. }, t.prototype.sign = function(t, e, i) {
  11050. try {
  11051. return u(this.getKey()
  11052. .sign(t, e, i))
  11053. } catch (t) {
  11054. return !1
  11055. }
  11056. }, t.prototype.verify = function(t, e, i) {
  11057. try {
  11058. return this.getKey()
  11059. .verify(t, h(e), i)
  11060. } catch (t) {
  11061. return !1
  11062. }
  11063. }, t.prototype.getKey = function(t) {
  11064. if (!this.key) {
  11065. if (this.key = new $, t && "[object Function]" === {}.toString.call(t)) return void this.key.generateAsync(this.default_key_size, this.default_public_exponent, t);
  11066. this.key.generate(this.default_key_size, this.default_public_exponent)
  11067. }
  11068. return this.key
  11069. }, t.prototype.getPrivateKey = function() {
  11070. return this.getKey()
  11071. .getPrivateKey()
  11072. }, t.prototype.getPrivateKeyB64 = function() {
  11073. return this.getKey()
  11074. .getPrivateBaseKeyB64()
  11075. }, t.prototype.getPublicKey = function() {
  11076. return this.getKey()
  11077. .getPublicKey()
  11078. }, t.prototype.getPublicKeyB64 = function() {
  11079. return this.getKey()
  11080. .getPublicBaseKeyB64()
  11081. }, t.version = "3.0.0-rc.1", t
  11082. }();
  11083. window.JSEncrypt = tt, t.JSEncrypt = tt, t.default = tt, Object.defineProperty(t, "__esModule", {
  11084. value: !0
  11085. })
  11086. }(e)
  11087. }, function(t, e, i) {
  11088. var n;
  11089. ! function(e, i) {
  11090. "object" == typeof t.exports ? t.exports = e.document ? i(e, !0) : function(t) {
  11091. if (!t.document) throw new Error("jQuery requires a window with a document");
  11092. return i(t)
  11093. } : i(e)
  11094. }("undefined" != typeof window ? window : this, (function(i, r) {
  11095. var o = [],
  11096. a = o.slice,
  11097. s = o.concat,
  11098. l = o.push,
  11099. u = o.indexOf,
  11100. h = {},
  11101. c = h.toString,
  11102. d = h.hasOwnProperty,
  11103. p = {},
  11104. f = i.document,
  11105. m = "2.1.1",
  11106. g = function(t, e) {
  11107. return new g.fn.init(t, e)
  11108. },
  11109. v = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
  11110. y = /^-ms-/,
  11111. b = /-([\da-z])/gi,
  11112. w = function(t, e) {
  11113. return e.toUpperCase()
  11114. };
  11115. function x(t) {
  11116. var e = t.length,
  11117. i = g.type(t);
  11118. return "function" !== i && !g.isWindow(t) && (!(1 !== t.nodeType || !e) || ("array" === i || 0 === e || "number" == typeof e && e > 0 && e - 1 in t))
  11119. }
  11120. g.fn = g.prototype = {
  11121. jquery: m,
  11122. constructor: g,
  11123. selector: "",
  11124. length: 0,
  11125. toArray: function() {
  11126. return a.call(this)
  11127. },
  11128. get: function(t) {
  11129. return null != t ? 0 > t ? this[t + this.length] : this[t] : a.call(this)
  11130. },
  11131. pushStack: function(t) {
  11132. var e = g.merge(this.constructor(), t);
  11133. return e.prevObject = this, e.context = this.context, e
  11134. },
  11135. each: function(t, e) {
  11136. return g.each(this, t, e)
  11137. },
  11138. map: function(t) {
  11139. return this.pushStack(g.map(this, (function(e, i) {
  11140. return t.call(e, i, e)
  11141. })))
  11142. },
  11143. slice: function() {
  11144. return this.pushStack(a.apply(this, arguments))
  11145. },
  11146. first: function() {
  11147. return this.eq(0)
  11148. },
  11149. last: function() {
  11150. return this.eq(-1)
  11151. },
  11152. eq: function(t) {
  11153. var e = this.length,
  11154. i = +t + (0 > t ? e : 0);
  11155. return this.pushStack(i >= 0 && e > i ? [this[i]] : [])
  11156. },
  11157. end: function() {
  11158. return this.prevObject || this.constructor(null)
  11159. },
  11160. push: l,
  11161. sort: o.sort,
  11162. splice: o.splice
  11163. }, g.extend = g.fn.extend = function() {
  11164. var t, e, i, n, r, o, a = arguments[0] || {},
  11165. s = 1,
  11166. l = arguments.length,
  11167. u = !1;
  11168. for ("boolean" == typeof a && (u = a, a = arguments[s] || {}, s++), "object" == typeof a || g.isFunction(a) || (a = {}), s === l && (a = this, s--); l > s; s++)
  11169. if (null != (t = arguments[s]))
  11170. for (e in t) i = a[e], a !== (n = t[e]) && (u && n && (g.isPlainObject(n) || (r = g.isArray(n))) ? (r ? (r = !1, o = i && g.isArray(i) ? i : []) : o = i && g.isPlainObject(i) ? i : {}, a[e] = g.extend(u, o, n)) : void 0 !== n && (a[e] = n));
  11171. return a
  11172. }, g.extend({
  11173. expando: "jQuery" + (m + Math.random())
  11174. .replace(/\D/g, ""),
  11175. isReady: !0,
  11176. error: function(t) {
  11177. throw new Error(t)
  11178. },
  11179. noop: function() {},
  11180. isFunction: function(t) {
  11181. return "function" === g.type(t)
  11182. },
  11183. isArray: Array.isArray,
  11184. isWindow: function(t) {
  11185. return null != t && t === t.window
  11186. },
  11187. isNumeric: function(t) {
  11188. return !g.isArray(t) && t - parseFloat(t) >= 0
  11189. },
  11190. isPlainObject: function(t) {
  11191. return "object" === g.type(t) && !t.nodeType && !g.isWindow(t) && !(t.constructor && !d.call(t.constructor.prototype, "isPrototypeOf"))
  11192. },
  11193. isEmptyObject: function(t) {
  11194. var e;
  11195. for (e in t) return !1;
  11196. return !0
  11197. },
  11198. type: function(t) {
  11199. return null == t ? t + "" : "object" == typeof t || "function" == typeof t ? h[c.call(t)] || "object" : typeof t
  11200. },
  11201. globalEval: function(t) {
  11202. var e, i = eval;
  11203. (t = g.trim(t)) && (1 === t.indexOf("use strict") ? ((e = f.createElement("script"))
  11204. .text = t, f.head.appendChild(e)
  11205. .parentNode.removeChild(e)) : i(t))
  11206. },
  11207. camelCase: function(t) {
  11208. return t.replace(y, "ms-")
  11209. .replace(b, w)
  11210. },
  11211. nodeName: function(t, e) {
  11212. return t.nodeName && t.nodeName.toLowerCase() === e.toLowerCase()
  11213. },
  11214. each: function(t, e, i) {
  11215. var n = 0,
  11216. r = t.length,
  11217. o = x(t);
  11218. if (i) {
  11219. if (o)
  11220. for (; r > n && !1 !== e.apply(t[n], i); n++);
  11221. else
  11222. for (n in t)
  11223. if (!1 === e.apply(t[n], i)) break
  11224. } else if (o)
  11225. for (; r > n && !1 !== e.call(t[n], n, t[n]); n++);
  11226. else
  11227. for (n in t)
  11228. if (!1 === e.call(t[n], n, t[n])) break;
  11229. return t
  11230. },
  11231. trim: function(t) {
  11232. return null == t ? "" : (t + "")
  11233. .replace(v, "")
  11234. },
  11235. makeArray: function(t, e) {
  11236. var i = e || [];
  11237. return null != t && (x(Object(t)) ? g.merge(i, "string" == typeof t ? [t] : t) : l.call(i, t)), i
  11238. },
  11239. inArray: function(t, e, i) {
  11240. return null == e ? -1 : u.call(e, t, i)
  11241. },
  11242. merge: function(t, e) {
  11243. for (var i = +e.length, n = 0, r = t.length; i > n; n++) t[r++] = e[n];
  11244. return t.length = r, t
  11245. },
  11246. grep: function(t, e, i) {
  11247. for (var n = [], r = 0, o = t.length, a = !i; o > r; r++) !e(t[r], r) !== a && n.push(t[r]);
  11248. return n
  11249. },
  11250. map: function(t, e, i) {
  11251. var n, r = 0,
  11252. o = t.length,
  11253. a = [];
  11254. if (x(t))
  11255. for (; o > r; r++) null != (n = e(t[r], r, i)) && a.push(n);
  11256. else
  11257. for (r in t) null != (n = e(t[r], r, i)) && a.push(n);
  11258. return s.apply([], a)
  11259. },
  11260. guid: 1,
  11261. proxy: function(t, e) {
  11262. var i, n, r;
  11263. return "string" == typeof e && (i = t[e], e = t, t = i), g.isFunction(t) ? (n = a.call(arguments, 2), (r = function() {
  11264. return t.apply(e || this, n.concat(a.call(arguments)))
  11265. })
  11266. .guid = t.guid = t.guid || g.guid++, r) : void 0
  11267. },
  11268. now: Date.now,
  11269. support: p
  11270. }), g.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), (function(t, e) {
  11271. h["[object " + e + "]"] = e.toLowerCase()
  11272. }));
  11273. var M = function(t) {
  11274. var e, i, n, r, o, a, s, l, u, h, c, d, p, f, m, g, v, y, b, w = "sizzle" + -new Date,
  11275. x = t.document,
  11276. M = 0,
  11277. T = 0,
  11278. S = rt(),
  11279. _ = rt(),
  11280. A = rt(),
  11281. P = function(t, e) {
  11282. return t === e && (c = !0), 0
  11283. },
  11284. C = "undefined",
  11285. E = {}.hasOwnProperty,
  11286. D = [],
  11287. L = D.pop,
  11288. O = D.push,
  11289. I = D.push,
  11290. R = D.slice,
  11291. N = D.indexOf || function(t) {
  11292. for (var e = 0, i = this.length; i > e; e++)
  11293. if (this[e] === t) return e;
  11294. return -1
  11295. },
  11296. k = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
  11297. F = "[\\x20\\t\\r\\n\\f]",
  11298. B = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
  11299. z = B.replace("w", "w#"),
  11300. U = "\\[" + F + "*(" + B + ")(?:" + F + "*([*^$|!~]?=)" + F + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + z + "))|)" + F + "*\\]",
  11301. V = ":(" + B + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + U + ")*)|.*)\\)|)",
  11302. j = new RegExp("^" + F + "+|((?:^|[^\\\\])(?:\\\\.)*)" + F + "+$", "g"),
  11303. H = new RegExp("^" + F + "*," + F + "*"),
  11304. G = new RegExp("^" + F + "*([>+~]|" + F + ")" + F + "*"),
  11305. W = new RegExp("=" + F + "*([^\\]'\"]*?)" + F + "*\\]", "g"),
  11306. q = new RegExp(V),
  11307. Y = new RegExp("^" + z + "$"),
  11308. X = {
  11309. ID: new RegExp("^#(" + B + ")"),
  11310. CLASS: new RegExp("^\\.(" + B + ")"),
  11311. TAG: new RegExp("^(" + B.replace("w", "w*") + ")"),
  11312. ATTR: new RegExp("^" + U),
  11313. PSEUDO: new RegExp("^" + V),
  11314. CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + F + "*(even|odd|(([+-]|)(\\d*)n|)" + F + "*(?:([+-]|)" + F + "*(\\d+)|))" + F + "*\\)|)", "i"),
  11315. bool: new RegExp("^(?:" + k + ")$", "i"),
  11316. needsContext: new RegExp("^" + F + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + F + "*((?:-\\d)?\\d*)" + F + "*\\)|)(?=[^-]|$)", "i")
  11317. },
  11318. Z = /^(?:input|select|textarea|button)$/i,
  11319. K = /^h\d$/i,
  11320. Q = /^[^{]+\{\s*\[native \w/,
  11321. J = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  11322. $ = /[+~]/,
  11323. tt = /'|\\/g,
  11324. et = new RegExp("\\\\([\\da-f]{1,6}" + F + "?|(" + F + ")|.)", "ig"),
  11325. it = function(t, e, i) {
  11326. var n = "0x" + e - 65536;
  11327. return n != n || i ? e : 0 > n ? String.fromCharCode(n + 65536) : String.fromCharCode(n >> 10 | 55296, 1023 & n | 56320)
  11328. };
  11329. try {
  11330. I.apply(D = R.call(x.childNodes), x.childNodes), D[x.childNodes.length].nodeType
  11331. } catch (t) {
  11332. I = {
  11333. apply: D.length ? function(t, e) {
  11334. O.apply(t, R.call(e))
  11335. } : function(t, e) {
  11336. for (var i = t.length, n = 0; t[i++] = e[n++];);
  11337. t.length = i - 1
  11338. }
  11339. }
  11340. }
  11341. function nt(t, e, n, r) {
  11342. var o, s, u, h, c, f, v, y, M, T;
  11343. if ((e ? e.ownerDocument || e : x) !== p && d(e), n = n || [], !t || "string" != typeof t) return n;
  11344. if (1 !== (h = (e = e || p)
  11345. .nodeType) && 9 !== h) return [];
  11346. if (m && !r) {
  11347. if (o = J.exec(t))
  11348. if (u = o[1]) {
  11349. if (9 === h) {
  11350. if (!(s = e.getElementById(u)) || !s.parentNode) return n;
  11351. if (s.id === u) return n.push(s), n
  11352. } else if (e.ownerDocument && (s = e.ownerDocument.getElementById(u)) && b(e, s) && s.id === u) return n.push(s), n
  11353. } else {
  11354. if (o[2]) return I.apply(n, e.getElementsByTagName(t)), n;
  11355. if ((u = o[3]) && i.getElementsByClassName && e.getElementsByClassName) return I.apply(n, e.getElementsByClassName(u)), n
  11356. } if (i.qsa && (!g || !g.test(t))) {
  11357. if (y = v = w, M = e, T = 9 === h && t, 1 === h && "object" !== e.nodeName.toLowerCase()) {
  11358. for (f = a(t), (v = e.getAttribute("id")) ? y = v.replace(tt, "\\$&") : e.setAttribute("id", y), y = "[id='" + y + "'] ", c = f.length; c--;) f[c] = y + ft(f[c]);
  11359. M = $.test(t) && dt(e.parentNode) || e, T = f.join(",")
  11360. }
  11361. if (T) try {
  11362. return I.apply(n, M.querySelectorAll(T)), n
  11363. } catch (t) {} finally {
  11364. v || e.removeAttribute("id")
  11365. }
  11366. }
  11367. }
  11368. return l(t.replace(j, "$1"), e, n, r)
  11369. }
  11370. function rt() {
  11371. var t = [];
  11372. return function e(i, r) {
  11373. return t.push(i + " ") > n.cacheLength && delete e[t.shift()], e[i + " "] = r
  11374. }
  11375. }
  11376. function ot(t) {
  11377. return t[w] = !0, t
  11378. }
  11379. function at(t) {
  11380. var e = p.createElement("div");
  11381. try {
  11382. return !!t(e)
  11383. } catch (t) {
  11384. return !1
  11385. } finally {
  11386. e.parentNode && e.parentNode.removeChild(e), e = null
  11387. }
  11388. }
  11389. function st(t, e) {
  11390. for (var i = t.split("|"), r = t.length; r--;) n.attrHandle[i[r]] = e
  11391. }
  11392. function lt(t, e) {
  11393. var i = e && t,
  11394. n = i && 1 === t.nodeType && 1 === e.nodeType && (~e.sourceIndex || 1 << 31) - (~t.sourceIndex || 1 << 31);
  11395. if (n) return n;
  11396. if (i)
  11397. for (; i = i.nextSibling;)
  11398. if (i === e) return -1;
  11399. return t ? 1 : -1
  11400. }
  11401. function ut(t) {
  11402. return function(e) {
  11403. return "input" === e.nodeName.toLowerCase() && e.type === t
  11404. }
  11405. }
  11406. function ht(t) {
  11407. return function(e) {
  11408. var i = e.nodeName.toLowerCase();
  11409. return ("input" === i || "button" === i) && e.type === t
  11410. }
  11411. }
  11412. function ct(t) {
  11413. return ot((function(e) {
  11414. return e = +e, ot((function(i, n) {
  11415. for (var r, o = t([], i.length, e), a = o.length; a--;) i[r = o[a]] && (i[r] = !(n[r] = i[r]))
  11416. }))
  11417. }))
  11418. }
  11419. function dt(t) {
  11420. return t && typeof t.getElementsByTagName !== C && t
  11421. }
  11422. for (e in i = nt.support = {}, o = nt.isXML = function(t) {
  11423. var e = t && (t.ownerDocument || t)
  11424. .documentElement;
  11425. return !!e && "HTML" !== e.nodeName
  11426. }, d = nt.setDocument = function(t) {
  11427. var e, r = t ? t.ownerDocument || t : x,
  11428. a = r.defaultView;
  11429. return r !== p && 9 === r.nodeType && r.documentElement ? (p = r, f = r.documentElement, m = !o(r), a && a !== a.top && (a.addEventListener ? a.addEventListener("unload", (function() {
  11430. d()
  11431. }), !1) : a.attachEvent && a.attachEvent("onunload", (function() {
  11432. d()
  11433. }))), i.attributes = at((function(t) {
  11434. return t.className = "i", !t.getAttribute("className")
  11435. })), i.getElementsByTagName = at((function(t) {
  11436. return t.appendChild(r.createComment("")), !t.getElementsByTagName("*")
  11437. .length
  11438. })), i.getElementsByClassName = Q.test(r.getElementsByClassName) && at((function(t) {
  11439. return t.innerHTML = "<div class='a'></div><div class='a i'></div>", t.firstChild.className = "i", 2 === t.getElementsByClassName("i")
  11440. .length
  11441. })), i.getById = at((function(t) {
  11442. return f.appendChild(t)
  11443. .id = w, !r.getElementsByName || !r.getElementsByName(w)
  11444. .length
  11445. })), i.getById ? (n.find.ID = function(t, e) {
  11446. if (typeof e.getElementById !== C && m) {
  11447. var i = e.getElementById(t);
  11448. return i && i.parentNode ? [i] : []
  11449. }
  11450. }, n.filter.ID = function(t) {
  11451. var e = t.replace(et, it);
  11452. return function(t) {
  11453. return t.getAttribute("id") === e
  11454. }
  11455. }) : (delete n.find.ID, n.filter.ID = function(t) {
  11456. var e = t.replace(et, it);
  11457. return function(t) {
  11458. var i = typeof t.getAttributeNode !== C && t.getAttributeNode("id");
  11459. return i && i.value === e
  11460. }
  11461. }), n.find.TAG = i.getElementsByTagName ? function(t, e) {
  11462. return typeof e.getElementsByTagName !== C ? e.getElementsByTagName(t) : void 0
  11463. } : function(t, e) {
  11464. var i, n = [],
  11465. r = 0,
  11466. o = e.getElementsByTagName(t);
  11467. if ("*" === t) {
  11468. for (; i = o[r++];) 1 === i.nodeType && n.push(i);
  11469. return n
  11470. }
  11471. return o
  11472. }, n.find.CLASS = i.getElementsByClassName && function(t, e) {
  11473. return typeof e.getElementsByClassName !== C && m ? e.getElementsByClassName(t) : void 0
  11474. }, v = [], g = [], (i.qsa = Q.test(r.querySelectorAll)) && (at((function(t) {
  11475. t.innerHTML = "<select msallowclip=''><option selected=''></option></select>", t.querySelectorAll("[msallowclip^='']")
  11476. .length && g.push("[*^$]=" + F + "*(?:''|\"\")"), t.querySelectorAll("[selected]")
  11477. .length || g.push("\\[" + F + "*(?:value|" + k + ")"), t.querySelectorAll(":checked")
  11478. .length || g.push(":checked")
  11479. })), at((function(t) {
  11480. var e = r.createElement("input");
  11481. e.setAttribute("type", "hidden"), t.appendChild(e)
  11482. .setAttribute("name", "D"), t.querySelectorAll("[name=d]")
  11483. .length && g.push("name" + F + "*[*^$|!~]?="), t.querySelectorAll(":enabled")
  11484. .length || g.push(":enabled", ":disabled"), t.querySelectorAll("*,:x"), g.push(",.*:")
  11485. }))), (i.matchesSelector = Q.test(y = f.matches || f.webkitMatchesSelector || f.mozMatchesSelector || f.oMatchesSelector || f.msMatchesSelector)) && at((function(t) {
  11486. i.disconnectedMatch = y.call(t, "div"), y.call(t, "[s!='']:x"), v.push("!=", V)
  11487. })), g = g.length && new RegExp(g.join("|")), v = v.length && new RegExp(v.join("|")), e = Q.test(f.compareDocumentPosition), b = e || Q.test(f.contains) ? function(t, e) {
  11488. var i = 9 === t.nodeType ? t.documentElement : t,
  11489. n = e && e.parentNode;
  11490. return t === n || !(!n || 1 !== n.nodeType || !(i.contains ? i.contains(n) : t.compareDocumentPosition && 16 & t.compareDocumentPosition(n)))
  11491. } : function(t, e) {
  11492. if (e)
  11493. for (; e = e.parentNode;)
  11494. if (e === t) return !0;
  11495. return !1
  11496. }, P = e ? function(t, e) {
  11497. if (t === e) return c = !0, 0;
  11498. var n = !t.compareDocumentPosition - !e.compareDocumentPosition;
  11499. return n || (1 & (n = (t.ownerDocument || t) === (e.ownerDocument || e) ? t.compareDocumentPosition(e) : 1) || !i.sortDetached && e.compareDocumentPosition(t) === n ? t === r || t.ownerDocument === x && b(x, t) ? -1 : e === r || e.ownerDocument === x && b(x, e) ? 1 : h ? N.call(h, t) - N.call(h, e) : 0 : 4 & n ? -1 : 1)
  11500. } : function(t, e) {
  11501. if (t === e) return c = !0, 0;
  11502. var i, n = 0,
  11503. o = t.parentNode,
  11504. a = e.parentNode,
  11505. s = [t],
  11506. l = [e];
  11507. if (!o || !a) return t === r ? -1 : e === r ? 1 : o ? -1 : a ? 1 : h ? N.call(h, t) - N.call(h, e) : 0;
  11508. if (o === a) return lt(t, e);
  11509. for (i = t; i = i.parentNode;) s.unshift(i);
  11510. for (i = e; i = i.parentNode;) l.unshift(i);
  11511. for (; s[n] === l[n];) n++;
  11512. return n ? lt(s[n], l[n]) : s[n] === x ? -1 : l[n] === x ? 1 : 0
  11513. }, r) : p
  11514. }, nt.matches = function(t, e) {
  11515. return nt(t, null, null, e)
  11516. }, nt.matchesSelector = function(t, e) {
  11517. if ((t.ownerDocument || t) !== p && d(t), e = e.replace(W, "='$1']"), !(!i.matchesSelector || !m || v && v.test(e) || g && g.test(e))) try {
  11518. var n = y.call(t, e);
  11519. if (n || i.disconnectedMatch || t.document && 11 !== t.document.nodeType) return n
  11520. } catch (t) {}
  11521. return nt(e, p, null, [t])
  11522. .length > 0
  11523. }, nt.contains = function(t, e) {
  11524. return (t.ownerDocument || t) !== p && d(t), b(t, e)
  11525. }, nt.attr = function(t, e) {
  11526. (t.ownerDocument || t) !== p && d(t);
  11527. var r = n.attrHandle[e.toLowerCase()],
  11528. o = r && E.call(n.attrHandle, e.toLowerCase()) ? r(t, e, !m) : void 0;
  11529. return void 0 !== o ? o : i.attributes || !m ? t.getAttribute(e) : (o = t.getAttributeNode(e)) && o.specified ? o.value : null
  11530. }, nt.error = function(t) {
  11531. throw new Error("Syntax error, unrecognized expression: " + t)
  11532. }, nt.uniqueSort = function(t) {
  11533. var e, n = [],
  11534. r = 0,
  11535. o = 0;
  11536. if (c = !i.detectDuplicates, h = !i.sortStable && t.slice(0), t.sort(P), c) {
  11537. for (; e = t[o++];) e === t[o] && (r = n.push(o));
  11538. for (; r--;) t.splice(n[r], 1)
  11539. }
  11540. return h = null, t
  11541. }, r = nt.getText = function(t) {
  11542. var e, i = "",
  11543. n = 0,
  11544. o = t.nodeType;
  11545. if (o) {
  11546. if (1 === o || 9 === o || 11 === o) {
  11547. if ("string" == typeof t.textContent) return t.textContent;
  11548. for (t = t.firstChild; t; t = t.nextSibling) i += r(t)
  11549. } else if (3 === o || 4 === o) return t.nodeValue
  11550. } else
  11551. for (; e = t[n++];) i += r(e);
  11552. return i
  11553. }, (n = nt.selectors = {
  11554. cacheLength: 50,
  11555. createPseudo: ot,
  11556. match: X,
  11557. attrHandle: {},
  11558. find: {},
  11559. relative: {
  11560. ">": {
  11561. dir: "parentNode",
  11562. first: !0
  11563. },
  11564. " ": {
  11565. dir: "parentNode"
  11566. },
  11567. "+": {
  11568. dir: "previousSibling",
  11569. first: !0
  11570. },
  11571. "~": {
  11572. dir: "previousSibling"
  11573. }
  11574. },
  11575. preFilter: {
  11576. ATTR: function(t) {
  11577. return t[1] = t[1].replace(et, it), t[3] = (t[3] || t[4] || t[5] || "")
  11578. .replace(et, it), "~=" === t[2] && (t[3] = " " + t[3] + " "), t.slice(0, 4)
  11579. },
  11580. CHILD: function(t) {
  11581. return t[1] = t[1].toLowerCase(), "nth" === t[1].slice(0, 3) ? (t[3] || nt.error(t[0]), t[4] = +(t[4] ? t[5] + (t[6] || 1) : 2 * ("even" === t[3] || "odd" === t[3])), t[5] = +(t[7] + t[8] || "odd" === t[3])) : t[3] && nt.error(t[0]), t
  11582. },
  11583. PSEUDO: function(t) {
  11584. var e, i = !t[6] && t[2];
  11585. return X.CHILD.test(t[0]) ? null : (t[3] ? t[2] = t[4] || t[5] || "" : i && q.test(i) && (e = a(i, !0)) && (e = i.indexOf(")", i.length - e) - i.length) && (t[0] = t[0].slice(0, e), t[2] = i.slice(0, e)), t.slice(0, 3))
  11586. }
  11587. },
  11588. filter: {
  11589. TAG: function(t) {
  11590. var e = t.replace(et, it)
  11591. .toLowerCase();
  11592. return "*" === t ? function() {
  11593. return !0
  11594. } : function(t) {
  11595. return t.nodeName && t.nodeName.toLowerCase() === e
  11596. }
  11597. },
  11598. CLASS: function(t) {
  11599. var e = S[t + " "];
  11600. return e || (e = new RegExp("(^|" + F + ")" + t + "(" + F + "|$)")) && S(t, (function(t) {
  11601. return e.test("string" == typeof t.className && t.className || typeof t.getAttribute !== C && t.getAttribute("class") || "")
  11602. }))
  11603. },
  11604. ATTR: function(t, e, i) {
  11605. return function(n) {
  11606. var r = nt.attr(n, t);
  11607. return null == r ? "!=" === e : !e || (r += "", "=" === e ? r === i : "!=" === e ? r !== i : "^=" === e ? i && 0 === r.indexOf(i) : "*=" === e ? i && r.indexOf(i) > -1 : "$=" === e ? i && r.slice(-i.length) === i : "~=" === e ? (" " + r + " ")
  11608. .indexOf(i) > -1 : "|=" === e && (r === i || r.slice(0, i.length + 1) === i + "-"))
  11609. }
  11610. },
  11611. CHILD: function(t, e, i, n, r) {
  11612. var o = "nth" !== t.slice(0, 3),
  11613. a = "last" !== t.slice(-4),
  11614. s = "of-type" === e;
  11615. return 1 === n && 0 === r ? function(t) {
  11616. return !!t.parentNode
  11617. } : function(e, i, l) {
  11618. var u, h, c, d, p, f, m = o !== a ? "nextSibling" : "previousSibling",
  11619. g = e.parentNode,
  11620. v = s && e.nodeName.toLowerCase(),
  11621. y = !l && !s;
  11622. if (g) {
  11623. if (o) {
  11624. for (; m;) {
  11625. for (c = e; c = c[m];)
  11626. if (s ? c.nodeName.toLowerCase() === v : 1 === c.nodeType) return !1;
  11627. f = m = "only" === t && !f && "nextSibling"
  11628. }
  11629. return !0
  11630. }
  11631. if (f = [a ? g.firstChild : g.lastChild], a && y) {
  11632. for (p = (u = (h = g[w] || (g[w] = {}))[t] || [])[0] === M && u[1], d = u[0] === M && u[2], c = p && g.childNodes[p]; c = ++p && c && c[m] || (d = p = 0) || f.pop();)
  11633. if (1 === c.nodeType && ++d && c === e) {
  11634. h[t] = [M, p, d];
  11635. break
  11636. }
  11637. } else if (y && (u = (e[w] || (e[w] = {}))[t]) && u[0] === M) d = u[1];
  11638. else
  11639. for (;
  11640. (c = ++p && c && c[m] || (d = p = 0) || f.pop()) && ((s ? c.nodeName.toLowerCase() !== v : 1 !== c.nodeType) || !++d || (y && ((c[w] || (c[w] = {}))[t] = [M, d]), c !== e)););
  11641. return (d -= r) === n || d % n == 0 && d / n >= 0
  11642. }
  11643. }
  11644. },
  11645. PSEUDO: function(t, e) {
  11646. var i, r = n.pseudos[t] || n.setFilters[t.toLowerCase()] || nt.error("unsupported pseudo: " + t);
  11647. return r[w] ? r(e) : r.length > 1 ? (i = [t, t, "", e], n.setFilters.hasOwnProperty(t.toLowerCase()) ? ot((function(t, i) {
  11648. for (var n, o = r(t, e), a = o.length; a--;) t[n = N.call(t, o[a])] = !(i[n] = o[a])
  11649. })) : function(t) {
  11650. return r(t, 0, i)
  11651. }) : r
  11652. }
  11653. },
  11654. pseudos: {
  11655. not: ot((function(t) {
  11656. var e = [],
  11657. i = [],
  11658. n = s(t.replace(j, "$1"));
  11659. return n[w] ? ot((function(t, e, i, r) {
  11660. for (var o, a = n(t, null, r, []), s = t.length; s--;)(o = a[s]) && (t[s] = !(e[s] = o))
  11661. })) : function(t, r, o) {
  11662. return e[0] = t, n(e, null, o, i), !i.pop()
  11663. }
  11664. })),
  11665. has: ot((function(t) {
  11666. return function(e) {
  11667. return nt(t, e)
  11668. .length > 0
  11669. }
  11670. })),
  11671. contains: ot((function(t) {
  11672. return function(e) {
  11673. return (e.textContent || e.innerText || r(e))
  11674. .indexOf(t) > -1
  11675. }
  11676. })),
  11677. lang: ot((function(t) {
  11678. return Y.test(t || "") || nt.error("unsupported lang: " + t), t = t.replace(et, it)
  11679. .toLowerCase(),
  11680. function(e) {
  11681. var i;
  11682. do {
  11683. if (i = m ? e.lang : e.getAttribute("xml:lang") || e.getAttribute("lang")) return (i = i.toLowerCase()) === t || 0 === i.indexOf(t + "-")
  11684. } while ((e = e.parentNode) && 1 === e.nodeType);
  11685. return !1
  11686. }
  11687. })),
  11688. target: function(e) {
  11689. var i = t.location && t.location.hash;
  11690. return i && i.slice(1) === e.id
  11691. },
  11692. root: function(t) {
  11693. return t === f
  11694. },
  11695. focus: function(t) {
  11696. return t === p.activeElement && (!p.hasFocus || p.hasFocus()) && !!(t.type || t.href || ~t.tabIndex)
  11697. },
  11698. enabled: function(t) {
  11699. return !1 === t.disabled
  11700. },
  11701. disabled: function(t) {
  11702. return !0 === t.disabled
  11703. },
  11704. checked: function(t) {
  11705. var e = t.nodeName.toLowerCase();
  11706. return "input" === e && !!t.checked || "option" === e && !!t.selected
  11707. },
  11708. selected: function(t) {
  11709. return t.parentNode && t.parentNode.selectedIndex, !0 === t.selected
  11710. },
  11711. empty: function(t) {
  11712. for (t = t.firstChild; t; t = t.nextSibling)
  11713. if (t.nodeType < 6) return !1;
  11714. return !0
  11715. },
  11716. parent: function(t) {
  11717. return !n.pseudos.empty(t)
  11718. },
  11719. header: function(t) {
  11720. return K.test(t.nodeName)
  11721. },
  11722. input: function(t) {
  11723. return Z.test(t.nodeName)
  11724. },
  11725. button: function(t) {
  11726. var e = t.nodeName.toLowerCase();
  11727. return "input" === e && "button" === t.type || "button" === e
  11728. },
  11729. text: function(t) {
  11730. var e;
  11731. return "input" === t.nodeName.toLowerCase() && "text" === t.type && (null == (e = t.getAttribute("type")) || "text" === e.toLowerCase())
  11732. },
  11733. first: ct((function() {
  11734. return [0]
  11735. })),
  11736. last: ct((function(t, e) {
  11737. return [e - 1]
  11738. })),
  11739. eq: ct((function(t, e, i) {
  11740. return [0 > i ? i + e : i]
  11741. })),
  11742. even: ct((function(t, e) {
  11743. for (var i = 0; e > i; i += 2) t.push(i);
  11744. return t
  11745. })),
  11746. odd: ct((function(t, e) {
  11747. for (var i = 1; e > i; i += 2) t.push(i);
  11748. return t
  11749. })),
  11750. lt: ct((function(t, e, i) {
  11751. for (var n = 0 > i ? i + e : i; --n >= 0;) t.push(n);
  11752. return t
  11753. })),
  11754. gt: ct((function(t, e, i) {
  11755. for (var n = 0 > i ? i + e : i; ++n < e;) t.push(n);
  11756. return t
  11757. }))
  11758. }
  11759. })
  11760. .pseudos.nth = n.pseudos.eq, {
  11761. radio: !0,
  11762. checkbox: !0,
  11763. file: !0,
  11764. password: !0,
  11765. image: !0
  11766. }) n.pseudos[e] = ut(e);
  11767. for (e in {
  11768. submit: !0,
  11769. reset: !0
  11770. }) n.pseudos[e] = ht(e);
  11771. function pt() {}
  11772. function ft(t) {
  11773. for (var e = 0, i = t.length, n = ""; i > e; e++) n += t[e].value;
  11774. return n
  11775. }
  11776. function mt(t, e, i) {
  11777. var n = e.dir,
  11778. r = i && "parentNode" === n,
  11779. o = T++;
  11780. return e.first ? function(e, i, o) {
  11781. for (; e = e[n];)
  11782. if (1 === e.nodeType || r) return t(e, i, o)
  11783. } : function(e, i, a) {
  11784. var s, l, u = [M, o];
  11785. if (a) {
  11786. for (; e = e[n];)
  11787. if ((1 === e.nodeType || r) && t(e, i, a)) return !0
  11788. } else
  11789. for (; e = e[n];)
  11790. if (1 === e.nodeType || r) {
  11791. if ((s = (l = e[w] || (e[w] = {}))[n]) && s[0] === M && s[1] === o) return u[2] = s[2];
  11792. if (l[n] = u, u[2] = t(e, i, a)) return !0
  11793. }
  11794. }
  11795. }
  11796. function gt(t) {
  11797. return t.length > 1 ? function(e, i, n) {
  11798. for (var r = t.length; r--;)
  11799. if (!t[r](e, i, n)) return !1;
  11800. return !0
  11801. } : t[0]
  11802. }
  11803. function vt(t, e, i, n, r) {
  11804. for (var o, a = [], s = 0, l = t.length, u = null != e; l > s; s++)(o = t[s]) && (!i || i(o, n, r)) && (a.push(o), u && e.push(s));
  11805. return a
  11806. }
  11807. function yt(t, e, i, n, r, o) {
  11808. return n && !n[w] && (n = yt(n)), r && !r[w] && (r = yt(r, o)), ot((function(o, a, s, l) {
  11809. var u, h, c, d = [],
  11810. p = [],
  11811. f = a.length,
  11812. m = o || function(t, e, i) {
  11813. for (var n = 0, r = e.length; r > n; n++) nt(t, e[n], i);
  11814. return i
  11815. }(e || "*", s.nodeType ? [s] : s, []),
  11816. g = !t || !o && e ? m : vt(m, d, t, s, l),
  11817. v = i ? r || (o ? t : f || n) ? [] : a : g;
  11818. if (i && i(g, v, s, l), n)
  11819. for (u = vt(v, p), n(u, [], s, l), h = u.length; h--;)(c = u[h]) && (v[p[h]] = !(g[p[h]] = c));
  11820. if (o) {
  11821. if (r || t) {
  11822. if (r) {
  11823. for (u = [], h = v.length; h--;)(c = v[h]) && u.push(g[h] = c);
  11824. r(null, v = [], u, l)
  11825. }
  11826. for (h = v.length; h--;)(c = v[h]) && (u = r ? N.call(o, c) : d[h]) > -1 && (o[u] = !(a[u] = c))
  11827. }
  11828. } else v = vt(v === a ? v.splice(f, v.length) : v), r ? r(null, a, v, l) : I.apply(a, v)
  11829. }))
  11830. }
  11831. function bt(t) {
  11832. for (var e, i, r, o = t.length, a = n.relative[t[0].type], s = a || n.relative[" "], l = a ? 1 : 0, h = mt((function(t) {
  11833. return t === e
  11834. }), s, !0), c = mt((function(t) {
  11835. return N.call(e, t) > -1
  11836. }), s, !0), d = [function(t, i, n) {
  11837. return !a && (n || i !== u) || ((e = i)
  11838. .nodeType ? h(t, i, n) : c(t, i, n))
  11839. }]; o > l; l++)
  11840. if (i = n.relative[t[l].type]) d = [mt(gt(d), i)];
  11841. else {
  11842. if ((i = n.filter[t[l].type].apply(null, t[l].matches))[w]) {
  11843. for (r = ++l; o > r && !n.relative[t[r].type]; r++);
  11844. return yt(l > 1 && gt(d), l > 1 && ft(t.slice(0, l - 1)
  11845. .concat({
  11846. value: " " === t[l - 2].type ? "*" : ""
  11847. }))
  11848. .replace(j, "$1"), i, r > l && bt(t.slice(l, r)), o > r && bt(t = t.slice(r)), o > r && ft(t))
  11849. }
  11850. d.push(i)
  11851. } return gt(d)
  11852. }
  11853. function wt(t, e) {
  11854. var i = e.length > 0,
  11855. r = t.length > 0,
  11856. o = function(o, a, s, l, h) {
  11857. var c, d, f, m = 0,
  11858. g = "0",
  11859. v = o && [],
  11860. y = [],
  11861. b = u,
  11862. w = o || r && n.find.TAG("*", h),
  11863. x = M += null == b ? 1 : Math.random() || .1,
  11864. T = w.length;
  11865. for (h && (u = a !== p && a); g !== T && null != (c = w[g]); g++) {
  11866. if (r && c) {
  11867. for (d = 0; f = t[d++];)
  11868. if (f(c, a, s)) {
  11869. l.push(c);
  11870. break
  11871. } h && (M = x)
  11872. }
  11873. i && ((c = !f && c) && m--, o && v.push(c))
  11874. }
  11875. if (m += g, i && g !== m) {
  11876. for (d = 0; f = e[d++];) f(v, y, a, s);
  11877. if (o) {
  11878. if (m > 0)
  11879. for (; g--;) v[g] || y[g] || (y[g] = L.call(l));
  11880. y = vt(y)
  11881. }
  11882. I.apply(l, y), h && !o && y.length > 0 && m + e.length > 1 && nt.uniqueSort(l)
  11883. }
  11884. return h && (M = x, u = b), v
  11885. };
  11886. return i ? ot(o) : o
  11887. }
  11888. return pt.prototype = n.filters = n.pseudos, n.setFilters = new pt, a = nt.tokenize = function(t, e) {
  11889. var i, r, o, a, s, l, u, h = _[t + " "];
  11890. if (h) return e ? 0 : h.slice(0);
  11891. for (s = t, l = [], u = n.preFilter; s;) {
  11892. for (a in (!i || (r = H.exec(s))) && (r && (s = s.slice(r[0].length) || s), l.push(o = [])), i = !1, (r = G.exec(s)) && (i = r.shift(), o.push({
  11893. value: i,
  11894. type: r[0].replace(j, " ")
  11895. }), s = s.slice(i.length)), n.filter) !(r = X[a].exec(s)) || u[a] && !(r = u[a](r)) || (i = r.shift(), o.push({
  11896. value: i,
  11897. type: a,
  11898. matches: r
  11899. }), s = s.slice(i.length));
  11900. if (!i) break
  11901. }
  11902. return e ? s.length : s ? nt.error(t) : _(t, l)
  11903. .slice(0)
  11904. }, s = nt.compile = function(t, e) {
  11905. var i, n = [],
  11906. r = [],
  11907. o = A[t + " "];
  11908. if (!o) {
  11909. for (e || (e = a(t)), i = e.length; i--;)(o = bt(e[i]))[w] ? n.push(o) : r.push(o);
  11910. (o = A(t, wt(r, n)))
  11911. .selector = t
  11912. }
  11913. return o
  11914. }, l = nt.select = function(t, e, r, o) {
  11915. var l, u, h, c, d, p = "function" == typeof t && t,
  11916. f = !o && a(t = p.selector || t);
  11917. if (r = r || [], 1 === f.length) {
  11918. if ((u = f[0] = f[0].slice(0))
  11919. .length > 2 && "ID" === (h = u[0])
  11920. .type && i.getById && 9 === e.nodeType && m && n.relative[u[1].type]) {
  11921. if (!(e = (n.find.ID(h.matches[0].replace(et, it), e) || [])[0])) return r;
  11922. p && (e = e.parentNode), t = t.slice(u.shift()
  11923. .value.length)
  11924. }
  11925. for (l = X.needsContext.test(t) ? 0 : u.length; l-- && (h = u[l], !n.relative[c = h.type]);)
  11926. if ((d = n.find[c]) && (o = d(h.matches[0].replace(et, it), $.test(u[0].type) && dt(e.parentNode) || e))) {
  11927. if (u.splice(l, 1), !(t = o.length && ft(u))) return I.apply(r, o), r;
  11928. break
  11929. }
  11930. }
  11931. return (p || s(t, f))(o, e, !m, r, $.test(t) && dt(e.parentNode) || e), r
  11932. }, i.sortStable = w.split("")
  11933. .sort(P)
  11934. .join("") === w, i.detectDuplicates = !!c, d(), i.sortDetached = at((function(t) {
  11935. return 1 & t.compareDocumentPosition(p.createElement("div"))
  11936. })), at((function(t) {
  11937. return t.innerHTML = "<a href='#'></a>", "#" === t.firstChild.getAttribute("href")
  11938. })) || st("type|href|height|width", (function(t, e, i) {
  11939. return i ? void 0 : t.getAttribute(e, "type" === e.toLowerCase() ? 1 : 2)
  11940. })), i.attributes && at((function(t) {
  11941. return t.innerHTML = "<input/>", t.firstChild.setAttribute("value", ""), "" === t.firstChild.getAttribute("value")
  11942. })) || st("value", (function(t, e, i) {
  11943. return i || "input" !== t.nodeName.toLowerCase() ? void 0 : t.defaultValue
  11944. })), at((function(t) {
  11945. return null == t.getAttribute("disabled")
  11946. })) || st(k, (function(t, e, i) {
  11947. var n;
  11948. return i ? void 0 : !0 === t[e] ? e.toLowerCase() : (n = t.getAttributeNode(e)) && n.specified ? n.value : null
  11949. })), nt
  11950. }(i);
  11951. g.find = M, g.expr = M.selectors, g.expr[":"] = g.expr.pseudos, g.unique = M.uniqueSort, g.text = M.getText, g.isXMLDoc = M.isXML, g.contains = M.contains;
  11952. var T = g.expr.match.needsContext,
  11953. S = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
  11954. _ = /^.[^:#\[\.,]*$/;
  11955. function A(t, e, i) {
  11956. if (g.isFunction(e)) return g.grep(t, (function(t, n) {
  11957. return !!e.call(t, n, t) !== i
  11958. }));
  11959. if (e.nodeType) return g.grep(t, (function(t) {
  11960. return t === e !== i
  11961. }));
  11962. if ("string" == typeof e) {
  11963. if (_.test(e)) return g.filter(e, t, i);
  11964. e = g.filter(e, t)
  11965. }
  11966. return g.grep(t, (function(t) {
  11967. return u.call(e, t) >= 0 !== i
  11968. }))
  11969. }
  11970. g.filter = function(t, e, i) {
  11971. var n = e[0];
  11972. return i && (t = ":not(" + t + ")"), 1 === e.length && 1 === n.nodeType ? g.find.matchesSelector(n, t) ? [n] : [] : g.find.matches(t, g.grep(e, (function(t) {
  11973. return 1 === t.nodeType
  11974. })))
  11975. }, g.fn.extend({
  11976. find: function(t) {
  11977. var e, i = this.length,
  11978. n = [],
  11979. r = this;
  11980. if ("string" != typeof t) return this.pushStack(g(t)
  11981. .filter((function() {
  11982. for (e = 0; i > e; e++)
  11983. if (g.contains(r[e], this)) return !0
  11984. })));
  11985. for (e = 0; i > e; e++) g.find(t, r[e], n);
  11986. return (n = this.pushStack(i > 1 ? g.unique(n) : n))
  11987. .selector = this.selector ? this.selector + " " + t : t, n
  11988. },
  11989. filter: function(t) {
  11990. return this.pushStack(A(this, t || [], !1))
  11991. },
  11992. not: function(t) {
  11993. return this.pushStack(A(this, t || [], !0))
  11994. },
  11995. is: function(t) {
  11996. return !!A(this, "string" == typeof t && T.test(t) ? g(t) : t || [], !1)
  11997. .length
  11998. }
  11999. });
  12000. var P, C = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;
  12001. (g.fn.init = function(t, e) {
  12002. var i, n;
  12003. if (!t) return this;
  12004. if ("string" == typeof t) {
  12005. if (!(i = "<" === t[0] && ">" === t[t.length - 1] && t.length >= 3 ? [null, t, null] : C.exec(t)) || !i[1] && e) return !e || e.jquery ? (e || P)
  12006. .find(t) : this.constructor(e)
  12007. .find(t);
  12008. if (i[1]) {
  12009. if (e = e instanceof g ? e[0] : e, g.merge(this, g.parseHTML(i[1], e && e.nodeType ? e.ownerDocument || e : f, !0)), S.test(i[1]) && g.isPlainObject(e))
  12010. for (i in e) g.isFunction(this[i]) ? this[i](e[i]) : this.attr(i, e[i]);
  12011. return this
  12012. }
  12013. return (n = f.getElementById(i[2])) && n.parentNode && (this.length = 1, this[0] = n), this.context = f, this.selector = t, this
  12014. }
  12015. return t.nodeType ? (this.context = this[0] = t, this.length = 1, this) : g.isFunction(t) ? void 0 !== P.ready ? P.ready(t) : t(g) : (void 0 !== t.selector && (this.selector = t.selector, this.context = t.context), g.makeArray(t, this))
  12016. })
  12017. .prototype = g.fn, P = g(f);
  12018. var E = /^(?:parents|prev(?:Until|All))/,
  12019. D = {
  12020. children: !0,
  12021. contents: !0,
  12022. next: !0,
  12023. prev: !0
  12024. };
  12025. function L(t, e) {
  12026. for (;
  12027. (t = t[e]) && 1 !== t.nodeType;);
  12028. return t
  12029. }
  12030. g.extend({
  12031. dir: function(t, e, i) {
  12032. for (var n = [], r = void 0 !== i;
  12033. (t = t[e]) && 9 !== t.nodeType;)
  12034. if (1 === t.nodeType) {
  12035. if (r && g(t)
  12036. .is(i)) break;
  12037. n.push(t)
  12038. } return n
  12039. },
  12040. sibling: function(t, e) {
  12041. for (var i = []; t; t = t.nextSibling) 1 === t.nodeType && t !== e && i.push(t);
  12042. return i
  12043. }
  12044. }), g.fn.extend({
  12045. has: function(t) {
  12046. var e = g(t, this),
  12047. i = e.length;
  12048. return this.filter((function() {
  12049. for (var t = 0; i > t; t++)
  12050. if (g.contains(this, e[t])) return !0
  12051. }))
  12052. },
  12053. closest: function(t, e) {
  12054. for (var i, n = 0, r = this.length, o = [], a = T.test(t) || "string" != typeof t ? g(t, e || this.context) : 0; r > n; n++)
  12055. for (i = this[n]; i && i !== e; i = i.parentNode)
  12056. if (i.nodeType < 11 && (a ? a.index(i) > -1 : 1 === i.nodeType && g.find.matchesSelector(i, t))) {
  12057. o.push(i);
  12058. break
  12059. } return this.pushStack(o.length > 1 ? g.unique(o) : o)
  12060. },
  12061. index: function(t) {
  12062. return t ? "string" == typeof t ? u.call(g(t), this[0]) : u.call(this, t.jquery ? t[0] : t) : this[0] && this[0].parentNode ? this.first()
  12063. .prevAll()
  12064. .length : -1
  12065. },
  12066. add: function(t, e) {
  12067. return this.pushStack(g.unique(g.merge(this.get(), g(t, e))))
  12068. },
  12069. addBack: function(t) {
  12070. return this.add(null == t ? this.prevObject : this.prevObject.filter(t))
  12071. }
  12072. }), g.each({
  12073. parent: function(t) {
  12074. var e = t.parentNode;
  12075. return e && 11 !== e.nodeType ? e : null
  12076. },
  12077. parents: function(t) {
  12078. return g.dir(t, "parentNode")
  12079. },
  12080. parentsUntil: function(t, e, i) {
  12081. return g.dir(t, "parentNode", i)
  12082. },
  12083. next: function(t) {
  12084. return L(t, "nextSibling")
  12085. },
  12086. prev: function(t) {
  12087. return L(t, "previousSibling")
  12088. },
  12089. nextAll: function(t) {
  12090. return g.dir(t, "nextSibling")
  12091. },
  12092. prevAll: function(t) {
  12093. return g.dir(t, "previousSibling")
  12094. },
  12095. nextUntil: function(t, e, i) {
  12096. return g.dir(t, "nextSibling", i)
  12097. },
  12098. prevUntil: function(t, e, i) {
  12099. return g.dir(t, "previousSibling", i)
  12100. },
  12101. siblings: function(t) {
  12102. return g.sibling((t.parentNode || {})
  12103. .firstChild, t)
  12104. },
  12105. children: function(t) {
  12106. return g.sibling(t.firstChild)
  12107. },
  12108. contents: function(t) {
  12109. return t.contentDocument || g.merge([], t.childNodes)
  12110. }
  12111. }, (function(t, e) {
  12112. g.fn[t] = function(i, n) {
  12113. var r = g.map(this, e, i);
  12114. return "Until" !== t.slice(-5) && (n = i), n && "string" == typeof n && (r = g.filter(n, r)), this.length > 1 && (D[t] || g.unique(r), E.test(t) && r.reverse()), this.pushStack(r)
  12115. }
  12116. }));
  12117. var O, I = /\S+/g,
  12118. R = {};
  12119. function N() {
  12120. f.removeEventListener("DOMContentLoaded", N, !1), i.removeEventListener("load", N, !1), g.ready()
  12121. }
  12122. g.Callbacks = function(t) {
  12123. t = "string" == typeof t ? R[t] || function(t) {
  12124. var e = R[t] = {};
  12125. return g.each(t.match(I) || [], (function(t, i) {
  12126. e[i] = !0
  12127. })), e
  12128. }(t) : g.extend({}, t);
  12129. var e, i, n, r, o, a, s = [],
  12130. l = !t.once && [],
  12131. u = function(c) {
  12132. for (e = t.memory && c, i = !0, a = r || 0, r = 0, o = s.length, n = !0; s && o > a; a++)
  12133. if (!1 === s[a].apply(c[0], c[1]) && t.stopOnFalse) {
  12134. e = !1;
  12135. break
  12136. } n = !1, s && (l ? l.length && u(l.shift()) : e ? s = [] : h.disable())
  12137. },
  12138. h = {
  12139. add: function() {
  12140. if (s) {
  12141. var i = s.length;
  12142. ! function e(i) {
  12143. g.each(i, (function(i, n) {
  12144. var r = g.type(n);
  12145. "function" === r ? t.unique && h.has(n) || s.push(n) : n && n.length && "string" !== r && e(n)
  12146. }))
  12147. }(arguments), n ? o = s.length : e && (r = i, u(e))
  12148. }
  12149. return this
  12150. },
  12151. remove: function() {
  12152. return s && g.each(arguments, (function(t, e) {
  12153. for (var i;
  12154. (i = g.inArray(e, s, i)) > -1;) s.splice(i, 1), n && (o >= i && o--, a >= i && a--)
  12155. })), this
  12156. },
  12157. has: function(t) {
  12158. return t ? g.inArray(t, s) > -1 : !(!s || !s.length)
  12159. },
  12160. empty: function() {
  12161. return s = [], o = 0, this
  12162. },
  12163. disable: function() {
  12164. return s = l = e = void 0, this
  12165. },
  12166. disabled: function() {
  12167. return !s
  12168. },
  12169. lock: function() {
  12170. return l = void 0, e || h.disable(), this
  12171. },
  12172. locked: function() {
  12173. return !l
  12174. },
  12175. fireWith: function(t, e) {
  12176. return !s || i && !l || (e = [t, (e = e || [])
  12177. .slice ? e.slice() : e
  12178. ], n ? l.push(e) : u(e)), this
  12179. },
  12180. fire: function() {
  12181. return h.fireWith(this, arguments), this
  12182. },
  12183. fired: function() {
  12184. return !!i
  12185. }
  12186. };
  12187. return h
  12188. }, g.extend({
  12189. Deferred: function(t) {
  12190. var e = [
  12191. ["resolve", "done", g.Callbacks("once memory"), "resolved"],
  12192. ["reject", "fail", g.Callbacks("once memory"), "rejected"],
  12193. ["notify", "progress", g.Callbacks("memory")]
  12194. ],
  12195. i = "pending",
  12196. n = {
  12197. state: function() {
  12198. return i
  12199. },
  12200. always: function() {
  12201. return r.done(arguments)
  12202. .fail(arguments), this
  12203. },
  12204. then: function() {
  12205. var t = arguments;
  12206. return g.Deferred((function(i) {
  12207. g.each(e, (function(e, o) {
  12208. var a = g.isFunction(t[e]) && t[e];
  12209. r[o[1]]((function() {
  12210. var t = a && a.apply(this, arguments);
  12211. t && g.isFunction(t.promise) ? t.promise()
  12212. .done(i.resolve)
  12213. .fail(i.reject)
  12214. .progress(i.notify) : i[o[0] + "With"](this === n ? i.promise() : this, a ? [t] : arguments)
  12215. }))
  12216. })), t = null
  12217. }))
  12218. .promise()
  12219. },
  12220. promise: function(t) {
  12221. return null != t ? g.extend(t, n) : n
  12222. }
  12223. },
  12224. r = {};
  12225. return n.pipe = n.then, g.each(e, (function(t, o) {
  12226. var a = o[2],
  12227. s = o[3];
  12228. n[o[1]] = a.add, s && a.add((function() {
  12229. i = s
  12230. }), e[1 ^ t][2].disable, e[2][2].lock), r[o[0]] = function() {
  12231. return r[o[0] + "With"](this === r ? n : this, arguments), this
  12232. }, r[o[0] + "With"] = a.fireWith
  12233. })), n.promise(r), t && t.call(r, r), r
  12234. },
  12235. when: function(t) {
  12236. var e, i, n, r = 0,
  12237. o = a.call(arguments),
  12238. s = o.length,
  12239. l = 1 !== s || t && g.isFunction(t.promise) ? s : 0,
  12240. u = 1 === l ? t : g.Deferred(),
  12241. h = function(t, i, n) {
  12242. return function(r) {
  12243. i[t] = this, n[t] = arguments.length > 1 ? a.call(arguments) : r, n === e ? u.notifyWith(i, n) : --l || u.resolveWith(i, n)
  12244. }
  12245. };
  12246. if (s > 1)
  12247. for (e = new Array(s), i = new Array(s), n = new Array(s); s > r; r++) o[r] && g.isFunction(o[r].promise) ? o[r].promise()
  12248. .done(h(r, n, o))
  12249. .fail(u.reject)
  12250. .progress(h(r, i, e)) : --l;
  12251. return l || u.resolveWith(n, o), u.promise()
  12252. }
  12253. }), g.fn.ready = function(t) {
  12254. return g.ready.promise()
  12255. .done(t), this
  12256. }, g.extend({
  12257. isReady: !1,
  12258. readyWait: 1,
  12259. holdReady: function(t) {
  12260. t ? g.readyWait++ : g.ready(!0)
  12261. },
  12262. ready: function(t) {
  12263. (!0 === t ? --g.readyWait : g.isReady) || (g.isReady = !0, !0 !== t && --g.readyWait > 0 || (O.resolveWith(f, [g]), g.fn.triggerHandler && (g(f)
  12264. .triggerHandler("ready"), g(f)
  12265. .off("ready"))))
  12266. }
  12267. }), g.ready.promise = function(t) {
  12268. return O || (O = g.Deferred(), "complete" === f.readyState ? setTimeout(g.ready) : (f.addEventListener("DOMContentLoaded", N, !1), i.addEventListener("load", N, !1))), O.promise(t)
  12269. }, g.ready.promise();
  12270. var k = g.access = function(t, e, i, n, r, o, a) {
  12271. var s = 0,
  12272. l = t.length,
  12273. u = null == i;
  12274. if ("object" === g.type(i))
  12275. for (s in r = !0, i) g.access(t, e, s, i[s], !0, o, a);
  12276. else if (void 0 !== n && (r = !0, g.isFunction(n) || (a = !0), u && (a ? (e.call(t, n), e = null) : (u = e, e = function(t, e, i) {
  12277. return u.call(g(t), i)
  12278. })), e))
  12279. for (; l > s; s++) e(t[s], i, a ? n : n.call(t[s], s, e(t[s], i)));
  12280. return r ? t : u ? e.call(t) : l ? e(t[0], i) : o
  12281. };
  12282. function F() {
  12283. Object.defineProperty(this.cache = {}, 0, {
  12284. get: function() {
  12285. return {}
  12286. }
  12287. }), this.expando = g.expando + Math.random()
  12288. }
  12289. g.acceptData = function(t) {
  12290. return 1 === t.nodeType || 9 === t.nodeType || !+t.nodeType
  12291. }, F.uid = 1, F.accepts = g.acceptData, F.prototype = {
  12292. key: function(t) {
  12293. if (!F.accepts(t)) return 0;
  12294. var e = {},
  12295. i = t[this.expando];
  12296. if (!i) {
  12297. i = F.uid++;
  12298. try {
  12299. e[this.expando] = {
  12300. value: i
  12301. }, Object.defineProperties(t, e)
  12302. } catch (n) {
  12303. e[this.expando] = i, g.extend(t, e)
  12304. }
  12305. }
  12306. return this.cache[i] || (this.cache[i] = {}), i
  12307. },
  12308. set: function(t, e, i) {
  12309. var n, r = this.key(t),
  12310. o = this.cache[r];
  12311. if ("string" == typeof e) o[e] = i;
  12312. else if (g.isEmptyObject(o)) g.extend(this.cache[r], e);
  12313. else
  12314. for (n in e) o[n] = e[n];
  12315. return o
  12316. },
  12317. get: function(t, e) {
  12318. var i = this.cache[this.key(t)];
  12319. return void 0 === e ? i : i[e]
  12320. },
  12321. access: function(t, e, i) {
  12322. var n;
  12323. return void 0 === e || e && "string" == typeof e && void 0 === i ? void 0 !== (n = this.get(t, e)) ? n : this.get(t, g.camelCase(e)) : (this.set(t, e, i), void 0 !== i ? i : e)
  12324. },
  12325. remove: function(t, e) {
  12326. var i, n, r, o = this.key(t),
  12327. a = this.cache[o];
  12328. if (void 0 === e) this.cache[o] = {};
  12329. else {
  12330. g.isArray(e) ? n = e.concat(e.map(g.camelCase)) : (r = g.camelCase(e), e in a ? n = [e, r] : n = (n = r) in a ? [n] : n.match(I) || []), i = n.length;
  12331. for (; i--;) delete a[n[i]]
  12332. }
  12333. },
  12334. hasData: function(t) {
  12335. return !g.isEmptyObject(this.cache[t[this.expando]] || {})
  12336. },
  12337. discard: function(t) {
  12338. t[this.expando] && delete this.cache[t[this.expando]]
  12339. }
  12340. };
  12341. var B = new F,
  12342. z = new F,
  12343. U = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  12344. V = /([A-Z])/g;
  12345. function j(t, e, i) {
  12346. var n;
  12347. if (void 0 === i && 1 === t.nodeType)
  12348. if (n = "data-" + e.replace(V, "-$1")
  12349. .toLowerCase(), "string" == typeof(i = t.getAttribute(n))) {
  12350. try {
  12351. i = "true" === i || "false" !== i && ("null" === i ? null : +i + "" === i ? +i : U.test(i) ? g.parseJSON(i) : i)
  12352. } catch (t) {}
  12353. z.set(t, e, i)
  12354. } else i = void 0;
  12355. return i
  12356. }
  12357. g.extend({
  12358. hasData: function(t) {
  12359. return z.hasData(t) || B.hasData(t)
  12360. },
  12361. data: function(t, e, i) {
  12362. return z.access(t, e, i)
  12363. },
  12364. removeData: function(t, e) {
  12365. z.remove(t, e)
  12366. },
  12367. _data: function(t, e, i) {
  12368. return B.access(t, e, i)
  12369. },
  12370. _removeData: function(t, e) {
  12371. B.remove(t, e)
  12372. }
  12373. }), g.fn.extend({
  12374. data: function(t, e) {
  12375. var i, n, r, o = this[0],
  12376. a = o && o.attributes;
  12377. if (void 0 === t) {
  12378. if (this.length && (r = z.get(o), 1 === o.nodeType && !B.get(o, "hasDataAttrs"))) {
  12379. for (i = a.length; i--;) a[i] && (0 === (n = a[i].name)
  12380. .indexOf("data-") && (n = g.camelCase(n.slice(5)), j(o, n, r[n])));
  12381. B.set(o, "hasDataAttrs", !0)
  12382. }
  12383. return r
  12384. }
  12385. return "object" == typeof t ? this.each((function() {
  12386. z.set(this, t)
  12387. })) : k(this, (function(e) {
  12388. var i, n = g.camelCase(t);
  12389. if (o && void 0 === e) {
  12390. if (void 0 !== (i = z.get(o, t))) return i;
  12391. if (void 0 !== (i = z.get(o, n))) return i;
  12392. if (void 0 !== (i = j(o, n, void 0))) return i
  12393. } else this.each((function() {
  12394. var i = z.get(this, n);
  12395. z.set(this, n, e), -1 !== t.indexOf("-") && void 0 !== i && z.set(this, t, e)
  12396. }))
  12397. }), null, e, arguments.length > 1, null, !0)
  12398. },
  12399. removeData: function(t) {
  12400. return this.each((function() {
  12401. z.remove(this, t)
  12402. }))
  12403. }
  12404. }), g.extend({
  12405. queue: function(t, e, i) {
  12406. var n;
  12407. return t ? (e = (e || "fx") + "queue", n = B.get(t, e), i && (!n || g.isArray(i) ? n = B.access(t, e, g.makeArray(i)) : n.push(i)), n || []) : void 0
  12408. },
  12409. dequeue: function(t, e) {
  12410. e = e || "fx";
  12411. var i = g.queue(t, e),
  12412. n = i.length,
  12413. r = i.shift(),
  12414. o = g._queueHooks(t, e);
  12415. "inprogress" === r && (r = i.shift(), n--), r && ("fx" === e && i.unshift("inprogress"), delete o.stop, r.call(t, (function() {
  12416. g.dequeue(t, e)
  12417. }), o)), !n && o && o.empty.fire()
  12418. },
  12419. _queueHooks: function(t, e) {
  12420. var i = e + "queueHooks";
  12421. return B.get(t, i) || B.access(t, i, {
  12422. empty: g.Callbacks("once memory")
  12423. .add((function() {
  12424. B.remove(t, [e + "queue", i])
  12425. }))
  12426. })
  12427. }
  12428. }), g.fn.extend({
  12429. queue: function(t, e) {
  12430. var i = 2;
  12431. return "string" != typeof t && (e = t, t = "fx", i--), arguments.length < i ? g.queue(this[0], t) : void 0 === e ? this : this.each((function() {
  12432. var i = g.queue(this, t, e);
  12433. g._queueHooks(this, t), "fx" === t && "inprogress" !== i[0] && g.dequeue(this, t)
  12434. }))
  12435. },
  12436. dequeue: function(t) {
  12437. return this.each((function() {
  12438. g.dequeue(this, t)
  12439. }))
  12440. },
  12441. clearQueue: function(t) {
  12442. return this.queue(t || "fx", [])
  12443. },
  12444. promise: function(t, e) {
  12445. var i, n = 1,
  12446. r = g.Deferred(),
  12447. o = this,
  12448. a = this.length,
  12449. s = function() {
  12450. --n || r.resolveWith(o, [o])
  12451. };
  12452. for ("string" != typeof t && (e = t, t = void 0), t = t || "fx"; a--;)(i = B.get(o[a], t + "queueHooks")) && i.empty && (n++, i.empty.add(s));
  12453. return s(), r.promise(e)
  12454. }
  12455. });
  12456. var H = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
  12457. G = ["Top", "Right", "Bottom", "Left"],
  12458. W = function(t, e) {
  12459. return t = e || t, "none" === g.css(t, "display") || !g.contains(t.ownerDocument, t)
  12460. },
  12461. q = /^(?:checkbox|radio)$/i;
  12462. ! function() {
  12463. var t = f.createDocumentFragment()
  12464. .appendChild(f.createElement("div")),
  12465. e = f.createElement("input");
  12466. e.setAttribute("type", "radio"), e.setAttribute("checked", "checked"), e.setAttribute("name", "t"), t.appendChild(e), p.checkClone = t.cloneNode(!0)
  12467. .cloneNode(!0)
  12468. .lastChild.checked, t.innerHTML = "<textarea>x</textarea>", p.noCloneChecked = !!t.cloneNode(!0)
  12469. .lastChild.defaultValue
  12470. }();
  12471. var Y = "undefined";
  12472. p.focusinBubbles = "onfocusin" in i;
  12473. var X = /^key/,
  12474. Z = /^(?:mouse|pointer|contextmenu)|click/,
  12475. K = /^(?:focusinfocus|focusoutblur)$/,
  12476. Q = /^([^.]*)(?:\.(.+)|)$/;
  12477. function J() {
  12478. return !0
  12479. }
  12480. function $() {
  12481. return !1
  12482. }
  12483. function tt() {
  12484. try {
  12485. return f.activeElement
  12486. } catch (t) {}
  12487. }
  12488. g.event = {
  12489. global: {},
  12490. add: function(t, e, i, n, r) {
  12491. var o, a, s, l, u, h, c, d, p, f, m, v = B.get(t);
  12492. if (v)
  12493. for (i.handler && (i = (o = i)
  12494. .handler, r = o.selector), i.guid || (i.guid = g.guid++), (l = v.events) || (l = v.events = {}), (a = v.handle) || (a = v.handle = function(e) {
  12495. return typeof g !== Y && g.event.triggered !== e.type ? g.event.dispatch.apply(t, arguments) : void 0
  12496. }), u = (e = (e || "")
  12497. .match(I) || [""])
  12498. .length; u--;) p = m = (s = Q.exec(e[u]) || [])[1], f = (s[2] || "")
  12499. .split(".")
  12500. .sort(), p && (c = g.event.special[p] || {}, p = (r ? c.delegateType : c.bindType) || p, c = g.event.special[p] || {}, h = g.extend({
  12501. type: p,
  12502. origType: m,
  12503. data: n,
  12504. handler: i,
  12505. guid: i.guid,
  12506. selector: r,
  12507. needsContext: r && g.expr.match.needsContext.test(r),
  12508. namespace: f.join(".")
  12509. }, o), (d = l[p]) || ((d = l[p] = [])
  12510. .delegateCount = 0, c.setup && !1 !== c.setup.call(t, n, f, a) || t.addEventListener && t.addEventListener(p, a, !1)), c.add && (c.add.call(t, h), h.handler.guid || (h.handler.guid = i.guid)), r ? d.splice(d.delegateCount++, 0, h) : d.push(h), g.event.global[p] = !0)
  12511. },
  12512. remove: function(t, e, i, n, r) {
  12513. var o, a, s, l, u, h, c, d, p, f, m, v = B.hasData(t) && B.get(t);
  12514. if (v && (l = v.events)) {
  12515. for (u = (e = (e || "")
  12516. .match(I) || [""])
  12517. .length; u--;)
  12518. if (p = m = (s = Q.exec(e[u]) || [])[1], f = (s[2] || "")
  12519. .split(".")
  12520. .sort(), p) {
  12521. for (c = g.event.special[p] || {}, d = l[p = (n ? c.delegateType : c.bindType) || p] || [], s = s[2] && new RegExp("(^|\\.)" + f.join("\\.(?:.*\\.|)") + "(\\.|$)"), a = o = d.length; o--;) h = d[o], !r && m !== h.origType || i && i.guid !== h.guid || s && !s.test(h.namespace) || n && n !== h.selector && ("**" !== n || !h.selector) || (d.splice(o, 1), h.selector && d.delegateCount--, c.remove && c.remove.call(t, h));
  12522. a && !d.length && (c.teardown && !1 !== c.teardown.call(t, f, v.handle) || g.removeEvent(t, p, v.handle), delete l[p])
  12523. } else
  12524. for (p in l) g.event.remove(t, p + e[u], i, n, !0);
  12525. g.isEmptyObject(l) && (delete v.handle, B.remove(t, "events"))
  12526. }
  12527. },
  12528. trigger: function(t, e, n, r) {
  12529. var o, a, s, l, u, h, c, p = [n || f],
  12530. m = d.call(t, "type") ? t.type : t,
  12531. v = d.call(t, "namespace") ? t.namespace.split(".") : [];
  12532. if (a = s = n = n || f, 3 !== n.nodeType && 8 !== n.nodeType && !K.test(m + g.event.triggered) && (m.indexOf(".") >= 0 && (v = m.split("."), m = v.shift(), v.sort()), u = m.indexOf(":") < 0 && "on" + m, (t = t[g.expando] ? t : new g.Event(m, "object" == typeof t && t))
  12533. .isTrigger = r ? 2 : 3, t.namespace = v.join("."), t.namespace_re = t.namespace ? new RegExp("(^|\\.)" + v.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, t.result = void 0, t.target || (t.target = n), e = null == e ? [t] : g.makeArray(e, [t]), c = g.event.special[m] || {}, r || !c.trigger || !1 !== c.trigger.apply(n, e))) {
  12534. if (!r && !c.noBubble && !g.isWindow(n)) {
  12535. for (l = c.delegateType || m, K.test(l + m) || (a = a.parentNode); a; a = a.parentNode) p.push(a), s = a;
  12536. s === (n.ownerDocument || f) && p.push(s.defaultView || s.parentWindow || i)
  12537. }
  12538. for (o = 0;
  12539. (a = p[o++]) && !t.isPropagationStopped();) t.type = o > 1 ? l : c.bindType || m, (h = (B.get(a, "events") || {})[t.type] && B.get(a, "handle")) && h.apply(a, e), (h = u && a[u]) && h.apply && g.acceptData(a) && (t.result = h.apply(a, e), !1 === t.result && t.preventDefault());
  12540. return t.type = m, r || t.isDefaultPrevented() || c._default && !1 !== c._default.apply(p.pop(), e) || !g.acceptData(n) || u && g.isFunction(n[m]) && !g.isWindow(n) && ((s = n[u]) && (n[u] = null), g.event.triggered = m, n[m](), g.event.triggered = void 0, s && (n[u] = s)), t.result
  12541. }
  12542. },
  12543. dispatch: function(t) {
  12544. t = g.event.fix(t);
  12545. var e, i, n, r, o, s = [],
  12546. l = a.call(arguments),
  12547. u = (B.get(this, "events") || {})[t.type] || [],
  12548. h = g.event.special[t.type] || {};
  12549. if (l[0] = t, t.delegateTarget = this, !h.preDispatch || !1 !== h.preDispatch.call(this, t)) {
  12550. for (s = g.event.handlers.call(this, t, u), e = 0;
  12551. (r = s[e++]) && !t.isPropagationStopped();)
  12552. for (t.currentTarget = r.elem, i = 0;
  12553. (o = r.handlers[i++]) && !t.isImmediatePropagationStopped();)(!t.namespace_re || t.namespace_re.test(o.namespace)) && (t.handleObj = o, t.data = o.data, void 0 !== (n = ((g.event.special[o.origType] || {})
  12554. .handle || o.handler)
  12555. .apply(r.elem, l)) && !1 === (t.result = n) && (t.preventDefault(), t.stopPropagation()));
  12556. return h.postDispatch && h.postDispatch.call(this, t), t.result
  12557. }
  12558. },
  12559. handlers: function(t, e) {
  12560. var i, n, r, o, a = [],
  12561. s = e.delegateCount,
  12562. l = t.target;
  12563. if (s && l.nodeType && (!t.button || "click" !== t.type))
  12564. for (; l !== this; l = l.parentNode || this)
  12565. if (!0 !== l.disabled || "click" !== t.type) {
  12566. for (n = [], i = 0; s > i; i++) void 0 === n[r = (o = e[i])
  12567. .selector + " "] && (n[r] = o.needsContext ? g(r, this)
  12568. .index(l) >= 0 : g.find(r, this, null, [l])
  12569. .length), n[r] && n.push(o);
  12570. n.length && a.push({
  12571. elem: l,
  12572. handlers: n
  12573. })
  12574. } return s < e.length && a.push({
  12575. elem: this,
  12576. handlers: e.slice(s)
  12577. }), a
  12578. },
  12579. props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
  12580. fixHooks: {},
  12581. keyHooks: {
  12582. props: "char charCode key keyCode".split(" "),
  12583. filter: function(t, e) {
  12584. return null == t.which && (t.which = null != e.charCode ? e.charCode : e.keyCode), t
  12585. }
  12586. },
  12587. mouseHooks: {
  12588. props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
  12589. filter: function(t, e) {
  12590. var i, n, r, o = e.button;
  12591. return null == t.pageX && null != e.clientX && (n = (i = t.target.ownerDocument || f)
  12592. .documentElement, r = i.body, t.pageX = e.clientX + (n && n.scrollLeft || r && r.scrollLeft || 0) - (n && n.clientLeft || r && r.clientLeft || 0), t.pageY = e.clientY + (n && n.scrollTop || r && r.scrollTop || 0) - (n && n.clientTop || r && r.clientTop || 0)), t.which || void 0 === o || (t.which = 1 & o ? 1 : 2 & o ? 3 : 4 & o ? 2 : 0), t
  12593. }
  12594. },
  12595. fix: function(t) {
  12596. if (t[g.expando]) return t;
  12597. var e, i, n, r = t.type,
  12598. o = t,
  12599. a = this.fixHooks[r];
  12600. for (a || (this.fixHooks[r] = a = Z.test(r) ? this.mouseHooks : X.test(r) ? this.keyHooks : {}), n = a.props ? this.props.concat(a.props) : this.props, t = new g.Event(o), e = n.length; e--;) t[i = n[e]] = o[i];
  12601. return t.target || (t.target = f), 3 === t.target.nodeType && (t.target = t.target.parentNode), a.filter ? a.filter(t, o) : t
  12602. },
  12603. special: {
  12604. load: {
  12605. noBubble: !0
  12606. },
  12607. focus: {
  12608. trigger: function() {
  12609. return this !== tt() && this.focus ? (this.focus(), !1) : void 0
  12610. },
  12611. delegateType: "focusin"
  12612. },
  12613. blur: {
  12614. trigger: function() {
  12615. return this === tt() && this.blur ? (this.blur(), !1) : void 0
  12616. },
  12617. delegateType: "focusout"
  12618. },
  12619. click: {
  12620. trigger: function() {
  12621. return "checkbox" === this.type && this.click && g.nodeName(this, "input") ? (this.click(), !1) : void 0
  12622. },
  12623. _default: function(t) {
  12624. return g.nodeName(t.target, "a")
  12625. }
  12626. },
  12627. beforeunload: {
  12628. postDispatch: function(t) {
  12629. void 0 !== t.result && t.originalEvent && (t.originalEvent.returnValue = t.result)
  12630. }
  12631. }
  12632. },
  12633. simulate: function(t, e, i, n) {
  12634. var r = g.extend(new g.Event, i, {
  12635. type: t,
  12636. isSimulated: !0,
  12637. originalEvent: {}
  12638. });
  12639. n ? g.event.trigger(r, null, e) : g.event.dispatch.call(e, r), r.isDefaultPrevented() && i.preventDefault()
  12640. }
  12641. }, g.removeEvent = function(t, e, i) {
  12642. t.removeEventListener && t.removeEventListener(e, i, !1)
  12643. }, g.Event = function(t, e) {
  12644. return this instanceof g.Event ? (t && t.type ? (this.originalEvent = t, this.type = t.type, this.isDefaultPrevented = t.defaultPrevented || void 0 === t.defaultPrevented && !1 === t.returnValue ? J : $) : this.type = t, e && g.extend(this, e), this.timeStamp = t && t.timeStamp || g.now(), void(this[g.expando] = !0)) : new g.Event(t, e)
  12645. }, g.Event.prototype = {
  12646. isDefaultPrevented: $,
  12647. isPropagationStopped: $,
  12648. isImmediatePropagationStopped: $,
  12649. preventDefault: function() {
  12650. var t = this.originalEvent;
  12651. this.isDefaultPrevented = J, t && t.preventDefault && t.preventDefault()
  12652. },
  12653. stopPropagation: function() {
  12654. var t = this.originalEvent;
  12655. this.isPropagationStopped = J, t && t.stopPropagation && t.stopPropagation()
  12656. },
  12657. stopImmediatePropagation: function() {
  12658. var t = this.originalEvent;
  12659. this.isImmediatePropagationStopped = J, t && t.stopImmediatePropagation && t.stopImmediatePropagation(), this.stopPropagation()
  12660. }
  12661. }, g.each({
  12662. mouseenter: "mouseover",
  12663. mouseleave: "mouseout",
  12664. pointerenter: "pointerover",
  12665. pointerleave: "pointerout"
  12666. }, (function(t, e) {
  12667. g.event.special[t] = {
  12668. delegateType: e,
  12669. bindType: e,
  12670. handle: function(t) {
  12671. var i, n = this,
  12672. r = t.relatedTarget,
  12673. o = t.handleObj;
  12674. return (!r || r !== n && !g.contains(n, r)) && (t.type = o.origType, i = o.handler.apply(this, arguments), t.type = e), i
  12675. }
  12676. }
  12677. })), p.focusinBubbles || g.each({
  12678. focus: "focusin",
  12679. blur: "focusout"
  12680. }, (function(t, e) {
  12681. var i = function(t) {
  12682. g.event.simulate(e, t.target, g.event.fix(t), !0)
  12683. };
  12684. g.event.special[e] = {
  12685. setup: function() {
  12686. var n = this.ownerDocument || this,
  12687. r = B.access(n, e);
  12688. r || n.addEventListener(t, i, !0), B.access(n, e, (r || 0) + 1)
  12689. },
  12690. teardown: function() {
  12691. var n = this.ownerDocument || this,
  12692. r = B.access(n, e) - 1;
  12693. r ? B.access(n, e, r) : (n.removeEventListener(t, i, !0), B.remove(n, e))
  12694. }
  12695. }
  12696. })), g.fn.extend({
  12697. on: function(t, e, i, n, r) {
  12698. var o, a;
  12699. if ("object" == typeof t) {
  12700. for (a in "string" != typeof e && (i = i || e, e = void 0), t) this.on(a, e, i, t[a], r);
  12701. return this
  12702. }
  12703. if (null == i && null == n ? (n = e, i = e = void 0) : null == n && ("string" == typeof e ? (n = i, i = void 0) : (n = i, i = e, e = void 0)), !1 === n) n = $;
  12704. else if (!n) return this;
  12705. return 1 === r && (o = n, (n = function(t) {
  12706. return g()
  12707. .off(t), o.apply(this, arguments)
  12708. })
  12709. .guid = o.guid || (o.guid = g.guid++)), this.each((function() {
  12710. g.event.add(this, t, n, i, e)
  12711. }))
  12712. },
  12713. one: function(t, e, i, n) {
  12714. return this.on(t, e, i, n, 1)
  12715. },
  12716. off: function(t, e, i) {
  12717. var n, r;
  12718. if (t && t.preventDefault && t.handleObj) return n = t.handleObj, g(t.delegateTarget)
  12719. .off(n.namespace ? n.origType + "." + n.namespace : n.origType, n.selector, n.handler), this;
  12720. if ("object" == typeof t) {
  12721. for (r in t) this.off(r, e, t[r]);
  12722. return this
  12723. }
  12724. return (!1 === e || "function" == typeof e) && (i = e, e = void 0), !1 === i && (i = $), this.each((function() {
  12725. g.event.remove(this, t, i, e)
  12726. }))
  12727. },
  12728. trigger: function(t, e) {
  12729. return this.each((function() {
  12730. g.event.trigger(t, e, this)
  12731. }))
  12732. },
  12733. triggerHandler: function(t, e) {
  12734. var i = this[0];
  12735. return i ? g.event.trigger(t, e, i, !0) : void 0
  12736. }
  12737. });
  12738. var et = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
  12739. it = /<([\w:]+)/,
  12740. nt = /<|&#?\w+;/,
  12741. rt = /<(?:script|style|link)/i,
  12742. ot = /checked\s*(?:[^=]|=\s*.checked.)/i,
  12743. at = /^$|\/(?:java|ecma)script/i,
  12744. st = /^true\/(.*)/,
  12745. lt = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
  12746. ut = {
  12747. option: [1, "<select multiple='multiple'>", "</select>"],
  12748. thead: [1, "<table>", "</table>"],
  12749. col: [2, "<table><colgroup>", "</colgroup></table>"],
  12750. tr: [2, "<table><tbody>", "</tbody></table>"],
  12751. td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
  12752. _default: [0, "", ""]
  12753. };
  12754. function ht(t, e) {
  12755. return g.nodeName(t, "table") && g.nodeName(11 !== e.nodeType ? e : e.firstChild, "tr") ? t.getElementsByTagName("tbody")[0] || t.appendChild(t.ownerDocument.createElement("tbody")) : t
  12756. }
  12757. function ct(t) {
  12758. return t.type = (null !== t.getAttribute("type")) + "/" + t.type, t
  12759. }
  12760. function dt(t) {
  12761. var e = st.exec(t.type);
  12762. return e ? t.type = e[1] : t.removeAttribute("type"), t
  12763. }
  12764. function pt(t, e) {
  12765. for (var i = 0, n = t.length; n > i; i++) B.set(t[i], "globalEval", !e || B.get(e[i], "globalEval"))
  12766. }
  12767. function ft(t, e) {
  12768. var i, n, r, o, a, s, l, u;
  12769. if (1 === e.nodeType) {
  12770. if (B.hasData(t) && (o = B.access(t), a = B.set(e, o), u = o.events))
  12771. for (r in delete a.handle, a.events = {}, u)
  12772. for (i = 0, n = u[r].length; n > i; i++) g.event.add(e, r, u[r][i]);
  12773. z.hasData(t) && (s = z.access(t), l = g.extend({}, s), z.set(e, l))
  12774. }
  12775. }
  12776. function mt(t, e) {
  12777. var i = t.getElementsByTagName ? t.getElementsByTagName(e || "*") : t.querySelectorAll ? t.querySelectorAll(e || "*") : [];
  12778. return void 0 === e || e && g.nodeName(t, e) ? g.merge([t], i) : i
  12779. }
  12780. function gt(t, e) {
  12781. var i = e.nodeName.toLowerCase();
  12782. "input" === i && q.test(t.type) ? e.checked = t.checked : ("input" === i || "textarea" === i) && (e.defaultValue = t.defaultValue)
  12783. }
  12784. ut.optgroup = ut.option, ut.tbody = ut.tfoot = ut.colgroup = ut.caption = ut.thead, ut.th = ut.td, g.extend({
  12785. clone: function(t, e, i) {
  12786. var n, r, o, a, s = t.cloneNode(!0),
  12787. l = g.contains(t.ownerDocument, t);
  12788. if (!(p.noCloneChecked || 1 !== t.nodeType && 11 !== t.nodeType || g.isXMLDoc(t)))
  12789. for (a = mt(s), n = 0, r = (o = mt(t))
  12790. .length; r > n; n++) gt(o[n], a[n]);
  12791. if (e)
  12792. if (i)
  12793. for (o = o || mt(t), a = a || mt(s), n = 0, r = o.length; r > n; n++) ft(o[n], a[n]);
  12794. else ft(t, s);
  12795. return (a = mt(s, "script"))
  12796. .length > 0 && pt(a, !l && mt(t, "script")), s
  12797. },
  12798. buildFragment: function(t, e, i, n) {
  12799. for (var r, o, a, s, l, u, h = e.createDocumentFragment(), c = [], d = 0, p = t.length; p > d; d++)
  12800. if ((r = t[d]) || 0 === r)
  12801. if ("object" === g.type(r)) g.merge(c, r.nodeType ? [r] : r);
  12802. else if (nt.test(r)) {
  12803. for (o = o || h.appendChild(e.createElement("div")), a = (it.exec(r) || ["", ""])[1].toLowerCase(), s = ut[a] || ut._default, o.innerHTML = s[1] + r.replace(et, "<$1></$2>") + s[2], u = s[0]; u--;) o = o.lastChild;
  12804. g.merge(c, o.childNodes), (o = h.firstChild)
  12805. .textContent = ""
  12806. } else c.push(e.createTextNode(r));
  12807. for (h.textContent = "", d = 0; r = c[d++];)
  12808. if ((!n || -1 === g.inArray(r, n)) && (l = g.contains(r.ownerDocument, r), o = mt(h.appendChild(r), "script"), l && pt(o), i))
  12809. for (u = 0; r = o[u++];) at.test(r.type || "") && i.push(r);
  12810. return h
  12811. },
  12812. cleanData: function(t) {
  12813. for (var e, i, n, r, o = g.event.special, a = 0; void 0 !== (i = t[a]); a++) {
  12814. if (g.acceptData(i) && ((r = i[B.expando]) && (e = B.cache[r]))) {
  12815. if (e.events)
  12816. for (n in e.events) o[n] ? g.event.remove(i, n) : g.removeEvent(i, n, e.handle);
  12817. B.cache[r] && delete B.cache[r]
  12818. }
  12819. delete z.cache[i[z.expando]]
  12820. }
  12821. }
  12822. }), g.fn.extend({
  12823. text: function(t) {
  12824. return k(this, (function(t) {
  12825. return void 0 === t ? g.text(this) : this.empty()
  12826. .each((function() {
  12827. (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) && (this.textContent = t)
  12828. }))
  12829. }), null, t, arguments.length)
  12830. },
  12831. append: function() {
  12832. return this.domManip(arguments, (function(t) {
  12833. 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || ht(this, t)
  12834. .appendChild(t)
  12835. }))
  12836. },
  12837. prepend: function() {
  12838. return this.domManip(arguments, (function(t) {
  12839. if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
  12840. var e = ht(this, t);
  12841. e.insertBefore(t, e.firstChild)
  12842. }
  12843. }))
  12844. },
  12845. before: function() {
  12846. return this.domManip(arguments, (function(t) {
  12847. this.parentNode && this.parentNode.insertBefore(t, this)
  12848. }))
  12849. },
  12850. after: function() {
  12851. return this.domManip(arguments, (function(t) {
  12852. this.parentNode && this.parentNode.insertBefore(t, this.nextSibling)
  12853. }))
  12854. },
  12855. remove: function(t, e) {
  12856. for (var i, n = t ? g.filter(t, this) : this, r = 0; null != (i = n[r]); r++) e || 1 !== i.nodeType || g.cleanData(mt(i)), i.parentNode && (e && g.contains(i.ownerDocument, i) && pt(mt(i, "script")), i.parentNode.removeChild(i));
  12857. return this
  12858. },
  12859. empty: function() {
  12860. for (var t, e = 0; null != (t = this[e]); e++) 1 === t.nodeType && (g.cleanData(mt(t, !1)), t.textContent = "");
  12861. return this
  12862. },
  12863. clone: function(t, e) {
  12864. return t = null != t && t, e = null == e ? t : e, this.map((function() {
  12865. return g.clone(this, t, e)
  12866. }))
  12867. },
  12868. html: function(t) {
  12869. return k(this, (function(t) {
  12870. var e = this[0] || {},
  12871. i = 0,
  12872. n = this.length;
  12873. if (void 0 === t && 1 === e.nodeType) return e.innerHTML;
  12874. if ("string" == typeof t && !rt.test(t) && !ut[(it.exec(t) || ["", ""])[1].toLowerCase()]) {
  12875. t = t.replace(et, "<$1></$2>");
  12876. try {
  12877. for (; n > i; i++) 1 === (e = this[i] || {})
  12878. .nodeType && (g.cleanData(mt(e, !1)), e.innerHTML = t);
  12879. e = 0
  12880. } catch (t) {}
  12881. }
  12882. e && this.empty()
  12883. .append(t)
  12884. }), null, t, arguments.length)
  12885. },
  12886. replaceWith: function() {
  12887. var t = arguments[0];
  12888. return this.domManip(arguments, (function(e) {
  12889. t = this.parentNode, g.cleanData(mt(this)), t && t.replaceChild(e, this)
  12890. })), t && (t.length || t.nodeType) ? this : this.remove()
  12891. },
  12892. detach: function(t) {
  12893. return this.remove(t, !0)
  12894. },
  12895. domManip: function(t, e) {
  12896. t = s.apply([], t);
  12897. var i, n, r, o, a, l, u = 0,
  12898. h = this.length,
  12899. c = this,
  12900. d = h - 1,
  12901. f = t[0],
  12902. m = g.isFunction(f);
  12903. if (m || h > 1 && "string" == typeof f && !p.checkClone && ot.test(f)) return this.each((function(i) {
  12904. var n = c.eq(i);
  12905. m && (t[0] = f.call(this, i, n.html())), n.domManip(t, e)
  12906. }));
  12907. if (h && (n = (i = g.buildFragment(t, this[0].ownerDocument, !1, this))
  12908. .firstChild, 1 === i.childNodes.length && (i = n), n)) {
  12909. for (o = (r = g.map(mt(i, "script"), ct))
  12910. .length; h > u; u++) a = i, u !== d && (a = g.clone(a, !0, !0), o && g.merge(r, mt(a, "script"))), e.call(this[u], a, u);
  12911. if (o)
  12912. for (l = r[r.length - 1].ownerDocument, g.map(r, dt), u = 0; o > u; u++) a = r[u], at.test(a.type || "") && !B.access(a, "globalEval") && g.contains(l, a) && (a.src ? g._evalUrl && g._evalUrl(a.src) : g.globalEval(a.textContent.replace(lt, "")))
  12913. }
  12914. return this
  12915. }
  12916. }), g.each({
  12917. appendTo: "append",
  12918. prependTo: "prepend",
  12919. insertBefore: "before",
  12920. insertAfter: "after",
  12921. replaceAll: "replaceWith"
  12922. }, (function(t, e) {
  12923. g.fn[t] = function(t) {
  12924. for (var i, n = [], r = g(t), o = r.length - 1, a = 0; o >= a; a++) i = a === o ? this : this.clone(!0), g(r[a])[e](i), l.apply(n, i.get());
  12925. return this.pushStack(n)
  12926. }
  12927. }));
  12928. var vt, yt = {};
  12929. function bt(t, e) {
  12930. var n, r = g(e.createElement(t))
  12931. .appendTo(e.body),
  12932. o = i.getDefaultComputedStyle && (n = i.getDefaultComputedStyle(r[0])) ? n.display : g.css(r[0], "display");
  12933. return r.detach(), o
  12934. }
  12935. function wt(t) {
  12936. var e = f,
  12937. i = yt[t];
  12938. return i || ("none" !== (i = bt(t, e)) && i || ((e = (vt = (vt || g("<iframe frameborder='0' width='0' height='0'/>"))
  12939. .appendTo(e.documentElement))[0].contentDocument)
  12940. .write(), e.close(), i = bt(t, e), vt.detach()), yt[t] = i), i
  12941. }
  12942. var xt = /^margin/,
  12943. Mt = new RegExp("^(" + H + ")(?!px)[a-z%]+$", "i"),
  12944. Tt = function(t) {
  12945. return t.ownerDocument.defaultView.getComputedStyle(t, null)
  12946. };
  12947. function St(t, e, i) {
  12948. var n, r, o, a, s = t.style;
  12949. return (i = i || Tt(t)) && (a = i.getPropertyValue(e) || i[e]), i && ("" !== a || g.contains(t.ownerDocument, t) || (a = g.style(t, e)), Mt.test(a) && xt.test(e) && (n = s.width, r = s.minWidth, o = s.maxWidth, s.minWidth = s.maxWidth = s.width = a, a = i.width, s.width = n, s.minWidth = r, s.maxWidth = o)), void 0 !== a ? a + "" : a
  12950. }
  12951. function _t(t, e) {
  12952. return {
  12953. get: function() {
  12954. return t() ? void delete this.get : (this.get = e)
  12955. .apply(this, arguments)
  12956. }
  12957. }
  12958. }! function() {
  12959. var t, e, n = f.documentElement,
  12960. r = f.createElement("div"),
  12961. o = f.createElement("div");
  12962. if (o.style) {
  12963. function a() {
  12964. o.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute", o.innerHTML = "", n.appendChild(r);
  12965. var a = i.getComputedStyle(o, null);
  12966. t = "1%" !== a.top, e = "4px" === a.width, n.removeChild(r)
  12967. }
  12968. o.style.backgroundClip = "content-box", o.cloneNode(!0)
  12969. .style.backgroundClip = "", p.clearCloneStyle = "content-box" === o.style.backgroundClip, r.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute", r.appendChild(o), i.getComputedStyle && g.extend(p, {
  12970. pixelPosition: function() {
  12971. return a(), t
  12972. },
  12973. boxSizingReliable: function() {
  12974. return null == e && a(), e
  12975. },
  12976. reliableMarginRight: function() {
  12977. var t, e = o.appendChild(f.createElement("div"));
  12978. return e.style.cssText = o.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0", e.style.marginRight = e.style.width = "0", o.style.width = "1px", n.appendChild(r), t = !parseFloat(i.getComputedStyle(e, null)
  12979. .marginRight), n.removeChild(r), t
  12980. }
  12981. })
  12982. }
  12983. }(), g.swap = function(t, e, i, n) {
  12984. var r, o, a = {};
  12985. for (o in e) a[o] = t.style[o], t.style[o] = e[o];
  12986. for (o in r = i.apply(t, n || []), e) t.style[o] = a[o];
  12987. return r
  12988. };
  12989. var At = /^(none|table(?!-c[ea]).+)/,
  12990. Pt = new RegExp("^(" + H + ")(.*)$", "i"),
  12991. Ct = new RegExp("^([+-])=(" + H + ")", "i"),
  12992. Et = {
  12993. position: "absolute",
  12994. visibility: "hidden",
  12995. display: "block"
  12996. },
  12997. Dt = {
  12998. letterSpacing: "0",
  12999. fontWeight: "400"
  13000. },
  13001. Lt = ["Webkit", "O", "Moz", "ms"];
  13002. function Ot(t, e) {
  13003. if (e in t) return e;
  13004. for (var i = e[0].toUpperCase() + e.slice(1), n = e, r = Lt.length; r--;)
  13005. if ((e = Lt[r] + i) in t) return e;
  13006. return n
  13007. }
  13008. function It(t, e, i) {
  13009. var n = Pt.exec(e);
  13010. return n ? Math.max(0, n[1] - (i || 0)) + (n[2] || "px") : e
  13011. }
  13012. function Rt(t, e, i, n, r) {
  13013. for (var o = i === (n ? "border" : "content") ? 4 : "width" === e ? 1 : 0, a = 0; 4 > o; o += 2) "margin" === i && (a += g.css(t, i + G[o], !0, r)), n ? ("content" === i && (a -= g.css(t, "padding" + G[o], !0, r)), "margin" !== i && (a -= g.css(t, "border" + G[o] + "Width", !0, r))) : (a += g.css(t, "padding" + G[o], !0, r), "padding" !== i && (a += g.css(t, "border" + G[o] + "Width", !0, r)));
  13014. return a
  13015. }
  13016. function Nt(t, e, i) {
  13017. var n = !0,
  13018. r = "width" === e ? t.offsetWidth : t.offsetHeight,
  13019. o = Tt(t),
  13020. a = "border-box" === g.css(t, "boxSizing", !1, o);
  13021. if (0 >= r || null == r) {
  13022. if ((0 > (r = St(t, e, o)) || null == r) && (r = t.style[e]), Mt.test(r)) return r;
  13023. n = a && (p.boxSizingReliable() || r === t.style[e]), r = parseFloat(r) || 0
  13024. }
  13025. return r + Rt(t, e, i || (a ? "border" : "content"), n, o) + "px"
  13026. }
  13027. function kt(t, e) {
  13028. for (var i, n, r, o = [], a = 0, s = t.length; s > a; a++)(n = t[a])
  13029. .style && (o[a] = B.get(n, "olddisplay"), i = n.style.display, e ? (o[a] || "none" !== i || (n.style.display = ""), "" === n.style.display && W(n) && (o[a] = B.access(n, "olddisplay", wt(n.nodeName)))) : (r = W(n), "none" === i && r || B.set(n, "olddisplay", r ? i : g.css(n, "display"))));
  13030. for (a = 0; s > a; a++)(n = t[a])
  13031. .style && (e && "none" !== n.style.display && "" !== n.style.display || (n.style.display = e ? o[a] || "" : "none"));
  13032. return t
  13033. }
  13034. function Ft(t, e, i, n, r) {
  13035. return new Ft.prototype.init(t, e, i, n, r)
  13036. }
  13037. g.extend({
  13038. cssHooks: {
  13039. opacity: {
  13040. get: function(t, e) {
  13041. if (e) {
  13042. var i = St(t, "opacity");
  13043. return "" === i ? "1" : i
  13044. }
  13045. }
  13046. }
  13047. },
  13048. cssNumber: {
  13049. columnCount: !0,
  13050. fillOpacity: !0,
  13051. flexGrow: !0,
  13052. flexShrink: !0,
  13053. fontWeight: !0,
  13054. lineHeight: !0,
  13055. opacity: !0,
  13056. order: !0,
  13057. orphans: !0,
  13058. widows: !0,
  13059. zIndex: !0,
  13060. zoom: !0
  13061. },
  13062. cssProps: {
  13063. float: "cssFloat"
  13064. },
  13065. style: function(t, e, i, n) {
  13066. if (t && 3 !== t.nodeType && 8 !== t.nodeType && t.style) {
  13067. var r, o, a, s = g.camelCase(e),
  13068. l = t.style;
  13069. return e = g.cssProps[s] || (g.cssProps[s] = Ot(l, s)), a = g.cssHooks[e] || g.cssHooks[s], void 0 === i ? a && "get" in a && void 0 !== (r = a.get(t, !1, n)) ? r : l[e] : ("string" === (o = typeof i) && (r = Ct.exec(i)) && (i = (r[1] + 1) * r[2] + parseFloat(g.css(t, e)), o = "number"), void(null != i && i == i && ("number" !== o || g.cssNumber[s] || (i += "px"), p.clearCloneStyle || "" !== i || 0 !== e.indexOf("background") || (l[e] = "inherit"), a && "set" in a && void 0 === (i = a.set(t, i, n)) || (l[e] = i))))
  13070. }
  13071. },
  13072. css: function(t, e, i, n) {
  13073. var r, o, a, s = g.camelCase(e);
  13074. return e = g.cssProps[s] || (g.cssProps[s] = Ot(t.style, s)), (a = g.cssHooks[e] || g.cssHooks[s]) && "get" in a && (r = a.get(t, !0, i)), void 0 === r && (r = St(t, e, n)), "normal" === r && e in Dt && (r = Dt[e]), "" === i || i ? (o = parseFloat(r), !0 === i || g.isNumeric(o) ? o || 0 : r) : r
  13075. }
  13076. }), g.each(["height", "width"], (function(t, e) {
  13077. g.cssHooks[e] = {
  13078. get: function(t, i, n) {
  13079. return i ? At.test(g.css(t, "display")) && 0 === t.offsetWidth ? g.swap(t, Et, (function() {
  13080. return Nt(t, e, n)
  13081. })) : Nt(t, e, n) : void 0
  13082. },
  13083. set: function(t, i, n) {
  13084. var r = n && Tt(t);
  13085. return It(0, i, n ? Rt(t, e, n, "border-box" === g.css(t, "boxSizing", !1, r), r) : 0)
  13086. }
  13087. }
  13088. })), g.cssHooks.marginRight = _t(p.reliableMarginRight, (function(t, e) {
  13089. return e ? g.swap(t, {
  13090. display: "inline-block"
  13091. }, St, [t, "marginRight"]) : void 0
  13092. })), g.each({
  13093. margin: "",
  13094. padding: "",
  13095. border: "Width"
  13096. }, (function(t, e) {
  13097. g.cssHooks[t + e] = {
  13098. expand: function(i) {
  13099. for (var n = 0, r = {}, o = "string" == typeof i ? i.split(" ") : [i]; 4 > n; n++) r[t + G[n] + e] = o[n] || o[n - 2] || o[0];
  13100. return r
  13101. }
  13102. }, xt.test(t) || (g.cssHooks[t + e].set = It)
  13103. })), g.fn.extend({
  13104. css: function(t, e) {
  13105. return k(this, (function(t, e, i) {
  13106. var n, r, o = {},
  13107. a = 0;
  13108. if (g.isArray(e)) {
  13109. for (n = Tt(t), r = e.length; r > a; a++) o[e[a]] = g.css(t, e[a], !1, n);
  13110. return o
  13111. }
  13112. return void 0 !== i ? g.style(t, e, i) : g.css(t, e)
  13113. }), t, e, arguments.length > 1)
  13114. },
  13115. show: function() {
  13116. return kt(this, !0)
  13117. },
  13118. hide: function() {
  13119. return kt(this)
  13120. },
  13121. toggle: function(t) {
  13122. return "boolean" == typeof t ? t ? this.show() : this.hide() : this.each((function() {
  13123. W(this) ? g(this)
  13124. .show() : g(this)
  13125. .hide()
  13126. }))
  13127. }
  13128. }), g.Tween = Ft, Ft.prototype = {
  13129. constructor: Ft,
  13130. init: function(t, e, i, n, r, o) {
  13131. this.elem = t, this.prop = i, this.easing = r || "swing", this.options = e, this.start = this.now = this.cur(), this.end = n, this.unit = o || (g.cssNumber[i] ? "" : "px")
  13132. },
  13133. cur: function() {
  13134. var t = Ft.propHooks[this.prop];
  13135. return t && t.get ? t.get(this) : Ft.propHooks._default.get(this)
  13136. },
  13137. run: function(t) {
  13138. var e, i = Ft.propHooks[this.prop];
  13139. return this.pos = e = this.options.duration ? g.easing[this.easing](t, this.options.duration * t, 0, 1, this.options.duration) : t, this.now = (this.end - this.start) * e + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), i && i.set ? i.set(this) : Ft.propHooks._default.set(this), this
  13140. }
  13141. }, Ft.prototype.init.prototype = Ft.prototype, Ft.propHooks = {
  13142. _default: {
  13143. get: function(t) {
  13144. var e;
  13145. return null == t.elem[t.prop] || t.elem.style && null != t.elem.style[t.prop] ? (e = g.css(t.elem, t.prop, "")) && "auto" !== e ? e : 0 : t.elem[t.prop]
  13146. },
  13147. set: function(t) {
  13148. g.fx.step[t.prop] ? g.fx.step[t.prop](t) : t.elem.style && (null != t.elem.style[g.cssProps[t.prop]] || g.cssHooks[t.prop]) ? g.style(t.elem, t.prop, t.now + t.unit) : t.elem[t.prop] = t.now
  13149. }
  13150. }
  13151. }, Ft.propHooks.scrollTop = Ft.propHooks.scrollLeft = {
  13152. set: function(t) {
  13153. t.elem.nodeType && t.elem.parentNode && (t.elem[t.prop] = t.now)
  13154. }
  13155. }, g.easing = {
  13156. linear: function(t) {
  13157. return t
  13158. },
  13159. swing: function(t) {
  13160. return .5 - Math.cos(t * Math.PI) / 2
  13161. }
  13162. }, g.fx = Ft.prototype.init, g.fx.step = {};
  13163. var Bt, zt, Ut = /^(?:toggle|show|hide)$/,
  13164. Vt = new RegExp("^(?:([+-])=|)(" + H + ")([a-z%]*)$", "i"),
  13165. jt = /queueHooks$/,
  13166. Ht = [function(t, e, i) {
  13167. var n, r, o, a, s, l, u, h = this,
  13168. c = {},
  13169. d = t.style,
  13170. p = t.nodeType && W(t),
  13171. f = B.get(t, "fxshow");
  13172. for (n in i.queue || (null == (s = g._queueHooks(t, "fx"))
  13173. .unqueued && (s.unqueued = 0, l = s.empty.fire, s.empty.fire = function() {
  13174. s.unqueued || l()
  13175. }), s.unqueued++, h.always((function() {
  13176. h.always((function() {
  13177. s.unqueued--, g.queue(t, "fx")
  13178. .length || s.empty.fire()
  13179. }))
  13180. }))), 1 === t.nodeType && ("height" in e || "width" in e) && (i.overflow = [d.overflow, d.overflowX, d.overflowY], u = g.css(t, "display"), "inline" === ("none" === u ? B.get(t, "olddisplay") || wt(t.nodeName) : u) && "none" === g.css(t, "float") && (d.display = "inline-block")), i.overflow && (d.overflow = "hidden", h.always((function() {
  13181. d.overflow = i.overflow[0], d.overflowX = i.overflow[1], d.overflowY = i.overflow[2]
  13182. }))), e)
  13183. if (r = e[n], Ut.exec(r)) {
  13184. if (delete e[n], o = o || "toggle" === r, r === (p ? "hide" : "show")) {
  13185. if ("show" !== r || !f || void 0 === f[n]) continue;
  13186. p = !0
  13187. }
  13188. c[n] = f && f[n] || g.style(t, n)
  13189. } else u = void 0;
  13190. if (g.isEmptyObject(c)) "inline" === ("none" === u ? wt(t.nodeName) : u) && (d.display = u);
  13191. else
  13192. for (n in f ? "hidden" in f && (p = f.hidden) : f = B.access(t, "fxshow", {}), o && (f.hidden = !p), p ? g(t)
  13193. .show() : h.done((function() {
  13194. g(t)
  13195. .hide()
  13196. })), h.done((function() {
  13197. var e;
  13198. for (e in B.remove(t, "fxshow"), c) g.style(t, e, c[e])
  13199. })), c) a = Yt(p ? f[n] : 0, n, h), n in f || (f[n] = a.start, p && (a.end = a.start, a.start = "width" === n || "height" === n ? 1 : 0))
  13200. }],
  13201. Gt = {
  13202. "*": [function(t, e) {
  13203. var i = this.createTween(t, e),
  13204. n = i.cur(),
  13205. r = Vt.exec(e),
  13206. o = r && r[3] || (g.cssNumber[t] ? "" : "px"),
  13207. a = (g.cssNumber[t] || "px" !== o && +n) && Vt.exec(g.css(i.elem, t)),
  13208. s = 1,
  13209. l = 20;
  13210. if (a && a[3] !== o) {
  13211. o = o || a[3], r = r || [], a = +n || 1;
  13212. do {
  13213. a /= s = s || ".5", g.style(i.elem, t, a + o)
  13214. } while (s !== (s = i.cur() / n) && 1 !== s && --l)
  13215. }
  13216. return r && (a = i.start = +a || +n || 0, i.unit = o, i.end = r[1] ? a + (r[1] + 1) * r[2] : +r[2]), i
  13217. }]
  13218. };
  13219. function Wt() {
  13220. return setTimeout((function() {
  13221. Bt = void 0
  13222. })), Bt = g.now()
  13223. }
  13224. function qt(t, e) {
  13225. var i, n = 0,
  13226. r = {
  13227. height: t
  13228. };
  13229. for (e = e ? 1 : 0; 4 > n; n += 2 - e) r["margin" + (i = G[n])] = r["padding" + i] = t;
  13230. return e && (r.opacity = r.width = t), r
  13231. }
  13232. function Yt(t, e, i) {
  13233. for (var n, r = (Gt[e] || [])
  13234. .concat(Gt["*"]), o = 0, a = r.length; a > o; o++)
  13235. if (n = r[o].call(i, e, t)) return n
  13236. }
  13237. function Xt(t, e, i) {
  13238. var n, r, o = 0,
  13239. a = Ht.length,
  13240. s = g.Deferred()
  13241. .always((function() {
  13242. delete l.elem
  13243. })),
  13244. l = function() {
  13245. if (r) return !1;
  13246. for (var e = Bt || Wt(), i = Math.max(0, u.startTime + u.duration - e), n = 1 - (i / u.duration || 0), o = 0, a = u.tweens.length; a > o; o++) u.tweens[o].run(n);
  13247. return s.notifyWith(t, [u, n, i]), 1 > n && a ? i : (s.resolveWith(t, [u]), !1)
  13248. },
  13249. u = s.promise({
  13250. elem: t,
  13251. props: g.extend({}, e),
  13252. opts: g.extend(!0, {
  13253. specialEasing: {}
  13254. }, i),
  13255. originalProperties: e,
  13256. originalOptions: i,
  13257. startTime: Bt || Wt(),
  13258. duration: i.duration,
  13259. tweens: [],
  13260. createTween: function(e, i) {
  13261. var n = g.Tween(t, u.opts, e, i, u.opts.specialEasing[e] || u.opts.easing);
  13262. return u.tweens.push(n), n
  13263. },
  13264. stop: function(e) {
  13265. var i = 0,
  13266. n = e ? u.tweens.length : 0;
  13267. if (r) return this;
  13268. for (r = !0; n > i; i++) u.tweens[i].run(1);
  13269. return e ? s.resolveWith(t, [u, e]) : s.rejectWith(t, [u, e]), this
  13270. }
  13271. }),
  13272. h = u.props;
  13273. for (function(t, e) {
  13274. var i, n, r, o, a;
  13275. for (i in t)
  13276. if (r = e[n = g.camelCase(i)], o = t[i], g.isArray(o) && (r = o[1], o = t[i] = o[0]), i !== n && (t[n] = o, delete t[i]), (a = g.cssHooks[n]) && "expand" in a)
  13277. for (i in o = a.expand(o), delete t[n], o) i in t || (t[i] = o[i], e[i] = r);
  13278. else e[n] = r
  13279. }(h, u.opts.specialEasing); a > o; o++)
  13280. if (n = Ht[o].call(u, t, h, u.opts)) return n;
  13281. return g.map(h, Yt, u), g.isFunction(u.opts.start) && u.opts.start.call(t, u), g.fx.timer(g.extend(l, {
  13282. elem: t,
  13283. anim: u,
  13284. queue: u.opts.queue
  13285. })), u.progress(u.opts.progress)
  13286. .done(u.opts.done, u.opts.complete)
  13287. .fail(u.opts.fail)
  13288. .always(u.opts.always)
  13289. }
  13290. g.Animation = g.extend(Xt, {
  13291. tweener: function(t, e) {
  13292. g.isFunction(t) ? (e = t, t = ["*"]) : t = t.split(" ");
  13293. for (var i, n = 0, r = t.length; r > n; n++) i = t[n], Gt[i] = Gt[i] || [], Gt[i].unshift(e)
  13294. },
  13295. prefilter: function(t, e) {
  13296. e ? Ht.unshift(t) : Ht.push(t)
  13297. }
  13298. }), g.speed = function(t, e, i) {
  13299. var n = t && "object" == typeof t ? g.extend({}, t) : {
  13300. complete: i || !i && e || g.isFunction(t) && t,
  13301. duration: t,
  13302. easing: i && e || e && !g.isFunction(e) && e
  13303. };
  13304. return n.duration = g.fx.off ? 0 : "number" == typeof n.duration ? n.duration : n.duration in g.fx.speeds ? g.fx.speeds[n.duration] : g.fx.speeds._default, (null == n.queue || !0 === n.queue) && (n.queue = "fx"), n.old = n.complete, n.complete = function() {
  13305. g.isFunction(n.old) && n.old.call(this), n.queue && g.dequeue(this, n.queue)
  13306. }, n
  13307. }, g.fn.extend({
  13308. fadeTo: function(t, e, i, n) {
  13309. return this.filter(W)
  13310. .css("opacity", 0)
  13311. .show()
  13312. .end()
  13313. .animate({
  13314. opacity: e
  13315. }, t, i, n)
  13316. },
  13317. animate: function(t, e, i, n) {
  13318. var r = g.isEmptyObject(t),
  13319. o = g.speed(e, i, n),
  13320. a = function() {
  13321. var e = Xt(this, g.extend({}, t), o);
  13322. (r || B.get(this, "finish")) && e.stop(!0)
  13323. };
  13324. return a.finish = a, r || !1 === o.queue ? this.each(a) : this.queue(o.queue, a)
  13325. },
  13326. stop: function(t, e, i) {
  13327. var n = function(t) {
  13328. var e = t.stop;
  13329. delete t.stop, e(i)
  13330. };
  13331. return "string" != typeof t && (i = e, e = t, t = void 0), e && !1 !== t && this.queue(t || "fx", []), this.each((function() {
  13332. var e = !0,
  13333. r = null != t && t + "queueHooks",
  13334. o = g.timers,
  13335. a = B.get(this);
  13336. if (r) a[r] && a[r].stop && n(a[r]);
  13337. else
  13338. for (r in a) a[r] && a[r].stop && jt.test(r) && n(a[r]);
  13339. for (r = o.length; r--;) o[r].elem !== this || null != t && o[r].queue !== t || (o[r].anim.stop(i), e = !1, o.splice(r, 1));
  13340. (e || !i) && g.dequeue(this, t)
  13341. }))
  13342. },
  13343. finish: function(t) {
  13344. return !1 !== t && (t = t || "fx"), this.each((function() {
  13345. var e, i = B.get(this),
  13346. n = i[t + "queue"],
  13347. r = i[t + "queueHooks"],
  13348. o = g.timers,
  13349. a = n ? n.length : 0;
  13350. for (i.finish = !0, g.queue(this, t, []), r && r.stop && r.stop.call(this, !0), e = o.length; e--;) o[e].elem === this && o[e].queue === t && (o[e].anim.stop(!0), o.splice(e, 1));
  13351. for (e = 0; a > e; e++) n[e] && n[e].finish && n[e].finish.call(this);
  13352. delete i.finish
  13353. }))
  13354. }
  13355. }), g.each(["toggle", "show", "hide"], (function(t, e) {
  13356. var i = g.fn[e];
  13357. g.fn[e] = function(t, n, r) {
  13358. return null == t || "boolean" == typeof t ? i.apply(this, arguments) : this.animate(qt(e, !0), t, n, r)
  13359. }
  13360. })), g.each({
  13361. slideDown: qt("show"),
  13362. slideUp: qt("hide"),
  13363. slideToggle: qt("toggle"),
  13364. fadeIn: {
  13365. opacity: "show"
  13366. },
  13367. fadeOut: {
  13368. opacity: "hide"
  13369. },
  13370. fadeToggle: {
  13371. opacity: "toggle"
  13372. }
  13373. }, (function(t, e) {
  13374. g.fn[t] = function(t, i, n) {
  13375. return this.animate(e, t, i, n)
  13376. }
  13377. })), g.timers = [], g.fx.tick = function() {
  13378. var t, e = 0,
  13379. i = g.timers;
  13380. for (Bt = g.now(); e < i.length; e++)(t = i[e])() || i[e] !== t || i.splice(e--, 1);
  13381. i.length || g.fx.stop(), Bt = void 0
  13382. }, g.fx.timer = function(t) {
  13383. g.timers.push(t), t() ? g.fx.start() : g.timers.pop()
  13384. }, g.fx.interval = 13, g.fx.start = function() {
  13385. zt || (zt = setInterval(g.fx.tick, g.fx.interval))
  13386. }, g.fx.stop = function() {
  13387. clearInterval(zt), zt = null
  13388. }, g.fx.speeds = {
  13389. slow: 600,
  13390. fast: 200,
  13391. _default: 400
  13392. }, g.fn.delay = function(t, e) {
  13393. return t = g.fx && g.fx.speeds[t] || t, e = e || "fx", this.queue(e, (function(e, i) {
  13394. var n = setTimeout(e, t);
  13395. i.stop = function() {
  13396. clearTimeout(n)
  13397. }
  13398. }))
  13399. },
  13400. function() {
  13401. var t = f.createElement("input"),
  13402. e = f.createElement("select"),
  13403. i = e.appendChild(f.createElement("option"));
  13404. t.type = "checkbox", p.checkOn = "" !== t.value, p.optSelected = i.selected, e.disabled = !0, p.optDisabled = !i.disabled, (t = f.createElement("input"))
  13405. .value = "t", t.type = "radio", p.radioValue = "t" === t.value
  13406. }();
  13407. var Zt, Kt = g.expr.attrHandle;
  13408. g.fn.extend({
  13409. attr: function(t, e) {
  13410. return k(this, g.attr, t, e, arguments.length > 1)
  13411. },
  13412. removeAttr: function(t) {
  13413. return this.each((function() {
  13414. g.removeAttr(this, t)
  13415. }))
  13416. }
  13417. }), g.extend({
  13418. attr: function(t, e, i) {
  13419. var n, r, o = t.nodeType;
  13420. if (t && 3 !== o && 8 !== o && 2 !== o) return typeof t.getAttribute === Y ? g.prop(t, e, i) : (1 === o && g.isXMLDoc(t) || (e = e.toLowerCase(), n = g.attrHooks[e] || (g.expr.match.bool.test(e) ? Zt : void 0)), void 0 === i ? n && "get" in n && null !== (r = n.get(t, e)) ? r : null == (r = g.find.attr(t, e)) ? void 0 : r : null !== i ? n && "set" in n && void 0 !== (r = n.set(t, i, e)) ? r : (t.setAttribute(e, i + ""), i) : void g.removeAttr(t, e))
  13421. },
  13422. removeAttr: function(t, e) {
  13423. var i, n, r = 0,
  13424. o = e && e.match(I);
  13425. if (o && 1 === t.nodeType)
  13426. for (; i = o[r++];) n = g.propFix[i] || i, g.expr.match.bool.test(i) && (t[n] = !1), t.removeAttribute(i)
  13427. },
  13428. attrHooks: {
  13429. type: {
  13430. set: function(t, e) {
  13431. if (!p.radioValue && "radio" === e && g.nodeName(t, "input")) {
  13432. var i = t.value;
  13433. return t.setAttribute("type", e), i && (t.value = i), e
  13434. }
  13435. }
  13436. }
  13437. }
  13438. }), Zt = {
  13439. set: function(t, e, i) {
  13440. return !1 === e ? g.removeAttr(t, i) : t.setAttribute(i, i), i
  13441. }
  13442. }, g.each(g.expr.match.bool.source.match(/\w+/g), (function(t, e) {
  13443. var i = Kt[e] || g.find.attr;
  13444. Kt[e] = function(t, e, n) {
  13445. var r, o;
  13446. return n || (o = Kt[e], Kt[e] = r, r = null != i(t, e, n) ? e.toLowerCase() : null, Kt[e] = o), r
  13447. }
  13448. }));
  13449. var Qt = /^(?:input|select|textarea|button)$/i;
  13450. g.fn.extend({
  13451. prop: function(t, e) {
  13452. return k(this, g.prop, t, e, arguments.length > 1)
  13453. },
  13454. removeProp: function(t) {
  13455. return this.each((function() {
  13456. delete this[g.propFix[t] || t]
  13457. }))
  13458. }
  13459. }), g.extend({
  13460. propFix: {
  13461. for: "htmlFor",
  13462. class: "className"
  13463. },
  13464. prop: function(t, e, i) {
  13465. var n, r, o = t.nodeType;
  13466. if (t && 3 !== o && 8 !== o && 2 !== o) return (1 !== o || !g.isXMLDoc(t)) && (e = g.propFix[e] || e, r = g.propHooks[e]), void 0 !== i ? r && "set" in r && void 0 !== (n = r.set(t, i, e)) ? n : t[e] = i : r && "get" in r && null !== (n = r.get(t, e)) ? n : t[e]
  13467. },
  13468. propHooks: {
  13469. tabIndex: {
  13470. get: function(t) {
  13471. return t.hasAttribute("tabindex") || Qt.test(t.nodeName) || t.href ? t.tabIndex : -1
  13472. }
  13473. }
  13474. }
  13475. }), p.optSelected || (g.propHooks.selected = {
  13476. get: function(t) {
  13477. var e = t.parentNode;
  13478. return e && e.parentNode && e.parentNode.selectedIndex, null
  13479. }
  13480. }), g.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], (function() {
  13481. g.propFix[this.toLowerCase()] = this
  13482. }));
  13483. var Jt = /[\t\r\n\f]/g;
  13484. g.fn.extend({
  13485. addClass: function(t) {
  13486. var e, i, n, r, o, a, s = "string" == typeof t && t,
  13487. l = 0,
  13488. u = this.length;
  13489. if (g.isFunction(t)) return this.each((function(e) {
  13490. g(this)
  13491. .addClass(t.call(this, e, this.className))
  13492. }));
  13493. if (s)
  13494. for (e = (t || "")
  13495. .match(I) || []; u > l; l++)
  13496. if (n = 1 === (i = this[l])
  13497. .nodeType && (i.className ? (" " + i.className + " ")
  13498. .replace(Jt, " ") : " ")) {
  13499. for (o = 0; r = e[o++];) n.indexOf(" " + r + " ") < 0 && (n += r + " ");
  13500. a = g.trim(n), i.className !== a && (i.className = a)
  13501. } return this
  13502. },
  13503. removeClass: function(t) {
  13504. var e, i, n, r, o, a, s = 0 === arguments.length || "string" == typeof t && t,
  13505. l = 0,
  13506. u = this.length;
  13507. if (g.isFunction(t)) return this.each((function(e) {
  13508. g(this)
  13509. .removeClass(t.call(this, e, this.className))
  13510. }));
  13511. if (s)
  13512. for (e = (t || "")
  13513. .match(I) || []; u > l; l++)
  13514. if (n = 1 === (i = this[l])
  13515. .nodeType && (i.className ? (" " + i.className + " ")
  13516. .replace(Jt, " ") : "")) {
  13517. for (o = 0; r = e[o++];)
  13518. for (; n.indexOf(" " + r + " ") >= 0;) n = n.replace(" " + r + " ", " ");
  13519. a = t ? g.trim(n) : "", i.className !== a && (i.className = a)
  13520. } return this
  13521. },
  13522. toggleClass: function(t, e) {
  13523. var i = typeof t;
  13524. return "boolean" == typeof e && "string" === i ? e ? this.addClass(t) : this.removeClass(t) : this.each(g.isFunction(t) ? function(i) {
  13525. g(this)
  13526. .toggleClass(t.call(this, i, this.className, e), e)
  13527. } : function() {
  13528. if ("string" === i)
  13529. for (var e, n = 0, r = g(this), o = t.match(I) || []; e = o[n++];) r.hasClass(e) ? r.removeClass(e) : r.addClass(e);
  13530. else(i === Y || "boolean" === i) && (this.className && B.set(this, "__className__", this.className), this.className = this.className || !1 === t ? "" : B.get(this, "__className__") || "")
  13531. })
  13532. },
  13533. hasClass: function(t) {
  13534. for (var e = " " + t + " ", i = 0, n = this.length; n > i; i++)
  13535. if (1 === this[i].nodeType && (" " + this[i].className + " ")
  13536. .replace(Jt, " ")
  13537. .indexOf(e) >= 0) return !0;
  13538. return !1
  13539. }
  13540. });
  13541. var $t = /\r/g;
  13542. g.fn.extend({
  13543. val: function(t) {
  13544. var e, i, n, r = this[0];
  13545. return arguments.length ? (n = g.isFunction(t), this.each((function(i) {
  13546. var r;
  13547. 1 === this.nodeType && (null == (r = n ? t.call(this, i, g(this)
  13548. .val()) : t) ? r = "" : "number" == typeof r ? r += "" : g.isArray(r) && (r = g.map(r, (function(t) {
  13549. return null == t ? "" : t + ""
  13550. }))), (e = g.valHooks[this.type] || g.valHooks[this.nodeName.toLowerCase()]) && "set" in e && void 0 !== e.set(this, r, "value") || (this.value = r))
  13551. }))) : r ? (e = g.valHooks[r.type] || g.valHooks[r.nodeName.toLowerCase()]) && "get" in e && void 0 !== (i = e.get(r, "value")) ? i : "string" == typeof(i = r.value) ? i.replace($t, "") : null == i ? "" : i : void 0
  13552. }
  13553. }), g.extend({
  13554. valHooks: {
  13555. option: {
  13556. get: function(t) {
  13557. var e = g.find.attr(t, "value");
  13558. return null != e ? e : g.trim(g.text(t))
  13559. }
  13560. },
  13561. select: {
  13562. get: function(t) {
  13563. for (var e, i, n = t.options, r = t.selectedIndex, o = "select-one" === t.type || 0 > r, a = o ? null : [], s = o ? r + 1 : n.length, l = 0 > r ? s : o ? r : 0; s > l; l++)
  13564. if (!(!(i = n[l])
  13565. .selected && l !== r || (p.optDisabled ? i.disabled : null !== i.getAttribute("disabled")) || i.parentNode.disabled && g.nodeName(i.parentNode, "optgroup"))) {
  13566. if (e = g(i)
  13567. .val(), o) return e;
  13568. a.push(e)
  13569. } return a
  13570. },
  13571. set: function(t, e) {
  13572. for (var i, n, r = t.options, o = g.makeArray(e), a = r.length; a--;)((n = r[a])
  13573. .selected = g.inArray(n.value, o) >= 0) && (i = !0);
  13574. return i || (t.selectedIndex = -1), o
  13575. }
  13576. }
  13577. }
  13578. }), g.each(["radio", "checkbox"], (function() {
  13579. g.valHooks[this] = {
  13580. set: function(t, e) {
  13581. return g.isArray(e) ? t.checked = g.inArray(g(t)
  13582. .val(), e) >= 0 : void 0
  13583. }
  13584. }, p.checkOn || (g.valHooks[this].get = function(t) {
  13585. return null === t.getAttribute("value") ? "on" : t.value
  13586. })
  13587. })), g.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), (function(t, e) {
  13588. g.fn[e] = function(t, i) {
  13589. return arguments.length > 0 ? this.on(e, null, t, i) : this.trigger(e)
  13590. }
  13591. })), g.fn.extend({
  13592. hover: function(t, e) {
  13593. return this.mouseenter(t)
  13594. .mouseleave(e || t)
  13595. },
  13596. bind: function(t, e, i) {
  13597. return this.on(t, null, e, i)
  13598. },
  13599. unbind: function(t, e) {
  13600. return this.off(t, null, e)
  13601. },
  13602. delegate: function(t, e, i, n) {
  13603. return this.on(e, t, i, n)
  13604. },
  13605. undelegate: function(t, e, i) {
  13606. return 1 === arguments.length ? this.off(t, "**") : this.off(e, t || "**", i)
  13607. }
  13608. });
  13609. var te = g.now(),
  13610. ee = /\?/;
  13611. g.parseJSON = function(t) {
  13612. return JSON.parse(t + "")
  13613. }, g.parseXML = function(t) {
  13614. var e;
  13615. if (!t || "string" != typeof t) return null;
  13616. try {
  13617. e = (new DOMParser)
  13618. .parseFromString(t, "text/xml")
  13619. } catch (t) {
  13620. e = void 0
  13621. }
  13622. return (!e || e.getElementsByTagName("parsererror")
  13623. .length) && g.error("Invalid XML: " + t), e
  13624. };
  13625. var ie, ne, re = /#.*$/,
  13626. oe = /([?&])_=[^&]*/,
  13627. ae = /^(.*?):[ \t]*([^\r\n]*)$/gm,
  13628. se = /^(?:GET|HEAD)$/,
  13629. le = /^\/\//,
  13630. ue = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
  13631. he = {},
  13632. ce = {},
  13633. de = "*/".concat("*");
  13634. try {
  13635. ne = location.href
  13636. } catch (t) {
  13637. (ne = f.createElement("a"))
  13638. .href = "", ne = ne.href
  13639. }
  13640. function pe(t) {
  13641. return function(e, i) {
  13642. "string" != typeof e && (i = e, e = "*");
  13643. var n, r = 0,
  13644. o = e.toLowerCase()
  13645. .match(I) || [];
  13646. if (g.isFunction(i))
  13647. for (; n = o[r++];) "+" === n[0] ? (n = n.slice(1) || "*", (t[n] = t[n] || [])
  13648. .unshift(i)) : (t[n] = t[n] || [])
  13649. .push(i)
  13650. }
  13651. }
  13652. function fe(t, e, i, n) {
  13653. var r = {},
  13654. o = t === ce;
  13655. function a(s) {
  13656. var l;
  13657. return r[s] = !0, g.each(t[s] || [], (function(t, s) {
  13658. var u = s(e, i, n);
  13659. return "string" != typeof u || o || r[u] ? o ? !(l = u) : void 0 : (e.dataTypes.unshift(u), a(u), !1)
  13660. })), l
  13661. }
  13662. return a(e.dataTypes[0]) || !r["*"] && a("*")
  13663. }
  13664. function me(t, e) {
  13665. var i, n, r = g.ajaxSettings.flatOptions || {};
  13666. for (i in e) void 0 !== e[i] && ((r[i] ? t : n || (n = {}))[i] = e[i]);
  13667. return n && g.extend(!0, t, n), t
  13668. }
  13669. ie = ue.exec(ne.toLowerCase()) || [], g.extend({
  13670. active: 0,
  13671. lastModified: {},
  13672. etag: {},
  13673. ajaxSettings: {
  13674. url: ne,
  13675. type: "GET",
  13676. isLocal: /^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ie[1]),
  13677. global: !0,
  13678. processData: !0,
  13679. async: !0,
  13680. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  13681. accepts: {
  13682. "*": de,
  13683. text: "text/plain",
  13684. html: "text/html",
  13685. xml: "application/xml, text/xml",
  13686. json: "application/json, text/javascript"
  13687. },
  13688. contents: {
  13689. xml: /xml/,
  13690. html: /html/,
  13691. json: /json/
  13692. },
  13693. responseFields: {
  13694. xml: "responseXML",
  13695. text: "responseText",
  13696. json: "responseJSON"
  13697. },
  13698. converters: {
  13699. "* text": String,
  13700. "text html": !0,
  13701. "text json": g.parseJSON,
  13702. "text xml": g.parseXML
  13703. },
  13704. flatOptions: {
  13705. url: !0,
  13706. context: !0
  13707. }
  13708. },
  13709. ajaxSetup: function(t, e) {
  13710. return e ? me(me(t, g.ajaxSettings), e) : me(g.ajaxSettings, t)
  13711. },
  13712. ajaxPrefilter: pe(he),
  13713. ajaxTransport: pe(ce),
  13714. ajax: function(t, e) {
  13715. "object" == typeof t && (e = t, t = void 0), e = e || {};
  13716. var i, n, r, o, a, s, l, u, h = g.ajaxSetup({}, e),
  13717. c = h.context || h,
  13718. d = h.context && (c.nodeType || c.jquery) ? g(c) : g.event,
  13719. p = g.Deferred(),
  13720. f = g.Callbacks("once memory"),
  13721. m = h.statusCode || {},
  13722. v = {},
  13723. y = {},
  13724. b = 0,
  13725. w = "canceled",
  13726. x = {
  13727. readyState: 0,
  13728. getResponseHeader: function(t) {
  13729. var e;
  13730. if (2 === b) {
  13731. if (!o)
  13732. for (o = {}; e = ae.exec(r);) o[e[1].toLowerCase()] = e[2];
  13733. e = o[t.toLowerCase()]
  13734. }
  13735. return null == e ? null : e
  13736. },
  13737. getAllResponseHeaders: function() {
  13738. return 2 === b ? r : null
  13739. },
  13740. setRequestHeader: function(t, e) {
  13741. var i = t.toLowerCase();
  13742. return b || (t = y[i] = y[i] || t, v[t] = e), this
  13743. },
  13744. overrideMimeType: function(t) {
  13745. return b || (h.mimeType = t), this
  13746. },
  13747. statusCode: function(t) {
  13748. var e;
  13749. if (t)
  13750. if (2 > b)
  13751. for (e in t) m[e] = [m[e], t[e]];
  13752. else x.always(t[x.status]);
  13753. return this
  13754. },
  13755. abort: function(t) {
  13756. var e = t || w;
  13757. return i && i.abort(e), M(0, e), this
  13758. }
  13759. };
  13760. if (p.promise(x)
  13761. .complete = f.add, x.success = x.done, x.error = x.fail, h.url = ((t || h.url || ne) + "")
  13762. .replace(re, "")
  13763. .replace(le, ie[1] + "//"), h.type = e.method || e.type || h.method || h.type, h.dataTypes = g.trim(h.dataType || "*")
  13764. .toLowerCase()
  13765. .match(I) || [""], null == h.crossDomain && (s = ue.exec(h.url.toLowerCase()), h.crossDomain = !(!s || s[1] === ie[1] && s[2] === ie[2] && (s[3] || ("http:" === s[1] ? "80" : "443")) === (ie[3] || ("http:" === ie[1] ? "80" : "443")))), h.data && h.processData && "string" != typeof h.data && (h.data = g.param(h.data, h.traditional)), fe(he, h, e, x), 2 === b) return x;
  13766. for (u in (l = h.global) && 0 == g.active++ && g.event.trigger("ajaxStart"), h.type = h.type.toUpperCase(), h.hasContent = !se.test(h.type), n = h.url, h.hasContent || (h.data && (n = h.url += (ee.test(n) ? "&" : "?") + h.data, delete h.data), !1 === h.cache && (h.url = oe.test(n) ? n.replace(oe, "$1_=" + te++) : n + (ee.test(n) ? "&" : "?") + "_=" + te++)), h.ifModified && (g.lastModified[n] && x.setRequestHeader("If-Modified-Since", g.lastModified[n]), g.etag[n] && x.setRequestHeader("If-None-Match", g.etag[n])), (h.data && h.hasContent && !1 !== h.contentType || e.contentType) && x.setRequestHeader("Content-Type", h.contentType), x.setRequestHeader("Accept", h.dataTypes[0] && h.accepts[h.dataTypes[0]] ? h.accepts[h.dataTypes[0]] + ("*" !== h.dataTypes[0] ? ", " + de + "; q=0.01" : "") : h.accepts["*"]), h.headers) x.setRequestHeader(u, h.headers[u]);
  13767. if (h.beforeSend && (!1 === h.beforeSend.call(c, x, h) || 2 === b)) return x.abort();
  13768. for (u in w = "abort", {
  13769. success: 1,
  13770. error: 1,
  13771. complete: 1
  13772. }) x[u](h[u]);
  13773. if (i = fe(ce, h, e, x)) {
  13774. x.readyState = 1, l && d.trigger("ajaxSend", [x, h]), h.async && h.timeout > 0 && (a = setTimeout((function() {
  13775. x.abort("timeout")
  13776. }), h.timeout));
  13777. try {
  13778. b = 1, i.send(v, M)
  13779. } catch (t) {
  13780. if (!(2 > b)) throw t;
  13781. M(-1, t)
  13782. }
  13783. } else M(-1, "No Transport");
  13784. function M(t, e, o, s) {
  13785. var u, v, y, w, M, T = e;
  13786. 2 !== b && (b = 2, a && clearTimeout(a), i = void 0, r = s || "", x.readyState = t > 0 ? 4 : 0, u = t >= 200 && 300 > t || 304 === t, o && (w = function(t, e, i) {
  13787. for (var n, r, o, a, s = t.contents, l = t.dataTypes;
  13788. "*" === l[0];) l.shift(), void 0 === n && (n = t.mimeType || e.getResponseHeader("Content-Type"));
  13789. if (n)
  13790. for (r in s)
  13791. if (s[r] && s[r].test(n)) {
  13792. l.unshift(r);
  13793. break
  13794. } if (l[0] in i) o = l[0];
  13795. else {
  13796. for (r in i) {
  13797. if (!l[0] || t.converters[r + " " + l[0]]) {
  13798. o = r;
  13799. break
  13800. }
  13801. a || (a = r)
  13802. }
  13803. o = o || a
  13804. }
  13805. return o ? (o !== l[0] && l.unshift(o), i[o]) : void 0
  13806. }(h, x, o)), w = function(t, e, i, n) {
  13807. var r, o, a, s, l, u = {},
  13808. h = t.dataTypes.slice();
  13809. if (h[1])
  13810. for (a in t.converters) u[a.toLowerCase()] = t.converters[a];
  13811. for (o = h.shift(); o;)
  13812. if (t.responseFields[o] && (i[t.responseFields[o]] = e), !l && n && t.dataFilter && (e = t.dataFilter(e, t.dataType)), l = o, o = h.shift())
  13813. if ("*" === o) o = l;
  13814. else if ("*" !== l && l !== o) {
  13815. if (!(a = u[l + " " + o] || u["* " + o]))
  13816. for (r in u)
  13817. if ((s = r.split(" "))[1] === o && (a = u[l + " " + s[0]] || u["* " + s[0]])) {
  13818. !0 === a ? a = u[r] : !0 !== u[r] && (o = s[0], h.unshift(s[1]));
  13819. break
  13820. } if (!0 !== a)
  13821. if (a && t.throws) e = a(e);
  13822. else try {
  13823. e = a(e)
  13824. } catch (t) {
  13825. return {
  13826. state: "parsererror",
  13827. error: a ? t : "No conversion from " + l + " to " + o
  13828. }
  13829. }
  13830. }
  13831. return {
  13832. state: "success",
  13833. data: e
  13834. }
  13835. }(h, w, x, u), u ? (h.ifModified && ((M = x.getResponseHeader("Last-Modified")) && (g.lastModified[n] = M), (M = x.getResponseHeader("etag")) && (g.etag[n] = M)), 204 === t || "HEAD" === h.type ? T = "nocontent" : 304 === t ? T = "notmodified" : (T = w.state, v = w.data, u = !(y = w.error))) : (y = T, (t || !T) && (T = "error", 0 > t && (t = 0))), x.status = t, x.statusText = (e || T) + "", u ? p.resolveWith(c, [v, T, x]) : p.rejectWith(c, [x, T, y]), x.statusCode(m), m = void 0, l && d.trigger(u ? "ajaxSuccess" : "ajaxError", [x, h, u ? v : y]), f.fireWith(c, [x, T]), l && (d.trigger("ajaxComplete", [x, h]), --g.active || g.event.trigger("ajaxStop")))
  13836. }
  13837. return x
  13838. },
  13839. getJSON: function(t, e, i) {
  13840. return g.get(t, e, i, "json")
  13841. },
  13842. getScript: function(t, e) {
  13843. return g.get(t, void 0, e, "script")
  13844. }
  13845. }), g.each(["get", "post"], (function(t, e) {
  13846. g[e] = function(t, i, n, r) {
  13847. return g.isFunction(i) && (r = r || n, n = i, i = void 0), g.ajax({
  13848. url: t,
  13849. type: e,
  13850. dataType: r,
  13851. data: i,
  13852. success: n
  13853. })
  13854. }
  13855. })), g.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], (function(t, e) {
  13856. g.fn[e] = function(t) {
  13857. return this.on(e, t)
  13858. }
  13859. })), g._evalUrl = function(t) {
  13860. return g.ajax({
  13861. url: t,
  13862. type: "GET",
  13863. dataType: "script",
  13864. async: !1,
  13865. global: !1,
  13866. throws: !0
  13867. })
  13868. }, g.fn.extend({
  13869. wrapAll: function(t) {
  13870. var e;
  13871. return g.isFunction(t) ? this.each((function(e) {
  13872. g(this)
  13873. .wrapAll(t.call(this, e))
  13874. })) : (this[0] && (e = g(t, this[0].ownerDocument)
  13875. .eq(0)
  13876. .clone(!0), this[0].parentNode && e.insertBefore(this[0]), e.map((function() {
  13877. for (var t = this; t.firstElementChild;) t = t.firstElementChild;
  13878. return t
  13879. }))
  13880. .append(this)), this)
  13881. },
  13882. wrapInner: function(t) {
  13883. return this.each(g.isFunction(t) ? function(e) {
  13884. g(this)
  13885. .wrapInner(t.call(this, e))
  13886. } : function() {
  13887. var e = g(this),
  13888. i = e.contents();
  13889. i.length ? i.wrapAll(t) : e.append(t)
  13890. })
  13891. },
  13892. wrap: function(t) {
  13893. var e = g.isFunction(t);
  13894. return this.each((function(i) {
  13895. g(this)
  13896. .wrapAll(e ? t.call(this, i) : t)
  13897. }))
  13898. },
  13899. unwrap: function() {
  13900. return this.parent()
  13901. .each((function() {
  13902. g.nodeName(this, "body") || g(this)
  13903. .replaceWith(this.childNodes)
  13904. }))
  13905. .end()
  13906. }
  13907. }), g.expr.filters.hidden = function(t) {
  13908. return t.offsetWidth <= 0 && t.offsetHeight <= 0
  13909. }, g.expr.filters.visible = function(t) {
  13910. return !g.expr.filters.hidden(t)
  13911. };
  13912. var ge = /%20/g,
  13913. ve = /\[\]$/,
  13914. ye = /\r?\n/g,
  13915. be = /^(?:submit|button|image|reset|file)$/i,
  13916. we = /^(?:input|select|textarea|keygen)/i;
  13917. function xe(t, e, i, n) {
  13918. var r;
  13919. if (g.isArray(e)) g.each(e, (function(e, r) {
  13920. i || ve.test(t) ? n(t, r) : xe(t + "[" + ("object" == typeof r ? e : "") + "]", r, i, n)
  13921. }));
  13922. else if (i || "object" !== g.type(e)) n(t, e);
  13923. else
  13924. for (r in e) xe(t + "[" + r + "]", e[r], i, n)
  13925. }
  13926. g.param = function(t, e) {
  13927. var i, n = [],
  13928. r = function(t, e) {
  13929. e = g.isFunction(e) ? e() : null == e ? "" : e, n[n.length] = encodeURIComponent(t) + "=" + encodeURIComponent(e)
  13930. };
  13931. if (void 0 === e && (e = g.ajaxSettings && g.ajaxSettings.traditional), g.isArray(t) || t.jquery && !g.isPlainObject(t)) g.each(t, (function() {
  13932. r(this.name, this.value)
  13933. }));
  13934. else
  13935. for (i in t) xe(i, t[i], e, r);
  13936. return n.join("&")
  13937. .replace(ge, "+")
  13938. }, g.fn.extend({
  13939. serialize: function() {
  13940. return g.param(this.serializeArray())
  13941. },
  13942. serializeArray: function() {
  13943. return this.map((function() {
  13944. var t = g.prop(this, "elements");
  13945. return t ? g.makeArray(t) : this
  13946. }))
  13947. .filter((function() {
  13948. var t = this.type;
  13949. return this.name && !g(this)
  13950. .is(":disabled") && we.test(this.nodeName) && !be.test(t) && (this.checked || !q.test(t))
  13951. }))
  13952. .map((function(t, e) {
  13953. var i = g(this)
  13954. .val();
  13955. return null == i ? null : g.isArray(i) ? g.map(i, (function(t) {
  13956. return {
  13957. name: e.name,
  13958. value: t.replace(ye, "\r\n")
  13959. }
  13960. })) : {
  13961. name: e.name,
  13962. value: i.replace(ye, "\r\n")
  13963. }
  13964. }))
  13965. .get()
  13966. }
  13967. }), g.ajaxSettings.xhr = function() {
  13968. try {
  13969. return new XMLHttpRequest
  13970. } catch (t) {}
  13971. };
  13972. var Me = 0,
  13973. Te = {},
  13974. Se = {
  13975. 0: 200,
  13976. 1223: 204
  13977. },
  13978. _e = g.ajaxSettings.xhr();
  13979. i.ActiveXObject && g(i)
  13980. .on("unload", (function() {
  13981. for (var t in Te) Te[t]()
  13982. })), p.cors = !!_e && "withCredentials" in _e, p.ajax = _e = !!_e, g.ajaxTransport((function(t) {
  13983. var e;
  13984. return p.cors || _e && !t.crossDomain ? {
  13985. send: function(i, n) {
  13986. var r, o = t.xhr(),
  13987. a = ++Me;
  13988. if (o.open(t.type, t.url, t.async, t.username, t.password), t.xhrFields)
  13989. for (r in t.xhrFields) o[r] = t.xhrFields[r];
  13990. for (r in t.mimeType && o.overrideMimeType && o.overrideMimeType(t.mimeType), t.crossDomain || i["X-Requested-With"] || (i["X-Requested-With"] = "XMLHttpRequest"), i) o.setRequestHeader(r, i[r]);
  13991. e = function(t) {
  13992. return function() {
  13993. e && (delete Te[a], e = o.onload = o.onerror = null, "abort" === t ? o.abort() : "error" === t ? n(o.status, o.statusText) : n(Se[o.status] || o.status, o.statusText, "string" == typeof o.responseText ? {
  13994. text: o.responseText
  13995. } : void 0, o.getAllResponseHeaders()))
  13996. }
  13997. }, o.onload = e(), o.onerror = e("error"), e = Te[a] = e("abort");
  13998. try {
  13999. o.send(t.hasContent && t.data || null)
  14000. } catch (t) {
  14001. if (e) throw t
  14002. }
  14003. },
  14004. abort: function() {
  14005. e && e()
  14006. }
  14007. } : void 0
  14008. })), g.ajaxSetup({
  14009. accepts: {
  14010. script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
  14011. },
  14012. contents: {
  14013. script: /(?:java|ecma)script/
  14014. },
  14015. converters: {
  14016. "text script": function(t) {
  14017. return g.globalEval(t), t
  14018. }
  14019. }
  14020. }), g.ajaxPrefilter("script", (function(t) {
  14021. void 0 === t.cache && (t.cache = !1), t.crossDomain && (t.type = "GET")
  14022. })), g.ajaxTransport("script", (function(t) {
  14023. var e, i;
  14024. if (t.crossDomain) return {
  14025. send: function(n, r) {
  14026. e = g("<script>")
  14027. .prop({
  14028. async: !0,
  14029. charset: t.scriptCharset,
  14030. src: t.url
  14031. })
  14032. .on("load error", i = function(t) {
  14033. e.remove(), i = null, t && r("error" === t.type ? 404 : 200, t.type)
  14034. }), f.head.appendChild(e[0])
  14035. },
  14036. abort: function() {
  14037. i && i()
  14038. }
  14039. }
  14040. }));
  14041. var Ae = [],
  14042. Pe = /(=)\?(?=&|$)|\?\?/;
  14043. g.ajaxSetup({
  14044. jsonp: "callback",
  14045. jsonpCallback: function() {
  14046. var t = Ae.pop() || g.expando + "_" + te++;
  14047. return this[t] = !0, t
  14048. }
  14049. }), g.ajaxPrefilter("json jsonp", (function(t, e, n) {
  14050. var r, o, a, s = !1 !== t.jsonp && (Pe.test(t.url) ? "url" : "string" == typeof t.data && !(t.contentType || "")
  14051. .indexOf("application/x-www-form-urlencoded") && Pe.test(t.data) && "data");
  14052. return s || "jsonp" === t.dataTypes[0] ? (r = t.jsonpCallback = g.isFunction(t.jsonpCallback) ? t.jsonpCallback() : t.jsonpCallback, s ? t[s] = t[s].replace(Pe, "$1" + r) : !1 !== t.jsonp && (t.url += (ee.test(t.url) ? "&" : "?") + t.jsonp + "=" + r), t.converters["script json"] = function() {
  14053. return a || g.error(r + " was not called"), a[0]
  14054. }, t.dataTypes[0] = "json", o = i[r], i[r] = function() {
  14055. a = arguments
  14056. }, n.always((function() {
  14057. i[r] = o, t[r] && (t.jsonpCallback = e.jsonpCallback, Ae.push(r)), a && g.isFunction(o) && o(a[0]), a = o = void 0
  14058. })), "script") : void 0
  14059. })), g.parseHTML = function(t, e, i) {
  14060. if (!t || "string" != typeof t) return null;
  14061. "boolean" == typeof e && (i = e, e = !1), e = e || f;
  14062. var n = S.exec(t),
  14063. r = !i && [];
  14064. return n ? [e.createElement(n[1])] : (n = g.buildFragment([t], e, r), r && r.length && g(r)
  14065. .remove(), g.merge([], n.childNodes))
  14066. };
  14067. var Ce = g.fn.load;
  14068. g.fn.load = function(t, e, i) {
  14069. if ("string" != typeof t && Ce) return Ce.apply(this, arguments);
  14070. var n, r, o, a = this,
  14071. s = t.indexOf(" ");
  14072. return s >= 0 && (n = g.trim(t.slice(s)), t = t.slice(0, s)), g.isFunction(e) ? (i = e, e = void 0) : e && "object" == typeof e && (r = "POST"), a.length > 0 && g.ajax({
  14073. url: t,
  14074. type: r,
  14075. dataType: "html",
  14076. data: e
  14077. })
  14078. .done((function(t) {
  14079. o = arguments, a.html(n ? g("<div>")
  14080. .append(g.parseHTML(t))
  14081. .find(n) : t)
  14082. }))
  14083. .complete(i && function(t, e) {
  14084. a.each(i, o || [t.responseText, e, t])
  14085. }), this
  14086. }, g.expr.filters.animated = function(t) {
  14087. return g.grep(g.timers, (function(e) {
  14088. return t === e.elem
  14089. }))
  14090. .length
  14091. };
  14092. var Ee = i.document.documentElement;
  14093. function De(t) {
  14094. return g.isWindow(t) ? t : 9 === t.nodeType && t.defaultView
  14095. }
  14096. g.offset = {
  14097. setOffset: function(t, e, i) {
  14098. var n, r, o, a, s, l, u = g.css(t, "position"),
  14099. h = g(t),
  14100. c = {};
  14101. "static" === u && (t.style.position = "relative"), s = h.offset(), o = g.css(t, "top"), l = g.css(t, "left"), ("absolute" === u || "fixed" === u) && (o + l)
  14102. .indexOf("auto") > -1 ? (a = (n = h.position())
  14103. .top, r = n.left) : (a = parseFloat(o) || 0, r = parseFloat(l) || 0), g.isFunction(e) && (e = e.call(t, i, s)), null != e.top && (c.top = e.top - s.top + a), null != e.left && (c.left = e.left - s.left + r), "using" in e ? e.using.call(t, c) : h.css(c)
  14104. }
  14105. }, g.fn.extend({
  14106. offset: function(t) {
  14107. if (arguments.length) return void 0 === t ? this : this.each((function(e) {
  14108. g.offset.setOffset(this, t, e)
  14109. }));
  14110. var e, i, n = this[0],
  14111. r = {
  14112. top: 0,
  14113. left: 0
  14114. },
  14115. o = n && n.ownerDocument;
  14116. return o ? (e = o.documentElement, g.contains(e, n) ? (typeof n.getBoundingClientRect !== Y && (r = n.getBoundingClientRect()), i = De(o), {
  14117. top: r.top + i.pageYOffset - e.clientTop,
  14118. left: r.left + i.pageXOffset - e.clientLeft
  14119. }) : r) : void 0
  14120. },
  14121. position: function() {
  14122. if (this[0]) {
  14123. var t, e, i = this[0],
  14124. n = {
  14125. top: 0,
  14126. left: 0
  14127. };
  14128. return "fixed" === g.css(i, "position") ? e = i.getBoundingClientRect() : (t = this.offsetParent(), e = this.offset(), g.nodeName(t[0], "html") || (n = t.offset()), n.top += g.css(t[0], "borderTopWidth", !0), n.left += g.css(t[0], "borderLeftWidth", !0)), {
  14129. top: e.top - n.top - g.css(i, "marginTop", !0),
  14130. left: e.left - n.left - g.css(i, "marginLeft", !0)
  14131. }
  14132. }
  14133. },
  14134. offsetParent: function() {
  14135. return this.map((function() {
  14136. for (var t = this.offsetParent || Ee; t && !g.nodeName(t, "html") && "static" === g.css(t, "position");) t = t.offsetParent;
  14137. return t || Ee
  14138. }))
  14139. }
  14140. }), g.each({
  14141. scrollLeft: "pageXOffset",
  14142. scrollTop: "pageYOffset"
  14143. }, (function(t, e) {
  14144. var n = "pageYOffset" === e;
  14145. g.fn[t] = function(r) {
  14146. return k(this, (function(t, r, o) {
  14147. var a = De(t);
  14148. return void 0 === o ? a ? a[e] : t[r] : void(a ? a.scrollTo(n ? i.pageXOffset : o, n ? o : i.pageYOffset) : t[r] = o)
  14149. }), t, r, arguments.length, null)
  14150. }
  14151. })), g.each(["top", "left"], (function(t, e) {
  14152. g.cssHooks[e] = _t(p.pixelPosition, (function(t, i) {
  14153. return i ? (i = St(t, e), Mt.test(i) ? g(t)
  14154. .position()[e] + "px" : i) : void 0
  14155. }))
  14156. })), g.each({
  14157. Height: "height",
  14158. Width: "width"
  14159. }, (function(t, e) {
  14160. g.each({
  14161. padding: "inner" + t,
  14162. content: e,
  14163. "": "outer" + t
  14164. }, (function(i, n) {
  14165. g.fn[n] = function(n, r) {
  14166. var o = arguments.length && (i || "boolean" != typeof n),
  14167. a = i || (!0 === n || !0 === r ? "margin" : "border");
  14168. return k(this, (function(e, i, n) {
  14169. var r;
  14170. return g.isWindow(e) ? e.document.documentElement["client" + t] : 9 === e.nodeType ? (r = e.documentElement, Math.max(e.body["scroll" + t], r["scroll" + t], e.body["offset" + t], r["offset" + t], r["client" + t])) : void 0 === n ? g.css(e, i, a) : g.style(e, i, n, a)
  14171. }), e, o ? n : void 0, o, null)
  14172. }
  14173. }))
  14174. })), g.fn.size = function() {
  14175. return this.length
  14176. }, g.fn.andSelf = g.fn.addBack, void 0 === (n = function() {
  14177. return g
  14178. }.apply(e, [])) || (t.exports = n);
  14179. var Le = i.jQuery,
  14180. Oe = i.$;
  14181. return g.noConflict = function(t) {
  14182. return i.$ === g && (i.$ = Oe), t && i.jQuery === g && (i.jQuery = Le), g
  14183. }, typeof r === Y && (i.jQuery = i.$ = g), g
  14184. }))
  14185. }, function(t, e, i) {
  14186. var n = i(0);
  14187. ! function() {
  14188. if ("performance" in window == 0 && (window.performance = {}), "now" in window.performance == 0) {
  14189. var t = Date.now();
  14190. performance.timing && performance.timing.navigationStart && (t = performance.timing.navigationStart), window.performance.now = function() {
  14191. return Date.now() - t
  14192. }
  14193. }
  14194. }(), n.WebGLRenderer.prototype.paramThreeToGL = function(t) {
  14195. var e, i = this.extensions,
  14196. r = this.context;
  14197. if (t === n.RepeatWrapping) return r.REPEAT;
  14198. if (t === n.ClampToEdgeWrapping) return r.CLAMP_TO_EDGE;
  14199. if (t === n.MirroredRepeatWrapping) return r.MIRRORED_REPEAT;
  14200. if (t === n.NearestFilter) return r.NEAREST;
  14201. if (t === n.NearestMipMapNearestFilter) return r.NEAREST_MIPMAP_NEAREST;
  14202. if (t === n.NearestMipMapLinearFilter) return r.NEAREST_MIPMAP_LINEAR;
  14203. if (t === n.LinearFilter) return r.LINEAR;
  14204. if (t === n.LinearMipMapNearestFilter) return r.LINEAR_MIPMAP_NEAREST;
  14205. if (t === n.LinearMipMapLinearFilter) return r.LINEAR_MIPMAP_LINEAR;
  14206. if (t === n.UnsignedByteType) return r.UNSIGNED_BYTE;
  14207. if (t === n.UnsignedShort4444Type) return r.UNSIGNED_SHORT_4_4_4_4;
  14208. if (t === n.UnsignedShort5551Type) return r.UNSIGNED_SHORT_5_5_5_1;
  14209. if (t === n.UnsignedShort565Type) return r.UNSIGNED_SHORT_5_6_5;
  14210. if (t === n.ByteType) return r.BYTE;
  14211. if (t === n.ShortType) return r.SHORT;
  14212. if (t === n.UnsignedShortType) return r.UNSIGNED_SHORT;
  14213. if (t === n.IntType) return r.INT;
  14214. if (t === n.UnsignedIntType) return r.UNSIGNED_INT;
  14215. if (t === n.FloatType) return r.FLOAT;
  14216. if (null !== (e = i.get("OES_texture_half_float")) && t === n.HalfFloatType) return e.HALF_FLOAT_OES;
  14217. if (t === n.AlphaFormat) return r.ALPHA;
  14218. if (t === n.RGBFormat) return r.RGB;
  14219. if (t === n.RGBAFormat) return r.RGBA;
  14220. if (t === n.LuminanceFormat) return r.LUMINANCE;
  14221. if (t === n.LuminanceAlphaFormat) return r.LUMINANCE_ALPHA;
  14222. if (t === n.AddEquation) return r.FUNC_ADD;
  14223. if (t === n.SubtractEquation) return r.FUNC_SUBTRACT;
  14224. if (t === n.ReverseSubtractEquation) return r.FUNC_REVERSE_SUBTRACT;
  14225. if (t === n.ZeroFactor) return r.ZERO;
  14226. if (t === n.OneFactor) return r.ONE;
  14227. if (t === n.SrcColorFactor) return r.SRC_COLOR;
  14228. if (t === n.OneMinusSrcColorFactor) return r.ONE_MINUS_SRC_COLOR;
  14229. if (t === n.SrcAlphaFactor) return r.SRC_ALPHA;
  14230. if (t === n.OneMinusSrcAlphaFactor) return r.ONE_MINUS_SRC_ALPHA;
  14231. if (t === n.DstAlphaFactor) return r.DST_ALPHA;
  14232. if (t === n.OneMinusDstAlphaFactor) return r.ONE_MINUS_DST_ALPHA;
  14233. if (t === n.DstColorFactor) return r.DST_COLOR;
  14234. if (t === n.OneMinusDstColorFactor) return r.ONE_MINUS_DST_COLOR;
  14235. if (t === n.SrcAlphaSaturateFactor) return r.SRC_ALPHA_SATURATE;
  14236. if (null !== (e = i.get("WEBGL_compressed_texture_s3tc"))) {
  14237. if (t === n.RGB_S3TC_DXT1_Format) return e.COMPRESSED_RGB_S3TC_DXT1_EXT;
  14238. if (t === n.RGBA_S3TC_DXT1_Format) return e.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  14239. if (t === n.RGBA_S3TC_DXT3_Format) return e.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  14240. if (t === n.RGBA_S3TC_DXT5_Format) return e.COMPRESSED_RGBA_S3TC_DXT5_EXT
  14241. }
  14242. if (null !== (e = i.get("WEBGL_compressed_texture_pvrtc"))) {
  14243. if (t === n.RGB_PVRTC_4BPPV1_Format) return e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  14244. if (t === n.RGB_PVRTC_2BPPV1_Format) return e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  14245. if (t === n.RGBA_PVRTC_4BPPV1_Format) return e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  14246. if (t === n.RGBA_PVRTC_2BPPV1_Format) return e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  14247. }
  14248. if (null !== (e = i.get("WEBGL_compressed_texture_etc1")) && t === n.RGB_ETC1_Format) return e.COMPRESSED_RGB_ETC1_WEBGL;
  14249. if (null !== (e = i.get("EXT_blend_minmax"))) {
  14250. if (t === n.MinEquation) return e.MIN_EXT;
  14251. if (t === n.MaxEquation) return e.MAX_EXT
  14252. }
  14253. return 0
  14254. }, n.WebGLState = function(t, e, i) {
  14255. var r = this,
  14256. o = new n.Vector4,
  14257. a = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  14258. s = new Uint8Array(a),
  14259. l = new Uint8Array(a),
  14260. u = new Uint8Array(a),
  14261. h = {},
  14262. c = null,
  14263. d = null,
  14264. p = null,
  14265. f = null,
  14266. m = null,
  14267. g = null,
  14268. v = null,
  14269. y = null,
  14270. b = !1,
  14271. w = null,
  14272. x = null,
  14273. M = null,
  14274. T = null,
  14275. S = null,
  14276. _ = null,
  14277. A = null,
  14278. P = null,
  14279. C = null,
  14280. E = null,
  14281. D = null,
  14282. L = null,
  14283. O = null,
  14284. I = null,
  14285. R = null,
  14286. N = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  14287. k = void 0,
  14288. F = {},
  14289. B = new n.Vector4,
  14290. z = null,
  14291. U = null,
  14292. V = new n.Vector4,
  14293. j = new n.Vector4;
  14294. this.init = function() {
  14295. this.clearColor(0, 0, 0, 1), this.clearDepth(1), this.clearStencil(0), this.enable(t.DEPTH_TEST), t.depthFunc(t.LEQUAL), t.frontFace(t.CCW), t.cullFace(t.BACK), this.enable(t.CULL_FACE), this.enable(t.BLEND), t.blendEquation(t.FUNC_ADD), t.blendFunc(t.SRC_ALPHA, t.ONE_MINUS_SRC_ALPHA)
  14296. }, this.initAttributes = function() {
  14297. for (var t = 0, e = s.length; t < e; t++) s[t] = 0
  14298. }, this.enableAttribute = function(i) {
  14299. if (s[i] = 1, 0 === l[i] && (t.enableVertexAttribArray(i), l[i] = 1), 0 !== u[i]) {
  14300. e.get("ANGLE_instanced_arrays");
  14301. n.vertexAttribDivisorANGLE(i, 0), u[i] = 0
  14302. }
  14303. }, this.enableAttributeAndDivisor = function(e, i, r) {
  14304. s[e] = 1, 0 === l[e] && (t.enableVertexAttribArray(e), l[e] = 1), u[e] !== i && (n.vertexAttribDivisorANGLE(e, i), u[e] = i)
  14305. }, this.disableUnusedAttributes = function() {
  14306. for (var e = 0, i = l.length; e < i; e++) l[e] !== s[e] && (t.disableVertexAttribArray(e), l[e] = 0)
  14307. }, this.enable = function(e) {
  14308. !0 !== h[e] && (t.enable(e), h[e] = !0)
  14309. }, this.disable = function(e) {
  14310. !1 !== h[e] && (t.disable(e), h[e] = !1)
  14311. }, this.getCompressedTextureFormats = function() {
  14312. if (null === c && (c = [], e.get("WEBGL_compressed_texture_pvrtc") || e.get("WEBGL_compressed_texture_s3tc") || e.get("WEBGL_compressed_texture_etc1")))
  14313. for (var i = t.getParameter(t.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++) c.push(i[n]);
  14314. return c
  14315. }, this.setBlending = function(e, r, o, a, s, l, u, h) {
  14316. e === n.NoBlending ? this.disable(t.BLEND) : this.enable(t.BLEND), e === d && h === b || (e === n.AdditiveBlending ? h ? (t.blendEquationSeparate(t.FUNC_ADD, t.FUNC_ADD), t.blendFuncSeparate(t.ONE, t.ONE, t.ONE, t.ONE)) : (t.blendEquation(t.FUNC_ADD), t.blendFunc(t.SRC_ALPHA, t.ONE)) : e === n.SubtractiveBlending ? h ? (t.blendEquationSeparate(t.FUNC_ADD, t.FUNC_ADD), t.blendFuncSeparate(t.ZERO, t.ZERO, t.ONE_MINUS_SRC_COLOR, t.ONE_MINUS_SRC_ALPHA)) : (t.blendEquation(t.FUNC_ADD), t.blendFunc(t.ZERO, t.ONE_MINUS_SRC_COLOR)) : e === n.MultiplyBlending ? h ? (t.blendEquationSeparate(t.FUNC_ADD, t.FUNC_ADD), t.blendFuncSeparate(t.ZERO, t.ZERO, t.SRC_COLOR, t.SRC_ALPHA)) : (t.blendEquation(t.FUNC_ADD), t.blendFunc(t.ZERO, t.SRC_COLOR)) : h ? (t.blendEquationSeparate(t.FUNC_ADD, t.FUNC_ADD), t.blendFuncSeparate(t.ONE, t.ONE_MINUS_SRC_ALPHA, t.ONE, t.ONE_MINUS_SRC_ALPHA)) : (t.blendEquationSeparate(t.FUNC_ADD, t.FUNC_ADD), t.blendFuncSeparate(t.SRC_ALPHA, t.ONE_MINUS_SRC_ALPHA, t.ONE, t.ONE_MINUS_SRC_ALPHA)), d = e, b = h), e === n.CustomBlending ? (s = s || r, l = l || o, u = u || a, r === p && s === g || (t.blendEquationSeparate(i(r), i(s)), p = r, g = s), o === f && a === m && l === v && u === y || (t.blendFuncSeparate(i(o), i(a), i(l), i(u)), f = o, m = a, v = l, y = u)) : (p = null, f = null, m = null, g = null, v = null, y = null)
  14317. }, this.setDepthFunc = function(e) {
  14318. if (w !== e) {
  14319. if (e) switch (e) {
  14320. case n.NeverDepth:
  14321. t.depthFunc(t.NEVER);
  14322. break;
  14323. case n.AlwaysDepth:
  14324. t.depthFunc(t.ALWAYS);
  14325. break;
  14326. case n.LessDepth:
  14327. t.depthFunc(t.LESS);
  14328. break;
  14329. case n.LessEqualDepth:
  14330. t.depthFunc(t.LEQUAL);
  14331. break;
  14332. case n.EqualDepth:
  14333. t.depthFunc(t.EQUAL);
  14334. break;
  14335. case n.GreaterEqualDepth:
  14336. t.depthFunc(t.GEQUAL);
  14337. break;
  14338. case n.GreaterDepth:
  14339. t.depthFunc(t.GREATER);
  14340. break;
  14341. case n.NotEqualDepth:
  14342. t.depthFunc(t.NOTEQUAL);
  14343. break;
  14344. default:
  14345. t.depthFunc(t.LEQUAL)
  14346. } else t.depthFunc(t.LEQUAL);
  14347. w = e
  14348. }
  14349. }, this.setDepthTest = function(e) {
  14350. e ? this.enable(t.DEPTH_TEST) : this.disable(t.DEPTH_TEST)
  14351. }, this.setDepthWrite = function(e) {
  14352. x !== e && (t.depthMask(e), x = e)
  14353. }, this.setColorWrite = function(e) {
  14354. M !== e && (t.colorMask(e, e, e, e), M = e)
  14355. }, this.setStencilFunc = function(e, i, n) {
  14356. S === e && _ === i && A === n || (t.stencilFunc(e, i, n), S = e, _ = i, A = n)
  14357. }, this.setStencilOp = function(e, i, n) {
  14358. P === e && C === i && E === n || (t.stencilOp(e, i, n), P = e, C = i, E = n)
  14359. }, this.setStencilTest = function(e) {
  14360. e ? this.enable(t.STENCIL_TEST) : this.disable(t.STENCIL_TEST)
  14361. }, this.setStencilWrite = function(e) {
  14362. T !== e && (t.stencilMask(e), T = e)
  14363. }, this.setFlipSided = function(e) {
  14364. D !== e && (e ? t.frontFace(t.CW) : t.frontFace(t.CCW), D = e)
  14365. }, this.setLineWidth = function(e) {
  14366. e !== L && (t.lineWidth(e), L = e)
  14367. }, this.setPolygonOffset = function(e, i, n) {
  14368. e ? this.enable(t.POLYGON_OFFSET_FILL) : this.disable(t.POLYGON_OFFSET_FILL), !e || O === i && I === n || (t.polygonOffset(i, n), O = i, I = n)
  14369. }, this.getScissorTest = function() {
  14370. return R
  14371. }, this.setScissorTest = function(e) {
  14372. R = e, e ? this.enable(t.SCISSOR_TEST) : this.disable(t.SCISSOR_TEST)
  14373. }, this.activeTexture = function(e) {
  14374. void 0 === e && (e = t.TEXTURE0 + N - 1), k !== e && (t.activeTexture(e), k = e)
  14375. }, this.bindTexture = function(e, i) {
  14376. void 0 === k && r.activeTexture();
  14377. var o = F[k];
  14378. void 0 === o && (o = {
  14379. type: void 0,
  14380. texture: void 0
  14381. }, F[k] = o), n.type === e && n.texture === i || (t.bindTexture(e, i), n.type = e, n.texture = i)
  14382. }, this.compressedTexImage2D = function() {
  14383. try {
  14384. t.compressedTexImage2D.apply(t, arguments)
  14385. } catch (t) {}
  14386. }, this.texImage2D = function() {
  14387. try {
  14388. t.texImage2D.apply(t, arguments)
  14389. } catch (t) {}
  14390. }, this.clearColor = function(e, i, n, r) {
  14391. o.set(e, i, n, r), !1 === B.equals(o) && (t.clearColor(e, i, n, r), B.copy(o))
  14392. }, this.clearDepth = function(e) {
  14393. z !== e && (t.clearDepth(e), z = e)
  14394. }, this.clearStencil = function(e) {
  14395. U !== e && (t.clearStencil(e), U = e)
  14396. }, this.scissor = function(e) {
  14397. !1 === V.equals(e) && (t.scissor(e.x, e.y, e.z, e.w), V.copy(e))
  14398. }, this.viewport = function(e) {
  14399. !1 === j.equals(e) && (t.viewport(e.x, e.y, e.z, e.w), j.copy(e))
  14400. }, this.reset = function() {
  14401. for (var e = 0; e < l.length; e++) 1 === l[e] && (t.disableVertexAttribArray(e), l[e] = 0);
  14402. h = {}, c = null, k = void 0, F = {}, d = null, M = null, x = null, T = null, D = null
  14403. }
  14404. }
  14405. }, function(t, e) {
  14406. Array.prototype.findIndex || (Array.prototype.findIndex = function(t) {
  14407. if (null == this) throw new TypeError("Array.prototype.findIndex called on null or undefined");
  14408. if ("function" != typeof t) throw new TypeError("predicate must be a function");
  14409. for (var e, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  14410. if (e = i[o], t.call(r, e, o, i)) return o;
  14411. return -1
  14412. })
  14413. }, function(t, e, i) {
  14414. i(0)
  14415. .CopyShader = {}
  14416. }, function(t, e, i) {
  14417. i(0)
  14418. .HorizontalBlurShader = {}
  14419. }, function(t, e, i) {
  14420. i(0).VerticalBlurShader = {}
  14421. }, function(t, e, i) {
  14422. var n = i(0);
  14423. n.SMAAShader = []
  14424. }, function(t, e, i) {
  14425. var n = i(0);
  14426. n.EffectComposer = function(t, e) {}
  14427. }, function(t, e, i) {
  14428. var n = i(0);
  14429. n.RenderPass = function(t, e, i, r, o) {}
  14430. }, function(t, e, i) {
  14431. var n = i(0);
  14432. n.OutlinePass = function(t, e, i, r) {}
  14433. }, function(t, e, i) {
  14434. var n = i(0);
  14435. n.ShaderPass = function(t, e) {}
  14436. }, function(t, e, i) {
  14437. var n = i(0);
  14438. n.MaskPass = function(t, e) {}
  14439. }, function(t, e, i) {
  14440. var n = i(0);
  14441. n.SMAAPass = () => {}
  14442. }, function(t, e, i) {
  14443. var n, r, o = i(0);
  14444. o.LineSegmentsGeometry = function() {}
  14445. }, function(t, e, i) {
  14446. var n = i(0);
  14447. n.LineGeometry = function() {}
  14448. }, function(t, e, i) {
  14449. var n = i(0);
  14450. n.UniformsLib.line = {},
  14451. n.ShaderLib.line = {},
  14452. n.LineMaterial = function(t) {},
  14453. n.LineMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  14454. n.LineMaterial.prototype.constructor = n.LineMaterial,
  14455. n.LineMaterial.prototype.isLineMaterial = !0,
  14456. n.LineMaterial.prototype.copy = function(t) {
  14457. }
  14458. }, function(t, e, i) {
  14459. var n, r, o = i(0);
  14460. o.LineSegments2 = function(t, e) {}
  14461. }, function(t, e, i) {
  14462. var n = i(0);
  14463. n.Line2 = function(t, e) {}
  14464. }, function(t, e, i) {
  14465. "use strict";
  14466. (function(e) {
  14467. i(49);
  14468. var n = i(0),
  14469. r = i(2),
  14470. o = i(51),
  14471. a = i(103),
  14472. s = i(35),
  14473. l = i(52),
  14474. u = i(54),
  14475. h = i(19),
  14476. c = i(108),
  14477. d = i(58),
  14478. p = i(109),
  14479. f = i(5),
  14480. m = i(18),
  14481. g = i(32),
  14482. v = i(1),
  14483. y = i(7),
  14484. b = i(9),
  14485. w = i(10),
  14486. x = i(15),
  14487. M = i(8),
  14488. T = i(4)
  14489. .EventEmitter,
  14490. S = i(37),
  14491. _ = i(61),
  14492. A = i(62),
  14493. P = i(110),
  14494. C = i(63),
  14495. E = i(64),
  14496. D = i(20),
  14497. L = i(27),
  14498. O = i(21),
  14499. I = i(24),
  14500. R = i(31),
  14501. N = i(14),
  14502. k = i(23),
  14503. F = i(38),
  14504. B = i(112),
  14505. z = i(113),
  14506. U = i(26),
  14507. V = i(66),
  14508. j = i(3),
  14509. H = i(39),
  14510. W = i(114),
  14511. q = (i(13), new r("/js/player.js")),
  14512. Y = (window.devicePixelRatio, Object.freeze({
  14513. FlyToPano: M.getUniqueId(),
  14514. FlyToNewMode: M.getUniqueId(),
  14515. FlyToSameMode: M.getUniqueId(),
  14516. FlyToViewFloor: M.getUniqueId(),
  14517. LookTransition: M.getUniqueId(),
  14518. ZoomTransition: M.getUniqueId()
  14519. })),
  14520. X = i(22),
  14521. Z = i(16),
  14522. K = i(28),
  14523. Q = i(117),
  14524. J = i(118),
  14525. $ = i(133),
  14526. tt = i(134),
  14527. et = i(136),
  14528. it = i(137),
  14529. nt = i(69),
  14530. rt = i(139),
  14531. ot = i(141),
  14532. at = i(143),
  14533. st = i(67);
  14534. function lt(t) {
  14535. G.player = this, this.currentPano = null, this.currentPanoQuaternion = null, this.nextPano = null, this.camera = null, this.paused = !1, this.flying = !1, this.sceneIntersectionPlane = null, this.target = new n.Vector3, this.mouse = new n.Vector3(1.1, 1.1, .5), this.mouseAtMouseDown = new n.Vector2, this.mouseCouldBeClickToMove = !1, this.inMeasureMode = !1, this.mouseLastMoveTime = Date.now(), this.mouseDown = !1, this.mouseDownTimer = null, this.couldBeLongTap = !1, this.containsMouse = !0, this.isTouchEvent = !1, this.isPanoHover = !1, this.reticule = new o(this), this.addTagReticule = new a(this), this.panoMarkers = [], this.spider = new p(this), this.quaternion = new n.Quaternion, this.position = new n.Vector3(15, 10, 15), this.previousState = null, this.lastInsideView = new d, this.last360View = new d, this.raycaster = new n.Raycaster, this.raycasterP = new n.Raycaster, this.intersect = null, this.lastChangeTime = Date.now(), this.history = new P, this.control = null, this.controls = {}, this.cameras = {}, this.path = null, this.model = null, this.domElement = null, this.cachedPanoCandidates = null, this.basePanoSize = 0, this.standardPanoSize = 0, this.highPanoSize = 0, this.ultraHighPanoSize = 0, this.zoomLevel = 1, this.zooming = 0, this.zoomSpeed = .5, this.scrollZoomSpeed = .06, this.zoomSpeedAdjust = .05, this.defaultZoomIncrement = .2, this.speedmultiplier = 1, this.baseFov = v.insideFOV, this.zoomFov = this.baseFov, this.zoomEnabled = !0, this.preRenderingEnabled = !1, this.setupCustomProperties(t), this.urlPoint = "/pc/add_label.html?", this.urlPoint3 = "/nest/ifaddtag/?", this.urlHighlights = "/nest/ifaddscenes/?", this.normal_length = .1, this.zoomStats = new z, this.scene = null, this.clock = new n.Clock, this.walkOnPano = !1, this.measurementTool = null, this.measureTexture = null, this.connect = K(), this.handleOperation = this.handleOperation.bind(this), this.getCurrentState = this.getCurrentState.bind(this), this.connect.on("operation", this.handleOperation), this.disableNavigator = !1, this.lockedFlyToPano = !1, this.putModelTypes = {
  14536. human: !1,
  14537. weapon: !1,
  14538. camera: !1
  14539. }, this.isShowModelList = null, this.isLoadedSaveModel = !1, this.panoramaStartRotationFrom = !1
  14540. }
  14541. lt.prototype = Object.create(T.prototype), lt.prototype.init = function(t) {
  14542. this.modelManager = t.modelManager, this.tileDownloader = t.tileDownloader, this.panoRenderer = t.panoRenderer, this.sRender = this.panoRenderer.sceneRenderer, this.qualityManager = t.qualityManager, this.domElement = t.container, this.camera = t.camera, this.mattertagManager = t.mattertagManager, this.setUpControls(), this.path = new c(t.director, this), this.basePanoSize = this.qualityManager.getPanoSize(k.BASE), this.standardPanoSize = this.qualityManager.getPanoSize(k.STANDARD), this.highPanoSize = this.qualityManager.getPanoSize(k.HIGH), this.ultraHighPanoSize = this.qualityManager.getPanoSize(k.ULTRAHIGH), this.tileDownloader.processPriorityQueue = !1, this.tileDownloader.tilePrioritizer = new F(this.qualityManager, this.basePanoSize, this.standardPanoSize, this.highPanoSize, this.ultraHighPanoSize), this.aiding = new Q(this), this.humanModelControls = new tt(this), this.humanModelControls.canbeUsed = !0, this.weaponModelControls = new et(this), this.weaponModelControls.canbeUsed = !0, this.postilControls = new it(this), this.postilControls.canbeUsed = !0, this.virtualCameraFovControls = new rt(this), this.virtualCameraFovControls.canbeUsed = !0, this.humanModelAnimationControls = new ot(this), this.humanModelAnimationControls.canbeUsed = !0, this.measuringToolControls = new at(this), this.measuringToolControls.canbeUsed = !0, this.baseControls = new J(this), this.putModelUIControls = new $(this), this.sRender.addComponent(this.baseControls), this.bindEvents(t.container), this.updateModel()
  14543. }, lt.prototype.setupCustomProperties = function(t) {
  14544. var e = t || f.PANORAMA;
  14545. Object.defineProperty(this, "mode", {
  14546. get: function() {
  14547. return e
  14548. },
  14549. set: function(t) {
  14550. var i = e;
  14551. e = t, this.onModeUpdated(i, e), this.changeSteeringWheelState(e)
  14552. }
  14553. })
  14554. }, lt.prototype.isInMode = function() {
  14555. for (var t = 0; t < arguments.length; t++)
  14556. if (this.mode === arguments[t]) return !0;
  14557. return !1
  14558. }, lt.prototype.isOutsideMode = function(t) {
  14559. return (t = t || this.mode) === f.DOLLHOUSE || t === f.FLOORPLAN
  14560. }, lt.prototype.is360View = function(t, e) {
  14561. return t === f.PANORAMA && e && !e.isAligned()
  14562. }, lt.prototype.setScene = function(t) {
  14563. this.scene = t, this.sceneIntersectionPlane = t.plane, this.path.setScene(t), this.moveReticuleToScene(t)
  14564. }, lt.prototype.moveReticuleToScene = function(t) {}, lt.prototype.updateModel = function() {
  14565. function t(t) {
  14566. var e = this.cameras[f.DOLLHOUSE],
  14567. i = this.controls[f.DOLLHOUSE],
  14568. n = e.position.y + (t - i.target.y),
  14569. r = v.showFloorDuration + v.showFloorDelay;
  14570. M.start(w.property(i.target, "y", t), r, null, v.flydown.movementDelay, x[v.flydown.movementEasing], null, Y.FlyToViewFloor), M.start(w.property(e.position, "y", n), r, null, v.flydown.movementDelay, x[v.flydown.movementEasing], null, Y.FlyToViewFloor)
  14571. }
  14572. this.model = this.modelManager.getActiveModel(), this.model.on("floor.changed", function(e, i, n) {
  14573. this.mode === f.DOLLHOUSE && e !== n && t.call(this, e.center.y)
  14574. }.bind(this)), this.model.on("allfloors.toggled", function(e, i) {
  14575. if (this.mode === f.DOLLHOUSE) {
  14576. var n = e ? this.model.center.y : lt = i.center.y;
  14577. t.call(this, n)
  14578. }
  14579. }.bind(this)), this.on(D.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  14580. var e = this;
  14581. this.model.panos.list.forEach((function(t) {
  14582. t.vrMarker.addEventListener("click", (function() {
  14583. e.flyToPano({
  14584. pano: t
  14585. })
  14586. }))
  14587. }))
  14588. }, lt.prototype.updateModelDependentData = function() {
  14589. this.setModelForControls(this.model), this.getPanoMarkersFromModel(this.model)
  14590. }, lt.prototype.onModelChanged = function() {
  14591. this.updateModel(), this.updateModelDependentData()
  14592. }, lt.prototype.getPanoMarkersFromModel = function(t) {
  14593. this.panoMarkers = t.panos.list.reduce((function(t, e) {
  14594. return e.marker ? t.concat(e.marker) : t
  14595. }), [])
  14596. }, lt.prototype.setModelForControls = function(t) {
  14597. this.controls[f.DOLLHOUSE].setZoomBounds(t.boundingBox);
  14598. var e = this.model.boundingBox.clone()
  14599. .expandByScalar(v.modelBoundsPadding);
  14600. [f.DOLLHOUSE, f.FLOORPLAN].forEach(function(t) {
  14601. this.controls[t].setBounds(e)
  14602. }.bind(this))
  14603. }, lt.prototype.updateControlsForNewMode = function(t, e) {
  14604. this.controls[t] && (this.controls[t].reset(), this.controls[t].enabled = !1), this.controls[e] && (this.controls[e].enabled = !0), this.control = this.controls[e]
  14605. }, lt.prototype.getCurrentState = function() {
  14606. var t = this.mode,
  14607. e = {
  14608. mode: t,
  14609. location: this.currentPano.id
  14610. };
  14611. return "panorama" === t ? (e.position = {
  14612. x: this.camera.position.x,
  14613. y: this.camera.position.y,
  14614. z: this.camera.position.z
  14615. }, e.rotation = {
  14616. x: this.camera.quaternion.x,
  14617. y: this.camera.quaternion.y,
  14618. z: this.camera.quaternion.z,
  14619. w: this.camera.quaternion.w
  14620. }) : "floorplan" === t ? (e.position = {
  14621. x: this.camera.position.x,
  14622. y: this.camera.position.y,
  14623. z: this.camera.position.z
  14624. }, e.rotation = {
  14625. x: this.camera.quaternion.x,
  14626. y: this.camera.quaternion.y,
  14627. z: this.camera.quaternion.z,
  14628. w: this.camera.quaternion.w
  14629. }, e.zoom = 3) : "dollhouse" === t && (e.position = {
  14630. x: this.camera.position.x,
  14631. y: this.camera.position.y,
  14632. z: this.camera.position.z
  14633. }, e.rotation = {
  14634. x: this.camera.quaternion.x,
  14635. y: this.camera.quaternion.y,
  14636. z: this.camera.quaternion.z,
  14637. w: this.camera.quaternion.w
  14638. }), e
  14639. }, lt.prototype.setUpControls = function() {
  14640. var t = {};
  14641. t[f.PANORAMA] = new S, t[f.DOLLHOUSE] = new _, t[f.FLOORPLAN] = new A;
  14642. var e = {};
  14643. e[f.PANORAMA] = new s(t[f.PANORAMA]), e[f.DOLLHOUSE] = new l(t[f.DOLLHOUSE]), e[f.FLOORPLAN] = new u(t[f.FLOORPLAN]);
  14644. var i = this.handleControlMove.bind(this),
  14645. n = this.handleControlInputStart.bind(this);
  14646. e[f.PANORAMA].on(L.Move, i), e[f.PANORAMA].on(L.Pinch, this.handleControlPinch.bind(this)), e[f.PANORAMA].on(L.Scroll, this.handleControlScroll.bind(this)), e[f.PANORAMA].on(L.RulersMove, this.handleControlRulersMove.bind(this)), e[f.PANORAMA].on(L.TtagsMove, this.handleControlTtagsMove.bind(this)), e[f.PANORAMA].on(L.InputStart, n), e[f.PANORAMA].on(L.PanoramaMove, this.handleControlPanoramaMove.bind(this)), e[f.PANORAMA].on(L.PanoramaMoveStop, this.handleControlPanoramaMoveStop.bind(this)), e[f.DOLLHOUSE].on(L.Move, i), e[f.DOLLHOUSE].on(L.InputStart, n), e[f.DOLLHOUSE].on("dollhouse-move", this.handleDollhouseMove.bind(this)), e[f.DOLLHOUSE].on("dollhouse-move-stop", this.handleDollhouseMoveStop.bind(this)), e[f.FLOORPLAN].on(L.Move, i), e[f.FLOORPLAN].on(L.InputStart, n), this.controls = e, this.cameras = t
  14647. };
  14648. var ut, ht, ct = !1,
  14649. dt = !0;
  14650. lt.prototype.handleControlPanoramaMove = function() {
  14651. !1 !== dt && (ct = !1, this.baseControls && this.baseControls.onHandleControlPanoramaMove())
  14652. }, lt.prototype.handleControlPanoramaMoveStop = function() {
  14653. !0 !== ct && (dt = !1, ct = !0, this.baseControls && this.baseControls.onHandleControlPanoramaMoveStop(), setTimeout((function() {
  14654. dt = !0
  14655. }), 0))
  14656. }, lt.prototype.handleDollhouseMove = function() {
  14657. this.baseControls && this.baseControls.onHandleDollhouseMove()
  14658. }, lt.prototype.handleDollhouseMoveStop = function() {
  14659. this.baseControls && this.baseControls.onHandleDollhouseMoveStop()
  14660. }, lt.prototype.handleControlRulersMove = function() {
  14661. this.emit(D.RulersMove)
  14662. }, lt.prototype.handleControlTtagsMove = function() {
  14663. this.mattertagManager.ttposition(), !1 !== dt && this.baseControls && this.baseControls.onHandleControlTtagsMove()
  14664. }, lt.prototype.handleControlMove = function(t) {
  14665. this.emit(D.Move, t), "panorama" === this.mode && this.baseControls && this.baseControls.onPlayerHandleControlPanoramaMove()
  14666. }, lt.prototype.handleControlInputStart = function(t) {
  14667. this.emit(D.InputStart, t)
  14668. }, lt.prototype.onModeUpdated = function(t, e) {
  14669. this.updateControlsForNewMode(t, e), this.emit(D.ModeChanged, t, e)
  14670. }, lt.prototype.isWarping = function() {
  14671. return this.path.warping
  14672. }, lt.prototype.getLabelScaleFactor = function() {
  14673. if (this.isOutsideMode()) {
  14674. return Math.sqrt(this.controls[f.FLOORPLAN].currentScale / 10)
  14675. }
  14676. return .5
  14677. }, lt.prototype.bindEvents = function(t) {
  14678. for (var e in t !== document && t.setAttribute("tabindex", -1), this.controls[f.PANORAMA].on(L.FlyInDirection, this.flyLocalDirection.bind(this)), t.addEventListener("mousedown", this.onMouseDown.bind(this), !1), t.addEventListener("mousemove", this.onMouseMove.bind(this), !1), t.addEventListener("mouseover", this.onMouseOver.bind(this)), t.addEventListener("mouseout", this.onMouseOut.bind(this)), t.addEventListener("mouseup", this.onMouseUp.bind(this), !1), t.addEventListener("mouseleave", this.onMouseLeave.bind(this)), this.modelManager.on(O.ActiveModelChanged, this.onModelChanged.bind(this)), t.addEventListener("touchstart", this.onTouchStart.bind(this)), t.addEventListener("touchmove", this.onTouchMove.bind(this)), t.addEventListener("touchend", this.onTouchEnd.bind(this)), t.addEventListener("pointerdown", this.onPointerDown.bind(this)), t.addEventListener("pointermove", this.onPointerMove.bind(this)), t.addEventListener("pointerup", this.onPointerUp.bind(this)), t.addEventListener("pointerout", this.onPointerOut.bind(this)), t.addEventListener("pointercancel", this.onPointerCancel.bind(this)), t.addEventListener("keyup", this.onKeyUpOfPlayerContainer.bind(this)), document.addEventListener("keydown", this.onKeyDown.bind(this)), document.addEventListener("keyup", this.onKeyUp.bind(this)), this.controls) this.controls[e].bindEvents(t);
  14679. this.on(D.WarpEnded, this.updateWarpEnded.bind(this))
  14680. }, lt.prototype.updateWarpEnded = function() {
  14681. this.mattertagManager.updateRegionalJumpTags(this.currentPano), this.steeringWheelPos(this.currentPano, null, 50)
  14682. }, lt.prototype.onMouseDown = function(t) {
  14683. var i = this;
  14684. if (this.disableNavigator = !1, this.lockedFlyToPano = !1, this.baseControls && this.baseControls.onPlayerMouseDown(t), this.measuringToolControls.canbeUsed && this.measuringToolControls.onPlayerMouseDown(t), this.measurementTool.onMouseDown(t), !this.disableNavigator && (!this.humanModelControls.HUMANMODEL || this.humanModelControls.HUMANMODEL.userData.follow_mouse) && (!this.weaponModelControls.CONTROLMODEL || this.weaponModelControls.CONTROLMODEL.userData.follow_mouse) && (!this.virtualCameraFovControls.VIRTUAL_CAMERA || this.virtualCameraFovControls.VIRTUAL_CAMERA.userData.follow_mouse)) {
  14685. if (this.mattertagManager.intersectTag && (this.mattertagManager.intersectTag.type === H.Tag360T1 || 1 === this.mattertagManager.intersectTag.subtype)) return t.preventDefault(), t.stopImmediatePropagation(), t.currentTarget !== document && t.currentTarget.focus(), void(0 === t.button && (this.handleInputStart.call(this, t.clientX, t.clientY, !1), this.updateIntersect()));
  14686. if (this.mattertagManager.intersectTag && this.mattertagManager.intersectTag.type == H.Pano) {
  14687. var n = this.mattertagManager.intersectTag,
  14688. r = function() {
  14689. i.model.panos.index[n.locationId].marker.material.map = Z.loadurl(X.splitUrl("./images/texture/location/location_512x512.png")), n.materials.free.map = Z.loadurl(X.splitUrl("./images/disable_on_256x256.png")), n.materials.hover.map = Z.loadurl(X.splitUrl("./images/disable_on_256x256.png")), n.disc.material.map = Z.loadurl(X.splitUrl("./images/disable_on_256x256.png")), i.model.panos.index[n.locationId].enable = !0
  14690. },
  14691. o = function() {
  14692. i.model.panos.index[n.locationId].marker.material.map = Z.loadurl(X.splitUrl("./images/texture/location/disable_512x512.png")), n.materials.free.map = Z.loadurl(X.splitUrl("./images/disable_off_256x256.png")), n.materials.hover.map = Z.loadurl(X.splitUrl("./images/disable_off_256x256.png")), n.disc.material.map = Z.loadurl(X.splitUrl("./images/disable_off_256x256.png")), i.model.panos.index[n.locationId].enable = !1
  14693. };
  14694. if (this.model.panos.index[n.locationId].enable) {
  14695. ! function(t) {
  14696. if (G.settings.nestscenes && G.settings.nestscenes.scenes && G.settings.nestscenes.scenes.length) {
  14697. for (var e = G.settings.nestscenes.scenes, n = 0; n < e.length; n++)
  14698. if (e[n]._camera._locationid === t) return !1
  14699. } else {
  14700. var r = i.model.data.orientationkey;
  14701. if (r) {
  14702. var o = !1;
  14703. if (model.data.orientations.forEach((function(e, i) {
  14704. e.key === r && e.location_id === t && (o = !0)
  14705. })), o) return !1
  14706. }
  14707. var a = i.model.panos;
  14708. for (n = 0; n < a.length; n++)
  14709. if (2 != a.list[n].alignmentType) return a.list[n].id !== t
  14710. }
  14711. return !0
  14712. }(n.locationId) ? G.toast("已设置为场景点或初始点,不能隐藏"): "sms" === G.u[window.location.host].type ? G.conf.isNewEditVersion ? e.ajax({
  14713. url: "/model/roam/hiddenpoint/",
  14714. type: "POST",
  14715. data: {
  14716. point: n.locationId,
  14717. enable: 0
  14718. }
  14719. })
  14720. .success((function(t) {
  14721. o()
  14722. }))
  14723. .fail((function(t) {
  14724. alert("连接服务器失败")
  14725. })) : e.ajax({
  14726. url: "/nest/hiddenpoint/",
  14727. type: "POST",
  14728. data: {
  14729. point: n.locationId,
  14730. enable: 0
  14731. }
  14732. })
  14733. .success((function(t) {
  14734. o()
  14735. }))
  14736. .fail((function(t) {
  14737. alert("连接服务器失败")
  14738. })) : o()
  14739. } else "sms" === G.u[window.location.host].type ? G.conf.isNewEditVersion ? e.ajax({
  14740. url: "/model/roam/hiddenpoint/",
  14741. type: "POST",
  14742. data: {
  14743. point: n.locationId,
  14744. enable: 1
  14745. }
  14746. })
  14747. .success((function(t) {
  14748. r()
  14749. }))
  14750. .fail((function(t) {
  14751. alert("连接服务器失败")
  14752. })) : e.ajax({
  14753. url: "/nest/hiddenpoint/",
  14754. type: "POST",
  14755. data: {
  14756. point: n.locationId,
  14757. enable: 1
  14758. }
  14759. })
  14760. .success((function(t) {
  14761. r()
  14762. }))
  14763. .fail((function(t) {
  14764. alert("连接服务器失败")
  14765. })) : r()
  14766. }
  14767. t.currentTarget !== document && t.currentTarget.focus(), 0 === t.button && (this.handleInputStart.call(this, t.clientX, t.clientY, !1), this.updateIntersect())
  14768. }
  14769. }, lt.prototype.onMouseLeave = function(t) {}, lt.prototype.onMouseMove = function(t) {
  14770. if (this.baseControls && this.baseControls.onPlayerMouseMove(t), (G.conf.modelMeasure || G.conf.publicity || G.measureMode) && this.measuringToolControls.canbeUsed && this.measuringToolControls.onPlayerMouseMove(t), this.isTouchEvent = !1, this.handleInputMove.call(this, t.clientX, t.clientY, !1), this.inMeasureMode) {
  14771. var e = b.convertWorldPositionToScreen(this.intersect.point, this.camera),
  14772. i = new n.Vector2(e.x, (window.renderHeight || window.innerHeight) - e.y);
  14773. i && (this.measurementTool.onMouseMove(t), this.measureTexture.onMouseMove(t, this.model, i))
  14774. } else this.model.chunks.forEach((function(t) {
  14775. t.material.uniforms.measureMode && (t.material.uniforms.measureMode.value = 0)
  14776. }))
  14777. }, lt.prototype.onMouseOver = function(t) {
  14778. this.containsMouse = !0, !this.mouseDown || 0 !== t.which && 0 !== t.buttons || (this.mouseDown = !1)
  14779. }, lt.prototype.onMouseOut = function(t) {
  14780. this.containsMouse = !1
  14781. }, lt.prototype.onMouseUp = function(t) {
  14782. this.baseControls && this.baseControls.onPlayerMouseUp(t), this.inMeasureMode && (this.measuringToolControls.canbeUsed && this.measuringToolControls.onPlayerMouseUp(t), this.measurementTool.onMouseUp(t)), this.handleInputEnd.call(this, t.clientX, t.clientY, !1, t)
  14783. }, lt.prototype.monitorSelect = function(t, e) {
  14784. var i = new Object;
  14785. if (i.type = this.currentPano.alignmentType, 2 != this.currentPano.alignmentType) {
  14786. if (!t) return;
  14787. (g = {})
  14788. .point = t.point.clone(), g.normal = t.normal.clone();
  14789. var r = g.point.x,
  14790. o = g.point.y,
  14791. a = g.point.z,
  14792. s = g.normal.x,
  14793. l = g.normal.y,
  14794. u = g.normal.z;
  14795. this.spot = new n.Vector3(r, o, a), this.spot.add(g.normal.clone()
  14796. .multiplyScalar(this.normal_length));
  14797. var h = this.spot.x - r,
  14798. c = this.spot.y - o,
  14799. d = this.spot.z - a,
  14800. p = this.currentPano.id,
  14801. f = this.camera.quaternion;
  14802. i.locationid = p, i.x = r, i.y = o, i.z = a, i.nx = s, i.ny = l, i.nz = u, i.dx = h, i.dy = c, i.dz = d, i.qw = f.y, i.qx = f.z, i.qy = f.w, i.qz = f.x
  14803. } else {
  14804. var m = this.getMouseDirection(),
  14805. g = Math.sqrt(4 / (m.x * m.x + m.y * m.y + m.z * m.z));
  14806. m.multiplyScalar(g), i.x = m.x, i.y = m.y, i.z = m.z, i.panoid = this.currentPano.id
  14807. }
  14808. this.emit(D.EditAddTagHighlight, i)
  14809. }, lt.prototype.onTouchStart = function(t) {
  14810. if (t.currentTarget !== document && t.currentTarget.focus(), !this.mouseDown) {
  14811. var e = y.average(t.changedTouches, "clientX"),
  14812. i = y.average(t.changedTouches, "clientY");
  14813. this.handleInputStart.call(this, e, i, !0)
  14814. }
  14815. }, lt.prototype.onTouchMove = function(t) {
  14816. var e = y.average(t.changedTouches, "clientX"),
  14817. i = y.average(t.changedTouches, "clientY");
  14818. this.handleInputMove.call(this, e, i, !0)
  14819. }, lt.prototype.onTouchEnd = function(t) {
  14820. this.updateIntersect(!0);
  14821. var e = y.average(t.changedTouches, "clientX"),
  14822. i = y.average(t.changedTouches, "clientY");
  14823. this.handleInputEnd.call(this, e, i, !0, t)
  14824. }, lt.prototype.onPointerDown = function(t) {}, lt.prototype.onPointerMove = function(t) {}, lt.prototype.onPointerUp = function(t) {}, lt.prototype.onPointerOut = function(t) {}, lt.prototype.onPointerCancel = function(t) {}, lt.prototype.onKeyUpOfPlayerContainer = function(t) {
  14825. this.baseControls && this.baseControls.onPlayerKeyUpPlayerContainer(t)
  14826. }, lt.prototype.onKeyUp = function(t) {
  14827. this.baseControls && this.baseControls.onPlayerKeyUp(t)
  14828. }, lt.prototype.onKeyDown = function(t) {
  14829. if (this.mode !== f.FLOORPLAN) {
  14830. var e = function() {
  14831. this.control && this.control.emit(L.Move, "key")
  14832. }.bind(this),
  14833. i = t.which;
  14834. switch (i) {
  14835. case g.F:
  14836. e(), this.changeFloor(-1);
  14837. break;
  14838. case g.R:
  14839. e(), this.changeFloor(1);
  14840. case g.ESC:
  14841. e(), G.measureMode && (this.setMeasureEnable(!1), this.emit("exitMeasureActive"), this.measurementTool && this.measurementTool.singleMeasuring, window.parent.cancelMeasure && window.parent.cancelMeasure())
  14842. }
  14843. }
  14844. }, lt.prototype.handleScrollPinchZoom = function(t) {
  14845. var e = t,
  14846. i = this.zoomLevel;
  14847. this.zoomBy(e), this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  14848. }, lt.prototype.handleControlPinch = function(t) {
  14849. v.zoom.enabled ? this.handleScrollPinchZoom(1 - t) : this.flyLocalDirection(new n.Vector3(0, 0, t)
  14850. .normalize())
  14851. }, lt.prototype.handleControlScroll = function(t) {
  14852. v.zoom.enabled ? (t > 0 ? t = 1 + this.scrollZoomSpeed : t < 0 && (t = 1 - this.scrollZoomSpeed), 0 !== t && this.handleScrollPinchZoom(t)) : this.flyLocalDirection(new n.Vector3(0, 0, -t)
  14853. .normalize())
  14854. }, lt.prototype.handleInputStart = function(t, e, i) {
  14855. this.isTouchEvent = i, b.convertScreenPositionToNDC(t, e, this.mouse), b.convertScreenPositionToNDC(t, e, this.mouseAtMouseDown), this.mouseCouldBeClickToMove = !0, this.mouseDown = !0
  14856. }, lt.prototype.handleInputMove = function(t, e, i) {
  14857. this.isTouchEvent = i, b.convertScreenPositionToNDC(t, e, this.mouse), !this.inMeasureMode && this.mouseAtMouseDown.distanceTo(this.mouse) > .02 && (this.mouseCouldBeClickToMove = !1), this.mouseLastMoveTime = Date.now(), this.reticule.move(t, e, i)
  14858. }, lt.prototype.handleInputEnd = function(t, e, i, n) {
  14859. if (this.isTouchEvent = i, this.mouseDown = !1, this.inMeasureMode) this.control && this.control.emit(L.Move, this.isTouchEvent ? "touch" : "mouse"), this.history.invalidate();
  14860. else if (this.controls[f.PANORAMA].emit("interaction.direct"), this.mouseCouldBeClickToMove) {
  14861. if (this.checkMattertagClick(n)) return this.control && (this.control.enabled = !0, this.control.onMouseUp(n)), !0;
  14862. if (this.control && this.control.emit(L.Move, this.isTouchEvent ? "touch" : "mouse"), this.history.invalidate(), this.intersect) return this.flyToPanoClosestToMouse();
  14863. if (this.mode === f.PANORAMA) {
  14864. var r = this.closestPanoInDirection(this.getMouseDirection());
  14865. return r ? this.flyToPano({
  14866. pano: r
  14867. }) : this.bump(this.getMouseDirection())
  14868. }
  14869. }
  14870. }, lt.prototype.checkMattertagClick = function(t) {
  14871. if (this.mattertagManager.intersectTag) {
  14872. var e = this.isTouchEvent,
  14873. i = this.mattertagManager.clickedOnTag(e, this, t);
  14874. return this.mattertagManager.intersectTag.tagid && this.emit(D.ClickTag, this.mattertagManager.intersectTag.tagid), e || i || M.cancelById(Y.LookTransition), !0
  14875. }
  14876. if (this.mattertagManager.activeTag) return !1
  14877. }, lt.prototype.rankedMattertagInDirection = function(t, e) {
  14878. return this.mattertagManager.rankedMattertagInDirection(t, this.position, this.camera, e)
  14879. }, lt.prototype.start = function(t) {
  14880. var i = t.mode,
  14881. r = t.pano,
  14882. o = t.position,
  14883. a = t.quaternion,
  14884. s = t.tag,
  14885. l = t.quickstart,
  14886. u = e.Deferred(),
  14887. h = new n.Quaternion;
  14888. h.setFromAxisAngle(new n.Vector3(0, -1, 0), Math.PI / 4), G.p = {
  14889. position: new n.Vector3(1, 1, 1),
  14890. quaternion: h
  14891. }, this.updateModelDependentData(), this.updateFromControls(), this.model.has360Views && this.findDefaultViews();
  14892. var c = this.is360View(i, r);
  14893. return !this.model.outsideAllowed() || c || l ? this.startInside(r, o, a, s, u) : this.startOutside(t, u), u.done(function(t) {
  14894. this.emit(D.Ready, c, t, s)
  14895. }.bind(this)), u.promise()
  14896. }, lt.prototype.startOutside = function(t, e) {
  14897. var i = t.mode,
  14898. n = t.pano,
  14899. r = t.position,
  14900. o = t.quaternion,
  14901. a = t.zoom,
  14902. s = t.floorVisibility,
  14903. l = t.tag;
  14904. this.emit(D.StartOutside, v[i].transitionTime), this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0), M.cancelById(Y.FlyToViewFloor), i === f.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o), e.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, e)
  14905. }, lt.prototype.startInside = function(t, i, n, r, o) {
  14906. o = o || e.Deferred(), this.currentPano = t;
  14907. var a = t && !t.isAligned();
  14908. if (i = a ? t.position : i || t.position, n = n || t.quaternion, t) {
  14909. a && this.mattertagManager.update360Tags(t.id);
  14910. var s = this.startInside.bind(this, t, i, n, r, o);
  14911. if (this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, s)) return
  14912. }
  14913. return this.mode = f.PANORAMA, t.floor.enter(this.mode), this.emit(D.PanoChosen, this.currentPano, this.currentPano), this.switchCameraMode(this.mode, n), this.emit(D.StartInside, a), o.resolve(!0), o
  14914. }, lt.prototype.startInsideWithFlyin = function(t, i, n, r, o) {
  14915. if (o = o || e.Deferred(), this.dollhouseMode(), !t) return q.warn("Player.startInsideWithFlyin() -> targetPano is invalid."), o.resolve(!1), o;
  14916. i = i || t.position;
  14917. var a = n || t.quaternionAutoScene || this.control.camera.quaternion;
  14918. t.position;
  14919. return setTimeout(function(e) {
  14920. this.control && (this.control.maxDistance = e);
  14921. var i = {
  14922. mode: f.PANORAMA,
  14923. pano: t,
  14924. quaternion: a,
  14925. callback: function() {
  14926. o.resolve(!0)
  14927. }.bind(this)
  14928. };
  14929. this.model.data.player_options.show3d && this.model.startup_type === V.STAY3D && "" == j.valueFromHash("o", "") && "" == j.valueFromHash("l", "") ? o.resolve(!0) : this.flyToNewMode(i)
  14930. }.bind(this, this.control.maxDistance), v.startupFlyinDelay), o
  14931. }, lt.prototype.checkAndWaitForPanoLoad = function(t, e, i, n, r, o, a, s, l, u) {
  14932. return null != s || (s = !0), this.model.supportsTiles ? this.checkAndWaitForTiledPanoLoad(t, n, r, o, a, s, l, u) : this.checkAndWaitForWholePanoLoad(t, e, i, r, s)
  14933. }, lt.prototype.checkAndWaitForWholePanoLoad = function(t, e, i, n, r) {
  14934. if (!t) throw new N("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  14935. return r && this.model.waitForLoad(t, (function() {
  14936. return t.isLoaded(i)
  14937. })), !t.isLoaded(e) && (t.loadCube(e)
  14938. .done(n), !0)
  14939. }, lt.prototype.checkAndWaitForTiledPanoLoad = (ut = new n.Vector3, ht = [], function(t, e, i, n, r, o, a, s) {
  14940. if (!t) throw new N("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  14941. if (ut.copy(m.FORWARD), this.getDirection(ut), t.isLoaded(e)) return !1;
  14942. var l = e + ":" + t.id;
  14943. return ht[l] || (ht[l] = !0, o && this.model.waitForLoad(t, (function() {
  14944. return t.isLoaded(e)
  14945. })), t.loadTiledPano(e, ut, null, a, s)
  14946. .done(function(t, e) {
  14947. ht[l] = !1, i && i(t, e)
  14948. }.bind(this))
  14949. .fail(function(t) {
  14950. ht[l] = !1, n && n(t)
  14951. }.bind(this))
  14952. .progress(function(t, e, i) {
  14953. r && r(t, e, i)
  14954. }.bind(this))), !0
  14955. }), lt.prototype.resetDC = function() {
  14956. var t = G.p.position.clone(),
  14957. e = this.model.boundingBox.min.distanceTo(this.model.boundingBox.max);
  14958. t.add(new n.Vector3(.5 * e, .7 * e, .5 * e))
  14959. .add(this.getDirection(null, !0)
  14960. .multiplyScalar(-6)), this.controls.dollhouse.lookAt(t, new n.Vector3(0, 0, 0), G.p.quaternion)
  14961. }, lt.prototype.switchCameraMode = function(t, e) {
  14962. var i = this.controls[t],
  14963. n = i.camera;
  14964. switch (t) {
  14965. case f.PANORAMA:
  14966. n.position.copy(this.currentPano.position);
  14967. var r = e ? m.FORWARD.clone()
  14968. .applyQuaternion(e) : this.getDirection()
  14969. .setY(0)
  14970. .normalize();
  14971. i.lookAt(r.add(n.position));
  14972. break;
  14973. case f.DOLLHOUSE:
  14974. this.resetDC();
  14975. break;
  14976. case f.FLOORPLAN:
  14977. n.position.copy(this.model.center)
  14978. .setY(10), i.target.copy(this.model.center)
  14979. .setY(0), i.zoomToContain(this.model.size), i.rotateToView(this.model.size, this.getDirection())
  14980. }
  14981. i.update(0)
  14982. }, lt.prototype.update = function() {
  14983. var t = {},
  14984. e = [];
  14985. return function(i) {
  14986. this.updatePersistentZooming(i), this.updateFromControls(i), this.getCurrentNodePanos(e), this.hasChanged(t) && (this.lastChangeTime = Date.now(), !this.mouseDown && this.containsMouse && this.updateIntersect(), this.model.supportsTiles && this.updateTileDownloader(e), this.emit(D.ViewChanged)), this.model.supportsTiles && (this.updateTileDownloader(t), this.updatePanoRenderer(t), this.updateZoomPano()), this.updatePreRendering(e), this.reticule.update(), this.path.update(), this.spider.update(), this.cachedPanoCandidates && v.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates), this.updateControlLocks(), this.updateMeasureTexture()
  14987. }
  14988. }(), lt.prototype.updatePersistentZooming = function(t) {
  14989. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * t) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * t)
  14990. }, lt.prototype.updateControlLocks = function() {
  14991. this.currentPano && this.model.supportsTiles && (this.controls[f.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  14992. }, lt.prototype.updatePanoRenderer = function() {
  14993. var t = new n.Vector3;
  14994. return function(e) {
  14995. (this.nextPano || this.currentPano) && (t.copy(m.FORWARD), this.getDirection(t), this.panoRenderer.updateDirection(t))
  14996. }
  14997. }(), lt.prototype.cleanupInactivePanos = function() {
  14998. var t = [],
  14999. e = [];
  15000. return function() {
  15001. t.length = 0, t.push(this.currentPano), this.nextPano && t.push(this.nextPano), e.length = 0;
  15002. for (var i = 0; i < this.panoRenderer.activePanos.length; i++) e.push(this.panoRenderer.activePanos[i]);
  15003. for (var n = 0; n < e.length; n++) {
  15004. for (var r = e[n], o = !0, a = 0; a < t.length; a++) r.id === t[a].id && (o = !1);
  15005. o && r.exit()
  15006. }
  15007. }
  15008. }(), lt.prototype.updatePreRendering = function() {
  15009. var t = {};
  15010. return function(e) {
  15011. if (1 === v.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  15012. var i = this.nextPano || this.currentPano;
  15013. if (i && e && e.length > 1) {
  15014. var n = e.findIndex((function(t) {
  15015. if (t.id === i.id) return !0
  15016. }));
  15017. if (n >= 0 && n + 1 < e.length) {
  15018. var r = e[n + 1];
  15019. r.isLoaded(this.basePanoSize) || t[r.id] || (window.setTimeout(function(e) {
  15020. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1), window.setTimeout(function(e) {
  15021. t[e.id] = !1
  15022. }.bind(this, e), v.tiling.panoPreRenderRepeatDelay)
  15023. }.bind(this, r), v.tiling.panoPreRenderDelay), t[r.id] = !0)
  15024. }
  15025. }
  15026. }
  15027. }
  15028. }(), lt.prototype.enablePreRendering = function() {
  15029. this.preRenderingEnabled = !0
  15030. }, lt.prototype.disablePreRendering = function() {
  15031. this.preRenderingEnabled = !1, this.cleanupInactivePanos()
  15032. }, lt.prototype.updateTileDownloader = function() {
  15033. var t = new n.Vector3;
  15034. return function(e) {
  15035. var i = this.nextPano || this.currentPano;
  15036. i && (t.copy(m.FORWARD), this.getDirection(t), this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, t, e.length > 0 ? e : null), this.tileDownloader.tilePrioritizer.zoomingActivated = this.zoomLevel > 1, this.tileDownloader.processPriorityQueue = !0)
  15037. }
  15038. }(), lt.prototype.updateFromControls = function(t) {
  15039. null != t || (t = 0), this.control && (this.control.update(t), this.quaternion.copy(this.control.camera.quaternion), this.position.copy(this.control.camera.position), this.target.copy(this.control.target), this.control.camera.updateProjectionMatrix(), this.camera.projectionMatrix.copy(this.control.camera.projectionMatrix)), this.camera.position.copy(this.position), this.camera.quaternion.copy(this.quaternion), this.camera.updateMatrix(), this.camera.updateMatrixWorld()
  15040. }, lt.prototype.hasChanged = function(t) {
  15041. if (!this.previousState) return this.previousState = {
  15042. allFloorsVisible: this.model.allFloorsVisible,
  15043. position: this.position.clone(),
  15044. quaternion: this.quaternion.clone(),
  15045. mouse: this.mouse.clone(),
  15046. zoom: this.getLabelScaleFactor(),
  15047. currentFloor: this.model.currentFloor,
  15048. projectionMatrix: this.camera.projectionMatrix.clone(),
  15049. worldMatrix: this.camera.matrixWorld.clone(),
  15050. mode: this.mode,
  15051. modelPosition: this.model.position.clone(),
  15052. modelCenter: this.model.center.clone(),
  15053. zooming: this.zooming
  15054. }, !0;
  15055. var e = 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.zoom && 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.zooming === this.previousState.zooming;
  15056. return t.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible, t.moved = !this.position.equals(this.previousState.position), t.rotated = !this.quaternion.equals(this.previousState.quaternion), t.mouseMoved = !this.mouse.equals(this.previousState.mouse), t.zoomed = this.getLabelScaleFactor() !== this.previousState.zoom, t.floorChanged = this.model.currentFloor !== this.previousState.currentFloor, t.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix), t.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix), t.modeChanged = this.mode !== this.previousState.mode, t.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition), t.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter), t.nextPanoActive = null !== this.nextPano, t.zooming = this.zooming !== this.previousState.zooming, this.previousState.allFloorsVisible = this.model.allFloorsVisible, this.previousState.position.copy(this.position), this.previousState.quaternion.copy(this.quaternion), this.previousState.mouse.copy(this.mouse), this.previousState.zoom = this.getLabelScaleFactor(), this.previousState.currentFloor = this.model.currentFloor, this.previousState.projectionMatrix.copy(this.camera.projectionMatrix), this.previousState.worldMatrix.copy(this.camera.matrixWorld), this.previousState.mode = this.mode, this.previousState.modelPosition.copy(this.model.position), this.previousState.modelCenter.copy(this.model.center), this.previousState.zooming = this.zooming, !e
  15057. }, lt.prototype.updateIntersect = function(t) {
  15058. if (!j.isMobile() || t) {
  15059. var e = this.flying || this.isWarping(),
  15060. i = this.isOutsideMode() && this.controls[this.mode].isEngaged(),
  15061. n = M.getById(Y.LookTransition),
  15062. r = !(e || i || this.isTouchEvent || n.length && n[0].running);
  15063. this.inMeasureMode && this.intersectPoints(this.mouse, this.camera), this.mattertagManager.intersectMattertag(this.mouse, r, this.camera) || (this.intersect = this.getMouseIntersect(), this.intersect && this.updateClosestPano(this.intersect), this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect), v.navigation.panoScores && !v.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : (this.reticule.updatePosition(this.position, this.intersect), v.isEditVersion && this.addTagReticule.hide()))
  15064. }
  15065. }, lt.prototype.intersectPoints = function(t, e) {
  15066. var i = this.mouse.clone(),
  15067. r = this.model.floors.reduce((function(t, e) {
  15068. return e.hidden ? t : t.concat(e.collider.children)
  15069. }), this.mode === f.PANORAMA ? this.panoMarkers : []),
  15070. o = new n.Vector3(i.x, i.y, -1)
  15071. .unproject(this.camera);
  15072. this.raycasterP.set(o, this.getMouseDirection(i));
  15073. var a = r.concat(G.MT.allSpheres),
  15074. s = this.raycasterP.intersectObjects(a);
  15075. if (s.length > 0 && "SphereGeometry" == s[0].object.geometry.type) {
  15076. this.raycasterP.set(this.intersect.point, this.intersect.face.normal);
  15077. this.raycasterP.intersectObjects(r)
  15078. .length
  15079. }
  15080. this.intersect && (this.intersect.point.add(this.intersect.face.normal.clone()
  15081. .multiplyScalar(.01)), G.pointsIntersect = {
  15082. point: this.intersect.point,
  15083. normal: this.intersect.normal
  15084. })
  15085. }, lt.prototype.getMouseDirection = function(t) {
  15086. t = t || this.mouse;
  15087. var e = new n.Vector3(t.x, t.y, -1)
  15088. .unproject(this.camera);
  15089. return new n.Vector3(t.x, t.y, 1)
  15090. .unproject(this.camera)
  15091. .sub(e)
  15092. .normalize()
  15093. }, lt.prototype.getMouseOnWholeIntersect = function(t) {}, lt.prototype.computeIntersectWithFloor = function(t, e, i) {
  15094. return i = i || this.model.floors.reduce((function(t, e) {
  15095. return e.hidden ? t : t.concat(e.collider.children)
  15096. }), this.mode === f.PANORAMA ? this.panoMarkers : []), this.raycaster.set(t, e, 1), this.raycaster.intersectObjects(i)
  15097. }, lt.prototype.getMouseIntersect = function(t, e) {
  15098. t = t || this.mouse.clone(), e = e || this.model.floors.reduce((function(t, e) {
  15099. return e.hidden ? t : t.concat(e.collider.children)
  15100. }), this.mode === f.PANORAMA ? this.panoMarkers : []);
  15101. var i = new n.Vector3(t.x, t.y, -1)
  15102. .unproject(this.camera),
  15103. r = this.computeIntersectWithFloor(i, this.getMouseDirection(t), e);
  15104. if (0 === r.length) return null;
  15105. var o = r[0];
  15106. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion), this.position.clone()
  15107. .sub(o.point)
  15108. .dot(o.normal) < 0 && o.normal.negate(), this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5, o.horizontal = o.normal.y > .8);
  15109. return o
  15110. }, lt.prototype.updateClosestPano = function(t) {
  15111. if (this.currentPano) {
  15112. var e = [h.filters.isPanoAligned()];
  15113. this.mode === f.PANORAMA ? (e.push(h.filters.not(this.currentPano)), e.push(h.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)), e.push(h.filters.isNeighbourPanoTo(this.currentPano)), e.push(h.filters.isCloseEnoughTo(t.point, v.panoFloorClickRadius)), e.push(h.filters.isNotBehindNormal(t.point, t.normal))) : (e.push(h.filters.isOnVisibleFloor()), this.mode !== f.FLOORPLAN && e.push(h.filters.inDirection(this.position, this.getDirection(), .25)));
  15114. var i = this.model.panos.find(e, [h.sortFunctions.floorDistanceToPoint(t.point)]);
  15115. i != this.closestPano && (this.emit(D.ClosestPanoChanging, this.closestPano, i, this.mode), this.closestPano = i)
  15116. }
  15117. }, lt.prototype.dollhouseMode = function(t, e) {
  15118. this.emit(D.ModeChanging, this.mode, f.DOLLHOUSE), this.mode = f.DOLLHOUSE, this.controls[f.DOLLHOUSE].reset();
  15119. new n.Vector3(this.model.center.x, 0, this.model.center.z), new n.Vector3(15, 20, 15);
  15120. this.controls[f.DOLLHOUSE].resetRanges(0, !0), this.resetDC(), this.updateFromControls(), this.model.alpha = 1, this.model.skybox.material.uniforms.opacity.value = 0
  15121. }, lt.prototype.insideMode = function(t, e) {
  15122. if (e = e || null, this.mode !== f.PANORAMA && this.mode !== f.TRANSITIONING) {
  15123. var i = [h.filters.isPanoAligned()];
  15124. this.model.currentFloor && i.push(h.filters.atFloor(this.model.currentFloor)), t = t || this.currentPano || this.model.panos.find(i, [h.sortFunctions.distanceToPoint(this.control.target)]);
  15125. var n = null !== this.currentPanoQuaternion ? this.currentPanoQuaternion : void 0;
  15126. this.flyToNewMode({
  15127. mode: f.PANORAMA,
  15128. pano: t,
  15129. callback: e,
  15130. quaternion: n
  15131. })
  15132. }
  15133. }, lt.prototype.fitDollhouse = function(t, e, i) {
  15134. var r = m.FORWARD.clone()
  15135. .applyQuaternion(i);
  15136. this.control.target.copy(r)
  15137. .add(t);
  15138. var o = m.RIGHT.clone()
  15139. .applyQuaternion(i),
  15140. a = m.UP.clone(),
  15141. s = o.clone()
  15142. .applyAxisAngle(a, Math.PI / 2),
  15143. l = this.model.boundingBox.max.clone(),
  15144. u = this.model.boundingBox.min.clone(),
  15145. h = [new n.Vector3(l.x, 0, l.z)
  15146. .sub(t), new n.Vector3(l.x, 0, u.z)
  15147. .sub(t), new n.Vector3(u.x, 0, l.z)
  15148. .sub(t), new n.Vector3(u.x, 0, u.z)
  15149. .sub(t)
  15150. ],
  15151. c = 0,
  15152. d = 0,
  15153. p = 0;
  15154. h.forEach((function(t, e, i) {
  15155. var n = Math.abs(t.dot(o)),
  15156. r = t.dot(s);
  15157. n > c && (c = n, d = r), r > p && (p = r)
  15158. }));
  15159. var f = Math.sqrt(Math.pow(l.x - u.x, 2) + Math.pow(l.z - u.z, 2)),
  15160. g = f + 1 / Math.max(2 * f, 1);
  15161. this.modellen = f;
  15162. var y = Math.max(Math.abs(new n.Vector3(0, l.y, 0)
  15163. .sub(t)
  15164. .dot(a)), Math.abs(new n.Vector3(0, u.y, 0)
  15165. .sub(t)
  15166. .dot(a))),
  15167. b = s.clone()
  15168. .multiplyScalar(d)
  15169. .add(e),
  15170. w = s.clone()
  15171. .multiplyScalar(p)
  15172. .add(e);
  15173. d = c / Math.tan(this.control.camera.fov / 2 * this.control.camera.aspect * (Math.PI / 180)), p = y / Math.tan(this.control.camera.fov / 2 * (Math.PI / 180)), d = Math.max(.5 * d, g), p = Math.max(.5 * p, g);
  15174. var x = r.clone()
  15175. .multiplyScalar(-d)
  15176. .add(b)
  15177. .sub(e)
  15178. .length(),
  15179. M = r.clone()
  15180. .multiplyScalar(-p)
  15181. .add(b)
  15182. .sub(e)
  15183. .length();
  15184. this.control.maxDistance = v.skyboxRadius - 1, x >= M ? this.control.camera.position.set(0, 6, 0)
  15185. .add(b)
  15186. .add(r.multiplyScalar(1.1 * -d)) : this.control.camera.position.set(0, 6, 0)
  15187. .add(w)
  15188. .add(r.multiplyScalar(1.1 * -p))
  15189. }, lt.prototype.floorplanMode = function(t, e, i) {
  15190. this.mode = f.FLOORPLAN;
  15191. var n = this.controls[f.FLOORPLAN];
  15192. n.reset();
  15193. var r = t || this.model.center;
  15194. if (n.target.copy(r)
  15195. .setY(0), n.camera.position.copy(r)
  15196. .setY(10), i ? (n.currentScale = i / ((window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight)), n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size), e) {
  15197. var o = m.LEFT.clone()
  15198. .applyQuaternion(e);
  15199. n.rotateLeft(-Math.atan2(o.x, o.z))
  15200. } else n.rotateToView(this.model.size, this.getDirection());
  15201. n.update(0)
  15202. }, lt.prototype.nonInterruptingFlyToPano = function(t, e) {
  15203. return t.skipWarpingCheck = !0, this.flyToPano(t, e)
  15204. }, lt.prototype.handleOperation = function(t) {
  15205. if ("flytopano" === t.type) {
  15206. var e = t.id,
  15207. i = this.model.panos.get(e);
  15208. this.remoteFlyToPano({
  15209. pano: i
  15210. })
  15211. }
  15212. }, lt.prototype.flyToPano = function(t, e) {
  15213. this.lockedFlyToPano || this.connect.getSyncState() && (this.connect.remoteControl || this.connect.sync || this.connect.sendOperation({
  15214. type: "flytopano",
  15215. id: t.pano.id
  15216. }), this.evalFlyToPano(t, e))
  15217. }, lt.prototype.remoteFlyToPano = function(t, e) {
  15218. this.evalFlyToPano(t, e)
  15219. }, lt.prototype.evalFlyToPano = function(t, e) {
  15220. var i = this,
  15221. r = t.pano,
  15222. o = t.lookAtPoint,
  15223. a = t.duration,
  15224. s = t.maxDistanceOverride,
  15225. l = t.skipWarpingCheck,
  15226. u = t.constantMoveSpeed,
  15227. h = null,
  15228. c = null;
  15229. if (this.isWarping() && !l) {
  15230. if (this.path.activeTransType === I.BLACK) return q.warn("Player.flyToPano() -> Cannot fly when warping"), e && e(), !1;
  15231. (h = y.deepExtend(t))
  15232. .skipWarpingCheck = !0;
  15233. var d = this.evalFlyToPano.bind(this, h, null);
  15234. return this.emit(D.WarpInterruptedWithFlyTo, this.path.activeTransType, d), e && e(), !1
  15235. }
  15236. if (this.updateLastView(), this.mode === f.PANORAMA) {
  15237. if (!r || (h = y.deepExtend(t), c = this.evalFlyToPano.bind(this, h, e), !this.checkAndWaitForPanoLoad(r, "high", "low", this.basePanoSize, c))) {
  15238. var p = function(t) {
  15239. e && e(t)
  15240. }.bind(this);
  15241. this.currentPano || (this.currentPano = r, this.path.placeCpm(), this.path.fadeOutCpm(v.path.fadeOutTime), this.spider.draw());
  15242. var g = a;
  15243. if ("number" != typeof a) {
  15244. var b = s || v.transition.flytimeMaxDistanceThreshold;
  15245. g = (Math.min(this.currentPano.position.distanceTo(r.position), b) * v.transition.flytimeDistanceMultiplier + v.transition.flyTime) * this.speedmultiplier
  15246. }
  15247. if (v.transition.flySpeed > .01 && (g = 1e3 * this.currentPano.position.distanceTo(r.position) / v.transition.flySpeed), 1 !== this.zoomLevel) switch (v.zoom.transitionStyle) {
  15248. case 1:
  15249. this.smoothZoomToDefault(g / 2);
  15250. break;
  15251. case 2:
  15252. return h = y.deepExtend(t), c = this.evalFlyToPano.bind(this, h, e), void this.smoothZoomToDefault(v.zoom.restoreTime * (this.zoomLevel - 1), c)
  15253. }
  15254. if (o) {
  15255. M.cancelById(Y.LookTransition), g *= v.transition.aimSlowFactor;
  15256. var T = this.control.camera.quaternion.clone(),
  15257. S = (new n.Matrix4)
  15258. .lookAt(r.position, o, m.UP),
  15259. _ = (new n.Quaternion)
  15260. .setFromRotationMatrix(S),
  15261. A = T.clone(),
  15262. P = new n.Vector3;
  15263. if (r === this.currentPano) {
  15264. var C = m.FORWARD.clone()
  15265. .applyQuaternion(T),
  15266. E = m.FORWARD.clone()
  15267. .applyQuaternion(_),
  15268. O = C.angleTo(E),
  15269. R = 1 * Math.sqrt(O) / v.mattertags.navigate.rotateSpeedFactor * 1e3;
  15270. return void M.start(function(t) {
  15271. A.copy(T), w.quaternion(A, _)(t), P.copy(m.FORWARD)
  15272. .applyQuaternion(A)
  15273. .add(this.control.camera.position), this.control.lookAt(P), i.handleControlPanoramaMove()
  15274. }.bind(this), R, p, 0, x[v.transition.movementEasing], null, Y.LookTransition)
  15275. }
  15276. }
  15277. if (r === this.currentPano || this.flying) return void p();
  15278. this.flying = !0;
  15279. var N = this.position.clone(),
  15280. k = this.currentPano;
  15281. q.debug("Flying to pano ", r.position), this.emit(D.PanoChosen, this.currentPano, r), this.emit(D.FlyingStarted, r.position, N, r, k), o && M.start(function(t) {
  15282. A.copy(T), w.quaternion(A, _)(t), P.copy(m.FORWARD)
  15283. .applyQuaternion(A)
  15284. .add(this.control.camera.position), this.control.lookAt(P)
  15285. }.bind(this), g, null, 0, x[v.transition.movementEasing], null, Y.LookTransition);
  15286. var F = u ? null : x[v.transition.movementEasing];
  15287. this.updateRulers(g), this.steeringWheelPos(r, this.currentPano, g), this.measurementTool.updateMeasureVisible(r), this.nextPano = r, this.emit("PanoAnimation", this.nextPano, g), G.R.recording && this.record(this.currentPano, this.nextPano), M.start(w.uniform(this.model.skybox, "progress", 1), g, null, 0, x[v.transition.blendEasing], "skyFly", Y.FlyToPano), M.start(w.allUniforms(this.model.chunks, "progress", 1), g, null, 0, x[v.transition.blendEasing], "chunkFly", Y.FlyToPano), M.start(w.vector(this.cameras[f.PANORAMA].position, r.position), g, function(t) {
  15288. this.flying = !1, this.currentPano.exit(), r.enter(), this.currentPano = r, this.nextPano = null, this.path.placeCpm(), this.path.fadeOutCpm(v.path.fadeOutTime), this.spider.draw(), this.emit(D.FlyingEnded, r.position, N, r, k), p(t), i.currentPano && (this.walkOnPano || this.emit(L.MoveHighlightsBar, i.currentPano.roomid), this.mattertagManager.updateRegionalJumpTags(r))
  15289. }.bind(this), 0, F, "camFly", Y.FlyToPano)
  15290. }
  15291. } else this.flyToNewMode({
  15292. mode: f.PANORAMA,
  15293. pano: r,
  15294. callback: e
  15295. })
  15296. }, lt.prototype.record = function(t, e) {
  15297. G.R.last && G.R.last.time + .05 > parseFloat(G.R.time.getElapsedTime()
  15298. .toFixed(5)) && G.R.save2({
  15299. tap: G.R.last.tap,
  15300. panoid: G.R.last.panoid,
  15301. action: G.R.last.action,
  15302. lon: parseFloat(G.R.last.lon.toFixed(5)),
  15303. lat: parseFloat(G.R.last.lat.toFixed(5)),
  15304. time: parseFloat(G.R.last.time.toFixed(5))
  15305. }), G.R.save({
  15306. tap: "panorama",
  15307. panoid: t.id,
  15308. action: "move",
  15309. destid: e.id
  15310. })
  15311. }, lt.prototype.updateRulers = function(t) {
  15312. var e = 0,
  15313. i = Math.ceil(t / 20),
  15314. n = this,
  15315. r = setInterval((function() {
  15316. ++e > i && clearInterval(r), n.emit(L.RulersWalk)
  15317. }), 20)
  15318. }, lt.prototype.steeringWheelPos = function(t, e, i) {
  15319. if (this.model.steeringWheel && t.id && t.position) {
  15320. var n = t.id,
  15321. r = (G.model.panos.list, this),
  15322. o = i || 400;
  15323. this.model.steeringWheel.position.copy(t.position), this.model.steeringWheel.material.opacity = 0, M.start(w.property(this.model.steeringWheel.material, "opacity", .6), o), this.model.settings.locations.points.forEach((function(t, e) {
  15324. if (t.locationid === n) return r.model.steeringWheel.position.y = t.spot.z + .1, !1
  15325. }))
  15326. }
  15327. }, lt.prototype.changeSteeringWheelState = function(t) {
  15328. t === f.PANORAMA ? this.model.showSteeringWheel() : t !== f.DOLLHOUSE && t !== f.FLOORPLAN || this.model.hideSteeringWheel()
  15329. }, lt.prototype.fastForwardActivePanoFlight = function(t) {
  15330. t = t || v.transition.fastForwardFactor / 10 * 4 + 1;
  15331. for (var e = M.getById(Y.FlyToPano), i = 0; i < e.length; i++) M.adjustSpeed(e[i], t)
  15332. }, lt.prototype.setSpeedMultiplier = function(t) {
  15333. var e = 1,
  15334. i = 1200;
  15335. switch (t) {
  15336. case "0.3×":
  15337. e = 3, i *= 1.5, v.warp.minWarpTime = i;
  15338. break;
  15339. case "0.5×":
  15340. e = 2, i *= 1.2, v.warp.minWarpTime = i;
  15341. break;
  15342. case "1.0×":
  15343. e = 1;
  15344. break;
  15345. case "1.5×":
  15346. e = .67;
  15347. break;
  15348. case "2.0×":
  15349. e = .5;
  15350. break;
  15351. default:
  15352. e = 1
  15353. }
  15354. this.speedmultiplier = e
  15355. }, lt.prototype.flyToPanoClosestToMouse = function() {
  15356. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(), this.intersect && this.updateClosestPano(this.intersect)), this.closestPano) return this.flyToPano({
  15357. pano: this.closestPano
  15358. });
  15359. var t = this.getMouseDirection();
  15360. this.flyDirection(t) || this.flyToPano({
  15361. pano: this.currentPano
  15362. })
  15363. }, lt.prototype.flyLocalDirection = function(t) {
  15364. var e = this.getDirection(t),
  15365. i = 1 === t.z ? .4 : .75,
  15366. n = 1 === Math.abs(t.x);
  15367. this.flyDirection(e, i, n)
  15368. }, lt.prototype.flyDirection = function(t, e, i) {
  15369. this.history.invalidate();
  15370. var n = this.closestPanoInDirection(t, e, i);
  15371. return n ? (this.flyToPano({
  15372. pano: n
  15373. }), !0) : (this.bump(t), !1)
  15374. }, lt.prototype.closestPanoInDirection = function(t, e, i) {
  15375. return this.rankedPanoInDirection(0, t, e, i)
  15376. }, lt.prototype.rankedPanoInDirection = function() {
  15377. var t = {
  15378. pano: null,
  15379. candidates: []
  15380. };
  15381. return function(e, i, n, r) {
  15382. e || (e = 0), n = void 0 !== n ? n : .75;
  15383. var o = r ? "angle" : "direction";
  15384. return this.model.panos.findRankedByScore(e, [h.filters.isPanoAligned(), h.filters.inPanoDirection(this.position, i, n), h.filters.isNeighbourPanoTo(this.currentPano), h.filters.not(this.currentPano)], [h.scoreFunctions.distanceSquared(this.currentPano), h.scoreFunctions[o](this.position, i)], t), this.cachedPanoCandidates = t.candidates, t.pano
  15385. }
  15386. }(), lt.prototype.bump = function(t) {
  15387. if (this.mode === f.PANORAMA && !this.flying && !this.isWarping()) {
  15388. var e, i, r, o = v.transition,
  15389. a = (o.flytimeMaxDistanceThreshold * o.flytimeDistanceMultiplier + o.flyTime) / 8,
  15390. s = this.camera.getWorldDirection(new n.Vector3)
  15391. .dot(t);
  15392. if (Math.abs(s) > .5) e = function() {
  15393. M.start(w.property(this.cameras[f.PANORAMA], "zoom", s > 0 ? 1.04 : .96), a, i, 0, x.easeInOutSine, "bumpZStart")
  15394. }.bind(this), i = function() {
  15395. M.start(w.property(this.cameras[f.PANORAMA], "zoom", 1), 5 * a, r, 0, x.easeInOutSine, "bumpZRelax")
  15396. }.bind(this);
  15397. else {
  15398. var l = this.camera.position.clone(),
  15399. u = t.clone();
  15400. this.raycaster.set(l, u);
  15401. var h = this.model.floors.reduce((function(t, e) {
  15402. return t.concat(e.collider.children)
  15403. }), []),
  15404. c = this.raycaster.intersectObjects(h),
  15405. d = c.length > 0 ? c[0].distance / 25 : .04,
  15406. p = l.clone()
  15407. .add(u.multiplyScalar(d));
  15408. e = function() {
  15409. M.start(w.vector(this.cameras[f.PANORAMA].position, p), a, i, 0, x.easeInOutSine, "bumpTStart")
  15410. }.bind(this), i = function() {
  15411. M.start(w.vector(this.cameras[f.PANORAMA].position, l), 5 * a, r, 0, x.easeInOutSine, "bumpTRelax")
  15412. }.bind(this)
  15413. }
  15414. r = function() {
  15415. this.flying = !1
  15416. }.bind(this), this.flying = !0, e()
  15417. }
  15418. }, lt.prototype.changeFloor = function(t, e) {
  15419. var i = this.controls[this.mode];
  15420. if (i && i.emit(L.Move, e), e && this.controls[f.PANORAMA].emit(L.InteractionGui, "floor-control"), !this.is360View(this.mode, this.currentPano))
  15421. if (this.mode === f.PANORAMA) {
  15422. var n = this.history.reversePano(t);
  15423. n && n.isAligned() ? this.flyToPano({
  15424. pano: n
  15425. }) : this.changeFloorByScore(t)
  15426. } else this.model.setFloor(this.model.nextFloor(t) || this.model.currentFloor)
  15427. }, lt.prototype.changeFloorByScore = function() {
  15428. var t = {
  15429. pano: null,
  15430. candidates: []
  15431. };
  15432. return function(e) {
  15433. var i = this.model.nextFloor(e);
  15434. return i ? (this.model.panos.lowestByScore([h.filters.atFloor(i), h.filters.isPanoAligned()], [h.scoreFunctions.distance(this.currentPano), h.scoreFunctions.direction(this.position, new n.Vector3(0, e, 0)), h.scoreFunctions.penalizeHeightDifferenceUnder(this.position, .5)], t), void(t.pano ? (this.cachedPanoCandidates = t.candidates, this.history.push(e, this.currentPano), this.flyToPano({
  15435. pano: t.pano
  15436. })) : q.warn("No pano found on selected floor, not moving there."))) : void q.debug("player.changeFloor(" + e + "): no such floor")
  15437. }
  15438. }(), lt.prototype.gotoFloor = function(t, e) {
  15439. var i = t - this.model.currentFloor.floorIndex;
  15440. this.changeFloor(i, e)
  15441. }, lt.prototype.getDirection = function(t, e) {
  15442. return t = t || (new n.Vector3)
  15443. .copy(m.FORWARD), e ? t.applyQuaternion(G.p.quaternion) : t.applyQuaternion(this.camera.quaternion)
  15444. }, lt.prototype.getHighlightDirection = function(t) {
  15445. return (t = t || (new n.Vector3)
  15446. .copy(m.FORWARD))
  15447. .applyQuaternion(this.model.heroImage._camera._rotation)
  15448. }, lt.prototype.flyToSameMode = function(t, e, i, r) {
  15449. var o = this;
  15450. if (this.mode === f.TRANSITIONING) return q.warn("should not be transitioning here"), void(r && r(!1));
  15451. var a = i || !1,
  15452. s = i ? i.position : this.position,
  15453. l = this.position.clone(),
  15454. u = this.currentPano;
  15455. if (q.debug("New pose in mode " + this.mode), t) {
  15456. var h = this.flyToSameMode.bind(this, t, e, i, r);
  15457. if (this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, h)) return
  15458. }
  15459. var c = function() {
  15460. this.emit(D.FlyingEnded, s, l, t, u), r && r(!0), o.currentPano
  15461. }.bind(this),
  15462. d = v[this.mode],
  15463. p = void 0 !== e ? e : d.transitionTime,
  15464. m = new n.Vector3,
  15465. g = new n.Vector3;
  15466. if (this.emit(D.FlyingStarted, s, l, t, u), this.mode === f.PANORAMA) q.warn("we should not be here for panorama views");
  15467. else if (this.mode === f.DOLLHOUSE)
  15468. if (a) {
  15469. var y = new n.Vector3(0, 1, 0);
  15470. this.controls[f.DOLLHOUSE].resetRanges(1, !0), this.model.warpDestFloors(i.floorVisibility), g.copy(i.position);
  15471. var b = new n.Vector3(0, 0, -1)
  15472. .applyQuaternion(i.quaternion),
  15473. T = new n.Raycaster(g.clone(), b.clone(), 0, 1 / 0)
  15474. .intersectObjects(this.model.colliders),
  15475. S = 3;
  15476. T.length ? (m.copy(T[0].point), S = .75 * g.distanceTo(m)) : (m.copy(b)
  15477. .multiplyScalar(3)
  15478. .add(g), q.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  15479. var _ = (new n.Matrix4)
  15480. .lookAt(g, m, y),
  15481. A = (new n.Euler)
  15482. .setFromRotationMatrix(_, v.warp.eOrder),
  15483. P = m.distanceTo(g),
  15484. C = (new n.Matrix4)
  15485. .lookAt(this.cameras[f.DOLLHOUSE].position, this.controls[f.DOLLHOUSE].target, y),
  15486. E = (new n.Euler)
  15487. .setFromRotationMatrix(C, v.warp.eOrder),
  15488. L = this.cameras[f.DOLLHOUSE].position.distanceTo(this.controls[f.DOLLHOUSE].target);
  15489. this.controls[f.DOLLHOUSE].resetRanges(Math.min(L, S), !0);
  15490. var O = new n.Euler(A.x - E.x, A.y - E.y, A.z - E.z, v.warp.eOrder);
  15491. O.y > Math.PI ? O.y -= 2 * Math.PI : O.y < -Math.PI && (O.y += 2 * Math.PI), this.path.burnsDir = Math.sign(O.y);
  15492. var I = new n.Euler(0, 0, 0, v.warp.eOrder),
  15493. R = new n.Vector3;
  15494. M.start(w.vector(this.controls[f.DOLLHOUSE].target, m), p, null, v.flydown.movementDelay, x[v.flydown.movementEasing], null, Y.FlyToSameMode), M.start(function(t, e) {
  15495. I.x = E.x + t * O.x, I.y = E.y + t * O.y, I.z = E.z + t * O.z;
  15496. var i = L + t * (P - L);
  15497. R.set(0, 0, i)
  15498. .applyEuler(I)
  15499. .add(this.controls[f.DOLLHOUSE].target), this.cameras[f.DOLLHOUSE].position.copy(R)
  15500. .add(this.model.position)
  15501. }.bind(this), p, null, v.flydown.movementDelay, x[v.flydown.movementEasing], null, Y.FlyToSameMode), M.start(function(t, e) {
  15502. this.controls[f.DOLLHOUSE].update(), this.quaternion.copy(this.cameras[f.DOLLHOUSE].quaternion), this.position.copy(this.cameras[f.DOLLHOUSE].position)
  15503. }.bind(this), p, null, v.flydown.movementDelay, x[v.flydown.movementEasing], null, Y.FlyToSameMode)
  15504. } else q.warn("invalid warp destination in flyToSameMode()? ignore it then");
  15505. else if (this.path.placeCpm(), this.path.fadeInCpm(v.path.fadeInTime), i) {
  15506. this.model.warpDestFloors(i.floorVisibility);
  15507. var N = this.cameras[f.FLOORPLAN],
  15508. k = this.controls[f.FLOORPLAN],
  15509. F = k.target.clone(),
  15510. B = i.position.clone()
  15511. .sub(F),
  15512. z = N.position.clone()
  15513. .sub(k.target)
  15514. .length(),
  15515. U = new n.Vector3(-1, 0, 0)
  15516. .applyQuaternion(i.quaternion)
  15517. .normalize(),
  15518. V = Math.atan2(k.offset.x, k.offset.z),
  15519. j = Math.atan2(U.x, U.z),
  15520. H = k.absoluteScale,
  15521. G = i.orthoZoom / ((window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight));
  15522. M.start(function(t, e) {
  15523. k.target.copy(B)
  15524. .multiplyScalar(t)
  15525. .add(F);
  15526. var i = V + (j - V) * t;
  15527. k.offset.x = z * Math.sin(i), k.offset.z = z * Math.cos(i), N.position.copy(k.target)
  15528. .add(k.offset), k.absoluteScale = H + t * (G - H), k.update(), this.quaternion.copy(N.quaternion), this.position.copy(N.position), this.target.copy(k.target), this.camera.projectionMatrix.copy(N.projectionMatrix)
  15529. }.bind(this), p, null, 0, x[v.flydown.movementEasing], null, Y.FlyToSameMode)
  15530. } else q.info("flyToSameMode() funny floorplan view? skipping");
  15531. M.setTimeout(function(t) {
  15532. this.mode = t, c()
  15533. }.bind(this, this.mode), p, Y.FlyToSameMode), this.mode = f.TRANSITIONING
  15534. }, lt.prototype.ownFlyToNewMode = function(t) {
  15535. var e = (t = t || {})
  15536. .mode,
  15537. i = t.pano,
  15538. n = t.duration,
  15539. r = t.warpDest,
  15540. o = t.callback,
  15541. a = t.force;
  15542. t.quaternion;
  15543. if (this.isWarping()) return q.warn("Player.flyToNewMode() -> Cannot fly when warping"), void(o || o(!1));
  15544. if (this.mode !== f.TRANSITIONING)
  15545. if (e !== this.mode) {
  15546. q.debug("Switching mode to " + e);
  15547. var s = this.ownFlyToNewMode.bind(this, t);
  15548. if (!i || !this.checkAndWaitForPanoLoad(i, "low", "low", this.basePanoSize, s)) {
  15549. if (!this.model.meshTexturesLoaded && this.isOutsideMode(e)) return q.info("Waiting for model textures to be loaded before going out to dollhouse"), this.model.waitForLoad(this.model, (function() {
  15550. return self.model.meshTexturesLoaded
  15551. })), void this.model.loadMeshTextures()
  15552. .done(s);
  15553. this.history.invalidate(), this.updateLastView();
  15554. var l = this.mode;
  15555. this.cameras[e];
  15556. t = y.deepExtend({}, v[e], v[l + "-" + e]);
  15557. void 0 !== n || t.transitionTime
  15558. }
  15559. } else a ? this.flyToSameMode(i, n, r, o) : o && o(!1);
  15560. else o && o(!1)
  15561. }, lt.prototype.flyToNewMode = function(t) {
  15562. var e = this,
  15563. i = (t = t || {})
  15564. .mode,
  15565. r = t.pano,
  15566. o = t.duration,
  15567. a = t.warpDest,
  15568. s = t.callback,
  15569. l = t.force,
  15570. u = t.quaternion;
  15571. if (this.isWarping()) return q.warn("Player.flyToNewMode() -> Cannot fly when warping"), void(s && s(!1));
  15572. if (this.mode !== f.TRANSITIONING) {
  15573. if (i === this.mode) return l ? void this.flyToSameMode(r, o, a, s) : void(s && s(!1));
  15574. var h = a || !1;
  15575. q.debug("Switching mode to " + i);
  15576. var c = this.flyToNewMode.bind(this, t);
  15577. if (!r || !this.checkAndWaitForPanoLoad(r, "low", "low", this.basePanoSize, c)) {
  15578. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i)) return q.info("Waiting for model textures to be loaded before going out to dollhouse"), this.model.waitForLoad(this.model, function() {
  15579. return this.model.meshTexturesLoaded
  15580. }.bind(this)), void this.model.loadMeshTextures()
  15581. .done(c);
  15582. this.history.invalidate(), this.updateLastView();
  15583. var d = this.mode,
  15584. p = this.cameras[i];
  15585. t = y.deepExtend({}, v[i], v[d + "-" + i]);
  15586. var m = void 0 !== o ? o : t.transitionTime;
  15587. this.emit(D.ModeChanging, d, i, r), r && (this.currentPano = r), d === f.PANORAMA && (this.currentPanoQuaternion = this.quaternion.clone()), this.switchCameraMode(i, u), M.cancelById(Y.LookTransition);
  15588. var g = (new n.Vector3)
  15589. .copy(this.position);
  15590. if (i === f.PANORAMA) this.emit(D.PanoChosen, r, r), setTimeout(function() {
  15591. r.floor.enter(i)
  15592. }.bind(this), m / 2), this.path.fadeOutCpm(v.path.fadeOutTime);
  15593. else if (i === f.DOLLHOUSE) {
  15594. if (h && (this.model.stayPut = !0), a ? (this.controls[f.DOLLHOUSE].resetRanges(1, !0), this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0), this.path.placeCpm(), this.path.fadeInCpm(v.path.fadeInTime), h) {
  15595. var b = new n.Vector3(this.model.center.x, 0, this.model.center.z);
  15596. g.set(15, 10, 15);
  15597. var T = new n.Vector3(0, 0, -1)
  15598. .applyQuaternion(a.quaternion),
  15599. S = new n.Raycaster(a.position.clone(), T.clone(), 0, 1 / 0)
  15600. .intersectObjects([this.sceneIntersectionPlane]);
  15601. S.length ? (b.copy(S[0].point), g.copy(a.position), this.controls[f.DOLLHOUSE].resetRanges(.75 * g.distanceTo(b), !0)) : (q.warn("Tried to restore dollhouse mode that did not intersect...", a.position, a.quaternion), this.controls[f.DOLLHOUSE].resetRanges(3, !0)), this.controls[f.DOLLHOUSE].target.copy(b), g.add(this.model.position), p.position.copy(g), this.controls[f.DOLLHOUSE].update()
  15602. }
  15603. } else if (this.path.placeCpm(), this.path.fadeInCpm(v.path.fadeInTime), a) {
  15604. this.model.warpDestFloors(a.floorVisibility);
  15605. var _ = this.cameras[f.FLOORPLAN],
  15606. A = this.controls[f.FLOORPLAN],
  15607. P = _.position.clone()
  15608. .sub(A.target),
  15609. O = new n.Vector3(-1, 0, 0)
  15610. .applyQuaternion(a.quaternion)
  15611. .normalize(),
  15612. N = Math.atan2(O.x, O.z);
  15613. A.target.copy(a.position);
  15614. var k = P.length();
  15615. A.offset.x = k * Math.sin(N), A.offset.y = 0, A.offset.z = k * Math.cos(N), _.position.copy(A.target)
  15616. .add(A.offset), A.target.clone()
  15617. .sub(p.position), p.quaternion.copy(a.quaternion), A.currentScale = a.orthoZoom / ((window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight)), A.absoluteScale = A.currentScale, A.update()
  15618. } else this.model.currentFloor.enter(i);
  15619. var F = this.currentPano,
  15620. B = this.position.clone();
  15621. this.emit(D.FlyingStarted, g, B, r, this.currentPano), this.flying = !0, this.isOutsideMode(i) && this.is360View(d, F) ? (h || i !== f.DOLLHOUSE || (p.position.set(15, 10, 15), p.controls.target.set(this.model.center.x, 0, this.model.center.z), p.controls.update()), t.blackoutStyle = R.FADEIN, m = v.show360Views.transitionTime, this.fade360View(m, p, t)) : this.isOutsideMode(d) && this.is360View(i, r) ? (h && this.switchCameraMode(i, h.quaternion), this.mode = i, this.path && this.path.popOutCpm(), t.blackoutStyle = R.END, m = v.show360Views.transitionTime, this.fade360View(m, p, t)) : (M.start(w.property(this.model, "alpha", t.modelAlpha, null), m * t.modelAlphaLength, null, t.modelAlphaDelay, null, Y.FlyToNewMode), M.start(w.vector(this.position, p.position), m, null, v.flydown.movementDelay, x[v.flydown.movementEasing], null, Y.FlyToNewMode), M.start(w.quaternion(this.quaternion, p.quaternion), m * t.rotationDuration, null, t.rotationDelay, x[v.flydown.rotationEasing], null, Y.FlyToNewMode), M.start(w.matrix4(this.camera.projectionMatrix, p.projectionMatrix), m * t.cameraMatrixDuration, null, t.cameraMatrixDelay, t.cameraMatrixEase, null, Y.FlyToNewMode), M.start(w.uniform(this.model.skybox, "opacity", t.skyboxOpacity), m * t.skyboxOpacityLength, null, t.skyboxOpacityDelay, null, Y.FlyToNewMode), M.start(w.property(this.reticule.material.uniforms.opacity, "value", 0), m, null, Y.FlyToNewMode)), M.setTimeout(function() {
  15622. this.flying = !1, d === f.PANORAMA && i !== f.PANORAMA ? this.currentPano.exit() : d !== f.PANORAMA && i === f.PANORAMA && (this.currentPano.enter(), this.path.placeCpm(), this.path.fadeOutCpm(v.path.fadeOutTime), this.spider.draw()), d === f.DOLLHOUSE && this.controls[f.DOLLHOUSE].resetRanges(), this.mode = i, this.emit(D.FlyingEnded, g, B, this.currentPano, F), e.currentPano && ("panorama" === G.player.mode && this.emit(L.MoveHighlightsBar, e.currentPano.roomid), this.steeringWheelPos(e.currentPano), this.mattertagManager.updateRegionalJumpTags(e.currentPano), this.measurementTool && this.measurementTool.updateMeasureVisible(e.currentPano), this.measuringToolControls && this.measuringToolControls.onFlyEnd()), e.model.entranceMesh && (e.mode === f.DOLLHOUSE ? e.model.setEntranceState(!0) : e.model.setEntranceState(!1)), h && d !== f.PANORAMA && i === f.PANORAMA ? this.startWarp(E.Retain, C.Retain, I.BLACK, null, null, s) : s && s()
  15623. }.bind(this), m, Y.FlyToNewMode), this.mode = f.TRANSITIONING
  15624. }
  15625. } else s && s(!1)
  15626. }, lt.prototype.fade360View = function(t, i, n) {
  15627. this.mattertagManager.hideShowTagsForBlackoutStyle(n.blackoutStyle, t), e(this.domElement)
  15628. .fadeOut(.5 * t, function() {
  15629. this.model.skybox.material.uniforms.opacity.value = n.skyboxOpacity, this.model.alpha = n.modelAlpha, this.position.copy(i.position), this.quaternion.copy(i.quaternion), this.camera.projectionMatrix.copy(i.projectionMatrix), e(this.domElement)
  15630. .fadeIn(.5 * t)
  15631. }.bind(this))
  15632. }, lt.prototype.findDefaultViews = function() {
  15633. this.findDefaultView(this.lastInsideView, !0), this.findDefaultView(this.last360View, !1)
  15634. }, lt.prototype.findDefaultView = function(t, e) {
  15635. var i, n = this.model.heroLocations,
  15636. r = this.model.panos,
  15637. o = n.findIndex((function(t) {
  15638. if (t.cameraMode !== f.PANORAMA) return !1;
  15639. var i = r.get(t.panoId);
  15640. return i && i.isAligned() === e
  15641. }));
  15642. o >= 0 ? (i = r.get(n[o].panoId), t.update({
  15643. cameraMode: f.PANORAMA,
  15644. pano: i,
  15645. position: n[o].position,
  15646. quaternion: n[o].quaternion
  15647. })) : (o = r.list.findIndex((function(t) {
  15648. return t.isAligned() === e
  15649. }))) >= 0 ? (i = r.list[o], t.update({
  15650. cameraMode: f.PANORAMA,
  15651. pano: i,
  15652. position: i.position
  15653. })) : q.warn("There are no", e ? "inside" : "360??", "views in this model")
  15654. }, lt.prototype.updateLastView = function() {
  15655. this.mode === f.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View)
  15656. .update({
  15657. pano: this.currentPano,
  15658. position: this.position,
  15659. quaternion: this.quaternion
  15660. })
  15661. }, lt.prototype.goToLastView = function(t) {
  15662. var e = t ? this.lastInsideView : this.last360View;
  15663. this.isInMode(f.PANORAMA) && this.currentPano.isAligned() !== t && this.updateLastView(), this.isInMode(f.PANORAMA) ? (this.path && this.path.popOutCpm(), this.fadeToView(t, e, v.show360Views.transitionTime)) : this.isOutsideMode() && this.flyToNewMode({
  15664. mode: e.cameraMode,
  15665. pano: e.pano,
  15666. quaternion: e.quaternion
  15667. })
  15668. }, lt.prototype.setStateWithAnimation = function(t, e) {
  15669. t && (t.mode && t.mode !== this.mode && this.mode !== f.TRANSITIONING ? t.mode === f.PANORAMA ? this.flyToNewMode({
  15670. pano: this.model.panos.index[t.panoId],
  15671. mode: f.PANORAMA
  15672. }) : (s.prototype._progressNumber = function(t, e, i) {
  15673. return t + (e - t) * i
  15674. }, s.prototype._progressRad = function(t, e, i) {
  15675. var n = 2 * Math.PI,
  15676. r = Math.PI,
  15677. o = function(t) {
  15678. return (t % n + n) % n
  15679. };
  15680. return t = o(t), (e = o(e)) - t > r ? this._progressNumber(t + n, e, i) : t - e > r ? this._progressNumber(t - n, e, i) : this._progressNumber(t, e, i)
  15681. }) : this.mode !== f.TRANSITIONING && this.controls[this.mode].translateWithAnimation(t.lon, t.lat, e), t.zoomLevel && t.zoomLevel !== this.zoomLevel && this.zoomTo(t.zoomLevel, !0))
  15682. }, lt.prototype.fadeToView = function(t, i, n) {
  15683. if (!i.isValid() || i.cameraMode === f.PANORAMA && !i.pano) return q.warn("Tried to fade to an illegal view", i.cameraMode), !1;
  15684. var r = function() {
  15685. e(this.domElement)
  15686. .fadeIn(.5 * n)
  15687. }.bind(this),
  15688. o = t ? R.FADEIN : R.END;
  15689. this.mattertagManager.hideShowTagsForBlackoutStyle(o, n), e(this.domElement)
  15690. .fadeOut(.5 * n, function() {
  15691. this.model.fadePanoMarkers(t ? v.panorama.markerOpacity : 0), i.cameraMode === f.PANORAMA ? this.flyToPano({
  15692. pano: i.pano,
  15693. lookAtPoint: m.FORWARD.clone()
  15694. .applyQuaternion(i.quaternion)
  15695. .add(i.pano.position),
  15696. duration: 0
  15697. }, r) : this.flyToNewMode({
  15698. mode: i.cameraMode,
  15699. quaternion: i.quaternion,
  15700. duration: 0,
  15701. callback: r
  15702. })
  15703. }.bind(this))
  15704. }, lt.prototype.startWarp = function(t, e, i, n, r, o) {
  15705. if (this.control && (this.control.enabled = !1), this.flying) return q.warn("Player.startWarp() -> Cannot warp when flying"), o && o(), !1;
  15706. null != t || (t = E.Show), this.history.invalidate(), "walk" === i ? this.walkOnPano = !0 : (this.walkOnPano = !1, this.updateRulers(1e3)), t != E.Retain ? this.path.brushToWarpPano(i, I.BLACK) || (i = I.BLACK) : i = this.path.upcomingTransType;
  15707. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  15708. return this.emit(D.WarpStarted, a, i, n, r), n = n || R.MIDDLE, this.path.warpToPano(i, n, r, function() {
  15709. e === C.Slow ? this.path.discardSlow() : e === C.Standard && this.path.discardPathObject(), this.emit(D.WarpEnded, i), this.control && (this.control.enabled = !0), o && o()
  15710. }.bind(this)), t === E.Hide && this.path.discardPathObject(), !0
  15711. }, lt.prototype.warpToPanoById = function(t, e, i, n, r, o, a, s) {
  15712. return this.path.setWarpDestinationByPanoId(t, e) ? this.startWarp(i, n, r, o, a, s) : (q.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"), s && s(), !1)
  15713. }, lt.prototype.warpToPanoByHeroIndex = function(t, e, i, n, r, o, a) {
  15714. if (-1 != e) return this.path.setWarpDestinationByHeroIndex(t) ? this.startWarp(e, i, n, r, o, a) : (a && a(), !1);
  15715. this.startWarp(e, i, n, r, o, a)
  15716. }, lt.prototype.warpToPano = function(t, e, i, n, r, o, a, s) {
  15717. return this.warpToPanoById(t.id, e, i, n, r, o, a, s)
  15718. }, lt.prototype.warpToNonPanoByHeroIndex = function(t, e) {
  15719. return this.path.setWarpDestinationByHeroIndex(t) ? (this.path.warpToNonPano(e), !0) : (q.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"), e && e(), !1)
  15720. }, lt.prototype.aimTourCamera = function(t, e, i, n) {
  15721. return this.warpToPanoByHeroIndex(t, e, i, null, null, null, n)
  15722. }, lt.prototype.showPathToHeroLocation = function(t) {
  15723. this.mode !== f.PANORAMA && this.path.setWarpDestinationByHeroIndex(t) && this.path.brushToWarpPano(I.STD, I.BLACK)
  15724. }, lt.prototype.tourInterlude = function(t, e) {
  15725. this.history.invalidate(), this.path.discardSlow(), this.path.waitNextStep(t, (function() {
  15726. e && e()
  15727. }))
  15728. }, lt.prototype.stopInterlude = function() {
  15729. this.interruptAndFastForward(null, 0)
  15730. }, lt.prototype.interruptAndFastForward = function(t, e) {
  15731. this.isWarping() && this.emit(D.WarpInterrupted, this.path.activeTransType, t, e), this.flying && this.emit(D.FlyingInterrupted), this.path.interruptAndFastForward(t, e)
  15732. }, lt.prototype.setSize = function(t, e) {
  15733. var i = t / e;
  15734. for (var n in this.cameras) this.cameras[n].updateAspect(i)
  15735. }, lt.prototype.toJSON = function() {
  15736. var t = {};
  15737. return this.control ? ((t = this.control.toJSON())
  15738. ._type = f.toInt(this.mode), this.isOutsideMode() ? this.model.allFloorsVisible ? t.floor_visibility = [] : t.floor_visibility = this.model.floors.list.map((function(t) {
  15739. return t.hidden ? 0 : 1
  15740. })) : f.PANORAMA && (t._locationid = this.currentPano.id), t) : t
  15741. }, lt.prototype.getCurrentNodePanos = function(t) {
  15742. if (this.model.panos.map, t.length = 0, this.path.nodes)
  15743. for (var e = 0; e < this.path.nodes.length; e++) {
  15744. var i = this.path.nodes[e];
  15745. t.push(this.model.panos.get(i))
  15746. }
  15747. }, lt.prototype.zoomIncrementally = function(t) {
  15748. var e = this.zoomLevel;
  15749. this.zoomTo(this.zoomLevel + t), e !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(e, this.zoomLevel, this.currentPano.id)
  15750. }, lt.prototype.zoomInIncrementally = function(t) {
  15751. t = t || this.defaultZoomIncrement, this.zoomIncrementally(t)
  15752. }, lt.prototype.zoomOutIncrementally = function(t) {
  15753. t = t || -this.defaultZoomIncrement, this.zoomIncrementally(t)
  15754. }, lt.prototype.zoomBy = function(t) {
  15755. this.zoomTo(this.zoomLevel * t)
  15756. }, lt.prototype.zoomIn = function() {
  15757. this.zoomBy(1 + this.zoomSpeed)
  15758. }, lt.prototype.zoomOut = function() {
  15759. this.zoomBy(1 - this.zoomSpeed)
  15760. }, lt.prototype.jumpTo3D = function() {
  15761. G.d.changeMode(f.DOLLHOUSE), G.d.jumpingto3d = !0
  15762. }, lt.prototype.zoomTo = function(t, e) {
  15763. if (e || v.zoom.enabled && this.mode === f.PANORAMA && this.zoomEnabled) {
  15764. if (t < v.zoom.min ? this.zf ? this.clock.getElapsedTime() - this.start > 3 ? this.zf = !1 : (this.len += v.zoom.min - t, this.len > .26 && (this.jump = !0, this.zf = !1)) : (this.start = this.clock.getElapsedTime(), this.zf = !0, this.len = 0, this.jump = !1) : (this.zf = !1, this.len = 0, this.jump = !1), t < v.zoom.min) {
  15765. t = v.zoom.min;
  15766. var i = G.model.outsideAllowed(),
  15767. n = !this.isInMode(f.DOLLHOUSE, f.TRANSITIONING);
  15768. if (this.jump && i && n) return G.R.recording && G.R.save({
  15769. tap: "dollhouse"
  15770. }), void this.jumpTo3D()
  15771. }
  15772. if (t > v.zoom.max && (t = v.zoom.max), t > this.zoomLevel ? (this.emit(B.ZoomIn), t === v.zoom.max && this.emit(B.ZoomMax)) : t < this.zoomLevel && (this.emit(B.ZoomOut), t === v.zoom.min && this.emit(B.ZoomMin)), this.control) {
  15773. G.R.recording && G.R.save({
  15774. tap: "zoom",
  15775. type: "panorama",
  15776. level: t
  15777. });
  15778. var r = this.control.camera;
  15779. this.zoomLevel = t, r.fov = this.baseFov * (1 / this.zoomLevel), r.updateProjectionMatrix(), this.zoomFov = r.fov
  15780. }
  15781. }
  15782. }, lt.prototype.increaseZoomSpeed = function() {
  15783. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  15784. }, lt.prototype.decreaseZoomSpeed = function() {
  15785. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  15786. }, lt.prototype.clampZoomSpeed = function(t) {
  15787. return t < 0 ? 0 : t
  15788. }, lt.prototype.activatePersistentZooming = function(t) {
  15789. this.zooming = t ? 1 : -1
  15790. }, lt.prototype.deactivatePersistentZooming = function() {
  15791. this.zooming = 0
  15792. }, lt.prototype.zoomDefault = function() {
  15793. this.zoomTo(1, !0)
  15794. }, lt.prototype.smoothZoomToDefault = function(t, e) {
  15795. var i, n = this.zoomLevel,
  15796. r = function(t) {
  15797. t > 1 && (t = 1), i = n * (1 - t) + t, this.zoomTo(i, !0)
  15798. }.bind(this),
  15799. o = function() {
  15800. this.zoomDefault(), e && window.setTimeout(e, 50)
  15801. }.bind(this);
  15802. M.start(r, t, o, null, 0, x[v.transition.blendEasing])
  15803. }, lt.prototype.updateZoomPano = function() {
  15804. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === f.PANORAMA) {
  15805. var t = this.currentPano;
  15806. if (t) {
  15807. var e = this.zoomLevel > v.zoom.activationThreshold,
  15808. i = !(this.flying && this.nextPano && this.nextPano !== this.currentPano) && !this.isWarping(),
  15809. n = e && i;
  15810. this.tileDownloader.tilePrioritizer.setZoomingActive(n), this.panoRenderer.setZoomingActive(n, t, !0);
  15811. var r = function(t, e) {
  15812. this.panoRenderer.resetRenderStatus(t.id, !1, !0, this.qualityManager.getMaxNavPanoSize()), this.panoRenderer.clearAllQueuedUploadsForPano(t.id), this.panoRenderer.renderPanoTiles(t.id, null, !1, !1), t.setZoomed(e)
  15813. }.bind(this);
  15814. n && !t.zoomed ? (r(t, !0), this.panoRenderer.enableUltraHighQualityMode(function() {
  15815. this.qualityManager.useUltraHighResolutionPanos && !v.zoom.overridemax && (v.zoom.max = U.ultraHighQualityMaxZoom), n && r(t, !0)
  15816. }.bind(this))) : !e && t.zoomed && r(t, !1)
  15817. }
  15818. }
  15819. }, lt.prototype.initMeasure = function() {
  15820. this.measurementTool = new W(this), this.measureTexture = new st(this), this.measureTexture.createNewColliders(), this.measureTexture.createMeasureLens(), this.measurementTool && (this.measurementTool.init(this.model), this.measuringToolControls.init(this.measurementTool), this.measurementTool.updateMeasureVisible(this.currentPano))
  15821. }, lt.prototype.updateMeasureMode = function(t) {
  15822. this.measurementTool.updateMode(t)
  15823. }, lt.prototype.setMeasureEnable = function(t) {
  15824. t ? (G.measureMode = !0, this.reticule.visible = !0, this.measurementTool.startInsertion({
  15825. showDistances: !0,
  15826. showArea: !0,
  15827. closed: !0
  15828. }, !j.isMobile()), this.measurementTool.intoMeasureMode(!j.isMobile()), this.measureTexture.show()) : (G.measureMode = !1, this.reticule.visible = !1, this.measurementTool && (this.measurementTool.exitMeasureMode(), this.model.chunks.forEach((function(t) {
  15829. t.material.uniforms.measureMode && (t.material.uniforms.measureMode.value = 0)
  15830. }))), this.measureTexture.hide())
  15831. }, lt.prototype.updateMeasureTexture = function() {
  15832. this.inMeasureMode && this.measureTexture && this.measureTexture.update()
  15833. }, lt.prototype.removeMeasurement = function() {
  15834. this.measurementTool.removeMeasurement()
  15835. }, lt.prototype.showMeasure = function(t) {
  15836. this.measurementTool.show(t)
  15837. }, lt.prototype.hideMeasure = function(t) {
  15838. this.measurementTool.hide(t)
  15839. }, lt.prototype.showAllMeasure = function() {
  15840. this.measurementTool.showAll()
  15841. }, lt.prototype.hideAllMeasure = function() {
  15842. this.measurementTool.hideAll()
  15843. }, lt.prototype.deleteMeasure = function(t) {
  15844. this.measurementTool.delete(t)
  15845. }, lt.prototype.changeMeasureName = function(t, e) {
  15846. this.measurementTool.changeName(t, e)
  15847. }, lt.prototype.clickedOnMeasure = function(t) {
  15848. var e = null;
  15849. if (this.measurementTool && this.measurementTool.activeMeasurement && (e = this.measurementTool.activeMeasurement.points), !this.measurementTool || !this.measurementTool.measurements || e && e.length > 1) return !1;
  15850. this.measurementTool.selected(t);
  15851. var i = null,
  15852. r = null;
  15853. if (this.measurementTool.measurements.forEach((function(e) {
  15854. e.measureid !== t && e.uuid !== t || (i = e.location_id, r = e.areaDetail.desc_position)
  15855. })), i) {
  15856. var o = {
  15857. pano: this.model.panos.index[i],
  15858. lookAtPoint: new n.Vector3(r.x, r.y, r.z)
  15859. };
  15860. this.flyToPano(o)
  15861. }
  15862. }, lt.prototype.disOnMeasure = function(t) {
  15863. this.measurementTool.disSelected(t)
  15864. }, lt.prototype.changeUnit = function(t) {
  15865. this.measurementTool.changeUnit(t)
  15866. }, lt.prototype.setAutoFit = function(t) {
  15867. this.measurementTool.setAutoFit(t)
  15868. }, lt.prototype.setMeasureArea = function(t) {
  15869. this.measurementTool.setMeasureArea(t)
  15870. }, lt.prototype.loadHumanModel = function(t) {
  15871. this.baseControls && this.baseControls.loadHumanModel(t)
  15872. }, lt.prototype.updatePutModelColor = function(t) {
  15873. this.humanModelControls.HUMANMODEL && this.humanModelControls.updateSkinColor(t), this.weaponModelControls.CONTROLMODEL && this.weaponModelControls.updateModelColor(t)
  15874. }, lt.prototype.hidePutModel = function(t) {
  15875. this.humanModelControls.handleHideHumanModel(t), this.weaponModelControls.handleHideModel(t), this.virtualCameraFovControls.handleHideModel(t)
  15876. }, lt.prototype.showPutModel = function(t) {
  15877. this.putModelUIControls && this.putModelUIControls.showPutModel(t)
  15878. }, lt.prototype.handleClickCompleteBtn = function() {
  15879. this.putModelUIControls && this.putModelUIControls.handleClickCompleteBtn()
  15880. }, lt.prototype.removePutModel = function(t) {
  15881. this.humanModelControls.handleDeleteHumanModel(t), this.weaponModelControls.handleDeleteModel(t), this.virtualCameraFovControls.handleDeleteModel(t)
  15882. }, lt.prototype.showModelList = function(t) {
  15883. this.baseControls && this.baseControls.showModelsList(t)
  15884. }, lt.prototype.hideModelList = function() {
  15885. this.baseControls && this.baseControls.hideModelsList()
  15886. }, lt.prototype.updatePutModelName = function(t) {
  15887. this.putModelUIControls && this.putModelUIControls.updatePutModelName(t)
  15888. }, lt.prototype.resetPutModel = function() {
  15889. this.putModelUIControls && this.putModelUIControls.resetPutModel()
  15890. }, lt.prototype.updatePutModelGroundClearance = function(t) {
  15891. 0 <= 1 * t && (this.emit("hidePutModelSetTools"), this.putModelUIControls && this.putModelUIControls.updateModelGroundClearance(t))
  15892. }, lt.prototype.updateSizeOfPutModel = function(t) {
  15893. this.emit("hidePutModelSetTools"), this.putModelUIControls && this.putModelUIControls.updateSizeOfPutModel(t)
  15894. }, lt.prototype.selectPutModel = function(t) {}, lt.prototype.savePutModel = function() {
  15895. if (this.baseControls) return this.baseControls.savePutModels()
  15896. }, lt.prototype.showHumanModelBonesNode = function() {
  15897. this.putModelUIControls && this.putModelUIControls.showHumanModelBonesNode()
  15898. }, lt.prototype.bundleTranslateControlOfPutModel = function() {
  15899. this.putModelUIControls && this.putModelUIControls.bundleTranslateControlOfPutModel()
  15900. }, lt.prototype.bundleRotateControlOfPutModel = function() {
  15901. this.putModelUIControls && this.putModelUIControls.bundleRotateControlOfPutModel()
  15902. }, lt.prototype.virtualSetSlideStop = function(t) {
  15903. this.putModelUIControls && this.putModelUIControls.onVirtualSetSlideStop(t)
  15904. }, lt.prototype.handleClickModelItem = function(t) {
  15905. this.putModelUIControls && this.putModelUIControls.handleClickModelItem(t)
  15906. }, lt.prototype.loadProbeModel = function(t) {
  15907. this.baseControls && this.baseControls.loadWeaponModel(t)
  15908. }, lt.prototype.updateCollision = function(t) {
  15909. this.putModelUIControls && this.putModelUIControls.updateCollision(t)
  15910. }, lt.prototype.loadPostilModel = function(t) {
  15911. this.baseControls && this.baseControls.loadPostilModel(t)
  15912. }, lt.prototype.updatePostilInfo = function(t) {
  15913. this.putModelUIControls && this.putModelUIControls.updatePostilInfo(t)
  15914. }, lt.prototype.savePostilsInfo = function() {
  15915. var t = {},
  15916. e = "";
  15917. if (this.humanModelControls) {
  15918. for (var i = this.postilControls.PostilOfScene, n = 0; n < i.length; ++n) {
  15919. var r = i[n].userData.setting_item;
  15920. t[i[n].uuid] = r
  15921. }
  15922. return e = JSON.stringify(t), "1" == j.getQueryString("isLocal") && localStorage.setItem("POSTILS_INFO_SAVE", e), e
  15923. }
  15924. }, lt.prototype.loadPostilsOfSave = function(t) {
  15925. this.postilControls.hideAll = !1;
  15926. var e = [];
  15927. if (0 < this.postilControls.PostilOfScene.length) {
  15928. for (var i = 0; i < this.postilControls.PostilOfScene.length; ++i) {
  15929. var n = this.postilControls.PostilOfScene[i];
  15930. n.visible = !0;
  15931. var r = n.userData.setting_item;
  15932. r.visible = !0, e.push(r), this.emit("add-postil-item", r)
  15933. }
  15934. this.emit("show-all-postils", e)
  15935. } else {
  15936. var o = this,
  15937. a = (e = [], []);
  15938. for (var s in t) e.push(t[s]);
  15939. ! function t() {
  15940. var i = e[a.length],
  15941. n = new nt(i.type)
  15942. .init(i),
  15943. r = n.userData.setting_item,
  15944. s = [];
  15945. r.visible = !0, s.push(r);
  15946. var l = o.panoMarkers.filter((function(t) {
  15947. return r.current_location_id === t.pano.id
  15948. }))[0];
  15949. n.userData.marker = l, o.addPostilIntoScene(n), a.push(n.uuid), a.length !== e.length ? t() : o.emit("show-all-postils", s)
  15950. }()
  15951. }
  15952. }, lt.prototype.addPostilIntoScene = function(t) {
  15953. this.postilControls.PostilOfScene.push(t), this.postilControls.PostilOfKV[t.uuid] = t, this.sRender.scene.add(t), this.emit("add-postil-item", t.userData.setting_item), this.postilControls.updateMarkerTexture(t)
  15954. }, lt.prototype.hidePostilsOfSave = function() {
  15955. this.postilControls.hideAll = !0;
  15956. for (var t = [], e = 0; e < this.postilControls.PostilOfScene.length; ++e) {
  15957. var i = this.postilControls.PostilOfScene[e];
  15958. i.visible = !1;
  15959. var n = i.userData.setting_item;
  15960. n.visible = !1, t.push(n)
  15961. }
  15962. this.emit("hide-all-postils", t)
  15963. }, lt.prototype.removePostil = function(t) {
  15964. this.emit("show-delete-dialog-of-postil", t)
  15965. }, lt.prototype.deletePostilOfConfirm = function(t) {
  15966. this.postilControls.handleDeletePostil(t)
  15967. }, lt.prototype.editPostil = function(t) {
  15968. var e = this;
  15969. if (this.postilControls.PostilOfKV[t]) {
  15970. var i = this.postilControls.PostilOfKV[t],
  15971. n = i.userData.setting_item,
  15972. r = n.current_location_id;
  15973. return this.emit("hide-postil-set-tool"), this.flyToPano({
  15974. pano: this.model.panos.index[r],
  15975. lookAtPoint: i.position
  15976. }, (function(t) {
  15977. e.postilControls.POSTIL && e.postilControls.POSTIL.uuid !== i.uuid && (e.postilControls.destroyControl(e.postilControls.POSTIL), e.postilControls.destroyBox(e.postilControls.POSTIL)), e.postilControls.POSTIL = i, e.postilControls.handleChoosedPostil(i), e.emit("show-edit-panel-of-postil")
  15978. })), n
  15979. }
  15980. }, lt.prototype.editConfirm = function(t) {
  15981. if (this.postilControls.PostilOfKV[t]) {
  15982. var e = this.postilControls.PostilOfKV[t].userData.setting_item;
  15983. this.emit("edit-confirm", e)
  15984. }
  15985. }, lt.prototype.loadVirtualCamera = function(t) {
  15986. this.baseControls && this.baseControls.loadVirtualCamera(t)
  15987. }, lt.prototype.updateVirtualCameraFov = function(t) {
  15988. this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.updateVirtualCameraFov(t)
  15989. }, lt.prototype.updateVirtualCameraDistance = function(t) {
  15990. this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.updateVirtualCameraDistance(t)
  15991. }, lt.prototype.onIntoEditMode = function() {
  15992. this.putModelUIControls && this.putModelUIControls.onIntoEditMode()
  15993. }, lt.prototype.onQuitEditMode = function() {
  15994. this.putModelUIControls && this.putModelUIControls.onQuitEditMode()
  15995. }, lt.prototype.onIntoPutMode = function() {
  15996. this.putModelUIControls && this.putModelUIControls.onIntoPutMode()
  15997. }, lt.prototype.onQuitPutMode = function() {
  15998. this.putModelUIControls && this.putModelUIControls.onQuitPutMode()
  15999. }, lt.prototype.onApiQuitPutMode = function() {
  16000. this.baseControls && this.baseControls.handleKeyOfESC(), this.putModelUIControls && this.putModelUIControls.onQuitPutMode()
  16001. }, lt.prototype.onIntoEditMeasure = function() {
  16002. this.measurementTool && this.measurementTool.onIntoEditMeasure()
  16003. }, lt.prototype.onQuitEditMeasure = function() {
  16004. this.measurementTool && this.measurementTool.onQuitEditMeasure()
  16005. }, lt.prototype.showVirtualCameraMeasurement = function(t) {
  16006. this.putModelUIControls && this.putModelUIControls.showVirtualCameraMeasurement(t)
  16007. }, lt.prototype.hideVirtualCameraMeasurement = function(t) {
  16008. this.putModelUIControls && this.putModelUIControls.hideVirtualCameraMeasurement(t)
  16009. }, lt.prototype.addModel = function(t) {
  16010. this.sRender.scene.add(t)
  16011. }, lt.prototype.setModelPose = function(t, e) {}, t.exports = lt
  16012. })
  16013. .call(this, i(6))
  16014. }, function(t, e, i) {
  16015. function n(t) {
  16016. r.call(this, t)
  16017. }
  16018. var r = i(14);
  16019. n.prototype = Object.create(r.prototype), t.exports = n
  16020. }, function(t, e, i) {
  16021. function n(t) {
  16022. r.call(this, t)
  16023. }
  16024. var r = i(14);
  16025. n.prototype = Object.create(r.prototype), t.exports = n
  16026. }, function(t, e) {
  16027. t.exports = {
  16028. NONE: 0,
  16029. CONTEXTUAL: 1,
  16030. ANDROID: 2
  16031. }
  16032. }, function(t, e, i) {
  16033. var n = i(0);
  16034. t.exports = {
  16035. newBlue: new n.Color("#28eff5"),
  16036. altBlue: new n.Color(47355),
  16037. classicBlue: new n.Color(53759),
  16038. mpYellow: new n.Color(16502016),
  16039. mpOrange: new n.Color(16428055),
  16040. mpBlue: new n.Color(12096),
  16041. mpLtGrey: new n.Color(13751252),
  16042. mpDkGrey: new n.Color(10000019),
  16043. mpRed: new n.Color(12525854),
  16044. mpOrangeDesat: new n.Color(16764529),
  16045. mpBlueDesat: new n.Color(4034734),
  16046. mpRedDesat: new n.Color(14705505),
  16047. white: new n.Color(16777215),
  16048. yellow: new n.Color("#FFBF32"),
  16049. black: new n.Color(0),
  16050. _desat: function(t, e) {
  16051. var i = e || .3,
  16052. r = (new n.Color)
  16053. .copy(t)
  16054. .getHSL({
  16055. h: 0,
  16056. s: 0,
  16057. l: 0
  16058. });
  16059. return (new n.Color)
  16060. .setHSL(r.h, r.s * (1 - i), r.l)
  16061. },
  16062. _darken: function(t, e) {
  16063. var i = e || .2,
  16064. r = (new n.Color)
  16065. .copy(t)
  16066. .getHSL({
  16067. h: 0,
  16068. s: 0,
  16069. l: 0
  16070. });
  16071. return (new n.Color)
  16072. .setHSL(r.h, r.s, r.l * (1 - i))
  16073. }
  16074. }
  16075. }, function(t, e, i) {
  16076. var n = i(22);
  16077. function r(t) {
  16078. var e = o.UniformsUtils.clone(h.waypoint.uniforms);
  16079. e.map.value = d, e.opacity.value = 0, e.color.value.set(a.reticuleColor), o.Mesh.call(this, new o.PlaneBufferGeometry(.2, .2, 1, 1), new o.RawShaderMaterial({
  16080. side: o.DoubleSide,
  16081. depthWrite: !1,
  16082. depthTest: !1,
  16083. transparent: !0,
  16084. vertexShader: h.waypoint.vertexShader,
  16085. fragmentShader: h.waypoint.fragmentShader,
  16086. uniforms: e,
  16087. name: "waypoint",
  16088. opacity: 0
  16089. })), this.renderOrder = c.reticule, this.player = t, this.direction = new o.Vector3, this.hidden = !0, this.mouseLastMoveTime = Date.now(), this.lineMaterial = new o.LineBasicMaterial({
  16090. linewidth: a.mattertags.pole.width,
  16091. color: a.mattertags.pole.color,
  16092. opacity: 1,
  16093. transparent: !0,
  16094. alphaTest: a.mattertags.pole.opacity * a.mattertags.visibility.alphaTestLevel
  16095. }), p.addAttribute("position", new o.BufferAttribute(f, 3)), this.line = new o.Line(p, this.lineMaterial), this.line.renderOrder = c.ribbon, this.pObject = new o.Object3D, this.pObject.add(this), this.pObject.add(this.line)
  16096. }
  16097. var o = i(0),
  16098. a = i(1),
  16099. s = i(8),
  16100. l = i(16),
  16101. u = i(10),
  16102. h = i(12),
  16103. c = i(17),
  16104. d = l.loadurl(n.splitUrl("./images/pointermain_512x512.png")),
  16105. p = new o.BufferGeometry,
  16106. f = new Float32Array(6);
  16107. f[0] = f[1] = f[2] = f[3] = f[4] = f[5] = 0, r.prototype = Object.create(o.Mesh.prototype), r.prototype.move = function(t, e, i) {
  16108. this.hidden = i, this.mouseLastMoveTime = Date.now()
  16109. }, r.prototype.hide = function() {
  16110. this.hidden || (this.hidden = !0, s.start(u.property(this.material.uniforms.opacity, "value", 0), a.reticuleOpacityTransitionTime))
  16111. }, r.prototype.show = function() {
  16112. this.hidden = !1, this.material.opacity <= 0 && s.start(u.property(this.material.uniforms.opacity, "value", a[this.player.mode].reticuleOpacity), a.reticuleOpacityTransitionTime)
  16113. }, r.prototype.update = function() {
  16114. Date.now() - this.mouseLastMoveTime > a.hideReticuleTimeout && !this.hidden && this.hide()
  16115. }, r.prototype.updatePosition = function(t, e) {
  16116. if (!this.hidden) {
  16117. if (!e) return this.hide();
  16118. var i = e.point,
  16119. n = t.distanceTo(i),
  16120. r = 1 + .01 * n;
  16121. n < 1 && (r -= 1 - n), this.show(), this.scale.set(r, r, r), this.direction = this.direction.multiplyScalar(.8), this.direction.add(e.face.normal.clone()
  16122. .multiplyScalar(.2)), this.position.copy(i)
  16123. .add(e.face.normal.clone()
  16124. .multiplyScalar(.01)), this.pObject.position.copy(this.position), this.buildPole(e), this.lookAt(this.position.clone()
  16125. .add(this.direction))
  16126. }
  16127. }, r.prototype.buildPole = function(t) {
  16128. f[0] = f[1] = f[2] = 0, f[3] = t.face.normal.x, f[4] = t.face.normal.y, f[5] = t.face.normal.z;
  16129. var e = new o.Vector3(f[3], f[4], f[5]);
  16130. e.normalize()
  16131. .multiplyScalar(.5), f[3] = e.x, f[4] = e.y, f[5] = e.z, p.addAttribute("position", new THREE.BufferAttribute(f, 3))
  16132. }, r.prototype.writeAsMattertag = function() {
  16133. var t = Math.floor(4294967296 * (1 + Math.random()))
  16134. .toString(16) + Math.floor(16 * (1 + Math.random()))
  16135. .toString(16),
  16136. e = new Date;
  16137. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  16138. var i = {
  16139. enabled: !0,
  16140. version: "0",
  16141. created: e.toISOString(),
  16142. created_by: "APITest",
  16143. position: this.position.clone(),
  16144. stem: {
  16145. enabled: a.mattertags.pole.enabled,
  16146. direction: this.direction.multiplyScalar(a.mattertags.pole.height)
  16147. },
  16148. label: "Mattertag " + this.tagCount,
  16149. description: "Description " + t,
  16150. floor: function(t) {
  16151. if (t.currentFloor) {
  16152. var e = t.floors.indexOf(t.currentFloor);
  16153. return e > -1 ? e : void 0
  16154. }
  16155. }(this.player.model),
  16156. type: "info",
  16157. metadata: {
  16158. preferred_camera: {
  16159. mode: this.player.mode
  16160. }
  16161. }
  16162. },
  16163. n = this.player.model.addMattertag(t, i)
  16164. .build();
  16165. n && (n.disc && this.player.mattertagDiscs.push(n.disc), n.visible || n.show(a.mattertags.startup.fadeInDuration))
  16166. }, t.exports = r
  16167. }, function(t, e, i) {
  16168. var n = i(105),
  16169. r = i(3),
  16170. o = "";
  16171. r.detectAndroid() ? o = "android" : r.detectIOS() && (o = "ios");
  16172. var a = function(t) {
  16173. n.call(this, t), this.deviceType = o, this.remoteAccid = void 0 !== t.remoteAccid ? t.remoteAccid : ""
  16174. };
  16175. a.getUserInfo = function(t) {
  16176. var e = null,
  16177. i = setTimeout((function() {
  16178. t()
  16179. }), 200);
  16180. "ios" == o && window.NativeClient ? window.NativeClient.getUserInfo && (e = window.NativeClient.getUserInfo((function(n) {
  16181. e = JSON.parse(n), clearTimeout(i), t(e)
  16182. }))) : "android" == o && window.house365js && window.house365js.getUserInfo && (e = window.house365js.getUserInfo(), e = JSON.parse(e), clearTimeout(i), t(e))
  16183. }, (a.prototype = Object.create(n.prototype))
  16184. .init = function() {
  16185. var t = this;
  16186. if ("android" === this.deviceType) {
  16187. if (!window.house365js) return this.emit("platform", "platform-error"), "platform-error"
  16188. } else if ("ios" === this.deviceType && !window.NativeClient) return this.emit("platform", "platform-error"), "platform-error";
  16189. return window.onData = function(e) {
  16190. t.emit("onData", e)
  16191. }, window.updateChatStatus = function(e) {
  16192. switch (e = parseInt(e)) {
  16193. case 1:
  16194. t.emit("calling");
  16195. break;
  16196. case 2:
  16197. case 3:
  16198. t.emit("onCall", e);
  16199. break;
  16200. case 4:
  16201. t.emit("busy");
  16202. break;
  16203. case 5:
  16204. t.emit("refuse");
  16205. break;
  16206. case 6:
  16207. t.emit("timeout");
  16208. break;
  16209. case 7:
  16210. case 8:
  16211. t.emit("hangup");
  16212. break;
  16213. case 9:
  16214. t.emit("voice_error")
  16215. }
  16216. }, this
  16217. }, a.prototype.sendData = function(t) {
  16218. "ios" == this.deviceType ? window.NativeClient.sendData && window.NativeClient.sendData(t) : "android" == this.deviceType && window.house365js.sendData && window.house365js.sendData(t)
  16219. }, a.prototype.call = function() {
  16220. "ios" == this.deviceType ? window.NativeClient.call && window.NativeClient.call() : "android" == this.deviceType && window.house365js.call && window.house365js.call()
  16221. }, a.prototype.mute = function() {
  16222. "ios" == this.deviceType ? window.NativeClient.mute && window.NativeClient.mute() : "android" == this.deviceType && window.house365js.mute && window.house365js.mute()
  16223. }, a.prototype.unmute = function() {
  16224. "ios" == this.deviceType ? window.NativeClient.unmute && window.NativeClient.unmute() : "android" == this.deviceType && window.house365js.unmute && window.house365js.unmute()
  16225. }, a.prototype.hangup = function() {
  16226. "ios" == this.deviceType ? window.NativeClient.hangup && window.NativeClient.hangup() : "android" == this.deviceType && window.house365js.hangup && window.house365js.hangup()
  16227. }, a.prototype.refuse = function() {
  16228. "ios" == this.deviceType ? window.NativeClient.refuse && window.NativeClient.refuse() : "android" == this.deviceType && window.house365js.refuse && window.house365js.refuse()
  16229. }, a.prototype.accept = function() {
  16230. "ios" == this.deviceType ? window.NativeClient.accept && window.NativeClient.accept() : "android" == this.deviceType && window.house365js.accept && window.house365js.accept()
  16231. }, a.prototype.urgeBroker = function() {
  16232. "ios" == this.deviceType ? window.NativeClient.urgeBroker && window.NativeClient.urgeBroker() : "android" == this.deviceType && window.house365js.urgeBroker && window.house365js.urgeBroker()
  16233. }, t.exports = a
  16234. }, function(t, e, i) {
  16235. var n = i(4)
  16236. .EventEmitter,
  16237. r = function() {
  16238. this.instance = null
  16239. };
  16240. (r.prototype = Object.create(n.prototype))
  16241. .construct = r, r.prototype.init = function() {}, r.prototype.sendData = function(t) {}, r.prototype.call = function() {}, r.prototype.mute = function() {}, r.prototype.unmute = function() {}, r.prototype.hangup = function() {}, r.prototype.refuse = function() {}, r.prototype.accept = function() {}, t.exports = r
  16242. }, function(t, e) {
  16243. t.exports = {
  16244. UNKNOWN: 0,
  16245. ALIGNED: 1,
  16246. UNALIGNED: 2,
  16247. PLACED: 3
  16248. }
  16249. }, function(t, e) {
  16250. t.exports = {
  16251. LoadComplete: "panorama.load.complete",
  16252. LoadFailed: "panorama.load.failed",
  16253. TileLoaded: "panorama.tile.loaded"
  16254. }
  16255. }, function(t, e, i) {
  16256. (function(e) {
  16257. var n = i(22);
  16258. function r(t, e) {
  16259. this.obj3d = null, this.nodes = [], this.colorHull = [], this.shortPaths = {}, this.floorHull = null, this.cameraHull = null, this.floorPathDistance = 0, this.floorCurvePoints = null, this.floorCurveColors = null, this.camCurvePoints = null, this.warpDestHeroLoc = null, this.warpDestPano = null, this.warpPathPoints = null, this.warpPathLengths = [0], this.warpLength = 0, this.closeWarpDistance = 4, this.UP = b.UP.clone(), this.longestStep = 0, this.upcomingTransType = null, this.burnsDir = 1, this.prevNextDist = 0, this.nextI = 0, this.activeTransType = null, this.bunnyObj = null, this.director = t, this.player = e, this.modelManager = e.modelManager, this.updateModel(), this.updateDefaultsFromModelData(), this.bindEvents(), this.warping = !1, this.warpInterrupted = !1, this.warpInterruptionBlackoutStyle = null, this.warpInterruptionTravelTime = null
  16260. }
  16261. var o = i(0),
  16262. a = i(2),
  16263. s = i(5),
  16264. l = i(17),
  16265. u = i(24),
  16266. h = i(1),
  16267. c = i(9),
  16268. d = i(10),
  16269. p = i(15),
  16270. f = i(8),
  16271. m = i(57),
  16272. g = i(59),
  16273. v = i(12),
  16274. y = i(16),
  16275. b = i(18),
  16276. w = (a = (i(60), new a(e)), i(20)),
  16277. x = i(31),
  16278. M = i(21),
  16279. T = {
  16280. path: y.loadurl(n.splitUrl("./images/texture/location/location_512x512.png")),
  16281. pathEnd: y.loadurl(n.splitUrl("./images/texture/location/location_512x512.png")),
  16282. pathStart: y.loadBase64("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==")
  16283. };
  16284. r.prototype.setScene = function(t) {
  16285. this.createCpm(t), this.createBunnyObj(t)
  16286. }, r.prototype.updateModel = function() {
  16287. this.model = this.modelManager.getActiveModel()
  16288. }, r.prototype.bindEvents = function() {
  16289. this.modelManager.on(M.ActiveModelChanged, this.updateModel.bind(this))
  16290. }, r.prototype.updateDefaultsFromModelData = function() {
  16291. this.model.data
  16292. }, r.prototype.pointPathDistance = function(t) {
  16293. for (var e = 0, i = 1; i < t.length; i += 1) e += t[i - 1].distanceTo(t[i]);
  16294. return e
  16295. }, r.prototype.pointPathLengths = function(t) {
  16296. for (var e = [0], i = 1; i < t.length; i += 1) e.push(e[i - 1] + t[i - 1].distanceTo(t[i]));
  16297. return e
  16298. }, r.prototype.interpAlongPath = function(t, e, i) {
  16299. var n, r = new o.Vector3,
  16300. a = e[e.length - 1];
  16301. if (i < 1) {
  16302. n = i * a;
  16303. for (var s = 1; s < e.length; s += 1)
  16304. if (e[s] > n) {
  16305. var l = (n - e[s - 1]) / (e[s] - e[s - 1]);
  16306. return r.copy(t[s]), r.sub(t[s - 1]), r.multiplyScalar(l), r.add(t[s - 1]), r
  16307. }
  16308. } else r.copy(t[t.length - 1]);
  16309. return r
  16310. }, r.prototype.pathHeight = function() {
  16311. return this.player.mode !== s.FLOORPLAN ? h.path.height : h.path.outsideHeight
  16312. }, r.prototype.createBunnyObj = function(t) {
  16313. this.bunnyObj || (this.bunnyObj = new o.AxesHelper(.1), this.bunnyObj.visible = h.warp.showBunny), this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj), t.add(this.bunnyObj)
  16314. }, r.prototype.createCpm = function(t) {
  16315. if (!this.currentPanoMarker) {
  16316. var e = this.makeWaypointObj(T.pathEnd, "Current");
  16317. e.material.uniforms.opacity.value = 0, this.currentPanoMarker = {
  16318. mesh: e,
  16319. placed: !1
  16320. }
  16321. }
  16322. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh), this.placeCpm(), this.currentPanoMarker.mesh.parent || t.add(this.currentPanoMarker.mesh)
  16323. }, r.prototype.placeCpm = function() {
  16324. h.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned() ? (this.currentPanoMarker.mesh.parent != this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh), this.player.currentPano.floor.add(this.currentPanoMarker.mesh)), this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition)
  16325. .sub(this.model.position), this.currentPanoMarker.mesh.position.y += this.pathHeight(), this.currentPanoMarker.placed = !0) : this.popOutCpm()
  16326. }, r.prototype.fadeInCpm = function(t) {
  16327. this.player.mode === s.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || h.path.mapGuides && this.currentPanoMarker.placed && f.start(d.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), t)
  16328. }, r.prototype.fadeOutCpm = function(t) {
  16329. f.start(d.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), t)
  16330. }, r.prototype.popInCpm = function() {
  16331. h.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  16332. }, r.prototype.popOutCpm = function() {
  16333. this.fadeOutCpm(2)
  16334. }, r.prototype.brushPrefs = {
  16335. linewidth: 7,
  16336. strokeWidth: 15,
  16337. cvSegments: 48,
  16338. paveStep: .1,
  16339. paveWidth: .2,
  16340. lookBlendDist: 3,
  16341. maxTurn: o.Math.degToRad(2)
  16342. }, r.prototype.panoPathDistance = function(t) {
  16343. var e = this.model.panos;
  16344. if (!t || t.length < 2) return 0;
  16345. for (var i = [], n = 0; n < t.length; n += 1) i.push(e.get(t[n])
  16346. .floorPosition);
  16347. return this.pointPathDistance(i)
  16348. }, r.prototype.loadTileTexture = function(t) {
  16349. var e = y.load(t, (function(e) {
  16350. e.wrapS = o.RepeatWrapping, e.wrapT = o.RepeatWrapping, e.needsUpdate = !0, a.debug('path texture "' + t + '" is ready')
  16351. }), (function() {
  16352. a.error('path texture "' + t + '" failed')
  16353. }));
  16354. return e.mapping = o.UVMapping, e
  16355. }, r.prototype.buildWarpDestinationDescriptor = function(t, e, i, n, r, o) {
  16356. return new m({
  16357. cameraMode: n,
  16358. position: t,
  16359. quaternion: e,
  16360. panoId: i,
  16361. orthoZoom: o,
  16362. floorVisibility: r,
  16363. thumbUrl: null,
  16364. name: null,
  16365. isHero: !1
  16366. })
  16367. }, r.prototype.buildWarpDestinationDescriptorFromHero = function(t) {
  16368. return this.buildWarpDestinationDescriptor(t.position, t.quaternion, this.getHeroId(t), t.cameraMode, t.floorVisibility, t.orthoZoom)
  16369. }, r.prototype.setWarpDestination = function(t) {
  16370. this.warpDestHeroLoc = t
  16371. }, r.prototype.setWarpDestinationByHeroIndex = function(t) {
  16372. var e = this.getHeroDescriptorByHeroIndex(t);
  16373. return null !== e && (this.setWarpDestination(e), !0)
  16374. }, r.prototype.setWarpDestinationByPano = function(t, e) {
  16375. return !!this.model.panos.get(t.id) && this.setWarpDestinationByPanoId(t.id, e)
  16376. }, r.prototype.setWarpDestinationByPanoId = function(t, e) {
  16377. var i = this.model.panos.get(t);
  16378. if (i) {
  16379. e = e || new o.Quaternion;
  16380. var n = this.buildWarpDestinationDescriptor(i.position, e, i.id, "panorama", [], -1);
  16381. return this.setWarpDestination(n), !0
  16382. }
  16383. return !1
  16384. }, r.prototype.getHeroDescriptorByHeroIndex = function(t) {
  16385. var e = this.model.heroCount();
  16386. if (null !== this.warpDestHeroLoc && e < 2) return a.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."), this.model.getHeroDescriptorByIndex(0);
  16387. var i = this.model.getHeroDescriptorByIndex(t);
  16388. if (i) {
  16389. var n = i.isPano() ? i.panoId : i.cameraMode;
  16390. a.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + e + " choices.")
  16391. }
  16392. return i
  16393. }, r.prototype.getHeroDescriptorByPano = function(t) {
  16394. return this.model.panos.get(t.id) ? this.getHeroDescriptorByPanoId(t.id) : null
  16395. }, r.prototype.getHeroDescriptorByPanoId = function(t) {
  16396. var e = this.getHeroIndexFromPanoId(t);
  16397. return this.getHeroDescriptorByHeroIndex(e)
  16398. }, r.prototype.getHeroIndexFromPanoId = function(t) {
  16399. for (var e = 0; e < this.model.heroLocations.length; e++) {
  16400. var i = this.model.heroLocations[e],
  16401. n = this.getHeroId(i);
  16402. if (n && n === t) return e
  16403. }
  16404. return -1
  16405. }, r.prototype.getHeroPano = function(t) {
  16406. if (null === t) return a.warn("getHeroPano(): no destination"), null;
  16407. var e = this.getHeroId(t),
  16408. i = this.model.panos.get(e);
  16409. return void 0 === i && (i = null, "" !== e && a.debug('unable to find pano "' + e + '"')), i
  16410. }, r.prototype.getHeroId = function(t) {
  16411. return t.panoId
  16412. }, r.prototype.setWarpDestPano = function() {
  16413. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc), this.warpDestPano
  16414. }, r.prototype.brushToWarpPano = function(t, e) {
  16415. if (this.discardPathObject(), !this.setWarpDestPano()) return !1;
  16416. if (this.warpDestHeroLoc.cameraMode !== s.PANORAMA && a.warn("Can only brush from pano to pano"), !this.warpDestPano) return a.info("No brush"), !1;
  16417. if (!this.player.currentPano) return a.debug("No current pano, visibility undefined"), !1;
  16418. if (!this.warpDestPano) return a.info("No wPano, visibility undefined"), !1;
  16419. if (!this.warpDestPano.isAligned()) return a.debug("Cannot brush to unaligned pano"), !1;
  16420. var i = (t === u.STD || t === u.WALK) && h.path.mapGuides,
  16421. n = !0;
  16422. if (this.player.currentPano.id === this.warpDestPano.id) a.debug("Already at destination pano");
  16423. else {
  16424. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano), n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1, this.obj3d = new o.Object3D, a.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"), n ? (a.info('No "walkable" route, using fall-back warp style transition'), t = e) : (this.setPathHulls(this.nodes), this.setFloorCurves(), i && ("chevron" === h.path.style ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints)) : "ribbon" === h.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))), this.player.currentPano.floor.add(this.obj3d);
  16425. var r = this.player.mode === s.DOLLHOUSE || this.player.mode === s.FLOORPLAN,
  16426. l = t === u.STD;
  16427. if (!n && (i || l)) {
  16428. if (r) {
  16429. var c = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  16430. this.obj3d.add(c)
  16431. }
  16432. var d = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  16433. this.obj3d.add(d)
  16434. }
  16435. this.appearSlow()
  16436. }
  16437. return this.upcomingTransType = t, !n
  16438. }, r.prototype.findShortestPath = function(t, e) {
  16439. if (!t || !e) return null;
  16440. var i = h.warp.walkExtraPanosDistance,
  16441. n = t.id + ":" + e.id + ":" + i;
  16442. if (this.shortPaths.hasOwnProperty(n)) return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  16443. var r = e.id + ":" + t.id + ":" + i;
  16444. if (this.shortPaths.hasOwnProperty(r)) return this.shortPaths[r] ? this.shortPaths[r].slice()
  16445. .reverse() : null;
  16446. var o = this.model.panos.aStarSearch(t, e);
  16447. return this.model.panos.includeNodesNearPath(o, i), this.shortPaths[n] = o ? o.slice() : null, o
  16448. }, r.prototype.makePathHulls = function(t) {
  16449. var e, i, n, r, o, s = 0,
  16450. l = [],
  16451. u = [],
  16452. c = [],
  16453. d = this.model.panos;
  16454. r = (e = d.get(t[0]))
  16455. .floor.floorIndex;
  16456. for (var p = 0; p < t.length; p += 1)(i = (e = d.get(t[p]))
  16457. .floorPosition.clone()
  16458. .sub(this.model.position))
  16459. .y += this.pathHeight(), l.push(i), u.push(e.position.clone()), n = e.floor.floorIndex, c.push(n > r ? h.path.colorUp : n < r ? h.path.colorDown : h.path.color), p > 0 && ((o = u[p].distanceTo(u[p - 1])) > s && (s = o));
  16460. return s > this.longestStep && (this.longestStep = s, a.debug("path contains " + s + " meter segment")), {
  16461. floor: l,
  16462. camera: u,
  16463. color: c
  16464. }
  16465. }, r.prototype.makeFloorCurves = function(t, e, i) {
  16466. var n = this.player.mode === s.PANORAMA ? h.path.waypointIndoorRadius : h.path.waypointRadius,
  16467. r = this.pointPathDistance(t) - 2 * n,
  16468. a = t.slice(0),
  16469. l = a[1].clone()
  16470. .sub(a[0]);
  16471. l.y = 0, l.normalize()
  16472. .multiplyScalar(n), a[0] = (new o.Vector3)
  16473. .copy(a[0])
  16474. .add(l), (l = a[a.length - 2].clone()
  16475. .sub(a[a.length - 1]))
  16476. .y = 0, l.normalize()
  16477. .multiplyScalar(n), a[a.length - 1] = (new o.Vector3)
  16478. .copy(a[a.length - 1])
  16479. .add(l);
  16480. var u = new o.CatmullRomCurve3(a),
  16481. c = Math.floor(r / i);
  16482. c = 4 * Math.floor(c / 4), c = Math.max(4, c);
  16483. for (var d, p, f = u.getSpacedPoints(c), m = [], g = new o.Vector3, v = 0; v < f.length; v += 1) {
  16484. p = 0, d = f[v].distanceTo(t[0]);
  16485. for (var y = 1; y < t.length; y += 1) g.copy(f[v])
  16486. .sub(t[y]), g.y *= 4, g.length() < d && (p = y);
  16487. m.push(e[p])
  16488. }
  16489. return {
  16490. distance: r,
  16491. points: f,
  16492. colors: m
  16493. }
  16494. }, r.prototype.makeCameraCurvePoints = function(t, e) {
  16495. var i = this.pointPathDistance(t);
  16496. return new o.CatmullRomCurve3(t)
  16497. .getSpacedPoints(Math.max(2, Math.floor(i / e)))
  16498. }, r.prototype.makeCameraCurveTangents = function(t, e) {
  16499. var i = this.pointPathDistance(t),
  16500. n = new o.CatmullRomCurve3(t),
  16501. r = Math.max(2, Math.floor(i / e));
  16502. r || (r = 5);
  16503. for (var a = [], s = 0; s <= r; s++) a.push(n.getTangentAt(s / r));
  16504. return a
  16505. }, r.prototype.setPathHulls = function(t) {
  16506. var e = this.makePathHulls(t);
  16507. this.floorHull = e.floor, this.cameraHull = e.camera, this.colorHull = e.color
  16508. }, r.prototype.setFloorCurves = function() {
  16509. var t = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  16510. this.floorPathDistance = t.distance, this.floorCurvePoints = t.points, this.floorCurveColors = t.colors
  16511. }, r.prototype.setCameraCurvePoints = function() {
  16512. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, h.warp.stepFactor * this.brushPrefs.paveStep)
  16513. }, r.prototype.chooseWarpPath = function(t) {
  16514. var e, i, n, r = this.player.cameras[s.PANORAMA];
  16515. if (this.player.currentPano === this.warpDestPano || !t) return this.warpPathPoints = null, this.warpLength = 0, !1;
  16516. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano), void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (a.debug("warp path to unreachable node"), i = (e = this.warpDestPano.position.clone()
  16517. .sub(r.position))
  16518. .clone()
  16519. .negate(), e.multiplyScalar(.15)
  16520. .add(r.position), i.multiplyScalar(.15)
  16521. .add(this.warpDestPano.position), e.y = r.position.y, i.y = this.warpDestPano.position.y, n = new o.CubicBezierCurve3(r.position.clone(), e, i, this.warpDestPano.position.clone()), this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (a.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"), this.setCameraCurvePoints(), this.warpPathPoints = this.camCurvePoints.slice(0)), this.warpLength = 0, this.warpPathLengths = [0];
  16522. for (var l = new o.Vector3, u = new o.Vector3, c = Math.cos(o.Math.degToRad(h.warp.minBrakeAngle)), d = Math.cos(o.Math.degToRad(h.warp.maxBrakeAngle)), p = 1; p < this.warpPathPoints.length; p += 1) {
  16523. l.copy(this.warpPathPoints[p - 1])
  16524. .sub(this.warpPathPoints[p]);
  16525. var f = l.length();
  16526. l.y *= h.warp.climbEffort;
  16527. var m = l.length() / f;
  16528. if (p > 1) {
  16529. l.setY(0)
  16530. .normalize(), u.copy(this.warpPathPoints[p - 2])
  16531. .sub(this.warpPathPoints[p - 1])
  16532. .setY(0)
  16533. .normalize();
  16534. var g = Math.min(1, l.dot(u)),
  16535. v = 1 + (h.warp.brakeStrength - 1) * (1 - o.Math.smoothstep(g, d, c));
  16536. m = Math.max(v, m)
  16537. }
  16538. this.warpLength += f * m, this.warpPathLengths[p] = this.warpLength
  16539. }
  16540. return !0
  16541. }, r.prototype.drawPathRibbon = function(t, e) {
  16542. this.bunnyObj.visible = h.warp.showBunny;
  16543. for (var i = .6 * h.path.ribbonWidth * .5, n = new o.Vector3, r = new o.Vector3(0, this.pathHeight(), 0), a = new o.Geometry, u = new o.Vector3, c = 0; c < t.length; c += 1) {
  16544. u.copy(t[c]), 0 === c ? u.sub(t[c + 1]) : u.sub(t[c - 1])
  16545. .negate(), u.normalize(), n.crossVectors(u, b.UP), n.multiplyScalar(i);
  16546. var d = (new o.Vector3)
  16547. .copy(t[c])
  16548. .add(r);
  16549. d.sub(n), a.vertices.push(d), (d = (new o.Vector3)
  16550. .copy(t[c])
  16551. .add(r))
  16552. .add(n), a.vertices.push(d)
  16553. }
  16554. var p, f, m, g = 0;
  16555. for (c = 0; c < t.length - 1; c += 1) {
  16556. var y = 2 * c,
  16557. w = g,
  16558. x = g += t[c + 1].distanceTo(t[c]),
  16559. M = e[c],
  16560. S = e[c + 1];
  16561. (p = new o.Face3(y, y + 1, y + 2))
  16562. .vertexColors = [new o.Color(M), new o.Color(M), new o.Color(S)], a.faces.push(p), a.faceVertexUvs[0].push([new o.Vector2(0, w), new o.Vector2(1, w), new o.Vector2(0, x)]), (p = new o.Face3(y + 2, y + 1, y + 3))
  16563. .vertexColors = [new o.Color(S), new o.Color(M), new o.Color(S)], a.faces.push(p), a.faceVertexUvs[0].push([new o.Vector2(0, x), new o.Vector2(1, w), new o.Vector2(1, x)])
  16564. }
  16565. a.computeFaceNormals(), a.computeVertexNormals(), this.player.mode === s.PANORAMA ? ((m = o.UniformsUtils.clone(v.ribbon.uniforms))
  16566. .map.value = T.path, m.opacity.value = 0, m.color.value.set(h.path.color), f = new o.RawShaderMaterial({
  16567. side: o.DoubleSide,
  16568. depthWrite: !1,
  16569. transparent: !0,
  16570. vertexShader: v.ribbon.vertexShader,
  16571. fragmentShader: v.ribbon.fragmentShader,
  16572. uniforms: m,
  16573. name: "ribbonT",
  16574. opacity: 0
  16575. })) : f = new o.MeshBasicMaterial({
  16576. color: 16777215,
  16577. side: o.DoubleSide,
  16578. name: "ribbonOut",
  16579. vertexColors: o.VertexColors
  16580. });
  16581. var _ = new o.Mesh(a, f);
  16582. return _.name = "ribbon", this.player.mode === s.PANORAMA && (_.renderOrder = l.ribbon), _
  16583. }, r.prototype.drawPathPavement = function(t) {
  16584. for (var e, i = new o.Vector3, n = new o.Geometry, r = new o.Vector3, a = 0; a < t.length; a += 1) r.copy(t[a]), 0 === a ? r.sub(t[a + 1])
  16585. .negate() : r.sub(t[a - 1]), r.normalize(), i.crossVectors(r, b.UP), i.multiplyScalar(this.brushPrefs.paveWidth), (e = (new o.Vector3)
  16586. .copy(t[a]))
  16587. .sub(i), n.vertices.push(e), n.vertices.push((new o.Vector3)
  16588. .copy(t[a])), (e = (new o.Vector3)
  16589. .copy(t[a]))
  16590. .add(i), n.vertices.push(e);
  16591. var l, u, c;
  16592. for (a = 0; a < t.length - 1; a += 1) l = 3 * a + 1, c = (u = .25 * a) + .25, n.faces.push(new o.Face3(l - 1, l, l + 3)), n.faceVertexUvs[0].push([new o.Vector2(0, u), new o.Vector2(.5, u), new o.Vector2(.5, c)]), n.faces.push(new o.Face3(l + 3, l + 2, l - 1)), n.faceVertexUvs[0].push([new o.Vector2(.5, c), new o.Vector2(0, c), new o.Vector2(0, u)]), n.faces.push(new o.Face3(l + 3, l, l + 1)), n.faceVertexUvs[0].push([new o.Vector2(.5, c), new o.Vector2(.5, u), new o.Vector2(1, u)]), n.faces.push(new o.Face3(l + 3, l + 1, l + 4)), n.faceVertexUvs[0].push([new o.Vector2(.5, c), new o.Vector2(1, u), new o.Vector2(1, c)]);
  16593. var d = this.player.mode === s.PANORAMA ? new o.MeshBasicMaterial({
  16594. color: h.path.color,
  16595. side: o.DoubleSide,
  16596. transparent: !0,
  16597. depthWrite: !1,
  16598. opacity: 0,
  16599. name: "paveT",
  16600. map: T.path
  16601. }) : new o.MeshBasicMaterial({
  16602. color: h.path.color,
  16603. side: o.DoubleSide,
  16604. transparent: !0,
  16605. depthWrite: !1,
  16606. opacity: 1,
  16607. name: "paveO",
  16608. map: T.path
  16609. });
  16610. return new o.Mesh(n, d)
  16611. }, r.prototype.hintPrefs = {
  16612. rad: .18,
  16613. width: .0125,
  16614. depth: .0625,
  16615. setBack: -.04,
  16616. markRad: .25,
  16617. markInnerRad: .16
  16618. }, r.prototype.makeWaypointObj = function(t, e) {
  16619. var i = new o.Geometry,
  16620. n = this.player.mode === s.PANORAMA ? h.path.waypointIndoorRadius : h.path.waypointRadius,
  16621. r = this.pathHeight();
  16622. i.vertices.push(new o.Vector3(-n, r, n), new o.Vector3(-n, r, -n), new o.Vector3(n, r, -n), new o.Vector3(n, r, n)), i.faces.push(new o.Face3(0, 1, 2), new o.Face3(2, 3, 0)), i.faceVertexUvs[0].push([new o.Vector2(0, 0), new o.Vector2(1, 0), new o.Vector2(1, 1)]), i.faceVertexUvs[0].push([new o.Vector2(1, 1), new o.Vector2(0, 1), new o.Vector2(0, 0)]);
  16623. var a = o.UniformsUtils.clone(v.waypoint.uniforms);
  16624. a.map.value = t, a.opacity.value = 0, a.color.value.set(h.path.color);
  16625. var l = {
  16626. side: o.DoubleSide,
  16627. depthWrite: !1,
  16628. transparent: !0,
  16629. vertexShader: v.waypoint.vertexShader,
  16630. fragmentShader: v.waypoint.fragmentShader,
  16631. uniforms: a,
  16632. name: "waypoint",
  16633. opacity: 0
  16634. };
  16635. this.player.mode !== s.PANORAMA && (l.depthTest = !1, l.name = "wayPtOut");
  16636. var u = new o.RawShaderMaterial(l),
  16637. c = new o.Mesh(i, u);
  16638. return c.name = e, c
  16639. }, r.prototype.makeStartMarker = function(t, e) {
  16640. var i = (new o.Vector3)
  16641. .copy(e[1])
  16642. .sub(e[0]);
  16643. i.y = 0, i.normalize();
  16644. var n = Math.acos(i.x),
  16645. r = this.makeWaypointObj(T.pathStart, "Start");
  16646. return r.rotateOnAxis(new o.Vector3(0, 1, 0), n), r.position.copy(t), r
  16647. }, r.prototype.makeEndMarker = function(t) {
  16648. var e = this.makeWaypointObj(T.pathEnd, "End"),
  16649. i = this.model.panos.get(this.nodes[0])
  16650. .floor.floorIndex,
  16651. n = this.model.panos.get(this.nodes[this.nodes.length - 1])
  16652. .floor.floorIndex;
  16653. return i < n ? e.material.uniforms.color.value.set(h.path.colorUp) : i > n && e.material.uniforms.color.value.set(h.path.colorDown), e.position.copy(t), e
  16654. }, r.prototype.pathClean = function(t) {
  16655. if (t) {
  16656. for (var e in t.children) this.pathClean(t.children[e]);
  16657. t.geometry && t.geometry.dispose(), t.material && t.material.dispose()
  16658. }
  16659. }, r.prototype.discardPathObject = function() {
  16660. if (this.obj3d) {
  16661. var t = this.obj3d.parent;
  16662. t && t.remove(this.obj3d), this.pathClean(this.obj3d)
  16663. }
  16664. this.obj3d = null, this.popInCpm()
  16665. }, r.prototype.discardSlow = function() {
  16666. if (this.obj3d) {
  16667. if (this.player.mode !== s.PANORAMA) return void this.discardPathObject();
  16668. for (var t, e = 0, i = function() {
  16669. this.discardPathObject()
  16670. }.bind(this), n = 0; n < this.obj3d.children.length; n += 1) void 0 !== (t = this.obj3d.children[n])
  16671. .material && !0 === t.material.transparent && (void 0 !== t.material.uniforms ? f.start(d.property(t.material.uniforms.opacity, "value", 0), h.path.fadeOutTime, i, 0, p[h.warp.blendEasing]) : f.start(d.property(t.material, "opacity", 0), h.path.fadeOutTime, i, 0, p[h.warp.blendEasing]), e += 1, i = null);
  16672. 0 === e && this.discardPathObject(), this.player.mode !== s.PANORAMA && this.fadeInCpm(h.path.fadeInTime - 3)
  16673. }
  16674. }, r.prototype.appearSlow = function() {
  16675. var t;
  16676. this.fadeOutCpm(h.path.fadeInTime);
  16677. for (var e = this.player.mode === s.PANORAMA ? h.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1) void 0 !== (t = this.obj3d.children[i])
  16678. .material && !0 === t.material.transparent && (void 0 !== t.material.uniforms ? f.start(d.property(t.material.uniforms.opacity, "value", e), h.path.fadeInTime, null, 0, p[h.warp.blendEasing]) : f.start(d.property(t.material, "opacity", e), h.path.fadeInTime, null, 0, p[h.warp.blendEasing]))
  16679. }, r.prototype.update = function() {
  16680. this.obj3d && this.obj3d.updateMatrixWorld()
  16681. }, r.prototype.calcBurnsAmount = function(t) {
  16682. var e = o.Math.degToRad(h.warp.burnsAngle);
  16683. if (this.player.mode === s.PANORAMA) {
  16684. var i = this.burnsDir * e;
  16685. if (this.upcomingTransType === u.BLACK) return i;
  16686. var n = t;
  16687. if (null === n) return a.warn("Transition request for non-highlight"), i;
  16688. var r = this.getHeroDescriptorByHeroIndex(n);
  16689. if (null === r) return i;
  16690. if (!r.isPano()) return i;
  16691. var l = this.getHeroPano(r),
  16692. c = this.player.cameras[s.PANORAMA],
  16693. d = b.FORWARD.clone()
  16694. .applyQuaternion(c.quaternion)
  16695. .setY(0)
  16696. .normalize(),
  16697. p = Math.min(o.Math.degToRad(h.warp.minBurnsAngle), e),
  16698. f = function(t) {
  16699. var i = Math.acos(Math.min(1, t.dot(d))),
  16700. n = (new o.Vector3)
  16701. .crossVectors(d, t);
  16702. return Math.max(p, Math.min(Math.abs(i), e)) * Math.sign(n.y)
  16703. };
  16704. if (l == this.player.currentPano) return f(b.FORWARD.clone()
  16705. .applyQuaternion(r.quaternion)
  16706. .setY(0)
  16707. .normalize());
  16708. var m = this.findShortestPath(this.player.currentPano, l);
  16709. if (null == m || m.length < 1) return a.debug("Empty path ahead..."), i;
  16710. var g = this.makePathHulls(m),
  16711. v = new o.CatmullRomCurve3(g.camera),
  16712. y = Math.min(.1, h.warp.lookAheadDist / v.getLength());
  16713. return f(v.getPointAt(y)
  16714. .clone()
  16715. .sub(c.position)
  16716. .setY(0)
  16717. .normalize())
  16718. }
  16719. if (this.player.mode === s.DOLLHOUSE) {
  16720. var w = this.player.cameras[s.DOLLHOUSE];
  16721. return this.burnsDir * Math.min(w.controls.rotationAcceleration.x + .05, .02)
  16722. }
  16723. return this.burnsDir
  16724. }, r.prototype.waitNextStep = function(t, e) {
  16725. var i = new o.Euler,
  16726. n = new o.Vector3;
  16727. if (a.debug("Starting wait: " + (void 0 !== e)), 2 === this.player.currentPano.alignmentType) var r = Math.PI / 8,
  16728. l = h.warp.tourStepDelay * h.warp.waitMultiplier1;
  16729. else r = this.calcBurnsAmount(t), l = h.warp.tourStepDelay;
  16730. var u = function() {
  16731. this.endWarpState(), this.player.mode === s.DOLLHOUSE && (this.player.cameras[s.DOLLHOUSE].controls.rotationAcceleration.x = 0), e && e()
  16732. }.bind(this),
  16733. c = function(t, e) {
  16734. if (this.warpInterrupted) return u(), !0;
  16735. var o = e || 1e3 / 60;
  16736. if (h.warp.doBurns)
  16737. if (this.player.mode === s.PANORAMA) {
  16738. var a = this.player.cameras[s.PANORAMA];
  16739. i.setFromQuaternion(a.quaternion, h.warp.eOrder);
  16740. var l = h.warp.waitMultiplier2 * o * r / h.warp.tourStepDelay;
  16741. i.y += l, n.set(0, 0, -1), n.applyEuler(i), n.add(a.position), a.controls.lookAt(n), a.controls.lookVector.copy(n), a.lookAt(n)
  16742. } else if (this.player.mode === s.DOLLHOUSE) {
  16743. this.player.cameras[s.DOLLHOUSE].controls.rotationAcceleration.x = r
  16744. } else this.player.controls[s.FLOORPLAN].absoluteScale *= .9996
  16745. }.bind(this);
  16746. this.startWarpState(), f.start(c, l, u, 0, p.easeInOutQuad, "wait")
  16747. }, r.prototype.warpToNonPano = function(t) {
  16748. if (this.discardPathObject(), this.warpDestHeroLoc.cameraMode === s.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === s.FLOORPLAN) {
  16749. var e = function() {
  16750. t && t()
  16751. }.bind(this);
  16752. this.player.flyToNewMode({
  16753. mode: this.warpDestHeroLoc.cameraMode,
  16754. duration: h.warp.outsideTime,
  16755. warpDest: this.warpDestHeroLoc,
  16756. callback: e,
  16757. force: !0
  16758. })
  16759. } else a.warn("no warp destination!!!"), t && t()
  16760. }, r.prototype._resetWarpShaderParams = function(t) {
  16761. this.player.mode === s.PANORAMA && (void 0 !== t.material.uniforms.blackout && (t.material.uniforms.blackout.value = 0), void 0 !== t.material.uniforms.modelAlpha && (t.material.uniforms.modelAlpha.value = 0))
  16762. }, r.prototype._clearWarpShading = function() {
  16763. for (var t = this.model.chunks, e = 0; e < t.length; e += 1) this._resetWarpShaderParams(t[e]), t[e].visible = !0;
  16764. this._resetWarpShaderParams(this.model.skybox)
  16765. }, r.prototype._warpStopFlying = function() {
  16766. this.activeTransType = null, this.placeCpm()
  16767. }, r.prototype._wrapupTravelOnlyBits = function() {
  16768. this._warpStopFlying(), this.warpPathPoints && (this.player.currentPano.exit(), this.warpDestPano.enter(), this.player.currentPano = this.warpDestPano), this.player.spider.draw(), this.placeCpm()
  16769. }, r.prototype._wrapupTravel = function(t) {
  16770. this._wrapupTravelOnlyBits(), this.warpCameraAim(t)
  16771. }, r.prototype._wrapupWarpShading = function(t) {
  16772. this._clearWarpShading(), this._wrapupTravel(t)
  16773. }, r.prototype.wrapupWarpShadingOnly = function(t, e) {
  16774. e !== x.END && this._clearWarpShading(), this._wrapupTravelOnlyBits(), this.upcomingTransType = null, t && t()
  16775. }, r.prototype._warpCameraAim = function(t, e) {
  16776. var i = this.warpDestHeroLoc.quaternion,
  16777. n = this.warpDestHeroLoc;
  16778. n && 2 == n.cameraType && G.model.panos.forEach((function(t) {
  16779. t.id == n.panoId && (i = t.quaternionAutoScene)
  16780. }));
  16781. var r = this.player.cameras[s.PANORAMA],
  16782. l = new o.Vector3(0, 0, 1)
  16783. .applyQuaternion(i)
  16784. .normalize(),
  16785. u = new o.Vector3(0, 0, 1)
  16786. .applyQuaternion(r.quaternion)
  16787. .normalize()
  16788. .dot(l),
  16789. d = o.Math.radToDeg(Math.acos(u)),
  16790. m = new o.Euler(0, 0, 0, h.warp.eOrder)
  16791. .setFromQuaternion(i, h.warp.eOrder),
  16792. g = (new o.Euler)
  16793. .setFromQuaternion(r.quaternion, h.warp.eOrder),
  16794. v = new o.Euler(m.x - g.x, m.y - g.y, m.z - g.z, h.warp.eOrder);
  16795. v.y = c.constrainedTurn(v.y), this.burnsDir = Math.sign(v.y);
  16796. var y = new o.Euler(0, 0, 0, h.warp.eOrder),
  16797. b = new o.Vector3,
  16798. w = function(t, e) {
  16799. return this.warpInterrupted ? void 0 : (y.x = g.x + t * v.x, y.y = g.y + t * v.y, y.z = g.z + t * v.z, b.set(0, 0, -1), b.applyEuler(y), b.add(r.position), r.controls.lookAt(b), r.controls.lookVector.copy(b), r.lookAt(b))
  16800. }.bind(this);
  16801. return d > h.warp.minRotation ? f.start(w, t, e, 0, p[h.warp.movementEasing]) : (a.debug("Aim angle only is " + d.toPrecision(3) + " degrees, skipping explicit re-aim"), void(e && e()))
  16802. }, r.prototype._warpBendAim = function(t, e, i, n) {
  16803. var r = n || 0,
  16804. a = this.player.cameras[s.PANORAMA],
  16805. l = new o.Euler(0, 0, 0, h.warp.eOrder)
  16806. .setFromQuaternion(this.warpDestHeroLoc.quaternion, h.warp.eOrder),
  16807. u = (new o.Euler)
  16808. .setFromQuaternion(a.quaternion, h.warp.eOrder),
  16809. d = new o.Euler(l.x - u.x, l.y - u.y, l.z - u.z, h.warp.eOrder);
  16810. d.y = c.constrainedTurn(d.y);
  16811. var m = Math.min(o.Math.degToRad(h.warp.softBendTilt), Math.abs(d.x));
  16812. d.x = m * Math.sign(d.x), m = Math.min(o.Math.degToRad(Math.max(0, h.warp.softBendAngle)), m), this.burnsDir = Math.sign(d.y), m *= Math.sign(d.y), d.y = m;
  16813. var g = new o.Euler(0, 0, 0, h.warp.eOrder),
  16814. v = new o.Vector3,
  16815. y = function(t, e) {
  16816. if (t < .5) g.x = u.x + t * d.x, g.y = u.y + t * d.y, g.z = u.z + t * d.z;
  16817. else {
  16818. var i = (1 - t) * h.warp.softBendEnd;
  16819. g.x = l.x - i * d.x, g.y = l.y - i * d.y, g.z = l.z - i * d.z
  16820. }
  16821. v.set(0, 0, -1), v.applyEuler(g), v.add(a.position), a.controls.lookAt(v), a.controls.lookVector.copy(v), a.lookAt(v)
  16822. }.bind(this);
  16823. return f.start(y, e, i, r, p[h.warp.movementEasing])
  16824. }, r.prototype._warpStepCameraAim = function(t, e, i) {
  16825. var n = this.player.cameras[s.PANORAMA],
  16826. r = new o.Euler(0, 0, 0, h.warp.eOrder)
  16827. .setFromQuaternion(this.warpDestHeroLoc.quaternion, h.warp.eOrder),
  16828. a = (new o.Euler)
  16829. .setFromQuaternion(n.quaternion, h.warp.eOrder),
  16830. l = new o.Euler(r.x - a.x, r.y - a.y, r.z - a.z, h.warp.eOrder);
  16831. l.y = c.constrainedTurn(l.y), this.burnsDir = Math.sign(l.y);
  16832. var u = new o.Euler(0, 0, 0, h.warp.eOrder),
  16833. d = new o.Vector3,
  16834. m = function(t, e) {
  16835. t < .5 ? u.copy(a) : u.copy(r), d.set(0, 0, -1), d.applyEuler(u), d.add(n.position), n.controls.lookAt(d), n.controls.lookVector.copy(d), n.lookAt(d)
  16836. }.bind(this);
  16837. return f.start(m, e, i, 0, p[h.warp.movementEasing])
  16838. }, r.prototype.setBurnsDir = function() {
  16839. var t = this.player.cameras[s.PANORAMA],
  16840. e = new o.Euler(0, 0, 0, h.warp.eOrder)
  16841. .setFromQuaternion(this.warpDestHeroLoc.quaternion, h.warp.eOrder),
  16842. i = (new o.Euler)
  16843. .setFromQuaternion(t.quaternion, h.warp.eOrder),
  16844. n = new o.Euler(e.x - i.x, e.y - i.y, e.z - i.z, h.warp.eOrder);
  16845. n.y = c.constrainedTurn(n.y), this.burnsDir = Math.sign(n.y)
  16846. }, r.prototype.stepWarpPath = function(t, e) {
  16847. var i = this.player.cameras[s.PANORAMA];
  16848. if (!this.warpPathPoints) return i.position.copy(this.warpDestPano.position), !0;
  16849. var n = this.warpPathPoints[0],
  16850. r = this.warpDestPano.position;
  16851. if (null !== this.nodes && this.cameraHull.length > 1) {
  16852. var a = new o.Vector3;
  16853. t < .5 ? a.copy(this.cameraHull[1])
  16854. .sub(n)
  16855. .normalize()
  16856. .multiplyScalar(h.warp.softPushDist * t)
  16857. .add(n) : a.copy(this.cameraHull[this.cameraHull.length - 2])
  16858. .sub(r)
  16859. .normalize()
  16860. .multiplyScalar(h.warp.softPushDist * h.warp.softPushEnd * (1 - t))
  16861. .add(r), i.position.copy(a)
  16862. } else t < .5 ? i.position.copy(n) : i.position.copy(r)
  16863. }, r.prototype.interruptAndFastForward = function(t, e) {
  16864. this.warping && (this.warpInterrupted = !0, this.warpInterruptionBlackoutStyle = t, this.warpInterruptionTravelTime = e, null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = x.MIDDLE), null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = h.minWarpTime))
  16865. }, r.prototype.warpCameraAim = function(t) {
  16866. var e = h.warp.minWarpTime;
  16867. if (this.upcomingTransType === u.BLACK) e = h.warp.teleportTime;
  16868. else {
  16869. var i = this.player.cameras[s.PANORAMA],
  16870. n = new o.Euler(0, 0, 0, h.warp.eOrder)
  16871. .setFromQuaternion(this.warpDestHeroLoc.quaternion, h.warp.eOrder),
  16872. r = (new o.Euler)
  16873. .setFromQuaternion(i.quaternion, h.warp.eOrder),
  16874. a = new o.Euler(n.x - r.x, n.y - r.y, n.z - r.z, h.warp.eOrder);
  16875. a.y = c.constrainedTurn(a.y);
  16876. var l = 1e3 * Math.abs(a.y) / o.Math.degToRad(h.warp.maxAimPerSec);
  16877. e = Math.max(e, l)
  16878. }
  16879. var d = function() {
  16880. this._warpStopFlying(), this.discardSlow(), t && t()
  16881. }.bind(this);
  16882. this._warpCameraAim(e, d)
  16883. }, r.prototype.warpCommonParameters = function(t, e, i, n) {
  16884. this.model.skybox.material.uniforms.blackout.value = n;
  16885. var r = d.uniform(this.model.skybox, "progress", 1),
  16886. o = d.allUniforms(this.model.chunks, "progress", 1),
  16887. a = !1,
  16888. s = function() {
  16889. if (this.warpInterrupted) return a = !0, !0
  16890. }.bind(this),
  16891. l = function(t, e) {
  16892. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0, !0) : void r(t, e)
  16893. }.bind(this),
  16894. u = function(t, e) {
  16895. return i && a ? (o(0), !0) : void o(t, e)
  16896. }.bind(this);
  16897. f.start(s, t, null, e, null, "safeHaltWatch"), f.start(l, t, null, e, p[h.warp.blendEasing], "skyboxProgress"), f.start(u, t, null, e, p[h.warp.blendEasing], "chunkProgress")
  16898. }, r.prototype.warpTravel_STD = function(t) {
  16899. var e, i = Math.min(h.warp.lookAheadMax, h.warp.lookAheadDist / this.warpLength),
  16900. n = this.player.cameras[s.PANORAMA],
  16901. r = (Math.min(.25, 3 / this.warpLength), Math.min(.35, 7 / this.warpLength)),
  16902. l = new o.Euler(0, 0, 0, h.warp.eOrder),
  16903. m = new o.Vector3,
  16904. v = (new o.Euler)
  16905. .setFromQuaternion(n.quaternion, h.warp.eOrder),
  16906. y = (new o.Euler)
  16907. .copy(v),
  16908. w = n.position.clone(),
  16909. M = new o.Matrix4,
  16910. T = new o.Euler,
  16911. S = h.warp.minWarpTime;
  16912. S += this.warpLength * h.warp.timePerMeter, h.warp.flySpeed > .01 && (S = 1e3 * this.warpLength / h.warp.flySpeed);
  16913. var _ = !1,
  16914. A = this.warpDestHeroLoc.quaternion,
  16915. P = new o.Vector3(0, 0, -1)
  16916. .applyQuaternion(A)
  16917. .normalize(),
  16918. C = this.warpPathPoints[this.warpPathPoints.length - 1].clone()
  16919. .sub(this.warpPathPoints[this.warpPathPoints.length - 2])
  16920. .normalize(),
  16921. E = C.dot(P),
  16922. D = o.Math.radToDeg(Math.acos(E)),
  16923. L = function(t) {
  16924. var e = r;
  16925. return o.Math.smoothstep(t, 0, e) * (1 - o.Math.smoothstep(t, 1 - e, 1))
  16926. },
  16927. O = function() {
  16928. return M.lookAt(w, e, b.UP), l.setFromRotationMatrix(M, h.warp.eOrder), v.setFromQuaternion(n.quaternion, h.warp.eOrder), T.set(l.x - v.x, l.y - v.y, l.z - v.z, h.warp.eOrder), c.constrainedTurn(T.y)
  16929. }.bind(this),
  16930. I = function(t, e) {
  16931. if (this.warpInterrupted) return _ = !0, !0
  16932. }.bind(this),
  16933. R = function(t, e) {
  16934. return _ || !this.warpPathPoints ? (g.blur(0), !0) : void g.blur(t)
  16935. }.bind(this),
  16936. N = d.allUniforms(this.model.chunks, "modelAlpha", 1),
  16937. k = function(t, e) {
  16938. return _ || !this.warpPathPoints ? (N(0), !0) : void N(t, e)
  16939. }.bind(this),
  16940. F = function(t, e) {
  16941. if (!this.warpPathPoints) return n.position.copy(this.warpDestPano.position), !0;
  16942. if (_) return !0;
  16943. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, t);
  16944. n.position.copy(i), w = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * t)
  16945. }.bind(this),
  16946. B = function(t, n) {
  16947. return this.warpPathPoints ? !!_ || void(e = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(t + i, 1))) : (a.debug("Lost bunny."), !0)
  16948. }.bind(this),
  16949. z = function(t, r) {
  16950. if (_) return a.debug(">>>> Walkthrough interupted at t=" + t), !0;
  16951. if (!this.warpPathPoints) return !0;
  16952. var s = this.warpLength * t,
  16953. u = o.Math.smoothstep(s, 0, this.brushPrefs.lookBlendDist),
  16954. d = o.Math.smoothstep(s, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  16955. h.warp.matchCam && (u *= 1 - d), M.lookAt(w, e, b.UP), l.setFromRotationMatrix(M, h.warp.eOrder), v.setFromQuaternion(n.quaternion, h.warp.eOrder), T.set(l.x - v.x, l.y - v.y, l.z - v.z, h.warp.eOrder), T.y = c.constrainedTurn(T.y), l.x = v.x + u * T.x, l.y = v.y + u * T.y, l.z = v.z + u * T.z, T.set(l.x - y.x, l.y - y.y, l.z - y.z, h.warp.eOrder), T.y = c.constrainedTurn(T.y);
  16956. var p = o.Math.degToRad(h.warp.maxTurnPerSec) * r / 1e3;
  16957. T.y = Math.sign(T.y) * Math.min(p, Math.abs(T.y)), y.x = y.x + T.x * h.warp.turnFriction, y.y = y.y + T.y * h.warp.turnFriction, y.z = y.z + T.z * h.warp.turnFriction, y.x = Math.max(o.Math.degToRad(h.warp.minDownAngle), y.x);
  16958. var f = e.clone()
  16959. .sub(w)
  16960. .normalize();
  16961. if (D < h.warp.maxAimRotation && d > 0) {
  16962. var g = 1 - d;
  16963. f.x = f.x * g + d * C.x, f.y = f.y * g + d * C.y, f.z = f.z * g + d * C.z, f.normalize()
  16964. }
  16965. this.bunnyObj.position.copy(n.position)
  16966. .add(f), m.set(0, 0, -1)
  16967. .applyEuler(y)
  16968. .normalize(), m.multiplyScalar(8), m.add(n.position), t > 1 - i && h.warp.matchCam || (n.controls.lookAt(m), n.controls.lookVector.copy(m), n.lookAt(m))
  16969. }.bind(this),
  16970. U = function() {
  16971. _ ? (this.discardSlow(), this.upcomingTransType = u.BLACK, this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, x.BEGINNING, t)) : this._wrapupWarpShading(t)
  16972. }.bind(this);
  16973. B(0);
  16974. var V = h.warp.motionLeadTime + 1e3 * Math.abs(O()) / o.Math.degToRad(h.warp.maxTurnPerSec),
  16975. j = V / (S += V);
  16976. this.warpCommonParameters(S, j, !0, x.NONE), f.start(I, S, null, 0, null, "_haltWatcher"), h.warp.blur > 0 && (g.blurStrength = h.warp.blur, f.start(R, S, null, j, L, "blurring")), f.start(k, S, null, j, L, "modelAlpha"), f.start(F, S, null, j, p[h.warp.blendEasing], "followPath"), f.start(B, S, null, j, p[h.warp.blendEasing], "goBunny"), f.start(z, S, U, 0, p[h.warp.blendEasing], "lookAtBunny")
  16977. }, r.prototype.warpTravel_BLACK = function(t, e, i, n) {
  16978. var r = t || 0;
  16979. null != e || (e = h.warp.teleportTime), this.warpCommonParameters(e, r, !1, i), this.model.chunks.forEach((function(t) {
  16980. t.material.uniforms.blackout.value = i
  16981. })), this._warpBendAim(null, e, null, r);
  16982. var o = function() {
  16983. this.wrapupWarpShadingOnly(n, i)
  16984. }.bind(this);
  16985. f.start(this.stepWarpPath.bind(this), e, o, r, p[h.warp.blendEasing], "stepMotion")
  16986. }, r.prototype.flightStepWalk = function(t, e, i) {
  16987. if (this.warpInterrupted) i && i();
  16988. else if (this.activeTransType !== u.WALK) this._clearWarpShading(), this._warpStopFlying(), this.player.spider.draw(), this.placeCpm(), i && i();
  16989. else if (this.player.currentPano !== t) {
  16990. var n = {
  16991. pano: t,
  16992. lookAtPoint: e,
  16993. duration: null,
  16994. maxDistanceOverride: h.warp.walkMaxDist,
  16995. skipWarpingCheck: !1,
  16996. constantMoveSpeed: !0
  16997. };
  16998. this.player.nonInterruptingFlyToPano(n, i)
  16999. } else i && i()
  17000. }, r.prototype.makeWalkFlightFunc = function(t, e, i) {
  17001. return this.flightStepWalk.bind(this, t, e, i)
  17002. }, r.prototype.warpTravel_WALK = function(t) {
  17003. var e = this.nodes.length,
  17004. i = this.player.model.panos,
  17005. n = i.get(this.nodes[e - 1]),
  17006. r = n.position.clone()
  17007. .multiplyScalar(2)
  17008. .sub(i.get(this.nodes[e - 2])
  17009. .position),
  17010. o = new Array(e + 1);
  17011. o[o.length - 1] = function() {
  17012. t && t()
  17013. }.bind(this);
  17014. for (var a = e - 1, s = o.length - 1; s > 0; s -= 1) {
  17015. var l = this.nodes[a];
  17016. n = i.get(l);
  17017. var u = r.distanceTo(n.position) < .3 ? null : r;
  17018. o[s - 1] = this.makeWalkFlightFunc(n, u, o[s]), r = n.position.clone(), a--
  17019. }
  17020. o[0]()
  17021. }, r.prototype.warpCameraTravel = function(t, e, i, n) {
  17022. if (this.activeTransType = this.upcomingTransType, this.upcomingTransType = null, t) this.activeTransType == u.BLACK ? this.warpTravel_BLACK(null, i, e, n) : this.activeTransType === u.WALK ? this.warpTravel_WALK(function() {
  17023. this._clearWarpShading(), this._warpStopFlying(), this.player.spider.draw(), this.placeCpm(), n && n()
  17024. }.bind(this)) : this.warpTravel_STD(n);
  17025. else {
  17026. var r = function() {
  17027. this._wrapupTravel(n)
  17028. }.bind(this),
  17029. o = {
  17030. pano: this.warpDestPano,
  17031. lookAtPoint: null,
  17032. duration: null,
  17033. maxDistanceOverride: null,
  17034. skipWarpingCheck: !1
  17035. };
  17036. this.player.flyToPano(o, r)
  17037. }
  17038. }, r.prototype.startWarpState = function() {
  17039. this.warping = !0, this.warpInterrupted = !1, this.warpInterruptionBlackoutStyle = null, this.warpInterruptionTravelTime = null
  17040. }, r.prototype.endWarpState = function() {
  17041. this.warping = !1
  17042. }, r.prototype.warpToPano = function(t, e, i, n) {
  17043. if (this.warping) a.warn("Cannot warp when already warping");
  17044. else {
  17045. if (this.upcomingTransType = t, this.activeTransType = null, !this.setWarpDestPano()) return this.upcomingTransType = null, void this.warpToNonPano(n);
  17046. if (this.player.mode !== s.PANORAMA) return this.upcomingTransType = null, this.discardSlow(), void this.player.flyToNewMode({
  17047. mode: s.PANORAMA,
  17048. pano: this.warpDestPano,
  17049. duration: h.warp.outsideTime,
  17050. warpDest: this.warpDestHeroLoc,
  17051. callback: n,
  17052. force: !0
  17053. });
  17054. if (!this.warpDestPano) return a.warn("no warp destination, callback dropped"), void(this.upcomingTransType = null);
  17055. var r = !(this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) && this.warpDestPano !== this.player.currentPano && this.warpDestPano.position.distanceTo(this.player.currentPano.position) < h.warp.nearPanoDist),
  17056. o = this.chooseWarpPath(r);
  17057. if (o && this.upcomingTransType !== u.WALK) {
  17058. var l = function() {
  17059. this.warpToPano(t, e, i, n)
  17060. }.bind(this);
  17061. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, l)) return
  17062. }
  17063. this.player.currentPano || (a.warn("Arrived at a very strange spot!"), this.player.currentPano = this.warpDestPano, this.placeCpm(), this.fadeOutCpm(h.path.fadeOutTime), this.player.spider.draw()), a.debug("Warping to pano ", this.warpDestPano.position), this.upcomingTransType !== u.WALK && this.player.emit(w.PanoChosen, this.player.currentPano, this.warpDestPano), this.player.activeTag && this.player.dismissActiveTag(), this.startWarpState();
  17064. var c = function() {
  17065. this.endWarpState(), n && n()
  17066. }.bind(this);
  17067. o ? this.warpCameraTravel(r, e, i, c) : this.warpCameraAim(c), this.player.smoothZoomToDefault(h.zoom.restoreTime)
  17068. }
  17069. }, t.exports = r
  17070. })
  17071. .call(this, "/js/objects/ShowPath.js")
  17072. }, function(t, e, i) {
  17073. function n(t) {
  17074. this.player = t, this.obj3d = null, this.UP = new r.Vector3(0, 1, 0)
  17075. }
  17076. var r = i(0),
  17077. o = i(1);
  17078. n.prototype.prefs = {
  17079. linewidth: 3,
  17080. height: .07,
  17081. opacity: .45,
  17082. endScale: .05
  17083. }, n.prototype.discard = function() {
  17084. if (this.obj3d) {
  17085. var t = this.obj3d.parent;
  17086. t && t.remove(this.obj3d)
  17087. }
  17088. this.obj3d = null
  17089. }, n.prototype.draw = function() {
  17090. if (this.discard(), o.showNeighbors) {
  17091. var t = this.player.currentPano.floor;
  17092. this.obj3d = new r.Object3D;
  17093. var e = this.player.model.panos.getNeighbours(this.player.currentPano),
  17094. i = this.player.currentPano.floorPosition.clone()
  17095. .sub(this.player.model.position);
  17096. i.y += this.prefs.height;
  17097. var n = .1525,
  17098. a = .0127,
  17099. s = .255,
  17100. l = new r.Matrix4;
  17101. for (var u in e)
  17102. if (e[u]) {
  17103. var h = this.player.model.panos.get(u),
  17104. c = (h.position.clone()
  17105. .sub(this.player.model.position), h.position.clone()
  17106. .sub(h.floorPosition)),
  17107. d = h.floorPosition.clone()
  17108. .sub(this.player.model.position);
  17109. d.y += this.prefs.height;
  17110. var p = new r.Geometry;
  17111. p.vertices.push(new r.Vector3(0, -a, 0), new r.Vector3(-a, 0, 0), new r.Vector3(0, a, 0), new r.Vector3(a, 0, 0), new r.Vector3(0, -a, 0)), p.vertices.push(new r.Vector3(0, -s, 0), new r.Vector3(s, -s, 0), new r.Vector3(s, n, 0), new r.Vector3(-n, n, 0), new r.Vector3(-n, .127, 0), new r.Vector3(-.19, .1, 0), new r.Vector3(-.19, -.2032, 0), new r.Vector3(-n, -.2286, 0), new r.Vector3(-n, -s, 0), new r.Vector3(0, -s, 0)), l.identity()
  17112. .setPosition(c), p.applyMatrix(l), p.vertices.push(new r.Vector3(0, -this.prefs.endScale, 0)), p.vertices.push(new r.Vector3(-this.prefs.endScale, -this.prefs.endScale, 0), new r.Vector3(-this.prefs.endScale, this.prefs.endScale, 0), new r.Vector3(this.prefs.endScale, this.prefs.endScale, 0), new r.Vector3(this.prefs.endScale, -this.prefs.endScale, 0)), l.lookAt(d, i, this.UP)
  17113. .setPosition(d), p.applyMatrix(l), p.vertices.push(d, i);
  17114. var f = new r.Line(p, new r.LineBasicMaterial({
  17115. color: h.debugColor.getHex(),
  17116. transparent: !0,
  17117. opacity: this.prefs.opacity,
  17118. depthWrite: !1,
  17119. name: "sLine" + u,
  17120. linewidth: this.prefs.linewidth
  17121. }));
  17122. this.obj3d.add(f)
  17123. } t.add(this.obj3d)
  17124. }
  17125. }, n.prototype.update = function() {
  17126. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  17127. }, t.exports = n
  17128. }, function(t, e, i) {
  17129. function n() {
  17130. this.events = [], this.valid = !1
  17131. }
  17132. var r = i(111);
  17133. n.prototype.push = function(t, e) {
  17134. this.events.push({
  17135. direction: t,
  17136. pano: e
  17137. }), this.valid = !0
  17138. }, n.prototype.pop = function(t) {
  17139. var e = this.events.pop();
  17140. return this.events.length < 1 && (this.valid = !1), e
  17141. }, n.prototype.peek = function() {
  17142. return this.events.length ? this.events[this.events.length - 1] : {
  17143. direction: null,
  17144. pano: null
  17145. }
  17146. }, n.prototype.invalidate = function() {
  17147. this.events = [], this.valid = !1
  17148. }, n.prototype.reversePano = function(t) {
  17149. if (!this.valid) return null;
  17150. var e = this.peek();
  17151. return r.opposite(t) === e.direction ? (this.pop(), e.pano) : null
  17152. }, t.exports = n
  17153. }, function(t, e) {
  17154. var i = {
  17155. UP: 1,
  17156. DOWN: -1,
  17157. LEFT: "L",
  17158. RIGHT: "R",
  17159. FORWARD: "F",
  17160. BACK: "B",
  17161. reverse: {},
  17162. opposite: function(t) {
  17163. return this.reverse[t.toString()]
  17164. }
  17165. };
  17166. i.reverse[i.UP] = i.DOWN, i.reverse[i.DOWN] = i.UP, i.reverse[i.LEFT] = i.RIGHT, i.reverse[i.RIGHT] = i.LEFT, i.reverse[i.FORWARD] = i.BACK, i.reverse[i.BACK] = i.FORWARD, t.exports = i
  17167. }, function(t, e) {
  17168. t.exports = {
  17169. ZoomIn: "zoom.in",
  17170. ZoomOut: "zoom.out",
  17171. ZoomMax: "zoom.max",
  17172. ZoomMin: "zoom.min"
  17173. }
  17174. }, function(t, e) {
  17175. function i() {
  17176. this.actionSequence = [], this.actionSequenceInProgress = !1
  17177. }
  17178. i.prototype.reset = function(t) {
  17179. this.actionSequenceInProgress = !1, this.actionSequence.length = 0
  17180. }, i.prototype.addZoomAction = function() {
  17181. var t = null,
  17182. e = null,
  17183. i = !1,
  17184. n = function() {
  17185. if (t = null, this.actionSequence.length > 0) this.actionSequence[0].start, this.actionSequence[this.actionSequence.length - 1].end;
  17186. this.reset()
  17187. };
  17188. return function(r, o, a) {
  17189. if (r !== o) {
  17190. i || (n = n.bind(this), i = !0), t && (window.clearTimeout(t), t = null), a === e && this.actionSequenceInProgress || (this.reset(), e = a), this.actionSequenceInProgress = !0;
  17191. var s = {
  17192. start: r,
  17193. end: o
  17194. };
  17195. this.actionSequence.push(s), t = window.setTimeout(n, 150)
  17196. }
  17197. }
  17198. }(), t.exports = i
  17199. }, function(t, e, i) {
  17200. (function(e) {
  17201. var n = i(0),
  17202. r = i(3),
  17203. o = i(115),
  17204. a = i(67),
  17205. s = i(20);
  17206. function l(t) {
  17207. G.MT = this;
  17208. var i = this,
  17209. l = 0,
  17210. u = 1,
  17211. h = t.sRender.scene,
  17212. c = t.sRender.renderer;
  17213. this.enabled = !1, this.camera = t.camera, this.renderer = c, this.player = t, this.domElement = c.domElement, this.mouse = {
  17214. x: 0,
  17215. y: 0
  17216. }, this.allSpheres = [], this.mode = "panorama", this.activeMeasurement = null, this.measurements = [], this.backupDollhouseMeasurements = [], this.backupPanoramaMeasurements = [], this.backupFloorplanMeasurements = [], this.sceneMeasurement = h, this.sceneRoot = new n.Object3D, this.sceneMeasurement.add(this.sceneRoot), this.hoveredElement = null, this.modeScale = 1, this.getPointType = 1, this.inMeasureMode = !1, this.isPC = null, this.movingpointi = -1;
  17217. var d = this.player.modellen;
  17218. this.checkradius = d < 10 ? 1.5 : d > 100 ? 5 : (d - 10) / 90 * 3.5 + 1.5, this.mouseDownFlag = !1, this.mouseMoveFlag = !1, this.clickOnceHandle = null, this.measureState = !1, this.unit = 1, this.mouseDownPos = new n.Vector2, this.pointIntersect = new n.Vector3, this.lockedAddPoint = !1, this.singleMeasuring = !1, this.editMode = !1, this.measureArea = !1, this.measureTexture = new a(this.player), this.oldPoint = null, this.clickMeasureId = null;
  17219. var p = !1,
  17220. f = this;
  17221. function m(t, e, i, n) {
  17222. var r = 1 / Math.tan(e / 2) / i;
  17223. return t * (r = r * n / 2)
  17224. }
  17225. Object.defineProperty(this, "autoFit", {
  17226. get: function() {
  17227. return p
  17228. },
  17229. set: function(t) {
  17230. return p = t, f.activeMeasurement && (f.activeMeasurement.enableAutoFit = t), t
  17231. }
  17232. }), this.init = function(t) {
  17233. var e = t.nestmeasure;
  17234. e && e.info && (e.info.forEach((function(t) {
  17235. i.startInsertion({
  17236. showDistances: !0,
  17237. showArea: !0,
  17238. closed: !0,
  17239. autoFit: i.autoFit
  17240. }, !0, t), i.intoMeasureMode(!r.isMobile());
  17241. for (var e = t.vertex_position.length - 1; e >= 0; e--) {
  17242. var o = new n.Vector3(t.vertex_position[e].x, t.vertex_position[e].y, t.vertex_position[e].z);
  17243. i.addPoint(o)
  17244. }
  17245. i.finishInsertion(!0, t.measureid), i.exitMeasureMode()
  17246. })), this.player.measuringToolControls && this.player.measuringToolControls.updateMeasureInfo(this.measurements), G.conf.modelMeasure && "panorama" === this.player.mode || this.hideAll())
  17247. }, this.onMouseMove = function(t, e) {
  17248. if (i.pointIntersect.copy(i.player.intersect.point), i.mouseDownFlag && (i.mouseMoveFlag = !0), i.pointIntersect && i.activeMeasurement && i.activeMeasurement.points) {
  17249. var n = i.activeMeasurement.points,
  17250. r = i.activeMeasurement.points.length - 1;
  17251. r >= 0 && i.activeMeasurement.setPosition(r, i.pointIntersect), 1 === n.length ? this.singleMeasuring = !0 : this.singleMeasuring = !1
  17252. }
  17253. }, this.updateNormalPoint = function(t) {
  17254. if (t && i.activeMeasurement && i.activeMeasurement.points) {
  17255. var e = i.activeMeasurement.points.length - 1;
  17256. e >= 0 && i.activeMeasurement.setPosition(e, t)
  17257. }
  17258. }, this.onMouseDown = function(t) {
  17259. if (this.lockedAddPoint = !1, this.mouseDownPos.set(t.clientX, t.clientY), "floorplan" === this.player.mode) return !1;
  17260. 0 === t.button && (i.mouseDownFlag = !0, i.mouseMoveFlag = !1), e(".measure-edit-title")
  17261. .hide(), e(".measure-label")
  17262. .removeClass("measureActive"), i.clickMeasureId && (e(".measure-edit-delete")
  17263. .hide(), i.clickMeasureId = null)
  17264. }, this.onMouseUp = function(t) {
  17265. var e = this;
  17266. if (!this.lockedAddPoint) {
  17267. if ("floorplan" === this.player.mode) return !1;
  17268. if (this.mouseDownPos.distanceTo(new n.Vector2(t.clientX, t.clientY)) < 3) {
  17269. if (0 === t.button)
  17270. if (this.clickOnceHandle && this.singleMeasuring) clearTimeout(this.clickOnceHandle), this.clickOnceHandle = null, new n.Vector2(t.clientX, t.clientY)
  17271. .distanceTo(this.oldPoint) < 6 && this.addNormalPoint();
  17272. else this.clickOnceHandle = setTimeout(function(t) {
  17273. e.clickOnceHandle = null, e.addPoint(t), e.measureArea || 3 !== e.activeMeasurement.points.length || e.endAndReMeasure()
  17274. }.bind(this, this.pointIntersect.clone()), 300), this.oldPoint = new n.Vector2(t.clientX, t.clientY);
  17275. i.mouseDownFlag = !1
  17276. }
  17277. 2 === t.button && this.endAndReMeasure()
  17278. }
  17279. }, this.endAndReMeasure = function() {
  17280. this.singleMeasuring = !1, this.finishInsertion(!0), this.exitMeasureMode(), this.startInsertion({
  17281. showDistances: !0,
  17282. showArea: !0,
  17283. closed: !0,
  17284. autoFit: this.autoFit
  17285. }, !0), this.intoMeasureMode(!0), this.player.measuringToolControls && 0 < this.measurements.length && this.player.measuringToolControls.updateMeasureInfo(this.measurements)
  17286. }, this.toast = function(t) {
  17287. setTimeout((function() {
  17288. document.getElementsByClassName("toast-wrap")[0].getElementsByClassName("toast-msg")[0].innerHTML = t;
  17289. var i = document.getElementsByClassName("toast-wrap")[0];
  17290. e(".toast-wrap")
  17291. .addClass("me"), e(".toast-msg")
  17292. .addClass("me"), i.className = i.className.replace("toastAnimate", ""), setTimeout((function() {
  17293. i.className = i.className + " toastAnimate"
  17294. }), 10)
  17295. }), 10)
  17296. }, this.addNormalPoint = function() {
  17297. if (!(this.activeMeasurement.points.length > 1)) {
  17298. var t = G.pointsIntersect.point.clone(),
  17299. e = G.pointsIntersect.normal.clone(),
  17300. i = this.player.computeIntersectWithFloor(t, e);
  17301. if (i.length > 0) {
  17302. for (var r = 0, o = 0; o < i.length; o++)
  17303. if (i[o].distance > .05) {
  17304. r = o;
  17305. break
  17306. } var a = i[r].point;
  17307. this.activeMeasurement.removeMarker(0), this.addPoint(t, !1), this.addPoint(a, !1), this.addPoint(new n.Vector3, !1), this.endAndReMeasure()
  17308. }
  17309. }
  17310. }, this.addPoint = function(t, r) {
  17311. if (i.activeMeasurement && i.activeMeasurement.points) {
  17312. var o = t || i.pointIntersect,
  17313. a = new n.Vector3(o.x, o.y, o.z);
  17314. if (function(t, e) {
  17315. var n = 0;
  17316. if (2 <= e.length) {
  17317. for (var r = 0, o = e.length; r < o; ++r) {
  17318. var a = t.x.toFixed(2) === e[r].x.toFixed(2),
  17319. s = t.y.toFixed(2) === e[r].y.toFixed(2),
  17320. l = t.z.toFixed(2) === e[r].z.toFixed(2);
  17321. a && s && l && n++
  17322. }
  17323. if (2 === n && !i.singleMeasuring) return !0
  17324. }
  17325. return !1
  17326. }(a, this.activeMeasurement.points)) return;
  17327. i.activeMeasurement.addMarker(a, r), 2 == i.activeMeasurement.points.length ? e(".measure-edit-cancel, .measure-edit-delete")
  17328. .show() : (e(".measure-edit-cancel")
  17329. .hide(), e(".measure-edit-save")
  17330. .show())
  17331. }
  17332. this.allSpheres = [];
  17333. for (var s = [], l = 0; i.measurements && l < i.measurements.length; l++) s.push(i.measurements[l]);
  17334. for (l = 0; l < s.length; l++)
  17335. for (var u = s[l], h = 0; h < u.spheres.length; h++) {
  17336. var c = u.spheres[h];
  17337. l == s.length - 1 && h == u.spheres.length - 1 || i.allSpheres.push(c)
  17338. }
  17339. }, this.hideLastPoint = function() {}, this.getMousePointCloudIntersection = function(t) {
  17340. var e = this.player.getMouseOnWholeIntersect(t);
  17341. return e ? e.clone() : null
  17342. }, this.setAutoFit = function(t) {
  17343. this.autoFit = t
  17344. }, this.setMeasureArea = function(t) {
  17345. this.measureArea = t
  17346. }, this.startInsertion = function(e, r, a) {
  17347. u;
  17348. var s = void 0 === (e = e || {})
  17349. .showDistances || e.showDistances,
  17350. l = void 0 !== e.showArea && e.showArea,
  17351. h = void 0 !== e.showAngles && e.showAngles,
  17352. c = void 0 !== e.closed && e.closed,
  17353. d = e.maxMarkers || Number.MAX_SAFE_INTEGER,
  17354. p = new o(t, a);
  17355. p.showDistances = s, p.showArea = l, p.showAngles = h, p.showEdge = !0, p.closed = c, p.maxMarkers = d, p.category = 1, p.unit = this.unit, p.enableAutoFit = this.autoFit, p.editMode = this.editMode, this.addMeasurement(p, 2), a ? p.addMarker(new n.Vector3(a.vertex_position[0].x, a.vertex_position[0].y, a.vertex_position[0].z)) : i.pointIntersect ? p.addMarker(i.pointIntersect.clone()) : p.addMarker(new n.Vector3(0, 0, 0)), this.activeMeasurement = p
  17356. }, this.finishInsertion = function(t, n) {
  17357. if (t) {
  17358. if (this.activeMeasurement && this.activeMeasurement.points && this.activeMeasurement.points.length) {
  17359. if (1 === this.activeMeasurement.points.length) return !1;
  17360. 2 === this.activeMeasurement.points.length || this.activeMeasurement.removeMarker(this.activeMeasurement.points.length - 1), this.activeMeasurement.points.length > 2 && (i.activeMeasurement.category = 2);
  17361. var o = this.measureData(this.activeMeasurement);
  17362. n ? (i.measurements[i.measurements.length - 1].measureid = n, i.measurements[i.measurements.length - 1].category = i.activeMeasurement.category) : r.valueFromHash("publicity") || r.valueFromHash("publictest") ? i.measurements[i.measurements.length - 1].measureid = 111 : "modelMeasure" === r.valueFromHash("iframe_type_editor") ? window.parent.addMeasure(o, (function(t) {
  17363. i.measurements[i.measurements.length - 2].measureid = t
  17364. })) : i.measurements[i.measurements.length - 1].measureid = this.activeMeasurement.uuid
  17365. }
  17366. e(".measure-edit-save, .measure-edit-cancel, .measure-edit-delete")
  17367. .hide()
  17368. }
  17369. var a = {
  17370. type: "insertion_finished",
  17371. measurement: this.activeMeasurement
  17372. };
  17373. this.dispatchEvent(a), this.activeMeasurement = null, l
  17374. }, this.updateMeasureVisible = function(t) {
  17375. if (!t) return !1;
  17376. for (var e = 0; e < this.measurements.length; e++) this.computeLableVisible(this.measurements[e], t)
  17377. }, this.computeLableVisible = function(t, e) {
  17378. for (var i = e.id, r = e.position, o = new n.Vector3, a = t.edgeLabels.concat(t.areaLabel), s = null, l = [], u = 0; u < a.length; u++) {
  17379. (s = a[u])
  17380. .userData.panoVisibleMap || (s.userData.panoVisibleMap = {}), o.subVectors(s.position, r)
  17381. .normalize();
  17382. var h = this.player.computeIntersectWithFloor(r, o);
  17383. h.length > 0 ? h[0].distance > s.position.distanceTo(r) || h[0].point.distanceTo(s.position) < .05 ? (l.push(!0), s.userData.panoVisibleMap[i] = !0) : (l.push(!1), s.userData.panoVisibleMap[i] = !1) : (l.push(!0), s.userData.panoVisibleMap[i] = !0)
  17384. }
  17385. return l
  17386. }, this.changeSize = function(t) {
  17387. for (var e = null, i = this.measurements.length - 1; i >= 0; i--) {
  17388. var n = this.measurements[i];
  17389. if (t === n.measureid) {
  17390. e = this.measureData(n);
  17391. break
  17392. }
  17393. }
  17394. window.parent && window.parent.changeSize && e && (e.measureid = t, e.measureId = t, window.parent.changeSize(e))
  17395. }, this.measureData = function(t) {
  17396. var e = t,
  17397. i = [];
  17398. return e.points.forEach((function(t) {
  17399. i.push({
  17400. x: t.x,
  17401. y: t.y,
  17402. z: t.z
  17403. })
  17404. })), e.edgeLabels.forEach((function(t, i) {
  17405. e.lineDetail[i] && (e.lineDetail[i].value = t.textNum)
  17406. })), {
  17407. vertex_position: i,
  17408. quaternion: e.q,
  17409. areaDetail: e.areaDetail,
  17410. lineDetail: e.lineDetail,
  17411. enable: e.enable,
  17412. mode: e.mode,
  17413. unit: e.unit,
  17414. category: e.category,
  17415. flooridx: e.flooridx,
  17416. locationid: e.location_id
  17417. }
  17418. }, this.addMeasurement = function(t, e) {
  17419. if (this.sceneMeasurement.add(t), this.measurements.push(t), 1 == e) switch (this.mode) {
  17420. case 1:
  17421. this.backupDollhouseMeasurements.push(t);
  17422. break;
  17423. case 2:
  17424. this.backupPanoramaMeasurements.push(t);
  17425. break;
  17426. case 3:
  17427. this.backupFloorplanMeasurements.push(t)
  17428. }
  17429. this.dispatchEvent({
  17430. type: "measurement_added",
  17431. measurement: t
  17432. }), t.addEventListener("marker_added", (function(t) {
  17433. i.dispatchEvent(t)
  17434. })), t.addEventListener("marker_removed", (function(t) {
  17435. i.dispatchEvent(t)
  17436. })), t.addEventListener("marker_moved", (function(t) {
  17437. i.dispatchEvent(t)
  17438. }))
  17439. }, this.changeMode = function(t, e) {
  17440. switch (e) {
  17441. case "panorama":
  17442. (i.measureState || G.conf.modelMeasure) && i.showAll();
  17443. break;
  17444. case "dollhouse":
  17445. case "floorplan":
  17446. break;
  17447. case "transitioning":
  17448. i.hideAll()
  17449. }
  17450. }, this.removeMeasurement = function(t, e) {
  17451. if (!t) {
  17452. var i = this.measurements.length - 1;
  17453. t = this.measurements[i], e = 1
  17454. }
  17455. if (this.sceneMeasurement.remove(t), (n = this.measurements.indexOf(t)) >= 0 && this.measurements.splice(n, 1), 1 == e) switch (this.mode) {
  17456. case 1:
  17457. (n = this.backupDollhouseMeasurements.indexOf(t)) >= 0 && this.backupDollhouseMeasurements.splice(n, 1);
  17458. break;
  17459. case 2:
  17460. (n = this.backupPanoramaMeasurements.indexOf(t)) >= 0 && this.backupPanoramaMeasurements.splice(n, 1);
  17461. break;
  17462. case 3:
  17463. var n;
  17464. (n = this.backupFloorplanMeasurements.indexOf(t)) >= 0 && this.backupFloorplanMeasurements.splice(n, 1)
  17465. }
  17466. }, this.updateMode = function(t) {
  17467. switch (this.mode = t, this.changeState(), this.mode) {
  17468. case "panorama":
  17469. this.getPointType = 2, this.modeScale = 1;
  17470. break;
  17471. case "dollhouse":
  17472. this.getPointType = 2, this.modeScale = 20;
  17473. break;
  17474. case "floorplan":
  17475. this.getPointType = 1, this.modeScale = 20
  17476. }
  17477. }, this.backup = function() {
  17478. for (var t = this.measurements.length - 1; t >= 0; t--) {
  17479. var e = this.measurements[t];
  17480. this.removeMeasurement(e, 2)
  17481. }
  17482. }, this.restore = function() {
  17483. var t = null;
  17484. switch (this.mode) {
  17485. case 1:
  17486. t = this.backupDollhouseMeasurements;
  17487. break;
  17488. case 2:
  17489. t = this.backupPanoramaMeasurements;
  17490. break;
  17491. case 3:
  17492. t = this.backupFloorplanMeasurements
  17493. }
  17494. for (var e = t.length, i = 0; i < e; i++) {
  17495. var n = t[i];
  17496. this.addMeasurement(n, 2)
  17497. }
  17498. }, this.intoMeasureMode = function(t) {
  17499. this.inMeasureMode = !0, this.player.inMeasureMode = !0, this.isPC = t, "panorama" === this.player.mode && (this.measureState = !0), this.measureTexture.show()
  17500. }, this.exitMeasureMode = function(t) {
  17501. this.inMeasureMode = !1, this.player.inMeasureMode = !1, this.activeMeasurement && this.activeMeasurement.points && this.activeMeasurement.points.length && (this.removeMeasurement(this.activeMeasurement, 1), this.activeMeasurement.removeMarker(this.activeMeasurement.points.length - 1)), i.activeMeasurement = null, this.player.measuringToolControls.updateMeasureInfo(this.measurements), this.measureTexture.hide()
  17502. }, this.deleteAll = function() {
  17503. for (var t = this.measurements.length - 1; t >= 0; t--) {
  17504. var e = this.measurements[t];
  17505. this.removeMeasurement(e, 1)
  17506. }
  17507. }, this.show = function(t) {
  17508. for (var e = this.measurements.length - 1; e >= 0; e--) {
  17509. var i = this.measurements[e];
  17510. i.measureid === t && this.showOrHide(i, !0)
  17511. }
  17512. }, this.hide = function(t) {
  17513. for (var e = this.measurements.length - 1; e >= 0; e--) {
  17514. var i = this.measurements[e];
  17515. i.measureid === t && this.showOrHide(i, !1)
  17516. }
  17517. }, this.showAll = function() {
  17518. this.measureState = !0;
  17519. for (var t = this.measurements.length - 1; t >= 0; t--) {
  17520. var e = this.measurements[t];
  17521. e.editMode || this.showOrHide(e, !0)
  17522. }
  17523. }, this.hideAll = function() {
  17524. for (var t = this.measurements.length - 1; t >= 0; t--) {
  17525. var e = this.measurements[t];
  17526. this.showOrHide(e, !1)
  17527. }
  17528. "panorama" === this.player.mode && (this.measureState = !1)
  17529. }, this.delete = function(t) {
  17530. for (var e = this.measurements.length - 1; e >= 0; e--) {
  17531. var i = this.measurements[e];
  17532. i.measureid !== t && i.uuid !== t || this.removeMeasurement(i, 1)
  17533. }
  17534. this.player.measuringToolControls.updateMeasureInfo(this.measurements)
  17535. }, this.changeName = function(t, e) {
  17536. for (var i = this.measurements.length - 1; i >= 0; i--) {
  17537. var n = this.measurements[i];
  17538. n.measureid === t && n.changeName(e)
  17539. }
  17540. this.player.measuringToolControls.updateMeasureInfo(this.measurements)
  17541. }, this.selected = function(t) {
  17542. this.clickMeasureId = t
  17543. }, this.disSelected = function(t) {
  17544. for (var e = this.measurements.length - 1; e >= 0; e--) {
  17545. var i = this.measurements[e];
  17546. i.measureid === t && i.disSelected(t)
  17547. }
  17548. }, this.changeUnit = function(t) {}, this.changeState = function() {
  17549. for (var t = 0; t < this.measurements.length; t++) {
  17550. var e = this.measurements[t];
  17551. if (!e.enable) break;
  17552. e.modeType = this.mode, e.update()
  17553. }
  17554. }, this.showOrHide = function(t, e) {
  17555. t.enable = e, t.showDistances = e, t.showArea = e, t.showEdge = e, t.update(), this.player.measuringToolControls.updateMeasureInfo(this.measurements)
  17556. }, this.unbindEventListener = function() {
  17557. this.domElement.removeEventListener("mousemove", onMouseMove, !1), this.domElement.removeEventListener("mousedown", onMouseDown, !1), this.domElement.removeEventListener("mouseup", onMouseUp, !0)
  17558. }, this.onIntoEditMeasure = function() {
  17559. this.editMode = !0;
  17560. for (var t = this.measurements.length - 1; t >= 0; t--) {
  17561. var e = this.measurements[t];
  17562. e.editMode && this.showOrHide(e, !0)
  17563. }
  17564. }, this.onQuitEditMeasure = function() {
  17565. this.editMode = !1;
  17566. for (var t = this.measurements.length - 1; t >= 0; t--) {
  17567. var e = this.measurements[t];
  17568. e.editMode && this.showOrHide(e, !1)
  17569. }
  17570. }, this.update = function() {
  17571. if (0 === this.measurements.length) return !1;
  17572. for (var t = [], e = 0; e < this.measurements.length; e++) t.push(this.measurements[e]);
  17573. this.activeMeasurement && t.push(this.activeMeasurement);
  17574. for (e = 0; e < t.length; e++) {
  17575. for (var r = t[e], o = 0; o < r.spheres.length; o++) {
  17576. var a = r.spheres[o];
  17577. this.allSpheres.push(a);
  17578. var s = i.camera.position.distanceTo(a.getWorldPosition(new n.Vector3)),
  17579. l = m(1, i.camera.fov * Math.PI / 180, i.player.cameras.floorplan.top, c.domElement.clientHeight),
  17580. u = 30 * this.modeScale / l;
  17581. a.scale.set(u, u, u)
  17582. }
  17583. for (o = 0; o < r.edgeLabels.length; o++) {
  17584. var h = r.edgeLabels[o];
  17585. s = i.camera.position.distanceTo(h.getWorldPosition()), l = m(1, i.camera.fov * Math.PI / 180, i.player.cameras.floorplan.top, c.domElement.clientHeight), u = 90 * this.modeScale / l;
  17586. h.scale.set(u, u, u)
  17587. }
  17588. for (o = 0; o < r.edgeLabels.length; o++) {
  17589. h = r.angleLabels[o], s = i.camera.position.distanceTo(h.getWorldPosition()), u = 70 / (l = m(1, i.camera.fov * Math.PI / 180, s, c.domElement.clientHeight));
  17590. h.scale.set(u, u, u)
  17591. }
  17592. s = i.camera.position.distanceTo(r.areaLabel.getWorldPosition()), l = m(1, i.camera.fov * Math.PI / 180, i.player.cameras.floorplan.top, c.domElement.clientHeight), u = 90 * this.modeScale / l;
  17593. r.areaLabel.scale.set(u, u, u)
  17594. }
  17595. }, this.player.on(s.ModeChanged, this.changeMode), e(".measure-edit-save")
  17596. .on("click", (function() {
  17597. i.endAndReMeasure(), e(".measure-edit-save, .measure-edit-cancel, .measure-edit-delete")
  17598. .hide()
  17599. })), e(".measure-edit-cancel")
  17600. .on("click", (function() {
  17601. i.exitMeasureMode(), i.startInsertion({
  17602. showDistances: !0,
  17603. showArea: !0,
  17604. closed: !0,
  17605. autoFit: this.autoFit
  17606. }, !0), i.intoMeasureMode(!0), e(".measure-edit-save, .measure-edit-cancel, .measure-edit-delete")
  17607. .hide()
  17608. })), e(".measure-edit-delete")
  17609. .on("click", (function() {
  17610. i.exitMeasureMode(), i.startInsertion({
  17611. showDistances: !0,
  17612. showArea: !0,
  17613. closed: !0,
  17614. autoFit: i.autoFit
  17615. }, !0), i.intoMeasureMode(!0), e(".measure-edit-save, .measure-edit-cancel, .measure-edit-delete")
  17616. .hide(), i.clickMeasureId && (i.delete(i.clickMeasureId), i.clickMeasureId = null)
  17617. }))
  17618. }
  17619. l.prototype = Object.create(n.EventDispatcher.prototype), t.exports = l
  17620. })
  17621. .call(this, i(6))
  17622. }, function(t, e, i) {
  17623. var n = i(0),
  17624. r = i(116),
  17625. o = i(9);
  17626. function a(t, e) {
  17627. G.Measure = this;
  17628. var i = this;
  17629. this.player = t, this.camera = t.camera, n.Object3D.call(this), this.enable = !e || e.enable, this.mode = e ? e.mode : t.mode, this.location_id = e ? e.locationid : t.currentPano.id, this.flooridx = e ? e.flooridx : t.currentPano.floorIndex, this.enableAutoFit = !1, this.checked = !1, this.unit = 1, this.lineDetail = [], this.areaDetail = {
  17630. name: "",
  17631. value: 0,
  17632. desc_position: {
  17633. x: 0,
  17634. y: 0,
  17635. z: 0
  17636. }
  17637. }, this.q = e ? e.quaternion : {
  17638. x: this.camera.quaternion.x,
  17639. y: this.camera.quaternion.y,
  17640. z: this.camera.quaternion.z,
  17641. w: this.camera.quaternion.w
  17642. }, this.points = [], this._showDistances = !0, this._showArea = !0, this._closed = !0, this.maxMarkers = Number.MAX_SAFE_INTEGER, this.spheres = [], this.edges = [], G.edges = this.edges, this.sphereLabels = [], this.edgeLabels = [], this.angleLabels = [], this.text = "", this.lockedFitAxis = !1, e && (1 === e.category ? this.text = "未命名" === e.lineDetail[0].name ? "" : e.lineDetail[0].name + " " : this.text = "未命名" === e.areaDetail.name ? "" : e.areaDetail.name + " "), this.flooridx || (this.flooridx = 0), this.areaLabel = new r(""), this.areaLabel.material.opacity = 1, this.areaLabel.textNum = 0;
  17643. var a = new n.SphereGeometry(.01, 16, 16);
  17644. this.color = new n.Color(16760622);
  17645. var s = function(t) {
  17646. t.target.material.emissive.setHex(8947848)
  17647. },
  17648. l = function(t) {
  17649. t.target.material.emissive.setHex(0)
  17650. },
  17651. u = function(t) {
  17652. var e = t.tool,
  17653. n = (e.dragstart, e.mouse, e.getMousePointCloudIntersection());
  17654. if (n) {
  17655. var r = i.spheres.indexOf(e.dragstart.object);
  17656. i.setPosition(r, n)
  17657. }
  17658. t.event.stopImmediatePropagation()
  17659. },
  17660. h = function(t) {};
  17661. function c(t) {
  17662. for (var e = (t += "")
  17663. .split("."), i = e[0], n = e.length > 1 ? "." + e[1] : "", r = /(\d+)(\d{3})/; r.test(i);) i = i.replace(r, "$1,$2");
  17664. return i + n
  17665. }
  17666. this.addMarker = function(t, e) {
  17667. var o = !1,
  17668. c = null;
  17669. null == e && (e = !0), e && 0 !== this.points.length && (c = this.points.pop(), o = !0), this.points.push(t), o && this.points.push(c);
  17670. var d = new n.Mesh(a, new n.MeshBasicMaterial({
  17671. flatShading: n.SmoothShading,
  17672. color: i.color,
  17673. depthTest: !0,
  17674. transparent: !0,
  17675. opacity: 1
  17676. }));
  17677. d.name = "sphere", d.userData.index = this.points.length - 1, d.addEventListener("move", s), d.addEventListener("leave", l), d.addEventListener("drag", u), d.addEventListener("drop", h), this.add(d), this.spheres.push(d);
  17678. var p = new n.LineGeometry;
  17679. p.setPositions([0, 0, 0, 0, 0, 0]), G.matLine = new n.LineMaterial({
  17680. color: 16760622,
  17681. linewidth: 2,
  17682. resolution: new n.Vector2(window.renderWidth || (window.renderWidth || window.innerWidth), (window.renderHeight || window.innerHeight)),
  17683. depthTest: !0
  17684. });
  17685. var f = new n.Line2(p, G.matLine);
  17686. f.renderOrder = 99, f.computeLineDistances(), f.scale.set(1, 1, 1), f.visible = !0, this.add(f), this.edges.push(f);
  17687. var m = new r;
  17688. m.visible = !1, m.textNum = 0, this.edgeLabels.push(m);
  17689. var g = new r;
  17690. g.material.opacity = 1, g.visible = !1, this.angleLabels.push(g), this.add(g);
  17691. var v = {
  17692. type: "marker_added",
  17693. measurement: this
  17694. };
  17695. this.dispatchEvent(v), this.setPosition(this.points.length - 1, t)
  17696. }, this.removeMarker = function(t, e) {
  17697. this.points.splice(t, 1), this.remove(this.spheres[t]);
  17698. var i = 0 === t ? 0 : t - 1;
  17699. this.remove(this.edges[i]), this.edges.splice(i, 1), this.remove(this.edgeLabels[i]), this.edgeLabels.splice(i, 1), this.spheres.splice(t, 1), this.update(), this.dispatchEvent({
  17700. type: "marker_removed",
  17701. measurement: this
  17702. })
  17703. }, this.setMarker = function(t, e) {
  17704. this.points[t] = e;
  17705. var i = {
  17706. type: "marker_moved",
  17707. measure: this,
  17708. index: t,
  17709. position: e.position.clone()
  17710. };
  17711. this.dispatchEvent(i), this.update()
  17712. }, this.setPosition = function(t, e) {
  17713. this.points[t].copy(e);
  17714. var i = {
  17715. type: "marker_moved",
  17716. measure: this,
  17717. index: t,
  17718. position: e.clone()
  17719. };
  17720. this.dispatchEvent(i), this.update()
  17721. }, this.changeName = function(t) {
  17722. this.text = t, this.update()
  17723. }, this.getPlaneAera = function() {
  17724. var t = 0,
  17725. e = this.points.length - 1,
  17726. i = [];
  17727. if (!(this.points.length >= 3)) return t;
  17728. var r = new n.Plane;
  17729. r.setFromCoplanarPoints(this.points[0], this.points[1], this.points[2]), r.constant = 0;
  17730. var o = r.normal,
  17731. a = o.angleTo(new n.Vector3(0, 1, 0)),
  17732. s = (new n.Vector3)
  17733. .crossVectors(o, new n.Vector3(0, 1, 0))
  17734. .normalize(),
  17735. l = (new n.Quaternion)
  17736. .setFromAxisAngle(s, a);
  17737. i.push({
  17738. x: 0,
  17739. y: 0
  17740. });
  17741. for (var u = new n.Vector3, h = 1; h < this.points.length; h++) u.subVectors(this.points[h], this.points[0]), r.projectPoint(u.clone(), u), u.applyQuaternion(l), i.push({
  17742. x: u.x,
  17743. y: u.z
  17744. });
  17745. if (i.length > 0)
  17746. for (h = 0; h < i.length; h++) {
  17747. var c = i[h],
  17748. d = i[e];
  17749. t += (d.x + c.x) * (c.y - d.y), e = h
  17750. }
  17751. return Math.abs(t / 2)
  17752. }, this.getAngleBetweenLines = function(t, e, i) {
  17753. var r = (new n.Vector3)
  17754. .subVectors(e, t),
  17755. o = (new n.Vector3)
  17756. .subVectors(i, t);
  17757. return r.angleTo(o)
  17758. }, this.changeUnit = function(t) {
  17759. this.unit = t, this.update()
  17760. }, this.selected = function() {
  17761. this.checked = !0, this.update()
  17762. }, this.disSelected = function() {
  17763. this.checked = !1, this.update()
  17764. }, this.fitAxis = function(t, e) {
  17765. if (!this.lockedFitAxis) {
  17766. var i, r = null,
  17767. o = null,
  17768. a = null;
  17769. i = t[e - 1], o = t[e], r = new n.Vector3(o.x, i.y, o.z), (a = this.computeFitPosition(r, i, o))
  17770. .point && o.copy(a.point), r.set(o.x, o.y, i.z), (a = this.computeFitPosition(r, i, o))
  17771. .point && o.copy(a.point), r.set(i.x, o.y, o.z), (a = this.computeFitPosition(r, i, o))
  17772. .point && o.copy(a.point)
  17773. }
  17774. }, this.computeFitPosition = function(t, e, i) {
  17775. var r = {
  17776. point: null,
  17777. angle: 0
  17778. },
  17779. o = (new n.Vector3)
  17780. .subVectors(e, t)
  17781. .normalize(),
  17782. a = (new n.Vector3)
  17783. .subVectors(i, e),
  17784. s = (new n.Vector3)
  17785. .crossVectors(o, a),
  17786. l = o.angleTo(a),
  17787. u = a.length(),
  17788. h = (new n.Vector3)
  17789. .crossVectors(o, s)
  17790. .normalize();
  17791. if (u <= 1.15) l <= .1 ? (a.projectOnVector(o), r.point = (new n.Vector3)
  17792. .addVectors(e, a), r.angle = 0) : l >= 3.05 ? (r.point = (new n.Vector3)
  17793. .addVectors(e, a), r.angle = 180) : l >= 1.48 && l <= 1.65 && (a.projectOnVector(h), r.point = (new n.Vector3)
  17794. .addVectors(e, a), r.angle = 90);
  17795. else {
  17796. var c = Math.abs(Math.sin(l) * u),
  17797. d = Math.abs(Math.cos(l) * u);
  17798. c < .2 ? (a.projectOnVector(o), r.point = (new n.Vector3)
  17799. .addVectors(e, a), r.angle = l > 3 ? 180 : 0) : d < .2 && (a.projectOnVector(h), r.point = (new n.Vector3)
  17800. .addVectors(e, a), r.angle = 90)
  17801. }
  17802. return r
  17803. }, this.cpmputedOutScreen = function(t) {
  17804. var e = !1;
  17805. return this.points.length >= 3 && (e = !0), e
  17806. }, this.update = function() {
  17807. if (0 !== this.points.length)
  17808. if (1 !== this.points.length) {
  17809. var t = this.points.length - 1,
  17810. e = new n.Vector3;
  17811. this.enableAutoFit && this.points.length >= 2 && this.fitAxis(this.points, t);
  17812. for (var r = 0; r <= t; r++) {
  17813. E = this.points[r];
  17814. e.add(E)
  17815. }
  17816. e.divideScalar(this.points.length);
  17817. var a = this.cpmputedOutScreen(e);
  17818. this.areaLabel.position.copy(e), this.areaLabel.userData.screen_position = o.convertWorldPositionToScreen(e.clone(), this.camera), this.areaLabel.visible = this.showArea && this.points.length >= 3;
  17819. var s = "" !== this.text ? this.text : "未命名",
  17820. l = c(this.getPlaneAera()
  17821. .toFixed(2)),
  17822. u = "";
  17823. u = l + "m²", u = this.text + u, this.areaLabel.setText(u), this.areaLabel.textNum = l, this.checked, this.enable || (this.areaLabel.visible = !1), this.areaLabel.setDepth(a), this.areaDetail.name = s, this.areaDetail.value = this.getPlaneAera()
  17824. .toFixed(2), this.areaDetail.desc_position = {
  17825. x: this.areaLabel.position.x,
  17826. y: this.areaLabel.position.y,
  17827. z: this.areaLabel.position.z
  17828. };
  17829. for (r = 0; r <= t; r++) {
  17830. var h = r,
  17831. d = r + 1 > t ? 0 : r + 1,
  17832. p = 0 === r ? t : r - 1,
  17833. f = (E = this.points[h], this.points[d]),
  17834. m = this.points[p],
  17835. g = this.spheres[h];
  17836. g.position.copy(E), g.material.color = i.color;
  17837. var v = this.edges[h],
  17838. y = [E.x, E.y, E.z, f.x, f.y, f.z];
  17839. v.geometry.setPositions(y), v.computeLineDistances(), v.geometry.verticesNeedUpdate = !0, v.geometry.computeBoundingSphere(), this.showEdge && this.enable ? this.showEdge && (v.visible = h < t || this.closed, g.visible = !0) : (v.visible = !1, g.visible = !1), this.checked;
  17840. var b = this.edgeLabels[r],
  17841. w = (new n.Vector3)
  17842. .add(E);
  17843. w.add(f), w = w.multiplyScalar(.5);
  17844. var x = E.distanceTo(f)
  17845. .toFixed(2);
  17846. b.position.copy(w), b.userData.screen_position = o.convertWorldPositionToScreen(w.clone(), this.camera);
  17847. var M = "" !== this.text ? this.text : "未命名",
  17848. T = x;
  17849. this.lineDetail.length === t - 1 ? this.lineDetail.push({
  17850. name: M,
  17851. value: x,
  17852. desc_position: {}
  17853. }) : this.lineDetail.length === t && (this.lineDetail[t - 1].name = M, this.lineDetail[t - 1].value = x, this.lineDetail[t - 1].desc_position = {
  17854. x: w.x,
  17855. y: w.y,
  17856. z: w.z
  17857. }), b.setText(this.text + T + "m"), b.textNum = T, b.setDepth(a), this.checked, b.visible = this.showDistances && (h < t || this.closed) && this.points.length >= 2 && x > 0, this.enable || (b.visible = !1);
  17858. var S = this.angleLabels[r],
  17859. _ = this.getAngleBetweenLines(E, m, f),
  17860. A = f.clone()
  17861. .sub(m);
  17862. A.multiplyScalar(.5), A = m.clone()
  17863. .add(A)
  17864. .sub(E)
  17865. .normalize();
  17866. var P = Math.min(E.distanceTo(m), E.distanceTo(f));
  17867. P /= 9;
  17868. var C = E.clone()
  17869. .add(A.multiplyScalar(P));
  17870. S.position.copy(C);
  17871. u = c((_ * (180 / Math.PI))
  17872. .toFixed(1)) + "°";
  17873. S.setText(u), S.visible = this.showAngles && (h < t || this.closed) && this.points.length >= 3 && _ > 0, this.enable || (S.visible = !1)
  17874. }
  17875. } else {
  17876. var E = this.points[0];
  17877. this.spheres[0].position.copy(E)
  17878. }
  17879. }
  17880. }
  17881. a.prototype = Object.create(n.Object3D.prototype), Object.defineProperty(a.prototype, "showArea", {
  17882. get: function() {
  17883. return this._showArea
  17884. },
  17885. set: function(t) {
  17886. this._showArea = t, this.update()
  17887. }
  17888. }), Object.defineProperty(a.prototype, "closed", {
  17889. get: function() {
  17890. return this._closed
  17891. },
  17892. set: function(t) {
  17893. this._closed = t, this.update()
  17894. }
  17895. }), Object.defineProperty(a.prototype, "showDistances", {
  17896. get: function() {
  17897. return this._showDistances
  17898. },
  17899. set: function(t) {
  17900. this._showDistances = t, this.update()
  17901. }
  17902. }), t.exports = a
  17903. }, function(t, e, i) {
  17904. var n = i(0),
  17905. r = i(3);
  17906. function o(t) {
  17907. n.Object3D.call(this);
  17908. var e = new n.Texture;
  17909. e.minFilter = n.LinearFilter, e.magFilter = n.LinearFilter;
  17910. var i = new n.SpriteMaterial({
  17911. map: e,
  17912. depthTest: !1,
  17913. depthWrite: !0
  17914. });
  17915. this.material = i, this.sprite = new n.Sprite(i), this.sprite.name = "measure", this.add(this.sprite), this.borderThickness = 1, this.fontface = "PingFangSC-Medium,PingFang SC", this.borderColor = "rgba(0, 0, 0, 0)", this.backgroundColor = "rgba(0, 0, 0, 0.6)", this.textColor = "rgba(255, 255, 255, 1)", this.text = "", this.fontsize = r.isMobile() ? 20 : 16, this.setText(t)
  17916. }
  17917. o.prototype = new n.Object3D, o.prototype.setText = function(t) {
  17918. this.text = t, this.update()
  17919. }, o.prototype.setTextColor = function(t) {
  17920. this.textColor = t, this.update()
  17921. }, o.prototype.setBorderColor = function(t) {
  17922. this.borderColor = t, this.update()
  17923. }, o.prototype.setBackgroundColor = function(t) {
  17924. this.backgroundColor = t, this.update()
  17925. }, o.prototype.setDepth = function(t) {
  17926. this.material.depthTest = !t
  17927. }, o.prototype.update = function() {
  17928. var t = document.createElement("canvas"),
  17929. e = t.getContext("2d");
  17930. e.font = this.fontsize + "px " + this.fontface, this.text = " " + this.text + " ";
  17931. var i = e.measureText(this.text)
  17932. .width + 20,
  17933. r = this.fontsize + 14;
  17934. e.canvas.width = i, e.canvas.height = r, e.font = this.fontsize + "px " + this.fontface, e.fillStyle = this.backgroundColor, e.strokeStyle = this.borderColor, e.lineWidth = this.borderThickness, this.roundRect(e, 0, 0, i, r, 3), e.fillStyle = this.textColor, e.fillText(this.text, 9, this.fontsize + 6);
  17935. var o = new n.Texture(t);
  17936. o.minFilter = n.LinearFilter, o.magFilter = n.LinearFilter, o.needsUpdate = !0, this.sprite.material.map = o, this.sprite.scale.set(.006 * i * .4, .006 * r * .4, 1)
  17937. }, o.prototype.roundRect = function(t, e, i, n, r, o) {
  17938. t.beginPath(), t.moveTo(e + o, i), t.lineTo(e + n - o, i), t.quadraticCurveTo(e + n, i, e + n, i + o), t.lineTo(e + n, i + r - o), t.quadraticCurveTo(e + n, i + r, e + n - o, i + r), t.lineTo(e + o, i + r), t.quadraticCurveTo(e, i + r, e, i + r - o), t.lineTo(e, i + o), t.quadraticCurveTo(e, i, e + o, i), t.closePath(), t.fill(), t.stroke(), t.closePath()
  17939. }, t.exports = o
  17940. }, function(t, e, i) {
  17941. var n = i(0),
  17942. r = i(9),
  17943. o = i(13);
  17944. function a(t) {
  17945. this.player = t, this.sRender = t.sRender
  17946. }
  17947. a.prototype.showWireFrame = function(t) {
  17948. var e;
  17949. 0 === t && (e = this.player.model.chunks), 1 === t && (e = this.player.model.colliders), 2 === t && (e = this.panoMarkers), this.player.model.userData.totalVertices = 0, this.player.model.userData.totalFaces = 0;
  17950. for (var i = {}, n = 0; n < e.length; ++n) {
  17951. var r, o = e[n];
  17952. this.removeWireFrame(o),
  17953. function t() {
  17954. r = Math.random(), i["_" + r] && t(), i["_" + r] = 1
  17955. }(), this.addWireFrame(o, 16777215 * r * 10)
  17956. }
  17957. }, a.prototype.hideWireFrame = function() {
  17958. for (var t = this.player.model.chunks, e = this.player.model.colliders, i = t.concat(e), n = 0; n < i.length; ++n) {
  17959. var r = i[n];
  17960. this.removeWireFrame(r)
  17961. }
  17962. }, a.prototype.addWireFrame = function(t, e) {
  17963. t.userData.line_segments && this.removeWireFrame(t);
  17964. var i = t.geometry,
  17965. r = new n.Geometry;
  17966. r.fromBufferGeometry(i)
  17967. .mergeVertices(), this.player.model.userData.totalVertices += r.vertices.length, this.player.model.userData.totalFaces += r.faces.length;
  17968. var o = new n.WireframeGeometry(t.geometry),
  17969. a = new n.LineSegments(o);
  17970. a.material.color.setHex(e), a.rotation.copy(t.rotation), a.position.copy(t.position), t.userData.line_segments = a, t.add(a)
  17971. }, a.prototype.removeWireFrame = function(t) {
  17972. if (t.userData.line_segments) {
  17973. var e = t.userData.line_segments;
  17974. t.userData.line_segments = null, e.geometry.dispose(), e.material.dispose(), t.remove(e)
  17975. }
  17976. }, a.prototype.showVertexNormals = function(t) {
  17977. for (var e = 0 === t ? this.player.model.chunks : this.player.model.colliders, i = 0, r = e.length; i < r; ++i) {
  17978. var o = new n.VertexNormalsHelper(e[i], .25);
  17979. e[i].add(o)
  17980. }
  17981. }, a.prototype.drawLine = function(t) {
  17982. var e = new n.Vector3(t.x, t.y, t.z),
  17983. i = o.drawLine(this.player.model.position, e);
  17984. this.sRender.scene.add(i)
  17985. }, a.prototype.drawFatLine = function(t) {
  17986. var e = new n.LineGeometry;
  17987. e.setPositions([0, 0, 0, t.x, t.y, t.z]);
  17988. var i = new n.LineMaterial({
  17989. color: 16711680,
  17990. linewidth: 2,
  17991. resolution: new n.Vector2(this.sRender.renderer.domElement.width, this.sRender.renderer.domElement.height)
  17992. }),
  17993. r = new n.Line2(e, i);
  17994. this.sRender.scene.add(r)
  17995. }, a.prototype.udpateShader = function(t, e) {
  17996. t = new n.Vector3(t.x, t.y, t.z), this.player.model.chunks.forEach((function(i) {
  17997. i.material.uniforms.centerT && i.material.uniforms.centerT.value.copy(t.normalize()), i.material.uniforms.virtualCameraAngle && (i.material.uniforms.virtualCameraAngle.value = n.Math.degToRad(e))
  17998. }))
  17999. }, a.prototype.hideChunks = function() {
  18000. for (var t = this.player.model.chunks, e = 0, i = t.length; e < i; ++e) t[e].visible = !1
  18001. }, a.prototype.showChunks = function() {
  18002. for (var t = this.player.model.chunks, e = 0, i = t.length; e < i; ++e) t[e].visible = !0
  18003. }, a.prototype.showColliders = function(t) {
  18004. for (var e = this.player.model.colliders, i = 0, n = e.length; i < n; ++i) e[i].material.color.setHex(t), e[i].material.visible = !0
  18005. }, a.prototype.hideColliders = function() {
  18006. for (var t = this.player.model.colliders, e = 0, i = t.length; e < i; ++e) t[e].material.visible = !1
  18007. }, a.prototype.getFrustum = function() {
  18008. var t = new n.Frustum;
  18009. return t.setFromMatrix((new n.Matrix4)
  18010. .multiplyMatrices(this.sRender.camera.projectionMatrix, this.sRender.camera.matrixWorldInverse)), t
  18011. }, a.prototype.switchDirLight = function(t) {
  18012. if (t) {
  18013. var e = new n.DirectionalLight(16777215);
  18014. e.position.set(0, 5, 0), this.sRender.scene.add(e), this.sRender.scene.userData.dir_light = e
  18015. } else this.sRender.scene.userData.dir_light && this.sRender.scene.remove(this.sRender.scene.userData.dir_light)
  18016. }, a.prototype.hideHumanModelOfOutScreen = function() {
  18017. for (var t = this.player.humanModelControls.putModelsOfHuman, e = new n.Vector3, i = !1, a = 0, s = t.length; a < s; ++a) {
  18018. var l = t[a],
  18019. u = this.sRender.scene.userData["line" + a];
  18020. u && (u.geometry && u.geometry.dispose(), u.material && u.material.dispose(), this.sRender.scene.remove(u)), u = o.drawLine(e, l.position, 255), this.sRender.scene.add(u), i = r.computeWorldPositionOutCamera(l.position, this.sRender.camera), l.visible = !i
  18021. }
  18022. }, t.exports = a
  18023. }, function(t, e, i) {
  18024. "use strict";
  18025. var n = i(0),
  18026. r = i(5),
  18027. o = i(3),
  18028. a = (i(9), i(119)),
  18029. s = i(121),
  18030. l = (i(123), i(125)),
  18031. u = i(127),
  18032. h = i(129),
  18033. c = i(69);
  18034. function d(t, e, i, r, o, a) {
  18035. const s = new n.Group,
  18036. l = new n.MeshBasicMaterial({
  18037. color: e
  18038. }),
  18039. u = new n.CylinderGeometry(r, r, i, 32),
  18040. h = new n.Mesh(u, l);
  18041. h.position.y = i / 2;
  18042. const c = new n.MeshBasicMaterial({
  18043. color: e
  18044. }),
  18045. d = new n.ConeGeometry(2 * r, 3 * r, 32),
  18046. p = new n.Mesh(d, c);
  18047. p.position.y = i;
  18048. const f = document.createElement("canvas");
  18049. f.width = 32, f.height = 32;
  18050. const m = f.getContext("2d");
  18051. m.font = o + "px Arial", m.fillStyle = e.getStyle(), m.fillText(t, f.width / 2, f.height / 2);
  18052. const g = new n.CanvasTexture(f),
  18053. v = new n.SpriteMaterial({
  18054. map: g
  18055. }),
  18056. y = new n.Sprite(v);
  18057. return y.position.y = i + 4 * r, y.scale.set(.2, .2, .2), s.add(h), s.add(p), s.add(y), s
  18058. }
  18059. function p() {
  18060. var t = new n.ConeGeometry(.2, .5, 4),
  18061. e = new n.Group,
  18062. i = new n.EdgesGeometry(t),
  18063. r = new n.MeshBasicMaterial({
  18064. color: 16777215,
  18065. transparent: !0,
  18066. opacity: .3
  18067. }),
  18068. o = new n.Mesh(t, r),
  18069. a = new n.LineSegments(i, new n.LineBasicMaterial({
  18070. color: 65280,
  18071. linewidth: 2
  18072. }));
  18073. o.rotation.x = Math.PI, a.rotation.x = Math.PI;
  18074. var s = d("X", new n.Color(16711680), .2, .02, 12);
  18075. s.rotation.z = -Math.PI / 2;
  18076. var l = d("Y", new n.Color(65280), .2, .02, 12),
  18077. u = d("Z", new n.Color(255), .2, .02, 12);
  18078. u.rotation.x = Math.PI / 2;
  18079. var h = new n.Group;
  18080. return h.add(s), h.add(l), h.add(u), e.add(o), e.add(a), e.add(h), e.name = "probemodel", e
  18081. }
  18082. function f(t) {
  18083. this.player = t, this.sRender = t.sRender, this.virtualCameraFovControls = t.virtualCameraFovControls, this.humanModelAnimationControls = t.humanModelAnimationControls, this.humanModelControls = t.humanModelControls, this.weaponModelControls = t.weaponModelControls, this.measuringToolControls = t.measuringToolControls, this.postilControls = t.postilControls, this.isEscPutModel = !1, this._isPuttingModel = !1, this.KEYS = {
  18084. k_27: "ESC",
  18085. k_46: "DEL"
  18086. }, this.MOUSE = {
  18087. button: {
  18088. _0: "LEFT_BUTTON",
  18089. _2: "RIGHT_BUTTON"
  18090. }
  18091. }, this.execState = {
  18092. intoDollhouse: {
  18093. times: 0
  18094. },
  18095. intoPanorama: {
  18096. times: 0
  18097. },
  18098. intoTransitioning: {
  18099. times: 0
  18100. }
  18101. }, this.recordCameraPositionChangeList = [], this.recordCameraRotationChangeList = [], this.defineProperty(), this.initStateEngine(), this.initEmitMessage(), G.conf.modelplaced && o.getQueryString("isLocal") || (this.humanModelControls.canbeSelect = !1, this.weaponModelControls.canbeSelect = !1, this.virtualCameraFovControls.canbeSelect = !1), G.conf.annotation && o.getQueryString("isLocal") || (this.postilControls.canbeSelect = !1)
  18102. }
  18103. f.prototype.defineProperty = function() {
  18104. Object.defineProperty(this, "isPuttingModel", {
  18105. get: function() {
  18106. return this._isPuttingModel
  18107. },
  18108. set: function(t) {
  18109. this._isPuttingModel = t
  18110. }
  18111. })
  18112. }, f.prototype.checkPlayerMode = function(t) {
  18113. switch (t) {
  18114. case "panorama":
  18115. this.intoPanorama();
  18116. break;
  18117. case "dollhouse":
  18118. this.intoDollhouse();
  18119. break;
  18120. case "floorplan":
  18121. break;
  18122. case "transitioning":
  18123. this.intoTransitioning()
  18124. }
  18125. }, f.prototype.checkCameraChangeList = function() {
  18126. var t = {},
  18127. e = {};
  18128. if (5 === this.recordCameraPositionChangeList.length && 5 === this.recordCameraRotationChangeList.length) {
  18129. var i = 0,
  18130. n = 0,
  18131. r = this.recordCameraPositionChangeList[0];
  18132. t["k_" + r.x.toFixed(3) + "_" + r.y.toFixed(3) + "_" + r.z.toFixed(3)] = 1;
  18133. for (var o = 1; o < 5; ++o) {
  18134. var a = this.recordCameraPositionChangeList[o];
  18135. 1 !== t["k_" + a.x.toFixed(3) + "_" + a.y.toFixed(3) + "_" + a.z.toFixed(3)] && (i = 1)
  18136. }
  18137. var s = this.recordCameraRotationChangeList[0];
  18138. e["k_" + s.x.toFixed(3) + "_" + s.y.toFixed(3) + "_" + s.z.toFixed(3)] = 1;
  18139. for (o = 1; o < 5; ++o) {
  18140. var l = this.recordCameraRotationChangeList[o];
  18141. 1 !== e["k_" + l.x.toFixed(3) + "_" + l.y.toFixed(3) + "_" + l.z.toFixed(3)] && (n = 1)
  18142. }
  18143. this.recordCameraPositionChangeList = [], this.recordCameraRotationChangeList = [], 1 === i && this.onCameraPositionMove(), 0 === i && this.onCameraPositionMoveStop(), 1 === n && this.onCameraRotationMove(), 0 === n && this.onCameraRotationMoveStop()
  18144. }
  18145. }, f.prototype.checkPuttingState = function() {}, f.prototype.initStateEngine = function() {
  18146. this.MouseStateMachine = {
  18147. LEFT_BUTTON: {
  18148. state: !1,
  18149. status: {
  18150. mousedown: {
  18151. state: !1,
  18152. callback: this.handleMouseLeftButtonDown.bind(this)
  18153. },
  18154. mouseup: {
  18155. state: !1,
  18156. callback: this.handleMouseLeftButtonUp.bind(this)
  18157. }
  18158. }
  18159. },
  18160. RIGHT_BUTTON: {
  18161. state: !1,
  18162. status: {
  18163. mousedown: {
  18164. state: !1,
  18165. callback: this.handleMouseRightButtonDown.bind(this)
  18166. },
  18167. mouseup: {
  18168. state: !1,
  18169. callback: this.handleMouseRightButtonUp.bind(this)
  18170. }
  18171. }
  18172. },
  18173. MOVE: {
  18174. state: !1,
  18175. callback: this.handleMouseMove.bind(this)
  18176. }
  18177. }, this.KeysStateMachine = {
  18178. ESC: {
  18179. state: !1,
  18180. status: {
  18181. keyup: {
  18182. state: !1,
  18183. callback: this.handleKeyOfESC.bind(this)
  18184. },
  18185. keydown: {
  18186. state: !1,
  18187. callback: function() {}
  18188. }
  18189. }
  18190. }
  18191. }
  18192. }, f.prototype.initEmitMessage = function() {
  18193. this.humanModelControls.emitter.on("human-follow-mouse", this._emitHumanFollowMouse.bind(this)), this.humanModelControls.emitter.on("human-put-over", this._emitHumanPutOver.bind(this)), this.humanModelControls.emitter.on("human-put-cancel", this._emitHumanPutCancel.bind(this)), this.humanModelControls.emitter.on("human-handle-choosed", this._emitHumanHandleChoosed.bind(this)), this.humanModelControls.emitter.on("human-unchoosed", this._emitHumanUnChoosed.bind(this)), this.humanModelControls.emitter.on("human-mouse-in", this._emitHumanMouseIn.bind(this)), this.humanModelControls.emitter.on("human-mouse-out", this._emitHumanMouseOut.bind(this)), this.weaponModelControls.emitter.on("weapon-follow-mouse", this._emitWeaponFollowMouse.bind(this)), this.weaponModelControls.emitter.on("weapon-put-over", this._emitWeaponPutOver.bind(this)), this.weaponModelControls.emitter.on("weapon-put-cancel", this._emitWeaponPutCancel.bind(this)), this.weaponModelControls.emitter.on("weapon-handle-choosed", this._emitWeaponHandleChoosed.bind(this)), this.weaponModelControls.emitter.on("weapon-unchoosed", this._emitWeaponUnChoosed.bind(this)), this.virtualCameraFovControls.emitter.on("virtualCamera-follow-mouse", this._emitVirtualCameraFollowMouse.bind(this)), this.virtualCameraFovControls.emitter.on("virtualCamera-follow-mouse-over", this._emitVirtualCameraFollowMouseOver.bind(this)), this.virtualCameraFovControls.emitter.on("virtualCamera-put-cancel", this._emitVirtualCameraPutCancel.bind(this)), this.virtualCameraFovControls.emitter.on("virtualCamera-handle-choosed", this._emitVirtualCameraHandleChoosed.bind(this)), this.virtualCameraFovControls.emitter.on("virtualCamera-unchoosed", this._emitVirtualCameraUnChoosed.bind(this)), this.virtualCameraFovControls.emitter.on("virtualCamera-mouse-in", this._emitVirtualCameraMouseIn.bind(this)), this.virtualCameraFovControls.emitter.on("virtualCamera-mouse-out", this._emitVirtualCameraMouseOut.bind(this)), this.postilControls.emitter.on("postil-follow-mouse", this._emitPostilFollowMouse.bind(this)), this.postilControls.emitter.on("postil-put-over", this._emitPostilPutOver.bind(this)), this.postilControls.emitter.on("postil-put-cancel", this._emitPostilPutCancel.bind(this))
  18194. }, f.prototype.intoPanorama = function() {
  18195. 1 !== this.execState.intoPanorama.times && (this.execState.intoTransitioning.times = 0, this.execState.intoPanorama.times += 1, this.player.emit("viewModePanorama"), this.humanModelControls.canbeUsed && ((G.conf.modelplaced || o.getQueryString("isLocal")) && (this.humanModelControls.canbeSelect = !0), this.humanModelControls.onIntoPanorama()), this.weaponModelControls.canbeUsed && ((G.conf.modelplaced || o.getQueryString("isLocal")) && (this.weaponModelControls._canbeSelect = !0), this.weaponModelControls.onIntoPanorama()), this.postilControls.canbeUsed && ((G.conf.annotation || o.getQueryString("isLocal")) && (this.postilControls.canbeSelect = !0), this.postilControls.onIntoPanorama()), this.virtualCameraFovControls.canbeUsed && ((G.conf.modelplaced || o.getQueryString("isLocal")) && (this.virtualCameraFovControls._canbeSelect = !0), this.virtualCameraFovControls.onIntoPanorama()), this.postilControls.canbeUsed && this.postilControls.onIntoPanorama())
  18196. }, f.prototype.intoTransitioning = function() {
  18197. this.execState.intoPanorama.times = 0, this.execState.intoDollhouse.times = 0, this.execState.intoTransitioning.times += 1, this.player.emit("viewModeTransitioning"), this.humanModelControls.onIntoTransitioning(), this.virtualCameraFovControls.onIntoTransitioning(), this.weaponModelControls.onIntoTransitioning()
  18198. }, f.prototype.intoDollhouse = function() {
  18199. 1 !== this.execState.intoDollhouse.times && (this.execState.intoTransitioning.times = 0, this.execState.intoDollhouse.times += 1, this.player.emit("view-mode-dollhouse"), this.humanModelControls.onIntoDollhouse(), this.virtualCameraFovControls.onIntoDollhouse())
  18200. }, f.prototype.handleKeyOfESC = function() {
  18201. this.isEscPutModel = !1, this.humanModelControls.canbeUsed && this.humanModelControls.handleKeyOfEsc(), this.weaponModelControls.canbeUsed && this.weaponModelControls.handleKeyOfEsc(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.handleKeyOfEsc(), this.postilControls.canbeUsed && this.postilControls.handleKeyOfEsc();
  18202. var t = this.getChoosedModel();
  18203. !t || t.userData.follow_mouse ? t || this.isEscPutModel || this.player.emit("quit-put-mode") : this.destroyChoosedModelControlState(t)
  18204. }, f.prototype.handleMouseMove = function() {
  18205. this.humanModelControls.canbeUsed && this.humanModelControls.handleMouseMove(event), this.weaponModelControls.canbeUsed && this.weaponModelControls.handleMouseMove(event), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.handleMouseMove(event), this.postilControls.canbeUsed && this.postilControls.handleMouseMove(event), this.humanModelControls.HUMANMODEL && (this.humanModelControls.HUMANMODEL.userData.follow_mouse ? (this.weaponModelControls._canbeSelect = !1, this.virtualCameraFovControls._canbeSelect = !1) : (this.weaponModelControls._canbeSelect = !0, this.virtualCameraFovControls._canbeSelect = !0)), this.weaponModelControls.CONTROLMODEL && (this.weaponModelControls.CONTROLMODEL.userData.follow_mouse ? (this.humanModelControls.canbeSelect = !1, this.virtualCameraFovControls._canbeSelect = !1) : (this.humanModelControls.canbeSelect = !0, this.virtualCameraFovControls._canbeSelect = !0)), this.virtualCameraFovControls.VIRTUAL_CAMERA && (this.virtualCameraFovControls.VIRTUAL_CAMERA.userData.follow_mouse ? (this.humanModelControls.canbeSelect = !1, this.weaponModelControls._canbeSelect = !1) : (this.humanModelControls.canbeSelect = !0, this.weaponModelControls._canbeSelect = !0))
  18206. }, f.prototype.handleMouseLeftButtonDown = function() {
  18207. this.humanModelControls.canbeUsed && this.humanModelControls.handleMouseLeftButtonDown(), this.weaponModelControls.canbeUsed && this.weaponModelControls.handleMouseLeftButtonDown(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.handleMouseLeftButtonDown(), this.postilControls.canbeUsed && this.postilControls.handleMouseLeftButtonDown()
  18208. }, f.prototype.handleMouseLeftButtonUp = function() {
  18209. m && (m = !1, this.onHandleControlPanoramaMoveStopNoPan()), this.humanModelControls.canbeUsed && this.humanModelControls.handleMouseLeftButtonUp(), this.weaponModelControls.canbeUsed && this.weaponModelControls.handleMouseLeftButtonUp(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.handleMouseLeftButtonUp(), this.postilControls.canbeUsed && this.postilControls.handleMouseLeftButtonUp()
  18210. }, f.prototype.handleMouseRightButtonDown = function() {
  18211. this.humanModelControls.canbeUsed && this.humanModelControls.handleMouseRightButtonDown(), this.weaponModelControls.canbeUsed && this.weaponModelControls.handleMouseRightButtonDown(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.handleMouseRightButtonDown(), this.postilControls.canbeUsed && this.postilControls.handleMouseRightButtonDown()
  18212. }, f.prototype.handleMouseRightButtonUp = function() {
  18213. this.humanModelControls.canbeUsed && this.humanModelControls.handleMouseRightButtonUp(), this.weaponModelControls.canbeUsed && this.weaponModelControls.handleMouseRightButtonUp(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.handleMouseRightButtonUp(), this.postilControls.canbeUsed && this.postilControls.handleMouseRightButtonUp()
  18214. }, f.prototype.loadHumanModel = function(t) {
  18215. if (!this._isPuttingModel && !this.player.inMeasureMode) {
  18216. var e = this;
  18217. if (10 !== t) {
  18218. var i = "model/human/model_" + t + ".fbx";
  18219. this.player.emit("showLoaddingOfLoadPutModel"), a.load(i)
  18220. .then((function(i) {
  18221. var n = new l(i, t);
  18222. n.init(), n.initMatcap()
  18223. .then((function(i) {
  18224. var n = i.userData.setting_item;
  18225. 3 === t && (n.modelName = "成年男性"), 4 === t && (n.modelName = "成年女性"), 5 === t && (n.modelName = "男性警察"), 6 === t && (n.modelName = "男性警察"), 7 === t && (n.modelName = "青年女性"), 8 === t && (n.modelName = "青年男性"), e.addHumanModel(i)
  18226. }))
  18227. }))
  18228. } else {
  18229. i = "model/human/model_" + t + ".glb";
  18230. this.player.emit("showLoaddingOfLoadPutModel"), s.load(i)
  18231. .then((function(t) {
  18232. var i = new n.Group;
  18233. i.add(t.scene.children[0]), i.animations = t.animations;
  18234. var r = new n.AxesHelper(.4);
  18235. i.add(r), i.scale.set(.8, .8, .8), i.userData.follow_mouse = !0, e.sRender.scene.add(i), e.humanModelAnimationControls.init(i), e.player.emit("hideLoaddingOfLoadPutModel")
  18236. }))
  18237. }
  18238. }
  18239. }, f.prototype.loadWeaponModel = function(t) {
  18240. if (!this._isPuttingModel && !this.player.inMeasureMode) {
  18241. this.player.emit("showLoaddingOfLoadPutModel");
  18242. var e = p();
  18243. new u(e, t)
  18244. .init(), e.userData.setting_item.modelName = "探针", this.addWeaponModel(e)
  18245. }
  18246. }, f.prototype.loadPostilModel = function(t) {
  18247. if (!this._isPuttingModel && !this.player.inMeasureMode) {
  18248. var e = this,
  18249. i = new c(t)
  18250. .init();
  18251. if (i) {
  18252. i.userData.follow_mouse = !0, this.postilControls.POSTIL && this.postilControls.destroyPostilChoosedState(), this.postilControls.POSTIL = i;
  18253. var n = setTimeout((function() {
  18254. e.sRender.scene.add(i), clearTimeout(n)
  18255. }), 300)
  18256. }
  18257. }
  18258. }, f.prototype.loadVirtualCamera = function(t) {
  18259. if (!this._isPuttingModel && !this.player.inMeasureMode) {
  18260. var e = (new h)
  18261. .init();
  18262. this.addVirtualCamera(e)
  18263. }
  18264. }, f.prototype.loadModelList = function(t) {
  18265. this.player.isLoadedSaveModel = !0;
  18266. var e = this,
  18267. i = [],
  18268. n = [],
  18269. r = [],
  18270. o = [],
  18271. s = {};
  18272. for (var c in t) {
  18273. "human" !== (f = t[c])
  18274. .type && "weapon" !== f.type || (o.push(f.timestamp), s["k_" + f.timestamp] = f), "camera" === f.type && r.push(f)
  18275. }
  18276. o.sort((function(t, e) {
  18277. return t - e
  18278. }));
  18279. for (var d = 0; d < o.length; ++d) {
  18280. var f = s["k_" + o[d]];
  18281. n.push(f)
  18282. }
  18283. function m() {
  18284. for (var t = [], i = 0, n = r.length; i < n; ++i) t.push(i + 1);
  18285. var o = [],
  18286. a = null;
  18287. ! function i(n) {
  18288. if (!n) return o[o.length - 1], void e.player.emit("hideLoaddingOfLoadPutModel");
  18289. var s, l, u;
  18290. s = n, l = function(e) {
  18291. return o.push(e), i(t.shift())
  18292. }, (u = (new h)
  18293. .init(r[s - 1]))
  18294. .userData.is_save = !0, e.addVirtualCameraOfSave(u), null === a && (a = setTimeout((function() {
  18295. e.virtualCameraFovControls.addAxleWire(u), e.virtualCameraFovControls.computeCrash(u, l), clearTimeout(a), a = null
  18296. }), 0))
  18297. }(t.shift())
  18298. }
  18299. 0 < n.length ? (e.player.emit("showLoaddingOfLoadPutModel"), function t() {
  18300. var o = n[i.length];
  18301. "human" === o.type && function(t, o, s) {
  18302. o = "model/human/model_" + t.mid + ".fbx", a.load(o)
  18303. .then((function(o) {
  18304. t.uuid = o.uuid, o.userData.setting_item = t, o.userData.is_save = !0;
  18305. var a = new l(o, t.mid);
  18306. a.init(), a.initMatcap()
  18307. .then((function(t) {
  18308. i.push(t.uuid), e.addHumanModelOfSave(t), i.length !== n.length ? s() : (e.player.emit("hideLoaddingOfLoadPutModel"), e.player.emit("putModelListLoadingIsOver"), 0 < r.length && (e.player.emit("showLoaddingOfLoadPutModel"), setTimeout((function() {
  18309. m()
  18310. }), 200)))
  18311. }))
  18312. }))
  18313. }(o, "", t), "weapon" == o.type && function(t, o, a) {
  18314. "model/weapon/model_" + t.mid + ".obj", t.uuid = s.uuid, s.userData.setting_item = t;
  18315. var s = p();
  18316. new u(s, t.mid)
  18317. .init(), s.userData.is_save = !0, i.push(s.uuid), e.addWeaponModelOfSave(s), i.length !== n.length ? a() : (e.player.emit("hideLoaddingOfLoadPutModel"), e.player.emit("putModelListLoadingIsOver"), 0 < r.length && (e.player.emit("showLoaddingOfLoadPutModel"), setTimeout((function() {
  18318. m()
  18319. }), 200)))
  18320. }(o, 0, t)
  18321. }()) : (e.player.emit("showLoaddingOfLoadPutModel"), setTimeout((function() {
  18322. m()
  18323. }), 200))
  18324. }, f.prototype.getChoosedModel = function() {
  18325. return this.humanModelControls.HUMANMODEL || this.weaponModelControls.CONTROLMODEL || this.virtualCameraFovControls.VIRTUAL_CAMERA
  18326. }, f.prototype.addHumanModel = function(t) {
  18327. var e = this.getChoosedModel();
  18328. e && this.destroyChoosedModelControlState(e);
  18329. var i = this;
  18330. t.userData.follow_mouse = !0, this.humanModelControls.HUMANMODEL = t, this.humanModelControls.initSkeletonBox(t);
  18331. var n = setTimeout((function() {
  18332. i.sRender.scene.add(t), i.player.emit("hideLoaddingOfLoadPutModel"), clearTimeout(n)
  18333. }), 300)
  18334. }, f.prototype.addWeaponModel = function(t) {
  18335. var e = this.getChoosedModel();
  18336. e && this.destroyChoosedModelControlState(e);
  18337. var i = this;
  18338. t.userData.follow_mouse = !0, this.weaponModelControls.initBoundingBox(t), this.weaponModelControls.CONTROLMODEL = t;
  18339. var n = setTimeout((function() {
  18340. i.sRender.scene.add(t), i.player.emit("hideLoaddingOfLoadPutModel"), clearTimeout(n)
  18341. }), 300)
  18342. }, f.prototype.addVirtualCamera = function(t) {
  18343. var e = this.getChoosedModel();
  18344. e && this.destroyChoosedModelControlState(e), t.userData.follow_mouse = !0;
  18345. var i = this.virtualCameraFovControls.VIRTUAL_CAMERA;
  18346. i && (this.virtualCameraFovControls.destroyBoxHelper(i), this.virtualCameraFovControls.destroyControl(i)), this.virtualCameraFovControls.VIRTUAL_CAMERA = t, this.virtualCameraFovControls.initBoxHelper(t), this.sRender.scene.add(t)
  18347. }, f.prototype.addHumanModelOfSave = function(t) {
  18348. var e = t.userData.setting_item;
  18349. this.sRender.scene.add(t), this.player.emit("addModelListItem", e), this.humanModelControls.putModelsOfHuman.push(t), this.humanModelControls.putModelsOfHumanKV[t.uuid] = t
  18350. }, f.prototype.addWeaponModelOfSave = function(t) {
  18351. this.sRender.scene.add(t), this.weaponModelControls.WEAPONS_SCENE.push(t), this.weaponModelControls.WEAPONS_KV[t.uuid] = t, this.player.emit("addModelListItem", t.userData.setting_item)
  18352. }, f.prototype.addVirtualCameraOfSave = function(t) {
  18353. this.sRender.scene.add(t), this.virtualCameraFovControls.putModels.push(t), this.virtualCameraFovControls.putModelsOfKV[t.uuid] = t, this.player.emit("addModelListItem", t.userData.setting_item)
  18354. }, f.prototype.savePutModels = function() {
  18355. for (var t = {}, e = this.humanModelControls.putModelsOfHuman, i = this.weaponModelControls.WEAPONS_SCENE, n = this.virtualCameraFovControls.putModels, r = e.concat(i)
  18356. .concat(n), a = 0, s = r.length; a < s; ++a) {
  18357. var l = r[a].userData.setting_item;
  18358. t[l.uuid] = l
  18359. }
  18360. if (o.getQueryString("isLocal")) {
  18361. var u = JSON.stringify(t);
  18362. localStorage.setItem("SETTINGS_DATA_PUTMODEL", u)
  18363. }
  18364. return JSON.stringify(t)
  18365. }, f.prototype.showModelsList = function(t) {
  18366. this.player.isShowModelList = !0, this.player.isLoadedSaveModel ? (this.humanModelControls.canbeUsed && this.humanModelControls.handleSwitchSaveModelVisible(!0), this.weaponModelControls.canbeUsed && this.weaponModelControls.handleSwitchSaveModelVisible(!0), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.handleSwitchSaveCameraVisible(!0), this.player.emit("showModelListPanel")) : this.loadModelList(t)
  18367. }, f.prototype.hideModelsList = function() {
  18368. this.player.isShowModelList = !1, this.humanModelControls.canbeUsed && this.humanModelControls.handleSwitchSaveModelVisible(!1), this.weaponModelControls.canbeUsed && this.weaponModelControls.handleSwitchSaveModelVisible(!1), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.handleSwitchSaveCameraVisible(!1), this.player.emit("hideModelListPanel")
  18369. }, f.prototype.switchPutModelCanbeSelect = function(t) {
  18370. this.humanModelControls.canbeUsed && (this.humanModelControls.canbeSelect = t), this.weaponModelControls.canbeUsed && (this.weaponModelControls._canbeSelect = t), this.virtualCameraFovControls.canbeUsed && (this.virtualCameraFovControls._canbeSelect = t)
  18371. }, f.prototype.switchMouseWheelLocked = function(t) {
  18372. this.player.controls && this.player.controls[r.PANORAMA] && (this.player.controls[r.PANORAMA].lockedMouseWheel = t, this.player.controls[r.DOLLHOUSE].lockedMouseWheel = t), this.switchKeyMoveDisabled(t), this.switchKeyRotateDisabled(t)
  18373. }, f.prototype.switchKeyMoveDisabled = function(t) {
  18374. this.player.controls && this.player.controls[r.PANORAMA] && (this.player.controls[r.PANORAMA].disableKeyMove = t)
  18375. }, f.prototype.switchKeyRotateDisabled = function(t) {
  18376. this.player.controls && this.player.controls[r.PANORAMA] && (this.player.controls[r.PANORAMA].disableKeyRotate = t)
  18377. }, f.prototype.destroyChoosedModelControlState = function(t) {
  18378. switch (t.userData.setting_item.type) {
  18379. case "human":
  18380. this.humanModelControls.destroyInvalidModelControl(t);
  18381. break;
  18382. case "weapon":
  18383. this.weaponModelControls.destroyModelChoosedState(t);
  18384. break;
  18385. case "camera":
  18386. this.virtualCameraFovControls.destroyModelControlState(t)
  18387. }
  18388. }, f.prototype.onHandleControlPanoramaMove = function() {
  18389. "panorama" === this.player.mode && (this.player.emit("handle-control-panorama-move"), this.humanModelControls.canbeUsed && this.humanModelControls.onHandleControlPanoramaMove(), this.weaponModelControls.canbeUsed && this.weaponModelControls.onHandleControlPanoramaMove(), this.measuringToolControls.canbeUsed && this.measuringToolControls.onHandleControlPanoramaMove(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.onHandleControlPanoramaMove())
  18390. }, f.prototype.onHandleDollhouseMove = function() {
  18391. this.player.emit("handle-control-dollhouse-move"), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.onHandleControlDollhouseMove(), this.humanModelControls.canbeUsed && this.humanModelControls.onHandleControlDollhouseMove()
  18392. }, f.prototype.onHandleControlTtagsMove = function() {
  18393. "panorama" === this.player.mode && (this.humanModelControls.onHandleControlTtagsMove(), this.weaponModelControls.onHandleControlTtagsMove(), this.virtualCameraFovControls.onHandleControlTtagsMove())
  18394. }, f.prototype.onHandleControlPanoramaMoveStop = function() {
  18395. "panorama" === this.player.mode && (this.humanModelControls.canbeUsed && this.humanModelControls.onHandleControlPanoramaMoveStop(), this.weaponModelControls.canbeUsed && this.weaponModelControls.onHandleControlPanoramaMoveStop(), this.measuringToolControls.canbeUsed && this.measuringToolControls.onHandleControlPanoramaMoveStop(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.onHandleControlPanoramaMoveStop())
  18396. }, f.prototype.onHandleControlPanoramaMoveStopNoPan = function() {
  18397. this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.onHandleControlPanoramaMoveStopNoPan()
  18398. }, f.prototype.onHandleDollhouseMoveStop = function() {
  18399. this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.onHandleControlDollhouseMoveStop(), this.humanModelControls.canbeUsed && this.humanModelControls.onHandleControlDollhouseMoveStop()
  18400. };
  18401. var m = !1;
  18402. f.prototype.onPlayerHandleControlPanoramaMove = function() {
  18403. m = !0, this.humanModelControls.canbeUsed && this.humanModelControls.onHandleControlPanoramaMove(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.onHandleControlPanoramaMove()
  18404. }, f.prototype.onFlyEnd = function() {
  18405. "panorama" === this.player.mode && (this.humanModelControls.onFlyEnd(), this.measuringToolControls.onFlyEnd(), this.virtualCameraFovControls.onFlyEnd())
  18406. }, f.prototype.onPlayerMouseMove = function(t) {
  18407. this.MouseStateMachine.MOVE.state = !0, this.MouseStateMachine.MOVE.callback()
  18408. }, f.prototype.onPlayerMouseDown = function(t) {
  18409. var e = t.button,
  18410. i = this.MOUSE.button["_" + e];
  18411. i && (this.MouseStateMachine[i].state = !0, this.MouseStateMachine[i].status.mousedown.state = !0, this.MouseStateMachine[i].status.mouseup.state = !1, this.MouseStateMachine[i].status.mousedown.callback()), this.MouseStateMachine.MOVE.state = !1
  18412. }, f.prototype.onPlayerMouseUp = function(t) {
  18413. var e = t.button,
  18414. i = this.MOUSE.button["_" + e];
  18415. i && (this.MouseStateMachine[i].state = !0, this.MouseStateMachine[i].status.mousedown.state = !1, this.MouseStateMachine[i].status.mouseup.state = !0, this.MouseStateMachine[i].status.mouseup.callback()), this.MouseStateMachine.MOVE.state = !1
  18416. }, f.prototype.onPlayerKeyUp = function(t) {
  18417. var e = t.keyCode ? t.keyCode : t.which;
  18418. this.KEYS["k_" + e] && (this.KeysStateMachine[this.KEYS["k_" + e]].state = !0, this.KeysStateMachine[this.KEYS["k_" + e]].status.keyup.state = !0, this.KeysStateMachine[this.KEYS["k_" + e]].status.keyup.callback())
  18419. }, f.prototype.onPlayerKeyUpPlayerContainer = function(t) {
  18420. var e = t.keyCode ? t.keyCode : t.which;
  18421. this.KEYS["k_" + e] && (this.KeysStateMachine[this.KEYS["k_" + e]].state = !0, this.KeysStateMachine[this.KEYS["k_" + e]].status.keyup.state = !0, this.KeysStateMachine[this.KEYS["k_" + e]].status.keyup.callback())
  18422. };
  18423. var g = !1;
  18424. f.prototype.onCameraPositionMove = function() {
  18425. g = !1, "panorama" === this.player.mode && this.virtualCameraFovControls && this.virtualCameraFovControls.onCameraPositionMove()
  18426. }, f.prototype.onCameraPositionMoveStop = function() {
  18427. g || (g = !0, "panorama" === this.player.mode && this.virtualCameraFovControls && this.virtualCameraFovControls.onCameraPositionMoveStop())
  18428. };
  18429. var v = !1;
  18430. f.prototype.onCameraRotationMove = function() {
  18431. v = !1, "panorama" === this.player.mode && this.virtualCameraFovControls && this.virtualCameraFovControls.onCameraRotationMove()
  18432. }, f.prototype.onCameraRotationMoveStop = function() {
  18433. v || (v = !0, "panorama" === this.player.mode && this.virtualCameraFovControls && this.virtualCameraFovControls.onCameraRotationMoveStop())
  18434. }, f.prototype._emitHumanFollowMouse = function() {
  18435. this.isEscPutModel = !1, this._isPuttingModel = !0, this.switchPutModelCanbeSelect(!1), this.player.emit("hide-right-tools"), this.player.emit("put-model-follow-mouse"), this.switchMouseWheelLocked(!0)
  18436. }, f.prototype._emitHumanPutOver = function() {
  18437. this.isEscPutModel = !1, this._isPuttingModel = !1, this.switchPutModelCanbeSelect(!0), this.player.emit("show-right-tools"), this.player.emit("put-model-follow-mouse-over"), this.switchMouseWheelLocked(!1)
  18438. }, f.prototype._emitHumanPutCancel = function() {
  18439. this.isEscPutModel = !0, this._isPuttingModel = !1, this.switchPutModelCanbeSelect(!0), this.player.emit("show-right-tools"), this.player.emit("put-model-follow-mouse-cancel"), this.switchMouseWheelLocked(!1)
  18440. }, f.prototype._emitHumanHandleChoosed = function() {
  18441. this.switchMouseWheelLocked(!0)
  18442. }, f.prototype._emitHumanUnChoosed = function() {
  18443. this.switchMouseWheelLocked(!1)
  18444. }, f.prototype._emitWeaponFollowMouse = function() {
  18445. this.isEscPutModel = !1, this._isPuttingModel = !0, this.switchPutModelCanbeSelect(!1), this.player.emit("hide-right-tools"), this.player.emit("put-model-follow-mouse"), this.switchMouseWheelLocked(!0)
  18446. }, f.prototype._emitWeaponPutOver = function() {
  18447. this.isEscPutModel = !1, this._isPuttingModel = !1, this.switchPutModelCanbeSelect(!0), this.player.emit("show-right-tools"), this.player.emit("put-model-follow-mouse-over"), this.switchMouseWheelLocked(!1)
  18448. }, f.prototype._emitWeaponPutCancel = function() {
  18449. this.isEscPutModel = !0, this._isPuttingModel = !1, this.switchPutModelCanbeSelect(!0), this.player.emit("show-right-tools"), this.player.emit("put-model-follow-mouse-cancel"), this.switchMouseWheelLocked(!1)
  18450. }, f.prototype._emitWeaponHandleChoosed = function() {
  18451. this.switchMouseWheelLocked(!0)
  18452. }, f.prototype._emitWeaponUnChoosed = function() {
  18453. this.switchMouseWheelLocked(!1)
  18454. }, f.prototype._emitVirtualCameraFollowMouse = function() {
  18455. this.isEscPutModel = !1, this._isPuttingModel = !0, this.switchPutModelCanbeSelect(!1), this.player.emit("hide-right-tools"), this.player.emit("put-model-follow-mouse"), this.switchMouseWheelLocked(!0)
  18456. }, f.prototype._emitVirtualCameraFollowMouseOver = function() {
  18457. this.isEscPutModel = !1, this._isPuttingModel = !1, this.switchPutModelCanbeSelect(!0), this.player.emit("show-right-tools"), this.player.emit("put-model-follow-mouse-over"), this.switchMouseWheelLocked(!1)
  18458. }, f.prototype._emitVirtualCameraPutCancel = function() {
  18459. this.isEscPutModel = !0, this._isPuttingModel = !1, this.switchPutModelCanbeSelect(!0), this.player.emit("show-right-tools"), this.player.emit("put-model-follow-mouse-cancel"), this.switchMouseWheelLocked(!1)
  18460. }, f.prototype._emitVirtualCameraHandleChoosed = function() {
  18461. this.switchMouseWheelLocked(!0)
  18462. }, f.prototype._emitVirtualCameraUnChoosed = function() {
  18463. this.switchMouseWheelLocked(!1)
  18464. }, f.prototype._emitPostilFollowMouse = function() {
  18465. this._isPuttingModel = !0, this.player.emit("put-model-follow-mouse")
  18466. }, f.prototype._emitPostilPutOver = function() {
  18467. this._isPuttingModel = !1, this.player.emit("put-model-follow-mouse-over")
  18468. }, f.prototype._emitPostilPutCancel = function() {
  18469. this._isPuttingModel = !1, this.player.emit("put-model-follow-mouse-cancel")
  18470. }, f.prototype._emitVirtualCameraMouseIn = function() {
  18471. this.switchMouseWheelLocked(!0)
  18472. }, f.prototype._emitVirtualCameraMouseOut = function() {
  18473. this.switchMouseWheelLocked(!1)
  18474. }, f.prototype._emitHumanMouseIn = function() {
  18475. this.switchMouseWheelLocked(!0)
  18476. }, f.prototype._emitHumanMouseOut = function() {
  18477. this.switchMouseWheelLocked(!1)
  18478. }, f.prototype.updateCameraChangeList = function() {
  18479. var t = this.sRender.camera.position.clone(),
  18480. e = this.sRender.camera.rotation.clone();
  18481. this.recordCameraPositionChangeList.push(t), this.recordCameraRotationChangeList.push(e), this.checkCameraChangeList()
  18482. };
  18483. f.prototype.update = function(t) {
  18484. this.updateCameraChangeList(), this.virtualCameraFovControls.update(t), this.humanModelAnimationControls.update(t), this.humanModelControls.update(t), this.weaponModelControls.update(t), this.measuringToolControls.update(t), this.postilControls.update(t), this.checkPlayerMode(this.player.mode)
  18485. }, t.exports = f
  18486. }, function(t, e, i) {
  18487. "use strict";
  18488. i(120);
  18489. var n = i(0);
  18490. function r() {}
  18491. r.prototype.load = function(t) {
  18492. var e = new n.FBXLoaderOfMeshMatcapMaterial;
  18493. return new Promise((function(i, n) {
  18494. e.load(t, (function(t) {
  18495. t ? i(t) : n("FBXLoader Failed")
  18496. }))
  18497. }))
  18498. }, t.exports = new r
  18499. }, function(t, e, i) {
  18500. var n = i(0);
  18501. n.FBXLoaderOfMeshMatcapMaterial = function() {
  18502. var t, e, i;
  18503. function r(t) {
  18504. this.manager = void 0 !== t ? t : n.DefaultLoadingManager
  18505. }
  18506. function o(t) {
  18507. this.textureLoader = t
  18508. }
  18509. function a() {}
  18510. function s() {}
  18511. function l() {}
  18512. function u() {}
  18513. function h(t, e) {
  18514. this.dv = new DataView(t), this.offset = 0, this.littleEndian = void 0 === e || e
  18515. }
  18516. function c() {}
  18517. function d(t) {
  18518. var e = t.match(/FBXVersion: (\d+)/);
  18519. if (e) return parseInt(e[1]);
  18520. throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")
  18521. }
  18522. function p(t) {
  18523. return t / 46186158e3
  18524. }
  18525. r.prototype = {
  18526. constructor: r,
  18527. crossOrigin: "anonymous",
  18528. load: function(t, e, i, r) {
  18529. var o = this,
  18530. a = void 0 === o.path ? n.LoaderUtils.extractUrlBase(t) : o.path,
  18531. s = new n.FileLoader(this.manager);
  18532. s.setPath(o.path), s.setResponseType("arraybuffer"), s.load(t, (function(i) {
  18533. try {
  18534. e(o.parse(i, a))
  18535. } catch (e) {
  18536. setTimeout((function() {
  18537. r && r(e), o.manager.itemError(t)
  18538. }), 0)
  18539. }
  18540. }), i, r)
  18541. },
  18542. setPath: function(t) {
  18543. return this.path = t, this
  18544. },
  18545. setResourcePath: function(t) {
  18546. return this.resourcePath = t, this
  18547. },
  18548. setCrossOrigin: function(t) {
  18549. return this.crossOrigin = t, this
  18550. },
  18551. parse: function(e, i) {
  18552. if (s = "Kaydara FBX Binary \0", (a = e)
  18553. .byteLength >= s.length && s === x(a, 0, s.length)) t = (new u)
  18554. .parse(e);
  18555. else {
  18556. var r = x(e);
  18557. if (! function(t) {
  18558. var e = ["K", "a", "y", "d", "a", "r", "a", "\\", "F", "B", "X", "\\", "B", "i", "n", "a", "r", "y", "\\", "\\"],
  18559. i = 0;
  18560. for (var n = 0; n < e.length; ++n) {
  18561. if ((o = void 0, o = t[(r = 1) - 1], t = t.slice(i + r), i++, o) === e[n]) return !1
  18562. }
  18563. var r, o;
  18564. return !0
  18565. }(r)) throw new Error("THREE.FBXLoader: Unknown format.");
  18566. if (d(r) < 7e3) throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: " + d(r));
  18567. t = (new l)
  18568. .parse(r)
  18569. }
  18570. var a, s;
  18571. return new o(new n.TextureLoader(this.manager)
  18572. .setPath(this.resourcePath || i)
  18573. .setCrossOrigin(this.crossOrigin))
  18574. .parse(t)
  18575. }
  18576. }, o.prototype = {
  18577. constructor: o,
  18578. parse: function() {
  18579. e = this.parseConnections();
  18580. var t = this.parseImages(),
  18581. n = this.parseTextures(t),
  18582. r = this.parseMaterials(n),
  18583. o = this.parseDeformers(),
  18584. s = (new a)
  18585. .parse(o);
  18586. return this.parseScene(o, s, r), i
  18587. },
  18588. parseConnections: function() {
  18589. var e = new Map;
  18590. "Connections" in t && t.Connections.connections.forEach((function(t) {
  18591. var i = t[0],
  18592. n = t[1],
  18593. r = t[2];
  18594. e.has(i) || e.set(i, {
  18595. parents: [],
  18596. children: []
  18597. });
  18598. var o = {
  18599. ID: n,
  18600. relationship: r
  18601. };
  18602. e.get(i)
  18603. .parents.push(o), e.has(n) || e.set(n, {
  18604. parents: [],
  18605. children: []
  18606. });
  18607. var a = {
  18608. ID: i,
  18609. relationship: r
  18610. };
  18611. e.get(n)
  18612. .children.push(a)
  18613. }));
  18614. return e
  18615. },
  18616. parseImages: function() {
  18617. var e = {},
  18618. i = {};
  18619. if ("Video" in t.Objects) {
  18620. var n = t.Objects.Video;
  18621. for (var r in n) {
  18622. var o = n[r];
  18623. if (e[u = parseInt(r)] = o.RelativeFilename || o.Filename, "Content" in o) {
  18624. var a = o.Content instanceof ArrayBuffer && o.Content.byteLength > 0,
  18625. s = "string" == typeof o.Content && "" !== o.Content;
  18626. if (a || s) {
  18627. var l = this.parseImage(n[r]);
  18628. i[o.RelativeFilename || o.Filename] = l
  18629. }
  18630. }
  18631. }
  18632. }
  18633. for (var u in e) {
  18634. var h = e[u];
  18635. void 0 !== i[h] ? e[u] = i[h] : e[u] = e[u].split("\\")
  18636. .pop()
  18637. }
  18638. return e
  18639. },
  18640. parseImage: function(t) {
  18641. var e, i = t.Content,
  18642. r = t.RelativeFilename || t.Filename;
  18643. switch (r.slice(r.lastIndexOf(".") + 1)
  18644. .toLowerCase()) {
  18645. case "bmp":
  18646. e = "image/bmp";
  18647. break;
  18648. case "jpg":
  18649. case "jpeg":
  18650. e = "image/jpeg";
  18651. break;
  18652. case "png":
  18653. e = "image/png";
  18654. break;
  18655. case "tif":
  18656. e = "image/tiff";
  18657. break;
  18658. case "tga":
  18659. if ("function" != typeof n.TGALoader) return;
  18660. if (null === n.Loader.Handlers.get(".tga")) {
  18661. var o = new n.TGALoader;
  18662. o.setPath(this.textureLoader.path), n.Loader.Handlers.add(/\.tga$/i, o)
  18663. }
  18664. e = "image/tga";
  18665. break;
  18666. default:
  18667. return
  18668. }
  18669. if ("string" == typeof i) return "data:" + e + ";base64," + i;
  18670. var a = new Uint8Array(i);
  18671. return window.URL.createObjectURL(new Blob([a], {
  18672. type: e
  18673. }))
  18674. },
  18675. parseTextures: function(e) {
  18676. var i = new Map;
  18677. if ("Texture" in t.Objects) {
  18678. var n = t.Objects.Texture;
  18679. for (var r in n) {
  18680. var o = this.parseTexture(n[r], e);
  18681. i.set(parseInt(r), o)
  18682. }
  18683. }
  18684. return i
  18685. },
  18686. parseTexture: function(t, e) {
  18687. var i = this.loadTexture(t, e);
  18688. i.ID = t.id, i.name = t.attrName;
  18689. var r = t.WrapModeU,
  18690. o = t.WrapModeV,
  18691. a = void 0 !== r ? r.value : 0,
  18692. s = void 0 !== o ? o.value : 0;
  18693. if (i.wrapS = 0 === a ? n.RepeatWrapping : n.ClampToEdgeWrapping, i.wrapT = 0 === s ? n.RepeatWrapping : n.ClampToEdgeWrapping, "Scaling" in t) {
  18694. var l = t.Scaling.value;
  18695. i.repeat.x = l[0], i.repeat.y = l[1]
  18696. }
  18697. return i
  18698. },
  18699. loadTexture: function(t, i) {
  18700. var r, o, a = this.textureLoader.path,
  18701. s = e.get(t.id)
  18702. .children;
  18703. void 0 !== s && s.length > 0 && void 0 !== i[s[0].ID] && (0 !== (r = i[s[0].ID])
  18704. .indexOf("blob:") && 0 !== r.indexOf("data:") || this.textureLoader.setPath(void 0));
  18705. var l = t.FileName.slice(-3)
  18706. .toLowerCase();
  18707. if ("tga" === l) {
  18708. var u = n.Loader.Handlers.get(".tga");
  18709. o = null === u ? new n.Texture : u.load(r)
  18710. } else o = "psd" === l ? new n.Texture : this.textureLoader.load(r);
  18711. return this.textureLoader.setPath(a), o
  18712. },
  18713. parseMaterials: function(e) {
  18714. var i = new Map;
  18715. if ("Material" in t.Objects) {
  18716. var n = t.Objects.Material;
  18717. for (var r in n) {
  18718. var o = this.parseMaterial(n[r], e);
  18719. null !== o && i.set(parseInt(r), o)
  18720. }
  18721. }
  18722. return i
  18723. },
  18724. parseMaterial: function(t, i) {
  18725. var r = t.id,
  18726. o = t.attrName,
  18727. a = t.ShadingModel;
  18728. if ("object" == typeof a && (a = a.value), !e.has(r)) return null;
  18729. var s, l = this.parseParameters(t, i, r);
  18730. switch (a.toLowerCase()) {
  18731. case "phong":
  18732. s = new n.MeshMatcapMaterial;
  18733. break;
  18734. case "lambert":
  18735. s = new n.MeshLambertMaterial;
  18736. break;
  18737. default:
  18738. s = new n.MeshMatcapMaterial
  18739. }
  18740. return s.setValues(l), s.name = o, s
  18741. },
  18742. parseParameters: function(t, i, r) {
  18743. var o = {};
  18744. t.BumpFactor && (o.bumpScale = t.BumpFactor.value), t.Diffuse ? o.color = (new n.Color)
  18745. .fromArray(t.Diffuse.value) : t.DiffuseColor && "Color" === t.DiffuseColor.type && (o.color = (new n.Color)
  18746. .fromArray(t.DiffuseColor.value)), t.DisplacementFactor && (o.displacementScale = t.DisplacementFactor.value), t.Opacity && (o.opacity = parseFloat(t.Opacity.value)), o.opacity < 1 && (o.transparent = !0), t.ReflectionFactor && (o.reflectivity = t.ReflectionFactor.value);
  18747. var a = this;
  18748. return e.get(r)
  18749. .children.forEach((function(t) {
  18750. switch (t.relationship) {
  18751. case "Bump":
  18752. o.bumpMap = a.getTexture(i, t.ID);
  18753. break;
  18754. case "Maya|TEX_ao_map":
  18755. o.aoMap = a.getTexture(i, t.ID);
  18756. break;
  18757. case "DiffuseColor":
  18758. case "Maya|TEX_color_map":
  18759. o.map = a.getTexture(i, t.ID);
  18760. break;
  18761. case "DisplacementColor":
  18762. o.displacementMap = a.getTexture(i, t.ID);
  18763. break;
  18764. case "EmissiveColor":
  18765. o.emissiveMap = a.getTexture(i, t.ID);
  18766. break;
  18767. case "NormalMap":
  18768. case "Maya|TEX_normal_map":
  18769. o.normalMap = a.getTexture(i, t.ID);
  18770. break;
  18771. case "ReflectionColor":
  18772. o.envMap = a.getTexture(i, t.ID), o.envMap.mapping = n.EquirectangularReflectionMapping;
  18773. break;
  18774. case "SpecularColor":
  18775. o.specularMap = a.getTexture(i, t.ID);
  18776. break;
  18777. case "TransparentColor":
  18778. o.alphaMap = a.getTexture(i, t.ID), o.transparent = !0
  18779. }
  18780. })), o
  18781. },
  18782. getTexture: function(i, n) {
  18783. return "LayeredTexture" in t.Objects && n in t.Objects.LayeredTexture && (n = e.get(n)
  18784. .children[0].ID), i.get(n)
  18785. },
  18786. parseDeformers: function() {
  18787. var i = {},
  18788. n = {};
  18789. if ("Deformer" in t.Objects) {
  18790. var r = t.Objects.Deformer;
  18791. for (var o in r) {
  18792. var a = r[o],
  18793. s = e.get(parseInt(o));
  18794. if ("Skin" === a.attrType) {
  18795. var l = this.parseSkeleton(s, r);
  18796. l.ID = o, s.parents.length, l.geometryID = s.parents[0].ID, i[o] = l
  18797. } else if ("BlendShape" === a.attrType) {
  18798. var u = {
  18799. id: o
  18800. };
  18801. u.rawTargets = this.parseMorphTargets(s, r), u.id = o, s.parents.length, n[o] = u
  18802. }
  18803. }
  18804. }
  18805. return {
  18806. skeletons: i,
  18807. morphTargets: n
  18808. }
  18809. },
  18810. parseSkeleton: function(t, e) {
  18811. var i = [];
  18812. return t.children.forEach((function(t) {
  18813. var r = e[t.ID];
  18814. if ("Cluster" === r.attrType) {
  18815. var o = {
  18816. ID: t.ID,
  18817. indices: [],
  18818. weights: [],
  18819. transformLink: (new n.Matrix4)
  18820. .fromArray(r.TransformLink.a)
  18821. };
  18822. "Indexes" in r && (o.indices = r.Indexes.a, o.weights = r.Weights.a), i.push(o)
  18823. }
  18824. })), {
  18825. rawBones: i,
  18826. bones: []
  18827. }
  18828. },
  18829. parseMorphTargets: function(t, i) {
  18830. for (var n = [], r = 0; r < t.children.length; r++) {
  18831. var o = t.children[r],
  18832. a = i[o.ID],
  18833. s = {
  18834. name: a.attrName,
  18835. initialWeight: a.DeformPercent,
  18836. id: a.id,
  18837. fullWeights: a.FullWeights.a
  18838. };
  18839. if ("BlendShapeChannel" !== a.attrType) return;
  18840. s.geoID = e.get(parseInt(o.ID))
  18841. .children.filter((function(t) {
  18842. return void 0 === t.relationship
  18843. }))[0].ID, n.push(s)
  18844. }
  18845. return n
  18846. },
  18847. parseScene: function(r, o, a) {
  18848. i = new n.Group;
  18849. var l = this.parseModels(r.skeletons, o, a),
  18850. u = t.Objects.Model,
  18851. h = this;
  18852. l.forEach((function(t) {
  18853. var n = u[t.ID];
  18854. h.setLookAtProperties(t, n), e.get(t.ID)
  18855. .parents.forEach((function(e) {
  18856. var i = l.get(e.ID);
  18857. void 0 !== i && i.add(t)
  18858. })), null === t.parent && i.add(t)
  18859. })), this.bindSkeleton(r.skeletons, o, l), this.createAmbientLight(), this.setupMorphMaterials(), i.traverse((function(t) {
  18860. if (t.userData.transformData) {
  18861. t.parent && (t.userData.transformData.parentMatrixWorld = t.parent.matrix);
  18862. var e = y(t.userData.transformData);
  18863. t.applyMatrix(e)
  18864. }
  18865. }));
  18866. var c = (new s)
  18867. .parse();
  18868. 1 === i.children.length && i.children[0].isGroup && (i.children[0].animations = c, i = i.children[0]), i.animations = c
  18869. },
  18870. parseModels: function(i, r, o) {
  18871. var a = new Map,
  18872. s = t.Objects.Model;
  18873. for (var l in s) {
  18874. var u = parseInt(l),
  18875. h = s[l],
  18876. c = e.get(u),
  18877. d = this.buildSkeleton(c, i, u, h.attrName);
  18878. if (!d) {
  18879. switch (h.attrType) {
  18880. case "Camera":
  18881. d = this.createCamera(c);
  18882. break;
  18883. case "Light":
  18884. d = this.createLight(c);
  18885. break;
  18886. case "Mesh":
  18887. d = this.createMesh(c, r, o);
  18888. break;
  18889. case "NurbsCurve":
  18890. d = this.createCurve(c, r);
  18891. break;
  18892. case "LimbNode":
  18893. case "Root":
  18894. d = new n.Bone;
  18895. break;
  18896. case "Null":
  18897. default:
  18898. d = new n.Group
  18899. }
  18900. d.name = n.PropertyBinding.sanitizeNodeName(h.attrName), d.ID = u
  18901. }
  18902. this.getTransformData(d, h), a.set(u, d)
  18903. }
  18904. return a
  18905. },
  18906. buildSkeleton: function(t, e, i, r) {
  18907. var o = null;
  18908. return t.parents.forEach((function(t) {
  18909. for (var a in e) {
  18910. var s = e[a];
  18911. s.rawBones.forEach((function(e, a) {
  18912. if (e.ID === t.ID) {
  18913. var l = o;
  18914. (o = new n.Bone)
  18915. .matrixWorld.copy(e.transformLink), o.name = n.PropertyBinding.sanitizeNodeName(r), o.ID = i, s.bones[a] = o, null !== l && o.add(l)
  18916. }
  18917. }))
  18918. }
  18919. })), o
  18920. },
  18921. createCamera: function(e) {
  18922. var i, r;
  18923. if (e.children.forEach((function(e) {
  18924. var i = t.Objects.NodeAttribute[e.ID];
  18925. void 0 !== i && (r = i)
  18926. })), void 0 === r) i = new n.Object3D;
  18927. else {
  18928. var o = 0;
  18929. void 0 !== r.CameraProjectionType && 1 === r.CameraProjectionType.value && (o = 1);
  18930. var a = 1;
  18931. void 0 !== r.NearPlane && (a = r.NearPlane.value / 1e3);
  18932. var s = 1e3;
  18933. void 0 !== r.FarPlane && (s = r.FarPlane.value / 1e3);
  18934. var l = (window.renderWidth || window.innerWidth),
  18935. u = (window.renderHeight || window.innerHeight);
  18936. void 0 !== r.AspectWidth && void 0 !== r.AspectHeight && (l = r.AspectWidth.value, u = r.AspectHeight.value);
  18937. var h = l / u,
  18938. c = 45;
  18939. void 0 !== r.FieldOfView && (c = r.FieldOfView.value);
  18940. var d = r.FocalLength ? r.FocalLength.value : null;
  18941. switch (o) {
  18942. case 0:
  18943. i = new n.PerspectiveCamera(c, h, a, s), null !== d && i.setFocalLength(d);
  18944. break;
  18945. case 1:
  18946. i = new n.OrthographicCamera(-l / 2, l / 2, u / 2, -u / 2, a, s);
  18947. break;
  18948. default:
  18949. i = new n.Object3D
  18950. }
  18951. }
  18952. return i
  18953. },
  18954. createLight: function(e) {
  18955. var i, r;
  18956. if (e.children.forEach((function(e) {
  18957. var i = t.Objects.NodeAttribute[e.ID];
  18958. void 0 !== i && (r = i)
  18959. })), void 0 === r) i = new n.Object3D;
  18960. else {
  18961. var o;
  18962. o = void 0 === r.LightType ? 0 : r.LightType.value;
  18963. var a = 16777215;
  18964. void 0 !== r.Color && (a = (new n.Color)
  18965. .fromArray(r.Color.value));
  18966. var s = void 0 === r.Intensity ? 1 : r.Intensity.value / 100;
  18967. void 0 !== r.CastLightOnObject && 0 === r.CastLightOnObject.value && (s = 0);
  18968. var l = 0;
  18969. void 0 !== r.FarAttenuationEnd && (l = void 0 !== r.EnableFarAttenuation && 0 === r.EnableFarAttenuation.value ? 0 : r.FarAttenuationEnd.value);
  18970. switch (o) {
  18971. case 0:
  18972. i = new n.PointLight(a, s, l, 1);
  18973. break;
  18974. case 1:
  18975. i = new n.DirectionalLight(a, s);
  18976. break;
  18977. case 2:
  18978. var u = Math.PI / 3;
  18979. void 0 !== r.InnerAngle && (u = n.Math.degToRad(r.InnerAngle.value));
  18980. var h = 0;
  18981. void 0 !== r.OuterAngle && (h = n.Math.degToRad(r.OuterAngle.value), h = Math.max(h, 1)), i = new n.SpotLight(a, s, l, u, h, 1);
  18982. break;
  18983. default:
  18984. i = new n.PointLight(a, s)
  18985. }
  18986. void 0 !== r.CastShadows && 1 === r.CastShadows.value && (i.castShadow = !0)
  18987. }
  18988. return i
  18989. },
  18990. createMesh: function(t, e, i) {
  18991. var r, o = null,
  18992. a = null,
  18993. s = [];
  18994. return t.children.forEach((function(t) {
  18995. e.has(t.ID) && (o = e.get(t.ID)), i.has(t.ID) && s.push(i.get(t.ID))
  18996. })), s.length > 1 ? a = s : s.length > 0 ? a = s[0] : (a = new n.MeshMatcapMaterial({
  18997. color: 13421772
  18998. }), s.push(a)), "color" in o.attributes && s.forEach((function(t) {
  18999. t.vertexColors = n.VertexColors
  19000. })), o.FBX_Deformer ? (s.forEach((function(t) {
  19001. t.skinning = !0
  19002. })), (r = new n.SkinnedMesh(o, a))
  19003. .normalizeSkinWeights()) : r = new n.Mesh(o, a), r
  19004. },
  19005. createCurve: function(t, e) {
  19006. var i = t.children.reduce((function(t, i) {
  19007. return e.has(i.ID) && (t = e.get(i.ID)), t
  19008. }), null),
  19009. r = new n.LineBasicMaterial({
  19010. color: 3342591,
  19011. linewidth: 1
  19012. });
  19013. return new n.Line(i, r)
  19014. },
  19015. getTransformData: function(t, e) {
  19016. var i = {};
  19017. "InheritType" in e && (i.inheritType = parseInt(e.InheritType.value)), i.eulerOrder = "RotationOrder" in e ? b(e.RotationOrder.value) : "ZYX", "Lcl_Translation" in e && (i.translation = e.Lcl_Translation.value), "PreRotation" in e && (i.preRotation = e.PreRotation.value), "Lcl_Rotation" in e && (i.rotation = e.Lcl_Rotation.value), "PostRotation" in e && (i.postRotation = e.PostRotation.value), "Lcl_Scaling" in e && (i.scale = e.Lcl_Scaling.value), "ScalingOffset" in e && (i.scalingOffset = e.ScalingOffset.value), "ScalingPivot" in e && (i.scalingPivot = e.ScalingPivot.value), "RotationOffset" in e && (i.rotationOffset = e.RotationOffset.value), "RotationPivot" in e && (i.rotationPivot = e.RotationPivot.value), t.userData.transformData = i
  19018. },
  19019. setLookAtProperties: function(r, o) {
  19020. "LookAtProperty" in o && e.get(r.ID)
  19021. .children.forEach((function(e) {
  19022. if ("LookAtProperty" === e.relationship) {
  19023. var o = t.Objects.Model[e.ID];
  19024. if ("Lcl_Translation" in o) {
  19025. var a = o.Lcl_Translation.value;
  19026. void 0 !== r.target ? (r.target.position.fromArray(a), i.add(r.target)) : r.lookAt((new n.Vector3)
  19027. .fromArray(a))
  19028. }
  19029. }
  19030. }))
  19031. },
  19032. bindSkeleton: function(t, i, r) {
  19033. var o = this.parsePoseNodes();
  19034. for (var a in t) {
  19035. var s = t[a];
  19036. e.get(parseInt(s.ID))
  19037. .parents.forEach((function(t) {
  19038. if (i.has(t.ID)) {
  19039. var a = t.ID;
  19040. e.get(a)
  19041. .parents.forEach((function(t) {
  19042. r.has(t.ID) && r.get(t.ID)
  19043. .bind(new n.Skeleton(s.bones), o[t.ID])
  19044. }))
  19045. }
  19046. }))
  19047. }
  19048. },
  19049. parsePoseNodes: function() {
  19050. var e = {};
  19051. if ("Pose" in t.Objects) {
  19052. var i = t.Objects.Pose;
  19053. for (var r in i)
  19054. if ("BindPose" === i[r].attrType) {
  19055. var o = i[r].PoseNode;
  19056. Array.isArray(o) ? o.forEach((function(t) {
  19057. e[t.Node] = (new n.Matrix4)
  19058. .fromArray(t.Matrix.a)
  19059. })) : e[o.Node] = (new n.Matrix4)
  19060. .fromArray(o.Matrix.a)
  19061. }
  19062. }
  19063. return e
  19064. },
  19065. createAmbientLight: function() {
  19066. if ("GlobalSettings" in t && "AmbientColor" in t.GlobalSettings) {
  19067. var e = t.GlobalSettings.AmbientColor.value,
  19068. r = e[0],
  19069. o = e[1],
  19070. a = e[2];
  19071. if (0 !== r || 0 !== o || 0 !== a) {
  19072. var s = new n.Color(r, o, a);
  19073. i.add(new n.AmbientLight(s, 1))
  19074. }
  19075. }
  19076. },
  19077. setupMorphMaterials: function() {
  19078. var t = this;
  19079. i.traverse((function(e) {
  19080. e.isMesh && e.geometry.morphAttributes.position && e.geometry.morphAttributes.position.length && (Array.isArray(e.material) ? e.material.forEach((function(i, n) {
  19081. t.setupMorphMaterial(e, i, n)
  19082. })) : t.setupMorphMaterial(e, e.material))
  19083. }))
  19084. },
  19085. setupMorphMaterial: function(t, e, n) {
  19086. var r = t.uuid,
  19087. o = e.uuid,
  19088. a = !1;
  19089. if (i.traverse((function(t) {
  19090. t.isMesh && (Array.isArray(t.material) ? t.material.forEach((function(e) {
  19091. e.uuid === o && t.uuid !== r && (a = !0)
  19092. })) : t.material.uuid === o && t.uuid !== r && (a = !0))
  19093. })), !0 === a) {
  19094. var s = e.clone();
  19095. s.morphTargets = !0, void 0 === n ? t.material = s : t.material[n] = s
  19096. } else e.morphTargets = !0
  19097. }
  19098. }, a.prototype = {
  19099. constructor: a,
  19100. parse: function(i) {
  19101. var n = new Map;
  19102. if ("Geometry" in t.Objects) {
  19103. var r = t.Objects.Geometry;
  19104. for (var o in r) {
  19105. var a = e.get(parseInt(o)),
  19106. s = this.parseGeometry(a, r[o], i);
  19107. n.set(parseInt(o), s)
  19108. }
  19109. }
  19110. return n
  19111. },
  19112. parseGeometry: function(t, e, i) {
  19113. switch (e.attrType) {
  19114. case "Mesh":
  19115. return this.parseMeshGeometry(t, e, i);
  19116. case "NurbsCurve":
  19117. return this.parseNurbsGeometry(e)
  19118. }
  19119. },
  19120. parseMeshGeometry: function(e, i, n) {
  19121. var r = n.skeletons,
  19122. o = n.morphTargets,
  19123. a = e.parents.map((function(e) {
  19124. return t.Objects.Model[e.ID]
  19125. }));
  19126. if (0 !== a.length) {
  19127. var s = e.children.reduce((function(t, e) {
  19128. return void 0 !== r[e.ID] && (t = r[e.ID]), t
  19129. }), null),
  19130. l = e.children.reduce((function(t, e) {
  19131. return void 0 !== o[e.ID] && (t = o[e.ID]), t
  19132. }), null),
  19133. u = a[0],
  19134. h = {};
  19135. "RotationOrder" in u && (h.eulerOrder = b(u.RotationOrder.value)), "InheritType" in u && (h.inheritType = parseInt(u.InheritType.value)), "GeometricTranslation" in u && (h.translation = u.GeometricTranslation.value), "GeometricRotation" in u && (h.rotation = u.GeometricRotation.value), "GeometricScaling" in u && (h.scale = u.GeometricScaling.value);
  19136. var c = y(h);
  19137. return this.genGeometry(i, s, l, c)
  19138. }
  19139. },
  19140. genGeometry: function(t, e, i, r) {
  19141. var o = new n.BufferGeometry;
  19142. t.attrName && (o.name = t.attrName);
  19143. var a = this.parseGeoNode(t, e),
  19144. s = this.genBuffers(a),
  19145. l = new n.Float32BufferAttribute(s.vertex, 3);
  19146. if (r.applyToBufferAttribute(l), o.addAttribute("position", l), s.colors.length > 0 && o.addAttribute("color", new n.Float32BufferAttribute(s.colors, 3)), e && (o.addAttribute("skinIndex", new n.Uint16BufferAttribute(s.weightsIndices, 4)), o.addAttribute("skinWeight", new n.Float32BufferAttribute(s.vertexWeights, 4)), o.FBX_Deformer = e), s.normal.length > 0) {
  19147. var u = new n.Float32BufferAttribute(s.normal, 3);
  19148. (new n.Matrix3)
  19149. .getNormalMatrix(r)
  19150. .applyToBufferAttribute(u), o.addAttribute("normal", u)
  19151. }
  19152. if (s.uvs.forEach((function(t, e) {
  19153. var i = "uv" + (e + 1)
  19154. .toString();
  19155. 0 === e && (i = "uv"), o.addAttribute(i, new n.Float32BufferAttribute(s.uvs[e], 2))
  19156. })), a.material && "AllSame" !== a.material.mappingType) {
  19157. var h = s.materialIndex[0],
  19158. c = 0;
  19159. if (s.materialIndex.forEach((function(t, e) {
  19160. t !== h && (o.addGroup(c, e - c, h), h = t, c = e)
  19161. })), o.groups.length > 0) {
  19162. var d = o.groups[o.groups.length - 1],
  19163. p = d.start + d.count;
  19164. p !== s.materialIndex.length && o.addGroup(p, s.materialIndex.length - p, h)
  19165. }
  19166. 0 === o.groups.length && o.addGroup(0, s.materialIndex.length, s.materialIndex[0])
  19167. }
  19168. return this.addMorphTargets(o, t, i, r), o
  19169. },
  19170. parseGeoNode: function(t, e) {
  19171. var i = {};
  19172. if (i.vertexPositions = void 0 !== t.Vertices ? t.Vertices.a : [], i.vertexIndices = void 0 !== t.PolygonVertexIndex ? t.PolygonVertexIndex.a : [], t.LayerElementColor && (i.color = this.parseVertexColors(t.LayerElementColor[0])), t.LayerElementMaterial && (i.material = this.parseMaterialIndices(t.LayerElementMaterial[0])), t.LayerElementNormal && (i.normal = this.parseNormals(t.LayerElementNormal[0])), t.LayerElementUV) {
  19173. i.uv = [];
  19174. for (var n = 0; t.LayerElementUV[n];) i.uv.push(this.parseUVs(t.LayerElementUV[n])), n++
  19175. }
  19176. return i.weightTable = {}, null !== e && (i.skeleton = e, e.rawBones.forEach((function(t, e) {
  19177. t.indices.forEach((function(n, r) {
  19178. void 0 === i.weightTable[n] && (i.weightTable[n] = []), i.weightTable[n].push({
  19179. id: e,
  19180. weight: t.weights[r]
  19181. })
  19182. }))
  19183. }))), i
  19184. },
  19185. genBuffers: function(t) {
  19186. var e = {
  19187. vertex: [],
  19188. normal: [],
  19189. colors: [],
  19190. uvs: [],
  19191. materialIndex: [],
  19192. vertexWeights: [],
  19193. weightsIndices: []
  19194. },
  19195. i = 0,
  19196. n = 0,
  19197. r = !0,
  19198. o = [],
  19199. a = [],
  19200. s = [],
  19201. l = [],
  19202. u = [],
  19203. h = [],
  19204. c = this;
  19205. return t.vertexIndices.forEach((function(d, p) {
  19206. var f = !1;
  19207. d < 0 && (d ^= -1, f = !0);
  19208. var g = [],
  19209. v = [];
  19210. if (o.push(3 * d, 3 * d + 1, 3 * d + 2), t.color) {
  19211. var y = m(p, i, d, t.color);
  19212. s.push(y[0], y[1], y[2])
  19213. }
  19214. if (t.skeleton) {
  19215. if (void 0 !== t.weightTable[d] && t.weightTable[d].forEach((function(t) {
  19216. v.push(t.weight), g.push(t.id)
  19217. })), v.length > 4) {
  19218. r || (r = !0);
  19219. var b = [0, 0, 0, 0],
  19220. w = [0, 0, 0, 0];
  19221. v.forEach((function(t, e) {
  19222. var i = t,
  19223. n = g[e];
  19224. w.forEach((function(t, e, r) {
  19225. if (i > t) {
  19226. r[e] = i, i = t;
  19227. var o = b[e];
  19228. b[e] = n, n = o
  19229. }
  19230. }))
  19231. })), g = b, v = w
  19232. }
  19233. for (; v.length < 4;) v.push(0), g.push(0);
  19234. for (var x = 0; x < 4; ++x) u.push(v[x]), h.push(g[x])
  19235. }
  19236. if (t.normal) {
  19237. y = m(p, i, d, t.normal);
  19238. a.push(y[0], y[1], y[2])
  19239. }
  19240. if (t.material && "AllSame" !== t.material.mappingType) var M = m(p, i, d, t.material)[0];
  19241. t.uv && t.uv.forEach((function(t, e) {
  19242. var n = m(p, i, d, t);
  19243. void 0 === l[e] && (l[e] = []), l[e].push(n[0]), l[e].push(n[1])
  19244. })), n++, f && (c.genFace(e, t, o, M, a, s, l, u, h, n), i++, n = 0, o = [], a = [], s = [], l = [], u = [], h = [])
  19245. })), e
  19246. },
  19247. genFace: function(t, e, i, n, r, o, a, s, l, u) {
  19248. for (var h = 2; h < u; h++) t.vertex.push(e.vertexPositions[i[0]]), t.vertex.push(e.vertexPositions[i[1]]), t.vertex.push(e.vertexPositions[i[2]]), t.vertex.push(e.vertexPositions[i[3 * (h - 1)]]), t.vertex.push(e.vertexPositions[i[3 * (h - 1) + 1]]), t.vertex.push(e.vertexPositions[i[3 * (h - 1) + 2]]), t.vertex.push(e.vertexPositions[i[3 * h]]), t.vertex.push(e.vertexPositions[i[3 * h + 1]]), t.vertex.push(e.vertexPositions[i[3 * h + 2]]), e.skeleton && (t.vertexWeights.push(s[0]), t.vertexWeights.push(s[1]), t.vertexWeights.push(s[2]), t.vertexWeights.push(s[3]), t.vertexWeights.push(s[4 * (h - 1)]), t.vertexWeights.push(s[4 * (h - 1) + 1]), t.vertexWeights.push(s[4 * (h - 1) + 2]), t.vertexWeights.push(s[4 * (h - 1) + 3]), t.vertexWeights.push(s[4 * h]), t.vertexWeights.push(s[4 * h + 1]), t.vertexWeights.push(s[4 * h + 2]), t.vertexWeights.push(s[4 * h + 3]), t.weightsIndices.push(l[0]), t.weightsIndices.push(l[1]), t.weightsIndices.push(l[2]), t.weightsIndices.push(l[3]), t.weightsIndices.push(l[4 * (h - 1)]), t.weightsIndices.push(l[4 * (h - 1) + 1]), t.weightsIndices.push(l[4 * (h - 1) + 2]), t.weightsIndices.push(l[4 * (h - 1) + 3]), t.weightsIndices.push(l[4 * h]), t.weightsIndices.push(l[4 * h + 1]), t.weightsIndices.push(l[4 * h + 2]), t.weightsIndices.push(l[4 * h + 3])), e.color && (t.colors.push(o[0]), t.colors.push(o[1]), t.colors.push(o[2]), t.colors.push(o[3 * (h - 1)]), t.colors.push(o[3 * (h - 1) + 1]), t.colors.push(o[3 * (h - 1) + 2]), t.colors.push(o[3 * h]), t.colors.push(o[3 * h + 1]), t.colors.push(o[3 * h + 2])), e.material && "AllSame" !== e.material.mappingType && (t.materialIndex.push(n), t.materialIndex.push(n), t.materialIndex.push(n)), e.normal && (t.normal.push(r[0]), t.normal.push(r[1]), t.normal.push(r[2]), t.normal.push(r[3 * (h - 1)]), t.normal.push(r[3 * (h - 1) + 1]), t.normal.push(r[3 * (h - 1) + 2]), t.normal.push(r[3 * h]), t.normal.push(r[3 * h + 1]), t.normal.push(r[3 * h + 2])), e.uv && e.uv.forEach((function(e, i) {
  19249. void 0 === t.uvs[i] && (t.uvs[i] = []), t.uvs[i].push(a[i][0]), t.uvs[i].push(a[i][1]), t.uvs[i].push(a[i][2 * (h - 1)]), t.uvs[i].push(a[i][2 * (h - 1) + 1]), t.uvs[i].push(a[i][2 * h]), t.uvs[i].push(a[i][2 * h + 1])
  19250. }))
  19251. },
  19252. addMorphTargets: function(e, i, n, r) {
  19253. if (null !== n) {
  19254. e.morphAttributes.position = [];
  19255. var o = this;
  19256. n.rawTargets.forEach((function(n) {
  19257. var a = t.Objects.Geometry[n.geoID];
  19258. void 0 !== a && o.genMorphGeometry(e, i, a, r, n.name)
  19259. }))
  19260. }
  19261. },
  19262. genMorphGeometry: function(t, e, i, r, o) {
  19263. var a = new n.BufferGeometry;
  19264. i.attrName && (a.name = i.attrName);
  19265. for (var s = void 0 !== e.PolygonVertexIndex ? e.PolygonVertexIndex.a : [], l = void 0 !== e.Vertices ? e.Vertices.a.slice() : [], u = void 0 !== i.Vertices ? i.Vertices.a : [], h = void 0 !== i.Indexes ? i.Indexes.a : [], c = 0; c < h.length; c++) {
  19266. var d = 3 * h[c];
  19267. l[d] += u[3 * c], l[d + 1] += u[3 * c + 1], l[d + 2] += u[3 * c + 2]
  19268. }
  19269. var p = {
  19270. vertexIndices: s,
  19271. vertexPositions: l
  19272. },
  19273. f = this.genBuffers(p),
  19274. m = new n.Float32BufferAttribute(f.vertex, 3);
  19275. m.name = o || i.attrName, r.applyToBufferAttribute(m), t.morphAttributes.position.push(m)
  19276. },
  19277. parseNormals: function(t) {
  19278. var e = t.MappingInformationType,
  19279. i = t.ReferenceInformationType,
  19280. n = t.Normals.a,
  19281. r = [];
  19282. return "IndexToDirect" === i && ("NormalIndex" in t ? r = t.NormalIndex.a : "NormalsIndex" in t && (r = t.NormalsIndex.a)), {
  19283. dataSize: 3,
  19284. buffer: n,
  19285. indices: r,
  19286. mappingType: e,
  19287. referenceType: i
  19288. }
  19289. },
  19290. parseUVs: function(t) {
  19291. var e = t.MappingInformationType,
  19292. i = t.ReferenceInformationType,
  19293. n = t.UV.a,
  19294. r = [];
  19295. return "IndexToDirect" === i && (r = t.UVIndex.a), {
  19296. dataSize: 2,
  19297. buffer: n,
  19298. indices: r,
  19299. mappingType: e,
  19300. referenceType: i
  19301. }
  19302. },
  19303. parseVertexColors: function(t) {
  19304. var e = t.MappingInformationType,
  19305. i = t.ReferenceInformationType,
  19306. n = t.Colors.a,
  19307. r = [];
  19308. return "IndexToDirect" === i && (r = t.ColorIndex.a), {
  19309. dataSize: 4,
  19310. buffer: n,
  19311. indices: r,
  19312. mappingType: e,
  19313. referenceType: i
  19314. }
  19315. },
  19316. parseMaterialIndices: function(t) {
  19317. var e = t.MappingInformationType,
  19318. i = t.ReferenceInformationType;
  19319. if ("NoMappingInformation" === e) return {
  19320. dataSize: 1,
  19321. buffer: [0],
  19322. indices: [0],
  19323. mappingType: "AllSame",
  19324. referenceType: i
  19325. };
  19326. for (var n = t.Materials.a, r = [], o = 0; o < n.length; ++o) r.push(o);
  19327. return {
  19328. dataSize: 1,
  19329. buffer: n,
  19330. indices: r,
  19331. mappingType: e,
  19332. referenceType: i
  19333. }
  19334. },
  19335. parseNurbsGeometry: function(t) {
  19336. if (void 0 === n.NURBSCurve) return new n.BufferGeometry;
  19337. var e = parseInt(t.Order);
  19338. if (isNaN(e)) return new n.BufferGeometry;
  19339. for (var i, r, o = e - 1, a = t.KnotVector.a, s = [], l = t.Points.a, u = 0, h = l.length; u < h; u += 4) s.push((new n.Vector4)
  19340. .fromArray(l, u));
  19341. if ("Closed" === t.Form) s.push(s[0]);
  19342. else if ("Periodic" === t.Form) {
  19343. i = o, r = a.length - 1 - i;
  19344. for (u = 0; u < o; ++u) s.push(s[u])
  19345. }
  19346. var c = new n.NURBSCurve(o, a, s, i, r)
  19347. .getPoints(7 * s.length),
  19348. d = new Float32Array(3 * c.length);
  19349. c.forEach((function(t, e) {
  19350. t.toArray(d, 3 * e)
  19351. }));
  19352. var p = new n.BufferGeometry;
  19353. return p.addAttribute("position", new n.BufferAttribute(d, 3)), p
  19354. }
  19355. }, s.prototype = {
  19356. constructor: s,
  19357. parse: function() {
  19358. var t = [],
  19359. e = this.parseClips();
  19360. if (void 0 !== e)
  19361. for (var i in e) {
  19362. var n = e[i],
  19363. r = this.addClip(n);
  19364. t.push(r)
  19365. }
  19366. return t
  19367. },
  19368. parseClips: function() {
  19369. if (void 0 !== t.Objects.AnimationCurve) {
  19370. var e = this.parseAnimationCurveNodes();
  19371. this.parseAnimationCurves(e);
  19372. var i = this.parseAnimationLayers(e);
  19373. return this.parseAnimStacks(i)
  19374. }
  19375. },
  19376. parseAnimationCurveNodes: function() {
  19377. var e = t.Objects.AnimationCurveNode,
  19378. i = new Map;
  19379. for (var n in e) {
  19380. var r = e[n];
  19381. if (null !== r.attrName.match(/S|R|T|DeformPercent/)) {
  19382. var o = {
  19383. id: r.id,
  19384. attr: r.attrName,
  19385. curves: {}
  19386. };
  19387. i.set(o.id, o)
  19388. }
  19389. }
  19390. return i
  19391. },
  19392. parseAnimationCurves: function(i) {
  19393. var n = t.Objects.AnimationCurve;
  19394. for (var r in n) {
  19395. var o = {
  19396. id: n[r].id,
  19397. times: n[r].KeyTime.a.map(p),
  19398. values: n[r].KeyValueFloat.a
  19399. },
  19400. a = e.get(o.id);
  19401. if (void 0 !== a) {
  19402. var s = a.parents[0].ID,
  19403. l = a.parents[0].relationship;
  19404. l.match(/X/) ? i.get(s)
  19405. .curves.x = o : l.match(/Y/) ? i.get(s)
  19406. .curves.y = o : l.match(/Z/) ? i.get(s)
  19407. .curves.z = o : l.match(/d|DeformPercent/) && i.has(s) && (i.get(s)
  19408. .curves.morph = o)
  19409. }
  19410. }
  19411. },
  19412. parseAnimationLayers: function(r) {
  19413. var o = t.Objects.AnimationLayer,
  19414. a = new Map;
  19415. for (var s in o) {
  19416. var l = [],
  19417. u = e.get(parseInt(s));
  19418. if (void 0 !== u) u.children.forEach((function(o, a) {
  19419. if (r.has(o.ID)) {
  19420. var s = r.get(o.ID);
  19421. if (void 0 !== s.curves.x || void 0 !== s.curves.y || void 0 !== s.curves.z) {
  19422. if (void 0 === l[a])
  19423. if (void 0 !== (f = e.get(o.ID)
  19424. .parents.filter((function(t) {
  19425. return void 0 !== t.relationship
  19426. }))[0].ID)) {
  19427. var u = t.Objects.Model[f.toString()],
  19428. h = {
  19429. modelName: n.PropertyBinding.sanitizeNodeName(u.attrName),
  19430. ID: u.id,
  19431. initialPosition: [0, 0, 0],
  19432. initialRotation: [0, 0, 0],
  19433. initialScale: [1, 1, 1]
  19434. };
  19435. i.traverse((function(t) {
  19436. t.ID === u.id && (h.transform = t.matrix, t.userData.transformData && (h.eulerOrder = t.userData.transformData.eulerOrder))
  19437. })), h.transform || (h.transform = new n.Matrix4), "PreRotation" in u && (h.preRotation = u.PreRotation.value), "PostRotation" in u && (h.postRotation = u.PostRotation.value), l[a] = h
  19438. } l[a] && (l[a][s.attr] = s)
  19439. } else if (void 0 !== s.curves.morph) {
  19440. if (void 0 === l[a]) {
  19441. var c = e.get(o.ID)
  19442. .parents.filter((function(t) {
  19443. return void 0 !== t.relationship
  19444. }))[0].ID,
  19445. d = e.get(c)
  19446. .parents[0].ID,
  19447. p = e.get(d)
  19448. .parents[0].ID,
  19449. f = e.get(p)
  19450. .parents[0].ID;
  19451. u = t.Objects.Model[f], h = {
  19452. modelName: n.PropertyBinding.sanitizeNodeName(u.attrName),
  19453. morphName: t.Objects.Deformer[c].attrName
  19454. };
  19455. l[a] = h
  19456. }
  19457. l[a][s.attr] = s
  19458. }
  19459. }
  19460. })), a.set(parseInt(s), l)
  19461. }
  19462. return a
  19463. },
  19464. parseAnimStacks: function(i) {
  19465. var n = t.Objects.AnimationStack,
  19466. r = {};
  19467. for (var o in n) {
  19468. var a = e.get(parseInt(o))
  19469. .children;
  19470. a.length;
  19471. var s = i.get(a[0].ID);
  19472. r[o] = {
  19473. name: n[o].attrName,
  19474. layer: s
  19475. }
  19476. }
  19477. return r
  19478. },
  19479. addClip: function(t) {
  19480. var e = [],
  19481. i = this;
  19482. return t.layer.forEach((function(t) {
  19483. e = e.concat(i.generateTracks(t))
  19484. })), new n.AnimationClip(t.name, -1, e)
  19485. },
  19486. generateTracks: function(t) {
  19487. var e = [],
  19488. i = new n.Vector3,
  19489. r = new n.Quaternion,
  19490. o = new n.Vector3;
  19491. if (t.transform && t.transform.decompose(i, r, o), i = i.toArray(), r = (new n.Euler)
  19492. .setFromQuaternion(r, t.eulerOrder)
  19493. .toArray(), o = o.toArray(), void 0 !== t.T && Object.keys(t.T.curves)
  19494. .length > 0) {
  19495. var a = this.generateVectorTrack(t.modelName, t.T.curves, i, "position");
  19496. void 0 !== a && e.push(a)
  19497. }
  19498. if (void 0 !== t.R && Object.keys(t.R.curves)
  19499. .length > 0) {
  19500. var s = this.generateRotationTrack(t.modelName, t.R.curves, r, t.preRotation, t.postRotation, t.eulerOrder);
  19501. void 0 !== s && e.push(s)
  19502. }
  19503. if (void 0 !== t.S && Object.keys(t.S.curves)
  19504. .length > 0) {
  19505. var l = this.generateVectorTrack(t.modelName, t.S.curves, o, "scale");
  19506. void 0 !== l && e.push(l)
  19507. }
  19508. if (void 0 !== t.DeformPercent) {
  19509. var u = this.generateMorphTrack(t);
  19510. void 0 !== u && e.push(u)
  19511. }
  19512. return e
  19513. },
  19514. generateVectorTrack: function(t, e, i, r) {
  19515. var o = this.getTimesForAllAxes(e),
  19516. a = this.getKeyframeTrackValues(o, e, i);
  19517. return new n.VectorKeyframeTrack(t + "." + r, o, a)
  19518. },
  19519. generateRotationTrack: function(t, e, i, r, o, a) {
  19520. void 0 !== e.x && (this.interpolateRotations(e.x), e.x.values = e.x.values.map(n.Math.degToRad)), void 0 !== e.y && (this.interpolateRotations(e.y), e.y.values = e.y.values.map(n.Math.degToRad)), void 0 !== e.z && (this.interpolateRotations(e.z), e.z.values = e.z.values.map(n.Math.degToRad));
  19521. var s = this.getTimesForAllAxes(e),
  19522. l = this.getKeyframeTrackValues(s, e, i);
  19523. void 0 !== r && ((r = r.map(n.Math.degToRad))
  19524. .push(a), r = (new n.Euler)
  19525. .fromArray(r), r = (new n.Quaternion)
  19526. .setFromEuler(r)), void 0 !== o && ((o = o.map(n.Math.degToRad))
  19527. .push(a), o = (new n.Euler)
  19528. .fromArray(o), o = (new n.Quaternion)
  19529. .setFromEuler(o)
  19530. .inverse());
  19531. for (var u = new n.Quaternion, h = new n.Euler, c = [], d = 0; d < l.length; d += 3) h.set(l[d], l[d + 1], l[d + 2], a), u.setFromEuler(h), void 0 !== r && u.premultiply(r), void 0 !== o && u.multiply(o), u.toArray(c, d / 3 * 4);
  19532. return new n.QuaternionKeyframeTrack(t + ".quaternion", s, c)
  19533. },
  19534. generateMorphTrack: function(t) {
  19535. var e = t.DeformPercent.curves.morph,
  19536. r = e.values.map((function(t) {
  19537. return t / 100
  19538. })),
  19539. o = i.getObjectByName(t.modelName)
  19540. .morphTargetDictionary[t.morphName];
  19541. return new n.NumberKeyframeTrack(t.modelName + ".morphTargetInfluences[" + o + "]", e.times, r)
  19542. },
  19543. getTimesForAllAxes: function(t) {
  19544. var e = [];
  19545. return void 0 !== t.x && (e = e.concat(t.x.times)), void 0 !== t.y && (e = e.concat(t.y.times)), void 0 !== t.z && (e = e.concat(t.z.times)), e = e.sort((function(t, e) {
  19546. return t - e
  19547. }))
  19548. .filter((function(t, e, i) {
  19549. return i.indexOf(t) == e
  19550. }))
  19551. },
  19552. getKeyframeTrackValues: function(t, e, i) {
  19553. var n = i,
  19554. r = [],
  19555. o = -1,
  19556. a = -1,
  19557. s = -1;
  19558. return t.forEach((function(t) {
  19559. if (e.x && (o = e.x.times.indexOf(t)), e.y && (a = e.y.times.indexOf(t)), e.z && (s = e.z.times.indexOf(t)), -1 !== o) {
  19560. var i = e.x.values[o];
  19561. r.push(i), n[0] = i
  19562. } else r.push(n[0]);
  19563. if (-1 !== a) {
  19564. var l = e.y.values[a];
  19565. r.push(l), n[1] = l
  19566. } else r.push(n[1]);
  19567. if (-1 !== s) {
  19568. var u = e.z.values[s];
  19569. r.push(u), n[2] = u
  19570. } else r.push(n[2])
  19571. })), r
  19572. },
  19573. interpolateRotations: function(t) {
  19574. for (var e = 1; e < t.values.length; e++) {
  19575. var i = t.values[e - 1],
  19576. n = t.values[e] - i,
  19577. r = Math.abs(n);
  19578. if (r >= 180) {
  19579. for (var o = r / 180, a = n / o, s = i + a, l = t.times[e - 1], u = (t.times[e] - l) / o, h = l + u, c = [], d = []; h < t.times[e];) c.push(h), h += u, d.push(s), s += a;
  19580. t.times = M(t.times, e, c), t.values = M(t.values, e, d)
  19581. }
  19582. }
  19583. }
  19584. }, l.prototype = {
  19585. constructor: l,
  19586. getPrevNode: function() {
  19587. return this.nodeStack[this.currentIndent - 2]
  19588. },
  19589. getCurrentNode: function() {
  19590. return this.nodeStack[this.currentIndent - 1]
  19591. },
  19592. getCurrentProp: function() {
  19593. return this.currentProp
  19594. },
  19595. pushStack: function(t) {
  19596. this.nodeStack.push(t), this.currentIndent += 1
  19597. },
  19598. popStack: function() {
  19599. this.nodeStack.pop(), this.currentIndent -= 1
  19600. },
  19601. setCurrentProp: function(t, e) {
  19602. this.currentProp = t, this.currentPropName = e
  19603. },
  19604. parse: function(t) {
  19605. this.currentIndent = 0, this.allNodes = new c, this.nodeStack = [], this.currentProp = [], this.currentPropName = "";
  19606. var e = this,
  19607. i = t.split(/[\r\n]+/);
  19608. return i.forEach((function(t, n) {
  19609. var r = t.match(/^[\s\t]*;/),
  19610. o = t.match(/^[\s\t]*$/);
  19611. if (!r && !o) {
  19612. var a = t.match("^\\t{" + e.currentIndent + "}(\\w+):(.*){", ""),
  19613. s = t.match("^\\t{" + e.currentIndent + "}(\\w+):[\\s\\t\\r\\n](.*)"),
  19614. l = t.match("^\\t{" + (e.currentIndent - 1) + "}}");
  19615. a ? e.parseNodeBegin(t, a) : s ? e.parseNodeProperty(t, s, i[++n]) : l ? e.popStack() : t.match(/^[^\s\t}]/) && e.parseNodePropertyContinued(t)
  19616. }
  19617. })), this.allNodes
  19618. },
  19619. parseNodeBegin: function(t, e) {
  19620. var i = e[1].trim()
  19621. .replace(/^"/, "")
  19622. .replace(/"$/, ""),
  19623. n = e[2].split(",")
  19624. .map((function(t) {
  19625. return t.trim()
  19626. .replace(/^"/, "")
  19627. .replace(/"$/, "")
  19628. })),
  19629. r = {
  19630. name: i
  19631. },
  19632. o = this.parseNodeAttr(n),
  19633. a = this.getCurrentNode();
  19634. 0 === this.currentIndent ? this.allNodes.add(i, r) : i in a ? ("PoseNode" === i ? a.PoseNode.push(r) : void 0 !== a[i].id && (a[i] = {}, a[i][a[i].id] = a[i]), "" !== o.id && (a[i][o.id] = r)) : "number" == typeof o.id ? (a[i] = {}, a[i][o.id] = r) : "Properties70" !== i && (a[i] = "PoseNode" === i ? [r] : r), "number" == typeof o.id && (r.id = o.id), "" !== o.name && (r.attrName = o.name), "" !== o.type && (r.attrType = o.type), this.pushStack(r)
  19635. },
  19636. parseNodeAttr: function(t) {
  19637. var e = t[0];
  19638. "" !== t[0] && (e = parseInt(t[0]), isNaN(e) && (e = t[0]));
  19639. var i = "",
  19640. n = "";
  19641. return t.length > 1 && (i = t[1].replace(/^(\w+)::/, ""), n = t[2]), {
  19642. id: e,
  19643. name: i,
  19644. type: n
  19645. }
  19646. },
  19647. parseNodeProperty: function(t, e, i) {
  19648. var n = e[1].replace(/^"/, "")
  19649. .replace(/"$/, "")
  19650. .trim(),
  19651. r = e[2].replace(/^"/, "")
  19652. .replace(/"$/, "")
  19653. .trim();
  19654. "Content" === n && "," === r && (r = i.replace(/"/g, "")
  19655. .replace(/,$/, "")
  19656. .trim());
  19657. var o = this.getCurrentNode();
  19658. if ("Properties70" !== o.name) {
  19659. if ("C" === n) {
  19660. var a = r.split(",")
  19661. .slice(1),
  19662. s = parseInt(a[0]),
  19663. l = parseInt(a[1]),
  19664. u = r.split(",")
  19665. .slice(3);
  19666. n = "connections",
  19667. function(t, e) {
  19668. for (var i = 0, n = t.length, r = e.length; i < r; i++, n++) t[n] = e[i]
  19669. }(r = [s, l], u = u.map((function(t) {
  19670. return t.trim()
  19671. .replace(/^"/, "")
  19672. }))), void 0 === o[n] && (o[n] = [])
  19673. }
  19674. "Node" === n && (o.id = r), n in o && Array.isArray(o[n]) ? o[n].push(r) : "a" !== n ? o[n] = r : o.a = r, this.setCurrentProp(o, n), "a" === n && "," !== r.slice(-1) && (o.a = w(r))
  19675. } else this.parseNodeSpecialProperty(t, n, r)
  19676. },
  19677. parseNodePropertyContinued: function(t) {
  19678. var e = this.getCurrentNode();
  19679. e.a += t, "," !== t.slice(-1) && (e.a = w(e.a))
  19680. },
  19681. parseNodeSpecialProperty: function(t, e, i) {
  19682. var n = i.split('",')
  19683. .map((function(t) {
  19684. return t.trim()
  19685. .replace(/^\"/, "")
  19686. .replace(/\s/, "_")
  19687. })),
  19688. r = n[0],
  19689. o = n[1],
  19690. a = n[2],
  19691. s = n[3],
  19692. l = n[4];
  19693. switch (o) {
  19694. case "int":
  19695. case "enum":
  19696. case "bool":
  19697. case "ULongLong":
  19698. case "double":
  19699. case "Number":
  19700. case "FieldOfView":
  19701. l = parseFloat(l);
  19702. break;
  19703. case "Color":
  19704. case "ColorRGB":
  19705. case "Vector3D":
  19706. case "Lcl_Translation":
  19707. case "Lcl_Rotation":
  19708. case "Lcl_Scaling":
  19709. l = w(l)
  19710. }
  19711. this.getPrevNode()[r] = {
  19712. type: o,
  19713. type2: a,
  19714. flag: s,
  19715. value: l
  19716. }, this.setCurrentProp(this.getPrevNode(), r)
  19717. }
  19718. }, u.prototype = {
  19719. constructor: u,
  19720. parse: function(t) {
  19721. var e = new h(t);
  19722. e.skip(23);
  19723. for (var i = e.getUint32(), n = new c; !this.endOfContent(e);) {
  19724. var r = this.parseNode(e, i);
  19725. null !== r && n.add(r.name, r)
  19726. }
  19727. return n
  19728. },
  19729. endOfContent: function(t) {
  19730. return t.size() % 16 == 0 ? (t.getOffset() + 160 + 16 & -16) >= t.size() : t.getOffset() + 160 + 16 >= t.size()
  19731. },
  19732. parseNode: function(t, e) {
  19733. var i = {},
  19734. n = e >= 7500 ? t.getUint64() : t.getUint32(),
  19735. r = e >= 7500 ? t.getUint64() : t.getUint32(),
  19736. o = (e >= 7500 ? t.getUint64() : t.getUint32(), t.getUint8()),
  19737. a = t.getString(o);
  19738. if (0 === n) return null;
  19739. for (var s = [], l = 0; l < r; l++) s.push(this.parseProperty(t));
  19740. var u = s.length > 0 ? s[0] : "",
  19741. h = s.length > 1 ? s[1] : "",
  19742. c = s.length > 2 ? s[2] : "";
  19743. for (i.singleProperty = 1 === r && t.getOffset() === n; n > t.getOffset();) {
  19744. var d = this.parseNode(t, e);
  19745. null !== d && this.parseSubNode(a, i, d)
  19746. }
  19747. return i.propertyList = s, "number" == typeof u && (i.id = u), "" !== h && (i.attrName = h), "" !== c && (i.attrType = c), "" !== a && (i.name = a), i
  19748. },
  19749. parseSubNode: function(t, e, i) {
  19750. if (!0 === i.singleProperty) {
  19751. var n = i.propertyList[0];
  19752. Array.isArray(n) ? (e[i.name] = i, i.a = n) : e[i.name] = n
  19753. } else if ("Connections" === t && "C" === i.name) {
  19754. var r = [];
  19755. i.propertyList.forEach((function(t, e) {
  19756. 0 !== e && r.push(t)
  19757. })), void 0 === e.connections && (e.connections = []), e.connections.push(r)
  19758. } else if ("Properties70" === i.name) {
  19759. Object.keys(i)
  19760. .forEach((function(t) {
  19761. e[t] = i[t]
  19762. }))
  19763. } else if ("Properties70" === t && "P" === i.name) {
  19764. var o, a = i.propertyList[0],
  19765. s = i.propertyList[1],
  19766. l = i.propertyList[2],
  19767. u = i.propertyList[3];
  19768. 0 === a.indexOf("Lcl ") && (a = a.replace("Lcl ", "Lcl_")), 0 === s.indexOf("Lcl ") && (s = s.replace("Lcl ", "Lcl_")), o = "Color" === s || "ColorRGB" === s || "Vector" === s || "Vector3D" === s || 0 === s.indexOf("Lcl_") ? [i.propertyList[4], i.propertyList[5], i.propertyList[6]] : i.propertyList[4], e[a] = {
  19769. type: s,
  19770. type2: l,
  19771. flag: u,
  19772. value: o
  19773. }
  19774. } else void 0 === e[i.name] ? "number" == typeof i.id ? (e[i.name] = {}, e[i.name][i.id] = i) : e[i.name] = i : "PoseNode" === i.name ? (Array.isArray(e[i.name]) || (e[i.name] = [e[i.name]]), e[i.name].push(i)) : void 0 === e[i.name][i.id] && (e[i.name][i.id] = i)
  19775. },
  19776. parseProperty: function(t) {
  19777. var e = t.getString(1);
  19778. switch (e) {
  19779. case "C":
  19780. return t.getBoolean();
  19781. case "D":
  19782. return t.getFloat64();
  19783. case "F":
  19784. return t.getFloat32();
  19785. case "I":
  19786. return t.getInt32();
  19787. case "L":
  19788. return t.getInt64();
  19789. case "R":
  19790. var i = t.getUint32();
  19791. return t.getArrayBuffer(i);
  19792. case "S":
  19793. i = t.getUint32();
  19794. return t.getString(i);
  19795. case "Y":
  19796. return t.getInt16();
  19797. case "b":
  19798. case "c":
  19799. case "d":
  19800. case "f":
  19801. case "i":
  19802. case "l":
  19803. var n = t.getUint32(),
  19804. r = t.getUint32(),
  19805. o = t.getUint32();
  19806. if (0 === r) switch (e) {
  19807. case "b":
  19808. case "c":
  19809. return t.getBooleanArray(n);
  19810. case "d":
  19811. return t.getFloat64Array(n);
  19812. case "f":
  19813. return t.getFloat32Array(n);
  19814. case "i":
  19815. return t.getInt32Array(n);
  19816. case "l":
  19817. return t.getInt64Array(n)
  19818. }
  19819. var a = new h(new Zlib.Inflate(new Uint8Array(t.getArrayBuffer(o)))
  19820. .decompress()
  19821. .buffer);
  19822. switch (e) {
  19823. case "b":
  19824. case "c":
  19825. return a.getBooleanArray(n);
  19826. case "d":
  19827. return a.getFloat64Array(n);
  19828. case "f":
  19829. return a.getFloat32Array(n);
  19830. case "i":
  19831. return a.getInt32Array(n);
  19832. case "l":
  19833. return a.getInt64Array(n)
  19834. }
  19835. default:
  19836. throw new Error("THREE.FBXLoader: Unknown property type " + e)
  19837. }
  19838. }
  19839. }, h.prototype = {
  19840. constructor: h,
  19841. getOffset: function() {
  19842. return this.offset
  19843. },
  19844. size: function() {
  19845. return this.dv.buffer.byteLength
  19846. },
  19847. skip: function(t) {
  19848. this.offset += t
  19849. },
  19850. getBoolean: function() {
  19851. return 1 == (1 & this.getUint8())
  19852. },
  19853. getBooleanArray: function(t) {
  19854. for (var e = [], i = 0; i < t; i++) e.push(this.getBoolean());
  19855. return e
  19856. },
  19857. getUint8: function() {
  19858. var t = this.dv.getUint8(this.offset);
  19859. return this.offset += 1, t
  19860. },
  19861. getInt16: function() {
  19862. var t = this.dv.getInt16(this.offset, this.littleEndian);
  19863. return this.offset += 2, t
  19864. },
  19865. getInt32: function() {
  19866. var t = this.dv.getInt32(this.offset, this.littleEndian);
  19867. return this.offset += 4, t
  19868. },
  19869. getInt32Array: function(t) {
  19870. for (var e = [], i = 0; i < t; i++) e.push(this.getInt32());
  19871. return e
  19872. },
  19873. getUint32: function() {
  19874. var t = this.dv.getUint32(this.offset, this.littleEndian);
  19875. return this.offset += 4, t
  19876. },
  19877. getInt64: function() {
  19878. var t, e;
  19879. return this.littleEndian ? (t = this.getUint32(), e = this.getUint32()) : (e = this.getUint32(), t = this.getUint32()), 2147483648 & e ? (e = 4294967295 & ~e, 4294967295 === (t = 4294967295 & ~t) && (e = e + 1 & 4294967295), -(4294967296 * e + (t = t + 1 & 4294967295))) : 4294967296 * e + t
  19880. },
  19881. getInt64Array: function(t) {
  19882. for (var e = [], i = 0; i < t; i++) e.push(this.getInt64());
  19883. return e
  19884. },
  19885. getUint64: function() {
  19886. var t, e;
  19887. return this.littleEndian ? (t = this.getUint32(), e = this.getUint32()) : (e = this.getUint32(), t = this.getUint32()), 4294967296 * e + t
  19888. },
  19889. getFloat32: function() {
  19890. var t = this.dv.getFloat32(this.offset, this.littleEndian);
  19891. return this.offset += 4, t
  19892. },
  19893. getFloat32Array: function(t) {
  19894. for (var e = [], i = 0; i < t; i++) e.push(this.getFloat32());
  19895. return e
  19896. },
  19897. getFloat64: function() {
  19898. var t = this.dv.getFloat64(this.offset, this.littleEndian);
  19899. return this.offset += 8, t
  19900. },
  19901. getFloat64Array: function(t) {
  19902. for (var e = [], i = 0; i < t; i++) e.push(this.getFloat64());
  19903. return e
  19904. },
  19905. getArrayBuffer: function(t) {
  19906. var e = this.dv.buffer.slice(this.offset, this.offset + t);
  19907. return this.offset += t, e
  19908. },
  19909. getString: function(t) {
  19910. for (var e = [], i = 0; i < t; i++) e[i] = this.getUint8();
  19911. var r = e.indexOf(0);
  19912. return r >= 0 && (e = e.slice(0, r)), n.LoaderUtils.decodeText(new Uint8Array(e))
  19913. }
  19914. }, c.prototype = {
  19915. constructor: c,
  19916. add: function(t, e) {
  19917. this[t] = e
  19918. }
  19919. };
  19920. var f = [];
  19921. function m(t, e, i, n) {
  19922. var r;
  19923. switch (n.mappingType) {
  19924. case "ByPolygonVertex":
  19925. r = t;
  19926. break;
  19927. case "ByPolygon":
  19928. r = e;
  19929. break;
  19930. case "ByVertice":
  19931. r = i;
  19932. break;
  19933. case "AllSame":
  19934. r = n.indices[0]
  19935. }
  19936. "IndexToDirect" === n.referenceType && (r = n.indices[r]);
  19937. var o = r * n.dataSize,
  19938. a = o + n.dataSize;
  19939. return function(t, e, i, n) {
  19940. for (var r = i, o = 0; r < n; r++, o++) t[o] = e[r];
  19941. return t
  19942. }(f, n.buffer, o, a)
  19943. }
  19944. var g = new n.Euler,
  19945. v = new n.Vector3;
  19946. function y(t) {
  19947. var e, i = new n.Matrix4,
  19948. r = new n.Matrix4,
  19949. o = new n.Matrix4,
  19950. a = new n.Matrix4,
  19951. s = new n.Matrix4,
  19952. l = new n.Matrix4,
  19953. u = new n.Matrix4,
  19954. h = new n.Matrix4,
  19955. c = new n.Matrix4,
  19956. d = new n.Matrix4,
  19957. p = new n.Matrix4,
  19958. f = t.inheritType ? t.inheritType : 0;
  19959. (t.translation && i.setPosition(v.fromArray(t.translation)), t.preRotation) && ((e = t.preRotation.map(n.Math.degToRad))
  19960. .push(t.eulerOrder), r.makeRotationFromEuler(g.fromArray(e)));
  19961. t.rotation && ((e = t.rotation.map(n.Math.degToRad))
  19962. .push(t.eulerOrder), o.makeRotationFromEuler(g.fromArray(e)));
  19963. t.postRotation && ((e = t.postRotation.map(n.Math.degToRad))
  19964. .push(t.eulerOrder), a.makeRotationFromEuler(g.fromArray(e)));
  19965. t.scale && s.scale(v.fromArray(t.scale)), t.scalingOffset && u.setPosition(v.fromArray(t.scalingOffset)), t.scalingPivot && l.setPosition(v.fromArray(t.scalingPivot)), t.rotationOffset && h.setPosition(v.fromArray(t.rotationOffset)), t.rotationPivot && c.setPosition(v.fromArray(t.rotationPivot)), t.parentMatrixWorld && (d = t.parentMatrixWorld);
  19966. var m = r.multiply(o)
  19967. .multiply(a),
  19968. y = new n.Matrix4;
  19969. d.extractRotation(y);
  19970. var b, w, x, M, T = new n.Matrix4;
  19971. if (T.copyPosition(d), x = T.getInverse(T)
  19972. .multiply(d), w = y.getInverse(y)
  19973. .multiply(x), b = s, 0 === f) M = y.multiply(m)
  19974. .multiply(w)
  19975. .multiply(b);
  19976. else if (1 === f) M = y.multiply(w)
  19977. .multiply(m)
  19978. .multiply(b);
  19979. else {
  19980. var S = (new n.Matrix4)
  19981. .copy(s),
  19982. _ = w.multiply(S.getInverse(S));
  19983. M = y.multiply(m)
  19984. .multiply(_)
  19985. .multiply(b)
  19986. }
  19987. var A = i.multiply(h)
  19988. .multiply(c)
  19989. .multiply(r)
  19990. .multiply(o)
  19991. .multiply(a)
  19992. .multiply(c.getInverse(c))
  19993. .multiply(u)
  19994. .multiply(l)
  19995. .multiply(s)
  19996. .multiply(l.getInverse(l)),
  19997. P = (new n.Matrix4)
  19998. .copyPosition(A),
  19999. C = d.multiply(P);
  20000. return p.copyPosition(C), A = p.multiply(M)
  20001. }
  20002. function b(t) {
  20003. var e = ["ZYX", "YZX", "XZY", "ZXY", "YXZ", "XYZ"];
  20004. return 6 === (t = t || 0) ? e[0] : e[t]
  20005. }
  20006. function w(t) {
  20007. return t.split(",")
  20008. .map((function(t) {
  20009. return parseFloat(t)
  20010. }))
  20011. }
  20012. function x(t, e, i) {
  20013. return void 0 === e && (e = 0), void 0 === i && (i = t.byteLength), n.LoaderUtils.decodeText(new Uint8Array(t, e, i))
  20014. }
  20015. function M(t, e, i) {
  20016. return t.slice(0, e)
  20017. .concat(i)
  20018. .concat(t.slice(e))
  20019. }
  20020. return r
  20021. }()
  20022. }, function(t, e, i) {
  20023. ! function() {
  20024. "use strict";
  20025. i(122);
  20026. var e = i(0);
  20027. t.exports = {
  20028. load: function(t) {
  20029. var i = new e.GLTFLoader;
  20030. return new Promise((function(e, n) {
  20031. i.load(t, (function(t) {
  20032. t && e(t)
  20033. }))
  20034. }))
  20035. }
  20036. }
  20037. }()
  20038. }, function(t, e, i) {
  20039. var n = i(0);
  20040. n.GLTFLoader = function() {
  20041. function t(t) {
  20042. this.manager = void 0 !== t ? t : n.DefaultLoadingManager, this.dracoLoader = null
  20043. }
  20044. function e() {
  20045. var t = {};
  20046. return {
  20047. get: function(e) {
  20048. return t[e]
  20049. },
  20050. add: function(e, i) {
  20051. t[e] = i
  20052. },
  20053. remove: function(e) {
  20054. delete t[e]
  20055. },
  20056. removeAll: function() {
  20057. t = {}
  20058. }
  20059. }
  20060. }
  20061. t.prototype = {
  20062. constructor: t,
  20063. crossOrigin: "anonymous",
  20064. load: function(t, e, i, r) {
  20065. var o, a = this;
  20066. o = void 0 !== this.resourcePath ? this.resourcePath : void 0 !== this.path ? this.path : n.LoaderUtils.extractUrlBase(t), a.manager.itemStart(t);
  20067. var s = function(e) {
  20068. r && r(e), a.manager.itemError(t), a.manager.itemEnd(t)
  20069. },
  20070. l = new n.FileLoader(a.manager);
  20071. l.setPath(this.path), l.setResponseType("arraybuffer"), l.load(t, (function(i) {
  20072. try {
  20073. a.parse(i, o, (function(i) {
  20074. e(i), a.manager.itemEnd(t)
  20075. }), s)
  20076. } catch (t) {
  20077. s(t)
  20078. }
  20079. }), i, s)
  20080. },
  20081. setCrossOrigin: function(t) {
  20082. return this.crossOrigin = t, this
  20083. },
  20084. setPath: function(t) {
  20085. return this.path = t, this
  20086. },
  20087. setResourcePath: function(t) {
  20088. return this.resourcePath = t, this
  20089. },
  20090. setDRACOLoader: function(t) {
  20091. return this.dracoLoader = t, this
  20092. },
  20093. parse: function(t, e, l, u) {
  20094. var f, m = {};
  20095. if ("string" == typeof t) f = t;
  20096. else if (n.LoaderUtils.decodeText(new Uint8Array(t, 0, 4)) === s) {
  20097. try {
  20098. m[i.KHR_BINARY_GLTF] = new h(t)
  20099. } catch (t) {
  20100. return void(u && u(t))
  20101. }
  20102. f = m[i.KHR_BINARY_GLTF].content
  20103. } else f = n.LoaderUtils.decodeText(new Uint8Array(t));
  20104. var g = JSON.parse(f);
  20105. if (void 0 === g.asset || g.asset.version[0] < 2) u && u(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported. Use LegacyGLTFLoader instead."));
  20106. else {
  20107. if (g.extensionsUsed)
  20108. for (var v = 0; v < g.extensionsUsed.length; ++v) {
  20109. var y = g.extensionsUsed[v],
  20110. b = g.extensionsRequired || [];
  20111. switch (y) {
  20112. case i.KHR_LIGHTS_PUNCTUAL:
  20113. m[y] = new o(g);
  20114. break;
  20115. case i.KHR_MATERIALS_UNLIT:
  20116. m[y] = new a(g);
  20117. break;
  20118. case i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:
  20119. m[y] = new p(g);
  20120. break;
  20121. case i.KHR_DRACO_MESH_COMPRESSION:
  20122. m[y] = new c(g, this.dracoLoader);
  20123. break;
  20124. case i.MSFT_TEXTURE_DDS:
  20125. m[i.MSFT_TEXTURE_DDS] = new r;
  20126. break;
  20127. case i.KHR_TEXTURE_TRANSFORM:
  20128. m[i.KHR_TEXTURE_TRANSFORM] = new d(g);
  20129. break;
  20130. default:
  20131. b.indexOf(y)
  20132. }
  20133. }
  20134. new U(g, m, {
  20135. path: e || this.resourcePath || "",
  20136. crossOrigin: this.crossOrigin,
  20137. manager: this.manager
  20138. })
  20139. .parse(l, u)
  20140. }
  20141. }
  20142. };
  20143. var i = {
  20144. KHR_BINARY_GLTF: "KHR_binary_glTF",
  20145. KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression",
  20146. KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual",
  20147. KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: "KHR_materials_pbrSpecularGlossiness",
  20148. KHR_MATERIALS_UNLIT: "KHR_materials_unlit",
  20149. KHR_TEXTURE_TRANSFORM: "KHR_texture_transform",
  20150. MSFT_TEXTURE_DDS: "MSFT_texture_dds"
  20151. };
  20152. function r() {
  20153. if (!n.DDSLoader) throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader");
  20154. this.name = i.MSFT_TEXTURE_DDS, this.ddsLoader = new n.DDSLoader
  20155. }
  20156. function o(t) {
  20157. this.name = i.KHR_LIGHTS_PUNCTUAL;
  20158. var e = t.extensions && t.extensions[i.KHR_LIGHTS_PUNCTUAL] || {};
  20159. this.lightDefs = e.lights || []
  20160. }
  20161. function a() {
  20162. this.name = i.KHR_MATERIALS_UNLIT
  20163. }
  20164. o.prototype.loadLight = function(t) {
  20165. var e, i = this.lightDefs[t],
  20166. r = new n.Color(16777215);
  20167. void 0 !== i.color && r.fromArray(i.color);
  20168. var o = void 0 !== i.range ? i.range : 0;
  20169. switch (i.type) {
  20170. case "directional":
  20171. (e = new n.DirectionalLight(r))
  20172. .target.position.set(0, 0, -1), e.add(e.target);
  20173. break;
  20174. case "point":
  20175. (e = new n.PointLight(r))
  20176. .distance = o;
  20177. break;
  20178. case "spot":
  20179. (e = new n.SpotLight(r))
  20180. .distance = o, i.spot = i.spot || {}, i.spot.innerConeAngle = void 0 !== i.spot.innerConeAngle ? i.spot.innerConeAngle : 0, i.spot.outerConeAngle = void 0 !== i.spot.outerConeAngle ? i.spot.outerConeAngle : Math.PI / 4, e.angle = i.spot.outerConeAngle, e.penumbra = 1 - i.spot.innerConeAngle / i.spot.outerConeAngle, e.target.position.set(0, 0, -1), e.add(e.target);
  20181. break;
  20182. default:
  20183. throw new Error('THREE.GLTFLoader: Unexpected light type, "' + i.type + '".')
  20184. }
  20185. return e.position.set(0, 0, 0), e.decay = 2, void 0 !== i.intensity && (e.intensity = i.intensity), e.name = i.name || "light_" + t, Promise.resolve(e)
  20186. }, a.prototype.getMaterialType = function() {
  20187. return n.MeshBasicMaterial
  20188. }, a.prototype.extendParams = function(t, e, i) {
  20189. var r = [];
  20190. t.color = new n.Color(1, 1, 1), t.opacity = 1;
  20191. var o = e.pbrMetallicRoughness;
  20192. if (o) {
  20193. if (Array.isArray(o.baseColorFactor)) {
  20194. var a = o.baseColorFactor;
  20195. t.color.fromArray(a), t.opacity = a[3]
  20196. }
  20197. void 0 !== o.baseColorTexture && r.push(i.assignTexture(t, "map", o.baseColorTexture))
  20198. }
  20199. return Promise.all(r)
  20200. };
  20201. var s = "glTF",
  20202. l = 1313821514,
  20203. u = 5130562;
  20204. function h(t) {
  20205. this.name = i.KHR_BINARY_GLTF, this.content = null, this.body = null;
  20206. var e = new DataView(t, 0, 12);
  20207. if (this.header = {
  20208. magic: n.LoaderUtils.decodeText(new Uint8Array(t.slice(0, 4))),
  20209. version: e.getUint32(4, !0),
  20210. length: e.getUint32(8, !0)
  20211. }, this.header.magic !== s) throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
  20212. if (this.header.version < 2) throw new Error("THREE.GLTFLoader: Legacy binary file detected. Use LegacyGLTFLoader instead.");
  20213. for (var r = new DataView(t, 12), o = 0; o < r.byteLength;) {
  20214. var a = r.getUint32(o, !0);
  20215. o += 4;
  20216. var h = r.getUint32(o, !0);
  20217. if (o += 4, h === l) {
  20218. var c = new Uint8Array(t, 12 + o, a);
  20219. this.content = n.LoaderUtils.decodeText(c)
  20220. } else if (h === u) {
  20221. var d = 12 + o;
  20222. this.body = t.slice(d, d + a)
  20223. }
  20224. o += a
  20225. }
  20226. if (null === this.content) throw new Error("THREE.GLTFLoader: JSON content not found.")
  20227. }
  20228. function c(t, e) {
  20229. if (!e) throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
  20230. this.name = i.KHR_DRACO_MESH_COMPRESSION, this.json = t, this.dracoLoader = e
  20231. }
  20232. function d() {
  20233. this.name = i.KHR_TEXTURE_TRANSFORM
  20234. }
  20235. function p() {
  20236. return {
  20237. name: i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,
  20238. specularGlossinessParams: ["color", "map", "lightMap", "lightMapIntensity", "aoMap", "aoMapIntensity", "emissive", "emissiveIntensity", "emissiveMap", "bumpMap", "bumpScale", "normalMap", "displacementMap", "displacementScale", "displacementBias", "specularMap", "specular", "glossinessMap", "glossiness", "alphaMap", "envMap", "envMapIntensity", "refractionRatio"],
  20239. getMaterialType: function() {
  20240. return n.ShaderMaterial
  20241. },
  20242. extendParams: function(t, e, i) {
  20243. var r = e.extensions[this.name],
  20244. o = n.ShaderLib.standard,
  20245. a = n.UniformsUtils.clone(o.uniforms),
  20246. s = ["#ifdef USE_SPECULARMAP", "\tuniform sampler2D specularMap;", "#endif"].join("\n"),
  20247. l = ["#ifdef USE_GLOSSINESSMAP", "\tuniform sampler2D glossinessMap;", "#endif"].join("\n"),
  20248. u = ["vec3 specularFactor = specular;", "#ifdef USE_SPECULARMAP", "\tvec4 texelSpecular = texture2D( specularMap, vUv );", "\ttexelSpecular = sRGBToLinear( texelSpecular );", "\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture", "\tspecularFactor *= texelSpecular.rgb;", "#endif"].join("\n"),
  20249. h = ["float glossinessFactor = glossiness;", "#ifdef USE_GLOSSINESSMAP", "\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );", "\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture", "\tglossinessFactor *= texelGlossiness.a;", "#endif"].join("\n"),
  20250. c = ["PhysicalMaterial material;", "material.diffuseColor = diffuseColor.rgb;", "material.specularRoughness = clamp( 1.0 - glossinessFactor, 0.04, 1.0 );", "material.specularColor = specularFactor.rgb;"].join("\n"),
  20251. d = o.fragmentShader.replace("uniform float roughness;", "uniform vec3 specular;")
  20252. .replace("uniform float metalness;", "uniform float glossiness;")
  20253. .replace("#include <roughnessmap_pars_fragment>", s)
  20254. .replace("#include <metalnessmap_pars_fragment>", l)
  20255. .replace("#include <roughnessmap_fragment>", u)
  20256. .replace("#include <metalnessmap_fragment>", h)
  20257. .replace("#include <lights_physical_fragment>", c);
  20258. delete a.roughness, delete a.metalness, delete a.roughnessMap, delete a.metalnessMap, a.specular = {
  20259. value: (new n.Color)
  20260. .setHex(1118481)
  20261. }, a.glossiness = {
  20262. value: .5
  20263. }, a.specularMap = {
  20264. value: null
  20265. }, a.glossinessMap = {
  20266. value: null
  20267. }, t.vertexShader = o.vertexShader, t.fragmentShader = d, t.uniforms = a, t.defines = {
  20268. STANDARD: ""
  20269. }, t.color = new n.Color(1, 1, 1), t.opacity = 1;
  20270. var p = [];
  20271. if (Array.isArray(r.diffuseFactor)) {
  20272. var f = r.diffuseFactor;
  20273. t.color.fromArray(f), t.opacity = f[3]
  20274. }
  20275. if (void 0 !== r.diffuseTexture && p.push(i.assignTexture(t, "map", r.diffuseTexture)), t.emissive = new n.Color(0, 0, 0), t.glossiness = void 0 !== r.glossinessFactor ? r.glossinessFactor : 1, t.specular = new n.Color(1, 1, 1), Array.isArray(r.specularFactor) && t.specular.fromArray(r.specularFactor), void 0 !== r.specularGlossinessTexture) {
  20276. var m = r.specularGlossinessTexture;
  20277. p.push(i.assignTexture(t, "glossinessMap", m)), p.push(i.assignTexture(t, "specularMap", m))
  20278. }
  20279. return Promise.all(p)
  20280. },
  20281. createMaterial: function(t) {
  20282. var e = new n.ShaderMaterial({
  20283. defines: t.defines,
  20284. vertexShader: t.vertexShader,
  20285. fragmentShader: t.fragmentShader,
  20286. uniforms: t.uniforms,
  20287. fog: !0,
  20288. lights: !0,
  20289. opacity: t.opacity,
  20290. transparent: t.transparent
  20291. });
  20292. return e.isGLTFSpecularGlossinessMaterial = !0, e.color = t.color, e.map = void 0 === t.map ? null : t.map, e.lightMap = null, e.lightMapIntensity = 1, e.aoMap = void 0 === t.aoMap ? null : t.aoMap, e.aoMapIntensity = 1, e.emissive = t.emissive, e.emissiveIntensity = 1, e.emissiveMap = void 0 === t.emissiveMap ? null : t.emissiveMap, e.bumpMap = void 0 === t.bumpMap ? null : t.bumpMap, e.bumpScale = 1, e.normalMap = void 0 === t.normalMap ? null : t.normalMap, t.normalScale && (e.normalScale = t.normalScale), e.displacementMap = null, e.displacementScale = 1, e.displacementBias = 0, e.specularMap = void 0 === t.specularMap ? null : t.specularMap, e.specular = t.specular, e.glossinessMap = void 0 === t.glossinessMap ? null : t.glossinessMap, e.glossiness = t.glossiness, e.alphaMap = null, e.envMap = void 0 === t.envMap ? null : t.envMap, e.envMapIntensity = 1, e.refractionRatio = .98, e.extensions.derivatives = !0, e
  20293. },
  20294. cloneMaterial: function(t) {
  20295. var e = t.clone();
  20296. e.isGLTFSpecularGlossinessMaterial = !0;
  20297. for (var i = this.specularGlossinessParams, n = 0, r = i.length; n < r; n++) e[i[n]] = t[i[n]];
  20298. return e
  20299. },
  20300. refreshUniforms: function(t, e, i, n, r, o) {
  20301. if (!0 === r.isGLTFSpecularGlossinessMaterial) {
  20302. var a, s = r.uniforms,
  20303. l = r.defines;
  20304. s.opacity.value = r.opacity, s.diffuse.value.copy(r.color), s.emissive.value.copy(r.emissive)
  20305. .multiplyScalar(r.emissiveIntensity), s.map.value = r.map, s.specularMap.value = r.specularMap, s.alphaMap.value = r.alphaMap, s.lightMap.value = r.lightMap, s.lightMapIntensity.value = r.lightMapIntensity, s.aoMap.value = r.aoMap, s.aoMapIntensity.value = r.aoMapIntensity, r.map ? a = r.map : r.specularMap ? a = r.specularMap : r.displacementMap ? a = r.displacementMap : r.normalMap ? a = r.normalMap : r.bumpMap ? a = r.bumpMap : r.glossinessMap ? a = r.glossinessMap : r.alphaMap ? a = r.alphaMap : r.emissiveMap && (a = r.emissiveMap), void 0 !== a && (a.isWebGLRenderTarget && (a = a.texture), !0 === a.matrixAutoUpdate && a.updateMatrix(), s.uvTransform.value.copy(a.matrix)), r.envMap && (s.envMap.value = r.envMap, s.envMapIntensity.value = r.envMapIntensity, s.flipEnvMap.value = r.envMap.isCubeTexture ? -1 : 1, s.reflectivity.value = r.reflectivity, s.refractionRatio.value = r.refractionRatio, s.maxMipLevel.value = t.properties.get(r.envMap)
  20306. .__maxMipLevel), s.specular.value.copy(r.specular), s.glossiness.value = r.glossiness, s.glossinessMap.value = r.glossinessMap, s.emissiveMap.value = r.emissiveMap, s.bumpMap.value = r.bumpMap, s.normalMap.value = r.normalMap, s.displacementMap.value = r.displacementMap, s.displacementScale.value = r.displacementScale, s.displacementBias.value = r.displacementBias, null !== s.glossinessMap.value && void 0 === l.USE_GLOSSINESSMAP && (l.USE_GLOSSINESSMAP = "", l.USE_ROUGHNESSMAP = ""), null === s.glossinessMap.value && void 0 !== l.USE_GLOSSINESSMAP && (delete l.USE_GLOSSINESSMAP, delete l.USE_ROUGHNESSMAP)
  20307. }
  20308. }
  20309. }
  20310. }
  20311. function f(t, e, i, r) {
  20312. n.Interpolant.call(this, t, e, i, r)
  20313. }
  20314. c.prototype.decodePrimitive = function(t, e) {
  20315. var i = this.json,
  20316. n = this.dracoLoader,
  20317. r = t.extensions[this.name].bufferView,
  20318. o = t.extensions[this.name].attributes,
  20319. a = {},
  20320. s = {},
  20321. l = {};
  20322. for (var u in o) {
  20323. var h = P[u] || u.toLowerCase();
  20324. a[h] = o[u]
  20325. }
  20326. for (u in t.attributes) {
  20327. h = P[u] || u.toLowerCase();
  20328. if (void 0 !== o[u]) {
  20329. var c = i.accessors[t.attributes[u]],
  20330. d = T[c.componentType];
  20331. l[h] = d, s[h] = !0 === c.normalized
  20332. }
  20333. }
  20334. return e.getDependency("bufferView", r)
  20335. .then((function(t) {
  20336. return new Promise((function(e) {
  20337. n.decodeDracoFile(t, (function(t) {
  20338. for (var i in t.attributes) {
  20339. var n = t.attributes[i],
  20340. r = s[i];
  20341. void 0 !== r && (n.normalized = r)
  20342. }
  20343. e(t)
  20344. }), a, l)
  20345. }))
  20346. }))
  20347. }, d.prototype.extendTexture = function(t, e) {
  20348. return t = t.clone(), void 0 !== e.offset && t.offset.fromArray(e.offset), void 0 !== e.rotation && (t.rotation = e.rotation), void 0 !== e.scale && t.repeat.fromArray(e.scale), e.texCoord, t.needsUpdate = !0, t
  20349. }, f.prototype = Object.create(n.Interpolant.prototype), f.prototype.constructor = f, f.prototype.copySampleValue_ = function(t) {
  20350. for (var e = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = t * n * 3 + n, o = 0; o !== n; o++) e[o] = i[r + o];
  20351. return e
  20352. }, f.prototype.beforeStart_ = f.prototype.copySampleValue_, f.prototype.afterEnd_ = f.prototype.copySampleValue_, f.prototype.interpolate_ = function(t, e, i, n) {
  20353. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = 2 * a, l = 3 * a, u = n - e, h = (i - e) / u, c = h * h, d = c * h, p = t * l, f = p - l, m = -2 * d + 3 * c, g = d - c, v = 1 - m, y = g - c + h, b = 0; b !== a; b++) {
  20354. var w = o[f + b + a],
  20355. x = o[f + b + s] * u,
  20356. M = o[p + b + a],
  20357. T = o[p + b] * u;
  20358. r[b] = v * w + y * x + m * M + g * T
  20359. }
  20360. return r
  20361. };
  20362. var m, g = 0,
  20363. v = 1,
  20364. y = 2,
  20365. b = 3,
  20366. w = 4,
  20367. x = 5,
  20368. M = 6,
  20369. T = (n.Matrix3, n.Matrix4, n.Vector2, n.Vector3, n.Vector4, n.Texture, {
  20370. 5120: Int8Array,
  20371. 5121: Uint8Array,
  20372. 5122: Int16Array,
  20373. 5123: Uint16Array,
  20374. 5125: Uint32Array,
  20375. 5126: Float32Array
  20376. }),
  20377. S = {
  20378. 9728: n.NearestFilter,
  20379. 9729: n.LinearFilter,
  20380. 9984: n.NearestMipMapNearestFilter,
  20381. 9985: n.LinearMipMapNearestFilter,
  20382. 9986: n.NearestMipMapLinearFilter,
  20383. 9987: n.LinearMipMapLinearFilter
  20384. },
  20385. _ = {
  20386. 33071: n.ClampToEdgeWrapping,
  20387. 33648: n.MirroredRepeatWrapping,
  20388. 10497: n.RepeatWrapping
  20389. },
  20390. A = (n.BackSide, n.FrontSide, n.NeverDepth, n.LessDepth, n.EqualDepth, n.LessEqualDepth, n.GreaterEqualDepth, n.NotEqualDepth, n.GreaterEqualDepth, n.AlwaysDepth, n.AddEquation, n.SubtractEquation, n.ReverseSubtractEquation, n.ZeroFactor, n.OneFactor, n.SrcColorFactor, n.OneMinusSrcColorFactor, n.SrcAlphaFactor, n.OneMinusSrcAlphaFactor, n.DstAlphaFactor, n.OneMinusDstAlphaFactor, n.DstColorFactor, n.OneMinusDstColorFactor, n.SrcAlphaSaturateFactor, {
  20391. SCALAR: 1,
  20392. VEC2: 2,
  20393. VEC3: 3,
  20394. VEC4: 4,
  20395. MAT2: 4,
  20396. MAT3: 9,
  20397. MAT4: 16
  20398. }),
  20399. P = {
  20400. POSITION: "position",
  20401. NORMAL: "normal",
  20402. TANGENT: "tangent",
  20403. TEXCOORD_0: "uv",
  20404. TEXCOORD_1: "uv2",
  20405. COLOR_0: "color",
  20406. WEIGHTS_0: "skinWeight",
  20407. JOINTS_0: "skinIndex"
  20408. },
  20409. C = {
  20410. scale: "scale",
  20411. translation: "position",
  20412. rotation: "quaternion",
  20413. weights: "morphTargetInfluences"
  20414. },
  20415. E = {
  20416. CUBICSPLINE: void 0,
  20417. LINEAR: n.InterpolateLinear,
  20418. STEP: n.InterpolateDiscrete
  20419. },
  20420. D = "OPAQUE",
  20421. L = "MASK",
  20422. O = "BLEND",
  20423. I = {
  20424. "image/png": n.RGBAFormat,
  20425. "image/jpeg": n.RGBFormat
  20426. };
  20427. function R(t, e) {
  20428. return "string" != typeof t || "" === t ? "" : /^(https?:)?\/\//i.test(t) || /^data:.*,.*$/i.test(t) || /^blob:.*$/i.test(t) ? t : e + t
  20429. }
  20430. function N(t, e, i) {
  20431. for (var n in i.extensions) void 0 === t[n] && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[n] = i.extensions[n])
  20432. }
  20433. function k(t, e) {
  20434. void 0 !== e.extras && "object" == typeof e.extras && (t.userData = e.extras)
  20435. }
  20436. function F(t, e) {
  20437. if (t.updateMorphTargets(), void 0 !== e.weights)
  20438. for (var i = 0, n = e.weights.length; i < n; i++) t.morphTargetInfluences[i] = e.weights[i];
  20439. if (e.extras && Array.isArray(e.extras.targetNames)) {
  20440. var r = e.extras.targetNames;
  20441. if (t.morphTargetInfluences.length === r.length) {
  20442. t.morphTargetDictionary = {};
  20443. for (i = 0, n = r.length; i < n; i++) t.morphTargetDictionary[r[i]] = i
  20444. }
  20445. }
  20446. }
  20447. function B(t) {
  20448. for (var e = "", i = Object.keys(t)
  20449. .sort(), n = 0, r = i.length; n < r; n++) e += i[n] + ":" + t[i[n]] + ";";
  20450. return e
  20451. }
  20452. function z(t) {
  20453. if (t.isInterleavedBufferAttribute) {
  20454. for (var e = t.count, i = t.itemSize, r = t.array.slice(0, e * i), o = 0, a = 0; o < e; ++o) r[a++] = t.getX(o), i >= 2 && (r[a++] = t.getY(o)), i >= 3 && (r[a++] = t.getZ(o)), i >= 4 && (r[a++] = t.getW(o));
  20455. return new n.BufferAttribute(r, i, t.normalized)
  20456. }
  20457. return t.clone()
  20458. }
  20459. function U(t, i, r) {
  20460. this.json = t || {}, this.extensions = i || {}, this.options = r || {}, this.cache = new e, this.primitiveCache = {}, this.textureLoader = new n.TextureLoader(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.fileLoader = new n.FileLoader(this.options.manager), this.fileLoader.setResponseType("arraybuffer")
  20461. }
  20462. function V(t, e, i) {
  20463. var n = e.attributes,
  20464. r = [];
  20465. function o(e, n) {
  20466. return i.getDependency("accessor", e)
  20467. .then((function(e) {
  20468. t.addAttribute(n, e)
  20469. }))
  20470. }
  20471. for (var a in n) {
  20472. var s = P[a] || a.toLowerCase();
  20473. s in t.attributes || r.push(o(n[a], s))
  20474. }
  20475. if (void 0 !== e.indices && !t.index) {
  20476. var l = i.getDependency("accessor", e.indices)
  20477. .then((function(e) {
  20478. t.setIndex(e)
  20479. }));
  20480. r.push(l)
  20481. }
  20482. return k(t, e), Promise.all(r)
  20483. .then((function() {
  20484. return void 0 !== e.targets ? function(t, e, i) {
  20485. for (var n = !1, r = !1, o = 0, a = e.length; o < a; o++) {
  20486. if (void 0 !== (u = e[o])
  20487. .POSITION && (n = !0), void 0 !== u.NORMAL && (r = !0), n && r) break
  20488. }
  20489. if (!n && !r) return Promise.resolve(t);
  20490. var s = [],
  20491. l = [];
  20492. for (o = 0, a = e.length; o < a; o++) {
  20493. var u = e[o];
  20494. if (n) {
  20495. var h = void 0 !== u.POSITION ? i.getDependency("accessor", u.POSITION) : t.attributes.position;
  20496. s.push(h)
  20497. }
  20498. if (r) {
  20499. h = void 0 !== u.NORMAL ? i.getDependency("accessor", u.NORMAL) : t.attributes.normal;
  20500. l.push(h)
  20501. }
  20502. }
  20503. return Promise.all([Promise.all(s), Promise.all(l)])
  20504. .then((function(i) {
  20505. for (var o = i[0], a = i[1], s = 0, l = o.length; s < l; s++) t.attributes.position !== o[s] && (o[s] = z(o[s]));
  20506. for (s = 0, l = a.length; s < l; s++) t.attributes.normal !== a[s] && (a[s] = z(a[s]));
  20507. for (s = 0, l = e.length; s < l; s++) {
  20508. var u = e[s],
  20509. h = "morphTarget" + s;
  20510. if (n && void 0 !== u.POSITION) {
  20511. var c = o[s];
  20512. c.name = h;
  20513. for (var d = t.attributes.position, p = 0, f = c.count; p < f; p++) c.setXYZ(p, c.getX(p) + d.getX(p), c.getY(p) + d.getY(p), c.getZ(p) + d.getZ(p))
  20514. }
  20515. if (r && void 0 !== u.NORMAL) {
  20516. var m = a[s];
  20517. m.name = h;
  20518. var g = t.attributes.normal;
  20519. for (p = 0, f = m.count; p < f; p++) m.setXYZ(p, m.getX(p) + g.getX(p), m.getY(p) + g.getY(p), m.getZ(p) + g.getZ(p))
  20520. }
  20521. }
  20522. return n && (t.morphAttributes.position = o), r && (t.morphAttributes.normal = a), t
  20523. }))
  20524. }(t, e.targets, i) : t
  20525. }))
  20526. }
  20527. return U.prototype.parse = function(t, e) {
  20528. var i = this,
  20529. n = this.json,
  20530. r = this.extensions;
  20531. this.cache.removeAll(), this.markDefs(), Promise.all([this.getDependencies("scene"), this.getDependencies("animation"), this.getDependencies("camera")])
  20532. .then((function(e) {
  20533. var o = {
  20534. scene: e[0][n.scene || 0],
  20535. scenes: e[0],
  20536. animations: e[1],
  20537. cameras: e[2],
  20538. asset: n.asset,
  20539. parser: i,
  20540. userData: {}
  20541. };
  20542. N(r, o, n), t(o)
  20543. }))
  20544. .catch(e)
  20545. }, U.prototype.markDefs = function() {
  20546. for (var t = this.json.nodes || [], e = this.json.skins || [], i = this.json.meshes || [], n = {}, r = {}, o = 0, a = e.length; o < a; o++)
  20547. for (var s = e[o].joints, l = 0, u = s.length; l < u; l++) t[s[l]].isBone = !0;
  20548. for (var h = 0, c = t.length; h < c; h++) {
  20549. var d = t[h];
  20550. void 0 !== d.mesh && (void 0 === n[d.mesh] && (n[d.mesh] = r[d.mesh] = 0), n[d.mesh]++, void 0 !== d.skin && (i[d.mesh].isSkinnedMesh = !0))
  20551. }
  20552. this.json.meshReferences = n, this.json.meshUses = r
  20553. }, U.prototype.getDependency = function(t, e) {
  20554. var n = t + ":" + e,
  20555. r = this.cache.get(n);
  20556. if (!r) {
  20557. switch (t) {
  20558. case "scene":
  20559. r = this.loadScene(e);
  20560. break;
  20561. case "node":
  20562. r = this.loadNode(e);
  20563. break;
  20564. case "mesh":
  20565. r = this.loadMesh(e);
  20566. break;
  20567. case "accessor":
  20568. r = this.loadAccessor(e);
  20569. break;
  20570. case "bufferView":
  20571. r = this.loadBufferView(e);
  20572. break;
  20573. case "buffer":
  20574. r = this.loadBuffer(e);
  20575. break;
  20576. case "material":
  20577. r = this.loadMaterial(e);
  20578. break;
  20579. case "texture":
  20580. r = this.loadTexture(e);
  20581. break;
  20582. case "skin":
  20583. r = this.loadSkin(e);
  20584. break;
  20585. case "animation":
  20586. r = this.loadAnimation(e);
  20587. break;
  20588. case "camera":
  20589. r = this.loadCamera(e);
  20590. break;
  20591. case "light":
  20592. r = this.extensions[i.KHR_LIGHTS_PUNCTUAL].loadLight(e);
  20593. break;
  20594. default:
  20595. throw new Error("Unknown type: " + t)
  20596. }
  20597. this.cache.add(n, r)
  20598. }
  20599. return r
  20600. }, U.prototype.getDependencies = function(t) {
  20601. var e = this.cache.get(t);
  20602. if (!e) {
  20603. var i = this,
  20604. n = this.json[t + ("mesh" === t ? "es" : "s")] || [];
  20605. e = Promise.all(n.map((function(e, n) {
  20606. return i.getDependency(t, n)
  20607. }))), this.cache.add(t, e)
  20608. }
  20609. return e
  20610. }, U.prototype.loadBuffer = function(t) {
  20611. var e = this.json.buffers[t],
  20612. n = this.fileLoader;
  20613. if (e.type && "arraybuffer" !== e.type) throw new Error("THREE.GLTFLoader: " + e.type + " buffer type is not supported.");
  20614. if (void 0 === e.uri && 0 === t) return Promise.resolve(this.extensions[i.KHR_BINARY_GLTF].body);
  20615. var r = this.options;
  20616. return new Promise((function(t, i) {
  20617. n.load(R(e.uri, r.path), t, void 0, (function() {
  20618. i(new Error('THREE.GLTFLoader: Failed to load buffer "' + e.uri + '".'))
  20619. }))
  20620. }))
  20621. }, U.prototype.loadBufferView = function(t) {
  20622. var e = this.json.bufferViews[t];
  20623. return this.getDependency("buffer", e.buffer)
  20624. .then((function(t) {
  20625. var i = e.byteLength || 0,
  20626. n = e.byteOffset || 0;
  20627. return t.slice(n, n + i)
  20628. }))
  20629. }, U.prototype.loadAccessor = function(t) {
  20630. var e = this,
  20631. i = this.json,
  20632. r = this.json.accessors[t];
  20633. if (void 0 === r.bufferView && void 0 === r.sparse) return Promise.resolve(null);
  20634. var o = [];
  20635. return void 0 !== r.bufferView ? o.push(this.getDependency("bufferView", r.bufferView)) : o.push(null), void 0 !== r.sparse && (o.push(this.getDependency("bufferView", r.sparse.indices.bufferView)), o.push(this.getDependency("bufferView", r.sparse.values.bufferView))), Promise.all(o)
  20636. .then((function(t) {
  20637. var o, a, s = t[0],
  20638. l = A[r.type],
  20639. u = T[r.componentType],
  20640. h = u.BYTES_PER_ELEMENT,
  20641. c = h * l,
  20642. d = r.byteOffset || 0,
  20643. p = void 0 !== r.bufferView ? i.bufferViews[r.bufferView].byteStride : void 0,
  20644. f = !0 === r.normalized;
  20645. if (p && p !== c) {
  20646. var m = "InterleavedBuffer:" + r.bufferView + ":" + r.componentType,
  20647. g = e.cache.get(m);
  20648. g || (o = new u(s), g = new n.InterleavedBuffer(o, p / h), e.cache.add(m, g)), a = new n.InterleavedBufferAttribute(g, l, d / h, f)
  20649. } else o = null === s ? new u(r.count * l) : new u(s, d, r.count * l), a = new n.BufferAttribute(o, l, f);
  20650. if (void 0 !== r.sparse) {
  20651. var v = A.SCALAR,
  20652. y = T[r.sparse.indices.componentType],
  20653. b = r.sparse.indices.byteOffset || 0,
  20654. w = r.sparse.values.byteOffset || 0,
  20655. x = new y(t[1], b, r.sparse.count * v),
  20656. M = new u(t[2], w, r.sparse.count * l);
  20657. null !== s && a.setArray(a.array.slice());
  20658. for (var S = 0, _ = x.length; S < _; S++) {
  20659. var P = x[S];
  20660. if (a.setX(P, M[S * l]), l >= 2 && a.setY(P, M[S * l + 1]), l >= 3 && a.setZ(P, M[S * l + 2]), l >= 4 && a.setW(P, M[S * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")
  20661. }
  20662. }
  20663. return a
  20664. }))
  20665. }, U.prototype.loadTexture = function(t) {
  20666. var e, r = this,
  20667. o = this.json,
  20668. a = this.options,
  20669. s = this.textureLoader,
  20670. l = window.URL || window.webkitURL,
  20671. u = o.textures[t],
  20672. h = u.extensions || {},
  20673. c = (e = h[i.MSFT_TEXTURE_DDS] ? o.images[h[i.MSFT_TEXTURE_DDS].source] : o.images[u.source])
  20674. .uri,
  20675. d = !1;
  20676. return void 0 !== e.bufferView && (c = r.getDependency("bufferView", e.bufferView)
  20677. .then((function(t) {
  20678. d = !0;
  20679. var i = new Blob([t], {
  20680. type: e.mimeType
  20681. });
  20682. return c = l.createObjectURL(i)
  20683. }))), Promise.resolve(c)
  20684. .then((function(t) {
  20685. var e = n.Loader.Handlers.get(t);
  20686. return e || (e = h[i.MSFT_TEXTURE_DDS] ? r.extensions[i.MSFT_TEXTURE_DDS].ddsLoader : s), new Promise((function(i, n) {
  20687. e.load(R(t, a.path), i, void 0, n)
  20688. }))
  20689. }))
  20690. .then((function(t) {
  20691. !0 === d && l.revokeObjectURL(c), t.flipY = !1, void 0 !== u.name && (t.name = u.name), e.mimeType in I && (t.format = I[e.mimeType]);
  20692. var i = (o.samplers || {})[u.sampler] || {};
  20693. return t.magFilter = S[i.magFilter] || n.LinearFilter, t.minFilter = S[i.minFilter] || n.LinearMipMapLinearFilter, t.wrapS = _[i.wrapS] || n.RepeatWrapping, t.wrapT = _[i.wrapT] || n.RepeatWrapping, t
  20694. }))
  20695. }, U.prototype.assignTexture = function(t, e, r) {
  20696. var o = this;
  20697. return this.getDependency("texture", r.index)
  20698. .then((function(a) {
  20699. if (!a.isCompressedTexture) switch (e) {
  20700. case "aoMap":
  20701. case "emissiveMap":
  20702. case "metalnessMap":
  20703. case "normalMap":
  20704. case "roughnessMap":
  20705. a.format = n.RGBFormat
  20706. }
  20707. if (o.extensions[i.KHR_TEXTURE_TRANSFORM]) {
  20708. var s = void 0 !== r.extensions ? r.extensions[i.KHR_TEXTURE_TRANSFORM] : void 0;
  20709. s && (a = o.extensions[i.KHR_TEXTURE_TRANSFORM].extendTexture(a, s))
  20710. }
  20711. t[e] = a
  20712. }))
  20713. }, U.prototype.assignFinalMaterial = function(t) {
  20714. var e = t.geometry,
  20715. r = t.material,
  20716. o = this.extensions,
  20717. a = void 0 !== e.attributes.tangent,
  20718. s = void 0 !== e.attributes.color,
  20719. l = void 0 === e.attributes.normal,
  20720. u = !0 === t.isSkinnedMesh,
  20721. h = Object.keys(e.morphAttributes)
  20722. .length > 0,
  20723. c = h && void 0 !== e.morphAttributes.normal;
  20724. if (t.isPoints) {
  20725. var d = "PointsMaterial:" + r.uuid,
  20726. p = this.cache.get(d);
  20727. p || (p = new n.PointsMaterial, n.Material.prototype.copy.call(p, r), p.color.copy(r.color), p.map = r.map, p.lights = !1, this.cache.add(d, p)), r = p
  20728. } else if (t.isLine) {
  20729. d = "LineBasicMaterial:" + r.uuid;
  20730. var f = this.cache.get(d);
  20731. f || (f = new n.LineBasicMaterial, n.Material.prototype.copy.call(f, r), f.color.copy(r.color), f.lights = !1, this.cache.add(d, f)), r = f
  20732. }
  20733. if (a || s || l || u || h) {
  20734. d = "ClonedMaterial:" + r.uuid + ":";
  20735. r.isGLTFSpecularGlossinessMaterial && (d += "specular-glossiness:"), u && (d += "skinning:"), a && (d += "vertex-tangents:"), s && (d += "vertex-colors:"), l && (d += "flat-shading:"), h && (d += "morph-targets:"), c && (d += "morph-normals:");
  20736. var m = this.cache.get(d);
  20737. m || (m = r.isGLTFSpecularGlossinessMaterial ? o[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].cloneMaterial(r) : r.clone(), u && (m.skinning = !0), a && (m.vertexTangents = !0), s && (m.vertexColors = n.VertexColors), l && (m.flatShading = !0), h && (m.morphTargets = !0), c && (m.morphNormals = !0), this.cache.add(d, m)), r = m
  20738. }
  20739. r.aoMap && void 0 === e.attributes.uv2 && void 0 !== e.attributes.uv && e.addAttribute("uv2", new n.BufferAttribute(e.attributes.uv.array, 2)), r.isGLTFSpecularGlossinessMaterial && (t.onBeforeRender = o[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].refreshUniforms), t.material = r
  20740. }, U.prototype.loadMaterial = function(t) {
  20741. var e, r = this.json,
  20742. o = this.extensions,
  20743. a = r.materials[t],
  20744. s = {},
  20745. l = a.extensions || {},
  20746. u = [];
  20747. if (l[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]) {
  20748. var h = o[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];
  20749. e = h.getMaterialType(), u.push(h.extendParams(s, a, this))
  20750. } else if (l[i.KHR_MATERIALS_UNLIT]) {
  20751. var c = o[i.KHR_MATERIALS_UNLIT];
  20752. e = c.getMaterialType(), u.push(c.extendParams(s, a, this))
  20753. } else {
  20754. e = n.MeshStandardMaterial;
  20755. var d = a.pbrMetallicRoughness || {};
  20756. if (s.color = new n.Color(1, 1, 1), s.opacity = 1, Array.isArray(d.baseColorFactor)) {
  20757. var p = d.baseColorFactor;
  20758. s.color.fromArray(p), s.opacity = p[3]
  20759. }
  20760. void 0 !== d.baseColorTexture && u.push(this.assignTexture(s, "map", d.baseColorTexture)), s.metalness = void 0 !== d.metallicFactor ? d.metallicFactor : 1, s.roughness = void 0 !== d.roughnessFactor ? d.roughnessFactor : 1, void 0 !== d.metallicRoughnessTexture && (u.push(this.assignTexture(s, "metalnessMap", d.metallicRoughnessTexture)), u.push(this.assignTexture(s, "roughnessMap", d.metallicRoughnessTexture)))
  20761. }!0 === a.doubleSided && (s.side = n.DoubleSide);
  20762. var f = a.alphaMode || D;
  20763. return f === O ? s.transparent = !0 : (s.transparent = !1, f === L && (s.alphaTest = void 0 !== a.alphaCutoff ? a.alphaCutoff : .5)), void 0 !== a.normalTexture && e !== n.MeshBasicMaterial && (u.push(this.assignTexture(s, "normalMap", a.normalTexture)), s.normalScale = new n.Vector2(1, 1), void 0 !== a.normalTexture.scale && s.normalScale.set(a.normalTexture.scale, a.normalTexture.scale)), void 0 !== a.occlusionTexture && e !== n.MeshBasicMaterial && (u.push(this.assignTexture(s, "aoMap", a.occlusionTexture)), void 0 !== a.occlusionTexture.strength && (s.aoMapIntensity = a.occlusionTexture.strength)), void 0 !== a.emissiveFactor && e !== n.MeshBasicMaterial && (s.emissive = (new n.Color)
  20764. .fromArray(a.emissiveFactor)), void 0 !== a.emissiveTexture && e !== n.MeshBasicMaterial && u.push(this.assignTexture(s, "emissiveMap", a.emissiveTexture)), Promise.all(u)
  20765. .then((function() {
  20766. var t;
  20767. return t = e === n.ShaderMaterial ? o[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s) : new e(s), void 0 !== a.name && (t.name = a.name), t.map && (t.map.encoding = n.sRGBEncoding), t.emissiveMap && (t.emissiveMap.encoding = n.sRGBEncoding), t.specularMap && (t.specularMap.encoding = n.sRGBEncoding), k(t, a), a.extensions && N(o, t, a), t
  20768. }))
  20769. }, U.prototype.loadGeometries = function(t) {
  20770. var e = this,
  20771. r = this.extensions,
  20772. o = this.primitiveCache;
  20773. function a(t) {
  20774. return r[i.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(t, e)
  20775. .then((function(i) {
  20776. return V(i, t, e)
  20777. }))
  20778. }
  20779. for (var s, l, u = [], h = 0, c = t.length; h < c; h++) {
  20780. var d, p = t[h],
  20781. f = (l = void 0, (l = (s = p)
  20782. .extensions && s.extensions[i.KHR_DRACO_MESH_COMPRESSION]) ? "draco:" + l.bufferView + ":" + l.indices + ":" + B(l.attributes) : s.indices + ":" + B(s.attributes) + ":" + s.mode),
  20783. m = o[f];
  20784. if (m) u.push(m.promise);
  20785. else d = p.extensions && p.extensions[i.KHR_DRACO_MESH_COMPRESSION] ? a(p) : V(new n.BufferGeometry, p, e), o[f] = {
  20786. primitive: p,
  20787. promise: d
  20788. }, u.push(d)
  20789. }
  20790. return Promise.all(u)
  20791. }, U.prototype.loadMesh = function(t) {
  20792. for (var e = this, i = this.json, r = (this.extensions, i.meshes[t]), o = r.primitives, a = [], s = 0, l = o.length; s < l; s++) {
  20793. var u = void 0 === o[s].material ? m = m || new n.MeshStandardMaterial({
  20794. color: 16777215,
  20795. emissive: 0,
  20796. metalness: 1,
  20797. roughness: 1,
  20798. transparent: !1,
  20799. depthTest: !0,
  20800. side: n.FrontSide
  20801. }) : this.getDependency("material", o[s].material);
  20802. a.push(u)
  20803. }
  20804. return Promise.all(a)
  20805. .then((function(i) {
  20806. return e.loadGeometries(o)
  20807. .then((function(a) {
  20808. for (var s = [], l = 0, u = a.length; l < u; l++) {
  20809. var h, c = a[l],
  20810. d = o[l],
  20811. p = i[l];
  20812. if (d.mode === w || d.mode === x || d.mode === M || void 0 === d.mode) !0 === (h = !0 === r.isSkinnedMesh ? new n.SkinnedMesh(c, p) : new n.Mesh(c, p))
  20813. .isSkinnedMesh && h.normalizeSkinWeights(), d.mode === x ? h.drawMode = n.TriangleStripDrawMode : d.mode === M && (h.drawMode = n.TriangleFanDrawMode);
  20814. else if (d.mode === v) h = new n.LineSegments(c, p);
  20815. else if (d.mode === b) h = new n.Line(c, p);
  20816. else if (d.mode === y) h = new n.LineLoop(c, p);
  20817. else {
  20818. if (d.mode !== g) throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + d.mode);
  20819. h = new n.Points(c, p)
  20820. }
  20821. Object.keys(h.geometry.morphAttributes)
  20822. .length > 0 && F(h, r), h.name = r.name || "mesh_" + t, a.length > 1 && (h.name += "_" + l), k(h, r), e.assignFinalMaterial(h), s.push(h)
  20823. }
  20824. if (1 === s.length) return s[0];
  20825. var f = new n.Group;
  20826. for (l = 0, u = s.length; l < u; l++) f.add(s[l]);
  20827. return f
  20828. }))
  20829. }))
  20830. }, U.prototype.loadCamera = function(t) {
  20831. var e, i = this.json.cameras[t],
  20832. r = i[i.type];
  20833. if (r) return "perspective" === i.type ? e = new n.PerspectiveCamera(n.Math.radToDeg(r.yfov), r.aspectRatio || 1, r.znear || 1, r.zfar || 2e6) : "orthographic" === i.type && (e = new n.OrthographicCamera(r.xmag / -2, r.xmag / 2, r.ymag / 2, r.ymag / -2, r.znear, r.zfar)), void 0 !== i.name && (e.name = i.name), k(e, i), Promise.resolve(e)
  20834. }, U.prototype.loadSkin = function(t) {
  20835. var e = this.json.skins[t],
  20836. i = {
  20837. joints: e.joints
  20838. };
  20839. return void 0 === e.inverseBindMatrices ? Promise.resolve(i) : this.getDependency("accessor", e.inverseBindMatrices)
  20840. .then((function(t) {
  20841. return i.inverseBindMatrices = t, i
  20842. }))
  20843. }, U.prototype.loadAnimation = function(t) {
  20844. for (var e = this.json.animations[t], i = [], r = [], o = [], a = [], s = [], l = 0, u = e.channels.length; l < u; l++) {
  20845. var h = e.channels[l],
  20846. c = e.samplers[h.sampler],
  20847. d = h.target,
  20848. p = void 0 !== d.node ? d.node : d.id,
  20849. m = void 0 !== e.parameters ? e.parameters[c.input] : c.input,
  20850. g = void 0 !== e.parameters ? e.parameters[c.output] : c.output;
  20851. i.push(this.getDependency("node", p)), r.push(this.getDependency("accessor", m)), o.push(this.getDependency("accessor", g)), a.push(c), s.push(d)
  20852. }
  20853. return Promise.all([Promise.all(i), Promise.all(r), Promise.all(o), Promise.all(a), Promise.all(s)])
  20854. .then((function(i) {
  20855. for (var r = i[0], o = i[1], a = i[2], s = i[3], l = i[4], u = [], h = 0, c = r.length; h < c; h++) {
  20856. var d = r[h],
  20857. p = o[h],
  20858. m = a[h],
  20859. g = s[h],
  20860. v = l[h];
  20861. if (void 0 !== d) {
  20862. var y;
  20863. switch (d.updateMatrix(), d.matrixAutoUpdate = !0, C[v.path]) {
  20864. case C.weights:
  20865. y = n.NumberKeyframeTrack;
  20866. break;
  20867. case C.rotation:
  20868. y = n.QuaternionKeyframeTrack;
  20869. break;
  20870. case C.position:
  20871. case C.scale:
  20872. default:
  20873. y = n.VectorKeyframeTrack
  20874. }
  20875. var b = d.name ? d.name : d.uuid,
  20876. w = void 0 !== g.interpolation ? E[g.interpolation] : n.InterpolateLinear,
  20877. x = [];
  20878. C[v.path] === C.weights ? d.traverse((function(t) {
  20879. !0 === t.isMesh && t.morphTargetInfluences && x.push(t.name ? t.name : t.uuid)
  20880. })) : x.push(b);
  20881. for (var M = 0, T = x.length; M < T; M++) {
  20882. var S = new y(x[M] + "." + C[v.path], p.array, m.array, w);
  20883. "CUBICSPLINE" === g.interpolation && (S.createInterpolant = function(t) {
  20884. return new f(this.times, this.values, this.getValueSize() / 3, t)
  20885. }, S.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0), u.push(S)
  20886. }
  20887. }
  20888. }
  20889. var _ = void 0 !== e.name ? e.name : "animation_" + t;
  20890. return new n.AnimationClip(_, void 0, u)
  20891. }))
  20892. }, U.prototype.loadNode = function(t) {
  20893. var e = this.json,
  20894. r = this.extensions,
  20895. o = this,
  20896. a = e.meshReferences,
  20897. s = e.meshUses,
  20898. l = e.nodes[t];
  20899. return (!0 === l.isBone ? Promise.resolve(new n.Bone) : void 0 !== l.mesh ? o.getDependency("mesh", l.mesh)
  20900. .then((function(t) {
  20901. var e;
  20902. if (a[l.mesh] > 1) {
  20903. var i = s[l.mesh]++;
  20904. (e = t.clone())
  20905. .name += "_instance_" + i, e.onBeforeRender = t.onBeforeRender;
  20906. for (var n = 0, r = e.children.length; n < r; n++) e.children[n].name += "_instance_" + i, e.children[n].onBeforeRender = t.children[n].onBeforeRender
  20907. } else e = t;
  20908. return void 0 !== l.weights && e.traverse((function(t) {
  20909. if (t.isMesh)
  20910. for (var e = 0, i = l.weights.length; e < i; e++) t.morphTargetInfluences[e] = l.weights[e]
  20911. })), e
  20912. })) : void 0 !== l.camera ? o.getDependency("camera", l.camera) : l.extensions && l.extensions[i.KHR_LIGHTS_PUNCTUAL] && void 0 !== l.extensions[i.KHR_LIGHTS_PUNCTUAL].light ? o.getDependency("light", l.extensions[i.KHR_LIGHTS_PUNCTUAL].light) : Promise.resolve(new n.Object3D))
  20913. .then((function(t) {
  20914. if (void 0 !== l.name && (t.name = n.PropertyBinding.sanitizeNodeName(l.name)), k(t, l), l.extensions && N(r, t, l), void 0 !== l.matrix) {
  20915. var e = new n.Matrix4;
  20916. e.fromArray(l.matrix), t.applyMatrix(e)
  20917. } else void 0 !== l.translation && t.position.fromArray(l.translation), void 0 !== l.rotation && t.quaternion.fromArray(l.rotation), void 0 !== l.scale && t.scale.fromArray(l.scale);
  20918. return t
  20919. }))
  20920. }, U.prototype.loadScene = function() {
  20921. function t(e, i, r, o) {
  20922. var a = r.nodes[e];
  20923. return o.getDependency("node", e)
  20924. .then((function(t) {
  20925. return void 0 === a.skin ? t : o.getDependency("skin", a.skin)
  20926. .then((function(t) {
  20927. for (var i = [], n = 0, r = (e = t)
  20928. .joints.length; n < r; n++) i.push(o.getDependency("node", e.joints[n]));
  20929. return Promise.all(i)
  20930. }))
  20931. .then((function(i) {
  20932. for (var r = !0 === t.isGroup ? t.children : [t], o = 0, a = r.length; o < a; o++) {
  20933. for (var s = r[o], l = [], u = [], h = 0, c = i.length; h < c; h++) {
  20934. var d = i[h];
  20935. if (d) {
  20936. l.push(d);
  20937. var p = new n.Matrix4;
  20938. void 0 !== e.inverseBindMatrices && p.fromArray(e.inverseBindMatrices.array, 16 * h), u.push(p)
  20939. }
  20940. }
  20941. s.bind(new n.Skeleton(l, u), s.matrixWorld)
  20942. }
  20943. return t
  20944. }));
  20945. var e
  20946. }))
  20947. .then((function(e) {
  20948. i.add(e);
  20949. var n = [];
  20950. if (a.children)
  20951. for (var s = a.children, l = 0, u = s.length; l < u; l++) {
  20952. var h = s[l];
  20953. n.push(t(h, e, r, o))
  20954. }
  20955. return Promise.all(n)
  20956. }))
  20957. }
  20958. return function(e) {
  20959. var i = this.json,
  20960. r = this.extensions,
  20961. o = this.json.scenes[e],
  20962. a = new n.Scene;
  20963. void 0 !== o.name && (a.name = o.name), k(a, o), o.extensions && N(r, a, o);
  20964. for (var s = o.nodes || [], l = [], u = 0, h = s.length; u < h; u++) l.push(t(s[u], a, i, this));
  20965. return Promise.all(l)
  20966. .then((function() {
  20967. return a
  20968. }))
  20969. }
  20970. }(), t
  20971. }()
  20972. }, function(t, e, i) {
  20973. "use strict";
  20974. i(124);
  20975. var n = i(0);
  20976. i(68);
  20977. function r() {
  20978. this.loader = new n.OBJLoaderOfMeshMatcapMaterial
  20979. }
  20980. r.prototype.load = function(t) {
  20981. var e = this;
  20982. return new Promise((function(i, n) {
  20983. e.loader.load(t, (function(t) {
  20984. t ? i(t) : n("load obj model error!")
  20985. }))
  20986. }))
  20987. }, t.exports = new r
  20988. }, function(t, e, i) {
  20989. var n = i(0);
  20990. n.OBJLoaderOfMeshMatcapMaterial = function() {
  20991. var t = /^[og]\s*(.+)?/,
  20992. e = /^mtllib /,
  20993. i = /^usemtl /;
  20994. function r() {
  20995. var t = {
  20996. objects: [],
  20997. object: {},
  20998. vertices: [],
  20999. normals: [],
  21000. colors: [],
  21001. uvs: [],
  21002. materialLibraries: [],
  21003. startObject: function(t, e) {
  21004. if (this.object && !1 === this.object.fromDeclaration) return this.object.name = t, void(this.object.fromDeclaration = !1 !== e);
  21005. var i = this.object && "function" == typeof this.object.currentMaterial ? this.object.currentMaterial() : void 0;
  21006. if (this.object && "function" == typeof this.object._finalize && this.object._finalize(!0), this.object = {
  21007. name: t || "",
  21008. fromDeclaration: !1 !== e,
  21009. geometry: {
  21010. vertices: [],
  21011. normals: [],
  21012. colors: [],
  21013. uvs: []
  21014. },
  21015. materials: [],
  21016. smooth: !0,
  21017. startMaterial: function(t, e) {
  21018. var i = this._finalize(!1);
  21019. i && (i.inherited || i.groupCount <= 0) && this.materials.splice(i.index, 1);
  21020. var n = {
  21021. index: this.materials.length,
  21022. name: t || "",
  21023. mtllib: Array.isArray(e) && e.length > 0 ? e[e.length - 1] : "",
  21024. smooth: void 0 !== i ? i.smooth : this.smooth,
  21025. groupStart: void 0 !== i ? i.groupEnd : 0,
  21026. groupEnd: -1,
  21027. groupCount: -1,
  21028. inherited: !1,
  21029. clone: function(t) {
  21030. var e = {
  21031. index: "number" == typeof t ? t : this.index,
  21032. name: this.name,
  21033. mtllib: this.mtllib,
  21034. smooth: this.smooth,
  21035. groupStart: 0,
  21036. groupEnd: -1,
  21037. groupCount: -1,
  21038. inherited: !1
  21039. };
  21040. return e.clone = this.clone.bind(e), e
  21041. }
  21042. };
  21043. return this.materials.push(n), n
  21044. },
  21045. currentMaterial: function() {
  21046. if (this.materials.length > 0) return this.materials[this.materials.length - 1]
  21047. },
  21048. _finalize: function(t) {
  21049. var e = this.currentMaterial();
  21050. if (e && -1 === e.groupEnd && (e.groupEnd = this.geometry.vertices.length / 3, e.groupCount = e.groupEnd - e.groupStart, e.inherited = !1), t && this.materials.length > 1)
  21051. for (var i = this.materials.length - 1; i >= 0; i--) this.materials[i].groupCount <= 0 && this.materials.splice(i, 1);
  21052. return t && 0 === this.materials.length && this.materials.push({
  21053. name: "",
  21054. smooth: this.smooth
  21055. }), e
  21056. }
  21057. }, i && i.name && "function" == typeof i.clone) {
  21058. var n = i.clone(0);
  21059. n.inherited = !0, this.object.materials.push(n)
  21060. }
  21061. this.objects.push(this.object)
  21062. },
  21063. finalize: function() {
  21064. this.object && "function" == typeof this.object._finalize && this.object._finalize(!0)
  21065. },
  21066. parseVertexIndex: function(t, e) {
  21067. var i = parseInt(t, 10);
  21068. return 3 * (i >= 0 ? i - 1 : i + e / 3)
  21069. },
  21070. parseNormalIndex: function(t, e) {
  21071. var i = parseInt(t, 10);
  21072. return 3 * (i >= 0 ? i - 1 : i + e / 3)
  21073. },
  21074. parseUVIndex: function(t, e) {
  21075. var i = parseInt(t, 10);
  21076. return 2 * (i >= 0 ? i - 1 : i + e / 2)
  21077. },
  21078. addVertex: function(t, e, i) {
  21079. var n = this.vertices,
  21080. r = this.object.geometry.vertices;
  21081. r.push(n[t + 0], n[t + 1], n[t + 2]), r.push(n[e + 0], n[e + 1], n[e + 2]), r.push(n[i + 0], n[i + 1], n[i + 2])
  21082. },
  21083. addVertexPoint: function(t) {
  21084. var e = this.vertices;
  21085. this.object.geometry.vertices.push(e[t + 0], e[t + 1], e[t + 2])
  21086. },
  21087. addVertexLine: function(t) {
  21088. var e = this.vertices;
  21089. this.object.geometry.vertices.push(e[t + 0], e[t + 1], e[t + 2])
  21090. },
  21091. addNormal: function(t, e, i) {
  21092. var n = this.normals,
  21093. r = this.object.geometry.normals;
  21094. r.push(n[t + 0], n[t + 1], n[t + 2]), r.push(n[e + 0], n[e + 1], n[e + 2]), r.push(n[i + 0], n[i + 1], n[i + 2])
  21095. },
  21096. addColor: function(t, e, i) {
  21097. var n = this.colors,
  21098. r = this.object.geometry.colors;
  21099. r.push(n[t + 0], n[t + 1], n[t + 2]), r.push(n[e + 0], n[e + 1], n[e + 2]), r.push(n[i + 0], n[i + 1], n[i + 2])
  21100. },
  21101. addUV: function(t, e, i) {
  21102. var n = this.uvs,
  21103. r = this.object.geometry.uvs;
  21104. r.push(n[t + 0], n[t + 1]), r.push(n[e + 0], n[e + 1]), r.push(n[i + 0], n[i + 1])
  21105. },
  21106. addUVLine: function(t) {
  21107. var e = this.uvs;
  21108. this.object.geometry.uvs.push(e[t + 0], e[t + 1])
  21109. },
  21110. addFace: function(t, e, i, n, r, o, a, s, l) {
  21111. var u = this.vertices.length,
  21112. h = this.parseVertexIndex(t, u),
  21113. c = this.parseVertexIndex(e, u),
  21114. d = this.parseVertexIndex(i, u);
  21115. if (this.addVertex(h, c, d), void 0 !== n && "" !== n) {
  21116. var p = this.uvs.length;
  21117. h = this.parseUVIndex(n, p), c = this.parseUVIndex(r, p), d = this.parseUVIndex(o, p), this.addUV(h, c, d)
  21118. }
  21119. if (void 0 !== a && "" !== a) {
  21120. var f = this.normals.length;
  21121. h = this.parseNormalIndex(a, f), c = a === s ? h : this.parseNormalIndex(s, f), d = a === l ? h : this.parseNormalIndex(l, f), this.addNormal(h, c, d)
  21122. }
  21123. this.colors.length > 0 && this.addColor(h, c, d)
  21124. },
  21125. addPointGeometry: function(t) {
  21126. this.object.geometry.type = "Points";
  21127. for (var e = this.vertices.length, i = 0, n = t.length; i < n; i++) this.addVertexPoint(this.parseVertexIndex(t[i], e))
  21128. },
  21129. addLineGeometry: function(t, e) {
  21130. this.object.geometry.type = "Line";
  21131. for (var i = this.vertices.length, n = this.uvs.length, r = 0, o = t.length; r < o; r++) this.addVertexLine(this.parseVertexIndex(t[r], i));
  21132. var a = 0;
  21133. for (o = e.length; a < o; a++) this.addUVLine(this.parseUVIndex(e[a], n))
  21134. }
  21135. };
  21136. return t.startObject("", !1), t
  21137. }
  21138. function o(t) {
  21139. this.manager = void 0 !== t ? t : n.DefaultLoadingManager, this.materials = null
  21140. }
  21141. return o.prototype = {
  21142. constructor: o,
  21143. load: function(t, e, i, r) {
  21144. var o = this,
  21145. a = new n.FileLoader(o.manager);
  21146. a.setPath(this.path), a.load(t, (function(t) {
  21147. e(o.parse(t))
  21148. }), i, r)
  21149. },
  21150. setPath: function(t) {
  21151. return this.path = t, this
  21152. },
  21153. setMaterials: function(t) {
  21154. return this.materials = t, this
  21155. },
  21156. parse: function(o) {
  21157. var a = new r; - 1 !== o.indexOf("\r\n") && (o = o.replace(/\r\n/g, "\n")), -1 !== o.indexOf("\\\n") && (o = o.replace(/\\\n/g, ""));
  21158. for (var s = o.split("\n"), l = "", u = "", h = [], c = "function" == typeof "".trimLeft, d = 0, p = s.length; d < p; d++)
  21159. if (l = s[d], 0 !== (l = c ? l.trimLeft() : l.trim())
  21160. .length && "#" !== (u = l.charAt(0)))
  21161. if ("v" === u) {
  21162. var f = l.split(/\s+/);
  21163. switch (f[0]) {
  21164. case "v":
  21165. a.vertices.push(parseFloat(f[1]), parseFloat(f[2]), parseFloat(f[3])), 8 === f.length && a.colors.push(parseFloat(f[4]), parseFloat(f[5]), parseFloat(f[6]));
  21166. break;
  21167. case "vn":
  21168. a.normals.push(parseFloat(f[1]), parseFloat(f[2]), parseFloat(f[3]));
  21169. break;
  21170. case "vt":
  21171. a.uvs.push(parseFloat(f[1]), parseFloat(f[2]))
  21172. }
  21173. } else if ("f" === u) {
  21174. for (var m = l.substr(1)
  21175. .trim()
  21176. .split(/\s+/), g = [], v = 0, y = m.length; v < y; v++) {
  21177. var b = m[v];
  21178. if (b.length > 0) {
  21179. var w = b.split("/");
  21180. g.push(w)
  21181. }
  21182. }
  21183. var x = g[0];
  21184. for (v = 1, y = g.length - 1; v < y; v++) {
  21185. var M = g[v],
  21186. T = g[v + 1];
  21187. a.addFace(x[0], M[0], T[0], x[1], M[1], T[1], x[2], M[2], T[2])
  21188. }
  21189. } else if ("l" === u) {
  21190. var S = l.substring(1)
  21191. .trim()
  21192. .split(" "),
  21193. _ = [],
  21194. A = [];
  21195. if (-1 === l.indexOf("/")) _ = S;
  21196. else
  21197. for (var P = 0, C = S.length; P < C; P++) {
  21198. var E = S[P].split("/");
  21199. "" !== E[0] && _.push(E[0]), "" !== E[1] && A.push(E[1])
  21200. }
  21201. a.addLineGeometry(_, A)
  21202. } else if ("p" === u) {
  21203. var D = l.substr(1)
  21204. .trim()
  21205. .split(" ");
  21206. a.addPointGeometry(D)
  21207. } else if (null !== (h = t.exec(l))) {
  21208. var L = (" " + h[0].substr(1)
  21209. .trim())
  21210. .substr(1);
  21211. a.startObject(L)
  21212. } else if (i.test(l)) a.object.startMaterial(l.substring(7)
  21213. .trim(), a.materialLibraries);
  21214. else if (e.test(l)) a.materialLibraries.push(l.substring(7)
  21215. .trim());
  21216. else {
  21217. if ("s" !== u) {
  21218. if ("\0" === l) continue;
  21219. throw new Error('THREE.OBJLoader: Unexpected line: "' + l + '"')
  21220. }
  21221. if ((h = l.split(" "))
  21222. .length > 1) {
  21223. var O = h[1].trim()
  21224. .toLowerCase();
  21225. a.object.smooth = "0" !== O && "off" !== O
  21226. } else a.object.smooth = !0;
  21227. (q = a.object.currentMaterial()) && (q.smooth = a.object.smooth)
  21228. }
  21229. a.finalize();
  21230. var I = new n.Group;
  21231. I.materialLibraries = [].concat(a.materialLibraries);
  21232. for (d = 0, p = a.objects.length; d < p; d++) {
  21233. var R = a.objects[d],
  21234. N = R.geometry,
  21235. k = R.materials,
  21236. F = "Line" === N.type,
  21237. B = "Points" === N.type,
  21238. z = !1;
  21239. if (0 !== N.vertices.length) {
  21240. var U = new n.BufferGeometry;
  21241. U.addAttribute("position", new n.Float32BufferAttribute(N.vertices, 3)), N.normals.length > 0 ? U.addAttribute("normal", new n.Float32BufferAttribute(N.normals, 3)) : U.computeVertexNormals(), N.colors.length > 0 && (z = !0, U.addAttribute("color", new n.Float32BufferAttribute(N.colors, 3))), N.uvs.length > 0 && U.addAttribute("uv", new n.Float32BufferAttribute(N.uvs, 2));
  21242. for (var V, j = [], H = 0, G = k.length; H < G; H++) {
  21243. var W = k[H],
  21244. q = void 0;
  21245. if (null !== this.materials)
  21246. if (q = this.materials.create(W.name), !F || !q || q instanceof n.LineBasicMaterial) {
  21247. if (B && q && !(q instanceof n.PointsMaterial)) {
  21248. var Y = new n.PointsMaterial({
  21249. size: 10,
  21250. sizeAttenuation: !1
  21251. });
  21252. n.Material.prototype.copy.call(Y, q), Y.color.copy(q.color), Y.map = q.map, Y.lights = !1, q = Y
  21253. }
  21254. } else {
  21255. var X = new n.LineBasicMaterial;
  21256. n.Material.prototype.copy.call(X, q), X.color.copy(q.color), X.lights = !1, q = X
  21257. } q || ((q = F ? new n.LineBasicMaterial : B ? new n.PointsMaterial({
  21258. size: 1,
  21259. sizeAttenuation: !1
  21260. }) : new n.MeshMatcapMaterial)
  21261. .name = W.name), q.flatShading = !W.smooth, q.vertexColors = z ? n.VertexColors : n.NoColors, j.push(q)
  21262. }
  21263. if (j.length > 1) {
  21264. for (H = 0, G = k.length; H < G; H++) {
  21265. W = k[H];
  21266. U.addGroup(W.groupStart, W.groupCount, H)
  21267. }
  21268. V = F ? new n.LineSegments(U, j) : B ? new n.Points(U, j) : new n.Mesh(U, j)
  21269. } else V = F ? new n.LineSegments(U, j[0]) : B ? new n.Points(U, j[0]) : new n.Mesh(U, j[0]);
  21270. V.name = R.name, I.add(V)
  21271. }
  21272. }
  21273. return I
  21274. }
  21275. }, o
  21276. }()
  21277. }, function(t, e, i) {
  21278. "use strict";
  21279. var n = i(0),
  21280. r = i(126),
  21281. o = {
  21282. Bip001_Neck: "Neck",
  21283. Bip001_Spine: "Spine",
  21284. Bip001_Spine1: "Spine1",
  21285. Bip001_L_Clavicle: "LeftShoulder",
  21286. Bip001_L_UpperArm: "LeftArm",
  21287. Bip001_L_Forearm: "LeftForeArm",
  21288. Bip001_L_Hand: "LeftHand",
  21289. Bip001_L_Thigh: "LeftUpLeg",
  21290. Bip001_L_Calf: "LeftLeg",
  21291. Bip001_L_Foot: "LeftFoot",
  21292. Bip001_R_Clavicle: "RightShoulder",
  21293. Bip001_R_UpperArm: "RightArm",
  21294. Bip001_R_Forearm: "RightForeArm",
  21295. Bip001_R_Hand: "RightHand",
  21296. Bip001_R_Thigh: "RightUpLeg",
  21297. Bip001_R_Calf: "RightLeg",
  21298. Bip001_R_Foot: "RightFoot",
  21299. Neck: "Neck",
  21300. Spine: "Spine",
  21301. Spine1: "Spine1",
  21302. LeftShoulder: "LeftShoulder",
  21303. LeftArm: "LeftArm",
  21304. LeftForeArm: "LeftForeArm",
  21305. LeftHand: "LeftHand",
  21306. LeftUpLeg: "LeftUpLeg",
  21307. LeftLeg: "LeftLeg",
  21308. LeftFoot: "LeftFoot",
  21309. RightShoulder: "RightShoulder",
  21310. RightArm: "RightArm",
  21311. RightForeArm: "RightForeArm",
  21312. RightHand: "RightHand",
  21313. RightUpLeg: "RightUpLeg",
  21314. RightLeg: "RightLeg",
  21315. RightFoot: "RightFoot"
  21316. };
  21317. function a(t, e) {
  21318. this.model = t, this.mid = e, this.settingItem = {}
  21319. }
  21320. a.prototype.init = function() {
  21321. this.model.userData.is_save ? (this.settingItem = this.model.userData.setting_item, this.restoreOfSettingItem(this.settingItem)) : (this.settingItem = new r(this.mid, this.model.uuid), this.settingItem.position = this.model.position, this.settingItem.rotation = this.model.rotation, this.settingItem.scale = this.model.scale, this.model.userData.setting_item = this.settingItem), this.initUserData(this.model), this.initSkeletonHelper(this.model)
  21322. }, a.prototype.restoreOfSettingItem = function(t) {
  21323. this.model.position.copy(t.position), this.model.rotation.copy(t.rotation), this.model.scale.copy(t.scale), this.model.visible = t.isShow, t.position = this.model.position, t.rotation = this.model.rotation, t.scale = this.model.scale, t.headTop_center_position = (new n.Vector3)
  21324. .copy(t.headTop_center_position)
  21325. }, a.prototype.initUserData = function(t) {
  21326. t.userData.handle_choosed = !1, t.userData.follow_mouse = !1, t.userData.skeleton_helper = null, t.userData.skeleton_box = null, t.userData.transform_control = null, t.userData.setting_item = this.settingItem
  21327. }, a.prototype.initSkeletonHelper = function(t) {
  21328. if (!t.userData.skeleton_helper) {
  21329. var e = new n.SkeletonHelper(t);
  21330. e.visible = !1, t.userData.skeleton_helper = e, G.render.scene.add(e), this.initBones2(e.bones)
  21331. }
  21332. }, a.prototype.initBons = function(t) {
  21333. var e = this,
  21334. i = {};
  21335. for (var r in this.settingItem.bones_rotation) i[r] = null;
  21336. var a = t.children.filter((function(t) {
  21337. return "Hips" === t.name || "Bip001" === t.name
  21338. }))[0],
  21339. s = new n.Vector3(1, 1, 1);
  21340. (.1 >= 100 * a.scale.x || .1 >= 100 * a.scale.y || .1 >= 100 * a.scale.z) && (s.x = 10, s.y = 10, s.z = 10), a.traverse((function(n) {
  21341. var r = o[n.name];
  21342. if (null === i[r]) {
  21343. if (i[r] = n, n.userData.current_scale = s, n.userData.rotation_default = {
  21344. x: n.rotation.x,
  21345. y: n.rotation.y,
  21346. z: n.rotation.z
  21347. }, t.userData.is_save) {
  21348. var a = t.userData.setting_item;
  21349. n.rotation.copy(a.bones_rotation[r])
  21350. }
  21351. e.settingItem.bones_rotation[r] = n.rotation
  21352. }
  21353. })), t.userData.bones = i
  21354. }, a.prototype.initBones2 = function(t) {
  21355. var e = {};
  21356. for (var i in this.settingItem.bones_rotation) e[i] = null;
  21357. for (var n = 0, r = t.length; n < r; ++n) {
  21358. var a = t[n],
  21359. s = o[a.name];
  21360. if (void 0 !== s && null === e[s]) {
  21361. if (e[s] = a, a.userData.rotation_default = {
  21362. x: a.rotation.x,
  21363. y: a.rotation.y,
  21364. z: a.rotation.z
  21365. }, this.model.userData.is_save) {
  21366. var l = this.model.userData.setting_item;
  21367. a.rotation.copy(l.bones_rotation[s])
  21368. }
  21369. this.settingItem.bones_rotation[s] = a.rotation
  21370. }
  21371. }
  21372. this.model.userData.bones = e
  21373. }, a.prototype.initMatcap = function() {
  21374. var t = this,
  21375. e = new n.TextureLoader;
  21376. return new Promise((function(i, n) {
  21377. e.load("model/texture/matcaps/matcap-porcelain-white.jpg", (function(e) {
  21378. e ? (t.model.traverse((function(i) {
  21379. "SkinnedMesh" === i.type && (i.userData.type = "HumanSkin", i.material.matcap = e, i.material.color.setHex(t.settingItem.skin_color), i.skeleton.update()), "AmbientLight" === i.type && t.model.remove(i)
  21380. })), i(t.model)) : n("add matcap error!")
  21381. }))
  21382. }))
  21383. }, t.exports = a
  21384. }, function(t, e, i) {
  21385. "use strict";
  21386. var n = i(0);
  21387. t.exports = function(t, e) {
  21388. this.mid = t, this.uuid = e, this.type = "human", this.modelName = "人体模型", this.raycaster = !1, this.isShow = !0, this.ground_clearance = 0, this.geometric_scaling = !0, this.origin_skin_color = "0x484DC2", this.origin_size = {
  21389. width: 0,
  21390. height: 0,
  21391. depth: 0
  21392. }, this.origin_scale = new n.Vector3(1, 1, 1), this.origin_position = new n.Vector3, this.origin_rotation = new n.Euler, this.skin_color = "0x484DC2", this.size = {
  21393. width: 0,
  21394. height: 0,
  21395. depth: 0
  21396. }, this.scale = new n.Vector3, this.position = new n.Vector3, this.rotation = new n.Euler, this.collision = !1, this.bones_rotation = {
  21397. Neck: new n.Euler,
  21398. Spine1: new n.Euler,
  21399. LeftHand: new n.Euler,
  21400. LeftArm: new n.Euler,
  21401. LeftForeArm: new n.Euler,
  21402. LeftFoot: new n.Euler,
  21403. LeftUpLeg: new n.Euler,
  21404. LeftLeg: new n.Euler,
  21405. RightHand: new n.Euler,
  21406. RightArm: new n.Euler,
  21407. RightForeArm: new n.Euler,
  21408. RightFoot: new n.Euler,
  21409. RightUpLeg: new n.Euler,
  21410. RightLeg: new n.Euler
  21411. }, this.timestamp = 0, this.current_location_id = "", this.headTop_center_position = new n.Vector3, this.headTop_center_screen_position = {
  21412. x: 0,
  21413. y: 0
  21414. }, this.labelIsShow = !0, this.labelBlockView = !1
  21415. }
  21416. }, function(t, e, i) {
  21417. "use strict";
  21418. var n = i(0),
  21419. r = (i(68), i(128));
  21420. function o(t, e) {
  21421. this.id = e, this.model = t, this.settingItem = null
  21422. }
  21423. o.prototype.init = function() {
  21424. this.model.userData.setting_item && (this.settingItem = this.model.userData.setting_item, this.restoreOfSettingItem(this.settingItem)), void 0 === this.model.userData.setting_item && (this.settingItem = new r(this.id, this.model.uuid), this.settingItem.position = this.model.position, this.settingItem.rotation = this.model.rotation, this.settingItem.scale = this.model.scale), this.initUserData(this.model)
  21425. }, o.prototype.initUserData = function(t) {
  21426. t.userData.handle_choosed = !1, t.userData.follow_mouse = !1, t.userData.box_helper = null, t.userData.transform_control = null, t.userData.setting_item = this.settingItem
  21427. }, o.prototype.initMatcap = function() {
  21428. var t = this;
  21429. new n.TextureLoader;
  21430. return new Promise((function(e, i) {
  21431. e(t.model)
  21432. }))
  21433. }, o.prototype.restoreOfSettingItem = function(t) {
  21434. this.model.position.copy(t.position), this.model.rotation.copy(t.rotation), this.model.scale.copy(t.scale), this.model.visible = t.isShow, t.position = this.model.position, t.rotation = this.model.rotation, t.scale = this.model.scale
  21435. }, t.exports = o
  21436. }, function(t, e, i) {
  21437. "use strict";
  21438. var n = i(0);
  21439. t.exports = function(t, e) {
  21440. this.mid = t, this.uuid = e, this.type = "weapon", this.modelName = "凶器", this.raycaster = !1, this.isShow = !0, this.ground_clearance = 0, this.geometric_scaling = !0, this.origin_skin_color = "0xc3c3c3", this.origin_size = {
  21441. width: 0,
  21442. height: 0,
  21443. depth: 0
  21444. }, this.origin_scale = new n.Vector3(1, 1, 1), this.origin_position = new n.Vector3, this.origin_rotation = new n.Euler, this.skin_color = "0x999999", this.size = {
  21445. width: 0,
  21446. height: 0,
  21447. depth: 0
  21448. }, this.scale = new n.Vector3, this.position = new n.Vector3, this.rotation = new n.Euler, this.collision = !1, this.timestamp = 0, this.current_location_id = ""
  21449. }
  21450. }, function(t, e, i) {
  21451. "use strict";
  21452. i(0);
  21453. var n = i(130),
  21454. r = i(131);
  21455. function o() {
  21456. this.model = new r, this._settingItem = null, this.defineProperty()
  21457. }
  21458. o.prototype.defineProperty = function() {
  21459. Object.defineProperty(this, "settingItem", {
  21460. get: function() {
  21461. return this._settingItem
  21462. },
  21463. set: function(t) {
  21464. this._settingItem = t, this._settingItem.uuid = this.model.uuid, this.restoreOfSettingItem(this._settingItem)
  21465. }
  21466. })
  21467. }, o.prototype.init = function(t) {
  21468. return t ? this.settingItem = t : (this._settingItem = new n(this.model.uuid), this._settingItem.position = this.model.position, this._settingItem.rotation = this.model.rotation), this.initUserData(this.model), this.model
  21469. }, o.prototype.initUserData = function(t) {
  21470. t.userData.handle_choosed = !1, t.userData.follow_mouse = !1, t.userData.box_helper = null, t.userData.transform_control = null, t.userData.face_group = null, t.userData.setting_item = this._settingItem
  21471. }, o.prototype.restoreOfSettingItem = function(t) {
  21472. this.model.position.copy(t.position), this.model.rotation.copy(t.rotation), this.model.visible = t.isShow, t.position = this.model.position, t.rotation = this.model.rotation, t.origin_position = this.model.position, t.origin_rotation = this.model.rotation, this.model.FOV = t.FOV, this.model.DISTANCE = t.DISTANCE
  21473. }, t.exports = o
  21474. }, function(t, e, i) {
  21475. "use strict";
  21476. var n = i(0);
  21477. t.exports = function() {
  21478. this.type = "camera", this.mid = 1, this.uuid = null, this.modelName = "摄像头", this.position = new n.Vector3, this.rotation = new n.Euler, this.FOV = 0, this.DISTANCE = 0, this.FOV_MIN = 10, this.FOV_MAX = 180, this.DISTANCE_MIN = 300, this.DISTANCE_MAX = 1e3, this.isShow = !0, this.origin_position = new n.Vector3, this.origin_rotation = new n.Euler, this.isBarrier = !1, this.isLabelShow = !0, this.labelPosition = {
  21479. x: 0,
  21480. y: 0
  21481. }, this.labelPosition2 = {
  21482. x: 0,
  21483. y: 0
  21484. }, this.hasSpaceData = !1, this.directionDistanceType = {
  21485. axis_1_0_0: 0,
  21486. "axis_0_-1_0": 0,
  21487. "axis_0_0_-1": 0
  21488. }, this.axleWireWidthDirectionRotate = {
  21489. axis_1_0_0: 0,
  21490. "axis_0_-1_0": 0,
  21491. "axis_0_0_-1": 0
  21492. }, this.current_location_id = ""
  21493. }
  21494. }, function(t, e, i) {
  21495. "use strict";
  21496. var n = i(0);
  21497. function r() {
  21498. n.Group.call(this), this._R = .025, this._H = .15, this._FOV = 30, this._DISTANCE = 300, this.segmentOfCone = 320, this.userData.virtual_camera = null, this.userData.cone = null, this._visible = !0, this.init(), this.defineProperty()
  21499. }
  21500. r.prototype = Object.create(n.Group.prototype), r.prototype.defineProperty = function() {
  21501. Object.defineProperty(this, "FOV", {
  21502. get: function() {
  21503. return this._FOV
  21504. },
  21505. set: function(t) {
  21506. this._FOV = t, this.update()
  21507. }
  21508. }), Object.defineProperty(this, "DISTANCE", {
  21509. get: function() {
  21510. return this._DISTANCE
  21511. },
  21512. set: function(t) {
  21513. this._DISTANCE = t, this.update()
  21514. }
  21515. })
  21516. }, r.prototype.init = function() {
  21517. var t = new n.CylinderBufferGeometry(this._R, this._R, this._H, 32),
  21518. e = new n.MeshLambertMaterial({
  21519. color: 3355443,
  21520. opacity: 1,
  21521. transparent: !0
  21522. }),
  21523. i = new n.Mesh(t, e);
  21524. i.geometry.rotateX(Math.PI / 2), i.name = "VirtualCamera", this.userData.virtual_camera = i, this.add(i);
  21525. var r = Math.tan(.5 * this._FOV * Math.PI / 180) * this._DISTANCE * .01,
  21526. o = (t = new n.ConeGeometry(r, .01 * this._DISTANCE, this.segmentOfCone), e = new n.MeshPhongMaterial({
  21527. color: 16776960,
  21528. transparent: !0,
  21529. opacity: 0,
  21530. depthWrite: !1,
  21531. side: n.DoubleSide
  21532. }), new n.Mesh(t, e));
  21533. o.name = "cone", o.rotateX(-Math.PI / 2), o.geometry.translate(0, .01 * -this._DISTANCE * .5 - .5 * this._H, 0), this.userData.cone = o, this.add(o)
  21534. }, r.prototype.update = function() {
  21535. var t = this.userData.cone;
  21536. if (t) {
  21537. var e = Math.tan(.5 * this._FOV * Math.PI / 180) * this._DISTANCE * .01;
  21538. t.geometry = new n.ConeGeometry(e, .01 * this._DISTANCE, this.segmentOfCone), t.geometry.translate(0, .01 * -this._DISTANCE * .5 - .5 * this._H, 0)
  21539. }
  21540. }, t.exports = r
  21541. }, function(t, e, i) {
  21542. "use strict";
  21543. var n = i(0);
  21544. t.exports = function(t) {
  21545. this.uuid = null, this.type = t, this.color = "#ff0000", this.title = "未命名", this.desc = "", this.imgs = [], this.position = new n.Vector3(0, 0, 0), this.scale = new n.Vector3(1, 1, 1), this.fat = 0, this.size = {
  21546. width: 0,
  21547. height: 0
  21548. }, this.default_scale = new n.Vector3(1, 1, 1), this.default_color = "#ff0000", this.default_fat = 0, this.default_size = {
  21549. width: 0,
  21550. height: 0
  21551. }, this.visible = !0, this.screenPosition = {
  21552. x: 0,
  21553. y: 0
  21554. }, this.current_location_id = "", this.size_slide_stop = null, this.distanceToScreenCenter = 0
  21555. }
  21556. }, function(t, e, i) {
  21557. "use strict";
  21558. function n(t) {
  21559. this.player = t, this.sRender = t.sRender, this.humanModelControls = t.humanModelControls, this.weaponModelControls = t.weaponModelControls, this.postilControls = t.postilControls, this.virtualCameraFovControls = t.virtualCameraFovControls
  21560. }
  21561. n.prototype.resetPutModel = function() {
  21562. this.humanModelControls.canbeUsed && this.humanModelControls.restoreOriginSetting(), this.weaponModelControls.canbeUsed && this.weaponModelControls.restoreOriginSetting(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.restoreOriginSetting()
  21563. }, n.prototype.showPutModel = function(t) {
  21564. this.humanModelControls.handleShowModel(t), this.weaponModelControls.handleShowModel(t), this.virtualCameraFovControls.handleShowModel(t)
  21565. }, n.prototype.showHumanModelBonesNode = function() {
  21566. if (this.humanModelControls.canbeUsed && this.humanModelControls.HUMANMODEL) {
  21567. var t = this.humanModelControls.HUMANMODEL;
  21568. this.humanModelControls.initBonesNode(t), this.humanModelControls.destroyControl(t)
  21569. }
  21570. }, n.prototype.showVirtualCameraMeasurement = function(t) {
  21571. var e = this.virtualCameraFovControls.putModelsOfKV[t];
  21572. e && this.virtualCameraFovControls.computeSpaceData(e, !0)
  21573. }, n.prototype.hideVirtualCameraMeasurement = function(t) {
  21574. var e = this.virtualCameraFovControls.putModelsOfKV[t];
  21575. e && this.virtualCameraFovControls.destroySpaceData(e)
  21576. }, n.prototype.bundleTranslateControlOfPutModel = function() {
  21577. this.humanModelControls.canbeUsed && this.humanModelControls.bundleControlOfTranslate(), this.weaponModelControls.canbeUsed && this.weaponModelControls.bundleControlOfTranslate(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.bundleControlOfTranslate()
  21578. }, n.prototype.bundleRotateControlOfPutModel = function() {
  21579. this.humanModelControls.canbeUsed && this.humanModelControls.bundleControlOfRotate(), this.weaponModelControls.canbeUsed && this.weaponModelControls.bundleControlOfRotate(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.bundleControlOfRotate()
  21580. }, n.prototype.handleClickModelItem = function(t) {
  21581. var e = this.humanModelControls.putModelsOfHumanKV[t],
  21582. i = this.weaponModelControls.WEAPONS_KV[t],
  21583. n = this.virtualCameraFovControls.putModelsOfKV[t],
  21584. r = e || i || n;
  21585. if (r) var o = r.userData.setting_item.current_location_id;
  21586. this.player.flyToPano({
  21587. pano: this.player.model.panos.index[o],
  21588. lookAtPoint: r.position,
  21589. duration: 360
  21590. }, (function(t) {}))
  21591. }, n.prototype.handleClickCompleteBtn = function() {
  21592. this.humanModelControls.canbeUsed && this.humanModelControls.handleComplete(), this.weaponModelControls.canbeUsed && this.weaponModelControls.handleComplete(), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.handleComplete()
  21593. }, n.prototype.onIntoEditMode = function() {
  21594. this.humanModelControls.canbeUsed && (this.humanModelControls.canbeSelect = !1, this.humanModelControls.handleShowCurrentModel()), this.weaponModelControls.canbeUsed && (this.weaponModelControls._canbeSelect = !1, this.weaponModelControls.handleShowCurrentModel()), this.virtualCameraFovControls.canbeUsed && (this.virtualCameraFovControls._canbeSelect = !1, this.virtualCameraFovControls.handleShowCurrentCamera())
  21595. }, n.prototype.onQuitEditMode = function() {
  21596. this.humanModelControls.canbeUsed && (this.humanModelControls.canbeSelect = !1, this.humanModelControls.handleHideCurrentModel()), this.weaponModelControls.canbeUsed && (this.weaponModelControls._canbeSelect = !1, this.weaponModelControls.handleHideCurrentModel()), this.virtualCameraFovControls.canbeUsed && (this.virtualCameraFovControls._canbeSelect = !1, this.virtualCameraFovControls.handleHideCurrentCamera())
  21597. }, n.prototype.onIntoPutMode = function() {
  21598. this.humanModelControls.canbeUsed && (this.humanModelControls.canbeSelect = !0), this.weaponModelControls.canbeUsed && (this.weaponModelControls._canbeSelect = !0), this.virtualCameraFovControls.canbeUsed && (this.virtualCameraFovControls._canbeSelect = !0)
  21599. }, n.prototype.onQuitPutMode = function() {
  21600. this.humanModelControls.canbeUsed && (this.humanModelControls.canbeSelect = !1, this.humanModelControls.destroyInvalidModelControl()), this.weaponModelControls.canbeUsed && (this.weaponModelControls._canbeSelect = !1, this.weaponModelControls.destroyModelChoosedState()), this.virtualCameraFovControls.canbeUsed && (this.virtualCameraFovControls._canbeSelect = !1, this.virtualCameraFovControls.destroyModelControlState())
  21601. }, n.prototype.onVirtualSetSlideStop = function(t) {
  21602. switch (t) {
  21603. case "camera-fov":
  21604. this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.onCameraFovSlideStop();
  21605. break;
  21606. case "camera-distance":
  21607. this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.onCameraDistanceSlideStop();
  21608. break;
  21609. default:
  21610. this.humanModelControls.canbeUsed && (this.humanModelControls.needUpdateSkeletonBox = !0, this.humanModelControls.updateSetToolsAndControlPosition()), this.weaponModelControls.canbeUsed && this.weaponModelControls.updateSetToolsAndControlPosition()
  21611. }
  21612. }, n.prototype.updatePutModelName = function(t) {
  21613. this.humanModelControls.canbeUsed && this.humanModelControls.updateModelName(t), this.weaponModelControls.canbeUsed && this.weaponModelControls.updateModelName(t), this.virtualCameraFovControls.canbeUsed && this.virtualCameraFovControls.updateModelName(t)
  21614. }, n.prototype.updateSizeOfPutModel = function(t) {
  21615. this.humanModelControls.canbeUsed && this.humanModelControls.updateSize(t), this.weaponModelControls.canbeUsed && this.weaponModelControls.updateSize(t)
  21616. }, n.prototype.updateModelGroundClearance = function(t) {
  21617. this.humanModelControls.canbeUsed && this.humanModelControls.updateModelGroundClearance(t), this.weaponModelControls.canbeUsed && this.weaponModelControls.updateModelGroundClearance(t)
  21618. }, n.prototype.updateCollision = function(t) {
  21619. this.humanModelControls.canbeUsed && this.humanModelControls.HUMANMODEL && (this.humanModelControls.collision = t), this.weaponModelControls.canbeUsed && this.weaponModelControls.CONTROLMODEL && (this.weaponModelControls.collision = t)
  21620. }, n.prototype.updatePostilInfo = function(t) {
  21621. this.postilControls.canbeUsed && this.postilControls.updatePostilInfo(t)
  21622. }, t.exports = n
  21623. }, function(t, e, i) {
  21624. "use strict";
  21625. var n = i(0),
  21626. r = i(9),
  21627. o = i(13),
  21628. a = i(40)(n),
  21629. s = i(4)
  21630. .EventEmitter,
  21631. l = (new n.TextureLoader)
  21632. .load("images/bone_node_default_2x.png"),
  21633. u = (new n.TextureLoader)
  21634. .load("images/bone_node_choosed_2x.png"),
  21635. h = (i(135), i(41));
  21636. function c(t) {
  21637. this._canbeUsed = !1, this._canbeChoosed = !0, this._canbeSelect = !0, this._needUpdateSkeletonBox = !1, this._collision = !1, this.player = t, this.sRender = t.sRender, this.mouse = new n.Vector3, this.raycaster = new n.Raycaster, this.raycaster2 = new n.Raycaster, this.putModelsOfHuman = [], this.putModelsOfHumanKV = {}, this.HUMANMODEL = null, this.INTERSECTS_SKIN = null, this.BONENODE = null, this.boneNodes = [], this.controls = [], this.viewMode = {
  21638. transitioning: !1,
  21639. panorama: !1
  21640. }, this.currentColliders = [], this._box_top_center = new n.Vector3, this.collision_d = .05, this.modelControlChange = !1, this.boneControlChange = !1, this.locationId = null, this.eye = new n.Vector3, this.unitY = new n.Vector3(0, 1, 0), this.emitter = new s, this.defineProperty(), this.initStateEngine()
  21641. }
  21642. c.prototype.defineProperty = function() {
  21643. Object.defineProperty(this, "canbeUsed", {
  21644. get: function() {
  21645. return this._canbeUsed
  21646. },
  21647. set: function(t) {
  21648. this._canbeUsed = t
  21649. }
  21650. }), Object.defineProperty(this, "canbeSelect", {
  21651. get: function() {
  21652. return this._canbeSelect
  21653. },
  21654. set: function(t) {
  21655. this._canbeSelect = t
  21656. }
  21657. }), Object.defineProperty(this, "collision", {
  21658. get: function() {
  21659. return this._collision
  21660. },
  21661. set: function(t) {
  21662. this._collision = t, this.HUMANMODEL.userData.setting_item.collision = t;
  21663. var e = this.HUMANMODEL.userData.transform_control;
  21664. if (e)
  21665. for (var i in e.MOVELOCK) e.MOVELOCK[i].state = !1
  21666. }
  21667. }), Object.defineProperty(this, "box_top_center", {
  21668. get: function() {
  21669. return this._box_top_center
  21670. },
  21671. set: function(t) {
  21672. this._box_top_center = t
  21673. }
  21674. }), Object.defineProperty(this, "needUpdateSkeletonBox", {
  21675. get: function() {
  21676. return this._needUpdateSkeletonBox
  21677. },
  21678. set: function(t) {
  21679. t && this.HUMANMODEL && this.updateSkeletonBox(this.HUMANMODEL)
  21680. }
  21681. })
  21682. }, c.prototype.initStateEngine = function() {
  21683. this.MouseStateEngine = {
  21684. mouseMoveIn: {
  21685. state: !1,
  21686. callback: this.handleMouseMoveInVirtualHuman.bind(this)
  21687. },
  21688. mouseMoveOut: {
  21689. state: !1,
  21690. callback: this.handleMouseMoveOutVirtualHuman.bind(this)
  21691. }
  21692. }, this.MouseStateEngineTranstion = {
  21693. mouseMoveIn: {
  21694. mouseMoveOut: function() {
  21695. this.MouseStateEngine.mouseMoveIn.state && (this.MouseStateEngine.mouseMoveIn.state = !1, this.MouseStateEngine.mouseMoveOut.state = !0, this.MouseStateEngine.mouseMoveOut.callback())
  21696. }.bind(this)
  21697. }
  21698. }
  21699. }, c.prototype.init = function(t) {
  21700. if (this.HUMANMODEL) {
  21701. if (this.HUMANMODEL.uuid === t.uuid) return;
  21702. this.destroyInvalidModelControl()
  21703. }
  21704. this.HUMANMODEL = t, this.initSkeletonBox(this.HUMANMODEL), this.bundleControlOfTranslate();
  21705. var e = t.userData.setting_item,
  21706. i = t.userData.skeleton_box;
  21707. this.updateSetToolsPosition(i), this.player.emit("choosedHumanModel", e), this.player.emit("showPutModelSetTools", "human")
  21708. }, c.prototype.initBonesNode = function(t) {
  21709. if (0 < this.boneNodes.length) this.handleSwitchBonesNodeVisible(!0);
  21710. else {
  21711. var e = t.userData.bones;
  21712. for (var i in e) {
  21713. var r = e[i],
  21714. o = new n.SpriteMaterial({
  21715. map: l,
  21716. side: n.DoubleSide,
  21717. transparent: !0,
  21718. depthTest: !1
  21719. }),
  21720. a = new n.Sprite(o),
  21721. s = r.localToWorld(r.position.clone()
  21722. .applyMatrix4(r.matrixWorld));
  21723. a.scale.divideScalar(22), a.position.copy(s), a.userData.type = "BoneNode", a.userData.mouse_hover = !1, a.userData.handle_choosed = !1, a.userData.bundle_bone = r, this.sRender.scene.add(a), this.boneNodes[this.boneNodes.length] = a
  21724. }
  21725. }
  21726. }, c.prototype.initSkeletonHelper = function(t) {
  21727. if (!t.userData.skeleton_helper) {
  21728. var e = new n.SkeletonHelper(t);
  21729. e.visible = !1, t.userData.skeleton_helper = e, this.sRender.scene.add(e)
  21730. }
  21731. }, c.prototype.initSkeletonBox = function(t) {
  21732. if (!t.userData.skeleton_box) {
  21733. var e = t.userData.skeleton_helper,
  21734. i = new n.BoxHelper(e, 5756395);
  21735. i.visible = !1, i.geometry.computeBoundingBox(), i.userData.out_screen = !1, t.userData.skeleton_box = i, this.sRender.scene.add(i), this.initBoundingCube(i)
  21736. }
  21737. }, c.prototype.initBoundingCube = function(t) {
  21738. t.geometry.computeBoundingBox();
  21739. var e = this.HUMANMODEL.userData.box_helper_fatline;
  21740. e && (this.sRender.scene.remove(e), e.traverse((function(t) {
  21741. t.geometry && t.geometry.dispose(), t.material && t.material.dispose()
  21742. })));
  21743. var i = o.drawBoxHelperOfLine2(t, 5756395, this.sRender.renderer.domElement);
  21744. this.sRender.scene.add(i), this.HUMANMODEL.userData.box_helper_fatline = i;
  21745. var r = t.geometry.boundingBox,
  21746. a = r.getSize(new n.Vector3),
  21747. s = r.getCenter(new n.Vector3),
  21748. l = this.HUMANMODEL.userData.box_cube;
  21749. if (l) return l.geometry = new n.BoxGeometry(a.x, a.y, a.z, 2, 2, 2), void l.position.copy(s);
  21750. var u = new n.BoxGeometry(a.x, a.y, a.z, 2, 2, 2),
  21751. h = new n.MeshBasicMaterial({
  21752. color: 65280,
  21753. transparent: !0,
  21754. opacity: 0,
  21755. depthTest: !0,
  21756. depthWrite: !1
  21757. }),
  21758. c = new n.Mesh(u, h);
  21759. c.position.copy(s), this.HUMANMODEL.userData.box_cube = c, this.sRender.scene.add(c)
  21760. }, c.prototype.initFilterSphere = function(t) {
  21761. var e = this.HUMANMODEL.userData.filter_sphere;
  21762. t.geometry.computeBoundingSphere();
  21763. var i = t.geometry.boundingSphere,
  21764. r = i.center;
  21765. if (e) return e.geometry.copy(new n.SphereBufferGeometry(i.radius, 32, 32)), void e.position.copy(r);
  21766. var o = new n.SphereBufferGeometry(i.radius, 32, 32),
  21767. a = new n.MeshBasicMaterial({
  21768. color: 13421772,
  21769. transparent: !0,
  21770. opacity: .2,
  21771. depthWrite: !1
  21772. }),
  21773. s = new n.Mesh(o, a);
  21774. s.position.copy(r), s.userData.radius = i.radius, this.HUMANMODEL.userData.filter_sphere = s, this.sRender.scene.add(s)
  21775. }, c.prototype.bundleControlOfModel = function(t, e) {
  21776. if (t.userData.transform_control) return (i = t.userData.transform_control)
  21777. .setMode(e), void this.destroyBoneNodes();
  21778. var i, n = this,
  21779. r = t.userData.skeleton_box;
  21780. (i = new a(this.sRender.camera, this.sRender.renderer.domElement))
  21781. .attach(t), i.setMode(e), i.setSize(.5), this.updateControlPosition(i, r), i.addEventListener("objectChange", (function(t) {
  21782. n.modelControlChange = !0, n.needUpdateSkeletonBox = !0, n.player.emit("hidePutModelSetTools"), n.updateGroudClearance(), "translate" === this.getMode() && n.updateControlPosition(i, r)
  21783. })), i.addEventListener("mouseDown", (function(t) {
  21784. i.MOVELOCK[i.axis].state = !1
  21785. })), i.addEventListener("mouseUp", (function(e) {
  21786. if (n.modelControlChange = !1, n.updateSetToolsPosition(r), n.player.emit("showPutModelSetTools", "human"), "rotate" === this.getMode() && n.updateControlPosition(i, r), n._collision) {
  21787. var o = n.computeContainsPoint(t, n.currentColliders);
  21788. 0 < o.length && n.computeCrash_2(o)
  21789. }
  21790. })), t.userData.transform_control = i, this.sRender.scene.add(i), this.controls.push(i), this.destroyBoneNodes()
  21791. }, c.prototype.bundleControlOfBone = function(t) {
  21792. var e = this,
  21793. i = new a(this.sRender.camera, this.sRender.renderer.domElement);
  21794. i.attach(t), i.setMode("rotate"), i.setSize(.5), i.addEventListener("objectChange", (function(t) {
  21795. e.boneControlChange = !0, e.needUpdateSkeletonBox = !0, e.handleSwitchBonesNodeVisible(!0)
  21796. })), i.addEventListener("mouseDown", (function(t) {
  21797. i.MOVELOCK[i.axis].state = !1
  21798. })), i.addEventListener("mouseUp", (function(t) {
  21799. e.boneControlChange = !1
  21800. })), t.userData.transform_control = i, this.sRender.scene.add(i), this.controls.push(i)
  21801. }, c.prototype.bundleControlOfTranslate = function() {
  21802. this.HUMANMODEL && this.bundleControlOfModel(this.HUMANMODEL, "translate")
  21803. }, c.prototype.bundleControlOfRotate = function() {
  21804. this.HUMANMODEL && this.bundleControlOfModel(this.HUMANMODEL, "rotate")
  21805. }, c.prototype.onHandleControlPanoramaMove = function() {
  21806. this._canbeChoosed = !1, this.INTERSECTS_SKIN && (this.INTERSECTS_SKIN = null), this.HUMANMODEL && !this.HUMANMODEL.userData.follow_mouse && this.player.emit("hidePutModelSetTools"), this.pickedObject && !this.pickedObject.parent.userData.handle_choosed && this.MouseStateEngine.mouseMoveIn.state && this.updateLabelPosition(this.pickedObject.parent)
  21807. }, c.prototype.onHandleControlTtagsMove = function() {
  21808. this.player.emit("hide-virtual-human-info"), this.HUMANMODEL && !this.HUMANMODEL.userData.follow_mouse && this.player.emit("hidePutModelSetTools")
  21809. }, c.prototype.onHandleControlPanoramaMoveStop = function() {
  21810. if (this.HUMANMODEL && !this.HUMANMODEL.userData.follow_mouse) {
  21811. var t = this.HUMANMODEL.userData.skeleton_box,
  21812. e = !this.modelControlChange,
  21813. i = !this.boneControlChange,
  21814. n = !t.userData.out_screen;
  21815. e && i && n && (this.updateSetToolsPosition(t), this.player.emit("showPutModelSetTools", "human"))
  21816. }
  21817. }, c.prototype.onHandleControlDollhouseMove = function() {}, c.prototype.onHandleControlDollhouseMoveStop = function() {}, c.prototype.onFlyEnd = function() {}, c.prototype.onIntoPanorama = function() {
  21818. 0 < this.putModelsOfHuman.length && this.player.emit("showModelListPanel")
  21819. }, c.prototype.onIntoDollhouse = function() {}, c.prototype.onIntoTransitioning = function() {
  21820. this.destroyInvalidModelControl()
  21821. }, c.prototype.getOriginModelInfo = function(t) {
  21822. var e = t.userData.setting_item,
  21823. i = t.userData.skeleton_box;
  21824. i.geometry.computeBoundingBox(), e.timestamp = (new Date)
  21825. .getTime();
  21826. var r = i.geometry.boundingBox.getSize(new n.Vector3),
  21827. o = 1e3 * r.x.toFixed(3),
  21828. a = 1e3 * r.y.toFixed(3),
  21829. s = 1e3 * r.z.toFixed(3);
  21830. 0 === e.origin_size.width && 0 === e.origin_size.height && 0 === e.origin_size.depth && (e.origin_size = {
  21831. width: o,
  21832. height: a,
  21833. depth: s
  21834. }), e.size = {
  21835. width: o,
  21836. height: a,
  21837. depth: s
  21838. }, e.origin_position.copy(t.position.clone()), e.origin_rotation.copy(t.rotation.clone()), e.origin_scale.copy(t.scale.clone())
  21839. }, c.prototype.getHeadTopPosition = function(t) {
  21840. for (var e = t.userData.skeleton_helper.bones, i = ["Bip001_HeadNub", "head_end"], r = null, o = 0; o < e.length; ++o) {
  21841. var a = e[o],
  21842. s = a.name;
  21843. if (-1 !== i.indexOf(s)) {
  21844. r = a;
  21845. break
  21846. }
  21847. }
  21848. return r ? r.localToWorld(r.position.clone()
  21849. .applyMatrix4(r.matrixWorld))
  21850. .clone() : new n.Vector3
  21851. }, c.prototype.destroySkeletonBox = function(t) {
  21852. if (t.userData.skeleton_box) {
  21853. var e = t.userData.skeleton_box;
  21854. this.sRender.scene.remove(e), e.geometry.dispose(), e.material.dispose(), t.userData.skeleton_box = null
  21855. }
  21856. if (t.userData.box_helper_fatline) {
  21857. var i = t.userData.box_helper_fatline;
  21858. this.sRender.scene.remove(i), i.traverse((function(t) {
  21859. t.geometry && t.geometry.dispose(), t.material && t.material.dispose()
  21860. })), t.userData.box_helper_fatline = null
  21861. }
  21862. }, c.prototype.destroySkeletonHelper = function(t) {
  21863. if (t.userData.skeleton_helper) {
  21864. var e = t.userData.skeleton_helper;
  21865. this.sRender.scene.remove(e), e.geometry.dispose(), e.material.dispose(), t.userData.skeleton_helper = null
  21866. }
  21867. }, c.prototype.destroyBoneNodes = function() {
  21868. if (this.BONENODE) {
  21869. var t = this.BONENODE.userData.bundle_bone;
  21870. this.destroyControl(t), this.BONENODE = null
  21871. }
  21872. for (var e = 0, i = this.boneNodes.length; e < i; ++e) {
  21873. var n = this.boneNodes[e];
  21874. this.sRender.scene.remove(n), n.geometry.dispose(), n.material.dispose()
  21875. }
  21876. this.boneNodes = []
  21877. }, c.prototype.destroyControl = function(t) {
  21878. if (t.userData.transform_control) {
  21879. var e = t.userData.transform_control;
  21880. t.userData.transform_control = null, e.dispose(), e.detach(), this.sRender.scene.remove(e), this.BONENODE = null
  21881. }
  21882. }, c.prototype.destroyInvalidModelControl = function(t) {
  21883. (t = t || this.HUMANMODEL) && (this.destroySkeletonBox(t), this.destroyControl(t), t.userData.handle_choosed = !1, this.HUMANMODEL = null, this.emitter.emit("human-unchoosed"), this.INTERSECTS_SKIN && (this.INTERSECTS_SKIN = null), this.destroyBoneNodes(), this.player.emit("hidePutModelSetTools"), this.player.emit("hidePutModelInfoPanel"))
  21884. }, c.prototype.destroyModelFromScene = function(t) {
  21885. this.sRender.scene.remove(t), t.traverse((function(t) {
  21886. t.material && t.material.dispose(), t.geometry && t.geometry.dispose()
  21887. }))
  21888. }, c.prototype.destroyLabel = function(t) {
  21889. t.geometry.dispose(), t.material.dispose(), this.sRender.scene.remove(t)
  21890. }, c.prototype.handlePutModel = function(t) {
  21891. t.userData.follow_mouse = !1;
  21892. var e = t.userData.setting_item;
  21893. "" === e.current_location_id && (e.current_location_id = this.locationId), this.putModelsOfHuman.push(t), this.putModelsOfHumanKV[t.uuid] = t, this.HUMANMODEL = null, this.getOriginModelInfo(t), this.destroySkeletonBox(t), this.player.emit("addModelListItem", t.userData.setting_item), this.emitter.emit("human-put-over")
  21894. }, c.prototype.handleKeyOfEsc = function() {
  21895. if (this.HUMANMODEL && this.HUMANMODEL.userData.follow_mouse) {
  21896. var t = this.HUMANMODEL;
  21897. this.destroyInvalidModelControl(t), this.destroyModelFromScene(t), this.player.emit("deletePutModelSuccess", t.uuid), this.emitter.emit("human-put-cancel")
  21898. }
  21899. }, c.prototype.handleMouseLeftButtonDown = function() {
  21900. if (!1 !== h.canbeChoosedOfMode3D || "panorama" === this.player.mode) {
  21901. if (this._canbeChoosed = !0, 0 < this.putModelsOfHuman.length) {
  21902. if (this.HUMANMODEL && this.HUMANMODEL.userData.follow_mouse) return;
  21903. this._canbeSelect && this.handleSelectModel()
  21904. }
  21905. if (0 < this.boneNodes.length) {
  21906. if (this.HUMANMODEL && this.HUMANMODEL.userData.follow_mouse) return;
  21907. this.handleSelectBoneNode()
  21908. }
  21909. }
  21910. }, c.prototype.handleMouseLeftButtonUp = function() {
  21911. this._canbeChoosed && (this.BONENODE && this.handleChoosedBoneNode(this.BONENODE), this.INTERSECTS_SKIN && (this.player.weaponModelControls.destroyModelChoosedState(), this.player.virtualCameraFovControls.destroyModelControlState(), this.handleChoosedModel(this.INTERSECTS_SKIN.parent)))
  21912. }, c.prototype.handleMouseRightButtonDown = function() {}, c.prototype.handleMouseRightButtonUp = function() {
  21913. this.HUMANMODEL && this.HUMANMODEL.userData.follow_mouse && this.handlePutModel(this.HUMANMODEL)
  21914. }, c.prototype.handleSelectModel = function() {
  21915. this.raycaster.setFromCamera(this.mouse, this.sRender.camera);
  21916. var t = this.raycaster.intersectObjects(this.putModelsOfHuman, !0);
  21917. if (0 < t.length) {
  21918. var e = t[0],
  21919. i = e.object;
  21920. "SkinnedMesh" === e.object.type && (this.INTERSECTS_SKIN = i, this.player.disableNavigator = !0)
  21921. }
  21922. }, c.prototype.handleSelectBoneNode = function() {
  21923. this.raycaster.setFromCamera(this.mouse, this.sRender.camera);
  21924. var t = this.raycaster.intersectObjects(this.boneNodes);
  21925. if (0 < t.length) {
  21926. this.player.disableNavigator = !0;
  21927. var e = t[0];
  21928. if (this.BONENODE && this.BONENODE.uuid !== e.object.uuid) {
  21929. this.BONENODE.userData.handle_choosed = !1, this.BONENODE.material.map = l, this.BONENODE.scale.divideScalar(1.5);
  21930. var i = this.BONENODE.userData.bundle_bone;
  21931. this.destroyControl(i)
  21932. }
  21933. this.BONENODE = e.object
  21934. }
  21935. }, c.prototype.handleChoosedBoneNode = function() {
  21936. var t = this.BONENODE.userData.bundle_bone;
  21937. t.userData.transform_control || (this.BONENODE.userData.handle_choosed = !0, this.BONENODE.material.map = u, this.BONENODE.scale.multiplyScalar(1.5), this.bundleControlOfBone(t))
  21938. }, c.prototype.handleHumanModelFollowMouse = function(t, e) {
  21939. t.position.copy(e), this.emitter.emit("human-follow-mouse")
  21940. }, c.prototype.handleChoosedModel = function(t) {
  21941. if (t.visible) {
  21942. t.userData.handle_choosed = !0;
  21943. var e = t.userData.setting_item;
  21944. this._collision = e.collision, this.init(t), this.emitter.emit("human-handle-choosed")
  21945. }
  21946. }, c.prototype.handleDeleteHumanModel = function(t) {
  21947. if (this.putModelsOfHumanKV[t]) {
  21948. var e = this.putModelsOfHumanKV[t];
  21949. e.userData.handle_choosed && (this.destroyInvalidModelControl(e), this.player.emit("hidePutModelSetTools"), this.player.emit("hidePutModelInfoPanel")), this.destroyModelFromScene(e), this.putModelsOfHuman.splice(this.putModelsOfHuman.indexOf(e), 1), delete this.putModelsOfHumanKV[t], this.player.emit("deletePutModelSuccess", t), 0 === this.putModelsOfHuman.length && 0 === this.player.weaponModelControls.WEAPONS_SCENE.length && 0 === this.player.virtualCameraFovControls.putModels.length && this.player.emit("hideModelListPanel")
  21950. }
  21951. }, c.prototype.handleHideHumanModel = function(t) {
  21952. if (this.putModelsOfHumanKV[t]) {
  21953. var e = this.putModelsOfHumanKV[t],
  21954. i = e.userData.setting_item;
  21955. i.isShow = !1, e.visible = i.isShow, e.userData.handle_choosed && (this.destroyInvalidModelControl(e), this.player.emit("hidePutModelSetTools"))
  21956. }
  21957. }, c.prototype.handleShowModel = function(t) {
  21958. if (this.putModelsOfHumanKV[t]) {
  21959. var e = this.putModelsOfHumanKV[t],
  21960. i = e.userData.setting_item;
  21961. i.isShow = !0, e.visible = i.isShow
  21962. }
  21963. }, c.prototype.handleShowCurrentModel = function() {
  21964. for (var t = 0, e = this.putModelsOfHuman.length; t < e; ++t) {
  21965. var i = this.putModelsOfHuman[t];
  21966. !0 !== i.userData.is_save && (i.visible = !0)
  21967. }
  21968. }, c.prototype.handleHideCurrentModel = function() {
  21969. for (var t = 0, e = this.putModelsOfHuman.length; t < e; ++t) {
  21970. var i = this.putModelsOfHuman[t];
  21971. !0 !== i.userData.is_save && (i.visible = !1), i.userData.handle_choosed && (this.destroyInvalidModelControl(i), this.player.emit("hidePutModelSetTools"))
  21972. }
  21973. }, c.prototype.handleSwitchHumanLabelVisible = function(t, e) {
  21974. t.userData.setting_item.labelIsShow = e
  21975. }, c.prototype.handleSwitchSaveModelVisible = function(t) {
  21976. for (var e = 0, i = this.putModelsOfHuman.length; e < i; ++e) {
  21977. var n = this.putModelsOfHuman[e];
  21978. n.userData.is_save && (n.visible = t, !1 === t && n.userData.handle_choosed && (this.destroyInvalidModelControl(n), this.player.emit("hidePutModelSetTools")))
  21979. }
  21980. }, c.prototype.handleSwitchBonesNodeVisible = function(t) {
  21981. for (var e = 0, i = this.boneNodes.length; e < i; ++e) {
  21982. var n = this.boneNodes[e],
  21983. r = n.userData.bundle_bone,
  21984. o = r.localToWorld(r.position.clone()
  21985. .applyMatrix4(r.matrixWorld));
  21986. n.position.copy(o), n.visible = t
  21987. }
  21988. }, c.prototype.handleMouseMoveInVirtualHuman = function(t) {
  21989. document.body.style.cursor = "pointer", this.emitter.emit("human-mouse-in");
  21990. var e = t.parent,
  21991. i = e.userData.setting_item,
  21992. n = this.getHeadTopPosition(e);
  21993. i.headTop_center_position = n, i.headTop_center_screen_position = r.convertWorldPositionToScreen(n, this.sRender.camera), this.player.emit("show-virtual-human-info", i)
  21994. }, c.prototype.handleMouseMoveOutVirtualHuman = function() {
  21995. document.body.style.cursor = "", this.emitter.emit("human-mouse-out"), this.player.emit("hide-virtual-human-info")
  21996. }, c.prototype.handleMouseMove = function() {
  21997. if (this.mouse.copy(this.player.mouse), this.HUMANMODEL && this.HUMANMODEL.userData.follow_mouse && (this.handleHumanModelFollowMouse(this.HUMANMODEL, this.player.intersect.point), this.needUpdateSkeletonBox = !0), 0 < this.putModelsOfHuman.length) {
  21998. var t = this.putModelsOfHuman.filter((function(t) {
  21999. return !1 === t.userData.handle_choosed
  22000. }));
  22001. 0 < t.length && this.handlePickupVirtualHuman(t)
  22002. }
  22003. }, c.prototype.handlePickupVirtualHuman = function(t) {
  22004. this.raycaster.setFromCamera(this.mouse, this.sRender.camera);
  22005. var e = this.raycaster.intersectObjects(t, !0);
  22006. if (0 < e.length) {
  22007. var i = e[0].object;
  22008. "SkinnedMesh" === i.type ? (this.pickedObject = i, this.MouseStateEngine.mouseMoveIn.state = !0, this.MouseStateEngine.mouseMoveIn.callback(i)) : this.MouseStateEngineTranstion.mouseMoveIn.mouseMoveOut()
  22009. } else this.MouseStateEngineTranstion.mouseMoveIn.mouseMoveOut()
  22010. }, c.prototype.handleComplete = function() {
  22011. this.destroyInvalidModelControl()
  22012. }, c.prototype.restoreOriginPose = function(t) {
  22013. var e = t.userData.bones,
  22014. i = t.userData.setting_item;
  22015. for (var r in e) {
  22016. var o = e[r],
  22017. a = o.userData.rotation_default,
  22018. s = new n.Euler(a.x, a.y, a.z, "XYZ"),
  22019. l = new n.Quaternion;
  22020. l.setFromEuler(s), o.quaternion.copy(l.clone())
  22021. }
  22022. var u = i.origin_rotation,
  22023. h = new n.Euler(u.x, u.y, u.z, "XYZ"),
  22024. c = new n.Quaternion;
  22025. c.setFromEuler(h), t.quaternion.copy(c.clone())
  22026. }, c.prototype.restoreOriginSetting = function() {
  22027. if (this.HUMANMODEL) {
  22028. var t = this,
  22029. e = this.HUMANMODEL,
  22030. i = e.userData.setting_item,
  22031. n = e.userData.skeleton_box,
  22032. r = e.userData.transform_control;
  22033. if (e.position.y = i.origin_position.y, i.ground_clearance = 0, e.scale.copy(i.origin_scale), i.size.width = i.origin_size.width, i.size.height = i.origin_size.height, i.size.depth = i.origin_size.depth, this.updateSkinColor({
  22034. hex: i.origin_skin_color
  22035. }), this.restoreOriginPose(e), r) var o = setTimeout((function() {
  22036. t.needUpdateSkeletonBox = !0, t.updateControlPosition(r, n), t.updateSetToolsPosition(n), clearTimeout(o)
  22037. }), 100);
  22038. this.player.emit("resetPutModelInfo", i)
  22039. }
  22040. }, c.prototype.computeContainsPoint = function(t, e) {
  22041. for (var i = t.userData.skeleton_box, n = (t.userData.box_cube.geometry.vertices, i.geometry.boundingSphere.center), r = [], o = 0, a = e.length; o < a; ++o) {
  22042. var s = e[o];
  22043. s.geometry.boundingBox.containsPoint(n) && r.push(s)
  22044. }
  22045. return r
  22046. };
  22047. var d = null,
  22048. p = null,
  22049. f = null;
  22050. c.prototype.computeCrash_2 = function(t) {
  22051. var e = this,
  22052. i = this.HUMANMODEL,
  22053. o = i.userData.transform_control;
  22054. i.userData.box_cube;
  22055. i.userData.skeleton_box && function a(s) {
  22056. var l = i.userData.skeleton_box,
  22057. u = r.getVerticesOfItemSize(l.geometry);
  22058. l.geometry.computeBoundingBox();
  22059. for (var h = l.geometry.boundingBox.getCenter(new n.Vector3), c = new n.Vector3, m = 0, g = 0; g < u.length; ++g) {
  22060. var v = u[g].applyMatrix4(l.matrix);
  22061. c.subVectors(v, h)
  22062. .normalize();
  22063. var y = new n.Raycaster(h, c)
  22064. .intersectObjects(t);
  22065. if (0 < y.length) {
  22066. var b = y[0],
  22067. w = b.object,
  22068. x = (b.point, b.distance),
  22069. M = b.face.normal;
  22070. x < c.length() && (m = 1, o.axis && (p = o.axis, o.MOVELOCK[p].state = !0), null === d && (d = (new n.Vector3)
  22071. .subVectors(M.applyMatrix4(w.matrixWorld), w.position)
  22072. .normalize()))
  22073. }
  22074. }
  22075. 1 === m && (null === f && (f = (new Date)
  22076. .getTime()), i.position.add(d.clone()
  22077. .divideScalar(100)), e.needUpdateSkeletonBox = !0, 2e3 > (new Date)
  22078. .getTime() - f ? requestAnimationFrame(a) : (d = null, f = null, o.MOVELOCK[p].state = !1, e.updateControlPosition(o, l)));
  22079. 0 === m && p && (d = null, o.MOVELOCK[p].state = !1, e.updateControlPosition(o, l))
  22080. }()
  22081. }, c.prototype.computeHumanLabelVisible = function(t, e) {
  22082. if (0 < this.putModelsOfHuman.length)
  22083. for (var i = 0, r = this.putModelsOfHuman.length; i < r; ++i) {
  22084. var o = this.putModelsOfHuman[i].userData.setting_item,
  22085. a = o.headTop_center_position.clone(),
  22086. s = new n.Vector3;
  22087. s.subVectors(t.position, a)
  22088. .normalize(), this.raycaster2.set(a, s, 1);
  22089. var l = this.raycaster2.intersectObjects(e);
  22090. if (0 < l.length) l[0].distance < a.distanceTo(t.position) ? o.labelBlockView = !0 : o.labelBlockView = !1;
  22091. else o.labelBlockView = !1
  22092. }
  22093. }, c.prototype.updateControlOfMode = function(t) {
  22094. if (this.HUMANMODEL) {
  22095. var e = this.HUMANMODEL.userData.transform_control;
  22096. e ? e.setMode(t) : this.bundleControlOfModel(this.HUMANMODEL, t)
  22097. }
  22098. }, c.prototype.updateSkeletonBox = function(t) {
  22099. var e = t.userData.skeleton_box,
  22100. i = t.userData.setting_item;
  22101. e.update(), e.geometry.computeBoundingBox();
  22102. var n = this.getHeadTopPosition(t);
  22103. i.headTop_center_position = n, i.headTop_center_screen_position = r.convertWorldPositionToScreen(n, this.sRender.camera), this.initBoundingCube(e)
  22104. }, c.prototype.updateControls = function() {
  22105. for (var t = 0; t < this.controls.length; ++t) this.controls[t].update()
  22106. }, c.prototype.updateBoneNodesDirection = function() {
  22107. for (var t = 0; t < this.boneNodes.length; ++t) this.boneNodes[t].lookAt(this.sRender.camera.position)
  22108. }, c.prototype.updateControlPosition = function(t, e) {
  22109. e.geometry.computeBoundingBox();
  22110. var i = e.geometry.boundingBox,
  22111. r = i.getCenter(new n.Vector3),
  22112. o = i.getSize(new n.Vector3),
  22113. a = new n.Vector3(r.x, r.y - .5 * o.y, r.z);
  22114. t.currentWorldPosition.copy(a)
  22115. }, c.prototype.updateSkinColor = function(t) {
  22116. var e = this.HUMANMODEL;
  22117. e.traverse((function(e) {
  22118. "SkinnedMesh" === e.type && e.material.color.setHex(t.hex)
  22119. })), e.userData.setting_item.skin_color = t.hex
  22120. }, c.prototype.updateModelName = function(t) {
  22121. this.HUMANMODEL && (this.HUMANMODEL.userData.setting_item.modelName = t)
  22122. }, c.prototype.updateSetToolsPosition = function(t) {
  22123. t.geometry.computeBoundingBox();
  22124. for (var e = r.getVerticesOfItemSize(t.geometry), i = {}, n = {}, o = [], a = [], s = 0; s < e.length; ++s) {
  22125. var l = e[s].clone();
  22126. if (!r.computeWorldPositionOutCamera(l, this.sRender.camera)) {
  22127. var u = r.convertWorldPositionToScreen(l, this.sRender.camera);
  22128. o.push(u.x), a.push(u.y), i["k_" + u.x] = u, n["k_" + u.y] = u
  22129. }
  22130. }
  22131. var h = i["k_" + Math.max.apply(null, o)];
  22132. this.player.emit("setPutModelToolsPosition", h)
  22133. }, c.prototype.updateGroudClearance = function() {
  22134. if (this.HUMANMODEL) {
  22135. var t = this.HUMANMODEL,
  22136. e = t.userData.setting_item,
  22137. i = e.origin_position,
  22138. n = 100 * (t.position.clone()
  22139. .y - i.y);
  22140. e.ground_clearance = n, this.player.emit("resetPutModelInfo", e)
  22141. }
  22142. }, c.prototype.updateModelGroundClearance = function(t) {
  22143. if (this.HUMANMODEL) {
  22144. var e = this.HUMANMODEL,
  22145. i = e.userData.setting_item;
  22146. e.position.y = i.origin_position.y + .01 * t, i.ground_clearance = t;
  22147. var n = e.userData.transform_control,
  22148. r = e.userData.skeleton_box;
  22149. this.needUpdateSkeletonBox = !0, this.updateSetToolsPosition(r), n && this.updateControlPosition(n, r)
  22150. }
  22151. }, c.prototype.updateSize = function(t) {
  22152. if (this.HUMANMODEL) {
  22153. var e = this.HUMANMODEL,
  22154. i = e.userData.setting_item,
  22155. n = e.userData.transform_control,
  22156. r = i.origin_size,
  22157. o = i.origin_scale,
  22158. a = o.x / r.width,
  22159. s = o.y / r.height,
  22160. l = o.z / r.depth,
  22161. u = t.width * a,
  22162. h = t.height * s,
  22163. c = t.depth * l;
  22164. e.scale.set(u, h, c), i.scale = e.scale, i.size = {
  22165. width: u * r.width,
  22166. height: h * r.height,
  22167. depth: c * r.depth
  22168. }, this.needUpdateSkeletonBox = !0;
  22169. var d = e.userData.skeleton_box;
  22170. this.updateSetToolsPosition(d), n && this.updateControlPosition(n, d)
  22171. }
  22172. }, c.prototype.updateSetToolsAndControlPosition = function() {
  22173. if (this.HUMANMODEL) {
  22174. var t = this.HUMANMODEL,
  22175. e = t.userData.skeleton_box,
  22176. i = t.userData.transform_control;
  22177. this.updateSetToolsPosition(e), this.player.emit("showPutModelSetTools", "human"), i && e && this.updateControlPosition(i, e)
  22178. }
  22179. }, c.prototype.updateBoxHelperIsOutScrren = function(t) {
  22180. if ("panorama" === this.player.mode) {
  22181. for (var e = r.getVerticesOfItemSize(t.geometry), i = {}, n = 0, o = e.length; n < o; ++n) {
  22182. var a = e[n],
  22183. s = a.applyMatrix4(this.sRender.camera.matrixWorldInverse)
  22184. .applyMatrix4(this.sRender.camera.projectionMatrix),
  22185. l = Math.abs(s.x) > 1,
  22186. u = Math.abs(s.y) > 1,
  22187. h = Math.abs(s.z) > 1;
  22188. (l || u || h) && (1, i["k_" + n] = a)
  22189. }
  22190. e.length === Object.keys(i)
  22191. .length ? (this.player.emit("hidePutModelSetTools"), t.userData.out_screen = !0) : t.userData.out_screen = !1
  22192. }
  22193. }, c.prototype.updateLabelPosition = function(t) {
  22194. if (t) {
  22195. var e = t.userData.setting_item,
  22196. i = this.getHeadTopPosition(t);
  22197. e.headTop_center_position = i, e.headTop_center_screen_position = r.convertWorldPositionToScreen(i, this.sRender.camera), this.player.emit("show-virtual-human-info", e)
  22198. }
  22199. }, c.prototype.updateHumanLabel = function(t) {
  22200. for (var e = 0, i = t.length; e < i; ++e) {
  22201. var n = t[e],
  22202. o = n.userData.setting_item;
  22203. o.headTop_center_screen_position = r.convertWorldPositionToScreen(o.headTop_center_position, this.sRender.camera), r.computeWorldPositionOutCamera(o.headTop_center_position, this.sRender.camera) ? o.labelIsShow = !1 : o.labelIsShow = !0, n.visible || (o.labelIsShow = !1)
  22204. }
  22205. }, c.prototype.update = function() {
  22206. if (0 < this.controls.length && this.updateControls(), this.player && (this.player.currentPano && this.player.currentPano.id && (this.locationId = this.player.currentPano.id), 0 === this.currentColliders.length && (this.currentColliders = this.player.model.floors.reduce((function(t, e) {
  22207. return e.hidden ? t : t.concat(e.collider.children)
  22208. }), []))), this.HUMANMODEL) {
  22209. var t = this.HUMANMODEL.userData;
  22210. t.handle_choosed && this.updateBoxHelperIsOutScrren(t.skeleton_box)
  22211. }
  22212. }, t.exports = c
  22213. }, function(t, e, i) {
  22214. "use strict";
  22215. var n = i(0),
  22216. r = i(13);
  22217. function o(t) {
  22218. n.Sprite.call(this), this.geometry = new n.PlaneBufferGeometry, this.init(t)
  22219. }
  22220. o.prototype = Object.create(n.Sprite.prototype), o.prototype.init = function(t) {
  22221. var e = r.initCanvasLabel(t),
  22222. i = e.texture,
  22223. o = e.canvas;
  22224. this.width = o.width, this.height = o.height, this.material = new n.ShaderMaterial({
  22225. uniforms: {
  22226. tDiffuse: {
  22227. value: i
  22228. },
  22229. width: {
  22230. value: o.width
  22231. },
  22232. height: {
  22233. value: o.height
  22234. },
  22235. domWidth: {
  22236. value: t.renderDom.width
  22237. },
  22238. domHeight: {
  22239. value: t.renderDom.height
  22240. }
  22241. },
  22242. vertexShader: ["precision highp float;", "uniform float width;", "uniform float height;", "uniform float domWidth;", "uniform float domHeight;", "varying vec2 vUv;", "void main() {", "vUv = uv;", "vec4 proj = projectionMatrix * modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0);", "gl_Position = vec4(", "proj.x / proj.w + position.x * width / domWidth * 2.0,", "proj.y / proj.w + position.y * height / domHeight * 2.0,", "proj.z / proj.w,", "1.0", ");", "}"].join("\n"),
  22243. fragmentShader: ["precision highp float;", "uniform sampler2D tDiffuse;", "uniform float width;", "uniform float height;", "varying vec2 vUv;", "void main() {", "vec2 _uv = vec2(", "(floor(vUv.s * width) + 0.5) / width,", "(floor(vUv.t * height) + 0.5) / height", ");", "gl_FragColor = texture2D( tDiffuse, _uv );", "}"].join("\n"),
  22244. transparent: !0
  22245. })
  22246. }, t.exports = o
  22247. }, function(t, e, i) {
  22248. "use strict";
  22249. var n = i(0),
  22250. r = i(9),
  22251. o = i(4)
  22252. .EventEmitter,
  22253. a = i(40)(n),
  22254. s = i(13),
  22255. l = i(41);
  22256. function u(t) {
  22257. this._canbeUsed = !1, this._canbeSelect = !0, this._canbeChoosed = !0, this.player = t, this.sRender = t.sRender, this.raycaster = new n.Raycaster, this.mouse = new n.Vector3, this.CONTROLMODEL = null, this.CURRENTMODEL = null, this.INTERSECT = null, this.WEAPONS_SCENE = [], this.ACTIVEMODEL = null, this.WEAPONS_KV = {}, this.controls = [], this._collision = !1, this.collision_d = .05, this.modelControlChange = !1, this.emitter = new o, this.defineProperty(), this.initStateEngine()
  22258. }
  22259. window.THREE = n, u.prototype.defineProperty = function() {
  22260. Object.defineProperty(this, "canbeUsed", {
  22261. get: function() {
  22262. return this._canbeUsed
  22263. },
  22264. set: function(t) {
  22265. this._canbeUsed = t
  22266. }
  22267. }), Object.defineProperty(this, "canbeSelect", {
  22268. get: function() {
  22269. return this._canbeSelect
  22270. },
  22271. set: function(t) {
  22272. this._canbeSelect = t
  22273. }
  22274. }), Object.defineProperty(this, "collision", {
  22275. get: function(t) {
  22276. return this._collision
  22277. },
  22278. set: function(t) {
  22279. this._collision = t;
  22280. var e = this.CONTROLMODEL.userData.setting_item,
  22281. i = this.CONTROLMODEL.userData.transform_control;
  22282. if (e.collision = t, i)
  22283. for (var n in i.MOVELOCK) i.MOVELOCK[n].state = !1
  22284. }
  22285. })
  22286. }, u.prototype.initStateEngine = function() {
  22287. this.MouseStateEngine = {
  22288. mouseMoveIn: {
  22289. state: !1,
  22290. callback: this.handleMouseMoveInWeapon.bind(this)
  22291. },
  22292. mouseMoveOut: {
  22293. state: !1,
  22294. callback: this.handleMouseMoveOutWeapon.bind(this)
  22295. }
  22296. }, this.MouseStateEngineTranstion = {
  22297. mouseMoveIn: {
  22298. mouseMoveOut: function() {
  22299. this.MouseStateEngine.mouseMoveIn.state && (this.MouseStateEngine.mouseMoveIn.state = !1, this.MouseStateEngine.mouseMoveOut.state = !0, this.MouseStateEngine.mouseMoveOut.callback())
  22300. }.bind(this)
  22301. }
  22302. }
  22303. }, u.prototype.initBoundingBox = function(t) {
  22304. if (!t.userData.box_helper) {
  22305. var e = new n.BoxHelper(t, 5756395);
  22306. e.visible = !1, e.geometry.computeBoundingBox();
  22307. var i = e.geometry.boundingBox.getSize(new n.Vector3);
  22308. e.userData.out_screen = !1, t.userData.box_helper = e, t.userData.box_size = i, this.sRender.scene.add(e);
  22309. var r = s.drawBoxHelperOfLine2(e, 5756395, this.sRender.renderer.domElement);
  22310. t.userData.box_helper_fatline = r, this.sRender.scene.add(r)
  22311. }
  22312. }, u.prototype.initOriginInfo = function(t) {
  22313. var e = t.userData.setting_item,
  22314. i = t.userData.box_helper;
  22315. i.geometry.computeBoundingBox(), e.timestamp = (new Date)
  22316. .getTime();
  22317. var r = i.geometry.boundingBox.getSize(new n.Vector3),
  22318. o = r.x.toFixed(3),
  22319. a = r.y.toFixed(3),
  22320. s = r.z.toFixed(3);
  22321. 0 === e.origin_size.width && 0 === e.origin_size.height && 0 === e.origin_size.depth && (e.origin_size = {
  22322. width: o,
  22323. height: a,
  22324. depth: s
  22325. }), e.size = {
  22326. width: o,
  22327. height: a,
  22328. depth: s
  22329. }, e.origin_position.copy(t.position.clone()), e.origin_rotation.copy(t.rotation.clone()), e.origin_scale.copy(t.scale.clone()), e.current_location_id = this.player.currentPano.id
  22330. };
  22331. var h = !1;
  22332. u.prototype.onHandleControlPanoramaMove = function() {
  22333. h = !1, this._canbeChoosed = !1, this.CONTROLMODEL && this.player.emit("hidePutModelSetTools"), this.INTERSECT && (this.INTERSECT = null)
  22334. }, u.prototype.onHandleControlTtagsMove = function() {
  22335. this.CONTROLMODEL && this.player.emit("hidePutModelSetTools")
  22336. }, u.prototype.onHandleControlPanoramaMoveStop = function() {
  22337. if (!h && (h = !0, this.CONTROLMODEL && !this.CONTROLMODEL.userData.follow_mouse)) {
  22338. var t = this.CONTROLMODEL.userData.box_helper;
  22339. this.modelControlChange || t.userData.out_screen || (this.updateSetToolsPosition(t), this.player.emit("showPutModelSetTools", "weapon"))
  22340. }
  22341. }, u.prototype.onIntoPanorama = function() {
  22342. 0 < this.WEAPONS_SCENE.length && this.player.emit("showModelListPanel")
  22343. }, u.prototype.onIntoTransitioning = function() {
  22344. this.destroyModelChoosedState()
  22345. }, u.prototype.handleMouseMove = function() {
  22346. if (this.mouse.copy(this.player.mouse), this.CONTROLMODEL && this.CONTROLMODEL.userData.follow_mouse && this.player.intersect && this.player.intersect.point && (this.handleModelFollowingMouse(this.CONTROLMODEL, this.player.intersect.point), this.updateBoundingBox()), 0 < this.WEAPONS_SCENE.length) {
  22347. var t = this.WEAPONS_SCENE.filter((function(t) {
  22348. return !1 === t.userData.handle_choosed
  22349. }));
  22350. 0 < t.length && this.handlePickupWeapon(t)
  22351. }
  22352. }, u.prototype.handleMouseLeftButtonDown = function() {
  22353. if ((!1 !== l.canbeChoosedOfMode3D || "panorama" === this.player.mode) && (this._canbeChoosed = !0, 0 < this.WEAPONS_SCENE.length)) {
  22354. if (this.CONTROLMODEL && this.CONTROLMODEL.userData.follow_mouse) return;
  22355. this._canbeSelect && this.handleSelectModel()
  22356. }
  22357. }, u.prototype.handleMouseLeftButtonUp = function() {
  22358. this._canbeChoosed && this.INTERSECT && (this.player.humanModelControls.destroyInvalidModelControl(), this.player.virtualCameraFovControls.destroyModelControlState(), (this.INTERSECT.name = "probeModel") ? this.handleChooseModel(this.INTERSECT.parent) : this.handleChooseModel(this.INTERSECT.parent.parent.parent), this.INTERSECT = null)
  22359. }, u.prototype.handleMouseRightButtonDown = function() {}, u.prototype.handleMouseRightButtonUp = function() {
  22360. this.CONTROLMODEL && this.CONTROLMODEL.userData.follow_mouse && this.handlePutModel(this.CONTROLMODEL)
  22361. }, u.prototype.handleModelFollowingMouse = function(t, e) {
  22362. var i = t.userData.box_size,
  22363. r = (new n.Vector3)
  22364. .copy(e.clone());
  22365. r.y += i.y, t.position.copy(r), this.emitter.emit("weapon-follow-mouse")
  22366. }, u.prototype.handlePutModel = function(t) {
  22367. t.userData.follow_mouse = !1, this.WEAPONS_SCENE.push(t), this.WEAPONS_KV[t.uuid] = t, this.initOriginInfo(t), this.destroyBoundingBox(t), this.player.emit("addModelListItem", t.userData.setting_item), this.CONTROLMODEL = null, this.emitter.emit("weapon-put-over")
  22368. }, u.prototype.handleSelectModel = function() {
  22369. this.raycaster.setFromCamera(this.mouse, this.sRender.camera);
  22370. var t = this.raycaster.intersectObjects(this.WEAPONS_SCENE, !0);
  22371. if (0 < t.length) {
  22372. var e = t[0].object;
  22373. this.INTERSECT = e, this.player.disableNavigator = !0
  22374. }
  22375. }, u.prototype.handleChooseModel = function(t) {
  22376. if (t.visible && (this.CONTROLMODEL && t.uuid !== this.CONTROLMODEL.uuid && this.destroyModelChoosedState(), !this.CONTROLMODEL || t.uuid !== this.CONTROLMODEL.uuid)) {
  22377. this.CURRENTMODEL = t, document.body.style.cursor = "", t.userData.handle_choosed = !0, this.CONTROLMODEL = t, this.initBoundingBox(t), this.bundleControlOfTranslate();
  22378. var e = t.userData.box_helper;
  22379. this.updateSetToolsPosition(e), this.player.emit("showPutModelSetTools", "weapon"), this.player.emit("choosed-weapon", t.userData.setting_item), this.emitter.emit("weapon-handle-choosed")
  22380. }
  22381. }, u.prototype.handleKeyOfEsc = function() {
  22382. if (this.CONTROLMODEL && this.CONTROLMODEL.userData.follow_mouse) {
  22383. var t = this.CONTROLMODEL;
  22384. this.destroyModelChoosedState(t), this.destroyModelFromScene(t), this.emitter.emit("weapon-put-cancel")
  22385. }
  22386. }, u.prototype.handleDeleteModel = function(t) {
  22387. if (this.WEAPONS_KV[t]) {
  22388. var e = this.WEAPONS_KV[t];
  22389. e.userData.handle_choosed && (this.destroyModelChoosedState(e), this.player.emit("hidePutModelSetTools"), this.player.emit("hidePutModelInfoPanel")), this.destroyModelFromScene(e), this.WEAPONS_SCENE.splice(this.WEAPONS_SCENE.indexOf(e), 1), delete this.WEAPONS_KV[t], this.player.emit("deletePutModelSuccess", t), 0 === this.WEAPONS_SCENE.length && 0 === this.player.humanModelControls.putModelsOfHuman.length && 0 === this.player.virtualCameraFovControls.putModels.length && this.player.emit("hideModelListPanel")
  22390. }
  22391. }, u.prototype.handleShowModel = function(t) {
  22392. if (this.WEAPONS_KV[t]) {
  22393. var e = this.WEAPONS_KV[t],
  22394. i = e.userData.setting_item;
  22395. i.isShow = !0, e.visible = i.isShow
  22396. }
  22397. }, u.prototype.handleHideModel = function(t) {
  22398. if (this.WEAPONS_KV[t]) {
  22399. var e = this.WEAPONS_KV[t],
  22400. i = e.userData.setting_item;
  22401. i.isShow = !1, e.visible = i.isShow, e.userData.handle_choosed && (this.destroyModelChoosedState(e), this.player.emit("hidePutModelSetTools"))
  22402. }
  22403. }, u.prototype.handleShowCurrentModel = function() {
  22404. for (var t = 0, e = this.WEAPONS_SCENE.length; t < e; ++t) {
  22405. var i = this.WEAPONS_SCENE[t];
  22406. !0 !== i.userData.is_save && (i.visible = !0)
  22407. }
  22408. }, u.prototype.handleHideCurrentModel = function() {
  22409. for (var t = 0, e = this.WEAPONS_SCENE.length; t < e; ++t) {
  22410. var i = this.WEAPONS_SCENE[t];
  22411. !0 !== i.userData.is_save && (i.visible = !1), i.userData.handle_choosed && (this.destroyModelChoosedState(i), this.player.emit("hidePutModelSetTools"))
  22412. }
  22413. }, u.prototype.handleSwitchSaveModelVisible = function(t) {
  22414. for (var e = 0, i = this.WEAPONS_SCENE.length; e < i; ++e) {
  22415. var n = this.WEAPONS_SCENE[e];
  22416. n.userData.is_save && (n.visible = t, !1 === t && n.userData.handle_choosed && (this.destroyModelChoosedState(n), this.player.emit("hidePutModelSetTools")))
  22417. }
  22418. }, u.prototype.handleHideAllModel = function() {
  22419. for (var t = 0, e = this.WEAPONS_SCENE.length; t < e; ++t) {
  22420. var i = this.WEAPONS_SCENE[t];
  22421. i.visible = !1, i.userData.handle_choosed && (this.destroyModelChoosedState(i), this.player.emit("hidePutModelSetTools"))
  22422. }
  22423. }, u.prototype.handleComplete = function() {
  22424. if (this.destroyModelChoosedState(), this.CURRENTMODEL) {
  22425. var t = this.CURRENTMODEL.getWorldPosition(),
  22426. e = this.CURRENTMODEL.getWorldQuaternion();
  22427. this.player.emit("putProbeModelComplete", {
  22428. worldPosition: t,
  22429. worldQuaternion: e
  22430. })
  22431. }
  22432. }, u.prototype.handlePickupWeapon = function(t) {
  22433. this.raycaster.setFromCamera(this.mouse, this.sRender.camera);
  22434. var e = this.raycaster.intersectObjects(t, !0);
  22435. if (0 < e.length) {
  22436. var i = e[0].object;
  22437. this.MouseStateEngine.mouseMoveIn.state = !0, this.MouseStateEngine.mouseMoveIn.callback(i)
  22438. } else this.MouseStateEngineTranstion.mouseMoveIn.mouseMoveOut()
  22439. }, u.prototype.handleMouseMoveInWeapon = function(t) {
  22440. document.body.style.cursor = "pointer", this.sRender.outlinePass.selectedObjects = [t.parent]
  22441. }, u.prototype.handleMouseMoveOutWeapon = function() {
  22442. document.body.style.cursor = "", this.sRender.outlinePass.selectedObjects = []
  22443. }, u.prototype.bundleControlOfTranslate = function() {
  22444. this.CONTROLMODEL && this.bundleControlOfModel(this.CONTROLMODEL, "translate")
  22445. }, u.prototype.bundleControlOfRotate = function() {
  22446. this.CONTROLMODEL && this.bundleControlOfModel(this.CONTROLMODEL, "rotate")
  22447. }, u.prototype.bundleControlOfModel = function(t, e) {
  22448. if (t.userData.transform_control) {
  22449. (n = t.userData.transform_control)
  22450. .setMode(e)
  22451. } else {
  22452. var i = this,
  22453. n = new a(this.sRender.camera, this.sRender.renderer.domElement),
  22454. r = t.userData.box_helper;
  22455. this.updateControlPosition(n, r), n.attach(t), n.setMode(e), n.setSize(.5), n.addEventListener("objectChange", (function(e) {
  22456. i.modelControlChange = !0, i.player.emit("hidePutModelSetTools"), i.updateGroudClearance(), i.updateBoundingBox(), "translate" === n.getMode() && i.updateControlPosition(n, r), i._collision && i.computeCrash_2(t)
  22457. })), n.addEventListener("mouseUp", (function(t) {
  22458. i.modelControlChange = !1, "rotate" === n.getMode() && i.updateControlPosition(n, r), i.updateSetToolsPosition(r), i.player.emit("showPutModelSetTools", "weapon")
  22459. })), n.addEventListener("mouseDown", (function(t) {
  22460. n.MOVELOCK[n.axis].state = !1
  22461. })), t.userData.transform_control = n, this.controls.push(n), this.sRender.scene.add(n)
  22462. }
  22463. }, u.prototype.bundleControlOfTranslate = function() {
  22464. this.CONTROLMODEL && this.bundleControlOfModel(this.CONTROLMODEL, "translate")
  22465. }, u.prototype.bundleControlOfRotate = function() {
  22466. this.CONTROLMODEL && this.bundleControlOfModel(this.CONTROLMODEL, "rotate")
  22467. }, u.prototype.destroyBoundingBox = function(t) {
  22468. if (t.userData.box_helper) {
  22469. var e = t.userData.box_helper;
  22470. t.userData.box_helper = null, e.geometry.dispose(), e.material.dispose(), this.sRender.scene.remove(e)
  22471. }
  22472. if (t.userData.box_helper_fatline) {
  22473. var i = t.userData.box_helper_fatline;
  22474. this.sRender.scene.remove(i), i.traverse((function(t) {
  22475. t.geometry && t.geometry.dispose(), t.material && t.material.dispose()
  22476. })), t.userData.box_helper_fatline = null
  22477. }
  22478. }, u.prototype.destroyModelChoosedState = function(t) {
  22479. (t = t || this.CONTROLMODEL) && (this.destroyControl(this.CONTROLMODEL), this.destroyBoundingBox(this.CONTROLMODEL), this.CONTROLMODEL = null, this.emitter.emit("weapon-unchoosed"), this.player.emit("hidePutModelSetTools"), this.player.emit("hidePutModelInfoPanel"))
  22480. }, u.prototype.destroyControl = function(t) {
  22481. if (t.userData.transform_control) {
  22482. var e = t.userData.transform_control;
  22483. e.dispose(), e.detach(), this.sRender.scene.remove(e), t.userData.handle_choosed = !1, t.userData.transform_control = null
  22484. }
  22485. }, u.prototype.destroyModelFromScene = function(t) {
  22486. this.sRender.scene.remove(t), t.traverse((function(t) {
  22487. t.material && t.material.dispose(), t.geometry && t.geometry.dispose()
  22488. }))
  22489. }, u.prototype.restoreOriginSetting = function() {
  22490. if (this.CONTROLMODEL) {
  22491. var t = this,
  22492. e = this.CONTROLMODEL,
  22493. i = e.userData.setting_item,
  22494. n = e.userData.box_helper,
  22495. r = e.userData.transform_control;
  22496. e.position.y = i.origin_position.y, i.ground_clearance = 0;
  22497. var o = i.origin_rotation;
  22498. if (e.rotation.copy(o), e.scale.copy(i.origin_scale), i.size.width = i.origin_size.width, i.size.height = i.origin_size.height, i.size.depth = i.origin_size.depth, this.updateModelColor({
  22499. hex: i.origin_skin_color
  22500. }), r) var a = setTimeout((function() {
  22501. t.updateBoundingBox(), t.updateControlPosition(r, n), t.updateSetToolsPosition(n), clearTimeout(a)
  22502. }), 100);
  22503. this.player.emit("resetPutModelInfo", i)
  22504. }
  22505. }, u.prototype.computeCrash_2 = function(t) {
  22506. if (t.userData.box_helper) {
  22507. var e = t.userData.transform_control,
  22508. i = t.userData.box_helper,
  22509. o = i.geometry;
  22510. o.computeBoundingBox();
  22511. for (var a = o.boundingBox, s = r.getVerticesOfItemSize(o), l = a.getCenter(new n.Vector3), u = 0; u < s.length; ++u) {
  22512. s[u].userData = {}, s[u].userData.name = "v_" + u;
  22513. var h = s[u].clone()
  22514. .applyMatrix4(i.matrix)
  22515. .sub(l),
  22516. c = new n.Raycaster(l, h)
  22517. .intersectObjects(this.player.model.colliders);
  22518. if (0 < c.length) {
  22519. var d = c[0],
  22520. p = d.object,
  22521. f = d.face,
  22522. m = (d.point, d.distance);
  22523. f.normal.applyMatrix4(p.matrixWorld)
  22524. .sub(p.position)
  22525. .normalize();
  22526. h.length() + this.collision_d >= m && (e.MOVELOCK[e.axis].state = !0)
  22527. }
  22528. }
  22529. }
  22530. }, u.prototype.updateBoundingBox = function(t) {
  22531. if ((t = t || this.CONTROLMODEL)
  22532. .userData.box_helper) {
  22533. var e = t.userData.box_helper;
  22534. e.update();
  22535. var i = t.userData.box_helper_fatline;
  22536. i && (this.sRender.scene.remove(i), i.traverse((function(t) {
  22537. t.geometry && t.geometry.dispose(), t.material && t.material.dispose()
  22538. })));
  22539. var n = s.drawBoxHelperOfLine2(e, 5756395, this.sRender.renderer.domElement);
  22540. t.userData.box_helper_fatline = n, this.sRender.scene.add(n)
  22541. }
  22542. }, u.prototype.updateControlPosition = function(t, e) {
  22543. e.geometry.computeBoundingBox();
  22544. var i = e.geometry.boundingBox,
  22545. r = i.getCenter(new n.Vector3),
  22546. o = i.getSize(new n.Vector3),
  22547. a = new n.Vector3(r.x, r.y - .5 * o.y, r.z);
  22548. t.currentWorldPosition.copy(a)
  22549. }, u.prototype.updateSetToolsPosition = function(t) {
  22550. t.geometry.computeBoundingBox();
  22551. for (var e = r.getVerticesOfItemSize(t.geometry), i = {}, n = {}, o = [], a = [], s = 0; s < e.length; ++s) {
  22552. var l = e[s].clone();
  22553. if (!r.computeWorldPositionOutCamera(l, this.sRender.camera)) {
  22554. var u = r.convertWorldPositionToScreen(l, this.sRender.camera);
  22555. o.push(u.x), a.push(u.y), i["k_" + u.x] = u, n["k_" + u.y] = u
  22556. }
  22557. }
  22558. var h = i["k_" + Math.max.apply(null, o)];
  22559. this.player.emit("setPutModelToolsPosition", h)
  22560. }, u.prototype.updateModelColor = function(t) {
  22561. this.CONTROLMODEL.traverse((function(e) {
  22562. "Mesh" === e.type && e.material.color.setHex(t.hex)
  22563. })), this.CONTROLMODEL.userData.setting_item.skin_color = t.hex
  22564. }, u.prototype.updateSize = function(t) {
  22565. if (this.CONTROLMODEL) {
  22566. var e = this.CONTROLMODEL,
  22567. i = e.userData.setting_item,
  22568. n = i.origin_size,
  22569. r = i.origin_scale,
  22570. o = r.x / n.width,
  22571. a = r.y / n.height,
  22572. s = r.z / n.depth,
  22573. l = t.width * o,
  22574. u = t.height * a,
  22575. h = t.depth * s;
  22576. e.scale.set(l, u, h), i.scale = e.scale, i.size = {
  22577. width: l * n.width,
  22578. height: u * n.height,
  22579. depth: h * n.depth
  22580. }, this.updateBoundingBox()
  22581. }
  22582. }, u.prototype.updateGroudClearance = function() {
  22583. if (this.CONTROLMODEL) {
  22584. var t = this.CONTROLMODEL,
  22585. e = t.userData.setting_item,
  22586. i = e.origin_position,
  22587. n = t.position.clone()
  22588. .y - i.y;
  22589. e.ground_clearance = n, this.player.emit("resetPutModelInfo", e)
  22590. }
  22591. }, u.prototype.updateModelGroundClearance = function(t) {
  22592. if (this.CONTROLMODEL) {
  22593. var e = this.CONTROLMODEL,
  22594. i = e.userData.setting_item;
  22595. e.position.y = i.origin_position.y + .01 * t, i.ground_clearance = t;
  22596. var n = e.userData.transform_control,
  22597. r = e.userData.box_helper;
  22598. this.updateBoundingBox(), this.updateSetToolsPosition(r), n && this.updateControlPosition(n, r)
  22599. }
  22600. }, u.prototype.updateSetToolsAndControlPosition = function() {
  22601. if (this.CONTROLMODEL) {
  22602. var t = this.CONTROLMODEL,
  22603. e = t.userData.box_helper,
  22604. i = t.userData.transform_control;
  22605. this.updateSetToolsPosition(e), i && e && this.updateControlPosition(i, e), this.player.emit("showPutModelSetTools", "weapon")
  22606. }
  22607. }, u.prototype.updateBoxHelperIsOutScrren = function(t) {
  22608. if ("panorama" === this.player.mode) {
  22609. for (var e = r.getVerticesOfItemSize(t.geometry), i = {}, n = 0, o = e.length; n < o; ++n) {
  22610. var a = e[n],
  22611. s = a.applyMatrix4(this.sRender.camera.matrixWorldInverse)
  22612. .applyMatrix4(this.sRender.camera.projectionMatrix),
  22613. l = Math.abs(s.x) > 1,
  22614. u = Math.abs(s.y) > 1,
  22615. h = Math.abs(s.z) > 1;
  22616. (l || u || h) && (1, i["k_" + n] = a)
  22617. }
  22618. e.length === Object.keys(i)
  22619. .length ? (this.player.emit("hidePutModelSetTools"), t.userData.out_screen = !0) : t.userData.out_screen = !1
  22620. }
  22621. }, u.prototype.updateModelName = function(t) {
  22622. this.CONTROLMODEL && (this.CONTROLMODEL.userData.setting_item.modelName = t)
  22623. }, u.prototype.updateControls = function() {
  22624. if (0 < this.controls.length)
  22625. for (var t = 0; t < this.controls.length; ++t) this.controls[t].update()
  22626. }, u.prototype.update = function() {
  22627. if (this.updateControls(), this.CONTROLMODEL) {
  22628. var t = this.CONTROLMODEL.userData;
  22629. t.handle_choosed && this.updateBoxHelperIsOutScrren(t.box_helper)
  22630. }
  22631. }, t.exports = u
  22632. }, function(t, e, i) {
  22633. "use strict";
  22634. var n = i(0),
  22635. r = i(9),
  22636. o = (i(13), i(3), i(4)
  22637. .EventEmitter),
  22638. a = i(138)(n),
  22639. s = (new n.TextureLoader)
  22640. .load("./images/texture/location/location_red_512x512.png");
  22641. function l(t) {
  22642. this._canbeUsed = !1, this._canbeSelect = !1, this.player = t, this.sRender = t.sRender, this.locationId = null, this.raycaster = new n.Raycaster, this.mouse = new n.Vector3, this.POSTIL = null, this.controls = [], this.PostilOfScene = [], this.PostilOfKV = {}, this.hideAll = !1, this.defineProperty(), this.emitter = new o
  22643. }
  22644. l.prototype.defineProperty = function() {
  22645. Object.defineProperty(this, "canbeUsed", {
  22646. get: function() {
  22647. return this._canbeUsed
  22648. },
  22649. set: function(t) {
  22650. this._canbeUsed = t
  22651. }
  22652. }), Object.defineProperty(this, "canbeSelect", {
  22653. get: function() {
  22654. return this._canbeSelect
  22655. },
  22656. set: function(t) {
  22657. this._canbeSelect = t
  22658. }
  22659. })
  22660. }, l.prototype.initBox = function() {
  22661. if (!this.POSTIL.userData.box_line) {
  22662. this.POSTIL.geometry.computeBoundingBox();
  22663. var t = this.POSTIL.geometry.boundingBox.getSize(new n.Vector3),
  22664. e = new n.PlaneBufferGeometry(t.x, t.y),
  22665. i = new n.EdgesGeometry(e),
  22666. r = new n.LineSegments(i, new n.LineBasicMaterial({
  22667. color: 65280
  22668. }));
  22669. this.POSTIL.userData.box_line = r, this.POSTIL.add(r)
  22670. }
  22671. }, l.prototype.onIntoPanorama = function() {
  22672. this.destroyPostilChoosedState()
  22673. }, l.prototype.handleMouseLeftButtonDown = function() {
  22674. if ("panorama" === this.player.mode && 0 < this.PostilOfScene.length) {
  22675. if (this.POSTIL && this.POSTIL.userData.follow_mouse) return;
  22676. this._canbeSelect && this.handleSelectPostil()
  22677. }
  22678. }, l.prototype.handleMouseLeftButtonUp = function() {
  22679. "panorama" === this.player.mode && this.POSTIL && !this.POSTIL.userData.follow_mouse && this.handleChoosedPostil(this.POSTIL)
  22680. }, l.prototype.handleMouseRightButtonDown = function() {}, l.prototype.handleMouseRightButtonUp = function() {
  22681. "panorama" === this.player.mode && this.POSTIL && this.POSTIL.userData.follow_mouse && (this.handlePutPostil(this.POSTIL), this.POSTIL = null)
  22682. }, l.prototype.handleMouseMove = function() {
  22683. !this.player || this.player && "panorama" !== this.player.mode || (this.mouse.copy(this.player.mouse), "panorama" === this.player.mode && this.POSTIL && this.POSTIL.userData.follow_mouse && 0 < this.player.model.colliders.length && this.handlePostilFollowingMouse2(this.POSTIL, this.player.intersect))
  22684. }, l.prototype.handlePutPostil = function(t) {
  22685. var e = this;
  22686. t.userData.follow_mouse = !1;
  22687. var i = this.player.panoMarkers.filter((function(t) {
  22688. return e.locationId === t.pano.id
  22689. }))[0];
  22690. t.userData.marker = i, this.PostilOfScene.push(t), this.PostilOfKV[t.uuid] = t, this.destroyPositionLine(t), this.updateSettingItem(t), this.updateMarkerTexture(t), t.userData.marker = i;
  22691. var r = new n.BoxHelper(t);
  22692. this.sRender.scene.add(r), r.visible = !1, t.userData.box_helper = r, this.player.emit("add-postil-item", t.userData.setting_item), this.emitter.emit("postil-put-over")
  22693. }, l.prototype.handleKeyOfEsc = function() {
  22694. this.POSTIL && this.POSTIL.userData.follow_mouse && (this.destroyPositionLine(), this.sRender.scene.remove(this.POSTIL), this.POSTIL.geometry.dispose(), this.POSTIL.material.dispose(), this.POSTIL = null, this.emitter.emit("postil-put-cancel"))
  22695. }, l.prototype.handleModelFollowingMouse = function(t, e) {
  22696. this.raycaster.setFromCamera(this.mouse, this.sRender.camera);
  22697. var i = this.raycaster.intersectObjects(e);
  22698. if (0 < i.length) {
  22699. var n = i[0];
  22700. if (n.face) {
  22701. var r = n.face.normal.applyMatrix4(n.object.matrixWorld)
  22702. .sub(n.object.position)
  22703. .normalize();
  22704. t.position.set(0, 0, 0), t.lookAt(r), t.position.copy(n.point)
  22705. }
  22706. }
  22707. }, l.prototype.handlePostilFollowingMouse2 = function(t, e) {
  22708. if (e.face) {
  22709. var i = e.point,
  22710. n = e.face.normal.applyMatrix4(e.object.matrixWorld)
  22711. .sub(e.object.position)
  22712. .normalize(),
  22713. r = i.clone();
  22714. t.position.copy(r.add(n.divideScalar(6))
  22715. .clone()), this.destroyPositionLine(), this.addPositionLine(i, t.position), t.lookAt(this.sRender.camera.position), this.emitter.emit("postil-follow-mouse")
  22716. }
  22717. }, l.prototype.handleSelectPostil = function() {
  22718. this.raycaster.setFromCamera(this.mouse, this.sRender.camera);
  22719. var t = this.raycaster.intersectObjects(this.PostilOfScene);
  22720. if (0 < t.length) {
  22721. this.player.disableNavigator = !0;
  22722. var e = t[0];
  22723. this.POSTIL && this.POSTIL.uuid !== e.object.uuid && (this.destroyControl(this.POSTIL), this.destroyBox(this.POSTIL)), this.POSTIL = e.object
  22724. }
  22725. }, l.prototype.handleChoosedPostil = function(t) {
  22726. t.userData.handle_choosed = !0, this.bundleControl(t), this.updateSettingItem(t), this.player.emit("choosed-postil", t.userData.setting_item)
  22727. }, l.prototype.handleDeletePostil = function(t) {
  22728. if (this.PostilOfKV[t]) {
  22729. var e = this.PostilOfKV[t],
  22730. i = e.userData.marker,
  22731. n = i.userData.postils,
  22732. r = i.userData.default_texture;
  22733. e.userData.transform_control && (this.destroyControl(e), this.destroyBox(e), this.POSTIL.userData.transform_control = null, this.POSTIL = null, this.player.emit("hide-postil-set-tool")), this.sRender.scene.remove(e), e.geometry.dispose(), e.material.dispose(), this.PostilOfScene.splice(this.PostilOfScene.indexOf(e), 1), delete this.PostilOfKV[t], delete n[t], 0 === Object.keys(n)
  22734. .length && (i.material.map = r, i.material.map.needsUpdate = !0), this.player.emit("delete-postil-success", t)
  22735. }
  22736. }, l.prototype.handleEditPostil = function(t) {
  22737. if (this.PostilOfKV[t]) return this.PostilOfKV[t].userData.setting_item
  22738. }, l.prototype.bundleControl = function(t) {
  22739. var e = this,
  22740. i = t.userData.setting_item;
  22741. if (!t.userData.transform_control) {
  22742. var n = new a(this.sRender.camera, this.sRender.renderer.domElement);
  22743. n.attach(t), n.setMode("translate"), n.setSize(.5), n.addEventListener("objectChange", (function(i) {
  22744. e.player.emit("hide-postil-set-tool"), e.updateSettingItem(t)
  22745. })), n.addEventListener("mouseUp", (function(t) {
  22746. e.player.emit("update-postil-ui", i)
  22747. })), n.addEventListener("mouseDown", (function(t) {})), t.userData.transform_control = n, this.controls.push(n), this.sRender.scene.add(n)
  22748. }
  22749. }, l.prototype.addPositionLine = function(t, e) {
  22750. if (this.POSTIL) {
  22751. var i = new n.LineBasicMaterial({
  22752. color: 16777215
  22753. }),
  22754. r = new n.Geometry;
  22755. r.vertices.push(t, e);
  22756. var o = new n.Line(r, i);
  22757. o.name = "position_line", this.sRender.scene.userData.position_line = o, this.sRender.scene.add(o)
  22758. }
  22759. }, l.prototype.destroyPositionLine = function() {
  22760. if (this.sRender.scene.userData.position_line) {
  22761. var t = this.sRender.scene.userData.position_line;
  22762. this.sRender.scene.userData.position_line = null, this.sRender.scene.remove(t), t.geometry.dispose(), t.material.dispose()
  22763. }
  22764. }, l.prototype.destroyPostilChoosedState = function() {
  22765. this.POSTIL && (this.POSTIL.userData.setting_item.visible = !0, this.destroyControl(this.POSTIL), this.destroyBox(this.POSTIL), this.POSTIL = null, this.player.emit("hide-postil-set-tool"))
  22766. }, l.prototype.destroyControl = function(t) {
  22767. if (t.userData.transform_control) {
  22768. var e = t.userData.transform_control;
  22769. t.userData.transform_control = null, t.userData.handle_choosed = !1, e.dispose(), e.detach(), this.sRender.scene.remove(e)
  22770. }
  22771. }, l.prototype.destroyBox = function(t) {
  22772. if (t.userData.box_line) {
  22773. var e = t.userData.box_line;
  22774. t.userData.box_line = null, t.remove(e), e.geometry.dispose(), e.material.dispose()
  22775. }
  22776. }, l.prototype.updateSettingItem = function(t) {
  22777. var e = t.userData.setting_item;
  22778. if (e.scale = t.scale, e.position = t.position, e.default_scale = t.userData.default_scale, e.default_size = t.userData.default_size, e.default_fat = t.userData.default_fat, 0 === e.size.width && (e.size = t.userData.default_size), 0 === e.fat && (e.fat = t.userData.default_fat), t.userData.box_helper) {
  22779. var i = r.getVerticesOfItemSize(t.geometry)[1].clone()
  22780. .applyMatrix4(t.matrixWorld);
  22781. e.screenPosition = r.convertWorldPositionToScreen(i, this.sRender.camera)
  22782. }
  22783. "" === e.current_location_id && (e.current_location_id = this.locationId)
  22784. }, l.prototype.updatePostilInfo = function(t) {
  22785. var e = t.info,
  22786. i = t.change_type;
  22787. if ("size" === i && e.size_slide_stop && (this.updateSettingItem(this.POSTIL), this.player.emit("update-postil-ui", e)), "fat" === i || "color" === i) {
  22788. var n, r = e.fat,
  22789. o = e.color,
  22790. a = e.size.width;
  22791. 1 === e.type && (n = this.POSTIL.userData.PostilModel.createTorusTexture(r, a, o)), 2 === e.type && (n = this.POSTIL.userData.PostilModel.createRectTexture(r, a, o)), this.POSTIL.material.map = n
  22792. }
  22793. }, l.prototype.updateDirectionOfPostil = function() {
  22794. for (var t = 0, e = this.PostilOfScene.length; t < e; ++t) {
  22795. this.PostilOfScene[t].lookAt(this.sRender.camera.position)
  22796. }
  22797. }, l.prototype.updateControlsOfPostil = function() {
  22798. if (0 < this.controls.length)
  22799. for (var t = 0; t < this.controls.length; ++t) this.controls[t].update()
  22800. }, l.prototype.updateShowOfPostil = function(t) {
  22801. if (!this.hideAll) {
  22802. for (var e = [], i = 0, o = this.PostilOfScene.length; i < o; ++i) {
  22803. var a = this.PostilOfScene[i],
  22804. s = a.userData.setting_item;
  22805. if (t === s.current_location_id) {
  22806. a.visible = !0;
  22807. var l = r.convertWorldPositionToScreen(new n.Vector3(0, 0, 0), this.sRender.camera);
  22808. l = new n.Vector2(l.x, l.y);
  22809. var u = r.convertWorldPositionToScreen(a.position.clone(), this.sRender.camera);
  22810. u = new n.Vector2(u.x, u.y), s.distanceToScreenCenter = u.distanceTo(l);
  22811. var h = r.getVerticesOfItemSize(a.geometry)[1].applyMatrix4(a.matrixWorld);
  22812. s.screenPosition = r.convertWorldPositionToScreen(h.clone(), this.sRender.camera), this.computedOutScrren(a), a.userData.handle_choosed && (s.visible = !1), e[e.length] = s
  22813. } else a.visible = !1
  22814. }
  22815. this.player.emit("update-postil-show", e)
  22816. }
  22817. }, l.prototype.updateMarkerTexture = function(t) {
  22818. var e = t.userData.marker;
  22819. e.userData.postils[t.uuid] = 1, e.material.map = s, e.material.map.needsUpdate = !0
  22820. }, l.prototype.computedOutScrren = function(t) {
  22821. var e = t.position.clone(),
  22822. i = t.userData.setting_item;
  22823. if ("panorama" === this.player.mode) {
  22824. var n = e.applyMatrix4(this.sRender.camera.matrixWorldInverse)
  22825. .applyMatrix4(this.sRender.camera.projectionMatrix);
  22826. i.visible = !0;
  22827. var r = Math.abs(n.x) > 1,
  22828. o = Math.abs(n.y) > 1,
  22829. a = Math.abs(n.z) > 1;
  22830. r || o || a ? (i.visible = !1, t.visible = !1) : (i.visible = !0, t.visible = !0)
  22831. } else i.visible = !1
  22832. }, l.prototype.update = function() {
  22833. this.updateDirectionOfPostil(), this.updateControlsOfPostil(), this.player.currentPano && this.player.currentPano.id && (this.locationId = this.player.currentPano.id, this.updateShowOfPostil(this.locationId))
  22834. }, t.exports = l
  22835. }, function(t, e) {
  22836. t.exports = function(t) {
  22837. var e = function(e) {
  22838. t.MeshBasicMaterial.call(this), this.depthTest = !1, this.depthWrite = !1, this.transparent = !0, this.opacity = .8, this.color.setHex(e.color), this.highlight = function(t) {
  22839. this.opacity = t ? 1 : .8
  22840. }
  22841. };
  22842. (e.prototype = Object.create(t.MeshBasicMaterial.prototype))
  22843. .constructor = e;
  22844. var i = function(e) {
  22845. t.LineBasicMaterial.call(this), this.depthTest = !1, this.depthWrite = !1, this.transparent = !0, this.linewidth = 1, this.color.setHex(e.color)
  22846. };
  22847. function n(e, i) {
  22848. t.Object3D.call(this), i = void 0 !== i ? i : document, this.object = void 0, this.visible = !1, this.translationSnap = null, this.rotationSnap = null, this.space = "world", this.size = 1, this.axis = null;
  22849. var n = this,
  22850. r = "translate",
  22851. o = !1,
  22852. a = {
  22853. translate: new t.TransformGizmoDIY2Translate
  22854. };
  22855. for (var s in this._gizmo = a, a) {
  22856. var l = a[s];
  22857. l.visible = s === r, this.add(l)
  22858. }
  22859. var u = {
  22860. type: "change"
  22861. },
  22862. h = {
  22863. type: "mouseDown"
  22864. },
  22865. c = {
  22866. type: "mouseUp",
  22867. mode: r
  22868. },
  22869. d = {
  22870. type: "objectChange"
  22871. },
  22872. p = new t.Raycaster,
  22873. f = new t.Vector2,
  22874. m = new t.Vector3,
  22875. g = new t.Vector3,
  22876. v = new t.Vector3,
  22877. y = new t.Vector3,
  22878. b = 1,
  22879. w = new t.Vector3,
  22880. x = new t.Matrix4,
  22881. M = new t.Vector3,
  22882. T = new t.Quaternion,
  22883. S = new t.Vector3(1, 0, 0),
  22884. _ = new t.Vector3(0, 1, 0),
  22885. A = new t.Vector3(0, 0, 1),
  22886. P = new t.Quaternion,
  22887. C = new t.Quaternion,
  22888. E = new t.Quaternion,
  22889. D = new t.Quaternion,
  22890. L = new t.Vector3,
  22891. O = new t.Vector3,
  22892. I = new t.Matrix4,
  22893. R = new t.Matrix4,
  22894. N = new t.Vector3,
  22895. k = new t.Vector3,
  22896. F = new t.Euler,
  22897. B = new t.Matrix4,
  22898. z = new t.Vector3,
  22899. U = new t.Euler;
  22900. function V(t) {
  22901. if (void 0 !== n.object && !0 !== o && (void 0 === t.button || 0 === t.button)) {
  22902. var e = W(t.changedTouches ? t.changedTouches[0] : t, a[r].pickers.children),
  22903. i = null;
  22904. e && (i = e.object.name, t.preventDefault()), n.axis !== i && (n.axis = i, n.update(), n.dispatchEvent(u))
  22905. }
  22906. }
  22907. function j(t) {
  22908. if (void 0 !== n.object && !0 !== o && (void 0 === t.button || 0 === t.button)) {
  22909. var e = t.changedTouches ? t.changedTouches[0] : t;
  22910. if (0 === e.button || void 0 === e.button) {
  22911. var i = W(e, a[r].pickers.children);
  22912. if (i) {
  22913. t.preventDefault(), t.stopPropagation(), n.dispatchEvent(h), n.axis = i.object.name, n.update(), w.copy(z)
  22914. .sub(k)
  22915. .normalize(), a[r].setActivePlane(n.axis, w);
  22916. var s = W(e, [a[r].activePlane]);
  22917. s && (L.copy(n.object.position), O.copy(n.object.scale), I.extractRotation(n.object.matrix), B.extractRotation(n.object.matrixWorld), R.extractRotation(n.object.parent.matrixWorld), N.setFromMatrixScale(x.getInverse(n.object.parent.matrixWorld)), g.copy(s.point));
  22918. var l = i.object,
  22919. u = n.getMode(),
  22920. c = n._gizmo[u].pickerGizmos;
  22921. if ("rotate" === u && l.userData.isPicker) {
  22922. for (var d in c) {
  22923. (p = c[d][0][0].children[0])
  22924. .visible = !1
  22925. }
  22926. l.parent.getObjectByName("Torus")
  22927. .visible = !0, l.parent.getObjectByName("ArcSurface")
  22928. .visible = !0
  22929. }
  22930. if ("translate" === u && l.userData.isPicker)
  22931. for (var d in c) {
  22932. var p = c[d][0][0];
  22933. n.axis !== d && (p.visible = !1)
  22934. }
  22935. }
  22936. }
  22937. o = !0
  22938. }
  22939. }
  22940. function H(e) {
  22941. if (void 0 !== n.object && null !== n.axis && !1 !== o && (void 0 === e.button || 0 === e.button)) {
  22942. var i = W(e.changedTouches ? e.changedTouches[0] : e, [a[r].activePlane]);
  22943. if (!1 !== i) {
  22944. if (e.preventDefault(), e.stopPropagation(), m.copy(i.point), "translate" === r && (m.sub(g), m.multiply(N), "local" === n.space && (m.applyMatrix4(x.getInverse(B)), -1 === n.axis.search("X") && (m.x = 0), -1 === n.axis.search("Y") && (m.y = 0), -1 === n.axis.search("Z") && (m.z = 0), m.applyMatrix4(I), n.object.position.copy(L), n.object.position.add(m)), "world" !== n.space && -1 === n.axis.search("XYZ") || (-1 === n.axis.search("X") && (m.x = 0), -1 === n.axis.search("Y") && (m.y = 0), -1 === n.axis.search("Z") && (m.z = 0), m.applyMatrix4(x.getInverse(R)), n.object.position.copy(L), n.object.position.add(m)), null !== n.translationSnap && ("local" === n.space && n.object.position.applyMatrix4(x.getInverse(B)), -1 !== n.axis.search("X") && (n.object.position.x = Math.round(n.object.position.x / n.translationSnap) * n.translationSnap), -1 !== n.axis.search("Y") && (n.object.position.y = Math.round(n.object.position.y / n.translationSnap) * n.translationSnap), -1 !== n.axis.search("Z") && (n.object.position.z = Math.round(n.object.position.z / n.translationSnap) * n.translationSnap), "local" === n.space && n.object.position.applyMatrix4(B))), "rotate" === r && (m.sub(k), m.multiply(N), M.copy(g)
  22945. .sub(k), M.multiply(N), "world" === n.space)) {
  22946. if (v.set(Math.atan2(m.z, m.y), Math.atan2(m.x, m.z), Math.atan2(m.y, m.x)), y.set(Math.atan2(M.z, M.y), Math.atan2(M.x, M.z), Math.atan2(M.y, M.x)), T.setFromRotationMatrix(x.getInverse(R)), null !== n.rotationSnap ? (C.setFromAxisAngle(S, Math.round((v.x - y.x) / n.rotationSnap) * n.rotationSnap), E.setFromAxisAngle(_, Math.round((v.y - y.y) / n.rotationSnap) * n.rotationSnap), D.setFromAxisAngle(A, Math.round((v.z - y.z) / n.rotationSnap) * n.rotationSnap)) : (C.setFromAxisAngle(S, v.x - y.x), E.setFromAxisAngle(_, v.y - y.y), D.setFromAxisAngle(A, v.z - y.z)), P.setFromRotationMatrix(B), "X" === n.axis) {
  22947. T.multiplyQuaternions(T, C);
  22948. var s = n._gizmo[r].pickerGizmos.X[0][0].getObjectByName("ArcSurface");
  22949. (l = new t.Quaternion)
  22950. .setFromAxisAngle(A, v.x), s.quaternion.copy(l)
  22951. }
  22952. if ("Y" === n.axis) {
  22953. T.multiplyQuaternions(T, E);
  22954. s = n._gizmo[r].pickerGizmos.Y[0][0].getObjectByName("ArcSurface");
  22955. (l = new t.Quaternion)
  22956. .setFromAxisAngle(A, v.y), s.quaternion.copy(l)
  22957. }
  22958. if ("Z" === n.axis) {
  22959. T.multiplyQuaternions(T, D);
  22960. var l;
  22961. s = n._gizmo[r].pickerGizmos.Z[0][0].getObjectByName("ArcSurface");
  22962. (l = new t.Quaternion)
  22963. .setFromAxisAngle(A, v.z), s.quaternion.copy(l)
  22964. }
  22965. T.multiplyQuaternions(T, P), n.object.quaternion.copy(T)
  22966. }
  22967. n.update(), n.dispatchEvent(u), n.dispatchEvent(d)
  22968. }
  22969. }
  22970. }
  22971. function G(t) {
  22972. if (t.preventDefault(), void 0 === t.button || 0 === t.button) {
  22973. if (o && null !== n.axis) {
  22974. c.mode = r, n.dispatchEvent(c);
  22975. var e = n.getMode(),
  22976. i = n.axis,
  22977. a = n._gizmo[e].pickerGizmos;
  22978. if ("rotate" === e) {
  22979. for (var s in a) {
  22980. (l = a[s][0][0].children[0])
  22981. .visible = !0
  22982. }
  22983. a[i][0][0].getObjectByName("Torus")
  22984. .visible = !1, a[i][0][0].getObjectByName("ArcSurface")
  22985. .visible = !1
  22986. }
  22987. if ("translate" === e)
  22988. for (var s in a) {
  22989. var l = a[s][0][0];
  22990. n.axis !== s && (l.visible = !0)
  22991. }
  22992. }
  22993. o = !1, "TouchEvent" in window && t instanceof TouchEvent ? (n.axis = null, n.update(), n.dispatchEvent(u)) : V(t)
  22994. }
  22995. }
  22996. function W(t, n) {
  22997. var r = i.getBoundingClientRect(),
  22998. o = (t.clientX - r.left) / r.width,
  22999. a = (t.clientY - r.top) / r.height;
  23000. f.set(2 * o - 1, -2 * a + 1), p.setFromCamera(f, e);
  23001. var s = p.intersectObjects(n, !0);
  23002. return !!s[0] && s[0]
  23003. }
  23004. i.addEventListener("mousedown", j, !1), i.addEventListener("touchstart", j, !1), i.addEventListener("mousemove", V, !1), i.addEventListener("touchmove", V, !1), i.addEventListener("mousemove", H, !1), i.addEventListener("touchmove", H, !1), i.addEventListener("mouseup", G, !1), i.addEventListener("mouseout", G, !1), i.addEventListener("touchend", G, !1), i.addEventListener("touchcancel", G, !1), i.addEventListener("touchleave", G, !1), this.dispose = function() {
  23005. i.removeEventListener("mousedown", j), i.removeEventListener("touchstart", j), i.removeEventListener("mousemove", V), i.removeEventListener("touchmove", V), i.removeEventListener("mousemove", H), i.removeEventListener("touchmove", H), i.removeEventListener("mouseup", G), i.removeEventListener("mouseout", G), i.removeEventListener("touchend", G), i.removeEventListener("touchcancel", G), i.removeEventListener("touchleave", G)
  23006. }, this.attach = function(t) {
  23007. this.object = t, this.visible = !0, this.update()
  23008. }, this.detach = function() {
  23009. this.object = void 0, this.visible = !1, this.axis = null
  23010. }, this.getMode = function() {
  23011. return r
  23012. }, this.setMode = function(t) {
  23013. for (var e in "scale" === (r = t || r) && (n.space = "local"), a) a[e].visible = e === r;
  23014. this.update(), n.dispatchEvent(u)
  23015. }, this.setTranslationSnap = function(t) {
  23016. n.translationSnap = t
  23017. }, this.setRotationSnap = function(t) {
  23018. n.rotationSnap = t
  23019. }, this.setSize = function(t) {
  23020. n.size = t, this.update(), n.dispatchEvent(u)
  23021. }, this.setSpace = function(t) {
  23022. n.space = t, this.update(), n.dispatchEvent(u)
  23023. }, this.update = function() {
  23024. void 0 !== n.object && (n.object.updateMatrixWorld(), k.setFromMatrixPosition(n.object.matrixWorld), F.setFromRotationMatrix(x.extractRotation(n.object.matrixWorld)), e.updateMatrixWorld(), z.setFromMatrixPosition(e.matrixWorld), U.setFromRotationMatrix(x.extractRotation(e.matrixWorld)), b = k.distanceTo(z) / 6 * n.size, this.position.copy(k), this.scale.set(b, b, b), e instanceof t.PerspectiveCamera ? w.copy(z)
  23025. .sub(k)
  23026. .normalize() : e instanceof t.OrthographicCamera && w.copy(z)
  23027. .normalize(), "local" === n.space ? a[r].update(F, w) : "world" === n.space && a[r].update(new t.Euler, w), a[r].highlight(n.axis))
  23028. }
  23029. }
  23030. return (i.prototype = Object.create(t.LineBasicMaterial.prototype))
  23031. .constructor = i, t.TransformGizmoDIY2 = function() {
  23032. this.init = function() {
  23033. t.Object3D.call(this), this.handles = new t.Object3D, this.pickers = new t.Object3D, this.planes = new t.Object3D, this.add(this.handles), this.add(this.pickers), this.add(this.planes);
  23034. var e = new t.PlaneBufferGeometry(50, 50, 2, 2),
  23035. i = new t.MeshBasicMaterial({
  23036. visible: !1,
  23037. side: t.DoubleSide
  23038. }),
  23039. n = {
  23040. XY: new t.Mesh(e, i),
  23041. YZ: new t.Mesh(e, i),
  23042. XZ: new t.Mesh(e, i)
  23043. };
  23044. for (var r in n.YZ.rotation.set(0, Math.PI / 2, 0), n.XZ.rotation.set(-Math.PI / 2, 0, 0), n) n[r].name = r, this.planes.add(n[r]), this.planes[r] = n[r];
  23045. var o = function(t, e) {
  23046. for (var i in t)
  23047. for (r = t[i].length; r--;) {
  23048. var n = t[i][r][0],
  23049. o = t[i][r][1],
  23050. a = t[i][r][2];
  23051. n.name = i, o && n.position.set(o[0], o[1], o[2]), a && n.rotation.set(a[0], a[1], a[2]), e.add(n)
  23052. }
  23053. };
  23054. o(this.handleGizmos, this.handles), o(this.pickerGizmos, this.pickers), this.traverse((function(e) {
  23055. if (e instanceof t.Mesh) {
  23056. e.updateMatrix();
  23057. var i = e.geometry.clone();
  23058. i.applyMatrix(e.matrix), e.geometry = i, e.position.set(0, 0, 0), e.rotation.set(0, 0, 0), e.scale.set(1, 1, 1)
  23059. }
  23060. }))
  23061. }, this.highlight = function(t) {
  23062. this.traverse((function(e) {
  23063. e.material && e.material.highlight && (e.name === t ? e.material.highlight(!0) : e.material.highlight(!1))
  23064. }))
  23065. }
  23066. }, t.TransformGizmoDIY2.prototype = Object.create(t.Object3D.prototype), t.TransformGizmoDIY2.prototype.constructor = t.TransformGizmoDIY2, t.TransformGizmoDIY2.prototype.update = function(t, e) {}, t.TransformGizmoDIY2Translate = function() {
  23067. t.TransformGizmoDIY2.call(this);
  23068. var n = new t.BufferGeometry;
  23069. n.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, .3, 0, 0], 3));
  23070. var r = new t.Line(n, new i({
  23071. color: 65280
  23072. }));
  23073. r.userData.isLine = !0;
  23074. var o = new t.BufferGeometry;
  23075. o.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, 0, .3, 0], 3));
  23076. var a = new t.Line(o, new i({
  23077. color: 16711680
  23078. }));
  23079. a.userData.isLine = !0;
  23080. var s = new t.BufferGeometry;
  23081. s.addAttribute("position", new t.Float32BufferAttribute([0, 0, 0, 0, 0, .3], 3));
  23082. var l = new t.Line(s, new i({
  23083. color: 16776960
  23084. }));
  23085. r.userData.isLine = !0, this.handleGizmos = {
  23086. X: [
  23087. [r]
  23088. ],
  23089. Y: [
  23090. [a]
  23091. ],
  23092. Z: [
  23093. [l]
  23094. ]
  23095. };
  23096. var u = function() {
  23097. for (var e = [{
  23098. x: 0,
  23099. y: 18
  23100. }, {
  23101. x: 0,
  23102. y: 10
  23103. }, {
  23104. x: -36,
  23105. y: 10
  23106. }, {
  23107. x: -36,
  23108. y: -8
  23109. }, {
  23110. x: 0,
  23111. y: -8
  23112. }, {
  23113. x: 0,
  23114. y: -18
  23115. }, {
  23116. x: 36,
  23117. y: 0
  23118. }], i = new t.Shape, n = 0; n < e.length; ++n) 0 === n ? i.moveTo(e[n].x, e[n].y) : i.lineTo(e[n].x, e[n].y);
  23119. return new t.ExtrudeBufferGeometry(i, {
  23120. depth: 8,
  23121. bevelEnabled: !1,
  23122. bevelSegments: 1,
  23123. steps: 1,
  23124. bevelSize: 1,
  23125. bevelThickness: 1
  23126. })
  23127. },
  23128. h = new t.Mesh(new u, new e({
  23129. visible: !0,
  23130. transparent: !0,
  23131. color: 65280
  23132. }));
  23133. h.scale.set(.01, .01, .01), h.userData.isPicker = !0;
  23134. var c = new t.Mesh(new u, new e({
  23135. visible: !0,
  23136. transparent: !0,
  23137. color: 16711680
  23138. }));
  23139. c.scale.set(.01, .01, .01), c.userData.isPicker = !0;
  23140. var d = new t.Mesh(new u, new e({
  23141. visible: !0,
  23142. transparent: !0,
  23143. color: 16776960
  23144. }));
  23145. d.scale.set(.01, .01, .01), d.userData.isPicker = !0, this.pickerGizmos = {
  23146. X: [
  23147. [h, [.8, 0, 0],
  23148. [Math.PI / 2, 0, 0]
  23149. ]
  23150. ],
  23151. Y: [
  23152. [c, [0, .8, 0],
  23153. [0, 0, Math.PI / 2]
  23154. ]
  23155. ],
  23156. Z: [
  23157. [d, [0, 0, .8],
  23158. [Math.PI / 2, 0, Math.PI / 2]
  23159. ]
  23160. ]
  23161. }, this.setActivePlane = function(e, i) {
  23162. var n = new t.Matrix4;
  23163. i.applyMatrix4(n.getInverse(n.extractRotation(this.planes.XY.matrixWorld))), "X" === e && (this.activePlane = this.planes.XY, Math.abs(i.y) > Math.abs(i.z) && (this.activePlane = this.planes.XZ)), "Y" === e && (this.activePlane = this.planes.XY, Math.abs(i.x) > Math.abs(i.z) && (this.activePlane = this.planes.YZ)), "Z" === e && (this.activePlane = this.planes.XZ, Math.abs(i.x) > Math.abs(i.y) && (this.activePlane = this.planes.YZ)), "XY" === e && (this.activePlane = this.planes.XY), "YZ" === e && (this.activePlane = this.planes.YZ), "XZ" === e && (this.activePlane = this.planes.XZ)
  23164. };
  23165. var p = new t.Vector3(1, 0, 0),
  23166. f = new t.Vector3(0, 1, 0),
  23167. m = new t.Vector3(0, 0, 1),
  23168. g = new t.Quaternion,
  23169. v = new t.Quaternion,
  23170. y = new t.Vector3(0, 1, 0);
  23171. this.update = function(e, i) {
  23172. t.TransformGizmoDIY2.prototype.update.apply(this, arguments), this.traverse((function(e) {
  23173. var n;
  23174. "X" === e.name && ((n = y.copy(p)
  23175. .applyQuaternion(g)
  23176. .dot(i)) < 0 && (e.scale.x = -1), n > 0 && (e.scale.x = 1));
  23177. if ("Y" === e.name) {
  23178. var r = new t.Quaternion,
  23179. o = new t.Quaternion;
  23180. r.setFromAxisAngle(f, Math.atan2(i.x, i.z)), o.multiplyQuaternions(o, r), e.quaternion.copy(o)
  23181. }
  23182. "Z" === e.name && ((n = y.copy(m)
  23183. .applyQuaternion(v)
  23184. .dot(i)) < 0 && (e.scale.z = -1), n > 0 && (e.scale.z = 1))
  23185. }))
  23186. }, this.init()
  23187. }, t.TransformGizmoDIY2Translate.prototype = Object.create(t.TransformGizmoDIY2.prototype), t.TransformGizmoDIY2Translate.prototype.constructor = t.TransformGizmoDIY2Translate, n.prototype = Object.create(t.Object3D.prototype), n.prototype.constructor = n, n
  23188. }
  23189. }, function(t, e, i) {
  23190. "use strict";
  23191. var n = i(0),
  23192. r = i(40)(n),
  23193. o = i(9),
  23194. a = i(13),
  23195. s = i(4)
  23196. .EventEmitter,
  23197. l = i(140),
  23198. u = i(41);
  23199. function h(t) {
  23200. this._canbeUsed = !1, this._canbeChoosed = !1, this._canbeSelect = !0, this.player = t, this.sRender = t.sRender, this.raycaster = new n.Raycaster, this.VIRTUAL_CAMERA = null, this.VIRTUAL_CAMERA_INTERSECT = null, this.putModels = [], this.putModelsOfKV = {}, this.controls = [], this.crossFadeControls = [], this.colliders = [], this.newColliders = [], this.newCollidersBoxCube = [], this.emitter = new s, this.defineProperty(), this.initStateEngine()
  23201. }
  23202. h.prototype.defineProperty = function() {
  23203. Object.defineProperty(this, "canbeUsed", {
  23204. get: function() {
  23205. return this._canbeUsed
  23206. },
  23207. set: function(t) {
  23208. this._canbeUsed = t
  23209. }
  23210. }), Object.defineProperty(this, "canbeSelect", {
  23211. get: function() {
  23212. return this._canbeSelect
  23213. },
  23214. set: function(t) {
  23215. this._canbeSelect = t
  23216. }
  23217. })
  23218. }, h.prototype.initStateEngine = function() {
  23219. this.MouseStateEngine = {
  23220. mouseMoveIn: {
  23221. state: !1,
  23222. callback: this.handleMouseMoveInVirtualCamera.bind(this)
  23223. },
  23224. mouseMoveOut: {
  23225. state: !1,
  23226. callback: this.handleMouseMoveOutVirtualCamera.bind(this)
  23227. }
  23228. }, this.MouseStateEngineTranstion = {
  23229. mouseMoveIn: {
  23230. mouseMoveOut: function() {
  23231. this.MouseStateEngine.mouseMoveIn.state && (this.MouseStateEngine.mouseMoveIn.state = !1, this.MouseStateEngine.mouseMoveOut.state = !0, this.MouseStateEngine.mouseMoveOut.callback())
  23232. }.bind(this)
  23233. }
  23234. }
  23235. }, h.prototype.initBoxHelper = function(t) {
  23236. if (!t.userData.box_helper) {
  23237. var e = new n.BoxHelper(t);
  23238. e.visible = !1, e.geometry.computeBoundingBox();
  23239. var i = e.geometry.boundingBox.getSize(new n.Vector3);
  23240. e.userData.box_size = i, t.userData.box_helper = e, this.sRender.scene.add(e)
  23241. }
  23242. }, h.prototype.initPositionLine = function(t, e) {
  23243. if (this.VIRTUAL_CAMERA) {
  23244. var i = new n.LineBasicMaterial({
  23245. color: 16777215
  23246. }),
  23247. r = new n.Geometry;
  23248. r.vertices.push(t, e);
  23249. var o = new n.Line(r, i);
  23250. o.name = "position_line", this.sRender.scene.userData.position_line = o, this.sRender.scene.add(o)
  23251. }
  23252. }, h.prototype.initOriginSettingItem = function(t) {
  23253. var e = t.userData.setting_item;
  23254. e.uuid = t.uuid, e.FOV = t.FOV, e.DISTANCE = t.DISTANCE, e.origin_position.copy(t.position.clone()), e.origin_rotation.copy(t.rotation.clone()), e.current_location_id = this.player.currentPano.id
  23255. }, h.prototype.initNewCollider = function(t) {
  23256. this.newColliders = [];
  23257. for (var e = new n.MeshBasicMaterial({
  23258. side: n.FrontSide,
  23259. transparent: !0,
  23260. opacity: 0
  23261. }), i = 0, r = t.length; i < r; ++i) {
  23262. var o = t[i],
  23263. a = (new n.Geometry)
  23264. .fromBufferGeometry(o.geometry),
  23265. s = new n.Mesh(a, e);
  23266. this.sRender.scene.add(s), this.newColliders.push(s);
  23267. var l = new n.BoxHelper(s, 255);
  23268. l.visible = !1, this.sRender.scene.add(l), s.userData.box_helper = l;
  23269. var u = this.initBoundingCube(l, 2, 0);
  23270. this.sRender.scene.add(u), this.newCollidersBoxCube.push(u)
  23271. }
  23272. for (i = 0, r = this.newCollidersBoxCube.length; i < r; ++i) {
  23273. u = this.newCollidersBoxCube[i], o = t[i];
  23274. u.userData.collider = o
  23275. }
  23276. }, h.prototype.initLabel = function(t) {
  23277. this.player.emit("add-virtual-camera-label", t)
  23278. }, h.prototype.initBoundingCube = function(t, e, i) {
  23279. t.geometry.computeBoundingBox();
  23280. var r = t.geometry.boundingBox,
  23281. o = r.getSize(new n.Vector3),
  23282. a = r.getCenter(new n.Vector3),
  23283. s = new n.BoxGeometry(o.x, o.y, o.z, e, e, e),
  23284. l = new n.MeshBasicMaterial({
  23285. color: i,
  23286. transparent: !0,
  23287. opacity: 0,
  23288. depthTest: !1,
  23289. depthWrite: !1
  23290. }),
  23291. u = new n.Mesh(s, l);
  23292. return u.position.copy(a), u
  23293. };
  23294. var c = !1;
  23295. h.prototype.onHandleControlPanoramaMove = function() {
  23296. c = !1, this._canbeChoosed = !1, this.player.emit("hide-all-virtual-camera-label"), this.VIRTUAL_CAMERA && !this.VIRTUAL_CAMERA.userData.follow_mouse && this.player.emit("hidePutModelSetTools"), this.VIRTUAL_CAMERA_INTERSECT && (this.VIRTUAL_CAMERA_INTERSECT = null)
  23297. }, h.prototype.onHandleControlPanoramaMoveStop = function() {
  23298. if (!c && (c = !0, this.VIRTUAL_CAMERA && !this.VIRTUAL_CAMERA.userData.follow_mouse)) {
  23299. var t = this.VIRTUAL_CAMERA.userData.virtual_camera;
  23300. this.VIRTUAL_CAMERA.userData.setting_item;
  23301. this.updateSetToolsPosition(t), t.userData.out_screen || this.player.emit("showPutModelSetTools", "camera")
  23302. }
  23303. }, h.prototype.onHandleControlPanoramaMoveStopNoPan = function() {}, h.prototype.onHandleControlDollhouseMove = function() {
  23304. this.VIRTUAL_CAMERA && this.player.emit("hidePutModelSetTools")
  23305. }, h.prototype.onHandleControlDollhouseMoveStop = function() {
  23306. if (this.VIRTUAL_CAMERA) {
  23307. var t = this.VIRTUAL_CAMERA.userData.virtual_camera;
  23308. this.VIRTUAL_CAMERA.userData.setting_item;
  23309. this.updateSetToolsPosition(t), this.player.emit("showPutModelSetTools", "camera")
  23310. }
  23311. }, h.prototype.onCameraFovSlideStop = function() {
  23312. this.VIRTUAL_CAMERA
  23313. }, h.prototype.onCameraDistanceSlideStop = function() {
  23314. this.VIRTUAL_CAMERA
  23315. }, h.prototype.onIntoPanorama = function() {
  23316. 0 < this.putModels.length && (this.player.emit("showModelListPanel"), this.updateAllLabelPosition(this.putModels, !0), this.handleShowAllPlaceMonitor())
  23317. }, h.prototype.onIntoTransitioning = function() {
  23318. this.destroyModelControlState(), this.handleHideAllPlaceMonitor(), this.player.emit("hide-all-virtual-camera-label")
  23319. }, h.prototype.onIntoDollhouse = function() {
  23320. G.conf.modelplaced, this.handleShowAllPlaceMonitor(), this.player.emit("hide-all-virtual-camera-label")
  23321. }, h.prototype.onHandleControlTtagsMove = function() {
  23322. this.player.emit("hide-all-virtual-camera-label")
  23323. }, h.prototype.onFlyEnd = function() {
  23324. this.computeLabelBarrier(this.player.currentPano, this.colliders), this.updateAllLabelPosition(this.putModels)
  23325. }, h.prototype.onCameraPositionMove = function() {}, h.prototype.onCameraPositionMoveStop = function() {
  23326. this.updateAllLabelPosition(this.putModels)
  23327. }, h.prototype.onCameraRotationMove = function() {}, h.prototype.onCameraRotationMoveStop = function() {
  23328. this.updateAllLabelPosition(this.putModels)
  23329. }, h.prototype.handleMouseMove = function() {
  23330. if (this.VIRTUAL_CAMERA && this.VIRTUAL_CAMERA.userData.follow_mouse && this.handleModelFollowingMouse(this.VIRTUAL_CAMERA), 0 < this.putModels.length) {
  23331. var t = this.putModels.filter((function(t) {
  23332. return !1 === t.userData.handle_choosed
  23333. }));
  23334. 0 < t.length && this.handlePickupVirtualCamera(t)
  23335. }
  23336. }, h.prototype.handlePickupVirtualCamera = function(t) {
  23337. this.raycaster.setFromCamera(this.player.mouse, this.sRender.camera);
  23338. var e = this.raycaster.intersectObjects(t, !0);
  23339. if (0 < e.length) {
  23340. var i = e[0].object;
  23341. "VirtualCamera" === i.name ? (this.pickedObject = i, this.MouseStateEngine.mouseMoveIn.state = !0, this.MouseStateEngine.mouseMoveIn.callback(i)) : this.MouseStateEngineTranstion.mouseMoveIn.mouseMoveOut()
  23342. } else this.MouseStateEngineTranstion.mouseMoveIn.mouseMoveOut()
  23343. }, h.prototype.handleMouseLeftButtonDown = function() {
  23344. if ((!1 !== u.canbeChoosedOfMode3D || "panorama" === this.player.mode) && (this._canbeChoosed = !0, 0 < this.putModels.length)) {
  23345. if (this.VIRTUAL_CAMERA && this.VIRTUAL_CAMERA.userData.follow_mouse) return;
  23346. this._canbeSelect && this.handleSelectModel(this.putModels)
  23347. }
  23348. }, h.prototype.handleMouseLeftButtonUp = function() {
  23349. if (this._canbeChoosed && this.VIRTUAL_CAMERA_INTERSECT) {
  23350. this.player.humanModelControls.destroyInvalidModelControl(), this.player.weaponModelControls.destroyModelChoosedState();
  23351. var t = this.VIRTUAL_CAMERA_INTERSECT.parent;
  23352. this.handleChoosedModel(t), this.VIRTUAL_CAMERA_INTERSECT = null
  23353. }
  23354. }, h.prototype.handleMouseRightButtonDown = function() {}, h.prototype.handleMouseRightButtonUp = function() {
  23355. if (this.VIRTUAL_CAMERA && this.VIRTUAL_CAMERA.userData.follow_mouse) {
  23356. var t = this.VIRTUAL_CAMERA;
  23357. this.handlePutModel(t), this.destroyBoxHelper(t), this.destroyPositionLine(), this.putModels.push(t), this.putModelsOfKV[t.uuid] = t, this.VIRTUAL_CAMERA = null, this.player.emit("addModelListItem", t.userData.setting_item)
  23358. }
  23359. }, h.prototype.handleModelFollowingMouse = function(t) {
  23360. t.userData.virtual_camera.geometry.computeBoundingBox();
  23361. var e = this.player.intersect,
  23362. i = e.object,
  23363. n = e.face.normal,
  23364. r = e.point,
  23365. o = n.applyMatrix4(i.matrixWorld)
  23366. .sub(i.position)
  23367. .normalize();
  23368. t.position.set(0, 0, 0), t.lookAt(o), t.position.copy(r.clone()
  23369. .add(n.divideScalar(8))), this.emitter.emit("virtualCamera-follow-mouse"), this.destroyPositionLine(), this.initPositionLine(r, t.position)
  23370. }, h.prototype.handlePutModel = function(t) {
  23371. var e = this;
  23372. t.userData.follow_mouse = !1;
  23373. var i = t.userData.setting_item;
  23374. this.emitter.emit("virtualCamera-follow-mouse-over"), this.initOriginSettingItem(t), this.addAxleWire(t), this.computeCrash(t, (function() {
  23375. e.computeSpaceData(t, !1), e.updateLabelPosition(t, i), e.initLabel(i)
  23376. }))
  23377. }, h.prototype.handleMouseMoveInVirtualCamera = function(t) {
  23378. document && (document.body.style.cursor = "pointer");
  23379. t.parent;
  23380. this.sRender.outlinePass.selectedObjects = [t], this.emitter.emit("virtualCamera-mouse-in")
  23381. }, h.prototype.handleMouseMoveOutVirtualCamera = function() {
  23382. document && (document.body.style.cursor = ""), this.sRender.outlinePass.selectedObjects = [], this.emitter.emit("virtualCamera-mouse-out")
  23383. }, h.prototype.handleSelectModel = function(t) {
  23384. this.raycaster.setFromCamera(this.player.mouse, this.sRender.camera);
  23385. var e = this.raycaster.intersectObjects(t, !0);
  23386. if (0 < e.length) {
  23387. var i = e[0].object;
  23388. "VirtualCamera" === i.name && (this.player.disableNavigator = !0, this.player.lockedFlyToPano = !0, this.VIRTUAL_CAMERA_INTERSECT = i)
  23389. }
  23390. }, h.prototype.handleChoosedModel = function(t) {
  23391. if (t.visible && (this.VIRTUAL_CAMERA && t.uuid !== this.VIRTUAL_CAMERA.uuid && this.destroyModelControlState(this.VIRTUAL_CAMERA), !this.VIRTUAL_CAMERA || t.uuid !== this.VIRTUAL_CAMERA.uuid)) {
  23392. t.userData.handle_choosed = !0, this.VIRTUAL_CAMERA = t;
  23393. var e = t.userData.virtual_camera,
  23394. i = t.userData.setting_item;
  23395. e.material.opacity = 1, this.initBoxHelper(t), this.bundleControlOfTranslate(), this.updateSetToolsPosition(t.userData.virtual_camera), this.destroySpaceData(t), this.emitter.emit("virtualCamera-handle-choosed"), this.player.emit("showPutModelSetTools", "camera"), this.player.emit("choosed-virtual-camera", t.userData.setting_item);
  23396. var n = {
  23397. positions: t.userData.axle_wire.geometry.vertices,
  23398. fov: t.FOV,
  23399. distance: t.DISTANCE,
  23400. quaternion: t.quaternion
  23401. };
  23402. this.sRender.emit("virtual-update-position", n), i.isLabelShow = !1, this.initLabel(i)
  23403. }
  23404. }, h.prototype.handleKeyOfEsc = function() {
  23405. if (this.VIRTUAL_CAMERA && this.VIRTUAL_CAMERA.userData.follow_mouse) {
  23406. var t = this.VIRTUAL_CAMERA;
  23407. this.destroyPositionLine(), this.destroyModelControlState(t), this.destroyModelFromScene(t), this.emitter.emit("virtualCamera-put-cancel")
  23408. }
  23409. }, h.prototype.handleHideModel = function(t) {
  23410. if (this.putModelsOfKV[t]) {
  23411. var e = this.putModelsOfKV[t],
  23412. i = e.userData.cone,
  23413. n = e.userData.face_group,
  23414. r = i.userData.place_monitor,
  23415. o = e.userData.axle_wire,
  23416. a = e.userData.setting_item;
  23417. this.switchSpaceDataVisible(e, !1), e.userData.handle_choosed && (this.destroyModelControlState(e), this.player.emit("hidePutModelSetTools"), this.player.emit("hidePutModelInfoPanel")), n && (n.visible = !1), r && (r.visible = !1), o && (o.visible = !1), e.visible = !1, a.isShow = !1
  23418. }
  23419. }, h.prototype.handleShowModel = function(t) {
  23420. if (this.putModelsOfKV[t]) {
  23421. var e = this.putModelsOfKV[t],
  23422. i = e.userData.cone,
  23423. n = e.userData.face_group,
  23424. r = i.userData.place_monitor,
  23425. o = e.userData.axle_wire,
  23426. a = e.userData.setting_item;
  23427. this.switchSpaceDataVisible(e, !0), n && (n.visible = !0), r && (r.visible = !0), o && (o.visible = !0), e.visible = !0, a.isShow = !0
  23428. }
  23429. }, h.prototype.handleDeleteModel = function(t) {
  23430. if (this.putModelsOfKV[t]) {
  23431. var e = this.putModelsOfKV[t];
  23432. e.userData.handle_choosed && (this.destroyModelControlState(e), this.player.emit("hidePutModelSetTools"), this.player.emit("hidePutModelInfoPanel")), this.destroySpaceData(e), this.destroyModelFromScene(e), this.putModels.splice(this.putModels.indexOf(e), 1), delete this.putModelsOfKV[t], this.player.emit("deletePutModelSuccess", t), 0 === this.putModels.length && 0 === this.player.humanModelControls.putModelsOfHuman.length && 0 === this.player.weaponModelControls.WEAPONS_SCENE.length && this.player.emit("hideModelListPanel")
  23433. }
  23434. }, h.prototype.handleHideCurrentCamera = function() {
  23435. for (var t = 0, e = this.putModels.length; t < e; ++t) {
  23436. var i = this.putModels[t];
  23437. !0 !== i.userData.is_save && this.handleHideModel(i.uuid)
  23438. }
  23439. }, h.prototype.handleShowCurrentCamera = function() {
  23440. for (var t = 0, e = this.putModels.length; t < e; ++t) {
  23441. var i = this.putModels[t];
  23442. !0 !== i.userData.is_save && this.handleShowModel(i.uuid)
  23443. }
  23444. }, h.prototype.handleSwitchSaveCameraVisible = function(t) {
  23445. for (var e = 0, i = this.putModels.length; e < i; ++e) {
  23446. var n = this.putModels[e],
  23447. r = n.userData.setting_item;
  23448. n.userData.is_save && (!1 === t && (n.userData.handle_choosed && (this.destroyModelControlState(n), this.player.emit("hidePutModelSetTools")), this.handleHideModel(r.uuid)), !0 === t && this.handleShowModel(r.uuid))
  23449. }
  23450. }, h.prototype.handleHideAllPlaceMonitor = function() {
  23451. for (var t = 0, e = this.putModels.length; t < e; ++t) {
  23452. var i = this.putModels[t],
  23453. n = i.userData.cone,
  23454. r = i.userData.face_group,
  23455. o = n.userData.place_monitor;
  23456. r && i.visible && (r.visible = !1), o && i.visible && (o.visible = !1)
  23457. }
  23458. }, h.prototype.handleShowAllPlaceMonitor = function() {
  23459. for (var t = 0, e = this.putModels.length; t < e; ++t) {
  23460. var i = this.putModels[t],
  23461. n = i.userData.cone,
  23462. r = i.userData.face_group,
  23463. o = n.userData.place_monitor;
  23464. r && i.visible && (r.visible = !0), o && i.visible && (o.visible = !0)
  23465. }
  23466. }, h.prototype.handleSwitchLabelVisible = function(t, e) {}, h.prototype.handleComplete = function() {
  23467. if (this.VIRTUAL_CAMERA) {
  23468. var t = this.VIRTUAL_CAMERA,
  23469. e = t.userData.setting_item;
  23470. this.destroyModelControlState(t), this.computeCrash(t), this.computeSpaceData(t, !1), this.updateLabelPosition(t, e), "panorama" === this.player.mode ? e.isLabelShow = !0 : e.isLabelShow = !1, this.initLabel(e)
  23471. }
  23472. }, h.prototype.bundleControlOfTranslate = function() {
  23473. this.VIRTUAL_CAMERA && this.bundleControlOfModel(this.VIRTUAL_CAMERA, "translate")
  23474. }, h.prototype.bundleControlOfRotate = function() {
  23475. this.VIRTUAL_CAMERA && this.bundleControlOfModel(this.VIRTUAL_CAMERA, "rotate")
  23476. }, h.prototype.bundleControlOfModel = function(t, e) {
  23477. if (t.userData.transform_control) {
  23478. (n = t.userData.transform_control)
  23479. .setMode(e)
  23480. } else {
  23481. var i = this,
  23482. n = new r(this.sRender.camera, this.sRender.renderer.domElement),
  23483. o = t.userData.virtual_camera,
  23484. a = t.userData.cone;
  23485. t.userData.setting_item;
  23486. this.updateControlPosition(n, o.position.clone()
  23487. .applyMatrix4(o.matrixWorld)), n.attach(t), n.setMode(e), n.setSize(.5), n.addEventListener("objectChange", (function(e) {
  23488. "translate" === n.getMode() && i.updateControlPosition(n, o.position.clone()
  23489. .applyMatrix4(o.matrixWorld)), a.visible = !0, i.updateAxleWire(t), i.player.emit("hidePutModelSetTools"), i.destroyPlaceMonitor(t), i.destroyCrossFace(t)
  23490. })), n.addEventListener("mouseDown", (function(t) {})), n.addEventListener("mouseUp", (function(t) {
  23491. "rotate" === n.getMode() && i.updateControlPosition(n, o.position.clone()
  23492. .applyMatrix4(o.matrixWorld)), i.updateSetToolsPosition(o), i.player.emit("showPutModelSetTools", "camera")
  23493. })), t.userData.transform_control = n, this.controls.push(n), this.sRender.scene.add(n)
  23494. }
  23495. };
  23496. var d = {
  23497. name: "totalIntersects"
  23498. };
  23499. h.prototype.computeCrash = function(t, e) {
  23500. var i = this;
  23501. void 0 === e && this.player.emit("showLoaddingOfLoadPutModel");
  23502. var r = setTimeout((function() {
  23503. var o = t.userData.axle_wire,
  23504. a = t.userData.cone,
  23505. s = a.geometry.vertices,
  23506. l = new n.Raycaster,
  23507. u = new n.Vector3,
  23508. h = a.localToWorld(s[0].clone()),
  23509. c = new WeakMap;
  23510. c.set(d, []);
  23511. var p = h.clone(),
  23512. f = s[s.length - 1].clone(),
  23513. m = a.localToWorld(f),
  23514. g = i.newColliders;
  23515. if (o) {
  23516. var v = o.userData.startVec.clone(),
  23517. y = o.userData.endVec.clone(),
  23518. b = o.userData.direct_vector.clone();
  23519. l.set(v, b.normalize());
  23520. var w = l.intersectObjects(g),
  23521. x = v.distanceTo(y);
  23522. if (0 < w.length) {
  23523. var M = (A = w[0])
  23524. .point;
  23525. A.distance <= x && i.updateAxleWire(t, M)
  23526. }
  23527. }
  23528. for (var T = 1, S = s.length - 1; T < S; ++T) {
  23529. f = s[T].clone();
  23530. var _ = a.localToWorld(f);
  23531. u.subVectors(_, h), l.set(h, u.normalize());
  23532. var A;
  23533. w = l.intersectObjects(g), x = h.distanceTo(_);
  23534. if (0 < w.length)(A = w[0])
  23535. .distance <= x ? c.get(d)
  23536. .push(A) : c.get(d)
  23537. .push({
  23538. point: _
  23539. });
  23540. else c.get(d)
  23541. .push({
  23542. point: _
  23543. })
  23544. }
  23545. c.get(d)
  23546. .push(c.get(d)[0]), i.destroyPlaceMonitor(t);
  23547. var P = new n.Group,
  23548. C = new n.MeshBasicMaterial({
  23549. color: 65280,
  23550. side: n.DoubleSide,
  23551. transparent: !0,
  23552. opacity: 0,
  23553. depthTest: !0,
  23554. depthWrite: !1
  23555. });
  23556. for (T = 0, S = c.get(d)
  23557. .length; T < S - 1; ++T) {
  23558. var E = new n.Geometry,
  23559. D = h.clone(),
  23560. L = c.get(d)[T].point,
  23561. O = c.get(d)[T + 1].point;
  23562. E.vertices.push(D, L, O);
  23563. var I = new n.Face3(0, 1, 2);
  23564. E.faces.push(I);
  23565. var R = new n.Mesh(E, C);
  23566. P.add(R)
  23567. }
  23568. c.set(d, null), i.sRender.scene.add(P), a.visible = !1, a.userData.place_monitor = P, i.computeCrossFace(p, m, .5 * t.FOV, g, t), i.player.emit("hideLoaddingOfLoadPutModel"), e && e(), clearTimeout(r)
  23569. }), 100)
  23570. }, h.prototype.computeCrossShape = function(t) {
  23571. for (var e = 0; e < t.length; ++e) {
  23572. if (!t[e + 1]) return;
  23573. var i = t[e].point,
  23574. n = t[e + 1].point,
  23575. r = this.sRender.scene.userData["shape_line_" + e];
  23576. r && (r.geometry && r.geometry.dispose(), r.material && r.material.dispose(), this.sRender.scene.remove(r), this.sRender.scene.userData["shape_line_" + e] = null, r = null), r = a.drawLine(i, n, 255), this.sRender.scene.add(r), this.sRender.scene.userData["shape_line_" + e] = r
  23577. }
  23578. };
  23579. var p = new n.MeshBasicMaterial({
  23580. color: 65280,
  23581. side: n.FrontSide,
  23582. transparent: !0,
  23583. opacity: .2,
  23584. depthTest: !0,
  23585. depthWrite: !1
  23586. }),
  23587. f = {};
  23588. h.prototype.computeCrossFace = function(t, e, i, r, o) {
  23589. var a = this;
  23590. this.destroyCrossFace(o);
  23591. var s = new n.Group;
  23592. this.sRender.scene.add(s), o.userData.face_group = s, r.forEach((function(n) {
  23593. for (var r = n.geometry.vertices, s = n.geometry.faces, l = 0, u = s.length; l < u; ++l) {
  23594. var h = s[l];
  23595. a.computeCurrentFace(h, r, t, e, i, n, o)
  23596. }
  23597. })), f = {}
  23598. }, h.prototype.computeCurrentFace = function(t, e, i, r, o, a, s) {
  23599. var l = s.userData.face_group,
  23600. u = t.normal.clone(),
  23601. h = e[t.a].clone(),
  23602. c = e[t.b].clone(),
  23603. d = e[t.c].clone(),
  23604. m = 0,
  23605. g = new n.Triangle;
  23606. g.set(h, c, d);
  23607. var v = g.getMidpoint(new n.Vector3),
  23608. y = "uuid_" + a.uuid + "face_" + t.a + "_" + t.b + "_" + t.c;
  23609. if (f[y]) m = 1;
  23610. else {
  23611. var b = (new n.Vector3)
  23612. .subVectors(v, i),
  23613. w = (new n.Vector3)
  23614. .subVectors(r, i),
  23615. x = Math.acos(b.clone()
  23616. .normalize()
  23617. .dot(w.clone()
  23618. .normalize())),
  23619. M = n.Math.radToDeg(x);
  23620. if (M <= o || Math.abs(o - M) < 1.125) b.clone()
  23621. .projectOnVector(w.clone())
  23622. .length() <= w.length() && (m = 1, f[y] = 1, this.computeBarrier(i, v) && (m = 0))
  23623. }
  23624. if (1 === m) {
  23625. var T = new n.Geometry;
  23626. T.vertices[0] = e[t.a].clone(), T.vertices[1] = e[t.b].clone(), T.vertices[2] = e[t.c].clone(), T.faces.push(new n.Face3(0, 1, 2));
  23627. var S = new n.Mesh(T, p);
  23628. S.position.add(u.divideScalar(1e3)
  23629. .clone()), l.add(S)
  23630. }
  23631. }, h.prototype.computeFilterColliders = function(t, e, i) {
  23632. var r = [],
  23633. o = {};
  23634. this.player.hideWireFrame();
  23635. for (var a = 0, s = t.length; a < s; ++a) {
  23636. var l = t[a];
  23637. l.geometry.computeBoundingBox();
  23638. var u = l.geometry.boundingBox,
  23639. h = u.getCenter(new n.Vector3),
  23640. c = u.containsPoint(e),
  23641. d = u.containsPoint(i),
  23642. p = h.distanceTo(e) <= e.distanceTo(i),
  23643. f = 0;
  23644. (c || d || p) && (! function t() {
  23645. f = Math.random(), o["_" + f] && t(), o["_" + f] = 1
  23646. }(), this.player.addWireFrame(l, 16777215 * f * 10), r.push(l))
  23647. }
  23648. return r
  23649. }, h.prototype.computeFilterColliders2 = function(t, e) {
  23650. var i = t.userData.box_helper;
  23651. i ? i.update() : (i = new n.BoxHelper(t, 16711680), this.sRender.scene.add(i), t.userData.box_helper = i);
  23652. var r = this.sRender.scene.userData.cone_box_cube;
  23653. r && (r.geometry && r.geometry.dispose(), r.material && r.material.dispose(), this.sRender.scene.remove(r)), (r = this.initBoundingCube(i, 2, 16711680))
  23654. .geometry.computeBoundingBox(), this.sRender.scene.add(r), this.sRender.scene.userData.cone_box_cube = r;
  23655. var o = r.geometry.vertices,
  23656. a = new n.Raycaster,
  23657. s = r.position.clone(),
  23658. l = new n.Vector3;
  23659. this.player.hideWireFrame();
  23660. for (var u = 0, h = o.length; u < h; ++u) {
  23661. var c = o[u].applyMatrix4(r.matrixWorld);
  23662. l.subVectors(c, s), a.set(s, l, 1);
  23663. var d = a.intersectObjects(this.newCollidersBoxCube);
  23664. if (0 < d.length)
  23665. for (var p = 0; p < d.length; ++p) {
  23666. var f = d[p].object.userData.collider;
  23667. this.player.addWireFrame(f, 16777215 * Math.random())
  23668. }
  23669. }
  23670. for (u = 0, h = this.newCollidersBoxCube.length; u < h; ++u) {
  23671. var m = this.newCollidersBoxCube[u];
  23672. m.geometry.computeBoundingBox();
  23673. m.geometry.boundingBox.getCenter(new n.Vector3)
  23674. .applyMatrix4(m.matrixWorld);
  23675. for (var g = m.geometry.vertices, v = (p = 0, g.length); p < v; ++p) {
  23676. c = g[p].applyMatrix4(m.matrixWorld);
  23677. if (r.geometry.boundingBox.containsPoint(c)) {
  23678. f = m.userData.collider;
  23679. this.player.addWireFrame(f, 16777215 * Math.random())
  23680. }
  23681. }
  23682. }
  23683. return []
  23684. }, h.prototype.computeLabelBarrier = function(t, e) {
  23685. for (var i = new n.Raycaster, r = 0, o = this.putModels.length; r < o; ++r) {
  23686. var a = this.putModels[r],
  23687. s = a.userData.virtual_camera,
  23688. l = a.userData.setting_item;
  23689. s.geometry.computeBoundingBox();
  23690. var u = s.geometry.boundingBox.getCenter(new n.Vector3);
  23691. u = u.clone()
  23692. .applyMatrix4(s.matrixWorld);
  23693. var h = new n.Vector3;
  23694. h.subVectors(t.position, u)
  23695. .normalize(), i.set(u, h, 1);
  23696. var c = i.intersectObjects(e);
  23697. if (0 < c.length) c[0].distance < u.distanceTo(t.position) ? l.isBarrier = !0 : l.isBarrier = !1;
  23698. else l.isBarrier = !1
  23699. }
  23700. };
  23701. var m = new n.Raycaster,
  23702. g = new n.Vector3;
  23703. h.prototype.computeBarrier = function(t, e) {
  23704. g.subVectors(e, t), m.set(t, g.normalize());
  23705. var i = m.intersectObjects(this.newColliders),
  23706. n = t.distanceTo(e);
  23707. if (0 < i.length) {
  23708. var r = i[0].distance;
  23709. if (r < n && n - r > .01) return !0
  23710. }
  23711. return !1
  23712. }, h.prototype.computeLabelPosition = function(t) {
  23713. t.geometry.computeBoundingBox();
  23714. var e = t.geometry.boundingBox.getSize(new n.Vector3),
  23715. i = t.position.clone()
  23716. .applyMatrix4(t.matrixWorld);
  23717. return i.y += e.y, i
  23718. }, h.prototype.computeSpaceData = function(t, e) {
  23719. var i = t.userData.setting_item,
  23720. r = t.userData.virtual_camera;
  23721. e && (this.destroySpaceData(t), r.material.opacity = .7);
  23722. for (var s = o.getVerticesOfItemSize(r.geometry), l = r.position.clone()
  23723. .applyMatrix4(r.matrixWorld), u = s[s.length - 2].clone()
  23724. .applyMatrix4(r.matrixWorld), h = s[s.length - 1].clone()
  23725. .applyMatrix4(r.matrixWorld), c = new n.Vector3(1, 0, 0), d = (new n.Vector3(-1, 0, 0), new n.Vector3(0, 1, 0), new n.Vector3(0, -1, 0)), p = (new n.Vector3(0, 0, 1), new n.Vector3(0, 0, -1)), f = ((new n.Vector3)
  23726. .subVectors(h, u)
  23727. .normalize(), [c, d, p]), m = new n.Raycaster, g = t.userData.axle_wire.userData.direct_vector, v = 0, y = f.length; v < y; ++v) {
  23728. var b = f[v];
  23729. m.set(l, b, 1);
  23730. var w = m.intersectObjects(this.colliders);
  23731. if (0 < w.length) {
  23732. var x = w[0],
  23733. M = x.point,
  23734. T = x.distance,
  23735. S = "axis_" + b.x + "_" + b.y + "_" + b.z;
  23736. i.directionDistanceType[S] = T;
  23737. var _ = g.clone()
  23738. .normalize()
  23739. .dot(b.clone()
  23740. .normalize()),
  23741. A = Math.acos(_) / (Math.PI / 180);
  23742. if (i.axleWireWidthDirectionRotate[S] = A, !0 === e) {
  23743. var P = a.drawFatLine(l, M, 16776960, 1.4);
  23744. P.material.depthWrite = !1, t.userData.space_data.push(P);
  23745. var C = l.clone(),
  23746. E = M.clone(),
  23747. D = new n.Line3(C, E)
  23748. .getCenter(new n.Vector3),
  23749. L = this.addMeasureLabel(D, T, P, S);
  23750. P.userData.label = L, this.sRender.scene.add(P), this.sRender.scene.add(L), i.hasSpaceData = !0
  23751. }
  23752. }
  23753. }
  23754. }, h.prototype.computeRotateAngle = function(t) {
  23755. for (var e = t.userData.setting_item, i = t.userData.virtual_camera, r = i.position.clone()
  23756. .applyMatrix4(i.matrixWorld), o = t.userData.axle_wire.userData.direct_vector, a = new n.Raycaster, s = [new n.Vector3(1, 0, 0), new n.Vector3(0, -1, 0), new n.Vector3(0, 0, -1)], l = 0, u = s.length; l < u; ++l) {
  23757. var h = s[l];
  23758. if (a.set(r, h, 1), 0 < a.intersectObjects(this.colliders)
  23759. .length) {
  23760. var c = "axis_" + h.x + "_" + h.y + "_" + h.z,
  23761. d = o.clone()
  23762. .normalize()
  23763. .dot(h.clone()
  23764. .normalize()),
  23765. p = Math.acos(d) / (Math.PI / 180);
  23766. e.axleWireWidthDirectionRotate[c] = p
  23767. }
  23768. }
  23769. this.player.emit("update-ui-rotate", e.axleWireWidthDirectionRotate)
  23770. }, h.prototype.addMeasureLabel = function(t, e, i, n) {
  23771. var r = {
  23772. "axis_0_-1_0": "离地",
  23773. "axis_0_0_-1": "后边",
  23774. axis_1_0_0: "侧边"
  23775. },
  23776. o = {
  23777. text: (r[n] ? r[n] + " " : "") + e.toFixed(2) + "m",
  23778. fontSize: 14,
  23779. fontFace: "Arial",
  23780. renderDom: this.sRender.renderer.domElement
  23781. },
  23782. a = new l(o);
  23783. return a.scale.set(.0015, .0015, .0015), a.position.copy(t), a
  23784. }, h.prototype.addAxleWire = function(t, e) {
  23785. if (!t.userData.axle_wire) {
  23786. var i = t.userData.cone,
  23787. r = t.userData.virtual_camera,
  23788. o = i.geometry.vertices,
  23789. s = r.position.clone()
  23790. .applyMatrix4(r.matrixWorld),
  23791. l = e || i.localToWorld(o[o.length - 1].clone()),
  23792. u = new n.Vector3,
  23793. h = a.drawLine(s, l, 16777215);
  23794. h.userData.startVec = s, h.userData.endVec = l, h.userData.direct_vector = u.subVectors(l, s), t.userData.axle_wire = h;
  23795. var c = {
  23796. positions: h.geometry.vertices,
  23797. fov: t.FOV,
  23798. distance: t.DISTANCE,
  23799. quaternion: t.quaternion
  23800. };
  23801. this.sRender.emit("virtual-update-position", c), this.computeRotateAngle(t)
  23802. }
  23803. }, h.prototype.switchSpaceDataVisible = function(t, e) {
  23804. var i = t.userData.space_data;
  23805. if (i && 0 < i.length)
  23806. for (var n = 0, r = i.length; n < r; ++n) {
  23807. var o = i[n];
  23808. if (o.visible = e, o.userData.label) o.userData.label.visible = e
  23809. }
  23810. }, h.prototype.destroyAxleWire = function(t) {
  23811. var e = t.userData.axle_wire;
  23812. e && (e.material && e.material.dispose(), e.geometry && e.geometry.dispose(), this.sRender.scene.remove(e), t.userData.axle_wire = null)
  23813. }, h.prototype.destroyBoxHelper = function(t) {
  23814. var e = t.userData.box_helper;
  23815. e && (e.geometry && e.geometry.dispose(), e.material && e.material.dispose(), this.sRender.scene.remove(e), t.userData.box_helper = null)
  23816. }, h.prototype.destroyControl = function(t) {
  23817. var e = t.userData.transform_control;
  23818. e && (t.userData.handle_choosed = !1, t.userData.transform_control = null, e.dispose(), e.detach(), this.sRender.scene.remove(e), this.controls.splice(this.controls.indexOf(e), 1))
  23819. }, h.prototype.destroyPositionLine = function() {
  23820. if (this.sRender.scene.userData.position_line) {
  23821. var t = this.sRender.scene.userData.position_line;
  23822. this.sRender.scene.userData.position_line = null, this.sRender.scene.remove(t), t.geometry.dispose(), t.material.dispose()
  23823. }
  23824. }, h.prototype.destroyModelControlState = function(t) {
  23825. (t = t || this.VIRTUAL_CAMERA) && (this.destroyBoxHelper(t), this.destroyControl(t), this.VIRTUAL_CAMERA = null, this.player.emit("hidePutModelSetTools"), this.player.emit("hidePutModelInfoPanel"), this.emitter.emit("virtualCamera-unchoosed"))
  23826. }, h.prototype.destroyModelFromScene = function(t) {
  23827. (t = t || this.VIRTUAL_CAMERA) && (this.destroyBoxHelper(t), this.destroyControl(t), t.traverse((function(t) {
  23828. t.material && t.material.dispose(), t.geometry && t.geometry.dispose()
  23829. })), this.sRender.scene.remove(t), this.destroyPlaceMonitor(t), this.destroyCrossFace(t), this.destroyAxleWire(t))
  23830. }, h.prototype.destroyPlaceMonitor = function(t) {
  23831. var e = t.userData.cone,
  23832. i = e.userData.place_monitor;
  23833. i && (i.traverse((function(t) {
  23834. t.isMesh && (t.geometry.dispose(), t.material.dispose())
  23835. })), this.sRender.scene.remove(i), e.userData.place_monitor = null)
  23836. }, h.prototype.destroyCrossFace = function(t) {
  23837. var e = t.userData.face_group;
  23838. e && (e.traverse((function(t) {
  23839. t.isMesh && (t.geometry.dispose(), t.material.dispose())
  23840. })), this.sRender.scene.remove(e), t.userData.face_group = null)
  23841. }, h.prototype.destroySpaceData = function(t) {
  23842. t.userData.virtual_camera.material.opacity = 1;
  23843. var e = t.userData.space_data,
  23844. i = t.userData.setting_item;
  23845. if (e && 0 < e.length) {
  23846. for (var n = 0, r = e.length; n < r; ++n) {
  23847. var o = e[n];
  23848. if (o.geometry && o.geometry.dispose(), o.material && o.material.dispose(), this.sRender.scene.remove(o), o.userData.label) {
  23849. var a = o.userData.label;
  23850. a.geometry && a.geometry.dispose(), a.material && a.material.dispose(), this.sRender.scene.remove(a)
  23851. }
  23852. }
  23853. i.hasSpaceData = !1
  23854. }
  23855. e = [], t.userData.space_data = []
  23856. }, h.prototype.restoreOriginSetting = function() {
  23857. if (this.VIRTUAL_CAMERA) {
  23858. var t = this.VIRTUAL_CAMERA,
  23859. e = t.userData.cone,
  23860. i = t.userData.setting_item;
  23861. this.destroyPlaceMonitor(t), this.destroyCrossFace(t), t.FOV = i.FOV_MIN, t.DISTANCE = i.DISTANCE_MIN, e.visible = !0, i.FOV = i.FOV_MIN, i.DISTANCE = i.DISTANCE_MIN, this.player.emit("resetPutModelInfo", i), this.updateAxleWire(t)
  23862. }
  23863. }, h.prototype.updateBoxHelper = function(t) {
  23864. var e = t.userData.box_helper;
  23865. e && e.update()
  23866. }, h.prototype.updateControlPosition = function(t, e) {
  23867. t.currentWorldPosition.copy(e)
  23868. }, h.prototype.updateSetToolsPosition = function(t) {
  23869. var e = t.position.clone()
  23870. .applyMatrix4(t.matrixWorld);
  23871. if (o.computeWorldPositionOutCamera(e.clone(), this.sRender.camera)) t.userData.out_screen = !0, this.player.emit("hidePutModelSetTools");
  23872. else {
  23873. t.userData.out_screen = !1;
  23874. var i = o.convertWorldPositionToScreen(e, this.sRender.camera);
  23875. this.player.emit("setPutModelToolsPosition", i)
  23876. }
  23877. }, h.prototype.updateVirtualCameraFov = function(t) {
  23878. var e = this.VIRTUAL_CAMERA;
  23879. e && (e.userData.cone.visible = !0, e.FOV = t, this.updateAxleWire(e), this.destroyPlaceMonitor(e), this.destroyCrossFace(e))
  23880. }, h.prototype.updateVirtualCameraDistance = function(t) {
  23881. var e = this.VIRTUAL_CAMERA;
  23882. e && (e.userData.cone.visible = !0, e.DISTANCE = t, this.updateAxleWire(e), this.destroyPlaceMonitor(e), this.destroyCrossFace(e))
  23883. }, h.prototype.updateModelName = function(t) {
  23884. if (this.VIRTUAL_CAMERA) {
  23885. this.VIRTUAL_CAMERA.userData.virtual_camera;
  23886. this.VIRTUAL_CAMERA.userData.setting_item.modelName = t
  23887. }
  23888. }, h.prototype.updateLabelPosition = function(t, e) {
  23889. var i = t.userData.virtual_camera,
  23890. n = i.position.clone()
  23891. .applyMatrix4(i.matrixWorld);
  23892. o.computeWorldPositionOutCamera(n, this.sRender.camera) ? e.isLabelShow = !1 : t.userData.handle_choosed || (e.isLabelShow = !0);
  23893. var r = o.convertWorldPositionToScreen(n, this.sRender.camera);
  23894. e.labelPosition2 = r
  23895. }, h.prototype.updateAllLabelPosition = function(t, e) {
  23896. if (0 < t.length)
  23897. for (var i = t, n = 0, r = i.length; n < r; ++n) {
  23898. var o = i[n],
  23899. a = o.userData.setting_item;
  23900. e && (a.isLabelShow = !0), this.updateLabelPosition(o, a), this.initLabel(a)
  23901. }
  23902. }, h.prototype.updateAxleWire = function(t, e) {
  23903. this.destroyAxleWire(t), this.addAxleWire(t, e)
  23904. }, h.prototype.update = function() {
  23905. if (0 < this.controls.length)
  23906. for (var t = 0, e = this.controls.length; t < e; ++t) this.controls[t].update();
  23907. this.VIRTUAL_CAMERA && (this.updateBoxHelper(this.VIRTUAL_CAMERA), this.VIRTUAL_CAMERA.userData.cone.material.clippingPlanes = this.sRender.clipPlanes);
  23908. this.player && 0 === this.colliders.length && (this.colliders = this.player.model.floors.reduce((function(t, e) {
  23909. return e.hidden ? t : t.concat(e.collider.children)
  23910. }), []))
  23911. }, t.exports = h
  23912. }, function(t, e, i) {
  23913. "use strict";
  23914. var n = i(0),
  23915. r = i(13);
  23916. function o(t) {
  23917. n.Sprite.call(this), this.geometry = new n.PlaneBufferGeometry, this.init(t)
  23918. }
  23919. o.prototype = Object.create(n.Sprite.prototype), o.prototype.init = function(t) {
  23920. var e = r.initCanvasLabel(t, "rgba( 255, 255, 255, 1 )", "rgba( 0, 0, 0, 1 )"),
  23921. i = e.texture,
  23922. o = e.canvas;
  23923. this.width = o.width, this.height = o.height, this.material = new n.ShaderMaterial({
  23924. uniforms: {
  23925. tDiffuse: {
  23926. value: i
  23927. },
  23928. width: {
  23929. value: o.width
  23930. },
  23931. height: {
  23932. value: o.height
  23933. },
  23934. domWidth: {
  23935. value: t.renderDom.width
  23936. },
  23937. domHeight: {
  23938. value: t.renderDom.height
  23939. }
  23940. },
  23941. vertexShader: ["precision highp float;", "uniform float width;", "uniform float height;", "uniform float domWidth;", "uniform float domHeight;", "varying vec2 vUv;", "void main() {", "vUv = uv;", "vec4 proj = projectionMatrix * modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0);", "gl_Position = vec4(", "proj.x / proj.w + position.x * width / domWidth * 2.0,", "proj.y / proj.w + position.y * height / domHeight * 2.0,", "proj.z / proj.w,", "1.0", ");", "}"].join("\n"),
  23942. fragmentShader: ["precision highp float;", "uniform sampler2D tDiffuse;", "uniform float width;", "uniform float height;", "varying vec2 vUv;", "void main() {", "vec2 _uv = vec2(", "(floor(vUv.s * width) + 0.5) / width,", "(floor(vUv.t * height) + 0.5) / height", ");", "gl_FragColor = texture2D( tDiffuse, _uv );", "}"].join("\n"),
  23943. transparent: !0
  23944. })
  23945. }, t.exports = o
  23946. }, function(t, e, i) {
  23947. "use strict";
  23948. var n = i(0),
  23949. r = (i(142), i(13));
  23950. function o(t) {
  23951. this._canbeUsed = !1, this.player = t, this.HUMAN = null, this.INTERSETCT_SKIN = null, this.ray = new n.Raycaster, this.clock = new n.Clock, this.MOUSE = {
  23952. btn_0: "LEFT_BUTTON",
  23953. btn_2: "RIGHT_BUTTON"
  23954. }, this.startPosition = new n.Vector3, this.mixer = null, this.actions = [], this.idleAction = null, this.walkAction = null, this.actionMode = "", this.walkSpeed = .022, this.defineProperty(), this.initStateEngine(), this.endPosition = null
  23955. }
  23956. o.prototype.defineProperty = function() {
  23957. Object.defineProperty(this, "canbeUsed", {
  23958. get: function() {
  23959. return this._canbeUsed
  23960. },
  23961. set: function(t) {
  23962. this._canbeUsed = t
  23963. }
  23964. })
  23965. }, o.prototype.init = function(t) {
  23966. this.HUMAN = t, this.HUMAN.userData.skeleton_box = null, this.HUMAN.userData.skeleton_helper = null, this.initSkeletonHelper(this.HUMAN), this.initSkeletonBox(this.HUMAN)
  23967. }, o.prototype.initStateEngine = function() {
  23968. this.ActionStateEngine = {
  23969. WALK: {
  23970. state: !1,
  23971. status: {
  23972. start_fade: {
  23973. state: !1,
  23974. callback: this.runFadeOfIdleToWalk
  23975. },
  23976. fading: function() {},
  23977. end_fade: {
  23978. state: !1,
  23979. callback: this.runFadeOfIdleToWalkEnd
  23980. }
  23981. }
  23982. },
  23983. IDLE: {
  23984. state: !1,
  23985. status: {
  23986. start_fade: {
  23987. state: !1,
  23988. callback: this.runFadeOfWalkToIdle
  23989. },
  23990. fading: function() {},
  23991. end_fade: {
  23992. state: !1,
  23993. callback: this.runFadeOfWalkToIdleEnd
  23994. }
  23995. }
  23996. }
  23997. }, this.MouseStateMachine = {
  23998. LEFT_BUTTON: {
  23999. state: !1,
  24000. status: {
  24001. mousedown: {
  24002. state: !1,
  24003. callback: this.handleMouseLeftButtonDown
  24004. },
  24005. mouseup: {
  24006. state: !1,
  24007. callback: this.handleMouseLeftButtonUp
  24008. }
  24009. }
  24010. },
  24011. RIGHT_BUTTON: {
  24012. state: !1,
  24013. status: {
  24014. mousedown: {
  24015. state: !1,
  24016. callback: function() {}
  24017. },
  24018. mouseup: {
  24019. state: !1,
  24020. callback: this.handleMouseRightButtonUp
  24021. }
  24022. }
  24023. },
  24024. MOVE: {
  24025. state: !1,
  24026. callback: this.handleMouseMove
  24027. },
  24028. LEAVE: {
  24029. state: !1,
  24030. callback: function() {}
  24031. }
  24032. }
  24033. }, o.prototype.initSkeletonHelper = function(t) {
  24034. if (!t.userData.skeleton_helper) {
  24035. var e = new n.SkeletonHelper(t);
  24036. t.userData.skeleton_helper = e, this.player.sRender.scene.add(e)
  24037. }
  24038. }, o.prototype.initSkeletonBox = function(t) {
  24039. if (!t.userData.skeleton_box) {
  24040. var e = t.userData.skeleton_helper,
  24041. i = new n.BoxHelper(e, 5756395);
  24042. i.geometry.computeBoundingBox(), i.userData.bottom_center_position = null, t.userData.skeleton_box = i, this.player.sRender.scene.add(i)
  24043. }
  24044. };
  24045. o.prototype.initAction = function(t) {
  24046. this.mixer = new n.AnimationMixer(t), t.userData.mixer = this.mixer, this.idleAction = this.mixer.clipAction(this.HUMAN.animations[0]), this.walkAction = this.mixer.clipAction(this.HUMAN.animations[3]), this.idleAction.name = "idle", this.walkAction.name = "walk", this.actions = [this.idleAction, this.walkAction], this.activateAllActions()
  24047. }, o.prototype.handleWalk = function() {
  24048. this.ActionStateEngine.WALK.state || (this.ActionStateEngine.WALK.state = !0, this.ActionStateEngine.IDLE.state = !1, this.ActionStateEngine.IDLE.status.start_fade.state = !1, this.ActionStateEngine.IDLE.status.end_fade.state = !1, this.ActionStateEngine.WALK.status.start_fade.callback.call(this, 0))
  24049. }, o.prototype.handleWalkAssign = function(t) {
  24050. this.endPosition = t
  24051. }, o.prototype.handleIdle = function() {
  24052. this.ActionStateEngine.IDLE.state || (this.ActionStateEngine.IDLE.state = !0, this.ActionStateEngine.WALK.state = !1, this.ActionStateEngine.WALK.status.start_fade.state = !1, this.ActionStateEngine.WALK.status.end_fade.state = !1, this.ActionStateEngine.IDLE.status.start_fade.callback.call(this, 0))
  24053. }, o.prototype.handleMouseMove = function() {
  24054. this.HUMAN && this.HUMAN.userData.follow_mouse && this.HUMAN.position.copy(this.player.intersect.point)
  24055. }, o.prototype.handleMouseLeftButtonDown = function() {
  24056. if (this.HUMAN && !this.HUMAN.userData.follow_mouse) {
  24057. this.player.disableNavigator = !0;
  24058. var t = r.drawLine(this.HUMAN.position, this.player.intersect.point, 255);
  24059. this.player.sRender.scene.add(t), this.player.sRender.scene.userData.walk_line = t, this.HUMAN.lookAt(this.player.intersect.point), this.HUMAN.rotateY(Math.PI), this.startPosition = this.HUMAN.position.clone(), this.handleWalk()
  24060. }
  24061. }, o.prototype.handleMouseLeftButtonUp = function() {
  24062. var t = this.player.sRender.scene.userData.walk_line;
  24063. t && (t.geometry.dispose(), t.material.dispose(), this.player.sRender.scene.remove(t), this.player.sRender.scene.userData.walk_line = null), this.HUMAN && (this.handleIdle(), this.player.disableNavigator = !0)
  24064. }, o.prototype.handleMouseRightButtonUp = function() {
  24065. this.HUMAN && this.HUMAN.userData.follow_mouse && (this.HUMAN.userData.follow_mouse = !1, this.initAction(this.HUMAN))
  24066. }, o.prototype.runFadeOfIdleToWalk = function(t) {
  24067. var e = this;
  24068. this.setWeight(this.walkAction, 1), this.ActionStateEngine.WALK.status.start_fade.state = !0, this.ActionStateEngine.WALK.status.end_fade.state = !1, this.idleAction.crossFadeTo(this.walkAction, t, !0);
  24069. var i = setTimeout((function() {
  24070. e.ActionStateEngine.WALK.status.start_fade.state = !1, e.ActionStateEngine.WALK.status.end_fade.state = !0, e.ActionStateEngine.WALK.status.end_fade.callback.call(e), clearTimeout(i)
  24071. }), 1e3 * t)
  24072. }, o.prototype.runFadeOfIdleToWalkEnd = function() {}, o.prototype.runFadeOfWalkToIdle = function(t) {
  24073. var e = this;
  24074. this.setWeight(this.idleAction, 1), this.ActionStateEngine.IDLE.status.start_fade.state = !0, this.ActionStateEngine.IDLE.status.end_fade.state = !1, this.walkAction.crossFadeTo(this.idleAction, .5, !0);
  24075. var i = setTimeout((function() {
  24076. e.ActionStateEngine.IDLE.status.start_fade.state = !1, e.ActionStateEngine.IDLE.status.end_fade.state = !0, e.ActionStateEngine.IDLE.status.end_fade.callback.call(e), clearTimeout(i)
  24077. }), 1e3 * t)
  24078. }, o.prototype.runFadeOfWalkToIdleEnd = function() {}, o.prototype.runActionOfWalk = function(t, e) {
  24079. t.distanceTo(e);
  24080. var i = e.clone()
  24081. .sub(t)
  24082. .normalize();
  24083. this.HUMAN.position.add(i.clone()
  24084. .multiplyScalar(1.4 * this.walkSpeed))
  24085. }, o.prototype.activateAllActions = function() {
  24086. this.setWeight(this.idleAction, 1), this.setWeight(this.walkAction, 0), this.actions.forEach((function(t) {
  24087. t.play()
  24088. }))
  24089. }, o.prototype.setWeight = function(t, e) {
  24090. t.enabled = !0, t.setEffectiveTimeScale(1), t.setEffectiveWeight(e), 1 === e && (this.actionMode = t.name)
  24091. }, o.prototype.onPlayerMouseMove = function(t) {
  24092. this.MouseStateMachine.MOVE.state = !0, this.MouseStateMachine.MOVE.callback.call(this)
  24093. }, o.prototype.onPlayerMouseDown = function(t) {
  24094. var e = t.button,
  24095. i = this.MOUSE["btn_" + e];
  24096. this.MouseStateMachine.MOVE.state = !1, i && (this.MouseStateMachine[i].state = !0, this.MouseStateMachine[i].status.mousedown.state = !0, this.MouseStateMachine[i].status.mouseup.state = !1, this.MouseStateMachine[i].status.mousedown.callback.call(this))
  24097. }, o.prototype.onPlayerMouseUp = function(t) {
  24098. var e = t.button,
  24099. i = this.MOUSE["btn_" + e];
  24100. this.MouseStateMachine.MOVE.state = !1, i && (this.MouseStateMachine[i].state = !0, this.MouseStateMachine[i].status.mousedown.state = !1, this.MouseStateMachine[i].status.mouseup.state = !0, this.MouseStateMachine[i].status.mouseup.callback.call(this))
  24101. }, o.prototype.updateSkeletonBox = function(t) {
  24102. var e = t.userData.skeleton_box;
  24103. if (e) {
  24104. e.update(), e.geometry.computeBoundingBox();
  24105. var i = e.geometry.boundingBox,
  24106. r = i.getCenter(new n.Vector3),
  24107. o = i.getSize(new n.Vector3),
  24108. a = new n.Vector3(r.x, r.y - .5 * o.y, r.z);
  24109. e.userData.bottom_center_position = a
  24110. }
  24111. };
  24112. o.prototype.updateHumanPosition = function() {
  24113. if (this.HUMAN) {
  24114. var t = this.HUMAN.userData.skeleton_box;
  24115. if (t) t.userData.bottom_center_position.applyMatrix4(this.HUMAN.matrix), this.HUMAN.position.copy(new n.Vector3(this.HUMAN.position.x, this.HUMAN.position.y, this.HUMAN.position.z))
  24116. }
  24117. }, o.prototype.update = function() {
  24118. var t = this.clock.getDelta();
  24119. if (this.HUMAN) {
  24120. this.updateSkeletonBox(this.HUMAN);
  24121. var e = this.HUMAN.userData.mixer;
  24122. e && e.update(t), this.ActionStateEngine.WALK.status.end_fade.state && (this.endPosition ? this.runActionOfWalk(this.startPosition, this.endPosition) : this.player.intersect.point && this.runActionOfWalk(this.startPosition, this.player.intersect.point))
  24123. }
  24124. }, t.exports = o
  24125. }, function(t, e, i) {
  24126. t.exports = function(t) {
  24127. function e(n) {
  24128. if (i[n]) return i[n].exports;
  24129. var r = i[n] = {
  24130. exports: {},
  24131. id: n,
  24132. loaded: !1
  24133. };
  24134. return t[n].call(r.exports, r, r.exports, e), r.loaded = !0, r.exports
  24135. }
  24136. var i = {};
  24137. return e.m = t, e.c = i, e.p = "", e(0)
  24138. }([function(t, e, i) {
  24139. "use strict";
  24140. var n = function(t) {
  24141. return t && t.__esModule ? t : {
  24142. default: t
  24143. }
  24144. }(i(1));
  24145. t.exports = n.default
  24146. }, function(t, e, i) {
  24147. "use strict";
  24148. function n(t) {
  24149. return t && t.__esModule ? t : {
  24150. default: t
  24151. }
  24152. }
  24153. e.__esModule = !0;
  24154. var r = n(i(2)),
  24155. o = n(i(6)),
  24156. a = n(i(3)),
  24157. s = n(i(7)),
  24158. l = n(i(8)),
  24159. u = n(i(10)),
  24160. h = n(i(11)),
  24161. c = n(i(12)),
  24162. d = n(i(13)),
  24163. p = n(i(14)),
  24164. f = n(i(15)),
  24165. m = n(i(16)),
  24166. g = n(i(9)),
  24167. v = n(i(17));
  24168. e.default = {
  24169. color: {
  24170. Color: r.default,
  24171. math: o.default,
  24172. interpret: a.default
  24173. },
  24174. controllers: {
  24175. Controller: s.default,
  24176. BooleanController: l.default,
  24177. OptionController: u.default,
  24178. StringController: h.default,
  24179. NumberController: c.default,
  24180. NumberControllerBox: d.default,
  24181. NumberControllerSlider: p.default,
  24182. FunctionController: f.default,
  24183. ColorController: m.default
  24184. },
  24185. dom: {
  24186. dom: g.default
  24187. },
  24188. gui: {
  24189. GUI: v.default
  24190. },
  24191. GUI: v.default
  24192. }
  24193. }, function(t, e, i) {
  24194. "use strict";
  24195. function n(t) {
  24196. return t && t.__esModule ? t : {
  24197. default: t
  24198. }
  24199. }
  24200. function r(t, e) {
  24201. if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
  24202. }
  24203. function o(t, e, i) {
  24204. Object.defineProperty(t, e, {
  24205. get: function() {
  24206. return "RGB" === this.__state.space || c.recalculateRGB(this, e, i), this.__state[e]
  24207. },
  24208. set: function(t) {
  24209. "RGB" !== this.__state.space && (c.recalculateRGB(this, e, i), this.__state.space = "RGB"), this.__state[e] = t
  24210. }
  24211. })
  24212. }
  24213. function a(t, e) {
  24214. Object.defineProperty(t, e, {
  24215. get: function() {
  24216. return "HSV" === this.__state.space || c.recalculateHSV(this), this.__state[e]
  24217. },
  24218. set: function(t) {
  24219. "HSV" !== this.__state.space && (c.recalculateHSV(this), this.__state.space = "HSV"), this.__state[e] = t
  24220. }
  24221. })
  24222. }
  24223. e.__esModule = !0;
  24224. var s = n(i(3)),
  24225. l = n(i(6)),
  24226. u = n(i(4)),
  24227. h = n(i(5)),
  24228. c = function() {
  24229. function t() {
  24230. if (r(this, t), this.__state = s.default.apply(this, arguments), !1 === this.__state) throw new Error("Failed to interpret color arguments");
  24231. this.__state.a = this.__state.a || 1
  24232. }
  24233. return t.prototype.toString = function() {
  24234. return (0, u.default)(this)
  24235. }, t.prototype.toHexString = function() {
  24236. return (0, u.default)(this, !0)
  24237. }, t.prototype.toOriginal = function() {
  24238. return this.__state.conversion.write(this)
  24239. }, t
  24240. }();
  24241. c.recalculateRGB = function(t, e, i) {
  24242. if ("HEX" === t.__state.space) t.__state[e] = l.default.component_from_hex(t.__state.hex, i);
  24243. else {
  24244. if ("HSV" !== t.__state.space) throw new Error("Corrupted color state");
  24245. h.default.extend(t.__state, l.default.hsv_to_rgb(t.__state.h, t.__state.s, t.__state.v))
  24246. }
  24247. }, c.recalculateHSV = function(t) {
  24248. var e = l.default.rgb_to_hsv(t.r, t.g, t.b);
  24249. h.default.extend(t.__state, {
  24250. s: e.s,
  24251. v: e.v
  24252. }), h.default.isNaN(e.h) ? h.default.isUndefined(t.__state.h) && (t.__state.h = 0) : t.__state.h = e.h
  24253. }, c.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"], o(c.prototype, "r", 2), o(c.prototype, "g", 1), o(c.prototype, "b", 0), a(c.prototype, "h"), a(c.prototype, "s"), a(c.prototype, "v"), Object.defineProperty(c.prototype, "a", {
  24254. get: function() {
  24255. return this.__state.a
  24256. },
  24257. set: function(t) {
  24258. this.__state.a = t
  24259. }
  24260. }), Object.defineProperty(c.prototype, "hex", {
  24261. get: function() {
  24262. return "HEX" !== !this.__state.space && (this.__state.hex = l.default.rgb_to_hex(this.r, this.g, this.b)), this.__state.hex
  24263. },
  24264. set: function(t) {
  24265. this.__state.space = "HEX", this.__state.hex = t
  24266. }
  24267. }), e.default = c
  24268. }, function(t, e, i) {
  24269. "use strict";
  24270. function n(t) {
  24271. return t && t.__esModule ? t : {
  24272. default: t
  24273. }
  24274. }
  24275. e.__esModule = !0;
  24276. var r = n(i(4)),
  24277. o = n(i(5)),
  24278. a = [{
  24279. litmus: o.default.isString,
  24280. conversions: {
  24281. THREE_CHAR_HEX: {
  24282. read: function(t) {
  24283. var e = t.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  24284. return null !== e && {
  24285. space: "HEX",
  24286. hex: parseInt("0x" + e[1].toString() + e[1].toString() + e[2].toString() + e[2].toString() + e[3].toString() + e[3].toString(), 0)
  24287. }
  24288. },
  24289. write: r.default
  24290. },
  24291. SIX_CHAR_HEX: {
  24292. read: function(t) {
  24293. var e = t.match(/^#([A-F0-9]{6})$/i);
  24294. return null !== e && {
  24295. space: "HEX",
  24296. hex: parseInt("0x" + e[1].toString(), 0)
  24297. }
  24298. },
  24299. write: r.default
  24300. },
  24301. CSS_RGB: {
  24302. read: function(t) {
  24303. var e = t.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  24304. return null !== e && {
  24305. space: "RGB",
  24306. r: parseFloat(e[1]),
  24307. g: parseFloat(e[2]),
  24308. b: parseFloat(e[3])
  24309. }
  24310. },
  24311. write: r.default
  24312. },
  24313. CSS_RGBA: {
  24314. read: function(t) {
  24315. var e = t.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  24316. return null !== e && {
  24317. space: "RGB",
  24318. r: parseFloat(e[1]),
  24319. g: parseFloat(e[2]),
  24320. b: parseFloat(e[3]),
  24321. a: parseFloat(e[4])
  24322. }
  24323. },
  24324. write: r.default
  24325. }
  24326. }
  24327. }, {
  24328. litmus: o.default.isNumber,
  24329. conversions: {
  24330. HEX: {
  24331. read: function(t) {
  24332. return {
  24333. space: "HEX",
  24334. hex: t,
  24335. conversionName: "HEX"
  24336. }
  24337. },
  24338. write: function(t) {
  24339. return t.hex
  24340. }
  24341. }
  24342. }
  24343. }, {
  24344. litmus: o.default.isArray,
  24345. conversions: {
  24346. RGB_ARRAY: {
  24347. read: function(t) {
  24348. return 3 === t.length && {
  24349. space: "RGB",
  24350. r: t[0],
  24351. g: t[1],
  24352. b: t[2]
  24353. }
  24354. },
  24355. write: function(t) {
  24356. return [t.r, t.g, t.b]
  24357. }
  24358. },
  24359. RGBA_ARRAY: {
  24360. read: function(t) {
  24361. return 4 === t.length && {
  24362. space: "RGB",
  24363. r: t[0],
  24364. g: t[1],
  24365. b: t[2],
  24366. a: t[3]
  24367. }
  24368. },
  24369. write: function(t) {
  24370. return [t.r, t.g, t.b, t.a]
  24371. }
  24372. }
  24373. }
  24374. }, {
  24375. litmus: o.default.isObject,
  24376. conversions: {
  24377. RGBA_OBJ: {
  24378. read: function(t) {
  24379. return !!(o.default.isNumber(t.r) && o.default.isNumber(t.g) && o.default.isNumber(t.b) && o.default.isNumber(t.a)) && {
  24380. space: "RGB",
  24381. r: t.r,
  24382. g: t.g,
  24383. b: t.b,
  24384. a: t.a
  24385. }
  24386. },
  24387. write: function(t) {
  24388. return {
  24389. r: t.r,
  24390. g: t.g,
  24391. b: t.b,
  24392. a: t.a
  24393. }
  24394. }
  24395. },
  24396. RGB_OBJ: {
  24397. read: function(t) {
  24398. return !!(o.default.isNumber(t.r) && o.default.isNumber(t.g) && o.default.isNumber(t.b)) && {
  24399. space: "RGB",
  24400. r: t.r,
  24401. g: t.g,
  24402. b: t.b
  24403. }
  24404. },
  24405. write: function(t) {
  24406. return {
  24407. r: t.r,
  24408. g: t.g,
  24409. b: t.b
  24410. }
  24411. }
  24412. },
  24413. HSVA_OBJ: {
  24414. read: function(t) {
  24415. return !!(o.default.isNumber(t.h) && o.default.isNumber(t.s) && o.default.isNumber(t.v) && o.default.isNumber(t.a)) && {
  24416. space: "HSV",
  24417. h: t.h,
  24418. s: t.s,
  24419. v: t.v,
  24420. a: t.a
  24421. }
  24422. },
  24423. write: function(t) {
  24424. return {
  24425. h: t.h,
  24426. s: t.s,
  24427. v: t.v,
  24428. a: t.a
  24429. }
  24430. }
  24431. },
  24432. HSV_OBJ: {
  24433. read: function(t) {
  24434. return !!(o.default.isNumber(t.h) && o.default.isNumber(t.s) && o.default.isNumber(t.v)) && {
  24435. space: "HSV",
  24436. h: t.h,
  24437. s: t.s,
  24438. v: t.v
  24439. }
  24440. },
  24441. write: function(t) {
  24442. return {
  24443. h: t.h,
  24444. s: t.s,
  24445. v: t.v
  24446. }
  24447. }
  24448. }
  24449. }
  24450. }],
  24451. s = void 0,
  24452. l = void 0;
  24453. e.default = function() {
  24454. l = !1;
  24455. var t = arguments.length > 1 ? o.default.toArray(arguments) : arguments[0];
  24456. return o.default.each(a, (function(e) {
  24457. if (e.litmus(t)) return o.default.each(e.conversions, (function(e, i) {
  24458. if (s = e.read(t), !1 === l && !1 !== s) return l = s, s.conversionName = i, s.conversion = e, o.default.BREAK
  24459. })), o.default.BREAK
  24460. })), l
  24461. }
  24462. }, function(t, e) {
  24463. "use strict";
  24464. e.__esModule = !0, e.default = function(t, e) {
  24465. var i = t.__state.conversionName.toString(),
  24466. n = Math.round(t.r),
  24467. r = Math.round(t.g),
  24468. o = Math.round(t.b),
  24469. a = t.a,
  24470. s = Math.round(t.h),
  24471. l = t.s.toFixed(1),
  24472. u = t.v.toFixed(1);
  24473. if (e || "THREE_CHAR_HEX" === i || "SIX_CHAR_HEX" === i) {
  24474. for (var h = t.hex.toString(16); h.length < 6;) h = "0" + h;
  24475. return "#" + h
  24476. }
  24477. return "CSS_RGB" === i ? "rgb(" + n + "," + r + "," + o + ")" : "CSS_RGBA" === i ? "rgba(" + n + "," + r + "," + o + "," + a + ")" : "HEX" === i ? "0x" + t.hex.toString(16) : "RGB_ARRAY" === i ? "[" + n + "," + r + "," + o + "]" : "RGBA_ARRAY" === i ? "[" + n + "," + r + "," + o + "," + a + "]" : "RGB_OBJ" === i ? "{r:" + n + ",g:" + r + ",b:" + o + "}" : "RGBA_OBJ" === i ? "{r:" + n + ",g:" + r + ",b:" + o + ",a:" + a + "}" : "HSV_OBJ" === i ? "{h:" + s + ",s:" + l + ",v:" + u + "}" : "HSVA_OBJ" === i ? "{h:" + s + ",s:" + l + ",v:" + u + ",a:" + a + "}" : "unknown format"
  24478. }
  24479. }, function(t, e) {
  24480. "use strict";
  24481. e.__esModule = !0;
  24482. var i = Array.prototype.forEach,
  24483. n = Array.prototype.slice,
  24484. r = {
  24485. BREAK: {},
  24486. extend: function(t) {
  24487. return this.each(n.call(arguments, 1), (function(e) {
  24488. (this.isObject(e) ? Object.keys(e) : [])
  24489. .forEach(function(i) {
  24490. this.isUndefined(e[i]) || (t[i] = e[i])
  24491. }.bind(this))
  24492. }), this), t
  24493. },
  24494. defaults: function(t) {
  24495. return this.each(n.call(arguments, 1), (function(e) {
  24496. (this.isObject(e) ? Object.keys(e) : [])
  24497. .forEach(function(i) {
  24498. this.isUndefined(t[i]) && (t[i] = e[i])
  24499. }.bind(this))
  24500. }), this), t
  24501. },
  24502. compose: function() {
  24503. var t = n.call(arguments);
  24504. return function() {
  24505. for (var e = n.call(arguments), i = t.length - 1; i >= 0; i--) e = [t[i].apply(this, e)];
  24506. return e[0]
  24507. }
  24508. },
  24509. each: function(t, e, n) {
  24510. if (t)
  24511. if (i && t.forEach && t.forEach === i) t.forEach(e, n);
  24512. else if (t.length === t.length + 0) {
  24513. var r, o = void 0;
  24514. for (o = 0, r = t.length; o < r; o++)
  24515. if (o in t && e.call(n, t[o], o) === this.BREAK) return
  24516. } else
  24517. for (var a in t)
  24518. if (e.call(n, t[a], a) === this.BREAK) return
  24519. },
  24520. defer: function(t) {
  24521. setTimeout(t, 0)
  24522. },
  24523. debounce: function(t, e) {
  24524. var i = void 0;
  24525. return function() {
  24526. function n() {
  24527. i = null
  24528. }
  24529. var r = this,
  24530. o = arguments,
  24531. a = !i;
  24532. clearTimeout(i), i = setTimeout(n, e), a && t.apply(r, o)
  24533. }
  24534. },
  24535. toArray: function(t) {
  24536. return t.toArray ? t.toArray() : n.call(t)
  24537. },
  24538. isUndefined: function(t) {
  24539. return void 0 === t
  24540. },
  24541. isNull: function(t) {
  24542. return null === t
  24543. },
  24544. isNaN: function(t) {
  24545. function e(e) {
  24546. return t.apply(this, arguments)
  24547. }
  24548. return e.toString = function() {
  24549. return t.toString()
  24550. }, e
  24551. }((function(t) {
  24552. return isNaN(t)
  24553. })),
  24554. isArray: Array.isArray || function(t) {
  24555. return t.constructor === Array
  24556. },
  24557. isObject: function(t) {
  24558. return t === Object(t)
  24559. },
  24560. isNumber: function(t) {
  24561. return t === t + 0
  24562. },
  24563. isString: function(t) {
  24564. return t === t + ""
  24565. },
  24566. isBoolean: function(t) {
  24567. return !1 === t || !0 === t
  24568. },
  24569. isFunction: function(t) {
  24570. return "[object Function]" === Object.prototype.toString.call(t)
  24571. }
  24572. };
  24573. e.default = r
  24574. }, function(t, e) {
  24575. "use strict";
  24576. e.__esModule = !0;
  24577. var i = void 0,
  24578. n = {
  24579. hsv_to_rgb: function(t, e, i) {
  24580. var n = Math.floor(t / 60) % 6,
  24581. r = t / 60 - Math.floor(t / 60),
  24582. o = i * (1 - e),
  24583. a = i * (1 - r * e),
  24584. s = i * (1 - (1 - r) * e),
  24585. l = [
  24586. [i, s, o],
  24587. [a, i, o],
  24588. [o, i, s],
  24589. [o, a, i],
  24590. [s, o, i],
  24591. [i, o, a]
  24592. ][n];
  24593. return {
  24594. r: 255 * l[0],
  24595. g: 255 * l[1],
  24596. b: 255 * l[2]
  24597. }
  24598. },
  24599. rgb_to_hsv: function(t, e, i) {
  24600. var n = Math.min(t, e, i),
  24601. r = Math.max(t, e, i),
  24602. o = r - n,
  24603. a = void 0;
  24604. return 0 === r ? {
  24605. h: NaN,
  24606. s: 0,
  24607. v: 0
  24608. } : (a = t === r ? (e - i) / o : e === r ? 2 + (i - t) / o : 4 + (t - e) / o, (a /= 6) < 0 && (a += 1), {
  24609. h: 360 * a,
  24610. s: o / r,
  24611. v: r / 255
  24612. })
  24613. },
  24614. rgb_to_hex: function(t, e, i) {
  24615. var n = this.hex_with_component(0, 2, t);
  24616. return n = this.hex_with_component(n, 1, e), this.hex_with_component(n, 0, i)
  24617. },
  24618. component_from_hex: function(t, e) {
  24619. return t >> 8 * e & 255
  24620. },
  24621. hex_with_component: function(t, e, n) {
  24622. return n << (i = 8 * e) | t & ~(255 << i)
  24623. }
  24624. };
  24625. e.default = n
  24626. }, function(t, e) {
  24627. "use strict";
  24628. e.__esModule = !0;
  24629. var i = function() {
  24630. function t(e, i) {
  24631. (function(t, e) {
  24632. if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
  24633. })(this, t), this.initialValue = e[i], this.domElement = document.createElement("div"), this.object = e, this.property = i, this.__onChange = void 0, this.__onFinishChange = void 0
  24634. }
  24635. return t.prototype.onChange = function(t) {
  24636. return this.__onChange = t, this
  24637. }, t.prototype.onFinishChange = function(t) {
  24638. return this.__onFinishChange = t, this
  24639. }, t.prototype.setValue = function(t) {
  24640. return this.object[this.property] = t, this.__onChange && this.__onChange.call(this, t), this.updateDisplay(), this
  24641. }, t.prototype.getValue = function() {
  24642. return this.object[this.property]
  24643. }, t.prototype.updateDisplay = function() {
  24644. return this
  24645. }, t.prototype.isModified = function() {
  24646. return this.initialValue !== this.getValue()
  24647. }, t
  24648. }();
  24649. e.default = i
  24650. }, function(t, e, i) {
  24651. "use strict";
  24652. function n(t) {
  24653. return t && t.__esModule ? t : {
  24654. default: t
  24655. }
  24656. }
  24657. e.__esModule = !0;
  24658. var r = n(i(7)),
  24659. o = n(i(9)),
  24660. a = function(t) {
  24661. function e(i, n) {
  24662. ! function(t, e) {
  24663. if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
  24664. }(this, e);
  24665. var r = function(t, e) {
  24666. if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  24667. return !e || "object" != typeof e && "function" != typeof e ? t : e
  24668. }(this, t.call(this, i, n)),
  24669. a = r;
  24670. return r.__prev = r.getValue(), r.__checkbox = document.createElement("input"), r.__checkbox.setAttribute("type", "checkbox"), o.default.bind(r.__checkbox, "change", (function() {
  24671. a.setValue(!a.__prev)
  24672. }), !1), r.domElement.appendChild(r.__checkbox), r.updateDisplay(), r
  24673. }
  24674. return function(t, e) {
  24675. if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e);
  24676. t.prototype = Object.create(e && e.prototype, {
  24677. constructor: {
  24678. value: t,
  24679. enumerable: !1,
  24680. writable: !0,
  24681. configurable: !0
  24682. }
  24683. }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e)
  24684. }(e, t), e.prototype.setValue = function(e) {
  24685. var i = t.prototype.setValue.call(this, e);
  24686. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), this.__prev = this.getValue(), i
  24687. }, e.prototype.updateDisplay = function() {
  24688. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"), this.__checkbox.checked = !0) : this.__checkbox.checked = !1, t.prototype.updateDisplay.call(this)
  24689. }, e
  24690. }(r.default);
  24691. e.default = a
  24692. }, function(t, e, i) {
  24693. "use strict";
  24694. function n(t) {
  24695. if ("0" === t || r.default.isUndefined(t)) return 0;
  24696. var e = t.match(a);
  24697. return r.default.isNull(e) ? 0 : parseFloat(e[1])
  24698. }
  24699. e.__esModule = !0;
  24700. var r = function(t) {
  24701. return t && t.__esModule ? t : {
  24702. default: t
  24703. }
  24704. }(i(5)),
  24705. o = {};
  24706. r.default.each({
  24707. HTMLEvents: ["change"],
  24708. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  24709. KeyboardEvents: ["keydown"]
  24710. }, (function(t, e) {
  24711. r.default.each(t, (function(t) {
  24712. o[t] = e
  24713. }))
  24714. }));
  24715. var a = /(\d+(\.\d+)?)px/,
  24716. s = {
  24717. makeSelectable: function(t, e) {
  24718. void 0 !== t && void 0 !== t.style && (t.onselectstart = e ? function() {
  24719. return !1
  24720. } : function() {}, t.style.MozUserSelect = e ? "auto" : "none", t.style.KhtmlUserSelect = e ? "auto" : "none", t.unselectable = e ? "on" : "off")
  24721. },
  24722. makeFullscreen: function(t, e, i) {
  24723. var n = i,
  24724. o = e;
  24725. r.default.isUndefined(o) && (o = !0), r.default.isUndefined(n) && (n = !0), t.style.position = "absolute", o && (t.style.left = 0, t.style.right = 0), n && (t.style.top = 0, t.style.bottom = 0)
  24726. },
  24727. fakeEvent: function(t, e, i, n) {
  24728. var a = i || {},
  24729. s = o[e];
  24730. if (!s) throw new Error("Event type " + e + " not supported.");
  24731. var l = document.createEvent(s);
  24732. switch (s) {
  24733. case "MouseEvents":
  24734. var u = a.x || a.clientX || 0,
  24735. h = a.y || a.clientY || 0;
  24736. l.initMouseEvent(e, a.bubbles || !1, a.cancelable || !0, window, a.clickCount || 1, 0, 0, u, h, !1, !1, !1, !1, 0, null);
  24737. break;
  24738. case "KeyboardEvents":
  24739. var c = l.initKeyboardEvent || l.initKeyEvent;
  24740. r.default.defaults(a, {
  24741. cancelable: !0,
  24742. ctrlKey: !1,
  24743. altKey: !1,
  24744. shiftKey: !1,
  24745. metaKey: !1,
  24746. keyCode: void 0,
  24747. charCode: void 0
  24748. }), c(e, a.bubbles || !1, a.cancelable, window, a.ctrlKey, a.altKey, a.shiftKey, a.metaKey, a.keyCode, a.charCode);
  24749. break;
  24750. default:
  24751. l.initEvent(e, a.bubbles || !1, a.cancelable || !0)
  24752. }
  24753. r.default.defaults(l, n), t.dispatchEvent(l)
  24754. },
  24755. bind: function(t, e, i, n) {
  24756. var r = n || !1;
  24757. return t.addEventListener ? t.addEventListener(e, i, r) : t.attachEvent && t.attachEvent("on" + e, i), s
  24758. },
  24759. unbind: function(t, e, i, n) {
  24760. var r = n || !1;
  24761. return t.removeEventListener ? t.removeEventListener(e, i, r) : t.detachEvent && t.detachEvent("on" + e, i), s
  24762. },
  24763. addClass: function(t, e) {
  24764. if (void 0 === t.className) t.className = e;
  24765. else if (t.className !== e) {
  24766. var i = t.className.split(/ +/); - 1 === i.indexOf(e) && (i.push(e), t.className = i.join(" ")
  24767. .replace(/^\s+/, "")
  24768. .replace(/\s+$/, ""))
  24769. }
  24770. return s
  24771. },
  24772. removeClass: function(t, e) {
  24773. if (e)
  24774. if (t.className === e) t.removeAttribute("class");
  24775. else {
  24776. var i = t.className.split(/ +/),
  24777. n = i.indexOf(e); - 1 !== n && (i.splice(n, 1), t.className = i.join(" "))
  24778. }
  24779. else t.className = void 0;
  24780. return s
  24781. },
  24782. hasClass: function(t, e) {
  24783. return new RegExp("(?:^|\\s+)" + e + "(?:\\s+|$)")
  24784. .test(t.className) || !1
  24785. },
  24786. getWidth: function(t) {
  24787. var e = getComputedStyle(t);
  24788. return n(e["border-left-width"]) + n(e["border-right-width"]) + n(e["padding-left"]) + n(e["padding-right"]) + n(e.width)
  24789. },
  24790. getHeight: function(t) {
  24791. var e = getComputedStyle(t);
  24792. return n(e["border-top-width"]) + n(e["border-bottom-width"]) + n(e["padding-top"]) + n(e["padding-bottom"]) + n(e.height)
  24793. },
  24794. getOffset: function(t) {
  24795. var e = t,
  24796. i = {
  24797. left: 0,
  24798. top: 0
  24799. };
  24800. if (e.offsetParent)
  24801. do {
  24802. i.left += e.offsetLeft, i.top += e.offsetTop, e = e.offsetParent
  24803. } while (e);
  24804. return i
  24805. },
  24806. isActive: function(t) {
  24807. return t === document.activeElement && (t.type || t.href)
  24808. }
  24809. };
  24810. e.default = s
  24811. }, function(t, e, i) {
  24812. "use strict";
  24813. function n(t) {
  24814. return t && t.__esModule ? t : {
  24815. default: t
  24816. }
  24817. }
  24818. e.__esModule = !0;
  24819. var r = n(i(7)),
  24820. o = n(i(9)),
  24821. a = n(i(5)),
  24822. s = function(t) {
  24823. function e(i, n, r) {
  24824. ! function(t, e) {
  24825. if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
  24826. }(this, e);
  24827. var s = function(t, e) {
  24828. if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  24829. return !e || "object" != typeof e && "function" != typeof e ? t : e
  24830. }(this, t.call(this, i, n)),
  24831. l = r,
  24832. u = s;
  24833. return s.__select = document.createElement("select"), a.default.isArray(l) && function() {
  24834. var t = {};
  24835. a.default.each(l, (function(e) {
  24836. t[e] = e
  24837. })), l = t
  24838. }(), a.default.each(l, (function(t, e) {
  24839. var i = document.createElement("option");
  24840. i.innerHTML = e, i.setAttribute("value", t), u.__select.appendChild(i)
  24841. })), s.updateDisplay(), o.default.bind(s.__select, "change", (function() {
  24842. var t = this.options[this.selectedIndex].value;
  24843. u.setValue(t)
  24844. })), s.domElement.appendChild(s.__select), s
  24845. }
  24846. return function(t, e) {
  24847. if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e);
  24848. t.prototype = Object.create(e && e.prototype, {
  24849. constructor: {
  24850. value: t,
  24851. enumerable: !1,
  24852. writable: !0,
  24853. configurable: !0
  24854. }
  24855. }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e)
  24856. }(e, t), e.prototype.setValue = function(e) {
  24857. var i = t.prototype.setValue.call(this, e);
  24858. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), i
  24859. }, e.prototype.updateDisplay = function() {
  24860. return o.default.isActive(this.__select) ? this : (this.__select.value = this.getValue(), t.prototype.updateDisplay.call(this))
  24861. }, e
  24862. }(r.default);
  24863. e.default = s
  24864. }, function(t, e, i) {
  24865. "use strict";
  24866. function n(t) {
  24867. return t && t.__esModule ? t : {
  24868. default: t
  24869. }
  24870. }
  24871. e.__esModule = !0;
  24872. var r = n(i(7)),
  24873. o = n(i(9)),
  24874. a = function(t) {
  24875. function e(i, n) {
  24876. function r() {
  24877. s.setValue(s.__input.value)
  24878. }! function(t, e) {
  24879. if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
  24880. }(this, e);
  24881. var a = function(t, e) {
  24882. if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  24883. return !e || "object" != typeof e && "function" != typeof e ? t : e
  24884. }(this, t.call(this, i, n)),
  24885. s = a;
  24886. return a.__input = document.createElement("input"), a.__input.setAttribute("type", "text"), o.default.bind(a.__input, "keyup", r), o.default.bind(a.__input, "change", r), o.default.bind(a.__input, "blur", (function() {
  24887. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  24888. })), o.default.bind(a.__input, "keydown", (function(t) {
  24889. 13 === t.keyCode && this.blur()
  24890. })), a.updateDisplay(), a.domElement.appendChild(a.__input), a
  24891. }
  24892. return function(t, e) {
  24893. if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e);
  24894. t.prototype = Object.create(e && e.prototype, {
  24895. constructor: {
  24896. value: t,
  24897. enumerable: !1,
  24898. writable: !0,
  24899. configurable: !0
  24900. }
  24901. }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e)
  24902. }(e, t), e.prototype.updateDisplay = function() {
  24903. return o.default.isActive(this.__input) || (this.__input.value = this.getValue()), t.prototype.updateDisplay.call(this)
  24904. }, e
  24905. }(r.default);
  24906. e.default = a
  24907. }, function(t, e, i) {
  24908. "use strict";
  24909. function n(t) {
  24910. return t && t.__esModule ? t : {
  24911. default: t
  24912. }
  24913. }
  24914. function r(t) {
  24915. var e = t.toString();
  24916. return e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  24917. }
  24918. e.__esModule = !0;
  24919. var o = n(i(7)),
  24920. a = n(i(5)),
  24921. s = function(t) {
  24922. function e(i, n, o) {
  24923. ! function(t, e) {
  24924. if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
  24925. }(this, e);
  24926. var s = function(t, e) {
  24927. if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  24928. return !e || "object" != typeof e && "function" != typeof e ? t : e
  24929. }(this, t.call(this, i, n)),
  24930. l = o || {};
  24931. return s.__min = l.min, s.__max = l.max, s.__step = l.step, a.default.isUndefined(s.__step) ? 0 === s.initialValue ? s.__impliedStep = 1 : s.__impliedStep = Math.pow(10, Math.floor(Math.log(Math.abs(s.initialValue)) / Math.LN10)) / 10 : s.__impliedStep = s.__step, s.__precision = r(s.__impliedStep), s
  24932. }
  24933. return function(t, e) {
  24934. if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e);
  24935. t.prototype = Object.create(e && e.prototype, {
  24936. constructor: {
  24937. value: t,
  24938. enumerable: !1,
  24939. writable: !0,
  24940. configurable: !0
  24941. }
  24942. }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e)
  24943. }(e, t), e.prototype.setValue = function(e) {
  24944. var i = e;
  24945. return void 0 !== this.__min && i < this.__min ? i = this.__min : void 0 !== this.__max && i > this.__max && (i = this.__max), void 0 !== this.__step && i % this.__step != 0 && (i = Math.round(i / this.__step) * this.__step), t.prototype.setValue.call(this, i)
  24946. }, e.prototype.min = function(t) {
  24947. return this.__min = t, this
  24948. }, e.prototype.max = function(t) {
  24949. return this.__max = t, this
  24950. }, e.prototype.step = function(t) {
  24951. return this.__step = t, this.__impliedStep = t, this.__precision = r(t), this
  24952. }, e
  24953. }(o.default);
  24954. e.default = s
  24955. }, function(t, e, i) {
  24956. "use strict";
  24957. function n(t) {
  24958. return t && t.__esModule ? t : {
  24959. default: t
  24960. }
  24961. }
  24962. e.__esModule = !0;
  24963. var r = n(i(12)),
  24964. o = n(i(9)),
  24965. a = n(i(5)),
  24966. s = function(t) {
  24967. function e(i, n, r) {
  24968. function s() {
  24969. c.__onFinishChange && c.__onFinishChange.call(c, c.getValue())
  24970. }
  24971. function l(t) {
  24972. var e = d - t.clientY;
  24973. c.setValue(c.getValue() + e * c.__impliedStep), d = t.clientY
  24974. }
  24975. function u() {
  24976. o.default.unbind(window, "mousemove", l), o.default.unbind(window, "mouseup", u), s()
  24977. }! function(t, e) {
  24978. if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
  24979. }(this, e);
  24980. var h = function(t, e) {
  24981. if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  24982. return !e || "object" != typeof e && "function" != typeof e ? t : e
  24983. }(this, t.call(this, i, n, r));
  24984. h.__truncationSuspended = !1;
  24985. var c = h,
  24986. d = void 0;
  24987. return h.__input = document.createElement("input"), h.__input.setAttribute("type", "text"), o.default.bind(h.__input, "change", (function() {
  24988. var t = parseFloat(c.__input.value);
  24989. a.default.isNaN(t) || c.setValue(t)
  24990. })), o.default.bind(h.__input, "blur", (function() {
  24991. s()
  24992. })), o.default.bind(h.__input, "mousedown", (function(t) {
  24993. o.default.bind(window, "mousemove", l), o.default.bind(window, "mouseup", u), d = t.clientY
  24994. })), o.default.bind(h.__input, "keydown", (function(t) {
  24995. 13 === t.keyCode && (c.__truncationSuspended = !0, this.blur(), c.__truncationSuspended = !1, s())
  24996. })), h.updateDisplay(), h.domElement.appendChild(h.__input), h
  24997. }
  24998. return function(t, e) {
  24999. if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e);
  25000. t.prototype = Object.create(e && e.prototype, {
  25001. constructor: {
  25002. value: t,
  25003. enumerable: !1,
  25004. writable: !0,
  25005. configurable: !0
  25006. }
  25007. }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e)
  25008. }(e, t), e.prototype.updateDisplay = function() {
  25009. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(t, e) {
  25010. var i = Math.pow(10, e);
  25011. return Math.round(t * i) / i
  25012. }(this.getValue(), this.__precision), t.prototype.updateDisplay.call(this)
  25013. }, e
  25014. }(r.default);
  25015. e.default = s
  25016. }, function(t, e, i) {
  25017. "use strict";
  25018. function n(t) {
  25019. return t && t.__esModule ? t : {
  25020. default: t
  25021. }
  25022. }
  25023. e.__esModule = !0;
  25024. var r = n(i(12)),
  25025. o = n(i(9)),
  25026. a = function(t) {
  25027. function e(i, n, r, a, s) {
  25028. function l(t) {
  25029. t.preventDefault();
  25030. var e = c.__background.getBoundingClientRect();
  25031. return c.setValue(function(t, e, i, n, r) {
  25032. return n + (t - e) / (i - e) * (r - n)
  25033. }(t.clientX, e.left, e.right, c.__min, c.__max)), !1
  25034. }
  25035. function u() {
  25036. o.default.unbind(window, "mousemove", l), o.default.unbind(window, "mouseup", u), c.__onFinishChange && c.__onFinishChange.call(c, c.getValue())
  25037. }! function(t, e) {
  25038. if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
  25039. }(this, e);
  25040. var h = function(t, e) {
  25041. if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  25042. return !e || "object" != typeof e && "function" != typeof e ? t : e
  25043. }(this, t.call(this, i, n, {
  25044. min: r,
  25045. max: a,
  25046. step: s
  25047. })),
  25048. c = h;
  25049. return h.__background = document.createElement("div"), h.__foreground = document.createElement("div"), o.default.bind(h.__background, "mousedown", (function(t) {
  25050. document.activeElement.blur(), o.default.bind(window, "mousemove", l), o.default.bind(window, "mouseup", u), l(t)
  25051. })), o.default.addClass(h.__background, "slider"), o.default.addClass(h.__foreground, "slider-fg"), h.updateDisplay(), h.__background.appendChild(h.__foreground), h.domElement.appendChild(h.__background), h
  25052. }
  25053. return function(t, e) {
  25054. if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e);
  25055. t.prototype = Object.create(e && e.prototype, {
  25056. constructor: {
  25057. value: t,
  25058. enumerable: !1,
  25059. writable: !0,
  25060. configurable: !0
  25061. }
  25062. }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e)
  25063. }(e, t), e.prototype.updateDisplay = function() {
  25064. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  25065. return this.__foreground.style.width = 100 * e + "%", t.prototype.updateDisplay.call(this)
  25066. }, e
  25067. }(r.default);
  25068. e.default = a
  25069. }, function(t, e, i) {
  25070. "use strict";
  25071. function n(t) {
  25072. return t && t.__esModule ? t : {
  25073. default: t
  25074. }
  25075. }
  25076. e.__esModule = !0;
  25077. var r = n(i(7)),
  25078. o = n(i(9)),
  25079. a = function(t) {
  25080. function e(i, n, r) {
  25081. ! function(t, e) {
  25082. if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
  25083. }(this, e);
  25084. var a = function(t, e) {
  25085. if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  25086. return !e || "object" != typeof e && "function" != typeof e ? t : e
  25087. }(this, t.call(this, i, n)),
  25088. s = a;
  25089. return a.__button = document.createElement("div"), a.__button.innerHTML = void 0 === r ? "Fire" : r, o.default.bind(a.__button, "click", (function(t) {
  25090. return t.preventDefault(), s.fire(), !1
  25091. })), o.default.addClass(a.__button, "button"), a.domElement.appendChild(a.__button), a
  25092. }
  25093. return function(t, e) {
  25094. if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e);
  25095. t.prototype = Object.create(e && e.prototype, {
  25096. constructor: {
  25097. value: t,
  25098. enumerable: !1,
  25099. writable: !0,
  25100. configurable: !0
  25101. }
  25102. }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e)
  25103. }(e, t), e.prototype.fire = function() {
  25104. this.__onChange && this.__onChange.call(this), this.getValue()
  25105. .call(this.object), this.__onFinishChange && this.__onFinishChange.call(this, this.getValue())
  25106. }, e
  25107. }(r.default);
  25108. e.default = a
  25109. }, function(t, e, i) {
  25110. "use strict";
  25111. function n(t) {
  25112. return t && t.__esModule ? t : {
  25113. default: t
  25114. }
  25115. }
  25116. function r(t, e, i, n) {
  25117. t.style.background = "", u.default.each(c, (function(r) {
  25118. t.style.cssText += "background: " + r + "linear-gradient(" + e + ", " + i + " 0%, " + n + " 100%); "
  25119. }))
  25120. }
  25121. e.__esModule = !0;
  25122. var o = n(i(7)),
  25123. a = n(i(9)),
  25124. s = n(i(2)),
  25125. l = n(i(3)),
  25126. u = n(i(5)),
  25127. h = function(t) {
  25128. function e(i, n) {
  25129. function o(t) {
  25130. f(t), a.default.bind(window, "mousemove", f), a.default.bind(window, "mouseup", h)
  25131. }
  25132. function h() {
  25133. a.default.unbind(window, "mousemove", f), a.default.unbind(window, "mouseup", h), p()
  25134. }
  25135. function c() {
  25136. var t = (0, l.default)(this.value);
  25137. !1 !== t ? (v.__color.__state = t, v.setValue(v.__color.toOriginal())) : this.value = v.__color.toString()
  25138. }
  25139. function d() {
  25140. a.default.unbind(window, "mousemove", m), a.default.unbind(window, "mouseup", d), p()
  25141. }
  25142. function p() {
  25143. v.__onFinishChange && v.__onFinishChange.call(v, v.__color.toOriginal())
  25144. }
  25145. function f(t) {
  25146. t.preventDefault();
  25147. var e = v.__saturation_field.getBoundingClientRect(),
  25148. i = (t.clientX - e.left) / (e.right - e.left),
  25149. n = 1 - (t.clientY - e.top) / (e.bottom - e.top);
  25150. return n > 1 ? n = 1 : n < 0 && (n = 0), i > 1 ? i = 1 : i < 0 && (i = 0), v.__color.v = n, v.__color.s = i, v.setValue(v.__color.toOriginal()), !1
  25151. }
  25152. function m(t) {
  25153. t.preventDefault();
  25154. var e = v.__hue_field.getBoundingClientRect(),
  25155. i = 1 - (t.clientY - e.top) / (e.bottom - e.top);
  25156. return i > 1 ? i = 1 : i < 0 && (i = 0), v.__color.h = 360 * i, v.setValue(v.__color.toOriginal()), !1
  25157. }! function(t, e) {
  25158. if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
  25159. }(this, e);
  25160. var g = function(t, e) {
  25161. if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  25162. return !e || "object" != typeof e && "function" != typeof e ? t : e
  25163. }(this, t.call(this, i, n));
  25164. g.__color = new s.default(g.getValue()), g.__temp = new s.default(0);
  25165. var v = g;
  25166. g.domElement = document.createElement("div"), a.default.makeSelectable(g.domElement, !1), g.__selector = document.createElement("div"), g.__selector.className = "selector", g.__saturation_field = document.createElement("div"), g.__saturation_field.className = "saturation-field", g.__field_knob = document.createElement("div"), g.__field_knob.className = "field-knob", g.__field_knob_border = "2px solid ", g.__hue_knob = document.createElement("div"), g.__hue_knob.className = "hue-knob", g.__hue_field = document.createElement("div"), g.__hue_field.className = "hue-field", g.__input = document.createElement("input"), g.__input.type = "text", g.__input_textShadow = "0 1px 1px ", a.default.bind(g.__input, "keydown", (function(t) {
  25167. 13 === t.keyCode && c.call(this)
  25168. })), a.default.bind(g.__input, "blur", c), a.default.bind(g.__selector, "mousedown", (function() {
  25169. a.default.addClass(this, "drag")
  25170. .bind(window, "mouseup", (function() {
  25171. a.default.removeClass(v.__selector, "drag")
  25172. }))
  25173. }));
  25174. var y = document.createElement("div");
  25175. return u.default.extend(g.__selector.style, {
  25176. width: "122px",
  25177. height: "102px",
  25178. padding: "3px",
  25179. backgroundColor: "#222",
  25180. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  25181. }), u.default.extend(g.__field_knob.style, {
  25182. position: "absolute",
  25183. width: "12px",
  25184. height: "12px",
  25185. border: g.__field_knob_border + (g.__color.v < .5 ? "#fff" : "#000"),
  25186. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  25187. borderRadius: "12px",
  25188. zIndex: 1
  25189. }), u.default.extend(g.__hue_knob.style, {
  25190. position: "absolute",
  25191. width: "15px",
  25192. height: "2px",
  25193. borderRight: "4px solid #fff",
  25194. zIndex: 1
  25195. }), u.default.extend(g.__saturation_field.style, {
  25196. width: "100px",
  25197. height: "100px",
  25198. border: "1px solid #555",
  25199. marginRight: "3px",
  25200. display: "inline-block",
  25201. cursor: "pointer"
  25202. }), u.default.extend(y.style, {
  25203. width: "100%",
  25204. height: "100%",
  25205. background: "none"
  25206. }), r(y, "top", "rgba(0,0,0,0)", "#000"), u.default.extend(g.__hue_field.style, {
  25207. width: "15px",
  25208. height: "100px",
  25209. border: "1px solid #555",
  25210. cursor: "ns-resize",
  25211. position: "absolute",
  25212. top: "3px",
  25213. right: "3px"
  25214. }),
  25215. function(t) {
  25216. t.style.background = "", t.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);", t.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", t.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", t.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", t.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  25217. }(g.__hue_field), u.default.extend(g.__input.style, {
  25218. outline: "none",
  25219. textAlign: "center",
  25220. color: "#fff",
  25221. border: 0,
  25222. fontWeight: "bold",
  25223. textShadow: g.__input_textShadow + "rgba(0,0,0,0.7)"
  25224. }), a.default.bind(g.__saturation_field, "mousedown", o), a.default.bind(g.__field_knob, "mousedown", o), a.default.bind(g.__hue_field, "mousedown", (function(t) {
  25225. m(t), a.default.bind(window, "mousemove", m), a.default.bind(window, "mouseup", d)
  25226. })), g.__saturation_field.appendChild(y), g.__selector.appendChild(g.__field_knob), g.__selector.appendChild(g.__saturation_field), g.__selector.appendChild(g.__hue_field), g.__hue_field.appendChild(g.__hue_knob), g.domElement.appendChild(g.__input), g.domElement.appendChild(g.__selector), g.updateDisplay(), g
  25227. }
  25228. return function(t, e) {
  25229. if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e);
  25230. t.prototype = Object.create(e && e.prototype, {
  25231. constructor: {
  25232. value: t,
  25233. enumerable: !1,
  25234. writable: !0,
  25235. configurable: !0
  25236. }
  25237. }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e)
  25238. }(e, t), e.prototype.updateDisplay = function() {
  25239. var t = (0, l.default)(this.getValue());
  25240. if (!1 !== t) {
  25241. var e = !1;
  25242. u.default.each(s.default.COMPONENTS, (function(i) {
  25243. if (!u.default.isUndefined(t[i]) && !u.default.isUndefined(this.__color.__state[i]) && t[i] !== this.__color.__state[i]) return e = !0, {}
  25244. }), this), e && u.default.extend(this.__color.__state, t)
  25245. }
  25246. u.default.extend(this.__temp.__state, this.__color.__state), this.__temp.a = 1;
  25247. var i = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0,
  25248. n = 255 - i;
  25249. u.default.extend(this.__field_knob.style, {
  25250. marginLeft: 100 * this.__color.s - 7 + "px",
  25251. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  25252. backgroundColor: this.__temp.toHexString(),
  25253. border: this.__field_knob_border + "rgb(" + i + "," + i + "," + i + ")"
  25254. }), this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px", this.__temp.s = 1, this.__temp.v = 1, r(this.__saturation_field, "left", "#fff", this.__temp.toHexString()), this.__input.value = this.__color.toString(), u.default.extend(this.__input.style, {
  25255. backgroundColor: this.__color.toHexString(),
  25256. color: "rgb(" + i + "," + i + "," + i + ")",
  25257. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  25258. })
  25259. }, e
  25260. }(o.default),
  25261. c = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  25262. e.default = h
  25263. }, function(t, e, i) {
  25264. "use strict";
  25265. function n(t) {
  25266. return t && t.__esModule ? t : {
  25267. default: t
  25268. }
  25269. }
  25270. function r(t, e, i) {
  25271. var n = document.createElement("li");
  25272. return e && n.appendChild(e), i ? t.__ul.insertBefore(n, i) : t.__ul.appendChild(n), t.onResize(), n
  25273. }
  25274. function o(t, e) {
  25275. var i = t.__preset_select[t.__preset_select.selectedIndex];
  25276. i.innerHTML = e ? i.value + "*" : i.value
  25277. }
  25278. function a(t, e, i) {
  25279. if (i.__li = e, i.__gui = t, C.default.extend(i, {
  25280. options: function(e) {
  25281. if (arguments.length > 1) {
  25282. var n = i.__li.nextElementSibling;
  25283. return i.remove(), l(t, i.object, i.property, {
  25284. before: n,
  25285. factoryArgs: [C.default.toArray(arguments)]
  25286. })
  25287. }
  25288. if (C.default.isArray(e) || C.default.isObject(e)) {
  25289. var r = i.__li.nextElementSibling;
  25290. return i.remove(), l(t, i.object, i.property, {
  25291. before: r,
  25292. factoryArgs: [e]
  25293. })
  25294. }
  25295. },
  25296. name: function(t) {
  25297. return i.__li.firstElementChild.firstElementChild.innerHTML = t, i
  25298. },
  25299. listen: function() {
  25300. return i.__gui.listen(i), i
  25301. },
  25302. remove: function() {
  25303. return i.__gui.remove(i), i
  25304. }
  25305. }), i instanceof T.default) ! function() {
  25306. var t = new M.default(i.object, i.property, {
  25307. min: i.__min,
  25308. max: i.__max,
  25309. step: i.__step
  25310. });
  25311. C.default.each(["updateDisplay", "onChange", "onFinishChange", "step"], (function(e) {
  25312. var n = i[e],
  25313. r = t[e];
  25314. i[e] = t[e] = function() {
  25315. var e = Array.prototype.slice.call(arguments);
  25316. return r.apply(t, e), n.apply(i, e)
  25317. }
  25318. })), P.default.addClass(e, "has-slider"), i.domElement.insertBefore(t.domElement, i.domElement.firstElementChild)
  25319. }();
  25320. else if (i instanceof M.default) {
  25321. var n = function(e) {
  25322. if (C.default.isNumber(i.__min) && C.default.isNumber(i.__max)) {
  25323. var n = i.__li.firstElementChild.firstElementChild.innerHTML,
  25324. r = i.__gui.__listening.indexOf(i) > -1;
  25325. i.remove();
  25326. var o = l(t, i.object, i.property, {
  25327. before: i.__li.nextElementSibling,
  25328. factoryArgs: [i.__min, i.__max, i.__step]
  25329. });
  25330. return o.name(n), r && o.listen(), o
  25331. }
  25332. return e
  25333. };
  25334. i.min = C.default.compose(n, i.min), i.max = C.default.compose(n, i.max)
  25335. } else i instanceof w.default ? (P.default.bind(e, "click", (function() {
  25336. P.default.fakeEvent(i.__checkbox, "click")
  25337. })), P.default.bind(i.__checkbox, "click", (function(t) {
  25338. t.stopPropagation()
  25339. }))) : i instanceof x.default ? (P.default.bind(e, "click", (function() {
  25340. P.default.fakeEvent(i.__button, "click")
  25341. })), P.default.bind(e, "mouseover", (function() {
  25342. P.default.addClass(i.__button, "hover")
  25343. })), P.default.bind(e, "mouseout", (function() {
  25344. P.default.removeClass(i.__button, "hover")
  25345. }))) : i instanceof S.default && (P.default.addClass(e, "color"), i.updateDisplay = C.default.compose((function(t) {
  25346. return e.style.borderLeftColor = i.__color.toString(), t
  25347. }), i.updateDisplay), i.updateDisplay());
  25348. i.setValue = C.default.compose((function(e) {
  25349. return t.getRoot()
  25350. .__preset_select && i.isModified() && o(t.getRoot(), !0), e
  25351. }), i.setValue)
  25352. }
  25353. function s(t, e) {
  25354. var i = t.getRoot(),
  25355. n = i.__rememberedObjects.indexOf(e.object);
  25356. if (-1 !== n) {
  25357. var r = i.__rememberedObjectIndecesToControllers[n];
  25358. if (void 0 === r && (r = {}, i.__rememberedObjectIndecesToControllers[n] = r), r[e.property] = e, i.load && i.load.remembered) {
  25359. var o = i.load.remembered,
  25360. a = void 0;
  25361. if (o[t.preset]) a = o[t.preset];
  25362. else {
  25363. if (!o[D]) return;
  25364. a = o[D]
  25365. }
  25366. if (a[n] && void 0 !== a[n][e.property]) {
  25367. var s = a[n][e.property];
  25368. e.initialValue = s, e.setValue(s)
  25369. }
  25370. }
  25371. }
  25372. }
  25373. function l(t, e, i, n) {
  25374. if (void 0 === e[i]) throw new Error('Object "' + e + '" has no property "' + i + '"');
  25375. var o = void 0;
  25376. if (n.color) o = new S.default(e, i);
  25377. else {
  25378. var l = [e, i].concat(n.factoryArgs);
  25379. o = y.default.apply(t, l)
  25380. }
  25381. n.before instanceof b.default && (n.before = n.before.__li), s(t, o), P.default.addClass(o.domElement, "c");
  25382. var u = document.createElement("span");
  25383. P.default.addClass(u, "property-name"), u.innerHTML = o.property;
  25384. var h = document.createElement("div");
  25385. h.appendChild(u), h.appendChild(o.domElement);
  25386. var c = r(t, h, n.before);
  25387. return P.default.addClass(c, F.CLASS_CONTROLLER_ROW), o instanceof S.default ? P.default.addClass(c, "color") : P.default.addClass(c, m(o.getValue())), a(t, c, o), t.__controllers.push(o), o
  25388. }
  25389. function u(t, e) {
  25390. return document.location.href + "." + e
  25391. }
  25392. function h(t, e, i) {
  25393. var n = document.createElement("option");
  25394. n.innerHTML = e, n.value = e, t.__preset_select.appendChild(n), i && (t.__preset_select.selectedIndex = t.__preset_select.length - 1)
  25395. }
  25396. function c(t, e) {
  25397. e.style.display = t.useLocalStorage ? "block" : "none"
  25398. }
  25399. function d(t) {
  25400. var e = t.__save_row = document.createElement("li");
  25401. P.default.addClass(t.domElement, "has-save"), t.__ul.insertBefore(e, t.__ul.firstChild), P.default.addClass(e, "save-row");
  25402. var i = document.createElement("span");
  25403. i.innerHTML = "&nbsp;", P.default.addClass(i, "button gears");
  25404. var n = document.createElement("span");
  25405. n.innerHTML = "Save", P.default.addClass(n, "button"), P.default.addClass(n, "save");
  25406. var r = document.createElement("span");
  25407. r.innerHTML = "New", P.default.addClass(r, "button"), P.default.addClass(r, "save-as");
  25408. var o = document.createElement("span");
  25409. o.innerHTML = "Revert", P.default.addClass(o, "button"), P.default.addClass(o, "revert");
  25410. var a = t.__preset_select = document.createElement("select");
  25411. t.load && t.load.remembered ? C.default.each(t.load.remembered, (function(e, i) {
  25412. h(t, i, i === t.preset)
  25413. })) : h(t, D, !1), P.default.bind(a, "change", (function() {
  25414. for (var e = 0; e < t.__preset_select.length; e++) t.__preset_select[e].innerHTML = t.__preset_select[e].value;
  25415. t.preset = this.value
  25416. })), e.appendChild(a), e.appendChild(i), e.appendChild(n), e.appendChild(r), e.appendChild(o), L && function() {
  25417. var e = document.getElementById("dg-local-explain"),
  25418. i = document.getElementById("dg-local-storage");
  25419. document.getElementById("dg-save-locally")
  25420. .style.display = "block", "true" === localStorage.getItem(u(0, "isLocal")) && i.setAttribute("checked", "checked"), c(t, e), P.default.bind(i, "change", (function() {
  25421. t.useLocalStorage = !t.useLocalStorage, c(t, e)
  25422. }))
  25423. }();
  25424. var s = document.getElementById("dg-new-constructor");
  25425. P.default.bind(s, "keydown", (function(t) {
  25426. !t.metaKey || 67 !== t.which && 67 !== t.keyCode || O.hide()
  25427. })), P.default.bind(i, "click", (function() {
  25428. s.innerHTML = JSON.stringify(t.getSaveObject(), void 0, 2), O.show(), s.focus(), s.select()
  25429. })), P.default.bind(n, "click", (function() {
  25430. t.save()
  25431. })), P.default.bind(r, "click", (function() {
  25432. var e = prompt("Enter a new preset name.");
  25433. e && t.saveAs(e)
  25434. })), P.default.bind(o, "click", (function() {
  25435. t.revert()
  25436. }))
  25437. }
  25438. function p(t, e) {
  25439. t.domElement.style.width = e + "px", t.__save_row && t.autoPlace && (t.__save_row.style.width = e + "px"), t.__closeButton && (t.__closeButton.style.width = e + "px")
  25440. }
  25441. function f(t, e) {
  25442. var i = {};
  25443. return C.default.each(t.__rememberedObjects, (function(n, r) {
  25444. var o = {},
  25445. a = t.__rememberedObjectIndecesToControllers[r];
  25446. C.default.each(a, (function(t, i) {
  25447. o[i] = e ? t.initialValue : t.getValue()
  25448. })), i[r] = o
  25449. })), i
  25450. }
  25451. var m = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
  25452. return typeof t
  25453. } : function(t) {
  25454. return t && "function" == typeof Symbol && t.constructor === Symbol ? "symbol" : typeof t
  25455. },
  25456. g = n(i(18)),
  25457. v = n(i(19)),
  25458. y = n(i(20)),
  25459. b = n(i(7)),
  25460. w = n(i(8)),
  25461. x = n(i(15)),
  25462. M = n(i(13)),
  25463. T = n(i(14)),
  25464. S = n(i(16)),
  25465. _ = n(i(21)),
  25466. A = n(i(22)),
  25467. P = n(i(9)),
  25468. C = n(i(5)),
  25469. E = n(i(23));
  25470. g.default.inject(E.default);
  25471. var D = "Default",
  25472. L = function() {
  25473. try {
  25474. return "localStorage" in window && null !== window.localStorage
  25475. } catch (t) {
  25476. return !1
  25477. }
  25478. }(),
  25479. O = void 0,
  25480. I = !0,
  25481. R = void 0,
  25482. N = !1,
  25483. k = [],
  25484. F = function t(e) {
  25485. var i = this,
  25486. n = e || {};
  25487. this.domElement = document.createElement("div"), this.__ul = document.createElement("ul"), this.domElement.appendChild(this.__ul), P.default.addClass(this.domElement, "dg"), this.__folders = {}, this.__controllers = [], this.__rememberedObjects = [], this.__rememberedObjectIndecesToControllers = [], this.__listening = [], n = C.default.defaults(n, {
  25488. autoPlace: !0,
  25489. width: t.DEFAULT_WIDTH
  25490. }), n = C.default.defaults(n, {
  25491. resizable: n.autoPlace,
  25492. hideable: n.autoPlace
  25493. }), C.default.isUndefined(n.load) ? n.load = {
  25494. preset: D
  25495. } : n.preset && (n.load.preset = n.preset), C.default.isUndefined(n.parent) && n.hideable && k.push(this), n.resizable = C.default.isUndefined(n.parent) && n.resizable, n.autoPlace && C.default.isUndefined(n.scrollable) && (n.scrollable = !0);
  25496. var o = L && "true" === localStorage.getItem(u(0, "isLocal")),
  25497. a = void 0;
  25498. if (Object.defineProperties(this, {
  25499. parent: {
  25500. get: function() {
  25501. return n.parent
  25502. }
  25503. },
  25504. scrollable: {
  25505. get: function() {
  25506. return n.scrollable
  25507. }
  25508. },
  25509. autoPlace: {
  25510. get: function() {
  25511. return n.autoPlace
  25512. }
  25513. },
  25514. preset: {
  25515. get: function() {
  25516. return i.parent ? i.getRoot()
  25517. .preset : n.load.preset
  25518. },
  25519. set: function(t) {
  25520. i.parent ? i.getRoot()
  25521. .preset = t : n.load.preset = t,
  25522. function(t) {
  25523. for (var e = 0; e < t.__preset_select.length; e++) t.__preset_select[e].value === t.preset && (t.__preset_select.selectedIndex = e)
  25524. }(this), i.revert()
  25525. }
  25526. },
  25527. width: {
  25528. get: function() {
  25529. return n.width
  25530. },
  25531. set: function(t) {
  25532. n.width = t, p(i, t)
  25533. }
  25534. },
  25535. name: {
  25536. get: function() {
  25537. return n.name
  25538. },
  25539. set: function(t) {
  25540. n.name = t, titleRowName && (titleRowName.innerHTML = n.name)
  25541. }
  25542. },
  25543. closed: {
  25544. get: function() {
  25545. return n.closed
  25546. },
  25547. set: function(e) {
  25548. n.closed = e, n.closed ? P.default.addClass(i.__ul, t.CLASS_CLOSED) : P.default.removeClass(i.__ul, t.CLASS_CLOSED), this.onResize(), i.__closeButton && (i.__closeButton.innerHTML = e ? t.TEXT_OPEN : t.TEXT_CLOSED)
  25549. }
  25550. },
  25551. load: {
  25552. get: function() {
  25553. return n.load
  25554. }
  25555. },
  25556. useLocalStorage: {
  25557. get: function() {
  25558. return o
  25559. },
  25560. set: function(t) {
  25561. L && (o = t, t ? P.default.bind(window, "unload", a) : P.default.unbind(window, "unload", a), localStorage.setItem(u(0, "isLocal"), t))
  25562. }
  25563. }
  25564. }), C.default.isUndefined(n.parent)) {
  25565. if (n.closed = !1, P.default.addClass(this.domElement, t.CLASS_MAIN), P.default.makeSelectable(this.domElement, !1), L && o) {
  25566. i.useLocalStorage = !0;
  25567. var s = localStorage.getItem(u(0, "gui"));
  25568. s && (n.load = JSON.parse(s))
  25569. }
  25570. this.__closeButton = document.createElement("div"), this.__closeButton.innerHTML = t.TEXT_CLOSED, P.default.addClass(this.__closeButton, t.CLASS_CLOSE_BUTTON), this.domElement.appendChild(this.__closeButton), P.default.bind(this.__closeButton, "click", (function() {
  25571. i.closed = !i.closed
  25572. }))
  25573. } else {
  25574. void 0 === n.closed && (n.closed = !0);
  25575. var l = document.createTextNode(n.name);
  25576. P.default.addClass(l, "controller-name");
  25577. var h = r(i, l);
  25578. P.default.addClass(this.__ul, t.CLASS_CLOSED), P.default.addClass(h, "title"), P.default.bind(h, "click", (function(t) {
  25579. return t.preventDefault(), i.closed = !i.closed, !1
  25580. })), n.closed || (this.closed = !1)
  25581. }
  25582. n.autoPlace && (C.default.isUndefined(n.parent) && (I && (R = document.createElement("div"), P.default.addClass(R, "dg"), P.default.addClass(R, t.CLASS_AUTO_PLACE_CONTAINER), document.body.appendChild(R), I = !1), R.appendChild(this.domElement), P.default.addClass(this.domElement, t.CLASS_AUTO_PLACE)), this.parent || p(i, n.width)), this.__resizeHandler = function() {
  25583. i.onResizeDebounced()
  25584. }, P.default.bind(window, "resize", this.__resizeHandler), P.default.bind(this.__ul, "webkitTransitionEnd", this.__resizeHandler), P.default.bind(this.__ul, "transitionend", this.__resizeHandler), P.default.bind(this.__ul, "oTransitionEnd", this.__resizeHandler), this.onResize(), n.resizable && function(t) {
  25585. function e(e) {
  25586. return e.preventDefault(), t.width += r - e.clientX, t.onResize(), r = e.clientX, !1
  25587. }
  25588. function i() {
  25589. P.default.removeClass(t.__closeButton, F.CLASS_DRAG), P.default.unbind(window, "mousemove", e), P.default.unbind(window, "mouseup", i)
  25590. }
  25591. function n(n) {
  25592. return n.preventDefault(), r = n.clientX, P.default.addClass(t.__closeButton, F.CLASS_DRAG), P.default.bind(window, "mousemove", e), P.default.bind(window, "mouseup", i), !1
  25593. }
  25594. var r = void 0;
  25595. t.__resize_handle = document.createElement("div"), C.default.extend(t.__resize_handle.style, {
  25596. width: "6px",
  25597. marginLeft: "-3px",
  25598. height: "200px",
  25599. cursor: "ew-resize",
  25600. position: "absolute"
  25601. }), P.default.bind(t.__resize_handle, "mousedown", n), P.default.bind(t.__closeButton, "mousedown", n), t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  25602. }(this), a = function() {
  25603. L && "true" === localStorage.getItem(u(0, "isLocal")) && localStorage.setItem(u(0, "gui"), JSON.stringify(i.getSaveObject()))
  25604. }, this.saveToLocalStorageIfPossible = a, n.parent || function() {
  25605. var t = i.getRoot();
  25606. t.width += 1, C.default.defer((function() {
  25607. t.width -= 1
  25608. }))
  25609. }()
  25610. };
  25611. F.toggleHide = function() {
  25612. N = !N, C.default.each(k, (function(t) {
  25613. t.domElement.style.display = N ? "none" : ""
  25614. }))
  25615. }, F.CLASS_AUTO_PLACE = "a", F.CLASS_AUTO_PLACE_CONTAINER = "ac", F.CLASS_MAIN = "main", F.CLASS_CONTROLLER_ROW = "cr", F.CLASS_TOO_TALL = "taller-than-window", F.CLASS_CLOSED = "closed", F.CLASS_CLOSE_BUTTON = "close-button", F.CLASS_DRAG = "drag", F.DEFAULT_WIDTH = 245, F.TEXT_CLOSED = "Close Controls", F.TEXT_OPEN = "Open Controls", F._keydownHandler = function(t) {
  25616. "text" === document.activeElement.type || 72 !== t.which && 72 !== t.keyCode || F.toggleHide()
  25617. }, P.default.bind(window, "keydown", F._keydownHandler, !1), C.default.extend(F.prototype, {
  25618. add: function(t, e) {
  25619. return l(this, t, e, {
  25620. factoryArgs: Array.prototype.slice.call(arguments, 2)
  25621. })
  25622. },
  25623. addColor: function(t, e) {
  25624. return l(this, t, e, {
  25625. color: !0
  25626. })
  25627. },
  25628. remove: function(t) {
  25629. this.__ul.removeChild(t.__li), this.__controllers.splice(this.__controllers.indexOf(t), 1);
  25630. var e = this;
  25631. C.default.defer((function() {
  25632. e.onResize()
  25633. }))
  25634. },
  25635. destroy: function() {
  25636. this.autoPlace && R.removeChild(this.domElement), P.default.unbind(window, "keydown", F._keydownHandler, !1), P.default.unbind(window, "resize", this.__resizeHandler), this.saveToLocalStorageIfPossible && P.default.unbind(window, "unload", this.saveToLocalStorageIfPossible)
  25637. },
  25638. addFolder: function(t) {
  25639. if (void 0 !== this.__folders[t]) throw new Error('You already have a folder in this GUI by the name "' + t + '"');
  25640. var e = {
  25641. name: t,
  25642. parent: this
  25643. };
  25644. e.autoPlace = this.autoPlace, this.load && this.load.folders && this.load.folders[t] && (e.closed = this.load.folders[t].closed, e.load = this.load.folders[t]);
  25645. var i = new F(e);
  25646. this.__folders[t] = i;
  25647. var n = r(this, i.domElement);
  25648. return P.default.addClass(n, "folder"), i
  25649. },
  25650. open: function() {
  25651. this.closed = !1
  25652. },
  25653. close: function() {
  25654. this.closed = !0
  25655. },
  25656. onResize: function() {
  25657. var t = this.getRoot();
  25658. if (t.scrollable) {
  25659. var e = P.default.getOffset(t.__ul)
  25660. .top,
  25661. i = 0;
  25662. C.default.each(t.__ul.childNodes, (function(e) {
  25663. t.autoPlace && e === t.__save_row || (i += P.default.getHeight(e))
  25664. })), (window.renderHeight || window.innerHeight) - e - 20 < i ? (P.default.addClass(t.domElement, F.CLASS_TOO_TALL), t.__ul.style.height = (window.renderHeight || window.innerHeight) - e - 20 + "px") : (P.default.removeClass(t.domElement, F.CLASS_TOO_TALL), t.__ul.style.height = "auto")
  25665. }
  25666. t.__resize_handle && C.default.defer((function() {
  25667. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  25668. })), t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  25669. },
  25670. onResizeDebounced: C.default.debounce((function() {
  25671. this.onResize()
  25672. }), 200),
  25673. remember: function() {
  25674. if (C.default.isUndefined(O) && ((O = new A.default)
  25675. .domElement.innerHTML = v.default), this.parent) throw new Error("You can only call remember on a top level GUI.");
  25676. var t = this;
  25677. C.default.each(Array.prototype.slice.call(arguments), (function(e) {
  25678. 0 === t.__rememberedObjects.length && d(t), -1 === t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  25679. })), this.autoPlace && p(this, this.width)
  25680. },
  25681. getRoot: function() {
  25682. for (var t = this; t.parent;) t = t.parent;
  25683. return t
  25684. },
  25685. getSaveObject: function() {
  25686. var t = this.load;
  25687. return t.closed = this.closed, this.__rememberedObjects.length > 0 && (t.preset = this.preset, t.remembered || (t.remembered = {}), t.remembered[this.preset] = f(this)), t.folders = {}, C.default.each(this.__folders, (function(e, i) {
  25688. t.folders[i] = e.getSaveObject()
  25689. })), t
  25690. },
  25691. save: function() {
  25692. this.load.remembered || (this.load.remembered = {}), this.load.remembered[this.preset] = f(this), o(this, !1), this.saveToLocalStorageIfPossible()
  25693. },
  25694. saveAs: function(t) {
  25695. this.load.remembered || (this.load.remembered = {}, this.load.remembered[D] = f(this, !0)), this.load.remembered[t] = f(this), this.preset = t, h(this, t, !0), this.saveToLocalStorageIfPossible()
  25696. },
  25697. revert: function(t) {
  25698. C.default.each(this.__controllers, (function(e) {
  25699. this.getRoot()
  25700. .load.remembered ? s(t || this.getRoot(), e) : e.setValue(e.initialValue), e.__onFinishChange && e.__onFinishChange.call(e, e.getValue())
  25701. }), this), C.default.each(this.__folders, (function(t) {
  25702. t.revert(t)
  25703. })), t || o(this.getRoot(), !1)
  25704. },
  25705. listen: function(t) {
  25706. var e = 0 === this.__listening.length;
  25707. this.__listening.push(t), e && function t(e) {
  25708. 0 !== e.length && _.default.call(window, (function() {
  25709. t(e)
  25710. })), C.default.each(e, (function(t) {
  25711. t.updateDisplay()
  25712. }))
  25713. }(this.__listening)
  25714. },
  25715. updateDisplay: function() {
  25716. C.default.each(this.__controllers, (function(t) {
  25717. t.updateDisplay()
  25718. })), C.default.each(this.__folders, (function(t) {
  25719. t.updateDisplay()
  25720. }))
  25721. }
  25722. }), t.exports = F
  25723. }, function(t, e) {
  25724. "use strict";
  25725. t.exports = {
  25726. load: function(t, e) {
  25727. var i = e || document,
  25728. n = i.createElement("link");
  25729. n.type = "text/css", n.rel = "stylesheet", n.href = t, i.getElementsByTagName("head")[0].appendChild(n)
  25730. },
  25731. inject: function(t, e) {
  25732. var i = e || document,
  25733. n = document.createElement("style");
  25734. n.type = "text/css", n.innerHTML = t;
  25735. var r = i.getElementsByTagName("head")[0];
  25736. try {
  25737. r.appendChild(n)
  25738. } catch (t) {}
  25739. }
  25740. }
  25741. }, function(t, e) {
  25742. t.exports = "<div id=dg-save class=\"dg dialogue\"> Here's the new load parameter for your <code>GUI</code>'s constructor: <textarea id=dg-new-constructor></textarea> <div id=dg-save-locally> <input id=dg-local-storage type=checkbox /> Automatically save values to <code>localStorage</code> on exit. <div id=dg-local-explain>The values saved to <code>localStorage</code> will override those passed to <code>dat.GUI</code>'s constructor. This makes it easier to work incrementally, but <code>localStorage</code> is fragile, and your friends may not see the same values you do. </div> </div> </div>"
  25743. }, function(t, e, i) {
  25744. "use strict";
  25745. function n(t) {
  25746. return t && t.__esModule ? t : {
  25747. default: t
  25748. }
  25749. }
  25750. e.__esModule = !0;
  25751. var r = n(i(10)),
  25752. o = n(i(13)),
  25753. a = n(i(14)),
  25754. s = n(i(11)),
  25755. l = n(i(15)),
  25756. u = n(i(8)),
  25757. h = n(i(5));
  25758. e.default = function(t, e) {
  25759. var i = t[e];
  25760. return h.default.isArray(arguments[2]) || h.default.isObject(arguments[2]) ? new r.default(t, e, arguments[2]) : h.default.isNumber(i) ? h.default.isNumber(arguments[2]) && h.default.isNumber(arguments[3]) ? h.default.isNumber(arguments[4]) ? new a.default(t, e, arguments[2], arguments[3], arguments[4]) : new a.default(t, e, arguments[2], arguments[3]) : h.default.isNumber(arguments[4]) ? new o.default(t, e, {
  25761. min: arguments[2],
  25762. max: arguments[3],
  25763. step: arguments[4]
  25764. }) : new o.default(t, e, {
  25765. min: arguments[2],
  25766. max: arguments[3]
  25767. }) : h.default.isString(i) ? new s.default(t, e) : h.default.isFunction(i) ? new l.default(t, e, "") : h.default.isBoolean(i) ? new u.default(t, e) : null
  25768. }
  25769. }, function(t, e) {
  25770. "use strict";
  25771. e.__esModule = !0, e.default = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(t) {
  25772. setTimeout(t, 1e3 / 60)
  25773. }
  25774. }, function(t, e, i) {
  25775. "use strict";
  25776. function n(t) {
  25777. return t && t.__esModule ? t : {
  25778. default: t
  25779. }
  25780. }
  25781. e.__esModule = !0;
  25782. var r = n(i(9)),
  25783. o = n(i(5)),
  25784. a = function() {
  25785. function t() {
  25786. (function(t, e) {
  25787. if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
  25788. })(this, t), this.backgroundElement = document.createElement("div"), o.default.extend(this.backgroundElement.style, {
  25789. backgroundColor: "rgba(0,0,0,0.8)",
  25790. top: 0,
  25791. left: 0,
  25792. display: "none",
  25793. zIndex: "1000",
  25794. opacity: 0,
  25795. WebkitTransition: "opacity 0.2s linear",
  25796. transition: "opacity 0.2s linear"
  25797. }), r.default.makeFullscreen(this.backgroundElement), this.backgroundElement.style.position = "fixed", this.domElement = document.createElement("div"), o.default.extend(this.domElement.style, {
  25798. position: "fixed",
  25799. display: "none",
  25800. zIndex: "1001",
  25801. opacity: 0,
  25802. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear",
  25803. transition: "transform 0.2s ease-out, opacity 0.2s linear"
  25804. }), document.body.appendChild(this.backgroundElement), document.body.appendChild(this.domElement);
  25805. var e = this;
  25806. r.default.bind(this.backgroundElement, "click", (function() {
  25807. e.hide()
  25808. }))
  25809. }
  25810. return t.prototype.show = function() {
  25811. var t = this;
  25812. this.backgroundElement.style.display = "block", this.domElement.style.display = "block", this.domElement.style.opacity = 0, this.domElement.style.webkitTransform = "scale(1.1)", this.layout(), o.default.defer((function() {
  25813. t.backgroundElement.style.opacity = 1, t.domElement.style.opacity = 1, t.domElement.style.webkitTransform = "scale(1)"
  25814. }))
  25815. }, t.prototype.hide = function() {
  25816. var t = this,
  25817. e = function e() {
  25818. t.domElement.style.display = "none", t.backgroundElement.style.display = "none", r.default.unbind(t.domElement, "webkitTransitionEnd", e), r.default.unbind(t.domElement, "transitionend", e), r.default.unbind(t.domElement, "oTransitionEnd", e)
  25819. };
  25820. r.default.bind(this.domElement, "webkitTransitionEnd", e), r.default.bind(this.domElement, "transitionend", e), r.default.bind(this.domElement, "oTransitionEnd", e), this.backgroundElement.style.opacity = 0, this.domElement.style.opacity = 0, this.domElement.style.webkitTransform = "scale(1.1)"
  25821. }, t.prototype.layout = function() {
  25822. this.domElement.style.left = (window.renderWidth || window.innerWidth) / 2 - r.default.getWidth(this.domElement) / 2 + "px", this.domElement.style.top = (window.renderHeight || window.innerHeight) / 2 - r.default.getHeight(this.domElement) / 2 + "px"
  25823. }, t
  25824. }();
  25825. e.default = a
  25826. }, function(t, e, i) {
  25827. (t.exports = i(24)())
  25828. .push([t.id, ".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1!important}.dg.main .close-button.drag,.dg.main:hover .close-button{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;transition:opacity .1s linear;border:0;position:absolute;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-x:hidden}.dg.a.has-save>ul{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{position:fixed;top:0;z-index:1002}.dg li{-webkit-transition:height .1s ease-out;transition:height .1s ease-out}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;overflow:hidden;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid transparent}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:9px}.dg .c select{margin-top:5px}.dg .cr.boolean,.dg .cr.boolean *,.dg .cr.function,.dg .cr.function *,.dg .cr.function .property-name{cursor:pointer}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco,monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px Lucida Grande,sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{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;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid hsla(0,0%,100%,.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.boolean:hover,.dg .cr.function:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}", ""])
  25829. }, function(t, e) {
  25830. t.exports = function() {
  25831. var t = [];
  25832. return t.toString = function() {
  25833. for (var t = [], e = 0; e < this.length; e++) {
  25834. var i = this[e];
  25835. i[2] ? t.push("@media " + i[2] + "{" + i[1] + "}") : t.push(i[1])
  25836. }
  25837. return t.join("")
  25838. }, t.i = function(e, i) {
  25839. "string" == typeof e && (e = [
  25840. [null, e, ""]
  25841. ]);
  25842. for (var n = {}, r = 0; r < this.length; r++) {
  25843. var o = this[r][0];
  25844. "number" == typeof o && (n[o] = !0)
  25845. }
  25846. for (r = 0; r < e.length; r++) {
  25847. var a = e[r];
  25848. "number" == typeof a[0] && n[a[0]] || (i && !a[2] ? a[2] = i : i && (a[2] = "(" + a[2] + ") and (" + i + ")"), t.push(a))
  25849. }
  25850. }, t
  25851. }
  25852. }])
  25853. }, function(t, e, i) {
  25854. "use strict";
  25855. var n = i(0),
  25856. r = (i(13), i(9));
  25857. function o(t) {
  25858. this._canbeUsed = !1, this.player = t, this.sRender = t.sRender, this.ray = new n.Raycaster, this.mouse = new n.Vector3, this.INTERSECT = null, this.measurementTool = null, this.vertexMesh = null, this.activeMeasurement = null, this.labelsInCamera = {}, this.currentInfo = [], this.dragging = !1, this.defineProperty(), this.initStateEngine()
  25859. }
  25860. o.prototype.defineProperty = function() {
  25861. Object.defineProperty(this, "canbeUsed", {
  25862. get: function() {
  25863. return this._canbeUsed
  25864. },
  25865. set: function(t) {
  25866. this._canbeUsed = t
  25867. }
  25868. })
  25869. }, o.prototype.initStateEngine = function() {}, o.prototype.init = function(t) {
  25870. this.measurementTool = t
  25871. }, o.prototype.selectMeasurementVertexMesh = function(t) {
  25872. this.ray.setFromCamera(this.mouse, this.sRender.camera);
  25873. var e = this.ray.intersectObjects(t);
  25874. 0 < e.length ? (this.INTERSECT = e[0], document.body.style.cursor = "pointer") : (this.INTERSECT = null, document.body.style.cursor = "default")
  25875. }, o.prototype.handleChoosedMeasurementVertexMesh = function(t) {
  25876. this.vertexMesh = t.object, this.activeMeasurement = this.vertexMesh.parent, this.measurementTool.lockedAddPoint = !0
  25877. }, o.prototype.onPlayerMouseDown = function() {
  25878. this.INTERSECT && (this.player.disableNavigator = !0, this.player.controls.panorama.lockedRotationFrom = !0, this.handleChoosedMeasurementVertexMesh(this.INTERSECT))
  25879. }, o.prototype.onPlayerMouseMove = function() {
  25880. if (this.mouse.copy(this.player.mouse), !this.vertexMesh) {
  25881. var t = !!this.measurementTool,
  25882. e = this.measurementTool.singleMeasuring && !!this.measurementTool.inMeasureMode,
  25883. i = 1 < this.measurementTool.measurements.length;
  25884. t && e && i && this.selectMeasurementVertexMesh(this.measurementTool.allSpheres)
  25885. }
  25886. this.vertexMesh && this.dragMeasurementVertexMesh(), this.player.inMeasureMode && this.measurementTool && !this.measurementTool.singleMeasuring && this.updateMeasureInfo(this.measurementTool.measurements)
  25887. }, o.prototype.onPlayerMouseUp = function() {
  25888. this.vertexMesh && (this.player.controls.panorama.lockedRotationFrom = !1, this.vertexMesh = null), this.dragging && (this.measurementTool.updateMeasureVisible(this.player.currentPano), this.updateMeasureInfo(this.measurementTool.measurements), this.measurementTool.changeSize(this.activeMeasurement.measureid))
  25889. }, o.prototype.onHandleControlPanoramaMove = function() {
  25890. var t = G.conf.modelMeasure || G.conf.publicity || !G.conf.modelMeasure && !G.conf.publicity,
  25891. e = !!this.measurementTool && 0 < this.measurementTool.measurements.length;
  25892. t && e && (this.measurementTool.lockedAddPoint = !0, this.updateMeasureInfo(this.measurementTool.measurements))
  25893. }, o.prototype.onHandleControlPanoramaMoveStop = function() {
  25894. G.conf.modelMeasure || G.conf.publicity || !G.conf.modelMeasure && G.conf.publicity, !!this.measurementTool && this.measurementTool.measurements.length
  25895. }, o.prototype.onFlyEnd = function() {
  25896. var t = G.conf.modelMeasure || G.conf.publicity,
  25897. e = !!this.measurementTool && 0 < this.measurementTool.measurements.length;
  25898. t && e && this.updateMeasureInfo(this.measurementTool.measurements)
  25899. }, o.prototype.dragMeasurementVertexMesh = function() {
  25900. this.dragging = !0, this.vertexMesh.position.copy(this.player.intersect.point), this.activeMeasurement.points[this.vertexMesh.userData.index].copy(this.vertexMesh.position), this.activeMeasurement.lockedFitAxis = !0, this.activeMeasurement.update(), this.updateMeasureInfo(this.measurementTool.measurements)
  25901. }, o.prototype.computeOutScreen = function(t) {
  25902. var e = t.position.clone()
  25903. .applyMatrix4(this.sRender.camera.matrixWorldInverse)
  25904. .applyMatrix4(this.sRender.camera.projectionMatrix),
  25905. i = Math.abs(e.x) > 1,
  25906. n = Math.abs(e.y) > 1,
  25907. r = Math.abs(e.z) > 1;
  25908. t.userData.out_camera = !!(i || n || r)
  25909. }, o.prototype.computeCrossCollider = function(t) {}, o.prototype.updateMeasureInfo = function(t) {
  25910. var e = [];
  25911. if (this.measurementTool && !this.measurementTool.measureState) return !1;
  25912. for (var i = 0, n = t.length; i < n; ++i) {
  25913. for (var o = t[i].edges, a = t[i].edgeLabels, s = t[i].areaLabel, l = t[i].category, u = t[i].uuid, h = 0, c = a.length; h < c; ++h) a[h].userData.screen_position = r.convertWorldPositionToScreen(a[h].position.clone(), this.sRender.camera), this.computeOutScreen(a[h]);
  25914. this.computeOutScreen(s), s.userData.screen_position = r.convertWorldPositionToScreen(s.position.clone(), this.sRender.camera), e.push({
  25915. edges: o,
  25916. edgeLabels: a,
  25917. areaLabel: s,
  25918. category: l,
  25919. uuid: u
  25920. })
  25921. }
  25922. this.player.emit("get-measurement-info", e)
  25923. };
  25924. o.prototype.update = function() {
  25925. var t = !!this.measurementTool && 0 < this.measurementTool.measurements.length;
  25926. this.player.flying && t && this.updateMeasureInfo(this.measurementTool.measurements)
  25927. }, t.exports = o
  25928. }, function(t, e, i) {
  25929. function n() {
  25930. G.d = this, this.endlessLoop = a.warp.loop, this.clock = new r.Clock(!0), this.model = null, this.player = null, this.currentItem = null, this.destinationItem = null, this.tourIsPlaying = !1, this.transitionStage = w.None, this.nextFunc = null, this.onTheBus = !1, this.reachSource = null, this.interrupted = !1, this.nItems = 0, this.currentScript = 1, this.walkingSectionPaused = !1, this.sLen = 0, this.connect = b(), this.handleOperation = this.handleOperation.bind(this), this.connect.on("operation", this.handleOperation)
  25931. }
  25932. var r = i(0),
  25933. o = i(2),
  25934. a = i(1),
  25935. s = i(8),
  25936. l = i(4)
  25937. .EventEmitter,
  25938. u = i(5),
  25939. h = i(24),
  25940. c = (i(8), i(21)),
  25941. d = i(70),
  25942. p = i(20),
  25943. f = i(27),
  25944. m = i(31),
  25945. g = i(63),
  25946. v = i(64),
  25947. y = (i(3), new o("/js/director.js")),
  25948. b = i(28),
  25949. w = Object.freeze({
  25950. None: 0,
  25951. Moving: 1,
  25952. Aiming: 2,
  25953. Interlude: 3
  25954. }),
  25955. x = Object.freeze({
  25956. Forward: 1,
  25957. NoChange: 0,
  25958. Backwards: -1
  25959. });
  25960. i(71);
  25961. n.prototype = Object.create(l.prototype), n.prototype.init = function(t, e) {
  25962. this.player = t, this.modelManager = e, this.updateModel(), this.resetAll(), this.bindEvents()
  25963. }, n.prototype.resetAll = function() {
  25964. if (this.currentItem = null, this.destinationItem = null, this.tourIsPlaying = !1, this.transitionStage = w.None, this.nextFunc = null, this.onTheBus = !1, this.reachSource = null, this.interrupted = !1, this.model) switch (this.model.switch_scene_type) {
  25965. case 1:
  25966. this.defaultWarpStyle = h.BLACK;
  25967. break;
  25968. case 2:
  25969. this.defaultWarpStyle = h.WALK;
  25970. break;
  25971. case 3:
  25972. this.defaultWarpStyle = h.STD;
  25973. break;
  25974. default:
  25975. this.defaultWarpStyle = h.BLACK
  25976. } else this.defaultWarpStyle = h.BLACK, y.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  25977. this.resetSpecialTransition()
  25978. }, n.prototype.updateModel = function() {
  25979. this.model = this.modelManager.getActiveModel(), this.nItems = this.model.heroLocations.length - 1
  25980. }, n.prototype.bindEvents = function() {
  25981. this.modelManager.on(c.ActiveModelChanged, this.updateModel.bind(this)), this.player.on(p.WarpInterruptedWithFlyTo, this.handleFlyToWarpInterruption.bind(this)), this.player.on(p.Move, this.handlePlayerMove.bind(this)), this.player.on(p.PanoChosen, this.handlePlayerPanoChosen.bind(this)), this.player.on(p.ModeChanged, this.handlePlayerModeChanged.bind(this)), this.player.on(p.InputStart, this.handlePlayerInputStart.bind(this)), this.player.on(p.FlyingStarted, this.handlePlayerFlyingStarted.bind(this))
  25982. }, n.prototype.handleFlyToWarpInterruption = function(t, e) {
  25983. t === h.WALK ? (this.interrupt(m.FADEIN), this.pauseWalkingSection(), this.player.fastForwardActivePanoFlight()) : this.transitionStage === w.Interlude && (this.interrupt(m.NONE), e && e())
  25984. }, n.prototype.handlePlayerMove = function(t) {
  25985. this.transitionStage === w.Interlude && this.interrupt(m.NONE)
  25986. }, n.prototype.handlePlayerPanoChosen = function(t, e) {
  25987. this.intermediateState() || t.id === e.id || (this.onTheBus = !1, this.emit("update.controls"))
  25988. }, n.prototype.handlePlayerModeChanged = function(t, e) {
  25989. this.intermediateState() || t === e || (this.onTheBus = !1, this.emit("update.controls"))
  25990. }, n.prototype.handlePlayerInputStart = function(t) {
  25991. this.transitionStage === w.Interlude && this.interrupt(m.NONE)
  25992. }, n.prototype.handlePlayerFlyingStarted = function() {
  25993. this.clearWalkingSectionPaused(), G.player.mattertagManager.ttflying = !0
  25994. }, n.prototype.describe = function() {
  25995. return {
  25996. nItems: this.nItems,
  25997. currentItem: this.currentItem,
  25998. destinationItem: this.destinationItem,
  25999. tourIsPlaying: this.tourIsPlaying,
  26000. onTheBus: this.onTheBus,
  26001. endlessLoop: this.endlessLoop,
  26002. viewMode: this.player.mode,
  26003. inTransition: this._inTransition(),
  26004. transitionStage: this.transitionStage
  26005. }
  26006. }, n.prototype._inTransition = function() {
  26007. return this.player.flying || this.player.isWarping() || this.player.mode === u.TRANSITIONING || this.tourIsPlaying
  26008. }, n.prototype.bounceable = function() {
  26009. var t = this.clock.getDelta();
  26010. return this.isInterrupted() || t < .9 && t > .01 || this.player.flying && !this.player.isWarping()
  26011. }, n.prototype.currentMoveDirection = function() {
  26012. return null === this.currentItem || void 0 === this.currentItem ? x.Forward : this.destinationItem === this.currentItem ? x.NoChange : this.destinationItem > this.currentItem ? x.Forward : x.Backwards
  26013. }, n.prototype.clearPath = function() {
  26014. this._inTransition() || this.player.path.discardPathObject()
  26015. }, n.prototype.allFloors = function() {
  26016. G.R.recording && G.R.save({
  26017. tap: "floor",
  26018. action: "all"
  26019. }), this.connect.getSyncState() && (this.connect.remoteControl || this.connect.sync || this.connect.sendOperation({
  26020. type: "floorchange",
  26021. floorIndex: "all"
  26022. }), this.showAllFloors())
  26023. }, n.prototype.showAllFloors = function() {
  26024. var t = this.player.controls[this.player.mode];
  26025. t && t.emit("move", "gui"), this.player.controls[u.PANORAMA].emit(f.InteractionGui, "floor-control"), this.model.toggleAllFloors()
  26026. }, n.prototype.gotoFloor = function(t) {
  26027. G.R.recording && G.R.save({
  26028. tap: "floor",
  26029. action: "" + parseInt(t)
  26030. }), this.connect.getSyncState() && (this.connect.remoteControl || this.connect.sync || this.connect.sendOperation({
  26031. type: "floorchange",
  26032. floorIndex: t
  26033. }), this.player.gotoFloor(t, "gui"))
  26034. }, n.prototype.openTag = function() {
  26035. this.player.mattertagManager.closeTag(), null !== this.currentItem && void 0 !== this.currentItem || (this.currentItem = 0);
  26036. this.currentItem - this.sLen < 0 || G.R.recording
  26037. }, n.prototype.actionComplete = function(t) {
  26038. var e = this.transitionStage;
  26039. if (this.interrupted = !1, this.transitionStage = w.None, this.resetSpecialTransition(), null !== this.destinationItem && this.setCurrentItem(this.destinationItem), this.tourIsPlaying || (this.player.disablePreRendering(), this.player.mode === u.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()), this.emit("update.controls"), this.currentScript && (this.model.enableTagMovie && e === w.Interlude || this.model.enableTagMovie && e === w.Aiming && null === this.nextFunc)) this.emit("gotoheighlight_done"), G.R.pafter();
  26040. else if (this.nextFunc) {
  26041. var i = this.nextFunc;
  26042. this.nextFunc = null, i()
  26043. } else this.emit("gotoheighlight_done"), G.R.pafter()
  26044. }, n.prototype.awaitCompletion = function(t, e) {
  26045. this.nextFunc = e, t()
  26046. }, n.prototype.updateSuccessFunction = function(t) {
  26047. this.nextFunc = t
  26048. }, n.prototype.interrupt = function(t, e) {
  26049. return !(!this.wouldInterrupt() || !this.canInterrupt()) && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled), this.tourIsPlaying = !1, this.interrupted = !0, this.nextFunc = null, this.emit(d.ActionInterruped), null != t || (t = m.BEGINNING), this.player.interruptAndFastForward(t, e), !0)
  26050. }, n.prototype.wouldInterrupt = function() {
  26051. return this.transitionStage !== w.None
  26052. }, n.prototype.intermediateState = function() {
  26053. return this.transitionStage !== w.None
  26054. }, n.prototype.isInterrupted = function() {
  26055. return this.interrupted
  26056. }, n.prototype.canInterrupt = function() {
  26057. return this.transitionStage !== w.Aiming && this.transitionStage !== w.Moving || this.transitionStage === w.Moving && this.player.mode === u.PANORAMA && this.nextWarpStyle !== h.BLACK
  26058. }, n.prototype.pauseWalkingSection = function() {
  26059. this.walkingSectionPaused = !0
  26060. }, n.prototype.clearWalkingSectionPaused = function() {
  26061. this.walkingSectionPaused = !1
  26062. }, n.prototype.autoTour = function() {
  26063. G.settings.nestscenes && G.settings.nestscenes.scenes && G.settings.nestscenes.scenes.length && !G.settings.nestscenes.scenes[0].script && a.warp.auto >= 0 && s.trigger({
  26064. duration: 1e3 * Math.min(300, a.warp.auto),
  26065. done: function() {
  26066. this.playTour()
  26067. }.bind(this),
  26068. name: "_atr"
  26069. })
  26070. }, n.prototype.atDestinationPano = function() {
  26071. if (!this.player.currentPano || null === this.destinationItem) return !1;
  26072. var t = this.player.currentPano.id;
  26073. if (void 0 === t) return !1;
  26074. var e = this.model.heroLocations;
  26075. return null !== this.destinationItem && void 0 !== e[this.destinationItem] && t == e[this.destinationItem].panoId
  26076. }, n.prototype.redirectToItem = function(t, e) {
  26077. if (null != t)
  26078. if (this.wouldInterrupt())
  26079. if (this.player.mode !== u.TRANSITIONING) {
  26080. y.debug("Director.redirectToItem() -> Redirecting to " + t + " via " + e);
  26081. var i = function() {
  26082. s.setTimeout(function() {
  26083. this.setDestinationItem(t), this.goToDestination(!0, m.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  26084. }.bind(this), 0)
  26085. }.bind(this);
  26086. this.interrupt(m.END, 0), this.updateSuccessFunction(i)
  26087. } else y.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  26088. else y.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  26089. else y.warn("Director.redirectToItem() -> Redirecting to null item.")
  26090. }, n.prototype.useSpecialTransition = function(t) {
  26091. void 0 !== t && this.defaultWarpStyle !== h.BLACK && y.debug("useSpecialTransition(): " + t), this.nextWarpStyle = this.defaultWarpStyle
  26092. }, n.prototype.resetSpecialTransition = function() {
  26093. this.nextWarpStyle = this.defaultWarpStyle
  26094. }, n.prototype.arrivedAtDestination = function(t) {
  26095. if (this.player.flying || this.player.isWarping()) y.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  26096. else {
  26097. this.transitionStage = w.Aiming;
  26098. var e = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  26099. this.player.model.fadePanoMarkers(0), this.tour360view(), this.awaitCompletion(function() {
  26100. this.resetSpecialTransition(), t ? this.player.aimTourCamera(this.destinationItem, v.Hide, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  26101. }.bind(this), e)
  26102. }
  26103. }, n.prototype.toast = function(t) {
  26104. setTimeout((function() {
  26105. document.getElementsByClassName("toast-wrap")[0].getElementsByClassName("toast-msg")[0].innerHTML = t;
  26106. var e = document.getElementsByClassName("toast-wrap")[0];
  26107. e.className = e.className.replace("toastAnimate", ""), setTimeout((function() {
  26108. e.className = e.className + " toastAnimate"
  26109. }), 10)
  26110. }), 10)
  26111. }, n.prototype.tour360view = function() {
  26112. this.model
  26113. }, n.prototype.goToDestination = function(t, e, i, n) {
  26114. if (this.onTheBus = !0, this.emit("update.controls"), this.player.updateLastView(), n || !this.atDestinationPano())
  26115. if (this.player.flying || this.player.isWarping()) y.warn("Cannot go to new destination while player is flying or warping.");
  26116. else {
  26117. var r = this.model.getHeroDescriptorByIndex(this.destinationItem),
  26118. o = null,
  26119. a = null;
  26120. if (this.player.mattertagManager.update360Tags(r.panoId), r.isPano()) {
  26121. var s = 0 === this.destinationItem || t ? h.BLACK : this.nextWarpStyle;
  26122. a = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, g.Slow, s, e, i, this.actionComplete.bind(this)), o = this.arrivedAtDestination.bind(this, !0)
  26123. } else a = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)), o = this.arrivedAtDestination.bind(this, !1);
  26124. this.transitionStage = w.Moving, this.model.fadePanoMarkers(0), this.awaitCompletion(function() {
  26125. a()
  26126. }.bind(this), o), this.emit("update.controls")
  26127. }
  26128. else this.arrivedAtDestination(!0)
  26129. }, n.prototype.tourInterlude = function() {
  26130. if (this.model.fadePanoMarkers(0), this.emit("update.controls"), this.tourIsPlaying) return this.atEndOfTour() && !this.endlessLoop ? (this.stopTour(), void(this.player.mode === u.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  26131. this.transitionStage = w.Interlude, this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  26132. }.bind(this), this.goNext.bind(this))
  26133. }, n.prototype.playTour = function(t) {
  26134. this.bounceable() || (this.tourIsPlaying ? y.info("tour is already playing") : this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle), this.reachSource = "play", this.tourIsPlaying = !0, this.wasZoomEnabled = this.player.zoomEnabled, this.player.zoomEnabled = !1, this.resetSpecialTransition(), this.emit("update.controls"), this.player.enablePreRendering(), this.walkingSectionPaused ? (this.clearWalkingSectionPaused(), this.goToDestination()) : this.goNext()))
  26135. }, n.prototype.hideTourBar = function() {}, n.prototype.stopTour = function() {
  26136. this.emit("tourStop"), this.isInterrupted() || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled), this.tourIsPlaying = !1, this.interrupt(), this.clearWalkingSectionPaused(), this.resetSpecialTransition(), this.emit("update.controls")), this.hideTourBar()
  26137. }, n.prototype.goToHighlight = function(t) {
  26138. if (this.canInterrupt() || !this.wouldInterrupt()) {
  26139. if (this.wouldInterrupt() && (t === this.destinationItem ? this.interrupt() : this.redirectToItem(t, "goToHighlight")), this.isInterrupted()) return void(G.R.fgotoh = !1);
  26140. this.clearWalkingSectionPaused(), this.setDestinationItem(t), this.useSpecialTransition("Hilight"), this.goToDestination()
  26141. }
  26142. }, n.prototype.goToHighlightByLocation = function(t) {
  26143. var e = this.model.heroLocations.findIndex((function(e) {
  26144. return !(!e.panoId || e.panoId != t)
  26145. }));
  26146. if (this.canInterrupt() || !this.wouldInterrupt()) {
  26147. if (y.debug("<tour.goto " + e + ">"), this.wouldInterrupt() && (e === this.destinationItem ? this.interrupt() : this.redirectToItem(e, "goToHighlight")), this.isInterrupted()) return;
  26148. this.clearWalkingSectionPaused(), this.setDestinationItem(e), this.useSpecialTransition("Hilight"), this.goToDestination()
  26149. }
  26150. }, n.prototype.prevHighlight = function() {
  26151. this.bounceable() || (this.player.emit("tour_manual", "prev"), this.interrupt(m.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(), this.reachSource = "prev", this.goPrev()))
  26152. }, n.prototype.nextHighlight = function() {
  26153. this.bounceable() || (this.player.emit("tour_manual", "next"), this.interrupt(m.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(), this.reachSource = "next", this.goNext()))
  26154. }, n.prototype.handleOperation = function(t) {
  26155. if ("changemode" === t.type) {
  26156. var e = t.mode;
  26157. this.remoteChangeMode(e)
  26158. } else if ("floorchange" === t.type) {
  26159. var i = t.floorIndex;
  26160. "all" === i ? this.showAllFloors() : this.player.gotoFloor(i, "remote")
  26161. }
  26162. }, n.prototype.changeMode = function(t, e) {
  26163. this.connect.getSyncState() && !G.measureMode && (this.connect.remoteControl || this.connect.sync || this.connect.sendOperation({
  26164. type: "changemode",
  26165. mode: t
  26166. }), this.evalChangeMode(t, e))
  26167. }, n.prototype.remoteChangeMode = function(t) {
  26168. this.evalChangeMode(t)
  26169. }, n.prototype.evalChangeMode = function(t, e) {
  26170. var i = e || "gui";
  26171. switch (this.wouldInterrupt() && this.interrupt(), this.player.controls[t].emit("interaction." + i), this.clearWalkingSectionPaused(), t) {
  26172. case u.PANORAMA:
  26173. this.player.insideMode();
  26174. break;
  26175. case u.DOLLHOUSE:
  26176. case u.FLOORPLAN:
  26177. this.player.flyToNewMode({
  26178. mode: t
  26179. })
  26180. }
  26181. }, n.prototype.atEndOfTour = function() {
  26182. return this.currentItem >= this.nItems - 1
  26183. }, n.prototype.firstDestination = function() {
  26184. if (this.nItems <= 0) return null;
  26185. for (var t = 0; t < this.nItems; t++)
  26186. if (this.model.images.list[t].script === this.currentScript) return t;
  26187. return 0
  26188. }, n.prototype.finalDestination = function() {
  26189. if (this.nItems <= 0) return null;
  26190. for (var t = this.nItems - 1; t >= 0; t--)
  26191. if (this.model.images.list[t].script === this.currentScript) return t;
  26192. return 0
  26193. }, n.prototype.goPrev = function() {
  26194. this.tourAdvance(-1)
  26195. }, n.prototype.goNext = function() {
  26196. null === this.currentItem && (this.currentItem = this.finalDestination());
  26197. for (var t, e = !1, i = this.currentItem + 1; i < this.nItems; i++)
  26198. if (this.model.images.list[i].script === this.currentScript) {
  26199. t = i - this.currentItem, e = !0;
  26200. break
  26201. } e || (t = this.nItems - this.currentItem), 0 === t && (t = 1), this.tourAdvance(t)
  26202. }, n.prototype.setDestinationItem = function(t) {
  26203. t > this.nItems && (t = this.firstDestination()), this.destinationItem = t, this.emit("update.controls")
  26204. }, n.prototype.setCurrentItem = function(t) {
  26205. this.currentItem = t, this.emit("update.controls")
  26206. }, n.prototype.nextItem = function(t) {
  26207. return t ? t > this.nItems && this.endlessLoop ? this.firstDestination() : t < this.nItems ? t + 1 : void 0 : this.firstDestination()
  26208. }, n.prototype.prevItem = function(t) {
  26209. return null === t ? this.firstDestination() : t < 0 ? this.endlessLoop ? this.lastDestination() : null : t - 1
  26210. }, n.prototype.tourAdvance = function(t) {
  26211. y.debug("tourAdvance(" + t + ")"), null === this.currentItem || void 0 === this.currentItem ? this.setDestinationItem(this.firstDestination()) : this.setDestinationItem(this.currentItem + t), this.destinationItem < 0 ? (this.setDestinationItem(this.finalDestination()), this.useSpecialTransition("reverse-looping to end")) : this.destinationItem >= this.nItems && (this.setDestinationItem(this.firstDestination()), this.useSpecialTransition("looping back to start")), this.goToDestination()
  26212. }, n.prototype.compassAdd = function(t) {
  26213. this.model.adjustCompass += t
  26214. }, n.prototype.compassReset = function(t) {
  26215. this.model.adjustCompass = t
  26216. }, t.exports = n
  26217. }, function(t, e, i) {
  26218. (function(e) {
  26219. (function(n) {
  26220. function r(t) {
  26221. this.player = null, this.director = null, this.modelManager = null, this.container = null, this.mattertagManager = null, this.fadeInSpeed = t, null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  26222. }
  26223. var o = i(0),
  26224. a = i(2),
  26225. s = (i(7), i(20)),
  26226. l = i(70),
  26227. u = i(1),
  26228. h = i(5),
  26229. c = (i(24), i(31), i(21)),
  26230. d = i(42),
  26231. p = i(8),
  26232. f = i(10),
  26233. m = new a(n);
  26234. r.prototype.init = function(t, e, i, n, r) {
  26235. this.player = e, this.director = t, this.modelManager = i, this.mattertagManager = n, this.container = r, this.updateModel(), this.bindEvents()
  26236. }, r.prototype.bindEvents = function() {
  26237. this.modelManager.on(c.ActiveModelChanged, this.updateModel.bind(this)), this.player.on(s.ModeChanging, this.handlePlayerModeChanging.bind(this)), this.player.on(s.ModeChanged, this.handlePlayerModeChanged.bind(this)), this.player.on(s.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)), this.player.on(s.StartInside, this.handleStartInside.bind(this)), this.player.on(s.StartOutside, this.handleStartOutside.bind(this)), this.player.on(s.WarpStarted, this.handleWarpStarted.bind(this)), this.director.on(l.ActionInterrupted, this.handleActionInterruption.bind(this)), this.mattertagManager.on(d.TagActivated, this.onMattertagActivated.bind(this)), this.mattertagManager.on(d.TagNavigation, this.onNavigationToMattertag.bind(this))
  26238. }, r.prototype.updateModel = function() {
  26239. this.model = this.modelManager.getActiveModel()
  26240. }, r.prototype.handleWarpStarted = function() {
  26241. this.hidePlayerReticule()
  26242. }, r.prototype.onMattertagActivated = function() {
  26243. this.hidePlayerReticule()
  26244. }, r.prototype.onNavigationToMattertag = function() {
  26245. this.hidePlayerReticule()
  26246. }, r.prototype.handlePlayerModeChanging = function(t, e, i) {
  26247. var n = this.modelManager.getActiveModel(),
  26248. r = this.player.is360View(e, i) || this.director.tourIsPlaying ? 0 : u[e].markerOpacity;
  26249. n.fadePanoMarkers(r), n.setMode(e)
  26250. }, r.prototype.handlePlayerModeChanged = function(t, e) {
  26251. var i = this.modelManager.getActiveModel(),
  26252. n = e === h.PANORAMA ? o.DoubleSide : o.FrontSide;
  26253. i.setSide(n), i.setMode(e), "dollhouse" === e && (G.R.lon = 0, G.R.lastlon = void 0)
  26254. }, r.prototype.handleClosestPanoChanging = function(t, e, i) {
  26255. i !== h.TRANSITIONING && (t && !this.director.tourIsPlaying && t.hoverOff(i), e && !this.director.tourIsPlaying && e.hoverOn(i))
  26256. }, r.prototype.handleActionInterruption = function() {}, r.prototype.handleStartInside = function(t) {
  26257. var e = u[this.player.mode],
  26258. i = t ? 0 : e.transitionTime * e.skyboxOpacityLength;
  26259. this.fadeIn(this.fadeInSpeed), this.model.alpha = 0, this.model.skybox.material.uniforms.opacity.value = 1, this.model.fadePanoMarkers(t ? 0 : e.markerOpacity);
  26260. var n = this.player.reticule;
  26261. p.start(f.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  26262. }, r.prototype.handleStartOutside = function(t) {
  26263. this.fadeIn(t)
  26264. }, r.prototype.fadeIn = function(t) {
  26265. null != t || (t = 2e3, m.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")), e(this.container)
  26266. .fadeIn(t)
  26267. }, r.prototype.hidePlayerReticule = function() {
  26268. this.player.reticule.hide()
  26269. }, t.exports = r
  26270. })
  26271. .call(this, "/js/DisplayController.js")
  26272. })
  26273. .call(this, i(6))
  26274. }, function(t, e, i) {
  26275. (function(e) {
  26276. var n = i(0),
  26277. r = (i(11), i(1)),
  26278. o = i(2),
  26279. a = i(9),
  26280. s = i(25),
  26281. l = i(19),
  26282. u = i(147),
  26283. h = i(12),
  26284. c = i(8),
  26285. d = i(45),
  26286. p = i(51),
  26287. f = i(74),
  26288. m = i(44),
  26289. g = i(61),
  26290. v = i(62),
  26291. y = i(37),
  26292. b = i(52),
  26293. w = i(54),
  26294. x = i(35),
  26295. M = i(180);
  26296. new o("js/showcase");
  26297. n.ImageUtils.crossOrigin = r.crossOrigin, t.exports = {
  26298. shaders: h,
  26299. transitions: c,
  26300. Model: u,
  26301. Chunk: d,
  26302. Floor: m,
  26303. Skybox: f,
  26304. Reticule: p,
  26305. Panorama: l,
  26306. DollhouseCamera: g,
  26307. FloorplanCamera: v,
  26308. PanoramaCamera: y,
  26309. DollhouseControls: b,
  26310. FloorplanControls: w,
  26311. PanoramaControls: x,
  26312. initS: function(t, i) {
  26313. if (!t.url) throw 'getModel(): missing parameter "url"';
  26314. t.autoload = void 0 === t.autoload || t.autoload;
  26315. var n = s.parseModelid(t.url);
  26316. t.urlBase = n.urlBase, t.urlModel = n.urlModel, t.urlFiles = n.urlFiles;
  26317. var r = this._getPlatformError();
  26318. return r ? e.Deferred()
  26319. .reject(r)
  26320. .promise() : (this.options = t, this.createS(i))
  26321. },
  26322. _getPlatformError: function() {
  26323. var t = (new M)
  26324. .getResult();
  26325. return "IE" === t.browser.name && parseInt(t.browser.major) < 11 ? "webgl-unsupported" : "iOS" === t.os.name && /^[0-7][$\.]/.test(t.os.version) ? "webgl-ios" : window.WebGLRenderingContext ? null : "webgl-unsupported"
  26326. },
  26327. _loadModel: function(t) {
  26328. return e.when(t)
  26329. },
  26330. createS: function(t) {
  26331. t.nestscenes = s.normalizeModeldata(t.nestscenes, a);
  26332. var i = new u(this.options, t);
  26333. return e.when(i)
  26334. }
  26335. }
  26336. })
  26337. .call(this, i(6))
  26338. }, function(t, e, i) {
  26339. (function(e) {
  26340. i(148);
  26341. var n = i(149),
  26342. r = i(0),
  26343. o = i(11),
  26344. a = i(150),
  26345. s = i(151),
  26346. l = i(5),
  26347. u = i(17),
  26348. h = i(44),
  26349. c = i(154),
  26350. d = i(45),
  26351. p = i(1),
  26352. f = i(2),
  26353. m = i(155),
  26354. g = i(19),
  26355. v = i(160),
  26356. y = i(166),
  26357. b = i(175),
  26358. w = i(176),
  26359. x = i(8),
  26360. M = i(7),
  26361. T = i(3),
  26362. S = i(177),
  26363. _ = i(178),
  26364. A = i(72),
  26365. P = i(14),
  26366. C = i(4)
  26367. .EventEmitter,
  26368. E = i(73)(),
  26369. D = new f("/js/model/Model.js");
  26370. function L(t, e) {
  26371. this.settings = e, G.model = this, e.floors = "", r.Object3D.call(this), this.modelid = e.basic.model.modelid, this.moreHouse = e.nestrecommends ? 0 === e.nestrecommends.models.length ? null : e.nestrecommends.models : null;
  26372. var i = e.basic;
  26373. G.settings.basic.menu.compass_enable = !0, window.disclaimer && window.disclaimer.content && i.user && 1 !== parseInt(i.user.group) && (i.model.disclaimer = window.disclaimer), this.data = {
  26374. modelid: i.model.modelid,
  26375. name: i.model.name,
  26376. floors: "",
  26377. image: -1 === e.nestscenes.backgroundimgurl.indexOf("background.") ? e.nestscenes.backgroundimgurl : "",
  26378. mobileimg: e.nestscenes.backgroundmobileimgurl && e.nestscenes.backgroundmobileimgurl.indexOf("mobile.") >= 0 ? e.nestscenes.backgroundmobileimgurl : "",
  26379. images: e.nestscenes,
  26380. player_options: {
  26381. highlight_reel: !0,
  26382. tour_buttons: !0,
  26383. contact_email: !0,
  26384. address: i.menu.address_enable,
  26385. contact_name: i.menu.contact_name_enable,
  26386. presented_by: i.menu.producer_enable,
  26387. floor_plan: !0,
  26388. dollhouse: !0,
  26389. fast_transitions: !1,
  26390. model_summary: i.menu.description_enable,
  26391. contact_phone: i.menu.phone_enable,
  26392. model_name: !0,
  26393. autoplay: !1,
  26394. bottom_presented_by: i.menu.bottom_presented_enable,
  26395. show3d: void 0 === i.menu.single_indoor || !i.menu.single_indoor,
  26396. businessname: i.menu.businessname_enable,
  26397. innerimage: i.menu.innerimage_enable
  26398. },
  26399. camera_start: null,
  26400. summary: i.menu.description,
  26401. description_voice_url: i.menu.description_voice_url,
  26402. presented_by: i.menu.producer,
  26403. address: i.menu.address,
  26404. contact_name: i.menu.contact_name,
  26405. contact_phone: i.menu.phone,
  26406. contact_email: i.menu.contact_email,
  26407. bottom_presented_by: i.menu.bottom_presented_by,
  26408. audio: i.model.audio,
  26409. businessname: i.menu.businessname,
  26410. innerimage: i.menu.innerimage,
  26411. orientations: e.locations.orientations,
  26412. orientationkey: e.locations.orientationkey,
  26413. orientation_correct: i.menu.orientation_correct
  26414. };
  26415. var o = T.valueFromHash("cleanui", 0);
  26416. if (o && (G.conf.isCleanUI = o), this.settings.panorama_settings && (p.panoramaSettings = this.settings.panorama_settings, p.screenshot ? p.insideFOV = p.panoramaSettings.screenshot_fov82 ? 82 : 70 : p.insideFOV = p.panoramaSettings.loading_fov82 ? 82 : 70), e.nestmeasure ? this.nestmeasure = e.nestmeasure : this.nestmeasure = {
  26417. info: [],
  26418. settings: {
  26419. unit: 1
  26420. }
  26421. }, this.scene_enable = i.menu.scene_enable, this.scene_autoplay = i.menu.scene_autoplay, this.single_3D = i.menu.single_3D, this.innermap_enable = !1, this.innermap_type = i.menu.innermap_type, this.innermap_imgurl = i.menu.innermap_imgurl, this.outermap_enable = i.menu.outermap_enable, this.outermap_type = i.menu.outermap_type, this.outermap_url = i.menu.outermap_url, this.visiotors_enable = i.menu.visiotors_enable, this.mlanguage_enable = i.menu.mlanguage_enable, this.measure_enable = i.menu.measure_enable, this.mlanguage_type = null, this.t_logo_enable = i.menu.t_logo_enable, this.t_logo_url = i.menu.t_logo_url, this.house_type_enabled = i.menu.house_type_enabled, this.floorplan_enable = !1 !== i.menu.floorplan_enable, this.inside_limit = 51, this.model_name_style = i.menu.model_name_style, this.menu_autohide = i.menu.menu_autohide, this.share_enable = i.model.share_enable, this.startup_type = i.menu.startup_type || 3, this.switch_scene_type = i.menu.switch_scene_type, this.oauth = i.menu.oauth, this.back_url = i.menu.back_url, this.entrance = e.building.house ? e.building.house.entrance : null, this.entranceMesh = null, this.rooms_real = e.building.rooms, this.panosUV = [], this.buildFloors = e.building, i.menu.house_type_url ? this.house_type_url = i.menu.house_type_url : e.building.floors && e.building.floors[0] && (this.house_type_url = e.building.floors[0].planurl), this.building_tag_enable = i.model.building_tag_enable, this.tour_tag_enable = i.model.tour_tag_enable, G.P = {
  26422. a: .025,
  26423. b: 0,
  26424. c: .01
  26425. }, this.loading_enable = i.menu.loading_enable, this.iframe_screen_enable = i.menu.iframe_screen_enable, this.straight_enable = i.menu.straight_enable, this.catalogue = e.catalogue, this.catalogue && ((!this.catalogue.tagopentime || this.catalogue.tagopentime < 0) && (this.catalogue.tagopentime = 5), (!this.catalogue.mediamaxtime || this.catalogue.mediamaxtime < 0) && (this.catalogue.mediamaxtime = 180), (!this.catalogue.iframemaxtime || this.catalogue.iframemaxtime < 0) && (this.catalogue.iframemaxtime = 20)), p.zoom.enabled = !0, e.nestscenes.scenes && e.nestscenes.scenes.length > 0) {
  26426. for (var s = -1, u = 0; u < e.nestscenes.scenes.length; u++)
  26427. if (1 !== e.nestscenes.scenes[u].script) {
  26428. s = u;
  26429. break
  26430. } - 1 !== s && (e.nestscenes.scenes[s].init_point = !0, this.normalMovie = !0)
  26431. }
  26432. this.outline_fills = e.building.outlines, this.language = null, this.language_type = null, this.options = t, this.urls = new a(t.urlFiles), this.isPublic = 2 !== e.basic.privacy, this.images = new S(this), this.images.extend(e.nestscenes.scenes), this.scenes360 = [], this.points = e.locations.points, this.gotoFrom360Item = -1, e.nestscenes.path = n.Catalogue, this.switch_scene_type = 2, this.jfData = null, e.jf && e.jf.enable && e.jf.dataset.length && (this.jfData = e.jf.dataset, G.R.arrSet = e.jf.dataset, G.R.arrSet.forEach((function(t, e) {
  26433. var i = G.R.arrSet[e].audiourl;
  26434. E.load(i)
  26435. })));
  26436. for (s = -1, u = 0; u < e.nestscenes.scenes.length; u++)
  26437. if (1 === e.nestscenes.scenes[u].script) {
  26438. s = u;
  26439. break
  26440. } - 1 !== s && (this.enableTagMovie = !0);
  26441. var d = null,
  26442. f = null;
  26443. if (this.images.getLength() > 0) {
  26444. var m = this.images.list.length,
  26445. g = this.points.length;
  26446. for (u = 0; u < m; u++) 1 == this.images.list[u].type ? -1 == this.gotoFrom360Item && (d = this.images.list[u]._camera._locationid, f = this.images.list[u]._camera._rotation, this.gotoFrom360Item = u) : 2 == this.images.list[u].type && this.scenes360.push(this.images.list[u]);
  26447. if (!d)
  26448. for (u = 0; u < m; u++)
  26449. for (s = 0; s < g; s++) this.points[s].locationid == this.images.list[u]._camera._locationid && (1 == this.points[s].type ? -1 == this.gotoFrom360Item && (d = this.images.list[u]._camera._locationid, f = this.images.list[u]._camera._rotation, this.gotoFrom360Item = u) : this.scenes360.push(this.images.list[u]));
  26450. if (!d)
  26451. for (u = 0; u < g; u++)
  26452. if (1 == this.points[u].type) {
  26453. d = this.points[u].locationid, f = this.points[u].rotation, this.gotoFrom360Item = this.images.getLength();
  26454. break
  26455. } if (null != d) {
  26456. var y = {
  26457. init_point: !0,
  26458. name: "",
  26459. sceneid: "test",
  26460. shortcuturl: "",
  26461. _camera: {
  26462. _locationid: d,
  26463. _rotation: f,
  26464. _type: 0,
  26465. _viewpoint: new r.Vector3(0, 0, 0),
  26466. _zoom: 0,
  26467. _zoom_enable: 0
  26468. }
  26469. };
  26470. this.images.add(y)
  26471. }
  26472. } - 1 == this.gotoFrom360Item && (this.gotoFrom360Item = 0), this.enableOri = i.model.orientation, T.isMobile() || (this.enableOri = !1), G.ori.flag = !1, this.vr_num = 0, this.vr_enable = !(null != i.menu.vr_enable && !i.menu.vr_enable), this.vr_enable && this.vr_num++, this.enableOri && this.vr_num++, this.heroImage = this.images.getbg(), this.heroLocations = [], this.outdoorPanoLocations = [], this.floors = new c(this), this.floorsEnabled = void 0 === t.floors || t.floors, this.changingFloor = !1, this.chunks = [], this.panos = new v, this.colliders = [], this.loadPanosPromise = null, this.loadMeshTexturesPromise = null, this.meshTexturesLoaded = !1, this.mattertags = {}, this.tagsShown = !1, this.shouldShowMattertags = !1, this.has360Views = !0, this.supportedModes = {}, this.supportedModes[l.PANORAMA] = !0, this.supportedModes[l.DOLLHOUSE] = !e.player_options || e.player_options.dollhouse, this.supportedModes[l.FLOORPLAN] = !e.player_options || e.player_options.floor_plan, this.supportedModes[l.TRANSITIONING] = !0, this.steeringWheel = null, this.steeringWheelVisible = null, this.supportsTiles = !!i.model.multiple, p.tiling.allowUltraHighResolution = !!i.model.hq, p.tiling.mobileHighQualityOverride = !!i.model.mobile2k, this.adjustCompass = parseFloat(i.model.adjustCompass ? i.model.adjustCompass : 0), this.mode = l.DOLLHOUSE, this.size = null, this.center = null, this.boundingBox = new r.Box3, this.currentFloor = null, this.allFloorsVisible = !0, this.projectedPano0 = null, this.projectedPano1 = null, this.floorsEnabled && e.floors && -1 !== e.floors.indexOf(",") && e.floors.split(",")
  26473. .forEach(function(t, e) {
  26474. this.addFloor(new h(this, e, t.trim()))
  26475. }.bind(this)), this.floorsHeight = this.setFloorsHeight(e), this.enablefilter = !1;
  26476. var b = G.settings.locations.points;
  26477. for (u = 0; u < b.length; u++) !b[u].color || 0 === b[u].color.brightness && 0 === b[u].color.contrast && 1 === b[u].color.gamma && 0 === b[u].color.hue && 0 === b[u].color.saturation && 0 === b[u].color.vibrance || (this.enablefilter = !0);
  26478. this.waitQueue = [], this.on("load", function(t) {
  26479. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter((function(t) {
  26480. return !t.isLoadedCallback()
  26481. })), 0 === this.waitQueue.length && this.emit("waiting-done"))
  26482. }.bind(this)), this.setupCustomProperties()
  26483. }
  26484. L.prototype = Object.create(r.Object3D.prototype), M.extend(L, C), L.prototype.setupCustomProperties = function() {
  26485. var t = p.modelAlpha;
  26486. Object.defineProperty(this, "alpha", {
  26487. get: function() {
  26488. return t
  26489. },
  26490. set: function(e) {
  26491. t = e, this.chunks.forEach((function(e) {
  26492. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  26493. }))
  26494. }
  26495. })
  26496. };
  26497. var O = function() {
  26498. var t = parseInt(T.getQueryString("lang"));
  26499. return t || (t = function() {
  26500. var t = null;
  26501. switch (window.navigator.userLanguage ? window.navigator.userLanguage.substring(0, 2)
  26502. .toLowerCase() : window.navigator.language.substring(0, 2)
  26503. .toLowerCase()) {
  26504. case "zh":
  26505. t = 3;
  26506. break;
  26507. case "en":
  26508. t = 1;
  26509. break;
  26510. case "ja":
  26511. t = 2;
  26512. break;
  26513. default:
  26514. t = 1
  26515. }
  26516. return t
  26517. }()), t
  26518. };
  26519. L.prototype.buildDollHouseCompass = function() {
  26520. var t = this,
  26521. e = new r.CircleGeometry(.5, 32),
  26522. i = new r.TextureLoader;
  26523. i.setCrossOrigin(!0);
  26524. var n = new r.Vector3;
  26525. n.x = (t.boundingBox.max.x - t.boundingBox.min.x) / 2, n.y = (t.boundingBox.max.y - t.boundingBox.min.y) / 2, n.z = (t.boundingBox.max.z - t.boundingBox.min.z) / 2, i.load("./images/ewsn_512.png", (function(i) {
  26526. var o = new r.MeshBasicMaterial({
  26527. map: i,
  26528. transparent: !0,
  26529. opacity: .9,
  26530. side: r.DoubleSide,
  26531. depthTest: !1
  26532. }),
  26533. a = new r.Mesh(e, o);
  26534. if (a.visible = null !== t.dollHouseCompass && t.dollHouseCompass, a.rotation.set(-Math.PI / 2, 0, 0), t.data.orientation_correct) {
  26535. var s = -t.data.orientation_correct * Math.PI / 180;
  26536. a.rotation.set(-Math.PI / 2, 0, s)
  26537. }
  26538. a.position.copy(n), t.add(a), t.dollHouseCompass = a
  26539. }))
  26540. }, L.prototype.buildStreeringWheel = function() {
  26541. var t = this,
  26542. e = new r.CircleGeometry(.62, 32),
  26543. i = new r.TextureLoader;
  26544. i.setCrossOrigin(!0);
  26545. var n = O(),
  26546. o = "./images/ewsn_512.png";
  26547. 1 == n ? o = "./images/ewsn_en_512.png" : 2 == n && (o = "./images/ewsn_jp_512.png"), i.load(o, (function(i) {
  26548. var n = new r.MeshBasicMaterial({
  26549. map: i,
  26550. transparent: !0,
  26551. opacity: .5,
  26552. side: r.DoubleSide,
  26553. depthTest: !1
  26554. }),
  26555. o = new r.Mesh(e, n);
  26556. if (o.visible = null !== t.steeringWheelVisible && t.steeringWheelVisible, o.rotation.set(-Math.PI / 2, 0, 0), t.data.orientation_correct) {
  26557. var a = -t.data.orientation_correct * Math.PI / 180;
  26558. o.rotation.set(-Math.PI / 2, 0, a)
  26559. }
  26560. t.add(o), t.steeringWheel = o
  26561. }))
  26562. }, L.prototype.showSteeringWheel = function() {
  26563. this.steeringWheel ? this.steeringWheel.visible = !0 : this.steeringWheelVisible = !0
  26564. }, L.prototype.hideSteeringWheel = function() {
  26565. this.steeringWheel ? this.steeringWheel.visible = !1 : this.steeringWheelVisible = !1
  26566. }, L.prototype.getCurrentHouseTypeImage = function() {
  26567. var t = "",
  26568. e = this.buildFloors.floors;
  26569. return (t = e && e.length > 0 && "number" == typeof this.currentFloor.floorIndex && this.currentFloor.floorIndex < e.lenght ? e[this.currentFloor.floorIndex] && e[this.currentFloor.floorIndex].planurl : this.house_type_url) ? t = "http:" === window.location.protocol ? t : t.replace("http:", "https:") : ""
  26570. }, L.prototype.toggleAlpha = function() {
  26571. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  26572. }, L.prototype.load = function(t) {
  26573. var i = function() {
  26574. return e.when(this.loadPanos(), this.loadMesh())
  26575. }.bind(this);
  26576. i = i(), t ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this));
  26577. var n = e.when(this.loadHighlightReel(), this.loadMattertags());
  26578. return e.when(i, n)
  26579. .done(this.build.bind(this))
  26580. }, L.prototype.loadMesh = function() {
  26581. var t = e.Deferred(),
  26582. i = this;
  26583. return y.load(i.urls, (function(e, n) {
  26584. if (0 === e.length) {
  26585. D.warn("No geometry found for model, loading faux geometry, disabling outside mode"), i.supportedModes[l.DOLLHOUSE] = !1, i.supportedModes[l.FLOORPLAN] = !1;
  26586. var o = new d({
  26587. geometry: new r.PlaneBufferGeometry(5, 5, 1, 1)
  26588. });
  26589. o.material.visible = !1, o.rotateX(-Math.PI / 2), o.geometry.computeBoundingBox(), e = [o]
  26590. }
  26591. e.forEach((function(t) {
  26592. var e = i.floorsEnabled ? A.parseFloor(t.name) : 0;
  26593. i.addChunk(e, t)
  26594. })), i.floors.sort(), t.resolve(i)
  26595. }), (function(e, i) {
  26596. t.notify(e, i)
  26597. }), (function(e) {
  26598. D.error(e), t.reject("loading-failed")
  26599. })), t.promise()
  26600. }, L.prototype.flyToTagid = function(t) {
  26601. if (!G.d.tourIsPlaying) {
  26602. G.player.mattertagManager.closeTag();
  26603. var e = this.getTagByTagid(t);
  26604. if (e) {
  26605. var i = {
  26606. pano: this.panos.index[e.locationId],
  26607. lookAtPoint: {
  26608. x: e.position.x,
  26609. y: e.position.y,
  26610. z: e.position.z
  26611. }
  26612. };
  26613. if (G.d.flyingtag) return;
  26614. G.d.flyingtag = !0, G.d.player.flyToPano(i, (function() {
  26615. G.d.player.mattertagManager.openTag(e), G.d.flyingtag = !1
  26616. }))
  26617. }
  26618. }
  26619. }, L.prototype.loadMeshTextures = function() {
  26620. return this.loadTexturesPromise || (this.loadTexturesPromise = b.load(this)
  26621. .then(function() {
  26622. this.meshTexturesLoaded = !0
  26623. }.bind(this))), this.loadTexturesPromise
  26624. }, L.prototype.generateEntrance = function(t) {
  26625. var e = t.world.ep,
  26626. i = t.world.sp,
  26627. n = new r.Vector3(e.x, e.y + .5, e.z),
  26628. o = new r.Vector3(i.x, i.y + .5, i.z),
  26629. a = (new r.Vector3)
  26630. .subVectors(n, o)
  26631. .divideScalar(2),
  26632. s = (new r.Vector3)
  26633. .subVectors(n, o)
  26634. .normalize(),
  26635. l = new r.Vector3(0, 1, 0),
  26636. u = (new r.Vector3)
  26637. .crossVectors(l, s),
  26638. h = l.angleTo(s),
  26639. c = (new r.Quaternion)
  26640. .setFromAxisAngle(u, h),
  26641. d = o.sub(a),
  26642. p = {
  26643. actiontype: 2,
  26644. base: {
  26645. y: d.y + .5,
  26646. x: d.x,
  26647. z: d.z
  26648. },
  26649. details: {
  26650. subtype: 0,
  26651. tagpictype: null,
  26652. title: this.settings.entry_door_text,
  26653. tagpicurl: "",
  26654. time: ""
  26655. },
  26656. enable: !0,
  26657. locationid: "location_10000",
  26658. normal: {
  26659. y: 1,
  26660. x: 0,
  26661. z: 0
  26662. },
  26663. showtitle: !0,
  26664. stem: {
  26665. direction: {
  26666. y: .1,
  26667. x: 0,
  26668. z: 0
  26669. },
  26670. enabled: !1
  26671. },
  26672. tagid: "1",
  26673. tagtitle: ""
  26674. },
  26675. f = new r.CylinderGeometry(.04, .16, .7, 4),
  26676. m = new r.MeshBasicMaterial({
  26677. color: 3342335
  26678. }),
  26679. g = new r.Mesh(f, m);
  26680. return g.position.copy(d), g.quaternion.multiply(c), g.visible = !0, {
  26681. mesh: g,
  26682. info: p
  26683. }
  26684. }, L.prototype.setEntranceState = function(t) {
  26685. this.entrance && this.entranceMesh && (this.entranceMesh.visible = t)
  26686. }, L.prototype.loadMattertags = function() {
  26687. var t = e.Deferred();
  26688. if (!p.mattertags.enabled || G.conf.screenshot) return t.resolve();
  26689. var i = this,
  26690. n = this.options.urlBase + "/play/data/" + this.modelid + "/nesttags";
  26691. return o.get(n, {
  26692. responseType: "json",
  26693. fetchNum: 1,
  26694. prefetchFrom: "nesttags",
  26695. auth: this.isPublic ? null : p.authorizationHeader
  26696. })
  26697. .done(function(e) {
  26698. if (!(e && e.setting && e.setting.display)) return t.resolve();
  26699. var n, r = e.info,
  26700. o = this.building_tag_enable,
  26701. a = this.tour_tag_enable;
  26702. if (o = isNaN(parseInt(o)) ? 1 : parseInt(o), a = isNaN(parseInt(a)) ? 1 : parseInt(a), r = r.filter((function(t) {
  26703. return 1 == o || 2 != parseInt(t.actiontype)
  26704. })), this.entrance && this.entrance.world && 1 == o) {
  26705. var s = this.generateEntrance(this.entrance);
  26706. r.push(s.info), this.entranceMesh = s.mesh, this.add(s.mesh)
  26707. }
  26708. var l = 0;
  26709. for (var u in G.titletags = [], r)(n = r[u])
  26710. .enable && (this.mattertags[u] = new m(this, u, n), n.showtitle && n.tagtitle && 12 !== n.details.templatetype && (n.details.tagpictype = 2, n.details.tagpicurl = n.tagtitle, this.mattertags[1e4 + parseInt(u)] = new m(this, 1e4 + parseInt(u), n)), 12 === n.details.templatetype && G.titletags.push(this.mattertags[u]));
  26711. if (n = {
  26712. actiontype: 1,
  26713. base: {
  26714. x: 1e4,
  26715. y: 1e4,
  26716. z: 1e4
  26717. },
  26718. details: {
  26719. description: "faketag",
  26720. subtype: 1,
  26721. tagpictype: 1,
  26722. tagpicurl: null,
  26723. templatetype: 9,
  26724. title: "faketag"
  26725. },
  26726. enable: !0,
  26727. flooridx: 0,
  26728. locationid: "location_01",
  26729. normal: {
  26730. x: 0,
  26731. y: 0,
  26732. z: 0
  26733. },
  26734. showtitle: !1,
  26735. stem: {
  26736. direction: {
  26737. x: 0,
  26738. y: 0,
  26739. z: 0
  26740. },
  26741. enabled: !1
  26742. },
  26743. tagid: "faketag"
  26744. }, this.mattertags[2e4] = new m(this, 2e4, n), this.buildFloors.rooms && 1 == a) {
  26745. var h = "";
  26746. l = 0;
  26747. this.buildFloors.rooms.forEach((function(t, e) {
  26748. t.connected_rooms && (h = t.roomidx, t.connected_rooms.forEach((function(t, e) {
  26749. t.position.y ? t.position.y = t.position.y + .1 : t.position.x = 0, n = {
  26750. actiontype: 1,
  26751. details: {
  26752. description: "区域跳转标签",
  26753. subtype: 0,
  26754. tagpictype: 2,
  26755. tagpicurl: null,
  26756. templatetype: 13,
  26757. title: t.target_name
  26758. },
  26759. enable: !0,
  26760. flooridx: 0,
  26761. locationid: "location_01",
  26762. showtitle: !1,
  26763. stem: {
  26764. direction: {
  26765. x: 0,
  26766. y: 0,
  26767. z: 0
  26768. },
  26769. enabled: !1
  26770. },
  26771. tagid: "faketag",
  26772. target_room: t.target_room,
  26773. target_scene: t.target_scene,
  26774. end_position: t.end_position,
  26775. base: {
  26776. x: t.position.x || 0,
  26777. y: t.position.y || 0,
  26778. z: t.position.z || 0
  26779. },
  26780. roomidx: h
  26781. }, i.mattertags[3e4 + parseInt(l)] = new m(i, 3e4 + parseInt(l), n), l++
  26782. })))
  26783. }))
  26784. }
  26785. t.resolve()
  26786. }.bind(this))
  26787. .fail((function() {
  26788. D.warn("Getting tags failed, not displaying tags."), t.resolve()
  26789. })), t
  26790. }, L.prototype.buildTagsForAddTag = function(t) {
  26791. var e = 0;
  26792. for (var i in this.mattertags) e++;
  26793. var n = new m(this, e, t);
  26794. this.mattertags[e] = n, this.mattertags[e].build(), this.mattertags[e].disc.material.opacity = 1
  26795. }, L.prototype.newBuildTagsForAddTag = function(t) {
  26796. var e = 0;
  26797. for (var i in this.delTag(t.tagid), this.mattertags) parseInt(i) < 1e4 && (e = parseInt(i) + 1);
  26798. var n = new m(this, e, t);
  26799. this.mattertags[e] = n, this.mattertags[e].build(), this.mattertags[e].disc.material.opacity = 1, t.showtitle && t.tagtitle && (e += 1e4, t.details.tagpictype = 2, t.details.tagpicurl = t.tagtitle, this.mattertags[e] = new m(this, e, t), this.mattertags[e].build(), this.mattertags[e].disc.material.opacity = 1)
  26800. }, L.prototype.delTag = function(t) {
  26801. var e = "closed",
  26802. i = "open",
  26803. n = "active",
  26804. r = null;
  26805. for (var o in this.mattertags)
  26806. if (this.mattertags[o] && this.mattertags[o].tagid && this.mattertags[o].tagid == t) {
  26807. r = this.mattertags[o];
  26808. break
  26809. } null != r && (r.floor.remove(r.obj3d), r.boardState !== i && r.boardState !== n || (r.setClosedState(), r.boardState = e), delete this.mattertags[o])
  26810. }, L.prototype.newAddScene = function(t) {}, L.prototype.getSceneLength = function() {
  26811. for (var t = this.settings.nestscenes.scenes, e = 0, i = 0; i < t.length; i++) 0 !== t[i].script && void 0 !== t[i].script || e++;
  26812. return e
  26813. }, L.prototype.build360TagsForAddTag = function(t) {
  26814. var e = Object.keys(this.mattertags)
  26815. .length,
  26816. i = this.mattertags[0],
  26817. n = JSON.parse(JSON.stringify(i.data));
  26818. n.base.x = t.base.x, n.base.y = t.base.y, n.base.z = t.base.z, n.details.title = t.details.title, n.details.templatetype = t.details.templatetype, n.locationid = t.locationid;
  26819. var r = new m(this, e, n);
  26820. return this.mattertags[e] = r, this.mattertags[e].build(), this.mattertags[e].disc.material.opacity = 1, n.locationid
  26821. }, L.prototype.removeScene = function(t) {
  26822. for (var e = this.heroLocations.length - 1; e >= 0; e--) this.heroLocations[e].panoId == t && this.heroLocations.splice(e, 1);
  26823. G.d.updateModel()
  26824. }, L.prototype.loadPanos = function() {
  26825. if (this.loadPanosPromise) return this.loadPanosPromise;
  26826. var t = new w(this),
  26827. i = this;
  26828. return this.loadPanosPromise = t.load()
  26829. .then((function(t) {
  26830. return i.data.sweeps && Object.keys(i.data.sweeps)
  26831. .length > 0 && (t = t.filter((function(t) {
  26832. return !(!i.data.sweeps[t.locationid] || void 0 === i.data.sweeps[t.locationid].enabled) && i.data.sweeps[t.locationid].enable
  26833. }))), i.panos.extend(t.map((function(t) {
  26834. return new g(i, t.locationid, t, i.supportsTiles)
  26835. }))), i.panos.forEach((function(t) {
  26836. if (p.delBK && 1 == t.alignmentType) {
  26837. var e = new Object;
  26838. e.id = t.id, e.u = t.u, e.v = t.v, i.panosUV.push(e)
  26839. }
  26840. t.neighbourUUIDs && (t.neighbourUUIDs.forEach((function(e) {
  26841. var n = i.panos.get(e);
  26842. n && i.panos.setNeighbour(t, n, !0)
  26843. })), t.neighbourPanos = i.panos.getNeighbours(t) || i.panos.setNeighbour(t, t, !0))
  26844. })), 0 === i.panos.length && (D.warn("Model has no panos, turning off inside mode"), i.supportedModes[l.PANORAMA] = !1), e.when(i)
  26845. })), this.loadPanosPromise
  26846. }, L.prototype.oldloadPanos = function() {
  26847. if (this.loadPanosPromise) return this.loadPanosPromise;
  26848. var t = new w(this);
  26849. return this.loadPanosPromise = t.load()
  26850. .then(function(t) {
  26851. return this.data.sweeps && Object.keys(this.data.sweeps)
  26852. .length > 0 && (t = t.filter(function(t) {
  26853. return !(!this.data.sweeps[t.locationid] || void 0 === this.data.sweeps[t.locationid].enabled) && this.data.sweeps[t.locationid].enabled
  26854. }.bind(this))), this.panos.extend(t.map(function(t) {
  26855. return new g(this, t.locationid, t, this.supportsTiles)
  26856. }.bind(this))), this.panos.forEach(function(t) {
  26857. if (p.delBK && 1 == t.alignmentType) {
  26858. var e = new Object;
  26859. e.id = t.id, e.u = t.u, e.v = t.v, this.panosUV.push(e)
  26860. }
  26861. }.bind(this)), this.panos.forEach(function(t) {
  26862. t.neighbourUUIDs && (t.neighbourUUIDs.forEach(function(e) {
  26863. var i = this.panos.get(e);
  26864. i && this.panos.setNeighbour(t, i, !0)
  26865. }.bind(this)), t.neighbourPanos = this.panos.getNeighbours(t) || this.panos.setNeighbour(t, t, !0))
  26866. }.bind(this)), 0 === this.panos.length && (D.warn("Model has no panos, turning off inside mode"), this.supportedModes[l.PANORAMA] = !1), e.when(this)
  26867. }.bind(this)), this.loadPanosPromise
  26868. }, L.prototype.loadHighlightReel = function() {
  26869. var t = e.Deferred(),
  26870. i = this.options.urlBase + "/play/data/" + this.modelid + "/nestscenes";
  26871. return o.get(i, {
  26872. responseType: "json",
  26873. fetchNum: 1,
  26874. prefetchFrom: "nestscenes",
  26875. auth: this.isPublic ? null : p.authorizationHeader
  26876. })
  26877. .done(function(e) {
  26878. t.resolve()
  26879. }.bind(this))
  26880. .fail((function() {
  26881. D.warn("Getting highlight reel failed, no highlights available"), t.resolve()
  26882. })), t
  26883. }, L.prototype.loadMeasures = function() {}, L.prototype.waitForLoad = function(t, e) {
  26884. e() || (this.waitQueue.push({
  26885. object: t,
  26886. isLoadedCallback: e
  26887. }), 1 === this.waitQueue.length && this.emit("waiting"))
  26888. }, L.prototype.update = function(t) {
  26889. this.panos.update(t)
  26890. }, L.prototype.hide = function() {
  26891. this.floors.hide()
  26892. }, L.prototype.show = function() {
  26893. this.floors.show()
  26894. }, L.prototype.floorNames = function() {
  26895. return this.floors.names()
  26896. }, L.prototype.warpDestFloors = function(t, e) {
  26897. if (t && this.floors.length === t.length) {
  26898. var i = t.findIndex(function(t) {
  26899. return t
  26900. }.bind(this)); - 1 !== i && this.setFloor(this.floors.list[i], null, e)
  26901. } else this.toggleAllFloors(!0)
  26902. }, L.prototype.setFloor = function(t, e, i) {
  26903. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor), this.allFloorsVisible = !1, this._setFloor(t, e, i)
  26904. }, L.prototype.toggleAllFloors = function(t) {
  26905. this.allFloorsVisible = void 0 !== t ? t : !this.allFloorsVisible, this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor), this._setFloor(this.currentFloor)
  26906. }, L.prototype._setFloor = function(t, e, i) {
  26907. e = e || this.mode, this.currentFloor = t, this.emit("floor.changed", t, e, this.currentFloor);
  26908. var n = null;
  26909. if (this.floors.list.forEach(function(t) {
  26910. t.toggle(t === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  26911. }.bind(this)), e === l.PANORAMA) {
  26912. if (this.show(), this.shouldShowMattertags && this.tagsShown)
  26913. for (n in this.mattertags) this.mattertags[n].show(p.showFloorDuration)
  26914. } else if ((e === l.FLOORPLAN || e === l.DOLLHOUSE) && this.shouldShowMattertags && this.tagsShown)
  26915. for (n in this.mattertags) {
  26916. var r = this.mattertags[n];
  26917. this.allFloorsVisible ? r.show(p.showFloorDuration) : r.floor === this.currentFloor ? r.show(p.showFloorDuration, p.showFloorDelay) : r.hide(p.hideFloorDuration, p.hideFloorDelay)
  26918. }
  26919. var o = this,
  26920. a = t;
  26921. x.start((function() {}), p.showFloorDelay, function() {
  26922. o.floors.forEach((function(t) {
  26923. t.chunks.forEach((function(e) {
  26924. e.renderOrder = t === a ? u.visibleFloor : u.ghostFloor
  26925. }))
  26926. }))
  26927. }.bind(this))
  26928. }, L.prototype.toggleExplode = function() {
  26929. this.floors.toggleExplodeHorizontal()
  26930. }, L.prototype.toggleExplodeUp = function() {
  26931. this.floors.toggleExplodeVertical()
  26932. }, L.prototype.nextFloor = function(t) {
  26933. return this.floors.nextFloor(this.currentFloor, t)
  26934. }, L.prototype.addFloor = function(t) {
  26935. this.floors.add(t)
  26936. }, L.prototype.getFloorAtPoint = function(t) {
  26937. return this.floors.getFloorAtPoint(t)
  26938. }, L.prototype.getTagByIdx = function(t) {
  26939. return t >= 1e4 && (t -= 1e4), this.mattertags[t]
  26940. }, L.prototype.getTagByTagid = function(t) {
  26941. for (var e = Object.keys(this.mattertags)
  26942. .length, i = 0; i < e; i++)
  26943. if (this.mattertags[i].tagid === t) return this.mattertags[i];
  26944. return null
  26945. }, L.prototype.addChunk = function(t, e) {
  26946. this.floors.getOrMakeFloor(t)
  26947. .addChunk(e), this.chunks.push(e)
  26948. }, L.prototype.setMode = function(t) {
  26949. if (!this.supportedModes[t]) throw new P("Mode not supported for this model: " + t);
  26950. this.mode = t, this.chunks.forEach((function(e) {
  26951. e.setMode(t)
  26952. }))
  26953. }, L.prototype.build = function() {
  26954. var t = this;
  26955. function i(t, e) {
  26956. return new r.Quaternion(t.x, t.y, t.z, t.w)
  26957. .multiply((new r.Quaternion)
  26958. .setFromAxisAngle(new r.Vector3(1, 0, 0), r.Math.degToRad(e)))
  26959. }
  26960. this.heroLocations = this.images.getHeroLocations(this.panos), this.has360Views = p.show360Views.enabled && this.heroLocations.some(function(t) {
  26961. return t.cameraMode === l.PANORAMA && this.panos.get(t.panoId) && !this.panos.get(t.panoId)
  26962. .isAligned()
  26963. }.bind(this)), null === this.heroImage && D.warn("No hero image defined."), this.currentFloor = this.floors.last(), this.floors.build(), this.colliders = this.floors.reduce((function(t, e) {
  26964. return t.concat(e.collider.children)
  26965. }), []);
  26966. var n = [],
  26967. o = [];
  26968. if (this.panos.forEach(function(t) {
  26969. 2 == t.alignmentType ? o.push(t) : n.push(t)
  26970. }.bind(this)), n.forEach(function(t) {
  26971. t.build1(), t.on("enter", function() {
  26972. t.floor !== this.currentFloor && this.setFloor(t.floor)
  26973. }.bind(this))
  26974. }.bind(this)), o.forEach(function(t) {
  26975. t.build1(), t.on("enter", function() {
  26976. t.floor !== this.currentFloor && this.setFloor(t.floor)
  26977. }.bind(this))
  26978. }.bind(this)), G.conf.isNewEditVersion && (parent.window.showHiddenPano ? G.editPanos = !0 : G.editPanos = !1), this.panos.forEach((function(e) {
  26979. if (e.build2(), 1 === e.alignmentType && G.conf.isNewEditVersion && G.editPanos) {
  26980. var i = {
  26981. actiontype: 1,
  26982. base: {
  26983. x: e.marker.position.x,
  26984. y: e.marker.position.y,
  26985. z: e.marker.position.z
  26986. },
  26987. details: {
  26988. templatetype: 9e3,
  26989. subtype: 0,
  26990. time: "2017-09-15 03:39:33",
  26991. title: "点击隐藏或显示全景点:" + e.id,
  26992. description: "pano使能",
  26993. tagpictype: 1
  26994. },
  26995. enable: !0,
  26996. locationid: e.id,
  26997. normal: {
  26998. x: 0,
  26999. y: 1,
  27000. z: 0
  27001. },
  27002. stem: {
  27003. direction: {
  27004. x: 0,
  27005. y: 1,
  27006. z: 0
  27007. },
  27008. enabled: !0
  27009. },
  27010. tagid: "pano_" + e.id
  27011. };
  27012. t.buildTagsForAddTag(i)
  27013. }
  27014. })), this.floors.forEach(function(t) {
  27015. this.boundingBox.union(t.boundingBox)
  27016. }.bind(this)), this.outline_fills) {
  27017. t = this;
  27018. this.outline_fills.forEach((function(e) {
  27019. var i = t.floors.get(e.flooridx)
  27020. .boundingBox.min.y + .8;
  27021. e.segments.forEach((function(e) {
  27022. var n = new r.Geometry;
  27023. e.forEach((function(t) {
  27024. n.vertices.push(new r.Vector3(t.x, i, -t.y))
  27025. }));
  27026. var o = new r.PointsMaterial({
  27027. color: 16711680,
  27028. size: .01,
  27029. transparent: !0,
  27030. opacity: 0
  27031. }),
  27032. a = new r.Points(n, o);
  27033. a.geometry.computeBoundingBox(), t.boundingBox.union(a.geometry.boundingBox)
  27034. }))
  27035. }))
  27036. }
  27037. for (var a in this.size = this.boundingBox.getSize(new r.Vector3), this.center = this.boundingBox.getCenter(new r.Vector3), this.floors.forEach(function(t) {
  27038. D.info("Floor " + t + ": " + t.children.length + " chunks, " + t.panos.length + " panos.")
  27039. }.bind(this)), this.panos.populate_path_graph(), this.skybox = new s(this.boundingBox), this.skybox.matrixWorldNeedsUpdate = !0, this.add(this.skybox), this.mattertags) 12 !== this.mattertags[a].type && this.mattertags[a].build();
  27040. if (1 == p.thirdCustomer && (null == this.floorNavigationMesh || null == this.floorNavigationMesh)) {
  27041. var u = new r.PlaneBufferGeometry(this.boundingBox.max.x - this.boundingBox.min.x, this.boundingBox.max.z - this.boundingBox.min.z),
  27042. h = new r.TextureLoader;
  27043. h.setCrossOrigin(!0);
  27044. var c = h.load("https://template2.3dnest.cn/dianli/" + this.modelid + ".png"),
  27045. d = new r.MeshBasicMaterial({
  27046. map: c,
  27047. side: r.FrontSide,
  27048. transparent: !0,
  27049. opacity: 1
  27050. });
  27051. this.floorNavigationMesh = new r.Mesh(u, d);
  27052. var f = (new r.Vector3)
  27053. .copy(this.boundingBox.getCenter(new r.Vector3)),
  27054. m = this.boundingBox.max.y,
  27055. v = f.clone()
  27056. .setY(m);
  27057. this.floorNavigationMesh.position.copy(v), "zq_sxex_17" == this.modelid ? this.floorNavigationMesh.quaternion.copy(i(this.floorNavigationMesh.quaternion, -95)) : "zq_dnjl_7" == this.modelid ? this.floorNavigationMesh.quaternion.copy(i(this.floorNavigationMesh.quaternion, -92)) : "zq_sxsx_18" == this.modelid ? this.floorNavigationMesh.quaternion.copy(i(this.floorNavigationMesh.quaternion, -95)) : "zq_ylck_24" == this.modelid ? this.floorNavigationMesh.quaternion.copy(i(this.floorNavigationMesh.quaternion, -92)) : this.floorNavigationMesh.quaternion.copy(i(this.floorNavigationMesh.quaternion, -90)), this.add(this.floorNavigationMesh)
  27058. }
  27059. return D.debug("Done building model"), g.raycastsDone > 0 && (D.warn("raycasts: " + g.raycastsDone), D.warn("raycasts skipped: " + g.raycastsSkipped)), this.buildRooms(), e.when(this)
  27060. }, L.prototype.buildRooms = function() {
  27061. this.rooms = new _(this), this.rooms.createFromChunks(this.chunks), this.rooms.calcRoomBoundaries()
  27062. }, L.prototype.updateProjectedPanos = function() {
  27063. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  27064. }, L.prototype.setProjectedPanos = function(t, e, i) {
  27065. null != i || (i = !0), i = !!i, this.projectedPano0 = t, this.projectedPano1 = e, this.skybox.material.setProjectedPanos(t, e, i), this.chunks.forEach((function(n) {
  27066. n.materialInside.setProjectedPanos(t, e, i)
  27067. }))
  27068. }, L.prototype.setSide = function(t) {
  27069. this.floors.forEach((function(e) {
  27070. e.collider.material.side = t
  27071. }))
  27072. }, L.prototype.setSide = function(t) {
  27073. this.floors.forEach((function(e) {
  27074. e.collider.material.side = t
  27075. }))
  27076. }, L.prototype.heroCount = function() {
  27077. return this.heroLocations ? this.heroLocations.length : 0
  27078. }, L.prototype.getHeroDescriptorByIndex = function(t) {
  27079. if (t < 0) return D.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."), null;
  27080. if (this.heroCount() < 1) return D.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"), null;
  27081. var e = this.heroLocations[t];
  27082. return void 0 === e ? (D.warn("Model.getHeroDescriptorByIndex() -> Index " + t + " is not a validindex"), null) : e
  27083. }, L.prototype.findPanoramicHero = function() {
  27084. for (var t in this.heroLocations)
  27085. if (this.heroLocations[t].cameraMode === l.PANORAMA) return this.heroLocations[t];
  27086. return null
  27087. }, L.prototype.listImagePanos = function() {
  27088. var t = [],
  27089. e = this;
  27090. return this.images.forEach((function(i) {
  27091. if (i._camera && i._camera._locationid) {
  27092. var n = e.panos.get(i._camera._locationid);
  27093. n && (e.supportsTiles || n.isLoaded("high") || t.push(n))
  27094. }
  27095. })), t
  27096. }, L.prototype.fadePanoMarkers = function(t, e) {
  27097. this.panos.fadeMarkerOpacity(t, e)
  27098. }, L.prototype.setSweepVisibility = function(t) {
  27099. this.panos.forEach((function(e) {
  27100. e.marker && (e.marker.visible = t)
  27101. }))
  27102. }, L.prototype.outsideAllowed = function() {
  27103. return this.supportedModes[l.DOLLHOUSE] && this.supportedModes[l.FLOORPLAN]
  27104. }, L.prototype.setFloorsHeight = function(t) {
  27105. var e = t.locations.points,
  27106. i = t.building.totalfloor,
  27107. n = {
  27108. totalfloor: i,
  27109. height: []
  27110. };
  27111. if (i && i > 1) {
  27112. for (var r = [], o = 0; o < i; o++) r.push([]);
  27113. e.forEach((function(t) {
  27114. null !== t.flooridx && r[t.flooridx].push(t.spot.z)
  27115. })), r.forEach((function(t) {
  27116. t.sort((function(t, e) {
  27117. return t - e
  27118. }));
  27119. var e = Math.floor(t.length / 2);
  27120. n.height.push(t[e])
  27121. }))
  27122. }
  27123. return n
  27124. }, t.exports = L
  27125. })
  27126. .call(this, i(6))
  27127. }, function(t, e) {
  27128. t.exports = {
  27129. Chinese: 0,
  27130. English: 1,
  27131. Japanese: 2
  27132. }
  27133. }, function(t, e) {
  27134. t.exports = {
  27135. Default: 0,
  27136. Fastmovie: 1,
  27137. Catalogue: 2
  27138. }
  27139. }, function(t, e, i) {
  27140. (function(e) {
  27141. (function(n) {
  27142. function r(t) {
  27143. this.cache = null, this.expires = 0
  27144. }
  27145. function o() {
  27146. this.baseUrl = null, this.cache = null, this.expires = 0
  27147. }
  27148. function a() {
  27149. this.baseUrl = null, this.expires = 0
  27150. }
  27151. function s(t) {
  27152. this.initialLoadingPromise = null, this.endpoint = t + "?type=3", this.urlContainer = null, this.authorizationHeader = c.getAuthorizationHeader(), this.containerClasses = [a, o, r]
  27153. }
  27154. var l = i(11),
  27155. u = i(2),
  27156. h = i(26),
  27157. c = i(25),
  27158. d = new u(n);
  27159. r.prototype = {
  27160. version: 1,
  27161. validate: function(t) {
  27162. return "catalog.json" in t && Object.keys(t)
  27163. .length > 0
  27164. },
  27165. update: function(t) {
  27166. return this.cache = t, this.expires = Date.now() + h.signedUrlDefaultExpireTime, e.when()
  27167. },
  27168. get: function(t) {
  27169. return this.cache[t]
  27170. }
  27171. }, o.prototype = {
  27172. version: 2,
  27173. validate: function(t) {
  27174. return "catalog.json" in t && "base.url" in t && Object.keys(t)
  27175. .length > 1
  27176. },
  27177. update: function(t) {
  27178. return this.baseUrl = t["base.url"], this.cache = t, this.expires = Date.now() + h.signedUrlDefaultExpireTime, e.when()
  27179. },
  27180. get: function(t) {
  27181. var e = this.cache[t];
  27182. return e ? this.baseUrl.replace("{{filename}}", t) + e : null
  27183. }
  27184. }, a.prototype = {
  27185. version: 3,
  27186. validate: function(t) {
  27187. return !0
  27188. },
  27189. update: function(t) {
  27190. return this.baseUrl = t.locationpics, t.expires ? this.expires = 1e3 * t.expires : this.expires = Date.now() + h.signedUrlDefaultExpireTime, e.when()
  27191. },
  27192. get: function(t) {
  27193. return this.baseUrl.replace("{{filename}}", t)
  27194. }
  27195. }, s.prototype = {
  27196. init: function() {
  27197. return this.initialLoadingPromise || (setInterval(function() {}.bind(this), h.signedUrlCheckInterval), this.initialLoadingPromise = this.refresh()), this.initialLoadingPromise
  27198. },
  27199. refresh: function(t) {
  27200. var i = void 0 === (t = t || {})
  27201. .cache || t.cache;
  27202. return l.get(this.endpoint, {
  27203. responseType: "json",
  27204. prefetchFrom: i ? "basic" : null,
  27205. cache: i,
  27206. auth: this.authorizationHeader
  27207. })
  27208. .then(function(t) {
  27209. if (this.urlContainer && this.urlContainer.validate(t)) return this.urlContainer.update(t);
  27210. for (var n = 0; n < this.containerClasses.length; n++) {
  27211. var r = new(0, this.containerClasses[n]);
  27212. if (r.validate(t)) return d.info("Using urls version " + r.version), this.urlContainer = r, this.urlContainer.update(t)
  27213. }
  27214. return i ? this.refresh({
  27215. cache: !1
  27216. }) : e.Deferred()
  27217. .reject("missing-urls")
  27218. }.bind(this), (function(t) {
  27219. return "loading-failed"
  27220. }))
  27221. },
  27222. get: function(t) {
  27223. return G.url.model + "/" + t
  27224. }
  27225. }, t.exports = s
  27226. })
  27227. .call(this, "/js/util/ModelUrls.js")
  27228. })
  27229. .call(this, i(6))
  27230. }, function(t, e, i) {
  27231. (function(e) {
  27232. function n(t) {
  27233. u.time("Computing a nice bounding cubemap");
  27234. var e = new a({
  27235. side: r.BackSide,
  27236. transparent: !0
  27237. });
  27238. e.uniforms.modelAlpha.value = 0, e.uniforms.opacity.value = 1 - s.modelAlpha, this.renderOrder = l.boundingSkybox, o.call(this, t, e), u.timeEnd("Computing a nice bounding cubemap")
  27239. }
  27240. var r = i(0),
  27241. o = (i(5), i(12), i(152)),
  27242. a = i(43),
  27243. s = i(1),
  27244. l = i(17),
  27245. u = new(i(2))(e);
  27246. n.prototype = Object.create(o.prototype), n.prototype.constructor = n, t.exports = n
  27247. })
  27248. .call(this, "/js/objects/BoundingTextureSkybox.js")
  27249. }, function(t, e, i) {
  27250. function n(t, e, i) {
  27251. var n = (t = t.clone())
  27252. .getSize(new r.Vector3),
  27253. o = new r.BoxGeometry(n.x, n.y, n.z);
  27254. o.boundingBox = t, r.Mesh.call(this, o, e), this.position.copy(t.getCenter(new r.Vector3)), this.frustumCulled = !1, i && this.add(new r.WireframeHelper(this))
  27255. }
  27256. var r = i(0);
  27257. n.prototype = Object.create(r.Mesh.prototype), n.prototype.constructor = n, t.exports = n
  27258. }, function(t, e, i) {
  27259. "use strict";
  27260. i(5);
  27261. var n = i(0);
  27262. function r(t) {
  27263. this.chunksize = t || 10, this.chunks = {}, this.boundingBoxes = {}, this.children = [], this.offset = new n.Vector3(0, .5, 0), this.material = new n.MeshBasicMaterial({
  27264. color: 16777215
  27265. })
  27266. }
  27267. r.prototype.add = function(t) {
  27268. var e, i, r, o, a, s, l, u, h = t.attributes,
  27269. c = new n.Vector3;
  27270. if (h ? (e = h.position.array, i = t.index ? t.index.array : void 0) : (e = t.vertices, t.faces), i)
  27271. for (var d = 0, p = i.length; d < p; d += 3) {
  27272. var f = 3 * i[d],
  27273. m = 3 * i[d + 1],
  27274. g = 3 * i[d + 2];
  27275. r = (e[f] + e[m] + e[g]) / 3, o = (e[f + 1] + e[m + 1] + e[g + 1]) / 3, a = (e[f + 2] + e[m + 2] + e[g + 2]) / 3, (s = Math.floor(r / this.chunksize) + "." + Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize)) in this.chunks ? (u = this.chunks[s], l = this.boundingBoxes[s]) : (u = this.chunks[s] = [], l = this.boundingBoxes[s] = new n.Box3), u.push(e[f], e[f + 1], e[f + 2], e[m], e[m + 1], e[m + 2], e[g], e[g + 1], e[g + 2]), l.expandByPoint(c.set(e[f], e[f + 1], e[f + 2])), l.expandByPoint(c.set(e[m], e[m + 1], e[m + 2])), l.expandByPoint(c.set(e[g], e[g + 1], e[g + 2]))
  27276. } else
  27277. for (d = 0, p = e.length; d < p; d += 9) r = (e[d] + e[d + 3] + e[d + 6]) / 3, o = (e[d + 1] + e[d + 4] + e[d + 7]) / 3, a = (e[d + 2] + e[d + 5] + e[d + 8]) / 3, (s = Math.floor(r / this.chunksize) + "." + Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize)) in this.chunks ? (u = this.chunks[s], l = this.boundingBoxes[s]) : (u = this.chunks[s] = [], l = this.boundingBoxes[s] = new n.Box3), u.push(e[d], e[d + 1], e[d + 2], e[d + 3], e[d + 4], e[d + 5], e[d + 6], e[d + 7], e[d + 8]), l.expandByPoint(c.set(e[d], e[d + 1], e[d + 2])), l.expandByPoint(c.set(e[d + 3], e[d + 4], e[d + 5])), l.expandByPoint(c.set(e[d + 6], e[d + 7], e[d + 8]))
  27278. }, r.prototype.build = function() {
  27279. var t = new n.Object3D;
  27280. for (var e in t.material = this.material, this.chunks) {
  27281. var i = this.chunks[e],
  27282. r = new n.BufferGeometry,
  27283. o = new n.BufferAttribute(new Float32Array(i), 3);
  27284. r.addAttribute("position", o), r.boundingBox = this.boundingBoxes[e];
  27285. var a = new n.Mesh(r, this.material);
  27286. a.material.visible = !1, t.add(a), this.chunks[e] = []
  27287. }
  27288. return t
  27289. }, t.exports = r
  27290. }, function(t, e, i) {
  27291. function n(t) {
  27292. s.call(this), this.model = t, this.exploded = !1
  27293. }
  27294. var r = i(44),
  27295. o = i(2),
  27296. a = i(8),
  27297. s = i(33),
  27298. l = i(7),
  27299. u = i(15),
  27300. h = i(0);
  27301. new o("/js/model/FloorCollection.js"), l.inherit(n, s), n.prototype.add = function(t) {
  27302. s.prototype.add.call(this, t), this.model.add(t)
  27303. }, n.prototype.getIndex = function(t) {
  27304. return t.floorIndex
  27305. }, n.prototype.build = function() {
  27306. this.list.forEach((function(t) {
  27307. t.build()
  27308. }))
  27309. }, n.prototype.size = function() {
  27310. return this.length
  27311. }, n.prototype.sort = function() {
  27312. s.prototype.sort.call(this, (function(t, e) {
  27313. return t.floorIndex - e.floorIndex
  27314. }))
  27315. }, n.prototype.nextFloor = function(t, e) {
  27316. return this.index[t.floorIndex + e] || null
  27317. }, n.prototype.getFloorAtPoint = function(t) {
  27318. for (var e = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  27319. var r = this.list[n],
  27320. o = r.distanceToPoint(t);
  27321. (!e || i > o) && (i = o, e = r)
  27322. }
  27323. return e
  27324. }, n.prototype.getOrMakeFloor = function(t) {
  27325. var e = this.index[t];
  27326. return e || (e = new r(this.model, t), this.add(e)), e
  27327. }, n.prototype.hide = function() {
  27328. this.list.forEach((function(t) {
  27329. t.hide()
  27330. }))
  27331. }, n.prototype.show = function() {
  27332. this.list.forEach((function(t) {
  27333. t.show()
  27334. }))
  27335. }, n.prototype.names = function() {
  27336. return this.list.reduce((function(t, e) {
  27337. return t.concat(e.name)
  27338. }), [])
  27339. }, n.prototype.toggleExplodeHorizontal = function() {
  27340. function t(t, e) {
  27341. t.position.x = i[t.floorIndex] * e, t.position.y = 1 * t.floorIndex * e
  27342. }
  27343. var e, i = [],
  27344. n = 0;
  27345. this.list.forEach((function(t, r, o) {
  27346. e = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - t.boundingBox.min.x, t.boundingBox.getSize(new h.Vector3)
  27347. .x / 2) : 0, n += e, i[r] = n
  27348. })), i = i.map((function(t) {
  27349. return t - n / 2
  27350. })), this.exploded ? this.list.forEach(function(e) {
  27351. a.start(function(i) {
  27352. t(e, 1 - i)
  27353. }.bind(this), 1500, null, 0, u.easeOutExpo)
  27354. }.bind(this)) : this.list.forEach(function(e) {
  27355. a.start(function(i) {
  27356. t(e, i)
  27357. }.bind(this), 1500, null, 0, u.easeOutExpo)
  27358. }.bind(this)), this.exploded = !this.exploded
  27359. }, n.prototype.toggleExplodeVertical = function() {
  27360. function t(t, i) {
  27361. t.position.y = (5 * t.floorIndex - e.y / 2) * i, t.panos.forEach((function(e) {
  27362. e.position.y = e.origin.y + t.position.y, e.skyboxMesh.position.y = e.origin.y + t.position.y
  27363. }))
  27364. }
  27365. var e = this.model.size;
  27366. this.exploded ? this.list.forEach((function(e) {
  27367. a.start((function(i) {
  27368. t(e, 1 - i)
  27369. }), 1500, null, 0, u.easeOutExpo)
  27370. })) : this.list.forEach((function(e) {
  27371. a.start((function(i) {
  27372. t(e, i)
  27373. }), 1500, null, 0, u.easeOutExpo)
  27374. })), this.exploded = !this.exploded
  27375. }, t.exports = n
  27376. }, function(t, e, i) {
  27377. (function(e) {
  27378. var n, r = i(156),
  27379. o = i(0),
  27380. a = i(2),
  27381. s = i(3),
  27382. l = i(1),
  27383. u = i(5),
  27384. h = i(17),
  27385. c = i(16),
  27386. d = i(19),
  27387. p = i(8),
  27388. f = i(10),
  27389. m = i(15),
  27390. g = i(157),
  27391. v = i(4)
  27392. .EventEmitter,
  27393. y = i(39),
  27394. b = i(71),
  27395. w = new a("/js/mattertag/Mattertag.js"),
  27396. x = i(158),
  27397. M = i(159),
  27398. T = i(22),
  27399. S = "closed",
  27400. _ = "opening",
  27401. A = "open",
  27402. P = "closing",
  27403. C = "active";
  27404. function E(t, e, i, n, r) {
  27405. this.tilesHorizontal = e, this.tilesVertical = i, this.numberOfTiles = n, t.wrapS = t.wrapT = o.RepeatWrapping, t.repeat.set(1 / this.tilesHorizontal, 1 / this.tilesVertical), this.tileDisplayDuration = r, this.currentLoopTime = this.currentTile = this.currentDisplayTime = 0, this.inStop = !1, this.totalcount = 0, this.update = function(e) {
  27406. for (this.inStop ? (this.totalcount++, 800 < this.totalcount && (this.totalcount = 0, this.inStop = !1)) : this.currentDisplayTime += e; this.currentDisplayTime > this.tileDisplayDuration;) this.currentDisplayTime -= this.tileDisplayDuration, this.currentTile++, t.offset.x = this.currentTile % this.tilesHorizontal / this.tilesHorizontal, t.offset.y = Math.floor(this.currentTile / this.tilesHorizontal) / this.tilesVertical
  27407. }
  27408. }
  27409. function D(t, i, n) {
  27410. var r = n.version || "0";
  27411. if ("0" !== r && w.info("nesttags version: " + r), this.data = n, this.model = t, this.player = G.player, this.locationId = n.locationid, this.i = i, this.tagid = n.tagid, this.enabled = l.mattertags.enabled && n.enable, this.label = n.details.title ? n.details.title : "", this.subtype = n.details.subtype, this.tagInfoUrl = n.details.url, this.audioenable = n.details.audioenable, n.details.templatetype === y.Audio && (this.audioenable = !0), this.audiourl = n.details.audiourl || n.details.url, this.videourl = n.details.videourl, this.tagPicUrl = n.details.tagpicurl, this.tagPicType = n.details.tagpictype, this.parsedDescription = [], this.links = [], this.floor = null, this.floorIndex = n.flooridx || 0, this.isBuilt = !1, this.des = this.data.details.description, G.player && G.player.currentPano && 2 === G.player.currentPano.alignmentType ? this.rt360 = !0 : this.rt360 = !1, 2e4 === i && (n.details.templatetype = y.Tag360T1), n.details.templatetype === y.ImageText && n.details.audioenable && n.details.audiourl && (n.details.templatetype = y.ImageTextAudio), n.details.templatetype === y.TextOnly && n.details.audioenable && n.details.audiourl && (n.details.templatetype = y.TextAudio), n.actiontype == y.ClassifyType.Building ? (this.type = y.BuildingType, this.mediatype = b.Normal) : (this.type = n.details.templatetype, n.details.templatetype === y.BuildingType || n.details.templatetype === y.TextOnly || n.details.templatetype === y.ImageText || n.details.templatetype === y.OtherModel ? this.mediatype = b.Normal : n.details.templatetype === y.Audio || n.details.templatetype === y.TextAudio || n.details.templatetype === y.ImageTextAudio ? (this.mediadiv = (n.details.templatetype, y.ImageTextAudio, window.document.getElementById("audio-tag")), this.mediatype = b.Audio) : n.details.templatetype === y.Video ? (this.mediadiv = window.document.getElementById("video-tag"), this.mediatype = b.Video) : n.details.templatetype === y.IFrame ? this.mediatype = b.IFrame : this.mediatype = b.Normal), n.details.audioenable && n.details.audiourl && (n.details.templatetype = y.TextAudio), this.imgaudioControl = {
  27412. loop: ""
  27413. }, this.picDescription = null, this.audioControl = {
  27414. loop: ""
  27415. }, this.audioPauseTime = 0, this.highlightStatus = !1, this.mode = u.PANORAMA, n.preferred_camera && n.preferred_camera.mode && (this.mode = n.preferred_camera.mode), this.obj3d = this.disc = this.billboard = null, this.geometry = {}, this.geometry.disc = new o.PlaneBufferGeometry(1, 1), this.geometry.discGif = new o.PlaneBufferGeometry(2, 2), this.geometry.discBuilding = new o.PlaneBufferGeometry(2, 2), this.geometry.discTo360Tag = new o.PlaneBufferGeometry(1, 1), this.geometry.discFrom360Tag = new o.PlaneBufferGeometry(1, .6), this.geometry.discOtherModel = new o.PlaneBufferGeometry(2, 2), this.geometry.discOtherModelText = new o.PlaneBufferGeometry(2, 2), this.geometry.cutout = new o.SphereBufferGeometry(.5, 16, 8), this.type === y.BuildingType && this.label) {
  27416. var a = G.settings.locations.points;
  27417. if (a && a.forEach((function(t, e) {
  27418. if (n.locationid === t.locationid) return n.base.y = t.viewpoint.z, !1
  27419. })), this.label.length > 6) {
  27420. var s = .22 * this.label.length + .3;
  27421. this.geometry.discBuilding = new o.PlaneBufferGeometry(s, .5)
  27422. } else {
  27423. s = .35 * this.label.length + .3;
  27424. this.geometry.discBuilding = new o.PlaneBufferGeometry(s, .5)
  27425. }
  27426. }
  27427. if (this.type === y.Audio) {
  27428. this.materialsAudio = {};
  27429. var h = T.splitUrl("./images/audioon_128x128.png"),
  27430. d = T.splitUrl("./images/audiooff_128x128.png");
  27431. if (this.tagPicType != M.Pic && this.tagPicType != M.GIF || null == this.tagPicUrl || "" == this.tagPicUrl || (h = this.tagPicUrl, d = this.tagPicUrl.replace(".png", "_hover.png")), this.tagPicType === M.Text) this.materialsAudio.free = this.buildDiscMaterial(this.getText(this.tagPicUrl, 1)), this.materialsAudio.hover = this.buildDiscMaterial(this.getText(this.tagPicUrl, 1));
  27432. else if (this.tagPicType === M.GIF) {
  27433. var p = this.getTexture(h);
  27434. this.materialsAudio.free = this.buildDiscMaterial(p), this.materialsAudio.hover = this.buildDiscMaterial(p), this.clock = new o.Clock, this.gifObject = new E(p, 1, 25, 25, 30)
  27435. } else this.materialsAudio.free = this.buildDiscMaterial(this.getTexture(h)), this.materialsAudio.hover = this.buildDiscMaterial(this.getTexture(d));
  27436. this.materialsAudio.disable = this.materialsAudio.free.clone(), this.materialsAudio.disable.opacity = l.mattertags.disc.disabledOpacity, this.materialsAudio.cutout = new o.MeshBasicMaterial({
  27437. transparent: !0,
  27438. opacity: 1,
  27439. colorWrite: !1
  27440. }), this.materialsAudio.pole = new o.LineBasicMaterial({
  27441. linewidth: l.mattertags.pole.width,
  27442. color: l.mattertags.pole.color,
  27443. opacity: l.mattertags.startup.hideUntilStart ? 0 : l.mattertags.pole.opacity,
  27444. transparent: !0,
  27445. alphaTest: l.mattertags.pole.opacity * l.mattertags.visibility.alphaTestLevel
  27446. }), this.materialsAudio = {
  27447. free: this.materialsAudio.free.clone(),
  27448. hover: this.materialsAudio.hover.clone(),
  27449. disable: this.materialsAudio.disable.clone(),
  27450. pole: this.materialsAudio.pole.clone(),
  27451. cutout: this.materialsAudio.cutout.clone()
  27452. }, this.audioControl.loop = n.details.loop, this.tagInfoUrl = n.details.url, this.materials = this.materialsAudio
  27453. } else if (this.type === y.OtherModel || this.type === y.TagTo360 || this.type === y.Tag360T1 || this.type === y.TextOnly) {
  27454. this.materialsOtherModel = {};
  27455. h = T.splitUrl("./images/goto_256x256.png"), d = T.splitUrl("./images/goto_256x256.png");
  27456. if (this.tagPicType !== M.Pic && this.tagPicType !== M.GIF || null === this.tagPicUrl || "" === this.tagPicUrl || (h = d = this.tagPicUrl), this.type === y.Title) this.geometry.disc = new o.PlaneBufferGeometry(12, 3), this.materialsOtherModel.free = this.materialsOtherModel.hover = this.buildDiscMaterial();
  27457. else if (this.tagPicType === M.Text) this.materialsOtherModel.free = this.buildDiscMaterial(this.getText(this.tagPicUrl, 1)), this.materialsOtherModel.hover = this.buildDiscMaterial(this.getText(this.tagPicUrl, 1));
  27458. else if (this.tagPicType === M.GIF) {
  27459. p = this.getTexture(h);
  27460. this.materialsOtherModel.free = this.buildDiscMaterial(p), this.materialsOtherModel.hover = this.buildDiscMaterial(p), this.clock = new o.Clock, this.gifObject = new E(p, 1, 25, 25, 30)
  27461. } else this.materialsOtherModel.free = this.buildDiscMaterial(this.getTexture(h)), this.materialsOtherModel.hover = this.buildDiscMaterial(this.getTexture(d));
  27462. this.materialsOtherModel.disable = this.materialsOtherModel.free.clone(), this.materialsOtherModel.disable.opacity = l.mattertags.disc.disabledOpacity, this.materialsOtherModel.cutout = new o.MeshBasicMaterial({
  27463. transparent: !0,
  27464. opacity: 1,
  27465. colorWrite: !1
  27466. }), this.materialsOtherModel.pole = new o.LineBasicMaterial({
  27467. linewidth: l.mattertags.pole.width,
  27468. color: l.mattertags.pole.color,
  27469. opacity: l.mattertags.startup.hideUntilStart ? 0 : l.mattertags.pole.opacity,
  27470. transparent: !0,
  27471. alphaTest: l.mattertags.pole.opacity * l.mattertags.visibility.alphaTestLevel
  27472. }), this.materialsOtherModel = {
  27473. free: this.materialsOtherModel.free.clone(),
  27474. hover: this.materialsOtherModel.hover.clone(),
  27475. disable: this.materialsOtherModel.disable.clone(),
  27476. pole: this.materialsOtherModel.pole.clone(),
  27477. cutout: this.materialsOtherModel.cutout.clone()
  27478. }, this.tagInfoUrl = n.details.url, this.materials = this.materialsOtherModel, this.materials.free.map.needsUpdate = !0
  27479. } else if (this.type === y.Title) e(".viewport-tags")
  27480. .append('<a id="titletag' + this.i + '" href="javascript:;" class="viewport-tag js-tag visible" style="z-index:20;"><div class="viewport-tag-point"></div><div class="viewport-tag-label"><span class="viewport-tag-label-name">' + n.details.title + "</span></div></a>");
  27481. else if (this.type === y.ImageText || this.type === y.ImageTextAudio || this.type === y.IKEA || this.type === y.Video) {
  27482. this.materialsNotAudio = {};
  27483. h = T.splitUrl("./images/tagnormal_128x128.png"), d = T.splitUrl("./images/taghover_128x128.png");
  27484. if (this.tagPicType !== M.Pic && this.tagPicType !== M.GIF || null === this.tagPicUrl || "" === this.tagPicUrl || (h = d = this.tagPicUrl), this.tagPicType === M.Text) this.materialsNotAudio.free = this.buildDiscMaterial(this.getText(this.tagPicUrl, 1)), this.materialsNotAudio.hover = this.buildDiscMaterial(this.getText(this.tagPicUrl, 1));
  27485. else if (this.tagPicType === M.GIF) {
  27486. p = this.getTexture(h);
  27487. this.materialsNotAudio.free = this.buildDiscMaterial(p), this.materialsNotAudio.hover = this.buildDiscMaterial(p), this.clock = new o.Clock, this.gifObject = new E(p, 1, 25, 25, 30)
  27488. } else this.materialsNotAudio.free = this.buildDiscMaterial(this.getTexture(h)), this.materialsNotAudio.hover = this.buildDiscMaterial(this.getTexture(d));
  27489. this.materialsNotAudio.disable = this.materialsNotAudio.free.clone(), this.materialsNotAudio.disable.opacity = l.mattertags.disc.disabledOpacity, this.materialsNotAudio.cutout = new o.MeshBasicMaterial({
  27490. transparent: !0,
  27491. opacity: 1,
  27492. colorWrite: !1
  27493. }), this.materialsNotAudio.pole = new o.LineBasicMaterial({
  27494. linewidth: l.mattertags.pole.width,
  27495. color: l.mattertags.pole.color,
  27496. opacity: l.mattertags.startup.hideUntilStart ? 0 : l.mattertags.pole.opacity,
  27497. transparent: !0,
  27498. alphaTest: l.mattertags.pole.opacity * l.mattertags.visibility.alphaTestLevel
  27499. }), this.materialsNotAudio = {
  27500. free: this.materialsNotAudio.free.clone(),
  27501. hover: this.materialsNotAudio.hover.clone(),
  27502. disable: this.materialsNotAudio.disable.clone(),
  27503. pole: this.materialsNotAudio.pole.clone(),
  27504. cutout: this.materialsNotAudio.cutout.clone()
  27505. }, this.imgaudioControl = n.details.audioloop ? n.details.audioloop : {
  27506. loop: ""
  27507. }, this.materials = this.materialsNotAudio
  27508. } else if (this.type === y.Tag360T1) {
  27509. if ({
  27510. free: c.loadCanvas(this.label),
  27511. hover: c.loadCanvas(this.label)
  27512. }, this.materials360Type = {}, 2 === this.subtype) {
  27513. this.tagPicType = 3;
  27514. h = T.splitUrl("./images/gif8_128x3200.png"), p = this.getTexture(h);
  27515. this.materials360Type.free = this.buildDiscMaterial(p), this.materials360Type.hover = this.buildDiscMaterial(p), this.clock = new o.Clock, this.gifObject = new E(p, 1, 25, 25, 30)
  27516. } else this.materials360Type.free = this.buildDiscMaterial(this.getText(this.label, 1)), this.materials360Type.hover = this.buildDiscMaterial(this.getText(this.label, 1));
  27517. this.materials360Type.disable = this.materials360Type.free.clone(), this.materials360Type.disable.opacity = l.mattertags.disc.disabledOpacity, this.materials360Type.cutout = new o.MeshBasicMaterial({
  27518. transparent: !0,
  27519. opacity: 1,
  27520. colorWrite: !1
  27521. }), this.materials360Type.pole = new o.LineBasicMaterial({
  27522. linewidth: l.mattertags.pole.width,
  27523. color: l.mattertags.pole.color,
  27524. opacity: l.mattertags.startup.hideUntilStart ? 0 : l.mattertags.pole.opacity,
  27525. transparent: !0,
  27526. alphaTest: l.mattertags.pole.opacity * l.mattertags.visibility.alphaTestLevel
  27527. }), this.materials360Type = {
  27528. free: this.materials360Type.free.clone(),
  27529. hover: this.materials360Type.hover.clone(),
  27530. disable: this.materials360Type.disable.clone(),
  27531. pole: this.materials360Type.pole.clone(),
  27532. cutout: this.materials360Type.cutout.clone()
  27533. }, this.materials = this.materials360Type
  27534. } else if (this.type === y.BuildingType)({
  27535. free: c.loadCanvas(this.label),
  27536. hover: c.loadCanvas(this.label)
  27537. }), this.materialsBuilding = {}, this.materialsBuilding.free = this.buildDiscMaterial(this.getText(this.label)), this.materialsBuilding.hover = this.buildDiscMaterial(this.getText(this.label)), this.materialsBuilding.disable = this.materialsBuilding.free.clone(), this.materialsBuilding.disable.opacity = l.mattertags.disc.disabledOpacity, this.materialsBuilding.cutout = new o.MeshBasicMaterial({
  27538. transparent: !0,
  27539. opacity: 1,
  27540. colorWrite: !1
  27541. }), this.materialsBuilding.pole = new o.LineBasicMaterial({
  27542. linewidth: l.mattertags.pole.width,
  27543. color: l.mattertags.pole.color,
  27544. opacity: l.mattertags.startup.hideUntilStart ? 0 : l.mattertags.pole.opacity,
  27545. transparent: !0,
  27546. alphaTest: l.mattertags.pole.opacity * l.mattertags.visibility.alphaTestLevel
  27547. }), this.materialsBuilding = {
  27548. free: this.materialsBuilding.free.clone(),
  27549. hover: this.materialsBuilding.hover.clone(),
  27550. disable: this.materialsBuilding.disable.clone(),
  27551. pole: this.materialsBuilding.pole.clone(),
  27552. cutout: this.materialsBuilding.cutout.clone()
  27553. }, this.materials = this.materialsBuilding;
  27554. else if (this.type === y.RegionalJump) this.materialsRegional = {}, this.materialsRegional.free = this.buildDiscMaterial(c.loadCanvasRe(this.label)), this.materialsRegional.hover = this.buildDiscMaterial(c.loadCanvasRe(this.label)), this.materialsRegional.disable = this.materialsRegional.free.clone(), this.materialsRegional.disable.opacity = l.mattertags.disc.disabledOpacity, this.materialsRegional.cutout = new o.MeshBasicMaterial({
  27555. transparent: !0,
  27556. opacity: 1,
  27557. colorWrite: !1
  27558. }), this.materialsRegional.pole = new o.LineBasicMaterial({
  27559. linewidth: l.mattertags.pole.width,
  27560. color: l.mattertags.pole.color,
  27561. opacity: l.mattertags.startup.hideUntilStart ? 0 : l.mattertags.pole.opacity,
  27562. transparent: !0,
  27563. alphaTest: l.mattertags.pole.opacity * l.mattertags.visibility.alphaTestLevel
  27564. }), this.materialsRegional = {
  27565. free: this.materialsRegional.free.clone(),
  27566. hover: this.materialsRegional.hover.clone(),
  27567. disable: this.materialsRegional.disable.clone(),
  27568. pole: this.materialsRegional.pole.clone(),
  27569. cutout: this.materialsRegional.cutout.clone()
  27570. }, this.materials = this.materialsRegional;
  27571. else if (this.type === y.TagTo360) {
  27572. if ({
  27573. free: c.loadCanvas(this.label),
  27574. hover: c.loadCanvas(this.label)
  27575. }, this.materialsTo360 = {}, 2 === this.subtype) {
  27576. this.tagPicType = 3;
  27577. h = T.splitUrl("./images/gif8_128x3200.png"), p = this.getTexture(h);
  27578. this.materialsTo360.free = this.buildDiscMaterial(p), this.materialsTo360.hover = this.buildDiscMaterial(p), this.clock = new o.Clock, this.gifObject = new E(p, 1, 25, 25, 30)
  27579. } else this.materialsTo360.free = this.buildDiscMaterial(this.getText(this.label, 1)), this.materialsTo360.hover = this.buildDiscMaterial(this.getText(this.label, 1));
  27580. this.materialsTo360.disable = this.materialsTo360.free.clone(), this.materialsTo360.disable.opacity = l.mattertags.disc.disabledOpacity, this.materialsTo360.cutout = new o.MeshBasicMaterial({
  27581. transparent: !0,
  27582. opacity: 1,
  27583. colorWrite: !1
  27584. }), this.materialsTo360.pole = new o.LineBasicMaterial({
  27585. linewidth: l.mattertags.pole.width,
  27586. color: l.mattertags.pole.color,
  27587. opacity: l.mattertags.startup.hideUntilStart ? 0 : l.mattertags.pole.opacity,
  27588. transparent: !0,
  27589. alphaTest: l.mattertags.pole.opacity * l.mattertags.visibility.alphaTestLevel
  27590. }), this.materialsTo360 = {
  27591. free: this.materialsTo360.free.clone(),
  27592. hover: this.materialsTo360.hover.clone(),
  27593. disable: this.materialsTo360.disable.clone(),
  27594. pole: this.materialsTo360.pole.clone(),
  27595. cutout: this.materialsTo360.cutout.clone()
  27596. }, this.tagInfoUrl = n.details.url, this.materials = this.materialsTo360
  27597. } else if (this.type === y.Pano) {
  27598. if (this.materialsNotAudio = {}, t.panos.index[this.locationId].enable ? (h = T.splitUrl("./images/disable_on_256x256.png"), d = T.splitUrl("./images/disable_on_256x256.png")) : (h = T.splitUrl("./images/disable_off_256x256.png"), d = T.splitUrl("./images/disable_off_256x256.png")), this.tagPicType !== M.Pic && this.tagPicType !== M.GIF || null === this.tagPicUrl || "" === this.tagPicUrl || void 0 === this.tagPicUrl || (h = d = this.tagPicUrl), this.tagPicType === M.Text) this.materialsNotAudio.free = this.buildDiscMaterial(this.getText(this.tagPicUrl, 1)), this.materialsNotAudio.hover = this.buildDiscMaterial(this.getText(this.tagPicUrl, 1));
  27599. else if (this.tagPicType === M.GIF) {
  27600. p = this.getTexture(h);
  27601. this.materialsNotAudio.free = this.buildDiscMaterial(p), this.materialsNotAudio.hover = this.buildDiscMaterial(p), this.clock = new o.Clock, this.gifObject = new E(p, 1, 25, 25, 30)
  27602. } else this.materialsNotAudio.free = this.buildDiscMaterial(this.getTexture(h)), this.materialsNotAudio.hover = this.buildDiscMaterial(this.getTexture(d));
  27603. this.materialsNotAudio.disable = this.materialsNotAudio.free.clone(), this.materialsNotAudio.disable.opacity = l.mattertags.disc.disabledOpacity, this.materialsNotAudio.cutout = new o.MeshBasicMaterial({
  27604. transparent: !0,
  27605. opacity: 1,
  27606. colorWrite: !1
  27607. }), this.materialsNotAudio.pole = new o.LineBasicMaterial({
  27608. linewidth: l.mattertags.pole.width,
  27609. color: l.mattertags.pole.color,
  27610. opacity: l.mattertags.startup.hideUntilStart ? 0 : l.mattertags.pole.opacity,
  27611. transparent: !0,
  27612. alphaTest: l.mattertags.pole.opacity * l.mattertags.visibility.alphaTestLevel
  27613. }), this.materialsNotAudio = {
  27614. free: this.materialsNotAudio.free.clone(),
  27615. hover: this.materialsNotAudio.hover.clone(),
  27616. disable: this.materialsNotAudio.disable.clone(),
  27617. pole: this.materialsNotAudio.pole.clone(),
  27618. cutout: this.materialsNotAudio.cutout.clone()
  27619. }, this.materials = this.materialsNotAudio
  27620. } else {
  27621. this.materialsNotAudio = {};
  27622. h = T.splitUrl("./images/tagnormal_128x128.png"), d = T.splitUrl("./images/taghover_128x128.png");
  27623. if (this.tagPicType !== M.Pic && this.tagPicType !== M.GIF || null === this.tagPicUrl || "" === this.tagPicUrl || (h = d = this.tagPicUrl), this.tagPicType === M.Text) this.materialsNotAudio.free = this.buildDiscMaterial(this.getText(this.tagPicUrl, 1)), this.materialsNotAudio.hover = this.buildDiscMaterial(this.getText(this.tagPicUrl, 1));
  27624. else if (this.tagPicType === M.GIF) {
  27625. p = this.getTexture(h);
  27626. this.materialsNotAudio.free = this.buildDiscMaterial(p), this.materialsNotAudio.hover = this.buildDiscMaterial(p), this.clock = new o.Clock, this.gifObject = new E(p, 1, 25, 25, 30)
  27627. } else this.materialsNotAudio.free = this.buildDiscMaterial(this.getTexture(h)), this.materialsNotAudio.hover = this.buildDiscMaterial(this.getTexture(d));
  27628. this.materialsNotAudio.disable = this.materialsNotAudio.free.clone(), this.materialsNotAudio.disable.opacity = l.mattertags.disc.disabledOpacity, this.materialsNotAudio.cutout = new o.MeshBasicMaterial({
  27629. transparent: !0,
  27630. opacity: 1,
  27631. colorWrite: !1
  27632. }), this.materialsNotAudio.pole = new o.LineBasicMaterial({
  27633. linewidth: l.mattertags.pole.width,
  27634. color: l.mattertags.pole.color,
  27635. opacity: l.mattertags.startup.hideUntilStart ? 0 : l.mattertags.pole.opacity,
  27636. transparent: !0,
  27637. alphaTest: l.mattertags.pole.opacity * l.mattertags.visibility.alphaTestLevel
  27638. }), this.materialsNotAudio = {
  27639. free: this.materialsNotAudio.free.clone(),
  27640. hover: this.materialsNotAudio.hover.clone(),
  27641. disable: this.materialsNotAudio.disable.clone(),
  27642. pole: this.materialsNotAudio.pole.clone(),
  27643. cutout: this.materialsNotAudio.cutout.clone()
  27644. }, this.materials = this.materialsNotAudio
  27645. }
  27646. this.position = (new o.Vector3)
  27647. .copy(n.base);
  27648. var f = (new o.Vector3)
  27649. .copy(n.stem.direction);
  27650. if (this.type, y.Title, this.discPosition = f, this.basepos = this.position.clone(), this.discpos2 = this.discPosition.clone(), this.discPosition.y += .03, this.discScale = .05, this.poleEnabled = n.stem.enabled, this.boardOrientation = "", this.boardState = S, this.hoveringBillboard = !1, this.animationScale = 0, this.visibleTransition = null, this.boardTransition = null, this.fadeInTimer = void 0, this.fadeOutTimer = void 0, l.mattertags.enableLinking && (this.type === y.TextOnly || this.type === y.TextAudio)) {
  27651. var m = this.parseLinks(n.details.description, t.modelid);
  27652. this.links = m.links, this.parsedDescription = m.description
  27653. }
  27654. }
  27655. var L = document.getElementById("tag-billboards"),
  27656. O = document.getElementById("audio-tag"),
  27657. I = document.getElementById("audio-tag"),
  27658. R = document.getElementById("video-tag");
  27659. D.prototype = Object.create(v.prototype), D.raycaster = new o.Raycaster, D.prototype.build = function() {
  27660. return this.enabled && !this.isBuilt && l.mattertags.enablePanoSize ? (this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(), this.floor && (this.billboard = this.buildBillboard(), this.obj3d = this.buildObject3D(), this.floor.add(this.obj3d)), this.isBuilt = !0, this) : null
  27661. }, D.prototype.draw = function(t, e) {}, D.prototype.buildObject3D = function() {
  27662. var t = new o.Object3D;
  27663. if (t.position.copy(this.position), this.tagPicType === M.Text)
  27664. if (this.tagPicUrl) {
  27665. var e = .35 * this.tagPicUrl.length + .2;
  27666. this.geometry.discOtherModelText = new o.PlaneBufferGeometry(e, .5), this.disc = new o.Mesh(this.geometry.discOtherModelText, this.materials.free)
  27667. } else this.disc = new o.Mesh(this.geometry.discOtherModelText, this.materials.free);
  27668. else this.type === y.BuildingType ? this.disc = new o.Mesh(this.geometry.discBuilding, this.materials.free) : this.type === y.OtherModel ? this.disc = new o.Mesh(this.geometry.discOtherModel, this.materials.free) : this.type === y.Tag360T1 ? this.disc = new o.Mesh(this.geometry.discFrom360Tag, this.materials.free) : this.type === y.TagTo360 ? this.disc = new o.Mesh(this.geometry.discTo360Tag, this.materials.free) : this.tagPicType === M.Text ? this.disc = new o.Mesh(this.geometry.discGif, this.materials.free) : this.disc = new o.Mesh(this.geometry.disc, this.materials.free);
  27669. 2e4 === this.i && (this.geometry.disc = new o.PlaneBufferGeometry(1e-4, 1e-4), this.disc = new o.Mesh(this.geometry.disc, this.materials.free)), this.type != y.Tag360T1 && this.disc.position.copy(this.discPosition), this.disc.renderOrder = h.mattertagDisc, this.disc.tag = this;
  27670. var i = new o.Mesh(this.geometry.cutout, this.materials.cutout);
  27671. if (i.renderOrder = h.mattertagCutout, this.disc.add(i), this.poleEnabled) {
  27672. var n = this.buildPole();
  27673. n.renderOrder = h.mattertagStem, t.add(n)
  27674. }
  27675. return t.add(this.disc)
  27676. }, D.prototype.updateTagMaterial = function(t) {
  27677. this.materials.free = this.buildDiscMaterial(this.getTexture(t)), this.disc.material = this.materials.free, this.disc.material.needUpdate = !0
  27678. }, D.prototype.buildTextObject3D = function(t) {
  27679. var e = Object.create(t);
  27680. e.type = -1;
  27681. var i = new o.Object3D;
  27682. e.position.y += .05, i.position.copy(e.position), e.disc = new o.Mesh(e.geometry.discOtherModel, e.materials.free), e.discPosition.y += .05, e.disc.position.copy(e.discPosition), e.disc.renderOrder = h.mattertagDisc, e.disc.tag = this;
  27683. var n = new o.Mesh(e.geometry.cutout, e.materials.cutout);
  27684. if (n.renderOrder = h.mattertagCutout, e.disc.add(n), e.poleEnabled) {
  27685. var r = e.buildPole();
  27686. r.renderOrder = h.mattertagStem, i.add(r)
  27687. }
  27688. return i.add(e.disc)
  27689. }, D.prototype.buildDiscMaterial = function(t, e) {
  27690. if (this.type === y.Title) {
  27691. var i = document.createElement("canvas");
  27692. i.width = 1024, i.height = 256;
  27693. var n = i.getContext("2d");
  27694. return this.dc = i, this.ctx = n, new o.MeshBasicMaterial({
  27695. map: new o.Texture(i),
  27696. transparent: !0,
  27697. opacity: 1,
  27698. alphaTest: l.mattertags.visibility.alphaTestLevel,
  27699. depthTest: !1
  27700. })
  27701. }
  27702. if (1 == e) {
  27703. var r = new o.SpriteMaterial({
  27704. opacity: l.mattertags.startup.hideUntilStart ? 0 : l.mattertags.disc.opacity,
  27705. transparent: !0,
  27706. map: t
  27707. });
  27708. return r.map.offset = new o.Vector2(0, 0), r.map.repeat = new o.Vector2(1 / 17, 1), r.depthTest = !1, r.blending = o.AdditiveBlending, r
  27709. }
  27710. return new o.MeshBasicMaterial({
  27711. map: t,
  27712. transparent: !0,
  27713. opacity: l.mattertags.startup.hideUntilStart ? 0 : l.mattertags.disc.opacity,
  27714. alphaTest: l.mattertags.visibility.alphaTestLevel
  27715. })
  27716. }, D.prototype.initAnimation = function() {
  27717. var t = this.disc.material.map.offset;
  27718. this.cursorAnimate = new TWEEN.Tween(t)
  27719. .to({
  27720. x: 1
  27721. }, 1e3)
  27722. .onStart((function() {}))
  27723. .onStop((function() {
  27724. t.x = 0
  27725. }))
  27726. .onUpdate((function() {}))
  27727. .onComplete((function() {
  27728. t.x = 0, setTimeout((function() {}), 1500)
  27729. })), this.cursorAnimate.easing((function(t) {
  27730. return Math.floor(17 * t) / 17
  27731. })), this.cursorAnimate.repeat(Number.POSITIVE_INFINITY), this.cursorAnimate.start()
  27732. }, D.prototype.getTexture = function(t) {
  27733. return c.loadurl(t)
  27734. }, D.prototype.getText = function(t, e) {
  27735. return e ? c.loadCanvasIn(t) : c.loadCanvas(t)
  27736. }, D.prototype.buildPole = function() {
  27737. return this.geom = new o.BufferGeometry, this.ar = new Float32Array(6), this.ar[0] = this.ar[1] = this.ar[2] = 0, this.ar[3] = this.discPosition.x, this.ar[4] = this.discPosition.y, this.ar[5] = this.discPosition.z, this.geom.addAttribute("position", new o.BufferAttribute(this.ar, 3)), this.line = new o.Line(this.geom, this.materials.pole), this.line
  27738. }, D.prototype.parseLinks = function(t, e) {
  27739. var i = /\[([^\]]*)\]\((.*?)(?:\)(?:\s|$))/,
  27740. n = [],
  27741. r = [],
  27742. o = [];
  27743. for (t = t.slice();;) {
  27744. var a = t.match(i);
  27745. if (!a) break;
  27746. r.push(t.slice(0, a.index)), t = t.slice(a.index + a[0].length), -1 === a[2].indexOf("javascript:") && n.push(a)
  27747. }
  27748. return r.push(t), l.mls || (o = this.buildLinks(n, e)), {
  27749. links: o,
  27750. description: r
  27751. }
  27752. }, D.prototype.buildLinks = function(t, e) {
  27753. return t.map((function(t) {
  27754. var i = g.EXT_LINK,
  27755. n = t[1],
  27756. r = t[2];
  27757. return -1 === r.indexOf("://") && (r = "https://" + r), -1 === r.indexOf("matterport.com/show") && -1 === r.indexOf(window.location.host + "/show") || (-1 !== r.indexOf(e) && -1 !== r.indexOf("start=") ? i = g.NAVIGATION : (i = g.MODEL, r += "&play=1")), {
  27758. label: n,
  27759. URL: r,
  27760. type: i
  27761. }
  27762. }))
  27763. }, D.prototype.buildBillboard = function() {
  27764. var t, i;
  27765. if (this.type === y.Audio) {
  27766. (i = document.createElement("div"))
  27767. .className = "c_circleProgress_wrapper", L.appendChild(i);
  27768. var n = document.createElement("div");
  27769. n.className = "c_wrapper c_right", i.appendChild(n);
  27770. var r = document.createElement("div");
  27771. r.className = "c_circleProgress c_rightcircle", n.appendChild(r);
  27772. var o = document.createElement("div");
  27773. o.className = "c_wrapper c_left", i.appendChild(o);
  27774. var a = document.createElement("div");
  27775. a.className = "c_circleProgress c_leftcircle", o.appendChild(a)
  27776. } else {
  27777. (i = document.createElement("div"))
  27778. .className = "tag-container has-hotzone", L.appendChild(i), (t = document.createElement("div"))
  27779. .className = "tag-body", i.appendChild(t);
  27780. var s = document.createElement("p");
  27781. s.className = "tag-label", s.textContent = this.label, e(".tag-label")
  27782. .css("line-height", 1.5), e(".tag-label")
  27783. .css("letter-spacing", "1px"), t.appendChild(s), this.buildContents(t), t.addEventListener("mouseover", function(t) {
  27784. this.boardState === A && i.classList.remove("has-hotzone")
  27785. }.bind(this)), t.addEventListener("mousedown", (function(t) {
  27786. t.stopPropagation()
  27787. })), t.addEventListener("mouseup", (function(t) {
  27788. t.stopPropagation()
  27789. })), i.addEventListener("mousedown", u("mousedown")), i.addEventListener("mouseup", u("mouseup")), i.addEventListener("mouseenter", function(t) {
  27790. (l.mattertags.animation.hoverOnClosing || this.boardState !== P) && (this.hoveringBillboard = !0, this.emit("enter", this), this.setHoverState())
  27791. }.bind(this)), i.addEventListener("mouseleave", function(t) {
  27792. this.hoveringBillboard = !1, this.emit("leave", this), this.boardState !== C && this.setFreeState()
  27793. }.bind(this))
  27794. }
  27795. function u(t) {
  27796. return function(e) {
  27797. var i, n = document.getElementById("player");
  27798. try {
  27799. i = new MouseEvent(t, e)
  27800. } catch (n) {
  27801. (i = document.createEvent("MouseEvents"))
  27802. .initMouseEvent(t, e.bubbles, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget)
  27803. }
  27804. n.dispatchEvent(i)
  27805. }
  27806. }
  27807. return i
  27808. }, D.prototype.buildContents = function(t) {
  27809. function i(t) {
  27810. var i = document.createElement("span");
  27811. return i.className = "tag-desc", e(".tag-desc")
  27812. .css("line-height", 1.6), e(i)
  27813. .html(null != t ? t : ""), i
  27814. }
  27815. this.links.forEach(function(e, n) {
  27816. var r = i(this.parsedDescription[n]);
  27817. t.appendChild(r);
  27818. var o = document.createElement("a");
  27819. if (o.classList.add("tag-link"), o.setAttribute("data-linktype", e.type), o.setAttribute("data-tagID", this.i), o.href = e.URL, o.textContent = e.label + " ", e.type === g.EXT_LINK) {
  27820. r.textContent += "→ ";
  27821. var a = document.createElement("i");
  27822. a.classList.add("icon-ext-link"), a.title = "Link to external web site", o.appendChild(a)
  27823. }
  27824. t.appendChild(o)
  27825. }.bind(this));
  27826. var n = i(this.parsedDescription[this.parsedDescription.length - 1]);
  27827. t.appendChild(n)
  27828. }, D.prototype.scrollAll = function(t) {}, D.prototype.setFreeState = function(t, e) {
  27829. O.volume = 1, this.type === y.ImageText || this.type === y.ImageTextAudio || this.type === y.IKEA || this.type === y.Video ? this.setClosedState() : this.type === y.Audio ? e && (this.setClosedState(), this.stopAudio()) : !t && this.hoveringBillboard || (this.fadeOutTimer || (this.fadeOutTimer = p.setTimeout(function() {
  27830. this.disc.material = this.materials.free, this.boardState !== S && (this.boardState = P, this.animateBoard())
  27831. }.bind(this), l.mattertags.animation.animOutDelay)), p.cancel(this.fadeInTimer), this.fadeInTimer = void 0)
  27832. }, D.prototype.startAudio = function() {
  27833. var t = this;
  27834. function e(t, e, i) {
  27835. return t * (1 - i) + i * e
  27836. }
  27837. function i(i, n) {
  27838. n <= .5 ? (i.firstElementChild.firstElementChild.style.webkitTransform = "rotate(" + e(-135, 45, n) + "deg)", i.lastElementChild.firstElementChild.style.webkitTransform = "rotate(-135deg)") : (i.firstElementChild.firstElementChild.style.webkitTransform = "rotate(45deg)", i.lastElementChild.firstElementChild.style.webkitTransform = "rotate(" + e(-135, 45, n) + "deg)"), G.R.longplaying ? (t.billboard.style.display = "block", t.billboard.style.visibility = "visible") : t.billboard.style.display = "none"
  27839. }
  27840. O.loop = this.audioControl.loop, O.src = this.audiourl, O.currentTime = 0, O.play(), this.played ? (O.oncanplay = function() {}, t.intvl = setInterval((function() {
  27841. var e = O.currentTime / O.duration;
  27842. i(t.billboard, e)
  27843. }), 1e3)) : (this.played = !0, O.oncanplay = function() {
  27844. t.intvl = setInterval((function() {
  27845. var e = O.currentTime / O.duration;
  27846. i(t.billboard, e)
  27847. }), 1e3)
  27848. }), O.onended = function() {
  27849. O.oncanplay = function() {}, t.intvl && (clearInterval(t.intvl), t.intvl = null, t.billboard.style.display = "none")
  27850. }
  27851. }, D.prototype.stopAudio = function() {
  27852. O.ended || (O.oncanplay = function() {}, this.intvl && (clearInterval(this.intvl), this.intvl = null), O.pause(), this.audioPauseTime = O.currentTime, this.billboard.style.display = "none")
  27853. }, D.prototype.setHoverState = function(t, i) {
  27854. var o = this;
  27855. this.model, this.model.language;
  27856. if (this.boardState !== C)
  27857. if (e("#tag-detail")
  27858. .hasClass("open") || (e("#drawer")
  27859. .hasClass("open") ? this.highlightStatus = !0 : this.highlightStatus = !1), this.type === y.ImageText || this.type === y.ImageTextAudio || this.type === y.IKEA || this.type === y.Video) {
  27860. if (this.audioenable && this.audiourl && (O.volume = .7, O.loop = this.imgaudioControl.loop, O.src = this.audiourl, O.currentTime = 0, O.play()), this.type === y.Video ? (R.src = this.videourl, R.oncanplay = function() {
  27861. e("#video-tag")
  27862. .css("display", "block"), e(".topimg")
  27863. .css("height", "0px")
  27864. }) : (s.isMobile() ? e(".topimg")
  27865. .css("height", "240px") : e(".topimg")
  27866. .css("height", "350px"), e("#video-tag")
  27867. .css("display", "none")), e.isArray(this.data.details.imageurl)) ! function(t) {
  27868. e(".topimg")
  27869. .hide(), e("#slidePictures")
  27870. .show();
  27871. for (var i = 0; i < t.length; i++) {
  27872. var n = r.getSize(t[i]);
  27873. if (n.width && n.height) {
  27874. var o = n.width / n.height;
  27875. if (o > 1.5) var a = '<div class="swiper-slide moreImages"><img class="imageCon longimgCon" src=' + t[i] + ' alt=""></div>';
  27876. else if (o < .8) a = '<div class="swiper-slide moreImages"><img class="imageCon highimgCon" src=' + t[i] + ' alt=""></div>';
  27877. else a = '<div class="swiper-slide moreImages"><img class="imageCon commimgCon" src=' + t[i] + ' alt=""></div>'
  27878. }
  27879. e("#wrapperPic")
  27880. .append(a)
  27881. }
  27882. new x("#slidePictures", {
  27883. speed: 500,
  27884. loop: !0,
  27885. setWrapperSize: !0,
  27886. observer: !0,
  27887. observeParents: !0
  27888. }), e(".imageCon")
  27889. .on("click", (function(t) {
  27890. t.stopPropagation(), t.cancelBubble = !0;
  27891. var i = e(this)
  27892. .attr("src"),
  27893. n = r.getWinSize(i);
  27894. e(".originpic")
  27895. .css("background-image", "url(" + i + ")"), e(".picsize")
  27896. .css({
  27897. width: n.width,
  27898. height: n.height
  27899. }), e(".picsize")
  27900. .attr("data-with", n.width), e(".picsize")
  27901. .attr("data-height", n.height), e("#picsizeScroll")
  27902. .css({
  27903. left: "50%",
  27904. top: "50%",
  27905. transform: "translate(-50%, -50%)"
  27906. }), e(".originpic-container")
  27907. .fadeIn(300)
  27908. })), e(".btn-prev3, .btn-next3")
  27909. .delay(750)
  27910. .fadeIn(500)
  27911. .fadeOut(500)
  27912. .fadeIn(500)
  27913. .fadeOut(500)
  27914. }(this.data.details.imageurl);
  27915. else {
  27916. e("#slidePictures")
  27917. .hide(), e(".topimg")
  27918. .show();
  27919. var a = r.getSize(this.data.details.imageurl);
  27920. if (a.width && a.height) {
  27921. var u = a.width / a.height;
  27922. u > 1.5 ? e(".imageCon")
  27923. .removeClass("highimgCon commimgCon")
  27924. .addClass("longimgCon") : u < .8 ? e(".imageCon")
  27925. .removeClass("longimgCon commimgCon")
  27926. .addClass("highimgCon") : e(".imageCon")
  27927. .removeClass("longimgCon highimgCon")
  27928. .addClass("commimgCon")
  27929. }
  27930. e(".topimg .imageCon")
  27931. .attr("src", this.data.details.imageurl), e(".originpic")
  27932. .css("background-image", "url(" + this.data.details.imageurl + ")");
  27933. var h = r.getWinSize(this.data.details.imageurl);
  27934. e(".picsize")
  27935. .css({
  27936. width: h.width,
  27937. height: h.height
  27938. }), e(".topimg")
  27939. .on("click", (function() {
  27940. e(".originpic-container")
  27941. .fadeIn(300)
  27942. })), e(".originpic-container")
  27943. .on("click", (function() {
  27944. e(".originpic-container")
  27945. .fadeOut(300)
  27946. }))
  27947. }
  27948. var c, d = this.data.details.isNew ? '<span style="color: red">新 </span>' : "",
  27949. f = this.data.details.price ? '<br/><span style="font-size: 200%;color:black;">¥ ' + this.data.details.price + "</span>" : "";
  27950. c = s.isMobile() ? "ikea" : "ikeapc", this.type === y.IKEA ? (e(".topimg")
  27951. .addClass(c), e(".middletitle")
  27952. .html(this.data.details.name1 ? d + this.data.details.name1 : ""), e(".middlecontent")
  27953. .html(this.data.details.name2 ? this.data.details.name2 + f : "" + f)) : (e(".topimg")
  27954. .removeClass(c), e(".middletitle")
  27955. .html(this.label ? d + this.label : ""), e(".middlecontent")
  27956. .html(this.data.details.description ? this.data.details.description : "")), void 0 !== this.tagInfoUrl && "" !== this.tagInfoUrl ? (e(".bottomlink")
  27957. .css("display", "block"), n = this.tagInfoUrl, e(".bl-text")
  27958. .on("click", (function(t) {
  27959. window.open(n)
  27960. }))) : e(".bottomlink")
  27961. .css("display", "none"), s.isMobile() && (e(window)
  27962. .width() <= 375 || e(window)
  27963. .height() <= 418) ? e(".middletext")
  27964. .css({
  27965. height: "88px",
  27966. "margin-bottom": "30px",
  27967. "overflow-y": "auto"
  27968. }) : e(".middletext")
  27969. .css({
  27970. height: "110px",
  27971. "margin-bottom": "34px",
  27972. "overflow-y": "auto"
  27973. }), this.label || this.data.details.description || this.tagInfoUrl || e(".middletext")
  27974. .css({
  27975. height: "0px",
  27976. "margin-bottom": "0",
  27977. "overflow-y": "hidden"
  27978. }), e(".pctagcontainer")
  27979. .fadeIn(300), e(".middletext")
  27980. .scrollTop(0)
  27981. } else if (this.type === y.Audio) {
  27982. o = this;
  27983. O.addEventListener("ended", (function() {
  27984. "loop" !== O.loop && (o.setFreeState(!0, !0), O.currentTime = 0)
  27985. })), 0 == i ? (1 === !this.subtype && (this.disc.material = this.materials.hover), this.startAudio()) : 1 == i && (1 === !this.subtype && (this.disc.material = this.materials.hover), O.loop = this.audioControl.loop, O.src = this.audiourl, O.currentTime = O.ended ? 0 : this.audioPauseTime, O.play())
  27986. } else if (8 === this.type) this.hoveringBillboard || this.billboard.classList.add("has-hotzone"), this.fadeInTimer && t && this.setActiveState(), p.cancel(this.fadeOutTimer), this.fadeOutTimer = void 0;
  27987. else if (this.type === y.OtherModel) 0 === i && this.tagInfoUrl && window.open(this.tagInfoUrl);
  27988. else if (this.type === y.Video) {
  27989. window.document.getElementById("audio-bar")
  27990. .pause(), e(".pwVideo")
  27991. .fadeIn(300, (function() {
  27992. document.getElementById("iframe-video")
  27993. .clientHeight;
  27994. s.isMobile() ? e(".video-play")
  27995. .hide() : e(".video-play")
  27996. .fadeIn(200)
  27997. }))
  27998. .css("display", "flex"), e(".help_back")
  27999. .fadeIn(500)
  28000. } else(this.type === y.TextOnly || this.type === y.TextAudio) && this.audioenable && this.audiourl && 0 === i && (O.volume = .7, I.loop = "", I.src = this.audiourl, I.currentTime = 0, I.play()), e(".tag-body")
  28001. .scrollTop(0), this.hoveringBillboard || this.billboard.classList.add("has-hotzone"), this.fadeInTimer ? t && this.setActiveState() : this.type === y.TextOnly && (this.fadeInTimer = p.setTimeout(function() {
  28002. 1 === !this.subtype && (this.disc.material = this.materials.hover), this.boardState !== A && (this.boardState = _, this.animateBoard(function() {
  28003. t && this.setActiveState()
  28004. }.bind(this)))
  28005. }.bind(this), l.mattertags.animation.animInDelay)), p.cancel(this.fadeOutTimer), this.fadeOutTimer = void 0
  28006. }, D.prototype.setClosedState = function() {
  28007. this.disc.material = this.materials.free, this.emit("tag.closed"), this.boardState = S, this.billboard.style.visibility = "hidden", this.billboard.classList.contains("has-hotzone") || this.billboard.classList.add("has-hotzone"), this.type === y.Video && (e("#video-tag")[0].pause(), e("#video-tag")[0].currentTime = 0), this.type === y.ImageTextAudio && O.pause()
  28008. }, D.prototype.setActiveState = function() {
  28009. this.type !== y.OtherModel && this.type !== y.IFrame && this.type !== y.Audio && (this.boardState = C, this.billboard.classList.remove("has-hotzone"))
  28010. }, D.prototype.hide = function(t, i) {
  28011. this.disc.visible = !1;
  28012. var n = e.Deferred();
  28013. if (0 === this.materials.free.opacity && !p.isRunning(this.visibleTransition)) return n.resolve()
  28014. .promise();
  28015. t = t || 0, i = i || 0, p.cancel(this.visibleTransition), this.type === y.Audio && (this.billboard.style.display = "none");
  28016. var r = this.materials.free.opacity / l.mattertags.disc.opacity,
  28017. o = i + t,
  28018. a = i / o;
  28019. return this.visibleTransition = p.start(function(t) {
  28020. f.property(this.materials.free, "opacity", 0)(t), f.property(this.materials.hover, "opacity", 0)(t), f.property(this.materials.pole, "opacity", 0)(t)
  28021. }.bind(this), o * r, (function() {
  28022. n.resolve()
  28023. }), a, m[l.warp.blendEasing]), n.promise()
  28024. }, D.prototype.show = function(t, i) {
  28025. this.disc.visible = !0;
  28026. var n = e.Deferred();
  28027. if (this.materials.free.opacity === l.mattertags.disc.opacity && !p.isRunning(this.visibleTransition)) return n.resolve()
  28028. .promise();
  28029. t = t || 0, i = i || 0, p.cancel(this.visibleTransition);
  28030. var r = (l.mattertags.disc.opacity - this.materials.free.opacity) / l.mattertags.disc.opacity,
  28031. o = i + t,
  28032. a = i / o;
  28033. return this.type === y.Audio && this.intvl && (this.billboard.style.display = "block", this.billboard.style.visibility = "visible"), this.visibleTransition = p.start(function(t) {
  28034. f.property(this.materials.free, "opacity", l.mattertags.disc.opacity)(t), f.property(this.materials.hover, "opacity", l.mattertags.disc.opacity)(t), f.property(this.materials.pole, "opacity", l.mattertags.pole.opacity)(t)
  28035. }.bind(this), o * r, (function() {
  28036. n.resolve()
  28037. }), a, m[l.warp.blendEasing]), n.promise()
  28038. }, D.prototype.closestPanoTowardTag = function(t, e) {
  28039. var i = [],
  28040. n = [],
  28041. r = this.disc.getWorldPosition(new o.Vector3);
  28042. if (t === u.PANORAMA) {
  28043. var a = e.position.clone()
  28044. .sub(r)
  28045. .normalize();
  28046. i.push(d.filters.isPanoAligned()), i.push(d.filters.inPanoDirection(r, a, .5)), i.push(d.filters.isNeighbourPanoTo(e)), n.push(d.scoreFunctions.direction(r, a))
  28047. }
  28048. var s = new o.Vector3;
  28049. i.push((function(t) {
  28050. return Math.abs(t.position.x - r.x) > l.mattertags.visibility.cameraClearance || Math.abs(t.position.z - r.z) > l.mattertags.visibility.cameraClearance
  28051. }), (function(t) {
  28052. s.copy(r)
  28053. .sub(t.position);
  28054. var e = -o.Math.radToDeg(Math.atan(s.y / Math.sqrt(s.x * s.x + s.z * s.z))),
  28055. i = l.mattertags.navigate.tiltTolerance;
  28056. return l.insideLookLimitDown - i < e && e < l.insideLookLimitUp + i
  28057. })), n.push(d.scoreFunctions.distanceSquared(this, -2));
  28058. var h = this.model.panos.sortByScore(i, n);
  28059. if (l.mattertags.navigate.lineOfSight) {
  28060. for (var c = 0; c < h.length; c++) {
  28061. var p = h[c].pano,
  28062. f = p.position.distanceTo(r);
  28063. if (!l.mattertags.visibility.anyDistance && f > l.mattertags.visibility.visibleDistance) return null;
  28064. D.raycaster.set(p.position, r.clone()
  28065. .sub(p.position)
  28066. .normalize());
  28067. var m = D.raycaster.intersectObjects(this.model.colliders);
  28068. if (0 === m.length || m[0].distance > f) return p
  28069. }
  28070. return null
  28071. }
  28072. return h.length > 0 ? h[0].pano : null
  28073. }, D.prototype.examineMattertag = function(t, e) {
  28074. var i, n, r, a = t.mode;
  28075. if (l.mattertags.navigate.nearestPano && 1 !== this.subtype && (i = this.closestPanoTowardTag(a, t.currentPano)), i || (i = t.currentPano), n = "disc" === l.mattertags.navigate.aimAt ? this.disc.getWorldPosition(new o.Vector3) : "object" === l.mattertags.navigate.aimAt ? this.obj3d.getWorldPosition(new o.Vector3) : "nothing" === l.mattertags.navigate.aimAt ? null : this.obj3d.getWorldPosition(new o.Vector3)
  28076. .add(this.discPosition.clone()
  28077. .multiplyScalar(.5)), r = l.mattertags.navigate.reactivate ? function() {
  28078. e(this), this.setActiveState()
  28079. }.bind(this) : null, a === u.PANORAMA) t.flyToPano({
  28080. pano: i,
  28081. lookAtPoint: n,
  28082. duration: null,
  28083. maxDistanceOverride: null,
  28084. skipWarpingCheck: !1
  28085. }, r);
  28086. else {
  28087. var s = {
  28088. pano: i
  28089. };
  28090. if (n) {
  28091. var h = (new o.Matrix4)
  28092. .lookAt(i.position, n, new o.Vector3(0, 1, 0));
  28093. s.quaternion = (new o.Quaternion)
  28094. .setFromRotationMatrix(h)
  28095. }
  28096. l.mattertags.navigate.reactivate && (s.callback = r), s.duration = 1500, s.mode = u.PANORAMA, t.flyToNewMode(s)
  28097. }
  28098. }, D.prototype.update = function(t, e, i, n, r) {
  28099. var o = this.model;
  28100. if (this.type !== y.Title) {
  28101. if (this.i >= 1e4 && this.disc && this.disc.position && e && e.position) {
  28102. var a = this.basepos.distanceTo(e.position);
  28103. if (G && G.P) {
  28104. var s = Math.max(a * G.P.a - G.P.b, G.P.c);
  28105. this.disc.position.y = this.discpos2.y - s
  28106. }
  28107. }
  28108. this.type === y.BuildingType ? t === u.DOLLHOUSE ? this.enabled = !0 : (this.enabled = !1, this.obj3d.visible = !1, this.hideDisc(t, e, i, n)) : this.type === y.RegionalJump ? t === u.PANORAMA ? this.enabled = !0 : (this.enabled = !1, this.obj3d.visible = !1, this.hideDisc(t, e, i, n)) : this.type === y.Tag360T1 || 1 === this.subtype ? t !== u.PANORAMA ? (this.enabled = !1, this.obj3d.visible = !1, this.hideDisc(t, e, i, n)) : i && (this.obj3d.position.copy(i.position.clone()
  28109. .add(this.position)), !this.i >= 1e4 && this.disc.position.copy(this.discPosition), this.locationId == r ? this.enabled = !0 : (this.enabled = !1, this.obj3d.visible = !1, this.hideDisc(t, e, i, n))) : (G.settings.nesttags.setting.show_in_3d || (t !== u.PANORAMA ? this.materials.free.opacity = 0 : this.materials.free.opacity = l.mattertags.disc.opacity), l.mattertags.enablePanoSize && (this.enabled = !0)), l.mattertags.enablePanoSize || (this.materials.free.opacity = 0, this.enabled = !1), this.enabled && (this.updateDisc(t, e, i, n, o), this.boardState === S && this.type !== y.Audio || this.updateBillboard(e))
  28110. }
  28111. }, D.prototype.updateDisc = function(t, e, i, n, r) {
  28112. if (G.conf.isNewEditVersion && ("-1" == this.tagid || "-2" == this.tagid))
  28113. if (this.rt360) {
  28114. var a = this.player.getMouseDirection(),
  28115. s = Math.sqrt(4 / (a.x * a.x + a.y * a.y + a.z * a.z));
  28116. a.multiplyScalar(s), this.obj3d.position.copy(i.position.clone()
  28117. .add(a)), this.disc.position.copy(this.discPosition)
  28118. } else {
  28119. var h = this.player.intersect;
  28120. if (null != h) {
  28121. (s = {})
  28122. .point = h.point.clone(), s.normal = h.normal.clone();
  28123. var c = s.normal.clone()
  28124. .multiplyScalar(.1);
  28125. this.obj3d.position.copy(s.point), this.disc.position.copy(c), null != this.ar && (this.ar[3] = c.x, this.ar[4] = c.y, this.ar[5] = c.z, this.geom.addAttribute("position", new o.BufferAttribute(this.ar, 3)))
  28126. }
  28127. } var d, p = G.settings.nesttags.setting,
  28128. f = l.mattertags.visibility,
  28129. m = l.mattertags.disc.scale,
  28130. g = this.disc.getWorldPosition(new o.Vector3);
  28131. if (t === u.PANORAMA ? (d = e.position.distanceTo(g), this.type !== y.RegionalJump && (1 != this.subtype && this.type != y.Tag360T1 && this.type !== y.Title ? p.autohide && (d > p.autohide_length ? this.materials.free.opacity = 0 : this.materials.free.opacity = l.mattertags.disc.opacity) : this.type === y.Title || (this.materials.free.opacity = l.mattertags.disc.opacity))) : d = f.visibleDistance, this.obj3d.visible = 0 !== this.disc.material.opacity && (f.anyDistance || d <= f.visibleDistance || t === u.TRANSITIONING) && (!f.hideViaFloor || this.tagVisibleOnCurrentFloor(t)) && (!f.hideOffScreenDisc || !this.offScreen(this.disc, e)) && (!f.hideOffScreenObject || !this.offScreen(this.obj3d, e)), this.obj3d.visible) {
  28132. this.disc.quaternion.copy(e.quaternion);
  28133. var v = m.maxSize - (m.maxSize - m.minSize) * o.Math.smoothstep(d, m.nearBound, m.farBound),
  28134. b = g.clone()
  28135. .project(e),
  28136. w = new o.Vector3((window.renderWidth || window.innerWidth) / 2, (window.renderHeight || window.innerHeight) / 2, 1)
  28137. .multiply(b),
  28138. x = new o.Vector3(v / 2, 0, 0)
  28139. .add(w),
  28140. M = (s = new o.Vector3(2 / (window.renderWidth || window.innerWidth), 2 / (window.renderHeight || window.innerHeight), 1)
  28141. .multiply(x))
  28142. .clone()
  28143. .unproject(e)
  28144. .clone()
  28145. .distanceTo(g),
  28146. T = 1 + m.responsiveness / 100 * (D.viewportScale(this.type) - 1);
  28147. this.discScale = M * T, this.disc.scale.set(this.discScale, this.discScale, this.discScale), this.type === y.RegionalJump && this.obj3d.visible
  28148. }
  28149. }, D.prototype.hideDisc = function(t, e, i, n) {
  28150. this.obj3d.visible = !1, this.billboard.style.display = "none"
  28151. }, D.prototype.tagVisibleOnCurrentFloor = function(t) {
  28152. if (this.clock && this.gifObject) {
  28153. var e = this.clock.getDelta();
  28154. this.gifObject.update(1e3 * e)
  28155. }
  28156. return t !== u.DOLLHOUSE && t !== u.FLOORPLAN || this.model.allFloorsVisible || !this.floor.hidden
  28157. }, D.prototype.offScreen = function(t, e) {
  28158. var i = t.getWorldPosition(new o.Vector3)
  28159. .project(e);
  28160. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  28161. }, D.viewportScale = function(t) {
  28162. return D.viewportWidth === (window.renderWidth || window.innerWidth) && D.viewportHeight === (window.renderHeight || window.innerHeight) || (D.viewportWidth = (window.renderWidth || window.innerWidth), D.viewportHeight = (window.renderHeight || window.innerHeight)), t === y.BuildingType ? (D.currentViewportScaleBuilding = Math.sqrt(Math.min(D.viewportWidth, D.viewportHeight) / l.mattertags.disc.scale.buildingViewportSize), D.currentViewportScaleBuilding) : (D.currentViewportScaleCommon = Math.sqrt(Math.min(D.viewportWidth, D.viewportHeight) / l.mattertags.disc.scale.baseViewportSize), D.currentViewportScaleCommon)
  28163. }, D.prototype.newBillboardOrientation = function(t) {
  28164. if (this.boardOrientation && this.boardState !== _) return this.boardOrientation;
  28165. var e = 1 / 3,
  28166. i = t.y < -e ? 0 : t.y < e ? 1 : 2,
  28167. n = t.x < -e ? 0 : t.x < e ? 1 : 2,
  28168. r = "";
  28169. return r += 0 === n ? "right" : 2 === n ? "left" : "", r += 0 === i ? "-down" : 2 === i ? "-up" : "", 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "", 1 === i && (r = (window.renderWidth || window.innerWidth) > (window.renderHeight || window.innerHeight) ? t.x < 0 ? "right" : "left" : t.y < 0 ? "bottom" : "top")), r
  28170. }, D.prototype.regionalJumpOrientation = function(t) {
  28171. var e = this.disc.getWorldPosition(new o.Vector3)
  28172. .clone()
  28173. .project(t);
  28174. return e.x < -.5 ? "Left" : e.x < .5 ? "Center" : "Right"
  28175. }, D.prototype.updateBillboard = function(t) {
  28176. var e = this.disc.getWorldPosition(new o.Vector3),
  28177. i = e.clone()
  28178. .project(t);
  28179. if (i.y *= -1, this.type !== y.Audio) {
  28180. var n = this.newBillboardOrientation(i);
  28181. if (n !== this.boardOrientation) {
  28182. this.billboard.style.transform = this.billboard.style.webkitTransform = "", this.billboard.classList.remove("tag-container-" + this.boardOrientation), this.billboard.classList.add("tag-container-" + n);
  28183. var r = window.getComputedStyle(this.billboard);
  28184. this.billboard.initialTransform = r.transform || r.webkitTransform, "none" === this.billboard.initialTransform && (this.billboard.initialTransform = "");
  28185. var a = window.getComputedStyle(this.billboard)
  28186. .transform.slice(7, -1)
  28187. .split(","),
  28188. s = -a[4],
  28189. u = -a[5];
  28190. this.billboard.style.webkitTransformOrigin = s + "px " + u + "px", this.billboard.style.transformOrigin = s + "px " + u + "px", this.boardOrientation = n
  28191. }
  28192. }
  28193. var h = new o.Vector3(-this.discScale / 2, 0, 0)
  28194. .applyQuaternion(t.quaternion)
  28195. .add(e)
  28196. .project(t),
  28197. c = Math.abs(i.x - h.x) * (window.renderWidth || window.innerWidth),
  28198. d = Math.sqrt(c / 40) * l.mattertags.boardScale.boardToDiscRatio,
  28199. p = (i.x + 1) * (window.renderWidth || window.innerWidth) / 2,
  28200. f = (i.y + 1) * (window.renderHeight || window.innerHeight) / 2;
  28201. this.type === y.IFrame || this.type === y.ImageTextAudio ? (this.billboard.screenTransform = this.billboard.initialTransform + " translate(" + p + "px, " + f + "px) scale(0)", this.billboard.style.visibility = "hidden") : this.type === y.Audio ? (this.billboard.screenTransform = " translate(" + p + "px, " + f + "px) scale(" + 1 * d + ")", this.billboard.style.webkitTransform = this.billboard.screenTransform, this.billboard.style.transform = this.billboard.screenTransform) : (this.billboard.screenTransform = this.billboard.initialTransform + " translate(" + p + "px, " + f + "px) scale(" + d * this.animationScale + ")", this.billboard.style.webkitTransform = this.billboard.screenTransform, this.billboard.style.transform = this.billboard.screenTransform)
  28202. }, D.prototype.animateBoard = function(t, i) {
  28203. this.boardState === _ ? (e(".tag-container")
  28204. .show(), p.cancel(this.boardTransition), s.detectSamsungNative() ? (this.boardOrientation = null, this.billboard.style.visibility = "visible", this.emit("tag.opened"), this.boardState = A, t && t()) : (this.billboard.style.webkitTransform = "scale(0)", this.billboard.style.transform = "scale(0)", this.billboard.style.visibility = "visible", this.boardTransition = p.start(f.property(this, "animationScale", 1), l.mattertags.animation.animInTime, function() {
  28205. this.emit("tag.opened"), this.boardState = A, t && t()
  28206. }.bind(this)))) : this.boardState === P && (p.cancel(this.boardTransition), this.boardTransition = p.start(f.property(this, "animationScale", 0), l.mattertags.animation.animOutTime, function() {
  28207. this.emit("tag.closed"), this.boardState = S, this.billboard.style.visibility = "hidden", this.billboard.classList.contains("has-hotzone") || this.billboard.classList.add("has-hotzone"), i && i()
  28208. }.bind(this)))
  28209. }, t.exports = D
  28210. })
  28211. .call(this, i(6))
  28212. }, function(t, e) {
  28213. t.exports = {
  28214. getSize: function(t) {
  28215. var e = 0,
  28216. i = 0;
  28217. if (null != t) {
  28218. var n = t.substring(t.lastIndexOf("_") + 1, t.lastIndexOf("."));
  28219. if (null != n) {
  28220. var r = n.split("x");
  28221. null != r && r.length > 1 && (e = parseInt(r[0], 0), i = parseInt(r[1], 0))
  28222. }
  28223. }
  28224. return {
  28225. width: e,
  28226. height: i
  28227. }
  28228. },
  28229. getWinSize: function(t) {
  28230. var e = this.getSize(t);
  28231. if (!e.width || !e.height || e.width <= (window.renderWidth || window.innerWidth) && e.height <= (window.renderHeight || window.innerHeight)) return e;
  28232. var i = e.width / e.height;
  28233. return i >= (window.renderWidth || window.innerWidth) / (window.renderHeight || window.innerHeight) ? (e.width = (window.renderWidth || window.innerWidth), e.height = e.width / i) : (e.height = (window.renderHeight || window.innerHeight), e.width = e.height * i), e
  28234. }
  28235. }
  28236. }, function(t, e) {
  28237. t.exports = {
  28238. NAVIGATION: "navigation",
  28239. MODEL: "model",
  28240. EXT_LINK: "ext-link"
  28241. }
  28242. }, function(t, e, i) {
  28243. (function(e) {
  28244. (function() {
  28245. "use strict";
  28246. var i, n, r, o = function(t, n) {
  28247. if (!(this instanceof o)) return new o(t, n);
  28248. var r = {
  28249. direction: "horizontal",
  28250. touchEventsTarget: "container",
  28251. initialSlide: 0,
  28252. speed: 300,
  28253. autoplay: !1,
  28254. autoplayDisableOnInteraction: !0,
  28255. autoplayStopOnLast: !1,
  28256. iOSEdgeSwipeDetection: !1,
  28257. iOSEdgeSwipeThreshold: 20,
  28258. freeMode: !1,
  28259. freeModeMomentum: !0,
  28260. freeModeMomentumRatio: 1,
  28261. freeModeMomentumBounce: !0,
  28262. freeModeMomentumBounceRatio: 1,
  28263. freeModeMomentumVelocityRatio: 1,
  28264. freeModeSticky: !1,
  28265. freeModeMinimumVelocity: .02,
  28266. autoHeight: !1,
  28267. setWrapperSize: !1,
  28268. virtualTranslate: !1,
  28269. effect: "slide",
  28270. coverflow: {
  28271. rotate: 50,
  28272. stretch: 0,
  28273. depth: 100,
  28274. modifier: 1,
  28275. slideShadows: !0
  28276. },
  28277. flip: {
  28278. slideShadows: !0,
  28279. limitRotation: !0
  28280. },
  28281. cube: {
  28282. slideShadows: !0,
  28283. shadow: !0,
  28284. shadowOffset: 20,
  28285. shadowScale: .94
  28286. },
  28287. fade: {
  28288. crossFade: !1
  28289. },
  28290. parallax: !1,
  28291. zoom: !1,
  28292. zoomMax: 3,
  28293. zoomMin: 1,
  28294. zoomToggle: !0,
  28295. scrollbar: null,
  28296. scrollbarHide: !0,
  28297. scrollbarDraggable: !1,
  28298. scrollbarSnapOnRelease: !1,
  28299. keyboardControl: !1,
  28300. mousewheelControl: !1,
  28301. mousewheelReleaseOnEdges: !1,
  28302. mousewheelInvert: !1,
  28303. mousewheelForceToAxis: !1,
  28304. mousewheelSensitivity: 1,
  28305. mousewheelEventsTarged: "container",
  28306. hashnav: !1,
  28307. hashnavWatchState: !1,
  28308. history: !1,
  28309. replaceState: !1,
  28310. breakpoints: void 0,
  28311. spaceBetween: 0,
  28312. slidesPerView: 1,
  28313. slidesPerColumn: 1,
  28314. slidesPerColumnFill: "column",
  28315. slidesPerGroup: 1,
  28316. centeredSlides: !1,
  28317. slidesOffsetBefore: 0,
  28318. slidesOffsetAfter: 0,
  28319. roundLengths: !1,
  28320. touchRatio: 1,
  28321. touchAngle: 45,
  28322. simulateTouch: !0,
  28323. shortSwipes: !0,
  28324. longSwipes: !0,
  28325. longSwipesRatio: .5,
  28326. longSwipesMs: 300,
  28327. followFinger: !0,
  28328. onlyExternal: !1,
  28329. threshold: 0,
  28330. touchMoveStopPropagation: !0,
  28331. touchReleaseOnEdges: !1,
  28332. uniqueNavElements: !0,
  28333. pagination: null,
  28334. paginationElement: "span",
  28335. paginationClickable: !1,
  28336. paginationHide: !1,
  28337. paginationBulletRender: null,
  28338. paginationProgressRender: null,
  28339. paginationFractionRender: null,
  28340. paginationCustomRender: null,
  28341. paginationType: "bullets",
  28342. resistance: !0,
  28343. resistanceRatio: .85,
  28344. nextButton: null,
  28345. prevButton: null,
  28346. watchSlidesProgress: !1,
  28347. watchSlidesVisibility: !1,
  28348. grabCursor: !1,
  28349. preventClicks: !0,
  28350. preventClicksPropagation: !0,
  28351. slideToClickedSlide: !1,
  28352. lazyLoading: !1,
  28353. lazyLoadingInPrevNext: !1,
  28354. lazyLoadingInPrevNextAmount: 1,
  28355. lazyLoadingOnTransitionStart: !1,
  28356. preloadImages: !0,
  28357. updateOnImagesReady: !0,
  28358. loop: !1,
  28359. loopAdditionalSlides: 0,
  28360. loopedSlides: null,
  28361. control: void 0,
  28362. controlInverse: !1,
  28363. controlBy: "slide",
  28364. normalizeSlideIndex: !0,
  28365. allowSwipeToPrev: !0,
  28366. allowSwipeToNext: !0,
  28367. swipeHandler: null,
  28368. noSwiping: !0,
  28369. noSwipingClass: "swiper-no-swiping",
  28370. passiveListeners: !0,
  28371. containerModifierClass: "swiper-container-",
  28372. slideClass: "swiper-slide",
  28373. slideActiveClass: "swiper-slide-active",
  28374. slideDuplicateActiveClass: "swiper-slide-duplicate-active",
  28375. slideVisibleClass: "swiper-slide-visible",
  28376. slideDuplicateClass: "swiper-slide-duplicate",
  28377. slideNextClass: "swiper-slide-next",
  28378. slideDuplicateNextClass: "swiper-slide-duplicate-next",
  28379. slidePrevClass: "swiper-slide-prev",
  28380. slideDuplicatePrevClass: "swiper-slide-duplicate-prev",
  28381. wrapperClass: "swiper-wrapper",
  28382. bulletClass: "swiper-pagination-bullet",
  28383. bulletActiveClass: "swiper-pagination-bullet-active",
  28384. buttonDisabledClass: "swiper-button-disabled",
  28385. paginationCurrentClass: "swiper-pagination-current",
  28386. paginationTotalClass: "swiper-pagination-total",
  28387. paginationHiddenClass: "swiper-pagination-hidden",
  28388. paginationProgressbarClass: "swiper-pagination-progressbar",
  28389. paginationClickableClass: "swiper-pagination-clickable",
  28390. paginationModifierClass: "swiper-pagination-",
  28391. lazyLoadingClass: "swiper-lazy",
  28392. lazyStatusLoadingClass: "swiper-lazy-loading",
  28393. lazyStatusLoadedClass: "swiper-lazy-loaded",
  28394. lazyPreloaderClass: "swiper-lazy-preloader",
  28395. notificationClass: "swiper-notification",
  28396. preloaderClass: "preloader",
  28397. zoomContainerClass: "swiper-zoom-container",
  28398. observer: !1,
  28399. observeParents: !1,
  28400. a11y: !1,
  28401. prevSlideMessage: "Previous slide",
  28402. nextSlideMessage: "Next slide",
  28403. firstSlideMessage: "This is the first slide",
  28404. lastSlideMessage: "This is the last slide",
  28405. paginationBulletMessage: "Go to slide {{index}}",
  28406. runCallbacksOnInit: !0
  28407. },
  28408. a = n && n.virtualTranslate;
  28409. n = n || {};
  28410. var l = {};
  28411. for (var u in n)
  28412. if ("object" != typeof n[u] || null === n[u] || (n[u].nodeType || n[u] === window || n[u] === document || void 0 !== s && n[u] instanceof s || void 0 !== e && n[u] instanceof e)) l[u] = n[u];
  28413. else
  28414. for (var h in l[u] = {}, n[u]) l[u][h] = n[u][h];
  28415. for (var c in r)
  28416. if (void 0 === n[c]) n[c] = r[c];
  28417. else if ("object" == typeof n[c])
  28418. for (var d in r[c]) void 0 === n[c][d] && (n[c][d] = r[c][d]);
  28419. var p = this;
  28420. if (p.params = n, p.originalParams = l, p.classNames = [], void 0 !== i && void 0 !== s && (i = s), (void 0 !== i || (i = void 0 === s ? window.Dom7 || window.Zepto || window.jQuery : s)) && (p.$ = i, p.currentBreakpoint = void 0, p.getActiveBreakpoint = function() {
  28421. if (!p.params.breakpoints) return !1;
  28422. var t, e = !1,
  28423. i = [];
  28424. for (t in p.params.breakpoints) p.params.breakpoints.hasOwnProperty(t) && i.push(t);
  28425. i.sort((function(t, e) {
  28426. return parseInt(t, 10) > parseInt(e, 10)
  28427. }));
  28428. for (var n = 0; n < i.length; n++)(t = i[n]) >= (window.renderWidth || window.innerWidth) && !e && (e = t);
  28429. return e || "max"
  28430. }, p.setBreakpoint = function() {
  28431. var t = p.getActiveBreakpoint();
  28432. if (t && p.currentBreakpoint !== t) {
  28433. var e = t in p.params.breakpoints ? p.params.breakpoints[t] : p.originalParams,
  28434. i = p.params.loop && e.slidesPerView !== p.params.slidesPerView;
  28435. for (var n in e) p.params[n] = e[n];
  28436. p.currentBreakpoint = t, i && p.destroyLoop && p.reLoop(!0)
  28437. }
  28438. }, p.params.breakpoints && p.setBreakpoint(), p.container = i(t), 0 !== p.container.length)) {
  28439. if (p.container.length > 1) {
  28440. var f = [];
  28441. return p.container.each((function() {
  28442. f.push(new o(this, n))
  28443. })), f
  28444. }
  28445. p.container[0].swiper = p, p.container.data("swiper", p), p.classNames.push(p.params.containerModifierClass + p.params.direction), p.params.freeMode && p.classNames.push(p.params.containerModifierClass + "free-mode"), p.support.flexbox || (p.classNames.push(p.params.containerModifierClass + "no-flexbox"), p.params.slidesPerColumn = 1), p.params.autoHeight && p.classNames.push(p.params.containerModifierClass + "autoheight"), (p.params.parallax || p.params.watchSlidesVisibility) && (p.params.watchSlidesProgress = !0), p.params.touchReleaseOnEdges && (p.params.resistanceRatio = 0), ["cube", "coverflow", "flip"].indexOf(p.params.effect) >= 0 && (p.support.transforms3d ? (p.params.watchSlidesProgress = !0, p.classNames.push(p.params.containerModifierClass + "3d")) : p.params.effect = "slide"), "slide" !== p.params.effect && p.classNames.push(p.params.containerModifierClass + p.params.effect), "cube" === p.params.effect && (p.params.resistanceRatio = 0, p.params.slidesPerView = 1, p.params.slidesPerColumn = 1, p.params.slidesPerGroup = 1, p.params.centeredSlides = !1, p.params.spaceBetween = 0, p.params.virtualTranslate = !0), "fade" !== p.params.effect && "flip" !== p.params.effect || (p.params.slidesPerView = 1, p.params.slidesPerColumn = 1, p.params.slidesPerGroup = 1, p.params.watchSlidesProgress = !0, p.params.spaceBetween = 0, void 0 === a && (p.params.virtualTranslate = !0)), p.params.grabCursor && p.support.touch && (p.params.grabCursor = !1), p.wrapper = p.container.children("." + p.params.wrapperClass), p.params.pagination && (p.paginationContainer = i(p.params.pagination), p.params.uniqueNavElements && "string" == typeof p.params.pagination && p.paginationContainer.length > 1 && 1 === p.container.find(p.params.pagination)
  28446. .length && (p.paginationContainer = p.container.find(p.params.pagination)), "bullets" === p.params.paginationType && p.params.paginationClickable ? p.paginationContainer.addClass(p.params.paginationModifierClass + "clickable") : p.params.paginationClickable = !1, p.paginationContainer.addClass(p.params.paginationModifierClass + p.params.paginationType)), (p.params.nextButton || p.params.prevButton) && (p.params.nextButton && (p.nextButton = i(p.params.nextButton), p.params.uniqueNavElements && "string" == typeof p.params.nextButton && p.nextButton.length > 1 && 1 === p.container.find(p.params.nextButton)
  28447. .length && (p.nextButton = p.container.find(p.params.nextButton))), p.params.prevButton && (p.prevButton = i(p.params.prevButton), p.params.uniqueNavElements && "string" == typeof p.params.prevButton && p.prevButton.length > 1 && 1 === p.container.find(p.params.prevButton)
  28448. .length && (p.prevButton = p.container.find(p.params.prevButton)))), p.isHorizontal = function() {
  28449. return "horizontal" === p.params.direction
  28450. }, p.rtl = p.isHorizontal() && ("rtl" === p.container[0].dir.toLowerCase() || "rtl" === p.container.css("direction")), p.rtl && p.classNames.push(p.params.containerModifierClass + "rtl"), p.rtl && (p.wrongRTL = "-webkit-box" === p.wrapper.css("display")), p.params.slidesPerColumn > 1 && p.classNames.push(p.params.containerModifierClass + "multirow"), p.device.android && p.classNames.push(p.params.containerModifierClass + "android"), p.container.addClass(p.classNames.join(" ")), p.translate = 0, p.progress = 0, p.velocity = 0, p.lockSwipeToNext = function() {
  28451. p.params.allowSwipeToNext = !1, !1 === p.params.allowSwipeToPrev && p.params.grabCursor && p.unsetGrabCursor()
  28452. }, p.lockSwipeToPrev = function() {
  28453. p.params.allowSwipeToPrev = !1, !1 === p.params.allowSwipeToNext && p.params.grabCursor && p.unsetGrabCursor()
  28454. }, p.lockSwipes = function() {
  28455. p.params.allowSwipeToNext = p.params.allowSwipeToPrev = !1, p.params.grabCursor && p.unsetGrabCursor()
  28456. }, p.unlockSwipeToNext = function() {
  28457. p.params.allowSwipeToNext = !0, !0 === p.params.allowSwipeToPrev && p.params.grabCursor && p.setGrabCursor()
  28458. }, p.unlockSwipeToPrev = function() {
  28459. p.params.allowSwipeToPrev = !0, !0 === p.params.allowSwipeToNext && p.params.grabCursor && p.setGrabCursor()
  28460. }, p.unlockSwipes = function() {
  28461. p.params.allowSwipeToNext = p.params.allowSwipeToPrev = !0, p.params.grabCursor && p.setGrabCursor()
  28462. }, p.setGrabCursor = function(t) {
  28463. p.container[0].style.cursor = "move", p.container[0].style.cursor = t ? "-webkit-grabbing" : "-webkit-grab", p.container[0].style.cursor = t ? "-moz-grabbin" : "-moz-grab", p.container[0].style.cursor = t ? "grabbing" : "grab"
  28464. }, p.unsetGrabCursor = function() {
  28465. p.container[0].style.cursor = ""
  28466. }, p.params.grabCursor && p.setGrabCursor(), p.imagesToLoad = [], p.imagesLoaded = 0, p.loadImage = function(t, e, i, n, r, o) {
  28467. var a;
  28468. function s() {
  28469. o && o()
  28470. }
  28471. t.complete && r ? s() : e ? ((a = new window.Image)
  28472. .onload = s, a.onerror = s, n && (a.sizes = n), i && (a.srcset = i), e && (a.src = e)) : s()
  28473. }, p.preloadImages = function() {
  28474. function t() {
  28475. null != p && p && (void 0 !== p.imagesLoaded && p.imagesLoaded++, p.imagesLoaded === p.imagesToLoad.length && (p.params.updateOnImagesReady && p.update(), p.emit("onImagesReady", p)))
  28476. }
  28477. p.imagesToLoad = p.container.find("img");
  28478. for (var e = 0; e < p.imagesToLoad.length; e++) p.loadImage(p.imagesToLoad[e], p.imagesToLoad[e].currentSrc || p.imagesToLoad[e].getAttribute("src"), p.imagesToLoad[e].srcset || p.imagesToLoad[e].getAttribute("srcset"), p.imagesToLoad[e].sizes || p.imagesToLoad[e].getAttribute("sizes"), !0, t)
  28479. }, p.autoplayTimeoutId = void 0, p.autoplaying = !1, p.autoplayPaused = !1, p.startAutoplay = function() {
  28480. return void 0 === p.autoplayTimeoutId && (!!p.params.autoplay && (!p.autoplaying && (p.autoplaying = !0, p.emit("onAutoplayStart", p), void I())))
  28481. }, p.stopAutoplay = function(t) {
  28482. p.autoplayTimeoutId && (p.autoplayTimeoutId && clearTimeout(p.autoplayTimeoutId), p.autoplaying = !1, p.autoplayTimeoutId = void 0, p.emit("onAutoplayStop", p))
  28483. }, p.pauseAutoplay = function(t) {
  28484. p.autoplayPaused || (p.autoplayTimeoutId && clearTimeout(p.autoplayTimeoutId), p.autoplayPaused = !0, 0 === t ? (p.autoplayPaused = !1, I()) : p.wrapper.transitionEnd((function() {
  28485. p && (p.autoplayPaused = !1, p.autoplaying ? I() : p.stopAutoplay())
  28486. })))
  28487. }, p.minTranslate = function() {
  28488. return -p.snapGrid[0]
  28489. }, p.maxTranslate = function() {
  28490. return -p.snapGrid[p.snapGrid.length - 1]
  28491. }, p.updateAutoHeight = function() {
  28492. var t, e = [],
  28493. i = 0;
  28494. if ("auto" !== p.params.slidesPerView && p.params.slidesPerView > 1)
  28495. for (t = 0; t < Math.ceil(p.params.slidesPerView); t++) {
  28496. var n = p.activeIndex + t;
  28497. if (n > p.slides.length) break;
  28498. e.push(p.slides.eq(n)[0])
  28499. } else e.push(p.slides.eq(p.activeIndex)[0]);
  28500. for (t = 0; t < e.length; t++)
  28501. if (void 0 !== e[t]) {
  28502. var r = e[t].offsetHeight;
  28503. i = r > i ? r : i
  28504. } i && p.wrapper.css("height", i + "px")
  28505. }, p.updateContainerSize = function() {
  28506. var t, e;
  28507. t = void 0 !== p.params.width ? p.params.width : p.container[0].clientWidth, e = void 0 !== p.params.height ? p.params.height : p.container[0].clientHeight, 0 === t && p.isHorizontal() || 0 === e && !p.isHorizontal() || (t = t - parseInt(p.container.css("padding-left"), 10) - parseInt(p.container.css("padding-right"), 10), e = e - parseInt(p.container.css("padding-top"), 10) - parseInt(p.container.css("padding-bottom"), 10), p.width = t, p.height = e, p.size = p.isHorizontal() ? p.width : p.height)
  28508. }, p.updateSlidesSize = function() {
  28509. p.slides = p.wrapper.children("." + p.params.slideClass), p.snapGrid = [], p.slidesGrid = [], p.slidesSizesGrid = [];
  28510. var t, e = p.params.spaceBetween,
  28511. i = -p.params.slidesOffsetBefore,
  28512. n = 0,
  28513. r = 0;
  28514. if (void 0 !== p.size) {
  28515. var o, a;
  28516. "string" == typeof e && e.indexOf("%") >= 0 && (e = parseFloat(e.replace("%", "")) / 100 * p.size), p.virtualSize = -e, p.rtl ? p.slides.css({
  28517. marginLeft: "",
  28518. marginTop: ""
  28519. }) : p.slides.css({
  28520. marginRight: "",
  28521. marginBottom: ""
  28522. }), p.params.slidesPerColumn > 1 && (o = Math.floor(p.slides.length / p.params.slidesPerColumn) === p.slides.length / p.params.slidesPerColumn ? p.slides.length : Math.ceil(p.slides.length / p.params.slidesPerColumn) * p.params.slidesPerColumn, "auto" !== p.params.slidesPerView && "row" === p.params.slidesPerColumnFill && (o = Math.max(o, p.params.slidesPerView * p.params.slidesPerColumn)));
  28523. var s, l = p.params.slidesPerColumn,
  28524. u = o / l,
  28525. h = u - (p.params.slidesPerColumn * u - p.slides.length);
  28526. for (t = 0; t < p.slides.length; t++) {
  28527. a = 0;
  28528. var c, d, f, m = p.slides.eq(t);
  28529. if (p.params.slidesPerColumn > 1) "column" === p.params.slidesPerColumnFill ? (f = t - (d = Math.floor(t / l)) * l, (d > h || d === h && f === l - 1) && ++f >= l && (f = 0, d++), c = d + f * o / l, m.css({
  28530. "-webkit-box-ordinal-group": c,
  28531. "-moz-box-ordinal-group": c,
  28532. "-ms-flex-order": c,
  28533. "-webkit-order": c,
  28534. order: c
  28535. })) : d = t - (f = Math.floor(t / u)) * u, m.css("margin-" + (p.isHorizontal() ? "top" : "left"), 0 !== f && p.params.spaceBetween && p.params.spaceBetween + "px")
  28536. .attr("data-swiper-column", d)
  28537. .attr("data-swiper-row", f);
  28538. "none" !== m.css("display") && ("auto" === p.params.slidesPerView ? (a = p.isHorizontal() ? m.outerWidth(!0) : m.outerHeight(!0), p.params.roundLengths && (a = O(a))) : (a = (p.size - (p.params.slidesPerView - 1) * e) / p.params.slidesPerView, p.params.roundLengths && (a = O(a)), p.isHorizontal() ? p.slides[t].style.width = a + "px" : p.slides[t].style.height = a + "px"), p.slides[t].swiperSlideSize = a, p.slidesSizesGrid.push(a), p.params.centeredSlides ? (i = i + a / 2 + n / 2 + e, 0 === n && 0 !== t && (i = i - p.size / 2 - e), 0 === t && (i = i - p.size / 2 - e), Math.abs(i) < .001 && (i = 0), r % p.params.slidesPerGroup == 0 && p.snapGrid.push(i), p.slidesGrid.push(i)) : (r % p.params.slidesPerGroup == 0 && p.snapGrid.push(i), p.slidesGrid.push(i), i = i + a + e), p.virtualSize += a + e, n = a, r++)
  28539. }
  28540. if (p.virtualSize = Math.max(p.virtualSize, p.size) + p.params.slidesOffsetAfter, p.rtl && p.wrongRTL && ("slide" === p.params.effect || "coverflow" === p.params.effect) && p.wrapper.css({
  28541. width: p.virtualSize + p.params.spaceBetween + "px"
  28542. }), p.support.flexbox && !p.params.setWrapperSize || (p.isHorizontal() ? p.wrapper.css({
  28543. width: p.virtualSize + p.params.spaceBetween + "px"
  28544. }) : p.wrapper.css({
  28545. height: p.virtualSize + p.params.spaceBetween + "px"
  28546. })), p.params.slidesPerColumn > 1 && (p.virtualSize = (a + p.params.spaceBetween) * o, p.virtualSize = Math.ceil(p.virtualSize / p.params.slidesPerColumn) - p.params.spaceBetween, p.isHorizontal() ? p.wrapper.css({
  28547. width: p.virtualSize + p.params.spaceBetween + "px"
  28548. }) : p.wrapper.css({
  28549. height: p.virtualSize + p.params.spaceBetween + "px"
  28550. }), p.params.centeredSlides)) {
  28551. for (s = [], t = 0; t < p.snapGrid.length; t++) p.snapGrid[t] < p.virtualSize + p.snapGrid[0] && s.push(p.snapGrid[t]);
  28552. p.snapGrid = s
  28553. }
  28554. if (!p.params.centeredSlides) {
  28555. for (s = [], t = 0; t < p.snapGrid.length; t++) p.snapGrid[t] <= p.virtualSize - p.size && s.push(p.snapGrid[t]);
  28556. p.snapGrid = s, Math.floor(p.virtualSize - p.size) - Math.floor(p.snapGrid[p.snapGrid.length - 1]) > 1 && p.snapGrid.push(p.virtualSize - p.size)
  28557. }
  28558. 0 === p.snapGrid.length && (p.snapGrid = [0]), 0 !== p.params.spaceBetween && (p.isHorizontal() ? p.rtl ? p.slides.css({
  28559. marginLeft: e + "px"
  28560. }) : p.slides.css({
  28561. marginRight: e + "px"
  28562. }) : p.slides.css({
  28563. marginBottom: e + "px"
  28564. })), p.params.watchSlidesProgress && p.updateSlidesOffset()
  28565. }
  28566. }, p.updateSlidesOffset = function() {
  28567. for (var t = 0; t < p.slides.length; t++) p.slides[t].swiperSlideOffset = p.isHorizontal() ? p.slides[t].offsetLeft : p.slides[t].offsetTop
  28568. }, p.currentSlidesPerView = function() {
  28569. var t, e, i = 1;
  28570. if (p.params.centeredSlides) {
  28571. var n, r = p.slides[p.activeIndex].swiperSlideSize;
  28572. for (t = p.activeIndex + 1; t < p.slides.length; t++) p.slides[t] && !n && (i++, (r += p.slides[t].swiperSlideSize) > p.size && (n = !0));
  28573. for (e = p.activeIndex - 1; e >= 0; e--) p.slides[e] && !n && (i++, (r += p.slides[e].swiperSlideSize) > p.size && (n = !0))
  28574. } else
  28575. for (t = p.activeIndex + 1; t < p.slides.length; t++) p.slidesGrid[t] - p.slidesGrid[p.activeIndex] < p.size && i++;
  28576. return i
  28577. }, p.updateSlidesProgress = function(t) {
  28578. if (void 0 === t && (t = p.translate || 0), 0 !== p.slides.length) {
  28579. void 0 === p.slides[0].swiperSlideOffset && p.updateSlidesOffset();
  28580. var e = -t;
  28581. p.rtl && (e = t), p.slides.removeClass(p.params.slideVisibleClass);
  28582. for (var i = 0; i < p.slides.length; i++) {
  28583. var n = p.slides[i],
  28584. r = (e + (p.params.centeredSlides ? p.minTranslate() : 0) - n.swiperSlideOffset) / (n.swiperSlideSize + p.params.spaceBetween);
  28585. if (p.params.watchSlidesVisibility) {
  28586. var o = -(e - n.swiperSlideOffset),
  28587. a = o + p.slidesSizesGrid[i];
  28588. (o >= 0 && o < p.size || a > 0 && a <= p.size || o <= 0 && a >= p.size) && p.slides.eq(i)
  28589. .addClass(p.params.slideVisibleClass)
  28590. }
  28591. n.progress = p.rtl ? -r : r
  28592. }
  28593. }
  28594. }, p.updateProgress = function(t) {
  28595. void 0 === t && (t = p.translate || 0);
  28596. var e = p.maxTranslate() - p.minTranslate(),
  28597. i = p.isBeginning,
  28598. n = p.isEnd;
  28599. 0 === e ? (p.progress = 0, p.isBeginning = p.isEnd = !0) : (p.progress = (t - p.minTranslate()) / e, p.isBeginning = p.progress <= 0, p.isEnd = p.progress >= 1), p.isBeginning && !i && p.emit("onReachBeginning", p), p.isEnd && !n && p.emit("onReachEnd", p), p.params.watchSlidesProgress && p.updateSlidesProgress(t), p.emit("onProgress", p, p.progress)
  28600. }, p.updateActiveIndex = function() {
  28601. var t, e, i, n = p.rtl ? p.translate : -p.translate;
  28602. for (e = 0; e < p.slidesGrid.length; e++) void 0 !== p.slidesGrid[e + 1] ? n >= p.slidesGrid[e] && n < p.slidesGrid[e + 1] - (p.slidesGrid[e + 1] - p.slidesGrid[e]) / 2 ? t = e : n >= p.slidesGrid[e] && n < p.slidesGrid[e + 1] && (t = e + 1) : n >= p.slidesGrid[e] && (t = e);
  28603. p.params.normalizeSlideIndex && (t < 0 || void 0 === t) && (t = 0), (i = Math.floor(t / p.params.slidesPerGroup)) >= p.snapGrid.length && (i = p.snapGrid.length - 1), t !== p.activeIndex && (p.snapIndex = i, p.previousIndex = p.activeIndex, p.activeIndex = t, p.updateClasses(), p.updateRealIndex())
  28604. }, p.updateRealIndex = function() {
  28605. p.realIndex = parseInt(p.slides.eq(p.activeIndex)
  28606. .attr("data-swiper-slide-index") || p.activeIndex, 10)
  28607. }, p.updateClasses = function() {
  28608. p.slides.removeClass(p.params.slideActiveClass + " " + p.params.slideNextClass + " " + p.params.slidePrevClass + " " + p.params.slideDuplicateActiveClass + " " + p.params.slideDuplicateNextClass + " " + p.params.slideDuplicatePrevClass);
  28609. var t = p.slides.eq(p.activeIndex);
  28610. t.addClass(p.params.slideActiveClass), n.loop && (t.hasClass(p.params.slideDuplicateClass) ? p.wrapper.children("." + p.params.slideClass + ":not(." + p.params.slideDuplicateClass + ')[data-swiper-slide-index="' + p.realIndex + '"]')
  28611. .addClass(p.params.slideDuplicateActiveClass) : p.wrapper.children("." + p.params.slideClass + "." + p.params.slideDuplicateClass + '[data-swiper-slide-index="' + p.realIndex + '"]')
  28612. .addClass(p.params.slideDuplicateActiveClass));
  28613. var e = t.next("." + p.params.slideClass)
  28614. .addClass(p.params.slideNextClass);
  28615. p.params.loop && 0 === e.length && (e = p.slides.eq(0))
  28616. .addClass(p.params.slideNextClass);
  28617. var r = t.prev("." + p.params.slideClass)
  28618. .addClass(p.params.slidePrevClass);
  28619. if (p.params.loop && 0 === r.length && (r = p.slides.eq(-1))
  28620. .addClass(p.params.slidePrevClass), n.loop && (e.hasClass(p.params.slideDuplicateClass) ? p.wrapper.children("." + p.params.slideClass + ":not(." + p.params.slideDuplicateClass + ')[data-swiper-slide-index="' + e.attr("data-swiper-slide-index") + '"]')
  28621. .addClass(p.params.slideDuplicateNextClass) : p.wrapper.children("." + p.params.slideClass + "." + p.params.slideDuplicateClass + '[data-swiper-slide-index="' + e.attr("data-swiper-slide-index") + '"]')
  28622. .addClass(p.params.slideDuplicateNextClass), r.hasClass(p.params.slideDuplicateClass) ? p.wrapper.children("." + p.params.slideClass + ":not(." + p.params.slideDuplicateClass + ')[data-swiper-slide-index="' + r.attr("data-swiper-slide-index") + '"]')
  28623. .addClass(p.params.slideDuplicatePrevClass) : p.wrapper.children("." + p.params.slideClass + "." + p.params.slideDuplicateClass + '[data-swiper-slide-index="' + r.attr("data-swiper-slide-index") + '"]')
  28624. .addClass(p.params.slideDuplicatePrevClass)), p.paginationContainer && p.paginationContainer.length > 0) {
  28625. var o, a = p.params.loop ? Math.ceil((p.slides.length - 2 * p.loopedSlides) / p.params.slidesPerGroup) : p.snapGrid.length;
  28626. if (p.params.loop ? ((o = Math.ceil((p.activeIndex - p.loopedSlides) / p.params.slidesPerGroup)) > p.slides.length - 1 - 2 * p.loopedSlides && (o -= p.slides.length - 2 * p.loopedSlides), o > a - 1 && (o -= a), o < 0 && "bullets" !== p.params.paginationType && (o = a + o)) : o = void 0 !== p.snapIndex ? p.snapIndex : p.activeIndex || 0, "bullets" === p.params.paginationType && p.bullets && p.bullets.length > 0 && (p.bullets.removeClass(p.params.bulletActiveClass), p.paginationContainer.length > 1 ? p.bullets.each((function() {
  28627. i(this)
  28628. .index() === o && i(this)
  28629. .addClass(p.params.bulletActiveClass)
  28630. })) : p.bullets.eq(o)
  28631. .addClass(p.params.bulletActiveClass)), "fraction" === p.params.paginationType && (p.paginationContainer.find("." + p.params.paginationCurrentClass)
  28632. .text(o + 1), p.paginationContainer.find("." + p.params.paginationTotalClass)
  28633. .text(a)), "progress" === p.params.paginationType) {
  28634. var s = (o + 1) / a,
  28635. l = s,
  28636. u = 1;
  28637. p.isHorizontal() || (u = s, l = 1), p.paginationContainer.find("." + p.params.paginationProgressbarClass)
  28638. .transform("translate3d(0,0,0) scaleX(" + l + ") scaleY(" + u + ")")
  28639. .transition(p.params.speed)
  28640. }
  28641. "custom" === p.params.paginationType && p.params.paginationCustomRender && (p.paginationContainer.html(p.params.paginationCustomRender(p, o + 1, a)), p.emit("onPaginationRendered", p, p.paginationContainer[0]))
  28642. }
  28643. p.params.loop || (p.params.prevButton && p.prevButton && p.prevButton.length > 0 && (p.isBeginning ? (p.prevButton.addClass(p.params.buttonDisabledClass), p.params.a11y && p.a11y && p.a11y.disable(p.prevButton)) : (p.prevButton.removeClass(p.params.buttonDisabledClass), p.params.a11y && p.a11y && p.a11y.enable(p.prevButton))), p.params.nextButton && p.nextButton && p.nextButton.length > 0 && (p.isEnd ? (p.nextButton.addClass(p.params.buttonDisabledClass), p.params.a11y && p.a11y && p.a11y.disable(p.nextButton)) : (p.nextButton.removeClass(p.params.buttonDisabledClass), p.params.a11y && p.a11y && p.a11y.enable(p.nextButton))))
  28644. }, p.updatePagination = function() {
  28645. if (p.params.pagination && p.paginationContainer && p.paginationContainer.length > 0) {
  28646. var t = "";
  28647. if ("bullets" === p.params.paginationType) {
  28648. for (var e = p.params.loop ? Math.ceil((p.slides.length - 2 * p.loopedSlides) / p.params.slidesPerGroup) : p.snapGrid.length, i = 0; i < e; i++) p.params.paginationBulletRender ? t += p.params.paginationBulletRender(p, i, p.params.bulletClass) : t += "<" + p.params.paginationElement + ' class="' + p.params.bulletClass + '"></' + p.params.paginationElement + ">";
  28649. p.paginationContainer.html(t), p.bullets = p.paginationContainer.find("." + p.params.bulletClass), p.params.paginationClickable && p.params.a11y && p.a11y && p.a11y.initPagination()
  28650. }
  28651. "fraction" === p.params.paginationType && (t = p.params.paginationFractionRender ? p.params.paginationFractionRender(p, p.params.paginationCurrentClass, p.params.paginationTotalClass) : '<span class="' + p.params.paginationCurrentClass + '"></span> / <span class="' + p.params.paginationTotalClass + '"></span>', p.paginationContainer.html(t)), "progress" === p.params.paginationType && (t = p.params.paginationProgressRender ? p.params.paginationProgressRender(p, p.params.paginationProgressbarClass) : '<span class="' + p.params.paginationProgressbarClass + '"></span>', p.paginationContainer.html(t)), "custom" !== p.params.paginationType && p.emit("onPaginationRendered", p, p.paginationContainer[0])
  28652. }
  28653. }, p.update = function(t) {
  28654. var e;
  28655. p && (p.updateContainerSize(), p.updateSlidesSize(), p.updateProgress(), p.updatePagination(), p.updateClasses(), p.params.scrollbar && p.scrollbar && p.scrollbar.set(), t ? (p.controller && p.controller.spline && (p.controller.spline = void 0), p.params.freeMode ? (i(), p.params.autoHeight && p.updateAutoHeight()) : (("auto" === p.params.slidesPerView || p.params.slidesPerView > 1) && p.isEnd && !p.params.centeredSlides ? p.slideTo(p.slides.length - 1, 0, !1, !0) : p.slideTo(p.activeIndex, 0, !1, !0)) || i()) : p.params.autoHeight && p.updateAutoHeight());
  28656. function i() {
  28657. p.rtl, p.translate;
  28658. e = Math.min(Math.max(p.translate, p.maxTranslate()), p.minTranslate()), p.setWrapperTranslate(e), p.updateActiveIndex(), p.updateClasses()
  28659. }
  28660. }, p.onResize = function(t) {
  28661. p.params.onBeforeResize && p.params.onBeforeResize(p), p.params.breakpoints && p.setBreakpoint();
  28662. var e = p.params.allowSwipeToPrev,
  28663. i = p.params.allowSwipeToNext;
  28664. p.params.allowSwipeToPrev = p.params.allowSwipeToNext = !0, p.updateContainerSize(), p.updateSlidesSize(), ("auto" === p.params.slidesPerView || p.params.freeMode || t) && p.updatePagination(), p.params.scrollbar && p.scrollbar && p.scrollbar.set(), p.controller && p.controller.spline && (p.controller.spline = void 0);
  28665. var n = !1;
  28666. if (p.params.freeMode) {
  28667. var r = Math.min(Math.max(p.translate, p.maxTranslate()), p.minTranslate());
  28668. p.setWrapperTranslate(r), p.updateActiveIndex(), p.updateClasses(), p.params.autoHeight && p.updateAutoHeight()
  28669. } else p.updateClasses(), n = ("auto" === p.params.slidesPerView || p.params.slidesPerView > 1) && p.isEnd && !p.params.centeredSlides ? p.slideTo(p.slides.length - 1, 0, !1, !0) : p.slideTo(p.activeIndex, 0, !1, !0);
  28670. p.params.lazyLoading && !n && p.lazy && p.lazy.load(), p.params.allowSwipeToPrev = e, p.params.allowSwipeToNext = i, p.params.onAfterResize && p.params.onAfterResize(p)
  28671. }, p.touchEventsDesktop = {
  28672. start: "mousedown",
  28673. move: "mousemove",
  28674. end: "mouseup"
  28675. }, window.navigator.pointerEnabled ? p.touchEventsDesktop = {
  28676. start: "pointerdown",
  28677. move: "pointermove",
  28678. end: "pointerup"
  28679. } : window.navigator.msPointerEnabled && (p.touchEventsDesktop = {
  28680. start: "MSPointerDown",
  28681. move: "MSPointerMove",
  28682. end: "MSPointerUp"
  28683. }), p.touchEvents = {
  28684. start: p.support.touch || !p.params.simulateTouch ? "touchstart" : p.touchEventsDesktop.start,
  28685. move: p.support.touch || !p.params.simulateTouch ? "touchmove" : p.touchEventsDesktop.move,
  28686. end: p.support.touch || !p.params.simulateTouch ? "touchend" : p.touchEventsDesktop.end
  28687. }, (window.navigator.pointerEnabled || window.navigator.msPointerEnabled) && ("container" === p.params.touchEventsTarget ? p.container : p.wrapper)
  28688. .addClass("swiper-wp8-" + p.params.direction), p.initEvents = function(t) {
  28689. var e = t ? "off" : "on",
  28690. i = t ? "removeEventListener" : "addEventListener",
  28691. r = "container" === p.params.touchEventsTarget ? p.container[0] : p.wrapper[0],
  28692. o = p.support.touch ? r : document,
  28693. a = !!p.params.nested;
  28694. if (p.browser.ie) r[i](p.touchEvents.start, p.onTouchStart, !1), o[i](p.touchEvents.move, p.onTouchMove, a), o[i](p.touchEvents.end, p.onTouchEnd, !1);
  28695. else {
  28696. if (p.support.touch) {
  28697. var s = !("touchstart" !== p.touchEvents.start || !p.support.passiveListener || !p.params.passiveListeners) && {
  28698. passive: !0,
  28699. capture: !1
  28700. };
  28701. r[i](p.touchEvents.start, p.onTouchStart, s), r[i](p.touchEvents.move, p.onTouchMove, a), r[i](p.touchEvents.end, p.onTouchEnd, s)
  28702. }(n.simulateTouch && !p.device.ios && !p.device.android || n.simulateTouch && !p.support.touch && p.device.ios) && (r[i]("mousedown", p.onTouchStart, !1), document[i]("mousemove", p.onTouchMove, a), document[i]("mouseup", p.onTouchEnd, !1))
  28703. }
  28704. window[i]("resize", p.onResize), p.params.nextButton && p.nextButton && p.nextButton.length > 0 && (p.nextButton[e]("click", p.onClickNext), p.params.a11y && p.a11y && p.nextButton[e]("keydown", p.a11y.onEnterKey)), p.params.prevButton && p.prevButton && p.prevButton.length > 0 && (p.prevButton[e]("click", p.onClickPrev), p.params.a11y && p.a11y && p.prevButton[e]("keydown", p.a11y.onEnterKey)), p.params.pagination && p.params.paginationClickable && (p.paginationContainer[e]("click", "." + p.params.bulletClass, p.onClickIndex), p.params.a11y && p.a11y && p.paginationContainer[e]("keydown", "." + p.params.bulletClass, p.a11y.onEnterKey)), (p.params.preventClicks || p.params.preventClicksPropagation) && r[i]("click", p.preventClicks, !0)
  28705. }, p.attachEvents = function() {
  28706. p.initEvents()
  28707. }, p.detachEvents = function() {
  28708. p.initEvents(!0)
  28709. }, p.allowClick = !0, p.preventClicks = function(t) {
  28710. p.allowClick || (p.params.preventClicks && t.preventDefault(), p.params.preventClicksPropagation && p.animating && (t.stopPropagation(), t.stopImmediatePropagation()))
  28711. }, p.onClickNext = function(t) {
  28712. t.preventDefault(), p.isEnd && !p.params.loop || p.slideNext()
  28713. }, p.onClickPrev = function(t) {
  28714. t.preventDefault(), p.isBeginning && !p.params.loop || p.slidePrev()
  28715. }, p.onClickIndex = function(t) {
  28716. t.preventDefault();
  28717. var e = i(this)
  28718. .index() * p.params.slidesPerGroup;
  28719. p.params.loop && (e += p.loopedSlides), p.slideTo(e)
  28720. }, p.updateClickedSlide = function(t) {
  28721. var e = R(t, "." + p.params.slideClass),
  28722. n = !1;
  28723. if (e)
  28724. for (var r = 0; r < p.slides.length; r++) p.slides[r] === e && (n = !0);
  28725. if (!e || !n) return p.clickedSlide = void 0, void(p.clickedIndex = void 0);
  28726. if (p.clickedSlide = e, p.clickedIndex = i(e)
  28727. .index(), p.params.slideToClickedSlide && void 0 !== p.clickedIndex && p.clickedIndex !== p.activeIndex) {
  28728. var o, a = p.clickedIndex,
  28729. s = "auto" === p.params.slidesPerView ? p.currentSlidesPerView() : p.params.slidesPerView;
  28730. if (p.params.loop) {
  28731. if (p.animating) return;
  28732. o = parseInt(i(p.clickedSlide)
  28733. .attr("data-swiper-slide-index"), 10), p.params.centeredSlides ? a < p.loopedSlides - s / 2 || a > p.slides.length - p.loopedSlides + s / 2 ? (p.fixLoop(), a = p.wrapper.children("." + p.params.slideClass + '[data-swiper-slide-index="' + o + '"]:not(.' + p.params.slideDuplicateClass + ")")
  28734. .eq(0)
  28735. .index(), setTimeout((function() {
  28736. p.slideTo(a)
  28737. }), 0)) : p.slideTo(a) : a > p.slides.length - s ? (p.fixLoop(), a = p.wrapper.children("." + p.params.slideClass + '[data-swiper-slide-index="' + o + '"]:not(.' + p.params.slideDuplicateClass + ")")
  28738. .eq(0)
  28739. .index(), setTimeout((function() {
  28740. p.slideTo(a)
  28741. }), 0)) : p.slideTo(a)
  28742. } else p.slideTo(a)
  28743. }
  28744. };
  28745. var m, g, v, y, b, w, x, M, T, S, _, A, P = "input, select, textarea, button, video",
  28746. C = Date.now(),
  28747. E = [];
  28748. for (var D in p.animating = !1, p.touches = {
  28749. startX: 0,
  28750. startY: 0,
  28751. currentX: 0,
  28752. currentY: 0,
  28753. diff: 0
  28754. }, p.onTouchStart = function(t) {
  28755. if (t.originalEvent && (t = t.originalEvent), (_ = "touchstart" === t.type) || !("which" in t) || 3 !== t.which)
  28756. if (p.params.noSwiping && R(t, "." + p.params.noSwipingClass)) p.allowClick = !0;
  28757. else if (!p.params.swipeHandler || R(t, p.params.swipeHandler)) {
  28758. var e = p.touches.currentX = "touchstart" === t.type ? t.targetTouches[0].pageX : t.pageX,
  28759. n = p.touches.currentY = "touchstart" === t.type ? t.targetTouches[0].pageY : t.pageY;
  28760. if (!(p.device.ios && p.params.iOSEdgeSwipeDetection && e <= p.params.iOSEdgeSwipeThreshold)) {
  28761. if (m = !0, g = !1, v = !0, b = void 0, A = void 0, p.touches.startX = e, p.touches.startY = n, y = Date.now(), p.allowClick = !0, p.updateContainerSize(), p.swipeDirection = void 0, p.params.threshold > 0 && (M = !1), "touchstart" !== t.type) {
  28762. var r = !0;
  28763. i(t.target)
  28764. .is(P) && (r = !1), document.activeElement && i(document.activeElement)
  28765. .is(P) && document.activeElement.blur(), r && t.preventDefault()
  28766. }
  28767. p.emit("onTouchStart", p, t)
  28768. }
  28769. }
  28770. }, p.onTouchMove = function(t) {
  28771. if (t.originalEvent && (t = t.originalEvent), !_ || "mousemove" !== t.type) {
  28772. if (t.preventedByNestedSwiper) return p.touches.startX = "touchmove" === t.type ? t.targetTouches[0].pageX : t.pageX, void(p.touches.startY = "touchmove" === t.type ? t.targetTouches[0].pageY : t.pageY);
  28773. if (p.params.onlyExternal) return p.allowClick = !1, void(m && (p.touches.startX = p.touches.currentX = "touchmove" === t.type ? t.targetTouches[0].pageX : t.pageX, p.touches.startY = p.touches.currentY = "touchmove" === t.type ? t.targetTouches[0].pageY : t.pageY, y = Date.now()));
  28774. if (_ && p.params.touchReleaseOnEdges && !p.params.loop)
  28775. if (p.isHorizontal()) {
  28776. if (p.touches.currentX < p.touches.startX && p.translate <= p.maxTranslate() || p.touches.currentX > p.touches.startX && p.translate >= p.minTranslate()) return
  28777. } else if (p.touches.currentY < p.touches.startY && p.translate <= p.maxTranslate() || p.touches.currentY > p.touches.startY && p.translate >= p.minTranslate()) return;
  28778. if (_ && document.activeElement && t.target === document.activeElement && i(t.target)
  28779. .is(P)) return g = !0, void(p.allowClick = !1);
  28780. if (v && p.emit("onTouchMove", p, t), !(t.targetTouches && t.targetTouches.length > 1)) {
  28781. var e;
  28782. if (p.touches.currentX = "touchmove" === t.type ? t.targetTouches[0].pageX : t.pageX, p.touches.currentY = "touchmove" === t.type ? t.targetTouches[0].pageY : t.pageY, void 0 === b) p.isHorizontal() && p.touches.currentY === p.touches.startY || !p.isHorizontal() && p.touches.currentX === p.touches.startX ? b = !1 : (e = 180 * Math.atan2(Math.abs(p.touches.currentY - p.touches.startY), Math.abs(p.touches.currentX - p.touches.startX)) / Math.PI, b = p.isHorizontal() ? e > p.params.touchAngle : 90 - e > p.params.touchAngle);
  28783. if (b && p.emit("onTouchMoveOpposite", p, t), void 0 === A && (p.touches.currentX === p.touches.startX && p.touches.currentY === p.touches.startY || (A = !0)), m)
  28784. if (b) m = !1;
  28785. else if (A) {
  28786. p.allowClick = !1, p.emit("onSliderMove", p, t), t.preventDefault(), p.params.touchMoveStopPropagation && !p.params.nested && t.stopPropagation(), g || (n.loop && p.fixLoop(), x = p.getWrapperTranslate(), p.setWrapperTransition(0), p.animating && p.wrapper.trigger("webkitTransitionEnd transitionend oTransitionEnd MSTransitionEnd msTransitionEnd"), p.params.autoplay && p.autoplaying && (p.params.autoplayDisableOnInteraction ? p.stopAutoplay() : p.pauseAutoplay()), S = !1, !p.params.grabCursor || !0 !== p.params.allowSwipeToNext && !0 !== p.params.allowSwipeToPrev || p.setGrabCursor(!0)), g = !0;
  28787. var r = p.touches.diff = p.isHorizontal() ? p.touches.currentX - p.touches.startX : p.touches.currentY - p.touches.startY;
  28788. r *= p.params.touchRatio, p.rtl && (r = -r), p.swipeDirection = r > 0 ? "prev" : "next", w = r + x;
  28789. var o = !0;
  28790. if (r > 0 && w > p.minTranslate() ? (o = !1, p.params.resistance && (w = p.minTranslate() - 1 + Math.pow(-p.minTranslate() + x + r, p.params.resistanceRatio))) : r < 0 && w < p.maxTranslate() && (o = !1, p.params.resistance && (w = p.maxTranslate() + 1 - Math.pow(p.maxTranslate() - x - r, p.params.resistanceRatio))), o && (t.preventedByNestedSwiper = !0), !p.params.allowSwipeToNext && "next" === p.swipeDirection && w < x && (w = x), !p.params.allowSwipeToPrev && "prev" === p.swipeDirection && w > x && (w = x), p.params.threshold > 0) {
  28791. if (!(Math.abs(r) > p.params.threshold || M)) return void(w = x);
  28792. if (!M) return M = !0, p.touches.startX = p.touches.currentX, p.touches.startY = p.touches.currentY, w = x, void(p.touches.diff = p.isHorizontal() ? p.touches.currentX - p.touches.startX : p.touches.currentY - p.touches.startY)
  28793. }
  28794. p.params.followFinger && ((p.params.freeMode || p.params.watchSlidesProgress) && p.updateActiveIndex(), p.params.freeMode && (0 === E.length && E.push({
  28795. position: p.touches[p.isHorizontal() ? "startX" : "startY"],
  28796. time: y
  28797. }), E.push({
  28798. position: p.touches[p.isHorizontal() ? "currentX" : "currentY"],
  28799. time: (new window.Date)
  28800. .getTime()
  28801. })), p.updateProgress(w), p.setWrapperTranslate(w))
  28802. }
  28803. }
  28804. }
  28805. }, p.onTouchEnd = function(t) {
  28806. if (t.originalEvent && (t = t.originalEvent), v && p.emit("onTouchEnd", p, t), v = !1, m) {
  28807. p.params.grabCursor && g && m && (!0 === p.params.allowSwipeToNext || !0 === p.params.allowSwipeToPrev) && p.setGrabCursor(!1);
  28808. var e, n = Date.now(),
  28809. r = n - y;
  28810. if (p.allowClick && (p.updateClickedSlide(t), p.emit("onTap", p, t), r < 300 && n - C > 300 && (T && clearTimeout(T), T = setTimeout((function() {
  28811. p && (p.params.paginationHide && p.paginationContainer.length > 0 && !i(t.target)
  28812. .hasClass(p.params.bulletClass) && p.paginationContainer.toggleClass(p.params.paginationHiddenClass), p.emit("onClick", p, t))
  28813. }), 300)), r < 300 && n - C < 300 && (T && clearTimeout(T), p.emit("onDoubleTap", p, t))), C = Date.now(), setTimeout((function() {
  28814. p && (p.allowClick = !0)
  28815. }), 0), m && g && p.swipeDirection && 0 !== p.touches.diff && w !== x)
  28816. if (m = g = !1, e = p.params.followFinger ? p.rtl ? p.translate : -p.translate : -w, p.params.freeMode) {
  28817. if (e < -p.minTranslate()) return void p.slideTo(p.activeIndex);
  28818. if (e > -p.maxTranslate()) return void(p.slides.length < p.snapGrid.length ? p.slideTo(p.snapGrid.length - 1) : p.slideTo(p.slides.length - 1));
  28819. if (p.params.freeModeMomentum) {
  28820. if (E.length > 1) {
  28821. var o = E.pop(),
  28822. a = E.pop(),
  28823. s = o.position - a.position,
  28824. l = o.time - a.time;
  28825. p.velocity = s / l, p.velocity = p.velocity / 2, Math.abs(p.velocity) < p.params.freeModeMinimumVelocity && (p.velocity = 0), (l > 150 || (new window.Date)
  28826. .getTime() - o.time > 300) && (p.velocity = 0)
  28827. } else p.velocity = 0;
  28828. p.velocity = p.velocity * p.params.freeModeMomentumVelocityRatio, E.length = 0;
  28829. var u = 1e3 * p.params.freeModeMomentumRatio,
  28830. h = p.velocity * u,
  28831. c = p.translate + h;
  28832. p.rtl && (c = -c);
  28833. var d, f = !1,
  28834. b = 20 * Math.abs(p.velocity) * p.params.freeModeMomentumBounceRatio;
  28835. if (c < p.maxTranslate()) p.params.freeModeMomentumBounce ? (c + p.maxTranslate() < -b && (c = p.maxTranslate() - b), d = p.maxTranslate(), f = !0, S = !0) : c = p.maxTranslate();
  28836. else if (c > p.minTranslate()) p.params.freeModeMomentumBounce ? (c - p.minTranslate() > b && (c = p.minTranslate() + b), d = p.minTranslate(), f = !0, S = !0) : c = p.minTranslate();
  28837. else if (p.params.freeModeSticky) {
  28838. var M, _ = 0;
  28839. for (_ = 0; _ < p.snapGrid.length; _ += 1)
  28840. if (p.snapGrid[_] > -c) {
  28841. M = _;
  28842. break
  28843. } c = Math.abs(p.snapGrid[M] - c) < Math.abs(p.snapGrid[M - 1] - c) || "next" === p.swipeDirection ? p.snapGrid[M] : p.snapGrid[M - 1], p.rtl || (c = -c)
  28844. }
  28845. if (0 !== p.velocity) u = p.rtl ? Math.abs((-c - p.translate) / p.velocity) : Math.abs((c - p.translate) / p.velocity);
  28846. else if (p.params.freeModeSticky) return void p.slideReset();
  28847. p.params.freeModeMomentumBounce && f ? (p.updateProgress(d), p.setWrapperTransition(u), p.setWrapperTranslate(c), p.onTransitionStart(), p.animating = !0, p.wrapper.transitionEnd((function() {
  28848. p && S && (p.emit("onMomentumBounce", p), p.setWrapperTransition(p.params.speed), p.setWrapperTranslate(d), p.wrapper.transitionEnd((function() {
  28849. p && p.onTransitionEnd()
  28850. })))
  28851. }))) : p.velocity ? (p.updateProgress(c), p.setWrapperTransition(u), p.setWrapperTranslate(c), p.onTransitionStart(), p.animating || (p.animating = !0, p.wrapper.transitionEnd((function() {
  28852. p && p.onTransitionEnd()
  28853. })))) : p.updateProgress(c), p.updateActiveIndex()
  28854. }(!p.params.freeModeMomentum || r >= p.params.longSwipesMs) && (p.updateProgress(), p.updateActiveIndex())
  28855. } else {
  28856. var A, P = 0,
  28857. D = p.slidesSizesGrid[0];
  28858. for (A = 0; A < p.slidesGrid.length; A += p.params.slidesPerGroup) void 0 !== p.slidesGrid[A + p.params.slidesPerGroup] ? e >= p.slidesGrid[A] && e < p.slidesGrid[A + p.params.slidesPerGroup] && (P = A, D = p.slidesGrid[A + p.params.slidesPerGroup] - p.slidesGrid[A]) : e >= p.slidesGrid[A] && (P = A, D = p.slidesGrid[p.slidesGrid.length - 1] - p.slidesGrid[p.slidesGrid.length - 2]);
  28859. var L = (e - p.slidesGrid[P]) / D;
  28860. if (r > p.params.longSwipesMs) {
  28861. if (!p.params.longSwipes) return void p.slideTo(p.activeIndex);
  28862. "next" === p.swipeDirection && (L >= p.params.longSwipesRatio ? p.slideTo(P + p.params.slidesPerGroup) : p.slideTo(P)), "prev" === p.swipeDirection && (L > 1 - p.params.longSwipesRatio ? p.slideTo(P + p.params.slidesPerGroup) : p.slideTo(P))
  28863. } else {
  28864. if (!p.params.shortSwipes) return void p.slideTo(p.activeIndex);
  28865. "next" === p.swipeDirection && p.slideTo(P + p.params.slidesPerGroup), "prev" === p.swipeDirection && p.slideTo(P)
  28866. }
  28867. }
  28868. else m = g = !1
  28869. }
  28870. }, p._slideTo = function(t, e) {
  28871. return p.slideTo(t, e, !0, !0)
  28872. }, p.slideTo = function(t, e, i, n) {
  28873. void 0 === i && (i = !0), void 0 === t && (t = 0), t < 0 && (t = 0), p.snapIndex = Math.floor(t / p.params.slidesPerGroup), p.snapIndex >= p.snapGrid.length && (p.snapIndex = p.snapGrid.length - 1);
  28874. var r = -p.snapGrid[p.snapIndex];
  28875. if (p.params.autoplay && p.autoplaying && (n || !p.params.autoplayDisableOnInteraction ? p.pauseAutoplay(e) : p.stopAutoplay()), p.updateProgress(r), p.params.normalizeSlideIndex)
  28876. for (var o = 0; o < p.slidesGrid.length; o++) - Math.floor(100 * r) >= Math.floor(100 * p.slidesGrid[o]) && (t = o);
  28877. return !(!p.params.allowSwipeToNext && r < p.translate && r < p.minTranslate()) && (!(!p.params.allowSwipeToPrev && r > p.translate && r > p.maxTranslate() && (p.activeIndex || 0) !== t) && (void 0 === e && (e = p.params.speed), p.previousIndex = p.activeIndex || 0, p.activeIndex = t, p.updateRealIndex(), p.rtl && -r === p.translate || !p.rtl && r === p.translate ? (p.params.autoHeight && p.updateAutoHeight(), p.updateClasses(), "slide" !== p.params.effect && p.setWrapperTranslate(r), !1) : (p.updateClasses(), p.onTransitionStart(i), 0 === e || p.browser.lteIE9 ? (p.setWrapperTranslate(r), p.setWrapperTransition(0), p.onTransitionEnd(i)) : (p.setWrapperTranslate(r), p.setWrapperTransition(e), p.animating || (p.animating = !0, p.wrapper.transitionEnd((function() {
  28878. p && p.onTransitionEnd(i)
  28879. })))), !0)))
  28880. }, p.onTransitionStart = function(t) {
  28881. void 0 === t && (t = !0), p.params.autoHeight && p.updateAutoHeight(), p.lazy && p.lazy.onTransitionStart(), t && (p.emit("onTransitionStart", p), p.activeIndex !== p.previousIndex && (p.emit("onSlideChangeStart", p), p.activeIndex > p.previousIndex ? p.emit("onSlideNextStart", p) : p.emit("onSlidePrevStart", p)))
  28882. }, p.onTransitionEnd = function(t) {
  28883. p.animating = !1, p.setWrapperTransition(0), void 0 === t && (t = !0), p.lazy && p.lazy.onTransitionEnd(), t && (p.emit("onTransitionEnd", p), p.activeIndex !== p.previousIndex && (p.emit("onSlideChangeEnd", p), p.activeIndex > p.previousIndex ? p.emit("onSlideNextEnd", p) : p.emit("onSlidePrevEnd", p))), p.params.history && p.history && p.history.setHistory(p.params.history, p.activeIndex), p.params.hashnav && p.hashnav && p.hashnav.setHash()
  28884. }, p.slideNext = function(t, e, i) {
  28885. if (p.params.loop) {
  28886. if (p.animating) return !1;
  28887. p.fixLoop();
  28888. p.container[0].clientLeft;
  28889. return p.slideTo(p.activeIndex + p.params.slidesPerGroup, e, t, i)
  28890. }
  28891. return p.slideTo(p.activeIndex + p.params.slidesPerGroup, e, t, i)
  28892. }, p._slideNext = function(t) {
  28893. return p.slideNext(!0, t, !0)
  28894. }, p.slidePrev = function(t, e, i) {
  28895. if (p.params.loop) {
  28896. if (p.animating) return !1;
  28897. p.fixLoop();
  28898. p.container[0].clientLeft;
  28899. return p.slideTo(p.activeIndex - 1, e, t, i)
  28900. }
  28901. return p.slideTo(p.activeIndex - 1, e, t, i)
  28902. }, p._slidePrev = function(t) {
  28903. return p.slidePrev(!0, t, !0)
  28904. }, p.slideReset = function(t, e, i) {
  28905. return p.slideTo(p.activeIndex, e, t)
  28906. }, p.disableTouchControl = function() {
  28907. return p.params.onlyExternal = !0, !0
  28908. }, p.enableTouchControl = function() {
  28909. return p.params.onlyExternal = !1, !0
  28910. }, p.setWrapperTransition = function(t, e) {
  28911. p.wrapper.transition(t), "slide" !== p.params.effect && p.effects[p.params.effect] && p.effects[p.params.effect].setTransition(t), p.params.parallax && p.parallax && p.parallax.setTransition(t), p.params.scrollbar && p.scrollbar && p.scrollbar.setTransition(t), p.params.control && p.controller && p.controller.setTransition(t, e), p.emit("onSetTransition", p, t)
  28912. }, p.setWrapperTranslate = function(t, e, i) {
  28913. var n = 0,
  28914. r = 0;
  28915. p.isHorizontal() ? n = p.rtl ? -t : t : r = t, p.params.roundLengths && (n = O(n), r = O(r)), p.params.virtualTranslate || (p.support.transforms3d ? p.wrapper.transform("translate3d(" + n + "px, " + r + "px, 0px)") : p.wrapper.transform("translate(" + n + "px, " + r + "px)")), p.translate = p.isHorizontal() ? n : r;
  28916. var o = p.maxTranslate() - p.minTranslate();
  28917. (0 === o ? 0 : (t - p.minTranslate()) / o) !== p.progress && p.updateProgress(t), e && p.updateActiveIndex(), "slide" !== p.params.effect && p.effects[p.params.effect] && p.effects[p.params.effect].setTranslate(p.translate), p.params.parallax && p.parallax && p.parallax.setTranslate(p.translate), p.params.scrollbar && p.scrollbar && p.scrollbar.setTranslate(p.translate), p.params.control && p.controller && p.controller.setTranslate(p.translate, i), p.emit("onSetTranslate", p, p.translate)
  28918. }, p.getTranslate = function(t, e) {
  28919. var i, n, r, o;
  28920. return void 0 === e && (e = "x"), p.params.virtualTranslate ? p.rtl ? -p.translate : p.translate : (r = window.getComputedStyle(t, null), window.WebKitCSSMatrix ? ((n = r.transform || r.webkitTransform)
  28921. .split(",")
  28922. .length > 6 && (n = n.split(", ")
  28923. .map((function(t) {
  28924. return t.replace(",", ".")
  28925. }))
  28926. .join(", ")), o = new window.WebKitCSSMatrix("none" === n ? "" : n)) : i = (o = r.MozTransform || r.OTransform || r.MsTransform || r.msTransform || r.transform || r.getPropertyValue("transform")
  28927. .replace("translate(", "matrix(1, 0, 0, 1,"))
  28928. .toString()
  28929. .split(","), "x" === e && (n = window.WebKitCSSMatrix ? o.m41 : 16 === i.length ? parseFloat(i[12]) : parseFloat(i[4])), "y" === e && (n = window.WebKitCSSMatrix ? o.m42 : 16 === i.length ? parseFloat(i[13]) : parseFloat(i[5])), p.rtl && n && (n = -n), n || 0)
  28930. }, p.getWrapperTranslate = function(t) {
  28931. return void 0 === t && (t = p.isHorizontal() ? "x" : "y"), p.getTranslate(p.wrapper[0], t)
  28932. }, p.observers = [], p.initObservers = function() {
  28933. if (p.params.observeParents)
  28934. for (var t = p.container.parents(), e = 0; e < t.length; e++) N(t[e]);
  28935. N(p.container[0], {
  28936. childList: !1
  28937. }), N(p.wrapper[0], {
  28938. attributes: !1
  28939. })
  28940. }, p.disconnectObservers = function() {
  28941. for (var t = 0; t < p.observers.length; t++) p.observers[t].disconnect();
  28942. p.observers = []
  28943. }, p.createLoop = function() {
  28944. p.wrapper.children("." + p.params.slideClass + "." + p.params.slideDuplicateClass)
  28945. .remove();
  28946. var t = p.wrapper.children("." + p.params.slideClass);
  28947. "auto" !== p.params.slidesPerView || p.params.loopedSlides || (p.params.loopedSlides = t.length), p.loopedSlides = parseInt(p.params.loopedSlides || p.params.slidesPerView, 10), p.loopedSlides = p.loopedSlides + p.params.loopAdditionalSlides, p.loopedSlides > t.length && (p.loopedSlides = t.length);
  28948. var e, n = [],
  28949. r = [];
  28950. for (t.each((function(e, o) {
  28951. var a = i(this);
  28952. e < p.loopedSlides && r.push(o), e < t.length && e >= t.length - p.loopedSlides && n.push(o), a.attr("data-swiper-slide-index", e)
  28953. })), e = 0; e < r.length; e++) p.wrapper.append(i(r[e].cloneNode(!0))
  28954. .addClass(p.params.slideDuplicateClass));
  28955. for (e = n.length - 1; e >= 0; e--) p.wrapper.prepend(i(n[e].cloneNode(!0))
  28956. .addClass(p.params.slideDuplicateClass))
  28957. }, p.destroyLoop = function() {
  28958. p.wrapper.children("." + p.params.slideClass + "." + p.params.slideDuplicateClass)
  28959. .remove(), p.slides.removeAttr("data-swiper-slide-index")
  28960. }, p.reLoop = function(t) {
  28961. var e = p.activeIndex - p.loopedSlides;
  28962. p.destroyLoop(), p.createLoop(), p.updateSlidesSize(), t && p.slideTo(e + p.loopedSlides, 0, !1)
  28963. }, p.fixLoop = function() {
  28964. var t;
  28965. p.activeIndex < p.loopedSlides ? (t = p.slides.length - 3 * p.loopedSlides + p.activeIndex, t += p.loopedSlides, p.slideTo(t, 0, !1, !0)) : ("auto" === p.params.slidesPerView && p.activeIndex >= 2 * p.loopedSlides || p.activeIndex > p.slides.length - 2 * p.params.slidesPerView) && (t = -p.slides.length + p.activeIndex + p.loopedSlides, t += p.loopedSlides, p.slideTo(t, 0, !1, !0))
  28966. }, p.appendSlide = function(t) {
  28967. if (p.params.loop && p.destroyLoop(), "object" == typeof t && t.length)
  28968. for (var e = 0; e < t.length; e++) t[e] && p.wrapper.append(t[e]);
  28969. else p.wrapper.append(t);
  28970. p.params.loop && p.createLoop(), p.params.observer && p.support.observer || p.update(!0)
  28971. }, p.prependSlide = function(t) {
  28972. p.params.loop && p.destroyLoop();
  28973. var e = p.activeIndex + 1;
  28974. if ("object" == typeof t && t.length) {
  28975. for (var i = 0; i < t.length; i++) t[i] && p.wrapper.prepend(t[i]);
  28976. e = p.activeIndex + t.length
  28977. } else p.wrapper.prepend(t);
  28978. p.params.loop && p.createLoop(), p.params.observer && p.support.observer || p.update(!0), p.slideTo(e, 0, !1)
  28979. }, p.removeSlide = function(t) {
  28980. p.params.loop && (p.destroyLoop(), p.slides = p.wrapper.children("." + p.params.slideClass));
  28981. var e, i = p.activeIndex;
  28982. if ("object" == typeof t && t.length) {
  28983. for (var n = 0; n < t.length; n++) e = t[n], p.slides[e] && p.slides.eq(e)
  28984. .remove(), e < i && i--;
  28985. i = Math.max(i, 0)
  28986. } else e = t, p.slides[e] && p.slides.eq(e)
  28987. .remove(), e < i && i--, i = Math.max(i, 0);
  28988. p.params.loop && p.createLoop(), p.params.observer && p.support.observer || p.update(!0), p.params.loop ? p.slideTo(i + p.loopedSlides, 0, !1) : p.slideTo(i, 0, !1)
  28989. }, p.removeAllSlides = function() {
  28990. for (var t = [], e = 0; e < p.slides.length; e++) t.push(e);
  28991. p.removeSlide(t)
  28992. }, p.effects = {
  28993. fade: {
  28994. setTranslate: function() {
  28995. for (var t = 0; t < p.slides.length; t++) {
  28996. var e = p.slides.eq(t),
  28997. i = -e[0].swiperSlideOffset;
  28998. p.params.virtualTranslate || (i -= p.translate);
  28999. var n = 0;
  29000. p.isHorizontal() || (n = i, i = 0);
  29001. var r = p.params.fade.crossFade ? Math.max(1 - Math.abs(e[0].progress), 0) : 1 + Math.min(Math.max(e[0].progress, -1), 0);
  29002. e.css({
  29003. opacity: r
  29004. })
  29005. .transform("translate3d(" + i + "px, " + n + "px, 0px)")
  29006. }
  29007. },
  29008. setTransition: function(t) {
  29009. if (p.slides.transition(t), p.params.virtualTranslate && 0 !== t) {
  29010. var e = !1;
  29011. p.slides.transitionEnd((function() {
  29012. if (!e && p) {
  29013. e = !0, p.animating = !1;
  29014. for (var t = ["webkitTransitionEnd", "transitionend", "oTransitionEnd", "MSTransitionEnd", "msTransitionEnd"], i = 0; i < t.length; i++) p.wrapper.trigger(t[i])
  29015. }
  29016. }))
  29017. }
  29018. }
  29019. },
  29020. flip: {
  29021. setTranslate: function() {
  29022. for (var t = 0; t < p.slides.length; t++) {
  29023. var e = p.slides.eq(t),
  29024. n = e[0].progress;
  29025. p.params.flip.limitRotation && (n = Math.max(Math.min(e[0].progress, 1), -1));
  29026. var r = -180 * n,
  29027. o = 0,
  29028. a = -e[0].swiperSlideOffset,
  29029. s = 0;
  29030. if (p.isHorizontal() ? p.rtl && (r = -r) : (s = a, a = 0, o = -r, r = 0), e[0].style.zIndex = -Math.abs(Math.round(n)) + p.slides.length, p.params.flip.slideShadows) {
  29031. var l = p.isHorizontal() ? e.find(".swiper-slide-shadow-left") : e.find(".swiper-slide-shadow-top"),
  29032. u = p.isHorizontal() ? e.find(".swiper-slide-shadow-right") : e.find(".swiper-slide-shadow-bottom");
  29033. 0 === l.length && (l = i('<div class="swiper-slide-shadow-' + (p.isHorizontal() ? "left" : "top") + '"></div>'), e.append(l)), 0 === u.length && (u = i('<div class="swiper-slide-shadow-' + (p.isHorizontal() ? "right" : "bottom") + '"></div>'), e.append(u)), l.length && (l[0].style.opacity = Math.max(-n, 0)), u.length && (u[0].style.opacity = Math.max(n, 0))
  29034. }
  29035. e.transform("translate3d(" + a + "px, " + s + "px, 0px) rotateX(" + o + "deg) rotateY(" + r + "deg)")
  29036. }
  29037. },
  29038. setTransition: function(t) {
  29039. if (p.slides.transition(t)
  29040. .find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left")
  29041. .transition(t), p.params.virtualTranslate && 0 !== t) {
  29042. var e = !1;
  29043. p.slides.eq(p.activeIndex)
  29044. .transitionEnd((function() {
  29045. if (!e && p && i(this)
  29046. .hasClass(p.params.slideActiveClass)) {
  29047. e = !0, p.animating = !1;
  29048. for (var t = ["webkitTransitionEnd", "transitionend", "oTransitionEnd", "MSTransitionEnd", "msTransitionEnd"], n = 0; n < t.length; n++) p.wrapper.trigger(t[n])
  29049. }
  29050. }))
  29051. }
  29052. }
  29053. },
  29054. cube: {
  29055. setTranslate: function() {
  29056. var t, e = 0;
  29057. p.params.cube.shadow && (p.isHorizontal() ? (0 === (t = p.wrapper.find(".swiper-cube-shadow"))
  29058. .length && (t = i('<div class="swiper-cube-shadow"></div>'), p.wrapper.append(t)), t.css({
  29059. height: p.width + "px"
  29060. })) : 0 === (t = p.container.find(".swiper-cube-shadow"))
  29061. .length && (t = i('<div class="swiper-cube-shadow"></div>'), p.container.append(t)));
  29062. for (var n = 0; n < p.slides.length; n++) {
  29063. var r = p.slides.eq(n),
  29064. o = 90 * n,
  29065. a = Math.floor(o / 360);
  29066. p.rtl && (o = -o, a = Math.floor(-o / 360));
  29067. var s = Math.max(Math.min(r[0].progress, 1), -1),
  29068. l = 0,
  29069. u = 0,
  29070. h = 0;
  29071. n % 4 == 0 ? (l = 4 * -a * p.size, h = 0) : (n - 1) % 4 == 0 ? (l = 0, h = 4 * -a * p.size) : (n - 2) % 4 == 0 ? (l = p.size + 4 * a * p.size, h = p.size) : (n - 3) % 4 == 0 && (l = -p.size, h = 3 * p.size + 4 * p.size * a), p.rtl && (l = -l), p.isHorizontal() || (u = l, l = 0);
  29072. var c = "rotateX(" + (p.isHorizontal() ? 0 : -o) + "deg) rotateY(" + (p.isHorizontal() ? o : 0) + "deg) translate3d(" + l + "px, " + u + "px, " + h + "px)";
  29073. if (s <= 1 && s > -1 && (e = 90 * n + 90 * s, p.rtl && (e = 90 * -n - 90 * s)), r.transform(c), p.params.cube.slideShadows) {
  29074. var d = p.isHorizontal() ? r.find(".swiper-slide-shadow-left") : r.find(".swiper-slide-shadow-top"),
  29075. f = p.isHorizontal() ? r.find(".swiper-slide-shadow-right") : r.find(".swiper-slide-shadow-bottom");
  29076. 0 === d.length && (d = i('<div class="swiper-slide-shadow-' + (p.isHorizontal() ? "left" : "top") + '"></div>'), r.append(d)), 0 === f.length && (f = i('<div class="swiper-slide-shadow-' + (p.isHorizontal() ? "right" : "bottom") + '"></div>'), r.append(f)), d.length && (d[0].style.opacity = Math.max(-s, 0)), f.length && (f[0].style.opacity = Math.max(s, 0))
  29077. }
  29078. }
  29079. if (p.wrapper.css({
  29080. "-webkit-transform-origin": "50% 50% -" + p.size / 2 + "px",
  29081. "-moz-transform-origin": "50% 50% -" + p.size / 2 + "px",
  29082. "-ms-transform-origin": "50% 50% -" + p.size / 2 + "px",
  29083. "transform-origin": "50% 50% -" + p.size / 2 + "px"
  29084. }), p.params.cube.shadow)
  29085. if (p.isHorizontal()) t.transform("translate3d(0px, " + (p.width / 2 + p.params.cube.shadowOffset) + "px, " + -p.width / 2 + "px) rotateX(90deg) rotateZ(0deg) scale(" + p.params.cube.shadowScale + ")");
  29086. else {
  29087. var m = Math.abs(e) - 90 * Math.floor(Math.abs(e) / 90),
  29088. g = 1.5 - (Math.sin(2 * m * Math.PI / 360) / 2 + Math.cos(2 * m * Math.PI / 360) / 2),
  29089. v = p.params.cube.shadowScale,
  29090. y = p.params.cube.shadowScale / g,
  29091. b = p.params.cube.shadowOffset;
  29092. t.transform("scale3d(" + v + ", 1, " + y + ") translate3d(0px, " + (p.height / 2 + b) + "px, " + -p.height / 2 / y + "px) rotateX(-90deg)")
  29093. } var w = p.isSafari || p.isUiWebView ? -p.size / 2 : 0;
  29094. p.wrapper.transform("translate3d(0px,0," + w + "px) rotateX(" + (p.isHorizontal() ? 0 : e) + "deg) rotateY(" + (p.isHorizontal() ? -e : 0) + "deg)")
  29095. },
  29096. setTransition: function(t) {
  29097. p.slides.transition(t)
  29098. .find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left")
  29099. .transition(t), p.params.cube.shadow && !p.isHorizontal() && p.container.find(".swiper-cube-shadow")
  29100. .transition(t)
  29101. }
  29102. },
  29103. coverflow: {
  29104. setTranslate: function() {
  29105. for (var t = p.translate, e = p.isHorizontal() ? -t + p.width / 2 : -t + p.height / 2, n = p.isHorizontal() ? p.params.coverflow.rotate : -p.params.coverflow.rotate, r = p.params.coverflow.depth, o = 0, a = p.slides.length; o < a; o++) {
  29106. var s = p.slides.eq(o),
  29107. l = p.slidesSizesGrid[o],
  29108. u = (e - s[0].swiperSlideOffset - l / 2) / l * p.params.coverflow.modifier,
  29109. h = p.isHorizontal() ? n * u : 0,
  29110. c = p.isHorizontal() ? 0 : n * u,
  29111. d = -r * Math.abs(u),
  29112. f = p.isHorizontal() ? 0 : p.params.coverflow.stretch * u,
  29113. m = p.isHorizontal() ? p.params.coverflow.stretch * u : 0;
  29114. Math.abs(m) < .001 && (m = 0), Math.abs(f) < .001 && (f = 0), Math.abs(d) < .001 && (d = 0), Math.abs(h) < .001 && (h = 0), Math.abs(c) < .001 && (c = 0);
  29115. var g = "translate3d(" + m + "px," + f + "px," + d + "px) rotateX(" + c + "deg) rotateY(" + h + "deg)";
  29116. if (s.transform(g), s[0].style.zIndex = 1 - Math.abs(Math.round(u)), p.params.coverflow.slideShadows) {
  29117. var v = p.isHorizontal() ? s.find(".swiper-slide-shadow-left") : s.find(".swiper-slide-shadow-top"),
  29118. y = p.isHorizontal() ? s.find(".swiper-slide-shadow-right") : s.find(".swiper-slide-shadow-bottom");
  29119. 0 === v.length && (v = i('<div class="swiper-slide-shadow-' + (p.isHorizontal() ? "left" : "top") + '"></div>'), s.append(v)), 0 === y.length && (y = i('<div class="swiper-slide-shadow-' + (p.isHorizontal() ? "right" : "bottom") + '"></div>'), s.append(y)), v.length && (v[0].style.opacity = u > 0 ? u : 0), y.length && (y[0].style.opacity = -u > 0 ? -u : 0)
  29120. }
  29121. }
  29122. p.browser.ie && (p.wrapper[0].style.perspectiveOrigin = e + "px 50%")
  29123. },
  29124. setTransition: function(t) {
  29125. p.slides.transition(t)
  29126. .find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left")
  29127. .transition(t)
  29128. }
  29129. }
  29130. }, p.lazy = {
  29131. initialImageLoaded: !1,
  29132. loadImageInSlide: function(t, e) {
  29133. if (void 0 !== t && (void 0 === e && (e = !0), 0 !== p.slides.length)) {
  29134. var n = p.slides.eq(t),
  29135. r = n.find("." + p.params.lazyLoadingClass + ":not(." + p.params.lazyStatusLoadedClass + "):not(." + p.params.lazyStatusLoadingClass + ")");
  29136. !n.hasClass(p.params.lazyLoadingClass) || n.hasClass(p.params.lazyStatusLoadedClass) || n.hasClass(p.params.lazyStatusLoadingClass) || (r = r.add(n[0])), 0 !== r.length && r.each((function() {
  29137. var t = i(this);
  29138. t.addClass(p.params.lazyStatusLoadingClass);
  29139. var r = t.attr("data-background"),
  29140. o = t.attr("data-src"),
  29141. a = t.attr("data-srcset"),
  29142. s = t.attr("data-sizes");
  29143. p.loadImage(t[0], o || r, a, s, !1, (function() {
  29144. if (null != p && p) {
  29145. if (r ? (t.css("background-image", 'url("' + r + '")'), t.removeAttr("data-background")) : (a && (t.attr("srcset", a), t.removeAttr("data-srcset")), s && (t.attr("sizes", s), t.removeAttr("data-sizes")), o && (t.attr("src", o), t.removeAttr("data-src"))), t.addClass(p.params.lazyStatusLoadedClass)
  29146. .removeClass(p.params.lazyStatusLoadingClass), n.find("." + p.params.lazyPreloaderClass + ", ." + p.params.preloaderClass)
  29147. .remove(), p.params.loop && e) {
  29148. var i = n.attr("data-swiper-slide-index");
  29149. if (n.hasClass(p.params.slideDuplicateClass)) {
  29150. var l = p.wrapper.children('[data-swiper-slide-index="' + i + '"]:not(.' + p.params.slideDuplicateClass + ")");
  29151. p.lazy.loadImageInSlide(l.index(), !1)
  29152. } else {
  29153. var u = p.wrapper.children("." + p.params.slideDuplicateClass + '[data-swiper-slide-index="' + i + '"]');
  29154. p.lazy.loadImageInSlide(u.index(), !1)
  29155. }
  29156. }
  29157. p.emit("onLazyImageReady", p, n[0], t[0])
  29158. }
  29159. })), p.emit("onLazyImageLoad", p, n[0], t[0])
  29160. }))
  29161. }
  29162. },
  29163. load: function() {
  29164. var t, e = p.params.slidesPerView;
  29165. if ("auto" === e && (e = 0), p.lazy.initialImageLoaded || (p.lazy.initialImageLoaded = !0), p.params.watchSlidesVisibility) p.wrapper.children("." + p.params.slideVisibleClass)
  29166. .each((function() {
  29167. p.lazy.loadImageInSlide(i(this)
  29168. .index())
  29169. }));
  29170. else if (e > 1)
  29171. for (t = p.activeIndex; t < p.activeIndex + e; t++) p.slides[t] && p.lazy.loadImageInSlide(t);
  29172. else p.lazy.loadImageInSlide(p.activeIndex);
  29173. if (p.params.lazyLoadingInPrevNext)
  29174. if (e > 1 || p.params.lazyLoadingInPrevNextAmount && p.params.lazyLoadingInPrevNextAmount > 1) {
  29175. var n = p.params.lazyLoadingInPrevNextAmount,
  29176. r = e,
  29177. o = Math.min(p.activeIndex + r + Math.max(n, r), p.slides.length),
  29178. a = Math.max(p.activeIndex - Math.max(r, n), 0);
  29179. for (t = p.activeIndex + e; t < o; t++) p.slides[t] && p.lazy.loadImageInSlide(t);
  29180. for (t = a; t < p.activeIndex; t++) p.slides[t] && p.lazy.loadImageInSlide(t)
  29181. } else {
  29182. var s = p.wrapper.children("." + p.params.slideNextClass);
  29183. s.length > 0 && p.lazy.loadImageInSlide(s.index());
  29184. var l = p.wrapper.children("." + p.params.slidePrevClass);
  29185. l.length > 0 && p.lazy.loadImageInSlide(l.index())
  29186. }
  29187. },
  29188. onTransitionStart: function() {
  29189. p.params.lazyLoading && (p.params.lazyLoadingOnTransitionStart || !p.params.lazyLoadingOnTransitionStart && !p.lazy.initialImageLoaded) && p.lazy.load()
  29190. },
  29191. onTransitionEnd: function() {
  29192. p.params.lazyLoading && !p.params.lazyLoadingOnTransitionStart && p.lazy.load()
  29193. }
  29194. }, p.scrollbar = {
  29195. isTouched: !1,
  29196. setDragPosition: function(t) {
  29197. var e = p.scrollbar,
  29198. i = (p.isHorizontal() ? "touchstart" === t.type || "touchmove" === t.type ? t.targetTouches[0].pageX : t.pageX || t.clientX : "touchstart" === t.type || "touchmove" === t.type ? t.targetTouches[0].pageY : t.pageY || t.clientY) - e.track.offset()[p.isHorizontal() ? "left" : "top"] - e.dragSize / 2,
  29199. n = -p.minTranslate() * e.moveDivider,
  29200. r = -p.maxTranslate() * e.moveDivider;
  29201. i < n ? i = n : i > r && (i = r), i = -i / e.moveDivider, p.updateProgress(i), p.setWrapperTranslate(i, !0)
  29202. },
  29203. dragStart: function(t) {
  29204. var e = p.scrollbar;
  29205. e.isTouched = !0, t.preventDefault(), t.stopPropagation(), e.setDragPosition(t), clearTimeout(e.dragTimeout), e.track.transition(0), p.params.scrollbarHide && e.track.css("opacity", 1), p.wrapper.transition(100), e.drag.transition(100), p.emit("onScrollbarDragStart", p)
  29206. },
  29207. dragMove: function(t) {
  29208. var e = p.scrollbar;
  29209. e.isTouched && (t.preventDefault ? t.preventDefault() : t.returnValue = !1, e.setDragPosition(t), p.wrapper.transition(0), e.track.transition(0), e.drag.transition(0), p.emit("onScrollbarDragMove", p))
  29210. },
  29211. dragEnd: function(t) {
  29212. var e = p.scrollbar;
  29213. e.isTouched && (e.isTouched = !1, p.params.scrollbarHide && (clearTimeout(e.dragTimeout), e.dragTimeout = setTimeout((function() {
  29214. e.track.css("opacity", 0), e.track.transition(400)
  29215. }), 1e3)), p.emit("onScrollbarDragEnd", p), p.params.scrollbarSnapOnRelease && p.slideReset())
  29216. },
  29217. draggableEvents: !1 !== p.params.simulateTouch || p.support.touch ? p.touchEvents : p.touchEventsDesktop,
  29218. enableDraggable: function() {
  29219. var t = p.scrollbar,
  29220. e = p.support.touch ? t.track : document;
  29221. i(t.track)
  29222. .on(t.draggableEvents.start, t.dragStart), i(e)
  29223. .on(t.draggableEvents.move, t.dragMove), i(e)
  29224. .on(t.draggableEvents.end, t.dragEnd)
  29225. },
  29226. disableDraggable: function() {
  29227. var t = p.scrollbar,
  29228. e = p.support.touch ? t.track : document;
  29229. i(t.track)
  29230. .off(t.draggableEvents.start, t.dragStart), i(e)
  29231. .off(t.draggableEvents.move, t.dragMove), i(e)
  29232. .off(t.draggableEvents.end, t.dragEnd)
  29233. },
  29234. set: function() {
  29235. if (p.params.scrollbar) {
  29236. var t = p.scrollbar;
  29237. t.track = i(p.params.scrollbar), p.params.uniqueNavElements && "string" == typeof p.params.scrollbar && t.track.length > 1 && 1 === p.container.find(p.params.scrollbar)
  29238. .length && (t.track = p.container.find(p.params.scrollbar)), t.drag = t.track.find(".swiper-scrollbar-drag"), 0 === t.drag.length && (t.drag = i('<div class="swiper-scrollbar-drag"></div>'), t.track.append(t.drag)), t.drag[0].style.width = "", t.drag[0].style.height = "", t.trackSize = p.isHorizontal() ? t.track[0].offsetWidth : t.track[0].offsetHeight, t.divider = p.size / p.virtualSize, t.moveDivider = t.divider * (t.trackSize / p.size), t.dragSize = t.trackSize * t.divider, p.isHorizontal() ? t.drag[0].style.width = t.dragSize + "px" : t.drag[0].style.height = t.dragSize + "px", t.divider >= 1 ? t.track[0].style.display = "none" : t.track[0].style.display = "", p.params.scrollbarHide && (t.track[0].style.opacity = 0)
  29239. }
  29240. },
  29241. setTranslate: function() {
  29242. if (p.params.scrollbar) {
  29243. var t, e = p.scrollbar,
  29244. i = (p.translate, e.dragSize);
  29245. t = (e.trackSize - e.dragSize) * p.progress, p.rtl && p.isHorizontal() ? (t = -t) > 0 ? (i = e.dragSize - t, t = 0) : -t + e.dragSize > e.trackSize && (i = e.trackSize + t) : t < 0 ? (i = e.dragSize + t, t = 0) : t + e.dragSize > e.trackSize && (i = e.trackSize - t), p.isHorizontal() ? (p.support.transforms3d ? e.drag.transform("translate3d(" + t + "px, 0, 0)") : e.drag.transform("translateX(" + t + "px)"), e.drag[0].style.width = i + "px") : (p.support.transforms3d ? e.drag.transform("translate3d(0px, " + t + "px, 0)") : e.drag.transform("translateY(" + t + "px)"), e.drag[0].style.height = i + "px"), p.params.scrollbarHide && (clearTimeout(e.timeout), e.track[0].style.opacity = 1, e.timeout = setTimeout((function() {
  29246. e.track[0].style.opacity = 0, e.track.transition(400)
  29247. }), 1e3))
  29248. }
  29249. },
  29250. setTransition: function(t) {
  29251. p.params.scrollbar && p.scrollbar.drag.transition(t)
  29252. }
  29253. }, p.controller = {
  29254. LinearSpline: function(t, e) {
  29255. var i, n, r, o, a, s = function(t, e) {
  29256. for (n = -1, i = t.length; i - n > 1;) t[r = i + n >> 1] <= e ? n = r : i = r;
  29257. return i
  29258. };
  29259. this.x = t, this.y = e, this.lastIndex = t.length - 1;
  29260. this.x.length;
  29261. this.interpolate = function(t) {
  29262. return t ? (a = s(this.x, t), o = a - 1, (t - this.x[o]) * (this.y[a] - this.y[o]) / (this.x[a] - this.x[o]) + this.y[o]) : 0
  29263. }
  29264. },
  29265. getInterpolateFunction: function(t) {
  29266. p.controller.spline || (p.controller.spline = p.params.loop ? new p.controller.LinearSpline(p.slidesGrid, t.slidesGrid) : new p.controller.LinearSpline(p.snapGrid, t.snapGrid))
  29267. },
  29268. setTranslate: function(t, e) {
  29269. var i, n, r = p.params.control;
  29270. function a(e) {
  29271. t = e.rtl && "horizontal" === e.params.direction ? -p.translate : p.translate, "slide" === p.params.controlBy && (p.controller.getInterpolateFunction(e), n = -p.controller.spline.interpolate(-t)), n && "container" !== p.params.controlBy || (i = (e.maxTranslate() - e.minTranslate()) / (p.maxTranslate() - p.minTranslate()), n = (t - p.minTranslate()) * i + e.minTranslate()), p.params.controlInverse && (n = e.maxTranslate() - n), e.updateProgress(n), e.setWrapperTranslate(n, !1, p), e.updateActiveIndex()
  29272. }
  29273. if (Array.isArray(r))
  29274. for (var s = 0; s < r.length; s++) r[s] !== e && r[s] instanceof o && a(r[s]);
  29275. else r instanceof o && e !== r && a(r)
  29276. },
  29277. setTransition: function(t, e) {
  29278. var i, n = p.params.control;
  29279. function r(e) {
  29280. e.setWrapperTransition(t, p), 0 !== t && (e.onTransitionStart(), e.wrapper.transitionEnd((function() {
  29281. n && (e.params.loop && "slide" === p.params.controlBy && e.fixLoop(), e.onTransitionEnd())
  29282. })))
  29283. }
  29284. if (Array.isArray(n))
  29285. for (i = 0; i < n.length; i++) n[i] !== e && n[i] instanceof o && r(n[i]);
  29286. else n instanceof o && e !== n && r(n)
  29287. }
  29288. }, p.hashnav = {
  29289. onHashCange: function(t, e) {
  29290. var i = document.location.hash.replace("#", "");
  29291. i !== p.slides.eq(p.activeIndex)
  29292. .attr("data-hash") && p.slideTo(p.wrapper.children("." + p.params.slideClass + '[data-hash="' + i + '"]')
  29293. .index())
  29294. },
  29295. attachEvents: function(t) {
  29296. var e = t ? "off" : "on";
  29297. i(window)[e]("hashchange", p.hashnav.onHashCange)
  29298. },
  29299. setHash: function() {
  29300. if (p.hashnav.initialized && p.params.hashnav)
  29301. if (p.params.replaceState && window.history && window.history.replaceState) window.history.replaceState(null, null, "#" + p.slides.eq(p.activeIndex)
  29302. .attr("data-hash") || !1);
  29303. else {
  29304. var t = p.slides.eq(p.activeIndex),
  29305. e = t.attr("data-hash") || t.attr("data-history");
  29306. document.location.hash = e || ""
  29307. }
  29308. },
  29309. init: function() {
  29310. if (p.params.hashnav && !p.params.history) {
  29311. p.hashnav.initialized = !0;
  29312. var t = document.location.hash.replace("#", "");
  29313. if (t)
  29314. for (var e = 0, i = p.slides.length; e < i; e++) {
  29315. var n = p.slides.eq(e);
  29316. if ((n.attr("data-hash") || n.attr("data-history")) === t && !n.hasClass(p.params.slideDuplicateClass)) {
  29317. var r = n.index();
  29318. p.slideTo(r, 0, p.params.runCallbacksOnInit, !0)
  29319. }
  29320. }
  29321. p.params.hashnavWatchState && p.hashnav.attachEvents()
  29322. }
  29323. },
  29324. destroy: function() {
  29325. p.params.hashnavWatchState && p.hashnav.attachEvents(!0)
  29326. }
  29327. }, p.history = {
  29328. init: function() {
  29329. if (p.params.history) {
  29330. if (!window.history || !window.history.pushState) return p.params.history = !1, void(p.params.hashnav = !0);
  29331. p.history.initialized = !0, this.paths = this.getPathValues(), (this.paths.key || this.paths.value) && (this.scrollToSlide(0, this.paths.value, p.params.runCallbacksOnInit), p.params.replaceState || window.addEventListener("popstate", this.setHistoryPopState))
  29332. }
  29333. },
  29334. setHistoryPopState: function() {
  29335. p.history.paths = p.history.getPathValues(), p.history.scrollToSlide(p.params.speed, p.history.paths.value, !1)
  29336. },
  29337. getPathValues: function() {
  29338. var t = window.location.pathname.slice(1)
  29339. .split("/"),
  29340. e = t.length;
  29341. return {
  29342. key: t[e - 2],
  29343. value: t[e - 1]
  29344. }
  29345. },
  29346. setHistory: function(t, e) {
  29347. if (p.history.initialized && p.params.history) {
  29348. var i = p.slides.eq(e),
  29349. n = this.slugify(i.attr("data-history"));
  29350. window.location.pathname.includes(t) || (n = t + "/" + n), p.params.replaceState ? window.history.replaceState(null, null, n) : window.history.pushState(null, null, n)
  29351. }
  29352. },
  29353. slugify: function(t) {
  29354. return t.toString()
  29355. .toLowerCase()
  29356. .replace(/\s+/g, "-")
  29357. .replace(/[^\w\-]+/g, "")
  29358. .replace(/\-\-+/g, "-")
  29359. .replace(/^-+/, "")
  29360. .replace(/-+$/, "")
  29361. },
  29362. scrollToSlide: function(t, e, i) {
  29363. if (e)
  29364. for (var n = 0, r = p.slides.length; n < r; n++) {
  29365. var o = p.slides.eq(n);
  29366. if (this.slugify(o.attr("data-history")) === e && !o.hasClass(p.params.slideDuplicateClass)) {
  29367. var a = o.index();
  29368. p.slideTo(a, t, i)
  29369. }
  29370. } else p.slideTo(0, t, i)
  29371. }
  29372. }, p.disableKeyboardControl = function() {
  29373. p.params.keyboardControl = !1, i(document)
  29374. .off("keydown", k)
  29375. }, p.enableKeyboardControl = function() {
  29376. p.params.keyboardControl = !0, i(document)
  29377. .on("keydown", k)
  29378. }, p.mousewheel = {
  29379. event: !1,
  29380. lastScrollTime: (new window.Date)
  29381. .getTime()
  29382. }, p.params.mousewheelControl && (p.mousewheel.event = navigator.userAgent.indexOf("firefox") > -1 ? "DOMMouseScroll" : function() {
  29383. var t = "onwheel" in document;
  29384. if (!t) {
  29385. var e = document.createElement("div");
  29386. e.setAttribute("onwheel", "return;"), t = "function" == typeof e.onwheel
  29387. }
  29388. return !t && document.implementation && document.implementation.hasFeature && !0 !== document.implementation.hasFeature("", "") && (t = document.implementation.hasFeature("Events.wheel", "3.0")), t
  29389. }() ? "wheel" : "mousewheel"), p.disableMousewheelControl = function() {
  29390. if (!p.mousewheel.event) return !1;
  29391. var t = p.container;
  29392. return "container" !== p.params.mousewheelEventsTarged && (t = i(p.params.mousewheelEventsTarged)), t.off(p.mousewheel.event, F), p.params.mousewheelControl = !1, !0
  29393. }, p.enableMousewheelControl = function() {
  29394. if (!p.mousewheel.event) return !1;
  29395. var t = p.container;
  29396. return "container" !== p.params.mousewheelEventsTarged && (t = i(p.params.mousewheelEventsTarged)), t.on(p.mousewheel.event, F), p.params.mousewheelControl = !0, !0
  29397. }, p.parallax = {
  29398. setTranslate: function() {
  29399. p.container.children("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]")
  29400. .each((function() {
  29401. B(this, p.progress)
  29402. })), p.slides.each((function() {
  29403. var t = i(this);
  29404. t.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]")
  29405. .each((function() {
  29406. B(this, Math.min(Math.max(t[0].progress, -1), 1))
  29407. }))
  29408. }))
  29409. },
  29410. setTransition: function(t) {
  29411. void 0 === t && (t = p.params.speed), p.container.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]")
  29412. .each((function() {
  29413. var e = i(this),
  29414. n = parseInt(e.attr("data-swiper-parallax-duration"), 10) || t;
  29415. 0 === t && (n = 0), e.transition(n)
  29416. }))
  29417. }
  29418. }, p.zoom = {
  29419. scale: 1,
  29420. currentScale: 1,
  29421. isScaling: !1,
  29422. gesture: {
  29423. slide: void 0,
  29424. slideWidth: void 0,
  29425. slideHeight: void 0,
  29426. image: void 0,
  29427. imageWrap: void 0,
  29428. zoomMax: p.params.zoomMax
  29429. },
  29430. image: {
  29431. isTouched: void 0,
  29432. isMoved: void 0,
  29433. currentX: void 0,
  29434. currentY: void 0,
  29435. minX: void 0,
  29436. minY: void 0,
  29437. maxX: void 0,
  29438. maxY: void 0,
  29439. width: void 0,
  29440. height: void 0,
  29441. startX: void 0,
  29442. startY: void 0,
  29443. touchesStart: {},
  29444. touchesCurrent: {}
  29445. },
  29446. velocity: {
  29447. x: void 0,
  29448. y: void 0,
  29449. prevPositionX: void 0,
  29450. prevPositionY: void 0,
  29451. prevTime: void 0
  29452. },
  29453. getDistanceBetweenTouches: function(t) {
  29454. if (t.targetTouches.length < 2) return 1;
  29455. var e = t.targetTouches[0].pageX,
  29456. i = t.targetTouches[0].pageY,
  29457. n = t.targetTouches[1].pageX,
  29458. r = t.targetTouches[1].pageY;
  29459. return Math.sqrt(Math.pow(n - e, 2) + Math.pow(r - i, 2))
  29460. },
  29461. onGestureStart: function(t) {
  29462. var e = p.zoom;
  29463. if (!p.support.gestures) {
  29464. if ("touchstart" !== t.type || "touchstart" === t.type && t.targetTouches.length < 2) return;
  29465. e.gesture.scaleStart = e.getDistanceBetweenTouches(t)
  29466. }
  29467. e.gesture.slide && e.gesture.slide.length || (e.gesture.slide = i(this), 0 === e.gesture.slide.length && (e.gesture.slide = p.slides.eq(p.activeIndex)), e.gesture.image = e.gesture.slide.find("img, svg, canvas"), e.gesture.imageWrap = e.gesture.image.parent("." + p.params.zoomContainerClass), e.gesture.zoomMax = e.gesture.imageWrap.attr("data-swiper-zoom") || p.params.zoomMax, 0 !== e.gesture.imageWrap.length) ? (e.gesture.image.transition(0), e.isScaling = !0) : e.gesture.image = void 0
  29468. },
  29469. onGestureChange: function(t) {
  29470. var e = p.zoom;
  29471. if (!p.support.gestures) {
  29472. if ("touchmove" !== t.type || "touchmove" === t.type && t.targetTouches.length < 2) return;
  29473. e.gesture.scaleMove = e.getDistanceBetweenTouches(t)
  29474. }
  29475. e.gesture.image && 0 !== e.gesture.image.length && (p.support.gestures ? e.scale = t.scale * e.currentScale : e.scale = e.gesture.scaleMove / e.gesture.scaleStart * e.currentScale, e.scale > e.gesture.zoomMax && (e.scale = e.gesture.zoomMax - 1 + Math.pow(e.scale - e.gesture.zoomMax + 1, .5)), e.scale < p.params.zoomMin && (e.scale = p.params.zoomMin + 1 - Math.pow(p.params.zoomMin - e.scale + 1, .5)), e.gesture.image.transform("translate3d(0,0,0) scale(" + e.scale + ")"))
  29476. },
  29477. onGestureEnd: function(t) {
  29478. var e = p.zoom;
  29479. !p.support.gestures && ("touchend" !== t.type || "touchend" === t.type && t.changedTouches.length < 2) || e.gesture.image && 0 !== e.gesture.image.length && (e.scale = Math.max(Math.min(e.scale, e.gesture.zoomMax), p.params.zoomMin), e.gesture.image.transition(p.params.speed)
  29480. .transform("translate3d(0,0,0) scale(" + e.scale + ")"), e.currentScale = e.scale, e.isScaling = !1, 1 === e.scale && (e.gesture.slide = void 0))
  29481. },
  29482. onTouchStart: function(t, e) {
  29483. var i = t.zoom;
  29484. i.gesture.image && 0 !== i.gesture.image.length && (i.image.isTouched || ("android" === t.device.os && e.preventDefault(), i.image.isTouched = !0, i.image.touchesStart.x = "touchstart" === e.type ? e.targetTouches[0].pageX : e.pageX, i.image.touchesStart.y = "touchstart" === e.type ? e.targetTouches[0].pageY : e.pageY))
  29485. },
  29486. onTouchMove: function(t) {
  29487. var e = p.zoom;
  29488. if (e.gesture.image && 0 !== e.gesture.image.length && (p.allowClick = !1, e.image.isTouched && e.gesture.slide)) {
  29489. e.image.isMoved || (e.image.width = e.gesture.image[0].offsetWidth, e.image.height = e.gesture.image[0].offsetHeight, e.image.startX = p.getTranslate(e.gesture.imageWrap[0], "x") || 0, e.image.startY = p.getTranslate(e.gesture.imageWrap[0], "y") || 0, e.gesture.slideWidth = e.gesture.slide[0].offsetWidth, e.gesture.slideHeight = e.gesture.slide[0].offsetHeight, e.gesture.imageWrap.transition(0), p.rtl && (e.image.startX = -e.image.startX), p.rtl && (e.image.startY = -e.image.startY));
  29490. var i = e.image.width * e.scale,
  29491. n = e.image.height * e.scale;
  29492. if (!(i < e.gesture.slideWidth && n < e.gesture.slideHeight)) {
  29493. if (e.image.minX = Math.min(e.gesture.slideWidth / 2 - i / 2, 0), e.image.maxX = -e.image.minX, e.image.minY = Math.min(e.gesture.slideHeight / 2 - n / 2, 0), e.image.maxY = -e.image.minY, e.image.touchesCurrent.x = "touchmove" === t.type ? t.targetTouches[0].pageX : t.pageX, e.image.touchesCurrent.y = "touchmove" === t.type ? t.targetTouches[0].pageY : t.pageY, !e.image.isMoved && !e.isScaling) {
  29494. if (p.isHorizontal() && Math.floor(e.image.minX) === Math.floor(e.image.startX) && e.image.touchesCurrent.x < e.image.touchesStart.x || Math.floor(e.image.maxX) === Math.floor(e.image.startX) && e.image.touchesCurrent.x > e.image.touchesStart.x) return void(e.image.isTouched = !1);
  29495. if (!p.isHorizontal() && Math.floor(e.image.minY) === Math.floor(e.image.startY) && e.image.touchesCurrent.y < e.image.touchesStart.y || Math.floor(e.image.maxY) === Math.floor(e.image.startY) && e.image.touchesCurrent.y > e.image.touchesStart.y) return void(e.image.isTouched = !1)
  29496. }
  29497. t.preventDefault(), t.stopPropagation(), e.image.isMoved = !0, e.image.currentX = e.image.touchesCurrent.x - e.image.touchesStart.x + e.image.startX, e.image.currentY = e.image.touchesCurrent.y - e.image.touchesStart.y + e.image.startY, e.image.currentX < e.image.minX && (e.image.currentX = e.image.minX + 1 - Math.pow(e.image.minX - e.image.currentX + 1, .8)), e.image.currentX > e.image.maxX && (e.image.currentX = e.image.maxX - 1 + Math.pow(e.image.currentX - e.image.maxX + 1, .8)), e.image.currentY < e.image.minY && (e.image.currentY = e.image.minY + 1 - Math.pow(e.image.minY - e.image.currentY + 1, .8)), e.image.currentY > e.image.maxY && (e.image.currentY = e.image.maxY - 1 + Math.pow(e.image.currentY - e.image.maxY + 1, .8)), e.velocity.prevPositionX || (e.velocity.prevPositionX = e.image.touchesCurrent.x), e.velocity.prevPositionY || (e.velocity.prevPositionY = e.image.touchesCurrent.y), e.velocity.prevTime || (e.velocity.prevTime = Date.now()), e.velocity.x = (e.image.touchesCurrent.x - e.velocity.prevPositionX) / (Date.now() - e.velocity.prevTime) / 2, e.velocity.y = (e.image.touchesCurrent.y - e.velocity.prevPositionY) / (Date.now() - e.velocity.prevTime) / 2, Math.abs(e.image.touchesCurrent.x - e.velocity.prevPositionX) < 2 && (e.velocity.x = 0), Math.abs(e.image.touchesCurrent.y - e.velocity.prevPositionY) < 2 && (e.velocity.y = 0), e.velocity.prevPositionX = e.image.touchesCurrent.x, e.velocity.prevPositionY = e.image.touchesCurrent.y, e.velocity.prevTime = Date.now(), e.gesture.imageWrap.transform("translate3d(" + e.image.currentX + "px, " + e.image.currentY + "px,0)")
  29498. }
  29499. }
  29500. },
  29501. onTouchEnd: function(t, e) {
  29502. var i = t.zoom;
  29503. if (i.gesture.image && 0 !== i.gesture.image.length) {
  29504. if (!i.image.isTouched || !i.image.isMoved) return i.image.isTouched = !1, void(i.image.isMoved = !1);
  29505. i.image.isTouched = !1, i.image.isMoved = !1;
  29506. var n = 300,
  29507. r = 300,
  29508. o = i.velocity.x * n,
  29509. a = i.image.currentX + o,
  29510. s = i.velocity.y * r,
  29511. l = i.image.currentY + s;
  29512. 0 !== i.velocity.x && (n = Math.abs((a - i.image.currentX) / i.velocity.x)), 0 !== i.velocity.y && (r = Math.abs((l - i.image.currentY) / i.velocity.y));
  29513. var u = Math.max(n, r);
  29514. i.image.currentX = a, i.image.currentY = l;
  29515. var h = i.image.width * i.scale,
  29516. c = i.image.height * i.scale;
  29517. i.image.minX = Math.min(i.gesture.slideWidth / 2 - h / 2, 0), i.image.maxX = -i.image.minX, i.image.minY = Math.min(i.gesture.slideHeight / 2 - c / 2, 0), i.image.maxY = -i.image.minY, i.image.currentX = Math.max(Math.min(i.image.currentX, i.image.maxX), i.image.minX), i.image.currentY = Math.max(Math.min(i.image.currentY, i.image.maxY), i.image.minY), i.gesture.imageWrap.transition(u)
  29518. .transform("translate3d(" + i.image.currentX + "px, " + i.image.currentY + "px,0)")
  29519. }
  29520. },
  29521. onTransitionEnd: function(t) {
  29522. var e = t.zoom;
  29523. e.gesture.slide && t.previousIndex !== t.activeIndex && (e.gesture.image.transform("translate3d(0,0,0) scale(1)"), e.gesture.imageWrap.transform("translate3d(0,0,0)"), e.gesture.slide = e.gesture.image = e.gesture.imageWrap = void 0, e.scale = e.currentScale = 1)
  29524. },
  29525. toggleZoom: function(t, e) {
  29526. var n, r, o, a, s, l, u, h, c, d, p, f, m, g, v, y, b = t.zoom;
  29527. (b.gesture.slide || (b.gesture.slide = t.clickedSlide ? i(t.clickedSlide) : t.slides.eq(t.activeIndex), b.gesture.image = b.gesture.slide.find("img, svg, canvas"), b.gesture.imageWrap = b.gesture.image.parent("." + t.params.zoomContainerClass)), b.gesture.image && 0 !== b.gesture.image.length) && (void 0 === b.image.touchesStart.x && e ? (n = "touchend" === e.type ? e.changedTouches[0].pageX : e.pageX, r = "touchend" === e.type ? e.changedTouches[0].pageY : e.pageY) : (n = b.image.touchesStart.x, r = b.image.touchesStart.y), b.scale && 1 !== b.scale ? (b.scale = b.currentScale = 1, b.gesture.imageWrap.transition(300)
  29528. .transform("translate3d(0,0,0)"), b.gesture.image.transition(300)
  29529. .transform("translate3d(0,0,0) scale(1)"), b.gesture.slide = void 0) : (b.scale = b.currentScale = b.gesture.imageWrap.attr("data-swiper-zoom") || t.params.zoomMax, e ? (v = b.gesture.slide[0].offsetWidth, y = b.gesture.slide[0].offsetHeight, o = b.gesture.slide.offset()
  29530. .left + v / 2 - n, a = b.gesture.slide.offset()
  29531. .top + y / 2 - r, u = b.gesture.image[0].offsetWidth, h = b.gesture.image[0].offsetHeight, c = u * b.scale, d = h * b.scale, m = -(p = Math.min(v / 2 - c / 2, 0)), g = -(f = Math.min(y / 2 - d / 2, 0)), (s = o * b.scale) < p && (s = p), s > m && (s = m), (l = a * b.scale) < f && (l = f), l > g && (l = g)) : (s = 0, l = 0), b.gesture.imageWrap.transition(300)
  29532. .transform("translate3d(" + s + "px, " + l + "px,0)"), b.gesture.image.transition(300)
  29533. .transform("translate3d(0,0,0) scale(" + b.scale + ")")))
  29534. },
  29535. attachEvents: function(t) {
  29536. var e = t ? "off" : "on";
  29537. if (p.params.zoom) {
  29538. p.slides;
  29539. var n = !("touchstart" !== p.touchEvents.start || !p.support.passiveListener || !p.params.passiveListeners) && {
  29540. passive: !0,
  29541. capture: !1
  29542. };
  29543. p.support.gestures ? (p.slides[e]("gesturestart", p.zoom.onGestureStart, n), p.slides[e]("gesturechange", p.zoom.onGestureChange, n), p.slides[e]("gestureend", p.zoom.onGestureEnd, n)) : "touchstart" === p.touchEvents.start && (p.slides[e](p.touchEvents.start, p.zoom.onGestureStart, n), p.slides[e](p.touchEvents.move, p.zoom.onGestureChange, n), p.slides[e](p.touchEvents.end, p.zoom.onGestureEnd, n)), p[e]("touchStart", p.zoom.onTouchStart), p.slides.each((function(t, n) {
  29544. i(n)
  29545. .find("." + p.params.zoomContainerClass)
  29546. .length > 0 && i(n)[e](p.touchEvents.move, p.zoom.onTouchMove)
  29547. })), p[e]("touchEnd", p.zoom.onTouchEnd), p[e]("transitionEnd", p.zoom.onTransitionEnd), p.params.zoomToggle && p.on("doubleTap", p.zoom.toggleZoom)
  29548. }
  29549. },
  29550. init: function() {
  29551. p.zoom.attachEvents()
  29552. },
  29553. destroy: function() {
  29554. p.zoom.attachEvents(!0)
  29555. }
  29556. }, p._plugins = [], p.plugins) {
  29557. var L = p.plugins[D](p, p.params[D]);
  29558. L && p._plugins.push(L)
  29559. }
  29560. return p.callPlugins = function(t) {
  29561. for (var e = 0; e < p._plugins.length; e++) t in p._plugins[e] && p._plugins[e][t](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5])
  29562. }, p.emitterEventListeners = {}, p.emit = function(t) {
  29563. var e;
  29564. if (p.params[t] && p.params[t](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]), p.emitterEventListeners[t])
  29565. for (e = 0; e < p.emitterEventListeners[t].length; e++) p.emitterEventListeners[t][e](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
  29566. p.callPlugins && p.callPlugins(t, arguments[1], arguments[2], arguments[3], arguments[4], arguments[5])
  29567. }, p.on = function(t, e) {
  29568. return t = z(t), p.emitterEventListeners[t] || (p.emitterEventListeners[t] = []), p.emitterEventListeners[t].push(e), p
  29569. }, p.off = function(t, e) {
  29570. var i;
  29571. if (t = z(t), void 0 === e) return p.emitterEventListeners[t] = [], p;
  29572. if (p.emitterEventListeners[t] && 0 !== p.emitterEventListeners[t].length) {
  29573. for (i = 0; i < p.emitterEventListeners[t].length; i++) p.emitterEventListeners[t][i] === e && p.emitterEventListeners[t].splice(i, 1);
  29574. return p
  29575. }
  29576. }, p.once = function(t, e) {
  29577. t = z(t);
  29578. var i = function() {
  29579. e(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]), p.off(t, i)
  29580. };
  29581. return p.on(t, i), p
  29582. }, p.a11y = {
  29583. makeFocusable: function(t) {
  29584. return t.attr("tabIndex", "0"), t
  29585. },
  29586. addRole: function(t, e) {
  29587. return t.attr("role", e), t
  29588. },
  29589. addLabel: function(t, e) {
  29590. return t.attr("aria-label", e), t
  29591. },
  29592. disable: function(t) {
  29593. return t.attr("aria-disabled", !0), t
  29594. },
  29595. enable: function(t) {
  29596. return t.attr("aria-disabled", !1), t
  29597. },
  29598. onEnterKey: function(t) {
  29599. 13 === t.keyCode && (i(t.target)
  29600. .is(p.params.nextButton) ? (p.onClickNext(t), p.isEnd ? p.a11y.notify(p.params.lastSlideMessage) : p.a11y.notify(p.params.nextSlideMessage)) : i(t.target)
  29601. .is(p.params.prevButton) && (p.onClickPrev(t), p.isBeginning ? p.a11y.notify(p.params.firstSlideMessage) : p.a11y.notify(p.params.prevSlideMessage)), i(t.target)
  29602. .is("." + p.params.bulletClass) && i(t.target)[0].click())
  29603. },
  29604. liveRegion: i('<span class="' + p.params.notificationClass + '" aria-live="assertive" aria-atomic="true"></span>'),
  29605. notify: function(t) {
  29606. var e = p.a11y.liveRegion;
  29607. 0 !== e.length && (e.html(""), e.html(t))
  29608. },
  29609. init: function() {
  29610. p.params.nextButton && p.nextButton && p.nextButton.length > 0 && (p.a11y.makeFocusable(p.nextButton), p.a11y.addRole(p.nextButton, "button"), p.a11y.addLabel(p.nextButton, p.params.nextSlideMessage)), p.params.prevButton && p.prevButton && p.prevButton.length > 0 && (p.a11y.makeFocusable(p.prevButton), p.a11y.addRole(p.prevButton, "button"), p.a11y.addLabel(p.prevButton, p.params.prevSlideMessage)), i(p.container)
  29611. .append(p.a11y.liveRegion)
  29612. },
  29613. initPagination: function() {
  29614. p.params.pagination && p.params.paginationClickable && p.bullets && p.bullets.length && p.bullets.each((function() {
  29615. var t = i(this);
  29616. p.a11y.makeFocusable(t), p.a11y.addRole(t, "button"), p.a11y.addLabel(t, p.params.paginationBulletMessage.replace(/{{index}}/, t.index() + 1))
  29617. }))
  29618. },
  29619. destroy: function() {
  29620. p.a11y.liveRegion && p.a11y.liveRegion.length > 0 && p.a11y.liveRegion.remove()
  29621. }
  29622. }, p.init = function() {
  29623. p.params.loop && p.createLoop(), p.updateContainerSize(), p.updateSlidesSize(), p.updatePagination(), p.params.scrollbar && p.scrollbar && (p.scrollbar.set(), p.params.scrollbarDraggable && p.scrollbar.enableDraggable()), "slide" !== p.params.effect && p.effects[p.params.effect] && (p.params.loop || p.updateProgress(), p.effects[p.params.effect].setTranslate()), p.params.loop ? p.slideTo(p.params.initialSlide + p.loopedSlides, 0, p.params.runCallbacksOnInit) : (p.slideTo(p.params.initialSlide, 0, p.params.runCallbacksOnInit), 0 === p.params.initialSlide && (p.parallax && p.params.parallax && p.parallax.setTranslate(), p.lazy && p.params.lazyLoading && (p.lazy.load(), p.lazy.initialImageLoaded = !0))), p.attachEvents(), p.params.observer && p.support.observer && p.initObservers(), p.params.preloadImages && !p.params.lazyLoading && p.preloadImages(), p.params.zoom && p.zoom && p.zoom.init(), p.params.autoplay && p.startAutoplay(), p.params.keyboardControl && p.enableKeyboardControl && p.enableKeyboardControl(), p.params.mousewheelControl && p.enableMousewheelControl && p.enableMousewheelControl(), p.params.hashnavReplaceState && (p.params.replaceState = p.params.hashnavReplaceState), p.params.history && p.history && p.history.init(), p.params.hashnav && p.hashnav && p.hashnav.init(), p.params.a11y && p.a11y && p.a11y.init(), p.emit("onInit", p)
  29624. }, p.cleanupStyles = function() {
  29625. p.container.removeClass(p.classNames.join(" "))
  29626. .removeAttr("style"), p.wrapper.removeAttr("style"), p.slides && p.slides.length && p.slides.removeClass([p.params.slideVisibleClass, p.params.slideActiveClass, p.params.slideNextClass, p.params.slidePrevClass].join(" "))
  29627. .removeAttr("style")
  29628. .removeAttr("data-swiper-column")
  29629. .removeAttr("data-swiper-row"), p.paginationContainer && p.paginationContainer.length && p.paginationContainer.removeClass(p.params.paginationHiddenClass), p.bullets && p.bullets.length && p.bullets.removeClass(p.params.bulletActiveClass), p.params.prevButton && i(p.params.prevButton)
  29630. .removeClass(p.params.buttonDisabledClass), p.params.nextButton && i(p.params.nextButton)
  29631. .removeClass(p.params.buttonDisabledClass), p.params.scrollbar && p.scrollbar && (p.scrollbar.track && p.scrollbar.track.length && p.scrollbar.track.removeAttr("style"), p.scrollbar.drag && p.scrollbar.drag.length && p.scrollbar.drag.removeAttr("style"))
  29632. }, p.destroy = function(t, e) {
  29633. p.detachEvents(), p.stopAutoplay(), p.params.scrollbar && p.scrollbar && p.params.scrollbarDraggable && p.scrollbar.disableDraggable(), p.params.loop && p.destroyLoop(), e && p.cleanupStyles(), p.disconnectObservers(), p.params.zoom && p.zoom && p.zoom.destroy(), p.params.keyboardControl && p.disableKeyboardControl && p.disableKeyboardControl(), p.params.mousewheelControl && p.disableMousewheelControl && p.disableMousewheelControl(), p.params.a11y && p.a11y && p.a11y.destroy(), p.params.history && !p.params.replaceState && window.removeEventListener("popstate", p.history.setHistoryPopState), p.params.hashnav && p.hashnav && p.hashnav.destroy(), p.emit("onDestroy"), !1 !== t && (p = null)
  29634. }, p.init(), p
  29635. }
  29636. function O(t) {
  29637. return Math.floor(t)
  29638. }
  29639. function I() {
  29640. var t = p.params.autoplay,
  29641. e = p.slides.eq(p.activeIndex);
  29642. e.attr("data-swiper-autoplay") && (t = e.attr("data-swiper-autoplay") || p.params.autoplay), p.autoplayTimeoutId = setTimeout((function() {
  29643. p.params.loop ? (p.fixLoop(), p._slideNext(), p.emit("onAutoplay", p)) : p.isEnd ? n.autoplayStopOnLast ? p.stopAutoplay() : (p._slideTo(0), p.emit("onAutoplay", p)) : (p._slideNext(), p.emit("onAutoplay", p))
  29644. }), t)
  29645. }
  29646. function R(t, e) {
  29647. var n = i(t.target);
  29648. if (!n.is(e))
  29649. if ("string" == typeof e) n = n.parents(e);
  29650. else if (e.nodeType) {
  29651. var r;
  29652. return n.parents()
  29653. .each((function(t, i) {
  29654. i === e && (r = e)
  29655. })), r ? e : void 0
  29656. }
  29657. if (0 !== n.length) return n[0]
  29658. }
  29659. function N(t, e) {
  29660. e = e || {};
  29661. var i = new(window.MutationObserver || window.WebkitMutationObserver)((function(t) {
  29662. t.forEach((function(t) {
  29663. p.onResize(!0), p.emit("onObserverUpdate", p, t)
  29664. }))
  29665. }));
  29666. i.observe(t, {
  29667. attributes: void 0 === e.attributes || e.attributes,
  29668. childList: void 0 === e.childList || e.childList,
  29669. characterData: void 0 === e.characterData || e.characterData
  29670. }), p.observers.push(i)
  29671. }
  29672. function k(t) {
  29673. t.originalEvent && (t = t.originalEvent);
  29674. var e = t.keyCode || t.charCode;
  29675. if (!p.params.allowSwipeToNext && (p.isHorizontal() && 39 === e || !p.isHorizontal() && 40 === e)) return !1;
  29676. if (!p.params.allowSwipeToPrev && (p.isHorizontal() && 37 === e || !p.isHorizontal() && 38 === e)) return !1;
  29677. if (!(t.shiftKey || t.altKey || t.ctrlKey || t.metaKey || document.activeElement && document.activeElement.nodeName && ("input" === document.activeElement.nodeName.toLowerCase() || "textarea" === document.activeElement.nodeName.toLowerCase()))) {
  29678. if (37 === e || 39 === e || 38 === e || 40 === e) {
  29679. var i = !1;
  29680. if (p.container.parents("." + p.params.slideClass)
  29681. .length > 0 && 0 === p.container.parents("." + p.params.slideActiveClass)
  29682. .length) return;
  29683. var n = {
  29684. left: window.pageXOffset,
  29685. top: window.pageYOffset
  29686. },
  29687. r = (window.renderWidth || window.innerWidth),
  29688. o = (window.renderHeight || window.innerHeight),
  29689. a = p.container.offset();
  29690. p.rtl && (a.left = a.left - p.container[0].scrollLeft);
  29691. for (var s = [
  29692. [a.left, a.top],
  29693. [a.left + p.width, a.top],
  29694. [a.left, a.top + p.height],
  29695. [a.left + p.width, a.top + p.height]
  29696. ], l = 0; l < s.length; l++) {
  29697. var u = s[l];
  29698. u[0] >= n.left && u[0] <= n.left + r && u[1] >= n.top && u[1] <= n.top + o && (i = !0)
  29699. }
  29700. if (!i) return
  29701. }
  29702. p.isHorizontal() ? (37 !== e && 39 !== e || (t.preventDefault ? t.preventDefault() : t.returnValue = !1), (39 === e && !p.rtl || 37 === e && p.rtl) && p.slideNext(), (37 === e && !p.rtl || 39 === e && p.rtl) && p.slidePrev()) : (38 !== e && 40 !== e || (t.preventDefault ? t.preventDefault() : t.returnValue = !1), 40 === e && p.slideNext(), 38 === e && p.slidePrev()), p.emit("onKeyPress", p, e)
  29703. }
  29704. }
  29705. function F(t) {
  29706. t.originalEvent && (t = t.originalEvent);
  29707. var e = 0,
  29708. i = p.rtl ? -1 : 1,
  29709. n = function(t) {
  29710. var e = 0,
  29711. i = 0,
  29712. n = 0,
  29713. r = 0;
  29714. return "detail" in t && (i = t.detail), "wheelDelta" in t && (i = -t.wheelDelta / 120), "wheelDeltaY" in t && (i = -t.wheelDeltaY / 120), "wheelDeltaX" in t && (e = -t.wheelDeltaX / 120), "axis" in t && t.axis === t.HORIZONTAL_AXIS && (e = i, i = 0), n = 10 * e, r = 10 * i, "deltaY" in t && (r = t.deltaY), "deltaX" in t && (n = t.deltaX), (n || r) && t.deltaMode && (1 === t.deltaMode ? (n *= 40, r *= 40) : (n *= 800, r *= 800)), n && !e && (e = n < 1 ? -1 : 1), r && !i && (i = r < 1 ? -1 : 1), {
  29715. spinX: e,
  29716. spinY: i,
  29717. pixelX: n,
  29718. pixelY: r
  29719. }
  29720. }(t);
  29721. if (p.params.mousewheelForceToAxis)
  29722. if (p.isHorizontal()) {
  29723. if (!(Math.abs(n.pixelX) > Math.abs(n.pixelY))) return;
  29724. e = n.pixelX * i
  29725. } else {
  29726. if (!(Math.abs(n.pixelY) > Math.abs(n.pixelX))) return;
  29727. e = n.pixelY
  29728. }
  29729. else e = Math.abs(n.pixelX) > Math.abs(n.pixelY) ? -n.pixelX * i : -n.pixelY;
  29730. if (0 !== e) {
  29731. if (p.params.mousewheelInvert && (e = -e), p.params.freeMode) {
  29732. var r = p.getWrapperTranslate() + e * p.params.mousewheelSensitivity,
  29733. o = p.isBeginning,
  29734. a = p.isEnd;
  29735. if (r >= p.minTranslate() && (r = p.minTranslate()), r <= p.maxTranslate() && (r = p.maxTranslate()), p.setWrapperTransition(0), p.setWrapperTranslate(r), p.updateProgress(), p.updateActiveIndex(), (!o && p.isBeginning || !a && p.isEnd) && p.updateClasses(), p.params.freeModeSticky ? (clearTimeout(p.mousewheel.timeout), p.mousewheel.timeout = setTimeout((function() {
  29736. p.slideReset()
  29737. }), 300)) : p.params.lazyLoading && p.lazy && p.lazy.load(), p.emit("onScroll", p, t), p.params.autoplay && p.params.autoplayDisableOnInteraction && p.stopAutoplay(), 0 === r || r === p.maxTranslate()) return
  29738. } else {
  29739. if ((new window.Date)
  29740. .getTime() - p.mousewheel.lastScrollTime > 60)
  29741. if (e < 0)
  29742. if (p.isEnd && !p.params.loop || p.animating) {
  29743. if (p.params.mousewheelReleaseOnEdges) return !0
  29744. } else p.slideNext(), p.emit("onScroll", p, t);
  29745. else if (p.isBeginning && !p.params.loop || p.animating) {
  29746. if (p.params.mousewheelReleaseOnEdges) return !0
  29747. } else p.slidePrev(), p.emit("onScroll", p, t);
  29748. p.mousewheel.lastScrollTime = (new window.Date)
  29749. .getTime()
  29750. }
  29751. return t.preventDefault ? t.preventDefault() : t.returnValue = !1, !1
  29752. }
  29753. }
  29754. function B(t, e) {
  29755. var n, r, o;
  29756. t = i(t);
  29757. var a = p.rtl ? -1 : 1;
  29758. n = t.attr("data-swiper-parallax") || "0", r = t.attr("data-swiper-parallax-x"), o = t.attr("data-swiper-parallax-y"), r || o ? (r = r || "0", o = o || "0") : p.isHorizontal() ? (r = n, o = "0") : (o = n, r = "0"), r = r.indexOf("%") >= 0 ? parseInt(r, 10) * e * a + "%" : r * e * a + "px", o = o.indexOf("%") >= 0 ? parseInt(o, 10) * e + "%" : o * e + "px", t.transform("translate3d(" + r + ", " + o + ",0px)")
  29759. }
  29760. function z(t) {
  29761. return 0 !== t.indexOf("on") && (t = t[0] !== t[0].toUpperCase() ? "on" + t[0].toUpperCase() + t.substring(1) : "on" + t), t
  29762. }
  29763. };
  29764. o.prototype = {
  29765. isSafari: (r = window.navigator.userAgent.toLowerCase(), r.indexOf("safari") >= 0 && r.indexOf("chrome") < 0 && r.indexOf("android") < 0),
  29766. isUiWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent),
  29767. isArray: function(t) {
  29768. return "[object Array]" === Object.prototype.toString.apply(t)
  29769. },
  29770. browser: {
  29771. ie: window.navigator.pointerEnabled || window.navigator.msPointerEnabled,
  29772. ieTouch: window.navigator.msPointerEnabled && window.navigator.msMaxTouchPoints > 1 || window.navigator.pointerEnabled && window.navigator.maxTouchPoints > 1,
  29773. lteIE9: (n = document.createElement("div"), n.innerHTML = "\x3c!--[if lte IE 9]><i></i><![endif]--\x3e", 1 === n.getElementsByTagName("i")
  29774. .length)
  29775. },
  29776. device: function() {
  29777. var t = window.navigator.userAgent,
  29778. e = t.match(/(Android);?[\s\/]+([\d.]+)?/),
  29779. i = t.match(/(iPad).*OS\s([\d_]+)/),
  29780. n = t.match(/(iPod)(.*OS\s([\d_]+))?/),
  29781. r = !i && t.match(/(iPhone\sOS|iOS)\s([\d_]+)/);
  29782. return {
  29783. ios: i || r || n,
  29784. android: e
  29785. }
  29786. }(),
  29787. support: {
  29788. touch: window.Modernizr && !0 === Modernizr.touch || !!("ontouchstart" in window || window.DocumentTouch && document instanceof DocumentTouch),
  29789. transforms3d: window.Modernizr && !0 === Modernizr.csstransforms3d || function() {
  29790. var t = document.createElement("div")
  29791. .style;
  29792. return "webkitPerspective" in t || "MozPerspective" in t || "OPerspective" in t || "MsPerspective" in t || "perspective" in t
  29793. }(),
  29794. flexbox: function() {
  29795. for (var t = document.createElement("div")
  29796. .style, e = "alignItems webkitAlignItems webkitBoxAlign msFlexAlign mozBoxAlign webkitFlexDirection msFlexDirection mozBoxDirection mozBoxOrient webkitBoxDirection webkitBoxOrient".split(" "), i = 0; i < e.length; i++)
  29797. if (e[i] in t) return !0
  29798. }(),
  29799. observer: "MutationObserver" in window || "WebkitMutationObserver" in window,
  29800. passiveListener: function() {
  29801. var t = !1;
  29802. try {
  29803. var e = Object.defineProperty({}, "passive", {
  29804. get: function() {
  29805. t = !0
  29806. }
  29807. });
  29808. window.addEventListener("testPassiveListener", null, e)
  29809. } catch (t) {}
  29810. return t
  29811. }(),
  29812. gestures: "ongesturestart" in window
  29813. },
  29814. plugins: {}
  29815. };
  29816. for (var a, s = function() {
  29817. var t = function(t) {
  29818. var e = 0;
  29819. for (e = 0; e < t.length; e++) this[e] = t[e];
  29820. return this.length = t.length, this
  29821. },
  29822. e = function(e, i) {
  29823. var n = [],
  29824. r = 0;
  29825. if (e && !i && e instanceof t) return e;
  29826. if (e)
  29827. if ("string" == typeof e) {
  29828. var o, a, s = e.trim();
  29829. if (s.indexOf("<") >= 0 && s.indexOf(">") >= 0) {
  29830. var l = "div";
  29831. for (0 === s.indexOf("<li") && (l = "ul"), 0 === s.indexOf("<tr") && (l = "tbody"), 0 !== s.indexOf("<td") && 0 !== s.indexOf("<th") || (l = "tr"), 0 === s.indexOf("<tbody") && (l = "table"), 0 === s.indexOf("<option") && (l = "select"), (a = document.createElement(l))
  29832. .innerHTML = e, r = 0; r < a.childNodes.length; r++) n.push(a.childNodes[r])
  29833. } else
  29834. for (o = i || "#" !== e[0] || e.match(/[ .<>:~]/) ? (i || document)
  29835. .querySelectorAll(e) : [document.getElementById(e.split("#")[1])], r = 0; r < o.length; r++) o[r] && n.push(o[r])
  29836. } else if (e.nodeType || e === window || e === document) n.push(e);
  29837. else if (e.length > 0 && e[0].nodeType)
  29838. for (r = 0; r < e.length; r++) n.push(e[r]);
  29839. return new t(n)
  29840. };
  29841. return t.prototype = {
  29842. addClass: function(t) {
  29843. if (void 0 === t) return this;
  29844. for (var e = t.split(" "), i = 0; i < e.length; i++)
  29845. for (var n = 0; n < this.length; n++) this[n].classList.add(e[i]);
  29846. return this
  29847. },
  29848. removeClass: function(t) {
  29849. for (var e = t.split(" "), i = 0; i < e.length; i++)
  29850. for (var n = 0; n < this.length; n++) this[n].classList.remove(e[i]);
  29851. return this
  29852. },
  29853. hasClass: function(t) {
  29854. return !!this[0] && this[0].classList.contains(t)
  29855. },
  29856. toggleClass: function(t) {
  29857. for (var e = t.split(" "), i = 0; i < e.length; i++)
  29858. for (var n = 0; n < this.length; n++) this[n].classList.toggle(e[i]);
  29859. return this
  29860. },
  29861. attr: function(t, e) {
  29862. if (1 === arguments.length && "string" == typeof t) return this[0] ? this[0].getAttribute(t) : void 0;
  29863. for (var i = 0; i < this.length; i++)
  29864. if (2 === arguments.length) this[i].setAttribute(t, e);
  29865. else
  29866. for (var n in t) this[i][n] = t[n], this[i].setAttribute(n, t[n]);
  29867. return this
  29868. },
  29869. removeAttr: function(t) {
  29870. for (var e = 0; e < this.length; e++) this[e].removeAttribute(t);
  29871. return this
  29872. },
  29873. data: function(t, e) {
  29874. if (void 0 !== e) {
  29875. for (var i = 0; i < this.length; i++) {
  29876. var n = this[i];
  29877. n.dom7ElementDataStorage || (n.dom7ElementDataStorage = {}), n.dom7ElementDataStorage[t] = e
  29878. }
  29879. return this
  29880. }
  29881. if (this[0]) {
  29882. var r = this[0].getAttribute("data-" + t);
  29883. return r || (this[0].dom7ElementDataStorage && t in this[0].dom7ElementDataStorage ? this[0].dom7ElementDataStorage[t] : void 0)
  29884. }
  29885. },
  29886. transform: function(t) {
  29887. for (var e = 0; e < this.length; e++) {
  29888. var i = this[e].style;
  29889. i.webkitTransform = i.MsTransform = i.msTransform = i.MozTransform = i.OTransform = i.transform = t
  29890. }
  29891. return this
  29892. },
  29893. transition: function(t) {
  29894. "string" != typeof t && (t += "ms");
  29895. for (var e = 0; e < this.length; e++) {
  29896. var i = this[e].style;
  29897. i.webkitTransitionDuration = i.MsTransitionDuration = i.msTransitionDuration = i.MozTransitionDuration = i.OTransitionDuration = i.transitionDuration = t
  29898. }
  29899. return this
  29900. },
  29901. on: function(t, i, n, r) {
  29902. function o(t) {
  29903. var r = t.target;
  29904. if (e(r)
  29905. .is(i)) n.call(r, t);
  29906. else
  29907. for (var o = e(r)
  29908. .parents(), a = 0; a < o.length; a++) e(o[a])
  29909. .is(i) && n.call(o[a], t)
  29910. }
  29911. var a, s, l = t.split(" ");
  29912. for (a = 0; a < this.length; a++)
  29913. if ("function" == typeof i || !1 === i)
  29914. for ("function" == typeof i && (n = arguments[1], r = arguments[2] || !1), s = 0; s < l.length; s++) this[a].addEventListener(l[s], n, r);
  29915. else
  29916. for (s = 0; s < l.length; s++) this[a].dom7LiveListeners || (this[a].dom7LiveListeners = []), this[a].dom7LiveListeners.push({
  29917. listener: n,
  29918. liveListener: o
  29919. }), this[a].addEventListener(l[s], o, r);
  29920. return this
  29921. },
  29922. off: function(t, e, i, n) {
  29923. for (var r = t.split(" "), o = 0; o < r.length; o++)
  29924. for (var a = 0; a < this.length; a++)
  29925. if ("function" == typeof e || !1 === e) "function" == typeof e && (i = arguments[1], n = arguments[2] || !1), this[a].removeEventListener(r[o], i, n);
  29926. else if (this[a].dom7LiveListeners)
  29927. for (var s = 0; s < this[a].dom7LiveListeners.length; s++) this[a].dom7LiveListeners[s].listener === i && this[a].removeEventListener(r[o], this[a].dom7LiveListeners[s].liveListener, n);
  29928. return this
  29929. },
  29930. once: function(t, e, i, n) {
  29931. var r = this;
  29932. function o(a) {
  29933. i(a), r.off(t, e, o, n)
  29934. }
  29935. "function" == typeof e && (e = !1, i = arguments[1], n = arguments[2]), r.on(t, e, o, n)
  29936. },
  29937. trigger: function(t, e) {
  29938. for (var i = 0; i < this.length; i++) {
  29939. var n;
  29940. try {
  29941. n = new window.CustomEvent(t, {
  29942. detail: e,
  29943. bubbles: !0,
  29944. cancelable: !0
  29945. })
  29946. } catch (i) {
  29947. (n = document.createEvent("Event"))
  29948. .initEvent(t, !0, !0), n.detail = e
  29949. }
  29950. this[i].dispatchEvent(n)
  29951. }
  29952. return this
  29953. },
  29954. transitionEnd: function(t) {
  29955. var e, i = ["webkitTransitionEnd", "transitionend", "oTransitionEnd", "MSTransitionEnd", "msTransitionEnd"],
  29956. n = this;
  29957. function r(o) {
  29958. if (o.target === this)
  29959. for (t.call(this, o), e = 0; e < i.length; e++) n.off(i[e], r)
  29960. }
  29961. if (t)
  29962. for (e = 0; e < i.length; e++) n.on(i[e], r);
  29963. return this
  29964. },
  29965. width: function() {
  29966. return this[0] === window ? (window.renderWidth || window.innerWidth) : this.length > 0 ? parseFloat(this.css("width")) : null
  29967. },
  29968. outerWidth: function(t) {
  29969. return this.length > 0 ? t ? this[0].offsetWidth + parseFloat(this.css("margin-right")) + parseFloat(this.css("margin-left")) : this[0].offsetWidth : null
  29970. },
  29971. height: function() {
  29972. return this[0] === window ? (window.renderHeight || window.innerHeight) : this.length > 0 ? parseFloat(this.css("height")) : null
  29973. },
  29974. outerHeight: function(t) {
  29975. return this.length > 0 ? t ? this[0].offsetHeight + parseFloat(this.css("margin-top")) + parseFloat(this.css("margin-bottom")) : this[0].offsetHeight : null
  29976. },
  29977. offset: function() {
  29978. if (this.length > 0) {
  29979. var t = this[0],
  29980. e = t.getBoundingClientRect(),
  29981. i = document.body,
  29982. n = t.clientTop || i.clientTop || 0,
  29983. r = t.clientLeft || i.clientLeft || 0,
  29984. o = window.pageYOffset || t.scrollTop,
  29985. a = window.pageXOffset || t.scrollLeft;
  29986. return {
  29987. top: e.top + o - n,
  29988. left: e.left + a - r
  29989. }
  29990. }
  29991. return null
  29992. },
  29993. css: function(t, e) {
  29994. var i;
  29995. if (1 === arguments.length) {
  29996. if ("string" != typeof t) {
  29997. for (i = 0; i < this.length; i++)
  29998. for (var n in t) this[i].style[n] = t[n];
  29999. return this
  30000. }
  30001. if (this[0]) return window.getComputedStyle(this[0], null)
  30002. .getPropertyValue(t)
  30003. }
  30004. if (2 === arguments.length && "string" == typeof t) {
  30005. for (i = 0; i < this.length; i++) this[i].style[t] = e;
  30006. return this
  30007. }
  30008. return this
  30009. },
  30010. each: function(t) {
  30011. for (var e = 0; e < this.length; e++) t.call(this[e], e, this[e]);
  30012. return this
  30013. },
  30014. html: function(t) {
  30015. if (void 0 === t) return this[0] ? this[0].innerHTML : void 0;
  30016. for (var e = 0; e < this.length; e++) this[e].innerHTML = t;
  30017. return this
  30018. },
  30019. text: function(t) {
  30020. if (void 0 === t) return this[0] ? this[0].textContent.trim() : null;
  30021. for (var e = 0; e < this.length; e++) this[e].textContent = t;
  30022. return this
  30023. },
  30024. is: function(i) {
  30025. if (!this[0]) return !1;
  30026. var n, r;
  30027. if ("string" == typeof i) {
  30028. var o = this[0];
  30029. if (o === document) return i === document;
  30030. if (o === window) return i === window;
  30031. if (o.matches) return o.matches(i);
  30032. if (o.webkitMatchesSelector) return o.webkitMatchesSelector(i);
  30033. if (o.mozMatchesSelector) return o.mozMatchesSelector(i);
  30034. if (o.msMatchesSelector) return o.msMatchesSelector(i);
  30035. for (n = e(i), r = 0; r < n.length; r++)
  30036. if (n[r] === this[0]) return !0;
  30037. return !1
  30038. }
  30039. if (i === document) return this[0] === document;
  30040. if (i === window) return this[0] === window;
  30041. if (i.nodeType || i instanceof t) {
  30042. for (n = i.nodeType ? [i] : i, r = 0; r < n.length; r++)
  30043. if (n[r] === this[0]) return !0;
  30044. return !1
  30045. }
  30046. return !1
  30047. },
  30048. index: function() {
  30049. if (this[0]) {
  30050. for (var t = this[0], e = 0; null !== (t = t.previousSibling);) 1 === t.nodeType && e++;
  30051. return e
  30052. }
  30053. },
  30054. eq: function(e) {
  30055. if (void 0 === e) return this;
  30056. var i, n = this.length;
  30057. return new t(e > n - 1 ? [] : e < 0 ? (i = n + e) < 0 ? [] : [this[i]] : [this[e]])
  30058. },
  30059. append: function(e) {
  30060. var i, n;
  30061. for (i = 0; i < this.length; i++)
  30062. if ("string" == typeof e) {
  30063. var r = document.createElement("div");
  30064. for (r.innerHTML = e; r.firstChild;) this[i].appendChild(r.firstChild)
  30065. } else if (e instanceof t)
  30066. for (n = 0; n < e.length; n++) this[i].appendChild(e[n]);
  30067. else this[i].appendChild(e);
  30068. return this
  30069. },
  30070. prepend: function(e) {
  30071. var i, n;
  30072. for (i = 0; i < this.length; i++)
  30073. if ("string" == typeof e) {
  30074. var r = document.createElement("div");
  30075. for (r.innerHTML = e, n = r.childNodes.length - 1; n >= 0; n--) this[i].insertBefore(r.childNodes[n], this[i].childNodes[0])
  30076. } else if (e instanceof t)
  30077. for (n = 0; n < e.length; n++) this[i].insertBefore(e[n], this[i].childNodes[0]);
  30078. else this[i].insertBefore(e, this[i].childNodes[0]);
  30079. return this
  30080. },
  30081. insertBefore: function(t) {
  30082. for (var i = e(t), n = 0; n < this.length; n++)
  30083. if (1 === i.length) i[0].parentNode.insertBefore(this[n], i[0]);
  30084. else if (i.length > 1)
  30085. for (var r = 0; r < i.length; r++) i[r].parentNode.insertBefore(this[n].cloneNode(!0), i[r])
  30086. },
  30087. insertAfter: function(t) {
  30088. for (var i = e(t), n = 0; n < this.length; n++)
  30089. if (1 === i.length) i[0].parentNode.insertBefore(this[n], i[0].nextSibling);
  30090. else if (i.length > 1)
  30091. for (var r = 0; r < i.length; r++) i[r].parentNode.insertBefore(this[n].cloneNode(!0), i[r].nextSibling)
  30092. },
  30093. next: function(i) {
  30094. return this.length > 0 ? i ? this[0].nextElementSibling && e(this[0].nextElementSibling)
  30095. .is(i) ? new t([this[0].nextElementSibling]) : new t([]) : this[0].nextElementSibling ? new t([this[0].nextElementSibling]) : new t([]) : new t([])
  30096. },
  30097. nextAll: function(i) {
  30098. var n = [],
  30099. r = this[0];
  30100. if (!r) return new t([]);
  30101. for (; r.nextElementSibling;) {
  30102. var o = r.nextElementSibling;
  30103. i ? e(o)
  30104. .is(i) && n.push(o) : n.push(o), r = o
  30105. }
  30106. return new t(n)
  30107. },
  30108. prev: function(i) {
  30109. return this.length > 0 ? i ? this[0].previousElementSibling && e(this[0].previousElementSibling)
  30110. .is(i) ? new t([this[0].previousElementSibling]) : new t([]) : this[0].previousElementSibling ? new t([this[0].previousElementSibling]) : new t([]) : new t([])
  30111. },
  30112. prevAll: function(i) {
  30113. var n = [],
  30114. r = this[0];
  30115. if (!r) return new t([]);
  30116. for (; r.previousElementSibling;) {
  30117. var o = r.previousElementSibling;
  30118. i ? e(o)
  30119. .is(i) && n.push(o) : n.push(o), r = o
  30120. }
  30121. return new t(n)
  30122. },
  30123. parent: function(t) {
  30124. for (var i = [], n = 0; n < this.length; n++) t ? e(this[n].parentNode)
  30125. .is(t) && i.push(this[n].parentNode) : i.push(this[n].parentNode);
  30126. return e(e.unique(i))
  30127. },
  30128. parents: function(t) {
  30129. for (var i = [], n = 0; n < this.length; n++)
  30130. for (var r = this[n].parentNode; r;) t ? e(r)
  30131. .is(t) && i.push(r) : i.push(r), r = r.parentNode;
  30132. return e(e.unique(i))
  30133. },
  30134. find: function(e) {
  30135. for (var i = [], n = 0; n < this.length; n++)
  30136. for (var r = this[n].querySelectorAll(e), o = 0; o < r.length; o++) i.push(r[o]);
  30137. return new t(i)
  30138. },
  30139. children: function(i) {
  30140. for (var n = [], r = 0; r < this.length; r++)
  30141. for (var o = this[r].childNodes, a = 0; a < o.length; a++) i ? 1 === o[a].nodeType && e(o[a])
  30142. .is(i) && n.push(o[a]) : 1 === o[a].nodeType && n.push(o[a]);
  30143. return new t(e.unique(n))
  30144. },
  30145. remove: function() {
  30146. for (var t = 0; t < this.length; t++) this[t].parentNode && this[t].parentNode.removeChild(this[t]);
  30147. return this
  30148. },
  30149. add: function() {
  30150. var t, i, n = this;
  30151. for (t = 0; t < arguments.length; t++) {
  30152. var r = e(arguments[t]);
  30153. for (i = 0; i < r.length; i++) n[n.length] = r[i], n.length++
  30154. }
  30155. return n
  30156. }
  30157. }, e.fn = t.prototype, e.unique = function(t) {
  30158. for (var e = [], i = 0; i < t.length; i++) - 1 === e.indexOf(t[i]) && e.push(t[i]);
  30159. return e
  30160. }, e
  30161. }(), l = ["jQuery", "Zepto", "Dom7"], u = 0; u < l.length; u++) window[l[u]] && h(window[l[u]]);
  30162. function h(t) {
  30163. t.fn.swiper = function(e) {
  30164. var i;
  30165. return t(this)
  30166. .each((function() {
  30167. var t = new o(this, e);
  30168. i || (i = t)
  30169. })), i
  30170. }
  30171. }(a = void 0 === s ? window.Dom7 || window.Zepto || window.jQuery : s) && ("transitionEnd" in a.fn || (a.fn.transitionEnd = function(t) {
  30172. var e, i = ["webkitTransitionEnd", "transitionend", "oTransitionEnd", "MSTransitionEnd", "msTransitionEnd"],
  30173. n = this;
  30174. function r(o) {
  30175. if (o.target === this)
  30176. for (t.call(this, o), e = 0; e < i.length; e++) n.off(i[e], r)
  30177. }
  30178. if (t)
  30179. for (e = 0; e < i.length; e++) n.on(i[e], r);
  30180. return this
  30181. }), "transform" in a.fn || (a.fn.transform = function(t) {
  30182. for (var e = 0; e < this.length; e++) {
  30183. var i = this[e].style;
  30184. i.webkitTransform = i.MsTransform = i.msTransform = i.MozTransform = i.OTransform = i.transform = t
  30185. }
  30186. return this
  30187. }), "transition" in a.fn || (a.fn.transition = function(t) {
  30188. "string" != typeof t && (t += "ms");
  30189. for (var e = 0; e < this.length; e++) {
  30190. var i = this[e].style;
  30191. i.webkitTransitionDuration = i.MsTransitionDuration = i.msTransitionDuration = i.MozTransitionDuration = i.OTransitionDuration = i.transitionDuration = t
  30192. }
  30193. return this
  30194. }), "outerWidth" in a.fn || (a.fn.outerWidth = function(t) {
  30195. return this.length > 0 ? t ? this[0].offsetWidth + parseFloat(this.css("margin-right")) + parseFloat(this.css("margin-left")) : this[0].offsetWidth : null
  30196. })), t.exports = o
  30197. })
  30198. .call(this, "/js/util/Swiper.js")
  30199. })
  30200. .call(this, i(6))
  30201. }, function(t, e) {
  30202. t.exports = {
  30203. Pic: 1,
  30204. Text: 2,
  30205. GIF: 3
  30206. }
  30207. }, function(t, e, i) {
  30208. (function(e) {
  30209. function n() {
  30210. h.call(this), this.neighbourMap = {}, this.map = null
  30211. }
  30212. var r = i(0),
  30213. o = i(7),
  30214. a = i(1),
  30215. s = i(19),
  30216. l = i(161),
  30217. u = new(i(2))(e),
  30218. h = i(33),
  30219. c = i(8);
  30220. o.inherit(n, h), n.prototype.getIndex = function(t) {
  30221. return t.id
  30222. }, n.prototype.find = function(t, e) {
  30223. var i = o.filterAll(this.list, t);
  30224. if (i.length > 0) return e && e.forEach((function(t) {
  30225. i = o.stableSort(i, t)
  30226. })), i[0]
  30227. }, n.prototype.sortByScore = function(t, e) {
  30228. var i = o.filterAll(this.list, t);
  30229. return i.length > 0 ? i = i.map((function(t) {
  30230. return {
  30231. pano: t,
  30232. score: e.reduce((function(e, i) {
  30233. return e + i(t)
  30234. }), 0)
  30235. }
  30236. }))
  30237. .sort((function(t, e) {
  30238. return e.score - t.score
  30239. })) : null
  30240. }, n.prototype.lowestByScore = function(t, e, i) {
  30241. return this.findRankedByScore(0, t, e, i)
  30242. }, n.prototype.findRankedByScore = function(t, e, i, n) {
  30243. n && (n.candidates = null, n.pano = null), t || (t = 0);
  30244. var r = this.sortByScore(e, i);
  30245. return r && 0 !== r.length && t < r.length ? (n && (n.candidates = r, n.pano = r[t].pano), r[t].pano) : null
  30246. }, n.prototype.showPanoScores = function(t) {
  30247. this.list.forEach((function(t) {
  30248. t.removeTextSprite()
  30249. }));
  30250. var e = 6344768;
  30251. t.forEach((function(t) {
  30252. t.pano.addTextSprite(t.score.toFixed(2), e), e = 16428055
  30253. }))
  30254. }, n.prototype.isNeighbour = function(t, e) {
  30255. return this.neighbourMap[t.id][e.id]
  30256. }, n.prototype.getNeighbours = function(t) {
  30257. return this.neighbourMap[t.id]
  30258. }, n.prototype.setNeighbour = function(t, e, i) {
  30259. return this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}), this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}), this.neighbourMap[t.id][t.id] = !0, this.neighbourMap[e.id][e.id] = !0, this.neighbourMap[t.id][e.id] = i, this.neighbourMap[e.id][t.id] = i, this.neighbourMap[t.id]
  30260. }, n.prototype.findClosest = function(t, e) {
  30261. var i = [s.filters.isPanoAligned()];
  30262. return e && i.push(s.filters.inDirection(t, e, .75)), this.find(i, [s.sortFunctions.distanceToPoint(t)])
  30263. }, n.prototype.dualNeighbors = function(t, e) {
  30264. var i, n = [];
  30265. for (i in this.neighbourMap[t.id]) this.neighbourMap[e.id][i] && n.push(i);
  30266. return n
  30267. }, n.prototype.populate_path_graph = function() {
  30268. var t, e, i, n, o, a, s, l, h = Date.now(),
  30269. c = {},
  30270. d = 0,
  30271. p = new r.Vector3(0, 0, 0);
  30272. for (t = 0; t < this.list.length; t++) {
  30273. for (e in s = {}, l = !1, i = (o = this.list[t])
  30274. .neighbourPanos || o.findNeighourPanos())
  30275. if (i[e]) {
  30276. a = this.index[e], p.copy(o.floorPosition), p.sub(a.floorPosition);
  30277. var f = Math.sqrt(p.x * p.x + p.z * p.z),
  30278. m = (Math.abs(p.y), Math.max(f, .01), Math.max(0, Math.abs(p.y) - .2));
  30279. m > 0 ? (m = Math.pow(4 * m, 2), f = Math.pow(f, 2), n = Math.sqrt(m * m + f * f)) : n = p.length(), s[a.id] = n, l = !0
  30280. } l ? c[o.id] = s : d += 1
  30281. }
  30282. this.map = c, u.info("graph ready in " + (Date.now() - h) + "ms, " + d + " had no neighbors")
  30283. }, n.prototype.aStarSearch = function(t, e) {
  30284. var i = Date.now(),
  30285. n = new l({
  30286. start: t,
  30287. isEnd: function(t) {
  30288. return t === e
  30289. },
  30290. neighbor: function(t) {
  30291. var e = t.neighbourPanos || t.findNeighourPanos(),
  30292. i = [];
  30293. for (var n in e) i.push(this.index[n]);
  30294. return i
  30295. }.bind(this),
  30296. distance: function(t, e) {
  30297. return this.map[t.id][e.id]
  30298. }.bind(this),
  30299. heuristic: function(t, e) {
  30300. return 1
  30301. }.bind(this),
  30302. hash: function(t) {
  30303. return t.id
  30304. },
  30305. timeout: 5e3
  30306. });
  30307. if (u.debug("A* search in " + (Date.now() - i) + "ms"), "success" !== n.status) return u.debug("Did not find A* path from " + t + " to " + e), null;
  30308. u.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  30309. var r = [];
  30310. return n.path.forEach((function(t) {
  30311. r.push(t.id)
  30312. })), r
  30313. }, n.prototype.includeNodesNearPath = function() {
  30314. var t = new r.Vector3,
  30315. e = new r.Vector3,
  30316. i = new r.Vector3,
  30317. n = new r.Vector3,
  30318. o = new r.Vector3,
  30319. a = new r.Vector3,
  30320. s = new r.Vector3,
  30321. l = new r.Vector3,
  30322. u = [],
  30323. h = new r.Vector3,
  30324. c = new r.Vector3;
  30325. return function(r, d) {
  30326. if (r)
  30327. for (var p = function(t, e, i) {
  30328. return o.copy(e)
  30329. .sub(t), o.dot(i)
  30330. }, f = function(t, e) {
  30331. return p(h, t.position, i) - p(h, e.position, i)
  30332. }, m = 0; m < r.length - 1;) {
  30333. var g = r[m],
  30334. v = r[m + 1],
  30335. y = this.index[g],
  30336. b = this.index[v];
  30337. h.copy(y.position), c.copy(b.position), u.length = 0, t.copy(c)
  30338. .sub(h), i.copy(t)
  30339. .normalize();
  30340. for (var w = 0; w < this.list.length; w++) {
  30341. var x = this.list[w];
  30342. o.copy(x.position)
  30343. .sub(h);
  30344. var M = o.dot(i);
  30345. if (M > 0)
  30346. if (s.copy(i), s.multiplyScalar(M), a.copy(o), a.sub(s), a.length() < d) e.copy(t)
  30347. .negate(), n.copy(e)
  30348. .normalize(), l.copy(x.position)
  30349. .sub(c), l.dot(n) > 0 && u.push(x)
  30350. }
  30351. if (u.length > 0) {
  30352. u.sort(f);
  30353. for (var T = r.length + u.length - 1; T >= m + u.length; T--) r[T] = r[T - u.length];
  30354. for (var S = 0; S < u.length; S++) r[S + m + 1] = u[S].id
  30355. }
  30356. m += u.length + 1
  30357. }
  30358. }
  30359. }(), n.prototype.fadeMarkerOpacity = function(t, e) {
  30360. var i = void 0 === t ? a.panorama.markerOpacity : t,
  30361. n = this.list.findIndex((function(t) {
  30362. return t.marker
  30363. }));
  30364. if (n >= 0) {
  30365. var r = this.list[n].marker.material.opacity;
  30366. if (r !== t) {
  30367. var o = i - r;
  30368. c.trigger({
  30369. func: function(t, e) {
  30370. var i = r + t * o;
  30371. this.forEach((function(t) {
  30372. t.marker && (t.marker.material.opacity = i)
  30373. }))
  30374. }.bind(this),
  30375. duration: void 0 === e ? a.markerOpacityTransitionTime : e,
  30376. name: "_fpm"
  30377. })
  30378. }
  30379. }
  30380. }, n.prototype.update = function(t) {
  30381. this.forEach((function(e) {
  30382. e.update(t)
  30383. }))
  30384. }, t.exports = n
  30385. })
  30386. .call(this, "/js/util/PanoramaCollection.js")
  30387. }, function(t, e, i) {
  30388. function n(t) {
  30389. if (void 0 !== t.parent) {
  30390. var e = n(t.parent);
  30391. return e.push(t.data), e
  30392. }
  30393. return [t.data]
  30394. }
  30395. function r(t) {
  30396. return t.toString()
  30397. }
  30398. function o(t, e) {
  30399. return t.f - e.f
  30400. }
  30401. var a = i(162),
  30402. s = i(163),
  30403. l = i(165);
  30404. t.exports = function(t) {
  30405. void 0 === t.timeout && (t.timeout = 1 / 0);
  30406. var e = t.hash || r,
  30407. i = {
  30408. data: t.start,
  30409. g: 0,
  30410. h: t.heuristic(t.start)
  30411. },
  30412. u = i;
  30413. i.f = i.h;
  30414. var h = new a,
  30415. c = new s(o),
  30416. d = l();
  30417. c.push(i), d.set(e(i.data), i);
  30418. for (var p = new Date; c.size();) {
  30419. if (new Date - p > t.timeout) return {
  30420. status: "timeout",
  30421. cost: u.g,
  30422. path: n(u)
  30423. };
  30424. var f = c.pop();
  30425. if (d.delete(e(f.data)), t.isEnd(f.data)) {
  30426. var m = n(f);
  30427. return {
  30428. status: "success",
  30429. cost: f.g,
  30430. path: m
  30431. }
  30432. }
  30433. h.add(e(f.data));
  30434. for (var g = t.neighbor(f.data), v = 0; v < g.length; v++) {
  30435. var y = g[v];
  30436. if (!h.contains(e(y))) {
  30437. var b = f.g + t.distance(f.data, y),
  30438. w = d.get(e(y)),
  30439. x = !1;
  30440. if (void 0 === w) w = {
  30441. data: y
  30442. }, d.set(e(y), w);
  30443. else {
  30444. if (w.g < b) continue;
  30445. x = !0
  30446. }
  30447. w.parent = f, w.g = b, w.h = t.heuristic(y), w.f = b + w.h, w.h < u.h && (u = w), x ? c.heapify() : c.push(w)
  30448. }
  30449. }
  30450. }
  30451. return {
  30452. status: "noPath",
  30453. cost: u.g,
  30454. path: n(u)
  30455. }
  30456. }
  30457. }, function(t, e, i) {
  30458. function n(t) {
  30459. if (this.set = {}, this.infContains = function() {
  30460. return !0
  30461. }, "object" == typeof t)
  30462. if (t instanceof Array)
  30463. for (var e = 0; e < t.length; e++) this.set[t[e]] = !0;
  30464. else this.set = t;
  30465. else if ("function" == typeof t) this.infContains = t;
  30466. else if (void 0 !== t) throw new Error("set must be either an array or an object.")
  30467. }
  30468. t.exports = n, n.prototype.contains = function(t) {
  30469. return !!this.set[t]
  30470. }, n.prototype.has = n.prototype.contains, n.prototype.add = function(t) {
  30471. if (1 == arguments.length) this.set[t] = !0;
  30472. else
  30473. for (var e = 0; e < arguments.length; e++) this.set[arguments[e]] = !0
  30474. }, n.prototype.addAll = function(t) {
  30475. if ("object" != typeof t && !(t instanceof Array)) throw new Error("arr must be an array.");
  30476. for (var e = 0; e < t.length; e++) this.add(t[e])
  30477. }, n.prototype.remove = function(t) {
  30478. if (1 == arguments.length) delete this.set[t];
  30479. else
  30480. for (var e = 0; e < arguments.length; e++) delete this.set[arguments[e]]
  30481. }, n.prototype.delete = n.prototype.remove, n.prototype.clear = function() {
  30482. this.set = {}
  30483. }, n.prototype.size = function() {
  30484. return Object.keys(this.set)
  30485. .length
  30486. }, n.prototype.toString = function() {
  30487. return "{" + Object.keys(this.set)
  30488. .toString() + "}"
  30489. }, n.prototype.toArray = function() {
  30490. return void 0 === this.set ? [] : Object.keys(this.set)
  30491. }, n.prototype["*values"] = n.prototype.toArray
  30492. }, function(t, e, i) {
  30493. t.exports = i(164)
  30494. }, function(t, e, i) {
  30495. var n, r, o;
  30496. (function() {
  30497. var i, a, s, l, u, h, c, d, p, f, m, g, v, y, b;
  30498. s = Math.floor, f = Math.min, a = function(t, e) {
  30499. return t < e ? -1 : t > e ? 1 : 0
  30500. }, p = function(t, e, i, n, r) {
  30501. var o;
  30502. if (null == i && (i = 0), null == r && (r = a), i < 0) throw new Error("lo must be non-negative");
  30503. for (null == n && (n = t.length); i < n;) r(e, t[o = s((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  30504. return [].splice.apply(t, [i, i - i].concat(e)), e
  30505. }, h = function(t, e, i) {
  30506. return null == i && (i = a), t.push(e), y(t, 0, t.length - 1, i)
  30507. }, u = function(t, e) {
  30508. var i, n;
  30509. return null == e && (e = a), i = t.pop(), t.length ? (n = t[0], t[0] = i, b(t, 0, e)) : n = i, n
  30510. }, d = function(t, e, i) {
  30511. var n;
  30512. return null == i && (i = a), n = t[0], t[0] = e, b(t, 0, i), n
  30513. }, c = function(t, e, i) {
  30514. var n;
  30515. return null == i && (i = a), t.length && i(t[0], e) < 0 && (e = (n = [t[0], e])[0], t[0] = n[1], b(t, 0, i)), e
  30516. }, l = function(t, e) {
  30517. var i, n, r, o, l, u;
  30518. for (null == e && (e = a), l = [], n = 0, r = (o = function() {
  30519. u = [];
  30520. for (var e = 0, i = s(t.length / 2); 0 <= i ? e < i : e > i; 0 <= i ? e++ : e--) u.push(e);
  30521. return u
  30522. }.apply(this)
  30523. .reverse())
  30524. .length; n < r; n++) i = o[n], l.push(b(t, i, e));
  30525. return l
  30526. }, v = function(t, e, i) {
  30527. var n;
  30528. if (null == i && (i = a), -1 !== (n = t.indexOf(e))) return y(t, 0, n, i), b(t, n, i)
  30529. }, m = function(t, e, i) {
  30530. var n, r, o, s, u;
  30531. if (null == i && (i = a), !(r = t.slice(0, e))
  30532. .length) return r;
  30533. for (l(r, i), o = 0, s = (u = t.slice(e))
  30534. .length; o < s; o++) n = u[o], c(r, n, i);
  30535. return r.sort(i)
  30536. .reverse()
  30537. }, g = function(t, e, i) {
  30538. var n, r, o, s, h, c, d, m, g;
  30539. if (null == i && (i = a), 10 * e <= t.length) {
  30540. if (!(o = t.slice(0, e)
  30541. .sort(i))
  30542. .length) return o;
  30543. for (r = o[o.length - 1], s = 0, c = (d = t.slice(e))
  30544. .length; s < c; s++) i(n = d[s], r) < 0 && (p(o, n, 0, null, i), o.pop(), r = o[o.length - 1]);
  30545. return o
  30546. }
  30547. for (l(t, i), g = [], h = 0, m = f(e, t.length); 0 <= m ? h < m : h > m; 0 <= m ? ++h : --h) g.push(u(t, i));
  30548. return g
  30549. }, y = function(t, e, i, n) {
  30550. var r, o, s;
  30551. for (null == n && (n = a), r = t[i]; i > e && n(r, o = t[s = i - 1 >> 1]) < 0;) t[i] = o, i = s;
  30552. return t[i] = r
  30553. }, b = function(t, e, i) {
  30554. var n, r, o, s, l;
  30555. for (null == i && (i = a), r = t.length, l = e, o = t[e], n = 2 * e + 1; n < r;)(s = n + 1) < r && !(i(t[n], t[s]) < 0) && (n = s), t[e] = t[n], n = 2 * (e = n) + 1;
  30556. return t[e] = o, y(t, l, e, i)
  30557. }, i = function() {
  30558. function t(t) {
  30559. this.cmp = null != t ? t : a, this.nodes = []
  30560. }
  30561. return t.push = h, t.pop = u, t.replace = d, t.pushpop = c, t.heapify = l, t.updateItem = v, t.nlargest = m, t.nsmallest = g, t.prototype.push = function(t) {
  30562. return h(this.nodes, t, this.cmp)
  30563. }, t.prototype.pop = function() {
  30564. return u(this.nodes, this.cmp)
  30565. }, t.prototype.peek = function() {
  30566. return this.nodes[0]
  30567. }, t.prototype.contains = function(t) {
  30568. return -1 !== this.nodes.indexOf(t)
  30569. }, t.prototype.replace = function(t) {
  30570. return d(this.nodes, t, this.cmp)
  30571. }, t.prototype.pushpop = function(t) {
  30572. return c(this.nodes, t, this.cmp)
  30573. }, t.prototype.heapify = function() {
  30574. return l(this.nodes, this.cmp)
  30575. }, t.prototype.updateItem = function(t) {
  30576. return v(this.nodes, t, this.cmp)
  30577. }, t.prototype.clear = function() {
  30578. return this.nodes = []
  30579. }, t.prototype.empty = function() {
  30580. return 0 === this.nodes.length
  30581. }, t.prototype.size = function() {
  30582. return this.nodes.length
  30583. }, t.prototype.clone = function() {
  30584. var e;
  30585. return (e = new t)
  30586. .nodes = this.nodes.slice(0), e
  30587. }, t.prototype.toArray = function() {
  30588. return this.nodes.slice(0)
  30589. }, t.prototype.insert = t.prototype.push, t.prototype.top = t.prototype.peek, t.prototype.front = t.prototype.peek, t.prototype.has = t.prototype.contains, t.prototype.copy = t.prototype.clone, t
  30590. }(), r = [], void 0 === (o = "function" == typeof(n = function() {
  30591. return i
  30592. }) ? n.apply(e, r) : n) || (t.exports = o)
  30593. })
  30594. .call(this)
  30595. }, function(t, e, i) {
  30596. "use strict";
  30597. var n = Object.prototype.hasOwnProperty;
  30598. function r(t) {
  30599. return "~" + t
  30600. }
  30601. function o(t) {
  30602. return t.substring("~".length)
  30603. }
  30604. function a(t) {
  30605. if ("string" != typeof t) throw new TypeError("key must be a string.")
  30606. }
  30607. t.exports = function(t) {
  30608. var e = Object.create(null),
  30609. i = 0,
  30610. s = {};
  30611. return function(t, e) {
  30612. for (var i in e) Object.defineProperty(t, i, {
  30613. value: e[i],
  30614. configurable: !0,
  30615. writable: !0
  30616. })
  30617. }(s, {
  30618. get: function(t, i) {
  30619. a(t);
  30620. var n = r(t);
  30621. return n in e ? e[n] : i
  30622. },
  30623. set: function(t, n) {
  30624. a(t);
  30625. var o = r(t);
  30626. return o in e || ++i, e[o] = n
  30627. },
  30628. has: function(t) {
  30629. return a(t), r(t) in e
  30630. },
  30631. delete: function(t) {
  30632. a(t);
  30633. var n = r(t);
  30634. return n in e && (--i, delete e[n], !0)
  30635. },
  30636. clear: function() {
  30637. e = Object.create(null), i = 0
  30638. },
  30639. forEach: function(t, i) {
  30640. if ("function" != typeof t) throw new TypeError("`callback` must be a function");
  30641. for (var r in e)
  30642. if (n.call(e, r)) {
  30643. var a = o(r),
  30644. l = e[r];
  30645. t.call(i, l, a, s)
  30646. }
  30647. }
  30648. }), Object.defineProperty(s, "size", {
  30649. get: function() {
  30650. return i
  30651. },
  30652. configurable: !0
  30653. }), "object" == typeof t && null !== t && Object.keys(t)
  30654. .forEach((function(e) {
  30655. s.set(e, t[e])
  30656. })), s
  30657. }
  30658. }, function(t, e, i) {
  30659. (function(e) {
  30660. var n = (i(0), i(1), i(3), i(167)),
  30661. r = new(i(2))(e);
  30662. t.exports = {
  30663. getLoaders: function(t) {
  30664. return [
  30665. ["_50k", ".dam", n],
  30666. ["", ".dam", n]
  30667. ][t]
  30668. },
  30669. load: function(t, e, i, n, o) {
  30670. o = o || 0;
  30671. var a = this.getLoaders(o);
  30672. if (a) {
  30673. var s = a[0],
  30674. l = a[1],
  30675. u = new a[2](t),
  30676. h = G.url.model + "/model.nest",
  30677. c = this;
  30678. h ? (r.debug("Trying " + s + l), u.load(h, e, i, (function() {
  30679. c.load(t, e, i, n, ++o)
  30680. }))) : (r.debug("Skipping " + l + ", not available"), this.load(t, e, i, n, ++o))
  30681. } else n && n("No suitable model file found...")
  30682. }
  30683. }
  30684. })
  30685. .call(this, "/js/loaders/ModelLoader.js")
  30686. }, function(t, e, i) {
  30687. (function(e, n) {
  30688. var r = i(0),
  30689. o = i(46),
  30690. a = i(2),
  30691. s = (i(7), i(11)),
  30692. l = i(45),
  30693. u = new a(n);
  30694. function h(t) {
  30695. this.urls = t;
  30696. var i = e("bWVzc2FnZSBtZXNoZXMgew0KICAgIHJlcXVpcmVkIHN0cmluZyB2ZXJzaW9uID0gMTsNCiAgICByZXBlYXRlZCBibG9ja19kZWZhdWx0IGJsb2NrX2RlZmF1bHQgPSAyOw0KICAgIHJlcGVhdGVkIGJsb2NrX21vZGVsIGJsb2NrX21vZGVsID0gMzsNCiAgICByZXBlYXRlZCBibG9ja19jdXN0b21pemVkIGJsb2NrX2N1c3RvbWl6ZWQgPSA0Ow0KfQ0KDQptZXNzYWdlIHZlcnRpY2VzX3NpbXBsZSB7DQogICAgcmVwZWF0ZWQgZmxvYXQgdXYgPSAxIFtwYWNrZWQ9dHJ1ZV07DQogICAgcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMiBbcGFja2VkPXRydWVdOw0KfQ0KDQptZXNzYWdlIGZhY2VzX3NpbXBsZSB7DQogICAgcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOw0KfQ0KDQptZXNzYWdlIGJsb2NrX21vZGVsIHsNCiAgICBvcHRpb25hbCB2ZXJ0aWNlc19zaW1wbGUgdmVydGljZXMgPSAxOw0KICAgIG9wdGlvbmFsIGZhY2VzX3NpbXBsZSBmYWNlcyA9IDI7DQogICAgb3B0aW9uYWwgc3RyaW5nIGJsb2NrX25hbWUgPSAzOw0KICAgIG9wdGlvbmFsIHN0cmluZyB0eHRuYW1lID0gNDsNCn0NCg0KbWVzc2FnZSBibG9ja19kZWZhdWx0IHsNCiAgICByZXBlYXRlZCBibG9ja19kZWZhdWx0X3VuaXQgZGVmYXVsdF91bml0cyA9IDE7DQp9DQoNCm1lc3NhZ2UgYmxvY2tfZGVmYXVsdF91bml0IHsNCiAgICByZXF1aXJlZCBzdHJpbmcgdW5pdF9pZCA9IDE7DQogICAgb3B0aW9uYWwgdmVydGljZXNfc2ltcGxlIHZlcnRpY2VzID0gMjsNCiAgICBvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAzOw0KICAgIG9wdGlvbmFsIHN0cmluZyBibG9ja19kZXMgPSA0Ow0KICAgIG9wdGlvbmFsIHN0cmluZyB0eHRuYW1lID0gNTsNCn0NCg0KbWVzc2FnZSBibG9ja19jdXN0b21pemVkIHsNCiAgICByZXBlYXRlZCBibG9ja19jdXN0b21pemVkX3VuaXQgY3VzdG9taXplZF91bml0cyA9IDE7DQp9DQoNCm1lc3NhZ2UgYmxvY2tfY3VzdG9taXplZF91bml0IHsNCiAgICByZXF1aXJlZCBzdHJpbmcgdW5pdF9pZCA9IDE7DQogICAgcmVxdWlyZWQgc3RyaW5nIHJlbGF0ZWRfaWQgPSAyOw0KICAgIG9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDM7DQogICAgb3B0aW9uYWwgZmFjZXNfc2ltcGxlIGZhY2VzID0gNDsNCiAgICBvcHRpb25hbCBzdHJpbmcgYmxvY2tfZGVzID0gNTsNCiAgICBvcHRpb25hbCBzdHJpbmcgdHh0bmFtZSA9IDY7DQp9DQo=", "base64");
  30697. this.decoder = o.loadProto(i)
  30698. .build("meshes")
  30699. }
  30700. window.dcodeIO && (o = window.dcodeIO.ProtoBuf), h.prototype = {
  30701. constructor: h,
  30702. load: function(t, e, i, n) {
  30703. return u.time("download"), s.get(t, {
  30704. responseType: "arraybuffer"
  30705. })
  30706. .done(function(r) {
  30707. u.timeEnd("download"), this.parse(r, t, e, i, n)
  30708. }.bind(this))
  30709. .fail(n)
  30710. },
  30711. parse: function(t, e, i, n, r) {
  30712. var o = this.readProtobuf(t);
  30713. if (!o) return r();
  30714. try {
  30715. u.time("convert to webgl"), this.convertProtobufToSceneObject(o, e, i, n, r), u.timeEnd("convert to webgl")
  30716. } catch (t) {
  30717. return u.error("failed parsing .dam"), u.error(t.message), r()
  30718. }
  30719. },
  30720. readProtobuf: function(t) {
  30721. var e;
  30722. try {
  30723. u.time("parse proto"), e = this.decoder.decode(t), u.timeEnd("parse proto")
  30724. } catch (t) {
  30725. return u.error("failed parsing proto for .dam"), u.error(t.message), null
  30726. }
  30727. return e
  30728. },
  30729. convertProtobufToSceneObject: function(t, e, i, n, o) {
  30730. if (0 === t.block_model.length) return u.warn("No chunks in damfile..."), i([]);
  30731. var a = new r.Matrix4;
  30732. a.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  30733. var s = t.block_model.map((function(t) {
  30734. var i = new r.BufferGeometry;
  30735. return i.addAttribute("position", new r.BufferAttribute(new Float32Array(t.vertices.xyz, 0, 3), 3)), t.vertices.uv.length > 0 && i.addAttribute("uv", new r.BufferAttribute(new Float32Array(t.vertices.uv, 0, 2), 2)), i.setIndex(new r.BufferAttribute(new Uint32Array(t.faces.faces, 0, 1), 1)), i.applyMatrix(a), i.computeBoundingBox(), new l({
  30736. geometry: i,
  30737. textureName: t.txtname,
  30738. name: t.block_name,
  30739. meshUrl: e
  30740. })
  30741. }));
  30742. return s ? i(s) : (u.error("no blocks..."), o())
  30743. }
  30744. }, t.exports = h
  30745. })
  30746. .call(this, i(47)
  30747. .Buffer, "/js/loaders/DamLoader.js")
  30748. }, function(t, e, i) {
  30749. var n, r, o;
  30750. r = [i(169)], void 0 === (o = "function" == typeof(n = function(t) {
  30751. "use strict";
  30752. var e = function(t, i, r) {
  30753. if (void 0 === t && (t = e.DEFAULT_CAPACITY), void 0 === i && (i = e.DEFAULT_ENDIAN), void 0 === r && (r = e.DEFAULT_NOASSERT), !r) {
  30754. if ((t |= 0) < 0) throw RangeError("Illegal capacity");
  30755. i = !!i, r = !!r
  30756. }
  30757. this.buffer = 0 === t ? n : new ArrayBuffer(t), this.view = 0 === t ? null : new Uint8Array(this.buffer), this.offset = 0, this.markedOffset = -1, this.limit = t, this.littleEndian = i, this.noAssert = r
  30758. };
  30759. e.VERSION = "5.0.1", e.LITTLE_ENDIAN = !0, e.BIG_ENDIAN = !1, e.DEFAULT_CAPACITY = 16, e.DEFAULT_ENDIAN = e.BIG_ENDIAN, e.DEFAULT_NOASSERT = !1, e.Long = t || null;
  30760. var i = e.prototype;
  30761. i.__isByteBuffer__, Object.defineProperty(i, "__isByteBuffer__", {
  30762. value: !0,
  30763. enumerable: !1,
  30764. configurable: !1
  30765. });
  30766. var n = new ArrayBuffer(0),
  30767. r = String.fromCharCode;
  30768. function o(t) {
  30769. var e = 0;
  30770. return function() {
  30771. return e < t.length ? t.charCodeAt(e++) : null
  30772. }
  30773. }
  30774. function a() {
  30775. var t = [],
  30776. e = [];
  30777. return function() {
  30778. if (0 === arguments.length) return e.join("") + r.apply(String, t);
  30779. t.length + arguments.length > 1024 && (e.push(r.apply(String, t)), t.length = 0), Array.prototype.push.apply(t, arguments)
  30780. }
  30781. }
  30782. function s(t, e, i, n, r) {
  30783. var o, a, s = 8 * r - n - 1,
  30784. l = (1 << s) - 1,
  30785. u = l >> 1,
  30786. h = -7,
  30787. c = i ? r - 1 : 0,
  30788. d = i ? -1 : 1,
  30789. p = t[e + c];
  30790. for (c += d, o = p & (1 << -h) - 1, p >>= -h, h += s; h > 0; o = 256 * o + t[e + c], c += d, h -= 8);
  30791. for (a = o & (1 << -h) - 1, o >>= -h, h += n; h > 0; a = 256 * a + t[e + c], c += d, h -= 8);
  30792. if (0 === o) o = 1 - u;
  30793. else {
  30794. if (o === l) return a ? NaN : 1 / 0 * (p ? -1 : 1);
  30795. a += Math.pow(2, n), o -= u
  30796. }
  30797. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30798. }
  30799. function l(t, e, i, n, r, o) {
  30800. var a, s, l, u = 8 * o - r - 1,
  30801. h = (1 << u) - 1,
  30802. c = h >> 1,
  30803. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  30804. p = n ? 0 : o - 1,
  30805. f = n ? 1 : -1,
  30806. m = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0;
  30807. for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (s = isNaN(e) ? 1 : 0, a = h) : (a = Math.floor(Math.log(e) / Math.LN2), e * (l = Math.pow(2, -a)) < 1 && (a--, l *= 2), (e += a + c >= 1 ? d / l : d * Math.pow(2, 1 - c)) * l >= 2 && (a++, l /= 2), a + c >= h ? (s = 0, a = h) : a + c >= 1 ? (s = (e * l - 1) * Math.pow(2, r), a += c) : (s = e * Math.pow(2, c - 1) * Math.pow(2, r), a = 0)); r >= 8; t[i + p] = 255 & s, p += f, s /= 256, r -= 8);
  30808. for (a = a << r | s, u += r; u > 0; t[i + p] = 255 & a, p += f, a /= 256, u -= 8);
  30809. t[i + p - f] |= 128 * m
  30810. }
  30811. e.accessor = function() {
  30812. return Uint8Array
  30813. }, e.allocate = function(t, i, n) {
  30814. return new e(t, i, n)
  30815. }, e.concat = function(t, i, n, r) {
  30816. "boolean" != typeof i && "string" == typeof i || (r = n, n = i, i = void 0);
  30817. for (var o, a = 0, s = 0, l = t.length; s < l; ++s) e.isByteBuffer(t[s]) || (t[s] = e.wrap(t[s], i)), (o = t[s].limit - t[s].offset) > 0 && (a += o);
  30818. if (0 === a) return new e(0, n, r);
  30819. var u, h = new e(a, n, r);
  30820. for (s = 0; s < l;)(o = (u = t[s++])
  30821. .limit - u.offset) <= 0 || (h.view.set(u.view.subarray(u.offset, u.limit), h.offset), h.offset += o);
  30822. return h.limit = h.offset, h.offset = 0, h
  30823. }, e.isByteBuffer = function(t) {
  30824. return !0 === (t && t.__isByteBuffer__)
  30825. }, e.type = function() {
  30826. return ArrayBuffer
  30827. }, e.wrap = function(t, n, r, o) {
  30828. if ("string" != typeof n && (o = r, r = n, n = void 0), "string" == typeof t) switch (void 0 === n && (n = "utf8"), n) {
  30829. case "base64":
  30830. return e.fromBase64(t, r);
  30831. case "hex":
  30832. return e.fromHex(t, r);
  30833. case "binary":
  30834. return e.fromBinary(t, r);
  30835. case "utf8":
  30836. return e.fromUTF8(t, r);
  30837. case "debug":
  30838. return e.fromDebug(t, r);
  30839. default:
  30840. throw Error("Unsupported encoding: " + n)
  30841. }
  30842. if (null === t || "object" != typeof t) throw TypeError("Illegal buffer");
  30843. var a;
  30844. if (e.isByteBuffer(t)) return (a = i.clone.call(t))
  30845. .markedOffset = -1, a;
  30846. if (t instanceof Uint8Array) a = new e(0, r, o), t.length > 0 && (a.buffer = t.buffer, a.offset = t.byteOffset, a.limit = t.byteOffset + t.byteLength, a.view = new Uint8Array(t.buffer));
  30847. else if (t instanceof ArrayBuffer) a = new e(0, r, o), t.byteLength > 0 && (a.buffer = t, a.offset = 0, a.limit = t.byteLength, a.view = t.byteLength > 0 ? new Uint8Array(t) : null);
  30848. else {
  30849. if ("[object Array]" !== Object.prototype.toString.call(t)) throw TypeError("Illegal buffer");
  30850. (a = new e(t.length, r, o))
  30851. .limit = t.length;
  30852. for (var s = 0; s < t.length; ++s) a.view[s] = t[s]
  30853. }
  30854. return a
  30855. }, i.writeBitSet = function(t, e) {
  30856. var i = void 0 === e;
  30857. if (i && (e = this.offset), !this.noAssert) {
  30858. if (!(t instanceof Array)) throw TypeError("Illegal BitSet: Not an array");
  30859. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  30860. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  30861. }
  30862. var n, r = e,
  30863. o = t.length,
  30864. a = o >> 3,
  30865. s = 0;
  30866. for (e += this.writeVarint32(o, e); a--;) n = 1 & !!t[s++] | (1 & !!t[s++]) << 1 | (1 & !!t[s++]) << 2 | (1 & !!t[s++]) << 3 | (1 & !!t[s++]) << 4 | (1 & !!t[s++]) << 5 | (1 & !!t[s++]) << 6 | (1 & !!t[s++]) << 7, this.writeByte(n, e++);
  30867. if (s < o) {
  30868. var l = 0;
  30869. for (n = 0; s < o;) n |= (1 & !!t[s++]) << l++;
  30870. this.writeByte(n, e++)
  30871. }
  30872. return i ? (this.offset = e, this) : e - r
  30873. }, i.readBitSet = function(t) {
  30874. var e = void 0 === t;
  30875. e && (t = this.offset);
  30876. var i, n = this.readVarint32(t),
  30877. r = n.value,
  30878. o = r >> 3,
  30879. a = 0,
  30880. s = [];
  30881. for (t += n.length; o--;) i = this.readByte(t++), s[a++] = !!(1 & i), s[a++] = !!(2 & i), s[a++] = !!(4 & i), s[a++] = !!(8 & i), s[a++] = !!(16 & i), s[a++] = !!(32 & i), s[a++] = !!(64 & i), s[a++] = !!(128 & i);
  30882. if (a < r) {
  30883. var l = 0;
  30884. for (i = this.readByte(t++); a < r;) s[a++] = !!(i >> l++ & 1)
  30885. }
  30886. return e && (this.offset = t), s
  30887. }, i.readBytes = function(t, e) {
  30888. var i = void 0 === e;
  30889. if (i && (e = this.offset), !this.noAssert) {
  30890. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  30891. if ((e >>>= 0) < 0 || e + t > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+" + t + ") <= " + this.buffer.byteLength)
  30892. }
  30893. var n = this.slice(e, e + t);
  30894. return i && (this.offset += t), n
  30895. }, i.writeBytes = i.append, i.writeInt8 = function(t, e) {
  30896. var i = void 0 === e;
  30897. if (i && (e = this.offset), !this.noAssert) {
  30898. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal value: " + t + " (not an integer)");
  30899. if (t |= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  30900. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  30901. }
  30902. e += 1;
  30903. var n = this.buffer.byteLength;
  30904. return e > n && this.resize((n *= 2) > e ? n : e), e -= 1, this.view[e] = t, i && (this.offset += 1), this
  30905. }, i.writeByte = i.writeInt8, i.readInt8 = function(t) {
  30906. var e = void 0 === t;
  30907. if (e && (t = this.offset), !this.noAssert) {
  30908. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  30909. if ((t >>>= 0) < 0 || t + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  30910. }
  30911. var i = this.view[t];
  30912. return 128 == (128 & i) && (i = -(255 - i + 1)), e && (this.offset += 1), i
  30913. }, i.readByte = i.readInt8, i.writeUint8 = function(t, e) {
  30914. var i = void 0 === e;
  30915. if (i && (e = this.offset), !this.noAssert) {
  30916. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal value: " + t + " (not an integer)");
  30917. if (t >>>= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  30918. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  30919. }
  30920. e += 1;
  30921. var n = this.buffer.byteLength;
  30922. return e > n && this.resize((n *= 2) > e ? n : e), e -= 1, this.view[e] = t, i && (this.offset += 1), this
  30923. }, i.writeUInt8 = i.writeUint8, i.readUint8 = function(t) {
  30924. var e = void 0 === t;
  30925. if (e && (t = this.offset), !this.noAssert) {
  30926. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  30927. if ((t >>>= 0) < 0 || t + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  30928. }
  30929. var i = this.view[t];
  30930. return e && (this.offset += 1), i
  30931. }, i.readUInt8 = i.readUint8, i.writeInt16 = function(t, e) {
  30932. var i = void 0 === e;
  30933. if (i && (e = this.offset), !this.noAssert) {
  30934. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal value: " + t + " (not an integer)");
  30935. if (t |= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  30936. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  30937. }
  30938. e += 2;
  30939. var n = this.buffer.byteLength;
  30940. return e > n && this.resize((n *= 2) > e ? n : e), e -= 2, this.littleEndian ? (this.view[e + 1] = (65280 & t) >>> 8, this.view[e] = 255 & t) : (this.view[e] = (65280 & t) >>> 8, this.view[e + 1] = 255 & t), i && (this.offset += 2), this
  30941. }, i.writeShort = i.writeInt16, i.readInt16 = function(t) {
  30942. var e = void 0 === t;
  30943. if (e && (t = this.offset), !this.noAssert) {
  30944. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  30945. if ((t >>>= 0) < 0 || t + 2 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+2) <= " + this.buffer.byteLength)
  30946. }
  30947. var i = 0;
  30948. return this.littleEndian ? (i = this.view[t], i |= this.view[t + 1] << 8) : (i = this.view[t] << 8, i |= this.view[t + 1]), 32768 == (32768 & i) && (i = -(65535 - i + 1)), e && (this.offset += 2), i
  30949. }, i.readShort = i.readInt16, i.writeUint16 = function(t, e) {
  30950. var i = void 0 === e;
  30951. if (i && (e = this.offset), !this.noAssert) {
  30952. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal value: " + t + " (not an integer)");
  30953. if (t >>>= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  30954. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  30955. }
  30956. e += 2;
  30957. var n = this.buffer.byteLength;
  30958. return e > n && this.resize((n *= 2) > e ? n : e), e -= 2, this.littleEndian ? (this.view[e + 1] = (65280 & t) >>> 8, this.view[e] = 255 & t) : (this.view[e] = (65280 & t) >>> 8, this.view[e + 1] = 255 & t), i && (this.offset += 2), this
  30959. }, i.writeUInt16 = i.writeUint16, i.readUint16 = function(t) {
  30960. var e = void 0 === t;
  30961. if (e && (t = this.offset), !this.noAssert) {
  30962. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  30963. if ((t >>>= 0) < 0 || t + 2 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+2) <= " + this.buffer.byteLength)
  30964. }
  30965. var i = 0;
  30966. return this.littleEndian ? (i = this.view[t], i |= this.view[t + 1] << 8) : (i = this.view[t] << 8, i |= this.view[t + 1]), e && (this.offset += 2), i
  30967. }, i.readUInt16 = i.readUint16, i.writeInt32 = function(t, e) {
  30968. var i = void 0 === e;
  30969. if (i && (e = this.offset), !this.noAssert) {
  30970. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal value: " + t + " (not an integer)");
  30971. if (t |= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  30972. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  30973. }
  30974. e += 4;
  30975. var n = this.buffer.byteLength;
  30976. return e > n && this.resize((n *= 2) > e ? n : e), e -= 4, this.littleEndian ? (this.view[e + 3] = t >>> 24 & 255, this.view[e + 2] = t >>> 16 & 255, this.view[e + 1] = t >>> 8 & 255, this.view[e] = 255 & t) : (this.view[e] = t >>> 24 & 255, this.view[e + 1] = t >>> 16 & 255, this.view[e + 2] = t >>> 8 & 255, this.view[e + 3] = 255 & t), i && (this.offset += 4), this
  30977. }, i.writeInt = i.writeInt32, i.readInt32 = function(t) {
  30978. var e = void 0 === t;
  30979. if (e && (t = this.offset), !this.noAssert) {
  30980. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  30981. if ((t >>>= 0) < 0 || t + 4 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+4) <= " + this.buffer.byteLength)
  30982. }
  30983. var i = 0;
  30984. return this.littleEndian ? (i = this.view[t + 2] << 16, i |= this.view[t + 1] << 8, i |= this.view[t], i += this.view[t + 3] << 24 >>> 0) : (i = this.view[t + 1] << 16, i |= this.view[t + 2] << 8, i |= this.view[t + 3], i += this.view[t] << 24 >>> 0), i |= 0, e && (this.offset += 4), i
  30985. }, i.readInt = i.readInt32, i.writeUint32 = function(t, e) {
  30986. var i = void 0 === e;
  30987. if (i && (e = this.offset), !this.noAssert) {
  30988. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal value: " + t + " (not an integer)");
  30989. if (t >>>= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  30990. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  30991. }
  30992. e += 4;
  30993. var n = this.buffer.byteLength;
  30994. return e > n && this.resize((n *= 2) > e ? n : e), e -= 4, this.littleEndian ? (this.view[e + 3] = t >>> 24 & 255, this.view[e + 2] = t >>> 16 & 255, this.view[e + 1] = t >>> 8 & 255, this.view[e] = 255 & t) : (this.view[e] = t >>> 24 & 255, this.view[e + 1] = t >>> 16 & 255, this.view[e + 2] = t >>> 8 & 255, this.view[e + 3] = 255 & t), i && (this.offset += 4), this
  30995. }, i.writeUInt32 = i.writeUint32, i.readUint32 = function(t) {
  30996. var e = void 0 === t;
  30997. if (e && (t = this.offset), !this.noAssert) {
  30998. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  30999. if ((t >>>= 0) < 0 || t + 4 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+4) <= " + this.buffer.byteLength)
  31000. }
  31001. var i = 0;
  31002. return this.littleEndian ? (i = this.view[t + 2] << 16, i |= this.view[t + 1] << 8, i |= this.view[t], i += this.view[t + 3] << 24 >>> 0) : (i = this.view[t + 1] << 16, i |= this.view[t + 2] << 8, i |= this.view[t + 3], i += this.view[t] << 24 >>> 0), e && (this.offset += 4), i
  31003. }, i.readUInt32 = i.readUint32, t && (i.writeInt64 = function(e, i) {
  31004. var n = void 0 === i;
  31005. if (n && (i = this.offset), !this.noAssert) {
  31006. if ("number" == typeof e) e = t.fromNumber(e);
  31007. else if ("string" == typeof e) e = t.fromString(e);
  31008. else if (!(e && e instanceof t)) throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  31009. if ("number" != typeof i || i % 1 != 0) throw TypeError("Illegal offset: " + i + " (not an integer)");
  31010. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  31011. }
  31012. "number" == typeof e ? e = t.fromNumber(e) : "string" == typeof e && (e = t.fromString(e)), i += 8;
  31013. var r = this.buffer.byteLength;
  31014. i > r && this.resize((r *= 2) > i ? r : i), i -= 8;
  31015. var o = e.low,
  31016. a = e.high;
  31017. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255, this.view[i + 2] = o >>> 16 & 255, this.view[i + 1] = o >>> 8 & 255, this.view[i] = 255 & o, i += 4, this.view[i + 3] = a >>> 24 & 255, this.view[i + 2] = a >>> 16 & 255, this.view[i + 1] = a >>> 8 & 255, this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255, this.view[i + 1] = a >>> 16 & 255, this.view[i + 2] = a >>> 8 & 255, this.view[i + 3] = 255 & a, i += 4, this.view[i] = o >>> 24 & 255, this.view[i + 1] = o >>> 16 & 255, this.view[i + 2] = o >>> 8 & 255, this.view[i + 3] = 255 & o), n && (this.offset += 8), this
  31018. }, i.writeLong = i.writeInt64, i.readInt64 = function(e) {
  31019. var i = void 0 === e;
  31020. if (i && (e = this.offset), !this.noAssert) {
  31021. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  31022. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  31023. }
  31024. var n = 0,
  31025. r = 0;
  31026. this.littleEndian ? (n = this.view[e + 2] << 16, n |= this.view[e + 1] << 8, n |= this.view[e], n += this.view[e + 3] << 24 >>> 0, e += 4, r = this.view[e + 2] << 16, r |= this.view[e + 1] << 8, r |= this.view[e], r += this.view[e + 3] << 24 >>> 0) : (r = this.view[e + 1] << 16, r |= this.view[e + 2] << 8, r |= this.view[e + 3], r += this.view[e] << 24 >>> 0, e += 4, n = this.view[e + 1] << 16, n |= this.view[e + 2] << 8, n |= this.view[e + 3], n += this.view[e] << 24 >>> 0);
  31027. var o = new t(n, r, !1);
  31028. return i && (this.offset += 8), o
  31029. }, i.readLong = i.readInt64, i.writeUint64 = function(e, i) {
  31030. var n = void 0 === i;
  31031. if (n && (i = this.offset), !this.noAssert) {
  31032. if ("number" == typeof e) e = t.fromNumber(e);
  31033. else if ("string" == typeof e) e = t.fromString(e);
  31034. else if (!(e && e instanceof t)) throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  31035. if ("number" != typeof i || i % 1 != 0) throw TypeError("Illegal offset: " + i + " (not an integer)");
  31036. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  31037. }
  31038. "number" == typeof e ? e = t.fromNumber(e) : "string" == typeof e && (e = t.fromString(e)), i += 8;
  31039. var r = this.buffer.byteLength;
  31040. i > r && this.resize((r *= 2) > i ? r : i), i -= 8;
  31041. var o = e.low,
  31042. a = e.high;
  31043. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255, this.view[i + 2] = o >>> 16 & 255, this.view[i + 1] = o >>> 8 & 255, this.view[i] = 255 & o, i += 4, this.view[i + 3] = a >>> 24 & 255, this.view[i + 2] = a >>> 16 & 255, this.view[i + 1] = a >>> 8 & 255, this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255, this.view[i + 1] = a >>> 16 & 255, this.view[i + 2] = a >>> 8 & 255, this.view[i + 3] = 255 & a, i += 4, this.view[i] = o >>> 24 & 255, this.view[i + 1] = o >>> 16 & 255, this.view[i + 2] = o >>> 8 & 255, this.view[i + 3] = 255 & o), n && (this.offset += 8), this
  31044. }, i.writeUInt64 = i.writeUint64, i.readUint64 = function(e) {
  31045. var i = void 0 === e;
  31046. if (i && (e = this.offset), !this.noAssert) {
  31047. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  31048. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  31049. }
  31050. var n = 0,
  31051. r = 0;
  31052. this.littleEndian ? (n = this.view[e + 2] << 16, n |= this.view[e + 1] << 8, n |= this.view[e], n += this.view[e + 3] << 24 >>> 0, e += 4, r = this.view[e + 2] << 16, r |= this.view[e + 1] << 8, r |= this.view[e], r += this.view[e + 3] << 24 >>> 0) : (r = this.view[e + 1] << 16, r |= this.view[e + 2] << 8, r |= this.view[e + 3], r += this.view[e] << 24 >>> 0, e += 4, n = this.view[e + 1] << 16, n |= this.view[e + 2] << 8, n |= this.view[e + 3], n += this.view[e] << 24 >>> 0);
  31053. var o = new t(n, r, !0);
  31054. return i && (this.offset += 8), o
  31055. }, i.readUInt64 = i.readUint64), i.writeFloat32 = function(t, e) {
  31056. var i = void 0 === e;
  31057. if (i && (e = this.offset), !this.noAssert) {
  31058. if ("number" != typeof t) throw TypeError("Illegal value: " + t + " (not a number)");
  31059. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  31060. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  31061. }
  31062. e += 4;
  31063. var n = this.buffer.byteLength;
  31064. return e > n && this.resize((n *= 2) > e ? n : e), e -= 4, l(this.view, t, e, this.littleEndian, 23, 4), i && (this.offset += 4), this
  31065. }, i.writeFloat = i.writeFloat32, i.readFloat32 = function(t) {
  31066. var e = void 0 === t;
  31067. if (e && (t = this.offset), !this.noAssert) {
  31068. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  31069. if ((t >>>= 0) < 0 || t + 4 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+4) <= " + this.buffer.byteLength)
  31070. }
  31071. var i = s(this.view, t, this.littleEndian, 23, 4);
  31072. return e && (this.offset += 4), i
  31073. }, i.readFloat = i.readFloat32, i.writeFloat64 = function(t, e) {
  31074. var i = void 0 === e;
  31075. if (i && (e = this.offset), !this.noAssert) {
  31076. if ("number" != typeof t) throw TypeError("Illegal value: " + t + " (not a number)");
  31077. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  31078. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  31079. }
  31080. e += 8;
  31081. var n = this.buffer.byteLength;
  31082. return e > n && this.resize((n *= 2) > e ? n : e), e -= 8, l(this.view, t, e, this.littleEndian, 52, 8), i && (this.offset += 8), this
  31083. }, i.writeDouble = i.writeFloat64, i.readFloat64 = function(t) {
  31084. var e = void 0 === t;
  31085. if (e && (t = this.offset), !this.noAssert) {
  31086. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  31087. if ((t >>>= 0) < 0 || t + 8 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  31088. }
  31089. var i = s(this.view, t, this.littleEndian, 52, 8);
  31090. return e && (this.offset += 8), i
  31091. }, i.readDouble = i.readFloat64, e.MAX_VARINT32_BYTES = 5, e.calculateVarint32 = function(t) {
  31092. return (t >>>= 0) < 128 ? 1 : t < 16384 ? 2 : t < 1 << 21 ? 3 : t < 1 << 28 ? 4 : 5
  31093. }, e.zigZagEncode32 = function(t) {
  31094. return ((t |= 0) << 1 ^ t >> 31) >>> 0
  31095. }, e.zigZagDecode32 = function(t) {
  31096. return t >>> 1 ^ -(1 & t) | 0
  31097. }, i.writeVarint32 = function(t, i) {
  31098. var n = void 0 === i;
  31099. if (n && (i = this.offset), !this.noAssert) {
  31100. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal value: " + t + " (not an integer)");
  31101. if (t |= 0, "number" != typeof i || i % 1 != 0) throw TypeError("Illegal offset: " + i + " (not an integer)");
  31102. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  31103. }
  31104. var r, o = e.calculateVarint32(t);
  31105. i += o;
  31106. var a = this.buffer.byteLength;
  31107. for (i > a && this.resize((a *= 2) > i ? a : i), i -= o, t >>>= 0; t >= 128;) r = 127 & t | 128, this.view[i++] = r, t >>>= 7;
  31108. return this.view[i++] = t, n ? (this.offset = i, this) : o
  31109. }, i.writeVarint32ZigZag = function(t, i) {
  31110. return this.writeVarint32(e.zigZagEncode32(t), i)
  31111. }, i.readVarint32 = function(t) {
  31112. var e = void 0 === t;
  31113. if (e && (t = this.offset), !this.noAssert) {
  31114. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  31115. if ((t >>>= 0) < 0 || t + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  31116. }
  31117. var i, n = 0,
  31118. r = 0;
  31119. do {
  31120. if (!this.noAssert && t > this.limit) {
  31121. var o = Error("Truncated");
  31122. throw o.truncated = !0, o
  31123. }
  31124. i = this.view[t++], n < 5 && (r |= (127 & i) << 7 * n), ++n
  31125. } while (0 != (128 & i));
  31126. return r |= 0, e ? (this.offset = t, r) : {
  31127. value: r,
  31128. length: n
  31129. }
  31130. }, i.readVarint32ZigZag = function(t) {
  31131. var i = this.readVarint32(t);
  31132. return "object" == typeof i ? i.value = e.zigZagDecode32(i.value) : i = e.zigZagDecode32(i), i
  31133. }, t && (e.MAX_VARINT64_BYTES = 10, e.calculateVarint64 = function(e) {
  31134. "number" == typeof e ? e = t.fromNumber(e) : "string" == typeof e && (e = t.fromString(e));
  31135. var i = e.toInt() >>> 0,
  31136. n = e.shiftRightUnsigned(28)
  31137. .toInt() >>> 0,
  31138. r = e.shiftRightUnsigned(56)
  31139. .toInt() >>> 0;
  31140. return 0 == r ? 0 == n ? i < 16384 ? i < 128 ? 1 : 2 : i < 1 << 21 ? 3 : 4 : n < 16384 ? n < 128 ? 5 : 6 : n < 1 << 21 ? 7 : 8 : r < 128 ? 9 : 10
  31141. }, e.zigZagEncode64 = function(e) {
  31142. return "number" == typeof e ? e = t.fromNumber(e, !1) : "string" == typeof e ? e = t.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()), e.shiftLeft(1)
  31143. .xor(e.shiftRight(63))
  31144. .toUnsigned()
  31145. }, e.zigZagDecode64 = function(e) {
  31146. return "number" == typeof e ? e = t.fromNumber(e, !1) : "string" == typeof e ? e = t.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()), e.shiftRightUnsigned(1)
  31147. .xor(e.and(t.ONE)
  31148. .toSigned()
  31149. .negate())
  31150. .toSigned()
  31151. }, i.writeVarint64 = function(i, n) {
  31152. var r = void 0 === n;
  31153. if (r && (n = this.offset), !this.noAssert) {
  31154. if ("number" == typeof i) i = t.fromNumber(i);
  31155. else if ("string" == typeof i) i = t.fromString(i);
  31156. else if (!(i && i instanceof t)) throw TypeError("Illegal value: " + i + " (not an integer or Long)");
  31157. if ("number" != typeof n || n % 1 != 0) throw TypeError("Illegal offset: " + n + " (not an integer)");
  31158. if ((n >>>= 0) < 0 || n + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  31159. }
  31160. "number" == typeof i ? i = t.fromNumber(i, !1) : "string" == typeof i ? i = t.fromString(i, !1) : !1 !== i.unsigned && (i = i.toSigned());
  31161. var o = e.calculateVarint64(i),
  31162. a = i.toInt() >>> 0,
  31163. s = i.shiftRightUnsigned(28)
  31164. .toInt() >>> 0,
  31165. l = i.shiftRightUnsigned(56)
  31166. .toInt() >>> 0;
  31167. n += o;
  31168. var u = this.buffer.byteLength;
  31169. switch (n > u && this.resize((u *= 2) > n ? u : n), n -= o, o) {
  31170. case 10:
  31171. this.view[n + 9] = l >>> 7 & 1;
  31172. case 9:
  31173. this.view[n + 8] = 9 !== o ? 128 | l : 127 & l;
  31174. case 8:
  31175. this.view[n + 7] = 8 !== o ? s >>> 21 | 128 : s >>> 21 & 127;
  31176. case 7:
  31177. this.view[n + 6] = 7 !== o ? s >>> 14 | 128 : s >>> 14 & 127;
  31178. case 6:
  31179. this.view[n + 5] = 6 !== o ? s >>> 7 | 128 : s >>> 7 & 127;
  31180. case 5:
  31181. this.view[n + 4] = 5 !== o ? 128 | s : 127 & s;
  31182. case 4:
  31183. this.view[n + 3] = 4 !== o ? a >>> 21 | 128 : a >>> 21 & 127;
  31184. case 3:
  31185. this.view[n + 2] = 3 !== o ? a >>> 14 | 128 : a >>> 14 & 127;
  31186. case 2:
  31187. this.view[n + 1] = 2 !== o ? a >>> 7 | 128 : a >>> 7 & 127;
  31188. case 1:
  31189. this.view[n] = 1 !== o ? 128 | a : 127 & a
  31190. }
  31191. return r ? (this.offset += o, this) : o
  31192. }, i.writeVarint64ZigZag = function(t, i) {
  31193. return this.writeVarint64(e.zigZagEncode64(t), i)
  31194. }, i.readVarint64 = function(e) {
  31195. var i = void 0 === e;
  31196. if (i && (e = this.offset), !this.noAssert) {
  31197. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  31198. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  31199. }
  31200. var n = e,
  31201. r = 0,
  31202. o = 0,
  31203. a = 0,
  31204. s = 0;
  31205. if (r = 127 & (s = this.view[e++]), 128 & s && (r |= (127 & (s = this.view[e++])) << 7, (128 & s || this.noAssert && void 0 === s) && (r |= (127 & (s = this.view[e++])) << 14, (128 & s || this.noAssert && void 0 === s) && (r |= (127 & (s = this.view[e++])) << 21, (128 & s || this.noAssert && void 0 === s) && (o = 127 & (s = this.view[e++]), (128 & s || this.noAssert && void 0 === s) && (o |= (127 & (s = this.view[e++])) << 7, (128 & s || this.noAssert && void 0 === s) && (o |= (127 & (s = this.view[e++])) << 14, (128 & s || this.noAssert && void 0 === s) && (o |= (127 & (s = this.view[e++])) << 21, (128 & s || this.noAssert && void 0 === s) && (a = 127 & (s = this.view[e++]), (128 & s || this.noAssert && void 0 === s) && (a |= (127 & (s = this.view[e++])) << 7, 128 & s || this.noAssert && void 0 === s)))))))))) throw Error("Buffer overrun");
  31206. var l = t.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  31207. return i ? (this.offset = e, l) : {
  31208. value: l,
  31209. length: e - n
  31210. }
  31211. }, i.readVarint64ZigZag = function(i) {
  31212. var n = this.readVarint64(i);
  31213. return n && n.value instanceof t ? n.value = e.zigZagDecode64(n.value) : n = e.zigZagDecode64(n), n
  31214. }), i.writeCString = function(t, e) {
  31215. var i = void 0 === e;
  31216. i && (e = this.offset);
  31217. var n, r = t.length;
  31218. if (!this.noAssert) {
  31219. if ("string" != typeof t) throw TypeError("Illegal str: Not a string");
  31220. for (n = 0; n < r; ++n)
  31221. if (0 === t.charCodeAt(n)) throw RangeError("Illegal str: Contains NULL-characters");
  31222. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  31223. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  31224. }
  31225. r = h.calculateUTF16asUTF8(o(t))[1], e += r + 1;
  31226. var a = this.buffer.byteLength;
  31227. return e > a && this.resize((a *= 2) > e ? a : e), e -= r + 1, h.encodeUTF16toUTF8(o(t), function(t) {
  31228. this.view[e++] = t
  31229. }.bind(this)), this.view[e++] = 0, i ? (this.offset = e, this) : r
  31230. }, i.readCString = function(t) {
  31231. var e = void 0 === t;
  31232. if (e && (t = this.offset), !this.noAssert) {
  31233. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  31234. if ((t >>>= 0) < 0 || t + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  31235. }
  31236. var i, n = t,
  31237. r = -1;
  31238. return h.decodeUTF8toUTF16(function() {
  31239. if (0 === r) return null;
  31240. if (t >= this.limit) throw RangeError("Illegal range: Truncated data, " + t + " < " + this.limit);
  31241. return 0 === (r = this.view[t++]) ? null : r
  31242. }.bind(this), i = a(), !0), e ? (this.offset = t, i()) : {
  31243. string: i(),
  31244. length: t - n
  31245. }
  31246. }, i.writeIString = function(t, e) {
  31247. var i = void 0 === e;
  31248. if (i && (e = this.offset), !this.noAssert) {
  31249. if ("string" != typeof t) throw TypeError("Illegal str: Not a string");
  31250. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  31251. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  31252. }
  31253. var n, r = e;
  31254. n = h.calculateUTF16asUTF8(o(t), this.noAssert)[1], e += 4 + n;
  31255. var a = this.buffer.byteLength;
  31256. if (e > a && this.resize((a *= 2) > e ? a : e), e -= 4 + n, this.littleEndian ? (this.view[e + 3] = n >>> 24 & 255, this.view[e + 2] = n >>> 16 & 255, this.view[e + 1] = n >>> 8 & 255, this.view[e] = 255 & n) : (this.view[e] = n >>> 24 & 255, this.view[e + 1] = n >>> 16 & 255, this.view[e + 2] = n >>> 8 & 255, this.view[e + 3] = 255 & n), e += 4, h.encodeUTF16toUTF8(o(t), function(t) {
  31257. this.view[e++] = t
  31258. }.bind(this)), e !== r + 4 + n) throw RangeError("Illegal range: Truncated data, " + e + " == " + (e + 4 + n));
  31259. return i ? (this.offset = e, this) : e - r
  31260. }, i.readIString = function(t) {
  31261. var i = void 0 === t;
  31262. if (i && (t = this.offset), !this.noAssert) {
  31263. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  31264. if ((t >>>= 0) < 0 || t + 4 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+4) <= " + this.buffer.byteLength)
  31265. }
  31266. var n = t,
  31267. r = this.readUint32(t),
  31268. o = this.readUTF8String(r, e.METRICS_BYTES, t += 4);
  31269. return t += o.length, i ? (this.offset = t, o.string) : {
  31270. string: o.string,
  31271. length: t - n
  31272. }
  31273. }, e.METRICS_CHARS = "c", e.METRICS_BYTES = "b", i.writeUTF8String = function(t, e) {
  31274. var i, n = void 0 === e;
  31275. if (n && (e = this.offset), !this.noAssert) {
  31276. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: " + e + " (not an integer)");
  31277. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  31278. }
  31279. var r = e;
  31280. i = h.calculateUTF16asUTF8(o(t))[1], e += i;
  31281. var a = this.buffer.byteLength;
  31282. return e > a && this.resize((a *= 2) > e ? a : e), e -= i, h.encodeUTF16toUTF8(o(t), function(t) {
  31283. this.view[e++] = t
  31284. }.bind(this)), n ? (this.offset = e, this) : e - r
  31285. }, i.writeString = i.writeUTF8String, e.calculateUTF8Chars = function(t) {
  31286. return h.calculateUTF16asUTF8(o(t))[0]
  31287. }, e.calculateUTF8Bytes = function(t) {
  31288. return h.calculateUTF16asUTF8(o(t))[1]
  31289. }, e.calculateString = e.calculateUTF8Bytes, i.readUTF8String = function(t, i, n) {
  31290. "number" == typeof i && (n = i, i = void 0);
  31291. var r = void 0 === n;
  31292. if (r && (n = this.offset), void 0 === i && (i = e.METRICS_CHARS), !this.noAssert) {
  31293. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal length: " + t + " (not an integer)");
  31294. if (t |= 0, "number" != typeof n || n % 1 != 0) throw TypeError("Illegal offset: " + n + " (not an integer)");
  31295. if ((n >>>= 0) < 0 || n + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  31296. }
  31297. var o, s = 0,
  31298. l = n;
  31299. if (i === e.METRICS_CHARS) {
  31300. if (o = a(), h.decodeUTF8(function() {
  31301. return s < t && n < this.limit ? this.view[n++] : null
  31302. }.bind(this), (function(t) {
  31303. ++s, h.UTF8toUTF16(t, o)
  31304. })), s !== t) throw RangeError("Illegal range: Truncated data, " + s + " == " + t);
  31305. return r ? (this.offset = n, o()) : {
  31306. string: o(),
  31307. length: n - l
  31308. }
  31309. }
  31310. if (i === e.METRICS_BYTES) {
  31311. if (!this.noAssert) {
  31312. if ("number" != typeof n || n % 1 != 0) throw TypeError("Illegal offset: " + n + " (not an integer)");
  31313. if ((n >>>= 0) < 0 || n + t > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + n + " (+" + t + ") <= " + this.buffer.byteLength)
  31314. }
  31315. var u = n + t;
  31316. if (h.decodeUTF8toUTF16(function() {
  31317. return n < u ? this.view[n++] : null
  31318. }.bind(this), o = a(), this.noAssert), n !== u) throw RangeError("Illegal range: Truncated data, " + n + " == " + u);
  31319. return r ? (this.offset = n, o()) : {
  31320. string: o(),
  31321. length: n - l
  31322. }
  31323. }
  31324. throw TypeError("Unsupported metrics: " + i)
  31325. }, i.readString = i.readUTF8String, i.writeVString = function(t, i) {
  31326. var n = void 0 === i;
  31327. if (n && (i = this.offset), !this.noAssert) {
  31328. if ("string" != typeof t) throw TypeError("Illegal str: Not a string");
  31329. if ("number" != typeof i || i % 1 != 0) throw TypeError("Illegal offset: " + i + " (not an integer)");
  31330. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  31331. }
  31332. var r, a, s = i;
  31333. r = h.calculateUTF16asUTF8(o(t), this.noAssert)[1], a = e.calculateVarint32(r), i += a + r;
  31334. var l = this.buffer.byteLength;
  31335. if (i > l && this.resize((l *= 2) > i ? l : i), i -= a + r, i += this.writeVarint32(r, i), h.encodeUTF16toUTF8(o(t), function(t) {
  31336. this.view[i++] = t
  31337. }.bind(this)), i !== s + r + a) throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  31338. return n ? (this.offset = i, this) : i - s
  31339. }, i.readVString = function(t) {
  31340. var i = void 0 === t;
  31341. if (i && (t = this.offset), !this.noAssert) {
  31342. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  31343. if ((t >>>= 0) < 0 || t + 1 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  31344. }
  31345. var n = t,
  31346. r = this.readVarint32(t),
  31347. o = this.readUTF8String(r.value, e.METRICS_BYTES, t += r.length);
  31348. return t += o.length, i ? (this.offset = t, o.string) : {
  31349. string: o.string,
  31350. length: t - n
  31351. }
  31352. }, i.append = function(t, i, n) {
  31353. "number" != typeof i && "string" == typeof i || (n = i, i = void 0);
  31354. var r = void 0 === n;
  31355. if (r && (n = this.offset), !this.noAssert) {
  31356. if ("number" != typeof n || n % 1 != 0) throw TypeError("Illegal offset: " + n + " (not an integer)");
  31357. if ((n >>>= 0) < 0 || n + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  31358. }
  31359. t instanceof e || (t = e.wrap(t, i));
  31360. var o = t.limit - t.offset;
  31361. if (o <= 0) return this;
  31362. n += o;
  31363. var a = this.buffer.byteLength;
  31364. return n > a && this.resize((a *= 2) > n ? a : n), n -= o, this.view.set(t.view.subarray(t.offset, t.limit), n), t.offset += o, r && (this.offset += o), this
  31365. }, i.appendTo = function(t, e) {
  31366. return t.append(this, e), this
  31367. }, i.assert = function(t) {
  31368. return this.noAssert = !t, this
  31369. }, i.capacity = function() {
  31370. return this.buffer.byteLength
  31371. }, i.clear = function() {
  31372. return this.offset = 0, this.limit = this.buffer.byteLength, this.markedOffset = -1, this
  31373. }, i.clone = function(t) {
  31374. var i = new e(0, this.littleEndian, this.noAssert);
  31375. return t ? (i.buffer = new ArrayBuffer(this.buffer.byteLength), i.view = new Uint8Array(i.buffer)) : (i.buffer = this.buffer, i.view = this.view), i.offset = this.offset, i.markedOffset = this.markedOffset, i.limit = this.limit, i
  31376. }, i.compact = function(t, e) {
  31377. if (void 0 === t && (t = this.offset), void 0 === e && (e = this.limit), !this.noAssert) {
  31378. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal begin: Not an integer");
  31379. if (t >>>= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal end: Not an integer");
  31380. if (e >>>= 0, t < 0 || t > e || e > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + t + " <= " + e + " <= " + this.buffer.byteLength)
  31381. }
  31382. if (0 === t && e === this.buffer.byteLength) return this;
  31383. var i = e - t;
  31384. if (0 === i) return this.buffer = n, this.view = null, this.markedOffset >= 0 && (this.markedOffset -= t), this.offset = 0, this.limit = 0, this;
  31385. var r = new ArrayBuffer(i),
  31386. o = new Uint8Array(r);
  31387. return o.set(this.view.subarray(t, e)), this.buffer = r, this.view = o, this.markedOffset >= 0 && (this.markedOffset -= t), this.offset = 0, this.limit = i, this
  31388. }, i.copy = function(t, i) {
  31389. if (void 0 === t && (t = this.offset), void 0 === i && (i = this.limit), !this.noAssert) {
  31390. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal begin: Not an integer");
  31391. if (t >>>= 0, "number" != typeof i || i % 1 != 0) throw TypeError("Illegal end: Not an integer");
  31392. if (i >>>= 0, t < 0 || t > i || i > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  31393. }
  31394. if (t === i) return new e(0, this.littleEndian, this.noAssert);
  31395. var n = i - t,
  31396. r = new e(n, this.littleEndian, this.noAssert);
  31397. return r.offset = 0, r.limit = n, r.markedOffset >= 0 && (r.markedOffset -= t), this.copyTo(r, 0, t, i), r
  31398. }, i.copyTo = function(t, i, n, r) {
  31399. var o, a;
  31400. if (!this.noAssert && !e.isByteBuffer(t)) throw TypeError("Illegal target: Not a ByteBuffer");
  31401. if (i = (a = void 0 === i) ? t.offset : 0 | i, n = (o = void 0 === n) ? this.offset : 0 | n, r = void 0 === r ? this.limit : 0 | r, i < 0 || i > t.buffer.byteLength) throw RangeError("Illegal target range: 0 <= " + i + " <= " + t.buffer.byteLength);
  31402. if (n < 0 || r > this.buffer.byteLength) throw RangeError("Illegal source range: 0 <= " + n + " <= " + this.buffer.byteLength);
  31403. var s = r - n;
  31404. return 0 === s ? t : (t.ensureCapacity(i + s), t.view.set(this.view.subarray(n, r), i), o && (this.offset += s), a && (t.offset += s), this)
  31405. }, i.ensureCapacity = function(t) {
  31406. var e = this.buffer.byteLength;
  31407. return e < t ? this.resize((e *= 2) > t ? e : t) : this
  31408. }, i.fill = function(t, e, i) {
  31409. var n = void 0 === e;
  31410. if (n && (e = this.offset), "string" == typeof t && t.length > 0 && (t = t.charCodeAt(0)), void 0 === e && (e = this.offset), void 0 === i && (i = this.limit), !this.noAssert) {
  31411. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal value: " + t + " (not an integer)");
  31412. if (t |= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal begin: Not an integer");
  31413. if (e >>>= 0, "number" != typeof i || i % 1 != 0) throw TypeError("Illegal end: Not an integer");
  31414. if (i >>>= 0, e < 0 || e > i || i > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + e + " <= " + i + " <= " + this.buffer.byteLength)
  31415. }
  31416. if (e >= i) return this;
  31417. for (; e < i;) this.view[e++] = t;
  31418. return n && (this.offset = e), this
  31419. }, i.flip = function() {
  31420. return this.limit = this.offset, this.offset = 0, this
  31421. }, i.mark = function(t) {
  31422. if (t = void 0 === t ? this.offset : t, !this.noAssert) {
  31423. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal offset: " + t + " (not an integer)");
  31424. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  31425. }
  31426. return this.markedOffset = t, this
  31427. }, i.order = function(t) {
  31428. if (!this.noAssert && "boolean" != typeof t) throw TypeError("Illegal littleEndian: Not a boolean");
  31429. return this.littleEndian = !!t, this
  31430. }, i.LE = function(t) {
  31431. return this.littleEndian = void 0 === t || !!t, this
  31432. }, i.BE = function(t) {
  31433. return this.littleEndian = void 0 !== t && !t, this
  31434. }, i.prepend = function(t, i, n) {
  31435. "number" != typeof i && "string" == typeof i || (n = i, i = void 0);
  31436. var r = void 0 === n;
  31437. if (r && (n = this.offset), !this.noAssert) {
  31438. if ("number" != typeof n || n % 1 != 0) throw TypeError("Illegal offset: " + n + " (not an integer)");
  31439. if ((n >>>= 0) < 0 || n + 0 > this.buffer.byteLength) throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  31440. }
  31441. t instanceof e || (t = e.wrap(t, i));
  31442. var o = t.limit - t.offset;
  31443. if (o <= 0) return this;
  31444. var a = o - n;
  31445. if (a > 0) {
  31446. var s = new ArrayBuffer(this.buffer.byteLength + a),
  31447. l = new Uint8Array(s);
  31448. l.set(this.view.subarray(n, this.buffer.byteLength), o), this.buffer = s, this.view = l, this.offset += a, this.markedOffset >= 0 && (this.markedOffset += a), this.limit += a, n += a
  31449. } else new Uint8Array(this.buffer);
  31450. return this.view.set(t.view.subarray(t.offset, t.limit), n - o), t.offset = t.limit, r && (this.offset -= o), this
  31451. }, i.prependTo = function(t, e) {
  31452. return t.prepend(this, e), this
  31453. }, i.printDebug = function(t) {
  31454. "function" != typeof t && (t = void 0), t(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  31455. }, i.remaining = function() {
  31456. return this.limit - this.offset
  31457. }, i.reset = function() {
  31458. return this.markedOffset >= 0 ? (this.offset = this.markedOffset, this.markedOffset = -1) : this.offset = 0, this
  31459. }, i.resize = function(t) {
  31460. if (!this.noAssert) {
  31461. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal capacity: " + t + " (not an integer)");
  31462. if ((t |= 0) < 0) throw RangeError("Illegal capacity: 0 <= " + t)
  31463. }
  31464. if (this.buffer.byteLength < t) {
  31465. var e = new ArrayBuffer(t),
  31466. i = new Uint8Array(e);
  31467. i.set(this.view), this.buffer = e, this.view = i
  31468. }
  31469. return this
  31470. }, i.reverse = function(t, e) {
  31471. if (void 0 === t && (t = this.offset), void 0 === e && (e = this.limit), !this.noAssert) {
  31472. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal begin: Not an integer");
  31473. if (t >>>= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal end: Not an integer");
  31474. if (e >>>= 0, t < 0 || t > e || e > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + t + " <= " + e + " <= " + this.buffer.byteLength)
  31475. }
  31476. return t === e || Array.prototype.reverse.call(this.view.subarray(t, e)), this
  31477. }, i.skip = function(t) {
  31478. if (!this.noAssert) {
  31479. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal length: " + t + " (not an integer)");
  31480. t |= 0
  31481. }
  31482. var e = this.offset + t;
  31483. if (!this.noAssert && (e < 0 || e > this.buffer.byteLength)) throw RangeError("Illegal length: 0 <= " + this.offset + " + " + t + " <= " + this.buffer.byteLength);
  31484. return this.offset = e, this
  31485. }, i.slice = function(t, e) {
  31486. if (void 0 === t && (t = this.offset), void 0 === e && (e = this.limit), !this.noAssert) {
  31487. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal begin: Not an integer");
  31488. if (t >>>= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal end: Not an integer");
  31489. if (e >>>= 0, t < 0 || t > e || e > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + t + " <= " + e + " <= " + this.buffer.byteLength)
  31490. }
  31491. var i = this.clone();
  31492. return i.offset = t, i.limit = e, i
  31493. }, i.toBuffer = function(t) {
  31494. var e = this.offset,
  31495. i = this.limit;
  31496. if (!this.noAssert) {
  31497. if ("number" != typeof e || e % 1 != 0) throw TypeError("Illegal offset: Not an integer");
  31498. if (e >>>= 0, "number" != typeof i || i % 1 != 0) throw TypeError("Illegal limit: Not an integer");
  31499. if (i >>>= 0, e < 0 || e > i || i > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + e + " <= " + i + " <= " + this.buffer.byteLength)
  31500. }
  31501. if (!t && 0 === e && i === this.buffer.byteLength) return this.buffer;
  31502. if (e === i) return n;
  31503. var r = new ArrayBuffer(i - e);
  31504. return new Uint8Array(r)
  31505. .set(new Uint8Array(this.buffer)
  31506. .subarray(e, i), 0), r
  31507. }, i.toArrayBuffer = i.toBuffer, i.toString = function(t, e, i) {
  31508. if (void 0 === t) return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  31509. switch ("number" == typeof t && (i = e = t = "utf8"), t) {
  31510. case "utf8":
  31511. return this.toUTF8(e, i);
  31512. case "base64":
  31513. return this.toBase64(e, i);
  31514. case "hex":
  31515. return this.toHex(e, i);
  31516. case "binary":
  31517. return this.toBinary(e, i);
  31518. case "debug":
  31519. return this.toDebug();
  31520. case "columns":
  31521. return this.toColumns();
  31522. default:
  31523. throw Error("Unsupported encoding: " + t)
  31524. }
  31525. };
  31526. var u = function() {
  31527. for (var t = {}, e = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47], i = [], n = 0, r = e.length; n < r; ++n) i[e[n]] = n;
  31528. return t.encode = function(t, i) {
  31529. for (var n, r; null !== (n = t());) i(e[n >> 2 & 63]), r = (3 & n) << 4, null !== (n = t()) ? (i(e[63 & ((r |= n >> 4 & 15) | n >> 4 & 15)]), r = (15 & n) << 2, null !== (n = t()) ? (i(e[63 & (r | n >> 6 & 3)]), i(e[63 & n])) : (i(e[63 & r]), i(61))) : (i(e[63 & r]), i(61), i(61))
  31530. }, t.decode = function(t, e) {
  31531. var n, r, o;
  31532. function a(t) {
  31533. throw Error("Illegal character code: " + t)
  31534. }
  31535. for (; null !== (n = t());)
  31536. if (void 0 === (r = i[n]) && a(n), null !== (n = t()) && (void 0 === (o = i[n]) && a(n), e(r << 2 >>> 0 | (48 & o) >> 4), null !== (n = t()))) {
  31537. if (void 0 === (r = i[n])) {
  31538. if (61 === n) break;
  31539. a(n)
  31540. }
  31541. if (e((15 & o) << 4 >>> 0 | (60 & r) >> 2), null !== (n = t())) {
  31542. if (void 0 === (o = i[n])) {
  31543. if (61 === n) break;
  31544. a(n)
  31545. }
  31546. e((3 & r) << 6 >>> 0 | o)
  31547. }
  31548. }
  31549. }, t.test = function(t) {
  31550. return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)
  31551. }, t
  31552. }();
  31553. i.toBase64 = function(t, e) {
  31554. if (void 0 === t && (t = this.offset), void 0 === e && (e = this.limit), e |= 0, (t |= 0) < 0 || e > this.capacity || t > e) throw RangeError("begin, end");
  31555. var i;
  31556. return u.encode(function() {
  31557. return t < e ? this.view[t++] : null
  31558. }.bind(this), i = a()), i()
  31559. }, e.fromBase64 = function(t, i) {
  31560. if ("string" != typeof t) throw TypeError("str");
  31561. var n = new e(t.length / 4 * 3, i),
  31562. r = 0;
  31563. return u.decode(o(t), (function(t) {
  31564. n.view[r++] = t
  31565. })), n.limit = r, n
  31566. }, e.btoa = function(t) {
  31567. return e.fromBinary(t)
  31568. .toBase64()
  31569. }, e.atob = function(t) {
  31570. return e.fromBase64(t)
  31571. .toBinary()
  31572. }, i.toBinary = function(t, e) {
  31573. if (void 0 === t && (t = this.offset), void 0 === e && (e = this.limit), e |= 0, (t |= 0) < 0 || e > this.capacity() || t > e) throw RangeError("begin, end");
  31574. if (t === e) return "";
  31575. for (var i = [], n = []; t < e;) i.push(this.view[t++]), i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)), i = []);
  31576. return n.join("") + String.fromCharCode.apply(String, i)
  31577. }, e.fromBinary = function(t, i) {
  31578. if ("string" != typeof t) throw TypeError("str");
  31579. for (var n, r = 0, o = t.length, a = new e(o, i); r < o;) {
  31580. if ((n = t.charCodeAt(r)) > 255) throw RangeError("illegal char code: " + n);
  31581. a.view[r++] = n
  31582. }
  31583. return a.limit = o, a
  31584. }, i.toDebug = function(t) {
  31585. for (var e, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n;) {
  31586. if (-1 !== i && (r += (e = this.view[i]) < 16 ? "0" + e.toString(16)
  31587. .toUpperCase() : e.toString(16)
  31588. .toUpperCase(), t && (o += e > 32 && e < 127 ? String.fromCharCode(e) : ".")), ++i, t && i > 0 && i % 16 == 0 && i !== n) {
  31589. for (; r.length < 51;) r += " ";
  31590. a += r + o + "\n", r = o = ""
  31591. }
  31592. i === this.offset && i === this.limit ? r += i === this.markedOffset ? "!" : "|" : i === this.offset ? r += i === this.markedOffset ? "[" : "<" : i === this.limit ? r += i === this.markedOffset ? "]" : ">" : r += i === this.markedOffset ? "'" : t || 0 !== i && i !== n ? " " : ""
  31593. }
  31594. if (t && " " !== r) {
  31595. for (; r.length < 51;) r += " ";
  31596. a += r + o + "\n"
  31597. }
  31598. return t ? a : r
  31599. }, e.fromDebug = function(t, i, n) {
  31600. for (var r, o, a = t.length, s = new e((a + 1) / 3 | 0, i, n), l = 0, u = 0, h = !1, c = !1, d = !1, p = !1, f = !1; l < a;) {
  31601. switch (r = t.charAt(l++)) {
  31602. case "!":
  31603. if (!n) {
  31604. if (c || d || p) {
  31605. f = !0;
  31606. break
  31607. }
  31608. c = d = p = !0
  31609. }
  31610. s.offset = s.markedOffset = s.limit = u, h = !1;
  31611. break;
  31612. case "|":
  31613. if (!n) {
  31614. if (c || p) {
  31615. f = !0;
  31616. break
  31617. }
  31618. c = p = !0
  31619. }
  31620. s.offset = s.limit = u, h = !1;
  31621. break;
  31622. case "[":
  31623. if (!n) {
  31624. if (c || d) {
  31625. f = !0;
  31626. break
  31627. }
  31628. c = d = !0
  31629. }
  31630. s.offset = s.markedOffset = u, h = !1;
  31631. break;
  31632. case "<":
  31633. if (!n) {
  31634. if (c) {
  31635. f = !0;
  31636. break
  31637. }
  31638. c = !0
  31639. }
  31640. s.offset = u, h = !1;
  31641. break;
  31642. case "]":
  31643. if (!n) {
  31644. if (p || d) {
  31645. f = !0;
  31646. break
  31647. }
  31648. p = d = !0
  31649. }
  31650. s.limit = s.markedOffset = u, h = !1;
  31651. break;
  31652. case ">":
  31653. if (!n) {
  31654. if (p) {
  31655. f = !0;
  31656. break
  31657. }
  31658. p = !0
  31659. }
  31660. s.limit = u, h = !1;
  31661. break;
  31662. case "'":
  31663. if (!n) {
  31664. if (d) {
  31665. f = !0;
  31666. break
  31667. }
  31668. d = !0
  31669. }
  31670. s.markedOffset = u, h = !1;
  31671. break;
  31672. case " ":
  31673. h = !1;
  31674. break;
  31675. default:
  31676. if (!n && h) {
  31677. f = !0;
  31678. break
  31679. }
  31680. if (o = parseInt(r + t.charAt(l++), 16), !n && (isNaN(o) || o < 0 || o > 255)) throw TypeError("Illegal str: Not a debug encoded string");
  31681. s.view[u++] = o, h = !0
  31682. }
  31683. if (f) throw TypeError("Illegal str: Invalid symbol at " + l)
  31684. }
  31685. if (!n) {
  31686. if (!c || !p) throw TypeError("Illegal str: Missing offset or limit");
  31687. if (u < s.buffer.byteLength) throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + u + " < " + a)
  31688. }
  31689. return s
  31690. }, i.toHex = function(t, e) {
  31691. if (t = void 0 === t ? this.offset : t, e = void 0 === e ? this.limit : e, !this.noAssert) {
  31692. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal begin: Not an integer");
  31693. if (t >>>= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal end: Not an integer");
  31694. if (e >>>= 0, t < 0 || t > e || e > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + t + " <= " + e + " <= " + this.buffer.byteLength)
  31695. }
  31696. for (var i, n = new Array(e - t); t < e;)(i = this.view[t++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  31697. return n.join("")
  31698. }, e.fromHex = function(t, i, n) {
  31699. if (!n) {
  31700. if ("string" != typeof t) throw TypeError("Illegal str: Not a string");
  31701. if (t.length % 2 != 0) throw TypeError("Illegal str: Length not a multiple of 2")
  31702. }
  31703. for (var r, o = t.length, a = new e(o / 2 | 0, i), s = 0, l = 0; s < o; s += 2) {
  31704. if (r = parseInt(t.substring(s, s + 2), 16), !n && (!isFinite(r) || r < 0 || r > 255)) throw TypeError("Illegal str: Contains non-hex characters");
  31705. a.view[l++] = r
  31706. }
  31707. return a.limit = l, a
  31708. };
  31709. var h = function() {
  31710. var t = {
  31711. MAX_CODEPOINT: 1114111,
  31712. encodeUTF8: function(t, e) {
  31713. var i = null;
  31714. for ("number" == typeof t && (i = t, t = function() {
  31715. return null
  31716. }); null !== i || null !== (i = t());) i < 128 ? e(127 & i) : i < 2048 ? (e(i >> 6 & 31 | 192), e(63 & i | 128)) : i < 65536 ? (e(i >> 12 & 15 | 224), e(i >> 6 & 63 | 128), e(63 & i | 128)) : (e(i >> 18 & 7 | 240), e(i >> 12 & 63 | 128), e(i >> 6 & 63 | 128), e(63 & i | 128)), i = null
  31717. },
  31718. decodeUTF8: function(t, e) {
  31719. for (var i, n, r, o, a = function(t) {
  31720. t = t.slice(0, t.indexOf(null));
  31721. var e = Error(t.toString());
  31722. throw e.name = "TruncatedError", e.bytes = t, e
  31723. }; null !== (i = t());)
  31724. if (0 == (128 & i)) e(i);
  31725. else if (192 == (224 & i)) null === (n = t()) && a([i, n]), e((31 & i) << 6 | 63 & n);
  31726. else if (224 == (240 & i))(null === (n = t()) || null === (r = t())) && a([i, n, r]), e((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  31727. else {
  31728. if (240 != (248 & i)) throw RangeError("Illegal starting byte: " + i);
  31729. (null === (n = t()) || null === (r = t()) || null === (o = t())) && a([i, n, r, o]), e((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  31730. }
  31731. },
  31732. UTF16toUTF8: function(t, e) {
  31733. for (var i, n = null; null !== (i = null !== n ? n : t());) i >= 55296 && i <= 57343 && null !== (n = t()) && n >= 56320 && n <= 57343 ? (e(1024 * (i - 55296) + n - 56320 + 65536), n = null) : e(i);
  31734. null !== n && e(n)
  31735. },
  31736. UTF8toUTF16: function(t, e) {
  31737. var i = null;
  31738. for ("number" == typeof t && (i = t, t = function() {
  31739. return null
  31740. }); null !== i || null !== (i = t());) i <= 65535 ? e(i) : (e(55296 + ((i -= 65536) >> 10)), e(i % 1024 + 56320)), i = null
  31741. },
  31742. encodeUTF16toUTF8: function(e, i) {
  31743. t.UTF16toUTF8(e, (function(e) {
  31744. t.encodeUTF8(e, i)
  31745. }))
  31746. },
  31747. decodeUTF8toUTF16: function(e, i) {
  31748. t.decodeUTF8(e, (function(e) {
  31749. t.UTF8toUTF16(e, i)
  31750. }))
  31751. },
  31752. calculateCodePoint: function(t) {
  31753. return t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4
  31754. },
  31755. calculateUTF8: function(t) {
  31756. for (var e, i = 0; null !== (e = t());) i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4;
  31757. return i
  31758. },
  31759. calculateUTF16asUTF8: function(e) {
  31760. var i = 0,
  31761. n = 0;
  31762. return t.UTF16toUTF8(e, (function(t) {
  31763. ++i, n += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4
  31764. })), [i, n]
  31765. }
  31766. };
  31767. return t
  31768. }();
  31769. return i.toUTF8 = function(t, e) {
  31770. if (void 0 === t && (t = this.offset), void 0 === e && (e = this.limit), !this.noAssert) {
  31771. if ("number" != typeof t || t % 1 != 0) throw TypeError("Illegal begin: Not an integer");
  31772. if (t >>>= 0, "number" != typeof e || e % 1 != 0) throw TypeError("Illegal end: Not an integer");
  31773. if (e >>>= 0, t < 0 || t > e || e > this.buffer.byteLength) throw RangeError("Illegal range: 0 <= " + t + " <= " + e + " <= " + this.buffer.byteLength)
  31774. }
  31775. var i;
  31776. try {
  31777. h.decodeUTF8toUTF16(function() {
  31778. return t < e ? this.view[t++] : null
  31779. }.bind(this), i = a())
  31780. } catch (i) {
  31781. if (t !== e) throw RangeError("Illegal range: Truncated data, " + t + " != " + e)
  31782. }
  31783. return i()
  31784. }, e.fromUTF8 = function(t, i, n) {
  31785. if (!n && "string" != typeof t) throw TypeError("Illegal str: Not a string");
  31786. var r = new e(h.calculateUTF16asUTF8(o(t), !0)[1], i, n),
  31787. a = 0;
  31788. return h.encodeUTF16toUTF8(o(t), (function(t) {
  31789. r.view[a++] = t
  31790. })), r.limit = a, r
  31791. }, e
  31792. }) ? n.apply(e, r) : n) || (t.exports = o)
  31793. }, function(t, e, i) {
  31794. var n, r, o;
  31795. r = [], void 0 === (o = "function" == typeof(n = function() {
  31796. "use strict";
  31797. function t(t, e, i) {
  31798. this.low = 0 | t, this.high = 0 | e, this.unsigned = !!i
  31799. }
  31800. function e(t) {
  31801. return !0 === (t && t.__isLong__)
  31802. }
  31803. t.prototype.__isLong__, Object.defineProperty(t.prototype, "__isLong__", {
  31804. value: !0,
  31805. enumerable: !1,
  31806. configurable: !1
  31807. }), t.isLong = e;
  31808. var i = {},
  31809. n = {};
  31810. function r(t, e) {
  31811. var r, o, s;
  31812. return e ? (s = 0 <= (t >>>= 0) && t < 256) && (o = n[t]) ? o : (r = a(t, (0 | t) < 0 ? -1 : 0, !0), s && (n[t] = r), r) : (s = -128 <= (t |= 0) && t < 128) && (o = i[t]) ? o : (r = a(t, t < 0 ? -1 : 0, !1), s && (i[t] = r), r)
  31813. }
  31814. function o(t, e) {
  31815. if (isNaN(t) || !isFinite(t)) return e ? m : f;
  31816. if (e) {
  31817. if (t < 0) return m;
  31818. if (t >= c) return w
  31819. } else {
  31820. if (t <= -d) return x;
  31821. if (t + 1 >= d) return b
  31822. }
  31823. return t < 0 ? o(-t, e)
  31824. .neg() : a(t % h | 0, t / h | 0, e)
  31825. }
  31826. function a(e, i, n) {
  31827. return new t(e, i, n)
  31828. }
  31829. t.fromInt = r, t.fromNumber = o, t.fromBits = a;
  31830. var s = Math.pow;
  31831. function l(t, e, i) {
  31832. if (0 === t.length) throw Error("empty string");
  31833. if ("NaN" === t || "Infinity" === t || "+Infinity" === t || "-Infinity" === t) return f;
  31834. if ("number" == typeof e ? (i = e, e = !1) : e = !!e, (i = i || 10) < 2 || 36 < i) throw RangeError("radix");
  31835. var n;
  31836. if ((n = t.indexOf("-")) > 0) throw Error("interior hyphen");
  31837. if (0 === n) return l(t.substring(1), e, i)
  31838. .neg();
  31839. for (var r = o(s(i, 8)), a = f, u = 0; u < t.length; u += 8) {
  31840. var h = Math.min(8, t.length - u),
  31841. c = parseInt(t.substring(u, u + h), i);
  31842. if (h < 8) {
  31843. var d = o(s(i, h));
  31844. a = a.mul(d)
  31845. .add(o(c))
  31846. } else a = (a = a.mul(r))
  31847. .add(o(c))
  31848. }
  31849. return a.unsigned = e, a
  31850. }
  31851. function u(e) {
  31852. return e instanceof t ? e : "number" == typeof e ? o(e) : "string" == typeof e ? l(e) : a(e.low, e.high, e.unsigned)
  31853. }
  31854. t.fromString = l, t.fromValue = u;
  31855. var h = 4294967296,
  31856. c = h * h,
  31857. d = c / 2,
  31858. p = r(1 << 24),
  31859. f = r(0);
  31860. t.ZERO = f;
  31861. var m = r(0, !0);
  31862. t.UZERO = m;
  31863. var g = r(1);
  31864. t.ONE = g;
  31865. var v = r(1, !0);
  31866. t.UONE = v;
  31867. var y = r(-1);
  31868. t.NEG_ONE = y;
  31869. var b = a(-1, 2147483647, !1);
  31870. t.MAX_VALUE = b;
  31871. var w = a(-1, -1, !0);
  31872. t.MAX_UNSIGNED_VALUE = w;
  31873. var x = a(0, -2147483648, !1);
  31874. t.MIN_VALUE = x;
  31875. var M = t.prototype;
  31876. return M.toInt = function() {
  31877. return this.unsigned ? this.low >>> 0 : this.low
  31878. }, M.toNumber = function() {
  31879. return this.unsigned ? (this.high >>> 0) * h + (this.low >>> 0) : this.high * h + (this.low >>> 0)
  31880. }, M.toString = function(t) {
  31881. if ((t = t || 10) < 2 || 36 < t) throw RangeError("radix");
  31882. if (this.isZero()) return "0";
  31883. if (this.isNegative()) {
  31884. if (this.eq(x)) {
  31885. var e = o(t),
  31886. i = this.div(e),
  31887. n = i.mul(e)
  31888. .sub(this);
  31889. return i.toString(t) + n.toInt()
  31890. .toString(t)
  31891. }
  31892. return "-" + this.neg()
  31893. .toString(t)
  31894. }
  31895. for (var r = o(s(t, 6), this.unsigned), a = this, l = "";;) {
  31896. var u = a.div(r),
  31897. h = (a.sub(u.mul(r))
  31898. .toInt() >>> 0)
  31899. .toString(t);
  31900. if ((a = u)
  31901. .isZero()) return h + l;
  31902. for (; h.length < 6;) h = "0" + h;
  31903. l = "" + h + l
  31904. }
  31905. }, M.getHighBits = function() {
  31906. return this.high
  31907. }, M.getHighBitsUnsigned = function() {
  31908. return this.high >>> 0
  31909. }, M.getLowBits = function() {
  31910. return this.low
  31911. }, M.getLowBitsUnsigned = function() {
  31912. return this.low >>> 0
  31913. }, M.getNumBitsAbs = function() {
  31914. if (this.isNegative()) return this.eq(x) ? 64 : this.neg()
  31915. .getNumBitsAbs();
  31916. for (var t = 0 != this.high ? this.high : this.low, e = 31; e > 0 && 0 == (t & 1 << e); e--);
  31917. return 0 != this.high ? e + 33 : e + 1
  31918. }, M.isZero = function() {
  31919. return 0 === this.high && 0 === this.low
  31920. }, M.isNegative = function() {
  31921. return !this.unsigned && this.high < 0
  31922. }, M.isPositive = function() {
  31923. return this.unsigned || this.high >= 0
  31924. }, M.isOdd = function() {
  31925. return 1 == (1 & this.low)
  31926. }, M.isEven = function() {
  31927. return 0 == (1 & this.low)
  31928. }, M.equals = function(t) {
  31929. return e(t) || (t = u(t)), (this.unsigned === t.unsigned || this.high >>> 31 != 1 || t.high >>> 31 != 1) && this.high === t.high && this.low === t.low
  31930. }, M.eq = M.equals, M.notEquals = function(t) {
  31931. return !this.eq(t)
  31932. }, M.neq = M.notEquals, M.lessThan = function(t) {
  31933. return this.comp(t) < 0
  31934. }, M.lt = M.lessThan, M.lessThanOrEqual = function(t) {
  31935. return this.comp(t) <= 0
  31936. }, M.lte = M.lessThanOrEqual, M.greaterThan = function(t) {
  31937. return this.comp(t) > 0
  31938. }, M.gt = M.greaterThan, M.greaterThanOrEqual = function(t) {
  31939. return this.comp(t) >= 0
  31940. }, M.gte = M.greaterThanOrEqual, M.compare = function(t) {
  31941. if (e(t) || (t = u(t)), this.eq(t)) return 0;
  31942. var i = this.isNegative(),
  31943. n = t.isNegative();
  31944. return i && !n ? -1 : !i && n ? 1 : this.unsigned ? t.high >>> 0 > this.high >>> 0 || t.high === this.high && t.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(t)
  31945. .isNegative() ? -1 : 1
  31946. }, M.comp = M.compare, M.negate = function() {
  31947. return !this.unsigned && this.eq(x) ? x : this.not()
  31948. .add(g)
  31949. }, M.neg = M.negate, M.add = function(t) {
  31950. e(t) || (t = u(t));
  31951. var i = this.high >>> 16,
  31952. n = 65535 & this.high,
  31953. r = this.low >>> 16,
  31954. o = 65535 & this.low,
  31955. s = t.high >>> 16,
  31956. l = 65535 & t.high,
  31957. h = t.low >>> 16,
  31958. c = 0,
  31959. d = 0,
  31960. p = 0,
  31961. f = 0;
  31962. return p += (f += o + (65535 & t.low)) >>> 16, d += (p += r + h) >>> 16, c += (d += n + l) >>> 16, c += i + s, a((p &= 65535) << 16 | (f &= 65535), (c &= 65535) << 16 | (d &= 65535), this.unsigned)
  31963. }, M.subtract = function(t) {
  31964. return e(t) || (t = u(t)), this.add(t.neg())
  31965. }, M.sub = M.subtract, M.multiply = function(t) {
  31966. if (this.isZero()) return f;
  31967. if (e(t) || (t = u(t)), t.isZero()) return f;
  31968. if (this.eq(x)) return t.isOdd() ? x : f;
  31969. if (t.eq(x)) return this.isOdd() ? x : f;
  31970. if (this.isNegative()) return t.isNegative() ? this.neg()
  31971. .mul(t.neg()) : this.neg()
  31972. .mul(t)
  31973. .neg();
  31974. if (t.isNegative()) return this.mul(t.neg())
  31975. .neg();
  31976. if (this.lt(p) && t.lt(p)) return o(this.toNumber() * t.toNumber(), this.unsigned);
  31977. var i = this.high >>> 16,
  31978. n = 65535 & this.high,
  31979. r = this.low >>> 16,
  31980. s = 65535 & this.low,
  31981. l = t.high >>> 16,
  31982. h = 65535 & t.high,
  31983. c = t.low >>> 16,
  31984. d = 65535 & t.low,
  31985. m = 0,
  31986. g = 0,
  31987. v = 0,
  31988. y = 0;
  31989. return v += (y += s * d) >>> 16, g += (v += r * d) >>> 16, v &= 65535, g += (v += s * c) >>> 16, m += (g += n * d) >>> 16, g &= 65535, m += (g += r * c) >>> 16, g &= 65535, m += (g += s * h) >>> 16, m += i * d + n * c + r * h + s * l, a((v &= 65535) << 16 | (y &= 65535), (m &= 65535) << 16 | (g &= 65535), this.unsigned)
  31990. }, M.mul = M.multiply, M.divide = function(t) {
  31991. if (e(t) || (t = u(t)), t.isZero()) throw Error("division by zero");
  31992. if (this.isZero()) return this.unsigned ? m : f;
  31993. var i, n, r;
  31994. if (this.unsigned) {
  31995. if (t.unsigned || (t = t.toUnsigned()), t.gt(this)) return m;
  31996. if (t.gt(this.shru(1))) return v;
  31997. r = m
  31998. } else {
  31999. if (this.eq(x)) return t.eq(g) || t.eq(y) ? x : t.eq(x) ? g : (i = this.shr(1)
  32000. .div(t)
  32001. .shl(1))
  32002. .eq(f) ? t.isNegative() ? g : y : (n = this.sub(t.mul(i)), r = i.add(n.div(t)));
  32003. if (t.eq(x)) return this.unsigned ? m : f;
  32004. if (this.isNegative()) return t.isNegative() ? this.neg()
  32005. .div(t.neg()) : this.neg()
  32006. .div(t)
  32007. .neg();
  32008. if (t.isNegative()) return this.div(t.neg())
  32009. .neg();
  32010. r = f
  32011. }
  32012. for (n = this; n.gte(t);) {
  32013. i = Math.max(1, Math.floor(n.toNumber() / t.toNumber()));
  32014. for (var a = Math.ceil(Math.log(i) / Math.LN2), l = a <= 48 ? 1 : s(2, a - 48), h = o(i), c = h.mul(t); c.isNegative() || c.gt(n);) c = (h = o(i -= l, this.unsigned))
  32015. .mul(t);
  32016. h.isZero() && (h = g), r = r.add(h), n = n.sub(c)
  32017. }
  32018. return r
  32019. }, M.div = M.divide, M.modulo = function(t) {
  32020. return e(t) || (t = u(t)), this.sub(this.div(t)
  32021. .mul(t))
  32022. }, M.mod = M.modulo, M.not = function() {
  32023. return a(~this.low, ~this.high, this.unsigned)
  32024. }, M.and = function(t) {
  32025. return e(t) || (t = u(t)), a(this.low & t.low, this.high & t.high, this.unsigned)
  32026. }, M.or = function(t) {
  32027. return e(t) || (t = u(t)), a(this.low | t.low, this.high | t.high, this.unsigned)
  32028. }, M.xor = function(t) {
  32029. return e(t) || (t = u(t)), a(this.low ^ t.low, this.high ^ t.high, this.unsigned)
  32030. }, M.shiftLeft = function(t) {
  32031. return e(t) && (t = t.toInt()), 0 == (t &= 63) ? this : t < 32 ? a(this.low << t, this.high << t | this.low >>> 32 - t, this.unsigned) : a(0, this.low << t - 32, this.unsigned)
  32032. }, M.shl = M.shiftLeft, M.shiftRight = function(t) {
  32033. return e(t) && (t = t.toInt()), 0 == (t &= 63) ? this : t < 32 ? a(this.low >>> t | this.high << 32 - t, this.high >> t, this.unsigned) : a(this.high >> t - 32, this.high >= 0 ? 0 : -1, this.unsigned)
  32034. }, M.shr = M.shiftRight, M.shiftRightUnsigned = function(t) {
  32035. if (e(t) && (t = t.toInt()), 0 == (t &= 63)) return this;
  32036. var i = this.high;
  32037. return t < 32 ? a(this.low >>> t | i << 32 - t, i >>> t, this.unsigned) : a(32 === t ? i : i >>> t - 32, 0, this.unsigned)
  32038. }, M.shru = M.shiftRightUnsigned, M.toSigned = function() {
  32039. return this.unsigned ? a(this.low, this.high, !1) : this
  32040. }, M.toUnsigned = function() {
  32041. return this.unsigned ? this : a(this.low, this.high, !0)
  32042. }, M.toBytes = function(t) {
  32043. return t ? this.toBytesLE() : this.toBytesBE()
  32044. }, M.toBytesLE = function() {
  32045. var t = this.high,
  32046. e = this.low;
  32047. return [255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255, 255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255]
  32048. }, M.toBytesBE = function() {
  32049. var t = this.high,
  32050. e = this.low;
  32051. return [t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t, e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e]
  32052. }, t
  32053. }) ? n.apply(e, r) : n) || (t.exports = o)
  32054. }, function(t, e) {}, function(t, e) {
  32055. var i;
  32056. i = function() {
  32057. return this
  32058. }();
  32059. try {
  32060. i = i || new Function("return this")()
  32061. } catch (t) {
  32062. "object" == typeof window && (i = window)
  32063. }
  32064. t.exports = i
  32065. }, function(t, e, i) {
  32066. "use strict";
  32067. e.byteLength = function(t) {
  32068. var e = u(t),
  32069. i = e[0],
  32070. n = e[1];
  32071. return 3 * (i + n) / 4 - n
  32072. }, e.toByteArray = function(t) {
  32073. var e, i, n = u(t),
  32074. a = n[0],
  32075. s = n[1],
  32076. l = new o(function(t, e, i) {
  32077. return 3 * (e + i) / 4 - i
  32078. }(0, a, s)),
  32079. h = 0,
  32080. c = s > 0 ? a - 4 : a;
  32081. for (i = 0; i < c; i += 4) e = r[t.charCodeAt(i)] << 18 | r[t.charCodeAt(i + 1)] << 12 | r[t.charCodeAt(i + 2)] << 6 | r[t.charCodeAt(i + 3)], l[h++] = e >> 16 & 255, l[h++] = e >> 8 & 255, l[h++] = 255 & e;
  32082. 2 === s && (e = r[t.charCodeAt(i)] << 2 | r[t.charCodeAt(i + 1)] >> 4, l[h++] = 255 & e);
  32083. 1 === s && (e = r[t.charCodeAt(i)] << 10 | r[t.charCodeAt(i + 1)] << 4 | r[t.charCodeAt(i + 2)] >> 2, l[h++] = e >> 8 & 255, l[h++] = 255 & e);
  32084. return l
  32085. }, e.fromByteArray = function(t) {
  32086. for (var e, i = t.length, r = i % 3, o = [], a = 0, s = i - r; a < s; a += 16383) o.push(h(t, a, a + 16383 > s ? s : a + 16383));
  32087. 1 === r ? (e = t[i - 1], o.push(n[e >> 2] + n[e << 4 & 63] + "==")) : 2 === r && (e = (t[i - 2] << 8) + t[i - 1], o.push(n[e >> 10] + n[e >> 4 & 63] + n[e << 2 & 63] + "="));
  32088. return o.join("")
  32089. };
  32090. for (var n = [], r = [], o = "undefined" != typeof Uint8Array ? Uint8Array : Array, a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", s = 0, l = a.length; s < l; ++s) n[s] = a[s], r[a.charCodeAt(s)] = s;
  32091. function u(t) {
  32092. var e = t.length;
  32093. if (e % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
  32094. var i = t.indexOf("=");
  32095. return -1 === i && (i = e), [i, i === e ? 0 : 4 - i % 4]
  32096. }
  32097. function h(t, e, i) {
  32098. for (var r, o, a = [], s = e; s < i; s += 3) r = (t[s] << 16 & 16711680) + (t[s + 1] << 8 & 65280) + (255 & t[s + 2]), a.push(n[(o = r) >> 18 & 63] + n[o >> 12 & 63] + n[o >> 6 & 63] + n[63 & o]);
  32099. return a.join("")
  32100. }
  32101. r["-".charCodeAt(0)] = 62, r["_".charCodeAt(0)] = 63
  32102. }, function(t, e) {
  32103. e.read = function(t, e, i, n, r) {
  32104. var o, a, s = 8 * r - n - 1,
  32105. l = (1 << s) - 1,
  32106. u = l >> 1,
  32107. h = -7,
  32108. c = i ? r - 1 : 0,
  32109. d = i ? -1 : 1,
  32110. p = t[e + c];
  32111. for (c += d, o = p & (1 << -h) - 1, p >>= -h, h += s; h > 0; o = 256 * o + t[e + c], c += d, h -= 8);
  32112. for (a = o & (1 << -h) - 1, o >>= -h, h += n; h > 0; a = 256 * a + t[e + c], c += d, h -= 8);
  32113. if (0 === o) o = 1 - u;
  32114. else {
  32115. if (o === l) return a ? NaN : 1 / 0 * (p ? -1 : 1);
  32116. a += Math.pow(2, n), o -= u
  32117. }
  32118. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  32119. }, e.write = function(t, e, i, n, r, o) {
  32120. var a, s, l, u = 8 * o - r - 1,
  32121. h = (1 << u) - 1,
  32122. c = h >> 1,
  32123. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  32124. p = n ? 0 : o - 1,
  32125. f = n ? 1 : -1,
  32126. m = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0;
  32127. for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (s = isNaN(e) ? 1 : 0, a = h) : (a = Math.floor(Math.log(e) / Math.LN2), e * (l = Math.pow(2, -a)) < 1 && (a--, l *= 2), (e += a + c >= 1 ? d / l : d * Math.pow(2, 1 - c)) * l >= 2 && (a++, l /= 2), a + c >= h ? (s = 0, a = h) : a + c >= 1 ? (s = (e * l - 1) * Math.pow(2, r), a += c) : (s = e * Math.pow(2, c - 1) * Math.pow(2, r), a = 0)); r >= 8; t[i + p] = 255 & s, p += f, s /= 256, r -= 8);
  32128. for (a = a << r | s, u += r; u > 0; t[i + p] = 255 & a, p += f, a /= 256, u -= 8);
  32129. t[i + p - f] |= 128 * m
  32130. }
  32131. }, function(t, e) {
  32132. var i = {}.toString;
  32133. t.exports = Array.isArray || function(t) {
  32134. return "[object Array]" == i.call(t)
  32135. }
  32136. }, function(t, e, i) {
  32137. (function(e) {
  32138. var n = i(7),
  32139. r = i(16),
  32140. o = i(3),
  32141. a = i(2),
  32142. s = i(1),
  32143. l = new a("/js/loaders/ModelTextureLoader.js");
  32144. t.exports.load = function(t) {
  32145. function i(t) {
  32146. t || (c++, h.notify(c, a), c === a && h.resolve())
  32147. }
  32148. if (!t.chunks[0] || !t.chunks[0].meshUrl) return e.when();
  32149. var a = n.countUnique(t.chunks.map((function(t) {
  32150. return t.textureName
  32151. }))),
  32152. u = "high";
  32153. o.isMobile() && "high" === u && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."), u = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."), u = "low"));
  32154. var h = e.Deferred(),
  32155. c = 0,
  32156. d = G.url.model + "/texture_" + u + "/";
  32157. return t.chunks.forEach((function(t) {
  32158. if (!t.material.map && t.textureName) {
  32159. var e = d + t.textureName;
  32160. t.setTextureMap(r.load(e, i.bind(this, r.isLoaded(e))))
  32161. }
  32162. })), h.promise()
  32163. }
  32164. })
  32165. .call(this, i(6))
  32166. }, function(t, e, i) {
  32167. (function(e) {
  32168. (function(n, r) {
  32169. i(1), i(46);
  32170. var o = i(11),
  32171. a = (i(7), i(9)),
  32172. s = i(2),
  32173. l = i(0),
  32174. u = new s(r);
  32175. function h(t) {
  32176. this.model = t, this.modelDataPath = G.url.model + "/vision.modeldata"
  32177. }
  32178. h.prototype.load = function() {
  32179. return this.modelDataPath ? (u.info("Using vision.modeldata"), this.loadVisionModelData()) : (u.warn("No sweep file found"), e.when([]))
  32180. }, h.prototype.loadVisionModelData = function() {
  32181. var t = this;
  32182. return o.get(this.modelDataPath, {
  32183. responseType: "json",
  32184. fetchNum: 1,
  32185. prefetchFrom: "locations"
  32186. })
  32187. .then(function(e) {
  32188. var i = e.points.map((function(t) {
  32189. var e = t.color;
  32190. return e ? (e.brightness || (e.brightness = 0), e.contrast || (e.contrast = 0), null !== e.gamma && void 0 !== e.gamma || (e.gamma = 1), e.hue || (e.hue = 0), e.saturation || (e.saturation = 0), e.vibrance || (e.vibrance = 0), e.balance || (e.balance = new l.Vector3(0, 0, 0))) : e = {
  32191. brightness: 0,
  32192. contrast: 0,
  32193. gamma: 1,
  32194. hue: 0,
  32195. saturation: 0,
  32196. vibrance: 0,
  32197. balance: new l.Vector3(0, 0, 0)
  32198. }, {
  32199. enable: t.enable,
  32200. locationid: t.locationid,
  32201. position: {
  32202. x: t.viewpoint.x,
  32203. y: t.viewpoint.y,
  32204. z: t.viewpoint.z
  32205. },
  32206. quaternion: {
  32207. x: t.rotation.x,
  32208. y: t.rotation.y,
  32209. z: t.rotation.z,
  32210. w: t.rotation.w
  32211. },
  32212. puck: {
  32213. x: t.spot.x,
  32214. y: t.spot.y,
  32215. z: t.spot.z
  32216. },
  32217. u: t.u,
  32218. v: t.v,
  32219. floor: t.flooridx,
  32220. neighbours: t.vps,
  32221. alignmentType: t.type,
  32222. angle_enable: t.angle_enable,
  32223. angle_x: t.angle_x,
  32224. angle_y: t.angle_y,
  32225. angle_z: t.angle_z,
  32226. launch: t.launch,
  32227. color: e,
  32228. roomid: t.roomidx
  32229. }
  32230. }))
  32231. .map((function(e) {
  32232. if (t.model.straight_enable) {
  32233. var i = new l.Euler;
  32234. i.setFromQuaternion(new l.Quaternion(e.quaternion.x, e.quaternion.y, e.quaternion.z, e.quaternion.w), "ZYX", !1), i._x = 0, i._y = 0;
  32235. var n = new l.Quaternion;
  32236. n.setFromEuler(i, !1), e.quaternion.x = n.x, e.quaternion.y = n.y, e.quaternion.z = n.z, e.quaternion.w = n.w
  32237. }
  32238. return e.position = a.convertVisionVector(e.position), e.quaternion = a.convertVisionQuaternion(e.quaternion), e.quaternionAutoScene = a.convertVisionQuaternionAutoScene(e.quaternion), e.puck = a.convertVisionVector(e.puck), e
  32239. }));
  32240. return i.forEach((function(t) {
  32241. t.neighbours = t.neighbours.map((function(t) {
  32242. return i[t].locationid
  32243. }))
  32244. })), !G.conf.jfedit && G.conf.isNewEditVersion || (i = i.filter((function(t) {
  32245. return t.enable
  32246. }))), i
  32247. }.bind(this))
  32248. }, t.exports = h
  32249. })
  32250. .call(this, i(47)
  32251. .Buffer, "/js/loaders/SweepDataLoader.js"),
  32252. function(n, r) {
  32253. i(1), i(46);
  32254. var o = i(11),
  32255. a = (i(7), i(9)),
  32256. s = i(2),
  32257. l = i(0),
  32258. u = new s(r);
  32259. function h(t) {
  32260. this.model = t, this.modelDataPath = G.url.model + "/vision.modeldata"
  32261. }
  32262. h.prototype.load = function() {
  32263. return this.modelDataPath ? (u.info("Using vision.modeldata"), this.loadVisionModelData()) : (u.warn("No sweep file found"), e.when([]))
  32264. }, h.prototype.loadVisionModelData = function() {
  32265. var t = this;
  32266. return o.get(this.modelDataPath, {
  32267. responseType: "json",
  32268. fetchNum: 1,
  32269. prefetchFrom: "locations"
  32270. })
  32271. .then(function(e) {
  32272. var i = e.points.map((function(t) {
  32273. var e = t.color;
  32274. return e ? (e.brightness || (e.brightness = 0), e.contrast || (e.contrast = 0), null !== e.gamma && void 0 !== e.gamma || (e.gamma = 1), e.hue || (e.hue = 0), e.saturation || (e.saturation = 0), e.vibrance || (e.vibrance = 0), e.balance || (e.balance = new l.Vector3(0, 0, 0))) : e = {
  32275. brightness: 0,
  32276. contrast: 0,
  32277. gamma: 1,
  32278. hue: 0,
  32279. saturation: 0,
  32280. vibrance: 0,
  32281. balance: new l.Vector3(0, 0, 0)
  32282. }, {
  32283. enable: t.enable,
  32284. locationid: t.locationid,
  32285. position: {
  32286. x: t.viewpoint.x,
  32287. y: t.viewpoint.y,
  32288. z: t.viewpoint.z
  32289. },
  32290. quaternion: {
  32291. x: t.rotation.x,
  32292. y: t.rotation.y,
  32293. z: t.rotation.z,
  32294. w: t.rotation.w
  32295. },
  32296. puck: {
  32297. x: t.spot.x,
  32298. y: t.spot.y,
  32299. z: t.spot.z
  32300. },
  32301. u: t.u,
  32302. v: t.v,
  32303. floor: t.flooridx,
  32304. neighbours: t.vps,
  32305. alignmentType: t.type,
  32306. angle_enable: t.angle_enable,
  32307. angle_x: t.angle_x,
  32308. angle_y: t.angle_y,
  32309. angle_z: t.angle_z,
  32310. launch: t.launch,
  32311. color: e,
  32312. roomid: t.roomidx
  32313. }
  32314. }))
  32315. .map((function(e) {
  32316. if (t.model.straight_enable) {
  32317. var i = new l.Euler;
  32318. i.setFromQuaternion(new l.Quaternion(e.quaternion.x, e.quaternion.y, e.quaternion.z, e.quaternion.w), "ZYX", !1), i._x = 0, i._y = 0;
  32319. var n = new l.Quaternion;
  32320. n.setFromEuler(i, !1), e.quaternion.x = n.x, e.quaternion.y = n.y, e.quaternion.z = n.z, e.quaternion.w = n.w
  32321. }
  32322. return e.position = a.convertVisionVector(e.position), e.quaternion = a.convertVisionQuaternion(e.quaternion), e.quaternionAutoScene = a.convertVisionQuaternionAutoScene(e.quaternion), e.puck = a.convertVisionVector(e.puck), e
  32323. }));
  32324. return i.forEach((function(t) {
  32325. t.neighbours = t.neighbours.map((function(t) {
  32326. return i[t].locationid
  32327. }))
  32328. })), !G.conf.jfedit && G.conf.isNewEditVersion || (i = i.filter((function(t) {
  32329. return t.enable
  32330. }))), i
  32331. }.bind(this))
  32332. }, t.exports = h
  32333. }.call(this, i(47)
  32334. .Buffer, "/js/loaders/SweepDataLoader.js")
  32335. })
  32336. .call(this, i(6))
  32337. }, function(t, e, i) {
  32338. (function(e) {
  32339. function n() {
  32340. u.call(this)
  32341. }
  32342. var r = i(1),
  32343. o = i(2),
  32344. a = i(5),
  32345. s = i(57),
  32346. l = (i(9), i(7)),
  32347. u = i(33),
  32348. h = new o(e);
  32349. l.inherit(n, u), n.prototype.getbg = function() {
  32350. for (var t = 0; t < this.list.length; t++)
  32351. if (this.list[t].init_point) return this.list[t];
  32352. return null
  32353. }, n.prototype.filterByModesAndReel = function(t, e) {
  32354. for (var i, n = t[a.DOLLHOUSE], r = t[a.FLOORPLAN], o = [], s = 0; s < e.length; s++) i = this.index[e[s].sceneid], 0 == s && (i.isHero = !0), i && o.push(i);
  32355. (o = o.filter((function(t) {
  32356. var e;
  32357. if (t._camera && void 0 !== t._camera._type) {
  32358. try {
  32359. e = a.convertWorkshopModeInt(t._camera._type)
  32360. } catch (t) {
  32361. return void h.debug(t.message)
  32362. }
  32363. return e === a.PANORAMA || e === a.FLOORPLAN && r || e === a.DOLLHOUSE && n
  32364. }
  32365. })))
  32366. .length !== this.list.length && (h.info("Disallowed " + (this.list.length - o.length) + " highlight images"), this.list = o, this.reIndex()), this.list = o, this.reIndex()
  32367. }, n.prototype.getHeroLocations = function(t) {
  32368. var e = [],
  32369. i = !1;
  32370. if (0 === this.list.length) return [];
  32371. for (var o = 0; o < this.list.length; ++o) {
  32372. var l = this.list[o],
  32373. u = l.shortcuturl,
  32374. h = l.name;
  32375. if (l.script = l.script ? l.script : 0, l._camera && void 0 !== l._camera._rotation) {
  32376. if (!r.show360Views.enabled && l._camera._locationid) {
  32377. var c = t.get(l._camera._locationid);
  32378. if (c && !c.isAligned()) continue
  32379. }
  32380. if (a.convertWorkshopModeInt(l._camera._type) === a.MESH) continue;
  32381. var d = new s({
  32382. cameraMode: "panorama",
  32383. position: l._camera._viewpoint,
  32384. quaternion: l._camera._rotation,
  32385. panoId: l._camera._locationid,
  32386. orthoZoom: l._camera._zoom,
  32387. floorVisibility: void 0 !== l._camera.floor_visibility ? l._camera.floor_visibility.slice(0) : [],
  32388. thumbUrl: u,
  32389. name: n.filterImageName(h),
  32390. isHero: l.init_point,
  32391. script: l.script,
  32392. cameraType: l._camera._type
  32393. });
  32394. e.push(d), i = i || l.init_point
  32395. }
  32396. }
  32397. return e.length > 0 && !i && (e[0].isHero = !0), e
  32398. }, n.prototype.getIndex = function(t) {
  32399. return t.sceneid
  32400. }, n.filterImageName = function(t) {
  32401. return "" === t || t.match(/^[0-9.]+_[0-9.]+$/) ? null : t
  32402. }, t.exports = n
  32403. })
  32404. .call(this, "/js/model/ImageCollection.js")
  32405. }, function(t, e, i) {
  32406. (function(e) {
  32407. function n() {
  32408. s.call(this)
  32409. }
  32410. var r = i(179),
  32411. o = (i(1), i(2)),
  32412. a = (i(8), i(15), i(7)),
  32413. s = i(33),
  32414. l = i(72);
  32415. new o(e), a.inherit(n, s), n.prototype.getIndex = function(t) {
  32416. return t.roomId
  32417. }, n.prototype.calcRoomBoundaries = function() {
  32418. this.forEach((function(t) {
  32419. t.calcBoundaries()
  32420. }))
  32421. }, n.prototype.createFromChunks = function(t) {
  32422. var e = {
  32423. floorId: -1,
  32424. roomId: -1
  32425. },
  32426. i = {};
  32427. t.forEach(function(t) {
  32428. l.parseIdsFromChunkName(t.name, e);
  32429. var o = i[e.roomId];
  32430. if (!o) {
  32431. var a = n.generateRoomId(e.floorId, e.roomId);
  32432. o = new r(e.floorId, a), this.add(o), i[e.roomId] = o
  32433. }
  32434. o.addChunk(t)
  32435. }.bind(this)), this.calcRoomBoundaries()
  32436. }, n.generateRoomId = function(t, e) {
  32437. return t + "_" + e
  32438. }, t.exports = n
  32439. })
  32440. .call(this, "/js/model/RoomCollection.js")
  32441. }, function(t, e, i) {
  32442. function n(t, e) {
  32443. this.chunks = [], this.floorId = t, this.roomId = e, this.position = new r.Vector3
  32444. }
  32445. var r = i(0);
  32446. n.prototype.addChunk = function(t) {
  32447. this.chunks.push(t)
  32448. }, n.prototype.calcBoundaries = function() {
  32449. for (var t = new r.Vector3, e = new r.Vector3(0, 0, 0), i = new r.Vector3(0, 0, 0), n = new r.Vector3(0, 0, 0), o = 0, a = 0; a < this.chunks.length; a++) {
  32450. var s = this.chunks[a].geometry.attributes.position;
  32451. if (s)
  32452. for (var l = 0; l < s.array.length; l += 3) t.set(s.array[l], s.array[l + 1], s.array[l + 2]), e.add(t), 0 === l ? (i.copy(t), n.copy(t)) : (i.max(t), n.min(t)), o++
  32453. }
  32454. o > 0 ? (e.multiplyScalar(1 / o), this.average = e) : this.average = null, this.boundsMax = i, this.boundsMin = n, this.center = new r.Vector3, this.center.copy(i)
  32455. .sub(n)
  32456. .multiplyScalar(.5)
  32457. .add(n)
  32458. }, t.exports = n
  32459. }, function(t, e, i) {
  32460. var n;
  32461. ! function(r, o) {
  32462. "use strict";
  32463. var a = "model",
  32464. s = "name",
  32465. l = "type",
  32466. u = "vendor",
  32467. h = "version",
  32468. c = "mobile",
  32469. d = "tablet",
  32470. p = "smarttv",
  32471. f = function(t) {
  32472. for (var e = {}, i = 0; i < t.length; i++) e[t[i].toUpperCase()] = t[i];
  32473. return e
  32474. },
  32475. m = function(t, e) {
  32476. return "string" == typeof t && -1 !== g(e)
  32477. .indexOf(g(t))
  32478. },
  32479. g = function(t) {
  32480. return t.toLowerCase()
  32481. },
  32482. v = function(t, e) {
  32483. if ("string" == typeof t) return t = t.replace(/^\s\s*/, ""), void 0 === e ? t : t.substring(0, 350)
  32484. },
  32485. y = function(t, e) {
  32486. for (var i, n, r, o, a, s, l = 0; l < e.length && !a;) {
  32487. var u = e[l],
  32488. h = e[l + 1];
  32489. for (i = n = 0; i < u.length && !a && u[i];)
  32490. if (a = u[i++].exec(t))
  32491. for (r = 0; r < h.length; r++) s = a[++n], "object" == typeof(o = h[r]) && o.length > 0 ? 2 === o.length ? "function" == typeof o[1] ? this[o[0]] = o[1].call(this, s) : this[o[0]] = o[1] : 3 === o.length ? "function" != typeof o[1] || o[1].exec && o[1].test ? this[o[0]] = s ? s.replace(o[1], o[2]) : void 0 : this[o[0]] = s ? o[1].call(this, s, o[2]) : void 0 : 4 === o.length && (this[o[0]] = s ? o[3].call(this, s.replace(o[1], o[2])) : void 0) : this[o] = s || void 0;
  32492. l += 2
  32493. }
  32494. },
  32495. b = function(t, e) {
  32496. for (var i in e)
  32497. if ("object" == typeof e[i] && e[i].length > 0) {
  32498. for (var n = 0; n < e[i].length; n++)
  32499. if (m(e[i][n], t)) return "?" === i ? void 0 : i
  32500. } else if (m(e[i], t)) return "?" === i ? void 0 : i;
  32501. return t
  32502. },
  32503. w = {
  32504. ME: "4.90",
  32505. "NT 3.11": "NT3.51",
  32506. "NT 4.0": "NT4.0",
  32507. 2e3: "NT 5.0",
  32508. XP: ["NT 5.1", "NT 5.2"],
  32509. Vista: "NT 6.0",
  32510. 7: "NT 6.1",
  32511. 8: "NT 6.2",
  32512. 8.1: "NT 6.3",
  32513. 10: ["NT 6.4", "NT 10.0"],
  32514. RT: "ARM"
  32515. },
  32516. x = {
  32517. browser: [
  32518. [/\b(?:crmo|crios)\/([\w\.]+)/i],
  32519. [h, [s, "Chrome"]],
  32520. [/edg(?:e|ios|a)?\/([\w\.]+)/i],
  32521. [h, [s, "Edge"]],
  32522. [/(opera mini)\/([-\w\.]+)/i, /(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i, /(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],
  32523. [s, h],
  32524. [/opios[\/ ]+([\w\.]+)/i],
  32525. [h, [s, "Opera Mini"]],
  32526. [/\bopr\/([\w\.]+)/i],
  32527. [h, [s, "Opera"]],
  32528. [/(kindle)\/([\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i, /(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i, /(ba?idubrowser)[\/ ]?([\w\.]+)/i, /(?:ms|\()(ie) ([\w\.]+)/i, /(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i, /(heytap|ovi)browser\/([\d\.]+)/i, /(weibo)__([\d\.]+)/i],
  32529. [s, h],
  32530. [/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],
  32531. [h, [s, "UCBrowser"]],
  32532. [/microm.+\bqbcore\/([\w\.]+)/i, /\bqbcore\/([\w\.]+).+microm/i],
  32533. [h, [s, "WeChat(Win) Desktop"]],
  32534. [/micromessenger\/([\w\.]+)/i],
  32535. [h, [s, "WeChat"]],
  32536. [/konqueror\/([\w\.]+)/i],
  32537. [h, [s, "Konqueror"]],
  32538. [/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],
  32539. [h, [s, "IE"]],
  32540. [/ya(?:search)?browser\/([\w\.]+)/i],
  32541. [h, [s, "Yandex"]],
  32542. [/(avast|avg)\/([\w\.]+)/i],
  32543. [
  32544. [s, /(.+)/, "$1 Secure Browser"], h
  32545. ],
  32546. [/\bfocus\/([\w\.]+)/i],
  32547. [h, [s, "Firefox Focus"]],
  32548. [/\bopt\/([\w\.]+)/i],
  32549. [h, [s, "Opera Touch"]],
  32550. [/coc_coc\w+\/([\w\.]+)/i],
  32551. [h, [s, "Coc Coc"]],
  32552. [/dolfin\/([\w\.]+)/i],
  32553. [h, [s, "Dolphin"]],
  32554. [/coast\/([\w\.]+)/i],
  32555. [h, [s, "Opera Coast"]],
  32556. [/miuibrowser\/([\w\.]+)/i],
  32557. [h, [s, "MIUI Browser"]],
  32558. [/fxios\/([-\w\.]+)/i],
  32559. [h, [s, "Firefox"]],
  32560. [/\bqihu|(qi?ho?o?|360)browser/i],
  32561. [
  32562. [s, "360 Browser"]
  32563. ],
  32564. [/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],
  32565. [
  32566. [s, /(.+)/, "$1 Browser"], h
  32567. ],
  32568. [/(comodo_dragon)\/([\w\.]+)/i],
  32569. [
  32570. [s, /_/g, " "], h
  32571. ],
  32572. [/(electron)\/([\w\.]+) safari/i, /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, /m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],
  32573. [s, h],
  32574. [/(metasr)[\/ ]?([\w\.]+)/i, /(lbbrowser)/i, /\[(linkedin)app\]/i],
  32575. [s],
  32576. [/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],
  32577. [
  32578. [s, "Facebook"], h
  32579. ],
  32580. [/(kakao(?:talk|story))[\/ ]([\w\.]+)/i, /(naver)\(.*?(\d+\.[\w\.]+).*\)/i, /safari (line)\/([\w\.]+)/i, /\b(line)\/([\w\.]+)\/iab/i, /(chromium|instagram)[\/ ]([-\w\.]+)/i],
  32581. [s, h],
  32582. [/\bgsa\/([\w\.]+) .*safari\//i],
  32583. [h, [s, "GSA"]],
  32584. [/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],
  32585. [h, [s, "TikTok"]],
  32586. [/headlesschrome(?:\/([\w\.]+)| )/i],
  32587. [h, [s, "Chrome Headless"]],
  32588. [/ wv\).+(chrome)\/([\w\.]+)/i],
  32589. [
  32590. [s, "Chrome WebView"], h
  32591. ],
  32592. [/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],
  32593. [h, [s, "Android Browser"]],
  32594. [/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],
  32595. [s, h],
  32596. [/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],
  32597. [h, [s, "Mobile Safari"]],
  32598. [/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],
  32599. [h, s],
  32600. [/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],
  32601. [s, [h, b, {
  32602. "1.0": "/8",
  32603. 1.2: "/1",
  32604. 1.3: "/3",
  32605. "2.0": "/412",
  32606. "2.0.2": "/416",
  32607. "2.0.3": "/417",
  32608. "2.0.4": "/419",
  32609. "?": "/"
  32610. }]],
  32611. [/(webkit|khtml)\/([\w\.]+)/i],
  32612. [s, h],
  32613. [/(navigator|netscape\d?)\/([-\w\.]+)/i],
  32614. [
  32615. [s, "Netscape"], h
  32616. ],
  32617. [/mobile vr; rv:([\w\.]+)\).+firefox/i],
  32618. [h, [s, "Firefox Reality"]],
  32619. [/ekiohf.+(flow)\/([\w\.]+)/i, /(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i, /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i, /(firefox)\/([\w\.]+)/i, /(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i, /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i, /(links) \(([\w\.]+)/i, /panasonic;(viera)/i],
  32620. [s, h],
  32621. [/(cobalt)\/([\w\.]+)/i],
  32622. [s, [h, /master.|lts./, ""]]
  32623. ],
  32624. cpu: [
  32625. [/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],
  32626. [
  32627. ["architecture", "amd64"]
  32628. ],
  32629. [/(ia32(?=;))/i],
  32630. [
  32631. ["architecture", g]
  32632. ],
  32633. [/((?:i[346]|x)86)[;\)]/i],
  32634. [
  32635. ["architecture", "ia32"]
  32636. ],
  32637. [/\b(aarch64|arm(v?8e?l?|_?64))\b/i],
  32638. [
  32639. ["architecture", "arm64"]
  32640. ],
  32641. [/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],
  32642. [
  32643. ["architecture", "armhf"]
  32644. ],
  32645. [/windows (ce|mobile); ppc;/i],
  32646. [
  32647. ["architecture", "arm"]
  32648. ],
  32649. [/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],
  32650. [
  32651. ["architecture", /ower/, "", g]
  32652. ],
  32653. [/(sun4\w)[;\)]/i],
  32654. [
  32655. ["architecture", "sparc"]
  32656. ],
  32657. [/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],
  32658. [
  32659. ["architecture", g]
  32660. ]
  32661. ],
  32662. device: [
  32663. [/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],
  32664. [a, [u, "Samsung"],
  32665. [l, d]
  32666. ],
  32667. [/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i, /samsung[- ]([-\w]+)/i, /sec-(sgh\w+)/i],
  32668. [a, [u, "Samsung"],
  32669. [l, c]
  32670. ],
  32671. [/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],
  32672. [a, [u, "Apple"],
  32673. [l, c]
  32674. ],
  32675. [/\((ipad);[-\w\),; ]+apple/i, /applecoremedia\/[\w\.]+ \((ipad)/i, /\b(ipad)\d\d?,\d\d?[;\]].+ios/i],
  32676. [a, [u, "Apple"],
  32677. [l, d]
  32678. ],
  32679. [/(macintosh);/i],
  32680. [a, [u, "Apple"]],
  32681. [/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],
  32682. [a, [u, "Sharp"],
  32683. [l, c]
  32684. ],
  32685. [/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],
  32686. [a, [u, "Huawei"],
  32687. [l, d]
  32688. ],
  32689. [/(?:huawei|honor)([-\w ]+)[;\)]/i, /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],
  32690. [a, [u, "Huawei"],
  32691. [l, c]
  32692. ],
  32693. [/\b(poco[\w ]+)(?: bui|\))/i, /\b; (\w+) build\/hm\1/i, /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i, /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i, /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],
  32694. [
  32695. [a, /_/g, " "],
  32696. [u, "Xiaomi"],
  32697. [l, c]
  32698. ],
  32699. [/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],
  32700. [
  32701. [a, /_/g, " "],
  32702. [u, "Xiaomi"],
  32703. [l, d]
  32704. ],
  32705. [/; (\w+) bui.+ oppo/i, /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],
  32706. [a, [u, "OPPO"],
  32707. [l, c]
  32708. ],
  32709. [/vivo (\w+)(?: bui|\))/i, /\b(v[12]\d{3}\w?[at])(?: bui|;)/i],
  32710. [a, [u, "Vivo"],
  32711. [l, c]
  32712. ],
  32713. [/\b(rmx[12]\d{3})(?: bui|;|\))/i],
  32714. [a, [u, "Realme"],
  32715. [l, c]
  32716. ],
  32717. [/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i, /\bmot(?:orola)?[- ](\w*)/i, /((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],
  32718. [a, [u, "Motorola"],
  32719. [l, c]
  32720. ],
  32721. [/\b(mz60\d|xoom[2 ]{0,2}) build\//i],
  32722. [a, [u, "Motorola"],
  32723. [l, d]
  32724. ],
  32725. [/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],
  32726. [a, [u, "LG"],
  32727. [l, d]
  32728. ],
  32729. [/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i, /\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i, /\blg-?([\d\w]+) bui/i],
  32730. [a, [u, "LG"],
  32731. [l, c]
  32732. ],
  32733. [/(ideatab[-\w ]+)/i, /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],
  32734. [a, [u, "Lenovo"],
  32735. [l, d]
  32736. ],
  32737. [/(?:maemo|nokia).*(n900|lumia \d+)/i, /nokia[-_ ]?([-\w\.]*)/i],
  32738. [
  32739. [a, /_/g, " "],
  32740. [u, "Nokia"],
  32741. [l, c]
  32742. ],
  32743. [/(pixel c)\b/i],
  32744. [a, [u, "Google"],
  32745. [l, d]
  32746. ],
  32747. [/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],
  32748. [a, [u, "Google"],
  32749. [l, c]
  32750. ],
  32751. [/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],
  32752. [a, [u, "Sony"],
  32753. [l, c]
  32754. ],
  32755. [/sony tablet [ps]/i, /\b(?:sony)?sgp\w+(?: bui|\))/i],
  32756. [
  32757. [a, "Xperia Tablet"],
  32758. [u, "Sony"],
  32759. [l, d]
  32760. ],
  32761. [/ (kb2005|in20[12]5|be20[12][59])\b/i, /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],
  32762. [a, [u, "OnePlus"],
  32763. [l, c]
  32764. ],
  32765. [/(alexa)webm/i, /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i, /(kf[a-z]+)( bui|\)).+silk\//i],
  32766. [a, [u, "Amazon"],
  32767. [l, d]
  32768. ],
  32769. [/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],
  32770. [
  32771. [a, /(.+)/g, "Fire Phone $1"],
  32772. [u, "Amazon"],
  32773. [l, c]
  32774. ],
  32775. [/(playbook);[-\w\),; ]+(rim)/i],
  32776. [a, u, [l, d]],
  32777. [/\b((?:bb[a-f]|st[hv])100-\d)/i, /\(bb10; (\w+)/i],
  32778. [a, [u, "BlackBerry"],
  32779. [l, c]
  32780. ],
  32781. [/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],
  32782. [a, [u, "ASUS"],
  32783. [l, d]
  32784. ],
  32785. [/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],
  32786. [a, [u, "ASUS"],
  32787. [l, c]
  32788. ],
  32789. [/(nexus 9)/i],
  32790. [a, [u, "HTC"],
  32791. [l, d]
  32792. ],
  32793. [/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i, /(zte)[- ]([\w ]+?)(?: bui|\/|\))/i, /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],
  32794. [u, [a, /_/g, " "],
  32795. [l, c]
  32796. ],
  32797. [/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],
  32798. [a, [u, "Acer"],
  32799. [l, d]
  32800. ],
  32801. [/droid.+; (m[1-5] note) bui/i, /\bmz-([-\w]{2,})/i],
  32802. [a, [u, "Meizu"],
  32803. [l, c]
  32804. ],
  32805. [/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i, /(hp) ([\w ]+\w)/i, /(asus)-?(\w+)/i, /(microsoft); (lumia[\w ]+)/i, /(lenovo)[-_ ]?([-\w]+)/i, /(jolla)/i, /(oppo) ?([\w ]+) bui/i],
  32806. [u, a, [l, c]],
  32807. [/(kobo)\s(ereader|touch)/i, /(archos) (gamepad2?)/i, /(hp).+(touchpad(?!.+tablet)|tablet)/i, /(kindle)\/([\w\.]+)/i, /(nook)[\w ]+build\/(\w+)/i, /(dell) (strea[kpr\d ]*[\dko])/i, /(le[- ]+pan)[- ]+(\w{1,9}) bui/i, /(trinity)[- ]*(t\d{3}) bui/i, /(gigaset)[- ]+(q\w{1,9}) bui/i, /(vodafone) ([\w ]+)(?:\)| bui)/i],
  32808. [u, a, [l, d]],
  32809. [/(surface duo)/i],
  32810. [a, [u, "Microsoft"],
  32811. [l, d]
  32812. ],
  32813. [/droid [\d\.]+; (fp\du?)(?: b|\))/i],
  32814. [a, [u, "Fairphone"],
  32815. [l, c]
  32816. ],
  32817. [/(u304aa)/i],
  32818. [a, [u, "AT&T"],
  32819. [l, c]
  32820. ],
  32821. [/\bsie-(\w*)/i],
  32822. [a, [u, "Siemens"],
  32823. [l, c]
  32824. ],
  32825. [/\b(rct\w+) b/i],
  32826. [a, [u, "RCA"],
  32827. [l, d]
  32828. ],
  32829. [/\b(venue[\d ]{2,7}) b/i],
  32830. [a, [u, "Dell"],
  32831. [l, d]
  32832. ],
  32833. [/\b(q(?:mv|ta)\w+) b/i],
  32834. [a, [u, "Verizon"],
  32835. [l, d]
  32836. ],
  32837. [/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],
  32838. [a, [u, "Barnes & Noble"],
  32839. [l, d]
  32840. ],
  32841. [/\b(tm\d{3}\w+) b/i],
  32842. [a, [u, "NuVision"],
  32843. [l, d]
  32844. ],
  32845. [/\b(k88) b/i],
  32846. [a, [u, "ZTE"],
  32847. [l, d]
  32848. ],
  32849. [/\b(nx\d{3}j) b/i],
  32850. [a, [u, "ZTE"],
  32851. [l, c]
  32852. ],
  32853. [/\b(gen\d{3}) b.+49h/i],
  32854. [a, [u, "Swiss"],
  32855. [l, c]
  32856. ],
  32857. [/\b(zur\d{3}) b/i],
  32858. [a, [u, "Swiss"],
  32859. [l, d]
  32860. ],
  32861. [/\b((zeki)?tb.*\b) b/i],
  32862. [a, [u, "Zeki"],
  32863. [l, d]
  32864. ],
  32865. [/\b([yr]\d{2}) b/i, /\b(dragon[- ]+touch |dt)(\w{5}) b/i],
  32866. [
  32867. [u, "Dragon Touch"], a, [l, d]
  32868. ],
  32869. [/\b(ns-?\w{0,9}) b/i],
  32870. [a, [u, "Insignia"],
  32871. [l, d]
  32872. ],
  32873. [/\b((nxa|next)-?\w{0,9}) b/i],
  32874. [a, [u, "NextBook"],
  32875. [l, d]
  32876. ],
  32877. [/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],
  32878. [
  32879. [u, "Voice"], a, [l, c]
  32880. ],
  32881. [/\b(lvtel\-)?(v1[12]) b/i],
  32882. [
  32883. [u, "LvTel"], a, [l, c]
  32884. ],
  32885. [/\b(ph-1) /i],
  32886. [a, [u, "Essential"],
  32887. [l, c]
  32888. ],
  32889. [/\b(v(100md|700na|7011|917g).*\b) b/i],
  32890. [a, [u, "Envizen"],
  32891. [l, d]
  32892. ],
  32893. [/\b(trio[-\w\. ]+) b/i],
  32894. [a, [u, "MachSpeed"],
  32895. [l, d]
  32896. ],
  32897. [/\btu_(1491) b/i],
  32898. [a, [u, "Rotor"],
  32899. [l, d]
  32900. ],
  32901. [/(shield[\w ]+) b/i],
  32902. [a, [u, "Nvidia"],
  32903. [l, d]
  32904. ],
  32905. [/(sprint) (\w+)/i],
  32906. [u, a, [l, c]],
  32907. [/(kin\.[onetw]{3})/i],
  32908. [
  32909. [a, /\./g, " "],
  32910. [u, "Microsoft"],
  32911. [l, c]
  32912. ],
  32913. [/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],
  32914. [a, [u, "Zebra"],
  32915. [l, d]
  32916. ],
  32917. [/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],
  32918. [a, [u, "Zebra"],
  32919. [l, c]
  32920. ],
  32921. [/smart-tv.+(samsung)/i],
  32922. [u, [l, p]],
  32923. [/hbbtv.+maple;(\d+)/i],
  32924. [
  32925. [a, /^/, "SmartTV"],
  32926. [u, "Samsung"],
  32927. [l, p]
  32928. ],
  32929. [/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],
  32930. [
  32931. [u, "LG"],
  32932. [l, p]
  32933. ],
  32934. [/(apple) ?tv/i],
  32935. [u, [a, "Apple TV"],
  32936. [l, p]
  32937. ],
  32938. [/crkey/i],
  32939. [
  32940. [a, "Chromecast"],
  32941. [u, "Google"],
  32942. [l, p]
  32943. ],
  32944. [/droid.+aft(\w)( bui|\))/i],
  32945. [a, [u, "Amazon"],
  32946. [l, p]
  32947. ],
  32948. [/\(dtv[\);].+(aquos)/i, /(aquos-tv[\w ]+)\)/i],
  32949. [a, [u, "Sharp"],
  32950. [l, p]
  32951. ],
  32952. [/(bravia[\w ]+)( bui|\))/i],
  32953. [a, [u, "Sony"],
  32954. [l, p]
  32955. ],
  32956. [/(mitv-\w{5}) bui/i],
  32957. [a, [u, "Xiaomi"],
  32958. [l, p]
  32959. ],
  32960. [/Hbbtv.*(technisat) (.*);/i],
  32961. [u, a, [l, p]],
  32962. [/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i, /hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],
  32963. [
  32964. [u, v],
  32965. [a, v],
  32966. [l, p]
  32967. ],
  32968. [/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],
  32969. [
  32970. [l, p]
  32971. ],
  32972. [/(ouya)/i, /(nintendo) ([wids3utch]+)/i],
  32973. [u, a, [l, "console"]],
  32974. [/droid.+; (shield) bui/i],
  32975. [a, [u, "Nvidia"],
  32976. [l, "console"]
  32977. ],
  32978. [/(playstation [345portablevi]+)/i],
  32979. [a, [u, "Sony"],
  32980. [l, "console"]
  32981. ],
  32982. [/\b(xbox(?: one)?(?!; xbox))[\); ]/i],
  32983. [a, [u, "Microsoft"],
  32984. [l, "console"]
  32985. ],
  32986. [/((pebble))app/i],
  32987. [u, a, [l, "wearable"]],
  32988. [/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],
  32989. [a, [u, "Apple"],
  32990. [l, "wearable"]
  32991. ],
  32992. [/droid.+; (glass) \d/i],
  32993. [a, [u, "Google"],
  32994. [l, "wearable"]
  32995. ],
  32996. [/droid.+; (wt63?0{2,3})\)/i],
  32997. [a, [u, "Zebra"],
  32998. [l, "wearable"]
  32999. ],
  33000. [/(quest( 2| pro)?)/i],
  33001. [a, [u, "Facebook"],
  33002. [l, "wearable"]
  33003. ],
  33004. [/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],
  33005. [u, [l, "embedded"]],
  33006. [/(aeobc)\b/i],
  33007. [a, [u, "Amazon"],
  33008. [l, "embedded"]
  33009. ],
  33010. [/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],
  33011. [a, [l, c]],
  33012. [/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],
  33013. [a, [l, d]],
  33014. [/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],
  33015. [
  33016. [l, d]
  33017. ],
  33018. [/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],
  33019. [
  33020. [l, c]
  33021. ],
  33022. [/(android[-\w\. ]{0,9});.+buil/i],
  33023. [a, [u, "Generic"]]
  33024. ],
  33025. engine: [
  33026. [/windows.+ edge\/([\w\.]+)/i],
  33027. [h, [s, "EdgeHTML"]],
  33028. [/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],
  33029. [h, [s, "Blink"]],
  33030. [/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, /ekioh(flow)\/([\w\.]+)/i, /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, /(icab)[\/ ]([23]\.[\d\.]+)/i, /\b(libweb)/i],
  33031. [s, h],
  33032. [/rv\:([\w\.]{1,9})\b.+(gecko)/i],
  33033. [h, s]
  33034. ],
  33035. os: [
  33036. [/microsoft (windows) (vista|xp)/i],
  33037. [s, h],
  33038. [/(windows) nt 6\.2; (arm)/i, /(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i, /(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],
  33039. [s, [h, b, w]],
  33040. [/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],
  33041. [
  33042. [s, "Windows"],
  33043. [h, b, w]
  33044. ],
  33045. [/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, /ios;fbsv\/([\d\.]+)/i, /cfnetwork\/.+darwin/i],
  33046. [
  33047. [h, /_/g, "."],
  33048. [s, "iOS"]
  33049. ],
  33050. [/(mac os x) ?([\w\. ]*)/i, /(macintosh|mac_powerpc\b)(?!.+haiku)/i],
  33051. [
  33052. [s, "Mac OS"],
  33053. [h, /_/g, "."]
  33054. ],
  33055. [/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],
  33056. [h, s],
  33057. [/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i, /(blackberry)\w*\/([\w\.]*)/i, /(tizen|kaios)[\/ ]([\w\.]+)/i, /\((series40);/i],
  33058. [s, h],
  33059. [/\(bb(10);/i],
  33060. [h, [s, "BlackBerry"]],
  33061. [/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],
  33062. [h, [s, "Symbian"]],
  33063. [/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],
  33064. [h, [s, "Firefox OS"]],
  33065. [/web0s;.+rt(tv)/i, /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],
  33066. [h, [s, "webOS"]],
  33067. [/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],
  33068. [h, [s, "watchOS"]],
  33069. [/crkey\/([\d\.]+)/i],
  33070. [h, [s, "Chromecast"]],
  33071. [/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],
  33072. [
  33073. [s, "Chromium OS"], h
  33074. ],
  33075. [/panasonic;(viera)/i, /(netrange)mmh/i, /(nettv)\/(\d+\.[\w\.]+)/i, /(nintendo|playstation) ([wids345portablevuch]+)/i, /(xbox); +xbox ([^\);]+)/i, /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i, /(mint)[\/\(\) ]?(\w*)/i, /(mageia|vectorlinux)[; ]/i, /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i, /(hurd|linux) ?([\w\.]*)/i, /(gnu) ?([\w\.]*)/i, /\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i, /(haiku) (\w+)/i],
  33076. [s, h],
  33077. [/(sunos) ?([\w\.\d]*)/i],
  33078. [
  33079. [s, "Solaris"], h
  33080. ],
  33081. [/((?:open)?solaris)[-\/ ]?([\w\.]*)/i, /(aix) ((\d)(?=\.|\)| )[\w\.])*/i, /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i, /(unix) ?([\w\.]*)/i],
  33082. [s, h]
  33083. ]
  33084. },
  33085. M = function(t, e) {
  33086. if ("object" == typeof t && (e = t, t = void 0), !(this instanceof M)) return new M(t, e)
  33087. .getResult();
  33088. var i = void 0 !== r && r.navigator ? r.navigator : void 0,
  33089. n = t || (i && i.userAgent ? i.userAgent : ""),
  33090. o = i && i.userAgentData ? i.userAgentData : void 0,
  33091. u = e ? function(t, e) {
  33092. var i = {};
  33093. for (var n in t) e[n] && e[n].length % 2 == 0 ? i[n] = e[n].concat(t[n]) : i[n] = t[n];
  33094. return i
  33095. }(x, e) : x,
  33096. p = i && i.userAgent == n;
  33097. return this.getBrowser = function() {
  33098. var t, e = {};
  33099. return e[s] = void 0, e[h] = void 0, y.call(e, n, u.browser), e.major = "string" == typeof(t = e[h]) ? t.replace(/[^\d\.]/g, "")
  33100. .split(".")[0] : void 0, p && i && i.brave && "function" == typeof i.brave.isBrave && (e[s] = "Brave"), e
  33101. }, this.getCPU = function() {
  33102. var t = {
  33103. architecture: void 0
  33104. };
  33105. return y.call(t, n, u.cpu), t
  33106. }, this.getDevice = function() {
  33107. var t = {
  33108. vendor: void 0,
  33109. model: void 0,
  33110. type: void 0
  33111. };
  33112. return y.call(t, n, u.device), p && !t[l] && o && o.mobile && (t[l] = c), p && "Macintosh" == t[a] && i && void 0 !== i.standalone && i.maxTouchPoints && i.maxTouchPoints > 2 && (t[a] = "iPad", t[l] = d), t
  33113. }, this.getEngine = function() {
  33114. var t = {
  33115. name: void 0,
  33116. version: void 0
  33117. };
  33118. return y.call(t, n, u.engine), t
  33119. }, this.getOS = function() {
  33120. var t = {
  33121. name: void 0,
  33122. version: void 0
  33123. };
  33124. return y.call(t, n, u.os), p && !t[s] && o && "Unknown" != o.platform && (t[s] = o.platform.replace(/chrome os/i, "Chromium OS")
  33125. .replace(/macos/i, "Mac OS")), t
  33126. }, this.getResult = function() {
  33127. return {
  33128. ua: this.getUA(),
  33129. browser: this.getBrowser(),
  33130. engine: this.getEngine(),
  33131. os: this.getOS(),
  33132. device: this.getDevice(),
  33133. cpu: this.getCPU()
  33134. }
  33135. }, this.getUA = function() {
  33136. return n
  33137. }, this.setUA = function(t) {
  33138. return n = "string" == typeof t && t.length > 350 ? v(t, 350) : t, this
  33139. }, this.setUA(n), this
  33140. };
  33141. M.VERSION = "0.7.35", M.BROWSER = f([s, h, "major"]), M.CPU = f(["architecture"]), M.DEVICE = f([a, u, l, "console", c, p, d, "wearable", "embedded"]), M.ENGINE = M.OS = f([s, h]), void 0 !== e ? (void 0 !== t && t.exports && (e = t.exports = M), e.UAParser = M) : i(181) ? void 0 === (n = function() {
  33142. return M
  33143. }.call(e, i, e, t)) || (t.exports = n) : void 0 !== r && (r.UAParser = M);
  33144. var T = void 0 !== r && (r.jQuery || r.Zepto);
  33145. if (T && !T.ua) {
  33146. var S = new M;
  33147. T.ua = S.getResult(), T.ua.get = function() {
  33148. return S.getUA()
  33149. }, T.ua.set = function(t) {
  33150. S.setUA(t);
  33151. var e = S.getResult();
  33152. for (var i in e) T.ua[i] = e[i]
  33153. }
  33154. }
  33155. }("object" == typeof window ? window : this)
  33156. }, function(t, e) {
  33157. (function(e) {
  33158. t.exports = e
  33159. })
  33160. .call(this, {})
  33161. }, function(t, e, i) {
  33162. (function(e) {
  33163. var n = i(0),
  33164. r = i(5),
  33165. o = new(i(2))(e);
  33166. t.exports = {
  33167. serialize: function(t) {
  33168. return encodeURI(JSON.stringify(t))
  33169. },
  33170. deserialize: function(t) {
  33171. try {
  33172. var e = JSON.parse(decodeURI(t));
  33173. return {
  33174. mode: r.fromInt(e._type),
  33175. panoId: e._locationid,
  33176. position: (new n.Vector3)
  33177. .copy(e._viewpoint),
  33178. quaternion: (new n.Quaternion)
  33179. .copy(e._rotation),
  33180. zoom: e._zoom,
  33181. floorVisibility: e.floor_visibility
  33182. }
  33183. } catch (e) {
  33184. o.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  33185. try {
  33186. var i = t.split(","),
  33187. a = {
  33188. x: parseFloat(i[2]),
  33189. y: parseFloat(i[3]),
  33190. z: parseFloat(i[4])
  33191. },
  33192. s = {
  33193. x: parseFloat(i[5]),
  33194. y: parseFloat(i[6]),
  33195. z: parseFloat(i[7]),
  33196. w: parseFloat(i[8])
  33197. };
  33198. return {
  33199. mode: r.fromInt(i[0]),
  33200. panoId: i[1],
  33201. position: (new n.Vector3)
  33202. .copy(a),
  33203. quaternion: (new n.Quaternion)
  33204. .copy(s)
  33205. }
  33206. } catch (e) {
  33207. o.warn('Invalid start override, ignoring: "' + t + '"', e.message)
  33208. }
  33209. }
  33210. return null
  33211. }
  33212. }
  33213. })
  33214. .call(this, "/js/controls/serializer.js")
  33215. }, function(t, e, i) {
  33216. (function(e) {
  33217. function n(t, e) {
  33218. this.model = t, this.panos = t.panos, this.player = e, this.imagePanos = this.listImagePanos(), this.retryMinimumTime = 1e4
  33219. }
  33220. var r = (i(0), i(5)),
  33221. o = (i(1), i(19)),
  33222. a = new(i(2))(e);
  33223. n.prototype.start = function() {
  33224. this.loadNextPano(function(t) {
  33225. t ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"), setTimeout(function() {
  33226. this.start()
  33227. }.bind(this), 1e3))
  33228. }.bind(this))
  33229. }, n.prototype.validLoadTarget = function(t) {
  33230. return t && !t.isLoaded("high") && Date.now() - t.failedLoadingAt > this.retryMinimumTime
  33231. }, n.prototype.listImagePanos = function() {
  33232. var t = [],
  33233. e = this;
  33234. return this.model.images.forEach((function(i) {
  33235. if (i._camera && i._camera._locationid) {
  33236. var n = e.model.panos.get(i._camera._locationid);
  33237. n && !n.isLoaded("high") && t.push(n)
  33238. }
  33239. })), t
  33240. }, n.prototype.nextNotLoadedImage = function() {
  33241. for (; this.imagePanos.length > 0;) {
  33242. var t = this.imagePanos[0];
  33243. if (!t.isLoaded("high")) return t;
  33244. this.imagePanos.shift()
  33245. }
  33246. return null
  33247. }, n.prototype.loadNextPano = function(t) {
  33248. var e, i, n = this.model.waitQueue.filter((function(t) {
  33249. return t.object instanceof o
  33250. }));
  33251. n.length > 0 ? (e = n[0].object, a.debug("Overrode pano selection: Flying to an unloaded pano " + e.id)) : this.validLoadTarget(this.player.currentPano) ? (e = this.player.currentPano, a.debug("Overrode pano selection: Currently at an unloaded pano " + e.id)) : this.validLoadTarget(this.player.closestPano) ? (e = this.player.closestPano, a.debug("Overrode pano selection: Hovering over an unloaded pano " + e.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high", e = this.imagePanos[0], a.debug("Overrode pano selection: Highlight image " + e.id)) : this.player.mode === r.PANORAMA && ((e = this.panos.lowestByScore([this.validLoadTarget.bind(this), o.filters.isNeighbourPanoTo(this.player.currentPano)], [o.scoreFunctions.distance(this.player.currentPano), o.scoreFunctions.direction(this.player.position, this.player.getDirection()), o.scoreFunctions.inFieldOfView(this.player.position, this.player.getDirection())])) && a.debug("Normal pano selection: neighbor " + e.id)), e ? (i = i || e.isLoaded("low") ? "high" : "low", a.debug("Preloading " + i + "-res pano " + e.id), e.loadCube(i)
  33252. .done(t)
  33253. .fail((function() {
  33254. a.warn("Failed preloading pano", e.id, ", marking it as failed and forgetting it for a while"), t()
  33255. }))) : t && t(null)
  33256. }, t.exports = n
  33257. })
  33258. .call(this, "/js/preloaders.js")
  33259. }, function(t, e, i) {
  33260. (function(e) {
  33261. function n(t, e, i) {
  33262. t && (t = t.toLowerCase()
  33263. .trim());
  33264. var n = new h.Vector3(0, 1, 0),
  33265. r = Math.PI / 3,
  33266. o = Math.PI / 2;
  33267. switch (t) {
  33268. case "left":
  33269. i.copy(e), i.applyAxisAngle(n, o);
  33270. break;
  33271. case "right":
  33272. i.copy(e), i.applyAxisAngle(n, -o);
  33273. break;
  33274. case "forwardleft":
  33275. i.copy(e), i.applyAxisAngle(n, r);
  33276. break;
  33277. case "forwardright":
  33278. i.copy(e), i.applyAxisAngle(n, -r);
  33279. break;
  33280. case "forward":
  33281. default:
  33282. i.copy(e)
  33283. }
  33284. return i
  33285. }
  33286. function r(t, e) {
  33287. if (t) {
  33288. var i = {
  33289. pano: t,
  33290. lookAtPoint: null,
  33291. duration: null,
  33292. maxDistanceOverride: null,
  33293. skipWarpingCheck: !1
  33294. };
  33295. this.player.flyToPano(i, (function() {
  33296. e && e({
  33297. success: !0,
  33298. message: "Transition complete."
  33299. })
  33300. }))
  33301. } else y.warn("Automation -> clickPanoObject: Unable to find pano."), e && e({
  33302. success: !1,
  33303. error: "Unable to find pano."
  33304. })
  33305. }
  33306. function o(t, e) {
  33307. var i = this.findRankedPano(t, e);
  33308. return i >= 0 ? this.handleToObject[i] : (y.warn("Automation -> findRankedPanoObject: Unable to find nearby pano."), null)
  33309. }
  33310. function a(t, e) {
  33311. var i = this.findRankedMattertag(t, e);
  33312. return i >= 0 ? this.handleToObject[i] : (y.warn("Automation -> findRankedMattertagObject: Unable to find nearby Mattertag."), null)
  33313. }
  33314. function s(t, e) {
  33315. e.copy(m.FORWARD), t.getDirection(e)
  33316. }
  33317. var l, u, h = i(0),
  33318. c = i(2),
  33319. d = i(5),
  33320. p = i(32),
  33321. f = i(1),
  33322. m = i(18),
  33323. g = i(185),
  33324. v = i(9),
  33325. y = new c(e),
  33326. b = null,
  33327. w = (u = new h.Vector3, function(t) {
  33328. t ? (u.copy(t.position), u.add(t.discPosition), v.projectPositionToCanvas(u, this.player.camera, u), this.click(u.x, u.y)) : y.warn("Automation -> clickMattertagObject: Unable to find Mattertag.")
  33329. }),
  33330. x = (l = new h.Vector3, function(t) {
  33331. var e = this.player.getDirection(),
  33332. i = 0,
  33333. n = 0;
  33334. if (this.player.mode === d.PANORAMA) i = f.insideLookLimitUp, n = f.insideLookLimitDown;
  33335. else {
  33336. if (this.player.mode !== d.DOLLHOUSE) return t;
  33337. i = f.dollhouseDefault.maxPolarAngle, n = f.dollhouseDefault.minPolarAngle
  33338. }
  33339. l.copy(e), l.y = 0, l.normalize();
  33340. var r = -h.Math.radToDeg(l.angleTo(e));
  33341. return t > (i -= r) && (t = i), t < (n -= r) && (t = n), t
  33342. });
  33343. g.setReceiver((function(t, e, i) {
  33344. if (e) {
  33345. var n = e.targetFunction,
  33346. r = e.params;
  33347. if (n) {
  33348. var o = b[n];
  33349. if (o) {
  33350. (r = r || {})
  33351. .onDone = function(t) {
  33352. g.respondToMessage(i, t)
  33353. };
  33354. var a = [];
  33355. for (var s in r) r.hasOwnProperty(s) && a.push(r[s]);
  33356. o.apply(b, a)
  33357. }
  33358. }
  33359. }
  33360. }));
  33361. var M = {};
  33362. b = {
  33363. handleToObject: {},
  33364. objectToHandle: {},
  33365. handleCount: 0,
  33366. director: null,
  33367. player: null,
  33368. init: function(t, e) {
  33369. this.director = t, this.player = e;
  33370. var i = M.onInitComplete;
  33371. i ? function(t) {
  33372. t({
  33373. success: !0,
  33374. message: "Init complete."
  33375. })
  33376. }(i) : M.onInitComplete = {
  33377. completed: !0
  33378. }
  33379. },
  33380. findRankedPano: function(t, e) {
  33381. var i = new h.Vector3,
  33382. r = new h.Vector3;
  33383. return function(t, e) {
  33384. s(this.player, r), n(e, r, i);
  33385. var o = this.player.rankedPanoInDirection(t, i);
  33386. if (o) {
  33387. var a = this.objectToHandle[o.id];
  33388. return a || (this.objectToHandle[o.id] = a = this.handleCount++, this.handleToObject[a] = o), a
  33389. }
  33390. return y.warn("Automation -> findRankedPano: Unable to find nearby pano."), -1
  33391. }
  33392. }(),
  33393. findRankedMattertag: function(t, e) {
  33394. var i = new h.Vector3,
  33395. r = new h.Vector3;
  33396. return function(t, e) {
  33397. s(this.player, r), n(e, r, i);
  33398. var o = this.player.rankedMattertagInDirection(t, i);
  33399. if (o) {
  33400. var a = this.objectToHandle[o.i];
  33401. return a || (this.objectToHandle[o.i] = a = this.handleCount++, this.handleToObject[a] = o), a
  33402. }
  33403. return y.warn("Automation -> findRankedMattertag: Unable to find nearby Mattertag."), -1
  33404. }
  33405. }(),
  33406. clickNearestMattertag: function(t) {
  33407. this.clickRankedMattertag(0, t)
  33408. },
  33409. clickRankedMattertag: function(t, e) {
  33410. var i = a.call(this, t, e);
  33411. i && w.call(this, i)
  33412. },
  33413. clickNearestPano: function(t, e) {
  33414. this.clickRankedPano(0, t, e)
  33415. },
  33416. clickRankedPano: function(t, e, i) {
  33417. var n = o.call(this, t, e);
  33418. n ? r.call(this, n, i) : i(null)
  33419. },
  33420. clickPano: function(t, e) {
  33421. var i = this.handleTable[t];
  33422. i ? r.call(this, i, e) : e(null)
  33423. },
  33424. rotate: function() {
  33425. function t(t) {
  33426. return "right" === t ? p.RIGHTARROW : "left" === t ? p.LEFTARROW : "up" === t ? p.I : "down" === t ? p.K : void 0
  33427. }
  33428. var e = (new h.Vector3, new h.Vector3),
  33429. i = new h.Vector3(0, 0, 0),
  33430. n = !1,
  33431. r = new h.Vector3;
  33432. return function(o, a, s) {
  33433. if (!n) {
  33434. if (!a || isNaN(a)) return y.warn("Automation -> rotate: Invalid rotation angle."), void(s && s({
  33435. success: !1,
  33436. error: "Invalid rotation angle."
  33437. }));
  33438. "right" === o || "left" === o ? (i.set(0, 1, 0), "right" === o && (a = -a)) : "up" === o || "down" === o ? (i.set(1, 0, 0), "down" === o && (a = -a), a = x.call(this, a)) : (y.warn("Automation -> rotate: Invalid direction for rotation: " + o), s && s({
  33439. success: !1,
  33440. error: "Invalid direction for rotation."
  33441. })), a = h.Math.degToRad(a), e = this.player.getDirection(), n = !0;
  33442. var l = this.player.controls[this.player.mode];
  33443. l.handleKeyDown(t(o));
  33444. var u = 0;
  33445. (function i() {
  33446. r.copy(m.FORWARD), this.player.getDirection(r);
  33447. var h = r.angleTo(e);
  33448. (u += Math.abs(h)) >= Math.abs(a) ? (n = !1, l.handleKeyUp(t(o)), s && s({
  33449. success: !0,
  33450. message: "Rotation complete."
  33451. })) : (e.copy(r), window.setTimeout(i.bind(this), 4))
  33452. })
  33453. .bind(this)()
  33454. }
  33455. }
  33456. }(),
  33457. click: function(t, e, i) {
  33458. !0 === i && (t = t / 100 * (window.renderWidth || window.innerWidth), e = e / 100 * (window.renderHeight || window.innerHeight)), this.player.handleInputStart(t, e), this.player.updateIntersect(), this.player.handleInputEnd(t, e)
  33459. },
  33460. mouseOver: function(t, e, i) {
  33461. !0 === i && (t = t / 100 * (window.renderWidth || window.innerWidth), e = e / 100 * (window.renderHeight || window.innerHeight)), this.player.handleInputMove(t, e), this.player.updateIntersect()
  33462. }
  33463. }, t.exports = b, window.__showcaseAutomationApi = b
  33464. })
  33465. .call(this, "/js/automation.js")
  33466. }, function(t, e, i) {
  33467. ! function() {
  33468. if ("performance" in window == 0 && (window.performance = {}), Date.now = Date.now || function() {
  33469. return (new Date)
  33470. .getTime()
  33471. }, "now" in window.performance == 0) {
  33472. var t = Date.now();
  33473. performance.timing && performance.timing.navigationStart && (t = performance.timing.navigationStart), window.performance.now = function() {
  33474. return Date.now() - t
  33475. }
  33476. }
  33477. }();
  33478. var n = n || {};
  33479. ! function(t) {
  33480. var e = 0,
  33481. i = 0,
  33482. n = 1,
  33483. r = function(t, e, i, n) {
  33484. return {
  33485. uid: t,
  33486. message: e,
  33487. type: i,
  33488. waitForResponse: n
  33489. }
  33490. },
  33491. o = {},
  33492. a = {},
  33493. s = null;
  33494. window.addEventListener("message", (function(e) {
  33495. var i = e.origin || e.originalEvent.origin;
  33496. t.receiveMessage(i, e.data, e.source)
  33497. }), !1), t.setReceiver = function(t) {
  33498. s = t
  33499. }, t.sendMessage = function(t, n, a, s) {
  33500. var l = e++;
  33501. if (s) {
  33502. var u = {
  33503. targetWindow: t,
  33504. uid: l,
  33505. timestamp: performance.now(),
  33506. onResponse: s
  33507. };
  33508. o[l] = u
  33509. }
  33510. var h = r(l, a, i, !!s);
  33511. t.postMessage(h, n)
  33512. }, t.receiveMessage = function(t, e, r) {
  33513. if (e) {
  33514. if (e.type === i && e.waitForResponse) {
  33515. var l = {
  33516. uid: e.uid,
  33517. timestamp: performance.now(),
  33518. sourceWindow: r
  33519. };
  33520. a[e.uid] = l
  33521. }
  33522. if (e.type === n) {
  33523. var u = e.uid,
  33524. h = o[u];
  33525. o[u] = null, h.onResponse && h.onResponse(e.message)
  33526. }
  33527. }
  33528. s && s(t, e.message, e.uid)
  33529. }, t.respondToMessage = function(t, e) {
  33530. var i = a[t];
  33531. if (i && i.sourceWindow) {
  33532. var o = r(t, e, n, !1);
  33533. i.sourceWindow.postMessage(o, "*"), a[o.uid] = null
  33534. }
  33535. }
  33536. }(n), t.exports = n
  33537. }, function(t, e, i) {
  33538. "use strict";
  33539. (function(e) {
  33540. var n, r, o, a = i(49),
  33541. s = i(0),
  33542. l = i(12),
  33543. u = i(187),
  33544. h = i(29),
  33545. c = i(48),
  33546. d = i(14),
  33547. p = (i(188), i(3)),
  33548. f = i(1),
  33549. m = i(189),
  33550. g = i(4)
  33551. .EventEmitter,
  33552. v = i(22),
  33553. y = i(190),
  33554. b = -1,
  33555. w = 0;
  33556. function x(t, e, i) {
  33557. this.scene = t, this.camera = e, this.renderer = null, this.stats = null, this.effects = i, this.animateCallback = null, this.composer = null, this.qualityManager = null, t.renderWidth = 0, t.renderHeight = 0, this.updateClock = new s.Clock, this.components = [], this.updateListeners = [], this.resizeListeners = [], this.forceUpdateSize = !1, this.started = !1, this.outlinePass = null, this.miniCameraControls = new y(this)
  33558. }
  33559. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame, x.prototype = Object.create(g.prototype), x.prototype.addComponent = function(t) {
  33560. this.components.push(t), t.update && this.updateListeners.push(t), t.setSize && (this.resizeListeners.push(t), this.forceUpdateSize = !0)
  33561. }, x.prototype.removeComponent = function(t) {
  33562. var e = function(e) {
  33563. return e != t
  33564. };
  33565. this.components = this.components.filter(e), this.updateListeners = this.updateListeners.filter(e), this.resizeListeners = this.resizeListeners.filter(e)
  33566. }, x.prototype.start = function(t) {
  33567. if (this.started) throw new d("Can't start SceneRenderer, already started");
  33568. this.createContext(t), this.boluoVrInit(), this.initComposer(), this.started = !0, this.miniCameraControls.init(), (M = M.bind(this))()
  33569. }, x.prototype.createContext = function(t) {
  33570. this.renderer = new s.WebGLRenderer({
  33571. preserveDrawingBuffer: !0
  33572. });
  33573. var e = (window.renderWidth || window.innerWidth),
  33574. i = (window.renderHeight || window.innerHeight);
  33575. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1), this.renderer.setSize(e, i), this.emit(c.ContextCreated), this.renderer.domElement.id = "house-player", t.appendChild(this.renderer.domElement)
  33576. }, x.prototype.getTextureTypeFromTarget = function(t, e) {
  33577. switch (e) {
  33578. case t.TEXTURE_CUBE_MAP_POSITIVE_X:
  33579. case t.TEXTURE_CUBE_MAP_NEGATIVE_X:
  33580. case t.TEXTURE_CUBE_MAP_POSITIVE_Y:
  33581. case t.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  33582. case t.TEXTURE_CUBE_MAP_POSITIVE_Z:
  33583. case t.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  33584. return u.TextureCube;
  33585. case t.TEXTURE_2D:
  33586. return u.Texture2D;
  33587. default:
  33588. return null
  33589. }
  33590. }, x.prototype.overrideTextures = function() {
  33591. var t = this.renderer.context,
  33592. e = 0,
  33593. i = t.createTexture;
  33594. t.createTexture = function() {
  33595. var n = i.call(t);
  33596. return n.id = e++, this.textures[n.id] = n, n
  33597. }.bind(this);
  33598. var n = t.texImage2D;
  33599. t.texImage2D = function(e, i, r, o, a, s, l, h, c) {
  33600. var d, p = this.getTextureTypeFromTarget(t, e);
  33601. d = p === u.TextureCube ? t.getParameter(t.TEXTURE_BINDING_CUBE_MAP) : t.getParameter(t.TEXTURE_BINDING_2D), void 0 !== l ? n.call(t, e, i, r, o, a, s, l, h, c) : (l = o, h = a, o = (c = s)
  33602. .naturalWidth, a = c.naturalHeight, n.call(t, e, i, r, l, h, c));
  33603. var f = this.textures[d.id];
  33604. f.width = p === u.TextureCube ? 6 * o : o, f.height = a
  33605. }.bind(this);
  33606. var r = t.deleteTexture;
  33607. t.deleteTexture = function(e) {
  33608. delete this.textures[e.id], r.call(t, e)
  33609. }.bind(this)
  33610. }, x.prototype.initComposer = function() {
  33611. var t = (window.renderWidth || window.innerWidth) * this.renderer.getPixelRatio(),
  33612. e = (window.renderHeight || window.innerHeight) * this.renderer.getPixelRatio();
  33613. this.composer = new s.EffectComposer(this.renderer);
  33614. var i = new s.RenderPass(this.scene, this.camera);
  33615. this.composer.addPass(i), this.outlinePass = new s.OutlinePass(new s.Vector2(t, e), this.scene, this.camera), this.outlinePass.visibleEdgeColor.set(59381), this.outlinePass.hiddenEdgeColor.set(59381), this.outlinePass.edgeThickness = 1, this.outlinePass.edgeStrength = 3, this.composer.addPass(this.outlinePass);
  33616. var n = new s.SMAAPass(t, e);
  33617. n.renderToScreen = !0, this.composer.addPass(n)
  33618. }, x.prototype.setSize = function(t, e) {
  33619. this.renderWidth = t, this.renderHeight = e, this.effects.aspect = t / e, this.renderer.setSize(t, e), this.composer.setSize(t, e);
  33620. for (var i = 0; i < this.resizeListeners.length; i++) this.resizeListeners[i].setSize(t, e);
  33621. G.render = this
  33622. }, x.prototype.render = function(t) {
  33623. this.renderer.setViewport(0, 0, (window.renderWidth || window.innerWidth), (window.renderHeight || window.innerHeight)), 0 < this.effects.currentBlur ? this.composer.render(t) : this.renderer.render(this.scene, this.camera), this.miniCameraControls.render()
  33624. }, x.prototype.boluoVrInit = function() {
  33625. this.isHuawei5X = p.detectHUAWEI5X(), this.oldRenderer = this.renderer, this.newRenderer = new this.vrRenderer(this.renderer, this, this.camera);
  33626. var t = this;
  33627. window._vrEnabled = !1, Object.defineProperty(t, "vrEnabled", {
  33628. get: function() {
  33629. return window._vrEnabled
  33630. },
  33631. set: function(e) {
  33632. (e = !!e) ? (t.renderer = t.newRenderer, window.vrMarkers.forEach((function(t) {
  33633. t.visible = !0
  33634. }))) : (t.renderer = t.oldRenderer, window.vrMarkers.forEach((function(t) {
  33635. t.visible = !1
  33636. }))), t.cursor.visible = e, t.setSize((window.renderWidth || window.innerWidth), (window.renderHeight || window.innerHeight)), window._vrEnabled = e
  33637. }
  33638. }), this.createCursor(.5, !1, 1, 16777215, 0);
  33639. var e = {
  33640. setSize: function(e, i) {
  33641. t.camera.aspect = e / i
  33642. }
  33643. };
  33644. this.resizeListeners.push(e), this.vrLoadingInit()
  33645. }, x.prototype.vrLoadingInit = function() {
  33646. var t = new(t = function(t) {
  33647. var e = this,
  33648. i = new s.RingGeometry(1.3, 1.5, 32, 32, 0, 1.2 * Math.PI),
  33649. n = new s.MeshBasicMaterial({
  33650. color: 4967932,
  33651. side: s.DoubleSide
  33652. }),
  33653. r = new s.Mesh(i, n);
  33654. this.mesh = r, r.position.z = -2, r.scale.set(.08, .08, .08), r.visible = !1, t.add(r), e.enabled = !1, this.update = function(t) {
  33655. 1 == e.enabled && (r.rotation.z += 15 * t)
  33656. }
  33657. })(this.camera);
  33658. window.Loading = t, this.updateListeners.push(t)
  33659. }, x.prototype.createCursor = function(t, e, i, n, r) {
  33660. var o, a = new s.SpriteMaterial({
  33661. opacity: i,
  33662. color: n,
  33663. transparent: e,
  33664. map: this.boluoGetTexture(v.splitUrl("./images/cursor.png")),
  33665. needsUpdate: !0,
  33666. side: s.DoubleSide
  33667. });
  33668. a.map.offset = new s.Vector2(1 / 17 * r, 0), a.map.repeat = new s.Vector2(1 / 17, 1), a.depthTest = !1, a.blending = s.AdditiveBlending, (o = new s.Sprite(a))
  33669. .scale.set(t, t, t), o.position.z = -2, o.visible = !1, o.name = "cursor", this.camera.add(o), this.scene.add(this.camera), this.cursor = o;
  33670. var l = new this.CursorAnimation(this.scene, o, this.camera);
  33671. this.cursor.triggerTargetEvent = l.triggerTargetEvent, this.updateListeners.push(l)
  33672. }, x.prototype.CursorAnimation = function(t, i, n) {
  33673. this.cursor = i, this.raycaster = new s.Raycaster, this.targetEventObj = {}, this.type = 1, this.tweenFlag = !0, this.target = n, this.euler = new s.Euler, this.q0 = new s.Quaternion, this.q1 = new s.Quaternion(-Math.sqrt(.5), 0, 0, Math.sqrt(.5)), this.zee = new s.Vector3(0, 0, 1), this.alpha = -1e3, this.beta = -1e3, this.gamma = -1e3, this.orient = s.Math.degToRad(window.orientation || 0);
  33674. var r = this;
  33675. window.addEventListener("orientationchange", (function() {
  33676. r.orient = s.Math.degToRad(window.orientation || 0)
  33677. })), window.addEventListener("deviceorientation", (function(t) {
  33678. var i = s.Math.degToRad(t.alpha),
  33679. n = s.Math.degToRad(t.beta),
  33680. o = s.Math.degToRad(t.gamma);
  33681. this.isHuawei5X ? (-1e3 === r.alpha && (r.alpha = i), -1e3 === r.beta && (r.beta = n), -1e3 === r.gamma && (r.gamma = o), Math.abs(i - r.alpha) > .06 && (r.alpha = i), Math.abs(n - r.beta) > .006 && (r.beta = n), Math.abs(o - r.gamma) > .006 && (r.gamma = o)) : (r.alpha = i, r.beta = n, r.gamma = o);
  33682. if (f.vrDebug) {
  33683. e("#info-device-orientation")
  33684. .css("display", "block");
  33685. var a = "";
  33686. a += "alpha=(" + r.alpha + ")<BR/>", a += "beta=(" + r.beta + ")<BR/>", a += "gamma=" + r.gamma + "<BR/>", document.getElementById("info-device-orientation")
  33687. .innerHTML = a
  33688. }
  33689. })), this.setObjectQuaternion = function(t, e, i, o, a) {
  33690. r.euler.set(i, e, -o, "YXZ"), t.setFromEuler(r.euler), t.multiply(r.q1), t.multiply(r.q0.setFromAxisAngle(r.zee, -a)), n.updateMatrixWorld()
  33691. }, parent !== window && window.addEventListener("message", (function(t) {
  33692. if (!t.data.type || "ZqApi.TagModule" !== t.data.type) {
  33693. var e = JSON.parse(t.data),
  33694. i = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  33695. e && e.alpha && e.beta && e.gamma && function(t) {
  33696. var i = s.Math.degToRad(e.alpha),
  33697. n = s.Math.degToRad(e.beta),
  33698. o = s.Math.degToRad(e.gamma);
  33699. t ? (-1e3 === r.alpha && (r.alpha = i), -1e3 === r.beta && (r.beta = n), -1e3 === r.gamma && (r.gamma = o), Math.abs(i - r.alpha) > .06 && (r.alpha = i), Math.abs(n - r.beta) > .006 && (r.beta = n), Math.abs(o - r.gamma) > .006 && (r.gamma = o)) : (r.alpha = i, r.beta = n, r.gamma = o)
  33700. }(i)
  33701. }
  33702. })), this.update = function(t) {
  33703. a.update(), window._vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient), this.triggerTargetEvent())
  33704. }, this.triggerTargetEvent = function() {
  33705. var t = this.choseObj(),
  33706. e = t ? t.object : void 0;
  33707. this.targetEventObj.currentObj = e, e !== this.targetEventObj.lastObj && (e && this.autoCursorPosition(t), 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(), e && e.enabled && this.startAnimate(function() {
  33708. this.clickCallback(e)
  33709. }.bind(this))) : this.type, this.targetEventObj.lastObj = e)
  33710. }, this.choseObj = function() {
  33711. this.raycaster.setFromCamera({
  33712. x: 0,
  33713. y: 0
  33714. }, n);
  33715. this.raycaster.ray;
  33716. var t = window.vrMarkers,
  33717. e = this.raycaster.intersectObjects(t);
  33718. if (e.length > 0) return e[0]
  33719. }, this.clickCallback = function(t) {
  33720. this.runTHREEAction(t, "onclick")
  33721. }, this.runTHREEAction = function(t, e) {
  33722. switch (e) {
  33723. case "onclick":
  33724. t._listeners && t._listeners.click && t._listeners.click.forEach((function(t) {
  33725. t()
  33726. }));
  33727. break;
  33728. case "onhover":
  33729. t._listeners && t._listeners.hover && t._listeners.hover.forEach((function(t) {
  33730. t()
  33731. }));
  33732. break;
  33733. case "onout":
  33734. t._listeners && t._listeners.out && t._listeners.out.forEach((function(t) {
  33735. t()
  33736. }))
  33737. }
  33738. }, this.startAnimate = function(t) {
  33739. this.tweenFlag && this.initAnimation(t)
  33740. }, this.initAnimation = function(t) {
  33741. var e = this,
  33742. i = this.cursor.material.map.offset;
  33743. e.tweenFlag = !1, this.cursorAnimate = new a.Tween(i)
  33744. .to({
  33745. x: 1
  33746. }, 1e3)
  33747. .onStart((function() {
  33748. e.tweenFlag = !1
  33749. }))
  33750. .onStop((function() {
  33751. e.tweenFlag = !0, this.x = 0, i.x = 0
  33752. }))
  33753. .onUpdate((function() {}))
  33754. .onComplete((function() {
  33755. t(), i.x = 0, setTimeout((function() {
  33756. e.tweenFlag = !0
  33757. }), 1500)
  33758. })), this.cursorAnimate.easing((function(t) {
  33759. return Math.floor(17 * t) / 17
  33760. })), this.cursorAnimate.start()
  33761. }, this.autoCursorPosition = function(t) {
  33762. var e = Math.abs(t.distance - 10);
  33763. this.cursor.position.z = -e, e /= 10, this.cursor.scale.set(e, e, e)
  33764. }
  33765. }, x.prototype.vrRenderer = function(t, e, i) {
  33766. var n = new e.vrCamera(i);
  33767. n.bananaAspect = .8, this.width, this.height;
  33768. e = this;
  33769. this.setSize = function(i, n) {
  33770. t.setSize.call(this, i, n), e.width = i, e.height = n
  33771. }, this.render = function(e, i, r, o) {
  33772. var a, s;
  33773. if (i.__RESS__SKIP__STEREO__) return t.render(e, i, r, o);
  33774. if ("PerspectiveCamera" === i.type) a = n.cameraL, s = n.cameraR, e.updateMatrixWorld(), null === i.parent && i.updateMatrixWorld(), n.vrCameraUpdate(i);
  33775. else {
  33776. if ("OrthographicCamera" !== i.type) return DEBUG && void 0;
  33777. a = s = i
  33778. }
  33779. t.setScissorTest(!0), t.setScissor(0, 0, this.width / 2, this.height), t.setViewport(0, 0, this.width / 2, this.height), t.render.call(this, e, a, r, o), t.setScissor(this.width / 2, 0, this.width / 2, this.height), t.setViewport(this.width / 2, 0, this.width / 2, this.height), t.render.call(this, e, s, r, o), t.setScissorTest(!1)
  33780. }, this.__proto__ = {
  33781. __proto__: t
  33782. }
  33783. }, x.prototype.vrCamera = function(t) {
  33784. this.type = "StereoCamera", this._aspect = 1, this._overlap = .064, this.cameraL = new s.PerspectiveCamera, this.cameraL.layers.enable(1), this.cameraL.matrixAutoUpdate = !1, this.cameraR = new s.PerspectiveCamera, this.cameraR.layers.enable(2), this.cameraR.matrixAutoUpdate = !1, this.eyeRight = new s.Matrix4, this.eyeLeft = new s.Matrix4, this.vrCameraNeedsUpdate = !0, Object.defineProperty(this, "bananaAspect", {
  33785. get: function() {
  33786. return this._aspect
  33787. },
  33788. set: function(t) {
  33789. this._aspect !== t && (this.vrCameraNeedsUpdate = !0), this._aspect = t
  33790. }
  33791. }), Object.defineProperty(this, "overlap", {
  33792. get: function() {
  33793. return this._overlap
  33794. },
  33795. set: function(t) {
  33796. this._overlap !== t && (this.vrCameraNeedsUpdate = !0), this._overlap = t
  33797. }
  33798. }), this.vrCameraUpdate = function(t) {
  33799. if (this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== t.fov || this.bananaReal_aspect !== t.aspect * this.bananaAspect || this.bananaNear !== t.near || this.bananaFar !== t.far, this.vrCameraNeedsUpdate) {
  33800. this.vrCameraNeedsUpdate = !1, this.bananaFocus = t.focus, this.bananaFov = t.fov, this.bananaReal_aspect = t.aspect * this.bananaAspect, this.bananaNear = t.near, this.bananaFar = t.far, this.bananaFocus = 10;
  33801. var e, i, n = t.projectionMatrix.clone(),
  33802. r = this.overlap / 2,
  33803. o = r * this.bananaNear / this.bananaFocus,
  33804. a = this.bananaNear * Math.tan(Math.PI / 180 * this.bananaFov * .5);
  33805. this.eyeLeft.elements[12] = -r, this.eyeRight.elements[12] = r, e = -a * this.bananaReal_aspect + o, i = a * this.bananaReal_aspect + o, n.elements[0] = 2 * this.bananaNear / (i - e), n.elements[8] = (i + e) / (i - e), this.cameraL.projectionMatrix.copy(n), e = -a * this.bananaReal_aspect - o, i = a * this.bananaReal_aspect - o, n.elements[0] = 2 * this.bananaNear / (i - e), n.elements[8] = (i + e) / (i - e), this.cameraR.projectionMatrix.copy(n)
  33806. }
  33807. this.cameraL.matrixWorld.copy(t.matrixWorld)
  33808. .multiply(this.eyeLeft), this.cameraR.matrixWorld.copy(t.matrixWorld)
  33809. .multiply(this.eyeRight)
  33810. }
  33811. }, x.prototype.boluoGetTexture = function(t) {
  33812. var e = new s.TextureLoader;
  33813. return e.crossOrigin = "anonymous", e.load(t)
  33814. }, x.prototype.updateScreenSize = function() {
  33815. //(window.innerWidth != this.renderWidth || (window.renderHeight || window.innerHeight) != this.renderHeight || this.forceUpdateSize) && (this.setSize(window.innerWidth, (window.renderHeight || window.innerHeight)), this.forceUpdateSize = !1)
  33816. }, x.prototype.updateComponents = function() {
  33817. for (var t = Math.min(1, this.updateClock.getDelta()), e = 0; e < this.updateListeners.length; e++) this.updateListeners[e].update(t)
  33818. }, x.prototype.computeCompassAngle = function() {
  33819. var t = this.camera.getWorldDirection(new s.Vector3),
  33820. e = (new s.Vector2)
  33821. .subVectors(new s.Vector2(t.z, t.x), new s.Vector2(0, -1));
  33822. e.y = e.y - 1;
  33823. var i = e.length(),
  33824. n = Math.acos(e.x / i);
  33825. e.y < 0 && (n *= -1), n = 180 * n / Math.PI + 180, this.emit("compass", n)
  33826. }, x.prototype.getImageData = (r = document.createElement("canvas"), o = r.getContext("2d"), function(t, e, i) {
  33827. return r.width == e && r.height == i || (r.width = e, r.height = i), o.drawImage(t, 0, 0, e, i), o.getImageData(0, 0, e, i)
  33828. }), x.prototype.initSizedTexture2D = function(t, e, i) {
  33829. var n = this.renderer,
  33830. r = n.context,
  33831. o = n.state,
  33832. a = new s.Texture(null);
  33833. a.flipY = !1, !0 !== i && (i = !1), a.generateMipmaps = i;
  33834. var l = n.paramThreeToGL(a.format),
  33835. u = n.paramThreeToGL(a.type),
  33836. h = n.properties.get(a),
  33837. c = r.createTexture();
  33838. o.bindTexture(r.TEXTURE_2D, c), r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY), r.texImage2D(r.TEXTURE_2D, 0, l, t, t, 0, l, u, null), a.wrapS = e, a.wrapT = e;
  33839. var d = n.paramThreeToGL(e);
  33840. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, d), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, d), i ? (a.magFilter = s.LinearFilter, a.minFilter = s.LinearMipMapLinearFilter, r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST), r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = s.LinearFilter, a.minFilter = s.LinearFilter, r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)), o.bindTexture(r.TEXTURE_2D, null), h.__webglTexture = c, a
  33841. }, x.prototype.initSizedCubeMap = function(t, e) {
  33842. var i = this.renderer,
  33843. n = i.context,
  33844. r = i.state,
  33845. o = new s.CubeTexture([null, null, null, null, null, null]);
  33846. o.flipY = !1, o.generateMipmaps = e;
  33847. var a = i.paramThreeToGL(o.format),
  33848. l = i.paramThreeToGL(o.type),
  33849. u = i.properties.get(o),
  33850. h = n.createTexture();
  33851. r.bindTexture(n.TEXTURE_CUBE_MAP, h), n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  33852. for (var c = 0; c < 6; c++) n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + c, 0, a, t, t, 0, a, l, null);
  33853. return e ? (o.magFilter = s.LinearFilter, o.minFilter = s.LinearMipMapLinearFilter, n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR), n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR), n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE), n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = s.LinearFilter, o.minFilter = s.LinearFilter, n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR), n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)), r.bindTexture(n.TEXTURE_CUBE_MAP, null), u.__image__webglTextureCube = h, o
  33854. }, x.prototype.deallocateCubeTexture = function(t) {
  33855. var e = this.renderer,
  33856. i = e.context,
  33857. n = e.properties.get(t);
  33858. i.deleteTexture(n.__image__webglTextureCube)
  33859. }, x.prototype.uploadTexture2D = function(t, e, i, n, r, o) {
  33860. var a = this.renderer,
  33861. s = a.context,
  33862. l = a.state,
  33863. u = a.properties.get(e);
  33864. l.bindTexture(s.TEXTURE_2D, u.__webglTexture), s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, e.flipY), s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, e.premultiplyAlpha), s.pixelStorei(s.UNPACK_ALIGNMENT, e.unpackAlignment), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(e.wrapS)), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(e.wrapT)), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(e.magFilter)), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(e.minFilter)), s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, t), e.generateMipmaps && s.generateMipmap(s.TEXTURE_2D), l.bindTexture(s.TEXTURE_2D, null)
  33865. }, x.prototype.rebuildMipMaps2D = function(t) {
  33866. var e = this.renderer,
  33867. i = e.context,
  33868. n = e.state;
  33869. e.properties.get(t), i.generateMipmap(i.TEXTURE_2D), n.bindTexture(i.TEXTURE_2D, null)
  33870. }, x.prototype.rebuildMipMaps3D = function(t) {
  33871. var e = this.renderer,
  33872. i = e.context,
  33873. n = e.state,
  33874. r = e.properties.get(t);
  33875. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube), i.generateMipmap(i.TEXTURE_CUBE_MAP), n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  33876. }, x.prototype.renderToCubeMap = function() {
  33877. var t = !1,
  33878. e = null,
  33879. i = null,
  33880. n = null,
  33881. r = null,
  33882. o = null;
  33883. return function(a, u, h, c, d, p, f, m, g, v, y, b, w, x, M, T) {
  33884. this.renderer.context, t || ((i = new s.OrthographicCamera(-.5, .5, .5, -.5, -200, 200))
  33885. .position.z = 150, (e = new s.Scene)
  33886. .add(i), n = new s.ShaderMaterial({
  33887. uniforms: {
  33888. tDiffuse: {
  33889. type: "t",
  33890. value: null
  33891. },
  33892. alpha: {
  33893. type: "f",
  33894. value: 1
  33895. }
  33896. },
  33897. vertexShader: l.basicTextured.vertexShader,
  33898. fragmentShader: l.basicTextured.fragmentShader,
  33899. depthWrite: !1,
  33900. depthTest: !1,
  33901. side: s.DoubleSide
  33902. }), r = new s.PlaneBufferGeometry(1, 1), (o = new s.Mesh(r, n))
  33903. .position.z = 0, e.add(o), t = !0);
  33904. var S = r.getAttribute("uv");
  33905. S.setDynamic(!0), S.needsUpdate = !0;
  33906. var _ = S.array,
  33907. A = d / h,
  33908. P = p / c,
  33909. C = f / h,
  33910. E = m / c;
  33911. _[0] = A, _[1] = P + E, _[2] = A + C, _[3] = P + E, _[4] = A, _[5] = P, _[6] = A + C, _[7] = P;
  33912. var D = r.getAttribute("position");
  33913. D.setDynamic(!0), D.needsUpdate = !0;
  33914. var L = D.array,
  33915. O = g / u.width - .5,
  33916. I = v / u.height - .5,
  33917. R = y / u.width,
  33918. N = b / u.height;
  33919. L[0] = O, L[1] = I + N, L[3] = O + R, L[4] = I + N, L[6] = O, L[7] = I, L[9] = O + R, L[10] = I, this.renderer.properties.get(a), n.uniforms.tDiffuse.value = a, n.blending = x || s.NoBlending, n.transparent = !!M, null != T || (T = 1), n.uniforms.alpha.value = T, n.needUpdate = !0, u.activeCubeFace = w, u.viewport.set(0, 0, u.width, u.height);
  33920. var k = this.renderer.autoClear;
  33921. this.renderer.autoClear = !1, this.renderer.render(e, i, u, !1), this.renderer.autoClear = k
  33922. }
  33923. }(), x.prototype.copyCubeMap = function() {
  33924. var t = !1,
  33925. e = null,
  33926. i = null,
  33927. n = null,
  33928. r = null,
  33929. o = null,
  33930. a = new s.Euler;
  33931. return new s.Vector3,
  33932. function(u, h, c, d, p, f, m, g, v) {
  33933. if (this.renderer, !t) {
  33934. (i = new s.OrthographicCamera(-1, 1, 1, -1, 0, 200))
  33935. .position.set(0, 0, 0), (e = new s.Scene)
  33936. .add(i), n = new s.ShaderMaterial({
  33937. uniforms: {
  33938. tDiffuse: {
  33939. type: "t",
  33940. value: null
  33941. },
  33942. alpha: {
  33943. type: "f",
  33944. value: 1
  33945. }
  33946. },
  33947. vertexShader: l.copyCubeMap.vertexShader,
  33948. fragmentShader: l.copyCubeMap.fragmentShader,
  33949. depthWrite: !1,
  33950. depthTest: !1,
  33951. side: s.DoubleSide
  33952. }), r = new s.BoxGeometry(2, 2, 2), o = new s.Mesh(r, n), e.add(o), t = !0
  33953. }
  33954. for (var y = 0; y < 6; y++) x.getCubeOrientationForCubeFace(y, a), o.rotation.copy(a), o.matrixWorldNeedsUpdate = !0, o.updateMatrixWorld(), n.uniforms.tDiffuse.value = u, n.blending = m || s.NoBlending, n.transparent = !!g, null != v || (v = 1), n.uniforms.alpha.value = v, n.needUpdate = !0, h.activeCubeFace = y, h.viewport.set(0, 0, p, f), this.renderer.render(e, i, h, !1)
  33955. }
  33956. }(), x.getCubeOrientationForCubeFace = function(t, e) {
  33957. switch (t) {
  33958. case h.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  33959. e.set(0, -Math.PI / 2, 0);
  33960. break;
  33961. case h.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  33962. e.set(0, Math.PI / 2, 0);
  33963. break;
  33964. case h.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  33965. e.set(Math.PI / 2, Math.PI, 0);
  33966. break;
  33967. case h.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  33968. e.set(-Math.PI / 2, Math.PI, 0);
  33969. break;
  33970. case h.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  33971. e.set(0, -Math.PI, 0);
  33972. break;
  33973. case h.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  33974. e.set(0, 0, 0)
  33975. }
  33976. }, x.prototype.renderSolidTileToCubeMap = function() {
  33977. var t = !1,
  33978. e = null,
  33979. i = null,
  33980. n = null,
  33981. r = null,
  33982. o = null;
  33983. return function(a, l, u, h, c, d, p, f, m, g) {
  33984. if (this.renderer.context, !t) {
  33985. (i = new s.OrthographicCamera(-.5, .5, .5, -.5, -200, 200))
  33986. .position.z = 150, (e = new s.Scene)
  33987. .add(i);
  33988. var v = ["void main() { ", " vec4 pos = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", " gl_Position = pos; ", "}"].join("\n"),
  33989. y = ["uniform vec4 blockColor;", "uniform float alpha;", "void main() {", " gl_FragColor = vec4(blockColor.rgb, alpha);", "}"].join("\n");
  33990. n = new s.ShaderMaterial({
  33991. uniforms: {
  33992. blockColor: {
  33993. type: "v4",
  33994. value: null
  33995. },
  33996. alpha: {
  33997. type: "f",
  33998. value: 1
  33999. }
  34000. },
  34001. vertexShader: v,
  34002. fragmentShader: y,
  34003. depthWrite: !1,
  34004. depthTest: !1,
  34005. side: s.DoubleSide
  34006. }), (r = new s.PlaneBufferGeometry(1, 1))
  34007. .getAttribute("position"), (o = new s.Mesh(r, n))
  34008. .position.z = 0, e.add(o), t = !0
  34009. }
  34010. n.uniforms.blockColor.value = p, null != g || (g = 1), n.uniforms.alpha.value = g, n.blending = f || s.NoBlending, n.transparent = !!m, n.needUpdate = !0, a.activeCubeFace = d, a.viewport.set(l, u, h, c), this.renderer.render(e, i, a, !1)
  34011. }
  34012. }(), x.prototype.showFPS = function() {
  34013. this.stats = new m, document.body.appendChild(this.stats.domElement)
  34014. };
  34015. var M = function(t) {
  34016. if (window.requestAnimationFrame(M), this.updateScreenSize(), this.updateComponents(), this.render(t), this.stats && this.stats.update(), -1 == b && G.model.settings.basic && G.model.settings.basic.user) {
  34017. var e = G.model.settings.basic.user.group;
  34018. b = 15 == e ? 1 : 0
  34019. }
  34020. if (1 == b && !0 === G.startEntryPage && !G.frameRate && G.player && "panorama" === G.player.mode) {
  34021. n || (n = (performance || Date)
  34022. .now());
  34023. var i = function() {
  34024. var t;
  34025. w++;
  34026. var e = (performance || Date)
  34027. .now();
  34028. if (e >= n + 1e3 && (t = 1e3 * w / (e - n), n = e, w = 0), t) return Math.ceil(t)
  34029. }();
  34030. G.frameRate = i
  34031. }
  34032. this.computeCompassAngle(), this.emit(c.AfterRender)
  34033. };
  34034. x.prototype.mesaueLensRender = function(t, e, i, n) {
  34035. this.renderer.render(t, e, i, n)
  34036. }, t.exports = x
  34037. })
  34038. .call(this, i(6))
  34039. }, function(t, e) {
  34040. t.exports = {
  34041. Texture2D: 0,
  34042. TextureCube: 1
  34043. }
  34044. }, function(t, e, i) {
  34045. function n(t) {
  34046. r.call(this, t)
  34047. }
  34048. var r = i(14);
  34049. n.prototype = Object.create(r.prototype), t.exports = n
  34050. }, function(t, e, i) {
  34051. var n;
  34052. t.exports = ((n = function() {
  34053. function t(t) {
  34054. return r.appendChild(t.dom), t
  34055. }
  34056. function e(t) {
  34057. for (var e = 0; e < r.children.length; e++) r.children[e].style.display = e === t ? "block" : "none";
  34058. i = t
  34059. }
  34060. var i = 0,
  34061. r = document.createElement("div");
  34062. r.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000", r.addEventListener("click", (function(t) {
  34063. t.preventDefault(), e(++i % r.children.length)
  34064. }), !1);
  34065. var o = (performance || Date)
  34066. .now(),
  34067. a = o,
  34068. s = 0,
  34069. l = t(new n.Panel("FPS", "#0ff", "#002")),
  34070. u = t(new n.Panel("MS", "#0f0", "#020"));
  34071. if (self.performance && self.performance.memory) var h = t(new n.Panel("MB", "#f08", "#201"));
  34072. return e(0), {
  34073. REVISION: 16,
  34074. dom: r,
  34075. addPanel: t,
  34076. showPanel: e,
  34077. begin: function() {
  34078. o = (performance || Date)
  34079. .now()
  34080. },
  34081. end: function() {
  34082. s++;
  34083. var t = (performance || Date)
  34084. .now();
  34085. if (u.update(t - o, 200), t > a + 1e3 && (l.update(1e3 * s / (t - a), 100), a = t, s = 0, h)) {
  34086. var e = performance.memory;
  34087. h.update(e.usedJSHeapSize / 1048576, e.jsHeapSizeLimit / 1048576)
  34088. }
  34089. return t
  34090. },
  34091. update: function() {
  34092. o = this.end()
  34093. },
  34094. domElement: r,
  34095. setMode: e
  34096. }
  34097. })
  34098. .Panel = function(t, e, i) {
  34099. var n = 1 / 0,
  34100. r = 0,
  34101. o = Math.round,
  34102. a = o(window.devicePixelRatio || 1),
  34103. s = 80 * a,
  34104. l = 48 * a,
  34105. u = 3 * a,
  34106. h = 2 * a,
  34107. c = 3 * a,
  34108. d = 15 * a,
  34109. p = 74 * a,
  34110. f = 30 * a,
  34111. m = document.createElement("canvas");
  34112. m.width = s, m.height = l, m.style.cssText = "width:80px;height:48px";
  34113. var g = m.getContext("2d");
  34114. return g.font = "bold " + 9 * a + "px Helvetica,Arial,sans-serif", g.textBaseline = "top", g.fillStyle = i, g.fillRect(0, 0, s, l), g.fillStyle = e, g.fillText(t, u, h), g.fillRect(c, d, p, f), g.fillStyle = i, g.globalAlpha = .9, g.fillRect(c, d, p, f), {
  34115. dom: m,
  34116. update: function(l, v) {
  34117. n = Math.min(n, l), r = Math.max(r, l), g.fillStyle = i, g.globalAlpha = 1, g.fillRect(0, 0, s, d), g.fillStyle = e, g.fillText(o(l) + " " + t + " (" + o(n) + "-" + o(r) + ")", u, h), g.drawImage(m, c + a, d, p - a, f, c, d, p - a, f), g.fillRect(c + p - a, d, a, f), g.fillStyle = i, g.globalAlpha = .9, g.fillRect(c + p - a, d, a, o((1 - l / v) * f))
  34118. }
  34119. }
  34120. }, n)
  34121. }, function(t, e, i) {
  34122. var n = i(0),
  34123. r = i(8),
  34124. o = i(10),
  34125. a = null,
  34126. s = null,
  34127. l = {
  34128. top: -451,
  34129. left: (window.renderWidth || window.innerWidth) - 480 - 260
  34130. },
  34131. u = !0;
  34132. function h(t) {
  34133. a = t, this.player = null, s = this
  34134. }
  34135. h.prototype.init = function() {
  34136. this.player = G.player, a.miniCamera = new n.PerspectiveCamera, a.on("virtual-update-position", (function(t) {
  34137. a.miniCamera = new n.PerspectiveCamera(t.fov, 1, .5, t.distance), a.miniCamera.position.copy(t.positions[0]), a.miniCamera.quaternion.copy(t.quaternion), a.miniCamera.lookAt(t.positions[1]), a.miniCamera.updateProjectionMatrix()
  34138. })), s.player.updateMiniCameraPosition = function(t) {
  34139. r.start(o.property(l, t.direction, t.new), 200), "left" === t.direction && (u = !(t.new > t.old))
  34140. }, s.player.on("choosed-virtual-camera", (function() {
  34141. l.left = (window.renderWidth || window.innerWidth) - 480 - 260, r.start(o.property(l, "top", 0), 200)
  34142. })), s.player.on("hidePutModelInfoPanel", (function() {
  34143. r.start(o.property(l, "top", -415), 200), l.left = (window.renderWidth || window.innerWidth) - 480 - 260
  34144. })), s.player.miniCameraScreenShot = function(t) {
  34145. s.getImage(t)
  34146. }, s.player.saveVirturalCameraScreenshot = function() {
  34147. var t = window.screenshotData,
  34148. e = [];
  34149. return t.forEach((function(t, i) {
  34150. e.push({
  34151. uuid: i,
  34152. name: t.name,
  34153. url: t.url
  34154. })
  34155. })), t = null, JSON.stringify(e)
  34156. }
  34157. }, h.prototype.render = function() {
  34158. a.renderer.clearDepth(), a.renderer.setScissorTest(!0), a.renderer.setScissor(l.left, l.top, 480, 360), a.renderer.setViewport(l.left, l.top, 480, 360), a.renderer.render(a.scene, a.miniCamera), a.renderer.setScissorTest(!1)
  34159. }, h.prototype.getImage = function(t) {
  34160. var e = new Image;
  34161. e.src = a.renderer.domElement.toDataURL("image/png", 1), e.onload = function() {
  34162. var i = document.createElement("canvas"),
  34163. n = i.getContext("2d");
  34164. i.width = 480 * window.devicePixelRatio, i.height = 360 * window.devicePixelRatio, n.drawImage(e, l.left * window.devicePixelRatio, 0, (window.renderWidth || window.innerWidth) * window.devicePixelRatio, (window.renderHeight || window.innerHeight) * window.devicePixelRatio, 0, 0, (window.renderWidth || window.innerWidth) * window.devicePixelRatio, (window.renderHeight || window.innerHeight) * window.devicePixelRatio);
  34165. var r = i.toDataURL("image/png");
  34166. t && t(r)
  34167. }
  34168. }, window.addEventListener("resize", (function() {
  34169. l.left = u ? (window.renderWidth || window.innerWidth) - 480 - 260 : (window.renderWidth || window.innerWidth) - 480 - 5
  34170. })), t.exports = h
  34171. }, function(t, e, i) {
  34172. (function(e) {
  34173. function n(t, e, i, n) {
  34174. this.qualityManager = t, this.scene = e, this.camera = i, this.container = n, this.quickstartCamera = new p, this.endFOV = a.insideFOV, this.quickstartCamera.fov = this.endFOV + g.quickstart.fovChange, this.controls = new f(this.quickstartCamera), this.controls.bindEvents(n), this.controls.enabled = !0, this.controls.locked = !0, this.skybox = null
  34175. }
  34176. var r = i(0),
  34177. o = i(2),
  34178. a = i(26),
  34179. s = i(8),
  34180. l = i(10),
  34181. u = i(15),
  34182. h = i(18),
  34183. c = i(23),
  34184. d = (i(43), i(192)),
  34185. p = i(37),
  34186. f = i(35),
  34187. m = (i(30), i(75), i(193)),
  34188. g = (i(3), i(1)),
  34189. v = i(194),
  34190. y = new o("/js/scene/QuickstartManager.js");
  34191. n.prototype.load = function(t) {
  34192. t.pano.shouldRedrawOnBaseLoaded = !0;
  34193. var i, n = this,
  34194. r = h.FORWARD.clone()
  34195. .applyQuaternion(t.quaternion),
  34196. o = r.clone()
  34197. .negate();
  34198. this.controls.lookAt(r.add(this.quickstartCamera.position));
  34199. var a = this.qualityManager.getPanoSize(c.BASE);
  34200. this.qualityManager.getPanoSize(c.STANDARD);
  34201. if (t.pano.tiled) {
  34202. window.loadingCount = 1, window.firstPanoId = t.pano.id, y.warn("Loading startPano, TILED", t.pano.id), t.pano.update();
  34203. var s = m.getHFOVForCamera(this.quickstartCamera, (window.renderWidth || window.innerWidth), (window.renderHeight || window.innerHeight)),
  34204. l = this.quickstartCamera.fov;
  34205. y.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + s + ", vertical FOV: " + l + "]"), i = t.pano.loadTiledPano(a, o, null, !1, !1, !0)
  34206. } else y.warn("Loading startPano", t.pano.id), i = t.pano.loadCube("high");
  34207. return e.when(i)
  34208. .then(function() {
  34209. n.init(t.pano, t.quaternion), t.pano.tiled ? i.done(function() {
  34210. t.pano.lockUntilRenderingComplete = !1, this.controls.locked = !1
  34211. }.bind(this)) : this.controls.locked = !1
  34212. }.bind(this))
  34213. }, n.prototype.init = function(t, i) {
  34214. y.info("Quickstart done loading, adding scene objects"), t.lockUntilRenderingComplete = !0, this.skybox = new r.Mesh(new r.CubeGeometry(1, 1, 1), new d({
  34215. side: r.BackSide
  34216. })), this.skybox.material.uniforms.map.value = t.skybox, this.skybox.quaternion.copy(t.quaternion), this.scene.add(this.skybox), e(this.container)
  34217. .show()
  34218. }, n.prototype.update = function(t) {
  34219. this.controls.update(t), this.camera.copy(this.quickstartCamera)
  34220. }, n.prototype.setSize = function(t, e) {
  34221. this.quickstartCamera.updateAspect(t / e)
  34222. }, n.prototype.destroy = function() {
  34223. this.scene.remove(this.skybox)
  34224. }, n.prototype.startLanding = function() {
  34225. function t() {
  34226. var t = s.getById("quickAnimation"),
  34227. e = t.length > 0 ? t[0].current : g.quickstart.animation,
  34228. n = e < g.quickstart.animation ? g.quickstart.animation - e : 0;
  34229. setTimeout(r, n), i()
  34230. }
  34231. function i() {
  34232. o.forEach((function(e) {
  34233. document.body.removeEventListener(e, t, !0)
  34234. }))
  34235. }
  34236. var n = e.Deferred(),
  34237. r = n.resolve.bind(n);
  34238. s.start(l.property(this.quickstartCamera, "fov", this.endFOV, function() {
  34239. this.quickstartCamera.updateProjectionMatrix()
  34240. }.bind(this)), g.quickstart.animation, null, 0, u.easeOutQuad, null, "quickAnimation");
  34241. var o = ["touchstart", "mousedown", "keydown"];
  34242. o.forEach((function(e) {
  34243. document.body.addEventListener(e, t, !0)
  34244. }));
  34245. var a = v.isQuickstartHelpEnabled() ? g.quickstart.fadeOutDelay : g.quickstart.animation;
  34246. return setTimeout(r, a), setTimeout(i, a), n.promise()
  34247. }, t.exports = n
  34248. })
  34249. .call(this, i(6))
  34250. }, function(t, e, i) {
  34251. function n(t) {
  34252. t = t || {}, r.RawShaderMaterial.call(this, a.extendObject({
  34253. fragmentShader: o.cube.fragmentShader,
  34254. vertexShader: o.cube.vertexShader,
  34255. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  34256. name: "CubemapMaterial"
  34257. }, t))
  34258. }
  34259. var r = i(0),
  34260. o = i(12),
  34261. a = i(7);
  34262. n.prototype = Object.create(r.RawShaderMaterial.prototype), n.prototype.constructor = n, t.exports = n
  34263. }, function(t, e, i) {
  34264. var n = i(56),
  34265. r = function(t, e, i) {
  34266. var r = e,
  34267. o = i;
  34268. return 2 * Math.atan(Math.tan(t * n.RADIANS_PER_DEGREE / 2) * (r / o)) * n.DEGREES_PER_RADIAN
  34269. };
  34270. t.exports = {
  34271. getHFOVForCamera: function(t, e, i) {
  34272. return r(t.fov, e, i)
  34273. },
  34274. getHFOVFromVFov: r
  34275. }
  34276. }, function(t, e, i) {
  34277. var n = i(3),
  34278. r = i(2),
  34279. o = i(1),
  34280. a = new r("/js/gui/helpManager.js"),
  34281. s = function() {
  34282. var t;
  34283. try {
  34284. return t = window.localStorage.getItem("visitCount") || "0", t = (parseFloat(t) + 1)
  34285. .toString(), window.localStorage.setItem("visitCount", t), a.debug("visitCount = " + t), t
  34286. } catch (e) {
  34287. t = "1", a.debug("couldn't set local storage")
  34288. }
  34289. }();
  34290. t.exports = {
  34291. isHelpEnabled: function() {
  34292. return ("1" === s || "1" === n.valueFromHash("help", null)) && "0" !== n.valueFromHash("help", null) && o.warp.auto < 0
  34293. },
  34294. isQuickstartHelpEnabled: function() {
  34295. if (o.quickstart.enabled && this.isHelpEnabled()) return !0
  34296. },
  34297. isStandardHelpEnabled: function() {
  34298. if (!o.quickstart.enabled && this.isHelpEnabled()) return !0
  34299. }
  34300. }
  34301. }, function(t, e, i) {
  34302. function n(t, e, i) {
  34303. this.maxNavPanoSize = -1, this.maxZoomPanoSize = -1, this.devicePixelDensity = t, this.deviceScreenSize = e, this.clientBandwidth = i, this.panoSizeClassMap = {}, this.useHighResolutionPanos = !0, this.useUltraHighResolutionPanos = !1, this.modelHasUltraHighPanos = !1
  34304. }
  34305. var r = i(23),
  34306. o = i(1),
  34307. a = i(3),
  34308. s = i(26),
  34309. l = (i(25), i(21));
  34310. n.prototype.init = function(t) {
  34311. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth), this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH), this.highSize = this.getPanoSize(r.HIGH), this.standardSize = this.getPanoSize(r.STANDARD), this.baseSize = this.getPanoSize(r.BASE), o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0), this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold), this.updateMaximums(), t.on(l.ActiveModelChanged, this.onModelChanged.bind(this))
  34312. }, n.prototype.updateFromModel = function(t) {
  34313. this.updateHighResolutionSettings(t), this.updateUltraHighResolutionSettings(t)
  34314. }, n.prototype.updateHighResolutionSettings = function(t) {
  34315. this.updateMaximums()
  34316. }, n.prototype.updateUltraHighResolutionSettings = function(t) {
  34317. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1, this.updateMaximums()
  34318. }, n.prototype.enableUltraHighQualityMode = function() {
  34319. this.modelHasUltraHighPanos = !0, this.updateUltraHighResolutionSettings(null)
  34320. }, n.prototype.ultraHighQualityModeEnabled = function() {
  34321. return this.modelHasUltraHighPanos
  34322. }, n.prototype.onModelChanged = function(t) {
  34323. this.updateFromModel(t.model), this.updateMaximums()
  34324. }, n.prototype.updateMaximums = function() {
  34325. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(), this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(), this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  34326. }, n.prototype.buildPanoSizeClassMap = function() {
  34327. this.panoSizeClassMap[r.BASE] = 512, this.panoSizeClassMap[r.STANDARD] = 1024, this.panoSizeClassMap[r.HIGH] = 2048, this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  34328. }, n.prototype.getPanoSize = function(t) {
  34329. return this.panoSizeClassMap[t]
  34330. }, n.prototype.getMaxPossiblePanoSize = function() {
  34331. return this.getPanoSize(r.ULTRAHIGH)
  34332. }, n.prototype.getMaxPanoSize = function() {
  34333. return this.maxZoomPanoSize
  34334. }, n.prototype.getMaxNavPanoSize = function() {
  34335. return this.maxNavPanoSize
  34336. }, n.prototype.getMaxZoomPanoSize = function() {
  34337. return this.maxZoomPanoSize
  34338. }, n.prototype.detectMaxNavPanoSizeClass = function() {
  34339. var t = "";
  34340. return t = o.screenshot ? o.panoramaSettings.screenshot_2k ? r.HIGH : r.STANDARD : o.panoramaSettings.loading_2k ? r.HIGH : r.STANDARD, this.useHighResolutionPanos ? (a.isMobile() || ((window.renderHeight || window.innerHeight), this.highQualityThreshold), t) : r.STANDARD
  34341. }, n.prototype.detectMaxNavPanoSize = function() {
  34342. var t = this.detectMaxNavPanoSizeClass();
  34343. return this.getPanoSize(t)
  34344. }, n.prototype.detectMaxZoomPanoSize = function() {
  34345. return this.useHighResolutionPanos ? a.isMobile() ? o.tiling.mobileHighQualityOverride ? this.getPanoSize(r.HIGH) : this.getPanoSize(r.STANDARD) : this.useUltraHighResolutionPanos ? this.getPanoSize(r.ULTRAHIGH) : this.getPanoSize(r.HIGH) : this.getPanoSize(r.STANDARD)
  34346. }, t.exports = n
  34347. }, function(t, e, i) {
  34348. (function(e) {
  34349. var n, r, o, a, s, l, u, h, c = i(0),
  34350. d = i(2),
  34351. p = i(7),
  34352. f = i(1),
  34353. m = i(24),
  34354. g = i(31),
  34355. v = i(21),
  34356. y = i(42),
  34357. b = i(20),
  34358. w = i(197),
  34359. x = i(4)
  34360. .EventEmitter,
  34361. M = i(39),
  34362. T = new d("/js/mattertag/MattertagManager.js");
  34363. function S() {
  34364. this.tagState = w.IDLE, this.intersectTag = null, this.hoveredTag = null, this.activeTag = null, this.mattertagDiscs = [], this.raycaster = new c.Raycaster, this.modelManager = null, this.player = null, this.director = null, this.totalMattertags = 0, this.lastAudioTag = null, this.hide360TagForce = ""
  34365. }
  34366. p.extend(S, x), S.prototype.init = function(t, i, n) {
  34367. this.modelManager = t, this.player = i, this.director = n, this.updateModel(), this.bindEvents();
  34368. var r = this;
  34369. e("#iframe-close, .help_back")
  34370. .click((function() {
  34371. e("#iframe-close")
  34372. .addClass("css-sprites"), document.getElementsByClassName("iframe-open")[0].src = "about:blank", r.dismissExaminedTag()
  34373. })), e(".closeTagContainer")
  34374. .on("click", (function() {
  34375. e(".pctagcontainer")
  34376. .fadeOut(300, (function() {
  34377. e(".moreImages")
  34378. .remove()
  34379. })), setTimeout((function() {
  34380. e(".imageCon")
  34381. .attr("src", "")
  34382. .removeClass("longimgCon highimgCon commimgCon"), e(".topimg")
  34383. .removeClass("topimgCss")
  34384. }), 300), r.dismissExaminedTag()
  34385. })), G.settings.building.rooms && (this.hasroom = !0)
  34386. }, S.prototype.update = function(t) {
  34387. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  34388. }, S.prototype.updateTags = function(t, e, i, n) {
  34389. for (var r in this.model.mattertags) 12 !== this.model.mattertags[r].type && this.model.mattertags[r].update(t, e, i, n, this.show360TagPanoId)
  34390. }, S.prototype.updateModel = function() {
  34391. this.model = this.modelManager.getActiveModel(), this.getMattertagsFromModel(), this.totalMattertags = Object.keys(this.model.mattertags)
  34392. .length
  34393. }, S.prototype.getMattertagsFromModel = function() {
  34394. for (var t in this.mattertagDiscs = [], this.model.mattertags) {
  34395. var e = this.model.mattertags[t].disc;
  34396. e && this.mattertagDiscs.push(e)
  34397. }
  34398. }, S.prototype.bindEvents = function() {
  34399. this.modelManager.on(v.ActiveModelChanged, this.updateModel.bind(this)), this.player.on(b.ModeChanging, this.onPlayerModeChanging.bind(this)), this.player.on(b.Move, this.onPlayerMove.bind(this)), this.player.on(b.Ready, this.onPlayerReady.bind(this)), this.player.on(b.FlyingEnded, this.onPlayerFlyingEnded.bind(this)), this.player.on(b.WarpStarted, this.handleWarpStart.bind(this)), this.player.on(b.WarpInterrupted, this.handleWarpInterruption.bind(this))
  34400. }, S.prototype.handleWarpStart = function(t, e, i, n) {
  34401. this.dismissExaminedTag(), e === m.BLACK && (n = n || f.warp.teleportTime, t && (i = g.END), this.hideShowTagsForBlackoutStyle(i, n))
  34402. }, S.prototype.handleWarpInterruption = function(t, e, i) {
  34403. i = i || f.warp.teleportTime, this.hideShowTagsForBlackoutStyle(e, i)
  34404. }, S.prototype.hideShowTagsForBlackoutStyle = function(t, e) {
  34405. var i = 0,
  34406. n = 0,
  34407. r = e / 2;
  34408. switch (null == t && (t = g.MIDDLE), t) {
  34409. case g.END:
  34410. this.hideAllMattertags(r);
  34411. break;
  34412. case g.BEGINNING:
  34413. this.hideAllMattertags()
  34414. .done(this.showAllMattertags.bind(this, r));
  34415. break;
  34416. case g.NONE:
  34417. break;
  34418. case g.MIDDLE:
  34419. i = r, n = r, this.hideAllMattertags(n), setTimeout(function() {
  34420. this.showAllMattertags(i)
  34421. }.bind(this), n);
  34422. break;
  34423. case g.FADEIN:
  34424. setTimeout(function() {
  34425. this.showAllMattertags(r)
  34426. }.bind(this), r)
  34427. }
  34428. }, S.prototype.onPlayerModeChanging = function() {
  34429. this.dismissExaminedTag()
  34430. }, S.prototype.onPlayerMove = function() {
  34431. this.dismissExaminedTag(!0)
  34432. }, S.prototype.onPlayerReady = function(t, e, i) {
  34433. this.startAllMattertags(t, e ? i : null)
  34434. }, S.prototype.onPlayerFlyingEnded = function(t, e) {
  34435. t && this.updateClosestTags(t)
  34436. }, S.prototype.dismissExaminedTag = function(t) {
  34437. t && this.activeTag && this.activeTag.type === M.Audio ? (this.boardState, this.tagState = w.BROWSE) : (this.activeTag && this.tagState === w.EXAMINE && this.dismissActiveTag(), this.hoveredTag && (this.hoveredTag.setFreeState(!0), this.hoveredTag = null))
  34438. }, S.prototype.startAllMattertags = function(t, e) {
  34439. this.model.shouldShowMattertags = f.mattertags.enabled, t || (this.showAllMattertags(f.mattertags.startup.fadeInDuration, f.mattertags.startup.fadeInDelay), e && setTimeout(function() {
  34440. this.activateTag(this.model.getTagByIdx(e))
  34441. }.bind(this), f.mattertags.startup.fadeInDuration / 2))
  34442. }, S.prototype.showAllMattertags = function(t, i) {
  34443. function n() {
  34444. ++o === this.totalMattertags && (this.model.tagsShown = !0, r.resolve())
  34445. }
  34446. var r = e.Deferred(),
  34447. o = 0;
  34448. if (!this.model.shouldShowMattertags) return r.resolve()
  34449. .promise();
  34450. for (var a in this.model.mattertags) {
  34451. var s = this.model.mattertags[a];
  34452. s.type !== M.Title && s.type !== M.RegionalJump && s.show(t, i)
  34453. .done(n.bind(this))
  34454. }
  34455. return this.showtitletags = !0, this.updatetitletags(), r.promise()
  34456. }, S.prototype.updatetitletags = function() {
  34457. if (this.showtitletags && G.titletags && "panorama" === G.player.mode) {
  34458. var t, i, n, r = G.player.camera.clone();
  34459. this.ttagsshow = [], this.ttagshide = [];
  34460. for (var o = 0; o < G.titletags.length; o++)
  34461. if (G.player && G.player.currentPano && 2 === G.player.currentPano.alignmentType) this.ttagsshow.push(G.titletags[o]);
  34462. else if ("dollhouse" !== G.player.mode && "floorplan" !== G.player.mode)
  34463. if (this.hasroom) n = G.titletags[o], G.player.currentPano && G.model.panos.index[n.locationId] && G.player.currentPano.roomid === G.model.panos.index[n.locationId].roomid ? this.ttagsshow.push(G.titletags[o]) : this.ttagshide.push(G.titletags[o]);
  34464. else {
  34465. if ((i = (t = G.titletags[o].position)
  34466. .clone()
  34467. .distanceTo(r.position)) <= f.titletagMaxdistance) {
  34468. var a = new c.Raycaster(r.position, r.position.clone()
  34469. .sub(t)
  34470. .normalize())
  34471. .intersectObjects(G.model.colliders);
  34472. if (a.length, !a.length || a[0].distance - i > -.5) {
  34473. this.ttagsshow.push(G.titletags[o]);
  34474. continue
  34475. }
  34476. }
  34477. this.ttagshide.push(G.titletags[o])
  34478. }
  34479. else this.ttagshide.push(G.titletags[o]);
  34480. this.ttposition()
  34481. } else e(".viewport-tag")
  34482. .css("display", "none")
  34483. }, S.prototype.ttposition = function() {
  34484. if (!this.ttagsshow) return !0;
  34485. for (var t = G.player.camera.clone(), i = t.getWorldDirection(new c.Vector3), n = 0; n < this.ttagsshow.length; n++) {
  34486. var r = this.ttagsshow[n],
  34487. o = r.position;
  34488. if (o.clone()
  34489. .sub(t.position)
  34490. .normalize()
  34491. .angleTo(i) > Math.PI / 2) e("#titletag" + r.i)
  34492. .css("display", "none");
  34493. else {
  34494. var a = o.clone()
  34495. .project(t),
  34496. s = (a.x + 1) / 2 * 100,
  34497. l = (1 - a.y) / 2 * 100;
  34498. e("#titletag" + r.i)
  34499. .css({
  34500. display: "",
  34501. left: s + "%",
  34502. top: l + "%"
  34503. })
  34504. }
  34505. }
  34506. for (n = 0; n < this.ttagshide.length; n++) e("#titletag" + this.ttagshide[n].i)
  34507. .css("display", "none")
  34508. }, S.prototype.updateRegionalJumpTags = function(t) {
  34509. var e = null;
  34510. for (var i in this.model.mattertags) {
  34511. var n = this.model.mattertags[i],
  34512. r = n.data;
  34513. i >= 3e4 && (t.roomid === n.data.roomidx ? (n.isTargetRoomHavePoint = !1, e = new c.Line3(new c.Vector3(r.base.x, 0, r.base.z), new c.Vector3(t.position.x, 0, t.position.z)), this.model.settings.locations.points.forEach((function(t) {
  34514. t.roomidx === n.data.target_room && (n.isTargetRoomHavePoint = !0)
  34515. })), !n.isTargetRoomHavePoint || e.distance() < 1 ? n.hide(0, 0) : n.show(0, 0)) : n.hide(0, 0))
  34516. }
  34517. }, S.prototype.hideAllMattertags = function(t, i) {
  34518. function n() {
  34519. ++o === this.totalMattertags && (this.model.tagsShown = !1, r.resolve())
  34520. }
  34521. var r = e.Deferred(),
  34522. o = 0;
  34523. for (var a in this.model.mattertags) {
  34524. var s = this.model.mattertags[a];
  34525. s.type !== M.RegionalJump && s.type !== M.Title && -1 !== s.tagid && -2 !== s.tagid && (s.hide(t, i)
  34526. .done(n.bind(this)), s === this.activeTag && this.dismissActiveTag()), s.type !== M.RegionalJump && s.type !== M.Title && -1 !== s.tagid && -2 !== s.tagid ? (s.hide(t, i)
  34527. .done(n.bind(this)), s === this.activeTag && this.dismissActiveTag()) : 12 === s.type && -1 !== s.tagid && -2 !== s.tagid && ++o === this.totalMattertags && (this.model.tagsShown = !1, r.resolve())
  34528. }
  34529. return r.promise()
  34530. }, S.prototype.update360Tags = function(t) {
  34531. var i = e.Deferred();
  34532. for (var n in this.hideAllMattertags(f.mattertags.startup.fadeInDuration), this.model.mattertags) {
  34533. var r = this.model.mattertags[n];
  34534. if (r.type == M.Tag360T1 || 1 === r.subtype) {
  34535. var o = this;
  34536. setTimeout((function() {
  34537. o.show360TagPanoId = t
  34538. }), 600)
  34539. }
  34540. }
  34541. return i.promise()
  34542. }, S.prototype.hideAllMattertagsExceptType = function(t, i, n) {
  34543. function r() {
  34544. ++a === this.totalMattertags && (this.model.tagsShown = !1, o.resolve())
  34545. }
  34546. var o = e.Deferred(),
  34547. a = 0;
  34548. for (var s in this.model.mattertags) {
  34549. var l = this.model.mattertags[s];
  34550. l.type !== t && (l.hide(i, n)
  34551. .done(r.bind(this)), l === this.activeTag && this.dismissActiveTag())
  34552. }
  34553. return o.promise()
  34554. }, S.prototype.activateTag = function(t, e) {
  34555. e = e || w.EXAMINE, this.activeTag = t, "panorama" === this.player.mode && (this.activeTag.type === M.IFrame || this.activeTag.type === M.ImageText || this.activeTag.type === M.ImageTextAudio || this.activeTag.type === M.Video || this.activeTag === M.IKEA ? document.getElementsByTagName("html")
  34556. .item(0)
  34557. .style.cursor = "default" : this.activeTag.type === M.Tag360T1 || (document.getElementsByTagName("html")
  34558. .item(0)
  34559. .style.cursor = "default", (this.activeTag.type != M.TextOnly && this.activeTag !== M.TextAudio || null != this.activeTag.label && "" != this.activeTag.label) && (this.activeTag.type == M.TagTo360 || this.activeTag.setHoverState(e === w.EXAMINE)))), this.tagState = e, T.error("=========emitTagEvent=======state", e), this.emit(y.TagActivated, t), this.emitTagEvent(t, e)
  34560. }, S.prototype.activateAudioTag = function(t, e, i) {
  34561. e = e || w.EXAMINE, this.activeTag = t, this.activeTag.setHoverState(e === w.EXAMINE, i), this.tagState = e, this.emit(y.TagActivated, t)
  34562. }, S.prototype.activateOtherModelTag = function(t, e, i) {
  34563. e = e || w.EXAMINE, this.activeTag = t, this.activeTag.setHoverState(e === w.EXAMINE, i), this.tagState = e, this.emit(y.TagActivated, t)
  34564. }, S.prototype.dismissActiveTag = function(t) {
  34565. if (null !== this.activeTag) {
  34566. t ? this.lastAudioTag && this.lastAudioTag.setFreeState(!0, !0) : this.activeTag.setFreeState(!0);
  34567. var e = this.activeTag;
  34568. this.activeTag = null, this.tagState = w.IDLE, this.emit(y.TagDismissed, e)
  34569. }
  34570. }, S.prototype.dismissAudioActiveTag = function() {
  34571. if (null != this.activeTag) {
  34572. var t = this.activeTag;
  34573. this.lastAudioTag.setFreeState(!0, !0), this.activeTag = null, this.tagState = w.IDLE, this.emit(y.TagDismissed, t)
  34574. }
  34575. }, S.prototype.pauseAudioTag = function() {
  34576. null != this.lastAudioTag && this.lastAudioTag.setFreeState(!0, !0)
  34577. }, S.prototype.openTag = function(t, e, i) {
  34578. t && (this.activeTag = t, this.tagState = w.EXAMINE, t.setHoverState(!0, 0), e && e >= 0 && (this.toid = setTimeout(function() {
  34579. this.closeTag(), i && i()
  34580. }.bind(this), e)))
  34581. }, S.prototype.closeTag = function() {
  34582. e(".pctagcontainer")
  34583. .fadeOut(300), e("#iframe-parent")
  34584. .css("display", "none"), e(".help_back")
  34585. .css("display", "none"), this.activeTag && (this.activeTag.stopAudio(), this.activeTag.setClosedState()), this.dismissExaminedTag(), this.activeTag = null, this.tagState = w.IDLE
  34586. }, S.prototype.clickedOnTag = function(t, e, i) {
  34587. var n, r, o, a, s, l, u, h = this;
  34588. if (this.intersectTag.type === M.BuildingType) return i.stopPropagation(), !0;
  34589. if (this.intersectTag.type === M.TagTo360 || this.intersectTag.type === M.Tag360T1) {
  34590. if (i.stopPropagation(), this.director) {
  34591. var d = function(t) {
  34592. var e = -1;
  34593. for (var i in h.player.model.images.list) h.player.model.images.list[i].sceneid == t && (e = i);
  34594. return e
  34595. }(this.intersectTag.tagInfoUrl); - 1 === d && (d = 0), this.director.goToHighlight(d)
  34596. }
  34597. return !0
  34598. }
  34599. if (this.intersectTag.type === M.RegionalJump) {
  34600. i.stopPropagation();
  34601. var p = (n = this.intersectTag.data.target_room, r = this.intersectTag.data.base, o = G.settings.locations.points, a = [], s = null, l = [], u = null, o && (o.forEach((function(t) {
  34602. n === t.roomidx && (s = new c.Line3(new c.Vector3(r.x, 0, r.z), new c.Vector3(t.viewpoint.x, 0, t.viewpoint.y)), t.lineLength = s.distance(), l.push(s.distance()), a.push(t))
  34603. })), l.sort((function(t, e) {
  34604. return t - e
  34605. })), a.forEach((function(t) {
  34606. t.lineLength === l[0] && (u = t.locationid)
  34607. }))), u),
  34608. f = (function(t) {
  34609. var e = G.settings.nestscenes.scenes,
  34610. i = null,
  34611. n = new c.Vector3,
  34612. r = t.target_scene,
  34613. o = new c.Vector3(t.base.x, 0, t.base.z),
  34614. a = new c.Vector3(t.end_position.x, 0, t.end_position.z);
  34615. e && (e.forEach((function(t) {
  34616. r === parseInt(t.sceneid) && (i = t._camera._locationid)
  34617. })), G.settings.locations.points.forEach((function(t) {
  34618. i === t.locationid && n.copy(t.spot)
  34619. .add((new c.Vector3)
  34620. .subVectors(a, o))
  34621. })))
  34622. }(this.intersectTag.data), e);
  34623. h.intersectTag.data.base, h.intersectTag.data.end_position;
  34624. return f.model.panos.list.forEach((function(t) {
  34625. p === t.id && f.flyToPano({
  34626. pano: t
  34627. })
  34628. })), !0
  34629. }
  34630. if (!(this.intersectTag.type != M.TextOnly && this.intersectTag !== M.TextAudio || null != this.intersectTag.label && "" != this.intersectTag.label)) return !0;
  34631. if (this.intersectTag.type == M.Pano) return !0;
  34632. if (!t) return this.tagState !== w.EXAMINE ? (this.intersectTag.type === M.Audio ? (null == this.lastAudioTag && (this.lastAudioTag = this.intersectTag), this.intersectTag.i == this.lastAudioTag.i ? "active" == this.intersectTag.boardState ? this.dismissActiveTag(!0) : this.intersectTag.setHoverState(!0, 0) : (this.dismissActiveTag(!0), this.intersectTag.setHoverState(!0, 0), this.lastAudioTag = this.intersectTag)) : (this.pauseAudioTag(), this.dismissActiveTag(!0), this.intersectTag.type === M.OtherModel || this.intersectTag.type === M.IFrame || this.intersectTag.type === M.ImageText || this.intersectTag.type === M.ImageTextAudio || this.intersectTag.type === M.TextOnly || this.intersectTag.type === M.TextAudio || this.intersectTag === M.IKEA ? this.intersectTag.setHoverState(!0, 0) : this.intersectTag.setHoverState(!0)), this.activeTag = this.intersectTag, (this.intersectTag.type !== M.IFrame && this.intersectTag.type !== M.ImageText && this.intersectTag.type !== M.ImageTextAudio || this.intersectTag !== M.IKEA) && this.activeTag.examineMattertag(this.player, this.activateTag.bind(this)), this.tagState = w.EXAMINE, this.emit(y.TagNavigation, this.activeTag), !0) : (this.dismissActiveTag(!0), !1);
  34633. if (this.tagState === w.IDLE) return this.intersectTag.type === M.Audio ? (null == this.lastAudioTag && (this.lastAudioTag = this.intersectTag), this.intersectTag.i == this.lastAudioTag.i ? this.activateAudioTag(this.intersectTag, w.EXAMINE, 1) : (this.dismissAudioActiveTag(), this.lastAudioTag = this.intersectTag, this.activateAudioTag(this.intersectTag, w.EXAMINE, 0))) : (this.pauseAudioTag(), this.dismissActiveTag(), this.intersectTag.type === M.OtherModel || this.intersectTag.type === M.IFrame || this.intersectTag.type === M.ImageText || this.intersectTag.type === M.ImageTextAudio || this.intersectTag.type === M.Video || this.intersectTag.type === M.TextOnly || this.intersectTag.type === M.TextAudio || this.intersectTag === M.IKEA ? this.activateOtherModelTag(this.intersectTag, w.EXAMINE, 0) : this.activateTag(this.intersectTag, w.EXAMINE));
  34634. if (this.tagState === w.EXAMINE) return this.intersectTag !== this.activeTag ? this.intersectTag.type === M.Audio ? (this.pauseAudioTag(), this.dismissActiveTag(), this.lastAudioTag = this.intersectTag, this.activateAudioTag(this.intersectTag, w.EXAMINE, 1)) : (this.pauseAudioTag(), this.dismissActiveTag(), this.intersectTag.type === M.OtherModel || this.intersectTag.type === M.IFrame || this.intersectTag.type === M.ImageText || this.intersectTag.type === M.ImageTextAudio || this.intersectTag === M.IKEA ? this.activateOtherModelTag(this.intersectTag, w.EXAMINE, 0) : this.activateTag(this.intersectTag, w.EXAMINE)) : this.intersectTag.type === M.Audio ? (this.pauseAudioTag(), this.dismissActiveTag(), !1) : (this.dismissActiveTag(), this.intersectTag.type !== M.ImageText && this.intersectTag.type !== M.ImageTextAudio && this.intersectTag !== M.IKEA || this.intersectTag.label || this.intersectTag.data.details.description || this.intersectTag.tagInfoUrl || this.activateOtherModelTag(this.intersectTag, w.EXAMINE, 0), !1);
  34635. if (this.tagState === w.BROWSE) {
  34636. if (this.intersectTag.type !== M.Audio) return this.pauseAudioTag(), this.dismissActiveTag(), this.intersectTag.type === M.OtherModel || this.intersectTag.type === M.IFrame || this.intersectTag.type === M.ImageText || this.intersectTag.type === M.ImageTextAudio || this.intersectTag === M.IKEA ? this.activateOtherModelTag(this.intersectTag, w.EXAMINE, 0) : this.activateTag(this.intersectTag, w.EXAMINE);
  34637. this.intersectTag.i == this.lastAudioTag.i ? (this.pauseAudioTag(), this.dismissActiveTag()) : (this.pauseAudioTag(), this.lastAudioTag = this.intersectTag, this.intersectTag.setHoverState(!0, 0))
  34638. }
  34639. }, S.prototype.disposeCursorFor360 = function(t) {
  34640. t && t.type === M.Tag360T1 ? document.getElementsByTagName("html")
  34641. .item(0)
  34642. .style.cursor = "pointer" : document.getElementsByTagName("html")
  34643. .item(0)
  34644. .style.cursor = "default"
  34645. }, S.prototype.intersectMattertag = (n = new c.Vector3, r = new c.Vector3, o = new c.Vector3, function(t, e, i) {
  34646. var a = null,
  34647. s = this.mattertagDiscs.filter((function(t) {
  34648. return t.parent.visible
  34649. }));
  34650. if (s.length > 0) {
  34651. var l = this.model.floors.reduce((function(t, e) {
  34652. return e.hidden ? t : t.concat(e.collider.children)
  34653. }), s);
  34654. n.set(t.x, t.y, -1)
  34655. .unproject(i), r.set(t.x, t.y, 1)
  34656. .unproject(i), o.copy(r)
  34657. .sub(n)
  34658. .normalize(), this.raycaster.set(n, o);
  34659. var u = this.raycaster.intersectObjects(l);
  34660. u.length > 0 && -1 !== s.indexOf(u[0].object) && u[0].object.tag.type && ((a = u[0].object.tag)
  34661. .i >= 3e4 ? a = G.model.mattertags[a.i] : a.i >= 1e4 && (a = G.model.mattertags[a.i - 1e4]))
  34662. }
  34663. return this.intersectTag = a, this.disposeCursorFor360(a), e && (this.activeTag && a !== this.activeTag && (this.tagState === w.BROWSE || this.tagState === w.EXAMINE && a) && this.dismissActiveTag(), a && a !== this.activeTag && (a.listeners("enter")
  34664. .length < 1 && (a.on("enter", function(t) {
  34665. this.hoveredTag = t
  34666. }.bind(this)), a.on("leave", function(t) {
  34667. this.hoveredTag = null
  34668. }.bind(this))), this.activateTag(a, w.BROWSE))), a
  34669. }), S.prototype.rankedMattertagInDirection = (a = [], s = [], l = new c.Vector3, u = new c.Vector3, h = new c.Vector3, function(t, e, i, n) {
  34670. var r = 0;
  34671. s.length = 0;
  34672. for (var o = 0; o < this.closestMattertags.length; o++) {
  34673. var c = this.closestMattertags[o];
  34674. u.copy(c.position), u.add(c.discPosition), l.copy(e), l.sub(u)
  34675. .negate(), l.normalize();
  34676. var d = l.dot(n);
  34677. if (d >= 0 && (h.copy(u), h.project(i), this.intersectMattertag(h, !1, i))) {
  34678. if (r >= a.length)
  34679. for (var p = 0; p < 64; p++) a.push({
  34680. tag: c,
  34681. dot: d
  34682. });
  34683. var f = a[r];
  34684. f.tag = c, f.dot = d, f.position = math.projectPositionToCanvas(u, i), s.push(f), r++
  34685. }
  34686. }
  34687. return s.sort((function(t, e) {
  34688. return t.dot > e.dot ? -1 : t.dot < e.dot ? 1 : 0
  34689. })), t < s.length ? s[t].tag : null
  34690. }), S.prototype.updateClosestTags = function() {
  34691. var t = new c.Vector3;
  34692. return function(e) {
  34693. this.closestMattertags || (this.closestMattertags = []), this.closestMattertags.length = 0;
  34694. var i = this.model.mattertags;
  34695. if (i)
  34696. for (var n in i)
  34697. if (i.hasOwnProperty(n)) {
  34698. if (n >= 1e4) return;
  34699. var r = i[n],
  34700. o = r.position;
  34701. t.copy(e), t.sub(o)
  34702. .negate();
  34703. var a = t.lengthSq();
  34704. 12 !== r.type && a < 30 && this.closestMattertags.push(r)
  34705. }
  34706. }
  34707. }(), S.prototype.emitTagEvent = function(t, e) {
  34708. if (T.warn("=========emitTagEvent=======tag===mode", t, e), "-1" !== t.tagid) {
  34709. var i = t.data.details,
  34710. n = "";
  34711. for (var r in e === w.EXAMINE ? e = "click" : e === w.BROWSE && (e = "hover"), t.type === M.TextOnly && (i.orientationAndPosition = t.getBillboardOrientationAndPosition(this.player.camera)), M)
  34712. if (i.templatetype === M[r]) {
  34713. n = r, i.type = r;
  34714. break
  34715. } var o = {
  34716. tagId: t.tagid,
  34717. type: n,
  34718. mode: e,
  34719. detail: i
  34720. };
  34721. "click" === e && (this.tagState = w.BROWSE, this.activeTag = t), this.emit("tagActiveEvent", o)
  34722. }
  34723. }, t.exports = S
  34724. })
  34725. .call(this, i(6))
  34726. }, function(t, e) {
  34727. t.exports = {
  34728. IDLE: "idle",
  34729. BROWSE: "browse",
  34730. EXAMINE: "examine"
  34731. }
  34732. }, function(t, e, i) {
  34733. (function(e) {
  34734. function n(t) {
  34735. this.panos = null, this.retryMinimumTime = 1e4, this.urls = null, this.panoLoadCallbacks = {}, this.downloadDescriptors = {}, this.priorityQueue = [], this.forceQueue = [], this.activeDownloads = [], this.qualityManager = null, this.tilePrioritizer = null, this.refreshInterval = null, this.processPriorityQueue = !1, this.concurrentDownloads = t.concurrentDownloads || 1, this.downloadTestResults = {}
  34736. }
  34737. var r, o, a, s, l = i(0),
  34738. u = (i(5), i(1)),
  34739. h = (i(19), i(2)),
  34740. c = (i(18), i(23), i(76)),
  34741. d = i(38),
  34742. p = i(30),
  34743. f = (i(29), i(65)),
  34744. m = i(36),
  34745. g = i(11),
  34746. v = i(4)
  34747. .EventEmitter,
  34748. y = (new h(e), Object.freeze({
  34749. Testing: 1,
  34750. Success: 2,
  34751. Fail: 3
  34752. }));
  34753. n.prototype = Object.create(v.prototype), n.IDLE_REFRESH_DELAY = 500, n.ACTIVE_REFRESH_DELAY = 0, n.DOWNLOAD_RETRIES = 4, n.prototype.init = function(t) {
  34754. this.qualityManager = t
  34755. }, n.prototype.setUrls = function(t) {
  34756. this.urls = t
  34757. }, n.prototype.setPanoData = function(t, e, i) {
  34758. this.panos = t, this.imagePanos = e, this.panoGroupId = i
  34759. }, n.prototype.start = function() {
  34760. this.refreshUpdateInterval(0)
  34761. }, n.prototype.stop = function() {
  34762. window.cancel(this.refreshInterval)
  34763. }, n.prototype.refreshUpdateInterval = function(t) {
  34764. t || (t = 0), this.refreshInterval = window.setTimeout(function() {
  34765. this.update() ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  34766. }.bind(this), t)
  34767. }, n.prototype.update = function() {
  34768. var t = this.forceQueue.length > 0;
  34769. return this.processQueueForDownloading(this.forceQueue), this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos), this.priorityQueue.length > 0 && (t = !0), this.processQueueForDownloading(this.priorityQueue)), t
  34770. }, n.prototype.forceQueueTilesForPano = (a = [], s = [], function(t, e, i, n, r, o) {
  34771. a.length = 0;
  34772. for (var l = this.getTileDownloadDescriptors(t, e), u = 0; u < l.length; u++) {
  34773. var h = l[u];
  34774. h.status !== f.None && h.status !== f.Queued || a.push(h)
  34775. }
  34776. if (i && a.length > 0) {
  34777. d.sortPanoTiles(a, t, i), s.length = 0, p.matchingTilesInDirection(t, e, i, n, r, s);
  34778. for (var c = 0, m = function(t) {
  34779. return t.face === g.face && t.faceTileIndex === g.faceTileIndex
  34780. }; c < a.length;) {
  34781. var g = a[c];
  34782. s.findIndex(m) < 0 ? a.splice(c, 1) : c++
  34783. }
  34784. }
  34785. for (var v = 0; v < a.length; v++) this.forceQueue.push(a[v]);
  34786. this.setStatusForAllDescriptors(this.forceQueue, f.ForceQueued), this.clearFromQueue(this.priorityQueue, f.ForceQueued, !1), o && this.processQueueForDownloading(this.forceQueue, !0)
  34787. }), n.prototype.clearForceQueue = function() {
  34788. this.clearQueue(this.forceQueue)
  34789. }, n.prototype.queuePrioritizedTilesForPanos = function(t) {
  34790. this.tilePrioritizer && (this.clearQueue(this.priorityQueue), this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, t, this), this.clearFromQueue(this.priorityQueue, f.None, !0), this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, f.Queued))
  34791. }, n.prototype.clearQueue = function(t) {
  34792. this.setStatusForAllDescriptors(t, f.None), t.length = 0
  34793. }, n.prototype.clearFromQueue = function(t, e, i) {
  34794. for (var n = 0; n < t.length; n++) {
  34795. var r = t[n];
  34796. r && (e === r.status && !i || e !== r.status && i) && (t[n] = null)
  34797. }
  34798. }, n.prototype.setStatusForAllDescriptors = function(t, e) {
  34799. for (var i = 0; i < t.length; i++) {
  34800. var n = t[i];
  34801. n && (n.status = e)
  34802. }
  34803. }, n.prototype.setStatusOrRemoveForAllDescriptors = function(t, e) {
  34804. for (var i = 0; i < t.length; i++) {
  34805. var n = t[i];
  34806. n && (n.status !== e ? n.status = e : t[i] = null)
  34807. }
  34808. }, n.prototype.getTileDownloadDescriptors = function(t, e) {
  34809. var i = this.getAllTileDownloadDescriptorsForPano(t),
  34810. n = i[e];
  34811. return n || (n = this.buildDownloadDescriptorArray(e), i[e] = n, this.initTileDownloadDescriptors(n, t, e)), n
  34812. }, n.prototype.getAllTileDownloadDescriptorsForPano = function(t) {
  34813. var e = this.downloadDescriptors[t.id];
  34814. return e || (e = {}, this.downloadDescriptors[t.id] = e), e
  34815. }, n.prototype.processQueueForDownloading = function(t, e) {
  34816. if (this.cleanupActiveDownloads(), this.activeDownloads.length < this.concurrentDownloads || e)
  34817. for (var i = e ? t.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && t.length > 0; r++) {
  34818. var o = t.shift();
  34819. o && (this.startDownload(o), n++)
  34820. }
  34821. }, n.prototype.testDownload = function(t, e, i) {
  34822. var n = this.downloadTestResults[t];
  34823. if (n) n === y.Success ? i(!0) : n === y.Fail && i(!1);
  34824. else {
  34825. this.downloadTestResults[t] = y.Testing;
  34826. var r = this.panos.list[0],
  34827. o = this.getTileUrl(r.id, t, e, 0),
  34828. a = function(e) {
  34829. this.downloadTestResults[t] = y.Success, i(!0)
  34830. }.bind(this),
  34831. s = function() {
  34832. this.downloadTestResults[t] = y.Fail, i(!1)
  34833. }.bind(this);
  34834. this.loadImage(o, 0, a, s)
  34835. }
  34836. }, n.prototype.startDownload = function(t) {
  34837. t.status = f.Downloading;
  34838. var e = this.getTileUrl(t.pano.id, t.panoSize, t.tileSize, t.tileIndex);
  34839. this.activeDownloads.push(t), this.loadImage(e, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, t), this.downloadFailed.bind(this, t))
  34840. }, n.prototype.downloadFailed = function(t, e) {}, n.prototype.downloadComplete = function(t, e) {
  34841. if (t.panoGroupId === this.panoGroupId) {
  34842. var i = this.getPanoLoadCallbacks(t.pano, t.panoSize);
  34843. t.status = f.Downloaded, i && i.onProgress && i.onProgress(t.pano, t.panoSize);
  34844. var n = {
  34845. panoId: t.pano.id,
  34846. image: e,
  34847. tileSize: t.tileSize,
  34848. panoSize: t.panoSize,
  34849. tileIndex: t.tileIndex,
  34850. faceTileIndex: t.faceTileIndex,
  34851. totalTiles: t.totalTiles,
  34852. face: t.face,
  34853. tileX: t.tileX,
  34854. tileY: t.tileY,
  34855. direction: t.direction
  34856. };
  34857. t.image = e, this.emit(c.TileDownloadSuccess, n), this.isPanoDownloaded(t.pano, t.panoSize) && (n = {
  34858. panoId: t.pano.id,
  34859. tileSize: t.tileSize,
  34860. panoSize: t.panoSize
  34861. }, this.emit(c.PanoDownloadComplete, n), i && i.onLoad && i.onLoad(t.pano, t.panoSize))
  34862. }
  34863. }, n.prototype.cleanupActiveDownloads = function() {
  34864. var t = [];
  34865. return function() {
  34866. t.length = 0;
  34867. for (var e = 0; e < this.activeDownloads.length; e++) {
  34868. var i = this.activeDownloads[e];
  34869. i.status !== f.Downloaded && i.status !== f.Failed && t.push(i)
  34870. }
  34871. this.activeDownloads.length = 0, this.activeDownloads.push.apply(this.activeDownloads, t)
  34872. }
  34873. }(), n.prototype.isPanoDownloaded = function(t, e) {
  34874. var i = this.getTileDownloadDescriptors(t, e);
  34875. if (i.length <= 0) return !1;
  34876. for (var n = 0; n < i.length; n++) {
  34877. if (i[n].status !== f.Downloaded) return !1
  34878. }
  34879. return !0
  34880. }, n.prototype.setPanoLoadCallbacks = function(t, e, i, n, r) {
  34881. var o = t.id + ":" + this.qualityManager.getPanoSize(e);
  34882. this.panoLoadCallbacks[o] = {
  34883. onLoad: i,
  34884. onFail: n,
  34885. onProgress: r
  34886. }
  34887. }, n.prototype.getPanoLoadCallbacks = function(t, e) {
  34888. var i = t.id + ":" + e;
  34889. return this.panoLoadCallbacks[i]
  34890. }, n.prototype.buildDownloadDescriptorArray = function(t) {
  34891. for (var e = p.getTileCountForSize(t), i = [], n = 0; n < e; n++) {
  34892. var r = this.buildDownloadDescriptor();
  34893. i.push(r)
  34894. }
  34895. return i
  34896. }, n.prototype.buildDownloadDescriptor = function() {
  34897. return {
  34898. panoGroupId: null,
  34899. pano: null,
  34900. panoSize: -1,
  34901. tileSize: -1,
  34902. tileIndex: -1,
  34903. totalTiles: -1,
  34904. faceTileIndex: -1,
  34905. status: f.None,
  34906. url: null,
  34907. image: null,
  34908. direction: new l.Vector3,
  34909. face: -1,
  34910. cubeFace: -1,
  34911. tileX: -1,
  34912. tileY: -1
  34913. }
  34914. }, n.prototype.initTileDownloadDescriptors = function(t, e, i) {
  34915. for (var n = 0; n < t.length; n++) {
  34916. var r = t[n];
  34917. this.initTileDownloadDescriptor(r, e, i, n)
  34918. }
  34919. }, n.prototype.initTileDownloadDescriptor = function(t, e, i, n) {
  34920. var r = i >= p.TILE_SIZE ? p.TILE_SIZE : i;
  34921. t.face = p.getFaceForTile(i, n), t.cubeFace = m.mapFaceToCubemapFace(t.face), t.panoGroupId = this.panoGroupId, t.pano = e, t.panoSize = i, t.tileSize = r, t.tileIndex = n, t.totalTiles = p.getTileCountForSize(i), t.status = f.None, t.image = null, p.getTileLocation(t.panoSize, t.tileIndex, t), p.getTileVector(t.panoSize, t.tileSize, t.cubeFace, t.tileX, t.tileY, p.LocationOnTile.Center, 0, t.direction)
  34922. }, n.prototype.getTileUrl = (r = {
  34923. 256: "256",
  34924. 512: "512",
  34925. 1024: "1k",
  34926. 2048: "2k",
  34927. 4096: "4k"
  34928. }, o = {
  34929. face: -1,
  34930. faceTileIndex: -1,
  34931. tileX: -1,
  34932. tileY: -1
  34933. }, function(t, e, i, n) {
  34934. p.getTileLocation(e, n, o);
  34935. var a = Math.floor(e / i),
  34936. s = a * a,
  34937. l = Math.floor(n / s),
  34938. h = "";
  34939. return 1 === u.tiling.customCompression && (h = "_" + u.tiling["q" + r[e]]), this.urls.get("multiple/" + t + "/" + r[e] + h + "_face" + l + "_" + o.tileX + "_" + o.tileY + ".jpg")
  34940. }), n.prototype.loadImage = function(t, e, i, n) {
  34941. g.getImage(t, e)
  34942. .then((function(t) {
  34943. i(t)
  34944. }))
  34945. .fail(n)
  34946. }, t.exports = n
  34947. })
  34948. .call(this, "/js/tile/TileDownloader.js")
  34949. }, function(t, e, i) {
  34950. function n(t) {
  34951. var e, i = {
  34952. renderTarget: null,
  34953. inUse: !1,
  34954. size: -1,
  34955. pano: null
  34956. };
  34957. return i.inUse = !0, i.size = t, e = i, E.push(e), i
  34958. }
  34959. function r(t) {
  34960. for (var e = 0; e < E.length; e++) {
  34961. var i = E[e];
  34962. if (i.renderTarget === t) return i.inUse = !1, !0
  34963. }
  34964. return !1
  34965. }
  34966. function o() {
  34967. this.tileDirectory = {}, this.activeRenderTargetDescriptors = {}, this.activePanos = [], this.panoLODDescriptors = {}, this.panoDescriptors = {}, this.tileTrees = {}, this.sceneRenderer = null, this.tileDownloader = null, this.forceQueue = [], this.uploadQueues = {}, this.uploadInterval = null, this.uploadIntervalCancelled = !1, this.usingTileOverlay = !1, this.overlayTilesLoaded = !1, this.overlayTileBase = null, this.overlayTilesBasic = {}, this.overlayTilesEnhanced = {}, this.zoomRenderTarget = null, this.zoomPano = null, this.zoomingActive = !1, this.zoomPanoId = null, this.zoomPanoRenderingDisabled = !1, this.direction = new u.Vector3, this.initTime = -1, this.maxBaseUploadsPerFrame = A, this.maxNonBaseUploadsPerFrame = _
  34968. }
  34969. function a() {
  34970. this.uploadIntervalCancelled || this.overlayTilesLoaded || (this.usingTileOverlay ? this.refreshUploadInterval(this.uploadIntervalDelay) : (M = !0, this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame), this.peekNextFromUploadQueue() ? this.refreshUploadInterval(T) : this.uploadInterval = null))
  34971. }
  34972. var s, l, u = i(0),
  34973. h = i(14),
  34974. c = i(1),
  34975. d = i(23),
  34976. p = i(55),
  34977. f = i(48),
  34978. m = i(76),
  34979. g = i(18),
  34980. v = i(200),
  34981. y = i(38),
  34982. b = i(30),
  34983. w = i(36),
  34984. x = i(4)
  34985. .EventEmitter,
  34986. M = !1,
  34987. T = c.tiling.uploadIntervalDelay,
  34988. S = c.tiling.initialIntervalDelay,
  34989. _ = c.tiling.maxNonBaseUploadsPerFrame,
  34990. A = c.tiling.maxBaseUploadsPerFrame,
  34991. P = 0,
  34992. C = 1,
  34993. E = [];
  34994. o.prototype = Object.create(x.prototype), o.prototype.init = function(t, e, i) {
  34995. this.sceneRenderer = t, this.tileDownloader = e, this.qualityManager = i, this.bindEvents(), this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)), this.initTime = performance.now()
  34996. }, o.prototype.getActivePanoTextures = function(t) {
  34997. t = t || [];
  34998. for (var e = 0; e < E.length; e++) {
  34999. var i = E[e];
  35000. i.renderTarget && i.renderTarget.texture && t.push(i.renderTarget.texture)
  35001. }
  35002. }, o.prototype.hasQueuedTiles = function() {
  35003. var t = this.peekNextFromUploadQueue();
  35004. return null != t
  35005. }, o.prototype.getActiveRenderTargetDescriptor = function(t) {
  35006. return this.activeRenderTargetDescriptors[t]
  35007. }, o.prototype.setActiveRenderTargetDescriptor = function(t, e) {
  35008. this.activeRenderTargetDescriptors[t] = e
  35009. }, o.prototype.loadOverlayTiles = function() {
  35010. if (0 !== c.tiling.overlayStyle) {
  35011. var t = 0,
  35012. e = function(e, n, r) {
  35013. e = n ? e[n] = this.sceneRenderer.initSizedTexture2D(b.TILE_SIZE, u.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(b.TILE_SIZE, u.ClampToEdgeWrapping), this.sceneRenderer.uploadTexture2D(r, e, 0, 0, b.TILE_SIZE, b.TILE_SIZE), ++t === i.length && (this.overlayTilesLoaded = !0)
  35014. }.bind(this),
  35015. i = [
  35016. ["images/outlineBase.png", e.bind(this, this.overlayTileBase, null)],
  35017. ["images/outlineBasic512.png", e.bind(this, this.overlayTilesBasic, 256)],
  35018. ["images/outlineBasic512.png", e.bind(this, this.overlayTilesBasic, 512)],
  35019. ["images/outlineBasic1024.png", e.bind(this, this.overlayTilesBasic, 1024)],
  35020. ["images/outlineBasic2048.png", e.bind(this, this.overlayTilesBasic, 2048)],
  35021. ["images/outlineBasic4096.png", e.bind(this, this.overlayTilesBasic, 4096)],
  35022. ["images/outlineEnhanced512.png", e.bind(this, this.overlayTilesEnhanced, 256)],
  35023. ["images/outlineEnhanced512.png", e.bind(this, this.overlayTilesEnhanced, 512)],
  35024. ["images/outlineEnhanced1024.png", e.bind(this, this.overlayTilesEnhanced, 1024)],
  35025. ["images/outlineEnhanced2048.png", e.bind(this, this.overlayTilesEnhanced, 2048)],
  35026. ["images/outlineEnhanced4096.png", e.bind(this, this.overlayTilesEnhanced, 4096)]
  35027. ];
  35028. i.forEach(function(t) {
  35029. this.tileDownloader.loadImage(t[0], 0, t[1])
  35030. }.bind(this)), this.usingTileOverlay = !0
  35031. } else this.usingTileOverlay = !1
  35032. }, o.prototype.bindEvents = function() {
  35033. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  35034. }, o.prototype.setupZoomRenderTarget = function() {
  35035. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  35036. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize()) return;
  35037. var t = this.zoomRenderTarget;
  35038. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1), t) {
  35039. var e = t.width,
  35040. i = this.zoomRenderTarget.width;
  35041. this.sceneRenderer.copyCubeMap(t.texture, this.zoomRenderTarget, e, e, i, i), t.texture.dispose(), t.texture.loaded = !1, t.texture.version = 0, this.sceneRenderer.deallocateCubeTexture(t.texture), t.texture = null
  35042. }
  35043. this.zoomPanoRenderingDisabled = !1
  35044. } else this.zoomPanoRenderingDisabled = !0
  35045. }, o.prototype.enableUltraHighQualityMode = function(t) {
  35046. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  35047. var e = this.qualityManager.getPanoSize(d.ULTRAHIGH);
  35048. this.tileDownloader.testDownload(e, b.TILE_SIZE, function(e) {
  35049. e && (this.qualityManager.enableUltraHighQualityMode(), this.setupZoomRenderTarget(), t())
  35050. }.bind(this))
  35051. }
  35052. }, o.prototype.activateTiledPano = function(t, e, i) {
  35053. i && this.clearAllQueuedUploads();
  35054. for (var o = 0; o < b.FACES_PER_PANO; o++) this.initTileTree(t.id, o, this.qualityManager.getMaxPossiblePanoSize());
  35055. this.linkAllTilesAndNodes(t);
  35056. var a = this.getActiveRenderTargetDescriptor(t.id);
  35057. if (e > this.qualityManager.getMaxNavPanoSize() && (e = this.qualityManager.getMaxNavPanoSize()), !a || e !== a.size) {
  35058. if (a && r(a.renderTarget), !(a = function(t) {
  35059. for (var e = 0; e < E.length; e++) {
  35060. var i = E[e];
  35061. if (!i.inUse && i.size === t) return i.inUse = !0, i
  35062. }
  35063. return null
  35064. }(e))) {
  35065. var s = this.initTiledPano(e, !1);
  35066. (a = n(s.width))
  35067. .renderTarget = s
  35068. }
  35069. a.pano = t, this.resetPanoDescriptor(t.id), this.resetPanoLODDescriptors(t.id), this.resetRenderStatus(t.id, !0, !0)
  35070. }
  35071. this.setActiveRenderTargetDescriptor(t.id, a);
  35072. var l = i ? 0 : 1;
  35073. return this.updateActivePanos(t, l), a.renderTarget
  35074. }, o.prototype.deactivateTiledPano = function(t) {
  35075. var e = this.getActiveRenderTargetDescriptor(t.id);
  35076. this.isRenderTargetDescriptorValid(e) && r(e.renderTarget), this.setActiveRenderTargetDescriptor(t.id, null);
  35077. var i = this.getUploadQueueForPano(t.id);
  35078. this.clearUploadQueue(i), this.updateActivePanos()
  35079. }, o.prototype.updateActivePanos = (s = [], function(t, e) {
  35080. s.length = 0;
  35081. for (var i = 0; i < this.activePanos.length; i++) {
  35082. t && s.length === e && s.push(t);
  35083. var n = this.activePanos[i],
  35084. r = this.getActiveRenderTargetDescriptor(n.id);
  35085. t && n.id === t.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  35086. }
  35087. t && e >= s.length && s.push(t), this.activePanos.length = 0, this.activePanos.push.apply(this.activePanos, s)
  35088. }), o.prototype.getActivePanoCount = function() {
  35089. return this.activePanos.length
  35090. }, o.prototype.resetRenderStatus = function(t, e, i, n) {
  35091. var r = function(t, n, r, o) {
  35092. i && (n.tile.zoomUploaded = !1), e && (n.tile.uploaded = !1)
  35093. },
  35094. o = null;
  35095. n && (o = v.getLevelCountForSize(b.TILE_SIZE, n) + 1);
  35096. for (var a = 0; a < b.FACES_PER_PANO; a++) {
  35097. this.getTileTree(t, a)
  35098. .breadthFirst({
  35099. callback: r.bind(this, a),
  35100. minLevel: o
  35101. })
  35102. }
  35103. }, o.prototype.copyBaseRenderStatusToZoomed = function(t) {
  35104. for (var e = v.getLevelCountForSize(b.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(t, e, i, n) {
  35105. e.tile.zoomUploaded = e.tile.uploaded, e.zoomCovered = e.covered
  35106. }, n = 0; n < b.FACES_PER_PANO; n++) {
  35107. this.getTileTree(t, n)
  35108. .breadthFirst({
  35109. callback: i.bind(this, n),
  35110. maxLevel: e
  35111. })
  35112. }
  35113. }, o.prototype.renderPanoTiles = (l = [], function(t, e, i, n) {
  35114. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(), e = e || this.direction || g.FORWARD;
  35115. var r = this.getActiveRenderTargetDescriptor(t);
  35116. if (!this.isRenderTargetDescriptorValid(r)) throw new h("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  35117. for (var o = 0; o < b.FACES_PER_PANO; o++) {
  35118. var a = this.getTileTree(t, o);
  35119. l.length = 0, a.breadthFirst({
  35120. saveVisited: l
  35121. });
  35122. for (var s = 0; s < l.length; s++) {
  35123. var u = l[s];
  35124. this.queueTileUpload(u.tile, !1, n || 0 === s && i)
  35125. }
  35126. }
  35127. this.updateDirection(e)
  35128. }), o.prototype.isRenderTargetDescriptorValid = function(t) {
  35129. return t && t.renderTarget
  35130. }, o.prototype.isPanoActive = function(t) {
  35131. var e = this.getActiveRenderTargetDescriptor(t);
  35132. return this.isRenderTargetDescriptorValid(e)
  35133. }, o.prototype.isPanoZoomed = function(t) {
  35134. return this.zoomingActive && this.zoomPanoId === t
  35135. }, o.prototype.initTileTree = function(t, e, i) {
  35136. var n = this.tileTrees[t];
  35137. n || (n = [], this.tileTrees[t] = n);
  35138. var r = n[e];
  35139. if (!r) {
  35140. var o = v.getLevelCountForSize(b.TILE_SIZE, i);
  35141. r = new v(b.TILE_SIZE, o), n[e] = r
  35142. }
  35143. }, o.prototype.getTileTree = function(t, e) {
  35144. var i = this.tileTrees[t];
  35145. if (!i) throw new h("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  35146. var n = i[e];
  35147. if (!n) throw new h("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  35148. return n
  35149. }, o.prototype.initTiledPano = function(t, e) {
  35150. var i = this.sceneRenderer.renderer,
  35151. n = (i.context, new u.WebGLRenderTargetCube(t, t, {
  35152. stencilBuffer: !1
  35153. })),
  35154. r = new u.CubeTexture([]);
  35155. n.texture = r, r.image = [null, null, null, null, null, null], r.flipY = !0, e ? (r.generateMipmaps = !0, r.magFilter = u.LinearFilter, r.minFilter = u.LinearMipMapLinearFilter) : (r.generateMipmaps = !1, r.magFilter = u.LinearFilter, r.minFilter = u.LinearFilter), r.format = u.RGBAFormat, i.setRenderTarget(n), i.setRenderTarget(null);
  35156. var o = i.properties.get(r);
  35157. return o.__image__webglTextureCube = o.__webglTexture, n
  35158. }, o.prototype.getUploadQueueForPano = function(t) {
  35159. var e = this.uploadQueues[t];
  35160. return e || (e = [], this.uploadQueues[t] = e), e
  35161. }, o.prototype.isTileUploaded = function(t) {
  35162. return this.isPanoZoomed(t.panoId) ? t.zoomUploaded : t.uploaded
  35163. }, o.prototype.setUploaded = function(t, e) {
  35164. this.isPanoZoomed(t.panoId) ? t.zoomUploaded = e : t.uploaded = e
  35165. }, o.prototype.queueTileUpload = function(t, e, i) {
  35166. var n = this.getActiveRenderTargetDescriptor(t.panoId);
  35167. if (this.isRenderTargetDescriptorValid(n) && t.downloaded && !this.isTileUploaded(t) && (!t.uploadQueued || i) && (!(t.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  35168. var r = this.getUploadQueueForPano(t.panoId);
  35169. i ? this.uploadTile(t, !1) : (this.shoulPushToFrontOfQueue(t) ? this.forceQueue.push(t) : e && this.direction ? y.insertSortedPanoTile(r, t, n.pano, this.direction) : r.push(t), t.uploadQueued = !0, this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  35170. }
  35171. }, o.prototype.shoulPushToFrontOfQueue = function(t) {
  35172. return 0 === v.getLevelCountForSize(b.TILE_SIZE, t.panoSize)
  35173. }, o.prototype.getTopUploadQueue = function() {
  35174. for (var t = null, e = null, i = P; i <= C; i++)
  35175. for (var n = 0; n < this.activePanos.length; n++)
  35176. if (t = this.activePanos[n], (e = this.getUploadQueueForPano(t.id))
  35177. .length > 0) switch (i) {
  35178. case P:
  35179. if (0 === e[0].level) return e;
  35180. break;
  35181. case C:
  35182. return e
  35183. }
  35184. return null
  35185. }, o.prototype.getNextFromUploadQueue = function() {
  35186. var t = function(t) {
  35187. var e = t.shift();
  35188. return e.uploadQueued = !1, e
  35189. };
  35190. return function() {
  35191. if (this.forceQueue.length > 0) return t(this.forceQueue);
  35192. var e = this.getTopUploadQueue();
  35193. return e && e.length > 0 ? t(e) : null
  35194. }
  35195. }(), o.prototype.peekNextFromUploadQueue = function() {
  35196. if (this.forceQueue.length > 0) return this.forceQueue[0];
  35197. var t = this.getTopUploadQueue();
  35198. return t && t.length > 0 ? t[0] : null
  35199. }, o.prototype.clearAllQueuedUploads = function() {
  35200. this.clearAllUploadQueues(null, 0)
  35201. }, o.prototype.clearAllQueuedUploadsForPano = function(t) {
  35202. this.clearAllUploadQueues(t, 0)
  35203. }, o.prototype.clearAllUploadQueues = function(t, e) {
  35204. if (t) this.clearUploadQueue(this.getUploadQueueForPano(t), e), this.clearUploadQueue(this.forceQueue, e, t);
  35205. else {
  35206. for (var i = 0; i < this.activePanos.length; i++) {
  35207. var n = this.activePanos[i];
  35208. this.clearUploadQueue(this.getUploadQueueForPano(n.id), e)
  35209. }
  35210. this.clearUploadQueue(this.forceQueue, e)
  35211. }
  35212. }, o.prototype.clearUploadQueue = function(t, e, i) {
  35213. null != e || (e = 0);
  35214. for (var n = 0; n < t.length;) {
  35215. var r = t[n];
  35216. (!i || i && i === r.tile.panoId) && r.level >= e ? (r.uploadQueued = !1, t.splice(n, 1)) : n++
  35217. }
  35218. }, o.prototype.refreshUploadInterval = function() {
  35219. var t = null;
  35220. return function(e) {
  35221. this.uploadIntervalCancelled || (t || (t = a.bind(this)), null != e || (e = T), M || (e = S), this.uploadInterval = window.setTimeout(t, e), this.uploadIntervalDelay = e)
  35222. }
  35223. }(), o.prototype.update = function() {
  35224. var t = performance.now(),
  35225. e = 0;
  35226. return function() {
  35227. this.uploadIntervalCancelled = !0, window.clearTimeout(this.uploadInterval), this.uploadInterval = null, !(performance.now() - t > T || 0 === e) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame), t = performance.now()), e++
  35228. }
  35229. }(), o.prototype.updateUploadQueue = function(t, e) {
  35230. t || (t = 1);
  35231. for (var i = 0, n = 0; !(n >= e || i >= t);) {
  35232. var r = this.getNextFromUploadQueue();
  35233. if (!r) break;
  35234. if (0 !== r.level ? i++ : n++, !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  35235. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  35236. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  35237. }
  35238. }
  35239. }, o.prototype.updateDirection = function(t) {
  35240. if (t = t || this.direction) {
  35241. this.direction = t;
  35242. for (var e = 0; e < this.activePanos.length; e++) {
  35243. var i = this.activePanos[e],
  35244. n = this.getUploadQueueForPano(i.id);
  35245. y.sortPanoTiles(n, i, this.direction)
  35246. }
  35247. }
  35248. }, o.prototype.uploadTile = function() {
  35249. var t = {},
  35250. e = (new u.Vector4, c.tiling.overlayStyle);
  35251. return function(i, n) {
  35252. var r = i.panoId,
  35253. o = i.image,
  35254. a = i.tileSize,
  35255. s = i.panoSize,
  35256. l = i.tileIndex,
  35257. h = (i.faceTileIndex, i.totalTiles),
  35258. c = (i.face, i.tileX),
  35259. d = i.tileY,
  35260. f = !0,
  35261. m = !1,
  35262. g = (this.getPanoDescriptor(r), this.getPanoLODDescriptor(r, s)),
  35263. v = this.getActiveRenderTargetDescriptor(r),
  35264. y = v.renderTarget,
  35265. b = v.size;
  35266. if (this.isPanoZoomed(r) && (y = this.zoomRenderTarget, b = this.qualityManager.getMaxZoomPanoSize()), this.isRenderTargetDescriptorValid(v) || (f = !1, m = !1), n || (this.anyUploaded(i.node) && (f = !1, m = !0), this.isTileUploaded(i) && (f = !1, m = !1)), f) {
  35267. var w = a / s * b,
  35268. x = c * a / s * b,
  35269. M = d * a / s * b;
  35270. t[a] || (t[a] = this.sceneRenderer.initSizedTexture2D(a, u.ClampToEdgeWrapping));
  35271. var T = t[a];
  35272. if (this.sceneRenderer.uploadTexture2D(o, T, 0, 0, a, a), 1 === e || 2 === e) {
  35273. var S = 1 === e ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  35274. this.sceneRenderer.renderToCubeMap(T, y, a, a, 0, 0, a, a, x, M, w, w, i.cubeFace), this.sceneRenderer.renderToCubeMap(S[s], y, a, a, 0, 0, a, a, x, M, w, w, i.cubeFace, u.NormalBlending, !0, .5)
  35275. } else this.sceneRenderer.renderToCubeMap(T, y, a, a, 0, 0, a, a, x, M, w, w, i.cubeFace);
  35276. g.uploadCount++, this.emit(p.TileRenderSuccess, r, s, l, h), g.uploadCount === h && this.emit(p.PanoRenderComplete, r, s, h), this.setUploaded(i, !0), this.addCoverageForNode(i.node)
  35277. } else this.setUploaded(i, !1);
  35278. return i.uploadAttempted || (g.uploadAttempts++, this.emit(p.TileUploadAttempted, r, s, l, h)), i.uploadAttempted = !0, g.uploadAttempts === h && this.emit(p.UploadAttemptedForAllTiles, r, s, h), m
  35279. }
  35280. }(), o.prototype.linkTileAndNode = function(t, e) {
  35281. e.tile = t, t.node = e
  35282. }, o.prototype.linkAllTilesAndNodes = function(t) {
  35283. for (var e = function(e, i, n, r, o) {
  35284. var a = this.getTileDirectoryEntry(t.id, i, r, o);
  35285. this.linkTileAndNode(a, n)
  35286. }, i = 0; i < b.FACES_PER_PANO; i++) {
  35287. var n = this.getTileTree(t.id, i);
  35288. n.breadthFirst({
  35289. callback: e.bind(this, n, i)
  35290. })
  35291. }
  35292. }, o.prototype.anyUploaded = function(t) {
  35293. if (!t) return !1;
  35294. if (t.tile && this.isTileUploaded(t.tile)) return !0;
  35295. if (t.children)
  35296. for (var e = 0; e < t.children.length; e++) {
  35297. var i = t.children[e];
  35298. if (this.anyUploaded(i)) return !0
  35299. }
  35300. return !1
  35301. }, o.prototype.setNodeCovered = function(t, e) {
  35302. this.isPanoZoomed(t.tile.panoId) ? t.zoomCovered = e : t.covered = e
  35303. }, o.prototype.isNodeCovered = function(t) {
  35304. return !!t && (this.isPanoZoomed(t.tile.panoId) ? t.zoomCovered : t.covered)
  35305. }, o.prototype.addCoverageForNode = function(t) {
  35306. if (this.setNodeCovered(t, !0), t.parent && t.covered) {
  35307. var e = t.parent;
  35308. this.nodeSubcovered(e) && this.addCoverageForNode(e, !0)
  35309. }
  35310. }, o.prototype.calcFullCoverage = function(t) {
  35311. var e = !1;
  35312. if (t.children)
  35313. for (var i = 0; i < t.children.length; i++) {
  35314. var n = t.children[i];
  35315. e = e || this.calcFullCoverage(n)
  35316. }
  35317. t.covered = t.tile.uploaded || e
  35318. }, o.prototype.nodeSubcovered = function(t) {
  35319. if (!t.children) return !1;
  35320. for (var e = 0; e < t.children.length; e++)
  35321. if (!t.children[e] || !this.isNodeCovered(t.children[e])) return !1;
  35322. return !0
  35323. }, o.prototype.resetPanoDescriptor = function(t) {
  35324. this.getPanoDescriptor(t)
  35325. }, o.prototype.getPanoDescriptor = function(t) {
  35326. var e = this.panoDescriptors[t];
  35327. return e || (e = {}, this.panoDescriptors[t] = e), e
  35328. }, o.prototype.resetPanoLODDescriptors = function(t) {
  35329. var e = this.getPanoLODDescriptors(t);
  35330. for (var i in e)
  35331. if (e.hasOwnProperty(i)) {
  35332. var n = e[i];
  35333. n.uploadCount = 0, n.uploadAttempts = 0
  35334. }
  35335. }, o.prototype.getPanoLODDescriptor = function(t, e) {
  35336. var i = this.getPanoLODDescriptors(t),
  35337. n = i[e];
  35338. return n || (n = {
  35339. uploadCount: 0,
  35340. uploadAttempts: 0
  35341. }, i[e] = n), n
  35342. }, o.prototype.getPanoLODDescriptors = function(t) {
  35343. var e = this.panoLODDescriptors[t];
  35344. return e || (e = {}, this.panoLODDescriptors[t] = e), e
  35345. }, o.prototype.onTileDownloaded = function(t) {
  35346. var e = v.getLevelCountForSize(b.TILE_SIZE, t.panoSize),
  35347. i = this.getTileDirectoryEntry(t.panoId, t.face, e, t.faceTileIndex);
  35348. if (i.downloaded = !0, i.image = t.image, i.panoSize = t.panoSize, i.tileX = t.tileX, i.tileY = t.tileY, i.totalTiles = t.totalTiles, i.tileIndex = t.tileIndex, i.faceTileIndex = t.faceTileIndex, i.face = t.face, i.cubeFace = w.mapFaceToCubemapFace(t.face), i.panoId = t.panoId, i.tileSize = t.tileSize, i.direction = (new u.Vector3)
  35349. .copy(t.direction), i.node = null, i.level = v.getLevelCountForSize(b.TILE_SIZE, i.panoSize), this.isPanoActive(i.panoId)) {
  35350. var n = this.getTileTree(i.panoId, i.face)
  35351. .getSubNode(i.panoSize, i.tileX, i.tileY);
  35352. this.linkTileAndNode(i, n), this.queueTileUpload(i, !0)
  35353. }
  35354. }, o.prototype.getTileDirectoryEntry = function(t, e, i, n) {
  35355. var r = this.tileDirectory[t];
  35356. r || (r = {}, this.tileDirectory[t] = r);
  35357. var o = 16384 * e + 1024 * i + n,
  35358. a = r[o];
  35359. return a || (a = {
  35360. downloaded: !1,
  35361. uploaded: !1,
  35362. zoomUploaded: !1
  35363. }, r[o] = a), a._key = t + ":" + e + ":" + i + ":" + n, a._tileKey = o, a
  35364. }, o.prototype.setZoomingActive = function(t, e, i) {
  35365. this.zoomPanoRenderingDisabled || t === this.zoomingActive && this.zoomPanoId === e.id || (this.zoomingActive = t, this.zoomPanoId = e.id, this.zoomingActive && (this.zoomPanoId !== e.id || i) && this.updateZoomedPanoFromBase(e))
  35366. }, o.prototype.updateZoomedPanoFromBase = function(t) {
  35367. if (!this.zoomPanoRenderingDisabled) {
  35368. var e = this.getActiveRenderTargetDescriptor(t.id);
  35369. if (e && e.renderTarget) {
  35370. var i = this.qualityManager.getMaxZoomPanoSize(),
  35371. n = e.renderTarget,
  35372. r = e.size;
  35373. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i), this.copyBaseRenderStatusToZoomed(t.id)
  35374. }
  35375. }
  35376. }, t.exports = o
  35377. }, function(t, e) {
  35378. function i(t) {
  35379. t.root = function t(e, i, r) {
  35380. if (r > e.levels) return null;
  35381. var o = new n(e, i);
  35382. e.allNodes.push(o);
  35383. for (var s = 0; s < a; s++) o.children[s] = t(e, o, r + 1);
  35384. return o
  35385. }(t, null, 0)
  35386. }
  35387. function n(t, e) {
  35388. this.tree = t, this.parent = e, this.children = [], this.id = ++r
  35389. }
  35390. var r = 0,
  35391. o = 2,
  35392. a = o * o;
  35393. function s(t, e) {
  35394. this.levels = e, this.tileSize = t, this.root = null, this.allNodes = [], i(this)
  35395. }
  35396. s.TraversalType = Object.freeze({
  35397. PreOrder: 0,
  35398. PostOrder: 1
  35399. }), s.getLevelCountForSize = function(t, e) {
  35400. var i = 0;
  35401. for (e < t && (e = t); !((e /= o) < t);) i++;
  35402. return i
  35403. }, s.getSizeForLevel = function(t, e) {
  35404. return Math.pow(o, e) * t
  35405. }, s.prototype.getSubNode = function(t, e, i) {
  35406. (!e || t < this.tileSize) && (e = 0), (!i || t < this.tileSize) && (i = 0), t < this.tileSize && (t = this.tileSize);
  35407. var n = s.getLevelCountForSize(this.tileSize, t);
  35408. return function t(e, i, n, r, a) {
  35409. if (!e) return null;
  35410. if (0 === n) return e;
  35411. if (!e.children || 0 === e.children.length) return null;
  35412. var s = Math.pow(o, n) / o,
  35413. l = r % s,
  35414. u = a % s,
  35415. h = Math.floor(a / s),
  35416. c = Math.floor(r / s),
  35417. d = h * o + c;
  35418. return t(e.children[d], i + 1, n - 1, l, u)
  35419. }(this.root, 0, n, e, i)
  35420. }, s.prototype.breadthFirst = function(t) {
  35421. var e = !!(t = t || {})
  35422. .nullLevelEnd,
  35423. i = t.maxLevel,
  35424. n = t.minLevel,
  35425. r = t.callback,
  35426. o = t.saveVisited,
  35427. a = [],
  35428. s = {},
  35429. l = 0;
  35430. for (a.push(this.root), a.push(s); a.length > 0 && !(i && l > i);) {
  35431. var u = a.shift();
  35432. if (u === s)(!n || l >= n) && (r && e && r(null), o && e && o.push(null)), a.length > 0 && a.push(s), l++, 0;
  35433. else {
  35434. if (u.children)
  35435. for (var h = 0; h < u.children.length; h++) {
  35436. u.children[h] && a.push(u.children[h])
  35437. }
  35438. var c = this.getFaceIndexFromNode(u);
  35439. (!n || l >= n) && (r && r(u, l, c), o && o.push(u))
  35440. }
  35441. }
  35442. }, s.prototype.getFaceIndexFromNode = function(t) {
  35443. if (!t) return -1;
  35444. for (var e = 1, i = t, n = 0, r = 0;;) {
  35445. var a = i.parent;
  35446. if (!a) break;
  35447. for (var s = -1, l = 0; l < a.children.length; l++) a.children[l] === i && (s = l);
  35448. n = s % o * e + n, r = Math.floor(s / o) * e + r, e *= o, i = a
  35449. }
  35450. return r * e + n
  35451. }, s.prototype.depthFirst = function(t, e, i) {
  35452. ! function t(e, i, n, r, a, l, u, h) {
  35453. if (e) {
  35454. u = u || s.TraversalType.PreOrder;
  35455. var c = r * o + n;
  35456. if (u === s.TraversalType.PreOrder && (a && a(e, i, c, n, r), l && l.push(e)), e.children && 0 !== e.children.length) {
  35457. for (var d = r * o, p = n * o, f = 0; f < o; f++)
  35458. for (var m = 0; m < o; m++) t(e.children[m * o + f], i + 1, p + f, d + m, a, l, u, h);
  35459. u === s.TraversalType.PostOrder && (a && a(e, i, c, n, r), l && l.push(e))
  35460. }
  35461. }
  35462. }(this.root, 0, 0, 0, t, e, i, this.tileSize)
  35463. }, t.exports = s
  35464. }, function(t, e, i) {
  35465. (function(e) {
  35466. var n = i(0),
  35467. r = i(5),
  35468. o = i(4)
  35469. .EventEmitter;
  35470. function a() {
  35471. this.enable = !1
  35472. }
  35473. a.prototype = Object.create(o.prototype), a.prototype.init = function(t) {
  35474. this.lineLeft = this.buildPanoDom("left"), this.lineRight = this.buildPanoDom("right"), this.lineHeight = this.buildPanoDom("height"), this.frames = 0, this.checkedPoint = null, this.areaName = t ? t.areaName : null, this.raycaster = new n.Raycaster
  35475. }, a.prototype.buildPanoDom = function(t) {
  35476. var i = document.createElement("div");
  35477. i.className = "pano-size-line", e("#pano-size")[0].appendChild(i);
  35478. var n = document.createElement("em");
  35479. i.appendChild(n);
  35480. var r = document.createElement("div");
  35481. r.className = "pano-size-label";
  35482. var o = document.createElement("div");
  35483. o.className = "pano-size-label-point";
  35484. var a = document.createElement("div");
  35485. return t && (a.className = "pano-size-label-name " + t), i.appendChild(r), r.appendChild(o), r.appendChild(a), i
  35486. }, a.prototype.setEnable = function(t) {
  35487. this.enable = t;
  35488. var e = document.getElementById("pano-size");
  35489. e.style.display = t ? "block" : "none"
  35490. }, a.prototype.update = function(t) {
  35491. if (this.enable) {
  35492. var i, o, a = t.mode,
  35493. s = t.camera,
  35494. l = t.currentPano,
  35495. u = l.floorIndex || 0,
  35496. h = this.getFloorCeilingHeight(t);
  35497. if (this.frames += 1, a !== r.PANORAMA || null === l || !l.areasPoints) return this.lineLeft.style.display = this.lineRight.style.display = this.lineHeight.style.display = "none", !1;
  35498. for (var c, d = l.areasPoints, p = 0, f = [], m = [], g = this.checkedPoint, v = this.areaName, y = s.getWorldDirection(new n.Vector3), b = 0; b < d.length; b++) {
  35499. var w = new n.Vector3(y.x, y.y, y.z),
  35500. x = new n.Vector3(d[b].x - s.position.x, d[b].y - s.position.y, d[b].z - s.position.z);
  35501. this.raycaster.set(s.position, x), m.push(w.angleTo(x)), f[p] = d[b], p++
  35502. }
  35503. for (var M = m.slice()
  35504. .sort((function(t, e) {
  35505. return t - e
  35506. }))[0], T = 0; T < m.length; T++)
  35507. if (M === m[T]) {
  35508. var S = T;
  35509. this.checkedPoint = T, this.areaName = l.areaName
  35510. } if (v !== this.areaName && (g = null), g !== this.checkedPoint && g) return this.lineLeft.style.display = this.lineRight.style.display = this.lineHeight.style.display = "none", !1;
  35511. this.lineLeft.style.display = this.lineRight.style.display = this.lineHeight.style.display = "block", c = {
  35512. x: f[S].x,
  35513. y: h[u],
  35514. z: f[S].z
  35515. }, i = 0 === S ? f[f.length - 1] : f[S - 1], o = S === f.length - 1 ? f[0] : f[S + 1], 0 === Math.round(f[S].y) && (f[S].y = 0 === S ? f[S + 1].y : f[0].y);
  35516. var _ = this.getAngleAndDistance(f[S], c, s),
  35517. A = this.getAngleAndDistance(f[S], i, s),
  35518. P = this.getAngleAndDistance(f[S], o, s);
  35519. this.emit("updatePanoSize", this.lineHeight, "height", _), this.emit("updatePanoSize", this.lineLeft, "left", A), this.emit("updatePanoSize", this.lineRight, "right", P), e(this.lineLeft)
  35520. .addClass("reverse"), e(this.lineHeight)
  35521. .removeClass("rock")
  35522. .addClass("around"), -90 < A.angle < 90 && e(this.lineLeft)
  35523. .addClass(""), 90 < P.angle < 270 && e(this.lineLeft)
  35524. .addClass("")
  35525. }
  35526. }, a.prototype.getFloorCeilingHeight = function(t) {
  35527. var e = [],
  35528. i = t.model.floorsHeight,
  35529. n = i.totalfloor,
  35530. r = i.height;
  35531. return n > 1 ? r.forEach((function(i, o) {
  35532. e[o] = o === n - 1 ? t.model.boundingBox.max.y : r[o + 1]
  35533. })) : e.push(t.model.boundingBox.max.y), e
  35534. }, a.prototype.getAngleAndDistance = function(t, e, i) {
  35535. function r(t) {
  35536. var e, r, o = t.project(i);
  35537. return o.y *= -1, e = Math.round((o.x + 1) * (window.renderWidth || window.innerWidth) / 2), r = Math.round((o.y + 1) * (window.renderHeight || window.innerHeight) / 2), new n.Vector2(e, r)
  35538. }
  35539. var o = new n.Matrix4,
  35540. a = new n.Line3(new n.Vector3(t.x, t.y, t.z), new n.Vector3(e.x, e.y, e.z)),
  35541. s = a.distance();
  35542. o.multiplyMatrices(i.projectionMatrix, o.getInverse(i.matrixWorld));
  35543. var l = o.elements,
  35544. u = new n.Vector3(l[3] + l[2], l[7] + l[6], l[11] + l[10]),
  35545. h = new n.Plane(u, l[15] + l[14]),
  35546. c = (new n.Vector3)
  35547. .copy(a.start)
  35548. .dot(h.normal) + h.constant,
  35549. d = (new n.Vector3)
  35550. .copy(a.end)
  35551. .dot(h.normal) + h.constant;
  35552. if (c < 0 && d < 0) return null;
  35553. var p = h.intersectLine(a);
  35554. void 0 !== p && (c < 0 ? a.start.copy(p) : a.end.copy(p));
  35555. var f = r(a.start),
  35556. m = r(a.end),
  35557. g = this.getAngle(f, m);
  35558. return g.point = f, g.length = s, g
  35559. }, a.prototype.updateUI = function(t, i, n) {
  35560. null !== n ? (t.style.display = "block", setTimeout((function() {
  35561. t.style.top = n.point.y + "px", t.style.left = n.point.x + "px", t.style.width = n.dis + "px", t.style.webkitTransform = "rotate(" + n.angle + "deg)", t.style.transform = "rotate(" + n.angle + "deg)", e(".pano-size-label-name")
  35562. .hasClass(i)
  35563. }), 0)) : t.style.display = "none"
  35564. }, a.prototype.getAngle = function(t, e) {
  35565. var i = (new n.Vector2)
  35566. .subVectors(e, t),
  35567. r = i.length(),
  35568. o = Math.acos(i.x / r);
  35569. return i.y < 0 && (o *= -1), {
  35570. angle: 180 * o / Math.PI,
  35571. dis: r
  35572. }
  35573. }, t.exports = a
  35574. })
  35575. .call(this, i(6))
  35576. }, function(t, e, n) {
  35577. (function(e) {
  35578. var r = n(4)
  35579. .EventEmitter,
  35580. o = n(73)(),
  35581. a = n(5),
  35582. s = n(0),
  35583. l = n(1),
  35584. u = function() {
  35585. this.debug = !1, this.arr = [], this.parr = [], this.arrSet = [], this.cur = 0, this.len = 0, this.lon = 0, this.playing = !1, this.pidx = 0, this.pcur = 0, this.enable = !0, this.longplaying = !1, this.adiv = null, this.loadAudio = this.loadAudio.bind(this)
  35586. };
  35587. (u.prototype = Object.create(r.prototype))
  35588. .constructor = u, u.prototype.init = function(t) {
  35589. if (t && o.audioContext) {
  35590. t && t.enable && t.dataset.length && (this.arrSet = t.dataset, this.arrSet.forEach((function(t, e) {
  35591. var i = t.audiourl;
  35592. o && o.load(i)
  35593. }))), this.len = t.dataset.length
  35594. } else this.enable = !1
  35595. }, u.prototype.startRecord = function(t) {
  35596. this.recording ? this.emit("recording") : (this.emit("readyToRecord"), this.recordstart = !0, this.rtime = 0, this.loadAudio(t), this.ridx = t)
  35597. }, u.prototype.endRecord = function() {
  35598. this.recording = !1, this.elapsedtime = this.time.getElapsedTime(), this.time.stop(), this.elapsedtime > this.adiv.duration && (this.elapsedtime = this.adiv.duration), this.send({
  35599. data: this.arr,
  35600. totalTime: parseFloat(this.elapsedtime.toFixed(5))
  35601. }), G.player.controls[a.PANORAMA].rtime = 0, this.adiv.currentTime = 0, this.adiv.pause(), this.emit("stopRecord"), this.pidx = 0
  35602. }, u.prototype.save = function(t) {
  35603. return t.time = parseFloat(this.time.getElapsedTime()
  35604. .toFixed(5)), this.arr.push(t), t.time
  35605. }, u.prototype.save2 = function(t) {
  35606. this.arr.push(t)
  35607. }, u.prototype.checkserver = function() {
  35608. return window.parent && window.parent.NestP
  35609. }, u.prototype.send = function(t) {
  35610. this.arrSet[this.recordidx] = {
  35611. name: this.arrSet[this.recordidx].name,
  35612. audiourl: this.arrSet[this.recordidx].audiourl,
  35613. totalTime: t.totalTime,
  35614. record: t.data.concat()
  35615. }, this.checkserver() && window.parent.NestP.record(t)
  35616. }, u.prototype.reset = function() {
  35617. this.arr = [], this.time = new s.Clock(!1)
  35618. }, u.prototype.trytopause = function(t, e) {
  35619. t !== this.pidx && (this.playing = !1, this.stop(), e && (this.want = t, setTimeout(e, 500)))
  35620. }, u.prototype.perviewPlay = function(t) {
  35621. G.d.currentScript = 1, this.inputidx = t, this.load(function() {
  35622. this.cplay()
  35623. }.bind(this))
  35624. }, u.prototype.pplay = function(t) {
  35625. if (this.enable) {
  35626. if (!this.checkEnable()) return this.emit("emity"), !1;
  35627. if (void 0 === t && (t = this.pidx), t === this.pidx) this.checkstate() ? this.ppause() : this.loadAudio(t);
  35628. else if (this.stopAction(), this.stopAudio(), this.clearview(this.pidx), this.checkstate()) {
  35629. var e = this.pidx;
  35630. this.pidx = t, this.rstop(e, this.loadAudio, t)
  35631. } else this.pidx = t, this.loadAudio(t);
  35632. this.setCurrentView(this.pidx)
  35633. }
  35634. }, u.prototype.checkEnable = function() {
  35635. return 0 !== this.arrSet.length
  35636. }, u.prototype.presume = function(t, e) {
  35637. this.checkstate() || (void 0 === t ? t = this.pidx : this.pidx = t, this.pplay(t))
  35638. }, u.prototype.preset = function() {}, u.prototype.ppause = function(t) {
  35639. this.checkstate() && (void 0 === t && (t = this.pidx), this.rpause(t), this.paused = !0)
  35640. }, u.prototype.loadAudio = function(t) {
  35641. function i() {
  35642. if (n.floading = !1, n.adiv.oncanplay = function() {}, n.fgotoh = !0, n.inputidx = t, G.player.flying || G.player.isWarping()) var e = setInterval((function() {
  35643. G.player.flying || G.player.isWarping() || (clearInterval(e), G.d.goToHighlight(t))
  35644. }), 100);
  35645. else G.d.goToHighlight(t)
  35646. }
  35647. var n = this;
  35648. this.pidx = t;
  35649. var r = this.arrSet[t].audiourl;
  35650. if (o.audioContext && (this.adiv = o.getCell(r)), null !== this.adiv && (this.floading = !0, 4 === this.adiv.readyState ? i() : (this.emit("loadingAudio"), this.adiv.oncanplay = function() {
  35651. i(), this.emit("loadAudioDone")
  35652. }), this.debug && !this.debugstart)) {
  35653. this.debugstart = !0;
  35654. var a = "audioBuffer:",
  35655. s = this.adiv.audioBuffer;
  35656. s ? (a += "duration:" + s.duration + ",", a += "length:" + s.length + ",", a += "numberOfChannels:" + s.numberOfChannels + ",", a += "sampleRate:" + s.sampleRate + ",") : a += "undefined", setInterval((function() {
  35657. e(".debuginfo")
  35658. .html(a), e(".debugpanel")
  35659. .show()
  35660. }), 1e3)
  35661. }
  35662. }, u.prototype.rstop = function(t, e, i) {
  35663. this.rpause(t), this.clearview(t), G.d.tourIsPlaying ? setTimeout(function() {
  35664. this.rstop(t, e, i)
  35665. }.bind(this), 500) : (this.stopAction(), this.stopAudio(), e(i))
  35666. }, u.prototype.stopAction = function() {
  35667. this.playing = !1, this.exetime && this.exetime.stop(), this.exetime = new s.Clock(!1), this.parr = [], this.w = void 0, this.st = 0, this.arrSet[this.pidx].inited = !1
  35668. }, u.prototype.stopAudio = function() {
  35669. this.adiv.currentTime = 0, this.adiv.pause()
  35670. }, u.prototype.rpause = function(t) {
  35671. this.floading && (this.adiv.oncanplay = function() {}, this.floading = !1), this.fgotoh && (this.fgotoh = !1), this.acpause(), this.aupause()
  35672. }, u.prototype.acpause = function() {
  35673. this.playing = !1, this.exetime && this.exetime.stop()
  35674. }, u.prototype.acresume = function() {
  35675. this.arrSet[this.pidx].inited ? (this.playing = !0, this.exetime.start()) : this.acstart(this.pidx)
  35676. }, u.prototype.aupause = function() {
  35677. this.adiv.pause()
  35678. }, u.prototype.auresume = function() {
  35679. this.adiv.play()
  35680. }, u.prototype._emitCountDown = function(t) {
  35681. this.emit("countdown", t)
  35682. }, u.prototype.pafter = function() {
  35683. var t = this;
  35684. if (this.fgotoh)
  35685. if (this.fgotoh = !1, this.recordstart) {
  35686. this._emitCountDown(3);
  35687. var e = 3,
  35688. i = setInterval(function() {
  35689. --e > 0 ? t._emitCountDown(e) : t.emit("startRecord"), 0 == e && (clearInterval(i), this.recordstart = !1, this.arr = [], this.recordidx = this.ridx, this.time = new s.Clock(!1), this.time.start(), this.rtime = void 0, this.recording = !0, this.austart(this.inputidx))
  35690. }.bind(this), 1e3)
  35691. } else this.paused ? (this.paused = !1, this.acresume(), this.auresume()) : (this.acstart(this.pidx), this.austart(this.pidx))
  35692. }, u.prototype.acstart = function(t) {
  35693. this.parr = [], this.parr = this.arrSet[t].record.concat(), this.totalTime = this.arrSet[t].totalTime, this.totalTime || (this.totalTime = this.adiv.duration), this.exetime = new s.Clock(!1), this.exetime.start(), this.playing = !0, this.arrSet[t].inited = !0
  35694. }, u.prototype.austart = function() {
  35695. this.adiv.currentTime = 0, this.adiv.play()
  35696. }, u.prototype.load = function(t) {
  35697. e(".aloading_back")
  35698. .css("display", "block");
  35699. var i = this,
  35700. n = 0,
  35701. r = setInterval((function() {
  35702. ++n > 100 && (clearInterval(r), e(".aloading_back")
  35703. .css("display", "none")), 4 === i.adiv.readyState && (e(".aloading_back")
  35704. .css("display", "none"), clearInterval(r), t && t())
  35705. }), 100)
  35706. }, u.prototype.pause = function() {
  35707. this.trytopause()
  35708. }, u.prototype.next = function() {
  35709. return this.pidx++, this.pidx === this.len ? (this.pidx = 0, this.stop(), -1) : this.pidx
  35710. }, u.prototype.cplay = function() {
  35711. G.d.goToHighlight(this.pidx)
  35712. }, u.prototype.cstop = function() {
  35713. G.d.stopTour(), G.playing = !1
  35714. }, u.prototype.stop = function() {
  35715. this.playing = !1, this.exetime.stop(), this.exetime = new s.Clock(!1), this.adiv.currentTime = 0, this.adiv.pause(), this.emit("stop")
  35716. }, u.prototype.update = function(t) {
  35717. if (this.recording) {
  35718. var e = this.adiv.duration - this.time.getElapsedTime();
  35719. this.recordnotice(e)
  35720. } else this.playing && (this.cur = this.exetime.getElapsedTime(), this.excute(), this.changeview(), G.player.mattertagManager.showtitletags && G.player.mattertagManager.ttposition())
  35721. }, u.prototype.recordnotice = function(t) {
  35722. t <= 0 ? (G.toast("录制结束"), this.autoend()) : this.emit("stopRecordCountDown", t)
  35723. }, u.prototype.autoend = function() {
  35724. this.endRecord()
  35725. }, u.prototype.excute = function() {
  35726. var t;
  35727. if (void 0 === this.w) this.parr && this.parr.length ? (this.w = this.parr[0], this.outdated() ? (this.last = {
  35728. lon: this.parr[0].lon,
  35729. tap: this.parr[0].tap,
  35730. action: this.parr[0].action
  35731. }, this.parse(), this.w = void 0, this.parr.shift()) : (t = this.smoothable()) && ("dollhouse" === t || "floorplan" === t ? this.cal2(t) : "panorama" === t && this.cal2())) : this.playing && this.cur >= this.totalTime && this.rstop(this.pidx, function() {
  35732. var t = this.next();
  35733. t >= 0 && this.pplay(t)
  35734. }.bind(this));
  35735. else if (this.outdated()) this.last = {
  35736. lon: this.parr[0].lon,
  35737. tap: this.parr[0].tap,
  35738. action: this.parr[0].action
  35739. }, this.parse(), this.w = void 0, this.parr.shift();
  35740. else {
  35741. if (!(t = this.smoothable())) return;
  35742. "dollhouse" === t || "floorplan" === t ? this.get2(t) : "panorama" === t && this.get2(), this.uu(t)
  35743. }
  35744. }, u.prototype.clearnext = function() {
  35745. var t = this.w,
  35746. e = 1.5,
  35747. i = this.actiontype(t);
  35748. 2 === i ? e += 1 : 3 === i && (e += l.transition.flyTime);
  35749. t.time;
  35750. this.w = void 0, this.actiontype(this.parr[0]) || this.parr[0].time > e || this.parr.shift()
  35751. }, u.prototype.smoothable = function() {
  35752. var t = this.w;
  35753. return "dollhouse" === t.tap && G.player.mode === a.DOLLHOUSE ? "dollhouse" : "floorplan" === t.tap && G.player.mode === a.FLOORPLAN ? "floorplan" : !("panorama" !== t.tap || "rotate" !== t.action || G.player.mode !== a.PANORAMA || !G.player.currentPano || G.player.currentPano.id !== t.panoid) && "panorama"
  35754. }, u.prototype.outdated = function() {
  35755. return this.cur >= this.w.time
  35756. }, u.prototype.cal3 = function(t) {
  35757. var e = this.w.time - this.cur;
  35758. this.st = this.cur, this.iv3 = {
  35759. target: this.calv3((new s.Vector3)
  35760. .copy(this.w.target), G.player.controls[t].target, e),
  35761. offset: this.calv3((new s.Vector3)
  35762. .copy(this.w.offset), G.player.controls[t].offset, e),
  35763. camera: this.calv3((new s.Vector3)
  35764. .copy(this.w.camera), G.player.controls[t].camera.position, e)
  35765. }, this.initv3 = {
  35766. target: G.player.controls[t].target.clone(),
  35767. offset: G.player.controls[t].offset.clone(),
  35768. camera: G.player.controls[t].camera.position.clone()
  35769. }
  35770. }, u.prototype.cal2 = function(t) {
  35771. t || (t = a.PANORAMA);
  35772. var e = this.w.time - this.cur;
  35773. this.st = this.cur, this.iv2 = {
  35774. lon: (this.w.lon - G.player.controls[t].lon) / e,
  35775. lat: (this.w.lat - G.player.controls[t].lat) / e
  35776. }, this.initv2 = {
  35777. lon: G.player.controls[t].lon,
  35778. lat: G.player.controls[t].lat
  35779. }
  35780. }, u.prototype.calv3 = function(t, e, i) {
  35781. return t.clone()
  35782. .sub(e)
  35783. .multiplyScalar(1 / i)
  35784. }, u.prototype.get3 = function(t) {
  35785. for (i in this.step = {}, this.iv3) this.step[i] = this.iv3[i].clone()
  35786. .multiply(this.cur - this.st)
  35787. .add(this.initv3[i])
  35788. }, u.prototype.get2 = function() {
  35789. this.step = {}, this.step.lon = this.iv2.lon * (this.cur - this.st) + this.initv2.lon, this.step.lat = this.iv2.lat * (this.cur - this.st) + this.initv2.lat
  35790. }, u.prototype.uu = function(t) {
  35791. t !== a.FLOORPLAN && G.player.controls[t].play(this.step)
  35792. }, u.prototype.changeview = function() {
  35793. if (this.playing) {
  35794. var t = this.cur / this.totalTime * 100;
  35795. if (t > 100) return;
  35796. this.emit("updateView", this.pidx, t)
  35797. }
  35798. }, u.prototype.setCurrentView = function(t) {
  35799. this.emit("updateView", t, 0)
  35800. }, u.prototype.clearview = function(t) {
  35801. this.emit("updateView", t, 0)
  35802. }, u.prototype.checkstate = function() {
  35803. return !!(G.d && G.d.tourIsPlaying || this.playing || this.floading || this.fgotoh)
  35804. }, u.prototype.parse = function() {
  35805. var t = this.w;
  35806. if (t.tap) switch (t.tap) {
  35807. case "housedetail":
  35808. this.housedetail(null, t.open);
  35809. break;
  35810. case "dollhouse":
  35811. if (t.action)
  35812. if (G.player.mode !== a.DOLLHOUSE && G.player.mode !== a.TRANSITIONING) G.d.changeMode(a.DOLLHOUSE, "gui");
  35813. else switch (t.action) {
  35814. case "rotate":
  35815. G.player.controls[a.DOLLHOUSE].play(t)
  35816. } else G.d.changeMode(a.DOLLHOUSE, "gui");
  35817. break;
  35818. case "floorplan":
  35819. t.action ? G.player.mode !== a.FLOORPLAN && G.player.mode !== a.TRANSITIONING ? G.d.changeMode(a.FLOORPLAN, "gui") : t.action : G.d.changeMode(a.FLOORPLAN, "gui");
  35820. break;
  35821. case "panorama":
  35822. t.action ? G.player.mode !== a.PANORAMA && G.player.mode !== a.TRANSITIONING ? t.panoid ? G.player.flyToNewMode({
  35823. mode: a.PANORAMA,
  35824. pano: G.model.panos.index[t.panoid]
  35825. }) : G.d.changeMode(a.PANORAMA, "gui") : "move" === t.action ? G.player.flyToPano({
  35826. pano: G.model.panos.index[t.destid]
  35827. }) : G.player.currentPano && G.player.currentPano.id !== t.panoid ? G.player.flyToPano({
  35828. pano: G.model.panos.index[t.panoid]
  35829. }) : "rotate" === t.action && (this.panoid = t.panoid, G.player.controls[a.PANORAMA].play(t)) : G.d.changeMode(a.PANORAMA, "gui");
  35830. break;
  35831. case "outermap":
  35832. break;
  35833. case "floor":
  35834. "all" === t.action ? G.d.allFloors() : G.d.gotoFloor(parseInt(t.action));
  35835. break;
  35836. case "zoom":
  35837. if (t.type === a.PANORAMA && G.player.mode === a.PANORAMA) {
  35838. var e = G.player.controls[a.PANORAMA].camera;
  35839. G.player.zoomLevel = t.level, e.fov = G.player.baseFov * (1 / G.player.zoomLevel), e.updateProjectionMatrix(), G.player.zoomFov = e.fov
  35840. } else t.type === a.DOLLHOUSE && G.player.mode === a.DOLLHOUSE && G.player.controls[a.DOLLHOUSE].dollyOut(parseFloat(t.level))
  35841. }
  35842. }, u.prototype.actiontype = function(t) {
  35843. switch (t.tap) {
  35844. case "housedetail":
  35845. case "outermap":
  35846. return 1;
  35847. case "dollhouse":
  35848. case "floorplan":
  35849. case "panorama":
  35850. return "rotate" === t.action ? 0 : "move" === t.action ? 3 : 2;
  35851. case "floor":
  35852. return 2;
  35853. case "zoom":
  35854. return 1
  35855. }
  35856. return 0
  35857. }, u.prototype.housedetail = function(t, e) {
  35858. this.emit("housedetail", e)
  35859. }, t.exports = u
  35860. })
  35861. .call(this, n(6))
  35862. }])
  35863. }));
  35864. //# sourceMappingURL=HOUSEPLAY.js.map