index-b63eb521.js 882 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104
  1. //niggers
  2. import {
  3. u as UI,
  4. v as a,
  5. w as t,
  6. x as d,
  7. y as vo,
  8. z as LI,
  9. D as z,
  10. H as Qe,
  11. J as PI,
  12. O as Ai,
  13. K as kr,
  14. L as gn,
  15. N as Pn,
  16. Q as DI,
  17. U as Gt,
  18. V as kt,
  19. W as FI,
  20. X as xI,
  21. Y as GI,
  22. Z as BI,
  23. _ as HI,
  24. $ as VI
  25. } from "./vendor-a818b261.js";
  26. import {
  27. N as Er,
  28. a as Nt,
  29. H as bo,
  30. M as xe,
  31. T as Ss,
  32. R as ue,
  33. b as _t,
  34. A as Or,
  35. c as ls,
  36. G as dd,
  37. d as re,
  38. D as hd,
  39. C as Qs,
  40. e as WI,
  41. f as st,
  42. g as jI,
  43. h as pi,
  44. i as ln,
  45. j as Cn,
  46. k as hl,
  47. l as fi,
  48. E as qI,
  49. m as Ic,
  50. n as Ws,
  51. S as Ga,
  52. o as go,
  53. p as vt,
  54. F as ao,
  55. q as po,
  56. r as Oo,
  57. s as so,
  58. t as YI,
  59. u as md,
  60. v as Mr,
  61. w as gd,
  62. x as pd,
  63. y as fd,
  64. z as fo,
  65. B as Gs,
  66. I as _n,
  67. O as _d,
  68. V as Lt,
  69. J as ea,
  70. P as Ur,
  71. K as zt,
  72. L as Qt,
  73. U as Ed,
  74. Q as zI,
  75. W as ta,
  76. X as Id,
  77. Y as Cd,
  78. Z as Sd,
  79. _ as Td,
  80. $ as Nd,
  81. a0 as Rd,
  82. a1 as vd,
  83. a2 as KI,
  84. a3 as bd,
  85. a4 as ss,
  86. a5 as Ba,
  87. a6 as sa,
  88. a7 as $I,
  89. a8 as QI,
  90. a9 as k,
  91. aa as XI,
  92. ab as JI,
  93. ac as ZI,
  94. ad as eC,
  95. ae as Od,
  96. af as wd,
  97. ag as yd,
  98. ah as Ad,
  99. ai as tC,
  100. aj as kd,
  101. ak as Md,
  102. al as sC,
  103. am as Ud,
  104. an as Ld,
  105. ao as nC,
  106. ap as Pd,
  107. aq as Dd,
  108. ar as Fd,
  109. as as xd,
  110. at as Gd,
  111. au as Bd,
  112. av as Hd,
  113. aw as rC,
  114. ax as oC,
  115. ay as Vd,
  116. az as Wd,
  117. aA as iC,
  118. aB as jd,
  119. aC,
  120. aD as lC,
  121. aE as qd,
  122. aF as cC,
  123. aG as Yd,
  124. aH as ml,
  125. aI as zd,
  126. aJ as uC,
  127. aK as Kd,
  128. aL as $d,
  129. aM as dC,
  130. aN as Qd,
  131. aO as hC,
  132. aP as Xd,
  133. aQ as mC,
  134. aR as gC,
  135. aS as Jd,
  136. aT as Zd,
  137. aU as eh,
  138. aV as th,
  139. aW as sh,
  140. aX as pC,
  141. aY as nh,
  142. aZ as fC,
  143. a_ as rh,
  144. a$ as oh,
  145. b0 as _C,
  146. b1 as EC,
  147. b2 as IC,
  148. b3 as CC,
  149. b4 as SC,
  150. b5 as TC,
  151. b6 as NC,
  152. b7 as ih,
  153. b8 as ah,
  154. b9 as lh,
  155. ba as ch,
  156. bb as uh,
  157. bc as RC,
  158. bd as vC,
  159. be as bC,
  160. bf as dh,
  161. bg as hh,
  162. bh as OC,
  163. bi as mh,
  164. bj as gh,
  165. bk as wC,
  166. bl as yC,
  167. bm as ph,
  168. bn as AC,
  169. bo as kC,
  170. bp as gl,
  171. bq as fh,
  172. br as _h,
  173. bs as pl,
  174. bt as Ha,
  175. bu as qr,
  176. bv as Eh,
  177. bw as Ih,
  178. bx as Ch,
  179. by as Sh,
  180. bz as Th,
  181. bA as Nh,
  182. bB as MC,
  183. bC as Rh,
  184. bD as UC,
  185. bE as LC,
  186. bF as PC,
  187. bG as DC,
  188. bH as FC,
  189. bI as xC,
  190. bJ as GC,
  191. bK as BC,
  192. bL as HC,
  193. bM as vh,
  194. bN as bh,
  195. bO as Oh,
  196. bP as wh,
  197. bQ as yh,
  198. bR as Ah,
  199. bS as kh,
  200. bT as Mh,
  201. bU as Uh,
  202. bV as Lh,
  203. bW as fl,
  204. bX as Ph,
  205. bY as Dh,
  206. bZ as Fh,
  207. b_ as xh,
  208. b$ as VC,
  209. c0 as WC,
  210. c1 as jC,
  211. c2 as qC,
  212. c3 as Gh,
  213. c4 as YC,
  214. c5 as zC,
  215. c6 as KC,
  216. c7 as $C,
  217. c8 as QC,
  218. c9 as XC,
  219. ca as JC,
  220. cb as ZC,
  221. cc as eS,
  222. cd as tS,
  223. ce as sS,
  224. cf as Bh,
  225. cg as Hh,
  226. ch as Vh,
  227. ci as nS,
  228. cj as Wh,
  229. ck as _l,
  230. cl as _i,
  231. cm as jh,
  232. cn as El,
  233. co as qh,
  234. cp as Yh,
  235. cq as zh,
  236. cr as Kh,
  237. cs as $h,
  238. ct as rS,
  239. cu as oS,
  240. cv as iS,
  241. cw as aS,
  242. cx as Qh,
  243. cy as Xh,
  244. cz as Jh,
  245. cA as Zh,
  246. cB as em,
  247. cC as tm,
  248. cD as sm,
  249. cE as nm,
  250. cF as rm,
  251. cG as om,
  252. cH as lS,
  253. cI as cS,
  254. cJ as im,
  255. cK as am,
  256. cL as uS,
  257. cM as lm,
  258. cN as cm,
  259. cO as um,
  260. cP as dm,
  261. cQ as hm,
  262. cR as mm,
  263. cS as gm,
  264. cT as pm,
  265. cU as fm,
  266. cV as _m,
  267. cW as Em,
  268. cX as Im,
  269. cY as Cm,
  270. cZ as Sm,
  271. c_ as Tm,
  272. c$ as Nm,
  273. d0 as Rm,
  274. d1 as vm,
  275. d2 as bm,
  276. d3 as Om,
  277. d4 as dS,
  278. d5 as hS,
  279. d6 as wm,
  280. d7 as mS,
  281. d8 as gS,
  282. d9 as pS,
  283. da as ym,
  284. db as fS,
  285. dc as _S,
  286. dd as Am,
  287. de as km,
  288. df as cr,
  289. dg as ES,
  290. dh as Mm,
  291. di as IS,
  292. dj as CS,
  293. dk as Um,
  294. dl as SS,
  295. dm as Il,
  296. dn as Lm,
  297. dp as TS,
  298. dq as NS,
  299. dr as Pm,
  300. ds as Dm,
  301. dt as RS,
  302. du as Fm,
  303. dv as vS,
  304. dw as xm,
  305. dx as Gm,
  306. dy as Bm,
  307. dz as Hm,
  308. dA as Vm,
  309. dB as Wm,
  310. dC as jm,
  311. dD as Cl,
  312. dE as bS,
  313. dF as qm,
  314. dG as Sl,
  315. dH as OS,
  316. dI as wS,
  317. dJ as yS,
  318. dK as AS,
  319. dL as kS,
  320. dM as MS,
  321. dN as US,
  322. dO as LS,
  323. dP as PS,
  324. dQ as DS,
  325. dR as FS,
  326. dS as xS,
  327. dT as GS,
  328. dU as BS,
  329. dV as HS,
  330. dW as VS,
  331. dX as WS,
  332. dY as Ym,
  333. dZ as zm,
  334. d_ as Km,
  335. d$ as $m,
  336. e0 as jS,
  337. e1 as qS,
  338. e2 as YS,
  339. e3 as Qm,
  340. e4 as Xm,
  341. e5 as Tl,
  342. e6 as Jm,
  343. e7 as zS,
  344. e8 as KS,
  345. e9 as $S,
  346. ea as QS,
  347. eb as XS,
  348. ec as JS,
  349. ed as ZS,
  350. ee as eT,
  351. ef as tT,
  352. eg as sT,
  353. eh as nT,
  354. ei as rT,
  355. ej as Zm,
  356. ek as oT,
  357. el as iT,
  358. em as aT,
  359. en as eg,
  360. eo as tg,
  361. ep as sg,
  362. eq as lT,
  363. er as ng,
  364. es as rg,
  365. et as cT,
  366. eu as og,
  367. ev as ig,
  368. ew as ag,
  369. ex as lg,
  370. ey as uT,
  371. ez as cg,
  372. eA as dT,
  373. eB as hT,
  374. eC as mT,
  375. eD as gT,
  376. eE as pT,
  377. eF as fT,
  378. eG as _T,
  379. eH as ug,
  380. eI as ET,
  381. eJ as IT,
  382. eK as dg,
  383. eL as CT,
  384. eM as ST,
  385. eN as hg,
  386. eO as mg,
  387. eP as gg,
  388. eQ as TT,
  389. eR as NT,
  390. eS as RT,
  391. eT as vT,
  392. eU as bT,
  393. eV as OT,
  394. eW as wT,
  395. eX as yT,
  396. eY as AT,
  397. eZ as kT,
  398. e_ as MT,
  399. e$ as UT,
  400. f0 as LT,
  401. f1 as PT,
  402. f2 as DT,
  403. f3 as FT,
  404. f4 as xT,
  405. f5 as GT,
  406. f6 as BT,
  407. f7 as HT,
  408. f8 as VT,
  409. f9 as WT,
  410. fa as pg,
  411. fb as fg,
  412. fc as _g,
  413. fd as jT,
  414. fe as qT,
  415. ff as Eg,
  416. fg as YT,
  417. fh as zT,
  418. fi as KT,
  419. fj as $T,
  420. fk as QT,
  421. fl as Ig,
  422. fm as XT,
  423. fn as JT,
  424. fo as ZT,
  425. fp as eN,
  426. fq as tN,
  427. fr as sN,
  428. fs as nN,
  429. ft as rN,
  430. fu as Cg,
  431. fv as Sg,
  432. fw as Tg,
  433. fx as Nl,
  434. fy as Ng,
  435. fz as Rg,
  436. fA as Rl,
  437. fB as oN,
  438. fC as iN,
  439. fD as vg,
  440. fE as bg,
  441. fF as Og,
  442. fG as wg,
  443. fH as yg,
  444. fI as aN,
  445. fJ as lN,
  446. fK as Ag,
  447. fL as kg,
  448. fM as Mg,
  449. fN as cN,
  450. fO as uN,
  451. fP as dN,
  452. fQ as hN,
  453. fR as mN,
  454. fS as Ug,
  455. fT as Lg,
  456. fU as Pg,
  457. fV as gN,
  458. fW as Dg,
  459. fX as pN,
  460. fY as fN,
  461. fZ as Fg,
  462. f_ as _N,
  463. f$ as xg,
  464. g0 as A,
  465. g1 as EN,
  466. g2 as IN,
  467. g3 as CN,
  468. g4 as Gg,
  469. g5 as Bg,
  470. g6 as Hg,
  471. g7 as Vg,
  472. g8 as SN,
  473. g9 as TN,
  474. ga as Wg,
  475. gb as jg,
  476. gc as NN,
  477. gd as qg,
  478. ge as Yg,
  479. gf as zg,
  480. gg as Kg,
  481. gh as $g,
  482. gi as Qg,
  483. gj as Xg,
  484. gk as Yr,
  485. gl as Jg,
  486. gm as Zg,
  487. gn as vl,
  488. go as ep,
  489. gp as bl,
  490. gq as tp,
  491. gr as sp,
  492. gs as np,
  493. gt as RN,
  494. gu as rp,
  495. gv as vN,
  496. gw as bN,
  497. gx as ON,
  498. gy as wN,
  499. gz as yN,
  500. gA as AN,
  501. gB as kN,
  502. gC as MN,
  503. gD as op,
  504. gE as ip,
  505. gF as Ol,
  506. gG as UN,
  507. gH as LN,
  508. gI as ap,
  509. gJ as lp,
  510. gK as PN,
  511. gL as DN,
  512. gM as FN,
  513. gN as xN,
  514. gO as GN,
  515. gP as BN,
  516. gQ as HN,
  517. gR as VN,
  518. gS as WN,
  519. gT as jN,
  520. gU as qN,
  521. gV as YN,
  522. gW as zN,
  523. gX as cp,
  524. gY as KN,
  525. gZ as up,
  526. g_ as dp,
  527. g$ as $N,
  528. h0 as hp,
  529. h1 as mp,
  530. h2 as Va,
  531. h3 as QN,
  532. h4 as ki,
  533. h5 as gp,
  534. h6 as pp,
  535. h7 as fp,
  536. h8 as _p,
  537. h9 as Ep,
  538. ha as wl,
  539. hb as Ip,
  540. hc as Cp,
  541. hd as Sr,
  542. he as XN,
  543. hf as JN,
  544. hg as ZN,
  545. hh as eR,
  546. hi as tR,
  547. hj as sR,
  548. hk as nR,
  549. hl as rR,
  550. hm as oR,
  551. hn as iR,
  552. ho as aR,
  553. hp as lR,
  554. hq as cR,
  555. hr as uR,
  556. hs as dR,
  557. ht as hR,
  558. hu as mR,
  559. hv as gR,
  560. hw as pR,
  561. hx as fR,
  562. hy as _R,
  563. hz as ER,
  564. hA as IR,
  565. hB as CR,
  566. hC as Sp,
  567. hD as Tp,
  568. hE as Np,
  569. hF as Rp,
  570. hG as SR,
  571. hH as vp,
  572. hI as TR,
  573. hJ as NR,
  574. hK as RR,
  575. hL as vR,
  576. hM as bp,
  577. hN as yl,
  578. hO as bR,
  579. hP as OR,
  580. hQ as wR,
  581. hR as Op,
  582. hS as yR,
  583. hT as wp,
  584. hU as yp,
  585. hV as Ap,
  586. hW as kp,
  587. hX as Mp,
  588. hY as Up,
  589. hZ as Lp,
  590. h_ as di,
  591. h$ as AR,
  592. i0 as Pp,
  593. i1 as Dp,
  594. i2 as kR,
  595. i3 as MR,
  596. i4 as Fp,
  597. i5 as Mi,
  598. i6 as Wa,
  599. i7 as xp,
  600. i8 as Gp,
  601. i9 as Bp,
  602. ia as Hp,
  603. ib as Vp,
  604. ic as Wp,
  605. id as jp,
  606. ie as qp,
  607. ig as Yp,
  608. ih as zp,
  609. ii as Kp,
  610. ij as $p,
  611. ik as Qp,
  612. il as UR,
  613. im as LR,
  614. io as PR,
  615. ip as DR,
  616. iq as Xp,
  617. ir as FR,
  618. is as Jp,
  619. it as Zp,
  620. iu as Al,
  621. iv as xR,
  622. iw as GR,
  623. ix as BR,
  624. iy as HR,
  625. iz as VR,
  626. iA as WR,
  627. iB as jR,
  628. iC as qR,
  629. iD as YR,
  630. iE as zR,
  631. iF as KR,
  632. iG as $R,
  633. iH as QR,
  634. iI as XR,
  635. iJ as JR,
  636. iK as ZR,
  637. iL as ev,
  638. iM as ef,
  639. iN as tv,
  640. iO as sv,
  641. iP as nv,
  642. iQ as rv,
  643. iR as ov,
  644. iS as iv,
  645. iT as av,
  646. iU as lv,
  647. iV as tf,
  648. iW as sf,
  649. iX as cv,
  650. iY as nf,
  651. iZ as rf,
  652. i_ as uv,
  653. i$ as kl,
  654. j0 as dv,
  655. j1 as hv,
  656. j2 as mv,
  657. j3 as gv,
  658. j4 as pv,
  659. j5 as fv,
  660. j6 as _v,
  661. j7 as of,
  662. j8 as af,
  663. j9 as ja,
  664. ja as lf,
  665. jb as Ev,
  666. jc as qa,
  667. jd as cf,
  668. je as uf,
  669. jf as df,
  670. jg as hf,
  671. jh as Ya,
  672. ji as mf,
  673. jj as gf,
  674. jk as pf,
  675. jl as ff,
  676. jm as _f,
  677. jn as Ef,
  678. jo as Iv,
  679. jp as Ui,
  680. jq as Cv,
  681. jr as Sv,
  682. js as Tv,
  683. jt as Nv,
  684. ju as Rv,
  685. jv as vv,
  686. jw as bv,
  687. jx as Ov,
  688. jy as wv,
  689. jz as yv,
  690. jA as Av,
  691. jB as If,
  692. jC as Cf,
  693. jD as kv,
  694. jE as Mv,
  695. jF as Sf,
  696. jG as Tf,
  697. jH as Nf,
  698. jI as Ml,
  699. jJ as Rf,
  700. jK as vf,
  701. jL as Ul,
  702. jM as Uv,
  703. jN as bf,
  704. jO as Lv,
  705. jP as Pv,
  706. jQ as Dv,
  707. jR as Ll,
  708. jS as rn,
  709. jT as Fv,
  710. jU as xv,
  711. jV as Gv,
  712. jW as Bv,
  713. jX as Of,
  714. jY as Hv,
  715. jZ as Vv,
  716. j_ as Wv,
  717. j$ as jv,
  718. k0 as qv,
  719. k1 as wf,
  720. k2 as Yv,
  721. k3 as yf,
  722. k4 as zv,
  723. k5 as Kv,
  724. k6 as $v,
  725. k7 as Qv,
  726. k8 as Xv,
  727. k9 as Jv,
  728. ka as Zv,
  729. kb as eb,
  730. kc as Af,
  731. kd as tb,
  732. ke as sb,
  733. kf as nb,
  734. kg as Ei,
  735. kh as rb,
  736. ki as Ii,
  737. kj as ob,
  738. kk as ib,
  739. kl as kf,
  740. km as Mf,
  741. kn as ab,
  742. ko as Uf,
  743. kp as Lf,
  744. kq as Pl,
  745. kr as lb,
  746. ks as cb,
  747. kt as Pf,
  748. ku as Df,
  749. kv as Dl,
  750. kw as ub,
  751. kx as db,
  752. ky as hb,
  753. kz as mb,
  754. kA as Ff,
  755. kB as gb,
  756. kC as pb,
  757. kD as fb,
  758. kE as _b,
  759. kF as Eb,
  760. kG as xf,
  761. kH as Gf,
  762. kI as Bf,
  763. kJ as Hf,
  764. kK as Vf,
  765. kL as Ib,
  766. kM as Wf,
  767. kN as Cb,
  768. kO as Sb,
  769. kP as Tb,
  770. kQ as Nb,
  771. kR as jf,
  772. kS as Fl,
  773. kT as Rb,
  774. kU as vb,
  775. kV as xl,
  776. kW as qf,
  777. kX as Yf,
  778. kY as bb,
  779. kZ as zf,
  780. k_ as Kf,
  781. k$ as $f,
  782. l0 as Qf,
  783. l1 as Xf,
  784. l2 as za,
  785. l3 as Jf,
  786. l4 as Ob,
  787. l5 as wb,
  788. l6 as Zf,
  789. l7 as e_,
  790. l8 as Ka,
  791. l9 as t_,
  792. la as $a,
  793. lb as s_,
  794. lc as n_,
  795. ld as r_,
  796. le as o_,
  797. lf as i_,
  798. lg as a_,
  799. lh as l_,
  800. li as Gl,
  801. lj as c_,
  802. lk as u_,
  803. ll as ro,
  804. lm as yb,
  805. ln as oo,
  806. lo as d_,
  807. lp as h_,
  808. lq as Ab,
  809. lr as kb,
  810. ls as m_,
  811. lt as Bl,
  812. lu as g_,
  813. lv as Mb,
  814. lw as p_,
  815. lx as f_,
  816. ly as Ub,
  817. lz as Lb,
  818. lA as Pb,
  819. lB as Db,
  820. lC as Fb,
  821. lD as xb,
  822. lE as Gb,
  823. lF as Bb,
  824. lG as Hb,
  825. lH as Vb,
  826. lI as Wb,
  827. lJ as jb,
  828. lK as qb,
  829. lL as Yb,
  830. lM as zb,
  831. lN as Kb,
  832. lO as $b,
  833. lP as Qb,
  834. lQ as Xb,
  835. lR as __,
  836. lS as Jb,
  837. lT as Zb,
  838. lU as E_,
  839. lV as eO,
  840. lW as tO,
  841. lX as sO,
  842. lY as I_,
  843. lZ as nO,
  844. l_ as rO,
  845. l$ as oO,
  846. m0 as iO,
  847. m1 as aO,
  848. m2 as C_,
  849. m3 as S_,
  850. m4 as lO,
  851. m5 as T_,
  852. m6 as N_,
  853. m7 as cO,
  854. m8 as uO,
  855. m9 as dO,
  856. ma as R_,
  857. mb as hO,
  858. mc as Hl,
  859. md as mO,
  860. me as gO,
  861. mf as pO,
  862. mg as fO,
  863. mh as _O,
  864. mi as EO,
  865. mj as Vl,
  866. mk as IO,
  867. ml as CO,
  868. mm as SO,
  869. mn as TO,
  870. mo as NO,
  871. mp as RO,
  872. mq as vO,
  873. mr as bO,
  874. ms as OO,
  875. mt as wO,
  876. mu as yO,
  877. mv as AO,
  878. mw as kO,
  879. mx as MO,
  880. my as UO,
  881. mz as LO,
  882. mA as PO,
  883. mB as DO,
  884. mC as FO,
  885. mD as xO,
  886. mE as GO,
  887. mF as BO,
  888. mG as HO,
  889. mH as VO,
  890. mI as WO,
  891. mJ as jO,
  892. mK as qO,
  893. mL as YO,
  894. mM as zO,
  895. mN as KO,
  896. mO as $O,
  897. mP as QO,
  898. mQ as XO,
  899. mR as JO,
  900. mS as ZO,
  901. mT as ew,
  902. mU as tw,
  903. mV as sw,
  904. mW as nw,
  905. mX as rw,
  906. mY as ow,
  907. mZ as iw,
  908. m_ as aw,
  909. m$ as lw,
  910. n0 as cw,
  911. n1 as uw,
  912. n2 as dw,
  913. n3 as hw,
  914. n4 as mw,
  915. n5 as gw,
  916. n6 as pw,
  917. n7 as fw,
  918. n8 as _w,
  919. n9 as Ew,
  920. na as Iw,
  921. nb as Cw,
  922. nc as Sw,
  923. nd as Tw,
  924. ne as Nw,
  925. nf as Rw,
  926. ng as vw,
  927. nh as bw,
  928. ni as Ow,
  929. nj as ww,
  930. nk as qt,
  931. nl as Qa,
  932. nm as Cc,
  933. nn as yw,
  934. no as Ci,
  935. np as Aw,
  936. nq as Sc,
  937. nr as Xa,
  938. ns as Ja,
  939. nt as _o,
  940. nu as pt,
  941. nv as na,
  942. nw as kw,
  943. nx as Tr,
  944. ny as Mw,
  945. nz as Uw,
  946. nA as Jt,
  947. nB as bt,
  948. nC as Lw,
  949. nD as Pw,
  950. nE as Dw,
  951. nF as Ho,
  952. nG as zs,
  953. nH as je,
  954. nI as Cs,
  955. nJ as Fw,
  956. nK as xw,
  957. nL as Gw,
  958. nM as v_,
  959. nN as Bw,
  960. nO as Hw,
  961. nP as Tc,
  962. nQ as Vw,
  963. nR as b_,
  964. nS as O_,
  965. nT as w_,
  966. nU as Ww,
  967. nV as jw,
  968. nW as qw,
  969. nX as Nc,
  970. nY as Ze,
  971. nZ as Bn,
  972. n_ as Yw,
  973. n$ as Is,
  974. o0 as y_,
  975. o1 as zw,
  976. o2 as Nn,
  977. o3 as Za,
  978. o4 as on,
  979. o5 as Rc,
  980. o6 as vc,
  981. o7 as ra,
  982. o8 as bc,
  983. o9 as oa,
  984. oa as ia,
  985. ob as Kw,
  986. oc as Vo,
  987. od as aa,
  988. oe as lo,
  989. of as Oc,
  990. og as $w,
  991. oh as A_,
  992. oi as Qw,
  993. oj as la,
  994. ok as is,
  995. ol as k_,
  996. om as Xs,
  997. on as ca,
  998. oo as Xw,
  999. op as wc,
  1000. oq as qs,
  1001. or as Jw,
  1002. os as Zw,
  1003. ot as ey,
  1004. ou as ty,
  1005. ov as sy,
  1006. ow as ny,
  1007. ox as Wo,
  1008. oy as Tt,
  1009. oz as ua,
  1010. oA as yc,
  1011. oB as ry,
  1012. oC as oy,
  1013. oD as iy,
  1014. oE as ay,
  1015. oF as ly,
  1016. oG as cy,
  1017. oH as Ac,
  1018. oI as ks,
  1019. oJ as jo
  1020. } from "./nitro-renderer-c8fb0546.js";
  1021. (function() {
  1022. const e = document.createElement("link").relList;
  1023. if (e && e.supports && e.supports("modulepreload")) return;
  1024. for (const r of document.querySelectorAll('link[rel="modulepreload"]')) n(r);
  1025. new MutationObserver(r => {
  1026. for (const o of r)
  1027. if (o.type === "childList")
  1028. for (const l of o.addedNodes) l.tagName === "LINK" && l.rel === "modulepreload" && n(l)
  1029. }).observe(document, {
  1030. childList: !0,
  1031. subtree: !0
  1032. });
  1033. function s(r) {
  1034. const o = {};
  1035. return r.integrity && (o.integrity = r.integrity), r.referrerpolicy && (o.referrerPolicy = r.referrerpolicy), r.crossorigin === "use-credentials" ? o.credentials = "include" : r.crossorigin === "anonymous" ? o.credentials = "omit" : o.credentials = "same-origin", o
  1036. }
  1037. function n(r) {
  1038. if (r.ep) return;
  1039. r.ep = !0;
  1040. const o = s(r);
  1041. fetch(r.href, o)
  1042. }
  1043. })();
  1044. function _e() {
  1045. return Er.instance
  1046. }
  1047. function dt(i) {
  1048. _e().addLinkEventTracker(i)
  1049. }
  1050. function Mt() {
  1051. return _e().avatar
  1052. }
  1053. function kc(i) {
  1054. return Mt().structureData.getPalette(i)
  1055. }
  1056. function Mc(i) {
  1057. return Mt().structureData.getSetType(i)
  1058. }
  1059. function co() {
  1060. return _e().cameraManager
  1061. }
  1062. function uy() {
  1063. return _e().core
  1064. }
  1065. function dy() {
  1066. return uy().configuration
  1067. }
  1068. function oe(i) {
  1069. i = i.startsWith("event:") ? i.substring(6) : i, _e().createLinkEvent(i)
  1070. }
  1071. function Lr() {
  1072. var i;
  1073. return (i = _e()) == null ? void 0 : i.communication
  1074. }
  1075. function ee(i, e = null) {
  1076. return Nt.getValue(i, e)
  1077. }
  1078. function el() {
  1079. var i;
  1080. return (i = Lr()) == null ? void 0 : i.connection
  1081. }
  1082. function M_() {
  1083. return _e().localization
  1084. }
  1085. const ir = i => {
  1086. !i || !i.length || (i.startsWith("http") ? bo.openWebPage(i) : oe(i))
  1087. };
  1088. function ht(i) {
  1089. _e().removeLinkEventTracker(i)
  1090. }
  1091. function X() {
  1092. return _e().roomEngine
  1093. }
  1094. let da = !1,
  1095. qo = 0,
  1096. Yo = 0;
  1097. const zo = (i, e = 1) => {
  1098. const s = i.clientX,
  1099. n = i.clientY;
  1100. let r = i.type;
  1101. switch (r === xe.MOUSE_CLICK && (qo && (Yo = 1, qo >= Date.now() - 300 && Yo++), qo = Date.now(), Yo === 2 && (da || (r = xe.DOUBLE_CLICK), Yo = 0, qo = null)), r) {
  1102. case xe.MOUSE_CLICK:
  1103. break;
  1104. case xe.DOUBLE_CLICK:
  1105. break;
  1106. case xe.MOUSE_MOVE:
  1107. da = !0;
  1108. break;
  1109. case xe.MOUSE_DOWN:
  1110. da = !1;
  1111. break;
  1112. case xe.MOUSE_UP:
  1113. break;
  1114. case xe.RIGHT_CLICK:
  1115. break;
  1116. default:
  1117. return
  1118. }
  1119. X().dispatchMouseEvent(e, s, n, r, i.altKey, i.ctrlKey || i.metaKey, i.shiftKey, !1)
  1120. };
  1121. let ha = !1,
  1122. Ko = 0,
  1123. $o = 0;
  1124. const Qo = (i, e = 1, s = !1, n = !1, r = !1, o = !1) => {
  1125. let l = 0,
  1126. c = 0;
  1127. i.touches[0] ? (l = i.touches[0].clientX, c = i.touches[0].clientY) : i.changedTouches[0] && (l = i.changedTouches[0].clientX, c = i.changedTouches[0].clientY);
  1128. let u = i.type;
  1129. switch (s && (u = Ss.TOUCH_LONG), (u === xe.MOUSE_CLICK || u === Ss.TOUCH_END) && (u = xe.MOUSE_CLICK, Ko && ($o = 1, Ko >= Date.now() - 300 && $o++), Ko = Date.now(), $o === 2 && (ha || (u = xe.DOUBLE_CLICK), $o = 0, Ko = null)), u) {
  1130. case xe.MOUSE_CLICK:
  1131. break;
  1132. case xe.DOUBLE_CLICK:
  1133. break;
  1134. case Ss.TOUCH_START:
  1135. u = xe.MOUSE_DOWN, ha = !1;
  1136. break;
  1137. case Ss.TOUCH_MOVE:
  1138. u = xe.MOUSE_MOVE, ha = !0;
  1139. break;
  1140. case Ss.TOUCH_END:
  1141. u = xe.MOUSE_UP;
  1142. break;
  1143. case Ss.TOUCH_LONG:
  1144. u = xe.MOUSE_DOWN_LONG;
  1145. break;
  1146. default:
  1147. return
  1148. }
  1149. u === Ss.TOUCH_START && X().dispatchMouseEvent(e, l, c, u, n, r, o, !1), X().dispatchMouseEvent(e, l, c, u, n, r, o, !1)
  1150. };
  1151. function as(i) {
  1152. if (!i || !i.model) return !1;
  1153. const e = J().userId,
  1154. s = i.model.getValue(ue.FURNITURE_OWNER_ID);
  1155. return e === s
  1156. }
  1157. function Eo(i, e, s) {
  1158. return i ? i.isRoomOwner || i.controllerLevel >= _t.GUEST || J().isModerator || as(X().getRoomObject(i.roomId, e, s)) : !1
  1159. }
  1160. function ur() {
  1161. return _e().roomSessionManager
  1162. }
  1163. function rr(i, e = null) {
  1164. ur().createSession(i, e)
  1165. }
  1166. function hy() {
  1167. const i = dr();
  1168. return i ? i.model.getValue(ue.FIGURE_CAN_STAND_UP) : Or.POSTURE_STAND
  1169. }
  1170. function ma() {
  1171. const i = dr();
  1172. if (!i) return !1;
  1173. const s = i.model.getValue(ue.FIGURE_EFFECT);
  1174. return !(s === 29 || s === 30 || s === 185)
  1175. }
  1176. function J() {
  1177. return _e().sessionDataManager
  1178. }
  1179. function gs() {
  1180. return ee("hc.disabled", !1) ? ls.VIP : J().clubLevel
  1181. }
  1182. class ds {}
  1183. ds.OKAY = 0;
  1184. ds.MISSING_OFFER = 1;
  1185. ds.FURNI_LIMIT_REACHED = 2;
  1186. ds.NOT_IN_ROOM = 3;
  1187. ds.NOT_ROOM_OWNER = 4;
  1188. ds.GUILD_ROOM = 5;
  1189. ds.VISITORS_IN_ROOM = 6;
  1190. class my {
  1191. constructor(e, s, n) {
  1192. this._depth = 0, this._localization = "", this._pageId = -1, this._pageName = "", this._iconId = 0, this._iconColor = "", this._depth = s, this._parent = n, this._localization = e.localization, this._pageId = e.pageId, this._pageName = e.pageName, this._iconId = e.icon, this._iconColor = e.iconColor, this._children = [], this._offerIds = e.offerIds, this._isVisible = e.visible, this._isActive = !1, this._isOpen = !1
  1193. }
  1194. activate() {
  1195. this._isActive = !0
  1196. }
  1197. deactivate() {
  1198. this._isActive = !1
  1199. }
  1200. open() {
  1201. this._isOpen = !0
  1202. }
  1203. close() {
  1204. this._isOpen = !1
  1205. }
  1206. addChild(e) {
  1207. e && this._children.push(e)
  1208. }
  1209. get depth() {
  1210. return this._depth
  1211. }
  1212. get isBranch() {
  1213. return this._children.length > 0
  1214. }
  1215. get isLeaf() {
  1216. return this._children.length === 0
  1217. }
  1218. get localization() {
  1219. return this._localization
  1220. }
  1221. get pageId() {
  1222. return this._pageId
  1223. }
  1224. get pageName() {
  1225. return this._pageName
  1226. }
  1227. get iconId() {
  1228. return this._iconId
  1229. }
  1230. get iconColor() {
  1231. return this._iconColor
  1232. }
  1233. get children() {
  1234. return this._children
  1235. }
  1236. get offerIds() {
  1237. return this._offerIds
  1238. }
  1239. get parent() {
  1240. return this._parent
  1241. }
  1242. get isVisible() {
  1243. return this._isVisible
  1244. }
  1245. get isActive() {
  1246. return this._isActive
  1247. }
  1248. get isOpen() {
  1249. return this._isOpen
  1250. }
  1251. }
  1252. const U_ = class {
  1253. constructor(i, e, s, n, r, o = -1) {
  1254. this._pageId = i, this._layoutCode = e, this._localization = s, this._offers = n, this._acceptSeasonCurrencyAsCredits = r;
  1255. for (const l of n) l.page = this;
  1256. o === -1 ? this._mode = U_.MODE_NORMAL : this._mode = o
  1257. }
  1258. get pageId() {
  1259. return this._pageId
  1260. }
  1261. get layoutCode() {
  1262. return this._layoutCode
  1263. }
  1264. get localization() {
  1265. return this._localization
  1266. }
  1267. get offers() {
  1268. return this._offers
  1269. }
  1270. get acceptSeasonCurrencyAsCredits() {
  1271. return this._acceptSeasonCurrencyAsCredits
  1272. }
  1273. get mode() {
  1274. return this._mode
  1275. }
  1276. };
  1277. let Wl = U_;
  1278. Wl.MODE_NORMAL = 0;
  1279. class It {}
  1280. It.DUCKET_INFO = "ducket_info";
  1281. It.CREDITS = "credits";
  1282. It.AVATAR_EFFECTS = "avatar_effects";
  1283. It.HC_MEMBERSHIP = "hc_membership";
  1284. It.CLUB_GIFTS = "club_gifts";
  1285. It.LIMITED_SOLD = "limited_sold";
  1286. It.PET_ACCESSORIES = "pet_accessories";
  1287. It.TRAX_SONGS = "trax_songs";
  1288. It.NEW_ADDITIONS = "new_additions";
  1289. It.QUEST_SHELL = "quest_shell";
  1290. It.QUEST_SNOWFLAKES = "quest_snowflakes";
  1291. It.VAL_QUESTS = "val_quests";
  1292. It.GUILD_CUSTOM_FURNI = "guild_custom_furni";
  1293. It.GIFT_SHOP = "gift_shop";
  1294. It.HORSE_STYLES = "horse_styles";
  1295. It.HORSE_SHOE = "horse_shoe";
  1296. It.SET_EASTER = "set_easter";
  1297. It.ECOTRON_TRANSFORM = "ecotron_transform";
  1298. It.LOYALTY_INFO = "loyalty_info";
  1299. It.ROOM_BUNDLES = "room_bundles";
  1300. It.ROOM_BUNDLES_MOBILE = "room_bundles_mobile";
  1301. It.HABBO_CLUB_DESKTOP = "habbo_club_desktop";
  1302. It.MOBILE_SUBSCRIPTIONS = "mobile_subscriptions";
  1303. class gy {
  1304. constructor(e, s) {
  1305. this.breed = e, this.palettes = s
  1306. }
  1307. }
  1308. class Oe {}
  1309. Oe.NONE = 0;
  1310. Oe.CONFIRM = 1;
  1311. Oe.PURCHASE = 2;
  1312. Oe.NO_CREDITS = 3;
  1313. Oe.NO_POINTS = 4;
  1314. Oe.SOLD_OUT = 5;
  1315. Oe.FAILED = 6;
  1316. class Us {}
  1317. Us.NORMAL = "NORMAL";
  1318. Us.BUILDER = "BUILDERS_CLUB";
  1319. const py = i => "",
  1320. fy = i => "",
  1321. Uc = (i, e) => {
  1322. const s = i.get(e),
  1323. n = [];
  1324. if (s && s.length)
  1325. for (const r of s) r.isVisible && n.push(r);
  1326. return n
  1327. },
  1328. L_ = (i, e, s, n) => {
  1329. if (s.isVisible && s.pageId > 0) {
  1330. let r = !1;
  1331. const o = [s.pageName, s.localization].join(" ").toLowerCase().replace(/ /gi, "");
  1332. if (o.indexOf(i) > -1 && (n.push(s), r = !0), !r) {
  1333. for (const l of e)
  1334. if (o.indexOf(l) >= 0) {
  1335. n.push(s);
  1336. break
  1337. }
  1338. }
  1339. }
  1340. for (const r of s.children) L_(i, e, r, n)
  1341. };
  1342. function _y(i) {
  1343. if (!i.length) return 0;
  1344. let e = i.length - 1;
  1345. for (; e >= 0 && !isNaN(parseInt(i.charAt(e)));) e--;
  1346. return e > 0 ? parseInt(i.substring(e + 1)) : -1
  1347. }
  1348. function Ey(i, e) {
  1349. switch (i) {
  1350. case 0:
  1351. return [
  1352. [16743226],
  1353. [16750435],
  1354. [16764339],
  1355. [16094464],
  1356. [16498012],
  1357. [16704690],
  1358. [15586304],
  1359. [16115545],
  1360. [16513201],
  1361. [8694111],
  1362. [11585939],
  1363. [14413767],
  1364. [6664599],
  1365. [9553845],
  1366. [12971486],
  1367. [8358322],
  1368. [10002885],
  1369. [13292268],
  1370. [10780600],
  1371. [12623573],
  1372. [14403561],
  1373. [12418717],
  1374. [14327229],
  1375. [15517403],
  1376. [14515069],
  1377. [15764368],
  1378. [16366271],
  1379. [11250603],
  1380. [13948116],
  1381. [16777215],
  1382. [14256481],
  1383. [14656129],
  1384. [15848130],
  1385. [14005087],
  1386. [14337152],
  1387. [15918540],
  1388. [15118118],
  1389. [15531929],
  1390. [9764857],
  1391. [11258085]
  1392. ];
  1393. case 1:
  1394. return [
  1395. [16743226],
  1396. [16750435],
  1397. [16764339],
  1398. [16094464],
  1399. [16498012],
  1400. [16704690],
  1401. [15586304],
  1402. [16115545],
  1403. [16513201],
  1404. [8694111],
  1405. [11585939],
  1406. [14413767],
  1407. [6664599],
  1408. [9553845],
  1409. [12971486],
  1410. [8358322],
  1411. [10002885],
  1412. [13292268],
  1413. [10780600],
  1414. [12623573],
  1415. [14403561],
  1416. [12418717],
  1417. [14327229],
  1418. [15517403],
  1419. [14515069],
  1420. [15764368],
  1421. [16366271],
  1422. [11250603],
  1423. [13948116],
  1424. [16777215],
  1425. [14256481],
  1426. [14656129],
  1427. [15848130],
  1428. [14005087],
  1429. [14337152],
  1430. [15918540],
  1431. [15118118],
  1432. [15531929],
  1433. [9764857],
  1434. [11258085]
  1435. ];
  1436. case 2:
  1437. return [
  1438. [16579283],
  1439. [15378351],
  1440. [8830016],
  1441. [15257125],
  1442. [9340985],
  1443. [8949607],
  1444. [6198292],
  1445. [8703620],
  1446. [9889626],
  1447. [8972045],
  1448. [12161285],
  1449. [13162269],
  1450. [8620113],
  1451. [12616503],
  1452. [8628101],
  1453. [13827840],
  1454. [9764857]
  1455. ];
  1456. case 3:
  1457. return [
  1458. [16777215],
  1459. [15658734],
  1460. [14540253]
  1461. ];
  1462. case 4:
  1463. return [
  1464. [16777215],
  1465. [16053490],
  1466. [15464440],
  1467. [16248792],
  1468. [15396319],
  1469. [15007487]
  1470. ];
  1471. case 5:
  1472. return [
  1473. [16777215],
  1474. [15658734],
  1475. [14540253]
  1476. ];
  1477. case 6:
  1478. return [
  1479. [16777215],
  1480. [15658734],
  1481. [14540253],
  1482. [16767177],
  1483. [16770205],
  1484. [16751331]
  1485. ];
  1486. case 7:
  1487. return [
  1488. [13421772],
  1489. [11447982],
  1490. [16751331],
  1491. [10149119],
  1492. [16763290],
  1493. [16743786]
  1494. ];
  1495. default:
  1496. {
  1497. const s = [];
  1498. for (const n of e) {
  1499. const r = X().getPetColorResult(i, n.paletteId);
  1500. r && (r.primaryColor === r.secondaryColor ? s.push([r.primaryColor]) : s.push([r.primaryColor, r.secondaryColor]))
  1501. }
  1502. return s
  1503. }
  1504. }
  1505. }
  1506. class Ce {}
  1507. Ce.WALL = "i";
  1508. Ce.FLOOR = "s";
  1509. Ce.EFFECT = "e";
  1510. Ce.HABBO_CLUB = "h";
  1511. Ce.BADGE = "b";
  1512. Ce.GAME_TOKEN = "GAME_TOKEN";
  1513. Ce.PET = "p";
  1514. Ce.ROBOT = "r";
  1515. const P_ = class {
  1516. constructor(i, e, s, n, r, o, l = !1, c = 0, u = 0) {
  1517. this._productType = i.toLowerCase(), this._productClassId = e, this._extraParam = s, this._productCount = n, this._productData = r, this._furnitureData = o, this._isUniqueLimitedItem = l, this._uniqueLimitedItemSeriesSize = c, this._uniqueLimitedItemsLeft = u
  1518. }
  1519. static stripAddonProducts(i) {
  1520. return i.length === 1 ? i : i.filter(e => e.productType !== Ce.BADGE && e.productType !== Ce.EFFECT && e.productClassId !== P_.EFFECT_CLASSID_NINJA_DISAPPEAR)
  1521. }
  1522. getIconUrl(i = null, e = null) {
  1523. switch (this._productType) {
  1524. case Ce.FLOOR:
  1525. return X().getFurnitureFloorIconUrl(this.productClassId);
  1526. case Ce.WALL:
  1527. {
  1528. if (i && this._furnitureData) {
  1529. let s = "";
  1530. switch (this._furnitureData.className) {
  1531. case "floor":
  1532. s = ["th", this._furnitureData.className, i.product.extraParam].join("_");
  1533. break;
  1534. case "wallpaper":
  1535. s = ["th", "wall", i.product.extraParam].join("_");
  1536. break;
  1537. case "landscape":
  1538. s = ["th", this._furnitureData.className, (i.product.extraParam || "").replace(".", "_"), "001"].join("_");
  1539. break
  1540. }
  1541. if (s !== "") return `${ee("catalog.asset.url")}/${s}.png`
  1542. }
  1543. return X().getFurnitureWallIconUrl(this.productClassId, this._extraParam)
  1544. }
  1545. case Ce.EFFECT:
  1546. return py(this.productClassId);
  1547. case Ce.HABBO_CLUB:
  1548. return fy(this.productClassId);
  1549. case Ce.BADGE:
  1550. return J().getBadgeUrl(this._extraParam);
  1551. case Ce.ROBOT:
  1552. return null
  1553. }
  1554. return null
  1555. }
  1556. get productType() {
  1557. return this._productType
  1558. }
  1559. get productClassId() {
  1560. return this._productClassId
  1561. }
  1562. get extraParam() {
  1563. return this._extraParam
  1564. }
  1565. set extraParam(i) {
  1566. this._extraParam = i
  1567. }
  1568. get productCount() {
  1569. return this._productCount
  1570. }
  1571. get productData() {
  1572. return this._productData
  1573. }
  1574. get furnitureData() {
  1575. return this._furnitureData
  1576. }
  1577. get isUniqueLimitedItem() {
  1578. return this._isUniqueLimitedItem
  1579. }
  1580. get uniqueLimitedItemSeriesSize() {
  1581. return this._uniqueLimitedItemSeriesSize
  1582. }
  1583. get uniqueLimitedItemsLeft() {
  1584. return this._uniqueLimitedItemsLeft
  1585. }
  1586. set uniqueLimitedItemsLeft(i) {
  1587. this._uniqueLimitedItemsLeft = i
  1588. }
  1589. };
  1590. let or = P_;
  1591. or.EFFECT_CLASSID_NINJA_DISAPPEAR = 108;
  1592. const sn = class {
  1593. constructor(i, e, s, n, r, o, l, c, u, h) {
  1594. this._clubLevel = 0, this._bundlePurchaseAllowed = !1, this._offerId = i, this._localizationId = e, this._isRentOffer = s, this._priceInCredits = n, this._priceInActivityPoints = r, this._activityPointType = o, this._giftable = l, this._clubLevel = c, this._products = u, this._bundlePurchaseAllowed = h, this.setPricingModelForProducts(), this.setPricingType();
  1595. for (const m of u)
  1596. if (m.productType === Ce.BADGE) {
  1597. this._badgeCode = m.extraParam;
  1598. break
  1599. }
  1600. }
  1601. activate() {}
  1602. get clubLevel() {
  1603. return this._clubLevel
  1604. }
  1605. get page() {
  1606. return this._page
  1607. }
  1608. set page(i) {
  1609. this._page = i
  1610. }
  1611. get offerId() {
  1612. return this._offerId
  1613. }
  1614. get localizationId() {
  1615. return this._localizationId
  1616. }
  1617. get priceInCredits() {
  1618. return this._priceInCredits
  1619. }
  1620. get priceInActivityPoints() {
  1621. return this._priceInActivityPoints
  1622. }
  1623. get activityPointType() {
  1624. return this._activityPointType
  1625. }
  1626. get giftable() {
  1627. return this._giftable
  1628. }
  1629. get product() {
  1630. if (!this._products || !this._products.length) return null;
  1631. if (this._products.length === 1) return this._products[0];
  1632. const i = or.stripAddonProducts(this._products);
  1633. return i.length ? i[0] : null
  1634. }
  1635. get pricingModel() {
  1636. return this._pricingModel
  1637. }
  1638. get priceType() {
  1639. return this._priceType
  1640. }
  1641. get bundlePurchaseAllowed() {
  1642. return this._bundlePurchaseAllowed
  1643. }
  1644. get isRentOffer() {
  1645. return this._isRentOffer
  1646. }
  1647. get badgeCode() {
  1648. return this._badgeCode
  1649. }
  1650. get localizationName() {
  1651. const i = wr(this._localizationId);
  1652. return i ? i.name : g(this._localizationId)
  1653. }
  1654. get localizationDescription() {
  1655. const i = wr(this._localizationId);
  1656. return i ? i.description : g(this._localizationId)
  1657. }
  1658. get isLazy() {
  1659. return !1
  1660. }
  1661. get products() {
  1662. return this._products
  1663. }
  1664. setPricingModelForProducts() {
  1665. const i = or.stripAddonProducts(this._products);
  1666. i.length === 1 ? i[0].productCount === 1 ? this._pricingModel = sn.PRICING_MODEL_SINGLE : this._pricingModel = sn.PRICING_MODEL_MULTI : i.length > 1 ? this._pricingModel = sn.PRICING_MODEL_BUNDLE : this._pricingModel = sn.PRICING_MODEL_UNKNOWN
  1667. }
  1668. setPricingType() {
  1669. this._priceInCredits > 0 && this._priceInActivityPoints > 0 ? this._priceType = sn.PRICE_TYPE_CREDITS_ACTIVITYPOINTS : this._priceInCredits > 0 ? this._priceType = sn.PRICE_TYPE_CREDITS : this._priceInActivityPoints > 0 ? this._priceType = sn.PRICE_TYPE_ACTIVITYPOINTS : this._priceType = sn.PRICE_TYPE_NONE
  1670. }
  1671. clone() {
  1672. const i = [],
  1673. e = wr(this.localizationId);
  1674. for (const n of this._products) {
  1675. const r = Io(n.productClassId, n.productType);
  1676. i.push(new or(n.productType, n.productClassId, n.extraParam, n.productCount, e, r))
  1677. }
  1678. const s = new sn(this.offerId, this.localizationId, this.isRentOffer, this.priceInCredits, this.priceInActivityPoints, this.activityPointType, this.giftable, this.clubLevel, i, this.bundlePurchaseAllowed);
  1679. return s.page = this.page, s
  1680. }
  1681. };
  1682. let et = sn;
  1683. et.PRICING_MODEL_UNKNOWN = "pricing_model_unknown";
  1684. et.PRICING_MODEL_SINGLE = "pricing_model_single";
  1685. et.PRICING_MODEL_MULTI = "pricing_model_multi";
  1686. et.PRICING_MODEL_BUNDLE = "pricing_model_bundle";
  1687. et.PRICING_MODEL_FURNITURE = "pricing_model_furniture";
  1688. et.PRICE_TYPE_NONE = "price_type_none";
  1689. et.PRICE_TYPE_CREDITS = "price_type_credits";
  1690. et.PRICE_TYPE_ACTIVITYPOINTS = "price_type_activitypoints";
  1691. et.PRICE_TYPE_CREDITS_ACTIVITYPOINTS = "price_type_credits_and_activitypoints";
  1692. class Iy {
  1693. constructor(e) {
  1694. this._furniData = e, this._product = new or(this._furniData.type, this._furniData.id, this._furniData.customParams, 1, wr(this._furniData.className), this._furniData)
  1695. }
  1696. activate() {
  1697. B(new dd(this._furniData.rentOfferId > -1 ? this._furniData.rentOfferId : this._furniData.purchaseOfferId))
  1698. }
  1699. get offerId() {
  1700. return this.isRentOffer ? this._furniData.rentOfferId : this._furniData.purchaseOfferId
  1701. }
  1702. get priceInActivityPoints() {
  1703. return 0
  1704. }
  1705. get activityPointType() {
  1706. return 0
  1707. }
  1708. get priceInCredits() {
  1709. return 0
  1710. }
  1711. get page() {
  1712. return this._page
  1713. }
  1714. set page(e) {
  1715. this._page = e
  1716. }
  1717. get priceType() {
  1718. return ""
  1719. }
  1720. get product() {
  1721. return this._product
  1722. }
  1723. get products() {
  1724. return [this._product]
  1725. }
  1726. get localizationId() {
  1727. return "roomItem.name." + this._furniData.id
  1728. }
  1729. get bundlePurchaseAllowed() {
  1730. return !1
  1731. }
  1732. get isRentOffer() {
  1733. return this._furniData.rentOfferId > -1
  1734. }
  1735. get giftable() {
  1736. return !1
  1737. }
  1738. get pricingModel() {
  1739. return et.PRICING_MODEL_FURNITURE
  1740. }
  1741. get clubLevel() {
  1742. return 0
  1743. }
  1744. get badgeCode() {
  1745. return ""
  1746. }
  1747. get localizationName() {
  1748. return this._furniData.name
  1749. }
  1750. get localizationDescription() {
  1751. return this._furniData.description
  1752. }
  1753. get isLazy() {
  1754. return !0
  1755. }
  1756. }
  1757. const D_ = (i, e, s = null) => {
  1758. let n = null;
  1759. switch (i.toLocaleLowerCase()) {
  1760. case Ce.FLOOR:
  1761. n = X().getFurnitureFloorIconUrl(e);
  1762. break;
  1763. case Ce.WALL:
  1764. n = X().getFurnitureWallIconUrl(e, s);
  1765. break
  1766. }
  1767. return n
  1768. };
  1769. class Cy {
  1770. constructor(e) {
  1771. this._isEnabled = !1, this._price = null, this._stuffTypes = null, this._boxTypes = null, this._ribbonTypes = null, this._defaultStuffTypes = null, this._isEnabled = e.isEnabled, this._price = e.price, this._boxTypes = e.boxTypes, this._ribbonTypes = e.ribbonTypes, this._stuffTypes = e.giftWrappers, this._defaultStuffTypes = e.giftFurnis
  1772. }
  1773. get isEnabled() {
  1774. return this._isEnabled
  1775. }
  1776. get price() {
  1777. return this._price
  1778. }
  1779. get stuffTypes() {
  1780. return this._stuffTypes
  1781. }
  1782. get boxTypes() {
  1783. return this._boxTypes
  1784. }
  1785. get ribbonTypes() {
  1786. return this._ribbonTypes
  1787. }
  1788. get defaultStuffTypes() {
  1789. return this._defaultStuffTypes
  1790. }
  1791. }
  1792. class wo {
  1793. constructor(e, s, n, r, o, l, c, u, h = -1) {
  1794. this._timeLeftMinutes = -1, this._offerId = e, this._furniId = s, this._furniType = n, this._extraData = r, this._stuffData = o, this._price = l, this._status = c, this._averagePrice = u, this._offerCount = h
  1795. }
  1796. get offerId() {
  1797. return this._offerId
  1798. }
  1799. set offerId(e) {
  1800. this._offerId = e
  1801. }
  1802. get furniId() {
  1803. return this._furniId
  1804. }
  1805. get furniType() {
  1806. return this._furniType
  1807. }
  1808. get extraData() {
  1809. return this._extraData
  1810. }
  1811. get stuffData() {
  1812. return this._stuffData
  1813. }
  1814. get price() {
  1815. return this._price
  1816. }
  1817. set price(e) {
  1818. this._price = e
  1819. }
  1820. get averagePrice() {
  1821. return this._averagePrice
  1822. }
  1823. get image() {
  1824. return this._image
  1825. }
  1826. set image(e) {
  1827. this._image = e
  1828. }
  1829. get imageCallback() {
  1830. return this._imageCallback
  1831. }
  1832. set imageCallback(e) {
  1833. this._imageCallback = e
  1834. }
  1835. get status() {
  1836. return this._status
  1837. }
  1838. get timeLeftMinutes() {
  1839. return this._timeLeftMinutes
  1840. }
  1841. set timeLeftMinutes(e) {
  1842. this._timeLeftMinutes = e
  1843. }
  1844. get offerCount() {
  1845. return this._offerCount
  1846. }
  1847. set offerCount(e) {
  1848. this._offerCount = e
  1849. }
  1850. get isUniqueLimitedItem() {
  1851. return this.stuffData && this.stuffData.uniqueSeries > 0
  1852. }
  1853. }
  1854. wo.TYPE_FLOOR = 1;
  1855. wo.TYPE_WALL = 2;
  1856. class ar {}
  1857. ar.ONGOING = 1;
  1858. ar.ONGOING_OWN = 1;
  1859. ar.SOLD = 2;
  1860. ar.EXPIRED = 3;
  1861. class Yt {}
  1862. Yt.BY_ACTIVITY = 1;
  1863. Yt.BY_VALUE = 2;
  1864. Yt.ADVANCED = 3;
  1865. class F_ {
  1866. constructor(e, s) {
  1867. this._images = e, this._texts = s
  1868. }
  1869. getText(e) {
  1870. let s = this._texts[e] || "";
  1871. return s && s.length && (s = s.replace(/\r\n|\r|\n/g, "<br />")), s
  1872. }
  1873. getImage(e) {
  1874. const s = this._images[e] || "";
  1875. if (!s || !s.length) return null;
  1876. let n = ee("catalog.asset.image.url");
  1877. return n = n.replace("%name%", s), n
  1878. }
  1879. }
  1880. class Sy {
  1881. constructor(e, s, n, r, o, l, c, u) {
  1882. this.roomId = e, this.objectId = s, this.category = n, this.wallLocation = r, this.x = o, this.y = l, this.direction = c, this.offer = u
  1883. }
  1884. get offerId() {
  1885. return this.offer.offerId
  1886. }
  1887. get productClassId() {
  1888. return this.offer.product.productClassId
  1889. }
  1890. get productData() {
  1891. return this.offer.product.productData
  1892. }
  1893. get furniData() {
  1894. return this.offer.product.furnitureData
  1895. }
  1896. get extraParam() {
  1897. return this.offer.product.extraParam
  1898. }
  1899. }
  1900. const Ir = class {
  1901. constructor() {
  1902. this._requestType = Ir.REQUEST_TYPE_NONE
  1903. }
  1904. resetRequest() {
  1905. this._requestType = Ir.REQUEST_TYPE_NONE, this._requestById = -1, this._requestedByOfferId = -1, this._requestByName = null
  1906. }
  1907. get requestType() {
  1908. return this._requestType
  1909. }
  1910. get requestById() {
  1911. return this._requestById
  1912. }
  1913. set requestById(i) {
  1914. this._requestType = Ir.REQUEST_TYPE_ID, this._requestById = i
  1915. }
  1916. get requestedByOfferId() {
  1917. return this._requestedByOfferId
  1918. }
  1919. set requestedByOfferId(i) {
  1920. this._requestType = Ir.REQUEST_TYPE_OFFER, this._requestedByOfferId = i
  1921. }
  1922. get requestByName() {
  1923. return this._requestByName
  1924. }
  1925. set requestByName(i) {
  1926. this._requestType = Ir.REQUEST_TYPE_NAME, this._requestByName = i
  1927. }
  1928. };
  1929. let Sn = Ir;
  1930. Sn.REQUEST_TYPE_NONE = 0;
  1931. Sn.REQUEST_TYPE_ID = 1;
  1932. Sn.REQUEST_TYPE_OFFER = 2;
  1933. Sn.REQUEST_TYPE_NAME = 3;
  1934. class Ty {
  1935. constructor(e, s, n) {
  1936. this.searchValue = e, this.offers = s, this.filteredNodes = n
  1937. }
  1938. }
  1939. function Io(i, e) {
  1940. let s = null;
  1941. switch (e.toLowerCase()) {
  1942. case Ce.FLOOR:
  1943. s = J().getFloorItemData(i);
  1944. break;
  1945. case Ce.WALL:
  1946. s = J().getWallItemData(i);
  1947. break
  1948. }
  1949. return s
  1950. }
  1951. function Li(i, e, s) {
  1952. const n = X().getRoomObject(i, e, s);
  1953. if (!n) return;
  1954. const r = n.model.getValue(ue.FURNITURE_TYPE_ID);
  1955. switch (s) {
  1956. case re.FLOOR:
  1957. return J().getFloorItemData(r);
  1958. case re.WALL:
  1959. return J().getWallItemData(r)
  1960. }
  1961. return null
  1962. }
  1963. function Ny() {
  1964. const i = dr();
  1965. return i ? i.model.getValue(ue.FIGURE_POSTURE) : Or.POSTURE_STAND
  1966. }
  1967. function wr(i) {
  1968. return i ? J().getProductData(i) : null
  1969. }
  1970. function Pe() {
  1971. return ur().getSession(-1)
  1972. }
  1973. function tl() {
  1974. B(new hd)
  1975. }
  1976. function Nr() {
  1977. return J().clubLevel >= ls.CLUB
  1978. }
  1979. function Xo() {
  1980. return J().clubLevel >= ls.VIP
  1981. }
  1982. function Ry(i) {
  1983. const e = X().getRoomObject(Pe().roomId, i, re.FLOOR);
  1984. if (!e || !e.model) return !1;
  1985. const s = J().userId,
  1986. n = e.model.getValue(ue.FURNITURE_OWNER_ID);
  1987. return s === n
  1988. }
  1989. function vy() {
  1990. const i = dr();
  1991. return i ? i.model.getValue(ue.FIGURE_EFFECT) === 77 : !1
  1992. }
  1993. function by(i) {
  1994. ur().startSession(i)
  1995. }
  1996. const jl = () => {
  1997. Pe() && (tl(), ur().removeSession(-1))
  1998. };
  1999. function dr() {
  2000. const i = J().userId,
  2001. e = X().activeRoomId,
  2002. s = re.UNIT,
  2003. n = X().getTotalObjectsForManager(e, s);
  2004. let r = 0;
  2005. for (; r < n;) {
  2006. const o = X().getRoomObjectByIndex(e, r, s);
  2007. if (o) {
  2008. const l = Pe().userDataManager.getUserDataByIndex(o.id);
  2009. if (l && l.webID === i) return o
  2010. }
  2011. r++
  2012. }
  2013. return null
  2014. }
  2015. const Pi = (i, e, s, n = 1) => {
  2016. const r = X().getRoomObjectBoundingRectangle(i, e, s, n);
  2017. return r ? (r.x = Math.round(r.x), r.y = Math.round(r.y), r) : null
  2018. },
  2019. x_ = (i, e, s, n = 1) => {
  2020. const r = X().getRoomObjectScreenLocation(i, e, s, n);
  2021. return r ? (r.x = Math.round(r.x), r.y = Math.round(r.y), r) : null
  2022. },
  2023. Oy = (i, e, s = 1) => {
  2024. const n = X(),
  2025. r = n.activeRoomId;
  2026. n.initializeRoomInstanceRenderingCanvas(r, s, i, e)
  2027. };
  2028. function wy(i) {
  2029. let e = !1;
  2030. const s = X().getRoomObject(i.roomId, i.objectId, i.category);
  2031. return s && s.model.getValue(ue.FURNITURE_SELECTION_DISABLED) === 1 && (e = !0, J().isModerator && (e = !1)), e
  2032. }
  2033. function Rr(i, e, s) {
  2034. X().processRoomObjectOperation(i, e, s)
  2035. }
  2036. function Lc(i) {
  2037. X().setActiveRoomId(i)
  2038. }
  2039. const B = i => el().send(i);
  2040. class ms {
  2041. static getAchievementBadgeCode(e) {
  2042. if (!e) return null;
  2043. let s = e.badgeId;
  2044. return e.finalLevel || (s = M_().getPreviousLevelBadgeId(s)), s
  2045. }
  2046. static getAchievementCategoryImageUrl(e, s = null, n = !1) {
  2047. const r = ee("achievements.images.url");
  2048. let o = n ? "achicon_" : "achcategory_";
  2049. return o += e.code, s !== null && (o += `_${s>0?"active":"inactive"}`), r.replace("%image%", o)
  2050. }
  2051. static getAchievementCategoryMaxProgress(e) {
  2052. if (!e) return 0;
  2053. let s = 0;
  2054. for (const n of e.achievements) s += n.levelCount;
  2055. return s
  2056. }
  2057. static getAchievementCategoryProgress(e) {
  2058. if (!e) return 0;
  2059. let s = 0;
  2060. for (const n of e.achievements) s += n.finalLevel ? n.level : n.level - 1;
  2061. return s
  2062. }
  2063. static getAchievementCategoryTotalUnseen(e) {
  2064. if (!e) return 0;
  2065. let s = 0;
  2066. for (const n of e.achievements) n.unseen > 0 && s++;
  2067. return s
  2068. }
  2069. static getAchievementHasStarted(e) {
  2070. return e ? !!(e.finalLevel || e.level - 1 > 0) : !1
  2071. }
  2072. static getAchievementIsIgnored(e) {
  2073. if (!e) return !1;
  2074. const s = ee("achievements.unseen.ignored"),
  2075. n = e.badgeId.replace(/[0-9]/g, "");
  2076. return s.indexOf(n) >= 0
  2077. }
  2078. static getAchievementLevel(e) {
  2079. return e ? e.finalLevel ? e.level : e.level - 1 : 0
  2080. }
  2081. }
  2082. class Pc {
  2083. constructor(e) {
  2084. this._code = e, this._achievements = []
  2085. }
  2086. getProgress() {
  2087. return ms.getAchievementCategoryProgress(this)
  2088. }
  2089. getMaxProgress() {
  2090. return ms.getAchievementCategoryMaxProgress(this)
  2091. }
  2092. get code() {
  2093. return this._code
  2094. }
  2095. get achievements() {
  2096. return this._achievements
  2097. }
  2098. set achievements(e) {
  2099. this._achievements = e
  2100. }
  2101. }
  2102. class Ms {}
  2103. Ms.ACTION_SAVE = "AEA_ACTION_SAVE";
  2104. Ms.ACTION_CLEAR = "AEA_ACTION_CLEAR";
  2105. Ms.ACTION_RESET = "AEA_ACTION_RESET";
  2106. Ms.ACTION_RANDOMIZE = "AEA_ACTION_RANDOMIZE";
  2107. class yy {
  2108. constructor(e, s = !1) {
  2109. this._partColor = e, this._isDisabled = s, this._isHC = this._partColor.clubLevel > 0, this._isSelected = !1
  2110. }
  2111. dispose() {
  2112. this._partColor = null
  2113. }
  2114. get partColor() {
  2115. return this._partColor
  2116. }
  2117. get color() {
  2118. return Qs.int2rgb(this._partColor.rgb)
  2119. }
  2120. get isDisabled() {
  2121. return this._isDisabled
  2122. }
  2123. get isHC() {
  2124. return this._isHC
  2125. }
  2126. get isSelected() {
  2127. return this._isSelected
  2128. }
  2129. set isSelected(e) {
  2130. this._isSelected = e, this.notify && this.notify()
  2131. }
  2132. get notify() {
  2133. return this._notifier
  2134. }
  2135. set notify(e) {
  2136. this._notifier = e
  2137. }
  2138. }
  2139. class ql {
  2140. constructor(e, s, n) {
  2141. this._selectedPartIndex = -1, this._name = e, this._parts = s, this._palettes = n, this._selectedPartIndex = -1
  2142. }
  2143. static defaultColorId(e, s) {
  2144. if (!e || !e.length) return -1;
  2145. let n = 0;
  2146. for (; n < e.length;) {
  2147. const r = e[n];
  2148. if (r.partColor && r.partColor.clubLevel <= s) return r.partColor.id;
  2149. n++
  2150. }
  2151. return -1
  2152. }
  2153. init() {
  2154. for (const e of this._parts) e && e.init()
  2155. }
  2156. dispose() {
  2157. if (this._parts) {
  2158. for (const e of this._parts) e.dispose();
  2159. this._parts = null
  2160. }
  2161. if (this._palettes) {
  2162. for (const e of this._palettes)
  2163. for (const s of e) s.dispose();
  2164. this._palettes = null
  2165. }
  2166. this._selectedPartIndex = -1, this._paletteIndexes = null
  2167. }
  2168. selectPartId(e) {
  2169. if (!this._parts) return;
  2170. let s = 0;
  2171. for (; s < this._parts.length;) {
  2172. if (this._parts[s].id === e) {
  2173. this.selectPartIndex(s);
  2174. return
  2175. }
  2176. s++
  2177. }
  2178. }
  2179. selectColorIds(e) {
  2180. if (!e || !this._palettes) return;
  2181. this._paletteIndexes = new Array(e.length);
  2182. let s = 0;
  2183. for (; s < this._palettes.length;) {
  2184. const n = this.getPalette(s);
  2185. if (n) {
  2186. let r = 0;
  2187. if (e.length > s) r = e[s];
  2188. else {
  2189. const l = n[0];
  2190. l && l.partColor && (r = l.partColor.id)
  2191. }
  2192. let o = 0;
  2193. for (; o < n.length;) {
  2194. const l = n[o];
  2195. l.partColor.id === r ? (this._paletteIndexes[s] = o, l.isSelected = !0) : l.isSelected = !1, o++
  2196. }
  2197. }
  2198. s++
  2199. }
  2200. this.updatePartColors()
  2201. }
  2202. selectPartIndex(e) {
  2203. if (!this._parts) return null;
  2204. if (this._selectedPartIndex >= 0 && this._parts.length > this._selectedPartIndex) {
  2205. const s = this._parts[this._selectedPartIndex];
  2206. s && (s.isSelected = !1)
  2207. }
  2208. if (this._parts.length > e) {
  2209. const s = this._parts[e];
  2210. if (s) return s.isSelected = !0, this._selectedPartIndex = e, s
  2211. }
  2212. return null
  2213. }
  2214. selectColorIndex(e, s) {
  2215. const n = this.getPalette(s);
  2216. if (!n || n.length <= e) return null;
  2217. this.deselectColorIndex(this._paletteIndexes[s], s), this._paletteIndexes[s] = e;
  2218. const r = n[e];
  2219. return r ? (r.isSelected = !0, this.updatePartColors(), r) : null
  2220. }
  2221. getCurrentColorIndex(e) {
  2222. return this._paletteIndexes[e]
  2223. }
  2224. deselectColorIndex(e, s) {
  2225. const n = this.getPalette(s);
  2226. if (!n || n.length <= e) return;
  2227. const r = n[e];
  2228. r && (r.isSelected = !1)
  2229. }
  2230. getSelectedColorIds() {
  2231. if (!this._paletteIndexes || !this._paletteIndexes.length || !this._palettes || !this._palettes.length) return null;
  2232. const e = this._palettes[0];
  2233. if (!e || !e.length) return null;
  2234. const s = e[0];
  2235. if (!s || !s.partColor) return null;
  2236. const n = s.partColor.id,
  2237. r = [];
  2238. let o = 0;
  2239. for (; o < this._paletteIndexes.length;) {
  2240. const c = this._palettes[o];
  2241. if (!(!c || c.length <= o))
  2242. if (c.length > this._paletteIndexes[o]) {
  2243. const u = c[this._paletteIndexes[o]];
  2244. u && u.partColor ? r.push(u.partColor.id) : r.push(n)
  2245. } else r.push(n);
  2246. o++
  2247. }
  2248. const l = this.getCurrentPart();
  2249. return l ? r.slice(0, Math.max(l.maxColorIndex, 1)) : null
  2250. }
  2251. getSelectedColors() {
  2252. const e = [];
  2253. let s = 0;
  2254. for (; s < this._paletteIndexes.length;) {
  2255. const n = this.getSelectedColor(s);
  2256. n ? e.push(n.partColor) : e.push(null), s++
  2257. }
  2258. return e
  2259. }
  2260. getSelectedColor(e) {
  2261. const s = this.getPalette(e);
  2262. return !s || s.length <= this._paletteIndexes[e] ? null : s[this._paletteIndexes[e]]
  2263. }
  2264. getSelectedColorId(e) {
  2265. const s = this.getSelectedColor(e);
  2266. return s && s.partColor ? s.partColor.id : 0
  2267. }
  2268. getPalette(e) {
  2269. return !this._paletteIndexes || !this._palettes || this._palettes.length <= e ? null : this._palettes[e]
  2270. }
  2271. getCurrentPart() {
  2272. return this._parts[this._selectedPartIndex]
  2273. }
  2274. updatePartColors() {
  2275. const e = this.getSelectedColors();
  2276. for (const s of this._parts) s && (s.partColors = e)
  2277. }
  2278. hasClubSelectionsOverLevel(e) {
  2279. let s = !1;
  2280. const n = this.getSelectedColors();
  2281. if (n) {
  2282. let o = 0;
  2283. for (; o < n.length;) {
  2284. const l = n[o];
  2285. l && l.clubLevel > e && (s = !0), o++
  2286. }
  2287. }
  2288. const r = this.getCurrentPart();
  2289. if (r && r.partSet) {
  2290. const o = r.partSet;
  2291. o && o.clubLevel > e && (s = !0)
  2292. }
  2293. return s
  2294. }
  2295. hasInvalidSelectedItems(e) {
  2296. const s = this.getCurrentPart();
  2297. if (!s) return !1;
  2298. const n = s.partSet;
  2299. if (!(!n || !n.isSellable)) return e.indexOf(n.id) > -1
  2300. }
  2301. stripClubItemsOverLevel(e) {
  2302. const s = this.getCurrentPart();
  2303. if (s && s.partSet && s.partSet.clubLevel > e) {
  2304. const r = this.selectPartIndex(0);
  2305. return r && !r.partSet && this.selectPartIndex(1), !0
  2306. }
  2307. return !1
  2308. }
  2309. stripClubColorsOverLevel(e) {
  2310. const s = [],
  2311. n = this.getSelectedColors(),
  2312. r = this.getPalette(0);
  2313. let o = !1;
  2314. const l = ql.defaultColorId(r, e);
  2315. if (l === -1) return !1;
  2316. let c = 0;
  2317. for (; c < n.length;) {
  2318. const u = n[c];
  2319. u ? u.clubLevel > e ? (s.push(l), o = !0) : s.push(u.id) : (s.push(l), o = !0), c++
  2320. }
  2321. return o && this.selectColorIds(s), o
  2322. }
  2323. get name() {
  2324. return this._name
  2325. }
  2326. get parts() {
  2327. return this._parts
  2328. }
  2329. get selectedPartIndex() {
  2330. return this._selectedPartIndex
  2331. }
  2332. }
  2333. class Rt {
  2334. static getGender(e) {
  2335. switch (e) {
  2336. case ge.MALE:
  2337. case "m":
  2338. case "M":
  2339. e = ge.MALE;
  2340. break;
  2341. case ge.FEMALE:
  2342. case "f":
  2343. case "F":
  2344. e = ge.FEMALE;
  2345. break;
  2346. default:
  2347. e = ge.MALE
  2348. }
  2349. return e
  2350. }
  2351. static hasFigureSetId(e) {
  2352. return this.FIGURE_SET_IDS.indexOf(e) >= 0
  2353. }
  2354. static createCategory(e, s) {
  2355. if (!e || !s || !this.CURRENT_FIGURE) return null;
  2356. const n = [],
  2357. r = [];
  2358. let o = 0;
  2359. for (; o < this.MAX_PALETTES;) r.push([]), o++;
  2360. const l = Mc(s);
  2361. if (!l) return null;
  2362. const c = kc(l.paletteID);
  2363. if (!c) return null;
  2364. let u = this.CURRENT_FIGURE.getColorIds(s);
  2365. u || (u = []);
  2366. const h = new Array(u.length),
  2367. m = this.clubItemsDimmed,
  2368. p = gs();
  2369. for (const S of c.colors.getValues())
  2370. if (S.isSelectable && (m || p >= S.clubLevel)) {
  2371. let T = 0;
  2372. for (; T < this.MAX_PALETTES;) {
  2373. const b = p < S.clubLevel,
  2374. y = new yy(S, b);
  2375. r[T].push(y), T++
  2376. }
  2377. if (s !== ge.FACE) {
  2378. let b = 0;
  2379. for (; b < u.length;) S.id === u[b] && (h[b] = S), b++
  2380. }
  2381. }
  2382. let E = [];
  2383. if (m ? E = Mt().getMandatoryAvatarPartSetIds(this.CURRENT_FIGURE.gender, 2) : E = Mt().getMandatoryAvatarPartSetIds(this.CURRENT_FIGURE.gender, p), E.indexOf(s) === -1) {
  2384. const S = new Co(null, null, !1);
  2385. S.isClear = !0, n.push(S)
  2386. }
  2387. const I = s !== ge.FACE,
  2388. C = l.partSets;
  2389. for (o = C.length - 1; o >= 0;) {
  2390. const S = C.getWithIndex(o);
  2391. let T = !1;
  2392. if ((S.gender === ge.UNISEX || S.gender === this.CURRENT_FIGURE.gender) && (T = !0), S.isSelectable && T && (m || p >= S.clubLevel)) {
  2393. const b = p < S.clubLevel;
  2394. let y = !0;
  2395. S.isSellable && (y = this.hasFigureSetId(S.id)), y && n.push(new Co(S, h, I, b))
  2396. }
  2397. o--
  2398. }
  2399. for (n.sort(this.clubItemsFirst ? this.clubSorter : this.noobSorter), o = 0; o < this.MAX_PALETTES;) r[o].sort(this.colorSorter), o++;
  2400. return new ql(s, n, r)
  2401. }
  2402. static clubSorter(e, s) {
  2403. const n = e.partSet ? e.partSet.clubLevel : 9999999999,
  2404. r = s.partSet ? s.partSet.clubLevel : 9999999999,
  2405. o = e.partSet ? e.partSet.isSellable : !1,
  2406. l = s.partSet ? s.partSet.isSellable : !1;
  2407. return o && !l ? 1 : l && !o || n > r ? -1 : n < r ? 1 : e.partSet.id > s.partSet.id ? -1 : e.partSet.id < s.partSet.id ? 1 : 0
  2408. }
  2409. static colorSorter(e, s) {
  2410. const n = e.partColor ? e.partColor.clubLevel : -1,
  2411. r = s.partColor ? s.partColor.clubLevel : -1;
  2412. return n < r ? -1 : n > r ? 1 : e.partColor.index < s.partColor.index ? -1 : e.partColor.index > s.partColor.index ? 1 : 0
  2413. }
  2414. static noobSorter(e, s) {
  2415. const n = e.partSet ? e.partSet.clubLevel : -1,
  2416. r = s.partSet ? s.partSet.clubLevel : -1,
  2417. o = e.partSet ? e.partSet.isSellable : !1,
  2418. l = s.partSet ? s.partSet.isSellable : !1;
  2419. return o && !l ? 1 : l && !o || n < r ? -1 : n > r ? 1 : e.partSet.id < s.partSet.id ? -1 : e.partSet.id > s.partSet.id ? 1 : 0
  2420. }
  2421. static avatarSetFirstSelectableColor(e) {
  2422. const s = Mc(e);
  2423. if (!s) return -1;
  2424. const n = kc(s.paletteID);
  2425. if (!n) return -1;
  2426. for (const r of n.colors.getValues())
  2427. if (!(!r.isSelectable || gs() < r.clubLevel)) return r.id;
  2428. return -1
  2429. }
  2430. static get clubItemsFirst() {
  2431. return ee("avatareditor.show.clubitems.first", !0)
  2432. }
  2433. static get clubItemsDimmed() {
  2434. return ee("avatareditor.show.clubitems.dimmed", !0)
  2435. }
  2436. }
  2437. Rt.MAX_PALETTES = 2;
  2438. Rt.CURRENT_FIGURE = null;
  2439. Rt.FIGURE_SET_IDS = [];
  2440. Rt.BOUND_FURNITURE_NAMES = [];
  2441. const Me = class {
  2442. constructor() {
  2443. this._gender = "M", this._direction = Me.DEFAULT_DIRECTION, this._avatarEffectType = -1, this._notifier = null
  2444. }
  2445. loadAvatarData(i, e) {
  2446. this._data = new Map, this._colors = new Map, this._gender = e, this.parseFigureString(i), this.updateView()
  2447. }
  2448. parseFigureString(i) {
  2449. if (!i) return;
  2450. const e = i.split(".");
  2451. if (!(!e || !e.length))
  2452. for (const s of e) {
  2453. const n = s.split("-");
  2454. if (!n.length) continue;
  2455. const r = n[0],
  2456. o = parseInt(n[1]),
  2457. l = [];
  2458. let c = 2;
  2459. for (; c < n.length;) l.push(parseInt(n[c])), c++;
  2460. l.length || l.push(0), this.savePartSetId(r, o, !1), this.savePartSetColourId(r, l, !1)
  2461. }
  2462. }
  2463. getPartSetId(i) {
  2464. const e = this._data.get(i);
  2465. return e !== void 0 ? e : -1
  2466. }
  2467. getColorIds(i) {
  2468. const e = this._colors.get(i);
  2469. return e !== void 0 ? e : [Rt.avatarSetFirstSelectableColor(i)]
  2470. }
  2471. getFigureString() {
  2472. let i = "";
  2473. const e = [];
  2474. for (const [n, r] of this._data.entries()) {
  2475. const o = this._colors.get(n);
  2476. let l = n + "-" + r;
  2477. if (o && o.length) {
  2478. let c = 0;
  2479. for (; c < o.length;) l = l + ("-" + o[c]), c++
  2480. }
  2481. e.push(l)
  2482. }
  2483. let s = 0;
  2484. for (; s < e.length;) i = i + e[s], s < e.length - 1 && (i = i + "."), s++;
  2485. return i
  2486. }
  2487. savePartData(i, e, s, n = !1) {
  2488. this.savePartSetId(i, e, n), this.savePartSetColourId(i, s, n)
  2489. }
  2490. savePartSetId(i, e, s = !0) {
  2491. switch (i) {
  2492. case Me.FACE:
  2493. case Me.HAIR:
  2494. case Me.HAT:
  2495. case Me.HEAD_ACCESSORIES:
  2496. case Me.EYE_ACCESSORIES:
  2497. case Me.FACE_ACCESSORIES:
  2498. case Me.SHIRT:
  2499. case Me.JACKET:
  2500. case Me.CHEST_ACCESSORIES:
  2501. case Me.CHEST_PRINTS:
  2502. case Me.TROUSERS:
  2503. case Me.SHOES:
  2504. case Me.TROUSER_ACCESSORIES:
  2505. e >= 0 ? this._data.set(i, e) : this._data.delete(i);
  2506. break
  2507. }
  2508. s && this.updateView()
  2509. }
  2510. savePartSetColourId(i, e, s = !0) {
  2511. switch (i) {
  2512. case Me.FACE:
  2513. case Me.HAIR:
  2514. case Me.HAT:
  2515. case Me.HEAD_ACCESSORIES:
  2516. case Me.EYE_ACCESSORIES:
  2517. case Me.FACE_ACCESSORIES:
  2518. case Me.SHIRT:
  2519. case Me.JACKET:
  2520. case Me.CHEST_ACCESSORIES:
  2521. case Me.CHEST_PRINTS:
  2522. case Me.TROUSERS:
  2523. case Me.SHOES:
  2524. case Me.TROUSER_ACCESSORIES:
  2525. this._colors.set(i, e);
  2526. break
  2527. }
  2528. s && this.updateView()
  2529. }
  2530. getFigureStringWithFace(i, e = !0) {
  2531. let s = "";
  2532. const n = [Me.FACE],
  2533. r = [];
  2534. for (const l of n) {
  2535. const c = this._colors.get(l);
  2536. if (!c) continue;
  2537. let u = this._data.get(l);
  2538. l === Me.FACE && e && (u = i);
  2539. let h = l + "-" + u;
  2540. if (u >= 0) {
  2541. let m = 0;
  2542. for (; m < c.length;) h = h + ("-" + c[m]), m++
  2543. }
  2544. r.push(h)
  2545. }
  2546. let o = 0;
  2547. for (; o < r.length;) s = s + r[o], o < r.length - 1 && (s = s + "."), o++;
  2548. return s
  2549. }
  2550. updateView() {
  2551. this.notify && this.notify()
  2552. }
  2553. get gender() {
  2554. return this._gender
  2555. }
  2556. get direction() {
  2557. return this._direction
  2558. }
  2559. set direction(i) {
  2560. this._direction = i, this.updateView()
  2561. }
  2562. set avatarEffectType(i) {
  2563. this._avatarEffectType = i
  2564. }
  2565. get avatarEffectType() {
  2566. return this._avatarEffectType
  2567. }
  2568. get notify() {
  2569. return this._notifier
  2570. }
  2571. set notify(i) {
  2572. this._notifier = i
  2573. }
  2574. };
  2575. let ge = Me;
  2576. ge.DEFAULT_DIRECTION = 4;
  2577. ge.MALE = "M";
  2578. ge.FEMALE = "F";
  2579. ge.UNISEX = "U";
  2580. ge.SCALE = "h";
  2581. ge.STD = "std";
  2582. ge.DEFAULT_FRAME = "0";
  2583. ge.FACE = "hd";
  2584. ge.HAIR = "hr";
  2585. ge.HAT = "ha";
  2586. ge.HEAD_ACCESSORIES = "he";
  2587. ge.EYE_ACCESSORIES = "ea";
  2588. ge.FACE_ACCESSORIES = "fa";
  2589. ge.JACKET = "cc";
  2590. ge.SHIRT = "ch";
  2591. ge.CHEST_ACCESSORIES = "ca";
  2592. ge.CHEST_PRINTS = "cp";
  2593. ge.TROUSERS = "lg";
  2594. ge.SHOES = "sh";
  2595. ge.TROUSER_ACCESSORIES = "wa";
  2596. ge.SET_TYPES = [Me.FACE, Me.HAIR, Me.HAT, Me.HEAD_ACCESSORIES, Me.EYE_ACCESSORIES, Me.FACE_ACCESSORIES, Me.JACKET, Me.SHIRT, Me.CHEST_ACCESSORIES, Me.CHEST_PRINTS, Me.TROUSERS, Me.SHOES, Me.TROUSERS];
  2597. const Cr = class {
  2598. constructor(i, e, s = !0, n = !1) {
  2599. if (this._renderManager = Mt(), this._partSet = i, this._partColors = e, this._useColors = s, this._isDisabled = n, this._thumbContainer = null, this._imageUrl = null, this._maxColorIndex = 0, this._isValidFigure = !1, this._isHC = !1, this._isSellable = !1, this._isClear = !1, this._isSelected = !1, this._disposed = !1, this._isInitalized = !1, i) {
  2600. const r = i.parts;
  2601. for (const o of r) this._maxColorIndex = Math.max(this._maxColorIndex, o.colorLayerIndex)
  2602. }
  2603. }
  2604. init() {
  2605. this._isInitalized || (this._isInitalized = !0, this.update())
  2606. }
  2607. dispose() {
  2608. this._disposed || (this._renderManager = null, this._partSet = null, this._partColors = null, this._imageUrl = null, this._disposed = !0, this._isInitalized = !1, this._thumbContainer && (this._thumbContainer.destroy(), this._thumbContainer = null))
  2609. }
  2610. update() {
  2611. this.updateThumbVisualization()
  2612. }
  2613. analyzeFigure() {
  2614. if (!this._renderManager || !this._partSet || !this._partSet.parts || !this._partSet.parts.length) return !1;
  2615. const i = this._renderManager.createFigureContainer(this.partSet.type + "-" + this.partSet.id);
  2616. return this._renderManager.isFigureContainerReady(i) ? (this._isValidFigure = !0, !0) : (this._renderManager.downloadAvatarFigure(i, this), !1)
  2617. }
  2618. renderThumb() {
  2619. if (!this._renderManager || !this._partSet || !this._isValidFigure && !this.analyzeFigure()) return null;
  2620. const i = this._partSet.parts.concat().sort(this.sortByDrawOrder),
  2621. e = new jI;
  2622. for (const s of i) {
  2623. if (!s) continue;
  2624. let n = null,
  2625. r = 0,
  2626. o = !1;
  2627. for (; !o && r < Cr.THUMB_DIRECTIONS.length;) {
  2628. const m = ge.SCALE + "_" + ge.STD + "_" + s.type + "_" + s.id + "_" + Cr.THUMB_DIRECTIONS[r] + "_" + ge.DEFAULT_FRAME;
  2629. n = this._renderManager.getAssetByName(m), n && n.texture ? o = !0 : r++
  2630. }
  2631. if (!o) continue;
  2632. const l = n.offsetX,
  2633. c = n.offsetY;
  2634. let u = null;
  2635. if (this._useColors && s.colorLayerIndex > 0) {
  2636. const m = this._partColors[s.colorLayerIndex - 1];
  2637. m && (u = m)
  2638. }
  2639. const h = new pi(n.texture);
  2640. h.position.set(l, c), u && (h.tint = u.rgb), e.addChild(h)
  2641. }
  2642. return e
  2643. }
  2644. updateThumbVisualization() {
  2645. if (!this._isInitalized) return;
  2646. let i = this._thumbContainer;
  2647. i || (i = this.renderThumb()), i && (this._partSet ? (this._isHC = this._partSet.clubLevel > 0, this._isSellable = this._partSet.isSellable) : (this._isHC = !1, this._isSellable = !1), this._isDisabled && this.setAlpha(i, .2), this._imageUrl = ln.generateImageUrl(i), this.notify && this.notify())
  2648. }
  2649. setAlpha(i, e) {
  2650. return i.filters = [Cr.ALPHA_FILTER], i
  2651. }
  2652. sortByDrawOrder(i, e) {
  2653. const s = Cr.DRAW_ORDER.indexOf(i.type),
  2654. n = Cr.DRAW_ORDER.indexOf(e.type);
  2655. return s < n ? -1 : s > n ? 1 : i.index < e.index ? -1 : i.index > e.index ? 1 : 0
  2656. }
  2657. resetFigure(i) {
  2658. this.analyzeFigure() && this.update()
  2659. }
  2660. get disposed() {
  2661. return this._disposed
  2662. }
  2663. get id() {
  2664. return this._partSet ? this._partSet.id : -1
  2665. }
  2666. get partSet() {
  2667. return this._partSet
  2668. }
  2669. set partColors(i) {
  2670. this._partColors = i, this.update()
  2671. }
  2672. get isDisabled() {
  2673. return this._isDisabled
  2674. }
  2675. set thumbContainer(i) {
  2676. this._thumbContainer = i, this.update()
  2677. }
  2678. get imageUrl() {
  2679. return this._imageUrl
  2680. }
  2681. get maxColorIndex() {
  2682. return this._maxColorIndex
  2683. }
  2684. get isHC() {
  2685. return this._isHC
  2686. }
  2687. get isSellable() {
  2688. return this._isSellable
  2689. }
  2690. get isClear() {
  2691. return this._isClear
  2692. }
  2693. set isClear(i) {
  2694. this._isClear = i
  2695. }
  2696. get isSelected() {
  2697. return this._isSelected
  2698. }
  2699. set isSelected(i) {
  2700. this._isSelected = i, this.notify && this.notify()
  2701. }
  2702. get notify() {
  2703. return this._notifier
  2704. }
  2705. set notify(i) {
  2706. this._notifier = i
  2707. }
  2708. };
  2709. let Co = Cr;
  2710. Co.ALPHA_FILTER = new WI(.2);
  2711. Co.THUMB_DIRECTIONS = [2, 6, 0, 4, 3, 1];
  2712. Co.DRAW_ORDER = [st.LEFT_HAND_ITEM, st.LEFT_HAND, st.LEFT_SLEEVE, st.LEFT_COAT_SLEEVE, st.BODY, st.SHOES, st.LEGS, st.CHEST, st.CHEST_ACCESSORY, st.COAT_CHEST, st.CHEST_PRINT, st.WAIST_ACCESSORY, st.RIGHT_HAND, st.RIGHT_SLEEVE, st.RIGHT_COAT_SLEEVE, st.HEAD, st.FACE, st.EYES, st.HAIR, st.HAIR_BIG, st.FACE_ACCESSORY, st.EYE_ACCESSORY, st.HEAD_ACCESSORY, st.HEAD_ACCESSORY_EXTRA, st.RIGHT_HAND_ITEM];
  2713. class Di {
  2714. constructor() {
  2715. this._isInitalized = !1, this._maxPaletteCount = 0
  2716. }
  2717. dispose() {
  2718. this._categories = null, this._disposed = !0
  2719. }
  2720. get disposed() {
  2721. return this._disposed
  2722. }
  2723. init() {
  2724. this._categories || (this._categories = new Map)
  2725. }
  2726. reset() {
  2727. if (this._isInitalized = !1, this._categories)
  2728. for (const e of this._categories.values()) e && e.dispose();
  2729. this._categories = new Map
  2730. }
  2731. addCategory(e) {
  2732. let s = this._categories.get(e);
  2733. s || (s = Rt.createCategory(this, e), s && (this._categories.set(e, s), this.updateSelectionsFromFigure(e)))
  2734. }
  2735. updateSelectionsFromFigure(e) {
  2736. const s = this._categories.get(e);
  2737. if (!s) return;
  2738. const n = Rt.CURRENT_FIGURE.getPartSetId(e);
  2739. let r = Rt.CURRENT_FIGURE.getColorIds(e);
  2740. r || (r = []), s.selectPartId(n), s.selectColorIds(r)
  2741. }
  2742. hasClubSelectionsOverLevel(e) {
  2743. if (!this._categories) return !1;
  2744. for (const s of this._categories.values())
  2745. if (s && s.hasClubSelectionsOverLevel(e)) return !0;
  2746. return !1
  2747. }
  2748. hasInvalidSelectedItems(e) {
  2749. if (!this._categories) return !1;
  2750. for (const s of this._categories.values())
  2751. if (s.hasInvalidSelectedItems(e)) return !0;
  2752. return !1
  2753. }
  2754. stripClubItemsOverLevel(e) {
  2755. if (!this._categories) return !1;
  2756. let s = !1;
  2757. for (const [n, r] of this._categories.entries()) {
  2758. let o = !1;
  2759. if (r.stripClubItemsOverLevel(e) && (o = !0), r.stripClubColorsOverLevel(e) && (o = !0), o) {
  2760. const l = r.getCurrentPart();
  2761. l && Rt.CURRENT_FIGURE && Rt.CURRENT_FIGURE.savePartData(n, l.id, r.getSelectedColorIds(), !0), s = !0
  2762. }
  2763. }
  2764. return s
  2765. }
  2766. stripInvalidSellableItems() {
  2767. if (!this._categories) return !1;
  2768. let e = !1;
  2769. for (const [s, n] of this._categories.entries());
  2770. return e
  2771. }
  2772. selectPart(e, s) {
  2773. const n = this._categories.get(e);
  2774. if (!n) return;
  2775. const r = n.selectedPartIndex;
  2776. n.selectPartIndex(s);
  2777. const o = n.getCurrentPart();
  2778. if (o) {
  2779. if (o.isDisabled) {
  2780. n.selectPartIndex(r);
  2781. return
  2782. }
  2783. this._maxPaletteCount = o.maxColorIndex, Rt.CURRENT_FIGURE.savePartData(e, o.id, n.getSelectedColorIds(), !0)
  2784. }
  2785. }
  2786. selectColor(e, s, n) {
  2787. const r = this._categories.get(e);
  2788. if (!r) return;
  2789. const o = r.getCurrentColorIndex(n);
  2790. if (r.selectColorIndex(s, n), r.getSelectedColor(n).isDisabled) {
  2791. r.selectColorIndex(o, n);
  2792. return
  2793. }
  2794. Rt.CURRENT_FIGURE.savePartSetColourId(e, r.getSelectedColorIds(), !0)
  2795. }
  2796. getCategoryData(e) {
  2797. return this._isInitalized || this.init(), this._categories ? this._categories.get(e) : null
  2798. }
  2799. get categories() {
  2800. return this._categories
  2801. }
  2802. get canSetGender() {
  2803. return !1
  2804. }
  2805. get maxPaletteCount() {
  2806. return this._maxPaletteCount || 1
  2807. }
  2808. set maxPaletteCount(e) {
  2809. this._maxPaletteCount = e
  2810. }
  2811. get name() {
  2812. return null
  2813. }
  2814. }
  2815. class Ay extends Di {
  2816. constructor() {
  2817. super(...arguments), this._imageCallBackHandled = !1
  2818. }
  2819. init() {
  2820. super.init(), this.addCategory(ge.FACE), this._isInitalized = !0
  2821. }
  2822. selectColor(e, s, n) {
  2823. super.selectColor(e, s, n), this.updateSelectionsFromFigure(ge.FACE)
  2824. }
  2825. updateSelectionsFromFigure(e) {
  2826. if (!this._categories || !Rt.CURRENT_FIGURE) return;
  2827. const s = this._categories.get(e);
  2828. if (!s) return;
  2829. const n = Rt.CURRENT_FIGURE.getPartSetId(e);
  2830. let r = Rt.CURRENT_FIGURE.getColorIds(e);
  2831. r || (r = []), s.selectPartId(n), s.selectColorIds(r);
  2832. for (const o of s.parts) {
  2833. const l = c => {
  2834. const u = Rt.CURRENT_FIGURE.getFigureStringWithFace(o.id),
  2835. h = Mt().createAvatarImage(u, hl.LARGE, null, {
  2836. resetFigure: l,
  2837. dispose: null,
  2838. disposed: !1
  2839. }),
  2840. m = h.getImageAsSprite(fi.HEAD);
  2841. m && (m.y = 10, o.thumbContainer = m, setTimeout(() => h.dispose(), 0))
  2842. };
  2843. l()
  2844. }
  2845. }
  2846. get canSetGender() {
  2847. return !0
  2848. }
  2849. get name() {
  2850. return Cn.GENERIC
  2851. }
  2852. }
  2853. const ts = i => {
  2854. if (i == null || typeof i != "object") return i;
  2855. const e = new i.constructor;
  2856. for (const s in i) i.hasOwnProperty(s) && (e[s] = i[s]);
  2857. return e
  2858. };
  2859. class bn {
  2860. static makeColorHex(e) {
  2861. return "#" + e
  2862. }
  2863. static makeColorNumberHex(e) {
  2864. let s = e.toString(16);
  2865. if (s.length < 6) {
  2866. const n = 6 - s.length;
  2867. for (let r = 0; r < n; r++) s = "0" + s
  2868. }
  2869. return "#" + s
  2870. }
  2871. static convertFromHex(e) {
  2872. return parseInt(e.replace("#", ""), 16)
  2873. }
  2874. static uintHexColor(e) {
  2875. const s = e >>> 0;
  2876. return bn.makeColorHex(s.toString(16).substring(2))
  2877. }
  2878. }
  2879. const Zn = i => {
  2880. let e = Math.floor(i / 86400),
  2881. s = Math.floor(i % 86400 / 3600),
  2882. n = Math.floor(i % 86400 % 3600 / 60),
  2883. r = i % 86400 % 3600 % 60;
  2884. return e.toString().padStart(2, "0") + ":" + s.toString().padStart(2, "0") + ":" + n.toString().padStart(2, "0") + ":" + r.toString().padStart(2, "0")
  2885. },
  2886. G_ = i => JSON.parse(window.localStorage.getItem(i)) ? ? null,
  2887. Yl = i => {
  2888. let e = _e().localization.getBadgeDesc(i);
  2889. return (!e || !e.length) && (e = `badge_desc_${i}`), e
  2890. },
  2891. yo = i => {
  2892. let e = _e().localization.getBadgeName(i);
  2893. return (!e || !e.length) && (e = `badge_name_${i}`), e
  2894. };
  2895. function Dc(i) {
  2896. if (!i || isNaN(i)) return "0";
  2897. let e = Math.abs(i);
  2898. const s = Math.pow(10, 1),
  2899. n = i < 0;
  2900. let r = "";
  2901. const o = [{
  2902. key: "Q",
  2903. value: Math.pow(10, 15)
  2904. }, {
  2905. key: "T",
  2906. value: Math.pow(10, 12)
  2907. }, {
  2908. key: "B",
  2909. value: Math.pow(10, 9)
  2910. }, {
  2911. key: "M",
  2912. value: Math.pow(10, 6)
  2913. }, {
  2914. key: "K",
  2915. value: 1e3
  2916. }];
  2917. for (const l of o) {
  2918. let c = e / l.value;
  2919. if (c = Math.round(c * s) / s, c >= 1) {
  2920. e = c, r = l.key;
  2921. break
  2922. }
  2923. }
  2924. return (n ? "-" : "") + e + r
  2925. }
  2926. function g(i, e = null, s = null) {
  2927. return _e().getLocalizationWithParameters(i, e, s)
  2928. }
  2929. class Ao {}
  2930. Ao.CATALOG_PLACE_MULTIPLE_OBJECTS = "catalogPlaceMultipleObjects";
  2931. Ao.CATALOG_SKIP_PURCHASE_CONFIRMATION = "catalogSkipPurchaseConfirmation";
  2932. const B_ = (i, e) => i.dispatchEvent(e),
  2933. sl = i => B_(_e().events, i),
  2934. cn = new qI,
  2935. At = i => B_(cn, i);
  2936. let H_ = !1;
  2937. const Fs = i => {
  2938. H_ && sl(new Ic(Ic.PLAY_SOUND, i))
  2939. },
  2940. Fc = [xe.MOUSE_CLICK],
  2941. ky = () => {
  2942. const i = () => Fc.forEach(s => window.removeEventListener(s, e)),
  2943. e = s => (H_ = !0) && i();
  2944. Fc.forEach(s => window.addEventListener(s, e))
  2945. };
  2946. ky();
  2947. class ae {}
  2948. ae.DEFAULT = 1;
  2949. ae.WALL_PAPER = 2;
  2950. ae.FLOOR = 3;
  2951. ae.LANDSCAPE = 4;
  2952. ae.POST_IT = 5;
  2953. ae.POSTER = 6;
  2954. ae.SOUND_SET = 7;
  2955. ae.TRAX_SONG = 8;
  2956. ae.PRESENT = 9;
  2957. ae.ECOTRON_BOX = 10;
  2958. ae.TROPHY = 11;
  2959. ae.CREDIT_FURNI = 12;
  2960. ae.PET_SHAMPOO = 13;
  2961. ae.PET_CUSTOM_PART = 14;
  2962. ae.PET_CUSTOM_PART_SHAMPOO = 15;
  2963. ae.PET_SADDLE = 16;
  2964. ae.GUILD_FURNI = 17;
  2965. ae.GAME_FURNI = 18;
  2966. ae.MONSTERPLANT_SEED = 19;
  2967. ae.MONSTERPLANT_REVIVAL = 20;
  2968. ae.MONSTERPLANT_REBREED = 21;
  2969. ae.MONSTERPLANT_FERTILIZE = 22;
  2970. ae.FIGURE_PURCHASABLE_SET = 23;
  2971. class So {
  2972. constructor(e) {
  2973. e && (this._locked = !1, this._id = e.itemId, this._type = e.spriteId, this._ref = e.ref, this._category = e.category, this._groupable = e.isGroupable && !e.rentable, this._tradeable = e.tradable, this._recyclable = e.isRecycleable, this._sellable = e.sellable, this._stuffData = e.stuffData, this._extra = e.extra, this._secondsToExpiration = e.secondsToExpiration, this._expirationTimeStamp = e.expirationTimeStamp, this._hasRentPeriodStarted = e.hasRentPeriodStarted, this._creationDay = e.creationDay, this._creationMonth = e.creationMonth, this._creationYear = e.creationYear, this._slotId = e.slotId, this._songId = e.songId, this._flatId = e.flatId, this._isRented = e.rentable, this._isWallItem = e.isWallItem)
  2974. }
  2975. get rentable() {
  2976. return this._isRented
  2977. }
  2978. get id() {
  2979. return this._id
  2980. }
  2981. get ref() {
  2982. return this._ref
  2983. }
  2984. get category() {
  2985. return this._category
  2986. }
  2987. get type() {
  2988. return this._type
  2989. }
  2990. get stuffData() {
  2991. return this._stuffData
  2992. }
  2993. set stuffData(e) {
  2994. this._stuffData = e
  2995. }
  2996. get extra() {
  2997. return this._extra
  2998. }
  2999. get recyclable() {
  3000. return this._recyclable
  3001. }
  3002. get isTradable() {
  3003. return this._tradeable
  3004. }
  3005. get isGroupable() {
  3006. return this._groupable
  3007. }
  3008. get sellable() {
  3009. return this._sellable
  3010. }
  3011. get secondsToExpiration() {
  3012. if (this._secondsToExpiration === -1) return -1;
  3013. let e = -1;
  3014. return this._hasRentPeriodStarted ? (e = this._secondsToExpiration - (Ws() - this._expirationTimeStamp) / 1e3, e < 0 && (e = 0)) : e = this._secondsToExpiration, e
  3015. }
  3016. get creationDay() {
  3017. return this._creationDay
  3018. }
  3019. get creationMonth() {
  3020. return this._creationMonth
  3021. }
  3022. get creationYear() {
  3023. return this._creationYear
  3024. }
  3025. get slotId() {
  3026. return this._slotId
  3027. }
  3028. get songId() {
  3029. return this._songId
  3030. }
  3031. get locked() {
  3032. return this._locked
  3033. }
  3034. set locked(e) {
  3035. this._locked = e
  3036. }
  3037. get flatId() {
  3038. return this._flatId
  3039. }
  3040. get isWallItem() {
  3041. return this._isWallItem
  3042. }
  3043. get hasRentPeriodStarted() {
  3044. return this._hasRentPeriodStarted
  3045. }
  3046. get expirationTimeStamp() {
  3047. return this._expirationTimeStamp
  3048. }
  3049. update(e) {
  3050. this._type = e.spriteId, this._ref = e.ref, this._category = e.category, this._groupable = e.isGroupable && !e.rentable, this._tradeable = e.tradable, this._recyclable = e.isRecycleable, this._sellable = e.sellable, this._stuffData = e.stuffData, this._extra = e.extra, this._secondsToExpiration = e.secondsToExpiration, this._expirationTimeStamp = e.expirationTimeStamp, this._hasRentPeriodStarted = e.hasRentPeriodStarted, this._creationDay = e.creationDay, this._creationMonth = e.creationMonth, this._creationYear = e.creationYear, this._slotId = e.slotId, this._songId = e.songId, this._flatId = e.flatId, this._isRented = e.rentable, this._isWallItem = e.isWallItem
  3051. }
  3052. clone() {
  3053. const e = new So(null);
  3054. return e._expirationTimeStamp = this._expirationTimeStamp, e._isWallItem = this._isWallItem, e._songId = this._songId, e._locked = this._locked, e._id = this._id, e._ref = this._ref, e._category = this._category, e._type = this._type, e._stuffData = this._stuffData, e._extra = this._extra, e._recyclable = this._recyclable, e._tradeable = this._tradeable, e._groupable = this._groupable, e._sellable = this._sellable, e._secondsToExpiration = this._secondsToExpiration, e._hasRentPeriodStarted = this._hasRentPeriodStarted, e._creationDay = this._creationDay, e._creationMonth = this._creationMonth, e._creationYear = this._creationYear, e._slotId = this._slotId, e._isRented = this._isRented, e._flatId = this._flatId, e
  3055. }
  3056. }
  3057. class zl {
  3058. constructor(e = -1, s = -1, n = null, r = null, o = -1) {
  3059. this._type = e, this._category = s, this._roomEngine = n, this._stuffData = r, this._extra = o, this._isWallItem = !1, this._iconUrl = null, this._name = null, this._description = null, this._locked = !1, this._selected = !1, this._hasUnseenItems = !1, this._items = []
  3060. }
  3061. clone() {
  3062. const e = new zl;
  3063. return e._type = this._type, e._category = this._category, e._roomEngine = this._roomEngine, e._stuffData = this._stuffData, e._extra = this._extra, e._isWallItem = this._isWallItem, e._iconUrl = this._iconUrl, e._name = this._name, e._description = this._description, e._locked = this._locked, e._selected = this._selected, e._hasUnseenItems = this._hasUnseenItems, e._items = this._items, e
  3064. }
  3065. prepareGroup() {
  3066. this.setIcon(), this.setName(), this.setDescription()
  3067. }
  3068. dispose() {}
  3069. getItemByIndex(e) {
  3070. return this._items[e]
  3071. }
  3072. getItemById(e) {
  3073. for (const s of this._items)
  3074. if (s.id === e) return s;
  3075. return null
  3076. }
  3077. getTradeItems(e) {
  3078. const s = [],
  3079. n = this.getLastItem();
  3080. if (!n) return s;
  3081. let r = 0,
  3082. o = 0;
  3083. for (; o < this._items.length && !(r >= e);) {
  3084. const l = this.getItemByIndex(o);
  3085. !l.locked && l.isTradable && l.type === n.type && (s.push(l), r++), o++
  3086. }
  3087. return s
  3088. }
  3089. push(e) {
  3090. const s = [...this._items];
  3091. let n = 0;
  3092. for (; n < s.length;) {
  3093. let r = s[n];
  3094. if (r.id === e.id) {
  3095. r = r.clone(), r.locked = !1, s.splice(n, 1), s.push(r), this._items = s;
  3096. return
  3097. }
  3098. n++
  3099. }
  3100. s.push(e), this._items = s, this._items.length === 1 && this.prepareGroup()
  3101. }
  3102. pop() {
  3103. const e = [...this._items];
  3104. let s = null;
  3105. if (e.length > 0) {
  3106. const n = e.length - 1;
  3107. s = e[n], e.splice(n, 1)
  3108. }
  3109. return this._items = e, s
  3110. }
  3111. remove(e) {
  3112. const s = [...this._items];
  3113. let n = 0;
  3114. for (; n < s.length;) {
  3115. let r = s[n];
  3116. if (r.id === e) return s.splice(n, 1), this._items = s, r;
  3117. n++
  3118. }
  3119. return null
  3120. }
  3121. getTotalCount() {
  3122. if (this._category === ae.POST_IT) {
  3123. let e = 0,
  3124. s = 0;
  3125. for (; s < this._items.length;) {
  3126. const n = this.getItemByIndex(s);
  3127. e = e + parseInt(n.stuffData.getLegacyString()), s++
  3128. }
  3129. return e
  3130. }
  3131. return this._items.length
  3132. }
  3133. getUnlockedCount() {
  3134. if (this.category === ae.POST_IT) return this.getTotalCount();
  3135. let e = 0,
  3136. s = 0;
  3137. for (; s < this._items.length;) this.getItemByIndex(s).locked || e++, s++;
  3138. return e
  3139. }
  3140. getLastItem() {
  3141. return this._items.length ? this.getItemByIndex(this._items.length - 1) : null
  3142. }
  3143. unlockAllItems() {
  3144. const e = [...this._items];
  3145. let s = 0;
  3146. for (; s < e.length;) {
  3147. const n = e[s];
  3148. if (n.locked) {
  3149. const r = n.clone();
  3150. r.locked = !1, e[s] = r
  3151. }
  3152. s++
  3153. }
  3154. this._items = e
  3155. }
  3156. lockItemIds(e) {
  3157. const s = [...this._items];
  3158. let n = 0,
  3159. r = !1;
  3160. for (; n < s.length;) {
  3161. const o = s[n],
  3162. l = e.indexOf(o.ref) >= 0;
  3163. if (o.locked !== l) {
  3164. r = !0;
  3165. const c = o.clone();
  3166. c.locked = l, s[n] = c
  3167. }
  3168. n++
  3169. }
  3170. return this._items = s, r
  3171. }
  3172. setName() {
  3173. const e = this.getLastItem();
  3174. if (!e) {
  3175. this._name = "";
  3176. return
  3177. }
  3178. let s = "";
  3179. switch (this._category) {
  3180. case ae.POSTER:
  3181. s = "poster_" + e.stuffData.getLegacyString() + "_name";
  3182. break;
  3183. case ae.TRAX_SONG:
  3184. this.getSongInfo();
  3185. return;
  3186. default:
  3187. this.isWallItem ? s = "wallItem.name." + e.type : s = "roomItem.name." + e.type
  3188. }
  3189. this._name = g(s)
  3190. }
  3191. setDescription() {
  3192. const e = this.getLastItem();
  3193. if (!e) {
  3194. this._name = "";
  3195. return
  3196. }
  3197. let s = "";
  3198. switch (this._category) {
  3199. case ae.POSTER:
  3200. s = "poster_" + e.stuffData.getLegacyString() + "_name";
  3201. break;
  3202. case ae.TRAX_SONG:
  3203. this.getSongInfo();
  3204. return;
  3205. default:
  3206. this.isWallItem ? s = "wallItem.desc." + e.type : s = "roomItem.desc." + e.type
  3207. }
  3208. this._description = g(s) == s ? "" : g(s)
  3209. }
  3210. setIcon() {
  3211. if (this._iconUrl) return;
  3212. let e = null;
  3213. this.isWallItem ? e = this._roomEngine.getFurnitureWallIconUrl(this._type, this._stuffData.getLegacyString()) : e = this._roomEngine.getFurnitureFloorIconUrl(this._type), e && (this._iconUrl = e)
  3214. }
  3215. getSongInfo() {
  3216. let e = _e().soundManager.musicController.getSongInfo(this._extra);
  3217. this._name = "SONG_NAME";
  3218. const s = n => {
  3219. _e().soundManager.events.removeEventListener(Ga.SIR_TRAX_SONG_INFO_RECEIVED, s), e = _e().soundManager.musicController.getSongInfo(this._extra), e != null && (this._description = e.creator, this._name = e.name)
  3220. };
  3221. e == null ? (_e().soundManager.events.addEventListener(Ga.SIR_TRAX_SONG_INFO_RECEIVED, s.bind(this)), _e().soundManager.musicController.requestSongInfoWithoutSamples(this._extra)) : (this._description = e.creator, this._name = e.name)
  3222. }
  3223. get type() {
  3224. return this._type
  3225. }
  3226. get category() {
  3227. return this._category
  3228. }
  3229. get stuffData() {
  3230. return this._stuffData
  3231. }
  3232. get extra() {
  3233. return this._extra
  3234. }
  3235. get iconUrl() {
  3236. return this._iconUrl
  3237. }
  3238. get name() {
  3239. return this._name
  3240. }
  3241. get description() {
  3242. return this._description
  3243. }
  3244. get hasUnseenItems() {
  3245. return this._hasUnseenItems
  3246. }
  3247. set hasUnseenItems(e) {
  3248. this._hasUnseenItems = e
  3249. }
  3250. get locked() {
  3251. return this._locked
  3252. }
  3253. set locked(e) {
  3254. this._locked = e
  3255. }
  3256. get selected() {
  3257. return this._selected
  3258. }
  3259. set selected(e) {
  3260. this._selected = e
  3261. }
  3262. get isWallItem() {
  3263. const e = this.getItemByIndex(0);
  3264. return e ? e.isWallItem : !1
  3265. }
  3266. get isGroupable() {
  3267. const e = this.getItemByIndex(0);
  3268. return e ? e.isGroupable : !1
  3269. }
  3270. get isSellable() {
  3271. const e = this.getItemByIndex(0);
  3272. return e ? e.sellable : !1
  3273. }
  3274. get isRecycleable() {
  3275. const e = this.getItemByIndex(0);
  3276. return e ? e.recyclable : !1
  3277. }
  3278. get items() {
  3279. return this._items
  3280. }
  3281. set items(e) {
  3282. this._items = e
  3283. }
  3284. }
  3285. const Kl = (i, e, s, n = NaN) => new zl(i, e, X(), s, n),
  3286. My = (i, e, s) => {
  3287. const n = [];
  3288. for (const o of i) o.type === e.type && n.push(o);
  3289. for (const o of n)
  3290. if (o.getItemById(e.id)) return o;
  3291. const r = Kl(e.type, e.category, e.stuffData, e.extra);
  3292. return r.push(e), s ? (r.hasUnseenItems = !0, i.unshift(r)) : i.push(r), r
  3293. },
  3294. Uy = (i, e, s) => {
  3295. let n = null;
  3296. for (const r of i)
  3297. if (r.type === e.type && r.isWallItem === e.isWallItem && r.isGroupable)
  3298. if (e.category === ae.POSTER) {
  3299. if (r.stuffData.getLegacyString() === e.stuffData.getLegacyString()) {
  3300. n = r;
  3301. break
  3302. }
  3303. } else if (e.category === ae.GUILD_FURNI) {
  3304. if (e.stuffData.compare(r.stuffData)) {
  3305. n = r;
  3306. break
  3307. }
  3308. } else {
  3309. n = r;
  3310. break
  3311. }
  3312. if (n) {
  3313. if (n.push(e), s) {
  3314. n.hasUnseenItems = !0;
  3315. const r = i.indexOf(n);
  3316. r >= 0 && i.splice(r, 1), i.unshift(n)
  3317. }
  3318. return n
  3319. }
  3320. return n = Kl(e.type, e.category, e.stuffData, e.extra), n.push(e), s ? (n.hasUnseenItems = !0, i.unshift(n)) : i.push(n), n
  3321. },
  3322. xc = (i, e, s) => {
  3323. e.isGroupable ? Uy(i, e, s) : My(i, e, s)
  3324. },
  3325. Ly = (i, e, s, n) => {
  3326. if (e === 1) return i;
  3327. n[s] = i;
  3328. for (const o of n)
  3329. if (!o) return null;
  3330. const r = new Map;
  3331. for (const o of n) {
  3332. for (const [l, c] of o) r.set(l, c);
  3333. o.clear()
  3334. }
  3335. return n = null, r
  3336. },
  3337. Py = i => {
  3338. const e = [];
  3339. for (const s of i) {
  3340. let n = s.getTotalCount();
  3341. s.category === ae.POST_IT && (n = 1);
  3342. let r = 0;
  3343. for (; r < n;) e.push(s.getItemByIndex(r).id), r++
  3344. }
  3345. return e
  3346. };
  3347. let V_ = !1,
  3348. W_ = -1;
  3349. const Dy = () => V_,
  3350. ko = i => V_ = i,
  3351. Pr = () => W_,
  3352. Fi = i => W_ = i,
  3353. To = () => {
  3354. Pr() !== -1 && (X().cancelRoomObjectPlacement(), Fi(-1), ko(!1))
  3355. },
  3356. nl = (i, e = !1) => {
  3357. const s = i.petData;
  3358. if (!s) return !1;
  3359. const n = ur().getSession(1);
  3360. return !n || !n.isRoomOwner && !n.allowPets ? !1 : (oe("inventory/hide"), X().processRoomObjectPlacement(go.INVENTORY, -s.id, re.UNIT, vt.PET, s.figureData.figuredata) && (Fi(s.id), ko(!0)), !0)
  3361. },
  3362. Dr = (i, e = !1) => {
  3363. if (!i || !i.getUnlockedCount()) return !1;
  3364. const s = i.getLastItem();
  3365. if (!s) return !1;
  3366. if (s.category === ae.FLOOR || s.category === ae.WALL_PAPER || s.category === ae.LANDSCAPE) return e || B(new ao(s.id)), !1; {
  3367. oe("inventory/hide");
  3368. let n = 0,
  3369. r = !1;
  3370. s.isWallItem ? n = re.WALL : n = re.FLOOR, s.category === ae.POSTER ? r = X().processRoomObjectPlacement(go.INVENTORY, s.id, n, s.type, s.stuffData.getLegacyString()) : r = X().processRoomObjectPlacement(go.INVENTORY, s.id, n, s.type, s.extra.toString(), s.stuffData), r && (Fi(s.ref), ko(!0))
  3371. }
  3372. return !0
  3373. },
  3374. rl = (i, e = !1) => {
  3375. const s = i.botData;
  3376. if (!s) return !1;
  3377. const n = ur().getSession(1);
  3378. return !n || !n.isRoomOwner ? !1 : (oe("inventory/hide"), X().processRoomObjectPlacement(go.INVENTORY, -s.id, re.UNIT, vt.RENTABLE_BOT, s.figure) && (Fi(s.id), ko(!0)), !0)
  3379. };
  3380. class nt {}
  3381. nt.FURNI = 1;
  3382. nt.RENTABLE = 2;
  3383. nt.PET = 3;
  3384. nt.BADGE = 4;
  3385. nt.BOT = 5;
  3386. nt.GAMES = 6;
  3387. const Fy = i => i.map(e => e.petData.id),
  3388. j_ = (i, e, s = !0) => {
  3389. const n = {
  3390. petData: i
  3391. };
  3392. return s ? e.unshift(n) : e.push(n), n
  3393. },
  3394. q_ = (i, e) => {
  3395. let s = 0;
  3396. for (; s < e.length;) {
  3397. const n = e[s];
  3398. if (n && n.petData.id === i) return Pr() === n.petData.id && (To(), oe("inventory/open")), e.splice(s, 1), n;
  3399. s++
  3400. }
  3401. return null
  3402. },
  3403. xy = (i, e, s) => {
  3404. const n = Fy(i),
  3405. r = [],
  3406. o = [];
  3407. for (const l of e.keys()) n.indexOf(l) === -1 && r.push(l);
  3408. for (const l of n) !e.get(l) && o.push(l);
  3409. n.length;
  3410. for (const l of o) q_(l, i);
  3411. for (const l of r) {
  3412. const c = e.get(l);
  3413. c && j_(c, i, s(nt.PET, c.id))
  3414. }
  3415. return i
  3416. },
  3417. Gy = (i, e, s, n) => {
  3418. if (e === 1) return i;
  3419. n[s] = i;
  3420. for (const o of n)
  3421. if (!o) return null;
  3422. const r = new Map;
  3423. for (const o of n) {
  3424. for (const [l, c] of o) r.set(l, c);
  3425. o.clear()
  3426. }
  3427. return n = null, r
  3428. };
  3429. class gt {}
  3430. gt.TRADING_STATE_READY = 0;
  3431. gt.TRADING_STATE_RUNNING = 1;
  3432. gt.TRADING_STATE_COUNTDOWN = 2;
  3433. gt.TRADING_STATE_CONFIRMING = 3;
  3434. gt.TRADING_STATE_CONFIRMED = 4;
  3435. gt.TRADING_STATE_COMPLETED = 5;
  3436. gt.TRADING_STATE_CANCELLED = 6;
  3437. class Gc {
  3438. constructor(e = -1, s = "", n = new po, r = 0, o = 0, l = !1, c = !1) {
  3439. this.userId = e, this.userName = s, this.userItems = n, this.itemCount = r, this.creditsCount = o, this.accepts = l, this.canTrade = c
  3440. }
  3441. }
  3442. class yt {}
  3443. yt.ALERT_SCAM = 0;
  3444. yt.HOTEL_TRADING_DISABLED = 1;
  3445. yt.YOU_NOT_ALLOWED = 2;
  3446. yt.THEY_NOT_ALLOWED = 4;
  3447. yt.ROOM_DISABLED = 6;
  3448. yt.YOU_OPEN = 7;
  3449. yt.THEY_OPEN = 8;
  3450. yt.ERROR_WHILE_COMMIT = 9;
  3451. yt.THEY_CANCELLED = 10;
  3452. const Bc = i => {
  3453. var e;
  3454. return ((e = J().getWallItemData(i)) == null ? void 0 : e.isExternalImage) || !1
  3455. },
  3456. Hc = i => {
  3457. const e = new po;
  3458. if (i.length)
  3459. for (const n of i) {
  3460. const r = n.spriteId,
  3461. o = n.category;
  3462. let l = n.furniType + r;
  3463. (!n.isGroupable || Bc(r)) && (l = "itemid" + n.itemId), n.category === ae.POSTER ? l = n.itemId + "poster" + n.stuffData.getLegacyString() : n.category === ae.GUILD_FURNI && (l = "");
  3464. let c = n.isGroupable && !Bc(n.spriteId) ? e.getValue(l) : null;
  3465. c || (c = Kl(r, o, n.stuffData), e.add(l, c)), c.push(new So(n))
  3466. }
  3467. return e
  3468. },
  3469. By = (i, e) => {
  3470. let s = i.toString();
  3471. if (!(e instanceof Oo)) return s;
  3472. let n = 1;
  3473. for (; n < 5;) s = s + ("," + e.getValue(n)), n++;
  3474. return s
  3475. };
  3476. class hi {
  3477. static getProductImageUrl(e, s, n) {
  3478. let r = null;
  3479. switch (e) {
  3480. case so.S:
  3481. r = X().getFurnitureFloorIconUrl(s);
  3482. break;
  3483. case so.I:
  3484. this.getProductCategory(so.I, s) === 1 && (r = X().getFurnitureWallIconUrl(s, n));
  3485. break
  3486. }
  3487. return r
  3488. }
  3489. static getProductCategory(e, s) {
  3490. if (e === so.S) return 1;
  3491. if (e === so.I) {
  3492. if (s === 3001) return ae.WALL_PAPER;
  3493. if (s === 3002) return ae.FLOOR;
  3494. if (s === 4057) return ae.LANDSCAPE
  3495. }
  3496. return 1
  3497. }
  3498. }
  3499. class Si {
  3500. static getRandomNumber(e) {
  3501. return Math.floor(Math.random() * e)
  3502. }
  3503. static getRandomElement(e) {
  3504. return e[this.getRandomNumber(e.length)]
  3505. }
  3506. static getRandomElements(e, s) {
  3507. const n = new Array(s);
  3508. let r = e.length;
  3509. const o = new Array(r);
  3510. for (; s--;) {
  3511. var l = this.getRandomNumber(r);
  3512. n[s] = e[l in o ? o[l] : l], o[l] = --r in o ? o[r] : r
  3513. }
  3514. return n
  3515. }
  3516. }
  3517. const Ut = new Map;
  3518. Ut.set("r", "red");
  3519. Ut.set("b", "blue");
  3520. Ut.set("g", "green");
  3521. Ut.set("y", "yellow");
  3522. Ut.set("w", "white");
  3523. Ut.set("o", "orange");
  3524. Ut.set("c", "cyan");
  3525. Ut.set("br", "brown");
  3526. Ut.set("pr", "purple");
  3527. Ut.set("pk", "pink");
  3528. Ut.set("red", "red");
  3529. Ut.set("blue", "blue");
  3530. Ut.set("green", "green");
  3531. Ut.set("yellow", "yellow");
  3532. Ut.set("white", "white");
  3533. Ut.set("orange", "orange");
  3534. Ut.set("cyan", "cyan");
  3535. Ut.set("brown", "brown");
  3536. Ut.set("purple", "purple");
  3537. Ut.set("pink", "pink");
  3538. const Hy = i => i.replace(/([\u00A0-\u9999<>&])(.|$)/g, (e, s, n) => s !== "&" || n !== "#" ? (/[\u00A0-\u9999<>&]/.test(n) && (n = "&#" + n.charCodeAt(0) + ";"), "&#" + s.charCodeAt(0) + ";" + n) : e),
  3539. Vy = i => {
  3540. let e = "";
  3541. if (i = Hy(i), i = UI.shortnameToUnicode(i), i.startsWith("@") && i.indexOf("@", 1) > -1) {
  3542. let s = null;
  3543. for (;
  3544. (s = /@[a-zA-Z]+@/g.exec(i)) !== null;) {
  3545. const n = s[0].toString(),
  3546. r = n.substr(1, n.length - 2),
  3547. o = i.replace(n, "");
  3548. Ut.has(r) ? e = '<span style="color: ' + Ut.get(r) + '">' + o + "</span>" : e = o;
  3549. break
  3550. }
  3551. } else e = i;
  3552. return e
  3553. },
  3554. Wy = (i, e) => window.localStorage.setItem(i, JSON.stringify(e));
  3555. class cs {}
  3556. cs.CAMERA_SHUTTER = "camera_shutter";
  3557. cs.CREDITS = "credits";
  3558. cs.DUCKETS = "duckets";
  3559. cs.MESSENGER_NEW_THREAD = "messenger_new_thread";
  3560. cs.MESSENGER_MESSAGE_RECEIVED = "messenger_message_received";
  3561. cs.MODTOOLS_NEW_TICKET = "modtools_new_ticket";
  3562. cs.GAME_CONTDOWN = "countdown";
  3563. function jy(i) {
  3564. const e = i.parts;
  3565. let s = 0;
  3566. for (const n of e) s = Math.max(s, n.colorLayerIndex);
  3567. return s
  3568. }
  3569. function qy(i, e) {
  3570. return e = e.filter(s => i.indexOf(s) === -1), [...i, ...Si.getRandomElements(e, Si.getRandomNumber(e.length) + 1)]
  3571. }
  3572. function Yy(i, e, s = 0, n = []) {
  3573. if (!i) return null;
  3574. const r = i.partSets.getValues().filter(o => !o.isSelectable || o.gender !== "U" && o.gender !== e || o.clubLevel > s || o.isSellable && n.indexOf(o.id) === -1 ? null : o);
  3575. return !r || !r.length ? null : Si.getRandomElement(r)
  3576. }
  3577. function zy(i, e, s = 0) {
  3578. if (!i) return [];
  3579. const n = i.colors.getValues().filter(r => !r.isSelectable || r.clubLevel > s ? null : r);
  3580. return !n || !n.length ? null : Si.getRandomElements(n, jy(e))
  3581. }
  3582. function Ky(i, e, s = 0, n = [], r = []) {
  3583. const o = Mt().structure,
  3584. l = new YI(""),
  3585. c = qy(o.getMandatorySetTypeIds(e, s), ge.SET_TYPES);
  3586. for (const u of r) {
  3587. const h = i.getPartSetId(u),
  3588. m = i.getColorIds(u);
  3589. l.updatePart(u, h, m)
  3590. }
  3591. for (const u of c) {
  3592. if (l.hasPartType(u)) continue;
  3593. const h = o.figureData.getSetType(u),
  3594. m = Yy(h, e, s, n);
  3595. if (!m) continue;
  3596. let p = [];
  3597. m.isColorable && (p = zy(o.figureData.getPalette(h.paletteID), m, s).map(E => E.id)), l.updatePart(h.type, m.id, p)
  3598. }
  3599. return l.getFigureString()
  3600. }
  3601. class $y extends Di {
  3602. init() {
  3603. super.init(), this.addCategory(ge.HAIR), this.addCategory(ge.HAT), this.addCategory(ge.HEAD_ACCESSORIES), this.addCategory(ge.EYE_ACCESSORIES), this.addCategory(ge.FACE_ACCESSORIES), this._isInitalized = !0
  3604. }
  3605. get name() {
  3606. return Cn.HEAD
  3607. }
  3608. }
  3609. class Qy extends Di {
  3610. init() {
  3611. super.init(), this.addCategory(ge.TROUSERS), this.addCategory(ge.SHOES), this.addCategory(ge.TROUSER_ACCESSORIES), this._isInitalized = !0
  3612. }
  3613. get name() {
  3614. return Cn.LEGS
  3615. }
  3616. }
  3617. class Xy extends Di {
  3618. init() {
  3619. super.init(), this.addCategory(ge.SHIRT), this.addCategory(ge.CHEST_PRINTS), this.addCategory(ge.JACKET), this.addCategory(ge.CHEST_ACCESSORIES), this._isInitalized = !0
  3620. }
  3621. get name() {
  3622. return Cn.TORSO
  3623. }
  3624. }
  3625. class No {}
  3626. No.COLORMATRIX = "colormatrix";
  3627. No.COMPOSITE = "composite";
  3628. class Jy {
  3629. constructor(e, s) {
  3630. this.texture = e, this.imageUrl = s
  3631. }
  3632. }
  3633. class Zy {
  3634. constructor(e, s) {
  3635. this.effectName = e, this.thumbnailUrl = s
  3636. }
  3637. }
  3638. class eA {
  3639. constructor(e, s, n) {
  3640. this._productName = e, this._customImage = s, this._furnitureClassName = n
  3641. }
  3642. get productName() {
  3643. return this._productName
  3644. }
  3645. get customImage() {
  3646. return this._customImage
  3647. }
  3648. get furnitureClassName() {
  3649. return this._furnitureClassName
  3650. }
  3651. }
  3652. class Ht {}
  3653. Ht.STATE_UNLOCKED = 1;
  3654. Ht.STATE_LOCKED_AVAILABLE = 2;
  3655. Ht.STATE_LOCKED_EXPIRED = 3;
  3656. Ht.STATE_LOCKED_FUTURE = 4;
  3657. class an {}
  3658. an.TYPE_CHAT = 1;
  3659. an.TYPE_ROOM_INFO = 2;
  3660. an.TYPE_IM = 3;
  3661. const Y_ = () => {
  3662. const i = new Date;
  3663. return `${i.getHours().toString().padStart(2,"0")}:${i.getMinutes().toString().padStart(2,"0")}`
  3664. },
  3665. Vc = (i = 0) => {
  3666. const e = i ? new Date(Date.now() - i * 1e3) : new Date;
  3667. return `${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}`
  3668. },
  3669. z_ = i => {
  3670. if (!i || !i.length) return null;
  3671. const e = i.split("/"),
  3672. s = e[0],
  3673. n = e[1],
  3674. r = parseInt(e[2]);
  3675. return {
  3676. username: s,
  3677. figure: n,
  3678. userId: r
  3679. }
  3680. };
  3681. class Kt {
  3682. constructor() {
  3683. this.id = -1, this.name = null, this.gender = 0, this.online = !1, this.followingAllowed = !1, this.figure = null, this.categoryId = 0, this.motto = null, this.realName = null, this.lastAccess = null, this.persistedMessageUser = !1, this.vipMember = !1, this.pocketHabboUser = !1, this.relationshipStatus = -1, this.unread = 0
  3684. }
  3685. populate(e) {
  3686. this.id = e.id, this.name = e.name, this.gender = e.gender, this.online = e.online, this.followingAllowed = e.followingAllowed, this.figure = e.figure, this.categoryId = e.categoryId, this.motto = e.motto, this.realName = e.realName, this.lastAccess = e.lastAccess, this.persistedMessageUser = e.persistedMessageUser, this.vipMember = e.vipMember, this.pocketHabboUser = e.pocketHabboUser, this.relationshipStatus = e.relationshipStatus
  3687. }
  3688. }
  3689. Kt.RELATIONSHIP_NONE = 0;
  3690. Kt.RELATIONSHIP_HEART = 1;
  3691. Kt.RELATIONSHIP_SMILE = 2;
  3692. Kt.RELATIONSHIP_BOBBA = 3;
  3693. class Fr {}
  3694. Fr.GROUP_CHAT = 0;
  3695. Fr.PRIVATE_CHAT = 1;
  3696. class Js {}
  3697. Js.HIDDEN = 0;
  3698. Js.SHOW = 1;
  3699. Js.UNREAD = 2;
  3700. class Wc {
  3701. populate(e) {
  3702. return e ? (this._id = e.requestId, this._name = e.requesterName, this._figureString = e.figureString, this._requesterUserId = e.requesterUserId, !0) : !1
  3703. }
  3704. get id() {
  3705. return this._id
  3706. }
  3707. get name() {
  3708. return this._name
  3709. }
  3710. get requesterUserId() {
  3711. return this._requesterUserId
  3712. }
  3713. get figureString() {
  3714. return this._figureString
  3715. }
  3716. }
  3717. class tA {
  3718. constructor(e = 0, s = 0, n = 0, r = []) {
  3719. this.userFriendLimit = e, this.normalFriendLimit = s, this.extendedFriendLimit = n, this.categories = r
  3720. }
  3721. }
  3722. class Ps {
  3723. constructor(e, s, n = 0, r = null, o = 0) {
  3724. this._type = o, this._senderId = e, this._message = s, this._secondsSinceSent = n, this._extraData = r, this._date = new Date
  3725. }
  3726. get type() {
  3727. return this._type
  3728. }
  3729. get senderId() {
  3730. return this._senderId
  3731. }
  3732. get message() {
  3733. return this._message
  3734. }
  3735. get secondsSinceSent() {
  3736. return this._secondsSinceSent
  3737. }
  3738. get extraData() {
  3739. return this._extraData
  3740. }
  3741. get date() {
  3742. return this._date
  3743. }
  3744. }
  3745. Ps.CHAT = 0;
  3746. Ps.ROOM_INVITE = 1;
  3747. Ps.STATUS_NOTIFICATION = 2;
  3748. Ps.SECURITY_NOTIFICATION = 3;
  3749. class sA {
  3750. constructor(e, s = Fr.PRIVATE_CHAT) {
  3751. this._userId = e, this._chats = [], this._type = s
  3752. }
  3753. addChat(e) {
  3754. this._chats.push(e)
  3755. }
  3756. get userId() {
  3757. return this._userId
  3758. }
  3759. get chats() {
  3760. return this._chats
  3761. }
  3762. get type() {
  3763. return this._type
  3764. }
  3765. set type(e) {
  3766. this._type = e
  3767. }
  3768. }
  3769. const K_ = class {
  3770. constructor(i) {
  3771. this._threadId = ++K_.THREAD_ID, this._participant = i, this._groups = [], this._lastUpdated = new Date, this._unreadCount = 0
  3772. }
  3773. addMessage(i, e, s = 0, n = null, r = 0) {
  3774. const o = i < 0 && n,
  3775. l = o ? z_(n).userId : i,
  3776. c = this.getLastGroup(l);
  3777. if (!c) return;
  3778. o && (c.type = Fr.GROUP_CHAT);
  3779. const u = new Ps(i, e, s, n, r);
  3780. return c.addChat(u), this._lastUpdated = new Date, this._unreadCount++, u
  3781. }
  3782. getLastGroup(i) {
  3783. let e = this._groups[this._groups.length - 1];
  3784. return e && e.userId === i || (e = new sA(i), this._groups.push(e)), e
  3785. }
  3786. setRead() {
  3787. this._unreadCount = 0
  3788. }
  3789. get threadId() {
  3790. return this._threadId
  3791. }
  3792. get participant() {
  3793. return this._participant
  3794. }
  3795. get groups() {
  3796. return this._groups
  3797. }
  3798. get lastUpdated() {
  3799. return this._lastUpdated
  3800. }
  3801. get unreadCount() {
  3802. return this._unreadCount
  3803. }
  3804. get unread() {
  3805. return this._unreadCount > 0
  3806. }
  3807. };
  3808. let $l = K_;
  3809. $l.MESSAGE_RECEIVED = "MT_MESSAGE_RECEIVED";
  3810. $l.THREAD_ID = 0;
  3811. function Mo(i = 0) {
  3812. oe(i === 0 ? "friends-messenger/toggle" : `friends-messenger/${i}`)
  3813. }
  3814. const nA = () => md.RENDERER_VERSION,
  3815. $_ = () => "2.1.1";
  3816. function Uo(i) {
  3817. B(new Mr(i, !0))
  3818. }
  3819. function Q_(i) {
  3820. oe(`groups/manage/${i}`)
  3821. }
  3822. function jc(i, e) {
  3823. oe(e ? `group-members/${i}/${e}` : `group-members/${i}`)
  3824. }
  3825. const ol = class {
  3826. constructor(i, e, s, n) {
  3827. this.type = i, this.key = e || 0, this.color = s || 0, this.position = n || 4
  3828. }
  3829. get code() {
  3830. return this.key === 0 && this.type !== ol.BASE ? null : ol.getCode(this.type, this.key, this.color, this.position)
  3831. }
  3832. static getCode(i, e, s, n) {
  3833. return i + (e < 10 ? "0" : "") + e + (s < 10 ? "0" : "") + s + n
  3834. }
  3835. };
  3836. let Zt = ol;
  3837. Zt.BASE = "b";
  3838. Zt.SYMBOL = "s";
  3839. class xt {}
  3840. xt.NOT_MEMBER = 0;
  3841. xt.MEMBER = 1;
  3842. xt.REQUEST_PENDING = 2;
  3843. class hs {}
  3844. hs.REGULAR = 0;
  3845. hs.EXCLUSIVE = 1;
  3846. hs.PRIVATE = 2;
  3847. const rA = i => {
  3848. B(i.favourite ? new gd(i.groupId) : new pd(i.groupId))
  3849. },
  3850. Ql = i => B(new fd(i));
  3851. class Ee {}
  3852. Ee.NONE = "NONE";
  3853. Ee.ERROR = "ERROR";
  3854. Ee.REJECTED = "REJECTED";
  3855. Ee.USER_CREATE = "USER_CREATE";
  3856. Ee.USER_PENDING = "USER_PENDING";
  3857. Ee.USER_ONGOING = "USER_ONGOING";
  3858. Ee.USER_FEEDBACK = "USER_FEEDBACK";
  3859. Ee.USER_NO_HELPERS = "USER_NO_HELPERS";
  3860. Ee.USER_SOMETHING_WRONG = "USER_SOMETHING_WRONG";
  3861. Ee.USER_THANKS = "USER_THANKS";
  3862. Ee.USER_GUIDE_DISCONNECTED = "USER_GUIDE_DISCONNECTED";
  3863. Ee.GUIDE_TOOL_MENU = "GUIDE_TOOL_MENU";
  3864. Ee.GUIDE_ACCEPT = "GUIDE_ACCEPT";
  3865. Ee.GUIDE_ONGOING = "GUIDE_ONGOING";
  3866. Ee.GUIDE_CLOSED = "GUIDE_CLOSED";
  3867. Ee.GUARDIAN_CHAT_REVIEW_ACCEPT = "GUARDIAN_CHAT_REVIEW_ACCEPT";
  3868. Ee.GUARDIAN_CHAT_REVIEW_WAIT_FOR_VOTERS = "GUARDIAN_CHAT_REVIEW_WAIT_FOR_VOTERS";
  3869. Ee.GUARDIAN_CHAT_REVIEW_VOTE = "GUARDIAN_CHAT_REVIEW_VOTE";
  3870. Ee.GUARDIAN_CHAT_REVIEW_WAIT_FOR_RESULTS = "GUARDIAN_CHAT_REVIEW_WAIT_FOR_RESULTS";
  3871. Ee.GUARDIAN_CHAT_REVIEW_RESULTS = "GUARDIAN_CHAT_REVIEW_RESULTS";
  3872. class qc {
  3873. constructor(e, s) {
  3874. this._message = e, this._roomId = s
  3875. }
  3876. get message() {
  3877. return this._message
  3878. }
  3879. get roomId() {
  3880. return this._roomId
  3881. }
  3882. }
  3883. class Yc {
  3884. constructor(e) {
  3885. this._userId = e, this._messages = []
  3886. }
  3887. addChat(e) {
  3888. this._messages.push(e)
  3889. }
  3890. get userId() {
  3891. return this._userId
  3892. }
  3893. get messages() {
  3894. return this._messages
  3895. }
  3896. }
  3897. class Ks {}
  3898. Ks.ACTIVE = "active";
  3899. Ks.NONE = "none";
  3900. Ks.EXPIRED = "expired";
  3901. const oA = "HC1",
  3902. iA = ["ACH_VipHC1", "ACH_VipHC2", "ACH_VipHC3", "ACH_VipHC4", "ACH_VipHC5", "HC1", "HC2", "HC3", "HC4", "HC5"],
  3903. aA = i => {
  3904. let e = null;
  3905. return iA.forEach(s => i.indexOf(s) > -1 && (e = s)), e || oA
  3906. };
  3907. class Ti {}
  3908. Ti.TOO_MANY_PENDING_CALLS_CODE = 1;
  3909. Ti.HAS_ABUSIVE_CALL_CODE = 2;
  3910. const lA = i => i === 1 ? "useless" : i === 2 ? "abusive" : "resolved";
  3911. class Wt {}
  3912. Wt.SELECT_USER = 0;
  3913. Wt.SELECT_CHATS = 1;
  3914. Wt.SELECT_TOPICS = 2;
  3915. Wt.INPUT_REPORT_MESSAGE = 3;
  3916. Wt.REPORT_SUMMARY = 4;
  3917. class rt {}
  3918. rt.EMERGENCY = 1;
  3919. rt.GUIDE = 2;
  3920. rt.IM = 3;
  3921. rt.ROOM = 4;
  3922. rt.BULLY = 6;
  3923. rt.THREAD = 7;
  3924. rt.MESSAGE = 8;
  3925. rt.PHOTO = 9;
  3926. const cA = i => {
  3927. switch (i) {
  3928. case 1:
  3929. case 2:
  3930. return "Normal";
  3931. case 3:
  3932. return "Automatic";
  3933. case 4:
  3934. return "Automatic IM";
  3935. case 5:
  3936. return "Guide System";
  3937. case 6:
  3938. return "IM";
  3939. case 7:
  3940. return "Room";
  3941. case 8:
  3942. return "Panic";
  3943. case 9:
  3944. return "Guardian";
  3945. case 10:
  3946. return "Automatic Helper";
  3947. case 11:
  3948. return "Discussion";
  3949. case 12:
  3950. return "Selfie";
  3951. case 14:
  3952. return "Photo";
  3953. case 15:
  3954. return "Ambassador"
  3955. }
  3956. return "Unknown"
  3957. };
  3958. class ze {
  3959. constructor(e, s, n, r, o) {
  3960. this._actionId = e, this._name = s, this._actionType = n, this._sanctionTypeId = r, this._actionLengthHours = o
  3961. }
  3962. get actionId() {
  3963. return this._actionId
  3964. }
  3965. get name() {
  3966. return this._name
  3967. }
  3968. get actionType() {
  3969. return this._actionType
  3970. }
  3971. get sanctionTypeId() {
  3972. return this._sanctionTypeId
  3973. }
  3974. get actionLengthHours() {
  3975. return this._actionLengthHours
  3976. }
  3977. }
  3978. ze.ALERT = 1;
  3979. ze.MUTE = 2;
  3980. ze.BAN = 3;
  3981. ze.KICK = 4;
  3982. ze.TRADE_LOCK = 5;
  3983. ze.MESSAGE = 6;
  3984. class We {}
  3985. We.NONE = 0;
  3986. We.START_DOORBELL = 1;
  3987. We.START_PASSWORD = 2;
  3988. We.STATE_PENDING_SERVER = 3;
  3989. We.UPDATE_STATE = 4;
  3990. We.STATE_WAITING = 5;
  3991. We.STATE_NO_ANSWER = 6;
  3992. We.STATE_WRONG_PASSWORD = 7;
  3993. We.STATE_ACCEPTED = 8;
  3994. class En {}
  3995. En.LIST = 0;
  3996. En.THUMBNAILS = 1;
  3997. En.FORCED_THUMBNAILS = 2;
  3998. const uA = () => {
  3999. const i = [];
  4000. for (let e = 10; e <= 100; e = e + 10) i.push(e);
  4001. return i
  4002. },
  4003. dA = uA(),
  4004. mr = [{
  4005. name: "anything",
  4006. query: null
  4007. }, {
  4008. name: "room.name",
  4009. query: "roomname"
  4010. }, {
  4011. name: "owner",
  4012. query: "owner"
  4013. }, {
  4014. name: "tag",
  4015. query: "tag"
  4016. }, {
  4017. name: "group",
  4018. query: "group"
  4019. }];
  4020. function Rs(i) {
  4021. B(new fo(i, !1, !0))
  4022. }
  4023. class fe {}
  4024. fe.DEFAULT = "default";
  4025. fe.MOTD = "motd";
  4026. fe.MODERATION = "moderation";
  4027. fe.EVENT = "event";
  4028. fe.NITRO = "nitro";
  4029. fe.SEARCH = "search";
  4030. fe.ALERT = "alert";
  4031. fe.AFK = "afk";
  4032. fe.CONFIRM = "confirm";
  4033. const il = class {
  4034. constructor(i, e = fe.DEFAULT, s = null, n = null, r = null, o = null) {
  4035. il.ITEM_ID += 1, this._id = il.ITEM_ID, this._messages = i, this._alertType = e, this._clickUrl = s, this._clickUrlText = n, this._title = r, this._imageUrl = o
  4036. }
  4037. get id() {
  4038. return this._id
  4039. }
  4040. get messages() {
  4041. return this._messages
  4042. }
  4043. set alertType(i) {
  4044. this._alertType = i
  4045. }
  4046. get alertType() {
  4047. return this._alertType
  4048. }
  4049. get clickUrl() {
  4050. return this._clickUrl
  4051. }
  4052. get clickUrlText() {
  4053. return this._clickUrlText
  4054. }
  4055. get title() {
  4056. return this._title
  4057. }
  4058. get imageUrl() {
  4059. return this._imageUrl
  4060. }
  4061. };
  4062. let al = il;
  4063. al.ITEM_ID = -1;
  4064. class Le {}
  4065. Le.FRIENDOFFLINE = "friendoffline";
  4066. Le.FRIENDONLINE = "friendonline";
  4067. Le.THIRDPARTYFRIENDOFFLINE = "thirdpartyfriendoffline";
  4068. Le.THIRDPARTYFRIENDONLINE = "thirdpartyfriendonline";
  4069. Le.ACHIEVEMENT = "achievement";
  4070. Le.BADGE_RECEIVED = "badge_received";
  4071. Le.INFO = "info";
  4072. Le.RECYCLEROK = "recyclerok";
  4073. Le.RESPECT = "respect";
  4074. Le.CLUB = "club";
  4075. Le.SOUNDMACHINE = "soundmachine";
  4076. Le.PETLEVEL = "petlevel";
  4077. Le.CLUBGIFT = "clubgift";
  4078. Le.BUYFURNI = "buyfurni";
  4079. Le.VIP = "vip";
  4080. Le.ROOMMESSAGESPOSTED = "roommessagesposted";
  4081. Le.LOOKSTRING = "look";
  4082. Le.FURNITURE = "furniture.preview";
  4083. Le.NEWSUPDATED = "news-updated";
  4084. Le.NEWSSILENT = "news-silent";
  4085. Le.PRESTIGE = "prestige";
  4086. const ll = class {
  4087. constructor(i, e, s = Le.INFO, n = null, r = null, o = -1) {
  4088. ll.ITEM_ID += 1, this._id = ll.ITEM_ID, this._display = i, this._message = e, this._notificationType = s, this._iconUrl = n, this._linkUrl = r, this._timeout = o, this.running = !1
  4089. }
  4090. get id() {
  4091. return this._id
  4092. }
  4093. get display() {
  4094. return this._display
  4095. }
  4096. get message() {
  4097. return this._message
  4098. }
  4099. get notificationType() {
  4100. return this._notificationType
  4101. }
  4102. get iconUrl() {
  4103. return this._iconUrl
  4104. }
  4105. get linkUrl() {
  4106. return this._linkUrl
  4107. }
  4108. get timeout() {
  4109. return this._timeout
  4110. }
  4111. };
  4112. let X_ = ll;
  4113. X_.ITEM_ID = -1;
  4114. const cl = class {
  4115. constructor(i, e, s, n, r, o, l) {
  4116. cl.ITEM_ID += 1, this._id = cl.ITEM_ID, this._confirmType = i, this._message = e, this._onConfirm = s, this._onCancel = n, this._confirmText = r, this._cancelText = o, this._title = l
  4117. }
  4118. get id() {
  4119. return this._id
  4120. }
  4121. get confirmType() {
  4122. return this._confirmType
  4123. }
  4124. get message() {
  4125. return this._message
  4126. }
  4127. get onConfirm() {
  4128. return this._onConfirm
  4129. }
  4130. get onCancel() {
  4131. return this._onCancel
  4132. }
  4133. get confirmText() {
  4134. return this._confirmText
  4135. }
  4136. get cancelText() {
  4137. return this._cancelText
  4138. }
  4139. get title() {
  4140. return this._title
  4141. }
  4142. };
  4143. let J_ = cl;
  4144. J_.ITEM_ID = -1;
  4145. class xn {}
  4146. xn.BUBBLE = "BUBBLE";
  4147. xn.PERSISTENT_BUBBLE = "PERSISTENT_BUBBLE";
  4148. class Xl {
  4149. constructor() {
  4150. this._credits = 0, this._activityPoints = new Map, this._clubDays = 0, this._clubPeriods = 0, this._isVIP = !1, this._pastClubDays = 0, this._pastVipDays = 0, this._isExpiring = !1, this._minutesUntilExpiration = 0, this._minutesSinceLastModified = 0, this._lastUpdated = 0
  4151. }
  4152. static from(e) {
  4153. const s = new Xl;
  4154. return s._credits = e._credits, s._activityPoints = e._activityPoints, s._clubDays = e._clubDays, s._clubPeriods = e._clubPeriods, s._isVIP = e._isVIP, s._pastClubDays = e._pastClubDays, s._pastVipDays = e._pastVipDays, s._isExpiring = e._isExpiring, s._minutesUntilExpiration = e._minutesUntilExpiration, s._minutesSinceLastModified = e._minutesSinceLastModified, s._lastUpdated = e._lastUpdated, s
  4155. }
  4156. get credits() {
  4157. return this._credits
  4158. }
  4159. set credits(e) {
  4160. this._lastUpdated = Ws(), this._credits = e
  4161. }
  4162. get activityPoints() {
  4163. return this._activityPoints
  4164. }
  4165. set activityPoints(e) {
  4166. this._lastUpdated = Ws(), this._activityPoints = e
  4167. }
  4168. get clubDays() {
  4169. return this._clubDays
  4170. }
  4171. set clubDays(e) {
  4172. this._lastUpdated = Ws(), this._clubDays = e
  4173. }
  4174. get clubPeriods() {
  4175. return this._clubPeriods
  4176. }
  4177. set clubPeriods(e) {
  4178. this._lastUpdated = Ws(), this._clubPeriods = e
  4179. }
  4180. get _Str_13571() {
  4181. return this._clubDays > 0 || this._clubPeriods > 0
  4182. }
  4183. get isVip() {
  4184. return this._isVIP
  4185. }
  4186. set isVip(e) {
  4187. this._isVIP = e
  4188. }
  4189. get pastClubDays() {
  4190. return this._pastClubDays
  4191. }
  4192. set pastClubDays(e) {
  4193. this._lastUpdated = Ws(), this._pastClubDays = e
  4194. }
  4195. get pastVipDays() {
  4196. return this._pastVipDays
  4197. }
  4198. set pastVipDays(e) {
  4199. this._lastUpdated = Ws(), this._pastVipDays = e
  4200. }
  4201. get isExpiring() {
  4202. return this._isExpiring
  4203. }
  4204. set isExpiring(e) {
  4205. this._isExpiring = e
  4206. }
  4207. get minutesUntilExpiration() {
  4208. var e = (Ws() - this._lastUpdated) / 6e4,
  4209. s = this._minutesUntilExpiration - e;
  4210. return s > 0 ? s : 0
  4211. }
  4212. set minutesUntilExpiration(e) {
  4213. this._lastUpdated = Ws(), this._minutesUntilExpiration = e
  4214. }
  4215. get minutesSinceLastModified() {
  4216. return this._minutesSinceLastModified
  4217. }
  4218. set minutesSinceLastModified(e) {
  4219. this._lastUpdated = Ws(), this._minutesSinceLastModified = e
  4220. }
  4221. get lastUpdated() {
  4222. return this._lastUpdated
  4223. }
  4224. get clubLevel() {
  4225. return this.clubDays === 0 && this.clubPeriods === 0 ? ls.NO_CLUB : this.isVip ? ls.VIP : ls.CLUB
  4226. }
  4227. }
  4228. class Lo extends Gs {}
  4229. class In extends Lo {
  4230. constructor(e, s) {
  4231. super(e), this._id = -1, this._numQuestions = 0, this._startMessage = "", this._endMessage = "", this._questionArray = null, this._pollType = "", this._npsPoll = !1, this._id = s
  4232. }
  4233. get id() {
  4234. return this._id
  4235. }
  4236. get summary() {
  4237. return this._summary
  4238. }
  4239. set summary(e) {
  4240. this._summary = e
  4241. }
  4242. get headline() {
  4243. return this._headline
  4244. }
  4245. set headline(e) {
  4246. this._headline = e
  4247. }
  4248. get numQuestions() {
  4249. return this._numQuestions
  4250. }
  4251. set numQuestions(e) {
  4252. this._numQuestions = e
  4253. }
  4254. get startMessage() {
  4255. return this._startMessage
  4256. }
  4257. set startMessage(e) {
  4258. this._startMessage = e
  4259. }
  4260. get endMessage() {
  4261. return this._endMessage
  4262. }
  4263. set endMessage(e) {
  4264. this._endMessage = e
  4265. }
  4266. get questionArray() {
  4267. return this._questionArray
  4268. }
  4269. set questionArray(e) {
  4270. this._questionArray = e
  4271. }
  4272. get pollType() {
  4273. return this._pollType
  4274. }
  4275. set pollType(e) {
  4276. this._pollType = e
  4277. }
  4278. get npsPoll() {
  4279. return this._npsPoll
  4280. }
  4281. set npsPoll(e) {
  4282. this._npsPoll = e
  4283. }
  4284. }
  4285. In.OFFER = "RWPUW_OFFER";
  4286. In.ERROR = "RWPUW_ERROR";
  4287. In.CONTENT = "RWPUW_CONTENT";
  4288. class Gn extends Lo {
  4289. constructor(e, s = 0, n = 0, r = 0) {
  4290. super(e), this._hue = s, this._saturation = n, this._lightness = r
  4291. }
  4292. get hue() {
  4293. return this._hue
  4294. }
  4295. get saturation() {
  4296. return this._saturation
  4297. }
  4298. get lightness() {
  4299. return this._lightness
  4300. }
  4301. }
  4302. Gn.PREVIEW = "RWUBCPE_PREVIEW";
  4303. Gn.CLEAR_PREVIEW = "RWUBCPE_CLEAR_PREVIEW";
  4304. const Z_ = class extends Lo {
  4305. constructor(i, e) {
  4306. super(Z_.CHAT_INPUT_CONTENT), this._chatMode = "", this._userName = "", this._chatMode = i, this._userName = e
  4307. }
  4308. get chatMode() {
  4309. return this._chatMode
  4310. }
  4311. get userName() {
  4312. return this._userName
  4313. }
  4314. };
  4315. let Hn = Z_;
  4316. Hn.CHAT_INPUT_CONTENT = "RWUCICE_CHAT_INPUT_CONTENT";
  4317. Hn.WHISPER = "whisper";
  4318. Hn.SHOUT = "shout";
  4319. const eE = class extends Lo {
  4320. constructor(i, e, s, n, r, o, l) {
  4321. super(eE.UPDATE_CHAT), this._objectId = i, this._category = e, this._botId = s, this._chat = n, this._automaticChat = r, this._chatDelay = o, this._mixSentences = l
  4322. }
  4323. get objectId() {
  4324. return this._objectId
  4325. }
  4326. get category() {
  4327. return this._category
  4328. }
  4329. get botId() {
  4330. return this._botId
  4331. }
  4332. get chat() {
  4333. return this._chat
  4334. }
  4335. get automaticChat() {
  4336. return this._automaticChat
  4337. }
  4338. get chatDelay() {
  4339. return this._chatDelay
  4340. }
  4341. get mixSentences() {
  4342. return this._mixSentences
  4343. }
  4344. };
  4345. let Jl = eE;
  4346. Jl.UPDATE_CHAT = "RWURBCE_UPDATE_CHAT";
  4347. class Ge extends Lo {
  4348. constructor(e, s, n, r) {
  4349. super(e), this._id = s, this._category = n, this._roomId = r
  4350. }
  4351. get id() {
  4352. return this._id
  4353. }
  4354. get category() {
  4355. return this._category
  4356. }
  4357. get roomId() {
  4358. return this._roomId
  4359. }
  4360. }
  4361. Ge.OBJECT_SELECTED = "RWUROE_OBJECT_SELECTED";
  4362. Ge.OBJECT_DESELECTED = "RWUROE_OBJECT_DESELECTED";
  4363. Ge.USER_REMOVED = "RWUROE_USER_REMOVED";
  4364. Ge.FURNI_REMOVED = "RWUROE_FURNI_REMOVED";
  4365. Ge.FURNI_ADDED = "RWUROE_FURNI_ADDED";
  4366. Ge.USER_ADDED = "RWUROE_USER_ADDED";
  4367. Ge.OBJECT_ROLL_OVER = "RWUROE_OBJECT_ROLL_OVER";
  4368. Ge.OBJECT_ROLL_OUT = "RWUROE_OBJECT_ROLL_OUT";
  4369. Ge.OBJECT_REQUEST_MANIPULATION = "RWUROE_OBJECT_REQUEST_MANIPULATION";
  4370. Ge.OBJECT_DOUBLE_CLICKED = "RWUROE_OBJECT_DOUBLE_CLICKED";
  4371. class xr {
  4372. constructor(e) {
  4373. this.type = e, this.id = 0, this.category = 0, this.name = "", this.description = "", this.image = null, this.isWallItem = !1, this.isStickie = !1, this.isRoomOwner = !1, this.roomControllerLevel = 0, this.isAnyRoomController = !1, this.expiration = -1, this.purchaseCatalogPageId = -1, this.purchaseOfferId = -1, this.extraParam = "", this.isOwner = !1, this.stuffData = null, this.groupId = 0, this.ownerId = 0, this.ownerName = "", this.usagePolicy = 0, this.rentCatalogPageId = -1, this.rentOfferId = -1, this.purchaseCouldBeUsedForBuyout = !1, this.rentCouldBeUsedForBuyout = !1, this.availableForBuildersClub = !1, this.tileSizeX = 1, this.tileSizeY = 1
  4374. }
  4375. }
  4376. xr.FURNI = "IFI_FURNI";
  4377. class tE {
  4378. constructor(e, s, n, r, o, l = !1) {
  4379. this.roomIndex = e, this.category = s, this.id = n, this.name = r, this.userType = o, this.isFriend = l
  4380. }
  4381. }
  4382. class Gr {
  4383. constructor(e) {
  4384. this.type = e, this.level = 0, this.maximumLevel = 0, this.experience = 0, this.levelExperienceGoal = 0, this.energy = 0, this.maximumEnergy = 0, this.happyness = 0, this.maximumHappyness = 0, this.respectsPetLeft = 0, this.respect = 0, this.age = 0, this.name = "", this.id = -1, this.image = null, this.petType = 0, this.petBreed = 0, this.petFigure = "", this.posture = "std", this.isOwner = !1, this.ownerId = -1, this.ownerName = "", this.canRemovePet = !1, this.roomIndex = 0, this.unknownRarityLevel = 0, this.saddle = !1, this.rider = !1, this.breedable = !1, this.skillTresholds = [], this.publiclyRideable = 0, this.fullyGrown = !1, this.dead = !1, this.rarityLevel = 0, this.maximumTimeToLive = 0, this.remainingTimeToLive = 0, this.remainingGrowTime = 0, this.publiclyBreedable = !1
  4385. }
  4386. }
  4387. Gr.PET_INFO = "IPI_PET_INFO";
  4388. class Br {
  4389. constructor(e) {
  4390. this.type = e, this.name = "", this.motto = "", this.webID = 0, this.figure = "", this.badges = [], this.carryItem = 0, this.roomIndex = 0, this.amIOwner = !1, this.amIAnyRoomController = !1, this.roomControllerLevel = 0, this.ownerId = -1, this.ownerName = "", this.botSkills = []
  4391. }
  4392. }
  4393. Br.RENTABLE_BOT = "IRBI_RENTABLE_BOT";
  4394. const sE = class {
  4395. constructor(i) {
  4396. this.type = i, this.name = "", this.motto = "", this.achievementScore = 0, this.webID = 0, this.xp = 0, this.userType = -1, this.figure = "", this.badges = [], this.groupId = 0, this.groupName = "", this.groupBadgeId = "", this.carryItem = 0, this.roomIndex = 0, this.isSpectatorMode = !1, this.allowNameChange = !1, this.amIOwner = !1, this.amIAnyRoomController = !1, this.roomControllerLevel = 0, this.canBeKicked = !1, this.canBeBanned = !1, this.canBeMuted = !1, this.respectLeft = 0, this.isIgnored = !1, this.isGuildRoom = !1, this.canTrade = !1, this.canTradeReason = 0, this.targetRoomControllerLevel = 0, this.isAmbassador = !1
  4397. }
  4398. get isOwnUser() {
  4399. return this.type === sE.OWN_USER
  4400. }
  4401. };
  4402. let mt = sE;
  4403. mt.OWN_USER = "IUI_OWN_USER";
  4404. mt.PEER = "IUI_PEER";
  4405. mt.BOT = "IUI_BOT";
  4406. mt.TRADE_REASON_OK = 0;
  4407. mt.TRADE_REASON_SHUTDOWN = 2;
  4408. mt.TRADE_REASON_NO_TRADING = 3;
  4409. mt.DEFAULT_BOT_BADGE_ID = "BOT";
  4410. class gr {
  4411. static getObjectName(e, s) {
  4412. const n = Pe();
  4413. let r = -1,
  4414. o = null,
  4415. l = 0;
  4416. switch (s) {
  4417. case re.FLOOR:
  4418. case re.WALL:
  4419. {
  4420. const c = X().getRoomObject(n.roomId, e, s);
  4421. if (!c) break;
  4422. if (c.type.indexOf("poster") === 0) o = g("${poster_" + parseInt(c.type.replace("poster", "")) + "_name}");
  4423. else {
  4424. let u = null;
  4425. const h = c.model.getValue(ue.FURNITURE_TYPE_ID);
  4426. if (s === re.FLOOR ? u = J().getFloorItemData(h) : s === re.WALL && (u = J().getWallItemData(h)), !u) break;
  4427. r = u.id, o = u.name
  4428. }
  4429. break
  4430. }
  4431. case re.UNIT:
  4432. {
  4433. const c = n.userDataManager.getUserDataByIndex(e);
  4434. if (!c) break;r = c.webID,
  4435. o = c.name,
  4436. l = c.type;
  4437. break
  4438. }
  4439. }
  4440. return !o || !o.length ? null : new tE(e, s, r, o, l)
  4441. }
  4442. static getFurniInfo(e, s) {
  4443. const n = Pe(),
  4444. r = new xr(xr.FURNI);
  4445. r.id = e, r.category = s;
  4446. const o = X().getRoomObject(n.roomId, e, s);
  4447. if (!o) return;
  4448. const l = o.model;
  4449. l.getValue(_n.INFOSTAND_EXTRA_PARAM) && (r.extraParam = l.getValue(_n.INFOSTAND_EXTRA_PARAM));
  4450. const c = l.getValue(ue.FURNITURE_DATA_FORMAT),
  4451. u = _d.getData(c);
  4452. u.initializeFromRoomObjectModel(l), r.stuffData = u;
  4453. const h = o.type;
  4454. if (h.indexOf("poster") === 0) {
  4455. const I = parseInt(h.replace("poster", ""));
  4456. r.name = g("${poster_" + I + "_name}"), r.description = g("${poster_" + I + "_desc}")
  4457. } else {
  4458. const I = l.getValue(ue.FURNITURE_TYPE_ID);
  4459. let C = null;
  4460. s === re.FLOOR ? C = J().getFloorItemData(I) : s === re.WALL && (C = J().getWallItemData(I)), C && (r.name = C.name, r.description = C.description, r.purchaseOfferId = C.purchaseOfferId, r.purchaseCouldBeUsedForBuyout = C.purchaseCouldBeUsedForBuyout, r.rentOfferId = C.rentOfferId, r.rentCouldBeUsedForBuyout = C.rentCouldBeUsedForBuyout, r.availableForBuildersClub = C.availableForBuildersClub, r.tileSizeX = C.tileSizeX, r.tileSizeY = C.tileSizeY)
  4461. }
  4462. h.indexOf("post_it") > -1 && (r.isStickie = !0);
  4463. const m = l.getValue(ue.FURNITURE_EXPIRY_TIME),
  4464. p = l.getValue(ue.FURNITURE_EXPIRTY_TIMESTAMP);
  4465. r.expiration = m < 0 ? m : Math.max(0, m - (Ws() - p) / 1e3);
  4466. let E = X().getRoomObjectImage(n.roomId, e, s, new Lt(180), 64, null);
  4467. (!E.data || E.data.width > 140 || E.data.height > 200) && (E = X().getRoomObjectImage(n.roomId, e, s, new Lt(180), 1, null)), r.image = E.getImage(), r.isWallItem = s === re.WALL, r.isRoomOwner = n.isRoomOwner, r.roomControllerLevel = n.controllerLevel, r.isAnyRoomController = J().isModerator, r.ownerId = l.getValue(ue.FURNITURE_OWNER_ID), r.ownerName = l.getValue(ue.FURNITURE_OWNER_NAME), r.usagePolicy = l.getValue(ue.FURNITURE_USAGE_POLICY);
  4468. const _ = l.getValue(ue.FURNITURE_GUILD_CUSTOMIZED_GUILD_ID);
  4469. return _ !== 0 && (r.groupId = _), as(o) && (r.isOwner = !0), r
  4470. }
  4471. static getUserInfo(e, s) {
  4472. const n = Pe();
  4473. let r = mt.OWN_USER;
  4474. s.webID !== J().userId && (r = mt.PEER);
  4475. const o = new mt(r);
  4476. o.isSpectatorMode = n.isSpectator, o.name = s.name, o.motto = s.custom, o.achievementScore = s.activityPoints, o.webID = s.webID, o.roomIndex = s.roomIndex, o.userType = vt.USER;
  4477. const l = X().getRoomObject(n.roomId, s.roomIndex, e);
  4478. if (l && (o.carryItem = l.model.getValue(ue.FIGURE_CARRY_OBJECT) || 0), r === mt.OWN_USER && (o.allowNameChange = J().canChangeName), o.amIOwner = n.isRoomOwner, o.isGuildRoom = n.isGuildRoom, o.roomControllerLevel = n.controllerLevel, o.amIAnyRoomController = J().isModerator, o.isAmbassador = J().isAmbassador, r === mt.PEER) {
  4479. if (l) {
  4480. const h = l.model.getValue(ue.FIGURE_FLAT_CONTROL);
  4481. h !== null && (o.targetRoomControllerLevel = h), o.canBeMuted = this.canBeMuted(o), o.canBeKicked = this.canBeKicked(o), o.canBeBanned = this.canBeBanned(o)
  4482. }
  4483. o.isIgnored = J().isUserIgnored(s.name), o.respectLeft = J().respectsLeft;
  4484. const c = J().isSystemShutdown,
  4485. u = n.tradeMode;
  4486. if (c) o.canTrade = !1;
  4487. else switch (u) {
  4488. case ea.ROOM_CONTROLLER_REQUIRED:
  4489. {
  4490. const h = o.roomControllerLevel !== _t.NONE && o.roomControllerLevel !== _t.GUILD_MEMBER,
  4491. m = o.targetRoomControllerLevel !== _t.NONE && o.targetRoomControllerLevel !== _t.GUILD_MEMBER;o.canTrade = h || m;
  4492. break
  4493. }
  4494. case ea.NO_TRADING:
  4495. o.canTrade = !0;
  4496. break;
  4497. default:
  4498. o.canTrade = !1;
  4499. break
  4500. }
  4501. o.canTradeReason = mt.TRADE_REASON_OK, c && (o.canTradeReason = mt.TRADE_REASON_SHUTDOWN), u !== ea.FREE_TRADING && (o.canTradeReason = mt.TRADE_REASON_NO_TRADING)
  4502. }
  4503. return o.groupId = s.groupId, o.groupBadgeId = J().getGroupBadge(o.groupId), o.groupName = s.groupName, o.badges = n.userDataManager.getUserBadges(s.webID), o.figure = s.figure, o
  4504. }
  4505. static getBotInfo(e, s) {
  4506. const n = Pe(),
  4507. r = new mt(mt.BOT);
  4508. r.name = s.name, r.motto = s.custom, r.webID = s.webID, r.roomIndex = s.roomIndex, r.userType = s.type;
  4509. const o = X().getRoomObject(n.roomId, s.roomIndex, e);
  4510. return o && (r.carryItem = o.model.getValue(ue.FIGURE_CARRY_OBJECT) || 0), r.amIOwner = n.isRoomOwner, r.isGuildRoom = n.isGuildRoom, r.roomControllerLevel = n.controllerLevel, r.amIAnyRoomController = J().isModerator, r.isAmbassador = J().isAmbassador, r.badges = [mt.DEFAULT_BOT_BADGE_ID], r.figure = s.figure, r
  4511. }
  4512. static getRentableBotInfo(e, s) {
  4513. const n = Pe(),
  4514. r = new Br(Br.RENTABLE_BOT);
  4515. r.name = s.name, r.motto = s.custom, r.webID = s.webID, r.roomIndex = s.roomIndex, r.ownerId = s.ownerId, r.ownerName = s.ownerName, r.botSkills = s.botSkills;
  4516. const o = X().getRoomObject(n.roomId, s.roomIndex, e);
  4517. return o && (r.carryItem = o.model.getValue(ue.FIGURE_CARRY_OBJECT) || 0), r.amIOwner = n.isRoomOwner, r.roomControllerLevel = n.controllerLevel, r.amIAnyRoomController = J().isModerator, r.badges = [mt.DEFAULT_BOT_BADGE_ID], r.figure = s.figure, r
  4518. }
  4519. static getPetInfo(e) {
  4520. const s = Pe(),
  4521. n = s.userDataManager.getPetData(e.id);
  4522. if (!n) return;
  4523. const r = new Ur(n.figure);
  4524. let o = null;
  4525. r.typeId === zt.MONSTERPLANT && (e.level >= e.adultLevel ? o = "std" : o = "grw" + e.level);
  4526. const l = e.ownerId === J().userId,
  4527. c = new Gr(Gr.PET_INFO);
  4528. return c.name = n.name, c.id = e.id, c.ownerId = e.ownerId, c.ownerName = e.ownerName, c.rarityLevel = e.rarityLevel, c.petType = r.typeId, c.petBreed = r.paletteId, c.petFigure = n.figure, c.posture = o, c.isOwner = l, c.roomIndex = n.roomIndex, c.level = e.level, c.maximumLevel = e.maximumLevel, c.experience = e.experience, c.levelExperienceGoal = e.levelExperienceGoal, c.energy = e.energy, c.maximumEnergy = e.maximumEnergy, c.happyness = e.happyness, c.maximumHappyness = e.maximumHappyness, c.respect = e.respect, c.respectsPetLeft = J().respectsPetLeft, c.age = e.age, c.saddle = e.saddle, c.rider = e.rider, c.breedable = e.breedable, c.fullyGrown = e.fullyGrown, c.dead = e.dead, c.rarityLevel = e.rarityLevel, c.skillTresholds = e.skillTresholds, c.canRemovePet = !1, c.publiclyRideable = e.publiclyRideable, c.maximumTimeToLive = e.maximumTimeToLive, c.remainingTimeToLive = e.remainingTimeToLive, c.remainingGrowTime = e.remainingGrowTime, c.publiclyBreedable = e.publiclyBreedable, (l || s.isRoomOwner || J().isModerator || s.controllerLevel >= _t.GUEST) && (c.canRemovePet = !0), c
  4529. }
  4530. static checkGuildSetting(e) {
  4531. return e.isGuildRoom ? e.roomControllerLevel >= _t.GUILD_ADMIN : e.roomControllerLevel >= _t.GUEST
  4532. }
  4533. static isValidSetting(e, s) {
  4534. const n = Pe();
  4535. if (!n.isPrivateRoom) return !1;
  4536. const r = n.moderationSettings;
  4537. let o = !1;
  4538. return r && (o = s(e, r)), o && e.targetRoomControllerLevel < _t.ROOM_OWNER
  4539. }
  4540. static canBeMuted(e) {
  4541. const s = (n, r) => {
  4542. switch (r.allowMute) {
  4543. case Qt.MODERATION_LEVEL_USER_WITH_RIGHTS:
  4544. return this.checkGuildSetting(n);
  4545. default:
  4546. return n.roomControllerLevel >= _t.ROOM_OWNER
  4547. }
  4548. };
  4549. return this.isValidSetting(e, s)
  4550. }
  4551. static canBeKicked(e) {
  4552. const s = (n, r) => {
  4553. switch (r.allowKick) {
  4554. case Qt.MODERATION_LEVEL_ALL:
  4555. return !0;
  4556. case Qt.MODERATION_LEVEL_USER_WITH_RIGHTS:
  4557. return this.checkGuildSetting(n);
  4558. default:
  4559. return n.roomControllerLevel >= _t.ROOM_OWNER
  4560. }
  4561. };
  4562. return this.isValidSetting(e, s)
  4563. }
  4564. static canBeBanned(e) {
  4565. const s = (n, r) => {
  4566. switch (r.allowBan) {
  4567. case Qt.MODERATION_LEVEL_USER_WITH_RIGHTS:
  4568. return this.checkGuildSetting(n);
  4569. default:
  4570. return n.roomControllerLevel >= _t.ROOM_OWNER
  4571. }
  4572. };
  4573. return this.isValidSetting(e, s)
  4574. }
  4575. }
  4576. class Ue {}
  4577. Ue.GENERIC_SKILL = 0;
  4578. Ue.DRESS_UP = 1;
  4579. Ue.SETUP_CHAT = 2;
  4580. Ue.RANDOM_WALK = 3;
  4581. Ue.DANCE = 4;
  4582. Ue.CHANGE_BOT_NAME = 5;
  4583. Ue.SERVE_BEVERAGE = 6;
  4584. Ue.INCLIENT_LINK = 7;
  4585. Ue.NUX_PROCEED = 8;
  4586. Ue.CHANGE_BOT_MOTTO = 9;
  4587. Ue.NUX_TAKE_TOUR = 10;
  4588. Ue.NO_PICK_UP = 12;
  4589. Ue.NAVIGATOR_SEARCH = 14;
  4590. Ue.DONATE_TO_USER = 24;
  4591. Ue.DONATE_TO_ALL = 25;
  4592. const nE = class {
  4593. constructor(i = -1, e = -1, s = -1, n = "", r = "", o = "", l = null, c = 0, u = 0, h = null, m = null) {
  4594. this.senderId = i, this.senderCategory = e, this.roomId = s, this.text = n, this.formattedText = r, this.username = o, this.location = l, this.type = c, this.styleId = u, this.imageUrl = h, this.color = m, this.id = -1, this.width = 0, this.height = 0, this.elementRef = null, this.skipMovement = !1, this._top = 0, this._left = 0, this.id = ++nE.BUBBLE_COUNTER
  4595. }
  4596. get top() {
  4597. return this._top
  4598. }
  4599. set top(i) {
  4600. this._top = i, this.elementRef && (this.elementRef.style.top = this._top + "px")
  4601. }
  4602. get left() {
  4603. return this._left
  4604. }
  4605. set left(i) {
  4606. this._left = i, this.elementRef && (this.elementRef.style.left = this._left + "px")
  4607. }
  4608. };
  4609. let rE = nE;
  4610. rE.BUBBLE_COUNTER = 0;
  4611. class $s {}
  4612. $s.CHAT_DEFAULT = 0;
  4613. $s.CHAT_WHISPER = 1;
  4614. $s.CHAT_SHOUT = 2;
  4615. class zc {
  4616. constructor(e = 0, s = 0, n = 0, r = 0) {
  4617. this.id = e, this.type = s, this.color = n, this.light = r
  4618. }
  4619. }
  4620. const hA = (i, e, s, n = 0) => !(i.left + n + i.width < e.left + n || i.left + n > e.left + n + e.width || i.top + i.height < e.top + s || i.top > e.top + s + e.height);
  4621. class Ts {
  4622. static savePreset(e, s, n, r, o) {
  4623. Pe().updateMoodlightData(e, s, n, r, o)
  4624. }
  4625. static changeState() {
  4626. Pe().toggleMoodlightState()
  4627. }
  4628. static previewDimmer(e, s, n) {
  4629. X().updateObjectRoomColor(Pe().roomId, e, s, n)
  4630. }
  4631. static scaleBrightness(e) {
  4632. return ~~((e - this.MIN_BRIGHTNESS) * (100 - 0) / (this.MAX_BRIGHTNESS - this.MIN_BRIGHTNESS) + 0)
  4633. }
  4634. }
  4635. Ts.AVAILABLE_COLORS = [7665141, 21495, 15161822, 15353138, 15923281, 8581961, 0];
  4636. Ts.HTML_COLORS = ["#74F5F5", "#0053F7", "#E759DE", "#EA4532", "#F2F851", "#82F349", "#000000"];
  4637. Ts.MIN_BRIGHTNESS = 76;
  4638. Ts.MAX_BRIGHTNESS = 255;
  4639. const mA = 130,
  4640. gA = 100,
  4641. pA = 130,
  4642. fA = 100,
  4643. _A = 130,
  4644. EA = 100,
  4645. oE = i => {
  4646. let e = 0,
  4647. s = 0,
  4648. n = 0,
  4649. r = 0;
  4650. for (; r < i.length;) {
  4651. switch (r % 3) {
  4652. case 0:
  4653. e = e + i.charCodeAt(r) * 37;
  4654. break;
  4655. case 1:
  4656. s = s + i.charCodeAt(r) * 37;
  4657. break;
  4658. case 2:
  4659. n = n + i.charCodeAt(r) * 37;
  4660. break
  4661. }
  4662. r++
  4663. }
  4664. return e = e % gA + mA, s = s % fA + pA, n = n % EA + _A, `rgb(${e},${s},${n})`
  4665. };
  4666. class yr {
  4667. static getMergedMannequinFigureContainer(e, s) {
  4668. const n = Mt().createFigureContainer(e),
  4669. r = Mt().createFigureContainer(s);
  4670. for (const o of this.MANNEQUIN_CLOTHING_PART_TYPES) n.removePart(o);
  4671. for (const o of r.getPartTypeIds()) n.updatePart(o, r.getPartSetId(o), r.getPartColorIds(o));
  4672. return n
  4673. }
  4674. static transformAsMannequinFigure(e) {
  4675. for (const s of e.getPartTypeIds()) this.MANNEQUIN_CLOTHING_PART_TYPES.indexOf(s) >= 0 || e.removePart(s);
  4676. e.updatePart(this.MANNEQUIN_FIGURE[0], this.MANNEQUIN_FIGURE[1], this.MANNEQUIN_FIGURE[2])
  4677. }
  4678. }
  4679. yr.MANNEQUIN_FIGURE = ["hd", 99999, [99998]];
  4680. yr.MANNEQUIN_CLOTHING_PART_TYPES = [st.CHEST_ACCESSORY, st.COAT_CHEST, st.CHEST, st.LEGS, st.SHOES, st.WAIST_ACCESSORY];
  4681. class Ni {}
  4682. Ni.POSTURE_STAND = 0;
  4683. Ni.POSTURE_SIT = 1;
  4684. class vr {
  4685. constructor(e, s, n) {
  4686. this._id = e, this._category = s, this._name = n
  4687. }
  4688. get id() {
  4689. return this._id
  4690. }
  4691. get category() {
  4692. return this._category
  4693. }
  4694. get name() {
  4695. return this._name
  4696. }
  4697. }
  4698. class IA {
  4699. constructor(e, s, n, r, o, l, c) {
  4700. this.id = e, this.category = s, this.name = n, this.requestRoomObjectId = r, this.targetRoomObjectId = o, this.requestInventoryStripId = l, this.replace = c
  4701. }
  4702. }
  4703. const Ri = "0",
  4704. iE = "1";
  4705. function ps(i) {
  4706. B(new Ed(i))
  4707. }
  4708. const Po = i => {
  4709. const e = Math.floor(i / 2);
  4710. return i % 2 ? (e + .5).toString() : e.toString()
  4711. };
  4712. class Se {}
  4713. Se.TOGGLE_FURNI_STATE = 0;
  4714. Se.RESET = 1;
  4715. Se.SET_FURNI_STATE = 3;
  4716. Se.MOVE_FURNI = 4;
  4717. Se.GIVE_SCORE = 6;
  4718. Se.CHAT = 7;
  4719. Se.TELEPORT = 8;
  4720. Se.JOIN_TEAM = 9;
  4721. Se.LEAVE_TEAM = 10;
  4722. Se.CHASE = 11;
  4723. Se.FLEE = 12;
  4724. Se.MOVE_AND_ROTATE_FURNI = 13;
  4725. Se.GIVE_SCORE_TO_PREDEFINED_TEAM = 14;
  4726. Se.TOGGLE_TO_RANDOM_STATE = 15;
  4727. Se.MOVE_FURNI_TO = 16;
  4728. Se.GIVE_REWARD = 17;
  4729. Se.CALL_ANOTHER_STACK = 18;
  4730. Se.KICK_FROM_ROOM = 19;
  4731. Se.MUTE_USER = 20;
  4732. Se.BOT_TELEPORT = 21;
  4733. Se.BOT_MOVE = 22;
  4734. Se.BOT_TALK = 23;
  4735. Se.BOT_GIVE_HAND_ITEM = 24;
  4736. Se.BOT_FOLLOW_AVATAR = 25;
  4737. Se.BOT_CHANGE_FIGURE = 26;
  4738. Se.BOT_TALK_DIRECT_TO_AVTR = 27;
  4739. class Ne {}
  4740. Ne.STATES_MATCH = 0;
  4741. Ne.FURNIS_HAVE_AVATARS = 1;
  4742. Ne.ACTOR_IS_ON_FURNI = 2;
  4743. Ne.TIME_ELAPSED_MORE = 3;
  4744. Ne.TIME_ELAPSED_LESS = 4;
  4745. Ne.USER_COUNT_IN = 5;
  4746. Ne.ACTOR_IS_IN_TEAM = 6;
  4747. Ne.HAS_STACKED_FURNIS = 7;
  4748. Ne.STUFF_TYPE_MATCHES = 8;
  4749. Ne.STUFFS_IN_FORMATION = 9;
  4750. Ne.ACTOR_IS_GROUP_MEMBER = 10;
  4751. Ne.ACTOR_IS_WEARING_BADGE = 11;
  4752. Ne.ACTOR_IS_WEARING_EFFECT = 12;
  4753. Ne.NOT_STATES_MATCH = 13;
  4754. Ne.FURNI_NOT_HAVE_HABBO = 14;
  4755. Ne.NOT_ACTOR_ON_FURNI = 15;
  4756. Ne.NOT_USER_COUNT_IN = 16;
  4757. Ne.NOT_ACTOR_IN_TEAM = 17;
  4758. Ne.NOT_HAS_STACKED_FURNIS = 18;
  4759. Ne.NOT_FURNI_IS_OF_TYPE = 19;
  4760. Ne.NOT_STUFFS_IN_FORMATION = 20;
  4761. Ne.NOT_ACTOR_IN_GROUP = 21;
  4762. Ne.NOT_ACTOR_WEARS_BADGE = 22;
  4763. Ne.NOT_ACTOR_WEARING_EFFECT = 23;
  4764. Ne.DATE_RANGE_ACTIVE = 24;
  4765. Ne.ACTOR_HAS_HANDITEM = 25;
  4766. const Kc = i => `${i.getFullYear()}/${("0"+(i.getMonth()+1)).slice(-2)}/${("0"+i.getDate()).slice(-2)} ${("0"+i.getHours()).slice(-2)}:${("0"+i.getMinutes()).slice(-2)}`;
  4767. class de {}
  4768. de.STUFF_SELECTION_OPTION_NONE = 0;
  4769. de.STUFF_SELECTION_OPTION_BY_ID = 1;
  4770. de.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE = 2;
  4771. de.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT = 3;
  4772. const CA = `
  4773. attribute vec2 aVertexPosition;
  4774. attribute vec2 aTextureCoord;
  4775. uniform mat3 projectionMatrix;
  4776. varying vec2 vTextureCoord;
  4777. void main(void)
  4778. {
  4779. gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
  4780. vTextureCoord = aTextureCoord;
  4781. }`,
  4782. SA = `
  4783. varying vec2 vTextureCoord;
  4784. uniform sampler2D uSampler;
  4785. uniform vec3 lineColor;
  4786. uniform vec3 color;
  4787. void main(void) {
  4788. vec4 currentColor = texture2D(uSampler, vTextureCoord);
  4789. vec3 colorLine = lineColor * currentColor.a;
  4790. vec3 colorOverlay = color * currentColor.a;
  4791. if(currentColor.r == 0.0 && currentColor.g == 0.0 && currentColor.b == 0.0 && currentColor.a > 0.0) {
  4792. gl_FragColor = vec4(colorLine.r, colorLine.g, colorLine.b, currentColor.a);
  4793. } else if(currentColor.a > 0.0) {
  4794. gl_FragColor = vec4(colorOverlay.r, colorOverlay.g, colorOverlay.b, currentColor.a);
  4795. }
  4796. }`;
  4797. class TA extends zI {
  4798. constructor(e, s) {
  4799. super(CA, SA), this.uniforms.lineColor = new Float32Array(3), this.uniforms.color = new Float32Array(3), this.lineColor = e, this.color = s
  4800. }
  4801. get lineColor() {
  4802. return this._lineColor
  4803. }
  4804. set lineColor(e) {
  4805. const s = this.uniforms.lineColor;
  4806. typeof e == "number" ? (Qs.hex2rgb(e, s), this._lineColor = e) : (s[0] = e[0], s[1] = e[1], s[2] = e[2], this._lineColor = Qs.rgb2hex(s))
  4807. }
  4808. get color() {
  4809. return this._color
  4810. }
  4811. set color(e) {
  4812. const s = this.uniforms.color;
  4813. typeof e == "number" ? (Qs.hex2rgb(e, s), this._color = e) : (s[0] = e[0], s[1] = e[1], s[2] = e[2], this._color = Qs.rgb2hex(s))
  4814. }
  4815. }
  4816. const nn = class {
  4817. static show(i) {
  4818. nn.applySelectionShader(nn.getRoomObject(i))
  4819. }
  4820. static hide(i) {
  4821. nn.clearSelectionShader(nn.getRoomObject(i))
  4822. }
  4823. static clearSelectionShaderFromFurni(i) {
  4824. for (const e of i) nn.clearSelectionShader(nn.getRoomObject(e))
  4825. }
  4826. static applySelectionShaderToFurni(i) {
  4827. for (const e of i) nn.applySelectionShader(nn.getRoomObject(e))
  4828. }
  4829. static getRoomObject(i) {
  4830. const e = X();
  4831. return e.getRoomObject(e.activeRoomId, i, re.FLOOR)
  4832. }
  4833. static applySelectionShader(i) {
  4834. if (!i) return;
  4835. const e = i.visualization;
  4836. if (e)
  4837. for (const s of e.sprites) s.blendMode !== 1 && (s.filters = [nn._selectionShader])
  4838. }
  4839. static clearSelectionShader(i) {
  4840. if (!i) return;
  4841. const e = i.visualization;
  4842. if (e)
  4843. for (const s of e.sprites) s.filters = []
  4844. }
  4845. };
  4846. let Ar = nn;
  4847. Ar._selectionShader = new TA([1, 1, 1], [.6, .6, .6]);
  4848. const Hr = " ";
  4849. class ut {}
  4850. ut.AVATAR_SAYS_SOMETHING = 0;
  4851. ut.AVATAR_WALKS_ON_FURNI = 1;
  4852. ut.AVATAR_WALKS_OFF_FURNI = 2;
  4853. ut.EXECUTE_ONCE = 3;
  4854. ut.TOGGLE_FURNI = 4;
  4855. ut.EXECUTE_PERIODICALLY = 6;
  4856. ut.AVATAR_ENTERS_ROOM = 7;
  4857. ut.GAME_STARTS = 8;
  4858. ut.GAME_ENDS = 9;
  4859. ut.SCORE_ACHIEVED = 10;
  4860. ut.COLLISION = 11;
  4861. ut.EXECUTE_PERIODICALLY_LONG = 12;
  4862. ut.BOT_REACHED_STUFF = 13;
  4863. ut.BOT_REACHED_AVATAR = 14;
  4864. const P = i => {
  4865. const {
  4866. ref: e = null,
  4867. innerRef: s = null,
  4868. display: n = null,
  4869. fit: r = !1,
  4870. fitV: o = !1,
  4871. grow: l = !1,
  4872. shrink: c = !1,
  4873. fullWidth: u = !1,
  4874. fullHeight: h = !1,
  4875. overflow: m = null,
  4876. position: p = null,
  4877. float: E = null,
  4878. pointer: _ = !1,
  4879. visible: I = null,
  4880. textColor: C = null,
  4881. classNames: f = [],
  4882. className: S = "",
  4883. style: T = {},
  4884. children: b = null,
  4885. ...y
  4886. } = i, w = a.useMemo(() => {
  4887. const U = [];
  4888. return n && n.length && U.push("d-" + n), (r || u) && U.push("w-100"), (r || h) && U.push("h-100"), o && U.push("vw-100", "vh-100"), l && U.push("flex-grow-1"), c && U.push("flex-shrink-0"), m && U.push("overflow-" + m), p && U.push("position-" + p), E && U.push("float-" + E), _ && U.push("cursor-pointer"), I !== null && U.push(I ? "visible" : "invisible"), C && U.push("text-" + C), f.length && U.push(...f), U
  4889. }, [n, r, o, l, c, u, h, m, p, E, _, I, C, f]), O = a.useMemo(() => {
  4890. let U = w.join(" ");
  4891. return S.length && (U += " " + S), U.trim()
  4892. }, [w, S]), F = a.useMemo(() => {
  4893. let U = {};
  4894. return Object.keys(T).length && (U = {...U,
  4895. ...T
  4896. }), U
  4897. }, [T]);
  4898. return t("div", {
  4899. ref: s,
  4900. className: O,
  4901. style: F,
  4902. ...y,
  4903. children: b
  4904. })
  4905. },
  4906. aE = a.createContext({
  4907. isCssGrid: !1
  4908. }),
  4909. NA = i => t(aE.Provider, {
  4910. value: i.value,
  4911. children: i.children
  4912. }),
  4913. RA = () => a.useContext(aE),
  4914. pe = i => {
  4915. const {
  4916. inline: e = !1,
  4917. gap: s = 2,
  4918. maxContent: n = !1,
  4919. columnCount: r = 0,
  4920. center: o = !1,
  4921. alignSelf: l = null,
  4922. alignItems: c = null,
  4923. justifyContent: u = null,
  4924. fullHeight: h = !0,
  4925. classNames: m = [],
  4926. style: p = {},
  4927. ...E
  4928. } = i, _ = a.useMemo(() => {
  4929. const C = [];
  4930. return e ? C.push("inline-grid") : C.push("grid"), s ? C.push("gap-" + s) : s === 0 && C.push("gap-0"), n && C.push("flex-basis-max-content"), l && C.push("align-self-" + l), c && C.push("align-items-" + c), u && C.push("justify-content-" + u), !c && !u && o && C.push("align-items-center", "justify-content-center"), m.length && C.push(...m), C
  4931. }, [e, s, n, l, c, u, o, m]), I = a.useMemo(() => {
  4932. let C = {};
  4933. return r && (C["--bs-columns"] = r.toString()), Object.keys(p).length && (C = {...C,
  4934. ...p
  4935. }), C
  4936. }, [r, p]);
  4937. return t(NA, {
  4938. value: {
  4939. isCssGrid: !0
  4940. },
  4941. children: t(P, {
  4942. fullHeight: h,
  4943. classNames: _,
  4944. style: I,
  4945. ...E
  4946. })
  4947. })
  4948. },
  4949. qe = i => {
  4950. const {
  4951. columnMinWidth: e = 40,
  4952. columnMaxWidth: s = "1fr",
  4953. columnMinHeight: n = 40,
  4954. columnCount: r = 0,
  4955. fullHeight: o = !1,
  4956. maxContent: l = !0,
  4957. overflow: c = "auto",
  4958. style: u = {},
  4959. ...h
  4960. } = i, m = a.useMemo(() => {
  4961. let p = {};
  4962. return p["--nitro-grid-column-min-height"] = n + "px", r > 1 && (p.gridTemplateColumns = `repeat(auto-fill, minmax(${e}px, ${s}))`), Object.keys(u).length && (p = {...p,
  4963. ...u
  4964. }), p
  4965. }, [e, n, r, u, s]);
  4966. return t(pe, {
  4967. columnCount: r,
  4968. fullHeight: o,
  4969. overflow: c,
  4970. style: m,
  4971. ...h
  4972. })
  4973. },
  4974. zr = i => {
  4975. const {
  4976. classNames: e = [],
  4977. ...s
  4978. } = i, n = a.useMemo(() => {
  4979. const r = ["btn-group gap-1"];
  4980. return e.length && r.push(...e), r
  4981. }, [e]);
  4982. return t(P, {
  4983. classNames: n,
  4984. ...s
  4985. })
  4986. },
  4987. lE = a.createContext({
  4988. closers: null,
  4989. setClosers: null,
  4990. closeAll: null
  4991. }),
  4992. vA = i => t(lE.Provider, {...i
  4993. }),
  4994. bA = () => a.useContext(lE),
  4995. vi = i => {
  4996. const {
  4997. alignItems: e = "center",
  4998. gap: s = 1,
  4999. children: n = null,
  5000. ...r
  5001. } = i;
  5002. return t(R, {
  5003. alignItems: e,
  5004. gap: s,
  5005. ...r,
  5006. children: n
  5007. })
  5008. },
  5009. uo = i => {
  5010. const {
  5011. headerText: e = "",
  5012. isExpanded: s = !1,
  5013. gap: n = 0,
  5014. classNames: r = [],
  5015. children: o = null,
  5016. ...l
  5017. } = i, [c, u] = a.useState(!1), {
  5018. setClosers: h = null,
  5019. closeAll: m = null
  5020. } = bA(), p = () => {
  5021. m(), u(I => !I)
  5022. }, E = a.useCallback(() => u(!1), []), _ = a.useMemo(() => {
  5023. const I = ["nitro-card-accordion-set"];
  5024. return c ? I.push("active") : I.push("flex-shrink-0"), r && r.length && I.push(...r), I
  5025. }, [c, r]);
  5026. return a.useEffect(() => {
  5027. u(s)
  5028. }, [s]), a.useEffect(() => {
  5029. const I = E;
  5030. return h(C => {
  5031. const f = [...C];
  5032. return f.push(I), f
  5033. }), () => {
  5034. h(C => {
  5035. const f = [...C],
  5036. S = f.indexOf(I);
  5037. return S >= 0 && f.splice(S, 1), f
  5038. })
  5039. }
  5040. }, [E, h]), d(v, {
  5041. classNames: _,
  5042. gap: n,
  5043. ...l,
  5044. children: [t(R, {
  5045. pointer: !0,
  5046. justifyContent: "between",
  5047. className: "nitro-card-accordion-set-header px-2 py-1 flex-shrink-0",
  5048. onClick: p,
  5049. children: e
  5050. }), c && t(v, {
  5051. fullHeight: !0,
  5052. overflow: "auto",
  5053. gap: 0,
  5054. className: "nitro-card-accordion-set-content",
  5055. children: o
  5056. })]
  5057. })
  5058. },
  5059. OA = i => {
  5060. const {...e
  5061. } = i, [s, n] = a.useState([]), r = a.useCallback(() => {
  5062. for (const o of s) o()
  5063. }, [s]);
  5064. return t(vA, {
  5065. value: {
  5066. closers: s,
  5067. setClosers: n,
  5068. closeAll: r
  5069. },
  5070. children: t(v, {
  5071. gap: 0,
  5072. ...e
  5073. })
  5074. })
  5075. },
  5076. at = i => {
  5077. const {
  5078. overflow: e = "auto",
  5079. classNames: s = [],
  5080. ...n
  5081. } = i, r = a.useMemo(() => {
  5082. const o = ["container-fluid", "content-area"];
  5083. return s.length && o.push(...s), o
  5084. }, [s]);
  5085. return t(v, {
  5086. classNames: r,
  5087. overflow: e,
  5088. ...n
  5089. })
  5090. };
  5091. a.createContext({
  5092. theme: null
  5093. });
  5094. const wA = i => {
  5095. const {
  5096. justifyContent: e = "center",
  5097. classNames: s = [],
  5098. ...n
  5099. } = i, r = a.useMemo(() => {
  5100. const o = ["container-fluid", "bg-muted", "p-1"];
  5101. return s.length && o.push(...s), o
  5102. }, [s]);
  5103. return t(R, {
  5104. justifyContent: e,
  5105. classNames: r,
  5106. ...n
  5107. })
  5108. },
  5109. en = i => {
  5110. const {
  5111. justifyContent: e = "center",
  5112. gap: s = 0,
  5113. classNames: n = [],
  5114. children: r = null,
  5115. ...o
  5116. } = i, l = a.useMemo(() => {
  5117. const c = ["container-fluid", "nitro-card-tabs"];
  5118. return n.length && c.push(...n), c
  5119. }, [n]);
  5120. return t(R, {
  5121. justifyContent: e,
  5122. gap: s,
  5123. classNames: l,
  5124. ...o,
  5125. children: r
  5126. })
  5127. },
  5128. Vr = (...i) => i.filter(Boolean).join(" "),
  5129. R = i => {
  5130. const {
  5131. display: e = "flex",
  5132. column: s = void 0,
  5133. reverse: n = !1,
  5134. gap: r = null,
  5135. center: o = !1,
  5136. alignSelf: l = null,
  5137. alignItems: c = null,
  5138. justifyContent: u = null,
  5139. classNames: h = [],
  5140. ...m
  5141. } = i, p = a.useMemo(() => {
  5142. const E = [];
  5143. return s ? n ? E.push("flex-column-reverse") : E.push("flex-column") : n && E.push("flex-row-reverse"), r && E.push("gap-" + r), l && E.push("align-self-" + l), c && E.push("align-items-" + c), u && E.push("justify-content-" + u), !c && !u && o && E.push("align-items-center", "justify-content-center"), h.length && E.push(...h), E
  5144. }, [s, n, r, o, l, c, u, h]);
  5145. return t(P, {
  5146. display: e,
  5147. classNames: p,
  5148. ...m
  5149. })
  5150. },
  5151. v = i => {
  5152. const {
  5153. size: e = 0,
  5154. offset: s = 0,
  5155. column: n = !0,
  5156. gap: r = 2,
  5157. classNames: o = [],
  5158. ...l
  5159. } = i, {
  5160. isCssGrid: c = !1
  5161. } = RA(), u = a.useMemo(() => {
  5162. const h = [];
  5163. if (e) {
  5164. let m = `col-${e}`;
  5165. c && (m = `g-${m}`), h.push(m)
  5166. }
  5167. if (s) {
  5168. let m = `offset-${s}`;
  5169. c && (m = `g-start-${s}`), h.push(m)
  5170. }
  5171. return o.length && h.push(...o), h
  5172. }, [e, s, c, o]);
  5173. return t(R, {
  5174. classNames: u,
  5175. column: n,
  5176. gap: r,
  5177. ...l
  5178. })
  5179. };
  5180. class tt {}
  5181. tt.CENTER = "DWP_CENTER";
  5182. tt.TOP_CENTER = "DWP_TOP_CENTER";
  5183. tt.TOP_LEFT = "DWP_TOP_LEFT";
  5184. tt.TOP_RIGHT = "DWP_TOP_RIGHT";
  5185. tt.NOTHING = "DWP_NOTHING";
  5186. tt.BOTTOM_LEFT = "DWP_BTM_LEFT";
  5187. const pn = [],
  5188. $c = new Map,
  5189. Qc = 0,
  5190. Xc = 0,
  5191. vs = i => {
  5192. const {
  5193. uniqueKey: e = null,
  5194. handleSelector: s = ".drag-handler",
  5195. windowPosition: n = tt.CENTER,
  5196. disableDrag: r = !1,
  5197. dragStyle: o = {},
  5198. children: l = null,
  5199. offsetLeft: c = 0,
  5200. offsetTop: u = 0,
  5201. contextRef: h = null,
  5202. modal: m = !1
  5203. } = i, [p, E] = a.useState(null), [_, I] = a.useState(null), [C, f] = a.useState({
  5204. x: 0,
  5205. y: 0
  5206. }), [S, T] = a.useState(!1), [b, y] = a.useState(null), w = a.useRef(), O = a.useRef(), [F, U] = a.useState(!1), j = a.useCallback(() => {
  5207. let ie = 400;
  5208. for (const He of pn) ie += 1, He.style.zIndex = ie.toString()
  5209. }, []), x = a.useCallback(() => {
  5210. const ie = pn.indexOf(O.current);
  5211. if (ie === -1) pn.push(O.current);
  5212. else {
  5213. if (ie === pn.length - 1) return;
  5214. ie >= 0 && (pn.splice(ie, 1), pn.push(O.current))
  5215. }
  5216. j()
  5217. }, [j]), M = a.useCallback(ie => {
  5218. x()
  5219. }, [x]), G = a.useCallback(ie => {
  5220. x()
  5221. }, [x]), H = a.useCallback((ie, He) => {
  5222. f({
  5223. x: ie,
  5224. y: He
  5225. }), T(!0)
  5226. }, []), Y = a.useCallback(ie => {
  5227. H(ie.clientX, ie.clientY)
  5228. }, [H]), q = a.useCallback(ie => {
  5229. const He = ie.touches[0];
  5230. H(He.clientX, He.clientY)
  5231. }, [H]), Z = a.useCallback(ie => {
  5232. E({
  5233. x: ie.clientX - C.x,
  5234. y: ie.clientY - C.y
  5235. })
  5236. }, [C]), ce = a.useCallback(ie => {
  5237. const He = ie.touches[0];
  5238. E({
  5239. x: He.clientX - C.x,
  5240. y: He.clientY - C.y
  5241. })
  5242. }, [C]), se = a.useCallback(() => {
  5243. if (!O.current || !b) return;
  5244. let ie = _.x + p.x,
  5245. He = _.y + p.y;
  5246. const ft = O.current.offsetLeft + ie,
  5247. Ie = O.current.offsetTop + He;
  5248. Ie < Qc ? He = -O.current.offsetTop : Ie + b.offsetHeight >= document.body.offsetHeight - Qc && (He = document.body.offsetHeight - O.current.offsetHeight - O.current.offsetTop), ft + O.current.offsetWidth < Xc ? ie = -O.current.offsetLeft : ft >= document.body.offsetWidth - Xc && (ie = document.body.offsetWidth - O.current.offsetWidth - O.current.offsetLeft), E({
  5249. x: 0,
  5250. y: 0
  5251. }), I({
  5252. x: ie,
  5253. y: He
  5254. }), T(!1), e !== null && $c.set(e, {
  5255. x: ie,
  5256. y: He
  5257. })
  5258. }, [b, p, _, e]), ye = a.useCallback(ie => {
  5259. se()
  5260. }, [se]), me = a.useCallback(ie => {
  5261. se()
  5262. }, [se]);
  5263. a.useEffect(() => {
  5264. w && w.current && (h && (h.current = w.current), O.current = w.current)
  5265. }, [w, O, h]), a.useEffect(() => {
  5266. const ie = O.current;
  5267. if (!ie) return;
  5268. if (pn.push(ie), j(), !r) {
  5269. const Ie = ie.querySelector(s);
  5270. Ie && y(Ie)
  5271. }
  5272. let He = 0,
  5273. ft = 0;
  5274. switch (n) {
  5275. case tt.TOP_CENTER:
  5276. ie.style.top = 5 + u + "px", ie.style.left = `calc(50vw - ${ie.offsetWidth/2+c}px)`;
  5277. break;
  5278. case tt.CENTER:
  5279. ie.style.top = `calc(50vh - ${ie.offsetHeight/2+u}px)`, ie.style.left = `calc(50vw - ${ie.offsetWidth/2+c}px)`;
  5280. break;
  5281. case tt.TOP_LEFT:
  5282. ie.style.top = 5 + u + "px", ie.style.left = 5 + c + "px";
  5283. break;
  5284. case tt.TOP_RIGHT:
  5285. ie.style.top = 5 + u + "px", ie.style.left = window.innerWidth - ie.clientWidth + c + "px";
  5286. break;
  5287. case tt.BOTTOM_LEFT:
  5288. ie.style.top = window.innerHeight - ie.clientHeight - 70 + u + "px", ie.style.left = 5 + c + "px";
  5289. break
  5290. }
  5291. if (e !== null) {
  5292. const Ie = $c.get(e);
  5293. Ie && (He = Ie.x, ft = Ie.y)
  5294. }
  5295. return E({
  5296. x: 0,
  5297. y: 0
  5298. }), I({
  5299. x: He,
  5300. y: ft
  5301. }), () => {
  5302. const Ie = pn.indexOf(ie);
  5303. Ie >= 0 && pn.splice(Ie, 1)
  5304. }
  5305. }, [j, r, n, e, s, u, c]), a.useEffect(() => {
  5306. if (!_ && !p) return;
  5307. const ie = O.current;
  5308. ie && (ie.style.transform = `translate(${_.x+p.x}px, ${_.y+p.y}px)`, ie.style.visibility = "visible", U(!0))
  5309. }, [_, p]), a.useEffect(() => {
  5310. if (b) return b.addEventListener(xe.MOUSE_DOWN, Y), b.addEventListener(Ss.TOUCH_START, q), () => {
  5311. b.removeEventListener(xe.MOUSE_DOWN, Y), b.removeEventListener(Ss.TOUCH_START, q)
  5312. }
  5313. }, [b, Y, q]), a.useEffect(() => {
  5314. if (S) return document.addEventListener(xe.MOUSE_UP, ye), document.addEventListener(Ss.TOUCH_END, me), document.addEventListener(xe.MOUSE_MOVE, Z), document.addEventListener(Ss.TOUCH_MOVE, ce), () => {
  5315. document.removeEventListener(xe.MOUSE_UP, ye), document.removeEventListener(Ss.TOUCH_END, me), document.removeEventListener(xe.MOUSE_MOVE, Z), document.removeEventListener(Ss.TOUCH_MOVE, ce)
  5316. }
  5317. }, [S, ye, Z, me, ce]);
  5318. let lt = t(P, {
  5319. position: "absolute",
  5320. innerRef: w,
  5321. className: "draggable-window",
  5322. onMouseDownCapture: M,
  5323. onTouchStartCapture: G,
  5324. style: {
  5325. visibility: F ? "visible" : "hidden",
  5326. ...o
  5327. },
  5328. children: l
  5329. });
  5330. return m && (lt = t(R, {
  5331. className: "alert-bg top-0 bottom-0 start-0 end-0 bg-black bg-opacity-75",
  5332. position: "absolute",
  5333. alignItems: "center",
  5334. justifyContent: "center",
  5335. children: lt
  5336. })), vo.createPortal(lt, document.getElementById("draggable-windows-container"))
  5337. },
  5338. yA = i => {
  5339. const {
  5340. classNames: e = [],
  5341. ...s
  5342. } = i, n = a.useMemo(() => {
  5343. const r = ["form-group"];
  5344. return e.length && r.push(...e), r
  5345. }, [e]);
  5346. return t(R, {
  5347. classNames: n,
  5348. ...s
  5349. })
  5350. },
  5351. AA = i => {
  5352. const {
  5353. variant: e = "black",
  5354. height: s = 1,
  5355. classNames: n = [],
  5356. style: r = {},
  5357. ...o
  5358. } = i, l = a.useMemo(() => {
  5359. const u = [];
  5360. return e && u.push("bg-" + e), n.length && u.push(...n), u
  5361. }, [e, n]), c = a.useMemo(() => {
  5362. let u = {
  5363. display: "list-item"
  5364. };
  5365. return s > 0 && (u.height = s), Object.keys(r).length && (u = {...u,
  5366. ...r
  5367. }), u
  5368. }, [s, r]);
  5369. return t(P, {
  5370. classNames: l,
  5371. style: c,
  5372. ...o
  5373. })
  5374. },
  5375. xi = i => {
  5376. var I, C;
  5377. const {
  5378. rows: e = [],
  5379. overscan: s = 5,
  5380. scrollToBottom: n = !1,
  5381. rowRender: r = null,
  5382. className: o = ""
  5383. } = i, [l, c] = a.useState(e.length - 1), u = a.useRef(null), {
  5384. virtualItems: h = [],
  5385. totalSize: m = 0,
  5386. scrollToIndex: p = null
  5387. } = LI({
  5388. parentRef: u,
  5389. size: e.length,
  5390. overscan: s
  5391. }), E = h.length > 0 && ((I = h == null ? void 0 : h[0]) == null ? void 0 : I.start) || 0, _ = h.length > 0 ? m - (((C = h == null ? void 0 : h[h.length - 1]) == null ? void 0 : C.end) || 0) : 0;
  5392. return a.useEffect(() => {
  5393. n && p(l)
  5394. }, [n, l, p]), d(P, {
  5395. fit: !0,
  5396. innerRef: u,
  5397. position: "relative",
  5398. overflow: "auto",
  5399. className: o,
  5400. children: [E > 0 && t("div", {
  5401. style: {
  5402. minHeight: `${E}px`
  5403. }
  5404. }), h.map(f => {
  5405. const S = e[f.index];
  5406. return S ? t("div", {
  5407. "data-index": f.index,
  5408. ref: f.measureRef,
  5409. children: r(S)
  5410. }, f.key) : t(a.Fragment, {}, f.key)
  5411. }), _ > 0 && t("div", {
  5412. style: {
  5413. minHeight: `${_}px`
  5414. }
  5415. })]
  5416. })
  5417. },
  5418. it = i => {
  5419. const {
  5420. figure: e = "",
  5421. gender: s = "M",
  5422. headOnly: n = !1,
  5423. direction: r = 0,
  5424. scale: o = 1,
  5425. classNames: l = [],
  5426. style: c = {},
  5427. ...u
  5428. } = i, [h, m] = a.useState(null), [p, E] = a.useState(-1), _ = a.useRef(!1), I = a.useMemo(() => {
  5429. const f = ["avatar-image"];
  5430. return l.length && f.push(...l), f
  5431. }, [l]), C = a.useMemo(() => {
  5432. let f = {};
  5433. return h && h.length && (f.backgroundImage = `url('${h}')`), o !== 1 && (f.transform = `scale(${o})`, o % 1 || (f.imageRendering = "pixelated")), Object.keys(c).length && (f = {...f,
  5434. ...c
  5435. }), f
  5436. }, [h, o, c]);
  5437. return a.useEffect(() => {
  5438. const f = Mt().createAvatarImage(e, hl.LARGE, s, {
  5439. resetFigure: b => {
  5440. _.current || E(Math.random())
  5441. },
  5442. dispose: () => {},
  5443. disposed: !1
  5444. }, null);
  5445. if (!f) return;
  5446. let S = fi.FULL;
  5447. n && (S = fi.HEAD), f.setDirection(S, r);
  5448. const T = f.getCroppedImage(S);
  5449. T && m(T.src), f.dispose()
  5450. }, [e, s, r, n, p]), a.useEffect(() => (_.current = !1, () => {
  5451. _.current = !0
  5452. }), []), t(P, {
  5453. classNames: I,
  5454. style: C,
  5455. ...u
  5456. })
  5457. },
  5458. kA = i => {
  5459. const {
  5460. imageUrl: e = null,
  5461. fit: s = !0,
  5462. style: n = null,
  5463. ...r
  5464. } = i, o = a.useMemo(() => {
  5465. const l = {...n
  5466. };
  5467. return e && (l.background = `url(${e}) center no-repeat`), l
  5468. }, [n, e]);
  5469. return t(P, {
  5470. fit: s,
  5471. style: o,
  5472. ...r
  5473. })
  5474. },
  5475. ot = i => {
  5476. const {
  5477. badgeCode: e = null,
  5478. isGroup: s = !1,
  5479. showInfo: n = !1,
  5480. customTitle: r = null,
  5481. isGrayscale: o = !1,
  5482. scale: l = 1,
  5483. classNames: c = [],
  5484. style: u = {},
  5485. children: h = null,
  5486. localIndex: m = -1,
  5487. ...p
  5488. } = i, [E, _] = a.useState(null), [I, C] = a.useState(!1), f = a.useMemo(() => {
  5489. const T = ["badge-image"];
  5490. return s && T.push("group-badge"), o && T.push("grayscale"), c.length && T.push(...c), I || T.push("icon loading-icon"), T
  5491. }, [s, o, c, I]), S = a.useMemo(() => {
  5492. let T = {};
  5493. return E && I && (T.backgroundImage = `url(${s?E.src:ee("badge.asset.url").replace("%badgename%",e.toString())})`, l !== 1 && (T.transform = `scale(${l})`, l % 1 || (T.imageRendering = "pixelated"), T.width = E.width * l, T.height = E.height * l)), Object.keys(u).length && (T = {...T,
  5494. ...u
  5495. }), T
  5496. }, [e, E, s, I, l, u]);
  5497. return a.useEffect(() => {
  5498. if (!e || !e.length) return;
  5499. let T = !1;
  5500. const b = w => {
  5501. if (w.badgeId !== e) return;
  5502. const O = ln.generateImage(new pi(w.image));
  5503. O.onload = () => {
  5504. _(O), C(!0)
  5505. }, T = !0, J().events.removeEventListener(ta.IMAGE_READY, b)
  5506. };
  5507. return (() => {
  5508. J().events.addEventListener(ta.IMAGE_READY, b);
  5509. const w = s ? J().getGroupBadgeImage(e) : J().getBadgeImage(e);
  5510. if (w && !T) {
  5511. const O = ln.generateImage(new pi(w));
  5512. O.onload = () => {
  5513. _(O), C(!0)
  5514. }
  5515. }
  5516. })(), () => J().events.removeEventListener(ta.IMAGE_READY, b)
  5517. }, [e, s, m]), d(P, {
  5518. classNames: f,
  5519. style: S,
  5520. ...p,
  5521. children: [n && ee("badge.descriptions.enabled", !0) && d(P, {
  5522. className: "badge-information text-black py-1 px-2",
  5523. children: [t("div", {
  5524. className: "volter-bold mb-1",
  5525. children: s ? r : yo(e)
  5526. }), t("div", {
  5527. children: s ? g("group.badgepopup.body") : Yl(e)
  5528. })]
  5529. }), h]
  5530. })
  5531. },
  5532. MA = i => {
  5533. const {
  5534. day: e = "00",
  5535. hour: s = "00",
  5536. minutes: n = "00",
  5537. seconds: r = "00",
  5538. classNames: o = [],
  5539. children: l = null,
  5540. ...c
  5541. } = i, u = a.useMemo(() => {
  5542. const h = ["nitro-counter-time"];
  5543. return o.length && h.push(...o), h
  5544. }, [o]);
  5545. return d(R, {
  5546. gap: 1,
  5547. children: [t(P, {
  5548. classNames: u,
  5549. ...c,
  5550. children: d("div", {
  5551. children: [e != "00" ? e : s, e != "00" ? g("countdown_clock_unit_days") : g("countdown_clock_unit_hours")]
  5552. })
  5553. }), t(P, {
  5554. style: {
  5555. marginTop: "3px"
  5556. },
  5557. children: ":"
  5558. }), t(P, {
  5559. classNames: u,
  5560. ...c,
  5561. children: d("div", {
  5562. children: [n, g("countdown_clock_unit_minutes")]
  5563. })
  5564. }), t(P, {
  5565. style: {
  5566. marginTop: "3px"
  5567. },
  5568. children: ":"
  5569. }), t(P, {
  5570. classNames: u,
  5571. ...c,
  5572. children: d("div", {
  5573. children: [r, g("countdown_clock_unit_seconds")]
  5574. })
  5575. }), l]
  5576. })
  5577. },
  5578. wt = i => {
  5579. const {
  5580. type: e = "",
  5581. classNames: s = [],
  5582. style: n = {},
  5583. ...r
  5584. } = i, o = a.useMemo(() => {
  5585. const u = ["nitro-currency-icon"];
  5586. return s.length && u.push(...s), u
  5587. }, [s]), l = a.useMemo(() => {
  5588. let u = ee("currency.asset.icon.url", "");
  5589. return u = u.replace("%type%", e.toString()), `url(${u})`
  5590. }, [e]), c = a.useMemo(() => {
  5591. let u = {};
  5592. return u.backgroundImage = l, Object.keys(n).length && (u = {...u,
  5593. ...n
  5594. }), u
  5595. }, [n, l]);
  5596. return t(P, {
  5597. classNames: o,
  5598. style: c,
  5599. ...r
  5600. })
  5601. },
  5602. cE = i => {
  5603. const {
  5604. productType: e = "s",
  5605. productClassId: s = -1,
  5606. extraData: n = "",
  5607. ...r
  5608. } = i;
  5609. return t(yn, {
  5610. imageUrl: D_(e, s, n),
  5611. className: "furni-image",
  5612. ...r
  5613. })
  5614. },
  5615. bi = i => {
  5616. const {
  5617. productType: e = "s",
  5618. productClassId: s = -1,
  5619. direction: n = 2,
  5620. extraData: r = "",
  5621. scale: o = 1,
  5622. style: l = {},
  5623. state: c = -1,
  5624. ...u
  5625. } = i, [h, m] = a.useState(null), p = a.useMemo(() => {
  5626. var _;
  5627. let E = {};
  5628. return (_ = h == null ? void 0 : h.src) != null && _.length && (E.backgroundImage = `url('${h.src}')`, E.width = h.width, E.height = h.height), o !== 1 && (E.transform = `scale(${o})`, o % 1 || (E.imageRendering = "pixelated")), Object.keys(l).length && (E = {...E,
  5629. ...l
  5630. }), E
  5631. }, [h, o, l]);
  5632. return a.useEffect(() => {
  5633. let E = null;
  5634. const _ = {
  5635. imageReady: (I, C, f) => {
  5636. !f && C && (f = ln.generateImage(C)), f.onload = () => m(f)
  5637. },
  5638. imageFailed: null
  5639. };
  5640. switch (e.toLocaleLowerCase()) {
  5641. case Ce.FLOOR:
  5642. E = X().getFurnitureFloorImage(s, new Lt(n), 64, _, 0, r, c);
  5643. break;
  5644. case Ce.WALL:
  5645. E = X().getFurnitureWallImage(s, new Lt(n), 64, _, 0, r, c);
  5646. break
  5647. }
  5648. if (E) {
  5649. const I = E.getImage();
  5650. I.onload = () => m(I)
  5651. }
  5652. }, [e, s, n, r, c]), h ? t(P, {
  5653. classNames: ["furni-image"],
  5654. style: p,
  5655. ...u
  5656. }) : null
  5657. },
  5658. uE = i => {
  5659. const {
  5660. figure: e = null,
  5661. userName: s = null,
  5662. message: n = null,
  5663. editable: r = !1,
  5664. onChange: o = null
  5665. } = i;
  5666. return d(R, {
  5667. overflow: "hidden",
  5668. className: "nitro-gift-card text-black",
  5669. children: [d("div", {
  5670. className: "d-flex align-items-center justify-content-center gift-face flex-shrink-0",
  5671. children: [!s && t("div", {
  5672. className: "gift-incognito"
  5673. }), e && t("div", {
  5674. className: "gift-avatar",
  5675. children: t(it, {
  5676. figure: e,
  5677. direction: 2,
  5678. headOnly: !0
  5679. })
  5680. })]
  5681. }), t(R, {
  5682. overflow: "hidden",
  5683. className: "w-100 pt-4 pb-4 pe-4 ps-3",
  5684. children: d(v, {
  5685. grow: !0,
  5686. overflow: "auto",
  5687. justifyContent: "between",
  5688. children: [!r && t(N, {
  5689. textBreak: !0,
  5690. className: "gift-message",
  5691. children: n
  5692. }), r && o !== null && t("textarea", {
  5693. className: "gift-message h-100",
  5694. maxLength: 140,
  5695. value: n,
  5696. onChange: l => o(l.target.value),
  5697. placeholder: g("catalog.gift_wrapping_new.message_hint")
  5698. }), s && t(N, {
  5699. italics: !0,
  5700. textEnd: !0,
  5701. className: "pe-1 volter-bold",
  5702. children: g("catalog.gift_wrapping_new.message_from", ["name"], [s])
  5703. })]
  5704. })
  5705. })]
  5706. })
  5707. },
  5708. Do = i => {
  5709. const {
  5710. count: e = 0,
  5711. position: s = "absolute",
  5712. classNames: n = [],
  5713. children: r = null,
  5714. ...o
  5715. } = i, l = a.useMemo(() => {
  5716. const c = ["badge", "border", "border-black", "bg-danger", "px-1", "nitro-item-count"];
  5717. return n.length && c.push(...n), c
  5718. }, [n]);
  5719. return d(P, {
  5720. position: "absolute",
  5721. classNames: l,
  5722. ...o,
  5723. children: [e, r]
  5724. })
  5725. },
  5726. lr = i => {
  5727. const {
  5728. value: e = 0
  5729. } = i, s = e.toString().split("");
  5730. return t(z, {
  5731. children: s.map((n, r) => t("i", {
  5732. className: "limited-edition-number n-" + n
  5733. }, r))
  5734. })
  5735. },
  5736. dE = i => {
  5737. const {
  5738. uniqueNumber: e = 0,
  5739. uniqueSeries: s = 0,
  5740. classNames: n = [],
  5741. children: r = null,
  5742. ...o
  5743. } = i, l = a.useMemo(() => {
  5744. const c = ["unique-compact-plate", "z-index-1"];
  5745. return n.length && c.push(...n), c
  5746. }, [n]);
  5747. return d(P, {
  5748. classNames: l,
  5749. ...o,
  5750. children: [t("div", {
  5751. children: t(lr, {
  5752. value: e
  5753. })
  5754. }), t("div", {
  5755. children: t(lr, {
  5756. value: s
  5757. })
  5758. }), r]
  5759. })
  5760. },
  5761. UA = i => {
  5762. const {
  5763. uniqueLimitedItemsLeft: e = 0,
  5764. uniqueLimitedSeriesSize: s = 0,
  5765. classNames: n = [],
  5766. ...r
  5767. } = i, o = a.useMemo(() => {
  5768. const l = ["unique-complete-plate"];
  5769. return n.length && l.push(...n), l
  5770. }, [n]);
  5771. return t(P, {
  5772. classNames: o,
  5773. ...r,
  5774. children: d(v, {
  5775. className: "plate-container",
  5776. gap: 0,
  5777. children: [d(R, {
  5778. justifyContent: "between",
  5779. alignItems: "center",
  5780. children: [g("unique.items.left"), t("div", {
  5781. children: t(lr, {
  5782. value: e
  5783. })
  5784. })]
  5785. }), d(R, {
  5786. justifyContent: "between",
  5787. alignItems: "center",
  5788. children: [g("unique.items.number.sold"), t("div", {
  5789. children: t(lr, {
  5790. value: s
  5791. })
  5792. })]
  5793. })]
  5794. })
  5795. })
  5796. },
  5797. Rn = i => {
  5798. const {
  5799. itemImage: e = void 0,
  5800. itemColor: s = void 0,
  5801. itemActive: n = !1,
  5802. itemCount: r = 1,
  5803. itemCountMinimum: o = 1,
  5804. itemUniqueSoldout: l = !1,
  5805. itemUniqueNumber: c = -2,
  5806. itemUnseen: u = !1,
  5807. itemHighlight: h = !1,
  5808. disabled: m = !1,
  5809. center: p = !0,
  5810. column: E = !0,
  5811. style: _ = {},
  5812. classNames: I = [],
  5813. position: C = "relative",
  5814. overflow: f = "hidden",
  5815. children: S = null,
  5816. background: T = !0,
  5817. ...b
  5818. } = i, y = a.useMemo(() => {
  5819. const O = ["layout-grid-item"];
  5820. return T && O.push("border", "border-2", "border-muted"), n && O.push("active"), (l || c > 0) && O.push("unique-item"), l && O.push("sold-out"), u && O.push("unseen"), h && O.push("has-highlight"), m && O.push("disabled"), e === null && O.push("icon", "loading-icon"), I.length && O.push(...I), O
  5821. }, [n, l, c, u, h, m, e, I]), w = a.useMemo(() => {
  5822. let O = {..._
  5823. };
  5824. return e && !(l || c > 0) && (O.backgroundImage = `url(${e})`), s && (O.backgroundColor = s), Object.keys(_).length && (O = {...O,
  5825. ..._
  5826. }), O
  5827. }, [_, e, s, l, c]);
  5828. return d(v, {
  5829. center: p,
  5830. pointer: !0,
  5831. position: C,
  5832. overflow: f,
  5833. column: E,
  5834. classNames: y,
  5835. style: w,
  5836. ...b,
  5837. children: [r > o && t(Do, {
  5838. count: r
  5839. }), c > 0 && d(z, {
  5840. children: [t(P, {
  5841. fit: !0,
  5842. className: "unique-bg-override",
  5843. style: {
  5844. backgroundImage: `url(${e})`
  5845. }
  5846. }), t("div", {
  5847. className: "position-absolute bottom-0 unique-item-counter",
  5848. children: t(lr, {
  5849. value: c
  5850. })
  5851. })]
  5852. }), S]
  5853. })
  5854. },
  5855. yn = i => {
  5856. const {
  5857. imageUrl: e = null,
  5858. className: s = "",
  5859. ...n
  5860. } = i;
  5861. return t("img", {
  5862. src: e,
  5863. className: "no-select " + s,
  5864. alt: "",
  5865. ...n
  5866. })
  5867. },
  5868. hE = i => {
  5869. const {...e
  5870. } = i;
  5871. return d(P, {
  5872. classNames: ["spinner-container"],
  5873. ...e,
  5874. children: [t(P, {
  5875. className: "spinner"
  5876. }), t(P, {
  5877. className: "spinner"
  5878. }), t(P, {
  5879. className: "spinner"
  5880. })]
  5881. })
  5882. },
  5883. br = new Map,
  5884. er = document.createElement("canvas");
  5885. async function vn(i, e, s = 0, n = "#000") {
  5886. let r = `${i}-${e}-${n}-${s}`;
  5887. return br.get(r) ? br.get(r) : new Promise((o, l) => {
  5888. let c = new Image;
  5889. c.onload = () => o(LA(c, e, s, n)), c.onerror = l, c.src = i
  5890. })
  5891. }
  5892. function Jc(i, e, s, n) {
  5893. s != null && (s.r == null || s.g == null || s.b == null || (i[e] = (s == null ? void 0 : s.r) - (i[e] < 255 ? 255 - i[e] : 0), i[e + 1] = (s == null ? void 0 : s.g) - (i[e + 1] < 255 ? 255 - i[e + 1] : 0), i[e + 2] = (s == null ? void 0 : s.b) - (i[e + 2] < 255 ? 255 - i[e + 2] : 0), i[e + 3] = 255 - n))
  5894. }
  5895. function LA(i, e, s = 0, n = "#000") {
  5896. let r = `${i.src}-${e}-${n}-${s}`;
  5897. const o = er.getContext("2d", {
  5898. willReadFrequently: !0
  5899. });
  5900. if (br.get(r)) return br.get(r);
  5901. er.width = i.width, er.height = i.height, o.drawImage(i, 0, 0);
  5902. const l = o.getImageData(0, 0, er.width, er.height, {});
  5903. let c = Zc(e);
  5904. const u = Zc(n);
  5905. if (!c) return er.toDataURL();
  5906. for (let h = 0; h < l.data.length; h += 4) l.data[h] + l.data[h + 1] + l.data[h + 2] + l.data[h + 2] !== 0 ? n !== "#000" && l.data[h] <= 255 * 2 / 3 ? (l.data[h] = l.data[h] + 127, l.data[h + 1] = l.data[h + 1] + 127, l.data[h + 2] = l.data[h + 2] + 127, Jc(l.data, h, u, s)) : Jc(l.data, h, c, s) : l.data[h + 3] != 0 && s && (l.data[h + 3] = 255 - s);
  5907. return o.putImageData(l, 0, 0), br.set(r, er.toDataURL()), br.get(r)
  5908. }
  5909. function Zc(i) {
  5910. var e = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(i);
  5911. return e ? {
  5912. r: parseInt(e[1], 16),
  5913. g: parseInt(e[2], 16),
  5914. b: parseInt(e[3], 16)
  5915. } : null
  5916. }
  5917. function ga(i) {
  5918. var e = i.toString(16);
  5919. return e.length == 1 ? "0" + e : e
  5920. }
  5921. function PA(i, e, s) {
  5922. return "#" + ga(parseInt(i)) + ga(parseInt(e)) + ga(parseInt(s))
  5923. }
  5924. function Gi(i, e) {
  5925. let s = "";
  5926. var n = Array.prototype.forEach.call.bind(Array.prototype.forEach);
  5927. return n(document.styleSheets, function(r, o) {
  5928. n(r.cssRules || r.rules, function(l) {
  5929. l instanceof CSSStyleRule && l.selectorText == i && (s = l.style[e])
  5930. })
  5931. }), s
  5932. }
  5933. const D = i => {
  5934. let {
  5935. skin: e = 0,
  5936. colour: s = "#FFFFFF",
  5937. opacity: n = 0,
  5938. innerRef: r,
  5939. disabled: o = !1,
  5940. classNames: l = [],
  5941. ...c
  5942. } = i;
  5943. const u = a.useRef(),
  5944. h = a.useRef(),
  5945. [m, p] = a.useState(!1),
  5946. E = a.useMemo(() => {
  5947. const C = ["ton-button", "cursor-pointer"];
  5948. return l.length && C.push(...l), o && C.push("disabled"), C
  5949. }, [l, o]),
  5950. _ = a.useCallback((C, f = !1, S = !1) => C && !C.current ? null : Gi('.ton-button[data-style="' + e + '"]' + (f ? ":hover" : "") + (S ? ":active" : ""), "border-image-source").replace('url("', "").replace('")', ""), [e]),
  5951. I = a.useCallback((C = !1, f = !1) => {
  5952. h && h.current && vn(_(h, C, f), s, n).then(S => {
  5953. h.current.style.borderImageSource = `url(${S})`, p(!0)
  5954. }).catch(() => {
  5955. console.log("missing image plz report")
  5956. })
  5957. }, [h, s, n, p, _]);
  5958. return a.useEffect(() => {
  5959. u && u.current && (r && (r.current = u.current), h.current = u.current)
  5960. }, [u, h, r]), a.useEffect(() => {
  5961. h && h.current && I()
  5962. }, [I]), t(P, {
  5963. innerRef: u,
  5964. "data-style": e,
  5965. classNames: E,
  5966. visible: !!m,
  5967. onMouseOver: () => I(!0),
  5968. onMouseOut: () => I(),
  5969. onMouseDown: () => I(!1, !0),
  5970. onMouseUp: () => I(),
  5971. ...c
  5972. })
  5973. },
  5974. DA = i => {
  5975. const {
  5976. roomId: e = -1,
  5977. textureReceiver: s = null,
  5978. onClose: n = null
  5979. } = i, r = a.useRef(), o = () => {
  5980. if (!r || !r.current) return null;
  5981. const c = r.current.getBoundingClientRect();
  5982. return new Id(Math.floor(c.x), Math.floor(c.y), Math.floor(c.width), Math.floor(c.height))
  5983. }, l = () => {
  5984. Fs(cs.CAMERA_SHUTTER), s(X().createTextureFromRoom(e, 1, o()))
  5985. };
  5986. return t(vs, {
  5987. handleSelector: ".nitro-room-thumbnail-camera",
  5988. children: d("div", {
  5989. className: "nitro-room-thumbnail-camera px-2",
  5990. children: [t("div", {
  5991. ref: r,
  5992. className: "camera-frame"
  5993. }), d("div", {
  5994. className: "d-flex align-items-end h-100 pb-2",
  5995. children: [t(D, {
  5996. className: "btn btn-sm btn-danger w-100 mb-1 me-2",
  5997. onClick: n,
  5998. children: g("cancel")
  5999. }), t(D, {
  6000. className: "btn btn-sm btn-success w-100 mb-1",
  6001. onClick: l,
  6002. children: g("navigator.thumbeditor.save")
  6003. })]
  6004. })]
  6005. })
  6006. })
  6007. };
  6008. class L {}
  6009. L.primary_blue = "#398cae";
  6010. L.catalog_search_blue = "#376c84";
  6011. L.message_light_blue = "#aad7dd";
  6012. L.primary_grey = "#6b6861";
  6013. L.secondary_grey = "#46433e";
  6014. L.light_grey = "#cbcbcb";
  6015. L.lighter_grey = "#E5E5E5";
  6016. L.tertiary_grey = "#656159";
  6017. L.quaternary_grey = "#33322b";
  6018. L.infostand_light_grey = "#6C6B6B";
  6019. L.catalog_tab_inactive_grey = "#969699";
  6020. L.green = "#99ff66";
  6021. L.white = "#FFFFFF";
  6022. L.black = "#000000";
  6023. L.primary_green = "#668a1e";
  6024. L.secondary_green = "#9cbe59";
  6025. L.primary_yellow = "#ffcb00";
  6026. L.secondary_yellow = "#d1ab00";
  6027. L.lighter_yellow = "#ffdd58";
  6028. L.club_yellow = "#ffca01";
  6029. L.primary_red = "#C73C3C";
  6030. L.dark_red = "#470e11";
  6031. L.moodlight_green = "#6dea4c";
  6032. L.maintenance_orange = "#FA6203";
  6033. L.maintenance_orange_light = "#ff8c45";
  6034. L.tutorial_purple = "#E0BBE4";
  6035. const zn = (i, e, s, n = !0) => {
  6036. a.useEffect(() => {
  6037. if (n) return Array.isArray(i) ? i.map(r => e.addEventListener(r, s)) : e.addEventListener(i, s), () => {
  6038. Array.isArray(i) ? i.map(r => e.removeEventListener(r, s)) : e.removeEventListener(i, s)
  6039. }
  6040. }, [i, e, n, s])
  6041. },
  6042. eu = (i, e) => zn(i, dy().events, e),
  6043. FA = (i, e) => zn(i, _e().cameraManager.events, e),
  6044. xA = (i, e) => zn(i, _e().localization.events, e),
  6045. fn = (i, e) => zn(i, _e().events, e),
  6046. ke = (i, e) => zn(i, X().events, e),
  6047. $e = (i, e) => zn(i, ur().events, e),
  6048. nr = (i, e, s = !0) => zn(i, _e().soundManager.events, e, s),
  6049. W = (i, e) => {
  6050. a.useEffect(() => {
  6051. const s = new i(e);
  6052. return Lr().registerMessageEvent(s), () => Lr().removeMessageEvent(s)
  6053. }, [i, e])
  6054. },
  6055. ct = (i, e, s = !0) => zn(i, cn, e, s),
  6056. GA = () => {
  6057. const [i, e] = a.useState(!0), [s, n] = a.useState([]), [r, o] = a.useState(null), [l, c] = a.useState(-1), [u, h] = a.useState(0), m = a.useMemo(() => {
  6058. let S = 0;
  6059. return s.forEach(T => S += ms.getAchievementCategoryTotalUnseen(T)), S
  6060. }, [s]), p = a.useMemo(() => {
  6061. let S = 0;
  6062. return s.forEach(T => S += T.getProgress()), S
  6063. }, [s]), E = a.useMemo(() => {
  6064. let S = 0;
  6065. return s.forEach(T => S += T.getMaxProgress()), S
  6066. }, [s]), _ = a.useMemo(() => ~~((p - 0) * (100 - 0) / (E - 0) + 0), [p, E]), I = a.useMemo(() => r === null ? null : s.find(S => S.code === r), [s, r]), C = a.useMemo(() => l === -1 || !I ? null : I.achievements.find(S => S.achievementId === l), [I, l]), f = a.useCallback((S, T) => {
  6067. n(b => {
  6068. const y = [...b];
  6069. for (const w of y)
  6070. if (w.code === S)
  6071. for (const O of w.achievements) O.achievementId === T && (O.unseen = 0);
  6072. return y
  6073. })
  6074. }, []);
  6075. return W(Cd, S => {
  6076. const b = S.getParser().achievement;
  6077. n(y => {
  6078. const w = [...y],
  6079. O = w.findIndex(F => F.code === b.category);
  6080. if (O === -1) {
  6081. const F = new Pc(b.category);
  6082. F.achievements.push(b), w.push(F)
  6083. } else {
  6084. const F = ts(w[O]),
  6085. U = [...F.achievements],
  6086. j = U.findIndex(M => M.achievementId === b.achievementId);
  6087. let x = null;
  6088. j === -1 ? U.push(b) : (x = U[j], U[j] = b), !ms.getAchievementIsIgnored(b) && b.achievementId !== l && (b.unseen++, x && (b.unseen += x.unseen)), F.achievements = U, w[O] = F
  6089. }
  6090. return w
  6091. })
  6092. }), W(Sd, S => {
  6093. const T = S.getParser(),
  6094. b = [];
  6095. for (const y of T.achievements) {
  6096. const w = y.category;
  6097. let O = b.find(F => F.code === w);
  6098. O || (O = new Pc(w), b.push(O)), O.achievements.push(y)
  6099. }
  6100. n(b)
  6101. }), W(Td, S => {
  6102. const T = S.getParser();
  6103. h(T.score)
  6104. }), a.useEffect(() => {
  6105. i && (B(new Nd), e(!1))
  6106. }, [i]), a.useEffect(() => {
  6107. !r || l === -1 || f(r, l)
  6108. }, [r, l, f]), {
  6109. achievementCategories: s,
  6110. selectedCategoryCode: r,
  6111. setSelectedCategoryCode: o,
  6112. selectedAchievementId: l,
  6113. setSelectedAchievementId: c,
  6114. achievementScore: u,
  6115. getTotalUnseen: m,
  6116. getProgress: p,
  6117. getMaxProgress: E,
  6118. scaledProgressPercent: _,
  6119. selectedCategory: I,
  6120. selectedAchievement: C,
  6121. setAchievementSeen: f
  6122. }
  6123. },
  6124. Bi = () => Qe(GA),
  6125. BA = () => {
  6126. const [i, e] = a.useState([]), [s, n] = a.useState([]), [r, o] = a.useState(-1), [l, c] = a.useState(10), [u, h] = a.useState(null);
  6127. return FA(KI.INITIALIZED, m => {
  6128. e(Array.from(co().effects.values()))
  6129. }), W(Rd, m => {
  6130. const p = m.getParser();
  6131. h({
  6132. credits: p.creditPrice,
  6133. duckets: p.ducketPrice,
  6134. publishDucketPrice: p.publishDucketPrice
  6135. })
  6136. }), a.useEffect(() => {
  6137. if (!co().isLoaded) {
  6138. co().init(), B(new vd);
  6139. return
  6140. }
  6141. }, []), {
  6142. availableEffects: i,
  6143. cameraRoll: s,
  6144. setCameraRoll: n,
  6145. selectedPictureIndex: r,
  6146. setSelectedPictureIndex: o,
  6147. myLevel: l,
  6148. price: u
  6149. }
  6150. },
  6151. mE = () => Qe(BA);
  6152. class Wn {}
  6153. Wn.POST_NEWS = "post_news";
  6154. Wn.DELETE_NEWS = "delete_news";
  6155. Wn.POST_UNAPPROVED_NEWS = "post_unapproved_news";
  6156. Wn.FETCH_UNAPPROVED_NEWS = "fetch_unapproved_news";
  6157. Wn.CREATE_NEWS_CATEGORIES = "create_news_categories";
  6158. Wn.BLOCK_VPN = "block_vpn";
  6159. const io = "...",
  6160. Jo = (i, e) => {
  6161. let s = e - i + 1;
  6162. return Array.from({
  6163. length: s
  6164. }, (n, r) => r + i)
  6165. },
  6166. HA = ({
  6167. totalCount: i,
  6168. pageSize: e,
  6169. siblingCount: s = 1,
  6170. currentPage: n
  6171. }) => a.useMemo(() => {
  6172. const o = Math.ceil(i / e);
  6173. if (s + 5 >= o) return Jo(1, o);
  6174. const c = Math.max(n - s, 1),
  6175. u = Math.min(n + s, o),
  6176. h = c > 2,
  6177. m = u < o - 2,
  6178. p = 1,
  6179. E = o;
  6180. if (!h && m) {
  6181. let _ = 3 + 2 * s;
  6182. return [...Jo(1, _), io, o]
  6183. }
  6184. if (h && !m) {
  6185. let _ = 3 + 2 * s,
  6186. I = Jo(o - _ + 1, o);
  6187. return [p, io, ...I]
  6188. }
  6189. if (h && m) {
  6190. let _ = Jo(c, u);
  6191. return [p, io, ..._, io, E]
  6192. }
  6193. }, [i, e, s, n]),
  6194. VA = () => {
  6195. var c;
  6196. const [i, e] = a.useState(((c = localStorage.getItem("auth-token")) == null ? void 0 : c.toString()) || "");
  6197. function s(u) {
  6198. return ee("cms")[u].replace("%api.url%", ee("cms")["api.url"])
  6199. }
  6200. const n = a.useCallback(async u => {
  6201. try {
  6202. return await (await fetch(u, {
  6203. headers: {
  6204. authorization: l()
  6205. }
  6206. })).json()
  6207. } catch {
  6208. return null
  6209. }
  6210. }, []),
  6211. r = a.useCallback(async(u, h) => {
  6212. try {
  6213. return await (await fetch(u, {
  6214. method: "POST",
  6215. headers: {
  6216. authorization: l(),
  6217. "content-type": "application/json"
  6218. },
  6219. body: JSON.stringify(h)
  6220. })).json()
  6221. } catch {
  6222. return null
  6223. }
  6224. }, []),
  6225. o = a.useCallback(u => {
  6226. u ? localStorage.setItem("auth-token", u) : localStorage.removeItem("auth-token"), e(u)
  6227. }, [e]),
  6228. l = () => localStorage.getItem("auth-token") || "";
  6229. return {
  6230. get: n,
  6231. post: r,
  6232. token: i,
  6233. setToken: o,
  6234. setInternalToken: e,
  6235. getAPI: s
  6236. }
  6237. },
  6238. Os = () => Qe(VA),
  6239. WA = () => {
  6240. const [i, e] = a.useState(!1), [s, n] = a.useState(null), [r, o] = a.useState(null), {
  6241. post: l,
  6242. getAPI: c
  6243. } = Os(), {
  6244. showSingleBubble: u = null
  6245. } = Ke();
  6246. return {
  6247. vpnVisible: i,
  6248. setVPNVisible: e,
  6249. ip: r,
  6250. username: s,
  6251. setUsername: n,
  6252. setIP: o,
  6253. blockVPN: async m => {
  6254. m.preventDefault();
  6255. const p = await l(c("block.post.api"), {
  6256. username: s,
  6257. ip: r
  6258. });
  6259. if (p) {
  6260. if (p.errors)
  6261. for (let E of p.errors) u(g(E));
  6262. if (p.messages)
  6263. for (let E of p.messages) u(g(E))
  6264. }
  6265. }
  6266. }
  6267. },
  6268. gE = () => Qe(WA),
  6269. jA = () => {
  6270. const {
  6271. get: i,
  6272. post: e,
  6273. setInternalToken: s,
  6274. setToken: n,
  6275. token: r,
  6276. getAPI: o
  6277. } = Os(), [l, c] = a.useState(!0), [u, h] = a.useState(""), [m, p] = a.useState(0), [E, _] = a.useState(!1), [I, C] = a.useState(!1), [f, S] = a.useState([]), [T, b] = a.useState([]), [y, w] = a.useState(null), O = a.useCallback(async() => {
  6278. let q = await i(o("auth.voting.api"));
  6279. return q && q.errors ? (b(q.errors), !0) : !q || q && !q.redirect || q && q.voted ? !0 : (window.location.replace(q.redirect), !1)
  6280. }, [i, o]), F = a.useCallback(async() => {
  6281. let q = await i(o("auth.session.api"));
  6282. if (q) {
  6283. if (q.errors) return b(q.errors);
  6284. q.permissions && S(q.permissions), w(q)
  6285. }
  6286. }, [i, o, S]), U = a.useCallback(async(q = !1) => {
  6287. if (C(!0), !await O()) return;
  6288. let Z = await i(o("auth.sso.api"));
  6289. return Z && Z.errors ? (C(!1), b(Z.errors)) : !Z || Z && !Z.authTicket ? (_(!1), n(null), C(!1)) : (c(!0), h(Z.authTicket), q && B(new bd(Z.authTicket, Date.now())), await F(), Z)
  6290. }, [i, o, n, F, O]), j = a.useCallback(async(q, Z) => {
  6291. b(null), C(!0);
  6292. let ce = await e(o("auth.login.api"), {
  6293. username: q,
  6294. password: Z
  6295. });
  6296. if (!ce) {
  6297. c(!1), n(null), C(!1);
  6298. return
  6299. }
  6300. return ce.errors.length == 0 ? (c(!0), n(ce.token), await U(!0)) : (b(ce.errors), C(!1)), ce
  6301. }, [e, o, n, U]), x = a.useCallback(async(q, Z, ce, se, ye) => {
  6302. b(null);
  6303. let me = await e(o("auth.register.api"), {
  6304. username: q,
  6305. email: Z,
  6306. password: ce,
  6307. passwordConfirm: se,
  6308. captcha: ye
  6309. });
  6310. if (!me) {
  6311. c(!1), n(null), C(!1);
  6312. return
  6313. }
  6314. return me.errors.length == 0 ? (c(!0), n(me.token), await U(!0)) : (b(me.errors), C(!1)), C(!1), me
  6315. }, [e, o, n, U]), M = a.useCallback(async q => {
  6316. r && await U(!0)
  6317. }, [r, U]), G = a.useCallback(async q => {
  6318. r && u && (n(null), _(!1), c(!1))
  6319. }, [r, u, n]), H = a.useCallback(q => f.includes(q), [f]), Y = () => {
  6320. localStorage.removeItem("auth-token"), document.defaultView.location.reload()
  6321. };
  6322. return a.useEffect(() => {
  6323. NitroConfig["sso.ticket"] || c(!1)
  6324. }, [l, U]), {
  6325. login: j,
  6326. register: x,
  6327. authenticated: l,
  6328. setAuthenticated: c,
  6329. authStep: m,
  6330. setAuthStep: p,
  6331. tryGetSSO: U,
  6332. handshakeFailedHandler: M,
  6333. ready: E,
  6334. setLoading: C,
  6335. loading: I,
  6336. setReady: _,
  6337. connectionClosedHandler: G,
  6338. hasPermission: H,
  6339. errors: T,
  6340. setErrors: b,
  6341. logout: Y,
  6342. userData: y
  6343. }
  6344. },
  6345. jn = () => Qe(jA);
  6346. class qA {
  6347. constructor(e) {
  6348. this._caption = e.readString(), this._collected = e.readBoolean()
  6349. }
  6350. get caption() {
  6351. return this._caption
  6352. }
  6353. get hasCollected() {
  6354. return this._collected
  6355. }
  6356. }
  6357. class pE {
  6358. constructor(e) {
  6359. this._unread = 0, this._campaign = e.readString(), this._captionSave = e.readString(), this._caption = e.readString(), this._description = e.readString(), this._prizeImage = e.readString(), this._items = [];
  6360. let s = e.readInt();
  6361. for (; s > 0;) this._items.push(new qA(e)), s--
  6362. }
  6363. get campaign() {
  6364. return this._campaign
  6365. }
  6366. get captionSave() {
  6367. return this._captionSave
  6368. }
  6369. get caption() {
  6370. return this._caption
  6371. }
  6372. get description() {
  6373. return this._description
  6374. }
  6375. get prizeImage() {
  6376. return this._prizeImage
  6377. }
  6378. set items(e) {
  6379. this._items = e
  6380. }
  6381. get items() {
  6382. return this._items
  6383. }
  6384. set unread(e) {
  6385. this._unread = e
  6386. }
  6387. get unread() {
  6388. return this._unread
  6389. }
  6390. get hasStarted() {
  6391. let e = !1;
  6392. for (let s of this.items) s.hasCollected && (e = !0);
  6393. return e
  6394. }
  6395. get hasCompleted() {
  6396. let e = 0;
  6397. for (let s of this.items) s.hasCollected && e++;
  6398. return e === this.items.length
  6399. }
  6400. }
  6401. class YA {
  6402. constructor(e) {
  6403. this._code = e.readString(), this._collections = [];
  6404. let s = e.readInt();
  6405. for (; s > 0;) this._collections.push(new pE(e)), s--
  6406. }
  6407. get code() {
  6408. return this._code
  6409. }
  6410. get collections() {
  6411. return this._collections
  6412. }
  6413. }
  6414. class zA {
  6415. flush() {
  6416. return !0
  6417. }
  6418. parse(e) {
  6419. if (!e) return !1;
  6420. this._campaigns = [];
  6421. let s = e.readInt();
  6422. for (; s > 0;) this._campaigns.push(new YA(e)), s--;
  6423. return !0
  6424. }
  6425. get campaigns() {
  6426. return this._campaigns
  6427. }
  6428. }
  6429. class KA {
  6430. flush() {
  6431. return !0
  6432. }
  6433. parse(e) {
  6434. return e ? (this._updatedCollection = new pE(e), !0) : !1
  6435. }
  6436. get updatedCollection() {
  6437. return this._updatedCollection
  6438. }
  6439. }
  6440. class fE extends ss {
  6441. constructor(e) {
  6442. super(e, zA)
  6443. }
  6444. getParser() {
  6445. return this.parser
  6446. }
  6447. }
  6448. class $A {
  6449. constructor(e) {
  6450. this._maximumAllowedItems = e.readInt(), this._discountBatchSize = e.readInt(), this._discountAmountPerBatch = e.readInt(), this._minimumDiscountsForBonus = e.readInt(), this._discountThreshold = [];
  6451. let s = e.readInt();
  6452. for (; s > 0;) this._discountThreshold.push(e.readInt()), s--
  6453. }
  6454. get maximumAllowedItems() {
  6455. return this._maximumAllowedItems
  6456. }
  6457. get discountBatchSize() {
  6458. return this._discountBatchSize
  6459. }
  6460. get discountAmountPerBatch() {
  6461. return this._discountAmountPerBatch
  6462. }
  6463. get minDiscountsForBonus() {
  6464. return this._minimumDiscountsForBonus
  6465. }
  6466. get discountThreshold() {
  6467. return this._discountThreshold
  6468. }
  6469. }
  6470. class QA {
  6471. flush() {
  6472. return this._bundleDiscountRuleset = null, !0
  6473. }
  6474. parse(e) {
  6475. return e ? (this._bundleDiscountRuleset = new $A(e), !0) : !1
  6476. }
  6477. get bundleDiscountRuleset() {
  6478. return this._bundleDiscountRuleset
  6479. }
  6480. }
  6481. class Zl {
  6482. constructor(e) {
  6483. if (!e) throw new Error("invalid_wrapper");
  6484. this.flush(), this.parse(e)
  6485. }
  6486. flush() {
  6487. return this._visible = !1, this._icon = 0, this._iconColor = "", this._pageId = -1, this._pageName = null, this._localization = null, this._children = [], this._offerIds = [], !0
  6488. }
  6489. parse(e) {
  6490. if (!e) return !1;
  6491. this._visible = e.readBoolean(), this._icon = e.readInt(), this._iconColor = e.readString(), this._pageId = e.readInt(), this._pageName = e.readString(), this._localization = e.readString();
  6492. let s = e.readInt();
  6493. for (; s > 0;) this._offerIds.push(e.readInt()), s--;
  6494. let n = e.readInt();
  6495. for (; n > 0;) this._children.push(new Zl(e)), n--;
  6496. return !0
  6497. }
  6498. get visible() {
  6499. return this._visible
  6500. }
  6501. get icon() {
  6502. return this._icon
  6503. }
  6504. get iconColor() {
  6505. return this._iconColor
  6506. }
  6507. get pageId() {
  6508. return this._pageId
  6509. }
  6510. get pageName() {
  6511. return this._pageName
  6512. }
  6513. get localization() {
  6514. return this._localization
  6515. }
  6516. get children() {
  6517. return this._children
  6518. }
  6519. get offerIds() {
  6520. return this._offerIds
  6521. }
  6522. }
  6523. class XA {
  6524. flush() {
  6525. return this._root = null, !0
  6526. }
  6527. parse(e) {
  6528. return e ? (this._root = new Zl(e), this._newAdditionsAvailable = e.readBoolean(), this._catalogType = e.readString(), !0) : !1
  6529. }
  6530. get root() {
  6531. return this._root
  6532. }
  6533. get newAdditionsAvailable() {
  6534. return this._newAdditionsAvailable
  6535. }
  6536. get catalogType() {
  6537. return this._catalogType
  6538. }
  6539. }
  6540. class JA {
  6541. constructor(e) {
  6542. this._Str_9163 = e.readInt(), this._id = e.readInt(), this._identifier = e.readString(), this._productCode = e.readString(), this._Str_3594 = e.readInt(), this._Str_3539 = e.readInt(), this._Str_2956 = e.readInt(), this._Str_9772 = e.readInt();
  6543. const s = e.readInt();
  6544. this._expirationTime = s > 0 ? s * 1e3 + Date.now() : 0, this._title = e.readString(), this._Str_1858 = e.readString(), this._Str_2991 = e.readString(), this._Str_18782 = e.readString(), this._type = e.readInt(), this._Str_11962 = [];
  6545. let n = e.readInt();
  6546. for (; n > 0;) this._Str_11962.push(e.readString()), n--;
  6547. return this
  6548. }
  6549. populate(e) {
  6550. e && (this._id = e.id, this._identifier = e.identifier, this._type = e.type, this._title = e.title, this._Str_1858 = e.description, this._Str_2991 = e.imageUrl, this._Str_18782 = e.iconUrl, this._productCode = e.productCode, this._Str_9772 = e.purchaseLimit, this._expirationTime = e.expirationTime, this._Str_3594 = e.priceInCredits, this._Str_3539 = e.priceInActivityPoints, this._Str_2956 = e.activityPointType, this._Str_11962 = e._Str_24978, this._Str_9163 = e._Str_11180)
  6551. }
  6552. _Str_24338(e) {
  6553. this._Str_9772 = this._Str_9772 - e
  6554. }
  6555. get id() {
  6556. return this._id
  6557. }
  6558. get identifier() {
  6559. return this._identifier
  6560. }
  6561. get type() {
  6562. return this._type
  6563. }
  6564. get title() {
  6565. return this._title
  6566. }
  6567. get description() {
  6568. return this._Str_1858
  6569. }
  6570. get imageUrl() {
  6571. return this._Str_2991
  6572. }
  6573. get iconUrl() {
  6574. return this._Str_18782
  6575. }
  6576. get productCode() {
  6577. return this._productCode
  6578. }
  6579. get purchaseLimit() {
  6580. return this._Str_9772
  6581. }
  6582. get expirationTime() {
  6583. return this._expirationTime
  6584. }
  6585. get priceInCredits() {
  6586. return this._Str_3594
  6587. }
  6588. get priceInActivityPoints() {
  6589. return this._Str_3539
  6590. }
  6591. get activityPointType() {
  6592. return this._Str_2956
  6593. }
  6594. get _Str_24978() {
  6595. return this._Str_11962
  6596. }
  6597. get _Str_11180() {
  6598. return this._Str_9163
  6599. }
  6600. }
  6601. class ZA {
  6602. flush() {
  6603. return this._data = null, !0
  6604. }
  6605. parse(e) {
  6606. return e ? (this._data = new JA(e), !0) : !1
  6607. }
  6608. get data() {
  6609. return this._data
  6610. }
  6611. }
  6612. class Hi {
  6613. constructor(e, s, n = 0) {
  6614. this._look = e, this._username = s, this._points = n
  6615. }
  6616. get look() {
  6617. return this._look
  6618. }
  6619. get username() {
  6620. return this._username
  6621. }
  6622. get points() {
  6623. return this._points
  6624. }
  6625. }
  6626. class _E {
  6627. constructor(e, s, n = null) {
  6628. if (this._team = e, this._points = s, this._members = [], n) {
  6629. let r = n.readInt();
  6630. for (; r > 0;) this._members.push(new Hi(n.readString(), n.readString(), n.readInt())), r--
  6631. }
  6632. }
  6633. get team() {
  6634. return this._team
  6635. }
  6636. get points() {
  6637. return this._points
  6638. }
  6639. }
  6640. class ek {
  6641. flush() {
  6642. return !0
  6643. }
  6644. parse(e) {
  6645. if (!e) return !1;
  6646. this._type = e.readString();
  6647. let s = e.readInt();
  6648. for (this._habbos = [], this._teams = []; s > 0;) this._type === "HABBOS" ? this._habbos.push(new Hi(e.readString(), e.readString(), e.readInt())) : this._type === "TEAMS" && this._teams.push(new _E(e.readInt(), e.readInt(), e)), s--;
  6649. return this._prize = e.readInt(), !0
  6650. }
  6651. get type() {
  6652. return this._type
  6653. }
  6654. get habbos() {
  6655. return this._habbos
  6656. }
  6657. get teams() {
  6658. return this._teams
  6659. }
  6660. get prize() {
  6661. return this._prize
  6662. }
  6663. }
  6664. class tk {
  6665. flush() {
  6666. return !0
  6667. }
  6668. parse(e) {
  6669. if (!e) return !1;
  6670. this._queueMax = e.readInt(), this._queueMin = e.readInt(), this._habbos = this._habbos = [];
  6671. let s = e.readInt();
  6672. for (; s > 0;) this._habbos.push(new Hi(e.readString(), e.readString())), s--;
  6673. return !0
  6674. }
  6675. get queueMax() {
  6676. return this._queueMax
  6677. }
  6678. get queueMin() {
  6679. return this._queueMin
  6680. }
  6681. get habbos() {
  6682. return this._habbos
  6683. }
  6684. }
  6685. class sk {
  6686. flush() {
  6687. return !0
  6688. }
  6689. parse(e) {
  6690. if (!e) return !1;
  6691. let s = e.readString(),
  6692. n = e.readInt();
  6693. for (this._habbos = [], this._teams = []; n > 0;) s === "HABBOS" ? this._habbos.push(new Hi(e.readString(), e.readString(), e.readInt())) : s === "TEAMS" && this._teams.push(new _E(e.readInt(), e.readInt())), n--;
  6694. return !0
  6695. }
  6696. get habbos() {
  6697. return this._habbos
  6698. }
  6699. get teams() {
  6700. return this._teams
  6701. }
  6702. }
  6703. class nk {
  6704. flush() {
  6705. return !0
  6706. }
  6707. parse(e) {
  6708. return e ? (this._step = e.readInt(), !0) : !1
  6709. }
  6710. get step() {
  6711. return this._step
  6712. }
  6713. }
  6714. class rk {
  6715. flush() {
  6716. return !0
  6717. }
  6718. parse(e) {
  6719. return e ? (this._totalTime = e.readInt(), this._ticks = e.readInt(), !0) : !1
  6720. }
  6721. get totalTime() {
  6722. return this._totalTime
  6723. }
  6724. get ticks() {
  6725. return this._ticks
  6726. }
  6727. }
  6728. class ok {
  6729. flush() {
  6730. return !0
  6731. }
  6732. parse(e) {
  6733. return e ? (this.count = e.readInt(), !0) : !1
  6734. }
  6735. }
  6736. class ik {
  6737. flush() {
  6738. return !0
  6739. }
  6740. parse(e) {
  6741. return e ? (this._soundId = e.readInt(), this._soundString = e.readString(), this._roomExit = e.readBoolean(), !0) : !1
  6742. }
  6743. get soundId() {
  6744. return this._soundId
  6745. }
  6746. get soundString() {
  6747. return this._soundString
  6748. }
  6749. get roomExit() {
  6750. return this._roomExit
  6751. }
  6752. }
  6753. class ak {
  6754. constructor(e) {
  6755. this.userId = e.readInt(), this.timer = e.readInt()
  6756. }
  6757. }
  6758. class lk {
  6759. constructor(e) {
  6760. this.userId = e.readInt(), this.progress = e.readInt(), this.currentLevelProgress = e.readInt(), this.full = e.readInt(), this.modifier = e.readInt(), this.skill = e.readString()
  6761. }
  6762. }
  6763. class ck {
  6764. flush() {
  6765. return !0
  6766. }
  6767. parse(e) {
  6768. if (!e) return !1;
  6769. if (this._type = e.readString(), this._type == "SKILL") {
  6770. this._skillers = this._skillers = [];
  6771. let s = e.readInt();
  6772. for (; s > 0;) this._skillers.push(new lk(e)), s--
  6773. } else this._type == "CURRENCY" && (this._currencyUser = new ak(e));
  6774. return !0
  6775. }
  6776. get type() {
  6777. return this._type
  6778. }
  6779. get skillers() {
  6780. return this._skillers
  6781. }
  6782. get currencyUser() {
  6783. return this._currencyUser
  6784. }
  6785. }
  6786. class uk {
  6787. flush() {
  6788. return !0
  6789. }
  6790. parse(e) {
  6791. if (!e) return !1;
  6792. this._commands = this._commands = [];
  6793. let s = e.readInt();
  6794. for (; s > 0;) this._commands.push({
  6795. key: e.readString(),
  6796. description: e.readString()
  6797. }), s--;
  6798. return !0
  6799. }
  6800. get commands() {
  6801. return this._commands
  6802. }
  6803. }
  6804. class dk {
  6805. constructor(e) {
  6806. this._id = e.readInt(), this._imageUrl = e.readString(), this._imageUrl == "" && (this._imageUrl = null), this._name = e.readString()
  6807. }
  6808. get name() {
  6809. return this._name
  6810. }
  6811. get id() {
  6812. return this._id
  6813. }
  6814. get imageUrl() {
  6815. return this._imageUrl
  6816. }
  6817. }
  6818. class hk {
  6819. constructor() {
  6820. this._gifts = []
  6821. }
  6822. flush() {
  6823. return !0
  6824. }
  6825. parse(e) {
  6826. if (!e) return !1;
  6827. let s = e.readInt();
  6828. for (let n = 0; n < s; n++) this.gifts.length < 3 && this.gifts.push(new dk(e));
  6829. return !0
  6830. }
  6831. get gifts() {
  6832. return this._gifts
  6833. }
  6834. }
  6835. class mk {
  6836. flush() {
  6837. return this._volumeSystem = 0, this._volumeFurni = 0, this._volumeTrax = 0, this._oldChat = !1, this._roomInvites = !1, this._cameraFollow = !1, this._flags = 0, this._chatType = 0, this._block_following = !1, this._block_frs = !1, this._disableYT = !1, this._noitemfloor = !1, !0
  6838. }
  6839. parse(e) {
  6840. return e ? (this._volumeSystem = e.readInt(), this._volumeFurni = e.readInt(), this._volumeTrax = e.readInt(), this._oldChat = e.readBoolean(), this._roomInvites = e.readBoolean(), this._cameraFollow = e.readBoolean(), this._flags = e.readInt(), this._chatType = e.readInt(), this._block_following = e.readBoolean(), this._block_frs = e.readBoolean(), this._disableYT = e.readBoolean(), this._noitemfloor = e.readBoolean(), !0) : !1
  6841. }
  6842. get volumeSystem() {
  6843. return this._volumeSystem
  6844. }
  6845. get volumeFurni() {
  6846. return this._volumeFurni
  6847. }
  6848. get volumeTrax() {
  6849. return this._volumeTrax
  6850. }
  6851. get oldChat() {
  6852. return this._oldChat
  6853. }
  6854. get roomInvites() {
  6855. return this._roomInvites
  6856. }
  6857. get cameraFollow() {
  6858. return this._cameraFollow
  6859. }
  6860. get flags() {
  6861. return this._flags
  6862. }
  6863. get chatType() {
  6864. return this._chatType
  6865. }
  6866. get blockFollowing() {
  6867. return this._block_following
  6868. }
  6869. get blockFrs() {
  6870. return this._block_frs
  6871. }
  6872. get disableYt() {
  6873. return this._disableYT
  6874. }
  6875. get noItemFloor() {
  6876. return this._noitemfloor
  6877. }
  6878. }
  6879. class EE extends ss {
  6880. constructor(e) {
  6881. super(e, KA)
  6882. }
  6883. getParser() {
  6884. return this.parser
  6885. }
  6886. }
  6887. class IE extends ss {
  6888. constructor(e) {
  6889. super(e, QA)
  6890. }
  6891. getParser() {
  6892. return this.parser
  6893. }
  6894. }
  6895. class CE extends ss {
  6896. constructor(e) {
  6897. super(e, XA)
  6898. }
  6899. getParser() {
  6900. return this.parser
  6901. }
  6902. }
  6903. class SE extends ss {
  6904. constructor(e) {
  6905. super(e, ZA)
  6906. }
  6907. getParser() {
  6908. return this.parser
  6909. }
  6910. }
  6911. class TE extends ss {
  6912. constructor(e) {
  6913. super(e, ek)
  6914. }
  6915. getParser() {
  6916. return this.parser
  6917. }
  6918. }
  6919. class NE extends ss {
  6920. constructor(e) {
  6921. super(e, tk)
  6922. }
  6923. getParser() {
  6924. return this.parser
  6925. }
  6926. }
  6927. class RE extends ss {
  6928. constructor(e) {
  6929. super(e, sk)
  6930. }
  6931. getParser() {
  6932. return this.parser
  6933. }
  6934. }
  6935. class vE extends ss {
  6936. constructor(e) {
  6937. super(e, nk)
  6938. }
  6939. getParser() {
  6940. return this.parser
  6941. }
  6942. }
  6943. class bE extends ss {
  6944. constructor(e) {
  6945. super(e, rk)
  6946. }
  6947. getParser() {
  6948. return this.parser
  6949. }
  6950. }
  6951. class ec extends ss {
  6952. constructor(e) {
  6953. super(e, ok)
  6954. }
  6955. getParser() {
  6956. return this.parser
  6957. }
  6958. }
  6959. class OE extends ss {
  6960. constructor(e) {
  6961. super(e, ik)
  6962. }
  6963. getParser() {
  6964. return this.parser
  6965. }
  6966. }
  6967. class tc extends ss {
  6968. constructor(e) {
  6969. super(e, ck)
  6970. }
  6971. getParser() {
  6972. return this.parser
  6973. }
  6974. }
  6975. class wE extends ss {
  6976. constructor(e) {
  6977. super(e, uk)
  6978. }
  6979. getParser() {
  6980. return this.parser
  6981. }
  6982. }
  6983. class yE extends ss {
  6984. constructor(e) {
  6985. super(e, hk)
  6986. }
  6987. getParser() {
  6988. return this.parser
  6989. }
  6990. }
  6991. class AE extends ss {
  6992. constructor(e) {
  6993. super(e, mk)
  6994. }
  6995. getParser() {
  6996. return this.parser
  6997. }
  6998. }
  6999. class gk extends Ba {
  7000. getEventTypes() {
  7001. const e = [sa.CREDITFURNI];
  7002. return this.mergeTypes(super.getEventTypes(), e)
  7003. }
  7004. initialize(e) {
  7005. super.initialize(e);
  7006. let s = 0;
  7007. e.logic && e.logic.credits && e.logic.credits !== "" && e.logic.credits.length > 0 && (s = parseInt(e.logic.credits)), this.object.model.setValue(ue.FURNITURE_CREDIT_VALUE, s)
  7008. }
  7009. useObject() {
  7010. !this.object || !this.eventDispatcher || (this.eventDispatcher.dispatchEvent(new sa(sa.CREDITFURNI, this.object)), super.useObject())
  7011. }
  7012. }
  7013. class $ {}
  7014. $.FURNITURE_TIP_JAR = "furniture_tip_jar";
  7015. $.FURNITURE_BASIC = "furniture_basic";
  7016. $.FURNITURE_MULTISTATE = "furniture_multistate";
  7017. $.FURNITURE_MULTIHEIGHT = "furniture_multiheight";
  7018. $.FURNITURE_RANDOMSTATE = "furniture_randomstate";
  7019. $.FURNITURE_PLACEHOLDER = "furniture_placeholder";
  7020. $.FURNITURE_CREDIT = "furniture_credit";
  7021. $.FURNITURE_STICKIE = "furniture_stickie";
  7022. $.FURNITURE_PRESENT = "furniture_present";
  7023. $.FURNITURE_TROPHY = "furniture_trophy";
  7024. $.FURNITURE_ECOTRON_BOX = "furniture_ecotron_box";
  7025. $.FURNITURE_DICE = "furniture_dice";
  7026. $.FURNITURE_HOCKEY_SCORE = "furniture_hockey_score";
  7027. $.FURNITURE_HABBOWHEEL = "furniture_habbowheel";
  7028. $.FURNITURE_ONE_WAY_DOOR = "furniture_one_way_door";
  7029. $.FURNITURE_PLANET_SYSTEM = "furniture_planet_system";
  7030. $.FURNITURE_WINDOW = "furniture_window";
  7031. $.FURNITURE_EXTERNAL_IMAGE_WALLITEM = "furniture_external_image_wallitem";
  7032. $.FURNITURE_ROOMDIMMER = "furniture_roomdimmer";
  7033. $.FURNITURE_SOUND_MACHINE = "furniture_sound_machine";
  7034. $.FURNITURE_JUKEBOX = "furniture_jukebox";
  7035. $.FURNITURE_CRACKABLE = "furniture_crackable";
  7036. $.FURNITURE_PUSHABLE = "furniture_pushable";
  7037. $.FURNITURE_CLOTHING_CHANGE = "furniture_clothing_change";
  7038. $.FURNITURE_COUNTER_CLOCK = "furniture_counter_clock";
  7039. $.FURNITURE_SCORE = "furniture_score";
  7040. $.FURNITURE_ES = "furniture_es";
  7041. $.FURNITURE_FIREWORKS = "furniture_fireworks";
  7042. $.FURNITURE_SONG_DISK = "furniture_song_disk";
  7043. $.FURNITURE_BB = "furniture_bb";
  7044. $.FURNITURE_BG = "furniture_bg";
  7045. $.FURNITURE_WELCOME_GIFT = "furniture_welcome_gift";
  7046. $.FURNITURE_FLOOR_HOLE = "furniture_floor_hole";
  7047. $.FURNITURE_MANNEQUIN = "furniture_mannequin";
  7048. $.FURNITURE_GUILD_CUSTOMIZED = "furniture_guild_customized";
  7049. $.FURNITURE_GROUP_FORUM_TERMINAL = "furniture_group_forum_terminal";
  7050. $.FURNITURE_PET_CUSTOMIZATION = "furniture_pet_customization";
  7051. $.FURNITURE_CUCKOO_CLOCK = "furniture_cuckoo_clock";
  7052. $.FURNITURE_VOTE_COUNTER = "furniture_vote_counter";
  7053. $.FURNITURE_VOTE_MAJORITY = "furniture_vote_majority";
  7054. $.FURNITURE_SOUNDBLOCK = "furniture_soundblock";
  7055. $.FURNITURE_RANDOM_TELEPORT = "furniture_random_teleport";
  7056. $.FURNITURE_MONSTERPLANT_SEED = "furniture_monsterplant_seed";
  7057. $.FURNITURE_PURCHASABLE_CLOTHING = "furniture_purchasable_clothing";
  7058. $.FURNITURE_BACKGROUND_COLOR = "furniture_background_color";
  7059. $.FURNITURE_MYSTERYBOX = "furniture_mysterybox";
  7060. $.FURNITURE_EFFECTBOX = "furniture_effectbox";
  7061. $.FURNITURE_MYSTERYTROPHY = "furniture_mysterytrophy";
  7062. $.FURNITURE_ACHIEVEMENT_RESOLUTION = "furniture_achievement_resolution";
  7063. $.FURNITURE_LOVELOCK = "furniture_lovelock";
  7064. $.FURNITURE_WILDWEST_WANTED = "furniture_wildwest_wanted";
  7065. $.FURNITURE_HWEEN_LOVELOCK = "furniture_hween_lovelock";
  7066. $.FURNITURE_BADGE_DISPLAY = "furniture_badge_display";
  7067. $.FURNITURE_HIGH_SCORE = "furniture_high_score";
  7068. $.FURNITURE_INTERNAL_LINK = "furniture_internal_link";
  7069. $.FURNITURE_CUSTOM_STACK_HEIGHT = "furniture_custom_stack_height";
  7070. $.FURNITURE_YOUTUBE = "furniture_youtube";
  7071. $.FURNITURE_RENTABLE_SPACE = "furniture_rentable_space";
  7072. $.FURNITURE_CHANGE_STATE_WHEN_STEP_ON = "furniture_change_state_when_step_on";
  7073. $.FURNITURE_VIMEO = "furniture_vimeo";
  7074. $.FURNITURE_EDITABLE_INTERNAL_LINK = "furniture_editable_internal_link";
  7075. $.FURNITURE_EDITABLE_ROOM_LINK = "furniture_editable_room_link";
  7076. $.FURNITURE_CRAFTING_GIZMO = "furniture_crafting_gizmo";
  7077. $.ROOM = "room";
  7078. $.USER = "user";
  7079. $.BOT = "bot";
  7080. $.RENTABLE_BOT = "rentable_bot";
  7081. $.PET = "pet";
  7082. $.TILE_CURSOR = "tile_cursor";
  7083. $.SELECTION_ARROW = "selection_arrow";
  7084. $.GAME_SNOWBALL = "game_snowball";
  7085. $.GAME_SNOWSPLASH = "game_snowsplash";
  7086. class kE {
  7087. constructor(e) {
  7088. this._data = [e.length, ...e]
  7089. }
  7090. getMessageArray() {
  7091. return this._data
  7092. }
  7093. dispose() {}
  7094. }
  7095. class sc {
  7096. constructor(e) {
  7097. this._data = [e]
  7098. }
  7099. getMessageArray() {
  7100. return this._data
  7101. }
  7102. dispose() {}
  7103. }
  7104. class pk {
  7105. constructor() {
  7106. this._data = []
  7107. }
  7108. getMessageArray() {
  7109. return this._data
  7110. }
  7111. dispose() {}
  7112. }
  7113. class nc {
  7114. constructor() {
  7115. this._data = []
  7116. }
  7117. getMessageArray() {
  7118. return this._data
  7119. }
  7120. dispose() {}
  7121. }
  7122. class ME {
  7123. constructor(e) {
  7124. this._data = [e]
  7125. }
  7126. getMessageArray() {
  7127. return this._data
  7128. }
  7129. dispose() {}
  7130. }
  7131. class UE {
  7132. constructor(e) {
  7133. this._data = [e.blockFollowing, e.blockFrs, e.disableYt, e.noItemFloor]
  7134. }
  7135. getMessageArray() {
  7136. return this._data
  7137. }
  7138. dispose() {}
  7139. }
  7140. class we {}
  7141. we.CATALOG_PAGE_LIST = 9001;
  7142. we.RequestOnlineCount = 9002;
  7143. we.USER_SETTINGS = 9004;
  7144. we.NUX_GIFTS = 3575;
  7145. we.COMMANDS_LIST = 9009;
  7146. we.PROGRESS_BARS = 9010;
  7147. we.GAME_STAGE = 9011;
  7148. we.PLAY_SOUND = 9012;
  7149. we.GAME_TIMER = 9013;
  7150. we.GAME_SCOREBOARD = 9014;
  7151. we.GAME_QUEUE_LIST = 9015;
  7152. we.GAME_LEADERBOARD = 9016;
  7153. we.COLLECTION_LIST = 9018;
  7154. we.COLLECTION_UPDATED = 9019;
  7155. we.OnlineCount = 9003;
  7156. we.SaveUserSettings = 9005;
  7157. we.UNIT_CHAT = 9006;
  7158. we.RECYCLE_ITEMS = 2771;
  7159. we.SECURITY_TICKET = 9007;
  7160. we.UNIT_WALK = 9008;
  7161. we.NUX_SCRIPT_PROCEED = 1299;
  7162. we.NUX_PICK_GIFT = 1822;
  7163. we.INTERNAL_URL = 9017;
  7164. class fk {
  7165. constructor() {
  7166. this._events = new Map, this._composers = new Map, this.registerEvents(), this.registerComposers()
  7167. }
  7168. registerEvents() {
  7169. this._events.set(we.CATALOG_PAGE_LIST, CE), this._events.set(we.OnlineCount, ec), this._events.set(we.USER_SETTINGS, AE), this._events.set(we.NUX_GIFTS, yE), this._events.set(we.COMMANDS_LIST, wE), this._events.set(we.PROGRESS_BARS, tc), this._events.set(we.GAME_STAGE, vE), this._events.set(we.PLAY_SOUND, OE), this._events.set(we.GAME_TIMER, bE), this._events.set(we.GAME_SCOREBOARD, RE), this._events.set(we.GAME_QUEUE_LIST, NE), this._events.set(we.GAME_LEADERBOARD, TE), this._events.set(we.COLLECTION_LIST, fE), this._events.set(we.COLLECTION_UPDATED, EE), this._composers.set(we.RequestOnlineCount, pk), this._composers.set(we.SaveUserSettings, UE), this._composers.set(we.UNIT_CHAT, $I), this._composers.set(we.SECURITY_TICKET, bd), this._composers.set(we.NUX_SCRIPT_PROCEED, nc), this._composers.set(we.NUX_PICK_GIFT, ME), this._composers.set(we.UNIT_WALK, QI), this._composers.set(we.INTERNAL_URL, sc), this._events.set(k.INTERSTITIAL_MESSAGE, XI), this._events.set(k.ROOM_AD_ERROR, JI), this._events.set(k.AVAILABILITY_STATUS, ZI), this._events.set(k.AVAILABILITY_TIME, eC), this._events.set(k.HOTEL_CLOSED_AND_OPENS, Od), this._events.set(k.HOTEL_CLOSES_AND_OPENS_AT, wd), this._events.set(k.HOTEL_WILL_CLOSE_MINUTES, yd), this._events.set(k.HOTEL_MAINTENANCE, Ad), this._events.set(k.USER_CHANGE_NAME, tC), this._events.set(k.CHECK_USER_NAME, kd), this._events.set(k.USER_FIGURE, Md), this._events.set(k.USER_OUTFITS, sC), this._events.set(k.ADD_BOT_TO_INVENTORY, Ud), this._events.set(k.USER_BOTS, Ld), this._events.set(k.BOT_RECEIVED, nC), this._events.set(k.REMOVE_BOT_FROM_INVENTORY, Pd), this._events.set(k.CFH_SANCTION, Dd), this._events.set(k.CFH_TOPICS, Fd), this._events.set(k.CFH_SANCTION_STATUS, xd), this._events.set(k.CAMERA_PUBLISH_STATUS, Gd), this._events.set(k.CAMERA_PURCHASE_OK, Bd), this._events.set(k.CAMERA_STORAGE_URL, Hd), this._events.set(k.COMPETITION_STATUS, rC), this._events.set(k.INIT_CAMERA, Rd), this._events.set(k.THUMBNAIL_STATUS, oC), this._events.set(k.CAMPAIGN_CALENDAR_DATA, Vd), this._events.set(k.CAMPAIGN_CALENDAR_DOOR_OPENED, Wd), this._events.set(k.BONUS_RARE_INFO, iC), this._events.set(k.BUILDERS_CLUB_FURNI_COUNT, jd), this._events.set(k.BUILDERS_CLUB_SUBSCRIPTION, aC), this._events.set(k.BUNDLE_DISCOUNT_RULESET, IE), this._events.set(k.CATALOG_PAGE_EXPIRATION, lC), this._events.set(k.CATALOG_PAGE, qd), this._events.set(k.CATALOG_EARLIEST_EXPIRY, cC), this._events.set(k.CATALOG_PUBLISHED, Yd), this._events.set(k.CLUB_GIFT_INFO, ml), this._events.set(k.CLUB_GIFT_SELECTED, zd), this._events.set(k.DIRECT_SMS_CLUB_BUY, uC), this._events.set(k.GIFT_RECEIVER_NOT_FOUND, Kd), this._events.set(k.GIFT_WRAPPER_CONFIG, $d), this._events.set(k.CLUB_EXTENDED_OFFER, dC), this._events.set(k.CLUB_OFFERS, Qd), this._events.set(k.IS_OFFER_GIFTABLE, hC), this._events.set(k.LIMITED_SOLD_OUT, Xd), this._events.set(k.LIMITED_OFFER_APPEARING_NEXT, mC), this._events.set(k.NOT_ENOUGH_BALANCE, gC), this._events.set(k.PRODUCT_OFFER, Jd), this._events.set(k.CATALOG_PURCHASE_ERROR, Zd), this._events.set(k.CATALOG_PURCHASE_NOT_ALLOWED, eh), this._events.set(k.CATALOG_PURCHASE_OK, th), this._events.set(k.ROOM_AD_PURCHASE, sh), this._events.set(k.SEASONAL_CALENDAR_OFFER, pC), this._events.set(k.CATALOG_RECEIVE_PET_BREEDS, nh), this._events.set(k.TARGET_OFFER, SE), this._events.set(k.TARGET_OFFER_NOT_FOUND, fC), this._events.set(k.REDEEM_VOUCHER_ERROR, rh), this._events.set(k.REDEEM_VOUCHER_OK, oh), this._events.set(k.CLIENT_PING, _C), this._events.set(k.COMPETITION_ENTRY_SUBMIT, EC), this._events.set(k.COMPETITION_VOTING_INFO, IC), this._events.set(k.COMPETITION_TIMING_CODE, CC), this._events.set(k.COMPETITION_USER_PART_OF, SC), this._events.set(k.COMPETITION_NO_OWNED_ROOMS, TC), this._events.set(k.COMPETITION_SECONDS_UNTIL, NC), this._events.set(k.CRAFTABLE_PRODUCTS, ih), this._events.set(k.CRAFTING_RECIPE, ah), this._events.set(k.CRAFTING_RECIPES_AVAILABLE, lh), this._events.set(k.CRAFTING_RESULT, ch), this._events.set(k.DESKTOP_VIEW, uh), this._events.set(k.MESSENGER_ACCEPT_FRIENDS, RC), this._events.set(k.MESSENGER_FIND_FRIENDS, vC), this._events.set(k.MESSENGER_FOLLOW_FAILED, bC), this._events.set(k.MESSENGER_FRIENDS, dh), this._events.set(k.MESSENGER_UPDATE, hh), this._events.set(k.MESSENGER_FRIEND_NOTIFICATION, OC), this._events.set(k.MESSENGER_REQUESTS, mh), this._events.set(k.MESSENGER_SEARCH, gh), this._events.set(k.MESSENGER_INSTANCE_MESSAGE_ERROR, wC), this._events.set(k.MESSENGER_MESSAGE_ERROR, yC), this._events.set(k.MESSENGER_INIT, ph), this._events.set(k.MESSENGER_MINIMAIL_NEW, AC), this._events.set(k.MESSENGER_MINIMAIL_COUNT, kC), this._events.set(k.MESSENGER_CHAT, gl), this._events.set(k.MESSENGER_REQUEST, fh), this._events.set(k.MESSENGER_INVITE_ERROR, _h), this._events.set(k.MESSENGER_INVITE, pl), this._events.set(k.LOAD_GAME_URL, Ha), this._events.set(k.GROUP_INFO, qr), this._events.set(k.GROUP_MEMBER_REMOVE_CONFIRM, Eh), this._events.set(k.GROUP_MEMBERS, Ih), this._events.set(k.GROUP_CREATE_OPTIONS, Ch), this._events.set(k.GROUP_BADGE_PARTS, Sh), this._events.set(k.GROUP_SETTINGS, Th), this._events.set(k.GROUP_PURCHASED, Nh), this._events.set(k.GROUP_BADGES, MC), this._events.set(k.GROUP_DEACTIVATE, Rh), this._events.set(k.GROUP_FORUM_DATA, UC), this._events.set(k.GROUP_FORUM_LIST, LC), this._events.set(k.GROUP_FORUM_THREADS, PC), this._events.set(k.GROUP_FORUM_POST, DC), this._events.set(k.GROUP_FORUM_POST_THREAD, FC), this._events.set(k.GROUP_FORUM_THREAD_MESSAGES, xC), this._events.set(k.GROUP_FORUM_UNREAD_COUNT, GC), this._events.set(k.GROUP_FORUM_UPDATE_MESSAGE, BC), this._events.set(k.GROUP_FORUM_UPDATE_THREAD, HC), this._events.set(k.CFH_DISABLED_NOTIFY, vh), this._events.set(k.CFH_PENDING_CALLS_DELETED, bh), this._events.set(k.CFH_PENDING_CALLS, Oh), this._events.set(k.CFH_REPLY, wh), this._events.set(k.CFH_RESULT_MESSAGE, yh), this._events.set(k.GUIDE_ON_DUTY_STATUS, Ah), this._events.set(k.GUIDE_SESSION_ATTACHED, kh), this._events.set(k.GUIDE_SESSION_DETACHED, Mh), this._events.set(k.GUIDE_SESSION_ENDED, Uh), this._events.set(k.GUIDE_SESSION_ERROR, Lh), this._events.set(k.GUIDE_SESSION_INVITED_TO_GUIDE_ROOM, fl), this._events.set(k.GUIDE_SESSION_MESSAGE, Ph), this._events.set(k.GUIDE_SESSION_PARTNER_IS_TYPING, Dh), this._events.set(k.GUIDE_SESSION_REQUESTER_ROOM, Fh), this._events.set(k.GUIDE_SESSION_STARTED, xh), this._events.set(k.GUIDE_TICKET_CREATION_RESULT, VC), this._events.set(k.GUIDE_TICKET_RESOLUTION, WC), this._events.set(k.GUIDE_REPORTING_STATUS, jC), this._events.set(k.HOTEL_MERGE_NAME_CHANGE, qC), this._events.set(k.ISSUE_CLOSE_NOTIFICATION, Gh), this._events.set(k.QUIZ_DATA, YC), this._events.set(k.QUIZ_RESULTS, zC), this._events.set(k.CHAT_REVIEW_SESSION_DETACHED, KC), this._events.set(k.CHAT_REVIEW_SESSION_OFFERED_TO_GUIDE, $C), this._events.set(k.CHAT_REVIEW_SESSION_RESULTS, QC), this._events.set(k.CHAT_REVIEW_SESSION_STARTED, XC), this._events.set(k.CHAT_REVIEW_SESSION_VOTING_STATUS, JC), this._events.set(k.ACHIEVEMENT_PROGRESSED, Cd), this._events.set(k.ACHIEVEMENT_LIST, Sd), this._events.set(k.USER_ACHIEVEMENT_SCORE, Td), this._events.set(k.USER_EFFECT_ACTIVATE, ZC), this._events.set(k.USER_EFFECT_LIST_ADD, eS), this._events.set(k.USER_EFFECT_LIST_REMOVE, tS), this._events.set(k.USER_EFFECT_LIST, sS), this._events.set(k.USER_BADGES, Bh), this._events.set(k.USER_BADGES_ADD, Hh), this._events.set(k.BADGE_POINT_LIMITS, Vh), this._events.set(k.BADGE_REQUEST_FULFILLED, nS), this._events.set(k.USER_CLOTHING, Wh), this._events.set(k.USER_FURNITURE_ADD, _l), this._events.set(k.USER_FURNITURE, _i), this._events.set(k.USER_FURNITURE_REFRESH, jh), this._events.set(k.USER_FURNITURE_REMOVE, El), this._events.set(k.USER_FURNITURE_POSTIT_PLACED, qh), this._events.set(k.USER_PETS, Yh), this._events.set(k.USER_PET_REMOVE, zh), this._events.set(k.USER_PET_ADD, Kh), this._events.set(k.PET_RECEIVED, $h), this._events.set(k.PET_PLACING_ERROR, rS), this._events.set(k.YOUTUBE_CONTROL_VIDEO, oS), this._events.set(k.YOUTUBE_DISPLAY_PLAYLISTS, iS), this._events.set(k.YOUTUBE_DISPLAY_VIDEO, aS), this._events.set(k.TRADE_ACCEPTED, Qh), this._events.set(k.TRADE_CLOSED, Xh), this._events.set(k.TRADE_COMPLETED, Jh), this._events.set(k.TRADE_CONFIRMATION, Zh), this._events.set(k.TRADE_LIST_ITEM, em), this._events.set(k.TRADE_NOT_OPEN, tm), this._events.set(k.TRADE_OPEN_FAILED, sm), this._events.set(k.TRADE_OPEN, nm), this._events.set(k.TRADE_OTHER_NOT_ALLOWED, rm), this._events.set(k.TRADE_YOU_NOT_ALLOWED, om), this._events.set(k.COMMUNITY_GOAL_VOTE_EVENT, lS), this._events.set(k.PROMO_ARTICLES, cS), this._events.set(k.MARKETPLACE_AFTER_ORDER_STATUS, im), this._events.set(k.MARKETPLACE_CANCEL_SALE, am), this._events.set(k.MARKETPLACE_SELL_ITEM, uS), this._events.set(k.MARKETPLACE_CONFIG, lm), this._events.set(k.MARKETPLACE_ITEM_STATS, cm), this._events.set(k.MARKETPLACE_ITEM_POSTED, um), this._events.set(k.MARKETPLACE_ITEMS_SEARCHED, dm), this._events.set(k.MARKETPLACE_OWN_ITEMS, hm), this._events.set(k.USER_BANNED, mm), this._events.set(k.MODERATION_CAUTION, gm), this._events.set(k.MODTOOL_ROOM_INFO, pm), this._events.set(k.MODTOOL_USER_CHATLOG, fm), this._events.set(k.MODTOOL_ROOM_CHATLOG, _m), this._events.set(k.MODERATION_USER_INFO, Em), this._events.set(k.MODERATION_TOOL, Im), this._events.set(k.MODTOOL_VISITED_ROOMS_USER, Cm), this._events.set(k.CFH_CHATLOG, Sm), this._events.set(k.ISSUE_DELETED, Tm), this._events.set(k.ISSUE_INFO, Nm), this._events.set(k.ISSUE_PICK_FAILED, Rm), this._events.set(k.MODERATOR_ACTION_RESULT, vm), this._events.set(k.MODERATOR_MESSAGE, bm), this._events.set(k.MODERATOR_TOOL_PREFERENCES, Om), this._events.set(k.MYSTERY_BOX_KEYS, dS), this._events.set(k.CAN_CREATE_ROOM, hS), this._events.set(k.CAN_CREATE_ROOM_EVENT, wm), this._events.set(k.CATEGORIES_WITH_VISITOR_COUNT, mS), this._events.set(k.COMPETITION_ROOMS_DATA, gS), this._events.set(k.CONVERTED_ROOM_ID, pS), this._events.set(k.ROOM_DOORBELL, ym), this._events.set(k.USER_FAVORITE_ROOM, fS), this._events.set(k.USER_FAVORITE_ROOM_COUNT, _S), this._events.set(k.ROOM_DOORBELL_REJECTED, Am), this._events.set(k.ROOM_CREATED, km), this._events.set(k.ROOM_INFO, cr), this._events.set(k.GUEST_ROOM_SEARCH_RESULT, ES), this._events.set(k.USER_HOME_ROOM, Mm), this._events.set(k.ROOM_EVENT_CANCEL, IS), this._events.set(k.ROOM_EVENT, CS), this._events.set(k.ROOM_INFO_UPDATED, Um), this._events.set(k.THUMBNAIL_UPDATE_RESULT, SS), this._events.set(k.NAVIGATOR_EVENT_CATEGORIES, Il), this._events.set(k.NAVIGATOR_CATEGORIES, Lm), this._events.set(k.NAVIGATOR_COLLAPSED, TS), this._events.set(k.NAVIGATOR_LIFTED, NS), this._events.set(k.NAVIGATOR_METADATA, Pm), this._events.set(k.NAVIGATOR_OPEN_ROOM_CREATOR, Dm), this._events.set(k.NAVIGATOR_SEARCHES, RS), this._events.set(k.NAVIGATOR_SEARCH, Fm), this._events.set(k.NAVIGATOR_SETTINGS, vS), this._events.set(k.GENERIC_ALERT, xm), this._events.set(k.MOTD_MESSAGES, Gm), this._events.set(k.NOTIFICATION_LIST, Bm), this._events.set(k.UNSEEN_ITEMS, Hm), this._events.set(k.ACHIEVEMENT_NOTIFICATION, Vm), this._events.set(k.INFO_FEED_ENABLE, Wm), this._events.set(k.CLUB_GIFT_NOTIFICATION, jm), this._events.set(k.ACTIVITY_POINT_NOTIFICATION, Cl), this._events.set(k.BOT_ERROR, bS), this._events.set(k.PET_LEVEL_NOTIFICATION, qm), this._events.set(k.USER_PERKS, Sl), this._events.set(k.QUESTION, OS), this._events.set(k.POLL_CONTENTS, wS), this._events.set(k.POLL_ERROR, yS), this._events.set(k.POLL_OFFER, AS), this._events.set(k.QUESTION_ANSWERED, kS), this._events.set(k.QUESTION_FINISHED, MS), this._events.set(k.COMMUNITY_GOAL_EARNED_PRIZES, US), this._events.set(k.COMMUNITY_GOAL_PROGRESS, LS), this._events.set(k.CONCURRENT_USERS_GOAL_PROGRESS, PS), this._events.set(k.QUEST_DAILY, DS), this._events.set(k.QUEST_CANCELLED, FS), this._events.set(k.QUEST_COMPLETED, xS), this._events.set(k.COMMUNITY_GOAL_HALL_OF_FAME, GS), this._events.set(k.EPIC_POPUP, BS), this._events.set(k.SEASONAL_QUESTS, HS), this._events.set(k.QUESTS, VS), this._events.set(k.QUEST, WS), this._events.set(k.ROOM_ENTER_ERROR, Ym), this._events.set(k.ROOM_ENTER, zm), this._events.set(k.ROOM_FORWARD, Km), this._events.set(k.ROOM_DOORBELL_ACCEPTED, $m), this._events.set(k.ROOM_RIGHTS_CLEAR, jS), this._events.set(k.ROOM_RIGHTS_OWNER, qS), this._events.set(k.ROOM_RIGHTS, YS), this._events.set(k.BOT_COMMAND_CONFIGURATION, Qm), this._events.set(k.ROOM_SETTINGS_CHAT, Xm), this._events.set(k.ROOM_INFO_OWNER, Tl), this._events.set(k.ROOM_SCORE, Jm), this._events.set(k.ROOM_ROLLING, zS), this._events.set(k.FURNITURE_FLOOR_ADD, KS), this._events.set(k.FURNITURE_FLOOR, $S), this._events.set(k.FURNITURE_FLOOR_REMOVE, QS), this._events.set(k.FURNITURE_FLOOR_UPDATE, XS), this._events.set(k.ITEM_WALL_ADD, JS), this._events.set(k.ITEM_WALL, ZS), this._events.set(k.ITEM_WALL_REMOVE, eT), this._events.set(k.ITEM_WALL_UPDATE, tT), this._events.set(k.FURNITURE_ALIASES, sT), this._events.set(k.FURNITURE_DATA, nT), this._events.set(k.FURNITURE_ITEMDATA, rT), this._events.set(k.ITEM_STACK_HELPER, Zm), this._events.set(k.FURNITURE_STATE, oT), this._events.set(k.ITEM_DIMMER_SETTINGS, iT), this._events.set(k.FURNITURE_STATE_2, aT), this._events.set(k.LOVELOCK_FURNI_FINISHED, eg), this._events.set(k.LOVELOCK_FURNI_FRIEND_COMFIRMED, tg), this._events.set(k.LOVELOCK_FURNI_START, sg), this._events.set(k.OBJECTS_DATA_UPDATE, lT), this._events.set(k.FURNITURE_GROUP_CONTEXT_MENU_INFO, ng), this._events.set(k.FURNITURE_POSTIT_STICKY_POLE_OPEN, rg), this._events.set(k.ROOM_SPECTATOR, cT), this._events.set(k.ROOM_RIGHTS_LIST, og), this._events.set(k.ROOM_RIGHTS_LIST_ADD, ig), this._events.set(k.ROOM_RIGHTS_LIST_REMOVE, ag), this._events.set(k.ROOM_BAN_LIST, lg), this._events.set(k.ROOM_SETTINGS_SAVE_ERROR, uT), this._events.set(k.ROOM_SETTINGS, cg), this._events.set(k.ROOM_SETTINGS_SAVE, dT), this._events.set(k.ROOM_SETTINGS_ERROR, hT), this._events.set(k.SHOW_ENFORCE_ROOM_CATEGORY, mT), this._events.set(k.ROOM_BAN_REMOVE, gT), this._events.set(k.ROOM_MUTED, pT), this._events.set(k.NO_SUCH_FLAT, fT), this._events.set(k.FAVORITE_GROUP_UDPATE, _T), this._events.set(k.ROOM_MODEL_DOOR, ug), this._events.set(k.ROOM_HEIGHT_MAP, ET), this._events.set(k.ROOM_HEIGHT_MAP_UPDATE, IT), this._events.set(k.ROOM_MODEL, dg), this._events.set(k.ROOM_MODEL_NAME, CT), this._events.set(k.ROOM_PAINT, ST), this._events.set(k.ROOM_THICKNESS, hg), this._events.set(k.ROOM_GET_FILTER_WORDS, mg), this._events.set(k.ROOM_MODEL_BLOCKED_TILES, gg), this._events.set(k.PET_FIGURE_UPDATE, TT), this._events.set(k.PET_INFO, NT), this._events.set(k.PET_STATUS, RT), this._events.set(k.PET_EXPERIENCE, vT), this._events.set(k.PLAYING_GAME, bT), this._events.set(k.UNIT_DANCE, OT), this._events.set(k.UNIT_EFFECT, wT), this._events.set(k.UNIT, yT), this._events.set(k.UNIT_EXPRESSION, AT), this._events.set(k.UNIT_HAND_ITEM, kT), this._events.set(k.UNIT_IDLE, MT), this._events.set(k.UNIT_INFO, UT), this._events.set(k.UNIT_NUMBER, LT), this._events.set(k.UNIT_REMOVE, PT), this._events.set(k.UNIT_STATUS, DT), this._events.set(k.HAND_ITEM_RECEIVED, FT), this._events.set(k.FLOOD_CONTROL, xT), this._events.set(k.REMAINING_MUTE, GT), this._events.set(k.UNIT_CHAT, BT), this._events.set(k.UNIT_CHAT_SHOUT, HT), this._events.set(k.UNIT_CHAT_WHISPER, VT), this._events.set(k.UNIT_TYPING, WT), this._events.set(k.WIRED_ACTION, pg), this._events.set(k.WIRED_CONDITION, fg), this._events.set(k.WIRED_TRIGGER, _g), this._events.set(k.WIRED_OPEN, jT), this._events.set(k.WIRED_REWARD, qT), this._events.set(k.WIRED_SAVE, Eg), this._events.set(k.WIRED_ERROR, YT), this._events.set(k.AUTHENTICATED, zT), this._events.set(k.JUKEBOX_PLAYLIST_FULL, KT), this._events.set(k.JUKEBOX_SONG_DISKS, $T), this._events.set(k.NOW_PLAYING, QT), this._events.set(k.OFFICIAL_SONG_ID, Ig), this._events.set(k.PLAYLIST, XT), this._events.set(k.PLAYLIST_SONG_ADDED, JT), this._events.set(k.TRAX_SONG_INFO, ZT), this._events.set(k.USER_SONG_DISKS_INVENTORY, eN), this._events.set(k.HELPER_TALENT_TRACK, tN), this._events.set(k.IN_CLIENT_LINK, sN), this._events.set(k.USER_IGNORED, nN), this._events.set(k.USER_IGNORED_RESULT, rN), this._events.set(k.USER_RESPECT, Cg), this._events.set(k.USER_PERMISSIONS, Sg), this._events.set(k.USER_BADGES_CURRENT, Tg), this._events.set(k.USER_INFO, Nl), this._events.set(k.UNIT_CHANGE_NAME, Ng), this._events.set(k.USER_PROFILE, Rg), this._events.set(k.MESSENGER_RELATIONSHIPS, Rl), this._events.set(k.GET_USER_TAGS, oN), this._events.set(k.GIFT_OPENED, iN), this._events.set(k.USER_CREDITS, vg), this._events.set(k.USER_CURRENCY, bg), this._events.set(k.USER_SUBSCRIPTION, Og), this._events.set(k.USER_WARDROBE_PAGE, wg), this._events.set(k.SCR_SEND_KICKBACK_INFO, yg), this._events.set(k.PET_RESPECTED, aN), this._events.set(k.PET_SUPPLEMENT, lN), this._events.set(k.GENERIC_ERROR, Ag), this._events.set(k.GROUP_LIST, kg), this._events.set(k.CATALOG_APPROVE_NAME_RESULT, Mg), this._events.set(k.NOOBNESS_LEVEL, cN), this._events.set(k.ACHIEVEMENTRESOLUTIONCOMPLETED, uN), this._events.set(k.ACHIEVEMENTRESOLUTIONPROGRESS, dN), this._events.set(k.ACHIEVEMENTRESOLUTIONS, hN), this._events.set(k.LOAD_GAME_URL, Ha), this._events.set(k.LOADGAME, mN), this._events.set(k.UNLOADGAME, Ug), this._events.set(k.GAME_CENTER_GAME_LIST, Lg), this._events.set(k.GAMESTATUSMESSAGE, Pg), this._events.set(k.GAME_CENTER_ACHIEVEMENTS, gN), this._events.set(k.GAME_CENTER_STATUS, Dg), this._events.set(k.GAMEACHIEVEMENTS, pN), this._events.set(k.GAMEINVITE, fN), this._events.set(k.JOINEDQUEUEMESSAGE, Fg), this._events.set(k.JOININGQUEUEFAILED, _N), this._events.set(k.LEFTQUEUE, xg)
  7170. }
  7171. registerComposers() {
  7172. this._composers.set(A.AUTHENTICATION, EN), this._composers.set(A.INTERSTITIAL_SHOWN, IN), this._composers.set(A.GET_INTERSTITIAL, CN), this._composers.set(A.GET_WARDROBE, Gg), this._composers.set(A.SAVE_WARDROBE_OUTFIT, Bg), this._composers.set(A.CHANGE_USERNAME, Hg), this._composers.set(A.CHECK_USERNAME, Vg), this._composers.set(A.REQUEST_CAMERA_CONFIGURATION, vd), this._composers.set(A.RENDER_ROOM, SN), this._composers.set(A.RENDER_ROOM_THUMBNAIL, TN), this._composers.set(A.PURCHASE_PHOTO, Wg), this._composers.set(A.PUBLISH_PHOTO, jg), this._composers.set(A.PHOTO_COMPETITION, NN), this._composers.set(A.OPEN_CAMPAIGN_CALENDAR_DOOR, qg), this._composers.set(A.OPEN_CAMPAIGN_CALENDAR_DOOR_STAFF, Yg), this._composers.set(A.BUILDERS_CLUB_PLACE_ROOM_ITEM, zg), this._composers.set(A.BUILDERS_CLUB_PLACE_WALL_ITEM, Kg), this._composers.set(A.BUILDERS_CLUB_QUERY_FURNI_COUNT, $g), this._composers.set(A.GET_CATALOG_INDEX, Qg), this._composers.set(A.GET_CATALOG_PAGE, Xg), this._composers.set(A.CATALOG_PURCHASE, Yr), this._composers.set(A.CATALOG_PURCHASE_GIFT, Jg), this._composers.set(A.GET_PRODUCT_OFFER, dd), this._composers.set(A.GET_CLUB_OFFERS, Zg), this._composers.set(A.GET_CLUB_GIFT_INFO, vl), this._composers.set(A.CATALOG_REDEEM_VOUCHER, ep), this._composers.set(A.GROUP_MEMBERSHIPS, bl), this._composers.set(A.GET_GIFT_WRAPPING_CONFIG, tp), this._composers.set(A.CATALOG_SELECT_VIP_GIFT, sp), this._composers.set(A.CATALOG_REQUESET_PET_BREEDS, np), this._composers.set(A.GET_BONUS_RARE_INFO, RN), this._composers.set(A.GET_BUNDLE_DISCOUNT_RULESET, rp), this._composers.set(A.GET_CATALOG_PAGE_EXPIRATION, vN), this._composers.set(A.GET_CATALOG_PAGE_WITH_EARLIEST_EXP, bN), this._composers.set(A.GET_DIRECT_CLUB_BUY_AVAILABLE, ON), this._composers.set(A.GET_HABBO_BASIC_MEMBERSHIP_EXTEND_OFFER, wN), this._composers.set(A.GET_HABBO_CLUB_EXTEND_OFFER, yN), this._composers.set(A.GET_IS_OFFER_GIFTABLE, AN), this._composers.set(A.GET_LIMITED_OFFER_APPEARING_NEXT, kN), this._composers.set(A.GET_NEXT_TARGETED_OFFER, MN), this._composers.set(A.GET_ROOM_AD_PURCHASE_INFO, op), this._composers.set(A.GET_SEASONAL_CALENDAR_DAILY_OFFER, ip), this._composers.set(A.GET_TARGETED_OFFER, Ol), this._composers.set(A.MARK_CATALOG_NEW_ADDITIONS_PAGE_OPENED, UN), this._composers.set(A.PURCHASE_BASIC_MEMBERSHIP_EXTENSION, LN), this._composers.set(A.PURCHASE_ROOM_AD, ap), this._composers.set(A.PURCHASE_TARGETED_OFFER, lp), this._composers.set(A.PURCHASE_VIP_MEMBERSHIP_EXTENSION, PN), this._composers.set(A.ROOM_AD_PURCHASE_INITIATED, DN), this._composers.set(A.SET_TARGETTED_OFFER_STATE, FN), this._composers.set(A.SHOP_TARGETED_OFFER_VIEWED, xN), this._composers.set(we.RECYCLE_ITEMS, kE), this._composers.set(A.FORWARD_TO_A_COMPETITION_ROOM, GN), this._composers.set(A.FORWARD_TO_A_SUBMITTABLE_ROOM, BN), this._composers.set(A.FORWARD_TO_RANDOM_COMPETITION_ROOM, HN), this._composers.set(A.GET_CURRENT_TIMING_CODE, VN), this._composers.set(A.GET_IS_USER_PART_OF_COMPETITION, WN), this._composers.set(A.GET_SECONDS_UNTIL, jN), this._composers.set(A.ROOM_COMPETITION_INIT, qN), this._composers.set(A.SUBMIT_ROOM_TO_COMPETITION, YN), this._composers.set(A.VOTE_FOR_ROOM, zN), this._composers.set(A.CRAFT, cp), this._composers.set(A.CRAFT_SECRET, KN), this._composers.set(A.GET_CRAFTABLE_PRODUCTS, up), this._composers.set(A.GET_CRAFTING_RECIPE, dp), this._composers.set(A.GET_CRAFTING_RECIPES_AVAILABLE, $N), this._composers.set(A.FRIEND_FURNI_CONFIRM_LOCK, hp), this._composers.set(A.ACCEPT_FRIEND, mp), this._composers.set(A.DECLINE_FRIEND, Va), this._composers.set(A.FIND_NEW_FRIENDS, QN), this._composers.set(A.FOLLOW_FRIEND, ki), this._composers.set(A.FRIEND_LIST_UPDATE, gp), this._composers.set(A.GET_FRIEND_REQUESTS, pp), this._composers.set(A.HABBO_SEARCH, fp), this._composers.set(A.MESSENGER_INIT, _p), this._composers.set(A.REMOVE_FRIEND, Ep), this._composers.set(A.REQUEST_FRIEND, wl), this._composers.set(A.MESSENGER_CHAT, Ip), this._composers.set(A.SEND_ROOM_INVITE, Cp), this._composers.set(A.SET_RELATIONSHIP_STATUS, Sr), this._composers.set(A.VISIT_USER, XN), this._composers.set(A.GET_GIFT, JN), this._composers.set(A.RESET_PHONE_NUMBER_STATE, ZN), this._composers.set(A.SET_PHONE_NUMBER_VERIFICATION_STATUS, eR), this._composers.set(A.TRY_PHONE_NUMBER, tR), this._composers.set(A.VERIFY_CODE, sR), this._composers.set(A.GET_FORUM_STATS, nR), this._composers.set(A.GET_FORUMS_LIST, rR), this._composers.set(A.GET_FORUM_MESSAGES, oR), this._composers.set(A.GET_FORUM_THREAD, iR), this._composers.set(A.GET_FORUM_THREADS, aR), this._composers.set(A.GET_UNREAD_FORUMS_COUNT, lR), this._composers.set(A.FORUM_MODERATE_MESSAGE, cR), this._composers.set(A.FORUM_MODERATE_THREAD, uR), this._composers.set(A.FORUM_POST_MESSAGE, dR), this._composers.set(A.UPDATE_FORUM_READ_MARKER, hR), this._composers.set(A.UPDATE_FORUM_SETTINGS, mR), this._composers.set(A.FORUM_UPDATE_THREAD, gR), this._composers.set(A.CLIENT_PONG, pR), this._composers.set(A.RELEASE_VERSION, fR), this._composers.set(A.USER_INFO, _R), this._composers.set(A.DISCONNECT, ER), this._composers.set(A.SECURITY_MACHINE, IR), this._composers.set(A.CLIENT_VARIABLES, CR), this._composers.set(A.CALL_FOR_HELP_FROM_FORUM_MESSAGE, Sp), this._composers.set(A.CALL_FOR_HELP_FROM_FORUM_THREAD, Tp), this._composers.set(A.CALL_FOR_HELP_FROM_IM, Np), this._composers.set(A.CALL_FOR_HELP_FROM_PHOTO, Rp), this._composers.set(A.CALL_FOR_HELP_FROM_SELFIE, SR), this._composers.set(A.CALL_FOR_HELP, vp), this._composers.set(A.CHAT_REVIEW_GUIDE_DECIDES, TR), this._composers.set(A.CHAT_REVIEW_GUIDE_DETACHED, NR), this._composers.set(A.CHAT_REVIEW_GUIDE_VOTE, RR), this._composers.set(A.CHAT_REVIEW_SESSION_CREATE, vR), this._composers.set(A.DELETE_PENDING_CALLS_FOR_HELP, bp), this._composers.set(A.GET_CFH_STATUS, yl), this._composers.set(A.GET_FAQ_CATEGORY, bR), this._composers.set(A.GET_FAQ_TEXT, OR), this._composers.set(A.GET_GUIDE_REPORTING_STATUS, wR), this._composers.set(A.GET_PENDING_CALLS_FOR_HELP, Op), this._composers.set(A.GET_QUIZ_QUESTIONS, yR), this._composers.set(A.GUIDE_SESSION_CREATE, wp), this._composers.set(A.GUIDE_SESSION_FEEDBACK, yp), this._composers.set(A.GUIDE_SESSION_GET_REQUESTER_ROOM, Ap), this._composers.set(A.GUIDE_SESSION_GUIDE_DECIDES, kp), this._composers.set(A.GUIDE_SESSION_INVITE_REQUESTER, Mp), this._composers.set(A.GUIDE_SESSION_IS_TYPING, Up), this._composers.set(A.GUIDE_SESSION_MESSAGE, Lp), this._composers.set(A.GUIDE_SESSION_ON_DUTY_UPDATE, di), this._composers.set(A.GUIDE_SESSION_REPORT, AR), this._composers.set(A.GUIDE_SESSION_REQUESTER_CANCELS, Pp), this._composers.set(A.GUIDE_SESSION_RESOLVED, Dp), this._composers.set(A.POST_QUIZ_ANSWERS, kR), this._composers.set(A.SEARCH_FAQS, MR), this._composers.set(A.DESKTOP_VIEW, hd), this._composers.set(A.GROUP_INFO, Mr), this._composers.set(A.GROUP_REQUEST, fd), this._composers.set(A.GROUP_MEMBER_REMOVE_CONFIRM, Fp), this._composers.set(A.GROUP_MEMBER_REMOVE, Mi), this._composers.set(A.GROUP_MEMBERS, Wa), this._composers.set(A.GROUP_ADMIN_ADD, xp), this._composers.set(A.GROUP_ADMIN_REMOVE, Gp), this._composers.set(A.GROUP_REQUEST_ACCEPT, Bp), this._composers.set(A.GROUP_REQUEST_DECLINE, Hp), this._composers.set(A.GROUP_DELETE, Vp), this._composers.set(A.GROUP_CREATE_OPTIONS, Wp), this._composers.set(A.GROUP_PARTS, jp), this._composers.set(A.GROUP_BUY, qp), this._composers.set(A.GROUP_SETTINGS, Yp), this._composers.set(A.GROUP_SAVE_BADGE, zp), this._composers.set(A.GROUP_SAVE_COLORS, Kp), this._composers.set(A.GROUP_SAVE_INFORMATION, $p), this._composers.set(A.GROUP_SAVE_PREFERENCES, Qp), this._composers.set(A.GROUP_FAVORITE, pd), this._composers.set(A.GROUP_UNFAVORITE, gd), this._composers.set(A.GROUP_BADGES, UR), this._composers.set(A.ROOM_FAVORITE, LR), this._composers.set(A.CAN_CREATE_ROOM, PR), this._composers.set(A.CANCEL_ROOM_EVENT, DR), this._composers.set(A.CONVERT_GLOBAL_ROOM_ID, Xp), this._composers.set(A.COMPETITION_ROOM_SEARCH, FR), this._composers.set(A.ROOM_CREATE, Jp), this._composers.set(A.GET_USER_FLAT_CATS, Zp), this._composers.set(A.GET_USER_EVENT_CATS, Al), this._composers.set(A.ROOM_FAVORITE_REMOVE, xR), this._composers.set(A.EDIT_ROOM_EVENT, GR), this._composers.set(A.FORWARD_TO_RANDOM_PROMOTED_ROOM, BR), this._composers.set(A.FORWARD_TO_SOME_ROOM, HR), this._composers.set(A.GET_CATEGORIES_WITH_USER_COUNT, VR), this._composers.set(A.GET_GUEST_ROOM, fo), this._composers.set(A.GET_OFFICIAL_ROOMS, WR), this._composers.set(A.GET_POPULAR_ROOM_TAGS, jR), this._composers.set(A.GUILD_BASE_SEARCH, qR), this._composers.set(A.MY_FAVOURITE_ROOMS_SEARCH, YR), this._composers.set(A.MY_FREQUENT_ROOM_HISTORY_SEARCH, zR), this._composers.set(A.MY_FRIENDS_ROOM_SEARCH, KR), this._composers.set(A.MY_GUILD_BASES_SEARCH, $R), this._composers.set(A.MY_RECOMMENDED_ROOMS, QR), this._composers.set(A.MY_ROOM_HISTORY_SEARCH, XR), this._composers.set(A.MY_ROOM_RIGHTS_SEARCH, JR), this._composers.set(A.MY_ROOMS_SEARCH, ZR), this._composers.set(A.POPULAR_ROOMS_SEARCH, ev), this._composers.set(A.ROOM_LIKE, ef), this._composers.set(A.ROOM_RIGHTS_REMOVE_OWN, tv), this._composers.set(A.ROOM_AD_EVENT_TAB_CLICKED, sv), this._composers.set(A.ROOM_AD_EVENT_TAB_VIEWED, nv), this._composers.set(A.ROOM_AD_SEARCH, rv), this._composers.set(A.ROOM_TEXT_SEARCH, ov), this._composers.set(A.ROOMS_WHERE_MY_FRIENDS_ARE, iv), this._composers.set(A.ROOMS_WITH_HIGHEST_SCORE_SEARCH, av), this._composers.set(A.SET_ROOM_SESSION_TAGS, lv), this._composers.set(A.ROOM_STAFF_PICK, tf), this._composers.set(A.USER_HOME_ROOM, sf), this._composers.set(A.UPDATE_ROOM_THUMBNAIL, cv), this._composers.set(A.ROOM_FILTER_WORDS, nf), this._composers.set(A.NAVIGATOR_INIT, rf), this._composers.set(A.NAVIGATOR_SEARCH_CLOSE, uv), this._composers.set(A.NAVIGATOR_SEARCH, kl), this._composers.set(A.NAVIGATOR_SEARCH_OPEN, dv), this._composers.set(A.NAVIGATOR_SEARCH_SAVE, hv), this._composers.set(A.NAVIGATOR_SETTINGS_SAVE, mv), this._composers.set(A.NAVIGATOR_CATEGORY_LIST_MODE, gv), this._composers.set(A.POLL_ANSWER, pv), this._composers.set(A.POLL_REJECT, fv), this._composers.set(A.POLL_START, _v), this._composers.set(A.USER_BADGES, of), this._composers.set(A.USER_BADGES_CURRENT_UPDATE, af), this._composers.set(A.USER_BOTS, ja), this._composers.set(A.USER_FURNITURE, lf), this._composers.set(A.REQUESTFURNIINVENTORYWHENNOTINROOM, Ev), this._composers.set(A.USER_PETS, qa), this._composers.set(A.TRADE_ACCEPT, cf), this._composers.set(A.TRADE_CANCEL, uf), this._composers.set(A.TRADE_CLOSE, df), this._composers.set(A.TRADE_CONFIRM, hf), this._composers.set(A.TRADE_ITEM, Ya), this._composers.set(A.TRADE_ITEMS, mf), this._composers.set(A.TRADE_ITEM_REMOVE, gf), this._composers.set(A.TRADE, pf), this._composers.set(A.TRADE_UNACCEPT, ff), this._composers.set(A.UNSEEN_RESET_CATEGORY, _f), this._composers.set(A.UNSEEN_RESET_ITEMS, Ef), this._composers.set(A.ACHIEVEMENT_LIST, Nd), this._composers.set(A.PET_MOUNT, Iv), this._composers.set(A.PET_RESPECT, Ui), this._composers.set(A.PET_SUPPLEMENT, Cv), this._composers.set(A.REMOVE_PET_SADDLE, Sv), this._composers.set(A.PET_INFO, Tv), this._composers.set(A.TOGGLE_PET_BREEDING, Nv), this._composers.set(A.TOGGLE_PET_RIDING, Rv), this._composers.set(A.USE_PET_PRODUCT, vv), this._composers.set(A.ROOM_ENTER, bv), this._composers.set(A.ROOM_DOORBELL, Ov), this._composers.set(A.GO_TO_FLAT, wv), this._composers.set(A.ROOM_AMBASSADOR_ALERT, yv), this._composers.set(A.ROOM_BAN_GIVE, Av), this._composers.set(A.ROOM_BAN_REMOVE, If), this._composers.set(A.ROOM_RIGHTS_GIVE, Cf), this._composers.set(A.ROOM_KICK, kv), this._composers.set(A.ROOM_MUTE_USER, Mv), this._composers.set(A.ROOM_RIGHTS_REMOVE, Sf), this._composers.set(A.ROOM_RIGHTS_REMOVE_ALL, Tf), this._composers.set(A.ROOM_DELETE, Nf), this._composers.set(A.ROOM_SETTINGS, Ml), this._composers.set(A.ROOM_SETTINGS_SAVE, Rf), this._composers.set(A.ROOM_RIGHTS_LIST, vf), this._composers.set(A.ROOM_BAN_LIST, Ul), this._composers.set(A.USER_TAGS, Uv), this._composers.set(A.BOT_CONFIGURATION, bf), this._composers.set(A.GET_ITEM_DATA, Lv), this._composers.set(A.REMOVE_WALL_ITEM, Pv), this._composers.set(A.BOT_PLACE, Dv), this._composers.set(A.BOT_PICKUP, Ll), this._composers.set(A.BOT_SKILL_SAVE, rn), this._composers.set(A.PET_PLACE, Fv), this._composers.set(A.PET_MOVE, xv), this._composers.set(A.PET_PICKUP, Gv), this._composers.set(A.SET_ITEM_DATA, Bv), this._composers.set(A.SET_OBJECT_DATA, Of), this._composers.set(A.COMPOST_PLANT, Hv), this._composers.set(A.HARVEST_PET, Vv), this._composers.set(A.FURNITURE_ALIASES, Wv), this._composers.set(A.FURNITURE_GROUP_INFO, jv), this._composers.set(A.FURNITURE_PICKUP, qv), this._composers.set(A.FURNITURE_PLACE, wf), this._composers.set(A.ITEM_PAINT, ao), this._composers.set(A.FURNITURE_POSTIT_PLACE, Yv), this._composers.set(A.FURNITURE_POSTIT_SAVE_STICKY_POLE, yf), this._composers.set(A.CONTROL_YOUTUBE_DISPLAY_PLAYBACK, zv), this._composers.set(A.GET_YOUTUBE_DISPLAY_STATUS, Kv), this._composers.set(A.SET_YOUTUBE_DISPLAY_PLAYLIST, $v), this._composers.set(A.FURNITURE_FLOOR_UPDATE, Qv), this._composers.set(A.FURNITURE_WALL_UPDATE, Xv), this._composers.set(A.ITEM_DIMMER_SETTINGS, Jv), this._composers.set(A.ITEM_DIMMER_SAVE, Zv), this._composers.set(A.ITEM_DIMMER_TOGGLE, eb), this._composers.set(A.ROOM_TONER_APPLY, Af), this._composers.set(A.ITEM_COLOR_WHEEL_CLICK, tb), this._composers.set(A.ITEM_DICE_CLICK, sb), this._composers.set(A.ITEM_DICE_CLOSE, nb), this._composers.set(A.FURNITURE_MULTISTATE, Ei), this._composers.set(A.FURNITURE_RANDOMSTATE, rb), this._composers.set(A.ITEM_STACK_HELPER, Ii), this._composers.set(A.FURNITURE_WALL_MULTISTATE, ob), this._composers.set(A.ONE_WAY_DOOR_CLICK, ib), this._composers.set(A.ITEM_EXCHANGE_REDEEM, kf), this._composers.set(A.ITEM_CLOTHING_REDEEM, Mf), this._composers.set(A.ROOM_MODEL, ab), this._composers.set(A.GET_OCCUPIED_TILES, Uf), this._composers.set(A.GET_ROOM_ENTRY_TILE, Lf), this._composers.set(A.ROOM_MODEL_SAVE, Pl), this._composers.set(A.UNIT_ACTION, lb), this._composers.set(A.UNIT_DANCE, cb), this._composers.set(A.UNIT_DROP_HAND_ITEM, Pf), this._composers.set(A.UNIT_GIVE_HANDITEM, Df), this._composers.set(A.UNIT_GIVE_HANDITEM_PET, Dl), this._composers.set(A.UNIT_LOOK, ub), this._composers.set(A.UNIT_SIGN, db), this._composers.set(A.UNIT_POSTURE, hb), this._composers.set(A.UNIT_CHAT_SHOUT, mb), this._composers.set(A.USER_SETTINGS_CHAT_STYLE, Ff), this._composers.set(A.UNIT_CHAT_WHISPER, gb), this._composers.set(A.UNIT_TYPING, pb), this._composers.set(A.UNIT_TYPING_STOP, fb), this._composers.set(A.WIRED_APPLY_SNAPSHOT, _b), this._composers.set(A.WIRED_OPEN, Eb), this._composers.set(A.WIRED_ACTION_SAVE, xf), this._composers.set(A.WIRED_CONDITION_SAVE, Gf), this._composers.set(A.WIRED_TRIGGER_SAVE, Bf), this._composers.set(A.ROOM_MUTE, Hf), this._composers.set(A.APPROVE_NAME, Vf), this._composers.set(A.USER_RESPECT, Ib), this._composers.set(A.SCR_GET_KICKBACK_INFO, Wf), this._composers.set(A.USER_IGNORED, Cb), this._composers.set(A.USER_IGNORE, Sb), this._composers.set(A.USER_IGNORE_ID, Tb), this._composers.set(A.USER_UNIGNORE, Nb), this._composers.set(A.USER_BADGES_CURRENT, jf), this._composers.set(A.USER_FIGURE, Fl), this._composers.set(A.USER_MOTTO, Rb), this._composers.set(A.USER_PROFILE, Ed), this._composers.set(A.USER_PROFILE_BY_NAME, vb), this._composers.set(A.MESSENGER_RELATIONSHIPS, xl), this._composers.set(A.MANNEQUIN_SAVE_NAME, qf), this._composers.set(A.MANNEQUIN_SAVE_LOOK, Yf), this._composers.set(A.PRESENT_OPEN_PRESENT, bb), this._composers.set(A.MARKETPLACE_CONFIG, zf), this._composers.set(A.MARKETPLACE_SELL_ITEM, Kf), this._composers.set(A.MARKETPLACE_REQUEST_OWN_ITEMS, $f), this._composers.set(A.MARKETPLACE_TAKE_BACK_ITEM, Qf), this._composers.set(A.MARKETPLACE_REQUEST_OFFERS, Xf), this._composers.set(A.MARKETPLACE_BUY_OFFER, za), this._composers.set(A.MARKETPLACE_REDEEM_CREDITS, Jf), this._composers.set(A.MARKETPLACE_BUY_TOKENS, Ob), this._composers.set(A.REQUEST_SELL_ITEM, wb), this._composers.set(A.REQUEST_MARKETPLACE_ITEM_STATS, Zf), this._composers.set(A.USER_BOTS, ja), this._composers.set(A.USER_PETS, qa), this._composers.set(A.USER_CURRENCY, e_), this._composers.set(A.USER_SUBSCRIPTION, Ka), this._composers.set(A.MODTOOL_REQUEST_ROOM_INFO, t_), this._composers.set(A.MODTOOL_CHANGE_ROOM_SETTINGS, $a), this._composers.set(A.MODTOOL_REQUEST_USER_CHATLOG, s_), this._composers.set(A.MODTOOL_REQUEST_ROOM_CHATLOG, n_), this._composers.set(A.MOD_TOOL_USER_INFO, r_), this._composers.set(A.MODTOOL_SANCTION_ALERT, o_), this._composers.set(A.MODTOOL_SANCTION_BAN, i_), this._composers.set(A.MODTOOL_SANCTION_KICK, a_), this._composers.set(A.MODTOOL_SANCTION_TRADELOCK, l_), this._composers.set(A.MODTOOL_ALERTEVENT, Gl), this._composers.set(A.MODTOOL_SANCTION_MUTE, c_), this._composers.set(A.MODTOOL_REQUEST_USER_ROOMS, u_), this._composers.set(A.MODTOOL_ROOM_ALERT, ro), this._composers.set(A.CLOSE_ISSUE_DEFAULT_ACTION, yb), this._composers.set(A.CLOSE_ISSUES, oo), this._composers.set(A.DEFAULT_SANCTION, d_), this._composers.set(A.GET_CFH_CHATLOG, h_), this._composers.set(A.MODTOOL_PREFERENCES, Ab), this._composers.set(A.MODTOOL_SANCTION, kb), this._composers.set(A.PICK_ISSUES, m_), this._composers.set(A.RELEASE_ISSUES, Bl), this._composers.set(A.USER_SETTINGS_CAMERA, g_), this._composers.set(A.USER_SETTINGS_OLD_CHAT, Mb), this._composers.set(A.USER_SETTINGS_INVITES, p_), this._composers.set(A.USER_SETTINGS_VOLUME, f_), this._composers.set(A.COMMUNITY_GOAL_VOTE_COMPOSER, Ub), this._composers.set(A.GET_PROMO_ARTICLES, Lb), this._composers.set(A.ACCEPT_QUEST, Pb), this._composers.set(A.ACTIVATE_QUEST, Db), this._composers.set(A.CANCEL_QUEST, Fb), this._composers.set(A.FRIEND_REQUEST_QUEST_COMPLETE, xb), this._composers.set(A.GET_COMMUNITY_GOAL_EARNED_PRIZES, Gb), this._composers.set(A.GET_COMMUNITY_GOAL_HALL_OF_FAME, Bb), this._composers.set(A.GET_COMMUNITY_GOAL_PROGRESS, Hb), this._composers.set(A.GET_CONCURRENT_USERS_GOAL_PROGRESS, Vb), this._composers.set(A.GET_CONCURRENT_USERS_REWARD, Wb), this._composers.set(A.GET_DAILY_QUEST, jb), this._composers.set(A.GET_QUESTS, qb), this._composers.set(A.GET_SEASONAL_QUESTS_ONLY, Yb), this._composers.set(A.OPEN_QUEST_TRACKER, zb), this._composers.set(A.REDEEM_COMMUNITY_GOAL_PRIZE, Kb), this._composers.set(A.REJECT_QUEST, $b), this._composers.set(A.START_CAMPAIGN, Qb), this._composers.set(A.GET_SOUND_SETTINGS, Xb), this._composers.set(A.ADD_JUKEBOX_DISK, __), this._composers.set(A.GET_JUKEBOX_PLAYLIST, Jb), this._composers.set(A.GET_NOW_PLAYING, Zb), this._composers.set(A.GET_OFFICIAL_SONG_ID, E_), this._composers.set(A.GET_SONG_INFO, eO), this._composers.set(A.GET_SOUND_MACHINE_PLAYLIST, tO), this._composers.set(A.GET_USER_SONG_DISKS, sO), this._composers.set(A.REMOVE_JUKEBOX_DISK, I_), this._composers.set(A.HELPER_TALENT_TRACK, nO), this._composers.set(A.ACHIEVEMENT_RESOLUTION_OPEN, rO), this._composers.set(A.ACCEPTGAMEINVITE, oO), this._composers.set(A.GAMEUNLOADEDMESSAGE, iO), this._composers.set(A.GETGAMEACHIEVEMENTSMESSAGE, aO), this._composers.set(A.GAMES_LIST, C_), this._composers.set(A.GETGAMESTATUSMESSAGE, S_), this._composers.set(A.GETUSERGAMEACHIEVEMENTSMESSAGE, lO), this._composers.set(A.JOINQUEUEMESSAGE, T_), this._composers.set(A.LEAVEQUEUEMESSAGE, N_), this._composers.set(A.RESETRESOLUTIONACHIEVEMENTMESSAGE, cO), this._composers.set(A.GAMES_INIT, uO), this._composers.set(A.GETWEEKLYGAMEREWARDWINNERS, dO), this._composers.set(A.GAME2GETACCOUNTGAMESTATUSMESSAGE, R_), this._composers.set(A.GAME2CHECKGAMEDIRECTORYSTATUSMESSAGE, hO), this._composers.set(A.GAME2EXITGAMEMESSAGE, Hl), this._composers.set(A.GAME2GAMECHATMESSAGE, mO), this._composers.set(A.GAME2LOADSTAGEREADYMESSAGE, gO), this._composers.set(A.GAME2PLAYAGAINMESSAGE, pO), this._composers.set(A.GAME2REQUESTFULLSTATUSUPDATEMESSAGE, fO), this._composers.set(A.GAME2GETWEEKLYFRIENDSLEADERBOARD, _O), this._composers.set(A.GAME2GETWEEKLYLEADERBOARD, EO)
  7173. }
  7174. get events() {
  7175. return this._events
  7176. }
  7177. get composers() {
  7178. return this._composers
  7179. }
  7180. }
  7181. class _k {
  7182. constructor() {
  7183. this.init()
  7184. }
  7185. init() {
  7186. _e().communication._messages = new fk, this.objectFactory()
  7187. }
  7188. objectFactory() {
  7189. _e().roomEngine.logicFactory.getLogicType = this.getLogicType
  7190. }
  7191. getLogicType(e) {
  7192. if (!e) return null;
  7193. let s = null;
  7194. switch (e) {
  7195. case $.FURNITURE_TIP_JAR:
  7196. s = gk;
  7197. break;
  7198. case $.ROOM:
  7199. s = ww;
  7200. break;
  7201. case $.TILE_CURSOR:
  7202. s = Ow;
  7203. break;
  7204. case $.SELECTION_ARROW:
  7205. s = bw;
  7206. break;
  7207. case $.USER:
  7208. case $.BOT:
  7209. case $.RENTABLE_BOT:
  7210. s = vw;
  7211. break;
  7212. case $.PET:
  7213. s = Rw;
  7214. break;
  7215. case $.FURNITURE_BASIC:
  7216. s = Ba;
  7217. break;
  7218. case $.FURNITURE_BADGE_DISPLAY:
  7219. s = Nw;
  7220. break;
  7221. case $.FURNITURE_CHANGE_STATE_WHEN_STEP_ON:
  7222. s = Tw;
  7223. break;
  7224. case $.FURNITURE_COUNTER_CLOCK:
  7225. s = Sw;
  7226. break;
  7227. case $.FURNITURE_CRACKABLE:
  7228. s = Cw;
  7229. break;
  7230. case $.FURNITURE_CREDIT:
  7231. s = Iw;
  7232. break;
  7233. case $.FURNITURE_CUSTOM_STACK_HEIGHT:
  7234. s = Ew;
  7235. break;
  7236. case $.FURNITURE_DICE:
  7237. s = _w;
  7238. break;
  7239. case $.FURNITURE_EDITABLE_INTERNAL_LINK:
  7240. s = fw;
  7241. break;
  7242. case $.FURNITURE_EDITABLE_ROOM_LINK:
  7243. s = pw;
  7244. break;
  7245. case $.FURNITURE_EXTERNAL_IMAGE_WALLITEM:
  7246. s = gw;
  7247. break;
  7248. case $.FURNITURE_FIREWORKS:
  7249. s = mw;
  7250. break;
  7251. case $.FURNITURE_FLOOR_HOLE:
  7252. s = hw;
  7253. break;
  7254. case $.FURNITURE_GUILD_CUSTOMIZED:
  7255. s = dw;
  7256. break;
  7257. case $.FURNITURE_HIGH_SCORE:
  7258. s = uw;
  7259. break;
  7260. case $.FURNITURE_HOCKEY_SCORE:
  7261. s = cw;
  7262. break;
  7263. case $.FURNITURE_ES:
  7264. s = lw;
  7265. break;
  7266. case $.FURNITURE_MANNEQUIN:
  7267. s = aw;
  7268. break;
  7269. case $.FURNITURE_MULTIHEIGHT:
  7270. s = iw;
  7271. break;
  7272. case $.FURNITURE_MULTISTATE:
  7273. s = ow;
  7274. break;
  7275. case $.FURNITURE_ONE_WAY_DOOR:
  7276. s = rw;
  7277. break;
  7278. case $.FURNITURE_PET_CUSTOMIZATION:
  7279. s = nw;
  7280. break;
  7281. case $.FURNITURE_PRESENT:
  7282. s = sw;
  7283. break;
  7284. case $.FURNITURE_PURCHASABLE_CLOTHING:
  7285. s = tw;
  7286. break;
  7287. case $.FURNITURE_PUSHABLE:
  7288. s = ew;
  7289. break;
  7290. case $.FURNITURE_BACKGROUND_COLOR:
  7291. s = ZO;
  7292. break;
  7293. case $.FURNITURE_BG:
  7294. s = JO;
  7295. break;
  7296. case $.FURNITURE_BB:
  7297. s = XO;
  7298. break;
  7299. case $.FURNITURE_ROOMDIMMER:
  7300. s = QO;
  7301. break;
  7302. case $.FURNITURE_SCORE:
  7303. s = $O;
  7304. break;
  7305. case $.FURNITURE_SOUNDBLOCK:
  7306. s = KO;
  7307. break;
  7308. case $.FURNITURE_STICKIE:
  7309. s = zO;
  7310. break;
  7311. case $.FURNITURE_TROPHY:
  7312. s = YO;
  7313. break;
  7314. case $.FURNITURE_VOTE_COUNTER:
  7315. s = qO;
  7316. break;
  7317. case $.FURNITURE_VOTE_MAJORITY:
  7318. s = jO;
  7319. break;
  7320. case $.FURNITURE_WINDOW:
  7321. s = WO;
  7322. break;
  7323. case $.FURNITURE_LOVELOCK:
  7324. s = VO;
  7325. break;
  7326. case $.FURNITURE_YOUTUBE:
  7327. s = HO;
  7328. break;
  7329. case $.FURNITURE_CRAFTING_GIZMO:
  7330. s = BO;
  7331. break;
  7332. case $.FURNITURE_RENTABLE_SPACE:
  7333. s = GO;
  7334. break;
  7335. case $.FURNITURE_EFFECTBOX:
  7336. s = xO;
  7337. break;
  7338. case $.FURNITURE_MONSTERPLANT_SEED:
  7339. s = FO;
  7340. break;
  7341. case $.FURNITURE_MYSTERYBOX:
  7342. s = DO;
  7343. break;
  7344. case $.FURNITURE_MYSTERYTROPHY:
  7345. s = PO;
  7346. break;
  7347. case $.FURNITURE_RANDOM_TELEPORT:
  7348. s = LO;
  7349. break;
  7350. case $.FURNITURE_CLOTHING_CHANGE:
  7351. s = UO;
  7352. break;
  7353. case $.FURNITURE_CUCKOO_CLOCK:
  7354. s = MO;
  7355. break;
  7356. case $.FURNITURE_ECOTRON_BOX:
  7357. s = kO;
  7358. break;
  7359. case $.FURNITURE_GROUP_FORUM_TERMINAL:
  7360. s = AO;
  7361. break;
  7362. case $.FURNITURE_HWEEN_LOVELOCK:
  7363. s = yO;
  7364. break;
  7365. case $.FURNITURE_INTERNAL_LINK:
  7366. s = wO;
  7367. break;
  7368. case $.FURNITURE_JUKEBOX:
  7369. s = OO;
  7370. break;
  7371. case $.FURNITURE_PLACEHOLDER:
  7372. s = bO;
  7373. break;
  7374. case $.FURNITURE_PLANET_SYSTEM:
  7375. s = vO;
  7376. break;
  7377. case $.FURNITURE_RANDOMSTATE:
  7378. s = RO;
  7379. break;
  7380. case $.FURNITURE_SONG_DISK:
  7381. s = NO;
  7382. break;
  7383. case $.FURNITURE_SOUND_MACHINE:
  7384. s = TO;
  7385. break;
  7386. case $.FURNITURE_WELCOME_GIFT:
  7387. s = SO;
  7388. break;
  7389. case $.FURNITURE_ACHIEVEMENT_RESOLUTION:
  7390. s = CO;
  7391. break;
  7392. case $.FURNITURE_HABBOWHEEL:
  7393. s = IO;
  7394. break;
  7395. default:
  7396. s = Ba;
  7397. break
  7398. }
  7399. return s || (Vl.warn("Unknown Logic", e), null)
  7400. }
  7401. }
  7402. const Ek = () => {
  7403. const [i, e] = a.useState(!1), [s, n] = a.useState(null), [r, o] = a.useState(null), [l, c] = a.useState(""), u = E => s ? s.filter(_ => _.code === E)[0] : null, h = () => r ? r.collections.sort((_, I) => !_.hasStarted && !_.hasCompleted ? 0 : !I.hasStarted && !I.hasCompleted ? -1 : 1).sort((_, I) => _.hasCompleted ? 0 : I.hasCompleted ? -1 : 1) : null, m = E => {
  7404. n(_ => {
  7405. if (!_) return [];
  7406. let I = [..._];
  7407. return I.forEach(C => {
  7408. C.collections.forEach(f => {
  7409. f.captionSave == E && (f.unread = 0)
  7410. })
  7411. }), I
  7412. })
  7413. }, p = a.useMemo(() => {
  7414. let E = 0;
  7415. return s ? (s.forEach(_ => {
  7416. _.collections.forEach(I => {
  7417. E += I.unread
  7418. })
  7419. }), E) : 0
  7420. }, [s]);
  7421. return a.useEffect(() => {
  7422. const E = {
  7423. linkReceived: _ => {
  7424. const I = _.split("/");
  7425. if (!(I.length < 2)) switch (c(""), I[2]) {
  7426. case "show":
  7427. e(!0);
  7428. return;
  7429. case "hide":
  7430. e(!1);
  7431. return;
  7432. case "toggle":
  7433. e(C => !C);
  7434. return
  7435. }
  7436. },
  7437. eventUrlPrefix: "habboUI/collections"
  7438. };
  7439. return dt(E), () => ht(E)
  7440. }, [s]), W(fE, E => {
  7441. let _ = E.getParser();
  7442. n(_.campaigns), o(_.campaigns[0])
  7443. }), W(EE, E => {
  7444. let _ = E.getParser();
  7445. if (!s) return;
  7446. let I = _.updatedCollection;
  7447. n(C => {
  7448. let f = [...C];
  7449. return C.forEach(S => {
  7450. S.collections.forEach(T => {
  7451. T.captionSave == I.captionSave && (T.unread += 1, T.items = I.items)
  7452. })
  7453. }), f
  7454. })
  7455. }), {
  7456. getCampaign: u,
  7457. visible: i,
  7458. setVisible: e,
  7459. campaigns: s,
  7460. setCampaigns: n,
  7461. selectedCampaign: r,
  7462. setSelectedCampaign: o,
  7463. selectedCollection: l,
  7464. setSelectedCollection: c,
  7465. resetCount: m,
  7466. getSortedCollections: h,
  7467. totalCount: p
  7468. }
  7469. },
  7470. Vi = () => Qe(Ek),
  7471. Ik = () => {
  7472. const [i, e] = a.useState(!1), [s, n] = a.useState(!1), [r, o] = a.useState([]), {
  7473. get: l,
  7474. getAPI: c
  7475. } = Os(), u = a.useCallback(async b => await l(c("news.list.api").replace("%category%", b.toString())), [l, c]), h = async() => {
  7476. let b = await l(c("news.all.api") + "/8");
  7477. if (!(!b || b && !b.data)) return b.data[0].active = !0, b.data
  7478. }, m = async() => {
  7479. let b = await l(c("news.categories.api"));
  7480. if (b) {
  7481. b.forEach(y => y.active = !1);
  7482. for (let y of b) {
  7483. let w = await u(y.id);
  7484. w.forEach(O => O.active = !1), y.articles = w, y.type = "articles"
  7485. }
  7486. b.push({
  7487. id: -2,
  7488. caption: g("window.news.top-paid-skill"),
  7489. colour: L.message_light_blue,
  7490. icon: "",
  7491. active: !0,
  7492. orderNum: -1,
  7493. articles: [],
  7494. type: "top-paid"
  7495. }), b.push({
  7496. id: -1,
  7497. caption: g("window.news.latest"),
  7498. colour: L.green,
  7499. icon: "",
  7500. active: !1,
  7501. orderNum: -1,
  7502. articles: await h(),
  7503. type: "articles"
  7504. }), b.sort((y, w) => y.id - w.id), o(b)
  7505. }
  7506. }, p = b => {
  7507. o(y => {
  7508. const w = [...y];
  7509. return w.forEach(O => {
  7510. O === b ? O.active = !O.active : O.active = !1
  7511. }), [...w]
  7512. })
  7513. }, E = async() => {
  7514. await m()
  7515. }, _ = () => {
  7516. let b = null;
  7517. for (let y of r)
  7518. for (let w of y.articles) w.active && (b = w);
  7519. return b
  7520. }, I = () => {
  7521. let b = null;
  7522. for (let y of r) y.active && (b = y);
  7523. return b
  7524. }, C = b => r.filter(w => w.id === b.categoryId)[0], f = b => {
  7525. o(y => {
  7526. const w = [...y];
  7527. return w.forEach(O => {
  7528. O.active = !1, O.articles.forEach(F => {
  7529. F === b && (O.active = !0), F.active = F === b
  7530. })
  7531. }), [...w]
  7532. })
  7533. }, S = b => {
  7534. let y = null;
  7535. return r.forEach(w => {
  7536. w.articles.forEach(O => {
  7537. O.id === b && (y = O)
  7538. })
  7539. }), y
  7540. }, T = b => {
  7541. let y = null;
  7542. return r.forEach(w => {
  7543. w.id === b && (y = w)
  7544. }), y
  7545. };
  7546. return Vs(() => {
  7547. E()
  7548. }), {
  7549. isVisible: i,
  7550. setIsVisible: e,
  7551. fetchCategories: m,
  7552. categories: r,
  7553. setCategories: o,
  7554. setActiveCategory: p,
  7555. getActiveArticle: _,
  7556. setActiveArticle: f,
  7557. getCategoryForArticle: C,
  7558. getArticle: S,
  7559. getCategory: T,
  7560. isEditorVisible: s,
  7561. setIsEditorVisible: n,
  7562. setup: E,
  7563. getActiveCategory: I
  7564. }
  7565. },
  7566. Kn = () => Qe(Ik),
  7567. Ck = () => {
  7568. const i = a.useRef(),
  7569. e = a.useRef(),
  7570. s = a.useRef();
  7571. return {
  7572. catalogIconRef: i,
  7573. inventoryIconRef: e,
  7574. navigatorIconRef: s
  7575. }
  7576. },
  7577. Wi = () => Qe(Ck),
  7578. Sk = () => {
  7579. const [i, e] = a.useState([]), {
  7580. post: s,
  7581. getAPI: n
  7582. } = Os();
  7583. return a.useEffect(() => {
  7584. const r = h => {
  7585. e(m => {
  7586. let p = [...m];
  7587. return p.push({
  7588. time: Date.now() / 1e3,
  7589. msBetween: h
  7590. }), p.length >= 2 ? (u(p), []) : p
  7591. })
  7592. };
  7593. let o = -1,
  7594. l = Date.now();
  7595. const c = h => {
  7596. const m = Date.now() - l;
  7597. Math.abs(m - o) <= 15 && o > 5e3 && r(o), o = m, l = Date.now()
  7598. },
  7599. u = async h => {
  7600. try {
  7601. await s(n("tracking.post.api"), {
  7602. clicks: h
  7603. })
  7604. } catch (m) {
  7605. console.log(m)
  7606. }
  7607. };
  7608. return document.addEventListener("dblclick", c), document.addEventListener("click", c), () => {
  7609. document.removeEventListener("dblclick", c), document.removeEventListener("click", c)
  7610. }
  7611. }, [n, s]), null
  7612. },
  7613. Tk = () => {
  7614. const [i, e] = a.useState(1), [s, n] = a.useState(""), {
  7615. post: r,
  7616. getAPI: o
  7617. } = Os(), {
  7618. canChat: l,
  7619. setCanChat: c
  7620. } = wn(), {
  7621. userData: u
  7622. } = jn(), {
  7623. simpleAlert: h
  7624. } = Ke(), {
  7625. logout: m
  7626. } = jn();
  7627. return a.useEffect(() => {
  7628. if (!u || Math.floor(Date.now() / 1e3) - u.accountCreated >= 86400) return;
  7629. const p = async() => {
  7630. if (!l) try {
  7631. await r(o("spam.post.api"), {
  7632. message: s
  7633. })
  7634. } catch (_) {
  7635. console.log(_)
  7636. }
  7637. },
  7638. E = _ => {
  7639. if (!_) return;
  7640. let I = _.clipboardData;
  7641. if (!I) return;
  7642. let C = I.getData("text");
  7643. C.length <= 10 || n(f => (f == C ? e(S => {
  7644. let T = S += 1;
  7645. return T >= 2 && (c(!1), (async() => (await p(), Lr().connection.dispose(), h("${spam.detection.message}")))()), T
  7646. }) : e(1), C))
  7647. };
  7648. return document.body.addEventListener("paste", E), () => {
  7649. document.body.removeEventListener("paste", E)
  7650. }
  7651. }, [o, s, m, r, c, u, l, h]), null
  7652. },
  7653. tu = 25 * 60,
  7654. su = 60 * 60,
  7655. Nk = () => {
  7656. const {
  7657. showAfkAlert: i = null
  7658. } = Ke(), [e, s] = a.useState(0), [n, r] = a.useState(!1), [o, l] = a.useState(-1);
  7659. return $e([qt.ENDED], c => {
  7660. r(!1)
  7661. }), W(tc, c => {
  7662. let u = c.getParser();
  7663. if (u != null) {
  7664. if (u.type == "SKILL") {
  7665. if (!u.skillers) return;
  7666. u.skillers.filter(m => m.userId == Pe().ownRoomIndex).length ? r(!0) : r(!1)
  7667. } else if (u.type == "CURRENCY") {
  7668. if (!u.currencyUser == null) return;
  7669. r(u.currencyUser.timer > -1)
  7670. }
  7671. }
  7672. }), a.useEffect(() => {
  7673. l(Math.floor(Math.random() * su + tu))
  7674. }, []), a.useEffect(() => {
  7675. const c = setInterval(() => {
  7676. s(u => {
  7677. let h = u + 1;
  7678. return n ? (h >= o && (i(), h = 0, l(Math.floor(Math.random() * su + tu))), h) : u
  7679. })
  7680. }, 1e3);
  7681. return () => {
  7682. clearTimeout(c)
  7683. }
  7684. }, [o, i, n]), null
  7685. },
  7686. Rk = () => d(z, {
  7687. children: [t(Sk, {}), t(Tk, {}), t(Nk, {})]
  7688. }),
  7689. V = i => {
  7690. let {
  7691. skin: e = 0,
  7692. colour: s = "#FFFFFF",
  7693. opacity: n = 0,
  7694. innerRef: r,
  7695. classNames: o = [],
  7696. column: l = !0,
  7697. ...c
  7698. } = i;
  7699. const u = a.useRef(),
  7700. h = a.useRef(),
  7701. [m, p] = a.useState(!1),
  7702. E = a.useMemo(() => {
  7703. const _ = ["ton-border"];
  7704. return o.length && _.push(...o), _
  7705. }, [o]);
  7706. return a.useEffect(() => {
  7707. u && u.current && (r && (r.current = u.current), h.current = u.current)
  7708. }, [u, h, r]), a.useEffect(() => {
  7709. const _ = I => I && !I.current ? null : Gi('.ton-border[data-style="' + e + '"]', "border-image-source").replace('url("', "").replace('")', "");
  7710. h && h.current && vn(_(h), s, n).then(I => {
  7711. h.current.style.borderImageSource = `url(${I})`, p(!0)
  7712. })
  7713. }, [h, s, n, e]), t(R, {
  7714. innerRef: u,
  7715. "data-style": e,
  7716. classNames: E,
  7717. visible: !!m,
  7718. column: l,
  7719. ...c
  7720. })
  7721. },
  7722. LE = i => {
  7723. const {
  7724. visible: e = !1
  7725. } = i, s = a.useRef(null), n = a.useMemo(() => ee("images.url") + "/loading_icon.png", []);
  7726. return t(Vn, {
  7727. type: Et.FADE_IN,
  7728. inProp: e,
  7729. timeout: 500,
  7730. children: t(V, {
  7731. opacity: 150,
  7732. classNames: ["position-absolute", "top-0", "bottom-0", "start-0", "end-0", "justify-content-center", "align-items-center", "d-flex"],
  7733. innerRef: s,
  7734. children: t("img", {
  7735. src: n,
  7736. className: "loading-spinner"
  7737. })
  7738. })
  7739. })
  7740. },
  7741. vk = () => {
  7742. const {
  7743. login: i,
  7744. loading: e,
  7745. setAuthStep: s,
  7746. errors: n,
  7747. setErrors: r
  7748. } = jn(), [o, l] = a.useState(""), [c, u] = a.useState(""), h = a.useCallback(async m => {
  7749. if (m.preventDefault(), !await i(o, c)) return r(["errors.unknown"])
  7750. }, [i, c, o, r]);
  7751. return d(R, {
  7752. gap: 2,
  7753. children: [t("div", {
  7754. children: n && n.length > 0 && t(le, {
  7755. draggable: !1,
  7756. closeable: !1,
  7757. className: "auth-login gap-1",
  7758. children: n.length > 0 && n.map((m, p) => t(V, {
  7759. colour: L.primary_red,
  7760. className: "text-white text-center p-2 d-flex flex-column gap-1",
  7761. children: t(N, {
  7762. bold: !0,
  7763. display: "block",
  7764. variant: "white",
  7765. children: g(m)
  7766. })
  7767. }, p))
  7768. })
  7769. }), d(R, {
  7770. column: !0,
  7771. gap: 2,
  7772. children: [t(le, {
  7773. draggable: !1,
  7774. closeable: !1,
  7775. className: "auth-login gap-1",
  7776. children: d(V, {
  7777. className: "text-black text-center p-2 d-flex flex-column gap-1",
  7778. children: [t(N, {
  7779. bold: !0,
  7780. display: "block",
  7781. children: g("auth.first.time.2")
  7782. }), t(N, {
  7783. bold: !0,
  7784. display: "block",
  7785. underline: !0,
  7786. className: "cursor-pointer",
  7787. onClick: () => s(1),
  7788. children: g("auth.first.time.3")
  7789. })]
  7790. })
  7791. }), t(le, {
  7792. title: g("auth.login"),
  7793. draggable: !1,
  7794. closeable: !1,
  7795. className: "auth-login",
  7796. children: d(R, {
  7797. gap: 1,
  7798. column: !0,
  7799. children: [d(V, {
  7800. className: "text-black text-center p-2 position-relative",
  7801. children: [d("form", {
  7802. onSubmit: h,
  7803. className: "gap-1 d-flex flex-column",
  7804. children: [t(N, {
  7805. bold: !0,
  7806. display: "block",
  7807. children: g("auth.name.of")
  7808. }), t(V, {
  7809. className: "p-1",
  7810. children: t("input", {
  7811. className: "ton-input text-center",
  7812. value: o,
  7813. placeholder: g("auth.username"),
  7814. onChange: m => l(m.target.value),
  7815. name: "username",
  7816. id: "username",
  7817. type: "text"
  7818. })
  7819. }), t(N, {
  7820. bold: !0,
  7821. display: "block",
  7822. children: g("auth.password")
  7823. }), t(V, {
  7824. className: "p-1",
  7825. children: t("input", {
  7826. className: "ton-input text-center",
  7827. value: c,
  7828. placeholder: g("auth.password"),
  7829. onChange: m => u(m.target.value),
  7830. name: "password",
  7831. id: "password",
  7832. type: "password"
  7833. })
  7834. }), t("input", {
  7835. type: "submit",
  7836. className: "d-none"
  7837. })]
  7838. }), t(LE, {
  7839. visible: e
  7840. })]
  7841. }), t(D, {
  7842. skin: 6,
  7843. colour: L.primary_green,
  7844. className: "mx-auto",
  7845. onClick: h,
  7846. disabled: e,
  7847. children: g("auth.go")
  7848. })]
  7849. })
  7850. })]
  7851. })]
  7852. })
  7853. },
  7854. bk = () => {
  7855. const {
  7856. register: i,
  7857. loading: e,
  7858. setAuthStep: s
  7859. } = jn(), [n, r] = a.useState(""), [o, l] = a.useState(""), [c, u] = a.useState(""), [h, m] = a.useState(""), [p, E] = a.useState(""), [_, I] = a.useState([]), C = a.useCallback(async f => {
  7860. f.preventDefault(), I([]);
  7861. let S = await i(n, o, c, h, p);
  7862. if (!S) return I(["errors.unknown"]);
  7863. I(S.errors)
  7864. }, [i, n, o, c, h, p]);
  7865. return d(R, {
  7866. gap: 2,
  7867. children: [t("div", {
  7868. children: _.length > 0 && t(le, {
  7869. draggable: !1,
  7870. closeable: !1,
  7871. className: "auth-login gap-1",
  7872. children: _.length > 0 && _.map((f, S) => t(V, {
  7873. colour: L.primary_red,
  7874. className: "text-white text-center p-2 d-flex flex-column gap-1",
  7875. children: t(N, {
  7876. bold: !0,
  7877. display: "block",
  7878. variant: "white",
  7879. children: g(f)
  7880. })
  7881. }, S))
  7882. })
  7883. }), t(R, {
  7884. column: !0,
  7885. gap: 2,
  7886. children: t(le, {
  7887. title: g("auth.register"),
  7888. draggable: !1,
  7889. closeable: !1,
  7890. className: "auth-login",
  7891. children: d(R, {
  7892. gap: 1,
  7893. column: !0,
  7894. children: [d(V, {
  7895. className: "text-black text-center p-2 position-relative",
  7896. children: [d("form", {
  7897. onSubmit: C,
  7898. className: "gap-1 d-flex flex-column",
  7899. children: [t(N, {
  7900. bold: !0,
  7901. display: "block",
  7902. children: g("auth.name.of")
  7903. }), t(V, {
  7904. className: "p-1",
  7905. children: t("input", {
  7906. className: "ton-input text-center",
  7907. name: "username",
  7908. id: "username",
  7909. value: n,
  7910. placeholder: g("auth.username"),
  7911. onChange: f => r(f.target.value)
  7912. })
  7913. }), t(N, {
  7914. bold: !0,
  7915. display: "block",
  7916. children: g("auth.email")
  7917. }), t(V, {
  7918. className: "p-1",
  7919. children: t("input", {
  7920. className: "ton-input text-center",
  7921. type: "email",
  7922. value: o,
  7923. name: "email",
  7924. id: "email",
  7925. placeholder: g("auth.email"),
  7926. onChange: f => l(f.target.value)
  7927. })
  7928. }), t(N, {
  7929. bold: !0,
  7930. display: "block",
  7931. children: g("auth.password")
  7932. }), t(V, {
  7933. className: "p-1",
  7934. children: t("input", {
  7935. className: "ton-input text-center",
  7936. value: c,
  7937. name: "password",
  7938. id: "password",
  7939. placeholder: g("auth.password"),
  7940. onChange: f => u(f.target.value),
  7941. type: "password"
  7942. })
  7943. }), t(N, {
  7944. bold: !0,
  7945. display: "block",
  7946. children: g("auth.password.confirm")
  7947. }), t(V, {
  7948. className: "p-1",
  7949. children: t("input", {
  7950. className: "ton-input text-center",
  7951. value: h,
  7952. name: "confirm_password",
  7953. id: "confirm_password",
  7954. placeholder: g("auth.password.confirm"),
  7955. onChange: f => m(f.target.value),
  7956. type: "password"
  7957. })
  7958. }), t(PI, {
  7959. sitekey: "6LfFd8IjAAAAAPPbacwLInWSNg3JMYVpvY_NXZoG",
  7960. onChange: E
  7961. }), t("input", {
  7962. type: "submit",
  7963. className: "d-none"
  7964. })]
  7965. }), t(LE, {
  7966. visible: e
  7967. })]
  7968. }), d(R, {
  7969. justifyContent: "between",
  7970. children: [t(D, {
  7971. className: "mx-auto",
  7972. skin: 5,
  7973. onClick: () => s(0),
  7974. children: g("auth.cancel")
  7975. }), t(D, {
  7976. skin: 6,
  7977. colour: L.primary_green,
  7978. className: "mx-auto",
  7979. onClick: C,
  7980. children: g("auth.go")
  7981. })]
  7982. })]
  7983. })
  7984. })
  7985. })]
  7986. })
  7987. },
  7988. Ok = () => {
  7989. const {
  7990. authenticated: i,
  7991. authStep: e,
  7992. tryGetSSO: s,
  7993. ready: n
  7994. } = jn();
  7995. return Os(), t(R, {
  7996. alignItems: "center",
  7997. justifyContent: "center",
  7998. position: "absolute",
  7999. className: "top-0 bottom-0 start-0 end-0 z-100",
  8000. children: (() => {
  8001. switch (e) {
  8002. case 0:
  8003. return t(vk, {});
  8004. case 1:
  8005. return t(bk, {})
  8006. }
  8007. })()
  8008. })
  8009. },
  8010. Fo = i => {
  8011. let {
  8012. skin: e = 0,
  8013. colour: s = "#FFFFFF",
  8014. placement: n = "bottom",
  8015. opacity: r = 0,
  8016. innerRef: o,
  8017. classNames: l = [],
  8018. ...c
  8019. } = i;
  8020. const u = a.useRef(),
  8021. h = a.useRef(),
  8022. [m, p] = a.useState(!1),
  8023. E = a.useMemo(() => {
  8024. const _ = ["ton-carat"];
  8025. return l.length && _.push(...l), _
  8026. }, [l]);
  8027. return a.useEffect(() => {
  8028. u && u.current && (o && (o.current = u.current), h.current = u.current)
  8029. }, [u, h, o]), a.useEffect(() => {
  8030. const _ = I => I && !I.current ? null : Gi(`.ton-carat[data-style="${e}-${n}"]`, "background-image").replace('url("', "").replace('")', "");
  8031. h && h.current && vn(_(h), s, r).then(I => {
  8032. h.current.style.backgroundImage = `url(${I})`, p(!0)
  8033. })
  8034. }, [h, s, r, e, n]), t(P, {
  8035. innerRef: u,
  8036. "data-style": e + "-" + n,
  8037. classNames: E,
  8038. visible: !!m,
  8039. ...c
  8040. })
  8041. },
  8042. wk = i => {
  8043. const {
  8044. variant: e = "",
  8045. size: s = "",
  8046. active: n = !1,
  8047. disabled: r = !1,
  8048. classNames: o = [],
  8049. ...l
  8050. } = i, c = a.useMemo(() => {
  8051. const u = ["gift-color-btn"];
  8052. return e && u.push("btn-" + e), s && u.push("btn-" + s), n && u.push("active"), r && u.push("disabled"), o.length && u.push(...o), u
  8053. }, [e, s, n, r, o]);
  8054. return t(R, {
  8055. center: !0,
  8056. classNames: c,
  8057. ...l
  8058. })
  8059. },
  8060. yk = i => {
  8061. const {
  8062. onPageChange: e,
  8063. totalCount: s,
  8064. siblingCount: n = 1,
  8065. currentPage: r,
  8066. pageSize: o
  8067. } = i, l = HA({
  8068. currentPage: r,
  8069. totalCount: s,
  8070. siblingCount: n,
  8071. pageSize: o
  8072. });
  8073. if (r === 0 || l.length < 2) return null;
  8074. const c = () => {
  8075. e(r + 1)
  8076. },
  8077. u = () => {
  8078. e(r - 1)
  8079. },
  8080. h = () => {
  8081. e(1)
  8082. },
  8083. m = () => {
  8084. e(p)
  8085. };
  8086. let p = l[l.length - 1];
  8087. return d(z, {
  8088. children: [t(D, {
  8089. disabled: r === 1,
  8090. onClick: h,
  8091. children: "<<"
  8092. }), t(D, {
  8093. disabled: r === 1,
  8094. onClick: u,
  8095. children: "<"
  8096. }), l.map(E => E === io ? t(D, {
  8097. disabled: !0,
  8098. children: "…"
  8099. }) : t(z, {
  8100. children: t(D, {
  8101. skin: E === r ? 1 : 0,
  8102. onClick: () => e(E),
  8103. children: E
  8104. }, E)
  8105. })), t(D, {
  8106. disabled: r === p,
  8107. onClick: c,
  8108. children: ">"
  8109. }), t(D, {
  8110. disabled: r === p,
  8111. onClick: m,
  8112. children: ">>"
  8113. })]
  8114. })
  8115. },
  8116. qn = i => {
  8117. const {
  8118. count: e = 0,
  8119. position: s = "absolute",
  8120. classNames: n = [],
  8121. children: r = null,
  8122. skin: o = 6,
  8123. unset: l = !1,
  8124. ...c
  8125. } = i, u = a.useMemo(() => {
  8126. const h = ["ton-item-count", "text-white"];
  8127. return n.length && h.push(...n), l || h.push("top-0"), h
  8128. }, [n]);
  8129. return d(V, {
  8130. skin: o,
  8131. colour: L.primary_red,
  8132. position: "absolute",
  8133. classNames: u,
  8134. ...c,
  8135. children: [e, r]
  8136. })
  8137. },
  8138. Ns = i => {
  8139. const {
  8140. isActive: e = !1,
  8141. count: s = 0,
  8142. skin: n = 0,
  8143. gap: r = 1,
  8144. overflow: o = "hidden",
  8145. pointer: l = !0,
  8146. position: c = "relative",
  8147. classNames: u = [],
  8148. children: h = null,
  8149. innerRef: m = null,
  8150. colour: p = "#FFFFFF",
  8151. opacity: E = 0,
  8152. ..._
  8153. } = i, I = a.useRef(), C = a.useRef(), f = a.useMemo(() => {
  8154. const S = ["ton-tab", "container-fluid", "justify-content-center", "p-1"];
  8155. return e && S.push("active"), u.length && S.push(...u), S
  8156. }, [e, u]);
  8157. return a.useEffect(() => {
  8158. I && I.current && (m && (m.current = I.current), C.current = I.current)
  8159. }, [I, C, m]), a.useEffect(() => {
  8160. if (!p || p === "#FFFFFF") return;
  8161. const S = T => T && !T.current ? null : Gi('.ton-tab[data-style="' + n + '"]', "border-image-source").replace('url("', "").replace('")', "");
  8162. C && C.current && vn(S(C), p, E).then(T => {
  8163. C.current.style.borderImageSource = `url(${T})`
  8164. })
  8165. }, [C, p, E, n]), d(R, {
  8166. overflow: o,
  8167. pointer: l,
  8168. position: c,
  8169. "data-style": n,
  8170. classNames: f,
  8171. innerRef: I,
  8172. ..._,
  8173. children: [t(R, {
  8174. shrink: !0,
  8175. center: !0,
  8176. className: "tab-text",
  8177. children: h
  8178. }), s > 0 && t(qn, {
  8179. count: s
  8180. })]
  8181. })
  8182. },
  8183. PE = i => {
  8184. const {
  8185. skin: e = 0,
  8186. pointer: s = !0,
  8187. classNames: n = [],
  8188. ...r
  8189. } = i, o = a.useMemo(() => {
  8190. const l = ["ton-list"];
  8191. return s && l.push("cursor-pointer"), n.length && l.push(...n), l
  8192. }, [s, n]);
  8193. return t(P, {
  8194. classNames: o,
  8195. "data-style": e,
  8196. ...r
  8197. })
  8198. },
  8199. ul = i => {
  8200. const {
  8201. carat: e = !1,
  8202. caratState: s = !1,
  8203. active: n = !1,
  8204. classNames: r = [],
  8205. children: o = null,
  8206. colour: l = L.white,
  8207. ...c
  8208. } = i, u = a.useMemo(() => {
  8209. const m = ["ton-list-item"];
  8210. return n && m.push("active"), r.length && m.push(...r), m
  8211. }, [n, r]), h = a.useMemo(() => {
  8212. let m = {};
  8213. return m["--item-color"] = l, m
  8214. }, [l]);
  8215. return d(P, {
  8216. classNames: u,
  8217. style: h,
  8218. ...c,
  8219. children: [t(P, {
  8220. className: "ton-list-caption",
  8221. children: o
  8222. }), e && t(P, {
  8223. className: `ton-list-carat ${s?"down":""}`
  8224. })]
  8225. })
  8226. },
  8227. DE = i => {
  8228. const {
  8229. text: e = "",
  8230. progress: s = 0,
  8231. maxProgress: n = 100,
  8232. position: r = "relative",
  8233. justifyContent: o = "center",
  8234. classNames: l = [],
  8235. children: c = null,
  8236. ...u
  8237. } = i, h = a.useMemo(() => {
  8238. const m = ["ton-progress-bar", "text-white"];
  8239. return l.length && m.push(...l), m
  8240. }, [l]);
  8241. return d(V, {
  8242. skin: 4,
  8243. colour: L.catalog_search_blue,
  8244. classNames: h,
  8245. fullWidth: !0,
  8246. position: "relative",
  8247. children: [~~((s - 0) * (100 - 0) / (n - 0) + 0) > 0 && t(V, {
  8248. skin: 4,
  8249. colour: L.primary_blue,
  8250. position: "absolute",
  8251. className: "ton-progress-bar-inner",
  8252. style: {
  8253. width: ~~((s - 0) * (100 - 0) / (n - 0) + 0) + "%"
  8254. }
  8255. }), d(v, {
  8256. fullWidth: !0,
  8257. position: r,
  8258. justifyContent: o,
  8259. classNames: h,
  8260. ...u,
  8261. children: [e && e.length > 0 && t(R, {
  8262. fit: !0,
  8263. center: !0,
  8264. position: "absolute",
  8265. className: "ton-progress-bar-text text-white",
  8266. children: e
  8267. }), c]
  8268. })]
  8269. })
  8270. },
  8271. Ak = i => {
  8272. const {
  8273. children: e = null,
  8274. setExtended: s = null,
  8275. extended: n = !1,
  8276. headerRef: r = null,
  8277. ...o
  8278. } = i;
  8279. return a.useEffect(() => {
  8280. const l = c => {
  8281. if (!r || r && r.current == null) return;
  8282. const u = c.target;
  8283. r.current.contains(u) || s(!1)
  8284. };
  8285. return document.addEventListener("click", l), () => document.removeEventListener(xe.MOUSE_CLICK, l)
  8286. }, [r, s]), t(V, {
  8287. className: "dropdown-open",
  8288. ...o,
  8289. onClick: l => s(!n),
  8290. children: e
  8291. })
  8292. },
  8293. es = i => {
  8294. const {
  8295. children: e = null,
  8296. selectedIndex: s = 0,
  8297. className: n = null,
  8298. options: r = null,
  8299. changeIndex: o = null,
  8300. skin: l = 0,
  8301. colour: c = L.white,
  8302. ...u
  8303. } = i, [h, m] = a.useState(!1), p = a.useRef(), E = a.useMemo(() => {
  8304. let I = null;
  8305. for (let C of r) C.index == s && (I = C);
  8306. return I
  8307. }, [r, s]), _ = d(R, {
  8308. justifyContent: "between",
  8309. gap: 2,
  8310. onClick: I => m(!h),
  8311. className: "ton-dropdown-header",
  8312. pointer: !0,
  8313. children: [t(N, {
  8314. truncate: !0,
  8315. children: g(E == null ? void 0 : E.caption)
  8316. }), d(R, {
  8317. gap: 1,
  8318. children: [t(P, {
  8319. className: "carat-division"
  8320. }), t(P, {
  8321. className: `ton-shockwave-carat ${h?"up":"down"}`
  8322. })]
  8323. })]
  8324. });
  8325. if (r) return d(V, {
  8326. className: n + " ton-dropdown p-0",
  8327. ...u,
  8328. position: "relative",
  8329. skin: l,
  8330. colour: c,
  8331. innerRef: p,
  8332. children: [_, h && d(Ak, {
  8333. setExtended: m,
  8334. skin: l,
  8335. colour: c,
  8336. extended: h,
  8337. headerRef: p,
  8338. children: [_, t("hr", {}), r.map((I, C) => {
  8339. if (I.index !== s) return t(N, {
  8340. className: "item",
  8341. onClick: f => {
  8342. o(I.index), m(!1)
  8343. },
  8344. children: g(I.caption)
  8345. }, C)
  8346. })]
  8347. })]
  8348. })
  8349. },
  8350. kk = () => {
  8351. const {
  8352. getActiveArticle: i,
  8353. getCategoryForArticle: e
  8354. } = Kn(), s = c => ee("news.categories.icons") + `${c}.png`, [n, r] = a.useState(!1), o = a.useMemo(() => i(), [i]), l = a.useMemo(() => e(i()), [e, i]);
  8355. if (o) return d("div", {
  8356. className: "p-2 overflow-y-scroll h-100 ubuntu",
  8357. children: [d(V, {
  8358. skin: 6,
  8359. colour: l.colour,
  8360. column: !1,
  8361. className: "ubuntu-bold ton-news-header d-flex justify-content-between justify-content-center align-items-center",
  8362. children: [!n && t("img", {
  8363. className: "ton-news-category-icon",
  8364. src: s(l.icon),
  8365. onError: () => {
  8366. r(!0)
  8367. }
  8368. }), t("h4", {
  8369. className: "mb-0",
  8370. children: o.caption
  8371. }), t("small", {
  8372. children: t("i", {
  8373. children: new Date(o.date * 1e3).toLocaleString()
  8374. })
  8375. })]
  8376. }), d("div", {
  8377. className: "mx-2",
  8378. children: [t(V, {
  8379. skin: 4,
  8380. colour: L.light_grey,
  8381. className: "ubuntu-bold ton-news-sub-header mb-2",
  8382. children: o.description
  8383. }), t("article", {
  8384. dangerouslySetInnerHTML: {
  8385. __html: o.body
  8386. },
  8387. className: "p-0 ql-editor"
  8388. })]
  8389. })]
  8390. })
  8391. },
  8392. Mk = i => {
  8393. const {
  8394. setActiveCategory: e,
  8395. setActiveArticle: s
  8396. } = Kn(), {
  8397. category: n
  8398. } = i;
  8399. return d(P, {
  8400. className: "ton-list-section",
  8401. children: [((n == null ? void 0 : n.type) == "articles" ? n.articles.length > 0 : !0) && t(ul, {
  8402. carat: n.articles.length > 0,
  8403. caratState: n.active,
  8404. onClick: r => e(n),
  8405. active: n.active,
  8406. colour: n.colour,
  8407. children: n.caption
  8408. }), n.active && n.articles && n.articles.map((r, o) => t(ul, {
  8409. className: "inset",
  8410. onClick: () => s(r),
  8411. active: r.active,
  8412. children: r.caption
  8413. }, o))]
  8414. })
  8415. },
  8416. Uk = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10].reverse(),
  8417. Lk = () => {
  8418. const {
  8419. get: i,
  8420. getAPI: e
  8421. } = Os(), [s, n] = a.useState(), [r, o] = a.useState();
  8422. a.useEffect(() => {
  8423. (async() => {
  8424. let h = await i(e("news.top.paid.api"));
  8425. n(h.list), o(h.topPaid)
  8426. })()
  8427. }, [i, e]);
  8428. const l = (u, h) => {
  8429. var m;
  8430. return (m = s[u]) == null ? void 0 : m.levels[h]
  8431. },
  8432. c = u => r[0] == u ? L.secondary_green : r[1] == u ? L.lighter_yellow : r[2] == u ? L.maintenance_orange_light : null;
  8433. return d(v, {
  8434. fit: !0,
  8435. gap: 1,
  8436. overflow: "hidden",
  8437. fullHeight: !0,
  8438. justifyContent: "center",
  8439. className: "px-1",
  8440. children: [d(v, {
  8441. gap: 0,
  8442. children: [d(R, {
  8443. gap: 0,
  8444. className: "text-black text-center pb-1",
  8445. fullWidth: !0,
  8446. children: [t(P, {
  8447. className: "top-paid-level flex-shrink-0 ubuntu-bold",
  8448. children: "Level"
  8449. }), s && s.map((u, h) => t(P, {
  8450. fullWidth: !0,
  8451. className: "ubuntu-bold",
  8452. children: u.skill.charAt(0).toUpperCase() + u.skill.slice(1)
  8453. }, h))]
  8454. }), t(V, {
  8455. skin: 100,
  8456. fit: !0,
  8457. className: "top-paid-container",
  8458. alignSelf: "center",
  8459. children: Uk.map((u, h) => d(R, {
  8460. gap: 0,
  8461. fullWidth: !0,
  8462. className: "text-black top-paid-row align-items-center justify-content-center",
  8463. children: [t(P, {
  8464. className: "text-center top-paid-level flex-shrink-0 ubuntu-bold",
  8465. children: u
  8466. }), s && s.map((m, p) => t(R, {
  8467. fullWidth: !0,
  8468. className: "border-seperation text-center justify-content-center align-items-center",
  8469. style: {
  8470. backgroundColor: c(m.skill)
  8471. },
  8472. children: l(p, u)
  8473. }, p))]
  8474. }, h))
  8475. })]
  8476. }), d(v, {
  8477. className: "ql-editor h-auto",
  8478. children: [t(N, {
  8479. className: "ubuntu-bold",
  8480. display: "block",
  8481. children: g("generic.more.info")
  8482. }), d("ul", {
  8483. children: [t("li", {
  8484. children: t("a", {
  8485. href: "event:habboUI/open/news/article/18",
  8486. style: {
  8487. color: L.maintenance_orange
  8488. },
  8489. children: "Skills Guide"
  8490. })
  8491. }), t("li", {
  8492. children: t("a", {
  8493. href: "event:habboUI/open/news/article/24",
  8494. style: {
  8495. color: L.maintenance_orange
  8496. },
  8497. children: "Prestiges"
  8498. })
  8499. })]
  8500. })]
  8501. })]
  8502. })
  8503. },
  8504. Pk = i => {
  8505. const {
  8506. isVisible: e = !1,
  8507. setIsVisible: s = null,
  8508. categories: n,
  8509. getActiveArticle: r,
  8510. getArticle: o,
  8511. setActiveArticle: l,
  8512. setActiveCategory: c,
  8513. getCategory: u,
  8514. getActiveCategory: h
  8515. } = Kn();
  8516. a.useEffect(() => {
  8517. const p = {
  8518. linkReceived: E => {
  8519. const _ = E.split("/").splice(1);
  8520. if (!(_.length < 2)) {
  8521. switch (_[1]) {
  8522. case "togglenews":
  8523. s(I => !I);
  8524. return;
  8525. case "news":
  8526. s(!0);
  8527. break
  8528. }
  8529. if (!(_.length < 4)) switch (_[2]) {
  8530. case "article":
  8531. let I = o(parseInt(_[3]));
  8532. I && l(I);
  8533. break;
  8534. case "category":
  8535. let C = u(parseInt(_[3]));
  8536. C && c(C);
  8537. break
  8538. }
  8539. }
  8540. },
  8541. eventUrlPrefix: "habboUI/open/"
  8542. };
  8543. return dt(p), () => ht(p)
  8544. }, [s, o, l, u, c]);
  8545. const m = a.useMemo(() => {
  8546. var p;
  8547. switch ((p = h()) == null ? void 0 : p.type) {
  8548. case "top-paid":
  8549. return t(Lk, {});
  8550. default:
  8551. return r() ? t(kk, {}) : null
  8552. }
  8553. }, [h, r]);
  8554. if (e) return t(vs, {
  8555. handleSelector: ".ton-news",
  8556. children: d(R, {
  8557. className: "ton-news",
  8558. children: [t(P, {
  8559. className: "ton-news-bg text-black",
  8560. children: m
  8561. }), t(le, {
  8562. skin: 0,
  8563. title: g("window.news.title"),
  8564. draggable: !1,
  8565. className: "ton-news-navigation",
  8566. onCloseClick: () => s(!e),
  8567. colour: L.quaternary_grey,
  8568. children: t(PE, {
  8569. children: t("div", {
  8570. className: "ton-list-section",
  8571. children: n && n.length && n.map(p => t(Mk, {
  8572. category: p
  8573. }, p.id))
  8574. })
  8575. })
  8576. })]
  8577. })
  8578. })
  8579. },
  8580. mi = i => {
  8581. const {
  8582. type: e = -1,
  8583. amount: s = -1,
  8584. short: n = !1,
  8585. seasonal: r = !1,
  8586. ...o
  8587. } = i, l = a.useMemo(() => {
  8588. switch (e) {
  8589. case "online":
  8590. return "Online Users";
  8591. case "hc":
  8592. return g("purse.hc");
  8593. case -1:
  8594. return g("purse_coins");
  8595. default:
  8596. return g("achievements.activitypoint." + e) == "achievements.activitypoint." + e ? g("purse.seasonal.currency." + e) : g("achievements.activitypoint." + e)
  8597. }
  8598. }, [e]), c = () => {
  8599. switch (e) {
  8600. case "online":
  8601. return;
  8602. case "hc":
  8603. return oe("habboUI/open/hccenter");
  8604. default:
  8605. return oe("catalog/open/currency-" + e)
  8606. }
  8607. };
  8608. return d(V, {
  8609. skin: 5,
  8610. opacity: 50,
  8611. colour: L.quaternary_grey,
  8612. className: "d-flex",
  8613. fullWidth: !0,
  8614. onClick: c,
  8615. pointer: !0,
  8616. ...o,
  8617. children: [d(R, {
  8618. justifyContent: r ? "between" : "end",
  8619. fullWidth: !0,
  8620. children: [r && t(P, {
  8621. className: "purse-caption",
  8622. style: {
  8623. color: ee("currency.colours")[e]
  8624. },
  8625. children: l
  8626. }), t(P, {
  8627. children: s
  8628. })]
  8629. }), t(V, {
  8630. skin: 5,
  8631. colour: ee("currency.colours")[e],
  8632. className: "d-flex",
  8633. children: t(wt, {
  8634. type: e
  8635. })
  8636. })]
  8637. })
  8638. },
  8639. Dk = i => {
  8640. const {
  8641. type: e = 0
  8642. } = i, {
  8643. onlineCount: s
  8644. } = dn(), [n, r] = a.useState(!1);
  8645. return W(ec, o => {
  8646. r(!0), setTimeout(() => {
  8647. r(!1)
  8648. }, 1200)
  8649. }), e == 2 ? t(mi, {
  8650. type: "online",
  8651. amount: s,
  8652. short: !1
  8653. }) : e == 1 ? d(V, {
  8654. skin: 0,
  8655. colour: L.primary_grey,
  8656. classNames: ["ton-online-count", "p-2", "w-100", "d-flex", "justify-content-center", "align-items-center", "position-relative"],
  8657. children: [t(P, {
  8658. classNames: ["online-hotel", "position-absolute", "start-0", n ? "animated" : ""]
  8659. }), d(N, {
  8660. variant: "white",
  8661. center: !0,
  8662. children: ["Online: ", s]
  8663. })]
  8664. }) : d(V, {
  8665. skin: 0,
  8666. colour: L.primary_grey,
  8667. classNames: ["ton-online-count", "p-1", "px-1"],
  8668. children: [t(N, {
  8669. variant: "white",
  8670. center: !0,
  8671. children: "Online:"
  8672. }), d(R, {
  8673. className: "align-items-center justify-content-center",
  8674. children: [t(P, {
  8675. classNames: ["online-hotel", n ? "animated" : ""]
  8676. }), s]
  8677. })]
  8678. })
  8679. },
  8680. Fk = i => {
  8681. const {
  8682. rare: e = null,
  8683. item: s,
  8684. furnidata: n = null
  8685. } = i, r = a.useRef(null), [o, l] = a.useState(!1), c = () => e.lastValue > e.currentValue;
  8686. if (!n) return;
  8687. const u = t(Ai, {
  8688. target: r.current,
  8689. show: o,
  8690. placement: "right",
  8691. children: t(kr, {
  8692. children: t(V, {
  8693. skin: 0,
  8694. colour: L.white,
  8695. className: "image-rendering-pixelated p-2 text-black",
  8696. children: d(R, {
  8697. alignItems: "center",
  8698. gap: 1,
  8699. children: [t("i", {
  8700. className: "icon " + (c() ? "icon-minus" : "icon-plus")
  8701. }), t(wt, {
  8702. type: -1
  8703. }), t(N, {
  8704. bold: !0,
  8705. children: Math.abs(e.lastValue - e.currentValue)
  8706. }), d(N, {
  8707. children: [g("window.rare-values.text"), " (", e.lastValue, ")"]
  8708. })]
  8709. })
  8710. })
  8711. })
  8712. });
  8713. return d(V, {
  8714. skin: 0,
  8715. position: "relative",
  8716. colour: L.light_grey,
  8717. fullWidth: !0,
  8718. column: !1,
  8719. className: "text-black p-1",
  8720. alignItems: "center",
  8721. gap: 1,
  8722. onMouseOver: h => l(!0),
  8723. onMouseLeave: h => l(!1),
  8724. children: [u, d(R, {
  8725. className: "w-75",
  8726. alignItems: "center",
  8727. children: [t(cE, {
  8728. productType: s.type,
  8729. productClassId: s.spriteId,
  8730. extraData: e.item.extradata
  8731. }), d(R, {
  8732. column: !0,
  8733. overflow: "hidden",
  8734. children: [t(N, {
  8735. bold: !0,
  8736. truncate: !0,
  8737. children: n.name === "unknown" ? n.fullName : n.name
  8738. }), t(N, {
  8739. truncate: !0,
  8740. children: n.description === "unknown" ? n.fullName : n.description
  8741. })]
  8742. })]
  8743. }), t(R, {
  8744. className: "w-25 flex-shrink-0 text-center",
  8745. column: !0,
  8746. justifyContent: "center",
  8747. position: "relative",
  8748. children: d(R, {
  8749. alignItems: "center",
  8750. gap: 1,
  8751. position: "relative",
  8752. children: [t(wt, {
  8753. type: -1,
  8754. innerRef: r
  8755. }), e.currentValue]
  8756. })
  8757. })]
  8758. })
  8759. },
  8760. xk = i => {
  8761. const [e, s] = a.useState(!1), {
  8762. get: n,
  8763. getAPI: r
  8764. } = Os(), [o, l] = a.useState([]), [c, u] = a.useState(""), [h, m] = a.useState([]), [p, E] = a.useState(0), _ = a.useMemo(() => {
  8765. var f;
  8766. let C = (f = h.filter(S => S.index == p)[0]) == null ? void 0 : f.value;
  8767. return !C || C == "all" ? o : o.filter(S => {
  8768. var T, b;
  8769. return ((b = (T = S.item) == null ? void 0 : T.page) == null ? void 0 : b.captionSave) == C
  8770. })
  8771. }, [h, o, p]), I = a.useMemo(() => c == "" || !c ? _ : _.filter(C => {
  8772. let f = Io(C.item.baseItem.spriteId, C.item.baseItem.type);
  8773. return f ? f.name.toLowerCase().includes(c.toLowerCase()) : !1
  8774. }), [c, _]);
  8775. if (a.useEffect(() => {
  8776. const C = {
  8777. linkReceived: f => s(!e),
  8778. eventUrlPrefix: "habboUI/open/rare-values"
  8779. };
  8780. return dt(C), () => ht(C)
  8781. }, [e, s]), a.useEffect(() => {
  8782. var S, T, b, y, w, O, F, U, j, x;
  8783. let C = [{
  8784. index: 0,
  8785. value: "all",
  8786. caption: "window.rare-values.filter.all"
  8787. }],
  8788. f = [];
  8789. for (let M of o) f.includes((T = (S = M.item) == null ? void 0 : S.page) == null ? void 0 : T.captionSave) || (C.push({
  8790. index: (y = (b = M.item) == null ? void 0 : b.page) == null ? void 0 : y.id,
  8791. value: (O = (w = M.item) == null ? void 0 : w.page) == null ? void 0 : O.captionSave,
  8792. caption: "window.rare-values.filter." + ((U = (F = M.item) == null ? void 0 : F.page) == null ? void 0 : U.captionSave)
  8793. }), f.push((x = (j = M.item) == null ? void 0 : j.page) == null ? void 0 : x.captionSave));
  8794. m(C)
  8795. }, [o]), a.useEffect(() => {
  8796. e && (async() => {
  8797. await n(r("rare.values.api")).then(f => {
  8798. l(f)
  8799. })
  8800. })()
  8801. }, [n, r, e]), !!e) return t(le, {
  8802. title: g("window.rare-values.title"),
  8803. skin: 1,
  8804. colour: L.primary_red,
  8805. className: "ton-rare-values",
  8806. onCloseClick: C => s(!1),
  8807. children: d(V, {
  8808. skin: 0,
  8809. fullHeight: !0,
  8810. overflow: "hidden",
  8811. gap: 1,
  8812. children: [d(R, {
  8813. gap: 1,
  8814. children: [t(es, {
  8815. className: "ton-rare-filter",
  8816. options: h,
  8817. selectedIndex: p,
  8818. changeIndex: C => E(C)
  8819. }), t("input", {
  8820. className: "ton-input black-border w-auto",
  8821. placeholder: g("generic.search"),
  8822. value: c,
  8823. onChange: C => u(C.target.value)
  8824. }), t(D, {
  8825. children: t("div", {
  8826. className: "catalog-searchicon"
  8827. })
  8828. })]
  8829. }), I && I.length > 0 ? t(qe, {
  8830. columnCount: 2,
  8831. columnMinWidth: 200,
  8832. gap: 1,
  8833. children: I.sort((C, f) => f.currentValue - C.currentValue).map((C, f) => t(Fk, {
  8834. item: C.item.baseItem,
  8835. rare: C,
  8836. furnidata: Io(C.item.baseItem.spriteId, C.item.baseItem.type)
  8837. }, f))
  8838. }) : d(R, {
  8839. gap: 4,
  8840. alignSelf: "center",
  8841. justifyContent: "center",
  8842. fullHeight: !0,
  8843. alignItems: "center",
  8844. children: [t(P, {
  8845. className: "ton-rare-ph"
  8846. }), d(R, {
  8847. column: !0,
  8848. children: [t(N, {
  8849. bold: !0,
  8850. children: g("window.rare-values.none.title")
  8851. }), t(N, {
  8852. children: g("window.rare-values.none.body")
  8853. })]
  8854. })]
  8855. })]
  8856. })
  8857. })
  8858. },
  8859. nu = i => {
  8860. const {
  8861. index: e = 0,
  8862. username: s = "",
  8863. amount: n = ""
  8864. } = i;
  8865. return d(R, {
  8866. gap: 1,
  8867. className: `p-1 ${e===0?"first-place":e===1?"second-place":e===2?"third-place":""}`,
  8868. children: [d(N, {
  8869. bold: !0,
  8870. children: [e + 1, "."]
  8871. }), t(N, {
  8872. bold: !0,
  8873. truncate: !0,
  8874. className: "me-auto",
  8875. children: s
  8876. }), n]
  8877. })
  8878. },
  8879. ru = [{
  8880. index: 0,
  8881. value: "networth",
  8882. caption: "toplist.networth.title"
  8883. }, {
  8884. index: 1,
  8885. value: "credits",
  8886. caption: "toplist.credits.title"
  8887. }, {
  8888. index: 2,
  8889. value: "achievements",
  8890. caption: "toplist.achievements.title"
  8891. }, {
  8892. index: 3,
  8893. value: "online",
  8894. caption: "toplist.online.title"
  8895. }, {
  8896. index: 4,
  8897. value: "respects",
  8898. caption: "toplist.respects.title"
  8899. }, {
  8900. index: 5,
  8901. value: "pixels",
  8902. caption: "toplist.pixels.title"
  8903. }],
  8904. Gk = i => {
  8905. const {
  8906. type: e = null,
  8907. setActiveType: s = null
  8908. } = i, {
  8909. get: n,
  8910. getAPI: r
  8911. } = Os(), [o, l] = a.useState([]), [c, u] = a.useState([]), [h, m] = a.useState(0), p = I => {
  8912. var C, f, S;
  8913. if (e == "credits" && c && c.length > 0) return ((C = c[I - 1]) == null ? void 0 : C.look) || null;
  8914. if (o && o.length > 0) return ((S = (f = o[I - 1]) == null ? void 0 : f.user) == null ? void 0 : S.look) || null
  8915. };
  8916. a.useEffect(() => {
  8917. (async C => {
  8918. C && await n(r("toplist.api").replace("%type%", e)).then(f => {
  8919. let S = f == null ? void 0 : f.type;
  8920. switch (u([]), l([]), S) {
  8921. case "users":
  8922. return u(f.users);
  8923. default:
  8924. return l(f.users)
  8925. }
  8926. })
  8927. })(e)
  8928. }, [e, n, r]), a.useEffect(() => {
  8929. var I;
  8930. s((I = ru[h]) == null ? void 0 : I.value)
  8931. }, [h, s]);
  8932. const E = (I, C) => {
  8933. let f = 0;
  8934. return I === "achievements" ? f = C.achievementScore : I === "online" ? f = Math.floor(C.onlineTime / 3600) : I === "respects" ? f = C.respectsReceived : I === "networth" ? f = Dc(C.value) : f = C.amount, _(f, I)
  8935. },
  8936. _ = (I, C) => `${I} ${g("toplist."+C+".pts")}`;
  8937. return t(z, {
  8938. children: d(v, {
  8939. className: "position-relative",
  8940. fullHeight: !0,
  8941. children: [t(V, {
  8942. skin: 4,
  8943. fullHeight: !0,
  8944. fullWidth: !0,
  8945. position: "absolute",
  8946. colour: L.dark_red,
  8947. opacity: 127
  8948. }), d(P, {
  8949. className: "podium",
  8950. children: [t(it, {
  8951. figure: p(1),
  8952. direction: 3,
  8953. className: "position-absolute winner"
  8954. }), t(it, {
  8955. figure: p(2),
  8956. direction: 2,
  8957. className: "position-absolute second"
  8958. }), t(it, {
  8959. figure: p(3),
  8960. direction: 4,
  8961. className: "position-absolute third"
  8962. })]
  8963. }), d(V, {
  8964. skin: 0,
  8965. position: "relative",
  8966. colour: L.white,
  8967. fullWidth: !0,
  8968. fullHeight: !0,
  8969. column: !0,
  8970. className: "text-black p-1 toplist-item",
  8971. alignItems: "center",
  8972. gap: 1,
  8973. children: [t(es, {
  8974. fullWidth: !0,
  8975. options: ru,
  8976. selectedIndex: h,
  8977. changeIndex: I => m(I),
  8978. colour: L.light_grey
  8979. }), t(R, {
  8980. fullWidth: !0,
  8981. alignItems: "center",
  8982. children: d(R, {
  8983. column: !0,
  8984. overflow: "hidden",
  8985. fullWidth: !0,
  8986. children: [o && o.map((I, C) => t(nu, {
  8987. index: C,
  8988. username: I.user.username,
  8989. amount: E(e, I)
  8990. }, C)), c && c.map((I, C) => t(nu, {
  8991. index: C,
  8992. username: I.username,
  8993. amount: _(Dc(I.credits), "credits")
  8994. }, C))]
  8995. })
  8996. })]
  8997. })]
  8998. })
  8999. })
  9000. },
  9001. Bk = i => {
  9002. const [e, s] = a.useState(!1), [n, r] = a.useState("");
  9003. if (a.useEffect(() => {
  9004. const o = {
  9005. linkReceived: l => s(!e),
  9006. eventUrlPrefix: "habboUI/open/toplists"
  9007. };
  9008. return dt(o), () => ht(o)
  9009. }, [e, s]), !!e) return t(le, {
  9010. title: g("toplists.title"),
  9011. skin: 1,
  9012. colour: L.primary_red,
  9013. className: "ton-toplist",
  9014. onCloseClick: o => s(!1),
  9015. children: t(Gk, {
  9016. type: n,
  9017. setActiveType: r
  9018. })
  9019. })
  9020. },
  9021. Hk = i => {
  9022. const {
  9023. step: e = 0
  9024. } = i;
  9025. return d(z, {
  9026. children: [t(V, {
  9027. className: "p-3",
  9028. colour: L.tutorial_purple,
  9029. justifyContent: "center",
  9030. children: t(P, {
  9031. className: `frank step-${e} flex-shrink-0`
  9032. })
  9033. }), t(N, {
  9034. dangerouslySetInnerHTML: {
  9035. __html: `${g(`tutorial.step.${e}`)}`}})]})},Vk=i=>{const{currentStep:e=1,...s}=i;return t(R,{gap:2,className:"p-2",fullHeight:!0,children:t(()=>{switch(e){default:return t(Hk,{step:e})}},{})})},Wk=i=>{const{tutorialVisible:e=null}=i,[s,n]=a.useState(!1),[r,o]=a.useState([]);W(yE,u=>{const h=u.getParser();h&&(o(h.gifts),e(!1),n(!0))});const l=u=>`url(${ee("image.library.url")+u})`,c=u=>{n(!1),B(new ME(u))};return t(z,{children:s&&t(le,{title:g("nux.gift.selection.choose.one"),closeable:!1,className:"ton-gift-chooser",colour:L.primary_blue,modal:!0,children:t(R,{fullHeight:!0,fullWidth:!0,gap:2,children:r&&r.map((u,h)=>d(R,{column:!0,fullHeight:!0,fullWidth:!0,gap:1,children:[t(V,{className:"ton-gift-chooser-gift",position:"relative",fullHeight:!0,skin:100,colour:L.primary_blue,style:{backgroundImage:l(u.imageUrl)},children:t(V,{opacity:127,skin:4,className:"thumbnail-glow"})}),t(D,{skin:1,onClick:m=>c(u.id),children:g("nux.gift.selection.button.get")})]},h))})})})},jk=()=>{const[i,e]=a.useState(!1);a.useEffect(()=>{const r={linkReceived:()=>e(!0),eventUrlPrefix:"nux/lobbyOffer"};return dt(r),()=>ht(r)},[i]);const s=()=>`url(${ee("image.library.url")+"/nux/lobbyoffer.png"})`,n=()=>{e(!1),B(new nc)};return i?t(le,{skin:0,windowPosition:tt.TOP_CENTER,title:g("notification.notification.nux.popup.title"),className:"ton-lobby-offer",children:d(V,{skin:100,colour:L.primary_blue,className:"ton-lobby-offer-image",position:"relative",style:{backgroundImage:s()},children:[t(V,{opacity:127,skin:4,className:"thumbnail-glow"}),t(V,{opacity:127,skin:4,colour:L.black,position:"absolute",className:"bottom-0 start-0 mb-1 ms-1 p-1",children:g("nux.offer.noob.lobby.summary")}),t(D,{skin:1,opacity:50,position:"absolute",className:"bottom-0 end-0 mb-1 me-1",onClick:n,children:g("nux.offer.noob.lobby.button")})]})}):null},ou=4,qk=i=>{const[e,s]=a.useState(!1),[n,r]=a.useState(1);a.useEffect(()=>{const l={linkReceived:()=>s(c=>!c),eventUrlPrefix:"nux/tutorial"};return dt(l),()=>ht(l)},[e]);const o=()=>{s(!1),B(new nc)};return d(z,{children:[e&&d(le,{skin:7,title:g("tutorial.title"),onCloseClick:()=>s(!1),className:"ton-tutorial",colour:L.white,modal:!0,children:[t(Vk,{currentStep:n}),d(R,{className:"buttons",gap:2,alignItems:"center",children:[t(N,{className:"cursor-pointer",onClick:l=>o(),bold:!0,children:g("tutorial.skip")}),d(R,{gap:1,children:[n!==1&&t(D,{onClick:l=>r(c=>c=c-1),children:g("habbo.way.back.button")}),n<ou&&t(D,{skin:1,onClick:l=>r(c=>c=c+1),children:g("habbo.way.next.button")}),n>=ou&&t(D,{skin:1,onClick:l=>o(),children:g("habbo.way.ok.button")})]})]})]}),t(Wk,{tutorialVisible:s}),t(jk,{})]})};class fs extends Gs{}fs.SHOW_CATALOG="CE_SHOW_CATALOG";fs.HIDE_CATALOG="CE_HIDE_CATALOG";fs.TOGGLE_CATALOG="CE_TOGGLE_CATALOG";fs.SOLD_OUT="CE_SOLD_OUT";fs.APPROVE_NAME_RESULT="CE_APPROVE_NAME_RESULT";fs.PURCHASE_APPROVED="CE_PURCHASE_APPROVED";fs.INIT_GIFT="CE_INIT_GIFT";fs.CATALOG_RESET="CE_RESET";fs.CATALOG_INVISIBLE_PAGE_VISITED="CE_CATALOG_INVISIBLE_PAGE_VISITED";class Yk extends fs{constructor(e,s,n){super(fs.INIT_GIFT),this._pageId=e,this._offerId=s,this._extraData=n}get pageId(){return this._pageId}get offerId(){return this._offerId}get extraData(){return this._extraData}}const FE=class extends fs{constructor(i){super(FE.POST_MARKETPLACE),this._item=i}get item(){return this._item}};let rc=FE;rc.POST_MARKETPLACE="CE_POST_MARKETPLACE";const xE=class extends Gs{constructor(i){super(xE.PURCHASE_SUCCESS),this._purchase=i}get purchase(){return this._purchase}};let Zs=xE;Zs.PURCHASE_SUCCESS="CPE_PURCHASE_SUCCESS";const GE=class extends Gs{constructor(i){super(GE.PURCHASE_FAILED),this._code=i}get code(){return this._code}};let On=GE;On.PURCHASE_FAILED="CPFE_PURCHASE_FAILED";const BE=class extends Gs{constructor(i){super(BE.NOT_ALLOWED),this._code=i}get code(){return this._code}};let Wr=BE;Wr.NOT_ALLOWED="CPNAE_NOT_ALLOWED";class Pt extends Gs{}Pt.WIDGETS_INITIALIZED="CWE_CWE_WIDGETS_INITIALIZED";Pt.SELECT_PRODUCT="CWE_SELECT_PRODUCT";Pt.SET_EXTRA_PARM="CWE_CWE_SET_EXTRA_PARM";Pt.PURCHASE="CWE_PURCHASE";Pt.COLOUR_ARRAY="CWE_COLOUR_ARRAY";Pt.MULTI_COLOUR_ARRAY="CWE_MULTI_COLOUR_ARRAY";Pt.COLOUR_INDEX="CWE_COLOUR_INDEX";Pt.TEXT_INPUT="CWE_TEXT_INPUT";Pt.DROPMENU_SELECT="CWE_CWE_DROPMENU_SELECT";Pt.PURCHASE_OVERRIDE="CWE_PURCHASE_OVERRIDE";Pt.SELLABLE_PET_PALETTES="CWE_SELLABLE_PET_PALETTES";Pt.UPDATE_ROOM_PREVIEW="CWE_UPDATE_ROOM_PREVIEW";Pt.GUILD_SELECTED="CWE_GUILD_SELECTED";Pt.TOTAL_PRICE_WIDGET_INITIALIZED="CWE_TOTAL_PRICE_WIDGET_INITIALIZED";Pt.PRODUCT_OFFER_UPDATED="CWE_CWE_PRODUCT_OFFER_UPDATED";Pt.SET_PREVIEWER_STUFFDATA="CWE_CWE_SET_PREVIEWER_STUFFDATA";Pt.EXTRA_PARAM_REQUIRED_FOR_BUY="CWE_CWE_EXTRA_PARAM_REQUIRED_FOR_BUY";Pt.TOGGLE="CWE_CWE_TOGGLE";Pt.BUILDER_SUBSCRIPTION_UPDATED="CWE_CWE_BUILDER_SUBSCRIPTION_UPDATED";Pt.ROOM_CHANGED="CWE_CWE_ROOM_CHANGED";Pt.SHOW_WARNING_TEXT="CWE_CWE_SHOW_WARNING_TEXT";const HE=class extends Gs{constructor(){super(HE.SOLD_OUT)}};let jr=HE;jr.SOLD_OUT="CPSOE_SOLD_OUT";const VE=class extends Gs{constructor(i,e){super(VE.UPDATE_STUFF_DATA),this._offer=i,this._stuffData=e}get offer(){return this._offer}get stuffData(){return this._stuffData}};let zk=VE;zk.UPDATE_STUFF_DATA="SRPSA_UPDATE_STUFF_DATA";class Xt extends Gs{}Xt.SHOW_GUIDE_TOOL="GTE_SHOW_GUIDE_TOOL";Xt.HIDE_GUIDE_TOOL="GTE_HIDE_GUIDE_TOOL";Xt.TOGGLE_GUIDE_TOOL="GTE_TOGGLE_GUIDE_TOOL";Xt.CREATE_HELP_REQUEST="GTE_CREATE_HELP_REQUEST";Xt.CREATE_BULLY_REQUEST="GTE_CREATE_BULLY_REQUEST";class Oi extends Gs{}Oi.INIT="HC_NAME_CHANGE_INIT";const WE=class extends Gs{constructor(i,e,s){super(WE.FURNI_ADDED),this.id=i,this.spriteId=e,this.category=s}};let wi=WE;wi.FURNI_ADDED="IFAE_FURNI_ADDED";class Ys extends Gs{}Ys.SHOW_THUMBNAIL="NE_SHOW_THUMBNAIL";Ys.HIDE_THUMBNAIL="NE_HIDE_THUMBNAIL";Ys.TOGGLE_THUMBNAIL="NE_TOGGLE_THUMBNAIL";const iu=i=>i&&i.length?i.replace(/\\r/g,"\r"):"",au=i=>{const e="0"+i;return e.substr(e.length-2,e.length)};let no=null;const Kk=()=>{const[i,e]=a.useState([]),[s,n]=a.useState([]),[r,o]=a.useState([]),[l,c]=a.useState(!1),[u,h]=a.useState(!1),m=()=>ee("notification",{}),p=x=>{const M=m();return M?M[x]:null},E=(x,M,G,H)=>{if(x.has(G))return x.get(G);const Y=["notification",M,G].join(".");return _e().localization.hasValue(Y)||H?g(Y,Array.from(x.keys()),Array.from(x.values())):null},_=(x,M)=>{let G=x.get("image");return G||(G=ee("image.library.notifications.url","").replace("%image%",M.replace(/\./g,"_"))),g(G)},I=a.useCallback((x,M=null,G=null,H=null,Y=null,q=null)=>{(!Y||!Y.length)&&(Y=g("notifications.broadcast.title")),(!M||!M.length)&&(M=fe.DEFAULT);const Z=new al([iu(x)],M,G,H,Y,q);e(ce=>[Z,...ce])},[]),C=a.useCallback(()=>I(null,fe.NITRO),[I]),f=a.useCallback(()=>I(null,fe.AFK),[I]),S=a.useCallback((x,M=Le.INFO,G=null,H=null,Y=xn.BUBBLE,q=-1)=>{if(l)return;const Z=new X_(Y,x,M,G,H,q);n(ce=>[Z,...ce])},[l]),T=(x,M=null)=>{M||(M=new Map);const G=p("notification."+x);if(G)for(const me in G)M.set(me,G[me]);x==="floorplan_editor.error"&&M.set("message",M.get("message").replace(/[^a-zA-Z._ ]/g,""));const H=E(M,x,"title",!0),Y=E(M,x,"message",!0).replace(/\\r/g,"\r"),q=E(M,x,"linkTitle",!1),Z=E(M,x,"linkUrl",!1),ce=_(M,x),se=E(M,x,"display",!0);let ye=E(M,x,"timeout",!1);ye||(ye="-1"),se===xn.BUBBLE||se===xn.PERSISTENT_BUBBLE?S(g(Y),x,ce,Z,se,parseInt(ye)):I(g(Y),x,Z,q,H,ce),M.get("sound")&&Fs(M.get("sound"))},b=a.useCallback((x,M,G,H=null,Y=null,q=null,Z=null)=>{(!H||!H.length)&&(H=g("generic.confirm")),(!Y||!Y.length)&&(Y=g("generic.cancel")),(!q||!q.length)&&(q=g("notifications.broadcast.title"));const ce=new J_(Z,x,M,G,H,Y,q);o(se=>[ce,...se])},[]),y=(x,M=null,G=!0)=>{I(x,fe.DEFAULT,M,g("mod.alert.link"),g("mod.alert.title"))},w=a.useCallback((x,M="")=>{switch(x){case yt.ALERT_SCAM:I(g("inventory.trading.warning.other_not_offering"),null,null,null,g("inventory.trading.notification.title"));return;case yt.HOTEL_TRADING_DISABLED:case yt.YOU_NOT_ALLOWED:case yt.THEY_NOT_ALLOWED:case yt.ROOM_DISABLED:case yt.YOU_OPEN:case yt.THEY_OPEN:I(g(`inventory.trading.openfail.${x}`,["otherusername"],[M]),null,null,null,g("inventory.trading.openfail.title"));return;case yt.ERROR_WHILE_COMMIT:I(`${g("inventory.trading.notification.caption")}, ${g("inventory.trading.notification.commiterror.info")}`,null,null,null,g("inventory.trading.notification.title"));return;case yt.THEY_CANCELLED:I(g("inventory.trading.info.closed"),null,null,null,g("inventory.trading.notification.title"));return}},[I]),O=a.useCallback(x=>{e(M=>{const G=[...M],H=G.findIndex(Y=>x===Y);return H>=0&&G.splice(H,1),G})},[]),F=a.useCallback(x=>{n(M=>{const G=[...M],H=G.findIndex(Y=>x===Y);return H>=0&&G.splice(H,1),G})},[]),U=a.useCallback(x=>{o(M=>{const G=[...M],H=G.findIndex(Y=>x===Y);return H>=0&&G.splice(H,1),G})},[]);W(Cg,x=>{const M=x.getParser();if(M.userId!==J().userId)return;const G=g("notifications.text.respect.1"),H=g("notifications.text.respect.2",["count"],[M.respectsReceived.toString()]);S(G,Le.RESPECT),S(H,Le.RESPECT)}),W(xm,x=>{const M=x.getParser();I(M.message.replace(/\\r/g,"\r"),null,null,g("notifications.broadcast.title"))}),W(Vm,x=>{const M=x.getParser(),G=g("achievements.levelup.desc"),H=yo(M.data.badgeCode),Y=J().getBadgeUrl(M.data.badgeCode),q="questengine/achievements/"+M.data.category;S(G+" "+H,Le.ACHIEVEMENT,Y,q)}),W(jm,x=>{const M=x.getParser();M.numGifts<=0||S(M.numGifts.toString(),Le.CLUBGIFT,null,"catalog/open/"+ee("catalog.links")["hc.hc_gifts"],xn.PERSISTENT_BUBBLE)}),W(bm,x=>{const M=x.getParser();y(M.message,M.url,!1)}),W(Cl,x=>{const M=x.getParser();if(M.amountChanged<=0||M.type!==5)return;const G=ee("currency.asset.icon.url","").replace("%type%",M.type.toString());S(g("notifications.text.loyalty.received",["AMOUNT"],[M.amountChanged.toString()]),Le.INFO,G)}),W(mm,x=>{const M=x.getParser();y(M.message)}),W(wd,x=>{const M=x.getParser();I(g("opening.hours."+(M.userThrowOutAtClose?"disconnected":"closed"),["h","m"],[au(M.openHour),au(M.openMinute)]),fe.DEFAULT,null,null,g("opening.hours.title"))}),W($h,x=>{const M=x.getParser(),G=g("notifications.text."+(M.boughtAsGift?"petbought":"petreceived"));let H=null;const Y=X().getRoomObjectPetImage(M.pet.typeId,M.pet.paletteId,parseInt(M.pet.color,16),new Lt(45*3),64,null,!0);Y&&(H=Y.getImage().src),S(G,Le.PETLEVEL,H)}),W(Gm,x=>{const G=x.getParser().messages.map(Y=>iu(Y)),H=new al(G,fe.MOTD,null,null,g("notifications.motd.title"));e(Y=>[H,...Y])}),W(qm,x=>{const M=x.getParser();let G=null;const H=X().getRoomObjectPetImage(M.figureData.typeId,M.figureData.paletteId,parseInt(M.figureData.color,16),new Lt(45*3),64,null,!0);H&&(G=H.getImage().src),S(g("notifications.text.petlevel",["pet_name","level"],[M.petName,M.level.toString()]),Le.PETLEVEL,G)}),W(Wm,x=>{const M=x.getParser();c(!M.enabled)}),W(zd,x=>{const M=x.getParser();if(!M.products||!M.products.length)return;const G=M.products[0];G&&S(g("notifications.text.club_gift.received"),Le.INFO,hi.getProductImageUrl(G.productType,G.furniClassId,G.extraParam))}),W(Ad,x=>{const M=x.getParser();I(g("maintenance.shutdown",["m","d"],[M.minutesUntilMaintenance.toString(),M.duration.toString()]),fe.DEFAULT,null,null,g("opening.hours.title"))}),W(gm,x=>{const M=x.getParser();y(M.message,M.url)}),W(Bm,x=>{const M=x.getParser();T(M.type,M.parameters)}),W(yd,x=>{const M=x.getParser();I(g("opening.hours.shutdown",["m"],[M.openMinute.toString()]),fe.DEFAULT,null,null,g("opening.hours.title"))}),W(Od,x=>{const M=x.getParser();I(g("opening.hours.disconnected",["h","m"],[M.openHour.toString(),M.openMinute.toString()]),fe.DEFAULT,null,null,g("opening.hours.title"))});const j=a.useCallback(()=>{if(!u)if(Qa.isRunning()){if(no)return;no=setTimeout(()=>{j()},Qa.totalRunningTime+5e3)}else no&&(clearTimeout(no),no=null),S(g("mod.chatdisclaimer"),Le.INFO),h(!0)},[u,S]);return W(zm,j),{alerts:i,bubbleAlerts:s,confirms:r,simpleAlert:I,showNitroAlert:C,showAfkAlert:f,showModeratorMessage:y,showTradeAlert:w,showConfirm:b,closeAlert:O,closeBubbleAlert:F,closeConfirm:U,showSingleBubble:S}},Ke=()=>Qe(Kk),$k=(i,e)=>{const[s,n]=a.useState(()=>{if(typeof window>"u")return e;try{return G_(i)??e}catch{return e}});return[s,o=>{try{const l=o instanceof Function?o(s):o;n(l),typeof window<"u"&&Wy(i,l)}catch(l){Vl.error(l)}}]},ji=$k,Qk=()=>ji(Ao.CATALOG_PLACE_MULTIPLE_OBJECTS,!1),jE=()=>Qe(Qk),Xk=()=>ji(Ao.CATALOG_SKIP_PURCHASE_CONFIRMATION,!1),qE=()=>Qe(Xk),Jk=-12345678,Zk=()=>{const[i,e]=a.useState(!1),[s,n]=a.useState(!1),[r,o]=a.useState(-1),[l,c]=a.useState(-1),[u,h]=a.useState(Us.NORMAL),[m,p]=a.useState(null),[E,_]=a.useState(null),[I,C]=a.useState(null),[f,S]=a.useState(null),[T,b]=a.useState([]),[y,w]=a.useState(null),[O,F]=a.useState([]),[U,j]=a.useState(null),[x,M]=a.useState(!1),[G,H]=a.useState({quantity:1,extraData:null,extraParamRequired:!1,previewStuffData:null}),[Y,q]=a.useState({}),[Z,ce]=a.useState(!1),[se,ye]=jE(),[me,lt]=qE(),[ie,He]=a.useState(null),[ft,Ie]=a.useState(null),[ve,St]=a.useState(0),[Bt,Es]=a.useState(0);a.useState(0);const[tn,Re]=a.useState(0);a.useState(0),a.useState(0);const{simpleAlert:Ve=null}=Ke(),Ye=a.useRef(new Sn),[rs,be]=a.useState(0),[Ae,As]=a.useState(null),hr=a.useCallback(()=>{o(-1),c(-1),p(null),_(null),C(null),S(null),b([]),w(null),F([]),e(!1)},[]),Qr=a.useCallback(K=>{if(!K)return ds.MISSING_OFFER;if(ve<0||ve>=Bt)return ds.FURNI_LIMIT_REACHED;const te=Pe();if(!te)return ds.NOT_IN_ROOM;if(!te.isRoomOwner)return ds.NOT_ROOM_OWNER;if(tn<=0){const ne=X();let he=ne.getRoomObjectCount(te.roomId,re.UNIT);for(;he>0;){const Te=ne.getRoomObjectByIndex(te.roomId,he,re.UNIT),Je=te.userDataManager.getUserDataByIndex(Te.id);if(Je&&Je.type===vt.USER&&Je.roomIndex!==te.ownRoomIndex&&!Je.isModerator)return ds.VISITORS_IN_ROOM;he--}}return ds.OKAY},[ve,Bt,tn]),Xr=a.useCallback(K=>{const te=Pe();return!!((te&&K.page&&K.page.layoutCode!=="sold_ltd_items"&&u===Us.NORMAL&&(te.isRoomOwner||te.isGuildRoom&&te.controllerLevel>=_t.GUILD_MEMBER)||u===Us.BUILDER&&Qr(K)===ds.OKAY)&&K.pricingModel!==et.PRICING_MODEL_BUNDLE&&K.product.productType!==Ce.EFFECT&&K.product.productType!==Ce.HABBO_CLUB)},[u,Qr]),Xn=a.useCallback(K=>{if(!Xr(K))return;const te=K.product;if(!te)return;let ne=0;switch(te.productType){case Ce.FLOOR:ne=re.FLOOR;break;case Ce.WALL:ne=re.WALL;break}X().processRoomObjectPlacement(go.CATALOG,-K.offerId,ne,te.productClassId,te.extraParam)&&(He(K),ce(!0),e(!1))},[Xr]),Mn=a.useCallback((K,te)=>{const ne=X();let he=ne.getRoomInstanceVariable(ne.activeRoomId,ue.ROOM_WALL_TYPE),Te=ne.getRoomInstanceVariable(ne.activeRoomId,ue.ROOM_FLOOR_TYPE),Je=ne.getRoomInstanceVariable(ne.activeRoomId,ue.ROOM_LANDSCAPE_TYPE);switch(he=he&&he.length?he:"101",Te=Te&&Te.length?Te:"101",Je=Je&&Je.length?Je:"1.1",K){case"floor":ne.updateRoomInstancePlaneType(ne.activeRoomId,te,he,Je,!0);return;case"wallpaper":ne.updateRoomInstancePlaneType(ne.activeRoomId,Te,te,Je,!0);return;case"landscape":ne.updateRoomInstancePlaneType(ne.activeRoomId,Te,he,te,!0);return;default:ne.updateRoomInstancePlaneType(ne.activeRoomId,Te,he,Je,!0);return}},[]),Jr=a.useCallback(()=>{ie&&(X().cancelRoomObjectInsert(),ce(!1),He(null))},[ie]),Jn=a.useCallback((K=!0)=>{ce(te=>(te&&K&&oe("catalog/open"),!1))},[]),Zr=a.useCallback((K=!1)=>{K||Jn(),Ie(te=>{if(te)switch(te.category){case re.FLOOR:X().removeRoomObjectFloor(te.roomId,te.objectId);break;case re.WALL:{switch(te.furniData.className){case"floor":case"wallpaper":case"landscape":Mn("reset","");break;default:X().removeRoomObjectWall(te.roomId,te.objectId);break}break}default:X().deleteRoomObject(te.objectId,te.category);break}return null})},[Jn,Mn]),Un=a.useCallback((K,te)=>{if(te.pageId===K&&te!==m)return te;for(const ne of te.children){const he=Un(K,ne);if(he)return he}return null},[m]),mn=a.useCallback((K,te)=>{if(te.pageName===K&&te!==m)return te;for(const ne of te.children){const he=mn(K,ne);if(he)return he}return null},[m]),os=a.useCallback((K,te=!1)=>{if(!E||!E.size)return null;if(te){const ne=[],he=E.get(K);if(he&&he.length)for(const Te of he)Te.isVisible&&ne.push(Te);if(ne.length)return ne}return E.get(K)},[E]),Ln=a.useCallback((K,te)=>{K<0||(n(!0),o(K),K>-1&&B(new Xg(K,te,u)))},[u]),eo=a.useCallback((K,te,ne,he,Te,Je)=>{const Dt=new Wl(K,te,ne,he,Je);if(C(Dt),c(Be=>K!==-1?K:Be),M(!1),Te>-1&&Dt.offers.length){for(const Be of Dt.offers)if(Be.offerId===Te){S(Be);break}}},[]),$t=a.useCallback((K,te=-1)=>{if(Jr(),K.parent.pageName==="root"&&K.children.length){for(const Te of K.children)if(Te.isVisible){K=Te;break}}const ne=[];let he=K;for(;he&&he.pageName!=="root";)ne.push(he),he=he.parent;ne.reverse(),b(Te=>{const Je=Te.indexOf(K)>=0,Dt=K.isOpen;for(const Be of Te)Be.deactivate(),ne.indexOf(Be)===-1&&Be.close();for(const Be of ne)Be.activate(),Be.parent&&Be.open(),Be===K.parent&&Be.children.length&&Be.open();return Je&&Dt?K.close():K.open(),ne}),K.pageId>-1&&Ln(K.pageId,te)},[b,Ln,Jr]),to=a.useCallback(K=>{if(K!==-1&&w(null),!i)Ye.current.requestById=K,e(!0);else{const te=Un(K,m);te&&$t(te)}},[i,m,Un,$t]),Ji=a.useCallback(K=>{if(w(null),!i)Ye.current.requestByName=K,e(!0);else{const te=mn(K,m);te&&$t(te)}},[i,m,mn,$t]),Zi=a.useCallback(K=>{if(w(null),!i)Ye.current.requestedByOfferId=K,e(!0);else{const te=os(K);if(!te||!te.length)return;$t(te[0],K)}},[i,os,$t]),yI=a.useCallback(()=>{},[]),AI=a.useCallback(K=>{let te=G.quantity,ne=Math.trunc(te/Ae.discountBatchSize),he=0;ne>=Ae.minDiscountsForBonus&&(te%Ae.discountBatchSize==Ae.discountBatchSize-1&&(he=1),he+=ne-Ae.minDiscountsForBonus);let Te=0;Ae.discountThreshold.forEach(Dt=>{te>=Dt&&(Te+=1)});let Je=ne*Ae.discountAmountPerBatch+he+Te;return{price:Math.max(0,K*(te-Je)),itemsDiscounted:Math.floor(Je)}},[Ae,G]),kI=a.useMemo(()=>{if(!f)return null;switch(f.priceType){case et.PRICE_TYPE_CREDITS:return ee("currency.colours")[-1];case et.PRICE_TYPE_ACTIVITYPOINTS:return ee("currency.colours")[f.activityPointType];default:return L.catalog_tab_inactive_grey}},[f]);return W(CE,K=>{const te=K.getParser(),ne=new Map,he=(Te,Je,Dt)=>{const Be=new my(Te,Je,Dt);for(const Ft of Be.offerIds)ne.has(Ft)?ne.get(Ft).push(Be):ne.set(Ft,[Be]);Je++;for(const Ft of Te.children)Be.addChild(he(Ft,Je,Be));return Be};p(he(te.root,0,null)),_(ne)}),W(qd,K=>{const te=K.getParser();if(te.catalogType!==u)return;const ne=[];let he=null;for(const Te of te.offers){const Je=[],Dt=wr(Te.localizationId);for(const Ft of Te.products){const MI=Io(Ft.furniClassId,Ft.productType);Je.push(new or(Ft.productType,Ft.furniClassId,Ft.extraParam,Ft.productCount,Dt,MI,Ft.uniqueLimitedItem,Ft.uniqueLimitedSeriesSize,Ft.uniqueLimitedItemsLeft))}if(!Je.length)continue;const Be=new et(Te.offerId,Te.localizationId,Te.rent,Te.priceCredits,Te.priceActivityPoints,Te.priceActivityPointsType,Te.giftable,Te.clubLevel,Je,Te.bundlePurchaseAllowed);(u===Us.NORMAL||Be.pricingModel!==et.PRICING_MODEL_BUNDLE&&Be.pricingModel!==et.PRICING_MODEL_MULTI)&&ne.push(Be),Te.offerId===te.offerId&&(he=Be)}te.frontPageItems&&te.frontPageItems.length&&F(te.frontPageItems),n(!1),r===te.pageId&&(eo(te.pageId,te.layoutCode,new F_(te.localization.images.concat(),te.localization.texts.concat()),ne,te.offerId,te.acceptSeasonCurrencyAsCredits),he&&S(he))}),W(th,K=>{const te=K.getParser();At(new Zs(te.offer))}),W(Zd,K=>{const te=K.getParser();At(new On(te.code))}),W(eh,K=>{const te=K.getParser();At(new Wr(te.code))}),W(Xd,K=>{K.getParser(),At(new jr)}),W(Jd,K=>{const ne=K.getParser().offer;if(!ne||!ne.products.length)return;ne.products[0].uniqueLimitedItem;const Te=[],Je=wr(ne.localizationId);for(const Be of ne.products){const Ft=Io(Be.furniClassId,Be.productType);Te.push(new or(Be.productType,Be.furniClassId,Be.extraParam,Be.productCount,Je,Ft,Be.uniqueLimitedItem,Be.uniqueLimitedSeriesSize,Be.uniqueLimitedItemsLeft))}const Dt=new et(ne.offerId,ne.localizationId,ne.rent,ne.priceCredits,ne.priceActivityPoints,ne.priceActivityPointsType,ne.giftable,ne.clubLevel,Te,ne.bundlePurchaseAllowed);(u===Us.NORMAL||Dt.pricingModel!==et.PRICING_MODEL_BUNDLE&&Dt.pricingModel!==et.PRICING_MODEL_MULTI)&&(Dt.page=I,S(Dt),Dt.product&&Dt.product.productType===Ce.WALL&&H(Be=>{const Ft={...Be};return Ft.extraData=Dt.product.extraParam||null,Ft}))}),W(nh,K=>{const te=K.getParser(),ne=new gy(te.productCode,te.palettes.slice());q(he=>{const Te=[];he.petPalettes&&Te.push(...he.petPalettes);for(let Je=0;Je<Te.length;Je++)if(Te[Je].breed===ne.breed){Te.splice(Je,1);break}return Te.push(ne),{...he,petPalettes:Te}})}),W(Qd,K=>{const te=K.getParser();q(ne=>{const he=te.offers;return{...ne,clubOffers:he}})}),W(kg,K=>{const te=K.getParser();q(ne=>{const he=te.groups;return{...ne,groups:he}})}),W($d,K=>{const te=K.getParser();q(ne=>{const he=new Cy(te);return{...ne,giftConfiguration:he}})}),W(um,K=>{const te=K.getParser();if(!te)return;let ne="";te.result===1?ne=g("inventory.marketplace.result.title.success"):ne=g("inventory.marketplace.result.title.failure");const he=g(`inventory.marketplace.result.${te.result}`);Ve(he,fe.DEFAULT,null,null,ne)}),W(ml,K=>{const te=K.getParser();q(ne=>({...ne,clubGifts:te}))}),W(Yd,K=>{const te=i;hr(),te&&Ve(g("catalog.alert.published.description"),fe.ALERT,null,null,g("catalog.alert.published.title"))}),W(jd,K=>{const te=K.getParser();St(te.furniCount),yI()}),ct(Zs.PURCHASE_SUCCESS,K=>Fs(cs.CREDITS)),ke(Cc.PLACED,K=>{if(!Z||K.type!==Cc.PLACED)return;if(Zr(!0),!ie){Jn();return}let te=!1;const ne=ie.product;if(K.category===re.WALL)switch(ne.furnitureData.className){case"floor":case"wallpaper":case"landscape":te=K.placedOnFloor||K.placedOnWall;break;default:te=K.placedInRoom;break}else te=K.placedInRoom;if(!te){Jn();return}switch(Ie(new Sy(K.roomId,K.objectId,K.category,K.wallLocation,K.x,K.y,K.direction,ie)),u){case Us.NORMAL:{switch(K.category){case re.FLOOR:X().addFurnitureFloor(K.roomId,K.objectId,ne.productClassId,new Lt(K.x,K.y,K.z),new Lt(K.direction),0,new yw);break;case re.WALL:switch(ne.furnitureData.className){case"floor":case"wallpaper":case"landscape":Mn(ne.furnitureData.className,ne.extraParam);break;default:X().addFurnitureWall(K.roomId,K.objectId,ne.productClassId,new Lt(K.x,K.y,K.z),new Lt(K.direction*45),0,K.instanceData,0);break}}const he=X().getRoomObject(K.roomId,K.objectId,K.category);he&&he.model.setValue(ue.FURNITURE_ALPHA_MULTIPLIER,.5),me&&B(new Yr(r,ie.offerId,ne.extraParam,1)),se&&Xn(ie);break}case Us.BUILDER:{let he=ie.page.pageId;switch(he===Jk&&(he=-1),K.category){case re.FLOOR:B(new zg(he,ie.offerId,ne.extraParam,K.x,K.y,K.direction));break;case re.WALL:B(new Kg(he,ie.offerId,ne.extraParam,K.wallLocation));break}se&&Xn(ie);break}}}),ct(wi.FURNI_ADDED,K=>{const te=X();if(!(!ft||ft.productClassId!==K.spriteId||ft.roomId!==te.activeRoomId)){switch(K.category){case ae.FLOOR:{const ne=te.getRoomInstanceVariable(te.activeRoomId,ue.ROOM_FLOOR_TYPE);ft.extraParam!==ne&&B(new ao(K.id));break}case ae.WALL_PAPER:{const ne=te.getRoomInstanceVariable(te.activeRoomId,ue.ROOM_WALL_TYPE);ft.extraParam!==ne&&B(new ao(K.id));break}case ae.LANDSCAPE:{const ne=te.getRoomInstanceVariable(te.activeRoomId,ue.ROOM_LANDSCAPE_TYPE);ft.extraParam!==ne&&B(new ao(K.id));break}default:B(new wf(K.id,ft.category,ft.wallLocation,ft.x,ft.y,ft.direction))}se||Zr()}}),W(IE,K=>{const ne=K.getParser().bundleDiscountRuleset;As(ne)}),a.useEffect(()=>()=>S(null),[I]),a.useEffect(()=>{if(!(!i||!m||!E||!Ye.current))switch(Ye.current.requestType){case Sn.REQUEST_TYPE_NONE:if(I)return;if(m.isBranch){for(const K of m.children)if(K&&K.isVisible){$t(K);return}}return;case Sn.REQUEST_TYPE_ID:to(Ye.current.requestById),Ye.current.resetRequest();return;case Sn.REQUEST_TYPE_OFFER:Zi(Ye.current.requestedByOfferId),Ye.current.resetRequest();return;case Sn.REQUEST_TYPE_NAME:Ji(Ye.current.requestByName),Ye.current.resetRequest();return}},[i,m,E,I,$t,to,Zi,Ji]),a.useEffect(()=>{!y&&I&&I.pageId===-1&&to(l)},[y,I,l,to]),a.useEffect(()=>{f&&H({quantity:1,extraData:null,extraParamRequired:!1,previewStuffData:null})},[f]),a.useEffect(()=>{!i||m||(B(new tp),B(new vl),B(new Qg(u)),B(new $g),B(new rp))},[i,m,u]),a.useEffect(()=>(j(new Ci(X(),++Ci.PREVIEW_COUNTER)),()=>{j(K=>(K.dispose(),null))}),[]),{isVisible:i,setIsVisible:e,isBusy:s,pageId:r,previousPageId:l,currentType:u,rootNode:m,offersToNodes:E,currentPage:I,setCurrentPage:C,currentOffer:f,setCurrentOffer:S,activeNodes:T,searchResult:y,setSearchResult:w,frontPageItems:O,roomPreviewer:U,navigationHidden:x,setNavigationHidden:M,purchaseOptions:G,setPurchaseOptions:H,catalogOptions:Y,setCatalogOptions:q,getNodeById:Un,getNodeByName:mn,activateNode:$t,openPageById:to,openPageByName:Ji,openPageByOfferId:Zi,requestOfferToMover:Xn,calculateDiscount:AI,ruleSet:Ae,getCurrencyColour:kI,selectedGroupIndex:rs,setSelectedGroupIndex:be}},De=()=>Qe(Zk),qi=()=>{const[i,e]=a.useState([]),s=a.useMemo(()=>!!i.length,[i]),n=a.useCallback(()=>{let o=-1;return e(l=>{const c=[...l];return o=c.length?c[c.length-1]+1:0,c.push(o),c}),o},[]),r=a.useCallback(o=>{e(l=>{const c=[...l],u=c.indexOf(o);return u===-1?l:(c.splice(u,1),c)})},[]);return{isVisible:s,activate:n,deactivate:r}},eM=i=>B(new _f(i)),tM=(i,e)=>B(new Ef(i,...e)),sM=()=>{const[i,e]=a.useState(new Map),s=a.useCallback(u=>{var h;return((h=i.get(u))==null?void 0:h.length)||0},[i]),n=a.useMemo(()=>{let u=0;for(const h of i.keys())u+=s(h);return u},[i,s]),r=a.useCallback(u=>{let h=!0;return e(m=>{if(!m.has(u))return h=!1,m;const p=new Map(m);return p.delete(u),eM(u),p}),h},[]),o=a.useCallback((u,h)=>{let m=!0;return e(p=>{if(!p.has(u))return m=!1,p;const E=new Map(p),_=E.get(u);if(_)for(const I of h)_.splice(_.indexOf(I),1);return tM(u,h),E}),m},[]),l=a.useCallback((u,h)=>i.has(u)?i.get(u).indexOf(h)>=0:!1,[i]),c=a.useCallback((u,h)=>{e(m=>{if(!m.has(u))return m;const p=new Map(m),E=p.get(u),_=E.indexOf(h);return _>=0&&E.splice(_,1),p})},[]);return W(Hm,u=>{const h=u.getParser();e(m=>{const p=new Map(m);for(const E of h.categories){let _=p.get(E);_||(_=[],p.set(E,_));const I=h.getItemsByCategory(E);for(const C of I)_.indexOf(C)===-1&&_.push(C)}return p})}),{getCount:s,getFullCount:n,resetCategory:r,resetItems:o,isUnseen:l,removeUnseen:c}},ws=()=>Qe(sM),nM=()=>{const[i,e]=a.useState(!0),[s,n]=a.useState([]),[r,o]=a.useState([]),[l,c]=a.useState([]),[u,h]=a.useState(null),{isVisible:m=!1,activate:p=null,deactivate:E=null}=qi(),{isUnseen:_=null,resetCategory:I=null}=ws(),C=ee("user.badges.max.slots",5),f=y=>l.indexOf(y)>=0,S=()=>l.length<C,T=y=>{c(w=>{const O=[...w],F=O.indexOf(y);if(F===-1){if(!S())return w;O.push(y)}else O.splice(F,1);const U=new af;for(let j=0;j<C;j++)U.addActivatedBadge(O[j]||null);return B(U),O})},b=y=>{const w=s.indexOf(y);return w===-1?0:r[w]||0};return W(Bh,y=>{const w=y.getParser(),O=w.getAllBadgeCodes(),F=[];for(const U of O)F.push(w.getBadgeId(U));n(O),o(F),c(w.getActiveBadgeCodes())}),W(Hh,y=>{const w=y.getParser(),O=_(nt.BADGE,w.badgeId);n(F=>{const U=[...F];return O?U.unshift(w.badgeCode):U.push(w.badgeCode),U}),o(F=>{const U=[...F];return O?U.unshift(w.badgeId):U.push(w.badgeId),U})}),a.useEffect(()=>{!s||!s.length||h(y=>{let w=y;return w&&s.indexOf(w)===-1&&(w=null),w||(w=s[0]),w})},[s]),a.useEffect(()=>{if(m)return()=>{I(nt.BADGE)}},[m,I]),a.useEffect(()=>{!m||!i||(B(new of),e(!1))},[m,i]),{badgeCodes:s,activeBadgeCodes:l,selectedBadgeCode:u,setSelectedBadgeCode:h,isWearingBadge:f,canWearBadges:S,toggleBadge:T,getBadgeId:b,activate:p,deactivate:E}},Yi=()=>Qe(nM),rM=()=>{const[i,e]=a.useState(!0),[s,n]=a.useState([]),[r,o]=a.useState(null),{isVisible:l=!1,activate:c=null,deactivate:u=null}=qi(),{isUnseen:h=null,resetCategory:m=null}=ws();return W(Ld,p=>{const E=p.getParser();n(_=>{const I=[..._],C=I.map(S=>S.botData.id),f=[];for(const S of E.items.values())C.indexOf(S.id)===-1&&f.push(S);for(const S of C){let T=!0;for(const w of E.items.values())if(w.id===S){T=!1;break}if(!T)continue;const b=I.findIndex(w=>w.botData.id===S),y=I[b];b===-1||!y||(Pr()===y.botData.id&&(To(),oe("inventory/open")),I.splice(b,1))}for(const S of f){const T={botData:S};h(nt.BOT,S.id)?I.unshift(T):I.push(T)}return I})}),W(Ud,p=>{const E=p.getParser();n(_=>{const I=[..._];if(I.findIndex(T=>T.botData.id===E.item.id)>=0)return _;const f={botData:E.item};return h(nt.BOT,f.botData.id)?I.unshift(f):I.push(f),I})}),W(Pd,p=>{const E=p.getParser();n(_=>{const I=[..._],C=I.findIndex(f=>f.botData.id===E.itemId);return C===-1?_:(I.splice(C,1),Pr()===E.itemId&&(To(),oe("inventory/show")),I)})}),a.useEffect(()=>{!s||!s.length||o(p=>{let E=p;return E&&s.indexOf(E)===-1&&(E=null),E||(E=s[0]),E})},[s]),a.useEffect(()=>{if(l)return()=>{m(nt.BOT)}},[l,m]),a.useEffect(()=>{!l||!i||(B(new ja),e(!1))},[l,i]),{botItems:s,selectedBot:r,setSelectedBot:o,activate:c,deactivate:u}},YE=()=>Qe(rM);let Zo=null;const oM=()=>{const[i,e]=a.useState(!0),[s,n]=a.useState([]),[r,o]=a.useState(null),{isVisible:l=!1,activate:c=null,deactivate:u=null}=qi(),{isUnseen:h=null,resetCategory:m=null}=ws(),p=I=>{if(!(!s||!s.length))return s.filter(C=>C.type===I)},E=I=>{if(!(!s||!s.length)){for(const C of s){const f=C.getItemById(I);if(f&&f.isWallItem)return C}return null}},_=I=>{if(!(!s||!s.length)){for(const C of s){const f=C.getItemById(I);if(f&&!f.isWallItem)return C}return null}};return W(_l,I=>{const C=I.getParser();n(f=>{const S=[...f];for(const T of C.items){let b=0,y=null;for(;b<S.length;){const w=S[b];let O=0;for(;O<w.items.length;){const F=w.items[O];if(F.id===T.itemId){F.update(T);const U=[...w.items];U[O]=F,w.items=U,y=w;break}O++}if(y)break;b++}if(y)y.hasUnseenItems=!0,S[b]=ts(y);else{const w=new So(T);xc(S,w,h(nt.FURNI,T.itemId)),At(new wi(w.id,w.type,w.category))}}return S})}),W(_i,I=>{const C=I.getParser();Zo||(Zo=new Array(C.totalFragments));const f=Ly(C.fragment,C.totalFragments,C.fragmentNumber,Zo);f&&(n(S=>{const T=[...S],b=Py(T);for(const y of b){if(f.get(y))continue;let w=0;for(;w<T.length;){const O=T[w],F=O.remove(y);if(!F){w++;continue}Pr()===F.ref&&(To(),Dr(O)||oe("inventory/show")),O.getTotalCount()<=0&&(T.splice(w,1),O.dispose());break}}for(const y of f.keys()){if(b.indexOf(y)>=0)continue;const w=f.get(y);if(!w)continue;const O=new So(w);xc(T,O,h(nt.FURNI,y)),At(new wi(O.id,O.type,O.category))}return T}),Zo=null)}),W(jh,I=>{e(!0)}),W(El,I=>{const C=I.getParser();n(f=>{const S=[...f];let T=0;for(;T<S.length;){const b=S[T],y=b.remove(C.itemId);if(!y){T++;continue}Pr()===y.ref&&(To(),Dr(b)||oe("inventory/show")),b.getTotalCount()<=0&&(S.splice(T,1),b.dispose());break}return S})}),W(qh,I=>{}),a.useEffect(()=>{!s||!s.length||o(I=>{let C=I;return C&&s.indexOf(C)===-1&&(C=null),C||(C=s[0]),C})},[s]),a.useEffect(()=>{if(l)return()=>{m(nt.FURNI)&&n(I=>{const C=[...I];for(const f of C)f.hasUnseenItems=!1;return C})}},[l,m]),a.useEffect(()=>{!l||!i||(B(new lf),e(!1))},[l,i]),{isVisible:l,groupItems:s,setGroupItems:n,selectedItem:r,setSelectedItem:o,activate:c,deactivate:u,getWallItemById:E,getFloorItemById:_,getItemsByType:p}},$n=()=>Qe(oM);let ei=null;const iM=()=>{const[i,e]=a.useState(!0),[s,n]=a.useState([]),[r,o]=a.useState(null),{isVisible:l=!1,activate:c=null,deactivate:u=null}=qi(),{isUnseen:h=null,resetCategory:m=null}=ws();return W(Yh,p=>{const E=p.getParser();ei||(ei=new Array(E.totalFragments));const _=Gy(E.fragment,E.totalFragments,E.fragmentNumber,ei);_&&(n(I=>{const C=[...I];return xy(C,_,h),C}),ei=null)}),W(Kh,p=>{const E=p.getParser();n(_=>{const I=[..._];return j_(E.pet,I,h(nt.PET,E.pet.id)),I})}),W(zh,p=>{const E=p.getParser();n(_=>{const I=[..._];return q_(E.petId,I),I})}),a.useEffect(()=>{!s||!s.length||o(p=>{let E=p;return E&&s.indexOf(E)===-1&&(E=null),E||(E=s[0]),E})},[s]),a.useEffect(()=>{if(l)return()=>{m(nt.PET)}},[l,m]),a.useEffect(()=>{!l||!i||(B(new qa),e(!1))},[l,i]),{petItems:s,selectedPet:r,setSelectedPet:o,activate:c,deactivate:u}},zE=()=>Qe(iM),aM=()=>{const[i,e]=a.useState(null),[s,n]=a.useState(null),[r,o]=a.useState(gt.TRADING_STATE_READY),{groupItems:l=[],setGroupItems:c=null,activate:u=null,deactivate:h=null}=$n(),{simpleAlert:m=null,showTradeAlert:p=null}=Ke(),E=r>=gt.TRADING_STATE_RUNNING,_=()=>{switch(r){case gt.TRADING_STATE_RUNNING:!s.itemCount&&!i.accepts&&m(g("inventory.trading.warning.other_not_offering"),null,null,null),i.accepts?B(new ff):B(new cf);return;case gt.TRADING_STATE_CONFIRMING:B(new hf),o(gt.TRADING_STATE_CONFIRMED);return}},I=f=>{const S=f.getLastItem();S&&B(new gf(S.id))},C=()=>{if(E)switch(r){case gt.TRADING_STATE_RUNNING:B(new df);return;default:B(new uf);return}};return W(Qh,f=>{const S=f.getParser();!i||!s||(i.userId===S.userID?e(T=>{const b=ts(T);return b.accepts=S.userAccepts,b}):s.userId===S.userID&&n(T=>{const b=ts(T);return b.accepts=S.userAccepts,b}))}),W(Xh,f=>{const S=f.getParser();S.reason===Aw.ERROR_WHILE_COMMIT?p(yt.ERROR_WHILE_COMMIT):i&&S.userID!==i.userId&&p(yt.THEY_CANCELLED),e(null),n(null),o(gt.TRADING_STATE_READY)}),W(Jh,f=>{f.getParser(),e(null),n(null),o(gt.TRADING_STATE_READY)}),W(Zh,f=>{f.getParser(),o(gt.TRADING_STATE_COUNTDOWN)}),W(em,f=>{const S=f.getParser(),T=Hc(S.firstUserItemArray),b=Hc(S.secondUserItemArray);e(y=>{const w=ts(y);w.userId===S.firstUserID?(w.creditsCount=S.firstUserNumCredits,w.itemCount=S.firstUserNumItems,w.userItems=T):(w.creditsCount=S.secondUserNumCredits,w.itemCount=S.secondUserNumItems,w.userItems=b);const O=[];for(const F of w.userItems.getValues()){let U=0;for(;U<F.getTotalCount();){const j=F.getItemByIndex(U);j&&O.push(j.ref),U++}}return c(F=>{const U=[...F];for(const j of U)j.lockItemIds(O);return U}),w}),n(y=>{const w=ts(y);return w.userId===S.firstUserID?(w.creditsCount=S.firstUserNumCredits,w.itemCount=S.firstUserNumItems,w.userItems=T):(w.creditsCount=S.secondUserNumCredits,w.itemCount=S.secondUserNumItems,w.userItems=b),w})}),W(tm,f=>{f.getParser()}),W(nm,f=>{const S=f.getParser(),T=new Gc,b=Pe().userDataManager.getUserData(S.userID);T.userItems=new po;const y=new Gc,w=Pe().userDataManager.getUserData(S.otherUserID);y.userItems=new po,b.webID===J().userId?(T.userId=b.webID,T.userName=b.name,T.canTrade=S.userCanTrade,y.userId=w.webID,y.userName=w.name,y.canTrade=S.otherUserCanTrade):w.webID===J().userId&&(T.userId=w.webID,T.userName=w.name,T.canTrade=S.otherUserCanTrade,y.userId=b.webID,y.userName=b.name,y.canTrade=S.userCanTrade),e(T),n(y),o(gt.TRADING_STATE_RUNNING)}),W(sm,f=>{const S=f.getParser();p(S.reason,S.otherUserName)}),W(rm,f=>{f.getParser(),p(yt.THEY_NOT_ALLOWED)}),W(om,f=>{f.getParser(),p(yt.YOU_NOT_ALLOWED)}),a.useEffect(()=>{if(r===gt.TRADING_STATE_READY)return;const f=u();return()=>h(f)},[r,u,h]),{ownUser:i,otherUser:s,tradeState:r,setTradeState:o,isTrading:E,groupItems:l,progressTrade:_,removeItem:I,stopTrading:C}},KE=()=>Qe(aM),lM=()=>{const[i,e]=a.useState([]),{setGroupItems:s,getFloorItemById:n}=$n(),r=a.useCallback(u=>{B(new kE(u))},[]),o=a.useMemo(()=>ee("recycler.limit")||3,[]),l=a.useCallback(u=>{e(h=>{let m=[...h],p=u.getItemByIndex(u.getUnlockedCount()-1);if(!p)return m;let E=p.id;return m.push(E),s(_=>{let I=[..._];return I.forEach((C,f)=>{C===u&&I[f].lockItemIds(m)}),I}),m.length>o?(r(m),[]):m}),oe("catalog/open/"+ee("catalog.links").recycler)},[r,o,s]),c=a.useCallback(u=>!i[u]||i[u]&&!n(i[u])?null:n(i[u]).iconUrl,[n,i]);return{recycleFurni:l,recycling:i,setRecycling:e,recyclerLimit:o,getIconFor:c,doRecycle:r}},$E=()=>Qe(lM),cM=1e3,uM=10,dM=1e3;let hM=0,mM=0;const gM=()=>{a.useState(!0);const[i,e]=a.useState([]),[s,n]=a.useState([]),[r,o]=a.useState([]),[l,c]=a.useState(!1),u=a.useCallback(p=>{p.id=hM++,e(E=>{const _=[...E];return _.push(p),_.length>cM&&_.shift(),_})},[e]),h=p=>{n(E=>{const _=[...E];return _.push(p),_.length>uM&&_.shift(),_})},m=a.useCallback(p=>{p.id=mM++,o(E=>{const _=[...E];return _.push(p),_.length>dM&&_.shift(),_})},[]);return W(gl,p=>{const E=p.getParser();m({id:-1,webId:E.senderId,entityId:-1,name:"",message:E.messageText,roomId:-1,timestamp:Vc(E.secondsSinceSent),type:an.TYPE_IM})}),W(pl,p=>{const E=p.getParser();m({id:-1,webId:E.senderId,entityId:-1,name:"",message:E.messageText,roomId:-1,timestamp:Vc(),type:an.TYPE_IM})}),$e(qt.STARTED,p=>c(!0)),W(cr,p=>{if(!l)return;const E=p.getParser();s.length&&s[s.length-1].id===E.data.roomId||(u({id:-1,webId:-1,entityId:-1,name:E.data.roomName,timestamp:Y_(),type:an.TYPE_ROOM_INFO,roomId:E.data.roomId}),h({id:E.data.roomId,name:E.data.roomName}),c(!1))}),{addChatEntry:u,chatHistory:i,roomHistory:s,messengerHistory:r}},oc=()=>Qe(gM),pM=()=>{const[i,e]=a.useState([]),[s,n]=a.useState([]),[r,o]=a.useState([]),[l,c]=a.useState([]),[u,h]=a.useState(null),[m,p]=a.useState(!1),E=a.useMemo(()=>{const O=i.filter(F=>F.online);return O.sort((F,U)=>F.name<U.name?-1:F.name>U.name?1:0),O},[i]),_=a.useMemo(()=>{const O=i.filter(F=>!F.online);return O.sort((F,U)=>F.name<U.name?-1:F.name>U.name?1:0),O},[i]),I=O=>B(new ki(O.id)),C=(O,F)=>F!==O.relationshipStatus&&B(new Sr(O.id,F)),f=O=>{for(const F of i)if(F.id===O)return F;return null},S=O=>!(O===J().userId||f(O)||s.find(F=>F.requesterUserId===O)||r.indexOf(O)>=0),T=(O,F)=>{if(!S(O))return!1;o(U=>{const j=[...U];return j.push(O),j}),B(new wl(F))},b=(O,F)=>{O===-1&&!F?(B(new Va(!0)),n([])):n(U=>{const j=[...U],x=j.findIndex(M=>M.id===O);return x===-1?U:(B(F?new mp(j[x].id):new Va(!1,j[x].id)),j.splice(x,1),j)})},y=O=>E.filter(F=>F.categoryId==O),w=O=>i.filter(F=>F.categoryId==O);return W(ph,O=>{const F=O.getParser();h(new tA(F.userFriendLimit,F.normalFriendLimit,F.extendedFriendLimit,F.categories)),B(new pp)}),W(dh,O=>{const F=O.getParser();e(U=>{const j=[...U];for(const x of F.fragment){const M=j.findIndex(H=>H.id===x.id),G=new Kt;G.populate(x),M>-1?j[M]=G:j.push(G)}return j})}),W(hh,O=>{const F=O.getParser();e(U=>{const j=[...U],x=M=>{const G=j.findIndex(H=>H.id===M.id);if(G===-1){const H=new Kt;H.populate(M),j.unshift(H)}else j[G].populate(M)};for(const M of F.addedFriends)x(M);for(const M of F.updatedFriends)x(M);for(const M of F.removedFriendIds){const G=j.findIndex(H=>H.id===M);G>-1&&j.splice(G,1)}return j})}),W(mh,O=>{const F=O.getParser();n(U=>{const j=[...U];for(const x of F.requests){const M=j.findIndex(G=>G.requesterUserId===x.requesterUserId);if(M>0)j[M]=ts(j[M]),j[M].populate(x);else{const G=new Wc;G.populate(x),j.push(G)}}return j})}),W(fh,O=>{const U=O.getParser().request;n(j=>{const x=[...j];if(x.findIndex(G=>G.requesterUserId===U.requesterUserId)===-1){const G=new Wc;G.populate(U),x.push(G)}return x})}),a.useEffect(()=>{B(new _p);const O=setInterval(()=>B(new gp),12e4);return()=>{clearInterval(O)}},[]),{friends:i,requests:s,sentRequests:r,dismissedRequestIds:l,setDismissedRequestIds:c,settings:u,onlineFriends:E,offlineFriends:_,getFriend:f,canRequestFriend:S,requestFriend:T,requestResponse:b,followFriend:I,updateRelationship:C,getFriendsForCategory:y,getAllFriendsForCategory:w,setFriendManagerVisible:p,friendManagerVisible:m}},ns=()=>Qe(pM),fM=()=>{const[i,e]=a.useState([]),[s,n]=a.useState(-1),[r,o]=a.useState([]),[l,c]=a.useState(Js.HIDDEN),{getFriend:u=null}=ns(),{simpleAlert:h=null}=Ke(),m=a.useMemo(()=>i.filter(C=>r.indexOf(C.threadId)===-1),[i,r]),p=a.useMemo(()=>s>0&&m.find(C=>C.threadId===s||null),[s,m]),E=C=>{let f=i.find(S=>S.participant&&S.participant.id===C);if(f){const S=r.indexOf(f.threadId);S>=0&&o(T=>{const b=[...T];return b.splice(S,1),b})}else{const S=u(C);if(!S)return null;f=new $l(S),m.length||f.addMessage(null,g("messenger.moderationinfo"),0,null,Ps.SECURITY_NOTIFICATION),f.setRead(),e(T=>{const b=[...T];return b.push(f),b})}return f},_=C=>{o(f=>{const S=[...f];return S.indexOf(C)>=0?f:(S.push(C),S)}),s===C&&n(-1)},I=(C,f,S,T=0,b=null,y=Ps.CHAT)=>{if(!C||!S||!S.length)return;const w=f===J().userId;w&&S.length<=255&&B(new Ip(C.participant.id,S)),e(O=>{const F=[...O],U=F.findIndex(j=>j.threadId===C.threadId);return U===-1?O:(C=ts(F[U]),w&&C.groups.length===1&&Fs(cs.MESSENGER_NEW_THREAD),C.addMessage(y===Ps.ROOM_INVITE?null:f,S,T,b,y),s===C.threadId&&C.setRead(),F[U]=C,!w&&C.unread&&Fs(cs.MESSENGER_MESSAGE_RECEIVED),F)})};return W(gl,C=>{const f=C.getParser(),S=E(f.senderId);S&&I(S,f.senderId,f.messageText,f.secondsSinceSent,f.extraData)}),W(pl,C=>{const f=C.getParser(),S=E(f.senderId);S&&I(S,f.senderId,f.messageText,0,null,Ps.ROOM_INVITE)}),W(_h,C=>{const f=C.getParser();h(`Received room invite error: ${f.errorCode},recipients: ${f.failedRecipients}`,fe.DEFAULT,null,null,g("friendlist.alert.title"))}),a.useEffect(()=>{s<=0||e(C=>{const f=[...C],S=f.findIndex(T=>T.threadId===s);return S>=0&&(f[S]=ts(f[S]),f[S].setRead()),f})},[s]),a.useEffect(()=>{c(C=>{if(!m.length)return Js.HIDDEN;let f=!1;for(const S of m)if(S.unreadCount>0){f=!0;break}return f?Js.UNREAD:Js.SHOW})},[m]),{messageThreads:i,activeThread:p,iconState:l,visibleThreads:m,getMessageThread:E,setActiveThreadId:n,closeThread:_,sendMessage:I}},QE=()=>Qe(fM),_M=()=>{const[i,e]=a.useState(!1),[s,n]=a.useState(null),[r,o]=a.useState(null),[l,c]=a.useState(null),[u,h]=a.useState(!1),[m,p]=a.useState(null),[E,_]=a.useState(!1),[I,C]=a.useState(null),[f,S]=a.useState(null),[T,b]=a.useState(-1),[y,w]=a.useState(),O=F=>s.filter(U=>U.gameId==F)[0]||null;return W(Lg,F=>{let U=F.getParser();!U||U&&!U.games.length||(o(U.games[0]),n(U.games))}),W(Dg,F=>{let U=F.getParser();U&&c(U)}),W(Pg,F=>{let U=F.getParser();U&&h(U.isInMaintenance)}),W(Ug,F=>{e(!0),_(!1),b(-1),S(null)}),W(Ha,F=>{let U=F.getParser();if(U)switch(_(!0),S(O(parseInt(U.gameClientId))),b(6),w(O(parseInt(U.gameClientId))),U.gameTypeId){case 0:return null;default:return p(U.url)}}),$e(qt.CREATED,F=>e(!1)),$e(qt.ENDED,F=>E??e(!0)),W(Fg,F=>{let U=F.getParser();U&&C(O(U.gameTypeId))}),W(xg,F=>{F.getParser()&&C(null)}),a.useEffect(()=>{i?(B(new C_),jl()):C(null)},[i]),W(OE,F=>{let U=F.getParser();U&&(U.roomExit?X().events.dispatchEvent(new Sc(Sc.PLAY_SAMPLE,-1,-(Math.random()*99999),-(Math.random()*99999),U.soundId,0)):Fs(U.soundString))}),{isVisible:i,setIsVisible:e,games:s,accountStatus:l,selectedGame:r,setSelectedGame:o,gameOffline:u,gameURL:m,setGameURL:p,queuedGame:I,setQueuedGame:C,inGame:E,currentGame:f,stageStep:T,setStageStep:b,lastGame:y}},ys=()=>Qe(_M),EM=()=>{const[i,e]=a.useState(null);return W(Sh,s=>{const n=s.getParser(),r={badgeBases:[],badgeSymbols:[],badgePartColors:[],groupColorsA:[],groupColorsB:[]};n.bases.forEach((l,c)=>r.badgeBases.push({id:c,images:l})),n.symbols.forEach((l,c)=>r.badgeSymbols.push({id:c,images:l})),n.partColors.forEach((l,c)=>r.badgePartColors.push({id:c,color:l})),n.colorsA.forEach((l,c)=>r.groupColorsA.push({id:c,color:l})),n.colorsB.forEach((l,c)=>r.groupColorsB.push({id:c,color:l}));const o=(l,c)=>l.id<c.id?-1:l.id>c.id?1:0;r.badgeBases.sort(o),r.badgeSymbols.sort(o),r.badgePartColors.sort(o),r.groupColorsA.sort(o),r.groupColorsB.sort(o),e(r)}),a.useEffect(()=>{B(new jp)},[]),{groupCustomize:i}},xo=()=>Qe(EM),IM=()=>{const[i,e]=a.useState(null),[s,n]=a.useState(null),{simpleAlert:r=null,showConfirm:o=null}=Ke(),l=(c,u)=>{const h={reportType:c,reportedUserId:-1,reportedChats:[],cfhCategory:-1,cfhTopic:-1,roomId:-1,roomName:"",messageId:-1,threadId:-1,groupId:-1,extraData:"",roomObjectId:-1,message:"",currentStep:0};switch(c){case rt.BULLY:case rt.EMERGENCY:case rt.IM:h.reportedUserId=u.reportedUserId,h.currentStep=Wt.SELECT_CHATS;break;case rt.ROOM:h.roomId=u.roomId,h.roomName=u.roomName,h.currentStep=Wt.SELECT_TOPICS;break;case rt.THREAD:h.groupId=u.groupId,h.threadId=u.threadId,h.currentStep=Wt.SELECT_TOPICS;break;case rt.MESSAGE:h.groupId=u.groupId,h.threadId=u.threadId,h.messageId=u.messageId,h.currentStep=Wt.SELECT_TOPICS;break}e(h)};return W(yh,c=>{const u=c.getParser();let h=u.messageText;switch(u.resultType){case Ti.TOO_MANY_PENDING_CALLS_CODE:B(new Op),r(g("help.cfh.error.pending"),fe.MODERATION,null,null,g("help.cfh.error.title"));break;case Ti.HAS_ABUSIVE_CALL_CODE:r(g("help.cfh.error.abusive"),fe.MODERATION,null,null,g("help.cfh.error.title"));break;default:h.trim().length===0&&(h=g("help.cfh.sent.text")),r(h,fe.MODERATION,null,null,g("help.cfh.sent.title"))}}),W(Gh,c=>{const u=c.getParser(),h=u.messageText.length===0?g("help.cfh.closed."+lA(u.closeReason)):u.messageText;r(h,fe.MODERATION,null,null,g("mod.alert.title"))}),W(Oh,c=>{const u=c.getParser();u.count>0&&o(g("help.emergency.pending.title")+`
  9036. `+u.pendingCalls[0].message,()=>{B(new bp)},null,g("help.emergency.pending.button.discard"),g("help.emergency.pending.button.keep"),g("help.emergency.pending.message.subtitle"))}),W(bh,c=>{r("Your pending calls were deleted",fe.MODERATION,null,null,g("mod.alert.title"))}),W(wh,c=>{const u=c.getParser();r(u.message,fe.MODERATION,null,null,g("help.cfh.reply.title"))}),W(vh,c=>{const u=c.getParser();r(g("help.emergency.global_mute.message"),fe.MODERATION,u.infoUrl,g("help.emergency.global_mute.link"),g("help.emergency.global_mute.subtitle"))}),W(xd,c=>{const u=c.getParser();n(u)}),{activeReport:i,setActiveReport:e,sanctionInfo:s,setSanctionInfo:n,report:l}},un=()=>Qe(IM),CM=()=>{const[i,e]=a.useState(null),[s,n]=a.useState([]),[r,o]=a.useState([]),[l,c]=a.useState([]),[u,h]=a.useState([]),[m,p]=a.useState([]),[E,_]=a.useState([]),{simpleAlert:I=null}=Ke(),C=G=>{s.indexOf(G)>=0||n(H=>[...H,G])},f=G=>{n(H=>{const Y=[...H],q=Y.indexOf(G);return q>=0&&Y.splice(q),Y})},S=G=>{s.indexOf(G)>=0?f(G):C(G)},T=G=>{r.indexOf(G)>=0||o(H=>[...H,G])},b=G=>{o(H=>{const Y=[...H],q=Y.indexOf(G);return q>=0&&Y.splice(q),Y})},y=G=>{r.indexOf(G)>=0?b(G):T(G)},w=G=>{l.indexOf(G)>=0||c(H=>[...H,G])},O=G=>{c(H=>{const Y=[...H],q=Y.indexOf(G);return q>=0&&Y.splice(q),Y})},F=G=>{l.indexOf(G)>=0?O(G):w(G)},U=G=>{u.indexOf(G)>=0||h(H=>[...H,G])},j=G=>{h(H=>{const Y=[...H],q=Y.indexOf(G);return q>=0&&Y.splice(q),Y})},x=G=>{r.indexOf(G)>=0?j(G):U(G)},M=m.filter(G=>G.state===Xa.STATE_OPEN);return W(Im,G=>{const Y=G.getParser().data;e(Y),p(Y.issues)}),W(Nm,G=>{const H=G.getParser();p(Y=>{const q=[...Y],Z=q.findIndex(ce=>ce.issueId===H.issueData.issueId);return Z>=0?q[Z]=H.issueData:(q.push(H.issueData),Fs(cs.MODTOOLS_NEW_TICKET)),q})}),W(Om,G=>{G.getParser()}),W(Rm,G=>{G.getParser()&&I("Failed to pick issue",fe.DEFAULT,null,null,"Error")}),W(Tm,G=>{const H=G.getParser();p(Y=>{const q=[...Y],Z=q.findIndex(ce=>ce.issueId===H.issueId);return Z>=0&&q.splice(Z,1),q})}),W(vm,G=>{G.getParser().success?I("Moderation action was successfull",fe.MODERATION,null,null,"Success"):I("There was a problem applying tht moderation action",fe.MODERATION,null,null,"Error")}),W(Fd,G=>{const H=G.getParser();_(H.callForHelpCategories)}),W(Dd,G=>{G.getParser()}),{settings:i,openRooms:s,openRoomChatlogs:r,openUserChatlogs:u,openUserInfos:l,cfhCategories:E,tickets:m,openRoomInfo:C,closeRoomInfo:f,toggleRoomInfo:S,openRoomChatlog:T,closeRoomChatlog:b,toggleRoomChatlog:y,openUserInfo:w,closeUserInfo:O,toggleUserInfo:F,openUserChatlog:U,closeUserChatlog:j,toggleUserChatlog:x,openIssues:M}},Kr=()=>Qe(CM),SM=()=>{const[i,e]=a.useState(null),[s,n]=a.useState(null),[r,o]=a.useState(null),[l,c]=a.useState(null),[u,h]=a.useState({roomInfo:null,state:We.NONE}),[m,p]=a.useState(null),[E,_]=a.useState({settingsReceived:!1,homeRoomId:0,enteredGuestRoom:null,currentRoomOwner:!1,currentRoomId:0,currentRoomIsStaffPick:!1,createdFlatId:0,avatarId:0,roomPicker:!1,eventMod:!1,currentRoomRating:0,canRate:!0}),{simpleAlert:I=null}=Ke();return W(Um,C=>{const f=C.getParser();B(new fo(f.roomId,!1,!1))}),W(wm,C=>{const f=C.getParser();f.canCreate||I(g(`navigator.cannotcreateevent.error.${f.errorCode}`),null,null,null,g("navigator.cannotcreateevent.title"))}),W(Nl,C=>{B(new Zp),B(new Al)}),W(Sg,C=>{const f=C.getParser();_(S=>{const T={...S};return T.eventMod=f.securityLevel>=Ja.MODERATOR,T.roomPicker=f.securityLevel>=Ja.COMMUNITY,T})}),W(Km,C=>{const f=C.getParser();Rs(f.roomId)}),W(Tl,C=>{const f=C.getParser();_(S=>{const T={...S};return T.enteredGuestRoom=null,T.currentRoomOwner=f.isOwner,T.currentRoomId=f.roomId,T}),B(new fo(f.roomId,!0,!1)),_o.available&&_o.call("legacyTrack","navigator","private",[f.roomId])}),W(cr,C=>{const f=C.getParser();if(f.roomEnter)h({roomInfo:null,state:We.NONE}),_(S=>{const T={...S};return T.enteredGuestRoom=f.data,T.currentRoomIsStaffPick=f.staffPick,!(T.createdFlatId===f.data.roomId)&&f.data.displayRoomEntryAd&&ee("roomenterad.habblet.enabled",!1)&&bo.openRoomEnterAd(),T.createdFlatId=0,T.enteredGuestRoom&&T.enteredGuestRoom.habboGroupId>0,T});else if(f.roomForward){if(f.data.ownerName!==J().userName&&!f.isGroupMember)switch(f.data.doorMode){case pt.DOORBELL_STATE:h(S=>{const T={...S};return T.roomInfo=f.data,T.state=We.START_DOORBELL,T});return;case pt.PASSWORD_STATE:h(S=>{const T={...S};return T.roomInfo=f.data,T.state=We.START_PASSWORD,T});return}if(f.data.doorMode===pt.NOOB_STATE&&!J().isAmbassador&&!J().isRealNoob&&!J().isModerator)return;rr(f.data.roomId)}else _(S=>{const T={...S};return T.enteredGuestRoom=f.data,T.currentRoomIsStaffPick=f.staffPick,T})}),W(Jm,C=>{const f=C.getParser();_(S=>{const T={...S};return T.currentRoomRating=f.totalLikes,T.canRate=f.canLike,T})}),W(ym,C=>{const f=C.getParser();(!f.userName||f.userName.length===0)&&h(S=>{const T={...S};return T.state=We.STATE_WAITING,T})}),W($m,C=>{const f=C.getParser();(!f.userName||f.userName.length===0)&&h(S=>{const T={...S};return T.state=We.STATE_ACCEPTED,T})}),W(Am,C=>{const f=C.getParser();(!f.userName||f.userName.length===0)&&h(S=>{const T={...S};return T.state=We.STATE_NO_ANSWER,T})}),W(Ag,C=>{switch(C.getParser().errorCode){case-100002:h(S=>{const T={...S};return T.state=We.STATE_WRONG_PASSWORD,T});return;case 4009:I(g("navigator.alert.need.to.be.vip"),fe.DEFAULT,null,null,g("generic.alert.title"));return;case 4010:I(g("navigator.alert.invalid_room_name"),fe.DEFAULT,null,null,g("generic.alert.title"));return;case 4011:I(g("navigator.alert.cannot_perm_ban"),fe.DEFAULT,null,null,g("generic.alert.title"));return;case 4013:I(g("navigator.alert.room_in_maintenance"),fe.DEFAULT,null,null,g("generic.alert.title"));return}}),W(Pm,C=>{const f=C.getParser();c(f.topLevelContexts),o(f.topLevelContexts.length?f.topLevelContexts[0]:null)}),W(Fm,C=>{const f=C.getParser();o(S=>{let T=S;if(T||(T=l&&l.length&&l[0]||null),!T)return null;if(f.result.code!==T.code&&l&&l.length)for(const b of l)b.code===f.result.code&&(T=b);for(const b of l)b.code===f.result.code&&(T=b);return T}),p(f.result)}),W(Lm,C=>{const f=C.getParser();e(f.categories)}),W(Il,C=>{const f=C.getParser();n(f.categories)}),W(km,C=>{const f=C.getParser();rr(f.roomId)}),W(Mm,C=>{const f=C.getParser();let S=!1;if(_(y=>{S=y.settingsReceived;const w={...y};return w.homeRoomId=f.homeRoomId,w.settingsReceived=!0,w}),S)return;let T=-1,b=-1;ee("friend.id")!==void 0&&parseInt(ee("friend.id"))>0&&(T=0,B(new ki(parseInt(ee("friend.id"))))),ee("forward.type")!==void 0&&ee("forward.id")!==void 0&&(T=parseInt(ee("forward.type")),b=parseInt(ee("forward.id"))),T===2?Rs(b):T===-1&&f.roomIdToEnter>0&&(oe("navigator/close"),f.roomIdToEnter!==f.homeRoomId?rr(f.roomIdToEnter):rr(f.homeRoomId))}),W(Ym,C=>{const f=C.getParser();switch(f.reason){case na.REASON_FULL:I(g("navigator.guestroomfull.text"),fe.DEFAULT,null,null,g("navigator.guestroomfull.title"));break;case na.REASON_QUEUE_ERROR:I(g(`room.queue.error.${f.parameter}`),fe.DEFAULT,null,null,g("room.queue.error.title"));break;case na.REASON_BANNED:I(g("navigator.banned.text"),fe.DEFAULT,null,null,g("navigator.banned.title"));break;default:I(g("room.queue.error.title"),fe.DEFAULT,null,null,g("room.queue.error.title"));break}jl()}),W(Dm,C=>{oe("navigator/create")}),{categories:i,doorData:u,setDoorData:h,topLevelContext:r,topLevelContexts:l,searchResult:m,navigatorData:E}},Bs=()=>Qe(SM),TM=()=>{const[i,e]=a.useState(new Xl),s=a.useMemo(()=>ee("hc.disabled",!1),[]),n=a.useMemo(()=>s||i.clubDays>0?Ks.ACTIVE:i.pastVipDays>0||i.pastVipDays>0?Ks.EXPIRED:Ks.NONE,[i,s]),r=o=>{if(o===-1)return i.credits;for(const[l,c]of i.activityPoints.entries())if(l===o)return c;return 0};return W(vg,o=>{const l=o.getParser();e(c=>{const u=ts(c);return u.credits=parseFloat(l.credits),c.credits&&u.credits&&Fs(cs.CREDITS),u})}),W(bg,o=>{const l=o.getParser();e(c=>{const u=ts(c);return u.activityPoints=l.currencies,u})}),W(Cl,o=>{const l=o.getParser();e(c=>{const u=ts(c);return u.activityPoints=new Map(u.activityPoints),u.activityPoints.set(l.type,l.amount),l.type===0&&Fs(cs.DUCKETS),u})}),W(Og,o=>{const l=o.getParser(),c=l.productName;c!=="club_habbo"&&c!=="habbo_club"||e(u=>{const h=ts(u);return h.clubDays=Math.max(0,l.daysToPeriodEnd),h.clubPeriods=Math.max(0,l.periodsSubscribedAhead),h.isVip=l.isVip,h.pastClubDays=l.pastClubDays,h.pastVipDays=l.pastVipDays,h.isExpiring=l.responseType===kw.RESPONSE_TYPE_DISCOUNT_AVAILABLE,h.minutesUntilExpiration=l.minutesUntilExpiration,h.minutesSinceLastModified=l.minutesSinceLastModified,h})}),a.useEffect(()=>{if(s)return;B(new Ka("habbo_club"));const o=setInterval(()=>B(new Ka("habbo_club")),5e4);return()=>clearInterval(o)},[s]),a.useEffect(()=>{B(new e_)},[]),{purse:i,hcDisabled:s,clubStatus:n,getCurrencyAmount:r}},An=()=>Qe(TM),NM=(i,e)=>{a.useEffect(()=>{if(!i)return;const s=n=>e(n);return cn.addEventListener(Ge.FURNI_ADDED,s),()=>{cn.removeEventListener(Ge.FURNI_ADDED,s)}},[i,e])},Hs=(i,e)=>{a.useEffect(()=>{if(!i)return;const s=n=>e(n);return cn.addEventListener(Ge.FURNI_REMOVED,s),()=>{cn.removeEventListener(Ge.FURNI_REMOVED,s)}},[i,e])},XE=i=>{ct(Ge.OBJECT_DESELECTED,i)},RM=i=>{ct(Ge.OBJECT_ROLL_OUT,i)},vM=i=>{ct(Ge.OBJECT_ROLL_OVER,i)},ic=i=>{ct(Ge.OBJECT_SELECTED,i)},JE=(i,e)=>{a.useEffect(()=>{if(!i)return;const s=n=>e(n);return cn.addEventListener(Ge.USER_ADDED,s),()=>{cn.removeEventListener(Ge.USER_ADDED,s)}},[i,e])},ZE=(i,e)=>{a.useEffect(()=>{if(!i)return;const s=n=>e(n);return cn.addEventListener(Ge.USER_REMOVED,s),()=>{cn.removeEventListener(Ge.USER_REMOVED,s)}},[i,e])},bM=()=>{const[i,e]=a.useState(null),[s,n]=a.useState(null),[r,o]=a.useState(null),[l,c]=a.useState(0),u=(m,p,E,_=!1)=>{if(!s)return;const I=Qs.hslToRGB(((m&255)<<16)+((p&255)<<8)+(E&255));_&&c(I),!m&&!p&&!E?s.tint=0:s.tint=I},h=m=>{if(!r)return;const p=m>>16&255,E=m>>8&255,_=m&255;r.red=p/255,r.green=E/255,r.blue=_/255};return ct(Gn.PREVIEW,m=>u(m.hue,m.saturation,m.lightness)),ct(Gn.CLEAR_PREVIEW,m=>{s&&(s.tint=l)}),ke(Mw.ROOM_BACKGROUND_COLOR,m=>{Tr.isRoomPreviewerId(m.roomId)||(m.enable?u(m.hue,m.saturation,m.lightness,!0):u(0,0,0,!0))}),ke(Uw.ROOM_COLOR,m=>{if(Tr.isRoomPreviewerId(m.roomId))return;let p=0,E=255;m.bgOnly||(p=m.color,E=m.brightness),h(Qs.hslToRGB((Qs.rgbToHSL(p)&16776960)+E))}),ke([Jt.INITIALIZED,Jt.DISPOSED],m=>{if(Tr.isRoomPreviewerId(m.roomId))return;const p=Pe();if(p)switch(m.type){case Jt.INITIALIZED:Lc(m.roomId),e(p);return;case Jt.DISPOSED:e(null);return}}),$e([qt.CREATED,qt.ENDED],m=>{switch(m.type){case qt.CREATED:by(m.session);return;case qt.ENDED:e(null);return}}),ke([bt.SELECTED,bt.DESELECTED,bt.ADDED,bt.REMOVED,bt.PLACED,bt.REQUEST_MOVE,bt.REQUEST_ROTATE,bt.MOUSE_ENTER,bt.MOUSE_LEAVE,bt.DOUBLE_CLICK],m=>{if(Tr.isRoomPreviewerId(m.roomId))return;let p=null;switch(m.type){case bt.SELECTED:wy(m)||(p=new Ge(Ge.OBJECT_SELECTED,m.objectId,m.category,m.roomId));break;case bt.DESELECTED:p=new Ge(Ge.OBJECT_DESELECTED,m.objectId,m.category,m.roomId);break;case bt.ADDED:{let E=null;switch(m.category){case re.FLOOR:case re.WALL:E=Ge.FURNI_ADDED;break;case re.UNIT:E=Ge.USER_ADDED;break}E&&(p=new Ge(E,m.objectId,m.category,m.roomId));break}case bt.REMOVED:{let E=null;switch(m.category){case re.FLOOR:case re.WALL:E=Ge.FURNI_REMOVED;break;case re.UNIT:E=Ge.USER_REMOVED;break}E&&(p=new Ge(E,m.objectId,m.category,m.roomId));break}case bt.REQUEST_MOVE:Eo(i,m.objectId,m.category)&&Rr(m.objectId,m.category,zs.OBJECT_MOVE);break;case bt.REQUEST_ROTATE:Eo(i,m.objectId,m.category)&&Rr(m.objectId,m.category,zs.OBJECT_ROTATE_POSITIVE);break;case bt.MOUSE_ENTER:p=new Ge(Ge.OBJECT_ROLL_OVER,m.objectId,m.category,m.roomId);break;case bt.MOUSE_LEAVE:p=new Ge(Ge.OBJECT_ROLL_OUT,m.objectId,m.category,m.roomId);break;case bt.DOUBLE_CLICK:p=new Ge(Ge.OBJECT_DOUBLE_CLICKED,m.objectId,m.category,m.roomId);break}p&&At(p)}),a.useEffect(()=>{if(!i)return;const m=_e(),p=X(),E=i.roomId,_=1,I=Math.floor(window.innerWidth),C=Math.floor(window.innerHeight),f=m.application.renderer;f&&(f.view.style.width=`${I}px`,f.view.style.height=`${C}px`,f.resolution=window.devicePixelRatio,f.resize(I,C));const S=p.getRoomInstanceDisplay(E,_,I,C,Lw.SCALE_ZOOMED_IN),T=X().getRoomInstanceRenderingCanvas(E,_);if(!S||!T)return;const b=new pi(Pw.WHITE),y=new Dw,w=T.master;b.tint=0,b.width=I,b.height=C,w.addChildAt(b,0),w.filters=[y],n(b),o(y);const O=p.getRoomInstanceGeometry(E,_);if(O){const j=p.getRoomInstanceVariable(E,Ho.ROOM_MIN_X)||0,x=p.getRoomInstanceVariable(E,Ho.ROOM_MAX_X)||0,M=p.getRoomInstanceVariable(E,Ho.ROOM_MIN_Y)||0,G=p.getRoomInstanceVariable(E,Ho.ROOM_MAX_Y)||0;let H=(j+x)/2,Y=(M+G)/2;const q=20;H=H+(q-1),Y=Y+(q-1);const Z=Math.sqrt(q*q+q*q)*Math.tan(30/180*Math.PI);O.location=new Lt(H,Y,Z)}const F=m.application.stage;if(!F)return;F.addChild(S),Lc(i.roomId);const U=j=>{const x=Math.floor(window.innerWidth),M=Math.floor(window.innerHeight);f.view.style.width=`${x}px`,f.view.style.height=`${M}px`,f.resolution=window.devicePixelRatio,f.resize(x,M),b.width=x,b.height=M,Oy(x,M,1),m.application.render()};return window.addEventListener("resize",U),()=>{n(null),o(null),c(0),window.removeEventListener("resize",U)}},[i]),{roomSession:i}},Xe=()=>Qe(bM),OM=()=>{const[i,e]=a.useState(-1),[s,n]=a.useState(-1),[r,o]=a.useState(0),[l,c]=a.useState(0),[u,h]=a.useState(0),{roomSession:m=null}=Xe(),p=()=>B(new Af(i,r,l,u)),E=()=>m.useMultistateItem(i),_=()=>{At(new Gn(Gn.CLEAR_PREVIEW)),e(-1),n(-1),o(0),c(0),h(0)};return ke(je.REQUEST_BACKGROUND_COLOR,I=>{if(!Eo(m,I.objectId,I.category))return;const f=X().getRoomObject(I.roomId,I.objectId,I.category).model;e(I.objectId),n(I.category),o(parseInt(f.getValue(ue.FURNITURE_ROOM_BACKGROUND_COLOR_HUE))),c(parseInt(f.getValue(ue.FURNITURE_ROOM_BACKGROUND_COLOR_SATURATION))),h(parseInt(f.getValue(ue.FURNITURE_ROOM_BACKGROUND_COLOR_LIGHTNESS)))}),Hs(i!==-1&&s!==-1,I=>{I.id!==i||I.category!==s||_()}),a.useEffect(()=>{i===-1||s===-1||At(new Gn(Gn.PREVIEW,r,l,u))},[i,s,r,l,u]),{objectId:i,hue:r,setHue:o,saturation:l,setSaturation:c,lightness:u,setLightness:h,applyToner:p,toggleToner:E,onClose:_}},wM=OM,yM=()=>{const[i,e]=a.useState(-1),[s,n]=a.useState(-1),[r,o]=a.useState("1"),[l,c]=a.useState(""),[u,h]=a.useState(""),[m,p]=a.useState(""),[E,_]=a.useState(""),{simpleAlert:I=null}=Ke(),C=()=>{e(-1),n(-1),o("1"),c(""),h(""),p(""),_("")};return ke([je.REQUEST_BADGE_DISPLAY_ENGRAVING,je.REQUEST_ACHIEVEMENT_RESOLUTION_ENGRAVING],f=>{const S=X().getRoomObject(f.roomId,f.objectId,f.category);if(!S)return;const T=new Oo;T.initializeFromRoomObjectModel(S.model),e(f.objectId),n(f.category),o("1"),c(yo(T.getValue(1))),h(Yl(T.getValue(1))),p(T.getValue(2)),_(T.getValue(3))}),ke(je.REQUEST_ACHIEVEMENT_RESOLUTION_FAILED,f=>{const S=X().getRoomObject(f.roomId,f.objectId,f.category);!S||S.model.getValue(ue.FURNITURE_OWNER_ID)!==J().userId||I(`${g("resolution.failed.subtitle")} ${g("resolution.failed.text")}`,null,null,null,g("resolution.failed.title"))}),Hs(i!==-1&&s!==-1,f=>{f.id!==i||f.category!==s||C()}),{objectId:i,category:s,color:r,badgeName:l,badgeDesc:u,date:m,senderName:E,onClose:C}},AM=yM,lu="MONSTERPLANT_SEED_CONFIRMATION",cu="PURCHASABLE_CLOTHING_CONFIRMATION",kM="GROUP_FURNITURE",MM="EFFECTBOX_OPEN",UM=()=>{const[i,e]=a.useState(-1),[s,n]=a.useState(null),[r,o]=a.useState(null),[l,c]=a.useState(-1),[u,h]=a.useState(null),[m,p]=a.useState(!1),{roomSession:E=null}=Xe(),_=()=>{e(-1),h(null),p(!1),n(null)},I=()=>{o(null),c(-1)},C=f=>{if(f)switch(f){case"use_friend_furni":E.useMultistateItem(i);break;case"use_monsterplant_seed":o(lu),c(i);break;case"use_random_teleport":X().useRoomObject(i,re.FLOOR);break;case"use_purchaseable_clothing":o(cu),c(i);break;case"join_group":Ql(u.guildId),p(!0);return;case"go_to_group_homeroom":u&&Rs(u.guildHomeRoomId);break}_()};return ke([je.OPEN_FURNI_CONTEXT_MENU,je.CLOSE_FURNI_CONTEXT_MENU,je.REQUEST_MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG,je.REQUEST_PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG,je.REQUEST_EFFECTBOX_OPEN_DIALOG],f=>{const S=X().getRoomObject(E.roomId,f.objectId,f.category);if(S)switch(f.type){case je.REQUEST_MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG:if(!as(S))return;c(S.id),o(lu),_();return;case je.REQUEST_EFFECTBOX_OPEN_DIALOG:if(!as(S))return;c(S.id),o(MM),_();return;case je.REQUEST_PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG:if(!as(S))return;c(S.id),o(cu),_();return;case je.OPEN_FURNI_CONTEXT_MENU:switch(e(S.id),f.contextMenu){case Cs.FRIEND_FURNITURE:n(Cs.FRIEND_FURNITURE);return;case Cs.MONSTERPLANT_SEED:as(S)&&n(Cs.MONSTERPLANT_SEED);return;case Cs.MYSTERY_BOX:return;case Cs.RANDOM_TELEPORT:n(Cs.RANDOM_TELEPORT);return;case Cs.PURCHASABLE_CLOTHING:as(S)&&n(Cs.PURCHASABLE_CLOTHING);return}return;case je.CLOSE_FURNI_CONTEXT_MENU:S.id===i&&_();return}}),W(ng,f=>{const S=f.getParser();e(S.objectId),h(S),p(S.userIsMember),n(kM)}),{objectId:i,mode:s,confirmMode:r,confirmingObjectId:l,groupData:u,isGroupMember:m,closeConfirm:I,processAction:C,onClose:_}},LM=UM,PM=()=>{const[i,e]=a.useState(-1),[s,n]=a.useState([]),[r,o]=a.useState(null),[l,c]=a.useState([]),[u,h]=a.useState(null),[m,p]=a.useState(new Map),[E,_]=a.useState(!1),{groupItems:I=[],getItemsByType:C=null,activate:f=null,deactivate:S=null}=$n(),{simpleAlert:T=null}=Ke(),b=r&&m.get(r.name)||null,y=()=>{n([]),o(null),c([]),p(new Map)},w=()=>{e(-1),y()},O=()=>{_(!0),B(new cp(i,r.name))},F=U=>{o(U),m.get(U.name)||B(new up(U.name))};return ke(je.OPEN_WIDGET,U=>{U.widget===Fw.CRAFTING&&(e(U.objectId),y(),B(new dp(U.objectId)))}),W(ih,U=>{const j=U.getParser();if(!j.isActive()){e(-1);return}n(x=>{const M=[];for(const G of j.recipes){const H=X().roomContentLoader._activeObjectTypeIds.get(G.itemName),Y=X().getFurnitureFloorIconUrl(H);M.push({name:G.recipeName,localizedName:g("roomItem.name."+H),iconUrl:Y})}return M}),h(j.ingredients)}),W(ah,U=>{const j=U.getParser();p(x=>{const M=new Map(x);return M.set(r.name,j.ingredients),M})}),W(ch,U=>{o(null),_(!1),U.getParser().result&&T(g("crafting.info.result.ok"))}),W(lh,U=>{}),a.useEffect(()=>{!u||!u.length||c(U=>{const j=[];for(const x of u){const M=X().roomContentLoader._activeObjectTypeIds.get(x),G=X().getFurnitureFloorIconUrl(M),H=C(M);let Y=0;if(H)for(const q of H)Y+=q.items.length;j.push({name:x,iconUrl:G,count:Y})}return j})},[I,u,C]),a.useEffect(()=>{if(i===-1)return;const U=f();return()=>S(U)},[i,f,S]),{objectId:i,recipes:s,ingredients:l,selectedRecipe:r,requiredIngredients:b,isCrafting:E,selectRecipe:F,craft:O,onClose:w}},DM=PM,FM=()=>{const[i,e]=a.useState([]),[s,n]=a.useState(0),[r,o]=a.useState(0),[l,c]=a.useState(0),[u,h]=a.useState(0),[m,p]=a.useState(16777215),[E,_]=a.useState(255),[I,C]=a.useState(0),[f,S]=a.useState(0),[T,b]=a.useState(0),{roomSession:y=null}=Xe(),w=()=>y.isRoomOwner||y.controllerLevel>=_t.GUEST||J().isModerator,O=U=>{const j=i[U-1];j&&(n(j.id),C(j.type),S(j.color),b(j.light))},F=()=>{if(r===0)return;const U=s-1;if(s<1||s>i.length)return;const j=i[U];!j||I===j.type&&f===j.color&&T===j.light||(e(x=>{const M=[...x];return M[U]=new zc(j.id,I,f,T),M}),Ts.savePreset(j.id,I,f,T,!0))};return ke(je.REQUEST_DIMMER,U=>{w()&&y.requestMoodlightSettings()}),$e(xw.ROOM_DIMMER_PRESETS,U=>{const j=[];let x=0;for(;x<U.presetCount;){const M=U.getPreset(x);M&&j.push(new zc(M.id,M.type,M.color,M.brightness)),x++}e(j),n(U.selectedPresetId)}),ke(Gw.ROOM_COLOR,U=>{Tr.isRoomPreviewerId(U.roomId)||(c(r),o(U.state),n(U.presetId),h(U.effectId),C(U.effectId),p(U.color),S(U.color),_(U.brightness),b(U.brightness))}),a.useEffect(()=>{r===0&&l===0||Ts.previewDimmer(f,T,I===2)},[r,l,f,T,I]),{presets:i,selectedPresetId:s,dimmerState:r,lastDimmerState:l,effectId:u,color:m,brightness:E,selectedEffectId:I,setSelectedEffectId:C,selectedColor:f,setSelectedColor:S,selectedBrightness:T,setSelectedBrightness:b,selectPresetId:O,applyChanges:F}},xM=FM,GM=()=>{const[i,e]=a.useState(-1),[s,n]=a.useState(-1),[r,o]=a.useState(0),l=()=>{e(-1),n(-1),o(0)},c=()=>{Pe().connection.send(new kf(i)),l()};return ke(je.REQUEST_CREDITFURNI,u=>{const h=X().getRoomObject(u.roomId,u.objectId,u.category);!h||!as(h)||(e(u.objectId),n(u.category),o(h.model.getValue(ue.FURNITURE_CREDIT_VALUE)||0))}),Hs(i!==-1&&s!==-1,u=>{u.id!==i||u.category!==s||l()}),{objectId:i,value:r,redeem:c,onClose:l}},BM=GM,HM=()=>{const[i,e]=a.useState(-1),[s,n]=a.useState(-1),[r,o]=a.useState(-1),[l,c]=a.useState([]),{roomSession:u=null}=Xe(),h=()=>{e(-1),n(-1),o(-1),c([])};return ke(je.REQUEST_EXTERNAL_IMAGE,m=>{const p=X().getRoomObject(m.roomId,m.objectId,m.category),E=X().getRoomObjects(u==null?void 0:u.roomId,re.WALL);if(!p)return;const _=[];E.forEach(C=>{if(C.type!=="external_image_wallitem_poster_small")return null;const f=C.model.getValue(ue.FURNITURE_DATA),S=JSON.parse(f);_.push(S)}),e(m.objectId),n(m.category),c(_);const I=JSON.parse(p.model.getValue(ue.FURNITURE_DATA));o(C=>{let f=0;return I&&(f=_.findIndex(S=>S.u===I.u)),f<0&&(f=0),f})}),Hs(i!==-1&&s!==-1,m=>{m.id!==i||m.category!==s||h()}),{objectId:i,currentPhotoIndex:r,currentPhotos:l,onClose:h}},VM=HM,WM=()=>{const[i,e]=a.useState(-1),[s,n]=a.useState(-1),[r,o]=a.useState(0),[l,c]=a.useState([]),[u,h]=a.useState([]),[m,p]=a.useState(null),[E,_]=a.useState(0),I=()=>{e(-1),n(-1),o(0),c([]),h([]),p(null)},C=f=>{Pe().connection.send(new hp(i,f)),I()};return W(sg,f=>{const S=f.getParser();e(S.furniId),_(S.start?1:2)}),W(eg,f=>I()),W(tg,f=>I()),ke(je.REQUEST_FRIEND_FURNITURE_ENGRAVING,f=>{const S=X().getRoomObject(f.roomId,f.objectId,f.category);if(!S)return;const T=S.model.getValue(ue.FURNITURE_DATA),b=S.model.getValue(ue.FURNITURE_FRIENDFURNI_ENGRAVING);T[0]!=="1"||T.length!==6||(e(f.objectId),n(f.category),o(b),c([T[1],T[2]]),h([T[3],T[4]]),p(T[5]),_(0))}),Hs(i!==-1&&s!==-1,f=>{f.id!==i||f.category!==s||I()}),{objectId:i,type:r,usernames:l,figures:u,date:m,stage:E,onClose:I,respond:C}},jM=WM,qM=["perteam","mostwins","classic"],YM=["alltime","daily","weekly","monthly"],zM=()=>{const[i,e]=a.useState(new Map),{roomSession:s=null}=Xe(),n=o=>qM[o],r=o=>YM[o];return ke(je.REQUEST_HIGH_SCORE_DISPLAY,o=>{const l=X().getRoomObject(o.roomId,o.objectId,o.category);if(!l)return;const c=l.model.getValue(ue.FURNITURE_DATA_FORMAT),u=_d.getData(c);u.initializeFromRoomObjectModel(l.model),e(h=>{const m=new Map(h);return m.set(l.id,u),m})}),ke(je.REQUEST_HIDE_HIGH_SCORE_DISPLAY,o=>{o.roomId===s.roomId&&e(l=>{const c=new Map(l);return c.delete(o.objectId),c})}),{stuffDatas:i,getScoreType:n,getClearType:r}},KM=zM,$M="internalLink",QM=()=>(ke(je.REQUEST_INTERNAL_LINK,i=>{const e=X().getRoomObject(i.roomId,i.objectId,i.category);if(!e)return;let n=e.model.getValue(ue.FURNITURE_DATA)[$M];(!n||!n.length)&&(n=e.model.getValue(ue.FURNITURE_INTERNAL_LINK)),n&&n.length&&oe(n)}),{}),XM=QM,JM=()=>{const[i,e]=a.useState(-1),[s,n]=a.useState(-1),[r,o]=a.useState(null),[l,c]=a.useState(null),[u,h]=a.useState(ls.NO_CLUB),[m,p]=a.useState(null),E=()=>{e(-1),n(-1),o(null),c(null),p(null)},_=()=>{i!==-1&&(B(new Yf(i)),E())},I=()=>{i!==-1&&(B(new Ei(i)),E())},C=()=>{i!==-1&&B(new qf(i,m))};return ke(je.REQUEST_MANNEQUIN,f=>{const S=X().getRoomObject(f.roomId,f.objectId,f.category);if(!S)return;const T=S.model,b=T.getValue(ue.FURNITURE_MANNEQUIN_FIGURE)||null,y=T.getValue(ue.FURNITURE_MANNEQUIN_GENDER)||null,w=Mt().createFigureContainer(b),O=Mt().getFigureClubLevel(w,y,yr.MANNEQUIN_CLOTHING_PART_TYPES);e(f.objectId),n(f.category),o(b),c(y),h(O),p(T.getValue(ue.FURNITURE_MANNEQUIN_NAME)||null)}),Hs(i!==-1&&s!==-1,f=>{f.id!==i||f.category!==s||E()}),{objectId:i,figure:r,gender:l,clubLevel:u,name:m,setName:p,saveFigure:_,wearFigure:I,saveName:C,onClose:E}},ZM=JM,e1=()=>{const[i,e]=a.useState(-1),[s,n]=a.useState(-1),[r,o]=a.useState(-1),[l,c]=a.useState(new po),[u,h]=a.useState([]),{roomSession:m=null}=Xe(),{showSingleBubble:p=null,simpleAlert:E=null}=Ke(),_=()=>{e(-1),n(-1)},I=a.useCallback((T,b)=>B(new __(T,b)),[]),C=a.useCallback(T=>B(new I_(T)),[]),f=a.useCallback((T,b)=>B(new Ei(T,b)),[]);ke(je.REQUEST_PLAYLIST_EDITOR,T=>{var y,w,O;const b=X().getRoomObject(T.roomId,T.objectId,T.category);if(b){if(as(b)){e(T.objectId),n(T.category),(y=_e().soundManager.musicController)==null||y.requestUserSongDisks(),(O=(w=_e().soundManager.musicController)==null?void 0:w.getRoomItemPlaylist())==null||O.requestPlayList();return}(m.isRoomOwner||m.controllerLevel>=_t.GUEST||J().isModerator)&&B(new Ei(T.objectId,-2))}}),Hs(i!==-1&&s!==-1,T=>{T.id!==i||T.category!==s||_()}),nr(v_.NPE_SONG_CHANGED,T=>{o(T.position)}),nr(Bw.NOTIFY_PLAYED_SONG,T=>{p(g("soundmachine.notification.playing",["songname","songauthor"],[T.name,T.creator]),Le.SOUNDMACHINE)}),nr(Hw.SDIR_SONG_DISK_INVENTORY_RECEIVENT_EVENT,T=>{var b;c((b=_e().soundManager.musicController)==null?void 0:b.songDiskInventory.clone())}),nr(Tc.PLUE_PLAY_LIST_UPDATED,T=>{var b,y;h((y=(b=_e().soundManager.musicController)==null?void 0:b.getRoomItemPlaylist())==null?void 0:y.entries.concat())}),nr(Tc.PLUE_PLAY_LIST_FULL,T=>{E(g("playlist.editor.alert.playlist.full"),fe.ALERT,"","",g("playlist.editor.alert.playlist.full.title"))});const S=T=>{var b,y;i!==-1&&(T instanceof _i?T.getParser().fragmentNumber===0&&((b=_e().soundManager.musicController)==null||b.requestUserSongDisks()):(y=_e().soundManager.musicController)==null||y.requestUserSongDisks())};return W(_i,S),W(El,S),W(_l,S),{objectId:i,diskInventory:l,playlist:u,currentPlayingIndex:r,onClose:_,addToPlaylist:I,removeFromPlaylist:C,togglePlayPause:f}},t1=e1,uu="floor",s1="wallpaper",du="landscape",n1="poster",r1=()=>{const[i,e]=a.useState(-1),[s,n]=a.useState(-1),[r,o]=a.useState(null),[l,c]=a.useState(null),[u,h]=a.useState(!1),[m,p]=a.useState(null),[E,_]=a.useState(null),[I,C]=a.useState(-1),[f,S]=a.useState(null),[T,b]=a.useState(!1),[y,w]=a.useState(null),{roomSession:O=null}=Xe(),F=()=>{e(-1),n(-1),o(null),c(null),h(!1),p(null),_(null),C(-1),S(null),b(!1),w(null)},U=()=>{i!==-1&&(O.openGift(i),X().changeObjectModelData(X().activeRoomId,i,re.FLOOR,ue.FURNITURE_DISABLE_PICKING_ANIMATION,1))},j=a.useMemo(()=>({imageReady:(x,M,G)=>{!G&&M&&(G=ln.generateImage(M)),w(G.src)},imageFailed:null}),[]);return $e(Vw.RSPE_PRESENT_OPENED,x=>{let M=null;x.itemType===Ce.FLOOR?M=J().getFloorItemData(x.classId):x.itemType===Ce.WALL&&(M=J().getWallItemData(x.classId));let G=!1;if(x.placedInRoom){const H=X().getRoomObject(O.roomId,x.placedItemId,re.FLOOR);H&&(G=as(H))}switch(x.itemType){case Ce.WALL:{if(M)switch(M.className){case uu:case du:case s1:let H=null;M.className===uu?H=g("inventory.furni.item.floor.name"):M.className===du?H=g("inventory.furni.item.landscape.name"):H=g("inventory.furni.item.wallpaper.name"),c(H);break;case n1:{const Y=x.productCode;let q=null;Y.indexOf("poster")===0&&(q=Y.replace("poster",""));const Z=J().getProductData(Y);let ce=null;Z?ce=Z.name:M&&(ce=M.name),c(ce),w(X().getFurnitureWallIconUrl(x.classId,q));break}default:{c(M.name||null),w(X().getFurnitureWallIconUrl(x.classId));break}}break}case Ce.HABBO_CLUB:c(g("widget.furni.present.hc"));break;default:{if(x.placedItemType===Ce.PET){const Y=x.petFigureString;if(Y&&Y.length){const q=new Ur(Y),Z=X().getRoomObjectPetImage(q.typeId,q.paletteId,q.color,new Lt(90),64,j,!0,0,q.customParts);Z&&w(Z.getImage().src)}}else{const Y=X().getFurnitureFloorImage(x.classId,new Lt(90),64,j);Y&&w(Y.getImage().src)}const H=J().getProductData(x.productCode);c(H&&H.name||M.name);break}}e(0),n(x.classId),o(x.itemType),h(G),C(x.placedItemId),S(x.placedItemType),b(x.placedInRoom)}),ke(je.REQUEST_PRESENT,x=>{const M=X().getRoomObject(x.roomId,x.objectId,x.category);if(!M)return null;F(),e(x.objectId),n(-1),c(M.model.getValue(ue.FURNITURE_DATA)||""),h(as(M)),p(M.model.getValue(ue.FURNITURE_PURCHASER_NAME)||null),_(M.model.getValue(ue.FURNITURE_PURCHASER_FIGURE)||null)}),Hs(i!==-1,x=>{x.id===i&&F(),x.id===I&&T&&b(!1)}),{objectId:i,classId:s,itemType:r,text:l,isOwnerOfFurniture:u,senderName:m,senderFigure:E,placedItemId:I,placedItemType:f,placedInRoom:T,imageUrl:y,openPresent:U,onClose:F}},o1=r1,i1=()=>{const[i,e]=a.useState(null),[s,n]=a.useState(!1),[r,o]=a.useState(-1),[l,c]=a.useState(-1),{roomSession:u=null}=Xe(),h=()=>{o(-1),c(-1),e(null),n(!1)},m=()=>{r!==-1&&(u.openGift(r),X().changeObjectModelData(X().activeRoomId,r,re.FLOOR,ue.FURNITURE_DISABLE_PICKING_ANIMATION,1),h())};return ke(je.REQUEST_ECOTRONBOX,p=>{const E=X().getRoomObject(p.roomId,p.objectId,p.category);if(!E)return null;h(),o(p.objectId),c(-1),e(E.model.getValue(ue.FURNITURE_DATA)||""),n(as(E))}),{onClose:h,openBox:m,text:i,objectId:r,classId:l,isOwnerOfFurniture:s}},a1=i1,l1="internalLink",c1=()=>{const[i,e]=a.useState(0);return ke(je.REQUEST_ROOM_LINK,s=>{const n=X().getRoomObject(s.roomId,s.objectId,s.category);if(!n)return;let o=n.model.getValue(ue.FURNITURE_DATA)[l1];(!o||!o.length)&&(o=n.model.getValue(ue.FURNITURE_INTERNAL_LINK)),!(!o||!o.length)&&(o=parseInt(o,10),!isNaN(o)&&(e(o),B(new fo(o,!1,!1))))}),W(cr,s=>{!i||s.getParser().data.roomId!==i||e(0)}),{}},u1=c1,d1=()=>{const[i,e]=a.useState(-1),[s,n]=a.useState(-1),[r,o]=a.useState(""),[l,c]=a.useState(""),[u,h]=a.useState("0"),[m,p]=a.useState(""),[E,_]=a.useState(!1),{getWallItemById:I=null}=$n(),C=()=>{B(new yf(i,l,u,m)),e(-1),n(-1),o(""),c(""),h("0"),p(""),_(!1)};return W(rg,f=>{const S=f.getParser();e(S.itemId),n(re.WALL);const T=I(S.itemId);let b="post_it";if(T){const y=X().getFurnitureWallName(T.type);y.match("post_it_")&&(b=y)}o(b),c(S.location),h("FFFF33"),p(""),_(!0)}),{objectId:i,color:u,setColor:h,text:m,setText:p,canModify:E,onClose:C}},h1=d1,pa=40,m1=()=>{const[i,e]=a.useState(-1),[s,n]=a.useState(-1),[r,o]=a.useState(0),[l,c]=a.useState(-1),u=()=>{e(-1),n(-1),o(0),c(-1)},h=(m,p=!1)=>{m||(m=0),m=Math.abs(m),p||m>pa&&(m=pa),o(parseFloat(m.toFixed(2))),p||c(m*100)};return W(Zm,m=>{const p=m.getParser();i===p.furniId&&h(p.height,!0)}),ke(je.REQUEST_STACK_HEIGHT,m=>{if(!Eo(Pe(),m.objectId,m.category))return;const p=X().getRoomObject(m.roomId,m.objectId,m.category);p&&(e(m.objectId),n(m.category),o(p.getLocation().z),c(-1))}),Hs(i!==-1&&s!==-1,m=>{m.id!==i||m.category!==s||u()}),a.useEffect(()=>{if(i===-1||l===-1)return;const m=setTimeout(()=>B(new Ii(i,~~l)),10);return()=>clearTimeout(m)},[i,l]),{objectId:i,height:r,maxHeight:pa,onClose:u,updateHeight:h}},g1=m1,p1=()=>{const[i,e]=a.useState(-1),[s,n]=a.useState(-1),[r,o]=a.useState("0"),[l,c]=a.useState(""),[u,h]=a.useState(""),[m,p]=a.useState(!1),E=()=>{e(-1),n(-1),o("0"),c(""),h(""),p(!1)},_=f=>{f!==r&&(o(f),X().modifyRoomObjectData(i,s,f,l))},I=f=>{c(f),X().modifyRoomObjectData(i,s,r,f)},C=()=>X().deleteRoomObject(i,s);return ke(je.REQUEST_STICKIE,f=>{const S=X().getRoomObject(f.roomId,f.objectId,f.category);if(!S)return;const T=S.model.getValue(ue.FURNITURE_ITEMDATA);if(T.length<6)return;let b=null,y=null;T.indexOf(" ")>0?(b=T.slice(0,T.indexOf(" ")),y=T.slice(T.indexOf(" ")+1,T.length)):b=T,e(f.objectId),n(f.category),o(b||"0"),c(y||""),h(S.type||"post_it"),p(Pe().isRoomOwner||J().isModerator||as(S))}),Hs(i!==-1&&s!==-1,f=>{f.id!==i||f.category!==s||E()}),{objectId:i,color:r,text:l,type:u,canModify:m,updateColor:_,updateText:I,trash:C,onClose:E}},f1=p1,_1=()=>{const[i,e]=a.useState(-1),[s,n]=a.useState(-1),[r,o]=a.useState("1"),[l,c]=a.useState(""),[u,h]=a.useState(""),[m,p]=a.useState(""),E=()=>{e(-1),n(-1),o("1"),c(""),h(""),p("")};return ke(je.REQUEST_TROPHY,_=>{const I=X().getRoomObject(_.roomId,_.objectId,_.category);if(!I)return;let C=I.model.getValue(ue.FURNITURE_DATA);I.model.getValue(ue.FURNITURE_EXTRAS),e(_.objectId),n(_.category),o(I.model.getValue(ue.FURNITURE_COLOR)||"1");const f=C.substring(0,C.indexOf(" "));C=C.substring(f.length+1,C.length);const S=C.substring(0,C.indexOf(" ")),T=C.substr(S.length+1,C.length);c(f),h(S),p(T)}),Hs(i!==-1&&s!==-1,_=>{_.id!==i||_.category!==s||E()}),{objectId:i,color:r,senderName:l,date:u,message:m,onClose:E}},E1=_1,I1=()=>{const[i,e]=a.useState(null),[s,n]=a.useState([]),[r,o]=a.useState(""),[l,c]=a.useState([]),[u,h]=a.useState(0),[m,p]=a.useState(de.STUFF_SELECTION_OPTION_NONE),{showConfirm:E=null}=Ke(),_=()=>{const C=f=>{f&&(f instanceof b_?B(new xf(f.id,s,r,l,u,f.stuffTypeSelectionCode)):f instanceof O_?B(new Bf(f.id,s,r,l,f.stuffTypeSelectionCode)):f instanceof w_&&B(new Gf(f.id,s,r,l,f.stuffTypeSelectionCode)))};Ry(i.id)?C(i):E(g("wiredfurni.nonowner.change.confirm.body"),()=>{C(i)},null,null,null,g("wiredfurni.nonowner.change.confirm.title"))},I=(C,f)=>{!i||!m||C<=0||c(S=>{const T=[...S],b=S.indexOf(C);return b>=0?(T.splice(b,1),Ar.hide(C)):T.length<i.maximumItemSelectionCount&&(T.push(C),Ar.show(C)),T})};return W(Eg,C=>{C.getParser(),e(null)}),W(pg,C=>{const f=C.getParser();e(f.definition)}),W(fg,C=>{const f=C.getParser();e(f.definition)}),W(_g,C=>{const f=C.getParser();e(f.definition)}),a.useEffect(()=>{if(i)return()=>{n([]),o(""),h(0),c(C=>(C&&C.length&&Ar.clearSelectionShaderFromFurni(C),[])),p(de.STUFF_SELECTION_OPTION_NONE)}},[i]),{trigger:i,setTrigger:e,intParams:s,setIntParams:n,stringParam:r,setStringParam:o,furniIds:l,setFurniIds:c,actionDelay:u,setActionDelay:h,setAllowsFurni:p,saveWired:_,selectObjectForWired:I}},Fe=()=>Qe(I1),C1=()=>{ys();const[i,e]=a.useState(null),[s,n]=a.useState(null),[r,o]=a.useState([]),[l,c]=a.useState([]),[u,h]=a.useState(null),[m,p]=a.useState(-1),[E,_]=a.useState(!1),{friends:I=[]}=ns(),{selectObjectForWired:C=null}=Fe(),{roomSession:f=null}=Xe(),S=O=>{o(F=>{const U=[...F];return U.splice(O,1),U})},T=O=>{c(F=>{const U=[...F],j=U.splice(O,1)[0];return u===j&&h(null),U})},b=O=>{h(O),c([])},y=(O,F)=>{const U=gr.getObjectName(O,F);U&&(n(U),F!==re.UNIT&&c([]))},w=(O,F)=>{let U=null;switch(F){case re.FLOOR:case re.WALL:U=gr.getFurniInfo(O,F),U&&C(O,F);break;case re.UNIT:{const j=f.userDataManager.getUserDataByIndex(O);if(!j)break;switch(j.type){case vt.PET:f.userDataManager.requestPetInfo(j.webID),p(j.webID);break;case vt.USER:U=gr.getUserInfo(F,j);break;case vt.BOT:U=gr.getBotInfo(F,j);break;case vt.RENTABLE_BOT:U=gr.getRentableBotInfo(F,j);break}}}U&&e(U)};return $e(Ww.USER_DATA_UPDATED,O=>{if(!O.addedUsers.length)return;let F=[];O.addedUsers.forEach(U=>{U.webID!==J().userId&&I.find(j=>j.id===U.webID)&&F.push(new tE(U.roomIndex,re.UNIT,U.webID,U.name,U.type,!0))}),F.length&&o(U=>{const j=[...U];return F.forEach(x=>{const M=j.findIndex(G=>G.id===x.id);M>-1&&j.splice(M,1),j.push(x)}),j})}),$e(jw.PET_INFO,O=>{const F=O.petInfo;if(!F||F.id!==m)return;const U=gr.getPetInfo(F);U&&(e(U),p(-1))}),$e(qw.PET_STATUS_UPDATE,O=>{}),ke(Nc.USE_PRODUCT_FROM_INVENTORY,O=>{}),ke(Nc.USE_PRODUCT_FROM_ROOM,O=>{const F=X().getRoomObject(f.roomId,O.objectId,re.FLOOR);if(!F||!as(F))return;const U=F.model.getValue(ue.FURNITURE_OWNER_ID),j=F.model.getValue(ue.FURNITURE_TYPE_ID),x=J().getFloorItemData(j),M=x.customParams.split(" "),G=M.length?parseInt(M[0]):-1;if(G===-1)return;const H=[],Y=X().getRoomObjects(f.roomId,re.UNIT);for(const q of Y){const Z=f.userDataManager.getUserDataByIndex(q.id);let ce=!1;if(!(!Z||Z.type!==vt.PET)){if(Z.ownerId===U){Z.hasSaddle&&x.specialType===ae.PET_SADDLE&&(ce=!0);const se=Z.figure.split(" ");if((se.length?parseInt(se[0]):-1)===G){if(x.specialType===ae.MONSTERPLANT_REVIVAL&&!Z.canRevive||x.specialType===ae.MONSTERPLANT_REBREED&&(Z.petLevel<7||Z.canRevive||Z.canBreed)||x.specialType===ae.MONSTERPLANT_FERTILIZE&&(Z.petLevel>=7||Z.canRevive))continue;H.push(new IA(Z.roomIndex,re.UNIT,Z.name,O.objectId,q.id,-1,ce))}}}}h(null),H.length&&c(H)}),ke(bt.REQUEST_MANIPULATION,O=>{Eo(f,O.objectId,O.category)&&_(!0)}),ic(O=>{w(O.id,O.category)}),XE(O=>{e(null),c([])}),vM(O=>{i||O.category!==re.UNIT||y(O.id,O.category)}),RM(O=>{!s||O.category!==re.UNIT||s.roomIndex!==O.id||n(null)}),ct([Ge.FURNI_REMOVED,Ge.USER_REMOVED],O=>{if(s&&s.category===O.category&&s.roomIndex===O.id&&n(null),O.category===re.UNIT){let F=r.findIndex(U=>U.roomIndex===O.id);F>-1&&o(U=>U.filter(j=>j.roomIndex===O.id)),F=l.findIndex(U=>U.id===O.id),F>-1&&c(U=>U.filter(j=>j.id!==O.id))}else O.category===re.FLOOR&&l.findIndex(U=>U.id===O.id)>-1&&c(U=>U.filter(j=>j.requestRoomObjectId!==O.id));i&&(i instanceof xr?i.id===O.id&&e(null):(i instanceof mt||i instanceof Br||i instanceof Gr)&&i.roomIndex===O.id&&e(null))}),a.useEffect(()=>{i&&(n(null),o([]),c([]))},[i]),a.useEffect(()=>{s&&o([])},[s]),a.useEffect(()=>{f.isDecorating=E},[f,E]),{avatarInfo:i,setAvatarInfo:e,activeNameBubble:s,setActiveNameBubble:n,nameBubbles:r,productBubbles:l,confirmingProduct:u,isDecorating:E,setIsDecorating:_,removeNameBubble:S,removeProductBubble:T,updateConfirmingProduct:b,getObjectName:y}},S1=C1,hu=new Map,mu=new Map,gu=new Map,T1=()=>{const[i,e]=a.useState([]),[s,n]=a.useState({mode:Ze.CHAT_MODE_FREE_FLOW,weight:Ze.CHAT_BUBBLE_WIDTH_NORMAL,speed:Ze.CHAT_SCROLL_SPEED_NORMAL,distance:50,protection:Ze.FLOOD_FILTER_NORMAL}),{roomSession:r=null}=Xe(),{addChatEntry:o}=oc(),[l,c]=a.useState(!0),u=a.useRef(!1),h=a.useMemo(()=>{if(!s)return 6e3;switch(s.speed){case Ze.CHAT_SCROLL_SPEED_FAST:return 3e3;case Ze.CHAT_SCROLL_SPEED_NORMAL:return 6e3;case Ze.CHAT_SCROLL_SPEED_SLOW:return 12e3}},[s]),m=f=>{const S=Mt().createAvatarImage(f,hl.LARGE,null,{resetFigure:y=>{u.current||m(y)},dispose:()=>{},disposed:!1});if(!S)return;const T=S.getCroppedImage(fi.HEAD),b=S.getPartColor(st.CHEST);return hu.set(f,b&&b.rgb||16777215),S.dispose(),mu.set(f,T.src),T.src},p=f=>{let S=mu.get(f);return S||(S=m(f)),S},E=(f,S,T,b=64,y=null)=>{let w=gu.get(f+y);if(w)return w;const O=new Ur(f),F=O.typeId,U=X().getRoomObjectPetImage(F,O.paletteId,O.color,new Lt(S*45),b,null,!1,0,O.customParts,y);return U&&(w=ln.generateImageUrl(U.data),gu.set(f+y,w)),w},_=a.useCallback(()=>{e(f=>{if(f){const S=f.filter(T=>T.top>-T.height*2);if(S.length!==f.length)return S}return f})},[e]),I=a.useCallback(f=>{e(S=>(S&&S.forEach(T=>{if(T.skipMovement){T.skipMovement=!1;return}T.top-=f}),S)),_()},[_,e]),C=a.useCallback((f,S=!1)=>{const T=X().getRoomObject(r.roomId,f.objectId,re.UNIT),b=T?x_(r.roomId,T==null?void 0:T.id,re.UNIT):new Bn(window.innerWidth/2,0),y=T?r.userDataManager.getUserDataByIndex(f.objectId):new Yw(-1);let w="",O=0,F=null,U=f.chatType,j=f.style,x=0,M=f.message;if(y){x=y.type;const q=y.figure;switch(x){case vt.PET:F=E(q,2,!0,64,T.model.getValue(ue.FIGURE_POSTURE)),new Ur(q).typeId;break;case vt.USER:F=p(q);break;case vt.RENTABLE_BOT:case vt.BOT:j=zw.BOT;break}O=hu.get(q),w=y.name}switch(U){case Is.CHAT_TYPE_RESPECT:M=g("widgets.chatbubble.respect",["username"],[w]),ee("respect.options").enabled&&Fs(ee("respect.options").sound);break;case Is.CHAT_TYPE_PETREVIVE:case Is.CHAT_TYPE_PET_REBREED_FERTILIZE:case Is.CHAT_TYPE_PET_SPEED_FERTILIZE:{let q="widget.chatbubble.petrevived";U===Is.CHAT_TYPE_PET_REBREED_FERTILIZE?q="widget.chatbubble.petrefertilized;":U===Is.CHAT_TYPE_PET_SPEED_FERTILIZE&&(q="widget.chatbubble.petspeedfertilized");let Z=null;if(X().getRoomObject(r.roomId,f.extraParam,re.UNIT)){const se=r.userDataManager.getUserDataByIndex(T.id);se&&(Z=se.name)}M=g(q,["petName","userName"],[w,Z]);break}case Is.CHAT_TYPE_PETRESPECT:M=g("widget.chatbubble.petrespect",["petname"],[w]);break;case Is.CHAT_TYPE_PETTREAT:M=g("widget.chatbubble.pettreat",["petname"],[w]);break;case Is.CHAT_TYPE_HAND_ITEM_RECEIVED:M=g("widget.chatbubble.handitem",["username","handitem"],[w,g("handitem"+f.extraParam)]);break;case Is.CHAT_TYPE_MUTE_REMAINING:{const q=(f.extraParam>0?Math.floor(f.extraParam/3600):0).toString(),Z=(f.extraParam>0?Math.floor(f.extraParam%3600/60):0).toString(),ce=(f.extraParam%60).toString();M=g("widget.chatbubble.mutetime",["hours","minutes","seconds"],[q,Z,ce]);break}}const G=Vy(M),H=O&&("#"+O.toString(16).padStart(6,"0")||null),Y=new rE(y.roomIndex,re.UNIT,r.roomId,M,G,w,new Bn(b.x,b.y),U,j,F,H);return S&&o({id:-1,webId:y.webID,entityId:y.roomIndex,name:w,imageUrl:F,style:j,chatType:U,entityType:y.type,message:G,timestamp:Y_(),type:an.TYPE_CHAT,roomId:r.roomId,color:H}),Y},[o,p,r]);return $e(Is.CHAT_EVENT,f=>e(S=>[...S,C(f,!0)])),ke([Jt.INITIALIZED,Jt.DISPOSED],f=>{e([])}),ke(y_.ROOM_DRAG,f=>{if(!i.length||f.roomId!==r.roomId)return;const S=f.offsetX;i.forEach(T=>T.elementRef&&(T.left+=S))}),W(cr,f=>{const S=f.getParser();S.roomEnter&&n(S.chat)}),W(Xm,f=>{const S=f.getParser();n(S.chat)}),a.useEffect(()=>(u.current=!1,()=>{u.current=!0}),[]),{chatMessages:i,setChatMessages:e,chatSettings:s,getScrollSpeed:h,removeHiddenChats:_,moveAllChatsUp:I,getPetImage:E,getUserImage:p,createBubble:C,canChat:l,setCanChat:c}},wn=()=>Qe(T1);let N1=null;const R1=()=>{const[i,e]=a.useState([]),{createBubble:s}=wn(),{roomSession:n=null}=Xe(),[r,o]=a.useState(!1),[l,c]=a.useState(!1),u=a.useRef(),h=a.useRef(),m=a.useRef(),[p,E]=a.useState(0);let _=0,I=0,C=0,f=0;$e(Is.CHAT_EVENT,w=>{let O=s(w);O.left=O.left-20,e(F=>[...F,O]),!r&&(c(!1),clearInterval(N1))}),$e(qt.ENDED,w=>{e([]),y()}),ke(y_.ROOM_DRAG,w=>{!i.length||w.roomId!==n.roomId||w.offsetX});const S=(w,O=!1)=>{u&&u.current==null||(c(!0),_=w.clientY,I=u.current.offsetHeight,O&&(I+=+w.clientY),document.addEventListener("mousemove",T),document.addEventListener("mouseup",b))},T=w=>{u&&u.current==null||(C=w.clientY,f=I+C-_,u.current.style.display="none",f>0&&(u.current.style.height=f+"px",u.current.style.display="flex",o(!0)))},b=w=>{u&&u.current==null||(parseInt(u.current.style.height,10)<=120&&(u.current.style.height=0+"px",u.current.style.display="none",o(!1)),document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",b))},y=()=>{c(!1),o(!1),u.current.style.height=0+"px",u.current.style.display="none"};return ke([Jt.INITIALIZED,Jt.DISPOSED],w=>{e([])}),{chatMessages:i,setChatMessages:e,isDragged:r,setIsDragged:o,roomSession:n,isVisible:l,setIsVisible:c,onMouseDown:S,onMouseUp:b,onMouseMove:T,historyRef:u,scrollRef:h,handleRef:m,setOffset:E,closeChatHistory:y}},Ro=()=>Qe(R1),v1=()=>{const[i,e]=a.useState(""),[s,n]=a.useState(!1),[r,o]=a.useState(!1),[l,c]=a.useState(!1),[u,h]=a.useState(!1),[m,p]=a.useState(0),{showNitroAlert:E=null,showAfkAlert:_=null,showConfirm:I=null}=Ke(),{roomSession:C=null}=Xe(),{canChat:f}=wn(),S=(T,b,y="",w=0)=>{if(T==="")return null;if(!f)return;const O=T.split(" ");if(O.length>0){const F=O[0];let U="";if(O.length>1&&(U=O[1]),F.charAt(0)===":"&&U==="x"){const j=X().selectedAvatarId;if(j>-1){const x=C.userDataManager.getUserDataByIndex(j);x&&(U=x.name,T=T.replace(" x"," "+x.name))}}switch(F.toLowerCase()){case":shake":return vc.init(2500,5e3),vc.turnVisualizationOn(),null;case":rotate":return Rc.init(2500,5e3),Rc.turnVisualizationOn(),null;case":d":case";d":gs()===ls.VIP&&C.sendExpressionMessage(on.LAUGH.ordinal);break;case"o/":case"_o/":return C.sendExpressionMessage(on.WAVE.ordinal),null;case":kiss":if(gs()===ls.VIP)return C.sendExpressionMessage(on.BLOW.ordinal),null;break;case":jump":if(gs()===ls.VIP)return C.sendExpressionMessage(on.JUMP.ordinal),null;break;case":idle":return C.sendExpressionMessage(on.IDLE.ordinal),null;case"_b":return C.sendExpressionMessage(on.RESPECT.ordinal),null;case":sign":return C.sendSignMessage(parseInt(U)),null;case":iddqd":case":flip":return X().events.dispatchEvent(new Za(C.roomId,-1,!0)),null;case":zoom":return X().events.dispatchEvent(new Za(C.roomId,parseFloat(U),!1)),null;case":screenshot":const j=X().createTextureFromRoom(C.roomId,1),x=new Image;return x.src=ln.generateImageUrl(j),window.open("").document.write(x.outerHTML),null;case":pickall":return(C.isRoomOwner||J().isModerator)&&I(g("room.confirm.pick_all"),()=>{J().sendSpecialCommandMessage(":pickall")},null,null,null,g("generic.alert.title")),null;case":furni":return oe("furni-chooser/"),null;case":chooser":return oe("user-chooser/"),null;case":floor":case":bcfloor":return C.controllerLevel>=_t.ROOM_OWNER&&oe("floor-editor/show"),null;case":togglefps":return Nn().maxFPS>0?Nn().maxFPS=0:Nn().maxFPS=ee("system.animation.fps"),null;case":client":case":nitro":case":billsonnn":case":hive":case":tonic":return E(),null;case":afkalert":return _(),null;case":settings":return(C.isRoomOwner||J().isModerator)&&B(new Ml(C.roomId)),null}}switch(b){case $s.CHAT_DEFAULT:C.sendChatMessage(T,w);break;case $s.CHAT_SHOUT:C.sendShoutMessage(T,w);break;case $s.CHAT_WHISPER:C.sendWhisperMessage(y,T,w);break}};return $e(Is.FLOOD_EVENT,T=>{h(!0),p(parseFloat(T.message))}),ic(T=>{if(T.category!==re.UNIT)return;const b=C.userDataManager.getUserDataByIndex(T.id);b&&e(b.name)}),ke(bt.DESELECTED,T=>e("")),a.useEffect(()=>{if(!u)return;let T=0;const b=setInterval(()=>{p(y=>(T=(y||0)-1,T)),T<0&&(clearInterval(b),h(!1))},1e3);return()=>clearInterval(b)},[u]),a.useEffect(()=>{if(!l)return;let T=null;return l&&(T=setTimeout(()=>{c(!1),n(!1)},1e4)),()=>clearTimeout(T)},[l]),a.useEffect(()=>{s?r||(o(!0),C.sendChatTypingMessage(s)):r&&(o(!1),C.sendChatTypingMessage(s))},[C,s,r]),{selectedUsername:i,floodBlocked:u,floodBlockedSeconds:m,setIsTyping:n,setIsIdle:c,sendChat:S}},b1=v1,O1=()=>{const[i,e]=a.useState([]),s=o=>{i.indexOf(o)>=0||e([...i,o])},n=o=>{const l=i.indexOf(o);if(l===-1)return;const c=[...i];c.splice(l,1),e(c)},r=(o,l)=>{Pe().sendDoorbellApprovalMessage(o,l),n(o)};return $e(ra.DOORBELL,o=>s(o.userName)),$e(ra.RSDE_REJECTED,o=>n(o.userName)),$e(ra.RSDE_ACCEPTED,o=>n(o.userName)),{users:i,addUser:s,removeUser:n,answer:r}},w1=O1,y1=()=>{const[i,e]=a.useState(null),[s,n]=a.useState(!1),r=()=>n(!1);return W(mg,o=>{const l=o.getParser();console.log("ye"),n(!0),e(l.words)}),{wordsFilter:i,isVisible:s,setWordsFilter:e,onClose:r}},A1=y1,k1=()=>{const[i,e]=a.useState([]),{requests:s=[],dismissedRequestIds:n=[],setDismissedRequestIds:r=null}=ns(),o=a.useMemo(()=>i.filter(c=>n.indexOf(c.request.requesterUserId)===-1),[i,n]),l=c=>{r(u=>{if(u.indexOf(c)>=0)return u;const h=[...u];return h.push(c),h})};return JE(!0,c=>{if(c.category!==re.UNIT)return;const u=Pe().userDataManager.getUserDataByIndex(c.id);if(!u||u.type!==bc.getTypeNumber(bc.USER))return;const h=s.find(p=>p.requesterUserId===u.webID);if(!h||i.find(p=>p.request.requesterUserId===u.webID))return;const m=[...i];m.push({roomIndex:u.roomIndex,request:h}),e(m)}),ZE(!0,c=>{if(c.category!==re.UNIT)return;const u=i.findIndex(m=>m.roomIndex===c.id);if(u===-1)return;const h=[...i];h.splice(u,1),e(h)}),a.useEffect(()=>{const c=[];for(const u of s){const h=Pe().userDataManager.getUserData(u.requesterUserId);h&&c.push({roomIndex:h.roomIndex,request:u})}e(c)},[s]),{displayedRequests:o,hideFriendRequest:l}},M1=k1,U1=()=>{const[i,e]=a.useState(null),{roomSession:s=null}=Xe(),n=()=>e(null),r=l=>l&&X().selectRoomObject(Pe().roomId,l.id,l.category),o=()=>{const l=J(),c=X().getRoomObjects(s.roomId,re.WALL),u=X().getRoomObjects(s.roomId,re.FLOOR),h=c.map(p=>{if(p.id<0)return null;let E=p.type;if(E.startsWith("poster"))E=g(`poster_${E.replace("poster","")}_name`);else{const _=p.model.getValue(ue.FURNITURE_TYPE_ID),I=l.getWallItemData(_);I&&I.name.length&&(E=I.name)}return new vr(p.id,re.WALL,E)}),m=u.map(p=>{if(p.id<0)return null;let E=p.type;const _=p.model.getValue(ue.FURNITURE_TYPE_ID),I=l.getFloorItemData(_);return I&&I.name.length&&(E=I.name),new vr(p.id,re.FLOOR,E)});e([...h,...m].sort((p,E)=>p.name<E.name?-1:1))};return NM(!!i,l=>{if(l.id<0)return;const c=X().getRoomObject(Pe().roomId,l.id,l.category);if(!c)return;let u=null;switch(l.category){case re.WALL:{let h=c.type;if(h.startsWith("poster"))h=g(`poster_${h.replace("poster","")}_name`);else{const m=c.model.getValue(ue.FURNITURE_TYPE_ID),p=J().getWallItemData(m);p&&p.name.length&&(h=p.name)}u=new vr(c.id,re.WALL,h);break}case re.FLOOR:{let h=c.type;const m=c.model.getValue(ue.FURNITURE_TYPE_ID),p=J().getFloorItemData(m);p&&p.name.length&&(h=p.name),u=new vr(c.id,re.FLOOR,h)}}e(h=>[...h,u].sort((m,p)=>m.name<p.name?-1:1))}),Hs(!!i,l=>{l.id<0||e(c=>{const u=[...c];for(let h=0;h<u.length;h++){const m=u[h];if(!(m.id!==l.id||m.category!==l.category)){u.splice(h,1);break}}return u})}),{items:i,onClose:n,selectItem:r,populateChooser:o}},L1=U1,P1=()=>{const{roomSession:i=null}=Xe(),e=r=>i.sendPollStartMessage(r),s=r=>i.sendPollRejectMessage(r),n=(r,o,l)=>i.sendPollAnswerMessage(r,o,l);return $e(oa.OFFER,r=>{const o=new In(In.OFFER,r.id);o.summary=r.summary,o.headline=r.headline,At(o)}),$e(oa.ERROR,r=>{const o=new In(In.ERROR,r.id);o.summary=r.summary,o.headline=r.headline,At(o)}),$e(oa.CONTENT,r=>{const o=new In(In.CONTENT,r.id);o.startMessage=r.startMessage,o.endMessage=r.endMessage,o.numQuestions=r.numQuestions,o.questionArray=r.questionArray,o.npsPoll=r.npsPoll,At(o)}),{startPoll:e,rejectPoll:s,answerPoll:n}},D1=P1,F1=()=>{const[i,e]=a.useState(null);Xe();const s=()=>e(null),n=o=>o&&X().selectRoomObject(Pe().roomId,o.id,o.category),r=()=>{const o=Pe(),l=X().getRoomObjects(o.roomId,re.UNIT);e(l.map(c=>{if(c.id<0)return null;const u=o.userDataManager.getUserDataByIndex(c.id);return u?new vr(u.roomIndex,re.UNIT,u.name):null}).sort((c,u)=>c.name<u.name?-1:1))};return JE(!!i,o=>{if(o.id<0)return;const l=Pe().userDataManager.getUserDataByIndex(o.id);l&&e(c=>{const u=[...c];return u.push(new vr(l.roomIndex,re.UNIT,l.name)),u.sort((h,m)=>h.name<m.name?-1:1),u})}),ZE(!!i,o=>{o.id<0||e(l=>{const c=[...l];for(let u=0;u<c.length;u++){const h=c[u];if(!(h.id!==o.id||h.category!==o.category)){c.splice(u,1);break}}return c})}),{items:i,onClose:s,selectItem:n,populateChooser:r}},x1=F1,fa=4e3,G1=5,B1=()=>{const[i,e]=a.useState(-1),[s,n]=a.useState(null),[r,o]=a.useState(!1),[l,c]=a.useState(null),[u,h]=a.useState(new Map),[m,p]=a.useState(new Map),{answerPoll:E=null}=D1(),{roomSession:_=null}=Xe(),[I,C]=a.useState(fa),f=()=>{e(-1),n(null)},S=T=>{r||!s||(E(i,s.id,[T]),o(!0))};return $e(ia.ANSWERED,T=>{const b=_.userDataManager.getUserData(T.userId);b&&(h(T.answerCounts),p(y=>{if(!y.has(b.roomIndex)){const w=new Map(m);return w.set(b.roomIndex,{value:T.value,secondsLeft:G1}),w}return y}),X().updateRoomObjectUserGesture(_.roomId,b.roomIndex,Or.getGestureId(T.value==="0"?Or.GESTURE_SAD:Or.GESTURE_SMILE)))}),$e(ia.FINISHED,T=>{s&&s.id===T.questionId&&(h(T.answerCounts),o(!0),c(b=>(b&&clearTimeout(b),setTimeout(()=>f(),fa)))),p(new Map)}),$e(ia.QUESTION,T=>{e(T.id),n(T.question),o(!1),h(new Map),p(new Map),c(b=>{if(b&&clearTimeout(b),T.duration>0){const y=T.duration<1e3?fa:T.duration;return C(y),setTimeout(()=>f(),y)}return null})}),a.useEffect(()=>{const T=()=>{p(y=>{const w=[];if(y.forEach((F,U)=>{F.secondsLeft--,F.secondsLeft<=0&&w.push(U)}),w.length===0)return y;const O=new Map(y);return w.forEach(F=>O.delete(F)),O})},b=setInterval(()=>T(),1e3);return()=>clearInterval(b)},[]),a.useEffect(()=>()=>{c(T=>(T&&clearTimeout(T),null))},[]),{question:s,answerSent:r,answerCounts:u,userAnswers:m,vote:S,delay:I}},H1=B1;class ac{constructor(){this._blockFollowing=!1,this._blockFrs=!1,this._disableYT=!1,this._noItemFloor=!1}clone(){const e=new ac;return e._blockFollowing=this._blockFollowing,e._blockFrs=this._blockFrs,e._disableYT=this._disableYT,e._noItemFloor=this._noItemFloor,e}get blockFollowing(){return this._blockFollowing}set blockFollowing(e){this._blockFollowing=e}get blockFrs(){return this._blockFrs}set blockFrs(e){this._blockFrs=e}get disableYt(){return this._disableYT}set disableYt(e){this._disableYT=e}get noItemFloor(){return this._noItemFloor}set noItemFloor(e){this._noItemFloor=e}}const V1=()=>{const[i,e]=a.useState(!1),[s,n]=a.useState(0),[r,o]=a.useState(null),[l,c]=jE(),[u,h]=qE(),[m,p]=a.useState(),E=a.useCallback((I,C)=>{let f=!0;const S=r.clone();let T=!1;const b=m.clone();let y=C;switch(I){case"close_view":e(!1),f=!1;return;case"room_invites":S.roomInvites=y,B(new p_(S.roomInvites));break;case"camera_follow":S.cameraFollow=y,B(new g_(S.cameraFollow));break;case"system_volume":S.volumeSystem=C,S.volumeSystem=Math.max(0,S.volumeSystem),S.volumeSystem=Math.min(100,S.volumeSystem);break;case"furni_volume":S.volumeFurni=C,S.volumeFurni=Math.max(0,S.volumeFurni),S.volumeFurni=Math.min(100,S.volumeFurni);break;case"trax_volume":S.volumeTrax=C,S.volumeTrax=Math.max(0,S.volumeTrax),S.volumeTrax=Math.min(100,S.volumeTrax);break;case"block_following":T=!0,b.blockFollowing=y;break;case"block_frs":T=!0,b.blockFrs=y;break;case"disableYt":T=!0,b.disableYt=y;break;case"noItemFloor":T=!0,b.noItemFloor=y;break}f&&o(S),T&&(B(new UE(b)),p(b)),sl(S)},[r,m]),_=a.useCallback(I=>{switch(I){case"volume":B(new f_(Math.round(r.volumeSystem),Math.round(r.volumeFurni),Math.round(r.volumeTrax)));break}},[r]);return W(AE,I=>{const C=I.getParser(),f=new Kw,S=new ac;f.volumeSystem=C.volumeSystem,f.volumeFurni=C.volumeFurni,f.volumeTrax=C.volumeTrax,f.oldChat=C.oldChat,f.roomInvites=C.roomInvites,f.cameraFollow=C.cameraFollow,f.flags=C.flags,f.chatType=C.chatType,S.blockFollowing=C.blockFollowing,S.blockFrs=C.blockFrs,p(S),o(f),sl(f)}),a.useEffect(()=>{const I={linkReceived:C=>{const f=C.split("/");if(!(f.length<2))switch(f[1]){case"show":e(!0);return;case"hide":e(!1);return;case"toggle":e(S=>!S);return}},eventUrlPrefix:"user-settings/"};return dt(I),()=>ht(I)},[]),a.useEffect(()=>{r&&At(r)},[r]),{isVisible:i,userSettings:r,setUserSettings:o,saveRangeSlider:_,processAction:E,setCatalogPlaceMultipleObjects:c,catalogPlaceMultipleObjects:l,catalogSkipPurchaseConfirmation:u,setCatalogSkipPurchaseConfirmation:h,activeTab:s,setActiveTab:n,tonSettings:m}},$r=()=>Qe(V1),W1=()=>{const[i,e]=a.useState(null),[s,n]=a.useState(null),{setUserSettings:r}=$r(),[o,l]=a.useState(0),[c,u]=a.useState(0),[h,m]=ji("nitro.screensize",{width:window.innerWidth,height:window.innerHeight}),[p,E]=a.useState(0),[_,I]=a.useState([]),C=T=>{r(b=>(b.chatType=T,b)),B(new Ff(T))},f=T=>{J().giveRespect(T),l(J().respectsLeft)},S=T=>{J().givePetRespect(T),u(J().respectsPetLeft)};return W(Nl,T=>{const b=T.getParser();e(b.userInfo),n(b.userInfo.figure),l(b.userInfo.respectsRemaining),u(b.userInfo.respectsPetRemaining)}),W(Md,T=>{const b=T.getParser();n(b.figure)}),W(wE,T=>{const b=T.getParser();I(b.commands)}),a.useEffect(()=>{const T=G_("nitro.screensize");if(T&&(T.width!==window.innerWidth||T.height!==window.innerHeight)){let y=window.localStorage.length;for(;y>0;){const w=window.localStorage.key(y);w&&w.startsWith("nitro.window")&&window.localStorage.removeItem(w),y--}}const b=y=>m({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",b),()=>{window.removeEventListener("resize",b)}},[m]),W(ec,T=>{const b=T.getParser();E(b.count)}),{userInfo:i,userFigure:s,userRespectRemaining:o,petRespectRemaining:c,respectUser:f,respectPet:S,updateChatStyleId:C,commands:_,onlineCount:p}},dn=()=>Qe(W1),j1=i=>a.useEffect(i,[]),Vs=i=>j1(()=>i()),_a=i=>{const{skin:e=0,title:s="",colour:n=L.primary_blue,closeable:r=!0,draggable:o=!0,modal:l=!1,onCloseClick:c=null,uniqueKey:u=null,handleSelector:h=".drag-handler",windowPosition:m=tt.CENTER,disableDrag:p=!1,overflow:E="hidden",position:_="relative",gap:I=0,classNames:C=[],children:f=null,offsetLeft:S=0,offsetTop:T=0,innerRef:b=null,visible:y=!0,...w}=i,[O,F]=a.useState(!1),U=a.useRef(),j=a.useRef(),x=a.useRef(),M=a.useRef(),G=a.useMemo(()=>{const q=["ton-frame"];return C.length&&q.push(...C),O||q.push("opacity-0"),q},[C,O]),H=a.useCallback((q,Z=!1)=>q&&!q.current?null:Z?document.defaultView.getComputedStyle(q.current).backgroundImage.replace('url("',"").replace('")',""):document.defaultView.getComputedStyle(q.current).borderImageSource.replace('url("',"").replace('")',""),[]);a.useEffect(()=>{U&&U.current&&(b&&(b.current=U.current),j.current=U.current)},[U,j,b]);const Y=a.useCallback(async()=>{j&&j.current&&H(j)&&await vn(H(j),n).then(q=>{j.current.style.borderImageSource=`url(${q})`}).catch(()=>{}),x&&x.current&&H(x,!0)&&await vn(H(x,!0),n).then(q=>{x.current.style.backgroundImage=`url(${q})`}).catch(()=>{}),M&&M.current&&H(M,!0)&&await vn(H(M,!0),n).then(q=>{M.current.style.backgroundImage=`url(${q})`}).catch(()=>{}),setTimeout(()=>F(!0),0)},[H,n,x,M,j]);return Vs(()=>{Y()}),d(v,{innerRef:U,overflow:E,position:_,gap:I,classNames:G,"data-style":e,...w,children:[s&&d(R,{children:[t(R,{className:"ton-frame-header-bg w-100 drag-handler","data-style":e,innerRef:x,children:t(P,{className:"ton-frame-header-text","data-style":e,innerRef:M,children:s})}),r&&t(P,{className:"ton-frame-close cursor-pointer","data-style":e,onClick:c})]}),f]})},le=i=>{const{skin:e=0,title:s="",colour:n=L.primary_blue,closeable:r=!0,draggable:o=!0,modal:l=!1,onCloseClick:c=null,uniqueKey:u=null,handleSelector:h=".drag-handler",windowPosition:m=tt.CENTER,disableDrag:p=!1,overflow:E="hidden",position:_="relative",gap:I=0,classNames:C=[],children:f=null,offsetLeft:S=0,offsetTop:T=0,innerRef:b=null,...y}=i,w=a.useRef(null),O=a.useCallback(()=>{let F={};return w&&w.current&&(F["--frame-width"]=w.current.clientWidth+"px",F["--frame-height"]=w.current.clientHeight+"px"),F},[w]);return{...O()},{...i},o?t(vs,{uniqueKey:u,handleSelector:h,windowPosition:m,disableDrag:!o,offsetLeft:S,offsetTop:T,dragStyle:{...O()},modal:l,children:t(_a,{...i,innerRef:w})}):t(_a,{...i})},Go=i=>{const{title:e="",onClose:s=null,classNames:n=[],children:r=null,type:o=fe.DEFAULT,...l}=i,c=a.useMemo(()=>{const u=["nitro-alert"];return u.push("nitro-alert-"+o),n.length&&u.push(...n),u},[n,o]);return t(le,{colour:L.quaternary_grey,onCloseClick:s,title:e,classNames:c,...l,children:r})};class Et{}Et.BOUNCE="bounce";Et.SLIDE_LEFT="slideLeft";Et.SLIDE_RIGHT="slideRight";Et.FLIP_X="flipX";Et.FADE_IN="fadeIn";Et.FADE_IN_LEFT="fadeInLeft";Et.FADE_DOWN="fadeDown";Et.FADE_UP="fadeUp";Et.HEAD_SHAKE="headShake";function q1(i,e,s=300){switch(i){case Et.BOUNCE:switch(e){default:return{};case gn:return{animationName:"bounceIn",animationDuration:`${s}ms`};case Pn:return{animationName:"bounceOut",animationDuration:`${s}ms`}}case Et.SLIDE_LEFT:switch(e){default:return{};case gn:return{animationName:"slideInLeft",animationDuration:`${s}ms`};case Pn:return{animationName:"slideOutLeft",animationDuration:`${s}ms`}}case Et.SLIDE_RIGHT:switch(e){default:return{};case gn:return{animationName:"slideInRight",animationDuration:`${s}ms`};case Pn:return{animationName:"slideOutRight",animationDuration:`${s}ms`}}case Et.FLIP_X:switch(e){default:return{};case gn:return{animationName:"flipInX",animationDuration:`${s}ms`};case Pn:return{animationName:"flipOutX",animationDuration:`${s}ms`}}case Et.FADE_UP:switch(e){default:return{};case gn:return{animationName:"fadeInUp",animationDuration:`${s}ms`};case Pn:return{animationName:"fadeOutDown",animationDuration:`${s}ms`}}case Et.FADE_IN_LEFT:switch(e){default:return{};case gn:return{animationName:"fadeInLeft",animationDuration:`${s}ms`};case Pn:return{animationName:"fadeOutLeft",animationDuration:`${s}ms`}}case Et.FADE_IN:switch(e){default:return{};case gn:return{animationName:"fadeIn",animationDuration:`${s}ms`};case Pn:return{animationName:"fadeOut",animationDuration:`${s}ms`}}case Et.FADE_DOWN:switch(e){default:return{};case gn:return{animationName:"fadeInDown",animationDuration:`${s}ms`};case Pn:return{animationName:"fadeOutUp",animationDuration:`${s}ms`}}case Et.HEAD_SHAKE:switch(e){default:return{};case gn:return{animationName:"headShake",animationDuration:`${s}ms`}}}return null}const Vn=i=>{const{type:e=null,inProp:s=!1,timeout:n=300,className:r=null,children:o=null}=i,[l,c]=a.useState(!1);return a.useEffect(()=>{let u=null;return s?c(!0):u=setTimeout(()=>{c(!1),clearTimeout(n)},n),()=>{u&&clearTimeout(u)}},[s,n]),t(DI,{in:s,timeout:n,children:u=>t("div",{className:(r??"")+" animate__animated",style:{...q1(e,u,n)},children:l&&o})})},eI=i=>{const{fadesOut:e=!0,timeoutMs:s=8e3,onClose:n=null,overflow:r="hidden",classNames:o=[],skin:l=4,colour:c=L.secondary_grey,opacity:u=0,...h}=i,[m,p]=a.useState(!1),E=a.useMemo(()=>{const _=["nitro-notification-bubble","p-1"];return o.length&&_.push(...o),_},[o]);return a.useEffect(()=>(p(!0),()=>p(!1)),[]),a.useEffect(()=>{if(!e)return;const _=setTimeout(()=>{p(!1),setTimeout(()=>n(),300)},s);return()=>clearTimeout(_)},[e,s,n]),t(Vn,{type:Et.SLIDE_RIGHT,inProp:m,timeout:300,children:t(V,{skin:l,colour:c,opacity:u,onClick:n,classNames:E,column:!1,...h})})},Tn=i=>{const{figure:e="",typeId:s=-1,paletteId:n=-1,petColor:r=16777215,customParts:o=[],posture:l="std",headOnly:c=!1,direction:u=0,scale:h=1,style:m={},...p}=i,[E,_]=a.useState(null),[I,C]=a.useState(0),[f,S]=a.useState(0),T=a.useRef(!1),b=a.useMemo(()=>{let y={};return E&&E.length&&(y.backgroundImage=`url(${E})`),h!==1&&(y.transform=`scale(${h})`,h%1||(y.imageRendering="pixelated")),y.width=I,y.height=f,Object.keys(m).length&&(y={...y,...m}),y},[E,h,m,I,f]);return a.useEffect(()=>{let y=s,w=n,O=r,F=o,U=c;if(e&&e.length){const x=new Ur(e);y=x.typeId,w=x.paletteId,O=x.color,F=x.customParts}y===16&&(U=!1);const j=X().getRoomObjectPetImage(y,w,O,new Lt(u*45),64,{imageReady:(x,M,G)=>{T.current||(G?(_(G.src),C(G.width),S(G.height)):M&&(_(ln.generateImageUrl(M)),C(M.width),S(M.height)))},imageFailed:x=>{}},U,0,F,l);if(j){const x=j.getImage();x&&(_(x.src),C(x.width),S(x.height))}},[e,s,n,r,o,l,c,u]),a.useEffect(()=>(T.current=!1,()=>{T.current=!0}),[]),t(P,{classNames:["pet-image"],style:b,...p})},lc=i=>{const{level:e=0,classNames:s=[],children:n=null,...r}=i,o=a.useMemo(()=>{const l=["nitro-rarity-level"];return s.length&&l.push(...s),l},[s]);return d(P,{classNames:o,...r,children:[t("div",{children:e}),n]})},zi=i=>{const{roomPreviewer:e=null,height:s=0,fullHeight:n=!1,children:r=null,bg:o=L.white}=i,[l,c]=a.useState(null),u=a.useRef(),h=m=>{e&&(m.shiftKey?e.changeRoomObjectDirection():e.changeRoomObjectState())};return a.useEffect(()=>{if(!e)return;const m=E=>{!e||!l||!u.current||(e.updatePreviewRoomView(),l.canvasUpdated&&(u.current.style.backgroundImage=`url(${ln.generateImageUrl(l.master)})`))};if(!l&&u.current&&e){let _=document.defaultView.getComputedStyle(u.current,null).backgroundColor;_=Qs.rgbStringToHex(_),_=_.replace("#","0x"),e.backgroundColor=parseInt(_,16);const I=u.current.parentElement.clientWidth;e.getRoomCanvas(I,s);const C=e.getRenderingCanvas();c(C),C.canvasUpdated=!0,m()}Nn().add(m);const p=new ResizeObserver(()=>{if(!e||!u.current)return;const E=u.current.parentElement.offsetWidth,_=u.current.parentElement.offsetHeight;e.modifyRoomCanvas(E,_),m()});return p.observe(u.current),()=>{p.disconnect(),Nn().remove(m)}},[l,e,u,s]),d("div",{className:"room-preview-container h-100 position-relative",children:[t("div",{ref:u,className:"room-preview-image",style:{height:n?"100%":s},onClick:h}),r,t(V,{skin:100,className:"top-0 bottom-0 start-0 end-0 pointer-events-none",position:"absolute"})]})},Ki=i=>{const{roomId:e=-1,customUrl:s=null,shrink:n=!0,overflow:r="hidden",classNames:o=[],children:l=null,colour:c="#FFFFFF",...u}=i,[h,m]=a.useState(!1),p=a.useMemo(()=>{const _=["room-thumbnail","position-relative"];return o.length&&_.push(...o),_},[o]),E=a.useMemo(()=>s&&s.length?ee("image.library.url")+s:ee("thumbnails.url").replace("%thumbnail%",e.toString()),[s,e]);return d(P,{shrink:n,overflow:r,classNames:p,...u,children:[d(R,{overflow:"hidden",fullHeight:!0,fullWidth:!0,justifyContent:"center",children:[t(V,{skin:100,colour:c}),E&&!h&&t("img",{alt:"",className:"thumbnail-image-ton",src:E,onError:()=>{m(!0)}})]}),l,t(V,{opacity:127,skin:4,className:"thumbnail-glow"})]})},tI=i=>{const{color:e="",message:s="",date:n="",senderName:r="",customTitle:o=null,onCloseClick:l=null}=i;return t(vs,{handleSelector:".drag-handler",children:d(v,{gap:0,alignItems:"center",className:`nitro-layout-trophy trophy-${e}`,children:[d(R,{center:!0,fullWidth:!0,position:"relative",className:"trophy-header drag-handler",children:[t(P,{position:"absolute",pointer:!0,className:"trophy-close",onClick:l}),t(N,{className:"volter-bold",children:g("widget.furni.trophy.title")})]}),d(v,{className:"trophy-content p-1",gap:1,children:[o&&t(N,{bold:!0,children:o}),s]}),d(R,{alignItems:"center",justifyContent:"between",className:"trophy-footer mt-1",children:[t(N,{className:"volter-bold",children:n}),t(N,{className:"volter-bold",children:r})]})]})})},bs=i=>{const{userId:e=0,userName:s=null,classNames:n=[],pointer:r=!0,children:o=null,...l}=i,c=a.useMemo(()=>{const u=["nitro-friends-spritesheet","icon-profile-sm"];return n.length&&u.push(...n),u},[n]);return t(P,{classNames:c,pointer:r,onClick:u=>ps(e),...l,children:o})},N=i=>{const{variant:e="black",fontWeight:s=null,fontSize:n=0,align:r=null,bold:o=!1,underline:l=!1,italics:c=!1,truncate:u=!1,center:h=!1,textEnd:m=!1,small:p=!1,wrap:E=!1,noWrap:_=!1,textBreak:I=!1,...C}=i,f=a.useMemo(()=>{const S=["d-inline"];return e&&S.push("text-"+e),o&&S.push("volter-bold"),s&&S.push("fw-"+s),n&&S.push("fs-"+n),r&&S.push("text-"+r),l&&S.push("text-decoration-underline"),c&&S.push("fst-italic"),u&&S.push("text-truncate"),h&&S.push("text-center"),m&&S.push("text-end"),p&&S.push(""),E&&S.push("text-wrap"),_&&S.push("text-nowrap"),I&&S.push("text-break"),S},[e,s,n,r,o,l,c,u,h,m,p,E,_,I]);return t(P,{classNames:f,...C})};class Y1{constructor(e){this.leftClouds=[],this.rightClouds=[],this.images=new Map;let{body:s}=e;this._options=e,this.body=s,s.style.display="flex",s.style.overflow="hidden",s.style.position="relative"}async setupDesktop(){let e=this._options,s=this.loadImage(e.splitImage,"split"),n=this.loadImage(e.viewImage,"view"),r=this.loadImage(e.rightImage,"right"),o=this.loadImage(e.rightRepeatImage,"rightRepeat"),l=this.loadImage(e.sunImage,"sun"),c=this.loadImage(e.drapeImage,"drape"),u=this.loadImage(e.clouds.small,"cloudSM"),h=this.loadImage(e.clouds.smallFlipped,"cloudSM2"),m=this.loadImage(e.clouds.med,"cloudLG"),p=this.loadImage(e.clouds.medFlipped,"cloudLG2");try{e.splitImage&&(await s.decode(),this.splitLeft=document.createElement("div"),this.splitLeft.style.width=s.width+"px",this.splitLeft.style.zIndex="1",this.splitLeft.style.height="100%",this.splitLeft.style.position="absolute",this.splitLeft.style.overflow="hidden",this.splitLeft.style.backgroundImage=`url(${this.getBase64Image(s)})`,this.splitRight=document.createElement("div"),this.splitRight.style.width="calc(100% - "+s.width+"px)",this.splitRight.style.height="100%",this.splitRight.style.position="absolute",this.splitRight.style.zIndex="2",this.splitRight.style.backgroundColor=e.color,this.splitRight.style.left=s.width+"px",this.splitRight.style.overflow="hidden",this.body.appendChild(this.splitLeft),this.body.appendChild(this.splitRight)),e.viewImage&&(await n.decode(),this.body.appendChild(this.images.get("view")),this.images.get("view").style.zIndex="10",this.images.get("view").style.alignSelf="end",this.images.get("view").style.position="absolute",this.images.get("view").style.bottom="0",this.body.style.setProperty("--hotelview-left-height",this.images.get("view").height+"px")),e.rightImage&&(await r.decode(),this.body.appendChild(this.images.get("right")),this.images.get("right").style.position="absolute",this.images.get("right").style.right=-this.images.get("right").width+"px",this.images.get("right").style.bottom="0",this.images.get("right").style.zIndex="9",this.images.get("right").style.transition="right 1.3s"),e.rightRepeatImage&&(await o.decode(),this.body.appendChild(this.images.get("rightRepeat")),this.images.get("rightRepeat").style.position="absolute",this.images.get("rightRepeat").style.right=-this.images.get("rightRepeat").width+"px",this.images.get("rightRepeat").style.bottom="0",this.images.get("rightRepeat").style.top="0",this.images.get("rightRepeat").style.zIndex="8",this.images.get("rightRepeat").style.transition="right 1s"),e.sunImage&&(await l.decode(),this.body.appendChild(this.images.get("sun")),this.images.get("sun").style.position="absolute",this.images.get("sun").style.right="0",this.images.get("sun").style.left=this.splitLeft.clientWidth+"px",this.images.get("sun").style.zIndex="7"),e.drapeImage&&(await c.decode(),this.body.appendChild(this.images.get("drape")),this.images.get("drape").style.position="absolute",this.images.get("drape").style.left="0",this.images.get("drape").style.top=-this.images.get("drape").height+"px",this.images.get("drape").style.zIndex="10",this.images.get("drape").style.transition="top 1s"),e.clouds.enabled&&(await u.decode(),await h.decode(),await m.decode(),await p.decode()),setTimeout(()=>{this.images.get("drape").style.top=0+"px",this.images.get("right").style.right=0+"px",this.images.get("rightRepeat").style.right=0+"px"},10),e.clouds.enabled&&(this.drawCloud(),this.ticker=setInterval(()=>{this.tick()},65))}catch(E){console.log(E)}}drawCloud(){let e=Math.round(Math.random()),s=Math.floor(Math.random()*(this.body.clientHeight-this.images.get("view").height/2))+100,n=this.images.get(e?"cloudSM":"cloudLG").cloneNode();n.style.position="absolute",n.style.top=s+"px",n.style.left=-this.images.get(e?"cloudSM":"cloudLG").width+"px";let r=this.images.get(e?"cloudSM2":"cloudLG2").cloneNode();r.style.position="absolute",r.style.top=s-this.splitLeft.clientWidth+(e?-29:-66)+this.images.get(e?"cloudSM2":"cloudLG2").width+"px",r.style.left=-(this.splitLeft.clientWidth+this.images.get(e?"cloudSM2":"cloudLG2").width)+"px",r.style.filter="brightness(0.95)",this.leftClouds.push(n),this.rightClouds.push(r),this.splitLeft.appendChild(n),this.splitRight.appendChild(r)}tick(){Math.floor(Math.random()*50)==10&&this.drawCloud(),this.leftClouds.forEach(e=>{e.style.left=parseInt(e.style.left)+2+"px",e.style.top=parseInt(e.style.top)-1+"px",parseInt(e.style.left)>this.splitLeft.clientWidth+e.clientWidth&&e.remove()}),this.rightClouds.forEach(e=>{e.style.left=parseInt(e.style.left)+2+"px",e.style.top=parseInt(e.style.top)+1+"px",parseInt(e.style.left)>this.splitRight.clientWidth+e.clientWidth&&e.remove()})}getBase64Image(e,s=!1){var n=document.createElement("canvas");n.width=e.width,n.height=e.height;var r=n.getContext("2d",{willReadFrequently:!0});s&&(r.translate(e.width,0),r.scale(-1,1)),r.drawImage(e,0,0),document.body.appendChild(n);var o=n.toDataURL();return o}loadImage(e,s){let n=new Image;return n.crossOrigin="anonymous",n.src=e,n.onerror=()=>{console.log("Failed to load :"+e)},this.images.set(s,n),n}setBody(e){this.body=e}dispose(){this.ticker&&clearInterval(this.ticker)}}const z1=()=>{const{userFigure:i=null,userInfo:e}=dn();return d(z,{children:[e&&d(V,{skin:4,className:"landing-user-info",opacity:75,children:[t("div",{className:"ubuntu-bold",children:g("landing.view.generic.welcome.title",["username"],[e.username])}),t("small",{children:g("landing.view.generic.welcome.content",["lastlogin"],[e.lastAccessedDate])})]}),t("div",{className:"avatar-image",children:t(it,{figure:i,direction:2})})]})},K1=i=>{var o,l;a.useState(null);const[e,s]=a.useState(0),{getCategory:n}=Kn(),r=a.useMemo(()=>{var c;return(c=n(-1))==null?void 0:c.articles},[n]);return a.useEffect(()=>{let c=null;if(!r)return;const u=()=>{s(h=>{let m=h;return m>=r.length-1?0:m+1}),c=setTimeout(()=>u(),4e3)};return c=setTimeout(()=>u(),4e3),()=>{clearInterval(c)}},[r]),r?t(P,{className:"promo-articles ton-news",children:t(R,{column:!0,className:"ton-news-bg transparent text-black",overflow:"hidden",fit:!0,children:d(R,{column:!0,className:"p-2",gap:1,children:[t(R,{children:r&&r.length>0&&r.map((c,u)=>t("div",{className:"promo-articles-bullet cursor-pointer "+(c===r[e]?"promo-articles-bullet-active":""),onClick:h=>s(u)},c.id))}),r&&r[e]&&d(R,{className:"promo-article",fullHeight:!0,overflow:"hidden",children:[t("div",{className:"promo-article-image flex-shrink-0"}),d(R,{fullHeight:!0,column:!0,overflow:"hidden",children:[d(P,{className:"mb-1",children:[t("h3",{className:"my-0 ubuntu-bold",children:(o=r[e])==null?void 0:o.caption}),t("b",{children:(l=r[e])==null?void 0:l.description})]}),t(D,{className:"align-self-start mt-2",skin:5,onClick:c=>oe(`habboUI/open/news/article/${r[e].id}`),children:g("generic.read.more")})]})]})]})})}):null},$1=i=>{const{conf:e=null,slot:s=0}=i,[n,r]=a.useState(0),[o,l]=a.useState(0),[c,u]=a.useState(0),h=a.useCallback(_=>{const C=e[_];if(!C)return null;switch(_){case"image":return Nt.interpolate(C)}return C},[e]),m=_=>{const I=_*1e3-Date.now(),C=Math.floor(I/1e3%60),f=Math.floor(I/1e3/60%60),S=Math.floor(I/(1e3*60*60)%24);r(S),l(f),u(C)},p=(_=!1)=>d(R,{gap:1,className:"mx-1 text-white ubuntu-bold "+(_?"float-right":""),children:[d("div",{className:"text-center",children:[t(V,{skin:3,colour:L.tertiary_grey,children:n.toString().padStart(2,"0")}),t("small",{className:"text-black",children:g("countdown_clock_unit_hours")})]}),":",d("div",{className:"text-center",children:[t(V,{skin:3,colour:L.tertiary_grey,children:o.toString().padStart(2,"0")}),t("small",{className:"text-black",children:g("countdown_clock_unit_minutes")})]}),":",d("div",{className:"text-center",children:[t(V,{skin:3,colour:L.tertiary_grey,children:c.toString().padStart(2,"0")}),t("small",{className:"text-black",children:g("countdown_clock_unit_seconds")})]})]}),E=a.useMemo(()=>{let _=[];return h("timer")||_.push("d-flex"),s>=4&&!h("timer")&&_.push("flex-column"),_.join(" ")},[]);return a.useEffect(()=>{let _=null,I=h("timer");return m(I),h("timer")&&(_=setInterval(()=>{I--,m(I)},1e3)),()=>{clearInterval(_)}},[h,r,l,u]),t(R,{className:"widgetcontainer widget "+(h("background")?"has-background ":"")+(s>=4?"smaller-widget":"w-100"),style:{backgroundImage:h("background")?`url(${Nt.interpolate(h("background"))})`:""},column:!0,alignItems:"center",children:d("div",{className:"align-self-center w-100",children:[h("heading")&&t(z,{children:d("div",{className:"d-flex flex-row align-items-center w-100 mb-1",children:[d(R,{className:"w-100 align-items-center align-self-base",children:[t("small",{className:"flex-shrink-0 pe-1 mb-auto",dangerouslySetInnerHTML:{__html:g(h("heading"))}}),t("hr",{className:"w-100 my-0"})]}),h("timer")&&p()]})}),d("div",{className:E,children:[h("imageLeft")&&t("div",{className:"widgetcontainer-image flex-shrink-0",style:{backgroundImage:h("imageLeft")?`url(${Nt.interpolate(h("imageLeft"))})`:""}}),d("div",{className:"d-flex flex-column w-100 "+(h("subHeader")?"align-self-center":""),children:[h("subHeader")&&t("h3",{className:"my-0 ubuntu-bold",dangerouslySetInnerHTML:{__html:g(h("subHeader"))}}),h("timer")&&!h("heading")&&p(!0),h("bodyText")&&t("div",{className:"mb-3",dangerouslySetInnerHTML:{__html:g(h("bodyText").replaceAll("\\n","</br>"))}}),h("btnText")&&h("btnLink")&&s<4&&t(D,{skin:5,onClick:_=>ir(h("btnLink")),dangerouslySetInnerHTML:{__html:g(h("btnText"))},className:h("background")?"":"align-self-center"})]}),h("imageRight")&&t("div",{className:"widgetcontainer-image flex-shrink-0",style:{backgroundImage:h("imageRight")?`url(${Nt.interpolate(h("imageRight"))})`:""}}),h("btnText")&&h("btnLink")&&s>=4&&t(D,{skin:5,onClick:_=>ir(h("btnLink")),dangerouslySetInnerHTML:{__html:g(h("btnText"))},className:"mt-1 w-100"+(h("background")?"":"align-self-center")})]}),h("divider")&&t("hr",{className:"w-100 mb-1"})]})})},Q1=i=>{switch(i.widgetType){case"promoarticle":return t(K1,{});case"widgetcontainer":return t($1,{conf:i.widgetConf,slot:i.slot});default:return null}},pr=i=>{const{widgetType:e=null,widgetSlot:s=0,widgetConf:n=null,className:r="",...o}=i;return t("div",{className:`widget-slot slot-${s} ${r||""}`,...o,children:t(Q1,{widgetType:e,slot:s,widgetConf:n})})},X1=()=>{const i=a.useRef(null),e=(n,r=null)=>r?e(n)[`slot.${n}.${r}`]:ee("hotelview").widgets,s=a.useMemo(()=>{let n={};return n["--font-colour"]=ee("hotelview").images["font.colour"]||"#000000",n["--font-etching"]=ee("hotelview").images["font.etching"]||"0 1px white",n},[]);return t("div",{className:"landing-widgets",ref:i,style:s,children:t("div",{className:"py-4",children:d(R,{gap:4,children:[d(R,{column:!0,gap:3,children:[t(pr,{widgetSlot:1,widgetType:e(1,"widget"),widgetConf:e(1,"conf")}),t(pr,{widgetSlot:2,widgetType:e(2,"widget"),widgetConf:e(2,"conf")}),t(pr,{widgetSlot:3,widgetType:e(3,"widget"),widgetConf:e(3,"conf")})]}),d(R,{column:!0,gap:3,children:[t(pr,{widgetSlot:4,widgetType:e(4,"widget"),widgetConf:e(4,"conf")}),t(pr,{widgetSlot:5,widgetType:e(5,"widget"),widgetConf:e(5,"conf")}),t(pr,{widgetSlot:6,widgetType:e(6,"widget"),widgetConf:e(6,"conf")})]})]})})})},J1=i=>{const{limited:e=!1,visible:s=!0}=i,[n,r]=a.useState(null),o=a.useRef(),l=ee("hotelview").images["background.colour"],c=Nt.interpolate(ee("hotelview").images.background),u=Nt.interpolate(ee("hotelview").images.sun),h=Nt.interpolate(ee("hotelview").images.drape),m=Nt.interpolate(ee("hotelview").images.left),p=Nt.interpolate(ee("hotelview").images["left.repeat"]),E=Nt.interpolate(ee("hotelview").images["left.horizon"]),_=Nt.interpolate(ee("hotelview").images["right.repeat"]),I=Nt.interpolate(ee("hotelview").images.right),C=Nt.interpolate(ee("hotelview").images["cloud.small"]),f=Nt.interpolate(ee("hotelview").images["cloud.smallFlipped"]),S=Nt.interpolate(ee("hotelview").images["cloud.med"]),T=Nt.interpolate(ee("hotelview").images["cloud.medFlipped"]);return a.useEffect(()=>(o&&o.current&&!n&&r(new Y1({body:o.current,color:l,splitImage:c,viewImage:m,rightImage:I,rightRepeatImage:_,sunImage:u,drapeImage:h,clouds:{enabled:!0,small:C,med:S,smallFlipped:f,medFlipped:T}})),()=>{n&&n.dispose()}),[c,l,S,T,n,C,f,h,m,I,_,u]),a.useEffect(()=>{o&&o.current&&n&&n.setBody(o.current),n&&s&&n.setupDesktop(),n&&!s&&n.dispose()},[n,s]),d("div",{className:"nitro-hotel-view",children:[d("div",{ref:o,className:"h-100 w-100 position-absolute top-0 bottom-0 pointer-events-none",children:[t("div",{className:"left-repeat",style:{backgroundImage:`url(${p})`}}),t("div",{className:"left-horizon",style:{backgroundImage:`url(${E})`}})]}),!e&&d(z,{children:[t(X1,{}),t(z1,{})]})]})},Z1=i=>{const{isError:e=!1,message:s="",percent:n=0,isAuth:r=!0}=i,o=a.useMemo(()=>{let l={};return l["--loading-percent"]=n.toFixed()+"%",l},[n]);return!r&&!e?null:t(R,{alignItems:"center",justifyContent:"center",classNames:["nitro-loading"],children:d(V,{skin:4,colour:L.tertiary_grey,style:o,className:"px-2 py-4 nitro-loading-inner",children:[t(P,{className:"logo"}),t(v,{size:6,className:"text-center mt-1 mx-auto",children:e&&s&&s.length?t(P,{className:"text-shadow volter-bold text-center",children:s}):d(z,{children:[t(P,{className:"loading-bar"}),t(N,{variant:"white",children:"Please Wait! Hive is loading..."})]})})]})})},eU=i=>{const{collection:e,selectedCollection:s=-1}=i,{resetCount:n}=Vi(),[r,o]=a.useState(!1),l=()=>{let c=L.light_grey;return e.hasStarted&&(c=L.lighter_yellow),e.hasCompleted&&(c=L.green),c};return a.useEffect(()=>{e.captionSave==s?o(!0):o(!1)},[s,e]),a.useEffect(()=>{r&&n(e.captionSave)},[r,e,n]),e?d(V,{colour:l(),fullWidth:!0,grow:!1,className:"text-black",children:[d(R,{gap:1,fullWidth:!0,pointer:!0,onClick:c=>o(!r),alignItems:"center",justifyContent:"between",position:"relative",children:[d(R,{gap:1,alignItems:"center",fullWidth:!0,children:[t("i",{className:"icon cursor-pointer flex-shrink-0 "+(r?"icon-minus":"icon-plus")}),d(v,{gap:1,fullWidth:!0,position:"relative",children:[d(N,{className:"volter-bold w-auto",position:"relative",children:[e.caption,e.unread>0&&t(qn,{count:e.unread})]}),t(N,{children:e.description})]})]}),t(P,{className:"ton-collections-prize flex-shrink-0",style:{backgroundImage:`url(${ee("image.library.url")+e.prizeImage})`}})]}),r&&e.items.map((c,u)=>d(P,{children:[t("hr",{className:"my-1 mb-2 text-black"}),d(R,{fullWidth:!0,alignItems:"center",gap:1,children:[t("i",{className:"icon "+(c.hasCollected?"icon-checkmark":"icon-x")}),t(N,{children:c.caption})]})]},u))]}):null},tU=()=>{const{campaigns:i,visible:e,setVisible:s,selectedCampaign:n,setSelectedCampaign:r,getCampaign:o,selectedCollection:l,getSortedCollections:c}=Vi(),[u,h]=a.useState(0);Vs(()=>{B(new sc("collections/request"))});const m=a.useMemo(()=>{if(!i)return[];let p=[];for(let E of i)p.push({index:p.length,value:E.code,caption:"collections."+E.code+".title"});return p},[i]);return a.useEffect(()=>{let E=(_=>{let I=null;for(let C of m)C.index==_&&(I=C);return I})(u);E&&r(o(E.value))},[o,m,u,r]),!i||!e?null:t(le,{title:g("window.collections.title"),className:"ton-collections",onCloseClick:p=>s(!1),children:d(V,{fullHeight:!0,fullWidth:!0,gap:1,overflow:"hidden",children:[m.length>0&&t(es,{fullWidth:!0,options:m,selectedIndex:u,changeIndex:p=>h(p)}),t(v,{gap:1,className:"overflow-y-auto",fullHeight:!0,children:c()&&c().map((p,E)=>t(eU,{collection:p,selectedCollection:l},E))})]})})},jt=i=>{const{itemImage:e=void 0,avatarImage:s=!1,itemColor:n=void 0,itemActive:r=!1,itemCount:o=1,itemCountMinimum:l=1,itemUniqueSoldout:c=!1,itemUniqueNumber:u=-2,itemUnseen:h=!1,itemHighlight:m=!1,disabled:p=!1,center:E=!0,column:_=!0,style:I={},classNames:C=[],position:f="relative",overflow:S="hidden",children:T=null,catalogue:b=!1,index:y=-1,...w}=i,[O,F]=a.useState(!1),U=a.useMemo(()=>{const M=["ton-inventory-grid-item"];return(c||u>0)&&M.push("unique-item"),c&&M.push("sold-out"),h&&M.push("unseen"),n&&M.push("border"),m&&M.push("has-highlight"),p&&M.push("disabled"),(e===null&&!s||!O)&&M.push("icon","loading-icon"),C.length&&M.push(...C),M},[c,u,h,m,p,n,e,C,s,O]),j=a.useMemo(()=>{let M={...I};return e&&!(c||u>0)&&O&&(M.backgroundImage=`url(${e})`),n&&(M.backgroundColor=n),Object.keys(I).length&&(M={...M,...I}),M},[I,e,n,c,u,O]),x=a.useMemo(()=>h?L.green:r?L.infostand_light_grey:L.light_grey,[h,r]);return a.useEffect(()=>{F(!0)},[y]),t(V,{skin:3,colour:x,className:"p-0",column:!0,children:d(v,{center:E,pointer:!0,position:f,overflow:S,column:_,classNames:U,style:j,...w,children:[o>l&&t(qn,{count:(b?"x":"")+o,skin:b?4:6}),u>0&&d(z,{children:[t(P,{fit:!0,className:"unique-bg-override",style:{backgroundImage:`url(${e})`}}),t("div",{className:"position-absolute bottom-0 unique-item-counter",children:t(lr,{value:u})})]}),T]})})},sI=i=>{const{achievement:e=null,scale:s=1,index:n=-1,...r}=i;return e?t(ot,{badgeCode:ms.getAchievementBadgeCode(e),isGrayscale:!ms.getAchievementHasStarted(e),scale:s,localIndex:n,...r}):null},sU=i=>{const{achievement:e=null,index:s=-1}=i,{selectedAchievement:n=null,setSelectedAchievementId:r=null}=Bi();return e?t(jt,{itemActive:n===e,itemUnseen:e.unseen>0,onClick:o=>r(e.achievementId),children:t(sI,{achievement:e,index:s})}):null},nU=i=>{const{achievements:e=null}=i;return t(qe,{columnCount:6,columnMinWidth:50,columnMinHeight:50,children:e&&e.length>0&&e.map((s,n)=>t(sU,{achievement:s,index:n},n))})},rU=i=>{const{achievement:e=null}=i;return e?d(R,{shrink:!0,className:"text-black",gap:2,overflow:"hidden",children:[d(v,{center:!0,gap:1,children:[t(sI,{className:"nitro-achievements-badge-image",achievement:e,scale:2}),t(N,{bold:!0,children:g("achievements.details.level",["level","limit"],[ms.getAchievementLevel(e).toString(),e.levelCount.toString()])})]}),d(v,{fullWidth:!0,justifyContent:"center",overflow:"hidden",children:[d(v,{gap:1,children:[t(N,{bold:!0,truncate:!0,children:yo(ms.getAchievementBadgeCode(e))}),t(N,{textBreak:!0,children:Yl(ms.getAchievementBadgeCode(e))})]}),(e.levelRewardPoints>0||e.scoreLimit>0)&&d(v,{gap:1,children:[e.levelRewardPoints>0&&d(R,{alignItems:"center",gap:1,children:[t(N,{truncate:!0,children:g("achievements.details.reward")}),d(R,{center:!0,gap:1,children:[e.levelRewardPoints,t(wt,{type:e.levelRewardPointType})]})]}),e.scoreLimit>0&&t(DE,{text:g("achievements.details.progress",["progress","limit"],[(e.currentPoints+e.scoreAtStartOfLevel).toString(),(e.scoreLimit+e.scoreAtStartOfLevel).toString()]),progress:e.currentPoints+e.scoreAtStartOfLevel,maxProgress:e.scoreLimit+e.scoreAtStartOfLevel})]})]})]}):null},oU=i=>{const{category:e=null}=i,{selectedAchievement:s=null,setSelectedAchievementId:n=null}=Bi();return a.useEffect(()=>{var r,o;e&&(s||n((o=(r=e==null?void 0:e.achievements)==null?void 0:r[0])==null?void 0:o.achievementId))},[e,s,n]),e?d(v,{fullHeight:!0,justifyContent:"between",children:[t(nU,{achievements:e.achievements}),!!s&&t(rU,{achievement:s})]}):null},iU=i=>{const{category:e=null,selectedCategoryCode:s=null,setSelectedCategoryCode:n=null}=i;if(!e)return null;const r=ms.getAchievementCategoryProgress(e),o=ms.getAchievementCategoryMaxProgress(e),l=ms.getAchievementCategoryImageUrl(e,r),c=ms.getAchievementCategoryTotalUnseen(e);return d(jt,{itemActive:s===e.code,itemCount:c,itemCountMinimum:0,gap:1,onClick:u=>n(e.code),children:[t(N,{fullWidth:!0,bold:!0,center:!0,className:"mt-1 top-0",position:"absolute",children:g(`quests.${e.code}.name`)}),t(kA,{position:"relative",imageUrl:l,className:"mt-3",children:d(N,{fullWidth:!0,center:!0,bold:!0,position:"absolute",variant:"white",className:"nitro-achievements-category-progress",children:[r,"/",o]})})]})},aU=i=>{const{categories:e=null,selectedCategoryCode:s=null,setSelectedCategoryCode:n=null}=i;return t(qe,{columnCount:3,columnMinWidth:90,columnMinHeight:100,children:e&&e.length>0&&e.map((r,o)=>t(iU,{category:r,selectedCategoryCode:s,setSelectedCategoryCode:n},o))})},lU=i=>{const[e,s]=a.useState(!1),{achievementCategories:n=[],selectedCategoryCode:r=null,setSelectedCategoryCode:o=null,achievementScore:l=0,getProgress:c=0,getMaxProgress:u=0,selectedCategory:h=null}=Bi();return a.useEffect(()=>{const m={linkReceived:p=>{const E=p.split("/");if(!(E.length<2))switch(E[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(_=>!_);return}},eventUrlPrefix:"achievements/"};return dt(m),()=>ht(m)},[]),e?t(le,{uniqueKey:"achievements",colour:L.quaternary_grey,title:g("inventory.achievements"),className:"nitro-achievements",onCloseClick:m=>s(!1),children:d(V,{position:"relative",className:"h-100",gap:2,overflow:"hidden",children:[h&&d(wA,{position:"relative",className:"justify-content-center align-items-center cursor-pointer h-100",gap:3,style:{maxHeight:65},children:[t(P,{onClick:m=>o(null),className:"nitro-achievements-back-arrow"}),d(v,{grow:!0,gap:0,children:[t(N,{bold:!0,className:"text-small",children:g(`quests.${h.code}.name`)}),t(N,{children:g("achievements.details.categoryprogress",["progress","limit"],[h.getProgress().toString(),h.getMaxProgress().toString()])})]}),t(yn,{imageUrl:ms.getAchievementCategoryImageUrl(h,null,!0)})]}),d(at,{fullHeight:!0,gap:1,className:"px-0",children:[!h&&d(z,{children:[t(aU,{categories:n,selectedCategoryCode:r,setSelectedCategoryCode:o}),d(v,{grow:!0,justifyContent:"end",gap:1,children:[t(N,{center:!0,children:g("achievements.categories.score",["score"],[l.toString()])}),t(DE,{text:g("achievements.categories.totalprogress",["progress","limit"],[c.toString(),u.toString()]),progress:c,maxProgress:u})]})]}),h&&t(oU,{category:h})]})]})}):null},cU=i=>{const{figureData:e=null}=i,[s,n]=a.useState(-1),r=o=>{o<Vo.MIN_DIRECTION&&(o=Vo.MAX_DIRECTION+(o+1)),o>Vo.MAX_DIRECTION&&(o=o-(Vo.MAX_DIRECTION+1)),e.direction=o};return a.useEffect(()=>{if(e)return e.notify=()=>n(o=>o+1),()=>{e.notify=null}},[e]),d(v,{className:"ton-figure-preview-container",overflow:"hidden",position:"relative",children:[t(it,{scale:2,figure:e.getFigureString(),direction:e.direction}),t(P,{className:"avatar-plate"}),t(P,{className:"arrow-container w-100 justify-content-center",children:t(P,{className:"icon arrow left",onClick:o=>r(e.direction+1)})})]})},ho=i=>{const{icon:e=null,selected:s=!1,classNames:n=[],children:r=null,...o}=i,l=a.useMemo(()=>{const c=["nitro-avatar-editor-spritesheet"];return e&&e.length&&c.push(e+"-icon"),s&&c.push("selected"),n.length&&c.push(...n),c},[e,s,n]);return t(P,{classNames:l,...o})},uU=i=>{const{partItem:e=null,children:s=null,...n}=i,[r,o]=a.useState(-1),l=ee("hc.disabled",!1);return a.useEffect(()=>{const c=()=>o(u=>u+1);return e.notify=c,()=>e.notify=null},[e]),d(jt,{itemImage:e.isClear?void 0:e.imageUrl,itemActive:e.isSelected,...n,children:[!l&&e.isHC&&t(wt,{className:"position-absolute end-1 bottom-1",type:"hc"}),e.isClear&&t(ho,{icon:"clear"}),e.isSellable&&t(ho,{icon:"sellable",position:"absolute",className:"end-1 bottom-1"}),s]})},dU=i=>{const{model:e=null,category:s=null,setMaxPaletteCount:n=null}=i,r=a.useRef(null),{clubLevel:o}=J(),l=a.useCallback(c=>{const u=s.parts.indexOf(c);if(u===-1)return;if(c.isHC&&!o)return oe("habboUI/open/hccenter");e.selectPart(s.name,u);const h=s.getCurrentPart();n(h.maxColorIndex||1)},[e,s,n,o]);return a.useEffect(()=>{!e||!s||!r||!r.current||(r.current.scrollTop=0)},[e,s]),t(qe,{innerRef:r,columnCount:3,columnMinHeight:50,children:s.parts.length>0&&s.parts.map((c,u)=>t(uU,{partItem:c,onClick:h=>l(c)},u))})},hU=i=>{const{colorItem:e=null,children:s=null,...n}=i,[r,o]=a.useState(-1),l=ee("hc.disabled",!1);return a.useEffect(()=>{const c=()=>o(u=>u+1);return e.notify=c,()=>e.notify=null},[e]),d(Rn,{itemColor:e.color,itemActive:e.isSelected,className:"clear-bg",...n,children:[!l&&e.isHC&&t(wt,{className:"position-absolute end-1 bottom-1",type:"hc"}),s]})},pu=i=>{const{model:e=null,category:s=null,paletteSet:n=[],paletteIndex:r=-1}=i,o=a.useRef(null),l=a.useCallback(c=>{const u=n.indexOf(c);u!==-1&&e.selectColor(s.name,u,r)},[e,s,n,r]);return a.useEffect(()=>{!e||!s||!o||!o.current||(o.current.scrollTop=0)},[e,s]),t(qe,{innerRef:o,gap:1,columnCount:5,columnMinWidth:30,children:n.length>0&&n.map((c,u)=>t(hU,{colorItem:c,onClick:h=>l(c)},u))})},mU=i=>{const{model:e=null,gender:s=null,setGender:n=null}=i,[r,o]=a.useState(null),[l,c]=a.useState(1),u=a.useCallback(h=>{const m=e.categories.get(h);if(m){m.init(),o(m);for(const p of m.parts)if(!(!p||!p.isSelected)){c(p.maxColorIndex||1);break}}},[e]);return a.useEffect(()=>{e.init();for(const h of e.categories.keys()){u(h);break}},[e,u]),!e||!r?null:d(pe,{children:[d(v,{size:2,children:[e.canSetGender&&d(z,{children:[t(R,{center:!0,pointer:!0,className:"category-item",onClick:h=>n(ge.MALE),children:t(ho,{icon:"male",selected:s===ge.MALE})}),t(R,{center:!0,pointer:!0,className:"category-item",onClick:h=>n(ge.FEMALE),children:t(ho,{icon:"female",selected:s===ge.FEMALE})})]}),!e.canSetGender&&e.categories&&e.categories.size>0&&Array.from(e.categories.keys()).map(h=>{const m=e.categories.get(h);return t(R,{center:!0,pointer:!0,className:"category-item",onClick:p=>u(h),children:t(ho,{icon:m.name,selected:r===m})},h)})]}),t(v,{size:5,overflow:"hidden",children:t(dU,{model:e,category:r,setMaxPaletteCount:c})}),d(v,{size:5,overflow:"hidden",children:[l>=1&&t(pu,{model:e,category:r,paletteSet:r.getPalette(0),paletteIndex:0}),l===2&&t(pu,{model:e,category:r,paletteSet:r.getPalette(1),paletteIndex:1})]})]})},gU=i=>{const{figureData:e=null,savedFigures:s=[],setSavedFigures:n=null,loadAvatarInEditor:r=null}=i,o=ee("hc.disabled",!1),l=a.useCallback(h=>{if(h>=s.length||h<0)return;const[m,p]=s[h];r(m.getFigureString(),p)},[s,r]),c=a.useCallback(h=>{if(!e||h>=s.length||h<0)return;const m=[...s],p=e.getFigureString(),E=e.gender;m[h]=[Mt().createFigureContainer(p),E],n(m),B(new Bg(h+1,p,E))},[e,s,n]),u=a.useMemo(()=>{if(!s||!s.length)return[];const h=[];return s.forEach(([m,p],E)=>{let _=0;m&&(_=Mt().getFigureClubLevel(m,p)),h.push(d(Rn,{position:"relative",overflow:"hidden",className:"nitro-avatar-editor-wardrobe-figure-preview",children:[d(R,{gap:1,className:"button-container",children:[t(D,{fullWidth:!0,onClick:I=>c(E),children:g("avatareditor.wardrobe.save")}),m&&t(D,{fullWidth:!0,onClick:I=>l(E),disabled:_>gs(),children:g("generic_usable.button.use")})]}),m&&t(it,{figure:m.getFigureString(),gender:p,direction:2}),t(P,{className:"avatar-plate"}),!o&&_>0&&t(wt,{className:"position-absolute bottom-1 start-1",type:"hc"})]},E))}),h},[s,o,c,l]);return t(qe,{columnCount:5,columnMinWidth:80,columnMinHeight:140,fullHeight:!0,children:u})},pU="hr-100.hd-180-7.ch-215-66.lg-270-79.sh-305-62.ha-1002-70.wa-2007",fU="hr-515-33.hd-600-1.ch-635-70.lg-716-66-62.sh-735-68",_U=i=>{const[e,s]=a.useState(!1),[n,r]=a.useState(null),[o,l]=a.useState(null),[c,u]=a.useState(null),[h,m]=a.useState(null),[p,E]=a.useState([]),[_,I]=a.useState([]),[C,f]=a.useState([]),[S,T]=a.useState(!1),[b,y]=a.useState(null),[w,O]=a.useState(null),[F,U]=a.useState(!0),[j,x]=a.useState(!1),M=a.useMemo(()=>ee("avatar.wardrobe.max.slots",10),[]);W(Wh,se=>{const ye=se.getParser();E(ye.figureSetIds),I(ye.boundsFurnitureNames)}),W(wg,se=>{const ye=se.getParser(),me=[];let lt=0;for(;lt<M;)me.push([null,null]),lt++;for(let[ie,[He,ft]]of ye.looks.entries()){const Ie=Mt().createFigureContainer(He);me[ie-1]=[Ie,ft]}f(me)});const G=a.useCallback(se=>{c&&m(c.get(se))},[c]),H=a.useCallback(()=>{const se=new Map;se.set(Cn.GENERIC,new Ay),se.set(Cn.HEAD,new $y),se.set(Cn.TORSO,new Xy),se.set(Cn.LEGS,new Qy),u(se)},[]),Y=a.useCallback(()=>{const se=new Map,ye=new ge,me=new ge;ye.loadAvatarData(pU,ge.MALE),me.loadAvatarData(fU,ge.FEMALE),se.set(ge.MALE,ye),se.set(ge.FEMALE,me),r(se),l(se.get(ge.MALE))},[]),q=a.useCallback((se,ye,me=!0)=>{ye=Rt.getGender(ye);let lt=o;ye!==lt.gender&&(lt=n.get(ye)),se!==lt.getFigureString()&&lt.loadAvatarData(se,ye),lt!==o&&l(lt),me&&(y(o.getFigureString()),O(o.gender))},[n,o]),Z=a.useCallback(se=>{switch(se){case Ms.ACTION_CLEAR:q(o.getFigureStringWithFace(0,!1),o.gender,!1),H();return;case Ms.ACTION_RESET:q(b,w),H();return;case Ms.ACTION_RANDOMIZE:const ye=Ky(o,o.gender,gs(),p,[ge.FACE]);q(ye,o.gender,!1),H();return;case Ms.ACTION_SAVE:B(new Fl(o.gender,o.getFigureString())),s(!1);return}},[o,b,w,p,q,H]),ce=a.useCallback(se=>{se=Rt.getGender(se),l(n.get(se))},[n]);return a.useEffect(()=>{const se={linkReceived:ye=>{const me=ye.split("/");if(!(me.length<2))switch(me[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(lt=>!lt);return}},eventUrlPrefix:"avatar-editor/"};return dt(se),()=>ht(se)},[]),a.useEffect(()=>{f(new Array(M))},[M]),a.useEffect(()=>{S&&(m(null),B(new Gg))},[S]),a.useEffect(()=>{h&&T(!1)},[h]),a.useEffect(()=>{c&&G(Cn.GENERIC)},[c,G]),a.useEffect(()=>{if(o)return Rt.CURRENT_FIGURE=o,H(),()=>Rt.CURRENT_FIGURE=null},[o,H]),a.useEffect(()=>(Rt.FIGURE_SET_IDS=p,Rt.BOUND_FURNITURE_NAMES=_,H(),()=>{Rt.FIGURE_SET_IDS=null,Rt.BOUND_FURNITURE_NAMES=null}),[p,_,H]),a.useEffect(()=>{if(e&&!n){Y(),x(!0);return}},[e,n,Y]),a.useEffect(()=>{!e||!j||!F||(q(J().figure,J().gender),U(!1))},[e,j,F,q]),a.useEffect(()=>{if(!e)return()=>{U(!0)}},[e]),!e||!o?null:d(le,{colour:L.secondary_grey,title:g("avatareditor.title"),className:"nitro-avatar-editor",onCloseClick:se=>s(!1),children:[d(en,{children:[c&&c.size>0&&Array.from(c.keys()).map(se=>{const ye=h&&h.name===se;return t(Ns,{skin:3,className:"py-2",isActive:ye,onClick:me=>G(se),children:t(P,{className:`tabs-icon ${se}`})},se)}),t(Ns,{skin:3,className:"py-2",isActive:S,onClick:se=>T(!0),children:t(P,{className:"tabs-icon wardrobe"})})]}),t(V,{skin:0,colour:L.primary_grey,position:"relative",className:"h-100 overflow-hidden",children:d(R,{fullHeight:!0,overflow:"hidden",gap:1,children:[d(v,{size:9,overflow:"hidden",fullHeight:!0,children:[h&&!S&&t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-hidden",children:t(mU,{model:h,gender:o.gender,setGender:ce})}),S&&t(V,{skin:0,colour:L.white,position:"relative",className:"overflow-hidden",fullHeight:!0,children:t(gU,{figureData:o,savedFigures:C,setSavedFigures:f,loadAvatarInEditor:q})})]}),d(v,{fullWidth:!0,overflow:"hidden",children:[t(cU,{figureData:o}),d(v,{grow:!0,gap:1,children:[d(zr,{fullWidth:!0,children:[t(D,{skin:3,fullWidth:!0,onClick:se=>Z(Ms.ACTION_RESET),children:t(R,{className:"align-items-center justify-content-center",children:t(P,{className:"avatar-editor-icon undo"})})}),t(D,{skin:3,fullWidth:!0,onClick:se=>Z(Ms.ACTION_CLEAR),children:t(R,{className:"align-items-center justify-content-center",children:t(P,{className:"avatar-editor-icon trash"})})}),t(D,{skin:3,fullWidth:!0,onClick:se=>Z(Ms.ACTION_RANDOMIZE),children:t(R,{className:"align-items-center justify-content-center",children:t(P,{className:"avatar-editor-icon randomize"})})})]}),t(D,{skin:3,onClick:se=>Z(Ms.ACTION_SAVE),children:g("avatareditor.save")})]})]})]})})]})},EU=3,IU=i=>{const{onClose:e=null,onEdit:s=null,onDelete:n=null}=i,{cameraRoll:r=null,setCameraRoll:o=null,selectedPictureIndex:l=-1,setSelectedPictureIndex:c=null}=mE(),{simpleAlert:u=null}=Ke(),h=a.useRef(),m=l>-1?r[l]:null,[p,E]=a.useState(!1),[_,I]=a.useState(!1),C=()=>{if(!h||!h.current)return null;const S=h.current.getBoundingClientRect();return new Id(Math.floor(S.x),Math.floor(S.y),Math.floor(S.width),Math.floor(S.height))},f=()=>{if(E(!0),l>-1){c(-1);return}const S=X().createTextureFromRoom(Pe().roomId,1,C()),T=[...r];T.length>=EU&&(_||u(g("camera.full.body")),I(!0),T.pop()),Fs(cs.CAMERA_SHUTTER),T.push(new Jy(S,ln.generateImageUrl(S))),o(T),setTimeout(()=>E(!1),100)};return t(vs,{uniqueKey:"nitro-camera-capture",children:t(v,{center:!0,className:"nitro-camera-capture",gap:0,children:d("div",{className:"camera-canvas drag-handler d-flex justify-content-end",children:[t("div",{ref:h,className:"camera-area camera-view-finder"+(p?" camera-flicker":"")}),m&&d("div",{className:"camera-area camera-frame",children:[t("img",{alt:"",src:m.imageUrl}),d("div",{className:"z-index camera-frame-preview-actions w-100 position-absolute bottom-0 py-2 text-center",children:[t(D,{className:"btn m-1 z-index",skin:0,onClick:n,children:t("div",{className:"camera-icon trash"})}),t(D,{className:"btn m-1 z-index",skin:0,onClick:s,children:t("div",{className:"camera-icon save"})})]})]}),d("div",{className:"d-flex flex-column align-items-center justify-content-between camera-roll gap-2 h-100",children:[t("div",{className:"camera-button flex-shrink-0",title:g("camera.take.photo.button.tooltip"),onClick:f}),r.length>0&&t(R,{gap:0,justifyContent:"between",alignItems:"center",column:!0,className:"camera-roll-grid py-3",children:r.map((S,T)=>t("img",{alt:"",src:S.imageUrl,onClick:b=>c(T)},T))}),t(D,{skin:1,className:"mb-2",onClick:e,children:"Close"})]})]})})})},CU=i=>{const{base64Url:e=null,onCloseClick:s=null,onCancelClick:n=null,price:r=null}=i,[o,l]=a.useState(null),[c,u]=a.useState(null),[h,m]=a.useState(0),[p,E]=a.useState(!1),[_,I]=a.useState(!1),[C,f]=a.useState(0),S=a.useMemo(()=>ee("camera.publish.disabled",!1),[]);W(Bd,b=>{m(y=>y+1),I(!1)}),W(Gd,b=>{const y=b.getParser();u(y.extraDataId),f(y.secondsToWait),E(y.ok),I(!1)}),W(Hd,b=>{const y=b.getParser();l(ee("camera.url")+"/"+y.url)});const T=(b,y=null)=>{switch(b){case"close":s();return;case"buy":if(_)return;I(!0),B(new Wg(""));return;case"publish":if(_)return;I(!0),B(new jg);return;case"cancel":n();return}};return a.useEffect(()=>{e&&X().saveBase64AsScreenshot(e)},[e]),r?t(le,{title:g("camera.confirm_phase.title"),colour:L.secondary_grey,className:"nitro-camera-checkout",onCloseClick:b=>T("close"),children:d(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto d-flex flex-column gap-2",children:[d(R,{center:!0,children:[o&&o.length&&t(yn,{className:"picture-preview border",imageUrl:o}),(!o||!o.length)&&t(R,{center:!0,className:"picture-preview border",children:t(N,{bold:!0,children:g("camera.loading")})})]}),d(R,{justifyContent:"between",alignItems:"center",className:"bg-muted p-2",children:[d(v,{size:S?9:6,gap:1,children:[t(N,{bold:!0,children:g("camera.purchase.header")}),(r.credits>0||r.duckets>0)&&d(R,{gap:1,children:[t(N,{children:g("catalog.purchase.confirmation.dialog.cost")}),r.credits>0&&d(R,{gap:1,children:[t(N,{bold:!0,children:r.credits}),t(wt,{type:-1})]}),r.duckets>0&&d(R,{gap:1,children:[t(N,{bold:!0,children:r.duckets}),t(wt,{type:5})]})]}),h>0&&d(N,{children:[t(N,{bold:!0,children:g("camera.purchase.count.info")})," ",h,t("u",{className:"ms-1 cursor-pointer",onClick:()=>oe("inventory/toggle"),children:g("camera.open.inventory")})]})]}),t(R,{alignItems:"center",children:t(D,{disabled:_,skin:1,onClick:b=>T("buy"),children:g(h?"camera.buy.another.button.text":"buy")})})]}),!S&&d(R,{justifyContent:"between",alignItems:"center",className:"bg-muted p-2",children:[d(v,{gap:1,children:[t(N,{bold:!0,children:g(p?"camera.publish.successful":"camera.publish.explanation")}),t(N,{children:g(p?"camera.publish.success.short.info":"camera.publish.detailed.explanation")}),p&&t("a",{href:c,rel:"noreferrer",target:"_blank",children:g("camera.link.to.published")}),!p&&r.publishDucketPrice>0&&d(R,{gap:1,children:[t(N,{children:g("catalog.purchase.confirmation.dialog.cost")}),d(R,{gap:1,children:[t(N,{bold:!0,children:r.publishDucketPrice}),t(wt,{type:5})]})]}),C>0&&t("div",{className:"mt-1 text-center",children:g("camera.publish.wait",["minutes"],[Math.ceil(C/60).toString()])})]}),!p&&t(R,{className:"d-flex align-items-end",children:t(D,{disabled:_||C>0,onClick:b=>T("publish"),children:g("camera.publish.button.text")})})]}),t(N,{center:!0,children:g("camera.warning.disclaimer")}),t(R,{justifyContent:"end",children:t(D,{onClick:b=>T("cancel"),children:g("generic.cancel")})})]})}):null},SU=i=>{const{effect:e=null,thumbnailUrl:s=null,isActive:n=!1,isLocked:r=!1,selectEffect:o=null,removeEffect:l=null}=i;return d(Rn,{title:g(r?`camera.effect.required.level ${e.minLevel}`:`camera.effect.name.${e.name}`),itemActive:n,onClick:c=>!n&&o(),children:[n&&t(D,{className:"rounded-circle remove-effect",onClick:l,children:t(Gt,{icon:"times"})}),!r&&s&&s.length>0&&t("div",{className:"effect-thumbnail-image border",children:t("img",{alt:"",src:s})}),r&&d(N,{center:!0,bold:!0,children:[t("div",{children:t(Gt,{icon:"lock"})}),e.minLevel]})]})},TU=i=>{const{myLevel:e=0,selectedEffects:s=[],effects:n=[],thumbnails:r=[],processAction:o=null}=i;return t(pe,{columnCount:3,overflow:"auto",children:n&&n.length>0&&n.map((l,c)=>{const u=r.find(m=>m.effectName===l.name),h=s.findIndex(m=>m.effect.name===l.name)>-1;return t(SU,{effect:l,thumbnailUrl:u&&u.thumbnailUrl||null,isActive:h,isLocked:l.minLevel>e,selectEffect:()=>o("select_effect",l.name),removeEffect:()=>o("remove_effect",l.name)},c)})})},fu=[No.COLORMATRIX,No.COMPOSITE],NU=i=>{const{picture:e=null,availableEffects:s=null,myLevel:n=1,onClose:r=null,onCancel:o=null,onCheckout:l=null}=i,[c,u]=a.useState(fu[0]),[h,m]=a.useState(null),[p,E]=a.useState([]),[_,I]=a.useState([]),[C,f]=a.useState(!1),S=a.useMemo(()=>s.filter(x=>x.colorMatrix),[s]),T=a.useMemo(()=>s.filter(x=>x.texture),[s]),b=a.useCallback(()=>c===No.COLORMATRIX?S:T,[c,S,T]),y=a.useCallback(x=>!x||!x.length||!p||!p.length?-1:p.findIndex(M=>M.effect.name===x),[p]),w=a.useMemo(()=>y(h),[h,y]),O=a.useMemo(()=>h&&p[w]||null,[h,w,p]),F=a.useCallback(x=>{const M=w;M!==-1&&E(G=>{const H=[...G],Y=H[M];return H[w]=new aa(Y.effect,x),H})},[w,E]),U=a.useMemo(()=>co().applyEffects(e.texture,p,C).src,[e,p,C]),j=a.useCallback((x,M=null)=>{switch(x){case"close":r();return;case"cancel":o();return;case"checkout":l(U);return;case"change_tab":u(String(M));return;case"select_effect":{if(y(M)>=0)return;const H=s.find(Y=>Y.name===M);if(!H)return;E(Y=>[...Y,new aa(H,1)]),m(H.name);return}case"remove_effect":{let G=y(M);if(G===-1)return;E(H=>{const Y=[...H];return Y.splice(G,1),Y}),h===M&&m(null);return}case"clear_effects":m(null),E([]);return;case"download":{const G=new Image;G.src=U,window.open("").document.write(G.outerHTML);return}case"zoom":f(!C);return}},[C,s,h,U,y,o,l,r,f,E]);return a.useEffect(()=>{const x=[];for(const M of s)x.push(new Zy(M.name,co().applyEffects(e.texture,[new aa(M,1)],!1).src));I(x)},[e,s]),d(le,{title:g("camera.editor.button.text"),colour:L.secondary_grey,className:"nitro-camera-editor",onCloseClick:x=>j("close"),children:[t(en,{children:fu.map(x=>t(Ns,{isActive:c===x,onClick:M=>j("change_tab",x),children:t("i",{className:"icon icon-camera-"+x})},x))}),t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:d(pe,{children:[t(v,{size:5,overflow:"hidden",children:t(TU,{myLevel:n,selectedEffects:p,effects:b(),thumbnails:_,processAction:j})}),d(v,{size:7,justifyContent:"between",overflow:"hidden",children:[d(v,{center:!0,children:[t(yn,{imageUrl:U,className:"picture-preview"}),h&&d(v,{center:!0,fullWidth:!0,gap:1,children:[t(N,{children:g("camera.effect.name."+h)}),t(kt,{className:"ton-slider",min:0,max:.8,step:.01,value:O.alpha,onChange:x=>F(x)})]})]}),d(R,{justifyContent:"between",children:[d(zr,{children:[t(D,{onClick:x=>j("clear_effects"),children:t("div",{className:"camera-icon trash"})}),t(D,{onClick:x=>j("download"),children:t("div",{className:"camera-icon save"})})]}),d(R,{gap:1,children:[t(D,{onClick:x=>j("cancel"),children:t("div",{className:"camera-icon cancel"})}),t(D,{skin:1,onClick:x=>j("checkout"),children:t("div",{className:"camera-icon continue"})})]})]})]})]})})]})},fr=0,ti=1,_u=2,Eu=3,RU=i=>{const[e,s]=a.useState(fr),[n,r]=a.useState(null),{availableEffects:o=[],selectedPictureIndex:l=-1,cameraRoll:c=[],setCameraRoll:u=null,myLevel:h=0,price:m={credits:0,duckets:0,publishDucketPrice:0}}=mE(),p=_=>{switch(_){case"close":s(fr);return;case"edit":s(_u);return;case"delete":u(I=>{const C=[...I];return C.splice(l,1),C});return;case"editor_cancel":s(ti);return}},E=_=>{r(_),s(Eu)};return $e(qt.ENDED,_=>s(fr)),a.useEffect(()=>{const _={linkReceived:I=>{const C=I.split("/");if(!(C.length<2))switch(C[1]){case"show":s(ti);return;case"hide":s(fr);return;case"toggle":s(f=>f?fr:ti);return}},eventUrlPrefix:"camera/"};return dt(_),()=>ht(_)},[]),e===fr?null:d(z,{children:[e===ti&&t(IU,{onClose:()=>p("close"),onEdit:()=>p("edit"),onDelete:()=>p("delete")}),e===_u&&t(NU,{picture:c[l],myLevel:h,onClose:()=>p("close"),onCancel:()=>p("editor_cancel"),onCheckout:E,availableEffects:o}),e===Eu&&t(CU,{base64Url:n,onCloseClick:()=>p("close"),onCancelClick:()=>p("editor_cancel"),price:m})]})},vU=i=>{const{itemId:e=-1,state:s=null,product:n=null,active:r=!1,onClick:o=null}=i,l=c=>{let u=J().getFloorItemDataByName(c),h=null;return u?h=X().getFurnitureFloorIconUrl(u.id):(u=J().getWallItemDataByName(c),u&&(h=X().getFurnitureWallIconUrl(u.id))),h};return d(V,{skin:100,colour:L.primary_blue,position:"relative",center:!0,pointer:!0,className:`campaign-spritesheet campaign-day-generic-bg calendar-item ${r?"active":""}`,onClick:()=>o(e),children:[d(R,{className:"calendar-item-content",center:!0,fullHeight:!0,children:[s===Ht.STATE_UNLOCKED&&t(R,{center:!0,className:"campaign-spritesheet unlocked-bg flex-shrink-0",children:t(R,{center:!0,className:"campaign-spritesheet campaign-opened",children:n&&t(yn,{imageUrl:n.customImage?ee("image.library.url")+n.customImage:l(n.productName)})})}),s!==Ht.STATE_UNLOCKED&&d(R,{center:!0,className:"campaign-spritesheet locked-bg",children:[s===Ht.STATE_LOCKED_AVAILABLE&&t(P,{className:"campaign-spritesheet available"}),(s===Ht.STATE_LOCKED_EXPIRED||s===Ht.STATE_LOCKED_FUTURE)&&t(P,{className:"campaign-spritesheet unavailable"})]}),s!==Ht.STATE_UNLOCKED&&s!=Ht.STATE_LOCKED_AVAILABLE&&t(P,{className:"campaign-spritesheet locked position-absolute bottom-0 end-0 m-1"})]}),t(V,{opacity:127,skin:4,className:"thumbnail-glow"})]})},Ea=5,bU=i=>{const{onClose:e=null,campaignName:s=null,currentDay:n=null,numDays:r=null,missedDays:o=null,openedDays:l=null,openPackage:c=null,receivedProducts:u=null,imageUrl:h=null}=i,[m,p]=a.useState(n),[E,_]=a.useState(Math.max(0,m-1)),[I,C]=a.useState(""),f=O=>l.includes(O)?Ht.STATE_UNLOCKED:O>n?Ht.STATE_LOCKED_FUTURE:o.includes(O)?Ht.STATE_LOCKED_EXPIRED:Ht.STATE_LOCKED_AVAILABLE,S=O=>{switch(f(O)){case Ht.STATE_UNLOCKED:return g("campaign.calendar.info.unlocked");case Ht.STATE_LOCKED_FUTURE:return g("campaign.calendar.info.future");case Ht.STATE_LOCKED_EXPIRED:return g("campaign.calendar.info.expired");default:return g("campaign.calendar.info.available.desktop")}},T=()=>{const O=m+1;O!==r&&(p(O),E+Ea<O+1&&_(E+1))},b=()=>{const O=m-1;O<0||(p(O),E>O&&_(E-1))},y=O=>{if(m===O){f(O)===Ht.STATE_LOCKED_AVAILABLE&&c(O,!1);return}p(O)};a.useEffect(()=>{let O=0;const F=U=>{if(O==2)return;O++;let j=document.createElement("img");j.src=`${ee("image.library.url")}/campaign/calendar/${U}`,j.onerror=()=>F("default.png"),j.onload=()=>C(j.src)};F(h||"default.png")},[h]);const w=a.useMemo(()=>{let O={};return I&&(O["--calendar-spritesheet"]=`url('${I}')`),O},[I]);return d(le,{title:g(`campaign.calendar.${s}.title`),className:"campaign-calendar",onCloseClick:e,style:w,modal:!0,children:[t(v,{center:!0,fullWidth:!0,children:t(pe,{fit:!0,columnCount:Ea,gap:1,children:[...Array(Ea)].map((O,F)=>{const U=E+F;return t(v,{overflow:"hidden",children:t(vU,{itemId:U,state:f(U),active:m===U,product:u.has(U)?u.get(U):null,onClick:y})},F)})})}),d(V,{position:"relative",className:"mt-1",column:!1,justifyContent:"between",skin:4,colour:L.catalog_search_blue,children:[t(P,{pointer:!0,className:"campaign-spritesheet prev",onClick:b}),d(v,{gap:1,alignSelf:"center",children:[t(N,{className:"volter-bold",variant:"light",children:g("campaign.calendar.heading.day",["number"],[(m+1).toString()])}),t(N,{variant:"light",children:S(m)})]}),t(P,{pointer:!0,className:"campaign-spritesheet next",onClick:T})]})]})},OU=i=>{const[e,s]=a.useState(null),[n,r]=a.useState(-1),[o,l]=a.useState(new Map),[c,u]=a.useState(!1),h=(m,p=!1)=>{e&&(r(m),B(p?new Yg(e.campaignName,m):new qg(e.campaignName,m)))};return W(Vd,m=>{const p=m.getParser();p&&s(p.calendarData)}),W(Wd,m=>{const p=m.getParser();if(!p)return;const E=n;p.doorOpened&&(s(_=>{const I=_.clone();return I.openedDays.push(n),I}),l(_=>{const I=new Map(_);return I.set(E,new eA(p.productName,p.customImage,p.furnitureClassName)),I})),r(-1)}),a.useEffect(()=>{const m={linkReceived:p=>{const E=p.split("/");if(!(E.length<2))switch(E[1]){case"togglecalendar":u(_=>!_);return;case"calendar":u(!0);break}},eventUrlPrefix:"openView/"};return dt(m),()=>ht(m)},[]),a.useEffect(()=>{c&&B(new ip)},[c]),t(z,{children:e&&c&&t(bU,{onClose:()=>u(!1),campaignName:e.campaignName,currentDay:e.currentDay,numDays:e.campaignDays,openedDays:e.openedDays,missedDays:e.missedDays,openPackage:h,receivedProducts:o,imageUrl:e.campaignImage})})},nI=i=>{let{image:e=null}=i;const s=a.useRef(),n=a.useMemo(()=>ee("catalog.asset.image.url").replace("%name%","catalog_header_roombuilder"),[]);return a.useEffect(()=>{e==null&&s!==null&&(s.current.src=n)},[e,s,n]),t(P,{className:"nitro-catalog-header user-select-none",children:t("img",{className:"nitro-catalog-header user-select-none",ref:s,src:e,onError:({currentTarget:r})=>{r.src=n}})})},rI=i=>{const{icon:e=0}=i,s=a.useMemo(()=>ee("catalog.asset.icon.url").replace("%name%",e.toString()),[e]);return t(yn,{imageUrl:s,style:{width:20,height:20},className:"catalog-list-icon"})},wU=i=>{const[e,s]=a.useState(!1),[n,r]=a.useState(0),[o,l]=a.useState(0),[c,u]=a.useState(""),[h,m]=a.useState(""),[p,E]=a.useState(!0),[_,I]=a.useState(""),[C,f]=a.useState([]),[S,T]=a.useState(0),[b,y]=a.useState(0),[w,O]=a.useState(0),[F,U]=a.useState(0),[j,x]=a.useState(0),[M,G]=a.useState(!1),{catalogOptions:H=null}=De(),{giftConfiguration:Y=null}=H,[q,Z]=a.useState([]),[ce,se]=a.useState([]),[ye,me]=a.useState(!0),{friends:lt}=ns(),ie=a.useCallback(()=>{s(!1),r(0),l(0),u(""),m(""),E(!0),I(""),T(0),y(0),me(!1),se([]),C.length&&O(C[0].id)},[C]),He=a.useMemo(()=>Y?Y.defaultStuffTypes.findIndex(be=>be===q[S])>-1:!1,[q,Y,S]),ft=a.useMemo(()=>Y?(q[S]*1e3+Y.ribbonTypes[b]).toString():"",[Y,S,b,q]),Ie=a.useMemo(()=>{if(!Y||He)return!1;const be=q[S];return!(be===8||be>=3&&be<=6)},[Y,S,He,q]),ve=a.useMemo(()=>He?q[S]:w,[He,q,S,w]),St=lt.filter(be=>be.id!==-1),Bt=be=>{const Ae=be.target.value;let As=[];Ae.length>0&&(As=St.sort().filter(hr=>hr.name.includes(Ae))),m(Ae),me(!0),se(As)},Es=be=>{m(be),me(!1)},tn=a.useCallback(be=>{switch(be){case"prev_box":T(Ae=>Ae===0?F:Ae-1);return;case"next_box":T(Ae=>Ae===F?0:Ae+1);return;case"prev_ribbon":y(Ae=>Ae===0?j:Ae-1);return;case"next_ribbon":y(Ae=>Ae===j?0:Ae+1);return;case"buy":if(!h||h.length===0){G(!0);return}B(new Jg(n,o,c,h,_,ve,S,b,p));return}},[ve,c,F,j,_,o,n,h,S,b,p]);W(Kd,be=>G(!0)),ct([Zs.PURCHASE_SUCCESS,fs.INIT_GIFT],be=>{switch(be.type){case Zs.PURCHASE_SUCCESS:ie();return;case fs.INIT_GIFT:const Ae=be;ie(),r(Ae.pageId),l(Ae.offerId),u(Ae.extraData),s(!0);return}}),a.useEffect(()=>{G(!1)},[h]);const Re=a.useCallback(()=>{Y&&Z(be=>{let Ae=[...Y.boxTypes];return Ae.push(Y.defaultStuffTypes[Math.floor(Math.random()*(Y.defaultStuffTypes.length-1))]),U(Ae.length-1),x(Ae.length-1),Ae})},[Y]);if(a.useEffect(()=>{if(!Y)return;const be=[];for(const Ae of Y.stuffTypes){const As=J().getFloorItemData(Ae);As&&As.colors&&As.colors.length>0&&be.push({id:Ae,color:bn.makeColorNumberHex(As.colors[0])})}Re(),be.length&&(O(be[0].id),f(be))},[Y,Re]),a.useEffect(()=>{e&&Re()},[Re,e]),!Y||!Y.isEnabled||!e)return null;const Ve="catalog.gift_wrapping_new.box."+(He?"default":q[S]),Ye=`catalog.gift_wrapping_new.ribbon.${b}`,rs="catalog.gift_wrapping_new."+(He?"freeprice":"price");return d(le,{title:g("catalog.gift_wrapping.title"),className:"nitro-catalog-gift",onCloseClick:ie,children:[d(V,{position:"relative",column:!0,gap:1,fullWidth:!0,alignItems:"center",children:[d(yA,{column:!0,fullWidth:!0,gap:1,children:[t(N,{children:g("catalog.gift_wrapping.receiver")}),t("input",{type:"text",className:Vr("ton-input text-black black-border",M&&"is-invalid"),value:h,onChange:be=>Bt(be)}),ce.length>0&&ye&&t(v,{className:"ton-input autocomplete-gift-container black-border",gap:1,children:ce.map(be=>t(P,{className:"autocomplete-gift-item",onClick:Ae=>Es(be.name),children:be.name},be.id))}),M&&t(P,{className:"text-danger volter-bold",children:g("catalog.gift_wrapping.receiver_not_found.title")})]}),t(uE,{figure:J().figure,userName:J().userName,message:_,editable:!0,onChange:be=>I(be)}),d(P,{className:"form-check",children:[t("input",{className:"form-check-input",type:"checkbox",name:"showMyFace",checked:p,onChange:be=>E(Ae=>!Ae)}),t("label",{className:"form-check-label text-black",children:g("catalog.gift_wrapping.show_face.title")})]}),d(R,{alignItems:"center",gap:2,fullWidth:!0,children:[w&&t(P,{className:"gift-preview flex-shrink-0",children:t(bi,{productType:Ce.FLOOR,productClassId:ve,extraData:ft})}),d(v,{gap:1,fullWidth:!0,children:[d(R,{gap:2,children:[d(R,{alignSelf:"baseline",gap:2,children:[t(D,{onClick:()=>tn("prev_box"),className:"flex-grow-0",children:t(Gt,{icon:"chevron-left"})}),t(D,{onClick:()=>tn("next_box"),className:"flex-grow-0",children:t(Gt,{icon:"chevron-right"})})]}),d(v,{gap:1,fullWidth:!0,children:[t(N,{bold:!0,children:g(Ve)}),d(R,{alignItems:"center",gap:1,className:"text-black",children:[g(rs,["price"],[Y.price.toString()]),t(wt,{type:-1})]})]})]}),d(R,{alignItems:"center",gap:2,className:Ie?"":"opacity-50 pointer-events-none",children:[d(R,{alignSelf:"baseline",gap:2,children:[t(D,{onClick:()=>tn("prev_ribbon"),children:t(Gt,{icon:"chevron-left"})}),t(D,{onClick:()=>tn("next_ribbon"),children:t(Gt,{icon:"chevron-right"})})]}),t(N,{bold:!0,children:g(Ye)})]})]})]}),d(v,{gap:1,className:Ie?"":"opacity-50 pointer-events-none",children:[t(N,{bold:!0,children:g("catalog.gift_wrapping.pick_color")}),t(R,{gap:1,children:C.map(be=>t(wk,{active:be.id===w,disabled:!Ie,style:{backgroundColor:be.color},onClick:()=>O(be.id)},be.id))})]})]}),d(R,{justifyContent:"between",alignItems:"center",fullWidth:!0,className:"mt-1",children:[t(D,{skin:5,onClick:ie,className:"text-black",children:g("cancel")}),t(D,{skin:6,colour:L.primary_green,onClick:()=>tn("buy"),children:g("catalog.gift_wrapping.give_gift")})]})]})},yU=i=>{const[e,s]=a.useState(""),{currentType:n=null,rootNode:r=null,offersToNodes:o=null,searchResult:l=null,setSearchResult:c=null,setCurrentPage:u=null}=De();return a.useEffect(()=>{let h=e==null?void 0:e.toLocaleLowerCase().replace(" ","");if(!h||!h.length){c(null);return}const m=setTimeout(()=>{const p=J().getAllFurnitureData({loadFurnitureData:null});if(!p||!p.length)return;const E=[],_=[];for(const f of p){if(n===Us.BUILDER&&!f.availableForBuildersClub||n===Us.NORMAL&&f.excludeDynamic)continue;const S=[f.className,f.name,f.description].join(" ").replace(/ /gi,"").toLowerCase();if(n===Us.BUILDER&&f.purchaseOfferId===-1&&f.rentOfferId===-1)f.furniLine!==""&&_.indexOf(f.furniLine)<0&&S.indexOf(h)>=0&&_.push(f.furniLine);else if([...Uc(o,f.purchaseOfferId),...Uc(o,f.rentOfferId)].length&&(S.indexOf(h)>=0&&E.push(f),E.length===250))break}const I=[];for(const f of E)I.push(new Iy(f));let C=[];L_(h,_,r,C),c(new Ty(h,I,C.filter(f=>f.isVisible))),u(new Wl(-1,"default_3x3",new F_([],[]),I,!1,1))},300);return()=>clearTimeout(m)},[o,n,r,e,u,c]),d(R,{gap:1,justifyContent:"center",className:"ps-2",children:[t(V,{skin:4,colour:L.catalog_search_blue,position:"relative",className:"ton-shop-search-input align-items-center text-white",fullWidth:!0,children:t("input",{type:"text",placeholder:g("generic.search"),value:e,onChange:h=>s(h.target.value),className:"ton-input p-1"})}),(!e||!e.length)&&t(D,{className:"catalog-search-button",children:t("div",{className:"catalog-searchicon"})}),e&&!!e.length&&t(D,{className:"catalog-search-button",onClick:h=>s(""),children:t("div",{className:"catalog-searchicon"})})]})},oI=i=>{const{node:e=null,child:s=!1}=i;return t(z,{children:e&&e.children.length>0&&e.children.map((n,r)=>n.isVisible?t(iI,{node:n,child:s},r):null)})},iI=i=>{const{node:e=null,child:s=!1}=i,{activateNode:n=null}=De();return a.useMemo(()=>{let r={};return r["--item-color"]=e.iconColor,r},[e]),d(P,{className:"ton-list-section",children:[d(ul,{carat:e.isBranch,caratState:e.isOpen,onClick:r=>n(e),active:e.isActive,colour:e.iconColor,className:s?"inset":"",children:[t(rI,{icon:e.iconId}),e.localization]}),e.isOpen&&e.isBranch&&t(oI,{node:e,child:!0})]})},AU=i=>{const{node:e=null}=i,{searchResult:s=null}=De();return d(z,{children:[d(PE,{children:[s&&s.filteredNodes.length>0&&s.filteredNodes.map((n,r)=>t(iI,{node:n},r)),!s&&t(oI,{node:e})]}),t(yU,{})]})},kU=i=>{const{columnCount:e=5,...s}=i,[n,r]=a.useState(!1),[o,l]=a.useState(null),{currentOffer:c=null,setPurchaseOptions:u=null}=De(),{badgeCodes:h=[],activate:m=null,deactivate:p=null}=Yi(),E=a.useMemo(()=>{if(!o)return null;const _=new Oo;return _.setValue(["0",o,"",""]),_},[o]);return a.useEffect(()=>{c&&u(_=>{const I={..._};return I.extraParamRequired=!0,I.extraData=E&&E.getValue(1)||null,I.previewStuffData=E,I})},[c,E,u]),a.useEffect(()=>{if(!n)return;const _=m();return()=>p(_)},[n,m,p]),a.useEffect(()=>(r(!0),()=>r(!1)),[]),t(qe,{columnCount:e,...s,children:h&&h.length>0&&h.map((_,I)=>t(jt,{itemActive:o===_,onClick:C=>l(_),children:t(ot,{badgeCode:_})},I))})},$i=i=>{const{currentPage:e=null,setCurrentOffer:s=null}=De();return a.useEffect(()=>{!e||!e.offers.length||s(e.offers[0])},[e,s]),null},cc=i=>{const{offer:e=null,selectOffer:s=null,itemActive:n=!1,...r}=i,[o,l]=a.useState(!1),{requestOfferToMover:c=null}=De(),{isVisible:u=!1}=$n(),h=a.useMemo(()=>e.pricingModel===et.PRICING_MODEL_BUNDLE?null:e.product.getIconUrl(e),[e]),m=E=>{switch(E.type){case xe.MOUSE_DOWN:s(e),l(!0);return;case xe.MOUSE_UP:l(!1);return;case xe.ROLL_OUT:if(!o||!n||!u)return;c(e);return}},p=e.product;return p?t(jt,{itemImage:h,itemCount:e.pricingModel===et.PRICING_MODEL_MULTI?p.productCount:1,itemUniqueSoldout:p.uniqueLimitedItemSeriesSize&&!p.uniqueLimitedItemsLeft,itemUniqueNumber:p.uniqueLimitedItemSeriesSize,itemActive:n,onMouseDown:m,onMouseUp:m,onMouseOut:m,catalogue:!0,avatarImage:e.product.productType===Ce.ROBOT,...r,children:e.product.productType===Ce.ROBOT&&t(it,{figure:e.product.extraParam,headOnly:!0,direction:3})}):null},Bo=i=>{const{columnCount:e=5,children:s=null,...n}=i,{currentOffer:r=null,setCurrentOffer:o=null,currentPage:l=null,setPurchaseOptions:c=null}=De(),u=a.useRef();if(a.useEffect(()=>{u&&u.current&&(u.current.scrollTop=0)},[l]),!l)return null;const h=m=>{m.activate(),!m.isLazy&&(o(m),m.product&&m.product.productType===Ce.WALL&&c(p=>{const E={...p};return E.extraData=m.product.extraParam||null,E}))};return d(qe,{className:"ton-shop-grid",gap:0,columnCount:e,columnMinHeight:38,columnMinWidth:38,columnMaxWidth:"38px",...n,children:[l.offers&&l.offers.length>0&&l.offers.map((m,p)=>t(cc,{itemActive:r&&r.offerId===m.offerId,offer:m,selectOffer:h},p)),s]})},Qi=i=>{const{children:e=null,...s}=i,{currentOffer:n=null}=De();return!n||n.pricingModel!==et.PRICING_MODEL_SINGLE||!n.product.isUniqueLimitedItem?null:d(P,{...s,children:[t(UA,{className:"mx-auto",uniqueLimitedItemsLeft:n.product.uniqueLimitedItemsLeft,uniqueLimitedSeriesSize:n.product.uniqueLimitedItemSeriesSize}),e]})},xs=i=>{const{noGiftOption:e=!1,purchaseCallback:s=null}=i;a.useState(!1);const[n,r]=a.useState(Oe.NONE);ji(Ao.CATALOG_SKIP_PURCHASE_CONFIRMATION,!1);const{currentOffer:o=null,currentPage:l=null,purchaseOptions:c=null,setPurchaseOptions:u=null,calculateDiscount:h=null}=De(),{getCurrencyAmount:m=null}=An(),p=a.useCallback(S=>{switch(S.type){case Zs.PURCHASE_SUCCESS:r(Oe.NONE);return;case On.PURCHASE_FAILED:r(Oe.FAILED);return;case Wr.NOT_ALLOWED:r(Oe.FAILED);return;case jr.SOLD_OUT:r(Oe.SOLD_OUT);return}},[]);ct(Zs.PURCHASE_SUCCESS,p),ct(On.PURCHASE_FAILED,p),ct(Wr.NOT_ALLOWED,p),ct(jr.SOLD_OUT,p);const E=a.useMemo(()=>{if(!o||c.extraParamRequired&&(!c.extraData||!c.extraData.length))return!1;if(o.pricingModel===et.PRICING_MODEL_SINGLE){const S=o.product;if(S&&S.isUniqueLimitedItem)return!S.uniqueLimitedItemsLeft}return!1},[o,c]),_=a.useMemo(()=>o?h(o.priceInCredits):null,[h,o]),I=a.useMemo(()=>o?h(o.priceInActivityPoints):null,[h,o]),C=(S=!1)=>{if(!o)return;if(gs()<o.clubLevel){oe("habboUI/open/hccenter");return}if(S){At(new Yk(o.page.pageId,o.offerId,c.extraData));return}if(r(Oe.PURCHASE),s){s();return}let T=o.page.pageId;B(new Yr(T,o.offerId,c.extraData,c.quantity))};return a.useEffect(()=>{o&&r(Oe.NONE)},[o,u]),a.useEffect(()=>{let S=null;return(n===Oe.CONFIRM||n===Oe.FAILED)&&(S=setTimeout(()=>r(Oe.NONE),3e3)),()=>{S&&clearTimeout(S)}},[n]),o?d(v,{gap:1,children:[t(()=>{if(o.priceInCredits*c.quantity,o.priceInActivityPoints*c.quantity,gs()<o.clubLevel)return t(D,{disabled:!0,children:g("catalog.alert.hc.required")});if(E)return t(D,{disabled:!0,children:g("catalog.alert.limited_edition_sold_out.title")});if(_.price>m(-1))return t(D,{skin:5,disabled:!0,children:g("catalog.alert.notenough.title")});if(I.price>m(o.activityPointType))return t(D,{skin:5,disabled:!0,children:g("catalog.alert.notenough.activitypoints.title."+o.activityPointType)});switch(n){case Oe.CONFIRM:return t(D,{skin:6,colour:L.primary_green,onClick:S=>C(),children:g("catalog.marketplace.confirm_title")});case Oe.PURCHASE:return t(D,{skin:6,colour:L.primary_green,disabled:!0,children:"..."});case Oe.FAILED:return setTimeout(()=>r(0),1e3),t(D,{skin:6,colour:L.primary_red,children:g("generic.failed")});case Oe.SOLD_OUT:return t(D,{skin:6,colour:L.primary_green,children:g("generic.failed")+" - "+g("catalog.alert.limited_edition_sold_out.title")});case Oe.NONE:default:return t(D,{skin:6,colour:L.primary_green,disabled:c.extraParamRequired&&(!c.extraData||!c.extraData.length),onClick:S=>r(Oe.CONFIRM),children:g("catalog.purchase_confirmation."+(o.isRentOffer?"rent":"buy"))})}},{}),!e&&!o.isRentOffer&&t(D,{skin:5,disabled:c.quantity>1||!o.giftable||E||c.extraParamRequired&&(!c.extraData||!c.extraData.length),onClick:S=>C(!0),children:g("catalog.purchase_confirmation.gift")})]}):null},uc=i=>{const{offer:e=null,separator:s=!1}=i,{purchaseOptions:n=null,calculateDiscount:r}=De(),{quantity:o=1}=n,l=a.useMemo(()=>e?r(e.priceInCredits):null,[r,e]),c=a.useMemo(()=>e?r(e.priceInActivityPoints):null,[r,e]);return e?d(z,{children:[e.priceInCredits>0&&d(R,{alignItems:"center",gap:1,children:[t(wt,{type:-1}),d(N,{bold:!0,children:[" ",l.itemsDiscounted>=1?l.price:e.priceInCredits*o]}),l.itemsDiscounted>=1&&d(N,{className:"text-grey position-relative",children:[t("hr",{className:"position-absolute w-100 text-black bg-danger top-0 bottom-0 mt-1 mb-1 opacity-100"}),e.priceInCredits*o]})]}),s&&e.priceInCredits>0&&e.priceInActivityPoints>0&&t(FontAwesomeIcon,{size:"xs",color:"black",icon:"plus"}),e.priceInActivityPoints>0&&d(R,{alignItems:"center",gap:1,children:[t(wt,{type:e.activityPointType}),d(N,{bold:!0,children:[" ",c.itemsDiscounted>=1?c.price:e.priceInActivityPoints*o]}),c.itemsDiscounted>=1&&d(N,{className:"text-grey position-relative",children:[t("hr",{className:"position-absolute w-100 text-black bg-danger top-0 bottom-0 mt-1 mb-1 opacity-100"}),e.priceInActivityPoints*o]})]})]}):null},kn=i=>{const{gap:e=1,...s}=i,{currentOffer:n=null}=De();return t(v,{gap:e,...s,children:t(uc,{offer:n})})},Qn=i=>{const{currentOffer:e=null,roomPreviewer:s=null,purchaseOptions:n=null}=De(),{previewStuffData:r=null}=n;return a.useEffect(()=>{if(!e||e.pricingModel===et.PRICING_MODEL_BUNDLE||!s)return;const o=e.product;if(o)switch(s.reset(!1),o.productType){case Ce.FLOOR:{if(!o.furnitureData)return;if(o.furnitureData.specialType===ae.FIGURE_PURCHASABLE_SET){const c=J().getFloorItemData(o.furnitureData.id).customParams.split(",").map(m=>parseInt(m)),u=[];for(const m of c)Mt().isValidFigureSetForGender(m,J().gender)&&u.push(m);const h=Mt().getFigureStringWithFigureIds(J().figure,J().gender,u);s.addAvatarIntoRoom(h,o.productClassId)}else s.addFurnitureIntoRoom(o.productClassId,new Lt(90),r,o.extraParam);return}case Ce.WALL:{if(!o.furnitureData)return;switch(o.furnitureData.specialType){case ae.FLOOR:s.updateObjectRoom(o.extraParam);return;case ae.WALL_PAPER:s.updateObjectRoom(null,o.extraParam);return;case ae.LANDSCAPE:{s.updateObjectRoom(null,null,o.extraParam);const l=J().getWallItemDataByName("window_double_default");l&&s.addWallItemIntoRoom(l.id,new Lt(90),l.customParams);return}default:s.updateObjectRoom("default","default","default"),s.addWallItemIntoRoom(o.productClassId,new Lt(90),o.extraParam);return}}case Ce.ROBOT:s.addAvatarIntoRoom(o.extraParam,0);return;case Ce.EFFECT:s.addAvatarIntoRoom(J().figure,o.productClassId);return}},[e,r,s]),e?e.pricingModel===et.PRICING_MODEL_BUNDLE?t(v,{fit:!0,overflow:"hidden",className:"bg-muted p-2",children:t(qe,{fullWidth:!0,columnCount:4,className:"nitro-catalog-layout-bundle-grid",children:e.products.length>0&&e.products.map((o,l)=>t(Rn,{itemImage:o.getIconUrl(e),itemCount:o.productCount},l))})}):t(zi,{roomPreviewer:s,fullHeight:!0}):null},MU=i=>{const{page:e=null}=i,{currentOffer:s=null}=De();return t(z,{children:d(P,{style:{height:310},className:"ton-shop-page-content overflow-auto",children:[t($i,{}),d(pe,{children:[d(v,{size:7,overflow:"hidden",children:[t(Bo,{shrink:!0}),d(v,{gap:1,overflow:"hidden",children:[t(N,{truncate:!0,shrink:!0,bold:!0,children:g("catalog_selectbadge")}),t(kU,{})]})]}),d(v,{center:!s,size:5,overflow:"hidden",children:[!s&&d(z,{children:[!!e.localization.getImage(1)&&t("img",{alt:"",src:e.localization.getImage(1)}),t(N,{center:!0,dangerouslySetInnerHTML:{__html:e.localization.getText(0)}})]}),s&&d(z,{children:[t(P,{position:"relative",overflow:"hidden",fullHeight:!0,children:t(Qn,{})}),d(v,{grow:!0,gap:1,children:[t(Qi,{fullWidth:!0}),t(N,{grow:!0,truncate:!0,children:s.localizationName}),t(R,{justifyContent:"end",children:t(kn,{alignItems:"end"})}),t(xs,{})]})]})]})]})]})})},Yn=i=>{const{...e}=i,{currentOffer:s=null}=De();return!s||!s.badgeCode||!s.badgeCode.length?null:t(ot,{badgeCode:s.badgeCode,...e})},UU=0,dc=i=>{const{currentOffer:e=null,purchaseOptions:s=null,setPurchaseOptions:n=null,ruleSet:r=null}=De(),{quantity:o=1}=s,l=c=>{isNaN(c)&&(c=1),c=Math.max(c,UU),c=Math.min(c,r.maximumAllowedItems),c!==o&&n(u=>{const h={...u};return h.quantity=c,h})};return!e||!e.bundlePurchaseAllowed?null:t(z,{children:d(R,{alignItems:"center",gap:1,fullWidth:!0,children:[t(N,{children:g("catalog.bundlewidget.quantity")}),t("input",{type:"number",className:"w-100",value:o,onChange:c=>l(c.target.valueAsNumber)})]})})},LU=i=>{const{page:e=null}=i,[s,n]=a.useState(new Map),{currentOffer:r=null,setCurrentOffer:o=null}=De(),[l,c]=a.useState(!1),u=(_,I)=>!_.product.furnitureData.colorIndex||!I.product.furnitureData.colorIndex||_.product.furnitureData.colorIndex>I.product.furnitureData.colorIndex?1:_==I?0:-1,h=(_,I)=>_.product.furnitureData.className>I.product.furnitureData.className?1:_==I?0:-1,m=_=>{_.activate(),o(_)},p=(_,I)=>{const C=`${I}*${_}`,f=e.offers.findIndex(S=>S.product.furnitureData.fullName===C);f>-1&&m(e.offers[f])},E=a.useMemo(()=>{const _=[],I=new Map,C=new Map;e.offers.sort(u);let f=0;return e.offers.forEach(S=>{if(!S.product)return;const T=S.product.furnitureData;if(!T||!T.hasIndexedColor)_.push(S);else{const b=T.className,y=T.colorIndex;if(C.has(b)||C.set(b,[]),T.colors){for(let w of T.colors)f=w;C.get(b).indexOf(f)===-1&&(C.get(b)[y]=f)}I.has(b)||(_.push(S),I.set(b,!0))}}),_.sort(h),n(C),_},[e.offers]);return d(pe,{children:[t(v,{size:6,overflow:"hidden",children:d(qe,{columnCount:5,className:"ton-shop-grid",gap:1,columnMinHeight:38,columnMinWidth:38,children:[(!l||!r||!s.has(r.product.furnitureData.className))&&E.map((_,I)=>t(cc,{itemActive:r&&(r.product.furnitureData.hasIndexedColor?r.product.furnitureData.className===_.product.furnitureData.className:r.offerId===_.offerId),offer:_,selectOffer:m},I)),l&&r&&s.has(r.product.furnitureData.className)&&s.get(r.product.furnitureData.className).map((_,I)=>t(Rn,{itemHighlight:!0,itemActive:r.product.furnitureData.colorIndex===I,itemColor:Qs.int2rgb(_),className:"clear-bg",onClick:C=>p(I,r.product.furnitureData.className)},I))]})}),d(v,{center:!r,size:6,overflow:"hidden",children:[!r&&d(z,{children:[!!e.localization.getImage(1)&&t("img",{alt:"",src:e.localization.getImage(1)}),t(N,{center:!0,dangerouslySetInnerHTML:{__html:e.localization.getText(0)}})]}),r&&d(z,{children:[d(P,{position:"relative",overflow:"hidden",fullHeight:!0,children:[t(Qn,{}),t(Yn,{position:"absolute",className:"bg-muted bottom-1 end-1"}),r.product.furnitureData.hasIndexedColor&&t(D,{position:"absolute",className:"bottom-1 start-1",onClick:_=>c(I=>!I),children:t(Gt,{icon:"fill-drip"})})]}),d(v,{grow:!0,gap:1,children:[t(Qi,{fullWidth:!0}),t(N,{grow:!0,truncate:!0,children:r.localizationName}),d(R,{justifyContent:"between",children:[t(v,{gap:1,children:t(dc,{})}),t(kn,{justifyContent:"end",alignItems:"end"})]}),t(xs,{})]})]})]})]})},aI=i=>{const{baseline:e=!1}=i,{currentOffer:s=null,currentPage:n}=De();if(!s)return d("div",{className:"position-relative ton-shop-image d-flex justify-content-center flex-column text-black"+(e?" align-self-baseline":""),children:[d(R,{justifyContent:"center",className:"pb-1",children:[!!n.localization.getImage(1)&&t("img",{alt:"",src:n.localization.getImage(1)}),!!n.localization.getImage(2)&&d("div",{className:"ton-shop-special",children:[t("span",{className:"position-absolute",dangerouslySetInnerHTML:{__html:n.localization.getText(1)}}),t("img",{alt:"",src:n.localization.getImage(2)})]})]}),n.localization.getText(2)]})},PU=i=>{const{currentOffer:e=null,currentPage:s,calculateDiscount:n}=De(),r=a.useMemo(()=>{if(!e)return null;switch(e.priceType){case et.PRICE_TYPE_CREDITS:return ee("currency.colours")[-1];case et.PRICE_TYPE_ACTIVITYPOINTS:return ee("currency.colours")[e.activityPointType];default:return L.catalog_tab_inactive_grey}},[e]);return t(v,{fullHeight:!0,overflow:"hidden",children:t(P,{className:"ton-shop-page-content overflow-auto",fullHeight:!0,children:d(R,{className:"overflow-hidden",fullHeight:!0,fullWidth:!0,gap:2,children:[s.offers&&s.offers.length>0&&t(v,{className:"ton-item-picker",size:6,overflow:"hidden",fullWidth:!0,children:t(Bo,{})}),d(v,{className:"ton-shop-image position-relative h-100 overflow-hidden",justifyContent:"center",fullWidth:!0,center:!e,size:4,children:[t(aI,{}),e&&d(z,{children:[d(R,{center:!0,overflow:"hidden",fullHeight:!0,position:"relative",children:[e.product.productType!==Ce.BADGE&&d(z,{children:[t(Qn,{}),t(Qi,{fullWidth:!0,position:"absolute",className:"top-1"}),t(Yn,{position:"absolute",className:"top-1 end-1"})]}),e.product.productType===Ce.BADGE&&t(Yn,{className:"scale-2"}),t(V,{skin:6,colour:r,className:"p-1 position-absolute bottom-0 end-0 m-1",children:(e.priceInCredits>0||e.priceInActivityPoints>0)&&t(kn,{})})]}),d(v,{grow:!0,gap:0,children:[t(N,{className:"volter-bold",children:e.localizationName}),t(R,{justifyContent:"center",className:"pb-1 pt-1",fullWidth:!0,children:t(dc,{})}),d(R,{gap:1,alignItems:"center",justifyContent:"center",children:[e.priceInCredits>0&&t(xs,{}),e.priceInCredits==0&&t(xs,{})]})]})]})]})]})})})},DU=i=>{const{...e}=i,{currentOffer:s=null,purchaseOptions:n=null}=De(),{previewStuffData:r=null}=n,o=a.useMemo(()=>{if(!s||!r)return null;const l=r.getValue(2);return!l||!l.length?null:l},[s,r]);return o?t(ot,{badgeCode:o,isGroup:!0,...e}):null},hc=i=>{const{selectedGroupIndex:e,setSelectedGroupIndex:s,currentOffer:n=null,catalogOptions:r=null,setPurchaseOptions:o=null}=De(),{groups:l=null}=r,c=a.useMemo(()=>{if(!l||!l.length)return null;const h=l[e];if(!h)return null;const m=new Oo;return m.setValue(["0",h.groupId.toString(),h.badgeCode,h.colorA,h.colorB]),m},[e,l]);if(a.useEffect(()=>{n&&o(h=>{const m={...h};return m.extraParamRequired=!0,m.extraData=c&&c.getValue(1)||null,m.previewStuffData=c,m})},[n,c,o]),a.useEffect(()=>{B(new bl)},[]),!l||!l.length)return d(P,{className:"bg-muted p-1 text-black text-center",children:[g("catalog.guild_selector.members_only"),t(D,{className:"mt-1",children:g("catalog.guild_selector.find_groups")})]});const u=l[e];return d(R,{gap:1,children:[!!u&&d(R,{overflow:"hidden",className:"border",children:[t(P,{fullHeight:!0,style:{width:"20px",backgroundColor:"#"+u.colorA}}),t(P,{fullHeight:!0,style:{width:"20px",backgroundColor:"#"+u.colorB}})]}),t("select",{className:"ton-carat position-static w-100 ",value:e,onChange:h=>s(parseInt(h.target.value)),children:l.map((h,m)=>t("option",{value:m,children:h.groupName},m))})]})},FU=i=>{const{page:e=null}=i,{currentOffer:s=null}=De();return d(pe,{children:[t(v,{className:"ton-item-picker",size:7,overflow:"hidden",fullWidth:!0,children:t(Bo,{gap:1})}),d(v,{center:!s,size:5,overflow:"hidden",children:[!s&&d(z,{children:[!!e.localization.getImage(1)&&t("img",{alt:"",src:e.localization.getImage(1)}),t(N,{center:!0,dangerouslySetInnerHTML:{__html:e.localization.getText(0)}})]}),s&&d(z,{children:[d(P,{position:"relative",overflow:"hidden",fullHeight:!0,children:[t(Qn,{}),t(DU,{position:"absolute",className:"bottom-1 end-1"})]}),d(v,{grow:!0,gap:1,children:[t(N,{truncate:!0,children:s.localizationName}),t(P,{grow:!0,children:t(hc,{})}),t(R,{justifyContent:"end",children:t(kn,{alignItems:"end"})}),t(xs,{})]})]})]})]})},xU=i=>{const{page:e=null}=i,{selectedGroupIndex:s,currentOffer:n=null,catalogOptions:r=null}=De(),{groups:o=null}=r,[l,c]=a.useState(-1);return a.useEffect(()=>{!o||!o.length||o[s]},[o,s]),d(R,{fullHeight:!0,overflow:"hidden",fullWidth:!0,gap:1,children:[t(v,{fullHeight:!0,fullWidth:!0,children:d(V,{overflow:"hidden",className:"p-2 text-black",gap:2,children:[t(N,{bold:!0,dangerouslySetInnerHTML:{__html:e.localization.getText(2)}}),t(P,{dangerouslySetInnerHTML:{__html:e.localization.getText(1)}})]})}),d(v,{fullWidth:!0,gap:1,children:[t(N,{bold:!0,children:g("compexp.pick.type")}),t("select",{className:"mb-2",value:l,onChange:u=>c(parseInt(u.target.value)),children:t("option",{disabled:!0,value:"-1",children:g("compexp.type")})}),t(N,{bold:!0,children:g("compexp.pick.group")}),t(hc,{}),t(D,{skin:6,colour:L.primary_green,children:g("catalog.purchase_confirmation.buy")})]})]})},GU=i=>{const{page:e=null}=i;a.useState(0);const{currentOffer:s=null,setCurrentOffer:n=null,catalogOptions:r=null}=De();return a.useEffect(()=>{B(new bl)},[e]),d(z,{children:[t($i,{}),d(pe,{children:[t(v,{className:"bg-muted p-2 text-black",size:7,overflow:"hidden",children:t(P,{className:"overflow-auto",dangerouslySetInnerHTML:{__html:e.localization.getText(1)}})}),t(v,{size:5,overflow:"hidden",gap:1,children:!!s&&t(z,{children:d(v,{grow:!0,gap:1,children:[t(N,{truncate:!0,children:s.localizationName}),t(P,{grow:!0,children:t(hc,{})}),t(R,{justifyContent:"end",children:t(kn,{alignItems:"end"})}),t(xs,{noGiftOption:!0})]})})})]})]})},BU=i=>{const{page:e=null}=i;return d(pe,{children:[t(v,{size:5,className:"my-auto",children:d(V,{overflow:"hidden",className:"p-2 text-black",gap:2,children:[t(N,{bold:!0,dangerouslySetInnerHTML:{__html:e.localization.getText(2)}}),t(P,{dangerouslySetInnerHTML:{__html:e.localization.getText(1)}})]})}),d(v,{center:!0,size:7,overflow:"hidden",children:[t(yn,{imageUrl:e.localization.getImage(1)}),t(D,{onClick:()=>oe("groups/create"),children:g("catalog.start.guild.purchase.button")})]})]})},HU=i=>{const{page:e=null}=i;return De(),t(z,{children:t(V,{skin:10,colour:L.club_yellow,children:d(R,{className:"ton-catalog-layout-info-loyalty",gap:2,children:[t("div",{className:"overflow-auto d-flex flex-column info-loyalty-content"}),t(N,{variant:"none",dangerouslySetInnerHTML:{__html:e.localization.getText(1)}})]})})})},lI=i=>{const{page:e=null}=i,s=e.localization.getImage(1);return d(v,{grow:!0,className:"text-black p-2",overflow:"hidden",children:[d(R,{alignItems:"center",gap:2,className:"px-4",children:[s&&t("img",{alt:"",src:s}),d(R,{column:!0,alignSelf:"center",children:[t(P,{className:"volter-bold",dangerouslySetInnerHTML:{__html:e.localization.getText(1)}}),t(P,{dangerouslySetInnerHTML:{__html:e.localization.getText(0)}})]})]}),t(V,{skin:4,colour:L.primary_blue,className:"text-white p-2 h-100",overflow:"hidden",children:t(v,{grow:!0,overflow:"auto",fullHeight:!0,children:t(P,{dangerouslySetInnerHTML:{__html:e.localization.getText(2)}})})}),t(R,{alignItems:"center",children:t(P,{className:"volter-bold",dangerouslySetInnerHTML:{__html:e.localization.getText(3)}})})]})},VU=i=>t(lI,{...i}),WU=i=>{const{page:e=null}=i,{recyclerLimit:s,getIconFor:n,doRecycle:r,recycling:o}=$E();return d(R,{fullHeight:!0,fullWidth:!0,position:"relative",className:"pt-4 mt-4",children:[d(R,{column:!0,fullHeight:!0,fullWidth:!0,children:[t(qe,{gap:1,fullWidth:!0,columnCount:5,columnMaxWidth:"38px",columnMinWidth:38,columnMinHeight:38,className:"mt-4 pt-1 ps-2",children:[...Array(s)].map((l,c)=>t(V,{className:"ton-inventory-grid-item",children:t(P,{fit:!0,style:{backgroundImage:`url(${n(c)})`},className:"ton-inventory-grid-item"})},c))}),t(D,{skin:1,className:"align-self-start mx-3 mt-4",onClick:l=>r(o),children:g("catalog.recycler.button.recycle")})]}),!!e.localization.getImage(1)&&t("img",{alt:"",className:"position-absolute end-0 bottom-0 mb-4 pb-4 me-2",src:e.localization.getImage(1)})]})},jU=i=>{const{page:e=null}=i,[s,n]=a.useState(""),[r,o]=a.useState(""),[l,c]=a.useState(-1),[u,h]=a.useState([]),[m,p]=a.useState(!1),[E,_]=a.useState(1),[I,C]=a.useState(null),{currentPage:f=null}=De(),S=()=>{const T=e.pageId,b=e.offers.length>=1?e.offers[0].offerId:-1,y=l,w=s,O=r,F=E;B(new ap(T,b,y,w,m,O,F))};return W(sh,T=>{const b=T.getParser();b&&h(b.rooms)}),W(Il,T=>{const b=T.getParser();C(b.categories)}),a.useEffect(()=>{B(new op),B(new Al)},[]),d(z,{children:[t(v,{alignItems:"center",children:t(nI,{image:f.localization.getImage(0)})}),t(N,{bold:!0,center:!0,children:g("roomad.catalog_header")}),d(v,{size:12,overflow:"hidden",className:"text-black",children:[t(P,{children:g("roomad.catalog_text")}),d(P,{className:"bg-muted p-1",children:[d(v,{gap:1,children:[t(N,{bold:!0,children:g("roomad.catalog_name")}),t(V,{skin:4,colour:L.lighter_grey,position:"relative",children:t("input",{type:"text",className:"ton-input",maxLength:64,value:s,onChange:T=>n(T.target.value)})})]}),d(v,{gap:1,children:[t(N,{bold:!0,children:g("roomad.catalog_description")}),t(V,{skin:4,colour:L.lighter_grey,position:"relative",children:t("textarea",{className:"ton-input",maxLength:64,value:r,onChange:T=>o(T.target.value)})})]}),d(v,{gap:1,children:[t(N,{bold:!0,children:g("roomad.catalog_roomname")}),d("select",{className:"ton-carat position-static w-100 ",value:l,onChange:T=>c(parseInt(T.target.value)),children:[t("option",{value:-1,disabled:!0,children:g("roomad.catalog_roomname")}),u&&u.map((T,b)=>t("option",{value:T.roomId,children:T.roomName},b))]})]}),t(v,{gap:1,children:t(D,{disabled:!s||!r||!l,onClick:S,children:g("buy")})})]})]})]})},cI=i=>{const{columnCount:e=5,children:s=null,...n}=i,{currentOffer:r=null}=De(),o=a.useRef();return a.useEffect(()=>{o&&o.current&&(o.current.scrollTop=0)},[r]),r?d(qe,{columnCount:5,...n,children:[r.products&&r.products.length>0&&r.products.map((l,c)=>t(jt,{itemImage:l.getIconUrl(),itemCount:l.productCount,catalogue:!0},c)),s]}):null},uI=i=>{const{gap:e=1,...s}=i,{currentOffer:n=null}=De();return t(R,{gap:e,alignItems:"center",classNames:["p-1"],...s,children:t(uc,{separator:!0,offer:n})})},qU=i=>{const{page:e=null}=i;return d(z,{children:[t($i,{}),d(pe,{children:[d(v,{size:7,overflow:"hidden",children:[!!e.localization.getText(2)&&t(N,{dangerouslySetInnerHTML:{__html:e.localization.getText(2)}}),t(v,{grow:!0,overflow:"hidden",className:"bg-muted p-2",children:t(cI,{fullWidth:!0,className:"nitro-catalog-layout-bundle-grid"})})]}),d(v,{size:5,overflow:"hidden",gap:1,children:[!!e.localization.getText(1)&&t(N,{center:!0,overflow:"auto",children:e.localization.getText(1)}),d(v,{grow:!0,position:"relative",overflow:"hidden",gap:0,children:[!!e.localization.getImage(1)&&t("img",{alt:"",className:"flex-grow-1",src:e.localization.getImage(1)}),t(Yn,{position:"absolute",className:"bg-muted bottom-0 start-0"}),t(uI,{position:"absolute",className:"bottom-0 end-0"})]}),t(v,{gap:1,children:t(xs,{})})]})]})]})},YU=i=>{const{page:e=null}=i;return d(z,{children:[t($i,{}),d(v,{position:"relative",children:[d(v,{position:"relative",children:[!!e.localization.getText(1)&&t(N,{center:!0,overflow:"auto",children:e.localization.getText(1)}),!!e.localization.getImage(1)&&t("img",{alt:"",className:"ton-bundle-image",src:e.localization.getImage(1)}),t(Yn,{position:"absolute",className:"bg-muted bottom-0 end-0"})]}),d(v,{overflow:"hidden",children:[!!e.localization.getText(2)&&t(N,{dangerouslySetInnerHTML:{__html:e.localization.getText(2)}}),t(V,{skin:0,colour:L.white,className:"ton-bundle-grid",children:t(cI,{fullWidth:!0,className:"nitro-catalog-layout-bundle-grid"})})]}),t(v,{alignItems:"end",overflow:"hidden",gap:1,children:t(V,{skin:4,colour:L.light_grey,className:"p-2",children:d(R,{gap:2,justifyContent:"between",alignItems:"center",children:[t(uI,{}),t(R,{gap:1,column:!0,children:t(xs,{})})]})})})]})]})},zU=i=>{const[e,s]=a.useState(-1),[n,r]=a.useState(""),{currentOffer:o=null,currentPage:l=null,getCurrencyColour:c}=De(),u=h=>{var m;return(m=_e().soundManager.musicController)==null?void 0:m.playSong(h,lo.PRIORITY_PURCHASE_PREVIEW,15,0,0,0)};return W(Ig,h=>{const m=h.getParser();m.officialSongId===n&&s(m.songId)}),a.useEffect(()=>{if(!o)return;const h=o.product;if(h){if(h.extraParam.length>0){const m=parseInt(h.extraParam);m>0?s(m):(r(h.extraParam),B(new E_(h.extraParam)))}else r(""),s(-1);return()=>{var m;return(m=_e().soundManager.musicController)==null?void 0:m.stop(lo.PRIORITY_PURCHASE_PREVIEW)}}},[o]),a.useEffect(()=>()=>{var h;return(h=_e().soundManager.musicController)==null?void 0:h.stop(lo.PRIORITY_PURCHASE_PREVIEW)},[]),t(v,{fullHeight:!0,overflow:"hidden",children:t(P,{className:"ton-shop-page-content overflow-auto",fullHeight:!0,children:d(R,{className:"overflow-hidden",fullHeight:!0,fullWidth:!0,gap:2,children:[l.offers&&l.offers.length>0&&t(v,{className:"ton-item-picker",size:6,overflow:"hidden",fullWidth:!0,children:t(Bo,{})}),d(v,{className:"ton-shop-image position-relative h-100 overflow-hidden",justifyContent:"center",fullWidth:!0,center:!o,size:4,children:[t(aI,{}),o&&d(z,{children:[d(R,{center:!0,overflow:"hidden",fullHeight:!0,position:"relative",children:[o.product.productType!==Ce.BADGE&&d(z,{children:[t(Qn,{}),t(Qi,{fullWidth:!0,position:"absolute",className:"top-1"}),t(Yn,{position:"absolute",className:"bg-muted top-1 end-1"})]}),o.product.productType===Ce.BADGE&&t(Yn,{className:"scale-2"}),t(V,{skin:6,colour:c,className:"p-1 position-absolute bottom-0 end-0 m-1",children:(o.priceInCredits>0||o.priceInActivityPoints>0)&&t(kn,{})})]}),d(v,{grow:!0,gap:1,children:[t(N,{grow:!0,truncate:!0,className:"volter-bold",children:o.localizationName}),e>-1&&t(D,{onClick:()=>u(e),children:g("play_preview_button")}),t(R,{justifyContent:"center",className:"pb-1 pt-1",fullWidth:!0,children:t(dc,{})}),t(R,{gap:1,alignItems:"center",justifyContent:"center",children:t(xs,{})})]})]})]})]})})})},KU=["floors","walls","views"],$U=i=>{const{columnCount:e=5,children:s=null,...n}=i,[r,o]=a.useState(null),[l,c]=a.useState(-1),[u,h]=a.useState(null),{currentPage:m=null,currentOffer:p=null,setCurrentOffer:E=null,setPurchaseOptions:_=null}=De(),I=a.useRef(),C=S=>{S&&h(T=>{const b=[...T];return b[l]=S,b})};if(a.useEffect(()=>{if(!m)return;const S=[[],[],[]];for(const T of m.offers){if(T.pricingModel!==et.PRICING_MODEL_SINGLE&&T.pricingModel!==et.PRICING_MODEL_MULTI)continue;const b=T.product;if(!b||b.productType!==Ce.WALL&&b.productType!==Ce.FLOOR||!b.furnitureData)continue;switch(b.furnitureData.className){case"floor":S[0].push(T);break;case"wallpaper":S[1].push(T);break;case"landscape":S[2].push(T);break}}o(S),c(0),h([S[0][0],S[1][0],S[2][0]])},[m]),a.useEffect(()=>{l===-1||!u||E(u[l])},[l,u,E]),a.useEffect(()=>{l===-1||!u||!p||_(S=>{const T={...S};return T.extraData=u[l].product.extraParam,T.extraParamRequired=!0,T})},[p,l,u,_]),a.useEffect(()=>{I&&I.current&&(I.current.scrollTop=0)},[l]),!r||l===-1)return null;const f=r[l];return d(z,{children:[t(zr,{className:"justify-content-center gap-2",children:KU.map((S,T)=>t(D,{disabled:l===T,onClick:b=>c(T),children:g(`catalog.spaces.tab.${S}`)},T))}),d(qe,{innerRef:I,className:"ton-shop-grid",gap:0,columnCount:e,columnMinHeight:38,columnMinWidth:38,columnMaxWidth:"38px",...n,children:[f&&f.length>0&&f.map((S,T)=>t(cc,{itemActive:p&&p===S,offer:S,selectOffer:b=>C(b)},T)),s]})]})},QU=i=>{const{page:e=null}=i,{currentOffer:s=null,roomPreviewer:n=null,currentPage:r}=De();a.useEffect(()=>{n.updatePreviewObjectBoundingRectangle(new Bn)},[n]);const o=a.useMemo(()=>{if(!s)return null;switch(s.priceType){case et.PRICE_TYPE_CREDITS:return ee("currency.colours")[-1];case et.PRICE_TYPE_ACTIVITYPOINTS:return ee("currency.colours")[s.activityPointType];default:return L.catalog_tab_inactive_grey}},[s]);return t(P,{className:"ton-shop-page-content overflow-auto",fullHeight:!0,children:d(R,{fullHeight:!0,fullWidth:!0,overflow:"hidden",gap:2,children:[t(v,{className:"ton-item-picker",size:6,overflow:"hidden",fullWidth:!0,children:t($U,{})}),d(v,{center:!s,size:4,className:"ton-shop-image",overflow:"hidden",children:[!s&&d(z,{children:[!!e.localization.getImage(1)&&t("img",{alt:"",src:e.localization.getImage(1)}),t(N,{center:!0,dangerouslySetInnerHTML:{__html:e.localization.getText(0)}})]}),s&&d(z,{children:[d(P,{fullHeight:!0,position:"relative",overflow:"hidden",children:[t(Qn,{}),t(V,{skin:6,colour:o,className:"p-1 position-absolute bottom-0 end-0 m-1",children:(s.priceInCredits>0||s.priceInActivityPoints>0)&&t(kn,{})})]}),d(v,{grow:!0,gap:1,children:[t(N,{grow:!0,truncate:!0,children:s.localizationName}),t(xs,{})]})]})]})]})})},XU=i=>{const{page:e=null}=i,[s,n]=a.useState(""),{currentOffer:r=null,setPurchaseOptions:o=null,getCurrencyColour:l}=De();return a.useEffect(()=>{r&&o(c=>{const u={...c};return u.extraData=s,u})},[r,s,o]),d(v,{overflow:"hidden",className:"ton-shop-page-content",fullHeight:!0,fullWidth:!0,gap:1,children:[d(R,{gap:2,className:"h-75",overflow:"hidden",children:[t(v,{className:"ton-item-picker",size:6,overflow:"hidden",fullWidth:!0,children:t(Bo,{})}),d(v,{className:"ton-shop-image position-relative overflow-hidden",fullHeight:!0,justifyContent:"center",fullWidth:!0,center:!r,size:6,children:[!r&&d(z,{children:[!!e.localization.getImage(1)&&t("img",{alt:"",src:e.localization.getImage(1)}),t(N,{center:!0,dangerouslySetInnerHTML:{__html:e.localization.getText(0)}})]}),r&&d(z,{children:[d(P,{fullHeight:!0,position:"relative",overflow:"hidden",children:[t(Qn,{}),t(V,{skin:6,colour:l,className:"p-1 position-absolute bottom-0 end-0 m-1",children:(r.priceInCredits>0||r.priceInActivityPoints>0)&&t(kn,{})})]}),d(v,{grow:!0,gap:1,children:[t(N,{grow:!0,truncate:!0,bold:!0,children:r.localizationName}),t(xs,{})]})]})]})]}),t("textarea",{className:"flex-grow-1 ton-input-trophy black-border w-100 h-25",defaultValue:s||"",onChange:c=>n(c.target.value)})]})},JU=i=>{const[e,s]=a.useState(Oe.NONE),{currentPage:n=null}=De(),{getCurrencyAmount:r=null}=An(),{pendingOffer:o}=i,l=a.useCallback(h=>{switch(h.type){case Zs.PURCHASE_SUCCESS:s(Oe.NONE);return;case On.PURCHASE_FAILED:s(Oe.FAILED);return}},[]);ct(Zs.PURCHASE_SUCCESS,l),ct(On.PURCHASE_FAILED,l);const c=a.useCallback(()=>{o&&(s(Oe.PURCHASE),B(new Yr(n.pageId,o.offerId,null,1)))},[o,n]),u=a.useCallback(()=>{if(!o)return null;if(o.priceCredits>r(-1))return t(D,{fullWidth:!0,children:g("catalog.alert.notenough.title")});if(o.priceActivityPoints>r(o.priceActivityPointsType))return t(D,{fullWidth:!0,children:g("catalog.alert.notenough.activitypoints.title."+o.priceActivityPointsType)});switch(e){case Oe.CONFIRM:return t(D,{fullWidth:!0,onClick:c,skin:6,colour:L.primary_yellow,children:g("catalog.marketplace.confirm_title")});case Oe.PURCHASE:return t(D,{fullWidth:!0,disabled:!0,skin:6,colour:L.primary_yellow,children:t(hE,{})});case Oe.FAILED:return t(D,{fullWidth:!0,disabled:!0,skin:6,colour:L.primary_red,children:g("generic.failed")});case Oe.NONE:default:return t(D,{fullWidth:!0,onClick:()=>s(Oe.CONFIRM),skin:6,colour:L.primary_green,children:g("buy")})}},[o,e,c,r]);return t(z,{children:u()})},ZU=i=>{const{currentPage:e=null,catalogOptions:s=null}=De(),{clubOffers:n=null}=s,{purse:r=null}=An(),o=a.useCallback(c=>{let u="";return c.months>0&&(u=g("catalog.vip.item.header.months",["num_months"],[c.months.toString()])),c.extraDays>0&&(u!==""&&(u+=" "),u+=" "+g("catalog.vip.item.header.days",["num_days"],[c.extraDays.toString()])),u},[]),l=a.useMemo(()=>{const c=r.clubDays,h=r.clubPeriods*31+c;return g("catalog.vip.extend.info",["days"],[h.toString()])},[r]);return a.useEffect(()=>{n||B(new Zg(1))},[n]),d(v,{className:"mx-4 nitro-catalog-layout-vip-buy-grid",children:[d(R,{fullHeight:!0,center:!0,overflow:"hidden",gap:2,children:[e.localization.getImage(1)&&t("img",{alt:"",src:e.localization.getImage(1)}),t(N,{center:!0,overflow:"auto",dangerouslySetInnerHTML:{__html:l}})]}),t(v,{children:n&&n.length>0&&n.map((c,u)=>d(V,{skin:0,colour:L.lighter_grey,gap:1,className:"p-1",children:[d(V,{skin:5,colour:L.black,opacity:160,column:!1,gap:3,className:"p-1",alignItems:"center",children:[t("i",{className:"icon-hc-banner"}),t(N,{textEnd:!0,variant:"white",className:"ubuntu-bold h4 m-0",children:o(c)})]}),d(R,{justifyContent:"between",children:[d(R,{gap:2,children:[c.priceCredits>0&&d(R,{alignItems:"center",justifyContent:"end",gap:1,children:[t(N,{className:"h5 m-0 ubuntu-bold",children:c.priceCredits}),t(wt,{type:-1})]}),c.priceActivityPoints>0&&d(R,{alignItems:"center",justifyContent:"end",gap:1,children:[t(N,{className:"h5 m-0 ubuntu-bold",children:c.priceActivityPoints}),t(wt,{type:c.priceActivityPointsType})]})]}),t(R,{gap:2,children:t(JU,{pendingOffer:c})})]})]},u))})]})},eL=i=>{const[e,s]=a.useState(""),[n,r]=a.useState(!1),{simpleAlert:o=null}=Ke(),l=()=>{!e||!e.length||n||(B(new ep(e)),r(!0))};return W(oh,c=>{const u=c.getParser();let h=g("catalog.alert.voucherredeem.ok.description");u.productName&&(h=g("catalog.alert.voucherredeem.ok.description.furni",["productName","productDescription"],[u.productName,u.productDescription])),o(h,null,null,null,g("catalog.alert.voucherredeem.ok.title")),r(!1),s("")}),W(rh,c=>{const u=c.getParser();o(g(`catalog.alert.voucherredeem.error.description.${u.errorCode}`),null,null,null,g("catalog.alert.voucherredeem.error.title")),r(!1)}),d(V,{skin:4,colour:L.primary_blue,gap:1,fullWidth:!0,column:!0,className:"p-2",children:[t("span",{className:"volter-bold",children:g("catalog.voucher_title")}),d(R,{children:[t(V,{skin:0,className:"p-1 mt-1 me-1 w-100",children:t("input",{type:"text",className:"ton-input text-black",placeholder:g("catalog.voucher_prompt"),value:e,onChange:c=>s(c.target.value)})}),t(D,{skin:1,onClick:l,disabled:n,children:g("redeem")})]})]})},tL=i=>{const{page:e=null,hideNavigation:s=null}=i;De();const{currentPage:n}=De();return a.useCallback(r=>{switch(r.type){case Oc.ITEM_CATALOGUE_PAGE:oe(`catalog/open/${r.catalogPageLocation}`);return;case Oc.ITEM_PRODUCT_OFFER:oe(`catalog/open/${r.productOfferId}`);return}},[]),a.useEffect(()=>{s()},[e,s]),d(z,{children:[d(R,{center:!0,position:"relative",className:"py-3",children:[t("img",{src:n.localization.getImage(1)}),t("img",{src:n.localization.getImage(2),className:"position-absolute"})]}),t(P,{fullHeight:!0,className:"overflow-y-scroll",children:d(pe,{className:"py-1 px-3",children:[d(v,{size:7,gap:4,children:[t(N,{dangerouslySetInnerHTML:{__html:e.localization.getText(1)}}),t(P,{className:"ton-frontpage-seasonal"}),t(N,{dangerouslySetInnerHTML:{__html:e.localization.getText(0)}})]}),d(v,{size:5,gap:5,children:[t(P,{className:"ton-frontpage-toolbox"}),t(N,{dangerouslySetInnerHTML:{__html:e.localization.getText(2)}}),t(P,{className:"ton-frontpage-purse"})]})]})}),t(eL,{text:g("catalog.voucher_title")})]})},dl=1,gi=2,dI=i=>{const{offerData:e=null,type:s=gi,onClick:n=null}=i,r=a.useMemo(()=>e?g((e.furniType===2?"wallItem":"roomItem")+`.name.${e.furniId}`):"",[e]),o=a.useCallback(()=>{if(!e)return"";if(e.status===ar.SOLD)return g("catalog.marketplace.offer.sold");if(e.timeLeftMinutes<=0)return g("catalog.marketplace.offer.expired");const l=Math.max(1,e.timeLeftMinutes),c=Math.floor(l/60);let h=l-c*60+" "+g("catalog.marketplace.offer.minutes");return c>0&&(h=c+" "+g("catalog.marketplace.offer.hours")+" "+h),g("catalog.marketplace.offer.time_left",["time"],[h])},[e]);return t(V,{colour:L.lighter_grey,children:d(R,{gap:2,center:!0,children:[t(v,{style:{width:40,height:40},children:t(Rn,{column:!1,itemImage:D_(e.furniType===wo.TYPE_FLOOR?Ce.FLOOR:Ce.WALL,e.furniId,e.extraData),itemUniqueNumber:e.isUniqueLimitedItem?e.stuffData.uniqueNumber:0,background:!1})}),d(v,{grow:!0,gap:0,children:[t(N,{bold:!0,children:r}),s===dl&&d(z,{children:[t(N,{children:g("catalog.marketplace.offer.price_own_item",["price"],[e.price.toString()])}),t(N,{children:o()})]}),s===gi&&d(z,{children:[t(N,{children:g("catalog.marketplace.offer.price_public_item",["price","average"],[e.price.toString(),e.averagePrice>0?e.averagePrice.toString():"-"])}),t(N,{children:g("catalog.marketplace.offer_count",["count"],[e.offerCount.toString()])})]})]}),d(v,{gap:1,children:[s===dl&&e.status!==ar.SOLD&&t(D,{onClick:()=>n(e),children:g("catalog.marketplace.offer.pick")}),s===gi&&d(z,{children:[t(D,{onClick:()=>n(e),children:g("buy")}),t(D,{disabled:!0,children:g("catalog.marketplace.view_more")})]})]})]})})},sL=i=>{const[e,s]=a.useState(0),[n,r]=a.useState([]),{simpleAlert:o=null}=Ke();W(hm,h=>{const m=h.getParser();if(!m)return;const p=m.offers.map(E=>{const _=new wo(E.offerId,E.furniId,E.furniType,E.extraData,E.stuffData,E.price,E.status,E.averagePrice,E.offerCount);return _.timeLeftMinutes=E.timeLeftMinutes,_});s(m.creditsWaiting),r(p)}),W(am,h=>{const m=h.getParser();if(m){if(!m.success){o(g("catalog.marketplace.cancel_failed"),fe.DEFAULT,null,null,g("catalog.marketplace.operation_failed.topic"));return}r(p=>p.filter(E=>E.offerId!==m.offerId))}});const l=a.useMemo(()=>n.filter(h=>h.status===ar.SOLD),[n]),c=a.useCallback(()=>{r(h=>{const m=l.map(p=>p.offerId);return h.filter(p=>m.indexOf(p.offerId)===-1)}),B(new Jf)},[l]),u=h=>{B(new Qf(h.offerId))};return a.useEffect(()=>{B(new $f)},[]),t(v,{children:t(P,{style:{height:360},className:"ton-shop-page-content overflow-auto",children:d(v,{overflow:"hidden",children:[e<=0&&t(N,{center:!0,className:"bg-muted p-1",children:g("catalog.marketplace.redeem.no_sold_items")}),e>0&&d(v,{center:!0,gap:1,className:"bg-muted p-2",children:[t(N,{children:g("catalog.marketplace.redeem.get_credits",["count","credits"],[l.length.toString(),e.toString()])}),t(D,{className:"mt-1",onClick:c,children:g("catalog.marketplace.offer.redeem")})]}),d(v,{gap:1,overflow:"hidden",children:[t(N,{truncate:!0,shrink:!0,bold:!0,children:g("catalog.marketplace.items_found",["count"],[n.length.toString()])}),t(v,{overflow:"auto",className:"nitro-catalog-layout-marketplace-grid",children:n.length>0&&n.map(h=>t(dI,{offerData:h,type:dl,onClick:u},h.offerId))})]})]})})})},nL=i=>{const{searchType:e=null,sortTypes:s=null,onSearch:n=null}=i,[r,o]=a.useState(s?s[0]:3),[l,c]=a.useState(""),[u,h]=a.useState(0),[m,p]=a.useState(0),[E,_]=a.useState(-1),I=a.useCallback(T=>{o(T),(e===Yt.BY_ACTIVITY||e===Yt.BY_VALUE)&&n({minPrice:-1,maxPrice:-1,query:"",type:T})},[n,e]),C=a.useCallback(()=>{const T=u>0?u:-1,b=m>0?m:-1;n({minPrice:T,maxPrice:b,type:r,query:l})},[m,u,n,l,r]);a.useEffect(()=>{if(!s||!s.length)return;const T=s[0];o(T),(e===Yt.BY_ACTIVITY||Yt.BY_VALUE===e)&&n({minPrice:-1,maxPrice:-1,query:"",type:T})},[n,e,s]),a.useEffect(()=>{_(s[0])},[s]);const f=a.useMemo(()=>{let T=[];return s.forEach(b=>{T.push({index:b,value:b.toString(),caption:g(`catalog.marketplace.sort.${b}`)})}),T},[s]),S=T=>{_(T),I(T)};return d(v,{gap:1,className:"p-1",overflow:"visible",children:[d(R,{alignItems:"center",gap:1,overflow:"visible",children:[t(N,{className:"col-3",children:g("catalog.marketplace.sort_order")}),t(es,{fullWidth:!0,selectedIndex:E,options:f,changeIndex:T=>S(parseInt(T))})]}),e===Yt.ADVANCED&&d(z,{children:[d(R,{alignItems:"center",gap:1,children:[t(N,{className:"col-3",children:g("catalog.marketplace.search_name")}),t(V,{skin:4,colour:L.lighter_grey,position:"relative",children:t("input",{className:"ton-input text-black",type:"text",value:l,onChange:T=>c(T.target.value)})})]}),d(R,{alignItems:"center",gap:1,children:[t(N,{className:"col-3",children:g("catalog.marketplace.search_price")}),d(R,{fullWidth:!0,gap:1,children:[t(V,{skin:4,colour:L.lighter_grey,position:"relative",children:t("input",{className:"ton-input text-black",type:"number",min:0,value:u,onChange:T=>h(T.target.valueAsNumber)})}),t(V,{skin:4,colour:L.lighter_grey,position:"relative",children:t("input",{className:"ton-input text-black",type:"number",min:0,value:m,onChange:T=>p(T.target.valueAsNumber)})})]})]}),t(D,{className:"mx-auto",onClick:C,children:g("generic.search")})]})]})},rL=[1,2],oL=[3,4,5,6],iL=[1,2,3,4,5,6],aL=i=>{De();const[e,s]=a.useState(Yt.BY_ACTIVITY),[n,r]=a.useState(0),[o,l]=a.useState(new Map),[c,u]=a.useState({minPrice:-1,maxPrice:-1,query:"",type:3}),{getCurrencyAmount:h=null}=An(),{simpleAlert:m=null,showConfirm:p=null}=Ke(),E=a.useCallback(C=>{console.log(C),u(C),B(new Xf(C.minPrice,C.maxPrice,C.query,C.type))},[]),_=a.useMemo(()=>{switch(e){case Yt.BY_ACTIVITY:return oL;case Yt.BY_VALUE:return rL;case Yt.ADVANCED:return iL}return[]},[e]),I=a.useCallback(C=>{if(C.price>h(-1)){m(g("catalog.alert.notenough.credits.description"),fe.DEFAULT,null,null,g("catalog.alert.notenough.title"));return}const f=C.offerId;p(g("catalog.marketplace.confirm_header"),()=>{B(new za(f))},null,null,null,g("catalog.marketplace.confirm_title"))},[h,m,p]);return W(dm,C=>{const f=C.getParser();if(!f)return;const S=new Map;f.offers.forEach(T=>{const b=new wo(T.offerId,T.furniId,T.furniType,T.extraData,T.stuffData,T.price,T.status,T.averagePrice,T.offerCount);b.timeLeftMinutes=T.timeLeftMinutes,S.set(T.offerId,b)}),r(f.totalItemsFound),l(S)}),W(im,C=>{const f=C.getParser();if(f)switch(f.result){case 1:E(c);break;case 2:l(S=>{const T=new Map(S);return T.delete(f.requestedOfferId),T}),m(g("catalog.marketplace.not_available_header"),fe.DEFAULT,null,null,g("catalog.marketplace.not_available_title"));break;case 3:l(S=>{const T=new Map(S),b=T.get(f.requestedOfferId);return b&&(b.offerId=f.offerId,b.price=f.newPrice,b.offerCount--,T.set(b.offerId,b)),T.delete(f.requestedOfferId),T}),p(g("catalog.marketplace.confirm_higher_header")+`
  9037. `+g("catalog.marketplace.confirm_price",["price"],[f.newPrice.toString()]),()=>{B(new za(f.offerId))},null,null,null,g("catalog.marketplace.confirm_higher_title"));break;case 4:m(g("catalog.alert.notenough.credits.description"),fe.DEFAULT,null,null,g("catalog.alert.notenough.title"));break}}),d(v,{gap:0,className:"ton-shop-page-content overflow-hidden",fullHeight:!0,children:[t(v,{grow:!0,gap:1,overflow:"hidden",className:"flex-shrink-0",children:d(zr,{children:[t(D,{className:"w-100",onClick:()=>s(Yt.BY_ACTIVITY),disabled:e==Yt.BY_ACTIVITY,children:g("catalog.marketplace.search_by_activity")}),t(D,{className:"w-100",onClick:()=>s(Yt.BY_VALUE),disabled:e==Yt.BY_VALUE,children:g("catalog.marketplace.search_by_value")}),t(D,{className:"w-100",onClick:()=>s(Yt.ADVANCED),disabled:e==Yt.ADVANCED,children:g("catalog.marketplace.search_advanced")})]})}),t(nL,{sortTypes:_,searchType:e,onSearch:E}),d(v,{gap:1,overflow:"hidden",fullHeight:!0,children:[t(N,{truncate:!0,shrink:!0,bold:!0,children:g("catalog.marketplace.items_found",["count"],[o.size.toString()])}),t(v,{fullHeight:!0,overflow:"hidden",children:t(v,{className:"nitro-catalog-layout-marketplace-grid",overflow:"auto",children:Array.from(o.values()).map((C,f)=>t(dI,{offerData:C,type:gi,onClick:I},f))})})]})]})},lL=i=>{const{page:e=null}=i,[s,n]=a.useState(-1),[r,o]=a.useState([]),[l,c]=a.useState(-1),[u,h]=a.useState([]),[m,p]=a.useState(-1),[E,_]=a.useState(!1),[I,C]=a.useState("");a.useState(!0);const[f,S]=a.useState(-1),{currentOffer:T=null,setCurrentOffer:b=null,setPurchaseOptions:y=null,catalogOptions:w=null,roomPreviewer:O=null}=De(),{petPalettes:F=null}=w,U=a.useMemo(()=>!u.length||m===-1?16777215:u[m][0],[u,m]),j=a.useMemo(()=>s===-1||!r.length||l===-1?"":g(`pet.breed.${s}.${r[l].breedId}`),[s,r,l]),x=a.useMemo(()=>{if(!r.length||l===-1)return"";const H=r[l].paletteId;let Y=16777215;if(s<=7){if(m===-1)return"";Y=u[m][0]}let q=Y.toString(16).toUpperCase();for(;q.length<6;)q="0"+q;return`${H}
  9038. ${q}`},[r,l,s,u,m]),M=a.useMemo(()=>{let H="";switch(f){case 1:H="catalog.alert.petname.long";break;case 2:H="catalog.alert.petname.short";break;case 3:H="catalog.alert.petname.chars";break;case 4:H="catalog.alert.petname.bobba";break}return!H||!H.length?"":g(H)},[f]),G=a.useCallback(()=>{if(f===-1){B(new Vf(I,1));return}if(f===0){B(new Yr(e.pageId,T.offerId,`${I}
  9039. ${x}`,1));return}},[e,T,I,x,f]);return W(Mg,H=>{const Y=H.getParser();S(Y.result),Y.result===0?G():At(new On(-1))}),a.useEffect(()=>{if(!e||!e.offers.length)return;const H=e.offers[0];b(H),n(_y(H.localizationId)),_(!1)},[e,b]),a.useEffect(()=>{if(!T)return;const H=T.product.productData;if(H){if(F)for(const Y of F){if(Y.breed!==H.type)continue;const q=[];for(const Z of Y.palettes)Z.sellable&&q.push(Z);c(q.length?0:-1),o(q);return}c(-1),o([]),B(new np(H.type))}},[T,F]),a.useEffect(()=>{if(s===-1)return;const H=Ey(s,r);p(H.length?0:-1),h(H)},[s,r]),a.useEffect(()=>{if(!O||(O.reset(!1),s===-1||!r.length||l===-1))return;let H=`${s} ${r[l].paletteId}`;s<=7&&(H+=` ${U.toString(16)}`),O.addPetIntoRoom(H)},[O,s,r,l,U]),a.useEffect(()=>{S(-1)},[I]),T?t(v,{children:t(P,{style:{height:310},className:"ton-shop-page-content overflow-auto",children:d(pe,{children:[t(v,{size:7,overflow:"hidden",children:d(qe,{columnCount:5,children:[!E&&r.length>0&&r.map((H,Y)=>t(jt,{itemActive:l===Y,onClick:q=>c(Y),children:t(Tn,{typeId:s,paletteId:H.paletteId,direction:2,headOnly:!0})},Y)),E&&u.length>0&&u.map((H,Y)=>t(jt,{itemHighlight:!0,itemActive:m===Y,itemColor:Qs.int2rgb(H[0]),className:"clear-bg",onClick:q=>p(Y)},Y))]})}),d(v,{center:!T,size:5,overflow:"hidden",children:[!T&&d(z,{children:[!!e.localization.getImage(1)&&t("img",{alt:"",src:e.localization.getImage(1)}),t(N,{center:!0,dangerouslySetInnerHTML:{__html:e.localization.getText(0)}})]}),T&&d(z,{children:[d(P,{position:"relative",overflow:"hidden",fullHeight:!0,children:[t(Qn,{}),t(Yn,{position:"absolute",className:"bottom-1 end-1"}),s>-1&&s<=7&&t(D,{position:"absolute",className:"bottom-1 start-1",onClick:H=>_(!E),children:t(Gt,{icon:"fill-drip"})})]}),d(v,{grow:!0,gap:1,children:[t(N,{truncate:!0,children:j}),d(v,{grow:!0,gap:1,children:[t(V,{skin:4,colour:L.lighter_grey,position:"relative",children:t("input",{type:"text",className:"ton-input",placeholder:g("widgets.petpackage.name.title"),value:I,onChange:H=>C(H.target.value)})}),f>0&&t("div",{className:"volter-bold text-danger",children:M})]}),t(R,{justifyContent:"end",children:t(kn,{justifyContent:"end",alignItems:"end"})}),t(xs,{purchaseCallback:G})]})]})]})]})})}):null},cL=i=>{const[e,s]=a.useState(Oe.NONE),{getCurrencyAmount:n=null}=An(),{offer:r=null,page:o=null}=i,l=a.useCallback(h=>{switch(h.type){case Zs.PURCHASE_SUCCESS:s(Oe.NONE);return;case On.PURCHASE_FAILED:s(Oe.FAILED);return;case Wr.NOT_ALLOWED:s(Oe.FAILED);return;case jr.SOLD_OUT:s(Oe.SOLD_OUT);return}},[]);ct(Zs.PURCHASE_SUCCESS,l),ct(On.PURCHASE_FAILED,l),ct(Wr.NOT_ALLOWED,l),ct(jr.SOLD_OUT,l);const c=h=>{var p;s(Oe.PURCHASE);let m=o.pageId;B(new Yr(m,h==null?void 0:h.offerId,(p=h.product)==null?void 0:p.extraParam,1))};return a.useEffect(()=>{let h=null;return(e===Oe.CONFIRM||e===Oe.FAILED)&&(h=setTimeout(()=>s(Oe.NONE),3e3)),()=>{h&&clearTimeout(h)}},[e]),t(()=>{const h=r.priceInCredits,m=r.priceInActivityPoints;if(h>n(-1))return t(D,{skin:5,disabled:!0,children:g("catalog.alert.notenough.title")});if(m>n(r.activityPointType))return t(D,{skin:5,disabled:!0,children:g("catalog.alert.notenough.activitypoints.title."+r.activityPointType)});switch(e){case Oe.CONFIRM:return t(D,{skin:6,colour:L.primary_green,onClick:p=>c(r),children:g("catalog.marketplace.confirm_title")});case Oe.PURCHASE:return t(D,{skin:6,colour:L.primary_green,disabled:!0,children:"..."});case Oe.FAILED:return setTimeout(()=>s(0),1e3),t(D,{skin:6,colour:L.primary_red,children:g("generic.failed")});case Oe.SOLD_OUT:return t(D,{skin:6,colour:L.primary_green,children:g("generic.failed")+" - "+g("catalog.alert.limited_edition_sold_out.title")});case Oe.NONE:default:return t(D,{skin:6,colour:L.primary_green,onClick:p=>s(Oe.CONFIRM),children:g("catalog.purchase_confirmation."+(r.isRentOffer?"rent":"buy"))})}},{})},uL=i=>{const{page:e=null}=i,{currentOffer:s=null,currentPage:n,calculateDiscount:r}=De(),o=a.useRef(null),[l,c]=a.useState(!1),u=h=>{if(!h)return null;switch(h.priceType){case et.PRICE_TYPE_CREDITS:return ee("currency.colours")[-1];case et.PRICE_TYPE_ACTIVITYPOINTS:return ee("currency.colours")[h.activityPointType];default:return L.catalog_tab_inactive_grey}};if(a.useEffect(()=>{setTimeout(()=>{o==null||o!==null&&o.current==null||(c(o.current.clientHeight<o.current.scrollHeight),console.log(o.current.clientHeight<o.current.scrollHeight))},40)},[o,n]),!(!e||!n))return t(v,{fullHeight:!0,overflow:"hidden",className:"py-2",children:t(P,{className:"ton-shop-page-content overflow-auto",fullHeight:!0,children:t(R,{className:"px-1 flex-shrink-0",fullHeight:!0,fullWidth:!0,gap:1,column:!0,innerRef:o,justifyContent:l?"start":"center",children:n.offers&&n.offers.length>0&&n.offers.map((h,m)=>{let p=m%2==0;return d(v,{gap:0,className:"px-2 "+(m==n.offers.length-1?"pb-4":""),children:[d(R,{gap:2,alignItems:"center",children:[p&&t(bi,{className:"flex-shrink-0 mx-auto",productType:h.product.productType,productClassId:h.product.productClassId,extraData:h.product.extraParam,state:h.product.furnitureData.className.includes("clothing")?-1:1}),d(R,{column:!0,gap:2,alignSelf:"center",children:[t(N,{bold:!0,display:"block",children:h.localizationName}),t(N,{display:"block",children:h.localizationDescription}),d(R,{justifyContent:"start",gap:2,children:[t(cL,{offer:h,page:e}),t(V,{skin:6,colour:u(h),className:"p-1",column:!1,gap:1,children:t(uc,{offer:h})})]})]}),!p&&t(bi,{className:"flex-shrink-0 mx-auto",productType:h.product.productType,productClassId:h.product.productClassId,extraData:h.product.extraParam,state:h.product.furnitureData.className.includes("clothing")?-1:1})]}),m!=n.offers.length-1&&t("hr",{className:"bg-light-dark my-2 mx-n2"})]},h.localizationId)})})})})},dL=i=>{const{offer:e=null,isAvailable:s=!1,daysRequired:n=0,onSelect:r=null}=i,o=a.useCallback(()=>{if(!e||!e.products.length)return"";const h=e.products[0];return hi.getProductImageUrl(h.productType,h.furniClassId,h.extraParam)},[e]),l=a.useCallback(()=>{if(!e||!e.products.length)return"";const h=e.products[0],m=hi.getProductCategory(h.productType,h.furniClassId)===2?"wallItem.name."+h.furniClassId:"roomItem.name."+h.furniClassId;return g(m)},[e]),c=a.useCallback(()=>{if(!e||!e.products.length)return"";const h=e.products[0],m=hi.getProductCategory(h.productType,h.furniClassId)===2?"wallItem.desc."+h.furniClassId:"roomItem.desc."+h.furniClassId;return g(m)},[e]),u=a.useCallback(()=>Math.floor(n/31),[n]);return t(V,{skin:0,colour:L.lighter_grey,children:d(R,{gap:2,children:[t(yn,{className:"gift-item-icon",imageUrl:o()}),d(R,{column:!0,children:[t(N,{grow:!0,className:"volter-bold",children:l()}),t(N,{grow:!0,children:c()}),u()>0&&!s&&t(N,{grow:!0,children:g("catalog.club_gift.months_required",["months"],[u().toString()])})]}),t(D,{onClick:()=>r(e.localizationId),disabled:!s,className:"align-self-center ms-auto",children:g("catalog.club_gift.select")})]})})},hL=i=>{const{purse:e=null}=An(),{catalogOptions:s=null,setCatalogOptions:n=null}=De(),{clubGifts:r=null}=s,{showConfirm:o=null}=Ke(),l=a.useCallback(()=>r?r.giftsAvailable>0?g("catalog.club_gift.available",["amount"],[r.giftsAvailable.toString()]):r.daysUntilNextGift>0?g("catalog.club_gift.days_until_next",["days"],[r.daysUntilNextGift.toString()]):e.isVip?g("catalog.club_gift.not_available"):g("catalog.club_gift.no_club"):"",[r,e]),c=a.useCallback(h=>{o(g("catalog.club_gift.confirm"),()=>{B(new sp(h)),n(m=>(m.clubGifts.giftsAvailable--,{...m}))},null)},[n,o]),u=a.useMemo(()=>r.offers.sort((m,p)=>r.getOfferExtraData(m.offerId).daysRequired-r.getOfferExtraData(p.offerId).daysRequired),[r]);return d(z,{children:[t(N,{shrink:!0,bold:!0,center:!0,children:l()}),t(qe,{columnCount:1,className:"nitro-catalog-layout-vip-gifts-grid",children:r.offers.length>0&&u.map(h=>t(dL,{offer:h,isAvailable:r.getOfferExtraData(h.offerId).isSelectable&&r.giftsAvailable>0,onSelect:c,daysRequired:r.getOfferExtraData(h.offerId).daysRequired},h.offerId))})]})},mL=(i,e)=>{if(!i)return null;const s={page:i,hideNavigation:e};switch(i.layoutCode){case"frontpage_featured":return null;case"frontpage4":return t(tL,{...s});case"pets":return t(lL,{...s});case"pets2":return t(VU,{...s});case"pets3":return t(lI,{...s});case"vip_buy":return t(ZU,{...s});case"guild_frontpage":return t(BU,{...s});case"guild_forum":return t(GU,{...s});case"guild_custom_furni":return t(FU,{...s});case"guild_expansion":return t(xU,{...s});case"club_gifts":return t(hL,{...s});case"marketplace_own_items":return t(sL,{...s});case"marketplace":return t(aL,{...s});case"single_bundle":return t(YU,{...s});case"room_bundle":return t(qU,{...s});case"spaces_new":return t(QU,{...s});case"trophies":return t(XU,{...s});case"info_loyalty":return t(HU,{...s});case"badge_display":return t(MU,{...s});case"roomads":return t(jU,{...s});case"default_3x3_color_grouping":return t(LU,{...s});case"recycler":return t(WU,{...s});case"soundmachine":return t(zU,{...s});case"rares_horiz":return t(uL,{...s});case"bots":case"default_3x3":default:return t(PU,{...s})}},gL=i=>{const[e,s]=a.useState(null),[n,r]=a.useState(0),[o,l]=a.useState("0"),{catalogOptions:c=null,setCatalogOptions:u=null}=De(),{marketplaceConfiguration:h=null}=c,{showConfirm:m=null}=Ke(),[p,E]=a.useState(null),_=b=>{l(b);const y=parseInt(b);isNaN(y)||y===n||r(parseInt(b))};if(W(lm,b=>{const y=b.getParser();u(w=>{const O={...w};return O.marketplaceConfiguration=y,O})}),W(cm,b=>{const y=b.getParser();y&&E(y)}),ct(rc.POST_MARKETPLACE,b=>s(b.item)),a.useEffect(()=>{e&&(B(new Zf(e.type,e.type)),r(0),l("0"),!h&&B(new zf))},[e,h]),!h||!e||!p)return null;const I=e?g(e.isWallItem?"wallItem.name."+e.type:"roomItem.name."+e.type):"",C=e?g(e.isWallItem?"wallItem.desc."+e.type:"roomItem.desc."+e.type):"",f=()=>Math.max(Math.ceil(h.commission*.01*n),1),S=()=>{let b=(p.dayOffsets.length?p.dayOffsets.length:"-").toString(),y=(p.averagePrice?p.averagePrice:"-").toString(),w=(p.averagePrice?p.averagePrice-Math.max(Math.ceil(h.commission*.01*p.averagePrice),1):"-").toString();return g("inventory.marketplace.make_offer.average_price",["days","price","price_no_commission"],[b,y,w])},T=()=>{!e||n<h.minimumPrice||m(g("inventory.marketplace.confirm_offer.info",["furniname","price"],[I,n.toString()]),()=>{B(new Kf(n,e.isWallItem?2:1,e.id)),s(null)},()=>{s(null)},null,null,g("inventory.marketplace.confirm_offer.title"))};return t(le,{title:g("inventory.marketplace.make_offer.title"),className:"nitro-catalog-layout-marketplace-post-offer",onCloseClick:b=>s(null),children:d(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-hidden w-100",children:[d(R,{gap:2,children:[t(V,{className:"marketplace-furni-preview",overflow:"hidden",alignItems:"center",colour:L.light_grey,children:t(bi,{productType:e.isWallItem?Ce.WALL:Ce.FLOOR,productClassId:e.type,extraData:e.extra.toString()})}),d(v,{gap:1,fullHeight:!0,justifyContent:"center",children:[t(N,{bold:!0,children:I}),t(N,{truncate:!0,shrink:!0,children:C})]})]}),d(v,{overflow:"auto",fullHeight:!0,children:[d(v,{className:"p-1",gap:1,justifyContent:"center",fullHeight:!0,children:[t(N,{children:g("inventory.marketplace.make_offer.expiration_info",["time"],[h.offerTime.toString()])}),d(N,{variant:"black",bold:!0,children:[" ",g("inventory.marketplace.make_offer.price_request")]}),t("input",{className:"ton-input black-border w-100",type:"number",min:0,value:o,onChange:b=>_(b.target.value),placeholder:g("inventory.marketplace.make_offer.price_request")}),d(N,{variant:"black",bold:!0,children:[S()," "]}),d(V,{skin:0,colour:L.light_grey,children:[(n<h.minimumPrice||isNaN(n))&&t(N,{variant:"danger",children:g("inventory.marketplace.make_offer.min_price",["minprice"],[h.minimumPrice.toString()])}),n>h.maximumPrice&&!isNaN(n)&&t(N,{variant:"danger",children:g("inventory.marketplace.make_offer.max_price",["maxprice"],[h.maximumPrice.toString()])}),!(n<h.minimumPrice||n>h.maximumPrice||isNaN(n))&&t(N,{children:g("inventory.marketplace.make_offer.final_price",["commission","finalprice"],[f().toString(),(n+f()).toString()])})]})]}),d(R,{gap:1,className:"justify-content-between mt-auto",children:[t(D,{onClick:b=>s(null),children:g("cancel")}),t(D,{skin:1,onClick:T,children:g("inventory.marketplace.make_offer.post")})]})]})]})})},pL=i=>{const{isVisible:e=!1,setIsVisible:s=null,rootNode:n=null,currentPage:r=null,navigationHidden:o=!1,setNavigationHidden:l=null,activeNodes:c=[],searchResult:u=null,setSearchResult:h=null,openPageByName:m=null,openPageByOfferId:p=null,activateNode:E=null,getNodeById:_}=De(),{catalogIconRef:I}=Wi();a.useEffect(()=>{const T={linkReceived:b=>{const y=b.split("/");if(!(y.length<2))switch(y[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(w=>!w);return;case"open":if(y.length>2)if(y.length===4)switch(y[2]){case"offerId":p(parseInt(y[3]));return}else m(y[2]);else s(!0);return}},eventUrlPrefix:"catalog/"};return dt(T),()=>ht(T)},[s,p,m]);const C=T=>T.isActive?L.white:T.iconColor.includes("#")?T.iconColor:L.catalog_tab_inactive_grey,f=a.useCallback(()=>{if(!I||I&&!I.current)return{x:0,y:0};let T=I.current;return{x:T.getBoundingClientRect().x+T.parentElement.clientWidth,y:T.getBoundingClientRect().y}},[I]),S=a.useMemo(()=>{if(!r)return!1;switch(r.layoutCode){case"pets3":case"pets2":case"trophies":return!1;default:return!0}},[r]);return I.current?d(z,{children:[e&&t(vs,{offsetLeft:f().x,offsetTop:f().y,handleSelector:".drag-handler",windowPosition:tt.TOP_LEFT,children:d("div",{className:"ton-shop",children:[t(P,{className:"ton-shop-heading drag-handler",style:{pointerEvents:e?"all":"none"}}),d(pe,{gap:0,children:[d(P,{className:"ton-shop-content",children:[d(v,{className:"ton-shop-background",size:o?12:9,overflow:"hidden",children:[r&&r.localization.getImage(0)&&d(v,{alignItems:"center",className:"ton-shop-header",children:[t(nI,{image:r.localization.getImage(0)}),r.localization.getText(0)&&S&&t(N,{center:!0,dangerouslySetInnerHTML:{__html:r.localization.getText(0)}})]}),mL(r,()=>l(!0))]}),t(en,{children:n&&n.children.length>0&&n.children.map(T=>T.isVisible?t(Ns,{skin:1,colour:C(T),isActive:T.isActive,onClick:b=>{u&&h(null),E(T)},children:t(rI,{icon:T.iconId})},T.pageId):null)})]}),t(le,{title:g("catalog.title"),className:"ton-shop-nav",onCloseClick:T=>s(!1),draggable:!1,windowPosition:tt.NOTHING,children:t(v,{size:3,overflow:"hidden",gap:1,fullHeight:!0,children:c&&c.length>0&&t(AU,{node:c[0]})})})]})]})}),t(wU,{}),t(gL,{})]}):null},Ds=32,tr=64,mo="x0123456789abcdefghijklmnopq";class Ot{}Ot.DOOR=0;Ot.UP=1;Ot.DOWN=2;Ot.SET=3;Ot.UNSET=4;const fL={x:"101010",0:"0065ff",1:"0091ff",2:"00bcff",3:"00e8ff",4:"00ffea",5:"00ffbf",6:"00ff93",7:"00ff68",8:"00ff3d",9:"19ff00",a:"44ff00",b:"70ff00",c:"9bff00",d:"f2ff00",e:"ffe000",f:"ffb500",g:"ff8900",h:"ff5e00",i:"ff3200",j:"ff0700",k:"ff0023",l:"ff007a",m:"ff00a5",n:"ff00d1",o:"ff00fc",p:"d600ff",q:"aa00ff"};class _L{constructor(){this._currentAction=Ot.SET,this._currentHeight=mo[1]}get currentAction(){return this._currentAction}set currentAction(e){this._currentAction=e}get currentHeight(){return this._currentHeight}set currentHeight(e){this._currentHeight=e}clear(){this._currentAction=Ot.SET,this._currentHeight=mo[1]}}class si{constructor(e,s){this._height=e,this._isBlocked=s}get height(){return this._height}set height(e){this._height=e}get isBlocked(){return this._isBlocked}set isBlocked(e){this._isBlocked=e}}const EL=(i,e)=>{let s=i*Ds/2-e*Ds/2;const n=i*Ds/4+e*Ds/4;return s=s+1024,[s,n]},IL=(i,e)=>{const s=i-1024,n=(s/(Ds/2)+e/(Ds/4))/2,r=(e/(Ds/4)-s/(Ds/2))/2;return[n,r]},yi=i=>{switch(i=parseInt(i.toString()),i){case 0:return-2;case 1:return-1;case 3:return 1;default:return 0}},ni=i=>{switch(i){case .25:return 0;case .5:return 1;case 2:return 3;default:return 2}},sr=class extends $w{constructor(){const i=Ds*tr+20,e=Ds*tr/2;super({width:i,height:e,backgroundColor:1118481,antialias:!0,autoDensity:!0,resolution:1,sharedLoader:!0,sharedTicker:!0}),this._tilemap=[],this._doorLocation=new Bn(0,0),this._width=0,this._height=0,this._isHolding=!1,this._lastUsedTile=new Bn(-1,-1),this._actionSettings=new _L}initialize(){if(this._isInitialized)return;const i=A_().getCollection("floor_editor");i&&(this._assetCollection=i,this._tilemapRenderer=new Qw(i.baseTexture),this.registerEventListeners(),this.stage.addChild(this._tilemapRenderer),this._isInitialized=!0)}registerEventListeners(){const i=new Bn;this._tilemapRenderer.containsPoint=e=>(this._tilemapRenderer.worldTransform.applyInverse(e,i),this.tileHitDetection(i,!1)),this._tilemapRenderer.on("pointerup",()=>{this._isHolding=!1}),this._tilemapRenderer.on("pointerout",()=>{this._isHolding=!1}),this._tilemapRenderer.on("pointerdown",e=>{if(!(e.data.originalEvent instanceof PointerEvent)&&!(e.data.originalEvent instanceof TouchEvent))return;const s=e.data.originalEvent;if(s instanceof MouseEvent&&s.button===2)return;const n=e.data.global;this.tileHitDetection(n,!0)}),this._tilemapRenderer.on("click",e=>{if(!(e.data.originalEvent instanceof PointerEvent)||e.data.originalEvent.button===2)return;const n=e.data.global;this.tileHitDetection(n,!0,!0)})}tileHitDetection(i,e,s=!1){const n=this._tilemapRenderer.pointsBuf,r=FI,o=n.length;e&&(this._isHolding=!0);for(let l=0;l<o;l+=r){const c=l+r,u=n.slice(l,c),h=Ds,m=Ds/2,p=Math.floor(i.x),E=Math.floor(i.y),_=u[2],I=u[3],C=_+h/2,f=I+m/2,S=Math.abs(p-C),T=Math.abs(E-f);if(S/(h*.6)+T/(m*.6)<=1){if(this._isHolding){const[y,w]=IL(_,I);s?this.onClick(y,w):(this._lastUsedTile.x!==y||this._lastUsedTile.y!==w)&&(this._lastUsedTile.x=y,this._lastUsedTile.y=w,this.onClick(y,w))}return!0}}return!1}onClick(i,e){const s=this._tilemap[e][i],n=mo.indexOf(s.height);let r=0;switch(this._actionSettings.currentAction){case Ot.DOOR:s.height!=="x"&&(this._doorLocation.x=i,this._doorLocation.y=e,this.renderTiles());return;case Ot.UP:if(s.height==="x")return;r=n+1;break;case Ot.DOWN:if(s.height==="x"||n<=1)return;r=n-1;break;case Ot.SET:r=mo.indexOf(this._actionSettings.currentHeight);break;case Ot.UNSET:r=0;break}if(r===-1||n===r)return;r>0&&(i+1>this._width&&(this._width=i+1),e+1>this._height&&(this._height=e+1));const o=mo[r];o&&(s.isBlocked||(this._tilemap[e][i].height=o,this.renderTiles()))}renderTiles(){this.tilemapRenderer.clear();for(let i=0;i<this._tilemap.length;i++)for(let e=0;e<this.tilemap[i].length;e++){const s=this.tilemap[i][e];let n=s.height;this._doorLocation.x===e&&this._doorLocation.y===i&&(n=sr.TILE_DOOR),s.isBlocked&&(n=sr.TILE_BLOCKED);const[r,o]=EL(e,i);this._tilemapRenderer.tile(this._assetCollection.getTexture(`floor_editor_${n}`),r,o)}}setTilemap(i,e){this._tilemap=[];const s=i.split("\r");let n=0,r=s.length;for(let o=0;o<r;o++){const l=s[o];if(l.length===0){s.splice(o,1),r=s.length,o--;continue}l.length>n&&(n=l.length)}for(let o=0;o<r;o++){this._tilemap[o]=[];const l=s[o];for(let c=0;c<n;c++){const u=e[o]&&e[o][c]||!1,h=l[c];h!=="x"&&h!=="X"&&h?this._tilemap[o][c]=new si(h,u):this._tilemap[o][c]=new si("x",u)}for(let c=n;c<tr;c++)this.tilemap[o][c]=new si("x",!1)}for(let o=r;o<tr;o++){this.tilemap[o]||(this.tilemap[o]=[]);for(let l=0;l<tr;l++)this.tilemap[o][l]=new si("x",!1)}this._width=n,this._height=r}getCurrentTilemapString(){if(this._tilemap[this._height-1][this._width-1].height==="x"){this._width=-1,this._height=-1;for(let s=tr-1;s>=0;s--)if(this._tilemap[s])for(let n=tr-1;n>=0;n--){if(!this._tilemap[s][n])continue;this._tilemap[s][n].height!=="x"&&(n+1>this._width&&(this._width=n+1),s+1>this._height&&(this._height=s+1))}}const e=[];for(let s=0;s<this._height;s++){const n=[];for(let r=0;r<this._width;r++){const o=this._tilemap[s][r];n[r]=o.height}e[s]=n.join("")}return e.join("\r")}clear(){this._tilemapRenderer.interactive=!1,this._tilemap=[],this._doorLocation.set(-1,-1),this._width=0,this._height=0,this._isHolding=!1,this._lastUsedTile.set(-1,-1),this._actionSettings.clear(),this._tilemapRenderer.clear()}get tilemapRenderer(){return this._tilemapRenderer}get tilemap(){return this._tilemap}get doorLocation(){return this._doorLocation}set doorLocation(i){this._doorLocation=i}get actionSettings(){return this._actionSettings}static get instance(){return sr._INSTANCE||(sr._INSTANCE=new sr),sr._INSTANCE}};let Vt=sr;Vt._INSTANCE=null;Vt.TILE_BLOCKED="r_blocked";Vt.TILE_DOOR="r_door";const hI=a.createContext({originalFloorplanSettings:null,setOriginalFloorplanSettings:null,visualizationSettings:null,setVisualizationSettings:null}),CL=i=>t(hI.Provider,{...i}),mc=()=>a.useContext(hI),SL=i=>{const{gap:e=1,children:s=null,...n}=i,[r,o]=a.useState(!1),[l,c]=a.useState(!1),{originalFloorplanSettings:u=null,setOriginalFloorplanSettings:h=null,setVisualizationSettings:m=null}=mc(),p=a.useRef(null);return W(gg,E=>{const _=E.getParser();h(I=>{const C={...I};return C.reservedTiles=_.blockedTilesMap,Vt.instance.setTilemap(C.tilemap,C.reservedTiles),C}),o(!0),p.current.scrollTo(Vt.instance.view.width/3,0)}),W(ug,E=>{const _=E.getParser();h(I=>{const C={...I};return C.entryPoint=[_.x,_.y],C.entryPointDir=_.direction,C}),m(I=>{const C={...I};return C.entryPointDir=_.direction,C}),Vt.instance.doorLocation=new Bn(_.x,_.y),c(!0)}),a.useEffect(()=>()=>{Vt.instance.clear(),m(E=>({wallHeight:u.wallHeight,thicknessWall:u.thicknessWall,thicknessFloor:u.thicknessFloor,entryPointDir:E.entryPointDir}))},[u.thicknessFloor,u.thicknessWall,u.wallHeight,m]),a.useEffect(()=>{!l||!r||Vt.instance.renderTiles()},[l,r]),Vs(()=>{B(new Lf),B(new Uf),Vt.instance.tilemapRenderer.interactive=!0,p.current&&p.current.appendChild(Vt.instance.renderer.view)}),d(v,{gap:e,...n,overflow:"hidden",position:"relative",children:[t(P,{fit:!0,overflow:"auto",innerRef:p}),t(V,{skin:100,colour:L.white,position:"absolute",className:"top-0 start-0 z-90 pointer-events-none floorplan-canvas-cover"}),s]})},Iu=i=>i.replace(/\r\n|\r|\n/g,`
  9040. `).toLowerCase(),TL=i=>{const{onCloseClick:e=null}=i,[s,n]=a.useState(""),{originalFloorplanSettings:r=null}=mc(),o=()=>{B(new Pl(s.split(`
  9041. `).join("\r"),r.entryPoint[0],r.entryPoint[1],r.entryPointDir,yi(r.thicknessWall),yi(r.thicknessFloor),r.wallHeight-1))};return Vs(()=>{n(Iu(r.tilemap))}),d(le,{colour:L.tertiary_grey,skin:1,title:g("floor.plan.editor.import.export"),className:"floorplan-import-export",onCloseClick:e,children:[t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:t("textarea",{className:"h-100 ton-input black-border",value:s,onChange:l=>n(l.target.value)})}),d(R,{justifyContent:"between",className:"mt-1",children:[t(D,{skin:6,colour:L.secondary_yellow,onClick:l=>n(Iu(r.tilemap)),children:g("floor.plan.editor.revert.to.last.received.map")}),t(D,{skin:6,colour:L.primary_blue,onClick:o,children:g("floor.plan.editor.save")})]})]})},NL=0,Cu=16,RL=0,Ia=26,vL=[{index:0,value:"0",caption:"navigator.roomsettings.wall_thickness.thinnest"},{index:1,value:"1",caption:"navigator.roomsettings.wall_thickness.thin"},{index:2,value:"2",caption:"navigator.roomsettings.wall_thickness.normal"},{index:3,value:"3",caption:"navigator.roomsettings.wall_thickness.thick"}],bL=[{index:0,value:"0",caption:"navigator.roomsettings.floor_thickness.thinnest"},{index:1,value:"1",caption:"navigator.roomsettings.floor_thickness.thin"},{index:2,value:"2",caption:"navigator.roomsettings.floor_thickness.normal"},{index:3,value:"3",caption:"navigator.roomsettings.floor_thickness.thick"}],OL=i=>{const{visualizationSettings:e=null,setVisualizationSettings:s=null}=mc(),[n,r]=a.useState(Ot.SET),[o,l]=a.useState(0),c=_=>{r(_),Vt.instance.actionSettings.currentAction=_},u=()=>{s(_=>{const I={..._};return I.entryPointDir<7?++I.entryPointDir:I.entryPointDir=0,I})},h=_=>{(isNaN(_)||_<=0)&&(_=0),_>26&&(_=26),l(_),Vt.instance.actionSettings.currentHeight=_.toString(36)},m=_=>{s(I=>{const C={...I};return C.thicknessFloor=_,C})},p=_=>{s(I=>{const C={...I};return C.thicknessWall=_,C})},E=_=>{(isNaN(_)||_<=0)&&(_=NL),_>Cu&&(_=Cu),s(I=>{const C={...I};return C.wallHeight=_,C})};return d(R,{fullWidth:!0,gap:3,children:[d(v,{gap:1,children:[d(R,{gap:4,children:[d(v,{gap:1,children:[t(N,{className:"volter-bold",children:g("floor.plan.editor.draw.mode")}),d(R,{gap:3,children:[d(R,{gap:1,children:[t(D,{colour:n===Ot.SET?L.secondary_green:L.white,onClick:_=>c(Ot.SET),className:"p-0 d-flex align-items-center justify-content-center",children:t("i",{className:"icon icon-set-tile"})}),t(D,{colour:n===Ot.UNSET?L.secondary_green:L.white,onClick:_=>c(Ot.UNSET),className:"p-0 d-flex align-items-center justify-content-center",children:t("i",{className:"icon icon-unset-tile"})})]}),d(R,{gap:1,children:[t(D,{colour:n===Ot.UP?L.secondary_green:L.white,onClick:_=>c(Ot.UP),className:"p-0 d-flex align-items-center justify-content-center",children:t("i",{className:"icon icon-increase-height"})}),t(D,{colour:n===Ot.DOWN?L.secondary_green:L.white,onClick:_=>c(Ot.DOWN),className:"p-0 d-flex align-items-center justify-content-center",children:t("i",{className:"icon icon-decrease-height"})})]}),t(D,{colour:n===Ot.DOOR?L.secondary_green:L.white,onClick:_=>c(Ot.DOOR),className:"p-0",children:t("i",{className:"icon icon-set-door"})})]})]}),t(v,{gap:1,children:d(v,{gap:1,children:[t(N,{className:"volter-bold",children:g("floor.plan.editor.enter.direction")}),t("i",{className:`icon icon-door-direction-${e.entryPointDir} cursor-pointer`,onClick:u})]})})]}),d(P,{position:"relative",children:[t(N,{className:"volter-bold",children:g("floor.plan.editor.tile.height")}),t(R,{className:"floorplan-slider-items mt-1 mx-1",children:Array.from(Array(Ia)).map((_,I)=>{let C=fL[I.toString(33)];return t("div",{style:{backgroundColor:`#${C}`},"data-ind":I},I)})}),t(P,{className:"icon icon-arrow-up",style:{left:`${14*Math.min(o,Ia-1)}px`}}),t("input",{type:"range",className:"floorplan-slider",min:RL,max:Ia,step:1,value:o,onChange:_=>h(parseInt(_.target.value))})]})]}),d(v,{justifyContent:"between",children:[d(v,{gap:1,children:[t(N,{className:"volter-bold",children:g("floor.plan.editor.room.options")}),d(R,{gap:2,children:[t(es,{fullWidth:!0,options:vL,selectedIndex:e.thicknessWall,changeIndex:_=>p(_)}),t(es,{fullWidth:!0,options:bL,selectedIndex:e.thicknessFloor,changeIndex:_=>m(_)})]})]}),d(v,{gap:1,children:[t(N,{className:"volter-bold",children:g("floor.editor.wall.height")}),t("input",{type:"number",className:"ton-input black-border mb-1 flex-grow-0",value:e.wallHeight,onChange:_=>E(_.target.valueAsNumber)})]})]})]})},wL=i=>{const[e,s]=a.useState(!1),[n,r]=a.useState(!1),[o,l]=a.useState({tilemap:"",reservedTiles:[],entryPoint:[0,0],entryPointDir:2,wallHeight:-1,thicknessWall:1,thicknessFloor:1}),[c,u]=a.useState({entryPointDir:2,wallHeight:-1,thicknessWall:1,thicknessFloor:1}),h=()=>{B(new Pl(Vt.instance.getCurrentTilemapString(),Vt.instance.doorLocation.x,Vt.instance.doorLocation.y,c.entryPointDir,yi(c.thicknessWall),yi(c.thicknessFloor),c.wallHeight-1))},m=()=>{u({wallHeight:o.wallHeight,thicknessWall:o.thicknessWall,thicknessFloor:o.thicknessFloor,entryPointDir:o.entryPointDir}),Vt.instance.doorLocation=new Bn(o.entryPoint[0],o.entryPoint[1]),Vt.instance.setTilemap(o.tilemap,o.reservedTiles),Vt.instance.renderTiles()};return ke(Jt.DISPOSED,p=>s(!1)),W(dg,p=>{const E=p.getParser();l(_=>{const I={..._};return I.tilemap=E.model,I.wallHeight=E.wallHeight+1,I}),u(_=>{const I={..._};return I.wallHeight=E.wallHeight+1,I})}),W(hg,p=>{const E=p.getParser();l(_=>{const I={..._};return I.thicknessFloor=ni(E.thicknessFloor),I.thicknessWall=ni(E.thicknessWall),I}),u(_=>{const I={..._};return I.thicknessFloor=ni(E.thicknessFloor),I.thicknessWall=ni(E.thicknessWall),I})}),a.useEffect(()=>{const p={linkReceived:E=>{const _=E.split("/");if(!(_.length<2))switch(_[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(I=>!I);return}},eventUrlPrefix:"floor-editor/"};return dt(p),()=>ht(p)},[]),a.useEffect(()=>{Vt.instance.initialize()},[]),d(CL,{value:{originalFloorplanSettings:o,setOriginalFloorplanSettings:l,visualizationSettings:c,setVisualizationSettings:u},children:[e&&d(le,{skin:1,colour:L.maintenance_orange,title:g("floor.plan.editor.title"),className:"nitro-floorplan-editor",onCloseClick:()=>s(!1),children:[t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:d(R,{overflow:"hidden",fullHeight:!0,column:!0,gap:1,children:[t(SL,{overflow:"hidden"}),t(OL,{})]})}),d(R,{justifyContent:"between",className:"mt-1",children:[t(D,{skin:6,colour:L.secondary_yellow,onClick:m,children:g("floor.plan.editor.reload")}),d(zr,{children:[t(D,{skin:5,onClick:p=>r(!0),children:g("floor.plan.editor.import.export")}),t(D,{skin:6,colour:L.primary_blue,onClick:h,children:g("floor.plan.editor.save")})]})]})]}),n&&t(TL,{onCloseClick:()=>r(!1)})]})},yL=()=>{var u;const{friendManagerVisible:i,setFriendManagerVisible:e,settings:s,getAllFriendsForCategory:n,friends:r}=ns(),[o,l]=a.useState(-1),c=h=>{l(h===o?-1:h)};return i?t(le,{title:g("window.friend.management"),className:"ton-friend-manager",onCloseClick:h=>e(!1),children:d(V,{fullHeight:!0,overflow:"hidden",column:!1,gap:1,children:[t(v,{gap:1,overflow:"auto",fullWidth:!0,children:s.categories&&s.categories.map((h,m)=>d(V,{colour:L.light_grey,onClick:p=>c(m),className:"p-1",children:[d(R,{justifyContent:"between",children:[d(N,{children:[h.name," (",n(h.id).length,")"]}),t(P,{className:`ton-shockwave-carat ${o==m?"up":"down"} `})]}),o==m&&t("hr",{className:"mt-1 mb-0 bg-dark"}),o==m&&n(h.id).map((p,E)=>d(R,{fullWidth:!0,className:"p-1 "+(E%2!=0&&"bg-white"),gap:1,children:[t(bs,{userName:p.name}),t(N,{children:p.name})]},E))]},m))}),d(V,{colour:L.light_grey,fullWidth:!0,overflow:"hidden",className:"p-1",children:[t(N,{className:"volter-bold",children:g("window.friend.management.add.to",["category"],[(u=s.categories[o])==null?void 0:u.name])}),t("hr",{className:"my-1 bg-dark"}),t(v,{gap:1,overflow:"auto",children:r&&r.map((h,m)=>d(R,{fullWidth:!0,className:"p-1 "+(m%2!=0&&"bg-white"),gap:1,children:[t(bs,{userName:h.name}),t(N,{children:h.name})]},m))})]})]})}):null},AL=i=>{const{friend:e=null}=i,[s,n]=a.useState(!1),{followFriend:r=null}=ns(),o=a.useRef();return a.useEffect(()=>{const l=c=>{const u=o.current;u&&c.target!==u&&!u.contains(c.target)&&n(!1)};return document.addEventListener(xe.MOUSE_CLICK,l),()=>document.removeEventListener(xe.MOUSE_CLICK,l)},[]),e?d(V,{skin:5,colour:L.secondary_green,innerRef:o,className:"friend-bar-item "+(s?"friend-bar-item-active":""),onClick:l=>n(c=>!c),children:[d("div",{className:`friend-bar-item-head position-absolute ${e.id>0?"avatar":"group"}`,children:[e.id>0&&t(it,{headOnly:!0,figure:e.figure,direction:2}),e.id<=0&&t(ot,{isGroup:!0,badgeCode:e.figure})]}),t("div",{className:"friend-bar-text text-truncate p-1",children:e.name}),s&&d(R,{gap:2,className:"d-flex py-2",children:[t(P,{className:"nitro-friends-spritesheet icon-friendbar-chat cursor-pointer",onClick:l=>Mo(e.id)}),e.followingAllowed&&t(P,{className:"nitro-friends-spritesheet icon-friendbar-visit cursor-pointer",onClick:l=>r(e)}),t(P,{className:"nitro-friends-spritesheet icon-profile cursor-pointer",onClick:l=>ps(e.id)})]})]}):d(V,{skin:5,colour:L.tertiary_grey,innerRef:o,className:"friend-bar-item friend-bar-search",children:[t("div",{className:"friend-bar-item-head position-absolute"}),t("div",{className:"friend-bar-text text-wrap",children:g("friend.bar.find.title")})]})},kL=i=>{const{onlineFriends:e=null}=i,[s,n]=a.useState(0),[r,o]=a.useState(1),{inGame:l}=ys(),c=150,u=a.useRef(),h=a.useCallback(()=>{let m=3+e.length,p=Math.min(Math.floor((u.current.getBoundingClientRect().width-60)/c),7);m>=p&&(m=p),o(m)},[c,e]);return a.useEffect(()=>{if(!u.current)return;const m=new ResizeObserver(()=>{h(),m.disconnect()});return m.observe(u.current),window.addEventListener("resize",()=>{h()}),()=>{m.disconnect(),window.removeEventListener("resize",()=>{h()})}},[h]),a.useEffect(()=>{l||h()},[h,l]),d(R,{innerRef:u,className:"w-100 justify-content-center align-items-center",children:[t(D,{className:"friend-bar-button left",disabled:s<=0,onClick:m=>n(s-1)}),r>0&&Array.from(Array(r),(m,p)=>t(AL,{friend:e[s+p]||null},p)),t(D,{className:"friend-bar-button right",disabled:!(e.length>r&&s+r<=e.length-1),onClick:m=>n(s+1)})]})},ML=i=>{const{friend:e=null,selected:s=!1,selectFriend:n=null}=i,[r,o]=a.useState(!1),{followFriend:l=null,updateRelationship:c=null}=ns(),u=_=>{_.stopPropagation(),l(e)},h=_=>{_.stopPropagation(),Mo(e.id)},m=_=>{_.stopPropagation(),o(!0)},p=(_,I)=>{_.stopPropagation(),c(e,I),o(!1)},E=()=>{if(!e)return"none";switch(e.relationshipStatus){case Kt.RELATIONSHIP_HEART:return"heart";case Kt.RELATIONSHIP_SMILE:return"smile";case Kt.RELATIONSHIP_BOBBA:return"bobba";default:return"none"}};return e?d(vi,{justifyContent:"between",className:`px-1 friend-item ${s&&"active"}`,onClick:_=>n(e.id),children:[d(R,{alignItems:"center",className:"friend-item",gap:0,children:[e.id>0&&t(it,{figure:e.figure,headOnly:!0,direction:2}),e.id<=0&&t(ot,{isGroup:!0,badgeCode:e.figure}),t("div",{className:"friend-item-name",children:e.name})]}),d(R,{alignItems:"center",gap:1,children:[!r&&d(z,{children:[E()!="none"&&e.id>0&&t(P,{className:"nitro-friends-spritesheet icon-"+E()}),e.followingAllowed&&t(P,{pointer:!0,onClick:u,className:"nitro-friends-spritesheet icon-follow",title:g("friendlist.tip.follow")}),e.online&&t(P,{pointer:!0,className:"nitro-friends-spritesheet icon-chat",onClick:h,title:g("friendlist.tip.im")}),e.id>0&&t(P,{className:"ton-shockwave-carat down cursor-pointer",onClick:m,title:g("infostand.link.relationship")})]}),r&&d(z,{children:[t(P,{pointer:!0,className:"nitro-friends-spritesheet icon-heart",onClick:_=>p(_,Kt.RELATIONSHIP_HEART)}),t(P,{pointer:!0,className:"nitro-friends-spritesheet icon-smile",onClick:_=>p(_,Kt.RELATIONSHIP_SMILE)}),t(P,{pointer:!0,className:"nitro-friends-spritesheet icon-bobba",onClick:_=>p(_,Kt.RELATIONSHIP_BOBBA)}),t(P,{pointer:!0,className:"nitro-friends-spritesheet icon-none",onClick:_=>p(_,Kt.RELATIONSHIP_NONE)}),t(P,{pointer:!0,className:"ton-shockwave-carat up",onClick:_=>p(_,Kt.RELATIONSHIP_NONE)})]})]})]}):null},Ca=i=>{const{list:e=null,selectedFriendsIds:s=null,selectFriend:n=null}=i;return!e||!e.length?null:t(v,{fullHeight:!0,gap:0,children:e.map((r,o)=>t(ML,{friend:r,selected:s&&s.indexOf(r.id)>=0,selectFriend:n},o))})},UL=i=>{const{request:e=null}=i,{requestResponse:s=null}=ns();return e?d(vi,{justifyContent:"between",className:"friend-request-name px-2 py-1",children:[d(R,{alignItems:"center",gap:1,children:[t(bs,{userId:e.id}),t("div",{children:e.name})]}),d(R,{alignItems:"center",gap:1,children:[t(P,{className:"ton-friend-icons accept-icon active",onClick:n=>s(e.id,!0)}),t(P,{className:"ton-friend-icons delete-icon active",onClick:n=>s(e.id,!1)})]})]}):null},LL=i=>{const{children:e=null,...s}=i,{requests:n=[],requestResponse:r=null}=ns();return n.length?d(uo,{className:"friend-request",...s,children:[d(v,{fullHeight:!0,justifyContent:"between",gap:1,children:[t(v,{gap:0,children:n.map((o,l)=>t(UL,{request:o},l))}),t(R,{justifyContent:"center",className:"px-2 py-1",children:t(D,{className:"decline-all",skin:4,onClick:o=>r(-1,!1),children:g("friendlist.requests.dismissall")})})]}),e]}):null},PL=i=>{const{selectedFriendsIds:e=null,removeFriendsText:s=null,removeSelectedFriends:n=null,onCloseClick:r=null}=i;return t(le,{title:g("friendlist.removefriendconfirm.title"),className:"nitro-friends-remove-confirmation",onCloseClick:r,children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:d(v,{gap:3,children:[t(N,{children:s}),d(R,{gap:1,children:[t(D,{fullWidth:!0,onClick:n,children:g("generic.ok")}),t(D,{fullWidth:!0,onClick:r,children:g("generic.cancel")})]})]})})})},DL=i=>{const{selectedFriendsIds:e=null,onCloseClick:s=null,sendRoomInvite:n=null}=i,[r,o]=a.useState("");return t(le,{uniqueKey:"nitro-friends-room-invite",title:g("friendlist.invite.title"),className:"nitro-friends-room-invite",onCloseClick:s,children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:d(v,{children:[t(N,{children:g("friendlist.invite.summary",["count"],[e.length.toString()])}),t("textarea",{className:"form-control",value:r,maxLength:255,onChange:l=>o(l.target.value)}),t(N,{center:!0,className:"bg-muted p-1",children:g("friendlist.invite.note")}),d(R,{gap:1,children:[t(D,{fullWidth:!0,disabled:r.length===0||e.length===0,onClick:()=>n(r),children:g("friendlist.invite.send")}),t(D,{fullWidth:!0,onClick:s,children:g("generic.cancel")})]})]})})})},FL=i=>{const{...e}=i,[s,n]=a.useState(""),[r,o]=a.useState(null),[l,c]=a.useState(null),{canRequestFriend:u=null,requestFriend:h=null}=ns();return W(gh,m=>{const p=m.getParser();o(p.friends),c(p.others)}),a.useEffect(()=>{if(!s||!s.length)return;const m=setTimeout(()=>{!s||!s.length||B(new fp(s))},500);return()=>clearTimeout(m)},[s]),d(uo,{className:"friend-search",...e,children:[d(v,{className:"friend-tab-content",children:[r&&d(z,{children:[r.length===0&&t(N,{bold:!0,className:"px-2 py-1",children:g("friendlist.search.nofriendsfound")}),r.length>0&&d(v,{gap:0,children:[t(N,{bold:!0,className:"px-2 py-1",children:g("friendlist.search.friendscaption",["cnt"],[r.length.toString()])}),t("hr",{className:"mx-2 mt-0 mb-1 text-black"}),t(v,{gap:0,children:r.map(m=>d(vi,{justifyContent:"between",className:"px-2 py-1",children:[d(R,{alignItems:"center",gap:1,children:[t(bs,{userId:m.avatarId}),t("div",{children:m.avatarName})]}),t(R,{alignItems:"center",gap:1,children:m.isAvatarOnline&&t(P,{className:"nitro-friends-spritesheet icon-chat cursor-pointer",onClick:p=>Mo(m.avatarId),title:g("friendlist.tip.im")})})]},m.avatarId))})]})]}),l&&d(z,{children:[l.length===0&&t(N,{bold:!0,className:"px-2 py-1",children:g("friendlist.search.noothersfound")}),l.length>0&&d(v,{gap:0,children:[t(N,{bold:!0,className:"px-2 py-1",children:g("friendlist.search.otherscaption",["cnt"],[l.length.toString()])}),t("hr",{className:"mx-2 mt-0 mb-1 text-black"}),t(v,{gap:0,children:l.map(m=>d(vi,{justifyContent:"between",className:"px-2 py-1",children:[d(R,{alignItems:"center",gap:1,children:[t(bs,{userId:m.avatarId}),t("div",{children:m.avatarName})]}),t(R,{alignItems:"center",gap:1,children:u(m.avatarId)&&t(P,{className:"nitro-friends-spritesheet icon-add cursor-pointer",onClick:p=>h(m.avatarId,m.avatarName),title:g("friendlist.tip.addfriend")})})]},m.avatarId))})]})]})]}),t(R,{className:"friend-search-bottom mt-auto",children:t("input",{type:"text",className:"search-friends",placeholder:g("generic.search"),value:s,maxLength:50,onChange:m=>n(m.target.value)})})]})},xL=i=>{const[e,s]=a.useState(!1),[n,r]=a.useState(!1),[o,l]=a.useState(!1),[c,u]=a.useState(!1),[h,m]=a.useState(!1),[p,E]=a.useState([]),[_,I]=a.useState(!1),[C,f]=a.useState(!1),{onlineFriends:S=[],offlineFriends:T=[],requests:b=[],requestFriend:y=null,settings:w,getFriendsForCategory:O,friendManagerVisible:F,setFriendManagerVisible:U}=ns(),j=q=>{q.stopPropagation(),Mo(p.length)},x=a.useMemo(()=>{if(!p||!p.length)return"";const q=[];for(const Z of p){let ce=S.find(se=>se.id===Z);ce||(ce=T.find(se=>se.id===Z)),ce&&q.push(ce.name)}return g("friendlist.removefriendconfirm.userlist",["user_names"],[q.join(", ")])},[T,S,p]),M=a.useCallback(q=>{q<0||E(Z=>{const ce=[...Z],se=ce.indexOf(q);return se>-1?ce.splice(se,1):ce.push(q),ce})},[E]),G=q=>{!p.length||!q||!q.length||q.length>255||(B(new Cp(q,p)),I(!1))},H=()=>{p.length!==0&&(E(q=>(B(new Ep(...q)),[])),f(!1))};a.useEffect(()=>{const q={linkReceived:Z=>{const ce=Z.split("/");if(!(ce.length<2))switch(ce[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(se=>!se);return;case"request":if(ce.length<4)return;y(parseInt(ce[2]),ce[3])}},eventUrlPrefix:"friends/"};return dt(q),()=>ht(q)},[y]);const Y=d(R,{fullWidth:!0,gap:1,className:"friendlist-bottom px-1 justify-content-between mt-auto",children:[p&&p.length===0&&d(z,{children:[d(R,{gap:1,children:[t(D,{skin:4,onMouseOver:q=>r(!0),onMouseLeave:q=>r(!1),children:t(P,{className:"ton-friend-icons message-icon placement"})}),t(D,{skin:4,onMouseOver:q=>u(!0),onMouseLeave:q=>u(!1),children:t(P,{className:"ton-friend-icons invite-icon placement"})})]}),t(D,{skin:4,onMouseOver:q=>m(!0),onMouseLeave:q=>m(!1),children:t(P,{className:"ton-friend-icons delete-icon placement"})})]}),p&&p.length>0&&d(z,{children:[d(R,{gap:1,children:[p&&p.length===1&&t(D,{skin:4,onClick:j,onMouseOver:q=>r(!0),onMouseLeave:q=>r(!1),children:t(P,{className:"ton-friend-icons message-icon active cursor-pointer placement"})}),p&&p.length>1&&t(D,{skin:4,onMouseOver:q=>r(!0),onMouseLeave:q=>r(!1),children:t(P,{className:"ton-friend-icons message-icon placement"})}),t(D,{skin:4,onClick:()=>I(!0),onMouseOver:q=>u(!0),onMouseLeave:q=>u(!1),children:t(P,{className:"ton-friend-icons invite-icon active cursor-pointer placement"})})]}),t(D,{skin:4,onClick:q=>f(!0),children:t(P,{onMouseOver:q=>m(!0),onMouseLeave:q=>m(!1),className:"ton-friend-icons delete-icon active cursor-pointer placement"})})]})]});return e?d(z,{children:[d(le,{skin:1,className:"nitro-friends",title:g("friendlist.friends"),colour:L.primary_yellow,uniqueKey:"nitro-friends",onCloseClick:q=>s(!1),children:[t(P,{className:"ton-frame-divider"}),t(R,{fullHeight:!0,overflow:"hidden",className:"ton-friendlist-middle flex-grow-1",children:d(OA,{fullHeight:!0,fullWidth:!0,overflow:"hidden",children:[d(uo,{className:"online-friends overflow-hidden",headerText:g("friendlist.friends")+` (${S.length})`,isExpanded:!0,children:[t(v,{fullHeight:!0,gap:0,className:"overflow-y-scroll",children:t(Ca,{list:S,selectedFriendsIds:p,selectFriend:M})}),Y]}),w.categories&&w.categories.map((q,Z)=>d(uo,{className:"online-friends overflow-hidden",headerText:q.name+` (${O(q.id).length})`,isExpanded:!1,children:[t(v,{fullHeight:!0,gap:0,className:"overflow-y-scroll",children:t(Ca,{list:O(q.id),selectedFriendsIds:p,selectFriend:M})}),Y]},Z)),d(uo,{className:"offline-friends overflow-hidden",headerText:g("friendlist.friends.offlinecaption")+` (${T.length})`,children:[t(v,{fullHeight:!0,gap:0,className:"overflow-y-scroll",children:t(Ca,{list:T,selectedFriendsIds:p,selectFriend:M})}),Y]}),t(LL,{headerText:g("friendlist.tab.friendrequests")+` (${b.length})`,isExpanded:!1}),t(FL,{headerText:g("people.search.title")})]})}),t(P,{className:"ton-frame-divider"}),d(R,{className:"console-bottom",children:[t(V,{className:"little-button",pointer:!0,onClick:q=>U(!F),children:t(P,{className:"nitro-friends-spritesheet icon-settings"})}),n&&t(R,{children:g("friendlist.tip.im")}),o&&t(R,{children:g("memenu.profile")}),c&&t(R,{children:g("guide.help.request.guide.ongoing.invite.button")}),h&&t(R,{children:g("generic.delete")})]})]}),_&&t(DL,{selectedFriendsIds:p,onCloseClick:()=>I(!1),sendRoomInvite:G}),C&&t(PL,{selectedFriendsIds:p,removeFriendsText:x,onCloseClick:()=>f(!1),removeSelectedFriends:H})]}):null},GL=i=>{const{thread:e=null,group:s=null}=i,n=a.useMemo(()=>s.type===Fr.GROUP_CHAT&&z_(s.chats[0].extraData),[s]),r=a.useMemo(()=>!e||!s?!1:!!(s.type===Fr.PRIVATE_CHAT&&s.userId===J().userId||n&&s.chats.length&&n.userId===J().userId),[e,s,n]),o=()=>{if(!s.chats||s.chats&&s.chats.length==0)return null;let c=null;for(let u of s.chats)u.type==Ps.CHAT&&(c=u);return c?c.date:null},l=c=>!s.chats||s.chats&&s.chats.length==0?!0:s.chats[0]==c;return!e||!s?null:s.userId?t(R,{fullWidth:!0,gap:0,children:t(R,{gap:1,fullWidth:!0,className:`text-black mb-1 py-1 px-1 ${r?"own-chat":"friend-chat"}`,children:d(P,{fullWidth:!0,children:[d(N,{bold:!0,className:"pe-1",children:[r&&`${J().userName}`,!r&&`${n?n.username:e.participant.name}`]}),s.chats.map((c,u)=>l(c)?t(N,{className:"pb-1",children:c.message},u):t(P,{className:"pb-1",children:c.message},u)),t(N,{variant:"muted",className:"float-right",children:o()&&o().toLocaleTimeString()})]})})}):t(z,{children:s.chats.map((c,u)=>t(R,{fullWidth:!0,gap:2,justifyContent:"start",children:d(P,{className:"w-100 text-break",children:[c.type===Ps.SECURITY_NOTIFICATION&&d(R,{gap:2,alignItems:"center",className:"bg-light mb-2 px-2 py-1 text-muted",children:[t(P,{className:"nitro-friends-spritesheet icon-warning flex-shrink-0"}),t(P,{children:c.message})]}),c.type===Ps.ROOM_INVITE&&d(R,{gap:2,alignItems:"center",className:"bg-light mb-2 px-2 py-1 text-black",children:[t(P,{className:"messenger-notification-icon flex-shrink-0"}),d(P,{children:[g("messenger.invitation")+" ",c.message]})]})]})},u))})},BL=i=>{const{thread:e=null}=i;return e.setRead(),t(z,{children:e.groups.length>0&&e.groups.map((s,n)=>t(GL,{thread:e,group:s},n))})},HL=i=>{const[e,s]=a.useState(!1),[n,r]=a.useState(-1),[o,l]=a.useState(""),{visibleThreads:c=[],activeThread:u=null,getMessageThread:h=null,sendMessage:m=null,setActiveThreadId:p=null,closeThread:E=null}=QE(),{report:_=null}=un(),I=a.useRef(),C=a.useRef(),[f,S]=a.useState(0),T=()=>u&&u.participant&&B(new ki(u.participant.id)),b=()=>u&&u.participant&&ps(u.participant.id),y=()=>{!u||!o.length||(m(u,J().userId,o),l(""))},w=j=>{j.key==="Enter"&&y()};a.useEffect(()=>{const j={linkReceived:x=>{const M=x.split("/");if(M.length===2){if(M[1]==="open"){s(!0);return}if(M[1]==="toggle"){s(H=>!H);return}const G=h(parseInt(M[1]));if(!G)return;p(G.threadId),s(!0)}},eventUrlPrefix:"friends-messenger/"};return dt(j),()=>ht(j)},[h,p]),a.useEffect(()=>{!e||!u||(I.current.scrollTop=I.current.scrollHeight)},[e,u]),a.useEffect(()=>{if(e&&!u){n>0?p(n):c.length>0&&p(c[0].threadId);return}!e&&u&&(r(u.threadId),p(-1))},[e,u,n,c,p]);const[O,F]=a.useState(1),U=30;return a.useEffect(()=>{if(!e||!C||C&&!C.current)return;const j=()=>{F(Math.floor((C.current.clientWidth-U*2)/U))},x=new ResizeObserver(j);return j(),x.observe(C.current),()=>{x.disconnect()}},[U,C,e]),e?d(le,{colour:L.primary_yellow,uniqueKey:"nitro-friends-messenger",title:g("messenger.window.title",["OPEN_CHAT_COUNT"],[c.length.toString()]),className:"ton-friends-messenger",onCloseClick:j=>s(!1),children:[t(P,{className:"ton-frame-divider"}),t(v,{className:"ton-messenger-middle",children:d(v,{fullWidth:!0,size:4,overflow:"hidden",children:[t(v,{fullWidth:!0,overflow:"hidden",children:d(R,{fullHeight:!0,innerRef:C,className:"ton-messenger-header",children:[c.length>O&&f+O<=c.length-1&&t(R,{className:"open-chat-entry",onClick:j=>S(f-1),children:t(Gt,{icon:"chevron-left"})}),Array.from(Array(O),(j,x)=>{let M=c[f+x];if(M)return d(R,{column:!0,onClick:G=>p(M.threadId),classNames:["open-chat-entry",u===M?"active":""],children:[M.unread&&t(Do,{count:M.unreadCount}),t(R,{alignItems:"center",gap:1,children:d(R,{alignItems:"center",className:"friend-head px-1",children:[M.participant.id>0&&t(it,{figure:M.participant.figure,headOnly:!0,direction:2}),M.participant.id<=0&&t(ot,{isGroup:!0,badgeCode:M.participant.figure})]})})]},M.threadId)}),c.length>O&&f+O<=c.length-1&&t(R,{className:"open-chat-entry",onClick:j=>S(f+1),children:t(Gt,{icon:"chevron-right"})})]})}),t(v,{overflow:"hidden",className:"px-1",children:u&&d(z,{children:[d(R,{alignItems:"center",justifyContent:"between",gap:1,children:[d(R,{gap:1,children:[d(zr,{className:"gap-1",children:[t(D,{skin:0,colour:L.white,onClick:T,children:t(P,{className:"nitro-friends-spritesheet icon-follow"})}),t(D,{skin:0,colour:L.white,onClick:b,children:t(P,{className:"nitro-friends-spritesheet icon-profile-sm"})})]}),t(D,{skin:0,colour:L.white,onClick:()=>_(rt.IM,{reportedUserId:u.participant.id}),children:g("messenger.window.button.report")})]}),t(D,{skin:0,colour:L.white,onClick:j=>E(u.threadId),children:t(Gt,{icon:"times"})})]}),t(v,{fullWidth:!0,className:"overflow-auto chat-messages",children:t(v,{innerRef:I,overflow:"auto",gap:0,children:t(BL,{thread:u})})})]})})]})}),t(P,{className:"ton-frame-divider"}),u&&t(R,{gap:1,className:"p-2",children:t("textarea",{className:"messenger-input w-100",maxLength:255,placeholder:g("messenger.window.input.default",["FRIEND_NAME"],[u.participant.name]),value:o,onChange:j=>l(j.target.value),onKeyDown:w})})]}):null},VL=i=>{const{settings:e=null,onlineFriends:s=[]}=ns();return e?d(z,{children:[t(xL,{}),t(HL,{}),t(yL,{}),vo.createPortal(t(kL,{onlineFriends:s}),document.getElementById("friend-bar"))]}):null},WL=()=>{const{currentGame:i}=ys(),e=()=>{B(new Hl)};if(i)return t(D,{skin:2,onClick:e,children:g("generic.exit")})},jL=()=>{const{lastGame:i}=ys(),[e,s]=a.useState(""),[n,r]=a.useState(!1),[o,l]=a.useState(),[c,u]=a.useState(),[h,m]=a.useState(0);W(TE,I=>{let C=I.getParser();C&&(s(C.type),C.habbos&&C.habbos.sort((f,S)=>f.points<S.points?1:-1),l(C.habbos),u(C.teams),m(C.prize),r(!0))});const p=()=>{r(!1),l(null),u(null)},E=t(z,{children:o&&o.map((I,C)=>d(V,{skin:0,colour:L.light_grey,column:!1,justifyContent:"between",children:[t(N,{bold:!0,children:I.username}),d(N,{children:[I.points," ",g(`gamecenter.${i.gameNameId}.pts`)]})]},C))}),_=t(z,{children:o&&d(R,{column:!0,fullHeight:!0,fullWidth:!0,center:!0,children:[t(N,{bold:!0,variant:"light",children:g("gamecenter.best.player")}),t(R,{className:"game-center-leaderboard-winner-avatar",column:!0,children:t(it,{figure:o[0].look,direction:3,className:"mb-n3 align-self-center me-1"})}),d(V,{skin:0,colour:L.light_grey,className:"mt-n4 position-relative game-center-leaderboard-winner",fullWidth:!0,justifyContent:"between",column:!1,children:[t(P,{className:"trophy"}),t(N,{bold:!0,children:o[0].username}),d(N,{children:[o[0].points," ",g(`gamecenter.${i.gameNameId}.pts`)]})]})]})});if(n)return t(le,{colour:L.quaternary_grey,className:"game-center-leaderboard",title:g("gamecenter.leaderboard"),onCloseClick:p,children:d(R,{gap:1,fullHeight:!0,overflow:"hidden",children:[d(R,{column:!0,className:"w-100",fullHeight:!0,overflow:"hidden",children:[t(P,{className:"ton-frame-divider mx-0"}),t(V,{skin:-1,fullHeight:!0,overflow:"hidden",children:t(R,{className:"overflow-y-scroll pe-1 text-black",fullHeight:!0,column:!0,gap:2,children:e=="HABBOS"?E:null})}),t(P,{className:"ton-frame-divider mx-0"})]}),t(R,{column:!0,className:"w-75",fullHeight:!0,overflow:"hidden",children:d(V,{skin:4,colour:L.infostand_light_grey,fullHeight:!0,overflow:"hidden",className:"text-black",alignItems:"center",justifyContent:"center",children:[e=="HABBOS"?_:null,d(V,{skin:5,className:"mt-auto p-1 volter-bold mb-2",column:!1,gap:1,center:!0,colour:ee("currency.colours")[-1],children:[t(wt,{type:-1}),g(e=="HABBOS"?"gamecenter.they.won":"gamecenter.prize.was",["amount"],[h.toString()])]})]})})]})})},qL=()=>{const{games:i,selectedGame:e,setSelectedGame:s}=ys(),n=o=>{let l=["game-icon"];return e===o&&l.push("selected"),l.join(" ")},r=o=>`url(${Nt.interpolate(o.assetUrl)}${o.gameNameId}_icon.png)`;return d(P,{fullWidth:!0,className:"gameList-container bg-dark p-1",children:[t(N,{className:"ubuntu-bold color-inherit",children:g("gamecenter.game_list_title")}),t(R,{gap:3,children:i&&i.map((o,l)=>t(P,{className:n(o),onClick:c=>s(o),style:{backgroundImage:r(o)}},l))})]})},YL=()=>{const{currentGame:i}=ys(),[e,s]=a.useState([]),[n,r]=a.useState([]),[o,l]=a.useState("00:00");if(W(RE,c=>{let u=c.getParser();u&&(s(u.habbos),r(u.teams))}),W(bE,c=>{let u=c.getParser();if(!u)return;let h=new Date((u.totalTime-u.ticks)*1e3).toISOString().substring(14,19);l(h)}),a.useEffect(()=>{i||(s([]),l("00:00"),r([]))},[i]),!!i)return d(z,{children:[t(V,{skin:7,opacity:70,colour:L.tertiary_grey,className:"ubuntu-bold p-2 text-center",fullWidth:!0,children:o}),e&&e.length>0&&e.map((c,u)=>d(V,{skin:7,opacity:70,colour:L.tertiary_grey,className:"p-2 ubuntu-bold position-relative",column:!1,justifyContent:"between",children:[t(R,{className:"avatar-head",position:"relative",center:!0,children:t(it,{figure:c.look,scale:.5,headOnly:!0,direction:3,position:"absolute"})}),t(N,{className:"align-self-end ubuntu-bold",variant:"light",children:c.points})]},u))]})},zL=()=>{const{currentGame:i,stageStep:e,setStageStep:s}=ys(),[n,r]=a.useState();if(Vs(()=>{const o=Nt.getValue("sounds.url");r(new Audio(o.replace("%sample%","countdown")))}),W(vE,o=>{let l=o.getParser();l&&(l.step==5&&(n.currentTime=0,n.play()),s(l.step))}),!(e<0))return t(P,{className:"game-center-stage-overlay z-200","data-step":e})},KL=()=>{const{gameURL:i,setGameURL:e}=ys(),[s,n]=a.useState(0),r=a.useRef();return a.useEffect(()=>{if(!r||r&&!r.current)return;n(0);let o=document.createElement("iframe");o.src=i,o.classList.add("game-center-stage"),o.classList.add("h-100"),o.onload=()=>{n(l=>l+=1)},r.current.innerHTML="",r.current.appendChild(o)},[r,i]),a.useEffect(()=>{s>1&&(e(null),B(new Hl))},[s,e]),i?t(P,{innerRef:r,className:"game-center-stage"}):null},$L=()=>{const{selectedGame:i,accountStatus:e}=ys();a.useEffect(()=>{i&&(B(new S_(i.gameId)),B(new R_(i.gameId)))},[i]);const s=()=>bn.uintHexColor(i.bgColor),n=()=>`url(${Nt.interpolate(i.assetUrl)}${i.gameNameId}_theme.png),url(${Nt.interpolate(i.assetUrl)}${i.gameNameId}_gradient.png)`,r=()=>bn.uintHexColor(i.textColor),o=()=>{B(new T_(i.gameId))};if(e)return d(R,{className:"game-view py-4",fullHeight:!0,style:{backgroundColor:s(),backgroundImage:n(),color:r()},children:[d(R,{className:"w-75",column:!0,alignItems:"center",gap:2,children:[t(N,{className:"color-inherit",children:g(`gamecenter.${i.gameNameId}.description_title`)}),t("img",{src:Nt.interpolate(i.assetUrl)+i.gameNameId+"_logo.png"}),(e.hasUnlimitedGames||e.freeGamesLeft>0)&&t(z,{children:d(D,{skin:6,colour:s(),position:"relative",className:"px-4",onClick:o,children:[g("gamecenter.play_now"),!e.hasUnlimitedGames&&t(Do,{className:"me-n1 mt-n1",count:e.freeGamesLeft})]})}),t(N,{className:"w-50 color-inherit",center:!0,children:g(`gamecenter.${i.gameNameId}.description_content`)})]}),t(P,{className:"w-25"})]})},QL=()=>{const{queuedGame:i}=ys(),[e,s]=a.useState(0),[n,r]=a.useState(0),[o,l]=a.useState([]),c=()=>{B(new N_(-1))};if(W(NE,u=>{let h=u.getParser();h&&(l(h.habbos),r(h.queueMax),s(h.queueMin))}),!!i)return t(le,{title:g("gamecenter.matchmaking"),className:"game-center-queue",colour:L.quaternary_grey,children:d(R,{gap:1,column:!0,fullHeight:!0,overflow:"hidden",fullWidth:!0,children:[d(V,{fullHeight:!0,fullWidth:!0,justifyContent:"center",gap:2,alignItems:"center",children:[t("img",{src:Nt.interpolate(i.assetUrl)+i.gameNameId+"_logo.png"}),t(qe,{columnCount:4,columnMinHeight:50,columnMinWidth:50,className:"queue-grid mb-3",gap:1,children:n&&Array.from(Array(n),(u,h)=>{let m=o[h];return t(V,{colour:L.light_grey,className:"layout-grid-item overflow-hidden",position:"relative",center:!0,column:!1,children:m?t(z,{children:t(it,{figure:m.look,direction:3,className:"avatar-head",headOnly:!0,position:"absolute"})}):t(P,{className:"icon loading-icon"})},h)})}),t(N,{bold:!0,children:o&&o.length<e?g("gamecenter.matchmaking.waiting"):g("gamecenter.matchmaking.starting")})]}),t(D,{skin:2,onClick:c,className:"mx-auto",children:g("generic.cancel")})]})})},XL=()=>{const{isVisible:i,setIsVisible:e,games:s,accountStatus:n}=ys();return a.useEffect(()=>{const r=()=>{e(l=>!l)},o={linkReceived:l=>{switch(l.split("/")[1]){case"toggle":r();break}},eventUrlPrefix:"games/"};return dt(o),()=>ht(o)},[e]),d(z,{children:[i&&s&&t(R,{position:"absolute",className:"top-0 bottom-0 start-0 end-0 bg-black z-100",justifyContent:"center",children:d(R,{className:"game-center-main",column:!0,children:[t($L,{}),t(qL,{})]})}),t(KL,{}),t(QL,{}),t(zL,{}),d(R,{className:"game-center-scoreboard position-absolute z-200 start-0 top-0 m-2 h4",column:!0,gap:2,children:[t(WL,{}),t(YL,{})]}),t(jL,{})]})},JL=[0,1,2,3,4,5,6,7,8],ZL=i=>{const{badgeParts:e=[],setBadgeParts:s=null}=i,[n,r]=a.useState(-1),{groupCustomize:o=null}=xo(),l=(c,u,h)=>{const m=[...e];m[c][u]=h,s(m),u==="key"&&r(-1)};return!e||!e.length?null:d(z,{children:[n<0&&e&&e.length>0&&e.map((c,u)=>d(R,{alignItems:"center",justifyContent:"between",gap:2,className:"bg-muted px-2 py-1",children:[d(R,{pointer:!0,center:!0,className:"bg-muted p-1",onClick:h=>r(u),children:[e[u].code&&e[u].code.length>0&&t(ot,{badgeCode:e[u].code,isGroup:!0}),(!e[u].code||!e[u].code.length)&&t(R,{center:!0,className:"badge-image group-badge",children:t("div",{className:"badgeadd-image"})})]}),c.type!==Zt.BASE&&t(pe,{gap:1,columnCount:3,children:JL.map((h,m)=>t(P,{pointer:!0,className:`group-badge-position-swatch ${e[u].position===h?"active":""}`,onClick:p=>l(u,"position",h)},m))}),t(pe,{gap:1,columnCount:8,children:o.badgePartColors.length>0&&o.badgePartColors.map((h,m)=>t(P,{pointer:!0,className:`group-badge-color-swatch ${e[u].color===m+1?"active":""}`,style:{backgroundColor:"#"+h.color},onClick:p=>l(u,"color",m+1)},m))})]},u)),n>=0&&d(pe,{gap:1,columnCount:5,children:[e[n].type===Zt.SYMBOL&&t(v,{pointer:!0,center:!0,className:"bg-muted p-1",onClick:c=>l(n,"key",0),children:t(R,{center:!0,className:"badge-image group-badge",children:t(Gt,{icon:"times"})})}),(e[n].type===Zt.BASE?o.badgeBases:o.badgeSymbols).map((c,u)=>t(v,{pointer:!0,center:!0,className:"bg-muted p-1",onClick:h=>l(n,"key",c.id),children:t(ot,{badgeCode:Zt.getCode(e[n].type,c.id,e[n].color,4),isGroup:!0})},u))]})]})},mI=i=>{const{groupData:e=null,setGroupData:s=null,setCloseAction:n=null,skipDefault:r=null}=i,[o,l]=a.useState(null),{groupCustomize:c=null}=xo(),u=()=>{if(!o||!o.length)return"";let m="";return o.forEach(p=>p.code&&(m+=p.code)),m},h=a.useCallback(()=>{if(!e||!o||!o.length)return!1;if(e.groupBadgeParts===o)return!0;if(e.groupId<=0)return s(p=>{const E={...p};return E.groupBadgeParts=o,E}),!0;const m=[];return o.forEach(p=>{p.code&&(m.push(p.key),m.push(p.color),m.push(p.position))}),B(new zp(e.groupId,m)),!0},[e,o,s]);return a.useEffect(()=>{if(e.groupBadgeParts)return;const m=[new Zt(Zt.BASE,c.badgeBases[0].id,c.badgePartColors[0].id),new Zt(Zt.SYMBOL,0,c.badgePartColors[0].id),new Zt(Zt.SYMBOL,0,c.badgePartColors[0].id),new Zt(Zt.SYMBOL,0,c.badgePartColors[0].id),new Zt(Zt.SYMBOL,0,c.badgePartColors[0].id)];s(p=>({...p,groupBadgeParts:m}))},[e.groupBadgeParts,c,s]),a.useEffect(()=>{if(e.groupId<=0){l(e.groupBadgeParts?[...e.groupBadgeParts]:null);return}l(e.groupBadgeParts)},[e]),a.useEffect(()=>(n({action:h}),()=>n(null)),[n,h]),d(pe,{overflow:"hidden",gap:1,children:[t(v,{size:2,children:t(R,{center:!0,className:"bg-muted p-1",children:t(ot,{badgeCode:u(),isGroup:!0})})}),t(v,{size:10,overflow:"auto",children:t(ZL,{badgeParts:o,setBadgeParts:l})})]})},gI=i=>{const{groupData:e=null,setGroupData:s=null,setCloseAction:n=null}=i,[r,o]=a.useState(null),{groupCustomize:l=null}=xo(),c=m=>m===0?l.groupColorsA.find(p=>p.id===r[m]).color:l.groupColorsB.find(p=>p.id===r[m]).color,u=(m,p)=>{o(E=>{const _=[...E];return _[m]=p,_})},h=a.useCallback(()=>!e||!r||!r.length?!1:e.groupColors===r?!0:e.groupId<=0?(s(m=>{const p={...m};return p.groupColors=[...r],p}),!0):(B(new Kp(e.groupId,r[0],r[1])),!0),[e,r,s]);return a.useEffect(()=>{if(!l.groupColorsA||!l.groupColorsB||e.groupColors)return;const m=[l.groupColorsA[0].id,l.groupColorsB[0].id];s(p=>({...p,groupColors:m}))},[l,e.groupColors,s]),a.useEffect(()=>{if(e.groupId<=0){o(e.groupColors?[...e.groupColors]:null);return}o(e.groupColors)},[e]),a.useEffect(()=>(n({action:h}),()=>n(null)),[n,h]),r?d(pe,{overflow:"hidden",children:[d(v,{size:2,gap:1,children:[t(N,{bold:!0,children:g("group.edit.color.guild.color")}),e.groupColors&&e.groupColors.length>0&&d(R,{overflow:"hidden",className:"border",children:[t(P,{className:"group-color-swatch",style:{backgroundColor:"#"+c(0)}}),t(P,{className:"group-color-swatch",style:{backgroundColor:"#"+c(1)}})]})]}),d(v,{size:5,gap:1,overflow:"hidden",children:[t(N,{bold:!0,children:g("group.edit.color.primary.color")}),t(qe,{gap:1,columnCount:7,columnMinWidth:16,columnMinHeight:16,children:e.groupColors&&l.groupColorsA&&l.groupColorsA.map((m,p)=>t("div",{className:Vr("group-badge-color-swatch cursor-pointer",e.groupColors[0]===m.id&&"active"),style:{backgroundColor:"#"+m.color},onClick:()=>u(0,m.id)},p))})]}),d(v,{size:5,gap:1,overflow:"hidden",children:[t(N,{bold:!0,children:g("group.edit.color.secondary.color")}),t(qe,{gap:1,columnCount:7,columnMinWidth:16,columnMinHeight:16,children:e.groupColors&&l.groupColorsB&&l.groupColorsB.map((m,p)=>t("div",{className:Vr("group-badge-color-swatch cursor-pointer",e.groupColors[1]===m.id&&"active"),style:{backgroundColor:"#"+m.color},onClick:()=>u(1,m.id)},p))})]})]}):null},e0=i=>{const{groupData:e=null,setGroupData:s=null,purchaseCost:n=0}=i,{groupCustomize:r=null}=xo(),o=()=>{if(!e||!e.groupBadgeParts||!e.groupBadgeParts.length)return"";let c="";return e.groupBadgeParts.forEach(u=>u.code&&(c+=u.code)),c},l=c=>c===0?r.groupColorsA.find(u=>u.id===e.groupColors[c]).color:r.groupColorsB.find(u=>u.id===e.groupColors[c]).color;return e?d(pe,{overflow:"hidden",gap:1,children:[d(v,{size:3,children:[d(v,{center:!0,className:"bg-muted p-1",gap:2,children:[t(N,{center:!0,children:g("group.create.confirm.guildbadge")}),t(ot,{badgeCode:o(),isGroup:!0})]}),d(v,{center:!0,className:"bg-muted p-1",gap:2,children:[t(N,{center:!0,children:g("group.edit.color.guild.color")}),d(R,{overflow:"hidden",className:" border",children:[t(P,{className:"group-color-swatch",style:{backgroundColor:"#"+l(0)}}),t(P,{className:"group-color-swatch",style:{backgroundColor:"#"+l(1)}})]})]})]}),d(v,{size:9,justifyContent:"between",children:[d(v,{children:[d(v,{gap:1,children:[t(N,{children:e.groupName}),t(N,{children:e.groupDescription})]}),t(N,{overflow:"auto",children:g("group.create.confirm.info")})]}),t(N,{center:!0,variant:"white",className:"bg-primary p-1",children:g("group.create.confirm.buyinfo",["amount"],[n.toString()])})]})]}):null},pI=i=>{const{groupData:e=null,setGroupData:s=null,setCloseAction:n=null,onClose:r=null,isCreator:o=!1,availableRooms:l=[]}=i,[c,u]=a.useState(""),[h,m]=a.useState(""),[p,E]=a.useState(-1),{showConfirm:_=null}=Ke(),I=()=>{!e||e.groupId<=0||_(g("group.deleteconfirm.desc"),()=>{B(new Vp(e.groupId)),r&&r()},null,null,null,g("group.deleteconfirm.title"))},C=a.useCallback(()=>!e||!c||!c.length?!1:c===e.groupName&&h===e.groupDescription?!0:e.groupId<=0?p<=0?!1:(s(f=>{const S={...f};return S.groupName=c,S.groupDescription=h,S.groupHomeroomId=p,S}),!0):(B(new $p(e.groupId,c,h||"")),!0),[e,c,h,p,s]);return a.useEffect(()=>{u(e.groupName||""),m(e.groupDescription||""),E(e.groupHomeroomId)},[e]),a.useEffect(()=>(n({action:C}),()=>n(null)),[n,C]),e?d(v,{justifyContent:"between",overflow:"auto",children:[d(v,{gap:1,children:[d(R,{alignItems:"center",gap:1,children:[t(N,{center:!0,className:"col-3 volter-bold",children:g("group.edit.name")}),t(V,{skin:4,colour:L.lighter_grey,position:"relative",className:"ton-shop-search-input align-items-center text-white",fullWidth:!0,children:t("input",{type:"text",className:"ton-input",value:c,maxLength:29,onChange:f=>u(f.target.value)})})]}),d(R,{alignItems:"center",gap:1,children:[t(N,{center:!0,className:"col-3 volter-bold",children:g("group.edit.desc")}),t(V,{skin:4,colour:L.lighter_grey,position:"relative",className:"ton-shop-search-input align-items-center text-white",fullWidth:!0,children:t("textarea",{className:"ton-input",value:h,maxLength:254,onChange:f=>m(f.target.value)})})]}),o&&d(z,{children:[d(R,{alignItems:"center",gap:1,children:[t(N,{center:!0,className:"col-3 volter-bold",children:g("group.edit.base")}),t(v,{fullWidth:!0,gap:1,children:t(V,{skin:4,colour:L.lighter_grey,position:"relative",className:"ton-shop-search-input align-items-center text-white",fullWidth:!0,children:d("select",{className:"ton-input",value:p,onChange:f=>E(parseInt(f.target.value)),children:[t("option",{value:-1,disabled:!0,children:g("group.edit.base.select.room")}),l&&l.map((f,S)=>t("option",{value:f.id,children:f.name},S))]})})})]}),d(R,{gap:1,children:[t(P,{className:"col-3",children:" "}),t(N,{children:g("group.edit.base.warning")})]})]})]}),!o&&t(D,{onClick:I,children:g("group.delete")}),o&&t(N,{underline:!0,center:!0,fullWidth:!0,pointer:!0,onClick:f=>oe("navigator/create"),children:g("group.createroom")})]}):null},t0=[1,2,3,4],s0=i=>{const{onClose:e=null}=i,[s,n]=a.useState(1),[r,o]=a.useState(null),[l,c]=a.useState(null),[u,h]=a.useState(null),[m,p]=a.useState(0),E=()=>{o(null),c(null),e&&e()},_=()=>{if(!l)return;const f=[];l.groupBadgeParts.forEach(S=>{S.code&&(f.push(S.key),f.push(S.color),f.push(S.position))}),B(new qp(l.groupName,l.groupDescription,l.groupHomeroomId,l.groupColors[0],l.groupColors[1],f))},I=()=>{if(!(r&&r.action&&!r.action())){if(s===1){e();return}n(f=>f-1)}},C=()=>{if(!(r&&r.action&&!r.action())){if(s===4){_();return}n(f=>f===4?f:f+1)}};return W(Ch,f=>{const S=f.getParser(),T=[];S.availableRooms.forEach((b,y)=>T.push({id:y,name:b})),h(T),p(S.groupCost)}),a.useEffect(()=>{n(1),c({groupId:-1,groupName:null,groupDescription:null,groupHomeroomId:-1,groupState:1,groupCanMembersDecorate:!0,groupColors:null,groupBadgeParts:null}),B(new Wp)},[c]),l?t(le,{title:g("group.create.title"),className:"nitro-group-creator",onCloseClick:E,children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 w-100 overflow-auto",children:d(at,{children:[t(R,{center:!0,className:"creator-tabs",children:t0.map((f,S)=>t(R,{center:!0,className:`tab tab-${f===1?"blue-flat":f===4?"yellow":"blue-arrow"} ${s===f?"active":""}`,children:t(N,{variant:"white",children:g(`group.create.steplabel.${f}`)})},S))}),d(v,{overflow:"hidden",children:[d(R,{alignItems:"center",gap:2,children:[t(P,{className:`nitro-group-tab-image flex-shrink-0 tab-${s}`}),d(v,{grow:!0,gap:0,children:[t(N,{bold:!0,children:g(`group.create.stepcaption.${s}`)}),t(N,{children:g(`group.create.stepdesc.${s}`)})]})]}),d(v,{overflow:"hidden",children:[s===1&&t(pI,{groupData:l,setGroupData:c,setCloseAction:o,onClose:null,isCreator:!0,availableRooms:u}),s===2&&t(mI,{groupData:l,setGroupData:c,setCloseAction:o}),s===3&&t(gI,{groupData:l,setGroupData:c,setCloseAction:o}),s===4&&t(e0,{groupData:l,setGroupData:c,purchaseCost:m})]}),d(R,{justifyContent:"between",children:[t(D,{className:"text-black",onClick:I,children:g(s===1?"generic.cancel":"group.create.previousstep")}),t(D,{disabled:s===4&&!Nr(),onClick:C,children:g(s===4?Nr()?"group.create.confirm.buy":"group.create.confirm.viprequired":"group.create.nextstep")})]})]})]})})}):null},n0=["regular","exclusive","private"],fI=i=>{const{groupInformation:e=null,onClose:s=null,overflow:n="hidden",...r}=i,{showConfirm:o=null}=Ke(),l=e&&e.ownerName===J().userName,c=()=>e&&Ql(e.id),u=()=>{o(g("group.leaveconfirm.desc"),()=>{B(new Mi(e.id,J().userId)),s&&s()},null)},h=()=>e.membershipType===xt.NOT_MEMBER||e.membershipType===xt.REQUEST_PENDING?null:l?t("i",{className:"icon icon-group-owner",title:g("group.youareowner")}):e.isAdmin?t("i",{className:"icon icon-group-admin",title:g("group.youareadmin")}):t("i",{className:"icon icon-group-member",title:g("group.youaremember")}),m=()=>{if(l)return"group.youareowner";if(e.type===hs.PRIVATE&&e.membershipType!==xt.MEMBER)return"";if(e.membershipType===xt.MEMBER)return"group.leave";if(e.membershipType===xt.NOT_MEMBER&&e.type===hs.REGULAR)return"group.join";if(e.membershipType===xt.REQUEST_PENDING)return"group.membershippending";if(e.membershipType===xt.NOT_MEMBER&&e.type===hs.EXCLUSIVE)return"group.requestmembership"},p=()=>{if(!(e.type===hs.PRIVATE&&e.membershipType===xt.NOT_MEMBER)){if(e.membershipType===xt.MEMBER){u();return}c()}},E=_=>{switch(_){case"members":jc(e.id);break;case"members_pending":jc(e.id,2);break;case"manage":Q_(e.id);break;case"homeroom":Rs(e.roomId);break;case"furniture":oe("catalog/open/"+It.GUILD_CUSTOM_FURNI);break;case"popular_groups":oe("navigator/search/groups");break}};return e?d(V,{fullHeight:!0,colour:L.light_grey,overflow:n,...r,column:!1,gap:3,children:[d(v,{className:"flex-shrink-0",shrink:!1,overflow:"hidden",children:[t(R,{alignItems:"center",overflow:"hidden",className:"group-badge",children:t(ot,{badgeCode:e.badge,isGroup:!0,scale:2})}),d(v,{alignItems:"center",gap:1,children:[t(N,{underline:!0,pointer:!0,onClick:()=>E("members"),children:g("group.membercount",["totalMembers"],[e.membersCount.toString()])}),e.pendingRequestsCount>0&&t(N,{underline:!0,pointer:!0,onClick:()=>E("members_pending"),children:g("group.pendingmembercount",["amount"],[e.pendingRequestsCount.toString()])}),e.isOwner&&t(N,{underline:!0,pointer:!0,onClick:()=>E("manage"),children:g("group.manage")}),h()]})]}),d(v,{justifyContent:"between",overflow:"auto",children:[d(v,{overflow:"hidden",children:[d(v,{gap:1,children:[d(R,{alignItems:"center",gap:2,children:[t(N,{className:"volter-bold",children:e.title}),d(R,{gap:1,children:[t("i",{className:"icon icon-group-type-"+e.type,title:g(`group.edit.settings.type.${n0[e.type]}.help`)}),e.canMembersDecorate&&t("i",{className:"icon icon-group-decorate",title:g("group.memberscandecorate")})]})]}),t(N,{children:g("group.created",["date","owner"],[e.createdAt,e.ownerName])})]}),t(N,{overflow:"auto",className:"group-description",children:e.description})]}),d(v,{children:[d(v,{gap:1,children:[t(N,{underline:!0,pointer:!0,onClick:()=>E("homeroom"),children:g("group.linktobase")}),t(N,{underline:!0,pointer:!0,onClick:()=>E("furniture"),children:g("group.buyfurni")}),t(N,{underline:!0,pointer:!0,onClick:()=>E("popular_groups"),children:g("group.showgroups")})]}),(e.type!==hs.PRIVATE||e.type===hs.PRIVATE&&e.membershipType===xt.MEMBER)&&t(D,{disabled:e.membershipType===xt.REQUEST_PENDING||l,onClick:p,children:g(m())})]})]})]}):null},r0=i=>{const[e,s]=a.useState(null);return W(qr,n=>{const r=n.getParser();(e&&e.id===r.id||r.flag)&&s(r)}),e?t(le,{colour:L.secondary_grey,title:g("group.window.title"),className:"nitro-group-information-standalone",onCloseClick:n=>s(null),children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:t(fI,{groupInformation:e,onClose:()=>s(null)})})}):null},o0=["regular","exclusive","private"],i0=i=>{const{groupData:e=null,setGroupData:s=null,setCloseAction:n=null}=i,[r,o]=a.useState(e.groupState),[l,c]=a.useState(e.groupCanMembersDecorate),u=a.useCallback(()=>e?r===e.groupState&&l===e.groupCanMembersDecorate?!0:e.groupId<=0?(s(h=>{const m={...h};return m.groupState=r,m.groupCanMembersDecorate=l,m}),!0):(B(new Qp(e.groupId,r,l?0:1)),!0):!1,[e,r,l,s]);return a.useEffect(()=>{o(e.groupState),c(e.groupCanMembersDecorate)},[e]),a.useEffect(()=>(n({action:u}),()=>n(null)),[n,u]),d(v,{overflow:"auto",children:[t(v,{children:o0.map((h,m)=>d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"radio",name:"groupState",checked:r===m,onChange:p=>o(m)}),d(v,{gap:0,children:[d(R,{gap:1,children:[t("i",{className:`icon icon-group-type-${m}`}),t(N,{className:"p-1",bold:!0,children:g(`group.edit.settings.type.${h}.label`)})]}),t(N,{children:g(`group.edit.settings.type.${h}.help`)})]})]},m))}),t(AA,{}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input position-fixed",type:"checkbox",checked:l,onChange:h=>c(m=>!m)}),t(N,{className:"p-1 ms-4",bold:!0,children:g("group.edit.settings.rights.caption")}),t(N,{children:g("group.edit.settings.rights.members.help")})]})]})},a0=[1,2,3,5],l0=i=>{const[e,s]=a.useState(1),[n,r]=a.useState(null),[o,l]=a.useState(null),c=()=>{r(h=>(h&&h.action&&h.action(),null)),l(null)},u=h=>{n&&n.action&&n.action(),s(h)};return W(qr,h=>{const m=h.getParser();!o||o.groupId!==m.id||l(p=>{const E={...p};return E.groupName=m.title,E.groupDescription=m.description,E.groupState=m.type,E.groupCanMembersDecorate=m.canMembersDecorate,E})}),W(Th,h=>{const m=h.getParser(),p=[];m.badgeParts.forEach((E,_)=>{p.push(new la(E.isBase?la.BASE:la.SYMBOL,E.key,E.color,E.position))}),l({groupId:m.id,groupName:m.title,groupDescription:m.description,groupHomeroomId:m.roomId,groupState:m.state,groupCanMembersDecorate:m.canMembersDecorate,groupColors:[m.colorA,m.colorB],groupBadgeParts:p})}),!o||o.groupId<=0?null:d(le,{colour:L.maintenance_orange,title:g("group.window.title"),className:"nitro-group-manager",onCloseClick:c,children:[t(en,{children:a0.map(h=>t(Ns,{isActive:e===h,onClick:()=>u(h),children:g(`group.edit.tab.${h}`)},h))}),t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:d(at,{children:[d(R,{alignItems:"center",gap:2,children:[t(P,{className:`nitro-group-tab-image tab-${e}`}),d(v,{grow:!0,gap:0,children:[t(N,{className:"volter-bold",children:g(`group.edit.tabcaption.${e}`)}),t(N,{children:g(`group.edit.tabdesc.${e}`)})]})]}),d(v,{grow:!0,overflow:"hidden",children:[e===1&&t(pI,{groupData:o,setGroupData:l,setCloseAction:r,onClose:c}),e===2&&t(mI,{groupData:o,setGroupData:l,setCloseAction:r,skipDefault:!0}),e===3&&t(gI,{groupData:o,setGroupData:l,setCloseAction:r}),e===5&&t(i0,{groupData:o,setGroupData:l,setCloseAction:r})]})]})})]})},c0=i=>{const[e,s]=a.useState(-1),[n,r]=a.useState(-1),[o,l]=a.useState(null),[c,u]=a.useState(-1),[h,m]=a.useState(0),[p,E]=a.useState(""),[_,I]=a.useState(null),{showConfirm:C=null}=Ke(),f=w=>{if(w.rank===is.OWNER)return"group.members.owner";if(o.admin){if(w.rank===is.ADMIN)return"group.members.removerights";if(w.rank===is.MEMBER)return"group.members.giverights"}return""},S=a.useCallback(()=>{e===-1||n===-1||c===-1||B(new Wa(e,c,p,n))},[e,n,c,p]),T=w=>{!o.admin||w.rank===is.OWNER||(w.rank!==is.ADMIN?B(new xp(o.groupId,w.id)):B(new Gp(o.groupId,w.id)),S())},b=w=>{!o.admin||w.rank!==is.REQUESTED||(B(new Bp(o.groupId,w.id)),S())},y=w=>{if(o.admin){if(w.rank===is.REQUESTED){B(new Hp(o.groupId,w.id)),S();return}I(w.name),B(new Fp(o.groupId,w.id))}};return W(Ih,w=>{const O=w.getParser();l(O),r(O.level),m(Math.ceil(O.totalMembersCount/O.pageSize))}),W(Eh,w=>{const O=w.getParser();C(g(O.furnitureCount>0?"group.kickconfirm.desc":"group.kickconfirm_nofurni.desc",["user","amount"],[_,O.furnitureCount.toString()]),()=>{B(new Mi(o.groupId,O.userId)),S()},null),I(null)}),a.useEffect(()=>{const w={linkReceived:O=>{const F=O.split("/");if(F.length<2)return;const U=parseInt(F[1])||-1,j=parseInt(F[2])||3;s(U),r(j),u(0)},eventUrlPrefix:"group-members/"};return dt(w),()=>ht(w)},[]),a.useEffect(()=>{u(0)},[e,n,p]),a.useEffect(()=>{e===-1||n===-1||c===-1||B(new Wa(e,c,p,n))},[e,n,c,p]),a.useEffect(()=>{e!==-1&&(r(-1),l(null),m(0),E(""),I(null))},[e]),e===-1||!o?null:t(le,{colour:L.secondary_grey,title:g("group.members.title",["groupName"],[o?o.groupTitle:""]),className:"nitro-group-members",onCloseClick:w=>s(-1),children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:d(at,{overflow:"hidden",children:[d(R,{gap:2,children:[t(R,{center:!0,className:"group-badge",children:t(ot,{badgeCode:o.badge,isGroup:!0,className:"mx-auto d-block"})}),d(v,{fullWidth:!0,gap:1,children:[t(V,{skin:4,colour:L.primary_grey,position:"relative",className:"ton-shop-search-input align-items-center text-white",fullWidth:!0,children:t("input",{type:"text",className:"ton-input",placeholder:g("group.members.searchinfo"),value:p,onChange:w=>E(w.target.value)})}),d("select",{className:"ton-carat position-static w-100",value:n,onChange:w=>r(parseInt(w.target.value)),children:[t("option",{value:"0",children:g("group.members.search.all")}),t("option",{value:"1",children:g("group.members.search.admins")}),t("option",{value:"2",children:g("group.members.search.pending")})]})]})]}),t(pe,{columnCount:2,overflow:"auto",className:"nitro-group-members-list-grid",children:o.result.map((w,O)=>d(R,{gap:2,alignItems:"center",overflow:"hidden",className:"member-list-item bg-white p-2",children:[t("div",{className:"avatar-head cursor-pointer",onClick:()=>ps(w.id),children:t(it,{figure:w.figure,headOnly:!0,direction:2})}),d(v,{grow:!0,gap:1,children:[t(N,{bold:!0,pointer:!0,onClick:F=>ps(w.id),children:w.name}),w.rank!==is.REQUESTED&&t(N,{italics:!0,variant:"muted",children:g("group.members.since",["date"],[w.joinedAt])})]}),d(v,{gap:1,children:[w.rank!==is.REQUESTED&&t(R,{center:!0,children:t(P,{pointer:o.admin,className:`icon icon-group-small-${w.rank===is.OWNER?"owner":w.rank===is.ADMIN?"admin":o.admin&&w.rank===is.MEMBER?"not-admin":""}`,title:g(f(w)),onClick:F=>T(w)})}),o.admin&&w.rank===is.REQUESTED&&t(R,{alignItems:"center",children:t(P,{pointer:!0,className:"nitro-friends-spritesheet icon-accept",title:g("group.members.accept"),onClick:F=>b(w)})}),o.admin&&w.rank!==is.OWNER&&w.id!==J().userId&&t(R,{alignItems:"center",children:t(P,{pointer:!0,className:"nitro-friends-spritesheet icon-deny",title:g(w.rank===is.REQUESTED?"group.members.reject":"group.members.kick"),onClick:F=>y(w)})})]})]},O))}),d(R,{gap:1,justifyContent:"between",alignItems:"center",children:[t(D,{disabled:o.pageIndex===0,onClick:w=>u(O=>O-1),children:t(Gt,{icon:"chevron-left"})}),t(N,{small:!0,children:g("group.members.pageinfo",["amount","page","totalPages"],[o.totalMembersCount.toString(),(o.pageIndex+1).toString(),h.toString()])}),t(D,{disabled:o.pageIndex===h-1,onClick:w=>u(O=>O+1),children:t(Gt,{icon:"chevron-right"})})]})]})})})},u0=i=>{const[e,s]=a.useState(!1);return xo(),W(Nh,n=>{const r=n.getParser();s(!1),Rs(r.roomId)}),a.useEffect(()=>{const n={linkReceived:r=>{const o=r.split("/");if(!(o.length<2))switch(o[1]){case"create":s(!0);return;case"manage":if(!o[2])return;s(!1),B(new Yp(Number(o[2])));return}},eventUrlPrefix:"groups/"};return dt(n),()=>ht(n)},[]),d(z,{children:[e&&t(s0,{onClose:()=>s(!1)}),!e&&t(l0,{}),t(c0,{}),t(r0,{})]})},d0=()=>{const[i,e]=a.useState(!1),[s,n]=a.useState(g("guide.help.guide.tool.title")),[r,o]=a.useState(!1),[l,c]=a.useState(Ee.GUIDE_TOOL_MENU),[u,h]=a.useState(!1),[m,p]=a.useState(!1),[E,_]=a.useState(!1),[I,C]=a.useState(!0),[f,S]=a.useState(0),[T,b]=a.useState(0),[y,w]=a.useState(0),[O,F]=a.useState(""),[U,j]=a.useState(null),[x,M]=a.useState(0),[G,H]=a.useState(0),[Y,q]=a.useState(null),[Z,ce]=a.useState(null),[se,ye]=a.useState(!1),[me,lt]=a.useState([]);Ke();const ie=a.useCallback((Ie,ve)=>{switch(Ie){case Ee.GUIDE_TOOL_MENU:n(g("guide.help.guide.tool.title")),o(!1);break;case Ee.GUIDE_ACCEPT:n(g("guide.help.request.guide.accept.title")),o(!0),Fs("guide_help_requested");break;case Ee.GUIDE_ONGOING:n(g("guide.help.request.guide.ongoing.title",["name"],[ve])),o(!0);break;case Ee.USER_CREATE:n(g("guide.help.request.user.create.title")),o(!1);break;case Ee.USER_PENDING:n(g("guide.help.request.user.pending.title")),o(!0);break;case Ee.USER_ONGOING:n(g("guide.help.request.user.ongoing.title",["name"],[ve])),o(!0);break;case Ee.USER_FEEDBACK:n(g("guide.help.request.user.feedback.title")),o(!1);break;case Ee.USER_THANKS:n(g("guide.help.request.user.thanks.title")),o(!1);break;case Ee.USER_NO_HELPERS:n(g("guide.help.request.no_tour_guides.heading")),o(!1);break;case Ee.USER_SOMETHING_WRONG:n(g("guide.help.request.user.guide.disconnected.error.heading")),o(!1);break}c(Ie),e(!0)},[]),He=a.useCallback(Ie=>{switch(Ie.type){case Xt.SHOW_GUIDE_TOOL:e(!0);return;case Xt.HIDE_GUIDE_TOOL:e(!1);return;case Xt.TOGGLE_GUIDE_TOOL:e(ve=>!ve);return;case Xt.CREATE_HELP_REQUEST:ie(Ee.USER_CREATE);return}},[ie]);ct(Xt.SHOW_GUIDE_TOOL,He),ct(Xt.HIDE_GUIDE_TOOL,He),ct(Xt.TOGGLE_GUIDE_TOOL,He),ct(Xt.CREATE_HELP_REQUEST,He),W(Sl,Ie=>{!Ie.getParser().isAllowed(k_.USE_GUIDE_TOOL)&&u&&(h(!1),B(new di(!1,!1,!1,!1)))}),W(Ah,Ie=>{const ve=Ie.getParser();h(ve.onDuty),b(ve.guidesOnDuty),S(ve.helpersOnDuty),w(ve.guardiansOnDuty)}),W(kh,Ie=>{const ve=Ie.getParser();j(ve.helpRequestDescription),M(ve.roleSpecificWaitTime),ve.asGuide&&u&&ie(Ee.GUIDE_ACCEPT),ve.asGuide||ie(Ee.USER_PENDING)}),W(xh,Ie=>{const ve=Ie.getParser();u?(H(ve.requesterUserId),q(ve.requesterName),ce(ve.requesterFigure),ie(Ee.GUIDE_ONGOING,ve.requesterName)):(H(ve.guideUserId),q(ve.guideName),ce(ve.guideFigure),ie(Ee.USER_ONGOING,ve.guideName))}),W(Dh,Ie=>{const ve=Ie.getParser();ye(ve.isTyping)}),W(Ph,Ie=>{const ve=Ie.getParser(),St=[...me];let Bt=St[St.length-1];(!Bt||Bt.userId!==ve.senderId)&&(Bt=new Yc(ve.senderId),St.push(Bt)),Bt.addChat(new qc(ve.chatMessage)),lt(St)}),W(fl,Ie=>{const ve=Ie.getParser(),St=[...me];let Bt=St[St.length-1];const Es=u?J().userId:G;(!Bt||Bt.userId!==Es)&&(Bt=new Yc(Es),St.push(Bt)),Bt.addChat(new qc(ve.roomName,ve.roomId)),lt(St)}),W(Uh,Ie=>{u?(H(0),q(null),ce(null),ye(!1),lt([]),ie(Ee.GUIDE_TOOL_MENU)):ie(Ee.USER_FEEDBACK)}),W(Lh,Ie=>{switch(Ie.getParser().errorCode){case 0:ie(Ee.USER_SOMETHING_WRONG);break;case 1:case 2:ie(Ee.USER_NO_HELPERS);break}}),W(Mh,Ie=>{H(0),q(null),ce(null),ye(!1),lt([]),ie(u?Ee.GUIDE_TOOL_MENU:Ee.USER_THANKS)}),a.useEffect(()=>{const Ie={linkReceived:ve=>{const St=ve.split("/");if(!(St.length<2))switch(St[1]){case"tour":return}},eventUrlPrefix:"help/"};return dt(Ie),B(new di(!1,!1,!1,!1)),()=>ht(Ie)},[]);const ft=a.useCallback(Ie=>{switch(Ie){case"close":H(0),q(null),ce(null),ye(!1),lt([]),e(!1),F(""),c(Ee.GUIDE_TOOL_MENU);return;case"toggle_duty":h(St=>(B(new di(!St,St?!1:E,St?!1:I,St?!1:m)),!St));return;case"forum_link":const ve=ee("group.homepage.url","").replace("%groupid%",ee("guide.help.alpha.groupid","0"));window.open(ve);return}},[m,E,I]);return{isOnDuty:u,isHandlingGuideRequests:E,setIsHandlingGuideRequests:_,isHandlingHelpRequests:I,setIsHandlingHelpRequests:C,isHandlingBullyReports:m,setIsHandlingBullyReports:p,guidesOnDuty:T,helpersOnDuty:f,guardiansOnDuty:y,sessionState:l,helpRequestDescription:U,headerText:s,helpRequestAverageTime:x,ongoingUserId:G,ongoingUsername:Y,ongoingFigure:Z,ongoingIsTyping:se,ongoingMessageGroups:me,userRequest:O,setUserRequest:F,processAction:ft,isVisible:i,noCloseButton:r}},gc=()=>Qe(d0),h0=i=>{const{helpRequestDescription:e=null,helpRequestAverageTime:s=0}=i,n=r=>B(new kp(r));return d(V,{gap:2,className:"text-black",children:[d(v,{gap:0,className:"bg-muted p-2",children:[t(N,{bold:!0,children:g("guide.help.request.guide.accept.request.title")}),t(N,{variant:"muted",children:g("guide.help.request.type.1")}),t(N,{wrap:!0,textBreak:!0,children:e})]}),d(v,{gap:1,children:[t(D,{onClick:r=>n(!0),children:g("guide.help.request.guide.accept.accept.button")}),t(D,{onClick:r=>n(!1),children:g("guide.help.request.guide.accept.skip.link")})]})]})},m0=i=>{const{isOnDuty:e=!1,helpersOnDuty:s=0,processAction:n=null,isVisible:r}=gc();return d(V,{gap:2,className:"text-black",children:[d(V,{colour:L.light_grey,column:!1,gap:1,alignItems:"center",children:[t(P,{className:"duty-switch"+(e?"":" off"),onClick:o=>n("toggle_duty")}),d(v,{gap:1,children:[t(N,{bold:!0,children:g("guide.help.guide.tool.yourstatus")}),t(N,{children:g(`guide.help.guide.tool.duty.${e?"on":"off"}`)})]})]}),t("hr",{className:"bg-dark m-0"}),d(R,{center:!0,gap:2,children:[t(P,{className:"info-icon"}),t(v,{gap:1,children:t(P,{dangerouslySetInnerHTML:{__html:g("guide.help.guide.tool.helpersonduty",["amount"],[s.toString()])}})})]})]})},g0=i=>{const e=a.useRef(null),{isGuide:s=!1,userId:n=0,userName:r=null,userFigure:o=null,isTyping:l=!1,messageGroups:c=[]}=i,[u,h]=a.useState(""),[m,p]=a.useState(-1);a.useEffect(()=>{var T;(T=e.current)==null||T.scrollIntoView({block:"end",behavior:"smooth"})},[c]);const E=a.useCallback(()=>{B(new Ap)},[]),_=a.useCallback(()=>{B(new Mp)},[]),I=a.useCallback(()=>{B(new Dp)},[]);W(Fh,T=>{const b=T.getParser();Rs(b.requesterRoomId)}),W(fl,T=>{const b=T.getParser();p(b.roomId)});const C=a.useCallback(()=>{!u||!u.length||(B(new Lp(u)),h(""))},[u]),f=a.useCallback(T=>{T.key==="Enter"&&C()},[C]),S=a.useCallback(T=>T===J().userId,[]);return a.useEffect(()=>{B(new Up(u.length>0))},[u]),d(v,{fullHeight:!0,overflow:"hidden",children:[t(V,{skin:4,colour:L.catalog_search_blue,className:"chat-messages p-2 pb-4",overflow:"hidden",children:d(v,{overflow:"auto",children:[c.map((T,b)=>d(R,{fullWidth:!0,justifyContent:S(T.userId)?"end":"start",gap:2,children:[!S(T.userId)&&t(P,{shrink:!0,className:"message-avatar",children:t(it,{headOnly:!0,figure:o,direction:2})}),d(V,{skin:4,fullWidth:!0,className:"text-black border-radius mb-2 p-2 messages-group-"+(S(T.userId)?"right":"left"),children:[d(N,{bold:!0,children:[S(T.userId)&&J().userName,!S(T.userId)&&r]}),T.messages.map((y,w)=>y.roomId>0?d(N,{variant:"success",underline:!0,className:"volter-bold",pointer:!0,onClick:O=>Rs(y.roomId),children:[g("guide.help.request.guide.ongoing.visit.button")," ",y.message]},w):t(P,{className:"text-break",children:y.message},w))]}),S(T.userId)&&t(P,{className:"message-avatar flex-shrink-0",children:t(it,{headOnly:!0,figure:J().figure,direction:4})})]},b)),t("div",{ref:e})]})}),d(V,{className:"mt-n4",gap:2,children:[l&&t(N,{variant:"muted",children:g("guide.help.common.typing")}),d(R,{gap:1,alignItems:"center",children:[t("input",{type:"text",className:"ton-input black-border",placeholder:g("guide.help.request.guide.ongoing.input.empty",["name"],[r]),value:u,onChange:T=>h(T.target.value),onKeyDown:f}),t(D,{skin:6,colour:L.primary_green,onClick:C,children:g("widgets.chatinput.say")})]}),d(R,{justifyContent:"between",gap:1,children:[s&&d(z,{children:[t(D,{skin:5,onClick:E,children:g("guide.help.request.guide.ongoing.visit.button")}),t(D,{skin:5,onClick:_,children:g("guide.help.request.guide.ongoing.invite.button")})]}),t(D,{skin:5,fullWidth:!0,onClick:I,children:g("guide.help.request."+(s?"guide":"user")+".ongoing.close.link")})]})]})]})},p0=15,f0=i=>{const{userRequest:e="",setUserRequest:s=null}=i,[n,r]=a.useState(!1),o=()=>{r(!0),B(new wp(1,e))};return d(V,{gap:2,className:"text-black",children:[t(N,{children:g("guide.help.request.user.create.help")}),t("textarea",{className:"request-message",maxLength:140,value:e,onChange:l=>s(l.target.value),placeholder:g("guide.help.request.user.create.input.help")}),t(D,{fullWidth:!0,disabled:e.length<p0||n,onClick:o,children:g("guide.help.request.user.create.input.button")})]})},_0=i=>{const{userName:e=null}=i,s=n=>B(new yp(n));return d(V,{gap:2,className:"text-black",children:[d(R,{justifyContent:"between",gap:1,className:"bg-muted p-2",children:[d(v,{gap:0,children:[t(N,{bold:!0,children:e}),t(N,{children:g("guide.help.request.user.feedback.guide.desc")})]}),t(D,{disabled:!0,children:g("guide.help.common.report.link")})]}),d(v,{gap:1,children:[t(N,{bold:!0,children:g("guide.help.request.user.feedback.closed.title")}),t(N,{children:g("guide.help.request.user.feedback.closed.desc")})]}),e&&e.length>0&&d(z,{children:[t("hr",{className:"bg-dark m-0 mt-auto"}),d(v,{children:[t(N,{center:!0,bold:!0,children:g("guide.help.request.user.feedback.question")}),d(R,{gap:1,children:[t(D,{fullWidth:!0,onClick:n=>s(!0),children:g("guide.help.request.user.feedback.positive.button")}),t(D,{fullWidth:!0,onClick:n=>s(!1),children:g("guide.help.request.user.feedback.negative.button")})]})]})]})]})},E0=i=>d(V,{gap:2,className:"text-black",children:[t(N,{bold:!0,children:g("guide.help.request.no_tour_guides.title")}),t(N,{children:g("guide.help.request.no_tour_guides.message")})]}),I0=i=>{const{helpRequestDescription:e=null,helpRequestAverageTime:s=0}=i,n=()=>B(new Pp);return d(V,{gap:2,className:"text-black",children:[d(V,{colour:L.light_grey,gap:0,className:"p-2",children:[t(N,{bold:!0,children:g("guide.help.request.guide.accept.request.title")}),t(N,{variant:"muted",children:g("guide.help.request.type.1")}),t(N,{wrap:!0,textBreak:!0,children:e})]}),d(v,{gap:1,children:[t(N,{bold:!0,children:g("guide.help.request.user.pending.info.title")}),t(N,{children:g("guide.help.request.user.pending.info.message")}),t(N,{children:g("guide.help.request.user.pending.info.waiting",["waitingtime"],[s.toString()])})]}),t(D,{skin:5,onClick:n,children:g("guide.help.request.user.pending.cancel.button")})]})},C0=i=>t(V,{gap:2,className:"text-black",children:t(N,{children:g("guide.help.request.user.guide.disconnected.error.desc")})}),S0=i=>d(V,{gap:2,className:"text-black",children:[t(N,{bold:!0,children:g("guide.help.request.user.thanks.info.title")}),t(N,{children:g("guide.help.request.user.thanks.info.desc")})]}),T0=i=>{const{isOnDuty:e,isHandlingGuideRequests:s,setIsHandlingGuideRequests:n,isHandlingHelpRequests:r,setIsHandlingHelpRequests:o,isHandlingBullyReports:l,setIsHandlingBullyReports:c,guidesOnDuty:u,helpersOnDuty:h,guardiansOnDuty:m,sessionState:p,helpRequestDescription:E,headerText:_,helpRequestAverageTime:I,ongoingUserId:C,ongoingUsername:f,ongoingFigure:S,ongoingIsTyping:T,ongoingMessageGroups:b,userRequest:y,setUserRequest:w,processAction:O,isVisible:F,noCloseButton:U}=gc();return F?d(le,{title:_,className:"nitro-guide-tool",onCloseClick:j=>O("close"),closeable:!U,children:[p===Ee.GUIDE_TOOL_MENU&&t(m0,{isOnDuty:e,isHandlingGuideRequests:s,setIsHandlingGuideRequests:n,isHandlingHelpRequests:r,setIsHandlingHelpRequests:o,isHandlingBullyReports:l,setIsHandlingBullyReports:c,guidesOnDuty:u,helpersOnDuty:h,guardiansOnDuty:m,processAction:O}),p===Ee.GUIDE_ACCEPT&&t(h0,{helpRequestDescription:E,helpRequestAverageTime:I}),[Ee.GUIDE_ONGOING,Ee.USER_ONGOING].includes(p)&&t(g0,{isGuide:e,userId:C,userName:f,userFigure:S,isTyping:T,messageGroups:b}),p===Ee.USER_CREATE&&t(f0,{userRequest:y,setUserRequest:w}),p===Ee.USER_PENDING&&t(I0,{helpRequestDescription:E,helpRequestAverageTime:I}),p===Ee.USER_FEEDBACK&&t(_0,{userName:f}),p===Ee.USER_THANKS&&t(S0,{}),p===Ee.USER_NO_HELPERS&&t(E0,{}),p===Ee.USER_SOMETHING_WRONG&&t(C0,{})]}):null},N0=i=>{const[e,s]=a.useState(!1),[n,r]=a.useState(null),[o,l]=a.useState(0),[c,u]=a.useState(null);dn();const{purse:h=null,clubStatus:m=null}=An(),{badgeCodes:p=[],activate:E=null,deactivate:_=null}=Yi();a.useRef();const I=()=>h.clubDays<=0?g("purse.clubdays.zero.amount.text"):h.minutesUntilExpiration>-1&&h.minutesUntilExpiration<60*24?Xs.shortFormat(h.minutesUntilExpiration*60):Xs.shortFormat((h.clubPeriods*31+h.clubDays)*86400),C=()=>{switch(m){case Ks.ACTIVE:return g(`hccenter.status.${m}.info`,["timeleft","joindate","streakduration"],[I(),n.firstSubscriptionDate,Xs.shortFormat(n.currentHcStreak*86400)]);case Ks.EXPIRED:return g(`hccenter.status.${m}.info`,["joindate"],[n.firstSubscriptionDate]);default:return g(`hccenter.status.${m}.info`)}},f=()=>n.timeUntilPayday<60?g("hccenter.special.time.soon"):Xs.shortFormat(n.timeUntilPayday*60),S=()=>g("hccenter.special.sum",["credits"],[(n.creditRewardForStreakBonus+n.creditRewardForMonthlySpent).toString()]);W(ml,y=>{const w=y.getParser();l(w.giftsAvailable)}),W(yg,y=>{const w=y.getParser();r(w.data)}),a.useEffect(()=>{const y={linkReceived:w=>{const O=w.split("/");if(!(O.length<2))switch(O[1]){case"open":if(O.length>2)switch(O[2]){case"hccenter":s(!e);break}return}},eventUrlPrefix:"habboUI/"};return dt(y),()=>ht(y)},[e]),a.useEffect(()=>{u(aA(p))},[p]),a.useEffect(()=>{if(!e)return;const y=E();return()=>_(y)},[e,E,_]),a.useEffect(()=>{B(new vl),B(new Wf)},[]);const T=a.useMemo(()=>{let y=document.getElementById("purse-view"),w=document.getElementById("notifications-confirms");return!y||!y||!e?{x:0,y:0}:{x:-(y.offsetWidth+7),y:w.offsetHeight}},[e]);if(!e)return null;const b=t(kr,{id:"popover-basic",children:t(V,{skin:4,colour:L.lighter_grey,children:d(kr.Body,{className:"text-black py-2 px-3",children:[t(N,{className:"volter-bold",children:g("hccenter.breakdown.title")}),t("div",{children:g("hccenter.breakdown.creditsspent",["credits"],[n.totalCreditsSpent.toString()])}),t("div",{children:g("hccenter.breakdown.paydayfactor.percent",["percent"],[(n.kickbackPercentage*100).toString()])}),t("div",{children:g("hccenter.breakdown.streakbonus",["credits"],[n.creditRewardForStreakBonus.toString()])}),t("hr",{className:"w-100 text-black my-1"}),t("div",{children:g("hccenter.breakdown.total",["credits","actual"],[S(),((n.kickbackPercentage*n.totalCreditsSpent+n.creditRewardForStreakBonus)*100/100).toString()])}),t("div",{className:"btn btn-link text-primary p-0",onClick:()=>oe("habbopages/"+ee("hc.center")["payday.habbopage"]),children:g("hccenter.special.infolink")})]})})});return d(le,{title:g("generic.hccenter"),onCloseClick:()=>s(!1),className:"nitro-hc-center",colour:L.quaternary_grey,windowPosition:tt.TOP_RIGHT,offsetLeft:T.x,offsetTop:T.y,children:[d(R,{fullWidth:!0,gap:1,children:[t(V,{fullWidth:!0,className:"d-flex align-items-center",children:d(P,{children:[t(P,{className:"hc-logo mb-1"}),t(D,{skin:6,colour:L.primary_green,onClick:y=>oe("catalog/open/"+ee("catalog.links")["hc.buy_hc"]),children:g(m===Ks.ACTIVE?"hccenter.btn.extend":"hccenter.btn.buy")})]})}),t(V,{fullWidth:!0,children:d(R,{gap:2,fullWidth:!0,children:[t(ot,{badgeCode:c,className:"align-self-center flex-shrink-0 me-1"}),d(v,{className:"streak-info",gap:0,children:[t(N,{children:g("hccenter.status."+m)}),t(N,{dangerouslySetInnerHTML:{__html:C()}})]})]})})]}),ee("hc.center")["gift.info"]&&d(V,{skin:4,fullWidth:!0,colour:L.primary_green,className:"d-flex flex-row giftInfo mt-1 px-1",children:[d("div",{children:[t("h4",{className:"mb-1",children:g("hccenter.gift.title")}),t("div",{dangerouslySetInnerHTML:{__html:o>0?g("hccenter.unclaimedgifts",["unclaimedgifts"],[o.toString()]):g("hccenter.gift.info")}})]}),t(D,{skin:5,onClick:()=>oe("catalog/open/"+ee("catalog.links")["hc.hc_gifts"]),className:"text-black ms-auto align-self-center",children:g(m===Ks.ACTIVE?"hccenter.btn.gifts.redeem":"hccenter.btn.gifts.view")})]}),ee("hc.center")["payday.info"]&&d(R,{gap:1,className:"mt-1",children:[d(V,{colour:L.catalog_search_blue,className:"payday-special mb-1 p-2",skin:4,children:[t("h4",{className:"mb-1",children:g("hccenter.special.title")}),t("div",{children:g("hccenter.special.info")}),t("div",{className:"btn btn-link text-white p-0 mt-auto align-self-baseline",onClick:()=>oe("habbopages/"+ee("hc.center")["payday.habbopage"]),children:g("hccenter.special.infolink")})]}),d("div",{className:"payday flex-shrink-0 p-2",children:[t("h5",{className:"mb-2 ms-2",children:g("hccenter.special.time.title")}),d("div",{className:"d-flex flex-row mb-4",children:[t("div",{className:"clock me-2"}),t("h6",{className:"mb-0 align-self-center",children:f()})]}),m===Ks.ACTIVE&&d("div",{className:"pe-3 mt-n2",children:[t("h5",{className:"ms-2 mb-1 bolder",children:g("hccenter.special.amount.title")}),d("div",{className:"d-flex flex-column",children:[t("div",{className:"w-100 text-center ms-4n",children:S()}),t(xI,{trigger:["hover","focus"],placement:"left",overlay:b,children:t("div",{className:"btn btn-link align-self-end text-primary",children:g("hccenter.breakdown.infolink")})})]})]})]})]}),ee("hc.center")["benefits.info"]&&t(V,{skin:4,colour:L.tertiary_grey,className:"px-2",children:d("div",{className:"benefits text-white py-2",children:[t("div",{className:"volter-bold text-white",children:g("hccenter.general.title")}),t("div",{className:"mb-2",dangerouslySetInnerHTML:{__html:g("hccenter.general.info")}}),t("button",{className:"btn btn-link p-0 text-white",onClick:()=>oe("habbopages/"+ee("hc.center")["benefits.habbopage"]),children:g("hccenter.general.infolink")})]})})]})},R0=i=>{const[e,s]=a.useState(""),{activeReport:n=null,setActiveReport:r=null}=un(),o=()=>{e.length<15||r(c=>{const u=Wt.REPORT_SUMMARY;return{...c,message:e,currentStep:u}})},l=()=>{r(c=>({...c,currentStep:c.currentStep-1}))};return d(z,{children:[d(v,{gap:1,children:[t(N,{className:"volter-bold",children:g("help.emergency.chat_report.subtitle")}),t(N,{children:g("help.cfh.input.text")})]}),t("textarea",{className:"form-control h-100",value:e,onChange:c=>s(c.target.value)}),d(R,{gap:2,justifyContent:"between",children:[t(D,{disabled:!(n.reportType===rt.BULLY||n.reportType===rt.EMERGENCY),onClick:l,children:g("generic.back")}),t(D,{disabled:e.length<15,onClick:o,children:g("help.emergency.main.submit.button")})]})]})},v0=i=>{const{setActiveReport:e=null}=un(),{isVisible:s}=gc(),n=()=>{e(r=>{const o=Wt.SELECT_USER,l=rt.BULLY;return{...r,currentStep:o,reportType:l}})};return d(z,{children:[d(v,{gap:1,children:[t(N,{className:"volter-bold",children:g("help.main.frame.title")}),t(N,{children:g("help.main.self.description")})]}),d(v,{gap:2,fullHeight:!0,children:[d(V,{skin:4,colour:L.primary_blue,opacity:127,className:"p-2 px-3 d-flex flex-column gap-1",children:[g("help.button.report.user"),t(D,{skin:6,colour:L.primary_red,onClick:n,children:g("help.main.bully.subtitle")})]}),d(V,{skin:4,colour:L.primary_yellow,opacity:50,className:"p-2 px-3 d-flex flex-column gap-1",children:[g("help.cfh.button.send"),t(D,{skin:6,colour:L.primary_blue,onClick:()=>At(new Xt(Xt.CREATE_HELP_REQUEST)),disabled:s,children:g("help.main.help.title")})]}),d(R,{gap:2,children:[t(D,{skin:5,fullWidth:!0,onClick:r=>oe("nux/tutorial"),children:g("tutorial.title")}),d(D,{skin:5,fullWidth:!0,onClick:r=>oe("habbopages/"+ee("habbopages").hive_way),children:[g("help.main.habboway.button")," "]})]}),t(D,{skin:5,onClick:()=>B(new yl(!1)),children:g("help.main.my.sanction.status")})]})]})},b0=i=>{const{username:e="",onAction:s=null}=i,[n,r]=a.useState(!1),o=()=>{n||(r(!0),B(new Hg(e)))};return W(Ng,l=>{const c=l.getParser();c&&c.webId===J().userId&&s("close")}),d("div",{className:"d-flex flex-column gap-4 h-100",children:[t("div",{className:"bg-muted p-2 text-center",children:g("tutorial.name_change.info.confirm")}),d("div",{className:"d-flex flex-column align-items-center gap-1 h-100",children:[t("div",{children:g("tutorial.name_change.confirm")}),t("div",{className:"volter-bold",children:e})]}),d("div",{className:"d-flex gap-2",children:[t(D,{className:"w-100",skin:1,disabled:n,onClick:o,children:g("generic.ok")}),t(D,{className:"w-100",onClick:()=>s("close"),children:g("cancel")})]})]})},O0=0,w0=2,y0=3,A0=4,k0=5,M0=6,U0=i=>{const{onAction:e=null}=i,[s,n]=a.useState(""),[r,o]=a.useState(!1),[l,c]=a.useState(!1),[u,h]=a.useState(null),[m,p]=a.useState([]),E=()=>{s!==""&&(o(!1),p([]),h(null),c(!0),B(new Vg(s)))},_=I=>{o(!1),p([]),h(null),n(I)};return W(kd,I=>{c(!1);const C=I.getParser();if(C)switch(C.resultCode){case O0:o(!0);break;case w0:h("short");break;case y0:h("long");break;case A0:h("invalid");break;case k0:p(C.nameSuggestions),h("taken");break;case M0:h("change_not_allowed")}}),d("div",{className:"d-flex flex-column gap-2 h-100",children:[t("div",{children:g("tutorial.name_change.info.select")}),t(V,{colour:L.white,skin:4,position:"relative",children:t("input",{type:"text",className:"ton-input",value:s,onChange:I=>_(I.target.value)})}),t(D,{skin:4,onClick:E,children:g("tutorial.name_change.check")}),!u&&!r&&t("div",{className:"bg-muted p-2 text-center",children:g("help.tutorial.name.info")}),u&&t("div",{className:"bg-danger p-2 text-center text-white",children:g(`help.tutorial.name.${u}`,["name"],[s])}),r&&t("div",{className:"bg-success p-2 text-center text-white",children:g("help.tutorial.name.available",["name"],[s])}),m&&t("div",{className:"d-flex flex-column gap-2",children:m.map((I,C)=>t("div",{className:"col bg-muted p-1 cursor-pointer",onClick:()=>_(I),children:I},C))}),d("div",{className:"d-flex gap-2",children:[t(D,{disabled:!r,skin:1,className:"w-100",onClick:()=>e("confirmation",s),children:g("tutorial.name_change.pick")}),t(D,{className:"w-100",onClick:()=>e("close"),children:g("cancel")})]})]})},ri="INIT",Su="INPUT",Sa="CONFIRMATION",L0=i=>{const[e,s]=a.useState(!1),[n,r]=a.useState(ri),[o,l]=a.useState(""),c=(h,m)=>{switch(h){case"start":r(Su);break;case"confirmation":l(m),r(Sa);break;case"close":l(""),s(!1);break}},u=a.useMemo(()=>{switch(n){case ri:return"tutorial.name_change.title.main";case Su:return"tutorial.name_change.title.select";case Sa:return"tutorial.name_change.title.confirm"}},[n]);return ct(Oi.INIT,h=>{r(ri),s(!0)}),e?t(le,{title:g(u),className:"nitro-change-username",onCloseClick:()=>c("close"),children:t(V,{skin:2,className:"overflow-auto",colour:L.white,position:"relative",children:d(at,{className:"text-black p-2",children:[n===ri&&t(U0,{onAction:c}),n===Sa&&t(b0,{username:o,onAction:c})]})})}):null},P0=i=>{const{activeReport:e=null,setActiveReport:s=null}=un(),n=()=>{const r=[];switch(e.reportType){case rt.BULLY:case rt.EMERGENCY:case rt.ROOM:{const o=e.roomId<=0?e.reportedChats[0].roomId:e.roomId;e.reportedChats.forEach(l=>r.push(l.webId,l.message)),B(new vp(e.message,e.cfhTopic,e.reportedUserId,o,r));break}case rt.IM:e.reportedChats.forEach(o=>r.push(o.webId,o.message)),B(new Np(e.message,e.cfhTopic,e.reportedUserId,r));break;case rt.THREAD:B(new Tp(e.groupId,e.threadId,e.cfhTopic,e.message));break;case rt.MESSAGE:B(new Sp(e.groupId,e.threadId,e.messageId,e.cfhTopic,e.message));break;case rt.PHOTO:B(new Rp(e.extraData,e.cfhTopic,e.roomId,J().userId,e.roomObjectId));break}s(null)};return d(z,{children:[d(v,{gap:1,children:[t(N,{className:"volter-bold",children:g("help.cfh.button.send")}),t(N,{children:g("help.main.summary")})]}),t(D,{onClick:n,children:g("guide.help.request.emergency.submit.button")})]})},D0=i=>{const{sanctionInfo:e=null,setSanctionInfo:s=null}=un(),n=(r,o,l)=>{let c=`help.sanction.${r}`;switch(o){case"ALERT":c=c+".alert";break;case"MUTE":c=c+".mute";break;case"BAN_PERMANENT":c=c+".permban";break;default:if(c=c+".ban",l>24)return c=c+".days",g(c,["days"],[(l/24).toString()])}return g(c,["hours"],[l.toString()])};return e?t(le,{title:g("help.sanction.info.title"),onCloseClick:()=>s(null),className:"nitro-cfh-sanction-status",children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:d(pe,{children:[t(v,{center:!0,size:5,overflow:"hidden",children:t(P,{className:"index-image"})}),d(v,{justifyContent:"between",size:7,overflow:"hidden",children:[e.sanctionReason==="cfh.reason.EMPTY"?t("div",{className:"col-12 volter-bold",children:g("help.sanction.current.none")}):d(z,{children:[(e.probationHoursLeft>0||e.isSanctionActive)&&t("div",{className:"col-12 volter-bold",children:g("help.sanction.probation.reminder")}),d("div",{className:`col-12 volter-bold ${e.isSanctionNew?"text-danger":""}`,children:[g("help.sanction.last.sanction")," ",n("current",e.sanctionName,e.sanctionLengthHours)]}),d("div",{className:"col-12",children:[g("generic.start.time")," ",e.sanctionCreationTime]}),d("div",{className:"col-12",children:[g("generic.reason")," ",e.sanctionReason]}),d("div",{className:"col-12",children:[g("help.sanction.probation.days.left")," ",Math.trunc(e.probationHoursLeft/24)+1]})]}),e.hasCustomMute&&!e.isSanctionActive&&t("div",{className:"col-12 volter-bold",children:g("help.sanction.custom.mute")}),e.tradeLockExpiryTime&&e.tradeLockExpiryTime.length>0&&d("div",{className:"col-12 volter-bold",children:[g("trade.locked.until")," ",e.tradeLockExpiryTime]}),t("div",{className:"col-12",children:n("next",e.nextSanctionName,e.nextSanctionLengthHours)}),t(D,{onClick:r=>s(null),children:g("habbo.way.ok.button")})]})]})})}):null},F0=i=>{const[e,s]=a.useState([]),{activeReport:n=null,setActiveReport:r=null}=un(),{chatHistory:o=[],messengerHistory:l=[]}=oc(),c=a.useMemo(()=>{switch(n.reportType){case rt.BULLY:case rt.EMERGENCY:return o.filter(p=>p.type===an.TYPE_CHAT&&p.webId===n.reportedUserId&&p.entityType===vt.USER);case rt.IM:return l.filter(p=>p.webId===n.reportedUserId&&p.type===an.TYPE_IM)}return[]},[n,o,l]),u=p=>{s(E=>{const _=[...E],I=_.indexOf(p);return I>=0?_.splice(I,1):_.push(p),_})},h=()=>{!e||e.length<=0||r(p=>({...p,reportedChats:e,currentStep:Wt.SELECT_TOPICS}))},m=()=>{r(p=>({...p,currentStep:p.currentStep-1}))};return d(z,{children:[d(v,{gap:1,children:[t(N,{className:"volter-bold",children:g("help.emergency.chat_report.subtitle")}),t(N,{children:g("help.emergency.chat_report.description")})]}),d(v,{gap:1,overflow:"hidden",fullHeight:!0,children:[!c||!c.length&&t(N,{children:g("help.cfh.error.no_user_data")}),c.length>0&&t(qe,{gap:1,columnCount:1,columnMinHeight:25,overflow:"auto",children:c.map((p,E)=>t(D,{skin:6,onClick:_=>u(p),colour:e.indexOf(p)>=0?L.primary_red:L.primary_green,children:t(N,{variant:"white",children:p.message})},p.id))})]}),d(R,{gap:2,justifyContent:"between",children:[t(D,{onClick:m,disabled:n.reportType===rt.IM,children:g("generic.back")}),t(D,{disabled:e.length<=0,onClick:h,children:g("help.emergency.main.submit.button")})]})]})},x0=i=>{const[e,s]=a.useState(-1),{chatHistory:n=[]}=oc(),{activeReport:r=null,setActiveReport:o=null}=un(),l=a.useMemo(()=>{const m=new Map;return n.forEach(p=>{p.type===an.TYPE_CHAT&&p.entityType===vt.USER&&p.webId!==J().userId&&!m.has(p.webId)&&m.set(p.webId,{id:p.webId,username:p.name})}),Array.from(m.values())},[n]),c=m=>{m<=0||o(p=>({...p,reportedUserId:m,currentStep:Wt.SELECT_CHATS}))},u=m=>{s(p=>m===p?-1:m)},h=()=>{o(m=>({...m,currentStep:m.currentStep-1}))};return d(z,{children:[d(v,{gap:1,children:[t(N,{className:"volter-bold",children:g("help.emergency.main.step.two.title")}),l.length>0&&t(N,{children:g("report.user.pick.user")})]}),d(v,{gap:1,overflow:"hidden",fullHeight:!0,children:[!l.length&&t(N,{children:g("report.user.error.nolist")}),l.length>0&&t(qe,{columnCount:1,columnMinHeight:25,gap:1,children:l.map((m,p)=>t(D,{onClick:E=>u(m.id),skin:6,colour:e===m.id?L.primary_red:L.primary_green,children:t("span",{dangerouslySetInnerHTML:{__html:m.username}})},m.id))})]}),d(R,{gap:2,justifyContent:"between",children:[t(D,{onClick:h,children:g("generic.back")}),t(D,{disabled:e<=0,onClick:()=>c(e),children:g("help.emergency.main.submit.button")})]})]})},G0=i=>{const[e,s]=a.useState(-1),[n,r]=a.useState(-1),{setActiveReport:o=null}=un(),{cfhCategories:l=[]}=Kr(),c=()=>{e<0||n<0||o(h=>({...h,cfhCategory:e,cfhTopic:l[e].topics[n].id,currentStep:Wt.INPUT_REPORT_MESSAGE}))},u=()=>{if(e>=0)return s(-1);o(h=>({...h,currentStep:h.currentStep-1}))};return d(z,{children:[d(v,{gap:1,children:[t(N,{className:"volter-bold",children:g("help.emergency.chat_report.subtitle")}),t(N,{children:g("help.cfh.pick.topic")})]}),d(v,{gap:1,overflow:"auto",fullHeight:!0,children:[e<0&&l.map((h,m)=>t(D,{skin:6,colour:L.primary_red,onClick:p=>s(m),children:g(`help.cfh.reason.${h.name}`)},m)),e>=0&&l[e].topics.map((h,m)=>t(D,{skin:6,colour:L.primary_red,onClick:p=>r(m),children:g(`help.cfh.topic.${h.id}`)},m))]}),d(R,{gap:2,justifyContent:"between",children:[t(D,{onClick:u,children:g("generic.back")}),t(D,{disabled:n<0,onClick:c,children:g("help.emergency.main.submit.button")})]})]})},B0=i=>{const[e,s]=a.useState(!1),{activeReport:n=null,setActiveReport:r=null,report:o=null}=un(),l=()=>{r(null),s(!1)};a.useEffect(()=>{const u={linkReceived:h=>{const m=h.split("/");if(!(m.length<2))switch(m[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(p=>!p);return;case"tour":return;case"report":m.length>=5&&m[2]==="room"&&(parseInt(m[3]),unescape(m.splice(4).join("/")));return;case"sanctions":B(new yl(!0));return}},eventUrlPrefix:"help/"};return dt(u),()=>ht(u)},[]),a.useEffect(()=>{n&&s(!0)},[n]);const c=()=>{if(n)switch(n.currentStep){case Wt.SELECT_USER:return t(x0,{});case Wt.SELECT_CHATS:return t(F0,{});case Wt.SELECT_TOPICS:return t(G0,{});case Wt.INPUT_REPORT_MESSAGE:return t(R0,{});case Wt.REPORT_SUMMARY:return t(P0,{})}return t(v0,{})};return d(z,{children:[e&&t(le,{title:g("help.button.cfh"),className:"nitro-help",onCloseClick:l,children:t(V,{skin:0,colour:L.white,position:"relative",className:"text-black",fullHeight:!0,overflow:"hidden",children:d(pe,{children:[t(v,{center:!0,size:5,overflow:"hidden",children:t(P,{className:"index-image"})}),t(v,{justifyContent:"between",size:7,overflow:"hidden",children:t(c,{})})]})})}),t(D0,{}),t(L0,{})]})},Tu=i=>{const{badgeCode:e=null,children:s=null,index:n=-1,...r}=i,{selectedBadgeCode:o=null,setSelectedBadgeCode:l=null,toggleBadge:c=null,getBadgeId:u=null}=Yi(),{isUnseen:h=null}=ws(),m=h(nt.BADGE,u(e));return d(jt,{itemActive:o===e,itemUnseen:m,onMouseDown:p=>l(e),onDoubleClick:p=>c(o),...r,children:[t(ot,{badgeCode:e,localIndex:n}),s]})},H0=i=>{const[e,s]=a.useState(!1),{badgeCodes:n=[],activeBadgeCodes:r=[],selectedBadgeCode:o=null,isWearingBadge:l=null,canWearBadges:c=null,toggleBadge:u=null,getBadgeId:h=null,activate:m=null,deactivate:p=null}=Yi(),{isUnseen:E=null,removeUnseen:_=null}=ws();return a.useEffect(()=>{!o||!E(nt.BADGE,h(o))||_(nt.BADGE,h(o))},[o,E,_,h]),a.useEffect(()=>{if(!e)return;const I=m();return()=>p(I)},[e,m,p]),a.useEffect(()=>(s(!0),()=>s(!1)),[]),d(pe,{children:[t(v,{size:7,overflow:"hidden",children:t(qe,{columnCount:4,children:n&&n.length>0&&n.map((I,C)=>r.indexOf(I)>=0?null:t(Tu,{badgeCode:I,index:C},C))})}),d(v,{className:"justify-content-between",size:5,overflow:"auto",children:[d(v,{overflow:"hidden",gap:2,children:[t(N,{className:"p-1",children:g("inventory.badges.activebadges")}),t(qe,{columnCount:3,children:r&&r.length>0&&r.map((I,C)=>t(Tu,{badgeCode:I,index:C},C))})]}),!!o&&d(v,{grow:!0,justifyContent:"end",gap:2,children:[d(R,{alignItems:"center",gap:2,children:[t(ot,{shrink:!0,badgeCode:o}),t(N,{className:"p-1",children:yo(o)})]}),c()&&t(D,{skin:5,onClick:I=>u(o),children:g(l(o)?"inventory.badges.clearbadge":"inventory.badges.wearbadge")}),!c()&&l(o)&&t(D,{skin:5,onClick:I=>u(o),children:g("inventory.badges.clearbadge")})]})]})]})},pc=i=>{const{title:e="",desc:s="",children:n=null,...r}=i;return d(pe,{...r,children:[t(v,{center:!0,size:5,overflow:"hidden",children:t("div",{className:"empty-image"})}),d(v,{justifyContent:"center",size:7,overflow:"hidden",children:[t(N,{className:"volter-bold p-1",overflow:"unset",truncate:!0,children:e}),t(N,{className:"p-1",overflow:"auto",children:s})]}),n]})},V0=i=>{const{botItem:e=null,children:s=null,...n}=i,[r,o]=a.useState(!1),{selectedBot:l=null,setSelectedBot:c=null}=YE(),{isUnseen:u=null}=ws(),h=u(nt.BOT,e.botData.id),m=p=>{switch(p.type){case xe.MOUSE_DOWN:c(e),o(!0);return;case xe.MOUSE_UP:o(!1);return;case xe.ROLL_OUT:if(!r||l!==e)return;rl(e);return;case"dblclick":rl(e);return}};return d(jt,{itemActive:l===e,itemUnseen:h,onMouseDown:m,onMouseUp:m,onMouseOut:m,onDoubleClick:m,...n,children:[t(it,{figure:e.botData.figure,direction:3,headOnly:!0}),s]})},W0=i=>{const{roomSession:e=null,roomPreviewer:s=null}=i,[n,r]=a.useState(!1),{botItems:o=[],selectedBot:l=null,activate:c=null,deactivate:u=null}=YE(),{isUnseen:h=null,removeUnseen:m=null}=ws();return a.useEffect(()=>{if(!l||!s)return;const p=l.botData,E=X();let _=E.getRoomInstanceVariable(E.activeRoomId,ue.ROOM_WALL_TYPE),I=E.getRoomInstanceVariable(E.activeRoomId,ue.ROOM_FLOOR_TYPE),C=E.getRoomInstanceVariable(E.activeRoomId,ue.ROOM_LANDSCAPE_TYPE);_=_&&_.length?_:"101",I=I&&I.length?I:"101",C=C&&C.length?C:"1.1",s.reset(!1),s.updateRoomWallsAndFloorVisibility(!0,!0),s.updateObjectRoom(I,_,C),s.addAvatarIntoRoom(p.figure,0)},[s,l]),a.useEffect(()=>{!l||!h(nt.BOT,l.botData.id)||m(nt.BOT,l.botData.id)},[l,h,m]),a.useEffect(()=>{if(!n)return;const p=c();return()=>u(p)},[n,c,u]),a.useEffect(()=>(r(!0),()=>r(!1)),[]),!o||!o.length?t(pc,{title:g("inventory.empty.bots.title"),desc:g("inventory.empty.bots.desc")}):d(pe,{children:[t(v,{size:7,overflow:"hidden",children:t(qe,{columnCount:5,children:o&&o.length>0&&o.map(p=>t(V0,{botItem:p},p.botData.id))})}),d(v,{size:5,overflow:"auto",children:[t(v,{overflow:"hidden",position:"relative",children:t(zi,{roomPreviewer:s,height:140})}),l&&d(v,{grow:!0,justifyContent:"between",gap:2,children:[t(N,{className:"p-1",grow:!0,truncate:!0,children:l.botData.name}),!!e&&t(D,{skin:5,onClick:p=>rl(l),children:g("inventory.furni.placetoroom")})]})]})]})},j0=i=>{const{groupItem:e=null,...s}=i,[n,r]=a.useState(!1),{selectedItem:o=null,setSelectedItem:l=null}=$n(),c=h=>{switch(h.type){case xe.MOUSE_DOWN:l(e),r(!0);return;case xe.MOUSE_UP:r(!1);return;case xe.ROLL_OUT:if(!n||e!==o)return;Dr(e);return;case"dblclick":Dr(e);return}},u=e.getUnlockedCount();return t(jt,{className:u?"":"opacity-0-5 ",itemImage:e.iconUrl,itemCount:e.getUnlockedCount(),itemActive:e===o,itemUniqueNumber:e.stuffData.uniqueNumber,itemUnseen:e.hasUnseenItems,onMouseDown:c,onMouseUp:c,onMouseOut:c,...s,catalogue:!1})},_I=i=>{const{groupItems:e=[],setGroupItems:s=null}=i,[n,r]=a.useState("");return a.useEffect(()=>{let o=[...e];if(n&&n.length){const l=n.toLocaleLowerCase();o=e.filter(c=>l&&l.length&&c.name.toLocaleLowerCase().includes(l)?c:null)}s(o)},[e,s,n]),d(R,{gap:1,children:[t("input",{type:"text",className:"ton-input black-border w-100",placeholder:g("generic.search"),value:n,onChange:o=>r(o.target.value)}),t(D,{children:g("generic.search")})]})},q0=i=>{const e=i.getLastItem();if(!e||!e.sellable)return!1;At(new rc(e))},Y0=i=>{const{roomSession:e=null,roomPreviewer:s=null}=i,[n,r]=a.useState(!1),[o,l]=a.useState([]),{groupItems:c=[],selectedItem:u=null,activate:h=null,deactivate:m=null}=$n(),{resetItems:p=null}=ws(),{recycleFurni:E}=$E();return a.useEffect(()=>{if(!u||!s)return;const _=u.getLastItem();if(!_)return;const I=X();let C=I.getRoomInstanceVariable(I.activeRoomId,ue.ROOM_WALL_TYPE),f=I.getRoomInstanceVariable(I.activeRoomId,ue.ROOM_FLOOR_TYPE),S=I.getRoomInstanceVariable(I.activeRoomId,ue.ROOM_LANDSCAPE_TYPE);if(C=C&&C.length?C:"101",f=f&&f.length?f:"101",S=S&&S.length?S:"1.1",s.reset(!1),s.updateObjectRoom(f,C,S),s.updateRoomWallsAndFloorVisibility(!0,!0),_.category===ae.WALL_PAPER||_.category===ae.FLOOR||_.category===ae.LANDSCAPE){if(f=_.category===ae.FLOOR?u.stuffData.getLegacyString():f,C=_.category===ae.WALL_PAPER?u.stuffData.getLegacyString():C,S=_.category===ae.LANDSCAPE?u.stuffData.getLegacyString():S,s.updateObjectRoom(f,C,S),_.category===ae.LANDSCAPE){const T=J().getWallItemDataByName("window_double_default");T&&s.addWallItemIntoRoom(T.id,new Lt(90,0,0),T.customParams)}}else u.isWallItem?s.addWallItemIntoRoom(u.type,new Lt(90),_.stuffData.getLegacyString()):s.addFurnitureIntoRoom(u.type,new Lt(90),u.stuffData,_.extra.toString())},[s,u]),a.useEffect(()=>{!u||!u.hasUnseenItems||(p(nt.FURNI,u.items.map(_=>_.id)),u.hasUnseenItems=!1)},[u,p]),a.useEffect(()=>{if(!n)return;const _=h();return()=>m(_)},[n,h,m]),a.useEffect(()=>(r(!0),()=>r(!1)),[]),!c||!c.length?t(pc,{title:g("inventory.empty.title"),desc:g("inventory.empty.desc")}):d(pe,{children:[d(v,{size:7,overflow:"hidden",children:[t(_I,{groupItems:c,setGroupItems:l}),t(qe,{columnCount:5,children:o&&o.length>0&&o.map((_,I)=>t(j0,{groupItem:_,index:I},I))})]}),d(v,{size:5,overflow:"auto",children:[d(v,{overflow:"hidden",position:"relative",fullHeight:!0,children:[t(zi,{roomPreviewer:s,fullHeight:!0}),u&&u.stuffData.isUnique&&t(dE,{className:"top-2 end-2",position:"absolute",uniqueNumber:u.stuffData.uniqueNumber,uniqueSeries:u.stuffData.uniqueSeries}),u&&u.stuffData.rarityLevel>-1&&t(lc,{className:"top-2 end-2",position:"absolute",level:u.stuffData.rarityLevel})]}),u&&d(v,{grow:!0,justifyContent:"between",gap:2,children:[t(N,{grow:!0,truncate:!0,bold:!0,children:u.name}),t(N,{truncate:!0,children:u.description}),d(v,{gap:1,children:[!!e&&t(D,{skin:5,onClick:_=>Dr(u),children:g("inventory.furni.placetoroom")}),u&&u.isSellable&&t(D,{skin:5,onClick:_=>q0(u),children:g("inventory.marketplace.sell")}),u&&u.isRecycleable&&t(D,{skin:5,onClick:_=>E(u),children:g("inventory.recycle")})]})]})]})]})},Ta=9,z0=i=>{const{cancelTrade:e=null}=i,[s,n]=a.useState(null),[r,o]=a.useState(null),[l,c]=a.useState(null),[u,h]=a.useState(null),[m,p]=a.useState(3),[E,_]=a.useState(1),{ownUser:I=null,otherUser:C=null,groupItems:f=[],tradeState:S=gt.TRADING_STATE_READY,progressTrade:T=null,removeItem:b=null,setTradeState:y=null}=KE(),{simpleAlert:w=null}=Ke(),O=(M,G,H,Y,q)=>{if(!I||I.accepts||!I.userItems)return!1;if(I.userItems.length<Ta)return!0;if(!Y)return!1;let Z=G.toString();return H===ae.POSTER?Z=Z+"poster"+q.getLegacyString():H===ae.GUILD_FURNI?Z=By(G,q):Z=(M?"I":"S")+Z,!!I.userItems.getValue(Z)},F=M=>{if(!s)return;const G=s.getTradeItems(M);if(!G||!G.length)return;let H=null;const Y=[];for(const Z of G)Y.push(Z.id),H||(H=Z);if(I.userItems.length+Y.length<=1500)if(!H.isGroupable&&Y.length)B(new Ya(Y.pop()));else{const Z=[];for(const ce of Y)O(H.isWallItem,H.type,H.category,H.isGroupable,H.stuffData)&&Z.push(ce);Z.length&&(Z.length===1?B(new Ya(Z.pop())):B(new mf(...Z)))}else w(g("trading.items.too_many_items.desc"),fe.DEFAULT,null,null,g("trading.items.too_many_items.title"))},U=M=>t("div",{className:"tradelock-"+(M?"lock":"unlock")}),j=(M,G)=>{(isNaN(Number(M))||Number(M)<0||!M)&&(M=1),M=Math.max(Number(M),1),M=Math.min(Number(M),G),M!==E&&_(M)},x=M=>{j(E,M),F(E)};return a.useEffect(()=>{_(1)},[s]),a.useEffect(()=>{if(S!==gt.TRADING_STATE_COUNTDOWN)return;p(3);const M=setInterval(()=>{p(G=>{const H=G-1;return H===0&&clearInterval(M),H})},1e3);return()=>clearInterval(M)},[S,y]),a.useEffect(()=>{m===0&&y(gt.TRADING_STATE_CONFIRMING)},[m,y]),S===gt.TRADING_STATE_READY||!I||!C?null:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:d(pe,{children:[d(v,{size:4,overflow:"hidden",children:[t(_I,{groupItems:f,setGroupItems:h}),d(R,{column:!0,fullHeight:!0,justifyContent:"between",overflow:"hidden",gap:2,children:[t(qe,{columnCount:3,children:u&&u.length>0&&u.map((M,G)=>{const H=M.getUnlockedCount();return t(jt,{className:H?"":"opacity-0-5 ",itemImage:M.iconUrl,itemCount:H,itemActive:s===M,itemUniqueNumber:M.stuffData.uniqueNumber,onClick:Y=>H&&n(M),onDoubleClick:Y=>F(1)},G)})}),d(v,{gap:1,alignItems:"end",children:[d(pe,{overflow:"hidden",children:[t(v,{size:6,overflow:"hidden",children:t(V,{colour:L.lighter_grey,position:"relative",skin:4,children:t("input",{type:"number",className:"ton-input p-1",placeholder:g("catalog.bundlewidget.spinner.select.amount"),disabled:!s,value:E,onChange:M=>_(M.target.valueAsNumber)})})}),t(v,{size:6,overflow:"hidden",children:t(D,{skin:1,disabled:!s,onClick:M=>x(s.getUnlockedCount()),children:g("infostand.button.trade")})})]}),t(P,{fullWidth:!0,className:"d-inline-block text-center w-100 text-black volter-bold",children:s?s.name:g("catalog_selectproduct")})]})]})]}),d(v,{size:8,overflow:"hidden",children:[d(pe,{overflow:"hidden",className:"mt-3",children:[d(v,{size:6,overflow:"hidden",children:[d(R,{justifyContent:"between",alignItems:"center",children:[d(N,{className:"p-1",children:[g("inventory.trading.you")," ",g("inventory.trading.areoffering"),":"]}),U(I.accepts)]}),t(qe,{columnCount:3,children:Array.from(Array(Ta),(M,G)=>{const H=I.userItems.getWithIndex(G)||null;return H?t(jt,{itemActive:r===H,itemImage:H.iconUrl,itemCount:H.getTotalCount(),itemUniqueNumber:H.stuffData.uniqueNumber,onClick:Y=>o(H),onDoubleClick:Y=>b(H),children:r===H&&t(D,{skin:1,position:"absolute",className:"trade-button bottom-0 start-0",onClick:Y=>b(H),children:"<"})},G):t(jt,{},G)})}),t(P,{fullWidth:!0,className:"d-inline-block text-center w-100 text-black volter-bold",children:r?r.name:g("catalog_selectproduct")})]}),d(v,{size:6,overflow:"hidden",children:[d(R,{justifyContent:"between",alignItems:"center",children:[d(N,{className:"p-1",children:[C.userName," ",g("inventory.trading.isoffering"),":"]}),U(C.accepts)]}),t(qe,{columnCount:3,children:Array.from(Array(Ta),(M,G)=>{const H=C.userItems.getWithIndex(G)||null;return H?t(jt,{itemActive:l===H,itemImage:H.iconUrl,itemCount:H.getTotalCount(),itemUniqueNumber:H.stuffData.uniqueNumber,onClick:Y=>c(H)},G):t(jt,{},G)})}),t(P,{fullWidth:!0,className:"d-inline-block text-center w-100 text-black volter-bold",children:l?l.name:g("catalog_selectproduct")})]})]}),d(R,{grow:!0,justifyContent:"between",children:[t(D,{onClick:e,children:g("generic.cancel")}),S===gt.TRADING_STATE_READY&&t(D,{skin:1,disabled:!I.itemCount&&!C.itemCount,onClick:T,children:g("inventory.trading.accept")}),S===gt.TRADING_STATE_RUNNING&&t(D,{skin:1,disabled:!I.itemCount&&!C.itemCount,onClick:T,children:g(I.accepts?"inventory.trading.modify":"inventory.trading.accept")}),S===gt.TRADING_STATE_COUNTDOWN&&t(D,{skin:1,disabled:!0,children:g("inventory.trading.countdown",["counter"],[m.toString()])}),S===gt.TRADING_STATE_CONFIRMING&&t(D,{skin:1,onClick:T,children:g("inventory.trading.button.restore")}),S===gt.TRADING_STATE_CONFIRMED&&t(D,{disabled:!0,children:g("inventory.trading.info.waiting")})]})]})]})})},K0=i=>{const{petItem:e=null,children:s=null,...n}=i,[r,o]=a.useState(!1),{selectedPet:l=null,setSelectedPet:c=null}=zE(),{isUnseen:u}=ws(),h=u(nt.PET,e.petData.id),m=p=>{switch(p.type){case xe.MOUSE_DOWN:c(e),o(!0);return;case xe.MOUSE_UP:o(!1);return;case xe.ROLL_OUT:if(!r||e!==l)return;nl(e);return;case"dblclick":nl(e);return}};return d(jt,{itemActive:e===l,itemUnseen:h,onMouseDown:m,onMouseUp:m,onMouseOut:m,onDoubleClick:m,...n,children:[t(Tn,{figure:e.petData.figureData.figuredata,direction:3,headOnly:!0}),s]})},$0=i=>{const{roomSession:e=null,roomPreviewer:s=null}=i,[n,r]=a.useState(!1),{petItems:o=null,selectedPet:l=null,activate:c=null,deactivate:u=null}=zE(),{isUnseen:h=null,removeUnseen:m=null}=ws();return a.useEffect(()=>{if(!l||!s)return;const p=l.petData,E=X();let _=E.getRoomInstanceVariable(E.activeRoomId,ue.ROOM_WALL_TYPE),I=E.getRoomInstanceVariable(E.activeRoomId,ue.ROOM_FLOOR_TYPE),C=E.getRoomInstanceVariable(E.activeRoomId,ue.ROOM_LANDSCAPE_TYPE);_=_&&_.length?_:"101",I=I&&I.length?I:"101",C=C&&C.length?C:"1.1",s.reset(!1),s.updateRoomWallsAndFloorVisibility(!0,!0),s.updateObjectRoom(I,_,C),s.addPetIntoRoom(p.figureString)},[s,l]),a.useEffect(()=>{!l||!h(nt.PET,l.petData.id)||m(nt.PET,l.petData.id)},[l,h,m]),a.useEffect(()=>{if(!n)return;const p=c();return()=>u(p)},[n,c,u]),a.useEffect(()=>(r(!0),()=>r(!1)),[]),!o||!o.length?t(pc,{title:g("inventory.empty.pets.title"),desc:g("inventory.empty.pets.desc")}):d(pe,{children:[t(v,{size:7,overflow:"hidden",children:t(qe,{columnCount:5,children:o&&o.length>0&&o.map(p=>t(K0,{petItem:p},p.petData.id))})}),d(v,{size:5,overflow:"auto",children:[t(v,{overflow:"hidden",position:"relative",children:t(zi,{roomPreviewer:s,height:140})}),l&&l.petData&&d(v,{grow:!0,justifyContent:"between",gap:2,children:[t(N,{className:"p-1",grow:!0,truncate:!0,children:l.petData.name}),!!e&&t(D,{skin:5,onClick:p=>nl(l),children:g("inventory.furni.placetoroom")})]})]})]})},EI="inventory.furni",II="inventory.bots",CI="inventory.furni.tab.pets",SI="inventory.badges",Nu=[EI,II,CI,SI],Q0=[nt.FURNI,nt.BOT,nt.PET,nt.BADGE],X0=i=>{const[e,s]=a.useState(!1),[n,r]=a.useState(Nu[0]),[o,l]=a.useState(null),[c,u]=a.useState(null),{isTrading:h=!1,stopTrading:m=null}=KE(),{getCount:p=null,resetCategory:E=null}=ws(),{inventoryIconRef:_}=Wi(),I=()=>{h&&m(),s(!1)};ke(bt.PLACED,f=>{Dy()&&(ko(!1),f.placedInRoom||s(!0))}),$e([qt.CREATED,qt.ENDED],f=>{switch(f.type){case qt.CREATED:l(f.session);return;case qt.ENDED:l(null),s(!1);return}}),W(Vh,f=>{const S=f.getParser();for(const T of S.data)M_().setBadgePointLimit(T.badgeId,T.limit)}),a.useEffect(()=>{const f={linkReceived:S=>{const T=S.split("/");if(!(T.length<2))switch(T[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(b=>!b);return}},eventUrlPrefix:"inventory/"};return dt(f),()=>ht(f)},[]),a.useEffect(()=>(u(new Ci(X(),++Ci.PREVIEW_COUNTER)),()=>{u(f=>(f.dispose(),null))}),[]),a.useEffect(()=>{!e&&h&&s(!0)},[e,h]);const C=a.useCallback(()=>{if(!_||_&&!_.current)return{x:0,y:0};let f=_.current;return{x:f.getBoundingClientRect().x+f.parentElement.clientWidth,y:f.getBoundingClientRect().y}},[_]);if(!_.current)return null;if(e)return d(le,{uniqueKey:"inventory",title:g("inventory.title"),className:h?"nitro-inventory-trade":"nitro-inventory",onCloseClick:I,offsetLeft:C().x,offsetTop:C().y,windowPosition:tt.TOP_LEFT,children:[!h&&d(z,{children:[t(en,{children:Nu.map((f,S)=>t(Ns,{className:"p-1",isActive:n===f,onClick:T=>r(f),count:p(Q0[S]),children:g(f)},S))}),d(V,{skin:0,colour:L.white,position:"relative",fullHeight:!0,overflow:"auto",column:!0,children:[n===EI&&t(Y0,{roomSession:o,roomPreviewer:c}),n===II&&t(W0,{roomSession:o,roomPreviewer:c}),n===CI&&t($0,{roomSession:o,roomPreviewer:c}),n===SI&&t(H0,{})]})]}),h&&t(z0,{cancelTrade:I})]})},J0=i=>{const{enabled:e=!1}=i,{isEditorVisible:s,setIsEditorVisible:n}=Kn(),{vpnVisible:r,setVPNVisible:o}=gE(),{hasPermission:l}=jn();return e?d(z,{children:[l(Wn.FETCH_UNAPPROVED_NEWS)&&t(D,{onClick:()=>n(!s),children:g("modtool.admin.news")}),l(Wn.BLOCK_VPN)&&t(D,{onClick:()=>o(!r),children:g("modtool.admin.blocker")})]}):null},Z0=i=>{const{index:e=0,category:s=null,onSaveField:n=null,onDelete:r=null}=i,o=a.useMemo(()=>"ton-input black-border w-100",[]);return d("tr",{className:"grid gap-0",children:[t("td",{className:"g-col-3",children:t("input",{type:"text",className:o,value:s.caption,onChange:l=>n(e,"caption",l)})}),t("td",{className:"g-col-3",children:t("input",{type:"color",className:o,value:s.colour,onChange:l=>n(e,"colour",l)})}),t("td",{className:"g-col-2",children:t("input",{type:"text",className:o,value:s.icon,onChange:l=>n(e,"icon",l)})}),t("td",{className:"g-col-2",children:t("input",{type:"number",className:o,value:s.orderNum,onChange:l=>n(e,"orderNum",l)})}),t("td",{className:"g-col-2",children:t(D,{skin:0,colour:L.primary_red,className:"text-white",onClick:()=>r(s),children:g("generic.delete")})})]})},eP=()=>{const{get:i,getAPI:e,post:s}=Os(),{showSingleBubble:n=null}=Ke(),[r,o]=a.useState(),[l,c]=a.useState(),[u,h]=a.useState(),[m,p]=a.useState(),[E,_]=a.useState(0),I=a.useCallback(async(y=0)=>{let w=await i(e("news.categories.api"));w&&o(w)},[i,e,o]),C=a.useCallback(async y=>{const{id:w=0,caption:O=null,colour:F=null,icon:U=null,orderNum:j=null}=y,x=await s(e("news.categories.create.api"),{id:w,caption:O,colour:F,icon:U,orderNum:j});if(x){if(x.errors)for(let M of x.errors)n(g(M));if(x.messages)for(let M of x.messages)n(g(M))}},[s,e,n]),f=a.useCallback((y,w,O)=>{o(F=>(F=[...r],F[y][w]=O.target.value,F))},[r,o]),S=a.useCallback(async()=>{await Promise.all(r.map(async y=>{await C(y)}))},[r,C]),T=a.useCallback(async y=>{const{id:w=0}=y,O=await s(e("news.categories.delete.api"),{id:w});if(O){if(O.errors)for(let F of O.errors)n(g(F));if(O.messages)for(let F of O.messages)n(g(F));await I()}},[s,e,I,n]),b=a.useCallback(async()=>{const y=await s(e("news.categories.create.api"),{caption:l,colour:u,icon:m,orderNum:E});if(y){if(y.errors)for(let w of y.errors)n(g(w));if(y.messages)for(let w of y.messages)n(g(w));y.errors.length||(await I(),c(""),h(""),p(""),_(0))}},[s,e,l,u,m,E,I,n]);return Vs(()=>{I()}),d(R,{overflow:"hidden",fullHeight:!0,column:!0,fullWidth:!0,children:[t(v,{gap:2,children:d(pe,{gap:1,className:"text-black volter-bold border-bottom pb-1",children:[t(P,{className:"g-col-3",children:g("modtool.admin.news.fields.caption")}),t(P,{className:"g-col-3",children:g("modtool.admin.news.fields.colour")}),t(P,{className:"g-col-2",children:g("modtool.admin.news.fields.icon")}),t(P,{className:"g-col-2",children:g("modtool.admin.news.fields.order")}),t(P,{className:"g-col-2",children:g("modtool.admin.news.fields.options")})]})}),t("table",{className:"table table-striped table-sm table-text-small text-black m-0 h-100 overflow-auto d-flex w-100",children:t("tbody",{className:"w-100",children:r&&r.map((y,w)=>t(Z0,{index:w,category:y,onSaveField:f,onDelete:T},w))})}),d(R,{gap:1,className:"mt-auto pb-1",children:[t("input",{className:"w-100 ton-input black-border",type:"text",value:l,onChange:y=>c(y.target.value),placeholder:g("modtool.admin.news.fields.caption")}),t("input",{className:"w-100 ton-input black-border",type:"color",value:u,onChange:y=>h(y.target.value),placeholder:g("modtool.admin.news.fields.colour")}),t("input",{className:"w-100 ton-input black-border",type:"text",value:m,onChange:y=>p(y.target.value),placeholder:g("modtool.admin.news.fields.icon")}),t("input",{className:"w-100 ton-input black-border",type:"number",value:E,onChange:y=>_(parseInt(y.target.value)),placeholder:g("modtool.admin.news.fields.orderNum")}),t(D,{skin:1,onClick:()=>b(),children:g("generic.create")})]}),t(R,{justifyContent:"center",children:t(D,{skin:1,onClick:()=>S(),children:g("generic.save.all")})})]})},tP=i=>{const{article:e=null,setCreateNews:s=null,setArticle:n=null}=i,{get:r,post:o,getAPI:l}=Os(),{quill:c,quillRef:u,editor:h}=GI({modules:{toolbar:[["bold","italic","underline",{list:"ordered"},{list:"bullet"},{color:[]},{background:[]},{align:[]},"clean","image","link"],[{size:["small",!1,"large","huge"]},{header:[1,2,3,4,5,6,!1]},{font:[]}]]}}),{showSingleBubble:m=null}=Ke(),[p,E]=a.useState(null),[_,I]=a.useState(0),[C,f]=a.useState(),[S,T]=a.useState(),[b,y]=a.useState(),w=a.useCallback(async()=>{let U=await r(l("news.categories.api"));U&&(e||y(U[0].id),E(U))},[r,l,E,e]);a.useEffect(()=>{w()},[w]),a.useEffect(()=>{!e||!c||(I(e.id),f(e.caption),T(e.description),y(e.categoryId),c.root.innerHTML=e.body)},[e,c]);const O=a.useCallback(async()=>{let U=await o(l("news.post.api"),{id:_,caption:C,description:S,body:c.root.innerHTML,image:" ",categoryId:b,teaser:""});if(U){if(U.errors.length){for(let j of U.errors)m(g(j));return}s(!1),n(null)}},[o,l,_,C,S,c,b,s,n,m]),F=a.useCallback(async()=>{let U=await o(l("news.delete.api"),{id:_});if(U){for(let j of U.errors)m(g(j));if(U.messages)for(let j of U.messages)m(g(j));U.errors.length>0||(s(!1),n(null))}},[o,l,_,m,s,n]);return d("form",{onSubmit:()=>O(),className:"d-flex flex-column h-100 gap-1 overflow-hidden",children:[d(R,{column:!0,fullHeight:!0,overflow:"auto",gap:1,children:[t("input",{type:"text",placeholder:g("modtool.admin.news.fields.caption"),value:C,onChange:U=>f(U.target.value),className:"ton-input black-border"}),t("textarea",{className:"ton-input black-border flex-shrink-0",rows:4,value:S,onChange:U=>T(U.target.value)}),t("select",{className:"ton-input black-border",onChange:U=>y(parseInt(U.target.value)),value:b,children:p&&p.length>0&&p.map(U=>t("option",{value:U.id,children:U.caption},U.id))}),t("div",{className:"text-black ubuntu w-100 h-100 ton-input border-black d-flex flex-column overflow-hidden",children:t("div",{ref:u})}),t("input",{type:"submit",className:"d-none"})]}),d(R,{justifyContent:"between",children:[t(D,{onClick:()=>{s(!1),n(null)},children:g("generic.cancel")}),t(D,{colour:L.primary_red,className:"text-white",onClick:()=>F(),children:g("generic.delete")}),t(D,{skin:1,onClick:()=>O(),children:g("modtool.admin.news."+(e?"save.article":"create.article"))})]})]})},Na=30,sP=i=>{const{setActiveNews:e=null,setCreateNews:s=null}=i,{get:n,getAPI:r}=Os(),[o,l]=a.useState(null),[c,u]=a.useState(0),[h,m]=a.useState(0),p=a.useCallback(async(_=0)=>{let I=await n(r("news.all.api")+`/${Na}/${Na*_}/force`);I&&(u(I.current_page),m(I.total),l(I.data))},[n,r,l,u]);a.useCallback(async()=>{await p(c+1)},[p,c]),a.useCallback(async()=>{await p(c-1)},[p,c]);const E=a.useCallback(async _=>{await p(_)},[p]);return Vs(()=>{p()}),d(R,{overflow:"hidden",fullHeight:!0,column:!0,fullWidth:!0,children:[t(v,{gap:2,children:d(pe,{gap:1,className:"text-black volter-bold border-bottom pb-1",children:[t(P,{className:"g-col-4",children:g("modtool.admin.news.fields.caption")}),t(P,{className:"g-col-4",children:g("modtool.admin.news.fields.category")}),t(P,{className:"g-col-4",children:g("modtool.admin.news.fields.date")})]})}),t("table",{className:"table table-striped table-sm table-text-small text-black m-0 table-clickable h-100 overflow-auto d-flex w-100",children:t("tbody",{className:"w-100",children:o&&o.length>0&&o.map(_=>d("tr",{className:"grid gap-0",onClick:()=>e(_),children:[t("td",{className:"g-col-4",children:_.caption}),t("td",{className:"g-col-4",children:_.category&&_.category.caption}),t("td",{className:"g-col-4",children:new Date(_.date*1e3).toLocaleString()})]},_.id))})}),d(R,{className:"pt-1",justifyContent:"between",children:[t(R,{gap:1,children:h&&t(yk,{currentPage:c,totalCount:h,pageSize:Na,onPageChange:_=>E(_-1)})}),t(D,{skin:1,onClick:()=>s(!0),children:g("modtool.admin.news.create.article")})]})]})},nP=()=>{const[i,e]=a.useState(null),[s,n]=a.useState(!1);return d(z,{children:[!s&&!i&&t(sP,{setActiveNews:e,setCreateNews:n}),(s||i)&&t(tP,{article:i,setCreateNews:n,setArticle:e})]})},rP=()=>{const[i,e]=a.useState(0),{isEditorVisible:s,setIsEditorVisible:n}=Kn(),r=["news","news.manage.categories"];if(s)return d(le,{title:g("modtool.admin.news"),className:"ton-tool-news",onCloseClick:()=>n(!1),children:[t(en,{children:r.map((o,l)=>t(Ns,{className:"p-1",onClick:c=>e(l),isActive:l===i,children:g("modtool.admin."+o)},l))}),d(V,{className:"d-flex flex-column",position:"relative",fullHeight:!0,overflow:"hidden",children:[i===0&&t(nP,{}),i===1&&t(eP,{})]})]})},oP=()=>{const{vpnVisible:i,setVPNVisible:e,setUsername:s,setIP:n,username:r,ip:o,blockVPN:l}=gE();if(i)return t(le,{title:g("modtool.admin.blocker"),className:"ton-tool-blocker",onCloseClick:()=>e(!1),children:d(v,{gap:1,children:[t(V,{className:"d-flex flex-column",position:"relative",fullHeight:!0,overflow:"hidden",gap:0,children:d("form",{onSubmit:l,className:"d-flex flex-column gap-1",children:[t(N,{bold:!0,children:g("generic.username")}),t("input",{type:"text",className:"ton-input black-border",onChange:c=>s(c.target.value),value:r}),t(N,{bold:!0,children:g("modtools.userinfo.userIP")}),t("input",{type:"text",className:"ton-input black-border",onChange:c=>n(c.target.value),value:o}),t("input",{type:"submit",className:"d-none"})]})}),t(D,{skin:6,colour:L.primary_green,onClick:()=>l,children:g("generic.ok")})]})})},iP=()=>d(z,{children:[t(rP,{}),t(oP,{})]}),fc=i=>{const{records:e=null}=i,{openRoomInfo:s=null}=Kr(),n=a.useMemo(()=>{const o=[];return e.forEach(l=>{o.push({isRoomInfo:!0,roomId:l.roomId,roomName:l.roomName}),l.chatlog.forEach(c=>{o.push({timestamp:c.timestamp,habboId:c.userId,username:c.userName,hasHighlighting:c.hasHighlighting,message:c.message,isRoomInfo:!1})})}),o},[e]),r=o=>d(R,{gap:2,alignItems:"center",justifyContent:"between",className:"room-info bg-muted p-1",children:[d(R,{gap:1,children:[t(N,{bold:!0,children:"Room name:"}),t(N,{children:o.roomName})]}),d(R,{gap:1,children:[t(D,{onClick:l=>Rs(o.roomId),children:"Visit Room"}),t(D,{onClick:l=>s(o.roomId),children:"Room Tools"})]})]});return t(z,{children:d(v,{fit:!0,gap:0,overflow:"hidden",children:[t(v,{gap:2,children:d(pe,{gap:1,className:"text-black border-bottom pb-1",children:[t(P,{className:"g-col-2",children:"Time"}),t(P,{className:"g-col-3",children:"User"}),t(P,{className:"g-col-7",children:"Message"})]})}),e&&e.length>0&&t(xi,{rows:n,estimateSize:25,rowRender:o=>d(z,{children:[o.isRoomInfo&&t(r,{roomId:o.roomId,roomName:o.roomName}),!o.isRoomInfo&&d(pe,{fullHeight:!1,gap:1,alignItems:"center",className:"log-entry py-1 border-bottom",children:[t(N,{className:"g-col-2",children:o.timestamp}),t(N,{className:"g-col-3",bold:!0,underline:!0,pointer:!0,onClick:l=>oe(`mod-tools/open-user-info/${o.habboId}`),children:o.username}),t(N,{textBreak:!0,wrap:!0,className:"g-col-7",children:o.message})]})]})})]})})},aP=i=>{const{roomId:e=null,onCloseClick:s=null}=i,[n,r]=a.useState(null);return W(_m,o=>{const l=o.getParser();!l||l.data.roomId!==e||r(l.data)}),a.useEffect(()=>{B(new n_(e))},[e]),n?t(le,{title:`Room Chatlog: ${n.roomName}`,className:"nitro-mod-tools-chatlog",windowPosition:tt.TOP_LEFT,offsetLeft:260,onCloseClick:s,children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:t(at,{className:"text-black h-100",overflow:"hidden",children:n&&t(fc,{records:[n]})})})}):null},lP=i=>{const{roomId:e=null,onCloseClick:s=null}=i,[n,r]=a.useState(!1),[o,l]=a.useState(null),[c,u]=a.useState(null),[h,m]=a.useState(null),[p,E]=a.useState(null),[_,I]=a.useState(!1),[C,f]=a.useState(0),[S,T]=a.useState(!1),[b,y]=a.useState(!1),[w,O]=a.useState(!1),[F,U]=a.useState(""),j=(x,M)=>{if(x)switch(x){case"alert_only":if(F.trim().length===0)return;B(new ro(ro.ACTION_ALERT,F,"")),B(new $a(e,b?1:0,w?1:0,S?1:0));return;case"send_message":if(F.trim().length===0)return;B(new ro(ro.ACTION_MESSAGE,F,"")),B(new $a(e,b?1:0,w?1:0,S?1:0));return}};return W(pm,x=>{const M=x.getParser();!M||M.data.flatId!==e||(l(M.data.flatId),u(M.data.room.name),m(M.data.ownerId),E(M.data.ownerName),I(M.data.ownerInRoom),f(M.data.userCount))}),a.useEffect(()=>{n||(B(new t_(e)),r(!0))},[e,n,r]),t(le,{title:"Room Info"+(c?": "+c:""),className:"nitro-mod-tools-room",windowPosition:tt.TOP_LEFT,offsetLeft:260,onCloseClick:s,children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:d(at,{className:"text-black",children:[d(R,{gap:2,children:[d(v,{justifyContent:"center",grow:!0,gap:1,children:[d(R,{alignItems:"center",gap:2,children:[t(N,{bold:!0,align:"end",className:"col-7",children:"Room Owner:"}),t(N,{underline:!0,pointer:!0,truncate:!0,children:p})]}),d(R,{alignItems:"center",gap:2,children:[t(N,{bold:!0,align:"end",className:"col-7",children:"Users in room:"}),t(N,{children:C})]}),d(R,{alignItems:"center",gap:2,children:[t(N,{bold:!0,align:"end",className:"col-7",children:"Owner in room:"}),t(N,{children:_?"Yes":"No"})]})]}),d(v,{gap:1,children:[t(D,{onClick:x=>Rs(e),children:"Visit Room"}),t(D,{onClick:x=>oe(`mod-tools/open-room-chatlog/${e}`),children:"Chatlog"})]})]}),d(v,{className:"bg-muted p-2",gap:1,children:[d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",checked:S,onChange:x=>T(x.target.checked)}),t(N,{children:"Kick everyone out"})]}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",checked:b,onChange:x=>y(x.target.checked)}),t(N,{children:"Enable the doorbell"})]}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",checked:w,onChange:x=>O(x.target.checked)}),t(N,{children:"Change room name"})]})]}),t("textarea",{className:"form-control",placeholder:"Type a mandatory message to the users in this text box...",value:F,onChange:x=>U(x.target.value)}),d(R,{justifyContent:"between",children:[t(D,{onClick:x=>j("send_message"),children:"Send Caution"}),t(D,{onClick:x=>j("alert_only"),children:"Send Alert only"})]})]})})})},cP=i=>{const{onCloseClick:e=null,issueId:s=null}=i,[n,r]=a.useState(null);return W(Sm,o=>{const l=o.getParser();!l||l.data.issueId!==s||r(l.data)}),a.useEffect(()=>{B(new h_(s))},[s]),t(le,{title:"Issue Chatlog",className:"nitro-mod-tools-chatlog",onCloseClick:e,children:t(at,{className:"text-black",children:n&&t(fc,{records:[n.chatRecord]})})})},uP=i=>{const{issueId:e=null,onIssueInfoClosed:s=null}=i,[n,r]=a.useState(!1),{tickets:o=[],openUserInfo:l=null}=Kr(),c=o.find(m=>m.issueId===e),u=m=>{B(new Bl([m])),s(m)},h=m=>{B(new oo([e],m)),s(e)};return d(z,{children:[t(le,{title:"Resolving issue "+e,className:"nitro-mod-tools-handle-issue",onCloseClick:()=>s(e),children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:d(at,{className:"text-black",children:[t(N,{fontSize:4,children:"Issue Information"}),d(pe,{overflow:"auto",children:[t(v,{size:8,children:t("table",{className:"table table-striped table-sm table-text-small text-black m-0",children:d("tbody",{children:[d("tr",{children:[t("th",{children:"Source"}),t("td",{children:cA(c.categoryId)})]}),d("tr",{children:[t("th",{children:"Category"}),t("td",{className:"text-break",children:g("help.cfh.topic."+c.reportedCategoryId)})]}),d("tr",{children:[t("th",{children:"Description"}),t("td",{className:"text-break",children:c.message})]}),d("tr",{children:[t("th",{children:"Caller"}),t("td",{children:t(N,{bold:!0,underline:!0,pointer:!0,onClick:m=>l(c.reporterUserId),children:c.reporterUserName})})]}),d("tr",{children:[t("th",{children:"Reported User"}),t("td",{children:t(N,{bold:!0,underline:!0,pointer:!0,onClick:m=>l(c.reportedUserId),children:c.reportedUserName})})]})]})})}),d(v,{size:4,gap:1,children:[t(D,{onClick:()=>r(!n),children:"Chatlog"}),t(D,{onClick:m=>h(oo.RESOLUTION_USELESS),children:"Close as useless"}),t(D,{onClick:m=>h(oo.RESOLUTION_ABUSIVE),children:"Close as abusive"}),t(D,{onClick:m=>h(oo.RESOLUTION_RESOLVED),children:"Close as resolved"}),t(D,{onClick:m=>u(e),children:"Release"})]})]})]})})}),n&&t(cP,{issueId:e,onCloseClick:()=>r(!1)})]})},dP=i=>{const{myIssues:e=null,handleIssue:s=null}=i;return d(v,{gap:0,overflow:"hidden",children:[t(v,{gap:2,children:d(pe,{gap:1,className:"text-black border-bottom pb-1",children:[t(P,{className:"g-col-2",children:"Type"}),t(P,{className:"g-col-3",children:"Room/Player"}),t(P,{className:"g-col-3",children:"Opened"}),t(P,{className:"g-col-2"}),t(P,{className:"g-col-2"})]})}),t(v,{overflow:"auto",className:"striped-children",gap:0,children:e&&e.length>0&&e.map(n=>d(pe,{gap:1,alignItems:"center",className:"text-black py-1 border-bottom",children:[t(P,{className:"g-col-2",children:n.categoryId}),t(P,{className:"g-col-3",children:n.reportedUserName}),t(P,{className:"g-col-3",children:new Date(Date.now()-n.issueAgeInMilliseconds).toLocaleTimeString()}),t(P,{className:"g-col-2",children:t(D,{onClick:r=>s(n.issueId),children:"Handle"})}),t(P,{className:"g-col-2",children:t(D,{onClick:r=>B(new Bl([n.issueId])),children:"Release"})})]},n.issueId))})]})},hP=i=>{const{openIssues:e=null}=i;return d(v,{gap:0,overflow:"hidden",children:[t(v,{gap:2,children:d(pe,{gap:1,className:"text-black border-bottom pb-1",children:[t(P,{className:"g-col-2",children:"Type"}),t(P,{className:"g-col-3",children:"Room/Player"}),t(P,{className:"g-col-4",children:"Opened"}),t(P,{className:"g-col-3"})]})}),t(v,{overflow:"auto",className:"striped-children",gap:0,children:e&&e.length>0&&e.map(s=>d(pe,{gap:1,alignItems:"center",className:"text-black py-1 border-bottom",children:[t(P,{className:"g-col-2",children:s.categoryId}),t(P,{className:"g-col-3",children:s.reportedUserName}),t(P,{className:"g-col-4",children:new Date(Date.now()-s.issueAgeInMilliseconds).toLocaleTimeString()}),t(P,{className:"g-col-3",children:t(D,{onClick:n=>B(new m_([s.issueId],!1,0,"pick issue button")),children:"Pick Issue"})})]},s.issueId))})]})},mP=i=>{const{pickedIssues:e=null}=i;return d(v,{gap:0,overflow:"hidden",children:[t(v,{gap:2,children:d(pe,{gap:1,className:"text-black border-bottom pb-1",children:[t(P,{className:"g-col-2",children:"Type"}),t(P,{className:"g-col-3",children:"Room/Player"}),t(P,{className:"g-col-4",children:"Opened"}),t(P,{className:"g-col-3",children:"Picker"})]})}),t(v,{overflow:"auto",className:"striped-children",gap:0,children:e&&e.length>0&&e.map(s=>d(pe,{gap:1,alignItems:"center",className:"text-black py-1 border-bottom",children:[t(P,{className:"g-col-2",children:s.categoryId}),t(P,{className:"g-col-3",children:s.reportedUserName}),t(P,{className:"g-col-4",children:new Date(Date.now()-s.issueAgeInMilliseconds).toLocaleTimeString()}),t(P,{className:"g-col-3",children:s.pickerUserName})]},s.issueId))})]})},gP=["Open Issues","My Issues","Picked Issues"],pP=i=>{const{onCloseClick:e=null}=i,[s,n]=a.useState(0),[r,o]=a.useState([]),{tickets:l=[],openIssues:c}=Kr(),u=l.filter(_=>_.state===Xa.STATE_PICKED&&_.pickerUserId===J().userId),h=l.filter(_=>_.state===Xa.STATE_PICKED),m=_=>{o(I=>{const C=[...I],f=C.indexOf(_);return f>=0&&C.splice(f,1),C})},p=_=>{o(I=>{const C=[...I],f=C.indexOf(_);return f===-1?C.push(_):C.splice(f,1),C})},E=()=>{switch(s){case 0:return t(hP,{openIssues:c});case 1:return t(dP,{myIssues:u,handleIssue:p});case 2:return t(mP,{pickedIssues:h})}return null};return d(z,{children:[d(le,{title:"Tickets",className:"nitro-mod-tools-tickets",onCloseClick:e,children:[t(en,{children:gP.map((_,I)=>t(Ns,{className:"p-1",isActive:s===I,onClick:C=>n(I),children:_},I))}),t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto text-black",children:t(at,{gap:1,children:t(E,{})})})]}),r&&r.length>0&&r.map(_=>t(uP,{issueId:_,onIssueInfoClosed:m},_))]})},fP=i=>{const{userId:e=null,onCloseClick:s=null}=i,[n,r]=a.useState(null),[o,l]=a.useState(null);return W(fm,c=>{const u=c.getParser();!u||u.data.userId!==e||(l(u.data.username),r(u.data.roomChatlogs))}),a.useEffect(()=>{B(new s_(e))},[e]),t(le,{title:`User Chatlog: ${o||""}`,className:"nitro-mod-tools-chatlog",windowPosition:tt.TOP_LEFT,offsetLeft:260,onCloseClick:s,children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:t(at,{className:"text-black h-100",children:n&&t(fc,{records:n})})})})},_P=i=>{const{onCloseClick:e=null}=i,[s,n]=a.useState(null);return a.useState(!0),t(z,{children:d(le,{title:"Lookup user by ID",className:"nitro-mod-tools",onCloseClick:e,children:[t(V,{skin:4,colour:L.white,position:"relative",children:t("input",{type:"number",className:"ton-input",value:s,onChange:r=>n(r.target.valueAsNumber)})}),t(D,{skin:0,className:"mt-1",onClick:()=>oe(`mod-tools/toggle-user-info/${s}`),disabled:isNaN(s),children:"Lookup"})]})})},Ru=[new ze(1,"Alert",ze.ALERT,1,0),new ze(2,"Mute 1h",ze.MUTE,2,0),new ze(3,"Ban 18h",ze.BAN,3,0),new ze(4,"Ban 7 days",ze.BAN,4,0),new ze(5,"Ban 30 days (step 1)",ze.BAN,5,0),new ze(7,"Ban 30 days (step 2)",ze.BAN,7,0),new ze(6,"Ban 100 years",ze.BAN,6,0),new ze(106,"Ban avatar-only 100 years",ze.BAN,6,0),new ze(101,"Kick",ze.KICK,0,0),new ze(102,"Lock trade 1 week",ze.TRADE_LOCK,0,168),new ze(104,"Lock trade permanent",ze.TRADE_LOCK,0,876e3),new ze(105,"Message",ze.MESSAGE,0,0)],EP=i=>{const{user:e=null,onCloseClick:s=null}=i,[n,r]=a.useState(-1),[o,l]=a.useState(-1),[c,u]=a.useState(""),{cfhCategories:h=null,settings:m=null}=Kr(),{simpleAlert:p=null}=Ke(),E=a.useMemo(()=>{const f=[];if(h&&h.length)for(const S of h)for(const T of S.topics)f.push(T);return f},[h]),_=f=>p(f,fe.DEFAULT,null,null,"Error"),I=()=>{let f=null;const S=E[n];if(n===-1&&(f="You must select a CFH topic"),f)return _(f);const T=c.trim().length===0?g(`help.cfh.topic.${S.id}`):c;B(new d_(e.userId,n,T)),s()},C=()=>{let f=null;const S=E[n],T=Ru[o];if(n===-1||o===-1?f="You must select a CFH topic and Sanction":!m||!m.cfhPermission?f="You do not have permission to do this":S?T||(f="You must select a sanction"):f="You must select a CFH topic",f){_(f);return}const b=c.trim().length===0?g(`help.cfh.topic.${S.id}`):c;switch(T.actionType){case ze.ALERT:{if(!m.alertPermission){_("You have insufficient permissions");return}B(new o_(e.userId,b,S.id));break}case ze.MUTE:B(new c_(e.userId,b,S.id));break;case ze.BAN:{if(!m.banPermission){_("You have insufficient permissions");return}B(new i_(e.userId,b,S.id,o,T.actionId===106));break}case ze.KICK:{if(!m.kickPermission){_("You have insufficient permissions");return}B(new a_(e.userId,b,S.id));break}case ze.TRADE_LOCK:{const y=T.actionLengthHours*60;B(new l_(e.userId,b,y,S.id));break}case ze.MESSAGE:{if(c.trim().length===0){_("Please write a message to user");return}B(new Gl(e.userId,c,S.id));break}}s()};return e?t(le,{title:"Mod Action: "+(e?e.username:""),className:"nitro-mod-tools-user-action",windowPosition:tt.TOP_LEFT,offsetLeft:95,onCloseClick:s,children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:d(at,{className:"text-black",children:[d("select",{className:"ton-carat position-static w-100",value:n,onChange:f=>r(parseInt(f.target.value)),children:[t("option",{value:-1,disabled:!0,children:"CFH Topic"}),E.map((f,S)=>t("option",{value:S,children:g("help.cfh.topic."+f.id)},S))]}),d("select",{className:"ton-carat position-static w-100",value:o,onChange:f=>l(parseInt(f.target.value)),children:[t("option",{value:-1,disabled:!0,children:"Sanction Type"}),Ru.map((f,S)=>t("option",{value:S,children:f.name},S))]}),d(v,{gap:1,children:[t(N,{children:"Optional message type, overrides default"}),t("textarea",{className:"form-control",value:c,onChange:f=>u(f.target.value)})]}),d(R,{justifyContent:"between",gap:1,children:[t(D,{onClick:I,children:"Default Sanction"}),t(D,{skin:1,onClick:C,children:"Sanction"})]})]})})}):null},IP=i=>{const{userId:e=null,onCloseClick:s=null}=i,[n,r]=a.useState(null);return W(Cm,o=>{const l=o.getParser();l.data.userId===e&&r(l.data)}),a.useEffect(()=>{B(new u_(e))},[e]),e?t(le,{title:"User Visits",className:"nitro-mod-tools-user-visits",windowPosition:tt.TOP_LEFT,offsetLeft:95,onCloseClick:s,children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:t(at,{className:"text-black",gap:1,children:d(v,{fullHeight:!0,gap:0,overflow:"hidden",children:[t(v,{gap:2,children:d(pe,{gap:1,className:"text-black border-bottom pb-1",children:[t(P,{className:"g-col-2",children:"Time"}),t(P,{className:"g-col-7",children:"Room name"}),t(P,{className:"g-col-3",children:"Visit"})]})}),t(xi,{rows:(n==null?void 0:n.rooms)??[],estimateSize:25,rowRender:o=>d(pe,{fullHeight:!1,gap:1,alignItems:"center",className:"text-black py-1 border-bottom",children:[d(N,{className:"g-col-2",children:[o.enterHour.toString().padStart(2,"0"),": ",o.enterMinute.toString().padStart(2,"0")]}),t(N,{className:"g-col-7",children:o.roomName}),t(N,{bold:!0,underline:!0,pointer:!0,variant:"primary",className:"g-col-3",onClick:l=>Rs(o.roomId),children:"Visit Room"})]})})]})})})}):null},CP=i=>{const{user:e=null,onCloseClick:s=null}=i,[n,r]=a.useState(""),{simpleAlert:o=null}=Ke();if(!e)return null;const l=()=>{if(n.trim().length===0){o("Please write a message to user.",null,null,null,"Error",null);return}B(new Gl(e.userId,n,-999)),s()};return t(le,{title:"Send Message",className:"nitro-mod-tools-user-message",windowPosition:tt.TOP_LEFT,offsetLeft:95,onCloseClick:()=>s(),children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:d(at,{className:"text-black",children:[d(N,{children:["Message To: ",e.username]}),t("textarea",{className:"form-control",value:n,onChange:c=>r(c.target.value)}),t(D,{fullWidth:!0,onClick:l,children:"Send message"})]})})})},SP=i=>{const{onCloseClick:e=null,userId:s=null}=i,[n,r]=a.useState(null),[o,l]=a.useState(!1),[c,u]=a.useState(!1),[h,m]=a.useState(!1),p=a.useMemo(()=>n?[{localeKey:"modtools.userinfo.userName",value:n.userName,showOnline:!0},{localeKey:"modtools.userinfo.cfhCount",value:n.cfhCount.toString()},{localeKey:"modtools.userinfo.abusiveCfhCount",value:n.abusiveCfhCount.toString()},{localeKey:"modtools.userinfo.cautionCount",value:n.cautionCount.toString()},{localeKey:"modtools.userinfo.banCount",value:n.banCount.toString()},{localeKey:"modtools.userinfo.lastSanctionTime",value:n.lastSanctionTime},{localeKey:"modtools.userinfo.tradingLockCount",value:n.tradingLockCount.toString()},{localeKey:"modtools.userinfo.tradingExpiryDate",value:n.tradingExpiryDate},{localeKey:"modtools.userinfo.minutesSinceLastLogin",value:Xs.format(n.minutesSinceLastLogin*60,".ago",2)},{localeKey:"modtools.userinfo.lastPurchaseDate",value:n.lastPurchaseDate},{localeKey:"modtools.userinfo.primaryEmailAddress",value:n.primaryEmailAddress},{localeKey:"modtools.userinfo.identityRelatedBanCount",value:n.identityRelatedBanCount.toString()},{localeKey:"modtools.userinfo.registrationAgeInMinutes",value:Xs.format(n.registrationAgeInMinutes*60,".ago",2)}]:null,[n]);return W(Em,E=>{const _=E.getParser();!_||_.data.userId!==s||r(_.data)}),a.useEffect(()=>{B(new r_(s))},[s]),n?d(z,{children:[t(le,{title:g("modtools.userinfo.title",["username"],[n.userName]),className:"nitro-mod-tools-user",windowPosition:tt.TOP_LEFT,offsetLeft:260,onCloseClick:()=>e(),children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:d(pe,{overflow:"hidden",children:[t(v,{size:8,overflow:"auto",children:t("table",{className:"table table-striped table-sm table-text-small text-black m-0",children:t("tbody",{children:p.map((E,_)=>d("tr",{children:[t("th",{scope:"row",children:g(E.localeKey)}),d("td",{children:[E.value,E.showOnline&&t("i",{className:`icon icon-pf-${n.online?"online":"offline"} ms-2`})]})]},_))})})}),d(v,{size:4,gap:1,children:[t(D,{onClick:E=>oe(`mod-tools/open-user-chatlog/${s}`),children:"Room Chat"}),t(D,{onClick:E=>l(!o),children:"Send Message"}),t(D,{onClick:E=>m(!h),children:"Room Visits"}),t(D,{onClick:E=>u(!c),children:"Mod Action"})]})]})})}),o&&t(CP,{user:{userId:s,username:n.userName},onCloseClick:()=>l(!1)}),c&&t(EP,{user:{userId:s,username:n.userName},onCloseClick:()=>u(!1)}),h&&t(IP,{userId:s,onCloseClick:()=>m(!1)})]}):null},TP=i=>{const[e,s]=a.useState(!0),[n,r]=a.useState(-1),[o,l]=a.useState(null),[c,u]=a.useState(!1),{openRooms:h=[],openRoomChatlogs:m=[],openUserChatlogs:p=[],openUserInfos:E=[],openRoomInfo:_=null,closeRoomInfo:I=null,toggleRoomInfo:C=null,openRoomChatlog:f=null,closeRoomChatlog:S=null,toggleRoomChatlog:T=null,openUserInfo:b=null,closeUserInfo:y=null,toggleUserInfo:w=null,openUserChatlog:O=null,closeUserChatlog:F=null,toggleUserChatlog:U=null,openIssues:j}=Kr(),x=J().isModerator,[M,G]=a.useState(!0),[H,Y]=a.useState(!1),q=a.useRef(null),[Z,ce]=a.useState(!1);return ke([Jt.INITIALIZED,Jt.DISPOSED],se=>{if(!Tr.isRoomPreviewerId(se.roomId))switch(se.type){case Jt.INITIALIZED:r(se.roomId);return;case Jt.DISPOSED:r(-1);return}}),ic(se=>{if(se.category!==re.UNIT)return;const ye=Pe();if(!ye)return;const me=ye.userDataManager.getUserDataByIndex(se.id);!me||me.type!==vt.USER||(G(!1),l({userId:me.webID,username:me.name}))}),XE(se=>{G(!0)}),a.useEffect(()=>{const se={linkReceived:ye=>{const me=ye.split("/");if(!(me.length<2))switch(me[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(lt=>!lt);return;case"open-room-info":_(Number(me[2]));return;case"close-room-info":I(Number(me[2]));return;case"toggle-room-info":C(Number(me[2]));return;case"open-room-chatlog":f(Number(me[2]));return;case"close-room-chatlog":S(Number(me[2]));return;case"toggle-room-chatlog":T(Number(me[2]));return;case"open-user-info":b(Number(me[2]));return;case"close-user-info":y(Number(me[2]));return;case"toggle-user-info":w(Number(me[2]));return;case"open-user-chatlog":O(Number(me[2]));return;case"close-user-chatlog":F(Number(me[2]));return;case"toggle-user-chatlog":U(Number(me[2]));return}},eventUrlPrefix:"mod-tools/"};return dt(se),()=>ht(se)},[_,I,C,f,S,T,b,y,w,O,F,U]),d(z,{children:[e&&x&&t(le,{title:"Mod Tools",className:"nitro-mod-tools",offsetLeft:80,windowPosition:tt.TOP_LEFT,onCloseClick:se=>s(!1),innerRef:q,children:d(R,{gap:1,column:!0,children:[!Z&&d(z,{children:[t(D,{onClick:se=>oe(`mod-tools/toggle-room-info/${n}`),disabled:n<=0,className:"position-relative",children:"Room Tool"}),t(D,{onClick:se=>oe(`mod-tools/toggle-room-chatlog/${n}`),disabled:n<=0,className:"position-relative",children:" Chatlog Tool"}),!M&&d(D,{onClick:()=>oe(`mod-tools/toggle-user-info/${o.userId}`),disabled:!o,className:"position-relative",children:["User: ",o?o.username:""]}),M&&t(D,{onClick:()=>Y(!0),className:"position-relative",children:"Lookup user"}),d(D,{onClick:()=>u(se=>!se),className:"position-relative",children:["Report Tool",j.length>0&&t(qn,{count:j.length,className:"my-auto me-1",unset:!0})]})]}),t(J0,{enabled:Z}),H&&t(_P,{onCloseClick:()=>Y(!1)}),t(D,{skin:1,onClick:se=>ce(!Z),className:"position-relative",children:g(`modtool.${Z?"mod":"admin"}`)})]})}),h.length>0&&h.map(se=>t(lP,{roomId:se,onCloseClick:()=>oe(`mod-tools/close-room-info/${se}`)},se)),m.length>0&&m.map(se=>t(aP,{roomId:se,onCloseClick:()=>oe(`mod-tools/close-room-chatlog/${se}`)},se)),E.length>0&&E.map(se=>t(SP,{userId:se,onCloseClick:()=>oe(`mod-tools/close-user-info/${se}`)},se)),p.length>0&&p.map(se=>t(fP,{userId:se,onCloseClick:()=>oe(`mod-tools/close-user-chatlog/${se}`)},se)),c&&t(pP,{onCloseClick:()=>u(!1)}),t(iP,{})]})},NP=[We.START_DOORBELL,We.STATE_WAITING,We.STATE_NO_ANSWER,We.START_PASSWORD,We.STATE_WRONG_PASSWORD],RP=[We.START_DOORBELL,We.STATE_WAITING,We.STATE_NO_ANSWER],vP=i=>{const[e,s]=a.useState(""),{doorData:n=null,setDoorData:r=null}=Bs(),o=()=>{n&&n.state===We.STATE_WAITING&&tl(),r(null)},l=()=>{!n||!n.roomInfo||(rr(n.roomInfo.roomId),r(h=>{const m={...h};return m.state=We.STATE_PENDING_SERVER,m}))},c=()=>{!n||!n.roomInfo||(rr(n.roomInfo.roomId,e),r(h=>{const m={...h};return m.state=We.STATE_PENDING_SERVER,m}))};if(a.useEffect(()=>{!n||n.state!==We.STATE_NO_ANSWER||tl()},[n]),!n||n.state===We.NONE||NP.indexOf(n.state)===-1)return null;const u=RP.indexOf(n.state)>=0;return t(le,{title:g(u?"navigator.doorbell.title":"navigator.password.title"),className:"nitro-navigator-doorbell no-resize",onCloseClick:o,children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:d(at,{children:[d(v,{gap:1,children:[t(N,{bold:!0,children:n&&n.roomInfo&&n.roomInfo.roomName}),n.state===We.START_DOORBELL&&t(N,{children:g("navigator.doorbell.info")}),n.state===We.STATE_WAITING&&t(N,{children:g("navigator.doorbell.waiting")}),n.state===We.STATE_NO_ANSWER&&t(N,{children:g("navigator.doorbell.no.answer")}),n.state===We.START_PASSWORD&&t(N,{children:g("navigator.password.info")}),n.state===We.STATE_WRONG_PASSWORD&&t(N,{children:g("navigator.password.retryinfo")})]}),u&&t(v,{gap:1,children:d(R,{gap:1,className:"justify-content-between",children:[t(D,{onClick:o,children:g("generic.cancel")}),n.state===We.START_DOORBELL&&t(D,{onClick:l,children:g("navigator.doorbell.button.ring")})]})}),!u&&d(z,{children:[d(v,{gap:1,children:[t(N,{children:g("navigator.password.enter")}),t(V,{skin:0,colour:L.white,position:"relative",children:t("input",{type:"password",className:"ton-input",onChange:h=>s(h.target.value)})})]}),t(v,{gap:1,children:d(R,{gap:1,className:"justify-content-between",children:[t(D,{onClick:o,children:g("generic.cancel")}),t(D,{onClick:c,children:g("navigator.password.button.try")})]})})]})]})})})},bP=i=>{const{itemImage:e=void 0,itemColor:s=void 0,itemActive:n=!1,itemCount:r=1,itemCountMinimum:o=1,itemUniqueSoldout:l=!1,itemUniqueNumber:c=-2,itemUnseen:u=!1,itemHighlight:h=!1,disabled:m=!1,center:p=!0,column:E=!0,style:_={},classNames:I=[],position:C="relative",overflow:f="hidden",children:S=null,...T}=i,b=a.useMemo(()=>{const w=["room-creator-grid-item"];return n&&w.push("active"),(l||c>0)&&w.push("unique-item"),l&&w.push("sold-out"),u&&w.push("unseen"),h&&w.push("has-highlight"),m&&w.push("disabled"),e===null&&w.push("icon","loading-icon"),I.length&&w.push(...I),w},[n,l,c,u,h,m,e,I]),y=a.useMemo(()=>{let w={..._};return e&&!(l||c>0)&&(w.backgroundImage=`url(${e})`),s&&(w.backgroundColor=s),Object.keys(_).length&&(w={...w,..._}),w},[_,e,s,l,c]);return d(v,{center:p,pointer:!0,position:C,overflow:f,column:E,style:y,classNames:b,...T,children:[r>o&&t(Do,{count:r}),c>0&&d(z,{children:[t(P,{fit:!0,className:"unique-bg-override",style:{backgroundImage:`url(${e})`}}),t("div",{className:"position-absolute bottom-0 unique-item-counter",children:t(lr,{value:c})})]}),S]})},OP=i=>{const[e,s]=a.useState(null),[n,r]=a.useState(null),[o,l]=a.useState(null),[c,u]=a.useState(null),[h,m]=a.useState(null),[p,E]=a.useState(0),[_,I]=a.useState([]),[C,f]=a.useState(""),{categories:S=null}=Bs(),T=ee("hc.disabled",!1),b=O=>ee("images.url")+`/navigator/models/model_${O}.png`,y=(O,F)=>{!O||O.clubLevel>gs()||f(_[F].name)},w=()=>{B(new Jp(n,o,"model_"+C,Number(c),Number(h),p))};return a.useEffect(()=>{if(!e){const O=[];for(let F=10;F<=100;F=F+10)O.push(F);s(O),m(O[0])}},[e]),a.useEffect(()=>{S&&S.length&&u(S[0].id)},[S]),a.useEffect(()=>{const O=ee("navigator.room.models");O&&O.length&&(I(O),f(O[0].name))},[]),d(le,{skin:6,overflow:"unset",colour:L.lighter_yellow,className:"ton-room-creator",title:" ",onCloseClick:O=>oe("navigator/close-creator"),children:[d(v,{overflow:"hidden",className:"p-4",children:[d(pe,{overflow:"hidden",children:[d(v,{size:6,gap:1,overflow:"auto",children:[d(v,{gap:1,children:[t(N,{variant:"none",children:g("navigator.createroom.roomnameinfo")}),t("input",{type:"text",className:"room-creator-form",maxLength:60,onChange:O=>r(O.target.value),placeholder:g("navigator.createroom.roomnameinfo")})]}),d(v,{grow:!0,gap:1,children:[t(N,{variant:"none",children:g("navigator.createroom.roomdescinfo")}),t("textarea",{className:"flex-grow-1 room-creator-form w-100",maxLength:255,onChange:O=>l(O.target.value),placeholder:g("navigator.createroom.roomdescinfo")})]}),d(v,{gap:1,children:[t(N,{variant:"none",children:g("navigator.category")}),t("select",{className:"room-creator-form-select",onChange:O=>u(Number(O.target.value)),children:S&&S.length>0&&S.map(O=>t("option",{value:O.id,children:g(O.name)},O.id))})]}),d(v,{gap:1,children:[t(N,{variant:"none",children:g("navigator.maxvisitors")}),t("select",{className:"room-creator-form-select",onChange:O=>m(Number(O.target.value)),children:e&&e.map(O=>t("option",{value:O,children:O},O))})]}),d(v,{gap:1,children:[t(N,{variant:"none",children:g("navigator.tradesettings")}),d("select",{className:"room-creator-form-select",onChange:O=>E(Number(O.target.value)),children:[t("option",{value:"0",children:g("navigator.roomsettings.trade_not_allowed")}),t("option",{value:"1",children:g("navigator.roomsettings.trade_not_with_Controller")}),t("option",{value:"2",children:g("navigator.roomsettings.trade_allowed")})]})]})]}),t(v,{size:6,gap:1,overflow:"auto",className:"p-1",children:_.map((O,F)=>d(bP,{fullHeight:!0,onClick:()=>y(O,F),itemActive:C===O.name,overflow:"unset",gap:0,className:"p-1",disabled:gs()<O.clubLevel,children:[t(R,{fullHeight:!0,center:!0,overflow:"hidden",children:t("img",{alt:"",src:b(O.name)})}),d(N,{variant:"none",children:[O.tileSize," ",g("navigator.createroom.tilesize")]}),!T&&O.clubLevel>ls.NO_CLUB&&t(wt,{position:"absolute",className:"top-1 end-1",type:"hc"}),C===O.name&&t(P,{className:"icon-checked bottom-1 end-1 position-absolute"})]},O.name))})]}),t(D,{fullWidth:!0,onClick:w,disabled:!n||n.length<3,children:g("navigator.createroom.create")})]}),t(P,{className:"tube"})]})},wP=i=>{const{onCloseClick:e=null}=i,[s,n]=a.useState(!1),[r,o]=a.useState(!1),{navigatorData:l=null}=Bs();a.useRef();const c=h=>{switch(h){case"settings":return J().userId===l.enteredGuestRoom.ownerId||J().isModerator;case"staff_pick":return J().securityLevel>=Ja.COMMUNITY;default:return!1}},u=(h,m)=>{if(!(!l||!l.enteredGuestRoom))switch(h){case"set_home_room":let p=-1;l.homeRoomId!==l.enteredGuestRoom.roomId&&(p=l.enteredGuestRoom.roomId),p>0&&B(new sf(p));return;case"navigator_search_tag":return;case"open_room_thumbnail_camera":At(new Ys(Ys.TOGGLE_THUMBNAIL));return;case"open_group_info":Uo(l.enteredGuestRoom.habboGroupId);return;case"toggle_room_link":oe("navigator/toggle-room-link");return;case"open_room_settings":B(new Ml(l.enteredGuestRoom.roomId));return;case"toggle_pick":n(E=>!E),B(new tf(l.enteredGuestRoom.roomId));return;case"toggle_mute":o(E=>!E),B(new Hf);return;case"room_filter":B(new nf(l.enteredGuestRoom.roomId));return;case"open_floorplan_editor":oe("floor-editor/toggle");return;case"close":e();return}};return a.useEffect(()=>{l&&(n(l.currentRoomIsStaffPick),l.enteredGuestRoom&&o(l.enteredGuestRoom.allInRoomMuted))},[l]),a.useMemo(()=>{let h=document.getElementById("purse-view"),m=document.getElementById("notifications-confirms");return!h||!h||!l?{x:0,y:0}:{x:-(h.offsetWidth+7),y:m.offsetHeight}},[l]),l.enteredGuestRoom?t(le,{title:g("navigator.roomsettings.roominfo"),className:"nitro-room-info",onCloseClick:()=>u("close"),children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 w-100 overflow-auto",children:l.enteredGuestRoom&&d(v,{gap:1,children:[d(R,{gap:2,overflow:"hidden",children:[t(Ki,{roomId:l.enteredGuestRoom.roomId,customUrl:l.enteredGuestRoom.officialRoomPicRef,children:c("settings")&&t("i",{className:"icon icon-camera-small position-absolute top-1 end-1 cursor-pointer",onClick:()=>u("open_room_thumbnail_camera")})}),d(v,{grow:!0,gap:1,overflow:"hidden",children:[d(R,{gap:1,children:[d(v,{grow:!0,gap:1,children:[d(R,{gap:1,children:[t("i",{onClick:()=>u("set_home_room"),className:Vr("flex-shrink-0 icon icon-house-small cursor-pointer",l.homeRoomId!==l.enteredGuestRoom.roomId&&"gray")}),t(N,{bold:!0,children:l.enteredGuestRoom.roomName})]}),l.enteredGuestRoom.showOwner&&d(R,{alignItems:"center",gap:1,children:[t(N,{variant:"muted",children:g("navigator.roomownercaption")}),d(R,{alignItems:"center",gap:1,children:[t(bs,{userId:l.enteredGuestRoom.ownerId}),t(N,{children:l.enteredGuestRoom.ownerName})]})]}),d(R,{alignItems:"center",gap:1,children:[t(N,{variant:"muted",children:g("navigator.roomrating")}),t(N,{children:l.currentRoomRating})]}),l.enteredGuestRoom.tags.length>0&&t(R,{alignItems:"center",gap:1,children:l.enteredGuestRoom.tags.map(h=>d(N,{pointer:!0,className:"bg-muted p-1",onClick:m=>u("navigator_search_tag"),children:["#",h]},h))})]}),t(v,{alignItems:"center",gap:1,children:c("settings")&&t("i",{className:"icon icon-cog cursor-pointer",title:g("navigator.room.popup.info.room.settings"),onClick:h=>u("open_room_settings")})})]}),t(N,{overflow:"auto",style:{maxHeight:50},children:l.enteredGuestRoom.description}),l.enteredGuestRoom.habboGroupId>0&&d(R,{pointer:!0,alignItems:"center",gap:1,onClick:()=>u("open_group_info"),children:[t(ot,{className:"flex-none",badgeCode:l.enteredGuestRoom.groupBadgeCode,isGroup:!0}),t(N,{underline:!0,children:g("navigator.guildbase",["groupName"],[l.enteredGuestRoom.groupName])})]})]})]}),d(v,{gap:1,children:[c("staff_pick")&&t(D,{skin:6,colour:L.maintenance_orange,onClick:()=>u("toggle_pick"),children:g(s?"navigator.staffpicks.unpick":"navigator.staffpicks.pick")}),t(D,{disabled:!0,skin:5,children:g("help.emergency.main.report.room")}),c("settings")&&d(z,{children:[t(D,{skin:r?5:6,colour:r?L.message_light_blue:L.maintenance_orange,onClick:()=>u("toggle_mute"),children:g(r?"navigator.muteall_on":"navigator.muteall_off")}),t(D,{skin:5,onClick:()=>u("room_filter"),children:g("navigator.roomsettings.roomfilter")}),t(D,{skin:5,onClick:()=>u("open_floorplan_editor"),children:g("open.floor.plan.editor")})]})]})]})})}):null},yP=i=>{const{onCloseClick:e=null}=i,{navigatorData:s=null}=Bs();return s.enteredGuestRoom?t(le,{title:g("navigator.embed.title"),className:"nitro-room-link",onCloseClick:e,children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:t(at,{className:"text-black d-flex align-items-center",children:d(R,{gap:2,children:[t(Ki,{roomId:s.enteredGuestRoom.roomId,customUrl:s.enteredGuestRoom.officialRoomPicRef}),d(v,{children:[t(N,{bold:!0,fontSize:5,children:g("navigator.embed.headline")}),t(N,{children:g("navigator.embed.info")}),t("input",{type:"text",readOnly:!0,className:"form-control ",value:g("navigator.embed.src",["roomId"],[s.enteredGuestRoom.roomId.toString()]).replace("${url.prefix}",ee("url.prefix",""))})]})]})})})}):null},AP=i=>{const{roomData:e=null,handleChange:s=null}=i,[n,r]=a.useState(""),[o,l]=a.useState(""),[c,u]=a.useState(!1),h=J().isModerator,m=()=>{!c||n.length<=0||o.length<=0||n!==o||s("password",n)};return a.useEffect(()=>{r(""),l(""),u(!1)},[e]),d(v,{gap:3,children:[d(v,{gap:1,children:[t(N,{bold:!0,children:g("navigator.roomsettings.roomaccess.caption")}),t(N,{children:g("navigator.roomsettings.roomaccess.info")})]}),d(v,{overflow:"auto",gap:4,children:[d(v,{gap:1,children:[t(N,{bold:!0,children:g("navigator.roomsettings.doormode")}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"radio",name:"lockState",checked:e.lockState===pt.OPEN_STATE&&!c,onChange:p=>s("lock_state",pt.OPEN_STATE)}),t(N,{children:g("navigator.roomsettings.doormode.open")})]}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"radio",name:"lockState",checked:e.lockState===pt.DOORBELL_STATE&&!c,onChange:p=>s("lock_state",pt.DOORBELL_STATE)}),t(N,{children:g("navigator.roomsettings.doormode.doorbell")})]}),h&&d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"radio",name:"lockState",checked:e.lockState===pt.INVISIBLE_STATE&&!c,onChange:p=>s("lock_state",pt.INVISIBLE_STATE)}),t(N,{children:g("navigator.roomsettings.doormode.invisible")})]}),d(R,{fullWidth:!0,gap:1,children:[t("input",{className:"ton-form-check-input",type:"radio",name:"lockState",checked:e.lockState===pt.PASSWORD_STATE||c,onChange:p=>u(p.target.checked)}),!c&&e.lockState!==pt.PASSWORD_STATE&&t(N,{children:g("navigator.roomsettings.doormode.password")}),(c||e.lockState===pt.PASSWORD_STATE)&&d(v,{gap:1,children:[t(N,{children:g("navigator.roomsettings.doormode.password")}),t(V,{skin:4,colour:L.lighter_grey,position:"relative",children:t("input",{type:"password",className:"ton-input",value:n,onChange:p=>r(p.target.value),placeholder:g("navigator.roomsettings.password"),onFocus:p=>u(!0)})}),c&&n.length<=0&&t(N,{bold:!0,variant:"danger",children:g("navigator.roomsettings.passwordismandatory")}),t(V,{skin:4,colour:L.lighter_grey,position:"relative",children:t("input",{type:"password",className:"ton-input",value:o,onChange:p=>l(p.target.value),onBlur:m,placeholder:g("navigator.roomsettings.passwordconfirm")})}),c&&n.length>0&&n!==o&&t(N,{bold:!0,variant:"danger",children:g("navigator.roomsettings.invalidconfirm")})]})]})]}),d(v,{gap:1,children:[t(N,{bold:!0,children:g("navigator.roomsettings.pets")}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",checked:e.allowPets,onChange:p=>s("allow_pets",p.target.checked)}),t(N,{children:g("navigator.roomsettings.allowpets")})]}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",checked:e.allowPetsEat,onChange:p=>s("allow_pets_eat",p.target.checked)}),t(N,{children:g("navigator.roomsettings.allowfoodconsume")})]})]})]})]})},vu=3,bu=60,Ou=255,kP=i=>{const{roomData:e=null,handleChange:s=null,onClose:n=null}=i,[r,o]=a.useState(""),[l,c]=a.useState(""),{showConfirm:u=null}=Ke(),{categories:h=null}=Bs(),m=()=>{u(g("navigator.roomsettings.deleteroom.confirm.message",["room_name"],[e.roomName]),()=>{B(new Nf(e.roomId)),n&&n(),oe("navigator/search/myworld_view")},null,null,null,g("navigator.roomsettings.deleteroom.confirm.title"))},p=()=>{r===e.roomName||r.length<vu||r.length>bu||s("name",r)},E=()=>{l===e.roomDescription||l.length>Ou||s("description",l)};a.useEffect(()=>{o(e.roomName),c(e.roomDescription)},[e]);const _=()=>{let f=[];for(let S of h)f.push({index:S.id,value:S.id,caption:g(S.name)});return f},I=()=>{let f=[];for(let S of dA)f.push({index:S,value:S.toString(),caption:S.toString()});return f},C=()=>[{index:0,value:"0",caption:g("navigator.roomsettings.trade_not_allowed")},{index:1,value:"1",caption:g("navigator.roomsettings.trade_not_with_Controller")},{index:2,value:"2",caption:g("navigator.roomsettings.trade_allowed")}];return d(z,{children:[d(v,{gap:1,children:[t(N,{className:"volter-bold",children:g("navigator.roomname")}),d(v,{fullWidth:!0,gap:0,children:[t("input",{className:"ton-input black-border",value:r,maxLength:bu,onChange:f=>o(f.target.value),onBlur:p}),r.length<vu&&t(N,{bold:!0,variant:"danger",children:g("navigator.roomsettings.roomnameismandatory")})]})]}),d(v,{gap:1,children:[t(N,{className:"volter-bold",children:g("navigator.roomsettings.desc")}),t("textarea",{className:"ton-input w-100 black-border",value:l,maxLength:Ou,onChange:f=>c(f.target.value),onBlur:E})]}),d(v,{gap:1,className:"mt-2",children:[t(N,{className:"volter-bold",children:g("navigator.category")}),t(es,{options:_(),selectedIndex:e.categoryId,changeIndex:f=>s("category",f),fullWidth:!0})]}),d(v,{gap:1,children:[t(N,{className:"volter-bold",children:g("navigator.maxvisitors")}),t(es,{options:I(),selectedIndex:e.userCount,changeIndex:f=>s("max_visitors",f),fullWidth:!0})]}),d(v,{gap:1,children:[t(N,{className:"volter-bold",children:g("navigator.tradesettings")}),t(es,{options:C(),selectedIndex:e.tradeState,changeIndex:f=>s("trade_state",f),fullWidth:!0})]}),d(R,{alignItems:"center",gap:1,children:[t(P,{className:"volter-bold"}),t("input",{className:"ton-form-check-input",type:"checkbox",checked:e.allowWalkthrough,onChange:f=>s("allow_walkthrough",f.target.checked)}),t(N,{children:g("navigator.roomsettings.allow_walk_through")})]}),t(D,{skin:6,className:"mt-auto mb-auto",colour:L.primary_red,onClick:m,children:g("navigator.roomsettings.delete")})]})},MP=i=>{var u;const{roomData:e=null,handleChange:s=null}=i,[n,r]=a.useState(-1),[o,l]=a.useState([]),c=h=>{l(m=>{const p=[...m],E=p.findIndex(_=>_.userId===h);return E>=0&&p.splice(E,1),p}),B(new If(h,e.roomId)),r(-1)};return W(lg,h=>{const m=h.getParser();!e||e.roomId!==m.roomId||l(m.bannedUsers)}),a.useEffect(()=>{B(new Ul(e.roomId))},[e.roomId]),d(v,{gap:2,fit:!0,overflow:"hidden",children:[t(N,{children:g("navigator.roomsettings.moderation.header")}),d(v,{gap:3,fullHeight:!0,children:[d(v,{gap:1,children:[t(N,{bold:!0,children:g("navigator.roomsettings.moderation.mute.header")}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",checked:e.moderationSettings.allowMute===Qt.MODERATION_LEVEL_USER_WITH_RIGHTS,onChange:h=>s("moderation_mute",h.target.checked?Qt.MODERATION_LEVEL_USER_WITH_RIGHTS:Qt.MODERATION_LEVEL_NONE)}),t(N,{children:g("navigator.roomsettings.moderation.rights")})]})]}),d(v,{gap:1,children:[t(N,{bold:!0,children:g("navigator.roomsettings.moderation.kick.header")}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",checked:e.moderationSettings.allowKick===Qt.MODERATION_LEVEL_ALL,onChange:h=>s("moderation_kick",h.target.checked?Qt.MODERATION_LEVEL_ALL:Qt.MODERATION_LEVEL_NONE)}),t(N,{children:g("navigator.roomsettings.moderation.all")})]}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",checked:e.moderationSettings.allowKick>=Qt.MODERATION_LEVEL_USER_WITH_RIGHTS,disabled:e.moderationSettings.allowKick===Qt.MODERATION_LEVEL_ALL,onChange:h=>s("moderation_kick",h.target.checked?Qt.MODERATION_LEVEL_USER_WITH_RIGHTS:Qt.MODERATION_LEVEL_NONE)}),t(N,{children:g("navigator.roomsettings.moderation.rights")})]})]}),d(v,{gap:1,children:[t(N,{bold:!0,children:g("navigator.roomsettings.moderation.ban.header")}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",checked:e.moderationSettings.allowBan===Qt.MODERATION_LEVEL_USER_WITH_RIGHTS,onChange:h=>s("moderation_ban",h.target.checked?Qt.MODERATION_LEVEL_USER_WITH_RIGHTS:Qt.MODERATION_LEVEL_NONE)}),t(N,{children:g("navigator.roomsettings.moderation.rights")})]})]})]}),d(v,{size:6,overflow:"hidden",fullHeight:!0,fullWidth:!0,children:[d(N,{bold:!0,children:[g("navigator.roomsettings.moderation.banned.users")," (",o.length,")"]}),t(V,{colour:L.light_grey,overflow:"hidden",className:"bg-white list-container p-2",children:t(v,{fullWidth:!0,overflow:"auto",gap:1,children:o&&o.length>0&&o.map((h,m)=>d(R,{shrink:!0,alignItems:"center",gap:1,overflow:"hidden",children:[t(bs,{userName:h.userName}),d(N,{pointer:!0,grow:!0,onClick:p=>r(h.userId),children:[" ",h.userName]})]},m))})}),d(D,{disabled:n<=0,onClick:h=>c(n),children:[g("navigator.roomsettings.moderation.unban")," ",n>0&&((u=o.find(h=>h.userId===n))==null?void 0:u.userName)]})]})]})},UP=i=>{const{roomData:e=null}=i,[s,n]=a.useState(new Map),[r,o]=a.useState(""),{friends:l=null}=ns();W(og,h=>{const m=h.getParser();!e||e.roomId!==m.roomId||n(m.users)}),W(ig,h=>{const m=h.getParser();!e||e.roomId!==m.roomId||n(p=>{const E=new Map(p);return E.set(m.data.userId,m.data.userName),E})}),W(ag,h=>{const m=h.getParser();!e||e.roomId!==m.roomId||n(p=>{const E=new Map(p);return E.delete(m.userId),E})}),a.useEffect(()=>{B(new vf(e.roomId))},[e.roomId]);const c=a.useMemo(()=>Array.from(s.entries()).filter(([h,m])=>r?m.toString().toLowerCase().includes(r.toLowerCase()):!0),[s,r]),u=a.useMemo(()=>{const h=m=>{let p=!1;for(let E of s.keys())E==m&&(p=!0);return p};return l.filter(m=>r?!h(m.id)&&m.name.toLowerCase().includes(r.toLowerCase()):!h(m.id))},[l,s,r]);return d(v,{gap:1,overflow:"hidden",fullHeight:!0,children:[d(R,{column:!1,alignItems:"center",gap:2,children:[t(N,{className:"volter-bold",children:g("navigator.flatctrls.filter")}),t("input",{type:"text",className:"ton-input black-border",value:r,onChange:h=>o(h.target.value)})]}),d(pe,{fullHeight:!0,overflow:"hidden",children:[d(v,{size:6,fullHeight:!0,overflow:"hidden",children:[t(N,{bold:!0,children:g("navigator.flatctrls.userswithrights",["displayed","total"],[s.size.toString(),s.size.toString()])}),d(V,{colour:L.light_grey,overflow:"hidden",fullHeight:!0,gap:2,children:[t(v,{fullWidth:!0,overflow:"auto",gap:2,className:"overflow-y-auto",children:c.map(([h,m],p)=>d(R,{shrink:!0,alignItems:"center",gap:1,overflow:"hidden",children:[t(bs,{userName:m}),d(N,{pointer:!0,grow:!0,onClick:E=>B(new Sf(h)),children:[" ",m]})]},p))}),t(D,{skin:5,className:"mt-auto",disabled:!s.size,onClick:h=>B(new Tf(e.roomId)),children:g("navigator.flatctrls.clear")})]})]}),d(v,{size:6,justifyContent:"end",fullHeight:!0,overflow:"hidden",children:[t(N,{bold:!0,children:g("navigator.flatctrls.friends",["displayed","total"],[u.length.toString(),l.length.toString()])}),t(V,{colour:L.light_grey,overflow:"hidden",fullHeight:!0,children:t(v,{fullWidth:!0,className:"overflow-y-auto",gap:2,children:u&&u.map((h,m)=>d(R,{fullWidth:!0,shrink:!0,alignItems:"center",gap:1,overflow:"hidden",onClick:p=>B(new Cf(h.id)),children:[t(bs,{userName:h.name}),d(N,{pointer:!0,grow:!0,children:[" ",h.name]})]},m))})})]})]})]})},LP=[{index:Ze.CHAT_MODE_FREE_FLOW,value:Ze.CHAT_MODE_FREE_FLOW.toString(),caption:"navigator.roomsettings.chat.mode.free.flow"},{index:Ze.CHAT_MODE_LINE_BY_LINE,value:Ze.CHAT_MODE_LINE_BY_LINE.toString(),caption:"navigator.roomsettings.chat.mode.line.by.line"}],PP=[{index:Ze.CHAT_BUBBLE_WIDTH_NORMAL,value:Ze.CHAT_BUBBLE_WIDTH_NORMAL.toString(),caption:"navigator.roomsettings.chat.bubbles.width.normal"},{index:Ze.CHAT_BUBBLE_WIDTH_THIN,value:Ze.CHAT_BUBBLE_WIDTH_THIN.toString(),caption:"navigator.roomsettings.chat.bubbles.width.thin"},{index:Ze.CHAT_BUBBLE_WIDTH_WIDE,value:Ze.CHAT_BUBBLE_WIDTH_WIDE.toString(),caption:"navigator.roomsettings.chat.bubbles.width.wide"}],DP=[{index:Ze.CHAT_SCROLL_SPEED_FAST,value:Ze.CHAT_SCROLL_SPEED_FAST.toString(),caption:"navigator.roomsettings.chat.speed.fast"},{index:Ze.CHAT_SCROLL_SPEED_NORMAL,value:Ze.CHAT_SCROLL_SPEED_NORMAL.toString(),caption:"navigator.roomsettings.chat.speed.normal"},{index:Ze.CHAT_SCROLL_SPEED_SLOW,value:Ze.CHAT_SCROLL_SPEED_SLOW.toString(),caption:"navigator.roomsettings.chat.speed.slow"}],FP=[{index:Ze.FLOOD_FILTER_LOOSE,value:Ze.FLOOD_FILTER_LOOSE.toString(),caption:"navigator.roomsettings.chat.flood.loose"},{index:Ze.FLOOD_FILTER_NORMAL,value:Ze.FLOOD_FILTER_NORMAL.toString(),caption:"navigator.roomsettings.chat.flood.normal"},{index:Ze.FLOOD_FILTER_STRICT,value:Ze.FLOOD_FILTER_STRICT.toString(),caption:"navigator.roomsettings.chat.flood.strict"}],xP=[{index:0,value:"0",caption:"navigator.roomsettings.wall_thickness.normal"},{index:1,value:"1",caption:"navigator.roomsettings.wall_thickness.thick"},{index:-1,value:"-1",caption:"navigator.roomsettings.wall_thickness.thin"},{index:-2,value:"-2",caption:"navigator.roomsettings.wall_thickness.thinnest"}],GP=[{index:0,value:"0",caption:"navigator.roomsettings.floor_thickness.normal"},{index:1,value:"1",caption:"navigator.roomsettings.floor_thickness.thick"},{index:-1,value:"-1",caption:"navigator.roomsettings.floor_thickness.thin"},{index:-2,value:"-2",caption:"navigator.roomsettings.floor_thickness.thinnest"}],BP=i=>{const{roomData:e=null,handleChange:s=null}=i,[n,r]=a.useState(0);return a.useEffect(()=>{r(e.chatSettings.distance)},[e.chatSettings]),d(v,{gap:2,children:[d(v,{gap:1,children:[t(N,{className:"volter-bold",children:g("navigator.roomsettings.vip.caption")}),t(N,{children:g("navigator.roomsettings.vip.info")})]}),d(v,{size:6,gap:1,fullWidth:!0,children:[t(N,{className:"volter-bold",children:g("navigator.roomsettings.vip_settings")}),d(R,{alignItems:"center",gap:0,children:[t("input",{className:"ton-form-check-input",type:"checkbox",checked:e.hideWalls,onChange:o=>s("hide_walls",o.target.checked)}),t(N,{className:"p-1",children:g("navigator.roomsettings.hide_walls")})]}),t(es,{options:xP,selectedIndex:e.wallThickness,changeIndex:o=>s("wall_thickness",o),fullWidth:!0}),t(es,{options:GP,selectedIndex:e.floorThickness,changeIndex:o=>s("floor_thickness",o),fullWidth:!0})]}),d(v,{size:6,gap:1,fullWidth:!0,children:[t(N,{className:"volter-bold",children:g("navigator.roomsettings.chat_settings")}),t(N,{children:g("navigator.roomsettings.chat_settings.info")}),t(es,{options:LP,selectedIndex:e.chatSettings.mode,changeIndex:o=>s("bubble_mode",o),fullWidth:!0}),t(es,{options:PP,selectedIndex:e.chatSettings.weight,changeIndex:o=>s("chat_weight",o),fullWidth:!0}),t(es,{options:DP,selectedIndex:e.chatSettings.speed,changeIndex:o=>s("bubble_speed",o),fullWidth:!0}),t(es,{options:FP,selectedIndex:e.chatSettings.protection,changeIndex:o=>s("flood_protection",o),fullWidth:!0}),d(R,{alignItems:"center",gap:2,className:"mt-2",children:[t("input",{type:"number",min:"0",className:"ton-input black-border w-50",value:n,onChange:o=>r(o.target.valueAsNumber),onBlur:o=>s("chat_distance",n)}),t(N,{className:"w-50",children:g("navigator.roomsettings.chat_settings.hearing.distance")})]})]})]})},Dn=["navigator.roomsettings.tab.1","navigator.roomsettings.tab.2","navigator.roomsettings.tab.3","navigator.roomsettings.tab.4","navigator.roomsettings.tab.5"],HP=i=>{const[e,s]=a.useState(null),[n,r]=a.useState(Dn[0]);W(cg,c=>{const u=c.getParser();if(!u)return;const h=u.data;s({roomId:h.roomId,roomName:h.name,roomDescription:h.description,categoryId:h.categoryId,userCount:h.maximumVisitorsLimit,tags:h.tags,tradeState:h.tradeMode,allowWalkthrough:h.allowWalkThrough,lockState:h.doorMode,password:null,allowPets:h.allowPets,allowPetsEat:h.allowFoodConsume,hideWalls:h.hideWalls,wallThickness:h.wallThickness,floorThickness:h.floorThickness,chatSettings:{mode:h.chatSettings.mode,weight:h.chatSettings.weight,speed:h.chatSettings.speed,distance:h.chatSettings.distance,protection:h.chatSettings.protection},moderationSettings:{allowMute:h.roomModerationSettings.allowMute,allowKick:h.roomModerationSettings.allowKick,allowBan:h.roomModerationSettings.allowBan}}),B(new Ul(h.roomId))});const o=()=>{s(null),r(Dn[0])},l=(c,u)=>{s(h=>{const m={...h};switch(c){case"name":m.roomName=String(u);break;case"description":m.roomDescription=String(u);break;case"category":m.categoryId=Number(u);break;case"max_visitors":m.userCount=Number(u);break;case"trade_state":m.tradeState=Number(u);break;case"allow_walkthrough":m.allowWalkthrough=Boolean(u);break;case"allow_pets":m.allowPets=Boolean(u);break;case"allow_pets_eat":m.allowPetsEat=Boolean(u);break;case"hide_walls":m.hideWalls=Boolean(u);break;case"wall_thickness":m.wallThickness=Number(u);break;case"floor_thickness":m.floorThickness=Number(u);break;case"lock_state":m.lockState=Number(u);break;case"password":m.lockState=pt.PASSWORD_STATE,m.password=String(u);break;case"moderation_mute":m.moderationSettings.allowMute=Number(u);break;case"moderation_kick":m.moderationSettings.allowKick=Number(u);break;case"moderation_ban":m.moderationSettings.allowBan=Number(u);break;case"bubble_mode":m.chatSettings.mode=Number(u);break;case"chat_weight":m.chatSettings.weight=Number(u);break;case"bubble_speed":m.chatSettings.speed=Number(u);break;case"flood_protection":m.chatSettings.protection=Number(u);break;case"chat_distance":m.chatSettings.distance=Number(u);break}return B(new Rf(m.roomId,m.roomName,m.roomDescription,m.lockState,m.password,m.userCount,m.categoryId,m.tags.length,m.tags,m.tradeState,m.allowPets,m.allowPetsEat,m.allowWalkthrough,m.hideWalls,m.wallThickness,m.floorThickness,m.moderationSettings.allowMute,m.moderationSettings.allowKick,m.moderationSettings.allowBan,m.chatSettings.mode,m.chatSettings.weight,m.chatSettings.speed,m.chatSettings.distance,m.chatSettings.protection)),m})};return e?d(le,{colour:L.secondary_grey,title:g("navigator.roomsettings"),className:"nitro-room-settings",onCloseClick:o,children:[t(en,{children:Dn.map(c=>t(Ns,{isActive:n===c,onClick:u=>r(c),children:g(c)},c))}),t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:d(v,{gap:2,fullHeight:!0,children:[n===Dn[0]&&t(kP,{roomData:e,handleChange:l,onClose:o}),n===Dn[1]&&t(AP,{roomData:e,handleChange:l}),n===Dn[2]&&t(UP,{roomData:e,handleChange:l}),n===Dn[3]&&t(BP,{roomData:e,handleChange:l}),n===Dn[4]&&t(MP,{roomData:e,handleChange:l})]})})]}):null},wu=i=>{const{roomData:e=null,popover:s=null}=i,[n,r]=a.useState(!1),o=a.useRef(),l=()=>{const c=100*(e.userCount/e.maxUserCount);let u="badge-empty";return c>=92?u="badge-danger":c>=50?u="badge-warning":c>0&&(u="badge-success"),u};return d(z,{children:[t(P,{pointer:!0,innerRef:o,className:"navigator-info",onMouseOver:c=>r(!0),onMouseLeave:c=>r(!1)}),t(Ai,{show:n,target:o.current,placement:"right",children:t(kr,{children:t(V,{skin:0,colour:L.white,className:"image-rendering-pixelated p-1",onMouseOver:c=>{s(!0),r(!0)},onMouseLeave:c=>{s(!1),r(!1)},children:t(at,{overflow:"hidden",className:"room-info bg-transparent",children:d(R,{gap:2,overflow:"hidden",children:[d(Ki,{roomId:e.roomId,customUrl:e.officialRoomPicRef,className:"d-flex flex-column align-items-center justify-content-end mb-1",overflow:"hidden",children:[e.habboGroupId>0&&t(ot,{badgeCode:e.groupBadgeCode,isGroup:!0,className:"position-absolute top-0 start-0 m-1 "}),e.doorMode!==pt.OPEN_STATE&&t("i",{className:"position-absolute end-0 mb-1 me-1 icon icon-navigator-room-"+(e.doorMode===pt.DOORBELL_STATE?"locked":e.doorMode===pt.PASSWORD_STATE?"password":e.doorMode===pt.INVISIBLE_STATE?"invisible":"")})]}),d(v,{gap:1,children:[t(N,{truncate:!0,className:"flex-grow-1 volter-bold",style:{maxHeight:13},children:e.roomName}),d(R,{gap:2,children:[t(N,{className:"volter-bold",children:g("navigator.roomownercaption")}),d(R,{alignItems:"center",gap:1,children:[t(bs,{userId:e.ownerId}),t(N,{italics:!0,children:e.ownerName})]})]}),t(N,{className:"flex-grow-1",children:e.description}),d(R,{center:!0,className:"badge p-1 position-absolute m-1 bottom-0 end-0 m-2 "+l(),gap:1,children:[t(P,{className:"user-icon"}),e.userCount]})]})]})})})})})]})},yu=i=>{const{roomData:e=null,children:s=null,thumbnail:n=!1,...r}=i,{setDoorData:o=null}=Bs(),[l,c]=a.useState(!1),[u,h]=a.useState("#FFFFFF"),m=a.useRef(),p=()=>{const _=100*(e.userCount/e.maxUserCount);let I="badge-empty";return _>=92?I="badge-danger":_>=50?I="badge-warning":_>0&&(I="badge-success"),I},E=_=>{if(!l){if(e.ownerId!==J().userId){if(e.habboGroupId!==0){Rs(e.roomId);return}switch(e.doorMode){case pt.DOORBELL_STATE:o(I=>{const C={...I};return C.roomInfo=e,C.state=We.START_DOORBELL,C});return;case pt.PASSWORD_STATE:o(I=>{const C={...I};return C.roomInfo=e,C.state=We.START_PASSWORD,C});return}}rr(e.roomId)}};return a.useEffect(()=>{if(m&&m.current){let _=window.getComputedStyle(m.current).getPropertyValue("border-color").replace("rgb(","").replace(")","").replaceAll(" ","").split(",");h(PA(_[0],_[1],_[2]))}},[m,h]),n?t(V,{className:"thumbnail-grid-item",skin:4,colour:u,innerRef:m,children:d(R,{pointer:!0,overflow:"hidden",onClick:E,gap:2,className:"position-relative",...r,column:!0,children:[t(P,{className:"thumbnail-frame align-self-center",children:d(Ki,{roomId:e.roomId,customUrl:e.officialRoomPicRef,className:"d-flex flex-column align-items-center justify-content-end mb-1",colour:u,overflow:"visible",children:[e.doorMode!==pt.OPEN_STATE&&t("i",{className:"position-absolute end-0 mb-1 me-1 bottom-0 icon icon-navigator-room-"+(e.doorMode===pt.DOORBELL_STATE?"locked":e.doorMode===pt.PASSWORD_STATE?"password":e.doorMode===pt.INVISIBLE_STATE?"invisible":"")}),d(R,{center:!0,className:"badge p-1 position-absolute m-auto bottom-0 end-0 start-0 mb-n1 "+p(),gap:1,children:[t(P,{className:"user-icon"}),e.userCount]})]})}),d(R,{className:"w-100",children:[t(v,{gap:0,overflow:"hidden",children:t(N,{truncate:!0,children:e.roomName})}),s,t(wu,{roomData:e,popover:c})]})]})}):d(R,{pointer:!0,overflow:"hidden",alignItems:"center",onClick:E,gap:2,className:"navigator-item px-2 py-1 position-relative",fullWidth:!0,innerRef:m,...r,children:[t(N,{truncate:!0,fullWidth:!0,children:e.roomName}),d(R,{reverse:!0,alignItems:"center",gap:1,className:"flex-shrink-0",children:[e.habboGroupId>0&&t("i",{className:"icon icon-navigator-room-group"}),e.doorMode!==pt.OPEN_STATE&&t("i",{className:"icon icon-navigator-room-"+(e.doorMode===pt.DOORBELL_STATE?"locked":e.doorMode===pt.PASSWORD_STATE?"password":e.doorMode===pt.INVISIBLE_STATE?"invisible":"")})]}),s,d(R,{center:!0,className:"badge p-1 px-0 flex-shrink-0 "+p(),gap:1,children:[t(P,{className:"user-icon"}),e.userCount]}),t(wu,{roomData:e,popover:c})]})},VP=i=>{const{searchResult:e=null,...s}=i,[n,r]=a.useState(!0),[o,l]=a.useState(0),{topLevelContext:c=null}=Bs(),u=()=>{let p=e.code;return!p||!p.length||g("navigator.searchcode.title."+p)=="navigator.searchcode.title."+p?e.data:p.startsWith("${")?p.slice(2,p.length-1):"navigator.searchcode.title."+p},h=()=>{l(p=>p===En.LIST?En.THUMBNAILS:En.LIST)};a.useEffect(()=>{e&&(r(!e.closed),l(e.mode))},[e]);const m=o>=En.THUMBNAILS;return!n&&c.code.includes("official")?t(P,{className:"w-100",children:d(P,{className:"navigator-category-collapsed position-relative cursor-pointer",style:{backgroundImage:`url(${ee("thumbnails.url").replace("%thumbnail%","large/"+e.code)})`},onClick:p=>r(E=>!E),children:[t(V,{className:"d-flex flex-column navigator-category-collapsed",skin:100}),t(V,{opacity:50,skin:3,colour:L.black,className:"position-absolute bottom-0 start-0 mb-1 ms-1 p-1",children:t(N,{className:"volter-bold",variant:"white",children:g(u())})}),t(V,{opacity:127,skin:4,className:"thumbnail-glow"})]})}):d(V,{className:"d-flex flex-column navigator-category",skin:0,opacity:200,colour:L.white,children:[d(R,{fullWidth:!0,alignItems:"center",justifyContent:"between",className:"px-2 pb-1",children:[d(R,{grow:!0,pointer:!0,alignItems:"center",gap:1,onClick:p=>r(E=>!E),children:[t(P,{className:`icons ${n?"minus":"plus"}`}),t(N,{className:"volter-bold",children:g(u())})]}),t(P,{className:`icons ${o===En.LIST?"th":o>=En.THUMBNAILS?"bars":null}`,onClick:h})]})," ",n&&t(z,{children:m?t(qe,{columnCount:3,...s,columnMinWidth:80,columnMaxWidth:"80px",columnMinHeight:130,className:"px-1",children:e.rooms.length>0&&e.rooms.map((p,E)=>t(yu,{roomData:p,thumbnail:!0},E))}):t(pe,{columnCount:1,className:"navigator-grid",gap:0,children:e.rooms.length>0&&e.rooms.map((p,E)=>t(yu,{roomData:p},E))})})]})},WP=i=>{const{sendSearch:e=null}=i,[s,n]=a.useState(0),[r,o]=a.useState(""),{topLevelContext:l=null,searchResult:c=null}=Bs(),u=()=>{if(!l)return;let p=mr[s];p||(p=mr[0]);const E=(p.query?p.query+":":"")+r;e(E||"",l.code)},h=p=>{p.key==="Enter"&&u()};return a.useEffect(()=>{if(!c)return;const p=c.data.split(":");let E=null,_="";if(p.length>=2){const[I,...C]=p;E=mr.find(f=>f.query===I),_=C.join(":")}else _=c.data;E||(E=mr[0]),n(mr.findIndex(I=>I===E)),o(_)},[c]),d(R,{fullWidth:!0,gap:1,children:[t(R,{shrink:!0,children:t(es,{options:(()=>{let p=[];for(let E of mr)p.push({index:p.length,value:p.length,caption:g("navigator.filter."+E.name)});return p})(),selectedIndex:s,changeIndex:p=>n(p)})}),d(R,{fullWidth:!0,gap:1,children:[t("input",{type:"text",className:"ton-input black-border",placeholder:g("navigator.filter.input.placeholder"),value:r,onChange:p=>o(p.target.value),onKeyDown:p=>h(p)}),t(D,{onClick:u,children:t("div",{className:"catalog-searchicon"})})]})]})},jP=i=>{const[e,s]=a.useState(!1),[n,r]=a.useState(!1),[o,l]=a.useState(!1),[c,u]=a.useState(!1),[h,m]=a.useState(!1),[p,E]=a.useState(!1),[_,I]=a.useState(!0),[C,f]=a.useState(!1),{searchResult:S=null,topLevelContext:T=null,topLevelContexts:b=null,navigatorData:y=null}=Bs(),w=a.useRef(null),O=a.useRef(),{navigatorIconRef:F}=Wi();$e(qt.CREATED,M=>{s(!1),l(!1)});const U=a.useCallback((M,G)=>{l(!1),B(new kl(G,M)),E(!0)},[]),j=a.useCallback(()=>{if(!n){f(!0);return}if(w.current){U(w.current.value,w.current.code),w.current=null;return}if(S){U(S.data,S.code);return}T&&U("",T.code)},[n,S,T,U]);a.useEffect(()=>{const M={linkReceived:G=>{const H=G.split("/");if(!(H.length<2))switch(H[1]){case"show":{s(!0),f(!0);return}case"hide":s(!1);return;case"toggle":{if(e){s(!1);return}s(!0),f(!0);return}case"toggle-room-info":u(Y=>!Y);return;case"toggle-room-link":m(Y=>!Y);return;case"goto":if(H.length<=2)return;switch(H[2]){case"home":if(y.homeRoomId<=0)return;Rs(y.homeRoomId);break;default:{const Y=parseInt(H[2]);Rs(Y)}}return;case"create":l(Y=>!Y);return;case"close-creator":l(!1);return;case"search":if(H.length>2){const Y=H[2];let q="";H.length>3&&(q=H[3]),w.current={value:q,code:Y},s(!0),f(!0)}return}},eventUrlPrefix:"navigator/"};return dt(M),()=>ht(M)},[e,y]),a.useEffect(()=>{S&&(E(!1),O&&O.current&&(O.current.scrollTop=0))},[S]),a.useEffect(()=>{!e||!n||!C||(j(),f(!1))},[e,n,C,j]),a.useEffect(()=>{n||!T||r(!0)},[n,T]),a.useEffect(()=>{!e||!_||(B(new rf),I(!1))},[e,_]),a.useEffect(()=>{_o.addCallback(bo.OPENROOM,(M,G=!1,H=null)=>B(new Xp(M)))},[]);const x=a.useCallback(()=>{if(!F||F&&!F.current)return{x:0,y:0};let M=F.current;return{x:M.getBoundingClientRect().x+M.parentElement.clientWidth,y:M.getBoundingClientRect().y}},[F]);return F.current?d(z,{children:[e&&d(le,{className:"ton-nav",title:g("navigator.title"),onCloseClick:M=>s(!1),uniqueKey:"navigator",offsetLeft:x().x,offsetTop:x().y,windowPosition:tt.TOP_LEFT,children:[t(R,{gap:2,className:"z-100",children:t(en,{children:b&&b.length>0&&b.map((M,G)=>t(Ns,{className:"p-1",isActive:T===M,onClick:H=>U("",M.code),children:g("navigator.toplevelview."+M.code)},G))})}),d(V,{skin:0,colour:L.white,position:"relative",className:"ton-nav-content h-100 overflow-auto d-flex flex-column gap-2 pe-1",children:[p&&t(P,{fit:!0,position:"absolute",className:"top-0 start-0 z-index-1 bg-muted opacity-0-5"}),T&&!T.code.includes("myworld")&&!T.code.includes("official")&&t(V,{skin:0,colour:L.light_grey,children:t(WP,{sendSearch:U})}),t(v,{overflow:"auto",className:"searchresult-nav-content",gap:1,children:S&&S.results.map((M,G)=>t(VP,{searchResult:M},G))})]}),T&&T.code.includes("myworld")&&t(V,{skin:4,colour:L.catalog_search_blue,className:"mt-1 p-1",children:d(R,{alignItems:"center",children:[t("i",{className:"icon icon-room-key me-1"}),g("navigator.moreroomscaption"),t(D,{className:"ms-auto",onClick:M=>l(!0),children:g("navigator.createroom")})]})})]}),t(vP,{}),c&&t(wP,{onCloseClick:()=>u(!1)}),h&&t(yP,{onCloseClick:()=>m(!1)}),o&&t(OP,{}),t(HP,{})]}):null},qP=/\n\r|\n|\r/mg,YP=i=>{const[e,s]=a.useState(null),[n,r]=a.useState(""),[o,l]=a.useState(),c=a.useRef(null),[u,h]=a.useState(!1);return a.useEffect(()=>{const m=async E=>{try{const _=await fetch(E);if(!_)return;const C=(await _.text()).split(qP),f=C.shift().split("|");r(f[0]),h(!0);try{let S=JSON.parse(f[1]);l(T=>{const{width:b=0,height:y=0,colour:w=L.primary_blue,skin:O=0}=S;return{width:b,height:y,colour:w,skin:O}})}catch{l({width:0,height:0,colour:L.primary_blue,skin:0})}s(C.join(""))}catch{s(null),Vl.error(`Failed to fetch ${E}`)}},p={linkReceived:E=>{const _=E.split("/");if(!(_.length<2)){if(_.shift(),!_||_[0]=="null"){s(null),h(!1);return}m(ee("habbopages.url")+_.join("/"))}},eventUrlPrefix:"habbopages/"};return dt(p),()=>ht(p)},[]),a.useEffect(()=>{const m=p=>{if(!(p.target instanceof HTMLAnchorElement))return;p.preventDefault();const E=p.target.href;!E||!E.length||ir(E)};return document.addEventListener("click",m),()=>{document.removeEventListener("click",m)}},[]),a.useEffect(()=>{h(!1),setTimeout(()=>{h(!0)},1)},[o]),!e||!u?null:t(le,{className:"nitropedia",title:n,skin:o.skin,colour:o.colour,onCloseClick:()=>s(null),style:o.width&&o.height?{width:o.width,height:o.height}:{},children:t(P,{fit:!0,innerRef:c,className:"text-black",overflow:"hidden",dangerouslySetInnerHTML:{__html:e}})})},zP=i=>{const[e,s]=a.useState(0),[n,r]=a.useState(null),[o,l]=a.useState(!1),{showConfirm:c=null}=Ke();W(uh,E=>{s(0),r(null)}),W(Tl,E=>{s(0),r(null)}),W(cr,E=>{const _=E.getParser();_.roomEnter&&(_.data.habboGroupId>0?(s(_.data.habboGroupId),B(new Mr(_.data.habboGroupId,!1))):(s(0),r(null)))}),W(Rh,E=>{const _=E.getParser();!n||_.groupId!==n.id&&_.groupId!==e||(s(0),r(null))}),W(qr,E=>{const _=E.getParser();_.id===e&&r(_)});const u=()=>{c(g("group.leaveconfirm.desc"),()=>{B(new Mi(n.id,J().userId))},null)},h=n&&n.ownerName===J().userName,m=()=>{if(h)return"group.manage";if(n.type===hs.PRIVATE)return"";if(n.membershipType===xt.MEMBER)return"group.leave";if(n.membershipType===xt.NOT_MEMBER&&n.type===hs.REGULAR)return"group.join";if(n.membershipType===xt.REQUEST_PENDING)return"group.membershippending";if(n.membershipType===xt.NOT_MEMBER&&n.type===hs.EXCLUSIVE)return"group.requestmembership"},p=()=>{if(h)return Q_(n.id);if(!(n.type===hs.PRIVATE&&n.membershipType===xt.NOT_MEMBER)){if(n.membershipType===xt.MEMBER){u();return}Ql(n.id)}};return n?t(V,{skin:7,colour:L.secondary_grey,className:"ton-notification-bubble ton-group-room-info",children:d(v,{gap:0,children:[d(R,{className:`ton-grouproom-header ${o?"":"closed"}`,alignItems:"center",justifyContent:"between",pointer:!0,onClick:E=>l(_=>!_),children:[t("div",{className:"groupicon-room"}),t(N,{variant:"white",children:g("group.homeroominfo.title")}),t(P,{className:`notification-arrow ${o?"down":"left"}`})]}),o&&t(z,{children:d(v,{className:"p-1",children:[d(R,{pointer:!0,alignItems:"center",gap:2,onClick:E=>Uo(n.id),children:[t(P,{className:"group-badge",children:t(ot,{badgeCode:n.badge,isGroup:!0})}),t(N,{className:"ubuntu-bold",variant:"white",children:n.title})]}),(n.type!==hs.PRIVATE||h)&&t(D,{skin:2,className:"mx-1 mb-1",onClick:p,children:g(m())})]})})]})}):null},KP=i=>{const{title:e="Nitro",onClose:s=null,...n}=i;return t(Go,{title:e,onClose:s,...n,children:d(v,{gap:1,children:[t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:d(pe,{gap:3,children:[t(v,{center:!0,size:5,children:t("object",{data:"https://assets.nitrodev.co/logos/nitro-n-dark.svg",width:"100",height:"100",children:" "})}),d(v,{size:7,children:[d(v,{alignItems:"center",gap:0,children:[t(N,{className:"volter-bold",children:"Nitro React"}),d(N,{children:["v",$_()]})]}),d(v,{alignItems:"center",children:[d(N,{children:[t("b",{children:"Renderer:"})," v",nA()]}),d(v,{fullWidth:!0,gap:1,children:[t(D,{fullWidth:!0,colour:"#7289da",skin:6,className:"text-white",onClick:r=>window.open("https://discord.nitrodev.co"),children:"Discord"}),d(R,{gap:1,children:[t(D,{colour:"#c27647",skin:6,className:"text-white",fullWidth:!0,onClick:r=>window.open("https://git.krews.org/nitro/nitro-react"),children:"Git"}),t(D,{fullWidth:!0,skin:6,colour:L.primary_red,className:"text-white",onClick:r=>window.open("https://git.krews.org/nitro/nitro-react/-/issues"),children:"Bug Report"})]})]})]})]})]})}),t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:d(pe,{gap:3,children:[t(v,{center:!0,size:5,children:t(P,{className:"hiveui-logo"})}),d(v,{size:7,children:[d(v,{alignItems:"center",gap:0,children:[t(N,{bold:!0,className:"volter-bold",children:"Hive UI"}),t(N,{children:"v 1.0"})]}),d(v,{children:[d(v,{alignItems:"center",gap:0,children:[t(N,{children:"Made with love"}),t(N,{children:"by Tonic"})]}),d(v,{alignItems:"center",fullWidth:!0,gap:1,children:[t(N,{className:"volter-bold",children:"Report all bugs on our Discord"}),t(D,{skin:6,colour:"#7289da",className:"text-white",onClick:r=>window.open("https://discord.gg/75aGKUpSeT"),children:"Hive Discord"})]})]})]})]})})]})})},$P=i=>{const{item:e=null,title:s=i.item&&i.item.title||"",onClose:n=null,...r}=i,[o,l]=a.useState(!1),[c,u]=a.useState({x:43+100,y:21+100}),[h,m]=a.useState(0),[p,E]=a.useState(!1),{canChat:_,setCanChat:I}=wn(),C=()=>{h<3&&!p?(u({x:Math.floor(Math.random()*280),y:Math.floor(Math.random()*128)}),m(h+1)):E(!0)},f=()=>{I(!0),n()};return a.useEffect(()=>{I(!1)},[I]),d(Go,{title:s,...r,modal:!0,closeable:!1,children:[t(P,{className:"ton-frame-divider"}),d(R,{fullHeight:!0,overflow:"hidden",gap:e.imageUrl&&!o?2:0,className:"ton-alert-middle flex-grow-1",children:[t(P,{className:"notification-afk-frank flex-shrink-0"}),e.imageUrl&&!o&&t("img",{src:e.imageUrl,alt:e.title,onError:()=>{l(!0)},className:"align-self-baseline"}),d(P,{classNames:["notification-text overflow-y-auto d-flex flex-column w-100 p-1"],children:[t(N,{bold:!0,children:g("notification.afk.title")}),t(N,{children:g("notification.afk.message")})]})]}),t(P,{className:"ton-frame-divider"}),!e.imageUrl||e.imageUrl&&o?t(z,{children:t(v,{alignItems:"center",center:!0,gap:0,className:"mt-1 py-2",children:t(D,{style:{position:"fixed",left:c.x,top:c.y},onMouseEnter:C,skin:2,onClick:p?f:null,children:g("generic.close")})})}):t("div",{className:"mt-3"})]})},QP=i=>{const{item:e=null,title:s=i.item&&i.item.title||"",onClose:n=null,...r}=i,[o,l]=a.useState(!1),c=()=>{ir(e.clickUrl),n()},u=e.alertType===fe.DEFAULT;return d(Go,{title:s,onClose:n,...r,type:u?fe.DEFAULT:e.alertType,modal:!u,children:[t(P,{className:"ton-frame-divider"}),d(R,{fullHeight:!0,overflow:"hidden",gap:u||e.imageUrl&&!o?2:0,className:"ton-alert-middle flex-grow-1",children:[u&&!e.imageUrl&&t(P,{className:"notification-frank flex-shrink-0"}),e.imageUrl&&!o&&t("img",{src:e.imageUrl,alt:e.title,onError:()=>{l(!0)},className:"align-self-baseline"}),d(P,{classNames:["notification-text overflow-y-auto d-flex flex-column w-100 p-1",e.clickUrl&&!u?"justify-content-center gap-2":""],children:[e.messages.length>0&&e.messages.map((h,m)=>{const p=h.replace(/\r\n|\r|\n/g,"<br />");return t(P,{dangerouslySetInnerHTML:{__html:g(p)}},m)}),e.clickUrl&&e.clickUrl.length>0&&e.imageUrl&&!o&&t(z,{children:t(D,{skin:6,colour:L.primary_blue,onClick:c,className:"align-self-center px-3",children:g(e.clickUrlText)})})]})]}),t(P,{className:"ton-frame-divider"}),!e.imageUrl||e.imageUrl&&o?t(z,{children:d(v,{alignItems:"center",center:!0,gap:0,className:"mt-1",children:[!e.clickUrl&&t(D,{className:"mb-1",skin:2,onClick:n,children:g("generic.close")}),e.clickUrl&&e.clickUrl.length>0&&t(D,{className:"mb-1",skin:2,onClick:c,children:g(e.clickUrlText)})]})}):t("div",{className:"mt-3"})]})},XP=i=>{const{item:e=null,title:s=i.item&&i.item.title||"",onClose:n=null,...r}=i,[o,l]=a.useState(""),[c,u]=a.useState([]),h=()=>{ir(e.clickUrl),n()},m=E=>{let _=JSON.parse(e.messages[0]);u(_.filter(I=>I.includes(E))),l(E)};a.useEffect(()=>{u(JSON.parse(e.messages[0]))},[e]);const p=e.clickUrl&&e.clickUrl.startsWith("event:");return t(Go,{title:s,onClose:n,type:fe.SEARCH,...r,children:d(v,{gap:1,fullHeight:!0,overflow:"hidden",children:[t(R,{fullWidth:!0,alignItems:"center",position:"relative",children:t(V,{skin:4,colour:L.lighter_grey,position:"relative",className:"w-100",children:t("input",{type:"text",className:"ton-input",placeholder:g("generic.search"),value:o,onChange:E=>m(E.target.value)})})}),t(V,{className:"overflow-hidden text-black d-flex flex-column flex-grow-1 h-100",children:t(P,{overflow:"auto",className:"d-flex flex-column",children:t(v,{fullHeight:!0,className:"py-1",overflow:"auto",children:t(qe,{gap:1,columnCount:1,children:c&&c.map((E,_)=>t("span",{children:E},_))})})})}),d(v,{alignItems:"center",center:!0,gap:1,children:[!p&&!e.clickUrl&&t(D,{skin:2,onClick:n,children:g("generic.close")}),e.clickUrl&&e.clickUrl.length>0&&t(D,{skin:2,onClick:h,children:g(e.clickUrlText)})]})]})})},JP=(i,e)=>{if(!i)return null;const s={key:i.id,item:i,onClose:e};switch(i.alertType){case fe.NITRO:return t(KP,{...s});case fe.AFK:return t($P,{...s});case fe.SEARCH:return t(XP,{...s});default:return t(QP,{...s})}},_c=i=>{const{item:e=null,onClose:s=null,...n}=i,r=e.message.replace(/\r\n|\r|\n/g,"<br />");return d(eI,{onClose:s,gap:2,onClick:l=>e.linkUrl&&e.linkUrl.length&&ir(e.linkUrl),...n,children:[t(R,{center:!0,className:"bubble-image-container flex-shrink-0",children:(()=>{if(!e.iconUrl)return null;switch(e.notificationType){case Le.LOOKSTRING:return t(it,{figure:e.iconUrl,direction:2,headOnly:!0});case Le.FURNITURE:return t(cE,{productType:Ce.FLOOR,productClassId:parseInt(e.iconUrl)});default:return t("img",{className:"no-select bubble-image-container",src:e.iconUrl,alt:""})}})()}),e.notificationType==Le.LOOKSTRING?t(N,{wrap:!0,variant:"white",className:"py-2",children:r}):t(N,{wrap:!0,variant:"white",dangerouslySetInnerHTML:{__html:r},className:"py-2"})]})},ZP=i=>{const{setup:e}=Kn(),{item:s=null,...n}=i;return Vs(()=>{e()}),s.notificationType===Le.NEWSSILENT?null:t(_c,{item:s,...i})},eD=i=>{const{item:e=null,onClose:s=null,...n}=i;return d(eI,{fadesOut:!1,className:"flex-column club-gift",onClose:s,...n,skin:5,colour:L.quaternary_grey,children:[d("div",{className:"d-flex gap-2 mb-1 px-1",children:[t(wt,{type:"hc",className:"flex-shrink-0 mt-1"}),t("span",{className:"ms-1",children:g("notifications.text.club_gift")})]}),d("div",{className:"d-flex align-items-center gap-2 px-1 pb-1",children:[t("span",{className:"text-decoration-underline cursor-pointer text-nowrap flex-shrink-0",onClick:s,children:g("notifications.button.later")}),t(D,{skin:2,onClick:()=>ir(e.linkUrl),className:"w-100",children:g("notifications.button.show_gift_list")})]})]})},tD=i=>{const{item:e=null,onClose:s=null}=i,{showConfirm:n}=Ke();return t(_c,{...i,pointer:!0,onClick:()=>n(g("notification.prestige.message"),()=>{B(new sc(e.linkUrl)),s()},null)})},TI=(i,e,s=null)=>{if(!i)return null;const n={key:i.id,item:i,onClose:e};switch(i.notificationType){case Le.CLUBGIFT:return t(eD,{...n,...s});case Le.PRESTIGE:return t(tD,{...n,...s});case Le.NEWSSILENT:case Le.NEWSUPDATED:return t(ZP,{...n,...s});default:return t(_c,{...n,...s})}},NI=()=>{let i=null;self.onmessage=e=>{if(!e)return;const s=e.data;switch(s.action){case"START":i=setInterval(()=>postMessage(null),s.content);break;case"STOP":i&&(clearInterval(i),i=null);break}}};class RI extends Worker{constructor(e){const s=e.toString(),n=new Blob([`(${s})()`]);super(URL.createObjectURL(n))}}const sD=i=>{const{item:e,onClose:s=null}=i;return a.useEffect(()=>{if(e.timeout==-1||e.running)return;let n=e.timeout/1e3,r=0;const o=new RI(NI);o.onmessage=()=>{r==n&&(s(),o.postMessage({action:"STOP"})),r++},e.running=!0,o.postMessage({action:"START",content:1e3})},[e,s]),vo.createPortal(TI(e,s,i),document.getElementById("notifications-confirms"))},nD=i=>{const{item:e=null,onClose:s=null,...n}=i,{message:r=null,onConfirm:o=null,onCancel:l=null,confirmText:c=null,cancelText:u=null,title:h=null}=e,m=()=>{o!=null&&o(),s()},p=()=>{l!==null&&l(),s()};return t(Go,{title:h,onClose:s,...n,type:fe.CONFIRM,children:d(v,{gap:1,fullHeight:!0,overflow:"hidden",children:[t(V,{center:!0,fullHeight:!0,children:t(N,{center:!0,children:r})}),d(R,{gap:1,children:[t(D,{skin:3,fullWidth:!0,onClick:p,children:u}),t(D,{skin:2,colour:L.primary_green,fullWidth:!0,onClick:m,children:c})]})]})})},rD=(i,e)=>{if(!i)return null;const s={key:i.id,item:i,onClose:e};switch(i.confirmType){default:return t(nD,{...s})}},oD=i=>{const{alerts:e=[],bubbleAlerts:s=[],confirms:n=[],closeAlert:r=null,closeBubbleAlert:o=null,closeConfirm:l=null}=Ke(),c=a.useMemo(()=>{if(!e||!e.length)return null;const p=[];for(const E of e){const _=JP(E,()=>r(E));p.push(_)}return p},[e,r]),u=a.useMemo(()=>{if(!s||!s.length)return null;const p=[];for(const E of s){if(E.display==xn.PERSISTENT_BUBBLE||E.notificationType===Le.CLUBGIFT)continue;const _=TI(E,()=>o(E));p.push(_)}return p},[s,o]),h=a.useMemo(()=>{if(!n||!n.length)return null;const p=[];for(const E of n){const _=rD(E,()=>l(E));p.push(_)}return p},[n,l]),m=a.useMemo(()=>{if(!s||!s.length)return null;const p=[];for(const E of s){if(E.display==xn.BUBBLE)continue;const _=t(sD,{opacity:50,fullWidth:!0,fadesOut:!1,item:E,onClose:()=>o(E),skin:5,colour:L.quaternary_grey},E.id);p.push(_)}return p},[s,o]);return d(z,{children:[d(v,{gap:1,children:[u,m]}),h,c]})},iD=i=>{const{offer:e=null,setOpen:s=null}=i;if(e)return d(V,{opacity:50,skin:5,colour:L.quaternary_grey,fullWidth:!0,className:"p-2 ubuntu nitro-notification-bubble",column:!1,gap:1,pointer:!0,onClick:()=>s(!0),children:[t("img",{src:ee("image.library.url")+e.iconUrl}),t(N,{variant:"light",className:"ubuntu-bold",children:e.title})]})},aD=i=>{const{offer:e=null,setOpen:s=null}=i,{getCurrencyAmount:n}=An(),[r,o]=a.useState(1),l=a.useMemo(()=>{let h=!1,m=!1,p=!1;return e.priceInCredits>0&&(h=n(-1)>=e.priceInCredits),e.priceInActivityPoints>0?m=n(e.activityPointType)>=e.priceInActivityPoints:m=!0,e.purchaseLimit>0&&(p=!0),h&&m&&p},[e,n]),c=()=>{let h=Math.max(0,(e.expirationTime-Date.now())/1e3);return Xs.format(h)},u=()=>{B(new lp(e.id,r)),B(new Ol)};if(e)return t(le,{onCloseClick:()=>s(!1),title:g(e.title),className:"ton-targeted-offer",children:d(V,{fullHeight:!0,className:"p-1",gap:1,justifyContent:"center",children:[t(V,{skin:4,colour:L.primary_red,className:"p-1 text-center volter-bold",children:g("targeted.offer.timeleft",["timeleft"],[c()])}),d(R,{gap:1,fullHeight:!0,children:[d(R,{gap:1,column:!0,className:"w-75 text-black",children:[d(V,{skin:0,fullHeight:!0,fullWidth:!0,colour:L.lighter_yellow,children:[t("h4",{className:"ubuntu-bold",children:g(e.title)}),t("h5",{className:"ubuntu",dangerouslySetInnerHTML:{__html:e.description}})]}),t(R,{alignSelf:"center",alignItems:"center",justifyContent:"center",gap:2,children:t(D,{skin:l?6:5,colour:l?L.primary_green:L.white,disabled:!l,onClick:()=>u(),children:g("targeted.offer.button.buy")})})]}),t(P,{className:"w-50",fullHeight:!0,style:{background:`url(${ee("image.library.url")+e.imageUrl}) no-repeat center`}})]}),d(R,{className:"price-ray position-absolute",alignItems:"center",justifyContent:"center",column:!0,children:[t(N,{className:"ubuntu",children:g("targeted.offer.price.label")}),e.priceInCredits>0&&d(R,{gap:1,children:[t(N,{className:"ubuntu-bold",variant:"light",children:e.priceInCredits}),t(wt,{type:-1})]}),e.priceInActivityPoints>0&&d(R,{gap:1,children:[d(N,{className:"ubuntu-bold",variant:"light",children:["+",e.priceInActivityPoints]})," ",t(wt,{type:e.activityPointType})]})]})]})})},lD=()=>{const[i,e]=a.useState(null),[s,n]=a.useState(!1);if(W(SE,r=>{let o=r.getParser();o&&e(o.data)}),Vs(()=>{B(new Ol)}),!!i)return t(z,{children:s?t(aD,{offer:i,setOpen:n}):t(iD,{offer:i,setOpen:n})})},cD=i=>{const[e,s]=a.useState(!1);a.useState(null),a.useState(null),a.useState(null),a.useState(!1);const{navigatorData:n=null}=Bs(),{roomSession:r=null}=Xe(),o=l=>{switch(l){case"settings":oe("navigator/toggle-room-info");return;case"zoom":s(c=>{let u=X().getRoomInstanceRenderingCanvasScale(r.roomId,1);return c?u*=2:u/=2,X().setRoomInstanceRenderingCanvasScale(r.roomId,1,u),!c});return;case"chat_history":oe("chat-history/toggle");return;case"like_room":B(new ef(1));return;case"toggle_room_link":oe("navigator/toggle-room-link");return}};return t(V,{skin:5,colour:L.quaternary_grey,opacity:50,className:"nitro-room-tools p-2",children:d(R,{gap:2,justifyContent:"between",children:[r&&d(R,{gap:1,children:[t(P,{pointer:!0,title:g("room.zoom.button.text"),onClick:()=>o("zoom"),className:"icon-zoom cursor-pointer"}),n.canRate&&t(P,{pointer:!0,title:g("room.like.button.text"),onClick:()=>o("like_room"),className:"thumbs-up-icon cursor-pointer"}),t(N,{center:!0,variant:"white",className:"cursor-pointer",onClick:()=>o("settings"),children:g("navigator.room.info.popup.title")})]}),d(R,{gap:1,className:"left-side",children:[t(N,{center:!0,variant:"white",className:"cursor-pointer",onClick:()=>oe("help/toggle"),children:g("toolbar.help")}),t(N,{center:!0,variant:"white",className:"cursor-pointer",onClick:()=>oe("user-settings/toggle"),children:g("friendlist.settings")})]})]})})},uD=i=>{const{purse:e=null,hcDisabled:s=!1}=An(),n=a.useMemo(()=>ee("system.currency.types",[]),[]),r=a.useMemo(()=>ee("currency.display.number.short",!1),[]),o=(()=>{if(!e)return null;const c=e.clubPeriods*31+e.clubDays,u=e.minutesUntilExpiration;return e.clubLevel===ls.NO_CLUB?g("purse.clubdays.zero.amount.text"):u>-1&&u<60*24?Xs.shortFormat(u*60):Xs.shortFormat(c*86400)})(),l=(c,u=-1,h=!1)=>{if(!e||!e.activityPoints||!e.activityPoints.size)return null;const m=Array.from(e.activityPoints.keys()).filter(_=>n.indexOf(_)>=0);let p=0;for(;p<c;)m.shift(),p++;p=0;const E=[];for(const _ of m){if(u>-1&&p===u)break;E.push(t(mi,{seasonal:h,type:_,amount:e.activityPoints.get(_)},_)),p++}return E};return e?t(v,{alignItems:"end",className:"nitro-purse-container",gap:0,children:d(R,{className:"nitro-purse",fullWidth:!0,gap:1,column:!0,children:[d(pe,{columnCount:2,gap:0,className:"nitro-purse-container-grid",children:[t(Dk,{type:2}),t(mi,{type:-1,amount:e.credits,short:r}),t(mi,{type:"hc",amount:o,onClick:c=>oe("habboUI/open/hccenter")}),l(0,1)]}),l(1,-1,!0),t(cD,{})]})}):null},dD=i=>{const{isDragged:e}=Ro(),{isInRoom:s}=i,{inGame:n}=ys(),r=a.useMemo(()=>{let o={};return e&&(o.right=35),s&&!e&&(o.right=5),o},[e,s]);return d("div",{className:"nitro-right-side d-flex gap-1",style:r,id:"right-side",children:[t(v,{gap:1,id:"notifications-confirms",className:"right-side-col "+(n?"d-none":""),children:!n&&t(z,{children:t(lD,{})})}),d(v,{position:"relative",gap:1,className:"right-side-col",id:"purse-view",children:[!n&&d(z,{children:[t(uD,{}),t(zP,{})]}),t(oD,{})]})]})},hD=i=>t("div",{className:"room-spectator"}),Xi=i=>{const{objectId:e=-1,category:s=-1,noFollow:n=!1,position:r="absolute",...o}=i,[l,c]=a.useState({x:-1,y:-1}),u=a.useRef();return a.useEffect(()=>{let h=!1;const m=()=>{const E=Pe();return Pi(E.roomId,e,s,1)},p=()=>{const E=m();!E||!u.current||c({x:Math.round(E.left+E.width/2-u.current.offsetWidth/2)+4,y:Math.round(E.top-u.current.offsetHeight+25)})};return n?p():(h=!0,Nn().add(p)),()=>{h&&Nn().remove(p)}},[e,s,n]),t(P,{innerRef:u,position:r,visible:l.x+(u.current?u.current.offsetWidth:0)>-1,className:"object-location",style:{left:l.x,top:l.y},...o})},Au=i=>{const{userId:e=-1,progress:s=100,timeout:n=-1,colour:r=L.primary_green,modifier:o=-1,full:l=-1,curLevelProg:c=-1,skill:u=""}=i,[h,m]=a.useState(!1),[p,E]=a.useState(n),_=a.useRef(),I=()=>{let S={};return n>0&&(S["--barTimeout"]=n+1+"s"),S["--barProgress"]=s*100/l+"%",S};a.useEffect(()=>{if(p==0||n<0)return;let S=null;const T=()=>{p<=0||(clearTimeout(S),E(b=>b-=1),S=setTimeout(T,1e3))};return S=setTimeout(T,1e3),()=>{clearTimeout(S)}},[n,p]);const C=()=>{const S=Pe();return Pi(S.roomId,e,re.UNIT,1)},f=t(Ai,{target:_.current,show:h,placement:"right",children:t(kr,{children:t(V,{skin:0,colour:L.white,className:"image-rendering-pixelated p-2 text-black",children:d(R,{gap:1,column:!0,children:[d(N,{children:[d(N,{bold:!0,children:[g("skills.training"),":"]})," ",u]}),d(N,{children:[d(N,{bold:!0,children:[g("skills.skill"),":"]})," ",s,"/",l]}),d(N,{children:[d(N,{bold:!0,children:[g("skills.speed"),":"]})," ",o,"/m"]})]})})})});if(C())return d(Xi,{objectId:e,category:re.UNIT,children:[n<0&&f,d(V,{skin:6,colour:L.tertiary_grey,className:"progress-bars-bar "+(n>-1?"":"is-thinned"),position:"absolute",innerRef:_,onMouseOver:S=>m(!0),onMouseLeave:S=>m(!1),children:[t(R,{fullHeight:!0,children:t(V,{style:I(),skin:3,colour:r,className:"progress-bar-inner p-0 "+(n>0?"has-timeout":"")})}),d(N,{bold:!0,position:"absolute",className:"bottom-0 top-0 start-0 end-0 d-flex justify-content-center align-items-center",variant:"white",children:[n>0&&p,o>0&&"+"+o]}),t(Fo,{skin:6,colour:L.tertiary_grey})]})]})},mD=()=>{const[i,e]=a.useState(null),[s,n]=a.useState(),r=o=>{n(null)};return W(tc,o=>{let l=o.getParser();l!=null&&(l.type=="SKILL"?e(l.skillers):l.type=="CURRENCY"&&n(l.currencyUser))}),d(P,{children:[i&&i.map((o,l)=>t(Au,{userId:o.userId,progress:o.progress,modifier:o.modifier,full:o.full,curLevelProg:o.currentLevelProgress,skill:o.skill},"a"+l)),s&&s.timer>0&&t(Au,{userId:s.userId,timeout:s.timer,onEnd:r,colour:L.primary_blue})]})},gD=i=>{const{chatEvent:e=null,onClose:s=null}=i,[n,r]=a.useState(e.chat==="${bot.skill.chatter.configuration.text.placeholder}"?"":e.chat),[o,l]=a.useState(e.automaticChat),[c,u]=a.useState(e.mixSentences),[h,m]=a.useState(e.chatDelay),p=a.useMemo(()=>Pi(Pe().roomId,e.objectId,e.category,1),[e]),E=I=>I.replace(/;#;/g," ").replace(/\r\n|\r|\n/g,"\r"),_=()=>{const I=E(n)+";#;"+o+";#;"+h+";#;"+c;B(new rn(e.botId,Ue.SETUP_CHAT,I)),s()};return t(vs,{windowPosition:tt.NOTHING,handleSelector:".drag-handler",dragStyle:{top:p.y,left:p.x},children:d(V,{skin:6,colour:L.tertiary_grey,className:"p-1",children:[t(V,{skin:3,colour:L.black,className:"drag-handler",children:g("bot.skill.chatter.configuration.title")}),d(v,{className:"p-1",children:[d(v,{gap:1,children:[t(N,{variant:"white",children:g("bot.skill.chatter.configuration.chat.text")}),t("textarea",{className:"form-control",placeholder:g("bot.skill.chatter.configuration.text.placeholder"),value:n,rows:7,onChange:I=>r(I.target.value)})]}),d(v,{gap:1,children:[d(R,{gap:1,alignItems:"center",justifyContent:"between",children:[t(N,{fullWidth:!0,variant:"white",children:g("bot.skill.chatter.configuration.automatic.chat")}),t("input",{type:"checkbox",className:"ton-form-check-input",checked:o,onChange:I=>l(I.target.checked)})]}),d(R,{gap:1,alignItems:"center",justifyContent:"between",children:[t(N,{fullWidth:!0,variant:"white",children:g("bot.skill.chatter.configuration.markov")}),t("input",{type:"checkbox",className:"ton-form-check-input",checked:c,onChange:I=>u(I.target.checked)})]}),d(R,{gap:1,alignItems:"center",justifyContent:"between",children:[t(N,{fullWidth:!0,variant:"white",children:g("bot.skill.chatter.configuration.chat.delay")}),t("input",{type:"number",className:"form-control",value:h,onChange:I=>m(I.target.valueAsNumber)})]})]}),d(R,{alignItems:"center",justifyContent:"between",gap:1,children:[t(D,{fullWidth:!0,skin:0,onClick:s,children:g("cancel")}),t(D,{fullWidth:!0,skin:1,onClick:_,children:g("save")})]})]})]})})},ku=-1,Mu=0,Uu=1,Lu=2,Pu=3,Du=4,Fu=5,xu=6,pD=i=>{const{item:e=null,onClose:s=null}=i,[n,r]=a.useState(ku),[o,l]=a.useState(null),[c,u]=a.useState(null),{roomSession:h=null}=Xe(),m=()=>{o&&X().selectRoomObject(h.roomId,o.roomIndex,re.UNIT)},p=()=>{h.usePetProduct(e.requestRoomObjectId,o.webID),s()},E=a.useMemo(()=>{if(!o||!c)return null;const _=new Ur(o.figure),I=c.customParams.split(" "),C=parseInt(I[0]);switch(c.specialType){case ae.PET_SHAMPOO:{if(I.length<2)return null;const f=X().getPetColorResult(C,_.paletteId),S=X().getPetColorResultsForTag(C,I[1]);let T=-1;for(const b of S)if(b.breed===f.breed){T=parseInt(b.id);break}return t(Tn,{typeId:_.typeId,paletteId:T,petColor:_.color,customParts:_.customParts,direction:2})}case ae.PET_CUSTOM_PART:{if(I.length<4)return null;const f=[],S=I[1].split(",").map(w=>parseInt(w)),T=I[2].split(",").map(w=>parseInt(w)),b=I[3].split(",").map(w=>parseInt(w));let y=0;for(;y<S.length;){const w=S[y],O=_.getCustomPart(w);let F=b[y];O!=null&&(F=O.paletteId),f.push(new ca(w,T[y],F)),y++}return t(Tn,{typeId:_.typeId,paletteId:_.paletteId,petColor:_.color,customParts:f,direction:2})}case ae.PET_CUSTOM_PART_SHAMPOO:{if(I.length<3)return null;const f=[],S=I[1].split(",").map(y=>parseInt(y)),T=I[2].split(",").map(y=>parseInt(y));let b=0;for(;b<S.length;){const y=S[b],w=_.getCustomPart(y);let O=-1;w!=null&&(O=w.partId),f.push(new ca(S[b],O,T[b])),b++}return t(Tn,{typeId:_.typeId,paletteId:_.paletteId,petColor:_.color,customParts:f,direction:2})}case ae.PET_SADDLE:{if(I.length<4)return null;const f=[],S=I[1].split(",").map(w=>parseInt(w)),T=I[2].split(",").map(w=>parseInt(w)),b=I[3].split(",").map(w=>parseInt(w));let y=0;for(;y<S.length;)f.push(new ca(S[y],T[y],b[y])),y++;for(const w of _.customParts)S.indexOf(w.layerId)===-1&&f.push(w);return t(Tn,{typeId:_.typeId,paletteId:_.paletteId,petColor:_.color,customParts:f,direction:2})}case ae.MONSTERPLANT_REBREED:case ae.MONSTERPLANT_REVIVAL:case ae.MONSTERPLANT_FERTILIZE:{let f="rip";const S=X().getRoomObject(h.roomId,o.roomIndex,re.UNIT);if(S&&(f=S.model.getValue(ue.FIGURE_POSTURE),f==="rip")){const T=o.petLevel;T<7?f=`grw${T}`:f="std"}return t(Tn,{typeId:_.typeId,paletteId:_.paletteId,petColor:_.color,customParts:_.customParts,posture:f,direction:2})}}},[o,c,h]);return a.useEffect(()=>{const _=h.userDataManager.getUserDataByIndex(e.id);l(_);const I=Li(h.roomId,e.requestRoomObjectId,re.FLOOR);if(!I)return;u(I);let C=ku;switch(I.specialType){case ae.PET_SHAMPOO:C=Mu;break;case ae.PET_CUSTOM_PART:C=Uu;break;case ae.PET_CUSTOM_PART_SHAMPOO:C=Lu;break;case ae.PET_SADDLE:C=Pu;break;case ae.MONSTERPLANT_REVIVAL:C=Du;break;case ae.MONSTERPLANT_REBREED:C=Fu;break;case ae.MONSTERPLANT_FERTILIZE:C=xu;break}r(C)},[h,e]),o?t(le,{title:g("useproduct.widget.title",["name"],[o.name]),className:"nitro-use-product-confirmation",onCloseClick:s,children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:t(at,{center:!0,children:d(R,{gap:2,overflow:"hidden",children:[t(v,{children:t(P,{pointer:!0,className:"product-preview",onClick:m,children:E})}),d(v,{justifyContent:"between",overflow:"auto",children:[d(v,{gap:2,children:[n===Mu&&d(z,{children:[t(N,{children:g("useproduct.widget.text.shampoo",["productName"],[c.name])}),t(N,{children:g("useproduct.widget.info.shampoo")})]}),n===Uu&&d(z,{children:[t(N,{children:g("useproduct.widget.text.custompart",["productName"],[c.name])}),t(N,{children:g("useproduct.widget.info.custompart")})]}),n===Lu&&d(z,{children:[t(N,{children:g("useproduct.widget.text.custompartshampoo",["productName"],[c.name])}),t(N,{children:g("useproduct.widget.info.custompartshampoo")})]}),n===Pu&&d(z,{children:[t(N,{children:g("useproduct.widget.text.saddle",["productName"],[c.name])}),t(N,{children:g("useproduct.widget.info.saddle")})]}),n===Du&&d(z,{children:[t(N,{children:g("useproduct.widget.text.revive_monsterplant",["productName"],[c.name])}),t(N,{children:g("useproduct.widget.info.revive_monsterplant")})]}),n===Fu&&d(z,{children:[t(N,{children:g("useproduct.widget.text.rebreed_monsterplant",["productName"],[c.name])}),t(N,{children:g("useproduct.widget.info.rebreed_monsterplant")})]}),n===xu&&d(z,{children:[t(N,{children:g("useproduct.widget.text.fertilize_monsterplant",["productName"],[c.name])}),t(N,{children:g("useproduct.widget.info.fertilize_monsterplant")})]})]}),d(R,{alignItems:"center",justifyContent:"between",children:[t(D,{onClick:s,children:g("useproduct.widget.cancel")}),t(D,{onClick:p,children:g("useproduct.widget.use")})]})]})]})})})}):null},Ls=i=>{const{justifyContent:e="center",alignItems:s="center",classNames:n=[],...r}=i,o=a.useMemo(()=>{const l=["menu-header"];return n.length&&l.push(...n),l},[n]);return t(R,{justifyContent:e,alignItems:s,classNames:o,...r})},Q=i=>{const{disabled:e=!1,fullWidth:s=!0,justifyContent:n="center",alignItems:r="center",classNames:o=[],onClick:l=null,...c}=i,u=m=>{e||l&&l(m)},h=a.useMemo(()=>{const m=["menu-item","list-item"];return e&&m.push("disabled"),o.length&&m.push(...o),m},[e,o]);return t(R,{fullWidth:s,justifyContent:n,alignItems:r,classNames:h,onClick:u,...c})},fD=i=>{const{justifyContent:e="center",alignItems:s="center",classNames:n=[],collapsed:r=!0,...o}=i,l=a.useMemo(()=>{const c=["menu-bottom"];return n.length&&c.push(...n),c},[n]);return t(R,{justifyContent:e,alignItems:s,classNames:l,...o,children:t("i",{className:r?"icon icon-context-menu-arrow-up":"icon icon-context-menu-arrow-down"})})},_D=25,Gu=3,ED=5e3,ID=75,_r=10;let Ra=!1,oi=null,ii=-1e6,va=1;const hn=i=>{const{objectId:e=-1,category:s=-1,userType:n=-1,fades:r=!1,onClose:o=null,position:l="absolute",classNames:c=[],style:u={},children:h=null,collapsable:m=!1,colour:p=L.tertiary_grey,...E}=i,[_,I]=a.useState({x:null,y:null}),[C,f]=a.useState(1),[S,T]=a.useState(!1),[b,y]=a.useState(Ra),w=a.useRef(),O=a.useCallback(x=>{if(!S)return;va+=x;let M=(1-va/ID)*1;if(M<=0)return o(),!1;f(M)},[S,o]),F=a.useCallback((x,M)=>{if(!x||!M||!oi)return;let G=-w.current.offsetHeight;n>-1&&(n===vt.USER||n===vt.BOT||n===vt.RENTABLE_BOT)?G=G+(x.height>50?15:0):G=G-14,oi.addValue(M.y-x.top);let H=oi.getMax();H<ii-Gu&&(H=ii-Gu),ii=H;const Y=M.y-H;let q=~~(M.x-w.current.offsetWidth/2),Z=~~(Y+G);const ce=_e().width-w.current.offsetWidth-_r,se=_e().height-w.current.offsetHeight-_r;q<_r?q=_r:q>ce&&(q=ce),Z<_r?Z=_r:Z>se&&(Z=se),I({x:q,y:Z})},[n]),U=a.useMemo(()=>{const x=["ton-context-menu"];return b&&x.push("menu-hidden"),x.push(_.x!==null?"visible":"invisible"),c.length&&x.push(...c),x},[_,c,b]),j=a.useMemo(()=>{let x={};return x.left=_.x||0,x.top=_.y||0,x.opacity=C,Object.keys(u).length&&(x={...x,...u}),x},[_,C,u]);return a.useEffect(()=>{if(!w.current)return;const x=M=>{if(!w.current)return;O(M);const G=Pi(Pe().roomId,e,s),H=x_(Pe().roomId,e,s);F(G,H)};return Nn().add(x),()=>{Nn().remove(x)}},[e,s,O,F]),a.useEffect(()=>{if(!r)return;const x=setTimeout(()=>T(!0),ED);return()=>clearTimeout(x)},[r]),a.useEffect(()=>{Ra=b},[b]),a.useEffect(()=>{oi=new Xw(_D),ii=-1e6,va=1},[]),d(V,{skin:6,colour:p,innerRef:w,position:l,classNames:U,style:j,...E,children:[!(m&&Ra)&&h,m&&t(fD,{onClick:()=>y(!b),collapsed:b}),t(Fo,{colour:p,skin:6})]})},Bu=0,Hu=1,Vu=2,Wu=3,ju=4,qu=5,Yu=6,zu=7,CD=i=>{const{item:e=null,updateConfirmingProduct:s=null,onClose:n=null}=i,[r,o]=a.useState(0),{roomSession:l=null}=Xe(),c=u=>{if(u)switch(u){case"use_product":case"use_product_shampoo":case"use_product_custom_part":case"use_product_custom_part_shampoo":case"use_product_saddle":case"replace_product_saddle":case"revive_monsterplant":case"rebreed_monsterplant":case"fertilize_monsterplant":s(e);break}};return a.useEffect(()=>{if(!e)return;const u=Li(l.roomId,e.requestRoomObjectId,re.FLOOR);if(!u)return;let h=Bu;switch(u.specialType){case ae.PET_SHAMPOO:h=Hu;break;case ae.PET_CUSTOM_PART:h=Vu;break;case ae.PET_CUSTOM_PART_SHAMPOO:h=Wu;break;case ae.PET_SADDLE:h=ju;break;case ae.MONSTERPLANT_REVIVAL:h=qu;break;case ae.MONSTERPLANT_REBREED:h=Yu;break;case ae.MONSTERPLANT_FERTILIZE:h=zu;break}o(h)},[l,e]),d(hn,{objectId:e.id,category:re.UNIT,userType:vt.PET,onClose:n,collapsable:!0,children:[t(Ls,{children:e.name}),r===Bu&&t(Q,{onClick:u=>c("use_product"),children:g("infostand.button.useproduct")}),r===Hu&&t(Q,{onClick:u=>c("use_product_shampoo"),children:g("infostand.button.useproduct_shampoo")}),r===Vu&&t(Q,{onClick:u=>c("use_product_custom_part"),children:g("infostand.button.useproduct_custom_part")}),r===Wu&&t(Q,{onClick:u=>c("use_product_custom_part_shampoo"),children:g("infostand.button.useproduct_custom_part_shampoo")}),r===ju&&d(z,{children:[e.replace&&t(Q,{onClick:u=>c("replace_product_saddle"),children:g("infostand.button.replaceproduct_saddle")}),!e.replace&&t(Q,{onClick:u=>c("use_product_saddle"),children:g("infostand.button.useproduct_saddle")})]}),r===qu&&t(Q,{onClick:u=>c("revive_monsterplant"),children:g("infostand.button.revive_monsterplant")}),r===Yu&&t(Q,{onClick:u=>c("rebreed_monsterplant"),children:g("infostand.button.rebreed_monsterplant")}),r===zu&&t(Q,{onClick:u=>c("fertilize_monsterplant"),children:g("infostand.button.fertilize_monsterplant")}),t(P,{className:"menu-bottom"})]})},SD=i=>{const{avatarInfo:e=null,onClose:s=null}=i;return e?t(V,{skin:4,colour:L.secondary_grey,className:"nitro-infostand",children:d(v,{overflow:"visible",gap:1,children:[d(v,{gap:1,children:[t(R,{alignItems:"center",justifyContent:"between",gap:1,children:t(N,{className:"volter-bold",variant:"white",wrap:!0,children:e.name})}),t("i",{className:"infostand-close",onClick:s}),t("hr",{className:"m-0"})]}),d(v,{gap:1,children:[d(R,{gap:1,children:[t(v,{fullWidth:!0,className:"body-image bot",children:t(it,{figure:e.figure,direction:4})}),t(v,{grow:!0,center:!0,gap:0,children:e.badges.length>0&&e.badges.map(n=>t(ot,{badgeCode:n,showInfo:!0},n))})]}),t("hr",{className:"m-0"})]}),t(R,{alignItems:"center",className:"bg-light-dark py-1 px-2",children:t(N,{fullWidth:!0,wrap:!0,textBreak:!0,variant:"white",className:"motto-content",children:e.motto})}),e.carryItem>0&&d(v,{gap:1,children:[t("hr",{className:"m-0"}),t(N,{variant:"white",wrap:!0,children:g("infostand.text.handitem",["item"],[g("handitem"+e.carryItem)])})]})]})}):null},ba=0,Ku=1,$u=2,TD=i=>{const{avatarInfo:e=null,onClose:s=null}=i,{roomSession:n=null}=Xe(),[r,o]=a.useState(0),[l,c]=a.useState(!1),[u,h]=a.useState(!1),[m,p]=a.useState(!1),[E,_]=a.useState([]),[I,C]=a.useState([]),[f,S]=a.useState([]),[T,b]=a.useState([]),[y,w]=a.useState(!1),[O,F]=a.useState(0),[U,j]=a.useState(0),[x,M]=a.useState(!1),[G,H]=a.useState(!1),[Y,q]=a.useState(null),[Z,ce]=a.useState(!1),[se,ye]=a.useState(!1),[me,lt]=a.useState(-1),[ie,He]=a.useState(""),[ft,Ie]=a.useState("");nr(v_.NPE_SONG_CHANGED,Re=>{lt(Re.id)},Z||se),nr(Ga.SIR_TRAX_SONG_INFO_RECEIVED,Re=>{if(Re.id!==me)return;const Ve=_e().soundManager.musicController.getSongInfo(Re.id);Ve&&(He(Ve.name),Ie(Ve.creator))},Z||se),a.useEffect(()=>{let Re=ba,Ve=!1,Ye=!1,rs=!1,be=[],Ae=[],As=[],hr=[],Qr=!1,Xr=0,Xn=0,Mn=!1,Jr=!1,Jn=!1,Zr=!1,Un=-1;const mn=e.roomControllerLevel>=_t.GUEST;if((mn||e.isOwner||e.isRoomOwner||e.isAnyRoomController)&&(Ve=!0,Ye=!e.isWallItem,e.roomControllerLevel>=_t.MODERATOR&&(Mn=!0)),e.isAnyRoomController&&(Jr=!0),(e.usagePolicy===wc.EVERYBODY||e.usagePolicy===wc.CONTROLLER&&mn||e.extraParam===_n.JUKEBOX&&mn||e.extraParam===_n.USABLE_PRODUCT&&mn)&&(rs=!0),e.extraParam){if(e.extraParam===_n.CRACKABLE_FURNI){const os=e.stuffData;rs=!0,Qr=!0,Xr=os.hits,Xn=os.target}else if(e.extraParam===_n.JUKEBOX){const os=_e().soundManager.musicController.getRoomItemPlaylist();os&&(Un=os.nowPlayingSongId),Jn=!0}else e.extraParam.indexOf(_n.SONGDISK)===0&&(Un=parseInt(e.extraParam.substr(_n.SONGDISK.length)),Zr=!0);if(Mn){const os=e.extraParam.substr(_n.BRANDING_OPTIONS.length);if(os){const Ln=os.split(" ");for(const eo of Ln){const $t=eo.split("=");$t&&$t.length===2&&(be.push($t[0]),Ae.push($t[1]))}}}}if(Mn){const os=X().getRoomObject(n.roomId,e.id,e.isWallItem?re.WALL:re.FLOOR);if(os){const Ln=os.model.getValue(ue.FURNITURE_CUSTOM_VARIABLES),eo=os.model.getValue(ue.FURNITURE_DATA);if(Ln&&Ln.length)for(const $t of Ln)As.push($t),hr.push(eo[$t]||"")}}e.isOwner||e.isAnyRoomController?Re=$u:(e.isRoomOwner||e.roomControllerLevel>=_t.GUILD_ADMIN)&&(Re=Ku),e.isStickie&&(Re=ba),o(Re),c(Ve),h(Ye),p(rs),_(be),C(Ae),S(As),b(hr),w(Qr),F(Xr),j(Xn),M(Mn),H(Jr),q(null),ce(Jn),ye(Zr),lt(Un),e.groupId&&B(new Mr(e.groupId,!1))},[n,e]),W(qr,Re=>{const Ve=Re.getParser();!e||e.groupId!==Ve.id||Ve.flag||(Y&&q(null),q(Ve.title))}),a.useEffect(()=>{const Re=_e().soundManager.musicController.getSongInfo(me);He((Re==null?void 0:Re.name)??""),Ie((Re==null?void 0:Re.creator)??"")},[me]);const ve=a.useCallback((Re,Ve)=>{const Ye=Array.from(I);Ye[Re]=Ve,C(Ye)},[I]),St=a.useCallback((Re,Ve)=>{const Ye=Array.from(T);Ye[Re]=Ve,b(Ye)},[T]),Bt=a.useCallback(()=>{if(E.length===0||I.length===0)return"";let Re="",Ve=0;for(;Ve<E.length;){const Ye=E[Ve],rs=I[Ve];Re=Re+(Ye+"="+rs+" "),Ve++}return Re},[E,I]),Es=a.useCallback(Re=>{if(!(!Re||Re===""))switch(Re){case"buy_one":oe(`catalog/open/offerId/${e.purchaseOfferId}`);return;case"move":X().processRoomObjectOperation(e.id,e.category,zs.OBJECT_MOVE);break;case"rotate":X().processRoomObjectOperation(e.id,e.category,zs.OBJECT_ROTATE_POSITIVE);break;case"pickup":r===$u?X().processRoomObjectOperation(e.id,e.category,zs.OBJECT_PICKUP):X().processRoomObjectOperation(e.id,e.category,zs.OBJECT_EJECT);break;case"use":X().useRoomObject(e.id,e.category);break;case"save_branding_configuration":{const Ve=new Map,Ye=Bt().split(" ");if(Ye)for(const rs of Ye){const[be,Ae]=rs.split("=",2);Ve.set(be,Ae)}X().modifyRoomObjectDataWithMap(e.id,e.category,zs.OBJECT_SAVE_STUFF_DATA,Ve);break}case"save_custom_variables":{const Ve=new Map;for(let Ye=0;Ye<f.length;Ye++){const rs=f[Ye],be=T[Ye];rs&&rs.length&&be&&be.length&&Ve.set(rs,be)}B(new Of(e.id,Ve));break}}},[e,r,f,T,Bt]),tn=a.useCallback(()=>{const Re=e.stuffData;return!Re||!(Re instanceof Oo)?null:Re.getValue(2)},[e]);return e?d(v,{gap:1,alignItems:"end",children:[t(V,{skin:4,className:"nitro-infostand",colour:L.secondary_grey,children:d(v,{overflow:"visible",gap:1,children:[d(v,{gap:1,children:[d(R,{alignItems:"center",justifyContent:"between",gap:1,children:[t(N,{className:"volter-bold",variant:"white",wrap:!0,children:e.name}),t("i",{className:"infostand-close",onClick:s})]}),t("hr",{className:"m-0"})]}),d(v,{gap:1,children:[d(R,{position:"relative",gap:1,children:[e.stuffData.isUnique&&t("div",{className:"position-absolute end-0",children:t(dE,{uniqueNumber:e.stuffData.uniqueNumber,uniqueSeries:e.stuffData.uniqueSeries})}),e.stuffData.rarityLevel>-1&&t("div",{className:"position-absolute end-0",children:t(lc,{level:e.stuffData.rarityLevel})}),e.image&&e.image.src.length&&t("img",{className:"d-block mx-auto",src:e.image.src,alt:""})]}),t("hr",{className:"m-0"})]}),e.description!=""&&d(v,{gap:1,children:[t(N,{fullWidth:!0,wrap:!0,textBreak:!0,variant:"white",children:e.description}),t("hr",{className:"m-0"})]}),d(v,{gap:1,children:[d(R,{alignItems:"center",gap:1,children:[t(bs,{userId:e.ownerId}),t(N,{variant:"white",wrap:!0,children:g("furni.owner",["name"],[e.ownerName])})]}),e.purchaseOfferId>0&&t(R,{children:t(N,{variant:"white",underline:!0,pointer:!0,onClick:Re=>Es("buy_one"),children:g("infostand.button.buy")})})]}),(Z||se)&&d(v,{gap:1,children:[t("hr",{className:"m-0"}),me===-1&&t(N,{variant:"white",small:!0,wrap:!0,children:g("infostand.jukebox.text.not.playing")}),!!ie.length&&d(R,{alignItems:"center",gap:1,children:[t(P,{className:"icon disk-icon"}),t(N,{variant:"white",small:!0,wrap:!0,children:ie})]}),!!ft.length&&d(R,{alignItems:"center",gap:1,children:[t(P,{className:"icon disk-creator"}),t(N,{variant:"white",small:!0,wrap:!0,children:ft})]})]}),d(v,{gap:1,children:[y&&d(z,{children:[t("hr",{className:"m-0"}),t(N,{variant:"white",wrap:!0,children:g("infostand.crackable_furni.hits_remaining",["hits","target"],[O.toString(),U.toString()])})]}),e.groupId>0&&d(z,{children:[t("hr",{className:"m-0"}),d(R,{pointer:!0,alignItems:"center",gap:2,onClick:()=>Uo(e.groupId),children:[t(ot,{badgeCode:tn(),isGroup:!0}),t(N,{variant:"white",underline:!0,children:Y})]})]}),x&&d(z,{children:[t("hr",{className:"m-0"}),G&&d(N,{wrap:!0,variant:"white",children:["ID: ",e.id]}),E.length>0&&d(z,{children:[t("hr",{className:"m-0"}),t(v,{gap:1,children:E.map((Re,Ve)=>d(R,{alignItems:"center",gap:1,children:[t(N,{wrap:!0,align:"end",variant:"white",className:"col-4",children:Re}),t(V,{skin:3,colour:L.white,position:"relative",children:t("input",{type:"text",className:"ton-input",value:I[Ve],onChange:Ye=>ve(Ve,Ye.target.value)})})]},Ve))})]})]}),f.length>0&&d(z,{children:[t("hr",{className:"m-0 my-1"}),t(v,{gap:1,children:f.map((Re,Ve)=>d(R,{alignItems:"center",gap:1,children:[t(N,{wrap:!0,align:"end",variant:"white",className:"col-4",children:Re}),t(V,{skin:3,colour:L.white,position:"relative",children:t("input",{type:"text",className:"ton-input",value:T[Ve],onChange:Ye=>St(Ve,Ye.target.value)})})]},Ve))})]})]})]})}),d(R,{gap:1,justifyContent:"end",className:"button-container",children:[l&&t(D,{skin:3,onClick:Re=>Es("move"),children:g("infostand.button.move")}),u&&t(D,{skin:3,onClick:Re=>Es("rotate"),children:g("infostand.button.rotate")}),r!==ba&&t(D,{skin:3,onClick:Re=>Es("pickup"),children:g(r===Ku?"infostand.button.eject":"infostand.button.pickup")}),m&&t(D,{skin:3,onClick:Re=>Es("use"),children:g("infostand.button.use")}),E.length>0&&I.length>0&&E.length===I.length&&t(D,{skin:3,onClick:()=>Es("save_branding_configuration"),children:g("save")}),f.length>0&&T.length>0&&f.length===T.length&&t(D,{skin:3,onClick:()=>Es("save_custom_variables"),children:g("save")})]})]}):null},ND=i=>{const{avatarInfo:e=null,onClose:s=null}=i,[n,r]=a.useState(0),[o,l]=a.useState(0),{roomSession:c=null}=Xe(),{petRespectRemaining:u=0,respectPet:h=null}=dn();if(a.useEffect(()=>{r(e.remainingGrowTime),l(e.remainingTimeToLive)},[e]),a.useEffect(()=>{if(e.petType!==zt.MONSTERPLANT||e.dead)return;const p=setInterval(()=>{r(E=>E-1),l(E=>E-1)},1e3);return()=>clearInterval(p)},[e]),!e)return null;const m=p=>{let E=!0;if(!(!p||p=="")){switch(p){case"respect":h(e.id),u-1>=1&&(E=!1);break;case"buyfood":oe("catalog/open/"+ee("catalog.links")["pets.buy_saddle"]);break;case"train":break;case"treat":B(new Ui(e.id));break;case"compost":c==null||c.compostPlant(e.id);break;case"pick_up":c==null||c.pickupPet(e.id);break}E&&s()}};return d(v,{gap:1,alignItems:"end",children:[t(V,{skin:4,colour:L.secondary_grey,className:"nitro-infostand",children:d(v,{overflow:"visible",gap:1,children:[d(v,{gap:1,children:[d(R,{alignItems:"center",justifyContent:"between",gap:1,children:[t(N,{variant:"white",wrap:!0,children:e.name}),t("i",{className:"infostand-close",onClick:s})]}),t(N,{variant:"white",wrap:!0,children:g(`pet.breed.${e.petType}.${e.petBreed}`)}),t("hr",{className:"m-0"})]}),e.petType===zt.MONSTERPLANT&&d(z,{children:[d(V,{skin:0,colour:L.infostand_light_grey,fullWidth:!0,className:"body-image",children:[t(Tn,{figure:e.petFigure,posture:e.posture,direction:4}),t("hr",{className:"m-0"})]}),d(v,{gap:2,children:[!e.dead&&t(v,{alignItems:"center",gap:1,children:t(N,{variant:"white",center:!0,wrap:!0,children:g("pet.level",["level","maxlevel"],[e.level.toString(),e.maximumLevel.toString()])})}),d(v,{alignItems:"center",gap:1,children:[t(N,{variant:"white",truncate:!0,children:g("infostand.pet.text.wellbeing")}),d(P,{fullWidth:!0,overflow:"hidden",position:"relative",className:"bg-light-dark ",children:[t(R,{fit:!0,center:!0,position:"absolute",children:t(N,{variant:"white",children:e.dead?"00:00:00":Zn(o==0?e.remainingTimeToLive:o).split(":")[1]+":"+Zn(o==null||o==null?0:o).split(":")[2]+":"+Zn(o==null||o==null?0:o).split(":")[3]})}),t(P,{className:"bg-success pet-stats",style:{width:e.dead?"0":Math.round(e.maximumTimeToLive*100/o).toString()}})]})]}),n!=0&&n>0&&d(v,{alignItems:"center",gap:1,children:[t(N,{variant:"white",truncate:!0,children:g("infostand.pet.text.growth")}),t(MA,{className:"top-2 end-2",day:Zn(n).split(":")[0],hour:Zn(n).split(":")[1],minutes:Zn(n).split(":")[2],seconds:Zn(n).split(":")[3]})]}),d(v,{alignItems:"center",gap:1,children:[t(N,{variant:"white",truncate:!0,children:g("infostand.pet.text.raritylevel",["level"],[g(`infostand.pet.raritylevel.${e.rarityLevel}`)])}),t(lc,{className:"top-2 end-2",level:e.rarityLevel})]}),t("hr",{className:"m-0"})]}),d(v,{gap:1,children:[t(N,{variant:"white",wrap:!0,children:g("pet.age",["age"],[e.age.toString()])}),t("hr",{className:"m-0"})]})]}),e.petType!==zt.MONSTERPLANT&&d(z,{children:[d(v,{gap:1,children:[d(R,{gap:1,children:[t(V,{skin:0,colour:L.infostand_light_grey,fullWidth:!0,className:"body-image",children:t(Tn,{figure:e.petFigure,posture:e.posture,direction:4})}),d(v,{grow:!0,gap:1,children:[t(N,{variant:"white",center:!0,wrap:!0,children:g("pet.level",["level","maxlevel"],[e.level.toString(),e.maximumLevel.toString()])}),d(v,{alignItems:"center",gap:1,children:[t(N,{variant:"white",truncate:!0,children:g("infostand.pet.text.happiness")}),d(P,{fullWidth:!0,overflow:"hidden",position:"relative",className:"bg-light-dark ",children:[t(R,{fit:!0,center:!0,position:"absolute",children:t(N,{variant:"white",children:e.happyness+"/"+e.maximumHappyness})}),t(P,{className:"bg-info pet-stats",style:{width:e.happyness/e.maximumHappyness*100+"%"}})]})]}),d(v,{alignItems:"center",gap:1,children:[t(N,{variant:"white",truncate:!0,children:g("infostand.pet.text.experience")}),d(P,{fullWidth:!0,overflow:"hidden",position:"relative",className:"bg-light-dark ",children:[t(R,{fit:!0,center:!0,position:"absolute",children:t(N,{variant:"white",children:e.experience+"/"+e.levelExperienceGoal})}),t(P,{className:"bg-purple pet-stats",style:{width:e.experience/e.levelExperienceGoal*100+"%"}})]})]}),d(v,{alignItems:"center",gap:1,children:[t(N,{variant:"white",truncate:!0,children:g("infostand.pet.text.energy")}),d(P,{fullWidth:!0,overflow:"hidden",position:"relative",className:"bg-light-dark ",children:[t(R,{fit:!0,center:!0,position:"absolute",children:t(N,{variant:"white",children:e.energy+"/"+e.maximumEnergy})}),t(P,{className:"bg-success pet-stats",style:{width:e.energy/e.maximumEnergy*100+"%"}})]})]})]})]}),t("hr",{className:"m-0"})]}),d(v,{gap:1,children:[e.petType!==zt.MONSTERPLANT&&t(N,{variant:"white",wrap:!0,children:g("infostand.text.petrespect",["count"],[e.respect.toString()])}),t(N,{variant:"white",wrap:!0,children:g("pet.age",["age"],[e.age.toString()])}),t("hr",{className:"m-0"})]})]}),t(v,{gap:1,children:d(R,{alignItems:"center",gap:1,children:[t(bs,{userId:e.ownerId}),t(N,{variant:"white",wrap:!0,children:g("infostand.text.petowner",["name"],[e.ownerName])})]})})]})}),d(R,{gap:1,justifyContent:"end",className:"button-container",children:[e.petType!==zt.MONSTERPLANT&&t(D,{skin:3,colour:L.secondary_grey,onClick:p=>m("buyfood"),children:g("infostand.button.buyfood")}),e.isOwner&&e.petType!==zt.MONSTERPLANT&&t(D,{skin:3,colour:L.secondary_grey,onClick:p=>m("train"),children:g("infostand.button.train")}),!e.dead&&e.energy/e.maximumEnergy<.98&&e.petType===zt.MONSTERPLANT&&t(D,{skin:3,colour:L.secondary_grey,onClick:p=>m("treat"),children:g("infostand.button.pettreat")}),(c==null?void 0:c.isRoomOwner)&&e.petType===zt.MONSTERPLANT&&t(D,{skin:3,colour:L.secondary_grey,onClick:p=>m("compost"),children:g("infostand.button.compost")}),e.isOwner&&t(D,{skin:3,colour:L.secondary_grey,onClick:p=>m("pick_up"),children:g("inventory.pets.pickup")}),u>0&&e.petType!==zt.MONSTERPLANT&&t(D,{skin:3,colour:L.secondary_grey,onClick:p=>m("respect"),children:g("infostand.button.petrespect",["count"],[u.toString()])})]})]})},RD=i=>{const{avatarInfo:e=null,onClose:s=null}=i,n=a.useMemo(()=>!(e.botSkills.indexOf(Ue.NO_PICK_UP)>=0||!e.amIOwner&&!e.amIAnyRoomController),[e]),r=()=>B(new Ll(e.webID));if(e)return d(v,{gap:1,children:[t(V,{skin:4,colour:L.secondary_grey,className:"nitro-infostand",children:d(v,{overflow:"visible",gap:1,children:[d(v,{gap:1,children:[d(R,{alignItems:"center",justifyContent:"between",children:[t(R,{alignItems:"center",gap:1,children:t(N,{className:"volter-bold",variant:"white",wrap:!0,children:e.name})}),t("i",{className:"infostand-close",onClick:s})]}),t("hr",{className:"m-0"})]}),d(v,{gap:1,children:[d(R,{gap:1,children:[t(V,{skin:0,colour:L.infostand_light_grey,className:"body-image bot",children:t(it,{figure:e.figure,direction:4})}),t(v,{grow:!0,center:!0,gap:0,children:e.badges.length>0&&e.badges.map(o=>t(ot,{badgeCode:o,showInfo:!0},o))})]}),t("hr",{className:"m-0"})]}),d(v,{gap:1,children:[t(V,{skin:0,colour:L.infostand_light_grey,className:"py-1 px-2",children:t(N,{fullWidth:!0,wrap:!0,textBreak:!0,variant:"white",className:"motto-content",children:e.motto})}),t("hr",{className:"m-0"})]}),t(v,{gap:1,children:e.carryItem>0&&d(z,{children:[t("hr",{className:"m-0"}),t(N,{variant:"white",wrap:!0,children:g("infostand.text.handitem",["item"],[g("handitem"+e.carryItem)])})]})})]})}),n&&t(R,{justifyContent:"end",className:"button-container",children:t(D,{skin:3,onClick:r,children:g("infostand.button.pickup")})})]})},Oa=i=>{const{type:e=-1,relationship:s=null}=i;if(!s)return null;const n=qs.RELATIONSHIP_NAMES[e].toLocaleLowerCase();return d(R,{alignItems:"center",gap:1,children:[t("i",{className:`nitro-friends-spritesheet icon-${n}`}),t(R,{alignItems:"center",gap:0,children:d(N,{variant:"white",onClick:r=>ps(s.randomFriendId),children:[t("u",{children:s.randomFriendName}),s.friendCount>1&&" "+g(`extendedprofile.relstatus.others.${n}`,["count"],[(s.friendCount-1).toString()])]})})]})},vD=i=>{const{relationships:e=null}=i;return!e||!e.relationshipStatusMap.length?null:d(z,{children:[t(Oa,{type:qs.HEART,relationship:e.relationshipStatusMap.getValue(qs.HEART)}),t(Oa,{type:qs.SMILE,relationship:e.relationshipStatusMap.getValue(qs.SMILE)}),t(Oa,{type:qs.BOBBA,relationship:e.relationshipStatusMap.getValue(qs.BOBBA)})]})},bD=i=>{oe(`navigator/search/${i}`),B(new kl("hotel_view",`tag:${i}`))},OD=i=>{const{tags:e=null}=i;return!e||!e.length?null:d(z,{children:[t("hr",{className:"m-0"}),t(R,{className:"flex-tags",children:e&&e.length>0&&e.map((s,n)=>t(N,{variant:"white",className:"text-tags",onClick:r=>bD(s),children:s},n))})]})},wD=i=>{const{avatarInfo:e=null,setAvatarInfo:s=null,onClose:n=null}=i,[r,o]=a.useState(null),[l,c]=a.useState(!1),[u,h]=a.useState(null),{roomSession:m=null}=Xe(),p=I=>{!l||I.length>ee("motto.max.length",38)||(m.sendMottoMessage(I),c(!1))},E=I=>p(I.target.value),_=I=>{switch(I.stopPropagation(),I.key){case"Enter":p(I.target.value);return}};return $e(Jw.RSUBE_BADGES,I=>{!e||e.webID!==I.userId||e.badges.join("")===I.badges.join("")||s(f=>{const S=ts(f);return S.badges=I.badges,S})}),$e(Zw.USER_FIGURE,I=>{!e||e.roomIndex!==I.roomIndex||s(C=>{const f=ts(C);return f.figure=I.figure,f.motto=I.customInfo,f.achievementScore=I.activityPoints,f})}),$e(ey.FAVOURITE_GROUP_UPDATE,I=>{!e||e.roomIndex!==I.roomIndex||s(C=>{const f=ts(C),S=I.status===-1||I.habboGroupId<=0;return f.groupId=S?-1:I.habboGroupId,f.groupName=S?null:I.habboGroupName,f.groupBadgeId=S?null:J().getGroupBadge(I.habboGroupId),f})}),W(Rl,I=>{const C=I.getParser();!e||e.webID!==C.userId||h(C)}),a.useEffect(()=>(c(!1),o(e.motto),B(new xl(e.webID)),()=>{c(!1),o(null),h(null)}),[e]),e?t(V,{skin:4,colour:L.secondary_grey,className:"nitro-infostand nitro-infostand-user",children:d(v,{overflow:"visible",gap:1,children:[d(v,{gap:1,children:[d(R,{alignItems:"center",justifyContent:"between",children:[d(R,{alignItems:"center",gap:1,children:[t(bs,{userId:e.webID}),t(N,{className:"volter-bold",variant:"white",wrap:!0,children:e.name})]}),t("i",{className:"infostand-close",onClick:n})]}),t("hr",{className:"m-0"})]}),d(v,{gap:1,children:[d(R,{gap:1,children:[t(V,{skin:0,colour:L.infostand_light_grey,fullWidth:!0,className:"body-image",onClick:I=>ps(e.webID),children:t(it,{figure:e.figure,direction:4})}),d(v,{grow:!0,gap:0,children:[d(R,{center:!0,gap:1,children:[t(R,{center:!0,className:"badge-image",children:e.badges[0]&&t(ot,{badgeCode:e.badges[0],showInfo:!0})}),t(R,{center:!0,pointer:e.groupId>0,className:"badge-image",onClick:I=>Uo(e.groupId),children:e.groupId>0&&t(ot,{badgeCode:e.groupBadgeId,isGroup:!0,showInfo:!0,customTitle:e.groupName})})]}),d(R,{center:!0,gap:1,children:[t(R,{center:!0,className:"badge-image",children:e.badges[1]&&t(ot,{badgeCode:e.badges[1],showInfo:!0})}),t(R,{center:!0,className:"badge-image",children:e.badges[2]&&t(ot,{badgeCode:e.badges[2],showInfo:!0})})]}),d(R,{center:!0,gap:1,children:[t(R,{center:!0,className:"badge-image",children:e.badges[3]&&t(ot,{badgeCode:e.badges[3],showInfo:!0})}),t(R,{center:!0,className:"badge-image",children:e.badges[4]&&t(ot,{badgeCode:e.badges[4],showInfo:!0})})]})]})]}),t("hr",{className:"m-0"})]}),d(v,{gap:1,children:[d(V,{skin:0,colour:L.infostand_light_grey,className:"py-1 px-2",children:[e.type!==mt.OWN_USER&&t(R,{grow:!0,alignItems:"center",className:"motto-content",children:t(N,{pointer:!0,wrap:!0,textBreak:!0,variant:"white",children:r})}),e.type===mt.OWN_USER&&d(R,{grow:!0,alignItems:"center",gap:2,children:[t("i",{className:"icon pencil-icon"}),d(R,{grow:!0,alignItems:"center",className:"motto-content",children:[!l&&d(N,{fullWidth:!0,pointer:!0,wrap:!0,textBreak:!0,variant:"white",onClick:I=>c(!0),children:[r," "]}),l&&t("input",{type:"text",className:"motto-input",maxLength:ee("motto.max.length",38),value:r,onChange:I=>o(I.target.value),onBlur:E,onKeyDown:_,autoFocus:!0})]})]})]}),t("hr",{className:"m-0"})]}),d(v,{gap:1,children:[t(N,{variant:"white",wrap:!0,children:g("infostand.text.achievement_score")+" "+e.achievementScore}),e.carryItem>0&&d(z,{children:[t("hr",{className:"m-0"}),t(N,{variant:"white",wrap:!0,children:g("infostand.text.handitem",["item"],[g("handitem"+e.carryItem)])})]})]}),t(v,{gap:1,children:t(vD,{relationships:u})}),ee("user.tags.enabled")&&t(v,{gap:1,className:"mt-1",children:t(OD,{tags:J().tags})})]})}):null},ai=0,wa=1,Qu=2,Xu=3,ya=4,Ju=5,Zu=6,yD=i=>{const{avatarInfo:e=null,onClose:s=null}=i,[n,r]=a.useState(ai),{canRequestFriend:o=null}=ns(),{report:l=null}=un(),{roomSession:c=null}=Xe(),{userRespectRemaining:u=0,respectUser:h=null}=dn(),m=a.useMemo(()=>e.amIOwner&&e.targetRoomControllerLevel<_t.GUEST&&!e.isGuildRoom,[e]),p=a.useMemo(()=>e.amIOwner&&e.targetRoomControllerLevel===_t.GUEST&&!e.isGuildRoom,[e]),E=a.useMemo(()=>e.canBeKicked||e.canBeBanned||e.canBeMuted||m||p,[m,p,e]),_=a.useMemo(()=>{let C=!1;const f=dr();if(f){const S=f.model.getValue(ue.FIGURE_CARRY_OBJECT);S>0&&S<999999&&(C=!0)}return C},[]),I=C=>{let f=!0;if(C)switch(C){case"moderate":f=!1,r(wa);break;case"ban":f=!1,r(Qu);break;case"mute":f=!1,r(Xu);break;case"ambassador":f=!1,r(ya);break;case"ambassador_mute":f=!1,r(Ju);break;case"back_moderate":f=!1,r(wa);break;case"back_ambassador":f=!1,r(ya);break;case"back":f=!1,r(ai);break;case"whisper":At(new Hn(Hn.WHISPER,e.name));break;case"friend":oe(`friends/request/${e.webID}/${e.name}`);break;case"relationship":f=!1,r(Zu);break;case"respect":{h(e.webID),u-1>=1&&(f=!1);break}case"ignore":J().ignoreUser(e.name);break;case"unignore":J().unignoreUser(e.name);break;case"kick":c.sendKickMessage(e.webID);break;case"ban_hour":c.sendBanMessage(e.webID,"RWUAM_BAN_USER_HOUR");break;case"ban_day":c.sendBanMessage(e.webID,"RWUAM_BAN_USER_DAY");break;case"perm_ban":c.sendBanMessage(e.webID,"RWUAM_BAN_USER_PERM");break;case"mute_2min":c.sendMuteMessage(e.webID,2);break;case"mute_5min":c.sendMuteMessage(e.webID,5);break;case"mute_10min":c.sendMuteMessage(e.webID,10);break;case"give_rights":c.sendGiveRightsMessage(e.webID);break;case"remove_rights":c.sendTakeRightsMessage(e.webID);break;case"trade":B(new pf(e.roomIndex));break;case"report":l(rt.BULLY,{reportedUserId:e.webID});break;case"pass_hand_item":B(new Df(e.webID));break;case"ambassador_alert":c.sendAmbassadorAlertMessage(e.webID);break;case"ambassador_kick":c.sendKickMessage(e.webID);break;case"ambassador_mute_2min":c.sendMuteMessage(e.webID,2);break;case"ambassador_mute_10min":c.sendMuteMessage(e.webID,10);break;case"ambassador_mute_60min":c.sendMuteMessage(e.webID,60);break;case"ambassador_mute_18hour":c.sendMuteMessage(e.webID,1080);break;case"rship_heart":B(new Sr(e.webID,Kt.RELATIONSHIP_HEART));break;case"rship_smile":B(new Sr(e.webID,Kt.RELATIONSHIP_SMILE));break;case"rship_bobba":B(new Sr(e.webID,Kt.RELATIONSHIP_BOBBA));break;case"rship_none":B(new Sr(e.webID,Kt.RELATIONSHIP_NONE));break}f&&s()};return a.useEffect(()=>{r(ai)},[e]),d(hn,{objectId:e.roomIndex,category:re.UNIT,userType:e.userType,onClose:s,collapsable:!0,children:[t(Ls,{className:"cursor-pointer",onClick:C=>ps(e.webID),children:e.name}),n===ai&&d(z,{children:[o(e.webID)&&t(Q,{onClick:C=>I("friend"),children:g("infostand.button.friend")}),t(Q,{onClick:C=>I("trade"),children:g("infostand.button.trade")}),t(Q,{onClick:C=>I("whisper"),children:g("infostand.button.whisper")}),u>0&&t(Q,{onClick:C=>I("respect"),children:g("infostand.button.respect",["count"],[u.toString()])}),!o(e.webID)&&d(Q,{onClick:C=>I("relationship"),children:[g("infostand.link.relationship"),t("i",{className:"icon icon-context-arrow-right right"})]}),!e.isIgnored&&t(Q,{onClick:C=>I("ignore"),children:g("infostand.button.ignore")}),e.isIgnored&&t(Q,{onClick:C=>I("unignore"),children:g("infostand.button.unignore")}),t(Q,{onClick:C=>I("report"),children:g("infostand.button.report")}),E&&d(Q,{onClick:C=>I("moderate"),children:[g("infostand.link.moderate"),t("i",{className:"icon icon-context-arrow-right right"})]}),e.isAmbassador&&d(Q,{onClick:C=>I("ambassador"),children:[g("infostand.link.ambassador"),t("i",{className:"icon icon-context-arrow-right right"})]}),_&&t(Q,{onClick:C=>I("pass_hand_item"),children:g("avatar.widget.pass_hand_item")})]}),n===wa&&d(z,{children:[t(Q,{onClick:C=>I("kick"),children:g("infostand.button.kick")}),d(Q,{onClick:C=>I("mute"),children:[g("infostand.button.mute"),t("i",{className:"icon icon-context-arrow-right right"})]}),d(Q,{onClick:C=>I("ban"),children:[g("infostand.button.ban"),t("i",{className:"icon icon-context-arrow-right right"})]}),m&&t(Q,{onClick:C=>I("give_rights"),children:g("infostand.button.giverights")}),p&&t(Q,{onClick:C=>I("remove_rights"),children:g("infostand.button.removerights")}),d(Q,{onClick:C=>I("back"),children:[t("i",{className:"icon icon-context-arrow-left left"}),g("generic.back")]})]}),n===Qu&&d(z,{children:[t(Q,{onClick:C=>I("ban_hour"),children:g("infostand.button.ban_hour")}),t(Q,{onClick:C=>I("ban_day"),children:g("infostand.button.ban_day")}),t(Q,{onClick:C=>I("perm_ban"),children:g("infostand.button.perm_ban")}),d(Q,{onClick:C=>I("back_moderate"),children:[t("i",{className:"icon icon-context-arrow-left left"}),g("generic.back")]})]}),n===Xu&&d(z,{children:[t(Q,{onClick:C=>I("mute_2min"),children:g("infostand.button.mute_2min")}),t(Q,{onClick:C=>I("mute_5min"),children:g("infostand.button.mute_5min")}),t(Q,{onClick:C=>I("mute_10min"),children:g("infostand.button.mute_10min")}),d(Q,{onClick:C=>I("back_moderate"),children:[t("i",{className:"icon icon-context-arrow-left left"}),g("generic.back")]})]}),n===ya&&d(z,{children:[t(Q,{onClick:C=>I("ambassador_alert"),children:g("infostand.button.alert")}),t(Q,{onClick:C=>I("ambassador_kick"),children:g("infostand.button.kick")}),d(Q,{onClick:C=>I("ambassador_mute"),children:[g("infostand.button.mute"),t("i",{className:"icon icon-context-arrow-right right"})]}),d(Q,{onClick:C=>I("back"),children:[t("i",{className:"icon icon-context-arrow-left left"}),g("generic.back")]})]}),n===Ju&&d(z,{children:[t(Q,{onClick:C=>I("ambassador_mute_2min"),children:g("infostand.button.mute_2min")}),t(Q,{onClick:C=>I("ambassador_mute_10min"),children:g("infostand.button.mute_10min")}),t(Q,{onClick:C=>I("ambassador_mute_60min"),children:g("infostand.button.mute_60min")}),t(Q,{onClick:C=>I("ambassador_mute_18hr"),children:g("infostand.button.mute_18hour")}),d(Q,{onClick:C=>I("back_ambassador"),children:[t("i",{className:"icon icon-context-arrow-left left"}),g("generic.back")]})]}),n===Zu&&d(z,{children:[d(R,{className:"menu-list-split-3",children:[t(Q,{onClick:C=>I("rship_heart"),children:t(P,{pointer:!0,className:"nitro-friends-spritesheet icon-heart"})}),t(Q,{onClick:C=>I("rship_smile"),children:t(P,{pointer:!0,className:"nitro-friends-spritesheet icon-smile"})}),t(Q,{onClick:C=>I("rship_bobba"),children:t(P,{pointer:!0,className:"nitro-friends-spritesheet icon-bobba"})})]}),t(Q,{onClick:C=>I("rship_none"),children:g("avatar.widget.clear_relationship")}),d(Q,{onClick:C=>I("back"),children:[t("i",{className:"icon icon-context-arrow-left left"}),g("generic.back")]})]})]})},AD=i=>{const{classNames:e=[],...s}=i,n=a.useMemo(()=>{const r=["menu-list"];return e.length&&r.push(...e),r},[e]);return t(v,{classNames:n,...s})},kD=i=>{const{userId:e=-1,userName:s="",roomIndex:n=-1,setIsDecorating:r=null}=i;return d(hn,{objectId:n,category:re.UNIT,onClose:null,children:[t(AD,{children:t(Q,{onClick:o=>r(!1),children:g("widget.avatar.stop_decorating")})}),t(R,{className:"menu-bottom"})]})},MD=i=>{const{avatarInfo:e=null,onClose:s=null}=i,n=r=>{if(r)switch(r){case"move":Rr(e.id,e.category,zs.OBJECT_MOVE);break;case"rotate":Rr(e.id,e.category,zs.OBJECT_ROTATE_POSITIVE);break;case"pickup":Rr(e.id,e.category,zs.OBJECT_PICKUP);break;case"eject":Rr(e.id,e.category,zs.OBJECT_EJECT);break}};return d(hn,{objectId:e.id,category:e.category,onClose:s,collapsable:!0,children:[t(Ls,{children:e.name}),d(R,{className:"menu-list-split-3",children:[t(Q,{onClick:r=>n("move"),children:t(Gt,{icon:"arrows-up-down-left-right",className:"center"})}),t(Q,{onClick:r=>n("rotate"),disabled:e.isWallItem,children:t(Gt,{icon:"rotate",className:"center"})}),(e.isOwner||e.isAnyRoomController)&&t(Q,{onClick:r=>n("pickup"),children:t(Gt,{icon:"trash-arrow-up",className:"center"})}),!e.isOwner&&!e.isAnyRoomController&&(e.isRoomOwner||e.roomControllerLevel>=_t.GUILD_ADMIN)&&t(Q,{onClick:r=>n("eject"),children:t(Gt,{icon:"trash-arrow-up",className:"center"})})]})]})},ed=i=>{const{nameInfo:e=null,onClose:s=null}=i,n=a.useMemo(()=>["name-only"],[e]);return t(hn,{objectId:e.roomIndex,category:e.category,userType:e.userType,fades:e.id!==J().userId,classNames:n,onClose:s,colour:e.isFriend?L.secondary_green:L.tertiary_grey,children:e.name})},Aa=0,ka=1,td=3,sd=4,UD=i=>{const{avatarInfo:e=null,isDancing:s=!1,setIsDecorating:n=null,onClose:r=null}=i,[o,l]=a.useState(s&&Nr()?ka:Aa),{roomSession:c=null}=Xe(),u=p=>{let E=!0;if(p)if(p.startsWith("sign_")){const _=parseInt(p.split("_")[1]);c.sendSignMessage(_)}else switch(p){case"decorate":n(!0);break;case"change_name":At(new Oi(Oi.INIT));break;case"change_looks":oe("avatar-editor/show");break;case"expressions":E=!1,l(td);break;case"sit":c.sendPostureMessage(Ni.POSTURE_SIT);break;case"stand":c.sendPostureMessage(Ni.POSTURE_STAND);break;case"wave":c.sendExpressionMessage(on.WAVE.ordinal);break;case"blow":c.sendExpressionMessage(on.BLOW.ordinal);break;case"laugh":c.sendExpressionMessage(on.LAUGH.ordinal);break;case"idle":c.sendExpressionMessage(on.IDLE.ordinal);break;case"dance_menu":E=!1,l(ka);break;case"dance":c.sendDanceMessage(1);break;case"dance_stop":c.sendDanceMessage(0);break;case"dance_1":case"dance_2":case"dance_3":case"dance_4":c.sendDanceMessage(parseInt(p.charAt(p.length-1)));break;case"signs":E=!1,l(sd);break;case"back":E=!1,l(Aa);break;case"drop_carry_item":B(new Pf);break}E&&r()},h=()=>e.amIOwner||e.amIAnyRoomController||e.roomControllerLevel>_t.GUEST,m=vy();return d(hn,{objectId:e.roomIndex,category:re.UNIT,userType:e.userType,onClose:r,collapsable:!0,children:[t(Ls,{className:"cursor-pointer",onClick:p=>ps(e.webID),children:e.name}),o===Aa&&d(z,{children:[e.allowNameChange&&t(Q,{onClick:p=>u("change_name"),children:g("widget.avatar.change_name")}),h()&&t(Q,{onClick:p=>u("decorate"),children:g("widget.avatar.decorate")}),t(Q,{onClick:p=>u("change_looks"),children:g("widget.memenu.myclothes")}),Nr()&&!m&&d(Q,{gap:1,onClick:p=>u("dance_menu"),children:[g("widget.memenu.dance"),t("i",{className:"icon icon-context-arrow-right right"})]}),!s&&!Nr()&&!m&&t(Q,{onClick:p=>u("dance"),children:g("widget.memenu.dance")}),s&&!Nr()&&!m&&t(Q,{onClick:p=>u("dance_stop"),children:g("widget.memenu.dance.stop")}),d(Q,{gap:1,onClick:p=>u("expressions"),children:[g("infostand.link.expressions"),t("i",{className:"icon icon-context-arrow-right right"})]}),d(Q,{gap:1,onClick:p=>u("signs"),children:[g("infostand.show.signs"),t("i",{className:"icon icon-context-arrow-right right"})]}),e.carryItem>0&&t(Q,{onClick:p=>u("drop_carry_item"),children:g("avatar.widget.drop_hand_item")})]}),o===ka&&d(z,{children:[s&&t(Q,{onClick:p=>u("dance_stop"),children:g("widget.memenu.dance.stop")}),t(Q,{onClick:p=>u("dance_1"),children:g("widget.memenu.dance1")}),t(Q,{onClick:p=>u("dance_2"),children:g("widget.memenu.dance2")}),t(Q,{onClick:p=>u("dance_3"),children:g("widget.memenu.dance3")}),t(Q,{onClick:p=>u("dance_4"),children:g("widget.memenu.dance4")}),d(Q,{gap:1,onClick:p=>u("back"),children:[t("i",{className:"icon icon-context-arrow-left left"}),g("generic.back")]})]}),o===td&&d(z,{children:[Ny()===Or.POSTURE_STAND&&t(Q,{onClick:p=>u("sit"),children:g("widget.memenu.sit")}),hy()&&t(Q,{onClick:p=>u("stand"),children:g("widget.memenu.stand")}),ma()&&t(Q,{onClick:p=>u("wave"),children:g("widget.memenu.wave")}),ma()&&d(Q,{disabled:!Xo(),onClick:p=>u("laugh"),children:[!Xo()&&t(wt,{type:"hc"}),g("widget.memenu.laugh")]}),ma()&&d(Q,{disabled:!Xo(),onClick:p=>u("blow"),children:[!Xo()&&t(wt,{type:"hc"}),g("widget.memenu.blow")]}),t(Q,{onClick:p=>u("idle"),children:g("widget.memenu.idle")}),d(Q,{gap:1,onClick:p=>u("back"),children:[t("i",{className:"icon icon-context-arrow-left left"}),g("generic.back")]})]}),o===sd&&d(z,{children:[d(R,{className:"menu-list-split-3",children:[t(Q,{onClick:p=>u("sign_1"),children:"1"}),t(Q,{onClick:p=>u("sign_2"),children:"2"}),t(Q,{onClick:p=>u("sign_3"),children:"3"})]}),d(R,{className:"menu-list-split-3",children:[t(Q,{onClick:p=>u("sign_4"),children:"4"}),t(Q,{onClick:p=>u("sign_5"),children:"5"}),t(Q,{onClick:p=>u("sign_6"),children:"6"})]}),d(R,{className:"menu-list-split-3",children:[t(Q,{onClick:p=>u("sign_7"),children:"7"}),t(Q,{onClick:p=>u("sign_8"),children:"8"}),t(Q,{onClick:p=>u("sign_9"),children:"9"})]}),d(R,{className:"menu-list-split-3",children:[t(Q,{onClick:p=>u("sign_10"),children:"10"}),t(Q,{onClick:p=>u("sign_11"),children:t("i",{className:"icon icon-sign-heart"})}),t(Q,{onClick:p=>u("sign_12"),children:t("i",{className:"icon icon-sign-skull"})})]}),d(R,{className:"menu-list-split-3",children:[t(Q,{onClick:p=>u("sign_0"),children:"0"}),t(Q,{onClick:p=>u("sign_13"),children:t("i",{className:"icon icon-sign-exclamation"})}),t(Q,{onClick:p=>u("sign_15"),children:t("i",{className:"icon icon-sign-smile"})})]}),d(R,{className:"menu-list-split-3",children:[t(Q,{onClick:p=>u("sign_14"),children:t("i",{className:"icon icon-sign-soccer"})}),t(Q,{onClick:p=>u("sign_17"),children:t("i",{className:"icon icon-sign-yellow"})}),t(Q,{onClick:p=>u("sign_16"),children:t("i",{className:"icon icon-sign-red"})})]}),d(Q,{gap:1,onClick:p=>u("back"),children:[t("i",{className:"icon icon-context-arrow-left left"}),g("generic.back")]})]})]})},Ma=0,nd=1,rd=2,od=3,LD=i=>{const{avatarInfo:e=null,onClose:s=null}=i,[n,r]=a.useState(Ma),{roomSession:o=null}=Xe(),{petRespectRemaining:l=0,respectPet:c=null}=dn(),u=a.useMemo(()=>{let m=!1;const p=dr();if(p){const E=p.model.getValue(ue.FIGURE_CARRY_OBJECT);E>0&&E<999999&&(m=!0)}return m},[]),h=m=>{let p=!0;if(m)switch(m){case"respect":c(e.id),l-1>=1&&(p=!1);break;case"treat":B(new Ui(e.id));break;case"pass_handitem":B(new Dl(e.id));break;case"train":break;case"pick_up":o.pickupPet(e.id);break;case"mount":o.mountPet(e.id);break;case"toggle_riding_permission":o.togglePetRiding(e.id);break;case"toggle_breeding_permission":o.togglePetBreeding(e.id);break;case"dismount":o.dismountPet(e.id);break;case"saddle_off":o.removePetSaddle(e.id);break;case"breed":break;case"harvest":o.harvestPet(e.id);break;case"revive":break;case"compost":o.compostPlant(e.id);break;case"buy_saddle":oe("catalog/open/"+ee("catalog.links")["pets.buy_saddle"]);break}p&&s()};return a.useEffect(()=>{r(m=>e.petType===zt.MONSTERPLANT?od:e.saddle&&!e.rider?nd:e.rider?rd:Ma)},[e]),d(hn,{objectId:e.roomIndex,category:re.UNIT,userType:vt.PET,onClose:s,collapsable:!0,children:[t(Ls,{children:e.name}),n===Ma&&d(z,{children:[l>0&&t(Q,{onClick:m=>h("respect"),children:g("infostand.button.petrespect",["count"],[l.toString()])}),t(Q,{onClick:m=>h("train"),children:g("infostand.button.train")}),t(Q,{onClick:m=>h("pick_up"),children:g("infostand.button.pickup")}),e.petType===zt.HORSE&&t(Q,{onClick:m=>h("buy_saddle"),children:g("infostand.button.buy_saddle")}),[zt.BEAR,zt.TERRIER,zt.CAT,zt.DOG,zt.PIG].indexOf(e.petType)>-1&&t(Q,{onClick:m=>h("breed"),children:g("infostand.button.breed")})]}),n===nd&&d(z,{children:[t(Q,{onClick:m=>h("mount"),children:g("infostand.button.mount")}),d(Q,{onClick:m=>h("toggle_riding_permission"),gap:1,children:[t("input",{type:"checkbox",checked:!!e.publiclyRideable,readOnly:!0}),g("infostand.button.toggle_riding_permission")]}),l>0&&t(Q,{onClick:m=>h("respect"),children:g("infostand.button.petrespect",["count"],[l.toString()])}),t(Q,{onClick:m=>h("train"),children:g("infostand.button.train")}),t(Q,{onClick:m=>h("pick_up"),children:g("infostand.button.pickup")}),t(Q,{onClick:m=>h("saddle_off"),children:g("infostand.button.saddleoff")})]}),n===rd&&d(z,{children:[t(Q,{onClick:m=>h("dismount"),children:g("infostand.button.dismount")}),l>0&&t(Q,{onClick:m=>h("respect"),children:g("infostand.button.petrespect",["count"],[l.toString()])})]}),n===od&&d(z,{children:[t(Q,{onClick:m=>h("pick_up"),children:g("infostand.button.pickup")}),e.dead&&t(Q,{onClick:m=>h("revive"),children:g("infostand.button.revive")}),o.isRoomOwner&&t(Q,{onClick:m=>h("compost"),children:g("infostand.button.compost")}),!e.dead&&e.energy/e.maximumEnergy<.98&&t(Q,{onClick:m=>h("treat"),children:g("infostand.button.pettreat")}),!e.dead&&e.level===e.maximumLevel&&e.breedable&&d(z,{children:[d(Q,{onClick:m=>h("toggle_breeding_permission"),gap:1,children:[t("input",{type:"checkbox",checked:e.publiclyBreedable,readOnly:!0}),g("infostand.button.toggle_breeding_permission")]}),t(Q,{onClick:m=>h("breed"),children:g("infostand.button.breed")})]})]}),u&&t(Q,{onClick:m=>h("pass_hand_item"),children:g("infostand.button.pass_hand_item")})]})},Ua=0,id=1,ad=2,ld=3,PD=i=>{const{avatarInfo:e=null,onClose:s=null}=i,[n,r]=a.useState(Ua),{roomSession:o=null}=Xe(),{petRespectRemaining:l=0,respectPet:c=null}=dn(),u=a.useMemo(()=>o.isRoomOwner||o.controllerLevel>=_t.GUEST||J().isModerator,[o]),h=a.useMemo(()=>{let p=!1;const E=dr();if(E){const _=E.model.getValue(ue.FIGURE_CARRY_OBJECT);_>0&&_<999999&&(p=!0)}return p},[]),m=p=>{let E=!0;if(p)switch(p){case"respect":c(e.id),l-1>=1&&(E=!1);break;case"treat":B(new Ui(e.id));break;case"pass_handitem":B(new Dl(e.id));break;case"pick_up":o.pickupPet(e.id);break;case"mount":o.mountPet(e.id);break;case"dismount":o.dismountPet(e.id);break}E&&s()};return a.useEffect(()=>{r(p=>e.petType===zt.MONSTERPLANT?ld:e.saddle&&!e.rider?id:e.rider?ad:Ua)},[e]),d(hn,{objectId:e.roomIndex,category:re.UNIT,userType:vt.PET,onClose:s,collapsable:!0,children:[t(Ls,{children:e.name}),n===Ua&&l>0&&t(Q,{onClick:p=>m("respect"),children:g("infostand.button.petrespect",["count"],[l.toString()])}),n===id&&d(z,{children:[!!e.publiclyRideable&&t(Q,{onClick:p=>m("mount"),children:g("infostand.button.mount")}),l>0&&t(Q,{onClick:p=>m("respect"),children:g("infostand.button.petrespect",["count"],[l.toString()])})]}),n===ad&&d(z,{children:[t(Q,{onClick:p=>m("dismount"),children:g("infostand.button.dismount")}),l>0&&t(Q,{onClick:p=>m("respect"),children:g("infostand.button.petrespect",["count"],[l.toString()])})]}),n===ld&&!e.dead&&e.energy/e.maximumEnergy<.98&&t(Q,{onClick:p=>m("treat"),children:g("infostand.button.pettreat")}),u&&t(Q,{onClick:p=>m("pick_up"),children:g("infostand.button.pickup")}),h&&t(Q,{onClick:p=>m("pass_hand_item"),children:g("infostand.button.pass_hand_item")})]})},La=0,cd=1,ud=2,DD=i=>{const{avatarInfo:e=null,onClose:s=null}=i,[n,r]=a.useState(La),[o,l]=a.useState(""),[c,u]=a.useState("");W(Qm,E=>{const _=E.getParser();if(_.botId===e.webID)switch(_.commandId){case Ue.CHANGE_BOT_NAME:l(_.data),r(cd);return;case Ue.CHANGE_BOT_MOTTO:u(_.data),r(ud);return;case Ue.SETUP_CHAT:{const I=_.data,C=I.split(I.indexOf(";#;")===-1?";":";#;");(C.length===3||C.length===4)&&(At(new Jl(e.roomIndex,re.UNIT,e.webID,C[0],C[1].toLowerCase()==="true"||C[1]==="1",parseInt(C[2]),C[3]?C[3].toLowerCase()==="true"||C[3]==="1":!1)),s());return}}});const h=E=>B(new bf(e.webID,E)),m=E=>{let _=!0;if(E)switch(E){case"donate_to_all":h(Ue.DONATE_TO_ALL),B(new rn(e.webID,Ue.DONATE_TO_ALL,""));break;case"donate_to_user":h(Ue.DONATE_TO_USER),B(new rn(e.webID,Ue.DONATE_TO_USER,""));break;case"change_bot_name":h(Ue.CHANGE_BOT_NAME),_=!1;break;case"save_bot_name":B(new rn(e.webID,Ue.CHANGE_BOT_NAME,o));break;case"change_bot_motto":h(Ue.CHANGE_BOT_MOTTO),_=!1;break;case"save_bot_motto":B(new rn(e.webID,Ue.CHANGE_BOT_MOTTO,c));break;case"dress_up":B(new rn(e.webID,Ue.DRESS_UP,""));break;case"random_walk":B(new rn(e.webID,Ue.RANDOM_WALK,""));break;case"setup_chat":h(Ue.SETUP_CHAT),_=!1;break;case"dance":B(new rn(e.webID,Ue.DANCE,""));break;case"nux_take_tour":_e().createLinkEvent("help/tour"),B(new rn(e.webID,Ue.NUX_TAKE_TOUR,""));break;case"pick":B(new Ll(e.webID));break}_&&s()};a.useEffect(()=>{r(La)},[e]);const p=e.amIOwner||e.amIAnyRoomController;return d(hn,{objectId:e.roomIndex,category:re.UNIT,userType:vt.RENTABLE_BOT,onClose:s,collapsable:!0,children:[t(Ls,{children:e.name}),n===La&&p&&d(z,{children:[e.botSkills.indexOf(Ue.DONATE_TO_ALL)>=0&&t(Q,{onClick:E=>m("donate_to_all"),children:g("avatar.widget.donate_to_all")}),e.botSkills.indexOf(Ue.DONATE_TO_USER)>=0&&t(Q,{onClick:E=>m("donate_to_user"),children:g("avatar.widget.donate_to_user")}),e.botSkills.indexOf(Ue.CHANGE_BOT_NAME)>=0&&t(Q,{onClick:E=>m("change_bot_name"),children:g("avatar.widget.change_bot_name")}),e.botSkills.indexOf(Ue.CHANGE_BOT_MOTTO)>=0&&t(Q,{onClick:E=>m("change_bot_motto"),children:g("avatar.widget.change_bot_motto")}),e.botSkills.indexOf(Ue.DRESS_UP)>=0&&t(Q,{onClick:E=>m("dress_up"),children:g("avatar.widget.dress_up")}),e.botSkills.indexOf(Ue.RANDOM_WALK)>=0&&t(Q,{onClick:E=>m("random_walk"),children:g("avatar.widget.random_walk")}),e.botSkills.indexOf(Ue.SETUP_CHAT)>=0&&t(Q,{onClick:E=>m("setup_chat"),children:g("avatar.widget.setup_chat")}),e.botSkills.indexOf(Ue.DANCE)>=0&&t(Q,{onClick:E=>m("dance"),children:g("avatar.widget.dance")}),e.botSkills.indexOf(Ue.NO_PICK_UP)===-1&&t(Q,{onClick:E=>m("pick"),children:g("avatar.widget.pick_up")})]}),n===cd&&d(v,{className:"menu-item",onClick:null,gap:1,children:[t(N,{variant:"white",children:g("bot.skill.name.configuration.new.name")}),t("input",{type:"text",className:"form-control ",value:o,maxLength:ee("bot.name.max.length",15),onChange:E=>l(E.target.value)}),d(R,{alignItems:"center",justifyContent:"between",gap:1,children:[t(D,{fullWidth:!0,onClick:E=>m(null),children:g("cancel")}),t(D,{fullWidth:!0,onClick:E=>m("save_bot_name"),children:g("save")})]})]}),n===ud&&d(v,{className:"menu-item",onClick:null,gap:1,children:[t(N,{variant:"white",children:g("bot.skill.name.configuration.new.motto")}),t("input",{type:"text",className:"form-control ",value:c,maxLength:ee("motto.max.length",38),onChange:E=>u(E.target.value)}),d(R,{alignItems:"center",justifyContent:"between",gap:1,children:[t(D,{fullWidth:!0,onClick:E=>m(null),children:g("cancel")}),t(D,{fullWidth:!0,onClick:E=>m("save_bot_motto"),children:g("save")})]})]})]})},FD=i=>{const[e,s]=a.useState(!1),[n,r]=a.useState(!1),[o,l]=a.useState(null),{avatarInfo:c=null,setAvatarInfo:u=null,activeNameBubble:h=null,setActiveNameBubble:m=null,nameBubbles:p=[],removeNameBubble:E=null,productBubbles:_=[],confirmingProduct:I=null,updateConfirmingProduct:C=null,removeProductBubble:f=null,isDecorating:S=!1,setIsDecorating:T=null}=S1(),{roomSession:b=null}=Xe();ke(Jt.NORMAL_MODE,O=>{e&&s(!1)}),ke(Jt.GAME_MODE,O=>{e||s(!0)}),$e(ty.RSDE_DANCE,O=>{O.roomIndex===b.ownRoomIndex&&r(O.danceId!==0)}),ct(Jl.UPDATE_CHAT,O=>l(O));const y=()=>{if(!b||e)return null;if(h)return t(ed,{nameInfo:h,onClose:()=>m(null)});if(c)switch(c.type){case xr.FURNI:{const O=c;return S?t(MD,{avatarInfo:O,onClose:()=>u(null)}):null}case mt.OWN_USER:case mt.PEER:{const O=c;return ee("user.tags.enabled")&&J().getUserTags(O.roomIndex),O.isSpectatorMode?null:O.isOwnUser?Qa.isRunning()?null:t(UD,{avatarInfo:O,isDancing:n,setIsDecorating:T,onClose:()=>u(null)}):t(yD,{avatarInfo:O,onClose:()=>u(null)})}case Gr.PET_INFO:{const O=c;return O.isOwner?t(LD,{avatarInfo:O,onClose:()=>u(null)}):t(PD,{avatarInfo:O,onClose:()=>u(null)})}case Br.RENTABLE_BOT:return t(DD,{avatarInfo:c,onClose:()=>u(null)})}return null},w=()=>{if(!c||!b||e)return null;switch(c.type){case xr.FURNI:return t(TD,{avatarInfo:c,onClose:()=>u(null)});case mt.OWN_USER:case mt.PEER:return t(wD,{avatarInfo:c,setAvatarInfo:u,onClose:()=>u(null)});case mt.BOT:return t(SD,{avatarInfo:c,onClose:()=>u(null)});case Br.RENTABLE_BOT:return t(RD,{avatarInfo:c,onClose:()=>u(null)});case Gr.PET_INFO:return t(ND,{avatarInfo:c,onClose:()=>u(null)})}};return d(z,{children:[S&&t(kD,{userId:J().userId,userName:J().userName,roomIndex:b.ownRoomIndex,setIsDecorating:T}),y(),c&&t(v,{alignItems:"end",className:"nitro-infostand-container",children:w()}),p.length>0&&p.map((O,F)=>t(ed,{nameInfo:O,onClose:()=>E(F)},F)),_.length>0&&_.map((O,F)=>t(CD,{item:O,updateConfirmingProduct:C,onClose:()=>f(F)},O.id)),o&&t(gD,{chatEvent:o,onClose:()=>l(null)}),I&&t(pD,{item:I,onClose:()=>C(null)})]})},xD=i=>{const{command:e=null,selectedIndex:s=-1,index:n=-2}=i,r=a.useRef(null);return a.useEffect(()=>{!r||r&&!r.current||s==n&&r.current.scrollIntoView({behavior:"smooth"})},[s,n]),t(V,{skin:4,colour:L.quaternary_grey,opacity:s==n?0:255,innerRef:r,children:d(N,{variant:"white",children:[":",e.key]})})},GD=i=>{const{chatValue:e=null,setChatInput:s=null,setCommandsVisible:n=null}=i,{commands:r}=dn(),[o,l]=a.useState([]),c=a.useRef(null),[u,h]=a.useState(-1),m=a.useCallback(p=>{if(!e.startsWith(":")||!c||c&&!c.current)return;let E=-1;switch(p.key){case"ArrowUp":E=(u>-1?u:o.length)-1,E<0&&(E=o.length-1),h(E);break;case"ArrowDown":E=(u>-1?u:o.length)+1,(E>o.length||E<=-1)&&(E=0),h(E);break;case"Enter":o[u]&&s(":"+o[u].key+" "),l([]);break}},[e,u,s,o]);return Vs(()=>{l(r)}),a.useEffect(()=>{if(e.split(":").length==1)return;let E=e.split(":")[1].split(" ")[0];h(-1),l(r.filter(_=>_.key.includes(E)))},[e,r]),a.useEffect(()=>{n(o.length>0&&u>-1)},[o,n,u]),a.useEffect(()=>(document.addEventListener("keyup",m),()=>{document.removeEventListener("keyup",m)}),[m]),e.startsWith(":")?t(V,{skin:5,colour:L.quaternary_grey,className:"ton-command-suggestion",children:t(R,{overflow:"auto",column:!0,className:"mt-auto text-white",innerRef:c,gap:1,children:o&&o.length>0&&o.map((p,E)=>t(xD,{selectedIndex:u,index:E,command:p},E))})}):null},BD=i=>{const{chatStyleId:e=0,chatStyleIds:s=null,selectChatStyleId:n=null}=i,[r,o]=a.useState(null),[l,c]=a.useState(!1),u=m=>{n(m),c(!1)},h=m=>{let p=!1;c(E=>(p=!E,p)),p&&o(m.target)};return a.useEffect(()=>{l||o(null)},[l]),d(z,{children:[t(P,{pointer:!0,className:"chatstyles-selector cursor-pointer",onClick:h}),t(Ai,{show:l,target:r,placement:"top",children:t(kr,{className:"nitro-chat-style-selector-parent",children:t(V,{skin:6,colour:L.quaternary_grey,opacity:30,overflow:"hidden",className:"nitro-chat-style-selector-container image-rendering-pixelated p-1 pb-4",children:d(R,{className:"flex-wrap",gap:1,overflow:"auto",children:[s&&s.length>0&&s.map(m=>t(R,{center:!0,pointer:!0,className:"bubble-parent-container",onClick:p=>u(m),children:t(P,{className:"bubble-container",children:t(P,{className:`chat-bubble bubble-${m}`,children:" "})},m)},m)),gs()<=ls.CLUB&&t(D,{skin:2,className:"mx-auto",onClick:m=>{oe("habboUI/open/hccenter"),h(m)},children:g("widgets.chatinput.styles.more.hc")})]})})})})]})},HD=i=>{var M;const[e,s]=a.useState(""),{updateChatStyleId:n=null}=dn(),{userSettings:r}=$r(),{selectedUsername:o="",floodBlocked:l=!1,floodBlockedSeconds:c=0,setIsTyping:u=null,setIsIdle:h=null,sendChat:m=null}=b1(),p=a.useRef(),[E,_]=a.useState(!1),I=a.useMemo(()=>g("widgets.chatinput.mode.whisper"),[]),C=a.useMemo(()=>g("widgets.chatinput.mode.shout"),[]),f=a.useMemo(()=>g("widgets.chatinput.mode.speak"),[]),S=a.useMemo(()=>ee("chat.input.maxlength",100),[]),{canChat:T}=wn(),{isEditorVisible:b}=Kn(),y=a.useCallback(()=>{if(b)return!0;const G=document.activeElement;return!(!G||p&&p.current===G||!(G instanceof HTMLInputElement)&&!(G instanceof HTMLTextAreaElement))},[p,b]),w=a.useCallback(()=>{p.current.focus(),p.current.setSelectionRange(p.current.value.length*2,p.current.value.length*2)},[p]),O=a.useCallback(()=>{s(G=>G!==I||!o.length?G:`${G} ${o}`)},[o,I]),F=a.useCallback((G,H=!1)=>{if(!G||G==="")return;let Y=H?$s.CHAT_SHOUT:$s.CHAT_DEFAULT,q=G;const Z=q.split(" ");let ce="",se="";switch(Z[0]){case I:Y=$s.CHAT_WHISPER,ce=Z[1],se=I+" "+ce+" ",Z.shift(),Z.shift();break;case C:Y=$s.CHAT_SHOUT,Z.shift();break;case f:Y=$s.CHAT_DEFAULT,Z.shift();break}q=Z.join(" "),u(!1),h(!1),q.length<=S&&(/%CC%/g.test(encodeURIComponent(q))?s(""):(s(""),m(q,Y,ce,r.chatType))),s(se)},[I,C,f,S,u,h,m,r]),U=a.useCallback(G=>{!G||!G.length?u(!1):(u(!0),h(!0)),s(G)},[u,h]),j=a.useCallback(G=>{if(l||!p.current||y())return;document.activeElement!==p.current&&w();const H=G.target.value;switch(G.key){case" ":case"Space":O();return;case"NumpadEnter":case"Enter":if(E)return;F(H,G.shiftKey);return;case"Backspace":if(H){const Y=H.split(" ");Y[0]===I&&Y.length===3&&Y[2]===""&&s("")}return}},[l,y,w,O,F,I]);ct(Hn.CHAT_INPUT_CONTENT,G=>{switch(G.chatMode){case Hn.WHISPER:{s(`${I} ${G.userName} `);return}case Hn.SHOUT:return}});const x=a.useMemo(()=>{let G=[],H=ee("chat.styles");H=H.sort((Y,q)=>Y.isHcOnly?Y.minRank-q.minRank:1);for(const Y of H)if(Y){if(Y.minRank>0){J().hasSecurity(Y.minRank)&&G.push(Y.styleId);continue}if(Y.isSystemStyle&&J().hasSecurity(_t.MODERATOR)){G.push(Y.styleId);continue}if(!(ee("chat.styles.disabled").indexOf(Y.styleId)>=0)){if(Y.isHcOnly&&gs()>=ls.CLUB){G.push(Y.styleId);continue}if(Y.isAmbassadorOnly&&J().isAmbassador){G.push(Y.styleId);continue}!Y.isHcOnly&&!Y.isAmbassadorOnly&&G.push(Y.styleId)}}return G},[]);if(a.useEffect(()=>(document.body.addEventListener("keydown",j),()=>{document.body.removeEventListener("keydown",j)}),[j]),a.useEffect(()=>{p.current&&(p.current.parentElement.dataset.value=e)},[e]),(M=Pe())!=null&&M.isSpectator)return null;if(T)return vo.createPortal(d(z,{children:[t(GD,{chatValue:e,setChatInput:U,setCommandsVisible:_}),d("div",{className:"nitro-chat-input-container",children:[t(BD,{chatStyleId:r.chatType,chatStyleIds:x,selectChatStyleId:n}),!l&&t("input",{ref:p,type:"text",className:"chat-input",placeholder:g("widgets.chatinput.default"),value:e,maxLength:S,onChange:G=>U(G.target.value),onMouseDown:G=>w()}),l&&d(N,{variant:"danger",children:[g("chat.input.alert.flood",["time"],[c.toString()])," "]})]})]}),document.getElementById("toolbar-chat-input-container"))},vI=i=>{const{chat:e=null,makeRoom:s=null,bubbleWidth:n=Ze.CHAT_BUBBLE_WIDTH_NORMAL,...r}=i,[o,l]=a.useState(!1),[c,u]=a.useState(!1),h=a.useRef(),m=a.useRef(),p=a.useRef(),{isDragged:E}=Ro(),{onMouseDown:_,setOffset:I}=Ro(),C=a.useMemo(()=>{switch(n){case Ze.CHAT_BUBBLE_WIDTH_NORMAL:return 350;case Ze.CHAT_BUBBLE_WIDTH_THIN:return 240;case Ze.CHAT_BUBBLE_WIDTH_WIDE:return 2e3}},[n]);a.useEffect(()=>{l(!1);const T=h.current;if(!T)return;const b=T.offsetWidth,y=T.offsetHeight;e.width=b,e.height=y,e.elementRef=T;let w=e.left,O=e.top;if(!s){w=e.location.x-b/2,e.left=w;return}return!w&&!O&&(w=e.location.x-b/2,O=T.parentElement.offsetHeight-y,e.left=w,e.top=O),u(!0),()=>{e.elementRef=null,u(!1)}},[e]),a.useEffect(()=>{!c||!e||o||(s&&s(e),l(!0))},[e,c,o,s]);const f=a.useCallback(T=>{_(T,!0)},[_]),S=a.useCallback(()=>{if(!m||m&&!m.current||!p||p&&!p.current)return;let b=ee("chat.styles").filter(y=>y.styleId==e.styleId)[0];!b||b&&!b.isColourable||(vn(document.defaultView.getComputedStyle(m.current).borderImageSource.replace('url("',"").replace('")',""),L.white,0,e.color).then(y=>{m&&m.current&&(m.current.style.borderImageSource=`url(${y})`)}),vn(document.defaultView.getComputedStyle(p.current).backgroundImage.replace('url("',"").replace('")',""),L.white,0,e.color).then(y=>{p&&p.current&&(p.current.style.backgroundImage=`url(${y})`)}))},[e,m]);return Vs(()=>{S()}),t("div",{ref:h,className:`bubble-container ${o||E?"visible":"invisible"}`,onClick:T=>X().selectRoomObject(e.roomId,e.senderId,re.UNIT),onMouseDown:T=>f(T),...r,children:d("div",{ref:m,className:`chat-bubble bubble-${e.styleId} type-${e.type}`,style:{maxWidth:C},children:[t("div",{className:"user-container",children:e.imageUrl&&e.imageUrl.length>0&&t("div",{className:"user-image",style:{backgroundImage:`url(${e.imageUrl})`}})}),d("div",{className:"chat-content",children:[t("span",{className:"username mr-1",dangerouslySetInnerHTML:{__html:`${e.username}: `}}),t("span",{className:"message",dangerouslySetInnerHTML:{__html:`${e.formattedText}`}})]}),t("div",{className:"pointer",ref:p})]})})},VD=i=>{const{chatMessages:e=[],setChatMessages:s=null,chatSettings:n=null,getScrollSpeed:r=6e3}=wn(),o=a.useRef(),{isDragged:l}=Ro(),c=a.useCallback(()=>{s(m=>{if(m){const p=m.filter(E=>E.top>-E.height*2);if(p.length!==m.length)return p}return m})},[s]),u=a.useCallback((m,p,E)=>{for(let _=e.indexOf(m)-1;_>=0;_--){const I=e[_];if(!(!I||m===I||E.indexOf(I)>=0||I.top+I.height-p>m.top+m.height)&&hA(m,I,-p,0)){const C=Math.abs(I.top+I.height-m.top);E.push(I),I.top-=C,I.skipMovement=!0,u(I,C,E)}}},[e]),h=a.useCallback(m=>{if(n.mode===Ze.CHAT_MODE_FREE_FLOW)m.skipMovement=!0,u(m,0,[m]),c();else{const p=m.top+m.height,E=m.height,_=o.current.offsetHeight-p,I=E-_;_<E&&(s(C=>(C.forEach(f=>{f!==m&&(f.top-=I)}),C)),c())}},[n,u,c,s]);return a.useEffect(()=>{const m=(p=null)=>{if(!o||!o.current)return;const E=o.current.offsetHeight,_=Math.round(document.body.offsetHeight*ee("chat.viewer.height.percentage"));o.current.style.height=`${_}px`,s(I=>{const C=[...I];return C&&C.forEach(f=>f.top-=E-_),C})};return window.addEventListener("resize",m),m(),()=>{window.removeEventListener("resize",m)}},[s]),a.useEffect(()=>{const m=E=>{s(_=>(_.forEach(I=>{if(I.skipMovement){I.skipMovement=!1;return}I.top-=E}),_)),c()},p=new RI(NI);return p.onmessage=()=>m(15),p.postMessage({action:"START",content:r}),()=>{p.postMessage({action:"STOP"})}},[r,c,s]),t("div",{ref:o,className:"nitro-chat-widget "+(l?"opacity-0":""),children:e.map(m=>t(vI,{chat:m,makeRoom:h,bubbleWidth:n.weight},m.id))})},WD=i=>{const{chatMessages:e=[],setIsDragged:s=null,roomSession:n=null,isVisible:r=!1,setIsVisible:o,onMouseDown:l,scrollRef:c,historyRef:u,handleRef:h,closeChatHistory:m}=Ro(),{chatSettings:p=null}=wn();let E=wn().chatMessages;const _=a.useRef();return a.useEffect(()=>{c&&c.current&&r&&(c.current.scrollTop=c.current.scrollHeight)},[r]),a.useEffect(()=>{if(u&&u.current==null||_&&_.current==null)return;let I=!1,C=0;const f=b=>{document.removeEventListener("mouseup",f.bind(void 0)),document.removeEventListener("mousemove",T.bind(void 0)),I=!1},S=b=>{r&&(document.addEventListener("mouseup",f.bind(void 0)),document.addEventListener("mousemove",T.bind(void 0)),r&&(I=!0),C=b.clientX)},T=b=>{I&&(_&&_.current==null||(C-b.clientX,C=b.clientX))};return h.current.addEventListener("mousedown",l.bind(void 0)),u.current.addEventListener("mousedown",S.bind(void 0)),()=>{document.removeEventListener("mousedown",S.bind(void 0)),document.removeEventListener("mouseup",f.bind(void 0)),document.removeEventListener("mousemove",T.bind(void 0))}},[u,h,l,e,r]),a.useEffect(()=>{if(!n)return o(!1);E.length==0&&e.length>0&&o(!0)},[E,n,r,o,e]),d(P,{className:"room-chat-history "+(r?"chat-history-visible":""),children:[t(P,{className:"room-chat-history-inner overflow-hidden",innerRef:u,children:t(P,{className:"nitro-chat-widget",fullHeight:!0,fullWidth:!0,overflow:"hidden",position:"relative",innerRef:_,children:t(xi,{className:"room-chat-history-view position-relative",rows:e,rowRender:I=>t(z,{children:t(vI,{chat:I,bubbleWidth:p.weight})})})})}),d(P,{className:"room-chat-history-handle",innerRef:h,children:[t(P,{className:"room-chat-history-handle-inner flex-shrink-0"}),t(P,{className:"ton-frame-close cursor-pointer position-absolute right-0","data-style":0,onClick:I=>m()})]})]})},bI=i=>{const{title:e=null,items:s=[],selectItem:n=null,onClose:r=null}=i,[o,l]=a.useState(null),[c,u]=a.useState(""),h=J().isModerator,m=a.useMemo(()=>{const p=c.toLocaleLowerCase();return h&&s.sort((E,_)=>E.id<_.id?-1:1),s.filter(E=>E.name.toLocaleLowerCase().includes(p))},[s,c,h]);return a.useEffect(()=>{o&&n(o)},[o,n]),t(le,{title:e,className:"nitro-chooser-widget",onCloseClick:r,windowPosition:tt.BOTTOM_LEFT,children:d(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-hidden d-flex flex-column",children:[t(V,{skin:4,colour:L.lighter_grey,position:"relative",children:t("input",{type:"text",className:"ton-input",placeholder:g("generic.search"),value:c,onChange:p=>u(p.target.value)})}),t(xi,{rows:m,rowRender:p=>t(R,{alignItems:"center",className:Vr("rounded p-1",o===p&&"bg-muted"),pointer:!0,onClick:E=>l(p),children:d(N,{truncate:!0,children:[p.name," ",h&&" - "+p.id]})})})]})})},jD=i=>{const{items:e=null,onClose:s=null,selectItem:n=null,populateChooser:r=null}=L1();return a.useEffect(()=>{const o={linkReceived:l=>{l.split("/"),r()},eventUrlPrefix:"furni-chooser/"};return dt(o),()=>ht(o)},[r]),e?t(bI,{title:g("widget.chooser.furni.title"),items:e,selectItem:n,onClose:s}):null},qD=i=>{const{items:e=null,onClose:s=null,selectItem:n=null,populateChooser:r=null}=x1();return a.useEffect(()=>{const o={linkReceived:l=>{l.split("/"),r()},eventUrlPrefix:"user-chooser/"};return dt(o),()=>ht(o)},[r]),e?t(bI,{title:g("widget.chooser.user.title"),items:e,selectItem:n,onClose:s}):null},YD=i=>{const[e,s]=a.useState(!1),{users:n=[],answer:r=null}=w1();return a.useEffect(()=>{s(!!n.length)},[n]),e?t(le,{title:g("navigator.doorbell.title"),className:"nitro-widget-doorbell no-resize",onCloseClick:o=>s(!1),windowPosition:tt.TOP_LEFT,offsetLeft:80,children:t(V,{skin:0,colour:L.white,position:"relative",className:"px-0",fullHeight:!0,overflow:"hidden",children:d(v,{overflow:"auto",fullHeight:!0,fullWidth:!0,gap:0,children:[t(v,{gap:2,className:"mx-1 px-1 pb-1 border-bottom border-muted",children:t(N,{children:g("widgets.doorbell.info")})}),t(v,{overflow:"auto",className:"striped-children",gap:0,children:n&&n.length>0&&n.map(o=>d(pe,{gap:1,alignItems:"center",className:"text-black px-2 py-1",children:[t(P,{className:"g-col-6",children:o}),t(P,{className:"g-col-6",children:d(R,{alignItems:"center",justifyContent:"end",gap:1,children:[t("div",{className:"boorbell-accept cursor-pointer",onClick:()=>r(o,!0)}),t("div",{className:"boorbell-deny cursor-pointer",onClick:()=>r(o,!1)})]})})]},o))})]})})}):null},zD=i=>{const{roomIndex:e=-1,request:s=null,hideFriendRequest:n=null,requestResponse:r=null}=i;return t(Xi,{objectId:e,category:re.UNIT,children:d(V,{skin:6,colour:L.secondary_yellow,className:"nitro-friend-request-dialog nitro-context-menu p-1",children:[d(v,{children:[d(R,{alignItems:"center",justifyContent:"between",gap:2,children:[t(N,{variant:"white",children:g("widget.friendrequest.from",["username"],[s.name])}),t(P,{className:"ton-frame-close align-self-start","data-style":1,onClick:o=>n(s.requesterUserId)})]}),d(R,{justifyContent:"between",gap:1,children:[t(N,{variant:"white",className:"align-self-center",onClick:o=>r(s.requesterUserId,!1),underline:!0,children:g("widget.friendrequest.decline")}),t(D,{skin:1,onClick:o=>r(s.requesterUserId,!0),children:g("widget.friendrequest.accept")})]})]}),t(Fo,{colour:L.secondary_yellow,skin:6})]})})},KD=i=>{const{displayedRequests:e=[],hideFriendRequest:s=null}=M1(),{requestResponse:n=null}=ns();return e.length?t(z,{children:e.map((r,o)=>t(zD,{roomIndex:r.roomIndex,request:r.request,hideFriendRequest:s,requestResponse:n},o))}):null},$D=i=>{const{objectId:e=-1,onClose:s=null}=i,{roomSession:n=null}=Xe(),r=()=>{n.useMultistateItem(e),s()};return t(le,{title:g("effectbox.header.title"),className:"nitro-use-product-confirmation",onCloseClick:s,children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:t(at,{center:!0,children:t(R,{gap:2,children:d(v,{justifyContent:"between",children:[t(N,{children:g("effectbox.header.description")}),d(R,{alignItems:"center",justifyContent:"between",children:[t(D,{onClick:s,children:g("generic.cancel")}),t(D,{onClick:r,children:g("generic.ok")})]})]})})})})})},li=-1,QD=0,XD=i=>{const{objectId:e=-1,onClose:s=null}=i,[n,r]=a.useState(null),[o,l]=a.useState(li),{roomSession:c=null}=Xe(),u=()=>{c.useMultistateItem(e),s()};return a.useEffect(()=>{if(!c||e===-1)return;const h=Li(c.roomId,e,re.FLOOR);if(!h)return;r(h);let m=li;switch(h.specialType){case ae.MONSTERPLANT_SEED:m=QD;break}if(m===li){s();return}l(m)},[c,e,s]),o===li?null:t(le,{title:g("useproduct.widget.title.plant_seed",["name"],[n.name]),className:"nitro-use-product-confirmation",onCloseClick:s,children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:t(at,{center:!0,children:d(R,{gap:2,overflow:"hidden",children:[t(v,{children:t(P,{className:"product-preview",children:t(P,{className:"monsterplant-image"})})}),d(v,{justifyContent:"between",overflow:"auto",children:[d(v,{gap:2,children:[t(N,{children:g("useproduct.widget.text.plant_seed",["productName"],[n.name])}),t(N,{children:g("useproduct.widget.info.plant_seed")})]}),d(R,{alignItems:"center",justifyContent:"between",children:[t(D,{onClick:s,children:g("useproduct.widget.cancel")}),t(D,{onClick:u,children:g("widget.monsterplant_seed.button.use")})]})]})]})})})})},ci=-1,JD=0,ZD=i=>{const{objectId:e=-1,onClose:s=null}=i,[n,r]=a.useState(ci),[o,l]=a.useState(ge.MALE),[c,u]=a.useState(null),{roomSession:h=null}=Xe(),m=()=>{el().send(new Mf(e)),el().send(new Fl(o,c)),s()};return a.useEffect(()=>{let p=ci;const E=J().figure,_=J().gender,I=[];if(h&&e>=0){const C=Li(h.roomId,e,re.FLOOR);if(C)switch(C.specialType){case ae.FIGURE_PURCHASABLE_SET:p=JD;const f=C.customParams.split(",").map(S=>parseInt(S));for(const S of f)Mt().isValidFigureSetForGender(S,_)&&I.push(S);break}}if(p===ci){s();return}l(_),u(Mt().getFigureStringWithFigureIds(E,_,I)),r(p)},[h,e,s]),n===ci?null:t(le,{title:g("useproduct.widget.title.bind_clothing"),className:"nitro-use-product-confirmation",onCloseClick:s,children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:t(at,{center:!0,children:d(R,{gap:2,overflow:"hidden",children:[t(v,{children:t(P,{className:"mannequin-preview",children:t(it,{figure:c,direction:2})})}),d(v,{justifyContent:"between",overflow:"auto",children:[d(v,{gap:2,children:[t(N,{children:g("useproduct.widget.text.bind_clothing")}),t(N,{children:g("useproduct.widget.info.bind_clothing")})]}),d(R,{alignItems:"center",justifyContent:"between",children:[t(D,{onClick:s,children:g("useproduct.widget.cancel")}),t(D,{onClick:m,children:g("useproduct.widget.bind_clothing")})]})]})]})})})})},eF="MONSTERPLANT_SEED_CONFIRMATION",tF="PURCHASABLE_CLOTHING_CONFIRMATION",sF="GROUP_FURNITURE",nF="EFFECTBOX_OPEN",rF=i=>{const{closeConfirm:e=null,processAction:s=null,onClose:n=null,objectId:r=-1,mode:o=null,confirmMode:l=null,confirmingObjectId:c=-1,groupData:u=null,isGroupMember:h=!1}=LM(),{simpleAlert:m=null}=Ke();return W(sy,p=>{const E=p.getParser();if(E)switch(E.count){case 1:m(g("costumehopper.costumerequired.bodytext"),null,"catalog/open/temporary_effects",g("costumehopper.costumerequired.buy"),g("costumehopper.costumerequired.header"),null);break;case 2:m(g("viphopper.viprequired.bodytext"),null,"catalog/open/habbo_club",g("viprequired.buy.vip"),g("viprequired.header"),null);break;case 3:m(g("gate.viprequired.bodytext"),null,"catalog/open/habbo_club",g("viprequired.buy.vip"),g("gate.viprequired.title"),null);break}}),d(z,{children:[l===eF&&t(XD,{objectId:c,onClose:e}),l===tF&&t(ZD,{objectId:c,onClose:e}),l===nF&&t($D,{objectId:c,onClose:e}),r>=0&&o&&d(hn,{objectId:r,category:re.FLOOR,onClose:n,fades:!0,children:[o===Cs.FRIEND_FURNITURE&&d(z,{children:[t(Ls,{children:g("friendfurni.context.title")}),t(Q,{onClick:p=>s("use_friend_furni"),children:g("friendfurni.context.use")})]}),o===Cs.MONSTERPLANT_SEED&&d(z,{children:[t(Ls,{children:g("furni.mnstr_seed.name")}),t(Q,{onClick:p=>s("use_monsterplant_seed"),children:g("widget.monsterplant_seed.button.use")})]}),o===Cs.RANDOM_TELEPORT&&d(z,{children:[t(Ls,{children:g("furni.random_teleport.name")}),t(Q,{onClick:p=>s("use_random_teleport"),children:g("widget.random_teleport.button.use")})]}),o===Cs.PURCHASABLE_CLOTHING&&d(z,{children:[t(Ls,{children:g("furni.generic_usable.name")}),t(Q,{onClick:p=>s("use_purchaseable_clothing"),children:g("widget.generic_usable.button.use")})]}),o===sF&&u&&d(z,{children:[t(Ls,{className:"cursor-pointer text-truncate",onClick:()=>Uo(u.guildId),children:u.guildName}),!h&&t(Q,{onClick:p=>s("join_group"),children:g("widget.furniture.button.join.group")}),t(Q,{onClick:p=>s("go_to_group_homeroom"),children:g("widget.furniture.button.go.to.group.home.room")}),u.guildHasReadableForum&&t(Q,{onClick:p=>s("open_forum"),children:g("widget.furniture.button.open_group_forum")})]}),t(P,{className:"menu-bottom"})]})]})},oF=i=>{const{objectId:e=-1,hue:s=0,setHue:n=null,saturation:r=0,setSaturation:o=null,lightness:l=0,setLightness:c=null,applyToner:u=null,toggleToner:h=null,onClose:m=null}=wM();return e===-1?null:t(le,{title:g("widget.backgroundcolor.title"),className:"nitro-room-widget-toner",onCloseClick:m,children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 w-100 overflow-auto",children:d(at,{overflow:"hidden",justifyContent:"between",children:[d(v,{overflow:"auto",gap:1,children:[d(v,{children:[t(N,{className:"volter-bold",children:g("widget.backgroundcolor.hue")}),t(kt,{className:"ton-slider",min:0,max:255,value:s,onChange:p=>n(p)})]}),d(v,{children:[t(N,{className:"volter-bold",children:g("widget.backgroundcolor.saturation")}),t(kt,{className:"ton-slider",min:0,max:255,value:r,onChange:p=>o(p)})]}),d(v,{children:[t(N,{className:"volter-bold",children:g("widget.backgroundcolor.lightness")}),t(kt,{className:"ton-slider",min:0,max:255,value:l,onChange:p=>c(p)})]})]}),d(v,{gap:1,children:[t(D,{fullWidth:!0,onClick:h,children:g("widget.backgroundcolor.button.on")}),t(D,{fullWidth:!0,onClick:u,children:g("widget.backgroundcolor.button.apply")})]})]})})})},iF=i=>{const{objectId:e=-1,color:s="1",badgeName:n="",badgeDesc:r="",date:o="",senderName:l="",onClose:c=null}=AM();return e===-1?null:t(tI,{color:s,message:r,date:o,senderName:l,customTitle:n,onCloseClick:c})},aF=i=>{const{objectId:e=-1,recipes:s=[],ingredients:n=[],selectedRecipe:r=null,requiredIngredients:o=null,isCrafting:l=!1,craft:c=null,selectRecipe:u=null,onClose:h=null}=DM(),{roomSession:m=null}=Xe(),[p,E]=a.useState(!1),_=a.useMemo(()=>{const f=X().getRoomObject(m.roomId,e,re.FLOOR);return as(f)},[e,m.roomId]),I=a.useMemo(()=>{if(!o||!o.length)return!1;for(const f of o){const S=n.find(T=>T.name===f.itemName);if(!S||S.count<f.count)return!1}return!0},[n,o]),C=()=>{if(!p){E(!0);return}c(),E(!1)};return a.useEffect(()=>{E(!1)},[r]),e===-1?null:t(vs,{handleSelector:".drag-handler",children:t(v,{className:"nitro-widget-crafting",children:t(at,{children:d(R,{grow:!0,overflow:"hidden",gap:2,children:[d(R,{column:!0,fullWidth:!0,className:"crafting-left-side",children:[d(v,{overflow:"hidden",fullHeight:!0,gap:3,children:[t("div",{className:"py-1 text-center",children:g("crafting.title.products")}),t(qe,{columnCount:5,className:"p-1",children:s.length>0&&s.map(f=>t(Rn,{itemImage:f.iconUrl,itemActive:r&&r.name===f.name,onClick:()=>u(f)},f.name))})]}),d(v,{overflow:"hidden",fullHeight:!0,gap:3,children:[t("div",{className:"py-1 text-center",children:g("crafting.title.mixer")}),t(qe,{columnCount:5,className:"p-1",children:n.length>0&&n.map(f=>t(Rn,{itemImage:f.iconUrl,itemCount:f.count,itemCountMinimum:0,className:(f.count?"":"opacity-0-5 ")+"cursor-default"},f.name))})]})]}),d(R,{column:!0,fullWidth:!0,gap:2,children:[!r&&t(v,{center:!0,fullHeight:!0,className:"text-black text-center",children:g("crafting.info.start")}),r&&d(z,{children:[d(v,{overflow:"hidden",fullHeight:!0,children:[t("div",{className:"bg-muted py-1 text-center",children:g("crafting.current_recipe")}),t(qe,{columnCount:5,className:"receipe-grid",children:!!o&&o.length>0&&o.map(f=>{const S=n.find(b=>b.name===f.itemName),T=[];for(let b=0;b<f.count;b++)T.push(t(Rn,{itemImage:S.iconUrl,className:(S.count-b<=0?"opacity-0-5 ":"")+"cursor-default"},b));return T})})]}),d(R,{gap:2,column:!0,fullHeight:!0,children:[d(R,{gap:2,className:"bg-muted",column:!0,fullHeight:!0,children:[t("div",{className:"py-1 text-center",children:g("crafting.result")}),d(R,{gap:1,center:!0,column:!0,fullHeight:!0,className:"pb-1",children:[t(v,{fullHeight:!0,children:t("img",{src:r.iconUrl})}),t("div",{className:"text-black",children:r.localizedName})]})]}),d(D,{disabled:!_||!I||l,onClick:C,children:[!l&&g(_?I?p?"generic.confirm":"crafting.btn.craft":"crafting.status.recipe.incomplete":"crafting.btn.notowner"),l&&t(hE,{})]})]})]})]})]})})})})},lF=i=>{const{isActive:e=!1,count:s=0,overflow:n="hidden",position:r="relative",pointer:o=!0,classNames:l=[],children:c=null,...u}=i,h=a.useMemo(()=>{const m=["nav-item"];return e&&m.push("active"),l.length&&m.push(...l),m},[e,l]);return t(z,{children:d(R,{gap:1,overflow:n,pointer:o,position:r,classNames:h,...u,children:[t(P,{classNames:["ton-moodlight-check-input-circle flex-shrink-0",e?"active":""]}),t(R,{shrink:!0,center:!0,children:c}),s>0&&t(Do,{count:s})]})})},cF=i=>{const[e,s]=a.useState(!1),{presets:n=[],dimmerState:r=0,selectedPresetId:o=0,color:l=16777215,brightness:c=255,effectId:u=0,selectedColor:h=0,setSelectedColor:m=null,selectedBrightness:p=0,setSelectedBrightness:E=null,selectedEffectId:_=0,setSelectedEffectId:I=null,selectPresetId:C=null,applyChanges:f}=xM(),S=()=>{Ts.previewDimmer(l,c,u===2),s(!1)};ke(je.REMOVE_DIMMER,b=>s(!1)),a.useEffect(()=>{!n||!n.length||s(!0)},[n]);const T=a.useMemo(()=>ee("widget.dimmer.colorwheel",!1),[]);return e?t(le,{skin:4,colour:L.primary_yellow,title:g("widget.dimmer.title"),className:"ton-moodlight",onCloseClick:S,children:d(v,{gap:1,className:"moodlight-content",children:[r===1&&t(en,{gap:2,children:n.map(b=>t(lF,{isActive:o===b.id,onClick:y=>C(b.id),children:g(`widget.dimmer.tab.${b.id}`)},b.id))}),d(at,{children:[r===0&&d(v,{alignItems:"center",children:[t(P,{className:"dimmer-banner"}),t(N,{center:!0,className:"bg-muted p-1",children:g("widget.dimmer.info.off")}),t(D,{fullWidth:!0,onClick:()=>Ts.changeState(),children:g("widget.dimmer.button.on")})]}),r===1&&d(z,{children:[d(v,{gap:1,children:[g("widget.backgroundcolor.hue"),T&&t("input",{type:"color",className:"form-control",value:bn.makeColorNumberHex(h),onChange:b=>m(bn.convertFromHex(b.target.value))}),!T&&t(pe,{gap:1,columnCount:7,children:Ts.AVAILABLE_COLORS.map((b,y)=>t(v,{fullWidth:!0,pointer:!0,className:Vr("color-swatch",b===h&&"active"),onClick:()=>m(b),style:{backgroundColor:Ts.HTML_COLORS[y]}},y))})]}),t(v,{gap:1,children:t(kt,{className:"moodlight-slider py-2",min:Ts.MIN_BRIGHTNESS,max:Ts.MAX_BRIGHTNESS,value:p,onChange:b=>E(b)})}),d(R,{className:"mt-2",alignItems:"center",gap:1,children:[t("input",{className:"ton-moodlight-form-check-input",type:"checkbox",checked:_===2,onChange:b=>I(b.target.checked?2:1)}),g("widget.dimmer.type.checkbox")]}),d(R,{gap:1,children:[t(D,{className:"button",skin:3,colour:L.moodlight_green,fullWidth:!0,onClick:()=>Ts.changeState(),children:g("widget.dimmer.button.off")}),t(D,{className:"button",skin:3,colour:L.moodlight_green,fullWidth:!0,onClick:f,children:g("widget.dimmer.button.apply")})]})]})]})]})}):null},uF=i=>{const{objectId:e=-1,value:s=0,onClose:n=null,redeem:r=null}=BM();return e===-1?null:t(le,{title:g("catalog.redeem.dialog.title"),className:"nitro-widget-exchange-credit",onCloseClick:n,children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:d(at,{children:[d(v,{gap:1,overflow:"auto",children:[t(N,{className:"volter-bold",children:g("creditfurni.description",["credits"],[s.toString()])}),t(N,{children:g("creditfurni.prompt")}),d(N,{underline:!0,pointer:!0,onClick:o=>oe("catalog/toggle"),children:[g("infostand.button.buy")," ",">>"]})]}),t(v,{gap:1,className:"mt-auto",children:d(R,{gap:1,className:"justify-content-between",children:[t(D,{onClick:n,className:"w-25",children:g("generic.cancel")}),t(D,{skin:1,onClick:r,className:"w-25",children:g("catalog.redeem.dialog.button.exchange")})]})})]})})})},dF=i=>{const{currentIndex:e=-1,currentPhotos:s=null}=i,[n,r]=a.useState(0),o=s&&s.length?s[n]:null,l=()=>{r(u=>{let h=u+1;return h>=s.length&&(h=0),h})},c=()=>{r(u=>{let h=u-1;return h<0&&(h=s.length-1),h})};return a.useEffect(()=>{r(e)},[e]),o?d(pe,{style:{display:"flex",flexDirection:"column"},children:[t(R,{center:!0,className:"picture-preview border border-black",style:o.w?{backgroundImage:"url("+o.w+")"}:{},children:!o.w&&t(N,{bold:!0,children:g("camera.loading")})}),o.m&&o.m.length&&t(N,{center:!0,children:o.m}),d(R,{alignItems:"center",justifyContent:"between",children:[t(N,{children:o.n||""}),d(v,{gap:0,children:[t(N,{children:new Date(o.t).toLocaleString()}),t(N,{underline:!0,className:"cursor-pointer ms-auto",onClick:u=>ps(o.oi),children:o.o})]})]}),s.length>1&&d(R,{className:"picture-preview-buttons w-100",children:[t(P,{className:"cursor-pointer left",onClick:c}),t(P,{className:"cursor-pointer right ms-auto",onClick:l})]})]}):null},hF=i=>{const{objectId:e=-1,currentPhotoIndex:s=-1,currentPhotos:n=null,onClose:r=null}=VM();return e===-1||s===-1?null:t(le,{colour:L.white,skin:8,title:" ",className:"nitro-external-image-widget",onCloseClick:r,children:t(at,{children:t(dF,{currentIndex:s,currentPhotos:n})})})},mF=i=>{const{objectId:e=-1,type:s=0,stage:n=0,usernames:r=[],figures:o=[],date:l=null,onClose:c=null,respond:u=null}=jM();if(e===-1)return null;if(n>0)return t(le,{title:g("friend.furniture.confirm.lock.caption"),className:"nitro-engraving-lock",onCloseClick:c,children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:d(at,{children:[t("div",{className:"text-black text-center volter-bold mt-2 mb-2",children:g("friend.furniture.confirm.lock.subtitle")}),t("div",{className:"d-flex justify-content-center mb-2",children:t("div",{className:`engraving-lock-stage-${n}`})}),n===2&&t("div",{className:"text-small text-black text-center mb-2",children:g("friend.furniture.confirm.lock.other.locked")}),d(R,{gap:1,children:[t(D,{fullWidth:!0,onClick:h=>u(!1),children:g("friend.furniture.confirm.lock.button.cancel")}),t(D,{fullWidth:!0,onClick:h=>u(!0),children:g("friend.furniture.confirm.lock.button.confirm")})]})]})})});if(r.length>0)return t(vs,{handleSelector:".nitro-engraving-lock-view",children:d("div",{className:`nitro-engraving-lock-view engraving-lock-${s}`,children:[t("div",{className:"engraving-lock-close",onClick:c}),d(R,{justifyContent:"center",children:[t("div",{className:"engraving-lock-avatar",children:t(it,{figure:o[0],direction:2})}),t("div",{className:"engraving-lock-avatar",children:t(it,{figure:o[1],direction:4})})]}),d(v,{justifyContent:"between",className:"mt-1",children:[d(v,{alignItems:"center",justifyContent:"center",gap:1,children:[d("div",{className:"ubuntu",children:[s===0&&g("lovelock.engraving.caption"),s===3&&g("wildwest.engraving.caption")]}),t("div",{className:"ubuntu",children:l})]}),d(R,{justifyContent:"center",gap:4,children:[t("div",{className:"ubuntu-bold mb-2",children:r[0]}),t("div",{className:"ubuntu-bold mb-2",children:r[1]})]})]})]})})},gF=i=>{const{objectId:e=-1,classId:s=-1,itemType:n=null,text:r=null,isOwnerOfFurniture:o=!1,senderName:l=null,senderFigure:c=null,placedItemId:u=-1,placedItemType:h=null,placedInRoom:m=!1,imageUrl:p=null,openPresent:E=null,onClose:_=null}=o1(),{groupItems:I=[]}=$n();if(e===-1)return null;const C=f=>{const S=I.find(T=>{var b;return((b=T.getItemById(f))==null?void 0:b.id)===f});S&&Dr(S),_()};return t(le,{title:g(l?"widget.furni.present.window.title_from":"widget.furni.present.window.title",["name"],[l]),className:"nitro-gift-opening",onCloseClick:_,children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:d(at,{children:[u===-1&&d(v,{overflow:"hidden",children:[t(R,{center:!0,overflow:"auto",children:t(uE,{userName:l,figure:c,message:r})}),o&&l&&t(D,{skin:1,fullWidth:!0,onClick:f=>oe("catalog/open"),children:g("widget.furni.present.give_gift",["name"],[l])}),t(D,{skin:1,fullWidth:!0,onClick:E,children:g("widget.furni.present.open_gift")})]}),u>-1&&d(R,{gap:2,overflow:"hidden",children:[t(v,{center:!0,className:"p-2",children:t(yn,{imageUrl:p})}),d(v,{grow:!0,children:[d(v,{center:!0,gap:1,children:[t(N,{wrap:!0,small:!0,children:g("widget.furni.present.message_opened")}),t(N,{className:"volter-bold",children:r})]}),d(v,{grow:!0,gap:1,children:[d(R,{gap:1,children:[m&&t(D,{skin:1,fullWidth:!0,onClick:null,children:g("widget.furni.present.put_in_inventory")}),t(D,{skin:1,fullWidth:!0,onClick:f=>C(u),children:g(m?"widget.furni.present.keep_in_room":"widget.furni.present.place_in_room")})]}),l&&l.length&&t(D,{skin:1,fullWidth:!0,onClick:f=>oe("catalog/open"),children:g("widget.furni.present.give_gift",["name"],[l])})]})]})]})]})})})},pF=i=>{const{stuffDatas:e=null,getScoreType:s=null,getClearType:n=null}=KM();return!e||!e.size?null:t(z,{children:Array.from(e.entries()).map(([r,o],l)=>t(Xi,{objectId:r,category:re.FLOOR,children:d(V,{skin:6,colour:L.lighter_grey,className:"ton-widget-high-score",children:[t(R,{center:!0,className:"ton-widget-high-score-header",children:g("high.score.display.caption",["scoretype","cleartype"],[g(`high.score.display.scoretype.${s(o.scoreType)}`),g(`high.score.display.cleartype.${n(o.clearType)}`)])}),d(v,{overflow:"hidden",gap:1,className:"h-100",children:[d(R,{className:"score-board-header mt-1",children:[t(V,{fullWidth:!0,skin:8,colour:L.lighter_grey,className:"p-1",children:t(N,{variant:"black",className:"col-8",children:g("high.score.display.users.header")})}),t(V,{skin:8,colour:L.lighter_grey,className:"p-1 w-50",children:t(N,{variant:"black",className:"col-4",children:g("high.score.display.score.header")})}),t("hr",{className:"m-0"})]}),t(V,{skin:3,colour:L.black,overflow:"auto",className:"overflow-y-auto high-score-results p-2 gap-1",children:o.entries.map((c,u)=>d(R,{alignItems:"center",children:[t(N,{variant:"white",className:"col-8",children:c.users.join(", ")}),t(N,{center:!0,variant:"white",className:"col-4",children:c.score})]},u))}),t("i",{className:"trophy position-absolute"}),t(R,{center:!0,className:"bottom-text",children:t(N,{center:!0,children:g("high.score.display.congratulations.footer")})})]})]})},l))})},fF=i=>(XM(),null),_F=-1,ui=0,Pa=1,Da=2,Fa=3,xa=4,EF=i=>{const[e,s]=a.useState(null),[n,r]=a.useState(_F),{objectId:o=-1,figure:l=null,gender:c=null,clubLevel:u=ls.NO_CLUB,name:h=null,setName:m=null,saveFigure:p=null,wearFigure:E=null,saveName:_=null,onClose:I=null}=ZM();return a.useEffect(()=>{if(o===-1)return;const C=Pe();if(C.isRoomOwner||C.controllerLevel>=_t.GUEST||J().isModerator){r(ui);return}if(J().gender.toLowerCase()!==c.toLowerCase()){r(xa);return}if(gs()<u){r(Fa);return}r(Da)},[o,c,u]),a.useEffect(()=>{switch(n){case ui:case xa:{const C=Mt().createFigureContainer(l);yr.transformAsMannequinFigure(C),s(C.getFigureString());break}case Pa:{const C=Mt().createFigureContainer(J().figure);yr.transformAsMannequinFigure(C),s(C.getFigureString());break}case Da:case Fa:{const C=yr.getMergedMannequinFigureContainer(J().figure,l);s(C.getFigureString());break}}},[n,l,u]),o===-1?null:t(le,{title:g("mannequin.widget.title"),className:"nitro-mannequin no-resize",onCloseClick:I,children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 overflow-auto",children:t(at,{center:!0,children:d(R,{fullWidth:!0,gap:2,overflow:"hidden",children:[t(v,{children:d(P,{position:"relative",className:"mannequin-preview",children:[t(it,{position:"absolute",figure:e,direction:2}),u>0&&t(wt,{className:"position-absolute end-2 bottom-2",type:"hc"})]})}),d(v,{grow:!0,justifyContent:"between",overflow:"auto",children:[n===ui&&d(z,{children:[t(V,{skin:4,colour:L.lighter_grey,position:"relative",children:t("input",{type:"text",className:"ton-input",value:h,onChange:C=>m(C.target.value),onBlur:_})}),d(v,{gap:1,children:[t(D,{onClick:C=>r(Pa),children:g("mannequin.widget.style")}),t(D,{onClick:E,children:g("mannequin.widget.wear")})]})]}),n===Pa&&d(z,{children:[d(v,{gap:1,children:[t(N,{bold:!0,children:h}),t(N,{wrap:!0,children:g("mannequin.widget.savetext")})]}),d(R,{alignItems:"center",justifyContent:"between",children:[t(N,{underline:!0,pointer:!0,onClick:C=>r(ui),children:g("mannequin.widget.back")}),t(D,{onClick:p,children:g("mannequin.widget.save")})]})]}),n===Da&&d(z,{children:[d(v,{gap:1,children:[t(N,{bold:!0,children:h}),t(N,{children:g("mannequin.widget.weartext")})]}),t(D,{onClick:E,children:g("mannequin.widget.wear")})]}),n===Fa&&t(R,{center:!0,grow:!0,children:t(N,{children:g("mannequin.widget.clubnotification")})}),n===xa&&t(N,{children:g("mannequin.widget.wronggender")})]})]})})})})},IF=()=>{const{onClose:i,openBox:e,text:s,objectId:n,classId:r,isOwnerOfFurniture:o}=a1();return n===-1?null:t(vs,{children:d(P,{className:"ton-ecotron-box drag-handler",children:[t(P,{className:"ton-ecotron-box-date",children:s}),t(P,{className:"ton-ecotron-box-title",children:g("widget.furni.ecotronbox.title")}),d(P,{className:"ton-ecotron-box-options d-flex justify-content-between",children:[t(D,{skin:1,onClick:l=>e(),children:g("widget.furni.ecotronbox.open")}),t(D,{skin:0,onClick:l=>i,children:g("generic.close")})]})]})})},CF=i=>(u1(),null),OI=["9CCEFF","FF9CFF","9CFF9C","FFFF33"],SF=["blue","pink","green","yellow"],TF=i=>{let e=OI.indexOf(i);return e===-1&&(e=0),SF[e]},NF=i=>{const{objectId:e=-1,color:s="0",setColor:n=null,text:r="",setText:o=null,canModify:l=!1,onClose:c=null}=h1();return e===-1?null:t(vs,{handleSelector:".drag-handler",windowPosition:tt.TOP_LEFT,offsetLeft:95,children:d("div",{className:"nitro-stickie nitro-stickie-image stickie-"+TF(s),children:[d("div",{className:"d-flex align-items-center stickie-header drag-handler",children:[t("div",{className:"d-flex align-items-center flex-grow-1 h-100",children:l&&d(z,{children:[t("div",{className:"nitro-stickie-image stickie-trash header-trash",onClick:c}),OI.map(u=>t("div",{className:"stickie-color ms-1",onClick:h=>n(u),style:{backgroundColor:bn.makeColorHex(u)}},u))]})}),t("div",{className:"d-flex align-items-center nitro-stickie-image stickie-close header-close",onClick:c})]}),t("div",{className:"stickie-context",children:t("textarea",{className:"context-text",value:r,onChange:u=>o(u.target.value),tabIndex:0,autoFocus:!0})})]})})},RF=i=>{const{objectId:e=-1,height:s=0,maxHeight:n=40,onClose:r=null,updateHeight:o=null}=g1(),[l,c]=a.useState(""),u=h=>{c(h);const m=parseFloat(h);isNaN(m)||m===s||o(m)};return a.useEffect(()=>{c(s.toString())},[s]),e===-1?null:t(le,{title:g("widget.custom.stack.height.title"),className:"nitro-widget-custom-stack-height",onCloseClick:r,children:t(V,{skin:0,colour:L.white,position:"relative",className:"h-100 w-100 overflow-auto",children:d(at,{justifyContent:"between",children:[t(N,{children:g("widget.custom.stack.height.text")}),d(R,{gap:2,children:[t(kt,{className:"ton-slider",min:0,max:n,step:.01,value:s,onChange:h=>o(h)}),t("input",{className:"show-number-arrows",style:{width:50},type:"number",min:0,max:n,value:l,onChange:h=>u(h.target.value)})]}),d(v,{gap:1,children:[t(D,{onClick:h=>B(new Ii(e,-100)),children:g("furniture.above.stack")}),t(D,{onClick:h=>B(new Ii(e,0)),children:g("furniture.floor.level")})]})]})})})},wI=["9CCEFF","FF9CFF","9CFF9C","FFFF33"],vF=["blue","pink","green","yellow"],bF=["post_it","post_it_shakesp","post_it_dreams","post_it_xmas","post_it_vd","post_it_juninas"],OF=["post_it","shakesp","dreams","christmas","heart","juninas"],wF=i=>{let e=wI.indexOf(i);return e===-1&&(e=0),vF[e]},yF=i=>{let e=bF.indexOf(i);return e===-1&&(e=0),OF[e]},AF=i=>{const{objectId:e=-1,color:s="0",text:n="",type:r="",canModify:o=!1,updateColor:l=null,updateText:c=null,trash:u=null,onClose:h=null}=f1(),[m,p]=a.useState(!1);return a.useEffect(()=>{p(!1)},[e,s,n,r]),e===-1?null:t(vs,{handleSelector:".drag-handler",windowPosition:tt.TOP_LEFT,offsetLeft:95,children:d("div",{className:"nitro-stickie nitro-stickie-image stickie-"+(r=="post_it"?wF(s):yF(r)),children:[d("div",{className:"d-flex align-items-center stickie-header drag-handler",children:[t("div",{className:"d-flex align-items-center flex-grow-1 h-100",children:o&&d(z,{children:[t("div",{className:"nitro-stickie-image stickie-trash header-trash",onClick:u}),r=="post_it"&&t(z,{children:wI.map(E=>t("div",{className:"stickie-color ms-1",onClick:_=>l(E),style:{backgroundColor:bn.makeColorHex(E)}},E))})]})}),t("div",{className:"d-flex align-items-center nitro-stickie-image stickie-close header-close",onClick:h})]}),t("div",{className:"stickie-context",children:!m||!o?t("div",{className:"context-text",onClick:E=>o&&p(!0),children:n}):t("textarea",{className:"context-text",defaultValue:n,tabIndex:0,onBlur:E=>c(E.target.value),autoFocus:!0})})]})})},kF=i=>{const{objectId:e=-1,color:s="1",senderName:n="",date:r="",message:o="",onClose:l=null}=E1();return e===-1?null:t(tI,{color:s,message:o,date:r,senderName:n,onCloseClick:l})},MF=i=>null,UF=i=>{const{diskInventory:e=null,addToPlaylist:s=null}=i,[n,r]=a.useState(-1),[o,l]=a.useState(-1),c=a.useCallback((m,p)=>{m.stopPropagation(),l(E=>E===p?-1:p)},[]),u=a.useCallback((m,p)=>{var E,_;m.stopPropagation(),s(p,(_=(E=_e().soundManager.musicController)==null?void 0:E.getRoomItemPlaylist())==null?void 0:_.length)},[s]),h=()=>{oe("catalog/open/"+It.TRAX_SONGS)};return a.useEffect(()=>{var m;if(o!==-1)return(m=_e().soundManager.musicController)==null||m.playSong(o,lo.PRIORITY_SONG_PLAY,0,0,0,0),()=>{var p;(p=_e().soundManager.musicController)==null||p.stop(lo.PRIORITY_SONG_PLAY)}},[o]),a.useEffect(()=>()=>l(-1),[]),d(z,{children:[d("div",{className:"bg-success py-3 container-fluid justify-content-center d-flex rounded",children:[t("img",{src:ee("image.library.url")+"playlist/title_mymusic.gif",className:"my-music"}),t("h2",{className:"ms-4",children:g("playlist.editor.my.music")})]}),t("div",{className:"h-100 overflow-y-scroll mt-4 py-2",children:t(qe,{columnCount:3,columnMinWidth:75,gap:1,columnMinHeight:110,children:e&&e.getKeys().map((m,p)=>{var C;const E=e.getKey(p),_=e.getWithIndex(p),I=(C=_e().soundManager.musicController)==null?void 0:C.getSongInfo(_);return d(jt,{catalogue:!0,className:"position-relative",onClick:()=>r(f=>f===p?-1:p),children:[t("div",{className:"disk-image flex-shrink-0 mb-n2",style:{backgroundColor:oE(I==null?void 0:I.songData)}}),t(N,{truncate:!0,fullWidth:!0,className:"text-center",children:I==null?void 0:I.name}),n===p&&d(R,{position:"absolute",className:"bottom-0 mb-1 bg-secondary p-1 rounded",alignItems:"center",justifyContent:"center",gap:2,children:[t(D,{onClick:f=>c(f,_),children:t(P,{className:o===_?"pause-btn":"preview-song"})}),t(D,{onClick:f=>u(f,E),children:t(P,{className:"move-disk"})})]})]},p)})})}),d("div",{className:"playlist-bottom text-black p-1",children:[t("h5",{children:g("playlist.editor.text.get.more.music")}),t("div",{children:g("playlist.editor.text.you.have.no.songdisks.available")}),t("div",{children:g("playlist.editor.text.you.can.buy.some.from.the.catalogue")}),t(D,{skin:1,className:"mt-1 w-auto",onClick:()=>h(),children:g("playlist.editor.button.open.catalogue")})]}),t("img",{src:ee("image.library.url")+"playlist/background_get_more_music.gif",className:"get-more"})]})},LF=i=>{var m,p;const{furniId:e=-1,playlist:s=null,currentPlayingIndex:n=-1,removeFromPlaylist:r=null,togglePlayPause:o=null}=i,[l,c]=a.useState(-1),u=E=>{l===E&&r(E)},h=(E,_)=>{o(E,_!==-1?_:0)};return d(z,{children:[d("div",{className:"bg-primary py-3 container-fluid justify-content-center d-flex rounded",children:[t("img",{src:ee("image.library.url")+"playlist/title_playlist.gif",className:"playlist-img"}),t("h2",{className:"ms-4",children:g("playlist.editor.playlist")})]}),t("div",{className:"h-100 overflow-y-scroll py-2",children:t(R,{column:!0,gap:2,children:s&&s.map((E,_)=>d(R,{gap:1,className:"text-black cursor-pointer "+(l===_?"border border-muted border-2 rounded":"border-2"),alignItems:"center",onClick:()=>c(I=>I===_?-1:_),children:[t(P,{onClick:()=>u(_),className:"disk-2 "+(l===_?"selected-song":""),style:{backgroundColor:l===_?"":oE(E.songData)}}),E.name]},_))})}),(!s||s.length===0)&&d(z,{children:[d("div",{className:"playlist-bottom text-black p-1 ms-5",children:[t("h5",{children:g("playlist.editor.add.songs.to.your.playlist")}),t("div",{children:g("playlist.editor.text.click.song.to.choose.click.again.to.move")})]}),t("img",{src:ee("image.library.url")+"playlist/background_add_songs.gif",className:"add-songs"})]}),s&&s.length>0&&d(z,{children:[n===-1&&t(D,{onClick:()=>h(e,l),children:g("playlist.editor.button.play.now")}),n!==-1&&d(R,{gap:1,children:[t(D,{onClick:()=>h(e,l),children:t(P,{className:"pause-song"})}),d(R,{column:!0,children:[t(N,{bold:!0,display:"block",children:g("playlist.editor.text.now.playing.in.your.room")}),t(N,{children:((m=s[n])==null?void 0:m.name)+" - "+((p=s[n])==null?void 0:p.creator)})]})]})]})]})},PF=i=>{const{objectId:e=-1,currentPlayingIndex:s=-1,playlist:n=null,diskInventory:r=null,onClose:o=null,togglePlayPause:l=null,removeFromPlaylist:c=null,addToPlaylist:u=null}=t1();return e===-1?null:t(le,{title:g("playlist.editor.title"),onCloseClick:o,className:"nitro-playlist-editor-widget",children:d("div",{className:"d-flex flex-row gap-1 h-100 ubuntu overflow-hidden",children:[t("div",{className:"w-50 position-relative overflow-hidden h-100 rounded d-flex flex-column",children:t(V,{fullHeight:!0,overflow:"hidden",children:t(UF,{addToPlaylist:u,diskInventory:r})})}),t("div",{className:"w-50 position-relative overflow-hidden h-100 rounded d-flex flex-column",children:t(V,{fullHeight:!0,overflow:"hidden",children:t(LF,{furniId:e,removeFromPlaylist:c,playlist:n,togglePlayPause:l,currentPlayingIndex:s})})})]})})},DF=i=>d(P,{fit:!0,position:"absolute",className:"nitro-room-widgets top-0 start-0",children:[t(oF,{}),t(iF,{}),t(aF,{}),t(cF,{}),t(uF,{}),t(hF,{}),t(mF,{}),t(gF,{}),t(pF,{}),t(fF,{}),t(EF,{}),t(PF,{}),t(CF,{}),t(NF,{}),t(RF,{}),t(AF,{}),t(kF,{}),t(rF,{}),t(MF,{}),t(IF,{})]}),FF=i=>{const[e,s]=a.useState("bobba"),[n,r]=a.useState(""),[o,l]=a.useState(!1),{wordsFilter:c=[],isVisible:u=null,setWordsFilter:h,onClose:m=null}=A1(),{navigatorData:p=null}=Bs(),E=I=>{(o?!n:!e)||(B(new ny(p.enteredGuestRoom.roomId,I,o?n:e)),r(""),s("bobba"),l(!1),!(I&&c.includes(o?n:e))&&h(C=>{const f=[...C];return I?f.push(o?n:e):f.splice(f.indexOf(o?n:e),1),f}))},_=I=>{s(I),l(!1)};return u?t(le,{className:"nitro-room-filter no-resize",onCloseClick:()=>m(),title:g("navigator.roomsettings.roomfilter"),children:d(v,{className:"text-black",gap:1,fullHeight:!0,children:[d(R,{gap:1,justifyContent:"end",alignItems:"center",children:[t("input",{type:"text",className:"ton-input black-border",maxLength:255,value:e,onChange:I=>_(I.target.value)}),t(D,{onClick:()=>E(!0),children:g("navigator.roomsettings.roomfilter.addword")})]}),t(V,{className:"p-1",fullHeight:!0,overflow:"hidden",children:t(v,{fullHeight:!0,className:"overflow-y-scroll",children:c&&c.length>0&&c.map((I,C)=>t(V,{skin:4,className:"p-1",colour:n===I?L.light_grey:L.white,children:t(N,{truncate:!0,children:I})},C))})}),t(R,{className:"d-flex align-items-center justify-content-end gap-2",children:t(D,{color:"red",onClick:()=>E(!1),disabled:c.length===0||!o,children:g("navigator.roomsettings.roomfilter.removeword")})})]})}):null},xF=i=>{const[e,s]=a.useState(!1),{roomSession:n=null}=Xe();ct([Ys.SHOW_THUMBNAIL,Ys.HIDE_THUMBNAIL,Ys.TOGGLE_THUMBNAIL],o=>{switch(o.type){case Ys.SHOW_THUMBNAIL:s(!0);return;case Ys.HIDE_THUMBNAIL:s(!1);return;case Ys.TOGGLE_THUMBNAIL:s(l=>!l);return}});const r=o=>{X().saveTextureAsScreenshot(o,!0),s(!1)};return e?t(DA,{roomId:n.roomId,textureReceiver:r,onClose:()=>s(!1)}):null},GF=i=>{a.useState(!1);const[e,s]=a.useState(null),[n,r]=a.useState(null),[o,l]=a.useState(null),[c,u]=a.useState(null),[h,m]=a.useState(null),[p,E]=a.useState(!1),{navigatorData:_=null}=Bs(),{roomSession:I=null}=Xe();return W(cr,C=>{const f=C.getParser();!f.roomEnter||f.data.roomId!==I.roomId||(e!==f.data.roomName&&s(f.data.roomName),c!==f.data.ownerName&&u(f.data.ownerName),n!==f.data.description&&r(f.data.description),o!==f.data.ranking&&l(f.data.ranking),h!==f.data.tags&&m(f.data.tags))}),a.useEffect(()=>{E(!0);const C=setTimeout(()=>E(!1),6e3);return()=>clearTimeout(C)},[e,c,h]),vo.createPortal(t(R,{className:"nitro-room-tools-container",gap:2,fullWidth:!0,children:t(v,{justifyContent:"center",fullWidth:!0,children:t(Vn,{type:Et.SLIDE_RIGHT,inProp:p,timeout:300,children:t(v,{center:!0,fullWidth:!0,children:d(V,{skin:4,colour:L.secondary_grey,className:"ton-room-info p-2",fullWidth:!0,children:[d(v,{gap:1,children:[t(N,{wrap:!0,variant:"white",className:"volter-bold",children:e}),d(R,{gap:1,children:[t(N,{variant:"white",className:"volter-bold",children:g("navigator.roomownercaption")}),t(N,{variant:"white",children:c})]}),t(R,{gap:1,children:t(N,{variant:"white",children:n})}),d(R,{gap:1,children:[t(N,{variant:"white",className:"volter-bold",children:g("navigator.roomrating")}),t(N,{variant:"white",children:_.currentRoomRating})]})]}),h&&h.length>0&&t(R,{gap:2,children:h.map((C,f)=>d(N,{variant:"white",className:"bg-primary p-1",children:["#",C]},f))})]})})})})}),document.getElementById("notifications-confirms"))},BF=i=>{const{question:e=null,canVote:s=null,vote:n=null,noVotes:r=null,yesVotes:o=null,delay:l=0}=i,c=()=>{let u={};return u["--timer"]=l/1e3+"s",u["--bgColour"]=L.secondary_green,u};return d(le,{draggable:!1,className:"wordquiz-question",position:"absolute",children:[!s&&d(v,{gap:1,children:[d(R,{gap:1,children:[t(V,{colour:L.primary_red,className:"p-2",alignItems:"center",justifyContent:"center",children:t(N,{variant:"white",bold:!0,className:"d-block",children:r})}),t(V,{className:"volter-bold text-black question text-center",justifyContent:"center",alignItems:"center",children:e}),t(V,{colour:L.secondary_green,className:"p-2",alignItems:"center",justifyContent:"center",children:t(N,{variant:"white",bold:!0,className:"d-block",children:o})})]}),t(P,{className:"wordquiz-timer",fullWidth:!0,children:t(P,{className:"wordquiz-timer-inner",style:c()})})]}),s&&d(v,{gap:1,children:[d(R,{gap:1,children:[t(V,{colour:L.primary_red,className:"p-1 cursor-pointer flex-shrink-0",onClick:u=>n(Ri),alignItems:"center",justifyContent:"center",children:t(P,{className:"word-quiz-dislike-sm"})}),t(V,{className:"volter-bold text-black question text-center",justifyContent:"center",alignItems:"center",children:e}),t(V,{colour:L.secondary_green,className:"p-1 cursor-pointer flex-shrink-0",onClick:u=>n(iE),alignItems:"center",justifyContent:"center",children:t(P,{className:"word-quiz-like-sm"})})]}),t(P,{className:"wordquiz-timer",fullWidth:!0,children:t(P,{className:"wordquiz-timer-inner",style:c()})})]})]})},HF=i=>{const{userIndex:e=null,vote:s=null,...n}=i;return t(Xi,{objectId:e,category:re.UNIT,...n,children:t(R,{center:!0,pointer:!0,className:`bg-${s===Ri?"danger":"success"} p-1`,children:t(P,{className:`word-quiz-${s===Ri?"dislike":"like"}-sm`})})})},VF=i=>{const{question:e=null,answerSent:s=!1,answerCounts:n=null,userAnswers:r=null,vote:o=null,delay:l=0}=H1();return d(z,{children:[e&&t(BF,{question:e.content,canVote:!s,vote:o,noVotes:n.get(Ri)||0,yesVotes:n.get(iE)||0,delay:l}),r&&Array.from(r.entries()).map(([c,u],h)=>t(HF,{userIndex:c,vote:u.value},h))]})},WF=i=>{const{roomSession:e=null}=Xe(),{simpleAlert:s=null}=Ke();return ke(Za.ROOM_ZOOM,n=>X().setRoomInstanceRenderingCanvasScale(n.roomId,1,n.level,null,null,!1,n.asDelta)),ke([je.REQUEST_TEASER,je.REQUEST_ECOTRONBOX,je.REQUEST_CLOTHING_CHANGE,je.REQUEST_PLAYLIST_EDITOR,je.OPEN_WIDGET,je.CLOSE_WIDGET,Wo.FURNI_CLICK,Wo.FURNI_DOUBLE_CLICK,Wo.TOOLTIP_SHOW,Wo.TOOLTIP_HIDE],n=>{if(e)switch(n.objectId,n.category,n.type){}}),$e([Tt.RSEME_KICKED,Tt.RSEME_PETS_FORBIDDEN_IN_HOTEL,Tt.RSEME_PETS_FORBIDDEN_IN_FLAT,Tt.RSEME_MAX_PETS,Tt.RSEME_MAX_NUMBER_OF_OWN_PETS,Tt.RSEME_NO_FREE_TILES_FOR_PET,Tt.RSEME_SELECTED_TILE_NOT_FREE_FOR_PET,Tt.RSEME_BOTS_FORBIDDEN_IN_HOTEL,Tt.RSEME_BOTS_FORBIDDEN_IN_FLAT,Tt.RSEME_BOT_LIMIT_REACHED,Tt.RSEME_SELECTED_TILE_NOT_FREE_FOR_BOT,Tt.RSEME_BOT_NAME_NOT_ACCEPTED],n=>{let r=g("error.title"),o="";switch(n.type){case Tt.RSEME_MAX_PETS:o=g("room.error.max_pets");break;case Tt.RSEME_MAX_NUMBER_OF_OWN_PETS:o=g("room.error.max_own_pets");break;case Tt.RSEME_KICKED:o=g("room.error.kicked"),r=g("generic.alert.title");break;case Tt.RSEME_PETS_FORBIDDEN_IN_HOTEL:o=g("room.error.pets.forbidden_in_hotel");break;case Tt.RSEME_PETS_FORBIDDEN_IN_FLAT:o=g("room.error.pets.forbidden_in_flat");break;case Tt.RSEME_NO_FREE_TILES_FOR_PET:o=g("room.error.pets.no_free_tiles");break;case Tt.RSEME_SELECTED_TILE_NOT_FREE_FOR_PET:o=g("room.error.pets.selected_tile_not_free");break;case Tt.RSEME_BOTS_FORBIDDEN_IN_HOTEL:o=g("room.error.bots.forbidden_in_hotel");break;case Tt.RSEME_BOTS_FORBIDDEN_IN_FLAT:o=g("room.error.bots.forbidden_in_flat");break;case Tt.RSEME_BOT_LIMIT_REACHED:o=g("room.error.max_bots");break;case Tt.RSEME_SELECTED_TILE_NOT_FREE_FOR_BOT:o=g("room.error.bots.selected_tile_not_free");break;case Tt.RSEME_BOT_NAME_NOT_ACCEPTED:o=g("room.error.bots.name.not.accepted");break;default:return}s(o,fe.DEFAULT,null,null,r)}),d(z,{children:[t(FD,{}),t(VD,{}),t(HD,{}),t(YD,{}),t(DF,{}),t(GF,{}),t(FF,{}),t(xF,{}),t(jD,{}),t(qD,{}),t(VF,{}),t(KD,{}),t(WD,{}),t(mD,{})]})},jF=i=>{const{roomSession:e=null}=Xe(),s=a.useRef(),{canChat:n}=wn();return a.useEffect(()=>{const r=_e().application.renderer.view;if(!r)return;r.onclick=l=>n?zo(l):null,r.onmousemove=l=>zo(l),r.onmousedown=l=>zo(l),r.onmouseup=l=>zo(l),r.ontouchstart=l=>Qo(l),r.ontouchmove=l=>Qo(l),r.ontouchend=l=>Qo(l),r.ontouchcancel=l=>Qo(l);const o=s.current;o&&o.appendChild(r)},[]),t(P,{fit:!0,innerRef:s,className:!e&&"d-none",children:e&&d(z,{children:[t(WF,{}),e.isSpectator&&t(hD,{})]})})},Fn=i=>{const{type:e,frames:s=0,tickerSpeed:n=50,...r}=i,[o,l]=a.useState(!1),[c,u]=a.useState(1);let h=a.useRef(null);const m=a.useCallback(()=>{if(!o||c>=s)return clearInterval(h.current);u(I=>I+1)},[c,s,h,o]),p=a.useCallback(()=>{if(o||c<=1)return clearInterval(h.current);u(I=>I-1)},[c,o]),E=()=>{l(!0)},_=()=>{l(!1)};return a.useEffect(()=>{h.current&&clearInterval(h.current),h.current=setInterval(o?m:p,n)},[m,o,p,n]),t(P,{className:`toolbar-icon cursor-pointer toolbar-${e}`,"data-frame":c,onMouseEnter:()=>E(),onMouseLeave:()=>_(),...r})},js=i=>{const{onClick:e=null,className:s=null,children:n=null}=i,[r,o]=a.useState(255);return d(V,{pointer:!0,skin:4,opacity:r,colour:L.tertiary_grey,alignItems:"center",justifyContent:"center",onClick:e,onMouseOver:l=>o(0),onMouseLeave:l=>o(255),position:"relative",children:[t(P,{className:s}),n]})},qF=i=>{const{setCmsExpanded:e=null,children:s=null,...n}=i;return a.useEffect(()=>{const r=o=>e(!1);return document.addEventListener("click",r),()=>document.removeEventListener(xe.MOUSE_CLICK,r)},[e]),d(V,{skin:6,colour:L.tertiary_grey,position:"absolute",display:"flex",className:"toolbar-me-view toolbar-cms p-2",children:[d(qe,{gap:1,columnMinWidth:45,columnMaxWidth:"45px",columnMinHeight:45,columnCount:3,fullWidth:!0,className:"toolbar-me-view-grid",children:[t(js,{className:"navigation-item icon icon-cms-news",onClick:r=>oe("habboUI/open/news")}),t(js,{className:"navigation-item icon icon-cms-values",onClick:r=>oe("habboUI/open/rare-values")}),t(js,{className:"navigation-item icon icon-cms-toplist",onClick:r=>oe("habboUI/open/toplists")}),s]}),t(Fo,{colour:L.tertiary_grey,skin:6})]})},YF=i=>{const{useGuideTool:e=!1,unseenAchievementCount:s=0,setMeExpanded:n=null,children:r=null,...o}=i;a.useRef();const{logout:l}=jn(),{totalCount:c}=Vi(),u=a.useMemo(()=>{let h=document.getElementById("toolbar-me-icon");return{x:h.getBoundingClientRect().x+h.parentElement.clientWidth+15,y:h.getBoundingClientRect().y-5}},[]);return a.useEffect(()=>{const h=Pe();h&&X().selectRoomObject(h.roomId,h.ownRoomIndex,re.UNIT)},[]),a.useEffect(()=>{const h=m=>n(!1);return document.addEventListener("click",h),()=>document.removeEventListener(xe.MOUSE_CLICK,h)},[n]),d(V,{skin:6,colour:L.tertiary_grey,position:"absolute",style:{left:u.x,top:u.y},display:"flex",className:"toolbar-me-view p-2",children:[d(qe,{gap:1,columnMinWidth:45,columnMinHeight:45,columnMaxWidth:"45px",columnCount:3,fullWidth:!0,className:"toolbar-me-view-grid",children:[e&&t(js,{className:"navigation-item icon icon-me-helper-tool",onClick:h=>At(new Xt(Xt.TOGGLE_GUIDE_TOOL))}),t(js,{className:"navigation-item icon icon-me-achievements",onClick:h=>oe("achievements/toggle"),children:s>0&&t(qn,{count:s})}),t(js,{className:"navigation-item icon icon-me-collections",onClick:h=>oe("habboUI/collections/toggle"),children:c>0&&t(qn,{count:c})}),t(js,{className:"navigation-item icon icon-me-profile",onClick:h=>ps(J().userId)}),t(js,{className:"navigation-item icon icon-me-rooms",onClick:h=>oe("navigator/search/myworld_view")}),t(js,{className:"navigation-item icon icon-me-clothing",onClick:h=>oe("avatar-editor/toggle")}),t(js,{className:"navigation-item icon icon-me-settings",onClick:h=>oe("user-settings/toggle")}),t(js,{className:"navigation-item icon icon-logout",onClick:h=>l()}),r]}),t(Fo,{colour:L.tertiary_grey,skin:6,placement:"left"})]})},zF=i=>{const{isInRoom:e}=i,{inGame:s}=ys(),[n,r]=a.useState(!1),[o,l]=a.useState(!1),[c,u]=a.useState(!1),{userFigure:h=null}=dn(),{getFullCount:m=0}=ws(),{getTotalUnseen:p=0}=Bi(),{totalCount:E}=Vi(),{requests:_=[]}=ns(),{iconState:I=Js.HIDDEN}=QE(),C=J().isModerator,{catalogIconRef:f,inventoryIconRef:S,navigatorIconRef:T}=Wi();W(Sl,y=>{const w=y.getParser();u(w.isAllowed(k_.USE_GUIDE_TOOL))});const b=a.useCallback((y,w,O,F)=>{const U=document.body.getElementsByClassName(y)[0];if(!U)return;w.className="toolbar-icon-animation",w.style.visibility="visible",w.style.left=O+"px",w.style.top=F+"px",document.body.append(w);const j=U.getBoundingClientRect(),x=w.getBoundingClientRect(),M=x.x-j.x,G=x.y-j.y,H=Math.sqrt(M*M+G*G),Y=500-Math.abs(1/H*100*500*.5),q=20,Z=`ToolbarBouncing[${y}]`;ua.getMotionByTag(Z)||(ua.runMotion(new yc(new ry(Y+8),new oy(U,400,12))).tag=Z);const ce=new yc(new iy(new ay(w,Y,j.x-x.x+q,j.y-x.y,100,1),1),new ly(w));ua.runMotion(ce)},[]);return ke(cy.ANIMATE_ICON,y=>{b("toolbar-inventory",y.image,y.x,y.y)}),d(z,{children:[!s&&d(z,{children:[t(Vn,{type:Et.FADE_IN,inProp:n,timeout:100,children:t(YF,{useGuideTool:c,unseenAchievementCount:p,setMeExpanded:r})}),t(Vn,{type:Et.FADE_IN,inProp:o,timeout:100,children:t(qF,{setCmsExpanded:l})}),t(V,{skin:2,colour:L.primary_grey,className:"ton-toolbar",children:t(R,{alignItems:"center",children:d(v,{alignItems:"center",gap:3,children:[e&&t(Fn,{type:"exit",frames:2,onClick:y=>jl()}),!e&&t(Fn,{type:"home",frames:6,onClick:y=>oe("navigator/goto/home")}),t(Fn,{type:"navigator",frames:4,onClick:y=>oe("navigator/toggle"),innerRef:T}),t(Fn,{type:"catalogue",frames:7,onClick:y=>oe("catalog/toggle"),innerRef:f}),e&&t(Fn,{type:"inventory",frames:5,onClick:y=>oe("inventory/toggle"),innerRef:S,children:m>0&&t(qn,{count:m})}),ee("game.center.enabled")&&t(P,{pointer:!0,className:"icon icon-game",onClick:y=>oe("games/toggle")}),t(P,{className:"navigation-item horz-splitter"}),d(R,{center:!0,pointer:!0,className:"navigation-item item-avatar "+(n?"active ":""),onClick:y=>r(!n),id:"toolbar-me-icon",children:[t(it,{pointer:!0,figure:h,headOnly:!0,direction:2,position:"absolute"}),p+E>0&&t(qn,{count:p+E})]})]})})})]}),d(V,{skin:2,colour:L.secondary_grey,opacity:90,className:"d-flex flex-row p-2 gap-2 friend-bar "+(s?"d-none":""),column:!1,children:[_.length===0&&t(Fn,{type:"console",frames:5,onClick:y=>oe("friends/toggle"),shrink:!0}),_.length>0&&t(Fn,{type:"console-request",frames:5,onClick:y=>oe("friends/toggle"),shrink:!0}),(I===Js.SHOW||I===Js.UNREAD)&&t(P,{pointer:!0,className:`navigation-item icon icon-message ${I===Js.UNREAD&&"is-unseen"}`,onClick:y=>Mo(),shrink:!0}),t(P,{id:"friend-bar",className:"align-items-center w-100 d-flex justify-content-center"}),e&&t(Fn,{type:"camera",frames:12,tickerSpeed:25,shrink:!0,onClick:y=>oe("camera/toggle")}),C&&t(P,{pointer:!0,className:"navigation-item icon icon-modtools align-self-center mb-2",shrink:!0,onClick:y=>oe("mod-tools/toggle")}),ee("cms").enabled&&t(P,{pointer:!0,className:"navigation-item icon icon-cms align-self-center mb-2",shrink:!0,onClick:y=>l(!o),id:"toolbar-cms-icon"})]}),t(R,{alignItems:"center",id:"toolbar-chat-input-container"})]})},KF=i=>{const{badges:e=null,gap:s=1,justifyContent:n="between",...r}=i;return t(z,{children:e&&e.length>0&&e.map((o,l)=>t(v,{center:!0,children:t(ot,{badgeCode:o},o)},o))})},$F=i=>{const{relationships:e=null}=i,s=({type:n})=>{const r=e&&e.relationshipStatusMap.hasKey(n)?e.relationshipStatusMap.getValue(n):null,o=qs.RELATIONSHIP_NAMES[n].toLocaleLowerCase();return d(R,{fullWidth:!0,gap:1,children:[t(R,{center:!0,className:"user-relationship",children:t("i",{className:`nitro-friends-spritesheet icon-${o}`})}),d(v,{grow:!0,gap:0,children:[d(V,{skin:4,colour:L.lighter_grey,alignItems:"center",column:!1,justifyContent:"between",className:"px-2 py-1 user-relationship",children:[d(N,{underline:!0,pointer:!0,onClick:l=>r&&r.randomFriendId>=1&&ps(r.randomFriendId),children:[(!r||r.friendCount===0)&&g("extendedprofile.add.friends"),r&&r.friendCount>=1&&r.randomFriendName]}),r&&r.friendCount>=1&&t(R,{center:!0,position:"relative",className:"avatar-image-container",children:t(it,{figure:r.randomFriendFigure,headOnly:!0,direction:4})})]}),d(N,{italics:!0,className:"user-relationship-count",children:[(!r||r.friendCount===0)&&g("extendedprofile.no.friends.in.this.category"),r&&r.friendCount>1&&g(`extendedprofile.relstatus.others.${o}`,["count"],[(r.friendCount-1).toString()])," "]})]})]})};return d(z,{children:[t(s,{type:qs.HEART}),t(s,{type:qs.SMILE}),t(s,{type:qs.BOBBA})]})},QF=i=>{const{relationships:e=null,friendsCount:s=null}=i;return d(v,{gap:1,children:[d(N,{children:[t("b",{children:g("extendedprofile.friends.count")})," ",s]}),t(N,{className:"volter-bold",children:g("extendedprofile.relstatus")}),t(v,{children:t($F,{relationships:e})})]})},XF=i=>{const{itsMe:e=null,groups:s=null,onLeaveGroup:n=null,overflow:r="hidden",gap:o=2,...l}=i,[c,u]=a.useState(null),[h,m]=a.useState(null);return W(qr,p=>{const E=p.getParser();!c||c!==E.id||E.flag||m(E)}),a.useEffect(()=>{c&&B(new Mr(c,!1))},[c]),a.useEffect(()=>{m(null),s.length>0&&u(p=>(p===s[0].groupId&&B(new Mr(s[0].groupId,!1)),s[0].groupId))},[s]),!s||!s.length?t(v,{center:!0,fullHeight:!0,children:d(R,{justifyContent:"center",gap:2,children:[t(P,{className:"no-group-spritesheet image-1"}),t(P,{className:"no-group-spritesheet image-2"}),t(P,{className:"no-group-spritesheet image-3"})]})}):d(pe,{overflow:r,gap:2,...l,children:[t(v,{alignItems:"center",size:2,overflow:"auto",children:t(qe,{overflow:null,columnCount:1,columnMinHeight:50,className:"user-groups-container",children:s.map((p,E)=>d(jt,{overflow:"unset",itemActive:c===p.groupId,onClick:()=>u(p.groupId),className:"p-1",children:[e&&t("i",{className:"position-absolute end-0 top-0 z-index-1 icon icon-group-"+(p.favourite?"favorite":"not-favorite"),onClick:()=>rA(p)}),t(ot,{badgeCode:p.badgeCode,isGroup:!0})]},E))})}),t(v,{size:10,overflow:"hidden",children:h&&t(fI,{groupInformation:h,onClose:n})})]})},JF=i=>{const{userProfile:e=null}=i,[s,n]=a.useState(e.requestSent),r=e.id===J().userId,o=!s&&!r&&!e.isMyFriend&&!e.requestSent,l=()=>{n(!0),B(new wl(e.username))};return a.useEffect(()=>{n(e.requestSent)},[e]),d(R,{gap:2,children:[t(v,{center:!0,className:"avatar-container",children:t(it,{figure:e.figure,direction:2})}),d(v,{children:[d(v,{gap:0,children:[t(N,{className:"volter-bold",children:e.username}),d(N,{variant:"muted",children:[e.motto," "]})]}),d(v,{gap:1,children:[d(N,{children:[t("b",{children:g("extendedprofile.created")})," ",e.registration]}),d(N,{children:[t("b",{children:g("extendedprofile.last.login")})," ",Xs.format(e.secondsSinceLastVisit,".ago",2)]}),d(N,{children:[t("b",{children:g("extendedprofile.achievementscore")})," ",e.achievementPoints]})]}),d(R,{gap:1,children:[e.isOnline&&t("i",{className:"icon icon-pf-online"}),!e.isOnline&&t("i",{className:"icon icon-pf-offline"}),d(R,{alignItems:"center",gap:1,children:[o&&t(N,{underline:!0,pointer:!0,onClick:l,children:g("extendedprofile.addasafriend")}),!o&&d(z,{children:[t("i",{className:"icon icon-pf-tick"}),r&&t(N,{children:g("extendedprofile.me")}),e.isMyFriend&&t(N,{children:g("extendedprofile.friend")}),(s||e.requestSent)&&t(N,{children:g("extendedprofile.friendrequestsent")})]})]})]})]})]})},ZF=i=>{const[e,s]=a.useState(null),[n,r]=a.useState([]),[o,l]=a.useState(null),c=J().isModerator,u=()=>{s(null),r([]),l(null)},h=()=>{!e||e.id!==J().userId||ps(e.id)};return W(Tg,m=>{const p=m.getParser();!e||p.userId!==e.id||r(p.badges)}),W(Rl,m=>{const p=m.getParser();!e||p.userId!==e.id||l(p)}),W(Rg,m=>{const p=m.getParser();let E=!1;s(_=>(_&&_.id&&(E=_.id===p.id),p)),E||(r([]),l(null)),B(new jf(p.id)),B(new xl(p.id))}),ke(bt.SELECTED,m=>{if(!e||m.category!==re.UNIT)return;const p=Pe().userDataManager.getUserDataByIndex(m.objectId);p.type===vt.USER&&ps(p.webID)}),e?t(le,{title:g("extendedprofile.caption")+(c&&` (${e.id})`),className:"user-profile",onCloseClick:u,children:d(V,{className:"overflow-auto p-2",colour:L.white,position:"relative",gap:2,overflow:"hidden",fullHeight:!0,children:[d(pe,{fullHeight:!1,gap:2,children:[d(v,{size:7,gap:1,className:"user-container pe-2",children:[t(JF,{userProfile:e}),t(V,{fullHeight:!0,colour:L.lighter_grey,className:"p-1",children:t(pe,{columnCount:5,fullHeight:!0,children:t(KF,{fullWidth:!0,center:!0,badges:n})})})]}),t(v,{size:5,children:o&&t(QF,{relationships:o,friendsCount:e.friendsCount})})]}),t(R,{alignItems:"center",className:"rooms-button-container px-2 py-1",children:d(R,{alignItems:"center",gap:1,onClick:m=>oe(`navigator/search/hotel_view/owner:${e.username}`),children:[t("i",{className:"icon icon-rooms"}),t(N,{underline:!0,pointer:!0,children:g("extendedprofile.rooms")})]})}),t(XF,{fullWidth:!0,itsMe:e.id===J().userId,groups:e.groups,onLeaveGroup:h})]})}):null},ex=i=>{const{processAction:e,userSettings:s,saveRangeSlider:n,activeTab:r}=$r();if(r===0)return d(v,{gap:1,alignItems:"center",children:[d(v,{gap:1,children:[t(N,{children:g("widget.memenu.settings.volume.ui")}),d(R,{alignItems:"center",gap:1,children:[t("i",{className:"cursor-pointer "+(s.volumeSystem>1?"icon icon-sound-off":"icon icon-sound-off-active"),onClick:o=>e("system_volume",0),onMouseUp:()=>n("volume")}),t("input",{type:"range",className:"custom-range",min:"0",max:"100",step:"1",id:"volumeSystem",value:s.volumeSystem,onChange:o=>e("system_volume",o.target.value),onMouseUp:()=>n("volume")}),t("i",{className:"cursor-pointer "+(s.volumeSystem<1?"icon icon-sound-on":"icon icon-sound-on-active"),onClick:o=>e("system_volume",100),onMouseUp:()=>n("volume")})]})]}),d(v,{gap:1,children:[t(N,{children:g("widget.memenu.settings.volume.furni")}),d(R,{alignItems:"center",gap:1,children:[t("i",{className:"cursor-pointer "+(s.volumeFurni>1?"icon icon-sound-off":"icon icon-sound-off-active"),onClick:o=>e("furni_volume",0),onMouseUp:()=>n("volume")}),t("input",{type:"range",className:"custom-range",min:"0",max:"100",step:"1",id:"volumeFurni",value:s.volumeFurni,onChange:o=>e("furni_volume",o.target.value),onMouseUp:()=>n("volume")}),t("i",{className:"cursor-pointer "+(s.volumeFurni<1?"icon icon-sound-on":"icon icon-sound-on-active"),onClick:o=>e("furni_volume",100),onMouseUp:()=>n("volume")})]})]}),d(v,{gap:1,children:[t(N,{children:g("widget.memenu.settings.volume.trax")}),d(R,{alignItems:"center",gap:1,children:[t("i",{className:"cursor-pointer "+(s.volumeTrax>1?"icon icon-sound-off":"icon icon-sound-off-active"),onClick:o=>e("trax_volume",0),onMouseUp:()=>n("volume")}),t("input",{type:"range",className:"custom-range",min:"0",max:"100",step:"1",id:"volumeTrax",value:s.volumeTrax,onChange:o=>e("trax_volume",o.target.value),onMouseUp:()=>n("volume")}),t("i",{className:"cursor-pointer "+(s.volumeTrax<1?"icon icon-sound-on":"icon icon-sound-on-active"),onClick:o=>e("trax_volume",100),onMouseUp:()=>n("volume")})]})]})]})},tx=i=>{const{userSettings:e,processAction:s,activeTab:n,tonSettings:r}=$r(),{showSingleBubble:o=null}=Ke(),{post:l,getAPI:c}=Os(),[u,h]=a.useState(""),[m,p]=a.useState(""),E=async()=>{let _=await l(c("change.password.api"),{currentPassword:u,newPassword:m});if(!(!_||_&&(!_.errors||!_.fields||!_.messages))){if(_.errors.length)for(let I of _.errors)o(g(I));else if(_.messages)for(let I of _.messages)o(g(I))}};if(n===2)return d(v,{gap:1,overflow:"auto",children:[d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",checked:e.cameraFollow,onChange:_=>s("camera_follow",_.target.checked)}),t(N,{children:g("memenu.settings.other.disable.room.camera.follow")})]}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",checked:e.roomInvites,onChange:_=>s("room_invites",_.target.checked)}),t(N,{children:g("memenu.settings.other.ignore.room.invites")})]}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",checked:r.blockFollowing,onChange:_=>s("block_following",_.target.checked)}),t(N,{children:g("memenu.settings.other.block.following")})]}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",checked:r.blockFrs,onChange:_=>s("block_frs",_.target.checked)}),t(N,{children:g("memenu.settings.other.ignore.friend.requests")})]}),t("form",{onSubmit:_=>E(),children:d(v,{alignItems:"center",className:"mt-2",children:[t(N,{bold:!0,children:"Change Password"}),t("input",{className:"ton-input text-center black-border w-50",type:"password",value:u,onChange:_=>h(_.target.value),placeholder:g("auth.current.password")}),t("input",{className:"ton-input text-center black-border w-50",type:"password",value:m,onChange:_=>p(_.target.value),placeholder:g("auth.new.password")}),t(D,{skin:1,onClick:_=>E(),children:g("auth.go")})]})})]})},sx=i=>{const{userSettings:e,processAction:s,setCatalogPlaceMultipleObjects:n,setCatalogSkipPurchaseConfirmation:r,catalogSkipPurchaseConfirmation:o,catalogPlaceMultipleObjects:l,activeTab:c,tonSettings:u}=$r();if(c===1)return d(v,{gap:1,children:[d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",checked:l,onChange:h=>n(h.target.checked)}),t(N,{children:g("memenu.settings.other.place.multiple.objects")})]}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",checked:o,onChange:h=>r(h.target.checked)}),t(N,{children:g("memenu.settings.other.skip.purchase.confirmation")})]}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",checked:u.disableYt,onChange:h=>s("disableYt",h.target.checked)}),t(N,{children:g("memenu.settings.other.disable.youtube")})]}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",checked:u.noItemFloor,onChange:h=>s("noItemFloor",h.target.checked)}),t(N,{children:g("memenu.settings.other.no.item.floor")})]})]})},nx=i=>{const{isVisible:e=!1,userSettings:s=null,processAction:n=null,setActiveTab:r=null,activeTab:o=0}=$r();return!e||!s?null:d(le,{title:g("widget.memenu.settings.title"),className:"user-settings-window",colour:L.secondary_grey,onCloseClick:l=>n("close_view"),children:[d(en,{children:[t(Ns,{onClick:l=>r(0),isActive:o==0,children:g("widget.memenu.settings.audio")}),t(Ns,{onClick:l=>r(1),isActive:o==1,children:g("widget.memenu.settings.other")}),t(Ns,{className:"px-3",onClick:l=>r(2),isActive:o==2,children:g("widget.memenu.settings.character")})]}),d(V,{skin:0,colour:L.white,position:"relative",fullHeight:!0,overflow:"hidden",children:[t(ex,{}),t(sx,{}),t(tx,{})]})]})},rx=i=>{const{trigger:e=null,furniIds:s=[]}=Fe();return d(v,{gap:1,children:[t("div",{className:"volter-bold text-white",children:g("wiredfurni.pickfurnis.caption",["count","limit"],[s.length.toString(),e.maximumItemSelectionCount.toString()])}),t("div",{className:"text-white",children:g("wiredfurni.pickfurnis.desc")})]})},Ec=i=>{const{wiredType:e="",requiresFurni:s=de.STUFF_SELECTION_OPTION_NONE,save:n=null,validate:r=null,children:o=null,hasSpecialInput:l=!1}=i,[c,u]=a.useState(null),[h,m]=a.useState(null),[p,E]=a.useState(!1),{trigger:_=null,setTrigger:I=null,setIntParams:C=null,setStringParam:f=null,setFurniIds:S=null,setAllowsFurni:T=null,saveWired:b=null}=Fe(),y=()=>I(null),w=()=>{r&&!r()||(n&&n(),E(!0))};return a.useEffect(()=>{p&&(b(),E(!1))},[p,b]),a.useEffect(()=>{if(!_)return;const O=_.spriteId||-1,F=J().getFloorItemData(O);F?(u(F.name),m(F.description)):(u("NAME: "+O),m("NAME: "+O)),l&&(C(_.intData),f(_.stringData)),s>de.STUFF_SELECTION_OPTION_NONE&&S(U=>(U&&U.length&&Ar.clearSelectionShaderFromFurni(U),_.selectedItems&&_.selectedItems.length?(Ar.applySelectionShaderToFurni(_.selectedItems),_.selectedItems):[])),T(s)},[_,l,s,C,f,S,T]),t(le,{uniqueKey:"nitro-wired",colour:L.secondary_grey,className:"nitro-wired",title:g("wiredfurni.title"),onCloseClick:y,children:d(v,{fullHeight:!0,gap:1,children:[d(v,{gap:1,className:"py-1 px-2",children:[d(R,{alignItems:"center",gap:1,children:[t("i",{className:`icon icon-wired-${e} flex-shrink-0`}),t("div",{className:"text-white volter-bold",children:c})]}),t("div",{className:"text-white",children:h})]}),!!o&&t("hr",{className:"m-0 bg-dark"}),d(v,{className:"py-1 px-2",gap:2,children:[o,s>de.STUFF_SELECTION_OPTION_NONE&&d(z,{children:[t("hr",{className:"my-0 bg-dark mx-n2"}),t(rx,{})]}),t("hr",{className:"my-0 bg-dark mx-n2"})]}),d(R,{alignItems:"center",gap:1,className:"py-1 px-2",children:[t(D,{skin:3,className:"text-white",fullWidth:!0,onClick:w,children:g("wiredfurni.ready")}),t(D,{skin:3,className:"text-white",fullWidth:!0,onClick:y,children:g("cancel")})]})]})})},Ct=i=>{const{requiresFurni:e=de.STUFF_SELECTION_OPTION_NONE,save:s=null,hasSpecialInput:n=!1,children:r=null}=i,{trigger:o=null,actionDelay:l=0,setActionDelay:c=null}=Fe();return a.useEffect(()=>{c(o.delayInPulses)},[o,c]),d(Ec,{wiredType:"action",requiresFurni:e,save:s,hasSpecialInput:n,children:[r,!!r&&t("hr",{className:"m-0 bg-dark"}),d(v,{fullWidth:!0,justifyContent:"center",gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.delay",["seconds"],[Po(l)])}),t(R,{justifyContent:"center",children:t(kt,{className:"ton-slider wired-slider",min:0,max:20,value:l,onChange:u=>c(u)})})]})]})},ox="hd-180-1.ch-210-66.lg-270-82.sh-290-81",ix=i=>{const[e,s]=a.useState(""),[n,r]=a.useState(""),{trigger:o=null,setStringParam:l=null}=Fe(),c=()=>l(e+Hr+n);return a.useEffect(()=>{const u=o.stringData.split(Hr);u.length>0&&s(u[0]),u.length>1&&r(u[1].length>0?u[1]:ox)},[o]),d(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:c,children:[d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.bot.name")}),t("input",{type:"text",className:"ton-input",maxLength:32,value:e,onChange:u=>s(u.target.value)})]}),d(R,{center:!0,children:[t(it,{figure:n,direction:4}),t(D,{onClick:u=>r(J().figure),children:g("wiredfurni.params.capture.figure")})]})]})},ax=i=>{const[e,s]=a.useState(""),[n,r]=a.useState(-1),{trigger:o=null,setStringParam:l=null,setIntParams:c=null}=Fe(),u=()=>{l(e),c([n])};return a.useEffect(()=>{s(o.stringData),r(o.intData.length>0?o.intData[0]:0)},[o]),d(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:u,children:[d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.bot.name")}),t("input",{type:"text",className:"ton-input",maxLength:32,value:e,onChange:h=>s(h.target.value)})]}),d(v,{gap:1,children:[d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-radio-input",type:"radio",name:"followMode",id:"followMode1",checked:n===1,onChange:h=>r(1)}),t(N,{variant:"white",pointer:!0,onClick:h=>r(1),children:g("wiredfurni.params.start.following")})]}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-radio-input",type:"radio",name:"followMode",id:"followMode2",checked:n===0,onChange:h=>r(0)}),t(N,{variant:"white",pointer:!0,onClick:h=>r(0),children:g("wiredfurni.params.stop.following")})]})]})]})},lx=[2,5,7,8,9,10,27],cx=i=>{const[e,s]=a.useState(""),[n,r]=a.useState(-1),{trigger:o=null,setStringParam:l=null,setIntParams:c=null}=Fe(),u=()=>{l(e),c([n])};return a.useEffect(()=>{s(o.stringData),r(o.intData.length>0?o.intData[0]:0)},[o]),d(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:u,children:[d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.bot.name")}),t("input",{type:"text",className:"ton-input",maxLength:32,value:e,onChange:h=>s(h.target.value)})]}),d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.handitem")}),d("select",{className:"ton-carat position-static w-100",value:n,onChange:h=>r(parseInt(h.target.value)),children:[t("option",{value:"0",children:"------"}),lx.map(h=>t("option",{value:h,children:g(`handitem${h}`)},h))]})]})]})},ux=i=>{const[e,s]=a.useState(""),{trigger:n=null,setStringParam:r=null}=Fe(),o=()=>r(e);return a.useEffect(()=>{s(n.stringData)},[n]),t(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!0,save:o,children:d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.bot.name")}),t("input",{type:"text",className:"ton-input",maxLength:32,value:e,onChange:l=>s(l.target.value)})]})})},dx=i=>{const[e,s]=a.useState(""),[n,r]=a.useState(""),[o,l]=a.useState(-1),{trigger:c=null,setStringParam:u=null,setIntParams:h=null}=Fe(),m=()=>{u(e+Hr+n),h([o])};return a.useEffect(()=>{const p=c.stringData.split(Hr);p.length>0&&s(p[0]),p.length>1&&r(p[1].length>0?p[1]:""),l(c.intData.length>0?c.intData[0]:0)},[c]),d(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:m,children:[d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.bot.name")}),t("input",{type:"text",className:"ton-input",maxLength:32,value:e,onChange:p=>s(p.target.value)})]}),d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.message")}),t("input",{type:"text",className:"ton-input",maxLength:ee("wired.action.bot.talk.to.avatar.max.length",64),value:n,onChange:p=>r(p.target.value)})]}),d(v,{gap:1,children:[d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-radio-input",type:"radio",name:"talkMode",id:"talkMode1",checked:o===0,onChange:p=>l(0)}),t(N,{variant:"white",pointer:!0,onClick:p=>l(0),children:g("wiredfurni.params.talk")})]}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-radio-input",type:"radio",name:"talkMode",id:"talkMode2",checked:o===1,onChange:p=>l(1)}),t(N,{variant:"white",pointer:!0,onClick:p=>l(1),children:g("wiredfurni.params.whisper")})]})]})]})},hx=i=>{const[e,s]=a.useState(""),[n,r]=a.useState(""),[o,l]=a.useState(-1),{trigger:c=null,setStringParam:u=null,setIntParams:h=null}=Fe(),m=()=>{u(e+Hr+n),h([o])};return a.useEffect(()=>{const p=c.stringData.split(Hr);p.length>0&&s(p[0]),p.length>1&&r(p[1].length>0?p[1]:""),l(c.intData.length>0?c.intData[0]:0)},[c]),d(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:m,children:[d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.bot.name")}),t("input",{type:"text",className:"ton-input",maxLength:32,value:e,onChange:p=>s(p.target.value)})]}),d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.message")}),t("input",{type:"text",className:"ton-input",maxLength:ee("wired.action.bot.talk.max.length",64),value:n,onChange:p=>r(p.target.value)})]}),d(v,{gap:1,children:[d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-radio-input",type:"radio",name:"talkMode",id:"talkMode1",checked:o===0,onChange:p=>l(0)}),t(N,{variant:"white",pointer:!0,onClick:p=>l(0),children:g("wiredfurni.params.talk")})]}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-radio-input",type:"radio",name:"talkMode",id:"talkMode2",checked:o===1,onChange:p=>l(1)}),t(N,{variant:"white",pointer:!0,onClick:p=>l(1),children:g("wiredfurni.params.shout")})]})]})]})},mx=i=>{const[e,s]=a.useState(""),{trigger:n=null,setStringParam:r=null}=Fe(),o=()=>r(e);return a.useEffect(()=>{s(n.stringData)},[n]),t(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!0,save:o,children:d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.bot.name")}),t("input",{type:"text",className:"ton-input",maxLength:32,value:e,onChange:l=>s(l.target.value)})]})})},gx=i=>t(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT,hasSpecialInput:!1,save:null}),px=i=>t(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT,hasSpecialInput:!1,save:null}),fx=i=>{const[e,s]=a.useState(""),{trigger:n=null,setStringParam:r=null}=Fe(),o=()=>r(e);return a.useEffect(()=>{s(n.stringData)},[n]),t(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:o,children:d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.message")}),t("input",{type:"text",className:"ton-input",value:e,onChange:l=>s(l.target.value),maxLength:ee("wired.action.chat.max.length",100)})]})})},_x=i=>t(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT,hasSpecialInput:!1,save:null}),Ex=i=>{const[e,s]=a.useState(!1),[n,r]=a.useState(1),[o,l]=a.useState(!1),[c,u]=a.useState(1),[h,m]=a.useState(1),[p,E]=a.useState([]),{trigger:_=null,setIntParams:I=null,setStringParam:C=null}=Fe(),f=()=>E(y=>[...y,{isBadge:!1,itemCode:"",probability:null}]),S=y=>{E(w=>{const O=Array.from(w);return O.splice(y,1),O})},T=(y,w,O,F)=>{const U=Array.from(p),j=U[y];j&&(j.isBadge=w,j.itemCode=O,j.probability=F,E(U))},b=()=>{let y=[];for(const w of p){if(!w.itemCode)continue;const O=[w.isBadge?"0":"1",w.itemCode,w.probability.toString()];y.push(O.join(","))}y.length>0&&(C(y.join(";")),I([n,o?1:0,c,h]))};return a.useEffect(()=>{const y=[];if(_.stringData.length>0&&_.stringData.includes(";")){const w=_.stringData.split(";");for(const O of w){const F=O.split(",");F.length===3&&y.push({isBadge:F[0]==="0",itemCode:F[1],probability:Number(F[2])})}}y.length===0&&y.push({isBadge:!1,itemCode:"",probability:null}),r(_.intData.length>0?_.intData[0]:0),l(_.intData.length>1?_.intData[1]===1:!1),u(_.intData.length>2?_.intData[2]:0),m(_.intData.length>3?_.intData[3]:0),s(_.intData.length>3?_.intData[3]>0:!1),E(y)},[_]),d(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:b,children:[d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",id:"limitEnabled",onChange:y=>s(y.target.checked)}),t(N,{variant:"white",children:g("wiredfurni.params.prizelimit",["amount"],[e?c.toString():""])})]}),!e&&t(V,{skin:3,colour:L.tertiary_grey,className:"p-1",children:t(N,{variant:"white",center:!0,children:"Reward limit not set. Make sure rewards are badges or non-tradeable items."})}),e&&t(kt,{className:"ton-slider",min:1,max:1e3,value:c,onChange:y=>u(y)}),t("hr",{className:"m-0 bg-dark"}),d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:"How often can a user be rewarded?"}),d(R,{gap:1,children:[d("select",{className:"ton-carat position-static w-100",value:n,onChange:y=>r(Number(y.target.value)),children:[t("option",{value:"0",children:"Once"}),d("option",{value:"3",children:["Once every ",h," minutes"]}),d("option",{value:"2",children:["Once every ",h," hours"]}),d("option",{value:"1",children:["Once every ",h," days"]})]}),n>0&&t("input",{type:"number",className:"form-control ",value:h,onChange:y=>m(Number(y.target.value))})]})]}),t("hr",{className:"m-0 bg-dark"}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",id:"uniqueRewards",checked:o,onChange:y=>l(y.target.checked)}),t(N,{variant:"white",children:"Unique rewards"})]}),t(V,{skin:3,colour:L.tertiary_grey,className:"p-1",children:t(N,{variant:"white",center:!0,children:"If checked each reward will be given once to each user. This will disable the probabilities option.."})}),t("hr",{className:"m-0 bg-dark"}),d(R,{justifyContent:"between",alignItems:"center",children:[t(N,{variant:"white",bold:!0,children:"Rewards"}),t(D,{onClick:f,children:t(Gt,{icon:"plus"})})]}),t(v,{gap:1,children:p&&p.map((y,w)=>d(R,{gap:1,children:[d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",checked:y.isBadge,onChange:O=>T(w,O.target.checked,y.itemCode,y.probability)}),t(N,{variant:"white",children:"Badge?"})]}),t(V,{skin:4,colour:L.white,position:"relative",children:t("input",{type:"text",className:"ton-input",value:y.itemCode,onChange:O=>T(w,y.isBadge,O.target.value,y.probability),placeholder:"Item Code"})}),t(V,{skin:4,colour:L.white,position:"relative",children:t("input",{type:"number",className:"ton-input",value:y.probability,onChange:O=>T(w,y.isBadge,y.itemCode,Number(O.target.value)),placeholder:"Probability"})}),w>0&&t(D,{onClick:O=>S(w),children:t(Gt,{icon:"trash"})})]},w))})]})},Ix=i=>{const[e,s]=a.useState(1),[n,r]=a.useState(1),[o,l]=a.useState(1),{trigger:c=null,setIntParams:u=null}=Fe(),h=()=>u([e,n,o]);return a.useEffect(()=>{c.intData.length>=2?(s(c.intData[0]),r(c.intData[1]),l(c.intData[2])):(s(1),r(1),l(1))},[c]),d(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:h,children:[d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.setpoints",["points"],[e.toString()])}),t(kt,{className:"ton-slider wired-slider mx-auto",min:1,max:100,value:e,onChange:m=>s(m)})]}),d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.settimesingame",["times"],[n.toString()])}),t(kt,{className:"ton-slider wired-slider mx-auto",min:1,max:10,value:n,onChange:m=>r(m)})]}),d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.team")}),[1,2,3,4].map(m=>d(R,{gap:1,children:[t("input",{className:"ton-form-radio-input",type:"radio",name:"selectedTeam",id:`selectedTeam${m}`,checked:o===m,onChange:p=>l(m)}),t(N,{variant:"white",pointer:!0,onClick:p=>l(m),children:g("wiredfurni.params.team."+m)})]},m))]})]})},Cx=i=>{const[e,s]=a.useState(1),[n,r]=a.useState(1),{trigger:o=null,setIntParams:l=null}=Fe(),c=()=>l([e,n]);return a.useEffect(()=>{o.intData.length>=2?(s(o.intData[0]),r(o.intData[1])):(s(1),r(1))},[o]),d(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:c,children:[d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.setpoints",["points"],[e.toString()])}),t(kt,{className:"ton-slider",min:1,max:100,value:e,onChange:u=>s(u)})]}),d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.settimesingame",["times"],[n.toString()])}),t(kt,{className:"ton-slider wired-slider",min:1,max:10,value:n,onChange:u=>r(u)})]})]})},Sx=i=>{const[e,s]=a.useState(-1),{trigger:n=null,setIntParams:r=null}=Fe(),o=()=>r([e]);return a.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),t(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:o,children:d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.team")}),[1,2,3,4].map(l=>d(R,{gap:1,children:[t("input",{className:"ton-form-radio-input",type:"radio",name:"selectedTeam",id:`selectedTeam${l}`,checked:e===l,onChange:c=>s(l)}),t(N,{variant:"white",pointer:!0,onClick:c=>s(l),children:g(`wiredfurni.params.team.${l}`)})]},l))]})})},Tx=i=>{const[e,s]=a.useState(""),{trigger:n=null,setStringParam:r=null}=Fe(),o=()=>r(e);return a.useEffect(()=>{s(n.stringData)},[n]),t(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:o,children:d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.message")}),t("input",{type:"text",className:"ton-input",value:e,onChange:l=>s(l.target.value),maxLength:ee("wired.action.kick.from.room.max.length",100)})]})})},Nx=i=>t(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!1,save:null}),Rx=[{value:0,icon:"ne"},{value:2,icon:"se"},{value:4,icon:"sw"},{value:6,icon:"nw"}],vx=[0,1,2,3,4,5,6],bx=i=>{const[e,s]=a.useState(-1),[n,r]=a.useState(-1),{trigger:o=null,setIntParams:l=null}=Fe(),c=()=>l([e,n]);return a.useEffect(()=>{o.intData.length>=2?(s(o.intData[0]),r(o.intData[1])):(s(-1),r(-1))},[o]),d(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT,hasSpecialInput:!0,save:c,children:[d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.startdir")}),t(R,{gap:1,className:"flex-wrap",children:Rx.map(u=>d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-radio-input",type:"radio",name:"movement",id:`movement${u.value}`,checked:e===u.value,onChange:h=>s(u.value)}),t(N,{variant:"white",pointer:!0,children:t("i",{className:`icon icon-${u.icon} cursor-pointer`,onClick:h=>s(u.value)})})]},u.value))})]}),d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.turn")}),vx.map(u=>d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-radio-input",type:"radio",name:"rotation",id:`rotation${u}`,checked:n===u,onChange:h=>r(u)}),t(N,{variant:"white",onClick:h=>r(u),children:g(`wiredfurni.params.turn.${u}`)})]},u))]})]})},Ox=[{value:0,icon:"ne"},{value:2,icon:"se"},{value:4,icon:"sw"},{value:6,icon:"nw"}],wx=i=>{const[e,s]=a.useState(-1),[n,r]=a.useState(-1),{trigger:o=null,setIntParams:l=null}=Fe(),c=()=>l([n,e]);return a.useEffect(()=>{o.intData.length>=2?(s(o.intData[1]),r(o.intData[0])):(s(-1),r(-1))},[o]),d(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE,hasSpecialInput:!0,save:c,children:[d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.emptytiles",["tiles"],[e.toString()])}),t(kt,{className:"ton-slider wired-slider",min:1,max:5,value:e,onChange:u=>s(u)})]}),d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.startdir")}),t(R,{gap:1,children:Ox.map(u=>d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-radio-input",type:"radio",name:"movement",id:`movement${u.value}`,checked:n===u.value,onChange:h=>r(u.value)}),t(N,{variant:"white",pointer:!0,onClick:h=>r(u.value),children:t("i",{className:`icon icon-${u.icon}`})})]},u.value))})]})]})},yx=[{value:4,icon:"ne"},{value:5,icon:"se"},{value:6,icon:"sw"},{value:7,icon:"nw"},{value:2,icon:"mv-2"},{value:3,icon:"mv-3"},{value:1,icon:"mv-1"}],Ax=[0,1,2,3],kx=i=>{const[e,s]=a.useState(-1),[n,r]=a.useState(-1),{trigger:o=null,setIntParams:l=null}=Fe(),c=()=>l([e,n]);return a.useEffect(()=>{o.intData.length>=2?(s(o.intData[0]),r(o.intData[1])):(s(-1),r(-1))},[o]),d(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT,hasSpecialInput:!0,save:c,children:[d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.movefurni")}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-radio-input",type:"radio",name:"selectedTeam",id:"movement0",checked:e===0,onChange:u=>s(0)}),t(N,{variant:"white",children:g("wiredfurni.params.movefurni.0")})]}),d(R,{gap:1,className:"flex-wrap",children:[yx.map(u=>d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-radio-input",type:"radio",name:"movement",id:`movement${u.value}`,checked:e===u.value,onChange:h=>s(u.value)}),t("i",{className:`icon icon-${u.icon} cursor-pointer`,onClick:h=>s(u.value)})]},u.value)),t("div",{className:"col"})]})]}),d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.rotatefurni")}),Ax.map(u=>d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-radio-input",type:"radio",name:"rotation",id:`rotation${u}`,checked:n===u,onChange:h=>r(u)}),d(N,{variant:"white",onClick:h=>r(u),pointer:!0,children:[[1,2].includes(u)&&t("i",{className:`icon icon-rot-${u} me-1`}),g(`wiredfurni.params.rotatefurni.${u}`)]})]},u))]})]})},Mx=i=>{const[e,s]=a.useState(-1),[n,r]=a.useState(""),{trigger:o=null,setIntParams:l=null,setStringParam:c=null}=Fe(),u=()=>{l([e]),c(n)};return a.useEffect(()=>{s(o.intData.length>0?o.intData[0]:0),r(o.stringData)},[o]),d(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:u,children:[d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.length.minutes",["minutes"],[e.toString()])}),t(kt,{className:"ton-slider wired-slider",min:1,max:10,value:e,onChange:h=>s(h)})]}),d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.message")}),t("input",{type:"text",className:"form-control ",value:n,onChange:h=>r(h.target.value),maxLength:ee("wired.action.mute.user.max.length",100)})]})]})},Ux=i=>t(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!1,save:null}),Lx=i=>{const[e,s]=a.useState(0),[n,r]=a.useState(0),[o,l]=a.useState(0),{trigger:c=null,setIntParams:u=null}=Fe(),h=()=>u([e,n,o]);return a.useEffect(()=>{s(c.getBoolean(0)?1:0),r(c.getBoolean(1)?1:0),l(c.getBoolean(2)?1:0)},[c]),t(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!0,save:h,children:d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.conditions")}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",id:"stateFlag",checked:!!e,onChange:m=>s(m.target.checked?1:0)}),t(N,{variant:"white",onClick:m=>s(n?0:1),pointer:!0,children:g("wiredfurni.params.condition.state")})]}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",id:"directionFlag",checked:!!n,onChange:m=>r(m.target.checked?1:0)}),t(N,{variant:"white",onClick:m=>r(n?0:1),pointer:!0,children:g("wiredfurni.params.condition.direction")})]}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",id:"positionFlag",checked:!!o,onChange:m=>l(m.target.checked?1:0)}),t(N,{variant:"white",onClick:m=>l(o?0:1),pointer:!0,children:g("wiredfurni.params.condition.position")})]})]})})},Px=i=>t(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT,hasSpecialInput:!1,save:null}),Dx=i=>t(Ct,{requiresFurni:de.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT,hasSpecialInput:!1,save:null}),Fx=i=>{switch(i){case Se.BOT_CHANGE_FIGURE:return t(ix,{});case Se.BOT_FOLLOW_AVATAR:return t(ax,{});case Se.BOT_GIVE_HAND_ITEM:return t(cx,{});case Se.BOT_MOVE:return t(ux,{});case Se.BOT_TALK:return t(hx,{});case Se.BOT_TALK_DIRECT_TO_AVTR:return t(dx,{});case Se.BOT_TELEPORT:return t(mx,{});case Se.CALL_ANOTHER_STACK:return t(gx,{});case Se.CHASE:return t(px,{});case Se.CHAT:return t(fx,{});case Se.FLEE:return t(_x,{});case Se.GIVE_REWARD:return t(Ex,{});case Se.GIVE_SCORE:return t(Cx,{});case Se.GIVE_SCORE_TO_PREDEFINED_TEAM:return t(Ix,{});case Se.JOIN_TEAM:return t(Sx,{});case Se.KICK_FROM_ROOM:return t(Tx,{});case Se.LEAVE_TEAM:return t(Nx,{});case Se.MOVE_FURNI:return t(kx,{});case Se.MOVE_AND_ROTATE_FURNI:return t(bx,{});case Se.MOVE_FURNI_TO:return t(wx,{});case Se.MUTE_USER:return t(Mx,{});case Se.RESET:return t(Ux,{});case Se.SET_FURNI_STATE:return t(Lx,{});case Se.TELEPORT:return t(Px,{});case Se.TOGGLE_FURNI_STATE:return t(Dx,{})}return null},us=i=>{const{requiresFurni:e=de.STUFF_SELECTION_OPTION_NONE,save:s=null,hasSpecialInput:n=!1,children:r=null}=i;return t(Ec,{wiredType:"condition",requiresFurni:e,hasSpecialInput:n,save:()=>s&&s(),children:r})},xx=[2,5,7,8,9,10,27],Gx=i=>{const[e,s]=a.useState(-1),{trigger:n=null,setIntParams:r=null}=Fe(),o=()=>r([e]);return a.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),t(us,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:o,children:d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.handitem")}),t("select",{className:"ton-carat position-static w-100",value:e,onChange:l=>s(parseInt(l.target.value)),children:xx.map(l=>t("option",{value:l,children:g(`handitem${l}`)},l))})]})})},Bx=i=>t(us,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!1,save:null}),Hx=i=>t(us,{requiresFurni:de.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!1,save:null}),Vx=[1,2,3,4],Wx=i=>{const[e,s]=a.useState(-1),{trigger:n=null,setIntParams:r=null}=Fe(),o=()=>r([e]);return a.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),t(us,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:o,children:d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.team")}),Vx.map(l=>d(R,{gap:1,alignItems:"center",children:[t("input",{className:"ton-form-radio-input",type:"radio",name:"selectedTeam",id:`selectedTeam${l}`,checked:e===l,onChange:c=>s(l)}),t(N,{variant:"white",pointer:!0,onClick:c=>s(l),children:g(`wiredfurni.params.team.${l}`)})]},l))]})})},jx=i=>{const[e,s]=a.useState(""),{trigger:n=null,setStringParam:r=null}=Fe(),o=()=>r(e);return a.useEffect(()=>{s(n.stringData)},[n]),t(us,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:o,children:d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.badgecode")}),t("input",{type:"text",className:"ton-input",value:e,onChange:l=>s(l.target.value)})]})})},qx=i=>{const[e,s]=a.useState(-1),{trigger:n=null,setIntParams:r=null}=Fe(),o=()=>r([e]);return a.useEffect(()=>{s((n==null?void 0:n.stringData)!==""?parseInt(n==null?void 0:n.stringData):0)},[n]),t(us,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:o,children:d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.tooltip.effectid")}),t("input",{type:"number",className:"ton-input",value:e,onChange:l=>s(parseInt(l.target.value))})]})})},Yx=i=>{const[e,s]=a.useState(""),[n,r]=a.useState(""),{trigger:o=null,setIntParams:l=null}=Fe(),c=()=>{let u=0,h=0;const m=new Date(e),p=new Date(n);m&&p&&(u=m.getTime()/1e3,h=p.getTime()/1e3),l([u,h])};return a.useEffect(()=>{if(o.intData.length>=2){let u=new Date,h=new Date;o.intData[0]>0&&(u=new Date(o.intData[0]*1e3)),o.intData[1]>0&&(h=new Date(o.intData[1]*1e3)),s(Kc(u)),r(Kc(h))}},[o]),d(us,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:c,children:[d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.startdate")}),t("input",{type:"text",className:"ton-input",value:e,onChange:u=>s(u.target.value)})]}),d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.enddate")}),t("input",{type:"text",className:"ton-input",value:n,onChange:u=>r(u.target.value)})]})]})},zx=i=>t(us,{requiresFurni:de.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!1,save:null}),Kx=i=>{const[e,s]=a.useState(-1),{trigger:n=null,setIntParams:r=null}=Fe(),o=()=>r([e]);return a.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),t(us,{requiresFurni:de.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!0,save:o,children:d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.requireall")}),[0,1].map(l=>d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-radio-input flex-shrink-0",type:"radio",name:"requireAll",id:`requireAll${l}`,checked:e===l,onChange:c=>s(l)}),t(N,{variant:"white",pointer:!0,onClick:c=>s(l),children:g("wiredfurni.params.requireall."+l)})]},l))]})})},$x=i=>{const[e,s]=a.useState(-1),{trigger:n=null,setIntParams:r=null}=Fe(),o=()=>r([e]);return a.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),t(us,{requiresFurni:de.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!0,save:o,children:d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.not_requireall")}),[0,1].map(l=>d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-radio-input flex-shrink-0",type:"radio",name:"requireAll",id:`requireAll${l}`,checked:e===l,onChange:c=>s(l)}),t(N,{variant:"white",pointer:!0,onClick:c=>s(l),children:g(`wiredfurni.params.not_requireall.${l}`)})]},l))]})})},Qx=i=>t(us,{requiresFurni:de.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE,hasSpecialInput:!1,save:null}),Xx=i=>{const[e,s]=a.useState(0),[n,r]=a.useState(0),[o,l]=a.useState(0),{trigger:c=null,setIntParams:u=null}=Fe(),h=()=>u([e,n,o]);return a.useEffect(()=>{s(c.getBoolean(0)?1:0),r(c.getBoolean(1)?1:0),l(c.getBoolean(2)?1:0)},[c]),t(us,{requiresFurni:de.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!0,save:h,children:d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.conditions")}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",id:"stateFlag",checked:!!e,onChange:m=>s(m.target.checked?1:0)}),t(N,{variant:"white",pointer:!0,onClick:m=>s(e?0:1),children:g("wiredfurni.params.condition.state")})]}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",id:"directionFlag",checked:!!n,onChange:m=>r(m.target.checked?1:0)}),t(N,{variant:"white",pointer:!0,onClick:m=>r(n?0:1),children:g("wiredfurni.params.condition.direction")})]}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-check-input",type:"checkbox",id:"positionFlag",checked:!!o,onChange:m=>l(m.target.checked?1:0)}),t(N,{variant:"white",pointer:!0,onClick:m=>l(o?0:1),children:g("wiredfurni.params.condition.position")})]})]})})},Jx=i=>{const[e,s]=a.useState(-1),{trigger:n=null,setIntParams:r=null}=Fe(),o=()=>r([e]);return a.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),t(us,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:o,children:d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.allowbefore",["seconds"],[Po(e)])}),t(kt,{className:"ton-slider wired-slider",min:1,max:1200,value:e,onChange:l=>s(l)})]})})},Zx=i=>{const[e,s]=a.useState(-1),{trigger:n=null,setIntParams:r=null}=Fe(),o=()=>r([e]);return a.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),t(us,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:o,children:d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.allowafter",["seconds"],[Po(e)])}),t(kt,{className:"ton-slider wired-slider",min:1,max:1200,value:e,onChange:l=>s(l)})]})})},eG=i=>{const[e,s]=a.useState(1),[n,r]=a.useState(1),{trigger:o=null,setIntParams:l=null}=Fe(),c=()=>l([e,n]);return a.useEffect(()=>{o.intData.length>=2?(s(o.intData[0]),r(o.intData[1])):(s(1),r(1))},[o]),d(us,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:c,children:[d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.usercountmin",["value"],[e.toString()])}),t(kt,{className:"ton-slider wired-slider",min:1,max:50,value:e,onChange:u=>s(u)})]}),d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.usercountmax",["value"],[n.toString()])}),t(kt,{className:"ton-slider wired-slider",min:1,max:50,value:n,onChange:u=>r(u)})]})]})},tG=i=>{switch(i){case Ne.ACTOR_HAS_HANDITEM:return t(Gx,{});case Ne.ACTOR_IS_GROUP_MEMBER:case Ne.NOT_ACTOR_IN_GROUP:return t(Bx,{});case Ne.ACTOR_IS_ON_FURNI:case Ne.NOT_ACTOR_ON_FURNI:return t(Hx,{});case Ne.ACTOR_IS_IN_TEAM:case Ne.NOT_ACTOR_IN_TEAM:return t(Wx,{});case Ne.ACTOR_IS_WEARING_BADGE:case Ne.NOT_ACTOR_WEARS_BADGE:return t(jx,{});case Ne.ACTOR_IS_WEARING_EFFECT:case Ne.NOT_ACTOR_WEARING_EFFECT:return t(qx,{});case Ne.DATE_RANGE_ACTIVE:return t(Yx,{});case Ne.FURNIS_HAVE_AVATARS:case Ne.FURNI_NOT_HAVE_HABBO:return t(zx,{});case Ne.HAS_STACKED_FURNIS:return t(Kx,{});case Ne.NOT_HAS_STACKED_FURNIS:return t($x,{});case Ne.STUFF_TYPE_MATCHES:case Ne.NOT_FURNI_IS_OF_TYPE:return t(Qx,{});case Ne.STATES_MATCH:case Ne.NOT_STATES_MATCH:return t(Xx,{});case Ne.TIME_ELAPSED_LESS:return t(Jx,{});case Ne.TIME_ELAPSED_MORE:return t(Zx,{});case Ne.USER_COUNT_IN:case Ne.NOT_USER_COUNT_IN:return t(eG,{})}return null},_s=i=>{const{requiresFurni:e=de.STUFF_SELECTION_OPTION_NONE,save:s=null,hasSpecialInput:n=!1,children:r=null}=i;return t(Ec,{wiredType:"trigger",requiresFurni:e,hasSpecialInput:n,save:()=>s&&s(),children:r})},sG=i=>{const[e,s]=a.useState(""),[n,r]=a.useState(0),{trigger:o=null,setStringParam:l=null}=Fe(),c=()=>l(n===1?e:"");return a.useEffect(()=>{s(o.stringData),r(o.stringData?1:0)},[o]),t(_s,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:c,children:d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.picktriggerer")}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-radio-input",type:"radio",name:"avatarMode",id:"avatarMode0",checked:n===0,onChange:u=>r(0)}),t(N,{variant:"white",pointer:!0,onClick:u=>r(0),children:g("wiredfurni.params.anyavatar")})]}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-radio-input",type:"radio",name:"avatarMode",id:"avatarMode1",checked:n===1,onChange:u=>r(1)}),t(N,{variant:"white",pointer:!0,onClick:u=>r(1),children:g("wiredfurni.params.certainavatar")})]}),n===1&&t("input",{type:"text",className:"ton-input",value:e,onChange:u=>s(u.target.value)})]})})},nG=i=>{const[e,s]=a.useState(""),[n,r]=a.useState(-1),{trigger:o=null,setStringParam:l=null,setIntParams:c=null}=Fe(),u=()=>{l(e),c([n])};return a.useEffect(()=>{s(o.stringData),r(o.intData.length>0?o.intData[0]:0)},[o]),d(_s,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:u,children:[d(v,{gap:1,children:[t("div",{className:"volter-bold text-white",children:g("wiredfurni.params.whatissaid")}),t("input",{type:"text",className:"ton-input",value:e,onChange:h=>s(h.target.value)})]}),t("hr",{className:"my-0 bg-dark mx-n2"}),d(v,{gap:1,children:[t("div",{className:"volter-bold text-white",children:g("wiredfurni.params.picktriggerer")}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-radio-input",type:"radio",name:"triggererAvatar",id:"triggererAvatar0",checked:n===0,onChange:h=>r(0)}),t("div",{className:"text-white cursor-pointer",onClick:h=>r(0),children:g("wiredfurni.params.anyavatar")})]}),d(R,{alignItems:"center",gap:1,children:[t("input",{className:"ton-form-radio-input",type:"radio",name:"triggererAvatar",id:"triggererAvatar1",checked:n===1,onChange:h=>r(1)}),t("div",{className:"text-white cursor-pointer",onClick:h=>r(1),children:J().userName})]})]})]})},rG=i=>t(_s,{requiresFurni:de.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE,hasSpecialInput:!1,save:null}),oG=i=>t(_s,{requiresFurni:de.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE,hasSpecialInput:!1,save:null}),iG=i=>{const[e,s]=a.useState(""),{trigger:n=null,setStringParam:r=null}=Fe(),o=()=>r(e);return a.useEffect(()=>{s(n.stringData)},[n]),t(_s,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:o,children:d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.bot.name")}),t("input",{type:"text",className:"ton-input",maxLength:32,value:e,onChange:l=>s(l.target.value)})]})})},aG=i=>{const[e,s]=a.useState(""),{trigger:n=null,setStringParam:r=null}=Fe(),o=()=>r(e);return a.useEffect(()=>{s(n.stringData)},[n]),t(_s,{requiresFurni:de.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE,hasSpecialInput:!0,save:o,children:d(v,{gap:1,children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.bot.name")}),t("input",{type:"text",className:"ton-input",maxLength:32,value:e,onChange:l=>s(l.target.value)})]})})},lG=i=>t(_s,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!1,save:null}),cG=i=>{const[e,s]=a.useState(1),{trigger:n=null,setIntParams:r=null}=Fe(),o=()=>r([e]);return a.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),t(_s,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:o,children:d(v,{gap:1,fullWidth:!0,justifyContent:"center",children:[t("div",{className:"volter-bold text-white",children:g("wiredfurni.params.settime",["seconds"],[Po(e)])}),t(R,{justifyContent:"center",children:t(kt,{className:"ton-slider wired-slider",min:1,max:1200,value:e,onChange:l=>s(l)})})]})})},uG=i=>{const[e,s]=a.useState(1),{trigger:n=null,setIntParams:r=null}=Fe(),o=()=>r([e]);return a.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),t(_s,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:o,children:d(v,{gap:1,fullWidth:!0,justifyContent:"center",children:[t(N,{variant:"white",bold:!0,children:g("wiredfurni.params.setlongtime",["time"],[Xs.format(e*5).toString()])}),t(R,{justifyContent:"center",children:t(kt,{className:"ton-slider wired-slider justify-content-center",min:1,max:120,value:e,onChange:l=>s(l)})})]})})},dG=i=>{const[e,s]=a.useState(1),{trigger:n=null,setIntParams:r=null}=Fe(),o=()=>r([e]);return a.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),t(_s,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:o,children:d(v,{gap:1,fullWidth:!0,justifyContent:"center",children:[t("div",{className:"volter-bold text-white",children:g("wiredfurni.params.settime",["seconds"],[Po(e)])}),t(R,{justifyContent:"center",children:t(kt,{className:"ton-slider wired-slider justify-content-center",min:1,max:60,value:e,onChange:l=>s(l)})})]})})},hG=i=>t(_s,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!1,save:null}),mG=i=>t(_s,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!1,save:null}),gG=i=>{const[e,s]=a.useState(1),{trigger:n=null,setIntParams:r=null}=Fe(),o=()=>r([e]);return a.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),t(_s,{requiresFurni:de.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:o,children:d(v,{gap:1,fullWidth:!0,justifyContent:"center",children:[t("div",{className:"volter-bold text-white",children:g("wiredfurni.params.setscore",["points"],[e.toString()])}),t(R,{justifyContent:"center",children:t(kt,{className:"ton-slider wired-slider justify-content-center",min:1,max:1e3,value:e,onChange:l=>s(l)})})]})})},pG=i=>t(_s,{requiresFurni:de.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE,hasSpecialInput:!1,save:null}),fG=i=>{switch(i){case ut.AVATAR_ENTERS_ROOM:return t(sG,{});case ut.AVATAR_SAYS_SOMETHING:return t(nG,{});case ut.AVATAR_WALKS_OFF_FURNI:return t(rG,{});case ut.AVATAR_WALKS_ON_FURNI:return t(oG,{});case ut.BOT_REACHED_AVATAR:return t(iG,{});case ut.BOT_REACHED_STUFF:return t(aG,{});case ut.COLLISION:return t(lG,{});case ut.EXECUTE_ONCE:return t(cG,{});case ut.EXECUTE_PERIODICALLY:return t(dG,{});case ut.EXECUTE_PERIODICALLY_LONG:return t(uG,{});case ut.GAME_ENDS:return t(hG,{});case ut.GAME_STARTS:return t(mG,{});case ut.SCORE_ACHIEVED:return t(gG,{});case ut.TOGGLE_FURNI:return t(pG,{})}return null},_G=i=>{const{trigger:e=null}=Fe();return e?e instanceof b_?Fx(e.code):e instanceof O_?fG(e.code):e instanceof w_?tG(e.code):null:null},EG=i=>{const[e,s]=a.useState(!1),[n,r]=a.useState(!0);return $e(qt.CREATED,o=>r(!1)),$e(qt.ENDED,o=>r(o.openLandingView)),a.useEffect(()=>{s(!0),Lr().connection.onReady()},[]),a.useEffect(()=>{const o={linkReceived:l=>{const c=l.split("/");if(!(c.length<2))switch(c[1]){case"open":if(c.length>2)switch(c[2]){case"credits":break;default:{const u=c[2];bo.openHabblet(u)}}return}},eventUrlPrefix:"habblet/"};return dt(o),()=>ht(o)},[]),d(z,{children:[t(zF,{isInRoom:!n}),t(TP,{}),t(_G,{}),t(_U,{}),t(lU,{}),t(jP,{}),t(X0,{}),t(pL,{}),t(VL,{}),t(dD,{isInRoom:!n}),t(nx,{}),t(ZF,{}),t(u0,{}),t(RU,{}),t(B0,{}),t(wL,{}),t(YP,{}),t(T0,{}),t(N0,{}),t(OU,{}),t(Pk,{}),t(jF,{}),t(qk,{}),t(xk,{}),t(XL,{}),t(Bk,{}),t(tU,{}),t(Rk,{})]})};md.UI_VERSION=$_();const IG=i=>{const[e,s]=a.useState(!1),[n,r]=a.useState(!1),[o,l]=a.useState("Getting Ready"),[c,u]=a.useState(0),[h,m]=a.useState(!0),[p,E]=a.useState(!1),{authenticated:_,handshakeFailedHandler:I,setReady:C,ready:f,connectionClosedHandler:S}=jn(),[T,b]=a.useState(!0),[y,w]=a.useState(!0);if(!_e()){if(!NitroConfig)throw new Error("NitroConfig is not defined!");Er.bootstrap(),new _k,NitroConfig["sso.ticket"]?C(!0):b(!1)}const O=a.useCallback(async F=>{switch(F.type){case jo.LOADED:_e().localization.init(),E(!0),u(U=>U+20);return;case jo.FAILED:r(!0),l("Configuration Failed");return;case Er.WEBGL_UNAVAILABLE:r(!0),l("WebGL Required");return;case Er.WEBGL_CONTEXT_LOST:r(!0),l("WebGL Context Lost - Reloading"),setTimeout(()=>window.location.reload(),1500);return;case ks.CONNECTION_HANDSHAKING:u(U=>U+20);return;case ks.CONNECTION_HANDSHAKE_FAILED:NitroConfig["sso.ticket"]&&r(!0);return;case ks.CONNECTION_AUTHENTICATED:u(U=>U+20),r(!1),_e().init(),_o.available&&_o.call("legacyTrack","authentication","authok",[]);return;case ks.CONNECTION_ERROR:r(!0),l("Connection Error "),C(!0);return;case ks.CONNECTION_CLOSED:_e().roomEngine&&_e().roomEngine.dispose(),r(!0),l("Connection Error"),bo.send(-1,"client.init.handshake.fail");return;case Jt.ENGINE_INITIALIZED:u(U=>U+20),s(!0),setTimeout(()=>{C(!0)},300);return;case Ac.LOADED:{const U=ee("preload.assets.urls"),j=[];if(U&&U.length)for(const M of U)j.push(Nt.interpolate(M));await A_().downloadAssets(j)?(Lr().init(),u(M=>M+20)):(r(!0),l("Assets Failed"));return}}},[C]);return fn(Er.WEBGL_UNAVAILABLE,O),fn(Er.WEBGL_CONTEXT_LOST,O),fn(ks.CONNECTION_HANDSHAKING,O),fn(ks.CONNECTION_HANDSHAKE_FAILED,O),fn(ks.CONNECTION_HANDSHAKE_FAILED,I),fn(ks.CONNECTION_AUTHENTICATED,O),fn(ks.CONNECTION_ERROR,O),fn(ks.CONNECTION_CLOSED,O),fn(ks.CONNECTION_CLOSED,S),ke(Jt.ENGINE_INITIALIZED,O),xA(Ac.LOADED,O),eu(jo.LOADED,O),eu(jo.FAILED,O),$e(qt.CREATED,F=>w(!1)),$e(qt.ENDED,F=>w(F.openLandingView)),a.useEffect(()=>{_e().core.configuration.init();const F=U=>m(!(window.devicePixelRatio%1));return window.addEventListener("resize",F),F(),()=>{window.removeEventListener("resize",F)}},[]),d(P,{fit:!0,overflow:"hidden",className:h&&"image-rendering-pixelated",children:[(!e||n)&&t(Z1,{isError:n,message:o,percent:c,isAuth:T}),t(P,{id:"draggable-windows-container"}),t(Vn,{type:Et.FADE_IN,inProp:p&&y,timeout:500,children:t(J1,{limited:!e,visible:y})}),t(Vn,{type:Et.FADE_IN,inProp:p&&!f,timeout:500,children:t(Ok,{})}),t(Vn,{type:Et.FADE_IN,inProp:e,children:t(EG,{})})]})};BI.add(HI);VI(document.getElementById("root")).render(t(IG,{}));