import{r as o,j as e,F as hc,a as gc,b as Qh,c as Hs,N as zr,d as fc,H as ia,M as be,T as Mt,R as te,e as $e,A as ai,f as Bt,G as Jh,g as X,D as Zh,C as Is,h as eg,i as Ve,k as tg,l as Za,m as Cn,n as Us,o as pc,p as eo,E as sg,q as tu,s as Ms,t as Xa,u as Bi,v as dt,w as Hi,S as aa,x as Ei,y as ng,z as am,B as Wi,I as rg,J as ig,K as ag,L as to,O as Rs,P as Ln,Q as om,V as Ot,U as ll,W as ci,X as Vt,Y as Qs,Z as og,_ as lg,$ as Bo,a0 as cl,a1 as lm,a2 as ar,a3 as or,a4 as Wn,a5 as cm,a6 as lt,a7 as cg,a8 as ug,a9 as dg,aa as mg,ab as hg,ac as gg,ad as fg,ae as pg,af as xg,ag as jg,ah as Ig,ai as bg,aj as um,ak as Eg,al as Cg,am as Ng,an as vg,ao as _g,ap as Sg,aq as wg,ar as Tg,as as yg,at as Rg,au as Og,av as kg,aw as Ag,ax as Dg,ay as ql,az as Pg,aA as dm,aB as Lg,aC as Mg,aD as Ug,aE as Fg,aF as Vg,aG as Gg,aH as Bg,aI as Hg,aJ as Wg,aK as qg,aL as zg,aM as Yg,aN as $g,aO as mm,aP as Kg,aQ as Xg,aR as Qg,aS as su,aT as Jg,aU as Zg,aV as ef,aW as Ho,aX as tf,aY as sf,aZ as hm,a_ as nf,a$ as rf,b0 as so,b1 as Pt,b2 as gi,b3 as gm,b4 as fm,b5 as af,b6 as of,b7 as lf,b8 as cf,b9 as uf,ba as df,bb as mf,bc as hf,bd as gf,be as Ni,bf as xc,bg as nu,bh as ff,bi as pm,bj as pf,bk as xf,bl as jf,bm as If,bn as bf,bo as Ef,bp as Cf,bq as Nf,br as vf,bs as _f,bt as Sf,bu as wf,bv as Tf,bw as yf,bx as Rf,by as Of,bz as kf,bA as Af,bB as Df,bC as Pf,bD as Lf,bE as Mf,bF as Uf,bG as Ff,bH as Vf,bI as Gf,bJ as Bf,bK as Hf,bL as Wf,bM as xm,bN as zl,bO as qf,bP as jm,bQ as zf,bR as Yf,bS as $f,bT as Kf,bU as Xf,bV as Qf,bW as Jf,bX as Zf,bY as ep,bZ as tp,b_ as sp,b$ as np,c0 as rp,c1 as ip,c2 as ap,c3 as op,c4 as lp,c5 as cp,c6 as up,c7 as dp,c8 as mp,c9 as hp,ca as gp,cb as fp,cc as pp,cd as xp,ce as jp,cf as Ip,cg as bp,ch as Ep,ci as Cp,cj as Np,ck as vp,cl as _p,cm as Im,cn as bm,co as no,cp as Sp,cq as wp,cr as qi,cs as Em,ct as et,cu as Tp,cv as yp,cw as Rp,cx as Op,cy as kp,cz as Ap,cA as Dp,cB as Pp,cC as Lp,cD as Mp,cE as Up,cF as ul,cG as Fp,cH as Vp,cI as Gp,cJ as Bp,cK as Hp,cL as Wp,cM as qp,cN as ru,cO as zp,cP as Yp,cQ as Er,cR as $p,cS as Kp,cT as ys,cU as bt,cV as Bs,cW as Xp,cX as Qp,cY as Jp,cZ as ba,c_ as Se,c$ as Zp,d0 as Ft,d1 as ex,d2 as tx,d3 as sx,d4 as nx,d5 as rx,d6 as ix,d7 as ax,d8 as ox,d9 as lx,da as cx,db as ux,dc as dx,dd as mx,de as hx,df as gx,dg as fx,dh as px,di as Yl,dj as xx,dk as jx,dl as Ix,dm as Cm,dn as bx,dp as Ex,dq as iu,dr as Cx,ds as Nx,dt as vx,du as _x,dv as $l,dw as Sx,dx as wx,dy as Tx,dz as yx,dA as au,dB as Ea,dC as Rx,dD as Ox,dE as kx,dF as Ax,dG as Nm,dH as Dx,dI as vm,dJ as Px,dK as _m,dL as Lx,dM as Mx,dN as Ux,dO as Fx,dP as ou,dQ as Ds,dR as Sm,dS as vi,dT as hn,dU as lu,dV as cu,dW as Et,dX as Vs,dY as Vx,dZ as Gx,d_ as Bx,d$ as Hx,e0 as dl,e1 as Wx,e2 as uu,e3 as du,e4 as qx,e5 as ml,e6 as hl,e7 as zx,e8 as Yx,e9 as $x,ea as Kx,eb as Xx,ec as Qx,ed as Ca,ee as Jx,ef as Zx,eg as ej,eh as wm,ei as tj,ej as sj,ek as jc,el as nj,em as rj,en as ij,eo as aj,ep as oj,eq as lj,er as cj,es as uj,et as dj,eu as mj,ev as hj,ew as gl,ex as gj,ey as Tm,ez as ym,eA as fj,eB as pj,eC as xj,eD as jj,eE as Ij,eF as bj,eG as Ss,eH as ws,eI as Ej,eJ as Wo,eK as Ic,eL as bc,eM as Rm,eN as Om,eO as Cj,eP as Nj,eQ as vj,eR as _j,eS as Sj,eT as _i,eU as wj,eV as Tj,eW as yj,eX as Rj,eY as Oj,eZ as mu,e_ as kj,e$ as Aj,f0 as Dj,f1 as Pj,f2 as Lj,f3 as Mj,f4 as hu,f5 as Uj,f6 as Fj,f7 as Vj,f8 as Gj,f9 as Bj,fa as Hj,fb as Wj,fc as qj,fd as zj,fe as Yj,ff as $j,fg as Kj,fh as Xj,fi as km,fj as Qj,fk as Jj,fl as Zj,fm as Am,fn as Dm,fo as eI,fp as tI,fq as Pm,fr as sI,fs as nI,ft as rI,fu as iI,fv as aI,fw as oI,fx as lI,fy as cI,fz as uI,fA as dI,fB as mI,fC as hI,fD as gI,fE as fI,fF as pI,fG as Ec,fH as oa,fI as xI,fJ as fl,fK as jI,fL as gu,fM as II,fN as bI,fO as cs,fP as EI,fQ as CI,fR as NI,fS as vI,fT as _I,fU as SI,fV as wI,fW as TI,fX as yI,fY as RI,fZ as OI,f_ as kI,f$ as AI,g0 as DI,g1 as PI,g2 as LI,g3 as fu,g4 as Lm,g5 as Mm,g6 as MI,g7 as UI,g8 as FI,g9 as VI,ga as GI,gb as BI,gc as HI,gd as WI,ge as qI,gf as ui,gg as Zs,gh as Um,gi as zI,gj as YI,gk as $I,gl as KI,gm as XI,gn as QI,go as JI,gp as ZI,gq as eb,gr as tb,gs as sb,gt as nb,gu as rb,gv as ib,gw as ab,gx as ob,gy as lb,gz as cb,gA as ub,gB as pu,gC as db,gD as mb,gE as hb,gF as gb,gG as fb,gH as pb,gI as Na,gJ as xu,gK as xb,gL as jb,gM as Ib,gN as va,gO as Fm,gP as bb,gQ as pl,gR as Eb,gS as Cb,gT as Nb,gU as Vm,gV as vb,gW as _b,gX as Sb,gY as wb,gZ as Tb,g_ as yb,g$ as Rb,h0 as Ob,h1 as kb,h2 as Ab,h3 as Db,h4 as Pb,h5 as Lb,h6 as Mb,h7 as Ub,h8 as Tr,h9 as Fb,ha as ju,hb as Vb,hc as Gb,hd as Bb,he as Gm,hf as Hb,hg as Wb,hh as qb,hi as zb,hj as Yb,hk as $b,hl as Kb,hm as Xb,hn as Qb,ho as Jb,hp as qo,hq as Bm,hr as Zb,hs as eE,ht as tE,hu as sE,hv as nE,hw as rE,hx as iE,hy as aE,hz as oE,hA as lE,hB as Hm,hC as cE,hD as Wm,hE as uE,hF as Cc,hG as Nc,hH as dE,hI as mE,hJ as hE,hK as gE,hL as Pn,hM as xl,hN as fE,hO as pE,hP as xE,hQ as Iu,hR as jE,hS as _a,hT as IE,hU as bE,hV as EE,hW as vc,hX as qm,hY as Js,hZ as CE,h_ as NE,h$ as vE,i0 as zm,i1 as Ym,i2 as _E,i3 as SE,i4 as wE,i5 as TE,i6 as yE,i7 as bu,i8 as RE,i9 as $m,ia as OE,ib as kE,ic as AE,id as DE,ie as PE,ig as LE,ih as ME,ii as UE,ij as FE,ik as VE,il as GE,im as BE,io as HE,ip as WE,iq as qE,ir as zE,is as YE,it as $E,iu as Sa,iv as xt,iw as KE,ix as jl,iy as Eu,iz as XE,iA as QE,iB as JE,iC as ZE,iD as eC,iE as tC,iF as sC,iG as nC,iH as rC,iI as iC,iJ as Il,iK as bl,iL as El,iM as aC,iN as oC,iO as lC,iP as cC,iQ as uC,iR as dC,iS as Cu,iT as mC,iU as an,iV as wa,iW as hC}from"./vendor-BA-Z_o67.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function s(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(r){if(r.ep)return;r.ep=!0;const i=s(r);fetch(r.href,i)}})();const A=a=>{const{ref:t=null,innerRef:s=null,display:n=null,fit:r=!1,fitV:i=!1,grow:l=!1,shrink:c=!1,fullWidth:m=!1,fullHeight:h=!1,overflow:u=null,position:g=null,float:f=null,pointer:p=!1,visible:x=null,textColor:I=null,classNames:j=[],className:E="",style:C={},children:b=null,..._}=a,S=o.useMemo(()=>{const k=[];return n&&n.length&&k.push("d-"+n),(r||m)&&k.push("w-100"),(r||h)&&k.push("h-100"),i&&k.push("vw-100","vh-100"),l&&k.push("flex-grow-1"),c&&k.push("flex-shrink-0"),u&&k.push("overflow-"+u),g&&k.push("position-"+g),f&&k.push("float-"+f),p&&k.push("cursor-pointer"),x!==null&&k.push(x?"visible":"invisible"),I&&k.push("text-"+I),j.length&&k.push(...j),k},[n,r,i,l,c,m,h,u,g,f,p,x,I,j]),T=o.useMemo(()=>{let k=S.join(" ");return E.length&&(k+=" "+E),k.trim()},[S,E]),L=o.useMemo(()=>{let k={};return Object.keys(C).length&&(k={...k,...C}),k},[C]);return e.jsx("div",{ref:s,className:T,style:L,..._,children:b})},Km=o.createContext({isCssGrid:!1}),gC=a=>e.jsx(Km.Provider,{value:a.value,children:a.children}),fC=()=>o.useContext(Km),ne=a=>{const{inline:t=!1,gap:s=2,maxContent:n=!1,columnCount:r=0,center:i=!1,alignSelf:l=null,alignItems:c=null,justifyContent:m=null,fullHeight:h=!0,classNames:u=[],style:g={},...f}=a,p=o.useMemo(()=>{const I=[];return t?I.push("inline-grid"):I.push("grid"),s?I.push("gap-"+s):s===0&&I.push("gap-0"),n&&I.push("flex-basis-max-content"),l&&I.push("align-self-"+l),c&&I.push("align-items-"+c),m&&I.push("justify-content-"+m),!c&&!m&&i&&I.push("align-items-center","justify-content-center"),u.length&&I.push(...u),I},[t,s,n,l,c,m,i,u]),x=o.useMemo(()=>{let I={};return r&&(I["--bs-columns"]=r.toString()),Object.keys(g).length&&(I={...I,...g}),I},[r,g]);return e.jsx(gC,{value:{isCssGrid:!0},children:e.jsx(A,{fullHeight:h,classNames:p,style:x,...f})})},Pe=a=>{const{columnMinWidth:t=40,columnMinHeight:s=40,columnCount:n=0,fullHeight:r=!1,maxContent:i=!0,overflow:l="auto",style:c={},...m}=a,h=o.useMemo(()=>{let u={};return u["--nitro-grid-column-min-height"]=s+"px",n>1&&(u.gridTemplateColumns=`repeat(auto-fill, minmax(${t}px, 1fr))`),Object.keys(c).length&&(u={...u,...c}),u},[t,s,n,c]);return e.jsx(ne,{columnCount:n,fullHeight:r,overflow:l,style:h,...m})},w=a=>{const{display:t="flex",column:s=void 0,reverse:n=!1,gap:r=null,center:i=!1,alignSelf:l=null,alignItems:c=null,justifyContent:m=null,classNames:h=[],...u}=a,g=o.useMemo(()=>{const f=[];return s?n?f.push("flex-column-reverse"):f.push("flex-column"):n&&f.push("flex-row-reverse"),r&&f.push("gap-"+r),l&&f.push("align-self-"+l),c&&f.push("align-items-"+c),m&&f.push("justify-content-"+m),!c&&!m&&i&&f.push("align-items-center","justify-content-center"),h.length&&f.push(...h),f},[s,n,r,i,l,c,m,h]);return e.jsx(A,{display:t,classNames:g,...u})},P=a=>{const{variant:t="primary",size:s="sm",active:n=!1,disabled:r=!1,classNames:i=[],outline:l=!1,tp:c=!1,...m}=a,h=o.useMemo(()=>{const u=["btn"];return l&&t?u.push("btn-outline-"+t):t&&u.push("btn-"+t),c&&u.push("btn-transparent"),s&&u.push("btn-"+s),n&&u.push("active"),r&&u.push("disabled"),i.length&&u.push(...i),u},[t,s,n,r,i,l]);return e.jsx(w,{center:!0,classNames:h,...m})},bn=a=>{const{classNames:t=[],...s}=a,n=o.useMemo(()=>{const r=["btn-group"];return t.length&&r.push(...t),r},[t]);return e.jsx(A,{classNames:n,...s})},Xm=o.createContext({closers:null,setClosers:null,closeAll:null}),pC=a=>e.jsx(Xm.Provider,{...a}),xC=()=>o.useContext(Xm),ro=a=>{const{alignItems:t="center",gap:s=1,children:n=null,...r}=a;return e.jsx(w,{alignItems:t,gap:s,...r,children:n})},io=a=>{const{headerText:t="",isExpanded:s=!1,gap:n=0,classNames:r=[],children:i=null,...l}=a,[c,m]=o.useState(!1),{setClosers:h=null,closeAll:u=null}=xC(),g=()=>{u(),m(x=>!x)},f=o.useCallback(()=>m(!1),[]),p=o.useMemo(()=>{const x=["nitro-card-accordion-set"];return c&&x.push("active"),r&&r.length&&x.push(...r),x},[c,r]);return o.useEffect(()=>{m(s)},[s]),o.useEffect(()=>{const x=f;return h(I=>{const j=[...I];return j.push(x),j}),()=>{h(I=>{const j=[...I],E=j.indexOf(x);return E>=0&&j.splice(E,1),j})}},[f,h]),e.jsxs(v,{classNames:p,gap:n,...l,children:[e.jsxs(w,{pointer:!0,justifyContent:"between",className:"nitro-card-accordion-set-header px-2 py-1",onClick:g,children:[e.jsx(N,{children:t}),c&&e.jsx(hc,{className:"fa-icon"}),!c&&e.jsx(gc,{className:"fa-icon"})]}),c&&e.jsx(v,{fullHeight:!0,overflow:"auto",gap:0,className:"nitro-card-accordion-set-content",children:i})]})},jC=a=>{const{...t}=a,[s,n]=o.useState([]),r=o.useCallback(()=>{for(const i of s)i()},[s]);return e.jsx(pC,{value:{closers:s,setClosers:n,closeAll:r},children:e.jsx(v,{gap:0,...t})})},se=a=>{const{overflow:t="auto",classNames:s=[],...n}=a,r=o.useMemo(()=>{const i=["container-fluid","content-area"];return s.length&&i.push(...s),i},[s]);return e.jsx(v,{classNames:r,overflow:t,...n})},IC=o.createContext({theme:null}),bC=a=>e.jsx(IC.Provider,{value:a.value,children:a.children}),re=a=>{const{headerText:t=null,isGalleryPhoto:s=!1,noCloseButton:n=!1,isInfoToHabboPages:r=!1,hideButtonClose:i=!1,onReportPhoto:l=null,onClickInfoHabboPages:c=null,onCloseClick:m=null,justifyContent:h="center",alignItems:u="center",classNames:g=[],children:f=null,...p}=a,x=o.useMemo(()=>{const j=["drag-handler","container-fluid","nitro-card-header"];return g.length&&j.push(...g),j},[g]),I=j=>{j.stopPropagation(),j.nativeEvent.stopImmediatePropagation()};return e.jsx(v,{center:!0,position:"relative",classNames:x,...p,children:e.jsxs(w,{fullWidth:!0,center:!0,className:"nitro-card-header-holder",children:[e.jsx("span",{className:"nitro-card-header-text",children:t}),s&&e.jsx(A,{position:"absolute",className:"end-4 nitro-card-header-report-camera",onClick:l,children:e.jsx(Qh,{className:"fa-icon"})}),r&&e.jsx(A,{position:"absolute",className:"end-6 nitro-card-header-info-habbopages",onClick:c}),e.jsx(w,{center:!0,position:"absolute",className:"end-2 nitro-card-header-close",onMouseDownCapture:I,onClick:m,children:!i&&e.jsx(Hs,{className:"fa-icon w-12 h-12"})})]})})},Qm=a=>{const{justifyContent:t="center",classNames:s=[],variant:n="muted",...r}=a,i=o.useMemo(()=>{const l=["container-fluid","p-1"];return s.length&&l.push(...s),l.push("bg-"+n),l},[s,n]);return e.jsx(w,{justifyContent:t,classNames:i,...r})};function Ie(){return zr.instance}function ht(a){Ie().addLinkEventTracker(a)}function vt(){return Ie().avatar}function Nu(a){return vt().structureData.getPalette(a)}function vu(a){return vt().structureData.getSetType(a)}function Si(){return Ie().cameraManager}function EC(){return Ie().core}function CC(){return EC().configuration}function Z(a){a=a.startsWith("event:")?a.substring(6):a,Ie().createLinkEvent(a)}function zi(){var a;return(a=Ie())==null?void 0:a.communication}function K(a,t=null){return fc.getValue(a,t)}function Kl(){var a;return(a=zi())==null?void 0:a.connection}function Jm(){return Ie().localization}const Dr=a=>{!a||!a.length||(a.startsWith("http")?ia.openWebPage(a):Z(a))};function gt(a){Ie().removeLinkEventTracker(a)}function H(){return Ie().roomEngine}let Cl=!1,Ta=0,ya=0;const Ra=(a,t=1)=>{const s=a.clientX,n=a.clientY;let r=a.type;switch(r===be.MOUSE_CLICK&&(Ta&&(ya=1,Ta>=Date.now()-300&&ya++),Ta=Date.now(),ya===2&&(Cl||(r=be.DOUBLE_CLICK),ya=0,Ta=null)),r){case be.MOUSE_CLICK:break;case be.DOUBLE_CLICK:break;case be.MOUSE_MOVE:Cl=!0;break;case be.MOUSE_DOWN:Cl=!1;break;case be.MOUSE_UP:break;case be.RIGHT_CLICK:break;default:return}H().dispatchMouseEvent(t,s,n,r,a.altKey,a.ctrlKey||a.metaKey,a.shiftKey,!1)};let Nl=!1,Oa=0,ka=0;const Aa=(a,t=1,s=!1,n=!1,r=!1,i=!1)=>{let l=0,c=0;a.touches[0]?(l=a.touches[0].clientX,c=a.touches[0].clientY):a.changedTouches[0]&&(l=a.changedTouches[0].clientX,c=a.changedTouches[0].clientY);let m=a.type;switch(s&&(m=Mt.TOUCH_LONG),(m===be.MOUSE_CLICK||m===Mt.TOUCH_END)&&(m=be.MOUSE_CLICK,Oa&&(ka=1,Oa>=Date.now()-300&&ka++),Oa=Date.now(),ka===2&&(Nl||(m=be.DOUBLE_CLICK),ka=0,Oa=null)),m){case be.MOUSE_CLICK:break;case be.DOUBLE_CLICK:break;case Mt.TOUCH_START:m=be.MOUSE_DOWN,Nl=!1;break;case Mt.TOUCH_MOVE:m=be.MOUSE_MOVE,Nl=!0;break;case Mt.TOUCH_END:m=be.MOUSE_UP;break;case Mt.TOUCH_LONG:m=be.MOUSE_DOWN_LONG;break;default:return}m===Mt.TOUCH_START&&H().dispatchMouseEvent(t,l,c,m,n,r,i,!1),H().dispatchMouseEvent(t,l,c,m,n,r,i,!1)};function $t(a){if(!a||!a.model)return!1;const t=B().userId,s=a.model.getValue(te.FURNITURE_OWNER_ID);return t===s}function Yi(a,t,s){return a?a.isRoomOwner||a.controllerLevel>=$e.GUEST||B().isModerator||$t(H().getRoomObject(a.roomId,t,s)):!1}function Pr(){return Ie().roomSessionManager}function Cr(a,t=null){Pr().createSession(a,t)}function NC(){const a=Lr();return a?a.model.getValue(te.FIGURE_CAN_STAND_UP):ai.POSTURE_STAND}function vl(){const a=Lr();if(!a)return!1;const s=a.model.getValue(te.FIGURE_EFFECT);return!(s===29||s===30||s===185)}function B(){return Ie().sessionDataManager}function Cs(){return K("hc.disabled",!1)?Bt.VIP:B().clubLevel}const Un=class Un{};Un.OKAY=0,Un.MISSING_OFFER=1,Un.FURNI_LIMIT_REACHED=2,Un.NOT_IN_ROOM=3,Un.NOT_ROOM_OWNER=4,Un.GUILD_ROOM=5,Un.VISITORS_IN_ROOM=6;let Mn=Un;class vC{constructor(t,s,n){this._depth=0,this._localization="",this._pageId=-1,this._pageName="",this._iconId=0,this._depth=s,this._parent=n,this._localization=t.localization,this._pageId=t.pageId,this._pageName=t.pageName,this._iconId=t.icon,this._children=[],this._offerIds=t.offerIds,this._isVisible=t.visible,this._isActive=!1,this._isOpen=!1}activate(){this._isActive=!0}deactivate(){this._isActive=!1}open(){this._isOpen=!0}close(){this._isOpen=!1}addChild(t){t&&this._children.push(t)}get depth(){return this._depth}get isBranch(){return this._children.length>0}get isLeaf(){return this._children.length===0}get localization(){return this._localization}get pageId(){return this._pageId}get pageName(){return this._pageName}get iconId(){return this._iconId}get children(){return this._children}get offerIds(){return this._offerIds}get parent(){return this._parent}get isVisible(){return this._isVisible}get isActive(){return this._isActive}get isOpen(){return this._isOpen}}const bo=class bo{constructor(t,s,n,r,i,l=-1){this._pageId=t,this._layoutCode=s,this._localization=n,this._offers=r,this._acceptSeasonCurrencyAsCredits=i;for(const c of r)c.page=this;l===-1?this._mode=bo.MODE_NORMAL:this._mode=l}get pageId(){return this._pageId}get layoutCode(){return this._layoutCode}get localization(){return this._localization}get offers(){return this._offers}get acceptSeasonCurrencyAsCredits(){return this._acceptSeasonCurrencyAsCredits}get mode(){return this._mode}};bo.MODE_NORMAL=0;let ao=bo;const ct=class ct{};ct.DUCKET_INFO="ducket_info",ct.CREDITS="credits",ct.AVATAR_EFFECTS="avatar_effects",ct.HC_MEMBERSHIP="hc_membership",ct.CLUB_GIFTS="club_gifts",ct.LIMITED_SOLD="limited_sold",ct.PET_ACCESSORIES="pet_accessories",ct.TRAX_SONGS="trax_songs",ct.NEW_ADDITIONS="new_additions",ct.QUEST_SHELL="quest_shell",ct.QUEST_SNOWFLAKES="quest_snowflakes",ct.VAL_QUESTS="val_quests",ct.GUILD_CUSTOM_FURNI="guild_custom_furni",ct.GIFT_SHOP="gift_shop",ct.HORSE_STYLES="horse_styles",ct.HORSE_SHOE="horse_shoe",ct.SET_EASTER="set_easter",ct.ECOTRON_TRANSFORM="ecotron_transform",ct.LOYALTY_INFO="loyalty_info",ct.ROOM_BUNDLES="room_bundles",ct.ROOM_BUNDLES_MOBILE="room_bundles_mobile",ct.HABBO_CLUB_DESKTOP="habbo_club_desktop",ct.MOBILE_SUBSCRIPTIONS="mobile_subscriptions";let oo=ct;class _C{constructor(t,s){this.breed=t,this.palettes=s}}const Fn=class Fn{};Fn.NONE=0,Fn.CONFIRM=1,Fn.PURCHASE=2,Fn.NO_CREDITS=3,Fn.NO_POINTS=4,Fn.SOLD_OUT=5,Fn.FAILED=6;let Je=Fn;const Eo=class Eo{};Eo.NORMAL="NORMAL",Eo.BUILDER="BUILDERS_CLUB";let Gs=Eo;const SC=a=>"",wC=a=>"",_u=(a,t)=>{const s=a.get(t),n=[];if(s&&s.length)for(const r of s)r.isVisible&&n.push(r);return n},Zm=(a,t,s,n)=>{if(s.isVisible&&s.pageId>0){let r=!1;const i=[s.pageName,s.localization].join(" ").toLowerCase().replace(/ /gi,"");if(i.indexOf(a)>-1&&(n.push(s),r=!0),!r){for(const l of t)if(i.indexOf(l)>=0){n.push(s);break}}}for(const r of s.children)Zm(a,t,r,n)};function TC(a){if(!a.length)return 0;let t=a.length-1;for(;t>=0&&!isNaN(parseInt(a.charAt(t)));)t--;return t>0?parseInt(a.substring(t+1)):-1}function yC(a,t){switch(a){case 0:return[[16743226],[16750435],[16764339],[16094464],[16498012],[16704690],[15586304],[16115545],[16513201],[8694111],[11585939],[14413767],[6664599],[9553845],[12971486],[8358322],[10002885],[13292268],[10780600],[12623573],[14403561],[12418717],[14327229],[15517403],[14515069],[15764368],[16366271],[11250603],[13948116],[16777215],[14256481],[14656129],[15848130],[14005087],[14337152],[15918540],[15118118],[15531929],[9764857],[11258085]];case 1:return[[16743226],[16750435],[16764339],[16094464],[16498012],[16704690],[15586304],[16115545],[16513201],[8694111],[11585939],[14413767],[6664599],[9553845],[12971486],[8358322],[10002885],[13292268],[10780600],[12623573],[14403561],[12418717],[14327229],[15517403],[14515069],[15764368],[16366271],[11250603],[13948116],[16777215],[14256481],[14656129],[15848130],[14005087],[14337152],[15918540],[15118118],[15531929],[9764857],[11258085]];case 2:return[[16579283],[15378351],[8830016],[15257125],[9340985],[8949607],[6198292],[8703620],[9889626],[8972045],[12161285],[13162269],[8620113],[12616503],[8628101],[13827840],[9764857]];case 3:return[[16777215],[15658734],[14540253]];case 4:return[[16777215],[16053490],[15464440],[16248792],[15396319],[15007487]];case 5:return[[16777215],[15658734],[14540253]];case 6:return[[16777215],[15658734],[14540253],[16767177],[16770205],[16751331]];case 7:return[[13421772],[11447982],[16751331],[10149119],[16763290],[16743786]];default:{const s=[];for(const n of t){const r=H().getPetColorResult(a,n.paletteId);r&&(r.primaryColor===r.secondaryColor?s.push([r.primaryColor]):s.push([r.primaryColor,r.secondaryColor]))}return s}}}const cn=class cn{};cn.WALL="i",cn.FLOOR="s",cn.EFFECT="e",cn.HABBO_CLUB="h",cn.BADGE="b",cn.GAME_TOKEN="GAME_TOKEN",cn.PET="p",cn.ROBOT="r";let fe=cn;const Co=class Co{constructor(t,s,n,r,i,l,c=!1,m=0,h=0){this._productType=t.toLowerCase(),this._productClassId=s,this._extraParam=n,this._productCount=r,this._productData=i,this._furnitureData=l,this._isUniqueLimitedItem=c,this._uniqueLimitedItemSeriesSize=m,this._uniqueLimitedItemsLeft=h}static stripAddonProducts(t){return t.length===1?t:t.filter(s=>s.productType!==fe.BADGE&&s.productType!==fe.EFFECT&&s.productClassId!==Co.EFFECT_CLASSID_NINJA_DISAPPEAR)}getIconUrl(t=null,s=null){switch(this._productType){case fe.FLOOR:return H().getFurnitureFloorIconUrl(this.productClassId);case fe.WALL:{if(t&&this._furnitureData){let n="";switch(this._furnitureData.className){case"floor":n=["th",this._furnitureData.className,t.product.extraParam].join("_");break;case"wallpaper":n=["th","wall",t.product.extraParam].join("_");break;case"landscape":n=["th",this._furnitureData.className,(t.product.extraParam||"").replace(".","_"),"001"].join("_");break}if(n!=="")return`${K("catalog.asset.url")}/${n}.png`}return H().getFurnitureWallIconUrl(this.productClassId,this._extraParam)}case fe.EFFECT:return SC(this.productClassId);case fe.HABBO_CLUB:return wC(this.productClassId);case fe.BADGE:return B().getBadgeUrl(this._extraParam);case fe.ROBOT:return null}return null}get productType(){return this._productType}get productClassId(){return this._productClassId}get extraParam(){return this._extraParam}set extraParam(t){this._extraParam=t}get productCount(){return this._productCount}get productData(){return this._productData}get furnitureData(){return this._furnitureData}get isUniqueLimitedItem(){return this._isUniqueLimitedItem}get uniqueLimitedItemSeriesSize(){return this._uniqueLimitedItemSeriesSize}get uniqueLimitedItemsLeft(){return this._uniqueLimitedItemsLeft}set uniqueLimitedItemsLeft(t){this._uniqueLimitedItemsLeft=t}};Co.EFFECT_CLASSID_NINJA_DISAPPEAR=108;let ir=Co;const At=class At{constructor(t,s,n,r,i,l,c,m,h,u){this._clubLevel=0,this._bundlePurchaseAllowed=!1,this._offerId=t,this._localizationId=s,this._isRentOffer=n,this._priceInCredits=r,this._priceInActivityPoints=i,this._activityPointType=l,this._giftable=c,this._clubLevel=m,this._products=h,this._bundlePurchaseAllowed=u,this.setPricingModelForProducts(),this.setPricingType();for(const g of h)if(g.productType===fe.BADGE){this._badgeCode=g.extraParam;break}}activate(){}get clubLevel(){return this._clubLevel}get page(){return this._page}set page(t){this._page=t}get offerId(){return this._offerId}get localizationId(){return this._localizationId}get priceInCredits(){return this._priceInCredits}get priceInActivityPoints(){return this._priceInActivityPoints}get activityPointType(){return this._activityPointType}get giftable(){return this._giftable}get product(){if(!this._products||!this._products.length)return null;if(this._products.length===1)return this._products[0];const t=ir.stripAddonProducts(this._products);return t.length?t[0]:null}get pricingModel(){return this._pricingModel}get priceType(){return this._priceType}get bundlePurchaseAllowed(){return this._bundlePurchaseAllowed}get isRentOffer(){return this._isRentOffer}get badgeCode(){return this._badgeCode}get localizationName(){const t=oi(this._localizationId);return t?t.name:d(this._localizationId)}get localizationDescription(){const t=oi(this._localizationId);return t?t.description:d(this._localizationId)}get isLazy(){return!1}get products(){return this._products}setPricingModelForProducts(){const t=ir.stripAddonProducts(this._products);t.length===1?t[0].productCount===1?this._pricingModel=At.PRICING_MODEL_SINGLE:this._pricingModel=At.PRICING_MODEL_MULTI:t.length>1?this._pricingModel=At.PRICING_MODEL_BUNDLE:this._pricingModel=At.PRICING_MODEL_UNKNOWN}setPricingType(){this._priceInCredits>0&&this._priceInActivityPoints>0?this._priceType=At.PRICE_TYPE_CREDITS_ACTIVITYPOINTS:this._priceInCredits>0?this._priceType=At.PRICE_TYPE_CREDITS:this._priceInActivityPoints>0?this._priceType=At.PRICE_TYPE_ACTIVITYPOINTS:this._priceType=At.PRICE_TYPE_NONE}clone(){const t=[],s=oi(this.localizationId);for(const r of this._products){const i=Xl(r.productClassId,r.productType);t.push(new ir(r.productType,r.productClassId,r.extraParam,r.productCount,s,i))}const n=new At(this.offerId,this.localizationId,this.isRentOffer,this.priceInCredits,this.priceInActivityPoints,this.activityPointType,this.giftable,this.clubLevel,t,this.bundlePurchaseAllowed);return n.page=this.page,n}};At.PRICING_MODEL_UNKNOWN="pricing_model_unknown",At.PRICING_MODEL_SINGLE="pricing_model_single",At.PRICING_MODEL_MULTI="pricing_model_multi",At.PRICING_MODEL_BUNDLE="pricing_model_bundle",At.PRICING_MODEL_FURNITURE="pricing_model_furniture",At.PRICE_TYPE_NONE="price_type_none",At.PRICE_TYPE_CREDITS="price_type_credits",At.PRICE_TYPE_ACTIVITYPOINTS="price_type_activitypoints",At.PRICE_TYPE_CREDITS_ACTIVITYPOINTS="price_type_credits_and_activitypoints";let Gt=At;class RC{constructor(t){this._furniData=t,this._product=new ir(this._furniData.type,this._furniData.id,this._furniData.customParams,1,oi(this._furniData.className),this._furniData)}activate(){D(new Jh(this._furniData.rentOfferId>-1?this._furniData.rentOfferId:this._furniData.purchaseOfferId))}get offerId(){return this.isRentOffer?this._furniData.rentOfferId:this._furniData.purchaseOfferId}get priceInActivityPoints(){return 0}get activityPointType(){return 0}get priceInCredits(){return 0}get page(){return this._page}set page(t){this._page=t}get priceType(){return""}get product(){return this._product}get products(){return[this._product]}get localizationId(){return"roomItem.name."+this._furniData.id}get bundlePurchaseAllowed(){return!1}get isRentOffer(){return this._furniData.rentOfferId>-1}get giftable(){return!1}get pricingModel(){return Gt.PRICING_MODEL_FURNITURE}get clubLevel(){return 0}get badgeCode(){return""}get localizationName(){return this._furniData.name}get localizationDescription(){return this._furniData.description}get isLazy(){return!0}}const OC=(a,t,s=null)=>{let n=null;switch(a.toLocaleLowerCase()){case fe.FLOOR:n=H().getFurnitureFloorIconUrl(t);break;case fe.WALL:n=H().getFurnitureWallIconUrl(t,s);break}return n};class kC{constructor(t){this._isEnabled=!1,this._price=null,this._stuffTypes=null,this._boxTypes=null,this._ribbonTypes=null,this._defaultStuffTypes=null,this._isEnabled=t.isEnabled,this._price=t.price,this._boxTypes=t.boxTypes,this._ribbonTypes=t.ribbonTypes,this._stuffTypes=t.giftWrappers,this._defaultStuffTypes=t.giftFurnis}get isEnabled(){return this._isEnabled}get price(){return this._price}get stuffTypes(){return this._stuffTypes}get boxTypes(){return this._boxTypes}get ribbonTypes(){return this._ribbonTypes}get defaultStuffTypes(){return this._defaultStuffTypes}}const No=class No{constructor(t,s,n,r,i,l,c,m,h=-1){this._timeLeftMinutes=-1,this._offerId=t,this._furniId=s,this._furniType=n,this._extraData=r,this._stuffData=i,this._price=l,this._status=c,this._averagePrice=m,this._offerCount=h}get offerId(){return this._offerId}set offerId(t){this._offerId=t}get furniId(){return this._furniId}get furniType(){return this._furniType}get extraData(){return this._extraData}get stuffData(){return this._stuffData}get price(){return this._price}set price(t){this._price=t}get averagePrice(){return this._averagePrice}get image(){return this._image}set image(t){this._image=t}get imageCallback(){return this._imageCallback}set imageCallback(t){this._imageCallback=t}get status(){return this._status}get timeLeftMinutes(){return this._timeLeftMinutes}set timeLeftMinutes(t){this._timeLeftMinutes=t}get offerCount(){return this._offerCount}set offerCount(t){this._offerCount=t}get isUniqueLimitedItem(){return this.stuffData&&this.stuffData.uniqueSeries>0}};No.TYPE_FLOOR=1,No.TYPE_WALL=2;let $i=No;const Kr=class Kr{};Kr.ONGOING=1,Kr.ONGOING_OWN=1,Kr.SOLD=2,Kr.EXPIRED=3;let Ki=Kr;const Ti=class Ti{};Ti.BY_ACTIVITY=1,Ti.BY_VALUE=2,Ti.ADVANCED=3;let qt=Ti;class eh{constructor(t,s){this._images=t,this._texts=s}getText(t){let s=this._texts[t]||"";return s&&s.length&&(s=s.replace(/\r\n|\r|\n/g,"
")),s}getImage(t){const s=this._images[t]||"";if(!s||!s.length)return null;let n=K("catalog.asset.image.url");return n=n.replace("%name%",s),n}}class AC{constructor(t,s,n,r,i,l,c,m){this.roomId=t,this.objectId=s,this.category=n,this.wallLocation=r,this.x=i,this.y=l,this.direction=c,this.offer=m}get offerId(){return this.offer.offerId}get productClassId(){return this.offer.product.productClassId}get productData(){return this.offer.product.productData}get furniData(){return this.offer.product.furnitureData}get extraParam(){return this.offer.product.extraParam}}const zs=class zs{constructor(){this._requestType=zs.REQUEST_TYPE_NONE}resetRequest(){this._requestType=zs.REQUEST_TYPE_NONE,this._requestById=-1,this._requestedByOfferId=-1,this._requestByName=null}get requestType(){return this._requestType}get requestById(){return this._requestById}set requestById(t){this._requestType=zs.REQUEST_TYPE_ID,this._requestById=t}get requestedByOfferId(){return this._requestedByOfferId}set requestedByOfferId(t){this._requestType=zs.REQUEST_TYPE_OFFER,this._requestedByOfferId=t}get requestByName(){return this._requestByName}set requestByName(t){this._requestType=zs.REQUEST_TYPE_NAME,this._requestByName=t}};zs.REQUEST_TYPE_NONE=0,zs.REQUEST_TYPE_ID=1,zs.REQUEST_TYPE_OFFER=2,zs.REQUEST_TYPE_NAME=3;let pr=zs;class DC{constructor(t,s,n){this.searchValue=t,this.offers=s,this.filteredNodes=n}}function Xl(a,t){let s=null;switch(t.toLowerCase()){case fe.FLOOR:s=B().getFloorItemData(a);break;case fe.WALL:s=B().getWallItemData(a);break}return s}function zo(a,t,s){const n=H().getRoomObject(a,t,s);if(!n)return;const r=n.model.getValue(te.FURNITURE_TYPE_ID);switch(s){case X.FLOOR:return B().getFloorItemData(r);case X.WALL:return B().getWallItemData(r)}return null}function PC(){const a=Lr();return a?a.model.getValue(te.FIGURE_POSTURE):ai.POSTURE_STAND}function oi(a){return a?B().getProductData(a):null}function ye(){return Pr().getSession(-1)}function Ql(){D(new Zh)}function Nr(){return B().clubLevel>=Bt.CLUB}function Da(){return B().clubLevel>=Bt.VIP}function LC(a){const t=H().getRoomObject(ye().roomId,a,X.FLOOR);if(!t||!t.model)return!1;const s=B().userId,n=t.model.getValue(te.FURNITURE_OWNER_ID);return s===n}function MC(){const a=Lr();return a?a.model.getValue(te.FIGURE_EFFECT)===77:!1}function UC(a){Pr().startSession(a)}const _c=()=>{ye()&&(Ql(),Pr().removeSession(-1))};function Lr(){const a=B().userId,t=H().activeRoomId,s=X.UNIT,n=H().getTotalObjectsForManager(t,s);let r=0;for(;r{const r=H().getRoomObjectBoundingRectangle(a,t,s,n);return r?(r.x=Math.round(r.x),r.y=Math.round(r.y),r):null},th=(a,t,s,n=1)=>{const r=H().getRoomObjectScreenLocation(a,t,s,n);return r?(r.x=Math.round(r.x),r.y=Math.round(r.y),r):null},FC=(a,t,s=1)=>{const n=H(),r=n.activeRoomId;n.initializeRoomInstanceRenderingCanvas(r,s,a,t)};function VC(a){let t=!1;const s=H().getRoomObject(a.roomId,a.objectId,a.category);return s&&s.model.getValue(te.FURNITURE_SELECTION_DISABLED)===1&&(t=!0,B().isModerator&&(t=!1)),t}function vr(a,t,s){H().processRoomObjectOperation(a,t,s)}function Su(a){H().setActiveRoomId(a)}const D=a=>Kl().send(a);class bs{static getAchievementBadgeCode(t){if(!t)return null;let s=t.badgeId;return t.finalLevel||(s=Jm().getPreviousLevelBadgeId(s)),s}static getAchievementCategoryImageUrl(t,s=null,n=!1){const r=K("achievements.images.url");let i=n?"achicon_":"achcategory_";return i+=t.code,s!==null&&(i+=`_${s>0?"active":"inactive"}`),r.replace("%image%",i)}static getAchievementCategoryMaxProgress(t){if(!t)return 0;let s=0;for(const n of t.achievements)s+=n.levelCount;return s}static getAchievementCategoryProgress(t){if(!t)return 0;let s=0;for(const n of t.achievements)s+=n.finalLevel?n.level:n.level-1;return s}static getAchievementCategoryTotalUnseen(t){if(!t)return 0;let s=0;for(const n of t.achievements)n.unseen>0&&s++;return s}static getAchievementHasStarted(t){return t?!!(t.finalLevel||t.level-1>0):!1}static getAchievementIsIgnored(t){if(!t)return!1;const s=K("achievements.unseen.ignored"),n=t.badgeId.replace(/[0-9]/g,"");return s.indexOf(n)>=0}static getAchievementLevel(t){return t?t.finalLevel?t.level:t.level-1:0}}class wu{constructor(t){this._code=t,this._achievements=[]}getProgress(){return bs.getAchievementCategoryProgress(this)}getMaxProgress(){return bs.getAchievementCategoryMaxProgress(this)}get code(){return this._code}get achievements(){return this._achievements}set achievements(t){this._achievements=t}}const Xr=class Xr{};Xr.ACTION_SAVE="AEA_ACTION_SAVE",Xr.ACTION_CLEAR="AEA_ACTION_CLEAR",Xr.ACTION_RESET="AEA_ACTION_RESET",Xr.ACTION_RANDOMIZE="AEA_ACTION_RANDOMIZE";let ln=Xr;class GC{constructor(t,s=!1){this._partColor=t,this._isDisabled=s,this._isHC=this._partColor.clubLevel>0,this._isSelected=!1}dispose(){this._partColor=null}get partColor(){return this._partColor}get color(){return Is.int2rgb(this._partColor.rgb)}get isDisabled(){return this._isDisabled}get isHC(){return this._isHC}get isSelected(){return this._isSelected}set isSelected(t){this._isSelected=t,this.notify&&this.notify()}get notify(){return this._notifier}set notify(t){this._notifier=t}}class wc{constructor(t,s,n){this._selectedPartIndex=-1,this._name=t,this._parts=s,this._palettes=n,this._selectedPartIndex=-1}static defaultColorId(t,s){if(!t||!t.length)return-1;let n=0;for(;ns)r=t[s];else{const l=n[0];l&&l.partColor&&(r=l.partColor.id)}let i=0;for(;i=0&&this._parts.length>this._selectedPartIndex){const s=this._parts[this._selectedPartIndex];s&&(s.isSelected=!1)}if(this._parts.length>t){const s=this._parts[t];if(s)return s.isSelected=!0,this._selectedPartIndex=t,s}return null}selectColorIndex(t,s){const n=this.getPalette(s);if(!n||n.length<=t)return null;this.deselectColorIndex(this._paletteIndexes[s],s),this._paletteIndexes[s]=t;const r=n[t];return r?(r.isSelected=!0,this.updatePartColors(),r):null}getCurrentColorIndex(t){return this._paletteIndexes[t]}deselectColorIndex(t,s){const n=this.getPalette(s);if(!n||n.length<=t)return;const r=n[t];r&&(r.isSelected=!1)}getSelectedColorIds(){if(!this._paletteIndexes||!this._paletteIndexes.length||!this._palettes||!this._palettes.length)return null;const t=this._palettes[0];if(!t||!t.length)return null;const s=t[0];if(!s||!s.partColor)return null;const n=s.partColor.id,r=[];let i=0;for(;ithis._paletteIndexes[i]){const m=c[this._paletteIndexes[i]];m&&m.partColor?r.push(m.partColor.id):r.push(n)}else r.push(n);i++}const l=this.getCurrentPart();return l?r.slice(0,Math.max(l.maxColorIndex,1)):null}getSelectedColors(){const t=[];let s=0;for(;st&&(s=!0),i++}}const r=this.getCurrentPart();if(r&&r.partSet){const i=r.partSet;i&&i.clubLevel>t&&(s=!0)}return s}hasInvalidSelectedItems(t){const s=this.getCurrentPart();if(!s)return!1;const n=s.partSet;if(!(!n||!n.isSellable))return t.indexOf(n.id)>-1}stripClubItemsOverLevel(t){const s=this.getCurrentPart();if(s&&s.partSet&&s.partSet.clubLevel>t){const r=this.selectPartIndex(0);return r&&!r.partSet&&this.selectPartIndex(1),!0}return!1}stripClubColorsOverLevel(t){const s=[],n=this.getSelectedColors(),r=this.getPalette(0);let i=!1;const l=wc.defaultColorId(r,t);if(l===-1)return!1;let c=0;for(;ct?(s.push(l),i=!0):s.push(m.id):(s.push(l),i=!0),c++}return i&&this.selectColorIds(s),i}get name(){return this._name}get parts(){return this._parts}get selectedPartIndex(){return this._selectedPartIndex}}const Qr=class Qr{static getGender(t){switch(t){case Ne.MALE:case"m":case"M":t=Ne.MALE;break;case Ne.FEMALE:case"f":case"F":t=Ne.FEMALE;break;default:t=Ne.MALE}return t}static hasFigureSetId(t){return this.FIGURE_SET_IDS.indexOf(t)>=0}static createCategory(t,s){if(!t||!s||!this.CURRENT_FIGURE)return null;const n=[],r=[];let i=0;for(;i=E.clubLevel)){let C=0;for(;C=0;){const E=I.getWithIndex(i);let C=!1;if((E.gender===Ne.UNISEX||E.gender===this.CURRENT_FIGURE.gender)&&(C=!0),E.isSelectable&&C&&(u||g>=E.clubLevel)){const b=gr?-1:ns.partSet.id?-1:t.partSet.idr?1:t.partColor.indexs.partColor.index?1:0}static noobSorter(t,s){const n=t.partSet?t.partSet.clubLevel:-1,r=s.partSet?s.partSet.clubLevel:-1,i=t.partSet?t.partSet.isSellable:!1,l=s.partSet?s.partSet.isSellable:!1;return i&&!l?1:l&&!i||nr?1:t.partSet.ids.partSet.id?1:0}static avatarSetFirstSelectableColor(t){const s=vu(t);if(!s)return-1;const n=Nu(s.paletteID);if(!n)return-1;for(const r of n.colors.getValues())if(!(!r.isSelectable||Cs()=0?this._data.set(t,s):this._data.delete(t);break}n&&this.updateView()}savePartSetColourId(t,s,n=!0){switch(t){case ce.FACE:case ce.HAIR:case ce.HAT:case ce.HEAD_ACCESSORIES:case ce.EYE_ACCESSORIES:case ce.FACE_ACCESSORIES:case ce.SHIRT:case ce.JACKET:case ce.CHEST_ACCESSORIES:case ce.CHEST_PRINTS:case ce.TROUSERS:case ce.SHOES:case ce.TROUSER_ACCESSORIES:this._colors.set(t,s);break}n&&this.updateView()}getFigureStringWithFace(t,s=!0){let n="";const r=[ce.FACE],i=[];for(const c of r){const m=this._colors.get(c);if(!m)continue;let h=this._data.get(c);c===ce.FACE&&s&&(h=t);let u=c+"-"+h;if(h>=0){let g=0;for(;g0){const g=this._partColors[n.colorLayerIndex-1];g&&(h=g)}const u=new Za(r.texture);u.position.set(c,m),h&&(u.tint=h.rgb),s.addChild(u)}return s}updateThumbVisualization(){if(!this._isInitalized)return;let t=this._thumbContainer;t||(t=this.renderThumb()),t&&(this._partSet?(this._isHC=this._partSet.clubLevel>0,this._isSellable=this._partSet.isSellable):(this._isHC=!1,this._isSellable=!1),this._isDisabled&&this.setAlpha(t,.2),this._imageUrl=Cn.generateImageUrl(t),this.notify&&this.notify())}setAlpha(t,s){return t.filters=[un.ALPHA_FILTER],t}sortByDrawOrder(t,s){const n=un.DRAW_ORDER.indexOf(t.type),r=un.DRAW_ORDER.indexOf(s.type);return nr?1:t.indexs.index?1:0}resetFigure(t){this.analyzeFigure()&&this.update()}get disposed(){return this._disposed}get id(){return this._partSet?this._partSet.id:-1}get partSet(){return this._partSet}set partColors(t){this._partColors=t,this.update()}get isDisabled(){return this._isDisabled}set thumbContainer(t){this._thumbContainer=t,this.update()}get imageUrl(){return this._imageUrl}get maxColorIndex(){return this._maxColorIndex}get isHC(){return this._isHC}get isSellable(){return this._isSellable}get isClear(){return this._isClear}set isClear(t){this._isClear=t}get isSelected(){return this._isSelected}set isSelected(t){this._isSelected=t,this.notify&&this.notify()}get notify(){return this._notifier}set notify(t){this._notifier=t}};un.ALPHA_FILTER=new eg(.2),un.THUMB_DIRECTIONS=[2,6,0,4,3,1],un.DRAW_ORDER=[Ve.LEFT_HAND_ITEM,Ve.LEFT_HAND,Ve.LEFT_SLEEVE,Ve.LEFT_COAT_SLEEVE,Ve.BODY,Ve.SHOES,Ve.LEGS,Ve.CHEST,Ve.CHEST_ACCESSORY,Ve.COAT_CHEST,Ve.CHEST_PRINT,Ve.WAIST_ACCESSORY,Ve.RIGHT_HAND,Ve.RIGHT_SLEEVE,Ve.RIGHT_COAT_SLEEVE,Ve.HEAD,Ve.FACE,Ve.EYES,Ve.HAIR,Ve.HAIR_BIG,Ve.FACE_ACCESSORY,Ve.EYE_ACCESSORY,Ve.HEAD_ACCESSORY,Ve.HEAD_ACCESSORY_EXTRA,Ve.RIGHT_HAND_ITEM];let lo=un;class Yo{constructor(){this._isInitalized=!1,this._maxPaletteCount=0}dispose(){this._categories=null,this._disposed=!0}get disposed(){return this._disposed}init(){this._categories||(this._categories=new Map)}reset(){if(this._isInitalized=!1,this._categories)for(const t of this._categories.values())t&&t.dispose();this._categories=new Map}addCategory(t){let s=this._categories.get(t);s||(s=wt.createCategory(this,t),s&&(this._categories.set(t,s),this.updateSelectionsFromFigure(t)))}updateSelectionsFromFigure(t){const s=this._categories.get(t);if(!s)return;const n=wt.CURRENT_FIGURE.getPartSetId(t);let r=wt.CURRENT_FIGURE.getColorIds(t);r||(r=[]),s.selectPartId(n),s.selectColorIds(r)}hasClubSelectionsOverLevel(t){if(!this._categories)return!1;for(const s of this._categories.values())if(s&&s.hasClubSelectionsOverLevel(t))return!0;return!1}hasInvalidSelectedItems(t){if(!this._categories)return!1;for(const s of this._categories.values())if(s.hasInvalidSelectedItems(t))return!0;return!1}stripClubItemsOverLevel(t){if(!this._categories)return!1;let s=!1;for(const[n,r]of this._categories.entries()){let i=!1;if(r.stripClubItemsOverLevel(t)&&(i=!0),r.stripClubColorsOverLevel(t)&&(i=!0),i){const l=r.getCurrentPart();l&&wt.CURRENT_FIGURE&&wt.CURRENT_FIGURE.savePartData(n,l.id,r.getSelectedColorIds(),!0),s=!0}}return s}stripInvalidSellableItems(){if(!this._categories)return!1;let t=!1;for(const[s,n]of this._categories.entries());return t}selectPart(t,s){const n=this._categories.get(t);if(!n)return;const r=n.selectedPartIndex;n.selectPartIndex(s);const i=n.getCurrentPart();if(i){if(i.isDisabled){n.selectPartIndex(r);return}this._maxPaletteCount=i.maxColorIndex,wt.CURRENT_FIGURE.savePartData(t,i.id,n.getSelectedColorIds(),!0)}}selectColor(t,s,n){const r=this._categories.get(t);if(!r)return;const i=r.getCurrentColorIndex(n);if(r.selectColorIndex(s,n),r.getSelectedColor(n).isDisabled){r.selectColorIndex(i,n);return}wt.CURRENT_FIGURE.savePartSetColourId(t,r.getSelectedColorIds(),!0)}getCategoryData(t){return this._isInitalized||this.init(),this._categories?this._categories.get(t):null}get categories(){return this._categories}get canSetGender(){return!1}get maxPaletteCount(){return this._maxPaletteCount||1}set maxPaletteCount(t){this._maxPaletteCount=t}get name(){return null}}class BC extends Yo{constructor(){super(...arguments),this._imageCallBackHandled=!1}init(){super.init(),this.addCategory(Ne.FACE),this._isInitalized=!0}selectColor(t,s,n){super.selectColor(t,s,n),this.updateSelectionsFromFigure(Ne.FACE)}updateSelectionsFromFigure(t){if(!this._categories||!wt.CURRENT_FIGURE)return;const s=this._categories.get(t);if(!s)return;const n=wt.CURRENT_FIGURE.getPartSetId(t);let r=wt.CURRENT_FIGURE.getColorIds(t);r||(r=[]),s.selectPartId(n),s.selectColorIds(r);for(const i of s.parts){const l=c=>{const m=wt.CURRENT_FIGURE.getFigureStringWithFace(i.id),h=vt().createAvatarImage(m,pc.LARGE,null,{resetFigure:l,dispose:null,disposed:!1}),u=h.getImageAsSprite(eo.HEAD);u&&(u.y=10,i.thumbContainer=u,setTimeout(()=>h.dispose(),0))};l()}}get canSetGender(){return!0}get name(){return Us.GENERIC}}const Es=a=>{if(a==null||typeof a!="object")return a;const t=new a.constructor;for(const s in a)a.hasOwnProperty(s)&&(t[s]=a[s]);return t};class ms{static makeColorHex(t){return"#"+t}static makeColorNumberHex(t){return"#"+t.toString(16).padStart(6,"0")}static convertFromHex(t){return parseInt(t.replace("#",""),16)}static uintHexColor(t){const s=t>>>0;return ms.makeColorHex(s.toString(16).substring(2))}static int_to_8BitVals(t){const s=t>>24&255,n=t>>16&255,r=t>>8&255,i=t&255;return[s,n,r,i]}static eight_bitVals_to_int(t,s,n,r){return(t<<24)+(s<<16)+(n<<8)+(r|0)}static int2rgb(t){t>>>=0;const s=t&255,n=(t&65280)>>>8;return"rgba("+[(t&16711680)>>>16,n,s,1].join(",")+")"}}const gr=a=>{let t=Math.floor(a/86400),s=Math.floor(a%86400/3600),n=Math.floor(a%86400%3600/60),r=a%86400%3600%60;return t.toString().padStart(2,"0")+":"+s.toString().padStart(2,"0")+":"+n.toString().padStart(2,"0")+":"+r.toString().padStart(2,"0")},$o=a=>{try{JSON.parse(window.localStorage.getItem(a))}catch{return null}},Tc=a=>{let t=Ie().localization.getBadgeDesc(a);return(!t||!t.length)&&(t=`badge_desc_${a}`),t},fi=a=>{let t=Ie().localization.getBadgeName(a);return(!t||!t.length)&&(t=`badge_name_${a}`),t};function Xi(a){return!a||isNaN(a)?"0":a.toString().replace(/\B(?=(\d{3})+(?!\d))/g," ")}function HC(a){if(!a||isNaN(a))return"0";let t=Math.abs(a);const s=Math.pow(10,1),n=a<0;let r="";const i=[{key:"Q",value:Math.pow(10,15)},{key:"T",value:Math.pow(10,12)},{key:"B",value:Math.pow(10,9)},{key:"M",value:Math.pow(10,6)},{key:"K",value:1e3}];for(const l of i){let c=t/l.value;if(c=Math.round(c*s)/s,c>=1){t=c,r=l.key;break}}return(n?"-":"")+t+r}function d(a,t=null,s=null){return Ie().getLocalizationWithParameters(a,t,s)}const vo=class vo{};vo.CATALOG_PLACE_MULTIPLE_OBJECTS="catalogPlaceMultipleObjects",vo.CATALOG_SKIP_PURCHASE_CONFIRMATION="catalogSkipPurchaseConfirmation";let Qi=vo;const sh=(a,t)=>a.dispatchEvent(t),Jl=a=>sh(Ie().events,a),Nn=new sg,Ct=a=>sh(Nn,a);let nh=!1;const vn=a=>{nh&&Jl(new tu(tu.PLAY_SOUND,a))},Tu=[be.MOUSE_CLICK],WC=()=>{const a=()=>Tu.forEach(s=>window.removeEventListener(s,t)),t=s=>(nh=!0)&&a();Tu.forEach(s=>window.addEventListener(s,t))};WC();const ut=class ut{};ut.DEFAULT=1,ut.WALL_PAPER=2,ut.FLOOR=3,ut.LANDSCAPE=4,ut.POST_IT=5,ut.POSTER=6,ut.SOUND_SET=7,ut.TRAX_SONG=8,ut.PRESENT=9,ut.ECOTRON_BOX=10,ut.TROPHY=11,ut.CREDIT_FURNI=12,ut.PET_SHAMPOO=13,ut.PET_CUSTOM_PART=14,ut.PET_CUSTOM_PART_SHAMPOO=15,ut.PET_SADDLE=16,ut.GUILD_FURNI=17,ut.GAME_FURNI=18,ut.MONSTERPLANT_SEED=19,ut.MONSTERPLANT_REVIVAL=20,ut.MONSTERPLANT_REBREED=21,ut.MONSTERPLANT_FERTILIZE=22,ut.FIGURE_PURCHASABLE_SET=23;let de=ut;class Ji{constructor(t){t&&(this._locked=!1,this._id=t.itemId,this._type=t.spriteId,this._ref=t.ref,this._category=t.category,this._groupable=t.isGroupable&&!t.rentable,this._tradeable=t.tradable,this._recyclable=t.isRecycleable,this._sellable=t.sellable,this._stuffData=t.stuffData,this._extra=t.extra,this._secondsToExpiration=t.secondsToExpiration,this._expirationTimeStamp=t.expirationTimeStamp,this._hasRentPeriodStarted=t.hasRentPeriodStarted,this._creationDay=t.creationDay,this._creationMonth=t.creationMonth,this._creationYear=t.creationYear,this._slotId=t.slotId,this._songId=t.songId,this._flatId=t.flatId,this._isRented=t.rentable,this._isWallItem=t.isWallItem)}get rentable(){return this._isRented}get id(){return this._id}get ref(){return this._ref}get category(){return this._category}get type(){return this._type}get stuffData(){return this._stuffData}set stuffData(t){this._stuffData=t}get extra(){return this._extra}get recyclable(){return this._recyclable}get isTradable(){return this._tradeable}get isGroupable(){return this._groupable}get sellable(){return this._sellable}get secondsToExpiration(){if(this._secondsToExpiration===-1)return-1;let t=-1;return this._hasRentPeriodStarted?(t=this._secondsToExpiration-(Ms()-this._expirationTimeStamp)/1e3,t<0&&(t=0)):t=this._secondsToExpiration,t}get creationDay(){return this._creationDay}get creationMonth(){return this._creationMonth}get creationYear(){return this._creationYear}get slotId(){return this._slotId}get songId(){return this._songId}get locked(){return this._locked}set locked(t){this._locked=t}get flatId(){return this._flatId}get isWallItem(){return this._isWallItem}get hasRentPeriodStarted(){return this._hasRentPeriodStarted}get expirationTimeStamp(){return this._expirationTimeStamp}update(t){this._type=t.spriteId,this._ref=t.ref,this._category=t.category,this._groupable=t.isGroupable&&!t.rentable,this._tradeable=t.tradable,this._recyclable=t.isRecycleable,this._sellable=t.sellable,this._stuffData=t.stuffData,this._extra=t.extra,this._secondsToExpiration=t.secondsToExpiration,this._expirationTimeStamp=t.expirationTimeStamp,this._hasRentPeriodStarted=t.hasRentPeriodStarted,this._creationDay=t.creationDay,this._creationMonth=t.creationMonth,this._creationYear=t.creationYear,this._slotId=t.slotId,this._songId=t.songId,this._flatId=t.flatId,this._isRented=t.rentable,this._isWallItem=t.isWallItem}clone(){const t=new Ji(null);return t._expirationTimeStamp=this._expirationTimeStamp,t._isWallItem=this._isWallItem,t._songId=this._songId,t._locked=this._locked,t._id=this._id,t._ref=this._ref,t._category=this._category,t._type=this._type,t._stuffData=this._stuffData,t._extra=this._extra,t._recyclable=this._recyclable,t._tradeable=this._tradeable,t._groupable=this._groupable,t._sellable=this._sellable,t._secondsToExpiration=this._secondsToExpiration,t._hasRentPeriodStarted=this._hasRentPeriodStarted,t._creationDay=this._creationDay,t._creationMonth=this._creationMonth,t._creationYear=this._creationYear,t._slotId=this._slotId,t._isRented=this._isRented,t._flatId=this._flatId,t}}class yc{constructor(t=-1,s=-1,n=null,r=null,i=-1){this._type=t,this._category=s,this._roomEngine=n,this._stuffData=r,this._extra=i,this._isWallItem=!1,this._iconUrl=null,this._name=null,this._description=null,this._locked=!1,this._selected=!1,this._hasUnseenItems=!1,this._items=[]}clone(){const t=new yc;return t._type=this._type,t._category=this._category,t._roomEngine=this._roomEngine,t._stuffData=this._stuffData,t._extra=this._extra,t._isWallItem=this._isWallItem,t._iconUrl=this._iconUrl,t._name=this._name,t._description=this._description,t._locked=this._locked,t._selected=this._selected,t._hasUnseenItems=this._hasUnseenItems,t._items=this._items,t}prepareGroup(){this.setIcon(),this.setName(),this.setDescription()}dispose(){}getItemByIndex(t){return this._items[t]}getItemById(t){for(const s of this._items)if(s.id===t)return s;return null}getTradeItems(t){const s=[],n=this.getLastItem();if(!n)return s;let r=0,i=0;for(;i=t);){const l=this.getItemByIndex(i);!l.locked&&l.isTradable&&l.type===n.type&&(s.push(l),r++),i++}return s}push(t){const s=[...this._items];let n=0;for(;n0){const n=t.length-1;s=t[n],t.splice(n,1)}return this._items=t,s}remove(t){const s=[...this._items];let n=0;for(;n=0;if(i.locked!==l){r=!0;const c=i.clone();c.locked=l,s[n]=c}n++}return this._items=s,r}setName(){const t=this.getLastItem();if(!t){this._name="";return}let s="";switch(this._category){case de.POSTER:s="poster_"+t.stuffData.getLegacyString()+"_name";break;case de.TRAX_SONG:this._name="SONG_NAME";return;default:this.isWallItem?s="wallItem.name."+t.type:s="roomItem.name."+t.type}this._name=d(s)}setDescription(){this._description=""}setIcon(){if(this._iconUrl)return;let t=null;this.isWallItem?t=this._roomEngine.getFurnitureWallIconUrl(this._type,this._stuffData.getLegacyString()):t=this._roomEngine.getFurnitureFloorIconUrl(this._type),t&&(this._iconUrl=t)}get type(){return this._type}get category(){return this._category}get stuffData(){return this._stuffData}get extra(){return this._extra}get iconUrl(){return this._iconUrl}get name(){return this._name}get description(){return this._description}get hasUnseenItems(){return this._hasUnseenItems}set hasUnseenItems(t){this._hasUnseenItems=t}get locked(){return this._locked}set locked(t){this._locked=t}get selected(){return this._selected}set selected(t){this._selected=t}get isWallItem(){const t=this.getItemByIndex(0);return t?t.isWallItem:!1}get isGroupable(){const t=this.getItemByIndex(0);return t?t.isGroupable:!1}get isSellable(){const t=this.getItemByIndex(0);return t?t.sellable:!1}get items(){return this._items}set items(t){this._items=t}}const Rc=(a,t,s,n=NaN)=>new yc(a,t,H(),s,n),qC=(a,t,s)=>{const n=[];for(const i of a)i.type===t.type&&n.push(i);for(const i of n)if(i.getItemById(t.id))return i;const r=Rc(t.type,t.category,t.stuffData,t.extra);return r.push(t),s?(r.hasUnseenItems=!0,a.unshift(r)):a.push(r),r},zC=(a,t,s)=>{let n=null;for(const r of a)if(r.type===t.type&&r.isWallItem===t.isWallItem&&r.isGroupable)if(t.category===de.POSTER){if(r.stuffData.getLegacyString()===t.stuffData.getLegacyString()){n=r;break}}else if(t.category===de.GUILD_FURNI){if(t.stuffData.compare(r.stuffData)){n=r;break}}else{n=r;break}if(n){if(n.push(t),s){n.hasUnseenItems=!0;const r=a.indexOf(n);r>=0&&a.splice(r,1),a.unshift(n)}return n}return n=Rc(t.type,t.category,t.stuffData,t.extra),n.push(t),s?(n.hasUnseenItems=!0,a.unshift(n)):a.push(n),n},yu=(a,t,s)=>{t.isGroupable?zC(a,t,s):qC(a,t,s)},YC=(a,t,s,n)=>{if(t===1)return a;n[s]=a;for(const i of n)if(!i)return null;const r=new Map;for(const i of n){for(const[l,c]of i)r.set(l,c);i.clear()}return n=null,r},$C=a=>{const t=[];for(const s of a){let n=s.getTotalCount();s.category===de.POST_IT&&(n=1);let r=0;for(;rrh,la=a=>rh=a,di=()=>ih,Ko=a=>ih=a,Zi=()=>{di()!==-1&&(H().cancelRoomObjectPlacement(),Ko(-1),la(!1))},Zl=(a,t=!1)=>{const s=a.petData;if(!s)return!1;const n=Pr().getSession(1);return!n||!n.isRoomOwner&&!n.allowPets?!1:(Z("inventory/hide"),H().processRoomObjectPlacement(Bi.INVENTORY,-s.id,X.UNIT,dt.PET,s.figureData.figuredata)&&(Ko(s.id),la(!0)),!0)},mi=(a,t=!1)=>{if(!a||!a.getUnlockedCount())return!1;const s=a.getLastItem();if(!s)return!1;if(s.category===de.FLOOR||s.category===de.WALL_PAPER||s.category===de.LANDSCAPE)return t||D(new Xa(s.id)),!1;{Z("inventory/hide");let n=0,r=!1;s.isWallItem?n=X.WALL:n=X.FLOOR,s.category===de.POSTER?r=H().processRoomObjectPlacement(Bi.INVENTORY,s.id,n,s.type,s.stuffData.getLegacyString()):r=H().processRoomObjectPlacement(Bi.INVENTORY,s.id,n,s.type,s.extra.toString(),s.stuffData),r&&(Ko(s.ref),la(!0))}return!0},ec=(a,t=!1)=>{const s=a.botData;if(!s)return!1;const n=Pr().getSession(1);return!n||!n.isRoomOwner?!1:(Z("inventory/hide"),H().processRoomObjectPlacement(Bi.INVENTORY,-s.id,X.UNIT,dt.RENTABLE_BOT,s.figure)&&(Ko(s.id),la(!0)),!0)},Jn=class Jn{};Jn.FURNI=1,Jn.RENTABLE=2,Jn.PET=3,Jn.BADGE=4,Jn.BOT=5,Jn.GAMES=6;let st=Jn;const XC=a=>a.map(t=>t.petData.id),ah=(a,t,s=!0)=>{const n={petData:a};return s?t.unshift(n):t.push(n),n},oh=(a,t)=>{let s=0;for(;s{const n=XC(a),r=[],i=[];for(const l of t.keys())n.indexOf(l)===-1&&r.push(l);for(const l of n)!t.get(l)&&i.push(l);n.length;for(const l of i)oh(l,a);for(const l of r){const c=t.get(l);c&&ah(c,a,s(st.PET,c.id))}return a},JC=(a,t,s,n)=>{if(t===1)return a;n[s]=a;for(const i of n)if(!i)return null;const r=new Map;for(const i of n){for(const[l,c]of i)r.set(l,c);i.clear()}return n=null,r},Vn=class Vn{};Vn.TRADING_STATE_READY=0,Vn.TRADING_STATE_RUNNING=1,Vn.TRADING_STATE_COUNTDOWN=2,Vn.TRADING_STATE_CONFIRMING=3,Vn.TRADING_STATE_CONFIRMED=4,Vn.TRADING_STATE_COMPLETED=5,Vn.TRADING_STATE_CANCELLED=6;let St=Vn;class Ru{constructor(t=-1,s="",n=new Hi,r=0,i=0,l=!1,c=!1){this.userId=t,this.userName=s,this.userItems=n,this.itemCount=r,this.creditsCount=i,this.accepts=l,this.canTrade=c}}const Ys=class Ys{};Ys.ALERT_SCAM=0,Ys.HOTEL_TRADING_DISABLED=1,Ys.YOU_NOT_ALLOWED=2,Ys.THEY_NOT_ALLOWED=4,Ys.ROOM_DISABLED=6,Ys.YOU_OPEN=7,Ys.THEY_OPEN=8,Ys.ERROR_WHILE_COMMIT=9,Ys.THEY_CANCELLED=10;let us=Ys;const Ou=a=>{var t;return((t=B().getWallItemData(a))==null?void 0:t.isExternalImage)||!1},ku=a=>{const t=new Hi;if(a.length)for(const n of a){const r=n.spriteId,i=n.category;let l=n.furniType+r;(!n.isGroupable||Ou(r))&&(l="itemid"+n.itemId),n.category===de.POSTER?l=n.itemId+"poster"+n.stuffData.getLegacyString():n.category===de.GUILD_FURNI&&(l="");let c=n.isGroupable&&!Ou(n.spriteId)?t.getValue(l):null;c||(c=Rc(r,i,n.stuffData),t.add(l,c)),c.push(new Ji(n))}return t},ZC=(a,t)=>{let s=a.toString();if(!(t instanceof aa))return s;let n=1;for(;n<5;)s=s+(","+t.getValue(n)),n++;return s};class Qa{static getProductImageUrl(t,s,n){let r=null;switch(t){case Ei.S:r=H().getFurnitureFloorIconUrl(s);break;case Ei.I:this.getProductCategory(Ei.I,s)===1&&(r=H().getFurnitureWallIconUrl(s,n));break}return r}static getProductCategory(t,s){if(t===Ei.S)return 1;if(t===Ei.I){if(s===3001)return de.WALL_PAPER;if(s===3002)return de.FLOOR;if(s===4057)return de.LANDSCAPE}return 1}}class co{static getRandomNumber(t){return Math.floor(Math.random()*t)}static getRandomElement(t){return t[this.getRandomNumber(t.length)]}static getRandomElements(t,s){const n=new Array(s);let r=t.length;const i=new Array(r);for(;s--;){var l=this.getRandomNumber(r);n[s]=t[l in i?i[l]:l],i[l]=--r in i?i[r]:r}return n}}const $=new Map;$.set("r","red");$.set("b","blue");$.set("g","green");$.set("y","yellow");$.set("w","white");$.set("o","orange");$.set("c","cyan");$.set("br","brown");$.set("pr","purple");$.set("pk","pink");$.set("black","black");$.set("red","red");$.set("orangered","orangered");$.set("orange","orange");$.set("yellow","yellow");$.set("yellowgreen","yellowgreen");$.set("green","green");$.set("seagreen","seagreen");$.set("teal","teal");$.set("blue","blue");$.set("darkblue","darkblue");$.set("indigo","indigo");$.set("purple","purple");$.set("violet","violet");$.set("brown","brown");$.set("burlywood","burlywood");$.set("rosybrown","rosybrown");$.set("saddlebrown","saddlebrown");$.set("maroon","maroon");$.set("firebrick","firebrick");$.set("darkred","darkred");$.set("chocolate","chocolate");$.set("sienna","sienna");$.set("peru","peru");$.set("darkorange","darkorange");$.set("orange","orange");$.set("orangered","orangered");$.set("tomato","tomato");$.set("coral","coral");$.set("darkolivegreen","darkolivegreen");$.set("olive","olive");$.set("olivedrab","olivedrab");$.set("greenyellow","greenyellow");$.set("yellowgreen","yellowgreen");$.set("darkgreen","darkgreen");$.set("limegreen","limegreen");$.set("lime","lime");$.set("lawngreen","lawngreen");$.set("palegreen","palegreen");$.set("springgreen","springgreen");$.set("mediumseagreen","mediumseagreen");$.set("mediumaquamarine","mediumaquamarine");$.set("aquamarine","aquamarine");$.set("turquoise","turquoise");$.set("mediumturquoise","mediumturquoise");$.set("darkturquoise","darkturquoise");$.set("aqua","aqua");$.set("cyan","cyan");$.set("lightcyan","lightcyan");$.set("paleturquoise","paleturquoise");$.set("azure","azure");$.set("lightblue","lightblue");$.set("powderblue","powderblue");$.set("deepskyblue","deepskyblue");$.set("skyblue","skyblue");$.set("lightskyblue","lightskyblue");$.set("steelblue","steelblue");$.set("royalblue","royalblue");$.set("mediumslateblue","mediumslateblue");$.set("slateblue","slateblue");$.set("darkslateblue","darkslateblue");$.set("mediumpurple","mediumpurple");$.set("blueviolet","blueviolet");$.set("darkviolet","darkviolet");$.set("darkmagenta","darkmagenta");$.set("mediumvioletred","mediumvioletred");$.set("violetred","violetred");$.set("orchid","orchid");$.set("darkorchid","darkorchid");$.set("mediumorchid","mediumorchid");$.set("thistle","thistle");$.set("plum","plum");$.set("purple","purple");$.set("darkgrey","darkgrey");$.set("dimgray","dimgray");$.set("lightgrey","lightgrey");$.set("grey","grey");$.set("slategrey","slategrey");$.set("lightslategrey","lightslategrey");$.set("whitesmoke","whitesmoke");$.set("white","white");$.set("snow","snow");$.set("mistyrose","mistyrose");$.set("seashell","seashell");$.set("antiquewhite","antiquewhite");$.set("linen","linen");$.set("oldlace","oldlace");$.set("papayawhip","papayawhip");$.set("blanchedalmond","blanchedalmond");$.set("moccasin","moccasin");$.set("wheat","wheat");$.set("navajowhite","navajowhite");$.set("burlywood","burlywood");$.set("tan","tan");$.set("rosybrown","rosybrown");$.set("sandybrown","sandybrown");$.set("goldenrod","goldenrod");$.set("darkgoldenrod","darkgoldenrod");$.set("peru","peru");$.set("chocolate","chocolate");$.set("saddlebrown","saddlebrown");$.set("sienna","sienna");$.set("brown","brown");const eN=a=>a.replace(/([\u00A0-\u9999<>&])(.|$)/g,(t,s,n)=>s!=="&"||n!=="#"?(/[\u00A0-\u9999<>&]/.test(n)&&(n=""+n.charCodeAt(0)+";"),""+s.charCodeAt(0)+";"+n):t),tN=a=>{let t="";a=eN(a),a=a.replace(/\[tag\](.*?)\[\/tag\]/g,'$1'),K("youtube.publish.disabled",!1)||(a=a.replace(/(?:http:\/\/|https:\/\/)?(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?.*v=|shorts\/)?([a-zA-Z0-9_-]{11})/g,`
Click on open video to see the YouTube video
Open Video
`));const s=a.match(/@[a-zA-Z]+@/);if(s){const n=s[0].toString(),r=n.substr(1,n.length-2),i=a.replace(n,"");$.has(r)?t=`${i}`:t=i}else t=a;return t},Oc=(a,t)=>window.localStorage.setItem(a,JSON.stringify(t)),Zn=class Zn{};Zn.CAMERA_SHUTTER="camera_shutter",Zn.CREDITS="credits",Zn.DUCKETS="duckets",Zn.MESSENGER_NEW_THREAD="messenger_new_thread",Zn.MESSENGER_MESSAGE_RECEIVED="messenger_message_received",Zn.MODTOOLS_NEW_TICKET="modtools_new_ticket";let _n=Zn;function sN(a){const t=a.parts;let s=0;for(const n of t)s=Math.max(s,n.colorLayerIndex);return s}function nN(a,t){return t=t.filter(s=>a.indexOf(s)===-1),[...a,...co.getRandomElements(t,co.getRandomNumber(t.length)+1)]}function rN(a,t,s=0,n=[]){if(!a)return null;const r=a.partSets.getValues().filter(i=>!i.isSelectable||i.gender!=="U"&&i.gender!==t||i.clubLevel>s||i.isSellable&&n.indexOf(i.id)===-1?null:i);return!r||!r.length?null:co.getRandomElement(r)}function iN(a,t,s=0){if(!a)return[];const n=a.colors.getValues().filter(r=>!r.isSelectable||r.clubLevel>s?null:r);return!n||!n.length?null:co.getRandomElements(n,sN(t))}function aN(a,t,s=0,n=[],r=[]){const i=vt().structure,l=new ng(""),c=nN(i.getMandatorySetTypeIds(t,s),Ne.SET_TYPES);for(const m of r){const h=a.getPartSetId(m),u=a.getColorIds(m);l.updatePart(m,h,u)}for(const m of c){if(l.hasPartType(m))continue;const h=i.figureData.getSetType(m),u=rN(h,t,s,n);if(!u)continue;let g=[];u.isColorable&&(g=iN(i.figureData.getPalette(h.paletteID),u,s).map(f=>f.id)),l.updatePart(h.type,u.id,g)}return l.getFigureString()}class oN extends Yo{init(){super.init(),this.addCategory(Ne.HAIR),this.addCategory(Ne.HAT),this.addCategory(Ne.HEAD_ACCESSORIES),this.addCategory(Ne.EYE_ACCESSORIES),this.addCategory(Ne.FACE_ACCESSORIES),this._isInitalized=!0}get name(){return Us.HEAD}}class Au extends Yo{init(){super.init(),this.addCategory(Ne.TROUSERS),this.addCategory(Ne.SHOES),this.addCategory(Ne.TROUSER_ACCESSORIES),this._isInitalized=!0}get name(){return Us.LEGS}}class Du extends Yo{init(){super.init(),this.addCategory(Ne.SHIRT),this.addCategory(Ne.CHEST_PRINTS),this.addCategory(Ne.JACKET),this.addCategory(Ne.CHEST_ACCESSORIES),this._isInitalized=!0}get name(){return Us.TORSO}}const _o=class _o{};_o.COLORMATRIX="colormatrix",_o.COMPOSITE="composite";let ea=_o;class lN{constructor(t,s){this.texture=t,this.imageUrl=s}}class cN{constructor(t,s){this.effectName=t,this.thumbnailUrl=s}}class uN{constructor(t,s,n){this._productName=t,this._customImage=s,this._furnitureClassName=n}get productName(){return this._productName}get customImage(){return this._customImage}get furnitureClassName(){return this._furnitureClassName}}const Jr=class Jr{};Jr.STATE_UNLOCKED=1,Jr.STATE_LOCKED_AVAILABLE=2,Jr.STATE_LOCKED_EXPIRED=3,Jr.STATE_LOCKED_FUTURE=4;let ns=Jr;const yi=class yi{};yi.TYPE_CHAT=1,yi.TYPE_ROOM_INFO=2,yi.TYPE_IM=3;let en=yi;const lh=()=>{const a=new Date;return`${a.getHours().toString().padStart(2,"0")}:${a.getMinutes().toString().padStart(2,"0")}`},Pu=(a=0)=>{const t=a?new Date(Date.now()-a*1e3):new Date;return`${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}`},ch=a=>{if(!a||!a.length)return null;const t=a.split("/"),s=t[0],n=t[1],r=parseInt(t[2]);return{username:s,figure:n,userId:r}},Zr=class Zr{constructor(){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}populate(t){this.id=t.id,this.name=t.name,this.gender=t.gender,this.online=t.online,this.followingAllowed=t.followingAllowed,this.figure=t.figure,this.categoryId=t.categoryId,this.motto=t.motto,this.realName=t.realName,this.lastAccess=t.lastAccess,this.persistedMessageUser=t.persistedMessageUser,this.vipMember=t.vipMember,this.pocketHabboUser=t.pocketHabboUser,this.relationshipStatus=t.relationshipStatus}};Zr.RELATIONSHIP_NONE=0,Zr.RELATIONSHIP_HEART=1,Zr.RELATIONSHIP_SMILE=2,Zr.RELATIONSHIP_BOBBA=3;let ds=Zr;const So=class So{};So.GROUP_CHAT=0,So.PRIVATE_CHAT=1;let Sr=So;const Ri=class Ri{};Ri.HIDDEN=0,Ri.SHOW=1,Ri.UNREAD=2;let jn=Ri;class Lu{populate(t){return t?(this._id=t.requestId,this._name=t.requesterName,this._figureString=t.figureString,this._requesterUserId=t.requesterUserId,!0):!1}get id(){return this._id}get name(){return this._name}get requesterUserId(){return this._requesterUserId}get figureString(){return this._figureString}}class dN{constructor(t=0,s=0,n=0,r=[]){this.userFriendLimit=t,this.normalFriendLimit=s,this.extendedFriendLimit=n,this.categories=r}}const ei=class ei{constructor(t,s,n=0,r=null,i=0){this._type=i,this._senderId=t,this._message=s,this._secondsSinceSent=n,this._extraData=r,this._date=new Date}get type(){return this._type}get senderId(){return this._senderId}get message(){return this._message}get secondsSinceSent(){return this._secondsSinceSent}get extraData(){return this._extraData}get date(){return this._date}};ei.CHAT=0,ei.ROOM_INVITE=1,ei.STATUS_NOTIFICATION=2,ei.SECURITY_NOTIFICATION=3;let Bn=ei;class mN{constructor(t,s=Sr.PRIVATE_CHAT){this._userId=t,this._chats=[],this._type=s}addChat(t){this._chats.push(t)}get userId(){return this._userId}get chats(){return this._chats}get type(){return this._type}set type(t){this._type=t}}const Oi=class Oi{constructor(t){this._threadId=++Oi.THREAD_ID,this._participant=t,this._groups=[],this._lastUpdated=new Date,this._unreadCount=0}addMessage(t,s,n=0,r=null,i=0){const l=t<0&&r,c=l?ch(r).userId:t,m=this.getLastGroup(c);if(!m)return;l&&(m.type=Sr.GROUP_CHAT);const h=new Bn(t,s,n,r,i);return m.addChat(h),this._lastUpdated=new Date,this._unreadCount++,h}getLastGroup(t){let s=this._groups[this._groups.length-1];return s&&s.userId===t||(s=new mN(t),this._groups.push(s)),s}setRead(){this._unreadCount=0}get threadId(){return this._threadId}get participant(){return this._participant}get groups(){return this._groups}get lastUpdated(){return this._lastUpdated}get unreadCount(){return this._unreadCount}get unread(){return this._unreadCount>0}};Oi.MESSAGE_RECEIVED="MT_MESSAGE_RECEIVED",Oi.THREAD_ID=0;let tc=Oi;function Xo(a=0){Z(a===0?"friends-messenger/toggle":`friends-messenger/${a}`)}const hN=()=>am.RENDERER_VERSION,uh=()=>"2.1.1";function ca(a){D(new Wi(a,!0))}function dh(a){Z(`groups/manage/${a}`)}function Mu(a,t){Z(t?`group-members/${a}/${t}`:`group-members/${a}`)}const ti=class ti{constructor(t,s,n,r){this.type=t,this.key=s||0,this.color=n||0,this.position=r||4}get code(){return this.key===0&&this.type!==ti.BASE?null:ti.getCode(this.type,this.key,this.color,this.position)}static getCode(t,s,n,r){return t+(s<10?"0":"")+s+(n<10?"0":"")+n+r}};ti.BASE="b",ti.SYMBOL="s";let ts=ti;const ki=class ki{};ki.NOT_MEMBER=0,ki.MEMBER=1,ki.REQUEST_PENDING=2;let Dt=ki;const Ai=class Ai{};Ai.REGULAR=0,Ai.EXCLUSIVE=1,Ai.PRIVATE=2;let Ts=Ai;const gN=a=>{D(a.favourite?new rg(a.groupId):new ig(a.groupId))},kc=a=>D(new ag(a)),_t=class _t{};_t.NONE="NONE",_t.ERROR="ERROR",_t.REJECTED="REJECTED",_t.USER_CREATE="USER_CREATE",_t.USER_PENDING="USER_PENDING",_t.USER_ONGOING="USER_ONGOING",_t.USER_FEEDBACK="USER_FEEDBACK",_t.USER_NO_HELPERS="USER_NO_HELPERS",_t.USER_SOMETHING_WRONG="USER_SOMETHING_WRONG",_t.USER_THANKS="USER_THANKS",_t.USER_GUIDE_DISCONNECTED="USER_GUIDE_DISCONNECTED",_t.GUIDE_TOOL_MENU="GUIDE_TOOL_MENU",_t.GUIDE_ACCEPT="GUIDE_ACCEPT",_t.GUIDE_ONGOING="GUIDE_ONGOING",_t.GUIDE_CLOSED="GUIDE_CLOSED",_t.GUARDIAN_CHAT_REVIEW_ACCEPT="GUARDIAN_CHAT_REVIEW_ACCEPT",_t.GUARDIAN_CHAT_REVIEW_WAIT_FOR_VOTERS="GUARDIAN_CHAT_REVIEW_WAIT_FOR_VOTERS",_t.GUARDIAN_CHAT_REVIEW_VOTE="GUARDIAN_CHAT_REVIEW_VOTE",_t.GUARDIAN_CHAT_REVIEW_WAIT_FOR_RESULTS="GUARDIAN_CHAT_REVIEW_WAIT_FOR_RESULTS",_t.GUARDIAN_CHAT_REVIEW_RESULTS="GUARDIAN_CHAT_REVIEW_RESULTS";let De=_t;class Uu{constructor(t,s){this._message=t,this._roomId=s}get message(){return this._message}get roomId(){return this._roomId}}class Fu{constructor(t){this._userId=t,this._messages=[]}addChat(t){this._messages.push(t)}get userId(){return this._userId}get messages(){return this._messages}}const Di=class Di{};Di.ACTIVE="active",Di.NONE="none",Di.EXPIRED="expired";let fn=Di;const fN="HC1",pN=["ACH_VipHC1","ACH_VipHC2","ACH_VipHC3","ACH_VipHC4","ACH_VipHC5","HC1","HC2","HC3","HC4","HC5"],xN=a=>{let t=null;return pN.forEach(s=>a.indexOf(s)>-1&&(t=s)),t||fN},wo=class wo{};wo.TOO_MANY_PENDING_CALLS_CODE=1,wo.HAS_ABUSIVE_CALL_CODE=2;let uo=wo;const jN=a=>a===1?"useless":a===2?"abusive":"resolved",jr=class jr{};jr.SELECT_USER=0,jr.SELECT_CHATS=1,jr.SELECT_TOPICS=2,jr.INPUT_REPORT_MESSAGE=3,jr.REPORT_SUMMARY=4;let Kt=jr;const dn=class dn{};dn.EMERGENCY=1,dn.GUIDE=2,dn.IM=3,dn.ROOM=4,dn.BULLY=6,dn.THREAD=7,dn.MESSAGE=8,dn.PHOTO=9;let tt=dn;const IN=a=>{switch(a){case 1:case 2:return"Normal";case 3:return"Automatic";case 4:return"Automatic IM";case 5:return"Guide System";case 6:return"IM";case 7:return"Room";case 8:return"Panic";case 9:return"Guardian";case 10:return"Automatic Helper";case 11:return"Discussion";case 12:return"Selfie";case 14:return"Photo";case 15:return"Ambassador"}return"Unknown"},er=class er{constructor(t,s,n,r,i){this._actionId=t,this._name=s,this._actionType=n,this._sanctionTypeId=r,this._actionLengthHours=i}get actionId(){return this._actionId}get name(){return this._name}get actionType(){return this._actionType}get sanctionTypeId(){return this._sanctionTypeId}get actionLengthHours(){return this._actionLengthHours}};er.ALERT=1,er.MUTE=2,er.BAN=3,er.KICK=4,er.TRADE_LOCK=5,er.MESSAGE=6;let Ge=er;const $s=class $s{};$s.NONE=0,$s.START_DOORBELL=1,$s.START_PASSWORD=2,$s.STATE_PENDING_SERVER=3,$s.UPDATE_STATE=4,$s.STATE_WAITING=5,$s.STATE_NO_ANSWER=6,$s.STATE_WRONG_PASSWORD=7,$s.STATE_ACCEPTED=8;let We=$s;const Pi=class Pi{};Pi.LIST=0,Pi.THUMBNAILS=1,Pi.FORCED_THUMBNAILS=2;let Kn=Pi;const bN=()=>{const a=[];for(let t=10;t<=100;t=t+10)a.push(t);return a},Vu=bN(),Br=[{name:"anything",query:null},{name:"room.name",query:"roomname"},{name:"owner",query:"owner"},{name:"tag",query:"tag"},{name:"group",query:"group"}];function is(a){D(new to(a,!1,!0))}const Gn=class Gn{};Gn.DEFAULT="default",Gn.MOTD="motd",Gn.MODERATION="moderation",Gn.EVENT="event",Gn.NITRO="nitro",Gn.SEARCH="search",Gn.ALERT="alert";let pe=Gn;const Li=class Li{constructor(t,s=pe.DEFAULT,n=null,r=null,i=null,l=null){Li.ITEM_ID+=1,this._id=Li.ITEM_ID,this._messages=t,this._alertType=s,this._clickUrl=n,this._clickUrlText=r,this._title=i,this._imageUrl=l}get id(){return this._id}get messages(){return this._messages}set alertType(t){this._alertType=t}get alertType(){return this._alertType}get clickUrl(){return this._clickUrl}get clickUrlText(){return this._clickUrlText}get title(){return this._title}get imageUrl(){return this._imageUrl}};Li.ITEM_ID=-1;let mo=Li;const Ut=class Ut{};Ut.FRIENDOFFLINE="friendoffline",Ut.FRIENDONLINE="friendonline",Ut.THIRDPARTYFRIENDOFFLINE="thirdpartyfriendoffline",Ut.THIRDPARTYFRIENDONLINE="thirdpartyfriendonline",Ut.ACHIEVEMENT="achievement",Ut.BADGE_RECEIVED="badge_received",Ut.INFO="info",Ut.RECYCLEROK="recyclerok",Ut.RESPECT="respect",Ut.CLUB="club",Ut.SOUNDMACHINE="soundmachine",Ut.PETLEVEL="petlevel",Ut.CLUBGIFT="clubgift",Ut.BUYFURNI="buyfurni",Ut.VIP="vip",Ut.ROOMMESSAGESPOSTED="roommessagesposted";let ss=Ut;const Mi=class Mi{constructor(t,s=ss.INFO,n=null,r=null){Mi.ITEM_ID+=1,this._id=Mi.ITEM_ID,this._message=t,this._notificationType=s,this._iconUrl=n,this._linkUrl=r}get id(){return this._id}get message(){return this._message}get notificationType(){return this._notificationType}get iconUrl(){return this._iconUrl}get linkUrl(){return this._linkUrl}};Mi.ITEM_ID=-1;let sc=Mi;const Ui=class Ui{constructor(t,s,n,r,i,l,c){Ui.ITEM_ID+=1,this._id=Ui.ITEM_ID,this._confirmType=t,this._message=s,this._onConfirm=n,this._onCancel=r,this._confirmText=i,this._cancelText=l,this._title=c}get id(){return this._id}get confirmType(){return this._confirmType}get message(){return this._message}get onConfirm(){return this._onConfirm}get onCancel(){return this._onCancel}get confirmText(){return this._confirmText}get cancelText(){return this._cancelText}get title(){return this._title}};Ui.ITEM_ID=-1;let nc=Ui;const Xc=class Xc{};Xc.DEFAULT="default";let Gu=Xc;class Ac{constructor(){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}static from(t){const s=new Ac;return s._credits=t._credits,s._activityPoints=t._activityPoints,s._clubDays=t._clubDays,s._clubPeriods=t._clubPeriods,s._isVIP=t._isVIP,s._pastClubDays=t._pastClubDays,s._pastVipDays=t._pastVipDays,s._isExpiring=t._isExpiring,s._minutesUntilExpiration=t._minutesUntilExpiration,s._minutesSinceLastModified=t._minutesSinceLastModified,s._lastUpdated=t._lastUpdated,s}get credits(){return this._credits}set credits(t){this._lastUpdated=Ms(),this._credits=t}get activityPoints(){return this._activityPoints}set activityPoints(t){this._lastUpdated=Ms(),this._activityPoints=t}get clubDays(){return this._clubDays}set clubDays(t){this._lastUpdated=Ms(),this._clubDays=t}get clubPeriods(){return this._clubPeriods}set clubPeriods(t){this._lastUpdated=Ms(),this._clubPeriods=t}get hasClubLeft(){return this._clubDays>0||this._clubPeriods>0}get isVip(){return this._isVIP}set isVip(t){this._isVIP=t}get pastClubDays(){return this._pastClubDays}set pastClubDays(t){this._lastUpdated=Ms(),this._pastClubDays=t}get pastVipDays(){return this._pastVipDays}set pastVipDays(t){this._lastUpdated=Ms(),this._pastVipDays=t}get isExpiring(){return this._isExpiring}set isExpiring(t){this._isExpiring=t}get minutesUntilExpiration(){var t=(Ms()-this._lastUpdated)/6e4,s=this._minutesUntilExpiration-t;return s>0?s:0}set minutesUntilExpiration(t){this._lastUpdated=Ms(),this._minutesUntilExpiration=t}get minutesSinceLastModified(){return this._minutesSinceLastModified}set minutesSinceLastModified(t){this._lastUpdated=Ms(),this._minutesSinceLastModified=t}get lastUpdated(){return this._lastUpdated}get clubLevel(){return this.clubDays===0&&this.clubPeriods===0?Bt.NO_CLUB:this.isVip?Bt.VIP:Bt.CLUB}}class ua extends Rs{}const Fi=class Fi extends ua{constructor(t,s){super(t),this._id=-1,this._numQuestions=0,this._startMessage="",this._endMessage="",this._questionArray=null,this._pollType="",this._npsPoll=!1,this._id=s}get id(){return this._id}get summary(){return this._summary}set summary(t){this._summary=t}get headline(){return this._headline}set headline(t){this._headline=t}get numQuestions(){return this._numQuestions}set numQuestions(t){this._numQuestions=t}get startMessage(){return this._startMessage}set startMessage(t){this._startMessage=t}get endMessage(){return this._endMessage}set endMessage(t){this._endMessage=t}get questionArray(){return this._questionArray}set questionArray(t){this._questionArray=t}get pollType(){return this._pollType}set pollType(t){this._pollType=t}get npsPoll(){return this._npsPoll}set npsPoll(t){this._npsPoll=t}};Fi.OFFER="RWPUW_OFFER",Fi.ERROR="RWPUW_ERROR",Fi.CONTENT="RWPUW_CONTENT";let Xn=Fi;const To=class To extends ua{constructor(t,s=0,n=0,r=0){super(t),this._hue=s,this._saturation=n,this._lightness=r}get hue(){return this._hue}get saturation(){return this._saturation}get lightness(){return this._lightness}};To.PREVIEW="RWUBCPE_PREVIEW",To.CLEAR_PREVIEW="RWUBCPE_CLEAR_PREVIEW";let nr=To;const si=class si extends ua{constructor(t,s){super(si.CHAT_INPUT_CONTENT),this._chatMode="",this._userName="",this._chatMode=t,this._userName=s}get chatMode(){return this._chatMode}get userName(){return this._userName}};si.CHAT_INPUT_CONTENT="RWUCICE_CHAT_INPUT_CONTENT",si.WHISPER="whisper",si.SHOUT="shout";let wr=si;const yo=class yo extends ua{constructor(t,s,n,r,i,l,c){super(yo.UPDATE_CHAT),this._objectId=t,this._category=s,this._botId=n,this._chat=r,this._automaticChat=i,this._chatDelay=l,this._mixSentences=c}get objectId(){return this._objectId}get category(){return this._category}get botId(){return this._botId}get chat(){return this._chat}get automaticChat(){return this._automaticChat}get chatDelay(){return this._chatDelay}get mixSentences(){return this._mixSentences}};yo.UPDATE_CHAT="RWURBCE_UPDATE_CHAT";let ho=yo;const Ls=class Ls extends ua{constructor(t,s,n,r){super(t),this._id=s,this._category=n,this._roomId=r}get id(){return this._id}get category(){return this._category}get roomId(){return this._roomId}};Ls.OBJECT_SELECTED="RWUROE_OBJECT_SELECTED",Ls.OBJECT_DESELECTED="RWUROE_OBJECT_DESELECTED",Ls.USER_REMOVED="RWUROE_USER_REMOVED",Ls.FURNI_REMOVED="RWUROE_FURNI_REMOVED",Ls.FURNI_ADDED="RWUROE_FURNI_ADDED",Ls.USER_ADDED="RWUROE_USER_ADDED",Ls.OBJECT_ROLL_OVER="RWUROE_OBJECT_ROLL_OVER",Ls.OBJECT_ROLL_OUT="RWUROE_OBJECT_ROLL_OUT",Ls.OBJECT_REQUEST_MANIPULATION="RWUROE_OBJECT_REQUEST_MANIPULATION",Ls.OBJECT_DOUBLE_CLICKED="RWUROE_OBJECT_DOUBLE_CLICKED";let Be=Ls;const Qc=class Qc{constructor(t){this.type=t,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}};Qc.FURNI="IFI_FURNI";let yr=Qc;class mh{constructor(t,s,n,r,i,l=!1){this.roomIndex=t,this.category=s,this.id=n,this.name=r,this.userType=i,this.isFriend=l}}const Jc=class Jc{constructor(t){this.type=t,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}};Jc.PET_INFO="IPI_PET_INFO";let Rr=Jc;const Zc=class Zc{constructor(t){this.type=t,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=[]}};Zc.RENTABLE_BOT="IRBI_RENTABLE_BOT";let Or=Zc;const mn=class mn{constructor(t){this.type=t,this.name="",this.motto="",this.achievementScore=0,this.backgroundId=0,this.standId=0,this.overlayId=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}get isOwnUser(){return this.type===mn.OWN_USER}};mn.OWN_USER="IUI_OWN_USER",mn.PEER="IUI_PEER",mn.BOT="IUI_BOT",mn.TRADE_REASON_OK=0,mn.TRADE_REASON_SHUTDOWN=2,mn.TRADE_REASON_NO_TRADING=3,mn.DEFAULT_BOT_BADGE_ID="BOT";let Rt=mn;class Hr{static getObjectName(t,s){const n=ye();let r=-1,i=null,l=0;switch(s){case X.FLOOR:case X.WALL:{const c=H().getRoomObject(n.roomId,t,s);if(!c)break;if(c.type.indexOf("poster")===0)i=d("${poster_"+parseInt(c.type.replace("poster",""))+"_name}");else{let m=null;const h=c.model.getValue(te.FURNITURE_TYPE_ID);if(s===X.FLOOR?m=B().getFloorItemData(h):s===X.WALL&&(m=B().getWallItemData(h)),!m)break;r=m.id,i=m.name}break}case X.UNIT:{const c=n.userDataManager.getUserDataByIndex(t);if(!c)break;r=c.webID,i=c.name,l=c.type;break}}return!i||!i.length?null:new mh(t,s,r,i,l)}static getFurniInfo(t,s){const n=ye(),r=new yr(yr.FURNI);r.id=t,r.category=s;const i=H().getRoomObject(n.roomId,t,s);if(!i)return;const l=i.model;l.getValue(Ln.INFOSTAND_EXTRA_PARAM)&&(r.extraParam=l.getValue(Ln.INFOSTAND_EXTRA_PARAM));const c=l.getValue(te.FURNITURE_DATA_FORMAT),m=om.getData(c);m.initializeFromRoomObjectModel(l),r.stuffData=m;const h=i.type;if(h.indexOf("poster")===0){const x=parseInt(h.replace("poster",""));r.name=d("${poster_"+x+"_name}"),r.description=d("${poster_"+x+"_desc}")}else{const x=l.getValue(te.FURNITURE_TYPE_ID);let I=null;s===X.FLOOR?I=B().getFloorItemData(x):s===X.WALL&&(I=B().getWallItemData(x)),I&&(r.name=I.name,r.description=I.description,r.purchaseOfferId=I.purchaseOfferId,r.purchaseCouldBeUsedForBuyout=I.purchaseCouldBeUsedForBuyout,r.rentOfferId=I.rentOfferId,r.rentCouldBeUsedForBuyout=I.rentCouldBeUsedForBuyout,r.availableForBuildersClub=I.availableForBuildersClub,r.tileSizeX=I.tileSizeX,r.tileSizeY=I.tileSizeY)}h.indexOf("post_it")>-1&&(r.isStickie=!0);const u=l.getValue(te.FURNITURE_EXPIRY_TIME),g=l.getValue(te.FURNITURE_EXPIRTY_TIMESTAMP);r.expiration=u<0?u:Math.max(0,u-(Ms()-g)/1e3);let f=H().getRoomObjectImage(n.roomId,t,s,new Ot(180),64,null);(!f.data||f.data.width>140||f.data.height>200)&&(f=H().getRoomObjectImage(n.roomId,t,s,new Ot(180),1,null)),r.image=f.getImage(),r.isWallItem=s===X.WALL,r.isRoomOwner=n.isRoomOwner,r.roomControllerLevel=n.controllerLevel,r.isAnyRoomController=B().isModerator,r.ownerId=l.getValue(te.FURNITURE_OWNER_ID),r.ownerName=l.getValue(te.FURNITURE_OWNER_NAME),r.usagePolicy=l.getValue(te.FURNITURE_USAGE_POLICY);const p=l.getValue(te.FURNITURE_GUILD_CUSTOMIZED_GUILD_ID);return p!==0&&(r.groupId=p),$t(i)&&(r.isOwner=!0),r}static getUserInfo(t,s){const n=ye();let r=Rt.OWN_USER;s.webID!==B().userId&&(r=Rt.PEER);const i=new Rt(r);i.isSpectatorMode=n.isSpectator,i.name=s.name,i.motto=s.custom,i.backgroundId=s.background,i.standId=s.stand,i.overlayId=s.overlay,i.achievementScore=s.activityPoints,i.webID=s.webID,i.roomIndex=s.roomIndex,i.userType=dt.USER;const l=H().getRoomObject(n.roomId,s.roomIndex,t);if(l&&(i.carryItem=l.model.getValue(te.FIGURE_CARRY_OBJECT)||0),r===Rt.OWN_USER&&(i.allowNameChange=B().canChangeName),i.amIOwner=n.isRoomOwner,i.isGuildRoom=n.isGuildRoom,i.roomControllerLevel=n.controllerLevel,i.amIAnyRoomController=B().isModerator,i.isAmbassador=B().isAmbassador,r===Rt.PEER){if(l){const h=l.model.getValue(te.FIGURE_FLAT_CONTROL);h!==null&&(i.targetRoomControllerLevel=h),i.canBeMuted=this.canBeMuted(i),i.canBeKicked=this.canBeKicked(i),i.canBeBanned=this.canBeBanned(i)}i.isIgnored=B().isUserIgnored(s.name),i.respectLeft=B().respectsLeft;const c=B().isSystemShutdown,m=n.tradeMode;if(c)i.canTrade=!1;else switch(m){case ll.ROOM_CONTROLLER_REQUIRED:{const h=i.roomControllerLevel!==$e.NONE&&i.roomControllerLevel!==$e.GUILD_MEMBER,u=i.targetRoomControllerLevel!==$e.NONE&&i.targetRoomControllerLevel!==$e.GUILD_MEMBER;i.canTrade=h||u;break}case ll.NO_TRADING:i.canTrade=!0;break;default:i.canTrade=!1;break}i.canTradeReason=Rt.TRADE_REASON_OK,c&&(i.canTradeReason=Rt.TRADE_REASON_SHUTDOWN),m!==ll.FREE_TRADING&&(i.canTradeReason=Rt.TRADE_REASON_NO_TRADING)}return i.groupId=s.groupId,i.groupBadgeId=B().getGroupBadge(i.groupId),i.groupName=s.groupName,i.badges=n.userDataManager.getUserBadges(s.webID),i.figure=s.figure,i}static getBotInfo(t,s){const n=ye(),r=new Rt(Rt.BOT);r.name=s.name,r.motto=s.custom,r.webID=s.webID,r.roomIndex=s.roomIndex,r.userType=s.type;const i=H().getRoomObject(n.roomId,s.roomIndex,t);return i&&(r.carryItem=i.model.getValue(te.FIGURE_CARRY_OBJECT)||0),r.amIOwner=n.isRoomOwner,r.isGuildRoom=n.isGuildRoom,r.roomControllerLevel=n.controllerLevel,r.amIAnyRoomController=B().isModerator,r.isAmbassador=B().isAmbassador,r.badges=[Rt.DEFAULT_BOT_BADGE_ID],r.figure=s.figure,r}static getRentableBotInfo(t,s){const n=ye(),r=new Or(Or.RENTABLE_BOT);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;const i=H().getRoomObject(n.roomId,s.roomIndex,t);return i&&(r.carryItem=i.model.getValue(te.FIGURE_CARRY_OBJECT)||0),r.amIOwner=n.isRoomOwner,r.roomControllerLevel=n.controllerLevel,r.amIAnyRoomController=B().isModerator,r.badges=[Rt.DEFAULT_BOT_BADGE_ID],r.figure=s.figure,r}static getPetInfo(t){const s=ye(),n=s.userDataManager.getPetData(t.id);if(!n)return;const r=new ci(n.figure);let i=null;r.typeId===Vt.MONSTERPLANT&&(t.level>=t.adultLevel?i="std":i="grw"+t.level);const l=t.ownerId===B().userId,c=new Rr(Rr.PET_INFO);return c.name=n.name,c.id=t.id,c.ownerId=t.ownerId,c.ownerName=t.ownerName,c.rarityLevel=t.rarityLevel,c.petType=r.typeId,c.petBreed=r.paletteId,c.petFigure=n.figure,c.posture=i,c.isOwner=l,c.roomIndex=n.roomIndex,c.level=t.level,c.maximumLevel=t.maximumLevel,c.experience=t.experience,c.levelExperienceGoal=t.levelExperienceGoal,c.energy=t.energy,c.maximumEnergy=t.maximumEnergy,c.happyness=t.happyness,c.maximumHappyness=t.maximumHappyness,c.respect=t.respect,c.respectsPetLeft=B().respectsPetLeft,c.age=t.age,c.saddle=t.saddle,c.rider=t.rider,c.breedable=t.breedable,c.fullyGrown=t.fullyGrown,c.dead=t.dead,c.rarityLevel=t.rarityLevel,c.skillTresholds=t.skillTresholds,c.canRemovePet=!1,c.publiclyRideable=t.publiclyRideable,c.maximumTimeToLive=t.maximumTimeToLive,c.remainingTimeToLive=t.remainingTimeToLive,c.remainingGrowTime=t.remainingGrowTime,c.publiclyBreedable=t.publiclyBreedable,(l||s.isRoomOwner||B().isModerator||s.controllerLevel>=$e.GUEST)&&(c.canRemovePet=!0),c}static checkGuildSetting(t){return t.isGuildRoom?t.roomControllerLevel>=$e.GUILD_ADMIN:t.roomControllerLevel>=$e.GUEST}static isValidSetting(t,s){const n=ye();if(!n.isPrivateRoom)return!1;const r=n.moderationSettings;let i=!1;return r&&(i=s(t,r)),i&&t.targetRoomControllerLevel<$e.ROOM_OWNER}static canBeMuted(t){const s=(n,r)=>{switch(r.allowMute){case Qs.MODERATION_LEVEL_USER_WITH_RIGHTS:return this.checkGuildSetting(n);default:return n.roomControllerLevel>=$e.ROOM_OWNER}};return this.isValidSetting(t,s)}static canBeKicked(t){const s=(n,r)=>{switch(r.allowKick){case Qs.MODERATION_LEVEL_ALL:return!0;case Qs.MODERATION_LEVEL_USER_WITH_RIGHTS:return this.checkGuildSetting(n);default:return n.roomControllerLevel>=$e.ROOM_OWNER}};return this.isValidSetting(t,s)}static canBeBanned(t){const s=(n,r)=>{switch(r.allowBan){case Qs.MODERATION_LEVEL_USER_WITH_RIGHTS:return this.checkGuildSetting(n);default:return n.roomControllerLevel>=$e.ROOM_OWNER}};return this.isValidSetting(t,s)}}const Wt=class Wt{};Wt.GENERIC_SKILL=0,Wt.DRESS_UP=1,Wt.SETUP_CHAT=2,Wt.RANDOM_WALK=3,Wt.DANCE=4,Wt.CHANGE_BOT_NAME=5,Wt.SERVE_BEVERAGE=6,Wt.INCLIENT_LINK=7,Wt.NUX_PROCEED=8,Wt.CHANGE_BOT_MOTTO=9,Wt.NUX_TAKE_TOUR=10,Wt.NO_PICK_UP=12,Wt.NAVIGATOR_SEARCH=14,Wt.DONATE_TO_USER=24,Wt.DONATE_TO_ALL=25;let ze=Wt;const Ro=class Ro{constructor(t=-1,s=-1,n=-1,r="",i="",l="",c=null,m=0,h=0,u=null,g=null,f=""){this.senderId=t,this.senderCategory=s,this.roomId=n,this.text=r,this.formattedText=i,this.username=l,this.location=c,this.type=m,this.styleId=h,this.imageUrl=u,this.color=g,this.chatColours=f,this.id=-1,this.width=0,this.height=0,this.elementRef=null,this.skipMovement=!1,this._top=0,this._left=0,this.id=++Ro.BUBBLE_COUNTER,this.color=g,this.chatColours=f}get top(){return this._top}set top(t){this._top=t,this.elementRef&&(this.elementRef.style.top=this._top+"px")}get left(){return this._left}set left(t){this._left=t,this.elementRef&&(this.elementRef.style.left=this._left+"px")}};Ro.BUBBLE_COUNTER=0;let rc=Ro;const Vi=class Vi{};Vi.CHAT_DEFAULT=0,Vi.CHAT_WHISPER=1,Vi.CHAT_SHOUT=2;let pn=Vi;class Bu{constructor(t=0,s=0,n=0,r=0){this.id=t,this.type=s,this.color=n,this.light=r}}const EN=(a,t,s,n=0)=>!(a.left+n+a.widtht.left+n+t.width||a.top+a.heightt.top+s+t.height),ni=class ni{static savePreset(t,s,n,r,i){ye().updateMoodlightData(t,s,n,r,i)}static changeState(){ye().toggleMoodlightState()}static previewDimmer(t,s,n){H().updateObjectRoomColor(ye().roomId,t,s,n)}static scaleBrightness(t){return~~((t-this.MIN_BRIGHTNESS)*100/(this.MAX_BRIGHTNESS-this.MIN_BRIGHTNESS)+0)}};ni.AVAILABLE_COLORS=[7665141,21495,15161822,15353138,15923281,8581961,0],ni.HTML_COLORS=["#74F5F5","#0053F7","#E759DE","#EA4532","#F2F851","#82F349","#000000"],ni.MIN_BRIGHTNESS=76,ni.MAX_BRIGHTNESS=255;let Fs=ni;const CN=130,NN=100,vN=130,_N=100,SN=130,wN=100,hh=a=>{let t=0,s=0,n=0,r=0;for(;r=0||t.removePart(s);t.updatePart(this.MANNEQUIN_FIGURE[0],this.MANNEQUIN_FIGURE[1],this.MANNEQUIN_FIGURE[2])}};Oo.MANNEQUIN_FIGURE=["hd",99999,[99998]],Oo.MANNEQUIN_CLOTHING_PART_TYPES=[Ve.CHEST_ACCESSORY,Ve.COAT_CHEST,Ve.CHEST,Ve.LEGS,Ve.SHOES,Ve.WAIST_ACCESSORY];let li=Oo;const ko=class ko{};ko.WATER=0,ko.LIGHT=1;let Hu=ko;const Ao=class Ao{};Ao.POSTURE_STAND=0,Ao.POSTURE_SIT=1;let go=Ao;class Yr{constructor(t,s,n){this._id=t,this._category=s,this._name=n}get id(){return this._id}get category(){return this._category}get name(){return this._name}}class TN{constructor(t,s,n,r,i,l,c){this.id=t,this.category=s,this.name=n,this.requestRoomObjectId=r,this.targetRoomObjectId=i,this.requestInventoryStripId=l,this.replace=c}}const fo="0",gh="1",tr=class tr{};tr.UNSTARTED=-1,tr.ENDED=0,tr.PLAYING=1,tr.PAUSED=2,tr.BUFFERING=3,tr.CUED=5;let rr=tr;function as(a){D(new og(a))}const da=a=>{const t=Math.floor(a/2);return a%2?(t+.5).toString():t.toString()},Xe=class Xe{};Xe.TOGGLE_FURNI_STATE=0,Xe.RESET=1,Xe.SET_FURNI_STATE=3,Xe.MOVE_FURNI=4,Xe.GIVE_SCORE=6,Xe.CHAT=7,Xe.TELEPORT=8,Xe.JOIN_TEAM=9,Xe.LEAVE_TEAM=10,Xe.CHASE=11,Xe.FLEE=12,Xe.MOVE_AND_ROTATE_FURNI=13,Xe.GIVE_SCORE_TO_PREDEFINED_TEAM=14,Xe.TOGGLE_TO_RANDOM_STATE=15,Xe.MOVE_FURNI_TO=16,Xe.GIVE_REWARD=17,Xe.CALL_ANOTHER_STACK=18,Xe.KICK_FROM_ROOM=19,Xe.MUTE_USER=20,Xe.BOT_TELEPORT=21,Xe.BOT_MOVE=22,Xe.BOT_TALK=23,Xe.BOT_GIVE_HAND_ITEM=24,Xe.BOT_FOLLOW_AVATAR=25,Xe.BOT_CHANGE_FIGURE=26,Xe.BOT_TALK_DIRECT_TO_AVTR=27;let Ze=Xe;const Qe=class Qe{};Qe.STATES_MATCH=0,Qe.FURNIS_HAVE_AVATARS=1,Qe.ACTOR_IS_ON_FURNI=2,Qe.TIME_ELAPSED_MORE=3,Qe.TIME_ELAPSED_LESS=4,Qe.USER_COUNT_IN=5,Qe.ACTOR_IS_IN_TEAM=6,Qe.HAS_STACKED_FURNIS=7,Qe.STUFF_TYPE_MATCHES=8,Qe.STUFFS_IN_FORMATION=9,Qe.ACTOR_IS_GROUP_MEMBER=10,Qe.ACTOR_IS_WEARING_BADGE=11,Qe.ACTOR_IS_WEARING_EFFECT=12,Qe.NOT_STATES_MATCH=13,Qe.FURNI_NOT_HAVE_HABBO=14,Qe.NOT_ACTOR_ON_FURNI=15,Qe.NOT_USER_COUNT_IN=16,Qe.NOT_ACTOR_IN_TEAM=17,Qe.NOT_HAS_STACKED_FURNIS=18,Qe.NOT_FURNI_IS_OF_TYPE=19,Qe.NOT_STUFFS_IN_FORMATION=20,Qe.NOT_ACTOR_IN_GROUP=21,Qe.NOT_ACTOR_WEARS_BADGE=22,Qe.NOT_ACTOR_WEARING_EFFECT=23,Qe.DATE_RANGE_ACTIVE=24,Qe.ACTOR_HAS_HANDITEM=25;let it=Qe;const Wu=a=>`${a.getFullYear()}/${("0"+(a.getMonth()+1)).slice(-2)}/${("0"+a.getDate()).slice(-2)} ${("0"+a.getHours()).slice(-2)}:${("0"+a.getMinutes()).slice(-2)}`,ri=class ri{};ri.STUFF_SELECTION_OPTION_NONE=0,ri.STUFF_SELECTION_OPTION_BY_ID=1,ri.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE=2,ri.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT=3;let ue=ri;const yN=`
attribute vec2 aVertexPosition;
attribute vec2 aTextureCoord;
uniform mat3 projectionMatrix;
varying vec2 vTextureCoord;
void main(void)
{
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
vTextureCoord = aTextureCoord;
}`,RN=`
varying vec2 vTextureCoord;
uniform sampler2D uSampler;
uniform vec3 lineColor;
uniform vec3 color;
void main(void) {
vec4 currentColor = texture2D(uSampler, vTextureCoord);
vec3 colorLine = lineColor * currentColor.a;
vec3 colorOverlay = color * currentColor.a;
if(currentColor.r == 0.0 && currentColor.g == 0.0 && currentColor.b == 0.0 && currentColor.a > 0.0) {
gl_FragColor = vec4(colorLine.r, colorLine.g, colorLine.b, currentColor.a);
} else if(currentColor.a > 0.0) {
gl_FragColor = vec4(colorOverlay.r, colorOverlay.g, colorOverlay.b, currentColor.a);
}
}`;class ON extends lg{constructor(t,s){super(yN,RN),this.uniforms.lineColor=new Float32Array(3),this.uniforms.color=new Float32Array(3),this.lineColor=t,this.color=s}get lineColor(){return this._lineColor}set lineColor(t){const s=this.uniforms.lineColor;typeof t=="number"?(Is.hex2rgb(t,s),this._lineColor=t):(s[0]=t[0],s[1]=t[1],s[2]=t[2],this._lineColor=Is.rgb2hex(s))}get color(){return this._color}set color(t){const s=this.uniforms.color;typeof t=="number"?(Is.hex2rgb(t,s),this._color=t):(s[0]=t[0],s[1]=t[1],s[2]=t[2],this._color=Is.rgb2hex(s))}}const ps=class ps{static setMaxItemSelectionCount(t){ps._maxItemSelectionCount=t}static show(t){ps.applySelectionShader(ps.getRoomObject(t))}static hide(t){ps.clearSelectionShader(ps.getRoomObject(t))}static clearSelectionShaderFromFurni(t){for(const s of t)ps.clearSelectionShader(ps.getRoomObject(s))}static applySelectionShaderToFurni(t){for(const s of t)ps.applySelectionShader(ps.getRoomObject(s))}static getRoomObject(t){const s=H();return s.getRoomObject(s.activeRoomId,t,X.FLOOR)}static applySelectionShader(t){if(!t)return;const s=t.visualization;if(s)for(const n of s.sprites)n.blendMode!==1&&(n.filters=[ps._selectionShader])}static clearSelectionShader(t){if(!t)return;const s=t.visualization;if(s)for(const n of s.sprites)n.filters=[]}};ps._selectionShader=new ON([1,1,1],[.6,.6,.6]),ps._maxItemSelectionCount=0;let Hn=ps;const hi=" ",es=class es{};es.AVATAR_SAYS_SOMETHING=0,es.AVATAR_WALKS_ON_FURNI=1,es.AVATAR_WALKS_OFF_FURNI=2,es.EXECUTE_ONCE=3,es.TOGGLE_FURNI=4,es.EXECUTE_PERIODICALLY=6,es.AVATAR_ENTERS_ROOM=7,es.GAME_STARTS=8,es.GAME_ENDS=9,es.SCORE_ACHIEVED=10,es.COLLISION=11,es.EXECUTE_PERIODICALLY_LONG=12,es.BOT_REACHED_STUFF=13,es.BOT_REACHED_AVATAR=14;let Zt=es;const ii=class ii{};ii.CENTER="DWP_CENTER",ii.TOP_CENTER="DWP_TOP_CENTER",ii.TOP_LEFT="DWP_TOP_LEFT",ii.NOTHING="DWP_NOTHING";let Tt=ii;const kn=[],qu=new Map,zu=0,Yu=0,Mr=a=>{const{uniqueKey:t=null,handleSelector:s=".drag-handler",windowPosition:n=Tt.CENTER,disableDrag:r=!1,dragStyle:i={},children:l=null,offsetLeft:c=0,offsetTop:m=0}=a,[h,u]=o.useState(null),[g,f]=o.useState(null),[p,x]=o.useState({x:0,y:0}),[I,j]=o.useState(!1),[E,C]=o.useState(null),b=o.useRef(),_=o.useCallback(()=>{let U=400;for(const J of kn)U+=1,J.style.zIndex=U.toString()},[]),S=o.useCallback(()=>{const U=kn.indexOf(b.current);if(U===-1)kn.push(b.current);else{if(U===kn.length-1)return;U>=0&&(kn.splice(U,1),kn.push(b.current))}_()},[_]),T=o.useCallback(U=>{S()},[S]),L=o.useCallback(U=>{S()},[S]),k=o.useCallback((U,J)=>{x({x:U,y:J}),j(!0)},[]),R=o.useCallback(U=>{k(U.clientX,U.clientY)},[k]),y=o.useCallback(U=>{const J=U.touches[0];k(J.clientX,J.clientY)},[k]),O=o.useCallback(U=>{u({x:U.clientX-p.x,y:U.clientY-p.y})},[p]),F=o.useCallback(U=>{const J=U.touches[0];u({x:J.clientX-p.x,y:J.clientY-p.y})},[p]),V=o.useCallback(()=>{if(!b.current||!E)return;let U=g.x+h.x,J=g.y+h.y;const je=b.current.offsetLeft+U,we=b.current.offsetTop+J;we=document.body.offsetHeight-zu&&(J=document.body.offsetHeight-b.current.offsetHeight-b.current.offsetTop),je+b.current.offsetWidth=document.body.offsetWidth-Yu&&(U=document.body.offsetWidth-b.current.offsetWidth-b.current.offsetLeft),u({x:0,y:0}),f({x:U,y:J}),j(!1),t!==null&&qu.set(t,{x:U,y:J})},[E,h,g,t]),Y=o.useCallback(U=>{V()},[V]),q=o.useCallback(U=>{V()},[V]);return o.useEffect(()=>{const U=b.current;if(!U)return;if(kn.push(U),_(),!r){const we=U.querySelector(s);we&&C(we)}let J=0,je=0;switch(n){case Tt.TOP_CENTER:U.style.top=50+m+"px",U.style.left=`calc(50vw - ${U.offsetWidth/2+c}px)`;break;case Tt.CENTER:U.style.top=`calc(50vh - ${U.offsetHeight/2+m}px)`,U.style.left=`calc(50vw - ${U.offsetWidth/2+c}px)`;break;case Tt.TOP_LEFT:U.style.top=50+m+"px",U.style.left=50+c+"px";break}if(t!==null){const we=qu.get(t);we&&(J=we.x,je=we.y)}return u({x:0,y:0}),f({x:J,y:je}),()=>{const we=kn.indexOf(U);we>=0&&kn.splice(we,1)}},[s,n,t,r,c,m,_]),o.useEffect(()=>{if(!g&&!h)return;const U=b.current;U&&(U.style.transform=`translate(${g.x+h.x}px, ${g.y+h.y}px)`,U.style.visibility="visible")},[g,h]),o.useEffect(()=>{if(E)return E.addEventListener(be.MOUSE_DOWN,R),E.addEventListener(Mt.TOUCH_START,y,{passive:!0}),()=>{E.removeEventListener(be.MOUSE_DOWN,R),E.removeEventListener(Mt.TOUCH_START,y)}},[E,R,y]),o.useEffect(()=>{if(I)return document.addEventListener(be.MOUSE_UP,Y),document.addEventListener(Mt.TOUCH_END,q),document.addEventListener(be.MOUSE_MOVE,O),document.addEventListener(Mt.TOUCH_MOVE,F),()=>{document.removeEventListener(be.MOUSE_UP,Y),document.removeEventListener(Mt.TOUCH_END,q),document.removeEventListener(be.MOUSE_MOVE,O),document.removeEventListener(Mt.TOUCH_MOVE,F)}},[I,Y,O,q,F]),o.useEffect(()=>{const U=b.current;if(U)return U.addEventListener("touchstart",L,{passive:!0}),()=>{U.removeEventListener("touchstart",L)}},[L]),o.useEffect(()=>{if(!t)return;const U=$o(`nitro.windows.${t}`);!U||!U.offset||(u({x:0,y:0}),U.offset&&f(U.offset))},[t]),Bo.createPortal(e.jsx(A,{position:"absolute",innerRef:b,className:"draggable-window",onMouseDownCapture:T,style:i,children:l}),document.getElementById("draggable-windows-container"))},An=[],$u=new Map,kN=a=>{const{uniqueKey:t=null,handleSelector:s=".drag-handler",windowPosition:n=Tt.CENTER,disableDrag:r=!1,dragStyle:i={},children:l=null,offsetLeft:c=0,offsetTop:m=0}=a,[h,u]=o.useState(null),[g,f]=o.useState(null),[p,x]=o.useState({x:0,y:0}),[I,j]=o.useState(!1),[E,C]=o.useState(null),b=o.useRef(),_=o.useCallback(()=>{let U=400;for(const J of An)U+=1,J.style.zIndex=U.toString()},[]),S=o.useCallback(()=>{const U=An.indexOf(b.current);if(U===-1)An.push(b.current);else{if(U===An.length-1)return;U>=0&&(An.splice(U,1),An.push(b.current))}_()},[_]),T=o.useCallback(U=>{S()},[S]),L=o.useCallback(U=>{S()},[S]),k=o.useCallback((U,J)=>{x({x:U,y:J}),j(!0)},[]),R=o.useCallback(U=>{k(U.clientX,U.clientY)},[k]),y=o.useCallback(U=>{const J=U.touches[0];k(J.clientX,J.clientY)},[k]),O=o.useCallback(U=>{u({x:U.clientX-p.x,y:U.clientY-p.y})},[p]),F=o.useCallback(U=>{const J=U.touches[0];u({x:J.clientX-p.x,y:J.clientY-p.y})},[p]),V=o.useCallback(()=>{if(!b.current||!E)return;let U=g.x+h.x,J=g.y+h.y;const je=b.current,we=je.offsetWidth,pt=je.offsetHeight,Xt=document.body.offsetWidth,Oe=document.body.offsetHeight,kt=-je.offsetLeft,Re=Xt-we-je.offsetLeft,Qt=-je.offsetTop,me=Oe-pt-je.offsetTop;U=Math.max(kt,Math.min(U,Re)),J=Math.max(Qt,Math.min(J,me)),u({x:0,y:0}),f({x:U,y:J}),j(!1),t!==null&&$u.set(t,{x:U,y:J})},[E,h,g,t]),Y=o.useCallback(U=>{V()},[V]),q=o.useCallback(U=>{V()},[V]);return o.useEffect(()=>{const U=b.current;if(!U)return;if(An.push(U),_(),!r){const we=U.querySelector(s);we&&C(we)}let J=0,je=0;switch(n){case Tt.TOP_CENTER:U.style.top=50+m+"px",U.style.left=`calc(50vw - ${U.offsetWidth/2+c}px)`;break;case Tt.CENTER:U.style.top=`calc(50vh - ${U.offsetHeight/2+m}px)`,U.style.left=`calc(50vw - ${U.offsetWidth/2+c}px)`;break;case Tt.TOP_LEFT:U.style.top=50+m+"px",U.style.left=50+c+"px";break}if(t!==null){const we=$u.get(t);we&&(J=we.x,je=we.y)}return u({x:0,y:0}),f({x:J,y:je}),()=>{const we=An.indexOf(U);we>=0&&An.splice(we,1)}},[s,n,t,r,c,m,_]),o.useEffect(()=>{if(!g&&!h)return;const U=b.current;U&&(U.style.transform=`translate(${g.x+h.x}px, ${g.y+h.y}px)`,U.style.visibility="visible")},[g,h]),o.useEffect(()=>{if(E)return E.addEventListener(be.MOUSE_DOWN,R),E.addEventListener(Mt.TOUCH_START,y,{passive:!0}),()=>{E.removeEventListener(be.MOUSE_DOWN,R),E.removeEventListener(Mt.TOUCH_START,y)}},[E,R,y]),o.useEffect(()=>{if(I)return document.addEventListener(be.MOUSE_UP,Y),document.addEventListener(Mt.TOUCH_END,q),document.addEventListener(be.MOUSE_MOVE,O),document.addEventListener(Mt.TOUCH_MOVE,F),()=>{document.removeEventListener(be.MOUSE_UP,Y),document.removeEventListener(Mt.TOUCH_END,q),document.removeEventListener(be.MOUSE_MOVE,O),document.removeEventListener(Mt.TOUCH_MOVE,F)}},[I,Y,O,q,F]),o.useEffect(()=>{const U=b.current;if(U)return U.addEventListener("touchstart",L,{passive:!0}),()=>{U.removeEventListener("touchstart",L)}},[L]),o.useEffect(()=>{if(!t)return;const U=$o(`nitro.windows.${t}`);!U||!U.offset||(u({x:0,y:0}),U.offset&&f(U.offset))},[t]),Bo.createPortal(e.jsx(A,{position:"absolute",innerRef:b,className:"draggable-window-camera",onMouseDownCapture:T,style:i,children:l}),document.getElementById("draggable-windows-container"))},ie=a=>{const{theme:t="primary",uniqueKey:s=null,handleSelector:n=".drag-handler",windowPosition:r=Tt.CENTER,disableDrag:i=!1,overflow:l="hidden",position:c="relative",gap:m=0,classNames:h=[],...u}=a,g=o.useRef(),f=o.useMemo(()=>{const p=["nitro-card","rounded","shadow"];return p.push(`theme-${t||"primary"}`),h.length&&p.push(...h),p},[t,h]);return e.jsx(bC,{value:{theme:t},children:e.jsx(Mr,{uniqueKey:s,handleSelector:n,windowPosition:r,disableDrag:i,children:e.jsx(v,{innerRef:g,overflow:l,position:c,gap:m,classNames:f,...u})})})},nt=a=>{const{figure:t="",gender:s="M",headOnly:n=!1,direction:r=0,scale:i=1,classNames:l=[],style:c={},...m}=a,[h,u]=o.useState(null),[g,f]=o.useState(-1),p=o.useRef(!1),x=o.useMemo(()=>{const j=["avatar-image"];return l.length&&j.push(...l),j},[l]),I=o.useMemo(()=>{let j={};return h&&h.length&&(j.backgroundImage=`url('${h}')`),i!==1&&(j.transform=`scale(${i})`,i%1||(j.imageRendering="pixelated")),Object.keys(c).length&&(j={...j,...c}),j},[h,i,c]);return o.useEffect(()=>{const j=vt().createAvatarImage(t,pc.LARGE,s,{resetFigure:b=>{p.current||f(Math.random())},dispose:()=>{},disposed:!1},null);if(!j)return;let E=eo.FULL;n&&(E=eo.HEAD),j.setDirection(E,r);const C=j.getCroppedImage(E);C&&u(C.src),j.dispose()},[t,s,r,n,g]),o.useEffect(()=>(p.current=!1,()=>{p.current=!0}),[]),e.jsx(A,{classNames:x,style:I,...m})},fh=a=>{const{imageUrl:t=null,fit:s=!0,style:n=null,...r}=a,i=o.useMemo(()=>{const l={...n};return t&&(l.background=`url(${t}) center no-repeat`),l},[n,t]);return e.jsx(A,{fit:s,style:i,...r})},mt=a=>{const{badgeCode:t=null,isGroup:s=!1,showInfo:n=!1,customTitle:r=null,isGrayscale:i=!1,scale:l=1,classNames:c=[],style:m={},children:h=null,...u}=a,[g,f]=o.useState(null),p=o.useMemo(()=>{const I=["badge-image"];return s&&I.push("group-badge"),i&&I.push("grayscale"),c.length&&I.push(...c),I},[c,s,i]),x=o.useMemo(()=>{let I={};return g&&(I.backgroundImage=`url(${s?g.src:K("badge.asset.url").replace("%badgename%",t.toString())})`,I.width=g.width,I.height=g.height,l!==1&&(I.transform=`scale(${l})`,l%1||(I.imageRendering="pixelated"),I.width=g.width*l,I.height=g.height*l)),Object.keys(m).length&&(I={...I,...m}),I},[g,l,m]);return o.useEffect(()=>{if(!t||!t.length)return;let I=!1;const j=C=>{if(C.badgeId!==t)return;const b=Cn.generateImage(new Za(C.image));b.onload=()=>f(b),I=!0,B().events.removeEventListener(cl.IMAGE_READY,j)};B().events.addEventListener(cl.IMAGE_READY,j);const E=s?B().getGroupBadgeImage(t):B().getBadgeImage(t);if(E&&!I){const C=Cn.generateImage(new Za(E));C.onload=()=>f(C)}return()=>B().events.removeEventListener(cl.IMAGE_READY,j)},[t,s]),e.jsxs(A,{classNames:p,style:x,...u,children:[n&&K("badge.descriptions.enabled",!0)&&e.jsxs(A,{className:"badge-information text-black py-1 px-2 small",children:[e.jsx("div",{className:"fw-bold mb-1",children:s?r:fi(t)}),e.jsx("div",{children:s?d("group.badgepopup.body"):Tc(t)})]}),h]})},AN=a=>{const{day:t="00",hour:s="00",minutes:n="00",seconds:r="00",classNames:i=[],children:l=null,...c}=a,m=o.useMemo(()=>{const h=["nitro-counter-time"];return i.length&&h.push(...i),h},[i]);return e.jsxs(w,{gap:1,children:[e.jsx(A,{classNames:m,...c,children:e.jsxs("div",{children:[t!="00"?t:s,t!="00"?d("countdown_clock_unit_days"):d("countdown_clock_unit_hours")]})}),e.jsx(A,{style:{marginTop:"3px"},children:":"}),e.jsx(A,{classNames:m,...c,children:e.jsxs("div",{children:[n,d("countdown_clock_unit_minutes")]})}),e.jsx(A,{style:{marginTop:"3px"},children:":"}),e.jsx(A,{classNames:m,...c,children:e.jsxs("div",{children:[r,d("countdown_clock_unit_seconds")]})}),l]})},Nt=a=>{const{type:t="",classNames:s=[],style:n={},...r}=a,i=o.useMemo(()=>{const m=["nitro-currency-icon topcurrencygen"];return s.length&&m.push(...s),m},[s]),l=o.useMemo(()=>{let m=K("currency.asset.icon.url","");return m=m.replace("%type%",t.toString()),`url(${m})`},[t]),c=o.useMemo(()=>{let m={};return m.backgroundImage=l,Object.keys(n).length&&(m={...m,...n}),m},[n,l]);return e.jsx(A,{classNames:i,style:c,...r})},Qo=a=>{const{productType:t="s",productClassId:s=-1,direction:n=2,extraData:r="",scale:i=1,style:l={},...c}=a,[m,h]=o.useState(null),u=o.useMemo(()=>{var f;let g={};return(f=m==null?void 0:m.src)!=null&&f.length&&(g.backgroundImage=`url('${m.src}')`,g.width=m.width,g.height=m.height),i!==1&&(g.transform=`scale(${i})`,i%1||(g.imageRendering="pixelated")),Object.keys(l).length&&(g={...g,...l}),g},[m,i,l]);return o.useEffect(()=>{let g=null;const f={imageReady:(p,x,I)=>{!I&&x&&(I=Cn.generateImage(x)),I.onload=()=>h(I)},imageFailed:null};switch(t.toLocaleLowerCase()){case fe.FLOOR:g=H().getFurnitureFloorImage(s,new Ot(n),64,f,0,r);break;case fe.WALL:g=H().getFurnitureWallImage(s,new Ot(n),64,f,0,r);break}if(g){const p=g.getImage();p.onload=()=>h(p)}},[t,s,n,r]),m?e.jsx(A,{classNames:["furni-image"],style:u,...c}):null},ph=a=>{const{figure:t=null,userName:s=null,message:n=null,editable:r=!1,onChange:i=null}=a;return e.jsxs(w,{overflow:"hidden",className:"nitro-gift-card text-black",children:[e.jsxs("div",{className:"d-flex align-items-center justify-content-center gift-face flex-shrink-0",children:[!s&&e.jsx("div",{className:"gift-incognito"}),t&&e.jsx("div",{className:"gift-avatar",children:e.jsx(nt,{figure:t,direction:2,headOnly:!0})})]}),e.jsx(w,{overflow:"hidden",className:"w-100 pt-4 pb-4 pe-4 ps-3",children:e.jsxs(v,{grow:!0,overflow:"auto",justifyContent:"between",children:[!r&&e.jsx(N,{textBreak:!0,className:"gift-message",children:n}),r&&i!==null&&e.jsx("textarea",{className:"gift-message h-100",maxLength:140,value:n,onChange:l=>i(l.target.value),placeholder:d("catalog.gift_wrapping_new.message_hint")}),s&&e.jsx(N,{italics:!0,textEnd:!0,className:"pe-1",children:d("catalog.gift_wrapping_new.message_from",["name"],[s])})]})})]})},v=a=>{const{size:t=0,offset:s=0,column:n=!0,gap:r=2,classNames:i=[],...l}=a,{isCssGrid:c=!1}=fC(),m=o.useMemo(()=>{const h=[];if(t){let u=`col-${t}`;c&&(u=`g-${u}`),h.push(u)}if(s){let u=`offset-${s}`;c&&(u=`g-start-${s}`),h.push(u)}return i.length&&h.push(...i),h},[t,s,c,i]);return e.jsx(w,{classNames:m,column:n,gap:r,...l})},En=a=>{const{count:t=0,position:s="absolute",classNames:n=[],children:r=null,...i}=a,l=o.useMemo(()=>{const c=["badge","border","border-black","bg-white","px-1","nitro-item-count"];return n.length&&c.push(...n),c},[n]);return e.jsxs(A,{position:"absolute",classNames:l,...i,children:[t,r]})},kr=a=>{const{value:t=0}=a,s=t.toString().split("");return e.jsx(e.Fragment,{children:s.map((n,r)=>e.jsx("i",{className:"limited-edition-number n-"+n},r))})},xh=a=>{const{uniqueNumber:t=0,uniqueSeries:s=0,classNames:n=[],children:r=null,...i}=a,l=o.useMemo(()=>{const c=["unique-compact-plate","z-index-1"];return n.length&&c.push(...n),c},[n]);return e.jsxs(A,{classNames:l,...i,children:[e.jsx("div",{children:e.jsx(kr,{value:t})}),e.jsx("div",{children:e.jsx(kr,{value:s})}),r]})},DN=a=>{const{uniqueLimitedItemsLeft:t=0,uniqueLimitedSeriesSize:s=0,classNames:n=[],...r}=a,i=o.useMemo(()=>{const l=["unique-complete-plate"];return n.length&&l.push(...n),l},[n]);return e.jsx(A,{classNames:i,...r,children:e.jsxs(v,{className:"plate-container",gap:0,children:[e.jsxs(w,{justifyContent:"between",alignItems:"center",children:[d("unique.items.left"),e.jsx("div",{children:e.jsx(kr,{value:t})})]}),e.jsxs(w,{justifyContent:"between",alignItems:"center",children:[d("unique.items.number.sold"),e.jsx("div",{children:e.jsx(kr,{value:s})})]})]})})},Ce=a=>{const{itemImage:t=void 0,itemColor:s=void 0,itemActive:n=!1,itemCount:r=1,itemCountMinimum:i=1,itemUniqueSoldout:l=!1,itemUniqueNumber:c=-2,itemUnseen:m=!1,itemHighlight:h=!1,disabled:u=!1,center:g=!0,column:f=!0,style:p={},classNames:x=[],position:I="relative",overflow:j="hidden",children:E=null,...C}=a,b=o.useMemo(()=>{const S=["layout-grid-item","border","border-2","border-muted","rounded"];return n&&S.push("active"),(l||c>0)&&S.push("unique-item"),l&&S.push("sold-out"),m&&S.push("unseen"),h&&S.push("has-highlight"),u&&S.push("disabled"),t===null&&S.push("icon","loading-icon"),x.length&&S.push(...x),S},[n,l,c,m,h,u,t,x]),_=o.useMemo(()=>{let S={...p};return t&&!(l||c>0)&&(S.backgroundImage=`url(${t})`),s&&(S.backgroundColor=s),Object.keys(p).length&&(S={...S,...p}),S},[p,t,s,l,c]);return e.jsxs(v,{center:g,pointer:!0,position:I,overflow:j,column:f,classNames:b,style:_,...C,children:[r>i&&e.jsx(En,{className:"text-black",count:r}),c>0&&e.jsxs(e.Fragment,{children:[e.jsx(A,{fit:!0,className:"unique-bg-override",style:{backgroundImage:`url(${t})`}}),e.jsx("div",{className:"position-absolute bottom-0 unique-item-counter",children:e.jsx(kr,{value:c})})]}),E]})},wn=a=>{const{imageUrl:t=null,className:s="",...n}=a;return e.jsx("img",{src:t,className:"no-select "+s,alt:"",...n})},PN=a=>{const{text:t=null}=a;return e.jsx(w,{className:"nitro-input-error-popup",alignItems:"center",justifyContent:"center",children:e.jsx(N,{className:"px-2",children:t})})},Dc=a=>{const{...t}=a;return e.jsxs(A,{classNames:["spinner-container"],...t,children:[e.jsx(A,{className:"spinner"}),e.jsx(A,{className:"spinner"}),e.jsx(A,{className:"spinner"})]})},LN=a=>{const{roomId:t=-1,textureReceiver:s=null,onClose:n=null}=a,r=o.useRef(),i=()=>{if(!r||!r.current)return null;const c=r.current.getBoundingClientRect();return new lm(Math.floor(c.x),Math.floor(c.y),Math.floor(c.width),Math.floor(c.height))},l=()=>{vn(_n.CAMERA_SHUTTER),s(H().createTextureFromRoom(t,1,i()))};return e.jsx(Mr,{handleSelector:".nitro-room-thumbnail-camera",children:e.jsxs("div",{className:"nitro-room-thumbnail-camera px-2",children:[e.jsx("div",{ref:r,className:"camera-frame"}),e.jsxs("div",{className:"d-flex align-items-end h-100 pb-2",children:[e.jsx("button",{className:"btn btn-sm btn-danger w-100 mb-1 me-2",onClick:n,children:d("cancel")}),e.jsx("button",{className:"btn btn-sm btn-success w-100 mb-1",onClick:l,children:d("navigator.thumbeditor.save")})]})]})})},Pc=a=>{const{title:t="",onClose:s=null,classNames:n=[],children:r=null,type:i=pe.DEFAULT,options:l=null,...c}=a,m=o.useMemo(()=>{const h=["nitro-alert"];return h.push("nitro-alert-"+i),n.length&&h.push(...n),h},[n,i]);return e.jsxs(ie,{classNames:m,theme:"primary-slim",...c,children:[e.jsx(re,{headerText:t,onCloseClick:s}),e.jsx(se,{grow:!0,justifyContent:"between",overflow:"hidden",className:"text-black",gap:0,children:r}),l]})},MN=a=>{const{title:t="",onClose:s=null,classNames:n=[],children:r=null,type:i=pe.DEFAULT,...l}=a,c=o.useMemo(()=>{const m=["nitro-alert","nitro-alert-credits"];return n.length&&m.push(...n),m},[n,i]);return e.jsxs(ie,{classNames:c,theme:"primary",...l,children:[e.jsx(re,{headerText:t,onCloseClick:s}),e.jsx(se,{grow:!0,justifyContent:"between",overflow:"hidden",className:"text-black",gap:0,children:r})]})},Lc=a=>{const{fadesOut:t=!0,timeoutMs:s=8e3,onClose:n=null,overflow:r="hidden",classNames:i=[],...l}=a,[c,m]=o.useState(!1),h=o.useMemo(()=>{const u=["nitro-notification-bubble","rounded"];return i.length&&u.push(...i),u},[i]);return o.useEffect(()=>(m(!0),()=>m(!1)),[]),o.useEffect(()=>{if(!t)return;const u=setTimeout(()=>{m(!1),setTimeout(()=>n(),300)},s);return()=>clearTimeout(u)},[t,s,n]),e.jsx(ar,{children:c&&e.jsx(or.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:e.jsx(w,{overflow:r,classNames:h,onClick:n,...l})})})},xn=a=>{const{figure:t="",typeId:s=-1,paletteId:n=-1,petColor:r=16777215,customParts:i=[],posture:l="std",headOnly:c=!1,direction:m=0,scale:h=1,style:u={},...g}=a,[f,p]=o.useState(null),[x,I]=o.useState(0),[j,E]=o.useState(0),C=o.useRef(!1),b=o.useMemo(()=>{let _={};return f&&f.length&&(_.backgroundImage=`url(${f})`),h!==1&&(_.transform=`scale(${h})`,h%1||(_.imageRendering="pixelated")),_.width=x,_.height=j,Object.keys(u).length&&(_={..._,...u}),_},[f,h,u,x,j]);return o.useEffect(()=>{let _=s,S=n,T=r,L=i,k=c;if(t&&t.length){const y=new ci(t);_=y.typeId,S=y.paletteId,T=y.color,L=y.customParts}_===16&&(k=!1);const R=H().getRoomObjectPetImage(_,S,T,new Ot(m*45),64,{imageReady:(y,O,F)=>{C.current||(F?(p(F.src),I(F.width),E(F.height)):O&&(p(Cn.generateImageUrl(O)),I(O.width),E(O.height)))},imageFailed:y=>{}},k,0,L,l);if(R){const y=R.getImage();y&&(p(y.src),I(y.width),E(y.height))}},[t,s,n,r,i,l,c,m]),o.useEffect(()=>(C.current=!1,()=>{C.current=!0}),[]),e.jsx(A,{classNames:["pet-image"],style:b,...g})},Mc=a=>{const{text:t="",progress:s=0,maxProgress:n=100,position:r="relative",justifyContent:i="center",classNames:l=[],children:c=null,...m}=a,h=o.useMemo(()=>{const u=["nitro-progress-bar","text-white"];return l.length&&u.push(...l),u},[l]);return e.jsxs(v,{position:r,justifyContent:i,classNames:h,...m,children:[t&&t.length>0&&e.jsx(w,{fit:!0,center:!0,position:"absolute",className:"nitro-progress-bar-text small",children:t}),e.jsx(A,{className:"nitro-progress-bar-inner",style:{width:~~((s-0)*100/(n-0)+0)+"%"}}),c]})},Uc=a=>{const{level:t=0,classNames:s=[],children:n=null,...r}=a,i=o.useMemo(()=>{const l=["nitro-rarity-level"];return s.length&&l.push(...s),l},[s]);return e.jsxs(A,{classNames:i,...r,children:[e.jsx("div",{children:t}),n]})},Jo=a=>{const{roomPreviewer:t=null,height:s=0,children:n=null}=a,[r,i]=o.useState(null),l=o.useRef(),c=m=>{t&&(m.shiftKey?t.changeRoomObjectDirection():t.changeRoomObjectState())};return o.useEffect(()=>{if(!t)return;const m=u=>{!t||!r||!l.current||(t.updatePreviewRoomView(),r.canvasUpdated&&(l.current.style.backgroundImage=`url(${Cn.generateImageUrl(r.master)})`))};if(!r&&l.current&&t){let g=document.defaultView.getComputedStyle(l.current,null).backgroundColor;g=Is.rgbStringToHex(g),g=g.replace("#","0x"),t.backgroundColor=parseInt(g,16);const f=l.current.parentElement.clientWidth;t.getRoomCanvas(f,s);const p=t.getRenderingCanvas();i(p),p.canvasUpdated=!0,m()}Wn().add(m);const h=new ResizeObserver(()=>{if(!t||!l.current)return;const u=l.current.parentElement.offsetWidth;t.modifyRoomCanvas(u,s),m()});return h.observe(l.current),()=>{h.disconnect(),Wn().remove(m)}},[r,t,l,s]),e.jsxs("div",{className:"room-preview-container",children:[e.jsx("div",{ref:l,className:"room-preview-image",style:{height:s},onClick:c}),n]})},Zo=a=>{const{roomId:t=-1,customUrl:s=null,shrink:n=!0,overflow:r="hidden",classNames:i=[],children:l=null,...c}=a,m=o.useMemo(()=>{const u=["room-thumbnail","rounded","border"];return i.length&&u.push(...i),u},[i]),h=o.useMemo(()=>s&&s.length?K("image.library.url")+s:K("thumbnails.url").replace("%thumbnail%",t.toString()),[s,t]);return e.jsxs(A,{shrink:n,overflow:r,classNames:m,...c,children:[h&&e.jsx("img",{alt:"",src:h}),l]})},jh=a=>{const{color:t="",message:s="",date:n="",senderName:r="",customTitle:i=null,onCloseClick:l=null}=a;return e.jsx(Mr,{handleSelector:".drag-handler",children:e.jsxs(v,{gap:0,alignItems:"center",className:`nitro-layout-trophy trophy-${t}`,children:[e.jsxs(w,{center:!0,fullWidth:!0,position:"relative",className:"trophy-header drag-handler",children:[e.jsx(A,{position:"absolute",pointer:!0,className:"trophy-close",onClick:l}),e.jsx(N,{bold:!0,children:d("widget.furni.trophy.title")})]}),e.jsxs(v,{className:"trophy-content py-1",gap:1,children:[i&&e.jsx(N,{bold:!0,children:i}),s]}),e.jsxs(w,{alignItems:"center",justifyContent:"between",className:"trophy-footer mt-1",children:[e.jsx(N,{bold:!0,children:n}),e.jsx(N,{bold:!0,children:r})]})]})})},Ih=a=>{const{title:t=null,onSaveSearch:s=null,onClick:n=null}=a;return e.jsx(A,{color:"white",className:"button-search-saves",pointer:!0,title:t,onClickCapture:s,onClick:n,children:e.jsx(cm,{})})},UN=a=>{const{itemImage:t=void 0,itemColor:s=void 0,itemActive:n=!1,itemCount:r=1,itemCountMinimum:i=1,itemUniqueSoldout:l=!1,itemUniqueNumber:c=-2,itemUnseen:m=!1,itemHighlight:h=!1,disabled:u=!1,center:g=!0,column:f=!0,style:p={},classNames:x=[],position:I="relative",overflow:j="hidden",children:E=null,...C}=a,b=o.useMemo(()=>{const S=["room-creator-grid-item"];return n&&S.push("active"),(l||c>0)&&S.push("unique-item"),l&&S.push("sold-out"),m&&S.push("unseen"),h&&S.push("has-highlight"),u&&S.push("disabled"),t===null&&S.push("icon","loading-icon"),x.length&&S.push(...x),S},[n,l,c,m,h,u,t,x]),_=o.useMemo(()=>{let S={...p};return t&&(S.backgroundImage=`url(${t})`),s&&(S.backgroundColor=s),Object.keys(p).length&&(S={...S,...p}),S},[p,t,s]);return e.jsxs(v,{center:g,pointer:!0,position:I,overflow:j,column:f,classNames:b,style:_,...C,children:[r>i&&e.jsx(En,{className:"text-black",count:r}),c>0&&e.jsxs(e.Fragment,{children:[e.jsx(A,{fit:!0,className:"unique-bg-override",style:{backgroundImage:`url(${t})`}}),e.jsx("div",{className:"position-absolute bottom-0 unique-item-counter",children:e.jsx(kr,{value:c})})]}),E]})},Ns=a=>{const{userId:t=0,classNames:s=[],pointer:n=!0,children:r=null,...i}=a,l=o.useMemo(()=>{const c=["nitro-friends-spritesheet","icon-profile-sm"];return s.length&&c.push(...s),c},[s]);return e.jsx(A,{classNames:l,pointer:n,onClick:c=>as(t),...i,children:r})},tn=a=>{const{isActive:t=!1,count:s=0,overflow:n="hidden",position:r="relative",pointer:i=!0,classNames:l=[],children:c=null,...m}=a,h=o.useMemo(()=>{const u=["nav-item","rounded-top","border"];return t&&u.push("active"),l.length&&u.push(...l),u},[t,l]);return e.jsxs(w,{overflow:n,pointer:i,position:r,classNames:h,...m,children:[e.jsx(w,{shrink:!0,center:!0,children:c}),s>0&&e.jsx(En,{className:"text-black",count:s})]})},Tn=a=>{const{justifyContent:t="start",gap:s=1,classNames:n=[],children:r=null,...i}=a,l=o.useMemo(()=>{const c=["container-fluid","nitro-card-tabs","pt-1","position-relative"];return n.length&&c.push(...n),c},[n]);return e.jsx(w,{justifyContent:t,gap:s,classNames:l,...i,children:r})},zt=(...a)=>a.filter(Boolean).join(" "),FN=a=>{const{classNames:t=[],...s}=a,n=o.useMemo(()=>{const r=["form-group"];return t.length&&r.push(...t),r},[t]);return e.jsx(w,{classNames:n,...s})},VN=a=>{const{variant:t="black",height:s=1,classNames:n=[],style:r={},...i}=a,l=o.useMemo(()=>{const m=[];return t&&m.push("bg-"+t),n.length&&m.push(...n),m},[t,n]),c=o.useMemo(()=>{let m={display:"list-item"};return s>0&&(m.height=s),Object.keys(r).length&&(m={...m,...r}),m},[s,r]);return e.jsx(A,{classNames:l,style:c,...i})},qn=(a,t,s,n=!0)=>{o.useEffect(()=>{if(n)return Array.isArray(a)?a.map(r=>t.addEventListener(r,s)):t.addEventListener(a,s),()=>{Array.isArray(a)?a.map(r=>t.removeEventListener(r,s)):t.removeEventListener(a,s)}},[a,t,n,s])},Ku=(a,t)=>qn(a,CC().events,t),GN=(a,t)=>qn(a,Ie().cameraManager.events,t),BN=(a,t)=>qn(a,Ie().localization.events,t),fr=(a,t)=>qn(a,Ie().events,t),ve=(a,t)=>qn(a,H().events,t),He=(a,t)=>qn(a,Pr().events,t),HN=(a,t)=>qn(a,B().events,t),xr=(a,t,s=!0)=>qn(a,Ie().soundManager.events,t,s),M=(a,t)=>{o.useEffect(()=>{const s=new a(t);return zi().registerMessageEvent(s),()=>zi().removeMessageEvent(s)},[a,t])},ot=(a,t,s=!0)=>qn(a,Nn,t,s),WN=()=>{const[a,t]=o.useState(!0),[s,n]=o.useState([]),[r,i]=o.useState(null),[l,c]=o.useState(-1),[m,h]=o.useState(0),u=o.useMemo(()=>{let E=0;return s.forEach(C=>E+=bs.getAchievementCategoryTotalUnseen(C)),E},[s]),g=o.useMemo(()=>{let E=0;return s.forEach(C=>E+=C.getProgress()),E},[s]),f=o.useMemo(()=>{let E=0;return s.forEach(C=>E+=C.getMaxProgress()),E},[s]),p=o.useMemo(()=>~~((g-0)*100/(f-0)+0),[g,f]),x=o.useMemo(()=>r===null?null:s.find(E=>E.code===r),[s,r]),I=o.useMemo(()=>l===-1||!x?null:x.achievements.find(E=>E.achievementId===l),[x,l]),j=o.useCallback((E,C)=>{n(b=>{const _=[...b];for(const S of _)if(S.code===E)for(const T of S.achievements)T.achievementId===C&&(T.unseen=0);return _})},[]);return M(cg,E=>{const b=E.getParser().achievement;n(_=>{const S=[..._],T=S.findIndex(L=>L.code===b.category);if(T===-1){const L=new wu(b.category);L.achievements.push(b),S.push(L)}else{const L=Es(S[T]),k=[...L.achievements],R=k.findIndex(O=>O.achievementId===b.achievementId);let y=null;R===-1?k.push(b):(y=k[R],k[R]=b),bs.getAchievementIsIgnored(b)||(b.unseen++,y&&(b.unseen+=y.unseen)),L.achievements=k,S[T]=L}return S})}),M(ug,E=>{const C=E.getParser(),b=[];for(const _ of C.achievements){const S=_.category;let T=b.find(L=>L.code===S);T||(T=new wu(S),b.push(T)),T.achievements.push(_)}n(b)}),M(dg,E=>{const C=E.getParser();h(C.score)}),o.useEffect(()=>{a&&(D(new mg),t(!1))},[a]),o.useEffect(()=>{!r||l===-1||j(r,l)},[r,l,j]),{achievementCategories:s,selectedCategoryCode:r,setSelectedCategoryCode:i,selectedAchievementId:l,setSelectedAchievementId:c,achievementScore:m,getTotalUnseen:u,getProgress:g,getMaxProgress:f,scaledProgressPercent:p,selectedCategory:x,selectedAchievement:I,setAchievementSeen:j}},el=()=>lt(WN),qN=()=>{const[a,t]=o.useState([]),[s,n]=o.useState([]),[r,i]=o.useState(-1),[l,c]=o.useState(10),[m,h]=o.useState(null);return GN(fg.INITIALIZED,u=>{t(Array.from(Si().effects.values()))}),M(hg,u=>{const g=u.getParser();h({credits:g.creditPrice,duckets:g.ducketPrice,publishDucketPrice:g.publishDucketPrice})}),o.useEffect(()=>{if(!Si().isLoaded){Si().init(),D(new gg);return}},[]),{availableEffects:a,cameraRoll:s,setCameraRoll:n,selectedPictureIndex:r,setSelectedPictureIndex:i,myLevel:l,price:m}},bh=()=>lt(qN),Ks=class Ks extends Rs{};Ks.SHOW_CATALOG="CE_SHOW_CATALOG",Ks.HIDE_CATALOG="CE_HIDE_CATALOG",Ks.TOGGLE_CATALOG="CE_TOGGLE_CATALOG",Ks.SOLD_OUT="CE_SOLD_OUT",Ks.APPROVE_NAME_RESULT="CE_APPROVE_NAME_RESULT",Ks.PURCHASE_APPROVED="CE_PURCHASE_APPROVED",Ks.INIT_GIFT="CE_INIT_GIFT",Ks.CATALOG_RESET="CE_RESET",Ks.CATALOG_INVISIBLE_PAGE_VISITED="CE_CATALOG_INVISIBLE_PAGE_VISITED";let Ar=Ks;class zN extends Ar{constructor(t,s,n){super(Ar.INIT_GIFT),this._pageId=t,this._offerId=s,this._extraData=n}get pageId(){return this._pageId}get offerId(){return this._offerId}get extraData(){return this._extraData}}const Do=class Do extends Ar{constructor(t){super(Do.POST_MARKETPLACE),this._item=t}get item(){return this._item}};Do.POST_MARKETPLACE="CE_POST_MARKETPLACE";let po=Do;const Po=class Po extends Rs{constructor(t){super(Po.PURCHASE_SUCCESS),this._purchase=t}get purchase(){return this._purchase}};Po.PURCHASE_SUCCESS="CPE_PURCHASE_SUCCESS";let Sn=Po;const Lo=class Lo extends Rs{constructor(t){super(Lo.PURCHASE_FAILED),this._code=t}get code(){return this._code}};Lo.PURCHASE_FAILED="CPFE_PURCHASE_FAILED";let lr=Lo;const Mo=class Mo extends Rs{constructor(t){super(Mo.NOT_ALLOWED),this._code=t}get code(){return this._code}};Mo.NOT_ALLOWED="CPNAE_NOT_ALLOWED";let ta=Mo;const It=class It extends Rs{};It.WIDGETS_INITIALIZED="CWE_CWE_WIDGETS_INITIALIZED",It.SELECT_PRODUCT="CWE_SELECT_PRODUCT",It.SET_EXTRA_PARM="CWE_CWE_SET_EXTRA_PARM",It.PURCHASE="CWE_PURCHASE",It.COLOUR_ARRAY="CWE_COLOUR_ARRAY",It.MULTI_COLOUR_ARRAY="CWE_MULTI_COLOUR_ARRAY",It.COLOUR_INDEX="CWE_COLOUR_INDEX",It.TEXT_INPUT="CWE_TEXT_INPUT",It.DROPMENU_SELECT="CWE_CWE_DROPMENU_SELECT",It.PURCHASE_OVERRIDE="CWE_PURCHASE_OVERRIDE",It.SELLABLE_PET_PALETTES="CWE_SELLABLE_PET_PALETTES",It.UPDATE_ROOM_PREVIEW="CWE_UPDATE_ROOM_PREVIEW",It.GUILD_SELECTED="CWE_GUILD_SELECTED",It.TOTAL_PRICE_WIDGET_INITIALIZED="CWE_TOTAL_PRICE_WIDGET_INITIALIZED",It.PRODUCT_OFFER_UPDATED="CWE_CWE_PRODUCT_OFFER_UPDATED",It.SET_PREVIEWER_STUFFDATA="CWE_CWE_SET_PREVIEWER_STUFFDATA",It.EXTRA_PARAM_REQUIRED_FOR_BUY="CWE_CWE_EXTRA_PARAM_REQUIRED_FOR_BUY",It.TOGGLE="CWE_CWE_TOGGLE",It.BUILDER_SUBSCRIPTION_UPDATED="CWE_CWE_BUILDER_SUBSCRIPTION_UPDATED",It.ROOM_CHANGED="CWE_CWE_ROOM_CHANGED",It.SHOW_WARNING_TEXT="CWE_CWE_SHOW_WARNING_TEXT";let Xu=It;const Uo=class Uo extends Rs{constructor(){super(Uo.SOLD_OUT)}};Uo.SOLD_OUT="CPSOE_SOLD_OUT";let sa=Uo;const Fo=class Fo extends Rs{constructor(t,s){super(Fo.UPDATE_STUFF_DATA),this._offer=t,this._stuffData=s}get offer(){return this._offer}get stuffData(){return this._stuffData}};Fo.UPDATE_STUFF_DATA="SRPSA_UPDATE_STUFF_DATA";let Qu=Fo;const Ir=class Ir extends Rs{};Ir.SHOW_GUIDE_TOOL="GTE_SHOW_GUIDE_TOOL",Ir.HIDE_GUIDE_TOOL="GTE_HIDE_GUIDE_TOOL",Ir.TOGGLE_GUIDE_TOOL="GTE_TOGGLE_GUIDE_TOOL",Ir.CREATE_HELP_REQUEST="GTE_CREATE_HELP_REQUEST",Ir.CREATE_BULLY_REQUEST="GTE_CREATE_BULLY_REQUEST";let xs=Ir;const eu=class eu extends Rs{};eu.INIT="HC_NAME_CHANGE_INIT";let na=eu;const Vo=class Vo extends Rs{constructor(t,s){super(Vo.DELETE_ITEM_CONFIRM),this._item=t,this._amount=s}get item(){return this._item}get amount(){return this._amount}};Vo.DELETE_ITEM_CONFIRM="DIC_DELETE_ITEM_CONFIRM";let xo=Vo;const Go=class Go extends Rs{constructor(t,s,n){super(Go.FURNI_ADDED),this.id=t,this.spriteId=s,this.category=n}};Go.FURNI_ADDED="IFAE_FURNI_ADDED";let ra=Go;const Gi=class Gi extends Rs{};Gi.SHOW_THUMBNAIL="NE_SHOW_THUMBNAIL",Gi.HIDE_THUMBNAIL="NE_HIDE_THUMBNAIL",Gi.TOGGLE_THUMBNAIL="NE_TOGGLE_THUMBNAIL";let gn=Gi;const Ju=a=>a&&a.length?a.replace(/\\r/g,"\r"):"",Zu=a=>{const t="0"+a;return t.substr(t.length-2,t.length)};let Ci=null;const YN=()=>{const[a,t]=o.useState([]),[s,n]=o.useState([]),[r,i]=o.useState([]),[l,c]=o.useState(!1),[m,h]=o.useState(!1),u=()=>K("notification",{}),g=R=>{const y=u();return y?y[R]:null},f=(R,y,O,F)=>{if(R.has(O))return R.get(O);const V=["notification",y,O].join(".");return Ie().localization.hasValue(V)||F?d(V,Array.from(R.keys()),Array.from(R.values())):null},p=(R,y)=>{let O=R.get("image");return O||(O=K("image.library.notifications.url","").replace("%image%",y.replace(/\./g,"_"))),d(O)},x=o.useCallback((R,y=null,O=null,F=null,V=null,Y=null)=>{(!V||!V.length)&&(V=d("notifications.broadcast.title")),(!y||!y.length)&&(y=pe.DEFAULT);const q=new mo([Ju(R)],y,O,F,V,Y);t(U=>[q,...U])},[]),I=o.useCallback(()=>x(null,pe.NITRO),[x]),j=o.useCallback((R,y,O=null,F=null)=>{if(l)return;const V=new sc(R,y,O,F);n(Y=>[V,...Y])},[l]),E=(R,y=null)=>{y||(y=new Map);const O=g("notification."+R);if(O)for(const J in O)y.set(J,O[J]);R==="floorplan_editor.error"&&y.set("message",y.get("message").replace(/[^a-zA-Z._ ]/g,""));const F=f(y,R,"title",!0),V=f(y,R,"message",!0).replace(/\\r/g,"\r"),Y=f(y,R,"linkTitle",!1),q=f(y,R,"linkUrl",!1),U=p(y,R);y.get("display")==="BUBBLE"?j(d(V),ss.INFO,U,q):x(d(V),R,q,Y,F,U),y.get("sound")&&vn(y.get("sound"))},C=o.useCallback((R,y,O,F=null,V=null,Y=null,q=null)=>{(!F||!F.length)&&(F=d("generic.confirm")),(!V||!V.length)&&(V=d("generic.cancel")),(!Y||!Y.length)&&(Y=d("notifications.broadcast.title"));const U=new nc(q,R,y,O,F,V,Y);i(J=>[U,...J])},[]),b=(R,y=null,O=!0)=>{x(R,pe.DEFAULT,y,d("mod.alert.link"),d("mod.alert.title"))},_=o.useCallback((R,y="")=>{switch(R){case us.ALERT_SCAM:x(d("inventory.trading.warning.other_not_offering"),null,null,null,d("inventory.trading.notification.title"));return;case us.HOTEL_TRADING_DISABLED:case us.YOU_NOT_ALLOWED:case us.THEY_NOT_ALLOWED:case us.ROOM_DISABLED:case us.YOU_OPEN:case us.THEY_OPEN:x(d(`inventory.trading.openfail.${R}`,["otherusername"],[y]),null,null,null,d("inventory.trading.openfail.title"));return;case us.ERROR_WHILE_COMMIT:x(`${d("inventory.trading.notification.caption")}, ${d("inventory.trading.notification.commiterror.info")}`,null,null,null,d("inventory.trading.notification.title"));return;case us.THEY_CANCELLED:x(d("inventory.trading.info.closed"),null,null,null,d("inventory.trading.notification.title"));return}},[x]),S=o.useCallback(R=>{t(y=>{const O=[...y],F=O.findIndex(V=>R===V);return F>=0&&O.splice(F,1),O})},[]),T=o.useCallback(R=>{n(y=>{const O=[...y],F=O.findIndex(V=>R===V);return F>=0&&O.splice(F,1),O})},[]),L=o.useCallback(R=>{i(y=>{const O=[...y],F=O.findIndex(V=>R===V);return F>=0&&O.splice(F,1),O})},[]);M(pg,R=>{const y=R.getParser();if(y.userId!==B().userId)return;const O=d("notifications.text.respect.1"),F=d("notifications.text.respect.2",["count"],[y.respectsReceived.toString()]);j(O,ss.RESPECT),j(F,ss.RESPECT)}),M(xg,R=>{const y=R.getParser();x(y.message.replace(/\\r/g,"\r"),null,null,d("notifications.broadcast.title"))}),M(jg,R=>{const y=R.getParser(),O=d("achievements.levelup.desc"),F=fi(y.data.badgeCode),V=B().getBadgeUrl(y.data.badgeCode),Y="questengine/achievements/"+y.data.category;j(O+" "+F,ss.ACHIEVEMENT,V,Y)}),M(Ig,R=>{const y=R.getParser();y.numGifts<=0||j(y.numGifts.toString(),ss.CLUBGIFT,null,"catalog/open/"+K("catalog.links")["hc.hc_gifts"])}),M(bg,R=>{const y=R.getParser();b(y.message,y.url,!1)}),M(um,R=>{const y=R.getParser();if(y.amountChanged<=0||y.type!==5)return;const O=K("currency.asset.icon.url","").replace("%type%",y.type.toString());j(d("notifications.text.loyalty.received",["AMOUNT"],[y.amountChanged.toString()]),ss.INFO,O)}),M(Eg,R=>{const y=R.getParser();b(y.message)}),M(Cg,R=>{const y=R.getParser();x(d("opening.hours."+(y.userThrowOutAtClose?"disconnected":"closed"),["h","m"],[Zu(y.openHour),Zu(y.openMinute)]),pe.DEFAULT,null,null,d("opening.hours.title"))}),M(Ng,R=>{const y=R.getParser(),O=d("notifications.text."+(y.boughtAsGift?"petbought":"petreceived"));let F=null;const V=H().getRoomObjectPetImage(y.pet.typeId,y.pet.paletteId,parseInt(y.pet.color,16),new Ot(45*3),64,null,!0);V&&(F=V.getImage().src),j(O,ss.PETLEVEL,F)}),M(vg,R=>{const O=R.getParser().messages.map(V=>Ju(V)),F=new mo(O,pe.MOTD,null,null,d("notifications.motd.title"));t(V=>[F,...V])}),M(_g,R=>{const y=R.getParser();let O=null;const F=H().getRoomObjectPetImage(y.figureData.typeId,y.figureData.paletteId,parseInt(y.figureData.color,16),new Ot(45*3),64,null,!0);F&&(O=F.getImage().src),j(d("notifications.text.petlevel",["pet_name","level"],[y.petName,y.level.toString()]),ss.PETLEVEL,O)}),M(Sg,R=>{const y=R.getParser();c(!y.enabled)}),M(wg,R=>{const y=R.getParser();if(!y.products||!y.products.length)return;const O=y.products[0];O&&j(d("notifications.text.club_gift.selected"),ss.INFO,Qa.getProductImageUrl(O.productType,O.furniClassId,O.extraParam))}),M(Tg,R=>{const y=R.getParser();x(d("maintenance.shutdown",["m","d"],[y.minutesUntilMaintenance.toString(),y.duration.toString()]),pe.DEFAULT,null,null,d("opening.hours.title"))}),M(yg,R=>{const y=R.getParser();b(y.message,y.url)}),M(Rg,R=>{const y=R.getParser();E(y.type,y.parameters)}),M(Og,R=>{const y=R.getParser();x(d("opening.hours.shutdown",["m"],[y.openMinute.toString()]),pe.DEFAULT,null,null,d("opening.hours.title"))}),M(kg,R=>{const y=R.getParser();x(d("opening.hours.disconnected",["h","m"],[y.openHour.toString(),y.openMinute.toString()]),pe.DEFAULT,null,null,d("opening.hours.title"))}),M(Ag,R=>{const y=R.getParser();switch(y.errorCode){default:case 0:x(d("connection.server.error.desc",["errorCode"],[y.errorCode.toString()]),pe.ALERT,null,null,d("connection.server.error.title"));break;case 1001:case 1002:case 1003:case 1004:case 1005:case 1006:case 1007:case 1008:case 1009:case 1010:case 1011:case 1012:case 1013:case 1014:case 1015:case 1016:case 1017:case 1018:case 1019:R.connection.dispose();break;case 4013:x(d("connection.room.maintenance.desc"),pe.ALERT,null,null,d("connection.room.maintenance.title"));break}}),M(Dg,R=>{const y=R.getParser();x(d(y.alertMessage),pe.DEFAULT,null,null,d(y.titleMessage?y.titleMessage:"notifications.broadcast.title"))});const k=o.useCallback(()=>{if(!m)if(ql.isRunning()){if(Ci)return;Ci=setTimeout(()=>{k()},ql.totalRunningTime+5e3)}else Ci&&(clearTimeout(Ci),Ci=null),j(d("mod.chatdisclaimer"),ss.INFO),h(!0)},[m,j]);return M(Pg,k),{alerts:a,bubbleAlerts:s,confirms:r,simpleAlert:x,showNitroAlert:I,showTradeAlert:_,showConfirm:C,showSingleBubble:j,closeAlert:S,closeBubbleAlert:T,closeConfirm:L}},Fe=()=>lt(YN),ed=new URLSearchParams(window.location.search).get("userid")||0,$N=(a,t)=>{a=ed?`${a}.${ed}`:a;const[s,n]=o.useState(()=>{try{return(typeof window<"u"?$o(a):void 0)??t}catch{return t}});return[s,i=>{try{const l=i instanceof Function?i(s):i;n(l),typeof window<"u"&&Oc(a,l)}catch(l){dm.error(l)}}]},In=$N,KN=()=>In(Qi.CATALOG_PLACE_MULTIPLE_OBJECTS,!1),Eh=()=>lt(KN),XN=()=>In(Qi.CATALOG_SKIP_PURCHASE_CONFIRMATION,!1),Ch=()=>lt(XN),QN=-12345678,JN=()=>{const[a,t]=o.useState(!1),[s,n]=o.useState(!1),[r,i]=o.useState(-1),[l,c]=o.useState(-1),[m,h]=o.useState(Gs.NORMAL),[u,g]=o.useState(null),[f,p]=o.useState(null),[x,I]=o.useState(null),[j,E]=o.useState(null),[C,b]=o.useState([]),[_,S]=o.useState(null),[T,L]=o.useState([]),[k,R]=o.useState(null),[y,O]=o.useState(!1),[F,V]=o.useState({quantity:1,extraData:null,extraParamRequired:!1,previewStuffData:null}),[Y,q]=o.useState({}),[U,J]=o.useState(!1),[je,we]=Eh(),[pt,Xt]=Ch(),[Oe,kt]=o.useState(null),[Re,Qt]=o.useState(null),[me,he]=o.useState(0),[le,Ae]=o.useState(0),[Ht,os]=o.useState(0),[nn,$n]=o.useState(0),[_s,Rn]=o.useState(0),[Te,Ke]=o.useState(0),{simpleAlert:rt=null}=Fe(),Jt=o.useRef(new pr),fs=o.useCallback(()=>{i(-1),c(-1),g(null),p(null),I(null),E(null),b([]),S(null),L([]),t(!1)},[]),xi=o.useCallback(G=>{if(!G)return Mn.MISSING_OFFER;if(me<0||me>=le)return Mn.FURNI_LIMIT_REACHED;const z=ye();if(!z)return Mn.NOT_IN_ROOM;if(!z.isRoomOwner)return Mn.NOT_ROOM_OWNER;if(nn<=0){const Q=H();let oe=Q.getRoomObjectCount(z.roomId,X.UNIT);for(;oe>0;){const Ee=Q.getRoomObjectByIndex(z.roomId,oe,X.UNIT),Me=z.userDataManager.getUserDataByIndex(Ee.id);if(Me&&Me.type===dt.USER&&Me.roomIndex!==z.ownRoomIndex&&!Me.isModerator)return Mn.VISITORS_IN_ROOM;oe--}}return Mn.OKAY},[me,le,nn]),ji=o.useCallback(G=>{const z=ye();return!!((z&&G.page&&G.page.layoutCode!=="sold_ltd_items"&&m===Gs.NORMAL&&(z.isRoomOwner||z.isGuildRoom&&z.controllerLevel>=$e.GUILD_MEMBER)||m===Gs.BUILDER&&xi(G)===Mn.OKAY)&&G.pricingModel!==Gt.PRICING_MODEL_BUNDLE&&G.product.productType!==fe.EFFECT&&G.product.productType!==fe.HABBO_CLUB)},[m,xi]),Fr=o.useCallback(G=>{if(!ji(G))return;const z=G.product;if(!z)return;let Q=0;switch(z.productType){case fe.FLOOR:Q=X.FLOOR;break;case fe.WALL:Q=X.WALL;break}H().processRoomObjectPlacement(Bi.CATALOG,-G.offerId,Q,z.productClassId,z.extraParam)&&(kt(G),J(!0),t(!1))},[ji]),Ii=o.useCallback((G,z)=>{const Q=H();let oe=Q.getRoomInstanceVariable(Q.activeRoomId,te.ROOM_WALL_TYPE),Ee=Q.getRoomInstanceVariable(Q.activeRoomId,te.ROOM_FLOOR_TYPE),Me=Q.getRoomInstanceVariable(Q.activeRoomId,te.ROOM_LANDSCAPE_TYPE);switch(oe=oe&&oe.length?oe:"101",Ee=Ee&&Ee.length?Ee:"101",Me=Me&&Me.length?Me:"1.1",G){case"floor":Q.updateRoomInstancePlaneType(Q.activeRoomId,z,oe,Me,!0);return;case"wallpaper":Q.updateRoomInstancePlaneType(Q.activeRoomId,Ee,z,Me,!0);return;case"landscape":Q.updateRoomInstancePlaneType(Q.activeRoomId,Ee,oe,z,!0);return;default:Q.updateRoomInstancePlaneType(Q.activeRoomId,Ee,oe,Me,!0);return}},[]),On=o.useCallback(()=>{Oe&&(H().cancelRoomObjectInsert(),J(!1),kt(null))},[Oe]),Vr=o.useCallback((G=!0)=>{J(z=>(z&&G&&Z("catalog/open"),!1))},[]),pa=o.useCallback((G=!1)=>{G||Vr(),Qt(z=>{if(z)switch(z.category){case X.FLOOR:H().removeRoomObjectFloor(z.roomId,z.objectId);break;case X.WALL:{switch(z.furniData.className){case"floor":case"wallpaper":case"landscape":Ii("reset","");break;default:H().removeRoomObjectWall(z.roomId,z.objectId);break}break}default:H().deleteRoomObject(z.objectId,z.category);break}return null})},[Vr,Ii]),Gr=o.useCallback((G,z)=>{if(z.pageId===G&&z!==u)return z;for(const Q of z.children){const oe=Gr(G,Q);if(oe)return oe}return null},[u]),mr=o.useCallback((G,z)=>{if(z.pageName===G&&z!==u)return z;for(const Q of z.children){const oe=mr(G,Q);if(oe)return oe}return null},[u]),rn=o.useCallback((G,z=!1)=>{if(!f||!f.size)return null;if(z){const Q=[],oe=f.get(G);if(oe&&oe.length)for(const Ee of oe)Ee.isVisible&&Q.push(Ee);if(Q.length)return Q}return f.get(G)},[f]),xa=o.useCallback((G,z)=>{G<0||(n(!0),i(G),G>-1&&D(new Lg(G,z,m)))},[m]),ae=o.useCallback((G,z,Q,oe,Ee,Me)=>{const jt=new ao(G,z,Q,oe,Me);if(I(jt),c(xe=>G!==-1?G:xe),O(!1),Ee>-1&&jt.offers.length){for(const xe of jt.offers)if(xe.offerId===Ee){E(xe);break}}},[]),ee=o.useCallback((G,z=-1)=>{if(On(),G.parent.pageName==="root"&&G.children.length){for(const Ee of G.children)if(Ee.isVisible){G=Ee;break}}const Q=[];let oe=G;for(;oe&&oe.pageName!=="root";)Q.push(oe),oe=oe.parent;Q.reverse(),b(Ee=>{const Me=Ee.indexOf(G)>=0,jt=G.isOpen;for(const xe of Ee)xe.deactivate(),Q.indexOf(xe)===-1&&xe.close();for(const xe of Q)xe.activate(),xe.parent&&xe.open(),xe===G.parent&&xe.children.length&&xe.open();return Me&&jt?G.close():G.open(),Q}),G.pageId>-1&&xa(G.pageId,z)},[b,xa,On]),ge=o.useCallback(G=>{if(G!==-1&&S(null),!a)Jt.current.requestById=G,t(!0);else{const z=Gr(G,u);z&&ee(z)}},[a,u,Gr,ee]),qe=o.useCallback(G=>{if(S(null),!a)Jt.current.requestByName=G,t(!0);else{const z=mr(G,u);z&&ee(z)}},[a,u,mr,ee]),Ue=o.useCallback(G=>{if(S(null),!a)Jt.current.requestedByOfferId=G,t(!0);else{const z=rn(G);if(!z||!z.length)return;ee(z[0],G)}},[a,rn,ee]),yt=o.useCallback(()=>{},[]);return M(Mg,G=>{const z=G.getParser(),Q=new Map,oe=(Ee,Me,jt)=>{const xe=new vC(Ee,Me,jt);for(const ls of xe.offerIds)Q.has(ls)?Q.get(ls).push(xe):Q.set(ls,[xe]);Me++;for(const ls of Ee.children)xe.addChild(oe(ls,Me,xe));return xe};g(oe(z.root,0,null)),p(Q)}),M(Ug,G=>{const z=G.getParser();if(z.catalogType!==m)return;const Q=[];for(const oe of z.offers){const Ee=[],Me=oi(oe.localizationId);for(const xe of oe.products){const ls=Xl(xe.furniClassId,xe.productType);Ee.push(new ir(xe.productType,xe.furniClassId,xe.extraParam,xe.productCount,Me,ls,xe.uniqueLimitedItem,xe.uniqueLimitedSeriesSize,xe.uniqueLimitedItemsLeft))}if(!Ee.length)continue;const jt=new Gt(oe.offerId,oe.localizationId,oe.rent,oe.priceCredits,oe.priceActivityPoints,oe.priceActivityPointsType,oe.giftable,oe.clubLevel,Ee,oe.bundlePurchaseAllowed);(m===Gs.NORMAL||jt.pricingModel!==Gt.PRICING_MODEL_BUNDLE&&jt.pricingModel!==Gt.PRICING_MODEL_MULTI)&&Q.push(jt)}z.frontPageItems&&z.frontPageItems.length&&L(z.frontPageItems),n(!1),r===z.pageId&&ae(z.pageId,z.layoutCode,new eh(z.localization.images.concat(),z.localization.texts.concat()),Q,z.offerId,z.acceptSeasonCurrencyAsCredits)}),M(Fg,G=>{const z=G.getParser();Ct(new Sn(z.offer))}),M(Vg,G=>{const z=G.getParser();Ct(new lr(z.code))}),M(Gg,G=>{const z=G.getParser();Ct(new ta(z.code))}),M(Bg,G=>{G.getParser(),Ct(new sa)}),M(Hg,G=>{const Q=G.getParser().offer;if(!Q||!Q.products.length)return;Q.products[0].uniqueLimitedItem;const Ee=[],Me=oi(Q.localizationId);for(const xe of Q.products){const ls=Xl(xe.furniClassId,xe.productType);Ee.push(new ir(xe.productType,xe.furniClassId,xe.extraParam,xe.productCount,Me,ls,xe.uniqueLimitedItem,xe.uniqueLimitedSeriesSize,xe.uniqueLimitedItemsLeft))}const jt=new Gt(Q.offerId,Q.localizationId,Q.rent,Q.priceCredits,Q.priceActivityPoints,Q.priceActivityPointsType,Q.giftable,Q.clubLevel,Ee,Q.bundlePurchaseAllowed);(m===Gs.NORMAL||jt.pricingModel!==Gt.PRICING_MODEL_BUNDLE&&jt.pricingModel!==Gt.PRICING_MODEL_MULTI)&&(jt.page=x,E(jt),jt.product&&jt.product.productType===fe.WALL&&V(xe=>{const ls={...xe};return ls.extraData=jt.product.extraParam||null,ls}))}),M(Wg,G=>{const z=G.getParser(),Q=new _C(z.productCode,z.palettes.slice());q(oe=>{const Ee=[];oe.petPalettes&&Ee.push(...oe.petPalettes);for(let Me=0;Me{const z=G.getParser();q(Q=>{const oe=z.offers;return{...Q,clubOffers:oe}})}),M(zg,G=>{const z=G.getParser();q(Q=>{const oe=z.groups;return{...Q,groups:oe}})}),M(Yg,G=>{const z=G.getParser();q(Q=>{const oe=new kC(z);return{...Q,giftConfiguration:oe}})}),M($g,G=>{const z=G.getParser();if(!z)return;let Q="";z.result===1?Q=d("inventory.marketplace.result.title.success"):Q=d("inventory.marketplace.result.title.failure");const oe=d(`inventory.marketplace.result.${z.result}`);rt(oe,pe.DEFAULT,null,null,Q)}),M(mm,G=>{const z=G.getParser();q(Q=>({...Q,clubGifts:z}))}),M(Kg,G=>{const z=a;fs(),z&&rt(d("catalog.alert.published.description"),pe.ALERT,null,null,d("catalog.alert.published.title"))}),M(Xg,G=>{const z=G.getParser();he(z.furniCount),yt()}),M(Qg,G=>{const z=G.getParser();Ae(z.furniLimit),os(z.maxFurniLimit),$n(z.secondsLeft),Rn(Ms()),Ke(z.secondsLeftWithGrace),yt()}),ot(Sn.PURCHASE_SUCCESS,G=>vn(_n.CREDITS)),ve(su.PLACED,G=>{if(!U||G.type!==su.PLACED)return;if(pa(!0),!Oe){Vr();return}let z=!1;const Q=Oe.product;if(G.category===X.WALL)switch(Q.furnitureData.className){case"floor":case"wallpaper":case"landscape":z=G.placedOnFloor||G.placedOnWall;break;default:z=G.placedInRoom;break}else z=G.placedInRoom;if(!z){Vr();return}switch(Qt(new AC(G.roomId,G.objectId,G.category,G.wallLocation,G.x,G.y,G.direction,Oe)),m){case Gs.NORMAL:{switch(G.category){case X.FLOOR:H().addFurnitureFloor(G.roomId,G.objectId,Q.productClassId,new Ot(G.x,G.y,G.z),new Ot(G.direction),0,new ef);break;case X.WALL:switch(Q.furnitureData.className){case"floor":case"wallpaper":case"landscape":Ii(Q.furnitureData.className,Q.extraParam);break;default:H().addFurnitureWall(G.roomId,G.objectId,Q.productClassId,new Ot(G.x,G.y,G.z),new Ot(G.direction*45),0,G.instanceData,0);break}}const oe=H().getRoomObject(G.roomId,G.objectId,G.category);oe&&oe.model.setValue(te.FURNITURE_ALPHA_MULTIPLIER,.5),pt&&D(new Ho(r,Oe.offerId,Q.extraParam,1)),je&&Fr(Oe);break}case Gs.BUILDER:{let oe=Oe.page.pageId;switch(oe===QN&&(oe=-1),G.category){case X.FLOOR:D(new Zg(oe,Oe.offerId,Q.extraParam,G.x,G.y,G.direction));break;case X.WALL:D(new Jg(oe,Oe.offerId,Q.extraParam,G.wallLocation));break}je&&Fr(Oe);break}}}),ot(ra.FURNI_ADDED,G=>{const z=H();if(!(!Re||Re.productClassId!==G.spriteId||Re.roomId!==z.activeRoomId)){switch(G.category){case de.FLOOR:{const Q=z.getRoomInstanceVariable(z.activeRoomId,te.ROOM_FLOOR_TYPE);Re.extraParam!==Q&&D(new Xa(G.id));break}case de.WALL_PAPER:{const Q=z.getRoomInstanceVariable(z.activeRoomId,te.ROOM_WALL_TYPE);Re.extraParam!==Q&&D(new Xa(G.id));break}case de.LANDSCAPE:{const Q=z.getRoomInstanceVariable(z.activeRoomId,te.ROOM_LANDSCAPE_TYPE);Re.extraParam!==Q&&D(new Xa(G.id));break}default:D(new tf(G.id,Re.category,Re.wallLocation,Re.x,Re.y,Re.direction))}je||pa()}}),o.useEffect(()=>()=>E(null),[x]),o.useEffect(()=>{if(!(!a||!u||!f||!Jt.current))switch(Jt.current.requestType){case pr.REQUEST_TYPE_NONE:if(x)return;if(u.isBranch){for(const G of u.children)if(G&&G.isVisible){ee(G);return}}return;case pr.REQUEST_TYPE_ID:ge(Jt.current.requestById),Jt.current.resetRequest();return;case pr.REQUEST_TYPE_OFFER:Ue(Jt.current.requestedByOfferId),Jt.current.resetRequest();return;case pr.REQUEST_TYPE_NAME:qe(Jt.current.requestByName),Jt.current.resetRequest();return}},[a,u,f,x,ee,ge,Ue,qe]),o.useEffect(()=>{!_&&x&&x.pageId===-1&&ge(l)},[_,x,l,ge]),o.useEffect(()=>{j&&V({quantity:1,extraData:null,extraParamRequired:!1,previewStuffData:null})},[j]),o.useEffect(()=>{!a||u||(D(new sf),D(new hm),D(new nf(m)),D(new rf))},[a,u,m]),o.useEffect(()=>(R(new so(H(),++so.PREVIEW_COUNTER)),()=>{R(G=>(G.dispose(),null))}),[]),{isVisible:a,setIsVisible:t,isBusy:s,pageId:r,previousPageId:l,currentType:m,rootNode:u,offersToNodes:f,currentPage:x,setCurrentPage:I,currentOffer:j,setCurrentOffer:E,activeNodes:C,searchResult:_,setSearchResult:S,frontPageItems:T,roomPreviewer:k,navigationHidden:y,setNavigationHidden:O,purchaseOptions:F,setPurchaseOptions:V,catalogOptions:Y,setCatalogOptions:q,getNodeById:Gr,getNodeByName:mr,activateNode:ee,openPageById:ge,openPageByName:qe,openPageByOfferId:Ue,requestOfferToMover:Fr}},Le=()=>lt(JN),ZN=1e3,ev=10,tv=1e3;let td=0,sv=0;const nv=()=>{const[a,t]=In("chatHistory",[]),[s,n]=In("roomHistory",[]),[r,i]=In("messengerHistory",[]),[l,c]=In("needsRoomInsert",!1),m=f=>{f.id=td++,t(p=>{const x=[...p];return x.push(f),x.length>ZN&&x.shift(),x})},h=f=>{n(p=>{const x=[...p];return x.push(f),x.length>ev&&x.shift(),x})},u=f=>{f.id=sv++,i(p=>{const x=[...p];return x.push(f),x.length>tv&&x.shift(),x})},g=()=>{t([]),td=0};return He(Pt.STARTED,f=>c(!0)),M(gi,f=>{if(!l)return;const p=f.getParser();s.length&&s[s.length-1].id===p.data.roomId||(m({id:-1,webId:-1,entityId:-1,name:p.data.roomName,timestamp:lh(),type:en.TYPE_ROOM_INFO,roomId:p.data.roomId}),h({id:p.data.roomId,name:p.data.roomName}),c(!1))}),M(gm,f=>{const p=f.getParser();u({id:-1,webId:p.senderId,entityId:-1,name:"",message:p.messageText,roomId:-1,timestamp:Pu(p.secondsSinceSent),type:en.TYPE_IM})}),M(fm,f=>{const p=f.getParser();u({id:-1,webId:p.senderId,entityId:-1,name:"",message:p.messageText,roomId:-1,timestamp:Pu(),type:en.TYPE_IM})}),{addChatEntry:m,chatHistory:a,roomHistory:s,messengerHistory:r,clearChatHistory:g}},ma=()=>lt(nv),rv=()=>{const[a,t]=o.useState([]),[s,n]=o.useState([]),[r,i]=o.useState([]),[l,c]=o.useState([]),[m,h]=o.useState(null),{simpleAlert:u}=Fe(),g=o.useMemo(()=>{const b=a.filter(_=>_.online);return b.sort((_,S)=>_.nameS.name?1:0),b},[a]),f=o.useMemo(()=>{const b=a.filter(_=>!_.online);return b.sort((_,S)=>_.nameS.name?1:0),b},[a]),p=b=>D(new xc(b.id)),x=(b,_)=>_!==b.relationshipStatus&&D(new Ni(b.id,_)),I=b=>{for(const _ of a)if(_.id===b)return _;return null},j=b=>!(b===B().userId||I(b)||s.find(_=>_.requesterUserId===b)||r.indexOf(b)>=0),E=(b,_)=>{if(!j(b))return!1;i(S=>{const T=[...S];return T.push(b),T}),D(new pm(_))},C=(b,_)=>{b===-1&&!_?(D(new nu(!0)),n([])):n(S=>{const T=[...S],L=T.findIndex(k=>k.id===b);return L===-1?S:(D(_?new ff(T[L].id):new nu(!1,T[L].id)),T.splice(L,1),T)})};return M(of,b=>{const _=b.getParser();h(new dN(_.userFriendLimit,_.normalFriendLimit,_.extendedFriendLimit,_.categories)),D(new af)}),M(lf,b=>{const _=b.getParser();t(S=>{const T=[...S];for(const L of _.fragment){const k=T.findIndex(y=>y.id===L.id),R=new ds;R.populate(L),k>-1?T[k]=R:T.push(R)}return T})}),M(cf,b=>{const _=b.getParser();t(S=>{const T=[...S],L=k=>{const R=T.findIndex(y=>y.id===k.id);if(R===-1){const y=new ds;y.populate(k),T.unshift(y)}else T[R].populate(k)};for(const k of _.addedFriends)L(k);for(const k of _.updatedFriends)L(k);for(const k of _.removedFriendIds){const R=T.findIndex(y=>y.id===k);R>-1&&T.splice(R,1)}return T})}),M(uf,b=>{const _=b.getParser();n(S=>{const T=[...S];for(const L of _.requests){const k=T.findIndex(R=>R.requesterUserId===L.requesterUserId);if(k>=0)T[k]=Es(T[k]),T[k].populate(L);else{const R=new Lu;R.populate(L),T.push(R)}}return T})}),M(df,b=>{const S=b.getParser().request;n(T=>{const L=[...T];if(L.findIndex(R=>R.requesterUserId===S.requesterUserId)===-1){const R=new Lu;R.populate(S),L.push(R)}return L})}),M(mf,b=>{const _=b.getParser();_&&u(d(_.success?"friendbar.find.success.text":"friendbar.find.error.text"),"","","",d(_.success?"friendbar.find.success.title":"friendbar.find.error.title"))}),o.useEffect(()=>{D(new hf);const b=window.setInterval(()=>D(new gf),12e4);return()=>{clearInterval(b)}},[]),{friends:a,requests:s,sentRequests:r,dismissedRequestIds:l,setDismissedRequestIds:c,settings:m,onlineFriends:g,offlineFriends:f,getFriend:I,canRequestFriend:j,requestFriend:E,requestResponse:C,followFriend:p,updateRelationship:x}},hs=()=>lt(rv),iv=()=>{const[a,t]=o.useState([]),[s,n]=o.useState(-1),[r,i]=o.useState([]),[l,c]=o.useState(jn.HIDDEN),{getFriend:m=null}=hs(),{simpleAlert:h=null}=Fe(),u=o.useMemo(()=>a.filter(I=>r.indexOf(I.threadId)===-1),[a,r]),g=o.useMemo(()=>s>0&&u.find(I=>I.threadId===s||null),[s,u]),f=I=>{let j=a.find(E=>E.participant&&E.participant.id===I);if(j){const E=r.indexOf(j.threadId);E>=0&&i(C=>{const b=[...C];return b.splice(E,1),b})}else{const E=m(I);if(!E)return null;j=new tc(E),j.addMessage(null,d("messenger.moderationinfo"),0,null,Bn.SECURITY_NOTIFICATION),j.setRead(),t(C=>{const b=[...C];return b.push(j),b})}return j},p=I=>{i(j=>{const E=[...j];return E.indexOf(I)>=0?j:(E.push(I),E)}),s===I&&n(-1)},x=(I,j,E,C=0,b=null,_=Bn.CHAT)=>{if(!I||!E||!E.length)return;const S=j===B().userId;S&&E.length<=255&&D(new xf(I.participant.id,E)),t(T=>{const L=[...T],k=L.findIndex(R=>R.threadId===I.threadId);return k===-1?T:(I=Es(L[k]),S&&I.groups.length===1&&vn(_n.MESSENGER_NEW_THREAD),I.addMessage(_===Bn.ROOM_INVITE?null:j,E,C,b,_),s===I.threadId&&I.setRead(),L[k]=I,!S&&I.unread&&vn(_n.MESSENGER_MESSAGE_RECEIVED),L)})};return M(gm,I=>{const j=I.getParser(),E=f(j.senderId);E&&x(E,j.senderId,j.messageText,j.secondsSinceSent,j.extraData)}),M(fm,I=>{const j=I.getParser(),E=f(j.senderId);E&&x(E,j.senderId,j.messageText,0,null,Bn.ROOM_INVITE)}),M(pf,I=>{const j=I.getParser();h(`Received room invite error: ${j.errorCode},recipients: ${j.failedRecipients}`,pe.DEFAULT,null,null,d("friendlist.alert.title"))}),o.useEffect(()=>{s<=0||t(I=>{const j=[...I],E=j.findIndex(C=>C.threadId===s);return E>=0&&(j[E]=Es(j[E]),j[E].setRead()),j})},[s]),o.useEffect(()=>{c(I=>{if(!u.length)return jn.HIDDEN;let j=!1;for(const E of u)if(E.unreadCount>0){j=!0;break}return j?jn.UNREAD:jn.SHOW})},[u]),{messageThreads:a,activeThread:g,iconState:l,visibleThreads:u,getMessageThread:f,setActiveThreadId:n,closeThread:p,sendMessage:x}},Nh=()=>lt(iv),av=()=>{const[a,t]=o.useState(!1),[s,n]=o.useState(null),[r,i]=o.useState(null),[l,c]=o.useState(null),[m,h]=o.useState(!1),[u,g]=o.useState(null);return M(jf,f=>{let p=f.getParser();!p||p&&!p.games.length||(i(p.games[0]),n(p.games))}),M(If,f=>{let p=f.getParser();p&&c(p)}),M(bf,f=>{let p=f.getParser();p&&h(p.isInMaintenance)}),M(Ef,f=>{let p=f.getParser();if(p)switch(p.gameTypeId){case 2:return console.log("snowwar");default:return g(p.url)}}),o.useEffect(()=>{a&&(D(new Cf),_c())},[a]),{isVisible:a,setIsVisible:t,games:s,accountStatus:l,selectedGame:r,setSelectedGame:i,gameOffline:m,gameURL:u,setGameURL:g}},tl=()=>lt(av),ov=()=>{const[a,t]=o.useState(null);return M(Nf,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 i=(l,c)=>l.idc.id?1:0;r.badgeBases.sort(i),r.badgeSymbols.sort(i),r.badgePartColors.sort(i),r.groupColorsA.sort(i),r.groupColorsB.sort(i),t(r)}),o.useEffect(()=>{D(new vf)},[]),{groupCustomize:a}},ha=()=>lt(ov),lv=()=>{const[a,t]=o.useState(null),[s,n]=o.useState(null),{simpleAlert:r=null,showConfirm:i=null}=Fe(),l=(c,m)=>{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 tt.BULLY:case tt.EMERGENCY:case tt.IM:h.reportedUserId=m.reportedUserId,h.currentStep=Kt.SELECT_CHATS;break;case tt.ROOM:h.roomId=m.roomId,h.roomName=m.roomName,h.currentStep=Kt.SELECT_TOPICS;break;case tt.THREAD:h.groupId=m.groupId,h.threadId=m.threadId,h.currentStep=Kt.SELECT_TOPICS;break;case tt.MESSAGE:h.groupId=m.groupId,h.threadId=m.threadId,h.messageId=m.messageId,h.currentStep=Kt.SELECT_TOPICS;break;case tt.PHOTO:h.extraData=m.extraData,h.roomId=m.roomId,h.reportedUserId=m.reportedUserId,h.roomObjectId=m.roomObjectId,h.currentStep=Kt.SELECT_TOPICS;break}t(h)};return M(Sf,c=>{const m=c.getParser();let h=m.messageText;switch(m.resultType){case uo.TOO_MANY_PENDING_CALLS_CODE:D(new _f),r(d("help.cfh.error.pending"),pe.MODERATION,null,null,d("help.cfh.error.title"));break;case uo.HAS_ABUSIVE_CALL_CODE:r(d("help.cfh.error.abusive"),pe.MODERATION,null,null,d("help.cfh.error.title"));break;default:h.trim().length===0&&(h=d("help.cfh.sent.text")),r(h,pe.MODERATION,null,null,d("help.cfh.sent.title"))}}),M(wf,c=>{const m=c.getParser(),h=m.messageText.length===0?d("help.cfh.closed."+jN(m.closeReason)):m.messageText;r(h,pe.MODERATION,null,null,d("mod.alert.title"))}),M(yf,c=>{const m=c.getParser();m.count>0&&i(d("help.emergency.pending.title")+`
`+m.pendingCalls[0].message,()=>{D(new Tf)},null,d("help.emergency.pending.button.discard"),d("help.emergency.pending.button.keep"),d("help.emergency.pending.message.subtitle"))}),M(Rf,c=>{r("Your pending calls were deleted",pe.MODERATION,null,null,d("mod.alert.title"))}),M(Of,c=>{const m=c.getParser();r(m.message,pe.MODERATION,null,null,d("help.cfh.reply.title"))}),M(kf,c=>{const m=c.getParser();r(d("help.emergency.global_mute.message"),pe.MODERATION,m.infoUrl,d("help.emergency.global_mute.link"),d("help.emergency.global_mute.subtitle"))}),M(Af,c=>{const m=c.getParser();n(m)}),{activeReport:a,setActiveReport:t,sanctionInfo:s,setSanctionInfo:n,report:l}},Ws=()=>lt(lv),sl=()=>{const[a,t]=o.useState([]),s=o.useMemo(()=>!!a.length,[a]),n=o.useCallback(()=>{let i=-1;return t(l=>{const c=[...l];return i=c.length?c[c.length-1]+1:0,c.push(i),c}),i},[]),r=o.useCallback(i=>{t(l=>{const c=[...l],m=c.indexOf(i);return m===-1?l:(c.splice(m,1),c)})},[]);return{isVisible:s,activate:n,deactivate:r}},cv=a=>D(new Pf(a)),uv=(a,t)=>D(new Lf(a,...t)),dv=()=>{const[a,t]=o.useState(new Map),s=o.useCallback(m=>{var h;return((h=a.get(m))==null?void 0:h.length)||0},[a]),n=o.useMemo(()=>{let m=0;for(const h of a.keys())m+=s(h);return m},[a,s]),r=o.useCallback(m=>{let h=!0;return t(u=>{if(!u.has(m))return h=!1,u;const g=new Map(u);return g.delete(m),cv(m),g}),h},[]),i=o.useCallback((m,h)=>{let u=!0;return t(g=>{if(!g.has(m))return u=!1,g;const f=new Map(g),p=f.get(m);if(p)for(const x of h)p.splice(p.indexOf(x),1);return uv(m,h),f}),u},[]),l=o.useCallback((m,h)=>a.has(m)?a.get(m).indexOf(h)>=0:!1,[a]),c=o.useCallback((m,h)=>{t(u=>{if(!u.has(m))return u;const g=new Map(u),f=g.get(m),p=f.indexOf(h);return p>=0&&f.splice(p,1),g})},[]);return M(Df,m=>{const h=m.getParser();t(u=>{const g=new Map(u);for(const f of h.categories){let p=g.get(f);p||(p=[],g.set(f,p));const x=h.getItemsByCategory(f);for(const I of x)p.indexOf(I)===-1&&p.push(I)}return g})}),{getCount:s,getFullCount:n,resetCategory:r,resetItems:i,isUnseen:l,removeUnseen:c}},Os=()=>lt(dv),mv=()=>{const[a,t]=o.useState(!0),[s,n]=o.useState([]),[r,i]=o.useState(new Map),[l,c]=o.useState([]),[m,h]=o.useState(null),{isVisible:u=!1,activate:g=null,deactivate:f=null}=sl(),{isUnseen:p=null,resetCategory:x=null}=Os(),I=K("user.badges.max.slots",5),j=_=>l.indexOf(_)>=0,E=()=>l.length{c(S=>{const T=[...S],L=T.indexOf(_);if(L===-1){if(!E())return S;T.push(_)}else T.splice(L,1);const k=new Vf;for(let R=0;Rs.indexOf(_)===-1?0:r.get(_)??0;return M(Mf,_=>{const S=_.getParser(),T=[];i(L=>{const k=new Map(L);return S.getAllBadgeCodes().forEach(R=>{const y=s.indexOf(R)>=0,O=S.getBadgeId(R);k.set(R,O),!y&&T.push(R)}),k}),c(S.getActiveBadgeCodes()),n(L=>[...L,...T])}),M(Uf,_=>{const S=_.getParser(),T=p(st.BADGE,S.badgeId);n(L=>{const k=[...L];return T?k.unshift(S.badgeCode):k.push(S.badgeCode),k}),i(L=>{const k=new Map(L);return k.set(S.badgeCode,S.badgeId),k})}),o.useEffect(()=>{!s||!s.length||h(_=>{let S=_;return S&&s.indexOf(S)===-1&&(S=null),S||(S=s[0]),S})},[s]),o.useEffect(()=>{if(u)return()=>{x(st.BADGE)}},[u,x]),o.useEffect(()=>{!u||!a||(D(new Ff),t(!1))},[u,a]),{badgeCodes:s,activeBadgeCodes:l,selectedBadgeCode:m,setSelectedBadgeCode:h,isWearingBadge:j,canWearBadges:E,toggleBadge:C,getBadgeId:b,activate:g,deactivate:f}},ga=()=>lt(mv),hv=()=>{const[a,t]=o.useState(!0),[s,n]=o.useState([]),[r,i]=o.useState(null),{isVisible:l=!1,activate:c=null,deactivate:m=null}=sl(),{isUnseen:h=null,resetCategory:u=null}=Os();return M(Gf,g=>{const f=g.getParser();n(p=>{const x=[...p],I=x.map(E=>E.botData.id),j=[];for(const E of f.items.values())I.indexOf(E.id)===-1&&j.push(E);for(const E of I){let C=!0;for(const S of f.items.values())if(S.id===E){C=!1;break}if(!C)continue;const b=x.findIndex(S=>S.botData.id===E),_=x[b];b===-1||!_||(di()===_.botData.id&&(Zi(),Z("inventory/open")),x.splice(b,1))}for(const E of j){const C={botData:E};h(st.BOT,E.id)?x.unshift(C):x.push(C)}return x})}),M(Bf,g=>{const f=g.getParser();n(p=>{const x=[...p];if(x.findIndex(C=>C.botData.id===f.item.id)>=0)return p;const j={botData:f.item};return h(st.BOT,j.botData.id)?x.unshift(j):x.push(j),x})}),M(Hf,g=>{const f=g.getParser();n(p=>{const x=[...p],I=x.findIndex(j=>j.botData.id===f.itemId);return I===-1?p:(x.splice(I,1),di()===f.itemId&&(Zi(),Z("inventory/show")),x)})}),o.useEffect(()=>{!s||!s.length||i(g=>{let f=g;return f&&s.indexOf(f)===-1&&(f=null),f||(f=s[0]),f})},[s]),o.useEffect(()=>{if(l)return()=>{u(st.BOT)}},[l,u]),o.useEffect(()=>{!l||!a||(D(new Wf),t(!1))},[l,a]),{botItems:s,selectedBot:r,setSelectedBot:i,activate:c,deactivate:m}},vh=()=>lt(hv);let Pa=null;const gv=()=>{const[a,t]=o.useState(!0),[s,n]=o.useState([]),[r,i]=o.useState(null),{isVisible:l=!1,activate:c=null,deactivate:m=null}=sl(),{isUnseen:h=null,resetCategory:u=null}=Os(),g=x=>{if(!(!s||!s.length))return s.filter(I=>I.type===x)},f=x=>{if(!(!s||!s.length)){for(const I of s){const j=I.getItemById(x);if(j&&j.isWallItem)return I}return null}},p=x=>{if(!(!s||!s.length)){for(const I of s){const j=I.getItemById(x);if(j&&!j.isWallItem)return I}return null}};return M(xm,x=>{const I=x.getParser();n(j=>{const E=[...j];for(const C of I.items){let b=0,_=null;for(;b{const I=x.getParser();Pa||(Pa=new Array(I.totalFragments));const j=YC(I.fragment,I.totalFragments,I.fragmentNumber,Pa);j&&(n(E=>{const C=[...E],b=$C(C);for(const _ of b){if(j.get(_))continue;let S=0;for(;S=0)continue;const S=j.get(_);if(!S)continue;const T=new Ji(S);yu(C,T,h(st.FURNI,_)),Ct(new ra(T.id,T.type,T.category))}return C}),Pa=null)}),M(qf,x=>{t(!0)}),M(jm,x=>{const I=x.getParser();n(j=>{const E=[...j];let C=0;for(;C{}),o.useEffect(()=>{!s||!s.length||i(x=>{let I=x;return I&&s.indexOf(I)===-1&&(I=null),I||(I=s[0]),I})},[s]),o.useEffect(()=>{if(l)return()=>{u(st.FURNI)&&n(x=>{const I=[...x];for(const j of I)j.hasUnseenItems=!1;return I})}},[l,u]),o.useEffect(()=>{!l||!a||(D(new Yf),t(!1))},[l,a]),{isVisible:l,groupItems:s,setGroupItems:n,selectedItem:r,setSelectedItem:i,activate:c,deactivate:m,getWallItemById:f,getFloorItemById:p,getItemsByType:g}},ur=()=>lt(gv);let La=null;const fv=()=>{const[a,t]=o.useState(!0),[s,n]=o.useState([]),[r,i]=o.useState(null),{isVisible:l=!1,activate:c=null,deactivate:m=null}=sl(),{isUnseen:h=null,resetCategory:u=null}=Os();return M($f,g=>{const f=g.getParser();La||(La=new Array(f.totalFragments));const p=JC(f.fragment,f.totalFragments,f.fragmentNumber,La);p&&(n(x=>{const I=[...x];return QC(I,p,h),I}),La=null)}),M(Kf,g=>{const f=g.getParser();n(p=>{const x=[...p];return ah(f.pet,x,h(st.PET,f.pet.id)),x})}),M(Xf,g=>{const f=g.getParser();n(p=>{const x=[...p];return oh(f.petId,x),x})}),o.useEffect(()=>{!s||!s.length||i(g=>{let f=g;return f&&s.indexOf(f)===-1&&(f=null),f||(f=s[0]),f})},[s]),o.useEffect(()=>{if(l)return()=>{u(st.PET)}},[l,u]),o.useEffect(()=>{!l||!a||(D(new Qf),t(!1))},[l,a]),{petItems:s,selectedPet:r,setSelectedPet:i,activate:c,deactivate:m}},_h=()=>lt(fv),pv=()=>{const[a,t]=o.useState(null),[s,n]=o.useState(null),[r,i]=o.useState(St.TRADING_STATE_READY),{groupItems:l=[],setGroupItems:c=null,activate:m=null,deactivate:h=null}=ur(),{simpleAlert:u=null,showTradeAlert:g=null}=Fe(),f=r>=St.TRADING_STATE_RUNNING,p=()=>{switch(r){case St.TRADING_STATE_RUNNING:!s.itemCount&&!a.accepts&&u(d("inventory.trading.warning.other_not_offering"),null,null,null),a.accepts?D(new hp):D(new gp);return;case St.TRADING_STATE_CONFIRMING:D(new mp),i(St.TRADING_STATE_CONFIRMED);return}},x=j=>{const E=j.getLastItem();E&&D(new dp(E.id))},I=()=>{if(f)switch(r){case St.TRADING_STATE_RUNNING:D(new up);return;default:D(new cp);return}};return M(Jf,j=>{const E=j.getParser();!a||!s||(a.userId===E.userID?t(C=>{const b=Es(C);return b.accepts=E.userAccepts,b}):s.userId===E.userID&&n(C=>{const b=Es(C);return b.accepts=E.userAccepts,b}))}),M(ep,j=>{const E=j.getParser();E.reason===Zf.ERROR_WHILE_COMMIT?g(us.ERROR_WHILE_COMMIT):a&&E.userID!==a.userId&&g(us.THEY_CANCELLED),t(null),n(null),i(St.TRADING_STATE_READY)}),M(tp,j=>{j.getParser(),t(null),n(null),i(St.TRADING_STATE_READY)}),M(sp,j=>{j.getParser(),i(St.TRADING_STATE_COUNTDOWN)}),M(np,j=>{const E=j.getParser(),C=ku(E.firstUserItemArray),b=ku(E.secondUserItemArray);t(_=>{const S=Es(_);S.userId===E.firstUserID?(S.creditsCount=E.firstUserNumCredits,S.itemCount=E.firstUserNumItems,S.userItems=C):(S.creditsCount=E.secondUserNumCredits,S.itemCount=E.secondUserNumItems,S.userItems=b);const T=[];for(const L of S.userItems.getValues()){let k=0;for(;k{const k=[...L];for(const R of k)R.lockItemIds(T);return k}),S}),n(_=>{const S=Es(_);return S.userId===E.firstUserID?(S.creditsCount=E.firstUserNumCredits,S.itemCount=E.firstUserNumItems,S.userItems=C):(S.creditsCount=E.secondUserNumCredits,S.itemCount=E.secondUserNumItems,S.userItems=b),S})}),M(rp,j=>{j.getParser()}),M(ip,j=>{const E=j.getParser(),C=new Ru,b=ye().userDataManager.getUserData(E.userID);C.userItems=new Hi;const _=new Ru,S=ye().userDataManager.getUserData(E.otherUserID);_.userItems=new Hi,b.webID===B().userId?(C.userId=b.webID,C.userName=b.name,C.canTrade=E.userCanTrade,_.userId=S.webID,_.userName=S.name,_.canTrade=E.otherUserCanTrade):S.webID===B().userId&&(C.userId=S.webID,C.userName=S.name,C.canTrade=E.otherUserCanTrade,_.userId=b.webID,_.userName=b.name,_.canTrade=E.userCanTrade),t(C),n(_),i(St.TRADING_STATE_RUNNING)}),M(ap,j=>{const E=j.getParser();g(E.reason,E.otherUserName)}),M(op,j=>{j.getParser(),g(us.THEY_NOT_ALLOWED)}),M(lp,j=>{j.getParser(),g(us.YOU_NOT_ALLOWED)}),o.useEffect(()=>{if(r===St.TRADING_STATE_READY)return;const j=m();return()=>h(j)},[r,m,h]),{ownUser:a,otherUser:s,tradeState:r,setTradeState:i,isTrading:f,groupItems:l,progressTrade:p,removeItem:x,stopTrading:I}},Fc=()=>lt(pv),xv=()=>{const[a,t]=o.useState(null),[s,n]=o.useState([]),[r,i]=o.useState([]),[l,c]=o.useState([]),[m,h]=o.useState([]),[u,g]=o.useState([]),[f,p]=o.useState([]),{simpleAlert:x=null}=Fe(),I=O=>{s.indexOf(O)>=0||n(F=>[...F,O])},j=O=>{n(F=>{const V=[...F],Y=V.indexOf(O);return Y>=0&&V.splice(Y),V})},E=O=>{s.indexOf(O)>=0?j(O):I(O)},C=O=>{r.indexOf(O)>=0||i(F=>[...F,O])},b=O=>{i(F=>{const V=[...F],Y=V.indexOf(O);return Y>=0&&V.splice(Y),V})},_=O=>{r.indexOf(O)>=0?b(O):C(O)},S=O=>{l.indexOf(O)>=0||c(F=>[...F,O])},T=O=>{c(F=>{const V=[...F],Y=V.indexOf(O);return Y>=0&&V.splice(Y),V})},L=O=>{l.indexOf(O)>=0?T(O):S(O)},k=O=>{m.indexOf(O)>=0||h(F=>[...F,O])},R=O=>{h(F=>{const V=[...F],Y=V.indexOf(O);return Y>=0&&V.splice(Y),V})},y=O=>{r.indexOf(O)>=0?R(O):k(O)};return M(fp,O=>{const V=O.getParser().data;t(V),g(V.issues)}),M(pp,O=>{const F=O.getParser();g(V=>{const Y=[...V],q=Y.findIndex(U=>U.issueId===F.issueData.issueId);return q>=0?Y[q]=F.issueData:(Y.push(F.issueData),vn(_n.MODTOOLS_NEW_TICKET)),Y})}),M(xp,O=>{O.getParser()}),M(jp,O=>{O.getParser()&&x("Failed to pick issue",pe.DEFAULT,null,null,"Error")}),M(Ip,O=>{const F=O.getParser();g(V=>{const Y=[...V],q=Y.findIndex(U=>U.issueId===F.issueId);return q>=0&&Y.splice(q,1),Y})}),M(bp,O=>{O.getParser().success?x("Moderation action was successfull",pe.MODERATION,null,null,"Success"):x("There was a problem applying tht moderation action",pe.MODERATION,null,null,"Error")}),M(Ep,O=>{const F=O.getParser();p(F.callForHelpCategories)}),M(Cp,O=>{O.getParser()}),{settings:a,openRooms:s,openRoomChatlogs:r,openUserChatlogs:m,openUserInfos:l,cfhCategories:f,tickets:u,openRoomInfo:I,closeRoomInfo:j,toggleRoomInfo:E,openRoomChatlog:C,closeRoomChatlog:b,toggleRoomChatlog:_,openUserInfo:S,closeUserInfo:T,toggleUserInfo:L,openUserChatlog:k,closeUserChatlog:R,toggleUserChatlog:y}},pi=()=>lt(xv),jv=()=>{const[a,t]=o.useState(null),[s,n]=o.useState(null),[r,i]=o.useState(null),[l,c]=o.useState(null),[m,h]=o.useState({roomInfo:null,state:We.NONE}),[u,g]=o.useState(null),[f,p]=o.useState(""),[x,I]=o.useState(null),[j,E]=o.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:C=null}=Fe();return M(Np,b=>{const _=b.getParser();D(new to(_.roomId,!1,!1))}),M(vp,b=>{const _=b.getParser();_.canCreate||C(d(`navigator.cannotcreateevent.error.${_.errorCode}`),null,null,null,d("navigator.cannotcreateevent.title"))}),M(bm,b=>{D(new _p),D(new Im)}),M(Sp,b=>{const _=b.getParser();E(S=>{const T={...S};return T.eventMod=_.securityLevel>=no.MODERATOR,T.roomPicker=_.securityLevel>=no.COMMUNITY,T})}),M(wp,b=>{const _=b.getParser();is(_.roomId)}),M(Em,b=>{const _=b.getParser();E(S=>{const T={...S};return T.enteredGuestRoom=null,T.currentRoomOwner=_.isOwner,T.currentRoomId=_.roomId,T}),D(new to(_.roomId,!0,!1)),qi.available&&qi.call("legacyTrack","navigator","private",[_.roomId])}),M(gi,b=>{const _=b.getParser();if(_.roomEnter)h({roomInfo:null,state:We.NONE}),E(S=>{const T={...S};return T.enteredGuestRoom=_.data,T.currentRoomIsStaffPick=_.staffPick,!(T.createdFlatId===_.data.roomId)&&_.data.displayRoomEntryAd&&K("roomenterad.habblet.enabled",!1)&&ia.openRoomEnterAd(),T.createdFlatId=0,T.enteredGuestRoom&&T.enteredGuestRoom.habboGroupId>0,T});else if(_.roomForward){if(_.data.ownerName!==B().userName&&!_.isGroupMember)switch(_.data.doorMode){case et.DOORBELL_STATE:h(S=>{const T={...S};return T.roomInfo=_.data,T.state=We.START_DOORBELL,T});return;case et.PASSWORD_STATE:h(S=>{const T={...S};return T.roomInfo=_.data,T.state=We.START_PASSWORD,T});return}if(_.data.doorMode===et.NOOB_STATE&&!B().isAmbassador&&!B().isRealNoob&&!B().isModerator)return;Cr(_.data.roomId)}else E(S=>{const T={...S};return T.enteredGuestRoom=_.data,T.currentRoomIsStaffPick=_.staffPick,T})}),M(Tp,b=>{const _=b.getParser();E(S=>{const T={...S};return T.currentRoomRating=_.totalLikes,T.canRate=_.canLike,T})}),M(yp,b=>{const _=b.getParser();(!_.userName||_.userName.length===0)&&h(S=>{const T={...S};return T.state=We.STATE_WAITING,T})}),M(Rp,b=>{const _=b.getParser();(!_.userName||_.userName.length===0)&&h(S=>{const T={...S};return T.state=We.STATE_ACCEPTED,T})}),M(Op,b=>{const _=b.getParser();(!_.userName||_.userName.length===0)&&h(S=>{const T={...S};return T.state=We.STATE_NO_ANSWER,T})}),M(kp,b=>{switch(b.getParser().errorCode){case-100002:h(S=>{const T={...S};return T.state=We.STATE_WRONG_PASSWORD,T});return;case 4009:C(d("navigator.alert.need.to.be.vip"),pe.DEFAULT,null,null,d("generic.alert.title"));return;case 4010:C(d("navigator.alert.invalid_room_name"),pe.DEFAULT,null,null,d("generic.alert.title"));return;case 4011:C(d("navigator.alert.cannot_perm_ban"),pe.DEFAULT,null,null,d("generic.alert.title"));return;case 4013:C(d("navigator.alert.room_in_maintenance"),pe.DEFAULT,null,null,d("generic.alert.title"));return}}),M(Ap,b=>{const _=b.getParser();c(_.topLevelContexts),i(_.topLevelContexts.length?_.topLevelContexts[0]:null)}),M(Dp,b=>{const _=b.getParser();i(S=>{let T=S;if(T||(T=l&&l.length&&l[0]||null),!T)return null;if(_.result.code!==T.code&&l&&l.length)for(const L of l)L.code===_.result.code&&(T=L);for(const L of l)L.code===_.result.code&&(T=L);return T}),g(_.result),p(_.result.data)}),M(Pp,b=>{const _=b.getParser();t(_.categories)}),M(Lp,b=>{const _=b.getParser();n(_.categories)}),M(Mp,b=>{const _=b.getParser();Cr(_.roomId)}),M(Up,b=>{const _=b.getParser();let S=!1;if(E(k=>{S=k.settingsReceived;const R={...k};return R.homeRoomId=_.homeRoomId,R.settingsReceived=!0,R}),S)return;let T=-1,L=-1;K("friend.id")!==void 0&&parseInt(K("friend.id"))>0&&(T=0,D(new xc(parseInt(K("friend.id"))))),K("forward.type")!==void 0&&K("forward.id")!==void 0&&(T=parseInt(K("forward.type")),L=parseInt(K("forward.id"))),T===2?is(L):T===-1&&_.roomIdToEnter>0&&(Z("navigator/close"),_.roomIdToEnter!==_.homeRoomId?Cr(_.roomIdToEnter):Cr(_.homeRoomId))}),M(Fp,b=>{const _=b.getParser();switch(_.reason){case ul.REASON_FULL:C(d("navigator.guestroomfull.text"),pe.DEFAULT,null,null,d("navigator.guestroomfull.title"));break;case ul.REASON_QUEUE_ERROR:C(d(`room.queue.error.${_.parameter}`),pe.DEFAULT,null,null,d("room.queue.error.title"));break;case ul.REASON_BANNED:C(d("navigator.banned.text"),pe.DEFAULT,null,null,d("navigator.banned.title"));break;default:C(d("room.queue.error.title"),pe.DEFAULT,null,null,d("room.queue.error.title"));break}_c()}),M(Vp,b=>Z("navigator/show")),M(Gp,b=>{const _=b.getParser();_&&I(_.searches)}),{categories:a,doorData:m,setDoorData:h,topLevelContext:r,topLevelContexts:l,searchResult:u,navigatorData:j,navigatorSearches:x,searchResultQuery:f}},qs=()=>lt(jv),Iv=()=>{const[a,t]=o.useState(new Ac),s=o.useMemo(()=>K("hc.disabled",!1),[]),n=o.useMemo(()=>s||a.clubDays>0?fn.ACTIVE:a.pastVipDays>0||a.pastVipDays>0?fn.EXPIRED:fn.NONE,[a,s]),r=i=>{if(i===-1)return a.credits;for(const[l,c]of a.activityPoints.entries())if(l===i)return c;return 0};return M(Bp,i=>{const l=i.getParser();t(c=>{const m=Es(c);return m.credits=parseFloat(l.credits),c.credits!==m.credits&&vn(_n.CREDITS),m})}),M(Hp,i=>{const l=i.getParser();t(c=>{const m=Es(c);return m.activityPoints=l.currencies,m})}),M(um,i=>{const l=i.getParser();t(c=>{const m=Es(c);return m.activityPoints=new Map(m.activityPoints),m.activityPoints.set(l.type,l.amount),l.type===0&&vn(_n.DUCKETS),m})}),M(qp,i=>{const l=i.getParser(),c=l.productName;c!=="club_habbo"&&c!=="habbo_club"||t(m=>{const h=Es(m);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===Wp.RESPONSE_TYPE_DISCOUNT_AVAILABLE,h.minutesUntilExpiration=l.minutesUntilExpiration,h.minutesSinceLastModified=l.minutesSinceLastModified,h})}),o.useEffect(()=>{if(s)return;D(new ru("habbo_club"));const i=setInterval(()=>D(new ru("habbo_club")),5e4);return()=>clearInterval(i)},[s]),o.useEffect(()=>{D(new zp)},[]),{purse:a,hcDisabled:s,clubStatus:n,getCurrencyAmount:r}},Ur=()=>lt(Iv),bv=(a,t)=>{o.useEffect(()=>{if(!a)return;const s=n=>t(n);return Nn.addEventListener(Be.FURNI_ADDED,s),()=>{Nn.removeEventListener(Be.FURNI_ADDED,s)}},[a,t])},ks=(a,t)=>{o.useEffect(()=>{if(!a)return;const s=n=>t(n);return Nn.addEventListener(Be.FURNI_REMOVED,s),()=>{Nn.removeEventListener(Be.FURNI_REMOVED,s)}},[a,t])},Ev=a=>{ot(Be.OBJECT_DESELECTED,a)},Cv=a=>{ot(Be.OBJECT_ROLL_OUT,a)},Nv=a=>{ot(Be.OBJECT_ROLL_OVER,a)},Vc=a=>{ot(Be.OBJECT_SELECTED,a)},Sh=(a,t)=>{o.useEffect(()=>{if(!a)return;const s=n=>t(n);return Nn.addEventListener(Be.USER_ADDED,s),()=>{Nn.removeEventListener(Be.USER_ADDED,s)}},[a,t])},wh=(a,t)=>{o.useEffect(()=>{if(!a)return;const s=n=>t(n);return Nn.addEventListener(Be.USER_REMOVED,s),()=>{Nn.removeEventListener(Be.USER_REMOVED,s)}},[a,t])},vv=()=>{const[a,t]=o.useState(null),[s,n]=o.useState(!1);return M(Yp,r=>{const i=r.getParser();i&&t(i)}),{promoteInformation:a,isExtended:s,setPromoteInformation:t,setIsExtended:n}},Gc=()=>lt(vv),_v=()=>{const[a,t]=o.useState(null),[s,n]=o.useState(null),[r,i]=o.useState(null),[l,c]=o.useState(0),m=(u,g,f,p=!1)=>{if(!s)return;const x=Is.hslToRGB(((u&255)<<16)+((g&255)<<8)+(f&255));p&&c(x),!u&&!g&&!f?s.tint=0:s.tint=x},h=u=>{if(!r)return;const g=u>>16&255,f=u>>8&255,p=u&255;r.red=g/255,r.green=f/255,r.blue=p/255};return ot(nr.PREVIEW,u=>m(u.hue,u.saturation,u.lightness)),ot(nr.CLEAR_PREVIEW,u=>{s&&(s.tint=l)}),ve($p.ROOM_BACKGROUND_COLOR,u=>{Er.isRoomPreviewerId(u.roomId)||(u.enable?m(u.hue,u.saturation,u.lightness,!0):m(0,0,0,!0))}),ve(Kp.ROOM_COLOR,u=>{if(Er.isRoomPreviewerId(u.roomId))return;let g=0,f=255;u.bgOnly||(g=u.color,f=u.brightness),h(Is.hslToRGB((Is.rgbToHSL(g)&16776960)+f))}),ve([ys.INITIALIZED,ys.DISPOSED],u=>{if(Er.isRoomPreviewerId(u.roomId))return;const g=ye();if(g)switch(u.type){case ys.INITIALIZED:Su(u.roomId),t(g);return;case ys.DISPOSED:t(null);return}}),He([Pt.CREATED,Pt.ENDED],u=>{switch(u.type){case Pt.CREATED:UC(u.session);return;case Pt.ENDED:t(null);return}}),ve([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],u=>{if(Er.isRoomPreviewerId(u.roomId))return;let g=null;switch(u.type){case bt.SELECTED:VC(u)||(g=new Be(Be.OBJECT_SELECTED,u.objectId,u.category,u.roomId));break;case bt.DESELECTED:g=new Be(Be.OBJECT_DESELECTED,u.objectId,u.category,u.roomId);break;case bt.ADDED:{let f=null;switch(u.category){case X.FLOOR:case X.WALL:f=Be.FURNI_ADDED;break;case X.UNIT:f=Be.USER_ADDED;break}f&&(g=new Be(f,u.objectId,u.category,u.roomId));break}case bt.REMOVED:{let f=null;switch(u.category){case X.FLOOR:case X.WALL:f=Be.FURNI_REMOVED;break;case X.UNIT:f=Be.USER_REMOVED;break}f&&(g=new Be(f,u.objectId,u.category,u.roomId));break}case bt.REQUEST_MOVE:Yi(a,u.objectId,u.category)&&vr(u.objectId,u.category,Bs.OBJECT_MOVE);break;case bt.REQUEST_ROTATE:Yi(a,u.objectId,u.category)&&vr(u.objectId,u.category,Bs.OBJECT_ROTATE_POSITIVE);break;case bt.MOUSE_ENTER:g=new Be(Be.OBJECT_ROLL_OVER,u.objectId,u.category,u.roomId);break;case bt.MOUSE_LEAVE:g=new Be(Be.OBJECT_ROLL_OUT,u.objectId,u.category,u.roomId);break;case bt.DOUBLE_CLICK:g=new Be(Be.OBJECT_DOUBLE_CLICKED,u.objectId,u.category,u.roomId);break}g&&Ct(g)}),o.useEffect(()=>{if(!a)return;const u=Ie(),g=H(),f=a.roomId,p=1,x=Math.floor(window.innerWidth),I=Math.floor(window.innerHeight),j=u.application.renderer;j&&(j.view.style.width=`${x}px`,j.view.style.height=`${I}px`,j.resolution=window.devicePixelRatio,j.resize(x,I));const E=g.getRoomInstanceDisplay(f,p,x,I,Xp.SCALE_ZOOMED_IN),C=H().getRoomInstanceRenderingCanvas(f,p);if(!E||!C)return;const b=new Za(Qp.WHITE),_=new Jp,S=C.master;b.tint=0,b.width=x,b.height=I,S.addChildAt(b,0),S.filters=[_],n(b),i(_);const T=g.getRoomInstanceGeometry(f,p);if(T){const R=g.getRoomInstanceVariable(f,ba.ROOM_MIN_X)||0,y=g.getRoomInstanceVariable(f,ba.ROOM_MAX_X)||0,O=g.getRoomInstanceVariable(f,ba.ROOM_MIN_Y)||0,F=g.getRoomInstanceVariable(f,ba.ROOM_MAX_Y)||0;let V=(R+y)/2,Y=(O+F)/2;const q=20;V=V+(q-1),Y=Y+(q-1);const U=Math.sqrt(q*q+q*q)*Math.tan(30/180*Math.PI);T.location=new Ot(V,Y,U)}const L=u.application.stage;if(!L)return;L.addChild(E),Su(a.roomId);const k=R=>{const y=Math.floor(window.innerWidth),O=Math.floor(window.innerHeight);j.view.style.width=`${y}px`,j.view.style.height=`${O}px`,j.resolution=window.devicePixelRatio,j.resize(y,O),b.width=y,b.height=O,FC(y,O,1),u.application.render()};return window.addEventListener("resize",k),()=>{n(null),i(null),c(0),window.removeEventListener("resize",k)}},[a]),{roomSession:a}},ke=()=>lt(_v),Sv=()=>{const[a,t]=o.useState(-1),[s,n]=o.useState(-1),[r,i]=o.useState(0),{roomSession:l=null}=ke(),c=()=>{const u=Is.rgbToHSL(r),[g,f,p,x]=ms.int_to_8BitVals(u);D(new Zp(a,f,p,x))},m=()=>l.useMultistateItem(a),h=()=>{Ct(new nr(nr.CLEAR_PREVIEW)),t(-1),n(-1),i(0)};return ve(Se.REQUEST_BACKGROUND_COLOR,u=>{if(!Yi(l,u.objectId,u.category))return;const f=H().getRoomObject(u.roomId,u.objectId,u.category).model;t(u.objectId),n(u.category);const p=parseInt(f.getValue(te.FURNITURE_ROOM_BACKGROUND_COLOR_HUE)),x=parseInt(f.getValue(te.FURNITURE_ROOM_BACKGROUND_COLOR_SATURATION)),I=parseInt(f.getValue(te.FURNITURE_ROOM_BACKGROUND_COLOR_LIGHTNESS)),j=ms.eight_bitVals_to_int(0,p,x,I),E=Is.hslToRGB(j);i(E)}),ks(a!==-1&&s!==-1,u=>{u.id!==a||u.category!==s||h()}),o.useEffect(()=>{if(a===-1||s===-1)return;const u=Is.rgbToHSL(r),[g,f,p,x]=ms.int_to_8BitVals(u);Ct(new nr(nr.PREVIEW,f,p,x))},[a,s,r]),{objectId:a,color:r,setColor:i,applyToner:c,toggleToner:m,onClose:h}},wv=Sv,Tv=()=>{const[a,t]=o.useState(-1),[s,n]=o.useState(-1),[r,i]=o.useState("1"),[l,c]=o.useState(""),[m,h]=o.useState(""),[u,g]=o.useState(""),[f,p]=o.useState(""),{simpleAlert:x=null}=Fe(),I=()=>{t(-1),n(-1),i("1"),c(""),h(""),g(""),p("")};return ve([Se.REQUEST_BADGE_DISPLAY_ENGRAVING,Se.REQUEST_ACHIEVEMENT_RESOLUTION_ENGRAVING],j=>{const E=H().getRoomObject(j.roomId,j.objectId,j.category);if(!E)return;const C=new aa;C.initializeFromRoomObjectModel(E.model),t(j.objectId),n(j.category),i("1"),c(fi(C.getValue(1))),h(Tc(C.getValue(1))),g(C.getValue(2)),p(C.getValue(3))}),ve(Se.REQUEST_ACHIEVEMENT_RESOLUTION_FAILED,j=>{const E=H().getRoomObject(j.roomId,j.objectId,j.category);!E||E.model.getValue(te.FURNITURE_OWNER_ID)!==B().userId||x(`${d("resolution.failed.subtitle")} ${d("resolution.failed.text")}`,null,null,null,d("resolution.failed.title"))}),ks(a!==-1&&s!==-1,j=>{j.id!==a||j.category!==s||I()}),{objectId:a,category:s,color:r,badgeName:l,badgeDesc:m,date:u,senderName:f,onClose:I}},yv=Tv,ic="MONSTERPLANT_SEED_CONFIRMATION",ac="PURCHASABLE_CLOTHING_CONFIRMATION",Th="GROUP_FURNITURE",yh="EFFECTBOX_OPEN",oc="MYSTERYTROPHY_OPEN_DIALOG",Rv=()=>{const[a,t]=o.useState(-1),[s,n]=o.useState(null),[r,i]=o.useState(null),[l,c]=o.useState(-1),[m,h]=o.useState(null),[u,g]=o.useState(!1),[f,p]=o.useState(-1),{roomSession:x=null}=ke(),I=()=>{t(-1),h(null),g(!1),n(null)},j=()=>{i(null),c(-1)},E=C=>{if(C)switch(C){case"use_friend_furni":x.useMultistateItem(a);break;case"use_monsterplant_seed":i(ic),c(a);break;case"use_random_teleport":H().useRoomObject(a,X.FLOOR);break;case"use_purchaseable_clothing":i(ac),c(a);break;case"use_mystery_box":x.useMultistateItem(a);break;case"use_mystery_trophy":i(oc),c(a);break;case"join_group":kc(m.guildId),g(!0);return;case"go_to_group_homeroom":m&&is(m.guildHomeRoomId);break}I()};return ve([Se.OPEN_FURNI_CONTEXT_MENU,Se.CLOSE_FURNI_CONTEXT_MENU,Se.REQUEST_MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG,Se.REQUEST_PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG,Se.REQUEST_EFFECTBOX_OPEN_DIALOG,Se.REQUEST_MYSTERYBOX_OPEN_DIALOG,Se.REQUEST_MYSTERYTROPHY_OPEN_DIALOG],C=>{const b=H().getRoomObject(x.roomId,C.objectId,C.category);if(b)switch(p(b.model.getValue(te.FURNITURE_OWNER_ID)),C.type){case Se.REQUEST_MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG:if(!$t(b))return;c(b.id),i(ic),I();return;case Se.REQUEST_EFFECTBOX_OPEN_DIALOG:if(!$t(b))return;c(b.id),i(yh),I();return;case Se.REQUEST_PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG:if(!$t(b))return;c(b.id),i(ac),I();return;case Se.REQUEST_MYSTERYBOX_OPEN_DIALOG:x.useMultistateItem(b.id),I();return;case Se.REQUEST_MYSTERYTROPHY_OPEN_DIALOG:if(!$t(b))return;c(b.id),i(oc),I();return;case Se.OPEN_FURNI_CONTEXT_MENU:switch(t(b.id),C.contextMenu){case Ft.FRIEND_FURNITURE:n(Ft.FRIEND_FURNITURE);return;case Ft.MONSTERPLANT_SEED:$t(b)&&n(Ft.MONSTERPLANT_SEED);return;case Ft.MYSTERY_BOX:n(Ft.MYSTERY_BOX);return;case Ft.MYSTERY_TROPHY:$t(b)&&n(Ft.MYSTERY_TROPHY);return;case Ft.RANDOM_TELEPORT:n(Ft.RANDOM_TELEPORT);return;case Ft.PURCHASABLE_CLOTHING:$t(b)&&n(Ft.PURCHASABLE_CLOTHING);return}return;case Se.CLOSE_FURNI_CONTEXT_MENU:b.id===a&&I();return}}),M(ex,C=>{const b=C.getParser();t(b.objectId),h(b),g(b.userIsMember),n(Th)}),{objectId:a,mode:s,confirmMode:r,confirmingObjectId:l,groupData:m,isGroupMember:u,objectOwnerId:f,closeConfirm:j,processAction:E,onClose:I}},Ov=Rv,kv=()=>{const[a,t]=o.useState(-1),[s,n]=o.useState([]),[r,i]=o.useState(null),[l,c]=o.useState([]),[m,h]=o.useState(null),[u,g]=o.useState(new Map),[f,p]=o.useState(!1),{groupItems:x=[],getItemsByType:I=null,activate:j=null,deactivate:E=null}=ur(),{simpleAlert:C=null}=Fe(),b=r&&u.get(r.name)||null,_=()=>{n([]),i(null),c([]),g(new Map)},S=()=>{t(-1),_()},T=()=>{p(!0),D(new ox(a,r.name))},L=k=>{i(k),u.get(k.name)||D(new lx(k.name))};return ve(Se.OPEN_WIDGET,k=>{k.widget===tx.CRAFTING&&(t(k.objectId),_(),D(new sx(k.objectId)))}),M(nx,k=>{const R=k.getParser();if(!R.isActive()){t(-1);return}n(y=>{const O=[];for(const F of R.recipes){const V=H().roomContentLoader._activeObjectTypeIds.get(F.itemName),Y=H().getFurnitureFloorIconUrl(V);O.push({name:F.recipeName,localizedName:d("roomItem.name."+V),iconUrl:Y})}return O}),h(R.ingredients)}),M(rx,k=>{const R=k.getParser();g(y=>{const O=new Map(y);return O.set(r.name,R.ingredients),O})}),M(ix,k=>{i(null),p(!1),k.getParser().result&&C(d("crafting.info.result.ok"))}),M(ax,k=>{}),o.useEffect(()=>{!m||!m.length||c(k=>{const R=[];for(const y of m){const O=H().roomContentLoader._activeObjectTypeIds.get(y),F=H().getFurnitureFloorIconUrl(O),V=I(O);let Y=0;if(V)for(const q of V)Y+=q.items.length;R.push({name:y,iconUrl:F,count:Y})}return R})},[x,m,I]),o.useEffect(()=>{if(a===-1)return;const k=j();return()=>E(k)},[a,j,E]),{objectId:a,recipes:s,ingredients:l,selectedRecipe:r,requiredIngredients:b,isCrafting:f,selectRecipe:L,craft:T,onClose:S}},Av=kv,Dv=()=>{const[a,t]=o.useState([]),[s,n]=o.useState(0),[r,i]=o.useState(0),[l,c]=o.useState(0),[m,h]=o.useState(0),[u,g]=o.useState(16777215),[f,p]=o.useState(255),[x,I]=o.useState(0),[j,E]=o.useState(0),[C,b]=o.useState(0),{roomSession:_=null}=ke(),S=()=>_.isRoomOwner||_.controllerLevel>=$e.GUEST||B().isModerator,T=k=>{const R=a[k-1];R&&(n(R.id),I(R.type),E(R.color),b(R.light))},L=()=>{if(r===0)return;const k=s-1;if(s<1||s>a.length)return;const R=a[k];!R||x===R.type&&j===R.color&&C===R.light||(t(y=>{const O=[...y];return O[k]=new Bu(R.id,x,j,C),O}),Fs.savePreset(R.id,x,j,C,!0))};return ve(Se.REQUEST_DIMMER,k=>{S()&&_.requestMoodlightSettings()}),He(cx.ROOM_DIMMER_PRESETS,k=>{const R=[];let y=0;for(;y{Er.isRoomPreviewerId(k.roomId)||(c(r),i(k.state),n(k.presetId),h(k.effectId),I(k.effectId),g(k.color),E(k.color),p(k.brightness),b(k.brightness))}),o.useEffect(()=>{r===0&&l===0||Fs.previewDimmer(j,C,x===2)},[r,l,j,C,x]),{presets:a,selectedPresetId:s,dimmerState:r,lastDimmerState:l,effectId:m,color:u,brightness:f,selectedEffectId:x,setSelectedEffectId:I,selectedColor:j,setSelectedColor:E,selectedBrightness:C,setSelectedBrightness:b,selectPresetId:T,applyChanges:L}},Pv=Dv,Lv=()=>{const[a,t]=o.useState(-1),[s,n]=o.useState(-1),[r,i]=o.useState(0),l=()=>{t(-1),n(-1),i(0)},c=()=>{ye().connection.send(new dx(a)),l()};return ve(Se.REQUEST_CREDITFURNI,m=>{const h=H().getRoomObject(m.roomId,m.objectId,m.category);!h||!$t(h)||(t(m.objectId),n(m.category),i(h.model.getValue(te.FURNITURE_CREDIT_VALUE)||0))}),ks(a!==-1&&s!==-1,m=>{m.id!==a||m.category!==s||l()}),{objectId:a,value:r,redeem:c,onClose:l}},Mv=Lv,Uv=()=>{const[a,t]=o.useState(-1),[s,n]=o.useState(-1),[r,i]=o.useState(-1),[l,c]=o.useState([]),{roomSession:m=null}=ke(),h=()=>{t(-1),n(-1),i(-1),c([])};return ve(Se.REQUEST_EXTERNAL_IMAGE,u=>{const g=H().getRoomObject(u.roomId,u.objectId,u.category),f=H().getRoomObjects(m==null?void 0:m.roomId,X.WALL);if(!g)return;const p=[];f.forEach(I=>{if(I.type!=="external_image_wallitem_poster_small")return null;const j=I.model.getValue(te.FURNITURE_DATA),E=JSON.parse(j);p.push(E)}),t(u.objectId),n(u.category),c(p);const x=JSON.parse(g.model.getValue(te.FURNITURE_DATA));i(I=>{let j=0;return x&&(j=p.findIndex(E=>E.w===x.w)),j<0&&(j=0),j})}),ks(a!==-1&&s!==-1,u=>{u.id!==a||u.category!==s||h()}),{objectId:a,currentPhotoIndex:r,currentPhotos:l,onClose:h}},Fv=Uv,Vv=()=>{const[a,t]=o.useState(-1),[s,n]=o.useState(-1),[r,i]=o.useState(0),[l,c]=o.useState([]),[m,h]=o.useState([]),[u,g]=o.useState(null),[f,p]=o.useState(0),x=()=>{t(-1),n(-1),i(0),c([]),h([]),g(null)},I=j=>{ye().connection.send(new fx(a,j)),x()};return M(mx,j=>{const E=j.getParser();t(E.furniId),p(E.start?1:2)}),M(hx,j=>x()),M(gx,j=>x()),ve(Se.REQUEST_FRIEND_FURNITURE_ENGRAVING,j=>{const E=H().getRoomObject(j.roomId,j.objectId,j.category);if(!E)return;const C=E.model.getValue(te.FURNITURE_DATA),b=E.model.getValue(te.FURNITURE_FRIENDFURNI_ENGRAVING);C[0]!=="1"||C.length!==6||(t(j.objectId),n(j.category),i(b),c([C[1],C[2]]),h([C[3],C[4]]),g(C[5]),p(0))}),ks(a!==-1&&s!==-1,j=>{j.id!==a||j.category!==s||x()}),{objectId:a,type:r,usernames:l,figures:m,date:u,stage:f,onClose:x,respond:I}},Gv=Vv,Bv=["perteam","mostwins","classic"],Hv=["alltime","daily","weekly","monthly"],Wv=()=>{const[a,t]=o.useState(new Map),{roomSession:s=null}=ke(),n=i=>Bv[i],r=i=>Hv[i];return ve(Se.REQUEST_HIGH_SCORE_DISPLAY,i=>{const l=H().getRoomObject(i.roomId,i.objectId,i.category);if(!l)return;const c=l.model.getValue(te.FURNITURE_DATA_FORMAT),m=om.getData(c);m.initializeFromRoomObjectModel(l.model),t(h=>{const u=new Map(h);return u.set(l.id,m),u})}),ve(Se.REQUEST_HIDE_HIGH_SCORE_DISPLAY,i=>{i.roomId===s.roomId&&t(l=>{const c=new Map(l);return c.delete(i.objectId),c})}),{stuffDatas:a,getScoreType:n,getClearType:r}},qv=Wv,zv="internalLink",Yv=()=>(ve(Se.REQUEST_INTERNAL_LINK,a=>{const t=H().getRoomObject(a.roomId,a.objectId,a.category);if(!t)return;let n=t.model.getValue(te.FURNITURE_DATA)[zv];(!n||!n.length)&&(n=t.model.getValue(te.FURNITURE_INTERNAL_LINK)),n&&n.length&&Z(n)}),{}),$v=Yv,Kv=()=>{const[a,t]=o.useState(-1),[s,n]=o.useState(-1),[r,i]=o.useState(null),[l,c]=o.useState(null),[m,h]=o.useState(Bt.NO_CLUB),[u,g]=o.useState(null),f=()=>{t(-1),n(-1),i(null),c(null),g(null)},p=()=>{a!==-1&&(D(new xx(a)),f())},x=()=>{a!==-1&&(D(new Yl(a)),f())},I=()=>{a!==-1&&D(new px(a,u))};return ve(Se.REQUEST_MANNEQUIN,j=>{const E=H().getRoomObject(j.roomId,j.objectId,j.category);if(!E)return;const C=E.model,b=C.getValue(te.FURNITURE_MANNEQUIN_FIGURE)||null,_=C.getValue(te.FURNITURE_MANNEQUIN_GENDER)||null,S=vt().createFigureContainer(b),T=vt().getFigureClubLevel(S,_,li.MANNEQUIN_CLOTHING_PART_TYPES);t(j.objectId),n(j.category),i(b),c(_),h(T),g(C.getValue(te.FURNITURE_MANNEQUIN_NAME)||null)}),ks(a!==-1&&s!==-1,j=>{j.id!==a||j.category!==s||f()}),{objectId:a,figure:r,gender:l,clubLevel:m,name:u,setName:g,saveFigure:p,wearFigure:x,saveName:I,onClose:f}},Xv=Kv,Qv=()=>{const[a,t]=o.useState(-1),[s,n]=o.useState(-1),[r,i]=o.useState(-1),[l,c]=o.useState(new Hi),[m,h]=o.useState([]),{roomSession:u=null}=ke(),{showSingleBubble:g=null,simpleAlert:f=null}=Fe(),p=()=>{t(-1),n(-1)},x=o.useCallback((C,b)=>D(new jx(C,b)),[]),I=o.useCallback(C=>D(new Ix(C)),[]),j=o.useCallback((C,b)=>D(new Yl(C,b)),[]);ve(Se.REQUEST_PLAYLIST_EDITOR,C=>{var _,S,T;const b=H().getRoomObject(C.roomId,C.objectId,C.category);if(b){if($t(b)){t(C.objectId),n(C.category),(_=Ie().soundManager.musicController)==null||_.requestUserSongDisks(),(T=(S=Ie().soundManager.musicController)==null?void 0:S.getRoomItemPlaylist())==null||T.requestPlayList();return}(u.isRoomOwner||u.controllerLevel>=$e.GUEST||B().isModerator)&&D(new Yl(C.objectId,-2))}}),ks(a!==-1&&s!==-1,C=>{C.id!==a||C.category!==s||p()}),xr(Cm.NPE_SONG_CHANGED,C=>{i(C.position)}),xr(bx.NOTIFY_PLAYED_SONG,C=>{g(d("soundmachine.notification.playing",["songname","songauthor"],[C.name,C.creator]),ss.SOUNDMACHINE)}),xr(Ex.SDIR_SONG_DISK_INVENTORY_RECEIVENT_EVENT,C=>{var b;c((b=Ie().soundManager.musicController)==null?void 0:b.songDiskInventory.clone())}),xr(iu.PLUE_PLAY_LIST_UPDATED,C=>{var b,_;h((_=(b=Ie().soundManager.musicController)==null?void 0:b.getRoomItemPlaylist())==null?void 0:_.entries.concat())}),xr(iu.PLUE_PLAY_LIST_FULL,C=>{f(d("playlist.editor.alert.playlist.full"),pe.ALERT,"","",d("playlist.editor.alert.playlist.full.title"))});const E=C=>{var b,_;a!==-1&&(C instanceof zl?C.getParser().fragmentNumber===0&&((b=Ie().soundManager.musicController)==null||b.requestUserSongDisks()):(_=Ie().soundManager.musicController)==null||_.requestUserSongDisks())};return M(zl,E),M(jm,E),M(xm,E),{objectId:a,diskInventory:l,playlist:m,currentPlayingIndex:r,onClose:p,addToPlaylist:x,removeFromPlaylist:I,togglePlayPause:j}},Jv=Qv,sd="floor",Zv="wallpaper",nd="landscape",e_="poster",t_=()=>{const[a,t]=o.useState(-1),[s,n]=o.useState(-1),[r,i]=o.useState(null),[l,c]=o.useState(null),[m,h]=o.useState(!1),[u,g]=o.useState(null),[f,p]=o.useState(null),[x,I]=o.useState(-1),[j,E]=o.useState(null),[C,b]=o.useState(!1),[_,S]=o.useState(null),{roomSession:T=null}=ke(),L=()=>{t(-1),n(-1),i(null),c(null),h(!1),g(null),p(null),I(-1),E(null),b(!1),S(null)},k=()=>{a!==-1&&(T.openGift(a),H().changeObjectModelData(H().activeRoomId,a,X.FLOOR,te.FURNITURE_DISABLE_PICKING_ANIMATION,1))},R=o.useMemo(()=>({imageReady:(y,O,F)=>{!F&&O&&(F=Cn.generateImage(O)),S(F.src)},imageFailed:null}),[]);return He(Cx.RSPE_PRESENT_OPENED,y=>{let O=null;y.itemType===fe.FLOOR?O=B().getFloorItemData(y.classId):y.itemType===fe.WALL&&(O=B().getWallItemData(y.classId));let F=!1;if(y.placedInRoom){const V=H().getRoomObject(T.roomId,y.placedItemId,X.FLOOR);V&&(F=$t(V))}switch(y.itemType){case fe.WALL:{if(O)switch(O.className){case sd:case nd:case Zv:let V=null;O.className===sd?V=d("inventory.furni.item.floor.name"):O.className===nd?V=d("inventory.furni.item.landscape.name"):V=d("inventory.furni.item.wallpaper.name"),c(V);break;case e_:{const Y=y.productCode;let q=null;Y.indexOf("poster")===0&&(q=Y.replace("poster",""));const U=B().getProductData(Y);let J=null;U?J=U.name:O&&(J=O.name),c(J),S(H().getFurnitureWallIconUrl(y.classId,q));break}default:{c(O.name||null),S(H().getFurnitureWallIconUrl(y.classId));break}}break}case fe.HABBO_CLUB:c(d("widget.furni.present.hc"));break;default:{if(y.placedItemType===fe.PET){const Y=y.petFigureString;if(Y&&Y.length){const q=new ci(Y),U=H().getRoomObjectPetImage(q.typeId,q.paletteId,q.color,new Ot(90),64,R,!0,0,q.customParts);U&&S(U.getImage().src)}}else{const Y=H().getFurnitureFloorImage(y.classId,new Ot(90),64,R);Y&&S(Y.getImage().src)}const V=B().getProductData(y.productCode);c(V&&V.name||O.name);break}}t(0),n(y.classId),i(y.itemType),h(F),I(y.placedItemId),E(y.placedItemType),b(y.placedInRoom)}),ve(Se.REQUEST_PRESENT,y=>{const O=H().getRoomObject(y.roomId,y.objectId,y.category);if(!O)return null;L(),t(y.objectId),n(-1),c(O.model.getValue(te.FURNITURE_DATA)||""),h($t(O)),g(O.model.getValue(te.FURNITURE_PURCHASER_NAME)||null),p(O.model.getValue(te.FURNITURE_PURCHASER_FIGURE)||null)}),ks(a!==-1,y=>{y.id===a&&L(),y.id===x&&C&&b(!1)}),{objectId:a,classId:s,itemType:r,text:l,isOwnerOfFurniture:m,senderName:u,senderFigure:f,placedItemId:x,placedItemType:j,placedInRoom:C,imageUrl:_,openPresent:k,onClose:L}},s_=t_,n_="internalLink",r_=()=>{const[a,t]=o.useState(0);return ve(Se.REQUEST_ROOM_LINK,s=>{const n=H().getRoomObject(s.roomId,s.objectId,s.category);if(!n)return;let i=n.model.getValue(te.FURNITURE_DATA)[n_];(!i||!i.length)&&(i=n.model.getValue(te.FURNITURE_INTERNAL_LINK)),!(!i||!i.length)&&(i=parseInt(i,10),!isNaN(i)&&(t(i),D(new to(i,!1,!1))))}),M(gi,s=>{!a||s.getParser().data.roomId!==a||t(0)}),{}},i_=r_,a_=()=>{const[a,t]=o.useState(-1),[s,n]=o.useState(-1),[r,i]=o.useState(""),[l,c]=o.useState(""),[m,h]=o.useState("0"),[u,g]=o.useState(""),[f,p]=o.useState(!1),{getWallItemById:x=null}=ur(),I=()=>{D(new vx(a,l,m,u)),t(-1),n(-1),i(""),c(""),h("0"),g(""),p(!1)};return M(Nx,j=>{const E=j.getParser();t(E.itemId),n(X.WALL);const C=x(E.itemId);let b="post_it";if(C){const _=H().getFurnitureWallName(C.type);_.match("post_it_")&&(b=_)}i(b),c(E.location),h("FFFF33"),g(""),p(!0)}),{objectId:a,color:m,setColor:h,text:u,setText:g,canModify:f,onClose:I}},o_=a_,_l=40,l_=()=>{const[a,t]=o.useState(-1),[s,n]=o.useState(-1),[r,i]=o.useState(0),[l,c]=o.useState(-1),m=()=>{t(-1),n(-1),i(0),c(-1)},h=(u,g=!1)=>{u||(u=0),u=Math.abs(u),g||u>_l&&(u=_l),i(parseFloat(u.toFixed(2))),g||c(u*100)};return M(_x,u=>{const g=u.getParser();a===g.furniId&&h(g.height,!0)}),ve(Se.REQUEST_STACK_HEIGHT,u=>{if(!Yi(ye(),u.objectId,u.category))return;const g=H().getRoomObject(u.roomId,u.objectId,u.category);g&&(t(u.objectId),n(u.category),i(g.getLocation().z),c(-1))}),ks(a!==-1&&s!==-1,u=>{u.id!==a||u.category!==s||m()}),o.useEffect(()=>{if(a===-1||l===-1)return;const u=setTimeout(()=>D(new $l(a,~~l)),10);return()=>clearTimeout(u)},[a,l]),{objectId:a,height:r,maxHeight:_l,onClose:m,updateHeight:h}},c_=l_,u_=()=>{const[a,t]=o.useState(-1),[s,n]=o.useState(-1),[r,i]=o.useState("0"),[l,c]=o.useState(""),[m,h]=o.useState(""),[u,g]=o.useState(!1),f=()=>{t(-1),n(-1),i("0"),c(""),h(""),g(!1)},p=j=>{j!==r&&(i(j),H().modifyRoomObjectData(a,s,j,l))},x=j=>{c(j),H().modifyRoomObjectData(a,s,r,j)},I=()=>H().deleteRoomObject(a,s);return ve(Se.REQUEST_STICKIE,j=>{const E=H().getRoomObject(j.roomId,j.objectId,j.category);if(!E)return;const C=E.model.getValue(te.FURNITURE_ITEMDATA);if(C.length<6)return;let b=null,_=null;C.indexOf(" ")>0?(b=C.slice(0,C.indexOf(" ")),_=C.slice(C.indexOf(" ")+1,C.length)):b=C,t(j.objectId),n(j.category),i(b||"0"),c(_||""),h(E.type||"post_it"),g(ye().isRoomOwner||B().isModerator||$t(E))}),ks(a!==-1&&s!==-1,j=>{j.id!==a||j.category!==s||f()}),{objectId:a,color:r,text:l,type:m,canModify:u,updateColor:p,updateText:x,trash:I,onClose:f}},d_=u_,m_=()=>{const[a,t]=o.useState(-1),[s,n]=o.useState(-1),[r,i]=o.useState("1"),[l,c]=o.useState(""),[m,h]=o.useState(""),[u,g]=o.useState(""),f=()=>{t(-1),n(-1),i("1"),c(""),h(""),g("")};return ve(Se.REQUEST_TROPHY,p=>{const x=H().getRoomObject(p.roomId,p.objectId,p.category);if(!x)return;let I=x.model.getValue(te.FURNITURE_DATA);x.model.getValue(te.FURNITURE_EXTRAS),t(p.objectId),n(p.category),i(x.model.getValue(te.FURNITURE_COLOR)||"1");const j=I.substring(0,I.indexOf(" "));I=I.substring(j.length+1,I.length);const E=I.substring(0,I.indexOf(" ")),C=I.substr(E.length+1,I.length);c(j),h(E),g(C)}),ks(a!==-1&&s!==-1,p=>{p.id!==a||p.category!==s||f()}),{objectId:a,color:r,senderName:l,date:m,message:u,onClose:f}},h_=m_,g_=0,f_=1,p_=2,x_=3,j_=()=>{const[a,t]=o.useState(-1),[s,n]=o.useState(-1),[r,i]=o.useState(null),[l,c]=o.useState(null),[m,h]=o.useState(null),[u,g]=o.useState(-1),[f,p]=o.useState(null),[x,I]=o.useState(null),[j,E]=o.useState(!1),C=()=>{t(-1),n(-1),i(null),c(null),h(null),g(-1),p(null),I(null),E(!1)},b=()=>D(new Ea(a,g_)),_=()=>D(new Ea(a,f_)),S=()=>j&&r&&r.length&&D(new Ea(a,p_)),T=()=>j&&r&&r.length&&D(new Ea(a,x_)),L=k=>{if(f===k){p(null),D(new au(a,""));return}p(k),D(new au(a,k))};return ve(Se.REQUEST_YOUTUBE,k=>{if(Er.isRoomPreviewerId(k.roomId))return;const R=H().getRoomObject(k.roomId,k.objectId,k.category);R&&(t(k.objectId),n(k.category),E(B().hasSecurity(no.EMPLOYEE)||$t(R)),D(new Sx(k.objectId)))}),M(wx,k=>{const R=k.getParser();a===-1||a!==R.furniId||(i(R.videoId),c(R.startAtSeconds),h(R.endAtSeconds),g(R.state))}),M(Tx,k=>{const R=k.getParser();a===-1||a!==R.furniId||(I(R.playlists),p(R.selectedPlaylistId),i(null),g(-1),h(null),c(null))}),M(yx,k=>{const R=k.getParser();if(!(a===-1||a!==R.furniId))switch(R.commandId){case 1:g(rr.PLAYING);break;case 2:g(rr.PAUSED);break}}),ks(a!==-1&&s!==-1,k=>{k.id!==a||k.category!==s||C()}),{objectId:a,videoId:r,videoStart:l,videoEnd:m,currentVideoState:u,selectedVideo:f,playlists:x,onClose:C,previous:b,next:_,pause:S,play:T,selectVideo:L}},I_=j_,b_=()=>{const[a,t]=o.useState(null),[s,n]=o.useState([]),[r,i]=o.useState(""),[l,c]=o.useState([]),[m,h]=o.useState(0),[u,g]=o.useState(ue.STUFF_SELECTION_OPTION_NONE),[f,p]=o.useState(5),{showConfirm:x}=Fe(),I=()=>{const E=C=>{C&&(C instanceof Nm?D(new Dx(C.id,s,r,l,m,C.stuffTypeSelectionCode)):C instanceof vm?D(new Px(C.id,s,r,l,C.stuffTypeSelectionCode)):C instanceof _m&&D(new Lx(C.id,s,r,l,C.stuffTypeSelectionCode)))};LC(a.id)?E(a):x(d("wiredfurni.nonowner.change.confirm.body"),()=>{E(a)},null,null,null,d("wiredfurni.nonowner.change.confirm.title"))},j=(E,C)=>{!a||!u||E<=0||c(b=>{const _=[...b],S=b.indexOf(E);return S>=0?(_.splice(S,1),Hn.hide(E)):_.length{E.getParser(),t(null)}),M(Ox,E=>{const C=E.getParser();t(C.definition)}),M(kx,E=>{const C=E.getParser();t(C.definition)}),M(Ax,E=>{const C=E.getParser();t(C.definition)}),o.useEffect(()=>{if(a)return()=>{n([]),i(""),h(0),c(E=>(E&&E.length&&Hn.clearSelectionShaderFromFurni(E),[])),g(ue.STUFF_SELECTION_OPTION_NONE)}},[a]),{trigger:a,setTrigger:t,intParams:s,setIntParams:n,stringParam:r,setStringParam:i,furniIds:l,setFurniIds:c,actionDelay:m,setActionDelay:h,setAllowsFurni:g,saveWired:I,selectObjectForWired:j,maxItemSelectionCount:f,setMaxItemSelectionCount:p}},_e=()=>lt(b_),E_=()=>{const[a,t]=o.useState(null),[s,n]=o.useState(null),[r,i]=o.useState([]),[l,c]=o.useState([]),[m,h]=o.useState(null),[u,g]=o.useState(-1),[f,p]=o.useState(!1),{friends:x=[]}=hs(),{selectObjectForWired:I=null}=_e(),{roomSession:j=null}=ke(),E=T=>{i(L=>{const k=[...L];return k.splice(T,1),k})},C=T=>{c(L=>{const k=[...L],R=k.splice(T,1)[0];return m===R&&h(null),k})},b=T=>{h(T),c([])},_=(T,L)=>{const k=Hr.getObjectName(T,L);k&&(n(k),L!==X.UNIT&&c([]))},S=(T,L)=>{let k=null;switch(L){case X.FLOOR:case X.WALL:k=Hr.getFurniInfo(T,L),k&&I(T,L);break;case X.UNIT:{const R=j.userDataManager.getUserDataByIndex(T);if(!R)break;switch(R.type){case dt.PET:j.userDataManager.requestPetInfo(R.webID),g(R.webID);break;case dt.USER:k=Hr.getUserInfo(L,R);break;case dt.BOT:k=Hr.getBotInfo(L,R);break;case dt.RENTABLE_BOT:k=Hr.getRentableBotInfo(L,R);break}}}k&&t(k)};return He(Mx.USER_DATA_UPDATED,T=>{if(!T.addedUsers.length)return;let L=[];T.addedUsers.forEach(k=>{k.webID===B().userId||k.type!==dt.USER||x.find(R=>R.id===k.webID)&&L.push(new mh(k.roomIndex,X.UNIT,k.webID,k.name,k.type,!0))}),L.length&&i(k=>{const R=[...k];return L.forEach(y=>{const O=R.findIndex(F=>F.id===y.id);O>-1&&R.splice(O,1),R.push(y)}),R})}),He(Ux.PET_INFO,T=>{const L=T.petInfo;if(!L||L.id!==u)return;const k=Hr.getPetInfo(L);k&&(t(k),g(-1))}),He(Fx.PET_STATUS_UPDATE,T=>{}),ve(ou.USE_PRODUCT_FROM_INVENTORY,T=>{}),ve(ou.USE_PRODUCT_FROM_ROOM,T=>{const L=H().getRoomObject(j.roomId,T.objectId,X.FLOOR);if(!L||!$t(L))return;const k=L.model.getValue(te.FURNITURE_OWNER_ID),R=L.model.getValue(te.FURNITURE_TYPE_ID),y=B().getFloorItemData(R),O=y.customParams.split(" "),F=O.length?parseInt(O[0]):-1;if(F===-1)return;const V=[],Y=H().getRoomObjects(j.roomId,X.UNIT);for(const q of Y){const U=j.userDataManager.getUserDataByIndex(q.id);let J=!1;if(!(!U||U.type!==dt.PET)){if(U.ownerId===k){U.hasSaddle&&y.specialType===de.PET_SADDLE&&(J=!0);const je=U.figure.split(" ");if((je.length?parseInt(je[0]):-1)===F){if(y.specialType===de.MONSTERPLANT_REVIVAL&&!U.canRevive||y.specialType===de.MONSTERPLANT_REBREED&&(U.petLevel<7||U.canRevive||U.canBreed)||y.specialType===de.MONSTERPLANT_FERTILIZE&&(U.petLevel>=7||U.canRevive))continue;V.push(new TN(U.roomIndex,X.UNIT,U.name,T.objectId,q.id,-1,J))}}}}h(null),V.length&&c(V)}),ve(bt.REQUEST_MANIPULATION,T=>{Yi(j,T.objectId,T.category)&&p(!0)}),Vc(T=>{S(T.id,T.category)}),Ev(T=>{t(null),c([])}),Nv(T=>{a||T.category!==X.UNIT||_(T.id,T.category)}),Cv(T=>{!s||T.category!==X.UNIT||s.roomIndex!==T.id||n(null)}),ot([Be.FURNI_REMOVED,Be.USER_REMOVED],T=>{if(s&&s.category===T.category&&s.roomIndex===T.id&&n(null),T.category===X.UNIT){let L=r.findIndex(k=>k.roomIndex===T.id);L>-1&&i(k=>k.filter(R=>R.roomIndex===T.id)),L=l.findIndex(k=>k.id===T.id),L>-1&&c(k=>k.filter(R=>R.id!==T.id))}else T.category===X.FLOOR&&l.findIndex(k=>k.id===T.id)>-1&&c(k=>k.filter(R=>R.requestRoomObjectId!==T.id));a&&(a instanceof yr?a.id===T.id&&t(null):(a instanceof Rt||a instanceof Or||a instanceof Rr)&&a.roomIndex===T.id&&t(null))}),o.useEffect(()=>{a&&(n(null),i([]),c([]))},[a]),o.useEffect(()=>{s&&i([])},[s]),o.useEffect(()=>{j&&(j.isDecorating=f)},[j,f]),{avatarInfo:a,setAvatarInfo:t,activeNameBubble:s,setActiveNameBubble:n,nameBubbles:r,productBubbles:l,confirmingProduct:m,isDecorating:f,setIsDecorating:p,removeNameBubble:E,removeProductBubble:C,updateConfirmingProduct:b,getObjectName:_}},C_=E_,N_=()=>{const[a,t]=o.useState(""),[s,n]=o.useState(!1),[r,i]=o.useState(!1),[l,c]=o.useState(!1),[m,h]=o.useState(!1),[u,g]=o.useState(0),{showNitroAlert:f=null,showConfirm:p=null}=Fe(),{roomSession:x=null}=ke(),I=(j,E,C="",b=0,_="")=>{if(j==="")return null;const S=j.split(" ");if(S.length>0){const T=S[0];let L="";if(S.length>1&&(L=S[1]),T.charAt(0)===":"&&L==="x"){const k=H().selectedAvatarId;if(k>-1){const R=x.userDataManager.getUserDataByIndex(k);R&&(L=R.name,j=j.replace(" x"," "+R.name))}}switch(T.toLowerCase()){case":shake":return cu.init(2500,5e3),cu.turnVisualizationOn(),null;case":rotate":return lu.init(2500,5e3),lu.turnVisualizationOn(),null;case":d":case";d":Cs()===Bt.VIP&&x.sendExpressionMessage(hn.LAUGH.ordinal);break;case"o/":case"_o/":return x.sendExpressionMessage(hn.WAVE.ordinal),null;case":kiss":if(Cs()===Bt.VIP)return x.sendExpressionMessage(hn.BLOW.ordinal),null;break;case":jump":if(Cs()===Bt.VIP)return x.sendExpressionMessage(hn.JUMP.ordinal),null;break;case":idle":return x.sendExpressionMessage(hn.IDLE.ordinal),null;case"_b":return x.sendExpressionMessage(hn.RESPECT.ordinal),null;case":sign":return x.sendSignMessage(parseInt(L)),null;case":iddqd":case":flip":return H().events.dispatchEvent(new vi(x.roomId,-1,!0)),null;case":zoom":let k=parseFloat(L);return isNaN(k)&&(k=1),k>=1&&k<=5?H().events.dispatchEvent(new vi(x.roomId,k,!1)):k===0?H().events.dispatchEvent(new vi(x.roomId,1,!1)):H().events.dispatchEvent(new vi(x.roomId,1,!1)),null;case":screenshot":const R=H().createTextureFromRoom(x.roomId,1),y=new Image;return y.src=Cn.generateImageUrl(R),window.open("").document.write(y.outerHTML),null;case":pickall":return(x.isRoomOwner||B().isModerator)&&p(d("room.confirm.pick_all"),()=>{B().sendSpecialCommandMessage(":pickall")},null,null,null,d("generic.alert.title"),null,"pickall"),null;case":ejectall":return(x.isRoomOwner||B().isModerator||x.controllerLevel>=$e.GUEST)&&p(d("room.confirm.eject_all"),()=>{B().sendSpecialCommandMessage(":ejectall")},null,null,null,d("generic.alert.title")),null;case":furni":return Z("furni-chooser/"),null;case":chooser":return Z("user-chooser/"),null;case":floor":case":bcfloor":return x.controllerLevel>=$e.ROOM_OWNER&&Z("floor-editor/show"),null;case":togglefps":return Wn().maxFPS>0?Wn().maxFPS=0:Wn().maxFPS=K("system.animation.fps"),null;case":client":case":nitro":case":billsonnn":return f(),null;case":settings":return(x.isRoomOwner||B().isModerator)&&D(new Sm(x.roomId)),null}}switch(E){case pn.CHAT_DEFAULT:x.sendChatMessage(j,b,_);break;case pn.CHAT_SHOUT:x.sendShoutMessage(j,b,_);break;case pn.CHAT_WHISPER:x.sendWhisperMessage(C,j,b);break}};return He(Ds.FLOOD_EVENT,j=>{h(!0),g(parseFloat(j.message))}),Vc(j=>{if(j.category!==X.UNIT)return;const E=x.userDataManager.getUserDataByIndex(j.id);E&&t(E.name)}),ve(bt.DESELECTED,j=>t("")),o.useEffect(()=>{if(!m)return;let j=0;const E=window.setInterval(()=>{g(C=>(j=(C||0)-1,j)),j<0&&(clearInterval(E),h(!1))},1e3);return()=>clearInterval(E)},[m]),o.useEffect(()=>{if(!l)return;let j=null;return l&&(j=setTimeout(()=>{c(!1),n(!1)},1e4)),()=>clearTimeout(j)},[l]),o.useEffect(()=>{s?r||(i(!0),x.sendChatTypingMessage(s)):r&&(i(!1),x.sendChatTypingMessage(s))},[x,s,r]),{selectedUsername:a,floodBlocked:m,floodBlockedSeconds:u,setIsTyping:n,setIsIdle:c,sendChat:I}},v_=N_,rd=new Map,id=new Map,ad=new Map,__=()=>{const[a,t]=o.useState([]),[s,n]=o.useState({mode:Et.CHAT_MODE_FREE_FLOW,weight:Et.CHAT_BUBBLE_WIDTH_NORMAL,speed:Et.CHAT_SCROLL_SPEED_NORMAL,distance:50,protection:Et.FLOOD_FILTER_NORMAL}),{roomSession:r=null}=ke(),{addChatEntry:i}=ma(),l=o.useRef(!1),c=o.useMemo(()=>{if(!s)return 6e3;switch(s.speed){case Et.CHAT_SCROLL_SPEED_FAST:return 3e3;case Et.CHAT_SCROLL_SPEED_NORMAL:return 6e3;case Et.CHAT_SCROLL_SPEED_SLOW:return 12e3}},[s]),m=g=>{const f=vt().createAvatarImage(g,pc.LARGE,null,{resetFigure:I=>{l.current||m(I)},dispose:()=>{},disposed:!1});if(!f)return;const p=f.getCroppedImage(eo.HEAD),x=f.getPartColor(Ve.CHEST);return rd.set(g,x&&x.rgb||16777215),f.dispose(),id.set(g,p.src),p.src},h=g=>{let f=id.get(g);return f||(f=m(g)),f},u=(g,f,p,x=64,I=null)=>{let j=ad.get(g+I);if(j)return j;const E=new ci(g),C=E.typeId,b=H().getRoomObjectPetImage(C,E.paletteId,E.color,new Ot(f*45),x,null,!1,0,E.customParts,I);return b&&(j=Cn.generateImageUrl(b.data),ad.set(g+I,j)),j};return He(Ds.CHAT_EVENT,g=>{const f=H().getRoomObject(r.roomId,g.objectId,X.UNIT),p=f?th(r.roomId,f==null?void 0:f.id,X.UNIT):new Vs,x=f?r.userDataManager.getUserDataByIndex(g.objectId):new Vx(-1);let I="",j=0,E=null,C=g.chatType,b=g.style,_=0,S=g.message,T=g._chatColours;if(x){_=x.type;const y=x.figure;switch(_){case dt.PET:E=u(y,2,!0,64,f.model.getValue(te.FIGURE_POSTURE)),new ci(y).typeId,T="black";break;case dt.USER:E=h(y);break;case dt.RENTABLE_BOT:case dt.BOT:b=Gx.BOT,T="black";break}j=rd.get(y),I=x.name}switch(C){case Ds.CHAT_TYPE_RESPECT:S=d("widgets.chatbubble.respect",["username"],[I]),K("respect.options").enabled&&vn(K("respect.options").sound);break;case Ds.CHAT_TYPE_PETREVIVE:case Ds.CHAT_TYPE_PET_REBREED_FERTILIZE:case Ds.CHAT_TYPE_PET_SPEED_FERTILIZE:{let y="widget.chatbubble.petrevived";C===Ds.CHAT_TYPE_PET_REBREED_FERTILIZE?y="widget.chatbubble.petrefertilized;":C===Ds.CHAT_TYPE_PET_SPEED_FERTILIZE&&(y="widget.chatbubble.petspeedfertilized");let O=null;if(H().getRoomObject(r.roomId,g.extraParam,X.UNIT)){const V=r.userDataManager.getUserDataByIndex(f.id);V&&(O=V.name)}S=d(y,["petName","userName"],[I,O]);break}case Ds.CHAT_TYPE_PETRESPECT:S=d("widget.chatbubble.petrespect",["petname"],[I]);break;case Ds.CHAT_TYPE_PETTREAT:S=d("widget.chatbubble.pettreat",["petname"],[I]);break;case Ds.CHAT_TYPE_HAND_ITEM_RECEIVED:S=d("widget.chatbubble.handitem",["username","handitem"],[I,d("handitem"+g.extraParam)]);break;case Ds.CHAT_TYPE_MUTE_REMAINING:{const y=(g.extraParam>0?Math.floor(g.extraParam/3600):0).toString(),O=(g.extraParam>0?Math.floor(g.extraParam%3600/60):0).toString(),F=(g.extraParam%60).toString();S=d("widget.chatbubble.mutetime",["hours","minutes","seconds"],[y,O,F]);break}}const L=tN(S),k=j&&("#"+j.toString(16).padStart(6,"0")||null),R=new rc(x.roomIndex,X.UNIT,r.roomId,S,L,I,new Vs(p.x,p.y),C,b,E,k,T);t(y=>[...y,R]),i({id:-1,webId:x.webID,entityId:x.roomIndex,name:I,imageUrl:E,style:b,chatType:C,entityType:x.type,message:L,timestamp:lh(),type:en.TYPE_CHAT,roomId:r.roomId,color:k,chatColours:T})}),ve(Bx.ROOM_DRAG,g=>{if(!a.length||g.roomId!==r.roomId)return;const f=g.offsetX;a.forEach(p=>p.elementRef&&(p.left+=f))}),M(gi,g=>{const f=g.getParser();f.roomEnter&&n(f.chat)}),M(Hx,g=>{const f=g.getParser();n(f.chat)}),o.useEffect(()=>(l.current=!1,()=>{l.current=!0}),[]),{chatMessages:a,setChatMessages:t,chatSettings:s,getScrollSpeed:c}},S_=__,w_=()=>{const[a,t]=o.useState([]),s=i=>{a.indexOf(i)>=0||t([...a,i])},n=i=>{const l=a.indexOf(i);if(l===-1)return;const c=[...a];c.splice(l,1),t(c)},r=(i,l)=>{ye().sendDoorbellApprovalMessage(i,l),n(i)};return He(dl.DOORBELL,i=>s(i.userName)),He(dl.RSDE_REJECTED,i=>n(i.userName)),He(dl.RSDE_ACCEPTED,i=>n(i.userName)),{users:a,addUser:s,removeUser:n,answer:r}},T_=w_,y_=()=>{const[a,t]=o.useState(null),[s,n]=o.useState(!1),r=()=>n(!1);return M(Wx,i=>{const l=i.getParser();n(!0),t(l.words)}),{wordsFilter:a,isVisible:s,setWordsFilter:t,onClose:r}},R_=y_,O_=()=>{const[a,t]=o.useState([]),{requests:s=[],dismissedRequestIds:n=[],setDismissedRequestIds:r=null}=hs(),i=o.useMemo(()=>a.filter(c=>n.indexOf(c.request.requesterUserId)===-1),[a,n]),l=c=>{r(m=>{if(m.indexOf(c)>=0)return m;const h=[...m];return h.push(c),h})};return Sh(!0,c=>{if(c.category!==X.UNIT)return;const m=ye().userDataManager.getUserDataByIndex(c.id);if(!m||m.type!==uu.getTypeNumber(uu.USER))return;const h=s.find(g=>g.requesterUserId===m.webID);if(!h||a.find(g=>g.request.requesterUserId===m.webID))return;const u=[...a];u.push({roomIndex:m.roomIndex,request:h}),t(u)}),wh(!0,c=>{if(c.category!==X.UNIT)return;const m=a.findIndex(u=>u.roomIndex===c.id);if(m===-1)return;const h=[...a];h.splice(m,1),t(h)}),o.useEffect(()=>{const c=[];for(const m of s){const h=ye().userDataManager.getUserData(m.requesterUserId);h&&c.push({roomIndex:h.roomIndex,request:m})}t(c)},[s]),{displayedRequests:i,hideFriendRequest:l}},k_=O_,A_=()=>{const[a,t]=o.useState(null),{roomSession:s=null}=ke(),n=()=>t(null),r=l=>l&&H().selectRoomObject(ye().roomId,l.id,l.category),i=()=>{const l=B(),c=H().getRoomObjects(s.roomId,X.WALL),m=H().getRoomObjects(s.roomId,X.FLOOR),h=c.map(g=>{if(g.id<0)return null;let f=g.type;if(f.startsWith("poster"))f=d(`poster_${f.replace("poster","")}_name`);else{const p=g.model.getValue(te.FURNITURE_TYPE_ID),x=l.getWallItemData(p);x&&x.name.length&&(f=x.name)}return new Yr(g.id,X.WALL,f)}),u=m.map(g=>{if(g.id<0)return null;let f=g.type;const p=g.model.getValue(te.FURNITURE_TYPE_ID),x=l.getFloorItemData(p);return x&&x.name.length&&(f=x.name),new Yr(g.id,X.FLOOR,f)});t([...h,...u].sort((g,f)=>g.name{if(l.id<0)return;const c=H().getRoomObject(ye().roomId,l.id,l.category);if(!c)return;let m=null;switch(l.category){case X.WALL:{let h=c.type;if(h.startsWith("poster"))h=d(`poster_${h.replace("poster","")}_name`);else{const u=c.model.getValue(te.FURNITURE_TYPE_ID),g=B().getWallItemData(u);g&&g.name.length&&(h=g.name)}m=new Yr(c.id,X.WALL,h);break}case X.FLOOR:{let h=c.type;const u=c.model.getValue(te.FURNITURE_TYPE_ID),g=B().getFloorItemData(u);g&&g.name.length&&(h=g.name),m=new Yr(c.id,X.FLOOR,h)}}t(h=>[...h,m].sort((u,g)=>u.name{l.id<0||t(c=>{const m=[...c];for(let h=0;h{const[a,t]=o.useState(!1),[s,n]=o.useState(-1),[r,i]=o.useState(""),[l,c]=o.useState(""),[m,h]=o.useState(""),u=()=>{h(""),c(""),i(""),n(-1),t(!1)},g=()=>{D(new qx(s,l))},f=x=>{c(x),m.length>0&&h("")},p=x=>{if(!(!x||x===0))switch(x){case 1:return d("catalog.alert.petname.long");case 2:return d("catalog.alert.petname.short");case 3:return d("catalog.alert.petname.chars");case 4:default:return d("catalog.alert.petname.bobba")}};return He(du.RSOPPE_OPEN_PET_PACKAGE_REQUESTED,x=>{if(!x)return;const I=H().getRoomObject(x.session.roomId,x.objectId,X.FLOOR);n(x.objectId),i(I.type),t(!0)}),He(du.RSOPPE_OPEN_PET_PACKAGE_RESULT,x=>{x&&(x.nameValidationStatus===0&&u(),x.nameValidationStatus!==0&&h(p(x.nameValidationStatus)))}),{isVisible:a,errorResult:m,petName:l,objectType:r,onChangePetName:f,onConfirm:g,onClose:u}},L_=P_,M_=()=>{const{roomSession:a=null}=ke(),t=r=>a.sendPollStartMessage(r),s=r=>a.sendPollRejectMessage(r),n=(r,i,l)=>a.sendPollAnswerMessage(r,i,l);return He(ml.OFFER,r=>{const i=new Xn(Xn.OFFER,r.id);i.summary=r.summary,i.headline=r.headline,Ct(i)}),He(ml.ERROR,r=>{const i=new Xn(Xn.ERROR,r.id);i.summary=r.summary,i.headline=r.headline,Ct(i)}),He(ml.CONTENT,r=>{const i=new Xn(Xn.CONTENT,r.id);i.startMessage=r.startMessage,i.endMessage=r.endMessage,i.numQuestions=r.numQuestions,i.questionArray=r.questionArray,i.npsPoll=r.npsPoll,Ct(i)}),{startPoll:t,rejectPoll:s,answerPoll:n}},U_=M_,F_=()=>{const[a,t]=o.useState(null),{roomSession:s=null}=ke(),n=()=>t(null),r=l=>l&&H().selectRoomObject(ye().roomId,l.id,l.category),i=()=>{const l=ye(),c=H().getRoomObjects(l.roomId,X.UNIT);t(c.map(m=>{if(m.id<0)return null;const h=l.userDataManager.getUserDataByIndex(m.id);return h?new Yr(h.roomIndex,X.UNIT,h.name):null}).sort((m,h)=>m.name{if(l.id<0)return;const c=ye().userDataManager.getUserDataByIndex(l.id);c&&t(m=>{const h=[...m];return h.push(new Yr(c.roomIndex,X.UNIT,c.name)),h.sort((u,g)=>u.name{l.id<0||t(c=>{const m=[...c];for(let h=0;h{const[a,t]=o.useState(-1),[s,n]=o.useState(null),[r,i]=o.useState(!1),[l,c]=o.useState(null),[m,h]=o.useState(new Map),[u,g]=o.useState(new Map),{answerPoll:f=null}=U_(),{roomSession:p=null}=ke(),x=()=>{t(-1),n(null)},I=j=>{r||!s||(f(a,s.id,[j]),i(!0))};return He(hl.ANSWERED,j=>{const E=p.userDataManager.getUserData(j.userId);E&&(h(j.answerCounts),g(C=>{if(!C.has(E.roomIndex)){const b=new Map(u);return b.set(E.roomIndex,{value:j.value,secondsLeft:G_}),b}return C}),H().updateRoomObjectUserGesture(p.roomId,E.roomIndex,ai.getGestureId(j.value==="0"?ai.GESTURE_SAD:ai.GESTURE_SMILE)))}),He(hl.FINISHED,j=>{s&&s.id===j.questionId&&(h(j.answerCounts),i(!0),c(E=>(E&&clearTimeout(E),setTimeout(()=>x(),od)))),g(new Map)}),He(hl.QUESTION,j=>{t(j.id),n(j.question),i(!1),h(new Map),g(new Map),c(E=>{if(E&&clearTimeout(E),j.duration>0){const C=j.duration<1e3?od:j.duration;return setTimeout(()=>x(),C)}return null})}),o.useEffect(()=>{const j=()=>{g(C=>{const b=[];if(C.forEach((S,T)=>{S.secondsLeft--,S.secondsLeft<=0&&b.push(T)}),b.length===0)return C;const _=new Map(C);return b.forEach(S=>_.delete(S)),_})},E=setInterval(()=>j(),1e3);return()=>clearInterval(E)},[]),o.useEffect(()=>()=>{c(j=>(j&&clearTimeout(j),null))},[]),{question:s,answerSent:r,answerCounts:m,userAnswers:u,vote:I}},H_=B_,W_=()=>{const[a,t]=o.useState(null),[s,n]=o.useState(null),[r,i]=In("chatStyleId",0),[l,c]=In("chatColour",""),[m,h]=o.useState(0),[u,g]=o.useState(0),[f,p]=In("nitroScreensize",{width:window.innerWidth,height:window.innerHeight}),x=C=>{i(C),D(new Yx(C))},I=C=>{c(C)},j=C=>{B().giveRespect(C),h(B().respectsLeft)},E=C=>{B().givePetRespect(C),g(B().respectsPetLeft)};return M(bm,C=>{const b=C.getParser();t(b.userInfo),n(b.userInfo.figure),h(b.userInfo.respectsRemaining),g(b.userInfo.respectsPetRemaining)}),M(zx,C=>{const b=C.getParser();n(b.figure)}),o.useEffect(()=>{const C=$o("nitroScreensize");if(C&&(C.width!==window.innerWidth||C.height!==window.innerHeight)){let _=window.localStorage.length;for(;_>0;){const S=window.localStorage.key(_);S&&S.startsWith("nitro.window")&&window.localStorage.removeItem(S),_--}}const b=_=>p({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",b),()=>{window.removeEventListener("resize",b)}},[p]),{userInfo:a,userFigure:s,chatStyleId:r,userRespectRemaining:m,petRespectRemaining:u,respectUser:j,respectPet:E,updateChatStyleId:x,updateChatColour:I,chatColour:l}},zn=()=>lt(W_),q_=a=>o.useEffect(a,[]),Bc=a=>q_(()=>a()),z_=()=>{const{showConfirm:a=null}=Fe(),t=n=>{if(n.target instanceof HTMLAnchorElement&&n.target.href){n.stopPropagation(),n.preventDefault();const r=n.target.href;if(r.includes("youtube.com")||r.includes("youtu.be")){const i=s(r);i&&Z("youtube-tv/show/"+i)}else a(d("chat.confirm.openurl",["url"],[r]),()=>{window.open(r,"_blank")},null,null,null,d("generic.alert.title"),null,"link")}},s=n=>{const r=/(?:http:\/\/|https:\/\/)?(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?.*v=|shorts\/)?([a-zA-Z0-9_-]{11})/,i=n.match(r);return i?i[1]:null};return{onClickChat:t}},Rh=()=>lt(z_),nl=a=>{var j,E;const{rows:t=[],overscan:s=5,scrollToBottom:n=!1,rowRender:r=null}=a,i=t.length-1,l=o.useRef(null),{getVirtualItems:c,getTotalSize:m,scrollToIndex:h=null,measureElement:u}=$x({count:t.length,getScrollElement:()=>l.current,estimateSize:()=>8,overscan:s}),g=c(),f=m(),p=g.length>0&&((j=g==null?void 0:g[0])==null?void 0:j.start)||0,x=g.length>0?f-(((E=g==null?void 0:g[g.length-1])==null?void 0:E.end)||0):0,I=C=>{if(!l.current)return!1;const b=l.current,_=b.querySelector(`[data-index="${C-1}"]`);if(!_)return!1;const S=_.getBoundingClientRect(),{scrollTop:T,scrollHeight:L,clientHeight:k}=b;return T+k+S.height>=L-S.height};return Bc(()=>{setTimeout(()=>h(i),0)}),o.useEffect(()=>{n&&I(i)&&h(i)},[n,i,h]),e.jsxs(A,{fit:!0,innerRef:l,position:"relative",overflow:"auto",children:[p>0&&e.jsx("div",{style:{minHeight:`${p}px`}}),g.map(C=>{const b=t[C.index];return b?e.jsx("div",{"data-index":C.index,ref:u,children:r(b)},C.key):e.jsx(o.Fragment,{},C.key)}),x>0&&e.jsx("div",{style:{minHeight:`${x}px`}})]})},Lt=a=>{const{disabledButton:t,max:s,min:n,value:r,onChange:i,...l}=a;return e.jsxs(w,{fullWidth:!0,gap:1,children:[!t&&e.jsx(P,{disabled:n>=r,onClick:()=>i(ni(s>r?r+1:s,0),children:e.jsx(Qx,{})})]})},N=a=>{const{variant:t="black",fontWeight:s=null,fontSize:n=0,align:r=null,bold:i=!1,underline:l=!1,italics:c=!1,truncate:m=!1,center:h=!1,textEnd:u=!1,small:g=!1,wrap:f=!1,noWrap:p=!1,textBreak:x=!1,...I}=a,j=o.useMemo(()=>{const E=["d-inline"];return t&&E.push("text-"+t),i&&E.push("fw-bold"),s&&E.push("fw-"+s),n&&E.push("fs-"+n),r&&E.push("text-"+r),l&&E.push("text-decoration-underline"),c&&E.push("fst-italic"),m&&E.push("text-truncate"),h&&E.push("text-center"),u&&E.push("text-end"),g&&E.push("small"),f&&E.push("text-wrap"),p&&E.push("text-nowrap"),x&&E.push("text-break"),E},[t,s,n,r,i,l,c,m,h,u,g,f,p,x]);return e.jsx(A,{classNames:j,...I})},Y_=a=>{const{isError:t=!1,message:s="",percent:n=0}=a;return e.jsx(v,{fullHeight:!0,position:"relative",className:"nitro-loading",children:e.jsx(A,{fullHeight:!0,className:"container h-100",children:e.jsxs(v,{fullHeight:!0,alignItems:"center",justifyContent:"end",children:[e.jsx(A,{className:"connecting-duck"}),e.jsx(A,{className:"logo"}),e.jsx(v,{size:6,className:"text-center py-4",children:t&&s&&s.length?e.jsx(A,{className:"fs-4 text-shadow",children:s}):e.jsxs(e.Fragment,{children:[e.jsxs(N,{fontSize:4,variant:"white",className:"text-shadow",children:["The hotel is loading ",n.toFixed(),"%..."]}),e.jsx(Mc,{progress:n,className:"mt-2 large"})]})})]})})})},Oh=a=>{const{achievement:t=null,scale:s=1,...n}=a;return t?e.jsx(mt,{badgeCode:bs.getAchievementBadgeCode(t),isGrayscale:!bs.getAchievementHasStarted(t),scale:s,...n}):null},$_=a=>{const{achievement:t=null}=a,{selectedAchievement:s=null,setSelectedAchievementId:n=null}=el();return t?e.jsx(Ce,{itemActive:s===t,itemUnseen:t.unseen>0,onClick:r=>n(t.achievementId),children:e.jsx(Oh,{achievement:t})}):null},K_=a=>{const{achievements:t=null}=a;return e.jsx(Pe,{columnCount:6,columnMinWidth:50,columnMinHeight:50,children:t&&t.length>0&&t.map((s,n)=>e.jsx($_,{achievement:s},n))})},X_=a=>{const{achievement:t=null}=a;return t?e.jsxs(w,{shrink:!0,className:"bg-muted rounded p-2 text-black",gap:2,overflow:"hidden",children:[e.jsxs(v,{center:!0,gap:1,children:[e.jsx(Oh,{className:"nitro-achievements-badge-image",achievement:t,scale:2}),e.jsx(N,{fontWeight:"bold",children:d("achievements.details.level",["level","limit"],[bs.getAchievementLevel(t).toString(),t.levelCount.toString()])})]}),e.jsxs(v,{fullWidth:!0,justifyContent:"center",overflow:"hidden",children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{fontWeight:"bold",truncate:!0,children:fi(bs.getAchievementBadgeCode(t))}),e.jsx(N,{textBreak:!0,children:Tc(bs.getAchievementBadgeCode(t))})]}),(t.levelRewardPoints>0||t.scoreLimit>0)&&e.jsxs(v,{gap:1,children:[t.levelRewardPoints>0&&e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(N,{truncate:!0,className:"small",children:d("achievements.details.reward")}),e.jsxs(w,{center:!0,className:"fw-bold small",gap:1,children:[t.levelRewardPoints,e.jsx(Nt,{type:t.levelRewardPointType})]})]}),t.scoreLimit>0&&e.jsx(Mc,{text:d("achievements.details.progress",["progress","limit"],[(t.currentPoints+t.scoreAtStartOfLevel).toString(),(t.scoreLimit+t.scoreAtStartOfLevel).toString()]),progress:t.currentPoints+t.scoreAtStartOfLevel,maxProgress:t.scoreLimit+t.scoreAtStartOfLevel})]})]})]}):null},Q_=a=>{const{category:t=null}=a,{selectedAchievement:s=null,setSelectedAchievementId:n=null}=el();return o.useEffect(()=>{var r,i;t&&(s||n((i=(r=t==null?void 0:t.achievements)==null?void 0:r[0])==null?void 0:i.achievementId))},[t,s,n]),t?e.jsxs(v,{fullHeight:!0,justifyContent:"between",children:[e.jsx(K_,{achievements:t.achievements}),!!s&&e.jsx(X_,{achievement:s})]}):null},J_=a=>{const{category:t=null,selectedCategoryCode:s=null,setSelectedCategoryCode:n=null}=a;if(!t)return null;const r=bs.getAchievementCategoryProgress(t),i=bs.getAchievementCategoryMaxProgress(t),l=bs.getAchievementCategoryImageUrl(t,r),c=bs.getAchievementCategoryTotalUnseen(t);return e.jsxs(Ce,{itemActive:s===t.code,itemCount:c,itemCountMinimum:0,gap:1,onClick:m=>n(t.code),children:[e.jsx(N,{fullWidth:!0,center:!0,small:!0,className:"pt-1",children:d(`quests.${t.code}.name`)}),e.jsx(fh,{position:"relative",imageUrl:l,children:e.jsxs(N,{fullWidth:!0,center:!0,position:"absolute",variant:"white",style:{fontSize:12,bottom:9},children:[r," / ",i]})})]})},Z_=a=>{const{categories:t=null,selectedCategoryCode:s=null,setSelectedCategoryCode:n=null}=a;return e.jsx(Pe,{columnCount:3,columnMinWidth:90,columnMinHeight:100,children:t&&t.length>0&&t.map((r,i)=>e.jsx(J_,{category:r,selectedCategoryCode:s,setSelectedCategoryCode:n},i))})},eS=a=>{const[t,s]=o.useState(!1),{achievementCategories:n=[],selectedCategoryCode:r=null,setSelectedCategoryCode:i=null,achievementScore:l=0,getProgress:c=0,getMaxProgress:m=0,selectedCategory:h=null}=el();return o.useEffect(()=>{const u={linkReceived:g=>{const f=g.split("/");if(!(f.length<2))switch(f[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(p=>!p);return}},eventUrlPrefix:"achievements/"};return ht(u),()=>gt(u)},[]),t?e.jsxs(ie,{uniqueKey:"achievements",className:"nitro-achievements",theme:"primary-slim",children:[e.jsx(re,{headerText:d("inventory.achievements"),onCloseClick:u=>s(!1)}),h&&e.jsxs(Qm,{position:"relative",className:"justify-content-center align-items-center cursor-pointer",gap:3,children:[e.jsx(A,{onClick:u=>i(null),className:"nitro-achievements-back-arrow"}),e.jsxs(v,{grow:!0,gap:0,children:[e.jsx(N,{fontSize:4,fontWeight:"bold",className:"text-small",children:d(`quests.${h.code}.name`)}),e.jsx(N,{children:d("achievements.details.categoryprogress",["progress","limit"],[h.getProgress().toString(),h.getMaxProgress().toString()])})]}),e.jsx(wn,{imageUrl:bs.getAchievementCategoryImageUrl(h,null,!0)})]}),e.jsxs(se,{gap:1,children:[!h&&e.jsxs(e.Fragment,{children:[e.jsx(Z_,{categories:n,selectedCategoryCode:r,setSelectedCategoryCode:i}),e.jsxs(v,{grow:!0,justifyContent:"end",gap:1,children:[e.jsx(N,{small:!0,center:!0,children:d("achievements.categories.score",["score"],[l.toString()])}),e.jsx(Mc,{text:d("achievements.categories.totalprogress",["progress","limit"],[c.toString(),m.toString()]),progress:c,maxProgress:m})]})]}),h&&e.jsx(Q_,{category:h})]})]}):null},tS=a=>{const{figureData:t=null}=a,[s,n]=o.useState(-1),r=i=>{iCa.MAX_DIRECTION&&(i=i-(Ca.MAX_DIRECTION+1)),t.direction=i};return o.useEffect(()=>{if(t)return t.notify=()=>n(i=>i+1),()=>{t.notify=null}},[t]),e.jsxs(v,{className:"figure-preview-container",overflow:"hidden",position:"relative",children:[e.jsx(nt,{figure:t.getFigureString(),direction:t.direction,scale:2}),e.jsx(A,{className:"avatar-shadow"}),e.jsx(A,{className:"arrow-container",children:e.jsx("i",{className:"icon arrow-left",onClick:i=>r(t.direction+1)})})]})},$r=a=>{const{icon:t=null,selected:s=!1,classNames:n=[],children:r=null,...i}=a,l=o.useMemo(()=>{const c=["nitro-avatar-editor-spritesheet"];return t&&t.length&&c.push(t+"-icon"),s&&c.push("selected"),n.length&&c.push(...n),c},[t,s,n]);return e.jsx(A,{classNames:l,...i})},sS=a=>{const{partItem:t=null,children:s=null,...n}=a,[r,i]=o.useState(-1),l=K("hc.disabled",!1);return o.useEffect(()=>{const c=()=>i(m=>m+1);return t.notify=c,()=>t.notify=null},[t]),e.jsx("div",{className:"avatar-container",children:e.jsxs(Ce,{className:`avatar-parts ${t.isSelected?"part-selected":""}`,itemImage:t.isClear?void 0:t.imageUrl,...n,children:[!l&&t.isHC&&e.jsx("i",{className:"icon hc-icon position-absolute"}),t.isClear&&e.jsx($r,{icon:"clear"}),t.isSellable&&e.jsx($r,{icon:"sellable",position:"absolute",className:"end-1 bottom-1"}),s]})})},nS=[3111,3110,3109,3030,3114,266,265,262,3113,3112,691,690,667],rS=[3128,3127,3126,3125,3124,3123,3122,3121,3120,3119],iS=[3116,281,275,715,700,696,3006],aS=[3115,3068,906],oS=a=>{const{model:t=null,category:s=null,isFromFootballGate:n=!1,setMaxPaletteCount:r=null}=a,i=o.useRef(null),l=o.useCallback(c=>{const m=s.parts.indexOf(c);if(m===-1)return;if(c.isHC&&B().clubLevel===Bt.NO_CLUB)return Z("habboUI/open/hccenter");t.selectPart(s.name,m);const h=s.getCurrentPart();r(h.maxColorIndex||1)},[t,s,r]);return o.useEffect(()=>{!t||!s||!i||!i.current||(i.current.scrollTop=0)},[t,s]),e.jsx(Pe,{className:"clothing-container",innerRef:i,columnCount:3,columnMinHeight:50,children:s.parts.length>0&&s.parts.map(c=>(!n||n&&nS.includes(c.id)||rS.includes(c.id)||iS.includes(c.id)||aS.includes(c.id))&&e.jsx(sS,{partItem:c,onClick:m=>l(c)},c.id))})},lS=a=>{const{itemImage:t=void 0,itemColor:s=void 0,itemActive:n=!1,itemCount:r=1,itemCountMinimum:i=1,itemUniqueSoldout:l=!1,itemUniqueNumber:c=-2,itemUnseen:m=!1,itemHighlight:h=!1,disabled:u=!1,center:g=!0,column:f=!0,style:p={},classNames:x=[],position:I="relative",overflow:j="hidden",children:E=null,...C}=a,b=o.useMemo(()=>{const S=["layout-grid-item","color-picker-frame"];return n&&S.push("active"),(l||c>0)&&S.push("unique-item"),l&&S.push("sold-out"),m&&S.push("unseen"),h&&S.push("has-highlight"),u&&S.push("disabled"),t===null&&S.push("icon","loading-icon"),x.length&&S.push(...x),S},[n,l,c,m,h,u,t,x]),_=o.useMemo(()=>{let S={...p};return t&&(S.backgroundImage=`url(${t})`),s&&(S.backgroundColor=s),Object.keys(p).length&&(S={...S,...p}),S},[p,t,s]);return e.jsxs(v,{center:g,pointer:!0,position:I,overflow:j,column:f,classNames:b,style:_,...C,children:[r>i&&e.jsx(En,{className:"text-black",count:r}),c>0&&e.jsxs(e.Fragment,{children:[e.jsx(A,{fit:!0,className:"unique-bg-override",style:{backgroundImage:`url(${t})`}}),e.jsx("div",{className:"position-absolute bottom-0 unique-item-counter",children:e.jsx(kr,{value:c})})]}),E]})},cS=a=>{const{colorItem:t=null,children:s=null,...n}=a,[r,i]=o.useState(-1),l=K("hc.disabled",!1);return o.useEffect(()=>{const c=()=>i(m=>m+1);return t.notify=c,()=>t.notify=null},[t]),e.jsxs(lS,{itemHighlight:!0,itemColor:t.color,itemActive:t.isSelected,className:"color-picker-frame clear-bg",...n,children:[!l&&t.isHC&&e.jsx("i",{className:"icon hc-icon position-absolute"}),s]})},ld=a=>{const{model:t=null,category:s=null,paletteSet:n=[],paletteIndex:r=-1}=a,i=o.useRef(null),l=o.useCallback(c=>{const m=n.indexOf(c);if(m!==-1){if(c.isHC&&B().clubLevel===Bt.NO_CLUB)return Z("habboUI/open/hccenter");t.selectColor(s.name,m,r)}},[t,s,n,r]);return o.useEffect(()=>{!t||!s||!i||!i.current||(i.current.scrollTop=0)},[t,s]),e.jsx(Pe,{className:"py-1 avatar-editor-palette-set-view",innerRef:i,gap:1,columnCount:8,columnMinWidth:14,children:n.length>0&&n.map((c,m)=>e.jsx(cS,{colorItem:c,onClick:h=>l(c)},m))})},uS=["ch","cp","lg","sh"],dS=a=>{const{model:t=null,gender:s=null,isFromFootballGate:n=!1,setGender:r=null}=a,[i,l]=o.useState(null),[c,m]=o.useState(1),h=o.useCallback(u=>{const g=t.categories.get(u);if(g){g.init(),l(g);for(const f of g.parts)if(!(!f||!f.isSelected)){m(f.maxColorIndex||1);break}}},[t]);return o.useEffect(()=>{t.init();for(const u of t.categories.keys()){h(u);break}},[t,h]),!t||!i?null:e.jsx(ne,{children:e.jsxs(v,{className:"choose-clothing overflow-y-auto overflow-x-hidden",children:[e.jsxs(w,{className:"px-3",gap:4,children:[t.canSetGender&&e.jsxs(e.Fragment,{children:[e.jsxs(w,{center:!0,pointer:!0,className:"category-item",gap:3,onClick:u=>r(Ne.MALE),children:[e.jsx($r,{icon:"male",selected:s===Ne.MALE}),e.jsx(N,{bold:!0,children:d("avatareditor.generic.boy")})]}),e.jsxs(w,{center:!0,pointer:!0,className:"category-item",gap:3,onClick:u=>r(Ne.FEMALE),children:[e.jsx($r,{icon:"female",selected:s===Ne.FEMALE}),e.jsx(N,{bold:!0,children:d("avatareditor.generic.girl")})]})]}),!t.canSetGender&&t.categories&&t.categories.size>0&&Array.from(t.categories.keys()).map(u=>{const g=t.categories.get(u);return e.jsx("div",{children:e.jsxs(w,{center:!0,pointer:!0,className:"category-item",onClick:f=>h(u),children:[n&&uS.includes(g.name)&&e.jsx($r,{icon:g.name,selected:i===g}),!n&&e.jsx($r,{icon:g.name,selected:i===g})]})},u)})]}),e.jsx(v,{className:"avatar-parts-container",size:5,overflow:"hidden",children:e.jsx(oS,{model:t,category:i,isFromFootballGate:n,setMaxPaletteCount:m})}),e.jsxs(v,{overflow:"hidden",className:c===2?"avatar-color-palette-container dual-palette":"avatar-color-palette-container",children:[c>=1&&e.jsx(ld,{model:t,category:i,paletteSet:i.getPalette(0),paletteIndex:0}),c===2&&e.jsx(ld,{model:t,category:i,paletteSet:i.getPalette(1),paletteIndex:1})]})]})})},mS=a=>{const{figureData:t=null,savedFigures:s=[],setSavedFigures:n=null,loadAvatarInEditor:r=null}=a,i=K("hc.disabled",!1),l=o.useCallback(u=>{if(u>=s.length||u<0)return;const[g,f]=s[u];r(g.getFigureString(),f)},[s,r]),c=o.useCallback(u=>{if(!t||u>=s.length||u<0)return;if(B().clubLevel===Bt.NO_CLUB)return Z("habboUI/open/hccenter");const g=[...s],f=t.getFigureString(),p=t.gender;g[u]=[vt().createFigureContainer(f),p],n(g),D(new Jx(u+1,f,p))},[t,s,n]),m=o.useCallback(()=>{let u=0;return s.forEach(([g,f])=>{if(g){const p=vt().getFigureClubLevel(g,f);u=Math.max(u,p)}}),u},[s]),h=o.useMemo(()=>{if(!s||!s.length)return[];const u=[];return s.forEach(([g,f],p)=>{let x=0;g&&(x=vt().getFigureClubLevel(g,f)),u.push(e.jsxs(w,{alignItems:"center",justifyContent:"center",children:[e.jsxs(w,{gap:1,column:!0,className:"button-container",children:[e.jsx("button",{className:"saved-outfit-button",onClick:I=>c(p),disabled:x>Cs()&&!i,children:e.jsx(Zx,{})}),g&&e.jsx("button",{className:"saved-outfit-button",onClick:I=>l(p),disabled:x>Cs()&&!i,children:e.jsx(ej,{})})]}),e.jsx("div",{className:"avatar-container",children:g&&e.jsx(nt,{className:"avatar-figure",figure:g.getFigureString(),gender:f,direction:4})})]},p))}),u},[s,c,l]);return e.jsxs("div",{children:[e.jsxs("div",{className:"d-flex flex-column align-items-center",children:[e.jsx("span",{className:"saved-outfits-title",children:d("avatareditor.wardrobe.title")}),e.jsx("span",{className:"mt-2",children:!i&&m()>0&&e.jsx(Nt,{type:"hc"})})]}),e.jsx("div",{className:"saved-outfit-container mt-2",children:e.jsx("div",{className:"nitro-avatar-editor-wardrobe-container",children:h})})]})},hS="hr-100.hd-180-7.ch-215-66.lg-270-79.sh-305-62.ha-1002-70.wa-2007",gS="hr-515-33.hd-600-1.ch-635-70.lg-716-66-62.sh-735-68",fS=a=>{const[t,s]=o.useState(!1),[n,r]=o.useState(null),[i,l]=o.useState(null),[c,m]=o.useState(null),[h,u]=o.useState(null),[g,f]=o.useState([]),[p,x]=o.useState([]),[I,j]=o.useState([]),[E,C]=o.useState(!1),[b,_]=o.useState(null),[S,T]=o.useState(null),[L,k]=o.useState(!0),[R,y]=o.useState(!1),[O,F]=o.useState(null),[V,Y]=o.useState(null),q=JSON.parse(window.localStorage.getItem("nitro.look.footballgate.M"))||"ch-3109-92-1408.lg-3116-82-1408.sh-3115-1408-1408",U=JSON.parse(window.localStorage.getItem("nitro.look.footballgate.F"))||"ch-3112-1408-1408.lg-3116-71-1408.sh-3115-1408-1408",J=o.useMemo(()=>K("avatar.wardrobe.max.slots",10),[]),je=()=>{F(null),Y(null),s(!1)};M(rj,me=>{const he=me.getParser();f(he.figureSetIds),x(he.boundsFurnitureNames)}),M(ij,me=>{const he=me.getParser(),le=[];let Ae=0;for(;Ae{c&&u(c.get(me))},[c]),pt=o.useCallback(()=>{const me=new Map;O?(me.set(Us.TORSO,new Du),me.set(Us.LEGS,new Au)):(me.set(Us.GENERIC,new BC),me.set(Us.HEAD,new oN),me.set(Us.TORSO,new Du),me.set(Us.LEGS,new Au)),m(me)},[O]),Xt=o.useCallback(()=>{const me=new Map,he=new Ne,le=new Ne;he.loadAvatarData(hS,Ne.MALE),le.loadAvatarData(gS,Ne.FEMALE),me.set(Ne.MALE,he),me.set(Ne.FEMALE,le),r(me),l(me.get(Ne.MALE))},[]),Oe=o.useCallback((me,he,le=!0)=>{he=wt.getGender(he);let Ae=i;he!==Ae.gender&&(Ae=n.get(he)),me!==Ae.getFigureString()&&Ae.loadAvatarData(me,he),Ae!==i&&l(Ae),le&&(_(i.getFigureString()),T(i.gender))},[n,i]),kt=o.useCallback(me=>{switch(me){case ln.ACTION_CLEAR:Oe(i.getFigureStringWithFace(0,!1),i.gender,!1),pt();return;case ln.ACTION_RESET:Oe(b,S),pt();return;case ln.ACTION_RANDOMIZE:const he=aN(i,i.gender,Cs(),g,[Ne.FACE]);Oe(he,i.gender,!1),pt();return;case ln.ACTION_SAVE:D(O?new tj(V,O,i.getFigureString()):new wm(i.gender,i.getFigureString())),Oc(`nitro.look.footballgate.${O}`,i.getFigureString()),je();return}},[Oe,i,pt,b,S,g,O,V]),Re=o.useCallback(me=>{me=wt.getGender(me),l(n.get(me))},[n]);if(o.useEffect(()=>{const me={linkReceived:he=>{const le=he.split("/");if(F(le[2]?le[2]:null),Y(le[3]?Number(le[3]):null),!(le.length<2))switch(le[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(Ae=>!Ae);return}},eventUrlPrefix:"avatar-editor/"};return ht(me),()=>gt(me)},[]),o.useEffect(()=>{j(new Array(J))},[J]),o.useEffect(()=>{D(new aj)},[]),o.useEffect(()=>{c&&we(O?Us.TORSO:Us.GENERIC)},[c,O,we]),o.useEffect(()=>{if(i)return wt.CURRENT_FIGURE=i,pt(),()=>wt.CURRENT_FIGURE=null},[i,pt]),o.useEffect(()=>(wt.FIGURE_SET_IDS=g,wt.BOUND_FURNITURE_NAMES=p,pt(),()=>{wt.FIGURE_SET_IDS=null,wt.BOUND_FURNITURE_NAMES=null}),[g,p,pt]),o.useEffect(()=>{if(t&&!n){Xt(),y(!0);return}},[t,n,Xt]),o.useEffect(()=>{!t||!R||!L||(O||Oe(B().figure,B().gender),O&&Oe(O===Ne.MALE?q:U,O),k(!1))},[t,R,L,Oe,O,q,U]),o.useEffect(()=>{if(t)return()=>{Xt(),C(!1),k(!0)}},[t,O,Xt]),o.useEffect(()=>{if(!t)return()=>{k(!0)}},[t]),!t||!i)return null;const Qt=`nitro-avatar-editor no-resize ${E?"expanded":""}`;return e.jsxs(ie,{uniqueKey:"avatar-editor",className:Qt,children:[e.jsx(re,{headerText:d(O?"widget.furni.clothingchange.editor.title":"avatareditor.title"),onCloseClick:je}),e.jsxs(Tn,{className:"avatar-editor-tabs",children:[c&&c.size>0&&Array.from(c.keys()).map(me=>{const he=h&&h.name===me;return e.jsx(tn,{isActive:he,onClick:le=>we(me),children:e.jsx("div",{className:`tab ${me}`})},me)}),!O&&e.jsx(tn,{onClick:me=>C(!E),children:e.jsx("div",{className:"tab-wardrobe"})})]}),e.jsx(se,{children:e.jsxs(ne,{children:[e.jsx(v,{size:E?6:8,overflow:"hidden",children:h&&e.jsx(dS,{model:h,gender:i.gender,setGender:Re})}),e.jsx(v,{size:E?6:4,overflow:"hidden",children:e.jsxs(w,{gap:2,className:"w-100 h-100",children:[e.jsxs(w,{column:!0,className:"w-100",children:[e.jsx(tS,{figureData:i}),e.jsxs(v,{grow:!0,gap:1,children:[!O&&e.jsxs(bn,{className:"action-buttons w-100",children:[e.jsx(P,{variant:"secondary",onClick:me=>kt(ln.ACTION_RESET),children:e.jsx(sj,{className:"fa-icon"})}),e.jsx(P,{variant:"secondary",onClick:me=>kt(ln.ACTION_CLEAR),children:e.jsx(jc,{className:"fa-icon"})}),e.jsx(P,{variant:"secondary",onClick:me=>kt(ln.ACTION_RANDOMIZE),children:e.jsx(nj,{className:"fa-icon"})})]}),e.jsx(P,{className:"w-10",variant:"success",onClick:me=>kt(ln.ACTION_SAVE),children:d("avatareditor.save")})]})]}),E&&e.jsx(v,{overflow:"hidden",className:"w-100",children:e.jsx(mS,{figureData:i,savedFigures:I,setSavedFigures:j,loadAvatarInEditor:Oe})})]})})]})})]})},pS=5,xS=a=>{const{onClose:t=null,onEdit:s=null,onDelete:n=null}=a,{cameraRoll:r=null,setCameraRoll:i=null,selectedPictureIndex:l=-1,setSelectedPictureIndex:c=null}=bh(),{simpleAlert:m=null}=Fe(),h=o.useRef(),u=l>-1?r[l]:null,g=()=>{if(!h||!h.current)return null;const p=h.current.getBoundingClientRect();return new lm(Math.floor(p.x),Math.floor(p.y),Math.floor(p.width),Math.floor(p.height))},f=()=>{if(l>-1){c(-1);return}const p=H().createTextureFromRoom(ye().roomId,1,g()),x=[...r];x.length>=pS&&(m(d("camera.full.body")),x.pop()),vn(_n.CAMERA_SHUTTER),x.push(new lN(p,Cn.generateImageUrl(p))),i(x)};return e.jsx(kN,{uniqueKey:"nitro-camera-capture",children:e.jsxs(v,{center:!0,className:"nitro-camera-capture",gap:0,children:[u&&e.jsx("img",{alt:"",className:"camera-area",src:u.imageUrl}),e.jsxs("div",{className:"camera-canvas drag-handler",children:[e.jsx("div",{className:"position-absolute info-camera",onClick:()=>Z("habbopages/camera")}),e.jsx("div",{className:"position-absolute header-close",onClick:t,children:e.jsx(Hs,{className:"fa-icon"})}),!u&&e.jsx("div",{ref:h,className:"camera-area camera-view-finder"}),u&&e.jsx("div",{className:"camera-area camera-frame",children:e.jsxs("div",{className:"camera-frame-preview-actions w-100 position-absolute bottom-0 py-2 text-center",children:[e.jsx("button",{className:"btn btn-success me-3",title:d("camera.editor.button.tooltip"),onClick:s,children:d("camera.editor.button.text")}),e.jsx("button",{className:"btn btn-danger",onClick:n,children:d("camera.delete.button.text")})]})}),e.jsx("div",{className:"d-flex justify-content-center",children:e.jsx("div",{className:"camera-button",title:d("camera.take.photo.button.tooltip"),onClick:f})})]}),r.length>0&&e.jsx(w,{gap:2,justifyContent:"center",className:"camera-roll d-flex justify-content-center py-2",children:r.map((p,x)=>e.jsx("img",{alt:"",src:p.imageUrl,onClick:I=>c(x)},x))})]})})},jS=a=>{const{base64Url:t=null,onCloseClick:s=null,onCancelClick:n=null,price:r=null}=a,[i,l]=o.useState(null),[c,m]=o.useState(null),[h,u]=o.useState(0),[g,f]=o.useState(!1),[p,x]=o.useState(!1),[I,j]=o.useState(0),{simpleAlert:E}=Fe(),C=o.useMemo(()=>K("camera.publish.disabled",!1),[]);M(oj,_=>{u(S=>S+1),x(!1)}),M(lj,_=>{const S=_.getParser();S.ok||E(d("camera.publish.wait",["minutes"],[Math.floor(S.secondsToWait/60).toString().replace("-","")]),null,null,null,d("camera.purchase.pleasewait")),m(S.extraDataId),j(S.secondsToWait),f(S.ok),x(!1)}),M(cj,_=>{const S=_.getParser();l(K("camera.url")+"/"+S.url)}),M(uj,_=>{const S=_.getParser();if(!S)return null;S.notEnoughCredits&&!S.notEnoughActivityPoints&&E(d("catalog.alert.notenough.credits.description"),null,null,null,d("catalog.alert.notenough.title")),!S.notEnoughCredits&&S.notEnoughActivityPoints&&E(d(`catalog.alert.notenough.activitypoints.description.${S.activityPointType}`),null,null,null,d(`catalog.alert.notenough.activitypoints.title.${S.activityPointType}`)),x(!1)});const b=(_,S=null)=>{switch(_){case"close":s();return;case"buy":if(p)return;x(!0),D(new mj(""));return;case"publish":if(p)return;x(!0),D(new dj);return;case"cancel":n();return}};return o.useEffect(()=>{t&&H().saveBase64AsScreenshot(t)},[t]),r?e.jsxs(ie,{className:"nitro-camera-checkout",theme:"primary-slim",children:[e.jsx(re,{headerText:d("camera.confirm_phase.title"),onCloseClick:_=>b("close")}),e.jsxs(se,{children:[e.jsxs(w,{center:!0,children:[i&&i.length&&e.jsx(wn,{className:"picture-preview border",imageUrl:i}),(!i||!i.length)&&e.jsx(w,{center:!0,className:"picture-preview border",children:e.jsx(N,{bold:!0,children:d("camera.loading")})})]}),e.jsxs(w,{justifyContent:"between",alignItems:"center",className:"bg-muted rounded p-2",children:[e.jsxs(v,{size:C?10:6,gap:1,children:[e.jsx(N,{bold:!0,children:d("camera.purchase.header")}),(r.credits>0||r.duckets>0)&&e.jsxs(w,{gap:1,children:[e.jsx(N,{children:d("catalog.purchase.confirmation.dialog.cost")}),r.credits>0&&e.jsxs(w,{gap:1,children:[e.jsx(N,{bold:!0,children:r.credits}),e.jsx(Nt,{type:-1})]}),r.duckets>0&&e.jsxs(w,{gap:1,children:[e.jsx(N,{bold:!0,children:r.duckets}),e.jsx(Nt,{type:5})]})]}),h>0&&e.jsxs(N,{children:[e.jsx(N,{bold:!0,children:d("camera.purchase.count.info")})," ",h,e.jsx("u",{className:"ms-1 cursor-pointer",onClick:()=>Z("inventory/toggle"),children:d("camera.open.inventory")})]})]}),e.jsx(w,{alignItems:"center",children:e.jsx(P,{variant:"success",disabled:p,onClick:_=>b("buy"),children:d(h?"camera.buy.another.button.text":"buy")})})]}),!C&&e.jsxs(w,{justifyContent:"between",alignItems:"center",className:"bg-muted rounded p-2",children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d(g?"camera.publish.successful":"camera.publish.explanation")}),e.jsx(N,{children:d(g?"camera.publish.success.short.info":"camera.publish.detailed.explanation")}),g&&e.jsx("a",{href:c,rel:"noreferrer",target:"_blank",children:d("camera.link.to.published")}),!g&&r.publishDucketPrice>0&&e.jsxs(w,{gap:1,children:[e.jsx(N,{children:d("catalog.purchase.confirmation.dialog.cost")}),e.jsxs(w,{gap:1,children:[e.jsx(N,{bold:!0,children:r.publishDucketPrice}),e.jsx(Nt,{type:5})]})]}),I>0&&e.jsx("div",{className:"mt-1 text-center fw-bold",children:d("camera.publish.wait",["minutes"],[Math.ceil(I/60).toString()])})]}),!g&&e.jsx(w,{className:"d-flex align-items-end",children:e.jsx(P,{variant:"success",disabled:p||I>0,onClick:_=>b("publish"),children:d("camera.publish.button.text")})})]}),e.jsx(N,{center:!0,children:d("camera.warning.disclaimer")}),e.jsx(w,{justifyContent:"end",children:e.jsx(P,{onClick:_=>b("cancel"),children:d("generic.cancel")})})]})]}):null},IS=a=>{const{effect:t=null,thumbnailUrl:s=null,isActive:n=!1,isLocked:r=!1,selectEffect:i=null,removeEffect:l=null}=a;return e.jsxs(Ce,{title:d(r?`camera.effect.required.level ${t.minLevel}`:`camera.effect.name.${t.name}`),itemActive:n,onClick:c=>!n&&i(),children:[n&&e.jsx(P,{variant:"danger",className:"rounded-circle remove-effect",onClick:l,children:e.jsx(Hs,{className:"fa-icon"})}),!r&&s&&s.length>0&&e.jsx("div",{className:"effect-thumbnail-image border",children:e.jsx("img",{alt:"",src:s})}),r&&e.jsxs(N,{center:!0,bold:!0,children:[e.jsx("div",{children:e.jsx(hj,{className:"fa-icon"})}),t.minLevel]})]})},bS=a=>{const{myLevel:t=0,selectedEffects:s=[],effects:n=[],thumbnails:r=[],processAction:i=null}=a;return e.jsx(ne,{columnCount:3,overflow:"auto",children:n&&n.length>0&&n.map((l,c)=>{const m=r.find(u=>u.effectName===l.name),h=s.findIndex(u=>u.effect.name===l.name)>-1;return e.jsx(IS,{effect:l,thumbnailUrl:m&&m.thumbnailUrl||null,isActive:h,isLocked:l.minLevel>t,selectEffect:()=>i("select_effect",l.name),removeEffect:()=>i("remove_effect",l.name)},c)})})},cd=[ea.COLORMATRIX,ea.COMPOSITE],ES=a=>{const{picture:t=null,availableEffects:s=null,myLevel:n=1,onClose:r=null,onCancel:i=null,onCheckout:l=null}=a,[c,m]=o.useState(cd[0]),[h,u]=o.useState(null),[g,f]=o.useState([]),[p,x]=o.useState([]),[I,j]=o.useState(!1),E=o.useMemo(()=>s.filter(y=>y.colorMatrix),[s]),C=o.useMemo(()=>s.filter(y=>y.texture),[s]),b=o.useCallback(()=>c===ea.COLORMATRIX?E:C,[c,E,C]),_=o.useCallback(y=>!y||!y.length||!g||!g.length?-1:g.findIndex(O=>O.effect.name===y),[g]),S=o.useMemo(()=>_(h),[h,_]),T=o.useMemo(()=>h&&g[S]||null,[h,S,g]),L=o.useCallback(y=>{const O=S;O!==-1&&f(F=>{const V=[...F],Y=V[O];return V[S]=new gl(Y.effect,y),V})},[S,f]),k=o.useMemo(()=>Si().applyEffects(t.texture,g,I).src,[t,g,I]),R=o.useCallback((y,O=null)=>{switch(y){case"close":r();return;case"cancel":i();return;case"checkout":l(k);return;case"change_tab":m(String(O));return;case"select_effect":{if(_(O)>=0)return;const V=s.find(Y=>Y.name===O);if(!V)return;f(Y=>[...Y,new gl(V,1)]),u(V.name);return}case"remove_effect":{let F=_(O);if(F===-1)return;f(V=>{const Y=[...V];return Y.splice(F,1),Y}),h===O&&u(null);return}case"clear_effects":u(null),f([]);return;case"download":{const F=new Image;F.src=k,window.open("").document.write(F.outerHTML);return}case"zoom":j(!I);return}},[I,s,h,k,_,i,l,r,j,f]);return o.useEffect(()=>{const y=[];for(const O of s)y.push(new cN(O.name,Si().applyEffects(t.texture,[new gl(O,1)],!1).src));x(y)},[t,s]),e.jsxs(ie,{className:"nitro-camera-editor",children:[e.jsx(re,{headerText:d("camera.editor.button.text"),onCloseClick:y=>R("close")}),e.jsx(Tn,{children:cd.map(y=>e.jsx(tn,{isActive:c===y,onClick:O=>R("change_tab",y),children:e.jsx("i",{className:"icon icon-camera-"+y})},y))}),e.jsx(se,{children:e.jsxs(ne,{children:[e.jsx(v,{size:5,overflow:"hidden",children:e.jsx(bS,{myLevel:n,selectedEffects:g,effects:b(),thumbnails:p,processAction:R})}),e.jsxs(v,{size:7,justifyContent:"between",overflow:"hidden",children:[e.jsxs(v,{center:!0,children:[e.jsx(wn,{imageUrl:k,className:"picture-preview"}),h&&e.jsxs(v,{center:!0,fullWidth:!0,gap:1,children:[e.jsx(N,{children:d("camera.effect.name."+h)}),e.jsx(Lt,{min:0,max:1,step:.01,value:T.alpha,onChange:y=>L(y),renderThumb:(y,O)=>e.jsx("div",{...y,children:O.valueNow})})]})]}),e.jsxs(w,{justifyContent:"between",children:[e.jsxs(bn,{children:[e.jsx(P,{onClick:y=>R("clear_effects"),children:e.jsx(jc,{className:"fa-icon"})}),e.jsx(P,{onClick:y=>R("download"),children:e.jsx(gj,{className:"fa-icon"})}),e.jsxs(P,{onClick:y=>R("zoom"),children:[I&&e.jsx(Tm,{className:"fa-icon"}),!I&&e.jsx(ym,{className:"fa-icon"})]})]}),e.jsxs(w,{gap:1,children:[e.jsx(P,{onClick:y=>R("cancel"),children:d("generic.cancel")}),e.jsx(P,{onClick:y=>R("checkout"),children:d("camera.preview.button.text")})]})]})]})]})})]})},Wr=0,Ma=1,ud=2,dd=3,CS=a=>{const[t,s]=o.useState(Wr),[n,r]=o.useState(null),{availableEffects:i=[],selectedPictureIndex:l=-1,cameraRoll:c=[],setCameraRoll:m=null,myLevel:h=0,price:u={credits:0,duckets:0,publishDucketPrice:0}}=bh(),g=x=>{switch(x){case"close":s(Wr);return;case"edit":s(ud);return;case"delete":m(I=>{const j=[...I];return j.splice(l,1),j});return;case"editor_cancel":s(Ma);return}},f=x=>{if(!x.startsWith("data:image/"))return;const j=p(x);j&&(r(j),s(dd))},p=x=>x.startsWith("data:image/")?x:null;return He(Pt.ENDED,x=>s(Wr)),o.useEffect(()=>{const x={linkReceived:I=>{const j=I.split("/");if(!(j.length<2))switch(j[1]){case"show":s(Ma);return;case"hide":s(Wr);return;case"toggle":s(E=>E?Wr:Ma);return}},eventUrlPrefix:"camera/"};return ht(x),()=>gt(x)},[]),t===Wr?null:e.jsxs(e.Fragment,{children:[t===Ma&&e.jsx(xS,{onClose:()=>g("close"),onEdit:()=>g("edit"),onDelete:()=>g("delete")}),t===ud&&e.jsx(ES,{picture:c[l],myLevel:h,onClose:()=>g("close"),onCancel:()=>g("editor_cancel"),onCheckout:f,availableEffects:i}),t===dd&&e.jsx(jS,{base64Url:n,onCloseClick:()=>g("close"),onCancelClick:()=>g("editor_cancel"),price:u})]})},NS=a=>{const{itemId:t=-1,state:s=null,product:n=null,active:r=!1,onClick:i=null}=a,l=c=>{let m=B().getFloorItemDataByName(c),h=null;return m?h=H().getFurnitureFloorIconUrl(m.id):(m=B().getWallItemDataByName(c),m&&(h=H().getFurnitureWallIconUrl(m.id))),h};return e.jsxs(v,{fit:!0,center:!0,pointer:!0,className:`campaign-spritesheet campaign-day-generic-bg rounded calendar-item ${r?"active":""}`,onClick:()=>i(t),children:[s===ns.STATE_UNLOCKED&&e.jsx(w,{center:!0,className:"campaign-spritesheet unlocked-bg",children:e.jsx(w,{center:!0,className:"campaign-spritesheet campaign-opened",children:n&&e.jsx(wn,{imageUrl:n.customImage?K("image.library.url")+n.customImage:l(n.productName)})})}),s!==ns.STATE_UNLOCKED&&e.jsxs(w,{center:!0,className:"campaign-spritesheet locked-bg",children:[s===ns.STATE_LOCKED_AVAILABLE&&e.jsx(A,{className:"campaign-spritesheet available"}),(s===ns.STATE_LOCKED_EXPIRED||s===ns.STATE_LOCKED_FUTURE)&&e.jsx(A,{className:"campaign-spritesheet unavailable"})]})]})},Sl=5,vS=a=>{const{onClose:t=null,campaignName:s=null,currentDay:n=null,numDays:r=null,missedDays:i=null,openedDays:l=null,openPackage:c=null,receivedProducts:m=null}=a,[h,u]=o.useState(n),[g,f]=o.useState(Math.max(0,h-1)),p=b=>l.includes(b)?ns.STATE_UNLOCKED:b>n?ns.STATE_LOCKED_FUTURE:i.includes(b)?ns.STATE_LOCKED_EXPIRED:ns.STATE_LOCKED_AVAILABLE,x=b=>{switch(p(b)){case ns.STATE_UNLOCKED:return d("campaign.calendar.info.unlocked");case ns.STATE_LOCKED_FUTURE:return d("campaign.calendar.info.future");case ns.STATE_LOCKED_EXPIRED:return d("campaign.calendar.info.expired");default:return d("campaign.calendar.info.available.desktop")}},I=()=>{const b=h+1;b!==r&&(u(b),g+Sl{const b=h-1;b<0||(u(b),g>b&&f(g-1))},E=b=>{if(h===b){p(b)===ns.STATE_LOCKED_AVAILABLE&&c(b,!1);return}u(b)},C=()=>{const b=h;p(b)!==ns.STATE_UNLOCKED&&c(b,!0)};return e.jsxs(ie,{className:"nitro-campaign-calendar",theme:"primary-slim",children:[e.jsx(re,{headerText:d(`campaign.calendar.${s}.title`),onCloseClick:t}),e.jsxs(se,{children:[e.jsxs(ne,{fullHeight:!1,justifyContent:"between",alignItems:"center",children:[e.jsx(v,{size:1}),e.jsx(v,{size:10,children:e.jsxs(w,{justifyContent:"between",alignItems:"center",gap:1,children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{fontSize:3,children:d("campaign.calendar.heading.day",["number"],[(h+1).toString()])}),e.jsx(N,{children:x(h)})]}),e.jsx("div",{children:B().isModerator&&e.jsx(P,{variant:"danger",onClick:C,children:"Force open"})})]})}),e.jsx(v,{size:1})]}),e.jsxs(w,{fullHeight:!0,gap:2,children:[e.jsx(w,{center:!0,children:e.jsx(A,{pointer:!0,className:"campaign-spritesheet prev",onClick:j})}),e.jsx(v,{center:!0,fullWidth:!0,children:e.jsx(ne,{fit:!0,columnCount:Sl,gap:1,children:[...Array(Sl)].map((b,_)=>{const S=g+_;return e.jsx(v,{overflow:"hidden",children:e.jsx(NS,{itemId:S,state:p(S),active:h===S,product:m.has(S)?m.get(S):null,onClick:E})},_)})})}),e.jsx(w,{center:!0,children:e.jsx(A,{pointer:!0,className:"campaign-spritesheet next",onClick:I})})]})]})]})},_S=a=>{const[t,s]=o.useState(null),[n,r]=o.useState(-1),[i,l]=o.useState(new Map),[c,m]=o.useState(!1),h=(u,g=!1)=>{t&&(r(u),D(g?new fj(t.campaignName,u):new pj(t.campaignName,u)))};return M(xj,u=>{const g=u.getParser();g&&s(g.calendarData)}),M(jj,u=>{const g=u.getParser();if(!g)return;const f=n;g.doorOpened&&(s(p=>{const x=p.clone();return x.openedDays.push(n),x}),l(p=>{const x=new Map(p);return x.set(f,new uN(g.productName,g.customImage,g.furnitureClassName)),x})),r(-1)}),o.useEffect(()=>{const u={linkReceived:g=>{const f=g.split("/");if(!(f.length<2))switch(f[1]){case"calendar":m(!0);break}},eventUrlPrefix:"openView/"};return ht(u),()=>gt(u)},[]),e.jsx(e.Fragment,{children:t&&c&&e.jsx(vS,{onClose:()=>m(!1),campaignName:t.campaignName,currentDay:t.currentDay,numDays:t.campaignDays,openedDays:t.openedDays,missedDays:t.missedDays,openPackage:h,receivedProducts:i})})},kh=a=>{const{icon:t=0}=a,s=o.useMemo(()=>K("catalog.asset.icon.url").replace("%name%",t.toString()),[t]);return e.jsx(wn,{imageUrl:s,style:{width:20,height:20}})},SS=a=>{const[t,s]=o.useState(!1),[n,r]=o.useState(0),[i,l]=o.useState(0),[c,m]=o.useState(""),[h,u]=o.useState(""),[g,f]=o.useState(!0),[p,x]=o.useState(""),[I,j]=o.useState([]),[E,C]=o.useState(0),[b,_]=o.useState(0),[S,T]=o.useState(0),[L,k]=o.useState(0),[R,y]=o.useState(0),[O,F]=o.useState(!1),{catalogOptions:V=null,getNodesByOfferId:Y=null}=Le(),{friends:q}=hs(),{giftConfiguration:U=null}=V,[J,je]=o.useState([]),[we,pt]=o.useState([]),[Xt,Oe]=o.useState(!0),kt=o.useCallback(()=>{s(!1),r(0),l(0),m(""),u(""),f(!0),x(""),C(0),_(0),Oe(!1),pt([]),I.length&&T(I[0].id)},[I]),Re=o.useMemo(()=>U?U.defaultStuffTypes.findIndex(Te=>Te===J[E])>-1:!1,[J,U,E]),Qt=o.useMemo(()=>U?(J[E]*1e3+U.ribbonTypes[b]).toString():"",[U,E,b,J]),me=o.useMemo(()=>{if(!U||Re)return!1;const Te=J[E];return!(Te===8||Te>=3&&Te<=6)},[U,E,Re,J]),he=o.useMemo(()=>Re?J[E]:S,[Re,J,E,S]),le=q.filter(Te=>Te.id!==-1),Ae=Te=>{const Ke=Te.target.value;let rt=[];Ke.length>0&&(rt=le.sort().filter(Jt=>Jt.name.includes(Ke))),u(Ke),Oe(!0),pt(rt)},Ht=Te=>{u(Te),Oe(!1)},os=o.useCallback(Te=>{switch(Te){case"prev_box":C(rt=>rt===0?L:rt-1);return;case"next_box":C(rt=>rt===L?0:rt+1);return;case"prev_ribbon":_(rt=>rt===0?R:rt-1);return;case"next_ribbon":_(rt=>rt===R?0:rt+1);return;case"buy":if(!h||h.length===0){F(!0);return}let Ke=n;if(Ke===-1){const rt=Y(i);rt&&(Ke=rt[0].pageId)}D(new Ij(Ke,i,c,h,p,he,E,b,g));return}},[he,c,L,R,p,i,n,h,E,b,g,Y]);M(bj,Te=>F(!0)),ot([Sn.PURCHASE_SUCCESS,Ar.INIT_GIFT],Te=>{switch(Te.type){case Sn.PURCHASE_SUCCESS:kt();return;case Ar.INIT_GIFT:const Ke=Te;kt(),r(Ke.pageId),l(Ke.offerId),m(Ke.extraData),s(!0);return}}),o.useEffect(()=>{F(!1)},[h]);const nn=o.useCallback(()=>{U&&je(Te=>{let Ke=[...U.boxTypes];return Ke.push(U.defaultStuffTypes[Math.floor(Math.random()*(U.defaultStuffTypes.length-1))]),k(Ke.length-1),y(Ke.length-1),Ke})},[U]);if(o.useEffect(()=>{if(!U)return;const Te=[];for(const Ke of U.stuffTypes){const rt=B().getFloorItemData(Ke);rt&&(rt.colors&&rt.colors.length>0?Te.push({id:Ke,color:ms.makeColorNumberHex(rt.colors[0])}):Te.push({id:Ke,color:"#000000"}))}nn(),Te.length&&(T(Te[0].id),j(Te))},[U,nn]),o.useEffect(()=>{t&&nn()},[nn,t]),!U||!U.isEnabled||!t)return null;const $n="catalog.gift_wrapping_new.box."+(Re?"default":J[E]),_s=`catalog.gift_wrapping_new.ribbon.${b}`,Rn="catalog.gift_wrapping_new."+(Re?"freeprice":"price");return e.jsxs(ie,{uniqueKey:"catalog-gift",className:"nitro-catalog-gift",theme:"primary-slim",children:[e.jsx(re,{headerText:d("catalog.gift_wrapping.title"),onCloseClick:kt}),e.jsxs(se,{className:"text-black",children:[e.jsxs(FN,{column:!0,children:[e.jsx(N,{children:d("catalog.gift_wrapping.receiver")}),e.jsx("input",{type:"text",className:zt("form-control form-control-sm",O&&"is-invalid"),value:h,onChange:Te=>Ae(Te)}),we.length>0&&Xt&&e.jsx(v,{className:"autocomplete-gift-container",children:we.map(Te=>e.jsx(A,{className:"autocomplete-gift-item",onClick:Ke=>Ht(Te.name),children:Te.name},Te.id))}),O&&e.jsx(A,{className:"invalid-feedback",children:d("catalog.gift_wrapping.receiver_not_found.title")})]}),e.jsx(ph,{figure:B().figure,userName:B().userName,message:p,editable:!0,onChange:Te=>x(Te)}),e.jsxs(A,{className:"form-check",children:[e.jsx("input",{className:"form-check-input",type:"checkbox",name:"showMyFace",checked:g,onChange:Te=>f(Ke=>!Ke)}),e.jsx("label",{className:"form-check-label",children:d("catalog.gift_wrapping.show_face.title")})]}),e.jsxs(w,{alignItems:"center",gap:2,children:[S&&e.jsx(A,{className:"gift-preview",children:e.jsx(Qo,{productType:fe.FLOOR,productClassId:he,extraData:Qt})}),e.jsxs(v,{gap:1,children:[e.jsxs(w,{gap:2,children:[e.jsxs(bn,{children:[e.jsx(P,{variant:"primary",onClick:()=>os("prev_box"),children:e.jsx(Ss,{className:"fa-icon"})}),e.jsx(P,{variant:"primary",onClick:()=>os("next_box"),children:e.jsx(ws,{className:"fa-icon"})})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{fontWeight:"bold",children:d($n)}),e.jsxs(w,{alignItems:"center",gap:1,children:[d(Rn,["price"],[U.price.toString()]),e.jsx(Nt,{type:-1})]})]})]}),e.jsxs(w,{alignItems:"center",gap:2,className:me?"":"opacity-50 pointer-events-none",children:[e.jsxs(bn,{children:[e.jsx(P,{variant:"primary",onClick:()=>os("prev_ribbon"),children:e.jsx(Ss,{className:"fa-icon"})}),e.jsx(P,{variant:"primary",onClick:()=>os("next_ribbon"),children:e.jsx(ws,{className:"fa-icon"})})]}),e.jsx(N,{fontWeight:"bold",children:d(_s)})]})]})]}),e.jsxs(v,{gap:1,className:me?"":"opacity-50 pointer-events-none",children:[e.jsx(N,{fontWeight:"bold",children:d("catalog.gift_wrapping.pick_color")}),e.jsx(bn,{fullWidth:!0,children:I.map(Te=>e.jsx(P,{variant:"dark",active:Te.id===S,disabled:!me,style:{backgroundColor:Te.color},onClick:()=>T(Te.id)},Te.id))})]}),e.jsxs(w,{justifyContent:"between",alignItems:"center",children:[e.jsx(P,{variant:"link",onClick:kt,className:"text-black",children:d("cancel")}),e.jsx(P,{variant:"success",onClick:()=>os("buy"),children:d("catalog.gift_wrapping.give_gift")})]})]})]})},wS=a=>{const[t,s]=o.useState(""),{currentType:n=null,rootNode:r=null,offersToNodes:i=null,searchResult:l=null,setSearchResult:c=null,setCurrentPage:m=null}=Le();return o.useEffect(()=>{let h=t==null?void 0:t.toLocaleLowerCase().replace(" ","");if(!h||!h.length){c(null);return}const u=setTimeout(()=>{const g=B().getAllFurnitureData({loadFurnitureData:null});if(!g||!g.length)return;const f=[],p=[];for(const j of g){if(n===Gs.BUILDER&&!j.availableForBuildersClub||n===Gs.NORMAL&&j.excludeDynamic)continue;const E=[j.className,j.name,j.description].join(" ").replace(/ /gi,"").toLowerCase();if(!(n===Gs.BUILDER&&j.purchaseOfferId===-1&&j.rentOfferId===-1)){if([..._u(i,j.purchaseOfferId),..._u(i,j.rentOfferId)].length&&(E.indexOf(h)>=0&&f.push(j),f.length===250))break}}const x=[];for(const j of f)x.push(new RC(j));let I=[];Zm(h,p,r,I),c(new DC(h,x,I.filter(j=>j.isVisible))),m(new ao(-1,"default_3x3",new eh([],[]),x,!1,1))},300);return()=>clearTimeout(u)},[i,n,r,t,m,c]),e.jsxs(w,{gap:1,children:[e.jsx(w,{fullWidth:!0,alignItems:"center",position:"relative",children:e.jsx("input",{type:"text",className:"form-control form-control-sm",placeholder:d("generic.search"),value:t,onChange:h=>s(h.target.value)})}),(!t||!t.length)&&e.jsx(P,{variant:"primary",className:"catalog-search-button",children:e.jsx(Ej,{className:"fa-icon"})}),t&&!!t.length&&e.jsx(P,{variant:"primary",className:"catalog-search-button",onClick:h=>s(""),children:e.jsx(Hs,{className:"fa-icon"})})]})},Ah=a=>{const{node:t=null,child:s=!1}=a;return e.jsx(e.Fragment,{children:t&&t.children.length>0&&t.children.map((n,r)=>n.isVisible?e.jsx(Dh,{node:n,child:s},r):null)})},Dh=a=>{const{node:t=null,child:s=!1}=a,{activateNode:n=null}=Le();return e.jsxs(A,{className:"nitro-catalog-navigation-section",children:[e.jsxs(Ce,{gap:1,column:!1,itemActive:t.isActive,onClick:r=>n(t),className:s?"inset":"",children:[e.jsx(kh,{icon:t.iconId}),e.jsx(N,{grow:!0,truncate:!0,children:t.localization}),t.isBranch&&e.jsxs(e.Fragment,{children:[t.isOpen&&e.jsx(hc,{className:"fa-icon blackselectiongen"}),!t.isOpen&&e.jsx(gc,{className:"fa-icon blackselectiongen"})]})]}),t.isOpen&&t.isBranch&&e.jsx(Ah,{node:t,child:!0})]})},TS=a=>{const{node:t=null}=a,{searchResult:s=null}=Le();return e.jsxs(e.Fragment,{children:[e.jsx(wS,{}),e.jsx(v,{fullHeight:!0,className:"nitro-catalog-navigation-grid-container rounded p-1",overflow:"hidden",children:e.jsxs(Pe,{id:"nitro-catalog-main-navigation",gap:1,columnCount:1,children:[s&&s.filteredNodes.length>0&&s.filteredNodes.map((n,r)=>e.jsx(Dh,{node:n},r)),!s&&e.jsx(Ah,{node:t})]})})]})},yS=a=>{const{columnCount:t=5,...s}=a,[n,r]=o.useState(!1),[i,l]=o.useState(null),{currentOffer:c=null,setPurchaseOptions:m=null}=Le(),{badgeCodes:h=[],activate:u=null,deactivate:g=null}=ga(),f=o.useMemo(()=>{if(!i)return null;const p=new aa;return p.setValue(["0",i,"",""]),p},[i]);return o.useEffect(()=>{c&&m(p=>{const x={...p};return x.extraParamRequired=!0,x.extraData=f&&f.getValue(1)||null,x.previewStuffData=f,x})},[c,f,m]),o.useEffect(()=>{if(!n)return;const p=u();return()=>g(p)},[n,u,g]),o.useEffect(()=>(r(!0),()=>r(!1)),[]),e.jsx(Pe,{columnCount:t,...s,children:h&&h.length>0&&h.map((p,x)=>e.jsx(Ce,{itemActive:i===p,onClick:I=>l(p),children:e.jsx(mt,{badgeCode:p})},x))})},rl=a=>{const{currentPage:t=null,setCurrentOffer:s=null}=Le();return o.useEffect(()=>{!t||!t.offers.length||s(t.offers[0])},[t,s]),null},Hc=a=>{const{offer:t=null,selectOffer:s=null,itemActive:n=!1,...r}=a,[i,l]=o.useState(!1),{requestOfferToMover:c=null}=Le(),{isVisible:m=!1}=ur(),h=o.useMemo(()=>t.pricingModel===Gt.PRICING_MODEL_BUNDLE?null:t.product.getIconUrl(t),[t]),u=f=>{switch(f.type){case be.MOUSE_DOWN:s(t),l(!0);return;case be.MOUSE_UP:l(!1);return;case be.ROLL_OUT:if(!i||!n||!m)return;c(t);return}},g=t.product;return g?e.jsx(Ce,{itemImage:h,itemCount:t.pricingModel===Gt.PRICING_MODEL_MULTI?g.productCount:1,itemUniqueSoldout:g.uniqueLimitedItemSeriesSize&&!g.uniqueLimitedItemsLeft,itemUniqueNumber:g.uniqueLimitedItemSeriesSize,itemActive:n,onMouseDown:u,onMouseUp:u,onMouseOut:u,...r,children:t.product.productType===fe.ROBOT&&e.jsx(nt,{figure:t.product.extraParam,headOnly:!0,direction:3})}):null},fa=a=>{const{columnCount:t=5,children:s=null,...n}=a,{currentOffer:r=null,setCurrentOffer:i=null,currentPage:l=null,setPurchaseOptions:c=null}=Le(),m=o.useRef();if(o.useEffect(()=>{m&&m.current&&(m.current.scrollTop=0)},[l]),!l)return null;const h=u=>{u.activate(),!u.isLazy&&(i(u),u.product&&u.product.productType===fe.WALL&&c(g=>{const f={...g};return f.extraData=u.product.extraParam||null,f}))};return e.jsxs(Pe,{innerRef:m,columnCount:t,...n,children:[l.offers&&l.offers.length>0&&l.offers.map((u,g)=>e.jsx(Hc,{itemActive:r&&r.offerId===u.offerId,offer:u,selectOffer:h},g)),s]})},il=a=>{const{children:t=null,...s}=a,{currentOffer:n=null}=Le();return!n||n.pricingModel!==Gt.PRICING_MODEL_SINGLE||!n.product.isUniqueLimitedItem?null:e.jsxs(A,{...s,children:[e.jsx(DN,{className:"mx-auto",uniqueLimitedItemsLeft:n.product.uniqueLimitedItemsLeft,uniqueLimitedSeriesSize:n.product.uniqueLimitedItemSeriesSize}),t]})},sn=a=>{const{noGiftOption:t=!1,purchaseCallback:s=null}=a,[n,r]=o.useState(Je.NONE),[i]=In(Qi.CATALOG_SKIP_PURCHASE_CONFIRMATION,!1),{currentOffer:l=null,purchaseOptions:c=null,setPurchaseOptions:m=null,getNodesByOfferId:h=null}=Le(),{getCurrencyAmount:u=null}=Ur(),g=o.useCallback(I=>{switch(I.type){case Sn.PURCHASE_SUCCESS:r(Je.NONE);return;case lr.PURCHASE_FAILED:r(Je.FAILED);return;case ta.NOT_ALLOWED:r(Je.FAILED);return;case sa.SOLD_OUT:r(Je.SOLD_OUT);return}},[]);ot(Sn.PURCHASE_SUCCESS,g),ot(lr.PURCHASE_FAILED,g),ot(ta.NOT_ALLOWED,g),ot(sa.SOLD_OUT,g);const f=o.useMemo(()=>{if(!l||c.extraParamRequired&&(!c.extraData||!c.extraData.length))return!1;if(l.pricingModel===Gt.PRICING_MODEL_SINGLE){const I=l.product;if(I&&I.isUniqueLimitedItem)return!I.uniqueLimitedItemsLeft}return!1},[l,c]),p=(I=!1)=>{if(!l)return;if(Cs(){l&&r(Je.NONE)},[l,m]),o.useEffect(()=>{let I=null;return(n===Je.CONFIRM||n===Je.FAILED)&&(I=setTimeout(()=>r(Je.NONE),3e3)),()=>{I&&clearTimeout(I)}},[n]),!l)return null;const x=()=>{const I=l.priceInCredits*c.quantity,j=l.priceInActivityPoints*c.quantity;if(Cs()u(-1))return e.jsx(P,{variant:"danger",disabled:!0,children:d("catalog.alert.notenough.title")});if(j>u(l.activityPointType))return e.jsx(P,{variant:"danger",disabled:!0,children:d("catalog.alert.notenough.activitypoints.title."+l.activityPointType)});switch(n){case Je.CONFIRM:return e.jsx(P,{variant:"warning",onClick:()=>p(),children:d("catalog.marketplace.confirm_title")});case Je.PURCHASE:return e.jsx(P,{disabled:!0,children:e.jsx(Dc,{})});case Je.FAILED:return e.jsx(P,{variant:"danger",children:d("generic.failed")});case Je.SOLD_OUT:return e.jsx(P,{variant:"danger",children:d("generic.failed")+" - "+d("catalog.alert.limited_edition_sold_out.title")});case Je.NONE:default:return e.jsx(P,{disabled:c.extraParamRequired&&(!c.extraData||!c.extraData.length),onClick:E=>r(Je.CONFIRM),children:d("catalog.purchase_confirmation."+(l.isRentOffer?"rent":"buy"))})}};return e.jsxs(e.Fragment,{children:[e.jsx(x,{}),!t&&!l.isRentOffer&&e.jsx(P,{disabled:c.quantity>1||!l.giftable||f||c.extraParamRequired&&(!c.extraData||!c.extraData.length),onClick:()=>p(!0),children:d("catalog.purchase_confirmation.gift")})]})},Ph=a=>{const{offer:t=null,separator:s=!1}=a,{purchaseOptions:n=null}=Le(),{quantity:r=1}=n;return t?e.jsxs(e.Fragment,{children:[t.priceInCredits>0&&e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(N,{bold:!0,children:t.priceInCredits*r}),e.jsx(Nt,{type:-1})]}),s&&t.priceInCredits>0&&t.priceInActivityPoints>0&&e.jsx(Wo,{size:"xs",color:"black",className:"fa-icon"}),t.priceInActivityPoints>0&&e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(N,{bold:!0,children:t.priceInActivityPoints*r}),e.jsx(Nt,{type:t.activityPointType})]})]}):null},Yn=a=>{const{gap:t=1,...s}=a,{currentOffer:n=null}=Le();return e.jsx(v,{gap:t,...s,children:e.jsx(Ph,{offer:n})})},dr=a=>{const{currentOffer:t=null,roomPreviewer:s=null,purchaseOptions:n=null}=Le(),{previewStuffData:r=null}=n;return o.useEffect(()=>{if(!t||t.pricingModel===Gt.PRICING_MODEL_BUNDLE||!s)return;const i=t.product;if(i)switch(s.reset(!1),i.productType){case fe.FLOOR:{if(!i.furnitureData)return;if(i.furnitureData.specialType===de.FIGURE_PURCHASABLE_SET){const c=B().getFloorItemData(i.furnitureData.id).customParams.split(",").map(u=>parseInt(u)),m=[];for(const u of c)vt().isValidFigureSetForGender(u,B().gender)&&m.push(u);const h=vt().getFigureStringWithFigureIds(B().figure,B().gender,m);s.addAvatarIntoRoom(h,i.productClassId)}else s.addFurnitureIntoRoom(i.productClassId,new Ot(90),r,i.extraParam);return}case fe.WALL:{if(!i.furnitureData)return;switch(i.furnitureData.specialType){case de.FLOOR:s.updateObjectRoom(i.extraParam);return;case de.WALL_PAPER:s.updateObjectRoom(null,i.extraParam);return;case de.LANDSCAPE:{s.updateObjectRoom(null,null,i.extraParam);const l=B().getWallItemDataByName("window_double_default");l&&s.addWallItemIntoRoom(l.id,new Ot(90),l.customParams);return}default:s.updateObjectRoom("default","default","default"),s.addWallItemIntoRoom(i.productClassId,new Ot(90),i.extraParam);return}}case fe.ROBOT:s.addAvatarIntoRoom(i.extraParam,0);return;case fe.EFFECT:s.addAvatarIntoRoom(B().figure,i.productClassId);return}},[t,r,s]),t?t.pricingModel===Gt.PRICING_MODEL_BUNDLE?e.jsx(v,{fit:!0,overflow:"hidden",className:"bg-muted p-2 rounded",children:e.jsx(Pe,{fullWidth:!0,columnCount:4,className:"nitro-catalog-layout-bundle-grid",children:t.products.length>0&&t.products.map((i,l)=>e.jsx(Ce,{itemImage:i.getIconUrl(t),itemCount:i.productCount},l))})}):e.jsx(Jo,{roomPreviewer:s,height:140}):null},RS=a=>{const{page:t=null}=a,{currentOffer:s=null}=Le();return e.jsxs(e.Fragment,{children:[e.jsx(rl,{}),e.jsxs(ne,{children:[e.jsxs(v,{size:7,overflow:"hidden",children:[e.jsx(fa,{shrink:!0}),e.jsxs(v,{gap:1,overflow:"hidden",children:[e.jsx(N,{truncate:!0,shrink:!0,fontWeight:"bold",children:d("catalog_selectbadge")}),e.jsx(yS,{})]})]}),e.jsxs(v,{center:!s,size:5,overflow:"hidden",children:[!s&&e.jsxs(e.Fragment,{children:[!!t.localization.getImage(1)&&e.jsx("img",{alt:"",src:t.localization.getImage(1)}),e.jsx(N,{center:!0,dangerouslySetInnerHTML:{__html:t.localization.getText(0)}})]}),s&&e.jsxs(e.Fragment,{children:[e.jsx(A,{position:"relative",overflow:"hidden",children:e.jsx(dr,{})}),e.jsxs(v,{grow:!0,gap:1,children:[e.jsx(il,{fullWidth:!0}),e.jsx(N,{grow:!0,truncate:!0,children:s.localizationName}),e.jsx(w,{justifyContent:"end",children:e.jsx(Yn,{alignItems:"end"})}),e.jsx(sn,{})]})]})]})]})]})},cr=a=>{const{...t}=a,{currentOffer:s=null}=Le();return!s||!s.badgeCode||!s.badgeCode.length?null:e.jsx(mt,{badgeCode:s.badgeCode,...t})},OS=1,kS=100,Wc=a=>{const{currentOffer:t=null,purchaseOptions:s=null,setPurchaseOptions:n=null}=Le(),{quantity:r=1}=s,i=l=>{isNaN(l)&&(l=1),l=Math.max(l,OS),l=Math.min(l,kS),l!==r&&n(c=>{const m={...c};return m.quantity=l,m})};return!t||!t.bundlePurchaseAllowed?null:e.jsxs(e.Fragment,{children:[e.jsx(N,{children:d("catalog.bundlewidget.spinner.select.amount")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(Ic,{className:"text-black cursor-pointer fa-icon",onClick:l=>i(r-1)}),e.jsx("input",{type:"number",className:"form-control form-control-sm quantity-input",value:r,onChange:l=>i(l.target.valueAsNumber)}),e.jsx(bc,{className:"text-black cursor-pointer fa-icon",onClick:l=>i(r+1)})]})]})},AS=a=>{const{page:t=null}=a,[s,n]=o.useState(new Map),{currentOffer:r=null,setCurrentOffer:i=null}=Le(),[l,c]=o.useState(!1),m=(p,x)=>!p.product.furnitureData.colorIndex||!x.product.furnitureData.colorIndex||p.product.furnitureData.colorIndex>x.product.furnitureData.colorIndex?1:p==x?0:-1,h=(p,x)=>p.product.furnitureData.className>x.product.furnitureData.className?1:p==x?0:-1,u=p=>{p.activate(),i(p)},g=(p,x)=>{const I=`${x}*${p}`,j=t.offers.findIndex(E=>E.product.furnitureData.fullName===I);j>-1&&u(t.offers[j])},f=o.useMemo(()=>{const p=[],x=new Map,I=new Map;return t.offers.sort(m),t.offers.forEach(j=>{if(!j.product)return;const E=j.product.furnitureData;if(!E||!E.hasIndexedColor)p.push(j);else{const C=E.className,b=E.colorIndex;I.has(C)||I.set(C,[]);let _=16777215;if(E.colors){for(let S of E.colors)S!==16777215&&(_=S);I.get(C).indexOf(_)===-1&&(I.get(C)[b]=_)}x.has(C)||(p.push(j),x.set(C,!0))}}),p.sort(h),n(I),p},[t.offers]);return e.jsxs(ne,{children:[e.jsx(v,{size:7,overflow:"hidden",children:e.jsxs(Pe,{columnCount:5,children:[(!l||!r||!s.has(r.product.furnitureData.className))&&f.map((p,x)=>e.jsx(Hc,{itemActive:r&&(r.product.furnitureData.hasIndexedColor?r.product.furnitureData.className===p.product.furnitureData.className:r.offerId===p.offerId),offer:p,selectOffer:u},x)),l&&r&&s.has(r.product.furnitureData.className)&&s.get(r.product.furnitureData.className).map((p,x)=>e.jsx(Ce,{itemHighlight:!0,itemActive:r.product.furnitureData.colorIndex===x,itemColor:Is.int2rgb(p),className:"clear-bg",onClick:I=>g(x,r.product.furnitureData.className)},x))]})}),e.jsxs(v,{center:!r,size:5,overflow:"hidden",children:[!r&&e.jsxs(e.Fragment,{children:[!!t.localization.getImage(1)&&e.jsx("img",{alt:"",src:t.localization.getImage(1)}),e.jsx(N,{center:!0,dangerouslySetInnerHTML:{__html:t.localization.getText(0)}})]}),r&&e.jsxs(e.Fragment,{children:[e.jsxs(A,{position:"relative",overflow:"hidden",children:[e.jsx(dr,{}),e.jsx(cr,{position:"absolute",className:"bg-muted rounded bottom-1 end-1"}),r.product.furnitureData.hasIndexedColor&&e.jsx(P,{position:"absolute",className:"bottom-1 start-1",onClick:p=>c(x=>!x),children:e.jsx(Rm,{className:"fa-icon"})})]}),e.jsxs(v,{grow:!0,gap:1,children:[e.jsx(il,{fullWidth:!0}),e.jsx(N,{grow:!0,truncate:!0,children:r.localizationName}),e.jsxs(w,{justifyContent:"between",children:[e.jsx(v,{gap:1,children:e.jsx(Wc,{})}),e.jsx(Yn,{justifyContent:"end",alignItems:"end"})]}),e.jsx(sn,{})]})]})]})]})},Lh=a=>{const{imageUrl:t=null}=a,[s,n]=o.useState("");return o.useEffect(()=>{n(t??K("catalog.asset.image.url").replace("%name%","catalog_header_roombuilder"))},[t]),e.jsx(w,{center:!0,fullWidth:!0,className:"nitro-catalog-header",children:e.jsx("img",{src:s,onError:({currentTarget:r})=>{r.src=K("catalog.asset.image.url").replace("%name%","catalog_header_roombuilder")}})})},DS=a=>{const{page:t=null}=a,{currentOffer:s=null,currentPage:n=null}=Le();return e.jsx(e.Fragment,{children:e.jsxs(ne,{children:[e.jsxs(v,{size:7,overflow:"hidden",children:[K("catalog.headers")&&e.jsx(Lh,{imageUrl:n.localization.getImage(0)}),e.jsx(fa,{})]}),e.jsxs(v,{center:!s,size:5,overflow:"hidden",children:[!s&&e.jsxs(e.Fragment,{children:[!!t.localization.getImage(1)&&e.jsx(wn,{imageUrl:t.localization.getImage(1)}),e.jsx(N,{center:!0,dangerouslySetInnerHTML:{__html:t.localization.getText(0)}})]}),s&&e.jsxs(e.Fragment,{children:[e.jsxs(w,{center:!0,overflow:"hidden",style:{height:140},children:[s.product.productType!==fe.BADGE&&e.jsxs(e.Fragment,{children:[e.jsx(dr,{}),e.jsx(cr,{className:"bg-muted rounded bottom-1 end-1"})]}),s.product.productType===fe.BADGE&&e.jsx(cr,{className:"scale-2"})]}),e.jsxs(v,{grow:!0,gap:1,children:[e.jsx(il,{fullWidth:!0}),e.jsx(N,{grow:!0,children:s.localizationName}),e.jsxs(w,{justifyContent:"between",children:[e.jsx(v,{gap:1,children:e.jsx(Wc,{})}),e.jsx(Yn,{justifyContent:"end",alignItems:"end"})]}),e.jsx(sn,{})]})]})]})]})})},PS=a=>{const{...t}=a,{currentOffer:s=null,purchaseOptions:n=null}=Le(),{previewStuffData:r=null}=n,i=o.useMemo(()=>{if(!s||!r)return null;const l=r.getValue(2);return!l||!l.length?null:l},[s,r]);return i?e.jsx(mt,{badgeCode:i,isGroup:!0,...t}):null},Mh=a=>{const[t,s]=o.useState(0),{currentOffer:n=null,catalogOptions:r=null,setPurchaseOptions:i=null}=Le(),{groups:l=null}=r,c=o.useMemo(()=>{if(!l||!l.length)return null;const h=l[t];if(!h)return null;const u=new aa;return u.setValue(["0",h.groupId.toString(),h.badgeCode,h.colorA,h.colorB]),u},[t,l]);if(o.useEffect(()=>{n&&i(h=>{const u={...h};return u.extraParamRequired=!0,u.extraData=c&&c.getValue(1)||null,u.previewStuffData=c,u})},[n,c,i]),o.useEffect(()=>{D(new Om)},[]),!l||!l.length)return e.jsxs(A,{className:"bg-muted rounded p-1 text-black text-center",children:[d("catalog.guild_selector.members_only"),e.jsx(P,{className:"mt-1",children:d("catalog.guild_selector.find_groups")})]});const m=l[t];return e.jsxs(w,{gap:1,children:[!!m&&e.jsxs(w,{overflow:"hidden",className:"rounded border",children:[e.jsx(A,{fullHeight:!0,style:{width:"20px",backgroundColor:"#"+m.colorA}}),e.jsx(A,{fullHeight:!0,style:{width:"20px",backgroundColor:"#"+m.colorB}})]}),e.jsx("select",{className:"form-select form-select-sm",value:t,onChange:h=>s(parseInt(h.target.value)),children:l.map((h,u)=>e.jsx("option",{value:u,children:h.groupName},u))})]})},LS=a=>{const{page:t=null}=a,{currentOffer:s=null}=Le();return e.jsxs(ne,{children:[e.jsx(v,{size:7,overflow:"hidden",children:e.jsx(fa,{})}),e.jsxs(v,{center:!s,size:5,overflow:"hidden",children:[!s&&e.jsxs(e.Fragment,{children:[!!t.localization.getImage(1)&&e.jsx("img",{alt:"",src:t.localization.getImage(1)}),e.jsx(N,{center:!0,dangerouslySetInnerHTML:{__html:t.localization.getText(0)}})]}),s&&e.jsxs(e.Fragment,{children:[e.jsxs(A,{position:"relative",overflow:"hidden",children:[e.jsx(dr,{}),e.jsx(PS,{position:"absolute",className:"bottom-1 end-1"})]}),e.jsxs(v,{grow:!0,gap:1,children:[e.jsx(N,{truncate:!0,children:s.localizationName}),e.jsx(A,{grow:!0,children:e.jsx(Mh,{})}),e.jsx(w,{justifyContent:"end",children:e.jsx(Yn,{alignItems:"end"})}),e.jsx(sn,{})]})]})]})]})},MS=a=>{const{page:t=null}=a,[s,n]=o.useState(0),{currentOffer:r=null,setCurrentOffer:i=null,catalogOptions:l=null}=Le(),{groups:c=null}=l;return o.useEffect(()=>{D(new Om)},[t]),e.jsxs(e.Fragment,{children:[e.jsx(rl,{}),e.jsxs(ne,{children:[e.jsx(v,{className:"bg-muted rounded p-2 text-black",size:7,overflow:"hidden",children:e.jsx(A,{className:"overflow-auto",dangerouslySetInnerHTML:{__html:t.localization.getText(1)}})}),e.jsx(v,{size:5,overflow:"hidden",gap:1,children:!!r&&e.jsx(e.Fragment,{children:e.jsxs(v,{grow:!0,gap:1,children:[e.jsx(N,{truncate:!0,children:r.localizationName}),e.jsx(A,{grow:!0,children:e.jsx(Mh,{})}),e.jsx(w,{justifyContent:"end",children:e.jsx(Yn,{alignItems:"end"})}),e.jsx(sn,{noGiftOption:!0})]})})})]})]})},US=a=>{const{page:t=null}=a;return e.jsxs(ne,{children:[e.jsxs(v,{size:7,overflow:"hidden",className:"bg-muted rounded p-2 text-black",children:[e.jsx(A,{dangerouslySetInnerHTML:{__html:t.localization.getText(2)}}),e.jsx(A,{overflow:"auto",dangerouslySetInnerHTML:{__html:t.localization.getText(0)}}),e.jsx(A,{dangerouslySetInnerHTML:{__html:t.localization.getText(1)}})]}),e.jsxs(v,{center:!0,size:5,overflow:"hidden",children:[e.jsx(wn,{imageUrl:t.localization.getImage(1)}),e.jsx(P,{onClick:()=>Z("groups/create"),children:d("catalog.start.guild.purchase.button")})]})]})},FS=a=>{const{page:t=null}=a;return e.jsx("div",{className:"h-100 nitro-catalog-layout-info-loyalty text-black d-flex flex-row",children:e.jsx("div",{className:"overflow-auto h-100 d-flex flex-column info-loyalty-content",children:e.jsx("div",{dangerouslySetInnerHTML:{__html:t.localization.getText(0)}})})})},Uh=a=>{const{page:t=null}=a,s=t.localization.getImage(1);return e.jsxs(v,{grow:!0,className:"bg-muted rounded text-black p-2",overflow:"hidden",children:[e.jsxs(w,{alignItems:"center",gap:2,children:[s&&e.jsx("img",{alt:"",src:s}),e.jsx(A,{className:"fs-5",dangerouslySetInnerHTML:{__html:t.localization.getText(1)}})]}),e.jsx(v,{grow:!0,alignItems:"center",overflow:"auto",children:e.jsx(A,{dangerouslySetInnerHTML:{__html:t.localization.getText(2)}})}),e.jsx(w,{alignItems:"center",children:e.jsx(A,{className:"fw-bold",dangerouslySetInnerHTML:{__html:t.localization.getText(3)}})})]})},VS=a=>e.jsx(Uh,{...a}),GS=a=>{const{page:t=null}=a,[s,n]=o.useState(""),[r,i]=o.useState(""),[l,c]=o.useState(-1),[m,h]=o.useState([]),[u,g]=o.useState(!1),[f,p]=o.useState(1),{categories:x=null}=qs(),{setIsVisible:I=null}=Le(),{promoteInformation:j,isExtended:E,setIsExtended:C}=Gc();o.useEffect(()=>{E&&(c(j.data.flatId),n(j.data.eventName),i(j.data.eventDescription),p(j.data.categoryId),g(E),C(!1))},[E,s,r,f]);const b=()=>{c(-1),n(""),i(""),p(1),C(!1),I(!1)},_=()=>{const S=t.pageId,T=t.offers.length>=1?t.offers[0].offerId:-1,L=l,k=s,R=r,y=f;D(new vj(S,T,L,k,u,R,y)),b()};return M(Cj,S=>{const T=S.getParser();T&&h(T.rooms)}),o.useEffect(()=>{D(new Nj),D(new Im)},[]),e.jsxs(e.Fragment,{children:[e.jsx(N,{bold:!0,center:!0,children:d("roomad.catalog_header")}),e.jsxs(v,{size:12,overflow:"hidden",className:"text-black",children:[e.jsx(A,{children:d("roomad.catalog_text",["duration"],["120"])}),e.jsxs(A,{className:"bg-muted rounded p-1",children:[e.jsxs(v,{gap:2,children:[e.jsx(N,{bold:!0,children:d("navigator.category")}),e.jsx("select",{className:"form-select form-select-sm",value:f,onChange:S=>p(parseInt(S.target.value)),disabled:u,children:x&&x.map((S,T)=>e.jsx("option",{value:S.id,children:d(S.name)},T))})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("roomad.catalog_name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:64,value:s,onChange:S=>n(S.target.value),readOnly:u})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("roomad.catalog_description")}),e.jsx("textarea",{className:"form-control form-control-sm",maxLength:64,value:r,onChange:S=>i(S.target.value),readOnly:u})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("roomad.catalog_roomname")}),e.jsxs("select",{className:"form-select form-select-sm",value:l,onChange:S=>c(parseInt(S.target.value)),disabled:u,children:[e.jsx("option",{value:-1,disabled:!0,children:d("roomad.catalog_roomname")}),m&&m.map((S,T)=>e.jsx("option",{value:S.roomId,children:S.roomName},T))]})]}),e.jsx(v,{gap:1,children:e.jsx(P,{variant:!s||!r||l===-1?"danger":"success",onClick:_,disabled:!s||!r||l===-1,children:d(u?"roomad.extend.event":"buy")})})]})]})]})},Fh=a=>{const{columnCount:t=5,children:s=null,...n}=a,{currentOffer:r=null}=Le(),i=o.useRef();return o.useEffect(()=>{i&&i.current&&(i.current.scrollTop=0)},[r]),r?e.jsxs(Pe,{innerRef:i,columnCount:5,...n,children:[r.products&&r.products.length>0&&r.products.map((l,c)=>e.jsx(Ce,{itemImage:l.getIconUrl(),itemCount:l.productCount},c)),s]}):null},Vh=a=>{const{gap:t=1,...s}=a,{currentOffer:n=null}=Le();return e.jsx(w,{gap:t,alignItems:"center",classNames:["bg-muted","p-1","rounded"],...s,children:e.jsx(Ph,{separator:!0,offer:n})})},BS=a=>{const{page:t=null}=a;return e.jsxs(e.Fragment,{children:[e.jsx(rl,{}),e.jsxs(ne,{children:[e.jsxs(v,{size:7,overflow:"hidden",children:[!!t.localization.getText(2)&&e.jsx(N,{dangerouslySetInnerHTML:{__html:t.localization.getText(2)}}),e.jsx(v,{grow:!0,overflow:"hidden",className:"bg-muted p-2 rounded",children:e.jsx(Fh,{fullWidth:!0,className:"nitro-catalog-layout-bundle-grid"})})]}),e.jsxs(v,{size:5,overflow:"hidden",gap:1,children:[!!t.localization.getText(1)&&e.jsx(N,{center:!0,small:!0,overflow:"auto",children:t.localization.getText(1)}),e.jsxs(v,{grow:!0,position:"relative",overflow:"hidden",gap:0,children:[!!t.localization.getImage(1)&&e.jsx("img",{alt:"",className:"flex-grow-1",src:t.localization.getImage(1)}),e.jsx(cr,{position:"absolute",className:"bg-muted rounded bottom-0 start-0"}),e.jsx(Vh,{position:"absolute",className:"bottom-0 end-0"})]}),e.jsx(v,{gap:1,children:e.jsx(sn,{})})]})]})]})},HS=a=>{const{page:t=null}=a;return e.jsxs(e.Fragment,{children:[e.jsx(rl,{}),e.jsxs(ne,{children:[e.jsxs(v,{size:7,overflow:"hidden",children:[!!t.localization.getText(2)&&e.jsx(N,{dangerouslySetInnerHTML:{__html:t.localization.getText(2)}}),e.jsx(v,{grow:!0,overflow:"hidden",className:"bg-muted p-2 rounded",children:e.jsx(Fh,{fullWidth:!0,className:"nitro-catalog-layout-bundle-grid"})})]}),e.jsxs(v,{size:5,overflow:"hidden",gap:1,children:[!!t.localization.getText(1)&&e.jsx(N,{center:!0,small:!0,overflow:"auto",children:t.localization.getText(1)}),e.jsxs(v,{grow:!0,position:"relative",overflow:"hidden",gap:0,children:[!!t.localization.getImage(1)&&e.jsx("img",{alt:"",className:"flex-grow-1",src:t.localization.getImage(1)}),e.jsx(cr,{position:"absolute",className:"bg-muted rounded bottom-0 start-0"}),e.jsx(Vh,{position:"absolute",className:"bottom-0 end-0"})]}),e.jsx(v,{gap:1,children:e.jsx(sn,{})})]})]})]})},WS=a=>{const{page:t=null}=a,[s,n]=o.useState(-1),[r,i]=o.useState(""),{currentOffer:l=null,currentPage:c=null}=Le(),m=h=>{var u;return(u=Ie().soundManager.musicController)==null?void 0:u.playSong(h,_i.PRIORITY_PURCHASE_PREVIEW,15,0,0,0)};return M(_j,h=>{const u=h.getParser();u.officialSongId===r&&n(u.songId)}),o.useEffect(()=>{if(!l)return;const h=l.product;if(h){if(h.extraParam.length>0){const u=parseInt(h.extraParam);u>0?n(u):(i(h.extraParam),D(new Sj(h.extraParam)))}else i(""),n(-1);return()=>{var u;return(u=Ie().soundManager.musicController)==null?void 0:u.stop(_i.PRIORITY_PURCHASE_PREVIEW)}}},[l]),o.useEffect(()=>()=>{var h;return(h=Ie().soundManager.musicController)==null?void 0:h.stop(_i.PRIORITY_PURCHASE_PREVIEW)},[]),e.jsx(e.Fragment,{children:e.jsxs(ne,{children:[e.jsxs(v,{size:7,overflow:"hidden",children:[K("catalog.headers")&&e.jsx(Lh,{imageUrl:c.localization.getImage(0)}),e.jsx(fa,{})]}),e.jsxs(v,{center:!l,size:5,overflow:"hidden",children:[!l&&e.jsxs(e.Fragment,{children:[!!t.localization.getImage(1)&&e.jsx(wn,{imageUrl:t.localization.getImage(1)}),e.jsx(N,{center:!0,dangerouslySetInnerHTML:{__html:t.localization.getText(0)}})]}),l&&e.jsxs(e.Fragment,{children:[e.jsxs(w,{center:!0,overflow:"hidden",style:{height:140},children:[l.product.productType!==fe.BADGE&&e.jsxs(e.Fragment,{children:[e.jsx(dr,{}),e.jsx(cr,{className:"bg-muted rounded bottom-1 end-1"})]}),l.product.productType===fe.BADGE&&e.jsx(cr,{className:"scale-2"})]}),e.jsxs(v,{grow:!0,gap:1,children:[e.jsx(il,{fullWidth:!0}),e.jsx(N,{grow:!0,truncate:!0,children:l.localizationName}),s>-1&&e.jsx(P,{onClick:()=>m(s),children:d("play_preview_button")}),e.jsxs(w,{justifyContent:"between",children:[e.jsx(v,{gap:1,children:e.jsx(Wc,{})}),e.jsx(Yn,{justifyContent:"end",alignItems:"end"})]}),e.jsx(sn,{})]})]})]})]})})},qS=["floors","walls","views"],zS=a=>{const{columnCount:t=5,children:s=null,...n}=a,[r,i]=o.useState(null),[l,c]=o.useState(-1),[m,h]=o.useState(null),{currentPage:u=null,currentOffer:g=null,setCurrentOffer:f=null,setPurchaseOptions:p=null}=Le(),x=o.useRef(),I=E=>{E&&h(C=>{const b=[...C];return b[l]=E,b})};if(o.useEffect(()=>{if(!u)return;const E=[[],[],[]];for(const C of u.offers){if(C.pricingModel!==Gt.PRICING_MODEL_SINGLE&&C.pricingModel!==Gt.PRICING_MODEL_MULTI)continue;const b=C.product;if(!b||b.productType!==fe.WALL&&b.productType!==fe.FLOOR||!b.furnitureData)continue;switch(b.furnitureData.className){case"floor":E[0].push(C);break;case"wallpaper":E[1].push(C);break;case"landscape":E[2].push(C);break}}i(E),c(0),h([E[0][0],E[1][0],E[2][0]])},[u]),o.useEffect(()=>{l===-1||!m||f(m[l])},[l,m,f]),o.useEffect(()=>{l===-1||!m||!g||p(E=>{const C={...E};return C.extraData=m[l].product.extraParam,C.extraParamRequired=!0,C})},[g,l,m,p]),o.useEffect(()=>{x&&x.current&&(x.current.scrollTop=0)},[l]),!r||l===-1)return null;const j=r[l];return e.jsxs(e.Fragment,{children:[e.jsx(bn,{children:qS.map((E,C)=>e.jsx(P,{active:l===C,onClick:b=>c(C),children:d(`catalog.spaces.tab.${E}`)},C))}),e.jsxs(Pe,{innerRef:x,columnCount:t,...n,children:[j&&j.length>0&&j.map((E,C)=>e.jsx(Hc,{itemActive:g&&g===E,offer:E,selectOffer:b=>I(b)},C)),s]})]})},YS=a=>{const{page:t=null}=a,{currentOffer:s=null,roomPreviewer:n=null}=Le();return o.useEffect(()=>{n.updatePreviewObjectBoundingRectangle(new Vs)},[n]),e.jsxs(ne,{children:[e.jsx(v,{size:7,overflow:"hidden",children:e.jsx(zS,{})}),e.jsxs(v,{center:!s,size:5,overflow:"hidden",children:[!s&&e.jsxs(e.Fragment,{children:[!!t.localization.getImage(1)&&e.jsx("img",{alt:"",src:t.localization.getImage(1)}),e.jsx(N,{center:!0,dangerouslySetInnerHTML:{__html:t.localization.getText(0)}})]}),s&&e.jsxs(e.Fragment,{children:[e.jsx(A,{position:"relative",overflow:"hidden",children:e.jsx(dr,{})}),e.jsxs(v,{grow:!0,gap:1,children:[e.jsx(N,{grow:!0,truncate:!0,children:s.localizationName}),e.jsx(w,{justifyContent:"end",children:e.jsx(Yn,{alignItems:"end"})}),e.jsx(sn,{})]})]})]})]})},$S=a=>{const{page:t=null}=a,[s,n]=o.useState(""),{currentOffer:r=null,setPurchaseOptions:i=null}=Le();return o.useEffect(()=>{r&&i(l=>{const c={...l};return c.extraData=s,c})},[r,s,i]),e.jsxs(ne,{children:[e.jsxs(v,{size:7,overflow:"hidden",children:[e.jsx(fa,{}),e.jsx("textarea",{className:"flex-grow-1 form-control w-100",defaultValue:s||"",onChange:l=>n(l.target.value)})]}),e.jsxs(v,{center:!r,size:5,overflow:"hidden",children:[!r&&e.jsxs(e.Fragment,{children:[!!t.localization.getImage(1)&&e.jsx("img",{alt:"",src:t.localization.getImage(1)}),e.jsx(N,{center:!0,dangerouslySetInnerHTML:{__html:t.localization.getText(0)}})]}),r&&e.jsxs(e.Fragment,{children:[e.jsx(dr,{}),e.jsxs(v,{grow:!0,gap:1,children:[e.jsx(N,{grow:!0,truncate:!0,children:r.localizationName}),e.jsx(w,{justifyContent:"end",children:e.jsx(Yn,{alignItems:"end"})}),e.jsx(sn,{})]})]})]})]})},KS=a=>{const[t,s]=o.useState(null),[n,r]=o.useState(Je.NONE),{currentPage:i=null,catalogOptions:l=null}=Le(),{purse:c=null,getCurrencyAmount:m=null}=Ur(),{clubOffers:h=null}=l,u=o.useCallback(C=>{switch(C.type){case Sn.PURCHASE_SUCCESS:r(Je.NONE);return;case lr.PURCHASE_FAILED:r(Je.FAILED);return}},[]);ot(Sn.PURCHASE_SUCCESS,u),ot(lr.PURCHASE_FAILED,u);const g=o.useCallback(C=>{let b="";return C.months>0&&(b=d("catalog.vip.item.header.months",["num_months"],[C.months.toString()])),C.extraDays>0&&(b!==""&&(b+=" "),b+=" "+d("catalog.vip.item.header.days",["num_days"],[C.extraDays.toString()])),b},[]),f=o.useCallback(()=>{if(!c)return"";const C=c.clubDays>0||c.clubPeriods>0?"extension.":"subscription.",b=t.months===0?"days":"months",_=t.months===0?t.extraDays:t.months;return d("catalog.vip.buy.confirm."+C+b).replace("%NUM_"+b.toUpperCase()+"%",_.toString())},[t,c]),p=o.useCallback(()=>{let C=d("catalog.vip.buy.confirm.end_date");return C=C.replace("%month%",t.month.toString()),C=C.replace("%day%",t.day.toString()),C=C.replace("%year%",t.year.toString()),C},[t]),x=o.useMemo(()=>{const C=c.clubDays,_=c.clubPeriods*31+C;return d("catalog.vip.extend.info",["days"],[_.toString()])},[c]),I=o.useCallback(()=>{t&&(r(Je.PURCHASE),D(new Ho(i.pageId,t.offerId,null,1)))},[t,i]),j=o.useCallback(C=>{r(Je.NONE),s(C)},[]),E=o.useCallback(()=>{if(!t)return null;if(t.priceCredits>m(-1))return e.jsx(P,{fullWidth:!0,variant:"danger",children:d("catalog.alert.notenough.title")});if(t.priceActivityPoints>m(t.priceActivityPointsType))return e.jsx(P,{fullWidth:!0,variant:"danger",children:d("catalog.alert.notenough.activitypoints.title."+t.priceActivityPointsType)});switch(n){case Je.CONFIRM:return e.jsx(P,{fullWidth:!0,variant:"warning",onClick:I,children:d("catalog.marketplace.confirm_title")});case Je.PURCHASE:return e.jsx(P,{fullWidth:!0,variant:"primary",disabled:!0,children:e.jsx(Dc,{})});case Je.FAILED:return e.jsx(P,{fullWidth:!0,variant:"danger",disabled:!0,children:d("generic.failed")});case Je.NONE:default:return e.jsx(P,{fullWidth:!0,variant:"success",onClick:()=>r(Je.CONFIRM),children:d("buy")})}},[t,n,I,m]);return o.useEffect(()=>{h||D(new wj(1))},[h]),e.jsxs(ne,{children:[e.jsxs(v,{fullHeight:!0,size:7,overflow:"hidden",justifyContent:"between",children:[e.jsx(Pe,{columnCount:1,className:"nitro-catalog-layout-vip-buy-grid",children:h&&h.length>0&&h.map((C,b)=>e.jsxs(Ce,{column:!1,center:!1,alignItems:"center",justifyContent:"between",itemActive:t===C,className:"p-1",onClick:()=>j(C),children:[e.jsx("i",{className:"icon-hc-banner"}),e.jsxs(v,{justifyContent:"end",gap:0,children:[e.jsx(N,{textEnd:!0,children:g(C)}),e.jsxs(w,{justifyContent:"end",gap:1,children:[C.priceCredits>0&&e.jsxs(w,{alignItems:"center",justifyContent:"end",gap:1,children:[e.jsx(N,{children:C.priceCredits}),e.jsx(Nt,{type:-1})]}),C.priceActivityPoints>0&&e.jsxs(w,{alignItems:"center",justifyContent:"end",gap:1,children:[e.jsx(N,{children:C.priceActivityPoints}),e.jsx(Nt,{type:C.priceActivityPointsType})]})]})]})]},b))}),e.jsx(N,{center:!0,dangerouslySetInnerHTML:{__html:d("catalog.vip.buy.hccenter")}})]}),e.jsxs(v,{size:5,overflow:"hidden",children:[e.jsxs(v,{fullHeight:!0,center:!0,overflow:"hidden",children:[i.localization.getImage(1)&&e.jsx("img",{alt:"",src:i.localization.getImage(1)}),e.jsx(N,{center:!0,overflow:"auto",dangerouslySetInnerHTML:{__html:x}})]}),t&&e.jsxs(v,{fullWidth:!0,grow:!0,justifyContent:"end",children:[e.jsxs(w,{alignItems:"end",children:[e.jsxs(v,{grow:!0,gap:0,children:[e.jsx(N,{fontWeight:"bold",children:f()}),e.jsx(N,{children:p()})]}),e.jsxs(v,{gap:1,children:[t.priceCredits>0&&e.jsxs(w,{alignItems:"center",justifyContent:"end",gap:1,children:[e.jsx(N,{children:t.priceCredits}),e.jsx(Nt,{type:-1})]}),t.priceActivityPoints>0&&e.jsxs(w,{alignItems:"center",justifyContent:"end",gap:1,children:[e.jsx(N,{children:t.priceActivityPoints}),e.jsx(Nt,{type:t.priceActivityPointsType})]})]})]}),E()]})]})]})},XS=a=>{const{text:t=null}=a,[s,n]=o.useState(""),[r,i]=o.useState(!1),{simpleAlert:l=null}=Fe(),c=()=>{!s||!s.length||r||(D(new Oj(s)),i(!0))};return M(Tj,m=>{const h=m.getParser();let u=d("catalog.alert.voucherredeem.ok.description");h.productName&&(u=d("catalog.alert.voucherredeem.ok.description.furni",["productName","productDescription"],[h.productName,h.productDescription])),l(u,null,null,null,d("catalog.alert.voucherredeem.ok.title")),i(!1),n("")}),M(yj,m=>{const h=m.getParser();l(d(`catalog.alert.voucherredeem.error.description.${h.errorCode}`),null,null,null,d("catalog.alert.voucherredeem.error.title")),i(!1)}),e.jsxs(w,{gap:1,children:[e.jsx("input",{type:"text",className:"form-control form-control-sm",placeholder:t,value:s,onChange:m=>n(m.target.value)}),e.jsx(P,{variant:"primary",onClick:c,disabled:r,children:e.jsx(Rj,{className:"fa-icon"})})]})},Ua=a=>{const{item:t=null,position:s="relative",pointer:n=!0,overflow:r="hidden",fullHeight:i=!0,classNames:l=[],children:c=null,...m}=a,h=o.useMemo(()=>{const g=["rounded","nitro-front-page-item"];return l.length&&g.push(...l),g},[l]);if(!t)return null;const u=K("image.library.url")+t.itemPromoImage;return e.jsxs(fh,{imageUrl:u,classNames:h,position:s,fullHeight:i,pointer:n,overflow:r,...m,children:[e.jsx(N,{position:"absolute",variant:"white",className:"bg-dark rounded p-2 m-2 bottom-0",children:t.itemName}),c]})},QS=a=>{const{page:t=null,hideNavigation:s=null}=a,{frontPageItems:n=[]}=Le(),r=o.useCallback(i=>{switch(i.type){case mu.ITEM_CATALOGUE_PAGE:Z(`catalog/open/${i.catalogPageLocation}`);return;case mu.ITEM_PRODUCT_OFFER:Z(`catalog/open/${i.productOfferId}`);return}},[]);return o.useEffect(()=>{s()},[t,s]),e.jsxs(ne,{children:[e.jsx(v,{size:4,children:n[0]&&e.jsx(Ua,{item:n[0],onClick:i=>r(n[0])})}),e.jsxs(v,{size:8,children:[n[1]&&e.jsx(Ua,{item:n[1],onClick:i=>r(n[1])}),n[2]&&e.jsx(Ua,{item:n[2],onClick:i=>r(n[2])}),n[3]&&e.jsx(Ua,{item:n[3],onClick:i=>r(n[3])}),e.jsx(XS,{text:t.localization.getText(1)})]})]})},lc=1,Ja=2,Gh=a=>{const{offerData:t=null,type:s=Ja,onClick:n=null}=a,r=o.useMemo(()=>t?d((t.furniType===2?"wallItem":"roomItem")+`.name.${t.furniId}`):"",[t]),i=o.useCallback(()=>{if(!t)return"";if(t.status===Ki.SOLD)return d("catalog.marketplace.offer.sold");if(t.timeLeftMinutes<=0)return d("catalog.marketplace.offer.expired");const l=Math.max(1,t.timeLeftMinutes),c=Math.floor(l/60);let h=l-c*60+" "+d("catalog.marketplace.offer.minutes");return c>0&&(h=c+" "+d("catalog.marketplace.offer.hours")+" "+h),d("catalog.marketplace.offer.time_left",["time"],[h])},[t]);return e.jsxs(Ce,{shrink:!0,center:!1,column:!1,alignItems:"center",className:"p-1",children:[e.jsx(v,{style:{width:40,height:40},children:e.jsx(Ce,{column:!1,itemImage:OC(t.furniType===$i.TYPE_FLOOR?fe.FLOOR:fe.WALL,t.furniId,t.extraData),itemUniqueNumber:t.isUniqueLimitedItem?t.stuffData.uniqueNumber:0})}),e.jsxs(v,{grow:!0,gap:0,children:[e.jsx(N,{fontWeight:"bold",children:r}),s===lc&&e.jsxs(e.Fragment,{children:[e.jsx(N,{children:d("catalog.marketplace.offer.price_own_item",["price"],[t.price.toString()])}),e.jsx(N,{children:i()})]}),s===Ja&&e.jsxs(e.Fragment,{children:[e.jsx(N,{children:d("catalog.marketplace.offer.price_public_item",["price","average"],[t.price.toString(),t.averagePrice>0?t.averagePrice.toString():"-"])}),e.jsx(N,{children:d("catalog.marketplace.offer_count",["count"],[t.offerCount.toString()])})]})]}),e.jsxs(v,{gap:1,children:[s===lc&&t.status!==Ki.SOLD&&e.jsx(P,{variant:"secondary",onClick:()=>n(t),children:d("catalog.marketplace.offer.pick")}),s===Ja&&e.jsxs(e.Fragment,{children:[e.jsx(P,{variant:"secondary",onClick:()=>n(t),children:d("buy")}),e.jsx(P,{variant:"secondary",disabled:!0,children:d("catalog.marketplace.view_more")})]})]})]})},JS=a=>{const[t,s]=o.useState(0),[n,r]=o.useState([]),{simpleAlert:i=null}=Fe();M(kj,h=>{const u=h.getParser();if(!u)return;const g=u.offers.map(f=>{const p=new $i(f.offerId,f.furniId,f.furniType,f.extraData,f.stuffData,f.price,f.status,f.averagePrice,f.offerCount);return p.timeLeftMinutes=f.timeLeftMinutes,p});s(u.creditsWaiting),r(g)}),M(Aj,h=>{const u=h.getParser();if(u){if(!u.success){i(d("catalog.marketplace.cancel_failed"),pe.DEFAULT,null,null,d("catalog.marketplace.operation_failed.topic"));return}r(g=>g.filter(f=>f.offerId!==u.offerId))}});const l=o.useMemo(()=>n.filter(h=>h.status===Ki.SOLD),[n]),c=o.useCallback(()=>{r(h=>{const u=l.map(g=>g.offerId);return h.filter(g=>u.indexOf(g.offerId)===-1)}),D(new Dj)},[l]),m=h=>{D(new Lj(h.offerId))};return o.useEffect(()=>{D(new Pj)},[]),e.jsxs(v,{overflow:"hidden",children:[t<=0&&e.jsx(N,{center:!0,className:"bg-muted rounded p-1",children:d("catalog.marketplace.redeem.no_sold_items")}),t>0&&e.jsxs(v,{center:!0,gap:1,className:"bg-muted rounded p-2",children:[e.jsx(N,{children:d("catalog.marketplace.redeem.get_credits",["count","credits"],[l.length.toString(),t.toString()])}),e.jsx(P,{className:"mt-1",onClick:c,children:d("catalog.marketplace.offer.redeem")})]}),e.jsxs(v,{gap:1,overflow:"hidden",children:[e.jsx(N,{truncate:!0,shrink:!0,fontWeight:"bold",children:d("catalog.marketplace.items_found",["count"],[n.length.toString()])}),e.jsx(v,{overflow:"auto",className:"nitro-catalog-layout-marketplace-grid",children:n.length>0&&n.map(h=>e.jsx(Gh,{offerData:h,type:lc,onClick:m},h.offerId))})]})]})},ZS=a=>{const{searchType:t=null,sortTypes:s=null,onSearch:n=null}=a,[r,i]=o.useState(s?s[0]:3),[l,c]=o.useState(""),[m,h]=o.useState(0),[u,g]=o.useState(0),f=o.useCallback(x=>{i(x),(t===qt.BY_ACTIVITY||t===qt.BY_VALUE)&&n({minPrice:-1,maxPrice:-1,query:"",type:x})},[n,t]),p=o.useCallback(()=>{const x=m>0?m:-1,I=u>0?u:-1;n({minPrice:x,maxPrice:I,type:r,query:l})},[u,m,n,l,r]);return o.useEffect(()=>{if(!s||!s.length)return;const x=s[0];i(x),(t===qt.BY_ACTIVITY||qt.BY_VALUE===t)&&n({minPrice:-1,maxPrice:-1,query:"",type:x})},[n,t,s]),e.jsxs(v,{gap:1,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(N,{className:"col-3",children:d("catalog.marketplace.sort_order")}),e.jsx("select",{className:"form-select form-select-sm",value:r,onChange:x=>f(parseInt(x.target.value)),children:s.map(x=>e.jsx("option",{value:x,children:d(`catalog.marketplace.sort.${x}`)},x))})]}),t===qt.ADVANCED&&e.jsxs(e.Fragment,{children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(N,{className:"col-3",children:d("catalog.marketplace.search_name")}),e.jsx("input",{className:"form-control form-control-sm",type:"text",value:l,onChange:x=>c(x.target.value)})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(N,{className:"col-3",children:d("catalog.marketplace.search_price")}),e.jsxs(w,{fullWidth:!0,gap:1,children:[e.jsx("input",{className:"form-control form-control-sm",type:"number",min:0,value:m,onChange:x=>h(x.target.valueAsNumber)}),e.jsx("input",{className:"form-control form-control-sm",type:"number",min:0,value:u,onChange:x=>g(x.target.valueAsNumber)})]})]}),e.jsx(P,{variant:"secondary",className:"mx-auto",onClick:p,children:d("generic.search")})]})]})},ew=[1,2],tw=[3,4,5,6],sw=[1,2,3,4,5,6],nw=a=>{const[t,s]=o.useState(qt.BY_ACTIVITY),[n,r]=o.useState(0),[i,l]=o.useState(new Map),[c,m]=o.useState({minPrice:-1,maxPrice:-1,query:"",type:3}),{getCurrencyAmount:h=null}=Ur(),{simpleAlert:u=null,showConfirm:g=null}=Fe(),f=o.useCallback(I=>{m(I),D(new Mj(I.minPrice,I.maxPrice,I.query,I.type))},[]),p=o.useMemo(()=>{switch(t){case qt.BY_ACTIVITY:return tw;case qt.BY_VALUE:return ew;case qt.ADVANCED:return sw}return[]},[t]),x=o.useCallback(I=>{if(I.price>h(-1)){u(d("catalog.alert.notenough.credits.description"),pe.DEFAULT,null,null,d("catalog.alert.notenough.title"));return}const j=I.offerId;g(d("catalog.marketplace.confirm_header"),()=>{D(new hu(j))},null,null,null,d("catalog.marketplace.confirm_title"))},[h,u,g]);return M(Uj,I=>{const j=I.getParser();if(!j)return;const E=new Map;j.offers.forEach(C=>{const b=new $i(C.offerId,C.furniId,C.furniType,C.extraData,C.stuffData,C.price,C.status,C.averagePrice,C.offerCount);b.timeLeftMinutes=C.timeLeftMinutes,E.set(C.offerId,b)}),r(j.totalItemsFound),l(E)}),M(Fj,I=>{const j=I.getParser();if(j)switch(j.result){case 1:f(c);break;case 2:l(E=>{const C=new Map(E);return C.delete(j.requestedOfferId),C}),u(d("catalog.marketplace.not_available_header"),pe.DEFAULT,null,null,d("catalog.marketplace.not_available_title"));break;case 3:l(E=>{const C=new Map(E),b=C.get(j.requestedOfferId);return b&&(b.offerId=j.offerId,b.price=j.newPrice,b.offerCount--,C.set(b.offerId,b)),C.delete(j.requestedOfferId),C}),g(d("catalog.marketplace.confirm_higher_header")+`
`+d("catalog.marketplace.confirm_price",["price"],[j.newPrice.toString()]),()=>{D(new hu(j.offerId))},null,null,null,d("catalog.marketplace.confirm_higher_title"));break;case 4:u(d("catalog.alert.notenough.credits.description"),pe.DEFAULT,null,null,d("catalog.alert.notenough.title"));break}}),e.jsxs(e.Fragment,{children:[e.jsxs(bn,{children:[e.jsx(P,{active:t===qt.BY_ACTIVITY,onClick:()=>s(qt.BY_ACTIVITY),children:d("catalog.marketplace.search_by_activity")}),e.jsx(P,{active:t===qt.BY_VALUE,onClick:()=>s(qt.BY_VALUE),children:d("catalog.marketplace.search_by_value")}),e.jsx(P,{active:t===qt.ADVANCED,onClick:()=>s(qt.ADVANCED),children:d("catalog.marketplace.search_advanced")})]}),e.jsx(ZS,{sortTypes:p,searchType:t,onSearch:f}),e.jsxs(v,{gap:1,overflow:"hidden",children:[e.jsx(N,{truncate:!0,shrink:!0,fontWeight:"bold",children:d("catalog.marketplace.items_found",["count"],[i.size.toString()])}),e.jsx(v,{className:"nitro-catalog-layout-marketplace-grid",overflow:"auto",children:Array.from(i.values()).map((I,j)=>e.jsx(Gh,{offerData:I,type:Ja,onClick:x},j))})]})]})},rw=a=>{const{page:t=null}=a,[s,n]=o.useState(-1),[r,i]=o.useState([]),[l,c]=o.useState(-1),[m,h]=o.useState([]),[u,g]=o.useState(-1),[f,p]=o.useState(!1),[x,I]=o.useState(""),[j,E]=o.useState(!0),[C,b]=o.useState(-1),{currentOffer:_=null,setCurrentOffer:S=null,setPurchaseOptions:T=null,catalogOptions:L=null,roomPreviewer:k=null}=Le(),{petPalettes:R=null}=L,y=o.useMemo(()=>!m.length||u===-1?16777215:m[u][0],[m,u]),O=o.useMemo(()=>s===-1||!r.length||l===-1?"":d(`pet.breed.${s}.${r[l].breedId}`),[s,r,l]),F=o.useMemo(()=>{if(!r.length||l===-1)return"";const q=r[l].paletteId;let U=16777215;if(s<=7){if(u===-1)return"";U=m[u][0]}let J=U.toString(16).toUpperCase();for(;J.length<6;)J="0"+J;return`${q}
${J}`},[r,l,s,m,u]),V=o.useMemo(()=>{let q="";switch(C){case 1:q="catalog.alert.petname.long";break;case 2:q="catalog.alert.petname.short";break;case 3:q="catalog.alert.petname.chars";break;case 4:q="catalog.alert.petname.bobba";break}return!q||!q.length?"":d(q)},[C]),Y=o.useCallback(()=>{if(C===-1){D(new Vj(x,1));return}if(C===0){D(new Ho(t.pageId,_.offerId,`${x}
${F}`,1));return}},[t,_,x,F,C]);return M(Gj,q=>{const U=q.getParser();b(U.result),U.result===0?Y():Ct(new lr(-1))}),o.useEffect(()=>{if(!t||!t.offers.length)return;const q=t.offers[0];S(q),n(TC(q.localizationId)),p(!1)},[t,S]),o.useEffect(()=>{if(!_)return;const q=_.product.productData;if(q){if(R)for(const U of R){if(U.breed!==q.type)continue;const J=[];for(const je of U.palettes)je.sellable&&J.push(je);c(J.length?0:-1),i(J);return}c(-1),i([]),D(new Bj(q.type))}},[_,R]),o.useEffect(()=>{if(s===-1)return;const q=yC(s,r);g(q.length?0:-1),h(q)},[s,r]),o.useEffect(()=>{if(!k||(k.reset(!1),s===-1||!r.length||l===-1))return;let q=`${s} ${r[l].paletteId}`;s<=7&&(q+=` ${y.toString(16)}`),k.addPetIntoRoom(q)},[k,s,r,l,y]),o.useEffect(()=>{b(-1)},[x]),_?e.jsxs(ne,{children:[e.jsx(v,{size:7,overflow:"hidden",children:e.jsxs(Pe,{columnCount:5,children:[!f&&r.length>0&&r.map((q,U)=>e.jsx(Ce,{itemActive:l===U,onClick:J=>c(U),children:e.jsx(xn,{typeId:s,paletteId:q.paletteId,direction:2,headOnly:!0})},U)),f&&m.length>0&&m.map((q,U)=>e.jsx(Ce,{itemHighlight:!0,itemActive:u===U,itemColor:Is.int2rgb(q[0]),className:"clear-bg",onClick:J=>g(U)},U))]})}),e.jsxs(v,{center:!_,size:5,overflow:"hidden",children:[!_&&e.jsxs(e.Fragment,{children:[!!t.localization.getImage(1)&&e.jsx("img",{alt:"",src:t.localization.getImage(1)}),e.jsx(N,{center:!0,dangerouslySetInnerHTML:{__html:t.localization.getText(0)}})]}),_&&e.jsxs(e.Fragment,{children:[e.jsxs(A,{position:"relative",overflow:"hidden",children:[e.jsx(dr,{}),e.jsx(cr,{position:"absolute",className:"bg-muted rounded bottom-1 end-1"}),s>-1&&s<=7&&e.jsx(P,{position:"absolute",className:"bottom-1 start-1",onClick:q=>p(!f),children:e.jsx(Rm,{className:"fa-icon"})})]}),e.jsxs(v,{grow:!0,gap:1,children:[e.jsx(N,{truncate:!0,children:O}),e.jsxs(v,{grow:!0,gap:1,children:[e.jsx("input",{type:"text",className:"form-control form-control-sm w-100",placeholder:d("widgets.petpackage.name.title"),value:x,onChange:q=>I(q.target.value)}),C>0&&e.jsx(A,{className:"invalid-feedback d-block m-0",children:V})]}),e.jsx(w,{justifyContent:"end",children:e.jsx(Yn,{justifyContent:"end",alignItems:"end"})}),e.jsx(sn,{purchaseCallback:Y})]})]})]})]}):null},iw=a=>{const{offer:t=null,isAvailable:s=!1,daysRequired:n=0,onSelect:r=null}=a,i=o.useCallback(()=>{if(!t||!t.products.length)return"";const c=t.products[0];return Qa.getProductImageUrl(c.productType,c.furniClassId,c.extraParam)},[t]),l=o.useCallback(()=>{if(!t||!t.products.length)return"";const c=t.products[0],m=Qa.getProductCategory(c.productType,c.furniClassId)===2?"wallItem.name."+c.furniClassId:"roomItem.name."+c.furniClassId;return d(m)},[t]);return o.useCallback(()=>{if(!t||!t.products.length)return"";const c=t.products[0],m=Qa.getProductCategory(c.productType,c.furniClassId)===2?"wallItem.desc."+c.furniClassId:"roomItem.desc."+c.furniClassId;return d(m)},[t]),o.useCallback(()=>Math.floor(n/31),[n]),e.jsxs(Ce,{center:!1,column:!1,alignItems:"center",className:"p-1",children:[e.jsx(wn,{imageUrl:i()}),e.jsx(N,{grow:!0,fontWeight:"bold",children:l()}),e.jsx(P,{variant:"secondary",onClick:()=>r(t.localizationId),disabled:!s,children:d("catalog.club_gift.select")})]})},aw=a=>{const{purse:t=null}=Ur(),{catalogOptions:s=null,setCatalogOptions:n=null}=Le(),{clubGifts:r=null}=s,{showConfirm:i=null}=Fe(),l=o.useCallback(()=>r?r.giftsAvailable>0?d("catalog.club_gift.available",["amount"],[r.giftsAvailable.toString()]):r.daysUntilNextGift>0?d("catalog.club_gift.days_until_next",["days"],[r.daysUntilNextGift.toString()]):t.isVip?d("catalog.club_gift.not_available"):d("catalog.club_gift.no_club"):"",[r,t]),c=o.useCallback(h=>{i(d("catalog.club_gift.confirm"),()=>{D(new Hj(h)),n(u=>(u.clubGifts.giftsAvailable--,{...u}))},null)},[n,i]),m=o.useMemo(()=>r.offers.sort((u,g)=>r.getOfferExtraData(u.offerId).daysRequired-r.getOfferExtraData(g.offerId).daysRequired),[r]);return e.jsxs(e.Fragment,{children:[e.jsx(N,{truncate:!0,shrink:!0,fontWeight:"bold",children:l()}),e.jsx(Pe,{columnCount:1,className:"nitro-catalog-layout-vip-gifts-grid",children:r.offers.length>0&&m.map(h=>e.jsx(iw,{offer:h,isAvailable:r.getOfferExtraData(h.offerId).isSelectable&&r.giftsAvailable>0,onSelect:c,daysRequired:r.getOfferExtraData(h.offerId).daysRequired},h.offerId))})]})},ow=(a,t)=>{if(!a)return null;const s={page:a,hideNavigation:t};switch(a.layoutCode){case"frontpage_featured":return null;case"frontpage4":return e.jsx(QS,{...s});case"pets":return e.jsx(rw,{...s});case"pets2":return e.jsx(VS,{...s});case"pets3":return e.jsx(Uh,{...s});case"vip_buy":return e.jsx(KS,{...s});case"guild_frontpage":return e.jsx(US,{...s});case"guild_forum":return e.jsx(MS,{...s});case"guild_custom_furni":return e.jsx(LS,{...s});case"club_gifts":return e.jsx(aw,{...s});case"marketplace_own_items":return e.jsx(JS,{...s});case"marketplace":return e.jsx(nw,{...s});case"single_bundle":return e.jsx(HS,{...s});case"room_bundle":return e.jsx(BS,{...s});case"spaces_new":return e.jsx(YS,{...s});case"trophies":return e.jsx($S,{...s});case"info_loyalty":return e.jsx(FS,{...s});case"badge_display":return e.jsx(RS,{...s});case"roomads":return e.jsx(GS,{...s});case"default_3x3_color_grouping":return e.jsx(AS,{...s});case"soundmachine":return e.jsx(WS,{...s});case"bots":case"default_3x3":default:return e.jsx(DS,{...s})}},lw=a=>{const[t,s]=o.useState(null),[n,r]=o.useState(0),[i,l]=o.useState("0"),{catalogOptions:c=null,setCatalogOptions:m=null}=Le(),{marketplaceConfiguration:h=null}=c,{showConfirm:u=null}=Fe(),g=j=>{l(j);const E=parseInt(j);isNaN(E)||E===n||r(parseInt(j))};if(M(Wj,j=>{const E=j.getParser();m(C=>{const b={...C};return b.marketplaceConfiguration=E,b})}),ot(po.POST_MARKETPLACE,j=>s(j.item)),o.useEffect(()=>{!t||h||D(new qj)},[t,h]),o.useEffect(()=>{if(t)return()=>r(0)},[t]),!h||!t)return null;const f=t?d(t.isWallItem?"wallItem.name."+t.type:"roomItem.name."+t.type):"",p=t?d(t.isWallItem?"wallItem.desc."+t.type:"roomItem.desc."+t.type):"",x=()=>Math.max(Math.ceil(h.commission*.01*n),1),I=()=>{!t||n{D(new zj(n,t.isWallItem?2:1,t.id)),s(null)},()=>{s(null)},null,null,d("inventory.marketplace.confirm_offer.title"))};return e.jsxs(ie,{className:"nitro-catalog-layout-marketplace-post-offer",theme:"primary-slim",children:[e.jsx(re,{headerText:d("inventory.marketplace.make_offer.title"),onCloseClick:j=>s(null)}),e.jsx(se,{overflow:"hidden",children:e.jsxs(ne,{fullHeight:!0,children:[e.jsx(v,{center:!0,className:"bg-muted rounded p-2",size:4,overflow:"hidden",children:e.jsx(Qo,{productType:t.isWallItem?fe.WALL:fe.FLOOR,productClassId:t.type,extraData:t.extra.toString()})}),e.jsxs(v,{size:8,justifyContent:"between",overflow:"hidden",children:[e.jsxs(v,{grow:!0,gap:1,children:[e.jsx(N,{fontWeight:"bold",children:f}),e.jsx(N,{truncate:!0,shrink:!0,children:p})]}),e.jsxs(v,{overflow:"auto",children:[e.jsx(N,{italics:!0,children:d("inventory.marketplace.make_offer.expiration_info",["time"],[h.offerTime.toString()])}),e.jsxs("div",{className:"input-group has-validation",children:[e.jsx("input",{className:"form-control form-control-sm",type:"number",min:0,value:i,onChange:j=>g(j.target.value),placeholder:d("inventory.marketplace.make_offer.price_request")}),(nh.maximumPrice&&!isNaN(n)&&e.jsx(A,{className:"invalid-feedback d-block",children:d("inventory.marketplace.make_offer.max_price",["maxprice"],[h.maximumPrice.toString()])}),!(nh.maximumPrice||isNaN(n))&&e.jsx(A,{className:"invalid-feedback d-block",children:d("inventory.marketplace.make_offer.final_price",["commission","finalprice"],[x().toString(),(n+x()).toString()])})]}),e.jsx(P,{disabled:nh.maximumPrice||isNaN(n),onClick:I,children:d("inventory.marketplace.make_offer.post")})]})]})]})})]})},cw=a=>{const{isVisible:t=!1,setIsVisible:s=null,rootNode:n=null,currentPage:r=null,navigationHidden:i=!1,setNavigationHidden:l=null,activeNodes:c=[],searchResult:m=null,setSearchResult:h=null,openPageByName:u=null,openPageByOfferId:g=null,activateNode:f=null,getNodeById:p}=Le();return o.useEffect(()=>{const x={linkReceived:I=>{const j=I.split("/");if(!(j.length<2))switch(j[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(E=>!E);return;case"open":if(j.length>2)if(j.length===4)switch(j[2]){case"offerId":g(parseInt(j[3]));return}else u(j[2]);else s(!0);return}},eventUrlPrefix:"catalog/"};return ht(x),()=>gt(x)},[s,g,u]),e.jsxs(e.Fragment,{children:[t&&e.jsxs(ie,{uniqueKey:"catalog",className:"nitro-catalog",style:K("catalog.headers")?{width:710}:{},children:[e.jsx(re,{headerText:d("catalog.title"),onCloseClick:x=>s(!1)}),e.jsx(Tn,{children:n&&n.children.length>0&&n.children.map((x,I)=>{if(!x.isVisible)return null;const j=`${x.pageId}-${I}`;return e.jsx(tn,{isActive:x.isActive,onClick:E=>{m&&h(null),f(x)},children:e.jsxs(w,{gap:K("catalog.tab.icons")?1:0,alignItems:"center",children:[K("catalog.tab.icons")&&e.jsx(kh,{icon:x.iconId}),x.localization]})},j)})}),e.jsx(se,{children:e.jsxs(ne,{children:[!i&&e.jsx(v,{size:3,overflow:"hidden",children:c&&c.length>0&&e.jsx(TS,{node:c[0]})}),e.jsx(v,{size:i?12:9,overflow:"hidden",children:ow(r,()=>l(!0))})]})})]}),e.jsx(SS,{}),e.jsx(lw,{})]})},uw=a=>{const{chatHistory:t=[],clearChatHistory:s}=ma(),[n,r]=o.useState(!1),{onClickChat:i=null}=Rh(),[l,c]=o.useState(""),m=o.useRef(null),h=o.useMemo(()=>{if(l.length===0)return t;let g=l.toLowerCase();return t.filter(f=>f.message&&f.message.toLowerCase().includes(g)||f.name&&f.name.toLowerCase().includes(g))},[t,l]),u=()=>{s&&s()};return o.useEffect(()=>{m&&m.current&&n&&(m.current.scrollTop=m.current.scrollHeight)},[n]),o.useEffect(()=>{const g={linkReceived:f=>{const p=f.split("/");if(!(p.length<2))switch(p[1]){case"show":r(!0);return;case"hide":r(!1);return;case"toggle":r(x=>!x);return}},eventUrlPrefix:"chat-history/"};return ht(g),()=>gt(g)},[]),e.jsx(ar,{children:n&&e.jsx(or.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},children:e.jsxs(w,{gap:2,className:"nitro-chat-history",children:[e.jsx(v,{className:"chat-history-content h-100",children:e.jsxs(v,{className:"h-100",children:[e.jsx(w,{justifyContent:"end",className:"p-2",children:e.jsx(P,{variant:"danger",onClick:u,children:d("chat.history.clear")})}),e.jsx(nl,{rows:h,scrollToBottom:!0,rowRender:g=>e.jsxs(w,{alignItems:"center",className:"p-1",gap:2,children:[e.jsx(N,{variant:"muted",children:g.timestamp}),g.type===en.TYPE_CHAT&&e.jsxs("div",{className:"bubble-container",style:{position:"relative"},children:[g.style===0&&e.jsx("div",{className:"user-container-bg",style:{backgroundColor:g.color}}),e.jsxs("div",{className:`chat-bubble bubble-${g.style} type-${g.chatType}`,style:{maxWidth:"100%"},children:[e.jsx("div",{className:"user-container",children:g.imageUrl&&g.imageUrl.length>0&&e.jsx("div",{className:"user-image",style:{backgroundImage:`url(${g.imageUrl})`}})}),e.jsxs("div",{className:"chat-content",children:[e.jsx("b",{className:"username mr-1",dangerouslySetInnerHTML:{__html:`${g.name}: `}}),e.jsx("span",{className:"message",style:{color:g.chatColours},dangerouslySetInnerHTML:{__html:`${g.message}`},onClick:f=>i(f)})]})]})]}),g.type===en.TYPE_ROOM_INFO&&e.jsxs(e.Fragment,{children:[e.jsx("i",{className:"icon icon-small-room"}),e.jsx(N,{textBreak:!0,wrap:!0,grow:!0,variant:"white",children:g.name})]})]})})]})}),e.jsx(w,{className:"chat-toggle",onClick:g=>r(!1)})]})})})},Bh=o.createContext({originalFloorplanSettings:null,setOriginalFloorplanSettings:null,visualizationSettings:null,setVisualizationSettings:null}),dw=a=>e.jsx(Bh.Provider,{...a}),qc=()=>o.useContext(Bh),js=32,Dn=95,Qn="x0123456789abcdefghijklmnopq",br=class br{};br.DOOR=0,br.UP=1,br.DOWN=2,br.SET=3,br.UNSET=4;let at=br;const mw={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 hw{constructor(){this._currentAction=at.SET,this._currentHeight=Qn[1]}get currentAction(){return this._currentAction}set currentAction(t){this._currentAction=t}get currentHeight(){return this._currentHeight}set currentHeight(t){this._currentHeight=t}clear(){this._currentAction=at.SET,this._currentHeight=Qn[1]}}const gw="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGwAAAC+CAMAAADnThrbAAAAYFBMVEUAAAAiIiIAZf8A6P8A/5MZ/wCb/wD/tQD/MgD/AHr/APxDXocAkf8A/+oA/2hE/wDy/wD/iQD/BwD/AKXWAP////8AvP8A/78A/z1w/wD/4AD/XgD/ACP/ANGqAP8QEBBSz3qJAAAAAXRSTlMAQObYZgAAAAlwSFlzAAALEwAACxMBAJqcGAAABJxJREFUeNrt1tuOszoMBeDpD7QFBloKDGf6/m+51UTj1PUhN1uWOup3vSQLkSzn6+vV4fAV9X9lLIcdDv/+xWKHw/d3PPPzE8k8Rj1osceoBz3z4yiZ31HauN9R2rjfUcq451HSuOdR0rjnUcK411HcuNdR3LjXUcw4btTrOG7U6zhu1Ms4adTzOGnU8zhpVBh30Eb5cQ/fKp/5UR1+51l9mfU/Mz6NxvfMuEGMu9G49f/y8vzLz4Ikif/8qopnhiF6FhNHP9aVo2cGR71lCZAvbAXkzADE/kgQvooqhM8MCNuMCUFLtiJoZiBI5ycsvD4qFs4MLLTNElFYjJUoZAYRPAsSlV/5lcpnBhU8C6y+zPqfGZ9G43tm3CDG3Wjc+p9N/Z7PgjSN//y6jmfGMXoWU0c/1rWjZ0ZHvWUpkC9sDeTMCMT+SBG+imqEz4wI24wpQUu2JmhmJEjnpyy8PmoWzowstM1SUViMtShkRhE8C1KVX/m1ymdGFTwLrL7M+p8Zn0bje2bcIMbdaNz6n039ns+CLIv//Mslnpmm6FnMHP1YXxw9MznqLcuAfGEvQM5MQOyPDOGr6ILwmQlhmzEjaMleCJqZCNL5GQuvjwsLZyYW2maZKCzGiyhkJhE8CzKVX/kXlc9MKngWWH2Z9T8zPo3G98y4QYy70bj1P5v6PZ8Fx2P851+v8cw8R8/i0dGP9dXRM7Oj3rIjkC/sFciZGYj9cUT4KroifGZG2GY8ErRkrwTNzATp/CMLr48rC2dmFtpmR1FYjFdRyMwieBYcVX7lX1U+M6vgWWD1Zdb/zPg0Gt8z4wYx7kbj1v9s6vd8FpxO8Z/fNPHMskTP4snRj3Xj6JnFUW/ZCcgXtgFyZgFif5wQvooahM8sCNuMJ4KWbEPQzEKQzj+x8PpoWDizsNA2O4nCYmxEIbOI4FlwUvmV36h8ZlHBs8Dqy6z/mfFpNL5nxg1i3I3Grf/Z1O/5LDif4z//dotn1jV6Fs+Ofqxvjp5ZHfWWnYF8YW9AzqxA7I8zwlfRDeEzK8I245mgJXsjaGYlSOefWXh93Fg4s7LQNjuLwmK8iUJmFcGz4KzyK/+m8plVBc8Cqy+z/mfGp9H4nhk3iHE3Grf+Z1O/57Mgz+M/v23jmW2LnsXc0Y916+iZzVFvWQ7kC9sCObMBsT9yhK+iFuEzG8I2Y07Qkm0JmtkI0vk5C6+PloUzGwtts1wUFmMrCplNBM+CXOVXfqvymU0FzwKrL7P+Z8an0fieGTeIcTcat/5nU7/ns6Ao4j+/6+KZfY+excLRj3Xn6JndUW9ZAeQL2wE5swOxPwqEr6IO4TM7wjZjQdCS7Qia2QnS+QULr4+OhTM7C22zQhQWYycKmV0Ez4JC5Vd+p/KZXQXPAqsvs/5nxqfR+J4ZN4hxNxq3/mdTv+ezoCzjP7/v45n7PXoWS0c/1r2jZ+6OestKIF/YHsiZOxD7o0T4KuoRPnNH2GYsCVqyPUEzd4J0fsnC66Nn4cydhbZZKQqLsReFzF0Ez4JS5Vd+r/KZuwqeBVZfZv3PjE+j8T0zbhDjbjRu/b+0PP8DZwi9QurvbfwAAAAASUVORK5CYII=",fw={frames:{0:{frame:{x:1,y:1,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},1:{frame:{x:37,y:1,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},2:{frame:{x:73,y:1,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},3:{frame:{x:1,y:20,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},4:{frame:{x:37,y:20,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},5:{frame:{x:73,y:20,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},6:{frame:{x:1,y:39,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},7:{frame:{x:37,y:39,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},8:{frame:{x:73,y:39,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},9:{frame:{x:1,y:58,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},a:{frame:{x:37,y:58,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},b:{frame:{x:73,y:58,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},c:{frame:{x:1,y:77,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},d:{frame:{x:37,y:77,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},e:{frame:{x:73,y:77,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},f:{frame:{x:1,y:96,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},g:{frame:{x:37,y:96,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},h:{frame:{x:73,y:96,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},i:{frame:{x:1,y:115,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},j:{frame:{x:37,y:115,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},k:{frame:{x:73,y:115,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},l:{frame:{x:1,y:134,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},m:{frame:{x:37,y:134,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},n:{frame:{x:73,y:134,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},o:{frame:{x:1,y:153,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},p:{frame:{x:37,y:153,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},q:{frame:{x:73,y:153,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},r:{frame:{x:73,y:153,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},r_blocked:{frame:{x:1,y:172,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},r_door:{frame:{x:37,y:172,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},s:{frame:{x:73,y:153,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},t:{frame:{x:73,y:153,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}},x:{frame:{x:73,y:172,w:34,h:17},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:34,h:17},sourceSize:{w:34,h:17}}}};class Fa{constructor(t,s){this._height=t,this._isBlocked=s,this._selected=!1}get height(){return this._height}set height(t){this._height=t}get isBlocked(){return this._isBlocked}set isBlocked(t){this._isBlocked=t}get selected(){return this._selected}set selected(t){this._selected=t}}const md=(a,t)=>{let s=a*js/2-t*js/2;const n=a*js/4+t*js/4;return s=s+1600,[s,n]},hd=(a,t)=>{const s=a-1600,n=(s/(js/2)+t/(js/4))/2,r=(t/(js/4)-s/(js/2))/2;return[n,r]},jo=a=>{switch(a=parseInt(a.toString()),a){case 0:return-2;case 1:return-1;case 3:return 1;default:return 0}},Va=a=>{switch(a){case .25:return 0;case .5:return 1;case 2:return 3;default:return 2}},Xs=class Xs{constructor(){this._squareSelectMode=!1,this._selectionStart=null,this._selectionEnd=null,this._zoomLevel=1;const t=js*Dn+20,s=js*Dn/2+100,n=document.createElement("canvas");n.height=s,n.width=t,n.style.touchAction="none",n.oncontextmenu=r=>{r.preventDefault()},this._renderer=n.getContext("2d"),this._image=new Image,this._image.src=gw,this._tilemap=[],this._doorLocation=new Vs(0,0),this._width=0,this._height=0,this._isPointerDown=!1,this._lastUsedTile=new Vs(-1,-1),this._actionSettings=new hw}setSquareSelectMode(t){this._squareSelectMode=t,t||(this._selectionStart=null,this._selectionEnd=null)}get squareSelectMode(){return this._squareSelectMode}onPointerRelease(){this._isPointerDown=!1,this._squareSelectMode&&this._selectionStart&&this.finalizeSquareSelection()}onPointerDown(t){if(this._squareSelectMode){t.preventDefault();const n=new Vs(t.offsetX/this._zoomLevel,t.offsetY/this._zoomLevel),[r,i]=hd(n.x,n.y),l=Math.floor(r),c=Math.floor(i);this._selectionStart=new Vs(l,c),this._selectionEnd=new Vs(l,c),this._isPointerDown=!0;return}if(t.button===2)return;const s=new Vs(t.offsetX/this._zoomLevel,t.offsetY/this._zoomLevel);this._isPointerDown=!0,this.tileHitDetection(s,!0)}onPointerMove(t){if(!this._isPointerDown)return;const s=new Vs(t.offsetX/this._zoomLevel,t.offsetY/this._zoomLevel);if(this._squareSelectMode&&this._selectionStart){const[n,r]=hd(s.x,s.y);this._selectionEnd.x=Math.floor(n),this._selectionEnd.y=Math.floor(r),this.renderTiles();return}this.tileHitDetection(s,!1)}tileHitDetection(t,s=!1){const n=Math.floor(t.x),r=Math.floor(t.y),i=js,l=js/2;for(let c=0;c0&&(t+1>this._width&&(this._width=t+1),s+1>this._height&&(this._height=s+1));const m=Qn[c];m&&(this._tilemap[s][t].height=m,n&&this.renderTiles())}renderTiles(){this.clearCanvas(),this._renderer.save(),this._renderer.scale(this._zoomLevel,this._zoomLevel);for(let t=0;t=m&&s<=h&&t>=u&&t<=g){this.renderer.fillStyle="rgba(0, 255, 0, 0.3)",this.renderer.fillRect(i,l,c.frame.w,c.frame.h);continue}}n.selected&&(this.renderer.fillStyle=n.isBlocked?"rgb(128, 0, 128)":"rgba(0, 0, 255, 0.3)",this.renderer.fillRect(i,l,c.frame.w,c.frame.h))}this._renderer.restore()}toggleSelectAll(){for(let t=0;tthis._width&&(this._width=s+1),t+1>this._height&&(this._height=t+1))}}this.recalcActiveArea(),this.renderTiles()}finalizeSquareSelection(){const t=Math.floor(this._selectionStart.x),s=Math.floor(this._selectionStart.y),n=Math.floor(this._selectionEnd.x),r=Math.floor(this._selectionEnd.y),i=Math.min(t,n),l=Math.max(t,n),c=Math.min(s,r),m=Math.max(s,r);this.selectSquareField(i,c,l,m),this._selectionStart=null,this._selectionEnd=null,this.renderTiles()}selectSquareField(t,s,n,r){for(let i=s;i<=r;i++)for(let l=t;l<=n;l++)this._tilemap[i]&&this._tilemap[i][l]&&(this._tilemap[i][l].selected=!0,this.onClick(l,i,!1,!0));this.recalcActiveArea(),this.renderTiles()}recalcActiveArea(){this._width=0,this._height=0;for(let t=0;tthis._width&&(this._width=s+1),t+1>this._height&&(this._height=t+1))}setTilemap(t,s){this._tilemap=[];const n=t.split("\r");let r=0,i=n.length;for(let l=0;lr&&(r=c.length)}for(let l=0;l=0;n--)if(this._tilemap[n])for(let r=Dn-1;r>=0;r--){if(!this._tilemap[n][r])continue;this._tilemap[n][r].height!=="x"&&(r+1>this._width&&(this._width=r+1),n+1>this._height&&(this._height=n+1))}}const s=[];for(let n=0;n{const{gap:t=1,children:s=null,...n}=a,[r,i]=o.useState(!1),[l,c]=o.useState(!1),{originalFloorplanSettings:m=null,setOriginalFloorplanSettings:h=null,setVisualizationSettings:u=null}=qc(),g=o.useRef(null);M(Yj,C=>{const b=C.getParser();h(_=>{const S={..._};return S.reservedTiles=b.blockedTilesMap,Ye.instance.setTilemap(S.tilemap,S.reservedTiles),S}),i(!0),g.current.scrollTo(Ye.instance.renderer.canvas.width/3,0)}),M($j,C=>{const b=C.getParser();h(_=>{const S={..._};return S.entryPoint=[b.x,b.y],S.entryPointDir=b.direction,S}),u(_=>{const S={..._};return S.entryPointDir=b.direction,S}),Ye.instance.doorLocation=new Vs(b.x,b.y),c(!0)});const f=C=>{const b=g.current;if(b)switch(C){case"up":b.scrollBy({top:-10});break;case"down":b.scrollBy({top:10});break;case"left":b.scrollBy({left:-10});break;case"right":b.scrollBy({left:10});break}},p=C=>{switch(C.preventDefault(),C.type){case"pointerout":case"pointerup":Ye.instance.onPointerRelease();break;case"pointerdown":Ye.instance.onPointerDown(C);break;case"pointermove":Ye.instance.onPointerMove(C);break}},x=()=>{Ye.instance.zoomIn()},I=()=>{Ye.instance.zoomOut()},j=()=>{Ye.instance._zoomLevel=1,Ye.instance.adjustCanvasSize(),Ye.instance.renderTiles()};o.useEffect(()=>()=>{Ye.instance.clear(),u(C=>({wallHeight:m.wallHeight,thicknessWall:m.thicknessWall,thicknessFloor:m.thicknessFloor,entryPointDir:C.entryPointDir}))},[m.thicknessFloor,m.thicknessWall,m.wallHeight,u]),o.useEffect(()=>{!l||!r||Ye.instance.renderTiles()},[l,r]),o.useEffect(()=>{D(new Kj),D(new Xj);const C=g.current;if(C)return C.appendChild(Ye.instance.renderer.canvas),C.addEventListener("pointerup",p),C.addEventListener("pointerout",p),C.addEventListener("pointerdown",p),C.addEventListener("pointermove",p),()=>{C&&(C.removeEventListener("pointerup",p),C.removeEventListener("pointerout",p),C.removeEventListener("pointerdown",p),C.removeEventListener("pointermove",p))}},[]);const E=()=>window.innerWidth<768;return e.jsxs(v,{gap:t,...n,children:[e.jsxs(ne,{overflow:"hidden",gap:1,children:[e.jsx(v,{center:!0,size:1,className:"d-md-none",children:e.jsx(P,{className:"d-md-none",onClick:C=>f("left"),children:e.jsx(km,{className:"fa-icon"})})}),e.jsxs(v,{overflow:"hidden",size:E()?10:12,gap:1,children:[e.jsxs(w,{justifyContent:"left",gap:1,children:[e.jsx(P,{shrink:!0,onClick:x,children:e.jsx(ym,{className:"fa-icon"})}),e.jsx(P,{shrink:!0,onClick:j,children:e.jsx(Qj,{className:"fa-icon"})}),e.jsx(P,{shrink:!0,onClick:I,children:e.jsx(Tm,{className:"fa-icon"})}),e.jsx(P,{shrink:!0,onClick:C=>f("up"),className:"d-md-none",children:e.jsx(Jj,{className:"fa-icon"})})]}),e.jsx(A,{overflow:"auto",innerRef:g}),e.jsx(w,{justifyContent:"center",className:"d-md-none",children:e.jsx(P,{shrink:!0,onClick:C=>f("down"),children:e.jsx(Zj,{className:"fa-icon"})})})]}),e.jsx(v,{center:!0,size:1,className:"d-md-none",children:e.jsx(P,{className:"d-md-none",onClick:C=>f("right"),children:e.jsx(Am,{className:"fa-icon"})})})]}),s]})},gd=a=>a.replace(/\r\n|\r|\n/g,`
`).toLowerCase(),xw=a=>{const{onCloseClick:t=null}=a,[s,n]=o.useState(""),{originalFloorplanSettings:r=null}=qc(),i=()=>{D(new Dm(s.split(`
`).join("\r"),r.entryPoint[0],r.entryPoint[1],r.entryPointDir,jo(r.thicknessWall),jo(r.thicknessFloor),r.wallHeight-1))};return Bc(()=>{n(gd(r.tilemap))}),e.jsxs(ie,{theme:"primary-slim",className:"floorplan-import-export",children:[e.jsx(re,{headerText:d("floor.plan.editor.import.export"),onCloseClick:t}),e.jsxs(se,{children:[e.jsx("textarea",{className:"h-100",value:s,onChange:l=>n(l.target.value)}),e.jsxs(w,{justifyContent:"between",children:[e.jsx(P,{onClick:l=>n(gd(r.tilemap)),children:d("floor.plan.editor.revert.to.last.received.map")}),e.jsx(P,{onClick:i,children:d("floor.plan.editor.save")})]})]})]})},fd=0,Ga=16,jw=0,Iw=26,bw=a=>{const{visualizationSettings:t=null,setVisualizationSettings:s=null}=qc(),[n,r]=o.useState(at.SET),[i,l]=o.useState(0),[c,m]=o.useState(Ye.instance.squareSelectMode);o.useEffect(()=>{m(Ye.instance.squareSelectMode)},[]);const h=C=>{r(C),Ye.instance.actionSettings.currentAction=C},u=()=>{const C=!Ye.instance.squareSelectMode;Ye.instance.setSquareSelectMode(C),m(C)},g=()=>{s(C=>{const b={...C};return b.entryPointDir<7?++b.entryPointDir:b.entryPointDir=0,b})},f=C=>{(isNaN(C)||C<=0)&&(C=0),C>26&&(C=26),l(C),Ye.instance.actionSettings.currentHeight=C.toString(36)},p=C=>{s(b=>{const _={...b};return _.thicknessFloor=C,_})},x=C=>{s(b=>{const _={...b};return _.thicknessWall=C,_})},I=C=>{(isNaN(C)||C<=0)&&(C=fd),C>Ga&&(C=Ga),s(b=>{const _={...b};return _.wallHeight=C,_})},j=()=>{let C=t.wallHeight+1;C>Ga&&(C=Ga),I(C)},E=()=>{let C=t.wallHeight-1;C<=0&&(C=fd),I(C)};return e.jsxs(v,{children:[e.jsxs(w,{gap:1,children:[e.jsxs(v,{size:5,gap:1,children:[e.jsx(N,{bold:!0,children:d("floor.plan.editor.draw.mode")}),e.jsxs(w,{gap:3,children:[e.jsxs(w,{gap:1,children:[e.jsx(Ce,{itemActive:n===at.SET,onClick:C=>h(at.SET),children:e.jsx("i",{className:"icon icon-set-tile"})}),e.jsx(Ce,{itemActive:n===at.UNSET,onClick:C=>h(at.UNSET),children:e.jsx("i",{className:"icon icon-unset-tile"})})]}),e.jsxs(w,{gap:1,children:[e.jsx(Ce,{itemActive:n===at.UP,onClick:C=>h(at.UP),children:e.jsx("i",{className:"icon icon-increase-height"})}),e.jsx(Ce,{itemActive:n===at.DOWN,onClick:C=>h(at.DOWN),children:e.jsx("i",{className:"icon icon-decrease-height"})}),e.jsx(Ce,{itemActive:n===at.DOOR,onClick:C=>h(at.DOOR),children:e.jsx("i",{className:"icon icon-set-door"})}),e.jsx(Ce,{onClick:C=>Ye.instance.toggleSelectAll(),children:e.jsx("i",{className:`icon ${n===at.UNSET?"icon-set-deselect":"icon-set-select"}`})}),e.jsx(Ce,{itemActive:c,onClick:u,children:e.jsx("i",{className:`icon ${c?"icon-set-active-squaresselect":"icon-set-squaresselect"}`})})]})]})]}),e.jsxs(v,{alignItems:"center",size:4,children:[e.jsx(N,{bold:!0,children:d("floor.plan.editor.enter.direction")}),e.jsx("i",{className:`icon icon-door-direction-${t.entryPointDir} cursor-pointer`,onClick:g})]}),e.jsxs(v,{size:3,children:[e.jsx(N,{bold:!0,children:d("floor.editor.wall.height")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(Ic,{className:"cursor-pointer fa-icon",onClick:E}),e.jsx("input",{type:"number",className:"form-control form-control-sm quantity-input",value:t.wallHeight,onChange:C=>I(C.target.valueAsNumber)}),e.jsx(bc,{className:"cursor-pointer fa-icon",onClick:j})]})]})]}),e.jsxs(w,{gap:1,children:[e.jsxs(v,{size:6,children:[e.jsxs(N,{bold:!0,children:[d("floor.plan.editor.tile.height"),": ",i]}),e.jsx(Lt,{min:jw,max:Iw,step:1,value:i,onChange:C=>f(C),renderThumb:({style:C,key:b,..._},S)=>e.jsx("div",{style:{backgroundColor:`#${mw[S.valueNow.toString(33)]}`,...C},..._,children:S.valueNow},b)})]}),e.jsxs(v,{size:6,children:[e.jsx(N,{bold:!0,children:d("floor.plan.editor.room.options")}),e.jsxs(w,{className:"align-items-center",children:[e.jsxs("select",{className:"form-control form-control-sm",value:t.thicknessWall,onChange:C=>x(parseInt(C.target.value)),children:[e.jsx("option",{value:0,children:d("navigator.roomsettings.wall_thickness.thinnest")}),e.jsx("option",{value:1,children:d("navigator.roomsettings.wall_thickness.thin")}),e.jsx("option",{value:2,children:d("navigator.roomsettings.wall_thickness.normal")}),e.jsx("option",{value:3,children:d("navigator.roomsettings.wall_thickness.thick")})]}),e.jsxs("select",{className:"form-control form-control-sm",value:t.thicknessFloor,onChange:C=>p(parseInt(C.target.value)),children:[e.jsx("option",{value:0,children:d("navigator.roomsettings.floor_thickness.thinnest")}),e.jsx("option",{value:1,children:d("navigator.roomsettings.floor_thickness.thin")}),e.jsx("option",{value:2,children:d("navigator.roomsettings.floor_thickness.normal")}),e.jsx("option",{value:3,children:d("navigator.roomsettings.floor_thickness.thick")})]})]})]})]})]})},Ew=a=>{const[t,s]=o.useState(!1),[n,r]=o.useState(!1),[i,l]=o.useState({tilemap:"",reservedTiles:[],entryPoint:[0,0],entryPointDir:2,wallHeight:-1,thicknessWall:1,thicknessFloor:1}),[c,m]=o.useState({entryPointDir:2,wallHeight:-1,thicknessWall:1,thicknessFloor:1}),h=()=>{D(new Dm(Ye.instance.getCurrentTilemapString(),Ye.instance.doorLocation.x,Ye.instance.doorLocation.y,c.entryPointDir,jo(c.thicknessWall),jo(c.thicknessFloor),c.wallHeight-1))},u=()=>{m({wallHeight:i.wallHeight,thicknessWall:i.thicknessWall,thicknessFloor:i.thicknessFloor,entryPointDir:i.entryPointDir}),Ye.instance.doorLocation=new Vs(i.entryPoint[0],i.entryPoint[1]),Ye.instance.setTilemap(i.tilemap,i.reservedTiles),Ye.instance.renderTiles()};return ve(ys.DISPOSED,g=>s(!1)),M(eI,g=>{const f=g.getParser();l(p=>{const x={...p};return x.tilemap=f.model,x.wallHeight=f.wallHeight+1,x}),m(p=>{const x={...p};return x.wallHeight=f.wallHeight+1,x})}),M(tI,g=>{const f=g.getParser();l(p=>{const x={...p};return x.thicknessFloor=Va(f.thicknessFloor),x.thicknessWall=Va(f.thicknessWall),x}),m(p=>{const x={...p};return x.thicknessFloor=Va(f.thicknessFloor),x.thicknessWall=Va(f.thicknessWall),x})}),o.useEffect(()=>{const g={linkReceived:f=>{const p=f.split("/");if(!(p.length<2))switch(p[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(x=>!x);return}},eventUrlPrefix:"floor-editor/"};return ht(g),()=>gt(g)},[]),e.jsxs(dw,{value:{originalFloorplanSettings:i,setOriginalFloorplanSettings:l,visualizationSettings:c,setVisualizationSettings:m},children:[t&&e.jsxs(ie,{uniqueKey:"floorpan-editor",className:"nitro-floorplan-editor",theme:"primary-slim",children:[e.jsx(re,{headerText:d("floor.plan.editor.title"),onCloseClick:()=>s(!1)}),e.jsxs(se,{overflow:"hidden",children:[e.jsx(bw,{}),e.jsx(pw,{overflow:"hidden"}),e.jsxs(w,{justifyContent:"between",children:[e.jsx(P,{onClick:u,children:d("floor.plan.editor.reload")}),e.jsxs(bn,{children:[e.jsx(P,{disabled:!0,children:d("floor.plan.editor.preview")}),e.jsx(P,{onClick:g=>r(!0),children:d("floor.plan.editor.import.export")}),e.jsx(P,{onClick:h,children:d("floor.plan.editor.save")})]})]})]})]}),n&&e.jsx(xw,{onCloseClick:()=>r(!1)})]})},Cw=a=>{const{friend:t=null}=a,[s,n]=o.useState(!1),{followFriend:r=null}=hs(),i=o.useRef();return o.useEffect(()=>{const l=c=>{const m=i.current;m&&c.target!==m&&!m.contains(c.target)&&n(!1)};return document.addEventListener(be.MOUSE_CLICK,l),()=>document.removeEventListener(be.MOUSE_CLICK,l)},[]),t?e.jsxs("div",{ref:i,className:"btn btn-friendsgensuccess friend-bar-item "+(s?"friend-bar-item-active":""),onClick:l=>n(c=>!c),children:[e.jsxs("div",{className:`friend-bar-item-head position-absolute ${t.id>0?"avatar":"group"}`,children:[t.id>0&&e.jsx(nt,{headOnly:!s,figure:t.figure,direction:s?2:3}),t.id<=0&&e.jsx(nt,{headOnly:!s,figure:t.id<=0&&t.figure==="ADM"?"ha-3409-1413-70.lg-285-89.ch-3032-1334-109.sh-3016-110.hd-185-1359.ca-3225-110-62.wa-3264-62-62.fa-1206-90.hr-3322-1403":t.figure,isgroup:t.id<=0?1:0,direction:s?2:3})]}),e.jsx("div",{className:"text-truncate",children:t.name}),s&&e.jsxs("div",{className:"d-flex justify-content-between",children:[e.jsx(A,{className:"nitro-friends-spritesheet icon-friendbar-chat cursor-pointer",onClick:l=>Xo(t.id)}),t.followingAllowed&&e.jsx(A,{className:"nitro-friends-spritesheet icon-friendbar-visit cursor-pointer",onClick:l=>r(t)}),e.jsx(A,{className:"nitro-friends-spritesheet icon-profile cursor-pointer",onClick:l=>as(t.id)})]})]}):e.jsxs("div",{ref:i,className:"btn btn-friendsgen friend-bar-item friend-bar-search "+(s?"friend-bar-search-item-active":""),onClick:l=>n(c=>!c),children:[e.jsx("div",{className:"friend-bar-item-head position-absolute"}),e.jsx("div",{className:"friend-bar-text",children:d("friend.bar.find.title")}),s&&e.jsxs("div",{className:"search-content mt-3",children:[e.jsx("div",{className:"bg-white text-black px-1 py-1 font-size-friend",children:d("friend.bar.find.text")}),e.jsx(P,{className:"mt-2 mb-4",variant:"white",onClick:()=>D(new Pm),children:d("friend.bar.find.button")})]})]})},wl=3,Nw=a=>{const{onlineFriends:t=null}=a,[s,n]=o.useState(0),r=o.useRef();return e.jsxs(w,{innerRef:r,alignItems:"center",className:"friend-bar",children:[e.jsx(P,{variant:"black",className:"friend-bar-button",disabled:s<=0,onClick:i=>n(s-1),children:e.jsx(Ss,{className:"fa-icon"})}),Array.from(Array(wl),(i,l)=>e.jsx(Cw,{friend:t[s+l]||null},l)),e.jsx(P,{variant:"black",className:"friend-bar-button",disabled:!(t.length>wl&&s+wl<=t.length-1),onClick:i=>n(s+1),children:e.jsx(ws,{className:"fa-icon"})})]})},vw=a=>{const{friend:t=null,selected:s=!1,selectFriend:n=null}=a,[r,i]=o.useState(!1),{followFriend:l=null,updateRelationship:c=null}=hs(),m=p=>{p.stopPropagation(),l(t)},h=p=>{p.stopPropagation(),Xo(t.id)},u=p=>{p.stopPropagation(),i(!0)},g=(p,x)=>{p.stopPropagation(),c(t,x),i(!1)},f=()=>{if(!t)return"none";switch(t.relationshipStatus){case ds.RELATIONSHIP_HEART:return"heart";case ds.RELATIONSHIP_SMILE:return"smile";case ds.RELATIONSHIP_BOBBA:return"bobba";default:return"none"}};return t?e.jsxs(ro,{justifyContent:"between",className:`px-2 py-1 ${s&&"bg-primary text-white"}`,onClick:p=>n(t.id),children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(A,{onClick:p=>p.stopPropagation(),children:e.jsx(Ns,{userId:t.id})}),e.jsx("div",{children:t.name})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[!r&&e.jsxs(e.Fragment,{children:[t.followingAllowed&&e.jsx(A,{pointer:!0,onClick:m,className:"nitro-friends-spritesheet icon-follow",title:d("friendlist.tip.follow")}),t.online&&e.jsx(A,{pointer:!0,className:"nitro-friends-spritesheet icon-chat",onClick:h,title:d("friendlist.tip.im")}),t.id>0&&e.jsx(A,{className:`nitro-friends-spritesheet icon-${f()} cursor-pointer`,onClick:u,title:d("infostand.link.relationship")})]}),r&&e.jsxs(e.Fragment,{children:[e.jsx(A,{pointer:!0,className:"nitro-friends-spritesheet icon-heart",onClick:p=>g(p,ds.RELATIONSHIP_HEART)}),e.jsx(A,{pointer:!0,className:"nitro-friends-spritesheet icon-smile",onClick:p=>g(p,ds.RELATIONSHIP_SMILE)}),e.jsx(A,{pointer:!0,className:"nitro-friends-spritesheet icon-bobba",onClick:p=>g(p,ds.RELATIONSHIP_BOBBA)}),e.jsx(A,{pointer:!0,className:"nitro-friends-spritesheet icon-none",onClick:p=>g(p,ds.RELATIONSHIP_NONE)})]})]})]}):null},pd=a=>{const{list:t=null,selectedFriendsIds:s=null,selectFriend:n=null}=a;return!t||!t.length?null:e.jsx(e.Fragment,{children:t.map((r,i)=>e.jsx(vw,{friend:r,selected:s&&s.indexOf(r.id)>=0,selectFriend:n},i))})},_w=a=>{const{request:t=null}=a,{requestResponse:s=null}=hs();return t?e.jsxs(ro,{justifyContent:"between",className:"px-2 py-1",children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(Ns,{userId:t.id}),e.jsx("div",{children:t.name})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(A,{className:"nitro-friends-spritesheet icon-accept cursor-pointer",onClick:n=>s(t.id,!0)}),e.jsx(A,{className:"nitro-friends-spritesheet icon-deny cursor-pointer",onClick:n=>s(t.id,!1)})]})]}):null},Sw=a=>{const{children:t=null,...s}=a,{requests:n=[],requestResponse:r=null}=hs();return n.length?e.jsxs(io,{...s,children:[e.jsxs(v,{fullHeight:!0,justifyContent:"between",gap:1,children:[e.jsx(v,{gap:0,children:n.map((i,l)=>e.jsx(_w,{request:i},l))}),e.jsx(w,{justifyContent:"center",className:"px-2 py-1",children:e.jsx(P,{onClick:i=>r(-1,!1),children:d("friendlist.requests.dismissall")})})]}),t]}):null},ww=a=>{const{selectedFriendsIds:t=null,removeFriendsText:s=null,removeSelectedFriends:n=null,onCloseClick:r=null}=a;return e.jsxs(ie,{className:"nitro-friends-remove-confirmation",theme:"primary-slim",children:[e.jsx(re,{headerText:d("friendlist.removefriendconfirm.title"),onCloseClick:r}),e.jsxs(se,{className:"text-black",children:[e.jsx("div",{children:s}),e.jsxs(w,{gap:1,children:[e.jsx(P,{fullWidth:!0,variant:"danger",disabled:t.length===0,onClick:n,children:d("generic.ok")}),e.jsx(P,{fullWidth:!0,onClick:r,children:d("generic.cancel")})]})]})]})},Tw=a=>{const{selectedFriendsIds:t=null,onCloseClick:s=null,sendRoomInvite:n=null}=a,[r,i]=o.useState("");return e.jsxs(ie,{className:"nitro-friends-room-invite",uniqueKey:"nitro-friends-room-invite",theme:"primary-slim",children:[e.jsx(re,{headerText:d("friendlist.invite.title"),onCloseClick:s}),e.jsxs(se,{className:"text-black",children:[d("friendlist.invite.summary",["count"],[t.length.toString()]),e.jsx("textarea",{className:"form-control",value:r,maxLength:255,onChange:l=>i(l.target.value)}),e.jsx(N,{center:!0,className:"bg-muted rounded p-1",children:d("friendlist.invite.note")}),e.jsxs(w,{gap:1,children:[e.jsx(P,{fullWidth:!0,variant:"success",disabled:r.length===0||t.length===0,onClick:()=>n(r),children:d("friendlist.invite.send")}),e.jsx(P,{fullWidth:!0,onClick:s,children:d("generic.cancel")})]})]})]})},yw=a=>{const{...t}=a,[s,n]=o.useState(""),[r,i]=o.useState(null),[l,c]=o.useState(null),{canRequestFriend:m=null,requestFriend:h=null}=hs();return M(sI,u=>{const g=u.getParser();i(g.friends),c(g.others)}),o.useEffect(()=>{if(!s||!s.length)return;const u=setTimeout(()=>{!s||!s.length||D(new nI(s))},500);return()=>clearTimeout(u)},[s]),e.jsxs(io,{...t,children:[e.jsx("input",{type:"text",className:"search-input form-control form-control-sm w-100 rounded-0",placeholder:d("generic.search"),value:s,maxLength:50,onChange:u=>n(u.target.value)}),e.jsxs(v,{children:[r&&e.jsxs(e.Fragment,{children:[r.length===0&&e.jsx(N,{bold:!0,small:!0,className:"px-2 py-1",children:d("friendlist.search.nofriendsfound")}),r.length>0&&e.jsxs(v,{gap:0,children:[e.jsx(N,{bold:!0,small:!0,className:"px-2 py-1",children:d("friendlist.search.friendscaption",["cnt"],[r.length.toString()])}),e.jsx("hr",{className:"mx-2 mt-0 mb-1 text-black"}),e.jsx(v,{gap:0,children:r.map(u=>e.jsxs(ro,{justifyContent:"between",className:"px-2 py-1",children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(Ns,{userId:u.avatarId}),e.jsx("div",{children:u.avatarName})]}),e.jsx(w,{alignItems:"center",gap:1,children:u.isAvatarOnline&&e.jsx(A,{className:"nitro-friends-spritesheet icon-chat cursor-pointer",onClick:g=>Xo(u.avatarId),title:d("friendlist.tip.im")})})]},u.avatarId))})]})]}),l&&e.jsxs(e.Fragment,{children:[l.length===0&&e.jsx(N,{bold:!0,small:!0,className:"px-2 py-1",children:d("friendlist.search.noothersfound")}),l.length>0&&e.jsxs(v,{gap:0,children:[e.jsx(N,{bold:!0,small:!0,className:"px-2 py-1",children:d("friendlist.search.otherscaption",["cnt"],[l.length.toString()])}),e.jsx("hr",{className:"mx-2 mt-0 mb-1 text-black"}),e.jsx(v,{gap:0,children:l.map(u=>e.jsxs(ro,{justifyContent:"between",className:"px-2 py-1",children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(Ns,{userId:u.avatarId}),e.jsx("div",{children:u.avatarName})]}),e.jsx(w,{alignItems:"center",gap:1,children:m(u.avatarId)&&e.jsx(A,{className:"nitro-friends-spritesheet icon-add cursor-pointer",onClick:g=>h(u.avatarId,u.avatarName),title:d("friendlist.tip.addfriend")})})]},u.avatarId))})]})]})]})]})},Rw=a=>{const[t,s]=o.useState(!1),[n,r]=o.useState(!1),[i,l]=o.useState([]),[c,m]=o.useState(!1),[h,u]=o.useState(!1),{onlineFriends:g=[],offlineFriends:f=[],requests:p=[],requestFriend:x=null}=hs(),I=o.useMemo(()=>{if(!i||!i.length)return"";const b=[];for(const _ of i){let S=g.find(T=>T.id===_);S||(S=f.find(T=>T.id===_)),S&&b.push(S.name)}return d("friendlist.removefriendconfirm.userlist",["user_names"],[b.join(", ")])},[f,g,i]),j=o.useCallback(b=>{b<0||l(_=>{const S=[..._],T=S.indexOf(b);return T>-1?S.splice(T,1):S.push(b),S})},[l]),E=b=>{!i.length||!b||!b.length||b.length>255||(D(new rI(b,i)),m(!1))},C=()=>{i.length!==0&&(l(b=>(D(new iI(...b)),[])),u(!1))};return o.useEffect(()=>{const b={linkReceived:_=>{const S=_.split("/");if(!(S.length<2))switch(S[1]){case"show":r(!0),s(!1);return;case"hide":r(!1),s(!1);return;case"toggle":r(T=>!T),s(!0);return;case"request":if(S.length<4)return;x(parseInt(S[2]),S[3])}},eventUrlPrefix:"friends/"};return ht(b),()=>gt(b)},[x]),n?e.jsxs(e.Fragment,{children:[e.jsxs(ie,{className:"nitro-friends",uniqueKey:"nitro-friends",theme:"primary-slim",children:[e.jsx(re,{headerText:d("friendlist.friends"),onCloseClick:b=>r(!1)}),e.jsxs(se,{overflow:"hidden",gap:1,className:"text-black p-0",children:[e.jsxs(jC,{fullHeight:!0,overflow:"hidden",children:[e.jsx(io,{headerText:d("friendlist.friends")+` (${g.length})`,isExpanded:!0,children:e.jsx(pd,{list:g,selectedFriendsIds:i,selectFriend:j})}),e.jsx(io,{headerText:d("friendlist.friends.offlinecaption")+` (${f.length})`,children:e.jsx(pd,{list:f,selectedFriendsIds:i,selectFriend:j})}),e.jsx(Sw,{headerText:d("friendlist.tab.friendrequests")+` (${p.length})`,isExpanded:!0}),e.jsx(yw,{headerText:d("people.search.title")})]}),i&&i.length>0&&e.jsxs(w,{gap:1,className:"p-1",children:[e.jsx(P,{fullWidth:!0,onClick:()=>m(!0),children:d("friendlist.tip.invite")}),e.jsx(P,{fullWidth:!0,variant:"danger",onClick:b=>u(!0),children:d("generic.delete")})]})]})]}),c&&e.jsx(Tw,{selectedFriendsIds:i,onCloseClick:()=>m(!1),sendRoomInvite:E}),h&&e.jsx(ww,{selectedFriendsIds:i,removeFriendsText:I,onCloseClick:()=>u(!1),removeSelectedFriends:C})]}):null},Ow=a=>{const{thread:t=null,group:s=null}=a,n=o.useMemo(()=>s.type===Sr.GROUP_CHAT&&ch(s.chats[0].extraData),[s]),r=o.useMemo(()=>!t||!s?!1:!!(s.type===Sr.PRIVATE_CHAT&&s.userId===B().userId||n&&s.chats.length&&n.userId===B().userId),[t,s,n]);return!t||!s?null:s.userId?e.jsxs(w,{fullWidth:!0,justifyContent:r?"end":"start",gap:2,children:[e.jsxs(A,{shrink:!0,className:"message-avatar",children:[s.type===Sr.PRIVATE_CHAT&&!r&&e.jsx(nt,{figure:t.participant.figure,direction:2}),n&&!r&&e.jsx(nt,{figure:n.figure,direction:2})]}),e.jsxs(A,{className:"bg-light text-black border-radius mb-2 rounded py-1 px-2 messages-group-"+(r?"right":"left"),children:[e.jsxs(A,{className:"fw-bold",children:[e.jsx(A,{className:"small text-muted",children:s.chats[0].date.toLocaleTimeString()}),r&&B().userName,!r&&(n?n.username:t.participant.name)]}),s.chats.map((i,l)=>e.jsx(A,{className:"text-break",children:i.message},l))]}),r&&e.jsx(A,{shrink:!0,className:"message-avatar",children:e.jsx(nt,{figure:B().figure,direction:4})})]}):e.jsx(e.Fragment,{children:s.chats.map((i,l)=>e.jsx(w,{fullWidth:!0,gap:2,justifyContent:"start",children:e.jsxs(A,{className:"w-100 text-break",children:[i.type===Bn.SECURITY_NOTIFICATION&&e.jsxs(w,{gap:2,alignItems:"center",className:"bg-light rounded mb-2 px-2 py-1 small text-muted",children:[e.jsx(A,{className:"nitro-friends-spritesheet icon-warning flex-shrink-0"}),e.jsx(A,{children:i.message})]}),i.type===Bn.ROOM_INVITE&&e.jsxs(w,{gap:2,alignItems:"center",className:"bg-light rounded mb-2 px-2 py-1 small text-black",children:[e.jsx(A,{className:"messenger-notification-icon flex-shrink-0"}),e.jsxs(A,{children:[d("messenger.invitation")+" ",i.message]})]})]})},l))})},kw=a=>{const{thread:t=null}=a;return t.setRead(),e.jsx(e.Fragment,{children:t.groups.length>0&&t.groups.map((s,n)=>e.jsx(Ow,{thread:t,group:s},n))})},Aw=a=>{const[t,s]=o.useState(!1),[n,r]=o.useState(-1),[i,l]=o.useState(""),{visibleThreads:c=[],activeThread:m=null,getMessageThread:h=null,sendMessage:u=null,setActiveThreadId:g=null,closeThread:f=null}=Nh(),{report:p=null}=Ws(),x=o.useRef(),I=()=>m&&m.participant&&D(new xc(m.participant.id)),j=()=>m&&m.participant&&as(m.participant.id),E=()=>{!m||!i.length||(u(m,B().userId,i),l(""))},C=b=>{b.key==="Enter"&&E()};return o.useEffect(()=>{const b={linkReceived:_=>{const S=_.split("/");if(S.length===2){if(S[1]==="open"){s(!0);return}if(S[1]==="toggle"){s(L=>!L);return}const T=h(parseInt(S[1]));if(!T)return;g(T.threadId),s(!0)}},eventUrlPrefix:"friends-messenger/"};return ht(b),()=>gt(b)},[h,g]),o.useEffect(()=>{!t||!m||(x.current.scrollTop=x.current.scrollHeight)},[t,m]),o.useEffect(()=>{if(t&&!m){n>0?g(n):c.length>0&&g(c[0].threadId);return}!t&&m&&(r(m.threadId),g(-1))},[t,m,n,c,g]),t?e.jsxs(ie,{className:"nitro-friends-messenger",uniqueKey:"nitro-friends-messenger",theme:"primary-slim",children:[e.jsx(re,{headerText:d("messenger.window.title",["OPEN_CHAT_COUNT"],[c.length.toString()]),onCloseClick:b=>s(!1)}),e.jsx(se,{children:e.jsxs(ne,{overflow:"hidden",children:[e.jsxs(v,{size:4,overflow:"hidden",children:[e.jsx(N,{bold:!0,children:d("toolbar.icon.label.messenger")}),e.jsx(v,{fit:!0,overflow:"auto",children:e.jsx(v,{children:c&&c.length>0&&c.map(b=>e.jsxs(Ce,{itemActive:m===b,onClick:_=>g(b.threadId),children:[b.unread&&e.jsx(En,{className:"text-black",count:b.unreadCount}),e.jsxs(w,{fullWidth:!0,alignItems:"center",gap:1,children:[e.jsx(w,{alignItems:"center",className:"friend-head px-2",children:e.jsx(nt,{figure:b.participant.id>0?b.participant.figure:b.participant.id<=0&&b.participant.figure==="ADM"?"ha-3409-1413-70.lg-285-89.ch-3032-1334-109.sh-3016-110.hd-185-1359.ca-3225-110-62.wa-3264-62-62.fa-1206-90.hr-3322-1403":b.participant.figure,headOnly:!0,direction:b.participant.id>0?2:3})}),e.jsx(N,{truncate:!0,grow:!0,children:b.participant.name})]})]},b.threadId))})})]}),e.jsx(v,{size:8,overflow:"hidden",children:m&&e.jsxs(e.Fragment,{children:[e.jsx(N,{bold:!0,center:!0,children:d("messenger.window.separator",["FRIEND_NAME"],[m.participant.name])}),e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:1,children:[m&&m.participant.id>0&&e.jsxs(w,{gap:1,children:[e.jsxs(bn,{children:[e.jsx(P,{onClick:I,children:e.jsx(A,{className:"nitro-friends-spritesheet icon-follow"})}),e.jsx(P,{onClick:j,children:e.jsx(A,{className:"nitro-friends-spritesheet icon-profile-sm"})})]}),e.jsx(P,{variant:"danger",onClick:()=>p(tt.IM,{reportedUserId:m.participant.id}),children:d("messenger.window.button.report")})]}),e.jsx(P,{onClick:b=>f(m.threadId),children:e.jsx(Hs,{className:"fa-icon"})})]}),e.jsx(v,{fit:!0,className:"bg-muted p-2 rounded chat-messages",children:e.jsx(v,{innerRef:x,overflow:"auto",children:e.jsx(kw,{thread:m})})}),e.jsxs(w,{gap:1,children:[e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:255,placeholder:d("messenger.window.input.default",["FRIEND_NAME"],[m.participant.name]),value:i,onChange:b=>l(b.target.value),onKeyDown:C}),e.jsx(P,{variant:"success",onClick:E,children:d("widgets.chatinput.say")})]})]})})]})})]}):null},Dw=a=>{const{settings:t=null,onlineFriends:s=[]}=hs();return t?e.jsxs(e.Fragment,{children:[Bo.createPortal(e.jsx(Nw,{onlineFriends:s}),document.getElementById("toolbar-friend-bar-container")),e.jsx(Rw,{}),e.jsx(Aw,{})]}):null},Pw=()=>{const{games:a,selectedGame:t,setSelectedGame:s}=tl(),n=i=>{let l=["game-icon"];return t===i&&l.push("selected"),l.join(" ")},r=i=>`url(${i.assetUrl}${i.gameNameId}_icon.png)`;return e.jsxs(A,{fullWidth:!0,className:"gameList-container bg-dark p-1",children:[d("gamecenter.game_list_title"),e.jsx(w,{gap:3,children:a&&a.map((i,l)=>e.jsx(A,{className:n(i),onClick:c=>s(i),style:{backgroundImage:r(i)}},l))})]})},Lw=()=>{const{gameURL:a,setGameURL:t}=tl(),[s,n]=o.useState(0),r=o.useRef();return o.useEffect(()=>{if(!r||r&&!r.current)return;n(0);let i=document.createElement("iframe");i.src=a,i.classList.add("game-center-stage"),i.classList.add("h-100"),i.onload=()=>{n(l=>l+=1)},r.current.innerHTML="",r.current.appendChild(i)},[r,a]),o.useEffect(()=>{s>1&&(t(null),D(new aI))},[s,t]),a?e.jsx(A,{innerRef:r,className:"game-center-stage"}):null},Mw=()=>{const{selectedGame:a,accountStatus:t}=tl();o.useEffect(()=>{a&&(D(new oI(a.gameId)),D(new lI(a.gameId)))},[a]);const s=()=>ms.uintHexColor(a.bgColor),n=()=>`url(${a.assetUrl}${a.gameNameId}_theme.png)`,r=()=>ms.uintHexColor(a.textColor),i=()=>{D(new cI(a.gameId))};return e.jsxs(w,{className:"game-view py-4",fullHeight:!0,style:{backgroundColor:s(),backgroundImage:n(),color:r()},children:[e.jsxs(w,{className:"w-75",column:!0,alignItems:"center",gap:2,children:[e.jsx(N,{bold:!0,children:d(`gamecenter.${a.gameNameId}.description_title`)}),e.jsx("img",{src:a.assetUrl+a.gameNameId+"_logo.png"}),(t.hasUnlimitedGames||t.freeGamesLeft>0)&&e.jsx(e.Fragment,{children:e.jsxs(P,{variant:"light",position:"relative",className:"px-4",onClick:i,children:[d("gamecenter.play_now"),!t.hasUnlimitedGames&&e.jsx(En,{className:"me-n1 mt-n1 text-black",count:t.freeGamesLeft})]})}),e.jsx(N,{bold:!0,className:"w-50",center:!0,children:d(`gamecenter.${a.gameNameId}.description_content`)})]}),e.jsx(A,{className:"w-25"})]})},Uw=()=>{const{isVisible:a,setIsVisible:t,games:s,accountStatus:n}=tl();if(o.useEffect(()=>{const r=()=>{t(l=>!l)},i={linkReceived:l=>{switch(l.split("/")[1]){case"toggle":r();break}},eventUrlPrefix:"games/"};return ht(i),()=>gt(i)},[]),!(!a||!s||!n))return e.jsxs(w,{position:"absolute",className:"top-0 bottom-0 start-0 end-0 bg-black",justifyContent:"center",children:[e.jsxs(w,{className:"game-center-main",column:!0,children:[e.jsx(Mw,{}),e.jsx(Pw,{})]}),e.jsx(Lw,{})]})},Fw=[0,1,2,3,4,5,6,7,8],Vw=a=>{const{badgeParts:t=[],setBadgeParts:s=null}=a,[n,r]=o.useState(-1),{groupCustomize:i=null}=ha(),l=(c,m,h)=>{const u=[...t];u[c][m]=h,s(u),m==="key"&&r(-1)};return!t||!t.length?null:e.jsxs(e.Fragment,{children:[n<0&&t&&t.length>0&&t.map((c,m)=>e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:2,className:"bg-muted rounded px-2 py-1",children:[e.jsxs(w,{pointer:!0,center:!0,className:"bg-muted rounded p-1",onClick:h=>r(m),children:[t[m].code&&t[m].code.length>0&&e.jsx(mt,{badgeCode:t[m].code,isGroup:!0}),(!t[m].code||!t[m].code.length)&&e.jsx(w,{center:!0,className:"badge-image group-badge",children:e.jsx(Wo,{className:"fa-icon"})})]}),c.type!==ts.BASE&&e.jsx(ne,{gap:1,columnCount:3,children:Fw.map((h,u)=>e.jsx(A,{pointer:!0,className:`group-badge-position-swatch ${t[m].position===h?"active":""}`,onClick:g=>l(m,"position",h)},u))}),e.jsx(ne,{gap:1,columnCount:8,children:i.badgePartColors.length>0&&i.badgePartColors.map((h,u)=>e.jsx(A,{pointer:!0,className:`group-badge-color-swatch ${t[m].color===u+1?"active":""}`,style:{backgroundColor:"#"+h.color},onClick:g=>l(m,"color",u+1)},u))})]},m)),n>=0&&e.jsxs(ne,{gap:1,columnCount:5,children:[t[n].type===ts.SYMBOL&&e.jsx(v,{pointer:!0,center:!0,className:"bg-muted rounded p-1",onClick:c=>l(n,"key",0),children:e.jsx(w,{center:!0,className:"badge-image group-badge",children:e.jsx(Hs,{className:"fa-icon"})})}),(t[n].type===ts.BASE?i.badgeBases:i.badgeSymbols).map((c,m)=>e.jsx(v,{pointer:!0,center:!0,className:"bg-muted rounded p-1",onClick:h=>l(n,"key",c.id),children:e.jsx(mt,{badgeCode:ts.getCode(t[n].type,c.id,t[n].color,4),isGroup:!0})},m))]})]})},Hh=a=>{const{groupData:t=null,setGroupData:s=null,setCloseAction:n=null,skipDefault:r=null}=a,[i,l]=o.useState(null),{groupCustomize:c=null}=ha(),m=()=>{if(!i||!i.length)return"";let u="";return i.forEach(g=>g.code&&(u+=g.code)),u},h=o.useCallback(()=>{if(!t||!i||!i.length)return!1;if(t.groupBadgeParts===i)return!0;if(t.groupId<=0)return s(g=>{const f={...g};return f.groupBadgeParts=i,f}),!0;const u=[];return i.forEach(g=>{g.code&&(u.push(g.key),u.push(g.color),u.push(g.position))}),D(new uI(t.groupId,u)),!0},[t,i,s]);return o.useEffect(()=>{if(t.groupBadgeParts)return;const u=[new ts(ts.BASE,c.badgeBases[0].id,c.badgePartColors[0].id),new ts(ts.SYMBOL,0,c.badgePartColors[0].id),new ts(ts.SYMBOL,0,c.badgePartColors[0].id),new ts(ts.SYMBOL,0,c.badgePartColors[0].id),new ts(ts.SYMBOL,0,c.badgePartColors[0].id)];s(g=>({...g,groupBadgeParts:u}))},[t.groupBadgeParts,c,s]),o.useEffect(()=>{if(t.groupId<=0){l(t.groupBadgeParts?[...t.groupBadgeParts]:null);return}l(t.groupBadgeParts)},[t]),o.useEffect(()=>(n({action:h}),()=>n(null)),[n,h]),e.jsxs(ne,{overflow:"hidden",gap:1,children:[e.jsx(v,{size:2,children:e.jsx(w,{center:!0,className:"bg-muted rounded p-1",children:e.jsx(mt,{badgeCode:m(),isGroup:!0})})}),e.jsx(v,{size:10,overflow:"auto",children:e.jsx(Vw,{badgeParts:i,setBadgeParts:l})})]})},Wh=a=>{const{groupData:t=null,setGroupData:s=null,setCloseAction:n=null}=a,[r,i]=o.useState(null),{groupCustomize:l=null}=ha(),c=u=>u===0?l.groupColorsA.find(g=>g.id===r[u]).color:l.groupColorsB.find(g=>g.id===r[u]).color,m=(u,g)=>{i(f=>{const p=[...f];return p[u]=g,p})},h=o.useCallback(()=>!t||!r||!r.length?!1:t.groupColors===r?!0:t.groupId<=0?(s(u=>{const g={...u};return g.groupColors=[...r],g}),!0):(D(new dI(t.groupId,r[0],r[1])),!0),[t,r,s]);return o.useEffect(()=>{if(!l.groupColorsA||!l.groupColorsB||t.groupColors)return;const u=[l.groupColorsA[0].id,l.groupColorsB[0].id];s(g=>({...g,groupColors:u}))},[l,t.groupColors,s]),o.useEffect(()=>{if(t.groupId<=0){i(t.groupColors?[...t.groupColors]:null);return}i(t.groupColors)},[t]),o.useEffect(()=>(n({action:h}),()=>n(null)),[n,h]),r?e.jsxs(ne,{overflow:"hidden",children:[e.jsxs(v,{size:2,gap:1,children:[e.jsx(N,{bold:!0,children:d("group.edit.color.guild.color")}),t.groupColors&&t.groupColors.length>0&&e.jsxs(w,{overflow:"hidden",className:"rounded border",children:[e.jsx(A,{className:"group-color-swatch",style:{backgroundColor:"#"+c(0)}}),e.jsx(A,{className:"group-color-swatch",style:{backgroundColor:"#"+c(1)}})]})]}),e.jsxs(v,{size:5,gap:1,overflow:"hidden",children:[e.jsx(N,{bold:!0,children:d("group.edit.color.primary.color")}),e.jsx(Pe,{gap:1,columnCount:7,columnMinWidth:16,columnMinHeight:16,children:t.groupColors&&l.groupColorsA&&l.groupColorsA.map((u,g)=>e.jsx("div",{className:zt("group-badge-color-swatch cursor-pointer",t.groupColors[0]===u.id&&"active"),style:{backgroundColor:"#"+u.color},onClick:()=>m(0,u.id)},g))})]}),e.jsxs(v,{size:5,gap:1,overflow:"hidden",children:[e.jsx(N,{bold:!0,children:d("group.edit.color.secondary.color")}),e.jsx(Pe,{gap:1,columnCount:7,columnMinWidth:16,columnMinHeight:16,children:t.groupColors&&l.groupColorsB&&l.groupColorsB.map((u,g)=>e.jsx("div",{className:zt("group-badge-color-swatch cursor-pointer",t.groupColors[1]===u.id&&"active"),style:{backgroundColor:"#"+u.color},onClick:()=>m(1,u.id)},g))})]})]}):null},Gw=a=>{const{groupData:t=null,setGroupData:s=null,purchaseCost:n=0}=a,{groupCustomize:r=null}=ha(),i=()=>{if(!t||!t.groupBadgeParts||!t.groupBadgeParts.length)return"";let c="";return t.groupBadgeParts.forEach(m=>m.code&&(c+=m.code)),c},l=c=>c===0?r.groupColorsA.find(m=>m.id===t.groupColors[c]).color:r.groupColorsB.find(m=>m.id===t.groupColors[c]).color;return t?e.jsxs(ne,{overflow:"hidden",gap:1,children:[e.jsxs(v,{size:3,children:[e.jsxs(v,{center:!0,className:"bg-muted rounded p-1",gap:2,children:[e.jsx(N,{bold:!0,center:!0,children:d("group.create.confirm.guildbadge")}),e.jsx(mt,{badgeCode:i(),isGroup:!0})]}),e.jsxs(v,{center:!0,className:"bg-muted rounded p-1",gap:2,children:[e.jsx(N,{bold:!0,center:!0,children:d("group.edit.color.guild.color")}),e.jsxs(w,{overflow:"hidden",className:"rounded border",children:[e.jsx(A,{className:"group-color-swatch",style:{backgroundColor:"#"+l(0)}}),e.jsx(A,{className:"group-color-swatch",style:{backgroundColor:"#"+l(1)}})]})]})]}),e.jsxs(v,{size:9,justifyContent:"between",children:[e.jsxs(v,{children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:t.groupName}),e.jsx(N,{children:t.groupDescription})]}),e.jsx(N,{overflow:"auto",children:d("group.create.confirm.info")})]}),e.jsx(N,{center:!0,variant:"white",className:"bg-primary rounded p-1",children:d("group.create.confirm.buyinfo",["amount"],[n.toString()])})]})]}):null},qh=a=>{const{groupData:t=null,setGroupData:s=null,setCloseAction:n=null,onClose:r=null,isCreator:i=!1,availableRooms:l=[]}=a,[c,m]=o.useState(""),[h,u]=o.useState(""),[g,f]=o.useState(-1),{showConfirm:p=null}=Fe(),x=()=>{!t||t.groupId<=0||p(d("group.deleteconfirm.desc"),()=>{D(new hI(t.groupId)),r&&r()},null,null,null,d("group.deleteconfirm.title"))},I=o.useCallback(()=>!t||!c||!c.length?!1:c===t.groupName&&h===t.groupDescription?!0:t.groupId<=0?g<=0?!1:(s(j=>{const E={...j};return E.groupName=c,E.groupDescription=h,E.groupHomeroomId=g,E}),!0):(D(new mI(t.groupId,c,h||"")),!0),[t,c,h,g,s]);return o.useEffect(()=>{m(t.groupName||""),u(t.groupDescription||""),f(t.groupHomeroomId)},[t]),o.useEffect(()=>(n({action:I}),()=>n(null)),[n,I]),t?e.jsxs(v,{justifyContent:"between",overflow:"auto",children:[e.jsxs(v,{gap:1,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(N,{center:!0,className:"col-3",children:d("group.edit.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:c,maxLength:29,onChange:j=>m(j.target.value)})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(N,{center:!0,className:"col-3",children:d("group.edit.desc")}),e.jsx("textarea",{className:"form-control form-control-sm",value:h,maxLength:254,onChange:j=>u(j.target.value)})]}),i&&e.jsxs(e.Fragment,{children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(N,{center:!0,className:"col-3",children:d("group.edit.base")}),e.jsx(v,{fullWidth:!0,gap:1,children:e.jsxs("select",{className:"form-select form-select-sm",value:g,onChange:j=>f(parseInt(j.target.value)),children:[e.jsx("option",{value:-1,disabled:!0,children:d("group.edit.base.select.room")}),l&&l.map((j,E)=>e.jsx("option",{value:j.id,children:j.name},E))]})})]}),e.jsxs(w,{gap:1,children:[e.jsx(A,{className:"col-3",children:" "}),e.jsx(N,{small:!0,children:d("group.edit.base.warning")})]})]})]}),!i&&e.jsx(P,{variant:"danger",onClick:x,children:d("group.delete")}),i&&e.jsx(N,{underline:!0,center:!0,fullWidth:!0,pointer:!0,onClick:j=>Z("navigator/create"),children:d("group.createroom")})]}):null},Bw=[1,2,3,4],Hw=a=>{const{onClose:t=null}=a,[s,n]=o.useState(1),[r,i]=o.useState(null),[l,c]=o.useState(null),[m,h]=o.useState(null),[u,g]=o.useState(0),f=()=>{i(null),c(null),t&&t()},p=()=>{if(!l)return;const j=[];l.groupBadgeParts.forEach(E=>{E.code&&(j.push(E.key),j.push(E.color),j.push(E.position))}),D(new pI(l.groupName,l.groupDescription,l.groupHomeroomId,l.groupColors[0],l.groupColors[1],j))},x=()=>{if(!(r&&r.action&&!r.action())){if(s===1){t();return}n(j=>j-1)}},I=()=>{if(!(r&&r.action&&!r.action())){if(s===4){p();return}n(j=>j===4?j:j+1)}};return M(gI,j=>{const E=j.getParser(),C=[];E.availableRooms.forEach((b,_)=>C.push({id:_,name:b})),h(C),g(E.groupCost)}),o.useEffect(()=>{n(1),c({groupId:-1,groupName:null,groupDescription:null,groupHomeroomId:-1,groupState:1,groupCanMembersDecorate:!0,groupColors:null,groupBadgeParts:null}),D(new fI)},[c]),l?e.jsxs(ie,{className:"nitro-group-creator",theme:"primary-slim",children:[e.jsx(re,{headerText:d("group.create.title"),onCloseClick:f}),e.jsxs(se,{children:[e.jsx(w,{center:!0,className:"creator-tabs",children:Bw.map((j,E)=>e.jsx(w,{center:!0,className:`tab tab-${j===1?"blue-flat":j===4?"yellow":"blue-arrow"} ${s===j?"active":""}`,children:e.jsx(N,{variant:"white",children:d(`group.create.steplabel.${j}`)})},E))}),e.jsxs(v,{overflow:"hidden",children:[e.jsxs(w,{alignItems:"center",gap:2,children:[e.jsx(A,{className:`nitro-group-tab-image tab-${s}`}),e.jsxs(v,{grow:!0,gap:0,children:[e.jsx(N,{bold:!0,fontSize:4,children:d(`group.create.stepcaption.${s}`)}),e.jsx(N,{children:d(`group.create.stepdesc.${s}`)})]})]}),e.jsxs(v,{overflow:"hidden",children:[s===1&&e.jsx(qh,{groupData:l,setGroupData:c,setCloseAction:i,onClose:null,isCreator:!0,availableRooms:m}),s===2&&e.jsx(Hh,{groupData:l,setGroupData:c,setCloseAction:i}),s===3&&e.jsx(Wh,{groupData:l,setGroupData:c,setCloseAction:i}),s===4&&e.jsx(Gw,{groupData:l,setGroupData:c,purchaseCost:u})]}),e.jsxs(w,{justifyContent:"between",children:[e.jsx(P,{variant:"link",className:"text-black",onClick:x,children:d(s===1?"generic.cancel":"group.create.previousstep")}),e.jsx(P,{disabled:s===4&&!Nr(),variant:s===4?Nr()?"success":"danger":"primary",onClick:I,children:d(s===4?Nr()?"group.create.confirm.buy":"group.create.confirm.viprequired":"group.create.nextstep")})]})]})]})]}):null},Ww=["regular","exclusive","private"],zh=a=>{const{groupInformation:t=null,onClose:s=null,overflow:n="hidden",...r}=a,{showConfirm:i=null}=Fe(),l=t&&t.ownerName===B().userName,c=()=>t&&kc(t.id),m=()=>{i(d("group.leaveconfirm.desc"),()=>{D(new Ec(t.id,B().userId)),s&&s()},null)},h=()=>t.membershipType===Dt.NOT_MEMBER||t.membershipType===Dt.REQUEST_PENDING?null:l?e.jsx("i",{className:"icon icon-group-owner",title:d("group.youareowner")}):t.isAdmin?e.jsx("i",{className:"icon icon-group-admin",title:d("group.youareadmin")}):e.jsx("i",{className:"icon icon-group-member",title:d("group.youaremember")}),u=()=>{if(l)return"group.youareowner";if(t.type===Ts.PRIVATE&&t.membershipType!==Dt.MEMBER)return"";if(t.membershipType===Dt.MEMBER)return"group.leave";if(t.membershipType===Dt.NOT_MEMBER&&t.type===Ts.REGULAR)return"group.join";if(t.membershipType===Dt.REQUEST_PENDING)return"group.membershippending";if(t.membershipType===Dt.NOT_MEMBER&&t.type===Ts.EXCLUSIVE)return"group.requestmembership"},g=()=>{if(!(t.type===Ts.PRIVATE&&t.membershipType===Dt.NOT_MEMBER)){if(t.membershipType===Dt.MEMBER){m();return}c()}},f=p=>{switch(p){case"members":Mu(t.id);break;case"members_pending":Mu(t.id,2);break;case"manage":dh(t.id);break;case"homeroom":is(t.roomId);break;case"furniture":Z("catalog/open/"+oo.GUILD_CUSTOM_FURNI);break;case"popular_groups":Z("navigator/search/groups");break}};return t?e.jsxs(ne,{overflow:n,...r,children:[e.jsxs(v,{center:!0,size:3,overflow:"hidden",children:[e.jsx(w,{alignItems:"center",overflow:"hidden",className:"group-badge",children:e.jsx(mt,{badgeCode:t.badge,isGroup:!0,scale:2})}),e.jsxs(v,{alignItems:"center",gap:1,children:[e.jsx(N,{small:!0,underline:!0,pointer:!0,onClick:()=>f("members"),children:d("group.membercount",["totalMembers"],[t.membersCount.toString()])}),t.pendingRequestsCount>0&&e.jsx(N,{small:!0,underline:!0,pointer:!0,onClick:()=>f("members_pending"),children:d("group.pendingmembercount",["amount"],[t.pendingRequestsCount.toString()])}),t.isOwner&&e.jsx(N,{small:!0,underline:!0,pointer:!0,onClick:()=>f("manage"),children:d("group.manage")})]}),h()]}),e.jsxs(v,{size:9,justifyContent:"between",overflow:"auto",children:[e.jsxs(v,{overflow:"hidden",children:[e.jsxs(v,{gap:1,children:[e.jsxs(w,{alignItems:"center",gap:2,children:[e.jsx(N,{bold:!0,children:t.title}),e.jsxs(w,{gap:1,children:[e.jsx("i",{className:"icon icon-group-type-"+t.type,title:d(`group.edit.settings.type.${Ww[t.type]}.help`)}),t.canMembersDecorate&&e.jsx("i",{className:"icon icon-group-decorate",title:d("group.memberscandecorate")})]})]}),e.jsx(N,{small:!0,children:d("group.created",["date","owner"],[t.createdAt,t.ownerName])})]}),e.jsx(N,{small:!0,overflow:"auto",className:"group-description",children:t.description})]}),e.jsxs(v,{children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{small:!0,underline:!0,pointer:!0,onClick:()=>f("homeroom"),children:d("group.linktobase")}),e.jsx(N,{small:!0,underline:!0,pointer:!0,onClick:()=>f("furniture"),children:d("group.buyfurni")}),e.jsx(N,{small:!0,underline:!0,pointer:!0,onClick:()=>f("popular_groups"),children:d("group.showgroups")})]}),(t.type!==Ts.PRIVATE||t.type===Ts.PRIVATE&&t.membershipType===Dt.MEMBER)&&e.jsx(P,{disabled:t.membershipType===Dt.REQUEST_PENDING||l,onClick:g,children:d(u())})]})]})]}):null},qw=a=>{const[t,s]=o.useState(null);return M(oa,n=>{const r=n.getParser();(t&&t.id===r.id||r.flag)&&s(r)}),t?e.jsxs(ie,{className:"nitro-group-information-standalone",theme:"primary-slim",children:[e.jsx(re,{headerText:d("group.window.title"),onCloseClick:n=>s(null)}),e.jsx(se,{children:e.jsx(zh,{groupInformation:t,onClose:()=>s(null)})})]}):null},zw=["regular","exclusive","private"],Yw=a=>{const{groupData:t=null,setGroupData:s=null,setCloseAction:n=null}=a,[r,i]=o.useState(t.groupState),[l,c]=o.useState(t.groupCanMembersDecorate),m=o.useCallback(()=>t?r===t.groupState&&l===t.groupCanMembersDecorate?!0:t.groupId<=0?(s(h=>{const u={...h};return u.groupState=r,u.groupCanMembersDecorate=l,u}),!0):(D(new xI(t.groupId,r,l?0:1)),!0):!1,[t,r,l,s]);return o.useEffect(()=>{i(t.groupState),c(t.groupCanMembersDecorate)},[t]),o.useEffect(()=>(n({action:m}),()=>n(null)),[n,m]),e.jsxs(v,{overflow:"auto",children:[e.jsx(v,{children:zw.map((h,u)=>e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"groupState",checked:r===u,onChange:g=>i(u)}),e.jsxs(v,{gap:0,children:[e.jsxs(w,{gap:1,children:[e.jsx("i",{className:`icon icon-group-type-${u}`}),e.jsx(N,{bold:!0,children:d(`group.edit.settings.type.${h}.label`)})]}),e.jsx(N,{children:d(`group.edit.settings.type.${h}.help`)})]})]},u))}),e.jsx(VN,{}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input flex-shrink-0",type:"checkbox",checked:l,onChange:h=>c(u=>!u)}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("group.edit.settings.rights.caption")}),e.jsx(N,{children:d("group.edit.settings.rights.members.help")})]})]})]})},$w=[1,2,3,5],Kw=a=>{const[t,s]=o.useState(1),[n,r]=o.useState(null),[i,l]=o.useState(null),c=()=>{r(h=>(h&&h.action&&h.action(),null)),l(null)},m=h=>{n&&n.action&&n.action(),s(h)};return M(oa,h=>{const u=h.getParser();!i||i.groupId!==u.id||l(g=>{const f={...g};return f.groupName=u.title,f.groupDescription=u.description,f.groupState=u.type,f.groupCanMembersDecorate=u.canMembersDecorate,f})}),M(jI,h=>{const u=h.getParser(),g=[];u.badgeParts.forEach((f,p)=>{g.push(new fl(f.isBase?fl.BASE:fl.SYMBOL,f.key,f.color,f.position))}),l({groupId:u.id,groupName:u.title,groupDescription:u.description,groupHomeroomId:u.roomId,groupState:u.state,groupCanMembersDecorate:u.canMembersDecorate,groupColors:[u.colorA,u.colorB],groupBadgeParts:g})}),!i||i.groupId<=0?null:e.jsxs(ie,{className:"nitro-group-manager",children:[e.jsx(re,{headerText:d("group.window.title"),onCloseClick:c}),e.jsx(Tn,{children:$w.map(h=>e.jsx(tn,{isActive:t===h,onClick:()=>m(h),children:d(`group.edit.tab.${h}`)},h))}),e.jsxs(se,{children:[e.jsxs(w,{alignItems:"center",gap:2,children:[e.jsx(A,{className:`nitro-group-tab-image tab-${t}`}),e.jsxs(v,{grow:!0,gap:0,children:[e.jsx(N,{bold:!0,fontSize:4,children:d(`group.edit.tabcaption.${t}`)}),e.jsx(N,{children:d(`group.edit.tabdesc.${t}`)})]})]}),e.jsxs(v,{grow:!0,overflow:"hidden",children:[t===1&&e.jsx(qh,{groupData:i,setGroupData:l,setCloseAction:r,onClose:c}),t===2&&e.jsx(Hh,{groupData:i,setGroupData:l,setCloseAction:r,skipDefault:!0}),t===3&&e.jsx(Wh,{groupData:i,setGroupData:l,setCloseAction:r}),t===5&&e.jsx(Yw,{groupData:i,setGroupData:l,setCloseAction:r})]})]})]})},Xw=a=>{const[t,s]=o.useState(-1),[n,r]=o.useState(-1),[i,l]=o.useState(null),[c,m]=o.useState(-1),[h,u]=o.useState(0),[g,f]=o.useState(""),[p,x]=o.useState(null),{showConfirm:I=null}=Fe(),j=S=>{if(S.rank===cs.OWNER)return"group.members.owner";if(i.admin){if(S.rank===cs.ADMIN)return"group.members.removerights";if(S.rank===cs.MEMBER)return"group.members.giverights"}return""},E=o.useCallback(()=>{t===-1||n===-1||c===-1||D(new gu(t,c,g,n))},[t,n,c,g]),C=S=>{!i.admin||S.rank===cs.OWNER||(S.rank!==cs.ADMIN?D(new EI(i.groupId,S.id)):D(new CI(i.groupId,S.id)),E())},b=S=>{!i.admin||S.rank!==cs.REQUESTED||(D(new NI(i.groupId,S.id)),E())},_=S=>{if(i.admin){if(S.rank===cs.REQUESTED){D(new vI(i.groupId,S.id)),E();return}x(S.name),D(new _I(i.groupId,S.id))}};return M(II,S=>{const T=S.getParser();l(T),r(T.level),u(Math.ceil(T.totalMembersCount/T.pageSize))}),M(bI,S=>{const T=S.getParser();I(d(T.furnitureCount>0?"group.kickconfirm.desc":"group.kickconfirm_nofurni.desc",["user","amount"],[p,T.furnitureCount.toString()]),()=>{D(new Ec(i.groupId,T.userId)),E()},null),x(null)}),o.useEffect(()=>{const S={linkReceived:T=>{const L=T.split("/");if(L.length<2)return;const k=parseInt(L[1])||-1,R=parseInt(L[2])||3;s(k),r(R),m(0)},eventUrlPrefix:"group-members/"};return ht(S),()=>gt(S)},[]),o.useEffect(()=>{m(0)},[t,n,g]),o.useEffect(()=>{t===-1||n===-1||c===-1||D(new gu(t,c,g,n))},[t,n,c,g]),o.useEffect(()=>{t!==-1&&(r(-1),l(null),u(0),f(""),x(null))},[t]),t===-1||!i?null:e.jsxs(ie,{className:"nitro-group-members",theme:"primary-slim",children:[e.jsx(re,{headerText:d("group.members.title",["groupName"],[i?i.groupTitle:""]),onCloseClick:S=>s(-1)}),e.jsxs(se,{overflow:"hidden",children:[e.jsxs(w,{gap:2,children:[e.jsx(w,{center:!0,className:"group-badge",children:e.jsx(mt,{badgeCode:i.badge,isGroup:!0,className:"mx-auto d-block"})}),e.jsxs(v,{fullWidth:!0,gap:1,children:[e.jsx("input",{type:"text",className:"form-control form-control-sm w-100",placeholder:d("group.members.searchinfo"),value:g,onChange:S=>f(S.target.value)}),e.jsxs("select",{className:"form-select form-select-sm w-100",value:n,onChange:S=>r(parseInt(S.target.value)),children:[e.jsx("option",{value:"0",children:d("group.members.search.all")}),e.jsx("option",{value:"1",children:d("group.members.search.admins")}),e.jsx("option",{value:"2",children:d("group.members.search.pending")})]})]})]}),e.jsx(ne,{columnCount:2,overflow:"auto",className:"nitro-group-members-list-grid",children:i.result.map((S,T)=>e.jsxs(w,{gap:2,alignItems:"center",overflow:"hidden",className:"member-list-item bg-white rounded p-2",children:[e.jsx("div",{className:"avatar-head cursor-pointer",onClick:()=>as(S.id),children:e.jsx(nt,{figure:S.figure,headOnly:!0,direction:2})}),e.jsxs(v,{grow:!0,gap:1,children:[e.jsx(N,{bold:!0,small:!0,pointer:!0,onClick:L=>as(S.id),children:S.name}),S.rank!==cs.REQUESTED&&e.jsx(N,{small:!0,italics:!0,variant:"muted",children:d("group.members.since",["date"],[S.joinedAt])})]}),e.jsxs(v,{gap:1,children:[S.rank!==cs.REQUESTED&&e.jsx(w,{center:!0,children:e.jsx(A,{pointer:i.admin,className:`icon icon-group-small-${S.rank===cs.OWNER?"owner":S.rank===cs.ADMIN?"admin":i.admin&&S.rank===cs.MEMBER?"not-admin":""}`,title:d(j(S)),onClick:L=>C(S)})}),i.admin&&S.rank===cs.REQUESTED&&e.jsx(w,{alignItems:"center",children:e.jsx(A,{pointer:!0,className:"nitro-friends-spritesheet icon-accept",title:d("group.members.accept"),onClick:L=>b(S)})}),i.admin&&S.rank!==cs.OWNER&&S.id!==B().userId&&e.jsx(w,{alignItems:"center",children:e.jsx(A,{pointer:!0,className:"nitro-friends-spritesheet icon-deny",title:d(S.rank===cs.REQUESTED?"group.members.reject":"group.members.kick"),onClick:L=>_(S)})})]})]},T))}),e.jsxs(w,{gap:1,justifyContent:"between",alignItems:"center",children:[e.jsx(P,{disabled:i.pageIndex===0,onClick:S=>m(T=>T-1),children:e.jsx(Ss,{className:"fa-icon"})}),e.jsx(N,{small:!0,children:d("group.members.pageinfo",["amount","page","totalPages"],[i.totalMembersCount.toString(),(i.pageIndex+1).toString(),h.toString()])}),e.jsx(P,{disabled:i.pageIndex===h-1,onClick:S=>m(T=>T+1),children:e.jsx(ws,{className:"fa-icon"})})]})]})]})},Qw=a=>{const[t,s]=o.useState(!1);return ha(),M(wI,n=>{const r=n.getParser();s(!1),is(r.roomId)}),o.useEffect(()=>{const n={linkReceived:r=>{const i=r.split("/");if(!(i.length<2))switch(i[1]){case"create":s(!0);return;case"manage":if(!i[2])return;s(!1),D(new SI(Number(i[2])));return}},eventUrlPrefix:"groups/"};return ht(n),()=>gt(n)},[]),e.jsxs(e.Fragment,{children:[t&&e.jsx(Hw,{onClose:()=>s(!1)}),!t&&e.jsx(Kw,{}),e.jsx(Xw,{}),e.jsx(qw,{})]})},Jw=a=>{const{helpRequestDescription:t=null,helpRequestAverageTime:s=0}=a,n=r=>D(new TI(r));return e.jsxs(v,{children:[e.jsxs(v,{gap:0,className:"bg-muted p-2 rounded",children:[e.jsx(N,{bold:!0,children:d("guide.help.request.guide.accept.request.title")}),e.jsx(N,{variant:"muted",children:d("guide.help.request.type.1")}),e.jsx(N,{wrap:!0,textBreak:!0,children:t})]}),e.jsxs(v,{gap:1,children:[e.jsx(P,{variant:"success",onClick:r=>n(!0),children:d("guide.help.request.guide.accept.accept.button")}),e.jsx(P,{variant:"danger",onClick:r=>n(!1),children:d("guide.help.request.guide.accept.skip.link")})]})]})},Zw=a=>{const{isOnDuty:t=!1,isHandlingGuideRequests:s=!1,setIsHandlingGuideRequests:n=null,isHandlingHelpRequests:r=!1,setIsHandlingHelpRequests:i=null,isHandlingBullyReports:l=!1,setIsHandlingBullyReports:c=null,guidesOnDuty:m=0,helpersOnDuty:h=0,guardiansOnDuty:u=0,processAction:g=null}=a;return e.jsxs(v,{children:[e.jsxs(w,{alignItems:"center",gap:2,className:"bg-muted p-2 rounded",children:[e.jsx(A,{className:"duty-switch"+(t?"":" off"),onClick:f=>g("toggle_duty")}),e.jsxs(v,{gap:0,children:[e.jsx(N,{bold:!0,children:d("guide.help.guide.tool.yourstatus")}),e.jsx(N,{children:d(`guide.help.guide.tool.duty.${t?"on":"off"}`)})]})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("guide.help.guide.tool.tickettypeselection.caption")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",disabled:t,type:"checkbox",checked:s,onChange:f=>n(f.target.checked)}),e.jsx(N,{children:d("guide.help.guide.tool.tickettypeselection.guiderequests")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",disabled:t,type:"checkbox",checked:r,onChange:f=>i(f.target.checked)}),e.jsx(N,{children:d("guide.help.guide.tool.tickettypeselection.onlyhelprequests")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",disabled:t,type:"checkbox",checked:l,onChange:f=>c(f.target.checked)}),e.jsx(N,{children:d("guide.help.guide.tool.tickettypeselection.bullyreports")})]})]}),e.jsx("hr",{className:"bg-dark m-0"}),e.jsxs(w,{center:!0,gap:2,children:[e.jsx(A,{className:"info-icon"}),e.jsxs(v,{gap:1,children:[e.jsx(A,{dangerouslySetInnerHTML:{__html:d("guide.help.guide.tool.guidesonduty",["amount"],[m.toString()])}}),e.jsx(A,{dangerouslySetInnerHTML:{__html:d("guide.help.guide.tool.helpersonduty",["amount"],[h.toString()])}}),e.jsx(A,{dangerouslySetInnerHTML:{__html:d("guide.help.guide.tool.guardiansonduty",["amount"],[u.toString()])}})]})]}),e.jsx("hr",{className:"bg-dark m-0"}),e.jsxs(w,{justifyContent:"between",gap:2,children:[e.jsx(P,{disabled:!0,onClick:f=>g("forum_link"),children:d("guide.help.guide.tool.forum.link")}),e.jsx(P,{disabled:!0,children:d("guide.help.guide.tool.skill.link")})]})]})},eT=a=>{const t=o.useRef(null),{isGuide:s=!1,userId:n=0,userName:r=null,userFigure:i=null,isTyping:l=!1,messageGroups:c=[]}=a,[m,h]=o.useState("");o.useEffect(()=>{var j;(j=t.current)==null||j.scrollIntoView({block:"end",behavior:"smooth"})},[c]);const u=o.useCallback(()=>{D(new yI)},[]),g=o.useCallback(()=>{D(new RI)},[]),f=o.useCallback(()=>{D(new OI)},[]);M(kI,j=>{const E=j.getParser();is(E.requesterRoomId)});const p=o.useCallback(()=>{!m||!m.length||(D(new AI(m)),h(""))},[m]),x=o.useCallback(j=>{j.key==="Enter"&&p()},[p]),I=o.useCallback(j=>j===B().userId,[]);return e.jsxs(v,{fullHeight:!0,children:[e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:1,className:"bg-muted p-2 rounded",children:[s&&e.jsxs(bn,{children:[e.jsx(P,{onClick:u,children:d("guide.help.request.guide.ongoing.visit.button")}),e.jsx(P,{onClick:g,children:d("guide.help.request.guide.ongoing.invite.button")})]}),!s&&e.jsxs(v,{gap:0,children:[e.jsx(N,{bold:!0,children:r}),e.jsx(N,{children:d("guide.help.request.user.ongoing.guide.desc")})]}),e.jsx(P,{variant:"danger",disabled:!0,children:d("guide.help.common.report.link")})]}),e.jsx(v,{overflow:"hidden",gap:1,className:"bg-muted rounded chat-messages p-2",children:e.jsxs(v,{overflow:"auto",children:[c.map((j,E)=>e.jsxs(w,{fullWidth:!0,justifyContent:I(j.userId)?"end":"start",gap:2,children:[e.jsx(A,{shrink:!0,className:"message-avatar",children:!I(j.userId)&&e.jsx(nt,{figure:i,direction:2})}),e.jsxs(A,{className:"bg-light text-black border-radius mb-2 rounded py-1 px-2 messages-group-"+(I(j.userId)?"right":"left"),children:[e.jsxs(N,{bold:!0,children:[I(j.userId)&&B().userName,!I(j.userId)&&r]}),j.messages.map((C,b)=>e.jsx(A,{pointer:!!C.roomId,className:C.roomId?"text-break text-underline":"text-break",onClick:()=>C.roomId?is(C.roomId):null,children:C.message},b))]}),I(j.userId)&&e.jsx(A,{className:"message-avatar flex-shrink-0",children:e.jsx(nt,{figure:B().figure,direction:4})})]},E)),e.jsx("div",{ref:t})]})}),e.jsxs(v,{gap:1,children:[e.jsxs(w,{gap:1,children:[e.jsx("input",{type:"text",className:"form-control form-control-sm",placeholder:d("guide.help.request.guide.ongoing.input.empty",["name"],[r]),value:m,onChange:j=>h(j.target.value),onKeyDown:x}),e.jsx(P,{variant:"success",onClick:p,children:d("widgets.chatinput.say")})]}),l&&e.jsx(N,{variant:"muted",children:d("guide.help.common.typing")})]}),e.jsx(P,{fullWidth:!0,variant:"success",onClick:f,children:d("guide.help.request."+(s?"guide":"user")+".ongoing.close.link")})]})},tT=15,sT=a=>{const{userRequest:t="",setUserRequest:s=null}=a,[n,r]=o.useState(!1),i=()=>{r(!0),D(new DI(1,t))};return e.jsxs(v,{children:[e.jsx(N,{children:d("guide.help.request.user.create.help")}),e.jsx("textarea",{className:"request-message",maxLength:140,value:t,onChange:l=>s(l.target.value),placeholder:d("guide.help.request.user.create.input.help")}),e.jsx(P,{fullWidth:!0,variant:"success",disabled:t.length{const{userName:t=null}=a,s=n=>D(new PI(n));return e.jsxs(v,{children:[e.jsxs(w,{justifyContent:"between",gap:1,className:"bg-muted p-2 rounded",children:[e.jsxs(v,{gap:0,children:[e.jsx(N,{bold:!0,children:t}),e.jsx(N,{children:d("guide.help.request.user.feedback.guide.desc")})]}),e.jsx(P,{variant:"danger",disabled:!0,children:d("guide.help.common.report.link")})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("guide.help.request.user.feedback.closed.title")}),e.jsx(N,{children:d("guide.help.request.user.feedback.closed.desc")})]}),t&&t.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"bg-dark m-0 mt-auto"}),e.jsxs(v,{children:[e.jsx(N,{center:!0,bold:!0,children:d("guide.help.request.user.feedback.question")}),e.jsxs(w,{gap:1,children:[e.jsx(P,{fullWidth:!0,variant:"success",onClick:n=>s(!0),children:d("guide.help.request.user.feedback.positive.button")}),e.jsx(P,{fullWidth:!0,variant:"danger",onClick:n=>s(!1),children:d("guide.help.request.user.feedback.negative.button")})]})]})]})]})},rT=a=>e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("guide.help.request.no_tour_guides.title")}),e.jsx(N,{children:d("guide.help.request.no_tour_guides.message")})]}),iT=a=>{const{helpRequestDescription:t=null,helpRequestAverageTime:s=0}=a,n=()=>D(new LI);return e.jsxs(v,{children:[e.jsxs(v,{gap:0,className:"bg-muted rounded p-2",children:[e.jsx(N,{bold:!0,children:d("guide.help.request.guide.accept.request.title")}),e.jsx(N,{variant:"muted",children:d("guide.help.request.type.1")}),e.jsx(N,{wrap:!0,textBreak:!0,children:t})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("guide.help.request.user.pending.info.title")}),e.jsx(N,{children:d("guide.help.request.user.pending.info.message")}),e.jsx(N,{children:d("guide.help.request.user.pending.info.waiting",["waitingtime"],[s.toString()])})]}),e.jsx(P,{variant:"danger",onClick:n,children:d("guide.help.request.user.pending.cancel.button")})]})},aT=a=>e.jsx(v,{gap:1,children:e.jsx(N,{children:d("guide.help.request.user.guide.disconnected.error.desc")})}),oT=a=>e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("guide.help.request.user.thanks.info.title")}),e.jsx(N,{children:d("guide.help.request.user.thanks.info.desc")})]}),lT=a=>{const[t,s]=o.useState(!1),[n,r]=o.useState(d("guide.help.guide.tool.title")),[i,l]=o.useState(!1),[c,m]=o.useState(De.GUIDE_TOOL_MENU),[h,u]=o.useState(!1),[g,f]=o.useState(!1),[p,x]=o.useState(!1),[I,j]=o.useState(!1),[E,C]=o.useState(0),[b,_]=o.useState(0),[S,T]=o.useState(0),[L,k]=o.useState(""),[R,y]=o.useState(null),[O,F]=o.useState(0),[V,Y]=o.useState(0),[q,U]=o.useState(null),[J,je]=o.useState(null),[we,pt]=o.useState(!1),[Xt,Oe]=o.useState([]),{simpleAlert:kt=null}=Fe(),Re=o.useCallback((he,le)=>{switch(he){case De.GUIDE_TOOL_MENU:r(d("guide.help.guide.tool.title")),l(!1);break;case De.GUIDE_ACCEPT:r(d("guide.help.request.guide.accept.title")),l(!0);break;case De.GUIDE_ONGOING:r(d("guide.help.request.guide.ongoing.title",["name"],[le])),l(!0);break;case De.USER_CREATE:r(d("guide.help.request.user.create.title")),l(!1);break;case De.USER_PENDING:r(d("guide.help.request.user.pending.title")),l(!0);break;case De.USER_ONGOING:r(d("guide.help.request.user.ongoing.title",["name"],[le])),l(!0);break;case De.USER_FEEDBACK:r(d("guide.help.request.user.feedback.title")),l(!0);break;case De.USER_THANKS:r(d("guide.help.request.user.thanks.title")),l(!1);break;case De.USER_NO_HELPERS:r(d("guide.help.request.no_tour_guides.heading")),l(!1);break;case De.USER_SOMETHING_WRONG:r(d("guide.help.request.user.guide.disconnected.error.heading")),l(!1);break}m(he),s(!0)},[]),Qt=o.useCallback(he=>{switch(he.type){case xs.SHOW_GUIDE_TOOL:s(!0);return;case xs.HIDE_GUIDE_TOOL:s(!1);return;case xs.TOGGLE_GUIDE_TOOL:s(le=>!le);return;case xs.CREATE_HELP_REQUEST:Re(De.USER_CREATE);return}},[Re]);ot(xs.SHOW_GUIDE_TOOL,Qt),ot(xs.HIDE_GUIDE_TOOL,Qt),ot(xs.TOGGLE_GUIDE_TOOL,Qt),ot(xs.CREATE_HELP_REQUEST,Qt),M(Mm,he=>{!he.getParser().isAllowed(Lm.USE_GUIDE_TOOL)&&h&&(u(!1),D(new fu(!1,!1,!1,!1)))}),M(MI,he=>{const le=he.getParser();u(le.onDuty),_(le.guidesOnDuty),C(le.helpersOnDuty),T(le.guardiansOnDuty)}),M(UI,he=>{const le=he.getParser();y(le.helpRequestDescription),F(le.roleSpecificWaitTime),le.asGuide&&h&&Re(De.GUIDE_ACCEPT),le.asGuide||Re(De.USER_PENDING)}),M(FI,he=>{const le=he.getParser();h?(Y(le.requesterUserId),U(le.requesterName),je(le.requesterFigure),Re(De.GUIDE_ONGOING,le.requesterName)):(Y(le.guideUserId),U(le.guideName),je(le.guideFigure),Re(De.USER_ONGOING,le.guideName))}),M(VI,he=>{const le=he.getParser();pt(le.isTyping)}),M(GI,he=>{const le=he.getParser(),Ae=[...Xt];let Ht=Ae[Ae.length-1];(!Ht||Ht.userId!==le.senderId)&&(Ht=new Fu(le.senderId),Ae.push(Ht)),Ht.addChat(new Uu(le.chatMessage)),Oe(Ae)}),M(BI,he=>{const le=he.getParser();if(le.roomId!==0){const Ae=[...Xt];let Ht=Ae[Ae.length-1];const os=h?B().userId:V;(!Ht||Ht.userId!==os)&&(Ht=new Fu(os),Ae.push(Ht)),Ht.addChat(new Uu(le.roomName,le.roomId)),Oe(Ae)}}),M(HI,he=>{h?(Y(0),U(null),je(null),pt(!1),Oe([]),Re(De.GUIDE_TOOL_MENU)):Re(De.USER_FEEDBACK)}),M(WI,he=>{switch(he.getParser().errorCode){case 0:Re(De.USER_SOMETHING_WRONG);break;case 1:case 2:Re(De.USER_NO_HELPERS);break}}),M(qI,he=>{Y(0),U(null),je(null),pt(!1),Oe([]),Re(h?De.GUIDE_TOOL_MENU:De.USER_THANKS)}),o.useEffect(()=>{const he={linkReceived:le=>{const Ae=le.split("/");if(!(Ae.length<2))switch(Ae[1]){case"tour":return}},eventUrlPrefix:"help/"};return ht(he),()=>gt(he)},[]);const me=o.useCallback(he=>{switch(he){case"close":s(!1),k(""),m(De.GUIDE_TOOL_MENU);return;case"toggle_duty":if(!g&&!p&&!I){kt(d("guide.help.guide.tool.noqueueselected.message"),null,null,null,d("guide.help.guide.tool.noqueueselected.caption"),null);return}u(Ae=>(D(new fu(!Ae,Ae?!1:p,Ae?!1:I,Ae?!1:g)),!Ae));return;case"forum_link":const le=K("group.homepage.url","").replace("%groupid%",K("guide.help.alpha.groupid","0"));window.open(le);return}},[g,p,I,kt]);return t?e.jsxs(ie,{className:"nitro-guide-tool",theme:"primary-slim",children:[e.jsx(re,{headerText:n,onCloseClick:he=>me("close"),noCloseButton:i}),e.jsxs(se,{className:"text-black",children:[c===De.GUIDE_TOOL_MENU&&e.jsx(Zw,{isOnDuty:h,isHandlingGuideRequests:p,setIsHandlingGuideRequests:x,isHandlingHelpRequests:I,setIsHandlingHelpRequests:j,isHandlingBullyReports:g,setIsHandlingBullyReports:f,guidesOnDuty:b,helpersOnDuty:E,guardiansOnDuty:S,processAction:me}),c===De.GUIDE_ACCEPT&&e.jsx(Jw,{helpRequestDescription:R,helpRequestAverageTime:O}),[De.GUIDE_ONGOING,De.USER_ONGOING].includes(c)&&e.jsx(eT,{isGuide:h,userId:V,userName:q,userFigure:J,isTyping:we,messageGroups:Xt}),c===De.USER_CREATE&&e.jsx(sT,{userRequest:L,setUserRequest:k}),c===De.USER_PENDING&&e.jsx(iT,{helpRequestDescription:R,helpRequestAverageTime:O}),c===De.USER_FEEDBACK&&e.jsx(nT,{userName:q}),c===De.USER_THANKS&&e.jsx(oT,{}),c===De.USER_NO_HELPERS&&e.jsx(rT,{}),c===De.USER_SOMETHING_WRONG&&e.jsx(aT,{})]})]}):null},cT=a=>{const[t,s]=o.useState(!1),[n,r]=o.useState(null),[i,l]=o.useState(0),[c,m]=o.useState(null),{userFigure:h=null}=zn(),{purse:u=null,clubStatus:g=null}=Ur(),{badgeCodes:f=[],activate:p=null,deactivate:x=null}=ga(),I=()=>u.clubDays<=0?d("purse.clubdays.zero.amount.text"):u.minutesUntilExpiration>-1&&u.minutesUntilExpiration<60*24?Zs.shortFormat(u.minutesUntilExpiration*60):Zs.shortFormat((u.clubPeriods*31+u.clubDays)*86400),j=()=>{switch(g){case fn.ACTIVE:return d(`hccenter.status.${g}.info`,["timeleft","joindate","streakduration"],[I(),n==null?void 0:n.firstSubscriptionDate,Zs.shortFormat((n==null?void 0:n.currentHcStreak)*86400)]);case fn.EXPIRED:return d(`hccenter.status.${g}.info`,["joindate"],[n==null?void 0:n.firstSubscriptionDate]);default:return d(`hccenter.status.${g}.info`)}},E=()=>!n||n.timeUntilPayday<60?d("hccenter.special.time.soon"):Zs.shortFormat(n.timeUntilPayday*60),C=()=>d("hccenter.special.sum",["credits"],[((n==null?void 0:n.creditRewardForStreakBonus)+(n==null?void 0:n.creditRewardForMonthlySpent)).toString()]);if(M(mm,_=>{const S=_.getParser();l(S.giftsAvailable)}),M(zI,_=>{const S=_.getParser();r(S.data)}),o.useEffect(()=>{const _={linkReceived:S=>{const T=S.split("/");if(!(T.length<2))switch(T[1]){case"open":if(T.length>2)switch(T[2]){case"hccenter":s(!0);break}return}},eventUrlPrefix:"habboUI/"};return ht(_),()=>gt(_)},[]),o.useEffect(()=>{m(xN(f))},[f]),o.useEffect(()=>{if(!t)return;const _=p();return()=>x(_)},[t,p,x]),o.useEffect(()=>{D(new hm),D(new YI)},[]),!t)return null;const b=e.jsx(ui,{id:"popover-basic",children:e.jsxs(ui.Body,{className:"text-black py-2 px-3",children:[e.jsx("h5",{children:d("hccenter.breakdown.title")}),e.jsx("div",{children:d("hccenter.breakdown.creditsspent",["credits"],[n==null?void 0:n.totalCreditsSpent.toString()])}),e.jsx("div",{children:d("hccenter.breakdown.paydayfactor.percent",["percent"],[((n==null?void 0:n.kickbackPercentage)*100).toString()])}),e.jsx("div",{children:d("hccenter.breakdown.streakbonus",["credits"],[n==null?void 0:n.creditRewardForStreakBonus.toString()])}),e.jsx("hr",{className:"w-100 text-black my-1"}),e.jsx("div",{children:d("hccenter.breakdown.total",["credits","actual"],[C(),(((n==null?void 0:n.kickbackPercentage)*(n==null?void 0:n.totalCreditsSpent)+(n==null?void 0:n.creditRewardForStreakBonus))*100/100).toString()])}),e.jsx("div",{className:"btn btn-link text-primary p-0",onClick:()=>Z("habbopages/"+K("hc.center")["payday.habbopage"]),children:d("hccenter.special.infolink")})]})});return e.jsxs(ie,{theme:"primary-slim",className:"nitro-hc-center",children:[e.jsx(re,{headerText:d("generic.hccenter"),onCloseClick:()=>s(!1)}),e.jsxs(w,{position:"relative",className:"bg-muted p-2",children:[e.jsxs(v,{gap:1,children:[e.jsx("div",{className:"hc-logo"}),e.jsx(w,{children:e.jsx(P,{variant:"success",onClick:_=>Z("catalog/open/"+K("catalog.links")["hc.buy_hc"]),children:d(g===fn.ACTIVE?"hccenter.btn.extend":"hccenter.btn.buy")})})]}),e.jsx(A,{position:"absolute",className:"end-0 p-4 top-0 habbo-avatar",children:e.jsx(nt,{figure:h,direction:4,scale:2})})]}),e.jsxs(se,{children:[e.jsxs(w,{gap:2,children:[e.jsx(mt,{badgeCode:c,className:"align-self-center flex-shrink-0 me-1"}),e.jsxs(v,{size:5,className:"streak-info",gap:0,children:[e.jsx(N,{children:d("hccenter.status."+g)}),e.jsx(N,{dangerouslySetInnerHTML:{__html:j()}})]})]}),K("hc.center")["payday.info"]&&e.jsxs(w,{alignItems:"center",children:[e.jsxs(v,{className:"rounded-start bg-primary p-2 payday-special mb-1",children:[e.jsx("h4",{className:"mb-1",children:d("hccenter.special.title")}),e.jsx("div",{children:d("hccenter.special.info")}),e.jsx("div",{className:"btn btn-link text-white p-0 mt-auto align-self-baseline",onClick:()=>Z("habbopages/"+K("hc.center")["payday.habbopage"]),children:d("hccenter.special.infolink")})]}),e.jsxs("div",{className:"payday flex-shrink-0 p-2",children:[e.jsx("h5",{className:"mb-2 ms-2",children:d("hccenter.special.time.title")}),e.jsxs("div",{className:"d-flex flex-row mb-2",children:[e.jsx("div",{className:"clock me-2"}),e.jsx("h6",{className:"mb-0 align-self-center",children:E()})]}),g===fn.ACTIVE&&e.jsxs("div",{className:"pe-3",children:[e.jsx("h5",{className:"ms-2 mb-1 bolder",children:d("hccenter.special.amount.title")}),e.jsxs("div",{className:"d-flex flex-column",children:[e.jsx("div",{className:"w-100 text-center ms-4n",children:C()}),e.jsx(Um,{trigger:["hover","focus"],placement:"left",overlay:b,children:e.jsx("div",{className:"btn btn-link align-self-end text-primary",children:d("hccenter.breakdown.infolink")})})]})]})]})]}),K("hc.center")["gift.info"]&&e.jsxs("div",{className:"rounded bg-success p-2 d-flex flex-row mb-0",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"mb-1",children:d("hccenter.gift.title")}),e.jsx("div",{dangerouslySetInnerHTML:{__html:i>0?d("hccenter.unclaimedgifts",["unclaimedgifts"],[i.toString()]):d("hccenter.gift.info")}})]}),e.jsx("button",{className:"btn btn-primary btn-lg align-self-center ms-auto",onClick:()=>Z("catalog/open/"+K("catalog.links")["hc.hc_gifts"]),children:d(g===fn.ACTIVE?"hccenter.btn.gifts.redeem":"hccenter.btn.gifts.view")})]}),K("hc.center")["benefits.info"]&&e.jsxs("div",{className:"benefits text-black py-2",children:[e.jsx("h5",{className:"mb-1 text-primary",children:d("hccenter.general.title")}),e.jsx("div",{className:"mb-2",dangerouslySetInnerHTML:{__html:d("hccenter.general.info")}}),e.jsx("button",{className:"btn btn-link p-0 text-primary",onClick:()=>Z("habbopages/"+K("hc.center")["benefits.habbopage"]),children:d("hccenter.general.infolink")})]})]})]})},uT=a=>{const[t,s]=o.useState(""),{activeReport:n=null,setActiveReport:r=null}=Ws(),i=()=>{t.length<15||r(c=>{const m=Kt.REPORT_SUMMARY;return{...c,message:t,currentStep:m}})},l=()=>{r(c=>({...c,currentStep:c.currentStep-1}))};return e.jsxs(e.Fragment,{children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{fontSize:4,children:d("help.emergency.chat_report.subtitle")}),e.jsx(N,{children:d("help.cfh.input.text")})]}),e.jsx("textarea",{className:"form-control h-100",value:t,onChange:c=>s(c.target.value)}),e.jsxs(w,{gap:2,justifyContent:"between",children:[e.jsx(P,{variant:"secondary",disabled:!(n.reportType===tt.BULLY||n.reportType===tt.EMERGENCY),onClick:l,children:d("generic.back")}),e.jsx(P,{disabled:t.length<15,onClick:i,children:d("help.emergency.main.submit.button")})]})]})},dT=a=>{const{setActiveReport:t=null}=Ws(),s=()=>{t(n=>{const r=Kt.SELECT_USER,i=tt.BULLY;return{...n,currentStep:r,reportType:i}})};return e.jsxs(e.Fragment,{children:[e.jsxs(v,{grow:!0,center:!0,gap:1,children:[e.jsx(N,{fontSize:3,children:d("help.main.frame.title")}),e.jsx(N,{children:d("help.main.self.description")})]}),e.jsxs(v,{gap:1,children:[e.jsx(P,{onClick:s,children:d("help.main.bully.subtitle")}),e.jsx(P,{onClick:()=>Ct(new xs(xs.CREATE_HELP_REQUEST)),disabled:!K("guides.enabled"),children:d("help.main.help.title")}),e.jsx(P,{disabled:!0,children:d("help.main.self.tips.title")})]}),e.jsx(P,{variant:"link",textColor:"black",onClick:()=>D(new $I(!1)),children:d("help.main.my.sanction.status")})]})},mT=a=>{const{username:t="",onAction:s=null}=a,[n,r]=o.useState(!1),i=()=>{n||(r(!0),D(new XI(t)))};return M(KI,l=>{const c=l.getParser();c&&c.webId===B().userId&&s("close")}),e.jsxs("div",{className:"d-flex flex-column gap-4 h-100",children:[e.jsx("div",{className:"bg-muted rounded p-2 text-center",children:d("tutorial.name_change.info.confirm")}),e.jsxs("div",{className:"d-flex flex-column align-items-center gap-1 h-100",children:[e.jsx("div",{children:d("tutorial.name_change.confirm")}),e.jsx("div",{className:"fw-bold",children:t})]}),e.jsxs("div",{className:"d-flex gap-2",children:[e.jsx("button",{className:"btn btn-success w-100",disabled:n,onClick:i,children:d("generic.ok")}),e.jsx("button",{className:"btn btn-primary w-100",onClick:()=>s("close"),children:d("cancel")})]})]})},hT=a=>{const{onAction:t=null}=a;return e.jsxs("div",{className:"d-flex flex-column gap-4 h-100",children:[e.jsx("div",{className:"bg-muted rounded p-2 text-center",children:d("tutorial.name_change.info.main")}),e.jsx("div",{className:"fw-bold d-flex align-items-center justify-content-center h-100 w-100",children:d("tutorial.name_change.current",["name"],[B().userName])}),e.jsxs("div",{className:"d-flex gap-2",children:[e.jsx("button",{className:"btn btn-success w-100",onClick:()=>t("start"),children:d("tutorial.name_change.change")}),e.jsx("button",{className:"btn btn-primary w-100",onClick:()=>t("confirmation",B().userName),children:d("tutorial.name_change.keep")})]})]})},gT=0,fT=2,pT=3,xT=4,jT=5,IT=6,bT=a=>{const{onAction:t=null}=a,[s,n]=o.useState(""),[r,i]=o.useState(!1),[l,c]=o.useState(!1),[m,h]=o.useState(null),[u,g]=o.useState([]),f=()=>{s!==""&&(i(!1),g([]),h(null),c(!0),D(new JI(s)))},p=x=>{i(!1),g([]),h(null),n(x)};return M(QI,x=>{c(!1);const I=x.getParser();if(I)switch(I.resultCode){case gT:i(!0);break;case fT:h("short");break;case pT:h("long");break;case xT:h("invalid");break;case jT:g(I.nameSuggestions),h("taken");break;case IT:h("change_not_allowed")}}),e.jsxs("div",{className:"d-flex flex-column gap-3 h-100",children:[e.jsx("div",{children:d("tutorial.name_change.info.select")}),e.jsxs("div",{className:"d-flex gap-2",children:[e.jsx("input",{type:"text",className:"form-control form-control-sm",value:s,onChange:x=>p(x.target.value)}),e.jsx("button",{className:"btn btn-primary",disabled:s===""||l,onClick:f,children:d("tutorial.name_change.check")})]}),!m&&!r&&e.jsx("div",{className:"bg-muted rounded p-2 text-center",children:d("help.tutorial.name.info")}),m&&e.jsx("div",{className:"bg-danger rounded p-2 text-center text-white",children:d(`help.tutorial.name.${m}`,["name"],[s])}),r&&e.jsx("div",{className:"bg-success rounded p-2 text-center text-white",children:d("help.tutorial.name.available",["name"],[s])}),u&&e.jsx("div",{className:"d-flex flex-column gap-2",children:u.map((x,I)=>e.jsx("div",{className:"col bg-muted rounded p-1 cursor-pointer",onClick:()=>p(x),children:x},I))}),e.jsxs("div",{className:"d-flex gap-2",children:[e.jsx("button",{className:"btn btn-success w-100",disabled:!r,onClick:()=>t("confirmation",s),children:d("tutorial.name_change.pick")}),e.jsx("button",{className:"btn btn-primary w-100",onClick:()=>t("close"),children:d("cancel")})]})]})},Ba="INIT",Tl="INPUT",yl="CONFIRMATION",ET=a=>{const[t,s]=o.useState(!1),[n,r]=o.useState(Ba),[i,l]=o.useState(""),c=(h,u)=>{switch(h){case"start":r(Tl);break;case"confirmation":l(u),r(yl);break;case"close":l(""),s(!1);break}},m=o.useMemo(()=>{switch(n){case Ba:return"tutorial.name_change.title.main";case Tl:return"tutorial.name_change.title.select";case yl:return"tutorial.name_change.title.confirm"}},[n]);return ot(na.INIT,h=>{r(Ba),s(!0)}),t?e.jsxs(ie,{className:"nitro-change-username",theme:"primary-slim",children:[e.jsx(re,{headerText:d(m),onCloseClick:()=>c("close")}),e.jsxs(se,{className:"text-black",children:[n===Ba&&e.jsx(hT,{onAction:c}),n===Tl&&e.jsx(bT,{onAction:c}),n===yl&&e.jsx(mT,{username:i,onAction:c})]})]}):null},CT=a=>{const{activeReport:t=null,setActiveReport:s=null}=Ws(),n=()=>{const r=[];switch(t.reportType){case tt.BULLY:case tt.EMERGENCY:case tt.ROOM:{const i=t.roomId<=0?t.reportedChats[0].roomId:t.roomId;t.reportedChats.forEach(l=>r.push(l.webId,l.message)),D(new nb(t.message,t.cfhTopic,t.reportedUserId,i,r));break}case tt.IM:t.reportedChats.forEach(i=>r.push(i.webId,i.message)),D(new sb(t.message,t.cfhTopic,t.reportedUserId,r));break;case tt.THREAD:D(new tb(t.groupId,t.threadId,t.cfhTopic,t.message));break;case tt.MESSAGE:D(new eb(t.groupId,t.threadId,t.messageId,t.cfhTopic,t.message));break;case tt.PHOTO:D(new ZI(t.extraData,t.roomId,t.reportedUserId,t.cfhTopic,t.roomObjectId));break}s(null)};return e.jsxs(e.Fragment,{children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{fontSize:4,children:d("help.cfh.button.send")}),e.jsx(N,{children:d("help.main.summary")})]}),e.jsx(P,{variant:"success",onClick:n,children:d("guide.help.request.emergency.submit.button")})]})},NT=a=>{const{sanctionInfo:t=null,setSanctionInfo:s=null}=Ws(),n=(r,i,l)=>{let c=`help.sanction.${r}`;switch(i){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",d(c,["days"],[(l/24).toString()])}return d(c,["hours"],[l.toString()])};return t?e.jsxs(ie,{className:"nitro-help",theme:"primary-slim",children:[e.jsx(re,{headerText:d("help.sanction.info.title"),onCloseClick:()=>s(null)}),e.jsx(se,{className:"text-black",children:e.jsxs(ne,{children:[e.jsx(v,{center:!0,size:5,overflow:"hidden",children:e.jsx(A,{className:"index-image"})}),e.jsxs(v,{justifyContent:"between",size:7,overflow:"hidden",children:[t.sanctionReason==="cfh.reason.EMPTY"?e.jsx("div",{className:"col-12 fw-bold",children:d("help.sanction.current.none")}):e.jsxs(e.Fragment,{children:[(t.probationHoursLeft>0||t.isSanctionActive)&&e.jsx("div",{className:"col-12 fw-bold",children:d("help.sanction.probation.reminder")}),e.jsxs("div",{className:`col-12 fw-bold ${t.isSanctionNew?"text-danger":""}`,children:[d("help.sanction.last.sanction")," ",n("current",t.sanctionName,t.sanctionLengthHours)]}),e.jsxs("div",{className:"col-12",children:[d("generic.start.time")," ",t.sanctionCreationTime]}),e.jsxs("div",{className:"col-12",children:[d("generic.reason")," ",t.sanctionReason]}),e.jsxs("div",{className:"col-12",children:[d("help.sanction.probation.days.left")," ",Math.trunc(t.probationHoursLeft/24)+1]})]}),t.hasCustomMute&&!t.isSanctionActive&&e.jsx("div",{className:"col-12 fw-bold",children:d("help.sanction.custom.mute")}),t.tradeLockExpiryTime&&t.tradeLockExpiryTime.length>0&&e.jsxs("div",{className:"col-12 fw-bold",children:[d("trade.locked.until")," ",t.tradeLockExpiryTime]}),e.jsx("div",{className:"col-12",children:n("next",t.nextSanctionName,t.nextSanctionLengthHours)}),e.jsx(P,{variant:"success",onClick:r=>s(null),children:d("habbo.way.ok.button")})]})]})})]}):null},vT=a=>{const[t,s]=o.useState([]),{activeReport:n=null,setActiveReport:r=null}=Ws(),{chatHistory:i=[],messengerHistory:l=[]}=ma(),c=o.useMemo(()=>{switch(n.reportType){case tt.BULLY:case tt.EMERGENCY:return i.filter(g=>g.type===en.TYPE_CHAT&&g.webId===n.reportedUserId&&g.entityType===dt.USER);case tt.IM:return l.filter(g=>g.webId===n.reportedUserId&&g.type===en.TYPE_IM)}return[]},[n,i,l]),m=g=>{s(f=>{const p=[...f],x=p.indexOf(g);return x>=0?p.splice(x,1):p.push(g),p})},h=()=>{!t||t.length<=0||r(g=>({...g,reportedChats:t,currentStep:Kt.SELECT_TOPICS}))},u=()=>{r(g=>({...g,currentStep:g.currentStep-1}))};return e.jsxs(e.Fragment,{children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{fontSize:4,children:d("help.emergency.chat_report.subtitle")}),e.jsx(N,{children:d("help.emergency.chat_report.description")})]}),e.jsxs(v,{gap:1,overflow:"hidden",children:[!c||!c.length&&e.jsx(N,{children:d("help.cfh.error.no_user_data")}),c.length>0&&e.jsx(Pe,{gap:1,columnCount:1,columnMinHeight:25,overflow:"auto",children:c.map((g,f)=>e.jsx(Ce,{onClick:p=>m(g),itemActive:t.indexOf(g)>=0,children:e.jsx(N,{children:g.message})},g.id))})]}),e.jsxs(w,{gap:2,justifyContent:"between",children:[e.jsx(P,{variant:"secondary",onClick:u,disabled:n.reportType===tt.IM,children:d("generic.back")}),e.jsx(P,{disabled:t.length<=0,onClick:h,children:d("help.emergency.main.submit.button")})]})]})},_T=a=>{const[t,s]=o.useState(-1),{chatHistory:n=[]}=ma(),{activeReport:r=null,setActiveReport:i=null}=Ws(),l=o.useMemo(()=>{const u=new Map;return n.forEach(g=>{g.type===en.TYPE_CHAT&&g.entityType===dt.USER&&g.webId!==B().userId&&!u.has(g.webId)&&u.set(g.webId,{id:g.webId,username:g.name})}),Array.from(u.values())},[n]),c=u=>{u<=0||i(g=>({...g,reportedUserId:u,currentStep:Kt.SELECT_CHATS}))},m=u=>{s(g=>u===g?-1:u)},h=()=>{i(u=>({...u,currentStep:u.currentStep-1}))};return e.jsxs(e.Fragment,{children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{fontSize:4,children:d("help.emergency.main.step.two.title")}),l.length>0&&e.jsx(N,{children:d("report.user.pick.user")})]}),e.jsxs(v,{gap:1,overflow:"hidden",children:[!l.length&&e.jsx(N,{children:d("report.user.error.nolist")}),l.length>0&&e.jsx(Pe,{columnCount:1,columnMinHeight:25,gap:1,children:l.map((u,g)=>e.jsx(Ce,{onClick:f=>m(u.id),itemActive:t===u.id,children:e.jsx("span",{dangerouslySetInnerHTML:{__html:u.username}})},u.id))})]}),e.jsxs(w,{gap:2,justifyContent:"between",children:[e.jsx(P,{variant:"secondary",onClick:h,children:d("generic.back")}),e.jsx(P,{disabled:t<=0,onClick:()=>c(t),children:d("help.emergency.main.submit.button")})]})]})},ST=a=>{const[t,s]=o.useState(-1),[n,r]=o.useState(-1),{setActiveReport:i=null}=Ws(),{cfhCategories:l=[]}=pi(),c=()=>{t<0||n<0||i(h=>({...h,cfhCategory:t,cfhTopic:l[t].topics[n].id,currentStep:Kt.INPUT_REPORT_MESSAGE}))},m=()=>{i(h=>({...h,currentStep:h.currentStep-1}))};return e.jsxs(e.Fragment,{children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{fontSize:4,children:d("help.emergency.chat_report.subtitle")}),e.jsx(N,{children:d("help.cfh.pick.topic")})]}),e.jsxs(v,{gap:1,overflow:"auto",children:[t<0&&l.map((h,u)=>e.jsx(P,{variant:"danger",onClick:g=>s(u),children:d(`help.cfh.reason.${h.name}`)},u)),t>=0&&l[t].topics.map((h,u)=>e.jsx(P,{variant:"danger",onClick:g=>r(u),active:n===u,children:d(`help.cfh.topic.${h.id}`)},u))]}),e.jsxs(w,{gap:2,justifyContent:"between",children:[e.jsx(P,{variant:"secondary",onClick:m,children:d("generic.back")}),e.jsx(P,{disabled:n<0,onClick:c,children:d("help.emergency.main.submit.button")})]})]})},wT=a=>{const[t,s]=o.useState(!1),{activeReport:n=null,setActiveReport:r=null,report:i=null}=Ws(),l=()=>{r(null),s(!1)};o.useEffect(()=>{const m={linkReceived:h=>{const u=h.split("/");if(!(u.length<2))switch(u[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(g=>!g);return;case"tour":return;case"report":u.length>=5&&u[2]==="room"&&(parseInt(u[3]),unescape(u.splice(4).join("/")));return}},eventUrlPrefix:"help/"};return ht(m),()=>gt(m)},[]),o.useEffect(()=>{n&&s(!0)},[n]);const c=()=>{if(n)switch(n.currentStep){case Kt.SELECT_USER:return e.jsx(_T,{});case Kt.SELECT_CHATS:return e.jsx(vT,{});case Kt.SELECT_TOPICS:return e.jsx(ST,{});case Kt.INPUT_REPORT_MESSAGE:return e.jsx(uT,{});case Kt.REPORT_SUMMARY:return e.jsx(CT,{})}return e.jsx(dT,{})};return e.jsxs(e.Fragment,{children:[t&&e.jsxs(ie,{className:"nitro-help",theme:"primary-slim",children:[e.jsx(re,{headerText:d("help.button.cfh"),onCloseClick:l}),e.jsx(se,{className:"text-black",children:e.jsxs(ne,{children:[e.jsx(v,{center:!0,size:5,overflow:"hidden",children:e.jsx(A,{className:"index-image"})}),e.jsx(v,{justifyContent:"between",size:7,overflow:"hidden",children:e.jsx(c,{})})]})})]}),e.jsx(NT,{}),e.jsx(ET,{})]})},TT=[{id:"room.rooftop",className:"rooftop-orange"},{id:"room.rooftop.pool",className:"rooftop-pool-orange"},{id:"room.pool",className:"pool-orange"},{id:"room.picnic",className:"picnic-orange"},{id:"room.peaceful",className:"peaceful-orange"},{id:"room.infobus",className:"infobus-orange"},{id:"room.lobby",className:"lobby"}],Yt=()=>{const a=K("hotelview"),t=s=>{Z(`navigator/goto/${s}`)};return e.jsx(w,{children:TT.map(s=>e.jsx(A,{className:`position-absolute ${s.className}`,onClick:()=>t(a[s.id]),children:e.jsx("i",{className:"active-arrow arrow"})},s.id))})},yT=()=>{const a=K("hotelview").images["background.colour"],t=new Date;t.getHours(),t.getMinutes();const s=a?{background:a}:{};return(r=>e.jsx("div",{className:"nitro-hotel-view",style:s,children:r}))(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue position-relative"}),e.jsx("div",{className:"back-e-alt-ii position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Yt,{})]})})]}))},RT=[{id:"room.rooftop",className:"rooftop-night"},{id:"room.rooftop.pool",className:"rooftop-pool-night"},{id:"room.picnic",className:"picnic-night"},{id:"room.peaceful",className:"peaceful-night"},{id:"room.pool",className:"pool-night"},{id:"room.infobus",className:"infobus-night"},{id:"room.lobby",className:"lobby-night"}],Io=()=>{const a=K("hotelview"),t=s=>{Z(`navigator/goto/${s}`)};return e.jsx(w,{children:RT.map(s=>e.jsx(A,{className:`position-absolute ${s.className}`,onClick:()=>t(a[s.id]),children:e.jsx("i",{className:"active-arrow arrow"})},s.id))})},OT=a=>{const t=K("hotelview").images["background.colour"],[s,n]=o.useState(!1),[r,i]=o.useState(!1);o.useEffect(()=>{setTimeout(()=>n(!0),7e3),setTimeout(()=>i(!0),0)},[]);const l=new Date,c=l.getHours()*60+l.getMinutes();return[{start:18*60,end:18*60+30},{start:19*60,end:19*60+30},{start:20*60,end:20*60+30},{start:21*60,end:21*60+30},{start:22*60,end:22*60+30},{start:23*60,end:23*60+30}].some(u=>c>=u.start&&c<=u.end)?e.jsxs("div",{className:"nitro-hotel-view",style:t&&t?{background:t}:{},children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-night position-relative"}),e.jsx("div",{className:"back-c-alt position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-night position-relative"}),e.jsx(Io,{}),e.jsx("div",{className:"light-i position-absolute"}),e.jsx("div",{className:"door position-absolute"}),e.jsx("div",{className:"door-b position-absolute"})]})})]}):e.jsxs("div",{className:"nitro-hotel-view",style:t&&t?{background:t}:{},children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-night position-relative"}),e.jsx("div",{className:"back-c-alt position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-night position-relative"}),e.jsx(Io,{}),e.jsx("div",{className:"light-i position-absolute"}),e.jsx("div",{className:"door position-absolute"}),e.jsx("div",{className:"door-b position-absolute"})]})})]})},kT=()=>{const a=K("hotelview").images["background.colour"],t=new Date,s=t.getHours(),n=t.getMinutes(),r=a&&a?{background:a}:{},i=l=>e.jsx("div",{className:"nitro-hotel-view",style:r,children:l});return e.jsxs(e.Fragment,{children:[s===6&&n<=30&&i(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-night position-relative"}),e.jsx("div",{className:"back-a position-absolute"}),e.jsx("div",{className:"back-a position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-night position-relative"}),e.jsx(Io,{}),e.jsx("div",{className:"light-a position-absolute"}),e.jsx("div",{className:"light-a position-absolute"})]})})]})),s===6&&n>=30&&i(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-night position-relative"}),e.jsx("div",{className:"back-a-alt position-absolute"}),e.jsx("div",{className:"back-b position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Yt,{}),e.jsx("div",{className:"front-a position-absolute"}),e.jsx("div",{className:"light-a position-absolute"})]})})]})),s===7&&n<=30&&i(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-night position-relative"}),e.jsx("div",{className:"back-a-alt position-absolute"}),e.jsx("div",{className:"back-c-alt position-absolute"}),e.jsx("div",{className:"back-b position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Yt,{}),e.jsx("div",{className:"front-c position-absolute"}),e.jsx("div",{className:"front-b position-absolute"}),e.jsx("div",{className:"light-b position-absolute"})]})})]})),s===7&&n>=30&&i(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue position-relative"}),e.jsx("div",{className:"back-d position-absolute"}),e.jsx("div",{className:"back-c position-absolute"}),e.jsx("div",{className:"back-b position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Yt,{}),e.jsx("div",{className:"front-c position-absolute"}),e.jsx("div",{className:"front-b position-absolute"}),e.jsx("div",{className:"light-d position-absolute"})]})})]})),s===8&&n<=30&&i(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue position-relative"}),e.jsx("div",{className:"back-d position-absolute"}),e.jsx("div",{className:"back-e-alt-ii position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Yt,{}),e.jsx("div",{className:"front-c position-absolute"}),e.jsx("div",{className:"front-c position-absolute"}),e.jsx("div",{className:"front-c position-absolute"}),e.jsx("div",{className:"front-c position-absolute"}),e.jsx("div",{className:"light-e position-absolute"})]})})]})),s===8&&n>=30&&i(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue position-relative"}),e.jsx("div",{className:"back-e-alt-iii position-absolute"}),e.jsx("div",{className:"back-d position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Yt,{}),e.jsx("div",{className:"front-c position-absolute"}),e.jsx("div",{className:"front-c position-absolute"}),e.jsx("div",{className:"front-c position-absolute"}),e.jsx("div",{className:"light-f position-absolute"})]})})]})),s===9&&n<=30&&i(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue position-relative"}),e.jsx("div",{className:"back-e-alt-iv position-absolute"}),e.jsx("div",{className:"back-d position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Yt,{}),e.jsx("div",{className:"front-d position-absolute"}),e.jsx("div",{className:"light-gg-alt position-absolute"}),e.jsx("div",{className:"light-g position-absolute"}),e.jsx("div",{className:"light-g position-absolute"})]})})]})),s===9&&n>=30&&i(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue position-relative"}),e.jsx("div",{className:"back-e position-absolute"}),e.jsx("div",{className:"back-e-alt-v position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Yt,{}),e.jsx("div",{className:"light-gg-alt position-absolute"}),e.jsx("div",{className:"light-g position-absolute"})]})})]})),s===10&&n<=30&&i(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue position-relative"}),e.jsx("div",{className:"back-e-alt-ii position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Yt,{}),e.jsx("div",{className:"light-i position-absolute"})]})})]}))]})},AT=a=>{const[t,s]=o.useState(!1),n=K("hotelview").images["background.colour"];return o.useEffect(()=>{setTimeout(()=>s(!0),15e3)},[]),e.jsxs("div",{className:"nitro-hotel-view",style:n&&n?{background:n}:{},children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-night position-relative"}),e.jsx("div",{className:"back-c-alt position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-night position-relative"}),e.jsx(Io,{}),e.jsx("div",{className:"light-i position-absolute"}),e.jsx("div",{className:"door position-absolute"})]})})]})},DT=()=>{const a=K("hotelview").images["background.colour"],t=new Date,s=t.getHours(),n=t.getMinutes(),r=a&&a?{background:a}:{},i=l=>e.jsx("div",{className:"nitro-hotel-view",style:r,children:l});return e.jsxs(e.Fragment,{children:[s===16&&n<=30&&i(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-af-1 position-relative"}),e.jsx("div",{className:"back-f-alt position-absolute"}),e.jsx("div",{className:"back-f position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Yt,{}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"light-j position-absolute"}),e.jsx("div",{className:"light-j position-absolute"})]})})]})),s===16&&n>=30&&i(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-af-2 position-relative"}),e.jsx("div",{className:"back-g-alt position-absolute"}),e.jsx("div",{className:"back-g position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Yt,{}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"light-l position-absolute"}),e.jsx("div",{className:"light-l-alt position-absolute"})]})})]})),s===17&&n<=30&&i(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-af-3 position-relative"}),e.jsx("div",{className:"back-h-alt position-absolute"}),e.jsx("div",{className:"back-h position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Yt,{}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"light-m position-absolute"}),e.jsx("div",{className:"light-m-alt position-absolute"})]})})]})),s===17&&n>=30&&i(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-af-4 position-relative"}),e.jsx("div",{className:"back-h position-absolute"})]})}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Yt,{}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"light-n position-absolute"}),e.jsx("div",{className:"light-n-alt position-absolute"})]})})]})),s===18&&n<=30&&i(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-af-5 position-relative"}),e.jsx("div",{className:"back-h position-absolute"}),e.jsx("div",{className:"back-n position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Yt,{}),e.jsx("div",{className:"front-k position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"light-n position-absolute"}),e.jsx("div",{className:"light-n-alt-iii position-absolute"})]})})]})),s===18&&n>=30&&i(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-af-6 position-relative"}),e.jsx("div",{className:"back-h position-absolute"}),e.jsx("div",{className:"back-n position-absolute"}),e.jsx("div",{className:"back-k-final position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Yt,{}),e.jsx("div",{className:"front-k position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"light-o position-absolute"}),e.jsx("div",{className:"light-o-alt position-absolute"}),e.jsx("div",{className:"light-o-alt-ii position-absolute"})]})})]})),s===19&&n<=30&&i(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-night position-relative"}),e.jsx("div",{className:"back-c-alt position-absolute"}),e.jsx("div",{className:"back-c-alt position-absolute"}),e.jsx("div",{className:"back-h position-absolute"}),e.jsx("div",{className:"back-k-alt position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Yt,{}),e.jsx("div",{className:"front-m position-absolute"}),e.jsx("div",{className:"front-m position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"front-j position-absolute"}),e.jsx("div",{className:"light-p position-absolute"}),e.jsx("div",{className:"light-p-alt position-absolute"}),e.jsx("div",{className:"light-p-alt-ii position-absolute"})]})})]})),s===19&&n>=30&&i(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview-back position-relative",children:[e.jsx("div",{className:"stretch-blue-night position-relative"}),e.jsx("div",{className:"back-e position-absolute"}),e.jsx("div",{className:"back-k-final position-absolute"}),e.jsx("div",{className:"back-l position-absolute"}),e.jsx("div",{className:"back-l position-absolute"})]})}),e.jsx("div",{className:"drape position-absolute"}),e.jsx("div",{className:"left position-absolute",children:e.jsxs("div",{className:"hotelview position-relative",children:[e.jsx("div",{className:"hotelview-orange position-relative"}),e.jsx(Yt,{}),e.jsx("div",{className:"front-a position-absolute"}),e.jsx("div",{className:"light-q position-absolute"}),e.jsx("div",{className:"light-q-alt-ii position-absolute"})]})})]}))]})},PT=a=>{const[t,s]=o.useState(null),[n,r]=o.useState(null),[i,l]=o.useState(null),[c,m]=o.useState(null);return M(rb,h=>{const u=h.getParser();s(u.productType),r(u.productClassId),l(u.totalCoinsForBonus),m(u.coinsStillRequiredToBuy)}),o.useEffect(()=>{D(new ib)},[]),t?e.jsxs("div",{className:"bonus-rare widget d-flex",children:[t,e.jsxs("div",{className:"bg-light-dark rounded overflow-hidden position-relative bonus-bar-container",children:[e.jsx("div",{className:"d-flex justify-content-center align-items-center w-100 h-100 position-absolute small top-0",children:i-c+"/"+i}),e.jsx("div",{className:"small bg-info rounded position-absolute top-0 h-100",style:{width:(i-c)/i*100+"%"}})]})]}):null},LT=a=>{const{data:t=null,goalCode:s=null}=a;return e.jsxs("div",{className:"hof-user-container",children:[e.jsxs("div",{className:"hof-tooltip px-2",children:[e.jsx(A,{className:"icon icon-sheet"}),e.jsx("b",{className:"text-black cursor-pointer px-2",onClick:()=>as(t.userId),children:t.userName}),e.jsxs("div",{className:"small text-black text-muted fw-bold",children:[d("landing.view.competition.hof.points",["points"],[Xi(t.currentScore).toString()])," points"]}),e.jsx("div",{className:"small text-black text-muted",children:d(`landing.view.competition.hof.${s}.rankdesc.leader`)})]}),e.jsx(nt,{figure:t.figure,direction:2})]})},MT=a=>{const{slot:t=-1,conf:s=null}=a,[n,r]=o.useState(null);return M(ab,i=>{const l=i.getParser();r(l.data)}),o.useEffect(()=>{const i=s?s.campaign:"";D(new ob(i))},[s]),n?e.jsx("div",{className:"hall-of-fame d-flex px-2",children:n.hof&&n.hof.length>0&&n.hof.map((i,l)=>e.jsx(LT,{data:i,goalCode:n.goalCode},l))}):null},UT=a=>{const[t,s]=o.useState(null),[n,r]=o.useState(0);return M(lb,i=>{const l=i.getParser();s(l.articles)}),o.useEffect(()=>{D(new cb)},[]),t?e.jsxs("div",{className:"promo-articles widget mb-2",children:[e.jsxs("div",{className:"d-flex flex-row align-items-center w-100 mb-1",children:[e.jsx("small",{className:"flex-shrink-0 pe-1",children:d("landing.view.promo.article.header")}),e.jsx("hr",{className:"w-100 my-0"})]}),e.jsx("div",{className:"d-flex flex-row mb-1",children:t&&t.length>0&&t.map((i,l)=>e.jsx("div",{className:"promo-articles-bullet cursor-pointer "+(i===t[n]?"promo-articles-bullet-active":""),onClick:c=>r(l)},i.id))}),t&&t[n]&&e.jsxs("div",{className:"promo-article d-flex flex-row row mx-0",children:[e.jsx("div",{className:"promo-article-image",style:{backgroundImage:`url(${t[n].imageUrl})`}}),e.jsxs("div",{className:"col-3 d-flex flex-column h-100",children:[e.jsx("h3",{className:"my-0",children:t[n].title}),e.jsx("b",{children:t[n].bodyText}),e.jsx("button",{className:"btn btn-sm mt-auto btn-gainsboro",onClick:i=>Dr(t[n].linkContent),children:t[n].buttonText})]})]})]}):null},FT=a=>{const{conf:t=null}=a,s=n=>{const r=t[n];if(!r)return null;switch(n){case"image":return fc.interpolate(r)}return r};return e.jsxs("div",{className:"widgetcontainer widget d-flex flex-row overflow-hidden",children:[e.jsx("div",{className:"widgetcontainer-image flex-shrink-0",style:{backgroundImage:`url(${s("image")})`}}),e.jsxs("div",{className:"d-flex flex-column align-self-center",children:[e.jsx("h3",{className:"my-0",children:d(`landing.view.${s("texts")}.header`)}),e.jsx("i",{children:d(`landing.view.${s("texts")}.body`)}),e.jsx("button",{className:"btn btn-sm btn-gainsboro align-self-start px-3 mt-auto",onClick:n=>Dr(s("btnLink")),children:d(`landing.view.${s("texts")}.button`)})]})]})},VT=a=>{switch(a.widgetType){case"promoarticle":return e.jsx(UT,{});case"achievementcompetition_hall_of_fame":return e.jsx(MT,{slot:a.slot,conf:a.widgetConf});case"bonusrare":return e.jsx(PT,{});case"widgetcontainer":return e.jsx(FT,{conf:a.widgetConf});default:return null}},GT=a=>{const{widgetType:t=null,widgetSlot:s=0,widgetConf:n=null,className:r="",...i}=a;return e.jsx("div",{className:`widget-slot slot-${s} ${r||""}`,...i,children:e.jsx(VT,{widgetType:t,slot:s,widgetConf:n})})},BT=()=>{const[a,t]=o.useState(!0);if(He([Pt.CREATED,Pt.ENDED],l=>{switch(l.type){case Pt.CREATED:t(!1);return;case Pt.ENDED:t(l.openLandingView);return}}),!a)return null;const s=K("hotelview"),n=s.images["background.colour"];K("asset.url");const r=l=>e.jsx(GT,{widgetSlot:l,widgetType:s.widgets[`slot.${l}.widget`],widgetConf:s.widgets[`slot.${l}.conf`],className:l===6?"mt-auto":l%2===0?"col-5":"col-7"},l),i=[1,2,3,4,5,6,7].map(l=>r(l));return e.jsx("div",{className:"nitro-hotel-view",style:n?{background:n}:{},children:e.jsx("div",{className:"container h-100 py-3 overflow-hidden landing-widgets",children:e.jsxs("div",{className:"row h-100",children:[e.jsx("div",{className:"col-9 h-100 d-flex flex-column",children:i.slice(0,6)}),e.jsx("div",{className:"col-3 h-100",children:i[6]})]})})})},HT=()=>{const[a,t]=o.useState(!0),{userFigure:s=null}=zn(),r=new Date().getHours(),i=r>5&&r<=9,l=r>9&&r<=16,c=r>16&&r<=19,m=r>19&&r<=23,h=r>23||r<=5;return He([Pt.CREATED,Pt.ENDED],u=>{t(u.type===Pt.CREATED?!1:u.openLandingView)}),a?e.jsxs("div",{children:[e.jsx(BT,{}),i&&e.jsx(kT,{}),l&&e.jsx(yT,{}),c&&e.jsx(DT,{}),m&&e.jsx(OT,{}),h&&e.jsx(AT,{})]}):null},sr=class sr{};sr.EVERYTHING="inventory.filter.option.everything",sr.FLOOR="inventory.furni.tab.floor",sr.WALL="inventory.furni.tab.wall",sr.ANYWHERE="inventory.placement.option.anywhere",sr.IN_ROOM="inventory.placement.option.inroom",sr.IN_INVENTORY="inventory.placement.option.notinroom";let Ps=sr;const _r="inventory.furni",cc="inventory.bots",uc="inventory.furni.tab.pets",wi="inventory.badges",dc=[_r,uc,wi,cc],WT=[st.FURNI,st.PET,st.BADGE,st.BOT],mc=9,qT=a=>{const{currentTab:t=null,groupItems:s=[],badgeCodes:n=[],setGroupItems:r=null,setBadgeCodes:i=null}=a,[l,c]=o.useState(Ps.EVERYTHING),[m,h]=o.useState(Ps.IN_INVENTORY),[u,g]=o.useState("");return o.useEffect(()=>{if(t!==wi)return;let f=[...n];const p=n.filter(j=>j.startsWith("ACH_")),x={};p.forEach(j=>{const E=j.split(/[\d]+/)[0],C=Number(j.replace(E,""));(x[E]===void 0||C>x[E])&&(x[E]=C)}),f=Object.keys(x).map(j=>`${j}${x[j]}`).concat(n.filter(j=>!j.startsWith("ACH_"))).filter(j=>fi(j).toLocaleLowerCase().includes(u==null?void 0:u.toLocaleLowerCase().replace(" ",""))),i(f)},[n,t,u,i]),o.useEffect(()=>{if(t!==_r)return;let f=[...s];const p=u.toLocaleLowerCase();if(l===Ps.EVERYTHING)return r(s.filter(x=>x.name.toLocaleLowerCase().includes(p)));f=s.filter(x=>{const I=l===Ps.WALL?x.isWallItem:!1,j=l===Ps.FLOOR?!x.isWallItem:!1,E=!!x.name.toLocaleLowerCase().includes(p);return p&&p.length?E&&(I||j):I||j}),r(f)},[s,r,u,l,t]),o.useEffect(()=>{c(Ps.EVERYTHING),h(Ps.IN_INVENTORY),g("")},[t]),e.jsxs(w,{className:"nitro-inventory-category-filter rounded p-1 mt-n1",style:{width:t===wi?"320px":"100%"},children:[e.jsxs(w,{className:"position-relative",children:[e.jsx(w,{fullWidth:!0,alignItems:"center",position:"relative",children:e.jsx("input",{type:"text",className:"form-control form-control-sm",value:u,onChange:f=>g(f.target.value),placeholder:d("catalog.search")})}),u&&!!u.length&&e.jsx("i",{className:"icon icon-clear position-absolute cursor-pointer end-1 top-1",onClick:f=>g("")})]}),t!==wi&&e.jsx(e.Fragment,{children:e.jsx(w,{alignItems:"center",position:"relative",className:"ms-2",children:e.jsx("select",{className:"form-select form-select-sm",value:l,onChange:f=>c(f.target.value),children:[Ps.EVERYTHING,Ps.FLOOR,Ps.WALL].map((f,p)=>e.jsx("option",{value:f,children:d(f)},p))})})})]})},xd=a=>{const{badgeCode:t=null,children:s=null,...n}=a,{selectedBadgeCode:r=null,setSelectedBadgeCode:i=null,toggleBadge:l=null,getBadgeId:c=null}=ga(),{isUnseen:m=null}=Os(),h=m(st.BADGE,c(t));return e.jsxs(Ce,{className:"badge-container",itemActive:r===t,itemUnseen:h,onMouseDown:u=>i(t),onDoubleClick:u=>l(r),...n,children:[e.jsx(mt,{badgeCode:t}),s]})},zT=a=>{const{filteredBadgeCodes:t=[]}=a,[s,n]=o.useState(!1),{activeBadgeCodes:r=[],selectedBadgeCode:i=null,isWearingBadge:l=null,canWearBadges:c=null,toggleBadge:m=null,getBadgeId:h=null,activate:u=null,deactivate:g=null}=ga(),{isUnseen:f=null,removeUnseen:p=null}=Os();return o.useEffect(()=>{!i||!f(st.BADGE,h(i))||p(st.BADGE,h(i))},[i,f,p,h]),o.useEffect(()=>{if(!s)return;const x=u();return()=>g(x)},[s,u,g]),o.useEffect(()=>(n(!0),()=>n(!1)),[]),e.jsxs("div",{className:"badge-wrapper calc-wrapper mt-n2",children:[e.jsxs(ne,{gap:1,children:[e.jsx(v,{overflow:"hidden",className:"size-list-badges mt-1",children:e.jsx(Pe,{gap:1,columnCount:5,children:t&&t.length>0&&t.map((x,I)=>l(x)?null:e.jsx(xd,{badgeCode:x},I))})}),e.jsx(v,{className:"justify-content-between size-badges position-absolute end-2 mt-n4",overflow:"auto",children:e.jsxs(v,{overflow:"hidden",children:[e.jsx(N,{center:!0,bold:!0,children:d("inventory.badges.activebadges")}),e.jsx(Pe,{gap:1,columnCount:5,children:r&&r.length>0&&r.map((x,I)=>e.jsx(xd,{badgeCode:x},I))})]})})]}),e.jsx(v,{gap:0,position:"absolute",className:"bottom-2",style:{width:"96%"},children:!!i&&e.jsxs(w,{className:"bg-white pb-1 px-2 rounded mt-2",style:{height:"50px"},justifyContent:"between",alignItems:"end",gap:2,children:[e.jsxs(w,{alignItems:"start",gap:2,children:[e.jsx(mt,{shrink:!0,badgeCode:i}),e.jsx(N,{className:"font-bold mt-2",children:fi(i)})]}),e.jsx(P,{className:"btn btn-primary mb-1",style:{fontSize:"12px"},disabled:!l(i)&&!c(),onClick:x=>m(i),children:d(l(i)?"inventory.badges.clearbadge":"inventory.badges.wearbadge")})]})})]})},zc=a=>{const{title:t="",desc:s="",isTrading:n=!1,children:r=null,...i}=a;return e.jsxs(ne,{...i,children:[e.jsxs(v,{center:!0,size:5,overflow:"hidden",children:[e.jsx("div",{className:"empty-image"}),!n&&e.jsx(w,{gap:2,position:"absolute",className:"bottom-2",children:e.jsx(P,{className:"py-1",onClick:()=>Z("catalog/open"),children:d("inventory.open.catalog")})})]}),e.jsxs(v,{justifyContent:"center",size:7,overflow:"hidden",children:[e.jsx(N,{fontWeight:"bold",fontSize:5,overflow:"unset",truncate:!0,children:t}),e.jsx(N,{overflow:"auto",children:s})]}),r]})},YT=a=>{const{botItem:t=null,children:s=null,...n}=a,[r,i]=o.useState(!1),{selectedBot:l=null,setSelectedBot:c=null}=vh(),{isUnseen:m=null}=Os(),h=m(st.BOT,t.botData.id),u=g=>{switch(g.type){case be.MOUSE_DOWN:c(t),i(!0);return;case be.MOUSE_UP:i(!1);return;case be.ROLL_OUT:if(!r||l!==t)return;ec(t);return;case"dblclick":ec(t);return}};return e.jsxs(Ce,{itemActive:l===t,itemUnseen:h,onMouseDown:u,onMouseUp:u,onMouseOut:u,onDoubleClick:u,...n,children:[e.jsx(nt,{figure:t.botData.figure,direction:3,headOnly:!0}),s]})},$T=a=>{const{roomSession:t=null,roomPreviewer:s=null,isTrading:n=!1}=a,[r,i]=o.useState(!1),{botItems:l=[],selectedBot:c=null,activate:m=null,deactivate:h=null}=vh(),{isUnseen:u=null,removeUnseen:g=null}=Os();return o.useEffect(()=>{if(!c||!s)return;const f=c.botData,p=H();let x=p.getRoomInstanceVariable(p.activeRoomId,te.ROOM_WALL_TYPE),I=p.getRoomInstanceVariable(p.activeRoomId,te.ROOM_FLOOR_TYPE),j=p.getRoomInstanceVariable(p.activeRoomId,te.ROOM_LANDSCAPE_TYPE);x=x&&x.length?x:"101",I=I&&I.length?I:"101",j=j&&j.length?j:"1.1",s.reset(!1),s.updateRoomWallsAndFloorVisibility(!0,!0),s.updateObjectRoom(I,x,j),s.addAvatarIntoRoom(f.figure,0)},[s,c]),o.useEffect(()=>{!c||!u(st.BOT,c.botData.id)||g(st.BOT,c.botData.id)},[c,u,g]),o.useEffect(()=>{if(!r)return;const f=m();return()=>h(f)},[r,m,h]),o.useEffect(()=>(i(!0),()=>i(!1)),[]),!l||!l.length?e.jsx(zc,{title:d("inventory.empty.bots.title"),desc:d("inventory.empty.bots.desc"),isTrading:n}):e.jsxs(ne,{children:[e.jsx(v,{size:7,overflow:"hidden",children:e.jsx(Pe,{columnCount:5,children:l&&l.length>0&&l.map(f=>e.jsx(YT,{botItem:f},f.botData.id))})}),e.jsxs(v,{size:5,overflow:"auto",children:[e.jsx(v,{overflow:"hidden",position:"relative",children:e.jsx(Jo,{roomPreviewer:s,height:140})}),c&&e.jsxs(v,{grow:!0,justifyContent:"between",gap:2,children:[e.jsx(N,{grow:!0,truncate:!0,children:c.botData.name}),!!t&&e.jsx(P,{variant:"success",onClick:f=>ec(c),children:d("inventory.furni.placetoroom")})]})]})]})},KT=a=>{const{groupItem:t=null,isTrading:s=null,attemptItemOffer:n=null,setGroupItem:r=null,...i}=a,[l,c]=o.useState(!1),{selectedItem:m=null,setSelectedItem:h=null}=ur(),u=f=>{switch(f.type){case be.MOUSE_DOWN:h(t),c(!0);return;case be.MOUSE_UP:c(!1);return;case be.ROLL_OUT:if(!l||t!==m)return;s||mi(t);return;case"dblclick":s||mi(t),s&&(r(t),n(1));return}},g=t.getUnlockedCount();return e.jsx(Ce,{className:g?"inventory-items":"inventory-items opacity-0-5 ",itemImage:t.iconUrl,itemCount:t.getUnlockedCount(),itemActive:t===m,itemUniqueNumber:t.stuffData.uniqueNumber,itemUnseen:t.hasUnseenItems,onClick:f=>g&&r(t),onMouseDown:u,onMouseUp:u,onMouseOut:u,onDoubleClick:u,...i})},XT=a=>{const t=a.getLastItem();if(!t||!t.sellable)return!1;Ct(new po(t))},QT=a=>{const t=a.getLastItem();if(!t)return!1;Ct(new xo(t,a.getTotalCount()))},JT=a=>{const{roomSession:t=null,roomPreviewer:s=null,isTrading:n=null,filteredGroupItems:r=[]}=a,[i,l]=o.useState(!1),[c,m]=o.useState(null),[h,u]=o.useState(1),{groupItems:g=[],selectedItem:f=null,activate:p=null,deactivate:x=null}=ur(),{ownUser:I=null}=Fc(),{resetItems:j=null}=Os(),{simpleAlert:E=null}=Fe(),C=(L,k)=>{(isNaN(Number(L))||Number(L)<0||!L)&&(L=1),L=Math.max(Number(L),1),L=Math.min(Number(L),k),L!==h&&u(L)},b=L=>{C(h,L),S(h)},_=(L,k,R,y,O)=>{if(!I||I.accepts||!I.userItems)return!1;if(I.userItems.length{if(!c)return;const k=c.getTradeItems(L);if(!k||!k.length)return;let R=null;const y=[];for(const F of k)y.push(F.id),R||(R=F);if(I.userItems.length+y.length<=1500)if(!R.isGroupable&&y.length)D(new pu(y.pop()));else{const F=[];for(const V of y)_(R.isWallItem,R.type,R.category,R.isGroupable,R.stuffData)&&F.push(V);F.length&&(F.length===1?D(new pu(F.pop())):D(new db(...F)))}else E(d("trading.items.too_many_items.desc"),pe.DEFAULT,null,null,d("trading.items.too_many_items.title"));m(f)};if(o.useEffect(()=>{if(!f||!s)return;const L=f.getLastItem();if(!L)return;const k=H();let R=k.getRoomInstanceVariable(k.activeRoomId,te.ROOM_WALL_TYPE),y=k.getRoomInstanceVariable(k.activeRoomId,te.ROOM_FLOOR_TYPE),O=k.getRoomInstanceVariable(k.activeRoomId,te.ROOM_LANDSCAPE_TYPE);if(R=R&&R.length?R:"101",y=y&&y.length?y:"101",O=O&&O.length?O:"1.1",s.reset(!1),s.updateObjectRoom(y,R,O),s.updateRoomWallsAndFloorVisibility(!0,!0),L.category===de.WALL_PAPER||L.category===de.FLOOR||L.category===de.LANDSCAPE){if(y=L.category===de.FLOOR?f.stuffData.getLegacyString():y,R=L.category===de.WALL_PAPER?f.stuffData.getLegacyString():R,O=L.category===de.LANDSCAPE?f.stuffData.getLegacyString():O,s.updateObjectRoom(y,R,O),L.category===de.LANDSCAPE){const F=B().getWallItemDataByName("window_double_default");F&&s.addWallItemIntoRoom(F.id,new Ot(90,0,0),F.customParams)}}else f.isWallItem?s.addWallItemIntoRoom(f.type,new Ot(90),L.stuffData.getLegacyString()):s.addFurnitureIntoRoom(f.type,new Ot(90),f.stuffData,L.extra.toString());m(f)},[s,f]),o.useEffect(()=>{!f||!f.hasUnseenItems||(j(st.FURNI,f.items.map(L=>L.id)),f.hasUnseenItems=!1)},[f,j]),o.useEffect(()=>{if(!i)return;const L=p();return()=>x(L)},[i,p,x]),o.useEffect(()=>(l(!0),()=>l(!1)),[]),o.useEffect(()=>{u(1)},[r]),!g||!g.length)return e.jsx(zc,{title:d("inventory.empty.title"),desc:d("inventory.empty.desc"),isTrading:n});const T=n?f.getUnlockedCount():f.items.length;return e.jsxs(ne,{className:"mt-n1",children:[e.jsx(v,{size:7,overflow:"hidden",style:{height:`calc(100% - ${n?"5px":"34px"})`},children:e.jsx(Pe,{gap:1,columnCount:5,className:n?"trading-inventory":"",children:r&&r.length>0&&r.map((L,k)=>e.jsx(KT,{groupItem:L,isTrading:n,attemptItemOffer:R=>S(R),setGroupItem:R=>m(R)},k))})}),e.jsxs(v,{size:5,overflow:"auto",children:[e.jsxs(v,{overflow:"hidden",position:"relative",className:"cursor-pointer",children:[e.jsx(Jo,{roomPreviewer:s,height:140}),f&&e.jsx(P,{variant:"danger",className:"bottom-2 end-2",position:"absolute",onClick:L=>QT(f),children:e.jsx(ub,{className:"fa-icon"})}),f&&(f.items[0].isTradable||!f.items[0].isTradable)&&e.jsxs(w,{gap:2,position:"absolute",className:"top-2 start-2",children:[e.jsx(A,{className:`icon ${f.items[0].isTradable&&T>0?"icon-tradeable":"icon-not-tradeable"}`,title:d(f.items[0].isTradable&&T>0?"inventory.furni.preview.tradeable_amount":"inventory.furni.preview.not_tradeable")}),f.items[0].isTradable&&T>0&&e.jsx(N,{variant:"black",className:"text-shadow-around-text mt-n1",children:T})]}),f&&(f.items[0].recyclable||!f.items[0].recyclable)&&e.jsxs(w,{gap:2,position:"absolute",className:"top-4 start-2",children:[e.jsx(A,{className:`icon ${f.items[0].recyclable&&T>0?"icon-recyclable":"icon-not-recyclable"}`,title:d(f.items[0].recyclable&&T>0?"inventory.furni.preview.recyclable_amount":"inventory.furni.preview.not_recyclable")}),f.items[0].recyclable&&T>0&&e.jsx(N,{variant:"black",className:"text-shadow-around-text",children:T})]}),f&&f.stuffData.isUnique&&e.jsx(xh,{className:"top-2 end-2",position:"absolute",uniqueNumber:f.stuffData.uniqueNumber,uniqueSeries:f.stuffData.uniqueSeries}),f&&f.stuffData.rarityLevel>-1&&e.jsx(Uc,{className:"top-2 end-2",position:"absolute",level:f.stuffData.rarityLevel})]}),f&&e.jsx(v,{grow:!0,justifyContent:"between",gap:2,children:e.jsxs(v,{gap:1,position:n?"relative":"absolute",className:"bottom-1",style:{width:n?"":"39%"},children:[e.jsx(N,{grow:!0,truncate:!0,bold:!0,children:f.name}),f.description&&e.jsx(N,{grow:!0,truncate:!0,small:!0,children:f.description}),!n&&e.jsxs(e.Fragment,{children:[!!t&&e.jsx(P,{className:"p-0 px-2",onClick:L=>mi(f),children:d("inventory.furni.placetoroom")}),f&&f.isSellable&&e.jsx(P,{className:"p-0 px-2",onClick:L=>XT(f),children:d("inventory.marketplace.sell")})]}),n&&e.jsxs(v,{gap:1,alignItems:"start",children:[e.jsx("input",{type:"number",className:"quantity-input remove-outline form-control",placeholder:d("catalog.bundlewidget.spinner.select.amount"),disabled:f.getUnlockedCount()===0,value:h||"",onChange:L=>u(L.target.valueAsNumber)}),e.jsx(P,{variant:"secondary",disabled:!h||f.getUnlockedCount()===0,onClick:L=>h?b(f.getUnlockedCount()):null,children:d("inventory.trading.areoffering")})]})]})})]})]})},ZT=a=>{const{currentTab:t=null,setCurrentTab:s=null,cancelTrade:n=null}=a,[r,i]=o.useState(null),[l,c]=o.useState(null),[m,h]=o.useState(3),{ownUser:u=null,otherUser:g=null,tradeState:f=St.TRADING_STATE_READY,progressTrade:p=null,removeItem:x=null,setTradeState:I=null}=Fc(),j=C=>C?e.jsx(A,{className:"mt-auto mb-5 pb-5 icon icon-lock-locked"}):e.jsx(A,{className:"mt-auto mb-5 pb-5 icon icon-lock-open"}),E=C=>C.getValues().map(b=>{var _;return Number((_=b.iconUrl.split("/")[b.iconUrl.split("/").length-1])==null?void 0:_.split("_")[1])*b.items.length}).reduce((b,_)=>b+(isNaN(_)?0:_),0);return o.useEffect(()=>{if(f!==St.TRADING_STATE_COUNTDOWN)return;h(3);const C=window.setInterval(()=>{h(b=>{const _=b-1;return _===0&&clearInterval(C),_})},1e3);return()=>clearInterval(C)},[f,I]),o.useEffect(()=>{m===0&&I(St.TRADING_STATE_CONFIRMING)},[m,I]),f===St.TRADING_STATE_READY||!u||!g?null:e.jsx(v,{children:e.jsxs(v,{fullWidth:!0,size:12,overflow:"hidden",className:"trade-bg p-2 text-black",children:[t===_r&&e.jsxs(e.Fragment,{children:[e.jsx(N,{small:!0,children:d("inventory.trading.info.add")}),e.jsxs(ne,{gap:0,overflow:"hidden",className:"px-2",children:[e.jsxs(v,{size:4,overflow:"hidden",children:[e.jsxs(w,{children:[u.accepts&&e.jsx(A,{className:"icon icon-confirmed"}),e.jsxs("small",{className:u.accepts?"px-2":"",children:[e.jsx("b",{children:d("inventory.trading.you")})," ",d("inventory.trading.areoffering")]})]}),e.jsx(Pe,{columnCount:3,columnMinWidth:35,columnMinHeight:35,children:Array.from(Array(mc),(C,b)=>{const _=u.userItems.getWithIndex(b)||null;return _?e.jsx(Ce,{itemActive:r===_,itemImage:_.iconUrl,itemCount:_.getTotalCount(),itemUniqueNumber:_.stuffData.uniqueNumber,onClick:S=>i(_),onDoubleClick:S=>x(_),children:r===_&&e.jsx(A,{position:"absolute",onClick:S=>x(_)})},b):e.jsx(Ce,{},b)})}),e.jsxs(v,{gap:0,fullWidth:!0,children:[e.jsx("small",{children:d("inventory.trading.info.itemcount",["value"],[u.itemCount.toString()])}),e.jsx("small",{className:"credits-align",children:d("inventory.trading.info.creditvalue.own",["value"],[E(u.userItems).toString()])})]})]}),e.jsx(w,{className:"lock-design-left",children:j(u.accepts)}),e.jsx(w,{className:"divisor"}),e.jsxs(v,{size:4,overflow:"hidden",children:[e.jsxs(w,{children:[g.accepts&&e.jsx(A,{className:"icon icon-confirmed"}),e.jsxs("small",{className:g.accepts?"px-2":"",children:[e.jsx("b",{children:g.userName})," ",d("inventory.trading.isoffering")]})]}),e.jsx(Pe,{columnCount:3,columnMinWidth:35,columnMinHeight:35,children:Array.from(Array(mc),(C,b)=>{const _=g.userItems.getWithIndex(b)||null;return _?e.jsx(Ce,{itemActive:l===_,itemImage:_.iconUrl,itemCount:_.getTotalCount(),itemUniqueNumber:_.stuffData.uniqueNumber,onClick:S=>c(_)},b):e.jsx(Ce,{},b)})}),e.jsxs(v,{gap:0,fullWidth:!0,children:[e.jsx("small",{children:d("inventory.trading.info.itemcount",["value"],[g.itemCount.toString()])}),e.jsx("small",{children:d("inventory.trading.info.creditvalue",["value"],[E(g.userItems).toString()])})]})]}),e.jsx(w,{className:"lock-design-right",children:j(g.accepts)})]})]}),t!==_r&&e.jsx(e.Fragment,{children:e.jsxs(w,{className:"px-2",children:[e.jsx(A,{className:"flex-shrink-0 icon icon-report-room"}),e.jsx(N,{bold:!0,children:d("inventory.trading.minimized.trade_in_progress")})]})}),e.jsxs(w,{grow:!0,justifyContent:"between",children:[t===_r&&e.jsxs(e.Fragment,{children:[f===St.TRADING_STATE_READY&&e.jsx(P,{variant:"secondary",disabled:!u.itemCount&&!g.itemCount,onClick:p,children:d("inventory.trading.accept")}),f===St.TRADING_STATE_RUNNING&&e.jsx(P,{variant:"secondary",disabled:!u.itemCount&&!g.itemCount,onClick:p,children:d(u.accepts?"inventory.trading.modify":"inventory.trading.accept")}),f===St.TRADING_STATE_COUNTDOWN&&e.jsx(P,{variant:"secondary",disabled:!0,children:d("inventory.trading.countdown",["counter"],[m.toString()])}),f===St.TRADING_STATE_CONFIRMING&&e.jsx(P,{variant:"secondary",onClick:p,children:d("inventory.trading.button.restore")}),f===St.TRADING_STATE_CONFIRMED&&e.jsx(P,{variant:"secondary",children:d("inventory.trading.info.waiting")})]}),t!==_r&&e.jsx(P,{variant:"secondary",onClick:()=>s(dc[0]),children:d("inventory.trading.minimized.continue_trade")}),e.jsx(P,{variant:"danger",onClick:n,children:d("generic.cancel")})]})]})})},ey=a=>{const{petItem:t=null,children:s=null,...n}=a,[r,i]=o.useState(!1),{selectedPet:l=null,setSelectedPet:c=null}=_h(),{isUnseen:m}=Os(),h=m(st.PET,t.petData.id),u=g=>{switch(g.type){case be.MOUSE_DOWN:c(t),i(!0);return;case be.MOUSE_UP:i(!1);return;case be.ROLL_OUT:if(!r||t!==l)return;Zl(t);return;case"dblclick":Zl(t);return}};return e.jsxs(Ce,{itemActive:t===l,itemUnseen:h,onMouseDown:u,onMouseUp:u,onMouseOut:u,onDoubleClick:u,...n,children:[e.jsx(xn,{figure:t.petData.figureData.figuredata,direction:3,headOnly:!0}),s]})},ty=a=>{const{roomSession:t=null,roomPreviewer:s=null,isTrading:n=!1}=a,[r,i]=o.useState(!1),{petItems:l=null,selectedPet:c=null,activate:m=null,deactivate:h=null}=_h(),{isUnseen:u=null,removeUnseen:g=null}=Os();return o.useEffect(()=>{if(!c||!s)return;const f=c.petData,p=H();let x=p.getRoomInstanceVariable(p.activeRoomId,te.ROOM_WALL_TYPE),I=p.getRoomInstanceVariable(p.activeRoomId,te.ROOM_FLOOR_TYPE),j=p.getRoomInstanceVariable(p.activeRoomId,te.ROOM_LANDSCAPE_TYPE);x=x&&x.length?x:"101",I=I&&I.length?I:"101",j=j&&j.length?j:"1.1",s.reset(!1),s.updateRoomWallsAndFloorVisibility(!0,!0),s.updateObjectRoom(I,x,j),s.addPetIntoRoom(f.figureString)},[s,c]),o.useEffect(()=>{!c||!u(st.PET,c.petData.id)||g(st.PET,c.petData.id)},[c,u,g]),o.useEffect(()=>{if(!r)return;const f=m();return()=>h(f)},[r,m,h]),o.useEffect(()=>(i(!0),()=>i(!1)),[]),!l||!l.length?e.jsx(zc,{title:d("inventory.empty.pets.title"),desc:d("inventory.empty.pets.desc"),isTrading:n}):e.jsxs(ne,{children:[e.jsx(v,{size:7,overflow:"hidden",children:e.jsx(Pe,{columnCount:5,children:l&&l.length>0&&l.map(f=>e.jsx(ey,{petItem:f},f.petData.id))})}),e.jsxs(v,{size:5,overflow:"auto",children:[e.jsx(v,{overflow:"hidden",position:"relative",children:e.jsx(Jo,{roomPreviewer:s,height:140})}),c&&c.petData&&e.jsxs(v,{grow:!0,justifyContent:"between",gap:2,children:[e.jsx(N,{grow:!0,truncate:!0,children:c.petData.name}),!!t&&e.jsx(P,{variant:"success",onClick:f=>Zl(c),children:d("inventory.furni.placetoroom")})]})]})]})},sy=a=>{const[t,s]=o.useState(null),[n,r]=o.useState(1),[i,l]=o.useState("1"),[c,m]=o.useState(1),h=x=>{let I=parseInt(x);isNaN(I)||I===n||(I=Math.max(I,1),I=Math.min(I,c),I!==n&&(l(I.toString()),r(I)))},{showConfirm:u=null}=Fe();if(ot(xo.DELETE_ITEM_CONFIRM,x=>{s(x.item),m(x.amount)}),!t)return null;const g=t?d(t.isWallItem?"wallItem.name."+t.type:"roomItem.name."+t.type):"",f=t?d(t.isWallItem?"wallItem.desc."+t.type:"roomItem.desc."+t.type):"",p=()=>{t&&u(d("inventory.delete.confirm_delete.info",["furniname","amount"],[g,n.toString()]),()=>{D(new mb(t.id,n)),s(null),r(1),m(1),l("1")},()=>{s(null),r(1),m(1),l("1")},null,null,d("inventory.delete.confirm_delete.title"))};return e.jsxs(ie,{className:"nitro-catalog-layout-marketplace-post-offer",theme:"primary-slim",children:[e.jsx(re,{headerText:d("inventory.delete.confirm_delete.title"),onCloseClick:x=>{s(null),r(1),m(1),l("1")}}),e.jsx(se,{overflow:"hidden",children:e.jsxs(ne,{fullHeight:!0,children:[e.jsx(v,{center:!0,className:"bg-muted rounded p-2",size:4,overflow:"hidden",children:e.jsx(Qo,{productType:t.isWallItem?fe.WALL:fe.FLOOR,productClassId:t.type,extraData:t.extra.toString()})}),e.jsxs(v,{size:8,justifyContent:"between",overflow:"hidden",children:[e.jsxs(v,{grow:!0,gap:1,children:[e.jsx(N,{fontWeight:"bold",children:g}),e.jsx(N,{truncate:!0,shrink:!0,children:f})]}),e.jsxs(v,{overflow:"auto",children:[e.jsx(N,{children:d("inventory.delete.amount")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(Ic,{className:"text-black cursor-pointer fa-icon",onClick:x=>h((n-1).toString())}),e.jsx("input",{className:"form-control form-control-sm quantity-input",type:"number",min:1,max:c,value:i,onChange:x=>h(x.target.value),placeholder:d("inventory.delete.amount")}),e.jsx(bc,{className:"text-black cursor-pointer fa-icon",onClick:x=>h((n+1).toString())}),e.jsx(P,{onClick:x=>h(c.toString()),children:d("inventory.delete.max_amount.button")})]}),e.jsx(P,{disabled:n>c,onClick:p,children:d("inventory.delete.confirm_delete.button")})]})]})]})})]})},ny=a=>{const[t,s]=o.useState(!1),[n,r]=o.useState(dc[0]),[i,l]=o.useState(null),[c,m]=o.useState(null),[h,u]=o.useState([]),[g,f]=o.useState([]),{isTrading:p=!1,stopTrading:x=null}=Fc(),{getCount:I=null}=Os(),{groupItems:j=[]}=ur(),{badgeCodes:E=[]}=ga(),C=()=>{p&&x(),s(!1)};return ve(bt.PLACED,b=>{KC()&&(la(!1),b.placedInRoom||s(!0))}),He([Pt.CREATED,Pt.ENDED],b=>{switch(b.type){case Pt.CREATED:l(b.session);return;case Pt.ENDED:l(null),s(!1);return}}),M(hb,b=>{const _=b.getParser();for(const S of _.data)Jm().setBadgePointLimit(S.badgeId,S.limit)}),o.useEffect(()=>{const b={linkReceived:_=>{const S=_.split("/");if(!(S.length<2))switch(S[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(T=>!T);return}},eventUrlPrefix:"inventory/"};return ht(b),()=>gt(b)},[]),o.useEffect(()=>(m(new so(H(),++so.PREVIEW_COUNTER)),()=>{m(b=>(b.dispose(),null))}),[]),o.useEffect(()=>{!t&&p&&s(!0)},[t,p]),t?e.jsxs(ie,{uniqueKey:"inventory",className:`${p?"nitro-inventory trading no-resize":"nitro-inventory"}`,theme:p?"primary":"",children:[e.jsx(re,{headerText:d("inventory.title"),onCloseClick:C}),e.jsxs(e.Fragment,{children:[e.jsx(Tn,{children:dc.map((b,_)=>e.jsx(tn,{isActive:n===b,onClick:S=>r(b),count:I(WT[_]),children:d(b)},_))}),e.jsxs(se,{overflow:"hidden",children:[n!==uc&&n!==cc&&e.jsx(qT,{currentTab:n,groupItems:j,setGroupItems:u,badgeCodes:E,setBadgeCodes:f}),n===_r&&e.jsx(JT,{roomSession:i,roomPreviewer:c,isTrading:p,filteredGroupItems:h}),n===uc&&e.jsx(ty,{roomSession:i,roomPreviewer:c,isTrading:p}),n===wi&&e.jsx(zT,{filteredBadgeCodes:g}),n===cc&&e.jsx($T,{roomSession:i,roomPreviewer:c,isTrading:p}),p&&e.jsx(ZT,{currentTab:n,setCurrentTab:b=>r(b),cancelTrade:C})]}),e.jsx(sy,{})]})]}):null},Yc=a=>{const{records:t=null}=a,{openRoomInfo:s=null}=pi(),n=o.useMemo(()=>{const i=[];return t.forEach(l=>{i.push({isRoomInfo:!0,roomId:l.roomId,roomName:l.roomName}),l.chatlog.forEach(c=>{i.push({timestamp:c.timestamp,habboId:c.userId,username:c.userName,hasHighlighting:c.hasHighlighting,message:c.message,isRoomInfo:!1})})}),i},[t]),r=i=>e.jsxs(w,{gap:2,alignItems:"center",justifyContent:"between",className:"bg-muted rounded p-1",children:[e.jsxs(w,{gap:1,children:[e.jsx(N,{bold:!0,children:"Room name:"}),e.jsx(N,{children:i.roomName})]}),e.jsxs(w,{gap:1,children:[e.jsx(P,{onClick:l=>is(i.roomId),children:"Visit Room"}),e.jsx(P,{onClick:l=>s(i.roomId),children:"Room Tools"})]})]});return e.jsx(e.Fragment,{children:e.jsxs(v,{fit:!0,gap:0,overflow:"hidden",children:[e.jsx(v,{gap:2,children:e.jsxs(ne,{gap:1,className:"text-black fw-bold border-bottom pb-1",children:[e.jsx(A,{className:"g-col-2",children:"Time"}),e.jsx(A,{className:"g-col-3",children:"User"}),e.jsx(A,{className:"g-col-7",children:"Message"})]})}),t&&t.length>0&&e.jsx(nl,{rows:n,rowRender:i=>e.jsxs(e.Fragment,{children:[i.isRoomInfo&&e.jsx(r,{roomId:i.roomId,roomName:i.roomName}),!i.isRoomInfo&&e.jsxs(ne,{fullHeight:!1,gap:1,alignItems:"center",className:"log-entry py-1 border-bottom",children:[e.jsx(N,{className:"g-col-2",children:i.timestamp}),e.jsx(N,{className:"g-col-3",bold:!0,underline:!0,pointer:!0,onClick:l=>Z(`mod-tools/open-user-info/${i.habboId}`),children:i.username}),e.jsx(N,{textBreak:!0,wrap:!0,className:"g-col-7",children:i.message})]})]})})]})})},ry=a=>{const{roomId:t=null,onCloseClick:s=null}=a,[n,r]=o.useState(null);return M(gb,i=>{const l=i.getParser();!l||l.data.roomId!==t||r(l.data)}),o.useEffect(()=>{D(new fb(t))},[t]),n?e.jsxs(ie,{className:"nitro-mod-tools-chatlog",theme:"primary-slim",windowPosition:Tt.TOP_LEFT,children:[e.jsx(re,{headerText:`Room Chatlog ${n.roomName}`,onCloseClick:s}),e.jsx(se,{className:"text-black",overflow:"hidden",children:n&&e.jsx(Yc,{records:[n]})})]}):null},iy=a=>{const{roomId:t=null,onCloseClick:s=null}=a,[n,r]=o.useState(!1),[i,l]=o.useState(null),[c,m]=o.useState(null),[h,u]=o.useState(null),[g,f]=o.useState(null),[p,x]=o.useState(!1),[I,j]=o.useState(0),[E,C]=o.useState(!1),[b,_]=o.useState(!1),[S,T]=o.useState(!1),[L,k]=o.useState(""),R=(y,O)=>{if(y)switch(y){case"alert_only":if(L.trim().length===0)return;D(new Na(Na.ACTION_ALERT,L,"")),D(new xu(t,b?1:0,S?1:0,E?1:0));return;case"send_message":if(L.trim().length===0)return;D(new Na(Na.ACTION_MESSAGE,L,"")),D(new xu(t,b?1:0,S?1:0,E?1:0));return}};return M(pb,y=>{const O=y.getParser();!O||O.data.flatId!==t||(l(O.data.flatId),m(O.data.room.name),u(O.data.ownerId),f(O.data.ownerName),x(O.data.ownerInRoom),j(O.data.userCount))}),o.useEffect(()=>{n||(D(new xb(t)),r(!0))},[t,n,r]),e.jsxs(ie,{className:"nitro-mod-tools-room",theme:"primary-slim",windowPosition:Tt.TOP_LEFT,children:[e.jsx(re,{headerText:"Room Info"+(c?": "+c:""),onCloseClick:y=>s()}),e.jsxs(se,{className:"text-black",children:[e.jsxs(w,{gap:2,children:[e.jsxs(v,{justifyContent:"center",grow:!0,gap:1,children:[e.jsxs(w,{alignItems:"center",gap:2,children:[e.jsx(N,{bold:!0,align:"end",className:"col-7",children:"Room Owner:"}),e.jsx(N,{underline:!0,pointer:!0,truncate:!0,children:g})]}),e.jsxs(w,{alignItems:"center",gap:2,children:[e.jsx(N,{bold:!0,align:"end",className:"col-7",children:"Users in room:"}),e.jsx(N,{children:I})]}),e.jsxs(w,{alignItems:"center",gap:2,children:[e.jsx(N,{bold:!0,align:"end",className:"col-7",children:"Owner in room:"}),e.jsx(N,{children:p?"Yes":"No"})]})]}),e.jsxs(v,{gap:1,children:[e.jsx(P,{onClick:y=>is(t),children:"Visit Room"}),e.jsx(P,{onClick:y=>Z(`mod-tools/open-room-chatlog/${t}`),children:"Chatlog"})]})]}),e.jsxs(v,{className:"bg-muted rounded p-2",gap:1,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:E,onChange:y=>C(y.target.checked)}),e.jsx(N,{small:!0,children:"Kick everyone out"})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:b,onChange:y=>_(y.target.checked)}),e.jsx(N,{small:!0,children:"Enable the doorbell"})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:S,onChange:y=>T(y.target.checked)}),e.jsx(N,{small:!0,children:"Change room name"})]})]}),e.jsx("textarea",{className:"form-control",placeholder:"Type a mandatory message to the users in this text box...",value:L,onChange:y=>k(y.target.value)}),e.jsxs(w,{justifyContent:"between",children:[e.jsx(P,{variant:"danger",onClick:y=>R("send_message"),children:"Send Caution"}),e.jsx(P,{onClick:y=>R("alert_only"),children:"Send Alert only"})]})]})]})},ay=a=>{const{onCloseClick:t=null,issueId:s=null}=a,[n,r]=o.useState(null);return M(jb,i=>{const l=i.getParser();!l||l.data.issueId!==s||r(l.data)}),o.useEffect(()=>{D(new Ib(s))},[s]),e.jsxs(ie,{className:"nitro-mod-tools-chatlog",theme:"primary-slim",children:[e.jsx(re,{headerText:"Issue Chatlog",onCloseClick:t}),e.jsx(se,{className:"text-black",children:n&&e.jsx(Yc,{records:[n.chatRecord]})})]})},oy=a=>{const{issueId:t=null,onIssueInfoClosed:s=null}=a,[n,r]=o.useState(!1),{tickets:i=[],openUserInfo:l=null}=pi(),c=i.find(u=>u.issueId===t),m=u=>{D(new Fm([u])),s(u)},h=u=>{D(new va([t],u)),s(t)};return e.jsxs(e.Fragment,{children:[e.jsxs(ie,{className:"nitro-mod-tools-handle-issue",theme:"primary-slim",children:[e.jsx(re,{headerText:"Resolving issue "+t,onCloseClick:()=>s(t)}),e.jsxs(se,{className:"text-black",children:[e.jsx(N,{fontSize:4,children:"Issue Information"}),e.jsxs(ne,{overflow:"auto",children:[e.jsx(v,{size:8,children:e.jsx("table",{className:"table table-striped table-sm table-text-small text-black m-0",children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("th",{children:"Source"}),e.jsx("td",{children:IN(c.categoryId)})]}),e.jsxs("tr",{children:[e.jsx("th",{children:"Category"}),e.jsx("td",{className:"text-break",children:d("help.cfh.topic."+c.reportedCategoryId)})]}),e.jsxs("tr",{children:[e.jsx("th",{children:"Description"}),e.jsx("td",{className:"text-break",children:c.message})]}),e.jsxs("tr",{children:[e.jsx("th",{children:"Caller"}),e.jsx("td",{children:e.jsx(N,{bold:!0,underline:!0,pointer:!0,onClick:u=>l(c.reporterUserId),children:c.reporterUserName})})]}),e.jsxs("tr",{children:[e.jsx("th",{children:"Reported User"}),e.jsx("td",{children:e.jsx(N,{bold:!0,underline:!0,pointer:!0,onClick:u=>l(c.reportedUserId),children:c.reportedUserName})})]})]})})}),e.jsxs(v,{size:4,gap:1,children:[e.jsx(P,{variant:"secondary",onClick:()=>r(!n),children:"Chatlog"}),e.jsx(P,{onClick:u=>h(va.RESOLUTION_USELESS),children:"Close as useless"}),e.jsx(P,{variant:"danger",onClick:u=>h(va.RESOLUTION_ABUSIVE),children:"Close as abusive"}),e.jsx(P,{variant:"success",onClick:u=>h(va.RESOLUTION_RESOLVED),children:"Close as resolved"}),e.jsx(P,{variant:"secondary",onClick:u=>m(t),children:"Release"})]})]})]})]}),n&&e.jsx(ay,{issueId:t,onCloseClick:()=>r(!1)})]})},ly=a=>{const{myIssues:t=null,handleIssue:s=null}=a;return e.jsxs(v,{gap:0,overflow:"hidden",children:[e.jsx(v,{gap:2,children:e.jsxs(ne,{gap:1,className:"text-black fw-bold border-bottom pb-1",children:[e.jsx(A,{className:"g-col-2",children:"Type"}),e.jsx(A,{className:"g-col-3",children:"Room/Player"}),e.jsx(A,{className:"g-col-3",children:"Opened"}),e.jsx(A,{className:"g-col-2"}),e.jsx(A,{className:"g-col-2"})]})}),e.jsx(v,{overflow:"auto",className:"striped-children",gap:0,children:t&&t.length>0&&t.map(n=>e.jsxs(ne,{gap:1,alignItems:"center",className:"text-black py-1 border-bottom",children:[e.jsx(A,{className:"g-col-2",children:n.categoryId}),e.jsx(A,{className:"g-col-3",children:n.reportedUserName}),e.jsx(A,{className:"g-col-3",children:new Date(Date.now()-n.issueAgeInMilliseconds).toLocaleTimeString()}),e.jsx(A,{className:"g-col-2",children:e.jsx(P,{variant:"primary",onClick:r=>s(n.issueId),children:"Handle"})}),e.jsx(A,{className:"g-col-2",children:e.jsx(P,{variant:"danger",onClick:r=>D(new Fm([n.issueId])),children:"Release"})})]},n.issueId))})]})},cy=a=>{const{openIssues:t=null}=a;return e.jsxs(v,{gap:0,overflow:"hidden",children:[e.jsx(v,{gap:2,children:e.jsxs(ne,{gap:1,className:"text-black fw-bold border-bottom pb-1",children:[e.jsx(A,{className:"g-col-2",children:"Type"}),e.jsx(A,{className:"g-col-3",children:"Room/Player"}),e.jsx(A,{className:"g-col-4",children:"Opened"}),e.jsx(A,{className:"g-col-3"})]})}),e.jsx(v,{overflow:"auto",className:"striped-children",gap:0,children:t&&t.length>0&&t.map(s=>e.jsxs(ne,{gap:1,alignItems:"center",className:"text-black py-1 border-bottom",children:[e.jsx(A,{className:"g-col-2",children:s.categoryId}),e.jsx(A,{className:"g-col-3",children:s.reportedUserName}),e.jsx(A,{className:"g-col-4",children:new Date(Date.now()-s.issueAgeInMilliseconds).toLocaleTimeString()}),e.jsx(A,{className:"g-col-3",children:e.jsx(P,{variant:"success",onClick:n=>D(new bb([s.issueId],!1,0,"pick issue button")),children:"Pick Issue"})})]},s.issueId))})]})},uy=a=>{const{pickedIssues:t=null}=a;return e.jsxs(v,{gap:0,overflow:"hidden",children:[e.jsx(v,{gap:2,children:e.jsxs(ne,{gap:1,className:"text-black fw-bold border-bottom pb-1",children:[e.jsx(A,{className:"g-col-2",children:"Type"}),e.jsx(A,{className:"g-col-3",children:"Room/Player"}),e.jsx(A,{className:"g-col-4",children:"Opened"}),e.jsx(A,{className:"g-col-3",children:"Picker"})]})}),e.jsx(v,{overflow:"auto",className:"striped-children",gap:0,children:t&&t.length>0&&t.map(s=>e.jsxs(ne,{gap:1,alignItems:"center",className:"text-black py-1 border-bottom",children:[e.jsx(A,{className:"g-col-2",children:s.categoryId}),e.jsx(A,{className:"g-col-3",children:s.reportedUserName}),e.jsx(A,{className:"g-col-4",children:new Date(Date.now()-s.issueAgeInMilliseconds).toLocaleTimeString()}),e.jsx(A,{className:"g-col-3",children:s.pickerUserName})]},s.issueId))})]})},dy=["Open Issues","My Issues","Picked Issues"],my=a=>{const{onCloseClick:t=null}=a,[s,n]=o.useState(0),[r,i]=o.useState([]),{tickets:l=[]}=pi(),c=l.filter(p=>p.state===pl.STATE_OPEN),m=l.filter(p=>p.state===pl.STATE_PICKED&&p.pickerUserId===B().userId),h=l.filter(p=>p.state===pl.STATE_PICKED),u=p=>{i(x=>{const I=[...x],j=I.indexOf(p);return j>=0&&I.splice(j,1),I})},g=p=>{i(x=>{const I=[...x],j=I.indexOf(p);return j===-1?I.push(p):I.splice(j,1),I})},f=()=>{switch(s){case 0:return e.jsx(cy,{openIssues:c});case 1:return e.jsx(ly,{myIssues:m,handleIssue:g});case 2:return e.jsx(uy,{pickedIssues:h})}return null};return e.jsxs(e.Fragment,{children:[e.jsxs(ie,{className:"nitro-mod-tools-tickets",children:[e.jsx(re,{headerText:"Tickets",onCloseClick:t}),e.jsx(Tn,{children:dy.map((p,x)=>e.jsx(tn,{isActive:s===x,onClick:I=>n(x),children:p},x))}),e.jsx(se,{gap:1,children:e.jsx(f,{})})]}),r&&r.length>0&&r.map(p=>e.jsx(oy,{issueId:p,onIssueInfoClosed:u},p))]})},hy=a=>{const{userId:t=null,onCloseClick:s=null}=a,[n,r]=o.useState(null),[i,l]=o.useState(null);return M(Eb,c=>{const m=c.getParser();!m||m.data.userId!==t||(l(m.data.username),r(m.data.roomChatlogs))}),o.useEffect(()=>{D(new Cb(t))},[t]),e.jsxs(ie,{className:"nitro-mod-tools-chatlog",theme:"primary-slim",windowPosition:Tt.TOP_LEFT,children:[e.jsx(re,{headerText:`User Chatlog: ${i||""}`,onCloseClick:s}),e.jsx(se,{className:"text-black h-100",children:n&&e.jsx(Yc,{records:n})})]})},jd=[new Ge(1,"Alert",Ge.ALERT,1,0),new Ge(2,"Mute 1h",Ge.MUTE,2,0),new Ge(3,"Ban 18h",Ge.BAN,3,0),new Ge(4,"Ban 7 days",Ge.BAN,4,0),new Ge(5,"Ban 30 days (step 1)",Ge.BAN,5,0),new Ge(7,"Ban 30 days (step 2)",Ge.BAN,7,0),new Ge(6,"Ban 100 years",Ge.BAN,6,0),new Ge(106,"Ban avatar-only 100 years",Ge.BAN,6,0),new Ge(101,"Kick",Ge.KICK,0,0),new Ge(102,"Lock trade 1 week",Ge.TRADE_LOCK,0,168),new Ge(104,"Lock trade permanent",Ge.TRADE_LOCK,0,876e3),new Ge(105,"Message",Ge.MESSAGE,0,0)],gy=a=>{const{user:t=null,onCloseClick:s=null}=a,[n,r]=o.useState(-1),[i,l]=o.useState(-1),[c,m]=o.useState(""),{cfhCategories:h=null,settings:u=null}=pi(),{simpleAlert:g=null}=Fe(),f=o.useMemo(()=>{const j=[];if(h&&h.length)for(const E of h)for(const C of E.topics)j.push(C);return j},[h]),p=j=>g(j,pe.DEFAULT,null,null,"Error"),x=()=>{let j=null;const E=f[n];if(n===-1&&(j="You must select a CFH topic"),j)return p(j);const C=c.trim().length===0?d(`help.cfh.topic.${E.id}`):c;D(new Nb(t.userId,n,C)),s()},I=()=>{let j=null;const E=f[n],C=jd[i];if(n===-1||i===-1?j="You must select a CFH topic and Sanction":!u||!u.cfhPermission?j="You do not have permission to do this":E?C||(j="You must select a sanction"):j="You must select a CFH topic",j){p(j);return}const b=c.trim().length===0?d(`help.cfh.topic.${E.id}`):c;switch(C.actionType){case Ge.ALERT:{if(!u.alertPermission){p("You have insufficient permissions");return}D(new Tb(t.userId,b,E.id));break}case Ge.MUTE:D(new wb(t.userId,b,E.id));break;case Ge.BAN:{if(!u.banPermission){p("You have insufficient permissions");return}D(new Sb(t.userId,b,E.id,i,C.actionId===106));break}case Ge.KICK:{if(!u.kickPermission){p("You have insufficient permissions");return}D(new _b(t.userId,b,E.id));break}case Ge.TRADE_LOCK:{const _=C.actionLengthHours*60;D(new vb(t.userId,b,_,E.id));break}case Ge.MESSAGE:{if(c.trim().length===0){p("Please write a message to user");return}D(new Vm(t.userId,c,E.id));break}}s()};return t?e.jsxs(ie,{className:"nitro-mod-tools-user-action",theme:"primary-slim",windowPosition:Tt.TOP_LEFT,children:[e.jsx(re,{headerText:"Mod Action: "+(t?t.username:""),onCloseClick:()=>s()}),e.jsxs(se,{className:"text-black",children:[e.jsxs("select",{className:"form-select form-select-sm",value:n,onChange:j=>r(parseInt(j.target.value)),children:[e.jsx("option",{value:-1,disabled:!0,children:"CFH Topic"}),f.map((j,E)=>e.jsx("option",{value:E,children:d("help.cfh.topic."+j.id)},E))]}),e.jsxs("select",{className:"form-select form-select-sm",value:i,onChange:j=>l(parseInt(j.target.value)),children:[e.jsx("option",{value:-1,disabled:!0,children:"Sanction Type"}),jd.map((j,E)=>e.jsx("option",{value:E,children:j.name},E))]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{small:!0,children:"Optional message type, overrides default"}),e.jsx("textarea",{className:"form-control",value:c,onChange:j=>m(j.target.value)})]}),e.jsxs(w,{justifyContent:"between",gap:1,children:[e.jsx(P,{variant:"primary",onClick:x,children:"Default Sanction"}),e.jsx(P,{variant:"success",onClick:I,children:"Sanction"})]})]})]}):null},fy=a=>{const{userId:t=null,onCloseClick:s=null}=a,[n,r]=o.useState(null);return M(yb,i=>{const l=i.getParser();l.data.userId===t&&r(l.data)}),o.useEffect(()=>{D(new Rb(t))},[t]),t?e.jsxs(ie,{className:"nitro-mod-tools-user-visits",theme:"primary-slim",windowPosition:Tt.TOP_LEFT,children:[e.jsx(re,{headerText:"User Visits",onCloseClick:s}),e.jsx(se,{className:"text-black",gap:1,children:e.jsxs(v,{fullHeight:!0,gap:0,overflow:"hidden",children:[e.jsx(v,{gap:2,children:e.jsxs(ne,{gap:1,className:"text-black fw-bold border-bottom pb-1",children:[e.jsx(A,{className:"g-col-2",children:"Time"}),e.jsx(A,{className:"g-col-7",children:"Room name"}),e.jsx(A,{className:"g-col-3",children:"Visit"})]})}),e.jsx(nl,{rows:(n==null?void 0:n.rooms)??[],rowRender:i=>e.jsxs(ne,{fullHeight:!1,gap:1,alignItems:"center",className:"text-black py-1 border-bottom",children:[e.jsxs(N,{className:"g-col-2",children:[i.enterHour.toString().padStart(2,"0"),": ",i.enterMinute.toString().padStart(2,"0")]}),e.jsx(N,{className:"g-col-7",children:i.roomName}),e.jsx(N,{bold:!0,underline:!0,pointer:!0,variant:"primary",className:"g-col-3",onClick:l=>is(i.roomId),children:"Visit Room"})]})})]})})]}):null},py=a=>{const{user:t=null,onCloseClick:s=null}=a,[n,r]=o.useState(""),{simpleAlert:i=null}=Fe();if(!t)return null;const l=()=>{if(n.trim().length===0){i("Please write a message to user.",null,null,null,"Error",null);return}D(new Vm(t.userId,n,-999)),s()};return e.jsxs(ie,{className:"nitro-mod-tools-user-message",theme:"primary-slim",windowPosition:Tt.TOP_LEFT,children:[e.jsx(re,{headerText:"Send Message",onCloseClick:()=>s()}),e.jsxs(se,{className:"text-black",children:[e.jsxs(N,{children:["Message To: ",t.username]}),e.jsx("textarea",{className:"form-control",value:n,onChange:c=>r(c.target.value)}),e.jsx(P,{fullWidth:!0,onClick:l,children:"Send message"})]})]})},xy=a=>{const{onCloseClick:t=null,userId:s=null}=a,[n,r]=o.useState(null),[i,l]=o.useState(!1),[c,m]=o.useState(!1),[h,u]=o.useState(!1),g=o.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:Zs.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:Zs.format(n.registrationAgeInMinutes*60,".ago",2)},{localeKey:"modtools.userinfo.userClassification",value:n.userClassification}]:null,[n]);return M(Ob,f=>{const p=f.getParser();!p||p.data.userId!==s||r(p.data)}),o.useEffect(()=>{D(new kb(s))},[s]),n?e.jsxs(e.Fragment,{children:[e.jsxs(ie,{className:"nitro-mod-tools-user",theme:"primary-slim",windowPosition:Tt.TOP_LEFT,children:[e.jsx(re,{headerText:d("modtools.userinfo.title",["username"],[n.userName]),onCloseClick:()=>t()}),e.jsx(se,{className:"text-black",children:e.jsxs(ne,{overflow:"hidden",children:[e.jsx(v,{size:8,overflow:"auto",children:e.jsx("table",{className:"table table-striped table-sm table-text-small text-black m-0",children:e.jsx("tbody",{children:g.map((f,p)=>e.jsxs("tr",{children:[e.jsx("th",{scope:"row",children:d(f.localeKey)}),e.jsxs("td",{children:[f.value,f.showOnline&&e.jsx("i",{className:`icon icon-pf-${n.online?"online":"offline"} ms-2`})]})]},p))})})}),e.jsxs(v,{size:4,gap:1,children:[e.jsx(P,{onClick:f=>Z(`mod-tools/open-user-chatlog/${s}`),children:"Room Chat"}),e.jsx(P,{onClick:f=>l(!i),children:"Send Message"}),e.jsx(P,{onClick:f=>u(!h),children:"Room Visits"}),e.jsx(P,{onClick:f=>m(!c),children:"Mod Action"})]})]})})]}),i&&e.jsx(py,{user:{userId:s,username:n.userName},onCloseClick:()=>l(!1)}),c&&e.jsx(gy,{user:{userId:s,username:n.userName},onCloseClick:()=>m(!1)}),h&&e.jsx(fy,{userId:s,onCloseClick:()=>u(!1)})]}):null},jy=a=>{const[t,s]=o.useState(!1),[n,r]=o.useState(-1),[i,l]=o.useState(null),[c,m]=o.useState(!1),{openRooms:h=[],openRoomChatlogs:u=[],openUserChatlogs:g=[],openUserInfos:f=[],openRoomInfo:p=null,closeRoomInfo:x=null,toggleRoomInfo:I=null,openRoomChatlog:j=null,closeRoomChatlog:E=null,toggleRoomChatlog:C=null,openUserInfo:b=null,closeUserInfo:_=null,toggleUserInfo:S=null,openUserChatlog:T=null,closeUserChatlog:L=null,toggleUserChatlog:k=null}=pi(),R=o.useRef(null);return ve([ys.INITIALIZED,ys.DISPOSED],y=>{if(!Er.isRoomPreviewerId(y.roomId))switch(y.type){case ys.INITIALIZED:r(y.roomId);return;case ys.DISPOSED:r(-1);return}}),Vc(y=>{if(y.category!==X.UNIT)return;const O=ye();if(!O)return;const F=O.userDataManager.getUserDataByIndex(y.id);!F||F.type!==dt.USER||l({userId:F.webID,username:F.name})}),o.useEffect(()=>{const y={linkReceived:O=>{const F=O.split("/");if(!(F.length<2))switch(F[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(V=>!V);return;case"open-room-info":p(Number(F[2]));return;case"close-room-info":x(Number(F[2]));return;case"toggle-room-info":I(Number(F[2]));return;case"open-room-chatlog":j(Number(F[2]));return;case"close-room-chatlog":E(Number(F[2]));return;case"toggle-room-chatlog":C(Number(F[2]));return;case"open-user-info":b(Number(F[2]));return;case"close-user-info":_(Number(F[2]));return;case"toggle-user-info":S(Number(F[2]));return;case"open-user-chatlog":T(Number(F[2]));return;case"close-user-chatlog":L(Number(F[2]));return;case"toggle-user-chatlog":k(Number(F[2]));return}},eventUrlPrefix:"mod-tools/"};return ht(y),()=>gt(y)},[p,x,I,j,E,C,b,_,S,T,L,k]),e.jsxs(e.Fragment,{children:[t&&e.jsxs(ie,{uniqueKey:"mod-tools",className:"nitro-mod-tools",windowPosition:Tt.TOP_LEFT,theme:"primary-slim",children:[e.jsx(re,{headerText:"Mod Tools",onCloseClick:y=>s(!1)}),e.jsxs(se,{className:"text-black",gap:1,children:[e.jsxs(P,{gap:1,onClick:y=>Z(`mod-tools/toggle-room-info/${n}`),disabled:n<=0,className:"position-relative",children:[e.jsx(A,{className:"icon icon-small-room position-absolute start-1"})," Room Tool"]}),e.jsxs(P,{innerRef:R,gap:1,onClick:y=>Z(`mod-tools/toggle-room-chatlog/${n}`),disabled:n<=0,className:"position-relative",children:[e.jsx(A,{className:"icon icon-chat-history position-absolute start-1"})," Chatlog Tool"]}),e.jsxs(P,{gap:1,onClick:()=>Z(`mod-tools/toggle-user-info/${i.userId}`),disabled:!i,className:"position-relative",children:[e.jsx(A,{className:"icon icon-user position-absolute start-1"})," User: ",i?i.username:""]}),e.jsxs(P,{gap:1,onClick:()=>m(y=>!y),className:"position-relative",children:[e.jsx(A,{className:"icon icon-tickets position-absolute start-1"})," Report Tool"]})]})]}),h.length>0&&h.map(y=>e.jsx(iy,{roomId:y,onCloseClick:()=>Z(`mod-tools/close-room-info/${y}`)},y)),u.length>0&&u.map(y=>e.jsx(ry,{roomId:y,onCloseClick:()=>Z(`mod-tools/close-room-chatlog/${y}`)},y)),f.length>0&&f.map(y=>e.jsx(xy,{userId:y,onCloseClick:()=>Z(`mod-tools/close-user-info/${y}`)},y)),g.length>0&&g.map(y=>e.jsx(hy,{userId:y,onCloseClick:()=>Z(`mod-tools/close-user-chatlog/${y}`)},y)),c&&e.jsx(my,{onCloseClick:()=>m(!1)})]})},Iy=[We.START_DOORBELL,We.STATE_WAITING,We.STATE_NO_ANSWER,We.START_PASSWORD,We.STATE_WRONG_PASSWORD],by=[We.START_DOORBELL,We.STATE_WAITING,We.STATE_NO_ANSWER],Ey=a=>{const[t,s]=o.useState(""),{doorData:n=null,setDoorData:r=null}=qs(),i=()=>{n&&n.state===We.STATE_WAITING&&Ql(),r(null)},l=()=>{!n||!n.roomInfo||(Cr(n.roomInfo.roomId),r(h=>{const u={...h};return u.state=We.STATE_PENDING_SERVER,u}))},c=()=>{!n||!n.roomInfo||(Cr(n.roomInfo.roomId,t),r(h=>{const u={...h};return u.state=We.STATE_PENDING_SERVER,u}))};if(o.useEffect(()=>{!n||n.state!==We.STATE_NO_ANSWER||Ql()},[n]),!n||n.state===We.NONE||Iy.indexOf(n.state)===-1)return null;const m=by.indexOf(n.state)>=0;return e.jsxs(ie,{className:"nitro-navigator-doorbell",theme:"primary",children:[e.jsx(re,{headerText:d(m?"navigator.doorbell.title":"navigator.password.title"),onCloseClick:i}),e.jsxs(se,{className:"px-3 pb-4",children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{small:!0,bold:!0,children:n&&n.roomInfo&&n.roomInfo.roomName}),n.state===We.START_DOORBELL&&e.jsx(N,{small:!0,children:d("navigator.doorbell.info")}),n.state===We.STATE_WAITING&&e.jsx(N,{small:!0,children:d("navigator.doorbell.waiting")}),n.state===We.STATE_NO_ANSWER&&e.jsx(N,{small:!0,children:d("navigator.doorbell.no.answer")}),n.state===We.START_PASSWORD&&e.jsx(N,{small:!0,children:d("navigator.password.info")}),n.state===We.STATE_WRONG_PASSWORD&&e.jsx(N,{small:!0,children:d("navigator.password.retryinfo")})]}),m&&e.jsxs(w,{fullWidth:!0,gap:1,className:"align-items-end mt-auto pt-3",children:[e.jsx(N,{small:!0,className:"cursor-pointer",underline:!0,onClick:i,children:d("generic.cancel")}),n.state===We.START_DOORBELL&&e.jsx(P,{className:"ms-auto",onClick:l,children:d("navigator.doorbell.button.ring")})]}),!m&&e.jsxs(e.Fragment,{children:[e.jsxs(w,{className:"pt-3 align-items-center",gap:1,children:[e.jsx(N,{small:!0,fullWidth:!0,children:d("navigator.password.enter")}),e.jsx("input",{type:"password",className:"form-control form-control-sm",onChange:h=>s(h.target.value)})]}),e.jsxs(w,{fullWidth:!0,gap:1,className:"align-items-end mt-auto pt-3",children:[e.jsx(N,{small:!0,className:"cursor-pointer",underline:!0,onClick:i,children:d("generic.cancel")}),e.jsx(P,{className:"ms-auto",onClick:c,children:d("navigator.password.button.try")})]})]})]})]})},Cy=a=>{const[t,s]=o.useState(null),[n,r]=o.useState(null),[i,l]=o.useState(null),[c,m]=o.useState(null),[h,u]=o.useState(null),[g,f]=o.useState(0),[p,x]=o.useState([]),[I,j]=o.useState(""),{categories:E=null}=qs(),C=K("hc.disabled",!1),b=T=>K("images.url")+`/navigator/models/model_${T}.png`,_=(T,L)=>{if(T){if(Cs(){!n||n.length<3||D(new Ab(n,i,"model_"+I,Number(c),Number(h),g))};return o.useEffect(()=>{if(!t){const T=[];for(let L=10;L<=100;L=L+10)T.push(L);s(T),u(T[0])}},[t]),o.useEffect(()=>{E&&E.length&&m(E[0].id)},[E]),o.useEffect(()=>{const T=K("navigator.room.models");T&&T.length&&(x(T),j(T[0].name))},[]),e.jsxs(ie,{className:"nitro-room-creator",theme:"primary",children:[e.jsx(re,{headerText:d("navigator.createroom.title"),onCloseClick:T=>Z("navigator/close-creator")}),e.jsx(se,{children:e.jsx(v,{overflow:"hidden",children:e.jsxs(ne,{overflow:"hidden",children:[e.jsxs(v,{size:5,gap:1,overflow:"auto",className:"px-2 py-1",children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{children:d("navigator.createroom.roomnameinfo")}),e.jsx("input",{type:"text",className:`room-creator-form ${!n||n.length<3?"input-error":""}`,maxLength:60,onChange:T=>r(T.target.value),placeholder:d("navigator.createroom.roomnameinfo")}),(!n||n.length<3)&&e.jsx(PN,{text:d("navigator.createroom.nameerr")})]}),e.jsxs(v,{grow:!0,gap:1,children:[e.jsx(N,{children:d("navigator.createroom.roomdescinfo")}),e.jsx("textarea",{className:"flex-grow-1 room-creator-form",maxLength:255,onChange:T=>l(T.target.value),placeholder:d("navigator.createroom.roomdescinfo")})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{children:d("navigator.category")}),e.jsx("select",{className:"form-select form-select-sm",onChange:T=>m(Number(T.target.value)),children:E&&E.length>0&&E.map(T=>e.jsx("option",{value:T.id,children:d(T.name)},T.id))})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{children:d("navigator.maxvisitors")}),e.jsx("select",{className:"form-select form-select-sm",onChange:T=>u(Number(T.target.value)),children:t&&t.map(T=>e.jsx("option",{value:T,children:T},T))})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{children:d("navigator.tradesettings")}),e.jsxs("select",{className:"form-select form-select-sm",onChange:T=>f(Number(T.target.value)),children:[e.jsx("option",{value:"0",children:d("navigator.roomsettings.trade_not_allowed")}),e.jsx("option",{value:"1",children:d("navigator.roomsettings.trade_not_with_Controller")}),e.jsx("option",{value:"2",children:d("navigator.roomsettings.trade_allowed")})]})]}),e.jsxs(w,{gap:2,children:[e.jsx(P,{fullWidth:!0,className:"volter-bold-button text-black",onClick:S,children:d("navigator.createroom.create")}),e.jsx(P,{fullWidth:!0,className:"volter-button text-black",onClick:T=>Z("navigator/close-creator"),children:d("cancel")})]})]}),e.jsx(v,{size:7,gap:1,overflow:"auto",children:e.jsx(Pe,{className:"room-creator-grid",gap:1,columnCount:2,columnMinWidth:100,columnMinHeight:50,overflow:"unset",children:p.map((T,L)=>e.jsxs(UN,{fullHeight:!0,onClick:()=>_(T,L),itemActive:I===T.name,overflow:"unset",gap:0,className:"py-3",children:[e.jsx(w,{fullHeight:!0,center:!0,overflow:"hidden",children:e.jsx("img",{alt:"",src:b(T.name)})}),e.jsxs(N,{position:"absolute",className:"bottom-1 start-1",children:[e.jsx(A,{className:`icon ${I===T.name?"icon-tiles_room_selected":"icon-tiles"}`})," ",T.tileSize," ",d("navigator.createroom.tilesize")]}),!C&&T.clubLevel>Bt.NO_CLUB&&e.jsx(A,{className:"icon icon-hc_mini position-absolute top-1 end-1"}),I&&e.jsx("i",{className:"active-arrow"})]},T.name))})})]})})})]})},Ny=a=>{const{onCloseClick:t=null}=a,[s,n]=o.useState(!1),[r,i]=o.useState(!1),{report:l=null}=Ws(),{navigatorData:c=null}=qs(),{roomSession:m=null}=ke(),h=g=>{switch(g){case"settings":return B().userId===c.enteredGuestRoom.ownerId||B().isModerator;case"staff_pick":return B().securityLevel>=no.COMMUNITY;case"floor":return(m==null?void 0:m.controllerLevel)>=$e.GUEST;case"guest":return(m==null?void 0:m.controllerLevel)===$e.GUEST;default:return!1}},u=(g,f)=>{if(!(!c||!c.enteredGuestRoom))switch(g){case"set_home_room":let p=0;c.homeRoomId!==c.enteredGuestRoom.roomId&&(p=c.enteredGuestRoom.roomId),D(new Fb(p));return;case"navigator_search_tag":Z(`navigator/search/${f}`),D(new Tr("hotel_view",`tag:${f}`));return;case"open_room_thumbnail_camera":Ct(new gn(gn.TOGGLE_THUMBNAIL));return;case"open_group_info":ca(c.enteredGuestRoom.habboGroupId);return;case"toggle_room_link":Z("navigator/toggle-room-link");return;case"open_room_settings":D(new Sm(c.enteredGuestRoom.roomId));return;case"toggle_pick":n(x=>!x),D(new Ub(c.enteredGuestRoom.roomId));return;case"toggle_mute":i(x=>!x),D(new Mb);return;case"room_filter":D(new Lb(c.enteredGuestRoom.roomId));return;case"open_floorplan_editor":Z("floor-editor/toggle");return;case"report_room":l(tt.ROOM,{roomId:c.enteredGuestRoom.roomId,roomName:c.enteredGuestRoom.roomName});return;case"remove_rights":D(new Pb(c.enteredGuestRoom.roomId));return;case"close":t();return}};return o.useEffect(()=>{c&&(n(c.currentRoomIsStaffPick),c.enteredGuestRoom&&i(c.enteredGuestRoom.allInRoomMuted))},[c]),c.enteredGuestRoom?e.jsxs(ie,{className:"nitro-room-info",theme:"primary-slim",children:[e.jsx(re,{headerText:d("navigator.roomsettings.roominfo"),onCloseClick:()=>u("close")}),e.jsx(se,{className:"text-black",children:c.enteredGuestRoom&&e.jsxs(e.Fragment,{children:[e.jsxs(w,{gap:2,overflow:"hidden",children:[e.jsxs(w,{column:!0,gap:2,overflow:"hidden",shrink:!0,style:{maxWidth:"110px"},children:[e.jsx(Zo,{roomId:c.enteredGuestRoom.roomId,customUrl:c.enteredGuestRoom.officialRoomPicRef,children:h("settings")&&e.jsx("i",{className:"top-0 m-1 cursor-pointer icon icon-camera-small position-absolute b-0 r-0",onClick:()=>u("open_room_thumbnail_camera")})}),c.enteredGuestRoom.tags.length>0&&e.jsx(w,{column:!0,gap:1,children:c.enteredGuestRoom.tags.map((g,f)=>e.jsxs(N,{pointer:!0,className:"w-full p-1 rounded bg-muted",truncate:!0,onClick:p=>u("navigator_search_tag",g),children:["#",g]},"tag-"+f))})]}),e.jsxs(v,{grow:!0,gap:1,overflow:"hidden",children:[e.jsxs(w,{gap:1,children:[e.jsxs(v,{grow:!0,gap:1,overflow:"hidden",children:[e.jsx(N,{bold:!0,truncate:!0,children:c.enteredGuestRoom.roomName}),c.enteredGuestRoom.showOwner&&e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(N,{variant:"muted",children:d("navigator.roomownercaption")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(Ns,{userId:c.enteredGuestRoom.ownerId}),e.jsx(N,{children:c.enteredGuestRoom.ownerName})]})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(N,{variant:"muted",children:d("navigator.roomrating")}),e.jsx(N,{children:c.currentRoomRating})]})]}),e.jsx(v,{children:e.jsxs(w,{column:!0,alignItems:"center",gap:1,className:"p-1 rounded bg-muted",children:[e.jsx("i",{onClick:()=>u("set_home_room"),className:zt("flex-shrink-0 icon icon-house-small cursor-pointer",c.homeRoomId!==c.enteredGuestRoom.roomId&&"gray")}),h("settings")&&e.jsx("i",{className:"cursor-pointer icon icon-cog",title:d("navigator.room.popup.info.room.settings"),onClick:g=>u("open_room_settings")}),e.jsx("i",{title:d("navigator.embed.caption"),className:"cursor-pointer icon icon-navigator-link",onClick:g=>Z("navigator/toggle-room-link")}),h("guest")&&e.jsx(Db,{title:d("navigator.roominfo.removerights.tooltip"),className:"cursor-pointer fa-icon",onClick:g=>u("remove_rights")})]})})]}),e.jsxs(N,{variant:"muted",children:[d("navigator.roomsettings.desc"),": "]}),e.jsx(N,{small:!0,overflow:"auto",style:{maxWidth:250,maxHeight:50},children:c.enteredGuestRoom.description}),c.enteredGuestRoom.habboGroupId>0&&e.jsxs(w,{pointer:!0,alignItems:"center",gap:1,onClick:()=>u("open_group_info"),children:[e.jsx(mt,{className:"flex-none",badgeCode:c.enteredGuestRoom.groupBadgeCode,isGroup:!0}),e.jsx(N,{underline:!0,children:d("navigator.guildbase",["groupName"],[c.enteredGuestRoom.groupName])})]})]})]}),e.jsxs(v,{gap:1,children:[h("staff_pick")&&e.jsx(P,{onClick:()=>u("toggle_pick"),children:d(s?"navigator.staffpicks.unpick":"navigator.staffpicks.pick")}),h("settings")&&e.jsxs(e.Fragment,{children:[e.jsx(P,{onClick:()=>u("toggle_mute"),children:d(r?"navigator.muteall_on":"navigator.muteall_off")}),e.jsx(P,{onClick:()=>u("room_filter"),children:d("navigator.roomsettings.roomfilter")})]}),h("floor")&&e.jsx(P,{onClick:()=>u("open_floorplan_editor"),children:d("open.floor.plan.editor")}),e.jsx(P,{variant:"danger",onClick:()=>u("report_room"),children:d("help.emergency.main.report.room")})]})]})})]}):null},vy=a=>{const{onCloseClick:t=null}=a,{navigatorData:s=null}=qs();return s.enteredGuestRoom?e.jsxs(ie,{className:"nitro-room-link no-resize",theme:"primary",children:[e.jsx(re,{headerText:d("navigator.embed.title"),onCloseClick:t}),e.jsx(se,{className:"text-black d-flex align-items-center",children:e.jsxs(w,{gap:2,children:[e.jsx(Zo,{roomId:s.enteredGuestRoom.roomId,customUrl:s.enteredGuestRoom.officialRoomPicRef}),e.jsxs(v,{children:[e.jsx(N,{bold:!0,fontSize:5,children:d("navigator.embed.headline")}),e.jsx(N,{children:d("navigator.embed.info")}),e.jsxs(N,{children:[" ",d("navigator.embed.direct.info")]}),e.jsx("input",{type:"text",readOnly:!0,className:"form-control form-control-sm",value:d("navigator.embed.src",["roomId"],[s.enteredGuestRoom.roomId.toString()]).replace("${url.prefix}",K("url.prefix",""))})]})]})})]}):null},_y=a=>{const{roomData:t=null,handleChange:s=null}=a,[n,r]=o.useState(""),[i,l]=o.useState(""),[c,m]=o.useState(!1),h=()=>{!c||n.length<=0||i.length<=0||n!==i||s("password",n)};return o.useEffect(()=>{r(""),l(""),m(!1)},[t]),e.jsxs(e.Fragment,{children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("navigator.roomsettings.roomaccess.caption")}),e.jsx(N,{children:d("navigator.roomsettings.roomaccess.info")})]}),e.jsxs(v,{overflow:"auto",children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("navigator.roomsettings.doormode")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"lockState",checked:t.lockState===et.OPEN_STATE&&!c,onChange:u=>s("lock_state",et.OPEN_STATE)}),e.jsx(N,{children:d("navigator.roomsettings.doormode.open")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"lockState",checked:t.lockState===et.DOORBELL_STATE&&!c,onChange:u=>s("lock_state",et.DOORBELL_STATE)}),e.jsx(N,{children:d("navigator.roomsettings.doormode.doorbell")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"lockState",checked:t.lockState===et.INVISIBLE_STATE&&!c,onChange:u=>s("lock_state",et.INVISIBLE_STATE)}),e.jsx(N,{children:d("navigator.roomsettings.doormode.invisible")})]}),e.jsxs(w,{fullWidth:!0,gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"lockState",checked:t.lockState===et.PASSWORD_STATE||c,onChange:u=>m(u.target.checked)}),!c&&t.lockState!==et.PASSWORD_STATE&&e.jsx(N,{children:d("navigator.roomsettings.doormode.password")}),(c||t.lockState===et.PASSWORD_STATE)&&e.jsxs(v,{gap:1,children:[e.jsx(N,{children:d("navigator.roomsettings.doormode.password")}),e.jsx("input",{type:"password",className:"form-control form-control-sm col-4",value:n,onChange:u=>r(u.target.value),placeholder:d("navigator.roomsettings.password"),onFocus:u=>m(!0)}),c&&n.length<=0&&e.jsx(N,{bold:!0,small:!0,variant:"danger",children:d("navigator.roomsettings.passwordismandatory")}),e.jsx("input",{type:"password",className:"form-control form-control-sm col-4",value:i,onChange:u=>l(u.target.value),onBlur:h,placeholder:d("navigator.roomsettings.passwordconfirm")}),c&&n.length>0&&n!==i&&e.jsx(N,{bold:!0,small:!0,variant:"danger",children:d("navigator.roomsettings.invalidconfirm")})]})]})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("navigator.roomsettings.pets")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:t.allowPets,onChange:u=>s("allow_pets",u.target.checked)}),e.jsx(N,{children:d("navigator.roomsettings.allowpets")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:t.allowPetsEat,onChange:u=>s("allow_pets_eat",u.target.checked)}),e.jsx(N,{children:d("navigator.roomsettings.allowfoodconsume")})]})]})]})]})},Id=3,bd=60,Ed=255,Ha=15,Sy=a=>{const{roomData:t=null,handleChange:s=null,onClose:n=null}=a,[r,i]=o.useState(""),[l,c]=o.useState(""),[m,h]=o.useState(""),[u,g]=o.useState(""),[f,p]=o.useState(0),[x,I]=o.useState(""),{showConfirm:j=null}=Fe(),{categories:E=null}=qs();M(Vb,T=>{const L=T.getParser();if(L)switch(L.code){case ju.ERROR_INVALID_TAG:I("navigator.roomsettings.unacceptablewords");case ju.ERROR_NON_USER_CHOOSABLE_TAG:I("navigator.roomsettings.nonuserchoosabletag");break;default:I("");break}});const C=()=>{j(d("navigator.roomsettings.deleteroom.confirm.message",["room_name"],[t.roomName]),()=>{D(new Gb(t.roomId)),n&&n(),Z("navigator/search/myworld_view")},null,null,null,d("navigator.roomsettings.deleteroom.confirm.title"))},b=()=>{r===t.roomName||r.lengthbd||s("name",r)},_=()=>{l===t.roomDescription||l.length>Ed||s("description",l)},S=T=>{T===0&&m===t.tags[0]||m.length>Ha||T===1&&u===t.tags[1]||u.length>Ha||(m===""&&u!==""&&g(""),I(""),p(T),s("tags",m===""&&u!==""?[u]:[m,u]))};return o.useEffect(()=>{i(t.roomName),c(t.roomDescription),h(t.tags.length>0&&t.tags[0]?t.tags[0]:""),g(t.tags.length>0&&t.tags[1]?t.tags[1]:"")},[t]),e.jsxs(e.Fragment,{children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(N,{className:"col-3",children:d("navigator.roomname")}),e.jsxs(v,{fullWidth:!0,gap:0,children:[e.jsx("input",{className:"form-control form-control-sm",value:r,maxLength:bd,onChange:T=>i(T.target.value),onBlur:b}),r.lengthc(T.target.value),onBlur:_})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(N,{className:"col-3",children:d("navigator.category")}),e.jsx("select",{className:"form-select form-select-sm",value:t.categoryId,onChange:T=>s("category",T.target.value),children:E&&E.map(T=>e.jsx("option",{value:T.id,children:d(T.name)},T.id))})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(N,{className:"col-3",children:d("navigator.maxvisitors")}),e.jsx("select",{className:"form-select form-select-sm",value:t.userCount,onChange:T=>s("max_visitors",T.target.value),children:Vu&&Vu.map(T=>e.jsx("option",{value:T,children:T},T))})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(N,{className:"col-3",children:d("navigator.tradesettings")}),e.jsxs("select",{className:"form-select form-select-sm",value:t.tradeState,onChange:T=>s("trade_state",T.target.value),children:[e.jsx("option",{value:"0",children:d("navigator.roomsettings.trade_not_allowed")}),e.jsx("option",{value:"1",children:d("navigator.roomsettings.trade_not_with_Controller")}),e.jsx("option",{value:"2",children:d("navigator.roomsettings.trade_allowed")})]})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(N,{className:"col-3",children:d("navigator.tags")}),e.jsxs(v,{fullWidth:!0,gap:0,children:[e.jsx("input",{className:"form-control form-control-sm",value:m,onChange:T=>h(T.target.value),onBlur:()=>S(0)}),m.length>Ha&&e.jsx(N,{bold:!0,small:!0,variant:"danger",children:d("navigator.roomsettings.toomanycharacters")}),f===0&&x!=""&&e.jsx(N,{bold:!0,small:!0,variant:"danger",children:d(x)})]}),e.jsxs(v,{fullWidth:!0,gap:0,children:[e.jsx("input",{className:"form-control form-control-sm",value:u,onChange:T=>g(T.target.value),onBlur:()=>S(1)}),u.length>Ha&&e.jsx(N,{bold:!0,small:!0,variant:"danger",children:d("navigator.roomsettings.toomanycharacters")}),f===1&&x!=""&&e.jsx(N,{bold:!0,small:!0,variant:"danger",children:d(x)})]})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(A,{className:"col-3"}),e.jsx("input",{className:"form-check-input",type:"checkbox",checked:t.allowWalkthrough,onChange:T=>s("allow_walkthrough",T.target.checked)}),e.jsx(N,{children:d("navigator.roomsettings.allow_walk_through")})]}),e.jsxs(N,{variant:"danger",underline:!0,bold:!0,pointer:!0,className:"d-flex justify-content-center align-items-center gap-1",onClick:C,children:[e.jsx(Hs,{className:"fa-icon"}),d("navigator.roomsettings.delete")]})]})},wy=a=>{var m;const{roomData:t=null,handleChange:s=null}=a,[n,r]=o.useState(-1),[i,l]=o.useState([]),c=h=>{l(u=>{const g=[...u],f=g.findIndex(p=>p.userId===h);return f>=0&&g.splice(f,1),g}),D(new Hb(h,t.roomId)),r(-1)};return M(Bb,h=>{const u=h.getParser();!t||t.roomId!==u.roomId||l(u.bannedUsers)}),o.useEffect(()=>{D(new Gm(t.roomId))},[t.roomId]),e.jsxs(ne,{overflow:"auto",children:[e.jsxs(v,{size:6,children:[e.jsxs(N,{bold:!0,children:[d("navigator.roomsettings.moderation.banned.users")," (",i.length,")"]}),e.jsx(w,{overflow:"hidden",className:"bg-white rounded list-container p-2",children:e.jsx(v,{fullWidth:!0,overflow:"auto",gap:1,children:i&&i.length>0&&i.map((h,u)=>e.jsxs(w,{shrink:!0,alignItems:"center",gap:1,overflow:"hidden",children:[e.jsx(Ns,{userName:h.userId}),e.jsxs(N,{pointer:!0,grow:!0,onClick:g=>r(h.userId),children:[" ",h.userName]})]},u))})}),e.jsxs(P,{disabled:n<=0,onClick:h=>c(n),children:[d("navigator.roomsettings.moderation.unban")," ",n>0&&((m=i.find(h=>h.userId===n))==null?void 0:m.userName)]})]}),e.jsxs(v,{size:6,children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("navigator.roomsettings.moderation.mute.header")}),e.jsx(w,{alignItems:"center",gap:1,children:e.jsxs("select",{className:"form-select form-select-sm",value:t.moderationSettings.allowMute,onChange:h=>s("moderation_mute",h.target.value),children:[e.jsx("option",{value:Qs.MODERATION_LEVEL_NONE,children:d("navigator.roomsettings.moderation.none")}),e.jsx("option",{value:Qs.MODERATION_LEVEL_USER_WITH_RIGHTS,children:d("navigator.roomsettings.moderation.rights")})]})})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("navigator.roomsettings.moderation.kick.header")}),e.jsx(w,{alignItems:"center",gap:1,children:e.jsxs("select",{className:"form-select form-select-sm",value:t.moderationSettings.allowKick,onChange:h=>s("moderation_kick",h.target.value),children:[e.jsx("option",{value:Qs.MODERATION_LEVEL_NONE,children:d("navigator.roomsettings.moderation.none")}),e.jsx("option",{value:Qs.MODERATION_LEVEL_USER_WITH_RIGHTS,children:d("navigator.roomsettings.moderation.rights")}),e.jsx("option",{value:Qs.MODERATION_LEVEL_ALL,children:d("navigator.roomsettings.moderation.all")})]})})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("navigator.roomsettings.moderation.ban.header")}),e.jsx(w,{alignItems:"center",gap:1,children:e.jsxs("select",{className:"form-select form-select-sm",value:t.moderationSettings.allowBan,onChange:h=>s("moderation_ban",h.target.value),children:[e.jsx("option",{value:Qs.MODERATION_LEVEL_NONE,children:d("navigator.roomsettings.moderation.none")}),e.jsx("option",{value:Qs.MODERATION_LEVEL_USER_WITH_RIGHTS,children:d("navigator.roomsettings.moderation.rights")})]})})]})]})]})},Ty=a=>{const{roomData:t=null}=a,[s,n]=o.useState(new Map),{onlineFriends:r=[],offlineFriends:i=[]}=hs(),l=[...r,...i],c=l.filter(m=>!s.has(m.id));return M(Wb,m=>{const h=m.getParser();!t||t.roomId!==h.roomId||n(h.users)}),M(qb,m=>{const h=m.getParser();!t||t.roomId!==h.roomId||n(u=>{const g=new Map(u);return g.set(h.data.userId,h.data.userName),g})}),M(zb,m=>{const h=m.getParser();!t||t.roomId!==h.roomId||n(u=>{const g=new Map(u);return g.delete(h.userId),g})}),o.useEffect(()=>{D(new Yb(t.roomId))},[t.roomId]),e.jsxs(ne,{children:[e.jsxs(v,{size:6,children:[e.jsx(N,{bold:!0,children:d("navigator.flatctrls.userswithrights",["displayed","total"],[s.size.toString(),s.size.toString()])}),e.jsx(w,{overflow:"hidden",className:"p-2 bg-white rounded list-container",children:e.jsx(v,{fullWidth:!0,overflow:"auto",gap:1,children:Array.from(s.entries()).map(([m,h],u)=>e.jsxs(w,{shrink:!0,alignItems:"center",gap:1,overflow:"hidden",children:[e.jsx(Ns,{userId:m}),e.jsxs(N,{pointer:!0,grow:!0,onClick:g=>D(new $b(m)),children:[" ",h]})]},u))})}),e.jsx(P,{variant:"danger",disabled:!s.size,onClick:m=>D(new Kb(t.roomId)),children:d("navigator.flatctrls.clear")})]}),e.jsxs(v,{size:6,children:[e.jsx(N,{bold:!0,children:d("navigator.flatctrls.friends",["displayed","total"],[c.length.toString(),l.length.toString()])}),e.jsx(w,{overflow:"hidden",className:"p-2 bg-white rounded list-container",children:e.jsx(v,{fullWidth:!0,overflow:"auto",gap:1,children:c.map((m,h)=>e.jsxs(w,{shrink:!0,alignItems:"center",gap:1,overflow:"hidden",children:[e.jsx(Ns,{userId:m.id}),e.jsxs(N,{pointer:!0,grow:!0,onClick:u=>D(new Xb(m.id)),children:[" ",m.name]})]},h))})})]})]})},yy=a=>{const{roomData:t=null,handleChange:s=null}=a,[n,r]=o.useState(0);return o.useEffect(()=>{r(t.chatSettings.distance)},[t.chatSettings]),e.jsxs(e.Fragment,{children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("navigator.roomsettings.vip.caption")}),e.jsx(N,{children:d("navigator.roomsettings.vip.info")})]}),e.jsxs(ne,{overflow:"auto",children:[e.jsxs(v,{size:6,gap:1,children:[e.jsx(N,{bold:!0,children:d("navigator.roomsettings.chat_settings")}),e.jsx(N,{children:d("navigator.roomsettings.chat_settings.info")}),e.jsxs("select",{className:"form-select form-select-sm",value:t.chatSettings.mode,onChange:i=>s("bubble_mode",i.target.value),children:[e.jsx("option",{value:Et.CHAT_MODE_FREE_FLOW,children:d("navigator.roomsettings.chat.mode.free.flow")}),e.jsx("option",{value:Et.CHAT_MODE_LINE_BY_LINE,children:d("navigator.roomsettings.chat.mode.line.by.line")})]}),e.jsxs("select",{className:"form-select form-select-sm",value:t.chatSettings.weight,onChange:i=>s("chat_weight",i.target.value),children:[e.jsx("option",{value:Et.CHAT_BUBBLE_WIDTH_NORMAL,children:d("navigator.roomsettings.chat.bubbles.width.normal")}),e.jsx("option",{value:Et.CHAT_BUBBLE_WIDTH_THIN,children:d("navigator.roomsettings.chat.bubbles.width.thin")}),e.jsx("option",{value:Et.CHAT_BUBBLE_WIDTH_WIDE,children:d("navigator.roomsettings.chat.bubbles.width.wide")})]}),e.jsxs("select",{className:"form-select form-select-sm",value:t.chatSettings.speed,onChange:i=>s("bubble_speed",i.target.value),children:[e.jsx("option",{value:Et.CHAT_SCROLL_SPEED_FAST,children:d("navigator.roomsettings.chat.speed.fast")}),e.jsx("option",{value:Et.CHAT_SCROLL_SPEED_NORMAL,children:d("navigator.roomsettings.chat.speed.normal")}),e.jsx("option",{value:Et.CHAT_SCROLL_SPEED_SLOW,children:d("navigator.roomsettings.chat.speed.slow")})]}),e.jsxs("select",{className:"form-select form-select-sm",value:t.chatSettings.protection,onChange:i=>s("flood_protection",i.target.value),children:[e.jsx("option",{value:Et.FLOOD_FILTER_LOOSE,children:d("navigator.roomsettings.chat.flood.loose")}),e.jsx("option",{value:Et.FLOOD_FILTER_NORMAL,children:d("navigator.roomsettings.chat.flood.normal")}),e.jsx("option",{value:Et.FLOOD_FILTER_STRICT,children:d("navigator.roomsettings.chat.flood.strict")})]}),e.jsx(N,{children:d("navigator.roomsettings.chat_settings.hearing.distance")}),e.jsx("input",{type:"number",min:"0",className:"form-control form-control-sm",value:n,onChange:i=>r(i.target.valueAsNumber),onBlur:i=>s("chat_distance",n)})]}),e.jsxs(v,{size:6,gap:1,children:[e.jsx(N,{bold:!0,children:d("navigator.roomsettings.vip_settings")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:t.hideWalls,onChange:i=>s("hide_walls",i.target.checked)}),e.jsx(N,{children:d("navigator.roomsettings.hide_walls")})]}),e.jsxs("select",{className:"form-select form-select-sm",value:t.wallThickness,onChange:i=>s("wall_thickness",i.target.value),children:[e.jsx("option",{value:"0",children:d("navigator.roomsettings.wall_thickness.normal")}),e.jsx("option",{value:"1",children:d("navigator.roomsettings.wall_thickness.thick")}),e.jsx("option",{value:"-1",children:d("navigator.roomsettings.wall_thickness.thin")}),e.jsx("option",{value:"-2",children:d("navigator.roomsettings.wall_thickness.thinnest")})]}),e.jsxs("select",{className:"form-select form-select-sm",value:t.floorThickness,onChange:i=>s("floor_thickness",i.target.value),children:[e.jsx("option",{value:"0",children:d("navigator.roomsettings.floor_thickness.normal")}),e.jsx("option",{value:"1",children:d("navigator.roomsettings.floor_thickness.thick")}),e.jsx("option",{value:"-1",children:d("navigator.roomsettings.floor_thickness.thin")}),e.jsx("option",{value:"-2",children:d("navigator.roomsettings.floor_thickness.thinnest")})]})]})]})]})},on=["navigator.roomsettings.tab.1","navigator.roomsettings.tab.2","navigator.roomsettings.tab.3","navigator.roomsettings.tab.4","navigator.roomsettings.tab.5"],Ry=a=>{const[t,s]=o.useState(null),[n,r]=o.useState(on[0]);M(Qb,c=>{const m=c.getParser();if(!m)return;const h=m.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}}),D(new Gm(h.roomId))});const i=()=>{s(null),r(on[0])},l=(c,m)=>{s(h=>{const u={...h};switch(c){case"name":u.roomName=String(m);break;case"description":u.roomDescription=String(m);break;case"category":u.categoryId=Number(m);break;case"max_visitors":u.userCount=Number(m);break;case"trade_state":u.tradeState=Number(m);break;case"tags":u.tags=m;break;case"allow_walkthrough":u.allowWalkthrough=!!m;break;case"allow_pets":u.allowPets=!!m;break;case"allow_pets_eat":u.allowPetsEat=!!m;break;case"hide_walls":u.hideWalls=!!m;break;case"wall_thickness":u.wallThickness=Number(m);break;case"floor_thickness":u.floorThickness=Number(m);break;case"lock_state":u.lockState=Number(m);break;case"password":u.lockState=et.PASSWORD_STATE,u.password=String(m);break;case"moderation_mute":u.moderationSettings.allowMute=Number(m);break;case"moderation_kick":u.moderationSettings.allowKick=Number(m);break;case"moderation_ban":u.moderationSettings.allowBan=Number(m);break;case"bubble_mode":u.chatSettings.mode=Number(m);break;case"chat_weight":u.chatSettings.weight=Number(m);break;case"bubble_speed":u.chatSettings.speed=Number(m);break;case"flood_protection":u.chatSettings.protection=Number(m);break;case"chat_distance":u.chatSettings.distance=Number(m);break}return D(new Jb(u.roomId,u.roomName,u.roomDescription,u.lockState,u.password,u.userCount,u.categoryId,u.tags.length,u.tags,u.tradeState,u.allowPets,u.allowPetsEat,u.allowWalkthrough,u.hideWalls,u.wallThickness,u.floorThickness,u.moderationSettings.allowMute,u.moderationSettings.allowKick,u.moderationSettings.allowBan,u.chatSettings.mode,u.chatSettings.weight,u.chatSettings.speed,u.chatSettings.distance,u.chatSettings.protection)),u})};return t?e.jsxs(ie,{uniqueKey:"nitro-room-settings",className:"nitro-room-settings",children:[e.jsx(re,{headerText:d("navigator.roomsettings"),isInfoToHabboPages:n===on[3],onClickInfoHabboPages:()=>n===on[3]?Z("habbopages/chat/options"):null,onCloseClick:i}),e.jsx(Tn,{children:on.map(c=>e.jsx(tn,{isActive:n===c,onClick:m=>r(c),children:d(c)},c))}),e.jsxs(se,{children:[n===on[0]&&e.jsx(Sy,{roomData:t,handleChange:l,onClose:i}),n===on[1]&&e.jsx(_y,{roomData:t,handleChange:l}),n===on[2]&&e.jsx(Ty,{roomData:t,handleChange:l}),n===on[3]&&e.jsx(yy,{roomData:t,handleChange:l}),n===on[4]&&e.jsx(wy,{roomData:t,handleChange:l})]})]}):null},Cd=a=>{const{roomData:t=null}=a,[s,n]=o.useState(!1),r=o.useRef(),[i,l]=o.useState(!1);o.useEffect(()=>{i&&n(!1)},[i]),o.useEffect(()=>(document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}),[]);const c=h=>{r.current.contains(h.target)||n(!1)},m=()=>{const h=100*(t.userCount/t.maxUserCount);let u="bg-primary";return h>=92?u="bg-danger":h>=50?u="bg-warning":h>0&&(u="bg-success"),u};return e.jsxs(e.Fragment,{children:[e.jsx(A,{pointer:!0,innerRef:r,className:"icon icon-navigator-info",onClick:h=>{n(!(s||i)),h.stopPropagation()}}),e.jsx(qo,{show:s,target:r.current,placement:"right",rootClose:!0,children:e.jsx(ui,{children:e.jsxs(se,{overflow:"hidden",className:"room-info bg-transparent",children:[e.jsxs(w,{gap:2,overflow:"hidden",className:"room-info-bg p-2",children:[e.jsxs(Zo,{roomId:t.roomId,customUrl:t.officialRoomPicRef,className:"d-flex flex-column align-items-center justify-content-end mb-1",children:[t.habboGroupId>0&&e.jsx(mt,{badgeCode:t.groupBadgeCode,isGroup:!0,className:"position-absolute top-0 start-0 m-1 "}),t.doorMode!==et.OPEN_STATE&&e.jsx("i",{className:"position-absolute end-0 mb-1 me-1 icon icon-navigator-room-"+(t.doorMode===et.DOORBELL_STATE?"locked":t.doorMode===et.PASSWORD_STATE?"password":t.doorMode===et.INVISIBLE_STATE?"invisible":"")})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,truncate:!0,className:"flex-grow-1",style:{maxHeight:13},children:t.roomName}),e.jsxs(w,{gap:2,children:[e.jsx(N,{italics:!0,variant:"muted",children:d("navigator.roomownercaption")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(Ns,{userId:t.ownerId,onClick:h=>{l(!0)}}),e.jsx(N,{italics:!0,children:t.ownerName})]})]}),e.jsx(N,{className:"flex-grow-1",children:t.description}),e.jsxs(w,{className:"badge p-1 position-absolute m-1 bottom-0 end-0 m-2 "+m(),gap:1,children:[e.jsx(Bm,{className:"fa-icon"}),t.userCount]})]})]}),e.jsxs(v,{children:[e.jsxs(w,{children:[e.jsxs(w,{gap:1,className:"align-items-center",children:[e.jsx(Ns,{userId:t.ownerId}),e.jsx(N,{bold:!0,underline:!0,children:t.ownerName})]}),e.jsxs(w,{gap:1,className:"align-items-center",justifyContent:"end",fullWidth:!0,children:[e.jsx("i",{className:"icon icon-navigator-room-group"}),e.jsx(N,{bold:!0,underline:!0,children:t.groupName})]})]}),e.jsxs(w,{gap:1,children:[e.jsx(N,{bold:!0,children:d("navigator.roompopup.property.max_users")}),e.jsx(N,{children:t.maxUserCount})]})]})]})})})]})},Nd=a=>{const{roomData:t=null,children:s=null,thumbnail:n=!1,...r}=a,{setDoorData:i=null}=qs(),l=()=>{const m=100*(t.userCount/t.maxUserCount);let h="badge-empty";return m>=92?h="badge-danger":m>=50?h="badge-warning":m>0&&(h="badge-success"),h},c=m=>{if(t.ownerId!==B().userId){if(t.habboGroupId!==0){is(t.roomId);return}switch(t.doorMode){case et.DOORBELL_STATE:i(h=>{const u={...h};return u.roomInfo=t,u.state=We.START_DOORBELL,u});return;case et.PASSWORD_STATE:i(h=>{const u={...h};return u.roomInfo=t,u.state=We.START_PASSWORD,u});return}}Cr(t.roomId)};return n?e.jsxs(v,{pointer:!0,overflow:"hidden",alignItems:"center",onClick:c,gap:0,className:"nav-thumbnail p-1 rounded-3 small mb-1 flex-column",...r,children:[e.jsxs(Zo,{roomId:t.roomId,customUrl:t.officialRoomPicRef,className:"d-flex flex-column align-items-center justify-content-end mb-1",children:[t.habboGroupId>0&&e.jsx(mt,{badgeCode:t.groupBadgeCode,isGroup:!0,className:"position-absolute top-0 start-0 m-1"}),e.jsxs(w,{center:!0,className:"badge p-1 position-absolute m-1 "+l(),gap:1,children:[e.jsx(Bm,{className:"fa-icon"}),t.userCount]}),t.doorMode!==et.OPEN_STATE&&e.jsx("i",{className:"position-absolute end-0 mb-1 me-1 icon icon-navigator-room-"+(t.doorMode===et.DOORBELL_STATE?"locked":t.doorMode===et.PASSWORD_STATE?"password":t.doorMode===et.INVISIBLE_STATE?"invisible":"")})]}),e.jsxs(w,{className:"w-100",children:[e.jsx(N,{truncate:!0,className:"flex-grow-1",children:t.roomName}),e.jsx(w,{reverse:!0,alignItems:"center",gap:1,children:e.jsx(Cd,{roomData:t})}),s]})]}):e.jsxs(w,{pointer:!0,overflow:"hidden",alignItems:"center",onClick:c,gap:2,className:"navigator-item px-2 small",...r,children:[e.jsxs(w,{center:!0,className:"p-1 fw-bold "+l(),gap:1,children:[e.jsx("div",{className:"nav-avatar-icon"}),t.userCount]}),e.jsx(N,{truncate:!0,grow:!0,children:t.roomName}),e.jsxs(w,{reverse:!0,alignItems:"center",gap:1,children:[e.jsx(Cd,{roomData:t}),t.habboGroupId>0&&e.jsx("i",{className:"icon icon-navigator-room-group"}),t.doorMode!==et.OPEN_STATE&&e.jsx("i",{className:"icon icon-navigator-room-"+(t.doorMode===et.DOORBELL_STATE?"locked":t.doorMode===et.PASSWORD_STATE?"password":t.doorMode===et.INVISIBLE_STATE?"invisible":"")})]}),s]})},Oy=a=>{const{searchResult:t=null,...s}=a,[n,r]=o.useState(!0),[i,l]=o.useState(0),{topLevelContext:c=null}=qs(),m=()=>{let f=t.code;return!f||!f.length||d("navigator.searchcode.title."+f)=="navigator.searchcode.title."+f?t.data:f.startsWith("${")?f.slice(2,f.length-1):"navigator.searchcode.title."+f},h=()=>{l(f=>f===Kn.LIST?Kn.THUMBNAILS:Kn.LIST)},u=()=>{t.action==1?D(new Tr(t.code,"")):t.action==2&&c&&D(new Tr(c.code,""))};o.useEffect(()=>{t&&(r(!t.closed),l(t.mode))},[t]);const g=i>=Kn.THUMBNAILS;return e.jsxs(v,{className:"bg-white",gap:0,children:[e.jsxs(w,{fullWidth:!0,alignItems:"center",justifyContent:"between",className:"px-2 py-1",children:[e.jsxs(w,{grow:!0,pointer:!0,alignItems:"center",gap:1,onClick:f=>r(p=>!p),children:[n&&e.jsx(Zb,{className:"text-secondary fa-icon"}),!n&&e.jsx(Wo,{className:"text-secondary fa-icon"}),e.jsxs("div",{className:"nav-category",children:[" ",d(m())]})]}),e.jsxs(w,{gap:2,children:[i===Kn.LIST&&e.jsx(eE,{className:"text-secondary fa-icon",onClick:h}),i>=Kn.THUMBNAILS&&e.jsx(tE,{className:"text-secondary fa-icon",onClick:h}),t.action>0&&t.action===1&&e.jsx(sE,{className:"text-secondary fa-icon",onClick:u}),t.action>0&&t.action!==1&&e.jsx(nE,{className:"text-secondary fa-icon",onClick:u}),c.code!=="official_view"&&e.jsx(Ih,{title:d("navigator.tooltip.add.saved.search"),onClick:()=>D(new rE(m(),t.data))})]})]})," ",n&&e.jsx(e.Fragment,{children:g?e.jsx(Pe,{columnCount:3,...s,columnMinWidth:110,columnMinHeight:130,className:"mx-2",children:t.rooms.length>0&&t.rooms.map((f,p)=>e.jsx(Nd,{roomData:f,thumbnail:!0},p))}):e.jsx(ne,{columnCount:1,className:"navigator-grid",gap:0,children:t.rooms.length>0&&t.rooms.map((f,p)=>e.jsx(Nd,{roomData:f},p))})})]})},ky=a=>{const{search:t=null}=a,[s,n]=o.useState(!1),[r,i]=o.useState(0),l=h=>{i(h),n(!0)},c=()=>{i(0),n(!1)},m=()=>{let h=t.code;return!h||!h.length||d("navigator.searchcode.title."+h)=="navigator.searchcode.title."+h?t.code:h.startsWith("${")?h.slice(2,h.length-1):"navigator.searchcode.title."+h};return e.jsxs(w,{grow:!0,pointer:!0,alignItems:"center",gap:1,onMouseEnter:()=>l(t.id),onMouseLeave:()=>c(),children:[s&&r===t.id&&e.jsx(A,{className:"icon nitro-navigator-search-delete",title:d("navigator.tooltip.remove.saved.search"),onClick:()=>D(new iE(t.id))}),e.jsx(N,{small:!0,pointer:!0,variant:"black",title:d("navigator.tooltip.open.saved.search"),onClick:()=>D(new Tr(t.code.split(".").reverse()[0],t.filter)),children:d(m())})]})},Ay=a=>{const{searchs:t=[]}=a;return e.jsxs(v,{className:"nitro-navigator-search-saves-result",children:[e.jsxs(w,{className:"badge p-1 bg-orange",gap:1,children:[e.jsx(cm,{color:"white"}),e.jsx(N,{variant:"white",children:d("navigator.quick.links.title")})]}),e.jsx(v,{className:"p-1",style:{overflowX:"hidden",overflowY:"auto"},children:t&&t.length>0&&t.map(s=>e.jsx(ky,{search:s},s.id))})]})},Dy=a=>{const{sendSearch:t=null}=a,[s,n]=o.useState(0),[r,i]=o.useState(""),{topLevelContext:l=null,searchResult:c=null}=qs(),m=()=>{if(!l)return;let u=Br[s];u||(u=Br[0]);const g=(u.query?u.query+":":"")+r;t(g||"",l.code)},h=u=>{u.key==="Enter"&&m()};return o.useEffect(()=>{if(!c)return;const u=c.data.split(":");let g=null,f="";if(u.length>=2){const[p,...x]=u;g=Br.find(I=>I.query===p),f=x.join(":")}else f=c.data;g||(g=Br[0]),n(Br.findIndex(p=>p===g)),i(f)},[c]),e.jsxs(w,{fullWidth:!0,gap:1,className:"mb-2",children:[e.jsx(w,{shrink:!0,children:e.jsx("select",{className:"form-select form-select-sm",value:s,onChange:u=>n(parseInt(u.target.value)),children:Br.map((u,g)=>e.jsx("option",{value:g,children:d("navigator.filter."+u.name)},g))})}),e.jsxs(w,{fullWidth:!0,gap:2,children:[e.jsx("input",{type:"text",className:"form-control form-control-sm",placeholder:d("navigator.filter.input.placeholder"),value:r,onChange:u=>i(u.target.value),onKeyDown:u=>h(u)}),e.jsx("i",{className:"icon icon-pen navigator-search-button position-absolute",onClick:m})]})]})},Py=a=>{const[t,s]=o.useState(!1),[n,r]=o.useState(!1),[i,l]=o.useState(!1),[c,m]=o.useState(!1),[h,u]=o.useState(!1),[g,f]=o.useState(!1),[p,x]=o.useState(!1),[I,j]=o.useState(!0),[E,C]=o.useState(!1),{searchResult:b=null,topLevelContext:_=null,topLevelContexts:S=null,navigatorData:T=null,navigatorSearches:L=null}=qs(),k=o.useRef(null),R=o.useRef();He(Pt.CREATED,F=>{s(!1),l(!1)});const y=o.useCallback((F,V)=>{D(new Tr(V,F)),x(!0)},[]),O=o.useCallback(()=>{if(!n){C(!0);return}if(k.current){y(k.current.value,k.current.code),k.current=null;return}if(b){y(b.data,b.code);return}_&&y("",_.code)},[n,b,_,y]);return o.useEffect(()=>{const F={linkReceived:V=>{const Y=V.split("/");if(!(Y.length<2))switch(Y[1]){case"show":{s(!0),C(!0);return}case"hide":s(!1);return;case"toggle":{if(t){s(!1);return}s(!0),C(!0);return}case"toggle-room-info":m(q=>!q);return;case"toggle-room-link":u(q=>!q);return;case"goto":if(Y.length<=2)return;switch(Y[2]){case"home":if(T.homeRoomId<=0)return;is(T.homeRoomId);break;default:{const q=parseInt(Y[2]);is(q)}}return;case"create":l(q=>!q);return;case"close-creator":l(!1);return;case"search":if(Y.length>2){const q=Y[2];let U="";Y.length>3&&(U=Y[3]),k.current={value:U,code:q},s(!0),C(!0)}return}},eventUrlPrefix:"navigator/"};return ht(F),()=>gt(F)},[t,T]),o.useEffect(()=>{b&&(x(!1),R&&R.current&&(R.current.scrollTop=0))},[b]),o.useEffect(()=>{!t||!n||!E||(O(),C(!1))},[t,n,E,O]),o.useEffect(()=>{n||!_||r(!0)},[n,_]),o.useEffect(()=>{!t||!I||(D(new aE),j(!1))},[t,I]),o.useEffect(()=>{qi.addCallback(ia.OPENROOM,(F,V=!1,Y=null)=>D(new oE(F)))},[]),e.jsxs(e.Fragment,{children:[t&&e.jsxs(ie,{uniqueKey:"navigator",className:`nitro-navigator ${g?"expanded":""}`,children:[e.jsx(re,{headerText:d("navigator.title"),isInfoToHabboPages:!0,onClickInfoHabboPages:()=>Z("habbopages/navigator"),onCloseClick:F=>s(!1)}),e.jsxs(Tn,{children:[e.jsx(A,{className:"mt-1",children:e.jsx(Ih,{style:{marginRight:g?"91px":"11px",marginLeft:"-2px",marginTop:"1px"},title:d("navigator.tooltip.left.show.hide"),onClick:()=>f(F=>!F)})}),S&&S.length>0&&S.map((F,V)=>e.jsx(tn,{isActive:_===F,onClick:Y=>y("",F.code),children:d("navigator.toplevelview."+F.code)},V))]}),e.jsxs(se,{position:"relative",children:[p&&e.jsx(A,{fit:!0,position:"absolute",className:"top-0 start-0 z-index-1 bg-muted opacity-0-5"}),e.jsx(v,{overflow:"hidden",children:e.jsxs(w,{fullWidth:!0,fullHeight:!0,children:[g&&e.jsx(v,{overflow:"hidden",className:"pe-5",children:e.jsx(Ay,{searchs:L})}),e.jsxs(w,{column:!0,className:"w-100",children:[e.jsx(Dy,{sendSearch:y}),e.jsx(v,{overflow:"auto",children:b&&b.results.map((F,V)=>e.jsx(Oy,{searchResult:F},V))}),e.jsx(w,{className:"nav-bottom",children:e.jsxs(w,{className:"position-absolute bottom-3",children:[e.jsx(w,{className:"nav-create-room",onClick:F=>l(V=>!V),children:e.jsx(N,{variant:"white",bold:!0,className:"nav-bottom-buttons-text",children:d("navigator.createroom.create")})}),(b==null?void 0:b.code)!=="myworld_view"&&(b==null?void 0:b.code)!=="roomads_view"&&e.jsx(w,{className:"nav-random-room",onClick:()=>D(new Pm),children:e.jsx(N,{variant:"white",bold:!0,className:"nav-bottom-buttons-text",children:d("navigator.random.room")})}),((b==null?void 0:b.code)==="myworld_view"||(b==null?void 0:b.code)==="roomads_view")&&e.jsx(w,{className:"nav-promote-room",onClick:()=>Z("catalog/open/room_event"),children:e.jsx(N,{variant:"white",bold:!0,className:"nav-bottom-buttons-text",children:d("navigator.promote.room")})})]})})]})]})})]})]}),i&&e.jsx(Cy,{}),e.jsx(Ey,{}),c&&e.jsx(Ny,{onCloseClick:()=>m(!1)}),h&&e.jsx(vy,{onCloseClick:()=>u(!1)}),e.jsx(Ry,{})]})},Ly=a=>{const[t,s]=o.useState(!1),[n,r]=o.useState(""),{chatHistory:i=[]}=ma(),l=o.useRef(null);if(o.useMemo(()=>{if(n.length===0)return i;let m=n.toLowerCase();return i.filter(h=>h.message&&h.message.toLowerCase().includes(m)||h.name&&h.name.toLowerCase().includes(m))},[i,n]),o.useEffect(()=>{l&&l.current&&t&&(l.current.scrollTop=l.current.scrollHeight)},[t]),o.useEffect(()=>{const m={linkReceived:h=>{const u=h.split("/");if(!(u.length<2))switch(u[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(g=>!g);return}},eventUrlPrefix:"nitrobubblehidden/"};return ht(m),()=>gt(m)},[]),!t)return null;var c="";return e.jsx("div",{dangerouslySetInnerHTML:{__html:c}})},My=/\n\r|\n|\r/mg,Uy=a=>{const[t,s]=o.useState(null),[n,r]=o.useState(""),[i,l]=o.useState(null),c=o.useRef(null);return o.useEffect(()=>{const m=async u=>{try{const g=await fetch(u);if(!g)return;const p=(await g.text()).split(My),x=p.shift().split("|");r(x[0]),l(I=>x[1]&&x[1].split(";").length===2?{width:parseInt(x[1].split(";")[0]),height:parseInt(x[1].split(";")[1])}:null),s(p.join(""))}catch{dm.error(`Failed to fetch ${u}`)}},h={linkReceived:u=>{const g=u.split("/");g.length<2||(g.shift(),m(K("habbopages.url")+g.join("/")))},eventUrlPrefix:"habbopages/"};return ht(h),()=>gt(h)},[]),o.useEffect(()=>{const m=h=>{if(!(h.target instanceof HTMLAnchorElement))return;h.preventDefault();const u=h.target.href;!u||!u.length||Dr(u)};return document.addEventListener("click",m),()=>{document.removeEventListener("click",m)}},[]),t?e.jsxs(ie,{className:"nitropedia",theme:"primary-slim",style:i?{width:i.width,height:i.height}:{},children:[e.jsx(re,{headerText:n,onCloseClick:()=>s(null)}),e.jsx(se,{children:e.jsx(A,{fit:!0,innerRef:c,className:"text-black",dangerouslySetInnerHTML:{__html:t}})})]}):null},Fy=a=>{const{offer:t=null,setOpen:s=null}=a;if(t)return e.jsxs(Lc,{fadesOut:!1,onClose:null,onClick:n=>s(!0),gap:2,children:[e.jsx(A,{className:"nitro-targeted-offer-icon",style:{backgroundImage:`url(${K("image.library.url")+t.iconImageUrl})`}}),e.jsx(N,{variant:"light",className:"ubuntu-bold",children:t.title})]})},Vy=a=>{const{offer:t=null,setOpen:s=null}=a,{getCurrencyAmount:n}=Ur(),[r,i]=o.useState(1),l=o.useMemo(()=>{let h=!1,u=!1,g=!1;return t.priceInCredits>0&&(h=n(-1)>=t.priceInCredits),t.priceInActivityPoints>0?u=n(t.activityPointType)>=t.priceInActivityPoints:u=!0,t.purchaseLimit>0&&(g=!0),h&&u&&g},[t,n]),c=()=>{let h=Math.max(0,(t.expirationTime-Date.now())/1e3);return Zs.format(h)},m=()=>{D(new lE(t.id,r)),D(new Hm)};if(t)return e.jsxs(ie,{theme:"primary-slim",uniqueKey:"targeted-offer",className:"nitro-targeted-offer",children:[e.jsx(re,{headerText:d(t.title),onCloseClick:h=>s(!1)}),e.jsx(Qm,{position:"relative",className:"justify-content-center align-items-center cursor-pointer",variant:"danger",gap:3,children:d("targeted.offer.timeleft",["timeleft"],[c()])}),e.jsxs(se,{gap:1,children:[e.jsxs(w,{gap:1,fullHeight:!0,children:[e.jsxs(w,{gap:1,column:!0,className:"w-75 text-black",children:[e.jsxs(v,{className:"bg-warning p-2",fullHeight:!0,children:[e.jsx("h4",{children:d(t.title)}),e.jsx(A,{dangerouslySetInnerHTML:{__html:t.description}})]}),e.jsxs(w,{alignSelf:"center",alignItems:"center",justifyContent:"center",gap:2,children:[t.purchaseLimit>1&&e.jsxs(w,{gap:1,children:[e.jsx(N,{variant:"muted",children:d("catalog.bundlewidget.quantity")}),e.jsx("input",{type:"number",value:r,onChange:h=>i(parseInt(h.target.value)),min:1,max:t.purchaseLimit})]}),e.jsx(P,{variant:"primary",disabled:!l,onClick:()=>m(),children:d("targeted.offer.button.buy")})]})]}),e.jsx(A,{className:"w-50",fullHeight:!0,style:{background:`url(${K("image.library.url")+t.imageUrl}) no-repeat center`}})]}),e.jsxs(w,{className:"price-ray position-absolute",alignItems:"center",justifyContent:"center",column:!0,children:[e.jsx(N,{children:d("targeted.offer.price.label")}),t.priceInCredits>0&&e.jsxs(w,{gap:1,children:[e.jsx(N,{variant:"light",children:t.priceInCredits}),e.jsx(Nt,{type:-1})]}),t.priceInActivityPoints>0&&e.jsxs(w,{gap:1,children:[e.jsxs(N,{className:"ubuntu-bold",variant:"light",children:["+",t.priceInActivityPoints]})," ",e.jsx(Nt,{type:t.activityPointType})]})]})]})]})},Gy=()=>{const[a,t]=o.useState(null),[s,n]=o.useState(!1);if(M(cE,r=>{let i=r.getParser();i&&t(i.data)}),Bc(()=>{D(new Hm)}),!!a)return e.jsx(e.Fragment,{children:s?e.jsx(Vy,{offer:a,setOpen:n}):e.jsx(Fy,{offer:a,setOpen:n})})},By=a=>{const[t,s]=o.useState(0),[n,r]=o.useState(null),[i,l]=o.useState(!0),{showConfirm:c=null}=Fe();M(Wm,f=>{s(0),r(null)}),M(Em,f=>{s(0),r(null)}),M(gi,f=>{const p=f.getParser();p.roomEnter&&(p.data.habboGroupId>0?(s(p.data.habboGroupId),D(new Wi(p.data.habboGroupId,!1))):(s(0),r(null)))}),M(uE,f=>{const p=f.getParser();!n||p.groupId!==n.id&&p.groupId!==t||(s(0),r(null))}),M(oa,f=>{const p=f.getParser();p.id===t&&r(p)});const m=()=>{c(d("group.leaveconfirm.desc"),()=>{D(new Ec(n.id,B().userId))},null)},h=n&&n.ownerName===B().userName,u=()=>{if(h)return"group.manage";if(n.type===Ts.PRIVATE)return"";if(n.membershipType===Dt.MEMBER)return"group.leave";if(n.membershipType===Dt.NOT_MEMBER&&n.type===Ts.REGULAR)return"group.join";if(n.membershipType===Dt.REQUEST_PENDING)return"group.membershippending";if(n.membershipType===Dt.NOT_MEMBER&&n.type===Ts.EXCLUSIVE)return"group.requestmembership"},g=()=>{if(h)return dh(n.id);if(!(n.type===Ts.PRIVATE&&n.membershipType===Dt.NOT_MEMBER)){if(n.membershipType===Dt.MEMBER){m();return}kc(n.id)}};return n?e.jsx(A,{className:"nitro-notification-bubble rounded",children:e.jsxs(v,{children:[e.jsxs(w,{alignItems:"center",justifyContent:"between",pointer:!0,onClick:f=>l(p=>!p),children:[e.jsx(N,{variant:"white",children:d("group.homeroominfo.title")}),i&&e.jsx(Cc,{className:"fa-icon"}),!i&&e.jsx(Nc,{className:"fa-icon"})]}),i&&e.jsxs(e.Fragment,{children:[e.jsxs(w,{pointer:!0,alignItems:"center",gap:2,onClick:f=>ca(n.id),children:[e.jsx(A,{className:"group-badge",children:e.jsx(mt,{badgeCode:n.badge,isGroup:!0})}),e.jsx(N,{variant:"white",children:n.title})]}),(n.type!==Ts.PRIVATE||h)&&e.jsx(P,{fullWidth:!0,variant:"success",disabled:n.membershipType===Dt.REQUEST_PENDING,onClick:g,children:d(u())})]})]})}):null},Hy=a=>{const{title:t="Nitro Cool UI Edit",onClose:s=null,...n}=a;return e.jsx(MN,{title:t,onClose:s,classNames:["nitro-credits"],...n,children:e.jsxs(ne,{children:[e.jsx(v,{size:12,children:e.jsx("div",{className:"nitro-logo-default"})}),e.jsxs(v,{size:10,children:[e.jsxs(v,{alignItems:"center",gap:1,children:[e.jsx(N,{bold:!0,fontSize:5,children:"Nitro React"}),e.jsx(N,{children:"Nitro was created by billsonnn"}),e.jsx("div",{className:"spacer"}),e.jsx(N,{children:"Nitro Versions"}),e.jsxs(N,{children:[e.jsx("b",{children:"Nitro:"})," ",uh()]})]}),e.jsxs(v,{alignItems:"center",children:[e.jsxs(N,{children:[e.jsx("b",{children:"Renderer:"})," v",hN()]}),e.jsxs(v,{fullWidth:!0,gap:1,children:[e.jsx(P,{fullWidth:!0,variant:"success",onClick:r=>window.open("https://discord.nitrodev.co"),children:"Nitro Discord"}),e.jsxs(w,{gap:1,children:[e.jsx(P,{fullWidth:!0,onClick:r=>window.open("https://git.krews.org/nitro/nitro-react"),children:"Nitro Git"}),e.jsx(P,{fullWidth:!0,onClick:r=>window.open("https://git.krews.org/nitro/nitro-react/-/issues"),children:"Nitro Bug Report"})]})]})]})]}),e.jsx("div",{className:"mysterytrophy-image"}),e.jsx(v,{size:12,children:e.jsx("div",{className:"credits-divider"})}),e.jsx(v,{size:12,children:e.jsxs(w,{alignItems:"center",gap:2,children:[e.jsx(v,{size:6,justifyContent:"start",children:e.jsx("div",{className:"nitro-coolui-logo"})}),e.jsxs(v,{size:6,alignItems:"left",gap:0,children:[e.jsx(N,{center:!0,bold:!0,fontSize:5,children:"Cool UI"}),e.jsx(N,{children:"Was created by Wassehk"}),e.jsx(N,{children:"- DuckieTM (Re-Design)"}),e.jsx(N,{children:"- Jonas (Contributing)"}),e.jsx(N,{children:"- Ohlucas (Sunset resources)"}),e.jsx(N,{center:!0,bold:!0,small:!0,children:"v1.5.0"}),e.jsx(P,{fullWidth:!0,onClick:r=>window.open("https://github.com/duckietm/Nitro-Cool-UI"),children:"Cool UI Git"})]})]})}),e.jsx(v,{size:12,children:e.jsx("div",{className:"credits-divider"})}),e.jsx(v,{size:10,children:e.jsxs(v,{alignItems:"center",gap:1,children:[e.jsx(N,{center:!0,bold:!0,fontSize:5,children:"Special Thanks"}),e.jsx(N,{children:"The whole Discord community !!"}),e.jsx(N,{children:"- Billsonnn for creating Nitro."}),e.jsx(N,{children:"- Remco for testing."}),e.jsx(N,{children:"- Object from Atom."}),e.jsx(N,{children:"- Habbo for providing the assets"})]})}),e.jsx("div",{className:"notification-frank"})]})})},Wy=a=>{const{item:t=null,title:s=a.item&&a.item.title||"",onClose:n=null,...r}=a,[i,l]=o.useState(!1),c=()=>{Dr(t.clickUrl),n()},m=t.alertType===pe.DEFAULT,h=e.jsxs(v,{alignItems:"center",center:!0,gap:0,className:"my-1",children:[!t.clickUrl&&e.jsx(P,{onClick:n,variant:"success",children:d("generic.close")}),t.clickUrl&&t.clickUrl.length>0&&e.jsx(P,{variant:"success",onClick:c,children:d(t.clickUrlText)})]});return e.jsx(Pc,{title:s,onClose:n,...r,type:m?pe.DEFAULT:t.alertType,options:h,children:e.jsxs(w,{fullHeight:!0,overflow:"auto",gap:m||t.imageUrl&&!i?2:0,children:[m&&!t.imageUrl&&e.jsx(A,{className:"notification-frank flex-shrink-0"}),t.imageUrl&&!i&&e.jsx("img",{src:t.imageUrl,alt:t.title,onError:()=>{l(!0)},className:"align-self-baseline"}),e.jsx(A,{classNames:["notification-text overflow-y-auto d-flex flex-column w-100",t.clickUrl&&!m?"justify-content-center":""],children:t.messages.length>0&&t.messages.map((u,g)=>{const f=u.replace(/\r\n|\r|\n/g,"
");return e.jsx(A,{dangerouslySetInnerHTML:{__html:f}},g)})})]})})},qy=a=>{const{item:t=null,title:s=a.item&&a.item.title||"",onClose:n=null,...r}=a,[i,l]=o.useState(""),[c,m]=o.useState([]),h=()=>{Dr(t.clickUrl),n()},u=f=>{let p=JSON.parse(t.messages[0]);m(p.filter(x=>x.includes(f))),l(f)};o.useEffect(()=>{m(JSON.parse(t.messages[0]))},[t]);const g=t.clickUrl&&t.clickUrl.startsWith("event:");return e.jsxs(Pc,{title:s,onClose:n,...r,children:[e.jsx(w,{fullWidth:!0,alignItems:"center",position:"relative",children:e.jsx("input",{type:"text",className:"form-control form-control-sm",placeholder:d("generic.search"),value:i,onChange:f=>u(f.target.value)})}),e.jsx(v,{fullHeight:!0,className:"py-1",overflow:"hidden",children:e.jsx(Pe,{gap:1,columnCount:1,children:c&&c.map((f,p)=>e.jsx("span",{children:f},p))})}),e.jsx("hr",{className:"my-2"}),e.jsxs(v,{alignItems:"center",center:!0,gap:1,children:[!g&&!t.clickUrl&&e.jsx(P,{onClick:n,children:d("generic.close")}),t.clickUrl&&t.clickUrl.length>0&&e.jsx(P,{onClick:h,children:d(t.clickUrlText)})]})]})},zy=(a,t)=>{if(!a)return null;const s=a.id,n={item:a,onClose:t};switch(a.alertType){case pe.NITRO:return e.jsx(Hy,{...n},s);case pe.SEARCH:return e.jsx(qy,{...n},s);default:return e.jsx(Wy,{...n},s)}},Yy=a=>{const{item:t=null,onClose:s=null,...n}=a;return e.jsxs(Lc,{fadesOut:!1,className:"flex-column club-gift",onClose:s,...n,children:[e.jsxs("div",{className:"d-flex align-items-center gap-2 mb-2",children:[e.jsx(Nt,{type:"hc",className:"flex-shrink-0"}),e.jsx("span",{className:"ms-1",children:d("notifications.text.club_gift")})]}),e.jsxs("div",{className:"d-flex align-items-center justify-content-end gap-2",children:[e.jsx("button",{type:"button",className:"btn btn-success w-100 btn-sm",onClick:()=>Dr(t.linkUrl),children:d("notifications.button.show_gift_list")}),e.jsx("span",{className:"text-decoration-underline cursor-pointer text-nowrap",onClick:s,children:d("notifications.button.later")})]})]})},$y=a=>{const{item:t=null,onClose:s=null,...n}=a,r=t.message.replace(/\r\n|\r|\n/g,"
");return e.jsxs(Lc,{onClose:s,gap:2,alignItems:"center",onClick:i=>t.linkUrl&&t.linkUrl.length&&Dr(t.linkUrl),...n,children:[e.jsx(w,{center:!0,className:"bubble-image-container",children:t.iconUrl&&t.iconUrl.length&&e.jsx("img",{className:"no-select",src:t.iconUrl,alt:""})}),e.jsx(N,{wrap:!0,variant:"white",dangerouslySetInnerHTML:{__html:r}})]})},Ky=(a,t)=>{if(!a)return null;const s={item:a,onClose:t};switch(a.notificationType){case ss.CLUBGIFT:return e.jsx(Yy,{...s},a.id);default:return e.jsx($y,{...s},a.id)}},Xy=a=>{const{item:t=null,onClose:s=null,...n}=a,{message:r=null,onConfirm:i=null,onCancel:l=null,confirmText:c=null,cancelText:m=null,title:h=null}=t,u=()=>{i&&i(),s()},g=()=>{l&&l(),s()};return e.jsxs(Pc,{title:h,onClose:s,...n,type:pe.ALERT,children:[e.jsx(w,{grow:!0,center:!0,children:e.jsx(N,{children:r})}),e.jsxs(w,{gap:1,children:[e.jsx(P,{fullWidth:!0,variant:"danger",onClick:g,children:m}),e.jsx(P,{fullWidth:!0,onClick:u,children:c})]})]})},Qy=(a,t)=>{if(!a)return null;const s={key:a.id,item:a,onClose:t};switch(a.confirmType){default:return e.jsx(Xy,{...s})}},Jy=a=>{const{alerts:t=[],bubbleAlerts:s=[],confirms:n=[],closeAlert:r=null,closeBubbleAlert:i=null,closeConfirm:l=null}=Fe(),c=o.useMemo(()=>!t||!t.length?null:t.map(u=>zy(u,()=>r(u))),[t,r]),m=o.useMemo(()=>!s||!s.length?null:s.map(u=>{const g=Ky(u,()=>i(u));return u.notificationType===ss.CLUBGIFT,g}),[s,i]),h=o.useMemo(()=>!n||!n.length?null:n.map(u=>Qy(u,()=>l(u))),[n,l]);return e.jsxs(e.Fragment,{children:[e.jsx(v,{gap:1,className:"topnotifications",children:m}),h,c]})},vd=a=>{const{type:t=-1,amount:s=-1,short:n=!1}=a,r=o.useMemo(()=>e.jsxs(P,{gap:1,className:`nitro-purse-button rounded allcurrencypurse nitro-purse-button currency-${t}`,variant:"f-grey",onClick:()=>Z("catalog/open/currency-"+t),children:[e.jsx(N,{truncate:!0,bold:!0,textEnd:!0,variant:"white",grow:!0,children:n?HC(s):Xi(s)}),e.jsx(Nt,{type:t})]}),[s,n,t]);return n?e.jsx(Um,{placement:"top",overlay:e.jsxs(dE,{id:`tooltip-${t}`,children:[" ",Xi(s)," "]}),children:r}):r},Zy=a=>{const{type:t=-1,amount:s=-1}=a;return e.jsx(w,{fullWidth:!0,justifyContent:"between",className:"nitro-purse-seasonal-currency nitro-notification "+K("currency.seasonal.color"),children:e.jsxs(w,{fullWidth:!0,children:[e.jsx(N,{bold:!0,truncate:!0,fullWidth:!0,variant:"white",className:"seasonal-padding seasonal-bold",children:d(`purse.seasonal.currency.${t}`)}),e.jsx(N,{bold:!0,truncate:!0,variant:"white",className:"seasonal-amount text-end",title:s>99999?Xi(s):"",children:s>99999?"99 999":Xi(s)}),e.jsx(w,{className:"nitro-seasonal-box seasonal-padding",children:e.jsx(Nt,{type:t})})]})})},eR=a=>{const{purse:t=null,hcDisabled:s=!1}=Ur(),n=o.useMemo(()=>K("system.currency.types",[]),[]),r=o.useMemo(()=>K("currency.display.number.short",!1),[]),i=(()=>{if(!t)return null;const c=t.clubPeriods*31+t.clubDays,m=t.minutesUntilExpiration;return t.clubLevel===Bt.NO_CLUB?d("purse.clubdays.zero.amount.text"):m>-1&&m<60*24?Zs.shortFormat(m*60):Zs.shortFormat(c*86400)})(),l=(c,m=-1,h=!1)=>{if(!t||!t.activityPoints||!t.activityPoints.size)return null;const u=Array.from(t.activityPoints.keys()).filter(p=>n.indexOf(p)>=0);u.sort((p,x)=>p===0?-1:x===0?1:p===5?-1:x===5?1:p-x);let g=0;for(;g-1&&g===m)break;h?f.push(e.jsx(Zy,{type:p,amount:t.activityPoints.get(p)},p)):f.push(e.jsx(vd,{type:p,amount:t.activityPoints.get(p),short:r},p)),g++}return f};return t?e.jsx(v,{alignItems:"end",className:"nitro-purse-container",gap:1,children:e.jsx(w,{className:"nitro-purse rounded-bottom p-1",children:e.jsxs(ne,{fullWidth:!0,gap:1,children:[e.jsxs(v,{justifyContent:"center",size:s?10:6,gap:0,children:[e.jsx(vd,{type:-1,amount:t.credits,short:r}),l(0,2)]}),!s&&e.jsxs(v,{center:!0,pointer:!0,size:4,gap:1,className:"nitro-purse-subscription rounded borderhccontent",onClick:c=>Z("habboUI/open/hccenter"),children:[e.jsx(Nt,{type:"hc"}),e.jsx(N,{variant:"white",children:i})]}),e.jsxs(v,{justifyContent:"center",size:1,gap:0,children:[e.jsx(w,{center:!0,pointer:!0,fullHeight:!0,className:"nitro-purse-button p-1 rounded coffecurrencybutton",onClick:c=>Z("help/show"),children:e.jsx("i",{className:"icon icon-help"})}),e.jsx(w,{center:!0,pointer:!0,fullHeight:!0,className:"nitro-purse-button p-1 rounded coffecurrencybutton",onClick:c=>Z("user-settings/toggle"),children:e.jsx("i",{className:"icon icon-cog"})})]}),e.jsx(v,{justifyContent:"center",size:11,gap:0,children:l(2,-1,!0)})]})})}):null},tR={purple:9452386,blue:3891856,green:6459451,yellow:10658089,lilac:6897548,orange:10841125,turquoise:2661026,red:10104881},sR=a=>{const[t,s]=o.useState(!0),[n,r]=o.useState(""),[i,l]=o.useState("");HN(mE.MYSTERY_BOX_KEYS_UPDATE,m=>{r(m.keyColor),l(m.boxColor)});const c=m=>{const h=tR[m];return ms.int2rgb(h)};return n===""&&i===""?null:e.jsx(A,{className:"nitro-notification-bubble rounded mysterybox-extension",children:e.jsxs(v,{children:[e.jsxs(w,{alignItems:"center",justifyContent:"between",pointer:!0,onClick:m=>s(h=>!h),children:[e.jsx(N,{variant:"white",children:d("mysterybox.tracker.title")}),t&&e.jsx(Cc,{className:"fa-icon"}),!t&&e.jsx(Nc,{className:"fa-icon"})]}),t&&e.jsxs(e.Fragment,{children:[e.jsx(N,{variant:"white",children:d("mysterybox.tracker.description")}),e.jsxs(w,{justifyContent:"center",alignItems:"center",gap:2,children:[e.jsx(Ce,{className:"mysterybox-container",children:e.jsx("div",{className:"box-image flex-shrink-0",style:{backgroundColor:c(i)},children:e.jsx("div",{className:"chain-overlay-image"})})}),e.jsx(Ce,{className:"mysterybox-container",children:e.jsx("div",{className:"key-image flex-shrink-0",style:{backgroundColor:c(n)},children:e.jsx("div",{className:"key-overlay-image"})})})]})]})]})})},nR=a=>{const{eventId:t=-1,eventName:s="",eventDescription:n="",setIsEditingPromote:r=null}=a,[i,l]=o.useState(s),[c,m]=o.useState(n),h=()=>{D(new hE(t,i,c)),r(!1)};return e.jsxs(ie,{className:"nitro-guide-tool",theme:"primary-slim",children:[e.jsx(re,{headerText:d("navigator.eventsettings.editcaption"),onCloseClick:()=>r(!1)}),e.jsxs(se,{className:"text-black",children:[e.jsxs(v,{children:[e.jsx(N,{bold:!0,children:d("navigator.eventsettings.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",placeholder:d("navigator.eventsettings.name"),maxLength:64,value:i,onChange:u=>l(u.target.value)})]}),e.jsxs(v,{children:[e.jsx(N,{bold:!0,children:d("navigator.eventsettings.desc")}),e.jsx("textarea",{className:"form-control form-control-sm",placeholder:d("navigator.eventsettings.desc"),maxLength:64,value:c,onChange:u=>m(u.target.value)})]}),e.jsx(v,{children:e.jsx(P,{fullWidth:!0,disabled:!i||!c,variant:!i||!c?"danger":"success",onClick:u=>h(),children:d("navigator.eventsettings.edit")})})]})]})},rR=a=>{const{eventDescription:t="",setIsEditingPromote:s=null}=a,{setIsExtended:n}=Gc(),r=()=>{n(!0),Z("catalog/open/room_event")};return e.jsxs(e.Fragment,{children:[e.jsx(w,{alignItems:"center",gap:2,style:{overflowWrap:"anywhere"},children:e.jsx(N,{variant:"white",children:t})}),e.jsx("br",{}),e.jsx("br",{}),e.jsxs(ne,{className:"d-flex align-items-center justify-content-end gap-2",children:[e.jsx(P,{className:"btn btn-primary w-100 btn-sm",onClick:i=>s(!0),children:d("navigator.roominfo.editevent")}),e.jsx(P,{className:"btn btn-success w-100 btn-sm",onClick:i=>r(),children:d("roomad.extend.event")})]})]})},iR=a=>{const{eventDescription:t=""}=a;return e.jsxs(e.Fragment,{children:[e.jsx(w,{alignItems:"center",gap:2,style:{overflowWrap:"anywhere"},children:e.jsx(N,{variant:"white",children:t})}),e.jsx("br",{}),e.jsx("br",{}),e.jsx(v,{alignItems:"center",gap:1,children:e.jsxs(A,{fullWidth:!0,overflow:"hidden",position:"relative",className:"bg-light-dark rounded",children:[e.jsx(w,{fit:!0,center:!0,position:"absolute",children:e.jsx(N,{variant:"white",center:!0,children:d("navigator.eventinprogress")})}),e.jsx(N,{children:" "})]})})]})},aR=a=>{const[t,s]=o.useState(!1),[n,r]=o.useState(!0),{promoteInformation:i,setPromoteInformation:l}=Gc();return M(Wm,c=>{l(null)}),i?e.jsx(e.Fragment,{children:i.data.adId!==-1&&e.jsx(A,{className:"nitro-notification-bubble rounded",children:e.jsxs(v,{children:[e.jsxs(w,{alignItems:"center",justifyContent:"between",pointer:!0,onClick:c=>r(m=>!m),children:[e.jsx(N,{variant:"white",overflow:"hidden",children:i.data.eventName}),n&&e.jsx(Cc,{className:"fa-icon"}),!n&&e.jsx(Nc,{className:"fa-icon"})]}),n&&B().userId!==i.data.ownerAvatarId&&e.jsx(iR,{eventDescription:i.data.eventDescription}),n&&B().userId===i.data.ownerAvatarId&&e.jsx(rR,{eventDescription:i.data.eventDescription,setIsEditingPromote:()=>s(!0)}),t&&e.jsx(nR,{eventId:i.data.adId,eventName:i.data.eventName,eventDescription:i.data.eventDescription,setIsEditingPromote:()=>s(!1)})]})})}):null},oR=a=>e.jsx("div",{className:"nitro-right-side",children:e.jsxs(v,{position:"relative",gap:1,children:[e.jsx(eR,{}),e.jsx(By,{}),e.jsx(sR,{}),e.jsx(Gy,{}),e.jsx(aR,{}),e.jsx(Jy,{})]})}),lR=a=>e.jsx("div",{className:"room-spectator"}),cR=a=>{const[t,s]=o.useState(null),[n,r]=o.useState(null),{chatStyleId:i=0}=zn(),{roomSession:l=null}=ke();M(gE,m=>{const h=m.getParser();if(!h)return;const u=l.userDataManager.getPetData(h.petId);u&&(s(u),r(h))});const c=(m,h)=>{!m||!h||l==null||l.sendChatMessage(`${m} ${h}`,i)};return!t||!n?null:e.jsxs(ie,{uniqueKey:"user-settings",className:"user-settings-window no-resize",theme:"primary-slim",children:[e.jsx(re,{headerText:d("widgets.pet.commands.title"),onCloseClick:()=>r(null)}),e.jsxs(se,{className:"text-black",children:[e.jsx(w,{alignItems:"center",justifyContent:"center",gap:2,children:e.jsxs(ne,{columnCount:2,children:[e.jsx(v,{fullWidth:!0,overflow:"hidden",className:"body-image pet p-1",children:e.jsx(xn,{figure:t.figure,posture:"std",direction:2})}),e.jsx(N,{variant:"black",small:!0,wrap:!0,children:t.name})]})}),e.jsx(ne,{columnCount:2,children:n.commands&&n.commands.length>0&&n.commands.map((m,h)=>e.jsx(P,{disabled:!n.enabledCommands.includes(m),onClick:()=>c(t.name,d(`pet.command.${m}`)),children:d(`pet.command.${m}`)},h))})]})]})},rs=a=>{const{justifyContent:t="center",alignItems:s="center",classNames:n=[],...r}=a,i=o.useMemo(()=>{const l=["menu-header","p-1"];return n.length&&l.push(...n),l},[n]);return e.jsx(w,{justifyContent:t,alignItems:s,classNames:i,...r})},uR=a=>{const{chatEvent:t=null,onClose:s=null}=a,[n,r]=o.useState(t.chat==="${bot.skill.chatter.configuration.text.placeholder}"?"":t.chat),[i,l]=o.useState(t.automaticChat),[c,m]=o.useState(t.mixSentences),[h,u]=o.useState(t.chatDelay),g=o.useMemo(()=>Sc(ye().roomId,t.objectId,t.category,1),[t]),f=x=>x.replace(/;#;/g," ").replace(/\r\n|\r|\n/g,"\r"),p=()=>{const x=f(n)+";#;"+i+";#;"+h+";#;"+c;D(new Pn(t.botId,ze.SETUP_CHAT,x)),s()};return e.jsx(Mr,{windowPosition:Tt.NOTHING,handleSelector:".drag-handler",dragStyle:{top:g.y,left:g.x},children:e.jsxs(A,{className:"nitro-context-menu bot-chat",children:[e.jsx(rs,{className:"drag-handler",children:d("bot.skill.chatter.configuration.title")}),e.jsxs(v,{className:"p-1",children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{variant:"white",children:d("bot.skill.chatter.configuration.chat.text")}),e.jsx("textarea",{className:"form-control form-control-sm",placeholder:d("bot.skill.chatter.configuration.text.placeholder"),value:n,rows:7,onChange:x=>r(x.target.value)})]}),e.jsxs(v,{gap:1,children:[e.jsxs(w,{gap:1,alignItems:"center",justifyContent:"between",children:[e.jsx(N,{fullWidth:!0,variant:"white",children:d("bot.skill.chatter.configuration.automatic.chat")}),e.jsx("input",{type:"checkbox",className:"form-check-input",checked:i,onChange:x=>l(x.target.checked)})]}),e.jsxs(w,{gap:1,alignItems:"center",justifyContent:"between",children:[e.jsx(N,{fullWidth:!0,variant:"white",children:d("bot.skill.chatter.configuration.markov")}),e.jsx("input",{type:"checkbox",className:"form-check-input",checked:c,onChange:x=>m(x.target.checked)})]}),e.jsxs(w,{gap:1,alignItems:"center",justifyContent:"between",children:[e.jsx(N,{fullWidth:!0,variant:"white",children:d("bot.skill.chatter.configuration.chat.delay")}),e.jsx("input",{type:"number",className:"form-control form-control-sm",value:h,onChange:x=>u(x.target.valueAsNumber)})]})]}),e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:1,children:[e.jsx(P,{fullWidth:!0,variant:"primary",onClick:s,children:d("cancel")}),e.jsx(P,{fullWidth:!0,variant:"success",onClick:p,children:d("save")})]})]})]})})},_d=-1,Sd=0,wd=1,Td=2,yd=3,Rd=4,Od=5,kd=6,dR=a=>{const{item:t=null,onClose:s=null}=a,[n,r]=o.useState(_d),[i,l]=o.useState(null),[c,m]=o.useState(null),{roomSession:h=null}=ke(),u=()=>{i&&H().selectRoomObject(h.roomId,i.roomIndex,X.UNIT)},g=()=>{h.usePetProduct(t.requestRoomObjectId,i.webID),s()},f=o.useMemo(()=>{if(!i||!c)return null;const p=new ci(i.figure),x=c.customParams.split(" "),I=parseInt(x[0]);switch(c.specialType){case de.PET_SHAMPOO:{if(x.length<2)return null;const j=H().getPetColorResult(I,p.paletteId),E=H().getPetColorResultsForTag(I,x[1]);let C=-1;for(const b of E)if(b.breed===j.breed){C=parseInt(b.id);break}return e.jsx(xn,{typeId:p.typeId,paletteId:C,petColor:p.color,customParts:p.customParts,direction:2})}case de.PET_CUSTOM_PART:{if(x.length<4)return null;const j=[],E=x[1].split(",").map(S=>parseInt(S)),C=x[2].split(",").map(S=>parseInt(S)),b=x[3].split(",").map(S=>parseInt(S));let _=0;for(;_parseInt(_)),C=x[2].split(",").map(_=>parseInt(_));let b=0;for(;bparseInt(S)),C=x[2].split(",").map(S=>parseInt(S)),b=x[3].split(",").map(S=>parseInt(S));let _=0;for(;_{const p=h.userDataManager.getUserDataByIndex(t.id);l(p);const x=zo(h.roomId,t.requestRoomObjectId,X.FLOOR);if(!x)return;m(x);let I=_d;switch(x.specialType){case de.PET_SHAMPOO:I=Sd;break;case de.PET_CUSTOM_PART:I=wd;break;case de.PET_CUSTOM_PART_SHAMPOO:I=Td;break;case de.PET_SADDLE:I=yd;break;case de.MONSTERPLANT_REVIVAL:I=Rd;break;case de.MONSTERPLANT_REBREED:I=Od;break;case de.MONSTERPLANT_FERTILIZE:I=kd;break}r(I)},[h,t]),i?e.jsxs(ie,{className:"nitro-use-product-confirmation",children:[e.jsx(re,{headerText:d("useproduct.widget.title",["name"],[i.name]),onCloseClick:s}),e.jsx(se,{center:!0,children:e.jsxs(w,{gap:2,overflow:"hidden",children:[e.jsx(v,{children:e.jsx(A,{pointer:!0,className:"product-preview",onClick:u,children:f})}),e.jsxs(v,{justifyContent:"between",overflow:"auto",children:[e.jsxs(v,{gap:2,children:[n===Sd&&e.jsxs(e.Fragment,{children:[e.jsx(N,{children:d("useproduct.widget.text.shampoo",["productName"],[c.name])}),e.jsx(N,{children:d("useproduct.widget.info.shampoo")})]}),n===wd&&e.jsxs(e.Fragment,{children:[e.jsx(N,{children:d("useproduct.widget.text.custompart",["productName"],[c.name])}),e.jsx(N,{children:d("useproduct.widget.info.custompart")})]}),n===Td&&e.jsxs(e.Fragment,{children:[e.jsx(N,{children:d("useproduct.widget.text.custompartshampoo",["productName"],[c.name])}),e.jsx(N,{children:d("useproduct.widget.info.custompartshampoo")})]}),n===yd&&e.jsxs(e.Fragment,{children:[e.jsx(N,{children:d("useproduct.widget.text.saddle",["productName"],[c.name])}),e.jsx(N,{children:d("useproduct.widget.info.saddle")})]}),n===Rd&&e.jsxs(e.Fragment,{children:[e.jsx(N,{children:d("useproduct.widget.text.revive_monsterplant",["productName"],[c.name])}),e.jsx(N,{children:d("useproduct.widget.info.revive_monsterplant")})]}),n===Od&&e.jsxs(e.Fragment,{children:[e.jsx(N,{children:d("useproduct.widget.text.rebreed_monsterplant",["productName"],[c.name])}),e.jsx(N,{children:d("useproduct.widget.info.rebreed_monsterplant")})]}),n===kd&&e.jsxs(e.Fragment,{children:[e.jsx(N,{children:d("useproduct.widget.text.fertilize_monsterplant",["productName"],[c.name])}),e.jsx(N,{children:d("useproduct.widget.info.fertilize_monsterplant")})]})]}),e.jsxs(w,{alignItems:"center",justifyContent:"between",children:[e.jsx(P,{variant:"danger",onClick:s,children:d("useproduct.widget.cancel")}),e.jsx(P,{variant:"success",onClick:g,children:d("useproduct.widget.use")})]})]})]})})]}):null},W=a=>{const{disabled:t=!1,fullWidth:s=!0,justifyContent:n="center",alignItems:r="center",classNames:i=[],onClick:l=null,...c}=a,m=u=>{t||l&&l(u)},h=o.useMemo(()=>{const u=["menu-item","list-item"];return t&&u.push("disabled"),i.length&&u.push(...i),u},[t,i]);return e.jsx(w,{fullWidth:s,justifyContent:n,alignItems:r,classNames:h,onClick:m,...c})},mR=a=>{const{justifyContent:t="center",alignItems:s="center",classNames:n=[],collapsed:r=!0,...i}=a,l=o.useMemo(()=>{const c=["menu-footer"];return n.length&&c.push(...n),c},[n]);return e.jsxs(w,{justifyContent:t,alignItems:s,classNames:l,...i,children:[!r&&e.jsx(gc,{className:"fa-icon align-self-center"}),r&&e.jsx(hc,{className:"fa-icon align-self-center"})]})},hR=25,Ad=3,gR=5e3,fR=75,qr=10;let Rl=!1,Wa=null,qa=-1e6,Ol=1;const yn=a=>{const{objectId:t=-1,category:s=-1,userType:n=-1,fades:r=!1,onClose:i=null,position:l="absolute",classNames:c=[],style:m={},children:h=null,collapsable:u=!1,...g}=a,[f,p]=o.useState({x:null,y:null}),[x,I]=o.useState(1),[j,E]=o.useState(!1),[C,b]=o.useState(Rl),_=o.useRef(),S=o.useCallback(R=>{if(!j)return;Ol+=R;let y=(1-Ol/fR)*1;if(y<=0)return i(),!1;I(y)},[j,i]),T=o.useCallback((R,y)=>{if(!R||!y||!Wa)return;let O=-_.current.offsetHeight;n>-1&&(n===dt.USER||n===dt.BOT||n===dt.RENTABLE_BOT)?O=O+(R.height>50?15:0):O=O-14,Wa.addValue(y.y-R.top);let F=Wa.getMax();FU&&(Y=U),qJ&&(q=J),p({x:Y,y:q})},[n]),L=o.useMemo(()=>{const R=["nitro-context-menu"];return C&&R.push("menu-hidden"),R.push(f.x!==null?"visible":"invisible"),c.length&&R.push(...c),R},[f,c,C]),k=o.useMemo(()=>{let R={};return R.left=f.x||0,R.top=f.y||0,R.opacity=x,Object.keys(m).length&&(R={...R,...m}),R},[f,x,m]);return o.useEffect(()=>{if(!_.current)return;const R=y=>{if(!_.current)return;S(y);const O=Sc(ye().roomId,t,s),F=th(ye().roomId,t,s);T(O,F)};return Wn().add(R),()=>{Wn().remove(R)}},[t,s,S,T]),o.useEffect(()=>{if(!r)return;const R=setTimeout(()=>E(!0),gR);return()=>clearTimeout(R)},[r]),o.useEffect(()=>{Rl=C},[C]),o.useEffect(()=>{Wa=new fE(hR),qa=-1e6,Ol=1},[]),e.jsxs(A,{innerRef:_,position:l,classNames:L,style:k,...g,children:[!(u&&Rl)&&h,u&&e.jsx(mR,{onClick:()=>b(!C),collapsed:C})]})},Dd=0,Pd=1,Ld=2,Md=3,Ud=4,Fd=5,Vd=6,Gd=7,pR=a=>{const{item:t=null,updateConfirmingProduct:s=null,onClose:n=null}=a,[r,i]=o.useState(0),{roomSession:l=null}=ke(),c=m=>{if(m)switch(m){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(t);break}};return o.useEffect(()=>{if(!t)return;const m=zo(l.roomId,t.requestRoomObjectId,X.FLOOR);if(!m)return;let h=Dd;switch(m.specialType){case de.PET_SHAMPOO:h=Pd;break;case de.PET_CUSTOM_PART:h=Ld;break;case de.PET_CUSTOM_PART_SHAMPOO:h=Md;break;case de.PET_SADDLE:h=Ud;break;case de.MONSTERPLANT_REVIVAL:h=Fd;break;case de.MONSTERPLANT_REBREED:h=Vd;break;case de.MONSTERPLANT_FERTILIZE:h=Gd;break}i(h)},[l,t]),e.jsxs(yn,{objectId:t.id,category:X.UNIT,userType:dt.PET,onClose:n,collapsable:!0,children:[e.jsx(rs,{children:t.name}),r===Dd&&e.jsx(W,{onClick:m=>c("use_product"),children:d("infostand.button.useproduct")}),r===Pd&&e.jsx(W,{onClick:m=>c("use_product_shampoo"),children:d("infostand.button.useproduct_shampoo")}),r===Ld&&e.jsx(W,{onClick:m=>c("use_product_custom_part"),children:d("infostand.button.useproduct_custom_part")}),r===Md&&e.jsx(W,{onClick:m=>c("use_product_custom_part_shampoo"),children:d("infostand.button.useproduct_custom_part_shampoo")}),r===Ud&&e.jsxs(e.Fragment,{children:[t.replace&&e.jsx(W,{onClick:m=>c("replace_product_saddle"),children:d("infostand.button.replaceproduct_saddle")}),!t.replace&&e.jsx(W,{onClick:m=>c("use_product_saddle"),children:d("infostand.button.useproduct_saddle")})]}),r===Fd&&e.jsx(W,{onClick:m=>c("revive_monsterplant"),children:d("infostand.button.revive_monsterplant")}),r===Vd&&e.jsx(W,{onClick:m=>c("rebreed_monsterplant"),children:d("infostand.button.rebreed_monsterplant")}),r===Gd&&e.jsx(W,{onClick:m=>c("fertilize_monsterplant"),children:d("infostand.button.fertilize_monsterplant")})]})},xR=a=>{const{avatarInfo:t=null,onClose:s=null}=a;return t?e.jsx(v,{className:"nitro-infostand rounded",children:e.jsxs(v,{overflow:"visible",className:"container-fluid content-area",gap:1,children:[e.jsxs(v,{gap:1,children:[e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:1,children:[e.jsx(N,{variant:"white",small:!0,wrap:!0,children:t.name}),e.jsx(Hs,{className:"cursor-pointer fa-icon",onClick:s})]}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(v,{gap:1,children:[e.jsxs(w,{gap:1,children:[e.jsx(v,{fullWidth:!0,className:"body-image bot",children:e.jsx(nt,{figure:t.figure,direction:4})}),e.jsx(v,{grow:!0,center:!0,gap:0,children:t.badges.length>0&&t.badges.map(n=>e.jsx(mt,{badgeCode:n,showInfo:!0},n))})]}),e.jsx("hr",{className:"m-0"})]}),e.jsx(w,{alignItems:"center",className:"bg-light-dark rounded py-1 px-2",children:e.jsx(N,{fullWidth:!0,wrap:!0,textBreak:!0,variant:"white",small:!0,className:"motto-content",children:t.motto})}),t.carryItem>0&&e.jsxs(v,{gap:1,children:[e.jsx("hr",{className:"m-0"}),e.jsx(N,{variant:"white",small:!0,wrap:!0,children:d("infostand.text.handitem",["item"],[d("handitem"+t.carryItem)])})]})]})}):null},kl=0,Bd=1,Hd=2,jR=a=>{const{avatarInfo:t=null,onClose:s=null}=a,{roomSession:n=null}=ke(),[r,i]=o.useState(0),[l,c]=o.useState(!1),[m,h]=o.useState(!1),[u,g]=o.useState(!1),[f,p]=o.useState([]),[x,I]=o.useState([]),[j,E]=o.useState([]),[C,b]=o.useState([]),[_,S]=o.useState(!1),[T,L]=o.useState(0),[k,R]=o.useState(0),[y,O]=o.useState(!1),[F,V]=o.useState(!1),[Y,q]=o.useState(null),[U,J]=o.useState(!1),[je,we]=o.useState(!1),[pt,Xt]=o.useState(-1),[Oe,kt]=o.useState(""),[Re,Qt]=o.useState(""),[me,he]=o.useState({x:-1,y:-1,z:-1}),[le,Ae]=o.useState(sessionStorage.getItem("dropdownOpen")==="true"),[Ht,os]=o.useState(null),[nn,$n]=o.useState(null),[_s,Rn]=o.useState(null),[Te,Ke]=o.useState(null),[rt,Jt]=o.useState(null),fs=o.useCallback((ae,ee,ge=0,qe=0)=>{if(!t)return;const Ue=H().activeRoomId,yt=H().getRoomObject(Ue,t.id,t.category);if(!yt)return;const G=yt.getLocation().x+ae,z=yt.getLocation().y+ee,Q=ge*1e4,oe=yt.getDirection().x,Ee=qe!==0?Vr(yt,qe>0)/45:oe/45;D(new pE(t.id,G,z,Q,Ee))},[t]);function xi(ae){switch(ae.x){case 0:return 0;case 45:return 1;case 90:return 2;case 135:return 3;case 180:return 4;case 225:return 5;case 270:return 6;case 315:return 7;default:return null}}o.useEffect(()=>{const ae=n.roomId,ee=t.id,ge=t.isWallItem,qe=H().getFurniLocation(ae,ee,ge),Ue=ji(qe);Ue&&(os(Ue.x),$n(Ue.y),Rn(Ue.z));const yt=H().getFurniDirection(ae,ee,ge),G=ji(yt),z=G?xi(G):null,Q=H().getFurniState(ae,ee,ge);Ke(z),Jt(Q)},[t,n]);function ji(ae){if(!ae)return null;const ee=ae.match(/\[Vector3d: ([\d.]+), ([\d.]+), ([\d.]+)/);return ee&&ee.length===4?{x:parseFloat(ee[1]),y:parseFloat(ee[2]),z:parseFloat(ee[3])}:null}M(xE,ae=>{const ge=ae.getParser().item;if(ge.itemId!==t.id)return;const qe={x:ge.x,y:ge.y,z:ge.z};qe&&(os(qe.x),$n(qe.y),Rn(qe.z));const Ue={x:ge.direction},yt=Ue?xi(Ue):null,G=ge.state;Ke(yt),Jt(G)});const Fr=o.useCallback(ae=>{let ee=parseFloat(ae.target.value);isNaN(ee)||ee<0?ee=0:ee>40&&(ee=40),Rn(ee),fs(0,0,ee,0)},[fs]),Ii=o.useCallback(ae=>{let ee=parseFloat(ae.target.value);isNaN(ee)||ee<0?ee=0:ee>40&&(ee=40),ee=parseFloat(ee.toFixed(4)),Rn(ee),fs(0,0,ee,0)},[fs]),On=o.useCallback(ae=>{let ee=_s+ae;ee<0?ee=0:ee>40&&(ee=40),ee=parseFloat(ee.toFixed(4)),Rn(ee),fs(0,0,ee,0)},[_s,fs]);function Vr(ae,ee){if(!ae||!ae.model)return 0;let ge=[];ae.type==="monster_plant"?ge=ae.model.getValue("pet_allowed_directions"):ge=ae.model.getValue("furniture_allowed_directions");let qe=ae.getDirection().x;if(ge&&ge.length){let Ue=ge.indexOf(qe);if(Ue<0){Ue=0;for(let yt=0;yt{Xt(ae.id)},U||je),xr(EE.SIR_TRAX_SONG_INFO_RECEIVED,ae=>{if(ae.id!==pt)return;const ee=Ie().soundManager.musicController.getSongInfo(ae.id);ee&&(kt(ee.name),Qt(ee.creator))},U||je),o.useEffect(()=>{let ae=kl,ee=!1,ge=!1,qe=!1,Ue=[],yt=[],G=[],z=[],Q=!1,oe=0,Ee=0,Me=!1,jt=!1,xe=!1,ls=!1,al=-1;const ja=H().getRoomObject(n.roomId,t.id,t.isWallItem?X.WALL:X.FLOOR).getLocation();ja&&he({x:ja.x,y:ja.y,z:ja.z});const Ia=t.roomControllerLevel>=$e.GUEST;if((Ia||t.isOwner||t.isRoomOwner||t.isAnyRoomController)&&(ee=!0,ge=!t.isWallItem,t.roomControllerLevel>=$e.MODERATOR&&(Me=!0)),t.isAnyRoomController&&(jt=!0),(t.usagePolicy===Iu.EVERYBODY||t.usagePolicy===Iu.CONTROLLER&&Ia||t.extraParam===Ln.JUKEBOX&&Ia||t.extraParam===Ln.USABLE_PRODUCT&&Ia)&&(qe=!0),t.extraParam){if(t.extraParam===Ln.CRACKABLE_FURNI){const As=t.stuffData;qe=!0,Q=!0,oe=As.hits,Ee=As.target}else if(t.extraParam===Ln.JUKEBOX){const As=Ie().soundManager.musicController.getRoomItemPlaylist();As&&(al=As.nowPlayingSongId),xe=!0}else t.extraParam.indexOf(Ln.SONGDISK)===0&&(al=parseInt(t.extraParam.substr(Ln.SONGDISK.length)),ls=!0);if(Me){const As=t.extraParam.substr(Ln.BRANDING_OPTIONS.length);if(As){const bi=As.split(" ");for(const ol of bi){const hr=ol.split("=");hr&&hr.length===2&&(Ue.push(hr[0]),yt.push(hr[1]))}}}}if(Me){const As=H().getRoomObject(n.roomId,t.id,t.isWallItem?X.WALL:X.FLOOR);if(As){const bi=As.model.getValue(te.FURNITURE_CUSTOM_VARIABLES),ol=As.model.getValue(te.FURNITURE_DATA);if(bi&&bi.length)for(const hr of bi)G.push(hr),z.push(ol[hr]||"")}}t.isOwner||t.isAnyRoomController?ae=Hd:(t.isRoomOwner||t.roomControllerLevel>=$e.GUILD_ADMIN)&&(ae=Bd),t.isStickie&&(ae=kl),i(ae),c(ee),h(ge),g(qe),p(Ue),I(yt),E(G),b(z),S(Q),L(oe),R(Ee),O(Me),V(jt),q(null),J(xe),we(ls),Xt(al),t.groupId&&D(new Wi(t.groupId,!1))},[n,t]),M(oa,ae=>{const ee=ae.getParser();!t||t.groupId!==ee.id||ee.flag||(Y&&q(null),q(ee.title))}),o.useEffect(()=>{const ae=Ie().soundManager.musicController.getSongInfo(pt);kt((ae==null?void 0:ae.name)??""),Qt((ae==null?void 0:ae.creator)??"")},[pt]);const pa=o.useCallback((ae,ee)=>{const ge=Array.from(x);ge[ae]=ee,I(ge)},[x]),Gr=o.useCallback((ae,ee)=>{const ge=Array.from(C);ge[ae]=ee,b(ge)},[C]),mr=o.useCallback(()=>{if(f.length===0||x.length===0)return"";let ae="",ee=0;for(;ee{if(!(!ae||ae===""))switch(ae){case"buy_one":Z(`catalog/open/offerId/${t.purchaseOfferId}`);return;case"move":H().processRoomObjectOperation(t.id,t.category,Bs.OBJECT_MOVE);break;case"rotate":H().processRoomObjectOperation(t.id,t.category,Bs.OBJECT_ROTATE_POSITIVE);break;case"pickup":r===Hd?H().processRoomObjectOperation(t.id,t.category,Bs.OBJECT_PICKUP):H().processRoomObjectOperation(t.id,t.category,Bs.OBJECT_EJECT);break;case"use":H().useRoomObject(t.id,t.category);break;case"save_branding_configuration":{const ee=new Map,ge=mr().split(" ");if(ge)for(const qe of ge){const[Ue,yt]=qe.split("=",2);ee.set(Ue,yt)}H().modifyRoomObjectDataWithMap(t.id,t.category,Bs.OBJECT_SAVE_STUFF_DATA,ee);break}case"save_custom_variables":{const ee=new Map;for(let ge=0;ge{const ae=t.stuffData;return!ae||!(ae instanceof aa)?null:ae.getValue(2)},[t]);return t?e.jsxs(v,{gap:1,alignItems:"end",children:[e.jsx(v,{className:"nitro-infostand",children:e.jsxs(v,{overflow:"visible",className:"container-fluid content-area",gap:1,children:[e.jsxs(v,{gap:1,children:[e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:1,children:[!je&&e.jsx(N,{variant:"white",wrap:!0,children:t.name}),Oe.length>0&&e.jsx(N,{variant:"white",wrap:!0,children:Oe}),e.jsx("i",{className:"infostand-close",onClick:s})]}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(v,{gap:1,children:[e.jsxs(w,{position:"relative",gap:1,children:[t.stuffData.isUnique&&e.jsx("div",{className:"position-absolute end-0",children:e.jsx(xh,{uniqueNumber:t.stuffData.uniqueNumber,uniqueSeries:t.stuffData.uniqueSeries})}),t.stuffData.rarityLevel>-1&&e.jsx("div",{className:"position-absolute end-0",children:e.jsx(Uc,{level:t.stuffData.rarityLevel})}),t.image&&t.image.src.length&&e.jsx("img",{className:"d-block mx-auto",src:t.image.src,alt:""})]}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{fullWidth:!0,wrap:!0,textBreak:!0,variant:"white",children:t.description}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(v,{gap:1,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(Ns,{userId:t.ownerId}),e.jsx(N,{variant:"white",wrap:!0,children:d("furni.owner",["name"],[t.ownerName])})]}),t.purchaseOfferId>0&&e.jsx(w,{children:e.jsx(P,{className:"volter-button",onClick:ae=>rn("buy_one"),children:d("infostand.button.buy")})})]}),(U||je)&&e.jsxs(v,{gap:1,children:[e.jsx("hr",{className:"m-0"}),pt===-1&&e.jsx(N,{variant:"white",small:!0,wrap:!0,children:d("infostand.jukebox.text.not.playing")}),!!Oe.length&&e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(A,{className:"icon disk-icon"}),e.jsx(N,{variant:"white",small:!0,wrap:!0,children:Oe})]}),!!Re.length&&e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(A,{className:"icon disk-creator"}),e.jsx(N,{variant:"white",small:!0,wrap:!0,children:Re})]})]}),e.jsxs(v,{gap:1,children:[_&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"m-0"}),e.jsx(N,{variant:"white",wrap:!0,children:d("infostand.crackable_furni.hits_remaining",["hits","target"],[T.toString(),k.toString()])})]}),t.groupId>0&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"m-0"}),e.jsxs(w,{pointer:!0,alignItems:"center",gap:2,onClick:()=>ca(t.groupId),children:[e.jsx(mt,{badgeCode:xa(),isGroup:!0}),e.jsx(N,{variant:"white",underline:!0,children:Y})]})]}),e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"m-0"}),e.jsxs(N,{small:!0,wrap:!0,variant:"white",children:["X = ",me.x," and Y = ",me.y,e.jsx("br",{}),"BuildHeight = ",me.z<.01?0:me.z,e.jsx("br",{}),F&&e.jsxs(N,{wrap:!0,variant:"white",children:[" Room Furnishing ID: ",t.id]})]})]}),me.x>-1,y&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"m-0"}),!t.isWallItem&&l&&e.jsxs(e.Fragment,{children:[e.jsx(P,{className:"infostand-buttons px-2",onClick:()=>Ae(!le),children:le?`${d("widget.furni.present.close")} Buildtools`:`${d("navigator.roomsettings.doormode.open")} Buildtools`}),le&&e.jsx(e.Fragment,{children:e.jsxs(w,{gap:1,children:[e.jsx(v,{className:"buildtool-box buildtool-box-left",children:e.jsxs(v,{fullWidth:!0,children:[e.jsx(N,{variant:"white",children:d("group.edit.badge.position")}),e.jsxs(v,{justifyContent:"center",alignItems:"center",className:"button-w-height",children:[e.jsxs(w,{className:"floor-spaceing",children:[e.jsxs(A,{className:"buildtool-movefurni button-leftup",onClick:()=>fs(-1,0,_s,0),children:[" ",e.jsx(_a,{className:"fa-icon icon-color",size:"1.7em"})," "]}),e.jsxs(A,{className:"buildtool-movefurni button-rightup",onClick:()=>fs(0,-1,_s,0),children:[" ",e.jsx(_a,{className:"fa-icon icon-color",size:"1.7em"})," "]})]}),e.jsxs(w,{className:"floor-spaceing",children:[e.jsxs(A,{className:"buildtool-movefurni button-leftdown",onClick:()=>fs(0,1,_s,0),children:[" ",e.jsx(_a,{className:"fa-icon icon-color",size:"1.7em"})," "]}),e.jsxs(A,{className:"buildtool-movefurni button-rightdown",onClick:()=>fs(1,0,_s,0),children:[" ",e.jsx(_a,{className:"fa-icon icon-color",size:"1.7em"})," "]})]})]}),e.jsx(N,{variant:"white",children:d("infostand.button.rotate")}),e.jsxs(w,{center:!0,className:"floor-spaceing",children:[e.jsxs(A,{className:"buildtool-rotatefurni",onClick:()=>fs(0,0,_s,-1),children:[" ",e.jsx(IE,{className:"fa-icon icon-color",size:"1.4em"})," "]}),e.jsxs(A,{className:"buildtool-rotatefurni",onClick:()=>fs(0,0,_s,1),children:[" ",e.jsx(bE,{className:"fa-icon icon-color",size:"1.4em"})," "]})]})]})}),e.jsx(v,{className:"buildtool-box buildtool-box-right",children:e.jsxs(v,{fullWidth:!0,children:[e.jsx(N,{variant:"white",children:d("stack.magic.tile.height.label")}),e.jsx("input",{spellCheck:"false",type:"number",className:"form-control form-control-sm",value:_s!==null?_s.toString():"",onChange:Fr,onBlur:Ii,min:0,max:40,step:.1}),e.jsxs(w,{justifyContent:"center",gap:1,children:[e.jsxs(v,{children:[e.jsx(A,{className:"buildtool-setheight buildtool-setheightup",onClick:()=>On(1),children:"↑"}),e.jsx(N,{variant:"white",align:"center",children:"█"}),e.jsx(A,{className:"buildtool-setheight buildtool-setheightdown",onClick:()=>On(-1),children:"↓"})]}),e.jsxs(v,{children:[e.jsx(A,{className:"buildtool-setheight buildtool-setheightup",onClick:()=>On(.1),children:"↑"}),e.jsx(N,{variant:"white",align:"center",children:"▄"}),e.jsx(A,{className:"buildtool-setheight buildtool-setheightdown",onClick:()=>On(-.1),children:"↓"})]}),e.jsxs(v,{children:[e.jsx(A,{className:"buildtool-setheight buildtool-setheightup",onClick:()=>On(.01),children:"↑"}),e.jsx(N,{variant:"white",align:"center",children:"_"}),e.jsx(A,{className:"buildtool-setheight buildtool-setheightdown",onClick:()=>On(-.01),children:"↓"})]})]})]})})]})})]}),f.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"m-0"}),e.jsx(v,{gap:1,children:f.map((ae,ee)=>e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(N,{wrap:!0,align:"end",variant:"white",className:"col-4",children:ae}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:x[ee],onChange:ge=>pa(ee,ge.target.value)})]},ee))})]})]}),j.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"m-0 my-1"}),e.jsx(v,{gap:1,children:j.map((ae,ee)=>e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(N,{small:!0,wrap:!0,align:"end",variant:"white",className:"col-4",children:ae}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:C[ee],onChange:ge=>Gr(ee,ge.target.value)})]},ee))})]})]})]})}),e.jsxs(w,{gap:2,justifyContent:"end",children:[l&&e.jsx(P,{className:"infostand-buttons px-2",onClick:ae=>rn("move"),children:d("infostand.button.move")}),m&&e.jsx(P,{className:"infostand-buttons px-2",onClick:ae=>rn("rotate"),children:d("infostand.button.rotate")}),r!==kl&&e.jsx(P,{className:"infostand-buttons px-2",onClick:ae=>rn("pickup"),children:d(r===Bd?"infostand.button.eject":"infostand.button.pickup")}),u&&e.jsx(P,{className:"infostand-buttons px-2",onClick:ae=>rn("use"),children:d("infostand.button.use")}),f.length>0&&x.length>0&&f.length===x.length&&e.jsx(P,{className:"infostand-buttons px-2",onClick:()=>rn("save_branding_configuration"),children:d("save")}),j.length>0&&C.length>0&&j.length===C.length&&e.jsx(P,{className:"infostand-buttons px-2",onClick:()=>rn("save_custom_variables"),children:d("save")})]})]}):null},IR=a=>{const{avatarInfo:t=null,onClose:s=null}=a,[n,r]=o.useState(0),[i,l]=o.useState(0),{roomSession:c=null}=ke(),{petRespectRemaining:m=0,respectPet:h=null}=zn();if(o.useEffect(()=>{r(t.remainingGrowTime),l(t.remainingTimeToLive)},[t]),o.useEffect(()=>{if(t.petType!==Vt.MONSTERPLANT||t.dead)return;const g=setInterval(()=>{r(f=>f-1),l(f=>f-1)},1e3);return()=>clearInterval(g)},[t]),!t)return null;const u=g=>{let f=!0;if(!(!g||g=="")){switch(g){case"respect":h(t.id),m-1>=1&&(f=!1);break;case"buyfood":Z("catalog/open/"+K("catalog.links")["pets.buy_food"]);break;case"train":c==null||c.requestPetCommands(t.id);break;case"treat":D(new vc(t.id));break;case"compost":c==null||c.compostPlant(t.id);break;case"pick_up":c==null||c.pickupPet(t.id);break}f&&s()}};return e.jsxs(v,{gap:1,alignItems:"end",children:[e.jsx(v,{className:"nitro-infostand rounded",children:e.jsxs(v,{overflow:"visible",className:"container-fluid content-area",gap:1,children:[e.jsxs(v,{gap:1,children:[e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:1,children:[e.jsx(N,{variant:"white",small:!0,wrap:!0,children:t.name}),e.jsx(Hs,{className:"cursor-pointer fa-icon",onClick:s})]}),e.jsx(N,{variant:"white",small:!0,wrap:!0,children:d(`pet.breed.${t.petType}.${t.petBreed}`)}),e.jsx("hr",{className:"m-0"})]}),t.petType===Vt.MONSTERPLANT&&e.jsxs(e.Fragment,{children:[e.jsxs(v,{center:!0,gap:1,children:[e.jsx(xn,{figure:t.petFigure,posture:t.posture,direction:4}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(v,{gap:2,children:[!t.dead&&e.jsx(v,{alignItems:"center",gap:1,children:e.jsx(N,{variant:"white",center:!0,small:!0,wrap:!0,children:d("pet.level",["level","maxlevel"],[t.level.toString(),t.maximumLevel.toString()])})}),e.jsxs(v,{alignItems:"center",gap:1,children:[e.jsx(N,{variant:"white",small:!0,truncate:!0,children:d("infostand.pet.text.wellbeing")}),e.jsxs(A,{fullWidth:!0,overflow:"hidden",position:"relative",className:"bg-light-dark rounded",children:[e.jsx(w,{fit:!0,center:!0,position:"absolute",children:e.jsx(N,{variant:"white",small:!0,children:t.dead?"00:00:00":gr(i==0?t.remainingTimeToLive:i).split(":")[1]+":"+gr(i==null||i==null?0:i).split(":")[2]+":"+gr(i==null||i==null?0:i).split(":")[3]})}),e.jsx(A,{className:"bg-success rounded pet-stats",style:{width:t.dead?"0":Math.round(t.maximumTimeToLive*100/i).toString()}})]})]}),n!=0&&n>0&&e.jsxs(v,{alignItems:"center",gap:1,children:[e.jsx(N,{variant:"white",small:!0,truncate:!0,children:d("infostand.pet.text.growth")}),e.jsx(AN,{className:"top-2 end-2",day:gr(n).split(":")[0],hour:gr(n).split(":")[1],minutes:gr(n).split(":")[2],seconds:gr(n).split(":")[3]})]}),e.jsxs(v,{alignItems:"center",gap:1,children:[e.jsx(N,{variant:"white",small:!0,truncate:!0,children:d("infostand.pet.text.raritylevel",["level"],[d(`infostand.pet.raritylevel.${t.rarityLevel}`)])}),e.jsx(Uc,{className:"top-2 end-2",level:t.rarityLevel})]}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{variant:"white",small:!0,wrap:!0,children:d("pet.age",["age"],[t.age.toString()])}),e.jsx("hr",{className:"m-0"})]})]}),t.petType!==Vt.MONSTERPLANT&&e.jsxs(e.Fragment,{children:[e.jsxs(v,{gap:1,children:[e.jsxs(w,{gap:1,children:[e.jsx(v,{fullWidth:!0,overflow:"hidden",className:"body-image pet p-1",children:e.jsx(xn,{figure:t.petFigure,posture:t.posture,direction:4})}),e.jsxs(v,{grow:!0,gap:1,children:[e.jsx(N,{variant:"white",center:!0,small:!0,wrap:!0,children:d("pet.level",["level","maxlevel"],[t.level.toString(),t.maximumLevel.toString()])}),e.jsxs(v,{alignItems:"center",gap:1,children:[e.jsx(N,{variant:"white",small:!0,truncate:!0,children:d("infostand.pet.text.happiness")}),e.jsxs(A,{fullWidth:!0,overflow:"hidden",position:"relative",className:"bg-light-dark rounded",children:[e.jsx(w,{fit:!0,center:!0,position:"absolute",children:e.jsx(N,{variant:"white",small:!0,children:t.happyness+"/"+t.maximumHappyness})}),e.jsx(A,{className:"bg-info rounded pet-stats",style:{width:t.happyness/t.maximumHappyness*100+"%"}})]})]}),e.jsxs(v,{alignItems:"center",gap:1,children:[e.jsx(N,{variant:"white",small:!0,truncate:!0,children:d("infostand.pet.text.experience")}),e.jsxs(A,{fullWidth:!0,overflow:"hidden",position:"relative",className:"bg-light-dark rounded",children:[e.jsx(w,{fit:!0,center:!0,position:"absolute",children:e.jsx(N,{variant:"white",small:!0,children:t.experience+"/"+t.levelExperienceGoal})}),e.jsx(A,{className:"bg-purple rounded pet-stats",style:{width:t.experience/t.levelExperienceGoal*100+"%"}})]})]}),e.jsxs(v,{alignItems:"center",gap:1,children:[e.jsx(N,{variant:"white",small:!0,truncate:!0,children:d("infostand.pet.text.energy")}),e.jsxs(A,{fullWidth:!0,overflow:"hidden",position:"relative",className:"bg-light-dark rounded",children:[e.jsx(w,{fit:!0,center:!0,position:"absolute",children:e.jsx(N,{variant:"white",small:!0,children:t.energy+"/"+t.maximumEnergy})}),e.jsx(A,{className:"bg-success rounded pet-stats",style:{width:t.energy/t.maximumEnergy*100+"%"}})]})]})]})]}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(v,{gap:1,children:[t.petType!==Vt.MONSTERPLANT&&e.jsx(N,{variant:"white",small:!0,wrap:!0,children:d("infostand.text.petrespect",["count"],[t.respect.toString()])}),e.jsx(N,{variant:"white",small:!0,wrap:!0,children:d("pet.age",["age"],[t.age.toString()])}),e.jsx("hr",{className:"m-0"})]})]}),e.jsx(v,{gap:1,children:e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(Ns,{userId:t.ownerId}),e.jsx(N,{variant:"white",small:!0,wrap:!0,children:d("infostand.text.petowner",["name"],[t.ownerName])})]})})]})}),e.jsxs(w,{gap:1,justifyContent:"end",children:[t.petType!==Vt.MONSTERPLANT&&e.jsx(P,{variant:"dark",onClick:g=>u("buyfood"),children:d("infostand.button.buyfood")}),t.isOwner&&t.petType!==Vt.MONSTERPLANT&&e.jsx(P,{variant:"dark",onClick:g=>u("train"),children:d("infostand.button.train")}),!t.dead&&t.energy/t.maximumEnergy<.98&&t.petType===Vt.MONSTERPLANT&&e.jsx(P,{variant:"dark",onClick:g=>u("treat"),children:d("infostand.button.pettreat")}),(c==null?void 0:c.isRoomOwner)&&t.petType===Vt.MONSTERPLANT&&e.jsx(P,{variant:"dark",onClick:g=>u("compost"),children:d("infostand.button.compost")}),t.isOwner&&e.jsx(P,{variant:"dark",onClick:g=>u("pick_up"),children:d("inventory.pets.pickup")}),m>0&&t.petType!==Vt.MONSTERPLANT&&e.jsx(P,{variant:"dark",onClick:g=>u("respect"),children:d("infostand.button.petrespect",["count"],[m.toString()])})]})]})},bR=a=>{const{avatarInfo:t=null,onClose:s=null}=a,n=o.useMemo(()=>!(t.botSkills.indexOf(ze.NO_PICK_UP)>=0||!t.amIOwner&&!t.amIAnyRoomController),[t]),r=()=>D(new qm(t.webID));if(t)return e.jsxs(v,{gap:1,children:[e.jsx(v,{className:"nitro-infostand rounded",children:e.jsxs(v,{overflow:"visible",className:"container-fluid content-area",gap:1,children:[e.jsxs(v,{gap:1,children:[e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:1,children:[e.jsx(N,{variant:"white",small:!0,wrap:!0,children:t.name}),e.jsx(Hs,{className:"cursor-pointer fa-icon",onClick:s})]}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(v,{gap:1,children:[e.jsxs(w,{gap:1,children:[e.jsx(v,{fullWidth:!0,className:"body-image bot",children:e.jsx(nt,{figure:t.figure,direction:4})}),e.jsx(v,{grow:!0,center:!0,gap:0,children:t.badges.length>0&&t.badges.map(i=>e.jsx(mt,{badgeCode:i,showInfo:!0},i))})]}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(v,{gap:1,children:[e.jsx(w,{alignItems:"center",className:"bg-light-dark rounded py-1 px-2",children:e.jsx(N,{fullWidth:!0,wrap:!0,textBreak:!0,variant:"white",small:!0,className:"motto-content",children:t.motto})}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(v,{gap:1,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(Ns,{userId:t.ownerId}),e.jsx(N,{variant:"white",small:!0,wrap:!0,children:d("infostand.text.botowner",["name"],[t.ownerName])})]}),t.carryItem>0&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"m-0"}),e.jsx(N,{variant:"white",small:!0,wrap:!0,children:d("infostand.text.handitem",["item"],[d("handitem"+t.carryItem)])})]})]})]})}),n&&e.jsx(w,{justifyContent:"end",children:e.jsx(P,{variant:"dark",onClick:r,children:d("infostand.button.pickup")})})]})},Al=a=>{const{type:t=-1,relationship:s=null}=a;if(!s)return null;const n=Js.RELATIONSHIP_NAMES[t].toLocaleLowerCase();return e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("i",{className:`nitro-friends-spritesheet icon-${n}`}),e.jsx(w,{alignItems:"center",gap:0,children:e.jsxs(N,{small:!0,variant:"white",onClick:r=>as(s.randomFriendId),children:[e.jsx("u",{children:s.randomFriendName}),s.friendCount>1&&" "+d(`extendedprofile.relstatus.others.${n}`,["count"],[(s.friendCount-1).toString()])]})})]})},ER=a=>{const{relationships:t=null}=a;return!t||!t.relationshipStatusMap.length?null:e.jsxs(e.Fragment,{children:[e.jsx(Al,{type:Js.HEART,relationship:t.relationshipStatusMap.getValue(Js.HEART)}),e.jsx(Al,{type:Js.SMILE,relationship:t.relationshipStatusMap.getValue(Js.SMILE)}),e.jsx(Al,{type:Js.BOBBA,relationship:t.relationshipStatusMap.getValue(Js.BOBBA)})]})},CR=a=>{Z(`navigator/search/${a}`),D(new Tr("hotel_view",`tag:${a}`))},NR=a=>{const{tags:t=null}=a;return!t||!t.length?null:e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"m-0"}),e.jsx(w,{className:"flex-tags",children:t&&t.length>0&&t.map((s,n)=>e.jsx(N,{variant:"white",className:"text-tags",onClick:r=>CR(s),children:s},n))})]})},vR=["backgrounds","stands","overlays"],_R=({setIsVisible:a,selectedBackground:t,setSelectedBackground:s,selectedStand:n,setSelectedStand:r,selectedOverlay:i,setSelectedOverlay:l})=>{const[c,m]=o.useState("backgrounds"),{roomSession:h}=ke(),u=o.useMemo(()=>({isHcMember:Cs()>=Bt.CLUB,securityLevel:B().canChangeName,isAmbassador:B().isAmbassador}),[]),g=o.useCallback((I,j)=>I!=null&&I.length?I.filter(E=>{const C=u.securityLevel>=E.minRank,b=!E.isAmbassadorOnly||u.isAmbassador;return E.isHcOnly||C&&b}).map(E=>({id:E[`${j}Id`],...E,selectable:!E.isHcOnly||u.isHcMember})):[],[u]),f=o.useMemo(()=>({backgrounds:g(K("backgrounds.data"),"background"),stands:g(K("stands.data"),"stand"),overlays:g(K("overlays.data"),"overlay")}),[g]),p=o.useCallback(I=>{if(!h)return;const j={backgrounds:s,stands:r,overlays:l},E={backgrounds:t,stands:n,overlays:i};j[c](I);const C={...E,[c]:I};h.sendBackgroundMessage(C.backgrounds,C.stands,C.overlays)},[c,h,t,n,i,s,r,l]),x=o.useCallback((I,j)=>e.jsxs(w,{pointer:!0,position:"relative",onClick:()=>I.selectable&&p(I.id),className:I.selectable?"":"non-selectable",children:[e.jsx(A,{className:`profile-${j} ${j}-${I.id}`}),I.isHcOnly&&e.jsx(Nt,{position:"absolute",className:"top-1 end-1",type:"hc"})]},I.id),[p]);return e.jsxs(ie,{uniqueKey:"backgrounds",className:"nitro-backgrounds no-resize",theme:"primary",children:[e.jsx(re,{headerText:"Profile Background",onCloseClick:()=>a(!1)}),e.jsx(Tn,{children:vR.map(I=>e.jsx(tn,{isActive:c===I,onClick:()=>m(I),children:I.charAt(0).toUpperCase()+I.slice(1)},I))}),e.jsxs(se,{gap:1,children:[e.jsx(N,{bold:!0,center:!0,children:"Select an Option"}),e.jsx(ne,{gap:1,columnCount:7,overflow:"auto",children:f[c].map(I=>x(I,c.slice(0,-1)))})]})]})},SR=({avatarInfo:a,setAvatarInfo:t,onClose:s})=>{const[n,r]=o.useState(""),[i,l]=o.useState(!1),[c,m]=o.useState(null),[h,u]=o.useState(!1),{roomSession:g}=ke(),f=o.useMemo(()=>({maxMottoLength:K("motto.max.length",38),tagsEnabled:K("user.tags.enabled")}),[]),p=o.useMemo(()=>({background:`background-${(a==null?void 0:a.backgroundId)??0}`,stand:`stand-${(a==null?void 0:a.standId)??0}`,overlay:`overlay-${(a==null?void 0:a.overlayId)??0}`}),[a==null?void 0:a.backgroundId,a==null?void 0:a.standId,a==null?void 0:a.overlayId]),x=o.useCallback(_=>{!i||!g||_.length>f.maxMottoLength||(g.sendMottoMessage(_),l(!1))},[i,g,f.maxMottoLength]),I=o.useCallback(_=>x(_.target.value),[x]),j=o.useCallback(_=>{_.stopPropagation(),_.key==="Enter"&&x(_.currentTarget.value)},[x]),E=o.useCallback(_=>{t(S=>S&&_(Es(S)))},[t]);if(He(CE.RSUBE_BADGES,o.useCallback(_=>{!a||a.webID!==_.userId||a.badges.join("")===_.badges.join("")||E(S=>({...S,badges:_.badges}))},[a,E])),He(NE.USER_FIGURE,o.useCallback(_=>{!a||a.roomIndex!==_.roomIndex||E(S=>({...S,figure:_.figure,motto:_.customInfo,backgroundId:_.backgroundId,standId:_.standId,overlayId:_.overlayId,achievementScore:_.activityPoints}))},[a,E])),He(vE.FAVOURITE_GROUP_UPDATE,o.useCallback(_=>{if(!a||a.roomIndex!==_.roomIndex)return;const S=_.status===-1||_.habboGroupId<=0;E(T=>({...T,groupId:S?-1:_.habboGroupId,groupName:S?null:_.habboGroupName,groupBadgeId:S?null:B().getGroupBadge(_.habboGroupId)}))},[a,E])),M(zm,o.useCallback(_=>{const S=_.getParser();!a||a.webID!==S.userId||m(S)},[a])),o.useEffect(()=>{if(a)return r(a.motto||""),D(new Ym(a.webID)),()=>{l(!1),r(""),m(null)}},[a]),!a)return null;const C=a.type===Rt.OWN_USER,b=_=>a.badges[_]&&e.jsx(w,{center:!0,className:"badge-image",children:e.jsx(mt,{badgeCode:a.badges[_],showInfo:!0})});return e.jsxs(v,{className:"nitro-infostand rounded",children:[e.jsxs(v,{overflow:"visible",className:"container-fluid content-area",gap:1,children:[e.jsxs(v,{gap:1,children:[e.jsxs(w,{alignItems:"center",justifyContent:"between",children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(Ns,{userId:a.webID}),e.jsx(N,{variant:"white",small:!0,wrap:!0,children:a.name})]}),e.jsx(Hs,{className:"cursor-pointer fa-icon",onClick:s})]}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(v,{gap:1,children:[e.jsxs(w,{gap:1,children:[e.jsxs(v,{position:"relative",pointer:!0,fullWidth:!0,className:`body-image profile-background ${p.background}`,onClick:()=>as(a.webID),children:[e.jsx(A,{position:"absolute",className:`body-image profile-stand ${p.stand}`}),e.jsx(nt,{figure:a.figure,direction:2}),e.jsx(A,{position:"absolute",className:`body-image profile-overlay ${p.overlay}`}),C&&e.jsx(A,{position:"absolute",className:"icon edit-icon edit-icon-position",onClick:_=>{_.stopPropagation(),u(S=>!S)}})]}),e.jsxs(v,{grow:!0,alignItems:"center",gap:0,children:[e.jsxs(w,{gap:1,children:[b(0),e.jsx(w,{center:!0,pointer:a.groupId>0,className:"badge-image",onClick:()=>a.groupId>0&&ca(a.groupId),children:a.groupId>0&&e.jsx(mt,{badgeCode:a.groupBadgeId,isGroup:!0,showInfo:!0,customTitle:a.groupName})})]}),e.jsxs(w,{center:!0,gap:1,children:[b(1),b(2)]}),e.jsxs(w,{center:!0,gap:1,children:[b(3),b(4)]})]})]}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(v,{gap:1,children:[e.jsx(w,{alignItems:"center",className:"bg-light-dark rounded py-1 px-2",children:C?e.jsxs(w,{grow:!0,alignItems:"center",gap:2,children:[e.jsx(_E,{className:"small fa-icon"}),i?e.jsx("input",{type:"text",className:"motto-input",maxLength:f.maxMottoLength,value:n,onChange:_=>r(_.target.value),onBlur:I,onKeyDown:j,autoFocus:!0}):e.jsxs(N,{fullWidth:!0,pointer:!0,wrap:!0,textBreak:!0,small:!0,variant:"white",onClick:()=>l(!0),children:[n," "]})]}):e.jsx(N,{fullWidth:!0,pointer:!0,wrap:!0,textBreak:!0,small:!0,variant:"white",children:n})}),e.jsx("hr",{className:"m-0"})]}),e.jsxs(v,{gap:1,children:[e.jsxs(N,{variant:"white",small:!0,wrap:!0,children:[d("infostand.text.achievement_score")," ",a.achievementScore]}),a.carryItem>0&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"m-0"}),e.jsx(N,{variant:"white",small:!0,wrap:!0,children:d("infostand.text.handitem",["item"],[d("handitem"+a.carryItem)])})]})]}),e.jsx(ER,{relationships:c}),f.tagsEnabled&&e.jsx(v,{gap:1,className:"mt-1",children:e.jsx(NR,{tags:B().tags})})]}),h&&C&&e.jsx(_R,{setIsVisible:u,selectedBackground:a.backgroundId??0,setSelectedBackground:_=>E(S=>({...S,backgroundId:_})),selectedStand:a.standId??0,setSelectedStand:_=>E(S=>({...S,standId:_})),selectedOverlay:a.overlayId??0,setSelectedOverlay:_=>E(S=>({...S,overlayId:_}))})]})},za=0,Dl=1,Wd=2,qd=3,Pl=4,zd=5,Yd=6,wR=a=>{const{avatarInfo:t=null,onClose:s=null}=a,[n,r]=o.useState(za),{canRequestFriend:i=null}=hs(),{report:l=null}=Ws(),{roomSession:c=null}=ke(),{userRespectRemaining:m=0,respectUser:h=null}=zn(),u=o.useMemo(()=>t.amIOwner&&t.targetRoomControllerLevel<$e.GUEST&&!t.isGuildRoom,[t]),g=o.useMemo(()=>t.amIOwner&&t.targetRoomControllerLevel===$e.GUEST&&!t.isGuildRoom,[t]),f=o.useMemo(()=>t.canBeKicked||t.canBeBanned||t.canBeMuted||u||g,[u,g,t]),p=o.useMemo(()=>{let I=!1;const j=Lr();if(j){const E=j.model.getValue(te.FIGURE_CARRY_OBJECT);E>0&&E<999999&&(I=!0)}return I},[]),x=I=>{let j=!0;if(I)switch(I){case"moderate":j=!1,r(Dl);break;case"ban":j=!1,r(Wd);break;case"mute":j=!1,r(qd);break;case"ambassador":j=!1,r(Pl);break;case"ambassador_mute":j=!1,r(zd);break;case"back_moderate":j=!1,r(Dl);break;case"back_ambassador":j=!1,r(Pl);break;case"back":j=!1,r(za);break;case"whisper":Ct(new wr(wr.WHISPER,t.name));break;case"friend":Z(`friends/request/${t.webID}/${t.name}`);break;case"relationship":j=!1,r(Yd);break;case"respect":{h(t.webID),m-1>=1&&(j=!1);break}case"ignore":B().ignoreUser(t.name);break;case"unignore":B().unignoreUser(t.name);break;case"kick":c.sendKickMessage(t.webID);break;case"ban_hour":c.sendBanMessage(t.webID,"RWUAM_BAN_USER_HOUR");break;case"ban_day":c.sendBanMessage(t.webID,"RWUAM_BAN_USER_DAY");break;case"perm_ban":c.sendBanMessage(t.webID,"RWUAM_BAN_USER_PERM");break;case"mute_2min":c.sendMuteMessage(t.webID,2);break;case"mute_5min":c.sendMuteMessage(t.webID,5);break;case"mute_10min":c.sendMuteMessage(t.webID,10);break;case"give_rights":c.sendGiveRightsMessage(t.webID);break;case"remove_rights":c.sendTakeRightsMessage(t.webID);break;case"trade":D(new wE(t.roomIndex));break;case"report":l(tt.BULLY,{reportedUserId:t.webID});break;case"pass_hand_item":D(new SE(t.webID));break;case"ambassador_alert":c.sendAmbassadorAlertMessage(t.webID);break;case"ambassador_kick":c.sendKickMessage(t.webID);break;case"ambassador_mute_2min":c.sendMuteMessage(t.webID,2);break;case"ambassador_mute_10min":c.sendMuteMessage(t.webID,10);break;case"ambassador_mute_60min":c.sendMuteMessage(t.webID,60);break;case"ambassador_mute_18hour":c.sendMuteMessage(t.webID,1080);break;case"rship_heart":D(new Ni(t.webID,ds.RELATIONSHIP_HEART));break;case"rship_smile":D(new Ni(t.webID,ds.RELATIONSHIP_SMILE));break;case"rship_bobba":D(new Ni(t.webID,ds.RELATIONSHIP_BOBBA));break;case"rship_none":D(new Ni(t.webID,ds.RELATIONSHIP_NONE));break}j&&s()};return o.useEffect(()=>{r(za)},[t]),e.jsxs(yn,{objectId:t.roomIndex,category:X.UNIT,userType:t.userType,onClose:s,collapsable:!0,children:[e.jsx(rs,{className:"cursor-pointer",onClick:I=>as(t.webID),dangerouslySetInnerHTML:{__html:`${t.name}`}}),n===za&&e.jsxs(e.Fragment,{children:[i(t.webID)&&e.jsx(W,{onClick:I=>x("friend"),children:d("infostand.button.friend")}),e.jsx(W,{onClick:I=>x("trade"),children:d("infostand.button.trade")}),e.jsx(W,{onClick:I=>x("whisper"),children:d("infostand.button.whisper")}),m>0&&e.jsx(W,{onClick:I=>x("respect"),children:d("infostand.button.respect",["count"],[m.toString()])}),!i(t.webID)&&e.jsxs(W,{onClick:I=>x("relationship"),children:[d("infostand.link.relationship"),e.jsx(ws,{className:"right fa-icon"})]}),!t.isIgnored&&e.jsx(W,{onClick:I=>x("ignore"),children:d("infostand.button.ignore")}),t.isIgnored&&e.jsx(W,{onClick:I=>x("unignore"),children:d("infostand.button.unignore")}),e.jsx(W,{onClick:I=>x("report"),children:d("infostand.button.report")}),f&&e.jsxs(W,{onClick:I=>x("moderate"),children:[e.jsx(ws,{className:"right fa-icon"}),d("infostand.link.moderate")]}),t.isAmbassador&&e.jsxs(W,{onClick:I=>x("ambassador"),children:[e.jsx(ws,{className:"right fa-icon"}),d("infostand.link.ambassador")]}),p&&e.jsx(W,{onClick:I=>x("pass_hand_item"),children:d("avatar.widget.pass_hand_item")})]}),n===Dl&&e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:I=>x("kick"),children:d("infostand.button.kick")}),e.jsxs(W,{onClick:I=>x("mute"),children:[e.jsx(ws,{className:"right fa-icon"}),d("infostand.button.mute")]}),e.jsxs(W,{onClick:I=>x("ban"),children:[e.jsx(ws,{className:"right fa-icon"}),d("infostand.button.ban")]}),u&&e.jsx(W,{onClick:I=>x("give_rights"),children:d("infostand.button.giverights")}),g&&e.jsx(W,{onClick:I=>x("remove_rights"),children:d("infostand.button.removerights")}),e.jsxs(W,{onClick:I=>x("back"),children:[e.jsx(Ss,{className:"left fa-icon"}),d("generic.back")]})]}),n===Wd&&e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:I=>x("ban_hour"),children:d("infostand.button.ban_hour")}),e.jsx(W,{onClick:I=>x("ban_day"),children:d("infostand.button.ban_day")}),e.jsx(W,{onClick:I=>x("perm_ban"),children:d("infostand.button.perm_ban")}),e.jsxs(W,{onClick:I=>x("back_moderate"),children:[e.jsx(Ss,{className:"left fa-icon"}),d("generic.back")]})]}),n===qd&&e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:I=>x("mute_2min"),children:d("infostand.button.mute_2min")}),e.jsx(W,{onClick:I=>x("mute_5min"),children:d("infostand.button.mute_5min")}),e.jsx(W,{onClick:I=>x("mute_10min"),children:d("infostand.button.mute_10min")}),e.jsxs(W,{onClick:I=>x("back_moderate"),children:[e.jsx(Ss,{className:"left fa-icon"}),d("generic.back")]})]}),n===Pl&&e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:I=>x("ambassador_alert"),children:d("infostand.button.alert")}),e.jsx(W,{onClick:I=>x("ambassador_kick"),children:d("infostand.button.kick")}),e.jsxs(W,{onClick:I=>x("ambassador_mute"),children:[d("infostand.button.mute"),e.jsx(ws,{className:"right fa-icon"})]}),e.jsxs(W,{onClick:I=>x("back"),children:[e.jsx(Ss,{className:"left fa-icon"}),d("generic.back")]})]}),n===zd&&e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:I=>x("ambassador_mute_2min"),children:d("infostand.button.mute_2min")}),e.jsx(W,{onClick:I=>x("ambassador_mute_10min"),children:d("infostand.button.mute_10min")}),e.jsx(W,{onClick:I=>x("ambassador_mute_60min"),children:d("infostand.button.mute_60min")}),e.jsx(W,{onClick:I=>x("ambassador_mute_18hr"),children:d("infostand.button.mute_18hour")}),e.jsxs(W,{onClick:I=>x("back_ambassador"),children:[e.jsx(Ss,{className:"left fa-icon"}),d("generic.back")]})]}),n===Yd&&e.jsxs(e.Fragment,{children:[e.jsxs(w,{className:"menu-list-split-3",children:[e.jsx(W,{onClick:I=>x("rship_heart"),children:e.jsx(A,{pointer:!0,className:"nitro-friends-spritesheet icon-heart"})}),e.jsx(W,{onClick:I=>x("rship_smile"),children:e.jsx(A,{pointer:!0,className:"nitro-friends-spritesheet icon-smile"})}),e.jsx(W,{onClick:I=>x("rship_bobba"),children:e.jsx(A,{pointer:!0,className:"nitro-friends-spritesheet icon-bobba"})})]}),e.jsx(W,{onClick:I=>x("rship_none"),children:d("avatar.widget.clear_relationship")}),e.jsxs(W,{onClick:I=>x("back"),children:[e.jsx(Ss,{className:"left fa-icon"}),d("generic.back")]})]})]})},Yh=a=>{const{classNames:t=[],...s}=a,n=o.useMemo(()=>{const r=["menu-list"];return t.length&&r.push(...t),r},[t]);return e.jsx(v,{classNames:n,...s})},TR=a=>{const{userId:t=-1,userName:s="",roomIndex:n=-1,setIsDecorating:r=null}=a;return e.jsx(yn,{objectId:n,category:X.UNIT,onClose:null,children:e.jsx(Yh,{children:e.jsx(W,{onClick:i=>r(!1),children:d("widget.avatar.stop_decorating")})})})},yR=a=>{const{avatarInfo:t=null,onClose:s=null}=a,n=r=>{if(r)switch(r){case"move":vr(t.id,t.category,Bs.OBJECT_MOVE);break;case"rotate":vr(t.id,t.category,Bs.OBJECT_ROTATE_POSITIVE);break;case"pickup":vr(t.id,t.category,Bs.OBJECT_PICKUP);break;case"eject":vr(t.id,t.category,Bs.OBJECT_EJECT);break}};return e.jsxs(yn,{objectId:t.id,category:t.category,onClose:s,collapsable:!0,children:[e.jsx(rs,{children:t.name}),e.jsxs(w,{className:"menu-list-split-3",children:[e.jsx(W,{onClick:r=>n("move"),children:e.jsx(TE,{className:"center fa-icon"})}),e.jsx(W,{onClick:r=>n("rotate"),disabled:t.isWallItem,children:e.jsx(yE,{className:"center fa-icon"})}),(t.isOwner||t.isAnyRoomController)&&e.jsx(W,{onClick:r=>n("pickup"),children:e.jsx(bu,{className:"center fa-icon"})}),!t.isOwner&&!t.isAnyRoomController&&(t.isRoomOwner||t.roomControllerLevel>=$e.GUILD_ADMIN)&&e.jsx(W,{onClick:r=>n("eject"),children:e.jsx(bu,{className:"center fa-icon"})})]})]})},$d=a=>{const{nameInfo:t=null,onClose:s=null}=a,n=o.useMemo(()=>{const r=["name-only"];return t.isFriend&&r.push("is-friend"),r},[t]);return e.jsx(yn,{objectId:t.roomIndex,category:t.category,userType:t.userType,fades:t.id!==B().userId,classNames:n,onClose:s,children:e.jsx("div",{className:"text-shadow",dangerouslySetInnerHTML:{__html:`${t.name}`}})})},Ll=0,Ml=1,Kd=3,Xd=4,RR=a=>{const{avatarInfo:t=null,isDancing:s=!1,setIsDecorating:n=null,onClose:r=null}=a,[i,l]=o.useState(s&&Nr()?Ml:Ll),{roomSession:c=null}=ke(),m=g=>{let f=!0;if(g)if(g.startsWith("sign_")){const p=parseInt(g.split("_")[1]);c.sendSignMessage(p)}else switch(g){case"decorate":n(!0);break;case"change_name":Ct(new na(na.INIT));break;case"change_looks":Z("avatar-editor/show");break;case"expressions":f=!1,l(Kd);break;case"sit":c.sendPostureMessage(go.POSTURE_SIT);break;case"stand":c.sendPostureMessage(go.POSTURE_STAND);break;case"wave":c.sendExpressionMessage(hn.WAVE.ordinal);break;case"blow":c.sendExpressionMessage(hn.BLOW.ordinal);break;case"laugh":c.sendExpressionMessage(hn.LAUGH.ordinal);break;case"idle":c.sendExpressionMessage(hn.IDLE.ordinal);break;case"dance_menu":f=!1,l(Ml);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(g.charAt(g.length-1)));break;case"signs":f=!1,l(Xd);break;case"back":f=!1,l(Ll);break;case"drop_carry_item":D(new RE);break}f&&r()},h=()=>t.amIOwner||t.amIAnyRoomController||t.roomControllerLevel>$e.GUEST,u=MC();return e.jsxs(yn,{objectId:t.roomIndex,category:X.UNIT,userType:t.userType,onClose:r,collapsable:!0,children:[e.jsx(rs,{className:"cursor-pointer",onClick:g=>as(t.webID),children:t.name}),i===Ll&&e.jsxs(e.Fragment,{children:[t.allowNameChange&&e.jsx(W,{onClick:g=>m("change_name"),children:d("widget.avatar.change_name")}),h()&&e.jsx(W,{onClick:g=>m("decorate"),children:d("widget.avatar.decorate")}),e.jsx(W,{onClick:g=>m("change_looks"),children:d("widget.memenu.myclothes")}),Nr()&&!u&&e.jsxs(W,{onClick:g=>m("dance_menu"),children:[e.jsx(ws,{className:"right fa-icon"}),d("widget.memenu.dance")]}),!s&&!Nr()&&!u&&e.jsx(W,{onClick:g=>m("dance"),children:d("widget.memenu.dance")}),s&&!Nr()&&!u&&e.jsx(W,{onClick:g=>m("dance_stop"),children:d("widget.memenu.dance.stop")}),e.jsxs(W,{onClick:g=>m("expressions"),children:[e.jsx(ws,{className:"right fa-icon"}),d("infostand.link.expressions")]}),e.jsxs(W,{onClick:g=>m("signs"),children:[e.jsx(ws,{className:"right fa-icon"}),d("infostand.show.signs")]}),t.carryItem>0&&e.jsx(W,{onClick:g=>m("drop_carry_item"),children:d("avatar.widget.drop_hand_item")})]}),i===Ml&&e.jsxs(e.Fragment,{children:[s&&e.jsx(W,{onClick:g=>m("dance_stop"),children:d("widget.memenu.dance.stop")}),e.jsx(W,{onClick:g=>m("dance_1"),children:d("widget.memenu.dance1")}),e.jsx(W,{onClick:g=>m("dance_2"),children:d("widget.memenu.dance2")}),e.jsx(W,{onClick:g=>m("dance_3"),children:d("widget.memenu.dance3")}),e.jsx(W,{onClick:g=>m("dance_4"),children:d("widget.memenu.dance4")}),e.jsxs(W,{onClick:g=>m("back"),children:[e.jsx(Ss,{className:"left fa-icon"}),d("generic.back")]})]}),i===Kd&&e.jsxs(e.Fragment,{children:[PC()===ai.POSTURE_STAND&&e.jsx(W,{onClick:g=>m("sit"),children:d("widget.memenu.sit")}),NC()&&e.jsx(W,{onClick:g=>m("stand"),children:d("widget.memenu.stand")}),vl()&&e.jsx(W,{onClick:g=>m("wave"),children:d("widget.memenu.wave")}),vl()&&e.jsxs(W,{disabled:!Da(),onClick:g=>m("laugh"),children:[!Da()&&e.jsx(Nt,{type:"hc"}),d("widget.memenu.laugh")]}),vl()&&e.jsxs(W,{disabled:!Da(),onClick:g=>m("blow"),children:[!Da()&&e.jsx(Nt,{type:"hc"}),d("widget.memenu.blow")]}),e.jsx(W,{onClick:g=>m("idle"),children:d("widget.memenu.idle")}),e.jsxs(W,{onClick:g=>m("back"),children:[e.jsx(Ss,{className:"left fa-icon"}),d("generic.back")]})]}),i===Xd&&e.jsxs(e.Fragment,{children:[e.jsxs(w,{className:"menu-list-split-3",children:[e.jsx(W,{onClick:g=>m("sign_1"),children:"1"}),e.jsx(W,{onClick:g=>m("sign_2"),children:"2"}),e.jsx(W,{onClick:g=>m("sign_3"),children:"3"})]}),e.jsxs(w,{className:"menu-list-split-3",children:[e.jsx(W,{onClick:g=>m("sign_4"),children:"4"}),e.jsx(W,{onClick:g=>m("sign_5"),children:"5"}),e.jsx(W,{onClick:g=>m("sign_6"),children:"6"})]}),e.jsxs(w,{className:"menu-list-split-3",children:[e.jsx(W,{onClick:g=>m("sign_7"),children:"7"}),e.jsx(W,{onClick:g=>m("sign_8"),children:"8"}),e.jsx(W,{onClick:g=>m("sign_9"),children:"9"})]}),e.jsxs(w,{className:"menu-list-split-3",children:[e.jsx(W,{onClick:g=>m("sign_10"),children:"10"}),e.jsx(W,{onClick:g=>m("sign_11"),children:e.jsx("i",{className:"icon icon-sign-heart"})}),e.jsx(W,{onClick:g=>m("sign_12"),children:e.jsx("i",{className:"icon icon-sign-skull"})})]}),e.jsxs(w,{className:"menu-list-split-3",children:[e.jsx(W,{onClick:g=>m("sign_0"),children:"0"}),e.jsx(W,{onClick:g=>m("sign_13"),children:e.jsx("i",{className:"icon icon-sign-exclamation"})}),e.jsx(W,{onClick:g=>m("sign_15"),children:e.jsx("i",{className:"icon icon-sign-smile"})})]}),e.jsxs(w,{className:"menu-list-split-3",children:[e.jsx(W,{onClick:g=>m("sign_14"),children:e.jsx("i",{className:"icon icon-sign-soccer"})}),e.jsx(W,{onClick:g=>m("sign_17"),children:e.jsx("i",{className:"icon icon-sign-yellow"})}),e.jsx(W,{onClick:g=>m("sign_16"),children:e.jsx("i",{className:"icon icon-sign-red"})})]}),e.jsxs(W,{onClick:g=>m("back"),children:[e.jsx(Ss,{className:"left fa-icon"}),d("generic.back")]})]})]})},Ul=0,Qd=1,Jd=2,Zd=3,OR=a=>{const{avatarInfo:t=null,onClose:s=null}=a,[n,r]=o.useState(Ul),{roomSession:i=null}=ke(),{petRespectRemaining:l=0,respectPet:c=null}=zn(),m=o.useMemo(()=>{let u=!1;const g=Lr();if(g){const f=g.model.getValue(te.FIGURE_CARRY_OBJECT);f>0&&f<999999&&(u=!0)}return u},[]),h=u=>{let g=!0;if(u)switch(u){case"respect":c(t.id),l-1>=1&&(g=!1);break;case"treat":D(new vc(t.id));break;case"pass_handitem":D(new $m(t.id));break;case"train":i.requestPetCommands(t.id);break;case"pick_up":i.pickupPet(t.id);break;case"mount":i.mountPet(t.id);break;case"toggle_riding_permission":i.togglePetRiding(t.id);break;case"toggle_breeding_permission":i.togglePetBreeding(t.id);break;case"dismount":i.dismountPet(t.id);break;case"saddle_off":i.removePetSaddle(t.id);break;case"breed":break;case"harvest":i.harvestPet(t.id);break;case"revive":break;case"compost":i.compostPlant(t.id);break;case"buy_saddle":Z("catalog/open/"+K("catalog.links")["pets.buy_saddle"]);break}g&&s()};return o.useEffect(()=>{r(u=>t.petType===Vt.MONSTERPLANT?Zd:t.saddle&&!t.rider?Qd:t.rider?Jd:Ul)},[t]),e.jsxs(yn,{objectId:t.roomIndex,category:X.UNIT,userType:dt.PET,onClose:s,collapsable:!0,children:[e.jsx(rs,{children:t.name}),n===Ul&&e.jsxs(e.Fragment,{children:[l>0&&e.jsx(W,{onClick:u=>h("respect"),children:d("infostand.button.petrespect",["count"],[l.toString()])}),e.jsx(W,{onClick:u=>h("train"),children:d("infostand.button.train")}),e.jsx(W,{onClick:u=>h("pick_up"),children:d("infostand.button.pickup")}),t.petType===Vt.HORSE&&e.jsx(W,{onClick:u=>h("buy_saddle"),children:d("infostand.button.buy_saddle")}),[Vt.BEAR,Vt.TERRIER,Vt.CAT,Vt.DOG,Vt.PIG].indexOf(t.petType)>-1&&e.jsx(W,{onClick:u=>h("breed"),children:d("infostand.button.breed")})]}),n===Qd&&e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:u=>h("mount"),children:d("infostand.button.mount")}),e.jsxs(W,{onClick:u=>h("toggle_riding_permission"),gap:1,children:[e.jsx("input",{type:"checkbox",checked:!!t.publiclyRideable,readOnly:!0}),d("infostand.button.toggle_riding_permission")]}),l>0&&e.jsx(W,{onClick:u=>h("respect"),children:d("infostand.button.petrespect",["count"],[l.toString()])}),e.jsx(W,{onClick:u=>h("train"),children:d("infostand.button.train")}),e.jsx(W,{onClick:u=>h("pick_up"),children:d("infostand.button.pickup")}),e.jsx(W,{onClick:u=>h("saddle_off"),children:d("infostand.button.saddleoff")})]}),n===Jd&&e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:u=>h("dismount"),children:d("infostand.button.dismount")}),l>0&&e.jsx(W,{onClick:u=>h("respect"),children:d("infostand.button.petrespect",["count"],[l.toString()])})]}),n===Zd&&e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:u=>h("pick_up"),children:d("infostand.button.pickup")}),t.dead&&e.jsx(W,{onClick:u=>h("revive"),children:d("infostand.button.revive")}),i.isRoomOwner&&e.jsx(W,{onClick:u=>h("compost"),children:d("infostand.button.compost")}),!t.dead&&t.energy/t.maximumEnergy<.98&&e.jsx(W,{onClick:u=>h("treat"),children:d("infostand.button.pettreat")}),!t.dead&&t.level===t.maximumLevel&&t.breedable&&e.jsxs(e.Fragment,{children:[e.jsxs(W,{onClick:u=>h("toggle_breeding_permission"),gap:1,children:[e.jsx("input",{type:"checkbox",checked:t.publiclyBreedable,readOnly:!0}),d("infostand.button.toggle_breeding_permission")]}),e.jsx(W,{onClick:u=>h("breed"),children:d("infostand.button.breed")})]})]}),m&&e.jsx(W,{onClick:u=>h("pass_hand_item"),children:d("infostand.button.pass_hand_item")})]})},Fl=0,em=1,tm=2,sm=3,kR=a=>{const{avatarInfo:t=null,onClose:s=null}=a,[n,r]=o.useState(Fl),{roomSession:i=null}=ke(),{petRespectRemaining:l=0,respectPet:c=null}=zn(),m=o.useMemo(()=>i.isRoomOwner||i.controllerLevel>=$e.GUEST||B().isModerator,[i]),h=o.useMemo(()=>{let g=!1;const f=Lr();if(f){const p=f.model.getValue(te.FIGURE_CARRY_OBJECT);p>0&&p<999999&&(g=!0)}return g},[]),u=g=>{let f=!0;if(g)switch(g){case"respect":c(t.id),l-1>=1&&(f=!1);break;case"treat":D(new vc(t.id));break;case"pass_handitem":D(new $m(t.id));break;case"pick_up":i.pickupPet(t.id);break;case"mount":i.mountPet(t.id);break;case"dismount":i.dismountPet(t.id);break}f&&s()};return o.useEffect(()=>{r(g=>t.petType===Vt.MONSTERPLANT?sm:t.saddle&&!t.rider?em:t.rider?tm:Fl)},[t]),e.jsxs(yn,{objectId:t.roomIndex,category:X.UNIT,userType:dt.PET,onClose:s,collapsable:!0,children:[e.jsx(rs,{children:t.name}),n===Fl&&l>0&&e.jsx(W,{onClick:g=>u("respect"),children:d("infostand.button.petrespect",["count"],[l.toString()])}),n===em&&e.jsxs(e.Fragment,{children:[!!t.publiclyRideable&&e.jsx(W,{onClick:g=>u("mount"),children:d("infostand.button.mount")}),l>0&&e.jsx(W,{onClick:g=>u("respect"),children:d("infostand.button.petrespect",["count"],[l.toString()])})]}),n===tm&&e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:g=>u("dismount"),children:d("infostand.button.dismount")}),l>0&&e.jsx(W,{onClick:g=>u("respect"),children:d("infostand.button.petrespect",["count"],[l.toString()])})]}),n===sm&&!t.dead&&t.energy/t.maximumEnergy<.98&&e.jsx(W,{onClick:g=>u("treat"),children:d("infostand.button.pettreat")}),m&&e.jsx(W,{onClick:g=>u("pick_up"),children:d("infostand.button.pickup")}),h&&e.jsx(W,{onClick:g=>u("pass_hand_item"),children:d("infostand.button.pass_hand_item")})]})},Vl=0,nm=1,rm=2,AR=a=>{const{avatarInfo:t=null,onClose:s=null}=a,[n,r]=o.useState(Vl),[i,l]=o.useState(""),[c,m]=o.useState("");M(OE,f=>{const p=f.getParser();if(p.botId===t.webID)switch(p.commandId){case ze.CHANGE_BOT_NAME:l(p.data),r(nm);return;case ze.CHANGE_BOT_MOTTO:m(p.data),r(rm);return;case ze.SETUP_CHAT:{const x=p.data,I=x.split(x.indexOf(";#;")===-1?";":";#;");(I.length===3||I.length===4)&&(Ct(new ho(t.roomIndex,X.UNIT,t.webID,I[0],I[1].toLowerCase()==="true"||I[1]==="1",parseInt(I[2]),I[3]?I[3].toLowerCase()==="true"||I[3]==="1":!1)),s());return}}});const h=f=>D(new kE(t.webID,f)),u=f=>{let p=!0;if(f)switch(f){case"donate_to_all":h(ze.DONATE_TO_ALL),D(new Pn(t.webID,ze.DONATE_TO_ALL,""));break;case"donate_to_user":h(ze.DONATE_TO_USER),D(new Pn(t.webID,ze.DONATE_TO_USER,""));break;case"change_bot_name":h(ze.CHANGE_BOT_NAME),p=!1;break;case"save_bot_name":D(new Pn(t.webID,ze.CHANGE_BOT_NAME,i));break;case"change_bot_motto":h(ze.CHANGE_BOT_MOTTO),p=!1;break;case"save_bot_motto":D(new Pn(t.webID,ze.CHANGE_BOT_MOTTO,c));break;case"dress_up":D(new Pn(t.webID,ze.DRESS_UP,""));break;case"random_walk":D(new Pn(t.webID,ze.RANDOM_WALK,""));break;case"setup_chat":h(ze.SETUP_CHAT),p=!1;break;case"dance":D(new Pn(t.webID,ze.DANCE,""));break;case"nux_take_tour":Ie().createLinkEvent("help/tour"),D(new Pn(t.webID,ze.NUX_TAKE_TOUR,""));break;case"pick":D(new qm(t.webID));break}p&&s()};o.useEffect(()=>{r(Vl)},[t]);const g=t.amIOwner||t.amIAnyRoomController;return e.jsxs(yn,{objectId:t.roomIndex,category:X.UNIT,userType:dt.RENTABLE_BOT,onClose:s,collapsable:!0,children:[e.jsx(rs,{children:t.name}),n===Vl&&g&&e.jsxs(e.Fragment,{children:[t.botSkills.indexOf(ze.DONATE_TO_ALL)>=0&&e.jsx(W,{onClick:f=>u("donate_to_all"),children:d("avatar.widget.donate_to_all")}),t.botSkills.indexOf(ze.DONATE_TO_USER)>=0&&e.jsx(W,{onClick:f=>u("donate_to_user"),children:d("avatar.widget.donate_to_user")}),t.botSkills.indexOf(ze.CHANGE_BOT_NAME)>=0&&e.jsx(W,{onClick:f=>u("change_bot_name"),children:d("avatar.widget.change_bot_name")}),t.botSkills.indexOf(ze.CHANGE_BOT_MOTTO)>=0&&e.jsx(W,{onClick:f=>u("change_bot_motto"),children:d("avatar.widget.change_bot_motto")}),t.botSkills.indexOf(ze.DRESS_UP)>=0&&e.jsx(W,{onClick:f=>u("dress_up"),children:d("avatar.widget.dress_up")}),t.botSkills.indexOf(ze.RANDOM_WALK)>=0&&e.jsx(W,{onClick:f=>u("random_walk"),children:d("avatar.widget.random_walk")}),t.botSkills.indexOf(ze.SETUP_CHAT)>=0&&e.jsx(W,{onClick:f=>u("setup_chat"),children:d("avatar.widget.setup_chat")}),t.botSkills.indexOf(ze.DANCE)>=0&&e.jsx(W,{onClick:f=>u("dance"),children:d("avatar.widget.dance")}),t.botSkills.indexOf(ze.NO_PICK_UP)===-1&&e.jsx(W,{onClick:f=>u("pick"),children:d("avatar.widget.pick_up")})]}),n===nm&&e.jsxs(v,{className:"menu-item",onClick:null,gap:1,children:[e.jsx(N,{variant:"white",children:d("bot.skill.name.configuration.new.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:i,maxLength:K("bot.name.max.length",15),onChange:f=>l(f.target.value)}),e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:1,children:[e.jsx(P,{fullWidth:!0,variant:"secondary",onClick:f=>u(null),children:d("cancel")}),e.jsx(P,{fullWidth:!0,variant:"success",onClick:f=>u("save_bot_name"),children:d("save")})]})]}),n===rm&&e.jsxs(v,{className:"menu-item",onClick:null,gap:1,children:[e.jsx(N,{variant:"white",children:d("bot.skill.name.configuration.new.motto")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:c,maxLength:K("motto.max.length",38),onChange:f=>m(f.target.value)}),e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:1,children:[e.jsx(P,{fullWidth:!0,variant:"secondary",onClick:f=>u(null),children:d("cancel")}),e.jsx(P,{fullWidth:!0,variant:"success",onClick:f=>u("save_bot_motto"),children:d("save")})]})]})]})},DR=a=>{const[t,s]=o.useState(!1),[n,r]=o.useState(!1),[i,l]=o.useState(null),{avatarInfo:c=null,setAvatarInfo:m=null,activeNameBubble:h=null,setActiveNameBubble:u=null,nameBubbles:g=[],removeNameBubble:f=null,productBubbles:p=[],confirmingProduct:x=null,updateConfirmingProduct:I=null,removeProductBubble:j=null,isDecorating:E=!1,setIsDecorating:C=null}=C_(),{roomSession:b=null}=ke();ve(ys.NORMAL_MODE,T=>{t&&s(!1)}),ve(ys.GAME_MODE,T=>{t||s(!0)}),He(AE.RSDE_DANCE,T=>{T.roomIndex===b.ownRoomIndex&&r(T.danceId!==0)}),ot(ho.UPDATE_CHAT,T=>l(T));const _=()=>{if(!b||t)return null;if(h)return e.jsx($d,{nameInfo:h,onClose:()=>u(null)});if(c)switch(c.type){case yr.FURNI:{const T=c;return E?e.jsx(yR,{avatarInfo:T,onClose:()=>m(null)}):null}case Rt.OWN_USER:case Rt.PEER:{const T=c;return K("user.tags.enabled")&&B().getUserTags(T.roomIndex),T.isSpectatorMode?null:T.isOwnUser?ql.isRunning()?null:e.jsx(RR,{avatarInfo:T,isDancing:n,setIsDecorating:C,onClose:()=>m(null)}):e.jsx(wR,{avatarInfo:T,onClose:()=>m(null)})}case Rr.PET_INFO:{const T=c;return T.isOwner?e.jsx(OR,{avatarInfo:T,onClose:()=>m(null)}):e.jsx(kR,{avatarInfo:T,onClose:()=>m(null)})}case Or.RENTABLE_BOT:return e.jsx(AR,{avatarInfo:c,onClose:()=>m(null)})}return null},S=()=>{if(!c)return null;switch(c.type){case yr.FURNI:return e.jsx(jR,{avatarInfo:c,onClose:()=>m(null)});case Rt.OWN_USER:case Rt.PEER:return e.jsx(SR,{avatarInfo:c,setAvatarInfo:m,onClose:()=>m(null)});case Rt.BOT:return e.jsx(xR,{avatarInfo:c,onClose:()=>m(null)});case Or.RENTABLE_BOT:return e.jsx(bR,{avatarInfo:c,onClose:()=>m(null)});case Rr.PET_INFO:return e.jsx(IR,{avatarInfo:c,onClose:()=>m(null)})}};return e.jsxs(e.Fragment,{children:[E&&e.jsx(TR,{userId:B().userId,userName:B().userName,roomIndex:b.ownRoomIndex,setIsDecorating:C}),_(),c&&e.jsx(v,{alignItems:"end",className:"nitro-infostand-container",children:S()}),g.length>0&&g.map((T,L)=>e.jsx($d,{nameInfo:T,onClose:()=>f(L)},L)),p.length>0&&p.map((T,L)=>e.jsx(pR,{item:T,updateConfirmingProduct:I,onClose:()=>j(L)},T.id)),i&&e.jsx(uR,{chatEvent:i,onClose:()=>l(null)}),x&&e.jsx(dR,{item:x,onClose:()=>I(null)}),e.jsx(cR,{})]})},PR=a=>{const{chatStyleId:t=0,chatStyleIds:s=null,selectChatStyleId:n=null}=a,[r,i]=o.useState(null),[l,c]=o.useState(!1),m=u=>{n(u),c(!1)},h=u=>{let g=!1;c(f=>(g=!f,g)),g&&i(u.target)};return o.useEffect(()=>{l||i(null)},[l]),e.jsxs(e.Fragment,{children:[e.jsx(A,{pointer:!0,className:"icon chatstyles-icon",onClick:h}),e.jsx(qo,{show:l,target:r,placement:"top",children:e.jsx(ui,{className:"nitro-chat-style-selector-container",children:e.jsx(se,{overflow:"hidden",className:"bg-transparent bubble-window image-rendering-pixelated",children:e.jsx(ne,{gap:1,columnCount:3,overflow:"auto",children:s&&s.length>0&&s.map(u=>e.jsx(w,{center:!0,pointer:!0,className:"bubble-parent-container",onClick:g=>m(u),children:e.jsx(A,{className:"bubble-container",children:e.jsx(A,{className:`chat-bubble bubble-${u}`,children:" "})},u)},u))})})})})]})},LR=a=>{const{addChatEmoji:t=null}=a,[s,n]=o.useState(!1),[r,i]=o.useState(null),l=o.useRef(null),c=o.useRef(null),m=g=>{t(g.native),n(!1)},h=g=>{c.current&&!c.current.contains(g.target)&&!g.target.classList.contains("emoji-icon")&&(n(!1),document.removeEventListener("mousedown",h),i(null))},u=g=>{n(f=>!f)};return o.useEffect(()=>{s?document.addEventListener("mousedown",h):i(null)},[c,s]),e.jsxs(e.Fragment,{children:[e.jsx(A,{pointer:!0,onClick:u,innerRef:l,children:"🙂"}),e.jsx(qo,{show:s,target:l,placement:"top-end",children:e.jsx(ui,{children:e.jsx(DE,{data:PE,onEmojiSelect:m})})})]})},MR=a=>{const{chatColour:t="black",selectColour:s=null}=a,[n,r]=o.useState(!1),[i,l]=o.useState(null),c=o.useRef(null);o.useEffect(()=>{const u=new Set(["r","b","g","y","w","o","c","br","pr","pk"]),g=new Map;$.forEach((f,p)=>{!u.has(p)&&!Array.from(g.values()).includes(f)&&g.set(p,f)}),l(g)},[]);const m=u=>{s(u),r(!1)},h=()=>{r(u=>!u)};return e.jsxs(e.Fragment,{children:[e.jsx(A,{pointer:!0,onClick:()=>h(),innerRef:c,style:{color:(i&&i.get(t))??"black"},children:e.jsx(LE,{})}),e.jsx(qo,{show:n,target:c,placement:"top",children:e.jsx(ui,{className:"nitro-chat-style-selector-container",children:e.jsx(se,{overflow:"hidden",className:"bg-transparent colour-container image-rendering-pixelated",children:e.jsx(Pe,{gap:1,columnCount:6,columnMinWidth:20,columnMinHeight:20,children:i&&i.size>0&&Array.from(i).map(([u,g])=>e.jsx(Ce,{itemHighlight:!0,itemColor:g,itemActive:t===u,className:"clear-bg",onClick:f=>m(u)},u))})})})})]})},UR=a=>{const[t,s]=o.useState(""),{chatStyleId:n=0,updateChatStyleId:r=null,chatColour:i="",updateChatColour:l=null}=zn(),{selectedUsername:c="",floodBlocked:m=!1,floodBlockedSeconds:h=0,setIsTyping:u=null,setIsIdle:g=null,sendChat:f=null}=v_(),[p,x]=o.useState(!1),{roomSession:I=null}=ke(),j=o.useRef(),E=o.useMemo(()=>d("widgets.chatinput.mode.whisper"),[]),C=o.useMemo(()=>d("widgets.chatinput.mode.shout"),[]),b=o.useMemo(()=>d("widgets.chatinput.mode.speak"),[]),_=o.useMemo(()=>K("chat.input.maxlength",100),[]),S=o.useCallback(()=>{const V=document.activeElement;return!(!V||j&&j.current===V||!(V instanceof HTMLInputElement)&&!(V instanceof HTMLTextAreaElement))},[j]),T=o.useCallback(()=>{j.current.focus(),j.current.setSelectionRange(j.current.value.length*2,j.current.value.length*2)},[j]),L=o.useCallback(()=>{s(V=>V!==E||!c.length?V:`${V} ${c}`)},[c,E]),k=o.useCallback((V,Y=!1)=>{if(!V||V==="")return;let q=Y?pn.CHAT_SHOUT:pn.CHAT_DEFAULT,U=V;const J=U.split(" ");let je="",we="";switch(J[0]){case E:q=pn.CHAT_WHISPER,je=J[1],we=E+" "+je+" ",J.shift(),J.shift();break;case C:q=pn.CHAT_SHOUT,J.shift();break;case b:q=pn.CHAT_DEFAULT,J.shift();break}U=J.join(" "),u(!1),g(!1),U.length<=_&&(/%CC%/g.test(encodeURIComponent(U))?s(""):(s(""),f(U,q,je,n,i))),s(we)},[E,C,b,_,n,u,g,f,i]),R=o.useCallback(V=>{!V||!V.length?u(!1):(u(!0),g(!0)),s(V)},[u,g]),y=o.useCallback(V=>{if(m||!j.current||S())return;document.activeElement!==j.current&&T();const Y=V.target.value;switch(V.key){case" ":case"Space":L();return;case"NumpadEnter":case"Enter":k(Y,V.shiftKey);return;case"Backspace":if(Y){const q=Y.split(" ");q[0]===E&&q.length===3&&q[2]===""&&s("")}return}},[m,j,E,S,T,L,k]);ot(wr.CHAT_INPUT_CONTENT,V=>{switch(V.chatMode){case wr.WHISPER:{s(`${E} ${V.userName} `);return}case wr.SHOUT:return}});const O=o.useMemo(()=>{let V=[];const Y=K("chat.styles");for(const q of Y)if(q){if(q.minRank>0){B().hasSecurity(q.minRank)&&V.push(q.styleId);continue}if(q.isSystemStyle&&B().hasSecurity($e.MODERATOR)){V.push(q.styleId);continue}if(!(K("chat.styles.disabled").indexOf(q.styleId)>=0)){if(q.isHcOnly&&Cs()>=Bt.CLUB){V.push(q.styleId);continue}if(q.isAmbassadorOnly&&B().isAmbassador){V.push(q.styleId);continue}!q.isHcOnly&&!q.isAmbassadorOnly&&V.push(q.styleId)}}return V},[]),F=V=>{s(t+V),u(!0)};return o.useEffect(()=>(document.body.addEventListener("keydown",y),()=>{document.body.removeEventListener("keydown",y)}),[y]),o.useEffect(()=>{j.current&&(j.current.parentElement.dataset.value=t)},[t]),!I||I.isSpectator?null:Bo.createPortal(e.jsxs("div",{className:"nitro-chat-input-container",onMouseEnter:()=>x(!0),onMouseLeave:()=>setTimeout(()=>x(!1),100),children:[e.jsxs("div",{className:"input-sizer align-items-center",children:[!m&&e.jsx("input",{ref:j,type:"text",className:"chat-input",placeholder:d("widgets.chatinput.default"),value:t,maxLength:_,onChange:V=>R(V.target.value),onMouseDown:V=>T()}),m&&e.jsxs(N,{variant:"danger",children:[d("chat.input.alert.flood",["time"],[h.toString()])," "]})]}),e.jsxs(w,{children:[e.jsx(LR,{addChatEmoji:F}),e.jsx(MR,{chatColour:i,selectColour:l}),e.jsx(PR,{chatStyleId:n,chatStyleIds:O,selectChatStyleId:r}),p&&e.jsx(A,{className:"info-habbopages",onClick:()=>Z("habbopages/chat/chatting")})]})]}),document.getElementById("toolbar-chat-input-container"))},FR=()=>{let a=null;self.onmessage=t=>{if(!t)return;const s=t.data;switch(s.action){case"START":a=setInterval(()=>postMessage(null),s.content);break;case"STOP":a&&(clearInterval(a),a=null);break}}};class VR extends Worker{constructor(t){const s=t.toString(),n=new Blob([`(${s})()`]);super(URL.createObjectURL(n))}}const GR=a=>{const{chat:t=null,makeRoom:s=null,bubbleWidth:n=Et.CHAT_BUBBLE_WIDTH_NORMAL,selectedEmoji:r}=a,[i,l]=o.useState(!1),[c,m]=o.useState(!1),{onClickChat:h=null}=Rh(),u=o.useRef(),g=o.useMemo(()=>{switch(n){case Et.CHAT_BUBBLE_WIDTH_NORMAL:return 350;case Et.CHAT_BUBBLE_WIDTH_THIN:return 240;case Et.CHAT_BUBBLE_WIDTH_WIDE:return 2e3}},[n]);return o.useEffect(()=>{l(!1);const f=u.current;if(!f)return;const p=f.offsetWidth,x=f.offsetHeight;t.width=p,t.height=x,t.elementRef=f;let I=t.left,j=t.top;return!I&&!j&&(I=t.location.x-p/2,j=f.parentElement.offsetHeight-x,t.left=I,t.top=j),m(!0),()=>{t.elementRef=null,m(!1)}},[t]),o.useEffect(()=>{!c||!t||i||(s&&s(t),l(!0))},[t,c,i,s]),e.jsxs("div",{ref:u,className:`bubble-container newbubblehe ${i?"visible":"invisible"}`,onClick:f=>H().selectRoomObject(t.roomId,t.senderId,X.UNIT),children:[r&&e.jsx("span",{children:DOMPurify.sanitize(r)}),t.styleId===0&&e.jsx("div",{className:"user-container-bg",style:{backgroundColor:t.color}}),e.jsxs("div",{className:`chat-bubble bubble-${t.styleId} type-${t.type}`,style:{maxWidth:g},children:[e.jsx("div",{className:"user-container",children:t.imageUrl&&t.imageUrl.length>0&&e.jsx("div",{className:"user-image",style:{backgroundImage:`url(${t.imageUrl})`}})}),e.jsxs("div",{className:"chat-content",children:[e.jsx("b",{className:"username mr-1",dangerouslySetInnerHTML:{__html:`${t.username}: `}}),e.jsx("span",{className:"message",style:{color:t.chatColours},dangerouslySetInnerHTML:{__html:`${t.formattedText}`},onClick:f=>h(f)})]}),e.jsx("div",{className:"pointer"})]})]})},BR=a=>{const{chatMessages:t=[],setChatMessages:s=null,chatSettings:n=null,getScrollSpeed:r=6e3}=S_(),i=o.useRef(),l=o.useCallback(()=>{s(h=>{if(h){const u=h.filter(g=>g.top>-g.height*2);if(u.length!==h.length)return u}return h})},[s]),c=o.useCallback((h,u,g)=>{for(let f=t.indexOf(h)-1;f>=0;f--){const p=t[f];if(!(!p||h===p||g.indexOf(p)>=0||p.top+p.height-u>h.top+h.height)&&EN(h,p,-u,0)){const x=Math.abs(p.top+p.height-h.top);g.push(p),p.top-=x,p.skipMovement=!0,c(p,x,g)}}},[t]),m=o.useCallback(h=>{if(n.mode===Et.CHAT_MODE_FREE_FLOW)h.skipMovement=!0,c(h,0,[h]),l();else{const u=h.top+h.height,g=h.height,f=i.current.offsetHeight-u,p=g-f;f(x.forEach(I=>{I!==h&&(I.top-=p)}),x)),l())}},[n,c,l,s]);return o.useEffect(()=>{const h=(u=null)=>{if(!i||!i.current)return;const g=i.current.offsetHeight,f=Math.round(document.body.offsetHeight*K("chat.viewer.height.percentage"));i.current.style.height=`${f}px`,s(p=>(p&&p.forEach(x=>x.top-=g-f),p))};return window.addEventListener("resize",h),h(),()=>{window.removeEventListener("resize",h)}},[s]),o.useEffect(()=>{const h=g=>{s(f=>(f.forEach(p=>{if(p.skipMovement){p.skipMovement=!1;return}p.top-=g}),f)),l()},u=new VR(FR);return u.onmessage=()=>h(15),u.postMessage({action:"START",content:r}),()=>{u.postMessage({action:"STOP"}),u.terminate()}},[r,l,s]),e.jsx("div",{ref:i,className:"nitro-chat-widget",children:t.map(h=>e.jsx(GR,{chat:h,makeRoom:m,bubbleWidth:n.weight},h.id))})},im=100,$h=a=>{const{title:t=null,items:s=[],selectItem:n=null,onClose:r=null}=a,[i,l]=o.useState(null),[c,m]=o.useState(""),h=B().isModerator,[u,g]=o.useState(!1),[f,p]=o.useState([]),x=C=>{if(C)I(C)?p(f.filter(b=>b!==C)):f.length!b),u)p([]);else{const b=E.map(_=>_.id).slice(0,im);p(b)}},I=C=>f.includes(C),j=()=>{D(new ME(...f)),p([]),g(!1)},E=o.useMemo(()=>{const C=c.toLocaleLowerCase();return s.filter(S=>{var T;return(T=S.name)==null?void 0:T.toLocaleLowerCase().includes(C)}).sort((S,T)=>S.name.localeCompare(T.name))},[s,c]);return o.useEffect(()=>{i&&n(i)},[i,n]),e.jsxs(ie,{className:"nitro-chooser-widget",theme:"primary-slim",children:[e.jsx(re,{headerText:t+" ("+E.length+")",onCloseClick:r}),e.jsxs(se,{overflow:"hidden",gap:1,children:[e.jsx("input",{type:"text",className:"form-control form-control-sm",placeholder:d("generic.search"),value:c,onChange:C=>m(C.target.value)}),a.pickallFurni&&e.jsxs(w,{gap:2,className:"text-black",children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:u,onChange:C=>x()}),e.jsx("label",{className:"form-check-label",children:d("widget.chooser.checkall")})]}),e.jsx(nl,{rows:E,rowRender:C=>e.jsxs(w,{alignItems:"center",className:zt("rounded p-1",i===C&&"bg-muted"),pointer:!0,onClick:b=>l(C),children:[a.pickallFurni&&e.jsx("input",{className:"flex-shrink-0 mx-1 form-check-input",type:"checkbox",name:"showMyFace",checked:I(C.id),onChange:b=>x(C.id)}),e.jsxs(N,{truncate:!0,children:[C.name," ",h&&" - "+C.id]})]})}),a.pickallFurni&&e.jsx(P,{variant:"secondary",onClick:C=>j(),disabled:!f.length,children:d("widget.chooser.btn.pickall")})]})]})},HR=a=>{const{items:t=null,onClose:s=null,selectItem:n=null,populateChooser:r=null}=D_(),{roomSession:i=null}=ke();return o.useEffect(()=>{const l={linkReceived:c=>{c.split("/"),r()},eventUrlPrefix:"furni-chooser/"};return ht(l),()=>gt(l)},[r]),t?e.jsx($h,{title:d("widget.chooser.furni.title"),items:t,selectItem:n,onClose:s,pickallFurni:i==null?void 0:i.isRoomOwner}):null},WR=a=>{const{items:t=null,onClose:s=null,selectItem:n=null,populateChooser:r=null}=V_();return o.useEffect(()=>{const i={linkReceived:l=>{l.split("/"),r()},eventUrlPrefix:"user-chooser/"};return ht(i),()=>gt(i)},[r]),t?e.jsx($h,{title:d("widget.chooser.user.title"),items:t,selectItem:n,onClose:s}):null},qR=a=>{const[t,s]=o.useState(!1),{users:n=[],answer:r=null}=T_();return o.useEffect(()=>{s(!!n.length)},[n]),t?e.jsxs(ie,{className:"nitro-widget-doorbell",theme:"primary-slim",children:[e.jsx(re,{headerText:d("navigator.doorbell.title"),onCloseClick:i=>s(!1)}),e.jsxs(se,{overflow:"hidden",gap:0,children:[e.jsx(v,{gap:2,children:e.jsxs(ne,{gap:1,className:"text-black fw-bold border-bottom px-1 pb-1",children:[e.jsx(A,{className:"g-col-6",children:d("generic.username")}),e.jsx(A,{className:"g-col-6"})]})}),e.jsx(v,{overflow:"auto",className:"striped-children",gap:0,children:n&&n.length>0&&n.map(i=>e.jsxs(ne,{gap:1,alignItems:"center",className:"text-black border-bottom p-1",children:[e.jsx(A,{className:"g-col-6",children:i}),e.jsx(A,{className:"g-col-6",children:e.jsxs(w,{alignItems:"center",justifyContent:"end",gap:1,children:[e.jsx(P,{variant:"success",onClick:()=>r(i,!0),children:d("generic.accept")}),e.jsx(P,{variant:"danger",onClick:()=>r(i,!1),children:d("generic.deny")})]})})]},i))})]})]}):null},$c=a=>{const{objectId:t=-1,category:s=-1,noFollow:n=!1,position:r="absolute",...i}=a,[l,c]=o.useState({x:-1,y:-1}),m=o.useRef();return o.useEffect(()=>{let h=!1;const u=()=>{const f=ye();return Sc(f.roomId,t,s,1)},g=()=>{const f=u();!f||!m.current||c({x:Math.round(f.left+f.width/2-m.current.offsetWidth/2),y:Math.round(f.top-m.current.offsetHeight+10)})};return n?g():(h=!0,Wn().add(g)),()=>{h&&Wn().remove(g)}},[t,s,n]),e.jsx(A,{innerRef:m,position:r,visible:l.x+(m.current?m.current.offsetWidth:0)>-1,className:"object-location",style:{left:l.x,top:l.y},...i})},zR=a=>{const{roomIndex:t=-1,request:s=null,hideFriendRequest:n=null,requestResponse:r=null}=a;return e.jsx($c,{objectId:t,category:X.UNIT,children:e.jsx(A,{className:"nitro-friend-request-dialog nitro-context-menu p-2",children:e.jsxs(v,{children:[e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:2,children:[e.jsx(N,{variant:"white",fontSize:6,children:d("widget.friendrequest.from",["username"],[s.name])}),e.jsx(Hs,{className:"cursor-pointer fa-icon",onClick:i=>n(s.requesterUserId)})]}),e.jsxs(w,{justifyContent:"end",gap:1,children:[e.jsx(P,{variant:"danger",onClick:i=>r(s.requesterUserId,!1),children:d("widget.friendrequest.decline")}),e.jsx(P,{variant:"success",onClick:i=>r(s.requesterUserId,!0),children:d("widget.friendrequest.accept")})]})]})})})},YR=a=>{const{displayedRequests:t=[],hideFriendRequest:s=null}=k_(),{requestResponse:n=null}=hs();return t.length?e.jsx(e.Fragment,{children:t.map((r,i)=>e.jsx(zR,{roomIndex:r.roomIndex,request:r.request,hideFriendRequest:s,requestResponse:n},i))}):null},$R=a=>{const{productType:t=fe.FLOOR,classId:s=-1,extraParam:n=void 0}=a;switch(t){case fe.WALL:case fe.FLOOR:return e.jsx(Qo,{productType:t,productClassId:s});case fe.BADGE:return e.jsx(mt,{badgeCode:n});case fe.HABBO_CLUB:return e.jsx(Nt,{type:"hc"})}return null},KR=a=>{const{ownerId:t=-1}=a,[s,n]=o.useState(0),[r,i]=o.useState(void 0),l=()=>{s===1&&D(new GE(t)),n(0),i(void 0)};M(UE,m=>{n(1)}),M(FE,m=>{n(0),i(void 0)}),M(VE,m=>{const h=m.getParser();i({contentType:h.contentType,classId:h.classId}),n(2)});const c=B().userId===t;return s===0?null:e.jsxs(ie,{className:"nitro-mysterybox-dialog",theme:"primary-slim",children:[e.jsx(re,{headerText:d(s===1?`mysterybox.dialog.${c?"owner":"other"}.title`:"mysterybox.reward.title"),onCloseClick:l}),e.jsxs(se,{children:[s===1&&e.jsxs(e.Fragment,{children:[e.jsxs(N,{variant:"primary",children:[" ",d(`mysterybox.dialog.${c?"owner":"other"}.subtitle`)," "]}),e.jsxs(N,{children:[" ",d(`mysterybox.dialog.${c?"owner":"other"}.description`)," "]}),e.jsxs(N,{children:[" ",d(`mysterybox.dialog.${c?"owner":"other"}.waiting`)]}),e.jsxs(P,{variant:"danger",onClick:l,className:"mt-auto",children:[" ",d(`mysterybox.dialog.${c?"owner":"other"}.cancel`)," "]})]}),s===2&&r&&e.jsxs(e.Fragment,{children:[e.jsxs(N,{variant:"black",children:[" ",d("mysterybox.reward.text")," "]}),e.jsx(w,{className:"prize-container justify-content-center mx-auto",children:e.jsx($R,{classId:r.classId,productType:r.contentType})}),e.jsxs(P,{variant:"success",onClick:l,className:"mt-auto",children:[" ",d("mysterybox.reward.close")," "]})]})]})]})},XR=a=>{const{objectId:t=-1,onClose:s=null}=a,[n,r]=o.useState(""),i=()=>{D(new BE(t,n)),s()};return t===-1?null:e.jsxs(ie,{className:"nitro-mysterytrophy-dialog no-resize",theme:"primary-slim",children:[e.jsx(re,{center:!0,headerText:d("mysterytrophy.header.title"),onCloseClick:s}),e.jsxs(se,{children:[e.jsxs(w,{className:"mysterytrophy-dialog-top p-3",children:[e.jsx("div",{className:"mysterytrophy-image flex-shrink-0"}),e.jsx("div",{className:"m-2",children:e.jsx(N,{variant:"white",className:"mysterytrophy-text-big",children:d("mysterytrophy.header.description")})})]}),e.jsx(w,{className:"mysterytrophy-dialog-bottom p-2",children:e.jsxs(v,{gap:1,children:[e.jsxs(w,{alignItems:"center",className:"bg-white rounded py-1 px-2 input-mysterytrophy-dialog",children:[e.jsx("textarea",{className:"form-control form-control-sm input-mysterytrophy",value:n,onChange:l=>r(l.target.value)}),e.jsx("div",{className:"mysterytrophy-pencil-image flex-shrink-0 small fa-icon"})]}),e.jsxs(w,{className:"mt-2",gap:5,display:"flex",justifyContent:"center",alignItems:"center",children:[e.jsx(N,{pointer:!0,className:"text-decoration",onClick:()=>s(),children:d("cancel")}),e.jsx(P,{variant:"success",onClick:()=>i(),children:d("generic.ok")})]})]})})]})]})},QR=a=>{const{objectId:t=-1,onClose:s=null}=a,{roomSession:n=null}=ke(),r=()=>{n.useMultistateItem(t),s()};return e.jsxs(ie,{className:"nitro-use-product-confirmation",children:[e.jsx(re,{headerText:d("effectbox.header.title"),onCloseClick:s}),e.jsx(se,{center:!0,children:e.jsx(w,{gap:2,children:e.jsxs(v,{justifyContent:"between",children:[e.jsx(N,{children:d("effectbox.header.description")}),e.jsxs(w,{alignItems:"center",justifyContent:"between",children:[e.jsx(P,{variant:"danger",onClick:s,children:d("generic.cancel")}),e.jsx(P,{variant:"success",onClick:r,children:d("generic.ok")})]})]})})})]})},Ya=-1,JR=0,ZR=a=>{const{objectId:t=-1,onClose:s=null}=a,[n,r]=o.useState(null),[i,l]=o.useState(Ya),{roomSession:c=null}=ke(),m=()=>{c.useMultistateItem(t),s()};return o.useEffect(()=>{if(!c||t===-1)return;const h=zo(c.roomId,t,X.FLOOR);if(!h)return;r(h);let u=Ya;switch(h.specialType){case de.MONSTERPLANT_SEED:u=JR;break}if(u===Ya){s();return}l(u)},[c,t,s]),i===Ya?null:e.jsxs(ie,{className:"nitro-use-product-confirmation",children:[e.jsx(re,{headerText:d("useproduct.widget.title.plant_seed",["name"],[n.name]),onCloseClick:s}),e.jsx(se,{center:!0,children:e.jsxs(w,{gap:2,overflow:"hidden",children:[e.jsx(v,{children:e.jsx(A,{className:"product-preview",children:e.jsx(A,{className:"monsterplant-image"})})}),e.jsxs(v,{justifyContent:"between",overflow:"auto",children:[e.jsxs(v,{gap:2,children:[e.jsx(N,{children:d("useproduct.widget.text.plant_seed",["productName"],[n.name])}),e.jsx(N,{children:d("useproduct.widget.info.plant_seed")})]}),e.jsxs(w,{alignItems:"center",justifyContent:"between",children:[e.jsx(P,{variant:"danger",onClick:s,children:d("useproduct.widget.cancel")}),e.jsx(P,{variant:"success",onClick:m,children:d("widget.monsterplant_seed.button.use")})]})]})]})})]})},$a=-1,eO=0,tO=a=>{const{objectId:t=-1,onClose:s=null}=a,[n,r]=o.useState($a),[i,l]=o.useState(Ne.MALE),[c,m]=o.useState(null),{roomSession:h=null}=ke(),u=()=>{Kl().send(new HE(t)),Kl().send(new wm(i,c)),s()};return o.useEffect(()=>{let g=$a;const f=B().figure,p=B().gender,x=[];if(h&&t>=0){const I=zo(h.roomId,t,X.FLOOR);if(I)switch(I.specialType){case de.FIGURE_PURCHASABLE_SET:g=eO;const j=I.customParams.split(",").map(E=>parseInt(E));for(const E of j)vt().isValidFigureSetForGender(E,p)&&x.push(E);break}}if(g===$a){s();return}l(p),m(vt().getFigureStringWithFigureIds(f,p,x)),r(g)},[h,t,s]),n===$a?null:e.jsxs(ie,{className:"nitro-use-product-confirmation",children:[e.jsx(re,{headerText:d("useproduct.widget.title.bind_clothing"),onCloseClick:s}),e.jsx(se,{center:!0,children:e.jsxs(w,{gap:2,overflow:"hidden",children:[e.jsx(v,{children:e.jsx(A,{className:"mannequin-preview",children:e.jsx(nt,{figure:c,direction:2})})}),e.jsxs(v,{justifyContent:"between",overflow:"auto",children:[e.jsxs(v,{gap:2,children:[e.jsx(N,{children:d("useproduct.widget.text.bind_clothing")}),e.jsx(N,{children:d("useproduct.widget.info.bind_clothing")})]}),e.jsxs(w,{alignItems:"center",justifyContent:"between",children:[e.jsx(P,{variant:"danger",onClick:s,children:d("useproduct.widget.cancel")}),e.jsx(P,{variant:"success",onClick:u,children:d("useproduct.widget.bind_clothing")})]})]})]})})]})},sO=a=>{const{closeConfirm:t=null,processAction:s=null,onClose:n=null,objectId:r=-1,mode:i=null,confirmMode:l=null,confirmingObjectId:c=-1,groupData:m=null,isGroupMember:h=!1,objectOwnerId:u=-1}=Ov(),{simpleAlert:g=null}=Fe();M(WE,p=>{const x=p.getParser();if(x)switch(x.count){case 1:g(d("costumehopper.costumerequired.bodytext"),null,"catalog/open/temporary_effects",d("costumehopper.costumerequired.buy"),d("costumehopper.costumerequired.header"),null);break;case 2:g(d("viphopper.viprequired.bodytext"),null,"catalog/open/habbo_club",d("viprequired.buy.vip"),d("viprequired.header"),null);break;case 3:g(d("gate.viprequired.bodytext"),null,"catalog/open/habbo_club",d("viprequired.buy.vip"),d("gate.viprequired.title"),null);break}});const f=B().userId===u;return e.jsxs(e.Fragment,{children:[l===ic&&e.jsx(ZR,{objectId:c,onClose:t}),l===ac&&e.jsx(tO,{objectId:c,onClose:t}),l===yh&&e.jsx(QR,{objectId:c,onClose:t}),l===oc&&e.jsx(XR,{objectId:c,onClose:t}),e.jsx(KR,{ownerId:u}),r>=0&&i&&e.jsxs(yn,{objectId:r,category:X.FLOOR,onClose:n,fades:!0,children:[i===Ft.FRIEND_FURNITURE&&e.jsxs(e.Fragment,{children:[e.jsx(rs,{children:d("friendfurni.context.title")}),e.jsx(W,{onClick:p=>s("use_friend_furni"),children:d("friendfurni.context.use")})]}),i===Ft.MONSTERPLANT_SEED&&e.jsxs(e.Fragment,{children:[e.jsx(rs,{children:d("furni.mnstr_seed.name")}),e.jsx(W,{onClick:p=>s("use_monsterplant_seed"),children:d("widget.monsterplant_seed.button.use")})]}),i===Ft.RANDOM_TELEPORT&&e.jsxs(e.Fragment,{children:[e.jsx(rs,{children:d("furni.random_teleport.name")}),e.jsx(W,{onClick:p=>s("use_random_teleport"),children:d("widget.random_teleport.button.use")})]}),i===Ft.PURCHASABLE_CLOTHING&&e.jsxs(e.Fragment,{children:[e.jsx(rs,{children:d("furni.generic_usable.name")}),e.jsx(W,{onClick:p=>s("use_purchaseable_clothing"),children:d("widget.generic_usable.button.use")})]}),i===Ft.MYSTERY_BOX&&e.jsxs(e.Fragment,{children:[e.jsx(rs,{children:d("mysterybox.context.title")}),e.jsx(W,{onClick:p=>s("use_mystery_box"),children:d("mysterybox.context."+(f?"owner":"other")+".use")})]}),i===Ft.MYSTERY_TROPHY&&e.jsxs(e.Fragment,{children:[e.jsx(rs,{children:d("mysterytrophy.header.title")}),e.jsx(W,{onClick:p=>s("use_mystery_trophy"),children:d("friendfurni.context.use")})]}),i===Th&&m&&e.jsxs(e.Fragment,{children:[e.jsx(rs,{className:"cursor-pointer text-truncate",onClick:()=>ca(m.guildId),children:m.guildName}),!h&&e.jsx(W,{onClick:p=>s("join_group"),children:d("widget.furniture.button.join.group")}),e.jsx(W,{onClick:p=>s("go_to_group_homeroom"),children:d("widget.furniture.button.go.to.group.home.room")}),m.guildHasReadableForum&&e.jsx(W,{onClick:p=>s("open_forum"),children:d("widget.furniture.button.open_group_forum")})]})]})]})},nO=a=>{const{objectId:t=-1,color:s=0,setColor:n=null,applyToner:r=null,toggleToner:i=null,onClose:l=null}=wv();return t===-1?null:e.jsxs(ie,{theme:"primary-slim",className:"nitro-room-widget-toner",children:[e.jsx(re,{headerText:d("widget.backgroundcolor.title"),onCloseClick:l}),e.jsxs(se,{overflow:"hidden",justifyContent:"between",children:[e.jsx(v,{overflow:"auto",gap:1,children:e.jsx("input",{type:"color",className:"form-control",value:ms.makeColorNumberHex(s),onChange:c=>n(ms.convertFromHex(c.target.value))})}),e.jsxs(v,{gap:1,children:[e.jsx(P,{fullWidth:!0,variant:"primary",onClick:i,children:d("widget.backgroundcolor.button.on")}),e.jsx(P,{fullWidth:!0,variant:"primary",onClick:r,children:d("widget.backgroundcolor.button.apply")})]})]})]})},rO=a=>{const{objectId:t=-1,color:s="1",badgeName:n="",badgeDesc:r="",date:i="",senderName:l="",onClose:c=null}=yv();return t===-1?null:e.jsx(jh,{color:s,message:r,date:i,senderName:l,customTitle:n,onCloseClick:c})},iO=a=>{const{objectId:t=-1,recipes:s=[],ingredients:n=[],selectedRecipe:r=null,requiredIngredients:i=null,isCrafting:l=!1,craft:c=null,selectRecipe:m=null,onClose:h=null}=Av(),{roomSession:u=null}=ke(),[g,f]=o.useState(!1),p=o.useMemo(()=>{if(!u)return!1;const j=H().getRoomObject(u.roomId,t,X.FLOOR);return $t(j)},[t,u]),x=o.useMemo(()=>{if(!i||!i.length)return!1;for(const j of i){const E=n.find(C=>C.name===j.itemName);if(!E||E.count{if(!g){f(!0);return}c(),f(!1)};return o.useEffect(()=>{f(!1)},[r]),t===-1?null:e.jsxs(ie,{className:"nitro-widget-crafting",theme:"primary-slim",children:[e.jsx(re,{headerText:d("crafting.title"),onCloseClick:h}),e.jsx(se,{children:e.jsxs(w,{grow:!0,overflow:"hidden",gap:2,children:[e.jsxs(w,{column:!0,fullWidth:!0,gap:2,children:[e.jsxs(v,{overflow:"hidden",fullHeight:!0,children:[e.jsx("div",{className:"bg-muted rounded py-1 text-center",children:d("crafting.title.products")}),e.jsx(Pe,{columnCount:5,children:s.length>0&&s.map(j=>e.jsx(Ce,{itemImage:j.iconUrl,itemActive:r&&r.name===j.name,onClick:()=>m(j)},j.name))})]}),e.jsxs(v,{overflow:"hidden",fullHeight:!0,children:[e.jsx("div",{className:"bg-muted rounded py-1 text-center",children:d("crafting.title.mixer")}),e.jsx(Pe,{columnCount:5,children:n.length>0&&n.map(j=>e.jsx(Ce,{itemImage:j.iconUrl,itemCount:j.count,itemCountMinimum:0,className:(j.count?"":"opacity-0-5 ")+"cursor-default"},j.name))})]})]}),e.jsxs(w,{column:!0,fullWidth:!0,gap:2,children:[!r&&e.jsx(v,{center:!0,fullHeight:!0,className:"text-black text-center",children:d("crafting.info.start")}),r&&e.jsxs(e.Fragment,{children:[e.jsxs(v,{overflow:"hidden",fullHeight:!0,children:[e.jsx("div",{className:"bg-muted rounded py-1 text-center",children:d("crafting.current_recipe")}),e.jsx(Pe,{columnCount:5,children:!!i&&i.length>0&&i.map(j=>{const E=n.find(b=>b.name===j.itemName),C=[];for(let b=0;b{const[t,s]=o.useState(!1),{presets:n=[],dimmerState:r=0,selectedPresetId:i=0,color:l=16777215,brightness:c=255,effectId:m=0,selectedColor:h=0,setSelectedColor:u=null,selectedBrightness:g=0,setSelectedBrightness:f=null,selectedEffectId:p=0,setSelectedEffectId:x=null,selectPresetId:I=null,applyChanges:j}=Pv(),E=()=>{Fs.previewDimmer(l,c,m===2),s(!1)};ve(Se.REMOVE_DIMMER,b=>s(!1)),o.useEffect(()=>{!n||!n.length||s(!0)},[n]);const C=o.useMemo(()=>K("widget.dimmer.colorwheel",!1),[]);return t?e.jsxs(ie,{className:"nitro-room-widget-dimmer",children:[e.jsx(re,{headerText:d("widget.dimmer.title"),onCloseClick:E}),r===1&&e.jsx(Tn,{children:n.map(b=>e.jsx(tn,{isActive:i===b.id,onClick:_=>I(b.id),children:d(`widget.dimmer.tab.${b.id}`)},b.id))}),e.jsxs(se,{children:[r===0&&e.jsxs(v,{alignItems:"center",children:[e.jsx(A,{className:"dimmer-banner"}),e.jsx(N,{center:!0,className:"bg-muted rounded p-1",children:d("widget.dimmer.info.off")}),e.jsx(P,{fullWidth:!0,variant:"success",onClick:()=>Fs.changeState(),children:d("widget.dimmer.button.on")})]}),r===1&&e.jsxs(e.Fragment,{children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{fontWeight:"bold",children:d("widget.backgroundcolor.hue")}),C&&e.jsx("input",{type:"color",className:"form-control",value:ms.makeColorNumberHex(h),onChange:b=>u(ms.convertFromHex(b.target.value))}),!C&&e.jsx(ne,{gap:1,columnCount:7,children:Fs.AVAILABLE_COLORS.map((b,_)=>e.jsx(v,{fullWidth:!0,pointer:!0,className:zt("color-swatch rounded",b===h&&"active"),onClick:()=>u(b),style:{backgroundColor:Fs.HTML_COLORS[_]}},_))})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{fontWeight:"bold",children:d("widget.backgroundcolor.lightness")}),e.jsx(Lt,{min:Fs.MIN_BRIGHTNESS,max:Fs.MAX_BRIGHTNESS,value:g,onChange:b=>f(b),thumbClassName:"thumb percent",renderThumb:(b,_)=>e.jsx("div",{...b,children:Fs.scaleBrightness(_.valueNow)})})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:p===2,onChange:b=>x(b.target.checked?2:1)}),e.jsx(N,{children:d("widget.dimmer.type.checkbox")})]}),e.jsxs(w,{gap:1,children:[e.jsx(P,{fullWidth:!0,variant:"danger",onClick:()=>Fs.changeState(),children:d("widget.dimmer.button.off")}),e.jsx(P,{fullWidth:!0,variant:"success",onClick:j,children:d("widget.dimmer.button.apply")})]})]})]})]}):null},oO=a=>{const{objectId:t=-1,value:s=0,onClose:n=null,redeem:r=null}=Mv();return t===-1?null:e.jsxs(ie,{className:"nitro-widget-exchange-credit",theme:"primary-slim",children:[e.jsx(re,{headerText:d("catalog.redeem.dialog.title"),onCloseClick:n}),e.jsx(se,{center:!0,children:e.jsxs(w,{overflow:"hidden",gap:2,children:[e.jsx(v,{center:!0,children:e.jsx(A,{className:"exchange-image"})}),e.jsxs(v,{grow:!0,justifyContent:"between",overflow:"hidden",children:[e.jsxs(v,{gap:1,overflow:"auto",children:[e.jsx(N,{fontWeight:"bold",children:d("creditfurni.description",["credits"],[s.toString()])}),e.jsx(N,{children:d("creditfurni.prompt")})]}),e.jsx(P,{variant:"success",onClick:r,children:d("catalog.redeem.dialog.button.exchange")})]})]})})]})},lO=a=>{const{currentIndex:t=-1,currentPhotos:s=null}=a,[n,r]=o.useState(0),i=s&&s.length?s[n]:null,l=()=>{r(h=>{let u=h+1;return u>=s.length&&(u=0),u})},c=()=>{r(h=>{let u=h-1;return u<0&&(u=s.length-1),u})},m=(h,u,g)=>{const f=H().getRoomObject(h,u,X.WALL);if(f)return g=="username"?f.model.getValue(te.FURNITURE_OWNER_NAME):f.model.getValue(te.FURNITURE_OWNER_ID)};return o.useEffect(()=>{r(t)},[t]),i?e.jsxs(ne,{style:{display:"flex",flexDirection:"column"},children:[e.jsx(w,{center:!0,className:"picture-preview border border-black",style:i.w?{backgroundImage:"url("+i.w+")"}:{},children:!i.w&&e.jsx(N,{bold:!0,children:d("camera.loading")})}),i.m&&i.m.length&&e.jsx(N,{center:!0,children:i.m}),e.jsxs(w,{alignItems:"center",justifyContent:"between",children:[e.jsxs(N,{children:[" ",new Date(i.t*1e3).toLocaleDateString(void 0,{day:"numeric",month:"long",year:"numeric"})," "]}),e.jsxs(N,{className:"username",onClick:()=>as(Number(m(i.s,Number(i.u),"id"))),children:[" ",m(i.s,Number(i.u),"username")," "]})]}),s.length>1&&e.jsxs(w,{className:"picture-preview-buttons",children:[e.jsx(km,{className:"cursor-pointer",onClick:c}),e.jsx(Am,{className:"cursor-pointer",onClick:l})]})]}):null},cO=a=>{const{objectId:t=-1,currentPhotoIndex:s=-1,currentPhotos:n=null,onClose:r=null}=Fv(),{report:i=null}=Ws();return t===-1||s===-1?null:e.jsxs(ie,{className:"nitro-external-image-widget",theme:"primary-slim",children:[e.jsx(re,{headerText:d("camera.interface.title"),isGalleryPhoto:!0,onReportPhoto:()=>i(tt.PHOTO,{extraData:n[s].w,roomId:n[s].s,reportedUserId:B().userId,roomObjectId:Number(n[s].u)}),onCloseClick:r}),e.jsx(se,{children:e.jsx(lO,{currentIndex:s,currentPhotos:n})})]})},uO=a=>{const{objectId:t=-1,type:s=0,stage:n=0,usernames:r=[],figures:i=[],date:l=null,onClose:c=null,respond:m=null}=Gv();if(t===-1)return null;if(n>0)return e.jsxs(ie,{className:"nitro-engraving-lock",theme:"primary-slim",children:[e.jsx(re,{headerText:d("friend.furniture.confirm.lock.caption"),onCloseClick:c}),e.jsxs(se,{children:[e.jsx("h5",{className:"text-black text-center fw-bold mt-2 mb-2",children:d("friend.furniture.confirm.lock.subtitle")}),e.jsx("div",{className:"d-flex justify-content-center mb-2",children:e.jsx("div",{className:`engraving-lock-stage-${n}`})}),n===2&&e.jsx("div",{className:"text-small text-black text-center mb-2",children:d("friend.furniture.confirm.lock.other.locked")}),e.jsxs(w,{gap:1,children:[e.jsx(P,{fullWidth:!0,onClick:h=>m(!1),children:d("friend.furniture.confirm.lock.button.cancel")}),e.jsx(P,{fullWidth:!0,variant:"success",onClick:h=>m(!0),children:d("friend.furniture.confirm.lock.button.confirm")})]})]})]});if(r.length>0)return e.jsx(Mr,{handleSelector:".nitro-engraving-lock-view",children:e.jsxs("div",{className:`nitro-engraving-lock-view engraving-lock-${s}`,children:[e.jsx("div",{className:"engraving-lock-close",onClick:c}),e.jsxs(w,{justifyContent:"center",children:[e.jsx("div",{className:"engraving-lock-avatar",children:e.jsx(nt,{figure:i[0],direction:2})}),e.jsx("div",{className:"engraving-lock-avatar",children:e.jsx(nt,{figure:i[1],direction:4})})]}),e.jsxs(v,{justifyContent:"between",className:"mt-1",children:[e.jsxs(v,{alignItems:"center",justifyContent:"center",gap:1,children:[e.jsxs("div",{children:[s===0&&d("lovelock.engraving.caption"),s===3&&d("wildwest.engraving.caption")]}),e.jsx("div",{children:l})]}),e.jsxs(w,{justifyContent:"center",gap:4,children:[e.jsx("div",{children:r[0]}),e.jsx("div",{children:r[1]})]})]})]})})},dO=a=>{const{objectId:t=-1,itemType:s=null,text:n=null,isOwnerOfFurniture:r=!1,senderName:i=null,senderFigure:l=null,placedItemId:c=-1,placedInRoom:m=!1,imageUrl:h=null,openPresent:u=null,onClose:g=null}=s_(),{groupItems:f=[]}=ur();if(t===-1)return null;const p=I=>{const j=f.find(E=>{var C;return((C=E.getItemById(I))==null?void 0:C.id)===I});j&&mi(j),g()},x=I=>{vr(I,s===fe.WALL?X.WALL:X.FLOOR,Bs.OBJECT_PICKUP),g()};return e.jsxs(ie,{className:"nitro-gift-opening",theme:"primary-slim",children:[e.jsx(re,{headerText:d(i?"widget.furni.present.window.title_from":"widget.furni.present.window.title",["name"],[i]),onCloseClick:g}),e.jsxs(se,{children:[c===-1&&e.jsxs(v,{overflow:"hidden",children:[e.jsx(w,{center:!0,overflow:"auto",children:e.jsx(ph,{userName:i,figure:l,message:n})}),r&&e.jsxs(w,{gap:1,children:[i&&e.jsx(P,{fullWidth:!0,onClick:I=>Z("catalog/open"),children:d("widget.furni.present.give_gift",["name"],[i])}),e.jsx(P,{fullWidth:!0,variant:"success",onClick:u,children:d("widget.furni.present.open_gift")})]})]}),c>-1&&e.jsxs(w,{gap:2,overflow:"hidden",children:[e.jsx(v,{center:!0,className:"p-2",children:e.jsx(wn,{imageUrl:h})}),e.jsxs(v,{grow:!0,children:[e.jsxs(v,{center:!0,gap:1,children:[e.jsx(N,{wrap:!0,small:!0,children:d("widget.furni.present.message_opened")}),e.jsx(N,{bold:!0,fontSize:5,children:n})]}),e.jsxs(v,{grow:!0,gap:1,children:[e.jsxs(w,{gap:1,children:[m&&e.jsx(P,{fullWidth:!0,onClick:I=>x(c),children:d("widget.furni.present.put_in_inventory")}),e.jsx(P,{fullWidth:!0,variant:"success",onClick:I=>p(c),children:d(m?"widget.furni.present.keep_in_room":"widget.furni.present.place_in_room")})]}),i&&i.length&&e.jsx(P,{fullWidth:!0,onClick:I=>Z("catalog/open"),children:d("widget.furni.present.give_gift",["name"],[i])})]})]})]})]})]})},mO=a=>{const{stuffDatas:t=null,getScoreType:s=null,getClearType:n=null}=qv();return!t||!t.size?null:e.jsx(e.Fragment,{children:Array.from(t.entries()).map(([r,i],l)=>e.jsx($c,{objectId:r,category:X.FLOOR,children:e.jsxs(v,{className:"nitro-widget-high-score nitro-context-menu",gap:0,children:[e.jsx(rs,{children:d("high.score.display.caption",["scoretype","cleartype"],[d(`high.score.display.scoretype.${s(i.scoreType)}`),d(`high.score.display.cleartype.${n(i.clearType)}`)])}),e.jsxs(Yh,{overflow:"hidden",gap:1,className:"h-100",children:[e.jsxs(v,{gap:1,children:[e.jsxs(w,{alignItems:"center",className:"px-2",children:[e.jsx(N,{bold:!0,variant:"white",className:"col-8",children:d("high.score.display.users.header")}),e.jsx(N,{align:"end",bold:!0,variant:"white",className:"col-4",children:d("high.score.display.score.header")})]}),e.jsx("hr",{className:"m-0"})]}),e.jsx(v,{overflow:"auto",gap:1,className:"px-2 overflow-y-scroll",children:i.entries.map((c,m)=>e.jsxs(w,{alignItems:"center",children:[e.jsx(N,{variant:"white",className:"col-8",children:c.users.join(", ")}),e.jsx(N,{align:"end",variant:"white",className:"col-4",children:c.score})]},m))})]})]})},l))})},hO=a=>($v(),null),gO=-1,Ka=0,Gl=1,Bl=2,Hl=3,Wl=4,fO=a=>{const[t,s]=o.useState(null),[n,r]=o.useState(gO),{objectId:i=-1,figure:l=null,gender:c=null,clubLevel:m=Bt.NO_CLUB,name:h=null,setName:u=null,saveFigure:g=null,wearFigure:f=null,saveName:p=null,onClose:x=null}=Xv();return o.useEffect(()=>{if(i===-1)return;const I=ye();if(I.isRoomOwner||I.controllerLevel>=$e.GUEST||B().isModerator){r(Ka);return}if(B().gender.toLowerCase()!==c.toLowerCase()){r(Wl);return}if(Cs(){switch(n){case Ka:case Wl:{const I=vt().createFigureContainer(l);li.transformAsMannequinFigure(I),s(I.getFigureString());break}case Gl:{const I=vt().createFigureContainer(B().figure);li.transformAsMannequinFigure(I),s(I.getFigureString());break}case Bl:case Hl:{const I=li.getMergedMannequinFigureContainer(B().figure,l);s(I.getFigureString());break}}},[n,l,m]),i===-1?null:e.jsxs(ie,{className:"nitro-mannequin no-resize",theme:"primary-slim",children:[e.jsx(re,{headerText:d("mannequin.widget.title"),onCloseClick:x}),e.jsx(se,{center:!0,children:e.jsxs(w,{fullWidth:!0,gap:2,overflow:"hidden",children:[e.jsx(v,{children:e.jsxs(A,{position:"relative",className:"mannequin-preview",children:[e.jsx(nt,{position:"absolute",figure:t,direction:2}),m>0&&e.jsx(Nt,{className:"position-absolute end-2 bottom-2",type:"hc"})]})}),e.jsxs(v,{grow:!0,justifyContent:"between",overflow:"auto",children:[n===Ka&&e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"text",className:"form-control form-control-sm",value:h,onChange:I=>u(I.target.value),onBlur:p}),e.jsxs(v,{gap:1,children:[e.jsx(P,{variant:"success",onClick:I=>r(Gl),children:d("mannequin.widget.style")}),e.jsx(P,{variant:"success",onClick:f,children:d("mannequin.widget.wear")})]})]}),n===Gl&&e.jsxs(e.Fragment,{children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:h}),e.jsx(N,{wrap:!0,children:d("mannequin.widget.savetext")})]}),e.jsxs(w,{alignItems:"center",justifyContent:"between",children:[e.jsx(N,{underline:!0,pointer:!0,onClick:I=>r(Ka),children:d("mannequin.widget.back")}),e.jsx(P,{variant:"success",onClick:g,children:d("mannequin.widget.save")})]})]}),n===Bl&&e.jsxs(e.Fragment,{children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:h}),e.jsx(N,{children:d("mannequin.widget.weartext")})]}),e.jsx(P,{variant:"success",onClick:f,children:d("mannequin.widget.wear")})]}),n===Hl&&e.jsx(w,{center:!0,grow:!0,children:e.jsx(N,{children:d("mannequin.widget.clubnotification")})}),n===Wl&&e.jsx(N,{children:d("mannequin.widget.wronggender")})]})]})})]})},pO=a=>(i_(),null),Kh=["9CCEFF","FF9CFF","9CFF9C","FFFF33"],xO=["blue","pink","green","yellow"],jO=a=>{let t=Kh.indexOf(a);return t===-1&&(t=0),xO[t]},IO=a=>{const{objectId:t=-1,color:s="0",setColor:n=null,text:r="",setText:i=null,canModify:l=!1,onClose:c=null}=o_();return t===-1?null:e.jsx(Mr,{handleSelector:".drag-handler",windowPosition:Tt.TOP_LEFT,children:e.jsxs("div",{className:"nitro-stickie nitro-stickie-image stickie-"+jO(s),children:[e.jsxs("div",{className:"d-flex align-items-center stickie-header drag-handler",children:[e.jsx("div",{className:"d-flex align-items-center flex-grow-1 h-100",children:l&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"nitro-stickie-image stickie-trash header-trash",onClick:c}),Kh.map(m=>e.jsx("div",{className:"stickie-color ms-1",onClick:h=>n(m),style:{backgroundColor:ms.makeColorHex(m)}},m))]})}),e.jsx("div",{className:"d-flex align-items-center nitro-stickie-image stickie-close header-close",onClick:c})]}),e.jsx("div",{className:"stickie-context",children:e.jsx("textarea",{className:"context-text",value:r,onChange:m=>i(m.target.value),tabIndex:0,autoFocus:!0})})]})})},bO=a=>{const{objectId:t=-1,height:s=0,maxHeight:n=40,onClose:r=null,updateHeight:i=null}=c_(),[l,c]=o.useState(""),m=h=>{c(h);const u=parseFloat(h);isNaN(u)||u===s||i(u)};return o.useEffect(()=>{c(s.toString())},[s]),t===-1?null:e.jsxs(ie,{className:"nitro-widget-custom-stack-height",theme:"primary-slim",children:[e.jsx(re,{headerText:d("widget.custom.stack.height.title"),onCloseClick:r}),e.jsxs(se,{justifyContent:"between",children:[e.jsx(N,{children:d("widget.custom.stack.height.text")}),e.jsxs(w,{gap:2,children:[e.jsx(Lt,{min:0,max:n,step:.01,value:s,onChange:h=>i(h),renderThumb:(h,u)=>e.jsx("div",{...h,children:u.valueNow})}),e.jsx("input",{className:"show-number-arrows",style:{width:50},type:"number",min:0,max:n,value:l,onChange:h=>m(h.target.value)})]}),e.jsxs(v,{gap:1,children:[e.jsx(P,{onClick:h=>D(new $l(t,-100)),children:d("furniture.above.stack")}),e.jsx(P,{onClick:h=>D(new $l(t,0)),children:d("furniture.floor.level")})]})]})]})},Xh=["9CCEFF","FF9CFF","9CFF9C","FFFF33"],EO=["blue","pink","green","yellow"],CO=["post_it","post_it_shakesp","post_it_dreams","post_it_xmas","post_it_vd","post_it_juninas"],NO=["post_it","shakesp","dreams","christmas","heart","juninas"],vO=a=>{let t=Xh.indexOf(a);return t===-1&&(t=0),EO[t]},_O=a=>{let t=CO.indexOf(a);return t===-1&&(t=0),NO[t]},SO=a=>{const{objectId:t=-1,color:s="0",text:n="",type:r="",canModify:i=!1,updateColor:l=null,updateText:c=null,trash:m=null,onClose:h=null}=d_(),[u,g]=o.useState(!1);return o.useEffect(()=>{g(!1)},[t,s,n,r]),t===-1?null:e.jsx(Mr,{handleSelector:".drag-handler",windowPosition:Tt.TOP_LEFT,children:e.jsxs("div",{className:"nitro-stickie nitro-stickie-image stickie-"+(r=="post_it"?vO(s):_O(r)),children:[e.jsxs("div",{className:"d-flex align-items-center stickie-header drag-handler",children:[e.jsx("div",{className:"d-flex align-items-center flex-grow-1 h-100",children:i&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"nitro-stickie-image stickie-trash header-trash",onClick:m}),r=="post_it"&&e.jsx(e.Fragment,{children:Xh.map(f=>e.jsx("div",{className:"stickie-color ms-1",onClick:p=>l(f),style:{backgroundColor:ms.makeColorHex(f)}},f))})]})}),e.jsx("div",{className:"d-flex align-items-center nitro-stickie-image stickie-close header-close",onClick:h})]}),e.jsx("div",{className:"stickie-context",children:!u||!i?e.jsx("div",{className:"context-text",onClick:f=>i&&g(!0),children:n}):e.jsx("textarea",{className:"context-text",defaultValue:n,tabIndex:0,onBlur:f=>c(f.target.value),autoFocus:!0})})]})})},wO=a=>{const{objectId:t=-1,color:s="1",senderName:n="",date:r="",message:i="",onClose:l=null}=h_();return t===-1?null:e.jsx(jh,{color:s,message:i,date:r,senderName:n,onCloseClick:l})},TO=a=>{const[t,s]=o.useState(null),{objectId:n=-1,videoId:r=null,videoStart:i=0,videoEnd:l=0,currentVideoState:c=null,selectedVideo:m=null,playlists:h=[],onClose:u=null,previous:g=null,next:f=null,pause:p=null,play:x=null,selectVideo:I=null}=I_(),j=C=>{if(s(C.target),n!==-1)switch(C.target.getPlayerState()){case-1:case 1:c!==1&&x();return;case 2:c!==2&&p()}};if(o.useEffect(()=>{if(!(c===null||!t)){if(c===rr.PLAYING&&t.getPlayerState()!==rr.PLAYING){t.playVideo();return}if(c===rr.PAUSED&&t.getPlayerState()!==rr.PAUSED){t.pauseVideo();return}}},[c,t]),n===-1)return null;const E={height:"375",width:"500",playerVars:{autoplay:1,disablekb:1,controls:0,origin:window.origin,modestbranding:1,start:i,end:l}};return e.jsxs(ie,{className:"youtube-tv-widget",children:[e.jsx(re,{headerText:d("catalog.page.youtube_tvs"),onCloseClick:u}),e.jsx(se,{children:e.jsxs("div",{className:"row w-100 h-100",children:[e.jsxs("div",{className:"youtube-video-container col-9 overflow-hidden",children:[r&&r.length>0&&e.jsx(qE,{videoId:r,opts:E,onReady:C=>s(C.target),onStateChange:j,containerClassName:"youtubeContainer"}),(!r||r.length===0)&&e.jsx("div",{className:"empty-video w-100 h-100 justify-content-center align-items-center d-flex",children:d("widget.furni.video_viewer.no_videos")})]}),e.jsxs("div",{className:"playlist-container col-3 d-flex flex-column",children:[e.jsxs("span",{className:"playlist-controls justify-content-center d-flex",children:[e.jsx("i",{className:"icon icon-youtube-prev cursor-pointer",onClick:g}),e.jsx("i",{className:"icon icon-youtube-next cursor-pointer",onClick:f})]}),e.jsx("div",{className:"mb-1",children:d("widget.furni.video_viewer.playlists")}),e.jsx(Pe,{columnCount:1,columnMinWidth:80,columnMinHeight:100,className:"mb-1",overflow:"auto",children:h&&h.map((C,b)=>e.jsx(Ce,{onClick:_=>I(C.video),itemActive:C.video===m,children:e.jsx("b",{children:C.title})},b))})]})]})})]})},yO=a=>{const{diskInventory:t=null,addToPlaylist:s=null}=a,[n,r]=o.useState(-1),[i,l]=o.useState(-1),c=o.useCallback((u,g)=>{u.stopPropagation(),l(f=>f===g?-1:g)},[]),m=o.useCallback((u,g)=>{var f,p;u.stopPropagation(),s(g,(p=(f=Ie().soundManager.musicController)==null?void 0:f.getRoomItemPlaylist())==null?void 0:p.length)},[s]),h=()=>{Z("catalog/open/"+oo.TRAX_SONGS)};return o.useEffect(()=>{var u;if(i!==-1)return(u=Ie().soundManager.musicController)==null||u.playSong(i,_i.PRIORITY_SONG_PLAY,0,0,0,0),()=>{var g;(g=Ie().soundManager.musicController)==null||g.stop(_i.PRIORITY_SONG_PLAY)}},[i]),o.useEffect(()=>()=>l(-1),[]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"bg-success py-3 container-fluid justify-content-center d-flex rounded",children:[e.jsx("img",{src:K("image.library.url")+"playlist/title_mymusic.gif",className:"my-music"}),e.jsx("h2",{className:"ms-4",children:d("playlist.editor.my.music")})]}),e.jsx("div",{className:"h-100 overflow-y-scroll mt-4 py-2",children:e.jsx(Pe,{columnCount:3,columnMinWidth:95,gap:1,children:t&&t.getKeys().map((u,g)=>{var I;const f=t.getKey(g),p=t.getWithIndex(g),x=(I=Ie().soundManager.musicController)==null?void 0:I.getSongInfo(p);return e.jsxs(Ce,{itemActive:n===g,onClick:()=>r(j=>j===g?-1:g),classNames:["text-black"],children:[e.jsx("div",{className:"disk-image flex-shrink-0 mb-n2",style:{backgroundColor:hh(x==null?void 0:x.songData)}}),e.jsx(N,{truncate:!0,fullWidth:!0,className:"text-center",children:x==null?void 0:x.name}),n===g&&e.jsxs(w,{position:"absolute",className:"bottom-0 mb-1 bg-secondary p-1 rounded",alignItems:"center",justifyContent:"center",gap:2,children:[e.jsx(P,{onClick:j=>c(j,p),variant:"light",children:e.jsx(A,{className:i===p?"pause-btn":"preview-song"})}),e.jsx(P,{onClick:j=>m(j,f),variant:"light",children:e.jsx(A,{className:"move-disk"})})]})]},g)})})}),e.jsxs("div",{className:"playlist-bottom text-black p-1",children:[e.jsx("h5",{children:d("playlist.editor.text.get.more.music")}),e.jsx("div",{children:d("playlist.editor.text.you.have.no.songdisks.available")}),e.jsx("div",{children:d("playlist.editor.text.you.can.buy.some.from.the.catalogue")}),e.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>h(),children:d("playlist.editor.button.open.catalogue")})]}),e.jsx("img",{src:K("image.library.url")+"playlist/background_get_more_music.gif",className:"get-more"})]})},RO=a=>{var u,g;const{furniId:t=-1,playlist:s=null,currentPlayingIndex:n=-1,removeFromPlaylist:r=null,togglePlayPause:i=null}=a,[l,c]=o.useState(-1),m=f=>{l===f&&r(f)},h=(f,p)=>{i(f,p!==-1?p:0)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"bg-primary py-3 container-fluid justify-content-center d-flex rounded",children:[e.jsx("img",{src:K("image.library.url")+"playlist/title_playlist.gif",className:"playlist-img"}),e.jsx("h2",{className:"ms-4",children:d("playlist.editor.playlist")})]}),e.jsx("div",{className:"h-100 overflow-y-scroll py-2",children:e.jsx(w,{column:!0,gap:2,children:s&&s.map((f,p)=>e.jsxs(w,{gap:1,className:"text-black cursor-pointer "+(l===p?"border border-muted border-2 rounded":"border-2"),alignItems:"center",onClick:()=>c(x=>x===p?-1:p),children:[e.jsx(A,{onClick:()=>m(p),className:"disk-2 "+(l===p?"selected-song":""),style:{backgroundColor:l===p?"":hh(f.songData)}}),f.name]},p))})}),(!s||s.length===0)&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"playlist-bottom text-black p-1 ms-5",children:[e.jsx("h5",{children:d("playlist.editor.add.songs.to.your.playlist")}),e.jsx("div",{children:d("playlist.editor.text.click.song.to.choose.click.again.to.move")})]}),e.jsx("img",{src:K("image.library.url")+"playlist/background_add_songs.gif",className:"add-songs"})]}),s&&s.length>0&&e.jsxs(e.Fragment,{children:[n===-1&&e.jsx(P,{variant:"success",size:"lg",onClick:()=>h(t,l),children:d("playlist.editor.button.play.now")}),n!==-1&&e.jsxs(w,{gap:1,children:[e.jsx(P,{variant:"danger",onClick:()=>h(t,l),children:e.jsx(A,{className:"pause-song"})}),e.jsxs(w,{column:!0,children:[e.jsx(N,{bold:!0,display:"block",children:d("playlist.editor.text.now.playing.in.your.room")}),e.jsx(N,{children:((u=s[n])==null?void 0:u.name)+" - "+((g=s[n])==null?void 0:g.creator)})]})]})]})]})},OO=a=>{const{objectId:t=-1,currentPlayingIndex:s=-1,playlist:n=null,diskInventory:r=null,onClose:i=null,togglePlayPause:l=null,removeFromPlaylist:c=null,addToPlaylist:m=null}=Jv();return t===-1?null:e.jsxs(ie,{className:"nitro-playlist-editor-widget",theme:"primary-slim",children:[e.jsx(re,{headerText:d("playlist.editor.title"),onCloseClick:i}),e.jsx(se,{children:e.jsxs("div",{className:"d-flex flex-row gap-1 h-100",children:[e.jsx("div",{className:"w-50 position-relative overflow-hidden h-100 rounded d-flex flex-column",children:e.jsx(yO,{addToPlaylist:m,diskInventory:r})}),e.jsx("div",{className:"w-50 position-relative overflow-hidden h-100 rounded d-flex flex-column",children:e.jsx(RO,{furniId:t,removeFromPlaylist:c,playlist:n,togglePlayPause:l,currentPlayingIndex:s})})]})})]})},kO=a=>e.jsxs(A,{fit:!0,position:"absolute",className:"nitro-room-widgets top-0 start-0",children:[e.jsx(nO,{}),e.jsx(rO,{}),e.jsx(iO,{}),e.jsx(aO,{}),e.jsx(oO,{}),e.jsx(cO,{}),e.jsx(uO,{}),e.jsx(dO,{}),e.jsx(mO,{}),e.jsx(hO,{}),e.jsx(fO,{}),e.jsx(OO,{}),e.jsx(pO,{}),e.jsx(IO,{}),e.jsx(bO,{}),e.jsx(SO,{}),e.jsx(wO,{}),e.jsx(sO,{}),e.jsx(TO,{})]}),AO=a=>{const{isVisible:t=!1,errorResult:s=null,petName:n=null,objectType:r=null,onChangePetName:i=null,onConfirm:l=null,onClose:c=null}=L_();return e.jsx(e.Fragment,{children:t&&e.jsxs(ie,{className:"nitro-pet-package no-resize",theme:"primary-slim",children:[e.jsx(re,{center:!0,headerText:d(r==="gnome_box"?"widgets.gnomepackage.name.title":"furni.petpackage.open"),onCloseClick:()=>c()}),e.jsxs(se,{children:[e.jsxs(w,{className:"pet-package-container-top p-3",children:[e.jsx("div",{className:`package-image-${r} flex-shrink-0`}),e.jsx("div",{className:"m-2",children:e.jsx(N,{variant:"white",className:"package-text-big",children:d(r==="gnome_box"?"widgets.gnomepackage.name.title":"furni.petpackage")})})]}),e.jsx(w,{className:"pet-package-container-bottom p-2",children:e.jsxs(v,{gap:1,children:[e.jsxs(w,{alignItems:"center",className:"bg-white rounded py-1 px-2 input-pet-package-container",children:[e.jsx("input",{type:"text",className:"form-control form-control-sm input-pet-package",maxLength:K("pet.package.name.max.length"),placeholder:d(r==="gnome_box"?"widgets.gnomepackage.name.select":"widgets.petpackage.name.title"),value:n,onChange:m=>i(m.target.value)}),e.jsx("div",{className:"package-pencil-image flex-shrink-0 small fa-icon"})]}),s.length>0&&e.jsx(A,{className:"invalid-feedback d-block m-0",children:s}),e.jsxs(w,{className:"mt-2",gap:5,display:"flex",justifyContent:"center",alignItems:"center",children:[e.jsx(N,{pointer:!0,className:"text-decoration",onClick:()=>c(),children:d("cancel")}),e.jsx(zE,{variant:n.length<3?"danger":"success",disabled:n.length<3,onClick:()=>l(),children:d(r==="gnome_box"?"widgets.gnomepackage.name.pick":"furni.petpackage.confirm")})]})]})})]})]})})},DO=a=>{const[t,s]=o.useState("bobba"),[n,r]=o.useState(""),[i,l]=o.useState(!1),{wordsFilter:c=[],isVisible:m=null,setWordsFilter:h,onClose:u=null}=R_(),{navigatorData:g=null}=qs(),f=I=>{(i?!n:!t)||(D(new YE(g.enteredGuestRoom.roomId,I,i?n:t)),r(""),s("bobba"),l(!1),!(I&&c.includes(i?n:t))&&h(j=>{const E=[...j];return I?E.push(i?n:t):E.splice(E.indexOf(i?n:t),1),E}))},p=I=>{s(I),l(!1)},x=I=>{r(I),l(!0)};return m?e.jsxs(ie,{className:"nitro-guide-tool no-resize",theme:"primary-slim",children:[e.jsx(re,{headerText:d("navigator.roomsettings.roomfilter"),onCloseClick:()=>u()}),e.jsxs(se,{className:"text-black",children:[e.jsxs(ne,{className:"d-flex align-items-center justify-content-end gap-2",children:[e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:255,value:t,onChange:I=>p(I.target.value)}),e.jsx(P,{onClick:()=>f(!0),children:d("navigator.roomsettings.roomfilter.addword")})]}),e.jsx(v,{overflow:"auto",gap:0,className:"form-control form-control-sm",style:{height:"100px"},children:c&&c.length>0&&c.map((I,j)=>e.jsx(w,{alignItems:"center",className:zt("rounded p-1",n===I&&"bg-muted"),pointer:!0,onClick:E=>x(I),children:e.jsx(N,{truncate:!0,children:I})},j))}),e.jsx(ne,{className:"d-flex align-items-center justify-content-end gap-2",children:e.jsx(P,{variant:"danger",onClick:()=>f(!1),disabled:c.length===0||!i,children:d("navigator.roomsettings.roomfilter.removeword")})})]})]}):null},PO=a=>{const[t,s]=o.useState(!1),{roomSession:n=null}=ke();ot([gn.SHOW_THUMBNAIL,gn.HIDE_THUMBNAIL,gn.TOGGLE_THUMBNAIL],i=>{switch(i.type){case gn.SHOW_THUMBNAIL:s(!0);return;case gn.HIDE_THUMBNAIL:s(!1);return;case gn.TOGGLE_THUMBNAIL:s(l=>!l);return}});const r=i=>{H().saveTextureAsScreenshot(i,!0),s(!1)};return t?e.jsx(LN,{roomId:n.roomId,textureReceiver:r,onClose:()=>s(!1)}):null},LO=a=>{var L,k,R,y;const[t,s]=o.useState(!1),[n,r]=o.useState(!1),[i,l]=o.useState(null),[c,m]=o.useState(null),[h,u]=o.useState(null),[g,f]=o.useState(!1),[p,x]=o.useState(!1),[I,j]=o.useState(!0),[E,C]=o.useState([]),{navigatorData:b=null}=qs(),{roomSession:_=null}=ke();o.useEffect(()=>{i||l(d("landing.view.generic.welcome.first_login"))},[i]);const S=(O,F)=>{switch(O){case"settings":Z("navigator/toggle-room-info");return;case"zoom":r(U=>{let J=H().getRoomInstanceRenderingCanvasScale(_.roomId,1);return U?J*=2:J/=2,H().setRoomInstanceRenderingCanvasScale(_.roomId,1,J),!U});return;case"chat_history":Z("chat-history/toggle");return;case"hiddenbubbles":Z("nitrobubblehidden/toggle");const V=document.getElementById("bubble");V&&V.classList.toggle("icon-chat-disablebubble");const Y=document.getElementById("hiddenbubblesText");if(Y){const U=d(t?"room.unmute.button.text":"room.mute.button.text");Y.innerText=U}s(!t);const q=document.getElementById("bubbleIcon");q&&q.classList.toggle("icon-chat-disablebubble");return;case"like_room":D(new $E(1));return;case"toggle_room_link":Z("navigator/toggle-room-link");return;case"navigator_search_tag":Z(`navigator/search/${F}`),D(new Tr("hotel_view",`tag:${F}`));return;case"room_history":E.length>0&&x(U=>!U);return;case"room_history_back":is(E[E.findIndex(U=>U.roomId===b.currentRoomId)-1].roomId);return;case"room_history_next":is(E[E.findIndex(U=>U.roomId===b.currentRoomId)+1].roomId);return}},T=(O,F)=>{let V=JSON.parse(window.localStorage.getItem("nitro.room.history"));if(V&&V.filter(q=>q.roomId===O).length>0)return;V&&V.length>=10&&V.shift();const Y=V?[...V,{roomId:O,roomName:F}]:[{roomId:O,roomName:F}];return C(Y),Oc("nitro.room.history",Y)};return M(gi,O=>{const F=O.getParser();!F.roomEnter||F.data.roomId!==_.roomId||(i!==F.data.roomName&&l(F.data.roomName),c!==F.data.ownerName&&m(F.data.ownerName),h!==F.data.tags&&u(F.data.tags),T(F.data.roomId,F.data.roomName))}),o.useEffect(()=>{const O=()=>{JSON.parse(window.localStorage.getItem("nitro.room.history"))&&window.localStorage.removeItem("nitro.room.history")};return window.addEventListener("beforeunload",O),()=>window.removeEventListener("beforeunload",O)},[]),o.useEffect(()=>{f(!0);const O=setTimeout(()=>f(!1),5e3);return()=>clearTimeout(O)},[i,c,h,I]),o.useEffect(()=>{C(JSON.parse(window.localStorage.getItem("nitro.room.history"))??[])},[]),e.jsxs(w,{className:"nitro-room-tools-container",gap:2,children:[e.jsx("div",{className:"btn-toggle toggle-roomtool d-flex align-items-center",onClick:()=>j(!I),children:e.jsx("div",{className:"toggle-icon "+(I?"left":"right")})}),I&&e.jsxs(e.Fragment,{children:[e.jsxs(v,{gap:0,center:!0,className:"nitro-room-tools p-3 px-3",children:[e.jsxs(w,{children:[e.jsxs(v,{center:!0,className:"margin-icons p-2 gap-2",children:[e.jsx(A,{pointer:!0,title:d("room.settings.button.text"),className:"icon icon-cog",onClick:()=>S("settings")}),e.jsx(A,{pointer:!0,title:d("room.zoom.button.text"),onClick:()=>S("zoom"),className:zt("icon",!n&&"icon-zoom-less",n&&"icon-zoom-more")}),e.jsx(A,{pointer:!0,title:d("room.chathistory.button.text"),onClick:()=>S("chat_history"),className:"icon icon-chat-history"}),b.canRate&&e.jsx(A,{pointer:!0,title:d("room.like.button.text"),onClick:()=>S("like_room"),className:"icon icon-like-room"}),e.jsx(A,{pointer:!0,onClick:()=>S("toggle_room_link"),className:"icon icon-room-link"}),e.jsx(A,{pointer:!0,onClick:()=>S("hiddenbubbles"),className:`icon ${t?"icon-chat-disablebubble":"icon-chat-enablebubble"}`})]}),e.jsxs(v,{className:"d-flex flex-column",children:[e.jsx(w,{className:"w-100 room-tool-item",children:e.jsx(N,{variant:"muted",underline:!0,small:!0,onClick:()=>S("settings"),children:d("room.settings.button.text")})}),e.jsx(w,{className:"w-100 room-tool-item",children:e.jsx(N,{variant:"muted",underline:!0,small:!0,onClick:()=>S("zoom"),children:d("room.zoom.button.text")})}),e.jsx(w,{className:"w-100 room-tool-item",children:e.jsx(N,{variant:"muted",underline:!0,small:!0,onClick:()=>S("chat_history"),children:d("room.chathistory.button.text")})}),b.canRate&&e.jsx(w,{className:"w-100 room-tool-item",children:e.jsx(N,{variant:"muted",underline:!0,small:!0,onClick:()=>S("like_room"),children:d("room.like.button.text")})}),e.jsx(w,{className:"w-100 room-tool-item",children:e.jsx(N,{variant:"muted",underline:!0,small:!0,onClick:()=>S("toggle_room_link"),children:d("navigator.embed.caption")})}),e.jsx(w,{className:"w-100 room-tool-item",children:e.jsxs(N,{variant:"muted",underline:!0,small:!0,onClick:()=>S("hiddenbubbles"),children:[" ",d(t?"room.unmute.button.text":"room.mute.button.text")]})})]})]}),e.jsxs(w,{justifyContent:"center",children:[e.jsx(A,{pointer:E.length>1&&((L=E[0])==null?void 0:L.roomId)!==b.currentRoomId,title:d("room.history.button.back.tooltip"),className:`icon ${(E==null?void 0:E.length)===0||((k=E[0])==null?void 0:k.roomId)===b.currentRoomId?"icon-room-history-back-disabled":"icon-room-history-back-enabled"}`,onClick:()=>{var O;return(E==null?void 0:E.length)===0||((O=E[0])==null?void 0:O.roomId)===b.currentRoomId?null:S("room_history_back")}}),e.jsx(A,{pointer:(E==null?void 0:E.length)>0,title:d("room.history.button.tooltip"),className:`icon ${(E==null?void 0:E.length)===0?"icon-room-history-disabled":"icon-room-history-enabled"} margin-button-history`,onClick:()=>(E==null?void 0:E.length)===0?null:S("room_history")}),e.jsx(A,{pointer:E.length>1&&((R=E[E.length-1])==null?void 0:R.roomId)!==b.currentRoomId,title:d("room.history.button.forward.tooltip"),className:`icon ${(E==null?void 0:E.length)===0||((y=E[E.length-1])==null?void 0:y.roomId)===b.currentRoomId?"icon-room-history-next-disabled":"icon-room-history-next-enabled"}`,onClick:()=>{var O;return(E==null?void 0:E.length)===0||((O=E[E.length-1])==null?void 0:O.roomId)===b.currentRoomId?null:S("room_history_next")}})]})]}),e.jsxs(w,{className:"nitro-room-tools-side-container",children:[e.jsx(ar,{children:p&&e.jsx(or.div,{initial:{x:-400},animate:{x:0},exit:{x:-400},children:e.jsx(v,{center:!0,children:e.jsx(v,{className:"px-3 py-2 rounded nitro-room-history",children:e.jsx(v,{gap:1,children:E.length>0&&E.map(O=>e.jsx(N,{bold:O.roomId===b.currentRoomId,variant:O.roomId===b.currentRoomId?"white":"muted",pointer:!0,onClick:()=>is(O.roomId),children:O.roomName},O.roomId))})})})})}),e.jsx(ar,{children:g&&e.jsx(or.div,{initial:{x:-400},animate:{x:0},exit:{x:-400},children:e.jsx(v,{center:!0,children:e.jsxs(v,{className:"px-3 py-2 rounded nitro-room-tools-info",overflow:"hidden",children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{wrap:!0,variant:"white",fontSize:4,truncate:!0,children:i}),e.jsx(N,{variant:"muted",fontSize:5,truncate:!0,children:c})]}),h&&h.length>0?e.jsx(w,{gap:2,children:h.map((O,F)=>e.jsxs(N,{small:!0,pointer:!0,truncate:!0,variant:"white",className:"rounded bg-primary p-1",onClick:()=>S("navigator_search_tag",O),children:["#",O]},F))}):e.jsx(N,{variant:"muted",children:d("navigator.notagsfound")})]})})})})]})]})]})},MO=a=>{const{question:t=null,canVote:s=null,vote:n=null,noVotes:r=null,yesVotes:i=null}=a;return e.jsxs(v,{gap:2,className:"wordquiz-question p-2",children:[!s&&e.jsxs(w,{fullWidth:!0,alignItems:"center",gap:2,children:[e.jsx(w,{center:!0,pointer:!0,className:"bg-danger rounded p-2",children:e.jsx(N,{variant:"white",children:r})}),e.jsx(N,{variant:"white",center:!0,textBreak:!0,children:t}),e.jsx(w,{center:!0,pointer:!0,className:"bg-success rounded p-2",children:e.jsx(N,{variant:"white",children:i})})]}),s&&e.jsxs(v,{children:[e.jsx(N,{variant:"white",center:!0,textBreak:!0,children:t}),e.jsxs(w,{fullWidth:!0,justifyContent:"center",gap:1,children:[e.jsx(w,{center:!0,pointer:!0,className:"bg-danger rounded p-1",onClick:l=>n(fo),children:e.jsx(A,{className:"word-quiz-dislike"})}),e.jsx(w,{center:!0,pointer:!0,className:"bg-success rounded p-1",onClick:l=>n(gh),children:e.jsx(A,{className:"word-quiz-like"})})]})]})]})},UO=a=>{const{userIndex:t=null,vote:s=null,...n}=a;return e.jsx($c,{objectId:t,category:X.UNIT,...n,children:e.jsx(w,{center:!0,pointer:!0,className:`bg-${s===fo?"danger":"success"} rounded p-1`,children:e.jsx(A,{className:`word-quiz-${s===fo?"dislike":"like"}-sm`})})})},FO=a=>{const{question:t=null,answerSent:s=!1,answerCounts:n=null,userAnswers:r=null,vote:i=null}=H_();return e.jsxs(e.Fragment,{children:[t&&e.jsx(MO,{question:t.content,canVote:!s,vote:i,noVotes:n.get(fo)||0,yesVotes:n.get(gh)||0}),r&&Array.from(r.entries()).map(([l,c],m)=>e.jsx(UO,{userIndex:l,vote:c.value},m))]})},VO=a=>{const{roomSession:t=null}=ke(),{simpleAlert:s=null}=Fe();return ve(vi.ROOM_ZOOM,n=>H().setRoomInstanceRenderingCanvasScale(n.roomId,1,n.level,null,null,!1,n.asDelta)),ve([Se.REQUEST_TEASER,Se.REQUEST_ECOTRONBOX,Se.REQUEST_CLOTHING_CHANGE,Se.REQUEST_PLAYLIST_EDITOR,Se.OPEN_WIDGET,Se.CLOSE_WIDGET,Sa.FURNI_CLICK,Sa.FURNI_DOUBLE_CLICK,Sa.TOOLTIP_SHOW,Sa.TOOLTIP_HIDE],n=>{if(t)switch(n.objectId,n.category,n.type){}}),He([xt.RSEME_KICKED,xt.RSEME_PETS_FORBIDDEN_IN_HOTEL,xt.RSEME_PETS_FORBIDDEN_IN_FLAT,xt.RSEME_MAX_PETS,xt.RSEME_MAX_NUMBER_OF_OWN_PETS,xt.RSEME_NO_FREE_TILES_FOR_PET,xt.RSEME_SELECTED_TILE_NOT_FREE_FOR_PET,xt.RSEME_BOTS_FORBIDDEN_IN_HOTEL,xt.RSEME_BOTS_FORBIDDEN_IN_FLAT,xt.RSEME_BOT_LIMIT_REACHED,xt.RSEME_SELECTED_TILE_NOT_FREE_FOR_BOT,xt.RSEME_BOT_NAME_NOT_ACCEPTED],n=>{let r=d("error.title"),i="";switch(n.type){case xt.RSEME_MAX_PETS:i=d("room.error.max_pets");break;case xt.RSEME_MAX_NUMBER_OF_OWN_PETS:i=d("room.error.max_own_pets");break;case xt.RSEME_KICKED:i=d("room.error.kicked"),r=d("generic.alert.title");break;case xt.RSEME_PETS_FORBIDDEN_IN_HOTEL:i=d("room.error.pets.forbidden_in_hotel");break;case xt.RSEME_PETS_FORBIDDEN_IN_FLAT:i=d("room.error.pets.forbidden_in_flat");break;case xt.RSEME_NO_FREE_TILES_FOR_PET:i=d("room.error.pets.no_free_tiles");break;case xt.RSEME_SELECTED_TILE_NOT_FREE_FOR_PET:i=d("room.error.pets.selected_tile_not_free");break;case xt.RSEME_BOTS_FORBIDDEN_IN_HOTEL:i=d("room.error.bots.forbidden_in_hotel");break;case xt.RSEME_BOTS_FORBIDDEN_IN_FLAT:i=d("room.error.bots.forbidden_in_flat");break;case xt.RSEME_BOT_LIMIT_REACHED:i=d("room.error.max_bots");break;case xt.RSEME_SELECTED_TILE_NOT_FREE_FOR_BOT:i=d("room.error.bots.selected_tile_not_free");break;case xt.RSEME_BOT_NAME_NOT_ACCEPTED:i=d("room.error.bots.name.not.accepted");break;default:return}s(i,pe.DEFAULT,null,null,r)}),e.jsxs(e.Fragment,{children:[e.jsx(DR,{}),e.jsx(BR,{}),e.jsx(UR,{}),e.jsx(qR,{}),e.jsx(kO,{}),e.jsx(LO,{}),e.jsx(DO,{}),e.jsx(PO,{}),e.jsx(HR,{}),e.jsx(AO,{}),e.jsx(WR,{}),e.jsx(FO,{}),e.jsx(YR,{})]})},GO=a=>{const{roomSession:t=null}=ke(),s=o.useRef();return o.useEffect(()=>{if(!t)return;const n=Ie().application.renderer.view;if(!n)return;n.onclick=i=>Ra(i),n.onmousemove=i=>Ra(i),n.onmousedown=i=>Ra(i),n.onmouseup=i=>Ra(i),n.ontouchstart=i=>Aa(i),n.ontouchmove=i=>Aa(i),n.ontouchend=i=>Aa(i),n.ontouchcancel=i=>Aa(i);const r=s.current;r&&r.appendChild(n)},[t]),e.jsx(ar,{children:e.jsx(or.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:e.jsx("div",{ref:s,className:"w-100 h-100",children:t instanceof KE&&e.jsxs(e.Fragment,{children:[e.jsx(VO,{}),t.isSpectator&&e.jsx(lR,{})]})})})})},BO=a=>{const{useGuideTool:t=!1,unseenAchievementCount:s=0,setMeExpanded:n=null,children:r=null,...i}=a,l=o.useRef();o.useEffect(()=>{const m=ye();m&&H().selectRoomObject(m.roomId,m.ownRoomIndex,X.UNIT)},[]),o.useEffect(()=>{const m=h=>{l.current&&!l.current.contains(h.target)&&n(!1)};return document.addEventListener("click",m),()=>document.removeEventListener("click",m)},[n]);const c=m=>{m.stopPropagation()};return e.jsxs(w,{innerRef:l,alignItems:"center",className:"nitro-toolbar-me p-2",gap:2,onClick:c,children:[K("guides.enabled")&&t&&e.jsx(A,{pointer:!0,className:"navigation-item icon icon-me-helper-tool click-box",onClick:m=>Ct(new xs(xs.TOGGLE_GUIDE_TOOL))}),e.jsx(A,{pointer:!0,className:"navigation-item icon icon-me-achievements click-box",onClick:m=>Z("achievements/toggle"),children:s>0&&e.jsx(En,{className:"text-black",count:s})}),e.jsx(A,{pointer:!0,className:"navigation-item icon icon-me-profile click-box",onClick:m=>as(GetSessionDataManager().userId)}),e.jsx(A,{pointer:!0,className:"navigation-item icon icon-me-rooms click-box",onClick:m=>Z("navigator/search/myworld_view")}),e.jsx(A,{pointer:!0,className:"navigation-item icon icon-me-clothing click-box",onClick:m=>Z("avatar-editor/toggle")}),e.jsx(A,{pointer:!0,className:"navigation-item icon icon-me-settings click-box",onClick:m=>Z("user-settings/toggle")}),r]})},HO=a=>{const{isInRoom:t}=a,[s,n]=o.useState(!1),[r,i]=o.useState(!1),{userFigure:l=null}=zn(),{getFullCount:c=0}=Os(),{getTotalUnseen:m=0}=el(),{requests:h=[]}=hs(),{iconState:u=jn.HIDDEN}=Nh(),g=B().isModerator;M(Mm,p=>{const x=p.getParser();i(x.isAllowed(Lm.USE_GUIDE_TOOL))}),ve(tC.ANIMATE_ICON,p=>{((I,j,E,C)=>{const b=document.body.getElementsByClassName(I)[0];if(!b)return;j.className="toolbar-icon-animation",j.style.visibility="visible",j.style.left=E+"px",j.style.top=C+"px",document.body.append(j);const _=b.getBoundingClientRect(),S=j.getBoundingClientRect(),T=S.x-_.x,L=S.y-_.y,k=Math.sqrt(T*T+L*L),R=500-Math.abs(1/k*100*500*.5),y=20,O=`ToolbarBouncing[${I}]`;jl.getMotionByTag(O)||(jl.runMotion(new Eu(new XE(R+8),new QE(b,400,12))).tag=O);const F=new Eu(new JE(new ZE(j,R,_.x-S.x+y,_.y-S.y,100,1),1),new eC(j));jl.runMotion(F)})("icon-inventory",p.image,p.x,p.y)});const f=p=>{p.stopPropagation(),n(x=>!x)};return e.jsxs(e.Fragment,{children:[e.jsx(ar,{children:s&&e.jsx(or.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"nitro-toolbar-me",children:e.jsx(BO,{useGuideTool:r,unseenAchievementCount:m,setMeExpanded:n})})}),e.jsxs(w,{alignItems:"center",justifyContent:"between",gap:2,className:"nitro-toolbar py-1 px-3",children:[e.jsxs(w,{gap:2,alignItems:"center",className:"widthsizemax",children:[e.jsxs(w,{alignItems:"center",gap:2,children:[e.jsxs(w,{center:!0,pointer:!0,className:"navigation-item item-avatar "+(s?"active ":""),onClick:f,children:[e.jsx(nt,{figure:l,headOnly:!0,direction:2,position:"absolute"}),m>0&&e.jsx(En,{className:"text-black",count:m})]}),t&&e.jsx(A,{pointer:!0,className:"navigation-item icon icon-habbo click-box",onClick:p=>_c()}),!t&&e.jsx(A,{pointer:!0,className:"navigation-item icon icon-house click-box",onClick:p=>Z("navigator/goto/home")}),e.jsx(A,{pointer:!0,className:"navigation-item icon icon-rooms click-box",onClick:p=>Z("navigator/toggle")}),K("game.center.enabled")&&e.jsx(A,{pointer:!0,className:"navigation-item icon icon-game click-box",onClick:p=>Z("games/toggle")}),e.jsx(A,{pointer:!0,className:"navigation-item icon icon-catalog click-box",onClick:p=>Z("catalog/toggle")}),e.jsx(A,{pointer:!0,className:"navigation-item icon icon-inventory click-box",onClick:p=>Z("inventory/toggle"),children:c>0&&e.jsx(En,{className:"text-black",count:c})}),t&&e.jsx(A,{pointer:!0,className:"navigation-item icon icon-camera click-box",onClick:p=>Z("camera/toggle")}),g&&e.jsx(A,{pointer:!0,className:"navigation-item icon icon-modtools click-box",onClick:p=>Z("mod-tools/toggle")})]}),e.jsx(w,{alignItems:"center",id:"toolbar-chat-input-container"})]}),e.jsxs(w,{alignItems:"center",gap:2,children:[e.jsxs(w,{gap:2,children:[e.jsx(A,{pointer:!0,className:"navigation-item icon icon-friendall click-box friendsmovilgen",onClick:p=>Z("friends/toggle"),children:h.length>0&&e.jsx(En,{className:"text-black",count:h.length})}),(u===jn.SHOW||u===jn.UNREAD)&&e.jsx(A,{pointer:!0,className:`navigation-item icon icon-message click-box mensajesmovilgen ${u===jn.UNREAD&&"is-unseen"}`,onClick:p=>Xo()})]}),e.jsx(A,{id:"toolbar-friend-bar-container",className:"d-none d-lg-block"})]})]})]})},WO=a=>{const{badges:t=null,gap:s=1,justifyContent:n="between",...r}=a;return e.jsx(e.Fragment,{children:t&&t.length>0&&t.map((i,l)=>e.jsx(v,{center:!0,children:e.jsx(mt,{badgeCode:i},i)},i))})},qO=a=>{const{relationships:t=null}=a,s=({type:n})=>{const r=t&&t.relationshipStatusMap.hasKey(n)?t.relationshipStatusMap.getValue(n):null,i=Js.RELATIONSHIP_NAMES[n].toLocaleLowerCase();return e.jsxs(w,{fullWidth:!0,gap:1,children:[e.jsx(w,{center:!0,className:"user-relationship",children:e.jsx("i",{className:`nitro-friends-spritesheet icon-${i}`})}),e.jsxs(v,{grow:!0,gap:0,children:[e.jsxs(w,{alignItems:"center",justifyContent:"between",className:"bg-white rounded px-2 py-1 user-relationship",children:[e.jsxs(N,{small:!0,underline:!0,pointer:!0,onClick:l=>r&&r.randomFriendId>=1&&as(r.randomFriendId),children:[(!r||r.friendCount===0)&&d("extendedprofile.add.friends"),r&&r.friendCount>=1&&r.randomFriendName]}),r&&r.friendCount>=1&&e.jsx(w,{center:!0,position:"relative",className:"avatar-image-container",children:e.jsx(nt,{figure:r.randomFriendFigure,headOnly:!0,direction:4})})]}),e.jsxs(N,{small:!0,italics:!0,className:"user-relationship-count",children:[(!r||r.friendCount===0)&&d("extendedprofile.no.friends.in.this.category"),r&&r.friendCount>1&&d(`extendedprofile.relstatus.others.${i}`,["count"],[(r.friendCount-1).toString()])," "]})]})]})};return e.jsxs(e.Fragment,{children:[e.jsx(s,{type:Js.HEART}),e.jsx(s,{type:Js.SMILE}),e.jsx(s,{type:Js.BOBBA})]})},zO=a=>{const{relationships:t=null,friendsCount:s=null}=a;return e.jsxs(v,{gap:1,children:[e.jsxs(N,{small:!0,children:[e.jsx("b",{children:d("extendedprofile.friends.count")})," ",s]}),e.jsx(N,{bold:!0,small:!0,children:d("extendedprofile.relstatus")}),e.jsx(v,{children:e.jsx(qO,{relationships:t})})]})},YO=a=>{const{itsMe:t=null,groups:s=null,onLeaveGroup:n=null,overflow:r="hidden",gap:i=2,...l}=a,[c,m]=o.useState(null),[h,u]=o.useState(null);return M(oa,g=>{const f=g.getParser();!c||c!==f.id||f.flag||u(f)}),o.useEffect(()=>{c&&D(new Wi(c,!1))},[c]),o.useEffect(()=>{u(null),s.length>0&&m(g=>(g===s[0].groupId&&D(new Wi(s[0].groupId,!1)),s[0].groupId))},[s]),!s||!s.length?e.jsx(v,{center:!0,fullHeight:!0,children:e.jsxs(w,{justifyContent:"center",gap:2,children:[e.jsx(A,{className:"no-group-spritesheet image-1"}),e.jsx(A,{className:"no-group-spritesheet image-2"}),e.jsx(A,{className:"no-group-spritesheet image-3"})]})}):e.jsxs(ne,{overflow:r,gap:2,...l,children:[e.jsx(v,{alignItems:"center",size:2,overflow:"auto",children:e.jsx(Pe,{overflow:null,columnCount:1,columnMinHeight:50,className:"user-groups-container",children:s.map((g,f)=>e.jsxs(Ce,{overflow:"unset",itemActive:c===g.groupId,onClick:()=>m(g.groupId),className:"p-1",children:[t&&e.jsx("i",{className:"position-absolute end-0 top-0 z-index-1 icon icon-group-"+(g.favourite?"favorite":"not-favorite"),onClick:()=>gN(g)}),e.jsx(mt,{badgeCode:g.badgeCode,isGroup:!0})]},f))})}),e.jsx(v,{size:10,overflow:"hidden",children:h&&e.jsx(zh,{groupInformation:h,onClose:n})})]})},$O=a=>{const{userProfile:t=null}=a,[s,n]=o.useState(t.requestSent),r=t.id===B().userId,i=!s&&!r&&!t.isMyFriend&&!t.requestSent,l=()=>{n(!0),D(new pm(t.username))};return o.useEffect(()=>{n(t.requestSent)},[t]),e.jsxs(w,{gap:2,children:[e.jsx(v,{center:!0,className:"avatar-container",children:e.jsx(nt,{figure:t.figure,direction:2})}),e.jsxs(v,{children:[e.jsxs(v,{gap:0,children:[e.jsx(N,{bold:!0,children:t.username}),e.jsxs(N,{italics:!0,textBreak:!0,small:!0,children:[t.motto," "]})]}),e.jsxs(v,{gap:1,children:[e.jsxs(N,{small:!0,children:[e.jsx("b",{children:d("extendedprofile.created")})," ",t.registration]}),e.jsxs(N,{small:!0,children:[e.jsx("b",{children:d("extendedprofile.last.login")})," ",Zs.format(t.secondsSinceLastVisit,".ago",2)]}),e.jsxs(N,{small:!0,children:[e.jsx("b",{children:d("extendedprofile.achievementscore")})," ",t.achievementPoints]})]}),e.jsxs(w,{gap:1,children:[t.isOnline&&e.jsx("i",{className:"icon icon-pf-online"}),!t.isOnline&&e.jsx("i",{className:"icon icon-pf-offline"}),e.jsxs(w,{alignItems:"center",gap:1,children:[i&&e.jsx(N,{small:!0,underline:!0,pointer:!0,onClick:l,children:d("extendedprofile.addasafriend")}),!i&&e.jsxs(e.Fragment,{children:[e.jsx("i",{className:"icon icon-pf-tick"}),r&&e.jsx(N,{children:d("extendedprofile.me")}),t.isMyFriend&&e.jsx(N,{children:d("extendedprofile.friend")}),(s||t.requestSent)&&e.jsx(N,{children:d("extendedprofile.friendrequestsent")})]})]})]})]})]})},KO=a=>{const[t,s]=o.useState(null),[n,r]=o.useState([]),[i,l]=o.useState(null),c=()=>{s(null),r([]),l(null)},m=()=>{!t||t.id!==B().userId||as(t.id)};return M(sC,h=>{const u=h.getParser();!t||u.userId!==t.id||r(u.badges)}),M(zm,h=>{const u=h.getParser();!t||u.userId!==t.id||l(u)}),M(rC,h=>{const u=h.getParser();let g=!1;s(f=>(f&&f.id&&(g=f.id===u.id),u)),g||(r([]),l(null)),D(new nC(u.id)),D(new Ym(u.id))}),M(iC,h=>{const u=h.getParser();u.userId==(t==null?void 0:t.id)&&as(u.userId)}),ve(bt.SELECTED,h=>{if(!t||h.category!==X.UNIT)return;const u=ye().userDataManager.getUserDataByIndex(h.objectId);u.type===dt.USER&&as(u.webID)}),t?e.jsxs(ie,{uniqueKey:"nitro-user-profile",theme:"primary-slim",className:"user-profile",children:[e.jsx(re,{headerText:d("extendedprofile.caption"),onCloseClick:c}),e.jsxs(se,{overflow:"hidden",children:[e.jsxs(ne,{fullHeight:!1,gap:2,children:[e.jsxs(v,{size:7,gap:1,className:"user-container pe-2",children:[e.jsx($O,{userProfile:t}),e.jsx(ne,{columnCount:5,fullHeight:!0,className:"bg-muted rounded px-2 py-1",children:e.jsx(WO,{fullWidth:!0,center:!0,badges:n})})]}),e.jsx(v,{size:5,children:i&&e.jsx(zO,{relationships:i,friendsCount:t.friendsCount})})]}),e.jsx(w,{alignItems:"center",className:"rooms-button-container px-2 py-1",children:e.jsxs(w,{alignItems:"center",gap:1,onClick:h=>Z(`navigator/search/hotel_view/owner:${t.username}`),children:[e.jsx("i",{className:"icon icon-rooms"}),e.jsx(N,{bold:!0,underline:!0,pointer:!0,children:d("extendedprofile.rooms")})]})}),e.jsx(YO,{fullWidth:!0,itsMe:t.id===B().userId,groups:t.groups,onLeaveGroup:m})]})]}):null},XO=a=>{const[t,s]=o.useState(!1),[n,r]=o.useState(null),[i,l]=Eh(),[c,m]=Ch(),h=(g,f)=>{let p=!0;const x=n.clone();switch(g){case"close_view":s(!1),p=!1;return;case"oldchat":x.oldChat=f,D(new lC(x.oldChat));break;case"room_invites":x.roomInvites=f,D(new oC(x.roomInvites));break;case"camera_follow":x.cameraFollow=f,D(new aC(x.cameraFollow));break;case"system_volume":x.volumeSystem=f,x.volumeSystem=Math.max(0,x.volumeSystem),x.volumeSystem=Math.min(100,x.volumeSystem);break;case"furni_volume":x.volumeFurni=f,x.volumeFurni=Math.max(0,x.volumeFurni),x.volumeFurni=Math.min(100,x.volumeFurni);break;case"trax_volume":x.volumeTrax=f,x.volumeTrax=Math.max(0,x.volumeTrax),x.volumeTrax=Math.min(100,x.volumeTrax);break}p&&r(x),Jl(x)},u=g=>{switch(g){case"volume":D(new cC(Math.round(n.volumeSystem),Math.round(n.volumeFurni),Math.round(n.volumeTrax)));break}};return M(dC,g=>{const f=g.getParser(),p=new uC;p.volumeSystem=f.volumeSystem,p.volumeFurni=f.volumeFurni,p.volumeTrax=f.volumeTrax,p.oldChat=f.oldChat,p.roomInvites=f.roomInvites,p.cameraFollow=f.cameraFollow,p.flags=f.flags,p.chatType=f.chatType,r(p),Jl(p)}),o.useEffect(()=>{const g={linkReceived:f=>{const p=f.split("/");if(!(p.length<2))switch(p[1]){case"show":s(!0);return;case"hide":s(!1);return;case"toggle":s(x=>!x);return}},eventUrlPrefix:"user-settings/"};return ht(g),()=>gt(g)},[]),o.useEffect(()=>{n&&Ct(n)},[n]),!t||!n?null:e.jsxs(ie,{uniqueKey:"user-settings",className:"user-settings-window",theme:"primary-slim",children:[e.jsx(re,{headerText:d("widget.memenu.settings.title"),onCloseClick:g=>h("close_view")}),e.jsxs(se,{className:"text-black",children:[e.jsxs(v,{gap:1,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:n.oldChat,onChange:g=>h("oldchat",g.target.checked)}),e.jsx(N,{children:d("memenu.settings.chat.prefer.old.chat")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:n.roomInvites,onChange:g=>h("room_invites",g.target.checked)}),e.jsx(N,{children:d("memenu.settings.other.ignore.room.invites")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:n.cameraFollow,onChange:g=>h("camera_follow",g.target.checked)}),e.jsx(N,{children:d("memenu.settings.other.disable.room.camera.follow")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:i,onChange:g=>l(g.target.checked)}),e.jsx(N,{children:d("memenu.settings.other.place.multiple.objects")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:c,onChange:g=>m(g.target.checked)}),e.jsx(N,{children:d("memenu.settings.other.skip.purchase.confirmation")})]})]}),e.jsxs(v,{children:[e.jsx(N,{bold:!0,children:d("widget.memenu.settings.volume")}),e.jsxs(v,{gap:1,children:[e.jsx(N,{children:d("widget.memenu.settings.volume.ui")}),e.jsxs(w,{alignItems:"center",gap:1,children:[n.volumeSystem===0&&e.jsx(Il,{className:zt(n.volumeSystem>=50&&"text-muted","fa-icon")}),n.volumeSystem>0&&e.jsx(bl,{className:zt(n.volumeSystem>=50&&"text-muted","fa-icon")}),e.jsx("input",{type:"range",className:"custom-range w-100",min:"0",max:"100",step:"1",id:"volumeSystem",value:n.volumeSystem,onChange:g=>h("system_volume",g.target.value),onMouseUp:()=>u("volume")}),e.jsx(El,{className:zt(n.volumeSystem<50&&"text-muted","fa-icon")})]})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{children:d("widget.memenu.settings.volume.furni")}),e.jsxs(w,{alignItems:"center",gap:1,children:[n.volumeFurni===0&&e.jsx(Il,{className:zt(n.volumeFurni>=50&&"text-muted","fa-icon")}),n.volumeFurni>0&&e.jsx(bl,{className:zt(n.volumeFurni>=50&&"text-muted","fa-icon")}),e.jsx("input",{type:"range",className:"custom-range w-100",min:"0",max:"100",step:"1",id:"volumeFurni",value:n.volumeFurni,onChange:g=>h("furni_volume",g.target.value),onMouseUp:()=>u("volume")}),e.jsx(El,{className:zt(n.volumeFurni<50&&"text-muted","fa-icon")})]})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{children:d("widget.memenu.settings.volume.trax")}),e.jsxs(w,{alignItems:"center",gap:1,children:[n.volumeTrax===0&&e.jsx(Il,{className:zt(n.volumeTrax>=50&&"text-muted","fa-icon")}),n.volumeTrax>0&&e.jsx(bl,{className:zt(n.volumeTrax>=50&&"text-muted","fa-icon")}),e.jsx("input",{type:"range",className:"custom-range w-100",min:"0",max:"100",step:"1",id:"volumeTrax",value:n.volumeTrax,onChange:g=>h("trax_volume",g.target.value),onMouseUp:()=>u("volume")}),e.jsx(El,{className:zt(n.volumeTrax<50&&"text-muted","fa-icon")})]})]})]})]})]})},QO=a=>{const{maxItemSelectionCount:t}=a,{furniIds:s,selectObjectForWired:n}=_e(),r=d("wiredfurni.pickfurnis.caption",["count","limit"],[s.length.toString(),t.toString()]);return e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:r}),e.jsx(N,{small:!0,children:d("wiredfurni.pickfurnis.desc")})]})},Kc=a=>{const{wiredType:t="",requiresFurni:s=ue.STUFF_SELECTION_OPTION_NONE,save:n=null,validate:r=null,children:i=null,hasSpecialInput:l=!1,maxItemSelectionCount:c=5}=a,[m,h]=o.useState(null),[u,g]=o.useState(null),[f,p]=o.useState(!1),{trigger:x,setTrigger:I,setIntParams:j,setStringParam:E,setFurniIds:C,setAllowsFurni:b,saveWired:_,setMaxItemSelectionCount:S}=_e();o.useEffect(()=>{S(c)},[c,S]);const T=()=>I(null),L=()=>{r&&!r()||(n&&n(),p(!0))};return o.useEffect(()=>{f&&(_(),p(!1))},[f,_]),o.useEffect(()=>{if(!x)return;const k=x.spriteId||-1,R=B().getFloorItemData(k);R?(h(R.name),g(R.description)):(h("NAME: "+k),g("NAME: "+k)),l&&(j(x.intData),E(x.stringData)),s>ue.STUFF_SELECTION_OPTION_NONE&&C(y=>(y&&y.length&&Hn.clearSelectionShaderFromFurni(y),x.selectedItems&&x.selectedItems.length?(Hn.applySelectionShaderToFurni(x.selectedItems),x.selectedItems):[])),b(s),Hn.setMaxItemSelectionCount&&Hn.setMaxItemSelectionCount(c)},[x,l,s,j,E,C,b,c]),e.jsxs(ie,{uniqueKey:"nitro-wired",className:"nitro-wired",theme:"primary-slim",children:[e.jsx(re,{headerText:d("wiredfurni.title"),onCloseClick:T}),e.jsxs(se,{children:[e.jsxs(v,{gap:1,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("i",{className:`icon icon-wired-${t}`}),e.jsx(N,{bold:!0,children:m})]}),e.jsx(N,{small:!0,children:u})]}),!!i&&e.jsx("hr",{className:"m-0 bg-dark"}),i,s>ue.STUFF_SELECTION_OPTION_NONE&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"m-0 bg-dark"}),e.jsx(QO,{maxItemSelectionCount:c})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx(P,{fullWidth:!0,variant:"success",onClick:L,children:d("wiredfurni.ready")}),e.jsx(P,{fullWidth:!0,variant:"secondary",onClick:T,children:d("cancel")})]})]})]})},ft=a=>{const{requiresFurni:t=ue.STUFF_SELECTION_OPTION_NONE,save:s=null,hasSpecialInput:n=!1,children:r=null}=a,{trigger:i=null,actionDelay:l=0,setActionDelay:c=null}=_e();return o.useEffect(()=>{c(i.delayInPulses)},[i,c]),e.jsxs(Kc,{wiredType:"action",requiresFurni:t,save:s,hasSpecialInput:n,children:[r,!!r&&e.jsx("hr",{className:"m-0 bg-dark"}),e.jsxs(v,{children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.delay",["seconds"],[da(l)])}),e.jsx(Lt,{min:0,max:20,value:l,snapDragDisabled:!1,onChange:m=>c(m)})]})]})},JO="hd-180-1.ch-210-66.lg-270-82.sh-290-81",ZO=a=>{const[t,s]=o.useState(""),[n,r]=o.useState(""),{trigger:i=null,setStringParam:l=null}=_e(),c=()=>l(t+hi+n);return o.useEffect(()=>{const m=i.stringData.split(hi);m.length>0&&s(m[0]),m.length>1&&r(m[1].length>0?m[1]:JO)},[i]),e.jsxs(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:c,children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.bot.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:32,value:t,onChange:m=>s(m.target.value)})]}),e.jsxs(w,{center:!0,children:[e.jsx(nt,{figure:n,direction:4}),e.jsx(P,{onClick:m=>r(B().figure),children:d("wiredfurni.params.capture.figure")})]})]})},e1=a=>{const[t,s]=o.useState(""),[n,r]=o.useState(-1),{trigger:i=null,setStringParam:l=null,setIntParams:c=null}=_e(),m=()=>{l(t),c([n])};return o.useEffect(()=>{s(i.stringData),r(i.intData.length>0?i.intData[0]:0)},[i]),e.jsxs(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:m,children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.bot.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:32,value:t,onChange:h=>s(h.target.value)})]}),e.jsxs(v,{gap:1,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"followMode",id:"followMode1",checked:n===1,onChange:h=>r(1)}),e.jsx(N,{children:d("wiredfurni.params.start.following")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"followMode",id:"followMode2",checked:n===0,onChange:h=>r(0)}),e.jsx(N,{children:d("wiredfurni.params.stop.following")})]})]})]})},t1=[2,5,7,8,9,10,27],s1=a=>{const[t,s]=o.useState(""),[n,r]=o.useState(-1),{trigger:i=null,setStringParam:l=null,setIntParams:c=null}=_e(),m=()=>{l(t),c([n])};return o.useEffect(()=>{s(i.stringData),r(i.intData.length>0?i.intData[0]:0)},[i]),e.jsxs(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:m,children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.bot.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:32,value:t,onChange:h=>s(h.target.value)})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.handitem")}),e.jsxs("select",{className:"form-select form-select-sm",value:n,onChange:h=>r(parseInt(h.target.value)),children:[e.jsx("option",{value:"0",children:"------"}),t1.map(h=>e.jsx("option",{value:h,children:d(`handitem${h}`)},h))]})]})]})},n1=a=>{const[t,s]=o.useState(""),{trigger:n=null,setStringParam:r=null}=_e(),i=()=>r(t);return o.useEffect(()=>{s(n.stringData)},[n]),e.jsx(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!0,save:i,children:e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.bot.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:32,value:t,onChange:l=>s(l.target.value)})]})})},r1=a=>{const[t,s]=o.useState(""),[n,r]=o.useState(""),[i,l]=o.useState(-1),{trigger:c=null,setStringParam:m=null,setIntParams:h=null}=_e(),u=()=>{m(t+hi+n),h([i])};return o.useEffect(()=>{const g=c.stringData.split(hi);g.length>0&&s(g[0]),g.length>1&&r(g[1].length>0?g[1]:""),l(c.intData.length>0?c.intData[0]:0)},[c]),e.jsxs(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:u,children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.bot.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:32,value:t,onChange:g=>s(g.target.value)})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.message")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:K("wired.action.bot.talk.to.avatar.max.length",64),value:n,onChange:g=>r(g.target.value)})]}),e.jsxs(v,{gap:1,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"talkMode",id:"talkMode1",checked:i===0,onChange:g=>l(0)}),e.jsx(N,{children:d("wiredfurni.params.talk")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"talkMode",id:"talkMode2",checked:i===1,onChange:g=>l(1)}),e.jsx(N,{children:d("wiredfurni.params.whisper")})]})]})]})},i1=a=>{const[t,s]=o.useState(""),[n,r]=o.useState(""),[i,l]=o.useState(-1),{trigger:c=null,setStringParam:m=null,setIntParams:h=null}=_e(),u=()=>{m(t+hi+n),h([i])};return o.useEffect(()=>{const g=c.stringData.split(hi);g.length>0&&s(g[0]),g.length>1&&r(g[1].length>0?g[1]:""),l(c.intData.length>0?c.intData[0]:0)},[c]),e.jsxs(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:u,children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.bot.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:32,value:t,onChange:g=>s(g.target.value)})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.message")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:K("wired.action.bot.talk.max.length",64),value:n,onChange:g=>r(g.target.value)})]}),e.jsxs(v,{gap:1,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"talkMode",id:"talkMode1",checked:i===0,onChange:g=>l(0)}),e.jsx(N,{children:d("wiredfurni.params.talk")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"talkMode",id:"talkMode2",checked:i===1,onChange:g=>l(1)}),e.jsx(N,{children:d("wiredfurni.params.shout")})]})]})]})},a1=a=>{const[t,s]=o.useState(""),{trigger:n=null,setStringParam:r=null}=_e(),i=()=>r(t);return o.useEffect(()=>{s(n.stringData)},[n]),e.jsx(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!0,save:i,children:e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.bot.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:32,value:t,onChange:l=>s(l.target.value)})]})})},o1=a=>e.jsx(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT,hasSpecialInput:!1,save:null}),l1=a=>e.jsx(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT,hasSpecialInput:!1,save:null}),c1=a=>{const[t,s]=o.useState(""),{trigger:n=null,setStringParam:r=null}=_e(),i=()=>r(t);return o.useEffect(()=>{s(n.stringData)},[n]),e.jsx(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:i,children:e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.message")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:t,onChange:l=>s(l.target.value),maxLength:K("wired.action.chat.max.length",100)})]})})},u1=a=>e.jsx(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT,hasSpecialInput:!1,save:null}),d1=a=>{const[t,s]=o.useState(!1),[n,r]=o.useState(1),[i,l]=o.useState(!1),[c,m]=o.useState(1),[h,u]=o.useState(1),[g,f]=o.useState([]),{trigger:p=null,setIntParams:x=null,setStringParam:I=null}=_e(),j=()=>f(_=>[..._,{isBadge:!1,itemCode:"",probability:null}]),E=_=>{f(S=>{const T=Array.from(S);return T.splice(_,1),T})},C=(_,S,T,L)=>{const k=Array.from(g),R=k[_];R&&(R.isBadge=S,R.itemCode=T,R.probability=L,f(k))},b=()=>{let _=[];for(const S of g){if(!S.itemCode)continue;const T=[S.isBadge?"0":"1",S.itemCode,S.probability.toString()];_.push(T.join(","))}_.length>0&&(I(_.join(";")),x([n,i?1:0,c,h]))};return o.useEffect(()=>{const _=[];if(p.stringData.length>0&&p.stringData.includes(";")){const S=p.stringData.split(";");for(const T of S){const L=T.split(",");L.length===3&&_.push({isBadge:L[0]==="0",itemCode:L[1],probability:Number(L[2])})}}_.length===0&&_.push({isBadge:!1,itemCode:"",probability:null}),r(p.intData.length>0?p.intData[0]:0),l(p.intData.length>1?p.intData[1]===1:!1),m(p.intData.length>2?p.intData[2]:0),u(p.intData.length>3?p.intData[3]:0),s(p.intData.length>3?p.intData[3]>0:!1),f(_)},[p]),e.jsxs(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:b,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",id:"limitEnabled",onChange:_=>s(_.target.checked)}),e.jsx(N,{children:d("wiredfurni.params.prizelimit",["amount"],[t?c.toString():""])})]}),!t&&e.jsx(N,{center:!0,small:!0,className:"bg-muted rounded p-1",children:"Reward limit not set. Make sure rewards are badges or non-tradeable items."}),t&&e.jsx(Lt,{min:1,max:1e3,value:c,onChange:_=>m(_)}),e.jsx("hr",{className:"m-0 bg-dark"}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:"How often can a user be rewarded?"}),e.jsxs(w,{gap:1,children:[e.jsxs("select",{className:"form-select form-select-sm w-100",value:n,onChange:_=>r(Number(_.target.value)),children:[e.jsx("option",{value:"0",children:"Once"}),e.jsxs("option",{value:"3",children:["Once every ",h," minutes"]}),e.jsxs("option",{value:"2",children:["Once every ",h," hours"]}),e.jsxs("option",{value:"1",children:["Once every ",h," days"]})]}),n>0&&e.jsx("input",{type:"number",className:"form-control form-control-sm",value:h,onChange:_=>u(Number(_.target.value))})]})]}),e.jsx("hr",{className:"m-0 bg-dark"}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",id:"uniqueRewards",checked:i,onChange:_=>l(_.target.checked)}),e.jsx(N,{children:"Unique rewards"})]}),e.jsx(N,{center:!0,small:!0,className:"bg-muted rounded p-1",children:"If checked each reward will be given once to each user. This will disable the probabilities option."}),e.jsx("hr",{className:"m-0 bg-dark"}),e.jsxs(w,{justifyContent:"between",alignItems:"center",children:[e.jsx(N,{bold:!0,children:"Rewards"}),e.jsx(P,{variant:"success",onClick:j,children:e.jsx(Wo,{className:"fa-icon"})})]}),e.jsx(v,{gap:1,children:g&&g.map((_,S)=>e.jsxs(w,{gap:1,children:[e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",checked:_.isBadge,onChange:T=>C(S,T.target.checked,_.itemCode,_.probability)}),e.jsx(N,{small:!0,children:"Badge?"})]}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:_.itemCode,onChange:T=>C(S,_.isBadge,T.target.value,_.probability),placeholder:"Item Code"}),e.jsx("input",{type:"number",className:"form-control form-control-sm",value:_.probability,onChange:T=>C(S,_.isBadge,_.itemCode,Number(T.target.value)),placeholder:"Probability"}),S>0&&e.jsx(P,{variant:"danger",onClick:T=>E(S),children:e.jsx(jc,{className:"fa-icon"})})]},S))})]})},m1=a=>{const[t,s]=o.useState(1),[n,r]=o.useState(1),[i,l]=o.useState(1),{trigger:c=null,setIntParams:m=null}=_e(),h=()=>m([t,n,i]);return o.useEffect(()=>{c.intData.length>=2?(s(c.intData[0]),r(c.intData[1]),l(c.intData[2])):(s(1),r(1),l(1))},[c]),e.jsxs(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:h,children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.setpoints",["points"],[t.toString()])}),e.jsx(Lt,{min:1,max:100,value:t,onChange:u=>s(u)})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.settimesingame",["times"],[n.toString()])}),e.jsx(Lt,{min:1,max:10,value:n,onChange:u=>r(u)})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.team")}),[1,2,3,4].map(u=>e.jsxs(w,{gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"selectedTeam",id:`selectedTeam${u}`,checked:i===u,onChange:g=>l(u)}),e.jsx(N,{children:d("wiredfurni.params.team."+u)})]},u))]})]})},h1=a=>{const[t,s]=o.useState(1),[n,r]=o.useState(1),{trigger:i=null,setIntParams:l=null}=_e(),c=()=>l([t,n]);return o.useEffect(()=>{i.intData.length>=2?(s(i.intData[0]),r(i.intData[1])):(s(1),r(1))},[i]),e.jsxs(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:c,children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.setpoints",["points"],[t.toString()])}),e.jsx(Lt,{min:1,max:100,value:t,onChange:m=>s(m)})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.settimesingame",["times"],[n.toString()])}),e.jsx(Lt,{min:1,max:10,value:n,onChange:m=>r(m)})]})]})},g1=a=>{const[t,s]=o.useState(-1),{trigger:n=null,setIntParams:r=null}=_e(),i=()=>r([t]);return o.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),e.jsx(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:i,children:e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.team")}),[1,2,3,4].map(l=>e.jsxs(w,{gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"selectedTeam",id:`selectedTeam${l}`,checked:t===l,onChange:c=>s(l)}),e.jsx(N,{children:d(`wiredfurni.params.team.${l}`)})]},l))]})})},f1=a=>{const[t,s]=o.useState(""),{trigger:n=null,setStringParam:r=null}=_e(),i=()=>r(t);return o.useEffect(()=>{s(n.stringData)},[n]),e.jsx(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:i,children:e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.message")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:t,onChange:l=>s(l.target.value),maxLength:K("wired.action.kick.from.room.max.length",100)})]})})},p1=a=>e.jsx(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!1,save:null}),x1=[{value:0,icon:"ne"},{value:2,icon:"se"},{value:4,icon:"sw"},{value:6,icon:"nw"}],j1=[0,1,2,3,4,5,6],I1=a=>{const[t,s]=o.useState(-1),[n,r]=o.useState(-1),{trigger:i=null,setIntParams:l=null}=_e(),c=()=>l([t,n]);return o.useEffect(()=>{i.intData.length>=2?(s(i.intData[0]),r(i.intData[1])):(s(-1),r(-1))},[i]),e.jsxs(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT,hasSpecialInput:!0,save:c,children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.startdir")}),e.jsx(w,{gap:1,children:x1.map(m=>e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"movement",id:`movement${m.value}`,checked:t===m.value,onChange:h=>s(m.value)}),e.jsx(N,{children:e.jsx("i",{className:`icon icon-${m.icon}`})})]},m.value))})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.turn")}),j1.map(m=>e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"rotation",id:`rotation${m}`,checked:n===m,onChange:h=>r(m)}),e.jsx(N,{children:d(`wiredfurni.params.turn.${m}`)})]},m))]})]})},b1=[{value:0,icon:"ne"},{value:2,icon:"se"},{value:4,icon:"sw"},{value:6,icon:"nw"}],E1=a=>{const[t,s]=o.useState(-1),[n,r]=o.useState(-1),{trigger:i=null,setIntParams:l=null}=_e(),c=()=>l([n,t]);return o.useEffect(()=>{i.intData.length>=2?(s(i.intData[1]),r(i.intData[0])):(s(-1),r(-1))},[i]),e.jsxs(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE,hasSpecialInput:!0,save:c,children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.emptytiles",["tiles"],[t.toString()])}),e.jsx(Lt,{min:1,max:5,value:t,onChange:m=>s(m)})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.startdir")}),e.jsx(w,{gap:1,children:b1.map(m=>e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"movement",id:`movement${m.value}`,checked:n===m.value,onChange:h=>r(m.value)}),e.jsx(N,{children:e.jsx("i",{className:`icon icon-${m.icon}`})})]},m.value))})]})]})},C1=[{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"}],N1=[0,1,2,3],v1=a=>{const[t,s]=o.useState(-1),[n,r]=o.useState(-1),{trigger:i=null,setIntParams:l=null}=_e(),c=()=>l([t,n]);return o.useEffect(()=>{i.intData.length>=2?(s(i.intData[0]),r(i.intData[1])):(s(-1),r(-1))},[i]),e.jsxs(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT,hasSpecialInput:!0,save:c,children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.movefurni")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"selectedTeam",id:"movement0",checked:t===0,onChange:m=>s(0)}),e.jsx(N,{children:d("wiredfurni.params.movefurni.0")})]}),e.jsxs(w,{gap:1,children:[C1.map(m=>e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"movement",id:`movement${m.value}`,checked:t===m.value,onChange:h=>s(m.value)}),e.jsx("i",{className:`icon icon-${m.icon}`})]},m.value)),e.jsx("div",{className:"col"})]})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.rotatefurni")}),N1.map(m=>e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"rotation",id:`rotation${m}`,checked:n===m,onChange:h=>r(m)}),e.jsxs(N,{children:[[1,2].includes(m)&&e.jsx("i",{className:`icon icon-rot-${m}`}),d(`wiredfurni.params.rotatefurni.${m}`)]})]},m))]})]})},_1=a=>{const[t,s]=o.useState(-1),[n,r]=o.useState(""),{trigger:i=null,setIntParams:l=null,setStringParam:c=null}=_e(),m=()=>{l([t]),c(n)};return o.useEffect(()=>{s(i.intData.length>0?i.intData[0]:0),r(i.stringData)},[i]),e.jsxs(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:m,children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.length.minutes",["minutes"],[t.toString()])}),e.jsx(Lt,{min:1,max:10,value:t,onChange:h=>s(h)})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.message")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:n,onChange:h=>r(h.target.value),maxLength:K("wired.action.mute.user.max.length",100)})]})]})},S1=a=>e.jsx(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!1,save:null}),w1=a=>{const[t,s]=o.useState(0),[n,r]=o.useState(0),[i,l]=o.useState(0),{trigger:c=null,setIntParams:m=null}=_e(),h=()=>m([t,n,i]);return o.useEffect(()=>{s(c.getBoolean(0)?1:0),r(c.getBoolean(1)?1:0),l(c.getBoolean(2)?1:0)},[c]),e.jsx(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!0,save:h,children:e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.conditions")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",id:"stateFlag",checked:!!t,onChange:u=>s(u.target.checked?1:0)}),e.jsx(N,{children:d("wiredfurni.params.condition.state")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",id:"directionFlag",checked:!!n,onChange:u=>r(u.target.checked?1:0)}),e.jsx(N,{children:d("wiredfurni.params.condition.direction")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",id:"positionFlag",checked:!!i,onChange:u=>l(u.target.checked?1:0)}),e.jsx(N,{children:d("wiredfurni.params.condition.position")})]})]})})},T1=a=>e.jsx(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT,hasSpecialInput:!1,save:null}),y1=a=>e.jsx(ft,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT,hasSpecialInput:!1,save:null}),R1=a=>{switch(a){case Ze.BOT_CHANGE_FIGURE:return e.jsx(ZO,{});case Ze.BOT_FOLLOW_AVATAR:return e.jsx(e1,{});case Ze.BOT_GIVE_HAND_ITEM:return e.jsx(s1,{});case Ze.BOT_MOVE:return e.jsx(n1,{});case Ze.BOT_TALK:return e.jsx(i1,{});case Ze.BOT_TALK_DIRECT_TO_AVTR:return e.jsx(r1,{});case Ze.BOT_TELEPORT:return e.jsx(a1,{});case Ze.CALL_ANOTHER_STACK:return e.jsx(o1,{});case Ze.CHASE:return e.jsx(l1,{});case Ze.CHAT:return e.jsx(c1,{});case Ze.FLEE:return e.jsx(u1,{});case Ze.GIVE_REWARD:return e.jsx(d1,{});case Ze.GIVE_SCORE:return e.jsx(h1,{});case Ze.GIVE_SCORE_TO_PREDEFINED_TEAM:return e.jsx(m1,{});case Ze.JOIN_TEAM:return e.jsx(g1,{});case Ze.KICK_FROM_ROOM:return e.jsx(f1,{});case Ze.LEAVE_TEAM:return e.jsx(p1,{});case Ze.MOVE_FURNI:return e.jsx(v1,{});case Ze.MOVE_AND_ROTATE_FURNI:return e.jsx(I1,{});case Ze.MOVE_FURNI_TO:return e.jsx(E1,{});case Ze.MUTE_USER:return e.jsx(_1,{});case Ze.RESET:return e.jsx(S1,{});case Ze.SET_FURNI_STATE:return e.jsx(w1,{});case Ze.TELEPORT:return e.jsx(T1,{});case Ze.TOGGLE_FURNI_STATE:return e.jsx(y1,{})}return null},gs=a=>{const{requiresFurni:t=ue.STUFF_SELECTION_OPTION_NONE,save:s=null,hasSpecialInput:n=!1,children:r=null,maxItemSelectionCount:i=50}=a,l=()=>s&&s();return e.jsx(Kc,{wiredType:"condition",requiresFurni:t,hasSpecialInput:n,save:l,maxItemSelectionCount:i,children:r})},O1=[2,5,7,8,9,10,27],k1=a=>{const[t,s]=o.useState(-1),{trigger:n=null,setIntParams:r=null}=_e(),i=()=>r([t]);return o.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),e.jsx(gs,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:i,children:e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.handitem")}),e.jsx("select",{className:"form-select form-select-sm",value:t,onChange:l=>s(parseInt(l.target.value)),children:O1.map(l=>e.jsx("option",{value:l,children:d(`handitem${l}`)},l))})]})})},A1=a=>e.jsx(gs,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!1,save:null}),D1=a=>e.jsx(gs,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!1,save:null}),P1=[1,2,3,4],L1=a=>{const[t,s]=o.useState(-1),{trigger:n=null,setIntParams:r=null}=_e(),i=()=>r([t]);return o.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),e.jsx(gs,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:i,children:e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.team")}),P1.map(l=>e.jsxs(w,{gap:1,alignItems:"center",children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"selectedTeam",id:`selectedTeam${l}`,checked:t===l,onChange:c=>s(l)}),e.jsx(N,{children:d(`wiredfurni.params.team.${l}`)})]},l))]})})},M1=a=>{const[t,s]=o.useState(""),{trigger:n=null,setStringParam:r=null}=_e(),i=()=>r(t);return o.useEffect(()=>{s(n.stringData)},[n]),e.jsx(gs,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:i,children:e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.badgecode")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:t,onChange:l=>s(l.target.value)})]})})},U1=a=>{const[t,s]=o.useState(-1),{trigger:n=null,setIntParams:r=null}=_e(),i=()=>r([t]);return o.useEffect(()=>{s((n==null?void 0:n.intData[0])??0)},[n]),e.jsx(gs,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:i,children:e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.tooltip.effectid")}),e.jsx("input",{type:"number",className:"form-control form-control-sm",value:t,onChange:l=>s(parseInt(l.target.value))})]})})},F1=a=>{const[t,s]=o.useState(""),[n,r]=o.useState(""),{trigger:i=null,setIntParams:l=null}=_e(),c=()=>{let m=0,h=0;const u=new Date(t),g=new Date(n);u&&g&&(m=u.getTime()/1e3,h=g.getTime()/1e3),l([m,h])};return o.useEffect(()=>{if(i.intData.length>=2){let m=new Date,h=new Date;i.intData[0]>0&&(m=new Date(i.intData[0]*1e3)),i.intData[1]>0&&(h=new Date(i.intData[1]*1e3)),s(Wu(m)),r(Wu(h))}},[i]),e.jsxs(gs,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:c,children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.startdate")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:t,onChange:m=>s(m.target.value)})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.enddate")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:n,onChange:m=>r(m.target.value)})]})]})},V1=a=>{const[t,s]=o.useState(5),n=r=>{s(r)};return e.jsx(gs,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!1,save:null,maxItemSelectionCount:t,children:e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.requireall.caption")}),[1,5].map(r=>e.jsxs(w,{gap:1,alignItems:"center",children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"requireAll",id:`requireAll${r}`,checked:t===r,onChange:()=>n(r)}),e.jsx("label",{className:"text-black form-check-label",htmlFor:`requireAll${r}`,children:d(r===1?"wiredfurni.params.requireall.2":"wiredfurni.params.requireall.3")})]},r))]})})},G1=a=>{const[t,s]=o.useState(-1),{trigger:n=null,setIntParams:r=null}=_e(),i=()=>r([t]);return o.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),e.jsx(gs,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!0,save:i,children:e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.requireall")}),[0,1].map(l=>e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"requireAll",id:`requireAll${l}`,checked:t===l,onChange:c=>s(l)}),e.jsx(N,{children:d("wiredfurni.params.requireall."+l)})]},l))]})})},B1=a=>{const[t,s]=o.useState(-1),{trigger:n=null,setIntParams:r=null}=_e(),i=()=>r([t]);return o.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),e.jsx(gs,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!0,save:i,children:e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.not_requireall")}),[0,1].map(l=>e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"requireAll",id:`requireAll${l}`,checked:t===l,onChange:c=>s(l)}),e.jsx(N,{children:d(`wiredfurni.params.not_requireall.${l}`)})]},l))]})})},H1=a=>e.jsx(gs,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE,hasSpecialInput:!1,save:null}),W1=a=>{const[t,s]=o.useState(0),[n,r]=o.useState(0),[i,l]=o.useState(0),{trigger:c=null,setIntParams:m=null}=_e(),h=()=>m([t,n,i]);return o.useEffect(()=>{s(c.getBoolean(0)?1:0),r(c.getBoolean(1)?1:0),l(c.getBoolean(2)?1:0)},[c]),e.jsx(gs,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID,hasSpecialInput:!0,save:h,children:e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.conditions")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",id:"stateFlag",checked:!!t,onChange:u=>s(u.target.checked?1:0)}),e.jsx(N,{children:d("wiredfurni.params.condition.state")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",id:"directionFlag",checked:!!n,onChange:u=>r(u.target.checked?1:0)}),e.jsx(N,{children:d("wiredfurni.params.condition.direction")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"checkbox",id:"positionFlag",checked:!!i,onChange:u=>l(u.target.checked?1:0)}),e.jsx(N,{children:d("wiredfurni.params.condition.position")})]})]})})},q1=a=>{const[t,s]=o.useState(-1),{trigger:n=null,setIntParams:r=null}=_e(),i=()=>r([t]);return o.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),e.jsx(gs,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:i,children:e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.allowbefore",["seconds"],[da(t)])}),e.jsx(Lt,{min:1,max:1200,value:t,onChange:l=>s(l)})]})})},z1=a=>{const[t,s]=o.useState(-1),{trigger:n=null,setIntParams:r=null}=_e(),i=()=>r([t]);return o.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),e.jsx(gs,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:i,children:e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.allowafter",["seconds"],[da(t)])}),e.jsx(Lt,{min:1,max:1200,value:t,onChange:l=>s(l)})]})})},Y1=a=>{const[t,s]=o.useState(1),[n,r]=o.useState(1),{trigger:i=null,setIntParams:l=null}=_e(),c=()=>l([t,n]);return o.useEffect(()=>{i.intData.length>=2?(s(i.intData[0]),r(i.intData[1])):(s(1),r(1))},[i]),e.jsxs(gs,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:c,children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.usercountmin",["value"],[t.toString()])}),e.jsx(Lt,{min:1,max:50,value:t,onChange:m=>s(m)})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.usercountmax",["value"],[n.toString()])}),e.jsx(Lt,{min:1,max:50,value:n,onChange:m=>r(m)})]})]})},$1=a=>{switch(a){case it.ACTOR_HAS_HANDITEM:return e.jsx(k1,{});case it.ACTOR_IS_GROUP_MEMBER:case it.NOT_ACTOR_IN_GROUP:return e.jsx(A1,{});case it.ACTOR_IS_ON_FURNI:case it.NOT_ACTOR_ON_FURNI:return e.jsx(D1,{});case it.ACTOR_IS_IN_TEAM:case it.NOT_ACTOR_IN_TEAM:return e.jsx(L1,{});case it.ACTOR_IS_WEARING_BADGE:case it.NOT_ACTOR_WEARS_BADGE:return e.jsx(M1,{});case it.ACTOR_IS_WEARING_EFFECT:case it.NOT_ACTOR_WEARING_EFFECT:return e.jsx(U1,{});case it.DATE_RANGE_ACTIVE:return e.jsx(F1,{});case it.FURNIS_HAVE_AVATARS:case it.FURNI_NOT_HAVE_HABBO:return e.jsx(V1,{});case it.HAS_STACKED_FURNIS:return e.jsx(G1,{});case it.NOT_HAS_STACKED_FURNIS:return e.jsx(B1,{});case it.STUFF_TYPE_MATCHES:case it.NOT_FURNI_IS_OF_TYPE:return e.jsx(H1,{});case it.STATES_MATCH:case it.NOT_STATES_MATCH:return e.jsx(W1,{});case it.TIME_ELAPSED_LESS:return e.jsx(q1,{});case it.TIME_ELAPSED_MORE:return e.jsx(z1,{});case it.USER_COUNT_IN:case it.NOT_USER_COUNT_IN:return e.jsx(Y1,{})}return null},vs=a=>{const{requiresFurni:t=ue.STUFF_SELECTION_OPTION_NONE,save:s=null,hasSpecialInput:n=!1,children:r=null}=a,i=()=>s&&s();return e.jsx(Kc,{wiredType:"trigger",requiresFurni:t,hasSpecialInput:n,save:i,children:r})},K1=a=>{const[t,s]=o.useState(""),[n,r]=o.useState(0),{trigger:i=null,setStringParam:l=null}=_e(),c=()=>l(n===1?t:"");return o.useEffect(()=>{s(i.stringData),r(i.stringData?1:0)},[i]),e.jsx(vs,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:c,children:e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.picktriggerer")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"avatarMode",id:"avatarMode0",checked:n===0,onChange:m=>r(0)}),e.jsx(N,{children:d("wiredfurni.params.anyavatar")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"avatarMode",id:"avatarMode1",checked:n===1,onChange:m=>r(1)}),e.jsx(N,{children:d("wiredfurni.params.certainavatar")})]}),n===1&&e.jsx("input",{type:"text",className:"form-control form-control-sm",value:t,onChange:m=>s(m.target.value)})]})})},X1=a=>{const[t,s]=o.useState(""),[n,r]=o.useState(-1),{trigger:i=null,setStringParam:l=null,setIntParams:c=null}=_e(),m=()=>{l(t),c([n])};return o.useEffect(()=>{s(i.stringData),r(i.intData.length>0?i.intData[0]:0)},[i]),e.jsxs(vs,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:m,children:[e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.whatissaid")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",value:t,onChange:h=>s(h.target.value)})]}),e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.picktriggerer")}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"triggererAvatar",id:"triggererAvatar0",checked:n===0,onChange:h=>r(0)}),e.jsx(N,{children:d("wiredfurni.params.anyavatar")})]}),e.jsxs(w,{alignItems:"center",gap:1,children:[e.jsx("input",{className:"form-check-input",type:"radio",name:"triggererAvatar",id:"triggererAvatar1",checked:n===1,onChange:h=>r(1)}),e.jsx(N,{children:B().userName})]})]})]})},Q1=a=>e.jsx(vs,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE,hasSpecialInput:!1,save:null}),J1=a=>e.jsx(vs,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE,hasSpecialInput:!1,save:null}),Z1=a=>{const[t,s]=o.useState(""),{trigger:n=null,setStringParam:r=null}=_e(),i=()=>r(t);return o.useEffect(()=>{s(n.stringData)},[n]),e.jsx(vs,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:i,children:e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.bot.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:32,value:t,onChange:l=>s(l.target.value)})]})})},ek=a=>{const[t,s]=o.useState(""),{trigger:n=null,setStringParam:r=null}=_e(),i=()=>r(t);return o.useEffect(()=>{s(n.stringData)},[n]),e.jsx(vs,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE,hasSpecialInput:!0,save:i,children:e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.bot.name")}),e.jsx("input",{type:"text",className:"form-control form-control-sm",maxLength:32,value:t,onChange:l=>s(l.target.value)})]})})},tk=a=>e.jsx(vs,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!1,save:null}),sk=a=>{const[t,s]=o.useState(1),{trigger:n=null,setIntParams:r=null}=_e(),i=()=>r([t]);return o.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),e.jsx(vs,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:i,children:e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.settime",["seconds"],[da(t)])}),e.jsx(Lt,{min:1,max:1200,value:t,onChange:l=>s(l)})]})})},nk=a=>{const[t,s]=o.useState(1),{trigger:n=null,setIntParams:r=null}=_e(),i=()=>r([t]);return o.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),e.jsx(vs,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:i,children:e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.setlongtime",["time"],[Zs.format(t*5).toString()])}),e.jsx(Lt,{min:1,max:120,value:t,onChange:l=>s(l)})]})})},rk=a=>{const[t,s]=o.useState(1),{trigger:n=null,setIntParams:r=null}=_e(),i=()=>r([t]);return o.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),e.jsx(vs,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:i,children:e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.settime",["seconds"],[da(t)])}),e.jsx(Lt,{min:1,max:60,value:t,onChange:l=>s(l)})]})})},ik=a=>e.jsx(vs,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!1,save:null}),ak=a=>e.jsx(vs,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!1,save:null}),ok=a=>{const[t,s]=o.useState(1),{trigger:n=null,setIntParams:r=null}=_e(),i=()=>r([t]);return o.useEffect(()=>{s(n.intData.length>0?n.intData[0]:0)},[n]),e.jsx(vs,{requiresFurni:ue.STUFF_SELECTION_OPTION_NONE,hasSpecialInput:!0,save:i,children:e.jsxs(v,{gap:1,children:[e.jsx(N,{bold:!0,children:d("wiredfurni.params.setscore",["points"],[t.toString()])}),e.jsx(Lt,{min:1,max:1e3,value:t,onChange:l=>s(l)})]})})},lk=a=>e.jsx(vs,{requiresFurni:ue.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE,hasSpecialInput:!1,save:null}),ck=a=>{switch(a){case Zt.AVATAR_ENTERS_ROOM:return e.jsx(K1,{});case Zt.AVATAR_SAYS_SOMETHING:return e.jsx(X1,{});case Zt.AVATAR_WALKS_OFF_FURNI:return e.jsx(Q1,{});case Zt.AVATAR_WALKS_ON_FURNI:return e.jsx(J1,{});case Zt.BOT_REACHED_AVATAR:return e.jsx(Z1,{});case Zt.BOT_REACHED_STUFF:return e.jsx(ek,{});case Zt.COLLISION:return e.jsx(tk,{});case Zt.EXECUTE_ONCE:return e.jsx(sk,{});case Zt.EXECUTE_PERIODICALLY:return e.jsx(rk,{});case Zt.EXECUTE_PERIODICALLY_LONG:return e.jsx(nk,{});case Zt.GAME_ENDS:return e.jsx(ik,{});case Zt.GAME_STARTS:return e.jsx(ak,{});case Zt.SCORE_ACHIEVED:return e.jsx(ok,{});case Zt.TOGGLE_FURNI:return e.jsx(lk,{})}return null},uk=a=>{const{trigger:t=null}=_e();return t?t instanceof Nm?R1(t.code):t instanceof vm?ck(t.code):t instanceof _m?$1(t.code):null:null},dk=a=>{const[t,s]=o.useState(-1),[n,r]=o.useState(""),[i,l]=o.useState(""),[c,m]=o.useState(!1),h=()=>{m(!1)};o.useEffect(()=>{const g={linkReceived:f=>{const p=f.split("/");if(!(p.length<3))switch(p[1]){case"show":m(!0),r(p[2]);return}},eventUrlPrefix:"youtube-tv/"};return ht(g),()=>gt(g)},[]);const u=o.useMemo(()=>K("url.prefix"),[]);return c?e.jsxs(ie,{className:"youtube-tv-widget",children:[e.jsx(re,{headerText:"Tv Youtube",onCloseClick:h}),e.jsx(se,{grow:!0,gap:0,children:e.jsx("div",{className:"youtube-video-container d-flex w-100 h-100",children:n&&n.length>0&&e.jsx("iframe",{allowFullScreen:!0,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",width:"100%",height:"100%",src:`https://www.youtube.com/embed/${n}?autoplay=1&mute=0&controls=1&origin=`+u+"&playsinline=1&showinfo=0&rel=0&iv_load_policy=3&modestbranding=1&disablekb=1&enablejsapi=1&widgetid=3"})})})]}):null},mk=a=>{const[t,s]=o.useState(!1),[n,r]=o.useState(!0);return He(Pt.CREATED,i=>r(!1)),He(Pt.ENDED,i=>r(i.openLandingView)),o.useEffect(()=>{s(!0),zi().connection.onReady()},[]),o.useEffect(()=>{const i={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 m=c[2];ia.openHabblet(m)}}return}},eventUrlPrefix:"habblet/"};return ht(i),()=>gt(i)},[]),e.jsxs(A,{fit:!0,children:[e.jsx(ar,{children:n&&e.jsx(or.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:e.jsx(HT,{})})}),e.jsx(HO,{isInRoom:!n}),e.jsx(jy,{}),e.jsx(GO,{}),e.jsx(uw,{}),e.jsx(uk,{}),e.jsx(fS,{}),e.jsx(eS,{}),e.jsx(Py,{}),e.jsx(Ly,{}),e.jsx(ny,{}),e.jsx(cw,{}),e.jsx(Dw,{}),e.jsx(oR,{}),e.jsx(XO,{}),e.jsx(KO,{}),e.jsx(Qw,{}),e.jsx(CS,{}),e.jsx(wT,{}),e.jsx(Uy,{}),e.jsx(lT,{}),e.jsx(cT,{}),e.jsx(_S,{}),e.jsx(Uw,{}),e.jsx(Ew,{}),e.jsx(dk,{})]})};am.UI_VERSION=uh();const hk=a=>{const[t,s]=o.useState(!1),[n,r]=o.useState(!1),[i,l]=o.useState("Getting Ready"),[c,m]=o.useState(0),[h,u]=o.useState(!0);if(!Ie()){if(!NitroConfig)throw new Error("NitroConfig is not defined!");zr.bootstrap()}const g=o.useCallback(async f=>{switch(f.type){case wa.LOADED:Ie().localization.init(),m(p=>p+20);return;case wa.FAILED:r(!0),l("Configuration Failed");return;case zr.WEBGL_UNAVAILABLE:r(!0),l("WebGL Required");return;case zr.WEBGL_CONTEXT_LOST:r(!0),l("WebGL Context Lost - Reloading"),setTimeout(()=>window.location.reload(),1500);return;case an.CONNECTION_HANDSHAKING:m(p=>p+20);return;case an.CONNECTION_HANDSHAKE_FAILED:r(!0),l("Handshake Failed");return;case an.CONNECTION_AUTHENTICATED:m(p=>p+20),Ie().init(),qi.available&&qi.call("legacyTrack","authentication","authok",[]);return;case an.CONNECTION_ERROR:r(!0),l("Connection Error");return;case an.CONNECTION_CLOSED:l("Connection Error"),ia.send(-1,"client.init.handshake.fail");return;case ys.ENGINE_INITIALIZED:m(p=>p+20),setTimeout(()=>s(!0),300);return;case Cu.LOADED:{const p=K("preload.assets.urls"),x=[];if(p&&p.length)for(const j of p)x.push(fc.interpolate(j));await mC().downloadAssets(x)?(zi().init(),m(j=>j+20)):(r(!0),l("Assets Failed"));return}}},[]);return fr(zr.WEBGL_UNAVAILABLE,g),fr(zr.WEBGL_CONTEXT_LOST,g),fr(an.CONNECTION_HANDSHAKING,g),fr(an.CONNECTION_HANDSHAKE_FAILED,g),fr(an.CONNECTION_AUTHENTICATED,g),fr(an.CONNECTION_ERROR,g),fr(an.CONNECTION_CLOSED,g),ve(ys.ENGINE_INITIALIZED,g),BN(Cu.LOADED,g),Ku(wa.LOADED,g),Ku(wa.FAILED,g),o.useEffect(()=>{Ie().core.configuration.init();const f=p=>u(!(window.devicePixelRatio%1));return window.addEventListener("resize",f),f(),()=>{window.removeEventListener("resize",f)}},[]),e.jsxs(A,{fit:!0,overflow:"hidden",className:h&&"image-rendering-pixelated",children:[(!t||n)&&e.jsx(Y_,{isError:n,message:i,percent:c}),e.jsx(ar,{children:t&&e.jsx(or.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},children:e.jsx(mk,{})})}),e.jsx(A,{id:"draggable-windows-container"})]})};hC(document.getElementById("root")).render(e.jsx(hk,{}));