import{i as bE,B as Z_,F as bd,A as YT,a as Il,C as HT,P as K,R as we,S as bt,T as Ft,b as jT,c as Ss,s as $_,d as Tg,M as Me,e as mg,f as gi,G as Tl,g as zT,h as WT,j as kT,E as KT,k as XT,I as qT,l as QT,m as JT,n as ZT,p as $T,o as tm,q as ml,r as em,t as sm,u as Kr}from"./vendor-B6wl5_nI.js";const cr=class cr{static log(...t){this.LOG_DEBUG&&console.log(this.logPrefix(),...t)}static warn(...t){this.LOG_WARN&&console.warn(this.logPrefix(),...t)}static error(...t){this.LOG_ERROR&&console.error(this.logPrefix(),...t)}static events(...t){this.LOG_EVENTS&&console.log(this.logPrefix(),...t)}static packets(...t){this.LOG_PACKETS&&console.log(this.logPrefix(),...t)}static logPrefix(){return"[Nitro]"}};cr.LOG_DEBUG=!1,cr.LOG_WARN=!1,cr.LOG_ERROR=!1,cr.LOG_EVENTS=!1,cr.LOG_PACKETS=!1;let j=cr;class Xt{constructor(t=null){if(this._length=0,this._dictionary=new Map,this._array=[],this._keys=[],t)for(const[e,s]of t.entries())this.add(e,s)}get length(){return this._length}get disposed(){return!this._dictionary}dispose(){if(!this._dictionary){for(const t of this._dictionary.keys())this._dictionary.delete(t);this._dictionary=null}this._length=0,this._array=null,this._keys=null}reset(){for(const t of this._dictionary.keys())this._dictionary.delete(t);this._length=0,this._array=[],this._keys=[]}unshift(t,e){return this._dictionary.get(t)!==null?!1:(this._dictionary.set(t,e),this._array.unshift(e),this._keys.unshift(t),this._length++,!0)}add(t,e){return this._dictionary.get(t)!==void 0?!1:(this._dictionary.set(t,e),this._array[this._length]=e,this._keys[this._length]=t,this._length++,!0)}remove(t){const e=this._dictionary.get(t);if(!e)return null;const s=this._array.indexOf(e);return s>=0&&(this._array.splice(s,1),this._keys.splice(s,1),this._length--),this._dictionary.delete(t),e}getWithIndex(t){return t<0||t>=this._length?null:this._array[t]}getKey(t){return t<0||t>=this._length?null:this._keys[t]}getKeys(){return this._keys.slice()}hasKey(t){return this._keys.indexOf(t)>-1}getValue(t){return this._dictionary.get(t)}getValues(){return this._array.slice()}hasValue(t){return this._array.indexOf(t)>-1}indexOf(t){return this._array.indexOf(t)}concatenate(t){for(const e of t._keys)this.add(e,t.getValue(e))}clone(){const t=new Xt;return t.concatenate(this),t}}const pg=n=>{let t="";const e=new Uint8Array(n),s=e.byteLength;for(let i=0;i<s;i++)t+=String.fromCharCode(e[i]);return window.btoa(t)};class tl{constructor(t){this._position=0,this._dataView=new DataView(t)}readBytes(t){const e=new tl(this._dataView.buffer.slice(this._position,this._position+t));return this._position+=t,e}readByte(){const t=this._dataView.getInt8(this._position);return this._position++,t}readShort(){const t=this._dataView.getInt16(this._position);return this._position+=2,t}readInt(){const t=this._dataView.getInt32(this._position);return this._position+=4,t}readFloat(){const t=this._dataView.getFloat32(this._position);return this._position+=4,t}readDouble(){const t=this._dataView.getFloat64(this._position);return this._position+=8,t}remaining(){return this._dataView.byteLength-this._position}toString(t){return new TextDecoder().decode(this._dataView.buffer)}toArrayBuffer(){return this._dataView.buffer}}class FE{constructor(){this._buffer=new Uint8Array,this._position=0}writeByte(t){const e=new Uint8Array(1);return e[0]=t,this.appendArray(e),this}writeBytes(t){const e=new Uint8Array(t);return this.appendArray(e),this}writeShort(t){const e=new Uint8Array(2);return e[0]=t>>8,e[1]=t&255,this.appendArray(e),this}writeInt(t){const e=new Uint8Array(4);return e[0]=t>>24,e[1]=t>>16,e[2]=t>>8,e[3]=t&255,this.appendArray(e),this}writeString(t,e=!0){const s=new TextEncoder().encode(t);return e?(this.writeShort(s.length),this.appendArray(s)):this.appendArray(s),this}appendArray(t){if(!t)return;const e=new Uint8Array(this.position+t.length>this._buffer.length?this.position+t.length:this._buffer.length);e.set(this._buffer),e.set(t,this.position),this._buffer=e,this.position+=t.length}getBuffer(){return this._buffer.buffer}get position(){return this._position}set position(t){this._position=t}toString(t){return new TextDecoder(t).decode(this._buffer)}}const dh=class dh{constructor(t){this._jsonFile=null,this._image=null,this._imageData=null,this._baseTexture=null,this.parse(t)}parse(t){const e=new tl(t);let s=e.readShort();for(;s>0;){const i=e.readShort(),r=e.readBytes(i).toString(),a=e.readInt(),o=e.readBytes(a);if(r.endsWith(".json")){const h=bE(o.toArrayBuffer());this._jsonFile=JSON.parse(dh.TEXT_DECODER.decode(h))}else{const h=bE(o.toArrayBuffer()),_=pg(h);this._baseTexture=new Z_("data:image/png;base64,"+_)}s--}}get jsonFile(){return this._jsonFile}get baseTexture(){return this._baseTexture}};dh.TEXT_DECODER=new TextDecoder("utf-8");let _o=dh;class im extends bd{constructor(t){super(`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;
            }`,`varying vec2 vTextureCoord;
            uniform sampler2D uSampler;
            
            uniform float gamma;
            uniform float contrast;
            uniform float saturation;
            uniform float brightness;
            uniform float red;
            uniform float green;
            uniform float blue;
            uniform float alpha;
            
            void main(void)
            {
                vec4 c = texture2D(uSampler, vTextureCoord);
            
                if (c.a > 0.0) {
                    c.rgb /= c.a;
            
                    vec3 rgb = pow(c.rgb, vec3(1. / gamma));
                    rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);
                    rgb.r *= red;
                    rgb.g *= green;
                    rgb.b *= blue;
                    c.rgb = rgb * brightness;
            
                    c.rgb *= c.a;
                }
            
                gl_FragColor = c * alpha;
            }`),this.gamma=1,this.saturation=1,this.contrast=1,this.brightness=1,this.red=1,this.green=1,this.blue=1,this.alpha=1,Object.assign(this,t)}apply(t,e,s,i){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,t.applyFilter(this,e,s,i)}}const rm=`
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;
}`,nm=`
varying vec2 vTextureCoord;
uniform sampler2D uSampler;
uniform sampler2D mask;
uniform int fromChannel;
uniform int toChannel;

void main(void) {
    vec4 maskColor = texture2D(mask, vTextureCoord);
    vec4 currentColor = texture2D(uSampler, vTextureCoord);
    vec4 adjusted = currentColor;

    if(maskColor.r == 0.0 && maskColor.g == 0.0 && maskColor.b == 0.0)
    {
        adjusted.a = 0.0;
    }

    gl_FragColor = vec4(adjusted.r, adjusted.g, adjusted.b, adjusted.a);
}`,hn=class hn extends bd{constructor(t,e,s){super(rm,nm,{mask:t.castToBaseTexture(),fromChannel:e,toChannel:s})}};hn.CHANNEL_RED=0,hn.CHANNEL_GREEN=1,hn.CHANNEL_BLUE=2,hn.CHANNEL_ALPHA=3;let xE=hn;const na=class na extends YT{constructor(t){super(t),na.INSTANCE||(na.INSTANCE=this)}static get instance(){return this.INSTANCE||null}};na.INSTANCE=null;let Kt=na;const ui=()=>{var n;return((n=Kt.instance)==null?void 0:n.ticker)||null},am=()=>{var n;return((n=ui())==null?void 0:n.FPS)||0},nt=()=>{var n;return((n=ui())==null?void 0:n.lastTime)||0};class BY extends Il{}class om extends Z_{}class Rs extends HT{}class hm extends bd{}class lo extends K{}class wY extends we{}class xt extends bt{}class Rg extends Ft{}class VY extends jT{}const _m=`
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;
}`,lm=`
varying vec2 vTextureCoord;
uniform sampler2D uSampler;
uniform sampler2D lut;
uniform int channel;

void main(void) {
    vec4 currentColor = texture2D(uSampler, vTextureCoord);
    vec4 adjusted = currentColor;

    if(currentColor.a > 0.0)
    {
        if(channel == 0)
        {
            adjusted = texture2D(lut, vec2((currentColor.r * 255.0 + 0.5) / 256.0, 0.5));
        } else if(channel == 1) {
            adjusted = texture2D(lut, vec2((currentColor.g * 255.0 + 0.5) / 256.0, 0.5));
        } else if(channel == 2) {
            adjusted = texture2D(lut, vec2((currentColor.b * 255.0 + 0.5) / 256.0, 0.5));
        } else if(channel == 3) {
            adjusted = texture2D(lut, vec2((currentColor.a * 255.0 + 0.5) / 256.0, 0.5));
        }
    }

    gl_FragColor = vec4(adjusted.r, adjusted.g, adjusted.b, currentColor.a);
}`,Es=class Es extends hm{constructor(t,e=Es.CHANNEL_RED){super(_m,lm),this._channel=e;let s=[];s=this.getLutForPalette(t),this._lut=om.fromBuffer(Uint8Array.from(s),s.length/4,1,{mipmap:0,scaleMode:0}),this.uniforms.lut=this._lut,this.uniforms.channel=this._channel}getLutForPalette(t){const e=[];for(let s=0;s<t.length;s++)e[s*4+Es.CHANNEL_RED]=t[s]>>16&255,e[s*4+Es.CHANNEL_GREEN]=t[s]>>8&255,e[s*4+Es.CHANNEL_BLUE]=t[s]&255,e[s*4+Es.CHANNEL_ALPHA]=t[s]>>24&255;return e}get lut(){return this._lut}get channel(){return this._channel}};Es.CHANNEL_RED=0,Es.CHANNEL_GREEN=1,Es.CHANNEL_BLUE=2,Es.CHANNEL_ALPHA=3;let co=Es;const Eh=class Eh{constructor(){this.RENDER_TEXTURE_POOL=new Map,this.RENDER_TEXTURE_CACHE=[]}clearCache(){this.RENDER_TEXTURE_POOL.forEach(t=>t==null?void 0:t.destroy(!0)),this.RENDER_TEXTURE_POOL.clear(),this.RENDER_TEXTURE_CACHE=[]}clearRenderTexture(t){return t?this.writeToRenderTexture(new bt(Ft.EMPTY),t):null}getTextureIdentifier(t,e,s){return`${s??Eh.DEFAULT_PLANE_ID}:${t}:${e}`}createRenderTexture(t,e,s=null){if(t<0||e<0)return null;if(!s){const r=Ss.create({width:t,height:e});return this.RENDER_TEXTURE_CACHE.push(r),r}s=this.getTextureIdentifier(t,e,s);let i=this.RENDER_TEXTURE_POOL.get(s);return i||(i=Ss.create({width:t,height:e}),this.RENDER_TEXTURE_CACHE.push(i),this.RENDER_TEXTURE_POOL.set(s,i)),i}createAndFillRenderTexture(t,e,s=null,i=16777215){if(t<0||e<0)return null;const r=this.createRenderTexture(t,e,s);return this.clearAndFillRenderTexture(r,i)}createAndWriteRenderTexture(t,e,s,i=null,r=null){if(t<0||e<0)return null;const a=this.createRenderTexture(t,e,i);return this.writeToRenderTexture(s,a,!0,r)}clearAndFillRenderTexture(t,e=16777215){if(!t)return null;const s=new bt(Ft.WHITE);return s.tint=e,s.width=t.width,s.height=t.height,this.writeToRenderTexture(s,t)}writeToRenderTexture(t,e,s=!0,i=null){return!t||!e?null:(this.getRenderer().render(t,{renderTexture:e,clear:s,transform:i}),e)}getPixels(t,e=null){return this.getExtractor().pixels(t)}getRenderer(){return Kt.instance.renderer}getExtractor(){return this.getRenderer().plugins.extract}};Eh.DEFAULT_PLANE_ID="DEFAULT";let pl=Eh;class Ut{static generateTexture(t,e=null,s=null,i=1){return t?(s===null&&(s=$_.SCALE_MODE),this.getRenderer().generateTexture(t,{scaleMode:s,resolution:i,region:e})):null}static generateTextureFromImage(t){return t?Ft.from(t):null}static generateImage(t){return t?this.getExtractor().image(t):null}static generateImageUrl(t){return t?this.getExtractor().base64(t):null}static generateCanvas(t){return t?this.getExtractor().canvas(t):null}static clearRenderTexture(t){return t?this.writeToRenderTexture(new bt(Ft.EMPTY),t):null}static createRenderTexture(t,e){return t<0||e<0?null:Ss.create({width:t,height:e})}static createAndFillRenderTexture(t,e,s=16777215){if(t<0||e<0)return null;const i=this.createRenderTexture(t,e);return this.clearAndFillRenderTexture(i,s)}static createAndWriteRenderTexture(t,e,s,i=null){if(t<0||e<0)return null;const r=this.createRenderTexture(t,e);return this.writeToRenderTexture(s,r,!0,i)}static clearAndFillRenderTexture(t,e=16777215){if(!t)return null;const s=new bt(Ft.WHITE);return s.tint=e,s.width=t.width,s.height=t.height,this.writeToRenderTexture(s,t)}static writeToRenderTexture(t,e,s=!0,i=null){return!t||!e?null:(this.getRenderer().render(t,{renderTexture:e,clear:s,transform:i}),e)}static getPixels(t,e=null){return this.getExtractor().pixels(t)}static getRenderer(){return Kt.instance.renderer}static getExtractor(){return this.getRenderer().plugins.extract}}const ur=class ur{static createAsset(t,e,s,i,r,a=!1,o=!1,h=!1){const _=ur.GRAPHIC_POOL.length?ur.GRAPHIC_POOL.pop():new ur;return _._name=t,_._source=e||null,s?(_._texture=s,_._initialized=!1):(_._texture=null,_._initialized=!0),_._usesPalette=h,_._x=i,_._y=r,_._flipH=a,_._flipV=o,_._rectangle=null,_}recycle(){this._texture=null,ur.GRAPHIC_POOL.push(this)}initialize(){this._initialized||!this._texture||(this._width=this._texture.width,this._height=this._texture.height,this._initialized=!0)}getImageUrl(){return Ut.generateImageUrl(new bt(this._texture))}get name(){return this._name}get source(){return this._source}get texture(){return this._texture}get usesPalette(){return this._usesPalette}get x(){return this._x}get y(){return this._y}get width(){return this.initialize(),this._width}get height(){return this.initialize(),this._height}get offsetX(){return this._flipH?-this._x:this._x}get offsetY(){return this._flipV?-this._y:this._y}get flipH(){return this._flipH}get flipV(){return this._flipV}get rectangle(){return this._rectangle||(this._rectangle=new we(0,0,this.width,this.height)),this._rectangle}};ur.GRAPHIC_POOL=[];let Rl=ur;class cm{constructor(t,e,s){for(this._palette=t;this._palette.length<256;)this._palette.push([0,0,0]);this._primaryColor=e,this._secondaryColor=s}dispose(){}applyPalette(t){var a,o;const e=Ut.createAndWriteRenderTexture(t.width,t.height,new bt(t)),s=Ut.getPixels(e);for(let h=0;h<s.length;h+=4){let _=this._palette[s[h+1]];_===void 0&&(_=[0,0,0]),s[h]=_[0],s[h+1]=_[1],s[h+2]=_[2]}const i=(a=e.baseTexture._glTextures[1])==null?void 0:a.texture,r=(o=Kt.instance.renderer)==null?void 0:o.gl;return r.bindTexture(r.TEXTURE_2D,i),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,e.width,e.height,0,r.RGBA,r.UNSIGNED_BYTE,s),r.bindTexture(r.TEXTURE_2D,null),e}get primaryColor(){return this._primaryColor}get secondaryColor(){return this._secondaryColor}}const aa=class aa{constructor(t,e){if(!t)throw new Error("invalid_collection");this._name=t.name,this._baseTexture=e&&e.baseTexture||null,this._data=t,this._textures=new Map,this._assets=new Map,this._palettes=new Map,this._paletteAssetNames=[],e&&this.addLibraryAsset(e.textures),this.define(t)}static removeFileExtension(t){return t.substring(0,t.lastIndexOf("."))||t}dispose(){if(this._palettes){for(const t of this._palettes.values())t.dispose();this._palettes.clear()}if(this._paletteAssetNames&&(this.disposePaletteAssets(),this._paletteAssetNames=null),this._assets){for(const t of this._assets.values())t.recycle();this._assets.clear()}}addReference(){this._referenceCount++,this._referenceTimestamp=nt()}removeReference(){this._referenceCount--,this._referenceCount<=0&&(this._referenceCount=0,this._referenceTimestamp=nt(),this.disposePaletteAssets(!1))}define(t){const e=t.assets,s=t.palettes;e&&this.defineAssets(e),s&&this.definePalettes(s)}defineAssets(t){if(t)for(const e in t){const s=t[e];if(!s)continue;const i=-s.x||0,r=-s.y||0;let a=!1;const o=!1,h=s.usesPalette||!1;let _=s.source||"";s.flipH&&_.length&&(a=!0),_.length||(_=e);const l=this.getLibraryAsset(_);if(!l)continue;let c=this.createAsset(e,_,l,a,o,i,r,h);if(!c){const f=this.getAsset(e);f&&f.name!==f.source&&(c=this.replaceAsset(e,_,l,a,o,i,r,h))}}}definePalettes(t){if(t)for(const e in t){const s=t[e];if(!s)continue;const i=s.id.toString();if(this._palettes.get(i))continue;let r=16777215,a=16777215,o=s.color1;o&&o.length>0&&(r=parseInt(o,16)),o=s.color2,o&&o.length>0&&(a=parseInt(o,16)),this._palettes.set(i,new cm(s.rgb,r,a))}}createAsset(t,e,s,i,r,a,o,h){if(this._assets.get(t))return!1;const _=Rl.createAsset(t,e,s,a,o,i,r,h);return this._assets.set(t,_),!0}replaceAsset(t,e,s,i,r,a,o,h){const _=this._assets.get(t);return _&&(this._assets.delete(t),_.recycle()),this.createAsset(t,e,s,i,r,a,o,h)}getAsset(t){if(!t)return null;const e=this._assets.get(t);return e||null}getAssetWithPalette(t,e){const s=t+"@"+e;let i=this.getAsset(s);if(!i){if(i=this.getAsset(t),!i||!i.usesPalette)return i;const r=this.getPalette(e);if(r){const a=r.applyPalette(i.texture);a&&(this._paletteAssetNames.push(s),this.createAsset(s,i.source+"@"+e,a,i.flipH,i.flipV,i.x,i.y,!1),i=this.getAsset(s))}}return i}getTexture(t){return this._textures.get(t)}getPaletteNames(){return Array.from(this._palettes.keys())}getPaletteColors(t){const e=this.getPalette(t);return e?[e.primaryColor,e.secondaryColor]:null}getPalette(t){if(!t)return null;const e=this._palettes.get(t);return e||null}addAsset(t,e,s,i=0,r=0,a=!1,o=!1){if(!t||!e)return!1;const h=this.getLibraryAsset(t);return h?s?(h.baseTexture=e.baseTexture,h.frame=e.frame,h.trim=e.trim,h.updateUvs(),!0):!1:(this._textures.set(t,e),this.createAsset(t,t,e,a,o,i,r,!1))}disposeAsset(t){const e=this._assets.get(t);if(!e)return;this._assets.delete(t);const s=this.getLibraryAsset(e.source);s&&(this._textures.delete(e.source),s.destroy(!0)),e.recycle()}getLibraryAsset(t){if(!t)return null;t=this._name+"_"+t;const e=this._textures.get(t);return e||null}addLibraryAsset(t){if(t)for(const e in t){const s=t[e];s&&this._textures.set(aa.removeFileExtension(e),s)}}disposePaletteAssets(t=!0){if(this._paletteAssetNames&&(t||this._paletteAssetNames.length>aa.PALETTE_ASSET_DISPOSE_THRESHOLD)){for(const e of this._paletteAssetNames)this.disposeAsset(e);this._paletteAssetNames=[]}}get referenceCount(){return this._referenceCount}get referenceTimestamp(){return this._referenceTimestamp}get name(){return this._name}get baseTexture(){return this._baseTexture}get data(){return this._data}get textures(){return this._textures}get assets(){return this._assets}};aa.PALETTE_ASSET_DISPOSE_THRESHOLD=10;let uo=aa;const gh=class gh{constructor(){this._textures=new Map,this._collections=new Map}getTexture(t){if(!t)return null;const e=this._textures.get(t);return e||null}setTexture(t,e){!t||!e||this._textures.set(t,e)}getAsset(t){if(!t)return null;for(const e of this._collections.values()){if(!e)continue;const s=e.getAsset(t);if(s)return s}return null}getCollection(t){if(!t)return null;const e=this._collections.get(t);return e||null}createCollection(t,e){if(!t)return null;const s=new uo(t,e);if(s){for(const[i,r]of s.textures.entries())this.setTexture(i,r);this._collections.set(s.name,s)}return s}async downloadAsset(t){return await this.downloadAssets([t])}async downloadAssets(t){if(!t||!t.length)return Promise.resolve(!0);try{for(const e of t){const s=await fetch(e);if(s.status!==200)continue;let i="application/octet-stream";switch(s.headers.has("Content-Type")&&(i=s.headers.get("Content-Type")),i){case"application/octet-stream":{const r=await s.arrayBuffer(),a=new _o(r);await this.processAsset(a.baseTexture,a.jsonFile);break}case"image/png":case"image/jpeg":case"image/gif":{const r=await s.arrayBuffer(),a=pg(r),o=Z_.from(`data:${i};base64,${a}`),h=async()=>{const _=new Ft(o);this.setTexture(e,_)};o.valid?await h():await new Promise((_,l)=>{o.once("update",async()=>(await h(),_()))});break}}}return Promise.resolve(!0)}catch(e){return j.error(e),Promise.resolve(!1)}}async processAsset(t,e){const s=e.spritesheet;if(!t||!s||!Object.keys(s).length){this.createCollection(e,null);return}const i=async()=>{const r=new Tg(t,s);await r.parse(),this.createCollection(e,r)};t.valid?await i():await new Promise((r,a)=>{t.once("update",async()=>(await i(),r()))})}get collections(){return this._collections}};gh._INSTANCE=new gh;let Ol=gh;const _s=()=>Ol._INSTANCE;class um{constructor(t,e,s){this.name=t,this.textures=e,this.durations=s}}const fh=class fh{};fh.UNKNOWN=0,fh.BROWSER=1;let Al=fh;const oa=class oa{};oa.UNKNOWN=0,oa.FLASH=1,oa.HTML5=2;let Sl=oa;const _n=class _n{};_n.CONNECTION_OPENED="open",_n.CONNECTION_CLOSED="close",_n.CONNECTION_ERROR="error",_n.CONNECTION_MESSAGE="message";let Ns=_n;const ha=class ha{static parseConfiguration(t,e=!1){if(!t)return!1;try{const s=new RegExp(/\${(.*?)}/g);for(const i in t){let r=t[i];typeof r=="string"&&(r=this.interpolate(r,s)),this._definitions.has(i)?e&&this.setValue(i,r):this.setValue(i,r)}return!0}catch(s){return j.error(s.stack),!1}}static interpolate(t,e=null){e||(e=new RegExp(/\${(.*?)}/g));const s=t.match(e);if(s&&s.length)for(const i of s){const r=this._definitions.get(this.removeInterpolateKey(i));r&&(t=t.replace(i,r))}return t}static removeInterpolateKey(t){return t.replace("${","").replace("}","")}static getValue(t,e=null){let s=this._definitions.get(t);if(s===void 0){if(this._missingKeys.indexOf(t)>=0)return e;this._missingKeys.push(t),j.warn(`Missing configuration key: ${t}`),s=e}return s}static setValue(t,e){const s=t.split(".");let i=this._config;for(let r=0;r<s.length;r++){const a=s[r].toString();if(r!==s.length-1){i[a]||(i[a]={}),i=i[a];continue}i[a]=e}this._definitions.set(t,e)}static get definitions(){return this._definitions}};ha._definitions=new Map,ha._config={},ha._missingKeys=[];let q=ha;const G=class G{static getExpressionTimeout(t){switch(t=parseInt(t),t){case 1:return 5e3;case 2:return 1400;case 3:return 2e3;case 4:return 2e3;case 5:return 0;case 6:return 700;case 7:return 2e3;case 8:return 1500;case 9:return 1500;case 10:return 1500;default:return 0}}static getExpressionId(t){return G.EXPRESSION_MAP.indexOf(t)}static getExpression(t){return t>G.EXPRESSION_MAP.length?null:G.EXPRESSION_MAP[t]}static getGestureId(t){return G.GESTURE_MAP.indexOf(t)}static getGesture(t){return t>G.GESTURE_MAP.length?null:G.GESTURE_MAP[t]}static idToAvatarActionState(t){return t==="Lay"?"lay":t==="Float"?"float":t==="Swim"?"swim":t==="Sit"?"sit":t==="Respect"?"respect":t==="Wave"?"wave":t==="Idle"?"idle":t==="Dance"?"dance":t==="UseItem"?"usei":t==="CarryItem"?"cri":t==="Talk"?"talk":t==="Sleep"?"Sleep":t==="Move"?"mv":"std"}};G.CARRY_OBJECT="cri",G.DANCE="dance",G.EFFECT="fx",G.EXPRESSION="expression",G.EXPRESSION_BLOW_A_KISS="blow",G.EXPRESSION_CRY="cry",G.EXPRESSION_IDLE="idle",G.EXPRESSION_LAUGH="laugh",G.EXPRESSION_RESPECT="respect",G.EXPRESSION_RIDE_JUMP="ridejump",G.EXPRESSION_SNOWBOARD_OLLIE="sbollie",G.EXPRESSION_SNOWBORD_360="sb360",G.EXPRESSION_WAVE="wave",G.GESTURE="gest",G.GESTURE_AGGRAVATED="agr",G.GESTURE_SAD="sad",G.GESTURE_SMILE="sml",G.GESTURE_SURPRISED="srp",G.GUIDE_STATUS="guide",G.MUTED="muted",G.PET_GESTURE_BLINK="eyb",G.PET_GESTURE_CRAZY="crz",G.PET_GESTURE_JOY="joy",G.PET_GESTURE_MISERABLE="mis",G.PET_GESTURE_PUZZLED="puz",G.PET_GESTURE_TONGUE="tng",G.PLAYING_GAME="playing_game",G.POSTURE="posture",G.POSTURE_FLOAT="float",G.POSTURE_LAY="lay",G.POSTURE_SIT="sit",G.POSTURE_STAND="std",G.POSTURE_SWIM="swim",G.POSTURE_WALK="mv",G.SIGN="sign",G.SLEEP="sleep",G.SNOWWAR_DIE_BACK="swdieback",G.SNOWWAR_DIE_FRONT="swdiefront",G.SNOWWAR_PICK="swpick",G.SNOWWAR_RUN="swrun",G.SNOWWAR_THROW="swthrow",G.TALK="talk",G.BLINK="blink",G.TYPING="typing",G.USE_OBJECT="usei",G.VOTE="vote",G.GESTURE_MAP=["",G.GESTURE_SMILE,G.GESTURE_AGGRAVATED,G.GESTURE_SURPRISED,G.GESTURE_SAD,G.PET_GESTURE_JOY,G.PET_GESTURE_CRAZY,G.PET_GESTURE_TONGUE,G.PET_GESTURE_BLINK,G.PET_GESTURE_MISERABLE,G.PET_GESTURE_PUZZLED],G.EXPRESSION_MAP=["",G.EXPRESSION_WAVE,G.EXPRESSION_BLOW_A_KISS,G.EXPRESSION_LAUGH,G.EXPRESSION_CRY,G.EXPRESSION_IDLE,G.DANCE,G.EXPRESSION_RESPECT,G.EXPRESSION_SNOWBOARD_OLLIE,G.EXPRESSION_SNOWBORD_360,G.EXPRESSION_RIDE_JUMP];let H=G;const ln=class ln{};ln.DIRECTION_TO_ANGLE=[45,90,135,180,225,270,315,0],ln.DIRECTION_IS_FLIPPED=[!1,!1,!1,!1,!0,!0,!0,!1],ln.MIN_DIRECTION=0,ln.MAX_DIRECTION=7;let Ki=ln;const ti=class ti{};ti.GENERIC="hd",ti.HEAD="head",ti.TORSO="torso",ti.LEGS="legs",ti.HOTLOOKS="hotlooks",ti.WARDROBE="wardrobe",ti.EFFECTS="effects";let GE=ti;const ht=class ht{};ht.BODY="bd",ht.SHOES="sh",ht.LEGS="lg",ht.CHEST="ch",ht.WAIST_ACCESSORY="wa",ht.CHEST_ACCESSORY="ca",ht.HEAD="hd",ht.HAIR="hr",ht.FACE_ACCESSORY="fa",ht.EYE_ACCESSORY="ea",ht.HEAD_ACCESSORY="ha",ht.HEAD_ACCESSORY_EXTRA="he",ht.COAT_CHEST="cc",ht.CHEST_PRINT="cp",ht.LEFT_HAND_ITEM="li",ht.LEFT_HAND="lh",ht.LEFT_SLEEVE="ls",ht.RIGHT_HAND="rh",ht.RIGHT_SLEEVE="rs",ht.FACE="fc",ht.EYES="ey",ht.HAIR_BIG="hrb",ht.RIGHT_HAND_ITEM="ri",ht.LEFT_COAT_SLEEVE="lc",ht.RIGHT_COAT_SLEEVE="rc",ht.FIGURE_SETS=[ht.SHOES,ht.LEGS,ht.CHEST,ht.WAIST_ACCESSORY,ht.CHEST_ACCESSORY,ht.HEAD,ht.HAIR,ht.FACE_ACCESSORY,ht.EYE_ACCESSORY,ht.HEAD_ACCESSORY,ht.HEAD_ACCESSORY_EXTRA,ht.COAT_CHEST,ht.CHEST_PRINT];let De=ht;const _a=class _a{};_a.NONE=0,_a.GUIDE=1,_a.REQUESTER=2;let Ws=_a;const Ih=class Ih{};Ih.LARGE="h",Ih.SMALL="sh";let Ks=Ih;const la=class la{};la.FULL="full",la.HEAD="head",la.BODY="body";let Ce=la;const dr=class dr{};dr.VERTICAL="vertical",dr.SITTING="sitting",dr.HORIZONTAL="horizontal",dr.SWIM="swim",dr.SNOWWARS_HORIZONTAL="swhorizontal";let Mi=dr;const ft=class ft{};ft.DOG=0,ft.CAT=1,ft.CROCODILE=2,ft.TERRIER=3,ft.BEAR=4,ft.PIG=5,ft.LION=6,ft.RHINO=7,ft.SPIDER=8,ft.TURTLE=9,ft.CHICKEN=10,ft.FROG=11,ft.DRAGON=12,ft.MONSTER=13,ft.MONKEY=14,ft.HORSE=15,ft.MONSTERPLANT=16,ft.BUNNY=17,ft.BUNNYEVIL=18,ft.BUNNYDEPRESSED=19,ft.BUNNYLOVE=20,ft.PIGEONGOOD=21,ft.PIGEONEVIL=22,ft.DEMONMONKEY=23,ft.BABYBEAR=24,ft.BABYTERRIER=25,ft.GNOME=26,ft.LEPRECHAUN=27,ft.KITTENBABY=28,ft.PUPPYBABY=29,ft.PIGLETNBABY=30,ft.HALOOMPA=31,ft.FOOLS=32,ft.PTEROSAUR=33,ft.VELOCIRAPTOR=34;let ja=ft;const Pi=class Pi{};Pi.NONE=0,Pi.HEART=1,Pi.SMILE=2,Pi.BOBBA=3,Pi.RELATIONSHIP_TYPES=[0,1,2,3],Pi.RELATIONSHIP_NAMES=["None","Heart","Smile","Bobba"];let Cl=Pi;const ei=class ei{};ei.HOTEL_VIEW="hotel_view",ei.HOME_ROOM="home_room",ei.NAVIGATOR="navigator",ei.CATALOG="catalog",ei.INVENTORY="inventory",ei.ME_MENU="me_menu",ei.FRIEND_LIST="friendlist";let Eo=ei;const Er=class Er{};Er.LOVE_LOCK=0,Er.CARVE_A_TREE=1,Er.FRIENDS_PORTRAIT=2,Er.WILD_WEST_WANTED=3,Er.HABBOWEEN=4;let go=Er;const Th=class Th{};Th.CATALOG="catalog",Th.INVENTORY="inventory";let Ml=Th;const N=class N{};N.OBJECT_ROOM_ID="object_room_id",N.OBJECT_ACCURATE_Z_VALUE="object_accurate_z_value",N.TILE_CURSOR_HEIGHT="tile_cursor_height",N.FIGURE="figure",N.GENDER="gender",N.OWN_USER="own_user",N.FIGURE_CAN_STAND_UP="figure_can_stand_up",N.FIGURE_VERTICAL_OFFSET="figure_vertical_offset",N.FIGURE_TALK="figure_talk",N.FIGURE_DANCE="figure_dance",N.FIGURE_SLEEP="figure_sleep",N.FIGURE_BLINK="figure_blink",N.FIGURE_EFFECT="figure_effect",N.FIGURE_CARRY_OBJECT="figure_carry_object",N.FIGURE_USE_OBJECT="figure_use_object",N.FIGURE_GESTURE="figure_gesture",N.FIGURE_POSTURE="figure_posture",N.FIGURE_POSTURE_PARAMETER="figure_posture_parameter",N.FIGURE_HIGHLIGHT_ENABLE="figure_highlight_enable",N.FIGURE_HIGHLIGHT="figure_highlight",N.FURNITURE_PURCHASER_NAME="furniture_purchaser_name",N.FURNITURE_PURCHASER_FIGURE="furniture_purchaser_figure",N.STD="std",N.FIGURE_SIGN="figure_sign",N.FIGURE_FLAT_CONTROL="figure_flat_control",N.FIGURE_IS_TYPING="figure_is_typing",N.FIGURE_IS_MUTED="figure_is_muted",N.FIGURE_GAINED_EXPERIENCE="figure_gained_experience",N.FIGURE_EXPERIENCE_TIMESTAMP="figure_experience_timestamp",N.FIGURE_NUMBER_VALUE="figure_number_value",N.FIGURE_IS_PLAYING_GAME="figure_is_playing_game",N.FIGURE_GUIDE_STATUS="figure_guide_status",N.FIGURE_EXPRESSION="figure_expression",N.HEAD_DIRECTION="head_direction",N.FURNITURE_CUSTOM_VARIABLES="furniture_custom_variables",N.FURNITURE_AUTOMATIC_STATE_INDEX="furniture_automatic_state_index",N.FURNITURE_ALWAYS_STACKABLE="furniture_always_stackable",N.FURNITURE_DISABLE_PICKING_ANIMATION="furniture_disable_picking_animation",N.FURNITURE_DATA_FORMAT="furniture_data_format",N.FURNITURE_UNIQUE_SERIAL_NUMBER="furniture_unique_serial_number",N.FURNITURE_UNIQUE_EDITION_SIZE="furniture_unique_edition_size",N.FURNITURE_CRACKABLE_STATE="furniture_crackable_state",N.FURNITURE_CRACKABLE_HITS="furniture_crackable_hits",N.FURNITURE_CRACKABLE_TARGET="furniture_crackable_target",N.FURNITURE_CREDIT_VALUE="furniture_credit_value",N.FURNITURE_DATA="furniture_data",N.FURNITURE_ITEMDATA="furniture_itemdata",N.FURNITURE_COLOR="furniture_color",N.FURNITURE_LIFT_AMOUNT="furniure_lift_amount",N.FURNITURE_GUILD_CUSTOMIZED_GUILD_ID="furniture_guild_customized_guild_id",N.FURNITURE_GUILD_CUSTOMIZED_ASSET_NAME="furniture_guild_customized_asset_name",N.FURNITURE_GUILD_CUSTOMIZED_COLOR_1="furniture_guild_customized_color_1",N.FURNITURE_GUILD_CUSTOMIZED_COLOR_2="furniture_guild_customized_color_2",N.FURNITURE_STATE_UPDATE_TIME="furniture_state_update_time",N.FURNITURE_SELECTION_DISABLED="furniture_selection_disabled",N.FURNITURE_SIZE_X="furniture_size_x",N.FURNITURE_SIZE_Y="furniture_size_y",N.FURNITURE_SIZE_Z="furniture_size_z",N.FURNITURE_CENTER_X="furniture_center_x",N.FURNITURE_CENTER_Y="furniture_center_y",N.FURNITURE_CENTER_Z="furniture_center_z",N.FURNITURE_ALLOWED_DIRECTIONS="furniture_allowed_directions",N.FURNITURE_AD_URL="furniture_ad_url",N.FURNITURE_TYPE_ID="furniture_type_id",N.FURNITURE_EXTRAS="furniture_extras",N.FURNITURE_EXPIRY_TIME="furniture_expiry_time",N.FURNITURE_EXPIRTY_TIMESTAMP="furniture_expiry_timestamp",N.FURNITURE_REAL_ROOM_OBJECT="furniture_real_room_object",N.FURNITURE_IS_STICKIE="furniture_is_stickie",N.FURNITURE_BRANDING_IMAGE_STATUS="furniture_branding_image_status",N.FURNITURE_BRANDING_IMAGE_URL="furniture_branding_image_url",N.FURNITURE_BRANDING_URL="furniture_branding_url",N.FURNITURE_BRANDING_OFFSET_X="furniture_branding_offset_x",N.FURNITURE_BRANDING_OFFSET_Y="furniture_branding_offset_y",N.FURNITURE_BRANDING_OFFSET_Z="furniture_branding_offset_z",N.FURNITURE_BRANDING_IS_ANIMATED="furniture_branding_is_animated",N.FURNITURE_BADGE_IMAGE_STATUS="furniture_badge_image_status",N.FURNITURE_BADGE_ASSET_NAME="furniture_badge_asset_name",N.FURNITURE_BADGE_VISIBLE_IN_STATE="furniture_badge_visible_in_state",N.FURNITURE_ALPHA_MULTIPLIER="furniture_alpha_multiplier",N.FURNITURE_USAGE_POLICY="furniture_usage_policy",N.FURNITURE_OWNER_ID="furniture_owner_id",N.FURNITURE_OWNER_NAME="furniture_owner_name",N.FURNITURE_ROOM_BACKGROUND_COLOR_HUE="furniture_room_background_color_hue",N.FURNITURE_ROOM_BACKGROUND_COLOR_SATURATION="furniture_room_background_color_saturation",N.FURNITURE_ROOM_BACKGROUND_COLOR_LIGHTNESS="furniture_room_background_color_lightness",N.FURNITURE_USES_PLANE_MASK="furniture_uses_plane_mask",N.FURNITURE_PLANE_MASK_TYPE="furniture_plane_mask_type",N.FURNITURE_IS_VARIABLE_HEIGHT="furniture_is_variable_height",N.FURNITURE_VOTE_MAJORITY_RESULT="furniture_vote_majority_result",N.FURNITURE_VOTE_COUNTER_COUNT="furniture_vote_counter_count",N.FURNITURE_SOUNDBLOCK_RELATIVE_ANIMATION_SPEED="furniture_soundblock_relative_animation_speed",N.FURNITURE_MANNEQUIN_NAME="furniture_mannequin_name",N.FURNITURE_MANNEQUIN_GENDER="furniture_mannequin_gender",N.FURNITURE_MANNEQUIN_FIGURE="furniture_mannequin_figure",N.FURNITURE_HIGHSCORE_SCORE_TYPE="furniture_highscore_score_type",N.FURNITURE_HIGHSCORE_CLEAR_TYPE="furniture_highscore_clear_type",N.FURNITURE_HIGHSCORE_DATA_ENTRY_COUNT="furniture_highscore_data_entry_count",N.FURNITURE_HIGHSCORE_DATA_ENTRY_BASE_USERS_="furniture_highscore_data_entry_base_users_",N.FURNITURE_HIGHSCORE_DATA_ENTRY_BASE_SCORE_="furniture_highscore_data_entry_base_score_",N.FURNITURE_INTERNAL_LINK="furniture_internal_link",N.FURNITURE_CLOTHING_BOY="furniture_clothing_boy",N.FURNITURE_CLOTHING_GIRL="furniture_clothing_girl",N.FURNITURE_PLANETSYSTEM_DATA="furniture_planetsystem_data",N.FURNITURE_FIREWORKS_DATA="furniture_fireworks_data",N.PET_PALETTE_INDEX="pet_palette_index",N.PET_COLOR="pet_color",N.PET_HEAD_ONLY="pet_head_only",N.PET_CUSTOM_LAYER_IDS="pet_custom_layer_ids",N.PET_CUSTOM_PARTS_IDS="pet_custom_part_ids",N.PET_CUSTOM_PALETTE_IDS="pet_custom_palette_ids",N.PET_IS_RIDING="pet_is_riding",N.PET_TYPE="pet_type",N.PET_ALLOWED_DIRECTIONS="pet_allowed_directions",N.RACE="race",N.ROOM_MAP_DATA="room_map_data",N.ROOM_PLANE_MASK_XML="room_plane_mask_xml",N.ROOM_FLOOR_TYPE="room_floor_type",N.ROOM_WALL_TYPE="room_wall_type",N.ROOM_LANDSCAPE_TYPE="room_landscape_type",N.ROOM_WALL_THICKNESS="room_wall_thickness",N.ROOM_FLOOR_THICKNESS="room_floor_thickness",N.ROOM_FLOOR_HOLE_UPDATE_TIME="room_floor_hole_update_time",N.ROOM_FLOOR_VISIBILITY="room_floor_visibility",N.ROOM_WALL_VISIBILITY="room_wall_visibility",N.ROOM_LANDSCAPE_VISIBILITY="room_landscape_visibility",N.ROOM_DOOR_X="room_door_x",N.ROOM_DOOR_Y="room_door_y",N.ROOM_DOOR_Z="room_door_z",N.ROOM_DOOR_DIR="room_door_dir",N.ROOM_BACKGROUND_COLOR="room_background_color",N.ROOM_COLORIZE_BG_ONLY="room_colorize_bg_only",N.ROOM_RANDOM_SEED="room_random_seed",N.ROOM_WORLD_TYPE="room_world_type",N.ROOM_SELECTED_X="room_selected_x",N.ROOM_SELECTED_Y="room_selected_y",N.ROOM_SELECTED_Z="room_selected_z",N.ROOM_SELECTED_PLANE="room_selected_plane",N.IMAGE_QUERY_SCALE="image_query_scale",N.FURNITURE_FRIENDFURNI_ENGRAVING="furniture_friendfurni_engraving_type",N.SESSION_URL_PREFIX="session_url_prefix",N.SESSION_CURRENT_USER_ID="session_current_user_id";let g=N;const iE=class iE{};iE.UNIQUE_SET=256;let Nl=iE;class ir{constructor(){this._flags=0,this._uniqueNumber=0,this._uniqueSeries=0}parseWrapper(t){(this._flags&Nl.UNIQUE_SET)>0&&(this._uniqueNumber=t.readInt(),this._uniqueSeries=t.readInt())}initializeFromRoomObjectModel(t){this._uniqueNumber=t.getValue(g.FURNITURE_UNIQUE_SERIAL_NUMBER),this._uniqueSeries=t.getValue(g.FURNITURE_UNIQUE_EDITION_SIZE)}writeRoomObjectModel(t){t&&(t.setValue(g.FURNITURE_UNIQUE_SERIAL_NUMBER,this._uniqueNumber),t.setValue(g.FURNITURE_UNIQUE_EDITION_SIZE,this._uniqueSeries))}getLegacyString(){return""}compare(t){return!1}get state(){const t=parseInt(this.getLegacyString());return isNaN(t)?0:t}get isUnique(){return this._uniqueSeries>0}get uniqueNumber(){return this._uniqueNumber}set uniqueNumber(t){this._uniqueNumber=t}get uniqueSeries(){return this._uniqueSeries}set uniqueSeries(t){this._uniqueSeries=t}get rarityLevel(){return-1}get flags(){return this._flags}set flags(t){this._flags=t}}const Ls=class Ls{};Ls.LEGACY_KEY=0,Ls.MAP_KEY=1,Ls.STRING_KEY=2,Ls.VOTE_KEY=3,Ls.EMPTY_KEY=4,Ls.NUMBER_KEY=5,Ls.HIGHSCORE_KEY=6,Ls.CRACKABLE_KEY=7;let qs=Ls;const mh=class mh extends ir{constructor(){super(),this._state="",this._hits=0,this._target=0}parseWrapper(t){t&&(this._state=t.readString(),this._hits=t.readInt(),this._target=t.readInt(),super.parseWrapper(t))}initializeFromRoomObjectModel(t){super.initializeFromRoomObjectModel(t),this._state=t.getValue(g.FURNITURE_CRACKABLE_STATE),this._hits=t.getValue(g.FURNITURE_CRACKABLE_HITS),this._target=t.getValue(g.FURNITURE_CRACKABLE_TARGET)}writeRoomObjectModel(t){super.writeRoomObjectModel(t),t.setValue(g.FURNITURE_DATA_FORMAT,mh.FORMAT_KEY),t.setValue(g.FURNITURE_CRACKABLE_STATE,this._state),t.setValue(g.FURNITURE_CRACKABLE_HITS,this._hits),t.setValue(g.FURNITURE_CRACKABLE_TARGET,this._target)}getLegacyString(){return this._state}compare(t){return!0}get hits(){return this._hits}get target(){return this._target}};mh.FORMAT_KEY=qs.CRACKABLE_KEY;let fo=mh;const ph=class ph extends ir{parseWrapper(t){t&&(this._state="",super.parseWrapper(t))}writeRoomObjectModel(t){super.writeRoomObjectModel(t),t.setValue(g.FURNITURE_DATA_FORMAT,ph.FORMAT_KEY)}getLegacyString(){return this._state}compare(t){return super.compare(t)}};ph.FORMAT_KEY=qs.EMPTY_KEY;let Io=ph;class BE{constructor(){this._score=-1,this._users=[]}get score(){return this._score}set score(t){this._score=t}get users(){return this._users}set users(t){this._users=t}addUsername(t){this._users.push(t)}}const Rh=class Rh extends ir{constructor(){super(),this._state="",this._scoreType=-1,this._clearType=-1,this._entries=[]}parseWrapper(t){if(!t)return;this._state=t.readString(),this._scoreType=t.readInt(),this._clearType=t.readInt();let e=t.readInt();for(;e>0;){const s=new BE;s.score=t.readInt();let i=t.readInt();for(;i>0;)s.addUsername(t.readString()),i--;this._entries.push(s),e--}super.parseWrapper(t)}initializeFromRoomObjectModel(t){this._scoreType=t.getValue(g.FURNITURE_HIGHSCORE_SCORE_TYPE),this._clearType=t.getValue(g.FURNITURE_HIGHSCORE_CLEAR_TYPE),this._entries=[];const e=t.getValue(g.FURNITURE_HIGHSCORE_DATA_ENTRY_COUNT);let s=0;for(;s<e;){const i=new BE;i.score=t.getValue(g.FURNITURE_HIGHSCORE_DATA_ENTRY_BASE_SCORE_+s),i.users=t.getValue(g.FURNITURE_HIGHSCORE_DATA_ENTRY_BASE_USERS_+s),this._entries.push(i),s++}super.initializeFromRoomObjectModel(t)}writeRoomObjectModel(t){if(super.writeRoomObjectModel(t),t.setValue(g.FURNITURE_DATA_FORMAT,Rh.FORMAT_KEY),t.setValue(g.FURNITURE_HIGHSCORE_SCORE_TYPE,this._scoreType),t.setValue(g.FURNITURE_HIGHSCORE_CLEAR_TYPE,this._clearType),this._entries){t.setValue(g.FURNITURE_HIGHSCORE_DATA_ENTRY_COUNT,this._entries.length);let e=0;for(;e<this._entries.length;){const s=this._entries[e];t.setValue(g.FURNITURE_HIGHSCORE_DATA_ENTRY_BASE_SCORE_+e,s.score),t.setValue(g.FURNITURE_HIGHSCORE_DATA_ENTRY_BASE_USERS_+e,s.users),e++}}}getLegacyString(){return this._state}get entries(){return this._entries}get clearType(){return this._clearType}get scoreType(){return this._scoreType}};Rh.FORMAT_KEY=qs.HIGHSCORE_KEY;let To=Rh;const Oh=class Oh extends ir{constructor(){super(),this._data=""}parseWrapper(t){t&&(this._data=t.readString(),super.parseWrapper(t))}initializeFromRoomObjectModel(t){super.initializeFromRoomObjectModel(t),this._data=t.getValue(g.FURNITURE_DATA)}writeRoomObjectModel(t){super.writeRoomObjectModel(t),t.setValue(g.FURNITURE_DATA_FORMAT,Oh.FORMAT_KEY),t.setValue(g.FURNITURE_DATA,this._data)}getLegacyString(){return this._data}compare(t){return this._data===t.getLegacyString()}setString(t){this._data=t}};Oh.FORMAT_KEY=qs.LEGACY_KEY;let Ne=Oh;const Ui=class Ui extends ir{constructor(){super(),this._data={}}parseWrapper(t){if(!t)return;this._data={};const e=t.readInt();if(e)for(let s=0;s<e;s++)this._data[t.readString()]=t.readString();super.parseWrapper(t)}initializeFromRoomObjectModel(t){super.initializeFromRoomObjectModel(t),this._data=t.getValue(g.FURNITURE_DATA)||{}}writeRoomObjectModel(t){super.writeRoomObjectModel(t),t.setValue(g.FURNITURE_DATA_FORMAT,Ui.FORMAT_KEY),t.setValue(g.FURNITURE_DATA,this._data)}getLegacyString(){if(!this._data)return"";const t=this._data[Ui.STATE];return t??""}compare(t){return!1}getValue(t){return this._data[t]}get rarityLevel(){if(!this._data)return-1;const t=this._data[Ui.RARITY];return t==null?-1:parseInt(t)}get data(){return this._data}};Ui.FORMAT_KEY=qs.MAP_KEY,Ui.STATE="state",Ui.RARITY="rarity";let wr=Ui;const gr=class gr extends ir{constructor(){super(),this._data=[]}parseWrapper(t){if(!t)return;this._data=[];const e=t.readInt();if(e)for(let s=0;s<e;s++)this._data.push(t.readInt());super.parseWrapper(t)}initializeFromRoomObjectModel(t){super.initializeFromRoomObjectModel(t),this._data=t.getValue(g.FURNITURE_DATA)}writeRoomObjectModel(t){super.writeRoomObjectModel(t),t.setValue(g.FURNITURE_DATA_FORMAT,gr.FORMAT_KEY),t.setValue(g.FURNITURE_DATA,this._data)}getLegacyString(){return!this._data||!this._data.length?"":this._data[gr.STATE].toString()}compare(t){if(!(t instanceof gr))return!1;let e=0;for(;e<this._data.length;){if(e!==0){if(this._data[e]!==t.getValue(e))return!1}e++}return!0}getValue(t){if(!this._data||!this._data.length)return-1;const e=this._data[t];return e??-1}};gr.FORMAT_KEY=qs.NUMBER_KEY,gr.STATE=0;let za=gr;const fr=class fr extends ir{constructor(){super(),this._data=[]}parseWrapper(t){if(!t)return;this._data=[];const e=t.readInt();if(e)for(let s=0;s<e;s++)this._data.push(t.readString());super.parseWrapper(t)}initializeFromRoomObjectModel(t){super.initializeFromRoomObjectModel(t),this._data=t.getValue(g.FURNITURE_DATA)}writeRoomObjectModel(t){super.writeRoomObjectModel(t),t.setValue(g.FURNITURE_DATA_FORMAT,fr.FORMAT_KEY),t.setValue(g.FURNITURE_DATA,this._data)}getLegacyString(){return!this._data||!this._data.length?"":this._data[fr.STATE]}compare(t){if(!(t instanceof fr))return!1;let e=0;for(;e<this._data.length;){if(e!==0){if(this._data[e]!==t.getValue(e))return!1}e++}return!0}getValue(t){return this._data[t]||""}setValue(t){this._data=t}};fr.FORMAT_KEY=qs.STRING_KEY,fr.STATE=0;let Vn=fr;const Ah=class Ah extends ir{constructor(){super(),this._state="",this._result=0}parseWrapper(t){t&&(this._state=t.readString(),this._result=t.readInt(),super.parseWrapper(t))}writeRoomObjectModel(t){super.writeRoomObjectModel(t),t.setValue(g.FURNITURE_DATA_FORMAT,Ah.FORMAT_KEY);const e={};e.S=this._state,e.R=this._result.toString(),t.setValue(g.FURNITURE_DATA,e)}getLegacyString(){return this._state}compare(t){return!0}setString(t){this._state=t}get result(){return this._result}};Ah.FORMAT_KEY=qs.VOTE_KEY;let Wa=Ah;class Xi{static getData(t){let e=null;switch(t&255){case fo.FORMAT_KEY:e=new fo;break;case Io.FORMAT_KEY:e=new Io;break;case To.FORMAT_KEY:e=new To;break;case Ne.FORMAT_KEY:e=new Ne;break;case wr.FORMAT_KEY:e=new wr;break;case za.FORMAT_KEY:e=new za;break;case Vn.FORMAT_KEY:e=new Vn;break;case Wa.FORMAT_KEY:e=new Wa;break}return e?(e.flags=t&65280,e):null}}const yi=class yi{};yi.MINIMUM=-2,yi.ROOM=0,yi.FLOOR=10,yi.WALL=20,yi.UNIT=100,yi.CURSOR=200;let M=yi;const w=class w{};w.FURNITURE_BASIC="furniture_basic",w.FURNITURE_MULTISTATE="furniture_multistate",w.FURNITURE_MULTIHEIGHT="furniture_multiheight",w.FURNITURE_RANDOMSTATE="furniture_randomstate",w.FURNITURE_PLACEHOLDER="furniture_placeholder",w.FURNITURE_CREDIT="furniture_credit",w.FURNITURE_STICKIE="furniture_stickie",w.FURNITURE_PRESENT="furniture_present",w.FURNITURE_TROPHY="furniture_trophy",w.FURNITURE_ECOTRON_BOX="furniture_ecotron_box",w.FURNITURE_DICE="furniture_dice",w.FURNITURE_HOCKEY_SCORE="furniture_hockey_score",w.FURNITURE_HABBOWHEEL="furniture_habbowheel",w.FURNITURE_ONE_WAY_DOOR="furniture_one_way_door",w.FURNITURE_PLANET_SYSTEM="furniture_planet_system",w.FURNITURE_WINDOW="furniture_window",w.FURNITURE_EXTERNAL_IMAGE_WALLITEM="furniture_external_image_wallitem",w.FURNITURE_ROOMDIMMER="furniture_roomdimmer",w.FURNITURE_SOUND_MACHINE="furniture_sound_machine",w.FURNITURE_JUKEBOX="furniture_jukebox",w.FURNITURE_CRACKABLE="furniture_crackable",w.FURNITURE_PUSHABLE="furniture_pushable",w.FURNITURE_CLOTHING_CHANGE="furniture_clothing_change",w.FURNITURE_COUNTER_CLOCK="furniture_counter_clock",w.FURNITURE_SCORE="furniture_score",w.FURNITURE_ES="furniture_es",w.FURNITURE_FIREWORKS="furniture_fireworks",w.FURNITURE_SONG_DISK="furniture_song_disk",w.FURNITURE_BB="furniture_bb",w.FURNITURE_BG="furniture_bg",w.FURNITURE_WELCOME_GIFT="furniture_welcome_gift",w.FURNITURE_FLOOR_HOLE="furniture_floor_hole",w.FURNITURE_MANNEQUIN="furniture_mannequin",w.FURNITURE_GUILD_CUSTOMIZED="furniture_guild_customized",w.FURNITURE_GROUP_FORUM_TERMINAL="furniture_group_forum_terminal",w.FURNITURE_PET_CUSTOMIZATION="furniture_pet_customization",w.FURNITURE_CUCKOO_CLOCK="furniture_cuckoo_clock",w.FURNITURE_VOTE_COUNTER="furniture_vote_counter",w.FURNITURE_VOTE_MAJORITY="furniture_vote_majority",w.FURNITURE_SOUNDBLOCK="furniture_soundblock",w.FURNITURE_RANDOM_TELEPORT="furniture_random_teleport",w.FURNITURE_MONSTERPLANT_SEED="furniture_monsterplant_seed",w.FURNITURE_PURCHASABLE_CLOTHING="furniture_purchasable_clothing",w.FURNITURE_BACKGROUND_COLOR="furniture_background_color",w.FURNITURE_MYSTERYBOX="furniture_mysterybox",w.FURNITURE_EFFECTBOX="furniture_effectbox",w.FURNITURE_MYSTERYTROPHY="furniture_mysterytrophy",w.FURNITURE_ACHIEVEMENT_RESOLUTION="furniture_achievement_resolution",w.FURNITURE_LOVELOCK="furniture_lovelock",w.FURNITURE_WILDWEST_WANTED="furniture_wildwest_wanted",w.FURNITURE_HWEEN_LOVELOCK="furniture_hween_lovelock",w.FURNITURE_BADGE_DISPLAY="furniture_badge_display",w.FURNITURE_HIGH_SCORE="furniture_high_score",w.FURNITURE_INTERNAL_LINK="furniture_internal_link",w.FURNITURE_CUSTOM_STACK_HEIGHT="furniture_custom_stack_height",w.FURNITURE_YOUTUBE="furniture_youtube",w.FURNITURE_RENTABLE_SPACE="furniture_rentable_space",w.FURNITURE_CHANGE_STATE_WHEN_STEP_ON="furniture_change_state_when_step_on",w.FURNITURE_VIMEO="furniture_vimeo",w.FURNITURE_EDITABLE_INTERNAL_LINK="furniture_editable_internal_link",w.FURNITURE_EDITABLE_ROOM_LINK="furniture_editable_room_link",w.FURNITURE_CRAFTING_GIZMO="furniture_crafting_gizmo",w.ROOM="room",w.USER="user",w.BOT="bot",w.RENTABLE_BOT="rentable_bot",w.PET="pet",w.TILE_CURSOR="tile_cursor",w.SELECTION_ARROW="selection_arrow",w.GAME_SNOWBALL="game_snowball",w.GAME_SNOWSPLASH="game_snowsplash";let Y=w;const Le=class Le{};Le.OBJECT_UNDEFINED="OBJECT_UNDEFINED",Le.OBJECT_MOVE="OBJECT_MOVE",Le.OBJECT_PLACE="OBJECT_PLACE",Le.OBJECT_ROTATE_POSITIVE="OBJECT_ROTATE_POSITIVE",Le.OBJECT_ROTATE_NEGATIVE="OBJECT_ROTATE_NEGATIVE",Le.OBJECT_MOVE_TO="OBJECT_MOVE_TO",Le.OBJECT_PLACE_TO="OBJECT_PLACE_TO",Le.OBJECT_PICKUP="OBJECT_PICKUP",Le.OBJECT_PICKUP_BOT="OBJECT_PICKUP_BOT",Le.OBJECT_PICKUP_PET="OBJECT_PICKUP_PET",Le.OBJECT_EJECT="OBJECT_EJECT",Le.OBJECT_SAVE_STUFF_DATA="OBJECT_SAVE_STUFF_DATA";let lt=Le;const cn=class cn{};cn.USER=1,cn.PET=2,cn.BOT=3,cn.RENTABLE_BOT=4;let fi=cn;const Pe=class Pe{static getTypeNumber(t){return Pe.AVATAR_TYPES[t]}static getTypeString(t){for(const e in Pe.AVATAR_TYPES)if(e&&Pe.AVATAR_TYPES[e]===t)return e;return null}static getRealType(t){switch(t){case Pe.BOT:case Pe.RENTABLE_BOT:return Pe.USER;default:return t}}};Pe.USER="user",Pe.PET="pet",Pe.BOT="bot",Pe.RENTABLE_BOT="rentable_bot",Pe.MONSTER_PLANT="monsterplant",Pe.AVATAR_TYPES={user:1,pet:2,bot:3,rentable_bot:4};let pt=Pe;const ct=class ct{};ct.FURNITURE_STATIC="furniture_static",ct.FURNITURE_ANIMATED="furniture_animated",ct.FURNITURE_RESETTING_ANIMATED="furniture_resetting_animated",ct.FURNITURE_POSTER="furniture_poster",ct.FURNITURE_EXTERNAL_IMAGE="furniture_external_image",ct.FURNITURE_HABBOWHEEL="furniture_habbowheel",ct.FURNITURE_VAL_RANDOMIZER="furniture_val_randomizer",ct.FURNITURE_BOTTLE="furniture_bottle",ct.FURNITURE_PLANET_SYSTEM="furniture_planet_system",ct.FURNITURE_QUEUE_TILE="furniture_queue_tile",ct.FURNITURE_PARTY_BEAMER="furniture_party_beamer",ct.FURNITURE_CUBOID="furniture_cuboid",ct.FURNITURE_GIFT_WRAPPED="furniture_gift_wrapped",ct.FURNITURE_GIFT_WRAPPED_FIREWORKS="furniture_gift_wrapped_fireworks",ct.FURNITURE_COUNTER_CLOCK="furniture_counter_clock",ct.FURNITURE_WATER_AREA="furniture_water_area",ct.FURNITURE_SCORE_BOARD="furniture_score_board",ct.FURNITURE_FIREWORKS="furniture_fireworks",ct.FURNITURE_BB="furniture_bb",ct.FURNITURE_ISOMETRIC_BB="furniture_isometric_bb",ct.FURNITURE_BG="furniture_bg",ct.FURNITURE_STICKIE="furniture_stickie",ct.FURNITURE_MANNEQUIN="furniture_mannequin",ct.FURNITURE_GUILD_CUSTOMIZED="furniture_guild_customized",ct.FURNITURE_GUILD_ISOMETRIC_BADGE="furniture_guild_isometric_badge",ct.FURNITURE_VOTE_COUNTER="furniture_vote_counter",ct.FURNITURE_VOTE_MAJORITY="furniture_vote_majority",ct.FURNITURE_SOUNDBLOCK="furniture_soundblock",ct.FURNITURE_BADGE_DISPLAY="furniture_badge_display",ct.FURNITURE_YOUTUBE="furniture_youtube",ct.FURNITURE_BUILDER_PLACEHOLDER="furniture_builder_placeholder",ct.ROOM="room",ct.USER="user",ct.PET_ANIMATED="pet_animated",ct.BOT="bot",ct.RENTABLE_BOT="rentable_bot",ct.TILE_CURSOR="tile_cursor";let x=ct;const Sh=class Sh{constructor(t,e,s,i=null){this._id=t,this._location=e,this._targetLocation=s,this._movementType=i}get id(){return this._id}get location(){return this._location}get targetLocation(){return this._targetLocation}get movementType(){return this._movementType}};Sh.MOVE="mv",Sh.SLIDE="sld";let di=Sh;const Ch=class Ch{};Ch.KICKED_OUT_OF_ROOM=4008,Ch.STRIP_LOCKED_FOR_TRADING=-13001;let Dl=Ch;const ca=class ca{};ca.OLD_IDENTITY=0,ca.NEW_IDENTITY=1,ca.REAL_NOOB=2;let Zn=ca;const vi=class vi{};vi.NONE=0,vi.GUEST=1,vi.GUILD_MEMBER=2,vi.GUILD_ADMIN=3,vi.ROOM_OWNER=4,vi.MODERATOR=5;let Ii=vi;const bi=class bi{static getLocalizationKey(t){switch(t){case bi.FREE_TRADING:return"${trading.mode.free}";case bi.ROOM_CONTROLLER_REQUIRED:return"${trading.mode.controller}";case bi.NO_TRADING:return"${trading.mode.not.allowed}"}return""}};bi.NO_TRADING=0,bi.ROOM_CONTROLLER_REQUIRED=1,bi.FREE_TRADING=2;let Ll=bi;const ts=class ts{};ts.SUPER_USER=9,ts.ADMINISTRATOR=8,ts.COMMUNITY=7,ts.PLAYER_SUPPORT=6,ts.MODERATOR=5,ts.EMPLOYEE=4,ts.BUS_PARTNER=3,ts.PARTNER=2,ts.CELEBRITY=1,ts.NONE=0;let Pl=ts;var vr=(n=>(n.FLOOR="S",n.WALL="I",n.EFFECT="E",n.BADGE="B",n.ROBOT="R",n.HABBO_CLUB="H",n.PET="P",n))(vr||{});const ua=class ua{};ua.MATCH_ALL_PIXELS=-1,ua.MATCH_OPAQUE_PIXELS=128,ua.MATCH_NOTHING=256;let Os=ua;const un=class un{};un.DEFAULT=1,un.ROOM_PLANE=2,un.AVATAR=3,un.AVATAR_OWN=4;let Je=un;class Og{}class R{constructor(t=0,e=0,s=0){this._x=t,this._y=e,this._z=s,this._length=NaN}static sum(t,e){return!t||!e?null:new R(t.x+e.x,t.y+e.y,t.z+e.z)}static dif(t,e){return!t||!e?null:new R(t.x-e.x,t.y-e.y,t.z-e.z)}static product(t,e){return t?new R(t.x*e,t.y*e,t.z*e):null}static dotProduct(t,e){return!t||!e?0:t.x*e.x+t.y*e.y+t.z*e.z}static crossProduct(t,e){return!t||!e?null:new R(t.y*e.z-t.z*e.y,t.z*e.x-t.x*e.z,t.x*e.y-t.y*e.x)}static scalarProjection(t,e){if(!t||!e)return-1;const s=e.length;return s>0?(t.x*e.x+t.y*e.y+t.z*e.z)/s:-1}static cosAngle(t,e){if(!t||!e)return 0;const s=t.length*e.length;return s?R.dotProduct(t,e)/s:0}static isEqual(t,e){return!(!t||!e||t.x!==e.x||t.y!==e.y||t.z!==e.z)}negate(){this._x=-this._x,this._y=-this._y,this._z=-this._z}add(t){t&&(this._x+=t.x,this._y+=t.y,this._z+=t.z,this._length=NaN)}subtract(t){t&&(this._x-=t.x,this._y-=t.y,this._z-=t.z,this._length=NaN)}multiply(t){this._x*=t,this._y*=t,this._z*=t,this._length=NaN}divide(t){t&&(this._x/=t,this._y/=t,this._z/=t,this._length=NaN)}assign(t){t&&(this._x=t.x,this._y=t.y,this._z=t.z,this._length=NaN)}get x(){return this._x}set x(t){this._x=t,this._length=NaN}get y(){return this._y}set y(t){this._y=t,this._length=NaN}get z(){return this._z}set z(t){this._z=t,this._length=NaN}get length(){return isNaN(this._length)&&(this._length=Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z)),this._length}toString(){return`[Vector3d: ${this._x}, ${this._y}, ${this._z}]`}}const gs=class gs{};gs.MOUSE_CLICK="click",gs.DOUBLE_CLICK="double_click",gs.MOUSE_MOVE="mousemove",gs.MOUSE_DOWN="mousedown",gs.MOUSE_DOWN_LONG="mousedown_long",gs.MOUSE_UP="mouseup",gs.ROLL_OVER="mouseover",gs.ROLL_OUT="mouseout",gs.RIGHT_CLICK="contextmenu";let z=gs;const Ir=class Ir{};Ir.TOUCH_START="touchstart",Ir.TOUCH_MOVE="touchmove",Ir.TOUCH_CANCEL="touchcancel",Ir.TOUCH_END="touchend",Ir.TOUCH_LONG="touchlong";let wE=Ir;const ee=class ee{constructor(t){this._ordinal=t}get ordinal(){return this._ordinal}equals(t){return t&&t._ordinal==this._ordinal}};ee.NONE=new ee(0),ee.WAVE=new ee(1),ee.BLOW=new ee(2),ee.LAUGH=new ee(3),ee.CRY=new ee(4),ee.IDLE=new ee(5),ee.JUMP=new ee(6),ee.RESPECT=new ee(7);let VE=ee;const fs=class fs{};fs.DUMMY="DUMMY",fs.FRIEND_FURNITURE="FRIEND_FURNITURE",fs.MONSTERPLANT_SEED="MONSTERPLANT_SEED",fs.MYSTERY_BOX="MYSTERY_BOX",fs.EFFECT_BOX="EFFECT_BOX",fs.MYSTERY_TROPHY="MYSTERY_TROPHY",fs.RANDOM_TELEPORT="RANDOM_TELEPORT",fs.PURCHASABLE_CLOTHING="PURCHASABLE_CLOTHING",fs.GENERIC_USABLE="GENERIC_USABLE";let Qs=fs;const k=class k{};k.CHAT_WIDGET="RWE_CHAT_WIDGET",k.INFOSTAND="RWE_INFOSTAND",k.ME_MENU="RWE_ME_MENU",k.CHAT_INPUT_WIDGET="RWE_CHAT_INPUT_WIDGET",k.FURNI_PLACEHOLDER="RWE_FURNI_PLACEHOLDER",k.FURNI_CREDIT_WIDGET="RWE_FURNI_CREDIT_WIDGET",k.FURNI_STICKIE_WIDGET="RWE_FURNI_STICKIE_WIDGET",k.FURNI_TROPHY_WIDGET="RWE_FURNI_TROPHY_WIDGET",k.FURNI_LOVELOCK_WIDGET="RWE_FURNI_LOVELOCK_WIDGET",k.FURNI_PRESENT_WIDGET="RWE_FURNI_PRESENT_WIDGET",k.FURNI_ECOTRONBOX_WIDGET="RWE_FURNI_ECOTRONBOX_WIDGET",k.FURNI_PET_PACKAGE_WIDGET="RWE_FURNI_PET_PACKAGE_WIDGET",k.PLAYLIST_EDITOR_WIDGET="RWE_PLAYLIST_EDITOR_WIDGET",k.DOORBELL="RWE_DOORBELL",k.LOADINGBAR="RWE_LOADINGBAR",k.ROOM_QUEUE="RWE_ROOM_QUEUE",k.ROOM_POLL="RWE_ROOM_POLL",k.ROOM_VOTE="RWE_ROOM_VOTE",k.USER_CHOOSER="RWE_USER_CHOOSER",k.FURNI_CHOOSER="RWE_FURNI_CHOOSER",k.ROOM_DIMMER="RWE_ROOM_DIMMER",k.FRIEND_REQUEST="RWE_FRIEND_REQUEST",k.CLOTHING_CHANGE="RWE_CLOTHING_CHANGE",k.CONVERSION_TRACKING="RWE_CONVERSION_TRACKING",k.USER_NOTIFICATION="RWE_USER_NOTIFICATION",k.FRIENDS_BAR="RWE_FRIENDS_BAR",k.PURSE_WIDGET="RWE_PURSE_WIDGET",k.AVATAR_INFO="RWE_AVATAR_INFO",k.WELCOME_GIFT="RWE_WELCOME_GIFT",k.SPAMWALL_POSTIT_WIDGET="RWE_SPAMWALL_POSTIT_WIDGET",k.EFFECTS="RWE_EFFECTS",k.MANNEQUIN="RWE_MANNEQUIN",k.FURNITURE_CONTEXT_MENU="RWE_FURNITURE_CONTEXT_MENU",k.LOCATION_WIDGET="RWE_LOCATION_WIDGET",k.CAMERA="RWE_CAMERA",k.ROOM_THUMBNAIL_CAMERA="RWE_ROOM_THUMBNAIL_CAMERA",k.ROOM_BACKGROUND_COLOR="RWE_ROOM_BACKGROUND_COLOR",k.CUSTOM_USER_NOTIFICATION="RWE_CUSTOM_USER_NOTIFICATION",k.FURNI_ACHIEVEMENT_RESOLUTION_ENGRAVING="RWE_FURNI_ACHIEVEMENT_RESOLUTION_ENGRAVING",k.FRIEND_FURNI_CONFIRM="RWE_FRIEND_FURNI_CONFIRM",k.FRIEND_FURNI_ENGRAVING="RWE_FRIEND_FURNI_ENGRAVING",k.HIGH_SCORE_DISPLAY="RWE_HIGH_SCORE_DISPLAY",k.INTERNAL_LINK="RWE_INTERNAL_LINK",k.CUSTOM_STACK_HEIGHT="RWE_CUSTOM_STACK_HEIGHT",k.YOUTUBE="RWE_YOUTUBE",k.RENTABLESPACE="RWE_RENTABLESPACE",k.VIMEO="RWE_VIMEO",k.ROOM_TOOLS="RWE_ROOM_TOOLS",k.EXTERNAL_IMAGE="RWE_EXTERNAL_IMAGE",k.WORD_QUIZZ="RWE_WORD_QUIZZ",k.UI_HELP_BUBBLE="RWE_UI_HELP_BUBBLE",k.ROOM_LINK="RWE_ROOM_LINK",k.CRAFTING="RWE_CRAFTING",k.ROOMGAME_CHECKERS="RWE_GAME_CHECKERS";let mo=k;const si=class si{};si.INFOSTAND_EXTRA_PARAM="RWEIEP_INFOSTAND_EXTRA_PARAM",si.JUKEBOX="RWEIEP_JUKEBOX",si.USABLE_PRODUCT="RWEIEP_USABLE_PRODUCT",si.SONGDISK="RWEIEP_SONGDISK",si.CRACKABLE_FURNI="RWEIEP_CRACKABLE_FURNI",si.BRANDING_OPTIONS="RWEIEP_BRANDING_OPTIONS",si.USABLE="RWEIEP_USABLE";let Ve=si;const da=class da{};da.NOBODY=0,da.CONTROLLER=1,da.EVERYBODY=2;let YE=da;const Ea=class Ea{};Ea.NORMAL=0,Ea.GENERIC=1,Ea.BOT=2;let ar=Ea;class Ye{constructor(){this._isDisposed=!1,this._isDisposing=!1}dispose(){this._isDisposed||this._isDisposing||(this._isDisposing=!0,this.onDispose(),this._isDisposed=!0,this._isDisposing=!1)}onDispose(){}get disposed(){return this._isDisposed}get isDisposing(){return this._isDisposing}}class $e extends Ye{constructor(){super(),this._listeners=new Map}onDispose(){this.removeAllListeners(),super.onDispose()}addEventListener(t,e){if(!t||!e)return;const s=this._listeners.get(t);if(!s){this._listeners.set(t,[e]);return}s.push(e)}removeEventListener(t,e){if(!t||!e)return;const s=this._listeners.get(t);if(!(!s||!s.length)){for(const[i,r]of s.entries())if(!(!r||r!==e)){s.splice(i,1),s.length||this._listeners.delete(t);return}}}dispatchEvent(t){return t?(j.events("Dispatched Event",t.type),this.processEvent(t),!0):!1}processEvent(t){const e=this._listeners.get(t.type);if(!e||!e.length)return;const s=[];for(const i of e)i&&s.push(i);for(;s.length;){const i=s.shift();try{i(t)}catch(r){j.error(r.stack);return}}}removeAllListeners(){this._listeners.clear()}}class Js extends Ye{constructor(){super(),this._events=new $e,this._isLoaded=!1,this._isLoading=!1}init(){this._isLoaded||this._isLoading||this.isDisposing||(this._isLoading=!0,this.onInit(),this._isLoaded=!0,this._isLoading=!1)}onInit(){}onDispose(){this._events&&this._events.dispose(),super.onDispose()}reload(){this.dispose(),this.init()}get events(){return this._events}get isLoaded(){return this._isLoaded}get isLoading(){return this._isLoading}}class dm{constructor(t){this._value=t}get value(){return this._value}}class Em{constructor(t,e){this._header=t,this._buffer=e}readBytes(t){return this._buffer?this._buffer.readBytes(t):null}readByte(){return this._buffer?this._buffer.readByte():-1}readBoolean(){return this.readByte()===1}readShort(){return this._buffer?this._buffer.readShort():-1}readInt(){return this._buffer?this._buffer.readInt():-1}readFloat(){return this._buffer?this._buffer.readFloat():-1}readDouble(){return this._buffer?this._buffer.readDouble():-1}readString(){const t=this.readShort();return this._buffer.readBytes(t).toString("utf8")}get header(){return this._header}get bytesAvailable(){return this._buffer&&this._buffer.remaining()>0}}class gm{constructor(t){this._value=t}get value(){return this._value}}class fm{encode(t,e){const s=new FE;s.writeShort(t);for(const r of e){let a=typeof r;switch(a==="object"&&(r===null?a="null":r instanceof dm?a="byte":r instanceof gm?a="short":r instanceof ArrayBuffer&&(a="arraybuffer")),a){case"undefined":case"null":s.writeShort(0);break;case"byte":s.writeByte(r.value);break;case"short":s.writeShort(r.value);break;case"number":s.writeInt(r);break;case"boolean":s.writeByte(r?1:0);break;case"string":r?s.writeString(r,!0):s.writeShort(0);break;case"arraybuffer":s.writeBytes(r);break}}const i=s.getBuffer();return i?new FE().writeInt(i.byteLength).writeBytes(i):null}decode(t){if(!t||!t.dataBuffer||!t.dataBuffer.byteLength)return null;const e=[];for(;t.dataBuffer.byteLength&&!(t.dataBuffer.byteLength<4);){const s=new tl(t.dataBuffer),i=s.readInt();if(i>t.dataBuffer.byteLength-4)break;const r=s.readBytes(i);e.push(new Em(r.readShort(),r)),t.dataBuffer=t.dataBuffer.slice(i+4)}return e}}class I{constructor(t,e){this._callBack=t,this._parserClass=e,this._parser=null,this._connection=null}dispose(){this._callBack=null,this._parserClass=null,this._parser=null,this._connection=null}get callBack(){return this._callBack}get parserClass(){return this._parserClass}get parser(){return this._parser}set parser(t){this._parser=t}get connection(){return this._connection}set connection(t){this._connection=t}}class gt{constructor(t){this._type=t}get type(){return this._type}}const dn=class dn extends gt{constructor(t,e,s){super(t),this._connection=e,this._originalEvent=event}get connection(){return this._connection}get originalEvent(){return this._originalEvent}};dn.CONNECTION_OPENED="SCE_OPEN",dn.CONNECTION_CLOSED="SCE_CLOSED",dn.CONNECTION_ERROR="SCE_ERROR",dn.CONNECTION_MESSAGE="SCE_MESSAGE";let ae=dn;const rE=class rE extends gt{constructor(t,e){super(t),this._library=e}get library(){return this._library}};rE.DOWNLOAD_COMPLETE="ARELE_DOWNLOAD_COMPLETE";let br=rE;const nE=class nE{};nE.AVATAR_RENDER_READY="AVATAR_RENDER_READY";let ka=nE;const aE=class aE extends gt{constructor(t,e){super(t),this._library=e}get library(){return this._library}};aE.DOWNLOAD_COMPLETE="ARLE_DOWNLOAD_COMPLETE";let Fr=aE;const oE=class oE extends gt{constructor(t){super(t)}};oE.INITIALIZED="RCWM_INITIALIZED";let po=oE;const ii=class ii extends gt{constructor(t,e){super(t),this._connection=e}get connection(){return this._connection}};ii.CONNECTION_ESTABLISHED="NCE_ESTABLISHED",ii.CONNECTION_CLOSED="NCE_CLOSED",ii.CONNECTION_ERROR="NCE_ERROR",ii.CONNECTION_HANDSHAKING="NCE_HANDSHAKING",ii.CONNECTION_HANDSHAKED="NCE_HANDSHAKED",ii.CONNECTION_HANDSHAKE_FAILED="NCE_HANDSHAKE_FAILED",ii.CONNECTION_AUTHENTICATED="NCE_AUTHENTICATED";let hs=ii;const Mh=class Mh extends gt{constructor(t){super(t)}};Mh.LOADED="NLE_LOADED",Mh.FAILED="NLE_FAILED";let Qr=Mh;const ga=class ga extends gt{constructor(){super(ga.SETTINGS_UPDATED)}clone(){const t=new ga;return t._volumeSystem=this._volumeSystem,t._volumeFurni=this._volumeFurni,t._volumeTrax=this._volumeTrax,t._oldChat=this._oldChat,t._roomInvites=this._roomInvites,t._cameraFollow=this._cameraFollow,t._flags=this._flags,t._chatType=this._chatType,t}get volumeSystem(){return this._volumeSystem}set volumeSystem(t){this._volumeSystem=t}get volumeFurni(){return this._volumeFurni}set volumeFurni(t){this._volumeFurni=t}get volumeTrax(){return this._volumeTrax}set volumeTrax(t){this._volumeTrax=t}get oldChat(){return this._oldChat}set oldChat(t){this._oldChat=t}get roomInvites(){return this._roomInvites}set roomInvites(t){this._roomInvites=t}get cameraFollow(){return this._cameraFollow}set cameraFollow(t){this._cameraFollow=t}get flags(){return this._flags}set flags(t){this._flags=t}get chatType(){return this._chatType}set chatType(t){this._chatType=t}};ga.SETTINGS_UPDATED="NSE_SETTINGS_UPDATED";let Gr=ga;const hE=class hE extends gt{constructor(t,e){super(t),this._sampleCode=e}get sampleCode(){return this._sampleCode}};hE.PLAY_SOUND="NSOE_PLAY_SOUND";let $n=hE;const Nh=class Nh extends gt{constructor(t){super(t)}get iconId(){return this._iconId}set iconId(t){this._iconId=t}get iconName(){return this._iconName}set iconName(t){this._iconName=t}};Nh.TOOLBAR_CLICK="NTE_TOOLBAR_CLICK",Nh.SELECT_OWN_AVATAR="NTE_SELECT_OWN_AVATAR";let Ul=Nh;const Dh=class Dh extends Ul{constructor(t,e,s){super(Dh.ANIMATE_ICON),this._image=t,this._x=e,this._y=s}get image(){return this._image}get x(){return this._x}get y(){return this._y}};Dh.ANIMATE_ICON="NTAIE_ANIMATE_ICON";let Ro=Dh;const ri=class ri extends gt{constructor(t,e){super(t),this._roomId=e}get roomId(){return this._roomId}};ri.INITIALIZED="REE_INITIALIZED",ri.ENGINE_INITIALIZED="REE_ENGINE_INITIALIZED",ri.OBJECTS_INITIALIZED="REE_OBJECTS_INITIALIZED",ri.NORMAL_MODE="REE_NORMAL_MODE",ri.GAME_MODE="REE_GAME_MODE",ri.ROOM_ZOOMED="REE_ROOM_ZOOMED",ri.DISPOSED="REE_DISPOSED";let Ct=ri;const Lh=class Lh extends Ct{constructor(t,e,s,i){super(Lh.ROOM_COLOR,t),this._color=e,this._brightness=s,this._bgOnly=i}get color(){return this._color}get brightness(){return this._brightness}get bgOnly(){return this._bgOnly}};Lh.ROOM_COLOR="REE_ROOM_COLOR";let yl=Lh;const fa=class fa extends gt{constructor(t,e){super(t),this._contentType=e}get contentType(){return this._contentType}};fa.RCLE_SUCCESS="RCLE_SUCCESS",fa.RCLE_FAILURE="RCLE_FAILURE",fa.RCLE_CANCEL="RCLE_CANCEL";let Ti=fa;const Ph=class Ph extends Ct{constructor(t,e,s){super(Ph.ROOM_DRAG,t),this._offsetX=e,this._offsetY=s}get offsetX(){return this._offsetX}get offsetY(){return this._offsetY}};Ph.ROOM_DRAG="RDE_ROOM_DRAG";let vl=Ph;const Uh=class Uh extends Ct{constructor(t,e,s,i,r,a){super(Uh.ROOM_COLOR,t),this._state=e,this._presetId=s,this._effectId=i,this._color=r,this._brightness=a}get state(){return this._state}get presetId(){return this._presetId}get effectId(){return this._effectId}get color(){return this._color}get brightness(){return this._brightness}};Uh.ROOM_COLOR="REDSE_ROOM_COLOR";let bl=Uh;const fe=class fe extends Ct{constructor(t,e,s,i){super(t,e),this._objectId=s,this._category=i}get objectId(){return this._objectId}get category(){return this._category}};fe.SELECTED="REOE_SELECTED",fe.DESELECTED="REOE_DESELECTED",fe.ADDED="REOE_ADDED",fe.REMOVED="REOE_REMOVED",fe.PLACED="REOE_PLACED",fe.PLACED_ON_USER="REOE_PLACED_ON_USER",fe.CONTENT_UPDATED="REOE_CONTENT_UPDATED",fe.REQUEST_MOVE="REOE_REQUEST_MOVE",fe.REQUEST_ROTATE="REOE_REQUEST_ROTATE",fe.REQUEST_MANIPULATION="REOE_REQUEST_MANIPULATION",fe.MOUSE_ENTER="REOE_MOUSE_ENTER",fe.MOUSE_LEAVE="REOE_MOUSE_LEAVE",fe.DOUBLE_CLICK="REOE_DOUBLE_CLICK";let Z=fe;class Im extends Z{constructor(t,e,s,i,r,a,o,h,_,l,c,f,p){super(t,e,s,i),this._wallLocation="",this._x=0,this._y=0,this._z=0,this._direction=0,this._placedInRoom=!1,this._placedOnFloor=!1,this._placedOnWall=!1,this._instanceData=null,this._wallLocation=r,this._x=a,this._y=o,this._z=h,this._direction=_,this._placedInRoom=l,this._placedOnFloor=c,this._placedOnWall=f,this._instanceData=p}get wallLocation(){return this._wallLocation}get x(){return this._x}get y(){return this._y}get z(){return this._z}get direction(){return this._direction}get placedInRoom(){return this._placedInRoom}get placedOnFloor(){return this._placedOnFloor}get placedOnWall(){return this._placedOnWall}get instanceData(){return this._instanceData}}class Tm extends Z{constructor(t,e,s,i,r,a){super(t,e,s,i),this._droppedObjectId=r,this._droppedObjectCategory=a}get droppedObjectId(){return this._droppedObjectId}get droppedObjectCategory(){return this._droppedObjectCategory}}const yh=class yh extends Z{constructor(t,e,s,i,r,a=1){super(t,e,s,i),this._soundId=r,this._pitch=a}get soundId(){return this._soundId}get pitch(){return this._pitch}};yh.PLAY_SOUND="REOPSE_PLAY_SOUND",yh.PLAY_SOUND_AT_PITCH="REOPSE_PLAY_SOUND_AT_PITCH";let Jr=yh;const En=class En extends Z{};En.FURNI_CLICK="RERAE_FURNI_CLICK",En.FURNI_DOUBLE_CLICK="RERAE_FURNI_DOUBLE_CLICK",En.TOOLTIP_SHOW="RERAE_TOOLTIP_SHOW",En.TOOLTIP_HIDE="RERAE_TOOLTIP_HIDE";let Zr=En;const gn=class gn extends Z{constructor(t,e,s,i,r,a=1){super(t,e,s,i),this._sampleId=r,this._pitch=a}get sampleId(){return this._sampleId}get pitch(){return this._pitch}};gn.ROOM_OBJECT_INITIALIZED="ROPSPE_ROOM_OBJECT_INITIALIZED",gn.ROOM_OBJECT_DISPOSED="ROPSPE_ROOM_OBJECT_DISPOSED",gn.PLAY_SAMPLE="ROPSPE_PLAY_SAMPLE",gn.CHANGE_PITCH="ROPSPE_CHANGE_PITCH";let qe=gn;const Tt=class Tt extends Z{constructor(t,e,s,i,r=null){super(t,e,s,i),this._widget=r}get widget(){return this._widget}get contextMenu(){return this._widget}};Tt.OPEN_WIDGET="RETWE_OPEN_WIDGET",Tt.CLOSE_WIDGET="RETWE_CLOSE_WIDGET",Tt.OPEN_FURNI_CONTEXT_MENU="RETWE_OPEN_FURNI_CONTEXT_MENU",Tt.CLOSE_FURNI_CONTEXT_MENU="RETWE_CLOSE_FURNI_CONTEXT_MENU",Tt.REQUEST_PLACEHOLDER="RETWE_REQUEST_PLACEHOLDER",Tt.REQUEST_CREDITFURNI="RETWE_REQUEST_CREDITFURNI",Tt.REQUEST_STACK_HEIGHT="RETWE_REQUEST_STACK_HEIGHT",Tt.REQUEST_EXTERNAL_IMAGE="RETWE_REQUEST_EXTERNAL_IMAGE",Tt.REQUEST_STICKIE="RETWE_REQUEST_STICKIE",Tt.REQUEST_PRESENT="RETWE_REQUEST_PRESENT",Tt.REQUEST_TROPHY="RETWE_REQUEST_TROPHY",Tt.REQUEST_TEASER="RETWE_REQUEST_TEASER",Tt.REQUEST_ECOTRONBOX="RETWE_REQUEST_ECOTRONBOX",Tt.REQUEST_DIMMER="RETWE_REQUEST_DIMMER",Tt.REMOVE_DIMMER="RETWE_REMOVE_DIMMER",Tt.REQUEST_CLOTHING_CHANGE="RETWE_REQUEST_CLOTHING_CHANGE",Tt.REQUEST_PLAYLIST_EDITOR="RETWE_REQUEST_PLAYLIST_EDITOR",Tt.REQUEST_MANNEQUIN="RETWE_REQUEST_MANNEQUIN",Tt.REQUEST_MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG="ROWRE_REQUEST_MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG",Tt.REQUEST_PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG="ROWRE_REQUEST_PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG",Tt.REQUEST_BACKGROUND_COLOR="RETWE_REQUEST_BACKGROUND_COLOR",Tt.REQUEST_MYSTERYBOX_OPEN_DIALOG="RETWE_REQUEST_MYSTERYBOX_OPEN_DIALOG",Tt.REQUEST_EFFECTBOX_OPEN_DIALOG="RETWE_REQUEST_EFFECTBOX_OPEN_DIALOG",Tt.REQUEST_MYSTERYTROPHY_OPEN_DIALOG="RETWE_REQUEST_MYSTERYTROPHY_OPEN_DIALOG",Tt.REQUEST_ACHIEVEMENT_RESOLUTION_ENGRAVING="RETWE_REQUEST_ACHIEVEMENT_RESOLUTION_ENGRAVING",Tt.REQUEST_ACHIEVEMENT_RESOLUTION_FAILED="RETWE_REQUEST_ACHIEVEMENT_RESOLUTION_FAILED",Tt.REQUEST_FRIEND_FURNITURE_CONFIRM="RETWE_REQUEST_FRIEND_FURNITURE_CONFIRM",Tt.REQUEST_FRIEND_FURNITURE_ENGRAVING="RETWE_REQUEST_FRIEND_FURNITURE_ENGRAVING",Tt.REQUEST_BADGE_DISPLAY_ENGRAVING="RETWE_REQUEST_BADGE_DISPLAY_ENGRAVING",Tt.REQUEST_HIGH_SCORE_DISPLAY="RETWE_REQUEST_HIGH_SCORE_DISPLAY",Tt.REQUEST_HIDE_HIGH_SCORE_DISPLAY="RETWE_REQUEST_HIDE_HIGH_SCORE_DISPLAY",Tt.REQUEST_INTERNAL_LINK="RETWE_REQUEST_INTERNAL_LINK",Tt.REQUEST_ROOM_LINK="RETWE_REQUEST_ROOM_LINK",Tt.REQUEST_YOUTUBE="RETWE_REQUEST_YOUTUBE";let V=Tt;const vh=class vh extends Z{constructor(t,e,s,i,r=-1,a=-1){super(t,e,s,i),this._inventoryStripId=r,this._furnitureTypeId=a}get inventoryStripId(){return this._inventoryStripId}get furnitureTypeId(){return this._furnitureTypeId}};vh.USE_PRODUCT_FROM_ROOM="REUPE_USE_PRODUCT_FROM_ROOM",vh.USE_PRODUCT_FROM_INVENTORY="REUPE_USE_PRODUCT_FROM_INVENTORY";let Oo=vh;class us extends gt{constructor(t,e){super(t),this._object=e}get object(){return this._object}get objectId(){return this._object?this._object.id:-1}get objectType(){return this._object?this._object.type:null}}const _E=class _E extends us{constructor(t,e,s,i=!0){super(t,e),this._badgeId=s,this._groupBadge=i}get badgeId(){return this._badgeId}get groupBadge(){return this._groupBadge}};_E.LOAD_BADGE="ROBAE_LOAD_BADGE";let As=_E;const bh=class bh extends us{constructor(t,e){super(t,e)}};bh.RODRE_CURRENT_USER_ID="RODRE_CURRENT_USER_ID",bh.RODRE_URL_PREFIX="RODRE_URL_PREFIX";let ls=bh;const Fh=class Fh extends us{constructor(t,e,s,i,r,a){super(Fh.DIMMER_STATE,t),this._state=e,this._presetId=s,this._effectId=i,this._color=r,this._brightness=a}get state(){return this._state}get presetId(){return this._presetId}get effectId(){return this._effectId}get color(){return this._color}get brightness(){return this._brightness}};Fh.DIMMER_STATE="RODSUE_DIMMER_STATE";let Br=Fh;const xh=class xh extends us{constructor(t,e){super(t,e)}};xh.ADD_HOLE="ROFHO_ADD_HOLE",xh.REMOVE_HOLE="ROFHO_REMOVE_HOLE";let ue=xh;const he=class he extends us{};he.DICE_OFF="ROFCAE_DICE_OFF",he.DICE_ACTIVATE="ROFCAE_DICE_ACTIVATE",he.USE_HABBOWHEEL="ROFCAE_USE_HABBOWHEEL",he.STICKIE="ROFCAE_STICKIE",he.ENTER_ONEWAYDOOR="ROFCAE_ENTER_ONEWAYDOOR",he.SOUND_MACHINE_INIT="ROFCAE_SOUND_MACHINE_INIT",he.SOUND_MACHINE_START="ROFCAE_SOUND_MACHINE_START",he.SOUND_MACHINE_STOP="ROFCAE_SOUND_MACHINE_STOP",he.SOUND_MACHINE_DISPOSE="ROFCAE_SOUND_MACHINE_DISPOSE",he.JUKEBOX_INIT="ROFCAE_JUKEBOX_INIT",he.JUKEBOX_START="ROFCAE_JUKEBOX_START",he.JUKEBOX_MACHINE_STOP="ROFCAE_JUKEBOX_MACHINE_STOP",he.JUKEBOX_DISPOSE="ROFCAE_JUKEBOX_DISPOSE",he.MOUSE_BUTTON="ROFCAE_MOUSE_BUTTON",he.MOUSE_ARROW="ROFCAE_MOUSE_ARROW";let y=he;const lE=class lE extends Ct{constructor(t,e,s,i,r,a){super(t,e),this._enable=s,this._hue=i,this._saturation=r,this._lightness=a}get enable(){return this._enable}get hue(){return this._hue}get saturation(){return this._saturation}get lightness(){return this._lightness}};lE.ROOM_BACKGROUND_COLOR="ROHSLCEE_ROOM_BACKGROUND_COLOR";let Ao=lE;const cE=class cE extends us{constructor(t,e,s,i,r,a){super(t,e),this._enable=s,this._hue=i,this._saturation=r,this._lightness=a}get enable(){return this._enable}get hue(){return this._hue}get saturation(){return this._saturation}get lightness(){return this._lightness}};cE.ROOM_BACKGROUND_COLOR="ROHSLCEE_ROOM_BACKGROUND_COLOR";let Ei=cE;const Ps=class Ps extends us{constructor(t,e,s,i=!1,r=!1,a=!1,o=!1){super(t,e),this._eventId="",this._eventId=s,this._altKey=i,this._ctrlKey=r,this._shiftKey=a,this._buttonDown=o}get eventId(){return this._eventId}get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get shiftKey(){return this._shiftKey}get buttonDown(){return this._buttonDown}get localX(){return this._localX}set localX(t){this._localX=t}get localY(){return this._localY}set localY(t){this._localY=t}get spriteOffsetX(){return this._spriteOffsetX}set spriteOffsetX(t){this._spriteOffsetX=t}get spriteOffsetY(){return this._spriteOffsetY}set spriteOffsetY(t){this._spriteOffsetY=t}};Ps.CLICK="ROE_MOUSE_CLICK",Ps.DOUBLE_CLICK="ROE_MOUSE_DOUBLE_CLICK",Ps.MOUSE_MOVE="ROE_MOUSE_MOVE",Ps.MOUSE_DOWN="ROE_MOUSE_DOWN",Ps.MOUSE_DOWN_LONG="ROE_MOUSE_DOWN_LONG",Ps.MOUSE_UP="ROE_MOUSE_UP",Ps.MOUSE_ENTER="ROE_MOUSE_ENTER",Ps.MOUSE_LEAVE="ROE_MOUSE_LEAVE";let X=Ps;const Gh=class Gh extends us{constructor(t,e){super(t,e)}};Gh.POSITION_CHANGED="ROME_POSITION_CHANGED",Gh.OBJECT_REMOVED="ROME_OBJECT_REMOVED";let Ee=Gh;const Bh=class Bh extends y{constructor(t,e,s,i=1){super(t,e),this._soundId=s,this._pitch=i}get soundId(){return this._soundId}get pitch(){return this._pitch}};Bh.PLAY_SOUND="ROPSIE_PLAY_SOUND",Bh.PLAY_SOUND_AT_PITCH="ROPSIE_PLAY_SOUND_AT_PITCH";let mi=Bh;const Tr=class Tr extends us{constructor(t,e,s="",i=""){super(t,e),this._imageUrl="",this._clickUrl="",this._imageUrl=s,this._clickUrl=i}get imageUrl(){return this._imageUrl}get clickUrl(){return this._clickUrl}};Tr.ROOM_AD_LOAD_IMAGE="RORAE_ROOM_AD_LOAD_IMAGE",Tr.ROOM_AD_FURNI_CLICK="RORAE_ROOM_AD_FURNI_CLICK",Tr.ROOM_AD_FURNI_DOUBLE_CLICK="RORAE_ROOM_AD_FURNI_DOUBLE_CLICK",Tr.ROOM_AD_TOOLTIP_SHOW="RORAE_ROOM_AD_TOOLTIP_SHOW",Tr.ROOM_AD_TOOLTIP_HIDE="RORAE_ROOM_AD_TOOLTIP_HIDE";let Pt=Tr;const fn=class fn extends us{constructor(t,e,s,i=1){super(t,e),this._sampleId=s,this._pitch=i}get sampleId(){return this._sampleId}get pitch(){return this._pitch}};fn.ROOM_OBJECT_INITIALIZED="ROPSPE_ROOM_OBJECT_INITIALIZED",fn.ROOM_OBJECT_DISPOSED="ROPSPE_ROOM_OBJECT_DISPOSED",fn.PLAY_SAMPLE="ROPSPE_PLAY_SAMPLE",fn.CHANGE_PITCH="ROPSPE_CHANGE_PITCH";let Ht=fn;const Us=class Us extends Z{};Us.SOUND_MACHINE_INIT="ROSM_SOUND_MACHINE_INIT",Us.SOUND_MACHINE_SWITCHED_ON="ROSM_SOUND_MACHINE_SWITCHED_ON",Us.SOUND_MACHINE_SWITCHED_OFF="ROSM_SOUND_MACHINE_SWITCHED_OFF",Us.SOUND_MACHINE_DISPOSE="ROSM_SOUND_MACHINE_DISPOSE",Us.JUKEBOX_INIT="ROSM_JUKEBOX_INIT",Us.JUKEBOX_SWITCHED_ON="ROSM_JUKEBOX_SWITCHED_ON",Us.JUKEBOX_SWITCHED_OFF="ROSM_JUKEBOX_SWITCHED_OFF",Us.JUKEBOX_DISPOSE="ROSM_JUKEBOX_DISPOSE";let yt=Us;const wh=class wh extends us{constructor(t,e,s=0){super(t,e),this._state=s}get state(){return this._state}};wh.STATE_CHANGE="ROSCE_STATE_CHANGE",wh.STATE_RANDOM="ROSCE_STATE_RANDOM";let Et=wh;class $s extends X{constructor(t,e,s,i,r,a,o=!1,h=!1,_=!1,l=!1){super(t,e,s,o,h,_,l),this._tileX=i,this._tileY=r,this._tileZ=a}get tileX(){return this._tileX}get tileY(){return this._tileY}get tileZ(){return this._tileZ}get tileXAsInt(){return Math.trunc(this._tileX+.499)}get tileYAsInt(){return Math.trunc(this._tileY+.499)}get tileZAsInt(){return Math.trunc(this._tileZ+.499)}}class Xr extends X{constructor(t,e,s,i,r,a,o,h,_,l=!1,c=!1,f=!1,p=!1){super(t,e,s,l,c,f,p),this._wallLocation=new R,this._wallWd=new R,this._wallHt=new R,this._wallLocation.assign(i),this._wallWd.assign(r),this._wallHt.assign(a),this._x=o,this._y=h,this._direction=_}get wallLocation(){return this._wallLocation}get wallWidth(){return this._wallWd}get wallHeight(){return this._wallHt}get x(){return this._x}get y(){return this._y}get direction(){return this._direction}}const ut=class ut extends us{constructor(t,e){super(t,e)}};ut.OPEN_WIDGET="ROWRE_OPEN_WIDGET",ut.CLOSE_WIDGET="ROWRE_CLOSE_WIDGET",ut.OPEN_FURNI_CONTEXT_MENU="ROWRE_OPEN_FURNI_CONTEXT_MENU",ut.CLOSE_FURNI_CONTEXT_MENU="ROWRE_CLOSE_FURNI_CONTEXT_MENU",ut.PLACEHOLDER="ROWRE_PLACEHOLDER",ut.CREDITFURNI="ROWRE_CREDITFURNI",ut.STACK_HEIGHT="ROWRE_STACK_HEIGHT",ut.EXTERNAL_IMAGE="ROWRE_EXTERNAL_IMAGE",ut.STICKIE="ROWRE_STICKIE",ut.PRESENT="ROWRE_PRESENT",ut.TROPHY="ROWRE_TROPHY",ut.TEASER="ROWRE_TEASER",ut.ECOTRONBOX="ROWRE_ECOTRONBOX",ut.DIMMER="ROWRE_DIMMER",ut.WIDGET_REMOVE_DIMMER="ROWRE_WIDGET_REMOVE_DIMMER",ut.CLOTHING_CHANGE="ROWRE_CLOTHING_CHANGE",ut.JUKEBOX_PLAYLIST_EDITOR="ROWRE_JUKEBOX_PLAYLIST_EDITOR",ut.MANNEQUIN="ROWRE_MANNEQUIN",ut.PET_PRODUCT_MENU="ROWRE_PET_PRODUCT_MENU",ut.GUILD_FURNI_CONTEXT_MENU="ROWRE_GUILD_FURNI_CONTEXT_MENU",ut.MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG="ROWRE_MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG",ut.PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG="ROWRE_PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG",ut.BACKGROUND_COLOR="ROWRE_BACKGROUND_COLOR",ut.MYSTERYBOX_OPEN_DIALOG="ROWRE_MYSTERYBOX_OPEN_DIALOG",ut.EFFECTBOX_OPEN_DIALOG="ROWRE_EFFECTBOX_OPEN_DIALOG",ut.MYSTERYTROPHY_OPEN_DIALOG="ROWRE_MYSTERYTROPHY_OPEN_DIALOG",ut.ACHIEVEMENT_RESOLUTION_OPEN="ROWRE_ACHIEVEMENT_RESOLUTION_OPEN",ut.ACHIEVEMENT_RESOLUTION_ENGRAVING="ROWRE_ACHIEVEMENT_RESOLUTION_ENGRAVING",ut.ACHIEVEMENT_RESOLUTION_FAILED="ROWRE_ACHIEVEMENT_RESOLUTION_FAILED",ut.FRIEND_FURNITURE_CONFIRM="ROWRE_FRIEND_FURNITURE_CONFIRM",ut.FRIEND_FURNITURE_ENGRAVING="ROWRE_FRIEND_FURNITURE_ENGRAVING",ut.BADGE_DISPLAY_ENGRAVING="ROWRE_BADGE_DISPLAY_ENGRAVING",ut.HIGH_SCORE_DISPLAY="ROWRE_HIGH_SCORE_DISPLAY",ut.HIDE_HIGH_SCORE_DISPLAY="ROWRE_HIDE_HIGH_SCORE_DISPLAY",ut.INERNAL_LINK="ROWRE_INTERNAL_LINK",ut.ROOM_LINK="ROWRE_ROOM_LINK",ut.YOUTUBE="ROWRE_YOUTUBE";let S=ut;class mm{constructor(t,e,s,i,r,a,o=0,h=0,_=!1,l=!1,c=!1,f=!1){this._type=t,this._eventId=e,this._canvasId=s,this._spriteTag=i,this._screenX=r,this._screenY=a,this._localX=o,this._localY=h,this._ctrlKey=_,this._altKey=l,this._shiftKey=c,this._buttonDown=f,this._spriteOffsetX=0,this._spriteOffsetY=0}get type(){return this._type}get eventId(){return this._eventId}get canvasId(){return this._canvasId}get spriteTag(){return this._spriteTag}get screenX(){return this._screenX}get screenY(){return this._screenY}get localX(){return this._localX}get localY(){return this._localY}get ctrlKey(){return this._ctrlKey}get altKey(){return this._altKey}get shiftKey(){return this._shiftKey}get buttonDown(){return this._buttonDown}get spriteOffsetX(){return this._spriteOffsetX}set spriteOffsetX(t){this._spriteOffsetX=t}get spriteOffsetY(){return this._spriteOffsetY}set spriteOffsetY(t){this._spriteOffsetY=t}}class pm extends gt{constructor(t){super(t)}}const uE=class uE extends pm{constructor(t,e){super(t),this._targetLocation=e}get targetLocation(){return this._targetLocation}};uE.ROAME_MOVE_TO="ROAME_MOVE_TO";let Yn=uE;const Vh=class Vh extends Ct{constructor(t,e,s=!1,i=!1){super(Vh.ROOM_ZOOM,t),this._level=e,this._forceFlip=s,this._asDelta=i}get level(){return this._level}get forceFlip(){return this._forceFlip}get asDelta(){return this._asDelta}};Vh.ROOM_ZOOM="REE_ROOM_ZOOM";let HE=Vh;const Yh=class Yh extends gt{constructor(t,e){super(Yh.IMAGE_READY),this._badgeId=t,this._image=e}get badgeId(){return this._badgeId}get image(){return this._image}};Yh.IMAGE_READY="BIME_BADGE_IMAGE_READY";let Hn=Yh;const Hh=class Hh extends gt{constructor(t,e){super(Hh.MYSTERY_BOX_KEYS_UPDATE),this._boxColor=t,this._keyColor=e}get boxColor(){return this._boxColor}get keyColor(){return this._keyColor}};Hh.MYSTERY_BOX_KEYS_UPDATE="mbke_update";let Fl=Hh;const jh=class jh extends gt{constructor(){super(jh.PERKS_UPDATED)}};jh.PERKS_UPDATED="PUE_perks_updated";let jE=jh;const In=class In extends gt{constructor(t,e,s=!0){super(t),this._session=e,this._openLandingView=s}get session(){return this._session}get openLandingView(){return this._openLandingView}};In.CREATED="RSE_CREATED",In.STARTED="RSE_STARTED",In.ENDED="RSE_ENDED",In.ROOM_DATA="RSE_ROOM_DATA";let tt=In;const Ie=class Ie extends tt{constructor(t,e,s,i,r,a=0,o,h=null,_=-1){super(t,e),this._objectId=s,this._message=i,this._chatType=r,this._chatColours=o,this._links=h,this._extraParam=_,this._style=a}get objectId(){return this._objectId}get message(){return this._message}get chatType(){return this._chatType}get links(){return this._links}get extraParam(){return this._extraParam}get style(){return this._style}get chatColours(){return this._chatColours}};Ie.CHAT_EVENT="RSCE_CHAT_EVENT",Ie.FLOOD_EVENT="RSCE_FLOOD_EVENT",Ie.CHAT_TYPE_SPEAK=0,Ie.CHAT_TYPE_WHISPER=1,Ie.CHAT_TYPE_SHOUT=2,Ie.CHAT_TYPE_RESPECT=3,Ie.CHAT_TYPE_PETRESPECT=4,Ie.CHAT_TYPE_HAND_ITEM_RECEIVED=5,Ie.CHAT_TYPE_PETTREAT=6,Ie.CHAT_TYPE_PETREVIVE=7,Ie.CHAT_TYPE_PET_REBREED_FERTILIZE=8,Ie.CHAT_TYPE_PET_SPEED_FERTILIZE=9,Ie.CHAT_TYPE_MUTE_REMAINING=10;let Nt=Ie;const zh=class zh extends tt{constructor(t,e,s,i,r,a){super(zh.CONFIRM_PET_BREEDING,t),this._nestId=e,this._pet1=s,this._pet2=i,this._rarityCategories=r,this._resultPetTypeId=a}get nestId(){return this._nestId}get pet1(){return this._pet1}get pet2(){return this._pet2}get rarityCategories(){return this._rarityCategories}get resultPetTypeId(){return this._resultPetTypeId}};zh.CONFIRM_PET_BREEDING="RSPFUE_CONFIRM_PET_BREEDING";let xl=zh;const Wh=class Wh extends tt{constructor(t,e,s){super(Wh.RSPFUE_CONFIRM_PET_BREEDING_RESULT,t),this._breedingNestStuffId=e,this._result=s}get breedingNestStuffId(){return this._breedingNestStuffId}get result(){return this._result}};Wh.RSPFUE_CONFIRM_PET_BREEDING_RESULT="RSPFUE_CONFIRM_PET_BREEDING_RESULT";let Gl=Wh;const kh=class kh extends tt{constructor(t,e,s){super(kh.RSDE_DANCE,t),this._roomIndex=e,this._danceId=s}get roomIndex(){return this._roomIndex}get danceId(){return this._danceId}};kh.RSDE_DANCE="RSDE_DANCE";let Bl=kh;class Rm{constructor(t,e,s,i){this._id=t,this._type=e,this._color=s,this._brightness=i}get id(){return this._id}get type(){return this._type}get color(){return this._color}get brightness(){return this._brightness}}const dE=class dE extends tt{constructor(t,e){super(t,e),this._selectedPresetId=0,this._presets=[]}storePreset(t,e,s,i){this._presets[t-1]=new Rm(t,e,s,i)}getPreset(t){return t<0||t>=this._presets.length?null:this._presets[t]}get presetCount(){return this._presets.length}get selectedPresetId(){return this._selectedPresetId}set selectedPresetId(t){this._selectedPresetId=t}};dE.ROOM_DIMMER_PRESETS="RSDPE_PRESETS";let So=dE;const Ia=class Ia extends tt{constructor(t,e,s){super(t,e),this._userName="",this._userName=s}get userName(){return this._userName}};Ia.DOORBELL="RSDE_DOORBELL",Ia.RSDE_REJECTED="RSDE_REJECTED",Ia.RSDE_ACCEPTED="RSDE_ACCEPTED";let qi=Ia;const Ue=class Ue extends tt{constructor(t,e,s=null){super(t,e),this._message=s}get message(){return this._message}};Ue.RSEME_KICKED="RSEME_KICKED",Ue.RSEME_PETS_FORBIDDEN_IN_HOTEL="RSEME_PETS_FORBIDDEN_IN_HOTEL",Ue.RSEME_PETS_FORBIDDEN_IN_FLAT="RSEME_PETS_FORBIDDEN_IN_FLAT",Ue.RSEME_MAX_PETS="RSEME_MAX_PETS",Ue.RSEME_MAX_NUMBER_OF_OWN_PETS="RSEME_MAX_NUMBER_OF_OWN_PETS",Ue.RSEME_NO_FREE_TILES_FOR_PET="RSEME_NO_FREE_TILES_FOR_PET",Ue.RSEME_SELECTED_TILE_NOT_FREE_FOR_PET="RSEME_SELECTED_TILE_NOT_FREE_FOR_PET",Ue.RSEME_BOTS_FORBIDDEN_IN_HOTEL="RSEME_BOTS_FORBIDDEN_IN_HOTEL",Ue.RSEME_BOTS_FORBIDDEN_IN_FLAT="RSEME_BOTS_FORBIDDEN_IN_FLAT",Ue.RSEME_BOT_LIMIT_REACHED="RSEME_BOT_LIMIT_REACHED",Ue.RSEME_SELECTED_TILE_NOT_FREE_FOR_BOT="RSEME_SELECTED_TILE_NOT_FREE_FOR_BOT",Ue.RSEME_BOT_NAME_NOT_ACCEPTED="RSEME_BOT_NAME_NOT_ACCEPTED";let ce=Ue;const Kh=class Kh extends tt{constructor(t,e,s,i,r){super(Kh.FAVOURITE_GROUP_UPDATE,t),this._roomIndex=e,this._habboGroupId=s,this._habboGroupName=r,this._status=i}get roomIndex(){return this._roomIndex}get habboGroupId(){return this._habboGroupId}get habboGroupName(){return this._habboGroupName}get status(){return this._status}};Kh.FAVOURITE_GROUP_UPDATE="RSFGUE_FAVOURITE_GROUP_UPDATE";let wl=Kh;const Xh=class Xh extends tt{constructor(t,e,s,i){super(Xh.RSFRE_FRIEND_REQUEST,t),this._requestId=0,this._userId=0,this._requestId=e,this._userId=s,this._userName=i}get requestId(){return this._requestId}get userId(){return this._userId}get userName(){return this._userName}};Xh.RSFRE_FRIEND_REQUEST="RSFRE_FRIEND_REQUEST";let Vl=Xh;const qh=class qh extends tt{constructor(t,e,s){super(qh.NEST_BREEDING_SUCCESS,t),this._petId=e,this._rarityCategory=s}get rarityCategory(){return this._rarityCategory}get petId(){return this._petId}};qh.NEST_BREEDING_SUCCESS="RSPFUE_NEST_BREEDING_SUCCESS";let Yl=qh;const Qh=class Qh extends tt{constructor(t,e,s,i){super(Qh.PET_BREEDING,t),this._state=e,this._ownPetId=s,this._otherPetId=i}get state(){return this._state}get ownPetId(){return this._ownPetId}get otherPetId(){return this._otherPetId}};Qh.PET_BREEDING="RSPFUE_PET_BREEDING";let Hl=Qh;const Jh=class Jh extends tt{constructor(t,e,s){super(Jh.PET_BREEDING_RESULT,t),this._resultData=e,this._otherResultData=s}get resultData(){return this._resultData}get otherResultData(){return this._otherResultData}};Jh.PET_BREEDING_RESULT="RSPFUE_PET_BREEDING_RESULT";let jl=Jh;const Zh=class Zh extends tt{constructor(t,e,s,i){super(Zh.PET_COMMANDS,t),this._petId=e,this._allCommandIds=s,this._enabledCommandIds=i}get id(){return this._petId}get commands(){return this._allCommandIds}get enabledCommands(){return this._enabledCommandIds}};Zh.PET_COMMANDS="RSPIUE_ENABLED_PET_COMMANDS";let zE=Zh;const $h=class $h extends tt{constructor(t,e,s){super($h.PET_FIGURE_UPDATE,t),this._petId=e,this._figure=s}get id(){return this._petId}get figure(){return this._figure}};$h.PET_FIGURE_UPDATE="RSPFUE_PET_FIGURE_UPDATE";let zl=$h;const t_=class t_ extends tt{constructor(t,e){super(t_.PET_INFO,t),this._petInfo=e}get petInfo(){return this._petInfo}};t_.PET_INFO="RSPIUE_PET_INFO";let Wl=t_;const e_=class e_ extends tt{constructor(t,e,s){super(e_.PET_LEVEL_UPDATE,t),this._petId=e,this._level=s}get petId(){return this._petId}get level(){return this._level}};e_.PET_LEVEL_UPDATE="RSPLUE_PET_LEVEL_UPDATE";let kl=e_;const s_=class s_ extends tt{constructor(t,e,s,i,r,a){super(t,e),this._objectId=-1,this._nameValidationStatus=0,this._nameValidationInfo=null,this._objectId=s,this._figureData=i,this._nameValidationStatus=r,this._nameValidationInfo=a}get objectId(){return this._objectId}get figureData(){return this._figureData}get nameValidationStatus(){return this._nameValidationStatus}get nameValidationInfo(){return this._nameValidationInfo}};s_.RSOPPE_OPEN_PET_PACKAGE_REQUESTED="RSOPPE_OPEN_PET_PACKAGE_REQUESTED",s_.RSOPPE_OPEN_PET_PACKAGE_RESULT="RSOPPE_OPEN_PET_PACKAGE_RESULT";let $r=s_;const i_=class i_ extends tt{constructor(t,e,s,i,r,a){super(i_.PET_STATUS_UPDATE,t),this._petId=e,this._canBreed=s,this._canHarvest=i,this._canRevive=r,this._hasBreedingPermission=a}get petId(){return this._petId}get canBreed(){return this._canBreed}get canHarvest(){return this._canHarvest}get canRevive(){return this._canRevive}get hasBreedingPermission(){return this._hasBreedingPermission}};i_.PET_STATUS_UPDATE="RSPFUE_PET_STATUS_UPDATE";let Kl=i_;const Ta=class Ta extends tt{constructor(t,e,s){super(t,e),this._id=-1,this._numQuestions=0,this._startMessage="",this._endMessage="",this._questionArray=null,this._npsPoll=!1,this._id=s}get id(){return this._id}get headline(){return this._headline}set headline(t){this._headline=t}get summary(){return this._summary}set summary(t){this._summary=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 npsPoll(){return this._npsPoll}set npsPoll(t){this._npsPoll=t}};Ta.OFFER="RSPE_POLL_OFFER",Ta.ERROR="RSPE_POLL_ERROR",Ta.CONTENT="RSPE_POLL_CONTENT";let Ni=Ta;const EE=class EE extends tt{constructor(t,e,s,i,r,a,o,h,_){super(t,e),this._classId=0,this._itemType="",this._placedItemId=0,this._placedItemType="",this._classId=s,this._itemType=i,this._productCode=r,this._placedItemId=a,this._placedItemType=o,this._placedInRoom=h,this._petFigureString=_}get classId(){return this._classId}get itemType(){return this._itemType}get productCode(){return this._productCode}get placedItemId(){return this._placedItemId}get placedInRoom(){return this._placedInRoom}get placedItemType(){return this._placedItemType}get petFigureString(){return this._petFigureString}};EE.RSPE_PRESENT_OPENED="RSPE_PRESENT_OPENED";let Co=EE;const gE=class gE extends tt{constructor(t,e){super(t,e)}};gE.RSDUE_ALLOW_PETS="RSDUE_ALLOW_PETS";let Mo=gE;const Fi=class Fi extends tt{constructor(t,e,s,i=!1){super(Fi.QUEUE_STATUS,t),this._name=e,this._target=s,this._queues=new Map,this._isActive=i}get isActive(){return this._isActive}get queueSetName(){return this._name}get queueSetTarget(){return this._target}get queueTypes(){return Array.from(this._queues.keys())}getQueueSize(t){return this._queues.get(t)}addQueue(t,e){this._queues.set(t,e)}};Fi.QUEUE_STATUS="RSQE_QUEUE_STATUS",Fi.QUEUE_TYPE_CLUB="c",Fi.QUEUE_TYPE_NORMAL="d",Fi.QUEUE_TARGET_VISITOR=2,Fi.QUEUE_TARGET_SPECTATOR=1;let WE=Fi;const fE=class fE extends tt{constructor(t,e){super(t,e)}};fE.SPECTATOR_MODE="RSSME_SPECTATOR_MODE";let No=fE;const r_=class r_ extends tt{constructor(t,e,s){super(r_.RSUBE_BADGES,t),this._userId=0,this._badges=[],this._userId=e,this._badges=s}get userId(){return this._userId}get badges(){return this._badges}};r_.RSUBE_BADGES="RSUBE_BADGES";let Xl=r_;const n_=class n_ extends tt{constructor(t,e){super(n_.USER_DATA_UPDATED,t),this._addedUsers=e}get addedUsers(){return this._addedUsers}};n_.USER_DATA_UPDATED="RMUDUE_USER_DATA_UPDATED";let ql=n_;const a_=class a_ extends tt{constructor(t,e,s,i,r,a){super(a_.USER_FIGURE,t),this._roomIndex=0,this._figure="",this._gender="",this._customInfo="",this._roomIndex=e,this._figure=s,this._gender=i,this._customInfo=r,this._achievementScore=a}get roomIndex(){return this._roomIndex}get figure(){return this._figure}get gender(){return this._gender}get customInfo(){return this._customInfo}get activityPoints(){return this._achievementScore}};a_.USER_FIGURE="RSUBE_FIGURE";let Ql=a_;const o_=class o_ extends gt{constructor(t,e){super(o_.UTRE_USER_TAGS_RECEIVED),this._userId=t,this._tags=e}get userId(){return this._userId}get tags(){return this._tags}};o_.UTRE_USER_TAGS_RECEIVED="UTRE_USER_TAGS_RECEIVED";let kE=o_;const h_=class h_ extends tt{constructor(t,e,s,i,r=null,a=0){super(t,e),this._question="",this._SafeStr_7654=0,this._choices=[],this._SafeStr_7651=[],this._question=s,this._choices=i,this._SafeStr_7651=r,this._SafeStr_7651==null&&(this._SafeStr_7651=[]),this._SafeStr_7654=a}get question(){return this._question}get choices(){return this._choices.slice()}get _SafeStr_4173(){return this._SafeStr_7651.slice()}get _SafeStr_4174(){return this._SafeStr_7654}};h_.VOTE_QUESTION="RSPE_VOTE_QUESTION",h_.VOTE_RESULT="RSPE_VOTE_RESULT";let tn=h_;const ma=class ma extends tt{constructor(t,e,s=-1){super(t,e),this._id=-1,this._pollType=null,this._pollId=-1,this._questionId=-1,this._duration=-1,this._question=null,this._userId=-1,this._id=s}get id(){return this._id}get pollType(){return this._pollType}set pollType(t){this._pollType=t}get pollId(){return this._pollId}set pollId(t){this._pollId=t}get questionId(){return this._questionId}set questionId(t){this._questionId=t}get duration(){return this._duration}set duration(t){this._duration=t}get question(){return this._question}set question(t){this._question=t}get userId(){return this._userId}set userId(t){this._userId=t}get value(){return this._value}set value(t){this._value=t}get answerCounts(){return this._answerCounts}set answerCounts(t){this._answerCounts=t}};ma.QUESTION="RWPUW_NEW_QUESTION",ma.FINISHED="RWPUW_QUESION_FINSIHED",ma.ANSWERED="RWPUW_QUESTION_ANSWERED";let Di=ma;const __=class __ extends gt{constructor(t){super(__.UPDATED),this._uiFlags=t}get uiFlags(){return this._uiFlags}};__.UPDATED="APUE_UPDATED";let Jl=__;const l_=class l_ extends gt{constructor(t){super(l_.UNUE_NAME_UPDATED),this._name=t}get name(){return this._name}};l_.UNUE_NAME_UPDATED="unue_name_updated";let Do=l_;class Om{constructor(){this._messageIdByEvent=new Map,this._messageIdByComposer=new Map,this._messageInstancesById=new Map}dispose(){this._messageIdByEvent.clear(),this._messageIdByComposer.clear(),this._messageInstancesById.clear()}registerMessages(t){for(const[e,s]of t.events)this.registerMessageEventClass(e,s);for(const[e,s]of t.composers)this.registerMessageComposerClass(e,s)}registerMessageEventClass(t,e){!t||!e||this._messageIdByEvent.set(e,t)}registerMessageComposerClass(t,e){!t||!e||this._messageIdByComposer.set(e,t)}registerMessageEvent(t){if(!t)return;const e=this.getEventId(t);if(!e)return;let s=this._messageInstancesById.get(e);(!s||!s.length)&&(s=[],this._messageInstancesById.set(e,s)),s.push(t)}removeMessageEvent(t){if(!t)return;const e=this.getEventId(t);if(!e)return;const s=this._messageInstancesById.get(e);if(s){for(const[i,r]of s.entries())if(r&&r===t){s.splice(i,1),s.length===0&&this._messageInstancesById.delete(e),r.dispose();return}}}getEvents(t){if(!t)return;const e=this._messageInstancesById.get(t);if(e)return e}getEventId(t){if(!t)return-1;const e=t instanceof I?t.constructor:t,s=this._messageIdByEvent.get(e);return s||-1}getComposerId(t){if(!t)return-1;const e=this._messageIdByComposer.get(t.constructor);return e||-1}}class Am extends $e{constructor(t,e){super(),this._communicationManager=t,this._stateListener=e,this._socket=null,this._messages=new Om,this._codec=new fm,this._dataBuffer=null,this._isReady=!1,this._pendingClientMessages=[],this._pendingServerMessages=[],this._isAuthenticated=!1,this.onOpen=this.onOpen.bind(this),this.onClose=this.onClose.bind(this),this.onError=this.onError.bind(this),this.onMessage=this.onMessage.bind(this)}init(t){this._stateListener&&this._stateListener.connectionInit(t),this.createSocket(t)}onDispose(){super.onDispose(),this.destroySocket(),this._communicationManager=null,this._stateListener=null,this._messages=null,this._codec=null,this._dataBuffer=null}onReady(){this._isReady||(this._isReady=!0,this._pendingServerMessages&&this._pendingServerMessages.length&&this.processWrappers(...this._pendingServerMessages),this._pendingClientMessages&&this._pendingClientMessages.length&&this.send(...this._pendingClientMessages),this._pendingServerMessages=[],this._pendingClientMessages=[])}createSocket(t){t&&(this.destroySocket(),this._dataBuffer=new ArrayBuffer(0),this._socket=new WebSocket(t),this._socket.addEventListener(Ns.CONNECTION_OPENED,this.onOpen),this._socket.addEventListener(Ns.CONNECTION_CLOSED,this.onClose),this._socket.addEventListener(Ns.CONNECTION_ERROR,this.onError),this._socket.addEventListener(Ns.CONNECTION_MESSAGE,this.onMessage))}destroySocket(){this._socket&&(this._socket.removeEventListener(Ns.CONNECTION_OPENED,this.onOpen),this._socket.removeEventListener(Ns.CONNECTION_CLOSED,this.onClose),this._socket.removeEventListener(Ns.CONNECTION_ERROR,this.onError),this._socket.removeEventListener(Ns.CONNECTION_MESSAGE,this.onMessage),this._socket.readyState===WebSocket.OPEN&&this._socket.close(),this._socket=null)}onOpen(t){this.dispatchConnectionEvent(ae.CONNECTION_OPENED,t)}onClose(t){this.dispatchConnectionEvent(ae.CONNECTION_CLOSED,t)}onError(t){this.dispatchConnectionEvent(ae.CONNECTION_ERROR,t)}onMessage(t){if(!t)return;const e=new FileReader;e.readAsArrayBuffer(t.data),e.onloadend=()=>{this._dataBuffer=this.concatArrayBuffers(this._dataBuffer,e.result),this.processReceivedData()}}dispatchConnectionEvent(t,e){this.dispatchEvent(new ae(t,this,e))}authenticated(){this._isAuthenticated=!0}send(...t){if(this.disposed||!t)return!1;if(t=[...t],this._isAuthenticated&&!this._isReady)return this._pendingClientMessages||(this._pendingClientMessages=[]),this._pendingClientMessages.push(...t),!1;for(const e of t){if(!e)continue;const s=this._messages.getComposerId(e);if(s===-1){j.packets("Unknown Composer",e.constructor.name);continue}const i=e.getMessageArray(),r=this._codec.encode(s,i);if(!r){j.packets("Encoding Failed",e.constructor.name);continue}j.packets("OutgoingComposer",s,e.constructor.name,i),this.write(r.getBuffer())}return!0}write(t){this._socket.readyState===WebSocket.OPEN&&this._socket.send(t)}processReceivedData(){try{this.processData()}catch(t){j.error(t)}}processData(){const t=this.splitReceivedMessages();if(!(!t||!t.length)){if(this._isAuthenticated&&!this._isReady){this._pendingServerMessages||(this._pendingServerMessages=[]),this._pendingServerMessages.push(...t);return}this.processWrappers(...t)}}processWrappers(...t){if(!(!t||!t.length))for(const e of t){if(!e)continue;const s=this.getMessagesForWrapper(e);!s||!s.length||(j.packets("IncomingMessage",e.header,s[0].constructor.name,s[0].parser),this.handleMessages(...s))}}splitReceivedMessages(){return!this._dataBuffer||!this._dataBuffer.byteLength?null:this._codec.decode(this)}concatArrayBuffers(t,e){const s=new Uint8Array(t.byteLength+e.byteLength);return s.set(new Uint8Array(t),0),s.set(new Uint8Array(e),t.byteLength),s.buffer}getMessagesForWrapper(t){if(!t)return null;const e=this._messages.getEvents(t.header);if(!e||!e.length){j.packets("IncomingMessage",t.header,"UNREGISTERED",t);return}try{const s=new e[0].parserClass;if(!s||!s.flush()||!s.parse(t))return null;for(const i of e)i.parser=s}catch(s){return j.error("Error parsing message",s,e[0].constructor.name),null}return e}handleMessages(...t){t=[...t];for(const e of t)e&&(e.connection=this,e.callBack&&e.callBack(e))}registerMessages(t){t&&this._messages.registerMessages(t)}addMessageEvent(t){!t||!this._messages||this._messages.registerMessageEvent(t)}removeMessageEvent(t){!t||!this._messages||this._messages.removeMessageEvent(t)}get isAuthenticated(){return this._isAuthenticated}get dataBuffer(){return this._dataBuffer}set dataBuffer(t){this._dataBuffer=t}}class Sm extends Ye{constructor(){super(),this._connections=[]}onDispose(){if(!(!this._connections||!this._connections.length))for(const t of this._connections.values())t&&t.dispose()}createConnection(t=null){const e=new Am(this,t);if(e)return this._connections.push(e),e}update(t){let e=0;for(;e<this._connections.length;){const s=this._connections[e];if(s.processReceivedData(),this.disposed)return;s.disposed?this._connections.splice(e,1):e++}}}const c_=class c_ extends gt{constructor(t){super(t)}};c_.LOADED="NCE_LOADED",c_.FAILED="NCE_FAILED";let ki=c_;class Cm extends Js{constructor(){super(),this._definitions=new Map,this._config=[],this._pendingUrls=[],this._missingKeys=[],this.onConfigurationLoaded=this.onConfigurationLoaded.bind(this)}onInit(){q.parseConfiguration(this.getDefaultConfig(),!0),this._pendingUrls=q.getValue("config.urls").slice(),this.loadNextConfiguration()}loadNextConfiguration(){if(!this._pendingUrls.length){this.dispatchConfigurationEvent(ki.LOADED);return}this.loadConfigurationFromUrl(this._pendingUrls[0])}loadConfigurationFromUrl(t){if(!t||t===""){this.dispatchConfigurationEvent(ki.FAILED);return}fetch(t).then(e=>e.json()).then(e=>this.onConfigurationLoaded(e,t)).catch(e=>this.onConfigurationFailed(e))}onConfigurationLoaded(t,e){if(t){if(q.parseConfiguration(t)){const s=this._pendingUrls.indexOf(e);s>=0&&this._pendingUrls.splice(s,1),this.loadNextConfiguration();return}this.dispatchConfigurationEvent(ki.FAILED)}}onConfigurationFailed(t){this.dispatchConfigurationEvent(ki.FAILED)}dispatchConfigurationEvent(t){this.events&&this.events.dispatchEvent(new ki(t))}getDefaultConfig(){return NitroConfig}}const xi=class xi{static sayHello(){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){const t=[`
 %c %c %c Nitro ${xi.UI_VERSION} - Renderer ${xi.RENDERER_VERSION} %c %c %c https://discord.nitrodev.co %c %c 

`,"background: #ffffff; padding:5px 0;","background: #ffffff; padding:5px 0;","color: #ffffff; background: #000000; padding:5px 0;","background: #ffffff; padding:5px 0;","background: #ffffff; padding:5px 0;","background: #000000; padding:5px 0;","background: #ffffff; padding:5px 0;","background: #ffffff; padding:5px 0;"];self.console.log(...t)}else self.console&&self.console.log(`Nitro ${xi.UI_VERSION} - Renderer ${xi.RENDERER_VERSION} `)}};xi.RENDERER_VERSION="1.6.6",xi.UI_VERSION="";let Lo=xi;class Mm extends Ye{constructor(){super(),Lo.sayHello(),this._configuration=new Cm,this._communication=new Sm}onDispose(){this._communication&&(this._communication.dispose(),this._communication=null)}get configuration(){return this._configuration}get communication(){return this._communication}}class Nm{constructor(t){this._id=parseInt(t.id),this._value=parseInt(t.id),this._prevents=t.prevents||[],this._preventHeadTurn=t.preventHeadTurn||!1,this._isAnimated=!0,t.animated!==void 0&&t.animated===!1&&(this._isAnimated=!1)}get id(){return this._id}get value(){return this._value}get prevents(){return this._prevents}get preventHeadTurn(){return this._preventHeadTurn}get isAnimated(){return this._isAnimated}}class Dm{constructor(t){if(this._id=t.id,this._state=t.state,this._precedence=t.precedence,this._activePartSet=t.activePartSet,this._assetPartDefinition=t.assetPartDefinition,this._lay=t.lay,this._geometryType=t.geometryType,this._isMain=t.main||!1,this._isDefault=t.isDefault||!1,this._isAnimation=t.animation||!1,this._startFromFrameZero=t.startFromFrameZero||!1,this._prevents=t.prevents||[],this._preventHeadTurn=t.preventHeadTurn||!1,this._types=new Map,this._params=new Map,this._defaultParameterValue="",this._canvasOffsets=null,t.params&&t.params.length>0)for(const e of t.params)e&&(e.id==="default"?this._defaultParameterValue=e.value:this._params.set(e.id,e.value));if(t.types&&t.types.length>0)for(const e of t.types){if(!e)continue;const s=new Nm(e);this._types.set(s.id,s)}}setOffsets(t,e,s){this._canvasOffsets||(this._canvasOffsets=new Map);let i=this._canvasOffsets.get(t);i||(i=new Map,this._canvasOffsets.set(t,i)),i.set(e,s)}getOffsets(t,e){if(!this._canvasOffsets)return null;const s=this._canvasOffsets.get(t);return s?s.get(e):null}getType(t){if(!t)return null;const e=this._types.get(parseInt(t));return e||null}getParameterValue(t){if(!t)return"";const e=this._params.get(t);return e||this._defaultParameterValue}getPrevents(t){return this._prevents.concat(this.getTypePrevents(t))}getTypePrevents(t){if(!t)return[];const e=this._types.get(parseInt(t));return e?e.prevents:[]}getPreventHeadTurn(t){if(!t)return this._preventHeadTurn;const e=this.getType(t);return e?e.preventHeadTurn:this._preventHeadTurn}isAnimated(t){if(!t)return!0;const e=this.getType(t);return e?e.isAnimated:!0}get id(){return this._id}get state(){return this._state}get precedence(){return this._precedence}get activePartSet(){return this._activePartSet}get assetPartDefinition(){return this._assetPartDefinition}get lay(){return this._lay}get geometryType(){return this._geometryType}get isMain(){return this._isMain}get isDefault(){return this._isDefault}get isAnimation(){return this._isAnimation}get startFromFrameZero(){return this._startFromFrameZero}get prevents(){return this._prevents}get preventHeadTurn(){return this._preventHeadTurn}get params(){return this._params}}class Zl{constructor(t,e="",s=0){this._actionType=t||"",this._actionParameter=e||"",this._definition=null,this._startFrame=s||0,this._overridingAction=null}dispose(){this._actionType=null,this._actionParameter=null,this._definition=null}get id(){return this._definition?this._definition.id+"_"+this._actionParameter:""}get actionType(){return this._actionType}get actionParameter(){return this._actionParameter}set actionParameter(t){this._actionParameter=t}get definition(){return this._definition}set definition(t){this._definition=t}get startFrame(){return this._startFrame}get overridingAction(){return this._overridingAction}set overridingAction(t){this._overridingAction=t}}class Lm{constructor(t,e){this._assets=t,this._actions=new Map,this._defaultAction=null,this.updateActions(e)}updateActions(t){if(t){for(const e of t.actions){if(!e||!e.state)continue;const s=new Dm(e);this._actions.set(s.state,s)}t.actionOffsets&&this.parseActionOffsets(t.actionOffsets)}}parseActionOffsets(t){if(!(!t||!t.length))for(const e of t){const s=this._actions.get(e.action);if(s)for(const i of e.offsets){const r=i.size||"",a=i.direction;if(r===""||a===void 0)continue;const o=i.x||0,h=i.y||0,_=i.z||0;s.setOffsets(r,a,[o,h,_])}}}getActionDefinition(t){if(!t)return null;for(const e of this._actions.values())if(!(!e||e.id!==t))return e;return null}getActionDefinitionWithState(t){const e=this._actions.get(t);return e||null}getDefaultAction(){if(this._defaultAction)return this._defaultAction;for(const t of this._actions.values())if(!(!t||!t.isDefault))return this._defaultAction=t,t;return null}getCanvasOffsets(t,e,s){let i=[];for(const r of t){if(!r)continue;const a=this._actions.get(r.actionType),o=a&&a.getOffsets(e,s);o&&(i=o)}return i}sortActions(t){if(!t)return null;t=this.filterActions(t);const e=[];for(const s of t){if(!s)continue;const i=this._actions.get(s.actionType);i&&(s.definition=i,e.push(s))}return e.sort(this.sortByPrecedence),e}filterActions(t){let e=[];const s=[];for(const i of t){if(!i)continue;const r=this._actions.get(i.actionType);r&&(e=e.concat(r.getPrevents(i.actionParameter)))}for(const i of t){if(!i)continue;let r=i.actionType;i.actionType==="fx"&&(r=r+("."+i.actionParameter)),!(e.indexOf(r)>=0)&&s.push(i)}return s}sortByPrecedence(t,e){if(!t||!e)return 0;const s=t.definition.precedence,i=e.definition.precedence;return s<i?1:s>i?-1:0}}class Pm{constructor(t,e){this._name=t,this._link=e.link,this._flipH=e.flipH,this._flipV=e.flipV}get name(){return this._name}get link(){return this._link}get flipH(){return this._flipH}get flipV(){return this._flipV}}class Um{constructor(t,e){this._avatarRenderManager=t,this._aliases=new Map,this._assets=e,this._missingAssetNames=[]}dispose(){this._assets=null,this._aliases=null}reset(){this.init()}init(){for(const t of this._assets.collections.values()){if(!t)continue;const e=t.data&&t.data.aliases;if(e)for(const s in e){const i=e[s];i&&this._aliases.set(s,new Pm(s,i))}}}hasAlias(t){return!!this._aliases.get(t)}getAssetName(t){let e=t,s=5;for(;this.hasAlias(e)&&s>=0;)e=this._aliases.get(e).link,s--;return e}getAsset(t){if(!this._assets)return null;t=this.getAssetName(t);const e=this._assets.getAsset(t);return e||null}}class ym{constructor(t){this._id=t.id||"",this._align=t.align||"",this._base=t.base||"",this._ink=t.ink||0,this._blend=0;const e=t.blend;e&&e.length>0&&(this._blend=parseInt(e),this._blend>1&&(this._blend=this._blend/100))}get id(){return this._id}get align(){return this._align}get base(){return this._base}get ink(){return this._ink}get blend(){return this._blend}get isBlended(){return this._blend!==1}}const u_=class u_{constructor(t,e,s){if(this._id=t.id,this._animationFrame=t.frame||0,this._dx=t.dx||0,this._dy=t.dy||0,this._dz=t.dz||0,this._directionOffset=t.dd||0,this._type=e,this._base=t.base||"",this._items=new Map,t.items)for(const i of t.items)this._items.set(i.id,i.base);this._base!==""&&this.baseAsInt().toString(),s&&(this._action=new Zl(s.state,this.base),this._action.definition=s)}get items(){return this._items}baseAsInt(){let t=0,e=0;for(;e<this._base.length;)t=t+this._base.charCodeAt(e),e++;return t}get id(){return this._id}get animationFrame(){return this._animationFrame}get dx(){return this._dx}get dy(){return this._dy}get dz(){return this._dz}get dd(){return this._directionOffset}get type(){return this._type}get base(){return this._base}get action(){return this._action}};u_.BODYPART="bodypart",u_.FX="fx";let ps=u_;class vm{constructor(t){this._ink=t.ink;let e=t.foreground,s=t.background;e=e.replace("#",""),s=s.replace("#",""),this._foreGround=parseInt(e,16),this._backGround=parseInt(s,16),this._colorTransform=null,this._rgb=parseInt(e,16),this._r=this._rgb>>16&255,this._g=this._rgb>>8&255,this._b=this._rgb>>0&255,this._redMultiplier=this._r/255*1,this._greenMultiplier=this._g/255*1,this._blueMultiplier=this._b/255*1,this._alphaMultiplier=1,this._paletteIsGrayscale=!0,this._ink===37&&(this._alphaMultiplier=.5,this._paletteIsGrayscale=!1),this._colorTransform=new im({red:this._r/255,green:this._g/255,blue:this._b/255,alpha:this._alphaMultiplier}),this._colorMap=this.generatePaletteMapForGrayscale(this._backGround,this._foreGround)}get ink(){return this._ink}get colorTransform(){return this._colorTransform}get reds(){return this._colorMap.get("reds")}get greens(){return this._colorMap.get("greens")}get blues(){return this._colorMap.get("blues")}get alphas(){return this._colorMap.get("alphas")}get paletteIsGrayscale(){return this._paletteIsGrayscale}generatePaletteMapForGrayscale(t,e){const s=t>>24&255,i=t>>16&255,r=t>>8&255,a=t>>0&255,o=e>>24&255,h=e>>16&255,_=e>>8&255,l=e>>0&255,c=(o-s)/255,f=(h-i)/255,p=(_-r)/255,m=(l-a)/255,O=new Map,A=[],C=[],L=[];let D=s,U=i,P=r,v=a;for(let F=0;F<256;F++)U==i&&P==r&&v==a&&(D=0),D=D+c,U=U+f,P=P+p,v=v+m,A.push(D<<24|U<<16|P<<8|v),C.push(D<<24|U<<16|P<<8|v),L.push(D<<24|U<<16|P<<8|v);return O.set("alphas",A),O.set("reds",A),O.set("greens",C),O.set("blues",L),O}}class bm{constructor(t){this._offset=t.offset}get offset(){return this._offset}}class Fm{constructor(t,e){this._animation=t,this._id=e.id,this._ink=e.ink,this._member=e.member,this._hasStaticY=!!e.staticY,this._hasDirections=!!e.directions,this._dx=[],this._dy=[],this._dz=[];const s=e.directionList;if(s&&s.length)for(const i of s){const r=i.id;r!==void 0&&(this._dx[r]=i.dx||0,this._dy[r]=i.dy||0,this._dz[r]=i.dz||0)}}getDirectionOffsetX(t){return t<this._dx.length?this._dx[t]:0}getDirectionOffsetY(t){return t<this._dy.length?this._dy[t]:0}getDirectionOffsetZ(t){return t<this._dz.length?this._dz[t]:0}get animation(){return this._animation}get id(){return this._id}get ink(){return this._ink}get member(){return this._member}get hasDirections(){return this._hasDirections}get hasStaticY(){return this._hasStaticY}}const Tn=class Tn{constructor(t,e){if(this._id=e.name,this._description=this._id,this._frames=[],this._spriteData=null,this._avatarData=null,this._directionData=null,this._removeData=null,this._addData=null,this._overriddenActions=null,this._overrideFrames=null,this._resetOnToggle=e.resetOnToggle||!1,e.sprites&&e.sprites.length){this._spriteData=[];for(const s of e.sprites)this._spriteData.push(new Fm(this,s))}if(e.avatars&&e.avatars.length&&(this._avatarData=new vm(e.avatars[0])),e.directions&&e.directions.length&&(this._directionData=new bm(e.directions[0])),e.removes&&e.removes.length){this._removeData=[];for(const s of e.removes)this._removeData.push(s.id)}if(e.adds&&e.adds.length){this._addData=[];for(const s of e.adds)this._addData.push(new ym(s))}if(e.overrides&&e.overrides.length){this._overrideFrames=new Map,this._overriddenActions=new Map;for(const s of e.overrides){const i=s.name,r=s.override;this._overriddenActions.set(r,i);const a=[];this.parseFrames(a,s.frames,t),this._overrideFrames.set(i,a)}}this.parseFrames(this._frames,e.frames,t)}parseFrames(t,e,s){if(!(!e||!e.length))for(const i of e){let r=1;i.repeats&&i.repeats>1&&(r=i.repeats);let a=0;for(;a<r;){const o=[];if(i.bodyparts&&i.bodyparts.length)for(const h of i.bodyparts){const _=s.getActionDefinition(h.action),l=new ps(h,ps.BODYPART,_);o.push(l)}if(i.fxs&&i.fxs.length)for(const h of i.fxs){const _=s.getActionDefinition(h.action),l=new ps(h,ps.FX,_);o.push(l)}t.push(o),a++}}}frameCount(t=null){if(!t)return this._frames.length;if(this._overrideFrames){const e=this._overrideFrames.get(t);if(e)return e.length}return 0}hasOverriddenActions(){return this._overriddenActions?this._overriddenActions.size>0:!1}overriddenActionNames(){if(!this._overriddenActions)return null;const t=[];for(const e of this._overriddenActions.keys())t.push(e);return t}overridingAction(t){return this._overriddenActions?this._overriddenActions.get(t):null}getFrame(t,e=null){t<0&&(t=0);let s=[];if(!e)this._frames.length>0&&(s=this._frames[t%this._frames.length]);else{const i=this._overrideFrames.get(e);i&&i.length>0&&(s=i[t%i.length])}return s}getAnimatedBodyPartIds(t,e=null){const s=[];for(const i of this.getFrame(t,e))if(i.type===ps.BODYPART)s.push(i.id);else if(i.type===ps.FX&&this._addData&&this._addData.length)for(const r of this._addData)r.id===i.id&&s.push(r.align);return s}getLayerData(t,e,s=null){for(const i of this.getFrame(t,s)){if(i.id===e)return i;if(i.type===ps.FX&&this._addData&&this._addData.length){for(const r of this._addData)if(r.align===e&&r.id===i.id)return i}}return null}hasAvatarData(){return this._avatarData!==null}hasDirectionData(){return this._directionData!==null}hasAddData(){return this._addData!==null}getAddData(t){if(this._addData){for(const e of this._addData)if(e.id===t)return e}return null}get id(){return this._id}get spriteData(){return this._spriteData||Tn.EMPTY_ARRAY}get avatarData(){return this._avatarData}get directionData(){return this._directionData}get removeData(){return this._removeData||Tn.EMPTY_ARRAY}get addData(){return this._addData||Tn.EMPTY_ARRAY}toString(){return this._description}get resetOnToggle(){return this._resetOnToggle}};Tn.EMPTY_ARRAY=[];let $l=Tn;class xm{constructor(){this._animations=new Map}registerAnimation(t,e){if(!e)return!1;const s=e[Object.keys(e)[0]],i=new $l(t,s);return this._animations.set(s.name,i),!0}getAnimation(t){const e=this._animations.get(t);return e||null}getLayerData(t,e,s){const i=this.getAnimation(t);return i?i.getLayerData(e,s):null}get animations(){return this._animations}}const ye=class ye extends $e{constructor(t,e,s,i){super(),this._state=ye.NOT_LOADED,this._libraryName=t,this._revision=e,this._downloadUrl=i,this._assets=s,this._downloadUrl=this._downloadUrl.replace(/%libname%/gi,this._libraryName),this._downloadUrl=this._downloadUrl.replace(/%revision%/gi,this._revision),this._assets.getCollection(this._libraryName)&&(this._state=ye.LOADED)}async downloadAsset(){if(!this._assets||this._state===ye.LOADING||this._state===ye.LOADED)return;if(this._assets.getCollection(this._libraryName)){this._state=ye.LOADED,this.dispatchEvent(new Fr(Fr.DOWNLOAD_COMPLETE,this));return}this._state=ye.LOADING,await this._assets.downloadAsset(this._downloadUrl)&&(this._state=ye.LOADED,this.dispatchEvent(new Fr(Fr.DOWNLOAD_COMPLETE,this)))}get libraryName(){return this._libraryName}get isLoaded(){return this._state===ye.LOADED}};ye.DOWNLOAD_COMPLETE="AADL_DOWNLOAD_COMPLETE",ye.NOT_LOADED=0,ye.LOADING=1,ye.LOADED=2;let tc=ye;const mr=class mr extends $e{constructor(t,e){super(),this._assets=t,this._structure=e,this._missingMandatoryLibs=q.getValue("avatar.mandatory.libraries"),this._figureMap=new Map,this._pendingContainers=[],this._figureListeners=new Map,this._incompleteFigures=new Map,this._pendingDownloadQueue=[],this._currentDownloads=[],this._libraryNames=[],this._isReady=!1,this.onLibraryLoaded=this.onLibraryLoaded.bind(this),this.onAvatarRenderReady=this.onAvatarRenderReady.bind(this),this.loadFigureMap(),this._structure.renderManager.events.addEventListener(ka.AVATAR_RENDER_READY,this.onAvatarRenderReady)}loadFigureMap(){const t=new XMLHttpRequest;try{t.open("GET",q.getValue("avatar.figuremap.url")),t.send(),t.onloadend=e=>{if(t.responseText){const s=JSON.parse(t.responseText);this.processFigureMap(s.libraries),this.processMissingLibraries(),this._isReady=!0,this.dispatchEvent(new gt(mr.DOWNLOADER_READY))}},t.onerror=e=>{throw new Error("invalid_avatar_figure_map")}}catch(e){j.error(e)}}processFigureMap(t){if(t)for(const e of t){if(!e)continue;const s=e.id,i=e.revision||"";if(this._libraryNames.indexOf(s)>=0)continue;this._libraryNames.push(s);const r=new tc(s,i,this._assets,q.getValue("avatar.asset.url"));r.addEventListener(Fr.DOWNLOAD_COMPLETE,this.onLibraryLoaded);for(const a of e.parts){const o=a.id,_=a.type+":"+o;let l=this._figureMap.get(_);l||(l=[]),l.push(r),this._figureMap.set(_,l)}}}onAvatarRenderReady(t){if(t){for(const[e,s]of this._pendingContainers)this.downloadAvatarFigure(e,s);this._pendingContainers=[]}}onLibraryLoaded(t){if(!t||!t.library)return;const e=[];for(const[i,r]of this._incompleteFigures.entries()){let a=!0;for(const o of r)if(!(!o||o.isLoaded)){a=!1;break}if(a){e.push(i);const o=this._figureListeners.get(i);if(o)for(const h of o)!h||h.disposed||h.resetFigure(i);this._figureListeners.delete(i),this.dispatchEvent(new gt(mr.LIBRARY_LOADED))}}for(const i of e)i&&this._incompleteFigures.delete(i);let s=0;for(;s<this._currentDownloads.length;){const i=this._currentDownloads[s];i&&i.libraryName===t.library.libraryName&&this._currentDownloads.splice(s,1),s++}}processMissingLibraries(){const t=this._missingMandatoryLibs.slice();for(const e of t){if(!e)continue;const s=this._figureMap.get(e);if(s)for(const i of s)i&&this.downloadLibrary(i)}}isAvatarFigureContainerReady(t){return!this._isReady||!this._structure.renderManager.isReady?!1:!this.getAvatarFigurePendingLibraries(t).length}getAvatarFigurePendingLibraries(t){const e=[];if(!t||!this._structure)return e;const s=this._structure.figureData;if(!s)return e;const i=t.getPartTypeIds();for(const r of i){const a=s.getSetType(r);if(!a)continue;const o=a.getPartSet(t.getPartSetId(r));if(o)for(const h of o.parts){if(!h)continue;const _=h.type+":"+h.id,l=this._figureMap.get(_);if(l!==void 0)for(const c of l)!c||c.isLoaded||e.indexOf(c)>=0||e.push(c)}}return e}downloadAvatarFigure(t,e){if(!this._isReady||!this._structure.renderManager.isReady){this._pendingContainers.push([t,e]);return}const s=t.getFigureString(),i=this.getAvatarFigurePendingLibraries(t);if(i&&i.length){if(e&&!e.disposed){let r=this._figureListeners.get(s);r||(r=[],this._figureListeners.set(s,r)),r.push(e)}this._incompleteFigures.set(s,i);for(const r of i)r&&this.downloadLibrary(r)}else e&&!e.disposed&&e.resetFigure(s)}downloadLibrary(t){!t||t.isLoaded||this._pendingDownloadQueue.indexOf(t)>=0||this._currentDownloads.indexOf(t)>=0||(this._pendingDownloadQueue.push(t),this.processDownloadQueue())}processDownloadQueue(){for(;this._pendingDownloadQueue.length;)this._pendingDownloadQueue[0].downloadAsset(),this._currentDownloads.push(this._pendingDownloadQueue.shift())}};mr.DOWNLOADER_READY="AADM_DOWNLOADER_READY",mr.LIBRARY_LOADED="AADM_LIBRARY_LOADED",mr.MAX_DOWNLOADS=2;let or=mr;class oo{constructor(t){this._parts=new Map,this.parseFigure(t)}getPartTypeIds(){return this.partSets().keys()}hasPartType(t){return!!this.partSets().get(t)}getPartSetId(t){const e=this.partSets().get(t);return e?e.get("setid"):0}getPartColorIds(t){const e=this.partSets().get(t);return e?e.get("colorids"):null}updatePart(t,e,s){const i=new Map;i.set("type",t),i.set("setid",e),i.set("colorids",s);const r=this.partSets();r.delete(t),r.set(t,i)}removePart(t){this.partSets().delete(t)}getFigureString(){const t=[];for(const e of this.partSets().keys()){if(!e)continue;let s=[];s.push(e),s.push(this.getPartSetId(e)),s=s.concat(this.getPartColorIds(e)),t.push(s.join("-"))}return t.join(".")}partSets(){return this._parts||(this._parts=new Map),this._parts}parseFigure(t){t||(t="");for(const e of t.split(".")){const s=e.split("-");if(s.length>=2){const i=s[0],r=parseInt(s[1]),a=[];let o=2;for(;o<s.length;)a.push(parseInt(s[o])),o++;this.updatePart(i,r,a)}}}}class Gm{constructor(){this._cache=new Map,this.setLastAccessTime(nt())}dispose(){if(this.debugInfo("[dispose]"),!!this._cache){for(const t of this._cache.values())t&&t.dispose();this._cache.clear()}}getDirectionCache(t){const e=this._cache.get(t.toString());return e||null}updateDirectionCache(t,e){this._cache.set(t.toString(),e)}setLastAccessTime(t){this._lastAccessTime=t}getLastAccessTime(){return this._lastAccessTime}debugInfo(t){}}class KE{constructor(){this._cache=new Map}setAction(t,e){this._currentAction||(this._currentAction=t);const s=this.getActionCache(this._currentAction);s&&s.setLastAccessTime(e),this._currentAction=t}dispose(){if(!this._disposed){if(!this._cache)return;this.disposeActions(0,2147483647),this._cache.clear(),this._cache=null,this._disposed=!0}}disposeActions(t,e){if(!(!this._cache||this._disposed))for(const[s,i]of this._cache.entries()){if(!i)continue;const r=i.getLastAccessTime();e-r>=t&&(i.dispose(),this._cache.delete(s))}}getAction(){return this._currentAction}setDirection(t){this._currentDirection=t}getDirection(){return this._currentDirection}getActionCache(t=null){return this._currentAction?(t||(t=this._currentAction),t.overridingAction?this._cache.get(t.overridingAction):this._cache.get(t.id)):null}updateActionCache(t,e){t.overridingAction?this._cache.set(t.overridingAction,e):this._cache.set(t.id,e)}debugInfo(t){}}class Bm{constructor(t,e,s){this._image=t,this._regPoint=e,this._offset=new K(0,0),this._regPoint=e,this._isCacheable=s,this.cleanPoints()}dispose(){this._image&&this._image.destroy({children:!0}),this._image=null,this._regPoint=null,this._offset=null}cleanPoints(){}setRegPoint(t){this._regPoint=t,this.cleanPoints()}get image(){return this._image}set image(t){this._image&&this._image!==t&&this._image.destroy({children:!0}),this._image=t}get regPoint(){const t=this._regPoint.clone();return t.x+=this._offset.x,t.y+=this._offset.y,t}set offset(t){this._offset=t,this.cleanPoints()}get isCacheable(){return this._isCacheable}}class wm{constructor(t){this._partList=t,this._images=new Map}dispose(){for(const t of this._images.values())t&&t.dispose();this._images=null}getPartList(){return this._partList}getImageContainer(t){const e=this._images.get(this.getCacheKey(t));return e||null}updateImageContainer(t,e){const s=this.getCacheKey(e),i=this._images.get(s);i&&i.dispose(),this._images.set(s,t)}getCacheKey(t){let e="";for(const s of this._partList)e+=s.getCacheableKey(t)+"/";return e}debugInfo(t){}}class XE{constructor(t,e,s,i,r,a=null){this._texture=t,this._container=a,this._rect=e,this._regPoint=s,this._flipH=i,this._colorTransform=r,i&&(this._regPoint.x=-this._regPoint.x+e.width)}dispose(){this._texture=null,this._regPoint=null,this._colorTransform=null}get texture(){return this._texture}get container(){return this._container}get rect(){return this._rect}get regPoint(){return this._regPoint}get flipH(){return this._flipH}get colorTransform(){return this._colorTransform}get offsetRect(){return new we(-this._regPoint.x,-this._regPoint.y,this._rect.width,this._rect.height)}}const IE=class IE{constructor(t,e,s,i){this._structure=t,this._avatar=e,this._assets=s,this._scale=i,this._cache=new Map,this._canvas=null,this._disposed=!1,this._unionImages=[],this._matrix=new Me,this._serverRenderData=[]}dispose(){if(!this._disposed){if(this._structure=null,this._avatar=null,this._assets=null,this._canvas=null,this._disposed=!0,this._cache){for(const t of this._cache.values())t&&t.dispose();this._cache=null}if(this._unionImages){for(const t of this._unionImages)t&&t.dispose();this._unionImages=[]}}}disposeInactiveActions(t=6e4){const e=nt();if(this._cache)for(const s of this._cache.values())s&&s.disposeActions(t,e)}resetBodyPartCache(t){if(this._cache)for(const e of this._cache.values())e&&e.setAction(t,0)}setDirection(t,e){const s=this._structure.getBodyPartsUnordered(t);if(s)for(const i of s){const r=this.getBodyPartCache(i);r&&r.setDirection(e)}}setAction(t,e){const s=this._structure.getActiveBodyPartIds(t,this._avatar);for(const i of s){const r=this.getBodyPartCache(i);r&&r.setAction(t,e)}}setGeometryType(t){if(this._geometryType!==t){if(this._geometryType===Mi.SITTING&&t===Mi.VERTICAL||this._geometryType===Mi.VERTICAL&&t===Mi.SITTING||this._geometryType===Mi.SNOWWARS_HORIZONTAL&&(t=Mi.SNOWWARS_HORIZONTAL)){this._geometryType=t,this._canvas=null;return}this.disposeInactiveActions(0),this._geometryType=t,this._canvas=null}}getImageContainer(t,e,s=!1){let i=this.getBodyPartCache(t);i||(i=new KE,this._cache.set(t,i));let r=i.getDirection(),a=i.getAction(),o=e;a.definition.startFromFrameZero&&(o-=a.startFrame);let h=a,_=[],l=new Map;const c=new K;if(!(!a||!a.definition)&&a.definition.isAnimation){let A=r;const C=this._structure.getAnimation(a.definition.state+"."+a.actionParameter),L=e-a.startFrame;if(C){const D=C.getLayerData(L,t,a.overridingAction);D&&(A=r+D.dd,D.dd<0?A<0?A=8+A:A>7&&(A=8-A):A<0?A=A+8:A>7&&(A=A-8),this._scale===Ks.LARGE?(c.x=D.dx,c.y=D.dy):(c.x=D.dx/2,c.y=D.dy/2),o=D.animationFrame,D.action&&(a=D.action),D.type===ps.BODYPART?(D.action!=null&&(h=D.action),r=A):D.type===ps.FX&&(r=A),l=D.items),_=C.removeData}}let f=i.getActionCache(h);(!f||s)&&(f=new Gm,i.updateActionCache(h,f));let p=f.getDirectionCache(r);if(!p||s){const A=this._structure.getParts(t,this._avatar.getFigure(),h,this._geometryType,r,_,this._avatar,l);p=new wm(A),f.updateDirectionCache(r,p)}let m=p.getImageContainer(o);if(!m||s){const A=p.getPartList();if(m=this.renderBodyPart(r,A,o,a,s),m&&!s)m.isCacheable&&p.updateImageContainer(m,o);else return null}const O=this._structure.getFrameBodyPartOffset(h,r,o,t);return c.x+=O.x,c.y+=O.y,m.offset=c,m}getServerRenderData(){return this._serverRenderData=[],this._serverRenderData}getBodyPartCache(t){let e=this._cache.get(t);return e||(e=new KE,this._cache.set(t,e)),e}renderBodyPart(t,e,s,i,r=!1){if(!e||!e.length||!this._canvas&&(this._canvas=this._structure.getCanvas(this._scale,this._geometryType),!this._canvas))return null;const a=Ki.DIRECTION_IS_FLIPPED[t]||!1;let o=i.definition.assetPartDefinition,h=!0,_=e.length-1;for(;_>=0;){const m=e[_];let O=16777215;if(!(t==7&&(m.partType==="fc"||m.partType==="ey"))&&!(m.partType==="ri"&&!m.partId)){const A=m.partId,C=m.getFrameDefinition(s);let L=m.partType,D=0;C?(D=C.number,C.assetPartDefinition&&C.assetPartDefinition!==""&&(o=C.assetPartDefinition)):D=m.getFrameIndex(s);let U=t,P=!1;a&&(o==="wav"&&(L===De.LEFT_HAND||L===De.LEFT_SLEEVE||L===De.LEFT_COAT_SLEEVE)||o==="drk"&&(L===De.RIGHT_HAND||L===De.RIGHT_SLEEVE||L===De.RIGHT_COAT_SLEEVE)||o==="blw"&&L===De.RIGHT_HAND||o==="sig"&&L===De.LEFT_HAND||o==="respect"&&L===De.LEFT_HAND||L===De.RIGHT_HAND_ITEM||L===De.LEFT_HAND_ITEM||L===De.CHEST_PRINT?P=!0:(t===4?U=2:t===5?U=1:t===6&&(U=0),m.flippedPartType!==L&&(L=m.flippedPartType)));let v=this._scale+"_"+o+"_"+L+"_"+A+"_"+U+"_"+D,F=this._assets.getAsset(v);if(F||(v=this._scale+"_std_"+L+"_"+A+"_"+U+"_0",F=this._assets.getAsset(v)),F){const $=F.texture;if(!$||!$.valid||!$.baseTexture)h=!1;else{m.isColorable&&m.color&&(O=m.color.rgb);const et=new K(-F.x,-F.y);if(P&&(et.x=et.x+(this._scale===Ks.LARGE?65:31)),r){const at=new Og;at.name=this._assets.getAssetName(v),at.x=-et.x-33,at.y=-et.y,at.z=this._serverRenderData.length*-1e-4,at.width=F.rectangle.width,at.height=F.rectangle.height,at.flipH=P,o==="lay"&&(at.x=at.x+53),a&&(at.flipH=!at.flipH,at.flipH?at.x=-at.x-$.width:at.x=at.x+65),m.isColorable&&(at.color=`${O}`),this._serverRenderData.push(at)}this._unionImages.push(new XE($,F.rectangle,et,P,O))}}}_--}if(!this._unionImages.length)return null;const l=this.createUnionImage(this._unionImages,a),c=this._scale===Ks.LARGE?this._canvas.height-16:this._canvas.height-8,f=new K(-l.regPoint.x,c-l.regPoint.y);a&&o!=="lay"&&(f.x=f.x+(this._scale===Ks.LARGE?67:31));let p=this._unionImages.length-1;for(;p>=0;){const m=this._unionImages.pop();m&&m.dispose(),p--}return new Bm(l.container,f,h)}convertColorToHex(t){let e=(t*255).toString(16);return e.length<2&&(e="0"+e),e}createUnionImage(t,e){const s=new we;for(const o of t)o&&s.enlarge(o.offsetRect);const i=new K(-s.x,-s.y),r=new Rs,a=new xt(Ft.EMPTY);a.width=s.width,a.height=s.height,r.addChild(a);for(const o of t){if(!o)continue;const h=o.texture,_=o.colorTransform,l=!(e&&o.flipH)&&(e||o.flipH),c=i.clone();c.x-=o.regPoint.x,c.y-=o.regPoint.y,e&&(c.x=r.width-(c.x+o.rect.width)),l?(this._matrix.a=-1,this._matrix.tx=o.rect.x+o.rect.width+c.x,this._matrix.ty=c.y-o.rect.y):(this._matrix.a=1,this._matrix.tx=c.x-o.rect.x,this._matrix.ty=c.y-o.rect.y);const f=new xt(h);f.tint=_,f.transform.setFromMatrix(this._matrix),r.addChild(f)}return new XE(null,r.getLocalBounds(),i,e,null,r)}};IE.DEFAULT_MAX_CACHE_STORAGE_TIME_MS=6e4;let ec=IE;const Zt=class Zt{constructor(t,e,s,i,r,a=null){this._frameCounter=0,this._directionOffset=0,this._isAnimating=!1,this._animationHasResetOnToggle=!1,this._actionsSorted=!1,this._fullImageCacheSize=5,this._isCachedImage=!1,this._useFullImageCache=!1,this._effectIdInUse=-1,this._cachedBodyPartsDirection=-1,this._cachedBodyPartsGeometryType=null,this._cachedBodyPartsAvatarSet=null,this._canvasOffsets=[],this._actions=[],this._cachedBodyParts=[],this._changes=!0,this._disposed=!1,this._effectManager=r,this._structure=t,this._assets=e,this._scale=i,this._effectListener=a,this._scale==null&&(this._scale=Ks.LARGE),s==null&&(s=new oo("hr-893-45.hd-180-2.ch-210-66.lg-270-82.sh-300-91.wa-2007-.ri-1-")),this._figure=s,this._cache=new ec(this._structure,this,this._assets,this._scale),this.setDirection(Zt.DEFAULT_AVATAR_SET,Zt.DEFAULT_DIRECTION),this._actions=[],this._defaultAction=new Zl(H.POSTURE_STAND),this._defaultAction.definition=this._structure.getActionDefinition(Zt.DEFAULT_ACTION),this.resetActions(),this._fullImageCache=new Xt,this._animationFrameCount=0}getServerRenderData(){return this.getAvatarPartsForCamera(Ce.FULL),this._cache.getServerRenderData()}dispose(){if(!this._disposed){if(this._structure=null,this._assets=null,this._mainAction=null,this._figure=null,this._avatarSpriteData=null,this._actions=null,this._image&&(this._image.destroy(),this._image=null),this._cache&&(this._cache.dispose(),this._cache=null),this._fullImageCache){for(const t of this._fullImageCache.getValues())t&&t.destroy();this._fullImageCache=null}this._image=null,this._canvasOffsets=null,this._disposed=!0}}get disposed(){return this._disposed}getFigure(){return this._figure}getScale(){return this._scale}getPartColor(t){return this._structure.getPartColor(this._figure,t)}setDirection(t,e){e=e+this._directionOffset,e<Ki.MIN_DIRECTION&&(e=Ki.MAX_DIRECTION+(e+1)),e>Ki.MAX_DIRECTION&&(e=e-(Ki.MAX_DIRECTION+1)),this._structure.isMainAvatarSet(t)&&(this._mainDirection=e),(t===Ce.HEAD||t===Ce.FULL)&&(t===Ce.HEAD&&this.isHeadTurnPreventedByAction()&&(e=this._mainDirection),this._headDirection=e),this._cache.setDirection(t,e),this._changes=!0}setDirectionAngle(t,e){this.setDirection(t,Math.floor(e/45))}getSprites(){return this._sprites}getCanvasOffsets(){return this._canvasOffsets}getLayerData(t){return this._structure.getBodyPartData(t.animation.id,this._frameCounter,t.id)}updateAnimationByFrames(t=1){this._frameCounter+=t,this._changes=!0}resetAnimationFrameCounter(){this._frameCounter=0,this._changes=!0}getBodyParts(t,e,s){return(s!=this._cachedBodyPartsDirection||e!=this._cachedBodyPartsGeometryType||t!=this._cachedBodyPartsAvatarSet)&&(this._cachedBodyPartsDirection=s,this._cachedBodyPartsGeometryType=e,this._cachedBodyPartsAvatarSet=t,this._cachedBodyParts=this._structure.getBodyParts(t,e,s)),this._cachedBodyParts}getAvatarPartsForCamera(t){if(this._mainAction===null||this._structure.getCanvas(this._scale,this._mainAction.definition.geometryType)===null)return;const s=this.getBodyParts(t,this._mainAction.definition.geometryType,this._mainDirection);for(let i=s.length-1;i>=0;i--){const r=s[i];this._cache.getImageContainer(r,this._frameCounter,!0)}}getImage(t,e,s=1,i=!0){if(!this._changes)return this._image;if(!this._mainAction)return null;this._actionsSorted||this.endActionAppends();const r=this._structure.getCanvas(this._scale,this._mainAction.definition.geometryType);if(!r)return null;this._image&&(this._image.width!==r.width||this._image.height!==r.height)&&(this._reusableTexture&&(this._reusableTexture.destroy(!0),this._reusableTexture=null),this._image=null,this._isCachedImage=!1);const a=this.getBodyParts(t,this._mainAction.definition.geometryType,this._mainDirection);this._image=null;const o=new Rs;let h=!0,_=a.length-1;for(;_>=0;){const l=a[_],c=this._cache.getImageContainer(l,this._frameCounter);if(c){const f=c.image;if(!f)return o.destroy({children:!0}),null;h=h&&c.isCacheable;const p=c.regPoint.clone();if(p){p.x+=r.offset.x,p.y+=r.offset.y,p.x+=r.regPoint.x,p.y+=r.regPoint.y;const m=new Rs;m.addChild(f),m&&(m.position.set(p.x,p.y),o.addChild(m))}}_--}return this._avatarSpriteData&&(o.filters||(o.filters=[]),this._avatarSpriteData.colorTransform&&o.filters.push(this._avatarSpriteData.colorTransform),this._avatarSpriteData.paletteIsGrayscale&&(this.convertToGrayscale(o),o.filters.push(new co(this._avatarSpriteData.reds,co.CHANNEL_RED)))),i?(this._reusableTexture?(Kt.instance.renderer.render(o,{renderTexture:this._reusableTexture,clear:!0}),this._reusableTexture.baseTexture.hitMap=null):this._reusableTexture=Ut.generateTexture(o,new we(0,0,r.width,r.height)),this._reusableTexture?(this._image=this._reusableTexture,this._changes=!1,this._image):null):Ut.generateTexture(o,new we(0,0,r.width,r.height))}applyPalette(t,e=[],s=[],i=[]){const r=Ut.generateCanvas(t),a=r.getContext("2d"),o=a.getImageData(0,0,r.width,r.height),h=o.data;for(let l=0;l<h.length;l+=4){if(e.length==256){let c=e[h[l]];c===void 0&&(c=0),h[l]=c>>16&255,h[l+1]=c>>8&255,h[l+2]=c&255}if(s.length==256){let c=s[h[l+1]];c===void 0&&(c=0),h[l]=c>>16&255,h[l+1]=c>>8&255,h[l+2]=c&255}if(i.length==256){let c=s[h[l+2]];c===void 0&&(c=0),h[l]=c>>16&255,h[l+1]=c>>8&255,h[l+2]=c&255}}a.putImageData(o,0,0);const _=new bt(Ft.from(r));return Kt.instance.renderer.render(_,{renderTexture:t,clear:!0}),t}getImageAsSprite(t,e=1){if(!this._mainAction)return null;this._actionsSorted||this.endActionAppends();const s=this._structure.getCanvas(this._scale,this._mainAction.definition.geometryType);if(!s)return null;const i=this.getBodyParts(t,this._mainAction.definition.geometryType,this._mainDirection),r=new xt,a=new xt(Ft.EMPTY);a.width=s.width,a.height=s.height,r.addChild(a);let o=i.length-1;for(;o>=0;){const h=i[o],_=this._cache.getImageContainer(h,this._frameCounter);if(_){const l=_.image;if(!l)return r.destroy({children:!0}),null;const c=_.regPoint.clone();if(c){c.x+=s.offset.x,c.y+=s.offset.y,c.x+=s.regPoint.x,c.y+=s.regPoint.y;const f=new Rs;f.addChild(l),f.position.set(c.x,c.y),r.addChild(f)}}o--}return r}getCroppedImage(t,e=1){if(!this._mainAction)return null;this._actionsSorted||this.endActionAppends();const s=this._structure.getCanvas(this._scale,this._mainAction.definition.geometryType);if(!s)return null;const i=this.getBodyParts(t,this._mainAction.definition.geometryType,this._mainDirection),r=new Rs;let a=i.length-1;for(;a>=0;){const _=i[a],l=this._cache.getImageContainer(_,this._frameCounter);if(l){const c=l.image;if(!c)return r.destroy({children:!0}),null;const f=l.regPoint.clone();if(f){f.x+=s.offset.x,f.y+=s.offset.y,f.x+=s.regPoint.x,f.y+=s.regPoint.y;const p=new Rs;p.addChild(c),p&&(p.position.set(f.x,f.y),r.addChild(p))}}a--}const o=Ut.generateTexture(r,new we(0,0,s.width,s.height)),h=Ut.generateImage(o);return h||null}getFullImage(t){const e=this._fullImageCache.getValue(t);return e?(e.valid||(this._fullImageCache.remove(t),e.destroy(!0)),e):null}cacheFullImage(t,e){const s=this._fullImageCache.getValue(t);if(s&&(this._fullImageCache.remove(t),s.destroy(!0)),this._fullImageCache.length===this._fullImageCacheSize){const i=this._fullImageCache.getKey(0);i&&this._fullImageCache.remove(i).destroy(!0)}this._fullImageCache.add(t,e)}getAsset(t){return this._assets.getAsset(t)}getDirection(){return this._mainDirection}initActionAppends(){this._actions=[],this._actionsSorted=!1,this._currentActionsString="",this._useFullImageCache=!1}endActionAppends(){if(this.sortActions()){for(const t of this._sortedActions)t.actionType===H.EFFECT&&(this._effectManager.isAvatarEffectReady(parseInt(t.actionParameter))||this._effectManager.downloadAvatarEffect(parseInt(t.actionParameter),this));this.resetActions(),this.setActionsToParts()}}appendAction(t,...e){let s="";switch(this._actionsSorted=!1,e&&e.length>0&&(s=e[0]),s!=null&&(s=s.toString()),t){case H.POSTURE:switch(s){case H.POSTURE_LAY:case H.POSTURE_WALK:case H.POSTURE_STAND:case H.POSTURE_SWIM:case H.POSTURE_FLOAT:case H.POSTURE_SIT:case H.SNOWWAR_RUN:case H.SNOWWAR_DIE_FRONT:case H.SNOWWAR_DIE_BACK:case H.SNOWWAR_PICK:case H.SNOWWAR_THROW:(s===H.POSTURE_LAY||s===H.POSTURE_LAY||s===H.POSTURE_LAY)&&(s===H.POSTURE_LAY&&(this._mainDirection==0?this.setDirection(Ce.FULL,4):this.setDirection(Ce.FULL,2)),this._useFullImageCache=!0,this._useFullImageCache=!0),this.addActionData(s);break}break;case H.GESTURE:switch(s){case H.GESTURE_AGGRAVATED:case H.GESTURE_SAD:case H.GESTURE_SMILE:case H.GESTURE_SURPRISED:this.addActionData(s);break}break;case H.EFFECT:case H.DANCE:case H.TALK:case H.EXPRESSION_WAVE:case H.SLEEP:case H.SIGN:case H.EXPRESSION_RESPECT:case H.EXPRESSION_BLOW_A_KISS:case H.EXPRESSION_LAUGH:case H.EXPRESSION_CRY:case H.EXPRESSION_IDLE:case H.EXPRESSION_SNOWBOARD_OLLIE:case H.EXPRESSION_SNOWBORD_360:case H.EXPRESSION_RIDE_JUMP:s===H.EFFECT&&(s==="33"||s==="34"||s==="35"||s==="36"||s==="38"||s==="39")&&(this._useFullImageCache=!0),this.addActionData(t,s);break;case H.CARRY_OBJECT:case H.USE_OBJECT:{const i=this._structure.getActionDefinitionWithState(t);i&&(s=i.getParameterValue(s)),this.addActionData(t,s);break}}return!0}addActionData(t,e=""){let s;this._actions||(this._actions=[]);let i=0;for(;i<this._actions.length;){if(s=this._actions[i],s.actionType==t&&s.actionParameter==e)return;i++}this._actions.push(new Zl(t,e,this._frameCounter))}isAnimating(){return this._isAnimating||this._animationFrameCount>1}resetActions(){return this._animationHasResetOnToggle=!1,this._isAnimating=!1,this._sprites=[],this._avatarSpriteData=null,this._directionOffset=0,this._structure.removeDynamicItems(this),this._mainAction=this._defaultAction,this._mainAction.definition=this._defaultAction.definition,this.resetBodyPartCache(this._defaultAction),!0}isHeadTurnPreventedByAction(){let t,e;if(this._sortedActions==null)return!1;for(const s of this._sortedActions)t=this._structure.getActionDefinitionWithState(s.actionType),t!=null&&t.getPreventHeadTurn(s.actionParameter)&&(e=!0);return e}sortActions(){let t,e,s;if(this._currentActionsString="",this._sortedActions=this._structure.sortActions(this._actions),this._animationFrameCount=this._structure.maxFrames(this._sortedActions),!this._sortedActions)this._canvasOffsets=[0,0,0],this._lastActionsString!==""&&(s=!0,this._lastActionsString="");else{this._canvasOffsets=this._structure.getCanvasOffsets(this._sortedActions,this._scale,this._mainDirection);for(const i of this._sortedActions)if(this._currentActionsString=this._currentActionsString+(i.actionType+i.actionParameter),i.actionType===H.EFFECT){const r=parseInt(i.actionParameter);this._effectIdInUse!==r&&(t=!0),this._effectIdInUse=r,e=!0}e||(this._effectIdInUse>-1&&(t=!0),this._effectIdInUse=-1),t&&this._cache.disposeInactiveActions(0),this._lastActionsString!=this._currentActionsString&&(s=!0,this._lastActionsString=this._currentActionsString)}return this._actionsSorted=!0,s}setActionsToParts(){if(!this._sortedActions==null)return;const t=nt(),e=[];for(const s of this._sortedActions)e.push(s.actionType);for(const s of this._sortedActions)if(s&&s.definition&&s.definition.isAnimation){const i=this._structure.getAnimation(s.definition.state+"."+s.actionParameter);if(i&&i.hasOverriddenActions()){const r=i.overriddenActionNames();if(r)for(const a of r)e.indexOf(a)>=0&&(s.overridingAction=i.overridingAction(a))}i&&i.resetOnToggle&&(this._animationHasResetOnToggle=!0)}for(const s of this._sortedActions)if(!(!s||!s.definition)&&(s.definition.isAnimation&&s.actionParameter===""&&(s.actionParameter="1"),this.setActionToParts(s,t),s.definition.isAnimation)){this._isAnimating=s.definition.isAnimated(s.actionParameter);const i=this._structure.getAnimation(s.definition.state+"."+s.actionParameter);i&&(this._sprites=this._sprites.concat(i.spriteData),i.hasDirectionData()&&(this._directionOffset=i.directionData.offset),i.hasAvatarData()&&(this._avatarSpriteData=i.avatarData))}}setActionToParts(t,e){t==null||t.definition==null||t.definition.assetPartDefinition!=""&&(t.definition.isMain&&(this._mainAction=t,this._cache.setGeometryType(t.definition.geometryType)),this._cache.setAction(t,e),this._changes=!0)}resetBodyPartCache(t){t&&t.definition.assetPartDefinition!==""&&(t.definition.isMain&&(this._mainAction=t,this._cache.setGeometryType(t.definition.geometryType)),this._cache.resetBodyPartCache(t),this._changes=!0)}get avatarSpriteData(){return this._avatarSpriteData}convertToGrayscale(t,e="CHANNELS_EQUAL"){let s=.33,i=.33,r=.33;switch(e){case Zt.CHANNELS_UNIQUE:s=.3,i=.59,r=.11;break;case Zt.CHANNELS_RED:s=1,i=0,r=0;break;case Zt.CHANNELS_GREEN:s=0,i=1,r=0;break;case Zt.CHANNELS_BLUE:s=0,i=0,r=1;break;case Zt.CHANNELS_DESATURATED:s=.3086,i=.6094,r=.082;break}const a=new mg;return a.matrix=[s,i,r,0,0,s,i,r,0,0,s,i,r,0,0,0,0,0,1,0],t.filters.push(a),t}errorThis(t){}logThis(t){}isPlaceholder(){return!1}forceActionUpdate(){this._lastActionsString=""}get animationHasResetOnToggle(){return this._animationHasResetOnToggle}get mainAction(){return this._mainAction.actionType}resetEffect(t){t===this._effectIdInUse&&(this.resetActions(),this.setActionsToParts(),this._animationHasResetOnToggle=!0,this._changes=!0,this._effectListener&&this._effectListener.resetEffect(t))}};Zt.CHANNELS_EQUAL="CHANNELS_EQUAL",Zt.CHANNELS_UNIQUE="CHANNELS_UNIQUE",Zt.CHANNELS_RED="CHANNELS_RED",Zt.CHANNELS_GREEN="CHANNELS_GREEN",Zt.CHANNELS_BLUE="CHANNELS_BLUE",Zt.CHANNELS_DESATURATED="CHANNELS_DESATURATED",Zt.DEFAULT_ACTION="Default",Zt.DEFAULT_DIRECTION=2,Zt.DEFAULT_AVATAR_SET=Ce.FULL;let Po=Zt;class ho{constructor(t){this._number=t.number,this._assetPartDefinition=t.assetPartDefinition||null}get number(){return this._number}get assetPartDefinition(){return this._assetPartDefinition}}class Vm{constructor(t){if(this._frames=[],t.frames&&t.frames.length>0)for(const e of t.frames){if(!e)continue;this._frames.push(new ho(e));let s=e.repeats||0;if(s>1)for(;--s>0;)this._frames.push(this._frames[this._frames.length-1])}}get frames(){return this._frames}}const mn=class mn{constructor(t){if(this._id=t.id,this._actionParts=new Map,this._bodyPartOffsets=new Map,this._frameCount=0,this._frameIndexes=[],t.parts&&t.parts.length>0)for(const e of t.parts){if(!e)continue;const s=new Vm(e);this._actionParts.set(e.setType,s),this._frameCount=Math.max(this._frameCount,s.frames.length)}if(t.offsets&&t.offsets.frames&&t.offsets.frames.length>0)for(const e of t.offsets.frames){if(!e)continue;const s=e.id;this._frameCount=Math.max(this._frameCount,s);const i=new Map;if(this._bodyPartOffsets.set(s,i),e.directions&&e.directions.length>0)for(const r of e.directions){if(!r)continue;const a=r.id,o=new Map;if(i.set(a,o),r.bodyParts&&r.bodyParts.length>0)for(const h of r.bodyParts){if(!h)continue;const _=h.id;let l=0,c=0;h.dx!==void 0&&(l=h.dx),h.dy!==void 0&&(c=h.dy),o.set(_,new K(l,c))}}if(this._frameIndexes.push(s),e.repeats!==void 0){let r=e.repeats||0;if(r>1)for(;--r>0;)this._frameIndexes.push(s)}}}getPart(t){if(!t)return null;const e=this._actionParts.get(t);return e||null}getFrameBodyPartOffset(t,e,s){const i=e%this._frameIndexes.length,r=this._frameIndexes[i],a=this._bodyPartOffsets.get(r);if(!a)return mn.DEFAULT_OFFSET;const o=a.get(t);if(!o)return mn.DEFAULT_OFFSET;const h=o.get(s);return h||mn.DEFAULT_OFFSET}get id(){return this._id}get parts(){return this._actionParts}get frameCount(){return this._frameCount}};mn.DEFAULT_OFFSET=new K(0,0);let Ka=mn;class Ym{constructor(){this._actions=new Map}parse(t){if(t&&t.length>0)for(const e of t){if(!e)continue;const s=new Ka(e);this._actions.set(s.id,s)}return!0}appendJSON(t){for(const e of t.action)this._actions.set(e.id,new Ka(e));return!0}getAction(t){const e=this._actions.get(t.id);return e||null}getFrameCount(t){const e=this.getAction(t);return e?e.frameCount:0}}class Hm{constructor(t,e){this._id=t.id,this._width=t.width,this._height=t.height,this._offset=new K(t.dx,t.dy),e==Ks.LARGE?this._regPoint=new K((this._width-64)/2,0):this._regPoint=new K((this._width-32)/2,0)}get width(){return this._width}get height(){return this._height}get offset(){return this._offset}get id(){return this._id}get regPoint(){return this._regPoint}}const d_=class d_ extends $e{constructor(t,e){super(),this._dataReceiver=e,this.download(t)}download(t){const e=new XMLHttpRequest;try{e.open("GET",t),e.send(),e.onloadend=s=>{const i=e.responseText;if(!i||!i.length)throw new Error("invalid_figure_data");this._dataReceiver&&this._dataReceiver.appendJSON(JSON.parse(i)),this.dispatchEvent(new gt(d_.AVATAR_STRUCTURE_DONE))},e.onerror=s=>{throw new Error("invalid_avatar_figure_data")}}catch(s){j.error(s)}}};d_.AVATAR_STRUCTURE_DONE="AVATAR_STRUCTURE_DONE";let Uo=d_;class jm{constructor(t){if(!t)throw new Error("invalid_data");this._id=t.id,this._type=t.type,this._index=t.index,this._colorLayerIndex=t.colorindex,this._paletteMapId=-1,this._breed=-1}dispose(){}get id(){return this._id}get type(){return this._type}get breed(){return this._breed}get index(){return this._index}get colorLayerIndex(){return this._colorLayerIndex}get paletteMap(){return this._paletteMapId}}class zm{constructor(t,e){if(!t||!e)throw new Error("invalid_data");this._id=e.id,this._type=t,this._gender=e.gender,this._clubLevel=e.club,this._isColorable=e.colorable,this._isSelectable=e.selectable,this._parts=[],this._hiddenLayers=[],this._isPreSelectable=e.preselectable,this._isSellable=e.sellable;for(const s of e.parts){const i=new jm(s),r=this.getPartIndex(i);r!==-1?this._parts.splice(r,0,i):this._parts.push(i)}if(e.hiddenLayers)for(const s of e.hiddenLayers)this._hiddenLayers.push(s.partType)}dispose(){for(const t of this._parts)t.dispose();this._parts=null,this._hiddenLayers=null}getPartIndex(t){const e=this._parts.length;if(!e)return-1;for(let s=0;s<e;s++){const i=this._parts[s];if(i&&!(i.type!==t.type||i.index>t.index))return s}return-1}getPart(t,e){for(const s of this._parts)if(!(s.type!==t||s.id!==e))return s;return null}get id(){return this._id}get type(){return this._type}get gender(){return this._gender}get clubLevel(){return this._clubLevel}get isColorable(){return this._isColorable}get isSelectable(){return this._isSelectable}get parts(){return this._parts}get hiddenLayers(){return this._hiddenLayers}get isPreSelectable(){return this._isPreSelectable}get isSellable(){return this._isSellable}}class Wm{constructor(t){if(!t)throw new Error("invalid_data");this._id=t.id,this._index=t.index,this._clubLevel=t.club||0,this._isSelectable=t.selectable,this._rgb=parseInt("0x"+t.hexCode,16)}get id(){return this._id}get index(){return this._index}get clubLevel(){return this._clubLevel}get isSelectable(){return this._isSelectable}get rgb(){return this._rgb}}class qE{constructor(t){if(!t)throw new Error("invalid_data");this._id=t.id,this._colors=new Xt,this.append(t)}append(t){for(const e of t.colors){const s=new Wm(e);this._colors.add(e.id.toString(),s)}}getColor(t){return t===void 0||t<0?null:this._colors.getValue(t.toString())||null}get id(){return this._id}get colors(){return this._colors}}class cl{constructor(t){if(!t)throw new Error("invalid_data");this._type=t.type,this._paletteId=t.paletteId,this._isMandatory={},this._isMandatory.F=[t.mandatory_f_0,t.mandatory_f_1],this._isMandatory.M=[t.mandatory_m_0,t.mandatory_m_1],this._partSets=new Xt,this.append(t)}dispose(){for(const t of this._partSets.getValues())t.dispose();this._partSets=null}cleanUp(t){for(const e of t.sets){const s=e.id.toString(),i=this._partSets.getValue(s);i&&(i.dispose(),this._partSets.remove(s))}}append(t){if(!(!t||!t.sets))for(const e of t.sets)this._partSets.add(e.id.toString(),new zm(this._type,e))}getDefaultPartSet(t){for(const e of this._partSets.getValues())if(e&&e.clubLevel===0&&(e.gender===t||e.gender==="U"))return e;return null}getPartSet(t){return this._partSets.getValue(t.toString())}get type(){return this._type}get paletteID(){return this._paletteId}isMandatory(t,e){return this._isMandatory[t.toUpperCase()][Math.min(e,1)]}optionalFromClubLevel(t){return this._isMandatory[t.toUpperCase()].indexOf(!1)}get partSets(){return this._partSets}}class km{constructor(){this._palettes=new Map,this._setTypes=new Map}dispose(){}parse(t){if(!t)return!1;for(const e of t.palettes){const s=new qE(e);s&&this._palettes.set(s.id.toString(),s)}for(const e of t.setTypes){const s=new cl(e);s&&this._setTypes.set(s.type,s)}return!0}injectJSON(t){for(const e of t.setTypes){const s=this._setTypes.get(e.type);s?s.cleanUp(e):this._setTypes.set(e.type,new cl(e))}this.appendJSON(t)}appendJSON(t){if(!t)return!1;for(const e of t.palettes){const s=e.id.toString(),i=this._palettes.get(s);i?i.append(e):this._palettes.set(s,new qE(e))}for(const e of t.setTypes){const s=e.type,i=this._setTypes.get(s);i?i.append(e):this._setTypes.set(s,new cl(e))}return!1}getMandatorySetTypeIds(t,e){const s=[];for(const i of this._setTypes.values())!i||!i.isMandatory(t,e)||s.push(i.type);return s}getDefaultPartSet(t,e){const s=this._setTypes.get(t);return s?s.getDefaultPartSet(e):null}getSetType(t){return this._setTypes.get(t)||null}getPalette(t){return this._palettes.get(t.toString())||null}getFigurePartSet(t){for(const e of this._setTypes.values()){const s=e.getPartSet(t);if(s)return s}return null}}class QE{constructor(t){if(this._id=t.id,this._parts=[],t.activeParts&&t.activeParts.length>0)for(const e of t.activeParts)e&&this._parts.push(e.setType)}get parts(){return this._parts}}class ul{constructor(t){if(!t)throw new Error("invalid_data");this._setType=t.setType,this._flippedSetType=t.flippedSetType||null,this._removeSetType=t.removeSetType||null,this._appendToFigure=!1,this._staticId=-1}hasStaticId(){return this._staticId>=0}get staticId(){return this._staticId}set staticId(t){this._staticId=t}get setType(){return this._setType}get flippedSetType(){return this._flippedSetType}set flippedSetType(t){this._flippedSetType=t}get removeSetType(){return this._removeSetType}get appendToFigure(){return this._appendToFigure}set appendToFigure(t){this._appendToFigure=t}}class Km{constructor(){this._parts=new Map,this._activePartSets=new Map}parse(t){if(t.partSet&&t.partSet.length>0)for(const e of t.partSet)e&&this._parts.set(e.setType,new ul(e));if(t.activePartSets&&t.activePartSets.length>0)for(const e of t.activePartSets)e&&this._activePartSets.set(e.id,new QE(e));return!0}appendJSON(t){if(t.partSet&&t.partSet.length>0)for(const e of t.partSet)e&&this._parts.set(e.setType,new ul(e));if(t.activePartSets&&t.activePartSets.length>0)for(const e of t.activePartSets)e&&this._activePartSets.set(e.id,new QE(e));return!1}getActiveParts(t){const e=this._activePartSets.get(t.activePartSet);return e?e.parts:[]}getPartDefinition(t){const e=this._parts.get(t);return e||null}addPartDefinition(t){const e=t.setType;let s=this._parts.get(e);return s||(s=new ul(t),this._parts.set(e,s)),s}getActivePartSet(t){const e=this._activePartSets.get(t.activePartSet);return e||null}get parts(){return this._parts}get activePartSets(){return this._activePartSets}}class dl{constructor(t,e,s,i,r,a,o,h,_="",l=!1,c=1){this._bodyPartId=t,this._partType=e,this._partId=s,this._color=i,this._frames=r,this._action=a,this._isColorable=o,this._paletteMapId=h,this._flippedPartType=_,this._isBlendable=l,this._blendTransform=null,this._partType==="ey"&&(this._isColorable=!1)}getFrameIndex(t){if(!this._frames||!this._frames.length)return 0;const e=t%this._frames.length;return this._frames[e]instanceof ho?this._frames[e].number:e}getFrameDefinition(t){const e=t%this._frames.length;return this._frames&&this._frames.length>e&&this._frames[e]instanceof ho?this._frames[e]:null}getCacheableKey(t){const e=t%this._frames.length;if(this._frames&&this._frames.length>e&&this._frames[e]instanceof ho){const s=this._frames[e];return this.partId+":"+s.assetPartDefinition+":"+s.number}return this.partId+":"+e}get bodyPartId(){return this._bodyPartId}get partType(){return this._partType}get partId(){return this._partId}get color(){return this._color}get action(){return this._action}get isColorable(){return this._isColorable}set isColorable(t){this._isColorable=t}get paletteMapId(){return this._paletteMapId}get flippedPartType(){return this._flippedPartType}get isBlendable(){return this._isBlendable}toString(){return[this._bodyPartId,this._partType,this._partId].join(":")}}const Q=class Q{constructor(){this._gender="M",this._avatarEffectType=-1}loadAvatarData(t,e){this._data=new Map,this._colors=new Map,this._gender=e,this.parseFigureString(t)}dispose(){this._data=null,this._colors=null,this._isDisposed=!0}get disposed(){return this._isDisposed}parseFigureString(t){if(t)for(const e of t.split(".")){const s=e.split("-");if(s.length>0){const i=s[0],r=parseInt(s[1]),a=[];let o=2;for(;o<s.length;)a.push(parseInt(s[o])),o++;a.length||a.push(0),this.savePartSetId(i,r,!1),this.savePartSetColourId(i,a,!1)}}}hasSetType(t){return!!this._data.get(t)}getPartSetId(t){return this.hasSetType(t)?this._data.get(t):-1}getColourIds(t){return this._colors.get(t)?this._colors.get(t):[]}getFigureString(){let t="";const e=[];for(const[i,r]of this._data.entries()){let a=i+"-"+r;const o=this._colors.get(i);if(o)for(const h of o)a=a+("-"+h);e.push(a)}let s=0;for(;s<e.length;)t=t+e[s],s<e.length-1&&(t=t+"."),s++;return t}savePartData(t,e,s,i=!1){this.savePartSetId(t,e,i),this.savePartSetColourId(t,s,i)}savePartSetId(t,e,s=!0){switch(t){case Q.HD:case Q.HAIR:case Q.HAT:case Q.HEAD_ACCESSORIES:case Q.EYE_ACCESSORIES:case Q.FACE_ACCESSORIES:case Q.SHIRT:case Q.JACKET:case Q.CHEST_ACCESSORIES:case Q.CHEST_PRINTS:case Q.TROUSERS:case Q.SHOES:case Q.TROUSER_ACCESSORIES:e>=0?this._data.set(t,e):this._data.delete(t)}}savePartSetColourId(t,e,s=!0){switch(t){case Q.HD:case Q.HAIR:case Q.HAT:case Q.HEAD_ACCESSORIES:case Q.EYE_ACCESSORIES:case Q.FACE_ACCESSORIES:case Q.SHIRT:case Q.JACKET:case Q.CHEST_ACCESSORIES:case Q.CHEST_PRINTS:case Q.TROUSERS:case Q.SHOES:case Q.TROUSER_ACCESSORIES:this._colors.set(t,e);return}}getFigureStringWithFace(t){const e=[Q.HD];let s="";const i=[];for(const a of e){const o=this._colors.get(a);if(o){let h=this._data.get(a);a===Q.HD&&(h=t);let _=a+"-"+h;if(h>=0){let l=0;for(;l<o.length;)_=_+("-"+o[l]),l++}i.push(_)}}let r=0;for(;r<i.length;)s=s+i[r],r<i.length-1&&(s=s+"."),r++;return s}get gender(){return this._gender}};Q.MALE="M",Q.FEMALE="F",Q.UNISEX="U",Q.SCALE="h",Q.STD="std",Q.DEFAULT_FRAME="0",Q.HD="hd",Q.HAIR="hr",Q.HAT="ha",Q.HEAD_ACCESSORIES="he",Q.EYE_ACCESSORIES="ea",Q.FACE_ACCESSORIES="fa",Q.JACKET="cc",Q.SHIRT="ch",Q.CHEST_ACCESSORIES="ca",Q.CHEST_PRINTS="cp",Q.TROUSERS="lg",Q.SHOES="sh",Q.TROUSER_ACCESSORIES="wa",Q.BLOCKED_FX_TYPES=[28,29,30,33,34,35,36,37,38,39,40,41,42,43,68];let sc=Q;class YY{constructor(t){this._data=[],this._maxSize=t,this._index=0}reset(){this._data=[],this._index=0}addValue(t){this._data.length<this._maxSize?this._data.push(t):this._data[this._index]=t,this._index=(this._index+1)%this._maxSize}getMax(){let t=Number.MIN_VALUE,e=0;for(;e<this._maxSize;)this._data[e]>t&&(t=this._data[e]),e++;return t}getMin(){let t=Number.MAX_VALUE,e=0;for(;e<this._maxSize;)this._data[e]<t&&(t=this._data[e]),e++;return t}}class qt{constructor(t,e){this._location=t,this._direction=e}get location(){return this._location}get direction(){return this._direction}}class el extends Ye{constructor(){super(),this._object=null,this._events=null,this._time=0}initialize(t){}onDispose(){this._object=null}update(t){this._time=t}processUpdateMessage(t){!t||!this._object||(this._object.setLocation(t.location),this._object.setDirection(t.direction))}getEventTypes(){return[]}mergeTypes(t,e){const s=t.concat();for(const i of e)!i||s.indexOf(i)>=0||s.push(i);return s}mouseEvent(t,e){}useObject(){}setObject(t){if(this._object!==t){if(this._object&&this._object.setLogic(null),!t){this.dispose(),this._object=null;return}this._object=t,this._object.setLogic(this)}}tearDown(){}get object(){return this._object}get eventDispatcher(){return this._events}set eventDispatcher(t){this._events=t}get widget(){return null}get contextMenu(){return null}get time(){return this._time}}class Ag{constructor(){this._map=new Map,this._updateCounter=0}dispose(){this._map.clear(),this._updateCounter=0}getValue(t){return this._map.get(t)}setValue(t,e){this._map.has(t)&&this._map.get(t)===e||(this._map.set(t,e),this._updateCounter++)}removeKey(t){t&&(this._map.delete(t),this._updateCounter++)}get updateCounter(){return this._updateCounter}}const E_=class E_ extends Ye{constructor(t,e,s){super(),this._id=t,this._instanceId=E_.OBJECT_COUNTER++,this._type=s,this._model=new Ag,this._location=new R,this._direction=new R,this._states=[],this._visualization=null,this._logic=null,this._pendingLogicMessages=[],this._updateCounter=0,this._isReady=!1;let i=e-1;for(;i>=0;)this._states[i]=0,i--}onDispose(){this._pendingLogicMessages=[],this.setVisualization(null),this.setLogic(null),this._model&&this._model.dispose(),super.onDispose()}getLocation(){return this._location}setLocation(t){t&&(t.x===this._location.x&&t.y===this._location.y&&t.z===this._location.z||(this._location.x=t.x,this._location.y=t.y,this._location.z=t.z,this._updateCounter++))}getDirection(){return this._direction}setDirection(t){t&&(t.x===this._direction.x&&t.y===this._direction.y&&t.z===this._direction.z||(this._direction.x=(t.x%360+360)%360,this._direction.y=(t.y%360+360)%360,this._direction.z=(t.z%360+360)%360,this._updateCounter++))}getState(t=0){return t>=0&&t<this._states.length?this._states[t]:-1}setState(t,e=0){return e>=0&&e<this._states.length?(this._states[e]!==t&&(this._states[e]=t,this._updateCounter++),!0):!1}setVisualization(t){this._visualization!==t&&(this._visualization&&this._visualization.dispose(),this._visualization=t,this._visualization&&(this._visualization.object=this))}setLogic(t){if(this._logic===t)return;const e=this._logic;if(e&&(this._logic=null,e.setObject(null)),this._logic=t,this._logic)for(this._logic.setObject(this);this._pendingLogicMessages.length;){const s=this._pendingLogicMessages.shift();this._logic.processUpdateMessage(s)}}processUpdateMessage(t){if(this._logic)return this._logic.processUpdateMessage(t);this._pendingLogicMessages.push(t)}tearDown(){this._logic&&this._logic.tearDown()}get id(){return this._id}get instanceId(){return this._instanceId}get type(){return this._type}get model(){return this._model}get visualization(){return this._visualization}get mouseHandler(){return this._logic}get logic(){return this._logic}get location(){return this._location}get direction(){return this._direction}get updateCounter(){return this._updateCounter}set updateCounter(t){this._updateCounter=t}get isReady(){return this._isReady}set isReady(t){this._isReady=t}};E_.OBJECT_COUNTER=0;let ic=E_;const g_=class g_{constructor(){this._id=g_.SPRITE_COUNTER++,this._name="",this._type="",this._spriteType=Je.DEFAULT,this._texture=null,this._container=null,this._width=0,this._height=0,this._offsetX=0,this._offsetY=0,this._flipH=!1,this._flipV=!1,this._direction=0,this._alpha=255,this._blendMode=gi.NORMAL,this._color=16777215,this._relativeDepth=0,this._varyingDepth=!1,this._libraryAssetName="",this._clickHandling=!1,this._visible=!0,this._tag="",this._posture=null,this._alphaTolerance=Os.MATCH_OPAQUE_PIXELS,this._filters=[],this._updateCounter=0,this._updateContainer=!1}dispose(){this._texture=null,this._width=0,this._height=0}get id(){return this._id}set id(t){this._id=t}get name(){return this._name}set name(t){this._name!==t&&(this._name=t,this._updateCounter++)}get type(){return this._type}set type(t){this._type=t}get spriteType(){return this._spriteType}set spriteType(t){this._spriteType=t}get texture(){return this._texture}set texture(t){this._texture!==t&&(t&&(this._width=t.width,this._height=t.height),this._texture=t,this._updateCounter++)}get container(){return this._container}set container(t){this._container!==t&&(this.texture=Ft.EMPTY,t&&(this._width=t.width,this._height=t.height),this._container=t,this._updateCounter++,this._updateContainer=!0)}get width(){return this._width}get height(){return this._height}get offsetX(){return this._offsetX}set offsetX(t){this._offsetX!==t&&(this._offsetX=t,this._updateCounter++)}get offsetY(){return this._offsetY}set offsetY(t){this._offsetY!==t&&(this._offsetY=t,this._updateCounter++)}get flipH(){return this._flipH}set flipH(t){this._flipH!==t&&(this._flipH=t,this._updateCounter++)}get flipV(){return this._flipV}set flipV(t){this._flipV!==t&&(this._flipV=t,this._updateCounter++)}get direction(){return this._direction}set direction(t){this._direction=t}get alpha(){return this._alpha}set alpha(t){t=t&255,this._alpha!==t&&(this._alpha=t,this._updateCounter++)}get blendMode(){return this._blendMode}set blendMode(t){this._blendMode!==t&&(this._blendMode=t,this._updateCounter++)}get color(){return this._color}set color(t){t=t&16777215,this._color!==t&&(this._color=t,this._updateCounter++)}get relativeDepth(){return this._relativeDepth}set relativeDepth(t){this._relativeDepth!==t&&(this._relativeDepth=t,this._updateCounter++)}get varyingDepth(){return this._varyingDepth}set varyingDepth(t){t!==this._varyingDepth&&(this._varyingDepth=t,this._updateCounter++)}get libraryAssetName(){return this._libraryAssetName}set libraryAssetName(t){this._libraryAssetName=t}get clickHandling(){return this._clickHandling}set clickHandling(t){this._clickHandling=t}get visible(){return this._visible}set visible(t){this._visible!==t&&(this._visible=t,this._updateCounter++)}get tag(){return this._tag}set tag(t){this._tag!==t&&(this._tag=t,this._updateCounter++)}get posture(){return this._posture}set posture(t){this._posture!==t&&(this._posture=t,this._updateCounter++)}get alphaTolerance(){return this._alphaTolerance}set alphaTolerance(t){this._alphaTolerance!==t&&(this._alphaTolerance=t,this._updateCounter++)}get filters(){return this._filters}set filters(t){this._filters=t,this._updateCounter++}get updateCounter(){return this._updateCounter}get updateContainer(){return this._updateContainer}set updateContainer(t){this._updateContainer=t}};g_.SPRITE_COUNTER=0;let yo=g_;const f_=class f_{constructor(){this._id=f_.VISUALIZATION_COUNTER++,this._object=null,this._asset=null,this._sprites=[],this._scale=-1,this._updateObjectCounter=-1,this._updateModelCounter=-1,this._updateSpriteCounter=-1}initialize(t){return!1}update(t,e,s,i){}reset(){this._scale=-1}dispose(){if(this._sprites){for(;this._sprites.length;){const t=this._sprites[0];t&&t.dispose(),this._sprites.pop()}this._sprites=null}this._object=null,this._asset=null}getSprite(t){return t>=0&&t<this._sprites.length?this._sprites[t]:null}getSpriteList(){return null}createSprite(){return this.createSpriteAtIndex(this._sprites.length)}createSpriteAtIndex(t){const e=new yo;return t>=this._sprites.length?this._sprites.push(e):this._sprites.splice(t,0,e),e}createSprites(t){for(;this._sprites.length>t;){const e=this._sprites[this._sprites.length-1];e&&e.dispose(),this._sprites.pop()}for(;this._sprites.length<t;)this._sprites.push(new yo)}get image(){return this.getImage(0,-1)}getImage(t,e){const s=this.getBoundingRectangle();if(s.width*s.height===0)return null;const i=this.totalSprites,r=[];let a=0;for(;a<i;){const _=this.getSprite(a);_&&_.visible&&_.texture&&r.push(_),a++}r.sort((_,l)=>l.relativeDepth-_.relativeDepth);const o=new Rs;for(a=0;a<r.length;){const _=r[a],l=_.texture;if(l){const c=new xt(l);c.alpha=_.alpha/255,c.tint=_.color,c.x=_.offsetX,c.y=_.offsetY,c.blendMode=_.blendMode,c.filters=_.filters,_.flipH&&(c.scale.x=-1),_.flipV&&(c.scale.y=-1),o.addChild(c)}a++}const h=Ut.generateTexture(o);return h||null}getBoundingRectangle(){const t=this.totalSprites,e=new we;let s=0;for(;s<t;){const i=this.getSprite(s);if(i&&i.texture&&i.visible){const r=i.flipH?-i.width+i.offsetX:i.offsetX,a=i.flipV?-i.height+i.offsetY:i.offsetY,o=new K(r,a);s===0?(e.x=o.x,e.y=o.y,e.width=i.width,e.height=i.height):(o.x<e.x&&(e.x=o.x),o.y<e.y&&(e.y=o.y),o.x+i.width>e.right&&(e.width=o.x+i.width-e.x),o.y+i.height>e.bottom&&(e.height=o.y+i.height-e.y))}s++}return e}get instanceId(){return this._id}get object(){return this._object}set object(t){this._object=t}get asset(){return this._asset}set asset(t){this._asset&&this._asset.removeReference(),this._asset=t,this._asset&&this._asset.addReference()}get sprites(){return this._sprites}get totalSprites(){return this._sprites.length}get updateObjectCounter(){return this._updateObjectCounter}set updateObjectCounter(t){this._updateObjectCounter=t}get updateModelCounter(){return this._updateModelCounter}set updateModelCounter(t){this._updateModelCounter=t}get updateSpriteCounter(){return this._updateSpriteCounter}set updateSpriteCounter(t){this._updateSpriteCounter=t}get spriteCount(){return this._sprites.length}};f_.VISUALIZATION_COUNTER=0;let jn=f_;class Xm{constructor(t){this._roomObjectVariableAccurateZ=t||"",this._location=new R,this._screenLocation=new R,this._locationChanged=!1,this._geometryUpdateId=-1,this._objectUpdateId=-1}dispose(){this._screenLocation=null}updateLocation(t,e){if(!t||!e)return null;let s=!1;const i=t.getLocation();if((e.updateId!==this._geometryUpdateId||t.updateCounter!==this._objectUpdateId)&&(this._objectUpdateId=t.updateCounter,(e.updateId!==this._geometryUpdateId||i.x!==this._location.x||i.y!==this._location.y||i.z!==this._location.z)&&(this._geometryUpdateId=e.updateId,this._location.assign(i),s=!0)),this._locationChanged=s,this._locationChanged){const r=e.getScreenPosition(i);if(!r)return null;const a=t.model.getValue(this._roomObjectVariableAccurateZ);if(isNaN(a)||a===0){const o=new R(Math.round(i.x),Math.round(i.y),i.z);if(o.x!==i.x||o.y!==i.y){const h=e.getScreenPosition(o);this._screenLocation.assign(r),h&&(this._screenLocation.z=h.z)}else this._screenLocation.assign(r)}else this._screenLocation.assign(r);this._screenLocation.x=Math.round(this._screenLocation.x),this._screenLocation.y=Math.round(this._screenLocation.y)}return this._screenLocation}get locationChanged(){return this._locationChanged}}class qm{constructor(){this._sprites=[],this._updateId1=-1,this._updateId2=-1,this._isEmpty=!1}get spriteCount(){return this._sprites.length}get isEmpty(){return this._isEmpty}dispose(){this.setSpriteCount(0)}addSprite(t){this._sprites.push(t)}getSprite(t){return this._sprites[t]}get sprites(){return this._sprites}needsUpdate(t,e){return t===this._updateId1&&e===this._updateId2?!1:(this._updateId1=t,this._updateId2=e,!0)}setSpriteCount(t){if(t<this._sprites.length){let e=t;for(;e<this._sprites.length;){const s=this._sprites[e];s&&s.dispose(),e++}this._sprites.splice(t,this._sprites.length-t)}this._isEmpty=!this._sprites.length}}class Qm{constructor(t){this._location=new Xm(t),this._sprites=new qm}get location(){return this._location}get sprites(){return this._sprites}dispose(){this._location&&(this._location.dispose(),this._location=null),this._sprites&&(this._sprites.dispose(),this._sprites=null)}get objectId(){return this._objectId}set objectId(t){this._objectId=t}}const pa=class pa{constructor(t){this._data=new Map,this._roomObjectVariableAccurateZ=t}dispose(){if(this._data){for(const[t,e]of this._data.entries())e&&(this._data.delete(t),e.dispose());this._data=null}}getObjectCache(t){let e=this._data.get(t);return e||(e=new Qm(this._roomObjectVariableAccurateZ),this._data.set(t,e)),e}removeObjectCache(t){const e=this._data.get(t);e&&(this._data.delete(t),e.dispose())}getSortableSpriteList(){const t=[];for(const e of this._data.values()){if(!e)continue;const s=e.sprites&&e.sprites.sprites;if(!(!s||!s.length)){for(const i of s)if(i&&i.sprite.spriteType!==Je.ROOM_PLANE&&i.sprite.name!==""){const r=new Og;r.objectId=e.objectId,r.x=i.x,r.y=i.y,r.z=i.z,r.name=i.sprite.name||"",r.flipH=i.sprite.flipH,r.alpha=i.sprite.alpha,r.color=i.sprite.color.toString(),r.blendMode=i.sprite.blendMode.toString(),r.width=i.sprite.width,r.height=i.sprite.height,r.type=i.sprite.type,r.posture=i.sprite.posture;const a=this.isSkewedSprite(i.sprite);a&&(r.skew=i.sprite.direction%4===0?-.5:.5),(a||i.name.indexOf("%image.library.url%")>=0||i.name.indexOf("%group.badge.url%")>=0)&&r.width<=pa.MAX_SIZE_FOR_AVG_COLOR&&r.height<=pa.MAX_SIZE_FOR_AVG_COLOR&&i.sprite.name.indexOf("external_image_wallitem")===0&&(r.frame=!0),t.push(r)}}}return!t||!t.length?null:t}isSkewedSprite(t){return t.type?t.type.indexOf("external_image_wallitem")===0&&t.tag==="THUMBNAIL"||t.type.indexOf("guild_forum")===0&&t.tag==="THUMBNAIL":!1}getPlaneSortableSprites(){const t=[];for(const e of this._data.values())for(const s of e.sprites.sprites)s.sprite.spriteType===Je.ROOM_PLANE&&t.push(s);return t}};pa.MAX_SIZE_FOR_AVG_COLOR=200;let rc=pa;const ys=class ys{static hex2rgb(t,e=[]){return e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(t&255)/255,e}static hex2rgba(t,e=[]){return e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(t&255)/255,e[3]=t&255,e}static rgb2hex(t){return(t[0]*255<<16)+(t[1]*255<<8)+(t[2]*255|0)}static rgba2hex(t){return(t[0]*255<<16)+(t[1]*255<<8)+(t[2]*255|0)+(t[3]|0)}static rgbStringToHex(t){const e=t.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);return"#"+ys.getHex(e[1])+ys.getHex(e[2])+ys.getHex(e[3])}static getHex(t){return isNaN(t)?"00":ys.HEX_DIGITS[(t-t%16)/16]+ys.HEX_DIGITS[t%16]}static int2rgb(t){t>>>=0;const e=t&255,s=(t&65280)>>>8;return"rgba("+[(t&16711680)>>>16,s,e,1].join(",")+")"}static rgbToHSL(t){const e=(t>>16&255)/255,s=(t>>8&255)/255,i=(t&255)/255,r=Math.max(e,s,i),a=Math.min(e,s,i),o=r-a;let h=0,_=0,l=0;o==0?h=0:r==e?s>i?h=60*(s-i)/o:h=60*(s-i)/o+360:r==s?h=60*(i-e)/o+120:r==i&&(h=60*(e-s)/o+240),_=.5*(r+a),o==0?l=0:_<=.5?l=o/_*.5:l=o/(1-_)*.5;const c=Math.round(h/360*255),f=Math.round(l*255),p=Math.round(_*255);return(c<<16)+(f<<8)+p}static hslToRGB(t){let e,s,i,r,a;const o=(t>>16&255)/255,h=(t>>8&255)/255,_=(t&255)/255;let l=0,c=0,f=0;h>0?(e=0,s=0,_<.5?e=_*(1+h):e=_+h-_*h,s=2*_-e,i=o+1/3,r=o,a=o-1/3,i<0?i=i+1:i>1&&i--,r<0?r=r+1:r>1&&r--,a<0?a=a+1:a>1&&a--,i*6<1?l=s+(e-s)*6*i:i*2<1?l=e:i*3<2?l=s+(e-s)*6*(2/3-i):l=s,r*6<1?c=s+(e-s)*6*r:r*2<1?c=e:r*3<2?c=s+(e-s)*6*(2/3-r):c=s,a*6<1?f=s+(e-s)*6*a:a*2<1?f=e:a*3<2?f=s+(e-s)*6*(2/3-a):f=s):(l=_,c=_,f=_);const p=Math.round(l*255),m=Math.round(c*255),O=Math.round(f*255);return(p<<16)+(m<<8)+O}static rgb2xyz(t){let e=(t>>16&255)/255,s=(t>>8&255)/255,i=(t>>0&255)/255;return e>.04045?e=Math.pow((e+.055)/1.055,2.4):e=e/12.92,s>.04045?s=Math.pow((s+.055)/1.055,2.4):s=s/12.92,i>.04045?i=Math.pow((i+.055)/1.055,2.4):i=i/12.92,e=e*100,s=s*100,i=i*100,new R(e*.4124+s*.3576+i*.1805,e*.2126+s*.7152+i*.0722,e*.0193+s*.1192+i*.9505)}static xyz2CieLab(t){let e=t.x/95.047,s=t.y/100,i=t.z/108.883;return e>.008856?e=Math.pow(e,1/3):e=7.787*e+16/116,s>.008856?s=Math.pow(s,1/3):s=7.787*s+16/116,i>.008856?i=Math.pow(i,1/3):i=7.787*i+16/116,new R(116*s-16,500*(e-s),200*(s-i))}static rgb2CieLab(t){return ys.xyz2CieLab(ys.rgb2xyz(t))}static colorize(t,e){if(e===4294967295)return t;let s=e>>16&255,i=e>>8&255,r=e&255;return s=(t>>16&255)*s/255,i=(t>>8&255)*i/255,r=(t&255)*r/255,(t&&4278190080)|s<<16|i<<8|r}};ys.HEX_DIGITS=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];let Xa=ys;class JE{constructor(t){t<0&&(t=0),this._reservedNumbers=[],this._freeNumbers=[];let e=0;for(;e<t;)this._freeNumbers.push(e),e++}dispose(){this._reservedNumbers=null,this._freeNumbers=null}reserveNumber(){if(this._freeNumbers.length>0){const t=this._freeNumbers.pop();return this._reservedNumbers.push(t),t}return-1}freeNumber(t){const e=this._reservedNumbers.indexOf(t);e>=0&&(this._reservedNumbers.splice(e,1),this._freeNumbers.push(t))}}class Jm{static getFlipHBitmapData(t){if(!t)return null;const e=Ut.createRenderTexture(t.width,t.height),s=new Me;return s.scale(-1,1),s.translate(t.width,0),Kt.instance.renderer.render(new bt(t),{renderTexture:e,clear:!0,transform:s}),e}static getFlipVBitmapData(t){if(!t)return null;const e=new Me;e.scale(1,-1),e.translate(0,t.height);const s=new Tl;return s.beginTextureFill({texture:t,matrix:e}).drawRect(0,0,t.width,t.height).endFill(),Ut.generateTexture(s)}static getFlipHVBitmapData(t){if(!t)return null;const e=new Me;e.scale(-1,-1),e.translate(t.width,t.height);const s=new Tl;return s.beginTextureFill({texture:t,matrix:e}).drawRect(0,0,t.width,t.height).endFill(),Ut.generateTexture(s)}}const st=class st{static init(t,e){st._currentDelta=0,st._startDelayMs=t,st._effectDurationMs=e,st._initializationTimeMs=nt(),st._state=st.STATE_START_DELAY}static turnVisualizationOn(){if(st._state===st.STATE_NOT_INITIALIZED||st._state===st.STATE_OVER)return;const t=nt()-st._initializationTimeMs;if(t>st._startDelayMs+st._effectDurationMs){st._state=st.STATE_OVER;return}if(st._visualizationOn=!0,t<st._startDelayMs){st._state=st.STATE_START_DELAY;return}st._state=st.STATE_RUNNING,st._currentDelta=(t-st._startDelayMs)/st._effectDurationMs}static turnVisualizationOff(){st._visualizationOn=!1}static isVisualizationOn(){return st._visualizationOn&&st.isRunning()}static isRunning(){return st._state===st.STATE_START_DELAY||st._state===st.STATE_RUNNING}static getDelta(t=0,e=1){return Math.min(Math.max(st._currentDelta,t),e)}static get totalRunningTime(){return st._startDelayMs+st._effectDurationMs}};st.STATE_NOT_INITIALIZED=0,st.STATE_START_DELAY=1,st.STATE_RUNNING=2,st.STATE_OVER=3,st._state=st.STATE_NOT_INITIALIZED,st._visualizationOn=!1,st._currentDelta=0,st._initializationTimeMs=0,st._startDelayMs=20*1e3,st._effectDurationMs=2e3;let ks=st;const vs=class vs{constructor(t,e,s,i=null){this._updateId=0,this._scale=1,this._x_scale=1,this._y_scale=1,this._z_scale=1,this._x_scale_internal=1,this._y_scale_internal=1,this._z_scale_internal=1,this._clipNear=-500,this._clipFar=500,this._displacements=null,this.scale=t,this._x=new R,this._y=new R,this._z=new R,this._directionAxis=new R,this._location=new R,this._direction=new R,this._depth=new R,this._x_scale_internal=1,this._y_scale_internal=1,this.x_scale=1,this.y_scale=1,this._z_scale_internal=Math.sqrt(1/2)/Math.sqrt(3/4),this.z_scale=1,this.location=new R(s.x,s.y,s.z),this.direction=new R(e.x,e.y,e.z),i!=null?this.setDepthVector(i):this.setDepthVector(e),this._displacements=new Map}static getIntersectionVector(t,e,s,i){const r=R.dotProduct(e,i);if(Math.abs(r)<1e-5)return null;const a=R.dif(t,s),o=-R.dotProduct(i,a)/r;return R.sum(t,R.product(e,o))}get updateId(){return this._updateId}get scale(){return this._scale/Math.sqrt(.5)}set scale(t){t<=1&&(t=1),t=t*Math.sqrt(.5),t!=this._scale&&(this._scale=t,this._updateId++)}get directionAxis(){return this._directionAxis}get location(){return this._location.assign(this._loc),this._location.x=this._location.x*this._x_scale,this._location.y=this._location.y*this._y_scale,this._location.z=this._location.z*this._z_scale,this._location}set location(t){if(t==null)return;this._loc==null&&(this._loc=new R);const e=this._loc.x,s=this._loc.y,i=this._loc.z;this._loc.assign(t),this._loc.x=this._loc.x/this._x_scale,this._loc.y=this._loc.y/this._y_scale,this._loc.z=this._loc.z/this._z_scale,(this._loc.x!=e||this._loc.y!=s||this._loc.z!=i)&&this._updateId++}get direction(){return this._direction}set direction(t){let e,s,i,r,a;if(t==null)return;this._dir==null&&(this._dir=new R);const o=this._dir.x,h=this._dir.y,_=this._dir.z;this._dir.assign(t),this._direction.assign(t),(this._dir.x!=o||this._dir.y!=h||this._dir.z!=_)&&this._updateId++;const l=new R(0,1,0),c=new R(0,0,1),f=new R(1,0,0),p=t.x/180*Math.PI,m=t.y/180*Math.PI,O=t.z/180*Math.PI,A=Math.cos(p),C=Math.sin(p),L=R.sum(R.product(l,A),R.product(f,-C)),D=new R(c.x,c.y,c.z),U=R.sum(R.product(l,C),R.product(f,A)),P=Math.cos(m),v=Math.sin(m),F=new R(L.x,L.y,L.z),$=R.sum(R.product(D,P),R.product(U,v)),et=R.sum(R.product(D,-v),R.product(U,P));O!=0?(e=Math.cos(O),s=Math.sin(O),i=R.sum(R.product(F,e),R.product($,s)),r=R.sum(R.product(F,-s),R.product($,e)),a=new R(et.x,et.y,et.z),this._x.assign(i),this._y.assign(r),this._z.assign(a),this._directionAxis.assign(this._z)):(this._x.assign(F),this._y.assign($),this._z.assign(et),this._directionAxis.assign(this._z))}set x_scale(t){this._x_scale!=t*this._x_scale_internal&&(this._x_scale=t*this._x_scale_internal,this._updateId++)}set y_scale(t){this._y_scale!=t*this._y_scale_internal&&(this._y_scale=t*this._y_scale_internal,this._updateId++)}set z_scale(t){this._z_scale!=t*this._z_scale_internal&&(this._z_scale=t*this._z_scale_internal,this._updateId++)}dispose(){this._x=null,this._y=null,this._z=null,this._loc=null,this._dir=null,this._directionAxis=null,this._location=null,this._displacements!=null&&(this._displacements.clear(),this._displacements=null)}setDisplacement(t,e){let s,i;t==null||e==null||this._displacements!=null&&(s=Math.trunc(Math.round(t.x))+"_"+Math.trunc(Math.round(t.y))+"_"+Math.trunc(Math.round(t.z)),this._displacements.delete(s),i=new R,i.assign(e),this._displacements.set(s,i),this._updateId++)}getDisplacenent(t){let e;return this._displacements!=null?(e=Math.trunc(Math.round(t.x))+"_"+Math.trunc(Math.round(t.y))+"_"+Math.trunc(Math.round(t.z)),this._displacements.get(e)):null}setDepthVector(t){let e,s,i;const r=new R(0,1,0),a=new R(0,0,1),o=new R(1,0,0),h=t.x/180*Math.PI,_=t.y/180*Math.PI,l=t.z/180*Math.PI,c=Math.cos(h),f=Math.sin(h),p=R.sum(R.product(r,c),R.product(o,-f)),m=new R(a.x,a.y,a.z),O=R.sum(R.product(r,f),R.product(o,c)),A=Math.cos(_),C=Math.sin(_),L=new R(p.x,p.y,p.z),D=R.sum(R.product(m,A),R.product(O,C)),U=R.sum(R.product(m,-C),R.product(O,A));l!=0?(e=Math.cos(l),s=Math.sin(l),R.sum(R.product(L,e),R.product(D,s)),R.sum(R.product(L,-s),R.product(D,e)),i=new R(U.x,U.y,U.z),this._depth.assign(i)):this._depth.assign(U),this._updateId++}adjustLocation(t,e){if(t==null||this._z==null)return;const s=R.product(this._z,-e),i=new R(t.x+s.x,t.y+s.y,t.z+s.z);this.location=i}getCoordinatePosition(t){if(t==null)return null;const e=R.scalarProjection(t,this._x),s=R.scalarProjection(t,this._y),i=R.scalarProjection(t,this._z);return new R(e,s,i)}getScreenPosition(t){let e=R.dif(t,this._loc);e.x=e.x*this._x_scale,e.y=e.y*this._y_scale,e.z=e.z*this._z_scale;let s=R.scalarProjection(e,this._depth);if(s<this._clipNear||s>this._clipFar)return null;let i=R.scalarProjection(e,this._x),r=-R.scalarProjection(e,this._y);i=i*this._scale,r=r*this._scale;const a=this.getDisplacenent(t);return a!=null&&(e=R.dif(t,this._loc),e.add(a),e.x=e.x*this._x_scale,e.y=e.y*this._y_scale,e.z=e.z*this._z_scale,s=R.scalarProjection(e,this._depth)),e.x=i,e.y=r,e.z=s,e}getScreenPoint(t){const e=this.getScreenPosition(t);return e==null?null:new K(e.x,e.y)}getPlanePosition(t,e,s,i){let r,a;const o=t.x/this._scale,h=-t.y/this._scale,_=R.product(this._x,o);_.add(R.product(this._y,h));const l=new R(this._loc.x*this._x_scale,this._loc.y*this._y_scale,this._loc.z*this._z_scale);l.add(_);const c=this._z,f=new R(e.x*this._x_scale,e.y*this._y_scale,e.z*this._z_scale),p=new R(s.x*this._x_scale,s.y*this._y_scale,s.z*this._z_scale),m=new R(i.x*this._x_scale,i.y*this._y_scale,i.z*this._z_scale),O=R.crossProduct(p,m),A=new R;return A.assign(vs.getIntersectionVector(l,c,f,O)),A!=null?(A.subtract(f),r=R.scalarProjection(A,s)/p.length*s.length,a=R.scalarProjection(A,i)/m.length*i.length,new K(r,a)):null}performZoom(){this.isZoomedIn()?this.scale=vs.SCALE_ZOOMED_OUT:this.scale=vs.SCALE_ZOOMED_IN}isZoomedIn(){return this.scale==vs.SCALE_ZOOMED_IN}performZoomOut(){this.scale=vs.SCALE_ZOOMED_OUT}performZoomIn(){this.scale=vs.SCALE_ZOOMED_IN}};vs.SCALE_ZOOMED_IN=64,vs.SCALE_ZOOMED_OUT=32;let Vr=vs;const Ra=class Ra{static makeRoomPreviewerId(t){return(t&65535)+Ra.PREVIEW_ROOM_ID_BASE}static isRoomPreviewerId(t){return t>=Ra.PREVIEW_ROOM_ID_BASE}};Ra.PREVIEW_ROOM_ID_BASE=2147418112;let vo=Ra;const es=class es{static init(t,e){this._SafeStr_4513=0,this._SafeStr_4515=t,this._SafeStr_4516=e,this._SafeStr_4514=nt(),this._SafeStr_448=1}static turnVisualizationOn(){if(this._SafeStr_448===0||this._SafeStr_448===3)return;this._SafeStr_4524||(this._SafeStr_4524=setTimeout(()=>this.turnVisualizationOff(),this._SafeStr_4516));const t=nt()-this._SafeStr_4514;if(t>this._SafeStr_4515+this._SafeStr_4516){this._SafeStr_448=3;return}if(this._SafeStr_4512=!0,t<this._SafeStr_4515){this._SafeStr_448=1;return}this._SafeStr_448=2,this._SafeStr_4513=(t-this._SafeStr_4515)/this._SafeStr_4516}static turnVisualizationOff(){this._SafeStr_4512=!1,clearTimeout(this._SafeStr_4524),this._SafeStr_4524=null}static isVisualizationOn(){return this._SafeStr_4512&&this.isRunning()}static isRunning(){return this._SafeStr_448===1||this._SafeStr_448===2}};es.STATE_NOT_INITIALIZED=0,es.STATE_START_DELAY=1,es.STATE_RUNNING=2,es.STATE_OVER=3,es._SafeStr_448=0,es._SafeStr_4512=!1,es._SafeStr_4513=0,es._SafeStr_4514=0,es._SafeStr_4515=2e4,es._SafeStr_4516=5e3;let nc=es;const Is=class Is{static init(t,e){this._SafeStr_4513=0,this._SafeStr_4515=t,this._SafeStr_4516=e,this._SafeStr_4514=nt(),this._SafeStr_448=1}static turnVisualizationOn(){if(this._SafeStr_448===0||this._SafeStr_448===3)return;this._SafeStr_4524||(this._SafeStr_4524=setTimeout(()=>this.turnVisualizationOff(),this._SafeStr_4516));const t=nt()-this._SafeStr_4514;if(t>this._SafeStr_4515+this._SafeStr_4516){this._SafeStr_448=3;return}if(this._SafeStr_4512=!0,t<this._SafeStr_4515){this._SafeStr_448=1;return}this._SafeStr_448=2,this._SafeStr_4513=(t-this._SafeStr_4515)/this._SafeStr_4516}static turnVisualizationOff(){this._SafeStr_4512=!1,clearTimeout(this._SafeStr_4524),this._SafeStr_4524=null}static isVisualizationOn(){return this._SafeStr_4512&&this.isRunning()}static isRunning(){return this._SafeStr_448===1||this._SafeStr_448===2}};Is.STATE_NOT_INITIALIZED=0,Is.STATE_START_DELAY=1,Is.STATE_RUNNING=2,Is.STATE_OVER=3,Is._SafeStr_448=0,Is._SafeStr_4512=!1,Is._SafeStr_4514=0,Is._SafeStr_4515=2e4,Is._SafeStr_4516=5e3;let bo=Is;class Zm{static hex2int(t){return parseInt(t,16)}static inkToBlendMode(t){return t=="ADD"||t==33?gi.ADD:t=="SUBTRACT"?gi.SUBTRACT:t=="DARKEN"?gi.DARKEN:gi.NORMAL}}class Fo extends bt{constructor(t=null){super(t),this._offsetX=0,this._offsetY=0,this._tag="",this._alphaTolerance=128,this._varyingDepth=!1,this._clickHandling=!1,this._pairedSpriteId=-1,this._pairedSpriteUpdateCounter=-1}needsUpdate(t,e){return this._pairedSpriteId===t&&this._pairedSpriteUpdateCounter===e?!1:(this._pairedSpriteId=t,this._pairedSpriteUpdateCounter=e,!0)}calculateVertices(){this.texture.orig&&super.calculateVertices()}setTexture(t){t||(t=Ft.EMPTY),t!==this.texture&&(t===Ft.EMPTY&&(this._pairedSpriteId=-1,this._pairedSpriteUpdateCounter=-1),this.texture=t)}containsPoint(t){return Fo.containsPoint(this,t)}static containsPoint(t,e){if(!t||!e||t.alphaTolerance>255||!(t instanceof bt))return!1;if(t.texture===Ft.EMPTY||t.blendMode!==gi.NORMAL)return;const s=t.texture,i=s.baseTexture;if(!s||!i||!i.valid)return!1;const r=e.x*t.scale.x,a=e.y*t.scale.y;if(!t.getLocalBounds().contains(r,a)||!i.hitMap&&!Fo.generateHitMap(i))return!1;const o=i.hitMap;let h=r+s.frame.x,_=a+s.frame.y;s.trim&&(h-=s.trim.x,_-=s.trim.y),h=Math.round(h)*i.resolution,_=Math.round(_)*i.resolution;const l=h+_*i.realWidth,c=l%32,f=l/32|0;return(o[f]&1<<c)!==0}static generateHitMap(t){if(!t)return!1;const e=new Ft(t),s=new bt(e),i=Ut.getPixels(s),r=t.width,a=t.height,o=new Uint32Array(Math.ceil(r*a/32)),h=Os.MATCH_OPAQUE_PIXELS;for(let _=0;_<r*a;_++){const l=_%32,c=_/32|0;i[_*4+3]>=h&&(o[c]=o[c]|1<<l)}return t.hitMap=o,s.destroy(),e.destroy(),!0}get offsetX(){return this._offsetX}set offsetX(t){this._offsetX=t}get offsetY(){return this._offsetY}set offsetY(t){this._offsetY=t}get tag(){return this._tag}set tag(t){this._tag=t}get alphaTolerance(){return this._alphaTolerance}set alphaTolerance(t){this._alphaTolerance=t}get varyingDepth(){return this._varyingDepth}set varyingDepth(t){this._varyingDepth=t}get clickHandling(){return this._clickHandling}set clickHandling(t){this._clickHandling=t}}class $m{constructor(){this._objectId="",this._spriteTag=""}get objectId(){return this._objectId}set objectId(t){this._objectId=t}get spriteTag(){return this._spriteTag}set spriteTag(t){this._spriteTag=t}}const I_=class I_{constructor(){this._name="",this._sprite=null,this._x=0,this._y=0,this._z=0}dispose(){this._z=-I_.Z_INFINITY,this._sprite=null}get name(){return this._name}set name(t){this._name=t}get sprite(){return this._sprite}set sprite(t){this._sprite=t}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get z(){return this._z}set z(t){this._z=t}};I_.Z_INFINITY=1e8;let ac=I_;class tp{constructor(t,e,s,i,r){this._SafeStr_4507=!1,this._rotation=0,this._rotationOrigin=null,this._rotationRodLength=0,this._SafeStr_795=0,this._id=e,this._container=t,this._geometry=new Vr(r,new R(-135,30,0),new R(11,11,5),new R(-135,.5,0)),this._animationFPS=W.instance.getConfiguration("system.fps.animation",24),this._renderTimestamp=0,this._totalTimeRunning=0,this._lastFrame=0,this._master=null,this._display=null,this._mask=null,this._sortableSprites=[],this._spriteCount=0,this._activeSpriteCount=0,this._spritePool=[],this._skipObjectUpdate=!1,this._runningSlow=!1,this._width=0,this._height=0,this._renderedWidth=0,this._renderedHeight=0,this._screenOffsetX=0,this._screenOffsetY=0,this._mouseLocation=new K,this._mouseOldX=0,this._mouseOldY=0,this._mouseCheckCount=0,this._mouseSpriteWasHit=!1,this._mouseActiveObjects=new Map,this._eventCache=new Map,this._eventId=0,this._scale=1,this._restrictsScaling=!1,this._noSpriteVisibilityChecking=!1,this._usesExclusionRectangles=!1,this._usesMask=!0,this._canvasUpdated=!1,this._objectCache=new rc(this._container.roomObjectVariableAccurateZ),this._mouseListener=null,this.setupCanvas(),this.initialize(s,i)}setupCanvas(){if(this._master||(this._master=new xt,this._master.interactiveChildren=!1),!this._display){const t=new Rs;this._master.addChild(t),this._display=t}}dispose(){if(this.cleanSprites(0,!0),this._geometry&&(this._geometry.dispose(),this._geometry=null),this._mask&&(this._mask=null),this._objectCache&&(this._objectCache.dispose(),this._objectCache=null),this._master){for(;this._master.children.length;)this._master.removeChildAt(0).destroy();this._master.parent&&this._master.parent.removeChild(this._master),this._master.destroy(),this._master=null}if(this._display=null,this._sortableSprites=[],this._mouseActiveObjects&&(this._mouseActiveObjects.clear(),this._mouseActiveObjects=null),this._spritePool){for(const t of this._spritePool)this.cleanSprite(t,!0);this._spritePool=[]}this._eventCache&&(this._eventCache.clear(),this._eventCache=null),this._mouseListener=null}initialize(t,e){if(t=t<1?1:t,e=e<1?1:e,this._usesMask&&(this._mask?this._mask.clear().beginFill(16711680).drawRect(0,0,t,e).endFill():(this._mask=new Tl().beginFill(16711680).drawRect(0,0,t,e).endFill(),this._master&&(this._master.addChild(this._mask),this._display&&(this._display.mask=this._mask)))),this._master){if(this._master.hitArea){const s=this._master.hitArea;s.width=t,s.height=e}else this._master.hitArea=new we(0,0,t,e);if(this._master.filterArea){const s=this._master.filterArea;s.width=t,s.height=e}else this._master.filterArea=new we(0,0,t,e)}this._width=t,this._height=e}setMask(t){t&&!this._usesMask?(this._usesMask=!0,this._mask&&this._mask.parent!==this._master&&(this._master.addChild(this._mask),this._display.mask=this._mask)):!t&&this._usesMask&&(this._usesMask=!1,this._mask&&this._mask.parent===this._master&&(this._master.removeChild(this._mask),this._display.mask=null))}setScale(t,e=null,s=null,i=!1,r=!1){!this._master||!this._display||this._restrictsScaling&&!i||(e||(e=new K(this._width/2,this._height/2)),s||(s=e),e=this._display.toLocal(e),r?this._scale*=t:this._scale=t,this.screenOffsetX=s.x-e.x*this._scale,this.screenOffsetY=s.y-e.y*this._scale)}render(t,e=!1){if(this._canvasUpdated=!1,this._totalTimeRunning+=ui().deltaTime,this._totalTimeRunning===this._renderTimestamp||(t===-1&&(t=this._renderTimestamp+1),!this._container||!this._geometry))return;(this._width!==this._renderedWidth||this._height!==this._renderedHeight)&&(e=!0),(this._display.x!==this._screenOffsetX||this._display.y!==this._screenOffsetY)&&(this._display.position.set(this._screenOffsetX,this._screenOffsetY),e=!0),this._display.scale.x!==this._scale&&(this._display.scale.set(this._scale),e=!0),this.doMagic();const s=Math.round(this._totalTimeRunning/(60/this._animationFPS));let i=!1;s!==this._lastFrame&&(this._lastFrame=s,i=!0);let r=0;const a=this._container.objects;if(a.size)for(const h of a.values())h&&(r=r+this.renderObject(h,h.instanceId.toString(),t,e,i,r));this._sortableSprites.sort((h,_)=>_.z-h.z),r<this._sortableSprites.length&&this._sortableSprites.splice(r);let o=0;for(;o<r;){const h=this._sortableSprites[o];h&&h.sprite&&this.renderSprite(o,h),o++}this.cleanSprites(r),(e||i)&&(this._canvasUpdated=!0),this._renderTimestamp=this._totalTimeRunning,this._renderedWidth=this._width,this._renderedHeight=this._height}skipSpriteVisibilityChecking(){this._noSpriteVisibilityChecking=!0,this.render(-1,!0)}resumeSpriteVisibilityChecking(){this._noSpriteVisibilityChecking=!1}getSortableSpriteList(){return this._objectCache.getSortableSpriteList()}getPlaneSortableSprites(){return this._objectCache.getPlaneSortableSprites()}removeFromCache(t){this._objectCache.removeObjectCache(t)}renderObject(t,e,s,i,r,a){if(!t)return 0;const o=t.visualization;if(!o)return this.removeFromCache(e),0;const h=this.getCacheItem(e);h.objectId=t.instanceId;const _=h.location,l=h.sprites,c=_.updateLocation(t,this._geometry);if(!c)return this.removeFromCache(e),0;if(r&&o.update(this._geometry,s,!l.isEmpty||i,this._skipObjectUpdate&&this._runningSlow),_.locationChanged&&(i=!0),!l.needsUpdate(o.instanceId,o.updateSpriteCounter)&&!i)return l.spriteCount;let f=c.x,p=c.y,m=c.z;f>0?m=m+f*12e-8:m=m+-f*12e-8,f=f+Math.trunc(this._width/2),p=p+Math.trunc(this._height/2);let O=0;for(const A of o.sprites.values()){if(!A||!A.visible)continue;const C=A.texture,L=C&&C.baseTexture;if(!C||!L)continue;const D=f+A.offsetX+this._screenOffsetX,U=p+A.offsetY+this._screenOffsetY;if(A.flipH){const v=f+-(C.width+-A.offsetX)+this._screenOffsetX;if(!this.isSpriteVisible(v,U,C.width,C.height))continue}else if(A.flipV){const v=p+-(C.height+-A.offsetY)+this._screenOffsetY;if(!this.isSpriteVisible(D,v,C.width,C.height))continue}else if(!this.isSpriteVisible(D,U,C.width,C.height))continue;let P=l.getSprite(O);P||(P=new ac,l.addSprite(P),this._sortableSprites.push(P),P.name=e),P.sprite=A,(A.spriteType===Je.AVATAR||A.spriteType===Je.AVATAR_OWN)&&(P.sprite.libraryAssetName="avatar_"+t.id),P.x=D-this._screenOffsetX,P.y=U-this._screenOffsetY,P.z=m+A.relativeDepth+37e-12*a,O++,a++}return l.setSpriteCount(O),this._canvasUpdated=!0,O}getExtendedSprite(t){if(t<0||t>=this._spriteCount)return null;const e=this._display.getChildAt(t);return e||null}getExtendedSpriteIdentifier(t){return t?t.name:""}renderSprite(t,e){if(t>=this._spriteCount)return this.createAndAddSprite(e),!0;if(!e)return!1;const s=e.sprite,i=this.getExtendedSprite(t);if(!s||!i)return!1;if(i.varyingDepth!==s.varyingDepth)return i.varyingDepth&&!s.varyingDepth?(this._display.removeChildAt(t),this._spritePool.push(i),this.renderSprite(t,e)):(this.createAndAddSprite(e,t),!0);if(i.needsUpdate(s.id,s.updateCounter)||ks.isVisualizationOn()){i.tag=s.tag,i.alphaTolerance=s.alphaTolerance,i.name=e.name,i.varyingDepth=s.varyingDepth,i.clickHandling=s.clickHandling,i.filters=s.filters;const r=s.alpha/255;i.alpha!==r&&(i.alpha=r),i.tint!==s.color&&(i.tint=s.color),i.blendMode!==s.blendMode&&(i.blendMode=s.blendMode),i.texture!==s.texture&&i.setTexture(s.texture),s.updateContainer&&(i.children.length===1&&i.removeChildAt(0),i.addChild(s.container),s.updateContainer=!1),s.flipH?i.scale.x!==-1&&(i.scale.x=-1):i.scale.x!==1&&(i.scale.x=1),s.flipV?i.scale.y!==-1&&(i.scale.y=-1):i.scale.y!==1&&(i.scale.y=1),this.updateEnterRoomEffect(i,s)}return i.x!==e.x&&(i.x=e.x),i.y!==e.y&&(i.y=e.y),i.offsetX=s.offsetX,i.offsetY=s.offsetY,!0}createAndAddSprite(t,e=-1){const s=t.sprite;if(!s)return;let i=null;this._spritePool.length>0&&(i=this._spritePool.pop()),i||(i=new Fo),i.children.length&&i.removeChildren(),i.tag=s.tag,i.alphaTolerance=s.alphaTolerance,i.alpha=s.alpha/255,i.tint=s.color,i.x=t.x,i.y=t.y,i.offsetX=s.offsetX,i.offsetY=s.offsetY,i.name=s.name,i.varyingDepth=s.varyingDepth,i.clickHandling=s.clickHandling,i.blendMode=s.blendMode,i.filters=s.filters,i.setTexture(s.texture),s.updateContainer&&(i.addChild(s.container),s.updateContainer=!1),s.flipH&&(i.scale.x=-1),s.flipV&&(i.scale.y=-1),this.updateEnterRoomEffect(i,s),e<0||e>=this._spriteCount?(this._display.addChild(i),this._spriteCount++):this._display.addChildAt(i,e),this._activeSpriteCount++}cleanSprites(t,e=!1){if(this._display){if(t<0&&(t=0),t<this._activeSpriteCount||!this._activeSpriteCount){let s=this._spriteCount-1;for(;s>=t;)this.cleanSprite(this.getExtendedSprite(s),e),s--}this._activeSpriteCount=t}}updateEnterRoomEffect(t,e){if(!(!ks.isVisualizationOn()||!e))switch(e.spriteType){case Je.AVATAR_OWN:return;case Je.ROOM_PLANE:t.alpha=ks.getDelta(.9);return;case Je.AVATAR:t.alpha=ks.getDelta(.5);return;default:t.alpha=ks.getDelta(.1)}}cleanSprite(t,e){t&&(e?(t.parent&&t.parent.removeChild(t),t.destroy({children:!0})):t.setTexture(null))}update(){this._mouseCheckCount,this._mouseCheckCount=0,this._eventId++}setMouseListener(t){this._mouseListener=t}getCacheItem(t){return this._objectCache.getObjectCache(t)}isSpriteVisible(t,e,s,i){return!!(this._noSpriteVisibilityChecking||(t=(t-this._screenOffsetX)*this._scale+this._screenOffsetX,e=(e-this._screenOffsetY)*this._scale+this._screenOffsetY,s=s*this._scale,i=i*this._scale,t<this._width&&t+s>=0&&e<this._height&&e+i>=0&&!this._usesExclusionRectangles))}handleMouseEvent(t,e,s,i,r,a,o){return t=t-this._screenOffsetX,e=e-this._screenOffsetY,this._mouseLocation.x=t/this._scale,this._mouseLocation.y=e/this._scale,this._mouseCheckCount>0&&s==z.MOUSE_MOVE?this._mouseSpriteWasHit:(this._mouseSpriteWasHit=this.checkMouseHits(Math.trunc(t/this._scale),Math.trunc(e/this._scale),s,i,r,a,o),this._mouseCheckCount++,this._mouseSpriteWasHit)}checkMouseHits(t,e,s,i=!1,r=!1,a=!1,o=!1){const h=[];let _=!1,l=null,c=this._activeSpriteCount-1;for(;c>=0;){const m=this.getExtendedSprite(c);if(m&&m.containsPoint(new K(t-m.x,e-m.y))&&!(m.clickHandling&&(s===z.MOUSE_CLICK||s===z.DOUBLE_CLICK))){const O=this.getExtendedSpriteIdentifier(m);if(h.indexOf(O)===-1){const A=m.tag;let C=this._mouseActiveObjects.get(O);C&&C.spriteTag!==A&&(l=this.createMouseEvent(0,0,0,0,z.ROLL_OUT,C.spriteTag,i,r,a,o),this.bufferMouseEvent(l,O)),s===z.MOUSE_MOVE&&(!C||C.spriteTag!==A)?l=this.createMouseEvent(t,e,t-m.x,e-m.y,z.ROLL_OVER,A,i,r,a,o):(l=this.createMouseEvent(t,e,t-m.x,e-m.y,s,A,i,r,a,o),l.spriteOffsetX=m.offsetX,l.spriteOffsetY=m.offsetY),C||(C=new $m,C.objectId=O,this._mouseActiveObjects.set(O,C)),C.spriteTag=A,(s!==z.MOUSE_MOVE||t!==this._mouseOldX||e!==this._mouseOldY)&&this.bufferMouseEvent(l,O),h.push(O)}_=!0}c--}const f=[];for(const m of this._mouseActiveObjects.keys())m&&f.push(m);let p=0;for(;p<f.length;){const m=f[p];h.indexOf(m)>=0&&(f[p]=null),p++}for(p=0;p<f.length;){const m=f[p];if(m!==null){const O=this._mouseActiveObjects.get(m);O&&this._mouseActiveObjects.delete(m);const A=this.createMouseEvent(0,0,0,0,z.ROLL_OUT,O.spriteTag,i,r,a,o);this.bufferMouseEvent(A,m)}p++}return this.processMouseEvents(),this._mouseOldX=t,this._mouseOldY=e,_}createMouseEvent(t,e,s,i,r,a,o,h,_,l){const c=t-this._width/2,f=e-this._height/2,p=`canvas_${this._id}`;return new mm(r,p+"_"+this._eventId,p,a,c,f,s,i,h,o,_,l)}bufferMouseEvent(t,e){!t||!this._eventCache||(this._eventCache.delete(e),this._eventCache.set(e,t))}processMouseEvents(){if(!(!this._container||!this._eventCache)){for(const[t,e]of this._eventCache.entries()){if(!this._eventCache)return;if(!e)continue;const s=this._container.getRoomObject(parseInt(t));if(s)if(this._mouseListener)this._mouseListener.processRoomCanvasMouseEvent(e,s,this._geometry);else{const i=s.mouseHandler;i&&i.mouseEvent(e,this._geometry)}}this._eventCache&&this._eventCache.clear()}}getDisplayAsTexture(){this._noSpriteVisibilityChecking=!0;const t=this._scale,e=this._screenOffsetX,s=this._screenOffsetY;this.setScale(1,null,null,!0),this._screenOffsetX=0,this._screenOffsetY=0,this.render(-1,!0),this._display.mask=null;const i=this._display.getBounds(),r=Ss.create({width:this._display.width,height:this._display.height});return Kt.instance.renderer.render(this._display,{renderTexture:r,clear:!0,transform:new Me(1,0,0,1,-i.x,-i.y)}),this._display.mask=this._mask,this._noSpriteVisibilityChecking=!1,this.setScale(t,null,null,!0),this._screenOffsetX=e,this._screenOffsetY=s,r}doMagic(){const t=this.geometry;if(this._rotation!==0){let e=this._effectDirection;t.direction=new R(e.x+this._rotation,e.y,e.z),e=t.direction,t.setDepthVector(new R(e.x,e.y,5));const s=new R;s.assign(this._rotationOrigin),s.x=s.x+this._rotationRodLength*Math.cos((e.x+180)/180*3.14159265358979)*Math.cos(e.y/180*3.14159265358979),s.y=s.y+this._rotationRodLength*Math.sin((e.x+180)/180*3.14159265358979)*Math.cos(e.y/180*3.14159265358979),s.z=s.z+this._rotationRodLength*Math.sin(e.y/180*3.14159265358979),t.location=s,this._effectLocation=new R,this._effectLocation.assign(s),this._effectDirection=new R,this._effectDirection.assign(t.direction)}if(bo.isVisualizationOn()&&!this._SafeStr_4507?this.changeShaking():!bo.isVisualizationOn()&&this._SafeStr_4507&&this.changeShaking(),nc.isVisualizationOn()&&this.changeRotation(),this._SafeStr_4507){this._SafeStr_795++;const e=this._effectDirection,s=R.sum(e,new R(Math.sin(this._SafeStr_795*5/180*3.14159265358979)*2,Math.sin(this._SafeStr_795/180*3.14159265358979)*5,Math.sin(this._SafeStr_795*10/180*3.14159265358979)*2));t.direction=s}else this._SafeStr_795=0,t.direction=this._effectDirection}changeShaking(){if(this._SafeStr_4507=!this._SafeStr_4507,this._SafeStr_4507){const t=this.geometry.direction;this._effectDirection=new R(t.x,t.y,t.z)}}changeRotation(){if(this._SafeStr_4507)return;const t=this.geometry;if(t){if(this._rotation===0){const e=t.location,s=t.directionAxis;this._effectLocation=new R,this._effectLocation.assign(e),this._effectDirection=new R,this._effectDirection.assign(t.direction);const i=Vr.getIntersectionVector(e,s,new R(0,0,0),new R(0,0,1));i!==null&&(this._rotationOrigin=new R(i.x,i.y,i.z),this._rotationRodLength=R.dif(i,e).length,this._rotation=1);return}this._rotation=0,t.location=this._effectLocation,t.direction=this._effectDirection,t.setDepthVector(new R(this._effectDirection.x,this._effectDirection.y,5))}}moveLeft(){if(this._rotation!==0){this._rotation===1?this._rotation=-1:this._rotation=this._rotation-1;return}const t=this.geometry,e=(t.direction.x-90)/180*3.14159265358979;t.location=R.sum(t.location,new R(Math.cos(e)*Math.sqrt(2),Math.sin(e)*Math.sqrt(2)))}moveRight(){if(this._rotation!==0){this._rotation===-1?this._rotation=1:this._rotation=this._rotation+1;return}const t=this.geometry,e=(t.direction.x+90)/180*3.14159265358979;t.location=R.sum(t.location,new R(Math.cos(e)*Math.sqrt(2),Math.sin(e)*Math.sqrt(2)))}moveUp(){if(this._rotation!==0)return;const t=this.geometry,e=t.direction.x/180*3.14159265358979;t.location=R.sum(t.location,new R(Math.cos(e)*Math.sqrt(2),Math.sin(e)*Math.sqrt(2)))}moveDown(){if(this._rotation!==0)return;const t=this.geometry,e=(t.direction.x+180)/180*3.14159265358979;t.location=R.sum(t.location,new R(Math.cos(e)*Math.sqrt(2),Math.sin(e)*Math.sqrt(2)))}get id(){return this._id}get geometry(){return this._geometry}get master(){return this._master}get display(){return this._display}get screenOffsetX(){return this._screenOffsetX}set screenOffsetX(t){t=Math.trunc(t),this._mouseLocation.x=this._mouseLocation.x-(t-this._screenOffsetX),this._screenOffsetX=t}get screenOffsetY(){return this._screenOffsetY}set screenOffsetY(t){t=Math.trunc(t),this._mouseLocation.y=this._mouseLocation.y-(t-this._screenOffsetY),this._screenOffsetY=t}get scale(){return this._scale}get width(){return this._width*this._scale}get height(){return this._height*this._scale}get restrictsScaling(){return this._restrictsScaling}set restrictsScaling(t){this._restrictsScaling=t}get canvasUpdated(){return this._canvasUpdated}set canvasUpdated(t){this._canvasUpdated=t}}class ep{constructor(){this._objects=new Map,this._canvases=new Map,this._disposed=!1,this._roomObjectVariableAccurateZ=null}dispose(){if(!this._disposed){if(this._canvases){for(const[t,e]of this._canvases.entries())this._canvases.delete(t),e&&e.dispose();this._canvases=null}this._objects&&(this._objects=null),this._disposed=!0}}reset(){this._objects.clear()}getInstanceId(t){return t?t.instanceId:-1}getRoomObject(t){return this._objects.get(t)}addObject(t){t&&this._objects.set(this.getInstanceId(t),t)}removeObject(t){const e=this.getInstanceId(t);this._objects.delete(e);for(const s of this._canvases.values()){if(!s)continue;s.removeFromCache(e.toString())}}render(t,e=!1){if(!(!this._canvases||!this._canvases.size))for(const s of this._canvases.values())s&&s.render(t,e)}update(t,e=!1){if(!(!this._canvases||!this._canvases.size)){this.render(t,e);for(const s of this._canvases.values())s&&s.update()}}getCanvas(t){const e=this._canvases.get(t);return e||null}createCanvas(t,e,s,i){const r=this._canvases.get(t);if(r)return r.initialize(e,s),r.geometry&&(r.geometry.scale=i),r;const a=this.createSpriteCanvas(t,e,s,i);if(a)return this._canvases.set(t,a),a}createSpriteCanvas(t,e,s,i){return new tp(this,t,e,s,i)}removeCanvas(t){const e=this._canvases.get(t);e&&(this._canvases.delete(t),e.dispose())}get objects(){return this._objects}get disposed(){return this._disposed}get roomObjectVariableAccurateZ(){return this._roomObjectVariableAccurateZ}set roomObjectVariableAccurateZ(t){this._roomObjectVariableAccurateZ=t}}class sp{createRenderer(){return new ep}}class ip extends Ye{constructor(t,e){super(),this._id=t,this._container=e,this._renderer=null,this._managers=new Map,this._updateCategories=[],this._model=new Ag}onDispose(){this.removeAllManagers(),this.destroyRenderer(),this._container=null,this._model.dispose()}setRenderer(t){if(t!==this._renderer&&(this._renderer&&this.destroyRenderer(),this._renderer=t,!!this._renderer&&(this._renderer.reset(),this._managers.size)))for(const e of this._managers.values()){if(!e)continue;const s=e.objects;if(s.length)for(const i of s.getValues())i&&this._renderer.addObject(i)}}destroyRenderer(){this._renderer&&(this._renderer.dispose(),this._renderer=null)}getManager(t){const e=this._managers.get(t);return e||null}getManagerOrCreate(t){let e=this.getManager(t);return e||(e=this._container.createRoomObjectManager(t),e?(this._managers.set(t,e),e):null)}getTotalObjectsForManager(t){const e=this.getManager(t);return e?e.totalObjects:0}getRoomObject(t,e){const s=this.getManager(e);if(!s)return null;const i=s.getObject(t);return i||null}getRoomObjectsForCategory(t){const e=this.getManager(t);return e?e.objects.getValues():[]}getRoomObjectByIndex(t,e){const s=this.getManager(e);if(!s)return null;const i=s.getObjectByIndex(t);return i||null}createRoomObject(t,e,s,i){const r=this.getManagerOrCreate(i);if(!r)return null;const a=r.createObject(t,e,s);return a?(this._renderer&&this._renderer.addObject(a),a):null}createRoomObjectAndInitalize(t,e,s){return this._container?this._container.createRoomObjectAndInitalize(this._id,t,e,s):null}removeRoomObject(t,e){const s=this.getManager(e);if(!s)return;const i=s.getObject(t);i&&(i.tearDown(),this._renderer&&this._renderer.removeObject(i),s.removeObject(t))}removeAllManagers(){for(const t of this._managers.values())if(t){if(this._renderer){const e=t.objects;if(e.length)for(const s of e.getValues())s&&this._renderer.removeObject(s)}t.dispose()}this._managers.clear()}addUpdateCategory(t){this._updateCategories.indexOf(t)>=0||this._updateCategories.push(t)}removeUpdateCategory(t){const e=this._updateCategories.indexOf(t);e!==-1&&this._updateCategories.splice(e,1)}update(t,e=!1){for(const s of this._updateCategories){const i=this.getManager(s);if(!i)continue;const r=i.objects;if(r.length)for(const a of r.getValues()){if(!a)continue;const o=a.logic;o&&o.update(t)}}this._renderer&&this._renderer.update(t,e)}hasUninitializedObjects(){for(const t of this._managers.values())if(t){for(const e of t.objects.getValues())if(e&&!e.isReady)return!0}return!1}get id(){return this._id}get container(){return this._container}get renderer(){return this._renderer}get managers(){return this._managers}get model(){return this._model}}const Oa=class Oa{constructor(t,e,s,i,r,a,o){this._layerTags=[],this._primaryColor=t&16777215,this._secondaryColor=e&16777215,this._breed=s,this._tag=i>-1&&i<Oa.COLOR_TAGS.length?Oa.COLOR_TAGS[i]:"",this._id=r,this._isMaster=a,this._layerTags=o}get primaryColor(){return this._primaryColor}get secondaryColor(){return this._secondaryColor}get breed(){return this._breed}get tag(){return this._tag}get id(){return this._id}get isMaster(){return this._isMaster}get layerTags(){return this._layerTags}};Oa.COLOR_TAGS=["Null","Black","White","Grey","Red","Orange","Pink","Green","Lime","Blue","Light-Blue","Dark-Blue","Yellow","Brown","Dark-Brown","Beige","Cyan","Purple","Gold"];let oc=Oa;const mt=class mt{constructor(){this._stateEvents=null,this._sessionDataManager=null,this._waitingForSessionDataManager=!1,this._iconListener=null,this._collections=new Map,this._gifCollections=new Map,this._images=new Map,this._events=new Map,this._activeObjects={},this._activeObjectTypes=new Map,this._activeObjectTypeIds=new Map,this._objectTypeAdUrls=new Map,this._wallItems={},this._wallItemTypes=new Map,this._wallItemTypeIds=new Map,this._furniRevisions=new Map,this._pets={},this._petColors=new Map,this._objectAliases=new Map,this._objectOriginalNames=new Map,this._pendingContentTypes=[],this._dataInitialized=!1}initialize(t){this._stateEvents=t,this.setFurnitureData();for(const[e,s]of q.getValue("pet.types").entries())this._pets[s]=e}dispose(){}setSessionDataManager(t){this._sessionDataManager=t,this._waitingForSessionDataManager&&(this._waitingForSessionDataManager=!1,this.setFurnitureData())}loadFurnitureData(){this.setFurnitureData()}setFurnitureData(){if(!this._sessionDataManager){this._waitingForSessionDataManager=!0;return}const t=this._sessionDataManager.getAllFurnitureData(this);t&&(this._sessionDataManager.removePendingFurniDataListener(this),this.processFurnitureData(t),this._stateEvents.dispatchEvent(new gt(mt.LOADER_READY)))}processFurnitureData(t){if(t)for(const e of t){if(!e)continue;const s=e.id;let i=e.className;e.hasIndexedColor&&(i=i+"*"+e.colorIndex);const r=e.revision,a=e.adUrl;a&&a.length>0&&this._objectTypeAdUrls.set(i,a);let o=e.className;e.type===vr.FLOOR?(this._activeObjectTypes.set(s,i),this._activeObjectTypeIds.set(i,s),this._activeObjects[o]||(this._activeObjects[o]=1)):e.type===vr.WALL&&(o==="post.it"&&(i="post_it",o="post_it"),o==="post.it.vd"&&(i="post_it_vd",o="post_id_vd"),this._wallItemTypes.set(s,i),this._wallItemTypeIds.set(i,s),this._wallItems[o]||(this._wallItems[o]=1));const h=this._furniRevisions.get(o);r>h&&(this._furniRevisions.delete(o),this._furniRevisions.set(o,r))}}getFurnitureFloorNameForTypeId(t){const e=this._activeObjectTypes.get(t);return this.removeColorIndex(e)}getFurnitureWallNameForTypeId(t,e=null){let s=this._wallItemTypes.get(t);return s==="poster"&&e!==null&&(s=s+e),this.removeColorIndex(s)}getFurnitureFloorColorIndex(t){const e=this._activeObjectTypes.get(t);return e?this.getColorIndexFromName(e):-1}getFurnitureWallColorIndex(t){const e=this._wallItemTypes.get(t);return e?this.getColorIndexFromName(e):-1}getColorIndexFromName(t){if(!t)return-1;const e=t.indexOf("*");return e===-1?0:parseInt(t.substr(e+1))}removeColorIndex(t){if(!t)return null;const e=t.indexOf("*");return e===-1?t:t.substr(0,e)}getRoomObjectAdUrl(t){const e=this._objectTypeAdUrls.get(t);return e||""}getPetColorResult(t,e){const s=this._petColors.get(t);return s?s.get(e):null}getPetColorResultsForTag(t,e){const s=this._petColors.get(t),i=[];if(s)for(const r of s.values())r.tag===e&&i.push(r);return i}getCollection(t){if(!t)return null;const e=this._collections.get(t);if(!e){const s=_s().getCollection(t);return s?(this._collections.set(t,s),s):null}return e}getGifCollection(t){return t&&this._gifCollections.get(t)||null}getImage(t){if(!t)return null;const e=this._images.get(t);if(!e)return null;const s=new Image;return s.src=e.src,s}addAssetToCollection(t,e,s,i=!0){const r=this.getCollection(t);return r?r.addAsset(e,s,i,0,0,!1,!1):!1}createGifCollection(t,e,s){if(!t||!e||!s)return null;const i=new um(t,e,s);return this._gifCollections.set(t,i),i}createCollection(t,e){if(!t||!e)return null;const s=new uo(t,e);this._collections.set(s.name,s);const i=this._pets[s.name];if(i!==void 0){const r=s.getPaletteNames(),a=new Map;for(const o of r){const h=s.getPalette(o),_=t.palettes[o],l=h.primaryColor,c=h.secondaryColor,f=_.breed!==void 0?_.breed:0,p=_.colorTag!==void 0?_.colorTag:-1,m=_.master!==void 0?_.master:!1,O=_.tags!==void 0?_.tags:[];a.set(parseInt(o),new oc(l,c,f,p,o,m,O))}this._petColors.set(i,a)}}getPlaceholderName(t){switch(this.getCategoryForType(t)){case M.FLOOR:return mt.PLACE_HOLDER;case M.WALL:return mt.PLACE_HOLDER_WALL;default:return this._pets[t]!==void 0?mt.PLACE_HOLDER_PET:mt.PLACE_HOLDER_DEFAULT}}getCategoryForType(t){return t?this._activeObjects[t]!==void 0?M.FLOOR:this._wallItems[t]!==void 0?M.WALL:this._pets[t]!==void 0?M.UNIT:t.indexOf("poster")===0?M.WALL:t==="room"?M.ROOM:t===pt.USER||t===pt.PET||t===pt.BOT||t===pt.RENTABLE_BOT?M.UNIT:t===mt.TILE_CURSOR||t===mt.SELECTION_ARROW?M.CURSOR:M.MINIMUM:M.MINIMUM}getPetNameForType(t){return q.getValue("pet.types")[t]||null}isLoaderType(t){return t=pt.getRealType(t),t!==x.USER}downloadImage(t,e,s,i=null){let r=null,a=[];if(e&&e.indexOf(",")>=0&&(r=e,e=r.split(",")[0]),r?a=this.getAssetUrls(r,s,!0):a=this.getAssetUrls(e,s,!0),a&&a.length){const o=a[0],h=new Image;return h.src=o,h.onload=()=>{h.onerror=null,this._images.set([e,s].join("_"),h),this._iconListener.onRoomContentLoaded(t,[e,s].join("_"),!0)},h.onerror=()=>{h.onload=null,j.error("Failed to download asset",o),this._iconListener.onRoomContentLoaded(t,[e,s].join("_"),!1)},!0}return!1}async downloadAsset(t,e){var i;const s=(i=this.getAssetUrls(t))==null?void 0:i[0];if(!(!s||!s.length)&&!(this._pendingContentTypes.indexOf(t)>=0||this.getOrRemoveEventDispatcher(t))){this._pendingContentTypes.push(t),this._events.set(t,e);try{const r=await fetch(s);let a="application/octet-stream";switch(r.headers.has("Content-Type")&&(a=r.headers.get("Content-Type")),a){case"application/octet-stream":{const o=new _o(await r.arrayBuffer());await this.processAsset(o.baseTexture,o.jsonFile);const h=this._events.get(t);if(!h)return;h.dispatchEvent(new Ti(Ti.RCLE_SUCCESS,t));break}default:throw new Error}}catch{e.dispatchEvent(new Ti(Ti.RCLE_FAILURE,t))}}}async processAsset(t,e){const s=e.spritesheet;if(!t||!s||!Object.keys(s).length){this.createCollection(e,null);return}const i=async()=>{const r=new Tg(t,s);await r.parse(),this.createCollection(e,r)};t.valid?await i():await new Promise((r,a)=>{t.once("update",async()=>(await i(),r()))})}setAssetAliasName(t,e){this._objectAliases.set(t,e),this._objectOriginalNames.set(e,t)}getAssetAliasName(t){const e=this._objectAliases.get(t);return e||t}getAssetOriginalName(t){const e=this._objectOriginalNames.get(t);return e||t}getAssetUrls(t,e=null,s=!1){switch(t){case mt.PLACE_HOLDER:return[this.getAssetUrlWithGenericBase(mt.PLACE_HOLDER)];case mt.PLACE_HOLDER_WALL:return[this.getAssetUrlWithGenericBase(mt.PLACE_HOLDER_WALL)];case mt.PLACE_HOLDER_PET:return[this.getAssetUrlWithGenericBase(mt.PLACE_HOLDER_PET)];case mt.ROOM:return[this.getAssetUrlWithGenericBase("room")];case mt.TILE_CURSOR:return[this.getAssetUrlWithGenericBase(mt.TILE_CURSOR)];case mt.SELECTION_ARROW:return[this.getAssetUrlWithGenericBase(mt.SELECTION_ARROW)];default:{const i=this.getCategoryForType(t);if(i===M.FLOOR||i===M.WALL){const r=this.getAssetAliasName(t);let a=s?this.getAssetUrlWithFurniIconBase(r):this.getAssetUrlWithFurniBase(t);if(s){const o=e&&e!==""&&this._activeObjectTypeIds.has(r+"*"+e);a=a.replace(/%param%/gi,o?"_"+e:"")}return[a]}return i===M.UNIT?[this.getAssetUrlWithPetBase(t)]:null}}}getAssetIconUrl(t,e){let s=null,i=[];return t&&t.indexOf(",")>=0&&(s=t,t=s.split(",")[0]),s?i=this.getAssetUrls(s,e,!0):i=this.getAssetUrls(t,e,!0),i&&i.length?i[0]:null}getAssetUrlWithGenericBase(t){return q.getValue("generic.asset.url").replace(/%libname%/gi,t)}getAssetUrlWithFurniBase(t){return q.getValue("furni.asset.url").replace(/%libname%/gi,t)}getAssetUrlWithFurniIconBase(t){return q.getValue("furni.asset.icon.url").replace(/%libname%/gi,t)}getAssetUrlWithPetBase(t){return q.getValue("pet.asset.url").replace(/%libname%/gi,t)}setRoomObjectRoomId(t,e){const s=t&&t.model;s&&s.setValue(g.OBJECT_ROOM_ID,e)}getOrRemoveEventDispatcher(t,e=!1){const s=this._events.get(t);return e&&this._events.delete(t),s}setIconListener(t){this._iconListener=t}};mt.PLACE_HOLDER="place_holder",mt.PLACE_HOLDER_WALL="place_holder_wall",mt.PLACE_HOLDER_PET="place_holder_pet",mt.PLACE_HOLDER_DEFAULT=mt.PLACE_HOLDER,mt.ROOM="room",mt.TILE_CURSOR="tile_cursor",mt.SELECTION_ARROW="selection_arrow",mt.LOADER_READY="RCL_LOADER_READY",mt.MANDATORY_LIBRARIES=[mt.PLACE_HOLDER,mt.PLACE_HOLDER_WALL,mt.PLACE_HOLDER_PET,mt.ROOM,mt.TILE_CURSOR,mt.SELECTION_ARROW];let Bn=mt;class rp{constructor(){this._objects=new Xt,this._objectsPerType=new Xt}dispose(){this.removeAllObjects()}getObject(t){const e=this._objects.getValue(t);return e||null}getObjectByIndex(t){const e=this._objects.getWithIndex(t);return e||null}createObject(t,e,s){const i=new ic(t,e,s);return this.addObject(t,s,i)}addObject(t,e,s){if(this._objects.getValue(t))return s.dispose(),null;this._objects.add(t,s);const i=this.getTypeMap(e);return i&&i.add(t,s),s}removeObject(t){const e=this._objects.remove(t);if(e){const s=this.getTypeMap(e.type);s&&s.remove(e.id),e.dispose()}}removeAllObjects(){let t=0;for(;t<this._objects.length;){const e=this._objects.getWithIndex(t);e&&e.dispose(),t++}for(this._objects.reset(),t=0;t<this._objectsPerType.length;){const e=this._objectsPerType.getWithIndex(t);e&&e.dispose(),t++}this._objectsPerType.reset()}getTypeMap(t,e=!0){let s=this._objectsPerType.getValue(t);return!s&&e&&(s=new Xt,this._objectsPerType.add(t,s)),s}get objects(){return this._objects}get totalObjects(){return this._objects.length}}const Te=class Te extends Js{constructor(t,e,s){super(),this._state=Te.ROOM_MANAGER_LOADED,this._rooms=new Map,this._contentLoader=null,this._updateCategories=[],this._listener=t,this._visualizationFactory=e,this._logicFactory=s,this._initialLoadList=[],this._pendingContentTypes=[],this._skipContentProcessing=!1,this._disposed=!1,this.onRoomContentLoadedEvent=this.onRoomContentLoadedEvent.bind(this),this.events.addEventListener(Ti.RCLE_SUCCESS,this.onRoomContentLoadedEvent),this.events.addEventListener(Ti.RCLE_FAILURE,this.onRoomContentLoadedEvent),this.events.addEventListener(Ti.RCLE_CANCEL,this.onRoomContentLoadedEvent)}onInit(){if(this._state>=Te.ROOM_MANAGER_INITIALIZING||!this._contentLoader)return;const t=Bn.MANDATORY_LIBRARIES;for(const e of t)e&&this._initialLoadList.indexOf(e)===-1&&(this._contentLoader.downloadAsset(e,this.events),this._initialLoadList.push(e));this._state=Te.ROOM_MANAGER_INITIALIZING}getRoomInstance(t){const e=this._rooms.get(t);return e||null}createRoomInstance(t){if(this._rooms.get(t))return null;const e=new ip(t,this);if(this._rooms.set(e.id,e),this._updateCategories.length)for(const s of this._updateCategories)e.addUpdateCategory(s);return e}removeRoomInstance(t){const e=this._rooms.get(t);return e?(this._rooms.delete(t),e.dispose(),!0):!1}createRoomObjectAndInitalize(t,e,s,i){const r=this.getRoomInstance(t);if(!r)return null;let a=s,o=s,h=s,_=null,l=!1;if(this._contentLoader.isLoaderType(s)){if(_=this._contentLoader.getCollection(s),!_&&(l=!0,this._contentLoader.downloadAsset(s,this.events),h=this._contentLoader.getPlaceholderName(s),_=this._contentLoader.getCollection(h),!_))return null;a=_.data.visualizationType,o=_.data.logicType}const c=r.createRoomObject(e,1,s,i);if(!c)return null;if(this._visualizationFactory){const f=this._visualizationFactory.getVisualization(a);if(!f)return r.removeRoomObject(e,i),null;f.asset=_;const p=this._visualizationFactory.getVisualizationData(h,a,_&&_.data||null);if(!p||!f.initialize(p))return r.removeRoomObject(e,i),null;c.setVisualization(f)}if(this._logicFactory){const f=this._logicFactory.getLogic(o);c.setLogic(f),f&&f.initialize(_&&_.data||null)}return l||(c.isReady=!0),this._contentLoader.setRoomObjectRoomId(c,t),c}reinitializeRoomObjectsByType(t){if(!t||!this._contentLoader||!this._visualizationFactory||!this._logicFactory)return;const e=this._contentLoader.getCollection(t);if(!e)return;const s=e.data.visualizationType,i=e.data.logicType,r=this._visualizationFactory.getVisualizationData(t,s,e.data);for(const a of this._rooms.values())if(a){for(const[o,h]of a.managers.entries())if(h)for(const _ of h.objects.getValues()){if(!_||_.type!==t)continue;const l=this._visualizationFactory.getVisualization(s);if(l)if(l.asset=e,!r||!l.initialize(r))h.removeObject(_.id);else{_.setVisualization(l);const c=this._logicFactory.getLogic(i);_.setLogic(c),c&&c.initialize(e.data),_.isReady=!0,this._listener&&this._listener.objectInitialized(a.id,_.id,o)}else h.removeObject(_.id)}}}addUpdateCategory(t){if(!(this._updateCategories.indexOf(t)>=0)&&(this._updateCategories.push(t),!!this._rooms.size))for(const s of this._rooms.values())s&&s.addUpdateCategory(t)}removeUpdateCategory(t){const e=this._updateCategories.indexOf(t);if(e!==-1&&(this._updateCategories.splice(e,1),!!this._rooms.size))for(const s of this._rooms.values())s&&s.removeUpdateCategory(t)}setContentLoader(t){this._contentLoader&&this._contentLoader.dispose(),this._contentLoader=t}processPendingContentTypes(t){if(this._skipContentProcessing){this._skipContentProcessing=!1;return}for(;this._pendingContentTypes.length;){const e=this._pendingContentTypes.shift();if(!this._contentLoader.getCollection(e)){this._listener&&this._listener.initalizeTemporaryObjectsByType(e,!1),j.log("Invalid Collection",e);continue}this.reinitializeRoomObjectsByType(e),this._listener&&this._listener.initalizeTemporaryObjectsByType(e,!0),this._initialLoadList.length>0&&this.removeFromInitialLoad(e)}}removeFromInitialLoad(t){if(!(!t||this._state===Te.ROOM_MANAGER_ERROR))if(this._contentLoader||(this._state=Te.ROOM_MANAGER_ERROR),this._contentLoader.getCollection(t)){const e=this._initialLoadList.indexOf(t);e>=0&&this._initialLoadList.splice(e,1),this._initialLoadList.length||(this._state=Te.ROOM_MANAGER_INITIALIZED,this._listener&&this._listener.onRoomEngineInitalized(!0))}else this._state=Te.ROOM_MANAGER_ERROR,this._listener&&this._listener.onRoomEngineInitalized(!1)}onRoomContentLoadedEvent(t){if(!this._contentLoader)return;const e=t.contentType;this._pendingContentTypes.indexOf(e)>=0||this._pendingContentTypes.push(e)}update(t,e=!1){if(this.processPendingContentTypes(t),!!this._rooms.size)for(const s of this._rooms.values())s&&s.update(t,e)}createRoomObjectManager(t){return new rp}get rooms(){return this._rooms}get disposed(){return this._disposed}};Te.ROOM_MANAGER_ERROR=-1,Te.ROOM_MANAGER_LOADING=0,Te.ROOM_MANAGER_LOADED=1,Te.ROOM_MANAGER_INITIALIZING=2,Te.ROOM_MANAGER_INITIALIZED=3,Te.CONTENT_PROCESSING_TIME_LIMIT_MILLISECONDS=40;let hc=Te;class np{constructor(t,e=-1,s=null,i=null,r=null){this._minLevel=-1,this._texture=null,this._colorMatrix=null,this._blendMode=null,this._name=t,this._minLevel=e,this._texture=s,this._colorMatrix=i,this._blendMode=r}get name(){return this._name}get texture(){return this._texture}set texture(t){this._texture=t}get colorMatrix(){return this._colorMatrix}set colorMatrix(t){this._colorMatrix=t}get blendMode(){return this._blendMode}set blendMode(t){this._blendMode=t}get minLevel(){return this._minLevel}}class ap{constructor(){this._effects=new Map,this._events=new $e,this._isLoaded=!1}init(){if(this._isLoaded)return;this._isLoaded=!0;const t=q.getValue("image.library.url")+"Habbo-Stories/",e=q.getValue("camera.available.effects");for(const s of e){if(!s.enabled)continue;const i=new np(s.name,s.minLevel);s.colorMatrix.length?i.colorMatrix=s.colorMatrix:(i.texture=Ft.from(t+s.name+".png"),i.blendMode=s.blendMode),this._effects.set(i.name,i)}this.events.dispatchEvent(new po(po.INITIALIZED))}applyEffects(t,e,s){const i=new Rs,r=new xt(t);i.addChild(r),s&&r.scale.set(2);for(const a of e){const o=a.effect;if(o)if(o.colorMatrix){const h=new mg;h.matrix=o.colorMatrix,h.alpha=a.alpha,r.filters||(r.filters=[]),r.filters.push(h)}else{const h=new xt(o.texture);h.alpha=a.alpha,h.blendMode=o.blendMode,i.addChild(h)}}return Ut.generateImage(i)}get effects(){return this._effects}get events(){return this._events}get isLoaded(){return this._isLoaded}}class HY{constructor(t,e){this._effect=t,this._alpha=e}get effect(){return this._effect}get alpha(){return this._alpha}}class op{flush(){return this._canShowInterstitial=!1,!0}parse(t){return t?(this._canShowInterstitial=t.readBoolean(),!0):!1}get canShowInterstitial(){return this._canShowInterstitial}}class hp{flush(){return this._errorCode=0,this._filteredText=null,!0}parse(t){return t?(this._errorCode=t.readInt(),this._filteredText=t.readString(),!0):!1}get errorCode(){return this._errorCode}get filteredText(){return this._filteredText}}class _p{flush(){return this._isOpen=!1,this._onShutdown=!1,this._isAuthenticUser=!1,!0}parse(t){return t?(this._isOpen=t.readBoolean(),this._onShutdown=t.readBoolean(),t.bytesAvailable&&(this._isAuthenticUser=t.readBoolean()),!0):!1}get isOpen(){return this._isOpen}get onShutdown(){return this._onShutdown}get isAuthenticUser(){return this._isAuthenticUser}}class lp{flush(){return this._isOpen=!1,this._minutesUntilChange=0,!0}parse(t){return t?(this._isOpen=t.readInt()>0,this._minutesUntilChange=t.readInt(),!0):!1}get isOpen(){return this._isOpen}get minutesUntilChange(){return this._minutesUntilChange}}class cp{flush(){return this._openHour=0,this._openMinute=0,!0}parse(t){return t?(this._openHour=t.readInt(),this._openMinute=t.readInt(),!0):!1}get openHour(){return this._openHour}get openMinute(){return this._openMinute}}class up{flush(){return this._openHour=0,this._openMinute=0,this._userThrownOutAtClose=!1,!0}parse(t){return t?(this._openHour=t.readInt(),this._openMinute=t.readInt(),this._userThrownOutAtClose=t.readBoolean(),!0):!1}get openHour(){return this._openHour}get openMinute(){return this._openMinute}get userThrowOutAtClose(){return this._userThrownOutAtClose}}class dp{flush(){return this._minutes=0,!0}parse(t){return t?(this._minutes=t.readInt(),!0):!1}get openMinute(){return this._minutes}}class Ep{flush(){return this._isInMaintenance=!1,this._minutesUntilMaintenance=0,this._duration=15,!0}parse(t){return t?(this._isInMaintenance=t.readBoolean(),this._minutesUntilMaintenance=t.readInt(),t.bytesAvailable&&(this._duration=t.readInt()),!0):!1}get isInMaintenance(){return this._isInMaintenance}get minutesUntilMaintenance(){return this._minutesUntilMaintenance}get duration(){return this._duration}}class gp{flush(){return this._resultCode=-1,this._name="",this._nameSuggestions=[],!0}parse(t){if(!t)return!1;this._resultCode=t.readInt(),this._name=t.readString();let e=t.readInt();for(;e>0;)this._nameSuggestions.push(t.readString()),e--;return!0}get resultCode(){return this._resultCode}get name(){return this._name}get nameSuggestions(){return this._nameSuggestions}}class fp{flush(){return this._resultCode=-1,this._name="",this._nameSuggestions=[],!0}parse(t){if(!t)return!1;this._resultCode=t.readInt(),this._name=t.readString();let e=t.readInt();for(;e>0;)this._nameSuggestions.push(t.readString()),e--;return!0}get resultCode(){return this._resultCode}get name(){return this._name}get nameSuggestions(){return this._nameSuggestions}}class Ip{flush(){return this._figure="",this._gender="",!0}parse(t){return t?(this._figure=t.readString(),this._gender=t.readString(),this._gender&&(this._gender=this._gender.toUpperCase()),!0):!1}get figure(){return this._figure}get gender(){return this._gender}}class Tp{constructor(t){this._slotId=t.readInt(),this._figureString=t.readString(),this._gender=t.readString()}get slotId(){return this._slotId}get figureString(){return this._figureString}get gender(){return this._gender}}class mp{flush(){return this._state=0,this._outfits=[],!0}parse(t){if(!t)return!1;this._state=t.readInt();let e=t.readInt();for(;e>0;)this._outfits.push(new Tp(t)),e--;return!0}get state(){return this._state}get outfits(){return this._outfits}}class Fd{constructor(t){if(!t)throw new Error("invalid_parser");this._id=t.readInt(),this._name=t.readString(),this._motto=t.readString(),this._gender=t.readString(),this._figure=t.readString()}get id(){return this._id}get name(){return this._name}get motto(){return this._motto}get figure(){return this._figure}get gender(){return this._gender}}class pp{flush(){return this._item=null,this._openInventory=!1,!0}parse(t){return t?(this._item=new Fd(t),this._openInventory=t.readBoolean(),!0):!1}get item(){return this._item}openInventory(){return this._openInventory}}class Rp{flush(){return this._items=null,!0}parse(t){this._items=new Map;let e=t.readInt();for(;e>0;){const s=new Fd(t);this._items.set(s.id,s),e--}return!0}get items(){return this._items}}class Op{flush(){return this._boughtAsGift=!1,this._item=null,!0}parse(t){return t?(this._boughtAsGift=t.readBoolean(),this._item=new Fd(t),!0):!1}get boughtAsGift(){return this._boughtAsGift}get item(){return this._item}}class Ap{flush(){return this._itemId=0,!0}parse(t){return t?(this._itemId=t.readInt(),!0):!1}get itemId(){return this._itemId}}class Sp{constructor(t){this._name=t.readString(),this._id=t.readInt(),this._consequence=t.readString()}get name(){return this._name}get id(){return this._id}get consequence(){return this._consequence}}class Cp{constructor(t){this._topics=[],this._name=t.readString();let e=t.readInt();for(;e>0;)this._topics.push(new Sp(t)),e--}dispose(){this._disposed||(this._disposed=!0,this._topics=null)}get disposed(){return this._disposed}get name(){return this._name}get topics(){return this._topics}}class Mp{constructor(t){this._tradeLockInfo="",this._machineBanInfo="",this._name=t.readString(),this._sanctionLengthInHours=t.readInt(),this._probationDays=t.readInt(),this._avatarOnly=t.readBoolean(),t.bytesAvailable&&(this._tradeLockInfo=t.readString()),t.bytesAvailable&&(this._machineBanInfo=t.readString())}get name(){return this._name}get sanctionLengthInHours(){return this._sanctionLengthInHours}get avatarOnly(){return this._avatarOnly}get tradeLockInfo(){return this._tradeLockInfo}get machineBanInfo(){return this._machineBanInfo}}class Np{flush(){return this._issueId=-1,this._accountId=1,this._sanctionType=null,!0}parse(t){return t?(this._issueId=t.readInt(),this._accountId=t.readInt(),this._sanctionType=new Mp(t),!0):!1}get issueId(){return this._issueId}get accountId(){return this._accountId}get sanctionType(){return this._sanctionType}}class Dp{flush(){return this._callForHelpCategories=null,!0}parse(t){if(!t)return!1;this._callForHelpCategories=[];let e=t.readInt();for(;e>0;)this._callForHelpCategories.push(new Cp(t)),e--;return!0}get callForHelpCategories(){return this._callForHelpCategories}}class Lp{flush(){return this._isSanctionNew=!1,this._isSanctionActive=!1,this._sanctionName=null,this._sanctionLengthHours=0,this._sanctionReason=null,this._sanctionCreationTime=null,this._probationHoursLeft=0,this._nextSanctionName=null,this._nextSanctionLengthHours=0,this._hasCustomMute=!1,this._tradeLockExpiryTime=null,!0}parse(t){return t?(this._isSanctionNew=t.readBoolean(),this._isSanctionActive=t.readBoolean(),this._sanctionName=t.readString(),this._sanctionLengthHours=t.readInt(),t.readInt(),this._sanctionReason=t.readString(),this._sanctionCreationTime=t.readString(),this._probationHoursLeft=t.readInt(),this._nextSanctionName=t.readString(),this._nextSanctionLengthHours=t.readInt(),t.readInt(),this._hasCustomMute=t.readBoolean(),t.bytesAvailable&&(this._tradeLockExpiryTime=t.readString()),!0):!1}get isSanctionNew(){return this._isSanctionNew}get isSanctionActive(){return this._isSanctionActive}get sanctionName(){return this._sanctionName}get sanctionLengthHours(){return this._sanctionLengthHours}get sanctionReason(){return this._sanctionReason}get sanctionCreationTime(){return this._sanctionCreationTime}get probationHoursLeft(){return this._probationHoursLeft}get nextSanctionName(){return this._nextSanctionName}get nextSanctionLengthHours(){return this._nextSanctionLengthHours}get hasCustomMute(){return this._hasCustomMute}get tradeLockExpiryTime(){return this._tradeLockExpiryTime}}class Pp{constructor(){this._ok=!1,this._secondsToWait=0}flush(){return this._ok=!1,this._secondsToWait=0,this._extraDataId=null,!0}parse(t){return t?(this._ok=t.readBoolean(),this._secondsToWait=t.readInt(),this._ok&&t.bytesAvailable&&(this._extraDataId=t.readString()),!0):!1}get ok(){return this._ok}get secondsToWait(){return this._secondsToWait}get extraDataId(){return this._extraDataId}}class Up{flush(){return!0}parse(t){return!!t}}class yp{flush(){return this._roomType=null,this._roomId=-1,!0}parse(t){return t?(this._roomType=t.readString(),this._roomId=t.readInt(),!0):!1}get roomType(){return this._roomType}get roomId(){return this._roomId}}class vp{flush(){return this._url="",!0}parse(t){return t?(this._url=t.readString(),!0):!1}get url(){return this._url}}class bp{constructor(){this._ok=!1,this._errorReason=null}flush(){return this._ok=!1,this._errorReason=null,!0}parse(t){return t?(this._ok=t.readBoolean(),this._errorReason=t.readString(),!0):!1}get ok(){return this._ok}get errorReason(){return this._errorReason}}class Fp{constructor(){this._creditPrice=0,this._ducketPrice=0,this._publishDucketPrice=0}flush(){return this._creditPrice=0,this._ducketPrice=0,this._publishDucketPrice=0,!0}parse(t){return t?(this._creditPrice=t.readInt(),this._ducketPrice=t.readInt(),t.bytesAvailable&&(this._publishDucketPrice=t.readInt()),!0):!1}get creditPrice(){return this._creditPrice}get ducketPrice(){return this._ducketPrice}get publishDucketPrice(){return this._publishDucketPrice}}class xp{constructor(){this._ok=!0,this._renderLimitHit=!1}flush(){return this._ok=!0,this._renderLimitHit=!1,!0}parse(t){return t?(t.bytesAvailable&&(this._ok=t.readBoolean(),this._renderLimitHit=t.readBoolean()),!0):!1}get ok(){return this._ok}get isRenderLimitHit(){return this._renderLimitHit}}class xd{parse(t){if(!t)return!1;this._campaignName=t.readString(),this._campaignImage=t.readString(),this._currentDay=t.readInt(),this._campaignDays=t.readInt(),this._openedDays=[];let e=t.readInt();for(let s=0;s<e;s++)this._openedDays.push(t.readInt());this._missedDays=[],e=t.readInt();for(let s=0;s<e;s++)this._missedDays.push(t.readInt());return!0}clone(){const t=new xd;return t.campaignDays=this._campaignDays,t.campaignImage=this._campaignImage,t.campaignName=this._campaignName,t.currentDay=this._currentDay,t.missedDays=this._missedDays,t.openedDays=this._openedDays,t}get campaignName(){return this._campaignName}set campaignName(t){this._campaignName=t}get campaignImage(){return this._campaignImage}set campaignImage(t){this._campaignImage=t}get currentDay(){return this._currentDay}set currentDay(t){this._currentDay=t}get campaignDays(){return this._campaignDays}set campaignDays(t){this._campaignDays=t}get openedDays(){return this._openedDays}set openedDays(t){this._openedDays=t}get missedDays(){return this._missedDays}set missedDays(t){this._missedDays=t}}class Gp{flush(){return this._calendarData=null,!0}parse(t){return t?(this._calendarData=new xd,this._calendarData.parse(t),!0):!1}get calendarData(){return this._calendarData}}class Bp{flush(){return this._doorOpened=!1,this._productName=null,this._customImage=null,this._furnitureClassName=null,!0}parse(t){return t?(this._doorOpened=t.readBoolean(),this._productName=t.readString(),this._customImage=t.readString(),this._furnitureClassName=t.readString(),!0):!1}get doorOpened(){return this._doorOpened}get productName(){return this._productName}get customImage(){return this._customImage}get furnitureClassName(){return this._furnitureClassName}}class wp{flush(){return this._totalCoinsForBonus=-1,this._coinsStillRequiredToBuy=-1,this._productType="",this._productClassId=-1,!0}parse(t){return t?(this._productType=t.readString(),this._productClassId=t.readInt(),this._totalCoinsForBonus=t.readInt(),this._coinsStillRequiredToBuy=t.readInt(),!0):!1}get totalCoinsForBonus(){return this._totalCoinsForBonus}get coinsStillRequiredToBuy(){return this._coinsStillRequiredToBuy}get productType(){return this._productType}get productClassId(){return this._productClassId}}class Vp{flush(){return this._furniCount=0,!0}parse(t){return t?(this._furniCount=t.readInt(),!0):!1}get furniCount(){return this._furniCount}}class Yp{flush(){return this._secondsLeft=0,this._furniLimit=0,this._maxFurniLimit=0,this._secondsLeftWithGrace=0,!0}parse(t){return t?(this._secondsLeft=t.readInt(),this._furniLimit=t.readInt(),this._maxFurniLimit=t.readInt(),t.bytesAvailable?this._secondsLeftWithGrace=t.readInt():this._secondsLeftWithGrace=this._secondsLeft,!0):!1}get secondsLeft(){return this._secondsLeft}get furniLimit(){return this._furniLimit}get maxFurniLimit(){return this._maxFurniLimit}get secondsLeftWithGrace(){return this._secondsLeftWithGrace}}class Hp{constructor(t){this._maxPurchaseSize=t.readInt(),this._bundleSize=t.readInt(),this._bundleDiscountSize=t.readInt(),this._bonusThreshold=t.readInt(),this._additionalBonusDiscountThresholdQuantities=[];let e=t.readInt();for(;e>0;)this._additionalBonusDiscountThresholdQuantities.push(t.readInt()),e--}get maxPurchaseSize(){return this._maxPurchaseSize}get bundleSize(){return this._bundleSize}get bundleDiscountSize(){return this._bundleDiscountSize}get bonusThreshold(){return this._bonusThreshold}get additionalBonusDiscountThresholdQuantities(){return this._additionalBonusDiscountThresholdQuantities}}class jp{flush(){return this._bundleDiscountRuleset=null,!0}parse(t){return t?(this._bundleDiscountRuleset=new Hp(t),!0):!1}get bundleDiscountRuleset(){return this._bundleDiscountRuleset}}class Gd{constructor(t){if(!t)throw new Error("invalid_wrapper");this.flush(),this.parse(t)}flush(){return this._visible=!1,this._icon=0,this._pageId=-1,this._pageName=null,this._localization=null,this._children=[],this._offerIds=[],!0}parse(t){if(!t)return!1;this._visible=t.readBoolean(),this._icon=t.readInt(),this._pageId=t.readInt(),this._pageName=t.readString(),this._localization=t.readString();let e=t.readInt();for(;e>0;)this._offerIds.push(t.readInt()),e--;let s=t.readInt();for(;s>0;)this._children.push(new Gd(t)),s--;return!0}get visible(){return this._visible}get icon(){return this._icon}get pageId(){return this._pageId}get pageName(){return this._pageName}get localization(){return this._localization}get children(){return this._children}get offerIds(){return this._offerIds}}class zp{flush(){return this._root=null,!0}parse(t){return t?(this._root=new Gd(t),this._newAdditionsAvailable=t.readBoolean(),this._catalogType=t.readString(),!0):!1}get root(){return this._root}get newAdditionsAvailable(){return this._newAdditionsAvailable}get catalogType(){return this._catalogType}}class Wp{constructor(t){this._images=[],this._texts=[];let e=t.readInt();for(;e>0;)this._images.push(t.readString()),e--;let s=t.readInt();for(;s>0;)this._texts.push(t.readString()),s--}get images(){return this._images}get texts(){return this._texts}}class kp{flush(){return this._pageName=null,this._pageId=0,this._secondsToExpiry=0,this._image=null,!0}parse(t){return t?(this._pageId=t.readInt(),this._pageName=t.readString(),this._secondsToExpiry=t.readInt(),this._image=t.readString(),!0):!1}get pageName(){return this._pageName}get pageId(){return this._pageId}get secondsToExpiry(){return this._secondsToExpiry}get image(){return this._image}}const pr=class pr{constructor(t){if(!t)throw new Error("invalid_wrapper");this.flush(),this.parse(t)}flush(){return this._productType=null,this._furniClassId=-1,this._extraParam=null,this._productCount=0,this._uniqueLimitedItem=!1,this._uniqueLimitedItemSeriesSize=0,this._uniqueLimitedItemsLeft=0,!0}parse(t){switch(this._productType=t.readString(),this._productType){case pr.B:return this._extraParam=t.readString(),this._productCount=1,!0;default:return this._furniClassId=t.readInt(),this._extraParam=t.readString(),this._productCount=t.readInt(),this._uniqueLimitedItem=t.readBoolean(),this._uniqueLimitedItem&&(this._uniqueLimitedItemSeriesSize=t.readInt(),this._uniqueLimitedItemsLeft=t.readInt()),!0}}get productType(){return this._productType}get furniClassId(){return this._furniClassId}get extraParam(){return this._extraParam}get productCount(){return this._productCount}get uniqueLimitedItem(){return this._uniqueLimitedItem}get uniqueLimitedSeriesSize(){return this._uniqueLimitedItemSeriesSize}get uniqueLimitedItemsLeft(){return this._uniqueLimitedItemsLeft}};pr.I="i",pr.S="s",pr.E="e",pr.B="b";let zn=pr;class sl{constructor(t){this._offerId=t.readInt(),this._localizationId=t.readString(),this._rent=t.readBoolean(),this._priceCredits=t.readInt(),this._priceActivityPoints=t.readInt(),this._priceActivityPointsType=t.readInt(),this._giftable=t.readBoolean(),this._products=[];let e=t.readInt();for(;e>0;)this._products.push(new zn(t)),e--;this._clubLevel=t.readInt(),this._bundlePurchaseAllowed=t.readBoolean(),this._isPet=t.readBoolean(),this._previewImage=t.readString()}get offerId(){return this._offerId}get localizationId(){return this._localizationId}get rent(){return this._rent}get priceCredits(){return this._priceCredits}get priceActivityPoints(){return this._priceActivityPoints}get priceActivityPointsType(){return this._priceActivityPointsType}get clubLevel(){return this._clubLevel}get giftable(){return this._giftable}get bundlePurchaseAllowed(){return this._bundlePurchaseAllowed}get isPet(){return this._isPet}get previewImage(){return this._previewImage}get products(){return this._products}}const Gi=class Gi{constructor(t){if(!t)throw new Error("invalid_wrapper");this.flush(),this.parse(t)}flush(){return this._type=-1,this._position=null,this._itemName=null,this._itemPromoImage=null,this._catalogPageLocation=null,this._productCode=null,this._productOfferId=0,this._expirationTime=0,!0}parse(t){if(!t)return!1;switch(this._position=t.readInt(),this._itemName=t.readString(),this._itemPromoImage=t.readString(),this._type=t.readInt(),this._type){case Gi.ITEM_CATALOGUE_PAGE:this._catalogPageLocation=t.readString();break;case Gi.ITEM_PRODUCT_OFFER:this._productOfferId=t.readInt();break;case Gi.ITEM_IAP:this._productCode=t.readString();break}const e=t.readInt();return this._expirationTime=e>0?e*1e3+nt():0,!0}get type(){return this._type}get position(){return this._position}get itemName(){return this._itemName}get itemPromoImage(){return this._itemPromoImage}get catalogPageLocation(){return this._catalogPageLocation}get productCode(){return this._productCode}get productOfferId(){return this._productOfferId}get expirationTime(){return this._expirationTime}};Gi.ITEM_CATALOGUE_PAGE=0,Gi.ITEM_PRODUCT_OFFER=1,Gi.ITEM_IAP=2;let _c=Gi;class Kp{flush(){return this._pageId=-1,this._catalogType=null,this._layoutCode=null,this._localization=null,this._offers=[],this._offerId=-1,this._acceptSeasonCurrencyAsCredits=!1,this._frontPageItems=[],!0}parse(t){if(!t)return!1;this._pageId=t.readInt(),this._catalogType=t.readString(),this._layoutCode=t.readString(),this._localization=new Wp(t);let e=t.readInt();for(;e>0;)this._offers.push(new sl(t)),e--;if(this._offerId=t.readInt(),this._acceptSeasonCurrencyAsCredits=t.readBoolean(),t.bytesAvailable){let s=t.readInt();for(;s>0;)this._frontPageItems.push(new _c(t)),s--}return!0}get pageId(){return this._pageId}get catalogType(){return this._catalogType}get layoutCode(){return this._layoutCode}get localization(){return this._localization}get offers(){return this._offers}get offerId(){return this._offerId}get acceptSeasonCurrencyAsCredits(){return this._acceptSeasonCurrencyAsCredits}get frontPageItems(){return this._frontPageItems}}class Xp{flush(){return this._pageName=null,this._secondsToExpiry=0,this._image=null,!0}parse(t){return t?(this._pageName=t.readString(),this._secondsToExpiry=t.readInt(),this._image=t.readString(),!0):!1}get pageName(){return this._pageName}get secondsToExpiry(){return this._secondsToExpiry}get image(){return this._image}}class qp{flush(){return this._instantlyRefreshCatalogue=!1,this._newFurniDataHash=null,!0}parse(t){return t?(this._instantlyRefreshCatalogue=t.readBoolean(),t.bytesAvailable&&(this._newFurniDataHash=t.readString()),!0):!1}get instantlyRefreshCatalogue(){return this._instantlyRefreshCatalogue}get newFurniDataHash(){return this._newFurniDataHash}}class Qp{constructor(t){this._offerId=t.readInt(),this._isVip=t.readBoolean(),this._daysRequired=t.readInt(),this._isSelectable=t.readBoolean()}get offerId(){return this._offerId}get isVip(){return this._isVip}get isSelectable(){return this._isSelectable}get daysRequired(){return this._daysRequired}}class Jp{flush(){return!0}parse(t){if(!t)return!1;this._offers=[],this._giftData=new Map,this._daysUntilNextGift=t.readInt(),this._giftsAvailable=t.readInt();const e=t.readInt();for(let i=0;i<e;i++)this._offers.push(new sl(t));const s=t.readInt();for(let i=0;i<s;i++){const r=new Qp(t);this._giftData.set(r.offerId,r)}return!0}get offers(){return this._offers}get daysUntilNextGift(){return this._daysUntilNextGift}get giftsAvailable(){return this._giftsAvailable}set giftsAvailable(t){this._giftsAvailable=t}getOfferExtraData(t){return t?this._giftData.get(t):null}get giftData(){return this._giftData}}class Zp{flush(){return this._productCode=null,this._products=[],!0}parse(t){if(!t)return!1;this._productCode=t.readString();let e=t.readInt();for(;e>0;)this._products.push(new zn(t)),e--;return!0}get productCode(){return this._productCode}get products(){return this._products}}class Sg{constructor(t){if(!t)throw new Error("invalid_wrapper");this._offerId=t.readInt(),this._productCode=t.readString(),t.readBoolean(),this._priceCredits=t.readInt(),this._priceActivityPoints=t.readInt(),this._priceActivityPointsType=t.readInt(),this._vip=t.readBoolean(),this._months=t.readInt(),this._extraDays=t.readInt(),this._giftable=t.readBoolean(),this._daysLeftAfterPurchase=t.readInt(),this._year=t.readInt(),this._month=t.readInt(),this._day=t.readInt()}get offerId(){return this._offerId}get productCode(){return this._productCode}get priceCredits(){return this._priceCredits}get priceActivityPoints(){return this._priceActivityPoints}get priceActivityPointsType(){return this._priceActivityPointsType}get vip(){return this._vip}get months(){return this._months}get extraDays(){return this._extraDays}get daysLeftAfterPurchase(){return this._daysLeftAfterPurchase}get year(){return this._year}get month(){return this._month}get day(){return this._day}get giftable(){return this._giftable}}class $p extends Sg{constructor(t){super(t),this._originalPrice=t.readInt(),this._originalActivityPointPrice=t.readInt(),this._originalActivityPointType=t.readInt(),this._subscriptionDaysLeft=t.readInt()}get originalPrice(){return this._originalPrice*this.months}get originalActivityPointPrice(){return this._originalActivityPointPrice*this.months}get originalActivityPointType(){return this._originalActivityPointType}get discountCreditAmount(){return this._originalPrice*this.months-this.priceCredits}get discountActivityPointAmount(){return this.originalActivityPointPrice*this.months-this.priceActivityPoints}get subscriptionDaysLeft(){return this._subscriptionDaysLeft}}class tR{flush(){return this._available=!1,this._pricePointUrl=null,this._market=null,this._lengthInDays=0,!0}parse(t){return t?(this._pricePointUrl=t.readString(),this._pricePointUrl!==""&&(this._available=!0),this._market=t.readString(),this._lengthInDays=t.readInt(),!0):!1}get available(){return this._available}get pricePointUrl(){return this._pricePointUrl}get market(){return this._market}get lengthInDays(){return this._lengthInDays}}class eR{constructor(t){this._stuffId=t.readInt(),this._charges=t.readInt(),this._SafeStr_6935=t.readInt(),this._SafeStr_6936=t.readInt(),this._SafeStr_6518=t.readInt(),this._SafeStr_7875=t.readInt()}get stuffId(){return this._stuffId}get charges(){return this._charges}get _SafeStr_5946(){return this._SafeStr_6935}get _SafeStr_5944(){return this._SafeStr_6936}get _SafeStr_7876(){return this._SafeStr_7875}get _SafeStr_5945(){return this._SafeStr_6518}}class sR{flush(){return this._fireworkChargeData=null,!0}parse(t){return t?(this._fireworkChargeData=new eR(t),!0):!1}get fireworkChargeData(){return this._fireworkChargeData}}class iR{flush(){return!0}parse(t){return!!t}}class rR{constructor(){this._isEnabled=!1,this._price=null,this._giftWrappers=null,this._boxTypes=null,this._ribbonTypes=null,this._giftFurnis=null}flush(){return this._boxTypes=null,this._giftFurnis=null,this._giftWrappers=null,this._ribbonTypes=null,this._isEnabled=null,this._price=null,!0}parse(t){if(!t)return!1;const e=[],s=[],i=[],r=[];this._isEnabled=t.readBoolean(),this._price=t.readInt();let a=t.readInt(),o=0;for(;o<a;)e.push(t.readInt()),o++;for(a=t.readInt(),o=0;o<a;)s.push(t.readInt()),o++;for(a=t.readInt(),o=0;o<a;)i.push(t.readInt()),o++;for(a=t.readInt(),o=0;o<a;)r.push(t.readInt()),o++;return this._giftWrappers=e,this._ribbonTypes=i,this._giftFurnis=r,this._boxTypes=s,!0}get giftWrappers(){return this._giftWrappers}get ribbonTypes(){return this._ribbonTypes}get giftFurnis(){return this._giftFurnis}get boxTypes(){return this._boxTypes}get isEnabled(){return this._isEnabled}get price(){return this._price}}class nR{flush(){return this._offer=null,!0}parse(t){return t?(this._offer=new $p(t),!0):!1}get offer(){return this._offer}}class aR{flush(){return this._offers=[],!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;)this._offers.push(new Sg(t)),e--;return!0}get offers(){return this._offers}}class oR{flush(){return this._offerId=0,this._isGiftable=!1,!0}parse(t){return t?(this._offerId=t.readInt(),this._isGiftable=t.readBoolean(),!0):!1}get offerId(){return this._offerId}get isGiftable(){return this._isGiftable}}class hR{flush(){return!0}parse(t){return!!t}}class _R{flush(){return this._appearsInSeconds=-1,this._pageId=-1,this._offerId=-1,this._productType="",!0}parse(t){return t?(this._appearsInSeconds=t.readInt(),this._pageId=t.readInt(),this._offerId=t.readInt(),this._productType=t.readString(),!0):!1}get appearsInSeconds(){return this._appearsInSeconds}get pageId(){return this._pageId}get offerId(){return this._offerId}get productType(){return this._productType}}class lR{constructor(){this._notEnoughCredits=!1,this._notEnoughActivityPoints=!1,this._activityPointType=0}flush(){return this._notEnoughCredits=!1,this._notEnoughActivityPoints=!1,this._activityPointType=0,!0}parse(t){return t?(this._notEnoughCredits=t.readBoolean(),this._notEnoughActivityPoints=t.readBoolean(),t.bytesAvailable&&(this._activityPointType=t.readInt()),!0):!1}get notEnoughCredits(){return this._notEnoughCredits}get notEnoughActivityPoints(){return this._notEnoughActivityPoints}get activityPointType(){return this._activityPointType}}class cR{flush(){return this._offer=null,!0}parse(t){return t?(this._offer=new sl(t),!0):!1}get offer(){return this._offer}}class uR{flush(){return this._code=0,!0}parse(t){return t?(this._code=t.readInt(),!0):!1}get code(){return this._code}}class dR{flush(){return this._code=0,!0}parse(t){return t?(this._code=t.readInt(),!0):!1}get code(){return this._code}}class ER{constructor(t){if(!t)throw new Error("invalid_wrapper");this.flush(),this.parse(t)}flush(){return this._offerId=-1,this._localizationId=null,this._rent=!1,this._priceCredits=0,this._priceActivityPoints=0,this._priceActivityPointsType=0,this._clubLevel=0,this._giftable=!1,this._bundlePurchaseAllowed=!1,this._products=[],!0}parse(t){if(!t)return!1;this._offerId=t.readInt(),this._localizationId=t.readString(),this._rent=t.readBoolean(),this._priceCredits=t.readInt(),this._priceActivityPoints=t.readInt(),this._priceActivityPointsType=t.readInt(),this._giftable=t.readBoolean();let e=t.readInt();for(;e>0;)this._products.push(new zn(t)),e--;return this._clubLevel=t.readInt(),this._bundlePurchaseAllowed=t.readBoolean(),!0}get offerId(){return this._offerId}get localizationId(){return this._localizationId}get rent(){return this._rent}get priceCredits(){return this._priceCredits}get priceActivityPoints(){return this._priceActivityPoints}get priceActivityPointsType(){return this._priceActivityPointsType}get clubLevel(){return this._clubLevel}get giftable(){return this._giftable}get bundlePurchaseAllowed(){return this._bundlePurchaseAllowed}get products(){return this._products}}class gR{flush(){return this._offer=null,!0}parse(t){return t?(this._offer=new ER(t),!0):!1}get offer(){return this._offer}}class fR{flush(){return this._clubLevel=0,this._securityLevel=0,this._isAmbassador=!1,!0}parse(t){return t?(this._clubLevel=t.readInt(),this._securityLevel=t.readInt(),this._isAmbassador=t.readBoolean(),!0):!1}get clubLevel(){return this._clubLevel}get securityLevel(){return this._securityLevel}get isAmbassador(){return this._isAmbassador}}const T_=class T_{flush(){return!0}parse(t){return t?(this._status=t.readInt(),!0):!1}get status(){return this._status}};T_.SAFETY_LOCK_STATUS_LOCKED=0,T_.SAFETY_LOCK_STATUS_UNLOCKED=1;let xo=T_;class IR{flush(){return this._result=-1,this._validationInfo="",!0}parse(t){return t?(this._result=t.readInt(),this._validationInfo=t.readString(),!0):!1}get result(){return this._result}get validationInfo(){return this._validationInfo}}const TE=class TE{flush(){return this._result=-1,!0}parse(t){return t?(this._result=t.readInt(),!0):!1}get result(){return this._result}};TE.EMAIL_STATUS_OK=0;let lc=TE;class TR{constructor(t){if(!t)throw new Error("invalid_wrapper");this.flush(),this.parse(t)}flush(){return this._relationshipStatusType=Cl.NONE,this._friendCount=0,this._randomFriendId=0,this._randomFriendFigure=null,this._randomFriendName=null,!0}parse(t){return t?(this._relationshipStatusType=t.readInt(),this._friendCount=t.readInt(),this._randomFriendId=t.readInt(),this._randomFriendName=t.readString(),this._randomFriendFigure=t.readString(),!0):!1}get relationshipStatusType(){return this._relationshipStatusType}get friendCount(){return this._friendCount}get randomFriendId(){return this._randomFriendId}get randomFriendName(){return this._randomFriendName}get randomFriendFigure(){return this._randomFriendFigure}}class mR{flush(){return this._userId=0,this._relationshipStatusMap=null,!0}parse(t){if(!t)return!1;this._userId=t.readInt(),this._relationshipStatusMap=new Xt;const e=t.readInt();for(let s=0;s<e;s++){const i=new TR(t);this._relationshipStatusMap.add(i.relationshipStatusType,i)}return!0}get userId(){return this._userId}get relationshipStatusMap(){return this._relationshipStatusMap}}class pR{flush(){return this._userId=null,this._badges=[],!0}parse(t){if(!t)return!1;this._userId=t.readInt();let e=t.readInt();for(;e>0;){t.readInt();const s=t.readString();this._badges.push(s),e--}return!0}get userId(){return this._userId}get badges(){return this._badges}}class RR{constructor(t){if(!t)throw new Error("invalid_wrapper");this.flush(),this.parse(t)}flush(){return this._userId=0,this._username=null,this._figure=null,this._gender=null,this._motto=null,this._realName=null,this._directMail=!1,this._respectsReceived=0,this._respectsRemaining=0,this._respectsPetRemaining=0,this._streamPublishingAllowed=!1,this._lastAccessDate=null,this._canChangeName=!1,this._safetyLocked=!1,!0}parse(t){return t?(this._userId=t.readInt(),this._username=t.readString(),this._figure=t.readString(),this._gender=t.readString(),this._motto=t.readString(),this._realName=t.readString(),this._directMail=t.readBoolean(),this._respectsReceived=t.readInt(),this._respectsRemaining=t.readInt(),this._respectsPetRemaining=t.readInt(),this._streamPublishingAllowed=t.readBoolean(),this._lastAccessDate=t.readString(),this._canChangeName=t.readBoolean(),this._safetyLocked=t.readBoolean(),!0):!1}get userId(){return this._userId}get username(){return this._username}get figure(){return this._figure}get gender(){return this._gender}get motto(){return this._motto}get realName(){return this._realName}get directMail(){return this._directMail}get respectsReceived(){return this._respectsReceived}get respectsRemaining(){return this._respectsRemaining}get respectsPetRemaining(){return this._respectsPetRemaining}get streamPublishingAllowed(){return this._streamPublishingAllowed}get lastAccessedDate(){return this._lastAccessDate}get canChangeName(){return this._canChangeName}get safetyLocked(){return this._safetyLocked}}class OR{flush(){return this._userInfo=null,!0}parse(t){return!(!t||(this._userInfo=new RR(t),!this._userInfo))}get userInfo(){return this._userInfo}}class AR{flush(){return this._webId=-1,this._id=-1,this._newName="",!0}parse(t){return t?(this._webId=t.readInt(),this._id=t.readInt(),this._newName=t.readString(),!0):!1}get webId(){return this._webId}get id(){return this._id}get newName(){return this._newName}}class Cg{constructor(t){this._groupId=t.readInt(),this._groupName=t.readString(),this._badgeCode=t.readString(),this._colorA=t.readString(),this._colorB=t.readString(),this._favourite=t.readBoolean(),this._ownerId=t.readInt(),this._hasForum=t.readBoolean()}get groupId(){return this._groupId}get groupName(){return this._groupName}get badgeCode(){return this._badgeCode}get colorA(){return this._colorA}get colorB(){return this._colorB}get favourite(){return this._favourite}get ownerId(){return this._ownerId}get hasForum(){return this._hasForum}}class SR{flush(){return this._id=0,this._username=null,this._figure=null,this._motto=null,this._registration=null,this._achievementPoints=0,this._friendsCount=0,this._isMyFriend=!1,this._requestSent=!1,this._isOnline=!1,this._groups=[],this._secondsSinceLastVisit=0,this._openProfileWindow=!1,!0}parse(t){if(!t)return!1;this._id=t.readInt(),this._username=t.readString(),this._figure=t.readString(),this._motto=t.readString(),this._registration=t.readString(),this._achievementPoints=t.readInt(),this._friendsCount=t.readInt(),this._isMyFriend=t.readBoolean(),this._requestSent=t.readBoolean(),this._isOnline=t.readBoolean();const e=t.readInt();for(let s=0;s<e;s++)this._groups.push(new Cg(t));return this._secondsSinceLastVisit=t.readInt(),this._openProfileWindow=t.readBoolean(),!0}get id(){return this._id}get username(){return this._username}get figure(){return this._figure}get motto(){return this._motto}get registration(){return this._registration}get achievementPoints(){return this._achievementPoints}get friendsCount(){return this._friendsCount}get isMyFriend(){return this._isMyFriend}get requestSent(){return this._requestSent}get isOnline(){return this._isOnline}get groups(){return this._groups}get secondsSinceLastVisit(){return this._secondsSinceLastVisit}get openProfileWindow(){return this._openProfileWindow}}class CR{flush(){return this._volumeSystem=0,this._volumeFurni=0,this._volumeTrax=0,this._oldChat=!1,this._roomInvites=!1,this._cameraFollow=!1,this._flags=0,this._chatType=0,!0}parse(t){return t?(this._volumeSystem=t.readInt(),this._volumeFurni=t.readInt(),this._volumeTrax=t.readInt(),this._oldChat=t.readBoolean(),this._roomInvites=t.readBoolean(),this._cameraFollow=t.readBoolean(),this._flags=t.readInt(),this._chatType=t.readInt(),!0):!1}get volumeSystem(){return this._volumeSystem}get volumeFurni(){return this._volumeFurni}get volumeTrax(){return this._volumeTrax}get oldChat(){return this._oldChat}get roomInvites(){return this._roomInvites}get cameraFollow(){return this._cameraFollow}get flags(){return this._flags}get chatType(){return this._chatType}}class MR{flush(){return this._roomUnitId=-1,this._tags=[],!0}parse(t){if(!t)return!1;this._roomUnitId=t.readInt();let e=t.readInt();for(;e>0;)this._tags.push(t.readString()),e--;return!0}get roomUnitId(){return this._roomUnitId}get tags(){return this._tags}}class NR{flush(){return this._email=null,this._isVerified=!1,this._allowChange=!1,!0}parse(t){return t?(this._email=t.readString(),this._isVerified=t.readBoolean(),this._allowChange=t.readBoolean(),!0):!1}get email(){return this._email}get isVerified(){return this._isVerified}get allowChange(){return this._allowChange}}class DR{flush(){return this._userId=-1,!0}parse(t){return t?(this._userId=t.readInt(),!0):!1}get userId(){return this._userId}}class LR{flush(){return this._groupId=-1,!0}parse(t){return t?(this._groupId=t.readInt(),!0):!1}get groupId(){return this._groupId}}class PR{flush(){return this._groupId=-1,this._requester=null,!0}parse(t){return t?(this._groupId=t.readInt(),this._requester=new Mu(t),!0):!1}get groupId(){return this._groupId}get requester(){return this._requester}}const mE=class mE{flush(){return this._reason=-1,!0}parse(t){return t?(this._reason=t.readInt(),!0):!1}get reason(){return this._reason}};mE.INSUFFICIENT_SUBSCRIPTION_LEVEL=2;let cc=mE;class UR{flush(){return this._guildId=-1,this._reason=-1,!0}parse(t){return t?(this._guildId=t.readInt(),this._reason=t.readInt(),!0):!1}get guildId(){return this._guildId}get reason(){return this._reason}}class yR{flush(){return this._groups=[],!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;)this._groups.push(new Cg(t)),e--;return!0}get groups(){return this._groups}}class vR{flush(){return this._badges=new Map,!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;){const s=t.readInt(),i=t.readString();this._badges.set(s,i),e--}return!0}get badges(){return this._badges}}const pE=class pE{flush(){return this._reason=-1,!0}parse(t){return t?(this._reason=t.readInt(),!0):!1}get reason(){return this._reason}};pE.INSUFFICIENT_SUBSCRIPTION_LEVEL=4;let uc=pE;class bR{flush(){return this._ignoredUsers=[],!0}parse(t){if(!t)return!1;this._ignoredUsers=[];let e=t.readInt();for(;e>0;)this._ignoredUsers.push(t.readString()),e--;return!0}get ignoredUsers(){return this._ignoredUsers}}class FR{flush(){return this._result=-1,this._name=null,!0}parse(t){return t?(this._result=t.readInt(),this._name=t.readString(),!0):!1}get result(){return this._result}get name(){return this._name}}class xR{flush(){return this._link=null,!0}parse(t){return t?(this._link=t.readString(),!0):!1}get link(){return this._link}}class GR{flush(){return this._credits=null,!0}parse(t){return t?(this._credits=t.readString(),!0):!1}get credits(){return this._credits}}class BR{flush(){return this._currencies=new Map,!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;)this._currencies.set(t.readInt(),t.readInt()),e--;return!0}get currencies(){return this._currencies}}const pn=class pn{flush(){return this._productName=null,this._daysToPeriodEnd=0,this._memberPeriods=0,this._periodsSubscribedAhead=0,this._responseType=0,this._hasEverBeenMember=!1,this._isVip=!1,this._pastClubDays=0,this._pastVipDays=0,this._minutesUntilExpiration=0,this._minutesSinceLastModified=0,!0}parse(t){return t?(this._productName=t.readString(),this._daysToPeriodEnd=t.readInt(),this._memberPeriods=t.readInt(),this._periodsSubscribedAhead=t.readInt(),this._responseType=t.readInt(),this._hasEverBeenMember=t.readBoolean(),this._isVip=t.readBoolean(),this._pastClubDays=t.readInt(),this._pastVipDays=t.readInt(),this._minutesUntilExpiration=t.readInt(),t.bytesAvailable&&(this._minutesSinceLastModified=t.readInt()),!0):!1}get productName(){return this._productName}get daysToPeriodEnd(){return this._daysToPeriodEnd}get memberPeriods(){return this._memberPeriods}get periodsSubscribedAhead(){return this._periodsSubscribedAhead}get responseType(){return this._responseType}get hasEverBeenMember(){return this._hasEverBeenMember}get isVip(){return this._isVip}get pastClubDays(){return this._pastClubDays}get pastVipDays(){return this._pastVipDays}get minutesUntilExpiration(){return this._minutesUntilExpiration}get minutesSinceLastModified(){return this._minutesSinceLastModified}};pn.RESPONSE_TYPE_LOGIN=1,pn.RESPONSE_TYPE_PURCHASE=2,pn.RESPONSE_TYPE_DISCOUNT_AVAILABLE=3,pn.RESPONSE_TYPE_CITIZENSHIP_DISCOUNT=4;let dc=pn;const Rn=class Rn{constructor(t){if(this._unseen=0,!t)throw new Error("invalid_parser");this._achievementId=t.readInt(),this._level=t.readInt(),this._badgeId=t.readString(),this._scoreAtStartOfLevel=t.readInt(),this._scoreLimit=Math.max(1,t.readInt()),this._levelRewardPoints=t.readInt(),this._levelRewardPointType=t.readInt(),this._currentPoints=t.readInt(),this._finalLevel=t.readBoolean(),this._category=t.readString(),this._subCategory=t.readString(),this._levelCount=t.readInt(),this._displayMethod=t.readInt()}get achievementId(){return this._achievementId}get badgeId(){return this._badgeId}get level(){return this._level}get scoreAtStartOfLevel(){return this._scoreAtStartOfLevel}get scoreLimit(){return this._scoreLimit-this._scoreAtStartOfLevel}get levelRewardPoints(){return this._levelRewardPoints}get levelRewardPointType(){return this._levelRewardPointType}get currentPoints(){return this._currentPoints-this._scoreAtStartOfLevel}get finalLevel(){return this._finalLevel}get category(){return this._category}get subCategory(){return this._subCategory}get levelCount(){return this._levelCount}get firstLevelAchieved(){return this._level>1||this._finalLevel}setMaxProgress(){this._currentPoints=this._scoreLimit}get displayMethod(){return this._displayMethod}get progress(){return this._currentPoints}get toNextProgress(){return this._scoreLimit}set unseen(t){this._unseen=t}get unseen(){return this._unseen}reset(t){this._achievementId=t._achievementId,this._level=t._level,this._badgeId=t._badgeId,this._scoreAtStartOfLevel=t._scoreAtStartOfLevel,this._scoreLimit=t._scoreLimit,this._levelRewardPoints=t._levelRewardPoints,this._levelRewardPointType=t._levelRewardPointType,this._currentPoints=t._currentPoints,this._finalLevel=t._finalLevel,this._category=t.category,this._subCategory=t._subCategory,this._levelCount=t._levelCount,this._displayMethod=t._displayMethod}};Rn.DISPLAY_METHOD_OBSOLETE=-1,Rn.DISPLAY_METHOD_SHOW_LEVEL_PROGRESS=0,Rn.DISPLAY_METHOD_NEVER_SHOW_PROGRESS=1,Rn.DISPLAY_METHOD_SHOW_TOTAL_PROGRESS=2;let Go=Rn;class wR{flush(){return this._achievement=null,!0}parse(t){return t?(this._achievement=new Go(t),!0):!1}get achievement(){return this._achievement}}const m_=class m_{constructor(t){this._achievementId=t.readInt(),this._level=t.readInt(),this._badgeId=t.readString(),this._requiredLevel=t.readInt(),this._state=t.readInt()}dispose(){this._achievementId=0,this._level=0,this._badgeId="",this._requiredLevel=0}get achievementId(){return this._achievementId}get level(){return this._level}get badgeId(){return this._badgeId}get requiredLevel(){return this._requiredLevel}get enabled(){return this._state===m_.STATE_SELECTABLE}get state(){return this._state}};m_.STATE_SELECTABLE=0;let Ec=m_;class VR{flush(){return this._achievements=[],this._defaultCategory=null,!0}parse(t){if(!t)return!1;this._achievements=[];let e=t.readInt();for(;e>0;)this._achievements.push(new Go(t)),e--;return this._defaultCategory=t.readString(),!0}get achievements(){return this._achievements}get defaultCategory(){return this._defaultCategory}}class YR{flush(){return this._score=0,!0}parse(t){return t?(this._score=t.readInt(),!0):!1}get score(){return this._score}}class HR{get type(){return this._type}set type(t){this._type=t}get subType(){return this._subType}set subType(t){this._subType=t}get duration(){return this._duration}set duration(t){this._duration=t}get inactiveEffectsInInventory(){return this._inactiveEffectsInInventory}set inactiveEffectsInInventory(t){this._inactiveEffectsInInventory=t}get secondsLeftIfActive(){return this._secondsLeftIfActive}set secondsLeftIfActive(t){this._secondsLeftIfActive=t}get isPermanent(){return this._permanent}set isPermanent(t){this._permanent=t}}class jR{flush(){return this._type=0,this._duration=0,this._isPermanent=!1,!0}parse(t){return t?(this._type=t.readInt(),this._duration=t.readInt(),this._isPermanent=t.readBoolean(),!0):!1}get type(){return this._type}get duration(){return this._duration}get isPermanent(){return this._isPermanent}}class zR{flush(){return this._type=0,this._subType=0,this._duration=0,this._permanent=!1,!0}parse(t){return t?(this._type=t.readInt(),this._subType=t.readInt(),this._duration=t.readInt(),this._permanent=t.readBoolean(),!0):!1}get type(){return this._type}get subType(){return this._subType}get duration(){return this._duration}get isPermanent(){return this._permanent}}class WR{flush(){return this._type=0,!0}parse(t){return t?(this._type=t.readInt(),!0):!1}get type(){return this._type}}class kR{flush(){return this._type=0,!0}parse(t){return t?(this._type=t.readInt(),!0):!1}get type(){return this._type}}class KR{flush(){return this._effects=[],!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;){const s=new HR;s.type=t.readInt(),s.subType=t.readInt(),s.duration=t.readInt(),s.inactiveEffectsInInventory=t.readInt(),s.secondsLeftIfActive=t.readInt(),s.isPermanent=t.readBoolean(),this._effects.push(s),e--}return!0}get effects(){return this._effects}}class XR{constructor(t,e){if(!e)throw new Error("invalid_parser");this._badgeId="ACH_"+t+e.readInt(),this._limit=e.readInt()}get badgeId(){return this._badgeId}get limit(){return this._limit}}class qR{flush(){return this._data=[],!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;){const s=t.readString(),i=t.readInt();let r=0;for(;r<i;)this._data.push(new XR(s,t)),r++;e--}return!0}get data(){return this._data}}class QR{flush(){return this._badgeId=0,this._badgeCode=null,!0}parse(t){return t?(this._badgeId=t.readInt(),this._badgeCode=t.readString(),!0):!1}get badgeId(){return this._badgeId}get badgeCode(){return this._badgeCode}}class JR{flush(){return this._allBadgeCodes=[],this._activeBadgeCodes=null,this._badgeIds=null,!0}parse(t){if(!t)return!1;this._allBadgeCodes=[],this._activeBadgeCodes=[],this._badgeIds=new Xt;let e=t.readInt();for(;e>0;){const s=t.readInt(),i=t.readString();this._badgeIds.add(i,s),this._allBadgeCodes.push(i),e--}for(e=t.readInt();e>0;){t.readInt();const s=t.readString();this._activeBadgeCodes.push(s),e--}return!0}getBadgeId(t){return this._badgeIds.getValue(t)}getAllBadgeCodes(){return this._allBadgeCodes}getActiveBadgeCodes(){return this._activeBadgeCodes}}class ZR{flush(){return!0}parse(t){return t?(this._requestCode=t.readString(),this._fulfilled=t.readBoolean(),!0):!1}get requestCode(){return this._requestCode}get fulfilled(){return this._fulfilled}}class $R{flush(){return this._figureSetIds=[],this._boundFurnitureNames=[],!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;)this._figureSetIds.push(t.readInt()),e--;let s=t.readInt();for(;s>0;)this._boundFurnitureNames.push(t.readString()),s--;return!0}get figureSetIds(){return this._figureSetIds}get boundsFurnitureNames(){return this._boundFurnitureNames}}const On=class On{flush(){return this._reason=0,this._parameter="",!0}parse(t){return t?(this._reason=t.readInt(),this._parameter=t.readString(),!0):!1}get reason(){return this._reason}get parameter(){return this._parameter}};On.REASON_FULL=1,On.REASON_CLOSED=2,On.REASON_QUEUE_ERROR=3,On.REASON_BANNED=4;let gc=On;class tO{flush(){return this._userName=null,!0}parse(t){return t?(this._userName=t.readString(),!0):!1}get userName(){return this._userName}}class eO{flush(){return!0}parse(t){return!!t}}class sO{flush(){return!0}parse(t){return!!t}}class iO{flush(){return this._controllerLevel=Ii.NONE,!0}parse(t){return t?(this._controllerLevel=t.readInt(),!0):!1}get controllerLevel(){return this._controllerLevel}}class rO{flush(){return!0}parse(t){return!!t}}class nO{flush(){return this._roomId=0,!0}parse(t){return t?(this._roomId=t.readInt(),!0):!1}get roomId(){return this._roomId}}class aO{flush(){return this._botId=-1,this._commandId=-1,this._data="",!0}parse(t){return t?(this._botId=t.readInt(),this._commandId=t.readInt(),this._data=t.readString(),!0):!1}get botId(){return this._botId}get commandId(){return this._commandId}get data(){return this._data}}class oO{flush(){return this._botId=-1,!0}parse(t){return t?(this._botId=t.readInt(),!0):!1}get botId(){return this._botId}}class hO{constructor(t){this._id=t.readInt(),this._data=t.readString()}get id(){return this._id}get data(){return this._data}}class _O{flush(){return this._botId=-1,this._skillList=[],!0}parse(t){if(!t)return!1;this._botId=t.readInt();let e=t.readInt();for(;e>0;)this._skillList.push(new hO(t)),e--;return!0}get botId(){return this._botId}get skillList(){return this._skillList}}class lO{constructor(t){this._userId=t.readInt(),this._userName=t.readString()}get userId(){return this._userId}get userName(){return this._userName}}class cO{flush(){return this._roomId=0,this._bannedUsers=[],!0}parse(t){if(!t)return!1;this._roomId=t.readInt();let e=t.readInt();for(;e>0;)this._bannedUsers.push(new lO(t)),e--;return!0}get roomId(){return this._roomId}get bannedUsers(){return this._bannedUsers}}class uO{constructor(t){this._userId=t.readInt(),this._userName=t.readString()}get userId(){return this._userId}get userName(){return this._userName}get selected(){return this._selected}set selected(t){this._selected=t}}class dO{flush(){return this._roomId=0,this._data=null,!0}parse(t){return t?(this._roomId=t.readInt(),this._data=new uO(t),!0):!1}get roomId(){return this._roomId}get data(){return this._data}}class EO{flush(){return this._roomId=0,this._userId=0,!0}parse(t){return t?(this._roomId=t.readInt(),this._userId=t.readInt(),!0):!1}get roomId(){return this._roomId}get userId(){return this._userId}}class gO{flush(){return this._roomId=0,this._users=new Map,!0}parse(t){if(!t)return!1;this._roomId=t.readInt();let e=t.readInt();for(;e>0;){const s=t.readInt(),i=t.readString();this._users.set(s,i),e--}return!0}get roomId(){return this._roomId}get users(){return this._users}}class fO{flush(){return!0}parse(t){return t?(this._isMuted=t.readBoolean(),!0):!1}get isMuted(){return this._isMuted}}class IO{flush(){return this._roomId=0,!0}parse(t){return t?(this._roomId=t.readInt(),!0):!1}get roomId(){return this._roomId}}const He=class He{constructor(t){if(!t)throw new Error("invalid_wrapper");this._mode=t.readInt(),this._weight=t.readInt(),this._speed=t.readInt(),this._distance=t.readInt(),this._protection=t.readInt()}get mode(){return this._mode}get weight(){return this._weight}get speed(){return this._speed}get distance(){return this._distance}get protection(){return this._protection}};He.CHAT_MODE_FREE_FLOW=0,He.CHAT_MODE_LINE_BY_LINE=1,He.CHAT_BUBBLE_WIDTH_WIDE=0,He.CHAT_BUBBLE_WIDTH_NORMAL=1,He.CHAT_BUBBLE_WIDTH_THIN=2,He.CHAT_SCROLL_SPEED_FAST=0,He.CHAT_SCROLL_SPEED_NORMAL=1,He.CHAT_SCROLL_SPEED_SLOW=2,He.FLOOD_FILTER_STRICT=0,He.FLOOD_FILTER_NORMAL=1,He.FLOOD_FILTER_LOOSE=2;let qa=He;const Aa=class Aa{constructor(t){this._allowMute=t.readInt(),this._allowKick=t.readInt(),this._allowBan=t.readInt()}get allowMute(){return this._allowMute}get allowKick(){return this._allowKick}get allowBan(){return this._allowBan}};Aa.MODERATION_LEVEL_NONE=0,Aa.MODERATION_LEVEL_USER_WITH_RIGHTS=1,Aa.MODERATION_LEVEL_ALL=2;let Bo=Aa;const se=class se{constructor(){this._roomId=-1,this._name=null,this._description=null,this._doorMode=se.DOORMODE_OPEN,this._categoryId=-1,this._maximumVisitors=0,this._maximumVisitorsLimit=0,this._tags=[],this._tradeMode=se.TRADEMODE_NOT_ALLOWED,this._allowPets=!1,this._allowFoodConsume=!1,this._allowWalkThrough=!1,this._hideWalls=!1,this._wallThickness=0,this._floorThickness=0,this._controllersById=new Map,this._controllerList=null,this._highlightedUserId=-1,this._bannedUsersById=new Map,this._bannedUsersList=null,this._roomModerationSettings=null,this._chatSettings=null,this._allowNavigatorDynamicCats=!1}static from(t){const e=new se;return e._roomId=t._roomId,e._name=t._name,e._description=t._description,e._doorMode=t._doorMode,e._categoryId=t._categoryId,e._maximumVisitors=t._maximumVisitors,e._maximumVisitorsLimit=t._maximumVisitorsLimit,e._tags=t._tags,e._tradeMode=t._tradeMode,e._allowPets=t._allowPets,e._allowFoodConsume=t._allowFoodConsume,e._allowWalkThrough=t._allowWalkThrough,e._hideWalls=t._hideWalls,e._wallThickness=t._wallThickness,e._floorThickness=t._floorThickness,e._controllersById=t._controllersById,e._controllerList=t._controllerList,e._highlightedUserId=t._highlightedUserId,e._bannedUsersById=t._bannedUsersById,e._bannedUsersList=t._bannedUsersList,e._roomModerationSettings=t._roomModerationSettings,e._chatSettings=t._chatSettings,e._allowNavigatorDynamicCats=t._allowNavigatorDynamicCats,e}static getDoorModeLocalizationKey(t){switch(t){case se.DOORMODE_OPEN:return"${navigator.door.mode.open}";case se.DOORMODE_CLOSED:return"${navigator.door.mode.closed}";case se.DOORMODE_PASSWORD:return"${navigator.door.mode.password}";case se.DOORMODE_INVISIBLE:return"${navigator.door.mode.invisible}";case se.DOORMODE_NOOBS_ONLY:return"${navigator.door.mode.noobs_only}"}return""}get tradeMode(){return this._tradeMode}set tradeMode(t){this._tradeMode=t}get allowPets(){return this._allowPets}set allowPets(t){this._allowPets=t}get allowFoodConsume(){return this._allowFoodConsume}set allowFoodConsume(t){this._allowFoodConsume=t}get allowWalkThrough(){return this._allowWalkThrough}set allowWalkThrough(t){this._allowWalkThrough=t}get hideWalls(){return this._hideWalls}set hideWalls(t){this._hideWalls=t}get wallThickness(){return this._wallThickness}set wallThickness(t){this._wallThickness=t}get floorThickness(){return this._floorThickness}set floorThickness(t){this._floorThickness=t}get roomId(){return this._roomId}set roomId(t){this._roomId=t}get name(){return this._name}set name(t){this._name=t}get description(){return this._description}set description(t){this._description=t}get doorMode(){return this._doorMode}set doorMode(t){this._doorMode=t}get categoryId(){return this._categoryId}set categoryId(t){this._categoryId=t}get maximumVisitors(){return this._maximumVisitors}set maximumVisitors(t){this._maximumVisitors=t}get maximumVisitorsLimit(){return this._maximumVisitorsLimit}set maximumVisitorsLimit(t){this._maximumVisitorsLimit=t}get tags(){return this._tags}set tags(t){this._tags=t}setFlatController(t,e){this._controllersById.set(t,e),this._controllerList=null,this._highlightedUserId=t}get roomModerationSettings(){return this._roomModerationSettings}set roomModerationSettings(t){this._roomModerationSettings=t}get controllersById(){return this._controllersById}set controllersById(t){this._controllersById=t}get controllerList(){if(!this._controllerList){this._controllerList=[];for(const t of this._controllersById.values())this._controllerList.push(t);this._controllerList.sort((t,e)=>t.userName.localeCompare(e.userName))}return this._controllerList}get highlightedUserId(){return this._highlightedUserId}setBannedUser(t,e){this._bannedUsersById.set(t,e),this._bannedUsersList=null}get bannedUsersById(){return this._bannedUsersById}get bannedUsersList(){if(!this._bannedUsersList){this._bannedUsersList=[];for(const t of this._bannedUsersById.values())this._bannedUsersList.push(t);this._bannedUsersList.sort((t,e)=>t.userName.localeCompare(e.userName))}return this._bannedUsersList}get chatSettings(){return this._chatSettings}set chatSettings(t){this._chatSettings=t}get allowNavigatorDynamicCats(){return this._allowNavigatorDynamicCats}set allowNavigatorDynamicCats(t){this._allowNavigatorDynamicCats=t}};se.DOORMODE_OPEN=0,se.DOORMODE_CLOSED=1,se.DOORMODE_PASSWORD=2,se.DOORMODE_INVISIBLE=3,se.DOORMODE_NOOBS_ONLY=4,se.TRADEMODE_NOT_ALLOWED=0,se.TRADEMODE_WITH_CONTROLLER=1,se.TRADEMODE_ALLOWED=2;let fc=se;class TO{flush(){return this._roomSettingsData=null,!0}parse(t){if(!t)return!1;this._roomSettingsData=new fc,this._roomSettingsData.roomId=t.readInt(),this._roomSettingsData.name=t.readString(),this._roomSettingsData.description=t.readString(),this._roomSettingsData.doorMode=t.readInt(),this._roomSettingsData.categoryId=t.readInt(),this._roomSettingsData.maximumVisitors=t.readInt(),this._roomSettingsData.maximumVisitorsLimit=t.readInt(),this._roomSettingsData.tags=[];let e=t.readInt();for(;e>0;)this._roomSettingsData.tags.push(t.readString()),e--;return this._roomSettingsData.tradeMode=t.readInt(),this._roomSettingsData.allowPets=t.readInt()===1,this._roomSettingsData.allowFoodConsume=t.readInt()===1,this._roomSettingsData.allowWalkThrough=t.readInt()===1,this._roomSettingsData.hideWalls=t.readInt()===1,this._roomSettingsData.wallThickness=t.readInt(),this._roomSettingsData.floorThickness=t.readInt(),this._roomSettingsData.chatSettings=new qa(t),this._roomSettingsData.allowNavigatorDynamicCats=t.readBoolean(),this._roomSettingsData.roomModerationSettings=new Bo(t),!0}get data(){return this._roomSettingsData}}class mO{flush(){return this._roomId=0,this._code=0,!0}parse(t){return t?(this._roomId=t.readInt(),this._code=t.readInt(),!0):!1}get roomId(){return this._roomId}get code(){return this._code}}class pO{flush(){return this._roomId=0,!0}parse(t){return t?(this._roomId=t.readInt(),!0):!1}get roomId(){return this._roomId}}const me=class me{flush(){return this._roomId=0,this._code=0,this._message=null,!0}parse(t){return t?(this._roomId=t.readInt(),this._code=t.readInt(),this._message=t.readString(),!0):!1}get roomId(){return this._roomId}get code(){return this._code}get message(){return this._message}};me.ERROR_ROOM_NOT_FOUND=1,me.ERROR_NOT_OWNER=2,me.ERROR_INVALID_DOOR_MODE=3,me.ERROR_INVALID_USER_LIMIT=4,me.ERROR_INVALID_PASSWORD=5,me.ERROR_INVALID_CATEGORY=6,me.ERROR_INVALID_NAME=7,me.ERROR_UNACCEPTABLE_NAME=8,me.ERROR_INVALID_DESCRIPTION=9,me.ERROR_UNACCEPTABLE_DESCRIPTION=10,me.ERROR_INVALID_TAG=11,me.ERROR_NON_USER_CHOOSABLE_TAG=12,me.ERROR_TOO_MANY_CHARACTERS_IN_TAG=13;let Ic=me;class RO{flush(){return this._selectionType=0,!0}parse(t){return t?(this._selectionType=t.readInt(),!0):!1}get selectionType(){return this._selectionType}}class OO{flush(){return this._roomId=0,this._userId=0,!0}parse(t){return t?(this._roomId=t.readInt(),this._userId=t.readInt(),!0):!1}get roomId(){return this._roomId}get userId(){return this._userId}}class AO{flush(){return this._chat=null,!0}parse(t){return t?(this._chat=new qa(t),!0):!1}get chat(){return this._chat}}const $t=class $t{constructor(t){if(!t)throw new Error("invalid_wrapper");this.flush(),this.parse(t)}flush(){return this._roomId=0,this._roomName=null,this._ownerId=0,this._ownerName=null,this._doorMode=0,this._userCount=0,this._maxUserCount=0,this._description=null,this._tradeMode=2,this._score=0,this._ranking=0,this._categoryId=0,this._totalStars=0,this._groupId=0,this._groupName=null,this._groupBadge=null,this._tags=[],this._bitMask=0,this._thumbnail=null,this._allowPets=!1,this._showOwner=!0,this._displayAd=!1,this._adName=null,this._adDescription=null,this._adExpiresIn=0,this._allInRoomMuted=!1,this._canMute=!1,this._officialRoomPicRef=null,!0}parse(t){return t?(this._roomId=t.readInt(),this._roomName=t.readString(),this._ownerId=t.readInt(),this._ownerName=t.readString(),this._doorMode=t.readInt(),this._userCount=t.readInt(),this._maxUserCount=t.readInt(),this._description=t.readString(),this._tradeMode=t.readInt(),this._score=t.readInt(),this._ranking=t.readInt(),this._categoryId=t.readInt(),this.parseTags(t),this.parseBitMask(t),!0):!1}parseTags(t){if(!t)return!1;this._tags=[];let e=t.readInt();for(;e>0;)this._tags.push(t.readString()),e--;return!0}parseBitMask(t){return t?(this._bitMask=t.readInt(),this._bitMask&$t.THUMBNAIL_BITMASK&&(this._officialRoomPicRef=t.readString()),this._bitMask&$t.GROUPDATA_BITMASK&&(this._groupId=t.readInt(),this._groupName=t.readString(),this._groupBadge=t.readString()),this._bitMask&$t.ROOMAD_BITMASK&&(this._adName=t.readString(),this._adDescription=t.readString(),this._adExpiresIn=t.readInt()),this._showOwner=(this._bitMask&$t.SHOWOWNER_BITMASK)>0,this._allowPets=(this._bitMask&$t.ALLOW_PETS_BITMASK)>0,this._displayAd=(this._bitMask&$t.DISPLAY_ROOMAD_BITMASK)>0,this._thumbnail=null,!0):!1}get roomId(){return this._roomId}get roomName(){return this._roomName}set roomName(t){this._roomName=t}get ownerId(){return this._ownerId}get ownerName(){return this._ownerName}get doorMode(){return this._doorMode}get userCount(){return this._userCount}get maxUserCount(){return this._maxUserCount}get description(){return this._description}get tradeMode(){return this._tradeMode}get score(){return this._score}get ranking(){return this._ranking}get categoryId(){return this._categoryId}get tags(){return this._tags}get officialRoomPicRef(){return this._officialRoomPicRef}get habboGroupId(){return this._groupId}get groupName(){return this._groupName}get groupBadgeCode(){return this._groupBadge}get roomAdName(){return this._adName}get roomAdDescription(){return this._adDescription}get roomAdExpiresInMin(){return this._adExpiresIn}get showOwner(){return this._showOwner}get allowPets(){return this._allowPets}get displayRoomEntryAd(){return this._displayAd}get canMute(){return this._canMute}set canMute(t){this._canMute=t}get allInRoomMuted(){return this._allInRoomMuted}set allInRoomMuted(t){this._allInRoomMuted=t}};$t.THUMBNAIL_BITMASK=1,$t.GROUPDATA_BITMASK=2,$t.ROOMAD_BITMASK=4,$t.SHOWOWNER_BITMASK=8,$t.ALLOW_PETS_BITMASK=16,$t.DISPLAY_ROOMAD_BITMASK=32,$t.OPEN_STATE=0,$t.DOORBELL_STATE=1,$t.PASSWORD_STATE=2,$t.INVISIBLE_STATE=3,$t.NOOB_STATE=4;let Wn=$t;class SO{flush(){return this._roomId=0,this._isOwner=!1,!0}parse(t){return t?(this._roomId=t.readInt(),this._isOwner=t.readBoolean(),!0):!1}get roomId(){return this._roomId}get isOwner(){return this._isOwner}}class CO{flush(){return this._totalLikes=0,this._canLike=!1,!0}parse(t){return t?(this._totalLikes=t.readInt(),this._canLike=t.readBoolean(),!0):!1}get totalLikes(){return this._totalLikes}get canLike(){return this._canLike}}class MO{flush(){return this._roomIndex=-1,this._groupId=-1,this._status=0,this._groupName=null,!0}parse(t){return t?(this._roomIndex=t.readInt(),this._groupId=t.readInt(),this._status=t.readInt(),this._groupName=t.readString(),!0):!1}get roomIndex(){return this._roomIndex}get groupId(){return this._groupId}get status(){return this._status}get groupName(){return this._groupName}}class NO{constructor(t,e,s){this._id=0,this._state=0,this._id=t,this._state=e,this._data=s}get id(){return this._id}get state(){return this._state}get data(){return this._data}}class DO{flush(){return this._code=0,!0}parse(t){return t?(this._code=t.readInt(),!0):!1}get count(){return this._code}}class LO{flush(){return this._itemId=0,this._value=0,!0}parse(t){return t?(this._itemId=t.readInt(),this._value=t.readInt(),!0):!1}get itemId(){return this._itemId}get value(){return this._value}}class rr{flush(){return this._itemId=0,this._data=null,!0}parse(t){return t?(this._itemId=parseInt(t.readString()),this._data=rr.parseObjectData(t),!0):!1}static parseObjectData(t){if(!t)return null;const e=Xi.getData(t.readInt());return e?(e.parseWrapper(t),e):null}get furnitureId(){return this._itemId}get objectData(){return this._data}}class Bd{constructor(t){if(!t)throw new Error("invalid_wrapper");this.flush(),this.parse(t)}flush(){return this._itemId=0,this._spriteId=0,this._spriteName=null,this._x=0,this._y=0,this._direction=0,this._z=0,this._stackHeight=0,this._extra=0,this._data=null,this._state=0,this._expires=0,this._usagePolicy=0,this._userId=0,this._username=null,!0}parse(t){return t?(this._itemId=t.readInt(),this._spriteId=t.readInt(),this._x=t.readInt(),this._y=t.readInt(),this._direction=t.readInt()%8*45,this._z=parseFloat(t.readString()),this._stackHeight=parseFloat(t.readString()),this._extra=t.readInt(),this._data=rr.parseObjectData(t),this._state=parseFloat(this._data&&this._data.getLegacyString())||0,this._expires=t.readInt(),this._usagePolicy=t.readInt(),this._userId=t.readInt(),this._username=null,this._spriteId<0&&(this._spriteName=t.readString()),!0):!1}get itemId(){return this._itemId}get spriteId(){return this._spriteId}get x(){return this._x}get y(){return this._y}get direction(){return this._direction}get z(){return isNaN(this._z)?0:this._z}get stackHeight(){return isNaN(this._stackHeight)?0:this._stackHeight}get extra(){return this._extra}get data(){return this._data}get state(){return this._state}get expires(){return this._expires}get usagePolicy(){return this._usagePolicy}get userId(){return this._userId}get username(){return this._username}set username(t){this._username=t}get spriteName(){return this._spriteName}set spriteName(t){this._spriteName=t}}class PO{flush(){return this._item=null,!0}parse(t){return t?(this._item=new Bd(t),this._item.username=t.readString(),!0):!1}get item(){return this._item}}class UO{flush(){return this._owners=new Map,this._items=[],!0}parse(t){if(!t||!this.parseOwners(t))return!1;let e=t.readInt();for(;e>0;){const s=new Bd(t);if(!s)continue;const i=this._owners.get(s.userId);i&&(s.username=i),this._items.push(s),e--}return!0}parseOwners(t){if(!t)return!1;let e=t.readInt();for(;e>0;)this._owners.set(t.readInt(),t.readString()),e--;return!0}get owners(){return this._owners}get items(){return this._items}}class yO{flush(){return this._itemId=0,this._isExpired=!0,this._userId=0,this._delay=0,!0}parse(t){return t?(this._itemId=parseInt(t.readString()),this._isExpired=t.readBoolean(),this._userId=t.readInt(),this._delay=t.readInt(),!0):!1}get itemId(){return this._itemId}get isExpired(){return this._isExpired}get userId(){return this._userId}get delay(){return this._delay}}class vO{flush(){return this._item=null,!0}parse(t){return t?(this._item=new Bd(t),!0):!1}get item(){return this._item}}class bO{flush(){return this._isWallItem=!1,this._furniTypeName=null,this._buyout=!1,this._priceInCredits=-1,this._priceInActivityPoints=-1,this._activityPointType=-1,!0}parse(t){return t?(this._isWallItem=t.readBoolean(),this._furniTypeName=t.readString(),this._buyout=t.readBoolean(),this._priceInCredits=t.readInt(),this._priceInActivityPoints=t.readInt(),this._activityPointType=t.readInt(),!0):!1}get isWallItem(){return this._isWallItem}get furniTypeName(){return this._furniTypeName}get buyout(){return this._buyout}get priceInCredits(){return this._priceInCredits}get priceInActivityPoints(){return this._priceInActivityPoints}get activityPointType(){return this._activityPointType}}class FO{flush(){return this._aliases=new Map,!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;)this._aliases.set(t.readString(),t.readString()),e--;return!0}get aliases(){return this._aliases}}class xO{flush(){return this._furniId=-1,this._height=0,!0}parse(t){return t?(this._furniId=t.readInt(),this._height=t.readInt()/100,!0):!1}get furniId(){return this._furniId}get height(){return this._height}}class GO{flush(){return this._objectId=0,this._guildId=0,this._guildName=null,this._guildHomeRoomId=0,this._userIsMember=!1,this._guildHasReadableForum=!1,!0}parse(t){return t?(this._objectId=t.readInt(),this._guildId=t.readInt(),this._guildName=t.readString(),this._guildHomeRoomId=t.readInt(),this._userIsMember=t.readBoolean(),this._guildHasReadableForum=t.readBoolean(),!0):!1}get objectId(){return this._objectId}get guildId(){return this._guildId}get guildName(){return this._guildName}get guildHomeRoomId(){return this._guildHomeRoomId}get userIsMember(){return this._userIsMember}get guildHasReadableForum(){return this._guildHasReadableForum}}class BO{flush(){return this._itemId=0,this._data="",!0}parse(t){return t?(this._itemId=parseInt(t.readString()),this._data=t.readString(),!0):!1}get furnitureId(){return this._itemId}get data(){return this._data}}class wO{get furniId(){return this._furniId}flush(){return this._furniId=-1,!0}parse(t){return this._furniId=t.readInt(),!0}}class VO{get furniId(){return this._furniId}flush(){return this._furniId=-1,!0}parse(t){return this._furniId=t.readInt(),!0}}class YO{get furniId(){return this._furniId}get start(){return this._start}flush(){return this._furniId=-1,this._start=!1,!0}parse(t){return this._furniId=t.readInt(),this._start=t.readBoolean(),!0}}class HO{flush(){return this._itemId=0,this._state=0,!0}parse(t){return t?(this._itemId=t.readInt(),this._state=t.readInt(),!0):!1}get itemId(){return this._itemId}get state(){return this._state}}class jO{flush(){return!0}parse(t){return t?(this._reason=t.readInt(),!0):!1}get reason(){return this._reason}}class zO{flush(){return!0}parse(t){return t?(this._expiryTime=t.readInt(),!0):!1}get expiryTime(){return this._expiryTime}}const ss=class ss{flush(){return this._rented=!1,this._renterId=-1,this._renterName=null,this._canRent=!1,this._canRentErrorCode=-1,this._timeRemaining=-1,this._price=-1,!0}parse(t){return t?(this._rented=t.readBoolean(),this._canRentErrorCode=t.readInt(),this._canRent=this._canRentErrorCode===0,this._renterId=t.readInt(),this._renterName=t.readString(),this._timeRemaining=t.readInt(),this._price=t.readInt(),this._rented||(this._renterId=-1,this._renterName=""),!0):!1}get rented(){return this._rented}get renterId(){return this._renterId}get renterName(){return this._renterName}get canRent(){return this._canRent}get price(){return this._price}get timeRemaining(){return this._timeRemaining}get canRentErrorCode(){return this._canRentErrorCode}};ss.SPACE_ALREADY_RENTED=100,ss.SPACE_EXTEND_NOT_RENTED=101,ss.SPACE_EXTEND_NOT_RENTED_BY_YOU=102,ss.CAN_RENT_ONLY_ONE_SPACE=103,ss.NOT_ENOUGH_CREDITS=200,ss.NOT_ENOUGH_PIXELS=201,ss.CANT_RENT_NO_PERMISSION=202,ss.CANT_RENT_NO_HABBO_CLUB=203,ss.CANT_RENT=300,ss.CANT_RENT_GENERIC=400;let Tc=ss;class WO{flush(){return this._itemId=-1,this._location="",!0}parse(t){return t?(this._itemId=t.readInt(),this._location=t.readString(),!0):!1}get itemId(){return this._itemId}get location(){return this._location}}class kO{constructor(t,e,s,i){this.id=t,this.type=e,this.color=s,this.brightness=i}}class KO{constructor(){this._selectedPresetId=0,this._presets=[]}flush(){return this._presets=[],!0}parse(t){const e=t.readInt();this._selectedPresetId=t.readInt();for(let s=0;s<e;s++){const i=t.readInt(),r=t.readInt(),a=parseInt(t.readString().substr(1),16),o=t.readInt();this._presets.push(new kO(i,r,a,o))}return!0}getPreset(t){return t<0||t>=this.presetCount?null:this._presets[t]}get presetCount(){return this._presets.length}get selectedPresetId(){return this._selectedPresetId}}class XO{flush(){return this._roomId=-1,this._roomName=null,this._messageCount=-1,!0}parse(t){return t?(this._roomId=t.readInt(),this._roomName=t.readString(),this._messageCount=t.readInt(),!0):!1}get roomId(){return this._roomId}get roomName(){return this._roomName}get messageCount(){return this._messageCount}}class wd{constructor(t){if(!t)throw new Error("invalid_wrapper");this.flush(),this.parse(t)}flush(){return this._itemId=0,this._spriteId=0,this._location=null,this._stuffData=null,this._state=0,this._secondsToExpiration=0,this._usagePolicy=-1,this._userId=0,this._username=null,this._width=0,this._height=0,this._localX=0,this._localY=0,this._y=0,this._z=0,this._direction=null,this._isOldFormat=!1,!0}parse(t){if(!t)return!1;this._itemId=parseInt(t.readString()),this._spriteId=t.readInt(),this._location=t.readString(),this._stuffData=t.readString(),this._secondsToExpiration=t.readInt(),this._usagePolicy=t.readInt(),this._userId=t.readInt(),this._username=null;const e=parseFloat(this._stuffData);if(isNaN(e)||(this._state=Math.trunc(e)),this._location.indexOf(":")===0){this._isOldFormat=!1;let s=this._location.split(" ");if(s.length>=3){let i=s[0],r=s[1];const a=s[2];if(i.length>3&&r.length>2&&(i=i.substr(3),r=r.substr(2),s=i.split(","),s.length>=2)){const o=parseInt(s[0]),h=parseInt(s[1]);if(s=r.split(","),s.length>=2){const _=parseInt(s[0]),l=parseInt(s[1]);this._width=o,this._height=h,this._localX=_,this._localY=l,this._direction=a}}}}else this._isOldFormat=!0;return!0}get itemId(){return this._itemId}get spriteId(){return this._spriteId}get wallPosition(){return this._location}get stuffData(){return this._stuffData}get state(){return this._state}get secondsToExpiration(){return this._secondsToExpiration}get usagePolicy(){return this._usagePolicy}get userId(){return this._userId}get username(){return this._username}set username(t){this._username=t}get width(){return this._width}get height(){return this._height}get localX(){return this._localX}get localY(){return this._localY}get direction(){return this._direction}get isOldFormat(){return this._isOldFormat}}class qO{flush(){return this._item=null,!0}parse(t){return t?(this._item=new wd(t),this._item.username=t.readString(),!0):!1}get item(){return this._item}}class QO{flush(){return this._owners=new Map,this._items=[],!0}parse(t){if(!t||!this.parseOwners(t))return!1;let e=t.readInt();for(;e>0;){const s=new wd(t);if(!s)continue;const i=this._owners.get(s.userId);i&&(s.username=i),this._items.push(s),e--}return!0}parseOwners(t){if(!t)return!1;let e=t.readInt();for(;e>0;)this._owners.set(t.readInt(),t.readString()),e--;return!0}get owners(){return this._owners}get items(){return this._items}}class JO{flush(){return this._itemId=0,this._userId=0,!0}parse(t){return t?(this._itemId=parseInt(t.readString()),this._userId=t.readInt(),!0):!1}get itemId(){return this._itemId}get userId(){return this._userId}}class ZO{flush(){return this._item=null,!0}parse(t){return t?(this._item=new wd(t),!0):!1}get item(){return this._item}}class $O{flush(){return this._email=null,this._isVerified=!1,this._allowChange=!1,this._furniId=-1,this._requestedByUser=!1,!0}parse(t){return t?(this._email=t.readString(),this._isVerified=t.readBoolean(),this._allowChange=t.readBoolean(),this._furniId=t.readInt(),this._requestedByUser=t.readBoolean(),!0):!1}get email(){return this._email}get isVerified(){return this._isVerified}get allowChange(){return this._allowChange}get furniId(){return this._furniId}get requestedByUser(){return this._requestedByUser}}class tA{parse(t){return this._furniId=t.readInt(),this._commandId=t.readInt(),!0}flush(){return this._furniId=-1,this._commandId=-1,!0}get furniId(){return this._furniId}get commandId(){return this._commandId}}class eA{constructor(t,e,s){this._video=t,this._title=e,this._description=s}get video(){return this._video}get title(){return this._title}get description(){return this._description}}class sA{flush(){return this._furniId=-1,this._playlists=null,this._selectedPlaylistId=null,!0}parse(t){this._furniId=t.readInt();const e=t.readInt();this._playlists=[];for(let s=0;s<e;s++)this._playlists.push(new eA(t.readString(),t.readString(),t.readString()));return this._selectedPlaylistId=t.readString(),!0}get furniId(){return this._furniId}get playlists(){return this._playlists}get selectedPlaylistId(){return this._selectedPlaylistId}}class iA{flush(){return!0}parse(t){return this._furniId=t.readInt(),this._videoId=t.readString(),this._startAtSeconds=t.readInt(),this._endAtSeconds=t.readInt(),this._state=t.readInt(),!0}get furniId(){return this._furniId}get videoId(){return this._videoId}get state(){return this._state}get startAtSeconds(){return this._startAtSeconds}get endAtSeconds(){return this._endAtSeconds}}class rA{flush(){return this._objects=[],!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;){const s=t.readInt(),i=rr.parseObjectData(t),r=parseFloat(i.getLegacyString());this._objects.push(new NO(s,r,i)),e--}return!0}get objects(){return this._objects}}class nA{flush(){return this._rollerId=0,this._itemsRolling=[],this._unitRolling=null,!0}parse(t){if(!t)return!1;const e=t.readInt(),s=t.readInt(),i=t.readInt(),r=t.readInt();let a=t.readInt();for(;a>0;){const c=t.readInt(),f=parseFloat(t.readString()),p=parseFloat(t.readString()),m=new di(c,new R(e,s,f),new R(i,r,p));this._itemsRolling.push(m),a--}if(this._rollerId=t.readInt(),!t.bytesAvailable)return!0;const o=t.readInt(),h=t.readInt(),_=parseFloat(t.readString()),l=parseFloat(t.readString());switch(o){case 0:break;case 1:this._unitRolling=new di(h,new R(e,s,_),new R(i,r,l),di.MOVE);break;case 2:this._unitRolling=new di(h,new R(e,s,_),new R(i,r,l),di.SLIDE);break}return!0}get rollerId(){return this._rollerId}get itemsRolling(){return this._itemsRolling}get unitRolling(){return this._unitRolling}}const Sa=class Sa{flush(){return this._model=null,this._width=0,this._height=0,this._wallHeight=-1,this._heightMap=[],this._scale=64,this._model=null,!0}parse(t){if(!t)return!1;const e=t.readBoolean(),s=t.readInt(),i=t.readString();return this.parseExplicitly(i,s,e)}parseModel(t,e,s=!0){return this.parseExplicitly(t,e,s)}parseExplicitly(t,e,s=!0){this._scale=s?32:64,this._wallHeight=e,this._model=t;const i=this._model.split("\r"),r=i.length;let a=0,o=0;for(;o<r;){const h=i[o];h.length>a&&(a=h.length),o++}for(this._heightMap=[],o=0;o<r;){const h=[];let _=0;for(;_<a;)h.push(Sa.TILE_BLOCKED),_++;this._heightMap.push(h),o++}for(this._width=a,this._height=r,o=0;o<r;){const h=this._heightMap[o],_=i[o];if(_.length>0){let l=0;for(;l<_.length;){const c=_.charAt(l);let f=Sa.TILE_BLOCKED;c!=="x"&&c!=="X"&&(f=parseInt(c,36)),h[l]=f,l++}}o++}return!0}getHeight(t,e){if(t<0||t>=this._width||e<0||e>=this._height)return-110;const s=this._heightMap[e];if(s===void 0)return-110;const i=s[t];return i===void 0?-110:i}get model(){return this._model}get width(){return this._width}get height(){return this._height}get heightMap(){return this._heightMap}get wallHeight(){return this._wallHeight}get scale(){return this._scale}};Sa.TILE_BLOCKED=-110;let wo=Sa;class aA{flush(){return this._x=0,this._y=0,this._direction=0,!0}parse(t){return t?(this._x=t.readInt(),this._y=t.readInt(),this._direction=t.readInt(),!0):!1}get x(){return this._x}get y(){return this._y}get direction(){return this._direction}}class Zi{static decodeTileHeight(t){return t<0?-1:(t&16383)/256}static decodeIsStackingBlocked(t){return!!(t&16384)}static decodeIsRoomTile(t){return t>=0}getTileHeight(t,e){return t<0||t>=this._width||e<0||e>=this._height?-1:Zi.decodeTileHeight(this._heights[e*this._width+t])}getStackingBlocked(t,e){return t<0||t>=this._width||e<0||e>=this._height?!0:Zi.decodeIsStackingBlocked(this._heights[e*this._width+t])}isRoomTile(t,e){return t<0||t>=this._width||e<0||e>=this._height?!1:Zi.decodeIsRoomTile(this._heights[e*this._width+t])}flush(){return this._width=0,this._height=0,this._heights=[],!0}parse(t){if(!t)return!1;this._width=t.readInt();const e=t.readInt();this._height=e/this._width;let s=0;for(;s<e;)this._heights[s]=t.readShort(),s++;return!0}get width(){return this._width}get height(){return this._height}get heights(){return this._heights}}class oA{flush(){return this._wrapper=null,this._count=0,this._x=0,this._y=0,this._value=0,!0}tileHeight(){return Zi.decodeTileHeight(this._value)}isStackingBlocked(){return Zi.decodeIsStackingBlocked(this._value)}isRoomTile(){return Zi.decodeIsRoomTile(this._value)}next(){return this._count?(this._count--,this._x=this._wrapper.readByte(),this._y=this._wrapper.readByte(),this._value=this._wrapper.readShort(),!0):!1}parse(t){return t?(this._wrapper=t,this._count=t.readByte(),!0):!1}get x(){return this._x}get y(){return this._y}get height(){return this._value}}class hA{flush(){return this._blockedTilesMap=[],!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;){const s=t.readInt(),i=t.readInt();this._blockedTilesMap[i]||(this._blockedTilesMap[i]=[]),this._blockedTilesMap[i][s]=!0,e--}return!0}get blockedTilesMap(){return this._blockedTilesMap}}class _A{flush(){return this._floorType=null,this._wallType=null,this._landscapeType=null,this._landscapeAnimation=null,!0}parse(t){if(!t)return!1;const e=t.readString(),s=t.readString();switch(e){case"floor":this._floorType=s;break;case"wallpaper":this._wallType=s;break;case"landscape":this._landscapeType=s;break;case"landscapeanim":this._landscapeAnimation=s;break}return!0}get floorType(){return this._floorType}get wallType(){return this._wallType}get landscapeType(){return this._landscapeType}get landscapeAnimation(){return this._landscapeAnimation}}class lA{flush(){return this._name=null,this._roomId=0,!0}parse(t){return t?(this._name=t.readString(),this._roomId=t.readInt(),!0):!1}get name(){return this._name}get roomId(){return this._roomId}}class cA{flush(){return this._hideWalls=!1,this._thicknessWall=0,this._thicknessFloor=0,!0}parse(t){if(!t)return!1;this._hideWalls=t.readBoolean();let e=t.readInt(),s=t.readInt();return e=e<-2?-2:e>1?1:e,s=s<-2?-2:s>1?1:s,this._thicknessWall=Math.pow(2,e),this._thicknessFloor=Math.pow(2,s),!0}get hideWalls(){return this._hideWalls}get thicknessWall(){return this._thicknessWall}get thicknessFloor(){return this._thicknessFloor}}class ZE{constructor(t){if(!t)throw new Error("invalid_wrapper");this._webId=t.readInt(),this._name=t.readString(),this._level=t.readInt(),this._figure=t.readString(),this._owner=t.readString()}dispose(){this._webId=0,this._name="",this._level=0,this._figure="",this._owner=""}get webId(){return this._webId}get name(){return this._name}get level(){return this._level}get figure(){return this._figure}get owner(){return this._owner}}class $E{constructor(t){this._stuffId=t.readInt(),this._classId=t.readInt(),this._productCode=t.readString(),this._userId=t.readInt(),this._userName=t.readString(),this._rarityLevel=t.readInt(),this._hasMutation=t.readBoolean()}get stuffId(){return this._stuffId}get classId(){return this._classId}get productCode(){return this._productCode}get userId(){return this._userId}get userName(){return this._userName}get rarityLevel(){return this._rarityLevel}get hasMutation(){return this._hasMutation}}class uA{flush(){return this._resultData=null,this._otherResultData=null,!0}parse(t){return t?(this._resultData=new $E(t),this._otherResultData=new $E(t),!0):!1}get resultData(){return this._resultData}get otherResultData(){return this._otherResultData}}class dA{flush(){return this._petId=-1,this._roomIndex=-1,this._gainedExperience=0,!0}parse(t){return t?(this._petId=t.readInt(),this._roomIndex=t.readInt(),this._gainedExperience=t.readInt(),!0):!1}get petId(){return this._petId}get roomIndex(){return this._roomIndex}get gainedExperience(){return this._gainedExperience}}class EA{flush(){return!0}parse(t){return t?(this._roomIndex=t.readInt(),this._petId=t.readInt(),this._figureData=new Yd(t),this._hasSaddle=t.readBoolean(),this._isRiding=t.readBoolean(),!0):!1}get roomIndex(){return this._roomIndex}get petId(){return this._petId}get figureData(){return this._figureData}get hasSaddle(){return this._hasSaddle}get isRiding(){return this._isRiding}}class gA{flush(){return this._id=-1,this._skillThresholds=[],!0}parse(t){if(!t)return!1;this._id=t.readInt(),this._name=t.readString(),this._level=t.readInt(),this._maximumLevel=t.readInt(),this._experience=t.readInt(),this._levelExperienceGoal=t.readInt(),this._energy=t.readInt(),this._maximumEnergy=t.readInt(),this._happyness=t.readInt(),this._maximumHappyness=t.readInt(),this._respect=t.readInt(),this._ownerId=t.readInt(),this._age=t.readInt(),this._ownerName=t.readString(),this._rarityLevel=t.readInt(),this._saddle=t.readBoolean(),this._rider=t.readBoolean();let e=t.readInt();for(;e>0;)this._skillThresholds.push(t.readInt()),e--;return this._skillThresholds.sort(),this._publiclyRideable=t.readInt(),this._breedable=t.readBoolean(),this._fullyGrown=t.readBoolean(),this._dead=t.readBoolean(),this._unknownRarity=t.readInt(),this._maximumTimeToLive=t.readInt(),this._remainingTimeToLive=t.readInt(),this._remainingGrowTime=t.readInt(),this._publiclyBreedable=t.readBoolean(),!0}get id(){return this._id}get name(){return this._name}get level(){return this._level}get maximumLevel(){return this._maximumLevel}get experience(){return this._experience}get energy(){return this._energy}get happyness(){return this._happyness}get levelExperienceGoal(){return this._levelExperienceGoal}get maximumEnergy(){return this._maximumEnergy}get maximumHappyness(){return this._maximumHappyness}get respect(){return this._respect}get ownerId(){return this._ownerId}get ownerName(){return this._ownerName}get age(){return this._age}get rarityLevel(){return this._rarityLevel}get saddle(){return this._saddle}get rider(){return this._rider}get breedable(){return this._breedable}get fullyGrown(){return this._fullyGrown}get dead(){return this._dead}get maximumTimeToLive(){return this._maximumTimeToLive}get remainingTimeToLive(){return this._remainingTimeToLive}get remainingGrowTime(){return this._remainingGrowTime}get skillTresholds(){return this._skillThresholds}get publiclyRideable(){return this._publiclyRideable}get unknownRarity(){return this._unknownRarity}get publiclyBreedable(){return this._publiclyBreedable}}class fA{flush(){return this._roomIndex=-1,this._petId=-1,this._canBreed=!1,this._canHarvest=!1,this._canRevive=!1,this._hasBreedingPermission=!1,!0}parse(t){return t?(this._roomIndex=t.readInt(),this._petId=t.readInt(),this._canBreed=t.readBoolean(),this._canHarvest=t.readBoolean(),this._canRevive=t.readBoolean(),this._hasBreedingPermission=t.readBoolean(),!0):!1}get roomIndex(){return this._roomIndex}get petId(){return this._petId}get canBreed(){return this._canBreed}get canHarvest(){return this._canHarvest}get canRevive(){return this._canRevive}get hasBreedingPermission(){return this._hasBreedingPermission}}class IA{constructor(t){if(!t)throw new Error("invalid_wrapper");this._chance=t.readInt(),this._breeds=[];let e=t.readInt();for(;e>0;)this._breeds.push(t.readInt()),e--}dispose(){this._chance=-1,this._breeds=[]}get chance(){return this._chance}get breeds(){return this._breeds}}class TA{flush(){return this._isPlaying=!1,!0}parse(t){return t?(this._isPlaying=t.readBoolean(),!0):!1}get isPlaying(){return this._isPlaying}}class mA{flush(){return!0}parse(t){return!0}}class pA{flush(){return this._seconds=0,!0}parse(t){return t?(this._seconds=t.readInt(),!0):!1}get seconds(){return this._seconds}}class RA{flush(){return this._seconds=0,!0}parse(t){return t?(this._seconds=t.readInt(),!0):!1}get seconds(){return this._seconds}}class Vd{flush(){return this._roomIndex=null,this._message=null,this._gesture=0,this._bubble=0,this._urls=[],this._chatColours=null,this._messageLength=0,!0}parse(t){return t?(this._roomIndex=t.readInt(),this._message=t.readString(),this._gesture=t.readInt(),this._bubble=t.readInt(),this.parseUrls(t),this._chatColours=t.readString(),this._messageLength=t.readInt(),!0):!1}parseUrls(t){if(!t)return!1;this._urls=[];let e=t.readInt();for(;e>0;)this._urls.push(t.readString()),e--;return!0}get roomIndex(){return this._roomIndex}get message(){return this._message}get gesture(){return this._gesture}get bubble(){return this._bubble}get urls(){return this._urls}get chatColours(){return this._chatColours}get messageLength(){return this._messageLength}}class OA{flush(){return this._unitId=null,this._isTyping=!1,!0}parse(t){return t?(this._unitId=t.readInt(),this._isTyping=t.readInt()===1,!0):!1}get unitId(){return this._unitId}get isTyping(){return this._isTyping}}class AA{flush(){return this._unitId=null,this._danceId=0,!0}parse(t){return t?(this._unitId=t.readInt(),this._danceId=t.readInt(),!0):!1}get unitId(){return this._unitId}get danceId(){return this._danceId}}class SA{flush(){return this._unitId=null,this._effectId=0,this._delay=0,!0}parse(t){return t?(this._unitId=t.readInt(),this._effectId=t.readInt(),this._delay=t.readInt(),!0):!1}get unitId(){return this._unitId}get effectId(){return this._effectId}get delay(){return this._delay}}class CA{flush(){return this._unitId=null,this._expression=0,!0}parse(t){return t?(this._unitId=t.readInt(),this._expression=t.readInt(),!0):!1}get unitId(){return this._unitId}get expression(){return this._expression}}class MA{flush(){return this._unitId=null,this._handId=0,!0}parse(t){return t?(this._unitId=t.readInt(),this._handId=t.readInt(),!0):!1}get unitId(){return this._unitId}get handId(){return this._handId}}class NA{flush(){return this._giverUserId=-1,this._handItemType=-1,!0}parse(t){return t?(this._giverUserId=t.readInt(),this._handItemType=t.readInt(),!0):!1}get giverUserId(){return this._giverUserId}get handItemType(){return this._handItemType}}class DA{flush(){return this._unitId=null,this._isIdle=!1,!0}parse(t){return t?(this._unitId=t.readInt(),this._isIdle=t.readBoolean(),!0):!1}get unitId(){return this._unitId}get isIdle(){return this._isIdle}}class LA{flush(){return this._unitId=null,this._figure=null,this._gender="M",this._motto=null,this._achievementScore=0,!0}parse(t){return t?(this._unitId=t.readInt(),this._figure=t.readString(),this._gender=t.readString().toLocaleUpperCase(),this._motto=t.readString(),this._achievementScore=t.readInt(),!0):!1}get unitId(){return this._unitId}get figure(){return this._figure}get gender(){return this._gender}get motto(){return this._motto}get achievementScore(){return this._achievementScore}}class PA{flush(){return this._unitId=null,this._value=0,!0}parse(t){return t?(this._unitId=t.readInt(),this._value=t.readInt(),!0):!1}get unitId(){return this._unitId}get value(){return this._value}}const p_=class p_{constructor(t){this._roomIndex=0,this._x=0,this._y=0,this._z=0,this._dir=0,this._name="",this._userType=0,this._sex="",this._figure="",this._custom="",this._activityPoints=0,this._webID=0,this._groupID=0,this._groupStatus=0,this._groupName="",this._subType="",this._ownerId=0,this._ownerName="",this._rarityLevel=0,this._hasSaddle=!1,this._isRiding=!1,this._canBreed=!1,this._canHarvest=!1,this._canRevive=!1,this._hasBreedingPermission=!1,this._petLevel=0,this._petPosture="",this._botSkills=[],this._isModerator=!1,this._isReadOnly=!1,this._roomIndex=t}setReadOnly(){this._isReadOnly=!0}get roomIndex(){return this._roomIndex}get x(){return this._x}set x(t){this._isReadOnly||(this._x=t)}get y(){return this._y}set y(t){this._isReadOnly||(this._y=t)}get z(){return this._z}set z(t){this._isReadOnly||(this._z=t)}get dir(){return this._dir}set dir(t){this._isReadOnly||(this._dir=t)}get name(){return this._name}set name(t){this._isReadOnly||(this._name=t)}get userType(){return this._userType}set userType(t){this._isReadOnly||(this._userType=t)}get sex(){return this._sex}set sex(t){this._isReadOnly||(this._sex=t)}get figure(){return this._figure}set figure(t){this._isReadOnly||(this._figure=t)}get custom(){return this._custom}set custom(t){this._isReadOnly||(this._custom=t)}get activityPoints(){return this._activityPoints}set activityPoints(t){this._isReadOnly||(this._activityPoints=t)}get webID(){return this._webID}set webID(t){this._isReadOnly||(this._webID=t)}get groupID(){return this._groupID}set groupID(t){this._isReadOnly||(this._groupID=t)}get groupName(){return this._groupName}set groupName(t){this._isReadOnly||(this._groupName=t)}get groupStatus(){return this._groupStatus}set groupStatus(t){this._isReadOnly||(this._groupStatus=t)}get subType(){return this._subType}set subType(t){this._isReadOnly||(this._subType=t)}get ownerId(){return this._ownerId}set ownerId(t){this._isReadOnly||(this._ownerId=t)}get ownerName(){return this._ownerName}set ownerName(t){this._isReadOnly||(this._ownerName=t)}get rarityLevel(){return this._rarityLevel}set rarityLevel(t){this._isReadOnly||(this._rarityLevel=t)}get hasSaddle(){return this._hasSaddle}set hasSaddle(t){this._isReadOnly||(this._hasSaddle=t)}get isRiding(){return this._isRiding}set isRiding(t){this._isReadOnly||(this._isRiding=t)}get canBreed(){return this._canBreed}set canBreed(t){this._isReadOnly||(this._canBreed=t)}get canHarvest(){return this._canHarvest}set canHarvest(t){this._isReadOnly||(this._canHarvest=t)}get canRevive(){return this._canRevive}set canRevive(t){this._isReadOnly||(this._canRevive=t)}get hasBreedingPermission(){return this._hasBreedingPermission}set hasBreedingPermission(t){this._isReadOnly||(this._hasBreedingPermission=t)}get petLevel(){return this._petLevel}set petLevel(t){this._isReadOnly||(this._petLevel=t)}get petPosture(){return this._petPosture}set petPosture(t){this._isReadOnly||(this._petPosture=t)}get botSkills(){return this._botSkills}set botSkills(t){this._botSkills=t}get isModerator(){return this._isModerator}set isModerator(t){this._isReadOnly||(this._isModerator=t)}};p_.M="M",p_.F="F";let en=p_;class UA{flush(){return this._users=[],!0}parse(t){if(!t)return!1;this._users=[];const e=t.readInt();let s=0;for(;s<e;){const i=t.readInt(),r=t.readString(),a=t.readString();let o=t.readString();const h=t.readInt(),_=t.readInt(),l=t.readInt(),c=parseFloat(t.readString()),f=t.readInt(),p=t.readInt(),m=new en(h);if(m.dir=f,m.name=r,m.custom=a,m.x=_,m.y=l,m.z=c,this._users.push(m),p===1){m.webID=i,m.userType=fi.USER,m.sex=this.resolveSex(t.readString()),m.groupID=t.readInt(),m.groupStatus=t.readInt(),m.groupName=t.readString();const O=t.readString();O!==""&&(o=this.convertSwimFigure(O,o,m.sex)),m.figure=o,m.activityPoints=t.readInt(),m.isModerator=t.readBoolean()}else if(p===2)m.userType=fi.PET,m.figure=o,m.webID=i,m.subType=t.readInt().toString(),m.ownerId=t.readInt(),m.ownerName=t.readString(),m.rarityLevel=t.readInt(),m.hasSaddle=t.readBoolean(),m.isRiding=t.readBoolean(),m.canBreed=t.readBoolean(),m.canHarvest=t.readBoolean(),m.canRevive=t.readBoolean(),m.hasBreedingPermission=t.readBoolean(),m.petLevel=t.readInt(),m.petPosture=t.readString();else if(p===3)m.userType=fi.BOT,m.webID=h*-1,o.indexOf("/")===-1?m.figure=o:m.figure="hr-100-.hd-180-1.ch-876-66.lg-270-94.sh-300-64",m.sex=en.M;else if(p===4){m.userType=fi.RENTABLE_BOT,m.webID=i,m.sex=this.resolveSex(t.readString()),m.figure=o,m.ownerId=t.readInt(),m.ownerName=t.readString();const O=t.readInt();if(O){const A=[];let C=0;for(;C<O;)A.push(t.readShort()),C++;m.botSkills=A}}s++}return!0}resolveSex(t){return t.substr(0,1).toLowerCase()==="f"?en.F:en.M}convertSwimFigure(t,e,s){const i=e.split(".");let r=1,a=1,o=1;const h=1e4;let _=0;for(;_<i.length;){const p=i[_].split("-");p.length>2&&p[0]==="hd"&&(r=parseInt(p[2])),_++}const l=["238,238,238","250,56,49","253,146,160","42,199,210","53,51,44","239,255,146","198,255,152","255,146,90","157,89,126","182,243,255","109,255,51","51,120,201","255,182,49","223,161,233","249,251,50","202,175,143","197,198,197","71,98,61","138,131,97","255,140,51","84,198,39","30,108,153","152,79,136","119,200,255","255,192,142","60,75,135","124,44,71","215,255,227","143,63,28","255,99,147","31,155,121","253,255,51"],c=t.split("=");if(c.length>1){const f=c[1].split("/");f[0];const p=f[1];s==="F"?o=10010:o=10011;const m=l.indexOf(p);a=h+m+1}return e+(".bds-10001-"+r+".ss-"+o+"-"+a)}get users(){return this._users}}class yA{flush(){return this._unitId=null,!0}parse(t){return t?(this._unitId=parseInt(t.readString()),!0):!1}get unitId(){return this._unitId}}class vA{constructor(t,e){this._action=t,this._value=e}get action(){return this._action}get value(){return this._value}}class bA{constructor(t,e,s,i,r,a,o,h=0,_=0,l=0,c,f,p){this._id=t,this._x=e,this._y=s,this._z=i,this._height=r,this._headDirection=a,this._direction=o,this._targetX=h,this._targetY=_,this._targetZ=l,this._didMove=c,this._canStandUp=f,this._actions=p||[]}get id(){return this._id}get x(){return this._x}get y(){return this._y}get z(){return this._z}get height(){return this._height}get headDirection(){return this._headDirection}get direction(){return this._direction}get targetX(){return this._targetX}get targetY(){return this._targetY}get targetZ(){return this._targetZ}get didMove(){return this._didMove}get canStandUp(){return this._canStandUp}get actions(){return this._actions}}class FA{flush(){return this._statuses=[],!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;){const s=this.parseStatus(t);if(!s){e--;continue}this._statuses.push(s),e--}return!0}parseStatus(t){if(!t)return null;const e=t.readInt(),s=t.readInt(),i=t.readInt(),r=parseFloat(t.readString()),a=t.readInt()%8*45,o=t.readInt()%8*45,h=t.readString();let _=0,l=0,c=0,f=0,p=!1,m=!1;if(h){const O=h.split("/"),A=[];for(const C of O){const L=C.split(" ");if(L[0]!==""&&L.length>=2){switch(L[0]){case"mv":{const D=L[1].split(",");D.length>=3&&(_=parseInt(D[0]),l=parseInt(D[1]),c=parseFloat(D[2]),m=!0);break}case"sit":{const D=parseFloat(L[1]);L.length>=3&&(p=L[2]==="1"),f=D;break}case"lay":{const D=parseFloat(L[1]);f=Math.abs(D);break}}A.push(new vA(L[0],L[1]))}}this._statuses.push(new bA(e,s,i,r,f,a,o,_,l,c,m,p,A))}}get statuses(){return this._statuses}}const An=class An{constructor(t){if(!t)throw new Error("invalid_wrapper");this.flush(),this.parse(t)}flush(){return this._rentable=!1,this._itemId=0,this._furniType=null,this._ref=0,this._spriteId=0,this._category=0,this._stuffData=null,this._isGroupable=!1,this._isRecyclable=!1,this._tradable=!1,this._sellable=!1,this._secondsToExpiration=0,this._extra=0,this._flatId=0,this._isWallItem=!1,this._hasRentPeriodStarted=!1,this._expirationTimeStamp=0,this._slotId="",this._songId=-1,!0}parse(t){return t?(this._itemId=t.readInt(),this._furniType=t.readString(),this._ref=t.readInt(),this._spriteId=t.readInt(),this._category=t.readInt(),this._stuffData=rr.parseObjectData(t),this._isRecyclable=t.readBoolean(),this._tradable=t.readBoolean(),this._isGroupable=t.readBoolean(),this._sellable=t.readBoolean(),this._secondsToExpiration=t.readInt(),this._expirationTimeStamp=nt(),this.secondsToExpiration>-1?this._rentable=!0:(this._rentable=!1,this._secondsToExpiration=-1),this._hasRentPeriodStarted=t.readBoolean(),this._flatId=t.readInt(),this._isWallItem=this._furniType===An.WALL_ITEM,this._furniType===An.FLOOR_ITEM&&(this._slotId=t.readString(),this._extra=t.readInt()),!0):!1}get itemId(){return this._itemId}get furniType(){return this._furniType}get ref(){return this._ref}get spriteId(){return this._spriteId}get category(){return this._category}get stuffData(){return this._stuffData}get isGroupable(){return this._isGroupable}get isRecycleable(){return this._isRecyclable}get tradable(){return this._tradable}get sellable(){return this._sellable}get secondsToExpiration(){return this._secondsToExpiration}get flatId(){return this._flatId}get slotId(){return this._slotId}get songId(){return this._songId}get extra(){return this._extra}get rentable(){return this._rentable}get isWallItem(){return this._isWallItem}get hasRentPeriodStarted(){return this._hasRentPeriodStarted}get expirationTimeStamp(){return this._expirationTimeStamp}get creationDay(){return 0}get creationMonth(){return 0}get creationYear(){return 0}get isExternalImageFurni(){return this._furniType.indexOf("external_image")!==-1}};An.WALL_ITEM="I",An.FLOOR_ITEM="S";let Vo=An;class xA{flush(){return this._items=[],!0}parse(t){return t?(this._items.push(new Vo(t)),!0):!1}get items(){return this._items}}class GA{flush(){return!0}parse(t){return!!t}}class BA{flush(){return this._totalFragments=0,this._fragmentNumber=0,this._fragment=new Map,!0}parse(t){if(!t)return!1;this._totalFragments=t.readInt(),this._fragmentNumber=t.readInt();let e=t.readInt();for(;e>0;){const s=new Vo(t);s&&this._fragment.set(s.itemId,s),e--}return!0}get totalFragments(){return this._totalFragments}get fragmentNumber(){return this._fragmentNumber}get fragment(){return this._fragment}}class wA{flush(){return this._itemId=0,!0}parse(t){return t?(this._itemId=t.readInt(),!0):!1}get itemId(){return this._itemId}}class VA{flush(){return this._itemId=0,this._itemsLeft=0,!0}parse(t){return t?(this._itemId=t.readInt(),this._itemsLeft=t.readInt(),!0):!1}get itemId(){return this._itemId}get itemsLeft(){return this._itemsLeft}}class YA{flush(){return this._itemType="",this._classId=0,this._productCode="",!0}parse(t){return t?(this._itemType=t.readString(),this._classId=t.readInt(),this._productCode=t.readString(),this._placedItemId=t.readInt(),this._placedItemType=t.readString(),this._placedInRoom=t.readBoolean(),this._petFigureString=t.readString(),!0):!1}get itemType(){return this._itemType}get classId(){return this._classId}get productCode(){return this._productCode}get placedItemId(){return this._placedItemId}get placedItemType(){return this._placedItemType}get placedInRoom(){return this._placedInRoom}get petFigureString(){return this._petFigureString}}class HA{flush(){this._nestId=0,this._pet1&&(this._pet1.dispose(),this._pet1=null),this._pet2&&(this._pet2.dispose(),this._pet2=null);for(const t of this._rarityCategories)t&&t.dispose();return this._rarityCategories=[],!0}parse(t){if(!t)return!1;this._nestId=t.readInt(),this._pet1=new ZE(t),this._pet2=new ZE(t);let e=t.readInt();for(;e>0;)this._rarityCategories.push(new IA(t)),e--;return this._resultPetType=t.readInt(),!0}get nestId(){return this._nestId}get pet1(){return this._pet1}get pet2(){return this._pet2}get rarityCategories(){return this._rarityCategories}get resultPetType(){return this._resultPetType}}class jA{flush(){return this._breedingNestStuffId=0,this._result=0,!0}parse(t){return t?(this._breedingNestStuffId=t.readInt(),this._result=t.readInt(),!0):!1}get breedingNestStuffId(){return this._breedingNestStuffId}get result(){return this._result}}class zA{flush(){return this._petId=-1,this._rarityCategory=-1,!0}parse(t){return this._petId=t.readInt(),this._rarityCategory=t.readInt(),!0}get rarityCategory(){return this._rarityCategory}get petId(){return this._petId}}class Yd{constructor(t){this._typeId=t.readInt(),this._paletteId=t.readInt(),this._color=t.readString(),this._breedId=t.readInt(),this._customParts=[],this._customPartCount=t.readInt();let e=0;for(;e<this._customPartCount;)this._customParts.push(t.readInt()),this._customParts.push(t.readInt()),this._customParts.push(t.readInt()),e++}get typeId(){return this._typeId}get paletteId(){return this._paletteId}get color(){return this._color}get breedId(){return this._breedId}get figuredata(){let t=this.typeId+" "+this.paletteId+" "+this.color;t=t+(" "+this.custompartCount);for(const e of this.customParts)t=t+(" "+e);return t}get customParts(){return this._customParts}get custompartCount(){return this._customPartCount}}class il{constructor(t){if(!t)throw new Error("invalid_wrapper");this._id=t.readInt(),this._name=t.readString(),this._figureData=new Yd(t),this._level=t.readInt()}get id(){return this._id}get name(){return this._name}get typeId(){return this._figureData.typeId}get paletteId(){return this._figureData.paletteId}get color(){return this._figureData.color}get breedId(){return this._figureData.breedId}get customPartCount(){return this._figureData.custompartCount}get figureString(){return this._figureData.figuredata}get figureData(){return this._figureData}get level(){return this._level}}class WA{flush(){return this._pet=null,this._boughtAsGift=!1,!0}parse(t){return this._pet=new il(t),this._boughtAsGift=t.readBoolean(),!0}get pet(){return this._pet}get boughtAsGift(){return this._boughtAsGift}}const Ca=class Ca{flush(){return this._state=0,this._ownPetId=0,this._otherPetId=0,!0}parse(t){return t?(this._state=t.readInt(),this._ownPetId=t.readInt(),this._otherPetId=t.readInt(),!0):!1}get state(){return this._state}get ownPetId(){return this._ownPetId}get otherPetId(){return this._otherPetId}};Ca.STATE_CANCEL=1,Ca.STATE_ACCEPT=2,Ca.STATE_REQUEST=3;let mc=Ca;class kA{flush(){return this._fragment=null,!0}parse(t){this._totalFragments=t.readInt(),this._fragmentNumber=t.readInt();let e=t.readInt();for(this._fragment=new Map;e>0;){const s=new il(t);this._fragment.set(s.id,s),e--}return!0}get totalFragments(){return this._totalFragments}get fragmentNumber(){return this._fragmentNumber}get fragment(){return this._fragment}}class KA{flush(){return this._boughtAsGift=!1,this._pet=null,!0}parse(t){return this._boughtAsGift=t.readBoolean(),this._pet=new il(t),!0}get boughtAsGift(){return this._boughtAsGift}get pet(){return this._pet}}class XA{flush(){return!0}parse(t){return t?(this._petId=t.readInt(),!0):!1}get petId(){return this._petId}}class qA{constructor(t){this._itemId=t.readInt(),this._furniType=t.readString().toUpperCase(),this._ref=t.readInt(),this._spriteId=t.readInt(),this._category=t.readInt(),this._isGroupable=t.readBoolean(),this._stuffData=rr.parseObjectData(t),this._secondsToExpiration=-1,this._expirationTimeStamp=nt(),this._hasRentPeriodStarted=!1,this._creationDay=t.readInt(),this._creationMonth=t.readInt(),this._creationYear=t.readInt(),this._extra=this.furniType==="S"?t.readInt():-1,this._flatId=-1,this._rentable=!1,this._isWallItem=this._furniType==="I"}get itemId(){return this._itemId}get furniType(){return this._furniType}get ref(){return this._ref}get spriteId(){return this._spriteId}get category(){return this._category}get stuffData(){return this._stuffData}get extra(){return this._extra}get secondsToExpiration(){return this._secondsToExpiration}get creationDay(){return this._creationDay}get creationMonth(){return this._creationMonth}get creationYear(){return this._creationYear}get isGroupable(){return this._isGroupable}get songId(){return this._extra}get flatId(){return this._flatId}get rentable(){return this._rentable}get isWallItem(){return this._isWallItem}get hasRentPeriodStarted(){return this._hasRentPeriodStarted}get expirationTimeStamp(){return this._expirationTimeStamp}get isRecycleable(){return!0}get tradable(){return!0}get sellable(){return!0}get slotId(){return null}get isExternalImageFurni(){return this._furniType.indexOf("external_image")!==-1}}class QA{flush(){return this._userID=-1,this._userAccepts=!1,!0}parse(t){return t?(this._userID=t.readInt(),this._userAccepts=t.readInt()>0,!0):!1}get userID(){return this._userID}get userAccepts(){return this._userAccepts}}const RE=class RE{flush(){return!0}parse(t){return t?(this._userId=t.readInt(),this._reason=t.readInt(),!0):!1}get userID(){return this._userId}get reason(){return this._reason}};RE.ERROR_WHILE_COMMIT=1;let pc=RE;class JA{flush(){return!0}parse(t){return!!t}}class ZA{flush(){return!0}parse(t){return!!t}}class $A{flush(){return this._firstUserID=-1,this._firstUserItemArray=null,this._firstUserNumItems=0,this._firstUserNumCredits=0,this._secondUserID=-1,this._secondUserItemArray=null,this._secondUserNumItems=0,this._secondUserNumCredits=0,!0}parse(t){return!t||(this._firstUserID=t.readInt(),this._firstUserItemArray=[],!this.parseItems(t,this._firstUserItemArray))||(this._firstUserNumItems=t.readInt(),this._firstUserNumCredits=t.readInt(),this._secondUserID=t.readInt(),this._secondUserItemArray=[],!this.parseItems(t,this._secondUserItemArray))?!1:(this._secondUserNumItems=t.readInt(),this._secondUserNumCredits=t.readInt(),!0)}parseItems(t,e){let s=t.readInt();for(;s>0;)e.push(new qA(t)),s--;return!0}get firstUserID(){return this._firstUserID}get firstUserItemArray(){return this._firstUserItemArray}get firstUserNumItems(){return this._firstUserNumItems}get firstUserNumCredits(){return this._firstUserNumCredits}get secondUserID(){return this._secondUserID}get secondUserItemArray(){return this._secondUserItemArray}get secondUserNumItems(){return this._secondUserNumItems}get secondUserNumCredits(){return this._secondUserNumCredits}}class tS{flush(){return!0}parse(t){return!!t}}class eS{flush(){return!0}parse(t){return!!t}}const R_=class R_{flush(){return!0}parse(t){return t?(this._reason=t.readInt(),this._otherUserName=t.readString(),!0):!1}get reason(){return this._reason}get otherUserName(){return this._otherUserName}};R_.REASON_YOU_ARE_ALREADY_TRADING=7,R_.REASON_OTHER_USER_ALREADY_TRADING=8;let Rc=R_;class sS{flush(){return this._userId=-1,this._userCanTrade=!1,this._otherUserId=-1,this._otherUserCanTrade=!1,!0}parse(t){return t?(this._userId=t.readInt(),this._userCanTrade=t.readInt()===1,this._otherUserId=t.readInt(),this._otherUserCanTrade=t.readInt()===1,!0):!1}get userID(){return this._userId}get userCanTrade(){return this._userCanTrade}get otherUserID(){return this._otherUserId}get otherUserCanTrade(){return this._otherUserCanTrade}}class iS{flush(){return!0}parse(t){return!!t}}class rS{flush(){return!0}parse(t){return!!t}}class nS{flush(){return this._respect=0,this._petOwnerId=0,this._petData=null,!0}parse(t){return t?(this._respect=t.readInt(),this._petOwnerId=t.readInt(),this._petData=new il(t),!0):!1}get respect(){return this._respect}get petOwnerId(){return this._petOwnerId}get petData(){return this._petData}get isTreat(){return this._petData.typeId===ja.MONSTERPLANT}}class aS{flush(){return this._petId=0,this._userId=0,this._supplementType=0,!0}parse(t){return t?(this._petId=t.readInt(),this._userId=t.readInt(),this._supplementType=t.readInt(),!0):!1}get petId(){return this._petId}get userId(){return this._userId}get supplementType(){return this._supplementType}}const Rr=class Rr{};Rr.WATER=0,Rr.LIGHT=1,Rr.REVIVE=2,Rr.REBREED_FERTILIZER=3,Rr.SPEED_FERTILIZER=4;let ta=Rr;class oS{flush(){return this._userId=0,this._respectsReceived=0,!0}parse(t){return t?(this._userId=t.readInt(),this._respectsReceived=t.readInt(),!0):!1}get userId(){return this._userId}get respectsReceived(){return this._respectsReceived}}class hS{constructor(t,e,s){this._hasControllers=!1,this._roomId=t,this._roomName=e,this._hasControllers=s}get roomId(){return this._roomId}get roomName(){return this._roomName}get hasControllers(){return this._hasControllers}}class _S{constructor(t){this._currentHcStreak=t.readInt(),this._firstSubscriptionDate=t.readString(),this._kickbackPercentage=t.readDouble(),this._totalCreditsMissed=t.readInt(),this._totalCreditsRewarded=t.readInt(),this._totalCreditsSpent=t.readInt(),this._creditRewardForStreakBonus=t.readInt(),this._creditRewardForMonthlySpent=t.readInt(),this._timeUntilPayday=t.readInt()}get currentHcStreak(){return this._currentHcStreak}get firstSubscriptionDate(){return this._firstSubscriptionDate}get kickbackPercentage(){return this._kickbackPercentage}get totalCreditsMissed(){return this._totalCreditsMissed}get totalCreditsRewarded(){return this._totalCreditsRewarded}get totalCreditsSpent(){return this._totalCreditsSpent}get creditRewardForStreakBonus(){return this._creditRewardForStreakBonus}get creditRewardForMonthlySpent(){return this._creditRewardForMonthlySpent}get timeUntilPayday(){return this._timeUntilPayday}}class lS{flush(){return this._data=null,!0}parse(t){return this._data=new _S(t),!0}get data(){return this._data}}class cS{flush(){return this._looks=new Map,!0}parse(t){if(!t)return!1;t.readInt();let e=t.readInt();for(;e>0;){const s=t.readInt(),i=t.readString(),r=t.readString();this._looks.set(s,[i,r]),e--}return!0}get looks(){return this._looks}}class uS{flush(){return this._result=-1,!0}parse(t){return t?(this._result=t.readInt(),!0):!1}get result(){return this._result}}class dS{flush(){return this._isVip=!1,this._rooms=[],!0}parse(t){if(!t)return!1;this._isVip=t.readBoolean();let e=t.readInt();for(;e>0;)this._rooms.push(new hS(t.readInt(),t.readString(),t.readBoolean())),e--;return!0}get isVip(){return this._isVip}get rooms(){return this._rooms}}class ES{flush(){return this._pageId=-1,this._data=null,!0}parse(t){return t?(this._pageId=t.readInt(),this._data=new sl(t),!0):!1}get pageId(){return this._pageId}get data(){return this._data}}class gS{constructor(t){if(!t)throw new Error("invalid_wrapper");this.flush(),this.parse(t)}flush(){return this._type=-1,this._breedId=-1,this._paletteId=-1,this._sellable=!1,this._rare=!1,!0}parse(t){return t?(this._type=t.readInt(),this._breedId=t.readInt(),this._paletteId=t.readInt(),this._sellable=t.readBoolean(),this._rare=t.readBoolean(),!0):!1}get type(){return this._type}get breedId(){return this._breedId}get paletteId(){return this._paletteId}get sellable(){return this._sellable}get rare(){return this._rare}}class fS{flush(){return this._productCode="",this._palettes=[],!0}parse(t){if(!t)return!1;this._productCode=t.readString();let e=t.readInt();for(;e>0;)this._palettes.push(new gS(t)),e--;return!0}get productCode(){return this._productCode}get palettes(){return this._palettes}}class IS{constructor(t){this._trackingState=t.readInt(),this._id=t.readInt(),this._identifier=t.readString(),this._productCode=t.readString(),this._priceInCredits=t.readInt(),this._priceInActivityPoints=t.readInt(),this._activityPointType=t.readInt(),this._purchaseLimit=t.readInt();const e=t.readInt();this._expirationTime=e>0?e*1e3+Date.now():0,this._title=t.readString(),this._description=t.readString(),this._imageUrl=t.readString(),this._iconImageUrl=t.readString(),this._type=t.readInt(),this._subProductCodes=[];let s=t.readInt();for(;s>0;)this._subProductCodes.push(t.readString()),s--;return this}populate(t){t&&(this._id=t.id,this._identifier=t.identifier,this._type=t.type,this._title=t.title,this._description=t.description,this._imageUrl=t.imageUrl,this._iconImageUrl=t.iconImageUrl,this._productCode=t.productCode,this._purchaseLimit=t.purchaseLimit,this._expirationTime=t.expirationTime,this._priceInCredits=t.priceInCredits,this._priceInActivityPoints=t.priceInActivityPoints,this._activityPointType=t.activityPointType,this._subProductCodes=t.subProductCodes,this._trackingState=t.trackingState)}purchase(t){this._purchaseLimit=this._purchaseLimit-t}get id(){return this._id}get identifier(){return this._identifier}get type(){return this._type}get title(){return this._title}get description(){return this._description}get imageUrl(){return this._imageUrl}get iconImageUrl(){return this._iconImageUrl}get productCode(){return this._productCode}get purchaseLimit(){return this._purchaseLimit}get expirationTime(){return this._expirationTime}get priceInCredits(){return this._priceInCredits}get priceInActivityPoints(){return this._priceInActivityPoints}get activityPointType(){return this._activityPointType}get subProductCodes(){return this._subProductCodes}get trackingState(){return this._trackingState}}class TS{flush(){return!0}parse(t){return!!t}}class mS{flush(){return this._data=null,!0}parse(t){return t?(this._data=new IS(t),!0):!1}get data(){return this._data}}class pS{constructor(){this._errorCode=""}flush(){return this._errorCode="",!0}parse(t){return t?(this._errorCode=t.readString(),!0):!1}get errorCode(){return this._errorCode}}class RS{constructor(){this._productName="",this._productDescription=""}flush(){return this._productDescription="",this._productName="",!0}parse(t){return t?(this._productDescription=t.readString(),this._productName=t.readString(),!0):!1}get productName(){return this._productName}get productDescription(){return this._productDescription}}class OS{flush(){return!0}parse(t){return!!t}}const ni=class ni{flush(){return this._goalId=0,this._goalCode=null,this._result=0,this._requiredFurnis=null,this._missingFurnis=null,!0}parse(t){this._goalId=t.readInt(),this._goalCode=t.readString(),this._result=t.readInt(),this._requiredFurnis=[];let e=t.readInt();for(;e>0;)this._requiredFurnis.push(t.readString()),e--;for(e=t.readInt();e>0;)this._missingFurnis[t.readString()]="",e--;return!0}get goalId(){return this._goalId}get goalCode(){return this._goalCode}get result(){return this._result}get requiredFurnis(){return this._requiredFurnis}isMissing(t){return!!this._missingFurnis[t]}};ni.SUBMITTED=0,ni.ASK_FOR_SUBMIT=1,ni.ASK_FOR_CONFIRM=2,ni.PREREQUISITES_NOT_MET=3,ni.ROOM_DOOR_NOT_OPEN=4,ni.ROOM_TOO_OLD=5,ni.ASK_FOR_ACCEPT_RULES=6;let Oc=ni;const Ma=class Ma{};Ma.ALLOWED=0,Ma.REQUIRED_PERK_MISSING=1,Ma.REQUIRED_BADGE_MISSING=2;let Ac=Ma;class AS{flush(){return this._goalId=0,this._goalCode=null,this._resultCode=0,this._votesRemaining=0,!0}parse(t){return this._goalId=t.readInt(),this._goalCode=t.readString(),this._resultCode=t.readInt(),this._votesRemaining=t.readInt(),!0}get goalId(){return this._goalId}get goalCode(){return this._goalCode}get isVotingAllowedForUser(){return this._resultCode===Ac.ALLOWED}get votesRemaining(){return this._votesRemaining}get resultCode(){return this._resultCode}}class SS{flush(){return this._schedulingStr=null,this._code=null,!0}parse(t){return this._schedulingStr=t.readString(),this._code=t.readString(),!0}get schedulingStr(){return this._schedulingStr}get code(){return this._code}}class CS{flush(){return this._isPartOf=!1,this._targetId=0,!0}parse(t){return this._isPartOf=t.readBoolean(),this._targetId=t.readInt(),!0}get isPartOf(){return this._isPartOf}get targetId(){return this._targetId}}class MS{flush(){return!0}parse(t){return!0}}class NS{flush(){return this._timeStr=null,this._secondsUntil=0,!0}parse(t){return this._timeStr=t.readString(),this._secondsUntil=t.readInt(),!0}get timeStr(){return this._timeStr}get secondsUntil(){return this._secondsUntil}}class Mg{constructor(t){this._recipeName=t.readString(),this._itemName=t.readString()}get recipeName(){return this._recipeName}get itemName(){return this._itemName}}class DS{constructor(){this._recipes=[],this._ingredients=[]}flush(){return this._recipes=[],this._ingredients=[],!0}parse(t){if(!t)return!1;const e=t.readInt();for(let i=0;i<e;i++)this._recipes.push(new Mg(t));const s=t.readInt();for(let i=0;i<s;i++)this._ingredients.push(t.readString());return!0}get recipes(){return this._recipes}get ingredients(){return this._ingredients}isActive(){return this._recipes.length>0||this._ingredients.length>0}}class LS{constructor(t){this._count=t.readInt(),this._itemName=t.readString()}get count(){return this._count}get itemName(){return this._itemName}}class PS{constructor(){this._ingredients=[]}parse(t){if(!t)return!1;const e=t.readInt();for(let s=0;s<e;s++)this._ingredients.push(new LS(t));return!0}flush(){return this._ingredients=[],!0}get ingredients(){return this._ingredients}}class US{parse(t){return t?(this._count=t.readInt(),this._hasRecipes=t.readBoolean(),!0):!1}flush(){return this._count=0,this._hasRecipes=!1,!0}get count(){return this._count}get hasRecipes(){return this._hasRecipes}}class yS{parse(t){return t?(this._success=t.readBoolean(),this._success&&(this._result=new Mg(t)),!0):!1}flush(){return this._success=!1,!0}get success(){return this._success}get result(){return this._result}}class vS{flush(){return!0}parse(t){return!!t}}class bS{constructor(t){if(!t)throw new Error("invalid_wrapper");this._senderId=t.readInt(),this._errorCode=t.readInt()}get senderId(){return this._senderId}get errorCode(){return this._errorCode}}class FS{flush(){return this._failuers=[],!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;)this._failuers.push(new bS(t)),e--;return!0}get failures(){return this._failuers}}class xS{flush(){return this._success=!1,!0}parse(t){return t?(this._success=t.readBoolean(),!0):!1}get success(){return this._success}}class GS{flush(){return this._errorCode=0,!0}parse(t){return t?(this._errorCode=t.readInt(),!0):!1}get errorCode(){return this._errorCode}}class Ng{constructor(t){if(!t)throw new Error("invalid_wrapper");this._id=t.readInt(),this._name=t.readString()}get id(){return this._id}get name(){return this._name}}class Sc{constructor(t){if(!t)throw new Error("invalid_wrapper");this._id=t.readInt(),this._name=t.readString(),this._gender=t.readInt(),this._online=t.readBoolean(),this._followingAllowed=t.readBoolean(),this._figure=t.readString(),this._categoryId=t.readInt(),this._motto=t.readString(),this._realName=t.readString(),this._lastAccess=t.readString(),this._persistedMessageUser=t.readBoolean(),this._vipMember=t.readBoolean(),this._pocketHabboUser=t.readBoolean(),this._relationshipStatus=t.readShort()}get id(){return this._id}get name(){return this._name}get gender(){return this._gender}get online(){return this._online}get followingAllowed(){return this._followingAllowed}get figure(){return this._figure}get categoryId(){return this._categoryId}get motto(){return this._motto}get lastAccess(){return this._lastAccess}get realName(){return this._realName}get persistedMessageUser(){return this._persistedMessageUser}get vipMember(){return this._vipMember}get pocketHabboUser(){return this._pocketHabboUser}get relationshipStatus(){return this._relationshipStatus}}class BS{flush(){return this._totalFragments=0,this._fragmentNumber=0,this._fragment=[],!0}parse(t){if(!t)return!1;this._totalFragments=t.readInt(),this._fragmentNumber=t.readInt();let e=t.readInt();for(;e>0;)this._fragment.push(new Sc(t)),e--;return!0}get totalFragments(){return this._totalFragments}get fragmentNumber(){return this._fragmentNumber}get fragment(){return this._fragment}}class wS{flush(){return this._categories=[],this._removedFriendIds=[],this._addedFriends=[],this._updatedFriends=[],!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;)this._categories.push(new Ng(t)),e--;let s=t.readInt();for(;s>0;){const i=t.readInt();i===-1?this._removedFriendIds.push(t.readInt()):i===0?this._updatedFriends.push(new Sc(t)):i===1&&this._addedFriends.push(new Sc(t)),s--}return!0}get categories(){return this._categories}get removedFriendIds(){return this._removedFriendIds}get addedFriends(){return this._addedFriends}get updatedFriends(){return this._updatedFriends}}class VS{flush(){return this._typeCode=-1,this._avatarId=0,this._message=null,!0}parse(t){return t?(this._typeCode=t.readInt(),this._avatarId=t.readInt(),this._message=t.readString(),!0):!1}get typeCode(){return this._typeCode}get avatarId(){return this._avatarId}get message(){return this._message}}class Dg{constructor(t){if(!t)throw new Error("invalid_wrapper");this._requestId=t.readInt(),this._requesterName=t.readString(),this._figureString=t.readString(),this._requesterUserId=this._requestId}get requestId(){return this._requestId}get requesterName(){return this._requesterName}get requesterUserId(){return this._requesterUserId}get figureString(){return this._figureString}}class YS{flush(){return this._totalRequests=0,this._requests=[],!0}parse(t){if(!t)return!1;this._totalRequests=t.readInt();let e=t.readInt();for(;e>0;)this._requests.push(new Dg(t)),e--;return!0}get totalRequests(){return this._totalRequests}get requests(){return this._requests}}class tg{constructor(t){if(!t)throw new Error("invalid_wrapper");this._avatarId=t.readInt(),this._avatarName=t.readString(),this._avatarMotto=t.readString(),this._isAvatarOnline=t.readBoolean(),this._canFollow=t.readBoolean(),this._lastOnlineData=t.readString(),this._avatarGender=t.readInt(),this._avatarFigure=t.readString(),this._realName=t.readString()}get avatarId(){return this._avatarId}get avatarName(){return this._avatarName}get avatarMotto(){return this._avatarMotto}get isAvatarOnline(){return this._isAvatarOnline}get canFollow(){return this._canFollow}get avatarGender(){return this._avatarGender}get avatarFigure(){return this._avatarFigure}get lastOnlineData(){return this._lastOnlineData}get realName(){return this._realName}}class HS{flush(){return this._friends=[],this._others=[],!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;)this._friends.push(new tg(t)),e--;let s=t.readInt();for(;s>0;)this._others.push(new tg(t)),s--;return!0}get friends(){return this._friends}get others(){return this._others}}class jS{flush(){return this._errorCode=0,this._userId=0,this._message=null,!0}parse(t){return t?(this._errorCode=t.readInt(),this._userId=t.readInt(),this._message=t.readString(),!0):!1}get errorCode(){return this._errorCode}get userId(){return this._userId}get message(){return this._message}}class zS{flush(){return this._clientMessageId=0,this._errorCode=0,!0}parse(t){return t?(this._clientMessageId=t.readInt(),this._errorCode=t.readInt(),!0):!1}get clientMessageId(){return this._clientMessageId}get errorCode(){return this._errorCode}}class WS{flush(){return this._userFriendLimit=0,this._normalFriendLimit=0,this._extendedFriendLimit=0,this._categories=[],!0}parse(t){if(!t)return!1;this._userFriendLimit=t.readInt(),this._normalFriendLimit=t.readInt(),this._extendedFriendLimit=t.readInt();let e=t.readInt();for(;e>0;)this._categories.push(new Ng(t)),e--;return!0}get userFriendLimit(){return this._userFriendLimit}get normalFriendLimit(){return this._normalFriendLimit}get extendedFriendLimit(){return this._extendedFriendLimit}get categories(){return this._categories}}class kS{flush(){return!0}parse(t){return!!t}}class KS{flush(){return this._count=0,!0}parse(t){return t?(this._count=t.readInt(),!0):!1}get count(){return this._count}}class XS{flush(){return this._senderId=0,this._messageText=null,this._secondsSinceSent=0,this._extraData=null,!0}parse(t){return t?(this._senderId=t.readInt(),this._messageText=t.readString(),this._secondsSinceSent=t.readInt(),t.bytesAvailable&&(this._extraData=t.readString()),!0):!1}get senderId(){return this._senderId}get messageText(){return this._messageText}get secondsSinceSent(){return this._secondsSinceSent}get extraData(){return this._extraData}}class qS{flush(){return this._request=null,!0}parse(t){return t?(this._request=new Dg(t),!0):!1}get request(){return this._request}}class QS{flush(){return this._errorCode=0,this._failedRecipients=[],!0}parse(t){if(!t)return!1;this._errorCode=t.readInt();let e=t.readInt();for(;e>0;)this._failedRecipients.push(t.readInt()),e--;return!0}get errorCode(){return this._errorCode}get failedRecipients(){return this._failedRecipients}}class JS{flush(){return this._senderId=0,this._messageText=null,!0}parse(t){return t?(this._senderId=t.readInt(),this._messageText=t.readString(),!0):!1}get senderId(){return this._senderId}get messageText(){return this._messageText}}class ZS{flush(){return!0}parse(t){return t?(this._gameTypeId=t.readInt(),this._freeGamesLeft=t.readInt(),this._gamesPlayedTotal=t.readInt(),!0):!1}get gameTypeId(){return this._gameTypeId}get freeGamesLeft(){return this._freeGamesLeft}get gamesPlayedTotal(){return this._gamesPlayedTotal}get hasUnlimitedGames(){return this._freeGamesLeft==-1}}const Sn=class Sn{flush(){return this._status=-1,this._blockLength=-1,this._gamesPlayed=-1,this._freeGamesLeft=-1,!0}parse(t){return t?(this._status=t.readInt(),this._blockLength=t.readInt(),this._gamesPlayed=t.readInt(),this._freeGamesLeft=t.readInt(),!0):!1}get status(){return this._status}get blockLength(){return this._blockLength}get gamesPlayed(){return this._gamesPlayed}get freeGamesLeft(){return this._freeGamesLeft}get hasUnlimitedGames(){return this._freeGamesLeft==-1}};Sn.STATUS_OK=0,Sn.STATUS_FAILED_REASON_UNKNOWN=1,Sn.STATUS_FAILED_REASON_GAME_DIRECTORY_IS_NOT_AVAILABLE=2,Sn.STATUS_FAILED_REASON_HOTEL_IS_CLOSED=3;let Cc=Sn;class $S{flush(){return this._position=-1,!0}parse(t){return t?(this._position=t.readInt(),!0):!1}get position(){return this._position}}const bs=class bs{flush(){return this._reason=-1,!0}parse(t){return t?(this._reason=t.readInt(),!0):!1}get reason(){return this._reason}};bs.KICKED=1,bs.DUPLICATE_MACHINEID=2,bs.INVITATION_REQUIRED=3,bs.NO_SPACE_IN_TEAM=4,bs.TEAM_NOT_FOUND=5,bs.USER_HAS_ACTIVE_INSTANCE=6,bs.USER_HAS_PENDING_INSTANCE_REQUEST=7,bs.USER_HAS_NO_FREE_GAMES_LEFT=8;let Mc=bs;const O_=class O_{flush(){return this._reason=-1,!0}parse(t){return t?(this._reason=t.readInt(),!0):!1}get reason(){return this._reason}};O_.NOT_ENOUGH_PLAYERS=1,O_.GAME_HAS_NO_OWNER=2;let Nc=O_;class tC{flush(){return!0}parse(t){return!!t}}class eC{flush(){return this._userId=-1,!0}parse(t){return t?(this._userId=t.readInt(),!0):!1}get userId(){return this._userId}}class sC{flush(){return!0}parse(t){return t?(this._stuffCode=t.readString(),this._badgeCode=t.readString(),!0):!1}get stuffCode(){return this._stuffCode}get badgeCode(){return this._badgeCode}}class iC{flush(){return this._stuffId=-1,this._achievementId=0,this._requiredLevelBadgeCode="",this._userProgress=0,this._totalProgress=0,this._endTime=0,!0}parse(t){return t?(this._stuffId=t.readInt(),this._achievementId=t.readInt(),this._requiredLevelBadgeCode=t.readString(),this._userProgress=t.readInt(),this._totalProgress=t.readInt(),this._endTime=t.readInt(),!0):!1}get stuffId(){return this._stuffId}get achievementId(){return this._achievementId}get requiredLevelBadgeCode(){return this._requiredLevelBadgeCode}get userProgress(){return this._userProgress}get totalProgress(){return this._totalProgress}get endTime(){return this._endTime}}class rC{flush(){return!0}parse(t){if(!t)return!1;this._stuffId=t.readInt();const e=t.readInt();let s=0;for(;s<e;)this._achievements.push(new Ec(t)),s++;return this._endTime=t.readInt(),!0}get stuffId(){return this._stuffId}get achievements(){return this._achievements}get endTime(){return this._endTime}}class nC{constructor(t,e,s,i){this._gameTypeId=t,this._achievementId=e,this._achievementName=s,this._levels=i}get gameTypeId(){return this._gameTypeId}get achievementId(){return this._achievementId}get achievementName(){return this._achievementName}get levels(){return this._levels}}class aC{flush(){return!0}parse(t){if(!t)return!1;this._achievements=[];const e=t.readInt();let s=0;for(;s<e;){const i=t.readInt(),r=t.readInt();let a=0;for(;a<r;){const o=t.readInt(),h=t.readString(),_=t.readInt();this._achievements.push(new nC(i,o,h,_)),a++}s++}return!0}get achievements(){return this._achievements}}class oC{constructor(t,e,s,i,r,a){this._gameId=t,this._gameNameId=e,this._bgColor=s,this._textColor=i,this._assetUrl=r,this._supportUrl=a}get gameId(){return this._gameId}get gameNameId(){return this._gameNameId}get bgColor(){return this._bgColor}get textColor(){return this._textColor}get assetUrl(){return this._assetUrl}get supportUrl(){return this._supportUrl}}class hC{flush(){return!0}parse(t){return t?(this._gameTypeId=t.readInt(),this._inviterId=t.readInt(),!0):!1}get gameTypeId(){return this._gameTypeId}get inviterId(){return this._inviterId}}class _C{flush(){return!0}parse(t){if(!t)return!1;this._games=[];const e=t.readInt();for(let s=0;s<e;s++){const i=t.readInt(),r=t.readString(),a=t.readString();let o=parseInt(a,16);o=o|4278190080;const h=t.readString();let _=parseInt(h,16);_=_|4278190080;const l=t.readString(),c=t.readString();this._games.push(new oC(i,r,o,_,l,c))}return!0}get games(){return this._games}}const Cn=class Cn{flush(){return!0}parse(t){return t?(this._gameTypeId=t.readInt(),this._status=t.readInt(),!0):!1}get gameTypeId(){return this._gameTypeId}get isOk(){return this._status==Cn.OK}get isInMaintenance(){return this._status==Cn.MAINTENANCE}};Cn.OK=0,Cn.MAINTENANCE=1;let Dc=Cn;class lC{flush(){return!0}parse(t){return t?(this._gameTypeId=t.readInt(),!0):!1}get gameTypeId(){return this._gameTypeId}}const OE=class OE{flush(){return!0}parse(t){return t?(this._gameTypeId=t.readInt(),this._reason=t.readInt(),!0):!1}get gameTypeId(){return this._gameTypeId}get reason(){return this._reason}};OE.DUPLICATE_MACHINEID=1;let Lc=OE;class cC{flush(){return!0}parse(t){return t?(this._gameTypeId=t.readInt(),!0):!1}get gameTypeId(){return this._gameTypeId}}class uC{flush(){return!0}parse(t){if(!t)return!1;this._gameTypeId=t.readInt(),this._gameClientId=t.readString(),this._url=t.readString(),this._quality=t.readString(),this._scaleMode=t.readString(),this._frameRate=t.readInt(),this._minMajorVersion=t.readInt(),this._minMinorVersion=t.readInt(),this._params=new Map;const e=t.readInt();let s=0;for(;s<e;)this._params.set(t.readString(),t.readString()),s++;return!0}get gameTypeId(){return this._gameTypeId}get url(){return this._url}get quality(){return this._quality}get scaleMode(){return this._scaleMode}get frameRate(){return this._frameRate}get minMajorVersion(){return this._minMajorVersion}get minMinorVersion(){return this._minMinorVersion}get params(){return this._params}get gameClientId(){return this._gameClientId}}class dC{flush(){return this._gameTypeId=0,this._url=null,this._gameClientId=null,!0}parse(t){return t?(this._gameTypeId=t.readInt(),this._gameClientId=t.readString(),this._url=t.readString(),!0):!1}get gameTypeId(){return this._gameTypeId}get url(){return this._url}get gameClientId(){return this._gameClientId}}class EC{flush(){return!0}parse(t){return t?(this._gameTypeId=t.readInt(),this._gameClientId=t.readString(),!0):!1}get gameTypeId(){return this._gameTypeId}get gameClientId(){return this._gameClientId}}class gC{flush(){return!0}parse(t){return!!t}}class rl{flush(){return this._year=-1,this._week=-1,this._maxOffset=-1,this._currentOffset=-1,this._minutesUntilReset=-1,!0}parse(t){return t?(this._year=t.readInt(),this._week=t.readInt(),this._maxOffset=t.readInt(),this._currentOffset=t.readInt(),this._minutesUntilReset=t.readInt(),!0):!1}get year(){return this._year}get week(){return this._week}get maxOffset(){return this._maxOffset}get currentOffset(){return this._currentOffset}get minutesUntilReset(){return this._minutesUntilReset}}class fC{constructor(t){this._name=t.readString(),this._figure=t.readString(),this._gender=t.readString(),this._rank=t.readInt(),this._score=t.readInt()}get name(){return this._name}get figure(){return this._figure}get gender(){return this._gender}get rank(){return this._rank}get score(){return this._score}}class IC{flush(){return this._gameTypeId=-1,this._products=[],this._minutesUntilNextWeek=0,this._rewardingOn=!0,!0}parse(t){if(!t)return!1;this._gameTypeId=t.readInt();let e=t.readInt();for(;e>0;)this._products.push(new zn(t)),e--;return this._minutesUntilNextWeek=t.readInt(),this._rewardingOn=t.readBoolean(),!0}get gameTypeId(){return this._gameTypeId}get products(){return this._products}get minutesUntilNextWeek(){return this._minutesUntilNextWeek}get rewardingOn(){return this._rewardingOn}}class TC{flush(){return this._gameTypeId=-1,this._winners=[],!0}parse(t){if(!t)return!1;this._gameTypeId=t.readInt();let e=t.readInt();for(;e>0;)this._winners.push(new fC(t)),e--;return!0}get gameTypeId(){return this._gameTypeId}get winners(){return this._winners}}class mC{flush(){return this._errorCode=0,!0}parse(t){return t?(this._errorCode=t.readInt(),!0):!1}get errorCode(){return this._errorCode}}class pC{flush(){return this._phoneStatusCode=-1,this._millisecondsToAllowProcessReset=-1,!0}parse(t){return t?(this._phoneStatusCode=t.readInt(),this._collectionStatusCode=t.readInt(),this._millisecondsToAllowProcessReset=t.readInt(),!0):!1}get phoneStatusCode(){return this._phoneStatusCode}get collectionStatusCode(){return this._collectionStatusCode}get millisecondsToAllowProcessReset(){return this._millisecondsToAllowProcessReset}}class RC{flush(){return this._resultCode=-1,!0}parse(t){return t?(this._resultCode=t.readInt(),this._millisToAllowProcessReset=t.readInt(),!0):!1}get resultCode(){return this._resultCode}get millisToAllowProcessReset(){return this._millisToAllowProcessReset}}class OC{flush(){return this._resultCode=-1,this._millisecondsToAllowProcessReset=-1,!0}parse(t){return t?(this._resultCode=t.readInt(),this._millisecondsToAllowProcessReset=t.readInt(),!0):!1}get resultCode(){return this._resultCode}get millisToAllowProcessReset(){return this._millisecondsToAllowProcessReset}}class AC{flush(){return this._bases=new Map,this._symbols=new Map,this._partColors=new Map,this._colorsA=new Map,this._colorsB=new Map,!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;){const o=t.readInt(),h=t.readString(),_=t.readString();this._bases.set(o,[h,_]),e--}let s=t.readInt();for(;s>0;){const o=t.readInt(),h=t.readString(),_=t.readString();this._symbols.set(o,[h,_]),s--}let i=t.readInt();for(;i>0;){const o=t.readInt(),h=t.readString();this._partColors.set(o,h),i--}let r=t.readInt();for(;r>0;){const o=t.readInt(),h=t.readString();this._colorsA.set(o,h),r--}let a=t.readInt();for(;a>0;){const o=t.readInt(),h=t.readString();this._colorsB.set(o,h),a--}return!0}get bases(){return this._bases}get symbols(){return this._symbols}get partColors(){return this._partColors}get colorsA(){return this._colorsA}get colorsB(){return this._colorsB}}class SC{flush(){return this._groupCost=0,this._availableRooms=new Map,!0}parse(t){if(!t)return!1;this._groupCost=t.readInt();let e=t.readInt();for(;e>0;){const s=t.readInt(),i=t.readString();t.readBoolean(),this._availableRooms.set(s,i),e--}return!0}get groupCost(){return this._groupCost}get availableRooms(){return this._availableRooms}}class CC{flush(){return this._userId=0,this._furnitureCount=0,!0}parse(t){return t?(this._userId=t.readInt(),this._furnitureCount=t.readInt(),!0):!1}get userId(){return this._userId}get furnitureCount(){return this._furnitureCount}}class MC{flush(){return this._id=0,this._type=0,this._title=null,this._description=null,this._badge=null,this._roomId=0,this._roomName=null,this._membershipType=0,this._membersCount=0,this._isFavorite=!1,this._createdAt=null,this._isOwner=!1,this._isAdmin=!1,this._ownerName=null,this._flag=!1,this._canMembersDecorate=!1,this._pendingRequestsCount=0,!0}parse(t){return t?(this._id=t.readInt(),t.readBoolean(),this._type=t.readInt(),this._title=t.readString(),this._description=t.readString(),this._badge=t.readString(),this._roomId=t.readInt(),this._roomName=t.readString(),this._membershipType=t.readInt(),this._membersCount=t.readInt(),this._isFavorite=t.readBoolean(),this._createdAt=t.readString(),this._isOwner=t.readBoolean(),this._isAdmin=t.readBoolean(),this._ownerName=t.readString(),this._flag=t.readBoolean(),this._canMembersDecorate=t.readBoolean(),this._pendingRequestsCount=t.readInt(),!0):!1}get id(){return this._id}get type(){return this._type}get title(){return this._title}get description(){return this._description}get badge(){return this._badge}get roomId(){return this._roomId}get roomName(){return this._roomName}get membershipType(){return this._membershipType}get membersCount(){return this._membersCount}get isFavorite(){return this._isFavorite}get createdAt(){return this._createdAt}get isOwner(){return this._isOwner}get isAdmin(){return this._isAdmin}get ownerName(){return this._ownerName}get flag(){return this._flag}get canMembersDecorate(){return this._canMembersDecorate}get pendingRequestsCount(){return this._pendingRequestsCount}}class NC{constructor(t){this.isBase=t,this.key=0,this.color=0,this.position=4}get code(){return this.key===0?null:(this.isBase?"b":"s")+(this.key<100?"0":"")+(this.key<10?"0":"")+this.key+(this.color<10?"0":"")+this.color+this.position}}const Or=class Or{};Or.OWNER=0,Or.ADMIN=1,Or.MEMBER=2,Or.REQUESTED=3,Or.DELETED=4;let eg=Or;class DC{constructor(t){if(!t)throw new Error("invalid_wrapper");this.flush(),this.parse(t)}flush(){return this._rank=-1,this._id=0,this._name=null,this._figure=null,this._joinedAt=null,!0}parse(t){return t?(this._rank=t.readInt(),this._id=t.readInt(),this._name=t.readString(),this._figure=t.readString(),this._joinedAt=t.readString(),!0):!1}get id(){return this._id}get name(){return this._name}get figure(){return this._figure}get rank(){return this._rank}get joinedAt(){return this._joinedAt}}class LC{flush(){return this._groupId=0,this._groupTitle=null,this._roomId=0,this._badge=null,this._totalMembersCount=0,this._result=[],this._admin=!1,this._pageSize=0,this._pageIndex=0,this._level=0,this._query=null,!0}parse(t){if(!t)return!1;this._groupId=t.readInt(),this._groupTitle=t.readString(),this._roomId=t.readInt(),this._badge=t.readString(),this._totalMembersCount=t.readInt();let e=t.readInt();for(;e>0;)this._result.push(new DC(t)),e--;return this._admin=t.readBoolean(),this._pageSize=t.readInt(),this._pageIndex=t.readInt(),this._level=t.readInt(),this._query=t.readString(),!0}get groupId(){return this._groupId}get groupTitle(){return this._groupTitle}get roomId(){return this._roomId}get badge(){return this._badge}get totalMembersCount(){return this._totalMembersCount}get result(){return this._result}get admin(){return this._admin}get pageSize(){return this._pageSize}get pageIndex(){return this._pageIndex}get level(){return this._level}get query(){return this._query}}class PC{flush(){return this._roomId=0,this._groupId=0,!0}parse(t){return t?(this._roomId=t.readInt(),this._groupId=t.readInt(),!0):!1}get roomId(){return this._roomId}get guildId(){return this._groupId}}class UC{flush(){return this._roomId=0,this._roomName=null,this._id=0,this._title=null,this._description=null,this._colorA=0,this._colorB=0,this._state=0,this._canMembersDecorate=!1,this._badgeParts=new Map,this._badgeCode=null,this._membersCount=0,!0}parse(t){if(!t)return!1;t.readInt()===1&&(this._roomId=t.readInt(),this._roomName=t.readString(),t.readBoolean()),t.readBoolean(),this._id=t.readInt(),this._title=t.readString(),this._description=t.readString(),t.readInt(),this._colorA=t.readInt(),this._colorB=t.readInt(),this._state=t.readInt(),this._canMembersDecorate=t.readInt()===0,t.readBoolean(),t.readString();const s=t.readInt();for(let i=0;i<s;i++){const r=new NC(i===0);r.key=t.readInt(),r.color=t.readInt(),r.position=t.readInt(),r.key===0&&(r.position=4),this._badgeParts.set(i,r)}return this._badgeCode=t.readString(),this._membersCount=t.readInt(),!0}get roomId(){return this._roomId}get roomName(){return this._roomName}get id(){return this._id}get title(){return this._title}get description(){return this._description}get colorA(){return this._colorA}get colorB(){return this._colorB}get state(){return this._state}get canMembersDecorate(){return this._canMembersDecorate}get badgeParts(){return this._badgeParts}get badgeCode(){return this._badgeCode}get membersCount(){return this._membersCount}}class yC{flush(){return!0}parse(t){return this._groupId=t.readInt(),!0}get groupId(){return this._groupId}}class Qa{static parse(t){return this.fillFromMessage(new Qa,t)}static fillFromMessage(t,e){return t._groupId=e.readInt(),t._name=e.readString(),t._description=e.readString(),t._icon=e.readString(),t._totalThreads=e.readInt(),t._leaderboardScore=e.readInt(),t._totalMessages=e.readInt(),t._unreadMessages=e.readInt(),t._lastMessageId=e.readInt(),t._lastMessageAuthorId=e.readInt(),t._lastMessageAuthorName=e.readString(),t._lastMessageTimeAsSecondsAgo=e.readInt(),t}get groupId(){return this._groupId}get name(){return this._name}get description(){return this._description}get icon(){return this._icon}get totalThreads(){return this._totalThreads}get leaderboardScore(){return this._leaderboardScore}get totalMessages(){return this._totalMessages}get unreadMessages(){return this._unreadMessages}get lastMessageId(){return this._lastMessageId}get lastMessageAuthorId(){return this._lastMessageAuthorId}get lastMessageAuthorName(){return this._lastMessageAuthorName}get lastMessageTimeAsSecondsAgo(){return this._lastMessageTimeAsSecondsAgo}updateFrom(t){this._totalThreads=t._totalThreads,this._totalMessages=t._totalMessages,this._unreadMessages=t._unreadMessages,this._lastMessageAuthorId=t._lastMessageAuthorId,this._lastMessageAuthorName=t._lastMessageAuthorName,this._lastMessageId=t._lastMessageId,this._lastMessageTimeAsSecondsAgo=t._lastMessageTimeAsSecondsAgo}get lastReadMessageId(){return this._totalMessages-this._unreadMessages}set lastReadMessageId(t){this._unreadMessages=this._totalMessages-t,this._unreadMessages<0&&(this._unreadMessages=0)}addNewThread(t){this._lastMessageAuthorId=t.lastUserId,this._lastMessageAuthorName=t.lastUserName,this._lastMessageId=t.lastMessageId,this._lastMessageTimeAsSecondsAgo=t.lastCommentTime,this._totalThreads++,this._totalMessages++,this._unreadMessages=0}}class Hd extends Qa{static parse(t){const e=new Hd;return Qa.fillFromMessage(e,t),e._readPermissions=t.readInt(),e._postMessagePermissions=t.readInt(),e._postThreadPermissions=t.readInt(),e._moderatePermissions=t.readInt(),e._readPermissionError=t.readString(),e._postMessagePermissionError=t.readString(),e._postThreadPermissionError=t.readString(),e._moderatePermissionError=t.readString(),e._reportPermissionError=t.readString(),e._canChangeSettings=t.readBoolean(),e._isStaff=t.readBoolean(),e}get readPermissions(){return this._readPermissions}get postMessagePermissions(){return this._postMessagePermissions}get postThreadPermissions(){return this._postThreadPermissions}get moderatePermissions(){return this._moderatePermissions}get hasReadPermissionError(){return this._readPermissionError.length===0}get canReport(){return!0}get hasPostMessagePermissionError(){return this._postMessagePermissionError.length===0}get hasPostThreadPermissionError(){return this._postThreadPermissionError.length===0}get hasModeratePermissionError(){return this._moderatePermissionError.length===0}get canChangeSettings(){return this._canChangeSettings}get isStaf(){return this._isStaff}get readPermissionError(){return this._readPermissionError}get postMessagePermissionError(){return this._postMessagePermissionError}get postThreadPermissionError(){return this._postThreadPermissionError}get moderatePermissionError(){return this._moderatePermissionError}get reportPermissionError(){return this._reportPermissionError}}class vC{flush(){return this._extendedForumData=null,!0}parse(t){return t?(this._extendedForumData=Hd.parse(t),!0):!1}get extendedForumData(){return this._extendedForumData}}class bC{flush(){return this._listCode=-1,this._totalAmount=0,this._startIndex=-1,this._amount=0,this._forums=[],!0}parse(t){if(!t)return!1;this._listCode=t.readInt(),this._totalAmount=t.readInt(),this._startIndex=t.readInt(),this._amount=t.readInt(),this._forums=[];let e=0;for(;e<this._amount;)this._forums.push(Qa.parse(t)),e++;return!0}get listCode(){return this._listCode}get totalAmount(){return this._totalAmount}get startIndex(){return this._startIndex}get amount(){return this._amount}get forums(){return this._forums}}class io{static parse(t){const e=new io;return e._threadId=t.readInt(),e._authorId=t.readInt(),e._authorName=t.readString(),e._header=t.readString(),e._isPinned=t.readBoolean(),e._isLocked=t.readBoolean(),e._creationTimeAsSecondsAgo=t.readInt(),e._totalMessages=t.readInt(),e._unreadMessagesCount=t.readInt(),e._lastMessageId=t.readInt(),e._lastUserId=t.readInt(),e._lastUserName=t.readString(),e._lastCommentTime=t.readInt(),e._state=t.readByte(),e._adminId=t.readInt(),e._adminName=t.readString(),e._adminOperationTimeAsSecondsAgo=t.readInt(),e}get adminOperationTimeAsSecondsAgo(){return this._adminOperationTimeAsSecondsAgo}set adminOperationTimeAsSecondsAgo(t){this._adminOperationTimeAsSecondsAgo=t}get lastCommentTime(){return this._lastCommentTime}set lastCommentTime(t){this._lastCommentTime=t}get threadId(){return this._threadId}set threadId(t){this._threadId=t}get authorId(){return this._authorId}set authorId(t){this._authorId=t}get authorName(){return this._authorName}set authorName(t){this._authorName=t}get creationTimeAsSecondsAgo(){return this._creationTimeAsSecondsAgo}set creationTimeAsSecondsAgo(t){this._creationTimeAsSecondsAgo=t}get header(){return this._header}set header(t){this._header=t}get lastMessageId(){return this._lastMessageId}set lastMessageId(t){this._lastMessageId=t}get lastUserId(){return this._lastUserId}set lastUserId(t){this._lastUserId=t}get lastUserName(){return this._lastUserName}set lastUserName(t){this._lastUserName=t}get totalMessages(){return this._totalMessages}set totalMessages(t){this._totalMessages=t}get unreadMessagesCount(){return this._unreadMessagesCount}set unreadMessagesCount(t){this._unreadMessagesCount=t}get state(){return this._state}set state(t){this._state=t}get adminId(){return this._adminId}set adminId(t){this._adminId=t}get adminName(){return this._adminName}set adminName(t){this._adminName=t}get isPinned(){return this._isPinned}set isPinned(t){this._isPinned=t}get isLocked(){return this._isLocked}set isLocked(t){this._isLocked=t}}class FC{flush(){return this._groupId=-1,this._startIndex=-1,this._amount=0,this._threads=[],!0}parse(t){if(!t)return!1;this._groupId=t.readInt(),this._startIndex=t.readInt(),this._amount=t.readInt(),this._threads=[];let e=0;for(;e<this._amount;)this._threads.push(io.parse(t)),e++;return!0}get groupId(){return this._groupId}get startIndex(){return this._startIndex}get amount(){return this._amount}get threads(){return this._threads}}class ro{static parse(t){const e=new ro;return e._messageId=t.readInt(),e._messageIndex=t.readInt(),e._authorId=t.readInt(),e._authorName=t.readString(),e._authorFigure=t.readString(),e._creationTime=t.readInt(),e._messageText=t.readString(),e._state=t.readByte(),e._adminId=t.readInt(),e._adminName=t.readString(),e._adminOperationTimeAsSeccondsAgo=t.readInt(),e._authorPostCount=t.readInt(),e}get state(){return this._state}set state(t){this._state=t}get adminId(){return this._adminId}set adminId(t){this._adminId=t}get adminName(){return this._adminName}set adminName(t){this._adminName=t}get adminOperationTimeAsSeccondsAgo(){return this._adminOperationTimeAsSeccondsAgo}set adminOperationTimeAsSeccondsAgo(t){this._adminOperationTimeAsSeccondsAgo=t}get messageId(){return this._messageId}set messageId(t){this._messageId=t}get creationTime(){return this._creationTime}set creationTime(t){this._creationTime=t}get authorName(){return this._authorName}set authorName(t){this._authorName=t}get authorFigure(){return this._authorFigure}set authorFigure(t){this._authorFigure=t}get threadId(){return this._threadId}set threadId(t){this._threadId=t}get messageIndex(){return this._messageIndex}set messageIndex(t){this._messageIndex=t}set groupID(t){this._groupId=t}get groupId(){return this._groupId}get authorId(){return this._authorId}set authorId(t){this._authorId=t}get messageText(){return this._messageText}set messageText(t){this._messageText=t}get authorPostCount(){return this._authorPostCount}set authorPostCount(t){this._authorPostCount=t}}class xC{flush(){return this._groupId=-1,this._threadId=-1,this._message=null,!0}parse(t){return t?(this._groupId=t.readInt(),this._threadId=t.readInt(),this._message=ro.parse(t),!0):!1}get groupId(){return this._groupId}get threadId(){return this._threadId}get message(){return this._message}}class GC{flush(){return this._groupId=-1,this._thread=null,!0}parse(t){return t?(this._groupId=t.readInt(),this._thread=io.parse(t),!0):!1}get groupId(){return this._groupId}get thread(){return this._thread}}class BC{flush(){return this._groupId=-1,this._threadId=-1,this._startIndex=-1,this._amount=0,this._messages=[],!0}parse(t){if(!t)return!1;this._groupId=t.readInt(),this._threadId=t.readInt(),this._startIndex=t.readInt(),this._amount=t.readInt(),this._messages=[];let e=0;for(;e<this._amount;){const s=ro.parse(t);s.groupID=this._groupId,s.threadId=this._threadId,this._messages.push(s),e++}return!0}get groupId(){return this._groupId}get threadId(){return this._threadId}get startIndex(){return this._startIndex}get amount(){return this._amount}get messages(){return this._messages}}class wC{flush(){return this._count=0,!0}parse(t){return t?(this._count=t.readInt(),!0):!1}get count(){return this._count}}class VC{flush(){return this._groupId=-1,this._threadId=-1,this._message=null,!0}parse(t){return t?(this._groupId=t.readInt(),this._threadId=t.readInt(),this._message=ro.parse(t),!0):!1}get groupId(){return this._groupId}get threadId(){return this._threadId}get message(){return this._message}}class YC{flush(){return this._groupId=-1,this._thread=null,!0}parse(t){return t?(this._groupId=t.readInt(),this._thread=io.parse(t),!0):!1}get groupId(){return this._groupId}get thread(){return this._thread}}class HC{constructor(){this._encryptedPublicKey=null,this._serverClientEncryption=!1}flush(){return!0}parse(t){return t?(this._encryptedPublicKey=t.readString(),t.bytesAvailable&&(this._serverClientEncryption=t.readBoolean()),!0):!1}get encryptedPublicKey(){return this._encryptedPublicKey}get serverClientEncryption(){return this._serverClientEncryption}}class jC{flush(){return this._reason=-1,!0}parse(t){return t?(this._reason=0,t.bytesAvailable&&(this._reason=t.readInt()),!0):!1}get reason(){return this._reason}}class zC{flush(){return this._accounts&&(this._accounts=new Map),!0}parse(t){if(!t)return!1;this._accounts=new Map;let e=t.readInt();for(;e>0;)this._accounts.set(t.readInt(),t.readString()),e--;return!0}get accounts(){return this._accounts}}class WC{flush(){return!0}parse(t){return t?(this._encryptedPrime=t.readString(),this._encryptedGenerator=t.readString(),!0):!1}get encryptedPrime(){return this._encryptedPrime}get encryptedGenerator(){return this._encryptedGenerator}}class kC{flush(){return this._noobnessLevel=0,!0}parse(t){return t?(this._noobnessLevel=t.readInt(),!0):!1}get noobnessLevel(){return this._noobnessLevel}}class KC{flush(){return!0}parse(t){return t?(this._infoUrl=t.readString(),!0):!1}get infoUrl(){return this._infoUrl}}class XC{flush(){return!0}parse(t){return!0}}class qC{flush(){return this._calls=[],!0}parse(t){this._calls=[];const e=t.readInt();for(let s=0;s<e;s++){const i=t.readString(),r=t.readString(),a=t.readString();this._calls.push({callId:i,timeStamp:r,message:a})}return!0}get pendingCalls(){return this._calls}get count(){return this._calls.length}}class QC{flush(){return this._message=null,!0}parse(t){return this._message=t.readString(),!0}get message(){return this._message}}class JC{flush(){return this._resultType=0,this._messageText=null,!0}parse(t){return t?(this._resultType=t.readInt(),this._messageText=t.readString(),!0):!1}get resultType(){return this._resultType}get messageText(){return this._messageText}}class ZC{flush(){return!0}parse(t){return!0}}class $C{flush(){return this._acceptanceTimeout=-1,!0}parse(t){return this._acceptanceTimeout=t.readInt(),!0}get acceptanceTimeout(){return this._acceptanceTimeout}}class tM{flush(){return this._winningVoteCode=-1,this._ownVoteCode=-1,this._finalStatus=null,!0}parse(t){this._finalStatus=[],this._winningVoteCode=t.readInt(),this._ownVoteCode=t.readInt();const e=t.readInt();for(let s=0;s<e;s++)this._finalStatus.push(t.readInt());return!0}get winningVoteCode(){return this._winningVoteCode}get ownVoteCode(){return this._ownVoteCode}get finalStatus(){return this._finalStatus}}class eM{flush(){return!0}parse(t){return this._votingTimeout=t.readInt(),this._chatRecord=t.readString(),!0}get votingTimeout(){return this._votingTimeout}get chatRecord(){return this._chatRecord}}const Bi=class Bi{flush(){return this._status=null,!0}parse(t){this._status=[];const e=t.readInt();for(let s=0;s<e;s++)this._status.push(t.readInt());return!0}get status(){return this._status}};Bi.AWAITING_VOTE=0,Bi.VOTED_OK=1,Bi.VOTED_BAD=2,Bi.VOTED_VERY_BAD=3,Bi.NO_VOTE=4,Bi.FINDING_NEW_VOTER=5;let Pc=Bi;class sM{flush(){return this._onDuty=!1,this._guidesOnDuty=0,this._helpersOnDuty=0,this._guardiansOnDuty=0,!0}parse(t){return t?(this._onDuty=t.readBoolean(),this._guidesOnDuty=t.readInt(),this._helpersOnDuty=t.readInt(),this._guardiansOnDuty=t.readInt(),!0):!1}get onDuty(){return this._onDuty}get guidesOnDuty(){return this._guidesOnDuty}get helpersOnDuty(){return this._helpersOnDuty}get guardiansOnDuty(){return this._guardiansOnDuty}}class iM{constructor(t,e,s,i,r,a,o){this._type=t,this._secondsAgo=e,this._isGuide=s,this._otherPartyName=i,this._otherPartyFigure=r,this._description=a,this._roomName=o}get type(){return this._type}set type(t){this._type=t}get secondsAgo(){return this._secondsAgo}set secondsAgo(t){this._secondsAgo=t}get isGuide(){return this._isGuide}set isGuide(t){this._isGuide=t}get otherPartyName(){return this._otherPartyName}set otherPartyName(t){this._otherPartyName=t}get otherPartyFigure(){return this._otherPartyFigure}set otherPartyFigure(t){this._otherPartyFigure=t}get description(){return this._description}set description(t){this._description=t}get roomName(){return this._roomName}set roomName(t){this._roomName=t}}const Mn=class Mn{flush(){return this._statusCode=0,this._pendingTicket=null,!0}parse(t){return t?(this._statusCode=t.readInt(),this._pendingTicket=new iM(t.readInt(),t.readInt(),t.readBoolean(),t.readString(),t.readString(),t.readString(),t.readString()),!0):!1}get statusCode(){return this._statusCode}get pendingTicket(){return this._pendingTicket}};Mn.GUIDE_REPORTING_STATUS_OK=0,Mn.GUIDE_REPORTING_STATUS_PENDING_TICKET=1,Mn.GUIDE_REPORTING_STATUS_ABUSIVE=2,Mn.GUIDE_REPORTING_STATUS_REPORTING_TOO_QUICKLY=3;let Uc=Mn;class rM{flush(){return this._asGuide=!1,this._helpRequestType=0,this._helpRequestDescription=null,this._roleSpecificWaitTime=0,!0}parse(t){return t?(this._asGuide=t.readBoolean(),this._helpRequestType=t.readInt(),this._helpRequestDescription=t.readString(),this._roleSpecificWaitTime=t.readInt(),!0):!1}get asGuide(){return this._asGuide}get helpRequestType(){return this._helpRequestType}get helpRequestDescription(){return this._helpRequestDescription}get roleSpecificWaitTime(){return this._roleSpecificWaitTime}}class nM{flush(){return!0}parse(t){return!!t}}class aM{flush(){return this._endReason=0,!0}parse(t){return t?(this._endReason=t.readInt(),!0):!1}get endReason(){return this._endReason}}const Ar=class Ar{flush(){return this._errorCode=0,!0}parse(t){return t?(this._errorCode=t.readInt(),!0):!1}get errorCode(){return this._errorCode}};Ar.ERROR_GENERIC=0,Ar.ERROR_GUIDES_REJECT=1,Ar.ERROR_NOT_ENOUGH_GUIDES=2,Ar.ERROR_NOT_ENOUGH_VOTES=3,Ar.ERROR_NO_CHATLOG_FOUND=4;let yc=Ar;class oM{flush(){return this._roomId=0,this._roomName=null,!0}parse(t){return t?(this._roomId=t.readInt(),this._roomName=t.readString(),!0):!1}get roomId(){return this._roomId}get roomName(){return this._roomName}}class hM{flush(){return this._chatMessage=null,this._senderId=0,!0}parse(t){return t?(this._chatMessage=t.readString(),this._senderId=t.readInt(),!0):!1}get chatMessage(){return this._chatMessage}get senderId(){return this._senderId}}class _M{flush(){return this._isTyping=!1,!0}parse(t){return t?(this._isTyping=t.readBoolean(),!0):!1}get isTyping(){return this._isTyping}}class lM{flush(){return this._requesterRoomId=0,!0}parse(t){return t?(this._requesterRoomId=t.readInt(),!0):!1}get requesterRoomId(){return this._requesterRoomId}}class cM{flush(){return this._requesterUserId=0,this._requesterName=null,this._requesterFigure=null,this._guideUserId=0,this._guideName=null,this._guideFigure=null,!0}parse(t){return t?(this._requesterUserId=t.readInt(),this._requesterName=t.readString(),this._requesterFigure=t.readString(),this._guideUserId=t.readInt(),this._guideName=t.readString(),this._guideFigure=t.readString(),!0):!1}get requesterUserId(){return this._requesterUserId}get requesterName(){return this._requesterName}get requesterFigure(){return this._requesterFigure}get guideUserId(){return this._guideUserId}get guideName(){return this._guideName}get guideFigure(){return this._guideFigure}}const Nn=class Nn{flush(){return this._result=0,!0}parse(t){return t?(this._result=t.readInt(),!0):!1}get result(){return this._result}};Nn.CREATION_RESULT_OK=0,Nn.CREATION_RESULT_UNABLE_TO_REPORT=1,Nn.CREATION_RESULT_NO_CHATLOG_FOUND=2,Nn.CREATION_RESULT_BULLY_ALREADY_REPORTED=3;let vc=Nn;const Na=class Na{flush(){return this._resolution=0,!0}parse(t){return t?(this._resolution=t.readInt(),!0):!1}get resolution(){return this._resolution}};Na.RESOLUTION_GUARDIANS_TOOK_ACTION=0,Na.RESOLUTION_FORWARDED_TO_MODERATORS=1,Na.RESOLUTION_REPORTER_IS_ABUSIVE=2;let bc=Na;class uM{flush(){return!0}parse(t){return!!t}}class dM{flush(){return this._closeReason=0,this._messageText="",!0}parse(t){return t?(this._closeReason=t.readInt(),this._messageText=t.readString(),!0):!1}get closeReason(){return this._closeReason}get messageText(){return this._messageText}}class EM{flush(){return this._quizCode=null,this._questionIds=[],!0}parse(t){if(!t)return!1;this._quizCode=t.readString();const e=t.readInt();this._questionIds=[];for(let s=0;s<e;s++)this._questionIds.push(t.readInt());return!0}get quizCode(){return this._quizCode}get questionIds(){return this._questionIds}}class gM{flush(){return this._quizCode=null,this._questionIdsForWrongAnswers=[],!0}parse(t){if(!t)return!1;this._quizCode=t.readString();const e=t.readInt();this._questionIdsForWrongAnswers=[];for(let s=0;s<e;s++)this._questionIdsForWrongAnswers.push(t.readInt());return!0}get quizCode(){return this._quizCode}get questionIdsForWrongAnswers(){return this._questionIdsForWrongAnswers}}const Da=class Da{constructor(t){this._id=t.readInt(),this._title=t.readString(),this._bodyText=t.readString(),this._buttonText=t.readString(),this._linkType=t.readInt(),this._linkContent=t.readString(),this._imageUrl=t.readString()}get id(){return this._id}get title(){return this._title}get bodyText(){return this._bodyText}get buttonText(){return this._buttonText}get linkType(){return this._linkType}get linkContent(){return this._linkContent}get imageUrl(){return this._imageUrl}};Da.LINK_TYPE_URL=0,Da.LINK_TYPE_INTERNAL=1,Da.LINK_TYPE_NO_LINK=2;let Fc=Da;class fM{flush(){return this._articles=[],!0}parse(t){if(!t)return!1;const e=t.readInt();for(let s=0;s<e;s++)this._articles.push(new Fc(t));return!0}get articles(){return this._articles}}class IM{flush(){return!0}parse(t){return t?(this._acknowledged=t.readBoolean(),!0):!1}get acknowledged(){return this._acknowledged}}class TM{flush(){return this._newOfferId=-1,this._newPrice=0,this._requestedOfferId=-1,!0}parse(t){return t?(this._result=t.readInt(),this._newOfferId=t.readInt(),this._newPrice=t.readInt(),this._requestedOfferId=t.readInt(),!0):!1}get result(){return this._result}get offerId(){return this._newOfferId}get newPrice(){return this._newPrice}get requestedOfferId(){return this._requestedOfferId}}class mM{flush(){return this._offerId=0,this._success=!1,!0}parse(t){return t?(this._offerId=t.readInt(),this._success=t.readBoolean(),!0):!1}get offerId(){return this._offerId}get success(){return this._success}}class pM{flush(){return this._tokenCount=0,this._result=0,!0}parse(t){return t?(this._result=t.readInt(),this._tokenCount=t.readInt(),!0):!1}get tokenCount(){return this._tokenCount}get resultCode(){return this._result}}class RM{flush(){return this._enabled=!1,this._commission=0,this._credits=0,this._advertisements=0,this._maximumPrice=0,this._minimumPrice=0,this._offerTime=0,this._displayTime=0,!0}parse(t){return t?(this._enabled=t.readBoolean(),this._commission=t.readInt(),this._credits=t.readInt(),this._advertisements=t.readInt(),this._minimumPrice=t.readInt(),this._maximumPrice=t.readInt(),this._offerTime=t.readInt(),this._displayTime=t.readInt(),!0):!1}get enabled(){return this._enabled}get commission(){return this._commission}get credits(){return this._credits}get advertisements(){return this._advertisements}get minimumPrice(){return this._minimumPrice}get maximumPrice(){return this._maximumPrice}get offerTime(){return this._offerTime}get displayTime(){return this._displayTime}}class OM{flush(){return this._result=0,!0}parse(t){return t?(this._result=t.readInt(),!0):!1}get result(){return this._result}}class AM{flush(){return this._averagePrice=0,this._currentOfferCount=0,this._historyLength=0,this._dayOffsets=[],this._averagePrices=[],this._soldAmounts=[],this._furniTypeId=0,this._furniCategoryId=0,!0}parse(t){if(!t)return!1;this._averagePrice=t.readInt(),this._currentOfferCount=t.readInt(),this._historyLength=t.readInt();let e=t.readInt();for(;e>0;)this._dayOffsets.push(t.readInt()),this._averagePrices.push(t.readInt()),this._soldAmounts.push(t.readInt()),e--;return this._furniCategoryId=t.readInt(),this._furniTypeId=t.readInt(),!0}get averagePrice(){return this._averagePrice}get offerCount(){return this._currentOfferCount}get historyLength(){return this._historyLength}get dayOffsets(){return this._dayOffsets}get averagePrices(){return this._averagePrices}get soldAmounts(){return this._soldAmounts}get furniTypeId(){return this._furniTypeId}get furniCategoryId(){return this._furniCategoryId}}class Lg{constructor(t,e,s,i,r,a,o,h,_,l=-1){this._timeLeftMinutes=-1,this._offerId=t,this._furniId=e,this._furniType=s,this._extraData=i,this._stuffData=r,this._price=a,this._status=o,this._timeLeftMinutes=h,this._averagePrice=_,this._offerCount=l}get offerId(){return this._offerId}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}get status(){return this._status}get timeLeftMinutes(){return this._timeLeftMinutes}get averagePrice(){return this._averagePrice}get offerCount(){return this._offerCount}get isUniqueLimitedItem(){return this.stuffData!=null&&this.stuffData.uniqueSeries>0}}const ai=class ai{constructor(){this.MAX_LIST_LENGTH=500}flush(){return this._offers=[],this._totalItemsFound=0,!0}parse(t){if(!t)return!1;const e=t.readInt();let s=0;for(;s<e;){const i=t.readInt(),r=t.readInt();let a=t.readInt(),o=-1,h="",_=null;a===ai.FURNITYPE_STUFF?(o=t.readInt(),_=rr.parseObjectData(t)):a===ai.FURNITYPE_WALL?(o=t.readInt(),h=t.readString()):a==ai.FAKE_FURNITYPE_UNIQUE&&(o=t.readInt(),_=Xi.getData(Ne.FORMAT_KEY),_.uniqueNumber=t.readInt(),_.uniqueSeries=t.readInt(),a=ai.FURNITYPE_STUFF);const l=t.readInt(),c=t.readInt(),f=t.readInt(),p=t.readInt(),m=new Lg(i,o,a,h,_,l,r,c,f,p);s<this.MAX_LIST_LENGTH&&this._offers.push(m),s++}return this._totalItemsFound=t.readInt(),!0}get offers(){return this._offers}get totalItemsFound(){return this._totalItemsFound}};ai.FURNITYPE_STUFF=1,ai.FURNITYPE_WALL=2,ai.FAKE_FURNITYPE_UNIQUE=3;let xc=ai;const A_=class A_{flush(){return this._offers=[],!0}parse(t){if(!t)return!1;this._offers=[],this._creditsWaiting=t.readInt();const e=t.readInt();for(let s=0;s<e;s++){const i=t.readInt(),r=t.readInt();let a=t.readInt(),o,h,_;a==1?(o=t.readInt(),_=this.getStuffData(t)):a==2?(o=t.readInt(),h=t.readString()):a==3&&(o=t.readInt(),_=Xi.getData(Ne.FORMAT_KEY),_.uniqueNumber=t.readInt(),_.uniqueSeries=t.readInt(),a=1);const l=t.readInt(),c=t.readInt(),f=t.readInt(),p=new Lg(i,o,a,h,_,l,r,c,f);s<A_.MAX_LIST_LENGTH&&this._offers.push(p)}return!0}get offers(){return this._offers}get creditsWaiting(){return this._creditsWaiting}getStuffData(t){const e=t.readInt(),s=Xi.getData(e);return s.parseWrapper(t),s}};A_.MAX_LIST_LENGTH=500;let Gc=A_;class SM{constructor(t,e,s,i,r){this._timestamp=t,this._habboId=e,this._username=s,this._message=i,this._hasHighlighting=r}get timestamp(){return this._timestamp}get userId(){return this._habboId}get userName(){return this._username}get message(){return this._message}get hasHighlighting(){return this._hasHighlighting}}const oi=class oi{constructor(t){this._context=new Map,this._chatlog=[],this._recordType=t.readByte();const e=t.readShort();for(let i=0;i<e;i++){const r=t.readString(),a=t.readByte();switch(a){case 0:this._context.set(r,t.readBoolean());break;case 1:this._context.set(r,t.readInt());break;case 2:this._context.set(r,t.readString());break;default:throw new Error("Unknown data type "+a)}}const s=t.readShort();for(let i=0;i<s;i++){const r=t.readString(),a=t.readInt(),o=t.readString(),h=t.readString(),_=t.readBoolean();this._chatlog.push(new SM(r,a,o,h,_))}}get recordType(){return this._recordType}get context(){return this._context}get chatlog(){return this._chatlog}get roomId(){return this.getInt("roomId")}get roomName(){return this._context.get("roomName")}get groupId(){return this.getInt("groupId")}get threadId(){return this.getInt("threadId")}get messageId(){return this.getInt("messageId")}getInt(t){const e=this._context.get(t);return e||0}};oi.TYPE_SIMPLE=0,oi.TYPE_ROOM_CHAT=1,oi.TYPE_IM_SESSION=2,oi.TYPE_DISCUSSION_THREAD=3,oi.TYPE_DISCUSSION_MESSAGE=4,oi.TYPE_SELFIE=5,oi.TYPE_PHOTO=6;let Ja=oi;class CM{constructor(t){this._issueId=t.readInt(),this._callerUserId=t.readInt(),this._reportedUserId=t.readInt(),this._chatRecordId=t.readInt(),this._chatRecord=new Ja(t)}get issueId(){return this._issueId}get callerUserId(){return this._callerUserId}get reportedUserId(){return this._reportedUserId}get chatRecordId(){return this._chatRecordId}get chatRecord(){return this._chatRecord}}class MM{flush(){return this._data=null,!0}parse(t){return t?(this._data=new CM(t),!0):!1}get data(){return this._data}}class NM{flush(){return!0}parse(t){return this._issueId=parseInt(t.readString()),!0}get issueId(){return this._issueId}}const La=class La{constructor(t,e,s,i,r,a,o,h,_,l,c,f,p,m,O,A){this._disposed=!1,this._issueId=t,this._state=e,this._categoryId=s,this._reportedCategoryId=i,this._issueAgeInMilliseconds=r,this._priority=a,this._groupingId=o,this._reporterUserId=h,this._reporterUserName=_,this._reportedUserId=l,this._reportedUserName=c,this._pickerUserId=f,this._pickerUserName=p,this._message=m,this._chatRecordId=O,this._patterns=A,this._creationTimeInMilliseconds=nt()}get issueId(){return this._issueId}get state(){return this._state}get categoryId(){return this._categoryId}get reportedCategoryId(){return this._reportedCategoryId}get issueAgeInMilliseconds(){return this._issueAgeInMilliseconds}get priority(){return this._priority}get groupingId(){return this._groupingId}get reporterUserId(){return this._reporterUserId}get reporterUserName(){return this._reporterUserName}get reportedUserId(){return this._reportedUserId}get reportedUserName(){return this._reportedUserName}get pickerUserId(){return this._pickerUserId}get pickerUserName(){return this._pickerUserName}get message(){return this._message}get chatRecordId(){return this._chatRecordId}get patterns(){return this._patterns}dispose(){if(!this.disposed){for(const t of this._patterns)t.dispose();this._patterns=[],this._disposed=!0}}get disposed(){return this._disposed}getOpenTime(t){const s=(this._issueAgeInMilliseconds+t-this._creationTimeInMilliseconds)/1e3/60,i=s%60,r=s/60,a=(i<10?"0":"")+i;return(r<10?"0":"")+r+":"+a}};La.STATE_OPEN=1,La.STATE_PICKED=2,La.STATE_CLOSED=3;let Yo=La;class DM{constructor(t){this._disposed=!1,this._pattern=t.readString(),this._startIndex=t.readInt(),this._endIndex=t.readInt()}dispose(){this._disposed=!0,this._pattern="",this._startIndex=-1,this._endIndex=-1}get disposed(){return this._disposed}get pattern(){return this._pattern}get startIndex(){return this._startIndex}get endIndex(){return this._endIndex}}class Pg{get issueData(){return this._issueData}flush(){return this._issueData=null,!0}parse(t){const e=t.readInt(),s=t.readInt(),i=t.readInt(),r=t.readInt(),a=t.readInt(),o=t.readInt(),h=t.readInt(),_=t.readInt(),l=t.readString(),c=t.readInt(),f=t.readString(),p=t.readInt(),m=t.readString(),O=t.readString(),A=t.readInt(),C=t.readInt(),L=[];for(let D=0;D<C;D++)L.push(new DM(t));return this._issueData=new Yo(e,s,i,r,a,o,h,_,l,c,f,p,m,O,A,L),!0}}class LM{flush(){return this._issues=null,!0}parse(t){this._issues=[];const e=t.readInt();for(let s=0;s<e;s++){const i=t.readInt(),r=t.readInt(),a=t.readString(),o=new Yo(i,0,0,0,0,0,0,0,null,0,null,r,a,null,0,[]);this._issues.push(o)}return this._retryEnabled=t.readBoolean(),this._retryCount=t.readInt(),!0}get issues(){return this._issues}get retryEnabled(){return this._retryEnabled}get retryCount(){return this._retryCount}}class PM{flush(){return this._message="",this._url=null,!0}parse(t){return t?(this._message=t.readString(),this._url=t.readString(),!0):!1}get message(){return this._message}get url(){return this._url}}class UM{flush(){return this._userId=-1,this._success=!1,!0}parse(t){return this._userId=t.readInt(),this._success=t.readBoolean(),!0}get userId(){return this._userId}get success(){return this._success}}class yM{constructor(t){this._disposed=!1;const e=new Pg;this._issues=[],this._messageTemplates=[],this._roomMessageTemplates=[];let s=t.readInt(),i=0;for(;i<s;)e.parse(t)&&this._issues.push(e.issueData),i++;for(s=t.readInt(),i=0;i<s;)this._messageTemplates.push(t.readString()),i++;for(s=t.readInt(),i=0;i<s;)t.readString(),i++;for(this._cfhPermission=t.readBoolean(),this._chatlogsPermission=t.readBoolean(),this._alertPermission=t.readBoolean(),this._kickPermission=t.readBoolean(),this._banPermission=t.readBoolean(),this._roomAlertPermission=t.readBoolean(),this._roomKickPermission=t.readBoolean(),s=t.readInt(),i=0;i<s;)this._roomMessageTemplates.push(t.readString()),i++}dispose(){this._disposed||(this._disposed=!0,this._messageTemplates=null,this._roomMessageTemplates=null,this._issues=null)}get disposed(){return this._disposed}get messageTemplates(){return this._messageTemplates}get roomMessageTemplates(){return this._roomMessageTemplates}get issues(){return this._issues}get cfhPermission(){return this._cfhPermission}get chatlogsPermission(){return this._chatlogsPermission}get alertPermission(){return this._alertPermission}get kickPermission(){return this._kickPermission}get banPermission(){return this._banPermission}get roomAlertPermission(){return this._roomAlertPermission}get roomKickPermission(){return this._roomKickPermission}}class vM{constructor(){this._data=null}flush(){return this._data=null,!0}parse(t){return this._data=new yM(t),!0}get data(){return this._data}}class bM{flush(){return this._message="",this._url="",!0}parse(t){return t?(this._message=t.readString(),this._url=t.readString(),!0):!1}get message(){return this._message}get url(){return this._url}}class FM{constructor(t){if(this._tags=[],this._exists=t.readBoolean(),!this.exists)return;this._name=t.readString(),this._desc=t.readString();const e=t.readInt();for(let s=0;s<e;s++)this._tags.push(t.readString())}get name(){return this._name}get desc(){return this._desc}get tags(){return this._tags}get exists(){return this._exists}get disposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._tags=null)}}class xM{constructor(t){this._flatId=t.readInt(),this._userCount=t.readInt(),this._ownerInRoom=t.readBoolean(),this._ownerId=t.readInt(),this._ownerName=t.readString(),this._room=new FM(t)}get flatId(){return this._flatId}get userCount(){return this._userCount}get ownerInRoom(){return this._ownerInRoom}get ownerId(){return this._ownerId}get ownerName(){return this._ownerName}get room(){return this._room}get disposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._room!=null&&(this._room.dispose(),this._room=null))}}class GM{flush(){return this._data=null,!0}parse(t){return t?(this._data=new xM(t),!0):!1}get data(){return this._data}}class BM{flush(){return this._windowX=0,this._windowY=0,this._windowWidth=0,this._windowHeight=0,!0}parse(t){return this._windowX=t.readInt(),this._windowY=t.readInt(),this._windowWidth=t.readInt(),this._windowHeight=t.readInt(),!0}get windowX(){return this._windowX}get windowY(){return this._windowY}get windowWidth(){return this._windowWidth}get windowHeight(){return this._windowHeight}}class wM{constructor(t){this._lastSanctionTime="",this._sanctionAgeHours=0,this._userId=t.readInt(),this._userName=t.readString(),this._figure=t.readString(),this._registrationAgeInMinutes=t.readInt(),this._minutesSinceLastLogin=t.readInt(),this._online=t.readBoolean(),this._cfhCount=t.readInt(),this._abusiveCfhCount=t.readInt(),this._cautionCount=t.readInt(),this._banCount=t.readInt(),this._tradingLockCount=t.readInt(),this._tradingExpiryDate=t.readString(),this._lastPurchaseDate=t.readString(),this._identityId=t.readInt(),this._identityRelatedBanCount=t.readInt(),this._primaryEmailAddress=t.readString(),this._userClassification=t.readString(),t.bytesAvailable&&(this._lastSanctionTime=t.readString(),this._sanctionAgeHours=t.readInt())}get userId(){return this._userId}get userName(){return this._userName}get figure(){return this._figure}get registrationAgeInMinutes(){return this._registrationAgeInMinutes}get minutesSinceLastLogin(){return this._minutesSinceLastLogin}get online(){return this._online}get cfhCount(){return this._cfhCount}get abusiveCfhCount(){return this._abusiveCfhCount}get cautionCount(){return this._cautionCount}get banCount(){return this._banCount}get tradingLockCount(){return this._tradingLockCount}get tradingExpiryDate(){return this._tradingExpiryDate}get lastPurchaseDate(){return this._lastPurchaseDate}get identityId(){return this._identityId}get identityRelatedBanCount(){return this._identityRelatedBanCount}get primaryEmailAddress(){return this._primaryEmailAddress}get userClassification(){return this._userClassification}get lastSanctionTime(){return this._lastSanctionTime}get sanctionAgeHours(){return this._sanctionAgeHours}}class VM{flush(){return this._data=null,!0}parse(t){return t?(this._data=new wM(t),!0):!1}get data(){return this._data}}class YM{flush(){return this._data=null,!0}parse(t){return t?(this._data=new Ja(t),!0):!1}get data(){return this._data}}class HM{constructor(t){this._roomId=t.readInt(),this._roomName=t.readString(),this._enterHour=t.readInt(),this._enterMinute=t.readInt()}get roomId(){return this._roomId}get roomName(){return this._roomName}get enterHour(){return this._enterHour}get enterMinute(){return this._enterMinute}}class jM{constructor(t){this._rooms=[],this._userId=t.readInt(),this._userName=t.readString();const e=t.readInt();let s=0;for(;s<e;)this._rooms.push(new HM(t)),s++}get userId(){return this._userId}get userName(){return this._userName}get rooms(){return this._rooms}}class zM{flush(){return!0}parse(t){return this._data=new jM(t),!0}get data(){return this._data}}class WM{flush(){return this._message="",!0}parse(t){return t?(this._message=t.readString(),!0):!1}get message(){return this._message}}class kM{constructor(t){this._roomChatlogs=[],this._userId=t.readInt(),this._username=t.readString();const e=t.readInt();for(let s=0;s<e;s++)this._roomChatlogs.push(new Ja(t))}get userId(){return this._userId}get username(){return this._username}get roomChatlogs(){return this._roomChatlogs}}class KM{flush(){return this._data=null,!0}parse(t){return t?(this._data=new kM(t),!0):!1}get data(){return this._data}}class XM{flush(){return!0}parse(t){return!!t}}class qM{flush(){return!0}parse(t){return t?(this._contentType=t.readString(),this._classId=t.readInt(),!0):!1}get contentType(){return this._contentType}get classId(){return this._classId}}class QM{flush(){return this._boxColor=null,this._keyColor=null,!0}parse(t){return t?(this._boxColor=t.readString(),this._keyColor=t.readString(),!0):!1}get boxColor(){return this._boxColor}get keyColor(){return this._keyColor}}class JM{flush(){return!0}parse(t){return!!t}}class ZM{flush(){return this._canCreate=!1,this._errorCode=0,!0}parse(t){return t?(this._canCreate=t.readBoolean(),this._errorCode=t.readInt(),!0):!1}get canCreate(){return this._canCreate}get errorCode(){return this._errorCode}}const S_=class S_{flush(){return!0}parse(t){return t?(this._resultCode=t.readInt(),this._roomLimit=t.readInt(),!0):!1}get resultCode(){return this._resultCode}get roomLimit(){return this._roomLimit}};S_.CREATION_ALLOWED=0,S_.ROOM_LIMIT_REACHED=1;let Bc=S_;class $M{constructor(t){this._categoryToCurrentUserCountMap=new Map,this._categoryToMaxUserCountMap=new Map;const e=t.readInt();for(let s=0;s<e;s++){const i=t.readInt(),r=t.readInt(),a=t.readInt();this._categoryToCurrentUserCountMap.set(i,r),this._categoryToMaxUserCountMap.set(i,a)}}get categoryToCurrentUserCountMap(){return this._categoryToCurrentUserCountMap}get categoryToMaxUserCountMap(){return this._categoryToMaxUserCountMap}}class tN{constructor(t,e=0,s=0){this._goalId=e,this._pageIndex=s,t&&(this._goalId=t.readInt(),this._pageIndex=t.readInt(),this._pageCount=t.readInt())}get goalId(){return this._goalId}get pageIndex(){return this._pageIndex}get pageCount(){return this._pageCount}}const hi=class hi{constructor(t){this._index=t.readInt(),this._popupCaption=t.readString(),this._popupDesc=t.readString(),this._showDetails=t.readInt()==1,this._picText=t.readString(),this._picRef=t.readString(),this._folderId=t.readInt(),this._userCount=t.readInt(),this._type=t.readInt(),this._type==hi.TYPE_TAG?this._tag=t.readString():this._type==hi.TYPE_GUEST_ROOM?this._guestRoomData=new Wn(t):this._open=t.readBoolean()}dispose(){this._disposed||(this._disposed=!0,this._guestRoomData!=null&&(this._guestRoomData.flush(),this._guestRoomData=null))}get disposed(){return this._disposed}get type(){return this._type}get index(){return this._index}get popupCaption(){return this._popupCaption}get popupDesc(){return this._popupDesc}get showDetails(){return this._showDetails}get picText(){return this._picText}get picRef(){return this._picRef}get folderId(){return this._folderId}get tag(){return this._tag}get userCount(){return this._userCount}get guestRoomData(){return this._guestRoomData}get open(){return this._open}toggleOpen(){this._open=!this._open}get maxUsers(){return this.type==hi.TYPE_TAG?0:this.type==hi.TYPE_GUEST_ROOM?this._guestRoomData.maxUserCount:0}};hi.TYPE_TAG=1,hi.TYPE_GUEST_ROOM=2,hi.TYPE_FOLDER=4;let wc=hi;class eN{constructor(t){this._rooms=[],this._searchType=t.readInt(),this._searchParam=t.readString();const e=t.readInt();for(let i=0;i<e;i++)this._rooms.push(new Wn(t));t.readBoolean()&&(this._ad=new wc(t))}dispose(){if(!this._disposed){if(this._disposed=!0,this._rooms!=null)for(const t of this._rooms)t.flush();this._ad!=null&&(this._ad.dispose(),this._ad=null),this._rooms=null}}get disposed(){return this._disposed}get searchType(){return this._searchType}get searchParam(){return this._searchParam}get rooms(){return this._rooms}get ad(){return this._ad}}class Ug{constructor(t){if(!t)throw new Error("invalid_wrapper");this.flush(),this.parse(t)}flush(){return this._id=-1,this._code=null,this._filter=null,this._localization=null,!0}parse(t){return t?(this._id=t.readInt(),this._code=t.readString(),this._filter=t.readString(),this._localization=t.readString(),!0):!1}get id(){return this._id}get code(){return this._code}get filter(){return this._filter}get localization(){return this._localization}}class sN{constructor(t){if(!t)throw new Error("invalid_wrapper");this.flush(),this.parse(t)}flush(){return this._code=null,this._data=null,this._action=-1,this._closed=!1,this._mode=-1,this._rooms=[],!0}parse(t){if(!t)return!1;this._code=t.readString(),this._data=t.readString(),this._action=t.readInt(),this._closed=t.readBoolean(),this._mode=t.readInt();let e=t.readInt();for(;e>0;)this._rooms.push(new Wn(t)),e--;return!0}get code(){return this._code}get data(){return this._data}get action(){return this._action}get closed(){return this._closed}get mode(){return this._mode}get rooms(){return this._rooms}}class iN{constructor(t){if(!t)throw new Error("invalid_wrapper");this.flush(),this.parse(t)}flush(){return this._code=null,this._data=null,this._results=[],!0}parse(t){if(!t)return!1;this._code=t.readString(),this._data=t.readString();let e=t.readInt();for(;e>0;)this._results.push(new sN(t)),e--;return!0}get code(){return this._code}get data(){return this._data}get results(){return this._results}}class rN{constructor(t){if(!t)throw new Error("invalid_wrapper");this.flush(),this.parse(t)}flush(){return this._code=null,this._savedSearches=[],!0}parse(t){if(!t)return!1;this._code=t.readString();let e=t.readInt();for(;e>0;)this._savedSearches.push(new Ug(t)),e--;return!0}get code(){return this._code}get savedSearches(){return this._savedSearches}}class nN{constructor(t){this._adId=t.readInt(),this._ownerAvatarId=t.readInt(),this._ownerAvatarName=t.readString(),this._flatId=t.readInt(),this._eventType=t.readInt(),this._eventName=t.readString(),this._eventDescription=t.readString();const e=t.readInt(),s=t.readInt(),i=new Date;let r=i.getTime();const a=e*60*1e3;r=r-a;const o=new Date(r);this._creationTime=o.getDate()+"-"+o.getMonth()+"-"+o.getFullYear()+" "+o.getHours()+":"+o.getMinutes();let h=i.getTime();const _=s*60*1e3;h=h+_,this._expirationDate=new Date(h),this._categoryId=t.readInt()}dispose(){this._disposed||(this._disposed=!0)}get disposed(){return this._disposed}get adId(){return this._adId}get ownerAvatarId(){return this._ownerAvatarId}get ownerAvatarName(){return this._ownerAvatarName}get flatId(){return this._flatId}get categoryId(){return this._categoryId}get eventType(){return this._eventType}get eventName(){return this._eventName}get eventDescription(){return this._eventDescription}get creationTime(){return this._creationTime}get expirationDate(){return this._expirationDate}}class aN{flush(){return!0}parse(t){return t?(this._data=new $M(t),!0):!1}get data(){return this._data}}class oN{flush(){return!0}parse(t){return t?(this._data=new tN(t),!0):!1}get data(){return this._data}}class hN{flush(){return!0}parse(t){return t?(this._globalId=t.readString(),this._convertedId=t.readInt(),!0):!1}get globalId(){return this._globalId}get convertedId(){return this._convertedId}}class _N{flush(){return this._userName=null,!0}parse(t){return t?(this._userName=t.readString(),!0):!1}get userName(){return this._userName}}class lN{flush(){return!0}parse(t){return t?(this._flatId=t.readInt(),this._added=t.readBoolean(),!0):!1}get flatId(){return this._flatId}get added(){return this._added}}class cN{flush(){return!0}parse(t){if(!t)return!1;this._favouriteRoomIds=[],this._limit=t.readInt();const e=t.readInt();for(let s=0;s<e;s++)this._favouriteRoomIds.push(t.readInt());return!0}get limit(){return this._limit}get favoriteRoomIds(){return this._favouriteRoomIds}}class uN{flush(){return this._userName=null,!0}parse(t){return t?(this._userName=t.readString(),!0):!1}get userName(){return this._userName}}class dN{flush(){return this._roomId=-1,this._roomName=null,!0}parse(t){return t?(this._roomId=t.readInt(),this._roomName=t.readString(),!0):!1}get roomId(){return this._roomId}get roomName(){return this._roomName}}class EN{flush(){return this._roomEnter=!1,this._roomForward=!1,this._data=null,this._staffPick=!1,this._isGroupMember=!1,this._moderation=null,this._chat=null,!0}parse(t){return t?(this._roomEnter=t.readBoolean(),this._data=new Wn(t),this._roomForward=t.readBoolean(),this._staffPick=t.readBoolean(),this._isGroupMember=t.readBoolean(),this.data.allInRoomMuted=t.readBoolean(),this._moderation=new Bo(t),this.data.canMute=t.readBoolean(),this._chat=new qa(t),!0):!1}get roomEnter(){return this._roomEnter}get roomForward(){return this._roomForward}get data(){return this._data}get staffPick(){return this._staffPick}get isGroupMember(){return this._isGroupMember}get moderation(){return this._moderation}get chat(){return this._chat}}class gN{flush(){return!0}parse(t){return t?(this._data=new eN(t),!0):!1}get data(){return this._data}}class fN{constructor(t){if(!t)throw new Error("invalid_wrapper");this.flush(),this.parse(t)}flush(){return this._id=-1,this._name=null,this._visible=!1,this._automatic=!1,this._automaticCategoryKey=null,this._globalCategoryKey=null,this._staffOnly=!1,!0}parse(t){return t?(this._id=t.readInt(),this._name=t.readString(),this._visible=t.readBoolean(),this._automatic=t.readBoolean(),this._automaticCategoryKey=t.readString(),this._globalCategoryKey=t.readString(),this._staffOnly=t.readBoolean(),!0):!1}get id(){return this._id}get name(){return this._name}get visible(){return this._visible}get automatic(){return this._automatic}get automaticCategoryKey(){return this._automaticCategoryKey}get globalCategoryKey(){return this._globalCategoryKey}get staffOnly(){return this._staffOnly}}class IN{flush(){return this._categories=[],!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;)this._categories.push(t.readString()),e--;return!0}get categories(){return this._categories}}class TN{constructor(t){if(!t)throw new Error("invalid_wrapper");this.flush(),this.parse(t)}flush(){return this._id=-1,this._name=null,this._visible=!1,!0}parse(t){return t?(this._id=t.readInt(),this._name=t.readString(),this._visible=t.readBoolean(),!0):!1}get id(){return this._id}get name(){return this._name}get visible(){return this._visible}}class mN{flush(){return this._homeRoomId=-1,this._roomIdToEnter=-1,!0}parse(t){return t?(this._homeRoomId=t.readInt(),this._roomIdToEnter=t.readInt(),!0):!1}get homeRoomId(){return this._homeRoomId}get roomIdToEnter(){return this._roomIdToEnter}}class pN{constructor(t){if(!t)throw new Error("invalid_wrapper");this.flush(),this.parse(t)}flush(){return this._roomId=-1,this._areaId=-1,this._image=null,this._caption=null,!0}parse(t){return t?(this._roomId=t.readInt(),this._areaId=t.readInt(),this._image=t.readString(),this._caption=t.readString(),!0):!1}get roomId(){return this._roomId}get areaId(){return this._areaId}get image(){return this._image}get caption(){return this._caption}}class RN{flush(){return this._rooms=[],!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;)this._rooms.push(new pN(t)),e--;return!0}get rooms(){return this._rooms}}class ON{flush(){return this._topLevelContexts=[],!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;)this._topLevelContexts.push(new rN(t)),e--;return!0}get topLevelContexts(){return this._topLevelContexts}}class AN{flush(){return!0}parse(t){return!!t}}class SN{flush(){return this._searches=[],!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;)this._searches.push(new Ug(t)),e--;return!0}get searches(){return this._searches}}class CN{flush(){return this._result=null,!0}parse(t){return t?(this._result=new iN(t),!0):!1}get result(){return this._result}}class MN{flush(){return this._windowX=0,this._windowY=0,this._windowWidth=0,this._windowHeight=0,this._leftPanelHidden=!1,this._resultsMode=0,!0}parse(t){return t?(this._windowX=t.readInt(),this._windowY=t.readInt(),this._windowWidth=t.readInt(),this._windowHeight=t.readInt(),this._leftPanelHidden=t.readBoolean(),this._resultsMode=t.readInt(),!0):!1}get windowX(){return this._windowX}get windowY(){return this._windowY}get windowWidth(){return this._windowWidth}get windowHeight(){return this._windowHeight}get leftPanelHidden(){return this._leftPanelHidden}get resultsMode(){return this._resultsMode}}class NN{constructor(t){this._tagName=t.readString(),this._userCount=t.readInt()}get tagName(){return this._tagName}get userCount(){return this._userCount}}class DN{constructor(t){if(!t)throw new Error("invalid_wrapper");this.flush(),this.parse(t)}flush(){return this._tags=[],!0}parse(t){if(!t)return!1;this._tags=[];const e=t.readInt();let s=0;for(;s<e;)this._tags.push(new NN(t)),s++;return!0}get tags(){return this._tags}}class LN{flush(){return this._data=null,!0}parse(t){return t?(this._data=new DN(t),!0):!1}get data(){return this._data}}class PN{flush(){return!0}parse(t){return!0}}class UN{flush(){return!0}parse(t){return this._data=new nN(t),!0}get data(){return this._data}}class yN{flush(){return this._words=[],!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;)this._words.push(t.readString()),e--;return!0}get words(){return this._words}}class vN{flush(){return this._roomId=0,!0}parse(t){return t?(this._roomId=t.readInt(),!0):!1}get roomId(){return this._roomId}}class bN{flush(){return!0}parse(t){return this._flatId=t.readInt(),this._resultCode=t.readInt(),!0}get flatId(){return this._flatId}get resultCode(){return this._resultCode}}class FN{flush(){return this._categories=[],!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;)this._categories.push(new TN(t)),e--;return!0}get categories(){return this._categories}}class xN{flush(){return this._categories=[],!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;)this._categories.push(new fN(t)),e--;return!0}get categories(){return this._categories}}class GN{constructor(t){this._badgeCode="",this._removedBadgeCode="",this._type=t.readInt(),this._level=t.readInt(),this._badgeId=t.readInt(),this._badgeCode=t.readString(),this._points=t.readInt(),this._levelRewardPoints=t.readInt(),this._levelRewardPointType=t.readInt(),this._bonusPoints=t.readInt(),this._achievementID=t.readInt(),this._removedBadgeCode=t.readString(),this._category=t.readString(),this._showDialogToUser=t.readBoolean()}get type(){return this._type}get level(){return this._level}get points(){return this._points}get levelRewardPoints(){return this._levelRewardPoints}get levelRewardPointType(){return this._levelRewardPointType}get bonusPoints(){return this._bonusPoints}get badgeId(){return this._badgeId}get badgeCode(){return this._badgeCode}get removedBadgeCode(){return this._removedBadgeCode}get achievementID(){return this._achievementID}get category(){return this._category}get showDialogToUser(){return this._showDialogToUser}}class BN{flush(){return this._data=null,!0}parse(t){return t?(this._data=new GN(t),!0):!1}get data(){return this._data}}class wN{flush(){return this._amount=0,this._amountChanged=0,this._type=-1,!0}parse(t){return t?(this._amount=t.readInt(),this._amountChanged=t.readInt(),this._type=t.readInt(),!0):!1}get amount(){return this._amount}get amountChanged(){return this._amountChanged}get type(){return this._type}}class VN{flush(){return this._errorCode=-1,!0}parse(t){return t?(this._errorCode=t.readInt(),!0):!1}get errorCode(){return this._errorCode}}class YN{flush(){return this._numGifts=0,!0}parse(t){return t?(this._numGifts=t.readInt(),!0):!1}get numGifts(){return this._numGifts}}class HN{flush(){return this._errorCode=0,this._messageId=0,this._timestamp=null,!0}parse(t){return t?(this._messageId=t.readInt(),this._errorCode=t.readInt(),this._timestamp=t.readString(),!0):!1}get errorCode(){return this._errorCode}get messageId(){return this._messageId}get timestamp(){return this._timestamp}}class jN{flush(){return this._key=null,!0}parse(t){return t?(this._key=t.readString(),!0):!1}get key(){return this._key}}class zN{flush(){return this._message=null,!0}parse(t){return t?(this._message=t.readString(),!0):!1}get message(){return this._message}}class WN{flush(){return this._enabled=!1,!0}parse(t){return t?(this._enabled=t.readBoolean(),!0):!1}get enabled(){return this._enabled}}class kN{flush(){return this._messages=[],!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;)this._messages.push(t.readString()),e--;return!0}get messages(){return this._messages}}class KN{flush(){return this._type=null,this._parameters=new Map,!0}parse(t){if(!t)return!1;this._type=t.readString();let e=t.readInt();for(;e>0;)this._parameters.set(t.readString(),t.readString()),e--;return!0}get type(){return this._type}get parameters(){return this._parameters}}class XN{flush(){return this._contentType=null,this._classId=0,this._name=null,this._description=null,!0}parse(t){return t?(this._contentType=t.readString(),this._classId=t.readInt(),this._name=t.readString(),this._description=t.readString(),!0):!1}get contentType(){return this._contentType}get classId(){return this._classId}get name(){return this._name}get description(){return this._description}}class qN{flush(){return this._petId=-1,this._petName=null,this._level=0,this._figureData=null,!0}parse(t){return t?(this._petId=t.readInt(),this._petName=t.readString(),this._level=t.readInt(),this._figureData=new Yd(t),!0):!1}get petId(){return this._petId}get petName(){return this._petName}get level(){return this._level}get figureData(){return this._figureData}}class QN{flush(){return this._errorCode=-1,!0}parse(t){return t?(this._errorCode=t.readInt(),!0):!1}get errorCode(){return this._errorCode}}class JN{flush(){return!0}parse(t){return!0}}class ZN{flush(){return this._alertMessage=null,!0}parse(t){return t?(this._alertMessage=t.readString(),t.bytesAvailable&&(this._titleMessage=t.readString()),!0):!1}get alertMessage(){return this._alertMessage}get titleMessage(){return this._titleMessage}}class $N{flush(){return this._items=new Xt,!0}parse(t){if(!t)return!1;let e=t.readInt();for(;e>0;){const s=t.readInt();let i=t.readInt();const r=[];for(;i>0;)r.push(t.readInt()),i--;this._items.add(s,r),e--}return!0}getItemsByCategory(t){return this._items.getValue(t)}get categories(){return this._items.getKeys()}}class tD{constructor(t,e,s){this._code=t,this._errorMessage=e,this._isAllowed=s}get code(){return this._code}get errorMessage(){return this._errorMessage}get isAllowed(){return this._isAllowed}}const ve=class ve{};ve.USE_GUIDE_TOOL="USE_GUIDE_TOOL",ve.GIVE_GUIDE_TOUR="GIVE_GUIDE_TOUR",ve.JUDGE_CHAT_REVIEWS="JUDGE_CHAT_REVIEWS",ve.VOTE_IN_COMPETITIONS="VOTE_IN_COMPETITIONS",ve.CALL_ON_HELPERS="CALL_ON_HELPERS",ve.CITIZEN="CITIZEN",ve.TRADE="TRADE",ve.HEIGHTMAP_EDITOR_BETA="HEIGHTMAP_EDITOR_BETA",ve.BUILDER_AT_WORK="BUILDER_AT_WORK",ve.NAVIGATOR_ROOM_THUMBNAIL_CAMERA="NAVIGATOR_ROOM_THUMBNAIL_CAMERA",ve.CAMERA="CAMERA",ve.MOUSE_ZOOM="MOUSE_ZOOM";let sg=ve;class eD{flush(){return this._perks=[],!0}parse(t){if(!t)return!1;this._perks=[];const e=t.readInt();for(let s=0;s<e;s++)this._perks.push(new tD(t.readString(),t.readString(),t.readBoolean()));return!0}isAllowed(t){let e=!1;for(const s of this._perks)if(s.code===t){e=s.isAllowed;break}return e}get perks(){return this._perks}}class sD{flush(){return this._objectId=-1,this._figureData=null,!0}parse(t){return this._objectId=t.readInt(),t.bytesAvailable&&(this._figureData=new uh(t.readString())),!0}get objectId(){return this._objectId}get figureData(){return this._figureData}}class iD{flush(){return this._objectId=0,this._nameValidationStatus=0,this._nameValidationInfo=null,!0}parse(t){return this._objectId=t.readInt(),this._nameValidationStatus=t.readInt(),this._nameValidationInfo=t.readString(),!0}get objectId(){return this._objectId}get nameValidationStatus(){return this._nameValidationStatus}get nameValidationInfo(){return this._nameValidationInfo}}class rD{flush(){return this._roomIndex=-1,this._petId=-1,this._level=-1,!0}parse(t){return this._roomIndex=t.readInt(),this._petId=t.readInt(),this._level=t.readInt(),!0}get roomIndex(){return this._roomIndex}get petId(){return this._petId}get level(){return this._level}}class nD{flush(){return this._currentAge=-1,this._requiredAge=-1,!0}parse(t){return this._currentAge=t.readInt(),this._requiredAge=t.readInt(),!0}get currentAge(){return this._currentAge}get requiredAge(){return this._requiredAge}}class aD{flush(){return this._petId=-1,this._commands=[],this._enabledCommands=[],!0}parse(t){this._petId=t.readInt();let e=t.readInt();for(;e>0;)this._commands.push(t.readInt()),e--;let s=t.readInt();for(;s>0;)this._enabledCommands.push(t.readInt()),s--;return!0}get petId(){return this._petId}get commands(){return this._commands}get enabledCommands(){return this._enabledCommands}}class oD{constructor(t,e,s){this._value=t,this._choiceText=e,this._choiceType=s}get value(){return this._value}set value(t){this._value=t}get choiceText(){return this._choiceText}set choiceText(t){this._choiceText=t}get choiceType(){return this._choiceType}set choiceType(t){this._choiceType=t}}class hD{constructor(){this._children=[],this._questionChoices=[]}get questionId(){return this._questionId}set questionId(t){this._questionId=t}get questionType(){return this._questionType}set questionType(t){this._questionType=t}get sortOrder(){return this._sortOrder}set sortOrder(t){this._sortOrder=t}get questionText(){return this._questionText}set questionText(t){this._questionText=t}get questionCategory(){return this._questionCategory}set questionCategory(t){this._questionCategory=t}get questionAnswerType(){return this._questionAnswerType}set questionAnswerType(t){this._questionAnswerType=t}get questionAnswerCount(){return this._questionAnswerCount}set questionAnswerCount(t){this._questionAnswerCount=t}get children(){return this._children}set children(t){this._children=t}get questionChoices(){return this._questionChoices}set questionChoices(t){this._questionChoices=t}}class _D{constructor(){this._id=-1,this._startMessage="",this._endMessage="",this._numQuestions=0,this._questionArray=[],this._npsPoll=!1}flush(){return this._id=-1,this._startMessage="",this._endMessage="",this._numQuestions=0,this._questionArray=[],!0}parse(t){this._id=t.readInt(),this._startMessage=t.readString(),this._endMessage=t.readString(),this._numQuestions=t.readInt();for(let e=0;e<this._numQuestions;e++){const s=this.parsePollQuestion(t),i=t.readInt();for(let r=0;r<i;r++)s.children.push(this.parsePollQuestion(t));this._questionArray.push(s)}return this._npsPoll=t.readBoolean(),!0}parsePollQuestion(t){const e=new hD;if(e.questionId=t.readInt(),e.sortOrder=t.readInt(),e.questionType=t.readInt(),e.questionText=t.readString(),e.questionCategory=t.readInt(),e.questionAnswerType=t.readInt(),e.questionAnswerCount=t.readInt(),e.questionType==1||e.questionType==2)for(let s=0;s<e.questionAnswerCount;s++)e.questionChoices.push(new oD(t.readString(),t.readString(),t.readInt()));return e}get id(){return this._id}get startMessage(){return this._startMessage}get endMessage(){return this._endMessage}get numQuestions(){return this._numQuestions}get questionArray(){return this._questionArray}get npsPoll(){return this._npsPoll}}class lD{flush(){throw!0}parse(t){return!0}}class cD{constructor(){this._id=-1,this._type="",this._headline="",this._summary=""}flush(){return this._id=-1,this._type="",this._summary="",!0}parse(t){return this._id=t.readInt(),this._type=t.readString(),this._headline=t.readString(),this._summary=t.readString(),!0}get id(){return this._id}get type(){return this._type}get headline(){return this._headline}get summary(){return this._summary}}class uD{flush(){return this._userId=-1,this._value="",this._answerCounts=null,!0}parse(t){this._userId=t.readInt(),this._value=t.readString(),this._answerCounts=new Map;const e=t.readInt();for(let s=0;s<e;s++){const i=t.readString(),r=t.readInt();this._answerCounts.set(i,r)}return!0}get userId(){return this._userId}get value(){return this._value}get answerCounts(){return this._answerCounts}}class dD{flush(){return this._questionId=-1,this._answerCounts=null,!0}parse(t){this._questionId=t.readInt(),this._answerCounts=new Map;const e=t.readInt();for(let s=0;s<e;s++){const i=t.readString(),r=t.readInt();this._answerCounts.set(i,r)}return!0}get questionId(){return this._questionId}get answerCounts(){return this._answerCounts}}class ED{constructor(){this._pollType=null,this._pollId=-1,this._questionId=-1,this._duration=-1,this._question=null}flush(){return this._pollType=null,this._pollId=-1,this._questionId=-1,this._duration=-1,this._question=null,!0}parse(t){this._pollType=t.readString(),this._pollId=t.readInt(),this._questionId=t.readInt(),this._duration=t.readInt();const e=t.readInt(),s=t.readInt(),i=t.readInt(),r=t.readString();if(this._question={id:e,number:s,type:i,content:r},this._question.type==1||this._question.type==2){this._question.selection_min=t.readInt();const a=t.readInt();this._question.selections=[],this._question.selection_values=[],this._question.selection_count=a,this._question.selection_max=a;for(let o=0;o<a;o++)this._question.selection_values.push(t.readString()),this._question.selections.push(t.readString())}return!0}get pollType(){return this._pollType}get pollId(){return this._pollId}get questionId(){return this._questionId}get duration(){return this._duration}get question(){return this._question}}class gD{flush(){return this._question=null,this._choices=[],this._SafeStr_7651=[],this._SafeStr_7654=-1,!0}parse(t){this._question=t.readString(),this._choices=[],this._SafeStr_7651=[];let e=t.readInt();for(;e>0;)this._choices.push(t.readString()),this._SafeStr_7651.push(t.readInt()),e--;return this._SafeStr_7654=t.readInt(),!0}get question(){return this._question}get choices(){return this._choices}get SafeStr_7651(){return this._SafeStr_7651}get SafeStr_7654(){return this._SafeStr_7654}}class fD{flush(){return this._question=null,this._choices=[],!0}parse(t){this._question=t.readString(),this._choices=[];const e=t.readInt();let s=0;for(;s<e;)this._choices.push(t.readString()),s++;return!0}get question(){return this._question}get choices(){return this._choices.slice()}}class ID{constructor(t){this._rewardUserLimits=[],this._hasGoalExpired=t.readBoolean(),this._personalContributionScore=t.readInt(),this._personalContributionRank=t.readInt(),this._communityTotalScore=t.readInt(),this._communityHighestAchievedLevel=t.readInt(),this._scoreRemainingUntilNextLevel=t.readInt(),this._percentCompletionTowardsNextLevel=t.readInt(),this._goalCode=t.readString(),this._timeRemainingInSeconds=t.readInt();const e=t.readInt();for(let s=0;s<e;s++)this._rewardUserLimits.push(t.readInt())}dispose(){this._rewardUserLimits=null}get disposed(){return this._rewardUserLimits==null}get hasGoalExpired(){return this._hasGoalExpired}get personalContributionScore(){return this._personalContributionScore}get personalContributionRank(){return this._personalContributionRank}get communityTotalScore(){return this._communityTotalScore}get communityHighestAchievedLevel(){return this._communityHighestAchievedLevel}get scoreRemainingUntilNextLevel(){return this._scoreRemainingUntilNextLevel}get percentCompletionTowardsNextLevel(){return this._percentCompletionTowardsNextLevel}get timeRemainingInSeconds(){return this._timeRemainingInSeconds}get rewardUserLimits(){return this._rewardUserLimits}get goalCode(){return this._goalCode}}class TD{constructor(t){this._communityGoalId=t.readInt(),this._communityGoalCode=t.readString(),this._userRank=t.readInt(),this._rewardCode=t.readString(),this._badge=t.readBoolean(),this._localizedName=t.readString()}get communityGoalId(){return this._communityGoalId}get communityGoalCode(){return this._communityGoalCode}get userRank(){return this._userRank}get rewardCode(){return this._rewardCode}get badge(){return this._badge}get localizedName(){return this._localizedName}}class mD{flush(){return this._prizes=[],!0}parse(t){if(!t)return!1;const e=t.readInt();for(let s=0;s<e;s++)this._prizes.push(new TD(t));return!0}get prizes(){return this._prizes}}class pD{constructor(t){this._userId=t.readInt(),this._userName=t.readString(),this._figure=t.readString(),this._rank=t.readInt(),this._currentScore=t.readInt()}get userId(){return this._userId}get userName(){return this._userName}get figure(){return this._figure}get rank(){return this._rank}get currentScore(){return this._currentScore}}class RD{constructor(t){this._hof=[],this._goalCode=t.readString();const e=t.readInt();for(let s=0;s<e;s++)this._hof.push(new pD(t))}dispose(){this._hof=null}get disposed(){return this._hof==null}get hof(){return this._hof}get goalCode(){return this._goalCode}}class OD{flush(){return this._data=null,!0}parse(t){return t?(this._data=new RD(t),!0):!1}get data(){return this._data}}class AD{flush(){return this._data=null,!0}parse(t){return t?(this._data=new ID(t),!0):!1}get data(){return this._data}}class SD{flush(){return this._state=-1,this._userCount=-1,this._userCountGoal=-1,!0}parse(t){return t?(this._state=t.readInt(),this._userCount=t.readInt(),this._userCountGoal=t.readInt(),!0):!1}get state(){return this._state}get userCount(){return this._userCount}get userCountGoal(){return this._userCountGoal}}class CD{flush(){return this._imageUri="",!0}parse(t){return t?(this._imageUri=t.readString(),!0):!1}get imageUri(){return this._imageUri}}class MD{flush(){return!0}parse(t){return t?(this._expired=t.readBoolean(),!0):!1}get expired(){return this._expired}}class Wr{constructor(t){this._receiveTime=new Date,this._campaignCode=t.readString(),this._completedQuestsInCampaign=t.readInt(),this._questCountInCampaign=t.readInt(),this._activityPointType=t.readInt(),this._id=t.readInt(),this._accepted=t.readBoolean(),this._type=t.readString(),this._imageVersion=t.readString(),this._rewardCurrencyAmount=t.readInt(),this._localizationCode=t.readString(),this._completedSteps=t.readInt(),this._totalSteps=t.readInt(),this._sortOrder=t.readInt(),this._catalogPageName=t.readString(),this._chainCode=t.readString(),this._easy=t.readBoolean()}static getCampaignLocalizationKeyForCode(t){return"quests."+t}get campaignCode(){return this._campaignCode}get localizationCode(){return this._localizationCode}get completedQuestsInCampaign(){return this._completedQuestsInCampaign}get questCountInCampaign(){return this._questCountInCampaign}get activityPointType(){return this._activityPointType}set accepted(t){this._accepted=t}get accepted(){return this._accepted}set id(t){this._id=t}get id(){return this._id}get type(){return this._type}get imageVersion(){return this._imageVersion}get rewardCurrencyAmount(){return this._rewardCurrencyAmount}get completedSteps(){return this._completedSteps}get totalSteps(){return this._totalSteps}get isCompleted(){return this._completedSteps==this._totalSteps}set waitPeriodSeconds(t){this._waitPeriodSeconds=t}get waitPeriodSeconds(){if(this._waitPeriodSeconds<1)return 0;const e=new Date().getTime()-this._receiveTime.getTime();return Math.max(0,this._waitPeriodSeconds-Math.floor(e/1e3))}getCampaignLocalizationKey(){return Wr.getCampaignLocalizationKeyForCode(this.campaignCode)}getQuestLocalizationKey(){return this.getCampaignLocalizationKey()+"."+this._localizationCode}get completedCampaign(){return this._id<1}get lastQuestInCampaign(){return this._completedQuestsInCampaign>=this._questCountInCampaign}get receiveTime(){return this._receiveTime}get sortOrder(){return this._sortOrder}get catalogPageName(){return this._catalogPageName}get chainCode(){return this._chainCode}get easy(){return this._easy}}class ND{flush(){return this._questData=null,!0}parse(t){return t?(this._questData=new Wr(t),this._showDialog=t.readBoolean(),!0):!1}get questData(){return this._questData}get showDialog(){return this._showDialog}}class DD{flush(){return this._quest=null,!0}parse(t){return t?(t.readBoolean()&&(this._quest=new Wr(t),this._easyQuestCount=t.readInt(),this._hardQuestCount=t.readInt()),!0):!1}get quest(){return this._quest}get easyQuestCount(){return this._easyQuestCount}get hardQuestCount(){return this._hardQuestCount}}class LD{flush(){return this._quest=null,!0}parse(t){return t?(this._quest=new Wr(t),!0):!1}get quest(){return this._quest}}class PD{flush(){return this._quests=[],!0}parse(t){if(!t)return!1;const e=t.readInt();for(let s=0;s<e;s++)this._quests.push(new Wr(t));return this._openWindow=t.readBoolean(),!0}get quests(){return this._quests}get openWindow(){return this._openWindow}}class UD{flush(){return this._quests=[],!0}parse(t){if(!t)return!1;const e=t.readInt();for(let s=0;s<e;s++)this._quests.push(new Wr(t));return!0}get quests(){return this._quests}}class yD{flush(){return this._recyclerFinishedStatus=-1,this._prizeId=0,!0}parse(t){return t?(this._recyclerFinishedStatus=t.readInt(),this._prizeId=t.readInt(),!0):!1}get recyclerFinishedStatus(){return this._recyclerFinishedStatus}get prizeId(){return this._prizeId}}class vD{flush(){return this._recyclerStatus=-1,this._recyclerTimeoutSeconds=0,!0}parse(t){return t?(this._recyclerStatus=t.readInt(),this._recyclerTimeoutSeconds=t.readInt(),!0):!1}get recyclerStatus(){return this._recyclerStatus}get recyclerTimeoutSeconds(){return this._recyclerTimeoutSeconds}}class jd{constructor(t){this._stuffIds=[],this._intParams=[],this._stuffTypeSelectionEnabled=t.readBoolean(),this._furniLimit=t.readInt();let e=t.readInt();for(;e>0;)this._stuffIds.push(t.readInt()),e--;for(this._stuffTypeId=t.readInt(),this._id=t.readInt(),this._stringParam=t.readString(),e=t.readInt();e>0;)this._intParams.push(t.readInt()),e--;this._stuffTypeSelectionCode=t.readInt()}getBoolean(t){return this._intParams[t]===1}get stuffTypeSelectionEnabled(){return this._stuffTypeSelectionEnabled}get stuffTypeSelectionCode(){return this._stuffTypeSelectionCode}set stuffTypeSelectionCode(t){this._stuffTypeSelectionCode=t}get maximumItemSelectionCount(){return this._furniLimit}get selectedItems(){return this._stuffIds}get id(){return this._id}get stringData(){return this._stringParam}get intData(){return this._intParams}get code(){return 0}get spriteId(){return this._stuffTypeId}}class bD extends jd{constructor(t){super(t),this._type=t.readInt()}get type(){return this._type}get code(){return this._type}}class FD extends jd{constructor(t){super(t),this._conflictingActions=[],this._triggerConf=t.readInt();let e=t.readInt();for(;e>0;)this._conflictingActions.push(t.readInt()),e--}get code(){return this._triggerConf}get conflictingActions(){return this._conflictingActions}}class xD extends jd{constructor(t){super(t),this._conflictingTriggers=[],this._type=t.readInt(),this._delayInPulses=t.readInt();let e=t.readInt();for(;e>0;)this._conflictingTriggers.push(t.readInt()),e--}get type(){return this._type}get code(){return this._type}get delayInPulses(){return this._delayInPulses}get conflictingTriggers(){return this._conflictingTriggers}}class GD{flush(){return this._definition=null,!0}parse(t){return t?(this._definition=new xD(t),!0):!1}get definition(){return this._definition}}class BD{flush(){return this._definition=null,!0}parse(t){return t?(this._definition=new bD(t),!0):!1}get definition(){return this._definition}}class wD{flush(){return this._definition=null,!0}parse(t){return t?(this._definition=new FD(t),!0):!1}get definition(){return this._definition}}class VD{flush(){return this._stuffId=0,!0}parse(t){return t?(this._stuffId=t.readInt(),!0):!1}get stuffId(){return this._stuffId}}class YD{flush(){return this._reason=0,!0}parse(t){return t?(this._reason=t.readInt(),!0):!1}get reason(){return this._reason}}class HD{flush(){return!0}parse(t){return!!t}}class jD{flush(){return this._info=null,!0}parse(t){return t?(this._info=t.readString(),!0):!1}get info(){return this._info}}class zD{flush(){return!0}parse(t){return!!t}}class WD{flush(){return!0}parse(t){return!0}}class kD{constructor(){this._songDisks=new Xt}flush(){return this._songDisks.reset(),this._maxLength=0,!0}parse(t){this._maxLength=t.readInt();const e=t.readInt();for(let s=0;s<e;s++)this._songDisks.add(t.readInt(),t.readInt());return!0}get songDisks(){return this._songDisks}get maxLength(){return this._maxLength}}class KD{flush(){return this._currentSongId=-1,this._currentPosition=-1,this._nextSongId=-1,this._nextPosition=-1,this._syncCount=-1,!0}parse(t){return this._currentSongId=t.readInt(),this._currentPosition=t.readInt(),this._nextSongId=t.readInt(),this._nextPosition=t.readInt(),this._syncCount=t.readInt(),!0}get currentSongId(){return this._currentSongId}get currentPosition(){return this._currentPosition}get nextSongId(){return this._nextSongId}get nextPosition(){return this._nextPosition}get syncCount(){return this._syncCount}}class XD{flush(){return this._songId=0,this._officialSongId="",!0}parse(t){return this._officialSongId=t.readString(),this._songId=t.readInt(),!0}get songId(){return this._songId}get officialSongId(){return this._officialSongId}}class nl{constructor(t,e,s,i){this._startPlayHead=0,this._id=t,this._length=e,this._name=s,this._creator=i}get id(){return this._id}get length(){return this._length}get name(){return this._name}get creator(){return this._creator}get startPlayHeadPos(){return this._startPlayHead}set startPlayHeadPos(t){this._startPlayHead=t}}class qD{flush(){return this._synchronizationCount=-1,this._playlist=[],!0}parse(t){this._synchronizationCount=t.readInt();const e=t.readInt();for(let s=0;s<e;s++)this._playlist.push(new nl(t.readInt(),t.readInt(),t.readString(),t.readString()));return!0}get synchronizationCount(){return this._synchronizationCount}get playList(){return this._playlist}}class QD{flush(){return this._entry=null,!0}parse(t){return this._entry=new nl(t.readInt(),t.readInt(),t.readString(),t.readString()),!0}get entry(){return this._entry}}class JD extends nl{constructor(t,e,s,i,r){super(t,e,s,i),this._data="",this._data=r}get data(){return this._data}}class ZD{flush(){return this._songs=[],!0}parse(t){const e=t.readInt();for(let s=0;s<e;s++){const i=t.readInt();t.readString();const r=t.readString(),a=t.readString(),o=t.readInt(),h=t.readString(),_=new JD(i,o,r,h,a);this._songs.push(_)}return!0}get songs(){return this._songs}}class $D{constructor(){this._songDiskInventory=new Xt}flush(){return this._songDiskInventory.reset(),!0}parse(t){const e=t.readInt();for(let s=0;s<e;s++)this._songDiskInventory.add(t.readInt(),t.readInt());return!0}getDiskId(t){return t>=0&&t<this._songDiskInventory.length?this._songDiskInventory.getKey(t):-1}getSongId(t){return t>=0&&t<this._songDiskInventory.length?this._songDiskInventory.getWithIndex(t):-1}get songDiskCount(){return this._songDiskInventory.length}}class tL{flush(){return this._talentTrackName=null,this._level=-1,this._rewardPerks=[],this._rewardProducts=[],!0}parse(t){if(!t)return!1;let e=0;this._talentTrackName=t.readString(),this._level=t.readInt();const s=t.readInt();for(;e<s;)this._rewardPerks.push(new nL(t)),e++;const i=t.readInt();if(e<i)for(let r=0;r<i;r++){const a=t.readString(),o=t.readInt();this._rewardProducts.push(new yg(a,o)),e++}return!0}get talentTrackName(){return this._talentTrackName}get level(){return this._level}get rewardPerks(){return this._rewardPerks}get rewardProducts(){return this._rewardProducts}}class eL{constructor(t,e,s,i,r){this._level=t,this._state=e,this._tasks=s,this._rewardPerks=i,this._rewardProducts=r}get level(){return this._level}get state(){return this._state}get tasks(){return this._tasks}get perks(){return this._rewardPerks}get items(){return this._rewardProducts}}class sL{flush(){return this._talentTrackName=null,this._level=-1,this._maxLevel=-1,!0}parse(t){return t?(this._talentTrackName=t.readString(),this._level=t.readInt(),this._maxLevel=t.readInt(),!0):!1}get talentTrackName(){return this._talentTrackName}get level(){return this._level}get maxLevel(){return this._maxLevel}}class yg{constructor(t,e){this._productCode=t,this._vipDays=e}get productCode(){return this._productCode}get vipDays(){return this._vipDays}}class iL{constructor(t,e,s,i,r,a){this._id=t,this._requiredLevel=e,this._badgeCode=s,this._state=i,this._currentScore=r,this._totalScore=a}get id(){return this._id}get requiredLevel(){return this._requiredLevel}get badgeCode(){return this._badgeCode}get state(){return this._state}get currentScore(){return this._currentScore}get totalScore(){return this._totalScore}}class rL{flush(){return this._type=null,this._levels=null,!0}parse(t){if(!t)return!1;this._type=t.readString(),this._levels=[];const e=t.readInt();for(let s=0;s<e;s++){const i=t.readInt(),r=t.readInt(),a=[],o=t.readInt();for(let f=0;f<o;f++){const p=t.readInt(),m=t.readInt(),O=t.readString(),A=t.readInt(),C=t.readInt(),L=t.readInt();a.push(new iL(p,m,O,A,C,L))}const h=[],_=t.readInt();for(let f=0;f<_;f++)h.push(t.readString());const l=[],c=t.readInt();for(let f=0;f<c;f++){const p=t.readString(),m=t.readInt();l.push(new yg(p,m))}this._levels.push(new eL(i,r,a,h,l))}return!0}get type(){return this._type}get levels(){return this._levels}}class nL{constructor(t){this._perkId=t.readInt()}get perkId(){return this._perkId}}class aL{flush(){return this._classifiedUsersNames&&(this._classifiedUsersNames=new Map),this._classifiedUsersClass&&(this._classifiedUsersClass=new Map),!0}parse(t){if(!t)return!1;let e,s,i,r=t.readInt();for(this._classifiedUsersNames=new Map,this._classifiedUsersClass=new Map;r>0;)e=t.readInt(),s=t.readString(),i=t.readString(),this._classifiedUsersNames.set(e,s),this._classifiedUsersClass.set(e,i),r--;return!0}get classifiedUsernameMap(){return this._classifiedUsersNames}get classifiedUserTypeMap(){return this._classifiedUsersClass}}class oL extends I{constructor(t){super(t,op)}getParser(){return this.parser}}class hL extends I{constructor(t){super(t,hp)}getParser(){return this.parser}}class vg extends I{constructor(t){super(t,_p)}getParser(){return this.parser}}class _L extends I{constructor(t){super(t,lp)}getParser(){return this.parser}}class lL extends I{constructor(t){super(t,cp)}getParser(){return this.parser}}class cL extends I{constructor(t){super(t,up)}getParser(){return this.parser}}class uL extends I{constructor(t){super(t,dp)}getParser(){return this.parser}}class dL extends I{constructor(t){super(t,Ep)}getParser(){return this.parser}}const Fs=class Fs extends I{constructor(t){super(t,gp)}getParser(){return this.parser}};Fs.NAME_OK=0,Fs.ERROR_NAME_REQUIRED=1,Fs.ERROR_NAME_TOO_SHORT=2,Fs.ERROR_NAME_TOO_LONG=3,Fs.ERROR_NAME_NOT_VALID=4,Fs.ERROR_NAME_IN_USE=5,Fs.ERROR_NAME_CHANGE_NOT_ALLOWED=6,Fs.ERROR_MERGE_HOTEL_DOWN=7;let Za=Fs;class EL extends I{constructor(t){super(t,fp)}getParser(){return this.parser}}class bg extends I{constructor(t){super(t,Ip)}getParser(){return this.parser}}class gL extends I{constructor(t){super(t,mp)}getParser(){return this.parser}}class fL extends I{constructor(t){super(t,pp)}getParser(){return this.parser}}class IL extends I{constructor(t){super(t,Rp)}getParser(){return this.parser}}class TL extends I{constructor(t){super(t,Op)}getParser(){return this.parser}}class mL extends I{constructor(t){super(t,Ap)}getParser(){return this.parser}}class pL extends I{constructor(t){super(t,Np)}getParser(){return this.parser}}class RL extends I{constructor(t){super(t,Dp)}getParser(){return this.parser}}class OL extends I{constructor(t){super(t,Lp)}getParser(){return this.parser}}class AL extends I{constructor(t){super(t,Pp)}getParser(){return this.parser}}class SL extends I{constructor(t){super(t,Up)}getParser(){return this.parser}}class CL extends I{constructor(t){super(t,yp)}getParser(){return this.parser}}class ML extends I{constructor(t){super(t,vp)}getParser(){return this.parser}}class NL extends I{constructor(t){super(t,bp)}getParser(){return this.parser}}class DL extends I{constructor(t){super(t,Fp)}getParser(){return this.parser}}class LL extends I{constructor(t){super(t,xp)}getParser(){return this.parser}}class PL extends I{constructor(t){super(t,Gp)}getParser(){return this.parser}}class UL extends I{constructor(t){super(t,Bp)}getParser(){return this.parser}}class yL extends I{constructor(t){super(t,wp)}getParser(){return this.parser}}class vL extends I{constructor(t){super(t,Vp)}getParser(){return this.parser}}class bL extends I{constructor(t){super(t,Yp)}getParser(){return this.parser}}class FL extends I{constructor(t){super(t,jp)}getParser(){return this.parser}}class xL extends I{constructor(t){super(t,kp)}getParser(){return this.parser}}class GL extends I{constructor(t){super(t,Kp)}getParser(){return this.parser}}class BL extends I{constructor(t){super(t,zp)}getParser(){return this.parser}}class wL extends I{constructor(t){super(t,Xp)}getParser(){return this.parser}}class VL extends I{constructor(t){super(t,qp)}getParser(){return this.parser}}class YL extends I{constructor(t){super(t,Jp)}getParser(){return this.parser}}class HL extends I{constructor(t){super(t,Zp)}getParser(){return this.parser}}class jL extends I{constructor(t){super(t,tR)}getParser(){return this.parser}}class zL extends I{constructor(t){super(t,sR)}getParser(){return this.parser}}class WL extends I{constructor(t){super(t,iR)}getParser(){return this.parser}}class kL extends I{constructor(t){super(t,rR)}getParser(){return this.parser}}class KL extends I{constructor(t){super(t,nR)}getParser(){return this.parser}}class XL extends I{constructor(t){super(t,aR)}getParser(){return this.parser}}class qL extends I{constructor(t){super(t,oR)}getParser(){return this.parser}}class QL extends I{constructor(t){super(t,hR)}getParser(){return this.parser}}class JL extends I{constructor(t){super(t,_R)}getParser(){return this.parser}}class ZL extends I{constructor(t){super(t,lR)}getParser(){return this.parser}}class $L extends I{constructor(t){super(t,cR)}getParser(){return this.parser}}class tP extends I{constructor(t){super(t,uR)}getParser(){return this.parser}}class eP extends I{constructor(t){super(t,dR)}getParser(){return this.parser}}class sP extends I{constructor(t){super(t,gR)}getParser(){return this.parser}}class iP extends I{constructor(t){super(t,dS)}getParser(){return this.parser}}class rP extends I{constructor(t){super(t,ES)}getParser(){return this.parser}}class nP extends I{constructor(t){super(t,fS)}getParser(){return this.parser}}class aP extends I{constructor(t){super(t,mS)}getParser(){return this.parser}}class oP extends I{constructor(t){super(t,TS)}getParser(){return this.parser}}class hP extends I{constructor(t){super(t,pS)}getParser(){return this.parser}}class _P extends I{constructor(t){super(t,RS)}getParser(){return this.parser}}class Fg extends I{constructor(t){super(t,OS)}getParser(){return this.parser}}class lP extends I{constructor(t){super(t,Oc)}getParser(){return this.parser}}class cP extends I{constructor(t){super(t,AS)}getParser(){return this.parser}}class uP extends I{constructor(t){super(t,SS)}getParser(){return this.parser}}class dP extends I{constructor(t){super(t,CS)}getParser(){return this.parser}}class EP extends I{constructor(t){super(t,MS)}getParser(){return this.parser}}class gP extends I{constructor(t){super(t,NS)}getParser(){return this.parser}}class fP extends I{constructor(t){super(t,DS)}getParser(){return this.parser}}class IP extends I{constructor(t){super(t,PS)}getParser(){return this.parser}}class TP extends I{constructor(t){super(t,US)}getParser(){return this.parser}}class mP extends I{constructor(t){super(t,yS)}getParser(){return this.parser}}class Vc extends I{constructor(t){super(t,vS)}getParser(){return this.parser}}class pP extends I{constructor(t){super(t,FS)}getParser(){return this.parser}}class RP extends I{constructor(t){super(t,xS)}getParser(){return this.parser}}class OP extends I{constructor(t){super(t,GS)}getParser(){return this.parser}}class AP extends I{constructor(t){super(t,BS)}getParser(){return this.parser}}class SP extends I{constructor(t){super(t,wS)}getParser(){return this.parser}}class CP extends I{constructor(t){super(t,VS)}getParser(){return this.parser}}class MP extends I{constructor(t){super(t,YS)}getParser(){return this.parser}}class NP extends I{constructor(t){super(t,HS)}getParser(){return this.parser}}class DP extends I{constructor(t){super(t,jS)}getParser(){return this.parser}}class LP extends I{constructor(t){super(t,zS)}getParser(){return this.parser}}class PP extends I{constructor(t){super(t,WS)}getParser(){return this.parser}}class UP extends I{constructor(t){super(t,kS)}getParser(){return this.parser}}class yP extends I{constructor(t){super(t,KS)}getParser(){return this.parser}}class vP extends I{constructor(t){super(t,XS)}getParser(){return this.parser}}class xg extends I{constructor(t){super(t,qS)}getParser(){return this.parser}}class bP extends I{constructor(t){super(t,QS)}getParser(){return this.parser}}class FP extends I{constructor(t){super(t,JS)}getParser(){return this.parser}}class xP extends I{constructor(t){super(t,ZS)}getParser(){return this.parser}}class GP extends I{constructor(t){super(t,Cc)}getParser(){return this.parser}}class BP extends I{constructor(t){super(t,$S)}getParser(){return this.parser}}class wP extends I{constructor(t){super(t,Mc)}getParser(){return this.parser}}class VP extends I{constructor(t){super(t,Nc)}getParser(){return this.parser}}class YP extends I{constructor(t){super(t,tC)}getParser(){return this.parser}}class HP extends I{constructor(t){super(t,eC)}getParser(){return this.parser}}class jP extends I{constructor(t){super(t,sC)}getParser(){return this.parser}}class zP extends I{constructor(t){super(t,iC)}getParser(){return this.parser}}class WP extends I{constructor(t){super(t,rC)}getParser(){return this.parser}}class kP extends I{constructor(t){super(t,aC)}getParser(){return this.parser}}class KP extends I{constructor(t){super(t,hC)}getParser(){return this.parser}}class XP extends I{constructor(t){super(t,_C)}getParser(){return this.parser}}class qP extends I{constructor(t){super(t,Dc)}getParser(){return this.parser}}class QP extends I{constructor(t){super(t,lC)}getParser(){return this.parser}}class JP extends I{constructor(t){super(t,Lc)}getParser(){return this.parser}}class ZP extends I{constructor(t){super(t,cC)}getParser(){return this.parser}}class $P extends I{constructor(t){super(t,uC)}getParser(){return this.parser}}class Gg extends I{constructor(t){super(t,dC)}getParser(){return this.parser}}class tU extends I{constructor(t){super(t,EC)}getParser(){return this.parser}}class eU extends I{constructor(t){super(t,gC)}getParser(){return this.parser}}class sU extends I{constructor(t){super(t,rl)}getParser(){return this.parser}}class iU extends I{constructor(t){super(t,rl)}getParser(){return this.parser}}class rU extends I{constructor(t){super(t,rl)}getParser(){return this.parser}}class nU extends I{constructor(t){super(t,rl)}getParser(){return this.parser}}class aU extends I{constructor(t){super(t,IC)}getParser(){return this.parser}}class oU extends I{constructor(t){super(t,TC)}getParser(){return this.parser}}class Yc extends I{constructor(t){super(t,mC)}getParser(){return this.parser}}class hU extends I{constructor(t){super(t,pC)}getParser(){return this.parser}}class _U extends I{constructor(t){super(t,RC)}getParser(){return this.parser}}class lU extends I{constructor(t){super(t,OC)}getParser(){return this.parser}}class Bg extends I{constructor(t){super(t,AC)}getParser(){return this.parser}}class cU extends I{constructor(t){super(t,SC)}getParser(){return this.parser}}class uU extends I{constructor(t){super(t,CC)}getParser(){return this.parser}}class dU extends I{constructor(t){super(t,MC)}getParser(){return this.parser}}class EU extends I{constructor(t){super(t,LC)}getParser(){return this.parser}}class gU extends I{constructor(t){super(t,PC)}getParser(){return this.parser}}class fU extends I{constructor(t){super(t,UC)}getParser(){return this.parser}}class IU extends I{constructor(t){super(t,yC)}getParser(){return this.parser}}class TU extends I{constructor(t){super(t,vC)}getParser(){return this.parser}}class mU extends I{constructor(t){super(t,bC)}getParser(){return this.parser}}class pU extends I{constructor(t){super(t,FC)}getParser(){return this.parser}}class RU extends I{constructor(t){super(t,xC)}getParser(){return this.parser}}class OU extends I{constructor(t){super(t,GC)}getParser(){return this.parser}}class AU extends I{constructor(t){super(t,BC)}getParser(){return this.parser}}class SU extends I{constructor(t){super(t,wC)}getParser(){return this.parser}}class CU extends I{constructor(t){super(t,VC)}getParser(){return this.parser}}class MU extends I{constructor(t){super(t,YC)}getParser(){return this.parser}}class NU extends I{constructor(t){super(t,HC)}getParser(){return this.parser}}const it=class it{};it.LOGOUT=0,it.JUST_BANNED=1,it.CONCURRENT_LOGIN=2,it.CONNECTION_LOST_TO_PEER=3,it.AVATAR_IDENTITY_CHANGE=4,it.REMOVE_FURNITURE_TOOL=5,it.STILL_BANNED=10,it.DUAL_LOGIN_BY_USERID=11,it.HOTEL_CLOSED=12,it.DUAL_LOGIN_BY_IP=13,it.PEER_CONNECTION_MISSING=16,it.NO_LOGIN_PERMISSION=17,it.DUPLICATE_CONNECTION=18,it.HOTEL_CLOSING=19,it.INCORRECT_PASSWORD=20,it.INVALID_LOGIN_TICKET=22,it.VERSION_CHECK_URL=23,it.VERSION_CHECK_PROPERTY=24,it.VERSION_CHECK_MACHINE_ID=25,it.NO_MESSENGER_SESSION=26,it.USER_NOT_FOUND=27,it.CRYPTO_NOT_INITIALIZED=28,it.DEV_CRYPTO_NOT_ALLOWED=29,it.DUPLICATE_UUID_DETECTED=100,it.OLD_SESSION_IN_PROXY=101,it.PUBLIC_KEY_NOT_NUMERIC=102,it.PUBLIC_KEY_TOO_SHORT=103,it.SOCKET_READ_GENERIC=104,it.SOCKET_READ_FIRST_BYTE=105,it.SOCKET_READ_LENGTH=106,it.SOCKET_READ_BODY=107,it.SOCKET_READ_POLICY=108,it.SOCKET_IO_EXCEPTION=109,it.SOCKET_WRONG_CRYPTO=110,it.PROXY_RUNTIME_EXCEPTION=111,it.IDLE_CONNECTION=112,it.PONG_TIMEOUT=113,it.IDLE_CONNECTION_NOT_AUTH=114,it.IDLE_CONNECTION_NO_USER_ID=115,it.WRITE_CLOSED_CHANNEL=116,it.SOCKET_WRITE_EXCEPTION_1=117,it.SOCKET_WRITE_EXCEPTION_2=118,it.SOCKET_WRITE_EXCEPTION_3=119;let sn=it;class DU extends I{constructor(t){super(t,jC)}getParser(){return this.parser}get reasonString(){switch(this.getParser().reason){case sn.JUST_BANNED:case sn.STILL_BANNED:return"banned";case sn.CONCURRENT_LOGIN:return"concurrentlogin";case sn.INCORRECT_PASSWORD:return"incorrectpassword";default:return"logout"}}}class LU extends I{constructor(t){super(t,zC)}getParser(){return this.parser}}class PU extends I{constructor(t){super(t,WC)}getParser(){return this.parser}}class wg extends I{constructor(t){super(t,kC)}getParser(){return this.parser}}class UU extends I{constructor(t){super(t,KC)}getParser(){return this.parser}}class yU extends I{constructor(t){super(t,XC)}getParser(){return this.parser}}class vU extends I{constructor(t){super(t,qC)}getParser(){return this.parser}}class bU extends I{constructor(t){super(t,QC)}getParser(){return this.parser}}class FU extends I{constructor(t){super(t,JC)}getParser(){return this.parser}}class xU extends I{constructor(t){super(t,ZC)}getParser(){return this.parser}}class GU extends I{constructor(t){super(t,$C)}getParser(){return this.parser}}class BU extends I{constructor(t){super(t,tM)}getParser(){return this.parser}}class wU extends I{constructor(t){super(t,eM)}getParser(){return this.parser}}class VU extends I{constructor(t){super(t,Pc)}getParser(){return this.parser}}class YU extends I{constructor(t){super(t,sM)}getParser(){return this.parser}}class HU extends I{constructor(t){super(t,Uc)}getParser(){return this.parser}}class jU extends I{constructor(t){super(t,rM)}getParser(){return this.parser}}class zU extends I{constructor(t){super(t,nM)}getParser(){return this.parser}}class Vg extends I{constructor(t){super(t,aM)}getParser(){return this.parser}}class Yg extends I{constructor(t){super(t,yc)}getParser(){return this.parser}}class WU extends I{constructor(t){super(t,oM)}getParser(){return this.parser}}class kU extends I{constructor(t){super(t,hM)}getParser(){return this.parser}}class KU extends I{constructor(t){super(t,_M)}getParser(){return this.parser}}class XU extends I{constructor(t){super(t,lM)}getParser(){return this.parser}}class Hg extends I{constructor(t){super(t,cM)}getParser(){return this.parser}}class qU extends I{constructor(t){super(t,vc)}getParser(){return this.parser}}class QU extends I{constructor(t){super(t,bc)}getParser(){return this.parser}}class JU extends I{constructor(t){super(t,uM)}getParser(){return this.parser}}class ZU extends I{constructor(t){super(t,dM)}getParser(){return this.parser}}class $U extends I{constructor(t){super(t,EM)}getParser(){return this.parser}}class ty extends I{constructor(t){super(t,gM)}getParser(){return this.parser}}const u=class u{};u.ACHIEVEMENT_LIST=305,u.AUTHENTICATED=2491,u.AUTHENTICATION=-1,u.AVAILABILITY_STATUS=2033,u.BUILDERS_CLUB_EXPIRED=1452,u.CLUB_OFFERS=2405,u.CATALOG_PAGE=804,u.CATALOG_PAGE_LIST=1032,u.CATALOG_PURCHASE_OK=869,u.CATALOG_PURCHASE_ERROR=1404,u.CATALOG_PURCHASE_NOT_ALLOWED=3770,u.PRODUCT_OFFER=3388,u.LIMITED_SOLD_OUT=377,u.CATALOG_PUBLISHED=1866,u.CFH_RESULT_MESSAGE=3635,u.CLIENT_LATENCY=10,u.CLIENT_PING=3928,u.DESKTOP_CAMPAIGN=1745,u.DESKTOP_NEWS=286,u.DESKTOP_VIEW=122,u.BUNDLE_DISCOUNT_RULESET=2347,u.FIRST_LOGIN_OF_DAY=793,u.FURNITURE_ALIASES=1723,u.FURNITURE_DATA=2547,u.FURNITURE_FLOOR=1778,u.FURNITURE_FLOOR_ADD=1534,u.FURNITURE_FLOOR_REMOVE=2703,u.FURNITURE_FLOOR_UPDATE=3776,u.FURNITURE_ITEMDATA=2202,u.FURNITURE_STATE=2376,u.FURNITURE_GROUP_CONTEXT_MENU_INFO=3293,u.FURNITURE_POSTIT_STICKY_POLE_OPEN=2366,u.GAME_CENTER_ACHIEVEMENTS=2265,u.GAME_CENTER_GAME_LIST=222,u.GAME_CENTER_STATUS=2893,u.GAME_CENTER_IN_ARENA_QUEUE=872,u.GAME_CENTER_STOP_COUNTER=3191,u.GAME_CENTER_USER_LEFT_GAME=3138,u.GAME_CENTER_DIRECTORY_STATUS=2246,u.GAME_CENTER_STARTING_GAME_FAILED=2142,u.GAME_CENTER_JOINING_FAILED=1730,u.GAMESTATUSMESSAGE=3805,u.GAMEACHIEVEMENTS=1689,u.GAMEINVITE=904,u.JOININGQUEUEFAILED=3035,u.JOINEDQUEUEMESSAGE=2260,u.LEFTQUEUE=1477,u.LOAD_GAME_URL=2624,u.LOADGAME=3654,u.UNLOADGAME=1715,u.ACHIEVEMENTRESOLUTIONCOMPLETED=740,u.ACHIEVEMENTRESOLUTIONPROGRESS=3370,u.ACHIEVEMENTRESOLUTIONS=66,u.GENERIC_ALERT=3801,u.MODERATOR_MESSAGE=2030,u.GENERIC_ERROR=1600,u.GIFT_WRAPPER_CONFIG=2234,u.GROUP_BADGES=2402,u.GROUP_CREATE_OPTIONS=2159,u.GROUP_FORUM_DATA=3011,u.GROUP_FORUM_LIST=3001,u.GROUP_FORUM_THREADS=1073,u.GROUP_FORUM_POST=2049,u.GROUP_FORUM_POST_THREAD=1862,u.GROUP_FORUM_THREAD_MESSAGES=509,u.GROUP_FORUM_UNREAD_COUNT=2379,u.GROUP_FORUM_UPDATE_MESSAGE=324,u.GROUP_FORUM_UPDATE_THREAD=2528,u.GROUP_INFO=1702,u.GROUP_LIST=420,u.GROUP_MEMBER=265,u.GROUP_MEMBERS=1200,u.GROUP_MEMBERS_REFRESH=2445,u.GROUP_MEMBER_REMOVE_CONFIRM=1876,u.GROUP_PURCHASED=2808,u.GROUP_SETTINGS=3965,u.GROUP_BADGE_PARTS=2238,u.GROUP_MEMBERSHIP_REQUESTED=1180,u.GROUP_DETAILS_CHANGED=1459,u.GROUP_HABBO_JOIN_FAILED=762,u.GUILD_EDIT_FAILED=3988,u.GUILD_MEMBER_MGMT_FAILED=818,u.ITEM_DIMMER_SETTINGS=2710,u.ITEM_STACK_HELPER=2816,u.ITEM_WALL=1369,u.ITEM_WALL_ADD=2187,u.ITEM_WALL_REMOVE=3208,u.ITEM_WALL_UPDATE=2009,u.MARKETPLACE_CONFIG=1823,u.MESSENGER_ACCEPT_FRIENDS=896,u.MESSENGER_CHAT=1587,u.MESSENGER_FIND_FRIENDS=1210,u.MESSENGER_FOLLOW_FAILED=3048,u.MESSENGER_FRIEND_NOTIFICATION=3082,u.MESSENGER_FRIENDS=3130,u.MESSENGER_INIT=1605,u.MESSENGER_INSTANCE_MESSAGE_ERROR=3359,u.MESSENGER_INVITE=3870,u.MESSENGER_INVITE_ERROR=462,u.MESSENGER_MESSAGE_ERROR=892,u.MESSENGER_MINIMAIL_COUNT=2803,u.MESSENGER_MINIMAIL_NEW=1911,u.MESSENGER_RELATIONSHIPS=2016,u.MESSENGER_REQUEST=2219,u.MESSENGER_REQUEST_ERROR=892,u.MESSENGER_REQUESTS=280,u.MESSENGER_SEARCH=973,u.MESSENGER_UPDATE=2800,u.MODERATION_REPORT_DISABLED=1651,u.MODERATION_TOOL=2696,u.MODERATION_USER_INFO=2866,u.MOTD_MESSAGES=2035,u.NAVIGATOR_CATEGORIES=1562,u.NAVIGATOR_COLLAPSED=1543,u.NAVIGATOR_EVENT_CATEGORIES=3244,u.NAVIGATOR_LIFTED=3104,u.NAVIGATOR_METADATA=3052,u.NAVIGATOR_OPEN_ROOM_CREATOR=2064,u.NAVIGATOR_SEARCH=2690,u.NAVIGATOR_SEARCHES=3984,u.NAVIGATOR_SETTINGS=518,u.THUMBNAIL_UPDATE_RESULT=1927,u.CAN_CREATE_ROOM=378,u.CATEGORIES_WITH_VISITOR_COUNT=1455,u.COMPETITION_ROOMS_DATA=3954,u.CONVERTED_ROOM_ID=1331,u.GUEST_ROOM_SEARCH_RESULT=52,u.NOTIFICATION_LIST=1992,u.NOTIFICATION_OFFER_REWARD_DELIVERED=2125,u.NOTIFICATION_SIMPLE_ALERT=5100,u.NOTIFICATION_ELEMENT_POINTER=1787,u.PET_FIGURE_UPDATE=1924,u.PET_INFO=2901,u.PET_TRAINING_PANEL=1164,u.PET_LEVEL_UPDATE=2824,u.PET_SCRATCH_FAILED=1130,u.PET_OPEN_PACKAGE_REQUESTED=2380,u.PET_OPEN_PACKAGE_RESULT=546,u.PET_BREEDING=1746,u.PET_CONFIRM_BREEDING_RESULT=1625,u.PET_GO_TO_BREEDING_NEST_FAILURE=2621,u.PET_NEST_BREEDING_SUCCESS=2527,u.PET_CONFIRM_BREEDING_REQUEST=634,u.PET_BREEDING_RESULT=1553,u.RECYCLER_PRIZES=3164,u.RECYCLER_STATUS=3433,u.RECYCLER_FINISHED=468,u.ROOM_BAN_LIST=1869,u.ROOM_BAN_REMOVE=3429,u.ROOM_CREATED=1304,u.ROOM_DOORBELL=2309,u.ROOM_DOORBELL_ACCEPTED=3783,u.ROOM_DOORBELL_REJECTED=878,u.ROOM_ENTER=758,u.ROOM_ENTER_ERROR=899,u.ROOM_FORWARD=160,u.ROOM_HEIGHT_MAP=2753,u.ROOM_HEIGHT_MAP_UPDATE=558,u.ROOM_INFO=687,u.ROOM_INFO_OWNER=749,u.ROOM_MODEL=1301,u.ROOM_MODEL_BLOCKED_TILES=3990,u.ROOM_MODEL_DOOR=1664,u.ROOM_MODEL_NAME=2031,u.ROOM_MUTED=2533,u.ROOM_MUTE_USER=826,u.ROOM_PAINT=2454,u.ROOM_PROMOTION=2274,u.ROOM_QUEUE_STATUS=2208,u.ROOM_RIGHTS=780,u.ROOM_RIGHTS_CLEAR=2392,u.ROOM_RIGHTS_LIST=1284,u.ROOM_RIGHTS_LIST_ADD=2088,u.ROOM_RIGHTS_LIST_REMOVE=1327,u.ROOM_RIGHTS_OWNER=339,u.ROOM_ROLLING=3207,u.ROOM_SCORE=482,u.ROOM_SETTINGS=1498,u.ROOM_SETTINGS_CHAT=1191,u.ROOM_SETTINGS_SAVE=948,u.ROOM_SETTINGS_SAVE_ERROR=1555,u.ROOM_INFO_UPDATED=3297,u.ROOM_SPECTATOR=1033,u.ROOM_THICKNESS=3547,u.ROOM_GET_FILTER_WORDS=2937,u.ROOM_MESSAGE_NOTIFICATION=1634,u.ROOM_POPULAR_TAGS_RESULT=2012,u.INFO_FEED_ENABLE=3284,u.SECURITY_MACHINE=1488,u.MYSTERY_BOX_KEYS=2833,u.GOTMYSTERYBOXPRIZEMESSAGE=3712,u.CANCELMYSTERYBOXWAITMESSAGE=596,u.SHOWMYSTERYBOXWAITMESSAGE=3201,u.TRADE_ACCEPTED=2568,u.TRADE_CLOSED=1373,u.TRADE_COMPLETED=1001,u.TRADE_CONFIRMATION=2720,u.TRADE_LIST_ITEM=2024,u.TRADE_NOT_OPEN=3128,u.TRADE_OPEN=2505,u.TRADE_OPEN_FAILED=217,u.TRADE_OTHER_NOT_ALLOWED=1254,u.TRADE_YOU_NOT_ALLOWED=3058,u.TRADE_NO_SUCH_ITEM=2873,u.UNIT=374,u.UNIT_CHANGE_NAME=2182,u.UNIT_CHAT=1446,u.UNIT_CHAT_SHOUT=1036,u.UNIT_CHAT_WHISPER=2704,u.UNIT_DANCE=2233,u.UNIT_EFFECT=1167,u.UNIT_EXPRESSION=1631,u.UNIT_HAND_ITEM=1474,u.UNIT_IDLE=1797,u.UNIT_INFO=3920,u.UNIT_NUMBER=2324,u.UNIT_REMOVE=2661,u.UNIT_STATUS=1640,u.UNIT_TYPING=1717,u.UNSEEN_ITEMS=2103,u.USER_ACHIEVEMENT_SCORE=1968,u.USER_BADGES=717,u.USER_BADGES_ADD=2493,u.USER_BADGES_CURRENT=1087,u.USER_BOT_REMOVE=233,u.USER_BOTS=3086,u.USER_CHANGE_NAME=118,u.USER_CLOTHING=1450,u.USER_CREDITS=3475,u.USER_CURRENCY=2018,u.ACTIVITY_POINT_NOTIFICATION=2275,u.USER_EFFECTS=340,u.USER_FAVORITE_ROOM=2524,u.USER_FAVORITE_ROOM_COUNT=151,u.USER_FIGURE=2429,u.USER_FURNITURE=994,u.USER_FURNITURE_ADD=104,u.USER_FURNITURE_POSTIT_PLACED=1501,u.USER_FURNITURE_REFRESH=3151,u.USER_FURNITURE_REMOVE=159,u.USER_HOME_ROOM=2875,u.ROOM_EVENT_CANCEL=3479,u.ROOM_EVENT=1840,u.USER_IGNORED=126,u.USER_IGNORED_RESULT=207,u.USER_INFO=2725,u.USER_OUTFITS=3315,u.USER_PERKS=2586,u.USER_PERMISSIONS=411,u.USER_PET_ADD=2101,u.USER_PET_REMOVE=3253,u.USER_PETS=3522,u.USER_PROFILE=3898,u.USER_RESPECT=2815,u.USER_SANCTION_STATUS=3679,u.USER_SETTINGS=513,u.USER_SUBSCRIPTION=954,u.USER_WARDROBE_PAGE=3315,u.USER_CLASSIFICATION=966,u.GET_USER_TAGS=1255,u.WIRED_ACTION=1434,u.WIRED_CONDITION=1108,u.WIRED_ERROR=156,u.WIRED_OPEN=1830,u.WIRED_REWARD=178,u.WIRED_SAVE=1155,u.WIRED_TRIGGER=383,u.PLAYING_GAME=448,u.FURNITURE_STATE_2=3431,u.REMOVE_BOT_FROM_INVENTORY=233,u.ADD_BOT_TO_INVENTORY=1352,u.ACHIEVEMENT_PROGRESSED=2107,u.MODTOOL_ROOM_INFO=1333,u.MODTOOL_USER_CHATLOG=3377,u.MODTOOL_ROOM_CHATLOG=3434,u.MODTOOL_VISITED_ROOMS_USER=1752,u.MODERATOR_ACTION_RESULT=2335,u.ISSUE_DELETED=3192,u.ISSUE_INFO=3609,u.ISSUE_PICK_FAILED=3150,u.CFH_CHATLOG=607,u.MODERATOR_TOOL_PREFERENCES=1576,u.LOVELOCK_FURNI_START=3753,u.LOVELOCK_FURNI_FRIEND_COMFIRMED=382,u.LOVELOCK_FURNI_FINISHED=770,u.GIFT_RECEIVER_NOT_FOUND=1517,u.GIFT_OPENED=56,u.FLOOD_CONTROL=566,u.REMAINING_MUTE=826,u.USER_EFFECT_LIST=340,u.USER_EFFECT_LIST_ADD=2867,u.USER_EFFECT_LIST_REMOVE=2228,u.USER_EFFECT_ACTIVATE=1959,u.AVATAR_EFFECT_SELECTED=3473,u.CLUB_GIFT_INFO=619,u.REDEEM_VOUCHER_ERROR=714,u.REDEEM_VOUCHER_OK=3336,u.IN_CLIENT_LINK=2023,u.BOT_COMMAND_CONFIGURATION=1618,u.BOT_SKILL_LIST_UPDATE=69,u.BOT_FORCE_OPEN_CONTEXT_MENU=296,u.HAND_ITEM_RECEIVED=354,u.PET_PLACING_ERROR=2913,u.BOT_ERROR=639,u.MARKETPLACE_SELL_ITEM=54,u.MARKETPLACE_ITEM_STATS=725,u.MARKETPLACE_OWN_ITEMS=3884,u.MARKETPLACE_CANCEL_SALE=3264,u.MARKETPLACE_ITEM_POSTED=1359,u.MARKETPLACE_ITEMS_SEARCHED=680,u.MARKETPLACE_AFTER_ORDER_STATUS=2032,u.CATALOG_RECEIVE_PET_BREEDS=3331,u.CATALOG_APPROVE_NAME_RESULT=1503,u.OBJECTS_DATA_UPDATE=1453,u.PET_EXPERIENCE=2156,u.COMMUNITY_GOAL_VOTE_EVENT=1435,u.PROMO_ARTICLES=286,u.COMMUNITY_GOAL_EARNED_PRIZES=3319,u.COMMUNITY_GOAL_PROGRESS=2525,u.CONCURRENT_USERS_GOAL_PROGRESS=2737,u.QUEST_DAILY=1878,u.QUEST_CANCELLED=3027,u.QUEST_COMPLETED=949,u.COMMUNITY_GOAL_HALL_OF_FAME=3005,u.EPIC_POPUP=3945,u.SEASONAL_QUESTS=1122,u.QUESTS=3625,u.QUEST=230,u.BONUS_RARE_INFO=1533,u.CRAFTABLE_PRODUCTS=1e3,u.CRAFTING_RECIPE=2774,u.CRAFTING_RECIPES_AVAILABLE=2124,u.CRAFTING_RESULT=618,u.CAMERA_PUBLISH_STATUS=2057,u.CAMERA_PURCHASE_OK=2783,u.CAMERA_STORAGE_URL=3696,u.CAMERA_SNAPSHOT=463,u.COMPETITION_STATUS=133,u.INIT_CAMERA=3878,u.THUMBNAIL_STATUS=3595,u.ACHIEVEMENT_NOTIFICATION=806,u.CLUB_GIFT_NOTIFICATION=2188,u.INTERSTITIAL_MESSAGE=1808,u.ROOM_AD_ERROR=1759,u.AVAILABILITY_TIME=600,u.HOTEL_CLOSED_AND_OPENS=3728,u.HOTEL_CLOSES_AND_OPENS_AT=2771,u.HOTEL_WILL_CLOSE_MINUTES=1050,u.HOTEL_MAINTENANCE=1350,u.JUKEBOX_PLAYLIST_FULL=105,u.JUKEBOX_SONG_DISKS=34,u.NOW_PLAYING=469,u.OFFICIAL_SONG_ID=1381,u.PLAYLIST=1748,u.PLAYLIST_SONG_ADDED=1140,u.TRAX_SONG_INFO=3365,u.USER_SONG_DISKS_INVENTORY=2602,u.CHECK_USER_NAME=563,u.CFH_SANCTION=2782,u.CFH_TOPICS=325,u.CFH_SANCTION_STATUS=2221,u.CAMPAIGN_CALENDAR_DATA=2531,u.CAMPAIGN_CALENDAR_DOOR_OPENED=2551,u.BUILDERS_CLUB_FURNI_COUNT=3828,u.BUILDERS_CLUB_SUBSCRIPTION=1452,u.CATALOG_PAGE_EXPIRATION=2668,u.CATALOG_EARLIEST_EXPIRY=2515,u.CLUB_GIFT_SELECTED=659,u.TARGET_OFFER_NOT_FOUND=1237,u.TARGET_OFFER=119,u.DIRECT_SMS_CLUB_BUY=195,u.ROOM_AD_PURCHASE=2468,u.NOT_ENOUGH_BALANCE=3914,u.LIMITED_OFFER_APPEARING_NEXT=44,u.IS_OFFER_GIFTABLE=761,u.CLUB_EXTENDED_OFFER=3964,u.SEASONAL_CALENDAR_OFFER=1889,u.COMPETITION_ENTRY_SUBMIT=1177,u.COMPETITION_VOTING_INFO=3506,u.COMPETITION_TIMING_CODE=1745,u.COMPETITION_USER_PART_OF=3841,u.COMPETITION_NO_OWNED_ROOMS=2064,u.COMPETITION_SECONDS_UNTIL=3926,u.BADGE_POINT_LIMITS=2501,u.BADGE_REQUEST_FULFILLED=2998,u.HELPER_TALENT_TRACK=3406,u.TALENT_TRACK_LEVEL=1203,u.TALENT_TRACK_LEVEL_UP=638,u.USER_BANNED=1683,u.BOT_RECEIVED=3684,u.PET_LEVEL_NOTIFICATION=859,u.PET_RECEIVED=1111,u.MODERATION_CAUTION=1890,u.YOUTUBE_CONTROL_VIDEO=1554,u.YOUTUBE_DISPLAY_PLAYLISTS=1112,u.YOUTUBE_DISPLAY_VIDEO=1411,u.CFH_DISABLED_NOTIFY=1651,u.QUESTION=2665,u.POLL_CONTENTS=2997,u.POLL_ERROR=662,u.POLL_OFFER=3785,u.POLL_ROOM_RESULT=5201,u.POLL_START_ROOM=5200,u.QUESTION_ANSWERED=2589,u.QUESTION_FINISHED=1066,u.CFH_PENDING_CALLS=1121,u.GUIDE_ON_DUTY_STATUS=1548,u.GUIDE_SESSION_ATTACHED=1591,u.GUIDE_SESSION_DETACHED=138,u.GUIDE_SESSION_ENDED=1456,u.GUIDE_SESSION_ERROR=673,u.GUIDE_SESSION_INVITED_TO_GUIDE_ROOM=219,u.GUIDE_SESSION_MESSAGE=841,u.GUIDE_SESSION_PARTNER_IS_TYPING=1016,u.GUIDE_SESSION_REQUESTER_ROOM=1847,u.GUIDE_SESSION_STARTED=3209,u.GUIDE_TICKET_CREATION_RESULT=3285,u.GUIDE_TICKET_RESOLUTION=2674,u.GUIDE_REPORTING_STATUS=3463,u.HOTEL_MERGE_NAME_CHANGE=1663,u.ISSUE_CLOSE_NOTIFICATION=934,u.QUIZ_DATA=2927,u.QUIZ_RESULTS=2772,u.CFH_PENDING_CALLS_DELETED=77,u.CFH_REPLY=3796,u.CHAT_REVIEW_SESSION_DETACHED=30,u.CHAT_REVIEW_SESSION_OFFERED_TO_GUIDE=735,u.CHAT_REVIEW_SESSION_RESULTS=3276,u.CHAT_REVIEW_SESSION_STARTED=143,u.CHAT_REVIEW_SESSION_VOTING_STATUS=1829,u.SCR_SEND_KICKBACK_INFO=3277,u.PET_STATUS=1907,u.GROUP_DEACTIVATE=3129,u.PET_RESPECTED=2788,u.PET_SUPPLEMENT=3441,u.NOOBNESS_LEVEL=3738,u.DISCONNECT_REASON=4e3,u.CAN_CREATE_ROOM_EVENT=2599,u.FAVORITE_GROUP_UDPATE=3403,u.NO_SUCH_FLAT=84,u.ROOM_SETTINGS_ERROR=2897,u.SHOW_ENFORCE_ROOM_CATEGORY=3896,u.CUSTOM_USER_NOTIFICATION=909,u.NEW_USER_EXPERIENCE_GIFT_OFFER=3575,u.RESTORE_CLIENT=426,u.FIREWORK_CHARGE_DATA=5210,u.NEW_USER_EXPERIENCE_NOT_COMPLETE=3639,u.CONNECTION_ERROR=1004,u.ACCOUNT_SAFETY_LOCK_STATUS_CHANGE=1243,u.PHONE_COLLECTION_STATE=2890,u.PHONE_TRY_NUMBER_RESULT=800,u.PHONE_TRY_VERIFICATION_CODE_RESULT=91,u.EXTENDED_PROFILE_CHANGED=876,u.WELCOME_GIFT_CHANGE_EMAIL_RESULT=2293,u.WELCOME_GIFT_STATUS=2707,u.HANDSHAKE_INIT_DIFFIE=1347,u.HANDSHAKE_COMPLETE_DIFFIE=3885,u.RENTABLE_SPACE_RENT_OK=2046,u.RENTABLE_SPACE_STATUS=3559,u.RENTABLE_SPACE_RENT_FAILED=1868,u.EMAIL_STATUS=612,u.CHANGE_EMAIL_RESULT=1815,u.WEEKLY_GAME_REWARD=2641,u.WEEKLY_GAME_REWARD_WINNERS=3097,u.WEEKLY_COMPETITIVE_LEADERBOARD=3512,u.WEEKLY_COMPETITIVE_FRIENDS_LEADERBOARD=3560,u.WEEKLY_GAME2_FRIENDS_LEADERBOARD=2270,u.WEEKLY_GAME2_LEADERBOARD=2196,u.RENTABLE_FURNI_RENT_OR_BUYOUT_OFFER=35,u.HANDSHAKE_IDENTITY_ACCOUNT=3523;let T=u;class ey extends I{constructor(t){super(t,wR)}getParser(){return this.parser}}class sy extends I{constructor(t){super(t,VR)}getParser(){return this.parser}}class iy extends I{constructor(t){super(t,YR)}getParser(){return this.parser}}class ry extends I{constructor(t){super(t,jR)}getParser(){return this.parser}}class ny extends I{constructor(t){super(t,zR)}getParser(){return this.parser}}class ay extends I{constructor(t){super(t,WR)}getParser(){return this.parser}}class oy extends I{constructor(t){super(t,kR)}getParser(){return this.parser}}class hy extends I{constructor(t){super(t,KR)}getParser(){return this.parser}}class jg extends I{constructor(t){super(t,qR)}getParser(){return this.parser}}class _y extends I{constructor(t){super(t,QR)}getParser(){return this.parser}}class ly extends I{constructor(t){super(t,JR)}getParser(){return this.parser}}class cy extends I{constructor(t){super(t,ZR)}getParser(){return this.parser}}class uy extends I{constructor(t){super(t,$R)}getParser(){return this.parser}}class dy extends I{constructor(t){super(t,xA)}getParser(){return this.parser}}class Ey extends I{constructor(t){super(t,BA)}getParser(){return this.parser}}class gy extends I{constructor(t){super(t,GA)}getParser(){return this.parser}}class fy extends I{constructor(t){super(t,wA)}getParser(){return this.parser}}class Iy extends I{constructor(t){super(t,VA)}getParser(){return this.parser}}class zg extends I{constructor(t){super(t,YA)}getParser(){return this.parser}}class Ty extends I{constructor(t){super(t,HA)}getParser(){return this.parser}}class my extends I{constructor(t){super(t,jA)}getParser(){return this.parser}}class py extends I{constructor(t){super(t,zA)}getParser(){return this.parser}}class Ry extends I{constructor(t){super(t,WA)}getParser(){return this.parser}}class Oy extends I{constructor(t){super(t,kA)}getParser(){return this.parser}}class Ay extends I{constructor(t){super(t,KA)}getParser(){return this.parser}}class Sy extends I{constructor(t){super(t,XA)}getParser(){return this.parser}}class Cy extends I{constructor(t){super(t,QA)}get userID(){return this.getParser().userID}get userAccepts(){return this.getParser().userAccepts}getParser(){return this.parser}}class My extends I{constructor(t){super(t,pc)}get userID(){return this.getParser().userID}getParser(){return this.parser}}class Ny extends I{constructor(t){super(t,JA)}getParser(){return this.parser}}class Dy extends I{constructor(t){super(t,ZA)}getParser(){return this.parser}}class Ly extends I{constructor(t){super(t,$A)}get firstUserID(){return this.getParser().firstUserID}get secondUserID(){return this.getParser().secondUserID}get firstUserNumItems(){return this.getParser().firstUserNumItems}get secondUserNumItems(){return this.getParser().secondUserNumItems}get firstUserNumCredits(){return this.getParser().firstUserNumCredits}get secondUserNumCredits(){return this.getParser().secondUserNumCredits}get firstUserItemArray(){return this.getParser().firstUserItemArray}get secondUserItemArray(){return this.getParser().secondUserItemArray}getParser(){return this.parser}}class Py extends I{constructor(t){super(t,tS)}getParser(){return this.parser}}class Uy extends I{constructor(t){super(t,eS)}getParser(){return this.parser}}class yy extends I{constructor(t){super(t,sS)}get userID(){return this.getParser().userID}get userCanTrade(){return this.getParser().userCanTrade}get otherUserID(){return this.getParser().otherUserID}get otherUserCanTrade(){return this.getParser().otherUserCanTrade}getParser(){return this.parser}}class vy extends I{constructor(t){super(t,Rc)}getParser(){return this.parser}}class by extends I{constructor(t){super(t,iS)}getParser(){return this.parser}}class Fy extends I{constructor(t){super(t,rS)}getParser(){return this.parser}}class xy extends I{constructor(t){super(t,fM)}getParser(){return this.parser}}class Gy extends I{constructor(t){super(t,IM)}getParser(){return this.parser}}class By extends I{constructor(t){super(t,TM)}getParser(){return this.parser}}class wy extends I{constructor(t){super(t,mM)}getParser(){return this.parser}}class Vy extends I{constructor(t){super(t,pM)}getParser(){return this.parser}}class Yy extends I{constructor(t){super(t,RM)}getParser(){return this.parser}}class Hy extends I{constructor(t){super(t,AM)}getParser(){return this.parser}}class jy extends I{constructor(t){super(t,OM)}getParser(){return this.parser}}class zy extends I{constructor(t){super(t,xc)}getParser(){return this.parser}}class Wy extends I{constructor(t){super(t,Gc)}getParser(){return this.parser}}class ky extends I{constructor(t){super(t,MM)}getParser(){return this.parser}}class Ky extends I{constructor(t){super(t,NM)}getParser(){return this.parser}}class Xy extends I{constructor(t){super(t,Pg)}getParser(){return this.parser}}class qy extends I{constructor(t){super(t,LM)}getParser(){return this.parser}}class Qy extends I{constructor(t){super(t,UM)}getParser(){return this.parser}}class Jy extends I{constructor(t){super(t,PM)}getParser(){return this.parser}}class Zy extends I{constructor(t){super(t,vM)}getParser(){return this.parser}}class $y extends I{constructor(t){super(t,bM)}getParser(){return this.parser}}class t0 extends I{constructor(t){super(t,GM)}getParser(){return this.parser}}class e0 extends I{constructor(t){super(t,BM)}getParser(){return this.parser}}class s0 extends I{constructor(t){super(t,VM)}getParser(){return this.parser}}class i0 extends I{constructor(t){super(t,YM)}getParser(){return this.parser}}class r0 extends I{constructor(t){super(t,zM)}getParser(){return this.parser}}class n0 extends I{constructor(t){super(t,WM)}getParser(){return this.parser}}class a0 extends I{constructor(t){super(t,KM)}getParser(){return this.parser}}class o0 extends I{constructor(t){super(t,XM)}getParser(){return this.parser}}class h0 extends I{constructor(t){super(t,qM)}getParser(){return this.parser}}class Wg extends I{constructor(t){super(t,QM)}getParser(){return this.parser}}class _0 extends I{constructor(t){super(t,JM)}getParser(){return this.parser}}class l0 extends I{constructor(t){super(t,Bc)}getParser(){return this.parser}}class c0 extends I{constructor(t){super(t,ZM)}getParser(){return this.parser}}class u0 extends I{constructor(t){super(t,aN)}getParser(){return this.parser}}class d0 extends I{constructor(t){super(t,oN)}getParser(){return this.parser}}class E0 extends I{constructor(t){super(t,hN)}getParser(){return this.parser}}class kg extends I{constructor(t){super(t,_N)}getParser(){return this.parser}get userName(){return this.getParser().userName}}class g0 extends I{constructor(t){super(t,lN)}getParser(){return this.parser}}class f0 extends I{constructor(t){super(t,cN)}getParser(){return this.parser}}class Hc extends I{constructor(t){super(t,uN)}getParser(){return this.parser}}class I0 extends I{constructor(t){super(t,dN)}getParser(){return this.parser}}class jc extends I{constructor(t){super(t,EN)}getParser(){return this.parser}}class T0 extends I{constructor(t){super(t,gN)}getParser(){return this.parser}}class m0 extends I{constructor(t){super(t,IN)}getParser(){return this.parser}}class p0 extends I{constructor(t){super(t,mN)}getParser(){return this.parser}}class R0 extends I{constructor(t){super(t,RN)}getParser(){return this.parser}}class O0 extends I{constructor(t){super(t,ON)}getParser(){return this.parser}}class A0 extends I{constructor(t){super(t,AN)}getParser(){return this.parser}}class S0 extends I{constructor(t){super(t,SN)}getParser(){return this.parser}}class C0 extends I{constructor(t){super(t,CN)}getParser(){return this.parser}}class M0 extends I{constructor(t){super(t,MN)}getParser(){return this.parser}}class N0 extends I{constructor(t){super(t,LN)}getParser(){return this.parser}}class D0 extends I{constructor(t){super(t,PN)}getParser(){return this.parser}}class L0 extends I{constructor(t){super(t,UN)}getParser(){return this.parser}}class P0 extends I{constructor(t){super(t,yN)}getParser(){return this.parser}}class U0 extends I{constructor(t){super(t,vN)}getParser(){return this.parser}}class y0 extends I{constructor(t){super(t,bN)}getParser(){return this.parser}}class v0 extends I{constructor(t){super(t,FN)}getParser(){return this.parser}}class b0 extends I{constructor(t){super(t,xN)}getParser(){return this.parser}}class F0 extends I{constructor(t){super(t,BN)}getParser(){return this.parser}}class x0 extends I{constructor(t){super(t,wN)}getParser(){return this.parser}}class Kg extends I{constructor(t){super(t,VN)}getParser(){return this.parser}}class G0 extends I{constructor(t){super(t,YN)}getParser(){return this.parser}}class B0 extends I{constructor(t){super(t,HN)}getParser(){return this.parser}}class w0 extends I{constructor(t){super(t,jN)}getParser(){return this.parser}}class V0 extends I{constructor(t){super(t,zN)}getParser(){return this.parser}}class Y0 extends I{constructor(t){super(t,WN)}getParser(){return this.parser}}class H0 extends I{constructor(t){super(t,kN)}getParser(){return this.parser}}class j0 extends I{constructor(t){super(t,KN)}getParser(){return this.parser}}class z0 extends I{constructor(t){super(t,XN)}getParser(){return this.parser}}class W0 extends I{constructor(t){super(t,qN)}getParser(){return this.parser}}class Xg extends I{constructor(t){super(t,QN)}getParser(){return this.parser}}class k0 extends I{constructor(t){super(t,JN)}getParser(){return this.parser}}class K0 extends I{constructor(t){super(t,ZN)}getParser(){return this.parser}}class X0 extends I{constructor(t){super(t,$N)}getParser(){return this.parser}}class q0{constructor(t){this._itemName=t.readString(),this._extraInfo=t.readString(),this._extraInfo==""&&(this._extraInfo=null)}get itemName(){return this._itemName}get extraInfo(){return this._extraInfo}}class Q0{constructor(t){this._thumbnailUrl=t.readString(),this._thumbnailUrl==""&&(this._thumbnailUrl=null),this._productOfferList=[];const e=t.readInt();let s=0;for(;s<e;)this._productOfferList.push(new q0(t)),s++}get productOfferList(){return this._productOfferList}get thumbnailUrl(){return this._thumbnailUrl}}class J0{flush(){return!0}parse(t){if(!t)return!1;const e=t.readInt();this._giftOptions=[];let s=0;for(;s<e;)this._giftOptions.push(new tv(t)),s++;return!0}get giftOptions(){return this._giftOptions}}class Z0{flush(){return!0}parse(t){return!!t}}class $0 extends I{constructor(t){super(t,J0)}getParser(){return this.parser}}class tv{constructor(t){this._dayIndex=t.readInt(),this._stepIndex=t.readInt(),this._options=[];const e=t.readInt();let s=0;for(;s<e;)this._options.push(new Q0(t)),s++}get dayIndex(){return this._dayIndex}get stepIndex(){return this._stepIndex}get options(){return this._options}}class ev extends I{constructor(t){super(t,Z0)}getParser(){return this.parser}}class sv extends I{constructor(t){super(t,eD)}getParser(){return this.parser}}class iv extends I{constructor(t){super(t,mc)}getParser(){return this.parser}}class qg extends I{constructor(t){super(t,sD)}getParser(){return this.parser}}class Qg extends I{constructor(t){super(t,iD)}getParser(){return this.parser}}class Jg extends I{constructor(t){super(t,rD)}getParser(){return this.parser}}class Zg extends I{constructor(t){super(t,nD)}getParser(){return this.parser}}class rv extends I{constructor(t){super(t,aD)}getParser(){return this.parser}}class $g extends I{constructor(t){super(t,_D)}getParser(){return this.parser}}class tf extends I{constructor(t){super(t,lD)}getParser(){return this.parser}}class ef extends I{constructor(t){super(t,cD)}getParser(){return this.parser}}class sf extends I{constructor(t){super(t,uD)}getParser(){return this.parser}}class rf extends I{constructor(t){super(t,ED)}getParser(){return this.parser}}class nf extends I{constructor(t){super(t,dD)}getParser(){return this.parser}}class af extends I{constructor(t){super(t,gD)}getParser(){return this.parser}}class of extends I{constructor(t){super(t,fD)}getParser(){return this.parser}}class nv extends I{constructor(t){super(t,mD)}getParser(){return this.parser}}class av extends I{constructor(t){super(t,OD)}getParser(){return this.parser}}class ov extends I{constructor(t){super(t,AD)}getParser(){return this.parser}}class hv extends I{constructor(t){super(t,SD)}getParser(){return this.parser}}class _v extends I{constructor(t){super(t,CD)}getParser(){return this.parser}}class lv extends I{constructor(t){super(t,MD)}getParser(){return this.parser}}class cv extends I{constructor(t){super(t,ND)}getParser(){return this.parser}}class uv extends I{constructor(t){super(t,DD)}getParser(){return this.parser}}class dv extends I{constructor(t){super(t,LD)}getParser(){return this.parser}}class Ev extends I{constructor(t){super(t,PD)}getParser(){return this.parser}}class gv extends I{constructor(t){super(t,UD)}getParser(){return this.parser}}const C_=class C_ extends I{constructor(t){super(t,yD)}getParser(){return this.parser}};C_.FINISHED_OK=1,C_.FINISHED_FAIL=2;let zc=C_;const Pa=class Pa extends I{constructor(t){super(t,vD)}getParser(){return this.parser}};Pa.SYSTEM_STATUS_ENABLED=1,Pa.SYSTEM_STATUS_DISABLED=2,Pa.SYSTEM_STATUS_TIMEOUT=3;let Wc=Pa;class kc extends I{constructor(t){super(t,tO)}getParser(){return this.parser}}class Kc extends I{constructor(t){super(t,eO)}getParser(){return this.parser}}class Xc extends I{constructor(t){super(t,iO)}getParser(){return this.parser}}class qc extends I{constructor(t){super(t,sO)}getParser(){return this.parser}}class fv extends I{constructor(t){super(t,gc)}getParser(){return this.parser}}class Qc extends I{constructor(t){super(t,rO)}getParser(){return this.parser}}class Iv extends I{constructor(t){super(t,nO)}getParser(){return this.parser}}class Tv extends I{constructor(t){super(t,aO)}getParser(){return this.parser}}class mv extends I{constructor(t){super(t,oO)}getParser(){return this.parser}}class pv extends I{constructor(t){super(t,_O)}getParser(){return this.parser}}class Rv extends I{constructor(t){super(t,AO)}getParser(){return this.parser}}class Ov extends I{constructor(t){super(t,SO)}getParser(){return this.parser}}class Av extends I{constructor(t){super(t,CO)}getParser(){return this.parser}}class hf extends I{constructor(t){super(t,MO)}getParser(){return this.parser}}class Jc extends I{constructor(t){super(t,rA)}getParser(){return this.parser}}class Zc extends I{constructor(t){super(t,nA)}getParser(){return this.parser}}class Sv extends I{constructor(t){super(t,DO)}getParser(){return this.parser}}class $c extends I{constructor(t){super(t,LO)}getParser(){return this.parser}}class tu extends I{constructor(t){super(t,PO)}getParser(){return this.parser}}class eu extends I{constructor(t){super(t,UO)}getParser(){return this.parser}}class su extends I{constructor(t){super(t,yO)}getParser(){return this.parser}}class iu extends I{constructor(t){super(t,vO)}getParser(){return this.parser}}class Cv extends I{constructor(t){super(t,bO)}getParser(){return this.parser}}class ru extends I{constructor(t){super(t,FO)}getParser(){return this.parser}}class nu extends I{constructor(t){super(t,rr)}getParser(){return this.parser}}class Mv extends I{constructor(t){super(t,xO)}getParser(){return this.parser}}class Nv extends I{constructor(t){super(t,GO)}getParser(){return this.parser}}class au extends I{constructor(t){super(t,BO)}getParser(){return this.parser}}class Dv extends I{constructor(t){super(t,wO)}getParser(){return this.parser}}class Lv extends I{constructor(t){super(t,VO)}getParser(){return this.parser}}class Pv extends I{constructor(t){super(t,YO)}getParser(){return this.parser}}class ou extends I{constructor(t){super(t,HO)}getParser(){return this.parser}}class Uv extends I{constructor(t){super(t,jO)}getParser(){return this.parser}}class yv extends I{constructor(t){super(t,zO)}getParser(){return this.parser}}class vv extends I{constructor(t){super(t,Tc)}getParser(){return this.parser}}class bv extends I{constructor(t){super(t,WO)}getParser(){return this.parser}}class _f extends I{constructor(t){super(t,KO)}getParser(){return this.parser}}class Fv extends I{constructor(t){super(t,XO)}getParser(){return this.parser}}class hu extends I{constructor(t){super(t,qO)}getParser(){return this.parser}}class _u extends I{constructor(t){super(t,QO)}getParser(){return this.parser}}class lu extends I{constructor(t){super(t,JO)}getParser(){return this.parser}}class cu extends I{constructor(t){super(t,ZO)}getParser(){return this.parser}}class xv extends I{constructor(t){super(t,$O)}getParser(){return this.parser}}class Gv extends I{constructor(t){super(t,tA)}getParser(){return this.parser}}class Bv extends I{constructor(t){super(t,sA)}getParser(){return this.parser}}class wv extends I{constructor(t){super(t,iA)}getParser(){return this.parser}}class uu extends I{constructor(t){super(t,wo)}getParser(){return this.parser}}class du extends I{constructor(t){super(t,aA)}getParser(){return this.parser}}class Eu extends I{constructor(t){super(t,Zi)}getParser(){return this.parser}}class gu extends I{constructor(t){super(t,oA)}getParser(){return this.parser}}class Vv extends I{constructor(t){super(t,hA)}getParser(){return this.parser}}class fu extends I{constructor(t){super(t,_A)}getParser(){return this.parser}}class kn extends I{constructor(t){super(t,lA)}getParser(){return this.parser}}class Iu extends I{constructor(t){super(t,cA)}getParser(){return this.parser}}class lf extends I{constructor(t){super(t,uA)}getParser(){return this.parser}}class cf extends I{constructor(t){super(t,dA)}getParser(){return this.parser}}class Ho extends I{constructor(t){super(t,EA)}getParser(){return this.parser}}class uf extends I{constructor(t){super(t,gA)}getParser(){return this.parser}}class df extends I{constructor(t){super(t,fA)}getParser(){return this.parser}}class Ef extends I{constructor(t){super(t,TA)}getParser(){return this.parser}}class gf extends I{constructor(t){super(t,mA)}getParser(){return this.parser}}class ff extends I{constructor(t){super(t,pA)}getParser(){return this.parser}}class If extends I{constructor(t){super(t,RA)}getParser(){return this.parser}}class zd extends I{constructor(t){super(t,Vd)}getParser(){return this.parser}}class jo extends I{constructor(t){super(t,Vd)}getParser(){return this.parser}}class zo extends I{constructor(t){super(t,Vd)}getParser(){return this.parser}}class Tu extends I{constructor(t){super(t,OA)}getParser(){return this.parser}}class Wo extends I{constructor(t){super(t,AA)}getParser(){return this.parser}}class mu extends I{constructor(t){super(t,SA)}getParser(){return this.parser}}class ko extends I{constructor(t){super(t,UA)}getParser(){return this.parser}}class pu extends I{constructor(t){super(t,CA)}getParser(){return this.parser}}class Ru extends I{constructor(t){super(t,MA)}getParser(){return this.parser}}class Tf extends I{constructor(t){super(t,NA)}getParser(){return this.parser}}class Ou extends I{constructor(t){super(t,DA)}getParser(){return this.parser}}class Ko extends I{constructor(t){super(t,LA)}getParser(){return this.parser}}class Au extends I{constructor(t){super(t,PA)}getParser(){return this.parser}}class Xo extends I{constructor(t){super(t,yA)}getParser(){return this.parser}}class Su extends I{constructor(t){super(t,FA)}getParser(){return this.parser}}class Yv extends I{constructor(t){super(t,GD)}getParser(){return this.parser}}class Hv extends I{constructor(t){super(t,BD)}getParser(){return this.parser}}class jv extends I{constructor(t){super(t,wD)}getParser(){return this.parser}}class zv extends I{constructor(t){super(t,VD)}getParser(){return this.parser}}const M_=class M_ extends I{constructor(t){super(t,YD)}getParser(){return this.parser}};M_.PRODUCT_DONATED_CODE=6,M_.BADGE_DONATED_CODE=7;let Cu=M_;class Wv extends I{constructor(t){super(t,HD)}getParser(){return this.parser}}class kv extends I{constructor(t){super(t,jD)}getParser(){return this.parser}}class Kv extends I{constructor(t){super(t,cO)}getParser(){return this.parser}}class Xv extends I{constructor(t){super(t,dO)}getParser(){return this.parser}}class qv extends I{constructor(t){super(t,EO)}getParser(){return this.parser}}class Qv extends I{constructor(t){super(t,gO)}getParser(){return this.parser}}class Jv extends I{constructor(t){super(t,fO)}getParser(){return this.parser}}class Zv extends I{constructor(t){super(t,IO)}getParser(){return this.parser}}class $v extends I{constructor(t){super(t,TO)}getParser(){return this.parser}}class tb extends I{constructor(t){super(t,mO)}getParser(){return this.parser}}class eb extends I{constructor(t){super(t,pO)}getParser(){return this.parser}}class sb extends I{constructor(t){super(t,Ic)}getParser(){return this.parser}}class ib extends I{constructor(t){super(t,RO)}getParser(){return this.parser}}class rb extends I{constructor(t){super(t,OO)}getParser(){return this.parser}}class mf extends I{constructor(t){super(t,zD)}getParser(){return this.parser}}class pf extends I{constructor(t){super(t,WD)}getParser(){return this.parser}}class Rf extends I{constructor(t){super(t,kD)}getParser(){return this.parser}}class Of extends I{constructor(t){super(t,KD)}getParser(){return this.parser}}class nb extends I{constructor(t){super(t,XD)}getParser(){return this.parser}}class ab extends I{constructor(t){super(t,qD)}getParser(){return this.parser}}class ob extends I{constructor(t){super(t,QD)}getParser(){return this.parser}}class Af extends I{constructor(t){super(t,ZD)}getParser(){return this.parser}}class Sf extends I{constructor(t){super(t,$D)}getParser(){return this.parser}}class hb extends I{constructor(t){super(t,tL)}getParser(){return this.parser}}class _b extends I{constructor(t){super(t,sL)}getParser(){return this.parser}}class lb extends I{constructor(t){super(t,rL)}getParser(){return this.parser}}class Cf extends I{constructor(t){super(t,fR)}getParser(){return this.parser}}class Mf extends I{constructor(t){super(t,xo)}getParser(){return this.parser}}class cb extends I{constructor(t){super(t,IR)}getParser(){return this.parser}}class ub extends I{constructor(t){super(t,lc)}getParser(){return this.parser}}class db extends I{constructor(t){super(t,mR)}getParser(){return this.parser}}class Nf extends I{constructor(t){super(t,pR)}getParser(){return this.parser}}class qo extends I{constructor(t){super(t,OR)}getParser(){return this.parser}}class Wd extends I{constructor(t){super(t,AR)}getParser(){return this.parser}}class Eb extends I{constructor(t){super(t,SR)}getParser(){return this.parser}}class gb extends I{constructor(t){super(t,CR)}getParser(){return this.parser}}class Df extends I{constructor(t){super(t,MR)}getParser(){return this.parser}}class Lf extends I{constructor(t){super(t,NR)}getParser(){return this.parser}}class fb extends I{constructor(t){super(t,DR)}getParser(){return this.parser}}class Ib extends I{constructor(t){super(t,LR)}getParser(){return this.parser}}class Tb extends I{constructor(t){super(t,PR)}getParser(){return this.parser}}class mb extends I{constructor(t){super(t,cc)}getParser(){return this.parser}}class pb extends I{constructor(t){super(t,UR)}getParser(){return this.parser}}class Rb extends I{constructor(t){super(t,yR)}getParser(){return this.parser}}class Pf extends I{constructor(t){super(t,vR)}getParser(){return this.parser}}class Ob extends I{constructor(t){super(t,uc)}getParser(){return this.parser}}class Uf extends I{constructor(t){super(t,bR)}getParser(){return this.parser}}class kd extends I{constructor(t){super(t,FR)}getParser(){return this.parser}}class yf extends I{constructor(t){super(t,xR)}getParser(){return this.parser}}class Ab extends I{constructor(t){super(t,GR)}getParser(){return this.parser}}class Sb extends I{constructor(t){super(t,BR)}getParser(){return this.parser}}class Cb extends I{constructor(t){super(t,dc)}getParser(){return this.parser}}const is=class is{constructor(t){this._type=t.readInt(),this._userId=t.readInt(),this._userName=t.readString(),this._figure=t.readString(),this._memberSince=t.readString()}get userId(){return this._userId}get userName(){return this._userName}get admin(){return this._type==is.TYPE_ADMIN}get owner(){return this._type==is.TYPE_OWNER}get pending(){return this._type==is.TYPE_PENDING}get member(){return this._type!=is.TYPE_MEMBER}get blocked(){return this._type==is.TYPE_BLOCKED}get figure(){return this._figure}get memberSince(){return this._memberSince}};is.TYPE_OWNER=0,is.TYPE_ADMIN=1,is.TYPE_PENDING=2,is.TYPE_MEMBER=3,is.TYPE_BLOCKED=4;let Mu=is;class vf extends I{constructor(t){super(t,nS)}getParser(){return this.parser}}class bf extends I{constructor(t){super(t,aS)}getParser(){return this.parser}}class Ff extends I{constructor(t){super(t,oS)}getParser(){return this.parser}}class Mb extends I{constructor(t){super(t,lS)}getParser(){return this.parser}}class Nb extends I{constructor(t){super(t,cS)}getParser(){return this.parser}}class Db extends I{constructor(t){super(t,uS)}getParser(){return this.parser}}class Lb extends I{constructor(t){super(t,aL)}getParser(){return this.parser}}class Pb{constructor(){this._data=[]}dispose(){}getMessageArray(){return this._data}}class Ub{constructor(){this._data=[]}dispose(){}getMessageArray(){return this._data}}class yb{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class vb{constructor(t){this._data=[t]}dispose(){this._data=null}getMessageArray(){return this._data}}class bb{constructor(t){this._data=[t]}dispose(){this._data=null}getMessageArray(){return this._data}}class Fb{constructor(t=0){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class xb{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class Gb{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class Bb{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class wb{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class Qo{constructor(t="",e="",s="",i=-1,r=-1){this._data=[]}getMessageArray(){return this._data}dispose(){this._data=[]}assignBitmap(t){const e=Ut.generateImageUrl(t);if(!e)return;const s=e.split(",")[1],i=Uint8Array.from(atob(s),r=>r.charCodeAt(0));this._data.push(i.byteLength,i.buffer)}assignBase64(t){const e=t.split(",")[1],s=Uint8Array.from(atob(e),i=>i.charCodeAt(0));this._data.push(s.byteLength,s.buffer)}}class Nu extends Qo{constructor(t="",e="",s="",i=-1,r=-1){super(t,e,s,i,r)}}class Vb{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class Yb{constructor(t,e){this._data=[t,e]}dispose(){this._data=null}getMessageArray(){return this._data}}class Hb{constructor(t,e){this._data=[t,e]}dispose(){this._data=null}getMessageArray(){return this._data}}class jb{constructor(t,e,s,i,r,a){this._data=[t,e,s,i,r,a]}dispose(){this._data=null}getMessageArray(){return this._data}}class zb{constructor(t,e,s,i){this._data=[t,e,s,i]}dispose(){this._data=null}getMessageArray(){return this._data}}class Wb{constructor(){this._data=[]}dispose(){this._data=null}getMessageArray(){return this._data}}class kb{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class Kb{constructor(){this._data=[]}dispose(){this._data=null}getMessageArray(){return this._data}}class Xb{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class qb{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class Qb{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class Jb{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class Zb{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){this._data=null}}class $b{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){this._data=null}}class tF{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){this._data=null}}class eF{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class sF{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){this._data=null}}class iF{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){this._data=null}}class rF{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){this._data=null}}class nF{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){this._data=null}}class aF{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){this._data=null}}class oF{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class hF{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){this._data=null}}class _F{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){this._data=null}}class lF{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class cF{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class uF{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class dF{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){this._data=null}}class EF{constructor(t,e,s,i,r,a,o,h,_){this._data=[t,e,s,i,r,a,o,h,_]}getMessageArray(){return this._data}dispose(){}}class gF{constructor(t,e,s,i){this._data=[t,e,s,i]}getMessageArray(){return this._data}dispose(){}}class fF{constructor(t,e,s,i,r,a,o){this._data=[t,e,s,i,r,a,o]}getMessageArray(){return this._data}dispose(){}}class IF{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class TF{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class mF{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class pF{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class RF{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class OF{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class AF{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class SF{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class CF{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class MF{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class NF{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class DF{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class LF{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class PF{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}const Dn=class Dn{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}};Dn.CONFIRM_LEVEL_NOT_ACCEPTED=0,Dn.CONFIRM_LEVEL_NOT_SUBMITTED=1,Dn.CONFIRM_LEVEL_NOT_CONFIRMED=2,Dn.CONFIRM_LEVEL_COMMIT=3;let Du=Dn;class UF{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class yF{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class vF{constructor(t,e){this._data=[t,e.length].concat(e)}getMessageArray(){return this._data}dispose(){}}class bF{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class FF{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class xF{constructor(t,e){this._data=[t,e.length].concat(e)}getMessageArray(){return this._data}dispose(){}}class GF{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class BF{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class wF{constructor(...t){this._data=[t.length,...t]}getMessageArray(){return this._data}dispose(){}}class VF{constructor(t,...e){this._data=[t,e.length,...e]}getMessageArray(){return this._data}dispose(){}}class YF{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class HF{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class jF{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class zF{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class WF{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class kF{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class KF{constructor(...t){this._data=[t.length,...t]}getMessageArray(){return this._data}dispose(){}}class XF{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class qF{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class QF{constructor(t,e){this._data=[e.length,...e,t]}getMessageArray(){return this._data}dispose(){}}class JF{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class ZF{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class $F{constructor(t=!0){this._data=[t]}dispose(){this._data=null}getMessageArray(){return this._data}}class tx{constructor(t){this._data=[t]}dispose(){this._data=null}getMessageArray(){return this._data}}class ex{constructor(t){this._data=[t]}dispose(){this._data=null}getMessageArray(){return this._data}}class sx{constructor(){this._data=[]}dispose(){this._data=null}getMessageArray(){return this._data}}class ix{constructor(){this._data=[]}dispose(){this._data=null}getMessageArray(){return this._data}}class rx{constructor(t){this._data=[t]}dispose(){this._data=null}getMessageArray(){return this._data}}class nx{constructor(t){this._data=[t]}dispose(){this._data=null}getMessageArray(){return this._data}}class ax{constructor(t,e){this._data=[t,e]}dispose(){this._data=null}getMessageArray(){return this._data}}class ox{constructor(t){this._data=[t]}dispose(){this._data=null}getMessageArray(){return this._data}}class hx{constructor(){this._data=[]}dispose(){this._data=null}getMessageArray(){return this._data}}class _x{constructor(){this._data=[]}dispose(){this._data=null}getMessageArray(){return this._data}}class lx{constructor(t){this._data=[t]}dispose(){this._data=null}getMessageArray(){return this._data}}class xf{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class cx{constructor(t){this._data=[t]}dispose(){this._data=null}getMessageArray(){return this._data}}class ux{constructor(t){this._data=[t]}dispose(){this._data=null}getMessageArray(){return this._data}}class dx{constructor(t){this._data=[t]}dispose(){this._data=null}getMessageArray(){return this._data}}class Ex{constructor(t){this._data=[t]}dispose(){this._data=null}getMessageArray(){return this._data}}class gx{constructor(t,e,s,i,r,a){this._data=[t,e,s,i,r,a]}dispose(){this._data=null}getMessageArray(){return this._data}}class fx{constructor(t,e,s,i,r,a){this._data=[t,e,s,i,r,a]}dispose(){this._data=null}getMessageArray(){return this._data}}class Ix{constructor(t){this._data=[t]}dispose(){this._data=null}getMessageArray(){return this._data}}class Tx{constructor(t){this._data=[t]}dispose(){this._data=null}getMessageArray(){return this._data}}const AE=class AE{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}};AE.NO_ISSUE_ID=-1;let Lu=AE;class mx{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}const SE=class SE{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}};SE.NO_ISSUE_ID=-1;let Pu=SE;class px{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class Rx{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class Ox{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class Ax{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class Sx{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class Cx{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class Mx{constructor(t,e,s,i,r,a){this._data=[t,e,s,i,r,a.length,...a]}getMessageArray(){return this._data}dispose(){}}class Nx{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class Dx{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class Lx{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class Px{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class Ux{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class yx{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class vx{constructor(t,e,s,i){this._data=[t,e,s,i]}getMessageArray(){return this._data}dispose(){}}class bx{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class Fx{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class xx{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class Gx{constructor(t,e){this._data=[t,e.length,...e]}getMessageArray(){return this._data}dispose(){}}class Bx{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class wx{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class Vx{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class Yx{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class Hx{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class jx{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class zx{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class Wx{constructor(t,e,s,i){this._data=[t,e,s,i]}getMessageArray(){return this._data}dispose(){}}class kx{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class Kx{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class Xx{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class qx{constructor(t,e,s,i){this._data=[t,e,s,i]}getMessageArray(){return this._data}dispose(){}}class Qx{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class Jx{constructor(t,e,s,i){this._data=[t,e,s,i]}getMessageArray(){return this._data}dispose(){}}class Zx{constructor(...t){this._data=[t.length],t.forEach(e=>{this._data.push(e.k),this._data.push(e._arg_2),this._data.push(e._arg_3)})}getMessageArray(){return this._data}dispose(){}}class $x{constructor(t,e,s,i,r){this._data=[t,e,s,i,r]}getMessageArray(){return this._data}dispose(){}}class t1{constructor(t,e,s,i){this._data=[t,e,i,s]}getMessageArray(){return this._data}dispose(){}}class e1{constructor(t,e,s){if(this._type=t,e.length===s.length){this._data=[];for(let i=0;i<e.length;i++)this._data.push(e[i]),this._data.push(s[i])}}getMessageArray(){return this._data}dispose(){}}class Gf{constructor(t,e,s,i){this._data=[`NITRO-${Lo.RENDERER_VERSION.replaceAll(".","-")}`,"HTML5",Sl.HTML5,Al.BROWSER]}getMessageArray(){return this._data}dispose(){}}class s1{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class i1{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class Bf{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class r1{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class wf{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class Vf{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class Yf{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class n1{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class a1{constructor(t,e,s,i,r){this._data=[t,e,s,i,r]}getMessageArray(){return this._data}dispose(){}}class o1{constructor(t,e,s,i){this._data=[t,e,s,i]}getMessageArray(){return this._data}dispose(){}}class h1{constructor(t,e,s,i){this._data=[t,e,s,i.length/2,...i]}getMessageArray(){return this._data}dispose(){}}class _1{constructor(t,e,s,i,r){this._data=[t,e,s,i,r]}getMessageArray(){return this._data}dispose(){}}class l1{constructor(t,e,s,i,r){this._data=[t,e,s,i,r]}getMessageArray(){return this._data}dispose(){}}class c1{constructor(t,e,s,i,r){this._data=[t,e,s,i,r.length/2,...r]}getMessageArray(){return this._data}dispose(){}}class u1{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class d1{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class E1{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class g1{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class f1{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class I1{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class T1{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class m1{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class p1{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class R1{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class O1{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class A1{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class S1{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class C1{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class M1{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class N1{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class D1{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class L1{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class P1{constructor(t,e,s,i){this._data=[t,e,s,i]}getMessageArray(){return this._data}dispose(){}}class U1{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class y1{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class v1{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class b1{constructor(t,e){this._data=[t,e.length,...e]}getMessageArray(){return this._data}dispose(){}}class F1{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class x1{constructor(t){this._data=[t]}dispose(){this._data=null}getMessageArray(){return this._data}}class G1{constructor(t){this._data=[t]}dispose(){this._data=null}getMessageArray(){return this._data}}class B1{constructor(){this._data=[]}dispose(){this._data=null}getMessageArray(){return this._data}}class w1{constructor(t){this._data=[t]}dispose(){this._data=null}getMessageArray(){return this._data}}class V1{constructor(t){this._data=[t]}dispose(){this._data=null}getMessageArray(){return this._data}}class Y1{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class H1{constructor(){this._badges=[]}getMessageArray(){const t=[];for(let e=1;e<=this._badges.length;e++)t.push(e),t.push(this._badges[e-1]);return t}dispose(){}addActivatedBadge(t){this._badges.push(t)}}class ig{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class j1{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class z1{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class W1{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class k1{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class K1{constructor(t,e,s,i){this._data=[t,e,s,i]}getMessageArray(){return this._data}dispose(){}}class rg{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class X1{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class q1{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class Q1{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class J1{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class Z1{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class $1{constructor(...t){this._data=[t.length,...t]}getMessageArray(){return this._data}dispose(){}}class tG{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class eG{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class sG{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class iG{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class rG{constructor(t,...e){this._data=[t,e.length,...e]}getMessageArray(){return this._data}dispose(){}}class nG{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class aG{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class oG{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){this._data=null}}class hG{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){this._data=null}}class _G{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){this._data=null}}class lG{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class cG{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){this._data=null}}class uG{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){this._data=null}}class dG{constructor(t,e,s,i){this._data=[t,e,s,i]}getMessageArray(){return this._data}dispose(){this._data=null}}class EG{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){this._data=null}}class gG{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class fG{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){this._data=null}}class IG{constructor(t,e,s){this._data=[t,e.length,...e,s]}getMessageArray(){return this._data}dispose(){}}const Ua=class Ua{constructor(t,e){this._data=[e,t.length,...t]}getMessageArray(){return this._data}dispose(){}};Ua.RESOLUTION_USELESS=1,Ua.RESOLUTION_ABUSIVE=2,Ua.RESOLUTION_RESOLVED=3;let Uu=Ua;const N_=class N_{constructor(t,e,s,i,r,a=-1){this._data=[t,e,s,i,r],a!=N_.NO_ISSUE_ID&&this._data.push(a)}getMessageArray(){return this._data}dispose(){}};N_.NO_ISSUE_ID=-1;let Si=N_;class TG{constructor(t,e,s,i=-1){this._data=[t,e,s],i!=Si.NO_ISSUE_ID&&this._data.push(i)}getMessageArray(){return this._data}dispose(){}}class mG{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class pG{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class RG{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class OG{constructor(t,e=0){this._data=[e,t]}getMessageArray(){return this._data}dispose(){}}class AG{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class SG{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class CG{constructor(t,e,s,i=-1){this._data=[t,e,s],i!=Si.NO_ISSUE_ID&&this._data.push(i)}getMessageArray(){return this._data}dispose(){}}class MG{constructor(t,e,s,i){this._data=[t,e,s,i]}getMessageArray(){return this._data}dispose(){}}const Ln=class Ln{constructor(t,e,s){this._data=[],this._data.push(t),this._data.push(e),this._data.push(s)}getMessageArray(){return this._data}dispose(){}};Ln.ACTION_ALERT=0,Ln.ACTION_KICK=1,Ln.ACTION_MESSAGE=3,Ln.ACTION_MESSAGE_AND_SOFT_KICK=4;let yu=Ln;class NG{constructor(t,e,s,i=-1){this._data=[t,e,s],i!=Si.NO_ISSUE_ID&&this._data.push(i)}getMessageArray(){return this._data}dispose(){}}class DG{constructor(t,e,s,i=-1){this._data=[],this._data.push(t),this._data.push(e),this._data.push(""),this._data.push(""),this._data.push(s),i!=Si.NO_ISSUE_ID&&this._data.push(i)}getMessageArray(){return this._data}dispose(){}}class LG{constructor(t,e,s,i=-1){this._data=[t,e,s],i!=Si.NO_ISSUE_ID&&this._data.push(i)}getMessageArray(){return this._data}dispose(){}}class PG{constructor(t,e,s,i){this._data=[t,e,s,i]}getMessageArray(){return this._data}dispose(){}}class UG{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class yG{constructor(t,e,s,i,r=-1){this._data=[t,e,s,i],r!=Si.NO_ISSUE_ID&&this._data.push(r)}getMessageArray(){return this._data}dispose(){}}class vG{constructor(t,e,s,i){this._data=[t.length,...t,e,s,i]}getMessageArray(){return this._data}dispose(){}}class bG{constructor(t){this._data=[t.length,...t]}getMessageArray(){return this._data}dispose(){}}class FG{constructor(t){this._data=[t]}dispose(){this._data=null}getMessageArray(){return this._data}}class xG{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class GG{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class BG{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class wG{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class VG{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class YG{constructor(t,e,s,i,r,a){this._data=[t,e,s,i,r,a]}getMessageArray(){return this._data}dispose(){}}class HG{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class jG{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class zG{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class WG{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class kG{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class KG{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class XG{constructor(t,e,s){this._data=[t,e?1:0,s?1:0]}getMessageArray(){return this._data}dispose(){}}class qG{constructor(t=0){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class QG{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class JG{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class ZG{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class $G{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class tB{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class eB{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class sB{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class iB{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class rB{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class nB{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class aB{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class oB{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class hB{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class _B{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class lB{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class cB{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class uB{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class dB{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class EB{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class gB{constructor(t,e,s,i,r,a){this._data=[t,e,s,i,r,a]}getMessageArray(){return this._data}dispose(){}}class fB{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class IB{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class TB{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class mB{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class pB{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class RB{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class OB{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class AB{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class SB{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class CB{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class MB{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class NB{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class DB{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class LB{constructor(t,e,s,i){this._data=[t,e,s,i]}getMessageArray(){return this._data}dispose(){}}class PB{constructor(...t){this._data=[t.length*3],t.forEach(e=>{this._data.push(e.dayIndex),this._data.push(e.stepIndex),this._data.push(e.giftIndex)})}dispose(){this._data=null}getMessageArray(){return this._data}}class Hf{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}const d=class d{};d.ACHIEVEMENT_LIST=219,d.AUTHENTICATION=-1,d.BOT_CONFIGURATION=1986,d.BOT_PICKUP=3323,d.BOT_PLACE=1592,d.BOT_SKILL_SAVE=2624,d.GET_CLUB_OFFERS=3285,d.GET_CLUB_GIFT_INFO=487,d.GET_CATALOG_INDEX=1195,d.GET_CATALOG_PAGE=412,d.CATALOG_PURCHASE=3492,d.CATALOG_PURCHASE_GIFT=1411,d.GET_PRODUCT_OFFER=2594,d.CLIENT_LATENCY=295,d.CLIENT_LATENCY_MEASURE=96,d.CLIENT_POLICY=26979,d.CLIENT_PONG=2596,d.CLIENT_TOOLBAR_TOGGLE=2313,d.CLIENT_VARIABLES=1053,d.GET_CURRENT_TIMING_CODE=2912,d.DESKTOP_NEWS=1827,d.DESKTOP_VIEW=105,d.GET_BUNDLE_DISCOUNT_RULESET=223,d.EVENT_TRACKER=3457,d.FIND_NEW_FRIENDS=516,d.FURNITURE_ALIASES=3898,d.FURNITURE_FLOOR_UPDATE=248,d.FURNITURE_MULTISTATE=99,d.FURNITURE_PICKUP=3456,d.FURNITURE_PLACE=1258,d.FURNITURE_POSTIT_PLACE=2248,d.FURNITURE_POSTIT_SAVE_STICKY_POLE=3283,d.FURNITURE_RANDOMSTATE=3617,d.FURNITURE_WALL_MULTISTATE=210,d.FURNITURE_WALL_UPDATE=168,d.GAMES_INIT=2914,d.GAMES_LIST=741,d.ACCEPTGAMEINVITE=3802,d.GAMEUNLOADEDMESSAGE=3207,d.GETGAMEACHIEVEMENTSMESSAGE=2399,d.GETGAMESTATUSMESSAGE=3171,d.GETUSERGAMEACHIEVEMENTSMESSAGE=389,d.JOINQUEUEMESSAGE=1458,d.LEAVEQUEUEMESSAGE=2384,d.RESETRESOLUTIONACHIEVEMENTMESSAGE=3144,d.GETWEEKLYGAMEREWARDWINNERS=1054,d.GAME2GETACCOUNTGAMESTATUSMESSAGE=11,d.GAME2CHECKGAMEDIRECTORYSTATUSMESSAGE=3259,d.GAME2EXITGAMEMESSAGE=1445,d.GAME2GAMECHATMESSAGE=2502,d.GAME2LOADSTAGEREADYMESSAGE=2415,d.GAME2PLAYAGAINMESSAGE=3196,d.GAME2REQUESTFULLSTATUSUPDATEMESSAGE=1598,d.GAME2GETWEEKLYFRIENDSLEADERBOARD=1232,d.GAME2GETWEEKLYLEADERBOARD=2565,d.GET_GIFT_WRAPPING_CONFIG=418,d.GROUP_ADMIN_ADD=2894,d.GROUP_ADMIN_REMOVE=722,d.GROUP_CREATE_OPTIONS=798,d.GROUP_FAVORITE=3549,d.GET_FORUM_STATS=3149,d.GET_FORUM_THREADS=873,d.GET_FORUMS_LIST=436,d.GET_FORUM_MESSAGES=232,d.GET_FORUM_THREAD=3900,d.GET_UNREAD_FORUMS_COUNT=2908,d.FORUM_MODERATE_MESSAGE=286,d.FORUM_MODERATE_THREAD=1397,d.FORUM_POST_MESSAGE=3529,d.UPDATE_FORUM_READ_MARKER=1855,d.UPDATE_FORUM_SETTINGS=2214,d.FORUM_UPDATE_THREAD=3045,d.GROUP_INFO=2991,d.GROUP_DELETE=1134,d.GROUP_MEMBER_REMOVE_CONFIRM=3593,d.GROUP_MEMBER_REMOVE=593,d.GROUP_MEMBERS=312,d.GROUP_MEMBERSHIPS=367,d.GROUP_REQUEST=998,d.GROUP_REQUEST_ACCEPT=3386,d.GROUP_REQUEST_DECLINE=1894,d.GROUP_SETTINGS=1004,d.GROUP_PARTS=813,d.GROUP_BUY=230,d.GROUP_SAVE_INFORMATION=3137,d.GROUP_SAVE_BADGE=1991,d.GROUP_SAVE_COLORS=1764,d.GROUP_SAVE_PREFERENCES=3435,d.GROUP_BADGES=21,d.GROUP_UNBLOCK_MEMBER=2864,d.GET_BADGE_POINTS_LIMITS=1371,d.REQUESTABADGE=3077,d.GETISBADGEREQUESTFULFILLED=1364,d.ITEM_CLOTHING_REDEEM=3374,d.ITEM_COLOR_WHEEL_CLICK=2144,d.ITEM_DICE_CLICK=1990,d.ITEM_DICE_CLOSE=1533,d.ITEM_DIMMER_SAVE=1648,d.ITEM_DIMMER_SETTINGS=2813,d.ITEM_DIMMER_TOGGLE=2296,d.ITEM_EXCHANGE_REDEEM=3115,d.ITEM_PAINT=711,d.SET_OBJECT_DATA=3608,d.ITEM_STACK_HELPER=3839,d.ITEM_WALL_CLICK=210,d.ITEM_WALL_UPDATE=168,d.MARKETPLACE_CONFIG=2597,d.ACCEPT_FRIEND=137,d.MESSENGER_CHAT=3567,d.DECLINE_FRIEND=2890,d.FOLLOW_FRIEND=3997,d.MESSENGER_FRIENDS=1523,d.MESSENGER_INIT=2781,d.MESSENGER_RELATIONSHIPS=2138,d.SET_RELATIONSHIP_STATUS=3768,d.REMOVE_FRIEND=1689,d.REQUEST_FRIEND=3157,d.GET_FRIEND_REQUESTS=2448,d.SEND_ROOM_INVITE=1276,d.HABBO_SEARCH=1210,d.FRIEND_LIST_UPDATE=1419,d.MOD_TOOL_USER_INFO=3295,d.GET_USER_FLAT_CATS=3027,d.NAVIGATOR_INIT=2110,d.NAVIGATOR_SEARCH=249,d.NAVIGATOR_SEARCH_CLOSE=1834,d.NAVIGATOR_SEARCH_OPEN=637,d.NAVIGATOR_SEARCH_SAVE=2226,d.GET_USER_EVENT_CATS=1782,d.NAVIGATOR_SETTINGS_SAVE=3159,d.NAVIGATOR_CATEGORY_LIST_MODE=1202,d.NAVIGATOR_DELETE_SAVED_SEARCH=1954,d.PET_INFO=2934,d.PET_PICKUP=1581,d.PET_PLACE=2647,d.PET_RESPECT=3202,d.PET_RIDE=1036,d.PET_MOVE=3449,d.PET_OPEN_PACKAGE=3698,d.PET_SELECTED=549,d.PETS_BREED=1638,d.PET_CANCEL_BREEDING=2713,d.PET_CONFIRM_BREEDING=3382,d.GET_PET_TRAINING_PANEL=2161,d.RECYCLER_PRIZES=398,d.RECYCLER_STATUS=1342,d.RECYCLER_ITEMS=2771,d.RELEASE_VERSION=4e3,d.CALL_FOR_HELP=1691,d.ROOM_AMBASSADOR_ALERT=2996,d.ROOM_BAN_GIVE=1477,d.ROOM_BAN_LIST=2267,d.ROOM_BAN_REMOVE=992,d.ROOM_CREATE=2752,d.ROOM_DELETE=532,d.ROOM_DOORBELL=1644,d.ROOM_ENTER=2312,d.ROOM_FAVORITE=3817,d.ROOM_FAVORITE_REMOVE=309,d.CAN_CREATE_ROOM=2128,d.CANCEL_ROOM_EVENT=2725,d.EDIT_ROOM_EVENT=3991,d.COMPETITION_ROOM_SEARCH=433,d.FORWARD_TO_RANDOM_PROMOTED_ROOM=10,d.FORWARD_TO_SOME_ROOM=1703,d.GET_CATEGORIES_WITH_USER_COUNT=3782,d.GET_GUEST_ROOM=2230,d.GET_OFFICIAL_ROOMS=1229,d.GET_POPULAR_ROOM_TAGS=826,d.GUILD_BASE_SEARCH=2930,d.MY_FAVOURITE_ROOMS_SEARCH=2578,d.MY_FREQUENT_ROOM_HISTORY_SEARCH=1002,d.MY_FRIENDS_ROOM_SEARCH=2266,d.MY_GUILD_BASES_SEARCH=39,d.MY_RECOMMENDED_ROOMS=2537,d.MY_ROOM_HISTORY_SEARCH=2264,d.MY_ROOM_RIGHTS_SEARCH=272,d.MY_ROOMS_SEARCH=2277,d.POPULAR_ROOMS_SEARCH=2758,d.ROOM_AD_EVENT_TAB_CLICKED=2412,d.ROOM_AD_EVENT_TAB_VIEWED=2668,d.ROOM_AD_SEARCH=2809,d.ROOM_TEXT_SEARCH=3943,d.ROOMS_WHERE_MY_FRIENDS_ARE=1786,d.ROOMS_WITH_HIGHEST_SCORE_SEARCH=2939,d.SET_ROOM_SESSION_TAGS=3305,d.UPDATE_ROOM_THUMBNAIL=2468,d.ROOM_KICK=1320,d.ROOM_LIKE=3582,d.ROOM_MODEL=2300,d.GET_OCCUPIED_TILES=1687,d.GET_ROOM_ENTRY_TILE=3559,d.ROOM_MODEL_SAVE=875,d.ROOM_MUTE=3637,d.ROOM_MUTE_USER=3485,d.ROOM_RIGHTS_GIVE=808,d.ROOM_RIGHTS_LIST=3385,d.ROOM_RIGHTS_REMOVE=2064,d.ROOM_RIGHTS_REMOVE_ALL=2683,d.ROOM_RIGHTS_REMOVE_OWN=3182,d.ROOM_SETTINGS=3129,d.ROOM_SETTINGS_SAVE=1969,d.ROOM_SETTINGS_UPDATE_ROOM_CATEGORY_AND_TRADE=1265,d.ROOM_STAFF_PICK=1918,d.ROOM_FILTER_WORDS=1911,d.ROOM_FILTER_WORDS_MODIFY=3001,d.MYSTERYBOXWAITINGCANCELEDMESSAGE=2012,d.MYSTERYBOX_OPEN_TROPHY=3074,d.SECURITY_MACHINE=2490,d.SECURITY_TICKET=2419,d.TRADE=1481,d.TRADE_ACCEPT=3863,d.TRADE_CANCEL=2341,d.TRADE_CLOSE=2551,d.TRADE_CONFIRM=2760,d.TRADE_ITEM=3107,d.TRADE_ITEM_REMOVE=3845,d.TRADE_ITEMS=1263,d.TRADE_UNACCEPT=1444,d.UNIT_ACTION=2456,d.UNIT_CHAT=1314,d.UNIT_CHAT_SHOUT=2085,d.UNIT_CHAT_WHISPER=1543,d.UNIT_DANCE=2080,d.UNIT_DROP_HAND_ITEM=2814,d.UNIT_GIVE_HANDITEM=2941,d.UNIT_LOOK=3301,d.UNIT_POSTURE=2235,d.UNIT_SIGN=1975,d.UNIT_TYPING=1597,d.UNIT_TYPING_STOP=1474,d.UNIT_WALK=3320,d.USER_BADGES=2769,d.USER_BADGES_CURRENT=2091,d.USER_BADGES_CURRENT_UPDATE=644,d.USER_BOTS=3848,d.USER_CURRENCY=273,d.USER_EFFECT_ACTIVATE=2959,d.USER_EFFECT_ENABLE=1752,d.USER_FIGURE=2730,d.USER_FURNITURE=3150,d.REQUESTFURNIINVENTORYWHENNOTINROOM=3500,d.USER_HOME_ROOM=1740,d.USER_INFO=357,d.USER_MOTTO=2228,d.USER_IGNORED=3878,d.USER_PETS=3095,d.USER_PROFILE=3265,d.USER_PROFILE_BY_NAME=2249,d.USER_RESPECT=2694,d.GET_SOUND_SETTINGS=2388,d.USER_SETTINGS_CAMERA=1461,d.USER_SETTINGS_CHAT_STYLE=1030,d.USER_SETTINGS_INVITES=1086,d.USER_SETTINGS_OLD_CHAT=1262,d.USER_SETTINGS_VOLUME=1367,d.USER_SUBSCRIPTION=3166,d.GET_WARDROBE=2742,d.SAVE_WARDROBE_OUTFIT=800,d.USER_TAGS=17,d.PEER_USERS_CLASSIFICATION=1160,d.USER_CLASSIFICATION=2285,d.VISIT_USER=2970,d.WIRED_ACTION_SAVE=2281,d.WIRED_APPLY_SNAPSHOT=3373,d.WIRED_CONDITION_SAVE=3203,d.WIRED_OPEN=768,d.WIRED_TRIGGER_SAVE=1520,d.GET_ITEM_DATA=3964,d.ONE_WAY_DOOR_CLICK=2765,d.REMOVE_WALL_ITEM=3336,d.SET_ITEM_DATA=3666,d.CATALOG_REDEEM_VOUCHER=339,d.ROOM_TONER_APPLY=2880,d.FRIEND_FURNI_CONFIRM_LOCK=3775,d.MANNEQUIN_SAVE_NAME=2850,d.MANNEQUIN_SAVE_LOOK=2209,d.PRESENT_OPEN_PRESENT=3558,d.CATALOG_SELECT_VIP_GIFT=2276,d.USER_IGNORE_ID=3314,d.USER_IGNORE=1117,d.USER_UNIGNORE=2061,d.MODTOOL_REQUEST_ROOM_INFO=707,d.MODTOOL_CHANGE_ROOM_SETTINGS=3260,d.MODTOOL_REQUEST_USER_CHATLOG=1391,d.MODTOOL_REQUEST_ROOM_CHATLOG=2587,d.MODTOOL_SANCTION_ALERT=229,d.MODTOOL_SANCTION_BAN=2766,d.MODTOOL_SANCTION_KICK=2582,d.MODTOOL_SANCTION_TRADELOCK=3742,d.MODTOOL_ALERTEVENT=1840,d.MODTOOL_SANCTION_MUTE=1945,d.MODTOOL_REQUEST_USER_ROOMS=3526,d.MODTOOL_ROOM_ALERT=3842,d.MODTOOL_PREFERENCES=31,d.CLOSE_ISSUE_DEFAULT_ACTION=2717,d.CLOSE_ISSUES=2067,d.DEFAULT_SANCTION=1681,d.GET_CFH_CHATLOG=211,d.MODTOOL_SANCTION=1392,d.PICK_ISSUES=15,d.RELEASE_ISSUES=1572,d.CONVERT_GLOBAL_ROOM_ID=314,d.REQUEST_SELL_ITEM=848,d.REQUEST_MARKETPLACE_ITEM_STATS=3288,d.MARKETPLACE_SELL_ITEM=3447,d.MARKETPLACE_REQUEST_OWN_ITEMS=2105,d.MARKETPLACE_TAKE_BACK_ITEM=434,d.MARKETPLACE_REDEEM_CREDITS=2650,d.MARKETPLACE_REQUEST_OFFERS=2407,d.MARKETPLACE_BUY_OFFER=1603,d.MARKETPLACE_BUY_TOKENS=1866,d.CATALOG_REQUESET_PET_BREEDS=1756,d.APPROVE_NAME=2109,d.UNIT_GIVE_HANDITEM_PET=2768,d.PET_MOUNT=1036,d.PET_SUPPLEMENT=749,d.FURNITURE_GROUP_INFO=2651,d.ACHIEVEMENT_RESOLUTION_OPEN=359,d.USE_PET_PRODUCT=1328,d.REMOVE_PET_SADDLE=186,d.TOGGLE_PET_RIDING=1472,d.TOGGLE_PET_BREEDING=3379,d.UNSEEN_RESET_CATEGORY=3493,d.UNSEEN_RESET_ITEMS=2343,d.COMMUNITY_GOAL_VOTE_COMPOSER=3536,d.GET_PROMO_ARTICLES=1827,d.ACCEPT_QUEST=3604,d.ACTIVATE_QUEST=793,d.CANCEL_QUEST=3133,d.FRIEND_REQUEST_QUEST_COMPLETE=1148,d.GET_COMMUNITY_GOAL_EARNED_PRIZES=2688,d.GET_COMMUNITY_GOAL_HALL_OF_FAME=2167,d.GET_COMMUNITY_GOAL_PROGRESS=1145,d.GET_CONCURRENT_USERS_GOAL_PROGRESS=1343,d.GET_CONCURRENT_USERS_REWARD=3872,d.GET_DAILY_QUEST=2486,d.GET_QUESTS=3333,d.GET_SEASONAL_QUESTS_ONLY=1190,d.OPEN_QUEST_TRACKER=2750,d.REDEEM_COMMUNITY_GOAL_PRIZE=90,d.REJECT_QUEST=2397,d.START_CAMPAIGN=1697,d.GET_BONUS_RARE_INFO=957,d.CRAFT=3591,d.CRAFT_SECRET=1251,d.GET_CRAFTABLE_PRODUCTS=633,d.GET_CRAFTING_RECIPE=1173,d.GET_CRAFTING_RECIPES_AVAILABLE=3086,d.PHOTO_COMPETITION=3959,d.PUBLISH_PHOTO=2068,d.PURCHASE_PHOTO=2408,d.RENDER_ROOM=3226,d.RENDER_ROOM_THUMBNAIL=1982,d.REQUEST_CAMERA_CONFIGURATION=796,d.ADD_JUKEBOX_DISK=753,d.GET_JUKEBOX_PLAYLIST=1435,d.GET_NOW_PLAYING=1325,d.GET_OFFICIAL_SONG_ID=3189,d.GET_SONG_INFO=3082,d.GET_SOUND_MACHINE_PLAYLIST=3498,d.GET_USER_SONG_DISKS=2304,d.REMOVE_JUKEBOX_DISK=3050,d.INTERSTITIAL_SHOWN=1109,d.GET_INTERSTITIAL=2519,d.CHANGE_USERNAME=2977,d.CHECK_USERNAME=3950,d.OPEN_CAMPAIGN_CALENDAR_DOOR_STAFF=3889,d.OPEN_CAMPAIGN_CALENDAR_DOOR=2257,d.BUILDERS_CLUB_PLACE_ROOM_ITEM=1051,d.BUILDERS_CLUB_PLACE_WALL_ITEM=462,d.BUILDERS_CLUB_QUERY_FURNI_COUNT=2529,d.GET_CATALOG_PAGE_EXPIRATION=742,d.GET_CATALOG_PAGE_WITH_EARLIEST_EXP=3135,d.GET_DIRECT_CLUB_BUY_AVAILABLE=801,d.GET_HABBO_BASIC_MEMBERSHIP_EXTEND_OFFER=603,d.GET_HABBO_CLUB_EXTEND_OFFER=2462,d.GET_IS_OFFER_GIFTABLE=1347,d.GET_LIMITED_OFFER_APPEARING_NEXT=410,d.GET_NEXT_TARGETED_OFFER=596,d.GET_ROOM_AD_PURCHASE_INFO=1075,d.GET_SEASONAL_CALENDAR_DAILY_OFFER=3257,d.GET_TARGETED_OFFER=2487,d.MARK_CATALOG_NEW_ADDITIONS_PAGE_OPENED=2150,d.PURCHASE_BASIC_MEMBERSHIP_EXTENSION=2735,d.PURCHASE_ROOM_AD=777,d.PURCHASE_TARGETED_OFFER=1826,d.PURCHASE_VIP_MEMBERSHIP_EXTENSION=3407,d.ROOM_AD_PURCHASE_INITIATED=2283,d.SET_TARGETTED_OFFER_STATE=2041,d.SHOP_TARGETED_OFFER_VIEWED=3483,d.HELPER_TALENT_TRACK=196,d.TALENT_TRACK_GET_LEVEL=2127,d.FORWARD_TO_A_COMPETITION_ROOM=172,d.FORWARD_TO_A_SUBMITTABLE_ROOM=1450,d.FORWARD_TO_RANDOM_COMPETITION_ROOM=865,d.GET_IS_USER_PART_OF_COMPETITION=2077,d.GET_SECONDS_UNTIL=271,d.ROOM_COMPETITION_INIT=1334,d.SUBMIT_ROOM_TO_COMPETITION=2595,d.VOTE_FOR_ROOM=143,d.GET_GIFT=2436,d.RESET_PHONE_NUMBER_STATE=2741,d.SET_PHONE_NUMBER_VERIFICATION_STATUS=1379,d.TRY_PHONE_NUMBER=790,d.VERIFY_CODE=2721,d.CONTROL_YOUTUBE_DISPLAY_PLAYBACK=3005,d.GET_YOUTUBE_DISPLAY_STATUS=336,d.SET_YOUTUBE_DISPLAY_PLAYLIST=2069,d.GO_TO_FLAT=685,d.CHANGE_QUEUE=3093,d.CALL_FOR_HELP_FROM_FORUM_MESSAGE=1412,d.CALL_FOR_HELP_FROM_FORUM_THREAD=534,d.CALL_FOR_HELP_FROM_IM=2950,d.CALL_FOR_HELP_FROM_PHOTO=2492,d.CALL_FOR_HELP_FROM_SELFIE=2755,d.CHAT_REVIEW_GUIDE_DECIDES=3365,d.CHAT_REVIEW_GUIDE_DETACHED=2501,d.CHAT_REVIEW_GUIDE_VOTE=3961,d.CHAT_REVIEW_SESSION_CREATE=3060,d.DELETE_PENDING_CALLS_FOR_HELP=3605,d.GET_CFH_STATUS=2746,d.GET_FAQ_CATEGORY=3445,d.GET_FAQ_TEXT=1849,d.GET_GUIDE_REPORTING_STATUS=3786,d.GET_PENDING_CALLS_FOR_HELP=3267,d.GET_QUIZ_QUESTIONS=1296,d.GUIDE_SESSION_CREATE=3338,d.GUIDE_SESSION_FEEDBACK=477,d.GUIDE_SESSION_GET_REQUESTER_ROOM=1052,d.GUIDE_SESSION_GUIDE_DECIDES=1424,d.GUIDE_SESSION_INVITE_REQUESTER=234,d.GUIDE_SESSION_IS_TYPING=519,d.GUIDE_SESSION_MESSAGE=3899,d.GUIDE_SESSION_ON_DUTY_UPDATE=1922,d.GUIDE_SESSION_REPORT=3969,d.GUIDE_SESSION_REQUESTER_CANCELS=291,d.GUIDE_SESSION_RESOLVED=887,d.POST_QUIZ_ANSWERS=3720,d.SEARCH_FAQS=2031,d.POLL_ANSWER=3505,d.POLL_REJECT=1773,d.POLL_START=109,d.POLL_VOTE_COUNTER=6200,d.DISCONNECT=2445,d.SCR_GET_KICKBACK_INFO=869,d.COMPOST_PLANT=3835,d.HARVEST_PET=1521,d.SET_CLOTHING_CHANGE_DATA=924,d.GROUP_UNFAVORITE=1820,d.NEW_USER_EXPERIENCE_GET_GIFTS=1822,d.NEW_USER_EXPERIENCE_SCRIPT_PROCEED=1299,d.HANDSHAKE_INIT_DIFFIE=3110,d.HANDSHAKE_COMPLETE_DIFFIE=773,d.WELCOME_OPEN_GIFT=2638,d.WELCOME_GIFT_CHANGE_EMAIL=66,d.EMAIL_GET_STATUS=2557,d.EMAIL_CHANGE=3965,d.APPROVE_ALL_MEMBERSHIP_REQUESTS=882,d.RENTABLE_SPACE_CANCEL_RENT=1667,d.RENTABLE_SPACE_RENT=2946,d.RENTABLE_SPACE_STATUS=872,d.TRACKING_PERFORMANCE_LOG=3230,d.TRACKING_LAG_WARNING_REPORT=3847,d.ROOM_DIRECTORY_ROOM_NETWORK_OPEN_CONNECTION=3736,d.RENTABLE_EXTEND_RENT_OR_BUYOUT_STRIP_ITEM=2115,d.RENTABLE_EXTEND_RENT_OR_BUYOUT_FURNI=1071,d.RENTABLE_GET_RENT_OR_BUYOUT_OFFER=2518,d.DELETE_ITEM=10018;let E=d;class jf{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class vu{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class zf{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class UB{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class Wf{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class kf{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class Kf{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class Xf{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class qf{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class Qf{constructor(t,e,s){this._data=[t,e,s.length,...s]}getMessageArray(){return this._data}dispose(){}}class Jf{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class Zf{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}let yB=class{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}};class vB{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class bB{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class FB{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class xB{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class GB{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class BB{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class wB{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class VB{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class YB{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class HB{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class jB{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class zB{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class WB{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class kB{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class KB{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class XB{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class qB{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class QB{constructor(...t){this._data=[t.length],t.forEach(e=>{this._data.push(e.itemId)})}getMessageArray(){return this._data}dispose(){}}class $f{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class tI{constructor(t,e=null){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class JB{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class eI{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class sI{constructor(t,e=0,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class ZB{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class iI{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class rI{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class nI{constructor(t,e,s=0){this._data=[t,s,e]}getMessageArray(){return this._data}dispose(){}}class aI{constructor(...t){this._data=[t.length,...t]}getMessageArray(){return this._data}dispose(){}}class $B{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class tw{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class ew{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class sw{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class iw{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class rw{constructor(t,e,s,i,r,a,o,h,_,l,c,f,p,m,O,A,C,L,D,U,P,v,F,$){this._data=[],this._data.push(t,e,s,i,r,a,o),this._data.push(_.length,..._),this._data.push(l,c,f,p,m,O,A,C,L,D,U,P,v,F,$)}getMessageArray(){return this._data}dispose(){}}class oI{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class hI{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class nw{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class _I{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class lI extends _I{constructor(t){super(t)}}class cI{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class uI extends _I{constructor(t){super(t)}}class bu{constructor(t,e,s,i){this._data=[t,e,s,i]}getMessageArray(){return this._data}dispose(){}}class dI{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class EI{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class gI{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class fI{constructor(t,e,s=""){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class II{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class TI{constructor(t,e){this._data=[t,e.size*2];for(const[s,i]of e.entries())this._data.push(s,i)}getMessageArray(){return this._data}dispose(){}}class aw{constructor(t,e,s,i){this._data=[t,e,s,i]}getMessageArray(){return this._data}dispose(){}}class mI{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class pI{constructor(t,e,s,i,r){this._data=[t,e,s,i,r]}getMessageArray(){return this._data}dispose(){}}class RI{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class ow{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class hw{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class Fu{constructor(t,e,s,i){this._data=[t,e,s,i]}getMessageArray(){return this._data}dispose(){}}class OI{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class AI{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class SI{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class CI{constructor(t,e,s,i,r,a){this._itemId=t,this._category=e,this._wallLocation=s,this._x=i,this._y=r,this._direction=a}getMessageArray(){switch(this._category){case M.FLOOR:return[`${this._itemId} ${this._x} ${this._y} ${this._direction}`];case M.WALL:return[`${this._itemId} ${this._wallLocation} `];default:return[]}}dispose(){}}class _w{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class MI{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class lw{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class NI{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class DI{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class LI{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class cw{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class Kd{constructor(t,e=0){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class PI{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class UI{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class uw{constructor(t,e=-100){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class yI{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class dw{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class Ew{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class gw{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class vI{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class fw{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class bI{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class Iw{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class Tw{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class mw{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class pw{constructor(t,e,s,i){this._data=[t,e,s,i]}getMessageArray(){return this._data}dispose(){}}class FI{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class Rw{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class Ow{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class Aw{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class Sw{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class xu{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class Cw{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class Mw{constructor(t,e,s,i,r,a,o){this._data=[t,e,s,i,r,a,o]}getMessageArray(){return this._data}dispose(){}}class Nw{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class xI{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class GI{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class Xd{constructor(t,e=0,s=""){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class BI{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class Dw{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class wI{constructor(t,e,s){this._data=[t+" "+e,s]}getMessageArray(){return this._data}dispose(){}}class VI{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class YI{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class HI{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class jI{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class Lw{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class Pw{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class Uw{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class zI{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class WI{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class kI{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class KI{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}const ya=class ya{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}};ya.STATE_START=0,ya.STATE_CANCEL=1,ya.STATE_ACCEPT=2;let Gu=ya;class yw{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class vw{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class bw{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class Fw{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class xw{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class Gw{constructor(t,e,s,i,r,a){this._data=[t,e.length,...e,s,i.length,...i,r,a]}getMessageArray(){return this._data}dispose(){}}class Bw{constructor(t,e,s,i,r){this._data=[t,e.length,...e,s,i.length,...i,r]}getMessageArray(){return this._data}dispose(){}}class ww{constructor(t,e,s,i,r){this._data=[t,e.length,...e,s,i.length,...i,r]}getMessageArray(){return this._data}dispose(){}}class Vw{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class Yw{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class XI{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class qI{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class Hw{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class QI{constructor(...t){this._data=[t.length].concat(t)}getMessageArray(){return this._data}dispose(){}}class jw{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class zw{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class JI{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class Ww{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class kw{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class Kw{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class Xw{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class qw{constructor(t,e,s,i,r,a,o,h,_,l,c){this._data=[t,e,s,i,r,a,o,h,_,l,c]}getMessageArray(){return this._data}dispose(){}}class Qw{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class Jw{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class Zw{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class $w{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class ZI{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class $I{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class tT{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class eT{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class sT{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class iT{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class tV{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class rT{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class eV{constructor(t,e=!0){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class sV{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class iV{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class nT{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class rV{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class nV{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class aV{constructor(){this._data=[]}getMessageArray(){return this._data}dispose(){}}class oV{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class hV{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class _V{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class lV{constructor(t,e,s){this._data=[t,e,s]}getMessageArray(){return this._data}dispose(){}}class cV{constructor(t,e){this._data=[t,e]}getMessageArray(){return this._data}dispose(){}}class aT{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class uV{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class oT{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class hT{constructor(t){this._data=[t]}getMessageArray(){return this._data}dispose(){}}class dV extends Js{constructor(t){super(),this._communication=t,this._handShaking=!1,this._didConnect=!1,this._pongInterval=null,this.onConnectionOpenedEvent=this.onConnectionOpenedEvent.bind(this),this.onConnectionClosedEvent=this.onConnectionClosedEvent.bind(this),this.onConnectionErrorEvent=this.onConnectionErrorEvent.bind(this),this.sendPong=this.sendPong.bind(this)}onInit(){const t=this._communication.connection;t&&(t.addEventListener(ae.CONNECTION_OPENED,this.onConnectionOpenedEvent),t.addEventListener(ae.CONNECTION_CLOSED,this.onConnectionClosedEvent),t.addEventListener(ae.CONNECTION_ERROR,this.onConnectionErrorEvent)),this._communication.registerMessageEvent(new Fg(this.onClientPingEvent.bind(this))),this._communication.registerMessageEvent(new mf(this.onAuthenticatedEvent.bind(this)))}onDispose(){const t=this._communication.connection;t&&(t.removeEventListener(ae.CONNECTION_OPENED,this.onConnectionOpenedEvent),t.removeEventListener(ae.CONNECTION_CLOSED,this.onConnectionClosedEvent),t.removeEventListener(ae.CONNECTION_ERROR,this.onConnectionErrorEvent)),this._handShaking=!1,this.stopPonging(),super.onDispose()}onConnectionOpenedEvent(t){const e=this._communication.connection;e&&(this._didConnect=!0,this.dispatchCommunicationDemoEvent(hs.CONNECTION_ESTABLISHED,e),q.getValue("system.pong.manually",!1)&&this.startPonging(),this.startHandshake(e),e.send(new Gf(null,null,null,null)),this.tryAuthentication(e))}onConnectionClosedEvent(t){const e=this._communication.connection;e&&(this.stopPonging(),this._didConnect&&this.dispatchCommunicationDemoEvent(hs.CONNECTION_CLOSED,e))}onConnectionErrorEvent(t){const e=this._communication.connection;e&&(this.stopPonging(),this.dispatchCommunicationDemoEvent(hs.CONNECTION_ERROR,e))}getGpu(){const t=document.createElement("canvas");let e,s,i,r;try{if(e=t.getContext("webgl")||t.getContext("experimental-webgl"),s=e.getExtension("WEBGL_debug_renderer_info"),e===null||s===null)return""}catch{return""}return i=e.getParameter(s.UNMASKED_VENDOR_WEBGL),r=e.getParameter(s.UNMASKED_RENDERER_WEBGL),i+"|"+r}getMathResult(){let t;t="";try{return t="<mathroutines>"+(Math.exp(10)+1/Math.exp(10))/2+"|"+Math.tan(-1e300)+"</mathroutines>",t}catch{return"<mathroutines>Error</mathroutines>"}}getCanvas(){const t=document.createElement("canvas"),e=t.getContext("2d");new Date().toString();const s="ThiosIsVefwsdcse02wefw83721##@@@_moreStuff! | ${userAgent} | ${screenInfo} | ${currentDate}";e.textBaseline="top",e.font="16px 'Arial'",e.textBaseline="alphabetic",e.rotate(.05),e.fillStyle="#f60",e.fillRect(125,1,62,20),e.fillStyle="#069",e.fillText(s,2,15),e.fillStyle="rgba(102, 200, 0, 0.7)",e.fillText(s,4,17),e.shadowBlur=10,e.shadowColor="blue",e.fillRect(-20,10,234,5);const i=t.toDataURL();document.body.appendChild(t);let r=0;if(i.length===0)return"nothing!";for(let a=0;a<i.length;a++)r=(r<<5)-r+i.charCodeAt(a),r&=r;return r}tryAuthentication(t){if(!t||!this.getSSO()){this.getSSO()||j.error("Login without an SSO ticket is not supported"),this.dispatchCommunicationDemoEvent(hs.CONNECTION_HANDSHAKE_FAILED,t);return}const e=new zT.ClientJS,s=e.getCustomFingerprint(e.getAvailableResolution(),e.getOS(),e.getCPU(),e.getColorDepth(),this.getGpu(),e.getSilverlightVersion(),e.getOSVersion(),this.getMathResult(),e.getCanvasPrint(),this.getCanvas()),i=s==null?"FAILED":`IID-${s}`;t.send(new Vf(this.getSSO(),nt())),t.send(new Yf(i,"",""))}onClientPingEvent(t){!t||!t.connection||this.sendPong(t.connection)}onAuthenticatedEvent(t){!t||!t.connection||(this.completeHandshake(t.connection),this.dispatchCommunicationDemoEvent(hs.CONNECTION_AUTHENTICATED,t.connection),t.connection.send(new Bf))}startHandshake(t){this.dispatchCommunicationDemoEvent(hs.CONNECTION_HANDSHAKING,t),this._handShaking=!0}completeHandshake(t){this.dispatchCommunicationDemoEvent(hs.CONNECTION_HANDSHAKED,t),this._handShaking=!1}startPonging(){this.stopPonging(),this._pongInterval=window.setInterval(this.sendPong,q.getValue("system.pong.interval.ms",2e4))}stopPonging(){this._pongInterval&&(clearInterval(this._pongInterval),this._pongInterval=null)}sendPong(t=null){t=t||this._communication.connection||null,t&&t.send(new wf)}dispatchCommunicationDemoEvent(t,e){W.instance.events.dispatchEvent(new hs(t,e))}getSSO(){return q.getValue("sso.ticket",null)}}class EV{constructor(){this._events=new Map,this._composers=new Map,this.registerEvents(),this.registerComposers()}registerEvents(){this._events.set(T.INTERSTITIAL_MESSAGE,oL),this._events.set(T.ROOM_AD_ERROR,hL),this._events.set(T.AVAILABILITY_STATUS,vg),this._events.set(T.AVAILABILITY_TIME,_L),this._events.set(T.HOTEL_CLOSED_AND_OPENS,lL),this._events.set(T.HOTEL_CLOSES_AND_OPENS_AT,cL),this._events.set(T.HOTEL_WILL_CLOSE_MINUTES,uL),this._events.set(T.HOTEL_MAINTENANCE,dL),this._events.set(T.USER_CHANGE_NAME,Za),this._events.set(T.CHECK_USER_NAME,EL),this._events.set(T.USER_FIGURE,bg),this._events.set(T.USER_OUTFITS,gL),this._events.set(T.ADD_BOT_TO_INVENTORY,fL),this._events.set(T.USER_BOTS,IL),this._events.set(T.BOT_RECEIVED,TL),this._events.set(T.REMOVE_BOT_FROM_INVENTORY,mL),this._events.set(T.CFH_SANCTION,pL),this._events.set(T.CFH_TOPICS,RL),this._events.set(T.CFH_SANCTION_STATUS,OL),this._events.set(T.CAMERA_PUBLISH_STATUS,AL),this._events.set(T.CAMERA_PURCHASE_OK,SL),this._events.set(T.CAMERA_STORAGE_URL,ML),this._events.set(T.COMPETITION_STATUS,NL),this._events.set(T.INIT_CAMERA,DL),this._events.set(T.THUMBNAIL_STATUS,LL),this._events.set(T.CAMERA_SNAPSHOT,CL),this._events.set(T.CAMPAIGN_CALENDAR_DATA,PL),this._events.set(T.CAMPAIGN_CALENDAR_DOOR_OPENED,UL),this._events.set(T.BONUS_RARE_INFO,yL),this._events.set(T.BUILDERS_CLUB_FURNI_COUNT,vL),this._events.set(T.BUILDERS_CLUB_SUBSCRIPTION,bL),this._events.set(T.BUNDLE_DISCOUNT_RULESET,FL),this._events.set(T.CATALOG_PAGE_EXPIRATION,xL),this._events.set(T.CATALOG_PAGE,GL),this._events.set(T.CATALOG_PAGE_LIST,BL),this._events.set(T.CATALOG_EARLIEST_EXPIRY,wL),this._events.set(T.CATALOG_PUBLISHED,VL),this._events.set(T.CLUB_GIFT_INFO,YL),this._events.set(T.CLUB_GIFT_SELECTED,HL),this._events.set(T.DIRECT_SMS_CLUB_BUY,jL),this._events.set(T.GIFT_RECEIVER_NOT_FOUND,WL),this._events.set(T.GIFT_WRAPPER_CONFIG,kL),this._events.set(T.CLUB_EXTENDED_OFFER,KL),this._events.set(T.CLUB_OFFERS,XL),this._events.set(T.IS_OFFER_GIFTABLE,qL),this._events.set(T.LIMITED_SOLD_OUT,QL),this._events.set(T.LIMITED_OFFER_APPEARING_NEXT,JL),this._events.set(T.NOT_ENOUGH_BALANCE,ZL),this._events.set(T.PRODUCT_OFFER,$L),this._events.set(T.CATALOG_PURCHASE_ERROR,tP),this._events.set(T.CATALOG_PURCHASE_NOT_ALLOWED,eP),this._events.set(T.CATALOG_PURCHASE_OK,sP),this._events.set(T.ROOM_AD_PURCHASE,iP),this._events.set(T.SEASONAL_CALENDAR_OFFER,rP),this._events.set(T.CATALOG_RECEIVE_PET_BREEDS,nP),this._events.set(T.TARGET_OFFER,aP),this._events.set(T.TARGET_OFFER_NOT_FOUND,oP),this._events.set(T.REDEEM_VOUCHER_ERROR,hP),this._events.set(T.REDEEM_VOUCHER_OK,_P),this._events.set(T.CLIENT_PING,Fg),this._events.set(T.COMPETITION_ENTRY_SUBMIT,lP),this._events.set(T.COMPETITION_VOTING_INFO,cP),this._events.set(T.COMPETITION_TIMING_CODE,uP),this._events.set(T.COMPETITION_USER_PART_OF,dP),this._events.set(T.COMPETITION_NO_OWNED_ROOMS,EP),this._events.set(T.COMPETITION_SECONDS_UNTIL,gP),this._events.set(T.CRAFTABLE_PRODUCTS,fP),this._events.set(T.CRAFTING_RECIPE,IP),this._events.set(T.CRAFTING_RECIPES_AVAILABLE,TP),this._events.set(T.CRAFTING_RESULT,mP),this._events.set(T.DESKTOP_VIEW,Vc),this._events.set(T.MESSENGER_ACCEPT_FRIENDS,pP),this._events.set(T.MESSENGER_FIND_FRIENDS,RP),this._events.set(T.MESSENGER_FOLLOW_FAILED,OP),this._events.set(T.MESSENGER_FRIENDS,AP),this._events.set(T.MESSENGER_UPDATE,SP),this._events.set(T.MESSENGER_FRIEND_NOTIFICATION,CP),this._events.set(T.MESSENGER_REQUESTS,MP),this._events.set(T.MESSENGER_SEARCH,NP),this._events.set(T.MESSENGER_INSTANCE_MESSAGE_ERROR,DP),this._events.set(T.MESSENGER_MESSAGE_ERROR,LP),this._events.set(T.MESSENGER_INIT,PP),this._events.set(T.MESSENGER_MINIMAIL_NEW,UP),this._events.set(T.MESSENGER_MINIMAIL_COUNT,yP),this._events.set(T.MESSENGER_CHAT,vP),this._events.set(T.MESSENGER_REQUEST,xg),this._events.set(T.MESSENGER_INVITE_ERROR,bP),this._events.set(T.MESSENGER_INVITE,FP),this._events.set(T.ACHIEVEMENTRESOLUTIONCOMPLETED,jP),this._events.set(T.ACHIEVEMENTRESOLUTIONPROGRESS,zP),this._events.set(T.ACHIEVEMENTRESOLUTIONS,WP),this._events.set(T.LOAD_GAME_URL,Gg),this._events.set(T.LOADGAME,$P),this._events.set(T.UNLOADGAME,tU),this._events.set(T.GAME_CENTER_GAME_LIST,XP),this._events.set(T.GAMESTATUSMESSAGE,qP),this._events.set(T.GAME_CENTER_ACHIEVEMENTS,eU),this._events.set(T.GAME_CENTER_STATUS,xP),this._events.set(T.GAME_CENTER_IN_ARENA_QUEUE,BP),this._events.set(T.GAME_CENTER_STOP_COUNTER,YP),this._events.set(T.GAME_CENTER_USER_LEFT_GAME,HP),this._events.set(T.GAME_CENTER_DIRECTORY_STATUS,GP),this._events.set(T.GAME_CENTER_STARTING_GAME_FAILED,VP),this._events.set(T.GAME_CENTER_JOINING_FAILED,wP),this._events.set(T.GAMEACHIEVEMENTS,kP),this._events.set(T.GAMEINVITE,KP),this._events.set(T.JOINEDQUEUEMESSAGE,QP),this._events.set(T.JOININGQUEUEFAILED,JP),this._events.set(T.LEFTQUEUE,ZP),this._events.set(T.WEEKLY_GAME_REWARD,aU),this._events.set(T.WEEKLY_GAME_REWARD_WINNERS,oU),this._events.set(T.WEEKLY_COMPETITIVE_LEADERBOARD,nU),this._events.set(T.WEEKLY_COMPETITIVE_FRIENDS_LEADERBOARD,rU),this._events.set(T.WEEKLY_GAME2_FRIENDS_LEADERBOARD,sU),this._events.set(T.WEEKLY_GAME2_LEADERBOARD,iU),this._events.set(T.GROUP_INFO,dU),this._events.set(T.GROUP_MEMBER_REMOVE_CONFIRM,uU),this._events.set(T.GROUP_MEMBERS,EU),this._events.set(T.GROUP_CREATE_OPTIONS,cU),this._events.set(T.GROUP_BADGE_PARTS,Bg),this._events.set(T.GROUP_SETTINGS,fU),this._events.set(T.GROUP_PURCHASED,gU),this._events.set(T.GROUP_BADGES,Pf),this._events.set(T.GROUP_DEACTIVATE,IU),this._events.set(T.GROUP_MEMBERSHIP_REQUESTED,Tb),this._events.set(T.GROUP_DETAILS_CHANGED,Ib),this._events.set(T.GROUP_HABBO_JOIN_FAILED,Ob),this._events.set(T.GROUP_FORUM_DATA,TU),this._events.set(T.GROUP_FORUM_LIST,mU),this._events.set(T.GROUP_FORUM_THREADS,pU),this._events.set(T.GROUP_FORUM_POST,RU),this._events.set(T.GROUP_FORUM_POST_THREAD,OU),this._events.set(T.GROUP_FORUM_THREAD_MESSAGES,AU),this._events.set(T.GROUP_FORUM_UNREAD_COUNT,SU),this._events.set(T.GROUP_FORUM_UPDATE_MESSAGE,CU),this._events.set(T.GROUP_FORUM_UPDATE_THREAD,MU),this._events.set(T.CFH_DISABLED_NOTIFY,UU),this._events.set(T.CFH_PENDING_CALLS_DELETED,yU),this._events.set(T.CFH_PENDING_CALLS,vU),this._events.set(T.CFH_REPLY,bU),this._events.set(T.CFH_RESULT_MESSAGE,FU),this._events.set(T.GUIDE_ON_DUTY_STATUS,YU),this._events.set(T.GUIDE_SESSION_ATTACHED,jU),this._events.set(T.GUIDE_SESSION_DETACHED,zU),this._events.set(T.GUIDE_SESSION_ENDED,Vg),this._events.set(T.GUIDE_SESSION_ERROR,Yg),this._events.set(T.GUIDE_SESSION_INVITED_TO_GUIDE_ROOM,WU),this._events.set(T.GUIDE_SESSION_MESSAGE,kU),this._events.set(T.GUIDE_SESSION_PARTNER_IS_TYPING,KU),this._events.set(T.GUIDE_SESSION_REQUESTER_ROOM,XU),this._events.set(T.GUIDE_SESSION_STARTED,Hg),this._events.set(T.GUIDE_TICKET_CREATION_RESULT,qU),this._events.set(T.GUIDE_TICKET_RESOLUTION,QU),this._events.set(T.GUIDE_REPORTING_STATUS,HU),this._events.set(T.HOTEL_MERGE_NAME_CHANGE,JU),this._events.set(T.ISSUE_CLOSE_NOTIFICATION,ZU),this._events.set(T.QUIZ_DATA,$U),this._events.set(T.QUIZ_RESULTS,ty),this._events.set(T.CHAT_REVIEW_SESSION_DETACHED,xU),this._events.set(T.CHAT_REVIEW_SESSION_OFFERED_TO_GUIDE,GU),this._events.set(T.CHAT_REVIEW_SESSION_RESULTS,BU),this._events.set(T.CHAT_REVIEW_SESSION_STARTED,wU),this._events.set(T.CHAT_REVIEW_SESSION_VOTING_STATUS,VU),this._events.set(T.ACHIEVEMENT_PROGRESSED,ey),this._events.set(T.ACHIEVEMENT_LIST,sy),this._events.set(T.USER_ACHIEVEMENT_SCORE,iy),this._events.set(T.USER_EFFECT_ACTIVATE,ry),this._events.set(T.USER_EFFECT_LIST_ADD,ny),this._events.set(T.USER_EFFECT_LIST_REMOVE,ay),this._events.set(T.USER_EFFECT_LIST,hy),this._events.set(T.AVATAR_EFFECT_SELECTED,oy),this._events.set(T.USER_BADGES,ly),this._events.set(T.USER_BADGES_ADD,_y),this._events.set(T.BADGE_POINT_LIMITS,jg),this._events.set(T.BADGE_REQUEST_FULFILLED,cy),this._events.set(T.USER_CLOTHING,uy),this._events.set(T.USER_FURNITURE_ADD,dy),this._events.set(T.USER_FURNITURE,Ey),this._events.set(T.USER_FURNITURE_REFRESH,gy),this._events.set(T.USER_FURNITURE_REMOVE,fy),this._events.set(T.USER_FURNITURE_POSTIT_PLACED,Iy),this._events.set(T.USER_PETS,Oy),this._events.set(T.USER_PET_REMOVE,Sy),this._events.set(T.USER_PET_ADD,Ry),this._events.set(T.PET_RECEIVED,Ay),this._events.set(T.PET_PLACING_ERROR,Xg),this._events.set(T.YOUTUBE_CONTROL_VIDEO,Gv),this._events.set(T.YOUTUBE_DISPLAY_PLAYLISTS,Bv),this._events.set(T.YOUTUBE_DISPLAY_VIDEO,wv),this._events.set(T.TRADE_ACCEPTED,Cy),this._events.set(T.TRADE_CLOSED,My),this._events.set(T.TRADE_COMPLETED,Ny),this._events.set(T.TRADE_CONFIRMATION,Dy),this._events.set(T.TRADE_LIST_ITEM,Ly),this._events.set(T.TRADE_NOT_OPEN,Uy),this._events.set(T.TRADE_OPEN_FAILED,vy),this._events.set(T.TRADE_OPEN,yy),this._events.set(T.TRADE_OTHER_NOT_ALLOWED,by),this._events.set(T.TRADE_YOU_NOT_ALLOWED,Fy),this._events.set(T.TRADE_NO_SUCH_ITEM,Py),this._events.set(T.COMMUNITY_GOAL_VOTE_EVENT,Gy),this._events.set(T.PROMO_ARTICLES,xy),this._events.set(T.MARKETPLACE_AFTER_ORDER_STATUS,By),this._events.set(T.MARKETPLACE_CANCEL_SALE,wy),this._events.set(T.MARKETPLACE_SELL_ITEM,Vy),this._events.set(T.MARKETPLACE_CONFIG,Yy),this._events.set(T.MARKETPLACE_ITEM_STATS,Hy),this._events.set(T.MARKETPLACE_ITEM_POSTED,jy),this._events.set(T.MARKETPLACE_ITEMS_SEARCHED,zy),this._events.set(T.MARKETPLACE_OWN_ITEMS,Wy),this._events.set(T.USER_BANNED,n0),this._events.set(T.MODERATION_CAUTION,Jy),this._events.set(T.MODTOOL_ROOM_INFO,t0),this._events.set(T.MODTOOL_USER_CHATLOG,a0),this._events.set(T.MODTOOL_ROOM_CHATLOG,i0),this._events.set(T.MODERATION_USER_INFO,s0),this._events.set(T.MODERATION_TOOL,Zy),this._events.set(T.MODTOOL_VISITED_ROOMS_USER,r0),this._events.set(T.CFH_CHATLOG,ky),this._events.set(T.ISSUE_DELETED,Ky),this._events.set(T.ISSUE_INFO,Xy),this._events.set(T.ISSUE_PICK_FAILED,qy),this._events.set(T.MODERATOR_ACTION_RESULT,Qy),this._events.set(T.MODERATOR_MESSAGE,$y),this._events.set(T.MODERATOR_TOOL_PREFERENCES,e0),this._events.set(T.MYSTERY_BOX_KEYS,Wg),this._events.set(T.GOTMYSTERYBOXPRIZEMESSAGE,h0),this._events.set(T.CANCELMYSTERYBOXWAITMESSAGE,o0),this._events.set(T.SHOWMYSTERYBOXWAITMESSAGE,_0),this._events.set(T.CAN_CREATE_ROOM,l0),this._events.set(T.CAN_CREATE_ROOM_EVENT,c0),this._events.set(T.CATEGORIES_WITH_VISITOR_COUNT,u0),this._events.set(T.COMPETITION_ROOMS_DATA,d0),this._events.set(T.CONVERTED_ROOM_ID,E0),this._events.set(T.ROOM_DOORBELL,kg),this._events.set(T.USER_FAVORITE_ROOM,g0),this._events.set(T.USER_FAVORITE_ROOM_COUNT,f0),this._events.set(T.ROOM_DOORBELL_REJECTED,Hc),this._events.set(T.ROOM_CREATED,I0),this._events.set(T.ROOM_INFO,jc),this._events.set(T.GUEST_ROOM_SEARCH_RESULT,T0),this._events.set(T.USER_HOME_ROOM,p0),this._events.set(T.ROOM_EVENT_CANCEL,D0),this._events.set(T.ROOM_EVENT,L0),this._events.set(T.ROOM_INFO_UPDATED,U0),this._events.set(T.THUMBNAIL_UPDATE_RESULT,y0),this._events.set(T.NAVIGATOR_EVENT_CATEGORIES,v0),this._events.set(T.NAVIGATOR_CATEGORIES,b0),this._events.set(T.NAVIGATOR_COLLAPSED,m0),this._events.set(T.NAVIGATOR_LIFTED,R0),this._events.set(T.NAVIGATOR_METADATA,O0),this._events.set(T.NAVIGATOR_OPEN_ROOM_CREATOR,A0),this._events.set(T.NAVIGATOR_SEARCHES,S0),this._events.set(T.NAVIGATOR_SEARCH,C0),this._events.set(T.NAVIGATOR_SETTINGS,M0),this._events.set(T.GENERIC_ALERT,V0),this._events.set(T.MOTD_MESSAGES,H0),this._events.set(T.NOTIFICATION_LIST,j0),this._events.set(T.UNSEEN_ITEMS,X0),this._events.set(T.ACHIEVEMENT_NOTIFICATION,F0),this._events.set(T.INFO_FEED_ENABLE,Y0),this._events.set(T.CLUB_GIFT_NOTIFICATION,G0),this._events.set(T.ACTIVITY_POINT_NOTIFICATION,x0),this._events.set(T.BOT_ERROR,Kg),this._events.set(T.PET_LEVEL_NOTIFICATION,W0),this._events.set(T.NOTIFICATION_OFFER_REWARD_DELIVERED,z0),this._events.set(T.NOTIFICATION_SIMPLE_ALERT,K0),this._events.set(T.NOTIFICATION_ELEMENT_POINTER,w0),this._events.set(T.USER_PERKS,sv),this._events.set(T.PET_TRAINING_PANEL,rv),this._events.set(T.PET_LEVEL_UPDATE,Jg),this._events.set(T.PET_SCRATCH_FAILED,Zg),this._events.set(T.PET_OPEN_PACKAGE_REQUESTED,qg),this._events.set(T.PET_OPEN_PACKAGE_RESULT,Qg),this._events.set(T.PET_BREEDING_RESULT,lf),this._events.set(T.QUESTION,rf),this._events.set(T.POLL_CONTENTS,$g),this._events.set(T.POLL_ERROR,tf),this._events.set(T.POLL_OFFER,ef),this._events.set(T.POLL_START_ROOM,of),this._events.set(T.QUESTION_ANSWERED,sf),this._events.set(T.QUESTION_FINISHED,nf),this._events.set(T.POLL_ROOM_RESULT,af),this._events.set(T.COMMUNITY_GOAL_EARNED_PRIZES,nv),this._events.set(T.COMMUNITY_GOAL_PROGRESS,ov),this._events.set(T.CONCURRENT_USERS_GOAL_PROGRESS,hv),this._events.set(T.QUEST_DAILY,uv),this._events.set(T.QUEST_CANCELLED,lv),this._events.set(T.QUEST_COMPLETED,cv),this._events.set(T.COMMUNITY_GOAL_HALL_OF_FAME,av),this._events.set(T.EPIC_POPUP,_v),this._events.set(T.SEASONAL_QUESTS,gv),this._events.set(T.QUESTS,Ev),this._events.set(T.QUEST,dv),this._events.set(T.ROOM_ENTER_ERROR,fv),this._events.set(T.ROOM_ENTER,Qc),this._events.set(T.ROOM_FORWARD,Iv),this._events.set(T.ROOM_DOORBELL_ACCEPTED,kc),this._events.set(T.ROOM_RIGHTS_CLEAR,Kc),this._events.set(T.ROOM_RIGHTS_OWNER,qc),this._events.set(T.ROOM_RIGHTS,Xc),this._events.set(T.BOT_COMMAND_CONFIGURATION,Tv),this._events.set(T.BOT_SKILL_LIST_UPDATE,pv),this._events.set(T.BOT_FORCE_OPEN_CONTEXT_MENU,mv),this._events.set(T.ROOM_SETTINGS_CHAT,Rv),this._events.set(T.ROOM_INFO_OWNER,Ov),this._events.set(T.ROOM_SCORE,Av),this._events.set(T.ROOM_ROLLING,Zc),this._events.set(T.FURNITURE_FLOOR_ADD,tu),this._events.set(T.FURNITURE_FLOOR,eu),this._events.set(T.FURNITURE_FLOOR_REMOVE,su),this._events.set(T.FURNITURE_FLOOR_UPDATE,iu),this._events.set(T.ITEM_WALL_ADD,hu),this._events.set(T.ITEM_WALL,_u),this._events.set(T.ITEM_WALL_REMOVE,lu),this._events.set(T.ITEM_WALL_UPDATE,cu),this._events.set(T.FURNITURE_ALIASES,ru),this._events.set(T.FURNITURE_DATA,nu),this._events.set(T.FURNITURE_ITEMDATA,au),this._events.set(T.ITEM_STACK_HELPER,Mv),this._events.set(T.FURNITURE_STATE,ou),this._events.set(T.ITEM_DIMMER_SETTINGS,_f),this._events.set(T.FURNITURE_STATE_2,$c),this._events.set(T.LOVELOCK_FURNI_FINISHED,Dv),this._events.set(T.LOVELOCK_FURNI_FRIEND_COMFIRMED,Lv),this._events.set(T.LOVELOCK_FURNI_START,Pv),this._events.set(T.OBJECTS_DATA_UPDATE,Jc),this._events.set(T.FURNITURE_GROUP_CONTEXT_MENU_INFO,Nv),this._events.set(T.FURNITURE_POSTIT_STICKY_POLE_OPEN,bv),this._events.set(T.ROOM_SPECTATOR,gf),this._events.set(T.CUSTOM_USER_NOTIFICATION,Sv),this._events.set(T.ROOM_MESSAGE_NOTIFICATION,Fv),this._events.set(T.ROOM_POPULAR_TAGS_RESULT,N0),this._events.set(T.ROOM_RIGHTS_LIST,Qv),this._events.set(T.ROOM_RIGHTS_LIST_ADD,Xv),this._events.set(T.ROOM_RIGHTS_LIST_REMOVE,qv),this._events.set(T.ROOM_BAN_LIST,Kv),this._events.set(T.ROOM_SETTINGS_SAVE_ERROR,sb),this._events.set(T.ROOM_SETTINGS,$v),this._events.set(T.ROOM_SETTINGS_SAVE,eb),this._events.set(T.ROOM_SETTINGS_ERROR,tb),this._events.set(T.SHOW_ENFORCE_ROOM_CATEGORY,ib),this._events.set(T.ROOM_BAN_REMOVE,rb),this._events.set(T.ROOM_MUTED,Jv),this._events.set(T.NO_SUCH_FLAT,Zv),this._events.set(T.FAVORITE_GROUP_UDPATE,hf),this._events.set(T.ROOM_MODEL_DOOR,du),this._events.set(T.ROOM_HEIGHT_MAP,Eu),this._events.set(T.ROOM_HEIGHT_MAP_UPDATE,gu),this._events.set(T.ROOM_MODEL,uu),this._events.set(T.ROOM_MODEL_NAME,kn),this._events.set(T.ROOM_PAINT,fu),this._events.set(T.ROOM_THICKNESS,Iu),this._events.set(T.ROOM_GET_FILTER_WORDS,P0),this._events.set(T.ROOM_MODEL_BLOCKED_TILES,Vv),this._events.set(T.PET_FIGURE_UPDATE,Ho),this._events.set(T.PET_INFO,uf),this._events.set(T.PET_STATUS,df),this._events.set(T.PET_EXPERIENCE,cf),this._events.set(T.PLAYING_GAME,Ef),this._events.set(T.UNIT_DANCE,Wo),this._events.set(T.UNIT_EFFECT,mu),this._events.set(T.UNIT,ko),this._events.set(T.UNIT_EXPRESSION,pu),this._events.set(T.UNIT_HAND_ITEM,Ru),this._events.set(T.UNIT_IDLE,Ou),this._events.set(T.UNIT_INFO,Ko),this._events.set(T.UNIT_NUMBER,Au),this._events.set(T.UNIT_REMOVE,Xo),this._events.set(T.UNIT_STATUS,Su),this._events.set(T.HAND_ITEM_RECEIVED,Tf),this._events.set(T.FLOOD_CONTROL,ff),this._events.set(T.REMAINING_MUTE,If),this._events.set(T.UNIT_CHAT,zd),this._events.set(T.UNIT_CHAT_SHOUT,jo),this._events.set(T.UNIT_CHAT_WHISPER,zo),this._events.set(T.UNIT_TYPING,Tu),this._events.set(T.WIRED_ACTION,Yv),this._events.set(T.WIRED_CONDITION,Hv),this._events.set(T.WIRED_TRIGGER,jv),this._events.set(T.WIRED_OPEN,zv),this._events.set(T.WIRED_REWARD,Cu),this._events.set(T.WIRED_SAVE,Wv),this._events.set(T.WIRED_ERROR,kv),this._events.set(T.AUTHENTICATED,mf),this._events.set(T.JUKEBOX_PLAYLIST_FULL,pf),this._events.set(T.JUKEBOX_SONG_DISKS,Rf),this._events.set(T.NOW_PLAYING,Of),this._events.set(T.OFFICIAL_SONG_ID,nb),this._events.set(T.PLAYLIST,ab),this._events.set(T.PLAYLIST_SONG_ADDED,ob),this._events.set(T.TRAX_SONG_INFO,Af),this._events.set(T.USER_SONG_DISKS_INVENTORY,Sf),this._events.set(T.HELPER_TALENT_TRACK,lb),this._events.set(T.TALENT_TRACK_LEVEL,_b),this._events.set(T.TALENT_TRACK_LEVEL_UP,hb),this._events.set(T.IN_CLIENT_LINK,yf),this._events.set(T.USER_IGNORED,Uf),this._events.set(T.USER_IGNORED_RESULT,kd),this._events.set(T.USER_RESPECT,Ff),this._events.set(T.USER_PERMISSIONS,Cf),this._events.set(T.USER_BADGES_CURRENT,Nf),this._events.set(T.USER_INFO,qo),this._events.set(T.UNIT_CHANGE_NAME,Wd),this._events.set(T.USER_SETTINGS,gb),this._events.set(T.USER_PROFILE,Eb),this._events.set(T.MESSENGER_RELATIONSHIPS,db),this._events.set(T.GIFT_OPENED,zg),this._events.set(T.USER_CREDITS,Ab),this._events.set(T.USER_CURRENCY,Sb),this._events.set(T.USER_SUBSCRIPTION,Cb),this._events.set(T.USER_WARDROBE_PAGE,Nb),this._events.set(T.USER_CLASSIFICATION,Lb),this._events.set(T.GET_USER_TAGS,Df),this._events.set(T.SCR_SEND_KICKBACK_INFO,Mb),this._events.set(T.PET_RESPECTED,vf),this._events.set(T.PET_SUPPLEMENT,bf),this._events.set(T.ACCOUNT_SAFETY_LOCK_STATUS_CHANGE,Mf),this._events.set(T.GENERIC_ERROR,Yc),this._events.set(T.GROUP_LIST,Rb),this._events.set(T.CATALOG_APPROVE_NAME_RESULT,cb),this._events.set(T.CONNECTION_ERROR,B0),this._events.set(T.GUILD_EDIT_FAILED,mb),this._events.set(T.GUILD_MEMBER_MGMT_FAILED,pb),this._events.set(T.EXTENDED_PROFILE_CHANGED,fb),this._events.set(T.NOOBNESS_LEVEL,wg),this._events.set(T.DISCONNECT_REASON,DU),this._events.set(T.HANDSHAKE_INIT_DIFFIE,PU),this._events.set(T.HANDSHAKE_COMPLETE_DIFFIE,NU),this._events.set(T.HANDSHAKE_IDENTITY_ACCOUNT,LU),this._events.set(T.NEW_USER_EXPERIENCE_GIFT_OFFER,$0),this._events.set(T.NEW_USER_EXPERIENCE_NOT_COMPLETE,ev),this._events.set(T.RESTORE_CLIENT,k0),this._events.set(T.FIREWORK_CHARGE_DATA,zL),this._events.set(T.PHONE_COLLECTION_STATE,hU),this._events.set(T.PHONE_TRY_NUMBER_RESULT,_U),this._events.set(T.PHONE_TRY_VERIFICATION_CODE_RESULT,lU),this._events.set(T.WELCOME_GIFT_CHANGE_EMAIL_RESULT,Db),this._events.set(T.WELCOME_GIFT_STATUS,xv),this._events.set(T.RENTABLE_SPACE_RENT_OK,yv),this._events.set(T.RENTABLE_SPACE_STATUS,vv),this._events.set(T.RENTABLE_SPACE_RENT_FAILED,Uv),this._events.set(T.RECYCLER_STATUS,Wc),this._events.set(T.RECYCLER_FINISHED,zc),this._events.set(T.EMAIL_STATUS,Lf),this._events.set(T.CHANGE_EMAIL_RESULT,ub),this._events.set(T.RENTABLE_FURNI_RENT_OR_BUYOUT_OFFER,Cv)}registerComposers(){this._composers.set(E.AUTHENTICATION,e1),this._composers.set(E.INTERSTITIAL_SHOWN,Ub),this._composers.set(E.GET_INTERSTITIAL,Pb),this._composers.set(E.GET_WARDROBE,Fb),this._composers.set(E.SAVE_WARDROBE_OUTFIT,xb),this._composers.set(E.CHANGE_USERNAME,vb),this._composers.set(E.CHECK_USERNAME,bb),this._composers.set(E.REQUEST_CAMERA_CONFIGURATION,Vb),this._composers.set(E.RENDER_ROOM,Qo),this._composers.set(E.RENDER_ROOM_THUMBNAIL,Nu),this._composers.set(E.PURCHASE_PHOTO,wb),this._composers.set(E.PUBLISH_PHOTO,Bb),this._composers.set(E.PHOTO_COMPETITION,Gb),this._composers.set(E.OPEN_CAMPAIGN_CALENDAR_DOOR,Hb),this._composers.set(E.OPEN_CAMPAIGN_CALENDAR_DOOR_STAFF,Yb),this._composers.set(E.BUILDERS_CLUB_PLACE_ROOM_ITEM,jb),this._composers.set(E.BUILDERS_CLUB_PLACE_WALL_ITEM,zb),this._composers.set(E.BUILDERS_CLUB_QUERY_FURNI_COUNT,Wb),this._composers.set(E.GET_CATALOG_INDEX,Xb),this._composers.set(E.GET_CATALOG_PAGE,qb),this._composers.set(E.CATALOG_PURCHASE,gF),this._composers.set(E.CATALOG_PURCHASE_GIFT,EF),this._composers.set(E.GET_PRODUCT_OFFER,oF),this._composers.set(E.GET_CLUB_OFFERS,$b),this._composers.set(E.GET_CLUB_GIFT_INFO,Zb),this._composers.set(E.CATALOG_REDEEM_VOUCHER,mF),this._composers.set(E.GROUP_MEMBERSHIPS,Jw),this._composers.set(E.GET_GIFT_WRAPPING_CONFIG,eF),this._composers.set(E.CATALOG_SELECT_VIP_GIFT,RF),this._composers.set(E.CATALOG_REQUESET_PET_BREEDS,lF),this._composers.set(E.GET_BONUS_RARE_INFO,kb),this._composers.set(E.GET_BUNDLE_DISCOUNT_RULESET,Kb),this._composers.set(E.GET_CATALOG_PAGE_EXPIRATION,Qb),this._composers.set(E.GET_CATALOG_PAGE_WITH_EARLIEST_EXP,Jb),this._composers.set(E.GET_DIRECT_CLUB_BUY_AVAILABLE,tF),this._composers.set(E.GET_HABBO_BASIC_MEMBERSHIP_EXTEND_OFFER,sF),this._composers.set(E.GET_HABBO_CLUB_EXTEND_OFFER,iF),this._composers.set(E.GET_IS_OFFER_GIFTABLE,rF),this._composers.set(E.GET_LIMITED_OFFER_APPEARING_NEXT,nF),this._composers.set(E.GET_NEXT_TARGETED_OFFER,aF),this._composers.set(E.GET_ROOM_AD_PURCHASE_INFO,hF),this._composers.set(E.GET_SEASONAL_CALENDAR_DAILY_OFFER,_F),this._composers.set(E.GET_TARGETED_OFFER,cF),this._composers.set(E.MARK_CATALOG_NEW_ADDITIONS_PAGE_OPENED,uF),this._composers.set(E.PURCHASE_BASIC_MEMBERSHIP_EXTENSION,dF),this._composers.set(E.PURCHASE_ROOM_AD,fF),this._composers.set(E.PURCHASE_TARGETED_OFFER,IF),this._composers.set(E.PURCHASE_VIP_MEMBERSHIP_EXTENSION,TF),this._composers.set(E.ROOM_AD_PURCHASE_INITIATED,pF),this._composers.set(E.SET_TARGETTED_OFFER_STATE,OF),this._composers.set(E.SHOP_TARGETED_OFFER_VIEWED,AF),this._composers.set(E.FORWARD_TO_A_COMPETITION_ROOM,SF),this._composers.set(E.FORWARD_TO_A_SUBMITTABLE_ROOM,CF),this._composers.set(E.FORWARD_TO_RANDOM_COMPETITION_ROOM,MF),this._composers.set(E.GET_CURRENT_TIMING_CODE,NF),this._composers.set(E.GET_IS_USER_PART_OF_COMPETITION,DF),this._composers.set(E.GET_SECONDS_UNTIL,LF),this._composers.set(E.ROOM_COMPETITION_INIT,PF),this._composers.set(E.SUBMIT_ROOM_TO_COMPETITION,Du),this._composers.set(E.VOTE_FOR_ROOM,UF),this._composers.set(E.CRAFT,yF),this._composers.set(E.CRAFT_SECRET,vF),this._composers.set(E.GET_CRAFTABLE_PRODUCTS,FF),this._composers.set(E.GET_CRAFTING_RECIPE,bF),this._composers.set(E.GET_CRAFTING_RECIPES_AVAILABLE,xF),this._composers.set(E.FRIEND_FURNI_CONFIRM_LOCK,BF),this._composers.set(E.ACCEPT_FRIEND,wF),this._composers.set(E.DECLINE_FRIEND,VF),this._composers.set(E.FIND_NEW_FRIENDS,YF),this._composers.set(E.FOLLOW_FRIEND,HF),this._composers.set(E.FRIEND_LIST_UPDATE,jF),this._composers.set(E.GET_FRIEND_REQUESTS,zF),this._composers.set(E.HABBO_SEARCH,WF),this._composers.set(E.MESSENGER_INIT,kF),this._composers.set(E.REMOVE_FRIEND,KF),this._composers.set(E.REQUEST_FRIEND,XF),this._composers.set(E.MESSENGER_CHAT,qF),this._composers.set(E.SEND_ROOM_INVITE,QF),this._composers.set(E.SET_RELATIONSHIP_STATUS,JF),this._composers.set(E.VISIT_USER,ZF),this._composers.set(E.DELETE_ITEM,j1),this._composers.set(E.ACHIEVEMENT_RESOLUTION_OPEN,xf),this._composers.set(E.ACCEPTGAMEINVITE,ax),this._composers.set(E.GAMEUNLOADEDMESSAGE,ox),this._composers.set(E.GETGAMEACHIEVEMENTSMESSAGE,hx),this._composers.set(E.GAMES_LIST,_x),this._composers.set(E.GETGAMESTATUSMESSAGE,lx),this._composers.set(E.GETUSERGAMEACHIEVEMENTSMESSAGE,cx),this._composers.set(E.JOINQUEUEMESSAGE,ux),this._composers.set(E.LEAVEQUEUEMESSAGE,dx),this._composers.set(E.RESETRESOLUTIONACHIEVEMENTMESSAGE,Ex),this._composers.set(E.GAMES_INIT,Ix),this._composers.set(E.GETWEEKLYGAMEREWARDWINNERS,Tx),this._composers.set(E.GAME2GETACCOUNTGAMESTATUSMESSAGE,rx),this._composers.set(E.GAME2CHECKGAMEDIRECTORYSTATUSMESSAGE,ix),this._composers.set(E.GAME2EXITGAMEMESSAGE,$F),this._composers.set(E.GAME2GAMECHATMESSAGE,tx),this._composers.set(E.GAME2LOADSTAGEREADYMESSAGE,ex),this._composers.set(E.GAME2PLAYAGAINMESSAGE,sx),this._composers.set(E.GAME2REQUESTFULLSTATUSUPDATEMESSAGE,nx),this._composers.set(E.GAME2GETWEEKLYFRIENDSLEADERBOARD,gx),this._composers.set(E.GAME2GETWEEKLYLEADERBOARD,fx),this._composers.set(E.GET_GIFT,Lu),this._composers.set(E.RESET_PHONE_NUMBER_STATE,mx),this._composers.set(E.SET_PHONE_NUMBER_VERIFICATION_STATUS,Pu),this._composers.set(E.TRY_PHONE_NUMBER,px),this._composers.set(E.VERIFY_CODE,Rx),this._composers.set(E.GET_FORUM_STATS,zx),this._composers.set(E.GET_FORUMS_LIST,jx),this._composers.set(E.GET_FORUM_MESSAGES,Wx),this._composers.set(E.GET_FORUM_THREAD,kx),this._composers.set(E.GET_FORUM_THREADS,Kx),this._composers.set(E.GET_UNREAD_FORUMS_COUNT,Xx),this._composers.set(E.FORUM_MODERATE_MESSAGE,qx),this._composers.set(E.FORUM_MODERATE_THREAD,Qx),this._composers.set(E.FORUM_POST_MESSAGE,Jx),this._composers.set(E.UPDATE_FORUM_READ_MARKER,Zx),this._composers.set(E.UPDATE_FORUM_SETTINGS,$x),this._composers.set(E.FORUM_UPDATE_THREAD,t1),this._composers.set(E.CLIENT_PONG,wf),this._composers.set(E.RELEASE_VERSION,Gf),this._composers.set(E.SECURITY_TICKET,Vf),this._composers.set(E.USER_INFO,Bf),this._composers.set(E.DISCONNECT,i1),this._composers.set(E.SECURITY_MACHINE,Yf),this._composers.set(E.CLIENT_VARIABLES,n1),this._composers.set(E.HANDSHAKE_INIT_DIFFIE,r1),this._composers.set(E.HANDSHAKE_COMPLETE_DIFFIE,s1),this._composers.set(E.CALL_FOR_HELP_FROM_FORUM_MESSAGE,a1),this._composers.set(E.CALL_FOR_HELP_FROM_FORUM_THREAD,o1),this._composers.set(E.CALL_FOR_HELP_FROM_IM,h1),this._composers.set(E.CALL_FOR_HELP_FROM_PHOTO,_1),this._composers.set(E.CALL_FOR_HELP_FROM_SELFIE,l1),this._composers.set(E.CALL_FOR_HELP,c1),this._composers.set(E.CHAT_REVIEW_GUIDE_DECIDES,u1),this._composers.set(E.CHAT_REVIEW_GUIDE_DETACHED,d1),this._composers.set(E.CHAT_REVIEW_GUIDE_VOTE,E1),this._composers.set(E.CHAT_REVIEW_SESSION_CREATE,g1),this._composers.set(E.DELETE_PENDING_CALLS_FOR_HELP,f1),this._composers.set(E.GET_CFH_STATUS,I1),this._composers.set(E.GET_FAQ_CATEGORY,T1),this._composers.set(E.GET_FAQ_TEXT,m1),this._composers.set(E.GET_GUIDE_REPORTING_STATUS,p1),this._composers.set(E.GET_PENDING_CALLS_FOR_HELP,R1),this._composers.set(E.GET_QUIZ_QUESTIONS,O1),this._composers.set(E.GUIDE_SESSION_CREATE,A1),this._composers.set(E.GUIDE_SESSION_FEEDBACK,S1),this._composers.set(E.GUIDE_SESSION_GET_REQUESTER_ROOM,C1),this._composers.set(E.GUIDE_SESSION_GUIDE_DECIDES,M1),this._composers.set(E.GUIDE_SESSION_INVITE_REQUESTER,N1),this._composers.set(E.GUIDE_SESSION_IS_TYPING,D1),this._composers.set(E.GUIDE_SESSION_MESSAGE,L1),this._composers.set(E.GUIDE_SESSION_ON_DUTY_UPDATE,P1),this._composers.set(E.GUIDE_SESSION_REPORT,U1),this._composers.set(E.GUIDE_SESSION_REQUESTER_CANCELS,y1),this._composers.set(E.GUIDE_SESSION_RESOLVED,v1),this._composers.set(E.POST_QUIZ_ANSWERS,b1),this._composers.set(E.SEARCH_FAQS,F1),this._composers.set(E.DESKTOP_VIEW,GF),this._composers.set(E.GROUP_INFO,Ux),this._composers.set(E.GROUP_REQUEST,yx),this._composers.set(E.GROUP_MEMBER_REMOVE_CONFIRM,Dx),this._composers.set(E.GROUP_MEMBER_REMOVE,xx),this._composers.set(E.GROUP_MEMBERS,vx),this._composers.set(E.GROUP_ADMIN_ADD,Ax),this._composers.set(E.GROUP_ADMIN_REMOVE,Sx),this._composers.set(E.GROUP_REQUEST_ACCEPT,bx),this._composers.set(E.GROUP_REQUEST_DECLINE,Fx),this._composers.set(E.GROUP_DELETE,Lx),this._composers.set(E.GROUP_CREATE_OPTIONS,Nx),this._composers.set(E.GROUP_PARTS,Cx),this._composers.set(E.GROUP_BUY,Mx),this._composers.set(E.GROUP_SETTINGS,Yx),this._composers.set(E.GROUP_SAVE_BADGE,Gx),this._composers.set(E.GROUP_SAVE_COLORS,Bx),this._composers.set(E.GROUP_SAVE_INFORMATION,wx),this._composers.set(E.GROUP_SAVE_PREFERENCES,Vx),this._composers.set(E.GROUP_FAVORITE,Px),this._composers.set(E.GROUP_UNFAVORITE,Hx),this._composers.set(E.GROUP_BADGES,nT),this._composers.set(E.APPROVE_ALL_MEMBERSHIP_REQUESTS,Ox),this._composers.set(E.GROUP_UNBLOCK_MEMBER,cV),this._composers.set(E.ROOM_FAVORITE,xG),this._composers.set(E.CAN_CREATE_ROOM,BG),this._composers.set(E.CANCEL_ROOM_EVENT,GG),this._composers.set(E.CONVERT_GLOBAL_ROOM_ID,VG),this._composers.set(E.COMPETITION_ROOM_SEARCH,wG),this._composers.set(E.ROOM_CREATE,YG),this._composers.set(E.GET_USER_FLAT_CATS,ZG),this._composers.set(E.GET_USER_EVENT_CATS,JG),this._composers.set(E.ROOM_FAVORITE_REMOVE,HG),this._composers.set(E.EDIT_ROOM_EVENT,jG),this._composers.set(E.FORWARD_TO_RANDOM_PROMOTED_ROOM,zG),this._composers.set(E.FORWARD_TO_SOME_ROOM,WG),this._composers.set(E.GET_CATEGORIES_WITH_USER_COUNT,kG),this._composers.set(E.GET_GUEST_ROOM,XG),this._composers.set(E.GET_OFFICIAL_ROOMS,qG),this._composers.set(E.GET_POPULAR_ROOM_TAGS,QG),this._composers.set(E.GUILD_BASE_SEARCH,$G),this._composers.set(E.MY_FAVOURITE_ROOMS_SEARCH,tB),this._composers.set(E.MY_FREQUENT_ROOM_HISTORY_SEARCH,eB),this._composers.set(E.MY_FRIENDS_ROOM_SEARCH,sB),this._composers.set(E.MY_GUILD_BASES_SEARCH,iB),this._composers.set(E.MY_RECOMMENDED_ROOMS,rB),this._composers.set(E.MY_ROOM_HISTORY_SEARCH,nB),this._composers.set(E.MY_ROOM_RIGHTS_SEARCH,aB),this._composers.set(E.MY_ROOMS_SEARCH,oB),this._composers.set(E.POPULAR_ROOMS_SEARCH,fB),this._composers.set(E.ROOM_LIKE,IB),this._composers.set(E.ROOM_RIGHTS_REMOVE_OWN,TB),this._composers.set(E.ROOM_AD_EVENT_TAB_CLICKED,mB),this._composers.set(E.ROOM_AD_EVENT_TAB_VIEWED,pB),this._composers.set(E.ROOM_AD_SEARCH,RB),this._composers.set(E.ROOM_TEXT_SEARCH,SB),this._composers.set(E.ROOMS_WHERE_MY_FRIENDS_ARE,OB),this._composers.set(E.ROOMS_WITH_HIGHEST_SCORE_SEARCH,AB),this._composers.set(E.SET_ROOM_SESSION_TAGS,CB),this._composers.set(E.ROOM_STAFF_PICK,MB),this._composers.set(E.ROOM_FILTER_WORDS,KG),this._composers.set(E.ROOM_FILTER_WORDS_MODIFY,DB),this._composers.set(E.USER_HOME_ROOM,NB),this._composers.set(E.UPDATE_ROOM_THUMBNAIL,LB),this._composers.set(E.NAVIGATOR_INIT,lB),this._composers.set(E.NAVIGATOR_SEARCH_CLOSE,cB),this._composers.set(E.NAVIGATOR_SEARCH,uB),this._composers.set(E.NAVIGATOR_SEARCH_OPEN,dB),this._composers.set(E.NAVIGATOR_SEARCH_SAVE,EB),this._composers.set(E.NAVIGATOR_SETTINGS_SAVE,gB),this._composers.set(E.NAVIGATOR_CATEGORY_LIST_MODE,hB),this._composers.set(E.NAVIGATOR_DELETE_SAVED_SEARCH,_B),this._composers.set(E.POLL_ANSWER,Qf),this._composers.set(E.POLL_REJECT,Jf),this._composers.set(E.POLL_START,Zf),this._composers.set(E.POLL_VOTE_COUNTER,yB),this._composers.set(E.USER_EFFECT_ACTIVATE,x1),this._composers.set(E.USER_EFFECT_ENABLE,G1),this._composers.set(E.USER_BADGES,Y1),this._composers.set(E.USER_BADGES_CURRENT_UPDATE,H1),this._composers.set(E.GET_BADGE_POINTS_LIMITS,B1),this._composers.set(E.REQUESTABADGE,V1),this._composers.set(E.GETISBADGEREQUESTFULFILLED,w1),this._composers.set(E.USER_BOTS,ig),this._composers.set(E.USER_FURNITURE,z1),this._composers.set(E.REQUESTFURNIINVENTORYWHENNOTINROOM,W1),this._composers.set(E.USER_PETS,rg),this._composers.set(E.TRADE_ACCEPT,X1),this._composers.set(E.TRADE_CANCEL,q1),this._composers.set(E.TRADE_CLOSE,Q1),this._composers.set(E.TRADE_CONFIRM,J1),this._composers.set(E.TRADE_ITEM,Z1),this._composers.set(E.TRADE_ITEMS,$1),this._composers.set(E.TRADE_ITEM_REMOVE,tG),this._composers.set(E.TRADE,eG),this._composers.set(E.TRADE_UNACCEPT,sG),this._composers.set(E.UNSEEN_RESET_CATEGORY,iG),this._composers.set(E.UNSEEN_RESET_ITEMS,rG),this._composers.set(E.ACHIEVEMENT_LIST,yb),this._composers.set(E.PET_MOUNT,vu),this._composers.set(E.PET_RESPECT,zf),this._composers.set(E.PET_SUPPLEMENT,UB),this._composers.set(E.REMOVE_PET_SADDLE,Wf),this._composers.set(E.PET_INFO,kf),this._composers.set(E.TOGGLE_PET_BREEDING,Kf),this._composers.set(E.TOGGLE_PET_RIDING,Xf),this._composers.set(E.USE_PET_PRODUCT,qf),this._composers.set(E.GET_PET_TRAINING_PANEL,jf),this._composers.set(E.PET_OPEN_PACKAGE,vI),this._composers.set(E.PET_SELECTED,yw),this._composers.set(E.PETS_BREED,Gu),this._composers.set(E.PET_CANCEL_BREEDING,k1),this._composers.set(E.PET_CONFIRM_BREEDING,K1),this._composers.set(E.ROOM_ENTER,tI),this._composers.set(E.ROOM_DOORBELL,$f),this._composers.set(E.GO_TO_FLAT,GI),this._composers.set(E.CHANGE_QUEUE,xI),this._composers.set(E.ROOM_AMBASSADOR_ALERT,eI),this._composers.set(E.ROOM_BAN_GIVE,sI),this._composers.set(E.ROOM_BAN_REMOVE,$B),this._composers.set(E.ROOM_RIGHTS_GIVE,iI),this._composers.set(E.ROOM_KICK,rI),this._composers.set(E.ROOM_MUTE_USER,nI),this._composers.set(E.ROOM_RIGHTS_REMOVE,aI),this._composers.set(E.ROOM_RIGHTS_REMOVE_ALL,JB),this._composers.set(E.ROOM_DELETE,ZB),this._composers.set(E.ROOM_SETTINGS,sw),this._composers.set(E.ROOM_SETTINGS_SAVE,rw),this._composers.set(E.ROOM_RIGHTS_LIST,iw),this._composers.set(E.ROOM_BAN_LIST,ew),this._composers.set(E.ROOM_SETTINGS_UPDATE_ROOM_CATEGORY_AND_TRADE,Vw),this._composers.set(E.BOT_CONFIGURATION,tw),this._composers.set(E.GET_ITEM_DATA,cI),this._composers.set(E.REMOVE_WALL_ITEM,gI),this._composers.set(E.BOT_PLACE,oI),this._composers.set(E.BOT_PICKUP,hI),this._composers.set(E.BOT_SKILL_SAVE,nw),this._composers.set(E.PET_PLACE,dI),this._composers.set(E.PET_MOVE,bu),this._composers.set(E.PET_PICKUP,EI),this._composers.set(E.SET_ITEM_DATA,II),this._composers.set(E.SET_OBJECT_DATA,TI),this._composers.set(E.COMPOST_PLANT,lI),this._composers.set(E.HARVEST_PET,uI),this._composers.set(E.SET_CLOTHING_CHANGE_DATA,fI),this._composers.set(E.FURNITURE_ALIASES,OI),this._composers.set(E.FURNITURE_GROUP_INFO,AI),this._composers.set(E.FURNITURE_PICKUP,SI),this._composers.set(E.FURNITURE_PLACE,CI),this._composers.set(E.ITEM_PAINT,_w),this._composers.set(E.FURNITURE_POSTIT_PLACE,MI),this._composers.set(E.FURNITURE_POSTIT_SAVE_STICKY_POLE,aw),this._composers.set(E.CONTROL_YOUTUBE_DISPLAY_PLAYBACK,Rw),this._composers.set(E.GET_YOUTUBE_DISPLAY_STATUS,Ow),this._composers.set(E.SET_YOUTUBE_DISPLAY_PLAYLIST,Aw),this._composers.set(E.FURNITURE_FLOOR_UPDATE,Fu),this._composers.set(E.FURNITURE_WALL_UPDATE,FI),this._composers.set(E.ITEM_DIMMER_SETTINGS,mI),this._composers.set(E.ITEM_DIMMER_SAVE,pI),this._composers.set(E.ITEM_DIMMER_TOGGLE,RI),this._composers.set(E.ROOM_TONER_APPLY,pw),this._composers.set(E.ITEM_COLOR_WHEEL_CLICK,NI),this._composers.set(E.ITEM_DICE_CLICK,DI),this._composers.set(E.ITEM_DICE_CLOSE,LI),this._composers.set(E.FURNITURE_MULTISTATE,Kd),this._composers.set(E.FURNITURE_RANDOMSTATE,UI),this._composers.set(E.ITEM_STACK_HELPER,uw),this._composers.set(E.FURNITURE_WALL_MULTISTATE,yI),this._composers.set(E.ONE_WAY_DOOR_CLICK,PI),this._composers.set(E.ITEM_EXCHANGE_REDEEM,cw),this._composers.set(E.ITEM_CLOTHING_REDEEM,Nw),this._composers.set(E.ROOM_MODEL,xu),this._composers.set(E.GET_OCCUPIED_TILES,Sw),this._composers.set(E.GET_ROOM_ENTRY_TILE,Cw),this._composers.set(E.ROOM_MODEL_SAVE,Mw),this._composers.set(E.UNIT_ACTION,HI),this._composers.set(E.UNIT_DANCE,jI),this._composers.set(E.UNIT_DROP_HAND_ITEM,Lw),this._composers.set(E.UNIT_GIVE_HANDITEM,Pw),this._composers.set(E.UNIT_GIVE_HANDITEM_PET,Uw),this._composers.set(E.UNIT_LOOK,zI),this._composers.set(E.UNIT_SIGN,kI),this._composers.set(E.UNIT_POSTURE,WI),this._composers.set(E.UNIT_WALK,KI),this._composers.set(E.UNIT_CHAT,Xd),this._composers.set(E.UNIT_CHAT_SHOUT,BI),this._composers.set(E.USER_SETTINGS_CHAT_STYLE,Dw),this._composers.set(E.UNIT_CHAT_WHISPER,wI),this._composers.set(E.UNIT_TYPING,VI),this._composers.set(E.UNIT_TYPING_STOP,YI),this._composers.set(E.WIRED_APPLY_SNAPSHOT,bw),this._composers.set(E.WIRED_OPEN,Fw),this._composers.set(E.WIRED_ACTION_SAVE,Gw),this._composers.set(E.WIRED_CONDITION_SAVE,Bw),this._composers.set(E.WIRED_TRIGGER_SAVE,ww),this._composers.set(E.ROOM_MUTE,xw),this._composers.set(E.APPROVE_NAME,Qw),this._composers.set(E.USER_RESPECT,aT),this._composers.set(E.SCR_GET_KICKBACK_INFO,aV),this._composers.set(E.PEER_USERS_CLASSIFICATION,oT),this._composers.set(E.USER_CLASSIFICATION,hT),this._composers.set(E.USER_IGNORED,ZI),this._composers.set(E.USER_IGNORE,tT),this._composers.set(E.USER_IGNORE_ID,eT),this._composers.set(E.USER_UNIGNORE,sT),this._composers.set(E.USER_BADGES_CURRENT,iT),this._composers.set(E.USER_FIGURE,tV),this._composers.set(E.USER_MOTTO,rT),this._composers.set(E.USER_PROFILE,eV),this._composers.set(E.USER_PROFILE_BY_NAME,$w),this._composers.set(E.USER_TAGS,$I),this._composers.set(E.MESSENGER_RELATIONSHIPS,sV),this._composers.set(E.MANNEQUIN_SAVE_NAME,Ew),this._composers.set(E.MANNEQUIN_SAVE_LOOK,dw),this._composers.set(E.PRESENT_OPEN_PRESENT,bI),this._composers.set(E.MARKETPLACE_CONFIG,cG),this._composers.set(E.MARKETPLACE_SELL_ITEM,gG),this._composers.set(E.MARKETPLACE_REQUEST_OWN_ITEMS,EG),this._composers.set(E.MARKETPLACE_TAKE_BACK_ITEM,_G),this._composers.set(E.MARKETPLACE_REQUEST_OFFERS,dG),this._composers.set(E.MARKETPLACE_BUY_OFFER,oG),this._composers.set(E.MARKETPLACE_REDEEM_CREDITS,fG),this._composers.set(E.MARKETPLACE_BUY_TOKENS,hG),this._composers.set(E.REQUEST_SELL_ITEM,lG),this._composers.set(E.REQUEST_MARKETPLACE_ITEM_STATS,uG),this._composers.set(E.USER_BOTS,ig),this._composers.set(E.USER_PETS,rg),this._composers.set(E.USER_CURRENCY,rV),this._composers.set(E.USER_SUBSCRIPTION,nV),this._composers.set(E.MODTOOL_REQUEST_ROOM_INFO,pG),this._composers.set(E.MODTOOL_CHANGE_ROOM_SETTINGS,MG),this._composers.set(E.MODTOOL_REQUEST_USER_CHATLOG,SG),this._composers.set(E.MODTOOL_REQUEST_ROOM_CHATLOG,OG),this._composers.set(E.MOD_TOOL_USER_INFO,RG),this._composers.set(E.MODTOOL_SANCTION_ALERT,CG),this._composers.set(E.MODTOOL_SANCTION_BAN,Si),this._composers.set(E.MODTOOL_SANCTION_KICK,NG),this._composers.set(E.MODTOOL_SANCTION_TRADELOCK,yG),this._composers.set(E.MODTOOL_ALERTEVENT,DG),this._composers.set(E.MODTOOL_SANCTION_MUTE,LG),this._composers.set(E.MODTOOL_REQUEST_USER_ROOMS,AG),this._composers.set(E.MODTOOL_ROOM_ALERT,yu),this._composers.set(E.CLOSE_ISSUE_DEFAULT_ACTION,IG),this._composers.set(E.CLOSE_ISSUES,Uu),this._composers.set(E.DEFAULT_SANCTION,TG),this._composers.set(E.GET_CFH_CHATLOG,mG),this._composers.set(E.MODTOOL_PREFERENCES,PG),this._composers.set(E.MODTOOL_SANCTION,UG),this._composers.set(E.PICK_ISSUES,vG),this._composers.set(E.RELEASE_ISSUES,bG),this._composers.set(E.MYSTERYBOXWAITINGCANCELEDMESSAGE,FG),this._composers.set(E.MYSTERYBOX_OPEN_TROPHY,gw),this._composers.set(E.USER_SETTINGS_CAMERA,oV),this._composers.set(E.USER_SETTINGS_OLD_CHAT,hV),this._composers.set(E.USER_SETTINGS_INVITES,_V),this._composers.set(E.USER_SETTINGS_VOLUME,lV),this._composers.set(E.COMMUNITY_GOAL_VOTE_COMPOSER,aG),this._composers.set(E.GET_PROMO_ARTICLES,nG),this._composers.set(E.ACCEPT_QUEST,vB),this._composers.set(E.ACTIVATE_QUEST,bB),this._composers.set(E.CANCEL_QUEST,FB),this._composers.set(E.FRIEND_REQUEST_QUEST_COMPLETE,xB),this._composers.set(E.GET_COMMUNITY_GOAL_EARNED_PRIZES,GB),this._composers.set(E.GET_COMMUNITY_GOAL_HALL_OF_FAME,BB),this._composers.set(E.GET_COMMUNITY_GOAL_PROGRESS,wB),this._composers.set(E.GET_CONCURRENT_USERS_GOAL_PROGRESS,VB),this._composers.set(E.GET_CONCURRENT_USERS_REWARD,YB),this._composers.set(E.GET_DAILY_QUEST,HB),this._composers.set(E.GET_QUESTS,jB),this._composers.set(E.GET_SEASONAL_QUESTS_ONLY,zB),this._composers.set(E.OPEN_QUEST_TRACKER,WB),this._composers.set(E.REDEEM_COMMUNITY_GOAL_PRIZE,kB),this._composers.set(E.REJECT_QUEST,KB),this._composers.set(E.START_CAMPAIGN,XB),this._composers.set(E.GET_SOUND_SETTINGS,zw),this._composers.set(E.ADD_JUKEBOX_DISK,Yw),this._composers.set(E.GET_JUKEBOX_PLAYLIST,XI),this._composers.set(E.GET_NOW_PLAYING,qI),this._composers.set(E.GET_OFFICIAL_SONG_ID,Hw),this._composers.set(E.GET_SONG_INFO,QI),this._composers.set(E.GET_SOUND_MACHINE_PLAYLIST,jw),this._composers.set(E.GET_USER_SONG_DISKS,JI),this._composers.set(E.REMOVE_JUKEBOX_DISK,Ww),this._composers.set(E.HELPER_TALENT_TRACK,Kw),this._composers.set(E.TALENT_TRACK_GET_LEVEL,kw),this._composers.set(E.NEW_USER_EXPERIENCE_GET_GIFTS,PB),this._composers.set(E.NEW_USER_EXPERIENCE_SCRIPT_PROCEED,Hf),this._composers.set(E.WELCOME_OPEN_GIFT,fw),this._composers.set(E.WELCOME_GIFT_CHANGE_EMAIL,uV),this._composers.set(E.EMAIL_GET_STATUS,iV),this._composers.set(E.EMAIL_CHANGE,Zw),this._composers.set(E.RENTABLE_SPACE_CANCEL_RENT,Iw),this._composers.set(E.RENTABLE_SPACE_RENT,Tw),this._composers.set(E.RENTABLE_SPACE_STATUS,mw),this._composers.set(E.RECYCLER_STATUS,qB),this._composers.set(E.RECYCLER_ITEMS,QB),this._composers.set(E.TRACKING_PERFORMANCE_LOG,qw),this._composers.set(E.TRACKING_LAG_WARNING_REPORT,Xw),this._composers.set(E.ROOM_DIRECTORY_ROOM_NETWORK_OPEN_CONNECTION,vw),this._composers.set(E.RENTABLE_EXTEND_RENT_OR_BUYOUT_STRIP_ITEM,hw),this._composers.set(E.RENTABLE_EXTEND_RENT_OR_BUYOUT_FURNI,ow),this._composers.set(E.RENTABLE_GET_RENT_OR_BUYOUT_OFFER,lw)}get events(){return this._events}get composers(){return this._composers}}class gV extends Js{constructor(t){super(),this._communication=t,this._connection=null,this._messages=new EV,this._demo=new dV(this),this.onConnectionOpenedEvent=this.onConnectionOpenedEvent.bind(this),this.onConnectionClosedEvent=this.onConnectionClosedEvent.bind(this),this.onConnectionErrorEvent=this.onConnectionErrorEvent.bind(this),this.onConnectionAuthenticatedEvent=this.onConnectionAuthenticatedEvent.bind(this)}onInit(){this._connection||(W.instance.events.addEventListener(hs.CONNECTION_AUTHENTICATED,this.onConnectionAuthenticatedEvent),this._connection=this._communication.createConnection(this),this._connection.registerMessages(this._messages),this._connection.addEventListener(ae.CONNECTION_OPENED,this.onConnectionOpenedEvent),this._connection.addEventListener(ae.CONNECTION_CLOSED,this.onConnectionClosedEvent),this._connection.addEventListener(ae.CONNECTION_ERROR,this.onConnectionErrorEvent),this._demo&&this._demo.init(),this._connection.init(q.getValue("socket.url")))}onDispose(){this._demo&&this._demo.dispose(),this._connection&&(this._connection.removeEventListener(ae.CONNECTION_OPENED,this.onConnectionOpenedEvent),this._connection.removeEventListener(ae.CONNECTION_CLOSED,this.onConnectionClosedEvent),this._connection.removeEventListener(ae.CONNECTION_ERROR,this.onConnectionErrorEvent)),W.instance.events.removeEventListener(hs.CONNECTION_AUTHENTICATED,this.onConnectionAuthenticatedEvent),super.onDispose()}onConnectionOpenedEvent(t){j.log("Connection Initialized")}onConnectionClosedEvent(t){j.log("Connection Closed")}onConnectionErrorEvent(t){j.log("Connection Error")}onConnectionAuthenticatedEvent(t){j.log("Connection Authenticated"),this._connection&&this._connection.authenticated()}connectionInit(t){j.log("Initializing Connection",t)}registerMessageEvent(t){return this._connection&&this._connection.addMessageEvent(t),t}removeMessageEvent(t){this._connection&&this._connection.removeMessageEvent(t)}get demo(){return this._demo}get connection(){return this._connection}}const Sr=class Sr{static get available(){return this._isListeningForPostMessages||(this._isListeningForPostMessages=!0,window.addEventListener("message",t=>{if(typeof t.data=="string"&&t.data.startsWith(Sr.MESSAGE_KEY)){const{method:e,params:s}=JSON.parse(t.data.substr(Sr.MESSAGE_KEY.length)),i=window[e];if(!i)return;i(...s);return}})),!0}static call(t,...e){if(window.top!==window&&window.top.postMessage(Sr.MESSAGE_KEY+JSON.stringify({method:t,params:e}),"*"),!("FlashExternalInterface"in window))return;const s=window.FlashExternalInterface[t];return typeof s<"u"?s(...e):void 0}static callGame(t,...e){if(window.top!==window&&window.top.postMessage("Nitro_LegacyExternalGameInterface"+JSON.stringify({method:t,params:e}),"*"),!("FlashExternalGameInterface"in window))return;const s=window.FlashExternalGameInterface[t];return typeof s<"u"?s(...e):void 0}static addCallback(t,e){window[t]=e}};Sr.MESSAGE_KEY="Nitro_LegacyExternalInterface",Sr._isListeningForPostMessages=!1;let dt=Sr;class fV{constructor(t){t.addMessageEvent(new Gg(this.onLoadGameUrl.bind(this)))}onLoadGameUrl(t){if(!t)return;const e=t.getParser();e&&dt.callGame("showGame",e.url)}}class El{constructor(t){this._badgeId="",this._level=1,this._base="",this._badgeId=t,this.parseText()}parseText(){let t=this._badgeId.length-1;for(;t>0&&this.isNumber(this._badgeId.charAt(t));)t--;this._base=this._badgeId.substr(0,t+1);const e=this._badgeId.substr(t+1,this._badgeId.length);e&&e!==""&&(this._level=Number.parseInt(e))}isNumber(t){const e=t.charCodeAt(0);return e>=48&&e<=57}get level(){return this._level}set level(t){this._level=Math.max(1,t)}get getBadgeId(){return this._base+this._level}get base(){return this._base}}class IV extends Js{constructor(t){super(),this._communication=t,this._definitions=new Map,this._parameters=new Map,this._badgePointLimits=new Map,this._romanNumerals=["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","XIII","XIV","XV","XVI","XVII","XVIII","XIX","XX","XXI","XXII","XXIII","XXIV","XXV","XXVI","XXVII","XXVIII","XXIX","XXX"],this._pendingUrls=[]}onInit(){this._communication.registerMessageEvent(new jg(this.onBadgePointLimitsEvent.bind(this)));let t=q.getValue("external.texts.url");Array.isArray(t)||(t=[q.getValue("external.texts.url")]);for(let e=0;e<t.length;e++)t[e]=q.interpolate(t[e]);this._pendingUrls=t,this.loadNextLocalization()}loadNextLocalization(){if(!this._pendingUrls.length){this.events&&this.events.dispatchEvent(new Qr(Qr.LOADED));return}this.loadLocalizationFromURL(this._pendingUrls[0])}loadLocalizationFromURL(t){fetch(t).then(e=>e.json()).then(e=>this.onLocalizationLoaded(e,t)).catch(e=>this.onLocalizationFailed(e))}onLocalizationLoaded(t,e){if(!t)return;if(!this.parseLocalization(t))throw new Error(`Invalid json data for file ${e}`);const s=this._pendingUrls.indexOf(e);s>=0&&this._pendingUrls.splice(s,1),this.loadNextLocalization()}onLocalizationFailed(t){this.events&&this.events.dispatchEvent(new Qr(Qr.FAILED))}parseLocalization(t){if(!t)return!1;for(const e in t)this._definitions.set(e,t[e]);return!0}onBadgePointLimitsEvent(t){const e=t.getParser();for(const s of e.data)this.setBadgePointLimit(s.badgeId,s.limit)}getBadgePointLimit(t){return this._badgePointLimits.get(t)||-1}setBadgePointLimit(t,e){this._badgePointLimits.set(t,e)}getRomanNumeral(t){return this._romanNumerals[Math.max(0,t-1)]}getPreviousLevelBadgeId(t){const e=new El(t);return e.level--,e.getBadgeId}hasValue(t){return this._definitions.has(t)}getValue(t,e=!0){if(!t||!t.length)return null;const s=t.match(/\$\{.[^}]*\}/g);if(s&&s.length)for(const r of s)t=t.replace(r,this.getValue(r.slice(2,-1),e));let i=this._definitions.get(t)||null;if(!i&&(i=q.definitions.get(t),i))return i;if(i&&e){const r=this._parameters.get(t);if(r)for(const[a,o]of r)i=i.replace("%"+a+"%",o)}return i||t}getValueWithParameter(t,e,s){const i=this.getValue(t,!1),r=i.replace("%"+e+"%",s);if(i.startsWith("%{")){const a=new RegExp("%{"+e.toUpperCase()+"\\|([^|]*)\\|([^|]*)\\|([^|]*)}"),o=i.match(a);if(!o)return r;let h=-1;switch(Number.parseInt(s)){case 0:h=1;break;case 1:h=2;break;default:case 2:h=3;break}if(h==-1||typeof o[h]>"u")return r;const l=o[h];if(l)return l.replace("%%",s)}return r}getValueWithParameters(t,e,s){let i=this.getValue(t,!1);if(e)for(let r=0;r<e.length;r++){const a=e[r],o=s[r];if(o!==void 0&&(i=i.replace("%"+a+"%",o),i.startsWith("%{"))){const h=new RegExp("%{"+a.toUpperCase()+"\\|([^|]*)\\|([^|]*)\\|([^|]*)}"),_=i.match(h);if(!_)continue;const l=parseInt(o);let c=-1;switch(l){case 0:c=1;break;case 1:c=2;break;case 2:default:c=3;break}if(c===-1||typeof _[c]>"u")continue;const f=_[c];f&&(i=f.replace("%%",o))}}return i}setValue(t,e){this._definitions.set(t,e)}registerParameter(t,e,s){if(!t||t.length===0||!e||e.length===0)return;let i=this._parameters.get(t);i||(i=new Map,this._parameters.set(t,i)),i.set(e,s)}getBadgeName(t){const e=new El(t),s=["badge_name_"+t,"badge_name_"+e.base];let i=this.fixBadLocalization(this.getExistingKey(s));return i=i.replace("%roman%",this.getRomanNumeral(e.level)),i}getBadgeDesc(t){const e=new El(t),s=["badge_desc_"+t,"badge_desc_"+e.base];let i=this.fixBadLocalization(this.getExistingKey(s));const r=this.getBadgePointLimit(t);return r>-1&&(i=i.replace("%limit%",r.toString())),i=i.replace("%roman%",this.getRomanNumeral(e.level)),i}getExistingKey(t){for(const e of t){const s=this.getValue(e);if(s!=e)return s}return""}fixBadLocalization(t){return t.replace("${","$").replace("{","$").replace("}","$")}}WT.add(kT,KT,XT,qT,QT,JT,ZT);class ng{constructor(){this.id=0,this.data=null,this.image=null}getImage(){return this.image?this.image:this.data?Ut.generateImage(this.data):null}}const D_=class D_ extends qt{constructor(t){super(null,null),this._type=t}get type(){return this._type}};D_.IMAGE_LOADED="ROAUM_IMAGE_LOADED",D_.IMAGE_LOADING_FAILED="ROAUM_IMAGE_FAILED";let ge=D_;class jt extends qt{constructor(){super(null,null)}}class _T extends jt{constructor(t,e){super(),this._itemType=t,this._itemName=e}get itemType(){return this._itemType}get itemName(){return this._itemName}}class qd extends jt{constructor(t=0){super(),this._numberOfWords=t}get numberOfWords(){return this._numberOfWords}}class lT extends jt{constructor(t=0){super(),this._danceStyle=t}get danceStyle(){return this._danceStyle}}class cT extends jt{constructor(t,e=0){super(),this._effect=t,this._delayMilliseconds=e}get effect(){return this._effect}get delayMilliseconds(){return this._delayMilliseconds}}class uT extends jt{constructor(t){super(),this._gainedExperience=t}get gainedExperience(){return this._gainedExperience}}class dT extends jt{constructor(t=0){super(),this._expressionType=t}get expressionType(){return this._expressionType}}class Jo extends jt{constructor(t,e=null,s=null,i=!1){super(),this._figure=t,this._gender=e,this._subType=s,this._isRiding=i}get figure(){return this._figure}get gender(){return this._gender}get subType(){return this._subType}get isRiding(){return this._isRiding}}class ET extends jt{constructor(t=0){super(),this._level=t}get level(){return this._level}}class gT extends jt{constructor(t=0){super(),this._gesture=t}get gesture(){return this._gesture}}class TV extends jt{constructor(t){super(),this._guideStatus=t}get guideStatus(){return this._guideStatus}}class fT extends jt{constructor(t=!1){super(),this._isMuted=t}get isMuted(){return this._isMuted}}class IT extends jt{}class TT extends jt{constructor(t){super(),this._gesture=t}get gesture(){return this._gesture}}class mT extends jt{constructor(t){super(),this._value=t}get value(){return this._value}}class pT extends jt{constructor(t){super(),this._isPlayingGame=t}get isPlayingGame(){return this._isPlayingGame}}class Qd extends jt{constructor(t,e=""){super(),this._postureType=t,this._parameter=e}get postureType(){return this._postureType}get parameter(){return this._parameter}}class Zo extends jt{constructor(t){super(),this._selected=t}get selected(){return this._selected}}class RT extends jt{constructor(t=0){super(),this._signType=t}get signType(){return this._signType}}class Jd extends jt{constructor(t=!1){super(),this._isSleeping=t}get isSleeping(){return this._isSleeping}}class OT extends jt{constructor(t=!1){super(),this._isTyping=t}get isTyping(){return this._isTyping}}class $i extends qt{constructor(t,e,s,i=!1){super(t,s),this._targetLocation=e,this._isSlide=i}get targetLocation(){return this._targetLocation?this._targetLocation:this.location}get isSlide(){return this._isSlide}}class $o extends $i{constructor(t,e,s,i,r,a){super(t,e,s),this._headDirection=i,this._canStandUp=r,this._baseY=a}get headDirection(){return this._headDirection}get canStandUp(){return this._canStandUp}get baseY(){return this._baseY}}class AT extends jt{constructor(t){super(),this._itemType=t}get itemType(){return this._itemType}}class St extends qt{constructor(t,e,s=null){super(null,null),this._state=t,this._data=e,this._extra=s}get state(){return this._state}get data(){return this._data}get extra(){return this._extra}}const CE=class CE extends qt{constructor(t,e){super(null,null),this._badgeId=t,this._assetName=e}get badgeId(){return this._badgeId}get assetName(){return this._assetName}};CE.BADGE_LOADED="ROGBUM_BADGE_LOADED";let Yr=CE;class ST extends qt{constructor(t,e,s){super(t,e),this._height=s}get height(){return this._height}}class Zd extends qt{constructor(t){super(null,null),this._data=t}get data(){return this._data}}class CT extends qt{constructor(t,e){super(null,null),this._numberKey=t,this._numberValue=e}get numberKey(){return this._numberKey}get numberValue(){return this._numberValue}}const ME=class ME extends qt{constructor(t,e,s,i){super(null,null),this._type=t,this._color=e,this._light=s,this._backgroundOnly=i}get type(){return this._type}get color(){return this._color}get light(){return this._light}get backgroundOnly(){return this._backgroundOnly}};ME.BACKGROUND_COLOR="RORCUM_BACKGROUND_COLOR";let $a=ME;const L_=class L_ extends qt{constructor(t,e,s=0,i=0,r=0,a=0){super(null,null),this._type=t,this._id=e,this._x=s,this._y=i,this._width=r,this._height=a}get type(){return this._type}get id(){return this._id}get x(){return this._x}get y(){return this._y}get width(){return this._width}get height(){return this._height}};L_.ADD="ORPFHUM_ADD",L_.REMOVE="ORPFHUM_REMOVE";let pi=L_;const P_=class P_ extends qt{constructor(t){super(null,null),this._type=P_.UPDATE_MAP,this._mapData=t}get type(){return this._type}get mapData(){return this._mapData}};P_.UPDATE_MAP="RORMUM_UPDATE_MAP";let th=P_;const Cr=class Cr extends qt{constructor(t,e,s=null,i=null,r="window"){super(null,null),this._type=t,this._maskId=e,this._maskType=s,this._maskLocation=i?new R(i.x,i.y,i.z):null,this._maskCategory=r}get type(){return this._type}get maskId(){return this._maskId}get maskType(){return this._maskType}get maskLocation(){return this._maskLocation}get maskCategory(){return this._maskCategory}};Cr.ADD_MASK="RORMUM_ADD_MASK",Cr.REMOVE_MASK="RORMUM_ADD_MASK",Cr.DOOR="door",Cr.WINDOW="window",Cr.HOLE="hole";let de=Cr;const U_=class U_ extends qt{constructor(t,e){super(null,null),this._type=t,this._value=e}get type(){return this._type}get value(){return this._value}};U_.WALL_THICKNESS="RORPPUM_WALL_THICKNESS",U_.FLOOR_THICKNESS="RORPVUM_FLOOR_THICKNESS";let Ri=U_;const y_=class y_ extends qt{constructor(t,e){super(null,null),this._type=t,this._visible=e}get type(){return this._type}get visible(){return this._visible}};y_.WALL_VISIBILITY="RORPVUM_WALL_VISIBILITY",y_.FLOOR_VISIBILITY="RORPVUM_FLOOR_VISIBILITY";let Oi=y_;const va=class va extends qt{constructor(t,e){super(null,null),this._type=t,this._value=e}get type(){return this._type}get value(){return this._value}};va.ROOM_WALL_UPDATE="RORUM_ROOM_WALL_UPDATE",va.ROOM_FLOOR_UPDATE="RORUM_ROOM_FLOOR_UPDATE",va.ROOM_LANDSCAPE_UPDATE="RORUM_ROOM_LANDSCAPE_UPDATE";let ne=va;class to extends jt{constructor(t){super(),this._selected=t}get selected(){return this._selected}}class qr extends qt{constructor(t,e,s,i,r=!1){super(t,null),this._height=e,this._visible=s,this._sourceEventId=i,this._toggleVisibility=r}get height(){return this._height}get visible(){return this._visible}get sourceEventId(){return this._sourceEventId}get toggleVisibility(){return this._toggleVisibility}}const v_=class v_ extends qt{constructor(t){super(null,null),this._type=t}get type(){return this._type}};v_.ENABLED="ROVUM_ENABLED",v_.DISABLED="ROVUM_DISABLED";let Ai=v_;const Pn=class Pn extends el{constructor(){super(),this._liftAmount=0,this._location=new R,this._locationDelta=new R,this._lastUpdateTime=0,this._changeTime=0,this._updateInterval=Pn.DEFAULT_UPDATE_INTERVAL}onDispose(){this._liftAmount=0,super.onDispose()}update(t){super.update(t);const e=this.getLocationOffset(),s=this.object&&this.object.model;if(s&&(e?this._liftAmount!==e.z&&(this._liftAmount=e.z,s.setValue(g.FURNITURE_LIFT_AMOUNT,this._liftAmount)):this._liftAmount!==0&&(this._liftAmount=0,s.setValue(g.FURNITURE_LIFT_AMOUNT,this._liftAmount))),this._locationDelta.length>0||e){const i=Pn.TEMP_VECTOR;let r=this.time-this._changeTime;r===this._updateInterval>>1&&r++,r>this._updateInterval&&(r=this._updateInterval),this._locationDelta.length>0?(i.assign(this._locationDelta),i.multiply(r/this._updateInterval),i.add(this._location)):i.assign(this._location),e&&i.add(e),this.object.setLocation(i),r===this._updateInterval&&(this._locationDelta.x=0,this._locationDelta.y=0,this._locationDelta.z=0)}this._lastUpdateTime=this.time}setObject(t){super.setObject(t),t&&this._location.assign(t.getLocation())}processUpdateMessage(t){if(t&&(super.processUpdateMessage(t),t.location&&this._location.assign(t.location),t instanceof $i))return this.processMoveMessage(t)}processMoveMessage(t){!t||!this.object||!t.location||(this._changeTime=this._lastUpdateTime,this._locationDelta.assign(t.targetLocation),this._locationDelta.subtract(this._location))}getLocationOffset(){return null}get lastUpdateTime(){return this._lastUpdateTime}set updateInterval(t){t<=0&&(t=1),this._updateInterval=t}};Pn.DEFAULT_UPDATE_INTERVAL=500,Pn.TEMP_VECTOR=new R;let tr=Pn;const Bt=class Bt extends tr{constructor(){super(),this._selected=!1,this._reportedLocation=null,this._effectChangeTimeStamp=0,this._newEffect=0,this._blinkingStartTimestamp=nt()+this.randomBlinkStartTimestamp(),this._blinkingEndTimestamp=0,this._talkingEndTimestamp=0,this._talkingPauseStartTimestamp=0,this._talkingPauseEndTimestamp=0,this._carryObjectStartTimestamp=0,this._carryObjectEndTimestamp=0,this._allowUseCarryObject=!1,this._animationEndTimestamp=0,this._signEndTimestamp=0,this._gestureEndTimestamp=0,this._numberValueEndTimestamp=0}getEventTypes(){const t=[X.CLICK,X.DOUBLE_CLICK,Ee.POSITION_CHANGED,X.MOUSE_ENTER,X.MOUSE_LEAVE,y.MOUSE_BUTTON,y.MOUSE_ARROW];return this.mergeTypes(super.getEventTypes(),t)}dispose(){this._selected&&this.object&&this.eventDispatcher&&this.eventDispatcher.dispatchEvent(new Ee(Ee.OBJECT_REMOVED,this.object)),super.dispose(),this._reportedLocation=null}update(t){if(super.update(t),this._selected&&this.object&&this.eventDispatcher){const s=this.object.getLocation();(!this._reportedLocation||this._reportedLocation.x!==s.x||this._reportedLocation.y!==s.y||this._reportedLocation.z!==s.z)&&(this._reportedLocation||(this._reportedLocation=new R),this._reportedLocation.assign(s),this.eventDispatcher.dispatchEvent(new Ee(Ee.POSITION_CHANGED,this.object)))}const e=this.object&&this.object.model;e&&this.updateModel(this.time,e)}updateModel(t,e){this._talkingEndTimestamp>0&&(t>this._talkingEndTimestamp?(e.setValue(g.FIGURE_TALK,0),this._talkingEndTimestamp=0,this._talkingPauseStartTimestamp=0,this._talkingPauseEndTimestamp=0):!this._talkingPauseEndTimestamp&&!this._talkingPauseStartTimestamp?(this._talkingPauseStartTimestamp=t+this.randomTalkingPauseStartTimestamp(),this._talkingPauseEndTimestamp=this._talkingPauseStartTimestamp+this.randomTalkingPauseEndTimestamp()):this._talkingPauseStartTimestamp>0&&t>this._talkingPauseStartTimestamp?(e.setValue(g.FIGURE_TALK,0),this._talkingPauseStartTimestamp=0):this._talkingPauseEndTimestamp>0&&t>this._talkingPauseEndTimestamp&&(e.setValue(g.FIGURE_TALK,1),this._talkingPauseEndTimestamp=0)),this._animationEndTimestamp>0&&t>this._animationEndTimestamp&&(e.setValue(g.FIGURE_EXPRESSION,0),this._animationEndTimestamp=0),this._gestureEndTimestamp>0&&t>this._gestureEndTimestamp&&(e.setValue(g.FIGURE_GESTURE,0),this._gestureEndTimestamp=0),this._signEndTimestamp>0&&t>this._signEndTimestamp&&(e.setValue(g.FIGURE_SIGN,-1),this._signEndTimestamp=0),this._carryObjectEndTimestamp>0&&t>this._carryObjectEndTimestamp&&(e.setValue(g.FIGURE_CARRY_OBJECT,0),e.setValue(g.FIGURE_USE_OBJECT,0),this._carryObjectStartTimestamp=0,this._carryObjectEndTimestamp=0,this._allowUseCarryObject=!1),this._allowUseCarryObject&&t-this._carryObjectStartTimestamp>5e3&&((t-this._carryObjectStartTimestamp)%1e4<1e3?e.setValue(g.FIGURE_USE_OBJECT,1):e.setValue(g.FIGURE_USE_OBJECT,0)),this._blinkingStartTimestamp>-1&&t>this._blinkingStartTimestamp&&(e.setValue(g.FIGURE_BLINK,1),this._blinkingStartTimestamp=t+this.randomBlinkStartTimestamp(),this._blinkingEndTimestamp=t+this.randomBlinkEndTimestamp()),this._blinkingEndTimestamp>0&&t>this._blinkingEndTimestamp&&(e.setValue(g.FIGURE_BLINK,0),this._blinkingEndTimestamp=0),this._effectChangeTimeStamp>0&&t>this._effectChangeTimeStamp&&(e.setValue(g.FIGURE_EFFECT,this._newEffect),this._effectChangeTimeStamp=0),this._numberValueEndTimestamp>0&&t>this._numberValueEndTimestamp&&(e.setValue(g.FIGURE_NUMBER_VALUE,0),this._numberValueEndTimestamp=0)}processUpdateMessage(t){if(!t||!this.object)return;super.processUpdateMessage(t);const e=this.object&&this.object.model;if(e){if(t instanceof Qd){e.setValue(g.FIGURE_POSTURE,t.postureType),e.setValue(g.FIGURE_POSTURE_PARAMETER,t.parameter);return}if(t instanceof qd){e.setValue(g.FIGURE_TALK,1),this._talkingEndTimestamp=this.time+t.numberOfWords*1e3;return}if(t instanceof OT){e.setValue(g.FIGURE_IS_TYPING,t.isTyping?1:0);return}if(t instanceof fT){e.setValue(g.FIGURE_IS_MUTED,t.isMuted?1:0);return}if(t instanceof pT){e.setValue(g.FIGURE_IS_PLAYING_GAME,t.isPlayingGame?1:0);return}if(t instanceof $o){e.setValue(g.HEAD_DIRECTION,t.headDirection),e.setValue(g.FIGURE_CAN_STAND_UP,t.canStandUp),e.setValue(g.FIGURE_VERTICAL_OFFSET,t.baseY);return}if(t instanceof gT){e.setValue(g.FIGURE_GESTURE,t.gesture),this._gestureEndTimestamp=this.time+3e3;return}if(t instanceof dT){e.setValue(g.FIGURE_EXPRESSION,t.expressionType),this._animationEndTimestamp=H.getExpressionTimeout(e.getValue(g.FIGURE_EXPRESSION)),this._animationEndTimestamp>-1&&(this._animationEndTimestamp+=this.time);return}if(t instanceof lT){e.setValue(g.FIGURE_DANCE,t.danceStyle);return}if(t instanceof Jd){e.setValue(g.FIGURE_SLEEP,t.isSleeping?1:0),t.isSleeping?this._blinkingStartTimestamp=-1:this._blinkingStartTimestamp=this.time+this.randomBlinkStartTimestamp();return}if(t instanceof mT){e.setValue(g.FIGURE_NUMBER_VALUE,t.value),this._numberValueEndTimestamp=this.time+3e3;return}if(t instanceof cT){this.updateAvatarEffect(t.effect,t.delayMilliseconds,e);return}if(t instanceof _T){e.setValue(g.FIGURE_CARRY_OBJECT,t.itemType),e.setValue(g.FIGURE_USE_OBJECT,0),t.itemType===0?(this._carryObjectStartTimestamp=0,this._carryObjectEndTimestamp=0,this._allowUseCarryObject=!1):(this._carryObjectStartTimestamp=this.time,t.itemType<Bt.MAX_HAND_ID?(this._carryObjectEndTimestamp=0,this._allowUseCarryObject=t.itemType<=Bt.MAX_HAND_USE_ID):(this._carryObjectEndTimestamp=this._carryObjectStartTimestamp+1500,this._allowUseCarryObject=!1));return}if(t instanceof AT){e.setValue(g.FIGURE_USE_OBJECT,t.itemType);return}if(t instanceof RT){e.setValue(g.FIGURE_SIGN,t.signType),this._signEndTimestamp=this.time+5e3;return}if(t instanceof ET){e.setValue(g.FIGURE_FLAT_CONTROL,t.level);return}if(t instanceof Jo){e.setValue(g.FIGURE,t.figure),e.setValue(g.GENDER,t.gender);return}if(t instanceof Zo){this._selected=t.selected,this._reportedLocation=null;return}if(t instanceof IT){e.setValue(g.OWN_USER,1);return}}}updateAvatarEffect(t,e,s){if(t===Bt.EFFECT_TYPE_SPLASH)this._effectChangeTimeStamp=nt()+Bt.EFFECT_SPLASH_LENGTH,this._newEffect=Bt.EFFECT_TYPE_SWIM;else if(t===Bt.EFFECT_TYPE_SPLASH_DARK)this._effectChangeTimeStamp=nt()+Bt.EFFECT_SPLASH_LENGTH,this._newEffect=Bt.EFFECT_TYPE_SWIM_DARK;else if(s.getValue(g.FIGURE_EFFECT)===Bt.EFFECT_TYPE_SWIM)this._effectChangeTimeStamp=nt()+Bt.EFFECT_SPLASH_LENGTH,this._newEffect=t,t=Bt.EFFECT_TYPE_SPLASH;else if(s.getValue(g.FIGURE_EFFECT)===Bt.EFFECT_TYPE_SWIM_DARK)this._effectChangeTimeStamp=nt()+Bt.EFFECT_SPLASH_LENGTH,this._newEffect=t,t=Bt.EFFECT_TYPE_SPLASH_DARK;else if(e===0)this._effectChangeTimeStamp=0;else{this._effectChangeTimeStamp=nt()+e,this._newEffect=t;return}s.setValue(g.FIGURE_EFFECT,t)}mouseEvent(t,e){let s=null;switch(t.type){case z.MOUSE_CLICK:s=X.CLICK;break;case z.DOUBLE_CLICK:s=X.DOUBLE_CLICK;break;case z.ROLL_OVER:s=X.MOUSE_ENTER,this.object.model&&this.object.model.setValue(g.FIGURE_HIGHLIGHT,1),this.eventDispatcher&&this.eventDispatcher.dispatchEvent(new y(y.MOUSE_BUTTON,this.object));break;case z.ROLL_OUT:s=X.MOUSE_LEAVE,this.object.model&&this.object.model.setValue(g.FIGURE_HIGHLIGHT,0),this.eventDispatcher&&this.eventDispatcher.dispatchEvent(new y(y.MOUSE_ARROW,this.object));break}s&&this.eventDispatcher&&this.eventDispatcher.dispatchEvent(new X(s,this.object,t.eventId,t.altKey,t.ctrlKey,t.shiftKey,t.buttonDown))}randomTalkingPauseStartTimestamp(){return 100+Math.random()*200}randomTalkingPauseEndTimestamp(){return 75+Math.random()*75}randomBlinkStartTimestamp(){return 4500+Math.random()*1e3}randomBlinkEndTimestamp(){return 50+Math.random()*200}};Bt.MAX_HAND_ID=999999999,Bt.MAX_HAND_USE_ID=999,Bt.EFFECT_TYPE_SPLASH=28,Bt.EFFECT_SPLASH_LENGTH=500,Bt.EFFECT_TYPE_SWIM=29,Bt.EFFECT_TYPE_SPLASH_DARK=184,Bt.EFFECT_TYPE_SWIM_DARK=185;let Bu=Bt;const be=class be extends tr{constructor(){super(),this._sizeX=0,this._sizeY=0,this._sizeZ=0,this._centerX=0,this._centerY=0,this._centerZ=0,this._directions=[],this._mouseOver=!1,this._locationOffset=new R,this._bouncingStep=0,this._storedRotateMessage=null,this._directionInitialized=!1,be.BOUNCING_STEPS===-1&&(be.BOUNCING_STEPS=q.getValue("furni.rotation.bounce.steps",8)),be.BOUNCING_Z===-1&&(be.BOUNCING_Z=q.getValue("furni.rotation.bounce.height",.0625))}getEventTypes(){const t=[Et.STATE_CHANGE,X.CLICK,X.MOUSE_DOWN,X.MOUSE_DOWN_LONG,Pt.ROOM_AD_TOOLTIP_SHOW,Pt.ROOM_AD_TOOLTIP_HIDE,Pt.ROOM_AD_FURNI_DOUBLE_CLICK,Pt.ROOM_AD_FURNI_CLICK];return this.widget&&t.push(S.OPEN_WIDGET,S.CLOSE_WIDGET),this.contextMenu&&t.push(S.OPEN_FURNI_CONTEXT_MENU,S.CLOSE_FURNI_CONTEXT_MENU),this.mergeTypes(super.getEventTypes(),t)}initialize(t){if(!t)return;const e=this.object&&this.object.model;if(e){if(t.logic){if(t.logic.model){const s=t.logic.model.dimensions;s&&(this._sizeX=s.x,this._sizeY=s.y,this._sizeZ=s.z,this._centerX=this._sizeX/2,this._centerY=this._sizeY/2,this._centerZ=this._sizeZ/2);const i=t.logic.model.directions;if(i&&i.length){for(const r of i)this._directions.push(r);this._directions.sort((r,a)=>r-a)}}if(t.logic.customVars){const s=t.logic.customVars.variables;s&&s.length&&e.setValue(g.FURNITURE_CUSTOM_VARIABLES,s)}}e.setValue(g.FURNITURE_SIZE_X,this._sizeX),e.setValue(g.FURNITURE_SIZE_Y,this._sizeY),e.setValue(g.FURNITURE_SIZE_Z,this._sizeZ),e.setValue(g.FURNITURE_CENTER_X,this._centerX),e.setValue(g.FURNITURE_CENTER_Y,this._centerY),e.setValue(g.FURNITURE_CENTER_Z,this._centerZ),e.setValue(g.FURNITURE_ALLOWED_DIRECTIONS,this._directions),e.setValue(g.FURNITURE_ALPHA_MULTIPLIER,1)}}onDispose(){this._storedRotateMessage=null,this._directions=null,super.onDispose()}setObject(t){super.setObject(t),t&&t.getLocation().length&&(this._directionInitialized=!0)}getAdClickUrl(t){return t.getValue(g.FURNITURE_AD_URL)}handleAdClick(t,e,s){this.eventDispatcher&&this.eventDispatcher.dispatchEvent(new Pt(Pt.ROOM_AD_FURNI_CLICK,this.object))}update(t){super.update(t),this._bouncingStep>0&&(this._bouncingStep++,this._bouncingStep>be.BOUNCING_STEPS&&(this._bouncingStep=0))}processUpdateMessage(t){if(t instanceof St){this.processDataUpdateMessage(t);return}if(t instanceof ST){this.processObjectHeightUpdateMessage(t);return}if(t instanceof Zd){this.processItemDataUpdateMessage(t);return}if(this._mouseOver=!1,t.location&&t.direction){if(!(t instanceof $i)){const e=this.object.getDirection(),s=this.object.getLocation();e.x!==t.direction.x&&this._directionInitialized&&s.x===t.location.x&&s.y===t.location.y&&s.z===t.location.z&&(this._bouncingStep=1,this._storedRotateMessage=new qt(t.location,t.direction),t=null)}this._directionInitialized=!0}if(t instanceof to&&this.contextMenu&&this.eventDispatcher&&this.object){const e=t.selected?S.OPEN_FURNI_CONTEXT_MENU:S.CLOSE_FURNI_CONTEXT_MENU;this.eventDispatcher.dispatchEvent(new S(e,this.object))}super.processUpdateMessage(t)}processDataUpdateMessage(t){t&&(this.object.setState(t.state,0),t.data&&t.data.writeRoomObjectModel(this.object.model),t.extra!==null&&this.object.model.setValue(g.FURNITURE_EXTRAS,t.extra.toString()),this.object.model.setValue(g.FURNITURE_STATE_UPDATE_TIME,this.lastUpdateTime))}processObjectHeightUpdateMessage(t){t&&this.object.model.setValue(g.FURNITURE_SIZE_Z,t.height)}processItemDataUpdateMessage(t){t&&this.object.model.setValue(g.FURNITURE_ITEMDATA,t.data)}mouseEvent(t,e){const s=this.getAdClickUrl(this.object.model);switch(t.type){case z.MOUSE_MOVE:if(this.eventDispatcher){const i=new X(X.MOUSE_MOVE,this.object,t.eventId,t.altKey,t.ctrlKey,t.shiftKey,t.buttonDown);i.localX=t.localX,i.localY=t.localY,i.spriteOffsetX=t.spriteOffsetX,i.spriteOffsetY=t.spriteOffsetY,this.eventDispatcher.dispatchEvent(i)}return;case z.ROLL_OVER:if(!this._mouseOver){if(this.eventDispatcher){s&&s.indexOf("http")===0&&this.eventDispatcher.dispatchEvent(new Pt(Pt.ROOM_AD_TOOLTIP_SHOW,this.object));const i=new X(X.MOUSE_ENTER,this.object,t.eventId,t.altKey,t.ctrlKey,t.shiftKey,t.buttonDown);i.localX=t.localX,i.localY=t.localY,i.spriteOffsetX=t.spriteOffsetX,i.spriteOffsetY=t.spriteOffsetY,this.eventDispatcher.dispatchEvent(i)}this._mouseOver=!0}return;case z.ROLL_OUT:if(this._mouseOver){if(this.eventDispatcher){s&&s.indexOf("http")===0&&this.eventDispatcher.dispatchEvent(new Pt(Pt.ROOM_AD_TOOLTIP_HIDE,this.object));const i=new X(X.MOUSE_LEAVE,this.object,t.eventId,t.altKey,t.ctrlKey,t.shiftKey,t.buttonDown);i.localX=t.localX,i.localY=t.localY,i.spriteOffsetX=t.spriteOffsetX,i.spriteOffsetY=t.spriteOffsetY,this.eventDispatcher.dispatchEvent(i)}this._mouseOver=!1}return;case z.DOUBLE_CLICK:this.useObject();return;case z.MOUSE_CLICK:if(this.eventDispatcher){const i=new X(X.CLICK,this.object,t.eventId,t.altKey,t.ctrlKey,t.shiftKey,t.buttonDown);i.localX=t.localX,i.localY=t.localY,i.spriteOffsetX=t.spriteOffsetX,i.spriteOffsetY=t.spriteOffsetY,this.eventDispatcher.dispatchEvent(i),s&&s.indexOf("http")===0&&this.eventDispatcher.dispatchEvent(new Pt(Pt.ROOM_AD_TOOLTIP_HIDE,this.object)),s&&s.length&&this.handleAdClick(this.object.id,this.object.type,s)}return;case z.MOUSE_DOWN:if(this.eventDispatcher){const i=new X(X.MOUSE_DOWN,this.object,t.eventId,t.altKey,t.ctrlKey,t.shiftKey,t.buttonDown);this.eventDispatcher.dispatchEvent(i)}return;case z.MOUSE_DOWN_LONG:if(this.eventDispatcher){const i=new X(X.MOUSE_DOWN_LONG,this.object,t.eventId,t.altKey,t.ctrlKey,t.shiftKey,t.buttonDown);this.eventDispatcher.dispatchEvent(i)}return}}getLocationOffset(){return this._bouncingStep<=0?null:(this._locationOffset.x=0,this._locationOffset.y=0,this._bouncingStep<=be.BOUNCING_STEPS/2?this._locationOffset.z=be.BOUNCING_Z*this._bouncingStep:this._bouncingStep<=be.BOUNCING_STEPS&&(this._storedRotateMessage&&(super.processUpdateMessage(this._storedRotateMessage),this._storedRotateMessage=null),this._locationOffset.z=be.BOUNCING_Z*(be.BOUNCING_STEPS-this._bouncingStep)),this._locationOffset)}useObject(){if(!this.object||!this.eventDispatcher)return;const t=this.getAdClickUrl(this.object.model);t&&t.length&&this.eventDispatcher.dispatchEvent(new Pt(Pt.ROOM_AD_FURNI_DOUBLE_CLICK,this.object,null,t)),this.widget&&this.eventDispatcher.dispatchEvent(new S(S.OPEN_WIDGET,this.object)),this.eventDispatcher.dispatchEvent(new Et(Et.STATE_CHANGE,this.object))}tearDown(){this.object.model.getValue(g.FURNITURE_REAL_ROOM_OBJECT)===1&&(this.widget&&this.eventDispatcher.dispatchEvent(new S(S.CLOSE_WIDGET,this.object)),this.contextMenu&&this.eventDispatcher.dispatchEvent(new S(S.CLOSE_FURNI_CONTEXT_MENU,this.object))),super.tearDown()}};be.BOUNCING_STEPS=-1,be.BOUNCING_Z=-1;let It=be;class MT extends It{getEventTypes(){const t=[S.BADGE_DISPLAY_ENGRAVING,As.LOAD_BADGE];return this.mergeTypes(super.getEventTypes(),t)}processUpdateMessage(t){if(super.processUpdateMessage(t),!!this.object){if(t instanceof St){const e=t.data;e instanceof Vn&&this.updateBadge(e.getValue(1));return}if(t instanceof Yr){t.assetName!=="loading_icon"&&(this.object.model.setValue(g.FURNITURE_BADGE_ASSET_NAME,t.assetName),this.object.model.setValue(g.FURNITURE_BADGE_IMAGE_STATUS,1),this.update(nt()));return}}}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new S(S.BADGE_DISPLAY_ENGRAVING,this.object))}updateBadge(t){t!==""&&this.eventDispatcher&&(this.object.model.setValue(g.FURNITURE_BADGE_IMAGE_STATUS,-1),this.eventDispatcher.dispatchEvent(new As(As.LOAD_BADGE,this.object,t,!1)))}}const Fe=class Fe extends MT{getEventTypes(){const t=[S.ACHIEVEMENT_RESOLUTION_OPEN,S.ACHIEVEMENT_RESOLUTION_ENGRAVING,S.ACHIEVEMENT_RESOLUTION_FAILED,As.LOAD_BADGE];return this.mergeTypes(super.getEventTypes(),t)}processUpdateMessage(t){if(super.processUpdateMessage(t),t instanceof Yr&&t.assetName!=="loading_icon"&&this.object.model.setValue(g.FURNITURE_BADGE_VISIBLE_IN_STATE,Fe.BADGE_VISIBLE_IN_STATE),t instanceof to){if(!this.eventDispatcher||!this.object)return;this.eventDispatcher.dispatchEvent(new S(S.CLOSE_FURNI_CONTEXT_MENU,this.object))}}useObject(){if(!this.object||!this.eventDispatcher)return;let t=null;switch(this.object.getState(0)){case Fe.STATE_RESOLUTION_NOT_STARTED:case Fe.STATE_RESOLUTION_IN_PROGRESS:t=new S(S.ACHIEVEMENT_RESOLUTION_OPEN,this.object);break;case Fe.STATE_RESOLUTION_ACHIEVED:t=new S(S.ACHIEVEMENT_RESOLUTION_ENGRAVING,this.object);break;case Fe.STATE_RESOLUTION_FAILED:t=new S(S.ACHIEVEMENT_RESOLUTION_FAILED,this.object);break}t&&this.eventDispatcher.dispatchEvent(t)}updateBadge(t){t!==Fe.ACH_NOT_SET&&super.updateBadge(t)}};Fe.STATE_RESOLUTION_NOT_STARTED=0,Fe.STATE_RESOLUTION_IN_PROGRESS=1,Fe.STATE_RESOLUTION_ACHIEVED=2,Fe.STATE_RESOLUTION_FAILED=3,Fe.ACH_NOT_SET="ach_0",Fe.BADGE_VISIBLE_IN_STATE=2;let wu=Fe;class mV extends It{constructor(){super(),this.onRoomToObjectOwnAvatarMoveEvent=this.onRoomToObjectOwnAvatarMoveEvent.bind(this)}initialize(t){super.initialize(t),this.eventDispatcher&&this.eventDispatcher.addEventListener(Yn.ROAME_MOVE_TO,this.onRoomToObjectOwnAvatarMoveEvent)}tearDown(){this.eventDispatcher&&this.eventDispatcher.removeEventListener(Yn.ROAME_MOVE_TO,this.onRoomToObjectOwnAvatarMoveEvent),super.tearDown()}onRoomToObjectOwnAvatarMoveEvent(t){if(!t||!this.object)return;const e=this.object.getLocation(),s=t.targetLocation;if(!s)return;let i=this.object.model.getValue(g.FURNITURE_SIZE_X),r=this.object.model.getValue(g.FURNITURE_SIZE_Y);const a=(Math.floor(this.object.getDirection().x)+45)%360/90;(a===1||a===3)&&([i,r]=[r,i]),s.x>=e.x&&s.x<e.x+i&&s.y>=e.y&&s.y<e.y+r?this.object.setState(1,0):this.object.setState(0,0)}}class pV extends It{getEventTypes(){const t=[S.CLOTHING_CHANGE];return this.mergeTypes(super.getEventTypes(),t)}initialize(t){super.initialize(t);const e=this.object.model.getValue(g.FURNITURE_DATA);this.updateClothingData(e)}processUpdateMessage(t){super.processUpdateMessage(t),t instanceof St&&t.data&&this.updateClothingData(t.data.getLegacyString())}updateClothingData(t){if(!t||!t.length)return;const[e,s]=t.split(",");e&&e.length&&this.object.model.setValue(g.FURNITURE_CLOTHING_BOY,e),s&&s.length&&this.object.model.setValue(g.FURNITURE_CLOTHING_GIRL,s)}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new S(S.CLOTHING_CHANGE,this.object))}}class RV extends It{getEventTypes(){const t=[Et.STATE_CHANGE];return this.mergeTypes(super.getEventTypes(),t)}mouseEvent(t,e){if(!t||!e||!this.object)return;let s=null;switch(t.type){case z.DOUBLE_CLICK:switch(t.spriteTag){case"start_stop":s=new Et(Et.STATE_CHANGE,this.object,1);break;case"reset":s=new Et(Et.STATE_CHANGE,this.object,2);break}if(this.eventDispatcher&&s){this.eventDispatcher.dispatchEvent(s);return}break}super.mouseEvent(t,e)}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new Et(Et.STATE_CHANGE,this.object,1))}}class OV extends It{processUpdateMessage(t){super.processUpdateMessage(t),this.object&&this.object.model.getValue(g.FURNITURE_REAL_ROOM_OBJECT)===1&&this.object.model.setValue(Ve.INFOSTAND_EXTRA_PARAM,Ve.CRACKABLE_FURNI)}}class AV extends It{get widget(){return mo.CRAFTING}}class SV extends It{getEventTypes(){const t=[S.CREDITFURNI];return this.mergeTypes(super.getEventTypes(),t)}initialize(t){super.initialize(t);let e=0;t.logic&&t.logic.credits&&t.logic.credits!==""&&t.logic.credits.length>0&&(e=parseInt(t.logic.credits)),this.object.model.setValue(g.FURNITURE_CREDIT_VALUE,e)}useObject(){!this.object||!this.eventDispatcher||(this.eventDispatcher.dispatchEvent(new S(S.CREDITFURNI,this.object)),super.useObject())}}class Vt extends It{getEventTypes(){const t=[y.MOUSE_BUTTON,y.MOUSE_ARROW];return this.mergeTypes(super.getEventTypes(),t)}mouseEvent(t,e){if(!(!t||!e||!this.object)){switch(t.type){case z.ROLL_OVER:this.eventDispatcher&&this.eventDispatcher.dispatchEvent(new y(y.MOUSE_BUTTON,this.object));break;case z.ROLL_OUT:this.eventDispatcher&&this.eventDispatcher.dispatchEvent(new y(y.MOUSE_ARROW,this.object));break}super.mouseEvent(t,e)}}}class CV extends Vt{constructor(){super(...arguments),this._state=1}getEventTypes(){const t=[mi.PLAY_SOUND_AT_PITCH];return this.mergeTypes(super.getEventTypes(),t)}processUpdateMessage(t){super.processUpdateMessage(t),t instanceof St&&(this._state!==-1&&t.state!==this._state&&this.dispatchSoundEvent(this.object.location.z),this._state=t.state)}dispatchSoundEvent(t){const e=Math.pow(2,t-1.2);this.eventDispatcher.dispatchEvent(new mi(mi.PLAY_SOUND_AT_PITCH,this.object,"FURNITURE_cuckoo_clock",e))}}class MV extends Vt{getEventTypes(){const t=[S.STACK_HEIGHT];return this.mergeTypes(super.getEventTypes(),t)}initialize(t){super.initialize(t),this.object&&this.object.model&&this.object.model.setValue(g.FURNITURE_ALWAYS_STACKABLE,1)}useObject(){!this.object||!this.eventDispatcher||(this.eventDispatcher.dispatchEvent(new S(S.STACK_HEIGHT,this.object)),super.useObject())}}class NV extends It{constructor(){super(),this._noTags=!1,this._noTagsLastStateActivate=!1}getEventTypes(){const t=[y.DICE_ACTIVATE,y.DICE_OFF];return this.mergeTypes(super.getEventTypes(),t)}mouseEvent(t,e){if(!t||!e||!this.object)return;let s=null;switch(t.type){case z.DOUBLE_CLICK:this._noTags?!this._noTagsLastStateActivate||this.object.getState(0)===0||this.object.getState(0)===100?(s=new y(y.DICE_ACTIVATE,this.object),this._noTagsLastStateActivate=!0):(s=new y(y.DICE_OFF,this.object),this._noTagsLastStateActivate=!1):t.spriteTag==="activate"||this.object.getState(0)===0||this.object.getState(0)===100?s=new y(y.DICE_ACTIVATE,this.object):t.spriteTag==="deactivate"&&(s=new y(y.DICE_OFF,this.object)),s&&this.eventDispatcher&&this.eventDispatcher.dispatchEvent(s);return}super.mouseEvent(t,e)}}class DV extends It{getEventTypes(){const t=[S.ECOTRONBOX];return this.mergeTypes(super.getEventTypes(),t)}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new S(S.ECOTRONBOX,this.object))}}class LV extends It{constructor(){super(),this._showStateOnceRendered=!1,this._updateCount=0}getEventTypes(){const t=[S.INERNAL_LINK];return this.mergeTypes(super.getEventTypes(),t)}initialize(t){super.initialize(t),t.logic&&t.logic.action&&t.logic.action.startState===1&&(this._showStateOnceRendered=!0)}update(t){super.update(t),this._showStateOnceRendered&&(this._updateCount++,this._showStateOnceRendered&&this._updateCount>20&&(this.setAutomaticStateIndex(1),this._showStateOnceRendered=!1))}setAutomaticStateIndex(t){this.object&&this.object.model&&this.object.model.setValue(g.FURNITURE_AUTOMATIC_STATE_INDEX,t)}mouseEvent(t,e){!t||!e||(t.type===z.DOUBLE_CLICK&&this.setAutomaticStateIndex(0),super.mouseEvent(t,e))}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new S(S.INERNAL_LINK,this.object))}}class PV extends It{getEventTypes(){const t=[S.ROOM_LINK];return this.mergeTypes(super.getEventTypes(),t)}initialize(t){super.initialize(t),t.logic&&t.logic.action&&t.logic.action.link&&t.logic.action.link!==""&&t.logic.action.link.length>0&&this.object&&this.object.model&&this.object.model.setValue(g.FURNITURE_INTERNAL_LINK,t.logic.action.link)}onDispose(){this._timer&&(clearTimeout(this._timer),this._timer=null),super.onDispose()}setAutomaticStateIndex(t){this.object&&this.object.model&&this.object.model.setValue(g.FURNITURE_AUTOMATIC_STATE_INDEX,t)}useObject(){this.setAutomaticStateIndex(1),this._timer&&(clearTimeout(this._timer),this._timer=null),this._timer=setTimeout(()=>{this.setAutomaticStateIndex(0),this._timer=null},2500),!(!this.object||!this.eventDispatcher)&&this.eventDispatcher.dispatchEvent(new S(S.ROOM_LINK,this.object))}}class UV extends It{getEventTypes(){const t=[S.EFFECTBOX_OPEN_DIALOG];return this.mergeTypes(super.getEventTypes(),t)}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new S(S.EFFECTBOX_OPEN_DIALOG,this.object))}get contextMenu(){return Qs.EFFECT_BOX}}class yV extends Vt{getEventTypes(){const t=[S.EXTERNAL_IMAGE];return this.mergeTypes(super.getEventTypes(),t)}initialize(t){if(super.initialize(t),!!t&&this.object&&this.object.model){let e="";t.logic&&t.logic.maskType&&t.logic.maskType!==""&&t.logic.maskType.length>0&&(e=t.logic.maskType),this.object.model.setValue(g.FURNITURE_USES_PLANE_MASK,0),this.object.model.setValue(g.FURNITURE_PLANE_MASK_TYPE,e)}}useObject(){!this.object||!this.eventDispatcher||(this.eventDispatcher.dispatchEvent(new S(S.EXTERNAL_IMAGE,this.object)),super.useObject())}}class vV extends It{getEventTypes(){const t=[Et.STATE_CHANGE];return this.mergeTypes(super.getEventTypes(),t)}initialize(t){super.initialize(t),t.logic&&t.logic.particleSystems&&t.logic.particleSystems.length&&this.object.model.setValue(g.FURNITURE_FIREWORKS_DATA,t.logic.particleSystems)}mouseEvent(t,e){if(!t||!e||!this.object)return;let s=null;switch(t.type){case z.DOUBLE_CLICK:switch(t.spriteTag){case"start_stop":s=new Et(Et.STATE_CHANGE,this.object,1);break;case"reset":s=new Et(Et.STATE_CHANGE,this.object,2);break}if(this.eventDispatcher&&s){this.eventDispatcher.dispatchEvent(s);return}break}super.mouseEvent(t,e)}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new Et(Et.STATE_CHANGE,this.object,0))}}const Mr=class Mr extends Vt{constructor(){super(),this._currentState=-1,this._currentLocation=null}getEventTypes(){const t=[ue.ADD_HOLE,ue.REMOVE_HOLE];return this.mergeTypes(super.getEventTypes(),t)}onDispose(){this._currentState===Mr.STATE_HOLE&&this.eventDispatcher.dispatchEvent(new ue(ue.REMOVE_HOLE,this.object)),super.onDispose()}update(t){super.update(t),this.handleAutomaticStateUpdate()}processUpdateMessage(t){if(super.processUpdateMessage(t),!this.object)return;t instanceof St&&this.handleStateUpdate(this.object.getState(0));const e=this.object.getLocation();this._currentLocation?(e.x!==this._currentLocation.x||e.y!==this._currentLocation.y)&&this._currentState===Mr.STATE_HOLE&&this.eventDispatcher&&this.eventDispatcher.dispatchEvent(new ue(ue.ADD_HOLE,this.object)):this._currentLocation=new R,this._currentLocation.assign(e)}handleStateUpdate(t){t!==this._currentState&&(this.eventDispatcher&&(t===Mr.STATE_HOLE?this.eventDispatcher.dispatchEvent(new ue(ue.ADD_HOLE,this.object)):this._currentState===Mr.STATE_HOLE&&this.eventDispatcher.dispatchEvent(new ue(ue.REMOVE_HOLE,this.object))),this._currentState=t)}handleAutomaticStateUpdate(){if(!this.object)return;const t=this.object.model;if(!t)return;const e=t.getValue(g.FURNITURE_AUTOMATIC_STATE_INDEX);isNaN(e)||this.handleStateUpdate(e%2)}};Mr.STATE_HOLE=0;let Vu=Mr;const Nr=class Nr extends Vt{constructor(){super(...arguments),this._state=-1}initialize(t){super.initialize(t),this.object&&this.object.model.setValue(g.FURNITURE_FRIENDFURNI_ENGRAVING,this.engravingDialogType)}processUpdateMessage(t){if(t instanceof St){const e=t.data;e?this._state=e.state:this._state=t.state}super.processUpdateMessage(t)}getEventTypes(){const t=[S.FRIEND_FURNITURE_ENGRAVING];return this.mergeTypes(super.getEventTypes(),t)}useObject(){!this.object||!this.eventDispatcher||(this._state===Nr.STATE_LOCKED?this.eventDispatcher.dispatchEvent(new S(S.FRIEND_FURNITURE_ENGRAVING,this.object)):super.useObject())}get engravingDialogType(){return 0}get contextMenu(){return this._state===Nr.STATE_UNLOCKED?Qs.FRIEND_FURNITURE:Qs.DUMMY}};Nr.STATE_UNINITIALIZED=-1,Nr.STATE_UNLOCKED=0,Nr.STATE_LOCKED=1;let eh=Nr;const xs=class xs extends Vt{getEventTypes(){const t=[As.LOAD_BADGE,S.GUILD_FURNI_CONTEXT_MENU,S.CLOSE_FURNI_CONTEXT_MENU];return this.mergeTypes(super.getEventTypes(),t)}processUpdateMessage(t){if(super.processUpdateMessage(t),t instanceof St){const e=t.data;e instanceof Vn&&(this.updateGroupId(e.getValue(xs.GROUPID_KEY)),this.updateBadge(e.getValue(xs.BADGE_KEY)),this.updateColors(e.getValue(xs.COLOR1_KEY),e.getValue(xs.COLOR2_KEY)))}else t instanceof Yr?t.assetName!=="loading_icon"&&(this.object.model.setValue(g.FURNITURE_GUILD_CUSTOMIZED_ASSET_NAME,t.assetName),this.update(nt())):t instanceof to&&(t.selected||this.eventDispatcher.dispatchEvent(new S(S.CLOSE_FURNI_CONTEXT_MENU,this.object)))}updateGroupId(t){this.object.model.setValue(g.FURNITURE_GUILD_CUSTOMIZED_GUILD_ID,parseInt(t))}updateBadge(t){this.eventDispatcher.dispatchEvent(new As(As.LOAD_BADGE,this.object,t,!0))}updateColors(t,e){this.object.model.setValue(g.FURNITURE_GUILD_CUSTOMIZED_COLOR_1,parseInt(t,16)),this.object.model.setValue(g.FURNITURE_GUILD_CUSTOMIZED_COLOR_2,parseInt(e,16))}mouseEvent(t,e){if(!(!t||!e||!this.object)){switch(t.type){case z.MOUSE_CLICK:this.openContextMenu()}super.mouseEvent(t,e)}}openContextMenu(){this.eventDispatcher.dispatchEvent(new S(S.GUILD_FURNI_CONTEXT_MENU,this.object))}};xs.GROUPID_KEY=1,xs.BADGE_KEY=2,xs.COLOR1_KEY=3,xs.COLOR2_KEY=4;let sh=xs;class bV extends sh{getEventTypes(){const t=[S.INERNAL_LINK];return this.mergeTypes(super.getEventTypes(),t)}updateGroupId(t){super.updateGroupId(t),this.object.model.setValue(g.FURNITURE_INTERNAL_LINK,`groupforum/${t}`)}useObject(){!this.object||!this.eventDispatcher||(this.eventDispatcher.dispatchEvent(new S(S.INERNAL_LINK,this.object)),super.useObject())}}class FV extends It{getEventTypes(){const t=[y.USE_HABBOWHEEL];return this.mergeTypes(super.getEventTypes(),t)}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new y(y.USE_HABBOWHEEL,this.object))}}const b_=class b_ extends It{constructor(){super(...arguments),this._state=-1}getEventTypes(){return[S.HIGH_SCORE_DISPLAY,S.HIDE_HIGH_SCORE_DISPLAY]}tearDown(){this.object.model.getValue(g.FURNITURE_REAL_ROOM_OBJECT)===1&&this.eventDispatcher.dispatchEvent(new S(S.HIDE_HIGH_SCORE_DISPLAY,this.object)),super.tearDown()}processUpdateMessage(t){super.processUpdateMessage(t),this.object.model.getValue(g.FURNITURE_REAL_ROOM_OBJECT)===1&&t instanceof St&&(t.state===b_.SHOW_WIDGET_IN_STATE?this.eventDispatcher.dispatchEvent(new S(S.HIGH_SCORE_DISPLAY,this.object)):this.eventDispatcher.dispatchEvent(new S(S.HIDE_HIGH_SCORE_DISPLAY,this.object)),this._state=t.state)}};b_.SHOW_WIDGET_IN_STATE=1;let Yu=b_;class xV extends It{getEventTypes(){const t=[Et.STATE_CHANGE];return this.mergeTypes(super.getEventTypes(),t)}mouseEvent(t,e){if(!t||!e||!this.object)return;let s=null;switch(t.type){case z.DOUBLE_CLICK:switch(t.spriteTag){case"off":s=new Et(Et.STATE_CHANGE,this.object,3);break}break;case z.MOUSE_CLICK:switch(t.spriteTag){case"inc":s=new Et(Et.STATE_CHANGE,this.object,2);break;case"dec":s=new Et(Et.STATE_CHANGE,this.object,1);break}break}if(this.eventDispatcher&&s){this.eventDispatcher.dispatchEvent(s);return}super.mouseEvent(t,e)}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new Et(Et.STATE_CHANGE,this.object,3))}}class GV extends eh{get engravingDialogType(){return go.HABBOWEEN}}class BV extends Vt{constructor(){super(),this._nextState=0,this._nextStateTimestamp=0}update(t){if(this._nextStateTimestamp>0&&t>=this._nextStateTimestamp){this._nextStateTimestamp=0;const e=new Ne;e.setString(this._nextState.toString()),super.processUpdateMessage(new St(this._nextState,e,this._nextStateExtra))}super.update(t)}processUpdateMessage(t){if(t instanceof St){this.processUpdate(t);return}super.processUpdateMessage(t)}processUpdate(t){if(!t)return;const e=~~(t.state/1e3),s=~~(t.state%1e3);if(s)this._nextState=e,this._nextStateExtra=t.extra,this._nextStateTimestamp=this.time+s;else{this._nextStateTimestamp=0;const i=new Ne;i.setString(e.toString()),super.processUpdateMessage(new St(e,i,t.extra))}}}class wV extends It{constructor(){super(...arguments),this._showStateOnceRendered=!1,this._updateCount=0}getEventTypes(){const t=[S.INERNAL_LINK];return this.mergeTypes(super.getEventTypes(),t)}initialize(t){super.initialize(t),t.logic&&t.logic.action&&(this.object.model.setValue(g.FURNITURE_INTERNAL_LINK,t.logic.action.link),t.logic.action.startState===1&&(this._showStateOnceRendered=!0))}update(t){super.update(t),this._showStateOnceRendered&&(this._updateCount++,this._showStateOnceRendered&&this._updateCount===20&&(this.setAutomaticStateIndex(1),this._showStateOnceRendered=!1))}setAutomaticStateIndex(t){this.object&&this.object.model&&this.object.model.setValue(g.FURNITURE_AUTOMATIC_STATE_INDEX,t)}mouseEvent(t,e){!t||!e||(t.type===z.DOUBLE_CLICK&&this._showStateOnceRendered&&this.setAutomaticStateIndex(0),super.mouseEvent(t,e))}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new S(S.INERNAL_LINK,this.object))}}class VV extends Vt{constructor(){super(...arguments),this._disposeEventsAllowed=!1,this._isInitialized=!1,this._currentState=-1}getEventTypes(){const t=[y.JUKEBOX_START,y.JUKEBOX_MACHINE_STOP,y.JUKEBOX_DISPOSE,y.JUKEBOX_INIT,S.JUKEBOX_PLAYLIST_EDITOR];return this.mergeTypes(super.getEventTypes(),t)}onDispose(){this.requestDispose(),super.onDispose()}processUpdateMessage(t){if(super.processUpdateMessage(t),this.object.model.getValue(g.FURNITURE_REAL_ROOM_OBJECT)===1&&(this._isInitialized||this.requestInit(),this.object.model.setValue(Ve.INFOSTAND_EXTRA_PARAM,Ve.JUKEBOX),t instanceof St)){const e=this.object.getState(0);e!==this._currentState&&(this._currentState=e,e===1?this.requestPlayList():e===0&&this.requestStopPlaying())}}requestInit(){!this.object||!this.eventDispatcher||(this._disposeEventsAllowed=!0,this.eventDispatcher.dispatchEvent(new y(y.JUKEBOX_INIT,this.object)),this._isInitialized=!0)}requestPlayList(){!this.object||!this.eventDispatcher||(this._disposeEventsAllowed=!0,this.eventDispatcher.dispatchEvent(new y(y.JUKEBOX_START,this.object)))}requestStopPlaying(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new y(y.JUKEBOX_MACHINE_STOP,this.object))}requestDispose(){!this._disposeEventsAllowed||!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new y(y.JUKEBOX_DISPOSE,this.object))}useObject(){!this.object||!this.eventDispatcher||(this.eventDispatcher.dispatchEvent(new S(S.JUKEBOX_PLAYLIST_EDITOR,this.object)),this.eventDispatcher.dispatchEvent(new Et(Et.STATE_CHANGE,this.object,-1)))}}class YV extends eh{get engravingDialogType(){return go.LOVE_LOCK}}const wi=class wi extends It{getEventTypes(){const t=[S.MANNEQUIN];return this.mergeTypes(super.getEventTypes(),t)}processUpdateMessage(t){super.processUpdateMessage(t),t instanceof St&&(t.data.writeRoomObjectModel(this.object.model),this.processObjectData())}processObjectData(){if(!this.object||!this.object.model)return;const t=new wr;t.initializeFromRoomObjectModel(this.object.model),this.object.model.setValue(g.FURNITURE_MANNEQUIN_GENDER,t.getValue(wi.GENDER)),this.object.model.setValue(g.FURNITURE_MANNEQUIN_FIGURE,t.getValue(wi.FIGURE)),this.object.model.setValue(g.FURNITURE_MANNEQUIN_NAME,t.getValue(wi.OUTFIT_NAME))}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new S(S.MANNEQUIN,this.object))}};wi.GENDER="GENDER",wi.FIGURE="FIGURE",wi.OUTFIT_NAME="OUTFIT_NAME";let Hu=wi;class HV extends Vt{getEventTypes(){const t=[S.MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG];return this.mergeTypes(super.getEventTypes(),t)}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new S(S.MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG,this.object))}get contextMenu(){return Qs.MONSTERPLANT_SEED}}class jV extends Vt{initialize(t){super.initialize(t),this.object&&this.object.model&&this.object.model.setValue(g.FURNITURE_IS_VARIABLE_HEIGHT,1)}}class zV extends Vt{getEventTypes(){const t=[S.MYSTERYBOX_OPEN_DIALOG];return this.mergeTypes(super.getEventTypes(),t)}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new S(S.MYSTERYBOX_OPEN_DIALOG,this.object))}get contextMenu(){return Qs.MYSTERY_BOX}}class WV extends Vt{getEventTypes(){const t=[S.MYSTERYTROPHY_OPEN_DIALOG];return this.mergeTypes(super.getEventTypes(),t)}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new S(S.MYSTERYTROPHY_OPEN_DIALOG,this.object))}get contextMenu(){return Qs.MYSTERY_TROPHY}}class kV extends It{getEventTypes(){const t=[y.ENTER_ONEWAYDOOR];return this.mergeTypes(super.getEventTypes(),t)}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new y(y.ENTER_ONEWAYDOOR,this.object))}}class KV extends It{getEventTypes(){const t=[S.PET_PRODUCT_MENU];return this.mergeTypes(super.getEventTypes(),t)}processUpdateMessage(t){super.processUpdateMessage(t),this.object&&this.object.model.getValue(g.FURNITURE_REAL_ROOM_OBJECT)===1&&this.object.model.setValue(Ve.INFOSTAND_EXTRA_PARAM,Ve.USABLE_PRODUCT)}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new S(S.PET_PRODUCT_MENU,this.object))}}class XV extends It{getEventTypes(){const t=[S.PLACEHOLDER];return this.mergeTypes(super.getEventTypes(),t)}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new S(S.PLACEHOLDER,this.object))}}class qV extends It{initialize(t){super.initialize(t),t.logic&&t.logic.planetSystems&&this.object.model.setValue(g.FURNITURE_PLANETSYSTEM_DATA,t.logic.planetSystems)}}const rs=class rs extends It{getEventTypes(){const t=[S.PRESENT];return this.mergeTypes(super.getEventTypes(),t)}initialize(t){super.initialize(t),t.logic&&t.logic.particleSystems&&t.logic.particleSystems.length&&this.object.model.setValue(g.FURNITURE_FIREWORKS_DATA,t.logic.particleSystems)}processUpdateMessage(t){super.processUpdateMessage(t),t instanceof St&&(t.data.writeRoomObjectModel(this.object.model),this.updateStuffData()),t instanceof CT&&t.numberKey===g.FURNITURE_DISABLE_PICKING_ANIMATION&&this.object.model.setValue(g.FURNITURE_DISABLE_PICKING_ANIMATION,t.numberValue)}updateStuffData(){if(!this.object||!this.object.model)return;const t=new wr;t.initializeFromRoomObjectModel(this.object.model);const e=t.getValue(rs.MESSAGE),s=this.object.model.getValue(g.FURNITURE_DATA);!e&&typeof s=="string"?this.object.model.setValue(g.FURNITURE_DATA,s.substr(1)):this.object.model.setValue(g.FURNITURE_DATA,t.getValue(rs.MESSAGE)),this.writeToModel(g.FURNITURE_TYPE_ID,t.getValue(rs.PRODUCT_CODE)),this.writeToModel(g.FURNITURE_PURCHASER_NAME,t.getValue(rs.PURCHASER_NAME)),this.writeToModel(g.FURNITURE_PURCHASER_FIGURE,t.getValue(rs.PURCHASER_FIGURE))}writeToModel(t,e){e&&this.object.model.setValue(t,e)}mouseEvent(t,e){if(!(!t||!e||!this.object)){switch(t.type){case z.ROLL_OVER:this.eventDispatcher.dispatchEvent(new y(y.MOUSE_BUTTON,this.object));break;case z.ROLL_OUT:this.eventDispatcher.dispatchEvent(new y(y.MOUSE_ARROW,this.object));break}super.mouseEvent(t,e)}}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new S(S.PRESENT,this.object))}};rs.MESSAGE="MESSAGE",rs.PRODUCT_CODE="PRODUCT_CODE",rs.EXTRA_PARAM="EXTRA_PARAM",rs.PURCHASER_NAME="PURCHASER_NAME",rs.PURCHASER_FIGURE="PURCHASER_FIGURE";let ju=rs;class QV extends Vt{getEventTypes(){const t=[S.PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG];return this.mergeTypes(super.getEventTypes(),t)}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new S(S.PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG,this.object))}get contextMenu(){return Qs.PURCHASABLE_CLOTHING}}const _i=class _i extends Vt{constructor(){super(),this.updateInterval=tr.DEFAULT_UPDATE_INTERVAL,this._oldLocation=new R}processUpdateMessage(t){if(!t)return;const e=t instanceof $i;if(this.object&&!e&&t.location){const s=this.object.getLocation(),i=R.dif(t.location,s);if(i&&Math.abs(i.x)<2&&Math.abs(i.y)<2){let r=s;(Math.abs(i.x)>1||Math.abs(i.y)>1)&&(r=R.sum(s,R.product(i,.5))),super.processUpdateMessage(new $i(r,t.location,t.direction));return}}if(t.location&&!e&&super.processUpdateMessage(new $i(t.location,t.location,t.direction)),t instanceof St){t.state>0?this.updateInterval=tr.DEFAULT_UPDATE_INTERVAL/this.getUpdateIntervalValue(t.state):this.updateInterval=1,this.handleDataUpdate(t);return}e&&t.isSlide&&(this.updateInterval=tr.DEFAULT_UPDATE_INTERVAL),super.processUpdateMessage(t)}getUpdateIntervalValue(t){return t/_i.MAX_ANIMATION_COUNT}getAnimationValue(t){return t%_i.MAX_ANIMATION_COUNT}handleDataUpdate(t){const e=this.getAnimationValue(t.state);if(e!==t.state){const s=new Ne;s.setString(e.toString()),t=new St(e,s,t.extra)}super.processUpdateMessage(t)}update(t){this.object&&(this._oldLocation.assign(this.object.getLocation()),super.update(t),R.dif(this.object.getLocation(),this._oldLocation).length===0&&this.object.getState(0)!==_i.ANIMATION_NOT_MOVING&&this.object.setState(_i.ANIMATION_NOT_MOVING,0))}};_i.ANIMATION_NOT_MOVING=0,_i.ANIMATION_MOVING=1,_i.MAX_ANIMATION_COUNT=10;let zu=_i;class JV extends It{getEventTypes(){const t=[Et.STATE_RANDOM];return this.mergeTypes(super.getEventTypes(),t)}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new Et(Et.STATE_RANDOM,this.object))}}class ZV extends Vt{get contextMenu(){return Qs.RANDOM_TELEPORT}}class $V extends It{getEventTypes(){const t=[ls.RODRE_CURRENT_USER_ID];return this.mergeTypes(super.getEventTypes(),t)}update(t){if(super.update(t),this.object&&this.object.model){this.object.model.getValue(g.SESSION_CURRENT_USER_ID)||this.eventDispatcher.dispatchEvent(new ls(ls.RODRE_CURRENT_USER_ID,this.object));const e=this.object.model.getValue(g.FURNITURE_DATA).renterId,s=this.object.model.getValue(g.SESSION_CURRENT_USER_ID);e?parseInt(e)===s?this.object.setState(2,0):this.object.setState(1,0):this.object.setState(0,0)}}get widget(){return mo.RENTABLESPACE}}class t2 extends Vt{constructor(){super(),this._roomColorUpdated=!1}getEventTypes(){const t=[S.BACKGROUND_COLOR,Ei.ROOM_BACKGROUND_COLOR];return this.mergeTypes(super.getEventTypes(),t)}onDispose(){this._roomColorUpdated&&(this.eventDispatcher&&this.object&&this.object.model.getValue(g.FURNITURE_REAL_ROOM_OBJECT)===1&&this.eventDispatcher.dispatchEvent(new Ei(Ei.ROOM_BACKGROUND_COLOR,this.object,!1,0,0,0)),this._roomColorUpdated=!1),super.onDispose()}processUpdateMessage(t){super.processUpdateMessage(t),t instanceof St&&(t.data.writeRoomObjectModel(this.object.model),this.object.model.getValue(g.FURNITURE_REAL_ROOM_OBJECT)===1&&this.processColorUpdate())}processColorUpdate(){if(!this.object||!this.object.model)return;const t=new za;t.initializeFromRoomObjectModel(this.object.model);const e=t.getValue(0),s=t.getValue(1),i=t.getValue(2),r=t.getValue(3);e>-1&&s>-1&&i>-1&&r>-1&&(this.object.model.setValue(g.FURNITURE_ROOM_BACKGROUND_COLOR_HUE,s),this.object.model.setValue(g.FURNITURE_ROOM_BACKGROUND_COLOR_SATURATION,i),this.object.model.setValue(g.FURNITURE_ROOM_BACKGROUND_COLOR_LIGHTNESS,r),this.object.setState(e,0),this.eventDispatcher&&this.eventDispatcher.dispatchEvent(new Ei(Ei.ROOM_BACKGROUND_COLOR,this.object,e===1,s,i,r)),this._roomColorUpdated=!0)}mouseEvent(t,e){if(!(!t||!e||!this.object)){switch(t.type){case z.DOUBLE_CLICK:this.eventDispatcher&&this.eventDispatcher.dispatchEvent(new S(S.BACKGROUND_COLOR,this.object));return}super.mouseEvent(t,e)}}}const te=class te extends It{constructor(){super(),this._disableFurnitureSelection=!0,this._hasClickUrl=!1}getEventTypes(){const t=[Pt.ROOM_AD_LOAD_IMAGE];return this.mergeTypes(super.getEventTypes(),t)}initialize(t){super.initialize(t),this._disableFurnitureSelection&&this.object.model.setValue(g.FURNITURE_SELECTION_DISABLED,1)}processUpdateMessage(t){super.processUpdateMessage(t),t instanceof St&&this.processAdDataUpdateMessage(t),t instanceof ge&&this.processAdUpdate(t)}processAdDataUpdateMessage(t){if(!t)return;const e=new wr;e.initializeFromRoomObjectModel(this.object.model);const s=parseInt(e.getValue(te.STATE));!isNaN(s)&&this.object.getState(0)!==s&&this.object.setState(s,0);const i=e.getValue(te.IMAGEURL_KEY),r=this.object.model.getValue(g.FURNITURE_BRANDING_IMAGE_URL);(!r||r!==i)&&(this.object.model.setValue(g.FURNITURE_BRANDING_IMAGE_URL,i),this.object.model.setValue(g.FURNITURE_BRANDING_IMAGE_STATUS,0),this.downloadBackground());const a=e.getValue(te.CLICKURL_KEY);if(a){const c=this.object.model.getValue(g.FURNITURE_BRANDING_URL);(!c||c!==a)&&this.object.model&&this.object.model.setValue(g.FURNITURE_BRANDING_URL,a)}const o=parseInt(e.getValue(te.OFFSETX_KEY)),h=parseInt(e.getValue(te.OFFSETY_KEY)),_=parseInt(e.getValue(te.OFFSETZ_KEY));isNaN(o)||this.object.model.setValue(g.FURNITURE_BRANDING_OFFSET_X,o),isNaN(h)||this.object.model.setValue(g.FURNITURE_BRANDING_OFFSET_Y,h),isNaN(_)||this.object.model.setValue(g.FURNITURE_BRANDING_OFFSET_Z,_);let l=te.IMAGEURL_KEY+"="+(i!==null?i:"")+"	";this._hasClickUrl&&(l=l+(te.CLICKURL_KEY+"="+(a!==null?a:"")+"	")),l=l+(te.OFFSETX_KEY+"="+o+"	"),l=l+(te.OFFSETY_KEY+"="+h+"	"),l=l+(te.OFFSETZ_KEY+"="+_+"	"),this.object.model.setValue(Ve.INFOSTAND_EXTRA_PARAM,Ve.BRANDING_OPTIONS+l)}processAdUpdate(t){if(!(!t||!this.object))switch(t.type){case ge.IMAGE_LOADED:this.object.model.setValue(g.FURNITURE_BRANDING_IMAGE_STATUS,1);break;case ge.IMAGE_LOADING_FAILED:this.object.model.setValue(g.FURNITURE_BRANDING_IMAGE_STATUS,-1);break}}mouseEvent(t,e){!t||!e||t.type===z.MOUSE_MOVE||t.type===z.DOUBLE_CLICK||super.mouseEvent(t,e)}async downloadBackground(){const t=this.object&&this.object.model;if(!t)return;const e=t.getValue(g.FURNITURE_BRANDING_IMAGE_URL),s=t.getValue(g.FURNITURE_BRANDING_IMAGE_STATUS);if(!(!e||e===""||s===1))if(e.endsWith(".gif"))this.object.model.setValue(g.FURNITURE_BRANDING_IS_ANIMATED,!0),fetch(e).then(i=>i.arrayBuffer()).then(i=>$T(i)).then(i=>{const r=i.lsd.width,a=i.lsd.height,o=r*a,h=tm(i,!1),_=[],l=[];let c=new Uint8Array(o*4);for(let f=0;f<h.length;f++){f>0&&(c=c.slice(0));const p=h[f].pixels,m=h[f].colorTable,O=h[f].transparentIndex,A=h[f].dims;for(let L=0;L<A.height;L++)for(let D=0;D<A.width;D++){const U=p[L*A.width+D],P=(L+A.top)*r+(D+A.left);if(O!==U){const v=m[U];c[4*P]=v[0],c[4*P+1]=v[1],c[4*P+2]=v[2],c[4*P+3]=255}}const C=Z_.fromBuffer(c,r,a);_.push(new Ft(C)),l.push(h[f].delay)}W.instance.roomEngine.roomContentLoader.createGifCollection(e,_,l),this.processUpdateMessage(new ge(ge.IMAGE_LOADED))}).catch(i=>{this.processUpdateMessage(new ge(ge.IMAGE_LOADING_FAILED))});else{const i=_s();if(!i)return;if(!i.getTexture(e)){await i.downloadAsset(e)?this.processUpdateMessage(new ge(ge.IMAGE_LOADED)):this.processUpdateMessage(new ge(ge.IMAGE_LOADING_FAILED));return}this.processUpdateMessage(new ge(ge.IMAGE_LOADED))}}};te.STATE="state",te.IMAGEURL_KEY="imageUrl",te.CLICKURL_KEY="clickUrl",te.OFFSETX_KEY="offsetX",te.OFFSETY_KEY="offsetY",te.OFFSETZ_KEY="offsetZ";let ih=te;class e2 extends ih{getAdClickUrl(t){return null}}class s2 extends ih{constructor(){super(),this._hasClickUrl=!0}getAdClickUrl(t){return t.getValue(g.FURNITURE_BRANDING_URL)}handleAdClick(t,e,s){if(s.indexOf("http")===0){Kn.openWebPage(s);return}this.eventDispatcher&&this.eventDispatcher.dispatchEvent(new Pt(Pt.ROOM_AD_FURNI_CLICK,this.object,"",s))}}class i2 extends It{constructor(){super(),this._roomColorUpdated=!1}getEventTypes(){const t=[S.DIMMER,S.WIDGET_REMOVE_DIMMER,Br.DIMMER_STATE];return this.mergeTypes(super.getEventTypes(),t)}onDispose(){this._roomColorUpdated&&this.eventDispatcher&&this.object&&(this.object.model.getValue(g.FURNITURE_REAL_ROOM_OBJECT)===1&&(this.eventDispatcher.dispatchEvent(new Br(this.object,0,1,1,16777215,255)),this.eventDispatcher.dispatchEvent(new S(S.WIDGET_REMOVE_DIMMER,this.object))),this._roomColorUpdated=!1),super.onDispose()}processUpdateMessage(t){if(t instanceof St){if(t.data){const e=t.data.getLegacyString();this.object.model.getValue(g.FURNITURE_REAL_ROOM_OBJECT)===1&&this.processDimmerData(e),super.processUpdateMessage(new St(this.getStateFromDimmerData(e),t.data))}return}super.processUpdateMessage(t)}getStateFromDimmerData(t){if(!t)return 0;const e=t.split(",");return e.length>=5?parseInt(e[0])-1:0}processDimmerData(t){if(!t)return;const e=t.split(",");if(e.length>=5){const s=this.getStateFromDimmerData(t),i=parseInt(e[1]),r=parseInt(e[2]),a=e[3];let o=parseInt(a.substr(1),16),h=parseInt(e[4]);s||(o=16777215,h=255),this.eventDispatcher&&this.object&&(this.eventDispatcher.dispatchEvent(new Br(this.object,s,i,r,o,h)),this._roomColorUpdated=!0)}}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new S(S.DIMMER,this.object))}update(t){super.update(t)}}const Vi=class Vi extends It{constructor(){super(),this._score=0,this._scoreIncreaser=50,this._scoreTimer=0}processUpdateMessage(t){if(t instanceof St)return this.updateScore(t.state);super.processUpdateMessage(t)}updateScore(t){this._score=t;const e=this.object.getState(0);if(this._score!==e){let s=this._score-e;s<0&&(s=-s),s*Vi.UPDATE_INTERVAL>Vi.MAX_UPDATE_TIME?this._scoreIncreaser=Vi.MAX_UPDATE_TIME/s:this._scoreIncreaser=Vi.UPDATE_INTERVAL,this._scoreTimer=nt()}}update(t){super.update(t);const e=this.object.getState(0);if(e!==this._score&&t>=this._scoreTimer+this._scoreIncreaser){const s=t-this._scoreTimer;let i=s/this._scoreIncreaser,r=1;this._score<e&&(r=-1),i>r*(this._score-e)&&(i=r*(this._score-e)),this.object.setState(e+r*i,0),this._scoreTimer=t-(s-i*this._scoreIncreaser)}}};Vi.UPDATE_INTERVAL=50,Vi.MAX_UPDATE_TIME=3e3;let Wu=Vi;class r2 extends It{processUpdateMessage(t){if(super.processUpdateMessage(t),this.object.model.getValue(g.FURNITURE_REAL_ROOM_OBJECT)===1){const e=this.object.model.getValue(g.FURNITURE_EXTRAS),s=parseInt(e);this.object.model.setValue(Ve.INFOSTAND_EXTRA_PARAM,Ve.SONGDISK+s)}}}const ns=class ns extends Vt{constructor(){super(...arguments),this._state=-1,this._sampleId=-1,this._noPitch=!1,this._lastLocZ=0}getEventTypes(){const t=[Ht.ROOM_OBJECT_INITIALIZED,Ht.ROOM_OBJECT_DISPOSED,Ht.PLAY_SAMPLE,Ht.CHANGE_PITCH];return this.mergeTypes(super.getEventTypes(),t)}initialize(t){super.initialize(t),t.logic&&t.logic.soundSample&&(this._sampleId=t.logic.soundSample.id,this._noPitch=t.logic.soundSample.noPitch),this.object.model.setValue(g.FURNITURE_SOUNDBLOCK_RELATIVE_ANIMATION_SPEED,1)}onDispose(){this._state!==ns.STATE_UNINITIALIZED&&this.eventDispatcher.dispatchEvent(new Ht(Ht.ROOM_OBJECT_DISPOSED,this.object,this._sampleId)),super.onDispose()}processUpdateMessage(t){super.processUpdateMessage(t),t instanceof St&&this.updateSoundBlockMessage(t)}updateSoundBlockMessage(t){if(!t)return;const e=this.object&&this.object.model,s=this.object&&this.object.location;!e||!s||(this._state===ns.STATE_UNINITIALIZED&&e.getValue(g.FURNITURE_REAL_ROOM_OBJECT)===1&&(this._lastLocZ=s.z,this.eventDispatcher.dispatchEvent(new Ht(Ht.ROOM_OBJECT_INITIALIZED,this.object,this._sampleId,this.getPitchForHeight(s.z)))),this._state!==ns.STATE_UNINITIALIZED&&e.getValue(g.FURNITURE_REAL_ROOM_OBJECT)===1&&this._lastLocZ!==s.z&&(this._lastLocZ=s.z,this.eventDispatcher.dispatchEvent(new Ht(Ht.CHANGE_PITCH,this.object,this._sampleId,this.getPitchForHeight(s.z)))),this._state!==ns.STATE_UNINITIALIZED&&t.state!==this._state&&this.playSoundAt(s.z),this._state=t.state)}playSoundAt(t){if(!this.object)return;const e=this.getPitchForHeight(t);this.object.model.setValue(g.FURNITURE_SOUNDBLOCK_RELATIVE_ANIMATION_SPEED,e),this.eventDispatcher.dispatchEvent(new Ht(Ht.PLAY_SAMPLE,this.object,this._sampleId,e))}getPitchForHeight(t){if(this._noPitch)return 1;let e=t*2;return e>ns.HIGHEST_SEMITONE&&(e=Math.min(0,ns.LOWEST_SEMITONE+(e-ns.HIGHEST_SEMITONE-1))),Math.pow(2,e/12)}};ns.HIGHEST_SEMITONE=12,ns.LOWEST_SEMITONE=-12,ns.STATE_UNINITIALIZED=-1;let ku=ns;class n2 extends Vt{constructor(){super(...arguments),this._disposeEventsAllowed=!1,this._isInitialized=!1,this._currentState=-1}getEventTypes(){const t=[y.SOUND_MACHINE_START,y.SOUND_MACHINE_STOP,y.SOUND_MACHINE_DISPOSE,y.SOUND_MACHINE_INIT];return this.mergeTypes(super.getEventTypes(),t)}onDispose(){this.requestDispose(),super.onDispose()}processUpdateMessage(t){if(super.processUpdateMessage(t),this.object.model.getValue(g.FURNITURE_REAL_ROOM_OBJECT)===1&&(this._isInitialized||this.requestInit(),this.object.model.setValue(Ve.INFOSTAND_EXTRA_PARAM,Ve.JUKEBOX),t instanceof St)){const e=this.object.getState(0);e!==this._currentState&&(this._currentState=e,e===1?this.requestPlayList():e===0&&this.requestStopPlaying())}}requestInit(){!this.object||!this.eventDispatcher||(this._disposeEventsAllowed=!0,this.eventDispatcher.dispatchEvent(new y(y.SOUND_MACHINE_INIT,this.object)),this._isInitialized=!0)}requestPlayList(){!this.object||!this.eventDispatcher||(this._disposeEventsAllowed=!0,this.eventDispatcher.dispatchEvent(new y(y.SOUND_MACHINE_START,this.object)))}requestStopPlaying(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new y(y.SOUND_MACHINE_STOP,this.object))}requestDispose(){!this._disposeEventsAllowed||!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new y(y.SOUND_MACHINE_DISPOSE,this.object))}}const F_=class F_ extends It{getEventTypes(){const t=[S.STICKIE,y.STICKIE];return this.mergeTypes(super.getEventTypes(),t)}initialize(t){super.initialize(t),this.updateColor(),this.object&&this.object.model.setValue(g.FURNITURE_IS_STICKIE,"")}processUpdateMessage(t){super.processUpdateMessage(t),t instanceof Zd&&this.eventDispatcher&&this.eventDispatcher.dispatchEvent(new S(S.STICKIE,this.object)),this.updateColor()}updateColor(){if(!this.object)return;const t=this.object.model.getValue(g.FURNITURE_DATA);let e=F_.STICKIE_COLORS.indexOf(t);e<0&&(e=3),this.object.model.setValue(g.FURNITURE_COLOR,e+1)}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new y(y.STICKIE,this.object))}};F_.STICKIE_COLORS=["9CCEFF","FF9CFF","9CFF9C","FFFF33"];let Ku=F_;class a2 extends It{getEventTypes(){const t=[S.TROPHY];return this.mergeTypes(super.getEventTypes(),t)}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new S(S.TROPHY,this.object))}}const Yi=class Yi extends Vt{constructor(){super(),this._total=0,this._lastUpdate=0,this._interval=33}processUpdateMessage(t){if(super.processUpdateMessage(t),t instanceof St){const e=t.data;if(!e)return;this.updateTotal(e.result)}}updateTotal(t){if(this._total=t,!this._lastUpdate){this.object.model.setValue(g.FURNITURE_VOTE_COUNTER_COUNT,t),this._lastUpdate=nt();return}if(this._total!==this.currentTotal){const e=Math.abs(this._total-this.currentTotal);e*Yi.UPDATE_INTERVAL>Yi.MAX_UPDATE_TIME?this._interval=Yi.MAX_UPDATE_TIME/e:this._interval=Yi.UPDATE_INTERVAL,this._lastUpdate=nt()}}update(t){if(super.update(t),this.object&&this.currentTotal!==this._total&&t>=this._lastUpdate+this._interval){const e=t-this._lastUpdate;let s=e/this._interval,i=1;this._total<this.currentTotal&&(i=-1),s>i*(this._total-this.currentTotal)&&(s=i*(this._total-this.currentTotal)),this.object.model.setValue(g.FURNITURE_VOTE_COUNTER_COUNT,this.currentTotal+i*s),this._lastUpdate=t-(e-s*this._interval)}}get currentTotal(){return this.object.model.getValue(g.FURNITURE_VOTE_COUNTER_COUNT)}};Yi.UPDATE_INTERVAL=33,Yi.MAX_UPDATE_TIME=1e3;let Xu=Yi;class o2 extends Vt{processUpdateMessage(t){if(super.processUpdateMessage(t),!!this.object&&t instanceof St){const e=t.data;e instanceof Wa&&this.object.model.setValue(g.FURNITURE_VOTE_MAJORITY_RESULT,e.result)}}}class h2 extends Vt{mouseEvent(t,e){!t||!e||(t.type===z.DOUBLE_CLICK&&this.eventDispatcher&&this.eventDispatcher.dispatchEvent(new Et(Et.STATE_CHANGE,this.object)),super.mouseEvent(t,e))}}class _2 extends Vt{initialize(t){super.initialize(t);let e="";t.logic&&t.logic.maskType&&t.logic.maskType!==""&&t.logic.maskType.length>0&&(e=t.logic.maskType),this.object.model.setValue(g.FURNITURE_USES_PLANE_MASK,1),this.object.model.setValue(g.FURNITURE_PLANE_MASK_TYPE,e)}}class l2 extends It{getEventTypes(){const t=[S.YOUTUBE,ls.RODRE_URL_PREFIX];return this.mergeTypes(super.getEventTypes(),t)}update(t){super.update(t),this.object.model.getValue(g.SESSION_URL_PREFIX)||this.eventDispatcher.dispatchEvent(new ls(ls.RODRE_URL_PREFIX,this.object))}useObject(){!this.object||!this.eventDispatcher||this.eventDispatcher.dispatchEvent(new S(S.YOUTUBE,this.object))}}class c2 extends tr{constructor(){super(),this._selected=!1,this._reportedLocation=null,this._postureIndex=0,this._gestureIndex=0,this._headDirectionDelta=0,this._directions=[],this._talkingEndTimestamp=0,this._gestureEndTimestamp=0,this._expressionEndTimestamp=0}getEventTypes(){const t=[X.CLICK,Ee.POSITION_CHANGED];return this.mergeTypes(super.getEventTypes(),t)}initialize(t){if(!t)return;const e=this.object&&this.object.model;if(e){if(t.logic&&t.logic.model){const s=t.logic.model.directions;if(s&&s.length){for(const i of s)this._directions.push(i);this._directions.sort()}}e.setValue(g.PET_ALLOWED_DIRECTIONS,this._directions)}}dispose(){this._selected&&this.object&&this.eventDispatcher&&this.eventDispatcher.dispatchEvent(new Ee(Ee.OBJECT_REMOVED,this.object)),this._directions=null,this._reportedLocation=null}update(t){if(super.update(t),this._selected&&this.object&&this.eventDispatcher){const e=this.object.getLocation();(!this._reportedLocation||this._reportedLocation.x!==e.x||this._reportedLocation.y!==e.y||this._reportedLocation.z!==e.z)&&(this._reportedLocation||(this._reportedLocation=new R),this._reportedLocation.assign(e),this.eventDispatcher.dispatchEvent(new Ee(Ee.POSITION_CHANGED,this.object)))}this.object&&this.object.model&&this.updateModel(t,this.object.model)}updateModel(t,e){this._gestureEndTimestamp>0&&t>this._gestureEndTimestamp&&(e.setValue(g.FIGURE_GESTURE,null),this._gestureEndTimestamp=0),this._talkingEndTimestamp>0&&t>this._talkingEndTimestamp&&(e.setValue(g.FIGURE_TALK,0),this._talkingEndTimestamp=0),this._expressionEndTimestamp>0&&t>this._expressionEndTimestamp&&(e.setValue(g.FIGURE_EXPRESSION,0),this._expressionEndTimestamp=0)}processUpdateMessage(t){if(!t||!this.object)return;super.processUpdateMessage(t);const e=this.object&&this.object.model;if(e){if(t instanceof $o){e.setValue(g.HEAD_DIRECTION,t.headDirection);return}if(t instanceof Jo){const s=new uh(t.figure);e.setValue(g.FIGURE,t.figure),e.setValue(g.RACE,t.subType),e.setValue(g.PET_PALETTE_INDEX,s.paletteId),e.setValue(g.PET_COLOR,s.color),e.setValue(g.PET_TYPE,s.typeId),e.setValue(g.PET_CUSTOM_LAYER_IDS,s.customLayerIds),e.setValue(g.PET_CUSTOM_PARTS_IDS,s.customPartIds),e.setValue(g.PET_CUSTOM_PALETTE_IDS,s.customPaletteIds),e.setValue(g.PET_IS_RIDING,t.isRiding?1:0);return}if(t instanceof Qd){e.setValue(g.FIGURE_POSTURE,t.postureType);return}if(t instanceof qd){e.setValue(g.FIGURE_TALK,1),this._talkingEndTimestamp=this.time+t.numberOfWords*1e3;return}if(t instanceof Jd){e.setValue(g.FIGURE_SLEEP,t.isSleeping?1:0);return}if(t instanceof TT){e.setValue(g.FIGURE_GESTURE,t.gesture),this._gestureEndTimestamp=this.time+3e3;return}if(t instanceof Zo){this._selected=t.selected,this._reportedLocation=null;return}if(t instanceof uT){e.setValue(g.FIGURE_EXPERIENCE_TIMESTAMP,this.time),e.setValue(g.FIGURE_GAINED_EXPERIENCE,t.gainedExperience);return}}}mouseEvent(t,e){let s=null;switch(t.type){case z.MOUSE_CLICK:s=X.CLICK;break;case z.DOUBLE_CLICK:break;case z.MOUSE_DOWN:{this.object.model.getValue(g.PET_TYPE)===ja.MONSTERPLANT&&this.eventDispatcher&&this.eventDispatcher.dispatchEvent(new X(X.MOUSE_DOWN,this.object,t.eventId,t.altKey,t.ctrlKey,t.shiftKey,t.buttonDown));break}}s&&this.eventDispatcher&&this.eventDispatcher.dispatchEvent(new X(s,this.object,t.eventId,t.altKey,t.ctrlKey,t.shiftKey,t.buttonDown))}}class NT{constructor(){this._width=0,this._height=0,this._wallHeight=0,this._fixedWallsHeight=0,this._tileMap=[],this._holeMap=[],this._doors=[],this._dimensions={minX:0,maxX:0,minY:0,maxY:0},this._restrictsDragging=!1,this._restrictedScale=1,this._restrictsScaling=!1}get width(){return this._width}set width(t){this._width=t}get height(){return this._height}set height(t){this._height=t}get wallHeight(){return this._wallHeight}set wallHeight(t){this._wallHeight=t}get fixedWallsHeight(){return this._fixedWallsHeight}set fixedWallsHeight(t){this._fixedWallsHeight=t}get tileMap(){return this._tileMap}get holeMap(){return this._holeMap}get doors(){return this._doors}get dimensions(){return this._dimensions}get restrictsDragging(){return this._restrictsDragging}set restrictsDragging(t){this._restrictsDragging=t}get restrictsScaling(){return this._restrictsScaling}set restrictsScaling(t){this._restrictsScaling=t}get restrictedScale(){return this._restrictedScale}set restrictedScale(t){this._restrictedScale=t}}const x_=class x_{constructor(t,e,s){this.type=t,this.loc=e,this.category=s}get loc(){return this._loc}set loc(t){this._loc||(this._loc=new R),this._loc.assign(t)}get type(){return this._type}set type(t){this._type=t}get category(){return this._category}set category(t){this._category=t}dispose(){this._loc=null}};x_.WINDOW="window",x_.HOLE="hole";let Hr=x_;class u2{constructor(){this._masks=[]}get masks(){return this._masks}}class DT{constructor(){this._masks=new Map}get maskCount(){return this._masks.size}dispose(){this._masks&&(this.reset(),this._masks=null)}initialize(t){if(!t)return!1;if(this._masks.clear(),t.masks.length)for(const e of t.masks){if(!e)continue;const s=e.locations.length?e.locations[0]:null;s&&this._masks.set(e.id,new Hr(e.type,s,e.category))}return!0}reset(){for(const t of this._masks.values())t&&t.dispose();this._masks.clear()}addMask(t,e,s,i){const r=new Hr(e,s,i);this._masks.delete(t),this._masks.set(t,r)}removeMask(t){const e=this._masks.get(t);return e?(this._masks.delete(t),e.dispose(),!0):!1}getXML(){const t=new u2;for(const[e,s]of this._masks.entries()){if(!s)continue;const i=this.getMaskType(s),r=this.getMaskCategory(s),a=this.getMaskLocation(s);if(i&&r&&a){const o={id:e,type:i,category:r,locations:[{x:a.x,y:a.y,z:a.z}]};t.masks.push(o)}}return t}getMaskLocation(t){return t?t.loc:null}getMaskType(t){return t?t.type:null}getMaskCategory(t){return t?t.category:null}get masks(){return this._masks}}class d2{constructor(t,e,s,i){this._leftSideLoc=0,this._rightSideLoc=0,this._leftSideLength=0,this._rightSideLength=0,this._leftSideLoc=t,this._rightSideLoc=e,this._leftSideLength=s,this._rightSideLength=i}get leftSideLoc(){return this._leftSideLoc}get rightSideLoc(){return this._rightSideLoc}get leftSideLength(){return this._leftSideLength}get rightSideLength(){return this._rightSideLength}}const Dr=class Dr{constructor(t,e,s,i,r){this._type=0,this._loc=null,this._leftSide=null,this._rightSide=null,this._normal=null,this._normalDirection=null;let a,o,h,_,l,c,f,p;if(this._secondaryNormals=[],this._masks=[],this._loc=new R,this._loc.assign(e),this._leftSide=new R,this._leftSide.assign(s),this._rightSide=new R,this._rightSide.assign(i),this._type=t,s!=null&&i!=null&&(this._normal=R.crossProduct(s,i),a=0,o=0,h=0,_=0,l=0,this.normal.x!=0||this.normal.y!=0?(_=this.normal.x,l=this.normal.y,a=360+Math.atan2(l,_)/Math.PI*180,a>=360&&(a=a-360),_=Math.sqrt(this.normal.x*this.normal.x+this.normal.y*this.normal.y),l=this.normal.z,o=360+Math.atan2(l,_)/Math.PI*180,o>=360&&(o=o-360)):this.normal.z<0?o=90:o=270,this._normalDirection=new R(a,o,h)),r!=null&&r.length>0)for(c=0;c<r.length;)f=r[c],f!=null&&f.length>0&&(p=new R,p.assign(f),p.multiply(1/p.length),this._secondaryNormals.push(p)),c++}get type(){return this._type}get loc(){return this._loc}get leftSide(){return this._leftSide}get rightSide(){return this._rightSide}get normal(){return this._normal}get normalDirection(){return this._normalDirection}get secondaryNormalCount(){return this._secondaryNormals.length}get maskCount(){return this._masks.length}getSecondaryNormal(t){if(t<0||t>=this.secondaryNormalCount)return null;const e=new R;return e.assign(this._secondaryNormals[t]),e}addMask(t,e,s,i){const r=new d2(t,e,s,i);this._masks.push(r)}getMask(t){return t<0||t>=this.maskCount?null:this._masks[t]}getMaskLeftSideLoc(t){const e=this.getMask(t);return e!=null?e.leftSideLoc:-1}getMaskRightSideLoc(t){const e=this.getMask(t);return e!=null?e.rightSideLoc:-1}getMaskLeftSideLength(t){const e=this.getMask(t);return e!=null?e.leftSideLength:-1}getMaskRightSideLength(t){const e=this.getMask(t);return e!=null?e.rightSideLength:-1}};Dr.PLANE_UNDEFINED=0,Dr.PLANE_FLOOR=1,Dr.PLANE_WALL=2,Dr.PLANE_LANDSCAPE=3,Dr.PLANE_BILLBOARD=4;let vt=Dr;class E2{constructor(t,e,s,i){this._x=t,this._y=e,this._width=s,this._height=i}get x(){return this._x}get y(){return this._y}get width(){return this._width}get height(){return this._height}}const Un=class Un{constructor(){this._corners=[],this._endPoints=[],this._directions=[],this._lengths=[],this._leftTurns=[],this._borders=[],this._hideWalls=[],this._manuallyLeftCut=[],this._manuallyRightCut=[],this._addDuplicates=!1,this._count=0}addWall(t,e,s,i,r){(this._addDuplicates||this.checkIsNotDuplicate(t,e,s,i,r))&&(this._corners.push(t),this._directions.push(e),this._lengths.push(s),this._borders.push(i),this._leftTurns.push(r),this._hideWalls.push(!1),this._manuallyLeftCut.push(!1),this._manuallyRightCut.push(!1),this._count++)}checkIsNotDuplicate(t,e,s,i,r){let a=0;for(;a<this._count;){if(this._corners[a].x==t.x&&this._corners[a].y==t.y&&this._directions[a]==e&&this._lengths[a]==s&&this._borders[a]==i&&this._leftTurns[a]==r)return!1;a++}return!0}get count(){return this._count}getCorner(t){return this._corners[t]}getEndPoint(t){return this.calculateWallEndPoints(),this._endPoints[t]}getLength(t){return this._lengths[t]}getDirection(t){return this._directions[t]}getBorder(t){return this._borders[t]}getHideWall(t){return this._hideWalls[t]}getLeftTurn(t){return this._leftTurns[t]}getManuallyLeftCut(t){return this._manuallyLeftCut[t]}getManuallyRightCut(t){return this._manuallyRightCut[t]}setHideWall(t,e){this._hideWalls[t]=e}setLength(t,e){e<this._lengths[t]&&(this._lengths[t]=e,this._manuallyRightCut[t]=!0)}moveCorner(t,e){let s;if(e>0&&e<this._lengths[t]){const i=this._corners[t];s=Un.WALL_DIRECTION_VECTORS[this.getDirection(t)],this._corners[t]=new K(i.x+e*s.x,i.y+e*s.y),this._lengths[t]=this._lengths[t]-e,this._manuallyLeftCut[t]=!0}}calculateWallEndPoints(){let t,e,s,i,r;if(this._endPoints.length!=this.count)for(this._endPoints=[],t=0;t<this.count;)e=this.getCorner(t),s=new K(e.x,e.y),i=Un.WALL_DIRECTION_VECTORS[this.getDirection(t)],r=this.getLength(t),s.x=s.x+i.x*r,s.y=s.y+i.y*r,this._endPoints.push(s),t++}};Un.WALL_DIRECTION_VECTORS=[new R(1,0,0),new R(0,1,0),new R(-1,0,0),new R(0,-1,0)],Un.WALL_NORMAL_VECTORS=[new R(0,1,0),new R(-1,0,0),new R(0,-1,0),new R(1,0,0)];let Ds=Un;const _t=class _t{constructor(){this._width=0,this._height=0,this._minX=0,this._maxX=0,this._minY=0,this._maxY=0,this._fixedWallHeight=-1,this._floorHeight=0,this._restrictsScaling=!1,this._restrictedScale=1,this._tileMatrix=[],this._tileMatrixOriginal=[],this._planes=[],this._floorHoleMatrix=[],this._wallHeight=3.6,this._wallThicknessMultiplier=1,this._floorThicknessMultiplier=1,this._floorHoles=new Map}static getFloorHeight(t){const e=t.length;if(!e)return 0;let s=0,i=0;for(;i<e;){const r=t[i];let a=0;for(;a<r.length;){const o=r[a];o>s&&(s=o),a++}i++}return s}static findEntranceTile(t){if(!t)return null;const e=t.length;if(!e)return null;const s=[];let i=0;for(;i<e;){const r=t[i];if(!r||!r.length)return null;let a=0;for(;a<r.length;){if(r[a]>=0){s.push(a);break}a++}s.length<i+1&&s.push(r.length+1),i++}for(i=1;i<s.length-1;){if(Math.trunc(s[i])<=Math.trunc(s[i-1])-1&&Math.trunc(s[i])<=Math.trunc(s[i+1])-1)return new K(Math.trunc(s[i]|0),i);i++}return null}static expandFloorTiles(t){let e,s,i,r,a,o,h,_,l,c,f,p;const m=t.length,O=t[0].length,A=[];for(s=0;s<m*4;)A[s]=[],s++;let C=0;for(s=0;s<m;){for(a=0,e=0;e<O;){if(o=t[s][e],o<0||o<=255)for(r=0;r<4;){for(i=0;i<4;)A[C+r]===void 0&&(A[C+r]=[]),A[C+r][a+i]=o<0?o:o*4,i++;r++}else{for(h=(o&255)*4,_=h+(o>>11&1)*3,l=h+(o>>10&1)*3,c=h+(o>>9&1)*3,f=h+(o>>8&1)*3,i=0;i<3;)p=i+1,A[C][a+i]=(_*(3-i)+l*i)/3,A[C+3][a+p]=(c*(3-p)+f*p)/3,A[C+p][a]=(_*(3-p)+c*p)/3,A[C+i][a+3]=(l*(3-i)+f*i)/3,i++;A[C+1][a+1]=_>h?h+2:h+1,A[C+1][a+2]=l>h?h+2:h+1,A[C+2][a+1]=c>h?h+2:h+1,A[C+2][a+2]=f>h?h+2:h+1}a=a+4,e++}C=C+4,s++}return A}static addTileTypes(t){let e,s,i,r,a,o,h,_,l,c,f,p,m;const O=t.length-1,A=t[0].length-1;for(s=1;s<O;){for(e=1;e<A;)i=t[s][e],i<0||(r=t[s-1][e-1]&255,a=t[s-1][e]&255,o=t[s-1][e+1]&255,h=t[s][e-1]&255,_=t[s][e+1]&255,l=t[s+1][e-1]&255,c=t[s+1][e]&255,f=t[s+1][e+1]&255,p=i+1,m=(r==p||a==p||h==p?8:0)|(o==p||a==p||_==p?4:0)|(l==p||c==p||h==p?2:0)|(f==p||c==p||_==p?1:0),m==15&&(m=0),t[s][e]=i|m<<8),e++;s++}}static unpadHeightMap(t){t.shift(),t.pop();for(const e of t)e.shift(),e.pop()}static padHeightMap(t){const e=[],s=[];for(const i of t)i.push(_t.TILE_BLOCKED),i.unshift(_t.TILE_BLOCKED);for(const i of t[0])e.push(_t.TILE_BLOCKED),s.push(_t.TILE_BLOCKED);t.push(s),t.unshift(e)}get minX(){return this._minX}get maxX(){return this._maxX}get minY(){return this._minY}get maxY(){return this._maxY}get tileMapWidth(){return this._width}get tileMapHeight(){return this._height}get planeCount(){return this._planes.length}get floorHeight(){return this._fixedWallHeight!=-1?this._fixedWallHeight:this._floorHeight}get wallHeight(){return this._fixedWallHeight!=-1?this._fixedWallHeight+3.6:this._wallHeight}set wallHeight(t){t<0&&(t=0),this._wallHeight=t}get wallThicknessMultiplier(){return this._wallThicknessMultiplier}set wallThicknessMultiplier(t){t<0&&(t=0),this._wallThicknessMultiplier=t}get floorThicknessMultiplier(){return this._floorThicknessMultiplier}set floorThicknessMultiplier(t){t<0&&(t=0),this._floorThicknessMultiplier=t}dispose(){this._planes=null,this._tileMatrix=null,this._tileMatrixOriginal=null,this._floorHoleMatrix=null,this._floorHoles!=null&&(this._floorHoles.clear(),this._floorHoles=null)}reset(){this._planes=[],this._tileMatrix=[],this._tileMatrixOriginal=[],this._width=0,this._height=0,this._minX=0,this._maxX=0,this._minY=0,this._maxY=0,this._floorHeight=0,this._floorHoleMatrix=[]}initializeTileMap(t,e){t<0&&(t=0),e<0&&(e=0),this._tileMatrix=[],this._tileMatrixOriginal=[],this._floorHoleMatrix=[];let s=0;for(;s<e;){const i=[],r=[],a=[];let o=0;for(;o<t;)i[o]=_t.TILE_BLOCKED,r[o]=_t.TILE_BLOCKED,a[o]=!1,o++;this._tileMatrix.push(i),this._tileMatrixOriginal.push(r),this._floorHoleMatrix.push(a),s++}return this._width=t,this._height=e,this._minX=this._width,this._maxX=-1,this._minY=this._height,this._maxY=-1,!0}setTileHeight(t,e,s){let i,r,a,o,h;if(t>=0&&t<this._width&&e>=0&&e<this._height){if(i=this._tileMatrix[e],i[t]=s,s>=0)t<this._minX&&(this._minX=t),t>this._maxX&&(this._maxX=t),e<this._minY&&(this._minY=e),e>this._maxY&&(this._maxY=e);else{if(t==this._minX||t==this._maxX){for(r=!1,a=this._minY;a<this._maxY;){if(this.getTileHeightInternal(t,a)>=0){r=!0;break}a++}r||(t==this._minX&&this._minX++,t==this._maxX&&this._maxX--)}if(e==this._minY||e==this._maxY){for(o=!1,h=this._minX;h<this._maxX;){if(this.getTileHeight(h,e)>=0){o=!0;break}h++}o||(e==this._minY&&this._minY++,e==this._maxY&&this._maxY--)}}return!0}return!1}getTileHeight(t,e){if(t<0||t>=this._width||e<0||e>=this._height)return _t.TILE_BLOCKED;const s=this._tileMatrix[e];return s[t]===void 0?0:Math.abs(s[t])}getTileHeightOriginal(t,e){return t<0||t>=this._width||e<0||e>=this._height?_t.TILE_BLOCKED:this._floorHoleMatrix[e][t]?_t.TILE_HOLE:this._tileMatrixOriginal[e][t]}getTileHeightInternal(t,e){return t<0||t>=this._width||e<0||e>=this._height?_t.TILE_BLOCKED:this._tileMatrix[e][t]}initializeFromTileData(t=-1){let e,s;for(this._fixedWallHeight=t,s=0;s<this._height;){for(e=0;e<this._width;)this._tileMatrixOriginal[s]===void 0&&(this._tileMatrixOriginal[s]=[]),this._tileMatrixOriginal[s][e]=this._tileMatrix[s][e],e++;s++}const i=_t.findEntranceTile(this._tileMatrix);for(s=0;s<this._height;){for(e=0;e<this._width;)this._floorHoleMatrix[s]===void 0&&(this._floorHoleMatrix[s]=[]),this._floorHoleMatrix[s][e]&&this.setTileHeight(e,s,_t.TILE_HOLE),e++;s++}return this.initialize(i)}initialize(t){let e=0;t!=null&&(e=this.getTileHeight(t.x,t.y),this.setTileHeight(t.x,t.y,_t.TILE_BLOCKED)),this._floorHeight=_t.getFloorHeight(this._tileMatrix),this.createWallPlanes();const s=[];for(const r of this._tileMatrix)s.push(r.concat());_t.padHeightMap(s),_t.addTileTypes(s),_t.unpadHeightMap(s);const i=_t.expandFloorTiles(s);return this.extractPlanes(i),t!=null&&(this.setTileHeight(t.x,t.y,e),this.addFloor(new R(t.x+.5,t.y+.5,e),new R(-1,0,0),new R(0,-1,0),!1,!1,!1,!1)),!0}generateWallData(t,e){let s,i,r,a,o;const h=new Ds,_=[this.extractTopWall.bind(this),this.extractRightWall.bind(this),this.extractBottomWall.bind(this),this.extractLeftWall.bind(this)];let l=0,c=new K(t.x,t.y),f=0;for(;f++<1e3;){if(s=!1,i=!1,r=l,(c.x<this.minX||c.x>this.maxX||c.y<this.minY||c.y>this.maxY)&&(s=!0),a=_[l](c,e),a==null)return null;if(o=Math.abs(a.x-c.x)+Math.abs(a.y-c.y),c.x==a.x||c.y==a.y?(l=(l-1+_.length)%_.length,o=o+1,i=!0):(l=(l+1)%_.length,o--),h.addWall(c,r,o,s,i),a.x==t.x&&a.y==t.y&&(a.x!=c.x||a.y!=c.y))break;c=a}return h.count==0?null:h}hidePeninsulaWallChains(t){let e,s,i,r,a=0;const o=t.count;for(;a<o;){const h=a;for(e=a,s=0,i=!1;!t.getBorder(a)&&a<o;)t.getLeftTurn(a)?s++:s>0&&s--,s>1&&(i=!0),e=a,a++;if(i)for(r=h;r<=e;)t.setHideWall(r,!0),r++;a++}}updateWallsNextToHoles(t){let e,s,i,r,a,o,h;const _=t.count;let l=0;for(;l<_;){if(!t.getHideWall(l)){for(e=t.getCorner(l),s=t.getDirection(l),i=t.getLength(l),r=Ds.WALL_DIRECTION_VECTORS[s],a=Ds.WALL_NORMAL_VECTORS[s],o=0,h=0;h<i;){if(this.getTileHeightInternal(e.x+h*r.x-a.x,e.y+h*r.y-a.y)==_t.TILE_HOLE){if(h>0&&o==0){t.setLength(l,h);break}o++}else if(o>0){t.moveCorner(l,o);break}h++}o==i&&t.setHideWall(l,!0)}l++}}resolveOriginalWallIndex(t,e,s){let i,r,a,o,h,_;const l=Math.min(t.y,e.y),c=Math.max(t.y,e.y),f=Math.min(t.x,e.x),p=Math.max(t.x,e.x),m=s.count;let O=0;for(;O<m;){if(i=s.getCorner(O),r=s.getEndPoint(O),t.x==e.x){if(i.x==t.x&&r.x==t.x&&(a=Math.min(i.y,r.y),o=Math.max(i.y,r.y),a<=l&&c<=o))return O}else if(t.y==e.y&&i.y==t.y&&r.y==t.y&&(h=Math.min(i.x,r.x),_=Math.max(i.x,r.x),h<=f&&p<=_))return O;O++}return-1}hideOriginallyHiddenWalls(t,e){let s,i,r,a,o;const h=t.count;let _=0;for(;_<h;)t.getHideWall(_)||(s=t.getCorner(_),i=new K(s.x,s.y),r=Ds.WALL_DIRECTION_VECTORS[t.getDirection(_)],a=t.getLength(_),i.x=i.x+r.x*a,i.y=i.y+r.y*a,o=this.resolveOriginalWallIndex(s,i,e),o>=0?e.getHideWall(o)&&t.setHideWall(_,!0):t.setHideWall(_,!0)),_++}checkWallHiding(t,e){this.hidePeninsulaWallChains(e),this.updateWallsNextToHoles(t),this.hideOriginallyHiddenWalls(t,e)}addWalls(t,e){const s=t.count,i=e.count;let r=0;for(;r<s;){if(!t.getHideWall(r)){const a=t.getCorner(r),o=t.getDirection(r),h=t.getLength(r),_=Ds.WALL_DIRECTION_VECTORS[o],l=Ds.WALL_NORMAL_VECTORS[o];let c=-1,f=0;for(;f<h;){const At=this.getTileHeightInternal(a.x+f*_.x+l.x,a.y+f*_.y+l.y);At>=0&&(At<c||c<0)&&(c=At),f++}const p=c;let m=new R(a.x,a.y,p);m=R.sum(m,R.product(l,.5)),m=R.sum(m,R.product(_,-.5));const O=this.wallHeight+Math.min(_t.MAX_WALL_ADDITIONAL_HEIGHT,this.floorHeight)-c,A=R.product(_,-h),C=new R(0,0,O);m=R.dif(m,A);const L=this.resolveOriginalWallIndex(a,t.getEndPoint(r),e);let D=0,U=0;L>=0?(D=e.getDirection((L+1)%i),U=e.getDirection((L-1+i)%i)):(D=t.getDirection((r+1)%s),U=t.getDirection((r-1+s)%s));let P=null;(D-o+4)%4==3?P=Ds.WALL_NORMAL_VECTORS[D]:(o-U+4)%4==3&&(P=Ds.WALL_NORMAL_VECTORS[U]);const v=t.getLeftTurn(r),F=t.getLeftTurn((r-1+s)%s),$=t.getHideWall((r+1)%s),et=t.getManuallyLeftCut(r),at=t.getManuallyRightCut(r);this.addWall(m,A,C,P,!F||et,!v||at,!$)}r++}}createWallPlanes(){const t=this._tileMatrix;if(t==null)return!1;let e,s,i;const r=t.length;let a=0;if(r==0)return!1;for(e=0;e<r;){if(i=t[e],i==null||i.length==0)return!1;a>0?a=Math.min(a,i.length):a=i.length,e++}const o=Math.min(_t.MAX_WALL_ADDITIONAL_HEIGHT,this._fixedWallHeight!=-1?this._fixedWallHeight:_t.getFloorHeight(t)),h=this.minX;let _=this.minY;for(_=this.minY;_<=this.maxY;){if(this.getTileHeightInternal(h,_)>_t.TILE_HOLE){_--;break}_++}if(_>this.maxY)return!1;const l=new K(h,_),c=this.generateWallData(l,!0),f=this.generateWallData(l,!1);for(c!=null&&(c.count,f.count,this.checkWallHiding(c,f),this.addWalls(c,f)),s=0;s<this.tileMapHeight;){for(e=0;e<this.tileMapWidth;)this.getTileHeightInternal(e,s)<0&&this.setTileHeight(e,s,-(o+this.wallHeight)),e++;s++}return!0}extractTopWall(t,e){if(t==null)return null;let s=1,i=_t.TILE_HOLE;for(e||(i=_t.TILE_BLOCKED);s<1e3;){if(this.getTileHeightInternal(t.x+s,t.y)>i)return new K(t.x+s-1,t.y);if(this.getTileHeightInternal(t.x+s,t.y+1)<=i)return new K(t.x+s,t.y+1);s++}return null}extractRightWall(t,e){if(t==null)return null;let s=1,i=_t.TILE_HOLE;for(e||(i=_t.TILE_BLOCKED);s<1e3;){if(this.getTileHeightInternal(t.x,t.y+s)>i)return new K(t.x,t.y+(s-1));if(this.getTileHeightInternal(t.x-1,t.y+s)<=i)return new K(t.x-1,t.y+s);s++}return null}extractBottomWall(t,e){if(t==null)return null;let s=1,i=_t.TILE_HOLE;for(e||(i=_t.TILE_BLOCKED);s<1e3;){if(this.getTileHeightInternal(t.x-s,t.y)>i)return new K(t.x-(s-1),t.y);if(this.getTileHeightInternal(t.x-s,t.y-1)<=i)return new K(t.x-s,t.y-1);s++}return null}extractLeftWall(t,e){if(t==null)return null;let s=1,i=_t.TILE_HOLE;for(e||(i=_t.TILE_BLOCKED);s<1e3;){if(this.getTileHeightInternal(t.x,t.y-s)>i)return new K(t.x,t.y-(s-1));if(this.getTileHeightInternal(t.x+1,t.y-s)<=i)return new K(t.x+1,t.y-s);s++}return null}addWall(t,e,s,i,r,a,o){this.addPlane(vt.PLANE_WALL,t,e,s,[i]),this.addPlane(vt.PLANE_LANDSCAPE,t,e,s,[i]);const h=_t.WALL_THICKNESS*this._wallThicknessMultiplier,_=_t.FLOOR_THICKNESS*this._floorThicknessMultiplier,l=R.crossProduct(e,s),c=R.product(l,1/l.length*-h);if(this.addPlane(vt.PLANE_WALL,R.sum(t,s),e,c,[l,i]),r&&this.addPlane(vt.PLANE_WALL,R.sum(R.sum(t,e),s),R.product(s,-(s.length+_)/s.length),c,[l,i]),a&&(this.addPlane(vt.PLANE_WALL,R.sum(t,R.product(s,-_/s.length)),R.product(s,(s.length+_)/s.length),c,[l,i]),o)){const f=R.product(e,h/e.length);this.addPlane(vt.PLANE_WALL,R.sum(R.sum(t,s),R.product(f,-1)),f,c,[l,e,i])}}addFloor(t,e,s,i,r,a,o){let h,_,l;this.addPlane(vt.PLANE_FLOOR,t,e,s)!=null&&(h=_t.FLOOR_THICKNESS*this._floorThicknessMultiplier,_=new R(0,0,h),l=R.dif(t,_),a&&this.addPlane(vt.PLANE_FLOOR,l,e,_),o&&this.addPlane(vt.PLANE_FLOOR,R.sum(l,R.sum(e,s)),R.product(e,-1),_),i&&this.addPlane(vt.PLANE_FLOOR,R.sum(l,s),R.product(s,-1),_),r&&this.addPlane(vt.PLANE_FLOOR,R.sum(l,e),s,_))}initializeFromMapData(t){if(!t)return!1;this.reset(),this.resetFloorHoles();const e=t.width,s=t.height,i=t.wallHeight,r=t.fixedWallsHeight;if(this.initializeTileMap(e,s),t.tileMap){let a=0;for(;a<t.tileMap.length;){const o=t.tileMap[a];if(o){let h=0;for(;h<o.length;){const _=o[h];_&&this.setTileHeight(h,a,_.height),h++}}a++}}if(t.holeMap&&t.holeMap.length){let a=0;for(;a<t.holeMap.length;){const o=t.holeMap[a];o&&(this.addFloorHole(o.id,o.x,o.y,o.width,o.height),a++)}this.initializeHoleMap()}return this.wallHeight=i,this.restrictsDragging=t.restrictsDragging,this.restrictsScaling=t.restrictsScaling,this.restrictedScale=t.restrictedScale,this.initializeFromTileData(r),!0}addPlane(t,e,s,i,r=null){if(s.length==0||i.length==0)return null;const a=new vt(t,e,s,i,r);return this._planes.push(a),a}getMapData(){const t=new NT;t.width=this._width,t.height=this._height,t.wallHeight=this._wallHeight,t.fixedWallsHeight=this._fixedWallHeight,t.dimensions.minX=this.minX,t.dimensions.maxX=this.maxX,t.dimensions.minY=this.minY,t.dimensions.maxY=this.maxY,t.restrictsDragging=this.restrictsDragging,t.restrictsScaling=this.restrictsScaling,t.restrictedScale=this.restrictedScale;let e=0;for(;e<this._height;){const s=[],i=this._tileMatrixOriginal[e];let r=0;for(;r<this._width;){const a=i[r];s.push({height:a}),r++}t.tileMap.push(s),e++}for(const[s,i]of this._floorHoles.entries())i&&t.holeMap.push({id:s,x:i.x,y:i.y,width:i.width,height:i.height});return t}getPlaneLocation(t){if(t<0||t>=this.planeCount)return null;const e=this._planes[t];return e?e.loc:null}getPlaneNormal(t){if(t<0||t>=this.planeCount)return null;const e=this._planes[t];return e?e.normal:null}getPlaneLeftSide(t){if(t<0||t>=this.planeCount)return null;const e=this._planes[t];return e?e.leftSide:null}getPlaneRightSide(t){if(t<0||t>=this.planeCount)return null;const e=this._planes[t];return e?e.rightSide:null}getPlaneNormalDirection(t){if(t<0||t>=this.planeCount)return null;const e=this._planes[t];return e?e.normalDirection:null}getPlaneSecondaryNormals(t){let e,s;if(t<0||t>=this.planeCount)return null;const i=this._planes[t];if(i!=null){for(e=[],s=0;s<i.secondaryNormalCount;)e.push(i.getSecondaryNormal(s)),s++;return e}return null}getPlaneType(t){if(t<0||t>=this.planeCount)return vt.PLANE_UNDEFINED;const e=this._planes[t];return e?e.type:vt.PLANE_UNDEFINED}getPlaneMaskCount(t){if(t<0||t>=this.planeCount)return 0;const e=this._planes[t];return e?e.maskCount:0}getPlaneMaskLeftSideLoc(t,e){if(t<0||t>=this.planeCount)return-1;const s=this._planes[t];return s?s.getMaskLeftSideLoc(e):-1}getPlaneMaskRightSideLoc(t,e){if(t<0||t>=this.planeCount)return-1;const s=this._planes[t];return s?s.getMaskRightSideLoc(e):-1}getPlaneMaskLeftSideLength(t,e){if(t<0||t>=this.planeCount)return-1;const s=this._planes[t];return s?s.getMaskLeftSideLength(e):-1}getPlaneMaskRightSideLength(t,e){if(t<0||t>=this.planeCount)return-1;const s=this._planes[t];return s?s.getMaskRightSideLength(e):-1}addFloorHole(t,e,s,i,r){this.removeFloorHole(t),this._floorHoles.set(t,new E2(e,s,i,r))}removeFloorHole(t){this._floorHoles.delete(t)}resetFloorHoles(){this._floorHoles.clear()}initializeHoleMap(){let t,e,s,i,r,a,o,h;for(e=0;e<this._height;){for(s=this._floorHoleMatrix[e],t=0;t<this._width;)s[t]=!1,t++;e++}for(const _ of this._floorHoles.values())if(i=_,i!=null)for(r=i.x,a=i.x+i.width-1,o=i.y,h=i.y+i.height-1,r=r<0?0:r,a=a>=this._width?this._width-1:a,o=o<0?0:o,h=h>=this._height?this._height-1:h,e=o;e<=h;){for(s=this._floorHoleMatrix[e],t=r;t<=a;)s[t]=!0,t++;e++}}extractPlanes(t){let e,s,i,r,a,o,h,_,l,c,f,p,m,O,A;const C=t.length,L=t[0].length,D=[];let U=0;for(;U<C;)D[U]=[],U++;let P=0;for(;P<C;){for(e=0;e<L;){if(s=t[P][e],!(s<0||D[P][e])){for(a=e==0||t[P][e-1]!=s,o=P==0||t[P-1][e]!=s,i=e+1;i<L&&!(t[P][i]!=s||D[P][i]||P>0&&t[P-1][i]==s==o);)i++;for(h=i==L||t[P][i]!=s,f=!1,r=P+1;r<C&&!f;){for(_=t[r][e]!=s,f=_||e>0&&t[r][e-1]==s==a||i<L&&t[r][i]==s==h,l=e;l<i;){if(t[r][l]==s==_){f=!0,i=l;break}l++}if(f)break;r++}for(_=_||r==C,h=i==L||t[P][i]!=s,c=P;c<r;){for(l=e;l<i;)D[c][l]=!0,l++;c++}p=e/4-.5,m=P/4-.5,O=(i-e)/4,A=(r-P)/4,this.addFloor(new R(p+O,m+A,s/4),new R(-O,0,0),new R(0,-A,0),h,a,_,o)}e++}P++}}get restrictsDragging(){return this._restrictsDragging}set restrictsDragging(t){this._restrictsDragging=t}get restrictsScaling(){return this._restrictsScaling}set restrictsScaling(t){this._restrictsScaling=t}get restrictedScale(){return this._restrictedScale}set restrictedScale(t){this._restrictedScale=t}};_t.FLOOR_THICKNESS=.25,_t.WALL_THICKNESS=.25,_t.MAX_WALL_ADDITIONAL_HEIGHT=20,_t.TILE_BLOCKED=-110,_t.TILE_HOLE=-100;let kt=_t;class g2 extends el{constructor(){super(),this._planeParser=new kt,this._planeBitmapMaskParser=new DT,this._color=16777215,this._light=255,this._originalColor=16777215,this._originalLight=255,this._targetColor=16777215,this._targetLight=255,this._colorChangedTime=0,this._colorTransitionLength=1500,this._lastHoleUpdate=0,this._needsMapUpdate=!1,this._skipColorTransition=!1}getEventTypes(){const t=[X.MOUSE_MOVE,X.CLICK];return this.mergeTypes(super.getEventTypes(),t)}dispose(){super.dispose(),this._planeParser&&(this._planeParser.dispose(),this._planeParser=null),this._planeBitmapMaskParser&&(this._planeBitmapMaskParser.dispose(),this._planeBitmapMaskParser=null)}initialize(t){!t||!this.object||t instanceof NT&&this._planeParser.initializeFromMapData(t)&&(this.object.model.setValue(g.ROOM_MAP_DATA,t),this.object.model.setValue(g.ROOM_BACKGROUND_COLOR,16777215),this.object.model.setValue(g.ROOM_FLOOR_VISIBILITY,1),this.object.model.setValue(g.ROOM_WALL_VISIBILITY,1),this.object.model.setValue(g.ROOM_LANDSCAPE_VISIBILITY,1),this._skipColorTransition=q.getValue("room.color.skip.transition")===!0)}update(t){if(super.update(t),this.updateBackgroundColor(t),this._needsMapUpdate){if(this._lastHoleUpdate&&t-this._lastHoleUpdate<5)return;const e=this.object&&this.object.model;if(e){const s=this._planeParser.getMapData();e.setValue(g.ROOM_MAP_DATA,s),e.setValue(g.ROOM_FLOOR_HOLE_UPDATE_TIME,t),this._planeParser.initializeFromMapData(s)}this._lastHoleUpdate=0,this._needsMapUpdate=!1}}updateBackgroundColor(t){if(!this.object||!this._colorChangedTime)return;let e=this._color,s=this._light;if(t-this._colorChangedTime>=this._colorTransitionLength)e=this._targetColor,s=this._targetLight,this._colorChangedTime=0;else{let r=this._originalColor>>16&255,a=this._originalColor>>8&255,o=this._originalColor&255;const h=this._targetColor>>16&255,_=this._targetColor>>8&255,l=this._targetColor&255,c=(t-this._colorChangedTime)/this._colorTransitionLength;r=r+(h-r)*c,a=a+(_-a)*c,o=o+(l-o)*c,e=(r<<16)+(a<<8)+o,s=this._originalLight+(this._targetLight-this._originalLight)*c,this._color=e,this._light=s}let i=Xa.rgbToHSL(e);i=(i&16776960)+s,e=Xa.hslToRGB(i),this.object.model&&this.object.model.setValue(g.ROOM_BACKGROUND_COLOR,e)}processUpdateMessage(t){if(!t||!this.object)return;const e=this.object.model;if(e){if(t instanceof ne){this.onObjectRoomUpdateMessage(t,e);return}if(t instanceof de){this.onObjectRoomMaskUpdateMessage(t,e);return}if(t instanceof Oi){this.onObjectRoomPlaneVisibilityUpdateMessage(t,e);return}if(t instanceof Ri){this.onObjectRoomPlanePropertyUpdateMessage(t,e);return}if(t instanceof pi){this.onObjectRoomFloorHoleUpdateMessage(t,e);return}if(t instanceof $a){this.onObjectRoomColorUpdateMessage(t,e);return}t instanceof th&&this.onObjectRoomMapUpdateMessage(t)}}onObjectRoomUpdateMessage(t,e){switch(t.type){case ne.ROOM_FLOOR_UPDATE:e.setValue(g.ROOM_FLOOR_TYPE,t.value);return;case ne.ROOM_WALL_UPDATE:e.setValue(g.ROOM_WALL_TYPE,t.value);return;case ne.ROOM_LANDSCAPE_UPDATE:e.setValue(g.ROOM_LANDSCAPE_TYPE,t.value);return}}onObjectRoomMaskUpdateMessage(t,e){let s=null,i=!1;switch(t.type){case de.ADD_MASK:s=Hr.WINDOW,t.maskCategory===de.HOLE&&(s=Hr.HOLE),this._planeBitmapMaskParser.addMask(t.maskId,t.maskType,t.maskLocation,s),i=!0;break;case de.REMOVE_MASK:i=this._planeBitmapMaskParser.removeMask(t.maskId);break}i&&e.setValue(g.ROOM_PLANE_MASK_XML,this._planeBitmapMaskParser.getXML())}onObjectRoomPlaneVisibilityUpdateMessage(t,e){let s=0;switch(t.visible&&(s=1),t.type){case Oi.FLOOR_VISIBILITY:e.setValue(g.ROOM_FLOOR_VISIBILITY,s);return;case Oi.WALL_VISIBILITY:e.setValue(g.ROOM_WALL_VISIBILITY,s),e.setValue(g.ROOM_LANDSCAPE_VISIBILITY,s);return}}onObjectRoomPlanePropertyUpdateMessage(t,e){switch(t.type){case Ri.FLOOR_THICKNESS:e.setValue(g.ROOM_FLOOR_THICKNESS,t.value);return;case Ri.WALL_THICKNESS:e.setValue(g.ROOM_WALL_THICKNESS,t.value);return}}onObjectRoomFloorHoleUpdateMessage(t,e){switch(t.type){case pi.ADD:this._planeParser.addFloorHole(t.id,t.x,t.y,t.width,t.height),this._needsMapUpdate=!0;return;case pi.REMOVE:this._planeParser.removeFloorHole(t.id),this._needsMapUpdate=!0;return}this._lastHoleUpdate=this.time}onObjectRoomColorUpdateMessage(t,e){!t||!e||(this._originalColor=this._color,this._originalLight=this._light,this._targetColor=t.color,this._targetLight=t.light,this._colorChangedTime=this.time,this._skipColorTransition?this._colorTransitionLength=0:this._colorTransitionLength=1500,e.setValue(g.ROOM_COLORIZE_BG_ONLY,t.backgroundOnly))}onObjectRoomMapUpdateMessage(t){!t||!t.mapData||(this.object.model.setValue(g.ROOM_MAP_DATA,t.mapData),this.object.model.setValue(g.ROOM_FLOOR_HOLE_UPDATE_TIME,this.time),this._planeParser.initializeFromMapData(t.mapData))}mouseEvent(t,e){if(!t||!e||!this.object||!this.object.model)return;const s=t.spriteTag;let i=0;if(s&&s.indexOf("@")>=0&&(i=parseInt(s.substr(s.indexOf("@")+1))),i<1||i>this._planeParser.planeCount){t.type===z.ROLL_OUT&&this.object.model.setValue(g.ROOM_SELECTED_PLANE,0);return}i--;let r=null;const a=this._planeParser.getPlaneLocation(i),o=this._planeParser.getPlaneLeftSide(i),h=this._planeParser.getPlaneRightSide(i),_=this._planeParser.getPlaneNormalDirection(i),l=this._planeParser.getPlaneType(i);if(a==null||o==null||h==null||_==null)return;const c=o.length,f=h.length;if(c==0||f==0)return;const p=t.screenX,m=t.screenY,O=new K(p,m);if(r=e.getPlanePosition(O,a,o,h),!r){this.object.model.setValue(g.ROOM_SELECTED_PLANE,0);return}const A=R.product(o,r.x/c);A.add(R.product(h,r.y/f)),A.add(a);const C=A.x,L=A.y,D=A.z;if(r.x>=0&&r.x<c&&r.y>=0&&r.y<f)this.object.model.setValue(g.ROOM_SELECTED_X,C),this.object.model.setValue(g.ROOM_SELECTED_Y,L),this.object.model.setValue(g.ROOM_SELECTED_Z,D),this.object.model.setValue(g.ROOM_SELECTED_PLANE,i+1);else{this.object.model.setValue(g.ROOM_SELECTED_PLANE,0);return}let U=null;switch(t.type===z.MOUSE_MOVE||t.type===z.ROLL_OVER?U=X.MOUSE_MOVE:t.type===z.MOUSE_CLICK&&(U=X.CLICK),t.type){case z.MOUSE_MOVE:case z.ROLL_OVER:case z.MOUSE_CLICK:{let P=null;if(l===vt.PLANE_FLOOR)P=new $s(U,this.object,t.eventId,C,L,D,t.altKey,t.ctrlKey,t.shiftKey,t.buttonDown);else if(l===vt.PLANE_WALL||l===vt.PLANE_LANDSCAPE){let v=90;_&&(v=_.x+90,v>360&&(v-=360));const F=o.length*r.x/c,$=h.length*r.y/f;P=new Xr(U,this.object,t.eventId,a,o,h,F,$,v,t.altKey,t.ctrlKey,t.shiftKey,t.buttonDown)}this.eventDispatcher&&this.eventDispatcher.dispatchEvent(P);return}}}}class f2 extends el{initialize(t){this.object&&(this.object.model.setValue(g.FURNITURE_ALPHA_MULTIPLIER,1),this.object.setState(1,0))}processUpdateMessage(t){if(super.processUpdateMessage(t),t instanceof Ai&&this.object)switch(t.type){case Ai.ENABLED:this.object.setState(0,0);return;case Ai.DISABLED:this.object.setState(1,0);return}}}const Gs=class Gs extends el{constructor(){super(),this._lastEventId=null,this._isHidden=!1}initialize(t){this.object&&(this.object.model.setValue(g.FURNITURE_ALPHA_MULTIPLIER,1),this.object.setState(Gs.CURSOR_HIDDEN_STATE,0))}processUpdateMessage(t){t instanceof qr&&(this._lastEventId&&this._lastEventId===t.sourceEventId||(t.toggleVisibility&&(this._isHidden=!this._isHidden),super.processUpdateMessage(t),this.object&&(this._isHidden?this.object.setState(Gs.CURSOR_HIDDEN_STATE,0):t.visible?(this.object.model.setValue(g.TILE_CURSOR_HEIGHT,t.height),this.object.setState(t.height>.8?Gs.CURSOR_HEIGHT_STATE:Gs.CURSOR_VISIBLE_STATE)):this.object.setState(Gs.CURSOR_HIDDEN_STATE,0)),this._lastEventId=t.sourceEventId))}};Gs.CURSOR_VISIBLE_STATE=0,Gs.CURSOR_HIDDEN_STATE=1,Gs.CURSOR_HEIGHT_STATE=6;let qu=Gs;class LT{constructor(t,e,s){this._id=t,this._type=e,this._visualization=s}dispose(){this._visualization=null}update(t,e){}animate(t){return!1}get id(){return this._id}get type(){return this._type}get visualization(){return this._visualization}}const xe=class xe extends LT{constructor(t,e,s){super(t,e,s),this._asset=null,this._startTime=nt(),this._delta=0,this._offsetY=0,this._scale=0,this._state=0}update(t,e){if(!t)return;this._scale=e;let s=64,i=0;if(e<48?(this._asset=this.visualization.getAvatarRenderAsset("avatar_addition_user_blowkiss_small"),this.visualization.angle===90||this.visualization.angle===270?i=0:this.visualization.angle===135||this.visualization.angle===180||this.visualization.angle===225?i=6:i=-6,this._offsetY=-38,s=32):(this._asset=this.visualization.getAvatarRenderAsset("avatar_addition_user_blowkiss"),this.visualization.angle===90||this.visualization.angle===270?i=-3:this.visualization.angle===135||this.visualization.angle===180||this.visualization.angle===225?i=22:i=-30,this._offsetY=-70),this.visualization.posture===H.POSTURE_SIT?this._offsetY+=s/2:this.visualization.posture===H.POSTURE_LAY&&(this._offsetY+=s),this._asset){t.texture=this._asset,t.offsetX=i,t.offsetY=this._offsetY,t.relativeDepth=-.02,t.alpha=0;const r=this._delta;this.animate(t),this._delta=r}}animate(t){if(!t)return!1;if(this._asset&&(t.texture=this._asset),this._state===xe.STATE_DELAY)return nt()-this._startTime<xe.DELAY_BEFORE_ANIMATION?!1:(this._state=xe.STATE_FADE_IN,t.alpha=0,t.visible=!0,this._delta=0,!0);if(this._state===xe.STATE_FADE_IN)return this._delta+=.1,t.offsetY=this._offsetY,t.alpha=Math.pow(this._delta,.9)*255,this._delta>=1&&(t.alpha=255,this._delta=0,this._state=xe.STATE_FLOAT),!0;if(this._state===xe.STATE_FLOAT){const e=Math.pow(this._delta,.9);this._delta+=.05;const s=this._scale<48?-30:-40;return t.offsetY=this._offsetY+(this._delta<1?e:1)*s,t.alpha=(1-e)*255,t.alpha<=0&&(t.visible=!1,this._state=xe.STATE_COMPLETE),!0}return!1}};xe.DELAY_BEFORE_ANIMATION=300,xe.STATE_DELAY=0,xe.STATE_FADE_IN=1,xe.STATE_FLOAT=2,xe.STATE_COMPLETE=3;let Qu=xe;const Lr=class Lr{static getExpressionAddition(t,e,s){switch(e){case this.BLOW:return new Qu(t,this.BLOW,s);default:return new LT(t,e,s)}}};Lr.WAVE=1,Lr.BLOW=2,Lr.LAUGH=3,Lr.CRY=4,Lr.IDLE=5;let Ju=Lr;const _e=class _e{constructor(t,e){this._id=t,this._visualization=e,this._asset=null,this._startTime=nt(),this._offsetY=0,this._scale=0,this._state=0}dispose(){this._visualization=null,this._asset=null}getSpriteAssetName(t){let e="left";return(this._visualization.angle===135||this._visualization.angle===180||this._visualization.angle===225||this._visualization.angle===270)&&(e="right"),"avatar_addition_user_idle_"+e+"_"+t+(this._scale<48?"_small":"")}update(t,e){if(!t)return;this._scale=e,this._asset=this._visualization.getAvatarRenderAsset(this.getSpriteAssetName(this._state===_e.STATE_FRAME_A?1:2));let s=64,i=0;e<48?(this._visualization.angle===135||this._visualization.angle===180||this._visualization.angle===225||this._visualization.angle===270?i=10:i=-16,this._offsetY=-38,s=32):(this._visualization.angle===135||this._visualization.angle===180||this._visualization.angle===225||this._visualization.angle===270?i=22:i=-30,this._offsetY=-70),this._visualization.posture===H.POSTURE_SIT?this._offsetY+=s/2:this._visualization.posture===H.POSTURE_LAY&&(this._offsetY+=s-.3*s),this._asset&&(t.texture=this._asset,t.offsetX=i,t.offsetY=this._offsetY,t.relativeDepth=-.02,t.alpha=0)}animate(t){if(!t)return!1;const e=nt();return this._state===_e.STATE_DELAY&&e-this._startTime>=_e.DELAY_BEFORE_ANIMATION&&(this._state=_e.STATE_FRAME_A,this._startTime=e,this._asset=this._visualization.getAvatarRenderAsset(this.getSpriteAssetName(1))),this._state===_e.STATE_FRAME_A&&e-this._startTime>=_e.DELAY_PER_FRAME&&(this._state=_e.STATE_FRAME_B,this._startTime=e,this._asset=this._visualization.getAvatarRenderAsset(this.getSpriteAssetName(2))),this._state===_e.STATE_FRAME_B&&e-this._startTime>=_e.DELAY_PER_FRAME&&(this._state=_e.STATE_FRAME_A,this._startTime=e,this._asset=this._visualization.getAvatarRenderAsset(this.getSpriteAssetName(1))),this._asset?(t.texture=this._asset,t.alpha=255,t.visible=!0):t.visible=!1,!1}get id(){return this._id}};_e.DELAY_BEFORE_ANIMATION=2e3,_e.DELAY_PER_FRAME=2e3,_e.STATE_DELAY=0,_e.STATE_FRAME_A=1,_e.STATE_FRAME_B=2;let Zu=_e;const Bs=class Bs{constructor(t){this._id=t,this._asset=null,this._disposed=!1}dispose(){this._asset=null}update(t,e){if(t){if(!this._asset){const s=new bt(Ft.WHITE);s.alpha=0,s.width=Bs.WIDTH,s.height=Bs.HEIGHT,this._asset=Ut.generateTexture(s)}t.visible=!0,t.texture=this._asset,t.offsetX=Bs.OFFSET_X,t.offsetY=Bs.OFFSET_Y,t.alphaTolerance=Os.MATCH_ALL_PIXELS}}animate(t){return!1}get id(){return this._id}};Bs.WIDTH=46,Bs.HEIGHT=60,Bs.OFFSET_X=-23,Bs.OFFSET_Y=-48;let $u=Bs;class I2{constructor(t,e,s){this._id=t,this._visualization=e,this._asset=null,this._relativeDepth=0,this._status=s}dispose(){this._visualization=null,this._asset=null}update(t,e){if(!t)return;t.visible=!0,t.relativeDepth=this._relativeDepth,t.alpha=255;let s=64,i=0,r=0;this._asset=this._visualization.getAvatarRenderAsset(this._status===Ws.GUIDE?"avatar_addition_user_guide_bubble":"avatar_addition_user_guide_requester_bubble"),e<48?(i=-19,r=-80,s=32):(i=-19,r=-120),this._visualization.posture===H.POSTURE_SIT?r+=s/2:this._visualization.posture===H.POSTURE_LAY&&(r+=e),this._asset&&(t.texture=this._asset,t.offsetX=i,t.offsetY=r,t.relativeDepth=-.02+0)}animate(t){return this._asset&&t&&(t.texture=this._asset),!1}get id(){return this._id}get relativeDepth(){return this._relativeDepth}set relativeDepth(t){this._relativeDepth=t}}class T2{constructor(t,e){this._id=t,this._visualization=e,this._asset=null}dispose(){this._visualization=null,this._asset=null}update(t,e){if(!t)return;let s=64,i=0,r=0;e<48?(this._asset=this._visualization.getAvatarRenderAsset("avatar_addition_user_muted_small"),s=32,i=-12,r=-66):(this._asset=this._visualization.getAvatarRenderAsset("avatar_addition_user_muted"),i=-15,r=-110),this._visualization.posture===H.POSTURE_SIT?r+=s/2:this._visualization.posture===H.POSTURE_LAY&&(r+=e),this._asset?(t.visible=!0,t.texture=this._asset,t.offsetX=i,t.offsetY=r,t.relativeDepth=-.02):t.visible=!1}animate(t){return this._asset&&t&&(t.texture=this._asset),!1}get id(){return this._id}}class m2{constructor(t,e,s){this._id=t,this._visualization=s,this._asset=null,this._scale=0,this._number=e,this._numberValueFadeDirection=0,this._numberValueMoving=!1,this._numberValueMoveCounter=0}dispose(){this._visualization=null,this._asset=null}update(t,e){if(!t)return;this._scale=e;let s=64,i=0,r=0;this._number>0?(e<48?(this._asset=this._visualization.getAvatarRenderAsset("avatar_addition_number_"+this._number+"_small"),s=32,i=-6,r=-52):(this._asset=this._visualization.getAvatarRenderAsset("avatar_addition_number_"+this._number),i=-8,r=-105),this._visualization.posture===H.POSTURE_SIT?r+=s/2:this._visualization.posture===H.POSTURE_LAY&&(r+=e),this._asset?(t.visible=!0,t.texture=this._asset,t.offsetX=i,t.offsetY=r,t.relativeDepth=-.01,t.alpha=0,this._numberValueFadeDirection=1,this._numberValueMoving=!0,this._numberValueMoveCounter=0):t.visible=!1):t.visible&&(this._numberValueFadeDirection=-1)}animate(t){if(!t)return!1;this._asset&&(t.texture=this._asset);let e=t.alpha,s=!1;if(this._numberValueMoving){if(this._numberValueMoveCounter++,this._numberValueMoveCounter<10)return!1;if(this._numberValueFadeDirection<0)this._scale<48?t.offsetY-=2:t.offsetY-=4;else{let i=4;this._scale<48&&(i=8),this._numberValueMoveCounter%i||(t.offsetY--,s=!0)}}return this._numberValueFadeDirection>0?(e<255&&(e+=32),e>=255&&(e=255,this._numberValueFadeDirection=0),t.alpha=e,!0):this._numberValueFadeDirection<0?(e>=0&&(e-=32),e<=0&&(this._numberValueFadeDirection=0,this._numberValueMoving=!1,e=0,t.visible=!1),t.alpha=e,!0):s}get id(){return this._id}}class p2{constructor(t,e){this._id=t,this._visualization=e,this._asset=null,this._relativeDepth=0}dispose(){this._visualization=null,this._asset=null}update(t,e){if(!t)return;t.visible=!0,t.relativeDepth=this._relativeDepth,t.alpha=255;let s=64,i=0,r=0;e<48?(this._asset=this._visualization.getAvatarRenderAsset("avatar_addition_user_typing_small"),i=3,r=-42,s=32):(this._asset=this._visualization.getAvatarRenderAsset("avatar_addition_user_typing"),i=14,r=-83),this._visualization.posture===H.POSTURE_SIT?r+=s/2:this._visualization.posture===H.POSTURE_LAY&&(r+=e),this._asset&&(t.texture=this._asset,t.offsetX=i,t.offsetY=r,t.relativeDepth=-.02+0)}animate(t){return this._asset&&t&&(t.texture=this._asset),!1}get id(){return this._id}get relativeDepth(){return this._relativeDepth}set relativeDepth(t){this._relativeDepth=t}}class rh extends Ye{constructor(){super()}initialize(t){return!0}onDispose(){this._avatarRenderer=null}createAvatarImage(t,e,s=null,i=null,r=null){let a=null;return e>48?a=this._avatarRenderer.createAvatarImage(t,Ks.LARGE,s,i,r):a=this._avatarRenderer.createAvatarImage(t,Ks.SMALL,s,i,r),a}getAvatarRendererAsset(t){return this._avatarRenderer?this._avatarRenderer.assets.getTexture(t):null}get avatarManager(){return this._avatarRenderer}set avatarManager(t){this._avatarRenderer=t}get layerCount(){return 0}}const B=class B extends jn{constructor(){super(),this._data=null,this._avatarImage=null,this._cachedAvatars=new Xt,this._cachedAvatarEffects=new Xt,this._shadow=null,this._lastUpdate=-1e3,this._disposed=!1,this._figure=null,this._gender=null,this._direction=-1,this._headDirection=-1,this._posture="",this._postureParameter="",this._canStandUp=!1,this._postureOffset=0,this._verticalOffset=0,this._angle=-1,this._headAngle=-1,this._talk=!1,this._expression=0,this._sleep=!1,this._blink=!1,this._gesture=0,this._sign=-1,this._highlightEnabled=!1,this._highlight=!1,this._dance=0,this._effect=0,this._carryObject=0,this._useObject=0,this._ownUser=!1,this._isLaying=!1,this._layInside=!1,this._isAnimating=!1,this._extraSpritesStartIndex=2,this._forcedAnimFrames=0,this._updatesUntilFrameUpdate=0,this._isAvatarReady=!1,this._needsUpdate=!1,this._geometryUpdateCounter=-1,this._additions=new Map}initialize(t){return t instanceof rh?(this._data=t,this.createSprites(B.INITIAL_RESERVED_SPRITES),super.initialize(t),!0):!1}dispose(){this._disposed||(super.dispose(),this._avatarImage&&this._avatarImage.dispose(),this._shadow=null,this._disposed=!0)}update(t,e,s,i){if(!this.object||!t||!this._data||e<this._lastUpdate+B.UPDATE_TIME_INCREASER)return;this._lastUpdate+=B.UPDATE_TIME_INCREASER,this._lastUpdate+B.UPDATE_TIME_INCREASER<e&&(this._lastUpdate=e-B.UPDATE_TIME_INCREASER);const r=this.object.model,a=t.scale,o=this._effect;let h=!1,_=!1,l=!1,c=!1;const f=this.updateModel(r,a);if(f||a!==this._scale||!this._avatarImage){if(a!==this._scale&&(h=!0,this.updateScale(a)),o!==this._effect&&(_=!0),h||!this._avatarImage||_){if(this._avatarImage=this.createAvatarImage(a,this._effect),!this._avatarImage)return;l=!0;const O=this.getSprite(B.AVATAR_LAYER_ID);O&&this._avatarImage&&this._avatarImage.isPlaceholder()?O.alpha=150:O&&(O.alpha=255)}if(!this._avatarImage)return;if(_&&this._avatarImage.animationHasResetOnToggle&&this._avatarImage.resetAnimationFrameCounter(),this.updateShadow(a),c=this.updateObject(this.object,t,s,!0),this.processActionsForAvatar(this._avatarImage),this._additions){let O=this._extraSpritesStartIndex;for(const A of this._additions.values())A.update(this.getSprite(O++),a)}this._scale=a}else c=this.updateObject(this.object,t,s);if(this._additions){let O=this._extraSpritesStartIndex;for(const A of this._additions.values())A.animate(this.getSprite(O++))&&this.updateSpriteCounter++}const p=c||f||h,m=(this._isAnimating||this._forcedAnimFrames>0)&&s;if(p&&(this._forcedAnimFrames=B.ANIMATION_FRAME_UPDATE_INTERVAL),p||m){if(this.updateSpriteCounter++,this._forcedAnimFrames--,this._updatesUntilFrameUpdate--,this._updatesUntilFrameUpdate<=0||h||f||l)this._avatarImage.updateAnimationByFrames(1),this._updatesUntilFrameUpdate=B.ANIMATION_FRAME_UPDATE_INTERVAL;else return;let O=this._avatarImage.getCanvasOffsets();(!O||O.length<3)&&(O=B.DEFAULT_CANVAS_OFFSETS);const A=this.getSprite(B.SPRITE_INDEX_AVATAR);if(A){const U=this.object.model.getValue(g.FIGURE_HIGHLIGHT_ENABLE)===1&&this.object.model.getValue(g.FIGURE_HIGHLIGHT)===1,P=this._avatarImage.getImage(Ce.FULL,U);P&&(A.texture=P,U||(A.filters=[])),A.texture&&(A.offsetX=-1*a/2+O[0]-(A.texture.width-a)/2,A.offsetY=-A.texture.height+a/4+O[1]+this._postureOffset),this._isLaying?this._layInside?A.relativeDepth=-.5:A.relativeDepth=B.AVATAR_SPRITE_LAYING_DEPTH+O[2]:A.relativeDepth=B.AVATAR_SPRITE_DEFAULT_DEPTH+O[2],this._ownUser?(A.relativeDepth-=B.AVATAR_OWN_DEPTH_ADJUST,A.spriteType=Je.AVATAR_OWN):A.spriteType=Je.AVATAR}const C=this.getAddition(B.TYPING_BUBBLE_ID);C&&(this._isLaying?C.relativeDepth=B.AVATAR_SPRITE_LAYING_DEPTH-.01+O[2]:C.relativeDepth=B.AVATAR_SPRITE_DEFAULT_DEPTH-.01+O[2]),this._isAnimating=this._avatarImage.isAnimating();let L=B.INITIAL_RESERVED_SPRITES;const D=this._avatarImage.getDirection();for(const U of this._avatarImage.getSprites())if(U.id===B.AVATAR){const P=this.getSprite(B.SPRITE_INDEX_AVATAR);if(P){const v=this._avatarImage.getLayerData(U);let F=U.getDirectionOffsetX(D),$=U.getDirectionOffsetY(D);v&&(F+=v.dx,$+=v.dy),a<48&&(F/=2,$/=2),this._canStandUp||(P.offsetX+=F,P.offsetY+=$)}}else{const P=this.getSprite(L);if(P){P.alphaTolerance=Os.MATCH_NOTHING,P.visible=!0;const v=this._avatarImage.getLayerData(U);let F=0,$=U.getDirectionOffsetX(D),et=U.getDirectionOffsetY(D);const at=U.getDirectionOffsetZ(D);let At=0;U.hasDirections&&(At=D),v&&(F=v.animationFrame,$+=v.dx,et+=v.dy,At+=v.dd),a<48&&($/=2,et/=2),At<0?At+=8:At>7&&(At-=8);const oe=this._avatarImage.getScale()+"_"+U.member+"_"+At+"_"+F,zt=this._avatarImage.getAsset(oe);if(!zt)continue;P.texture=zt.texture,P.offsetX=zt.offsetX-a/2+$,P.offsetY=zt.offsetY+et,P.flipH=zt.flipH,U.hasStaticY?P.offsetY+=this._verticalOffset*a/(2*B.BASE_Y_SCALE):P.offsetY+=this._postureOffset,this._isLaying?P.relativeDepth=B.AVATAR_SPRITE_LAYING_DEPTH-.001*this.totalSprites*at:P.relativeDepth=B.AVATAR_SPRITE_DEFAULT_DEPTH-.001*this.totalSprites*at,U.ink===33?P.blendMode=gi.ADD:P.blendMode=gi.NORMAL}L++}}}createAvatarImage(t,e){let s=null,i="avatarImage"+t.toString();if(e?(i+="-"+e,s=this._cachedAvatarEffects.getValue(i)):s=this._cachedAvatars.getValue(i),!s&&(s=this._data.createAvatarImage(this._figure,t,this._gender,this,this),s))if(!e)this._cachedAvatars.add(i,s);else{if(this._cachedAvatarEffects.length>=B.MAX_EFFECT_CACHE){const r=this._cachedAvatarEffects.remove(this._cachedAvatarEffects.getKey(0));r&&r.dispose()}this._cachedAvatarEffects.add(i,s)}return s}updateObject(t,e,s,i=!1){if(!i&&this.updateObjectCounter===t.updateCounter&&this._geometryUpdateCounter===e.updateId)return!1;let r=t.getDirection().x-e.direction.x,a=this._headDirection-e.direction.x;return this._posture==="float"&&(a=r),r=(r%360+360)%360,a=(a%360+360)%360,this._posture==="sit"&&this._canStandUp&&(r-=r%90-45,a-=a%90-45),(r!==this._angle||i)&&(s=!0,this._angle=r,r=r-(135-22.5),r=(r+360)%360,this._avatarImage.setDirectionAngle(Ce.FULL,r)),(a!==this._headAngle||i)&&(s=!0,this._headAngle=a,this._headAngle!==this._angle&&(a=a-(135-22.5),a=(a+360)%360,this._avatarImage.setDirectionAngle(Ce.HEAD,a))),this._geometryUpdateCounter=e.updateId,this.updateObjectCounter=this.object.updateCounter,s}updateModel(t,e){if(!t||this.updateModelCounter===t.updateCounter)return!1;let s=!1;const i=t.getValue(g.FIGURE_TALK)>0;i!==this._talk&&(this._talk=i,s=!0);const r=t.getValue(g.FIGURE_EXPRESSION);r!==this._expression&&(this._expression=r,s=!0);const a=t.getValue(g.FIGURE_SLEEP)>0;a!==this._sleep&&(this._sleep=a,s=!0);const o=t.getValue(g.FIGURE_BLINK)>0;o!==this._blink&&(this._blink=o,s=!0);const h=t.getValue(g.FIGURE_GESTURE)||0;h!==this._gesture&&(this._gesture=h,s=!0);const _=t.getValue(g.FIGURE_POSTURE);_!==this._posture&&(this._posture=_,s=!0);const l=t.getValue(g.FIGURE_POSTURE_PARAMETER);l!==this._postureParameter&&(this._postureParameter=l,s=!0);const c=t.getValue(g.FIGURE_CAN_STAND_UP);c!==this._canStandUp&&(this._canStandUp=c,s=!0);const f=t.getValue(g.FIGURE_VERTICAL_OFFSET)*B.BASE_Y_SCALE;f!==this._verticalOffset&&(this._verticalOffset=f,s=!0);const p=t.getValue(g.FIGURE_DANCE)||0;p!==this._dance&&(this._dance=p,s=!0);const m=t.getValue(g.FIGURE_EFFECT)||0;m!==this._effect&&(this._effect=m,s=!0);const O=t.getValue(g.FIGURE_CARRY_OBJECT)||0;O!==this._carryObject&&(this._carryObject=O,s=!0);const A=t.getValue(g.FIGURE_USE_OBJECT)||0;A!==this._useObject&&(this._useObject=A,s=!0);const C=t.getValue(g.HEAD_DIRECTION);C!==this._headDirection&&(this._headDirection=C,s=!0),this._carryObject>0&&A>0?this._useObject!==this._carryObject&&(this._useObject=this._carryObject,s=!0):this._useObject!==0&&(this._useObject=0,s=!0);let L=this.getAddition(B.FLOATING_IDLE_Z_ID);this._sleep?(L||(L=this.addAddition(new Zu(B.FLOATING_IDLE_Z_ID,this))),s=!0):L&&this.removeAddition(B.FLOATING_IDLE_Z_ID);const D=t.getValue(g.FIGURE_IS_MUTED)>0;let U=this.getAddition(B.MUTED_BUBBLE_ID);if(D)U||(U=this.addAddition(new T2(B.MUTED_BUBBLE_ID,this))),s=!0;else{U&&(this.removeAddition(B.MUTED_BUBBLE_ID),s=!0);const Ms=t.getValue(g.FIGURE_IS_TYPING)>0;let Zs=this.getAddition(B.TYPING_BUBBLE_ID);Ms?(Zs||(Zs=this.addAddition(new p2(B.TYPING_BUBBLE_ID,this))),s=!0):Zs&&(this.removeAddition(B.TYPING_BUBBLE_ID),s=!0)}const P=t.getValue(g.FIGURE_GUIDE_STATUS)||0;P!==Ws.NONE?(this.removeAddition(B.GUIDE_BUBBLE_ID),this.addAddition(new I2(B.GUIDE_BUBBLE_ID,this,P)),s=!0):this.getAddition(B.GUIDE_BUBBLE_ID)&&(this.removeAddition(B.GUIDE_BUBBLE_ID),s=!0);const v=t.getValue(g.FIGURE_IS_PLAYING_GAME)>0;let F=this.getAddition(B.GAME_CLICK_TARGET_ID);v?(F||(F=this.addAddition(new $u(B.GAME_CLICK_TARGET_ID))),s=!0):F&&this.removeAddition(B.GAME_CLICK_TARGET_ID);const $=t.getValue(g.FIGURE_NUMBER_VALUE);let et=this.getAddition(B.NUMBER_BUBBLE_ID);$>0?(et||(et=this.addAddition(new m2(B.NUMBER_BUBBLE_ID,$,this))),s=!0):et&&this.removeAddition(B.NUMBER_BUBBLE_ID);let at=this.getAddition(B.EXPRESSION_ID);this._expression>0?at||(at=Ju.getExpressionAddition(B.EXPRESSION_ID,this._expression,this),at&&this.addAddition(at)):at&&this.removeAddition(B.EXPRESSION_ID),this.updateScale(e);const At=t.getValue(g.GENDER);At!==this._gender&&(this._gender=At,s=!0),this.updateFigure(t.getValue(g.FIGURE))&&(s=!0);let oe=t.getValue(g.FIGURE_SIGN);oe===null&&(oe=-1),this._sign!==oe&&(this._sign=oe,s=!0);const zt=t.getValue(g.FIGURE_HIGHLIGHT_ENABLE)>0;if(zt!==this._highlightEnabled&&(this._highlightEnabled=zt,s=!0),this._highlightEnabled){const Ms=t.getValue(g.FIGURE_HIGHLIGHT)>0;Ms!==this._highlight&&(this._highlight=Ms,s=!0)}const ds=t.getValue(g.OWN_USER)>0;return ds!==this._ownUser&&(this._ownUser=ds,s=!0),this.updateModelCounter=t.updateCounter,s}setDirection(t){this._direction!==t&&(this._direction=t,this._needsUpdate=!0)}updateScale(t){t<48&&(this._blink=!1),this._posture==="sit"||this._posture==="lay"?this._postureOffset=t/2:this._postureOffset=0,this._layInside=!1,this._isLaying=!1,this._posture==="lay"&&(this._isLaying=!0,parseInt(this._postureParameter)<0&&(this._layInside=!0))}processActionsForAvatar(t){if(!t)return;if(t.initActionAppends(),t.appendAction(H.POSTURE,this._posture,this._postureParameter),this._gesture>0&&this._avatarImage.appendAction(H.GESTURE,H.getGesture(this._gesture)),this._dance>0&&this._avatarImage.appendAction(H.DANCE,this._dance),this._sign>-1&&this._avatarImage.appendAction(H.SIGN,this._sign),this._carryObject>0&&this._avatarImage.appendAction(H.CARRY_OBJECT,this._carryObject),this._useObject>0&&this._avatarImage.appendAction(H.USE_OBJECT,this._useObject),this._talk&&this._avatarImage.appendAction(H.TALK),(this._sleep||this._blink)&&this._avatarImage.appendAction(H.SLEEP),this._expression>0){const s=H.getExpression(this._expression);if(s!=="")switch(s){case H.DANCE:this._avatarImage.appendAction(H.DANCE,2);break;default:this._avatarImage.appendAction(s);break}}this._effect>0&&this._avatarImage.appendAction(H.EFFECT,this._effect),t.endActionAppends(),this._isAnimating=t.isAnimating();let e=B.INITIAL_RESERVED_SPRITES;for(const s of this._avatarImage.getSprites())s.id!==B.AVATAR&&e++;if(e!==this.totalSprites&&this.createSprites(e),this._extraSpritesStartIndex=e,this._additions)for(const s of this._additions.values())this.createSprite()}updateFigure(t){return this._figure===t?!1:(this._figure=t,this.clearAvatar(),!0)}resetFigure(t){this.clearAvatar()}resetEffect(t){this.clearAvatar()}clearAvatar(){for(const e of this._cachedAvatars.getValues())e&&e.dispose();for(const e of this._cachedAvatarEffects.getValues())e&&e.dispose();this._cachedAvatars.reset(),this._cachedAvatarEffects.reset(),this._avatarImage=null;const t=this.getSprite(B.AVATAR_LAYER_ID);t&&(t.texture=Ft.EMPTY,t.alpha=255)}getAddition(t){if(!this._additions)return null;const e=this._additions.get(t);return e||null}addAddition(t){if(!this.getAddition(t.id))return this._additions.set(t.id,t),t}removeAddition(t){const e=this.getAddition(t);e&&(this._additions.delete(e.id),e.dispose())}updateShadow(t){this._shadow=null;const e=this.getSprite(B.SHADOW_LAYER_ID);if(!e)return;let s=this._posture==="mv"||this._posture==="std"||this._posture==="sit"&&this._canStandUp;if(this._effect===B.SNOWBOARDING_EFFECT&&(s=!1),s){if(e.visible=!0,!this._shadow||t!==this._scale){let i=0,r=0;t<48?(e.libraryAssetName="sh_std_sd_1_0_0",this._shadow=this._avatarImage.getAsset(e.libraryAssetName),i=-8,r=this._canStandUp?6:-3):(e.libraryAssetName="h_std_sd_1_0_0",this._shadow=this._avatarImage.getAsset(e.libraryAssetName),i=-17,r=this._canStandUp?10:-7),this._shadow?(e.texture=this._shadow.texture,e.offsetX=i,e.offsetY=r,e.alpha=50,e.relativeDepth=1):e.visible=!1}}else this._shadow=null,e.visible=!1}getAvatarRenderAsset(t){return this._data?this._data.getAvatarRendererAsset(t):null}get direction(){return this._direction}get posture(){return this._posture}get angle(){return this._angle}get disposed(){return this._disposed}};B.AVATAR="avatar",B.FLOATING_IDLE_Z_ID=1,B.TYPING_BUBBLE_ID=2,B.EXPRESSION_ID=3,B.NUMBER_BUBBLE_ID=4,B.GAME_CLICK_TARGET_ID=5,B.MUTED_BUBBLE_ID=6,B.GUIDE_BUBBLE_ID=7,B.OWN_USER_ID=4,B.UPDATE_TIME_INCREASER=41,B.AVATAR_LAYER_ID=0,B.SHADOW_LAYER_ID=1,B.SNOWBOARDING_EFFECT=97,B.INITIAL_RESERVED_SPRITES=2,B.ANIMATION_FRAME_UPDATE_INTERVAL=2,B.DEFAULT_CANVAS_OFFSETS=[0,0,0],B.MAX_EFFECT_CACHE=2,B.SPRITE_INDEX_AVATAR=0,B.BASE_Y_SCALE=1e3,B.AVATAR_SPRITE_DEFAULT_DEPTH=-.01,B.AVATAR_OWN_DEPTH_ADJUST=.001,B.AVATAR_SPRITE_LAYING_DEPTH=-.409;let td=B;const Ge=class Ge{static allocate(t,e,s,i,r,a,o=-1,h=0){const _=Ge.POOL.length?Ge.POOL.pop():new Ge;return i<1&&(i=1),r<0&&(r=Ge.FRAME_REPEAT_FOREVER),_._id=t,_._x=e||0,_._y=s||0,_._repeats=i,_._frameRepeats=r,_._remainingFrameRepeats=r,_._isLastFrame=a,_._isRecycled=!1,o>=0?(_._activeSequence=o,_._activeSequenceOffset=h):(_._activeSequence=-1,_._activeSequenceOffset=0),_}get id(){return this._id>=0?this._id:-this._id*Math.random()}get x(){return this._x}get y(){return this._y}get repeats(){return this._repeats}get frameRepeats(){return this._frameRepeats}get isLastFrame(){return this._isLastFrame}get remainingFrameRepeats(){return this._frameRepeats<0?Ge.FRAME_REPEAT_FOREVER:this._remainingFrameRepeats}set remainingFrameRepeats(t){t<0&&(t=0),this._frameRepeats>0&&t>this._frameRepeats&&(t=this._frameRepeats),this._remainingFrameRepeats=t}get activeSequence(){return this._activeSequence}get activeSequenceOffset(){return this._activeSequenceOffset}recycle(){this._isRecycled||(this._isRecycled=!0,Ge.POOL.length<Ge.POOL_SIZE_LIMIT&&Ge.POOL.push(this))}};Ge.FRAME_REPEAT_FOREVER=-1,Ge.SEQUENCE_NOT_DEFINED=-1,Ge.POOL_SIZE_LIMIT=3e3,Ge.POOL=[];let er=Ge;class PT{constructor(t,e,s,i,r,a){this._id=0,this._x=0,this._y=0,this._randomX=0,this._randomY=0,this._repeats=1,this._id=t,this._x=e,this._y=s,this._randomX=i,this._randomY=r,this._repeats=a}get id(){return this._id}hasDirectionalOffsets(){return!1}getX(t){return this._x}getY(t){return this._y}get x(){return this._x}get y(){return this._x}get randomX(){return this._randomX}get randomY(){return this._randomY}get repeats(){return this._repeats}}class R2 extends PT{constructor(t,e,s,i,r,a,o){super(t,e,s,i,r,o),this._directionalOffsets=a}hasDirectionalOffsets(){return this._directionalOffsets!==null}getX(t){return this._directionalOffsets?this._directionalOffsets.getXOffset(t,super.getX(t)):super.getX(t)}getY(t){return this._directionalOffsets?this._directionalOffsets.getYOffset(t,super.getY(t)):super.getY(t)}}class O2{constructor(t,e){this._frames=[],this._frameIndexes=[],this._frameRepeats=[],this._isRandom=e,this._loopCount=t<1?1:t}get isRandom(){return this._isRandom}get frameCount(){return this._frameIndexes.length*this._loopCount}dispose(){this._frames=[]}initialize(){let t=this._frameIndexes.length-1,e=-1,s=1;for(;t>=0;)this._frameIndexes[t]===e?s++:(e=this._frameIndexes[t],s=1),this._frameRepeats[t]=s,t--}addFrame(t,e,s,i,r,a){let o=1;if(this._frames.length>0){const _=this._frames[this._frames.length-1];_.id===t&&!_.hasDirectionalOffsets()&&_.x===e&&_.y===s&&_.randomX===i&&i===0&&_.randomY===r&&r===0&&(o+=_.repeats,this._frames.pop())}const h=a?new R2(t,e,s,i,r,a,o):new PT(t,e,s,i,r,o);this._frames.push(h),this._frameIndexes.push(this._frames.length-1),this._frameRepeats.push(1)}getFrame(t){return!this._frames.length||t<0||t>=this.frameCount?null:this._frames[this._frameIndexes[t%this._frameIndexes.length]]}getFrameIndex(t){return t<0||t>=this.frameCount?-1:(this._isRandom&&(t=Math.round(Math.random()*this._frameIndexes.length),t===this._frameIndexes.length&&t--),t)}getRepeats(t){return t<0||t>=this.frameCount?0:this._frameRepeats[t%this._frameRepeats.length]}}class A2{constructor(t,e,s){this._frameSequences=[],this._frameCount=-1,this._loopCount=t<0?0:t,this._frameRepeat=e<1?1:e,this._isRandom=s}get frameCount(){return this._frameCount<0&&this.calculateLength(),this._frameCount}dispose(){if(!(!this._frameSequences||!this._frameSequences.length)){for(const t of this._frameSequences)t&&t.dispose();this._frameSequences=[]}}addFrameSequence(t,e){const s=new O2(t,e);return this._frameSequences.push(s),s}calculateLength(){this._frameCount=0;for(const t of this._frameSequences)t&&(this._frameCount+=t.frameCount)}getFrame(t,e){if(this._frameCount<1)return null;if(e=e/this._frameRepeat,!this._isRandom){const r=Math.floor(e/this._frameCount);e=Math.floor(e%this._frameCount);let a=!1,o=null;(this._loopCount>0&&r>=this._loopCount||this._loopCount<=0&&this._frameCount===1)&&(e=this._frameCount-1,a=!0);let h=0,_=0;for(;_<this._frameSequences.length;){if(o=this._frameSequences[_],o){if(e<h+o.frameCount)break;h+=o.frameCount}_++}return this.getFrameFromSpecificSequence(t,o,_,e-h,a)}const s=Math.trunc(this._frameSequences.length*Math.random()),i=this._frameSequences[s];return i.frameCount<1?null:this.getFrameFromSpecificSequence(t,i,s,0,!1)}getFrameFromSequence(t,e,s,i){if(e<0||e>=this._frameSequences.length)return null;const r=this._frameSequences[e];return r?s>=r.frameCount?this.getFrame(t,i):this.getFrameFromSpecificSequence(t,r,e,s,!1):null}getFrameFromSpecificSequence(t,e,s,i,r){if(!e)return null;const a=e.getFrameIndex(i),o=e.getFrame(a);if(!o)return null;let h=o.getX(t),_=o.getY(t);const l=o.randomX,c=o.randomY;let f=o.repeats,p=!1;l&&(h=Math.trunc(h+l*Math.random())),c&&(_=Math.trunc(_+c*Math.random())),f>1&&(f=e.getRepeats(a));let m=this._frameRepeat*f;return r&&(m=er.FRAME_REPEAT_FOREVER),!this._isRandom&&!e.isRandom&&s===this._frameSequences.length-1&&i===e.frameCount-1&&(p=!0),er.allocate(o.id,h,_,f,m,p,s,i)}}class UT{constructor(){this._offsetX=new Map,this._offsetY=new Map}getXOffset(t,e){const s=this._offsetX.get(t);return s??e}getYOffset(t,e){const s=this._offsetY.get(t);return s??e}setDirection(t,e,s){this._offsetX.set(t,e),this._offsetY.set(t,s)}}const ws=class ws{constructor(){this._layers=new Map,this._frameCount=-1,this._randomStart=!1,this._immediateChanges=null}static getTransitionToAnimationId(t){return ws.TRANSITION_TO_ANIMATION_OFFSET+t}static getTransitionFromAnimationId(t){return ws.TRANSITION_FROM_ANIMATION_OFFSET+t}static isTransitionToAnimation(t){return t>=ws.TRANSITION_TO_ANIMATION_OFFSET&&t<ws.TRANSITION_FROM_ANIMATION_OFFSET}static isTransitionFromAnimation(t){return t>=ws.TRANSITION_FROM_ANIMATION_OFFSET}dispose(){for(const t of this._layers.values())t&&t.dispose();this._layers.clear(),this._immediateChanges=null}setImmediateChanges(t){this._immediateChanges=t}isImmediateChange(t){return!(!this._immediateChanges||this._immediateChanges.indexOf(t)===-1)}getStartFrame(t){return this._randomStart?Math.random()*this._frameCount:0}initialize(t){if(t.randomStart&&(this._randomStart=!0),t.layers)for(const e in t.layers){const s=t.layers[e];if(!s)return!1;const i=parseInt(e),r=s.loopCount!==void 0?s.loopCount:1,a=s.frameRepeat!==void 0?s.frameRepeat:1,o=s.random!==void 0&&s.random!==0;if(!this.addLayer(i,r,a,o,s))return!1}return!0}addLayer(t,e,s,i,r){const a=new A2(e,s,i);if(r.frameSequences)for(const h in r.frameSequences){const _=r.frameSequences[h];if(!_)continue;const l=_.loopCount!==void 0?_.loopCount:1,c=_.random!==void 0&&_.random!==0,f=a.addFrameSequence(l,c);if(_.frames)for(const p in _.frames){const m=_.frames[p];if(!m)return a.dispose(),!1;f.addFrame(m.id,m.x||0,m.y||0,m.randomX||0,m.randomY||0,this.readDirectionalOffsets(m))}f.initialize()}a.calculateLength(),this._layers.set(t,a);const o=a.frameCount;return o>this._frameCount&&(this._frameCount=o),!0}readDirectionalOffsets(t){let e=null;if(t&&t.offsets)for(const s in t.offsets){const i=t.offsets[s];i&&(e||(e=new UT),e.setDirection(i.direction,i.x,i.y))}return e}getFrame(t,e,s){const i=this._layers.get(e);return i?i.getFrame(t,s):null}getFrameFromSequence(t,e,s,i,r){const a=this._layers.get(e);return a?a.getFrameFromSequence(t,s,i,r):null}};ws.TRANSITION_TO_ANIMATION_OFFSET=1e6,ws.TRANSITION_FROM_ANIMATION_OFFSET=2e6,ws.DEFAULT_FRAME_NUMBER=0;let Jt=ws;const ba=class ba{constructor(t){this._colors=[],this.createColors(t)}createColors(t){if(t)for(let e=0;e<t;e++)this._colors.push(ba.DEFAULT_COLOR)}dispose(){this._colors=[]}getLayerColor(t){const e=this._colors[t];return e||ba.DEFAULT_COLOR}setColorLayer(t,e){this._colors[t]&&(this._colors[t]=e)}};ba.DEFAULT_COLOR=16777215;let jr=ba;const ie=class ie{constructor(){this._tag=ie.DEFAULT_TAG,this._ink=ie.DEFAULT_INK,this._alpha=ie.DEFAULT_ALPHA,this._ignoreMouse=ie.DEFAULT_IGNORE_MOUSE,this._xOffset=ie.DEFAULT_XOFFSET,this._yOffset=ie.DEFAULT_YOFFSET,this._zOffset=ie.DEFAULT_ZOFFSET}setFromLayer(t){t&&(this._tag=t.tag,this._ink=t.ink,this._alpha=t.alpha,this._ignoreMouse=t.ignoreMouse,this._xOffset=t.xOffset,this._yOffset=t.yOffset,this._zOffset=t.zOffset)}get tag(){return this._tag}set tag(t){this._tag=t}get ink(){return this._ink}set ink(t){this._ink=t}get alpha(){return this._alpha}set alpha(t){this._alpha=t}get ignoreMouse(){return this._ignoreMouse}set ignoreMouse(t){this._ignoreMouse=t}get xOffset(){return this._xOffset}set xOffset(t){this._xOffset=t}get yOffset(){return this._yOffset}set yOffset(t){this._yOffset=t}get zOffset(){return this._zOffset}set zOffset(t){this._zOffset=t}};ie.DEFAULT_COUNT=0,ie.DEFAULT_DIRECTION=0,ie.DEFAULT_TAG="",ie.DEFAULT_INK=gi.NORMAL,ie.DEFAULT_ALPHA=255,ie.DEFAULT_IGNORE_MOUSE=!1,ie.DEFAULT_XOFFSET=0,ie.DEFAULT_YOFFSET=0,ie.DEFAULT_ZOFFSET=0;let Ot=ie;const NE=class NE{constructor(t){this._layers=[],this.createLayers(t)}createLayers(t){if(t)for(let e=0;e<t;e++)this._layers.push(new Ot)}dispose(){this._layers=[]}setFromDirection(t){if(!t)return;const e=this.layerCount;if(e===t.layerCount)for(let s=0;s<e;s++){const i=this.getLayer(s),r=t.getLayer(s);i&&i.setFromLayer(r)}}getLayer(t){const e=this._layers[t];return e||null}getLayerTag(t){const e=this.getLayer(t);return e?e.tag:Ot.DEFAULT_TAG}setLayerTag(t,e){const s=this.getLayer(t);s&&(s.tag=e)}getLayerInk(t){const e=this.getLayer(t);return e?e.ink:Ot.DEFAULT_INK}setLayerInk(t,e){const s=this.getLayer(t);s&&(isNaN(e)||(s.ink=e))}getLayerAlpha(t){const e=this.getLayer(t);return e?e.alpha:Ot.DEFAULT_ALPHA}setLayerAlpha(t,e){const s=this.getLayer(t);s&&(isNaN(e)||(s.alpha=e))}getLayerIgnoreMouse(t){const e=this.getLayer(t);return e?e.ignoreMouse:Ot.DEFAULT_IGNORE_MOUSE}setLayerIgnoreMouse(t,e){const s=this.getLayer(t);s&&(s.ignoreMouse=e||!1)}getLayerXOffset(t){const e=this.getLayer(t);return e?e.xOffset:Ot.DEFAULT_XOFFSET}setLayerXOffset(t,e){const s=this.getLayer(t);s&&(isNaN(e)||(s.xOffset=e))}getLayerYOffset(t){const e=this.getLayer(t);return e?e.yOffset:Ot.DEFAULT_YOFFSET}setLayerYOffset(t,e){const s=this.getLayer(t);s&&(isNaN(e)||(s.yOffset=e))}getLayerZOffset(t){const e=this.getLayer(t);return e?e.zOffset:Ot.DEFAULT_ZOFFSET}setLayerZOffset(t,e){const s=this.getLayer(t);s&&(isNaN(e)||(s.zOffset=e))}get layerCount(){return this._layers.length}};NE.USE_DEFAULT_DIRECTION=-1;let Qi=NE;const Fa=class Fa{constructor(t,e){this._layerCount=t<0?0:t>Fa.MAX_LAYERS?Fa.MAX_LAYERS:t,this._angle=e<1?1:e>360?360:e,this._defaultDirection=new Qi(this._layerCount),this._directions=new Map,this._colors=[],this._lastDirectionData=null,this._lastDirection=-1}dispose(){this._defaultDirection&&this._defaultDirection.dispose();for(const t of this._directions.values())t&&t.dispose();for(const t of this._colors)t&&t.dispose();this.reset()}reset(){this._defaultDirection=null,this._colors=[],this._lastDirectionData=null,this._lastDirection=-1,this._directions.clear()}processLayers(t){return t?this.setDirectionLayers(this._defaultDirection,t):!1}processDirections(t){if(!t)return!1;for(const e in t){const s=t[e];if(!s)continue;const i=parseInt(e);if(this._directions.get(i))return!1;const r=new Qi(this._layerCount);r.setFromDirection(this._defaultDirection),this.setDirectionLayers(r,s.layers),this._directions.set(i,r),this._lastDirectionData=null,this._lastDirection=-1}return!0}processColors(t){if(!t)return!1;for(const e in t){const s=t[e];if(!s)continue;const i=parseInt(e);if(this._colors[i])return!1;const r=new jr(this._layerCount);for(const a in s.layers){const o=s.layers[a];if(!o)continue;const h=parseInt(a),_=o.color;r.setColorLayer(h,_)}this._colors[i]=r}return!0}setDirectionLayers(t,e){if(!t||!e)return!1;for(const s in e){const i=e[s];if(!i)continue;const r=parseInt(s);if(r<0||r>=this._layerCount)return!1;i.ink!==void 0&&t.setLayerInk(r,Zm.inkToBlendMode(i.ink)),i.tag!==void 0&&t.setLayerTag(r,i.tag),i.alpha!==void 0&&t.setLayerAlpha(r,i.alpha),i.ignoreMouse!==void 0&&t.setLayerIgnoreMouse(r,i.ignoreMouse),i.x!==void 0&&t.setLayerXOffset(r,i.x),i.y!==void 0&&t.setLayerYOffset(r,i.y),i.z!==void 0&&t.setLayerZOffset(r,i.z/-1e3)}return!0}getValidDirection(t){if(this._directions.get(t))return t;t=(t%360+360)%360;let s=-1,i=-1;for(const r of this._directions.keys()){let a=(r*this._angle-t+360)%360;a>180&&(a=360-a),(a<s||s<0)&&(s=a,i=r)}return i>=0?Math.trunc(i):0}getDirectionData(t){if(t===this._lastDirection&&this._lastDirectionData)return this._lastDirectionData;let e=this._directions.get(t);return e||(e=this._defaultDirection),this._lastDirection=t,this._lastDirectionData=e,this._lastDirectionData}getLayerTag(t,e){const s=this.getDirectionData(t);return s?s.getLayerTag(e):Ot.DEFAULT_TAG}getLayerInk(t,e){const s=this.getDirectionData(t);return s?s.getLayerInk(e):Ot.DEFAULT_INK}getLayerAlpha(t,e){const s=this.getDirectionData(t);return s?s.getLayerAlpha(e):Ot.DEFAULT_ALPHA}getLayerColor(t,e){const s=this._colors[e];return s?s.getLayerColor(t):jr.DEFAULT_COLOR}getLayerIgnoreMouse(t,e){const s=this.getDirectionData(t);return s?s.getLayerIgnoreMouse(e):Ot.DEFAULT_IGNORE_MOUSE}getLayerXOffset(t,e){const s=this.getDirectionData(t);return s?s.getLayerXOffset(e):Ot.DEFAULT_XOFFSET}getLayerYOffset(t,e){const s=this.getDirectionData(t);return s?s.getLayerYOffset(e):Ot.DEFAULT_YOFFSET}getLayerZOffset(t,e){const s=this.getDirectionData(t);return s?s.getLayerZOffset(e):Ot.DEFAULT_ZOFFSET}get layerCount(){return this._layerCount}};Fa.MAX_LAYERS=26;let nh=Fa;class ah extends nh{constructor(t,e){super(t,e),this._animations=new Map,this._animationIds=[]}dispose(){super.dispose();for(const t of this._animations.values())t&&t.dispose();this._animations.clear(),this._animationIds=[]}defineAnimations(t){if(!t)return!0;for(const e in t){const s=t[e];if(!s)return!1;let i=parseInt(e.split("_")[0]),r=!1;const a=s.transitionTo,o=s.transitionFrom;a!==void 0&&(i=Jt.getTransitionToAnimationId(a),r=!0),o!==void 0&&(i=Jt.getTransitionFromAnimationId(o),r=!0);const h=this.createAnimationData();if(!h.initialize(s))return h.dispose(),!1;const _=s.immediateChangeFrom;if(_!==void 0){const l=_.split(","),c=[];for(const f of l){const p=parseInt(f);c.indexOf(p)===-1&&c.push(p)}h.setImmediateChanges(c)}this._animations.set(i,h),r||this._animationIds.push(i)}return!0}createAnimationData(){return new Jt}hasAnimation(t){return!!this._animations.get(t)}getAnimationCount(){return this._animationIds.length||0}getAnimationId(t){const e=this.getAnimationCount();return t<0||e<=0?0:this._animationIds[t%e]}isImmediateChange(t,e){const s=this._animations.get(t);return s?s.isImmediateChange(e):!1}getStartFrame(t,e){const s=this._animations.get(t);return s?s.getStartFrame(e):0}getFrame(t,e,s,i){const r=this._animations.get(t);return r?r.getFrame(e,s,i):null}getFrameFromSequence(t,e,s,i,r,a){const o=this._animations.get(t);return o?o.getFrameFromSequence(e,s,i,r,a):null}}class yT{constructor(){this._animationId=-1,this._animationAfterTransitionId=0,this._animationOver=!1,this._frameCounter=0,this._frames=[],this._lastFramePlayed=[],this._animationPlayed=[],this._layerCount=0}get animationOver(){return this._animationOver}set animationOver(t){this._animationOver=t}get frameCounter(){return this._frameCounter}set frameCounter(t){this._frameCounter=t}get animationId(){return this._animationId}set animationId(t){t!==this._animationId&&(this._animationId=t,this.resetAnimationFrames(!1))}get animationAfterTransitionId(){return this._animationAfterTransitionId}set animationAfterTransitionId(t){this._animationAfterTransitionId=t}dispose(){this.recycleFrames(),this._frames=null,this._lastFramePlayed=null,this._animationPlayed=null}setLayerCount(t){this._layerCount=t,this.resetAnimationFrames()}resetAnimationFrames(t=!0){(t||!this._frames)&&(this.recycleFrames(),this._frames=[]),this._lastFramePlayed=[],this._animationPlayed=[],this._animationOver=!1,this._frameCounter=0;let e=0;for(;e<this._layerCount;){if(t||this._frames.length<=e)this._frames[e]=null;else{const s=this._frames[e];s&&(s.recycle(),this._frames[e]=er.allocate(s.id,s.x,s.y,s.repeats,0,s.isLastFrame))}this._lastFramePlayed[e]=!1,this._animationPlayed[e]=!1,e++}}recycleFrames(){if(!(!this._frames||!this._frames.length))for(const t of this._frames)t&&t.recycle()}getFrame(t){return t<0||t>=this._layerCount?null:this._frames[t]}setFrame(t,e){if(t<0||t>=this._layerCount)return;const s=this._frames[t];s&&s.recycle(),this._frames[t]=e}getAnimationPlayed(t){return t<0||t>=this._layerCount?!0:this._animationPlayed[t]}setAnimationPlayed(t,e){t<0||t>=this._layerCount||(this._animationPlayed[t]=e)}getLastFramePlayed(t){return t<0||t>=this._layerCount?!0:this._lastFramePlayed[t]}setLastFramePlayed(t,e){t<0||t>=this._layerCount||(this._lastFramePlayed[t]=e)}}const G_=class G_ extends ah{constructor(t,e){super(t,e),this._posturesToAnimations=new Map,this._gesturesToAnimations=new Map,this._defaultPosture=null}processPostures(t){if(!t||(t.defaultPosture&&t.defaultPosture.length&&(this._defaultPosture=t.defaultPosture),!t.postures))return!1;for(const e of t.postures)this._posturesToAnimations.get(e.id)||(this._defaultPosture===null&&(this._defaultPosture=e.id),this._posturesToAnimations.set(e.id,e.animationId));return this._posturesToAnimations.get(this._defaultPosture)!==void 0}processGestures(t){if(!t)return!1;for(const e of t)this._gesturesToAnimations.get(e.id)||this._gesturesToAnimations.set(e.id,e.animationId);return!0}postureToAnimation(t){return this._posturesToAnimations.get(t)||(t=this._defaultPosture),this._posturesToAnimations.get(t)}getGestureDisabled(t){return t==="ded"}gestureToAnimation(t){return this._gesturesToAnimations.get(t)?this._gesturesToAnimations.get(t):G_.DEFAULT}animationToPosture(t,e){if(t>=0&&t<this._posturesToAnimations.size){const s=this._posturesToAnimations.keys();for(;;){const i=s.next();if(i.done)return null;if(t<=0)return i.value;--t}}return e?this._defaultPosture:null}animationToGesture(t){if(t>=0&&t<this._gesturesToAnimations.size){const e=this._gesturesToAnimations.keys();for(;;){const s=e.next();if(s.done)return null;if(t<=0)return s.value;--t}}return null}getGestureForAnimationId(t){for(const e of this._gesturesToAnimations.keys())if(this._gesturesToAnimations.get(e)===t)return e;return null}get totalPostures(){return this._posturesToAnimations.size}get totalGestures(){return this._gesturesToAnimations.size}};G_.DEFAULT=-1;let hr=G_;const DE=class DE{constructor(){this._type="",this._sizes=[],this._sizeDatas=new Map,this._lastSize=-1,this._lastSizeScale=-1,this._lastSizeData=null,this._lastSizeDataScale=-1}initialize(t){return this.reset(),t?(this._type=t.name,this.defineVisualizations(t.visualizations)?!0:(this.reset(),!1)):!1}dispose(){if(this._sizeDatas&&this._sizeDatas.size){for(const t of this._sizeDatas.values())t&&t.dispose();this._sizeDatas=null}this._lastSizeData=null,this._sizes=null}reset(){if(this._type="",this._sizeDatas&&this._sizeDatas.size)for(const t of this._sizeDatas.values())t&&t.dispose();this._sizeDatas.clear(),this._sizes=[],this._lastSizeData=null,this._lastSizeDataScale=-1}createSizeData(t,e,s){return new nh(e,s)}defineVisualizations(t){if(!t)return!1;for(const e in t){const s=t[e],i=s.layerCount,r=s.angle;let a=s.size;if(a<1&&(a=1),this._sizeDatas.get(a))return!1;const o=this.createSizeData(a,i,r);if(!o)return!1;for(const h in s){const _=s[h];if(!this.processVisualElement(o,h,_))return o.dispose(),!1}this._sizeDatas.set(a,o),this._sizes.push(a)}return this._sizes.sort(),!0}processVisualElement(t,e,s){if(!t||!e||!s)return!1;switch(e){case"layers":if(!t.processLayers(s))return!1;break;case"directions":if(!t.processDirections(s))return!1;break;case"colors":if(!t.processColors(s))return!1;break}return!0}getValidSize(t){if(t===this._lastSizeScale)return this._lastSize;const e=this.getSizeIndex(t);let s=-1;return e<this._sizes.length&&(s=this._sizes[e]),this._lastSizeScale=t,this._lastSize=s,s}getSizeIndex(t){if(t<=0)return 0;let e=0,s=1;for(;s<this._sizes.length;){if(this._sizes[s]>t){this._sizes[s]/t<t/this._sizes[s-1]&&(e=s);break}e=s,s++}return e}getSizeData(t){if(t===this._lastSizeDataScale)return this._lastSizeData;const e=this.getSizeIndex(t);return e<this._sizes.length?this._lastSizeData=this._sizeDatas.get(this._sizes[e]):this._lastSizeData=null,this._lastSizeDataScale=t,this._lastSizeData}getLayerCount(t){const e=this.getSizeData(t);return e?e.layerCount:Ot.DEFAULT_COUNT}getValidDirection(t,e){const s=this.getSizeData(t);return s?s.getValidDirection(e):Ot.DEFAULT_DIRECTION}getLayerTag(t,e,s){const i=this.getSizeData(t);return i?i.getLayerTag(e,s):Ot.DEFAULT_TAG}getLayerInk(t,e,s){const i=this.getSizeData(t);return i?i.getLayerInk(e,s):Ot.DEFAULT_INK}getLayerAlpha(t,e,s){const i=this.getSizeData(t);return i?i.getLayerAlpha(e,s):Ot.DEFAULT_ALPHA}getLayerColor(t,e,s){const i=this.getSizeData(t);return i?i.getLayerColor(e,s):jr.DEFAULT_COLOR}getLayerIgnoreMouse(t,e,s){const i=this.getSizeData(t);return i?i.getLayerIgnoreMouse(e,s):Ot.DEFAULT_IGNORE_MOUSE}getLayerXOffset(t,e,s){const i=this.getSizeData(t);return i?i.getLayerXOffset(e,s):Ot.DEFAULT_XOFFSET}getLayerYOffset(t,e,s){const i=this.getSizeData(t);return i?i.getLayerYOffset(e,s):Ot.DEFAULT_YOFFSET}getLayerZOffset(t,e,s){const i=this.getSizeData(t);return i?i.getLayerZOffset(e,s):Ot.DEFAULT_ZOFFSET}get type(){return this._type}};DE.LAYER_LETTERS=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];let Xs=DE;class $d extends Xs{createSizeData(t,e,s){return new ah(e,s)}processVisualElement(t,e,s){if(!t||!e||!s)return!1;switch(e){case"animations":if(!(t instanceof ah)||!t.defineAnimations(s))return!1;break;default:if(!super.processVisualElement(t,e,s))return!1;break}return!0}hasAnimation(t,e){const s=this.getSizeData(t);return s?s.hasAnimation(e):null}getAnimationCount(t){const e=this.getSizeData(t);return e?e.getAnimationCount():null}getAnimationId(t,e){const s=this.getSizeData(t);return s?s.getAnimationId(e):null}isImmediateChange(t,e,s){const i=this.getSizeData(t);return i?i.isImmediateChange(e,s):null}getStartFrame(t,e,s){const i=this.getSizeData(t);return i?i.getStartFrame(e,s):null}getFrame(t,e,s,i,r){const a=this.getSizeData(t);return a?a.getFrame(e,s,i,r):null}getFrameFromSequence(t,e,s,i,r,a,o){const h=this.getSizeData(t);return h?h.getFrameFromSequence(e,s,i,r,a,o):null}}const xa=class xa extends jn{constructor(){super(),this._data=null,this._type=null,this._direction=0,this._lastCameraAngle=NaN,this._selectedColor=0,this._furnitureLift=0,this._alphaMultiplier=1,this._alphaChanged=!1,this._clickUrl=null,this._clickHandling=!1,this._cacheDirection=-1,this._cacheScale=0,this._cacheSize=-1,this._layerCount=0,this._shadowLayerIndex=-1,this._updatedLayers=[],this._assetNames=[],this._spriteTags=[],this._spriteInks=[],this._spriteAlphas=[],this._spriteColors=[],this._spriteMouseCaptures=[],this._spriteXOffsets=[],this._spriteYOffsets=[],this._spriteZOffsets=[],this._animationNumber=0}initialize(t){return this.reset(),t instanceof Xs?(this._type=t.type,this._data=t,!0):!1}dispose(){super.dispose(),this._data=null,this._updatedLayers=null,this._assetNames=null,this._spriteTags=null,this._spriteInks=null,this._spriteAlphas=null,this._spriteColors=null,this._spriteMouseCaptures=null,this._spriteXOffsets=null,this._spriteYOffsets=null,this._spriteZOffsets=null}reset(){super.reset(),this.setDirection(-1),this._data=null,this._updatedLayers=[],this._assetNames=[],this._spriteTags=[],this._spriteInks=[],this._spriteAlphas=[],this._spriteColors=[],this._spriteMouseCaptures=[],this._spriteXOffsets=[],this._spriteYOffsets=[],this._spriteZOffsets=[],this.createSprites(0)}resetLayers(t,e){this._cacheDirection===e&&this._cacheScale===t||(this._updatedLayers=[],this._assetNames=[],this._spriteTags=[],this._spriteInks=[],this._spriteAlphas=[],this._spriteColors=[],this._spriteMouseCaptures=[],this._spriteXOffsets=[],this._spriteYOffsets=[],this._spriteZOffsets=[],this._cacheDirection=e,this._cacheScale=t,this._cacheSize=this.getValidSize(t),this.setLayerCount((this._data&&this._data.getLayerCount(t)||0)+this.getAdditionalLayerCount()))}update(t,e,s,i){if(!t)return;const r=t.scale;let a=!1;this.updateObject(r,t.direction.x)&&(a=!0),this.updateModel(r)&&(a=!0);let o=0;i?this._animationNumber=this._animationNumber|this.updateAnimation(r):(o=this.updateAnimation(r)|this._animationNumber,this._animationNumber=0),(a||o!==0)&&(this.updateSprites(r,a,o),this._scale=r,this.updateSpriteCounter++)}updateObject(t,e){if(!this.object||this.updateObjectCounter===this.object.updateCounter&&t===this._scale&&this._lastCameraAngle===e)return!1;let s=this.object.getDirection().x-(e+135);if(s=(s%360+360)%360,this._data){const i=this._data.getValidDirection(t,s);this.setDirection(i)}return this._lastCameraAngle=e,this._scale=t,this.updateObjectCounter=this.object.updateCounter,this.resetLayers(t,this._direction),!0}updateModel(t){const e=this.object&&this.object.model;if(!e||this.updateModelCounter===e.updateCounter)return!1;this._selectedColor=e.getValue(g.FURNITURE_COLOR),this._clickUrl=e.getValue(g.FURNITURE_AD_URL),this._clickHandling=this._clickUrl&&this._clickUrl!==""&&this._clickUrl.indexOf("http")===0||!1,this._furnitureLift=e.getValue(g.FURNITURE_LIFT_AMOUNT)||0;let s=e.getValue(g.FURNITURE_ALPHA_MULTIPLIER);return isNaN(s)&&(s=1),this._alphaMultiplier!==s&&(this._alphaMultiplier=s,this._alphaChanged=!0),this.updateModelCounter=e.updateCounter,!0}updateSprites(t,e,s){if(this._layerCount!==this.totalSprites&&this.createSprites(this._layerCount),e){let i=this.totalSprites-1;for(;i>=0;)this.updateSprite(t,i),i--}else{let i=0;for(;s>0;)s&&this.updateSprite(t,i),i++,s=s>>1}this._alphaChanged=!1}updateSprite(t,e){const s=this.getSpriteAssetName(t,e),i=this.getSprite(e);if(s&&i){const r=this.getAsset(s,e);if(r&&r.texture){i.visible=!0,i.type=this._type,i.texture=r.texture,i.flipH=r.flipH,i.flipV=r.flipV,i.direction=this._direction;let a=0;e!==this._shadowLayerIndex?(i.tag=this.getLayerTag(t,this._direction,e),i.alpha=this.getLayerAlpha(t,this._direction,e),i.color=this.getLayerColor(t,e,this._selectedColor),i.offsetX=r.offsetX+this.getLayerXOffset(t,this._direction,e),i.offsetY=r.offsetY+this.getLayerYOffset(t,this._direction,e),i.blendMode=this.getLayerInk(t,this._direction,e),i.alphaTolerance=this.getLayerIgnoreMouse(t,this._direction,e)?Os.MATCH_NOTHING:Os.MATCH_OPAQUE_PIXELS,a=this.getLayerZOffset(t,this._direction,e),a=a-e*.001):(i.offsetX=r.offsetX,i.offsetY=r.offsetY+this.getLayerYOffset(t,this._direction,e),i.alpha=48*this._alphaMultiplier,i.alphaTolerance=Os.MATCH_NOTHING,a=1),i.relativeDepth=a*xa.DEPTH_MULTIPLIER,i.name=s,i.libraryAssetName=this.getLibraryAssetNameForSprite(r,i),i.posture=this.getPostureForAsset(t,r.source),i.clickHandling=this._clickHandling}else this.resetSprite(i)}else i&&this.resetSprite(i)}getLibraryAssetNameForSprite(t,e){return t.source}getPostureForAssetFile(t,e){return null}resetSprite(t){t&&(t.texture=null,t.libraryAssetName="",t.posture="",t.tag="",t.offsetX=0,t.offsetY=0,t.flipH=!1,t.flipV=!1,t.relativeDepth=0,t.clickHandling=!1)}getSpriteAssetName(t,e){if(!this._data||e>=Xs.LAYER_LETTERS.length)return"";let s=this._assetNames[e],i=this._updatedLayers[e];return(!s||!s.length)&&(s=this.cacheSpriteAssetName(t,e,!0),i=this._cacheSize!==1),i&&(s+=this.getFrameNumber(t,e)),s}cacheSpriteAssetName(t,e,s){this._type;const i=s?this._cacheSize:this.getValidSize(t);let r="";const a=i!==1;if(e!==this._shadowLayerIndex?r=Xs.LAYER_LETTERS[e]||"":r="sd",r==="")return null;const o=this._type+(a?"_"+i+"_"+r+"_"+this._direction+"_":"_icon_"+r);return s&&(this._assetNames[e]=o,this._updatedLayers[e]=a),o}getLayerTag(t,e,s){const i=this._spriteTags[s];if(i!==void 0)return i;if(!this._data)return Ot.DEFAULT_TAG;const r=this._data.getLayerTag(t,e,s);return this._spriteTags[s]=r,r}getLayerInk(t,e,s){const i=this._spriteInks[s];if(i!==void 0)return i;if(!this._data)return Ot.DEFAULT_INK;const r=this._data.getLayerInk(t,e,s);return this._spriteInks[s]=r,r}getLayerAlpha(t,e,s){if(!this._alphaChanged){const r=this._spriteAlphas[s];if(r!==void 0)return r}if(!this._data)return Ot.DEFAULT_ALPHA;let i=this._data.getLayerAlpha(t,e,s);return this._alphaMultiplier!==null&&(i=i*this._alphaMultiplier),this._spriteAlphas[s]=i,i}getLayerColor(t,e,s){const i=this._spriteColors[e];if(i!==void 0)return i;if(!this._data)return jr.DEFAULT_COLOR;const r=this._data.getLayerColor(t,e,s);return this._spriteColors[e]=r,r}getLayerIgnoreMouse(t,e,s){const i=this._spriteMouseCaptures[s];if(i!==void 0)return i;if(!this._data)return Ot.DEFAULT_IGNORE_MOUSE;const r=this._data.getLayerIgnoreMouse(t,e,s);return this._spriteMouseCaptures[s]=r,r}getLayerXOffset(t,e,s){const i=this._spriteXOffsets[s];if(i!==void 0)return i;if(!this._data)return Ot.DEFAULT_XOFFSET;const r=this._data.getLayerXOffset(t,e,s);return this._spriteXOffsets[s]=r,r}getLayerYOffset(t,e,s){if(s===this._shadowLayerIndex)return Math.ceil(this._furnitureLift*(t/2));const i=this._spriteYOffsets[s];if(i!==void 0)return i;if(!this._data)return Ot.DEFAULT_YOFFSET;const r=this._data.getLayerYOffset(t,e,s);return this._spriteYOffsets[s]=r,r}getLayerZOffset(t,e,s){const i=this._spriteZOffsets[s];if(i!==void 0)return i;if(!this._data)return Ot.DEFAULT_ZOFFSET;const r=this._data.getLayerZOffset(t,e,s);return this._spriteZOffsets[s]=r,r}getValidSize(t){return this._data?this._data.getValidSize(t):t}setLayerCount(t){this._layerCount=t,this._shadowLayerIndex=t-this.getAdditionalLayerCount()}setDirection(t){this._direction!==t&&(this._direction=t)}getAdditionalLayerCount(){return 1}updateAnimation(t){return 0}getFrameNumber(t,e){return 0}getPostureForAsset(t,e){return null}getAsset(t,e=-1){return this.asset?this.asset.getAsset(t):null}get direction(){return this._direction}get data(){return this._data}};xa.DEPTH_MULTIPLIER=Math.sqrt(.5),xa.TYPE=x.FURNITURE_STATIC;let Ci=xa;const yn=class yn extends Ci{constructor(){super(),this._state=-1,this._frameIncrease=1,this._animationData=new yT,this._animationScale=0,this._animationChangeTime=0,this._animatedLayerCount=0,this._directionChanged=!1}initialize(t){return t instanceof $d?super.initialize(t):!1}dispose(){super.dispose(),this._animationData&&(this._animationData.dispose(),this._animationData=null)}get animatedLayerCount(){return this._animatedLayerCount}get animationId(){return this._animationData.animationId}getAnimationId(t){return this.animationId!==yn.DEFAULT_ANIMATION_ID&&this.data.hasAnimation(this._animationScale,this.animationId)?this.animationId:yn.DEFAULT_ANIMATION_ID}updateObject(t,e){if(super.updateObject(t,e)){const s=this.object.getState(0);return s!==this._state&&(this.setAnimation(s),this._state=s,this._animationChangeTime=this.object.model.getValue(g.FURNITURE_STATE_UPDATE_TIME)||0),!0}return!1}updateModel(t){if(super.updateModel(t)){if(this.usesAnimationResetting()){const s=this.object.model.getValue(g.FURNITURE_STATE_UPDATE_TIME);s>this._animationChangeTime&&(this._animationChangeTime=s,this.setAnimation(this._state))}const e=this.object.model.getValue(g.FURNITURE_AUTOMATIC_STATE_INDEX);if(!isNaN(e)){const s=this.data.getAnimationId(this._animationScale,e);this.setAnimation(s)}return!0}return!1}isPlayingTransition(t,e){return!(!Jt.isTransitionFromAnimation(t.animationId)&&!Jt.isTransitionToAnimation(t.animationId)||e!==t.animationAfterTransitionId||t.animationOver)}getCurrentState(t){const e=t.animationId;return!Jt.isTransitionFromAnimation(e)&&!Jt.isTransitionToAnimation(e)?e:t.animationAfterTransitionId}setAnimation(t){this.data&&this.setSubAnimation(this._animationData,t,this._state>=0)}setSubAnimation(t,e,s=!0){const i=t.animationId;if(s){if(this.isPlayingTransition(t,e))return!1;const r=this.getCurrentState(t);if(e!==r){if(!this.data.isImmediateChange(this._animationScale,e,r)){let a=Jt.getTransitionFromAnimationId(r);this.data.hasAnimation(this._animationScale,a)?(t.animationAfterTransitionId=e,e=a):(a=Jt.getTransitionToAnimationId(e),this.data.hasAnimation(this._animationScale,a)&&(t.animationAfterTransitionId=e,e=a))}}else if(Jt.isTransitionFromAnimation(t.animationId)){const a=Jt.getTransitionToAnimationId(e);this.data.hasAnimation(this._animationScale,a)&&(t.animationAfterTransitionId=e,e=a)}else if(!Jt.isTransitionToAnimation(t.animationId)&&this.usesAnimationResetting()){const a=Jt.getTransitionFromAnimationId(r);if(this.data.hasAnimation(this._animationScale,a))t.animationAfterTransitionId=e,e=a;else{const o=Jt.getTransitionToAnimationId(e);this.data.hasAnimation(this._animationScale,o)&&(t.animationAfterTransitionId=e,e=o)}}}return i!==e?(t.animationId=e,!0):!1}getLastFramePlayed(t){return this._animationData.getLastFramePlayed(t)}resetAllAnimationFrames(){this._animationData&&this._animationData.setLayerCount(this._animatedLayerCount)}updateAnimation(t){if(!this.data)return 0;t!==this._animationScale&&(this._animationScale=t,this._animatedLayerCount=this.data.getLayerCount(t),this.resetAllAnimationFrames());const e=this.updateAnimations(t);return this._directionChanged=!1,e}updateAnimations(t){if(this._animationData.animationOver&&!this._directionChanged)return 0;const e=this.updateFramesForAnimation(this._animationData,t);return this._animationData.animationOver&&(Jt.isTransitionFromAnimation(this._animationData.animationId)||Jt.isTransitionToAnimation(this._animationData.animationId))&&(this.setAnimation(this._animationData.animationAfterTransitionId),this._animationData.animationOver=!1),e}updateFramesForAnimation(t,e){if(t.animationOver&&!this._directionChanged)return 0;const s=this.getAnimationId(t);let i=t.frameCounter;i||(i=this.data.getStartFrame(e,s,this._direction)),i+=this.frameIncrease,t.frameCounter=i,t.animationOver=!0;let r=!1,a=this._animatedLayerCount-1,o=0,h=1<<this._animatedLayerCount-1;for(;a>=0;){let _=0;if(r=t.getAnimationPlayed(a),!r||this._directionChanged){let l=t.getLastFramePlayed(a),c=t.getFrame(a);c&&c.isLastFrame&&c.remainingFrameRepeats<=this.frameIncrease&&(l=!0),(this._directionChanged||!c||c.remainingFrameRepeats>=0&&(c.remainingFrameRepeats=c.remainingFrameRepeats-this.frameIncrease)<=0)&&(_=er.SEQUENCE_NOT_DEFINED,c&&(_=c.activeSequence),_===er.SEQUENCE_NOT_DEFINED?c=this.data.getFrame(e,s,this._direction,a,i):c=this.data.getFrameFromSequence(e,s,this._direction,a,_,c.activeSequenceOffset+c.repeats,i),t.setFrame(a,c),o=o|h),!c||c.remainingFrameRepeats==er.FRAME_REPEAT_FOREVER?(l=!0,r=!0):t.animationOver=!1,t.setLastFramePlayed(a,l),t.setAnimationPlayed(a,r)}h=h>>1,a--}return o}getFrameNumber(t,e){const s=this._animationData.getFrame(e);return s?s.id:super.getFrameNumber(t,e)}getLayerXOffset(t,e,s){const i=super.getLayerXOffset(t,e,s),r=this._animationData.getFrame(s);return r?i+r.x:i}getLayerYOffset(t,e,s){const i=super.getLayerYOffset(t,e,s),r=this._animationData.getFrame(s);return r?i+r.y:i}usesAnimationResetting(){return!1}setDirection(t){this._direction!==t&&(super.setDirection(t),this._directionChanged=!0)}get frameIncrease(){return this._frameIncrease}get data(){return this._data}};yn.TYPE=x.FURNITURE_ANIMATED,yn.DEFAULT_ANIMATION_ID=0;let wt=yn;const vn=class vn extends wt{constructor(){super(),this._badgeId="",this._badgeAssetNameNormalScale="",this._badgeAssetNameSmallScale="",this._badgeVisibleInState=-1}updateModel(t){let e=super.updateModel(t);const s=this.object.model.getValue(g.FURNITURE_BADGE_IMAGE_STATUS),i=this.object.model.getValue(g.FURNITURE_BADGE_ASSET_NAME);if(s===-1)this._badgeAssetNameNormalScale="",this._badgeAssetNameSmallScale="";else if(s===1&&i!==this._badgeId){this._badgeId=i,this._badgeAssetNameNormalScale=this._badgeId,this._badgeAssetNameSmallScale===""&&(this._badgeAssetNameSmallScale=this._badgeAssetNameNormalScale+"_32");const r=this.object.model.getValue(g.FURNITURE_BADGE_VISIBLE_IN_STATE);isNaN(r)||(this._badgeVisibleInState=r),e=!0}return e}getSpriteAssetName(t,e){return this.getLayerTag(t,this.direction,e)!==vn.BADGE||this._badgeVisibleInState!==-1&&this.object.getState(0)!==this._badgeVisibleInState?super.getSpriteAssetName(t,e):t===32?this._badgeAssetNameSmallScale:this._badgeAssetNameNormalScale}getLayerXOffset(t,e,s){let i=super.getLayerXOffset(t,e,s);if(this.getLayerTag(t,e,s)===vn.BADGE){const r=this.getAsset(t===32?this._badgeAssetNameSmallScale:this._badgeAssetNameNormalScale,s);r&&(t===64?i+=(40-r.width)/2:i+=(20-r.width)/2)}return i}getLayerYOffset(t,e,s){let i=super.getLayerYOffset(t,e,s);if(this.getLayerTag(t,e,s)===vn.BADGE){const r=this.getAsset(t===32?this._badgeAssetNameSmallScale:this._badgeAssetNameNormalScale,s);r&&(t===64?i+=(40-r.height)/2:i+=(20-r.height)/2)}return i}};vn.BADGE="BADGE";let ed=vn;const je=class je extends Ci{constructor(){super(),this._imageUrl=null,this._shortUrl=null,this._imageReady=!1,this._isAnimated=!1,this._gifCollection=null,this._offsetX=0,this._offsetY=0,this._offsetZ=0,this._currentFrame=-1,this._totalFrames=-1}dispose(){super.dispose(),this._imageUrl&&this.asset&&this.asset.disposeAsset(this._imageUrl)}updateObject(t,e){return super.updateObject(t,e)?(this._imageReady&&this.checkAndCreateImageForCurrentState(),!0):!1}updateModel(t){const e=super.updateModel(t);if(e&&(this._offsetX=this.object.model.getValue(g.FURNITURE_BRANDING_OFFSET_X)||0,this._offsetY=this.object.model.getValue(g.FURNITURE_BRANDING_OFFSET_Y)||0,this._offsetZ=this.object.model.getValue(g.FURNITURE_BRANDING_OFFSET_Z)||0,this._isAnimated=this.object.model.getValue(g.FURNITURE_BRANDING_IS_ANIMATED)||!1),this._imageReady){if(this.checkIfImageChanged())return this._imageReady=!1,this._imageUrl=null,!0}else if(this._imageReady=this.checkIfImageReady(),this._imageReady)return this.checkAndCreateImageForCurrentState(),!0;return e}checkIfImageChanged(){const t=this.object.model.getValue(g.FURNITURE_BRANDING_IMAGE_URL);return t&&t===this._imageUrl?!1:(this._gifCollection,this.asset&&this.asset.disposeAsset(this._imageUrl),!0)}checkIfImageReady(){if(!(this.object&&this.object.model))return!1;const e=this.object.model.getValue(g.FURNITURE_BRANDING_IMAGE_URL);if(!e||this._imageUrl&&this._imageUrl===e)return!1;if(this.object.model.getValue(g.FURNITURE_BRANDING_IMAGE_STATUS)===1){let i=null;if(this._isAnimated){const r=W.instance.roomEngine.roomContentLoader.getGifCollection(e);r&&(this._gifCollection=r,i=r.textures[0])}else i=_s().getTexture(e);return i?(this.imageReady(i,e),!0):!1}return!1}imageReady(t,e){if(!t){this._imageUrl=null;return}this._imageUrl=e}checkAndCreateImageForCurrentState(){if(this._isAnimated){this.buildAssetsForGif();return}if(!this._imageUrl)return;const t=_s().getTexture(this._imageUrl);if(!t)return;const e=this.object.getState(0);this.addBackgroundAsset(t,e,0)}buildAssetsForGif(){if(!this._gifCollection)return;const t=this._gifCollection.textures,e=this._gifCollection.durations;if(!t.length||!e.length||t.length!==e.length)return;const s=this.object.getState(0);for(let i=0;i<t.length;i++){const r=t[i];e[i],r&&this.addBackgroundAsset(r,s,i)}this._currentFrame=-1,this._totalFrames=t.length}addBackgroundAsset(t,e,s){let i=0,r=0,a=!1,o=!1;switch(e){case je.STATE_0:i=0,r=0,a=!1,o=!1;break;case je.STATE_1:i=-t.width,r=0,a=!0,o=!1;break;case je.STATE_2:i=-t.width,r=-t.height,a=!0,o=!0;break;case je.STATE_3:i=0,r=-t.height,a=!1,o=!0;break}this.asset.addAsset(`${this._imageUrl}_${s}`,t,!0,i,r,a,o)}getSpriteAssetName(t,e){return this.getLayerTag(t,this._direction,e)===je.BRANDED_IMAGE&&this._imageUrl?`${this._imageUrl}_${this.getFrameNumber(t,e)}`:super.getSpriteAssetName(t,e)}updateAnimation(t){return!this._imageReady||!this._isAnimated||this._totalFrames<=0?0:1}getFrameNumber(t,e){if(!this._imageReady||!this._isAnimated||this._totalFrames<=0)return 0;if(this.getLayerTag(t,this._direction,e)===je.BRANDED_IMAGE&&this._imageUrl){let i=this._currentFrame;return i<0?i=0:i+=1,i===this._totalFrames&&(i=0),this._currentFrame=i,this._currentFrame}return 0}};je.BRANDED_IMAGE="branded_image",je.STATE_0=0,je.STATE_1=1,je.STATE_2=2,je.STATE_3=3;let eo=je;class vT extends eo{getLayerXOffset(t,e,s){return super.getLayerXOffset(t,e,s)+this._offsetX}getLayerYOffset(t,e,s){return super.getLayerYOffset(t,e,s)+this._offsetY}getLayerZOffset(t,e,s){return super.getLayerZOffset(t,e,s)+this._offsetZ}}const Hi=class Hi extends wt{constructor(){super(),this._stateQueue=[],this._running=!1}setAnimation(t){if(t===-1&&!this._running){this._running=!0,this._stateQueue=[],this._stateQueue.push(Hi.ANIMATION_ID_ROLL);return}if(t>=0&&t<=7){if(this._running){this._running=!1,this._stateQueue=[],this._stateQueue.push(Hi.ANIMATION_ID_OFFSET_SLOW1),this._stateQueue.push(Hi.ANIMATION_ID_OFFSET_SLOW2+t),this._stateQueue.push(t);return}super.setAnimation(t)}}updateAnimation(t){return this.getLastFramePlayed(0)&&this._stateQueue.length&&super.setAnimation(this._stateQueue.shift()),super.updateAnimation(t)}};Hi.ANIMATION_ID_OFFSET_SLOW1=20,Hi.ANIMATION_ID_OFFSET_SLOW2=9,Hi.ANIMATION_ID_ROLL=-1;let sd=Hi;class S2 extends Ci{}const Vs=class Vs extends wt{getFrameNumber(t,e){const s=this.getLayerTag(t,this.direction,e),i=this.object.getState(0);switch(s){case Vs.SECONDS_SPRITE:return Math.floor(i%60%10);case Vs.TEN_SECONDS_SPRITE:return Math.floor(i%60/10);case Vs.MINUTES_SPRITE:return Math.floor(i/60%10);case Vs.TEN_MINUTES_SPRITE:return Math.floor(i/60/10%10);default:return super.getFrameNumber(t,e)}}get animationId(){return 0}};Vs.SECONDS_SPRITE="seconds_sprite",Vs.TEN_SECONDS_SPRITE="ten_seconds_sprite",Vs.MINUTES_SPRITE="minutes_sprite",Vs.TEN_MINUTES_SPRITE="ten_minutes_sprite";let id=Vs;class C2 extends jn{}const Ga=class Ga extends wt{constructor(){super(),this._thumbnailAssetNameNormal=null,this._thumbnailImageNormal=null,this._thumbnailDirection=-1,this._thumbnailChanged=!1,this._hasOutline=!1}get hasThumbnailImage(){return this._thumbnailImageNormal!=null}setThumbnailImages(t){this._thumbnailImageNormal=t,this._thumbnailChanged=!0}updateModel(t){const e=super.updateModel(t);return!this._thumbnailChanged&&this._thumbnailDirection===this.direction?e:(this.refreshThumbnail(),!0)}refreshThumbnail(){this.asset!=null&&(this._thumbnailImageNormal?this.addThumbnailAsset(this._thumbnailImageNormal,64):this.asset.disposeAsset(this.getThumbnailAssetName(64)),this._thumbnailChanged=!1,this._thumbnailDirection=this.direction)}addThumbnailAsset(t,e){let s=0;for(;s<this.totalSprites;){if(this.getLayerTag(e,this.direction,s)===Ga.THUMBNAIL){const i=this.cacheSpriteAssetName(e,s,!1)+this.getFrameNumber(e,s),r=this.getAsset(i,s);if(r){const a=this.generateTransformedThumbnail(t,r),o=this.getThumbnailAssetName(e);this.asset.disposeAsset(o),this.asset.addAsset(o,a,!0,r.offsetX,r.offsetY,!1,!1)}return}s++}}generateTransformedThumbnail(t,e){if(this._hasOutline){const o=new xt,h=new xt(Rg.WHITE);h.tint=0,h.width=t.width+40,h.height=t.height+40;const _=new xt(t),l=(h.width-_.width)/2,c=(h.height-_.height)/2;_.position.set(l,c),o.addChild(h,_),t=Ut.generateTexture(o)}const s=1.1,i=new Me,r=e.width/t.width;switch(this.direction){case 2:i.a=r,i.b=-.5*r,i.c=0,i.d=r*s,i.tx=0,i.ty=.5*r*t.width;break;case 0:case 4:i.a=r,i.b=.5*r,i.c=0,i.d=r*s,i.tx=0,i.ty=0;break;default:i.a=r,i.b=0,i.c=0,i.d=r,i.tx=0,i.ty=0}const a=new xt(t);return a.transform.setFromMatrix(i),Ut.generateTexture(a)}getSpriteAssetName(t,e){return this._thumbnailImageNormal&&this.getLayerTag(t,this.direction,e)===Ga.THUMBNAIL?this.getThumbnailAssetName(t):super.getSpriteAssetName(t,e)}getThumbnailAssetName(t){return this._thumbnailAssetNameNormal=this.getFullThumbnailAssetName(this.object.id,64),this._thumbnailAssetNameNormal}getFullThumbnailAssetName(t,e){return[this._type,t,"thumb",e].join("_")}};Ga.THUMBNAIL="THUMBNAIL";let oh=Ga;class bT extends oh{constructor(){super(),this._cachedUrl=null,this._hasOutline=!0}updateModel(t){if(this.object){const e=this.getThumbnailURL();if(this._cachedUrl!==e)if(this._cachedUrl=e,this._cachedUrl&&this._cachedUrl!==""){const s=new Image;s.src=e,s.crossOrigin="*",s.onload=()=>{const i=Ft.from(s);i.baseTexture.scaleMode=ml.LINEAR,this.setThumbnailImages(i)}}else this.setThumbnailImages(null)}return super.updateModel(t)}getThumbnailURL(){throw new Error("This method must be overridden!")}}class M2 extends bT{constructor(){super(),this._url=null,this._typePrefix=null}getThumbnailURL(){if(!this.object)return null;if(this._url)return this._url;const t=this.object.model.getValue(g.FURNITURE_DATA);if(!t||t==="")return null;this.object.type.indexOf("")>=0&&(this._typePrefix=this.object.type.indexOf("")>=0?"":"postcards/selfie/");let s=JSON.parse(t).w||"";return s=this.buildThumbnailUrl(s),this._url=s,this._url}buildThumbnailUrl(t){return t=t.replace(".png","_small.png"),t.indexOf(".png")===-1&&(t=t+"_small.png"),t}}class ag{constructor(){this._hasMoved=!1,this._age=0,this._isEmitter=!1,this._fade=!1,this._alphaMultiplier=1}init(t,e,s,i,r,a,o,h=!1,_=null,l=!1){this._x=t,this._y=e,this._z=s,this._particleDirection=new Ze(i.x,i.y,i.z),this._particleDirection.scaleBy(r),this._lastX=this._x-this._particleDirection.x*a,this._lastY=this._y-this._particleDirection.y*a,this._lastZ=this._z-this._particleDirection.z*a,this._age=0,this._hasMoved=!1,this._lifeTime=o,this._isEmitter=h,this._frames=_,this._fade=l,this._alphaMultiplier=1,this._fadeTime=.5+Math.random()*.5}dispose(){this._particleDirection=null}update(){this._age++,this._age===this._lifeTime&&this.ignite(),this._fade&&this._age/this._lifeTime>this._fadeTime&&(this._alphaMultiplier=(this._lifeTime-this._age)/(this._lifeTime*(1-this._fadeTime)))}getAsset(){return this._frames&&this._frames.length>0?this._frames[this._age%this._frames.length]:null}ignite(){}get fade(){return this._fade}get alphaMultiplier(){return this._alphaMultiplier}get direction(){return this._particleDirection}get age(){return this._age}get isEmitter(){return this._isEmitter}get isAlive(){return this._age<=this._lifeTime}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get z(){return this._z}set z(t){this._z=t}get lastX(){return this._lastX}set lastX(t){this._hasMoved=!0,this._lastX=t}get lastY(){return this._lastY}set lastY(t){this._hasMoved=!0,this._lastY=t}get lastZ(){return this._lastZ}set lastZ(t){this._hasMoved=!0,this._lastZ=t}get hasMoved(){return this._hasMoved}toString(){return[this._x,this._y,this._z].toString()}copy(t,e){this._x=t._x*e,this._y=t._y*e,this._z=t._z*e,this._lastX=t._lastX*e,this._lastY=t._lastY*e,this._lastZ=t._lastZ*e,this._hasMoved=t.hasMoved,this._particleDirection=t._particleDirection,this._age=t._age,this._lifeTime=t._lifeTime,this._isEmitter=t._isEmitter,this._fade=t._fade,this._fadeTime=t._fadeTime,this._alphaMultiplier=t._alphaMultiplier}}const ji=class ji extends ag{constructor(t="",e=-1){super(),this._roomObjectSpriteId=-1,this._timeStep=.1,this._fuseTime=10,this._energy=1,this._hasIgnited=!1,this._burstPulse=1,this._particles=[],this._name=t,this._roomObjectSpriteId=e,this._particleConfigurations=[]}dispose(){for(const t of this._particles)t.dispose();this._particles=null,this._particleConfigurations=null,super.dispose()}setup(t,e,s,i,r,a,o,h,_,l){this._maxNumberOfParticles=t,this._particlesPerFrame=e,this._force=s,this._emitterDirection=i,this._emitterDirection.normalize(),this._gravity=r,this._airFriction=a,this._explosionShape=o,this._fuseTime=_,this._energy=h,this._burstPulse=l,this.reset()}reset(){for(const t of this._particles)t.dispose();this._particles=[],this._emittedParticles=0,this._hasIgnited=!1,this.init(0,0,0,this._emitterDirection,this._force,this._timeStep,this._fuseTime,!0)}copyStateFrom(t,e){super.copy(t,e),this._force=t._force,this._emitterDirection=t._emitterDirection,this._gravity=t._gravity,this._airFriction=t._airFriction,this._explosionShape=t._explosionShape,this._fuseTime=t._fuseTime,this._energy=t._energy,this._burstPulse=t._burstPulse,this._timeStep=t._timeStep,this._hasIgnited=t._hasIgnited}configureParticle(t,e,s,i){const r={};r.lifeTime=t,r.isEmitter=e,r.frames=s,r.fade=i,this._particleConfigurations.push(r)}ignite(){this._hasIgnited=!0,this._emittedParticles<this._maxNumberOfParticles&&this.age>1&&this.releaseParticles(this,this.direction)}releaseParticles(t,e=null){e||(e=new Ze);const s=new Ze,i=this.getRandomParticleConfiguration();let r=0;for(;r<this._particlesPerFrame;){switch(this._explosionShape){case ji.CONE:s.x=this.randomBoolean(.5)?Math.random():-Math.random(),s.y=-(Math.random()+1),s.z=this.randomBoolean(.5)?Math.random():-Math.random();break;case ji.PLANE:s.x=this.randomBoolean(.5)?Math.random():-Math.random(),s.y=0,s.z=this.randomBoolean(.5)?Math.random():-Math.random();break;case ji.SPHERE:s.x=this.randomBoolean(.5)?Math.random():-Math.random(),s.y=this.randomBoolean(.5)?Math.random():-Math.random(),s.z=this.randomBoolean(.5)?Math.random():-Math.random();break}s.normalize();const a=new ag;let o=0,h=!1,_=!1,l=[];i?(o=Math.floor(Math.random()*i.lifeTime+10),h=i.isEmitter,l=i.frames,_=i.fade):(o=Math.trunc(Math.floor(Math.random()*20+10)),h=!1,l=[]),a.init(t.x,t.y,t.z,s,this._energy,this._timeStep,o,h,l,_),this._particles.push(a),this._emittedParticles++,r++}}getRandomParticleConfiguration(){const t=Math.trunc(Math.floor(Math.random()*this._particleConfigurations.length));return this._particleConfigurations[t]}update(){super.update(),this.accumulateForces(),this.verlet(),this.satisfyConstraints(),!this.isAlive&&this._emittedParticles<this._maxNumberOfParticles&&this.age%this._burstPulse===0&&this.releaseParticles(this,this.direction)}verlet(){if(this.isAlive||this._emittedParticles<this._maxNumberOfParticles){const e=this.x,s=this.y,i=this.z;this.x=(2-this._airFriction)*this.x-(1-this._airFriction)*this.lastX,this.y=(2-this._airFriction)*this.y-(1-this._airFriction)*this.lastY+this._gravity*this._timeStep*this._timeStep,this.z=(2-this._airFriction)*this.z-(1-this._airFriction)*this.lastZ,this.lastX=e,this.lastY=s,this.lastZ=i}const t=[];for(const e of this._particles){e.update();const s=e.x,i=e.y,r=e.z;e.x=(2-this._airFriction)*e.x-(1-this._airFriction)*e.lastX,e.y=(2-this._airFriction)*e.y-(1-this._airFriction)*e.lastY+this._gravity*this._timeStep*this._timeStep,e.z=(2-this._airFriction)*e.z-(1-this._airFriction)*e.lastZ,e.lastX=s,e.lastY=i,e.lastZ=r,(e.y>10||!e.isAlive)&&t.push(e)}for(const e of t)e.isEmitter,this._particles.splice(this._particles.indexOf(e),1),e.dispose()}satisfyConstraints(){}accumulateForces(){for(const t of this._particles);}get particles(){return this._particles}get hasIgnited(){return this._hasIgnited}randomBoolean(t){return Math.random()<t}get roomObjectSpriteId(){return this._roomObjectSpriteId}};ji.CONE="cone",ji.PLANE="plane",ji.SPHERE="sphere";let rd=ji;class N2{constructor(t){this._canvasId=-1,this._hasIgnited=!1,this._centerX=0,this._centerY=0,this._scaleMultiplier=1,this._blend=1,this._bgColor=4278190080,this._isDone=!1,this._emitters=new Xt,this._visualization=t,this._blackOverlayAlphaTransform=new Il,this._blackOverlayAlphaTransform.alpha=1,this._particleColorTransform=new Il,this._identityMatrix=new Me,this._translationMatrix=new Me}dispose(){for(const t of this._emitters.getValues())t.dispose();this._emitters=null,this._canvasTexture&&(this._canvasTexture.destroy(),this._canvasTexture=null),this._blackOverlay&&(this._blackOverlay.destroy(),this._blackOverlay=null),this._emptySprite&&(this._emptySprite.destroy(),this._emptySprite=null),this._blackOverlayAlphaTransform=null,this._particleColorTransform=null,this._identityMatrix=null,this._translationMatrix=null}reset(){this._currentEmitter&&this._currentEmitter.reset(),this._currentEmitter=null,this._hasIgnited=!1,this._isDone=!1,this.updateCanvas()}setAnimation(t){this._currentEmitter&&this._currentEmitter.reset(),this._currentEmitter=this._emitters.getValue(t),this._hasIgnited=!1,this._isDone=!1,this.updateCanvas()}updateCanvas(){if(!(!this._currentEmitter||this._canvasId===-1)&&(this._roomSprite=this._visualization.getSprite(this._canvasId),this._roomSprite&&this._roomSprite.texture)){if(this._roomSprite.width<=1||this._roomSprite.height<=1)return;this._canvasTexture&&(this._canvasTexture.width!==this._roomSprite.width||this._canvasTexture.height!==this._roomSprite.height)&&(this._canvasTexture=null),this.clearCanvas(),this._centerX=-this._roomSprite.offsetX,this._centerY=-this._roomSprite.offsetY,this._roomSprite.texture=this._canvasTexture}}getLayerYOffset(t,e,s){return this._currentEmitter&&this._currentEmitter.roomObjectSpriteId===s?this._currentEmitter.y*this._scaleMultiplier:0}controlsSprite(t){return this._currentEmitter?this._currentEmitter.roomObjectSpriteId==t:!1}updateSprites(){!this._currentEmitter||!this._roomSprite||(this._canvasTexture&&this._roomSprite.texture!==this._canvasTexture&&(this._roomSprite.texture=this._canvasTexture),this._hasIgnited&&this._currentEmitter.roomObjectSpriteId>=0&&(this._visualization.getSprite(this._currentEmitter.roomObjectSpriteId).visible=!1))}updateAnimation(){if(!this._currentEmitter||!this._roomSprite||this._isDone)return;const t=10;!this._hasIgnited&&this._currentEmitter.hasIgnited&&(this._hasIgnited=!0);const e=this._offsetY*this._scaleMultiplier;if(this._currentEmitter.update(),this._hasIgnited){this._currentEmitter.roomObjectSpriteId>=0&&(this._visualization.getSprite(this._currentEmitter.roomObjectSpriteId).visible=!1),this._canvasTexture||this.updateCanvas(),this.clearCanvas();for(const s of this._currentEmitter.particles){const i=this._centerX+(s.x-s.z)*t/10*this._scaleMultiplier,r=this._centerY-e+(s.y+(s.x+s.z)/2)*t/10*this._scaleMultiplier,a=s.getAsset();if(a&&a.texture)if(s.fade&&s.alphaMultiplier<1){this._translationMatrix.identity(),this._translationMatrix.translate(i+a.offsetX,r+a.offsetY);const o=new xt(a.texture);this._particleColorTransform.alpha=s.alphaMultiplier,o.filters=[this._particleColorTransform],Kt.instance.renderer.render(o,{renderTexture:this._canvasTexture,transform:this._translationMatrix,clear:!1})}else{const o=new lo(i+a.offsetX,r+a.offsetY),h=new xt(a.texture);h.x=o.x,h.y=o.y,Kt.instance.renderer.render(h,{renderTexture:this._canvasTexture,clear:!1})}else{const o=new xt(Ft.WHITE);o.tint=16777215,o.x=i-1,o.y=r-1,o.width=2,o.height=2,Kt.instance.renderer.render(o,{renderTexture:this._canvasTexture,clear:!1})}}if(!this._currentEmitter.particles.length){this._isDone=!0;return}}}parseData(t){this._size=t.size,this._canvasId=t.canvasId!==void 0?t.canvasId:-1,this._offsetY=t.offsetY!==void 0?t.offsetY:10,this._scaleMultiplier=this._size/64,this._blend=t.blend!==void 0?t.blend:1,this._blend=Math.min(this._blend,1),this._blackOverlayAlphaTransform.alpha=this._blend;const e=t.bgColor!==void 0?t.bgColor:"0";if(this._bgColor=parseInt(e,16)||0,!(!t.emitters||!t.emitters.length))for(const s of t.emitters){const i=s.id,r=s.name,a=s.spriteId,o=new rd(r,a);this._emitters.add(i,o);const h=s.maxNumParticles,_=s.particlesPerFrame,l=s.burstPulse!==void 0?s.burstPulse:1,c=s.fuseTime,f=s.simulation.force,p=s.simulation.direction,m=s.simulation.gravity,O=s.simulation.airFriction,A=s.simulation.shape,C=s.simulation.energy;for(const L of s.particles){const D=L.lifeTime,U=L.isEmitter||!1,P=L.fade||!1,v=[];for(const F of L.frames)v.push(this._visualization.asset.getAsset(F));o.configureParticle(D,U,v,P)}o.setup(h,_,f,new Ze(0,p,0),m,O,A,C,c,l)}}copyStateFrom(t){let e=0;t._emitters&&t._currentEmitter&&(e=t._emitters.getKey(t._emitters.getValues().indexOf(t._currentEmitter))),this.setAnimation(e),this._currentEmitter&&this._currentEmitter.copyStateFrom(t._currentEmitter,t._size/this._size),this._canvasTexture=null}clearCanvas(){this._emptySprite||(this._emptySprite=new xt(Ft.EMPTY),this._emptySprite.alpha=0),this._canvasTexture?Kt.instance.renderer.render(this._emptySprite,{renderTexture:this._canvasTexture,clear:!0}):this._canvasTexture=Ss.create({width:this._roomSprite.width,height:this._roomSprite.height})}}class FT extends wt{dispose(){if(super.dispose(),this._currentParticleSystem=null,this._particleSystems){for(const t of this._particleSystems.getValues())t.dispose();this._particleSystems=null}}updateObject(t,e){if(super.updateObject(t,e)){if(!this._particleSystems)this.readDefinition(),this._particleSystems?this._currentParticleSystem=this._particleSystems.getValue(t):j.log("ERROR Particle systems could not be read!",this.object.type);else if(t!==this._scale||this._particleSystems.getValue(t)!==this._currentParticleSystem){const s=this._particleSystems.getValue(t);s.copyStateFrom(this._currentParticleSystem),this._currentParticleSystem&&this._currentParticleSystem.reset(),this._currentParticleSystem=s}return!0}return!1}updateSprites(t,e,s){super.updateSprites(t,e,s),this._currentParticleSystem&&this._currentParticleSystem.updateSprites()}updateAnimation(t){return this._currentParticleSystem&&this._currentParticleSystem.updateAnimation(),super.updateAnimation(t)}setAnimation(t){this._currentParticleSystem&&this._currentParticleSystem.setAnimation(t),super.setAnimation(t)}getLayerYOffset(t,e,s){return this._currentParticleSystem&&this._currentParticleSystem.controlsSprite(s)?this._currentParticleSystem.getLayerYOffset(t,e,s):super.getLayerYOffset(t,e,s)}readDefinition(){if(!this.object||!this.object.model)return!1;const t=this.object.model.getValue(g.FURNITURE_FIREWORKS_DATA);if(!t||!t.length)return!1;this._particleSystems=new Xt;for(const e of t){const s=e.size,i=new N2(this);i.parseData(e),this._particleSystems.add(s,i)}return!0}}const zi=class zi extends FT{constructor(){super(...arguments),this._packetType=0,this._ribbonType=0,this._lastAnimationId=0}update(t,e,s,i){this.updatePresentWrap(),super.update(t,e,s,i)}updatePresentWrap(){if(!this.object)return;const t=1e3,e=this.object.model.getValue(g.FURNITURE_EXTRAS),s=parseInt(e),i=Math.floor(s/t),r=s%t;this._packetType=i>zi.MAX_PACKET_TYPE_VALUE?0:i,this._ribbonType=r>zi.MAX_RIBBON_TYPE_VALUE?0:r}getFrameNumber(t,e){if(this._lastAnimationId===zi.PRESENT_DEFAULT_STATE){if(e<=1)return this._packetType;if(e===2)return this._ribbonType}return super.getFrameNumber(t,e)}getSpriteAssetName(t,e){const s=this.getValidSize(t);let i=this._type,r="";e<this.spriteCount-1?r=String.fromCharCode(97+e):r="sd";const a=this.getFrameNumber(t,e);return i=i+("_"+s+"_"+r+"_"+this.direction),i=i+("_"+a),i}setAnimation(t){this._lastAnimationId=t,super.setAnimation(t)}};zi.PRESENT_DEFAULT_STATE=0,zi.MAX_PACKET_TYPE_VALUE=9,zi.MAX_RIBBON_TYPE_VALUE=11;let nd=zi;class D2 extends Ci{constructor(){super(...arguments),this._packetType=0,this._ribbonType=0}update(t,e,s,i){this.updatePresentWrap(),super.update(t,e,s,i)}updatePresentWrap(){if(!this.object)return;const t=this.object.model.getValue(g.FURNITURE_EXTRAS),e=1e3,s=parseInt(t);this._packetType=Math.floor(s/e),this._ribbonType=s%e}getFrameNumber(t,e){return e<=1?this._packetType:this._ribbonType}getSpriteAssetName(t,e){const s=this.getValidSize(t);let i=this._type,r="";e<this.spriteCount-1?r=String.fromCharCode(97+e):r="sd";const a=this.getFrameNumber(t,e);return i=i+("_"+s+"_"+r+"_"+this.direction),i=i+("_"+a),i}}const pe=class pe extends wt{constructor(){super(),this._color1=pe.DEFAULT_COLOR_1,this._color2=pe.DEFAULT_COLOR_2,this._badgeAssetNameNormalScale="",this._badgeAssetNameSmallScale=""}updateModel(t){const e=super.updateModel(t);if(this._badgeAssetNameNormalScale===""){const r=this.object.model.getValue(g.FURNITURE_GUILD_CUSTOMIZED_ASSET_NAME);r&&(this._badgeAssetNameNormalScale=r,this._badgeAssetNameSmallScale=this._badgeAssetNameNormalScale+"_32")}const s=this.object.model.getValue(g.FURNITURE_GUILD_CUSTOMIZED_COLOR_1);this._color1=s||pe.DEFAULT_COLOR_1;const i=this.object.model.getValue(g.FURNITURE_GUILD_CUSTOMIZED_COLOR_2);return this._color2=i||pe.DEFAULT_COLOR_2,e}getLayerColor(t,e,s){switch(this.getLayerTag(t,this._direction,e)){case pe.PRIMARY_COLOUR_SPRITE_TAG:return this._color1;case pe.SECONDARY_COLOUR_SPRITE_TAG:return this._color2}return super.getLayerColor(t,e,s)}getSpriteAssetName(t,e){return this.getLayerTag(t,this._direction,e)===pe.BADGE?t===32?this._badgeAssetNameSmallScale:this._badgeAssetNameNormalScale:super.getSpriteAssetName(t,e)}getLibraryAssetNameForSprite(t,e){return e.tag===pe.BADGE?"%group.badge.url%"+e.libraryAssetName.replace("badge_",""):super.getLibraryAssetNameForSprite(t,e)}};pe.PRIMARY_COLOUR_SPRITE_TAG="COLOR1",pe.SECONDARY_COLOUR_SPRITE_TAG="COLOR2",pe.BADGE="BADGE",pe.DEFAULT_COLOR_1=15658734,pe.DEFAULT_COLOR_2=4934475;let ad=pe;const Ts=class Ts extends oh{updateModel(t){const e=super.updateModel(t);if(!this.hasThumbnailImage){const r=this.object.model.getValue(g.FURNITURE_GUILD_CUSTOMIZED_ASSET_NAME);r&&r.length&&this.setThumbnailImages(this.getBitmapAsset(r))}const s=this.object.model.getValue(g.FURNITURE_GUILD_CUSTOMIZED_COLOR_1);this._color1=s||Ts.DEFAULT_COLOR_1;const i=this.object.model.getValue(g.FURNITURE_GUILD_CUSTOMIZED_COLOR_2);return this._color2=i||Ts.DEFAULT_COLOR_2,e}generateTransformedThumbnail(t,e){const i=new Me,r=e.width/t.width;switch(this.direction){case 2:i.a=r,i.b=-.5*r,i.c=0,i.d=r*1.1,i.tx=0,i.ty=.5*r*t.width;break;case 0:case 4:i.a=r,i.b=.5*r,i.c=0,i.d=r*1.1,i.tx=0,i.ty=0;break;default:i.a=r,i.b=0,i.c=0,i.d=r,i.tx=0,i.ty=0}const a=new xt(t);return a.transform.setFromMatrix(i),a.position.set(0),Ut.generateTexture(a)}getLayerColor(t,e,s){switch(this.getLayerTag(t,this._direction,e)){case Ts.PRIMARY_COLOUR_SPRITE_TAG:return this._color1;case Ts.SECONDARY_COLOUR_SPRITE_TAG:return this._color2}return super.getLayerColor(t,e,s)}getLibraryAssetNameForSprite(t,e){return e.tag===Ts.THUMBNAIL&&this.object&&this.object.model.getValue(g.FURNITURE_GUILD_CUSTOMIZED_ASSET_NAME)?"%group.badge.url%"+this.object.model.getValue(g.FURNITURE_GUILD_CUSTOMIZED_ASSET_NAME):super.getLibraryAssetNameForSprite(t,e)}getBitmapAsset(t){const e=this.asset.getAsset(t);return!e||!e.texture?null:e.texture}};Ts.PRIMARY_COLOUR_SPRITE_TAG="COLOR1",Ts.SECONDARY_COLOUR_SPRITE_TAG="COLOR2",Ts.DEFAULT_COLOR_1=15658734,Ts.DEFAULT_COLOR_2=4934475;let od=Ts;const ms=class ms extends wt{constructor(){super(),this._stateQueue=[],this._running=!1}setAnimation(t){if(t===-1&&!this._running){this._running=!0,this._stateQueue=[],this._stateQueue.push(ms.ANIMATION_ID_START_ROLL),this._stateQueue.push(ms.ANIMATION_ID_ROLL);return}if(t>0&&t<=ms.ANIMATION_ID_OFFSET_SLOW1){if(this._running){this._running=!1,this._stateQueue=[],this._stateQueue.push(ms.ANIMATION_ID_OFFSET_SLOW1+t),this._stateQueue.push(ms.ANIMATION_ID_OFFSET_SLOW2+t),this._stateQueue.push(t);return}super.setAnimation(t)}}updateAnimation(t){return this.getLastFramePlayed(1)&&this.getLastFramePlayed(2)&&this.getLastFramePlayed(3)&&this._stateQueue.length&&super.setAnimation(this._stateQueue.shift()),super.updateAnimation(t)}};ms.ANIMATION_ID_OFFSET_SLOW1=10,ms.ANIMATION_ID_OFFSET_SLOW2=20,ms.ANIMATION_ID_START_ROLL=31,ms.ANIMATION_ID_ROLL=32;let hd=ms;class L2 extends vT{constructor(){super(...arguments),this._needsTransform=!0}transformGifTextures(t){if(!this._gifCollection)return;const e=this._gifCollection.textures;if(e.length){for(let s=0;s<e.length;s++){const i=e[s];if(!i||!this.getAsset(`${this._imageUrl}_${s}`))continue;const a=1.1,o=new Me,h=t.width/i.width;switch(this.direction){case 2:o.a=h,o.b=-.5*h,o.c=0,o.d=h*a,o.tx=0,o.ty=.5*h*i.width;break;case 0:case 4:o.a=h,o.b=.5*h,o.c=0,o.d=h*a,o.tx=0,o.ty=0;break;default:o.a=h,o.b=0,o.c=0,o.d=h,o.tx=0,o.ty=0}const _=new xt(i),l=Ss.create({width:t.width+o.tx,height:t.height+o.ty});Kt.instance.renderer.render(_,{renderTexture:l,clear:!0,transform:o}),this.asset.disposeAsset(`${this._imageUrl}_${s}`),this.asset.addAsset(`${this._imageUrl}_${s}`,l,!0,t.x,t.y,t.flipH,t.flipV)}this._needsTransform=!1}}generateTransformedImage(t,e){const i=new Me,r=e.width/t.width;switch(this.direction){case 2:i.a=r,i.b=-.5*r,i.c=0,i.d=r*1.1,i.tx=0,i.ty=.5*r*t.width;break;case 0:case 4:i.a=r,i.b=.5*r,i.c=0,i.d=r*1.1,i.tx=0,i.ty=0;break;default:i.a=r,i.b=0,i.c=0,i.d=r,i.tx=0,i.ty=0}const a=new xt(t),o=Ss.create({width:e.width+i.tx,height:e.height+i.ty});Kt.instance.renderer.render(a,{renderTexture:o,clear:!0,transform:i}),this.asset.disposeAsset(`${this._imageUrl}_0`),this.asset.addAsset(`${this._imageUrl}_0`,o,!0,a.x,a.y,e.flipH,e.flipV),this._needsTransform=!1}checkAndCreateImageForCurrentState(){super.checkAndCreateImageForCurrentState(),this._needsTransform=!0}getSpriteAssetName(t,e){return this.getLayerTag(t,this._direction,e)===eo.BRANDED_IMAGE&&this._imageUrl?(this._needsTransform&&(this._isAnimated?this.transformGifTextures(this.getAsset(super.getSpriteAssetName(t,e))):this.generateTransformedImage(_s().getTexture(this._imageUrl),this.getAsset(super.getSpriteAssetName(t,e)))),`${this._imageUrl}_${this.getFrameNumber(t,e)}`):super.getSpriteAssetName(t,e)}}class _d extends Xs{constructor(){super(),this._avatarData=new rh}dispose(){super.dispose(),this._avatarData&&(this._avatarData.dispose(),this._avatarData=null)}createAvatarImage(t,e,s=null,i=null,r=null){return this._avatarData.createAvatarImage(t,e,s,i,r)}set avatarManager(t){this._avatarData.avatarManager=t}}const bn=class bn extends Ci{constructor(){super(),this._mannequinScale=-1,this._figure=null,this._gender=null,this._dynamicAssetName=null,this._needsUpdate=!1,this._placeHolderFigure="hd-99999-99998",this._disposed=!1}initialize(t){return t instanceof _d?super.initialize(t):!1}dispose(){this._disposed||(this._disposed=!0,this._dynamicAssetName&&this.asset&&(this.asset.disposeAsset(this._dynamicAssetName),this._dynamicAssetName=null),super.dispose())}updateObject(t,e){const s=super.updateObject(t,e);return s&&this._mannequinScale!==t&&(this._mannequinScale=t,this.updateAvatar()),s}updateModel(t){let e=super.updateModel(t);if(e){const s=this.object.model.getValue(g.FURNITURE_MANNEQUIN_FIGURE)||null;s&&(this._figure=s+"."+this._placeHolderFigure,this._gender=this.object.model.getValue(g.FURNITURE_MANNEQUIN_GENDER)||null,this.updateAvatar())}return e=e||this._needsUpdate,this._needsUpdate=!1,e}updateAvatar(t=!1){if(!this.avatarExists()||t){const e=this.data.createAvatarImage(this._figure,this._mannequinScale,this._gender,this);e&&(e.setDirection(Ce.FULL,this.direction),this._dynamicAssetName&&this.asset.disposeAsset(this._dynamicAssetName),this.asset.addAsset(this.getAvatarAssetName(),e.getImage(Ce.FULL,!1,1,!1),!0),this._dynamicAssetName=this.getAvatarAssetName(),this._needsUpdate=!0,e.dispose())}}avatarExists(){return this._figure&&this.getAsset(this.getAvatarAssetName())!==null}getAvatarAssetName(){return"mannequin_"+this._figure+"_"+this._mannequinScale+"_"+this.direction+"_"+this.object.id}resetFigure(t){t===this._figure&&this.updateAvatar(!0)}getSpriteAssetName(t,e){const s=this.getLayerTag(t,this.direction,e);return this._figure&&s===bn.AVATAR_IMAGE_SPRITE_TAG&&this.avatarExists()?this.getAvatarAssetName():super.getSpriteAssetName(t,e)}getLayerXOffset(t,e,s){return this.getLayerTag(t,e,s)===bn.AVATAR_IMAGE_SPRITE_TAG&&this.avatarExists()?-this.getSprite(s).width/2:super.getLayerXOffset(t,e,s)}getLayerYOffset(t,e,s){return this.getLayerTag(t,e,s)===bn.AVATAR_IMAGE_SPRITE_TAG&&this.avatarExists()?-this.getSprite(s).height:super.getLayerYOffset(t,e,s)}get disposed(){return this._disposed}get data(){return this._data}};bn.AVATAR_IMAGE_SPRITE_TAG="avatar_image";let ld=bn;const ze=class ze extends wt{constructor(){super(),this._animOffsetIndex=[]}updateAnimation(t){this._animSpeedIndex||this.initItems(t);let e=this.getSprite(2);return e&&(this._animOffsetIndex[0]=this.getNewPoint(t,0)),e=this.getSprite(3),e&&(this._animOffsetIndex[1]=this.getNewPoint(t,1)),super.updateAnimation(t)}getNewPoint(t,e){let s=0,i=this._animPhaseIndex[e],r=this._animDirectionIndex[e];const a=this._animSpeedIndex[e],o=this._animFactorIndex[e];let h=1;t==32?(s=ze.AREA_DIAMETER_SMALL,h=.5):s=ze.AREA_DIAMETER_LARGE;const _=i+r*a;Math.abs(_)>=s&&(r>0?i=i-(_-s):i=i+(-s-_),r=-r,this._animDirectionIndex[e]=r);const l=(s-Math.abs(i))*o;let c=r*Math.sin(Math.abs(i/4))*l;return r>0?c=c-l:c=c+l,i=i+r*a*h,this._animPhaseIndex[e]=i,Math.trunc(c)==0&&(this._animFactorIndex[e]=this.getRandomAmplitudeFactor()),new lo(i,c)}initItems(t){let e;t===32?e=ze.AREA_DIAMETER_SMALL:e=ze.AREA_DIAMETER_LARGE,this._animPhaseIndex=[],this._animPhaseIndex.push(Math.random()*e*1.5),this._animPhaseIndex.push(Math.random()*e*1.5),this._animDirectionIndex=[],this._animDirectionIndex.push(1),this._animDirectionIndex.push(-1),this._animSpeedIndex=[],this._animSpeedIndex.push(ze.ANIM_SPEED_FAST),this._animSpeedIndex.push(ze.ANIM_SPEED_SLOW),this._animFactorIndex=[],this._animFactorIndex.push(this.getRandomAmplitudeFactor()),this._animFactorIndex.push(this.getRandomAmplitudeFactor())}getLayerXOffset(t,e,s){return(s===2||s===3)&&this._animOffsetIndex.length==2?this._animOffsetIndex[s-2].x:super.getLayerXOffset(t,e,s)}getLayerYOffset(t,e,s){return(s===2||s===3)&&this._animOffsetIndex.length==2?this._animOffsetIndex[s-2].y:super.getLayerYOffset(t,e,s)}getRandomAmplitudeFactor(){return Math.random()*30/100+.15}};ze.UPDATE_INTERVAL=2,ze.AREA_DIAMETER_SMALL=15,ze.AREA_DIAMETER_LARGE=31,ze.ANIM_SPEED_FAST=2,ze.ANIM_SPEED_SLOW=1;let cd=ze;const B_=class B_{constructor(t,e,s,i,r,a){this._name=t,this._index=e,this._radius=s,this._arcSpeed=i*Math.PI*2/360,this._arcOffset=r*Math.PI*2/360,this._height=a,this._position=0,this._positionVector=new R(0,0,0),this._children=[]}dispose(){for(;this._children.length>0;)this._children.shift().dispose()}update(t,e,s){this._position=this._position+this._arcSpeed/B_.SYSTEM_TEMPO,t[this._index]=this.getPositionVector(e,s);for(const i of this._children)i.update(t,this._positionVector,s)}getPositionVector(t,e){const s=this._radius*Math.cos(this._position+this._arcOffset),i=this._radius*Math.sin(this._position+this._arcOffset);return this._positionVector.x=(s-i)*(e/2),this._positionVector.y=(i+s)*(e/2)*.5-this._height*(e/2),this._positionVector.z=-Math.trunc(4*(s+i)-.7),t&&this._positionVector.add(t),this._positionVector}addChild(t){this._children.indexOf(t)>=0||this._children.push(t)}hasChild(t){return!!this.getChild(t)}getChild(t){for(const e of this._children){if(e.name===t)return e;if(e.hasChild(t))return e.getChild(t)}return null}get name(){return this._name}};B_.SYSTEM_TEMPO=30;let ud=B_;class P2 extends wt{constructor(){super(),this._offsetArray=[],this._rootPosition=new R}dispose(){if(this._planetIndex)for(;this._planetIndex.length>0;)this._planetIndex.shift().dispose();this._planetIndex=null,this._planetNameIndex=null}updateAnimation(t){if(!this._planetIndex&&this.spriteCount>0&&!this.processPlanets())return 0;if(this._planetIndex){for(const e of this._planetIndex)e.update(this._offsetArray,this._rootPosition,t);return super.updateAnimation(t)}return 0}getLayerXOffset(t,e,s){return this._offsetArray[s]?this._offsetArray[s].x:super.getLayerXOffset(t,e,s)}getLayerYOffset(t,e,s){return this._offsetArray[s]?this._offsetArray[s].y:super.getLayerYOffset(t,e,s)}getLayerZOffset(t,e,s){return this._offsetArray[s]?this._offsetArray[s].z:super.getLayerZOffset(t,e,s)}processPlanets(){if(!this.object||!this.object.model)return;const t=this.object.model.getValue(g.FURNITURE_PLANETSYSTEM_DATA);if(!t)return!1;this._planetIndex=[],this._planetNameIndex=[];for(const e of t)this.getSprite(e.id)&&this.addPlanet(e.name,e.id,e.parent,e.radius||0,e.arcSpeed||0,e.arcOffset||0,e.height||0);return!0}addPlanet(t,e,s,i,r,a,o){if(!this._planetIndex)return;const h=new ud(t,e,i,r,a,o),_=this.getPlanet(s);_?_.addChild(h):(this._planetIndex.push(h),this._planetNameIndex.push(t))}getPlanet(t){for(const e of this._planetIndex){if(e.name===t)return e;if(e.hasChild(t))return e.getChild(t)}return null}}class U2 extends wt{}const li=class li extends wt{constructor(){super(),this._stateQueue=[],this._animationCounter=-1}setAnimation(t){return t===li.ANIMATION_ID_ROLL_ONCE&&(this._stateQueue=[],this._stateQueue.push(li.ANIMATION_ID_NORMAL),this._animationCounter=li.ANIMATION_DURATION),super.setAnimation(t)}updateAnimation(t){return this._animationCounter>0&&this._animationCounter--,this._animationCounter||this._stateQueue.length&&super.setAnimation(this._stateQueue.shift()),super.updateAnimation(t)}usesAnimationResetting(){return!0}};li.ANIMATION_ID_ROLL=3,li.ANIMATION_ID_ROLL_ONCE=2,li.ANIMATION_ID_NORMAL=1,li.ANIMATION_DURATION=15;let dd=li;class y2 extends wt{usesAnimationResetting(){return!0}}class v2 extends eo{imageReady(t,e){super.imageReady(t,e),t&&this.setImageOffset(t.width,t.height)}setImageOffset(t,e){const s=new UT;s.setDirection(1,0,-e),s.setDirection(3,0,0),s.setDirection(5,-t,0),s.setDirection(7,-t,-e),s.setDirection(4,-t/2,-e/2),this._imageOffset=s}getLayerXOffset(t,e,s){if(this._imageOffset){const i=this._imageOffset.getXOffset(e,0);if(i!==void 0)return i+this._offsetX}return super.getLayerXOffset(t,e,s)+this._offsetX}getLayerYOffset(t,e,s){if(this._imageOffset){const i=this._imageOffset.getYOffset(e,0);if(i!==void 0)return i+this._offsetY}return super.getLayerYOffset(t,e,s)+this._offsetY}getLayerZOffset(t,e,s){return super.getLayerZOffset(t,e,s)+-this._offsetZ}getLayerIgnoreMouse(t,e,s){return!0}}const Ys=class Ys extends wt{getFrameNumber(t,e){const s=this.getLayerTag(t,this.direction,e),i=this.object.getState(0);switch(s){case Ys.ONES_SPRITE:return Math.floor(i%10);case Ys.TENS_SPRITE:return Math.floor(i/10%10);case Ys.HUNDREDS_SPRITE:return Math.floor(i/100%10);case Ys.THOUSANDS_SPRITE:return Math.floor(i/1e3%10);default:return super.getFrameNumber(t,e)}}};Ys.ONES_SPRITE="ones_sprite",Ys.TENS_SPRITE="tens_sprite",Ys.HUNDREDS_SPRITE="hundreds_sprite",Ys.THOUSANDS_SPRITE="thousands_sprite";let Ed=Ys;class b2 extends wt{constructor(){super(...arguments),this._internalFrameIncreaseCounter=0}updateAnimations(t){return this._internalFrameIncreaseCounter=this._internalFrameIncreaseCounter+this.object.model.getValue(g.FURNITURE_SOUNDBLOCK_RELATIVE_ANIMATION_SPEED),this._frameIncrease=this._internalFrameIncreaseCounter,this._internalFrameIncreaseCounter=this._internalFrameIncreaseCounter-this._frameIncrease,super.updateAnimations(t)}}class F2 extends Ci{getLayerColor(t,e,s){return this._data?this._data.getLayerColor(t,e,s):jr.DEFAULT_COLOR}}const le=class le extends wt{constructor(){super(),this._stateQueue=[],this._running=!1,super.setAnimation(le.ANIMATION_ID_OFF)}setAnimation(t){if(t===0&&!this._running){this._running=!0,this._stateQueue=[],this._stateQueue.push(le.ANIMATION_ID_START_ROLL),this._stateQueue.push(le.ANIMATION_ID_ROLL);return}if(t>0&&t<=le.ANIMATION_ID_OFFSET_SLOW2){if(this._running){this._running=!1,this._stateQueue=[],this.direction===2?(this._stateQueue.push(le.ANIMATION_ID_OFFSET_SLOW1+5),this._stateQueue.push(le.ANIMATION_ID_OFFSET_SLOW2+5)):(this._stateQueue.push(le.ANIMATION_ID_OFFSET_SLOW1+t),this._stateQueue.push(le.ANIMATION_ID_OFFSET_SLOW2+t)),this._stateQueue.push(le.ANIMATION_ID_OFF);return}super.setAnimation(le.ANIMATION_ID_OFF)}}updateAnimation(t){return this.getLastFramePlayed(11)&&this._stateQueue.length&&super.setAnimation(this._stateQueue.shift()),super.updateAnimation(t)}};le.ANIMATION_ID_OFFSET_SLOW1=20,le.ANIMATION_ID_OFFSET_SLOW2=10,le.ANIMATION_ID_START_ROLL=31,le.ANIMATION_ID_ROLL=32,le.ANIMATION_ID_OFF=30;let gd=le;const We=class We extends wt{updateObject(t,e){return super.updateObject(t,e),!0}getFrameNumber(t,e){const s=this.object.model.getValue(g.FURNITURE_VOTE_COUNTER_COUNT);switch(this.getLayerTag(t,this.direction,e)){case We.ONES_SPRITE:return s%10;case We.TENS_SPRITE:return s/10%10;case We.HUNDREDS_SPRITE:return s/100%10;default:return super.getFrameNumber(t,e)}}getLayerAlpha(t,e,s){if(this.object.model.getValue(g.FURNITURE_VOTE_COUNTER_COUNT)===We.HIDE_COUNTER_SCORE)switch(this.getLayerTag(t,e,s)){case We.ONES_SPRITE:case We.TENS_SPRITE:case We.HUNDREDS_SPRITE:return 0}return super.getLayerAlpha(t,e,s)}};We.ONES_SPRITE="ones_sprite",We.TENS_SPRITE="tens_sprite",We.HUNDREDS_SPRITE="hundreds_sprite",We.HIDE_COUNTER_SCORE=-1;let fd=We;const Re=class Re extends wt{getFrameNumber(t,e){const s=this.object.model.getValue(g.FURNITURE_VOTE_MAJORITY_RESULT);switch(this.getLayerTag(t,this.direction,e)){case Re.ONES_SPRITE:return s%10;case Re.TENS_SPRITE:return s/10%10;case Re.HUNDREDS_SPRITE:return s/100%10;default:return super.getFrameNumber(t,e)}}getLayerAlpha(t,e,s){const i=this.object.model.getValue(g.FURNITURE_VOTE_MAJORITY_RESULT);if(Re.HIDE_RESULTS_STATES.indexOf(this.object.getState(0))!==-1||i===Re.HIDE_RESULTS_VALUE)switch(this.getLayerTag(t,e,s)){case Re.ONES_SPRITE:case Re.TENS_SPRITE:case Re.HUNDREDS_SPRITE:return 0}return super.getLayerAlpha(t,e,s)}};Re.ONES_SPRITE="ones_sprite",Re.TENS_SPRITE="tens_sprite",Re.HUNDREDS_SPRITE="hundreds_sprite",Re.HIDE_RESULTS_STATES=[-1,1],Re.HIDE_RESULTS_VALUE=-1;let Id=Re;class x2 extends wt{}const w_=class w_ extends bT{getThumbnailURL(){if(!this.object)return null;const t=this.object.model.getValue(g.FURNITURE_DATA);return t&&t[w_.THUMBNAIL_URL]||null}};w_.THUMBNAIL_URL="THUMBNAIL_URL";let Td=w_;class G2{constructor(t){this._sprite=new xt(t),this._texture=null,this._amount=-1,this._alpha=0}renderBubble(t){if(!this._sprite||this._amount===t)return null;const e=new Rs;e.addChild(this._sprite);const s=new em("+"+t,{fontFamily:"Arial",fontSize:9,fill:16777215,align:"center"});return s.anchor.x=.5,s.x=this._sprite.width/2,s.y=19,e.addChild(s),this._texture?Kt.instance.renderer.render(e,{renderTexture:this._texture,clear:!0}):this._texture=Ut.generateTexture(e),this._texture}get amount(){return this._amount}set amount(t){this._amount=t}get alpha(){return this._alpha}set alpha(t){this._alpha=t}}class xT extends $d{constructor(){super(),this._isAllowedToTurnHead=!0}createSizeData(t,e,s){return t>1?new hr(e,s):new ah(e,s)}defineVisualizations(t){return this._isAllowedToTurnHead=!0,super.defineVisualizations(t)}processVisualElement(t,e,s){if(!t||!e||!s)return!1;switch(e){case"postures":if(!(t instanceof hr)||!t.processPostures(s))return!1;break;case"gestures":if(!(t instanceof hr)||!t.processGestures(s))return!1;break;default:if(!super.processVisualElement(t,e,s))return!1;break}return!0}postureToAnimation(t,e){const s=this.getSizeData(t);return s?s.postureToAnimation(e):hr.DEFAULT}getGestureDisabled(t,e){const s=this.getSizeData(t);return s?s.getGestureDisabled(e):!1}gestureToAnimation(t,e){const s=this.getSizeData(t);return s?s.gestureToAnimation(e):hr.DEFAULT}animationToPosture(t,e,s){const i=this.getSizeData(t);return i?i.animationToPosture(e,s):null}animationToGesture(t,e){const s=this.getSizeData(t);return s?s.animationToGesture(e):null}getGestureForAnimationId(t,e){const s=this.getSizeData(t);return s?s.getGestureForAnimationId(e):null}totalPostures(t){const e=this.getSizeData(t);return e?e.totalPostures:0}totalGestures(t){const e=this.getSizeData(t);return e?e.totalGestures:0}get isAllowedToTurnHead(){return this._isAllowedToTurnHead}}const Dt=class Dt extends wt{constructor(){for(super(),this._posture="",this._gesture="",this._isSleeping=!1,this._headDirection=-1,this._headOnly=!1,this._nonHeadSprites=[],this._headSprites=[],this._saddleSprites=[],this._animationOver=!1,this._paletteIndex=-1,this._paletteName="",this._customLayerIds=[],this._customPartIds=[],this._customPaletteIds=[],this._isRiding=!1,this._color=16777215,this._experience=0,this._experienceTimestamp=0,this._experienceData=null,this._previousAnimationDirection=-1,this._animationStates=[];this._animationStates.length<Dt.ANIMATION_INDEX_COUNT;)this._animationStates.push(new yT)}initialize(t){if(!(t instanceof xT))return!1;const e=this.getPetAdditionAsset(Dt.PET_EXPERIENCE_BUBBLE);return e&&(this._experienceData=new G2(e)),super.initialize(t)}dispose(){if(super.dispose(),this._animationStates){for(;this._animationStates.length;){const t=this._animationStates[0];t&&t.dispose(),this._animationStates.pop()}this._animationStates=null}}getAnimationId(t){return t.animationId}update(t,e,s,i){super.update(t,e,s,i),this.updateExperienceBubble(e)}updateExperienceBubble(t){if(this._experienceData&&(this._experienceData.alpha=0,this._experienceTimestamp)){const e=t-this._experienceTimestamp;e<Dt.EXPERIENCE_BUBBLE_VISIBLE_IN_MS?this._experienceData.alpha=Math.sin(e/Dt.EXPERIENCE_BUBBLE_VISIBLE_IN_MS*Math.PI)*255:this._experienceTimestamp=0;const s=this.getSprite(this.totalSprites-1);if(s){if(this._experienceData.alpha>0){const i=this._experienceData.renderBubble(this._experience);if(i){s.texture=i,s.offsetX=-20,s.offsetY=-80,s.alpha=this._experienceData.alpha,s.visible=!0,s.relativeDepth=-.2;return}}s.texture=null,s.visible=!1}}}updateModel(t){const e=this.object&&this.object.model;if(!e||this.updateModelCounter===e.updateCounter)return!1;const s=e.getValue(g.FIGURE_POSTURE),i=e.getValue(g.FIGURE_GESTURE);this.setPostureAndGesture(s,i);let r=e.getValue(g.FURNITURE_ALPHA_MULTIPLIER)||null;(r===null||isNaN(r))&&(r=1),this._alphaMultiplier!==r&&(this._alphaMultiplier=r,this._alphaChanged=!0),this._isSleeping=e.getValue(g.FIGURE_SLEEP)>0;const a=e.getValue(g.HEAD_DIRECTION);!isNaN(a)&&this.data.isAllowedToTurnHead?this._headDirection=a:this._headDirection=this.object.getDirection().x,this._experience=e.getValue(g.FIGURE_GAINED_EXPERIENCE),this._experienceTimestamp=e.getValue(g.FIGURE_EXPERIENCE_TIMESTAMP);const o=e.getValue(g.PET_PALETTE_INDEX),h=e.getValue(g.PET_CUSTOM_LAYER_IDS),_=e.getValue(g.PET_CUSTOM_PARTS_IDS),l=e.getValue(g.PET_CUSTOM_PALETTE_IDS),c=e.getValue(g.PET_IS_RIDING),f=e.getValue(g.PET_HEAD_ONLY),p=e.getValue(g.PET_COLOR);return o!==this._paletteIndex&&(this._paletteIndex=o,this._paletteName=this._paletteIndex.toString()),this._customLayerIds=h||[],this._customPartIds=_||[],this._customPaletteIds=l||[],this._isRiding=!isNaN(c)&&c>0,this._headOnly=!isNaN(f)&&f>0,!isNaN(p)&&this._color!==p&&(this._color=p),this.updateModelCounter=e.updateCounter,!0}updateAnimation(t){if(this.object){const e=this.object.getDirection().x;e!==this._previousAnimationDirection&&(this._previousAnimationDirection=e,this.resetAllAnimationFrames())}return super.updateAnimation(t)}setPostureAndGesture(t,e){this.data&&(t!==this._posture&&(this._posture=t,this.setAnimationForIndex(Dt.POSTURE_ANIMATION_INDEX,this.data.postureToAnimation(this._scale,t))),this.data.getGestureDisabled(this._scale,t)&&(e=null),e!==this._gesture&&(this._gesture=e,this.setAnimationForIndex(Dt.GESTURE_ANIMATION_INDEX,this.data.gestureToAnimation(this._scale,e))))}getAnimationStateData(t){return t>=0&&t<this._animationStates.length?this._animationStates[t]:null}setAnimationForIndex(t,e){const s=this.getAnimationStateData(t);s&&this.setSubAnimation(s,e)&&(this._animationOver=!1)}resetAllAnimationFrames(){this._animationOver=!1;let t=this._animationStates.length-1;for(;t>=0;){const e=this._animationStates[t];e&&e.setLayerCount(this.animatedLayerCount),t--}}updateAnimations(t){if(this._animationOver)return 0;let e=!0,s=0,i=0;for(;i<this._animationStates.length;){const r=this._animationStates[i];if(r&&!r.animationOver){const a=this.updateFramesForAnimation(r,t);s=s|a,r.animationOver?(Jt.isTransitionFromAnimation(r.animationId)||Jt.isTransitionToAnimation(r.animationId))&&(this.setAnimationForIndex(i,r.animationAfterTransitionId),e=!1):e=!1}i++}return this._animationOver=e,s}getSpriteAssetName(t,e){if(this._headOnly&&this.isNonHeadSprite(e)||this._isRiding&&this._parser3(e))return null;const s=this.totalSprites;if(e<s-Dt.ADDITIONAL_SPRITE_COUNT){const i=this.getValidSize(t);if(e<s-(1+Dt.ADDITIONAL_SPRITE_COUNT)){if(e>=Xs.LAYER_LETTERS.length)return null;const r=Xs.LAYER_LETTERS[e];return i===1?this._type+"_icon_"+r:this._type+"_"+i+"_"+r+"_"+this.getDirection(t,e)+"_"+this.getFrameNumber(i,e)}return this._type+"_"+i+"_sd_"+this.getDirection(t,e)+"_0"}return null}getLayerColor(t,e,s){return e<this.totalSprites-Dt.ADDITIONAL_SPRITE_COUNT?this._color:16777215}getLayerXOffset(t,e,s){let i=super.getLayerXOffset(t,e,s),r=this._animationStates.length-1;for(;r>=0;){const a=this._animationStates[r];if(a){const o=a.getFrame(s);o&&(i+=o.x)}r--}return i}getLayerYOffset(t,e,s){let i=super.getLayerYOffset(t,e,s),r=this._animationStates.length-1;for(;r>=0;){const a=this._animationStates[r];if(a){const o=a.getFrame(s);o&&(i+=o.y)}r--}return i}getLayerZOffset(t,e,s){return this.data?this.data.getLayerZOffset(t,this.getDirection(t,s),s):Ot.DEFAULT_ZOFFSET}getDirection(t,e){return this.isHeadSprite(e)?this.data.getValidDirection(t,this._headDirection):this._direction}getFrameNumber(t,e){let s=this._animationStates.length-1;for(;s>=0;){const i=this._animationStates[s];if(i){const r=i.getFrame(e);if(r)return r.id}s--}return super.getFrameNumber(t,e)}isHeadSprite(t){if(this._headSprites[t]===void 0){const e=this.data.getLayerTag(this._scale,Qi.USE_DEFAULT_DIRECTION,t)===Dt.HEAD,s=this.data.getLayerTag(this._scale,Qi.USE_DEFAULT_DIRECTION,t)===Dt.HAIR;e||s?this._headSprites[t]=!0:this._headSprites[t]=!1}return this._headSprites[t]}isNonHeadSprite(t){if(this._nonHeadSprites[t]===void 0)if(t<this.totalSprites-(1+Dt.ADDITIONAL_SPRITE_COUNT)){const e=this.data.getLayerTag(this._scale,Qi.USE_DEFAULT_DIRECTION,t);e&&e.length>0&&e!==Dt.HEAD&&e!==Dt.HAIR?this._nonHeadSprites[t]=!0:this._nonHeadSprites[t]=!1}else this._nonHeadSprites[t]=!0;return this._nonHeadSprites[t]}_parser3(t){return this._saddleSprites[t]===void 0&&(this.data.getLayerTag(this._scale,Qi.USE_DEFAULT_DIRECTION,t)===Dt.SADDLE?this._saddleSprites[t]=!0:this._saddleSprites[t]=!1),this._saddleSprites[t]}getAsset(t,e=-1){if(!this.asset)return null;const s=this._customLayerIds.indexOf(e);let i=this._paletteName,r=-1,a=-1;return s>-1&&(r=this._customPartIds[s],a=this._customPaletteIds[s],i=a>-1?a.toString():this._paletteName),!isNaN(r)&&r>-1&&(t=t+"_"+r),this.asset.getAssetWithPalette(t,i)}getAdditionalLayerCount(){return super.getAdditionalLayerCount()+Dt.ADDITIONAL_SPRITE_COUNT}setLayerCount(t){super.setLayerCount(t),this._headSprites=[]}getPostureForAsset(t,e){const s=e.split("_");let i=s.length,r=0;for(;r<s.length;){if(s[r]==="64"||s[r]==="32"){i=r+3;break}r++}let a=null;if(i<s.length){let o=s[i];o=o.split("@")[0],a=this.data.animationToPosture(t,parseInt(o)/100,!1),a||(a=this.data.getGestureForAnimationId(t,parseInt(o)/100))}return a}getPetAdditionAsset(t){return _s().getTexture(t)}get data(){return this._data}};Dt.TYPE=x.PET_ANIMATED,Dt.HEAD="head",Dt.SADDLE="saddle",Dt.HAIR="hair",Dt.ADDITIONAL_SPRITE_COUNT=1,Dt.EXPERIENCE_BUBBLE_VISIBLE_IN_MS=1e3,Dt.PET_EXPERIENCE_BUBBLE="avatar_addition_pet_experience_bubble",Dt.POSTURE_ANIMATION_INDEX=0,Dt.GESTURE_ANIMATION_INDEX=1,Dt.ANIMATION_INDEX_COUNT=2;let md=Dt;const V_=class V_{constructor(t,e=-1,s=1,i=-1,r=1){this._normalMinX=e,this._normalMaxX=s,this._normalMinY=i,this._normalMaxY=r,this._asset=t}get asset(){return this._asset}get normalMinX(){return this._normalMinX}get normalMaxX(){return this._normalMaxX}get normalMinY(){return this._normalMinY}get normalMaxY(){return this._normalMaxY}dispose(){this._asset=null}};V_.MIN_NORMAL_COORDINATE_VALUE=-1,V_.MAX_NORMAL_COORDINATE_VALUE=1;let pd=V_;const Y_=class Y_{constructor(){this._bitmaps=[]}dispose(){for(const t of this._bitmaps)t&&t.dispose();this._bitmaps=null}addBitmap(t,e=-1,s=1,i=-1,r=1){this._bitmaps.push(new pd(t,e,s,i,r))}getAsset(t){if(!t)return null;for(const e of this._bitmaps)if(e&&t.x>=e.normalMinX&&t.x<=e.normalMaxX&&t.y>=e.normalMinY&&t.y<=e.normalMaxY)return e.asset;return null}};Y_.MIN_NORMAL_COORDINATE_VALUE=-1,Y_.MAX_NORMAL_COORDINATE_VALUE=1;let xr=Y_;class B2{constructor(){this._sizes=[],this._maskVisualizations=new Map,this._assetNames=new Map,this._lastMaskVisualization=null,this._lastSize=-1}dispose(){if(this._maskVisualizations){for(const t of this._maskVisualizations.values())t&&t.dispose();this._maskVisualizations=null}this._lastMaskVisualization=null,this._sizes=null}createMaskVisualization(t){if(this._maskVisualizations.get(t))return null;const s=new xr;return this._maskVisualizations.set(t,s),this._sizes.push(t),this._sizes.sort(),s}getSizeIndex(t){let e=0,s=1;for(;s<this._sizes.length;){if(this._sizes[s]>t){this._sizes[s]-t<t-this._sizes[s-1]&&(e=s);break}e=s,s++}return e}getMaskVisualization(t){if(t===this._lastSize)return this._lastMaskVisualization;const e=this.getSizeIndex(t);return e<this._sizes.length?this._lastMaskVisualization=this._maskVisualizations.get(this._sizes[e]):this._lastMaskVisualization=null,this._lastSize=t,this._lastMaskVisualization}getGraphicAsset(t,e){const s=this.getMaskVisualization(t);return s?s.getAsset(e):null}getAssetName(t){return this._assetNames&&this._assetNames.get(t)||null}setAssetName(t,e){this._assetNames&&this._assetNames.set(t,e)}}class w2{constructor(){this._assetCollection=null,this._masks=new Map,this._data=null}get data(){return this._data}dispose(){if(this._assetCollection=null,this._data=null,this._masks&&this._masks.size){for(const t of this._masks.values())t&&t.dispose();this._masks.clear()}}initialize(t){this._data=t}initializeAssetCollection(t){this.data&&(this._assetCollection=t,this.parseMasks(this.data,t))}parseMasks(t,e){if(!(!t||!e)&&t.masks&&t.masks.length){let s=0;for(;s<t.masks.length;){const i=t.masks[s];if(i){const r=i.id;if(this._masks.get(r))continue;const o=new B2;if(i.visualizations&&i.visualizations.length){let h=0;for(;h<i.visualizations.length;){const _=i.visualizations[h];if(_){const l=_.size,c=o.createMaskVisualization(l);if(c){const f=this.parseMaskBitmaps(_.bitmaps,c,e);o.setAssetName(l,f)}}h++}}this._masks.set(r,o)}s++}}}parseMaskBitmaps(t,e,s){if(!t||!t.length)return null;let i=null;for(const r of t){if(!r)continue;const a=r.assetName,o=s.getAsset(a);if(!o)continue;let h=xr.MIN_NORMAL_COORDINATE_VALUE,_=xr.MAX_NORMAL_COORDINATE_VALUE,l=xr.MIN_NORMAL_COORDINATE_VALUE,c=xr.MAX_NORMAL_COORDINATE_VALUE;r.normalMinX!==void 0&&(h=r.normalMinX),r.normalMaxX!==void 0&&(_=r.normalMaxX),r.normalMinY!==void 0&&(l=r.normalMinY),r.normalMaxY!==void 0&&(c=r.normalMaxY),o.flipH||(i=a),e.addBitmap(o,h,_,l,c)}return i}updateMask(t,e,s,i,r,a){const o=this._masks.get(e);if(!o)return!0;const h=o.getGraphicAsset(s,i);if(!h)return!0;const _=h.texture;if(!_)return!0;const l=new K(r+h.offsetX,a+h.offsetY),c=new Me;let f=1,p=1,m=0,O=0,A=l.x+m,C=l.y+O;return h.flipH&&(f=-1,m=_.width,A=l.x+m-_.width),h.flipV&&(p=-1,O=_.height,C=l.y+O-_.height),c.scale(f,p),c.translate(A,C),Kt.instance.renderer.render(new bt(_),{renderTexture:t,clear:!1,transform:c}),!0}getMask(t){return!this._masks||!this._masks.size?null:this._masks.get(t)||null}}class Jn{constructor(t=null,e=0,s=!1){this._assetNames=[],this._maskAssetNames=[],this._maskAssetLocations=[],this._maskAssetFlipHs=[],this._maskAssetFlipVs=[],t!=null&&(this._maskAssetNames=t._maskAssetNames,this._maskAssetLocations=t._maskAssetLocations,this._maskAssetFlipHs=t._maskAssetFlipHs,this._maskAssetFlipVs=t._maskAssetFlipVs),this._color=e,this._alignBottom=s}addMask(t,e,s,i){this._maskAssetNames.push(t),this._maskAssetLocations.push(e),this._maskAssetFlipHs.push(s),this._maskAssetFlipVs.push(i)}addAssetColumn(t){this._assetNames.push(t)}set z(t){this._z=t}get z(){return this._z}set cornerPoints(t){this._points=t}get cornerPoints(){return this._points}get color(){return this._color}get maskAssetNames(){return this._maskAssetNames}get maskAssetLocations(){return this._maskAssetLocations}get maskAssetFlipHs(){return this._maskAssetFlipHs}get maskAssetFlipVs(){return this._maskAssetFlipVs}isBottomAligned(){return this._alignBottom}get assetNameColumns(){return this._assetNames}}class V2{constructor(t,e,s,i,r){this._x=t,this._y=e,this._speedX=s,this._speedY=i,this._asset=r,isNaN(this._x)&&(this._x=0),isNaN(this._y)&&(this._y=0),isNaN(this._speedX)&&(this._speedX=0),isNaN(this._speedY)&&(this._speedY=0)}get bitmapData(){return this._asset}dispose(){this._asset=null}getPosition(t,e,s,i,r){let a=this._x,o=this._y;s>0&&(a=a+this._speedX/s*r/1e3),i>0&&(o=o+this._speedY/i*r/1e3);const h=Math.trunc(a%1*t),_=Math.trunc(o%1*e);return new K(h,_)}}const Wi=class Wi{constructor(t,e,s,i=0){this._material=t,this._offset=i,this._align=s,this._color=e,this._isDisposed=!1}get offset(){return this._offset}get align(){return this._align}get disposed(){return this._isDisposed}dispose(){this._isDisposed=!0,this._material=null,this.clearCache()}clearCache(){}render(t,e,s,i,r,a,o,h,_){const l=this._color>>16,c=this._color>>8&255,f=this._color&255,p=l<255||c<255||f<255;if(this._material){const m=this._material.render(t,e,p?null:s,i,r,a,o,h,_+this.offset,this.align===Wi.ALIGN_TOP);if(m&&p){const O=new bt(m);p&&(O.tint=this._color),e.writeToRenderTexture(O,s,!1)}}else{const m=e.createAndFillRenderTexture(i,r,t,this._color);e.writeToRenderTexture(new bt(m),s,!1)}return s}getMaterial(){return this._material}getColor(){return this._color}};Wi.DEFAULT_OFFSET=0,Wi.ALIGN_TOP=1,Wi.ALIGN_BOTTOM=2,Wi.ALIGN_DEFAULT=Wi.ALIGN_TOP;let cs=Wi;class Y2{constructor(t,e,s){this._layers=[],this._geometry=s,this._cachedBitmapNormal=new R,this._isCached=!1,this._hasAnimationLayers=!1,e<0&&(e=0);let i=0;for(;i<e;)this._layers.push(null),i++}get geometry(){return this._geometry}get hasAnimationLayers(){return this._hasAnimationLayers}dispose(){if(this._layers&&this._layers.length){for(const t of this._layers)t&&t.dispose();this._layers=null}this._geometry=null,this._cachedBitmapNormal&&(this._cachedBitmapNormal=null)}clearCache(){if(this._isCached){if(this._cachedBitmapNormal&&this._cachedBitmapNormal.assign(new R),this._layers&&this._layers.length)for(const t of this._layers){if(!t)continue;t.clearCache()}this._isCached=!1}}setLayer(t,e,s,i,r=0){if(t<0||t>this._layers.length)return!1;let a=this._layers[t];return a&&a.dispose(),a=new cs(e,s,i,r),this._layers[t]=a,!0}setAnimationLayer(t,e,s){if(t<0||t>this._layers.length)return!1;let i=this._layers[t];return i&&i.dispose(),i=new og(e,s),this._layers[t]=i,this._hasAnimationLayers=!0,!0}getLayers(){return this._layers}render(t,e,s,i,r,a,o,h=0,_=0,l=0,c=0,f=0,p=0,m=0){i<1&&(i=1),r<1&&(r=1),(!s||s.width!==i||s.height!==r)&&(s=null),this._isCached=!0;const O=e.createAndFillRenderTexture(i,r,t);if(this._cachedBitmapNormal.assign(a),this._layers&&this._layers.length)for(const A of this._layers)A&&(A instanceof cs?A.render(`${t}:${this._layers.indexOf(A)}`,e,O,i,r,a,o,h,_):A instanceof og&&A.render(e,O,i,r,a,h,_,l,c,f,p,m));return O}}class tE{constructor(){this._planeVisualizations=new Map,this._sizes=[],this._lastPlaneVisualization=null,this._lastSize=-1}isStatic(t){return!0}dispose(){for(const t of this._planeVisualizations.values())t&&t.dispose();this._planeVisualizations=null,this._lastPlaneVisualization=null,this._sizes=null,this._lastSize=-1}clearCache(){for(const t of this._planeVisualizations.values())t&&t.clearCache()}createPlaneVisualization(t,e,s){if(this._planeVisualizations.get(t.toString()))return null;const r=new Y2(t,e,s);return this._planeVisualizations.set(t.toString(),r),this._sizes.push(t),this._sizes.sort(),r}getSizeIndex(t){let e=0,s=1;for(;s<this._sizes.length;){if(this._sizes[s]>t){this._sizes[s]-t<t-this._sizes[s-1]&&(e=s);break}e=s,s++}return e}getPlaneVisualization(t){if(t===this._lastSize)return this._lastPlaneVisualization;const e=this.getSizeIndex(t);return e<this._sizes.length?this._lastPlaneVisualization=this._planeVisualizations.get(this._sizes[e].toString()):this._lastPlaneVisualization=null,this._lastSize=t,this._lastPlaneVisualization}getLayers(){return this.getPlaneVisualization(this._lastSize).getLayers()}}const Ba=class Ba extends tE{render(t,e,s,i,r,a,o,h,_,l){const c=this.getPlaneVisualization(a);if(!c||!c.geometry)return null;const f=c.geometry.getScreenPoint(new R(0,0,0)),p=c.geometry.getScreenPoint(new R(0,r/c.geometry.scale,0)),m=c.geometry.getScreenPoint(new R(i/c.geometry.scale,0,0));let O=0,A=0;if(f&&p&&m){i=Math.round(Math.abs(f.x-m.x)),r=Math.round(Math.abs(f.x-p.x));const C=f.x-c.geometry.getScreenPoint(new R(1,0,0)).x;O=_*Math.trunc(Math.abs(C)),A=l*Math.trunc(Math.abs(C))}return c.render(t,e,s,i,r,o,h,O,A)}};Ba.DEFAULT_COLOR=16777215,Ba.HORIZONTAL_ANGLE_DEFAULT=45,Ba.VERTICAL_ANGLE_DEFAULT=30;let wn=Ba;class hh{constructor(t,e){this._texture=t,this._timeStamp=e}dispose(){this._texture=null}get texture(){return this._texture}get timeStamp(){return this._timeStamp}}const Wt=class Wt{constructor(){this._seed=1,this._modulus=16777216,this._multiplier=69069,this._increment=5}static setSeed(t=1){Wt._randomizer||(Wt._randomizer=new Wt),Wt._randomizer.seed=t}static setModulus(t=16777216){Wt._randomizer||(Wt._randomizer=new Wt),Wt._randomizer.modulus=t}static getValues(t,e,s){return Wt._randomizer||(Wt._randomizer=new Wt),Wt._randomizer.getRandomValues(t,e,s)}static getArray(t,e){return Wt._randomizer||(Wt._randomizer=new Wt),Wt._randomizer.getRandomArray(t,e)}set seed(t){this._seed=t}set modulus(t){t<1&&(t=1),this._modulus=t}dispose(){}getRandomValues(t,e,s){const i=[];let r=0;for(;r<t;)i.push(this.iterateScaled(e,s-e)),r++;return i}getRandomArray(t,e){if(t>e||e>1e3)return null;const s=[];let i=0;for(;i<=e;)s.push(i),i++;const r=[];let a=0;for(;a<t;){const o=this.iterateScaled(0,s.length-1);r.push(s[o]),s.splice(o,1),a++}return r}iterate(){let t=wT(Math.trunc(this._multiplier*this._seed)+this._increment);return t<0&&(t=-t),t=t%this._modulus,this._seed=t,t}iterateScaled(t,e){let s=this.iterate();return e<1?t:(s=Math.trunc(t+s/this._modulus*e),s)}};Wt.DEFAULT_SEED=1,Wt.DEFAULT_MODULUS=16777216,Wt._randomizer=null;let sr=Wt;const Oe=class Oe{constructor(t,e,s=1){if(this._cells=[],this._repeatMode=s,this._width=t<1?1:t,this._cachedBitmapData=null,this._cachedBitmapNormal=null,this._cachedBitmapDataOffsetX=0,this._cachedBitmapDataOffsetY=0,this._isCached=!1,this._isStatic=!0,e&&e.length){let i=0;for(;i<e.length;){const r=e[i];r&&(this._cells.push(r),r.isStatic||(this._isStatic=!1)),i++}}}get isStatic(){return this._isStatic}isRepeated(){return this._repeatMode!==Oe.REPEAT_MODE_NONE}get width(){return this._width}dispose(){if(this._cells&&this._cells.length){for(const t of this._cells)t&&t.dispose();this._cells=null}this._cachedBitmapData=null,this._cachedBitmapNormal&&(this._cachedBitmapNormal=null)}clearCache(){if(this._isCached){if(this._cachedBitmapData&&(this._cachedBitmapData=null),this._cachedBitmapNormal&&(this._cachedBitmapNormal.x=0,this._cachedBitmapNormal.y=0,this._cachedBitmapNormal.z=0),this._cells&&this._cells.length)for(const t of this._cells)t&&t.clearCache();this._isCached=!1}}render(t,e,s,i,r,a){if(this._repeatMode===Oe.REPEAT_MODE_NONE&&(s=this.getCellsHeight(this._cells,i)),this._cachedBitmapNormal||(this._cachedBitmapNormal=new R),this.isStatic){if(this._cachedBitmapData){if(this._cachedBitmapData.height===s&&R.isEqual(this._cachedBitmapNormal,i)&&this._cachedBitmapDataOffsetX===r&&this._cachedBitmapDataOffsetY===a)return this._cachedBitmapData;this._cachedBitmapData=null}}else this._cachedBitmapData=null;if(this._isCached=!0,this._cachedBitmapData||(this._cachedBitmapData=e.createRenderTexture(this._width,s,`${t}:column`)),this._cachedBitmapNormal.assign(i),this._cachedBitmapDataOffsetX=r,this._cachedBitmapDataOffsetY=a,!this._cells.length)return this._cachedBitmapData;switch(this._repeatMode){case Oe.REPEAT_MODE_NONE:this.renderRepeatNone(i);break;case Oe.REPEAT_MODE_BORDERS:this.renderRepeatBorders(i);break;case Oe.REPEAT_MODE_CENTER:this.renderRepeatCenter(i);break;case Oe.REPEAT_MODE_FIRST:this.renderRepeatFirst(i);break;case Oe.REPEAT_MODE_LAST:this.renderRepeatLast(i);break;default:this.renderRepeatAll(i,r,a);break}return this._cachedBitmapData}getCellsHeight(t,e){if(!t||!t.length)return 0;let s=0,i=0;for(;i<t.length;){const r=t[i];r&&(s+=r.getHeight(e)),i++}return s}renderCells(t,e,s,i,r=0,a=0){if(!t||!t.length||!this._cachedBitmapData)return e;let o=0;for(;o<t.length;){let h=null;if(s?h=t[o]:h=t[t.length-1-o],h){const _=h.render(i,r,a);if(_&&(s||(e-=_.height),_.y=e,Ut.writeToRenderTexture(_,this._cachedBitmapData,!1),s&&(e=e+_.height),s&&e>=this._cachedBitmapData.height||!s&&e<=0))return e}o++}return e}renderRepeatNone(t){!this._cells.length||!this._cachedBitmapData||this.renderCells(this._cells,0,!0,t)}renderRepeatAll(t,e,s){if(!this._cells.length||!this._cachedBitmapData)return;let i=0;for(;i<this._cachedBitmapData.height;)if(i=this.renderCells(this._cells,i,!0,t,e,s),!i)return}renderRepeatBorders(t){if(!this._cells.length||!this._cachedBitmapData)return;const e=[];let s=0,i=1;for(;i<this._cells.length-1;){const h=this._cells[i];if(h){const _=h.getHeight(t);_>0&&(s=s+_,e.push(h))}i++}if(this._cells.length==1){const h=this._cells[0];if(h){const _=h.getHeight(t);_>0&&(s=s+_,e.push(h))}}let r=this._cachedBitmapData.height-s>>1,a=this.renderCells(e,r,!0,t),o=this._cells[0];if(o){const h=[o];for(;r>=0;)r=this.renderCells(h,r,!1,t)}if(o=this._cells[this._cells.length-1],o){const h=[o];for(;a<this._cachedBitmapData.height;)a=this.renderCells(h,a,!0,t)}}renderRepeatCenter(t){if(!this._cells.length||!this._cachedBitmapData)return;const e=[],s=[];let i=0,r=0,a=0;for(;a<this._cells.length>>1;){const _=this._cells[a];if(_){const l=_.getHeight(t);l>0&&(i=i+l,e.push(_))}a++}for(a=(this._cells.length>>1)+1;a<this._cells.length;){const _=this._cells[a];if(_){const l=_.getHeight(t);l>0&&(r=r+l,s.push(_))}a++}let o=0,h=this._cachedBitmapData.height;if(i+r>this._cachedBitmapData.height&&(o=i+r-this._cachedBitmapData.height,h=h+(o-(o>>1))),o==0){const _=this._cells[this._cells.length>>1];if(_){const l=_.getHeight(t);if(l>0){const c=this._cachedBitmapData.height-(i+r),f=Math.ceil(c/l)*l;let p=i-(f-c>>1);const m=p+f,O=[_];for(;p<m;)p=this.renderCells(O,p,!0,t)}}}this.renderCells(e,0,!0,t),this.renderCells(s,h,!1,t)}renderRepeatFirst(t){if(!this._cells.length||!this._cachedBitmapData)return;let e=this.renderCells(this._cells,this._cachedBitmapData.height,!1,t);const s=this._cells[0];if(!s)return;const i=[s];for(;e>=0;)e=this.renderCells(i,e,!1,t)}renderRepeatLast(t){if(!this._cells.length||!this._cachedBitmapData)return;let e=this.renderCells(this._cells,0,!0,t);const s=this._cells[this._cells.length-1];if(!s)return;const i=[s];for(;e<this._cachedBitmapData.height;)e=this.renderCells(i,e,!0,t)}getCells(){return this._cells}};Oe.REPEAT_MODE_NONE=0,Oe.REPEAT_MODE_ALL=1,Oe.REPEAT_MODE_BORDERS=2,Oe.REPEAT_MODE_CENTER=3,Oe.REPEAT_MODE_FIRST=4,Oe.REPEAT_MODE_LAST=5;let zs=Oe;const Lt=class Lt{constructor(t,e=1,s=1,i=-1,r=1,a=-1,o=1){this._repeatMode=1,this._align=1,this._cachedBitmapNormal=null,this._cachedBitmapHeight=0,this._isCached=!1,this._isStatic=!0,this._normalMinX=-1,this._normalMaxX=1,this._normalMinY=-1,this._normalMaxY=1,this._columns=[],t<1&&(t=1);let h=0;for(;h<t;)this._columns.push(null),h++;this._repeatMode=e,this._align=s,this._normalMinX=i,this._normalMaxX=r,this._normalMinY=a,this._normalMaxY=o,this._repeatMode===Lt.REPEAT_MODE_RANDOM&&(this._isStatic=!1)}static nextRandomColumnIndex(t){return sr.getValues(1,0,t*17631)[0]%t}get normalMinX(){return this._normalMinX}get normalMaxX(){return this._normalMaxX}get normalMinY(){return this._normalMinY}get normalMaxY(){return this._normalMaxY}isBottomAligned(){return this._align===Lt.ALIGN_BOTTOM}get isStatic(){return this._isStatic}dispose(){this._cachedBitmapNormal&&(this._cachedBitmapNormal=null)}clearCache(){if(this._isCached){if(this._cachedBitmapNormal&&(this._cachedBitmapNormal.x=0,this._cachedBitmapNormal.y=0,this._cachedBitmapNormal.z=0),this._columns&&this._columns.length)for(const t of this._columns)t&&t.clearCache();this._isCached=!1}}createColumn(t,e,s,i=1){if(t<0||t>=this._columns.length)return!1;const r=new zs(e,s,i),a=this._columns[t];return a&&a.dispose(),this._columns[t]=r,r&&!r.isStatic&&(this._isStatic=!1),!0}render(t,e,s,i,r,a,o,h,_,l){if(i<1&&(i=1),r<1&&(r=1),this._cachedBitmapNormal||(this._cachedBitmapNormal=new R),this.isStatic){if(this._cachedBitmapData){if(this._cachedBitmapData.baseTexture&&this._cachedBitmapData.width===i&&this._cachedBitmapData.height===r&&R.isEqual(this._cachedBitmapNormal,a))return s?(this.copyCachedBitmapOnCanvas(s,this._cachedBitmapHeight,_,l),s):this._cachedBitmapData;this._cachedBitmapData=null}}else this._cachedBitmapData=null;if(this._isCached=!0,this._cachedBitmapNormal.assign(a),!o)return this._cachedBitmapHeight=r,this._cachedBitmapData?e.clearAndFillRenderTexture(this._cachedBitmapData):this._cachedBitmapData=e.createAndFillRenderTexture(i,r,`${t}:matrix`),this._cachedBitmapData;this._cachedBitmapData||(this._cachedBitmapHeight=r,this._cachedBitmapData=e.createRenderTexture(i,r,`${t}:matrix`),e.clearRenderTexture(this._cachedBitmapData));const c=[];let f=0;for(;f<this._columns.length;){const m=this._columns[f];if(m){const O=m.render(t,e,r,a,h,_);O&&c.push(O)}f++}if(!c.length)return s||this._cachedBitmapData;let p=0;switch(this._repeatMode){case Lt.REPEAT_MODE_BORDERS:j.log("REPEAT_MODE_BORDERS");break;case Lt.REPEAT_MODE_CENTER:j.log("REPEAT_MODE_CENTER");break;case Lt.REPEAT_MODE_FIRST:j.log("REPEAT_MODE_FIRST");break;case Lt.REPEAT_MODE_LAST:j.log("REPEAT_MODE_LAST");break;case Lt.REPEAT_MODE_RANDOM:p=this.renderRepeatRandom(this._cachedBitmapData,c);break;default:p=this.renderRepeatAll(this._cachedBitmapData,c);break}return this._cachedBitmapHeight=p,s?(this.copyCachedBitmapOnCanvas(s,p,_,l),s):this._cachedBitmapData}copyCachedBitmapOnCanvas(t,e,s,i){if(!t||!this._cachedBitmapData||t===this._cachedBitmapData)return;i||(s=t.height-e-s);let r=null;this._align===Lt.ALIGN_TOP?r=new we(0,0,this._cachedBitmapData.width,this._cachedBitmapHeight):r=new we(0,this._cachedBitmapData.height-this._cachedBitmapHeight,this._cachedBitmapData.width,this._cachedBitmapHeight);const a=new Ss(this._cachedBitmapData.baseTexture,r),o=new bt(a);o.position.set(0,s),Ut.writeToRenderTexture(o,t,!1)}getColumnsWidth(t){if(!t||!t.length)return 0;let e=0;for(const s of t)s&&(e+=s.width);return e}renderColumns(t,e,s,i){if(!t||!e||!e.length)return new K(s,0);let r=0,a=0;for(;a<e.length;){const o=i?e[a]:e[e.length-1-a];if(o){i||(s=s-o.width);let h=0;this._align==Lt.ALIGN_BOTTOM&&(h=t.height-o.height);const _=new bt(o);if(_.position.set(s,h),Ut.writeToRenderTexture(_,t,!1),o.height>r&&(r=o.height),i&&(s=s+o.width),i&&s>=t.width||!i&&s<=0)return new K(s,r)}a++}return new K(s,r)}renderRepeatAll(t,e){if(!t||!e||!e.length)return 0;this.getColumnsWidth(e);let s=0,i=0;for(;s<t.width;){const r=this.renderColumns(t,e,s,!0);if(s=r.x,r.y>i&&(i=r.y),!r.x)return i}return i}renderRepeatRandom(t,e){if(!t||!e||!e.length)return 0;let s=0,i=0;for(;i<t.width;){const r=e[Lt.nextRandomColumnIndex(e.length)];if(r!=null){const a=this.renderColumns(t,[r],i,!0);i=a.x,a.y>s&&(s=a.y)}else return s}return s}getColumns(t){if(this._repeatMode===Lt.REPEAT_MODE_RANDOM){const e=[];let s=0;for(;s<t;){const i=this._columns[Lt.nextRandomColumnIndex(this._columns.length)];if(i)if(e.push(i),i.width>1)s+=i.width;else break;else break}return e}return this._columns}};Lt.REPEAT_MODE_ALL=1,Lt.REPEAT_MODE_BORDERS=2,Lt.REPEAT_MODE_CENTER=3,Lt.REPEAT_MODE_FIRST=4,Lt.REPEAT_MODE_LAST=5,Lt.REPEAT_MODE_RANDOM=6,Lt.REPEAT_MODE_DEFAULT=Lt.REPEAT_MODE_ALL,Lt.MIN_NORMAL_COORDINATE_VALUE=-1,Lt.MAX_NORMAL_COORDINATE_VALUE=1,Lt.ALIGN_TOP=1,Lt.ALIGN_BOTTOM=2,Lt.ALIGN_DEFAULT=Lt.ALIGN_TOP;let re=Lt;const H_=class H_{constructor(){this._planeMaterialItems=[],this._isCached=!1}dispose(){if(this._planeMaterialItems&&this._planeMaterialItems.length){for(const t of this._planeMaterialItems)t&&t.dispose();this._planeMaterialItems=null}this._isCached=!1}clearCache(){if(this._isCached){if(this._planeMaterialItems&&this._planeMaterialItems.length)for(const t of this._planeMaterialItems)t&&t.clearCache();this._isCached=!1}}addMaterialCellMatrix(t,e,s,i=-1,r=1,a=-1,o=1){const h=new re(t,e,s,i,r,a,o);return this._planeMaterialItems.push(h),h}getMaterialCellMatrix(t){if(!t)return null;if(this._planeMaterialItems&&this._planeMaterialItems.length){for(const e of this._planeMaterialItems)if(e&&t.x>=e.normalMinX&&t.x<=e.normalMaxX&&t.y>=e.normalMinY&&t.y<=e.normalMaxY)return e}return null}render(t,e,s,i,r,a,o,h,_,l){i<1&&(i=1),r<1&&(r=1);const c=this.getMaterialCellMatrix(a);return c?(this._isCached=!0,c.render(t,e,s,i,r,a,o,h,_,l)):null}};H_.MIN_NORMAL_COORDINATE_VALUE=-1,H_.MAX_NORMAL_COORDINATE_VALUE=1;let Rd=H_;class H2{constructor(t,e=null,s=null,i=0){if(this._extraItemCount=0,this._texture=t,this._extraItemOffsets=[],this._extraItemAssets=[],this._extraItemCount=0,e&&e.length&&i>0){let r=0;for(;r<e.length;){const a=e[r];a&&this._extraItemAssets.push(a),r++}if(this._extraItemAssets.length){if(s){let a=0;for(;a<s.length;){const o=s[a];o&&this._extraItemOffsets.push(new K(o.x,o.y)),a++}}this._extraItemCount=i}}}get isStatic(){return this._extraItemCount===0}dispose(){this._texture&&(this._texture.dispose(),this._texture=null),this._extraItemAssets=null,this._extraItemOffsets=null,this._extraItemCount=0}clearCache(){}getHeight(t){if(this._texture){const e=this._texture.getBitmap(t);if(e)return e.height}return 0}render(t,e,s){if(!this._texture)return null;const i=this._texture.getBitmap(t);if(!i)return null;const r=new sm(i,i.width,i.height);if(e!==0||s!==0){for(;e<0;)e+=i.width;for(;s<0;)s+=i.height;r.tilePosition.set(e%i.width,s%i.height),r.uvRespectAnchor=!0,e&&(r.anchor.x=1,r.scale.x=-1),s&&(r.anchor.y=1,r.scale.y=-1)}if(!this.isStatic){const a=Math.min(this._extraItemCount,this._extraItemOffsets.length),o=Math.max(this._extraItemCount,this._extraItemOffsets.length),h=sr.getArray(this._extraItemCount,o);let _=0;for(;_<a;){const l=this._extraItemOffsets[h[_]],c=this._extraItemAssets[_%this._extraItemAssets.length];if(l&&c){const f=c.texture;if(f){let p=c.offsetX,m=c.offsetY,O=1,A=1,C=0,L=0;c.flipH&&(O=-1,C=f.width,p=-(c.width+c.x)),c.flipV&&(A=-1,L=f.height,m=-(c.height+c.y));const D=new K(l.x+p,l.y+m),U=new Me;let P=D.x+C;P=P>>1<<1,U.scale(O,A),U.translate(P,D.y+L);const v=new bt(f);v.transform.setFromMatrix(U),r.addChild(v)}}_++}}return r}getAssetName(t){return this._texture==null?null:this._texture.getAssetName(t)}}const j_=class j_{constructor(t,e=-1,s=1,i=-1,r=1,a=null){this._bitmap=t,this._normalMinX=e,this._normalMaxX=s,this._normalMinY=i,this._normalMaxY=r,this._assetName=a}get bitmap(){return this._bitmap}get normalMinX(){return this._normalMinX}get normalMaxX(){return this._normalMaxX}get normalMinY(){return this._normalMinY}get normalMaxY(){return this._normalMaxY}get assetName(){return this._assetName}dispose(){this._bitmap=null}};j_.MIN_NORMAL_COORDINATE_VALUE=-1,j_.MAX_NORMAL_COORDINATE_VALUE=1;let Od=j_;const z_=class z_{constructor(){this._bitmaps=[]}dispose(){if(this._bitmaps){for(const t of this._bitmaps)t&&t.dispose();this._bitmaps=null}}addBitmap(t,e=-1,s=1,i=-1,r=1,a=null){this._bitmaps.push(new Od(t,e,s,i,r,a))}getBitmap(t){const e=this.getPlaneTextureBitmap(t);return e?e.bitmap:null}getPlaneTextureBitmap(t){if(!t)return null;for(const e of this._bitmaps)if(e&&t.x>=e.normalMinX&&t.x<=e.normalMaxX&&t.y>=e.normalMinY&&t.y<=e.normalMaxY)return e;return null}getAssetName(t){const e=this.getPlaneTextureBitmap(t);return e?e.assetName:null}};z_.MIN_NORMAL_COORDINATE_VALUE=-1,z_.MAX_NORMAL_COORDINATE_VALUE=1;let _r=z_;const W_=class W_{constructor(){this._assetCollection=null,this._textures=new Map,this._materials=new Map,this._planes=new Map,this._geometries=new Map,this._data=null}get data(){return this._data}get assetCollection(){return this._assetCollection}initializeDimensions(t,e){return!0}dispose(){if(this._planes){for(const t of this._planes.values())t&&t.dispose();this._planes=null}if(this._materials&&(this.resetMaterials(),this._materials=null),this._textures&&(this.resetTextures(),this._textures=null),this._geometries){for(const t of this._geometries.values())t&&t.dispose();this._geometries=null}this._data=null,this._assetCollection=null}clearCache(){for(const t of this._planes.values())t&&t.clearCache();for(const t of this._materials.values())t&&t.clearCache()}initialize(t){this._data=t}reinitialize(){this.resetTextures(),this.resetMaterials(),this.initializeAll()}resetMaterials(){for(const t of this._materials.values())t&&t.dispose();this._materials.clear()}resetTextures(){for(const t of this._textures.values())t&&t.dispose();this._textures.clear()}getTexture(t){return this._textures.get(t)}getMaterial(t){return this._materials.get(t)}getPlane(t){return this._planes.get(t)}addPlane(t,e){return e?this._planes.get(t)?!1:(this._planes.set(t,e),!0):!1}initializeAssetCollection(t){this._data&&(this._assetCollection=t,this.initializeAll())}initializeAll(){this._data&&(this.initializeTexturesAndMaterials(),this.initializePlanes())}initializeTexturesAndMaterials(){this._data.textures&&this._data.textures.length&&this.parseTextures(this._data.textures,this.assetCollection),this._data.materials&&this._data.materials.length&&this.parsePlaneMaterials(this._data.materials)}initializePlanes(){}parseTextures(t,e){if(!(!t||!e)&&t.length)for(const s of t){if(!s)continue;const i=s.id;if(!this._textures.get(i)){const r=new _r;if(s.bitmaps&&s.bitmaps.length)for(const a of s.bitmaps){if(!a)continue;const o=a.assetName;let h=_r.MIN_NORMAL_COORDINATE_VALUE,_=_r.MAX_NORMAL_COORDINATE_VALUE,l=_r.MIN_NORMAL_COORDINATE_VALUE,c=_r.MAX_NORMAL_COORDINATE_VALUE;a.normalMinX!==void 0&&(h=a.normalMinX),a.normalMaxX!==void 0&&(_=a.normalMaxX),a.normalMinY!==void 0&&(l=a.normalMinY),a.normalMaxY!==void 0&&(c=a.normalMaxY);const f=e.getAsset(o);if(f){const p=f.texture;if(p){let m=p;f.flipH?m=Jm.getFlipHBitmapData(p):m=m.clone(),r.addBitmap(m,h,_,l,c,o)}}}this._textures.set(i,r)}}}parsePlaneMaterials(t){if(!(!t||!t.length))for(const e of t){if(!e)continue;const s=e.id,i=new Rd;if(e.matrices&&e.matrices.length)for(const r of e.matrices){if(!r)continue;let a=re.REPEAT_MODE_DEFAULT,o=re.ALIGN_DEFAULT,h=re.MIN_NORMAL_COORDINATE_VALUE,_=re.MAX_NORMAL_COORDINATE_VALUE,l=re.MIN_NORMAL_COORDINATE_VALUE,c=re.MAX_NORMAL_COORDINATE_VALUE;switch(r.normalMinX!==void 0&&(h=r.normalMinX),r.normalMaxX!==void 0&&(_=r.normalMaxX),r.normalMinY!==void 0&&(l=r.normalMinY),r.normalMaxY!==void 0&&(c=r.normalMaxY),r.repeatMode){case"borders":a=re.REPEAT_MODE_BORDERS;break;case"center":a=re.REPEAT_MODE_CENTER;break;case"first":a=re.REPEAT_MODE_FIRST;break;case"last":a=re.REPEAT_MODE_LAST;break;case"random":a=re.REPEAT_MODE_RANDOM;break;default:a=re.REPEAT_MODE_DEFAULT;break}switch(r.align){case"top":o=re.ALIGN_TOP;break;case"bottom":o=re.ALIGN_BOTTOM;break;default:o=re.ALIGN_DEFAULT;break}if(r.columns&&r.columns.length){const f=i.addMaterialCellMatrix(r.columns.length,a,o,h,_,l,c);let p=0;for(;p<r.columns.length;){const m=r.columns[p];m&&this.parsePlaneMaterialCellColumn(m,f,p),p++}}}this._materials.set(s,i)}}parsePlaneMaterialCellColumn(t,e,s){if(!t||!e)return;let i=zs.REPEAT_MODE_ALL;const r=t.width,a=this.parsePlaneMaterialCells(t);switch(t.repeatMode){case"borders":i=zs.REPEAT_MODE_BORDERS;break;case"center":i=zs.REPEAT_MODE_CENTER;break;case"first":i=zs.REPEAT_MODE_FIRST;break;case"last":i=zs.REPEAT_MODE_LAST;break;case"none":i=zs.REPEAT_MODE_NONE;break;default:i=zs.REPEAT_MODE_ALL;break}e.createColumn(s,r,a,i)}parsePlaneMaterialCells(t){if(!t||!t.cells||!t.cells.length)return null;const e=[];let s=0;for(;s<t.cells.length;){const i=t.cells[s];if(i){const r=i.textureId;let a=null,o=null,h=null,_=0;if(i.extraData){const f=i.extraData.extraItemTypes,p=i.extraData.offsets;f&&p&&f.length&&p.length&&(a=this.parseExtraItemTypes(f),o=this.parseExtraItemOffsets(p),_=o.length,i.extraData.limitMax!==void 0&&(_=i.extraData.limitMax))}if(a&&a.length){h=[];for(const f of a){if(!f)continue;const p=this._assetCollection.getAsset(f);p&&h.push(p)}}const l=this.getTexture(r),c=new H2(l,h,o,_);e.push(c)}s++}return!e||!e.length?null:e}parseExtraItemTypes(t){const e=[];if(t&&t.length){let s=0;for(;s<t.length;){const i=t[s];i&&e.push(i),s++}}return e}parseExtraItemOffsets(t){const e=[];if(t&&t.length){let s=0;for(;s<t.length;){const[i,r]=t[s];e.push(new K(i,r)),s++}}return e}getGeometry(t,e,s){e=Math.abs(e),e>90&&(e=90),s=Math.abs(s),s>90&&(s=90);const i=`${t}_${Math.round(e)}_${Math.round(s)}`;let r=this._geometries.get(i);return r||(r=new Vr(t,new R(e,s),new R(-10,0,0)),this._geometries.set(i,r),r)}parseVisualizations(t,e){if(!(!t||!e)&&e&&e.length)for(const s of e){if(!s)continue;const i=s.size;let r=wn.HORIZONTAL_ANGLE_DEFAULT,a=wn.VERTICAL_ANGLE_DEFAULT;s.horizontalAngle!==void 0&&(r=s.horizontalAngle),s.verticalAngle!==void 0&&(a=s.verticalAngle);const o=s.allLayers,h=t.createPlaneVisualization(i,o&&o.length||0,this.getGeometry(i,r,a));if(h&&o&&o.length){let _=0;for(;_<o.length;){const l=o[_];if(l){let c=null,f=cs.ALIGN_DEFAULT,p=wn.DEFAULT_COLOR,m=cs.DEFAULT_OFFSET;l.materialId&&(c=this.getMaterial(l.materialId)),l.color&&(p=l.color),l.offset&&(m=l.offset),l.align&&(l.align==="bottom"?f=cs.ALIGN_BOTTOM:l.align=="top"&&(f=cs.ALIGN_TOP)),h.setLayer(_,c,p,f,m)}_++}}}}render(t,e,s,i,r,a,o,h,_,l=0,c=0,f=0,p=0,m=0){return null}getTextureIdentifier(t,e){return t.toString()}getLayers(t){let e=this.getPlane(t);return e||(e=this.getPlane(W_.DEFAULT)),e.getLayers()}};W_.DEFAULT="default";let zr=W_;class j2 extends zr{initializePlanes(){if(!this.data)return;const t=this.data.planes;t&&t.length&&this.parseFloors(t)}parseFloors(t){if(t)for(const e in t){const s=t[e];if(!s)continue;const i=s.id,r=s.visualizations,a=new wn;this.parseVisualizations(a,r),this.addPlane(i,a)||a.dispose()}}render(t,e,s,i,r,a,o,h,_,l=0,c=0,f=0,p=0,m=0){let O=this.getPlane(i);if(O||(O=this.getPlane(zr.DEFAULT)),!O)return null;s&&e.clearAndFillRenderTexture(s);let A=O.render(t,e,s,r,a,o,h,_,l,c);return A&&A!==s&&(A=new Ss(A.baseTexture),!A)?null:new hh(A,-1)}}const wa=class wa extends tE{render(t,e,s,i,r,a,o,h){const _=this.getPlaneVisualization(a);if(!_||!_.geometry)return null;const l=_.geometry.getScreenPoint(new R(0,0,0)),c=_.geometry.getScreenPoint(new R(0,0,r/_.geometry.scale)),f=_.geometry.getScreenPoint(new R(0,i/_.geometry.scale,0));return l&&c&&f&&(i=Math.round(Math.abs(l.x-f.x)),r=Math.round(Math.abs(l.y-c.y))),_.render(t,e,s,i,r,o,h)}};wa.DEFAULT_COLOR=16777215,wa.HORIZONTAL_ANGLE_DEFAULT=45,wa.VERTICAL_ANGLE_DEFAULT=30;let Ad=wa;class z2 extends zr{initializePlanes(){if(!this.data)return;const t=this.data.planes;t&&t.length&&this.parseWalls(t)}parseWalls(t){if(t)for(const e in t){const s=t[e];if(!s)continue;const i=s.id,r=s.visualizations,a=new Ad;this.parseVisualizations(a,r),this.addPlane(i,a)||a.dispose()}}render(t,e,s,i,r,a,o,h,_,l=0,c=0,f=0,p=0,m=0){let O=this.getPlane(i);if(O||(O=this.getPlane(zr.DEFAULT)),!O)return null;s&&e.clearAndFillRenderTexture(s);let A=O.render(t,e,s,r,a,o,h,_);return A&&A!==s&&(A=new Ss(A.baseTexture),!A)?null:new hh(A,-1)}getTextureIdentifier(t,e){return e?`${t}_${e.x}_${e.y}_${e.z}`:super.getTextureIdentifier(t,e)}}const Va=class Va extends tE{constructor(){super(...arguments),this._width=0,this._height=0}isStatic(t){const e=this.getPlaneVisualization(t);return e?!e.hasAnimationLayers:super.isStatic(t)}initializeDimensions(t,e){t<0&&(t=0),e<0&&(e=0),(t!==this._width||e!==this._height)&&(this._width=t,this._height=e)}render(t,e,s,i,r,a,o,h,_,l,c,f,p){const m=this.getPlaneVisualization(a);if(!m||!m.geometry)return null;const O=m.geometry.getScreenPoint(new R(0,0,0)),A=m.geometry.getScreenPoint(new R(0,0,1)),C=m.geometry.getScreenPoint(new R(0,1,0));if(O&&A&&C){i=Math.round(Math.abs((O.x-C.x)*i/m.geometry.scale)),r=Math.round(Math.abs((O.y-A.y)*r/m.geometry.scale));const L=Math.trunc(_*Math.abs(O.x-C.x)),D=Math.trunc(l*Math.abs(O.y-A.y)),U=Math.trunc(c*Math.abs(O.x-C.x)),P=Math.trunc(f*Math.abs(O.y-A.y));return m.render(t,e,s,i,r,o,h,L,D,U,P,c,f,p)}return null}};Va.DEFAULT_COLOR=16777215,Va.HORIZONTAL_ANGLE_DEFAULT=45,Va.VERTICAL_ANGLE_DEFAULT=30;let rn=Va;const Hs=class Hs extends zr{constructor(){super(...arguments),this._landscapeWidth=0,this._landscapeHeight=0,this._cachedBitmap=null}initializeDimensions(t,e){return t<0&&(t=0),e<0&&(e=0),this._landscapeWidth=t,this._landscapeHeight=e,!0}initializePlanes(){if(!this.data)return;const t=this.data.planes;t&&t.length&&this.parseLandscapes(t)}parseLandscapes(t){if(!t)return;const e=Math.trunc(Math.random()*654321);for(const s in t){const i=t[s];if(!i)continue;const r=i.id,a=i.animatedVisualization,o=new rn;for(const h of a){if(!h)continue;const _=h.size;let l=rn.HORIZONTAL_ANGLE_DEFAULT,c=rn.VERTICAL_ANGLE_DEFAULT;h.horizontalAngle!==void 0&&(l=h.horizontalAngle),h.verticalAngle!==void 0&&(c=h.verticalAngle);const f=h.allLayers.length??0,p=o.createPlaneVisualization(_,f||0,this.getGeometry(_,l,c));if(p){sr.setSeed(e);let m=0;for(;m<f;){const O=h.allLayers[m];if(O){if(O.items===void 0){const A=O;let C=null,L=cs.ALIGN_DEFAULT,D=rn.DEFAULT_COLOR,U=cs.DEFAULT_OFFSET;A.materialId&&(C=this.getMaterial(A.materialId)),A.color&&(D=A.color),A.offset&&(U=A.offset),A.align&&(A.align==="bottom"?L=cs.ALIGN_BOTTOM:A.align==="top"&&(L=cs.ALIGN_TOP)),p.setLayer(m,C,D,L,U)}else{const C=O.items,L=[];if(C&&C.length){for(const D of C)if(D){D.id;const U=D.assetId,P=this.getCoordinateValue(D.x||"",D.randomX||""),v=this.getCoordinateValue(D.y||"",D.randomY||""),F=D.speedX,$=D.speedY;L.push({asset:U,x:P,y:v,speedX:F,speedY:$})}}p.setAnimationLayer(m,L,this.assetCollection)}m++}}}}this.addPlane(r,o)||o.dispose()}}getCoordinateValue(t,e){let s=0;if(t.length>0&&t.charAt(t.length-1)==="%"&&(t=t.substr(0,t.length-1),s=parseFloat(t)/100),e.length>0){const a=sr.getValues(1,0,1e4)[0]/1e4;e.charAt(e.length-1)==="%"&&(e=e.substr(0,e.length-1),s=s+a*parseFloat(e)/100)}return s}render(t,e,s,i,r,a,o,h,_,l=0,c=0,f=0,p=0,m=0){let O=this.getPlane(i);if(O||(O=this.getPlane(Hs.DEFAULT)),!O)return null;s&&e.clearRenderTexture(s);let A=O.render(t,e,s,r,a,o,h,_,l,c,f,p,m);if(A&&A!==s&&(A=new Ss(A.baseTexture),!A))return null;let C=null;return!O.isStatic(o)&&Hs.UPDATE_INTERVAL>0?C=new hh(A,Math.round(m/Hs.UPDATE_INTERVAL)*Hs.UPDATE_INTERVAL+Hs.UPDATE_INTERVAL):C=new hh(A,-1),C}getTextureIdentifier(t,e){return e?e.x<0?t+"_0":t+"_1":super.getTextureIdentifier(t,e)}};Hs.LANDSCAPES_ENABLED=!0,Hs.LANDSCAPE_DEFAULT_COLOR=8828617,Hs.UPDATE_INTERVAL=500;let _h=Hs;class og{constructor(t,e){if(this._color=0,this._isDisposed=!1,this._color=0,this._isDisposed=!1,this._items=[],t&&e)for(const s of t){if(!s)continue;const i=s.asset;if(i){const r=e.getAsset(i);r&&this._items.push(new V2(s.x,s.y,s.speedX,s.speedY,r))}}}get disposed(){return this._isDisposed}dispose(){if(this._isDisposed=!0,this._items){for(const t of this._items)t&&t.dispose();this._items=[]}}clearCache(){}render(t,e,s,i,r,a,o,h,_,l,c,f){if(h>0&&_>0){let p=0;for(;p<this._items.length;){const m=this._items[p];if(m){const O=m.getPosition(h,_,l,c,f);if(O.x=Math.trunc(O.x-a),O.y=Math.trunc(O.y-o),m.bitmapData){if(O.x>-m.bitmapData.width&&O.x<e.width&&O.y>-m.bitmapData.height&&O.y<e.height){const A=new bt(m.bitmapData.texture);A.position.set(O.x,O.y),t.writeToRenderTexture(A,e,!1)}if(O.x-h>-m.bitmapData.width&&O.x-h<e.width&&O.y>-m.bitmapData.height&&O.y<e.height){const A=new bt(m.bitmapData.texture);A.position.set(O.x-h,O.y),t.writeToRenderTexture(A,e,!1)}if(O.x>-m.bitmapData.width&&O.x<e.width&&O.y-_>-m.bitmapData.height&&O.y-_<e.height){const A=new bt(m.bitmapData.texture);A.position.set(O.x,O.y-_),t.writeToRenderTexture(A,e,!1)}if(O.x-h>-m.bitmapData.width&&O.x-h<e.width&&O.y-_>-m.bitmapData.height&&O.y-_<e.height){const A=new bt(m.bitmapData.texture);A.position.set(O.x-h,O.y-_),t.writeToRenderTexture(A,e,!1)}}}p++}}return e}}class hg{constructor(t,e,s){this._type=t,this._leftSideLoc=e,this._rightSideLoc=s}get type(){return this._type}get leftSideLoc(){return this._leftSideLoc}get rightSideLoc(){return this._rightSideLoc}}class _g{constructor(t,e,s,i){this._leftSideLoc=t,this._rightSideLoc=e,this._leftSideLength=s,this._rightSideLength=i}get leftSideLoc(){return this._leftSideLoc}get rightSideLoc(){return this._rightSideLoc}get leftSideLength(){return this._leftSideLength}get rightSideLength(){return this._rightSideLength}}const Ae=class Ae{constructor(t,e,s,i,r,a,o,h,_,l=0,c=0,f=0,p=0){if(this._maskManager=null,this._width=0,this._height=0,this._textureCache=t,this._secondaryNormals=[],this._bitmapMasks=[],this._rectangleMasks=[],this._bitmapMasksOld=[],this._rectangleMasksOld=[],this._randomSeed=_,this._bitmapData=null,this._maskBitmapData=null,this._maskChanged=!1,this._activeTexture=null,this._origin=new R,this._origin.assign(e),this._location=new R,this._location.assign(s),this._leftSide=new R,this._leftSide.assign(i),this._rightSide=new R,this._rightSide.assign(r),this._normal=R.crossProduct(this._leftSide,this._rightSide),this._normal.length>0&&this._normal.multiply(1/this._normal.length),h!=null)for(const m of h){if(!m)continue;const O=new R;O.assign(m),this._secondaryNormals.push(O)}this._disposed=!1,this._isVisible=!1,this._id=null,this._hasTexture=!0,this._geometryUpdateId=-1,this._offset=new K,this._relativeDepth=0,this._type=a,this._color=0,this._rasterizer=null,this._canBeVisible=!0,this._cornerA=new R,this._cornerB=new R,this._cornerC=new R,this._cornerD=new R,this._width=0,this._height=0,this._textureOffsetX=l,this._textureOffsetY=c,this._textureMaxX=f,this._textureMaxY=p,this._useMask=o,this._uniqueId=++Ae._uniqueIdCounter}static blend(t,e){return Xa.colorize(e,t|4278190080)&16777215}set canBeVisible(t){t!==this._canBeVisible&&(this._canBeVisible||this.resetTextureCache(),this._canBeVisible=t)}get canBeVisible(){return this._canBeVisible}get bitmapData(){return!this.visible||!this._bitmapData?null:this._bitmapData}get maskBitmapData(){return!this.visible||!this._maskBitmapData?null:this._maskBitmapData}get visible(){return this._isVisible&&this._canBeVisible}get offset(){return this._offset}get relativeDepth(){return this._relativeDepth}get color(){return this._color}set color(t){this._color=t}get type(){return this._type}get leftSide(){return this._leftSide}get rightSide(){return this._rightSide}get location(){return this._location}get normal(){return this._normal}get hasTexture(){return this._hasTexture}set hasTexture(t){this._hasTexture=t}set rasterizer(t){this._rasterizer=t}set maskManager(t){this._maskManager=t}set id(t){t!==this._id&&(this.resetTextureCache(),this._id=t)}get uniqueId(){return this._uniqueId}dispose(){this._activeTexture=null,this._location=null,this._origin=null,this._leftSide=null,this._rightSide=null,this._normal=null,this._rasterizer=null,this._cornerA=null,this._cornerB=null,this._cornerC=null,this._cornerD=null,this._bitmapMasks=null,this._rectangleMasks=null,this._maskPixels=null,this._maskBitmapData&&(this._maskBitmapData.destroy(!0),this._maskBitmapData=null),this._disposed=!0}copyBitmapData(t){return!this.visible||!this._bitmapData||!t||this._bitmapData.width!==t.width||this._bitmapData.height!==t.height?null:t}resetTextureCache(t=null){this._activeTexture=null}getTextureIdentifier(t){return this._rasterizer?this._rasterizer.getTextureIdentifier(t,this.normal):t.toString()}needsNewTexture(t,e){if(!t)return!1;const s=this._activeTexture;return this.updateMaskChangeStatus(),!!(this._canBeVisible&&(!s||s.timeStamp>=0&&e>s.timeStamp||this._maskChanged))}getTexture(t,e){if(!t)return null;let s=null;if(this.needsNewTexture(t,e)){this.getTextureIdentifier(t.scale);const i=this._leftSide.length*t.scale,r=this._rightSide.length*t.scale,a=t.getCoordinatePosition(this._normal);s=this._rasterizer.render(this._uniqueId.toString(),this._textureCache,null,this._id,i,r,t.scale,a,this._hasTexture,this._textureOffsetX,this._textureOffsetY,this._textureMaxX,this._textureMaxY,e),s&&this.updateMask(s.texture,t)}else this._activeTexture&&(s=this._activeTexture);return s?(this._activeTexture=s,s.texture):null}resolveMasks(t){if(!this._useMask)return null;const e=new Jn,s=0;for(;s<this._bitmapMasks.length;){const i=this._bitmapMasks[s];if(i){const r=this._maskManager.getMask(i.type);if(r){const a=r.getAssetName(t.scale);if(a){const o=t.getCoordinatePosition(this._normal),h=r.getGraphicAsset(t.scale,o);if(h){const _=this._maskBitmapData.width*(1-i.leftSideLoc/this._leftSide.length),l=this._maskBitmapData.height*(1-i.rightSideLoc/this._rightSide.length);e.addMask(a,new K(_+h.offsetX,l+h.offsetY),h.flipH,h.flipV)}}}}}return e}screenWidth(t){const e=t.getScreenPoint(new R(0,0,0)),s=t.getScreenPoint(new R(0,1,0));return Math.round(this._leftSide.length*Math.abs(e.x-s.x))}getDrawingDatas(t){const e=[];if(this._isVisible){const s=this.resolveMasks(t),i=this._rasterizer.getLayers(this._id);for(const r of i)if(this._hasTexture&&r.getMaterial()){const a=t.getCoordinatePosition(this._normal),o=r.getMaterial().getMaterialCellMatrix(a),h=new Jn(s,Ae.blend(this._color,r.getColor()),o.isBottomAligned());sr.setSeed(this._randomSeed);for(const _ of o.getColumns(this.screenWidth(t))){const l=[];for(const c of _.getCells()){const f=c.getAssetName(a);f&&l.push(f)}l.length>0&&(_.isRepeated()||l.push(""),h.addAssetColumn(l))}h.assetNameColumns.length>0&&e.push(h)}else{const a=new Jn(s,Ae.blend(this._color,r.getColor()));e.push(a)}e.length||e.push(new Jn(s,this._color))}return e}update(t,e){if(!t||this._disposed)return!1;let s=!1;if(this._geometryUpdateId!=t.updateId&&(s=!0),(!s||!this._canBeVisible)&&!this.visible)return!1;if(s){this._activeTexture=null;let i=0;if(i=R.cosAngle(t.directionAxis,this.normal),i>-.001)return this._isVisible?(this._isVisible=!1,!0):!1;let r=0;for(;r<this._secondaryNormals.length;){if(i=R.cosAngle(t.directionAxis,this._secondaryNormals[r]),i>-.001)return this._isVisible?(this._isVisible=!1,!0):!1;r++}this.updateCorners(t);const o=t.getScreenPosition(this._origin).z;let h=Math.max(this._cornerA.z,this._cornerB.z,this._cornerC.z,this._cornerD.z)-o;this._type===Ae.TYPE_FLOOR&&(h=h-(this._location.z+Math.min(0,this._leftSide.z,this._rightSide.z))*8),this._type===Ae.TYPE_LANDSCAPE&&(h=h+.02),this._relativeDepth=h,this._isVisible=!0,this._geometryUpdateId=t.updateId}if(s||this.needsNewTexture(t,e)){if(!this._bitmapData||this._width!==this._bitmapData.width||this._height!==this._bitmapData.height){if(this._bitmapData)if(this._width!==this._bitmapData.width||this._height!==this._bitmapData.height){if(this._bitmapData.destroy(),this._bitmapData=null,this._width<1||this._height<1)return!0;this._bitmapData=this._textureCache.createAndFillRenderTexture(this._width,this._height)}else{if(this._width<1||this._height<1)return this._bitmapData.destroy(),this._bitmapData=null,!0;this._textureCache.clearAndFillRenderTexture(this._bitmapData)}else{if(this._width<1||this._height<1)return!1;this._bitmapData=this._textureCache.createAndFillRenderTexture(this._width,this._height)}if(!this._bitmapData)return!1}else this._textureCache.clearAndFillRenderTexture(this._bitmapData);sr.setSeed(this._randomSeed);const i=this.getTexture(t,e);if(i)this.renderTexture(t,i);else return this.dispose(),!1;return i!==null||s}return!1}updateCorners(t){this._cornerA.assign(t.getScreenPosition(this._location)),this._cornerB.assign(t.getScreenPosition(R.sum(this._location,this._rightSide))),this._cornerC.assign(t.getScreenPosition(R.sum(R.sum(this._location,this._leftSide),this._rightSide))),this._cornerD.assign(t.getScreenPosition(R.sum(this._location,this._leftSide))),this._offset=t.getScreenPoint(this._origin),this._cornerA.x=Math.round(this._cornerA.x),this._cornerA.y=Math.round(this._cornerA.y),this._cornerB.x=Math.round(this._cornerB.x),this._cornerB.y=Math.round(this._cornerB.y),this._cornerC.x=Math.round(this._cornerC.x),this._cornerC.y=Math.round(this._cornerC.y),this._cornerD.x=Math.round(this._cornerD.x),this._cornerD.y=Math.round(this._cornerD.y),this._offset.x=Math.round(this._offset.x),this._offset.y=Math.round(this._offset.y);const e=Math.min(this._cornerA.x,this._cornerB.x,this._cornerC.x,this._cornerD.x),s=Math.max(this._cornerA.x,this._cornerB.x,this._cornerC.x,this._cornerD.x)-e,i=Math.min(this._cornerA.y,this._cornerB.y,this._cornerC.y,this._cornerD.y),r=Math.max(this._cornerA.y,this._cornerB.y,this._cornerC.y,this._cornerD.y)-i;this._offset.x=this._offset.x-e,this._cornerA.x=this._cornerA.x-e,this._cornerB.x=this._cornerB.x-e,this._cornerC.x=this._cornerC.x-e,this._cornerD.x=this._cornerD.x-e,this._offset.y=this._offset.y-i,this._cornerA.y=this._cornerA.y-i,this._cornerB.y=this._cornerB.y-i,this._cornerC.y=this._cornerC.y-i,this._cornerD.y=this._cornerD.y-i,this._width=s,this._height=r}getMatrixForDimensions(t,e){let s=this._cornerD.x-this._cornerC.x,i=this._cornerD.y-this._cornerC.y,r=this._cornerB.x-this._cornerC.x,a=this._cornerB.y-this._cornerC.y;(this._type===Ae.TYPE_WALL||this._type===Ae.TYPE_LANDSCAPE)&&(Math.abs(r-t)<=1&&(r=t),Math.abs(a-t)<=1&&(a=t),Math.abs(s-e)<=1&&(s=e),Math.abs(i-e)<=1&&(i=e));const o=r/t,h=a/t,_=s/e,l=i/e,c=new Me(o,h,_,l);return c.translate(this._cornerC.x,this._cornerC.y),c}renderTexture(t,e){this._cornerA==null||this._cornerB==null||this._cornerC==null||this._cornerD==null||e==null||this._bitmapData==null||this.draw(e,this.getMatrixForDimensions(e.width,e.height))}draw(t,e){this._textureCache.writeToRenderTexture(new bt(t),this._bitmapData,!0,e)}resetBitmapMasks(){this._disposed||!this._useMask||!this._bitmapMasks.length||(this._maskChanged=!0,this._bitmapMasks=[])}addBitmapMask(t,e,s){if(!this._useMask)return!1;for(const r of this._bitmapMasks)if(r&&r.type===t&&r.leftSideLoc===e&&r.rightSideLoc===s)return!1;const i=new hg(t,e,s);return this._bitmapMasks.push(i),this._maskChanged=!0,!0}resetRectangleMasks(){!this._useMask||!this._rectangleMasks.length||(this._maskChanged=!0,this._rectangleMasks=[])}addRectangleMask(t,e,s,i){if(this._useMask){for(const a of this._rectangleMasks)if(a&&a.leftSideLoc===t&&a.rightSideLoc===e&&a.leftSideLength===s&&a.rightSideLength===i)return!1;const r=new _g(t,e,s,i);return this._rectangleMasks.push(r),this._maskChanged=!0,!0}return!1}updateMaskChangeStatus(){if(!this._maskChanged)return;let t=!0;if(this._bitmapMasks.length===this._bitmapMasksOld.length)for(const e of this._bitmapMasks){if(!e)continue;let s=!1;for(const i of this._bitmapMasksOld)if(i&&i.type===e.type&&i.leftSideLoc===e.leftSideLoc&&i.rightSideLoc===e.rightSideLoc){s=!0;break}if(!s){t=!1;break}}else t=!1;this._rectangleMasks.length>this._rectangleMasksOld.length&&(t=!1),t&&(this._maskChanged=!1)}updateMask(t,e){if(!t||!e||!this._useMask||!this._bitmapMasks.length&&!this._rectangleMasks.length&&!this._maskChanged||!this._maskManager)return;const s=t.width,i=t.height;if(this.updateMaskChangeStatus(),(!this._maskBitmapData||this._maskBitmapData.width!==s||this._maskBitmapData.height!==i)&&(this._maskBitmapData=this._textureCache.createAndFillRenderTexture(s,i,"mask"),this._maskChanged=!0),this._maskChanged){this._bitmapMasksOld=[],this._rectangleMasksOld=[],this._maskBitmapData&&this._textureCache.clearAndFillRenderTexture(this._maskBitmapData),this.resetTextureCache(t);const r=e.getCoordinatePosition(this._normal);let a=null,o=0,h=0,_=0;for(;_<this._bitmapMasks.length;){const l=this._bitmapMasks[_];l&&(a=l.type,o=this._maskBitmapData.width-this._maskBitmapData.width*l.leftSideLoc/this._leftSide.length,h=this._maskBitmapData.height-this._maskBitmapData.height*l.rightSideLoc/this._rightSide.length,this._maskManager.updateMask(this._maskBitmapData,a,e.scale,r,o,h),this._bitmapMasksOld.push(new hg(a,l.leftSideLoc,l.rightSideLoc))),_++}for(_=0;_<this._rectangleMasks.length;){const l=this._rectangleMasks[_];if(l){o=this._maskBitmapData.width-this._maskBitmapData.width*l.leftSideLoc/this._leftSide.length,h=this._maskBitmapData.height-this._maskBitmapData.height*l.rightSideLoc/this._rightSide.length;const c=this._maskBitmapData.width*l.leftSideLength/this._leftSide.length,f=this._maskBitmapData.height*l.rightSideLength/this._rightSide.length,p=new bt(Ft.WHITE);p.tint=0,p.width=c,p.height=f,p.position.set(o-c,h-f),this._textureCache.writeToRenderTexture(p,this._maskBitmapData,!1),this._rectangleMasksOld.push(new _g(l.leftSideLength,l.rightSideLoc,l.leftSideLength,l.rightSideLength))}_++}this._maskPixels=this._textureCache.getPixels(this._maskBitmapData),this._maskChanged=!1}this.combineTextureMask(t,this._maskPixels)}combineTextureMask(t,e){var a,o;if(!t||!e)return;const s=this._textureCache.getPixels(t);for(let h=0;h<s.length;h+=4){const _=e[h],l=e[h+1],c=e[h+2];e[h+3],!_&&!l&&!c&&(s[h+3]=0)}const i=(a=t.baseTexture._glTextures[1])==null?void 0:a.texture,r=(o=Kt.instance.renderer)==null?void 0:o.gl;!i||!r||(r.bindTexture(r.TEXTURE_2D,i),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,t.width,t.height,0,r.RGBA,r.UNSIGNED_BYTE,s),r.bindTexture(r.TEXTURE_2D,null))}};Ae.ZERO_POINT=new K(0,0),Ae.TYPE_UNDEFINED=0,Ae.TYPE_WALL=1,Ae.TYPE_FLOOR=2,Ae.TYPE_LANDSCAPE=3,Ae._uniqueIdCounter=1;let Rt=Ae;class GT extends Ye{constructor(){super(),this._wallRasterizer=new z2,this._floorRasterizer=new j2,this._landscapeRasterizer=new _h,this._maskManager=new w2,this._initialized=!1}initialize(t){if(!t.roomVisualization)return!1;const e=t.roomVisualization.wallData;e&&this._wallRasterizer.initialize(e);const s=t.roomVisualization.floorData;s&&this._floorRasterizer.initialize(s);const i=t.roomVisualization.landscapeData;i&&this._landscapeRasterizer.initialize(i);const r=t.roomVisualization.maskData;return r&&this._maskManager.initialize(r),!0}onDispose(){this._wallRasterizer&&(this._wallRasterizer.dispose(),this._wallRasterizer=null),this._floorRasterizer&&(this._floorRasterizer.dispose(),this._floorRasterizer=null),this._landscapeRasterizer&&(this._landscapeRasterizer.dispose(),this._landscapeRasterizer=null),this._maskManager&&(this._maskManager.dispose(),this._maskManager=null),super.onDispose()}setGraphicAssetCollection(t){this._initialized||(this._wallRasterizer.initializeAssetCollection(t),this._floorRasterizer.initializeAssetCollection(t),this._landscapeRasterizer.initializeAssetCollection(t),this._maskManager.initializeAssetCollection(t),this._initialized=!0)}clearCache(){this._wallRasterizer&&this._wallRasterizer.clearCache(),this._floorRasterizer&&this._floorRasterizer.clearCache(),this._landscapeRasterizer&&this._landscapeRasterizer.clearCache()}get wallRasterizer(){return this._wallRasterizer}get floorRasterizer(){return this._floorRasterizer}get landscapeRasterizer(){return this._landscapeRasterizer}get maskManager(){return this._maskManager}}const Mt=class Mt extends jn{constructor(){super(),this._data=null,this._roomPlaneParser=new kt,this._roomPlaneBitmapMaskParser=new DT,this._geometryUpdateId=-1,this._directionX=0,this._directionY=0,this._directionZ=0,this._floorThickness=1,this._wallThickness=1,this._holeUpdateTime=NaN,this._planes=[],this._visiblePlanes=[],this._visiblePlaneSpriteNumbers=[],this._roomScale=0,this._lastUpdateTime=-1e3,this._updateIntervalTime=250,this._wallType=null,this._floorType=null,this._landscapeType=null,this._colorBackgroundOnly=!0,this._color=16777215,this._redColor=255,this._greenColor=255,this._blueColor=255,this._typeVisibility=[],this._assetUpdateCounter=0,this._maskData=null,this._isPlaneSet=!1,this._textureCache=new pl,this._typeVisibility[Rt.TYPE_UNDEFINED]=!1,this._typeVisibility[Rt.TYPE_FLOOR]=!0,this._typeVisibility[Rt.TYPE_WALL]=!0,this._typeVisibility[Rt.TYPE_LANDSCAPE]=!0}initialize(t){return t instanceof GT?(this._data=t,super.initialize(t),this._data.setGraphicAssetCollection(this.asset),!0):!1}dispose(){super.dispose(),this.clearPlanes(),this._planes=null,this._visiblePlanes=null,this._visiblePlaneSpriteNumbers=null,this._roomPlaneParser&&(this._roomPlaneParser.dispose(),this._roomPlaneParser=null),this._roomPlaneBitmapMaskParser&&(this._roomPlaneBitmapMaskParser.dispose(),this._roomPlaneBitmapMaskParser=null),this._data&&(this._data.clearCache(),this._data=null),this._textureCache&&this._textureCache.clearCache()}reset(){super.reset(),this._floorType=null,this._wallType=null,this._landscapeType=null,this._maskData=null,this._geometryUpdateId=-1,this._roomScale=0}update(t,e,s,i){if(!this.object||!t)return;const r=this.updateGeometry(t),a=this.object.model;let o=!1;if(this.updateThickness(a)&&(o=!0),this.updateHole(a)&&(o=!0),this.initializeRoomPlanes(),o=this.updateMasks(a),!(e<this._lastUpdateTime+this._updateIntervalTime&&!r&&!o)){if(this.updatePlaneTexturesAndVisibilities(a)&&(o=!0),this.updatePlanes(t,r,e)&&(o=!0),o){let h=0;for(;h<this._visiblePlanes.length;){const _=this._visiblePlaneSpriteNumbers[h],l=this.getSprite(_),c=this._visiblePlanes[h];if(l&&c&&c.type!==Rt.TYPE_LANDSCAPE)if(this._colorBackgroundOnly){let f=c.color;const p=(f&255)*this._redColor/255,m=(f>>8&255)*this._greenColor/255,O=(f>>16&255)*this._blueColor/255;f=(f>>24<<24)+(O<<16)+(m<<8)+p,l.color=f}else l.color=c.color;h++}this.updateSpriteCounter++}this.updateModelCounter=a.updateCounter,this._lastUpdateTime=e}}updateGeometry(t){if(!t||this._geometryUpdateId===t.updateId)return!1;this._geometryUpdateId=t.updateId,this._boundingRectangle=null;const e=t.direction;return e&&(e.x!==this._directionX||e.y!==this._directionY||e.z!==this._directionZ||t.scale!==this._roomScale)?(this._directionX=e.x,this._directionY=e.y,this._directionZ=e.z,this._roomScale=t.scale,!0):!1}updateThickness(t){if(this.updateModelCounter===t.updateCounter)return!1;const e=t.getValue(g.ROOM_FLOOR_THICKNESS),s=t.getValue(g.ROOM_WALL_THICKNESS);return!isNaN(e)&&!isNaN(s)&&(e!==this._floorThickness||s!==this._wallThickness)?(this._floorThickness=e,this._wallThickness=s,this.clearPlanes(),!0):!1}updateHole(t){if(this.updateModelCounter===t.updateCounter)return!1;const e=t.getValue(g.ROOM_FLOOR_HOLE_UPDATE_TIME);return!isNaN(e)&&e!==this._holeUpdateTime?(this._holeUpdateTime=e,this.clearPlanes(),!0):!1}updateMasks(t){if(this.updateModelCounter===t.updateCounter)return!1;let e=!1;const s=t.getValue(g.ROOM_PLANE_MASK_XML);s!==this._maskData&&(this.updatePlaneMasks(s),this._maskData=s,e=!0);const i=t.getValue(g.ROOM_BACKGROUND_COLOR);i!==this._color&&(this._color=i,this._redColor=this._color&255,this._greenColor=this._color>>8&255,this._blueColor=this._color>>16&255,e=!0);const r=t.getValue(g.ROOM_COLORIZE_BG_ONLY)||!1;return r!==this._colorBackgroundOnly&&(this._colorBackgroundOnly=r,e=!0),e}updatePlaneTexturesAndVisibilities(t){if(this.updateModelCounter===t.updateCounter)return!1;const e=t.getValue(g.ROOM_FLOOR_TYPE),s=t.getValue(g.ROOM_WALL_TYPE),i=t.getValue(g.ROOM_LANDSCAPE_TYPE),r=t.getValue(g.ROOM_FLOOR_VISIBILITY)===1,a=t.getValue(g.ROOM_WALL_VISIBILITY)===1,o=t.getValue(g.ROOM_LANDSCAPE_VISIBILITY)===1;return this.updatePlaneTypes(e,s,i)||this.updatePlaneVisibility(r,a,o)}clearPlanes(){if(this._planes){for(;this._planes.length;){const t=this._planes[0];t&&t.dispose(),this._planes.pop()}this._planes=[],this._planes=[]}this._isPlaneSet=!1,this._assetUpdateCounter=this._assetUpdateCounter+1,this.reset()}initializeRoomPlanes(){if(!this.object||this._isPlaneSet)return;isNaN(this._floorThickness)||(this._roomPlaneParser.floorThicknessMultiplier=this._floorThickness),isNaN(this._wallThickness)||(this._roomPlaneParser.wallThicknessMultiplier=this._wallThickness);const t=this.object.model.getValue(g.ROOM_MAP_DATA);if(!this._roomPlaneParser.initializeFromMapData(t))return;const e=this.getLandscapeWidth(),s=this.getLandscapeHeight();let i=0,r=this.object.model.getValue(g.ROOM_RANDOM_SEED),a=0;for(;a<this._roomPlaneParser.planeCount;){const o=this._roomPlaneParser.getPlaneLocation(a),h=this._roomPlaneParser.getPlaneLeftSide(a),_=this._roomPlaneParser.getPlaneRightSide(a),l=this._roomPlaneParser.getPlaneSecondaryNormals(a),c=this._roomPlaneParser.getPlaneType(a);let f=null;if(o&&h&&_){const p=R.crossProduct(h,_);if(r=wT(Math.trunc(r*7613+517)>>>0),f=null,c===vt.PLANE_FLOOR){const m=o.x+h.x+.5,O=o.y+_.y+.5,A=Math.trunc(m)-m,C=Math.trunc(O)-O;f=new Rt(this._textureCache,this.object.getLocation(),o,h,_,Rt.TYPE_FLOOR,!0,l,r,-A,-C),p.z!==0?f.color=Mt.FLOOR_COLOR:f.color=p.x!==0?Mt.FLOOR_COLOR_RIGHT:Mt.FLOOR_COLOR_LEFT,this._data&&(f.rasterizer=this._data.floorRasterizer)}else c===vt.PLANE_WALL?(f=new Rt(this._textureCache,this.object.getLocation(),o,h,_,Rt.TYPE_WALL,!0,l,r),(h.length<1||_.length<1)&&(f.hasTexture=!1),p.x===0&&p.y===0?f.color=Mt.WALL_COLOR_BORDER:p.y>0?f.color=Mt.WALL_COLOR_TOP:p.y===0?f.color=Mt.WALL_COLOR_SIDE:f.color=Mt.WALL_COLOR_BOTTOM,this._data&&(f.rasterizer=this._data.wallRasterizer)):c===vt.PLANE_LANDSCAPE?(f=new Rt(this._textureCache,this.object.getLocation(),o,h,_,Rt.TYPE_LANDSCAPE,!0,l,r,i,0,e,s),p.y>0?f.color=Mt.LANDSCAPE_COLOR_TOP:p.y==0?f.color=Mt.LANDSCAPE_COLOR_SIDE:f.color=Mt.LANDSCAPE_COLOR_BOTTOM,this._data&&(f.rasterizer=this._data.landscapeRasterizer),i=i+h.length):c==vt.PLANE_BILLBOARD&&(f=new Rt(this._textureCache,this.object.getLocation(),o,h,_,Rt.TYPE_WALL,!0,l,r),(h.length<1||_.length<1)&&(f.hasTexture=!1),p.x==0&&p.y==0?f.color=Mt.WALL_COLOR_BORDER:p.y>0?f.color=Mt.WALL_COLOR_TOP:p.y==0?f.color=Mt.WALL_COLOR_SIDE:f.color=Mt.WALL_COLOR_BOTTOM);if(f){f.maskManager=this._data.maskManager;let m=0;for(;m<this._roomPlaneParser.getPlaneMaskCount(a);){const O=this._roomPlaneParser.getPlaneMaskLeftSideLoc(a,m),A=this._roomPlaneParser.getPlaneMaskRightSideLoc(a,m),C=this._roomPlaneParser.getPlaneMaskLeftSideLength(a,m),L=this._roomPlaneParser.getPlaneMaskRightSideLength(a,m);f.addRectangleMask(O,A,C,L),m++}this._planes.push(f)}}else return;a++}this._isPlaneSet=!0,this.defineSprites()}defineSprites(){this.createSprites(this._planes.length);let t=0;for(;t<this._planes.length;){const e=this._planes[t],s=this.getSprite(t);e&&s&&e.leftSide&&e.rightSide&&(e.type===Rt.TYPE_WALL&&(e.leftSide.length<1||e.rightSide.length<1)?s.alphaTolerance=Os.MATCH_NOTHING:s.alphaTolerance=Os.MATCH_OPAQUE_PIXELS,e.type===Rt.TYPE_WALL?s.tag="plane.wall@"+(t+1):e.type===Rt.TYPE_FLOOR?s.tag="plane.floor@"+(t+1):s.tag="plane@"+(t+1),s.spriteType=Je.ROOM_PLANE),t++}}getLandscapeWidth(){let t=0,e=0;for(;e<this._roomPlaneParser.planeCount;){if(this._roomPlaneParser.getPlaneType(e)===vt.PLANE_LANDSCAPE){const i=this._roomPlaneParser.getPlaneLeftSide(e);t+=i.length}e++}return t}getLandscapeHeight(){let t=0,e=0;for(;e<this._roomPlaneParser.planeCount;){if(this._roomPlaneParser.getPlaneType(e)===vt.PLANE_LANDSCAPE){const i=this._roomPlaneParser.getPlaneRightSide(e);i.length>t&&(t=i.length)}e++}return t>5&&(t=5),t}updatePlaneTypes(t,e,s){if(t!==this._floorType?this._floorType=t:t=null,e!==this._wallType?this._wallType=e:e=null,s!==this._landscapeType?this._landscapeType=s:s=null,!t&&!e&&!s)return!1;let i=0;for(;i<this._planes.length;){const r=this._planes[i];r&&(r.type===Rt.TYPE_FLOOR&&t?r.id=t:r.type===Rt.TYPE_WALL&&e?r.id=e:r.type===Rt.TYPE_LANDSCAPE&&s&&(r.id=s)),i++}return!0}updatePlaneVisibility(t,e,s){return t===this._typeVisibility[Rt.TYPE_FLOOR]&&e===this._typeVisibility[Rt.TYPE_WALL]&&s===this._typeVisibility[Rt.TYPE_LANDSCAPE]?!1:(this._typeVisibility[Rt.TYPE_FLOOR]=t,this._typeVisibility[Rt.TYPE_WALL]=e,this._typeVisibility[Rt.TYPE_LANDSCAPE]=s,this._visiblePlanes=[],this._visiblePlaneSpriteNumbers=[],!0)}updatePlanes(t,e,s){if(!t||!this.object)return!1;this._assetUpdateCounter++,e&&(this._visiblePlanes=[],this._visiblePlaneSpriteNumbers=[]);const i=this._visiblePlanes.length>0;let r=this._visiblePlanes;this._visiblePlanes.length||(r=this._planes);let a=0,o=!1,h=0;for(;h<r.length;){let _=h;i&&(_=this._visiblePlaneSpriteNumbers[h]);const l=this.getSprite(_);if(l){const c=r[h];c?(l.id=c.uniqueId,c.update(t,s)&&(c.visible&&(a=c.relativeDepth+this.floorRelativeDepth+_/1e3,c.type!==Rt.TYPE_FLOOR&&(a=c.relativeDepth+this.wallRelativeDepth+_/1e3,(c.leftSide.length<1||c.rightSide.length<1)&&(a=a+Mt.ROOM_DEPTH_OFFSET*.5)),this.updateSprite(l,t,c,`plane ${_} ${t.scale}`,a)),o=!0),l.visible!=(c.visible&&this._typeVisibility[c.type])&&(l.visible=!l.visible,o=!0),l.visible&&(i||(this._visiblePlanes.push(c),this._visiblePlaneSpriteNumbers.push(h)))):(l.id=0,l.visible&&(l.visible=!1,o=!0))}h++}return o}updatePlaneMasks(t){if(!t)return;this._roomPlaneBitmapMaskParser.initialize(t);const e=[],s=[];let i=!1,r=0;for(;r<this._planes.length;){const a=this._planes[r];a&&(a.resetBitmapMasks(),a.type===Rt.TYPE_LANDSCAPE&&e.push(r)),r++}for(const a of this._roomPlaneBitmapMaskParser.masks.values()){const o=this._roomPlaneBitmapMaskParser.getMaskType(a),h=this._roomPlaneBitmapMaskParser.getMaskLocation(a),_=this._roomPlaneBitmapMaskParser.getMaskCategory(a);if(h){let l=0;for(;l<this._planes.length;){const c=this._planes[l];if((c.type===Rt.TYPE_WALL||c.type===Rt.TYPE_LANDSCAPE)&&c&&c.location&&c.normal){const f=R.dif(h,c.location);if(Math.abs(R.scalarProjection(f,c.normal))<.01&&c.leftSide&&c.rightSide){const m=R.scalarProjection(f,c.leftSide),O=R.scalarProjection(f,c.rightSide);c.type===Rt.TYPE_WALL||c.type===Rt.TYPE_LANDSCAPE&&_===Hr.HOLE?c.addBitmapMask(o,m,O):c.type===Rt.TYPE_LANDSCAPE&&(c.canBeVisible||(i=!0),c.canBeVisible=!0,s.push(l))}}l++}}}for(r=0;r<e.length;){const a=e[r];if(s.indexOf(a)<0){const o=this._planes[a];o.canBeVisible=!1,i=!0}r++}i&&(this._visiblePlanes=[],this._visiblePlaneSpriteNumbers=[])}updateSprite(t,e,s,i,r){const a=s.offset;t.offsetX=-a.x,t.offsetY=-a.y,t.relativeDepth=r,t.color=s.color,t.texture=s.bitmapData,t.name=i+"_"+this._assetUpdateCounter}getBoundingRectangle(){return this._boundingRectangle||(this._boundingRectangle=super.getBoundingRectangle()),new we(this._boundingRectangle.x,this._boundingRectangle.y,this._boundingRectangle.width,this._boundingRectangle.height)}get planes(){const t=[];for(const e of this._visiblePlanes)t.push(e);return t}get floorRelativeDepth(){return Mt.ROOM_DEPTH_OFFSET+.1}get wallRelativeDepth(){return Mt.ROOM_DEPTH_OFFSET+.5}};Mt.FLOOR_COLOR=16777215,Mt.FLOOR_COLOR_LEFT=14540253,Mt.FLOOR_COLOR_RIGHT=12303291,Mt.WALL_COLOR_TOP=16777215,Mt.WALL_COLOR_SIDE=13421772,Mt.WALL_COLOR_BOTTOM=10066329,Mt.WALL_COLOR_BORDER=10066329,Mt.LANDSCAPE_COLOR_TOP=16777215,Mt.LANDSCAPE_COLOR_SIDE=13421772,Mt.LANDSCAPE_COLOR_BOTTOM=10066329,Mt.ROOM_DEPTH_OFFSET=1e3;let Sd=Mt;class W2 extends wt{constructor(){super(),this._tileHeight=0}getLayerYOffset(t,e,s){return s===1?(this._tileHeight=this.object.model.getValue(g.TILE_CURSOR_HEIGHT),-this._tileHeight*32):super.getLayerYOffset(t,e,s)}}const k_=class k_{constructor(){this._visualizationDatas=new Map}getVisualization(t){const e=this.getVisualizationType(t);return e?new e:null}getVisualizationType(t){if(!t)return null;let e=null;switch(t){case x.ROOM:e=Sd;break;case x.TILE_CURSOR:e=W2;break;case x.USER:case x.BOT:case x.RENTABLE_BOT:e=td;break;case x.PET_ANIMATED:e=md;break;case x.FURNITURE_STATIC:e=Ci;break;case x.FURNITURE_ANIMATED:e=wt;break;case x.FURNITURE_RESETTING_ANIMATED:e=y2;break;case x.FURNITURE_BADGE_DISPLAY:e=ed;break;case x.FURNITURE_BG:e=v2;break;case x.FURNITURE_BB:e=vT;break;case x.FURNITURE_ISOMETRIC_BB:e=L2;break;case x.FURNITURE_BOTTLE:e=sd;break;case x.FURNITURE_BUILDER_PLACEHOLDER:e=S2;break;case x.FURNITURE_COUNTER_CLOCK:e=id;break;case x.FURNITURE_CUBOID:e=C2;break;case x.FURNITURE_EXTERNAL_IMAGE:e=M2;break;case x.FURNITURE_FIREWORKS:e=FT;break;case x.FURNITURE_GIFT_WRAPPED_FIREWORKS:e=nd;break;case x.FURNITURE_GIFT_WRAPPED:e=D2;break;case x.FURNITURE_GUILD_CUSTOMIZED:e=ad;break;case x.FURNITURE_GUILD_ISOMETRIC_BADGE:e=od;break;case x.FURNITURE_HABBOWHEEL:e=hd;break;case x.FURNITURE_MANNEQUIN:e=ld;break;case x.FURNITURE_PARTY_BEAMER:e=cd;break;case x.FURNITURE_PLANET_SYSTEM:e=P2;break;case x.FURNITURE_POSTER:e=U2;break;case x.FURNITURE_QUEUE_TILE:e=dd;break;case x.FURNITURE_SCORE_BOARD:e=Ed;break;case x.FURNITURE_SOUNDBLOCK:e=b2;break;case x.FURNITURE_STICKIE:e=F2;break;case x.FURNITURE_VAL_RANDOMIZER:e=gd;break;case x.FURNITURE_VOTE_COUNTER:e=fd;break;case x.FURNITURE_VOTE_MAJORITY:e=Id;break;case x.FURNITURE_WATER_AREA:e=x2;break;case x.FURNITURE_YOUTUBE:e=Td;break}return e||(j.log("Unknown Visualization",t),null)}getVisualizationData(t,e,s){const i=this._visualizationDatas.get(t);if(i)return i;let r=null;switch(e){case x.FURNITURE_STATIC:case x.FURNITURE_GIFT_WRAPPED:case x.FURNITURE_BB:case x.FURNITURE_ISOMETRIC_BB:case x.FURNITURE_BG:case x.FURNITURE_STICKIE:case x.FURNITURE_BUILDER_PLACEHOLDER:r=new Xs;break;case x.FURNITURE_ANIMATED:case x.FURNITURE_RESETTING_ANIMATED:case x.FURNITURE_POSTER:case x.FURNITURE_HABBOWHEEL:case x.FURNITURE_VAL_RANDOMIZER:case x.FURNITURE_BOTTLE:case x.FURNITURE_PLANET_SYSTEM:case x.FURNITURE_QUEUE_TILE:case x.FURNITURE_PARTY_BEAMER:case x.FURNITURE_COUNTER_CLOCK:case x.FURNITURE_WATER_AREA:case x.FURNITURE_SCORE_BOARD:case x.FURNITURE_FIREWORKS:case x.FURNITURE_GIFT_WRAPPED_FIREWORKS:case x.FURNITURE_GUILD_CUSTOMIZED:case x.FURNITURE_GUILD_ISOMETRIC_BADGE:case x.FURNITURE_VOTE_COUNTER:case x.FURNITURE_VOTE_MAJORITY:case x.FURNITURE_SOUNDBLOCK:case x.FURNITURE_BADGE_DISPLAY:case x.FURNITURE_EXTERNAL_IMAGE:case x.FURNITURE_YOUTUBE:case x.TILE_CURSOR:r=new $d;break;case x.FURNITURE_MANNEQUIN:r=new _d;break;case x.ROOM:r=new GT;break;case x.USER:case x.BOT:case x.RENTABLE_BOT:r=new rh;break;case x.PET_ANIMATED:r=new xT;break}return r?r.initialize(s)?((r instanceof rh||r instanceof _d)&&(r.avatarManager=W.instance.avatar),k_.CACHING_ENABLED&&this._visualizationDatas.set(t,r),r):(r.dispose(),null):null}};k_.CACHING_ENABLED=!0;let Cd=k_;const ke=class ke{};ke.ROOM_MIN_X="room_min_x",ke.ROOM_MAX_X="room_max_x",ke.ROOM_MIN_Y="room_min_y",ke.ROOM_MAX_Y="room_max_y",ke.ROOM_IS_PUBLIC="room_is_public",ke.ROOM_Z_SCALE="room_z_scale",ke.AD_DISPLAY_DELAY="ad_display_delay",ke.IS_PLAYING_GAME="is_playing_game",ke.RESTRICTS_DRAGGING="restricts_dragging",ke.RESTRICTS_SCALING="restricts_scaling",ke.RESTRICTED_SCALE="room_scale";let Yt=ke;class k2{constructor(t,e){this._width=t,this._height=e,this._heights=[],this._isNotStackable=[],this._isRoomTile=[];let s=t*e;for(;s>0;)this._heights.push(0),this._isNotStackable.push(!1),this._isRoomTile.push(!1),s--}dispose(){this._width=0,this._height=0,this._height=null,this._isNotStackable=null,this._isRoomTile=null}validPosition(t,e){return t>=0&&t<this._width&&e>=0&&e<this._height}getTileHeight(t,e){return this.validPosition(t,e)?this._heights[e*this._width+t]:0}setTileHeight(t,e,s){this.validPosition(t,e)&&(this._heights[e*this._width+t]=s)}setStackingBlocked(t,e,s){this.validPosition(t,e)&&(this._isNotStackable[e*this._width+t]=s)}setIsRoomTile(t,e,s){this.validPosition(t,e)&&(this._isRoomTile[e*this._width+t]=s)}validateLocation(t,e,s,i,r,a,o,h,_,l=-1){let c=0,f=0;if(!this.validPosition(t,e)||!this.validPosition(t+s-1,e+i-1))return!1;(r<0||r>=this._width)&&(r=0),(a<0||a>=this._height)&&(a=0),o=Math.min(o,this._width-r),h=Math.min(h,this._height-a),l===-1&&(l=this.getTileHeight(t,e));let p=e;for(;p<e+i;){for(c=t;c<t+s;){if(c<r||c>=r+o||p<a||p>=a+h){if(f=p*this._width+c,_){if(!this._isRoomTile[f])return!1}else if(this._isNotStackable[f]||!this._isRoomTile[f]||Math.abs(this._heights[f]-l)>.01)return!1}c++}p++}return!0}get width(){return this._width}get height(){return this._height}}const Ke=class Ke{constructor(){this._isDisposed=!1,this._scale=64,this._heightMap=[],this._width=0,this._height=0,this._floorHeight=0}get disposed(){return this._isDisposed}get scale(){return this._scale}set scale(t){this._scale=t}dispose(){this.reset(),this._isDisposed=!0}initialize(t,e,s){if(t<=this._width&&e<=this._height){this._width=t,this._height=e,this._floorHeight=s;return}this.reset();let i=0;for(;i<e;){const r=[];this._heightMap.push(r);let a=0;for(;a<t;)r.push(0),a++;i++}this._width=t,this._height=e,this._floorHeight=s}reset(){this._heightMap=[]}setHeight(t,e,s){if(t<0||t>=this._width||e<0||e>=this._height)return!1;const i=this._heightMap[e];return i?(i[t]=s,!0):!1}getHeight(t,e){if(t<0||t>=this._width||e<0||e>=this._height)return 0;const s=this._heightMap[e];return s?s[t]:0}getLocation(t,e,s,i,r){if(t==0&&e==0){t=this._width,e=this._height;const l=Math.round(this.scale/10);if(r==Ke.R){let c=this._width-1;for(;c>=0;){let f=1;for(;f<this._height;){if(this.getHeight(c,f)<=this._floorHeight){f-1<e&&(t=c,e=f-1);break}f++}c--}i=i+(this.scale/4-l/2),s=s+this.scale/2}else{let c=this._height-1;for(;c>=0;){let f=1;for(;f<this._width;){if(this.getHeight(f,c)<=this._floorHeight){f-1<t&&(t=f-1,e=c);break}f++}c--}i=i+(this.scale/4-l/2),s=s-l}}let a=t,o=e,h=this.getHeight(t,e);return r==Ke.R?(a=a+(s/(this._scale/2)-.5),o=o+.5,h=h-(i-s/2)/(this._scale/2)):(o=o+((this._scale/2-s)/(this._scale/2)-.5),a=a+.5,h=h-(i-(this._scale/2-s)/2)/(this._scale/2)),new R(a,o,h)}getLocationOldFormat(t,e,s){let i,r,a=0,o=0;r=Math.ceil(t),a=r-t;let h,_,l,c=0;for(i=0;i<this._width;){if(r>=0&&r<this._height){if(this.getHeight(i,r)<=this._floorHeight){h=i-1,_=r,o=i,s=Ke.L;break}if(this.getHeight(i,r+1)<=this._floorHeight){h=i,_=r,o=_-t,s=Ke.R;break}}r++,i++}const f=this.scale/2*a;let p=-o*this.scale/2;return p=p+-e*18/32*this.scale/2,c=this.getHeight(h,_),l=c*this.scale/2+p,s==Ke.R?l=l+a*this.scale/4:l=l+(1-a)*this.scale/4,this.getLocation(h,_,f,l,s)}getOldLocation(t,e){if(t==null)return null;let s=0,i=0,r=0,a=0,o="",h=0;if(e==90)s=Math.floor(t.x-.5),i=Math.floor(t.y+.5),h=this.getHeight(s,i),r=this._scale/2-(t.y-i+.5)*(this._scale/2),a=(h-t.z)*(this._scale/2)+(this._scale/2-r)/2,o=Ke.L;else if(e==180)s=Math.floor(t.x+.5),i=Math.floor(t.y-.5),h=this.getHeight(s,i),r=(t.x+.5-s)*(this._scale/2),a=(h-t.z)*(this._scale/2)+r/2,o=Ke.R;else return null;return[s,i,r,a,o]}getOldLocationString(t,e){const s=this.getOldLocation(t,e);if(s==null)return null;const i=Math.trunc(s[0]),r=Math.trunc(s[1]),a=Math.trunc(s[2]),o=Math.trunc(s[3]),h=s[4];return":w="+i+","+r+" l="+a+","+o+" "+h}getDirection(t){return t==Ke.R?180:90}getFloorAltitude(t,e){const s=this.getHeight(t,e),i=s+1;return s+(Math.trunc(this.getHeight(t-1,e-1))==i||Math.trunc(this.getHeight(t,e-1))==i||Math.trunc(this.getHeight(t+1,e-1))==i||Math.trunc(this.getHeight(t-1,e))==i||Math.trunc(this.getHeight(t+1,e))==i||Math.trunc(this.getHeight(t-1,e+1))==i||Math.trunc(this.getHeight(t,e+1))==i||Math.trunc(this.getHeight(t+1,e+1))==i?.5:0)}isRoomTile(t,e){return t>=0&&t<this._width&&e>=0&&e<this._height&&this._heightMap[e][t]>=0}};Ke.DEFAULT_SCALE=32,Ke.L="l",Ke.R="r";let lh=Ke;const K_=class K_{constructor(){this._targetId=-1,this._targetCategory=-2,this._targetLoc=null,this._moveDistance=0,this._previousMoveSpeed=0,this._maintainPreviousMoveSpeed=!1,this._currentLoc=null,this._limitedLocX=!1,this._limitedLocY=!1,this._centeredLocX=!1,this._centeredLocY=!1,this._screenWd=0,this._screenHt=0,this._scale=0,this._roomWd=0,this._roomHt=0,this._geometryUpdateId=-1,this._scaleChanged=!1,this._targetObjectLoc=new R}get location(){return this._currentLoc}get targetId(){return this._targetId}set targetId(t){this._targetId=t}get targetCategory(){return this._targetCategory}set targetCategory(t){this._targetCategory=t}get targetObjectLoc(){return this._targetObjectLoc}set targetObjectLoc(t){this._targetObjectLoc.assign(t)}get limitedLocationX(){return this._limitedLocX}set limitedLocationX(t){this._limitedLocX=t}get limitedLocationY(){return this._limitedLocY}set limitedLocationY(t){this._limitedLocY=t}get centeredLocX(){return this._centeredLocX}set centeredLocX(t){this._centeredLocX=t}get centeredLocY(){return this._centeredLocY}set centeredLocY(t){this._centeredLocY=t}get screenWd(){return this._screenWd}set screenWd(t){this._screenWd=t}get screenHt(){return this._screenHt}set screenHt(t){this._screenHt=t}get scale(){return this._scale}set scale(t){this._scale!=t&&(this._scale=t,this._scaleChanged=!0)}get roomWd(){return this._roomWd}set roomWd(t){this._roomWd=t}get roomHt(){return this._roomHt}set roomHt(t){this._roomHt=t}get geometryUpdateId(){return this._geometryUpdateId}set geometryUpdateId(t){this._geometryUpdateId=t}get isMoving(){return this._targetLoc!=null&&this._currentLoc!=null}set target(t){let e;this._targetLoc==null&&(this._targetLoc=new R),(this._targetLoc.x!=t.x||this._targetLoc.y!=t.y||this._targetLoc.z!=t.z)&&(this._targetLoc.assign(t),e=R.dif(this._targetLoc,this._currentLoc),this._moveDistance=e.length,this._maintainPreviousMoveSpeed=!0)}dispose(){this._targetLoc=null,this._currentLoc=null}initializeLocation(t){this._currentLoc==null&&(this._currentLoc=new R,this._currentLoc.assign(t))}resetLocation(t){this._currentLoc==null&&(this._currentLoc=new R),this._currentLoc.assign(t)}update(t,e){let s,i,r,a,o;if(this._followDuration>0&&this._targetLoc!=null&&this._currentLoc!=null){if(this._scaleChanged){this._scaleChanged=!1,this._currentLoc=this._targetLoc,this._targetLoc=null;return}s=R.dif(this._targetLoc,this._currentLoc),s.length>this._moveDistance&&(this._moveDistance=s.length),s.length<=e?(this._currentLoc=this._targetLoc,this._targetLoc=null,this._previousMoveSpeed=0):(i=Math.sin(Math.PI*s.length/this._moveDistance),r=e*.5,a=this._moveDistance/K_.MOVE_SPEED_DENOMINATOR,o=r+(a-r)*i,this._maintainPreviousMoveSpeed&&(o<this._previousMoveSpeed?(o=this._previousMoveSpeed,o>s.length&&(o=s.length)):this._maintainPreviousMoveSpeed=!1),this._previousMoveSpeed=o,s.divide(s.length),s.multiply(o),this._currentLoc=R.sum(this._currentLoc,s))}}reset(){this._geometryUpdateId=-1}activateFollowing(t){this._followDuration=t}};K_.MOVE_SPEED_DENOMINATOR=12;let Md=K_;class lg{constructor(t,e){this._roomId=t,this._data=e,this._floorType=null,this._wallType=null,this._landscapeType=null}get roomId(){return this._roomId}get data(){return this._data}get floorType(){return this._floorType}set floorType(t){this._floorType=t}get wallType(){return this._wallType}set wallType(t){this._wallType=t}get landscapeType(){return this._landscapeType}set landscapeType(t){this._landscapeType=t}}class gl{constructor(t,e,s,i,r,a,o,h=NaN,_=-1,l=0,c=0,f="",p=!0,m=!0,O=-1){this._id=t,this._typeId=e,this._type=s,this._state=a,this._data=o,this._extra=h,this._expiryTime=_,this._usagePolicy=l,this._ownerId=c,this._ownerName=f,this._synchronized=p,this._realRoomObject=m,this._sizeZ=O,this._location=new R,this._direction=new R,this._location.assign(i),this._direction.assign(r)}get id(){return this._id}get typeId(){return this._typeId}get type(){return this._type}get location(){return this._location}get direction(){return this._direction}get state(){return this._state}get data(){return this._data}get extra(){return this._extra}get expiryTime(){return this._expiryTime}get usagePolicy(){return this._usagePolicy}get ownerId(){return this._ownerId}get ownerName(){return this._ownerName}get synchronized(){return this._synchronized}get realRoomObject(){return this._realRoomObject}get sizeZ(){return this._sizeZ}}class K2{constructor(t,e){this._tileObjectMap=new Map;let s=0;for(;s<e;)this._tileObjectMap.set(s,new Map),s++;this._width=t,this._height=e}clear(){for(const t of this._tileObjectMap.values())t&&t.clear();this._tileObjectMap.clear()}populate(t){this.clear();for(const e of t)this.addRoomObject(e)}dispose(){this._tileObjectMap=null,this._width=0,this._height=0}getObjectIntTile(t,e){if(t>=0&&t<this._width&&e>=0&&e<this._height){const s=this._tileObjectMap.get(e);if(s)return s.get(t)}return null}setObjectInTile(t,e,s){if(!s.isReady){j.log("Assigning non initialized object to tile object map!");return}if(t>=0&&t<this._width&&e>=0&&e<this._height){const i=this._tileObjectMap.get(e);i&&i.set(t,s)}}addRoomObject(t){if(!t||!t.model||!t.isReady)return;const e=t.getLocation(),s=t.getDirection();if(!e||!s)return;let i=t.model.getValue(g.FURNITURE_SIZE_X),r=t.model.getValue(g.FURNITURE_SIZE_Y);i<1&&(i=1),r<1&&(r=1);const a=Math.trunc(s.x+45)%360/90;(a===1||a===3)&&([i,r]=[r,i]);let o=e.y;for(;o<e.y+r;){let h=e.x;for(;h<e.x+i;){const _=this.getObjectIntTile(h,o);(!_||_!==t&&_.getLocation().z<=e.z)&&this.setObjectInTile(h,o,t),h++}o++}}}class X2{constructor(t){this._roomId=t,this._modelName=null,this._legacyGeometry=new lh,this._tileObjectMap=null,this._roomCamera=new Md,this._selectedObject=null,this._placedObject=null,this._furnitureStackingHeightMap=null,this._floorStack=new Map,this._wallStack=new Map,this._mouseButtonCursorOwners=[]}dispose(){}setModelName(t){this._modelName=t}setSelectedObject(t){this._selectedObject&&this._selectedObject.dispose(),this._selectedObject=t}setPlacedObject(t){this._placedObject&&this._placedObject.dispose(),this._placedObject=t}setFurnitureStackingHeightMap(t){this._furnitureStackingHeightMap&&this._furnitureStackingHeightMap.dispose(),this._furnitureStackingHeightMap=t,this._tileObjectMap&&this._tileObjectMap.dispose(),this._furnitureStackingHeightMap&&(this._tileObjectMap=new K2(this._furnitureStackingHeightMap.width,this._furnitureStackingHeightMap.height))}addPendingFurnitureFloor(t){t&&(this._floorStack.delete(t.id),this._floorStack.set(t.id,t))}removePendingFunitureFloor(t){const e=this._floorStack.get(t);return e?(this._floorStack.delete(t),e):null}getPendingFurnitureFloor(t){const e=this._floorStack.get(t);return e?(this._floorStack.delete(t),e):null}getNextPendingFurnitureFloor(){if(!this._floorStack.size)return null;const t=this._floorStack.keys();return this.getPendingFurnitureFloor(t.next().value)}addPendingFurnitureWall(t){t&&(this._wallStack.delete(t.id),this._wallStack.set(t.id,t))}removePendingFurnitureWall(t){const e=this._wallStack.get(t);return e?(this._wallStack.delete(t),e):null}getPendingFurnitureWall(t){const e=this._wallStack.get(t);return e?(this._wallStack.delete(t),e):null}getNextPendingFurnitureWall(){if(!this._wallStack.size)return null;const t=this._wallStack.keys();return this.getPendingFurnitureWall(t.next().value)}addButtonMouseCursorOwner(t){return this._mouseButtonCursorOwners.indexOf(t)===-1?(this._mouseButtonCursorOwners.push(t),!0):!1}removeButtonMouseCursorOwner(t){const e=this._mouseButtonCursorOwners.indexOf(t);return e>-1?(this._mouseButtonCursorOwners.splice(e,1),!0):!1}hasButtonMouseCursorOwners(){return this._mouseButtonCursorOwners.length>0}get roomId(){return this._roomId}get modelName(){return this._modelName}get legacyGeometry(){return this._legacyGeometry}get tileObjectMap(){return this._tileObjectMap}get roomCamera(){return this._roomCamera}get selectedObject(){return this._selectedObject}get placedObject(){return this._placedObject}get furnitureStackingHeightMap(){return this._furnitureStackingHeightMap}}class q2{constructor(t,e){this._object=t,this._groupBadge=e}get object(){return this._object}get groupBadge(){return this._groupBadge}}class fl{constructor(t,e,s,i,r,a=0,o=null,h=null,_=-1,l=-1,c=null){this._id=0,this._category=0,this._operation="",this._loc=null,this._dir=null,this._typeId=0,this._instanceData=null,this._stuffData=null,this._state=-1,this._animFrame=-1,this._posture=null,this._id=t,this._category=e,this._operation=s,this._loc=new R,this._loc.assign(i),this._dir=new R,this._dir.assign(r),this._typeId=a,this._instanceData=o,this._stuffData=h,this._state=_,this._animFrame=l,this._posture=c}get id(){return this._id}get category(){return this._category}get operation(){return this._operation}get loc(){return this._loc}get dir(){return this._dir}get typeId(){return this._typeId}get instanceData(){return this._instanceData}get stuffData(){return this._stuffData}get state(){return this._state}get animFrame(){return this._animFrame}get posture(){return this._posture}dispose(){this._loc=null,this._dir=null}}const Se=class Se{constructor(){this.spriteCount=0,this.externalImageCount=0}static addMannequinSprites(t,e){const s=[];for(const i of t)if(i)if(i.type==="boutique_mannequin1"&&i.name.indexOf("mannequin_")===0){const r=e.getRoomObject(e.activeRoomId,i.objectId,M.FLOOR);if(r){const a=r.visualization.getSpriteList();if(a)for(const o of a)o.x=o.x+(i.x+i.width/2+Se.MANNEQUIN_MAGIC_X_OFFSET),o.y=o.y+(i.y+i.height+Se.MANNEQUIN_MAGIC_Y_OFFSET),o.z=o.z+i.z,s.push(o)}}else s.push(i);return s}static sortSpriteDataObjects(t,e){return t.z<e.z?1:(t.z>e.z,-1)}static isSpriteInViewPort(t,e,s){return!0}static sortQuadPoints(t,e,s,i){const r=[];if(t.x==e.x?r.push(t,s,e,i):t.x==s.x?r.push(t,e,s,i):e.x<t.x&&e.y>t.y||e.x>t.x&&e.y<t.y?r.push(t,s,e,i):r.push(t,e,s,i),r[0].x<r[1].x){let a=r[0];r[0]=r[1],r[1]=a,a=r[2],r[2]=r[3],r[3]=a}if(r[0].y<r[2].y){let a=r[0];r[0]=r[2],r[2]=a,a=r[1],r[1]=r[3],r[3]=a}return r}getFurniData(t,e,s,i){const r=[];let a=e.getSortableSpriteList();const o=s.getRoomObjects(s.activeRoomId,M.UNIT);for(const h of o)if(h.id!==i){const _=h.visualization.getSpriteList();if(_){let l=0,c=0;for(const p of a)if(p.name==="avatar_"+h.id){l=p.z,c=p.y+p.height-e.geometry.scale/4;break}const f=s.getRoomObjectScreenLocation(s.activeRoomId,h.id,M.UNIT,e.id);if(f){c===0&&(c=f.y);for(const p of _)p.x=p.x+(f.x-e.screenOffsetX),p.y=p.y+c,p.z=p.z+l,(p.name.indexOf("h_std_fx29_")===0||p.name.indexOf("h_std_fx185_")===0)&&(p.y=p.y+Se.AVATAR_WATER_EFFECT_MAGIC_Y_OFFSET),a.push(p)}}}a=Se.addMannequinSprites(a,s),a.sort(Se.sortSpriteDataObjects);for(const h of a)h.name!==null&&h.name.length>0&&h.name.indexOf("tile_cursor_")!==0&&Se.isSpriteInViewPort(h,t,e)&&(i<0||h.objectId!=i)&&(r.push(this.getSpriteDataObject(h,t,e,s)),this.maxZ||(this.maxZ=h.z),this.spriteCount++);return JSON.stringify(r)}getRoomRenderingModifiers(t){return JSON.stringify(new Object)}getSpriteDataObject(t,e,s,i){let r=[];const a={};let o=t.name;return t.name.indexOf("@")!==-1&&(r=t.name.split("@"),o=r[0],r[1]),a.name=o,a.x=t.x-e.x,a.y=t.y-e.y,a.x=a.x+s.screenOffsetX,a.y=a.y+s.screenOffsetY,a.z=t.z,t.alpha&&t.alpha.toString()!=="255"&&(a.alpha=t.alpha),t.flipH&&(a.flipH=t.flipH),t.skew&&(a.skew=t.skew),t.frame&&(a.frame=t.frame),t.color&&t.color.length>0&&(a.color=parseInt(t.color)),t.blendMode&&t.blendMode!=="normal"&&(a.blendMode=t.blendMode),o.indexOf("http")===0&&(a.width=t.width,a.height=t.height,this.externalImageCount++,this.externalImageCount>Se.MAX_EXTERNAL_IMAGE_COUNT&&(a.name="box")),t.posture&&(a.posture=t.posture),a}makeBackgroundPlane(t,e,s){const i=new K(0,0),r=new K(t.width,0),a=new K(0,t.height),o=new K(t.width,t.height),h=Se.sortQuadPoints(i,r,a,o);let _=0;s.length>0?(_=s[0].z,this.maxZ&&(_=Math.max(this.maxZ,_))):_=this.maxZ?this.maxZ:0,_=_+(this.spriteCount*1.776104+s.length*2.31743);const l=new Jn(null,e);return l.cornerPoints=h,l.z=_,l}sortRoomPlanes(t,e,s){const i=new Map;let r=1;this.maxZ&&(r=r+this.maxZ);for(const h of t){const _={plane:h,z:r};i.set(h.uniqueId,_)}const a=e.getPlaneSortableSprites();a.sort((h,_)=>_.z-h.z),a.reverse();let o=[];for(const h of a){const _=h.sprite;if(_){const l=i.get(_.id);l&&(i.delete(_.id),l.z=h.z,o.push(l))}}return o=o.concat(Array.from(i.values())),o}getRoomPlanes(t,e,s,i){const r=[],o=s.getRoomObject(s.activeRoomId,so.ROOM_OBJECT_ID,M.ROOM).visualization;if(o){const h=e.geometry,_=this.sortRoomPlanes(o.planes,e,s),l=Kt.instance.stage;for(const c of _){const f=c.plane,p=[],m=R.sum(f.location,f.leftSide),O=h.getScreenPoint(f.location),A=h.getScreenPoint(m),C=h.getScreenPoint(R.sum(f.location,f.rightSide)),L=h.getScreenPoint(R.sum(m,f.rightSide));p.push(O,A,C,L);let D=0,U=0;for(const P of p)P.x+=l.width/2,P.y+=l.height/2,P.x+=e.screenOffsetX,P.y+=e.screenOffsetY,P.x+=-t.x,P.y+=-t.y,P.x<0?D--:P.x>=t.width&&D++,P.y<0?U--:P.y>=t.height&&U++;if(!(Math.abs(D)===4||Math.abs(U)===4)){const P=Se.sortQuadPoints(O,A,C,L);for(const v of f.getDrawingDatas(h))v.cornerPoints=P,v.z=c.z,r.push(v)}}r.unshift(this.makeBackgroundPlane(t,i,r))}return r}};Se.MANNEQUIN_MAGIC_X_OFFSET=1,Se.MANNEQUIN_MAGIC_Y_OFFSET=-16,Se.AVATAR_WATER_EFFECT_MAGIC_Y_OFFSET=-52,Se.MAX_EXTERNAL_IMAGE_COUNT=30;let Nd=Se;class Q2 extends Ye{constructor(t){super(),this._connection=null,this._roomCreator=t,this._planeParser=new kt,this._latestEntryTileEvent=null,this._currentRoomId=0,this._ownUserId=0,this._initialConnection=!0,this._guideId=-1,this._requesterId=-1}onDispose(){super.onDispose(),this._connection=null,this._roomCreator=null,this._latestEntryTileEvent=null,this._planeParser&&(this._planeParser.dispose(),this._planeParser=null)}setConnection(t){this._connection||!t||(this._connection=t,this._connection.addMessageEvent(new qo(this.onUserInfoEvent.bind(this))),this._connection.addMessageEvent(new kn(this.onRoomReadyMessageEvent.bind(this))),this._connection.addMessageEvent(new fu(this.onRoomPaintEvent.bind(this))),this._connection.addMessageEvent(new uu(this.onRoomModelEvent.bind(this))),this._connection.addMessageEvent(new Eu(this.onRoomHeightMapEvent.bind(this))),this._connection.addMessageEvent(new gu(this.onRoomHeightMapUpdateEvent.bind(this))),this._connection.addMessageEvent(new Iu(this.onRoomThicknessEvent.bind(this))),this._connection.addMessageEvent(new du(this.onRoomDoorEvent.bind(this))),this._connection.addMessageEvent(new Zc(this.onRoomRollingEvent.bind(this))),this._connection.addMessageEvent(new Jc(this.onObjectsDataUpdateEvent.bind(this))),this._connection.addMessageEvent(new ru(this.onFurnitureAliasesEvent.bind(this))),this._connection.addMessageEvent(new tu(this.onFurnitureFloorAddEvent.bind(this))),this._connection.addMessageEvent(new eu(this.onFurnitureFloorEvent.bind(this))),this._connection.addMessageEvent(new su(this.onFurnitureFloorRemoveEvent.bind(this))),this._connection.addMessageEvent(new iu(this.onFurnitureFloorUpdateEvent.bind(this))),this._connection.addMessageEvent(new hu(this.onFurnitureWallAddEvent.bind(this))),this._connection.addMessageEvent(new _u(this.onFurnitureWallEvent.bind(this))),this._connection.addMessageEvent(new lu(this.onFurnitureWallRemoveEvent.bind(this))),this._connection.addMessageEvent(new cu(this.onFurnitureWallUpdateEvent.bind(this))),this._connection.addMessageEvent(new nu(this.onFurnitureDataEvent.bind(this))),this._connection.addMessageEvent(new au(this.onItemDataUpdateMessageEvent.bind(this))),this._connection.addMessageEvent(new ou(this.onOneWayDoorStatusMessageEvent.bind(this))),this._connection.addMessageEvent(new Wo(this.onRoomUnitDanceEvent.bind(this))),this._connection.addMessageEvent(new mu(this.onRoomUnitEffectEvent.bind(this))),this._connection.addMessageEvent(new ko(this.onRoomUnitEvent.bind(this))),this._connection.addMessageEvent(new pu(this.onRoomUnitExpressionEvent.bind(this))),this._connection.addMessageEvent(new Ru(this.onRoomUnitHandItemEvent.bind(this))),this._connection.addMessageEvent(new Ou(this.onRoomUnitIdleEvent.bind(this))),this._connection.addMessageEvent(new Ko(this.onRoomUnitInfoEvent.bind(this))),this._connection.addMessageEvent(new Au(this.onRoomUnitNumberEvent.bind(this))),this._connection.addMessageEvent(new Xo(this.onRoomUnitRemoveEvent.bind(this))),this._connection.addMessageEvent(new Su(this.onRoomUnitStatusEvent.bind(this))),this._connection.addMessageEvent(new zd(this.onRoomUnitChatEvent.bind(this))),this._connection.addMessageEvent(new jo(this.onRoomUnitChatEvent.bind(this))),this._connection.addMessageEvent(new zo(this.onRoomUnitChatEvent.bind(this))),this._connection.addMessageEvent(new Tu(this.onRoomUnitTypingEvent.bind(this))),this._connection.addMessageEvent(new Ho(this.onPetFigureUpdateEvent.bind(this))),this._connection.addMessageEvent(new cf(this.onPetExperienceEvent.bind(this))),this._connection.addMessageEvent(new Ef(this.onYouArePlayingGameEvent.bind(this))),this._connection.addMessageEvent(new $c(this.onDiceValueMessageEvent.bind(this))),this._connection.addMessageEvent(new kd(this.onIgnoreResultEvent.bind(this))),this._connection.addMessageEvent(new Hg(this.onGuideSessionStartedMessageEvent.bind(this))),this._connection.addMessageEvent(new Vg(this.onGuideSessionEndedMessageEvent.bind(this))),this._connection.addMessageEvent(new Yg(this.onGuideSessionErrorMessageEvent.bind(this))))}setRoomId(t){this._currentRoomId!==0&&this._roomCreator&&this._roomCreator.destroyRoom(this._currentRoomId),this._currentRoomId=t,this._latestEntryTileEvent=null}clearRoomId(){this._currentRoomId=0,this._latestEntryTileEvent=null}onUserInfoEvent(t){if(!(t instanceof qo)||!t.connection)return;const e=t.getParser();e&&(this._ownUserId=e.userInfo.userId)}onRoomReadyMessageEvent(t){const e=t.getParser();if(this._currentRoomId!==e.roomId&&this.setRoomId(e.roomId),this._roomCreator&&this._roomCreator.setRoomInstanceModelName(e.roomId,e.name),this._initialConnection){t.connection.send(new OI),this._initialConnection=!1;return}t.connection.send(new xu)}onRoomPaintEvent(t){if(!(t instanceof fu))return;const e=t.getParser();if(!e)return;const s=e.floorType,i=e.wallType,r=e.landscapeType;this._roomCreator&&this._roomCreator.updateRoomInstancePlaneType(this._currentRoomId,s,i,r)}onRoomModelEvent(t){if(!(t instanceof uu)||!t.connection||!this._roomCreator)return;const e=t.getParser();if(!e)return;const s=this._roomCreator.getLegacyWallGeometry(this._currentRoomId);if(!s)return;this._planeParser.reset();const i=e.width,r=e.height;this._planeParser.initializeTileMap(i,r);let a=null;this._latestEntryTileEvent&&(a=this._latestEntryTileEvent.getParser());let o=-1,h=-1,_=0,l=0,c=0;for(;c<r;){let m=0;for(;m<i;){const O=e.getHeight(m,c);(c>0&&c<r-1||m>0&&m<i-1)&&O!=kt.TILE_BLOCKED&&(a==null||m==a.x&&c==a.y)&&(e.getHeight(m,c-1)==kt.TILE_BLOCKED&&e.getHeight(m-1,c)==kt.TILE_BLOCKED&&e.getHeight(m,c+1)==kt.TILE_BLOCKED&&(o=m+.5,h=c,_=O,l=90),e.getHeight(m,c-1)==kt.TILE_BLOCKED&&e.getHeight(m-1,c)==kt.TILE_BLOCKED&&e.getHeight(m+1,c)==kt.TILE_BLOCKED&&(o=m,h=c+.5,_=O,l=180)),this._planeParser.setTileHeight(m,c,O),m++}c++}this._planeParser.setTileHeight(Math.floor(o),Math.floor(h),_),this._planeParser.initializeFromTileData(e.wallHeight),this._planeParser.setTileHeight(Math.floor(o),Math.floor(h),_+this._planeParser.wallHeight),s.scale=e.scale,s.initialize(i,r,this._planeParser.floorHeight);let f=e.height-1;for(;f>=0;){let m=e.width-1;for(;m>=0;)s.setHeight(m,f,this._planeParser.getTileHeight(m,f)),m--;f--}const p=this._planeParser.getMapData();p.doors.push({x:o,y:h,z:_,dir:l}),this._roomCreator.createRoomInstance(this._currentRoomId,p)}onRoomHeightMapEvent(t){if(!(t instanceof Eu)||!t.connection||!this._roomCreator)return;const e=t.getParser();if(!e)return;const s=e.width,i=e.height,r=new k2(s,i);let a=0;for(;a<i;){let o=0;for(;o<s;)r.setTileHeight(o,a,e.getTileHeight(o,a)),r.setStackingBlocked(o,a,e.getStackingBlocked(o,a)),r.setIsRoomTile(o,a,e.isRoomTile(o,a)),o++;a++}this._roomCreator.setFurnitureStackingHeightMap(this._currentRoomId,r)}onRoomHeightMapUpdateEvent(t){if(!(t instanceof gu)||!t.connection||!this._roomCreator)return;const e=t.getParser();if(!e)return;const s=this._roomCreator.getFurnitureStackingHeightMap(this._currentRoomId);if(s){for(;e.next();)s.setTileHeight(e.x,e.y,e.tileHeight()),s.setStackingBlocked(e.x,e.y,e.isStackingBlocked()),s.setIsRoomTile(e.x,e.y,e.isRoomTile());this._roomCreator.refreshTileObjectMap(this._currentRoomId,"RoomMessageHandler.onRoomHeightMapUpdateEvent()")}}onRoomThicknessEvent(t){if(!(t instanceof Iu))return;const e=t.getParser();if(!e)return;const s=!e.hideWalls,i=!0,r=e.thicknessWall,a=e.thicknessFloor;this._roomCreator&&(this._roomCreator.updateRoomInstancePlaneVisibility(this._currentRoomId,s,i),this._roomCreator.updateRoomInstancePlaneThickness(this._currentRoomId,r,a))}onRoomDoorEvent(t){t instanceof du&&(this._latestEntryTileEvent=t)}onRoomRollingEvent(t){if(!(t instanceof Zc)||!t.connection||!this._roomCreator)return;const e=t.getParser();this._roomCreator.updateRoomObjectFloor(this._currentRoomId,e.rollerId,null,null,1,null),this._roomCreator.updateRoomObjectFloor(this._currentRoomId,e.rollerId,null,null,2,null);const s=e.itemsRolling;if(s&&s.length)for(const r of s)r&&this._roomCreator.rollRoomObjectFloor(this._currentRoomId,r.id,r.location,r.targetLocation);const i=e.unitRolling;if(i){this._roomCreator.updateRoomObjectUserLocation(this._currentRoomId,i.id,i.location,i.targetLocation);const r=this._roomCreator.getRoomObjectUser(this._currentRoomId,i.id);if(r&&r.type!==pt.MONSTER_PLANT){let a="std";switch(i.movementType){case di.MOVE:a="mv";break;case di.SLIDE:a="std";break}this._roomCreator.updateRoomObjectUserPosture(this._currentRoomId,i.id,a)}}}onObjectsDataUpdateEvent(t){if(!(t instanceof Jc)||!t.connection||!this._roomCreator)return;const e=t.getParser();if(e)for(const s of e.objects)this._roomCreator.updateRoomObjectFloor(this._currentRoomId,s.id,null,null,s.state,s.data)}onFurnitureAliasesEvent(t){!(t instanceof ru)||!t.connection||!this._roomCreator||(t.getParser().aliases,this._connection.send(new xu))}onFurnitureFloorAddEvent(t){if(!(t instanceof tu)||!t.connection||!this._roomCreator)return;const e=t.getParser().item;e&&this.addRoomObjectFurnitureFloor(this._currentRoomId,e)}onFurnitureFloorEvent(t){if(!(t instanceof eu)||!t.connection||!this._roomCreator)return;const e=t.getParser();if(!e)return;const s=e.items.length;let i=0;for(;i<s;){const r=e.items[i];r&&this.addRoomObjectFurnitureFloor(this._currentRoomId,r),i++}}onFurnitureFloorRemoveEvent(t){if(!(t instanceof su)||!t.connection||!this._roomCreator)return;const e=t.getParser();e&&(e.delay>0?setTimeout(()=>{this._roomCreator.removeRoomObjectFloor(this._currentRoomId,e.itemId,e.isExpired?-1:e.userId,!0)},e.delay):this._roomCreator.removeRoomObjectFloor(this._currentRoomId,e.itemId,e.isExpired?-1:e.userId,!0))}onFurnitureFloorUpdateEvent(t){if(!(t instanceof iu)||!t.connection||!this._roomCreator)return;const e=t.getParser().item;if(!e)return;const s=new R(e.x,e.y,e.z),i=new R(e.direction);this._roomCreator.updateRoomObjectFloor(this._currentRoomId,e.itemId,s,i,e.data.state,e.data,e.extra),this._roomCreator.updateRoomObjectFloorHeight(this._currentRoomId,e.itemId,e.stackHeight),this._roomCreator.updateRoomObjectFloorExpiration(this._currentRoomId,e.itemId,e.expires)}onFurnitureWallAddEvent(t){if(!(t instanceof hu)||!t.connection||!this._roomCreator)return;const e=t.getParser().item;e&&this.addRoomObjectFurnitureWall(this._currentRoomId,e)}onFurnitureWallEvent(t){if(!(t instanceof _u)||!t.connection||!this._roomCreator)return;const e=t.getParser();if(!e)return;const s=e.items.length;let i=0;for(;i<s;){const r=e.items[i];r&&this.addRoomObjectFurnitureWall(this._currentRoomId,r),i++}}onFurnitureWallRemoveEvent(t){if(!(t instanceof lu)||!t.connection||!this._roomCreator)return;const e=t.getParser();e&&this._roomCreator.removeRoomObjectWall(this._currentRoomId,e.itemId,e.userId)}onFurnitureWallUpdateEvent(t){if(!(t instanceof cu)||!t.connection||!this._roomCreator)return;const e=this._roomCreator.getLegacyWallGeometry(this._currentRoomId);if(!e)return;const s=t.getParser().item;if(!s)return;const i=e.getLocation(s.width,s.height,s.localX,s.localY,s.direction),r=new R(e.getDirection(s.direction));this._roomCreator.updateRoomObjectWall(this._currentRoomId,s.itemId,i,r,s.state,s.stuffData),this._roomCreator.updateRoomObjectWallExpiration(this._currentRoomId,s.itemId,s.secondsToExpiration)}onFurnitureDataEvent(t){if(!(t instanceof nu)||!t.connection||!this._roomCreator)return;const e=t.getParser();this._roomCreator.updateRoomObjectFloor(this._currentRoomId,e.furnitureId,null,null,e.objectData.state,e.objectData)}onItemDataUpdateMessageEvent(t){if(!(t instanceof au)||!t.connection||!this._roomCreator)return;const e=t.getParser();this._roomCreator.updateRoomObjectWallItemData(this._currentRoomId,e.furnitureId,e.data)}onOneWayDoorStatusMessageEvent(t){if(!(t instanceof ou)||!t.connection||!this._roomCreator)return;const e=t.getParser();this._roomCreator.updateRoomObjectFloor(this._currentRoomId,e.itemId,null,null,e.state,new Ne)}onDiceValueMessageEvent(t){if(!(t instanceof $c)||!t.connection||!this._roomCreator)return;const e=t.getParser();this._roomCreator.updateRoomObjectFloor(this._currentRoomId,e.itemId,null,null,e.value,new Ne)}onRoomUnitDanceEvent(t){!(t instanceof Wo)||!t.connection||!this._roomCreator||this._roomCreator.updateRoomObjectUserAction(this._currentRoomId,t.getParser().unitId,g.FIGURE_DANCE,t.getParser().danceId)}onRoomUnitEffectEvent(t){!(t instanceof mu)||!t.connection||!this._roomCreator||this._roomCreator.updateRoomObjectUserEffect(this._currentRoomId,t.getParser().unitId,t.getParser().effectId,t.getParser().delay)}onRoomUnitEvent(t){if(!(t instanceof ko)||!t.connection||!this._roomCreator)return;const e=t.getParser().users;if(!(!e||!e.length)){for(const s of e){if(!s)continue;const i=new R(s.x,s.y,s.z),r=new R(s.dir);this._roomCreator.addRoomObjectUser(this._currentRoomId,s.roomIndex,i,r,s.dir,s.userType,s.figure),s.webID===this._ownUserId&&(this._roomCreator.setRoomSessionOwnUser(this._currentRoomId,s.roomIndex),this._roomCreator.updateRoomObjectUserOwn(this._currentRoomId,s.roomIndex)),this._roomCreator.updateRoomObjectUserFigure(this._currentRoomId,s.roomIndex,s.figure,s.sex,s.subType,s.isRiding),pt.getTypeString(s.userType)===pt.PET&&this._roomCreator.getPetTypeId(s.figure)===ja.MONSTERPLANT&&this._roomCreator.updateRoomObjectUserPosture(this._currentRoomId,s.roomIndex,s.petPosture),this._roomCreator.updateRoomObjectUserAction(this._currentRoomId,s.roomIndex,g.FIGURE_IS_MUTED,this._roomCreator.sessionDataManager.isUserIgnored(s.name)?1:0)}this.updateGuideMarker()}}onRoomUnitExpressionEvent(t){!(t instanceof pu)||!t.connection||!this._roomCreator||this._roomCreator.updateRoomObjectUserAction(this._currentRoomId,t.getParser().unitId,g.FIGURE_EXPRESSION,t.getParser().expression)}onRoomUnitHandItemEvent(t){!(t instanceof Ru)||!t.connection||!this._roomCreator||this._roomCreator.updateRoomObjectUserAction(this._currentRoomId,t.getParser().unitId,g.FIGURE_CARRY_OBJECT,t.getParser().handId)}onRoomUnitIdleEvent(t){!(t instanceof Ou)||!t.connection||!this._roomCreator||this._roomCreator.updateRoomObjectUserAction(this._currentRoomId,t.getParser().unitId,g.FIGURE_SLEEP,t.getParser().isIdle?1:0)}onRoomUnitInfoEvent(t){!(t instanceof Ko)||!t.connection||!this._roomCreator||this._roomCreator.updateRoomObjectUserFigure(this._currentRoomId,t.getParser().unitId,t.getParser().figure,t.getParser().gender)}onRoomUnitNumberEvent(t){if(!(t instanceof Au)||!t.connection||!this._roomCreator)return;const e=t.getParser();e&&this._roomCreator.updateRoomObjectUserAction(this._currentRoomId,e.unitId,g.FIGURE_NUMBER_VALUE,e.value)}onRoomUnitRemoveEvent(t){!(t instanceof Xo)||!t.connection||!this._roomCreator||(this._roomCreator.removeRoomObjectUser(this._currentRoomId,t.getParser().unitId),this.updateGuideMarker())}onRoomUnitStatusEvent(t){if(!(t instanceof Su)||!t.connection||!this._roomCreator)return;const e=t.getParser().statuses;if(!e||!e.length)return;const s=this._roomCreator.getRoomInstance(this._currentRoomId);if(!s)return;const i=s.model.getValue(Yt.ROOM_Z_SCALE)||1;for(const r of e){if(!r)continue;let a=r.height;a&&(a=a/i);const o=new R(r.x,r.y,r.z+a),h=new R(r.direction);let _=null;r.didMove&&(_=new R(r.targetX,r.targetY,r.targetZ)),this._roomCreator.updateRoomObjectUserLocation(this._currentRoomId,r.id,o,_,r.canStandUp,a,h,r.headDirection),this._roomCreator.updateRoomObjectUserFlatControl(this._currentRoomId,r.id,"0");let l=!0,c=!1,f=g.STD,p="";if(r.actions&&r.actions.length){for(const m of r.actions)if(m)switch(m.action){case"flatctrl":this._roomCreator.updateRoomObjectUserFlatControl(this._currentRoomId,r.id,m.value);break;case"sign":r.actions.length===1&&(l=!1),this._roomCreator.updateRoomObjectUserAction(this._currentRoomId,r.id,g.FIGURE_SIGN,parseInt(m.value));break;case"gst":r.actions.length===1&&(l=!1),this._roomCreator.updateRoomObjectUserPetGesture(this._currentRoomId,r.id,m.value);break;case"wav":case"mv":c=!0,f=m.action,p=m.value;break;case"trd":break;default:c=!0,f=m.action,p=m.value;break}}c?this._roomCreator.updateRoomObjectUserPosture(this._currentRoomId,r.id,f,p):l&&this._roomCreator.updateRoomObjectUserPosture(this._currentRoomId,r.id,g.STD,"")}this.updateGuideMarker()}onRoomUnitChatEvent(t){if(!t.connection||!this._roomCreator)return;const e=t.getParser();e&&(this._roomCreator.updateRoomObjectUserGesture(this._currentRoomId,e.roomIndex,e.gesture),this._roomCreator.updateRoomObjectUserAction(this._currentRoomId,e.roomIndex,g.FIGURE_TALK,e.message.length/10))}onRoomUnitTypingEvent(t){!(t instanceof Tu)||!t.connection||!this._roomCreator||this._roomCreator.updateRoomObjectUserAction(this._currentRoomId,t.getParser().unitId,g.FIGURE_IS_TYPING,t.getParser().isTyping?1:0)}onPetFigureUpdateEvent(t){if(!(t instanceof Ho)||!t.connection||!this._roomCreator)return;const e=t.getParser();e&&this._roomCreator.updateRoomObjectUserFigure(this._currentRoomId,e.roomIndex,e.figureData.figuredata,"","",e.isRiding)}onPetExperienceEvent(t){const e=t.getParser();e&&this._roomCreator.updateRoomObjectUserAction(this._currentRoomId,e.roomIndex,g.FIGURE_GAINED_EXPERIENCE,e.gainedExperience)}onYouArePlayingGameEvent(t){if(!t)return;const e=t.getParser();e&&this._roomCreator.setRoomEngineGameMode(this._currentRoomId,e.isPlaying)}addRoomObjectFurnitureFloor(t,e){if(!e||!this._roomCreator)return;const s=new R(e.x,e.y,e.z),i=new R(e.direction);e.spriteName?this._roomCreator.addFurnitureFloorByTypeName(t,e.itemId,e.spriteName,s,i,e.state,e.data,e.extra,e.expires,e.usagePolicy,e.userId,e.username,!0,!0,e.stackHeight):this._roomCreator.addFurnitureFloor(t,e.itemId,e.spriteId,s,i,e.state,e.data,e.extra,e.expires,e.usagePolicy,e.userId,e.username,!0,!0,e.stackHeight)}addRoomObjectFurnitureWall(t,e){if(!e||!this._roomCreator)return;const s=this._roomCreator.getLegacyWallGeometry(t);if(!s)return;let i=null;e.isOldFormat||(i=s.getLocation(e.width,e.height,e.localX,e.localY,e.direction));const r=new R(s.getDirection(e.direction));this._roomCreator.addFurnitureWall(t,e.itemId,e.spriteId,i,r,e.state,e.stuffData,e.secondsToExpiration,e.usagePolicy,e.userId,e.username)}onIgnoreResultEvent(t){if(!t)return;const e=t.getParser();if(!e)return;const s=this._roomCreator.roomSessionManager.getSession(this._currentRoomId);if(!s)return;const i=s.userDataManager.getUserDataByName(e.name);if(i)switch(e.result){case 1:case 2:this._roomCreator.updateRoomObjectUserAction(this._currentRoomId,i.roomIndex,g.FIGURE_IS_MUTED,1);return;case 3:this._roomCreator.updateRoomObjectUserAction(this._currentRoomId,i.roomIndex,g.FIGURE_IS_MUTED,0);return}}onGuideSessionStartedMessageEvent(t){const e=t.getParser();this._guideId=e.guideUserId,this._requesterId=e.requesterUserId,this.updateGuideMarker()}onGuideSessionEndedMessageEvent(t){this.removeGuideMarker()}onGuideSessionErrorMessageEvent(t){this.removeGuideMarker()}updateGuideMarker(){const t=this._roomCreator.sessionDataManager.userId;this.setUserGuideStatus(this._guideId,this._requesterId===t?Ws.GUIDE:Ws.NONE),this.setUserGuideStatus(this._requesterId,this._guideId===t?Ws.REQUESTER:Ws.NONE)}removeGuideMarker(){this.setUserGuideStatus(this._guideId,Ws.NONE),this.setUserGuideStatus(this._requesterId,Ws.NONE),this._guideId=-1,this._requesterId=-1}setUserGuideStatus(t,e){if(!this._roomCreator||!this._roomCreator.roomSessionManager)return;const s=this._roomCreator.roomSessionManager.getSession(this._currentRoomId);if(!s)return;const i=s.userDataManager.getDataByType(t,fi.USER);i&&this._roomCreator.updateRoomObjectUserAction(this._currentRoomId,i.roomIndex,g.FIGURE_GUIDE_STATUS,e)}get currentRoomId(){return this._currentRoomId}}class J2 extends Ye{constructor(t){super(),this._roomEngine=t,this._eventIds=new Map,this._selectedAvatarId=-1,this._selectedObjectId=-1,this._selectedObjectCategory=-2,this._whereYouClickIsWhereYouGo=!0,this._objectPlacementSource=null,this.onRoomEngineObjectEvent=this.onRoomEngineObjectEvent.bind(this),this._roomEngine.events.addEventListener(Z.ADDED,this.onRoomEngineObjectEvent)}dispose(){this._eventIds&&(this._eventIds=null),this._roomEngine.events.removeEventListener(Z.ADDED,this.onRoomEngineObjectEvent),this._roomEngine=null}onRoomEngineObjectEvent(t){let e=this.getSelectedRoomObjectData(t.roomId);if(e&&e.operation===lt.OBJECT_PLACE&&e.id===t.objectId){const s=this._roomEngine.getRoomObject(t.roomId,e.id,e.category);if(s&&s.model&&e.category===M.FLOOR){const i=s.model.getValue(g.FURNITURE_ALLOWED_DIRECTIONS);if(i&&i.length){const r=new R(i[0]);if(s.setDirection(r),this.updateSelectedObjectData(t.roomId,e.id,e.category,e.loc,r,e.operation,e.typeId,e.instanceData,e.stuffData,e.state,e.animFrame,e.posture),e=this.getSelectedRoomObjectData(t.roomId),!e)return}}this.setFurnitureAlphaMultiplier(s,.5)}}processRoomCanvasMouseEvent(t,e,s){if(!t||!e||ks.isRunning())return;const i=e.type;let r=this._roomEngine.getRoomObjectCategoryForType(i);if(r!==M.ROOM&&(!this._roomEngine.isPlayingGame()||r!==M.UNIT)&&(r=M.MINIMUM),this.getMouseEventId(r,t.type)===t.eventId){if(t.type===z.MOUSE_CLICK||t.type===z.DOUBLE_CLICK||t.type===z.MOUSE_DOWN||t.type===z.MOUSE_UP||t.type===z.MOUSE_MOVE)return}else t.eventId&&this.setMouseEventId(r,t.type,t.eventId);e.mouseHandler&&e.mouseHandler.mouseEvent(t,s)}processRoomObjectPlacement(t,e,s,i,r,a=null,o=null,h=-1,_=-1,l=null){this._objectPlacementSource=t;const c=new R(-100,-100),f=new R(0);return this.setSelectedRoomObjectData(e,s,i,c,f,lt.OBJECT_PLACE,r,a,o,h,_,l),this._roomEngine&&(this._roomEngine.setObjectMoverIconSprite(r,i,!1,a,o,h,_,l),this._roomEngine.setObjectMoverIconSpriteVisible(!1)),!0}cancelRoomObjectInsert(t){return this.resetSelectedObjectData(t),!0}getMouseEventId(t,e){const s=this._eventIds.get(t);return s&&s.get(e)||null}setMouseEventId(t,e,s){let i=this._eventIds.get(t);i||(i=new Map,this._eventIds.set(t,i)),i.delete(e),i.set(e,s)}handleRoomObjectEvent(t,e){if(t){if(t instanceof X){this.handleRoomObjectMouseEvent(t,e);return}switch(t.type){case Et.STATE_CHANGE:case Et.STATE_RANDOM:this.onRoomObjectStateChangedEvent(t,e);return;case Br.DIMMER_STATE:this.onRoomObjectDimmerStateUpdateEvent(t,e);return;case Ee.POSITION_CHANGED:case Ee.OBJECT_REMOVED:this.handleSelectedObjectRemove(t,e);return;case S.OPEN_WIDGET:case S.CLOSE_WIDGET:case S.OPEN_FURNI_CONTEXT_MENU:case S.CLOSE_FURNI_CONTEXT_MENU:case S.PLACEHOLDER:case S.CREDITFURNI:case S.STACK_HEIGHT:case S.EXTERNAL_IMAGE:case S.STICKIE:case S.PRESENT:case S.TROPHY:case S.TEASER:case S.ECOTRONBOX:case S.DIMMER:case S.WIDGET_REMOVE_DIMMER:case S.CLOTHING_CHANGE:case S.JUKEBOX_PLAYLIST_EDITOR:case S.MANNEQUIN:case S.PET_PRODUCT_MENU:case S.GUILD_FURNI_CONTEXT_MENU:case S.MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG:case S.PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG:case S.BACKGROUND_COLOR:case S.MYSTERYBOX_OPEN_DIALOG:case S.EFFECTBOX_OPEN_DIALOG:case S.MYSTERYTROPHY_OPEN_DIALOG:case S.ACHIEVEMENT_RESOLUTION_OPEN:case S.ACHIEVEMENT_RESOLUTION_ENGRAVING:case S.ACHIEVEMENT_RESOLUTION_FAILED:case S.FRIEND_FURNITURE_CONFIRM:case S.FRIEND_FURNITURE_ENGRAVING:case S.BADGE_DISPLAY_ENGRAVING:case S.HIGH_SCORE_DISPLAY:case S.HIDE_HIGH_SCORE_DISPLAY:case S.INERNAL_LINK:case S.ROOM_LINK:case S.YOUTUBE:this.onRoomObjectWidgetRequestEvent(t,e);return;case y.DICE_ACTIVATE:case y.DICE_OFF:case y.USE_HABBOWHEEL:case y.STICKIE:case y.ENTER_ONEWAYDOOR:this.onRoomObjectFurnitureActionEvent(t,e);return;case y.SOUND_MACHINE_INIT:case y.SOUND_MACHINE_START:case y.SOUND_MACHINE_STOP:case y.SOUND_MACHINE_DISPOSE:this.handleObjectSoundMachineEvent(t,e);return;case y.JUKEBOX_INIT:case y.JUKEBOX_START:case y.JUKEBOX_MACHINE_STOP:case y.JUKEBOX_DISPOSE:this.handleObjectJukeboxEvent(t,e);return;case ue.ADD_HOLE:case ue.REMOVE_HOLE:this.onRoomObjectFloorHoleEvent(t,e);return;case Pt.ROOM_AD_FURNI_CLICK:case Pt.ROOM_AD_FURNI_DOUBLE_CLICK:case Pt.ROOM_AD_TOOLTIP_SHOW:case Pt.ROOM_AD_TOOLTIP_HIDE:case Pt.ROOM_AD_LOAD_IMAGE:this.onRoomObjectRoomAdEvent(t,e);return;case As.LOAD_BADGE:this.onRoomObjectBadgeAssetEvent(t,e);return;case y.MOUSE_ARROW:case y.MOUSE_BUTTON:this.handleMousePointer(t,e);return;case mi.PLAY_SOUND:case mi.PLAY_SOUND_AT_PITCH:this.handleRoomObjectPlaySoundEvent(t,e);return;case Ht.ROOM_OBJECT_INITIALIZED:case Ht.ROOM_OBJECT_DISPOSED:case Ht.PLAY_SAMPLE:case Ht.CHANGE_PITCH:this.handleRoomObjectSamplePlaybackEvent(t,e);return;case Ei.ROOM_BACKGROUND_COLOR:this.onHSLColorEnableEvent(t,e);return;case ls.RODRE_CURRENT_USER_ID:case ls.RODRE_URL_PREFIX:this.onRoomObjectDataRequestEvent(t,e);return;default:j.warn("Unhandled Event",t.constructor.name,"Object ID",t.object.id);return}}}handleRoomObjectMouseEvent(t,e){if(!(!t||!t.type))switch(t.type){case X.CLICK:this.handleRoomObjectMouseClickEvent(t,e);return;case X.DOUBLE_CLICK:this.handleRoomObjectMouseDoubleClickEvent(t,e);return;case X.MOUSE_MOVE:this.handleRoomObjectMouseMoveEvent(t,e);return;case X.MOUSE_DOWN:this.handleRoomObjectMouseDownEvent(t,e);return;case X.MOUSE_DOWN_LONG:this.handleRoomObjectMouseDownLongEvent(t,e);return;case X.MOUSE_ENTER:this.handleRoomObjectMouseEnterEvent(t,e);return;case X.MOUSE_LEAVE:this.handleRoomObjectMouseLeaveEvent(t,e);return}}handleRoomObjectMouseClickEvent(t,e){if(!t)return;let s=lt.OBJECT_UNDEFINED;const i=this.getSelectedRoomObjectData(e);i&&(s=i.operation);let r=!1,a=!1;this._whereYouClickIsWhereYouGo&&(!s||s===lt.OBJECT_UNDEFINED)&&(r=this.handleMoveTargetFurni(e,t));const o=this._roomEngine.getRoomObjectCategoryForType(t.objectType);switch(s){case lt.OBJECT_MOVE:o===M.ROOM?i&&this.modifyRoomObject(e,i.id,i.category,lt.OBJECT_MOVE_TO):o===M.UNIT&&(i&&t.objectType===pt.MONSTER_PLANT&&this.modifyRoomObject(e,i.id,i.category,lt.OBJECT_MOVE_TO),t.eventId&&this.setMouseEventId(M.ROOM,z.MOUSE_CLICK,t.eventId),this.placeObjectOnUser(e,t.objectId,o)),a=!0,t.objectId!==-1&&this.setSelectedObject(e,t.objectId,o);break;case lt.OBJECT_PLACE:if(o===M.ROOM)this.placeObject(e,t instanceof $s,t instanceof Xr);else if(o===M.UNIT)switch(t.objectType){case pt.MONSTER_PLANT:case pt.RENTABLE_BOT:this.placeObject(e,t instanceof $s,t instanceof Xr);break;default:t.eventId&&this.setMouseEventId(M.ROOM,z.MOUSE_CLICK,t.eventId),this.placeObjectOnUser(e,t.objectId,o);break}break;case lt.OBJECT_UNDEFINED:o===M.ROOM?!r&&t instanceof $s&&this.onRoomObjectTileMouseEvent(e,t):(this.setSelectedObject(e,t.objectId,o),a=!1,o===M.UNIT?(t.ctrlKey&&!t.altKey&&!t.shiftKey&&t.objectType===pt.RENTABLE_BOT?this.modifyRoomObject(e,t.objectId,o,lt.OBJECT_PICKUP_BOT):t.ctrlKey&&!t.altKey&&!t.shiftKey&&t.objectType===pt.MONSTER_PLANT?this.modifyRoomObject(e,t.objectId,o,lt.OBJECT_PICKUP_PET):!t.ctrlKey&&!t.altKey&&t.shiftKey&&t.objectType===pt.MONSTER_PLANT&&this.modifyRoomObject(e,t.objectId,o,lt.OBJECT_ROTATE_POSITIVE),this._roomEngine.isPlayingGame()?a=!0:r=!0):(o===M.FLOOR||o===M.WALL)&&(t.altKey||t.ctrlKey||t.shiftKey)&&(!t.ctrlKey&&!t.altKey&&t.shiftKey?o===M.FLOOR&&this._roomEngine.events&&this._roomEngine.events.dispatchEvent(new Z(Z.REQUEST_ROTATE,e,t.objectId,o)):t.ctrlKey&&!t.altKey&&!t.shiftKey&&this.modifyRoomObject(e,t.objectId,o,lt.OBJECT_PICKUP),this._roomEngine.isPlayingGame()?a=!0:r=!0),t.eventId&&(r&&this.setMouseEventId(M.ROOM,z.MOUSE_CLICK,t.eventId),a&&this.setMouseEventId(M.MINIMUM,z.MOUSE_CLICK,t.eventId)));break}if(o===M.ROOM){const h=this.getMouseEventId(M.MINIMUM,z.MOUSE_CLICK),_=this.getMouseEventId(M.UNIT,z.MOUSE_CLICK);h!==t.eventId&&_!==t.eventId&&!a&&(this.deselectObject(e),this._roomEngine.events&&this._roomEngine.events.dispatchEvent(new Z(Z.DESELECTED,e,-1,M.MINIMUM)),this.setSelectedAvatar(e,0,!1))}}handleRoomObjectMouseDoubleClickEvent(t,e){const s=t.objectId,i=t.objectType,r=this._roomEngine.getRoomObjectCategoryForType(i);this._roomEngine.events&&this._roomEngine.events.dispatchEvent(new Z(Z.DOUBLE_CLICK,e,s,r))}handleRoomObjectMouseMoveEvent(t,e){if(!t)return;let s=lt.OBJECT_UNDEFINED;const i=this.getSelectedRoomObjectData(e);i&&(s=i.operation);const r=this._roomEngine.getRoomObjectCategoryForType(t.objectType);if(this._roomEngine){const a=this._roomEngine.getRoomObjectCursor(e);if(a&&a.logic){let o=null;t instanceof $s?o=this.handleMouseOverTile(t,e):t.object&&t.object.id!==-1?this._whereYouClickIsWhereYouGo&&(o=this.handleMouseOverObject(r,e,t)):o=new qr(null,0,!1,t.eventId),a.processUpdateMessage(o)}}switch(s){case lt.OBJECT_MOVE:r===M.ROOM&&this.handleObjectMove(t,e);return;case lt.OBJECT_PLACE:r===M.ROOM&&this.handleObjectPlace(t,e);return}}handleRoomObjectMouseDownEvent(t,e){if(!t)return;let s=lt.OBJECT_UNDEFINED;const i=this.getSelectedRoomObjectData(e);i&&(s=i.operation);const r=this._roomEngine.getRoomObjectCategoryForType(t.objectType);switch(s){case lt.OBJECT_UNDEFINED:(r===M.FLOOR||r===M.WALL||t.objectType===pt.MONSTER_PLANT)&&(t.altKey&&!t.ctrlKey&&!t.shiftKey||this.decorateModeMove(t))&&this._roomEngine.events&&this._roomEngine.events.dispatchEvent(new Z(Z.REQUEST_MOVE,e,t.objectId,r));return}}handleRoomObjectMouseDownLongEvent(t,e){if(!t)return;let s=lt.OBJECT_UNDEFINED;const i=this.getSelectedRoomObjectData(e);i&&(s=i.operation);const r=this._roomEngine.getRoomObjectCategoryForType(t.objectType);switch(s){case lt.OBJECT_UNDEFINED:(r===M.FLOOR||r===M.WALL||t.objectType===pt.MONSTER_PLANT)&&(!t.ctrlKey&&!t.shiftKey||this.decorateModeMove(t))&&this._roomEngine.events&&this._roomEngine.events.dispatchEvent(new Z(Z.REQUEST_MANIPULATION,e,t.objectId,r));return}}handleRoomObjectMouseEnterEvent(t,e){const s=t.objectId,i=t.objectType,r=this._roomEngine.getRoomObjectCategoryForType(i);this._roomEngine.events&&this._roomEngine.events.dispatchEvent(new Z(Z.MOUSE_ENTER,e,s,r))}handleRoomObjectMouseLeaveEvent(t,e){const s=t.objectId,i=t.objectType,r=this._roomEngine.getRoomObjectCategoryForType(i);if(r!==M.ROOM&&r===M.UNIT){const a=this._roomEngine.getRoomObjectCursor(e);a&&a.processUpdateMessage(new St(0,null))}this._roomEngine.events&&this._roomEngine.events.dispatchEvent(new Z(Z.MOUSE_LEAVE,e,s,r))}onRoomObjectStateChangedEvent(t,e){if(t)switch(t.type){case Et.STATE_CHANGE:this.changeObjectState(e,t.object.id,t.object.type,t.state,!1);return;case Et.STATE_RANDOM:this.changeObjectState(e,t.object.id,t.object.type,t.state,!0);return}}onRoomObjectDimmerStateUpdateEvent(t,e){if(t)switch(t.type){case Br.DIMMER_STATE:this._roomEngine.events.dispatchEvent(new bl(e,t.state,t.presetId,t.effectId,t.color,t.brightness));return}}handleSelectedObjectRemove(t,e){if(!(!t||!this._roomEngine))switch(t.type){case Ee.POSITION_CHANGED:{const s=t.objectId,i=t.objectType,r=this._roomEngine.getRoomObjectCategoryForType(i),a=this._roomEngine.getRoomObject(e,s,r),o=this._roomEngine.getRoomObjectSelectionArrow(e);if(a&&o&&o.logic){const h=a.getLocation();o.logic.processUpdateMessage(new qt(h,null))}return}case Ee.OBJECT_REMOVED:this.setSelectedAvatar(e,0,!1);return}}onRoomObjectWidgetRequestEvent(t,e){if(!t||!this._roomEngine)return;const s=t.objectId,i=t.objectType,r=this._roomEngine.getRoomObjectCategoryForType(i),a=this._roomEngine.events;if(a&&!vo.isRoomPreviewerId(e))switch(t.type){case S.OPEN_WIDGET:a.dispatchEvent(new V(V.OPEN_WIDGET,e,s,r,t.object.logic.widget));return;case S.CLOSE_WIDGET:a.dispatchEvent(new V(V.CLOSE_WIDGET,e,s,r,t.object.logic.widget));return;case S.OPEN_FURNI_CONTEXT_MENU:a.dispatchEvent(new V(V.OPEN_FURNI_CONTEXT_MENU,e,s,r,t.object.logic.contextMenu));return;case S.CLOSE_FURNI_CONTEXT_MENU:a.dispatchEvent(new V(V.CLOSE_FURNI_CONTEXT_MENU,e,s,r));return;case S.PLACEHOLDER:a.dispatchEvent(new V(V.REQUEST_PLACEHOLDER,e,s,r));return;case S.CREDITFURNI:a.dispatchEvent(new V(V.REQUEST_CREDITFURNI,e,s,r));return;case S.STACK_HEIGHT:a.dispatchEvent(new V(V.REQUEST_STACK_HEIGHT,e,s,r));return;case S.EXTERNAL_IMAGE:a.dispatchEvent(new V(V.REQUEST_EXTERNAL_IMAGE,e,s,r));return;case S.STICKIE:a.dispatchEvent(new V(V.REQUEST_STICKIE,e,s,r));return;case S.PRESENT:a.dispatchEvent(new V(V.REQUEST_PRESENT,e,s,r));return;case S.TROPHY:a.dispatchEvent(new V(V.REQUEST_TROPHY,e,s,r));return;case S.TEASER:a.dispatchEvent(new V(V.REQUEST_TEASER,e,s,r));return;case S.ECOTRONBOX:a.dispatchEvent(new V(V.REQUEST_ECOTRONBOX,e,s,r));return;case S.DIMMER:a.dispatchEvent(new V(V.REQUEST_DIMMER,e,s,r));return;case S.WIDGET_REMOVE_DIMMER:a.dispatchEvent(new V(V.REMOVE_DIMMER,e,s,r));return;case S.CLOTHING_CHANGE:a.dispatchEvent(new V(V.REQUEST_CLOTHING_CHANGE,e,s,r));return;case S.JUKEBOX_PLAYLIST_EDITOR:a.dispatchEvent(new V(V.REQUEST_PLAYLIST_EDITOR,e,s,r));return;case S.MANNEQUIN:a.dispatchEvent(new V(V.REQUEST_MANNEQUIN,e,s,r));return;case S.PET_PRODUCT_MENU:a.dispatchEvent(new Oo(Oo.USE_PRODUCT_FROM_ROOM,e,s,r));return;case S.GUILD_FURNI_CONTEXT_MENU:this._roomEngine.connection.send(new AI(t.objectId,t.object.model.getValue(g.FURNITURE_GUILD_CUSTOMIZED_GUILD_ID)));return;case S.MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG:a.dispatchEvent(new V(V.REQUEST_MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG,e,s,r));return;case S.PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG:a.dispatchEvent(new V(V.REQUEST_PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG,e,s,r));return;case S.BACKGROUND_COLOR:a.dispatchEvent(new V(V.REQUEST_BACKGROUND_COLOR,e,s,r));return;case S.MYSTERYBOX_OPEN_DIALOG:a.dispatchEvent(new V(V.REQUEST_MYSTERYBOX_OPEN_DIALOG,e,s,r));return;case S.EFFECTBOX_OPEN_DIALOG:a.dispatchEvent(new V(V.REQUEST_EFFECTBOX_OPEN_DIALOG,e,s,r));return;case S.MYSTERYTROPHY_OPEN_DIALOG:a.dispatchEvent(new V(V.REQUEST_MYSTERYTROPHY_OPEN_DIALOG,e,s,r));return;case S.ACHIEVEMENT_RESOLUTION_OPEN:this._roomEngine.connection.send(new xf(t.objectId,0));return;case S.ACHIEVEMENT_RESOLUTION_ENGRAVING:a.dispatchEvent(new V(V.REQUEST_ACHIEVEMENT_RESOLUTION_ENGRAVING,e,s,r));return;case S.ACHIEVEMENT_RESOLUTION_FAILED:a.dispatchEvent(new V(V.REQUEST_ACHIEVEMENT_RESOLUTION_FAILED,e,s,r));return;case S.FRIEND_FURNITURE_CONFIRM:a.dispatchEvent(new V(V.REQUEST_FRIEND_FURNITURE_CONFIRM,e,s,r));return;case S.FRIEND_FURNITURE_ENGRAVING:a.dispatchEvent(new V(V.REQUEST_FRIEND_FURNITURE_ENGRAVING,e,s,r));return;case S.BADGE_DISPLAY_ENGRAVING:a.dispatchEvent(new V(V.REQUEST_BADGE_DISPLAY_ENGRAVING,e,s,r));return;case S.HIGH_SCORE_DISPLAY:a.dispatchEvent(new V(V.REQUEST_HIGH_SCORE_DISPLAY,e,s,r));return;case S.HIDE_HIGH_SCORE_DISPLAY:a.dispatchEvent(new V(V.REQUEST_HIDE_HIGH_SCORE_DISPLAY,e,s,r));return;case S.INERNAL_LINK:a.dispatchEvent(new V(V.REQUEST_INTERNAL_LINK,e,s,r));return;case S.ROOM_LINK:a.dispatchEvent(new V(V.REQUEST_ROOM_LINK,e,s,r));return;case S.YOUTUBE:a.dispatchEvent(new V(V.REQUEST_YOUTUBE,e,s,r));return}}onRoomObjectFurnitureActionEvent(t,e){t&&this.useObject(e,t.object.id,t.object.type,t.type)}handleObjectSoundMachineEvent(t,e){if(!t)return;const s=this._roomEngine.getRoomObjectCategoryForType(t.objectType),i=this.getSelectedRoomObjectData(e);if(!(i&&i.category===s&&i.id===t.objectId&&i.operation===lt.OBJECT_PLACE))switch(t.type){case y.SOUND_MACHINE_INIT:this._roomEngine.events.dispatchEvent(new yt(yt.SOUND_MACHINE_INIT,e,t.objectId,s));return;case y.SOUND_MACHINE_START:this._roomEngine.events.dispatchEvent(new yt(yt.SOUND_MACHINE_SWITCHED_ON,e,t.objectId,s));return;case y.SOUND_MACHINE_STOP:this._roomEngine.events.dispatchEvent(new yt(yt.SOUND_MACHINE_SWITCHED_OFF,e,t.objectId,s));return;case y.SOUND_MACHINE_DISPOSE:this._roomEngine.events.dispatchEvent(new yt(yt.SOUND_MACHINE_DISPOSE,e,t.objectId,s));return}}handleObjectJukeboxEvent(t,e){if(!t)return;const s=this._roomEngine.getRoomObjectCategoryForType(t.objectType),i=this.getSelectedRoomObjectData(e);if(!(i&&i.category===s&&i.id===t.objectId&&i.operation===lt.OBJECT_PLACE))switch(t.type){case y.JUKEBOX_INIT:this._roomEngine.events.dispatchEvent(new yt(yt.JUKEBOX_INIT,e,t.objectId,s));return;case y.JUKEBOX_START:this._roomEngine.events.dispatchEvent(new yt(yt.JUKEBOX_SWITCHED_ON,e,t.objectId,s));return;case y.JUKEBOX_MACHINE_STOP:this._roomEngine.events.dispatchEvent(new yt(yt.JUKEBOX_SWITCHED_OFF,e,t.objectId,s));return;case y.JUKEBOX_DISPOSE:this._roomEngine.events.dispatchEvent(new yt(yt.JUKEBOX_DISPOSE,e,t.objectId,s));return}}onRoomObjectFloorHoleEvent(t,e){if(t)switch(t.type){case ue.ADD_HOLE:this._roomEngine.addRoomInstanceFloorHole(e,t.objectId);return;case ue.REMOVE_HOLE:this._roomEngine.removeRoomInstanceFloorHole(e,t.objectId);return}}onRoomObjectRoomAdEvent(t,e){if(!t)return;let s=null;switch(t.type){case Pt.ROOM_AD_FURNI_CLICK:this._roomEngine.events.dispatchEvent(t),t.clickUrl&&t.clickUrl.length>0&&W.instance.createLinkEvent(t.clickUrl),s=Zr.FURNI_CLICK;break;case Pt.ROOM_AD_FURNI_DOUBLE_CLICK:if(t.clickUrl&&t.clickUrl.length>0){const i="CATALOG_PAGE";t.clickUrl.indexOf(i)===0&&W.instance.createLinkEvent(t.clickUrl.substr(i.length))}s=Zr.FURNI_DOUBLE_CLICK;break;case Pt.ROOM_AD_TOOLTIP_SHOW:s=Zr.TOOLTIP_SHOW;break;case Pt.ROOM_AD_TOOLTIP_HIDE:s=Zr.TOOLTIP_HIDE;break}s&&this._roomEngine.events.dispatchEvent(new Z(s,e,t.objectId,this._roomEngine.getRoomObjectCategoryForType(t.objectType)))}onRoomObjectBadgeAssetEvent(t,e){if(!(!t||!this._roomEngine))switch(t.type){case As.LOAD_BADGE:{const s=t.objectId,i=t.objectType,r=this._roomEngine.getRoomObjectCategoryForType(i);this._roomEngine.loadRoomObjectBadgeImage(e,s,r,t.badgeId,t.groupBadge);return}}}handleMousePointer(t,e){t&&this._roomEngine.updateMousePointer(t.type,t.objectId,t.objectType)}handleRoomObjectPlaySoundEvent(t,e){const s=this._roomEngine.getRoomObjectCategoryForType(t.objectType);switch(t.type){case mi.PLAY_SOUND:this._roomEngine.events.dispatchEvent(new Jr(Jr.PLAY_SOUND,e,t.objectId,s,t.soundId,t.pitch));return;case mi.PLAY_SOUND_AT_PITCH:this._roomEngine.events.dispatchEvent(new Jr(Jr.PLAY_SOUND_AT_PITCH,e,t.objectId,s,t.soundId,t.pitch));return}}handleRoomObjectSamplePlaybackEvent(t,e){if(!t)return;const s=this._roomEngine.getRoomObjectCategoryForType(t.objectType);switch(t.type){case Ht.ROOM_OBJECT_INITIALIZED:this._roomEngine.events.dispatchEvent(new qe(qe.ROOM_OBJECT_INITIALIZED,e,t.objectId,s,t.sampleId,t.pitch));break;case Ht.ROOM_OBJECT_DISPOSED:this._roomEngine.events.dispatchEvent(new qe(qe.ROOM_OBJECT_DISPOSED,e,t.objectId,s,t.sampleId,t.pitch));break;case Ht.PLAY_SAMPLE:this._roomEngine.events.dispatchEvent(new qe(qe.PLAY_SAMPLE,e,t.objectId,s,t.sampleId,t.pitch));break;case Ht.CHANGE_PITCH:this._roomEngine.events.dispatchEvent(new qe(qe.CHANGE_PITCH,e,t.objectId,s,t.sampleId,t.pitch));break}}onHSLColorEnableEvent(t,e){if(!(!t||!this._roomEngine))switch(t.type){case Ei.ROOM_BACKGROUND_COLOR:this._roomEngine.events.dispatchEvent(new Ao(Ao.ROOM_BACKGROUND_COLOR,e,t.enable,t.hue,t.saturation,t.lightness));return}}onRoomObjectDataRequestEvent(t,e){if(!(!t||!this._roomEngine||!t.object))switch(t.type){case ls.RODRE_CURRENT_USER_ID:t.object.model.setValue(g.SESSION_CURRENT_USER_ID,this._roomEngine.sessionDataManager.userId);return;case ls.RODRE_URL_PREFIX:t.object.model.setValue(g.SESSION_URL_PREFIX,q.getValue("url.prefix"));return}}onRoomObjectTileMouseEvent(t,e){if(!this._roomEngine||this._roomEngine.isDecorating||!this._roomEngine.roomSessionManager)return;const s=this._roomEngine.roomSessionManager.getSession(t);!s||s.isSpectator||this.sendWalkUpdate(e.tileXAsInt,e.tileYAsInt)}handleObjectMove(t,e){if(!t||!this._roomEngine||!this._roomEngine.events)return;const i=this.getSelectedRoomObjectData(e);if(!i)return;const r=this._roomEngine.getRoomObject(e,i.id,i.category);if(!r)return;let a=!0;if(i.category===M.FLOOR||i.category===M.UNIT){const o=this._roomEngine.getFurnitureStackingHeightMap(e);t instanceof $s&&this.handleFurnitureMove(r,i,Math.trunc(t.tileX+.5),Math.trunc(t.tileY+.5),o)||(this.handleFurnitureMove(r,i,i.loc.x,i.loc.y,o),a=!1)}else if(i.category===M.WALL){if(a=!1,t instanceof Xr){const o=t.wallLocation,h=t.wallWidth,_=t.wallHeight,l=t.x,c=t.y,f=t.direction;this.handleWallItemMove(r,i,o,h,_,l,c,f)&&(a=!0)}a||(r.setLocation(i.loc),r.setDirection(i.dir)),this._roomEngine.updateRoomObjectMask(e,i.id,a)}a?(this.setFurnitureAlphaMultiplier(r,.5),this._roomEngine.setObjectMoverIconSpriteVisible(!1)):(this.setFurnitureAlphaMultiplier(r,0),this._roomEngine.setObjectMoverIconSpriteVisible(!0))}handleObjectPlace(t,e){if(!t||!this._roomEngine||!this._roomEngine.events)return;let i=this.getSelectedRoomObjectData(e);if(!i)return;let r=this._roomEngine.getRoomObject(e,i.id,i.category);if(!r){if(t instanceof $s){if(i.category===M.FLOOR)this._roomEngine.addFurnitureFloor(e,i.id,i.typeId,i.loc,i.dir,0,i.stuffData,parseFloat(i.instanceData),-1,0,0,"",!1);else if(i.category===M.UNIT){this._roomEngine.addRoomObjectUser(e,i.id,new R,new R(180),180,i.typeId,i.instanceData);const a=this._roomEngine.getRoomObject(e,i.id,i.category);a&&i.posture&&a.model.setValue(g.FIGURE_POSTURE,i.posture)}}else t instanceof Xr&&i.category===M.WALL&&this._roomEngine.addFurnitureWall(e,i.id,i.typeId,i.loc,i.dir,0,i.instanceData,0);if(r=this._roomEngine.getRoomObject(e,i.id,i.category),r&&i.category===M.FLOOR){const a=r.model.getValue(g.FURNITURE_ALLOWED_DIRECTIONS);if(a&&a.length){const o=new R(a[0]);if(r.setDirection(o),this.updateSelectedObjectData(e,i.id,i.category,i.loc,o,i.operation,i.typeId,i.instanceData,i.stuffData,i.state,i.animFrame,i.posture),i=this.getSelectedRoomObjectData(e),!i)return}}this.setFurnitureAlphaMultiplier(r,.5),this._roomEngine.setObjectMoverIconSpriteVisible(!0)}if(r){let a=!0;const o=this._roomEngine.getFurnitureStackingHeightMap(e);if(i.category===M.FLOOR)t instanceof $s&&this.handleFurnitureMove(r,i,Math.trunc(t.tileX+.5),Math.trunc(t.tileY+.5),o)||(this._roomEngine.removeRoomObjectFloor(e,i.id),a=!1);else if(i.category===M.WALL){if(a=!1,t instanceof Xr){const h=t.wallLocation,_=t.wallWidth,l=t.wallHeight,c=t.x,f=t.y,p=t.direction;this.handleWallItemMove(r,i,h,_,l,c,f,p)&&(a=!0)}a||this._roomEngine.removeRoomObjectWall(e,i.id),this._roomEngine.updateRoomObjectMask(e,i.id,a)}else i.category===M.UNIT&&(t instanceof $s&&this.handleUserPlace(r,Math.trunc(t.tileX+.5),Math.trunc(t.tileY+.5),this._roomEngine.getLegacyWallGeometry(e))||(this._roomEngine.removeRoomObjectUser(e,i.id),a=!1));this._roomEngine.setObjectMoverIconSpriteVisible(!a)}}handleFurnitureMove(t,e,s,i,r){if(!t||!e)return!1;const a=new R;a.assign(t.getDirection()),t.setDirection(e.dir);const o=new R(s,i,0),h=new R;h.assign(t.getDirection());let _=this.validateFurnitureLocation(t,o,e.loc,e.dir,r);return _||(h.x=this.getValidRoomObjectDirection(t,!0),t.setDirection(h),_=this.validateFurnitureLocation(t,o,e.loc,e.dir,r)),_?(t.setLocation(_),h&&t.setDirection(h),!0):(t.setDirection(a),!1)}handleWallItemMove(t,e,s,i,r,a,o,h){if(!t||!e)return!1;const _=new R(h),l=this.validateWallItemLocation(t,s,i,r,a,o,e);return l?(t.setLocation(l),t.setDirection(_),!0):!1}validateFurnitureLocation(t,e,s,i,r){if(!t||!t.model||!e)return null;let a=null;const o=t.getDirection();if(!o||!s||!i)return null;if(e.x===s.x&&e.y===s.y&&o.x===i.x)return a=new R,a.assign(s),a;let h=t.model.getValue(g.FURNITURE_SIZE_X),_=t.model.getValue(g.FURNITURE_SIZE_Y);h<1&&(h=1),_<1&&(_=1);const l=s.x,c=s.y;let f=h,p=_,m=0,O=Math.trunc(Math.trunc(o.x+45)%360/90);if((O===1||O===3)&&(m=h,h=_,_=m),O=Math.trunc(Math.trunc(i.x+45)%360/90),(O===1||O===3)&&(m=f,f=p,p=m),r&&e){const A=t.model.getValue(g.FURNITURE_ALWAYS_STACKABLE)===1;return r.validateLocation(e.x,e.y,h,_,l,c,f,p,A)?new R(e.x,e.y,r.getTileHeight(e.x,e.y)):null}return null}validateWallItemLocation(t,e,s,i,r,a,o){if(t==null||t.model==null||e==null||s==null||i==null||o==null)return null;const h=t.model.getValue(g.FURNITURE_SIZE_X),_=t.model.getValue(g.FURNITURE_SIZE_Z),l=t.model.getValue(g.FURNITURE_CENTER_Z);if((r<h/2||r>s.length-h/2||a<l||a>i.length-(_-l))&&(r<h/2&&r<=s.length-h/2?r=h/2:r>=h/2&&r>s.length-h/2&&(r=s.length-h/2),a<l&&a<=i.length-(_-l)?a=l:a>=l&&a>i.length-(_-l)&&(a=i.length-(_-l))),r<h/2||r>s.length-h/2||a<l||a>i.length-(_-l))return null;let c=R.sum(R.product(s,r/s.length),R.product(i,a/i.length));return c=R.sum(e,c),c}changeObjectState(t,e,s,i,r){const a=this._roomEngine.getRoomObjectCategoryForType(s);this.changeRoomObjectState(t,e,a,i,r)}useObject(t,e,s,i){if(!(!this._roomEngine||!this._roomEngine.connection))switch(i){case y.DICE_ACTIVATE:this._roomEngine.connection.send(new DI(e));return;case y.DICE_OFF:this._roomEngine.connection.send(new LI(e));return;case y.USE_HABBOWHEEL:this._roomEngine.connection.send(new NI(e));return;case y.STICKIE:this._roomEngine.connection.send(new cI(e));return;case y.ENTER_ONEWAYDOOR:this._roomEngine.connection.send(new PI(e));return}}changeRoomObjectState(t,e,s,i,r){return!this._roomEngine||!this._roomEngine.connection||(s===M.FLOOR?r?this._roomEngine.connection.send(new UI(e,i)):this._roomEngine.connection.send(new Kd(e,i)):s===M.WALL&&this._roomEngine.connection.send(new yI(e,i))),!0}sendWalkUpdate(t,e){!this._roomEngine||!this._roomEngine.connection||this._roomEngine.connection.send(new KI(t,e))}handleMouseOverObject(t,e,s){if(t!==M.FLOOR)return null;const i=this._roomEngine.getRoomObject(e,s.objectId,M.FLOOR);if(!i)return null;const r=this.getActiveSurfaceLocation(i,s);if(!r||!this._roomEngine.getFurnitureStackingHeightMap(e))return null;const o=r.x,h=r.y,_=r.z;return new qr(new R(o,h,i.getLocation().z),_,!0,s.eventId)}handleMoveTargetFurni(t,e){if(e.objectType===pt.USER||e.objectType===pt.PET||e.objectType===pt.BOT||e.objectType===pt.RENTABLE_BOT||e.objectType===pt.MONSTER_PLANT)return;const s=this._roomEngine.getRoomObject(t,e.objectId,M.FLOOR),i=this.getActiveSurfaceLocation(s,e);return i?(this.sendWalkUpdate(i.x,i.y),!0):!1}getActiveSurfaceLocation(t,e){if(!t||!e)return null;const s=this._roomEngine.sessionDataManager.getFloorItemDataByName(t.type);if(!s||!s.canStandOn&&!s.canSitOn&&!s.canLayOn)return null;const i=t.model;if(!i)return null;const r=t.getLocation(),a=t.getDirection();let o=i.getValue(g.FURNITURE_SIZE_X),h=i.getValue(g.FURNITURE_SIZE_Y);const _=i.getValue(g.FURNITURE_SIZE_Z);(a.x===90||a.x===270)&&([o,h]=[h,o]),o<1&&(o=1),h<1&&(h=1);const l=this._roomEngine.getActiveRoomInstanceRenderingCanvas();if(!l)return null;const c=l.geometry.scale,f=s.canSitOn?.5:0,p=(c/2+e.spriteOffsetX+e.localX)/(c/4),m=(e.spriteOffsetY+e.localY+(_-f)*c/2)/(c/4),O=(p+2*m)/4,A=(p-2*m)/4,C=Math.floor(r.x+O),L=Math.floor(r.y-A+1);let D=!1;(C<r.x||C>=r.x+o||L<r.y||L>=r.y+h)&&(D=!0);const U=s.canSitOn?_-.5:_;return D?null:new R(C,L,U)}handleMouseOverTile(t,e){if(this._whereYouClickIsWhereYouGo)return new qr(new R(t.tileXAsInt,t.tileYAsInt,t.tileZAsInt),0,!0,t.eventId);const s=this._roomEngine.getRoomObjectCursor(e);if(s&&s.visualization){const i=t.tileXAsInt,r=t.tileYAsInt,a=t.tileZAsInt;if(this._roomEngine.getRoomInstance(e)){const h=this._roomEngine.getRoomTileObjectMap(e);if(h){const _=h.getObjectIntTile(i,r),l=this._roomEngine.getFurnitureStackingHeightMap(e);if(l){if(_&&_.model&&_.model.getValue(g.FURNITURE_IS_VARIABLE_HEIGHT)>0){const c=l.getTileHeight(i,r),f=this._roomEngine.getLegacyWallGeometry(e).getHeight(i,r);return new qr(new R(i,r,a),c-f,!0,t.eventId)}return new qr(new R(i,r,a),0,!0,t.eventId)}}}}return null}placeObject(t,e,s){const i=this.getSelectedRoomObjectData(t);if(!i)return;let r=null,a=i.id;const o=i.category;let h=0,_=0,l=0,c=0,f="";if(this._roomEngine&&this._roomEngine.connection&&(r=this._roomEngine.getRoomObject(t,a,o),r)){const p=r.getLocation();if(c=r.getDirection().x,o===M.FLOOR||o===M.UNIT)h=p.x,_=p.y,l=p.z;else if(o===M.WALL){h=p.x,_=p.y,l=p.z;const m=this._roomEngine.getLegacyWallGeometry(t);m&&(f=m.getOldLocationString(p,c))}c=(c/45%8+8)%8,a<0&&o===M.UNIT&&(a=a*-1),this._objectPlacementSource!==Ml.CATALOG&&(o===M.UNIT?i.typeId===fi.PET?this._roomEngine.connection.send(new dI(a,Math.trunc(h),Math.trunc(_))):i.typeId===fi.RENTABLE_BOT&&this._roomEngine.connection.send(new oI(a,Math.trunc(h),Math.trunc(_))):r.model.getValue(g.FURNITURE_IS_STICKIE)!==void 0?this._roomEngine.connection.send(new MI(a,f)):this._roomEngine.connection.send(new CI(a,o,f,Math.trunc(h),Math.trunc(_),c)))}if(this._roomEngine.setPlacedRoomObjectData(t,new fl(i.id,i.category,null,i.dir,null)),this.resetSelectedObjectData(t),this._roomEngine&&this._roomEngine.events){const p=r&&r.id===i.id;this._roomEngine.events.dispatchEvent(new Im(Z.PLACED,t,a,o,f,h,_,l,c,p,e,s,i.instanceData))}}modifyRoomObject(t,e,s,i){if(!this._roomEngine)return!1;const r=this._roomEngine.getRoomObject(t,e,s);if(!r)return!1;let a=!0;switch(i){case lt.OBJECT_ROTATE_POSITIVE:case lt.OBJECT_ROTATE_NEGATIVE:if(this._roomEngine.connection){let o=0;i==lt.OBJECT_ROTATE_NEGATIVE?o=this.getValidRoomObjectDirection(r,!1):o=this.getValidRoomObjectDirection(r,!0);const h=r.getLocation().x,_=r.getLocation().y;if(this.isValidLocation(r,new R(o),this._roomEngine.getFurnitureStackingHeightMap(t)))if(o=Math.trunc(o/45),r.type===pt.MONSTER_PLANT){const l=this._roomEngine.roomSessionManager.getSession(t);if(l){const c=l.userDataManager.getUserDataByIndex(e);c&&this._roomEngine.connection.send(new bu(c.webID,Math.trunc(h),Math.trunc(_),o))}}else this._roomEngine.connection.send(new Fu(e,h,_,o))}break;case lt.OBJECT_EJECT:case lt.OBJECT_PICKUP:this._roomEngine.connection&&this._roomEngine.connection.send(new SI(s,e));break;case lt.OBJECT_PICKUP_PET:if(this._roomEngine.connection){const o=this._roomEngine.roomSessionManager.getSession(t);if(o){const h=o.userDataManager.getUserDataByIndex(e);o.pickupPet(h.webID)}}break;case lt.OBJECT_PICKUP_BOT:if(this._roomEngine.connection){const o=this._roomEngine.roomSessionManager.getSession(t);if(o){const h=o.userDataManager.getUserDataByIndex(e);o.pickupBot(h.webID)}}break;case lt.OBJECT_MOVE:a=!1,this.setFurnitureAlphaMultiplier(r,.5),this.setSelectedRoomObjectData(t,r.id,s,r.getLocation(),r.getDirection(),i),this._roomEngine.setObjectMoverIconSprite(r.id,s,!0),this._roomEngine.setObjectMoverIconSpriteVisible(!1);break;case lt.OBJECT_MOVE_TO:{const o=this.getSelectedRoomObjectData(t);if(this.updateSelectedObjectData(t,o.id,o.category,o.loc,o.dir,lt.OBJECT_MOVE_TO,o.typeId,o.instanceData,o.stuffData,o.state,o.animFrame,o.posture),this.setFurnitureAlphaMultiplier(r,1),this._roomEngine.removeObjectMoverIconSprite(),this._roomEngine.connection){if(s===M.FLOOR){const h=r.getDirection().x%360,_=r.getLocation(),l=h/45;this._roomEngine.connection.send(new Fu(e,_.x,_.y,l))}else if(s===M.WALL){const h=r.getDirection().x%360,_=this._roomEngine.getLegacyWallGeometry(t);if(_){const l=_.getOldLocationString(r.getLocation(),h);l&&this._roomEngine.connection.send(new FI(e,l))}}else if(s===M.UNIT){const h=r.getDirection().x%360,_=r.getLocation(),l=h/45;parseInt(r.model.getValue(g.RACE));const c=this._roomEngine.roomSessionManager.getSession(t);if(c){const f=c.userDataManager.getUserDataByIndex(e);f&&this._roomEngine.connection.send(new bu(f.webID,_.x,_.y,l))}}}break}}return a&&this.resetSelectedObjectData(t),!0}modifyRoomObjectDataWithMap(t,e,s,i,r){if(!this._roomEngine||!this._roomEngine.getRoomObject(t,e,s))return!1;switch(i){case lt.OBJECT_SAVE_STUFF_DATA:this._roomEngine.connection&&this._roomEngine.connection.send(new TI(e,r));break}return!0}modifyWallItemData(t,e,s,i){return!this._roomEngine||!this._roomEngine.connection?!1:(this._roomEngine.connection.send(new II(e,s,i)),!0)}deleteWallItem(t,e){return!this._roomEngine||!this._roomEngine.connection?!1:(this._roomEngine.connection.send(new gI(e)),!0)}getValidRoomObjectDirection(t,e){if(!t||!t.model)return 0;let s=0,i=0,r=[];t.type===pt.MONSTER_PLANT?r=t.model.getValue(g.PET_ALLOWED_DIRECTIONS):r=t.model.getValue(g.FURNITURE_ALLOWED_DIRECTIONS);let a=t.getDirection().x;if(r&&r.length){if(s=r.indexOf(a),s<0){for(s=0,i=0;i<r.length&&!(a<=r[i]);)s++,i++;s=s%r.length}e?s=(s+1)%r.length:s=(s-1+r.length)%r.length,a=r[s]}return a}isValidLocation(t,e,s){if(!t||!t.model||!e)return!1;const i=t.getDirection(),r=t.getLocation();if(!i||!r)return!1;if(i.x%180===e.x%180)return!0;let a=t.model.getValue(g.FURNITURE_SIZE_X),o=t.model.getValue(g.FURNITURE_SIZE_Y);a<1&&(a=1),o<1&&(o=1);let h=a,_=o,l=Math.trunc(Math.trunc(e.x+45)%360/90);if((l===1||l===3)&&([a,o]=[o,a]),l=Math.trunc(Math.trunc(i.x+45)%360/90),(l===1||l===3)&&([h,_]=[_,h]),s&&r){const c=t.model.getValue(g.FURNITURE_ALWAYS_STACKABLE)===1;if(s.validateLocation(r.x,r.y,a,o,r.x,r.y,h,_,c,r.z))return!0}return!1}placeObjectOnUser(t,e,s){const i=this.getSelectedRoomObjectData(t);!i||!this._roomEngine.getRoomObject(t,e,s)||!this._roomEngine||!this._roomEngine.events||this._roomEngine.events.dispatchEvent(new Tm(Z.PLACED_ON_USER,t,e,s,i.id,i.category))}setSelectedObject(t,e,s){if(!this._roomEngine)return;const i=this._roomEngine.events;if(i)switch(s){case M.UNIT:case M.FLOOR:case M.WALL:if(s===M.UNIT)this.deselectObject(t),this.setSelectedAvatar(t,e,!0);else if(this.setSelectedAvatar(t,0,!1),e!==this._selectedObjectId){this.deselectObject(t);const r=this._roomEngine.getRoomObject(t,e,s);r&&r.logic&&(r.logic.processUpdateMessage(new to(!0)),this._selectedObjectId=e,this._selectedObjectCategory=s)}i.dispatchEvent(new Z(Z.SELECTED,t,e,s));return}}deselectObject(t){if(this._selectedObjectId===-1)return;const e=this._roomEngine.getRoomObject(t,this._selectedObjectId,this._selectedObjectCategory);e&&e.logic&&(e.logic.processUpdateMessage(new to(!1)),this._selectedObjectId=-1,this._selectedObjectCategory=M.MINIMUM)}setSelectedAvatar(t,e,s){if(!this._roomEngine)return;const i=M.UNIT,r=this._roomEngine.getRoomObject(t,this._selectedAvatarId,i);r&&r.logic&&(r.logic.processUpdateMessage(new Zo(!1)),this._selectedAvatarId=-1);let a=!1;if(s){const h=this._roomEngine.getRoomObject(t,e,i);if(h&&h.logic){h.logic.processUpdateMessage(new Zo(!0)),a=!0,this._selectedAvatarId=e;const _=h.getLocation();_&&this._roomEngine.connection.send(new zI(~~_.x,~~_.y))}}const o=this._roomEngine.getRoomObjectSelectionArrow(t);o&&o.logic&&(a&&!this._roomEngine.isPlayingGame()?o.logic.processUpdateMessage(new Ai(Ai.ENABLED)):o.logic.processUpdateMessage(new Ai(Ai.DISABLED)))}resetSelectedObjectData(t){if(!this._roomEngine)return;this._roomEngine.removeObjectMoverIconSprite();const e=this.getSelectedRoomObjectData(t);if(e){if(e.operation===lt.OBJECT_MOVE||e.operation===lt.OBJECT_MOVE_TO){const s=this._roomEngine.getRoomObject(t,e.id,e.category);s&&e.operation!==lt.OBJECT_MOVE_TO&&(s.setLocation(e.loc),s.setDirection(e.dir)),this.setFurnitureAlphaMultiplier(s,1),e.category===M.WALL&&this._roomEngine.updateRoomObjectMask(t,e.id,!0),this.updateSelectedObjectData(t,e.id,e.category,e.loc,e.dir,lt.OBJECT_MOVE,e.typeId,e.instanceData,e.stuffData,e.state,e.animFrame,e.posture)}else if(e.operation===lt.OBJECT_PLACE){const s=e.id;switch(e.category){case M.FLOOR:this._roomEngine.removeRoomObjectFloor(t,s);break;case M.WALL:this._roomEngine.removeRoomObjectWall(t,s);break;case M.UNIT:this._roomEngine.removeRoomObjectUser(t,s);break}}this._roomEngine.setSelectedRoomObjectData(t,null)}}getSelectedRoomObjectData(t){return this._roomEngine?this._roomEngine.getSelectedRoomObjectData(t):null}setFurnitureAlphaMultiplier(t,e){!t||!t.model||t.model.setValue(g.FURNITURE_ALPHA_MULTIPLIER,e)}decorateModeMove(t){return this._roomEngine.isDecorating&&!(t.ctrlKey||t.shiftKey)}cancelRoomObjectPlacement(t){return this.resetSelectedObjectData(t),!0}setSelectedRoomObjectData(t,e,s,i,r,a,o=0,h=null,_=null,l=-1,c=-1,f=null){if(this.resetSelectedObjectData(t),!this._roomEngine)return;const p=new fl(e,s,a,i,r,o,h,_,l,c,f);this._roomEngine.setSelectedRoomObjectData(t,p)}updateSelectedObjectData(t,e,s,i,r,a,o=0,h=null,_=null,l=-1,c=-1,f=null){if(!this._roomEngine)return null;const p=new fl(e,s,a,i,r,o,h,_,l,c,f);this._roomEngine.setSelectedRoomObjectData(t,p)}handleUserPlace(t,e,s,i){return i.isRoomTile(e,s)?(t.setLocation(new R(e,s,i.getHeight(e,s))),!0):!1}get engine(){return this._roomEngine}get selectedAvatarId(){return this._selectedAvatarId}}class Z2{constructor(){this._events=new $e,this._cachedEvents=new Map,this._registeredEvents=new Map,this._functions=[]}getLogic(t){const e=this.getLogicType(t);if(!e)return null;const s=new e;if(!s)return null;if(s.eventDispatcher=this._events,!this._cachedEvents.get(t)){this._cachedEvents.set(t,!0);const i=s.getEventTypes();for(const r of i)r&&this.registerEventType(r)}return s}registerEventType(t){if(!this._registeredEvents.get(t)){this._registeredEvents.set(t,!0);for(const e of this._functions)e&&this._events.addEventListener(t,e)}}registerEventFunction(t){if(t&&!(this._functions.indexOf(t)>=0)){this._functions.push(t);for(const e of this._registeredEvents.keys())e&&this._events.addEventListener(e,t)}}removeEventFunction(t){if(!t)return;const e=this._functions.indexOf(t);if(e!==-1){this._functions.splice(e,1);for(const s of this._registeredEvents.keys())s&&this._events.removeEventListener(s,t)}}getLogicType(t){if(!t)return null;let e=null;switch(t){case Y.ROOM:e=g2;break;case Y.TILE_CURSOR:e=qu;break;case Y.SELECTION_ARROW:e=f2;break;case Y.USER:case Y.BOT:case Y.RENTABLE_BOT:e=Bu;break;case Y.PET:e=c2;break;case Y.FURNITURE_BASIC:e=It;break;case Y.FURNITURE_BADGE_DISPLAY:e=MT;break;case Y.FURNITURE_CHANGE_STATE_WHEN_STEP_ON:e=mV;break;case Y.FURNITURE_COUNTER_CLOCK:e=RV;break;case Y.FURNITURE_CRACKABLE:e=OV;break;case Y.FURNITURE_CREDIT:e=SV;break;case Y.FURNITURE_CUSTOM_STACK_HEIGHT:e=MV;break;case Y.FURNITURE_DICE:e=NV;break;case Y.FURNITURE_EDITABLE_INTERNAL_LINK:e=LV;break;case Y.FURNITURE_EDITABLE_ROOM_LINK:e=PV;break;case Y.FURNITURE_EXTERNAL_IMAGE_WALLITEM:e=yV;break;case Y.FURNITURE_FIREWORKS:e=vV;break;case Y.FURNITURE_FLOOR_HOLE:e=Vu;break;case Y.FURNITURE_GUILD_CUSTOMIZED:e=sh;break;case Y.FURNITURE_HIGH_SCORE:e=Yu;break;case Y.FURNITURE_HOCKEY_SCORE:e=xV;break;case Y.FURNITURE_ES:e=BV;break;case Y.FURNITURE_MANNEQUIN:e=Hu;break;case Y.FURNITURE_MULTIHEIGHT:e=jV;break;case Y.FURNITURE_MULTISTATE:e=Vt;break;case Y.FURNITURE_ONE_WAY_DOOR:e=kV;break;case Y.FURNITURE_PET_CUSTOMIZATION:e=KV;break;case Y.FURNITURE_PRESENT:e=ju;break;case Y.FURNITURE_PURCHASABLE_CLOTHING:e=QV;break;case Y.FURNITURE_PUSHABLE:e=zu;break;case Y.FURNITURE_BACKGROUND_COLOR:e=t2;break;case Y.FURNITURE_BG:e=e2;break;case Y.FURNITURE_BB:e=s2;break;case Y.FURNITURE_ROOMDIMMER:e=i2;break;case Y.FURNITURE_SCORE:e=Wu;break;case Y.FURNITURE_SOUNDBLOCK:e=ku;break;case Y.FURNITURE_STICKIE:e=Ku;break;case Y.FURNITURE_TROPHY:e=a2;break;case Y.FURNITURE_VOTE_COUNTER:e=Xu;break;case Y.FURNITURE_VOTE_MAJORITY:e=o2;break;case Y.FURNITURE_WINDOW:e=_2;break;case Y.FURNITURE_LOVELOCK:e=YV;break;case Y.FURNITURE_YOUTUBE:e=l2;break;case Y.FURNITURE_CRAFTING_GIZMO:e=AV;break;case Y.FURNITURE_RENTABLE_SPACE:e=$V;break;case Y.FURNITURE_EFFECTBOX:e=UV;break;case Y.FURNITURE_MONSTERPLANT_SEED:e=HV;break;case Y.FURNITURE_MYSTERYBOX:e=zV;break;case Y.FURNITURE_MYSTERYTROPHY:e=WV;break;case Y.FURNITURE_RANDOM_TELEPORT:e=ZV;break;case Y.FURNITURE_CLOTHING_CHANGE:e=pV;break;case Y.FURNITURE_CUCKOO_CLOCK:e=CV;break;case Y.FURNITURE_ECOTRON_BOX:e=DV;break;case Y.FURNITURE_GROUP_FORUM_TERMINAL:e=bV;break;case Y.FURNITURE_HWEEN_LOVELOCK:e=GV;break;case Y.FURNITURE_INTERNAL_LINK:e=wV;break;case Y.FURNITURE_JUKEBOX:e=VV;break;case Y.FURNITURE_PLACEHOLDER:e=XV;break;case Y.FURNITURE_PLANET_SYSTEM:e=qV;break;case Y.FURNITURE_RANDOMSTATE:e=JV;break;case Y.FURNITURE_SONG_DISK:e=r2;break;case Y.FURNITURE_SOUND_MACHINE:e=n2;break;case Y.FURNITURE_WELCOME_GIFT:e=h2;break;case Y.FURNITURE_ACHIEVEMENT_RESOLUTION:e=wu;break;case Y.FURNITURE_HABBOWHEEL:e=FV;break;default:e=It;break}return e||(j.warn("Unknown Logic",t),null)}get events(){return this._events}}const ot=class ot extends Js{constructor(t){super(),this._communication=t,this._sessionDataManager=null,this._roomSessionManager=null,this._roomManager=null,this._roomObjectEventHandler=new J2(this),this._roomMessageHandler=new Q2(this),this._roomContentLoader=new Bn,this._ready=!1,this._roomContentLoaderReady=!1,this._activeRoomId=-1,this._activeRoomActiveCanvas=-1,this._roomInstanceDatas=new Map,this._roomDatas=new Map,this._roomRendererFactory=new sp,this._visualizationFactory=new Cd,this._logicFactory=new Z2,this._activeRoomActiveCanvasMouseX=0,this._activeRoomActiveCanvasMouseY=0,this._activeRoomIsDragged=!1,this._activeRoomWasDragged=!1,this._activeRoomDragStartX=0,this._activeRoomDragStartY=0,this._activeRoomDragX=0,this._activeRoomDragY=0,this._skipFurnitureCreationForNextFrame=!1,this._mouseCursorUpdate=!1,this._imageObjectIdBank=null,this._imageCallbacks=new Map,this._thumbnailCallbacks=new Map,this._roomDraggingAlwaysCenters=!1,this._roomAllowsDragging=!0,this._badgeListenerObjects=new Map,this.runVisibilityUpdate=this.runVisibilityUpdate.bind(this),this.processRoomObjectEvent=this.processRoomObjectEvent.bind(this),this.onRoomSessionEvent=this.onRoomSessionEvent.bind(this),this.onRoomContentLoaderReadyEvent=this.onRoomContentLoaderReadyEvent.bind(this),this.onBadgeImageReadyEvent=this.onBadgeImageReadyEvent.bind(this)}onInit(){this._ready||(this._imageObjectIdBank=new JE(1e3),this._thumbnailObjectIdBank=new JE(1e3),this._logicFactory.registerEventFunction(this.processRoomObjectEvent),this._roomManager&&(this._roomManager.setContentLoader(this._roomContentLoader),this._roomManager.addUpdateCategory(M.FLOOR),this._roomManager.addUpdateCategory(M.WALL),this._roomManager.addUpdateCategory(M.UNIT),this._roomManager.addUpdateCategory(M.CURSOR),this._roomManager.addUpdateCategory(M.ROOM)),this._roomMessageHandler.setConnection(this._communication.connection),this._roomContentLoader.initialize(this.events),this._roomContentLoader.setSessionDataManager(this._sessionDataManager),this._roomContentLoader.setIconListener(this),this._roomSessionManager&&(this._roomSessionManager.events.addEventListener(tt.STARTED,this.onRoomSessionEvent),this._roomSessionManager.events.addEventListener(tt.ENDED,this.onRoomSessionEvent)),this.events.addEventListener(Bn.LOADER_READY,this.onRoomContentLoaderReadyEvent),ui().add(this.update,this),document.addEventListener("visibilitychange",this.runVisibilityUpdate))}onDispose(){if(this._ready){for(const[t,e]of this._roomInstanceDatas)this.removeRoomInstance(t);document.removeEventListener("visibilitychange",this.runVisibilityUpdate),ui().remove(this.update,this),this._roomObjectEventHandler&&this._roomObjectEventHandler.dispose(),this._roomMessageHandler&&this._roomMessageHandler.dispose(),this._roomContentLoader&&this._roomContentLoader.dispose(),this.events.removeEventListener(Bn.LOADER_READY,this.onRoomContentLoaderReadyEvent),this._roomSessionManager&&(this._roomSessionManager.events.removeEventListener(tt.STARTED,this.onRoomSessionEvent),this._roomSessionManager.events.removeEventListener(tt.ENDED,this.onRoomSessionEvent)),super.onDispose()}}onRoomSessionEvent(t){if(t instanceof tt)switch(t.type){case tt.STARTED:this._roomMessageHandler&&this._roomMessageHandler.setRoomId(t.session.roomId);return;case tt.ENDED:this._roomMessageHandler&&(this._roomMessageHandler.clearRoomId(),this.removeRoomInstance(t.session.roomId));return}}onRoomContentLoaderReadyEvent(t){this._roomContentLoaderReady=!0,this._roomManager.init()}setActiveRoomId(t){this._activeRoomId=t}destroyRoom(t){this.removeRoomInstance(t)}getRoomInstance(t){return this._roomManager&&this._roomManager.getRoomInstance(this.getRoomId(t))||null}removeRoomInstance(t){this.getRoomInstance(t)&&this._roomManager&&this._roomManager.removeRoomInstance(this.getRoomId(t));const s=this._roomInstanceDatas.get(t);s&&(this._roomInstanceDatas.delete(s.roomId),s.dispose()),this.events.dispatchEvent(new Ct(Ct.DISPOSED,t))}createRoomInstance(t,e){let s="111",i="201",r="1";if(!this._ready){let h=this._roomDatas.get(t);h&&(this._roomDatas.delete(t),s=h.floorType,i=h.wallType,r=h.landscapeType),h=new lg(t,e),h.floorType=s,h.wallType=i,h.landscapeType=r,this._roomDatas.set(t,h),j.warn("Room Engine not initilized yet, can not create room. Room data stored for later initialization.");return}if(!e){j.warn("Room property messages");return}const a=this._roomDatas.get(t);a&&(this._roomDatas.delete(t),a.floorType&&(s=a.floorType),a.wallType&&(i=a.wallType),a.landscapeType&&(r=a.landscapeType)),this.setupRoomInstance(t,e,s,i,r,this.getRoomInstanceModelName(t))&&(e.restrictsDragging?this._roomAllowsDragging=!1:this._roomAllowsDragging=!0,this.events.dispatchEvent(new Ct(Ct.INITIALIZED,t)))}setupRoomInstance(t,e,s,i,r,a){if(!this._ready||!this._roomManager)return;const o=this._roomManager.createRoomInstance(this.getRoomId(t));if(!o)return null;const h=M.ROOM,_=o.createRoomObjectAndInitalize(ot.ROOM_OBJECT_ID,ot.ROOM_OBJECT_TYPE,h);if(o.model.setValue(Yt.ROOM_IS_PUBLIC,0),o.model.setValue(Yt.ROOM_Z_SCALE,1),e&&(o.model.setValue(Yt.RESTRICTS_DRAGGING,e.restrictsDragging),o.model.setValue(Yt.RESTRICTS_SCALING,e.restrictsScaling),o.model.setValue(Yt.RESTRICTED_SCALE,e.restrictedScale),e.dimensions)){const f=e.dimensions.minX,p=e.dimensions.maxX,m=e.dimensions.minY,O=e.dimensions.maxY;o.model.setValue(Yt.ROOM_MIN_X,f),o.model.setValue(Yt.ROOM_MAX_X,p),o.model.setValue(Yt.ROOM_MIN_Y,m),o.model.setValue(Yt.ROOM_MAX_Y,O);const A=Math.trunc(f*423+p*671+m*913+O*7509);_&&_.model&&_.model.setValue(g.ROOM_RANDOM_SEED,A)}const l=_&&_.logic||null;if(l&&(l.initialize(e),s&&(l.processUpdateMessage(new ne(ne.ROOM_FLOOR_UPDATE,s)),o.model.setValue(g.ROOM_FLOOR_TYPE,s)),i&&(l.processUpdateMessage(new ne(ne.ROOM_WALL_UPDATE,i)),o.model.setValue(g.ROOM_WALL_TYPE,i)),r&&(l.processUpdateMessage(new ne(ne.ROOM_LANDSCAPE_UPDATE,r)),o.model.setValue(g.ROOM_LANDSCAPE_TYPE,r))),e&&e.doors.length){let c=0;for(;c<e.doors.length;){const f=e.doors[c];if(f){const p=f.x,m=f.y,O=f.z,A=f.dir,C=de.DOOR,L="door_"+c,D=new R(p,m,O);l.processUpdateMessage(new de(de.ADD_MASK,L,C,D,de.HOLE)),(A===90||A===180)&&(A===90&&(o.model.setValue(g.ROOM_DOOR_X,p-.5),o.model.setValue(g.ROOM_DOOR_Y,m)),A===180&&(o.model.setValue(g.ROOM_DOOR_X,p),o.model.setValue(g.ROOM_DOOR_Y,m-.5)),o.model.setValue(g.ROOM_DOOR_Z,O),o.model.setValue(g.ROOM_DOOR_DIR,A))}c++}}return o.createRoomObjectAndInitalize(ot.CURSOR_OBJECT_ID,ot.CURSOR_OBJECT_TYPE,M.CURSOR),q.getValue("enable.avatar.arrow",!1)&&o.createRoomObjectAndInitalize(ot.ARROW_OBJECT_ID,ot.ARROW_OBJECT_TYPE,M.CURSOR),o}getRoomInstanceDisplay(t,e,s,i,r){const a=this.getRoomInstance(t);if(!a)return null;let o=a.renderer;if(!o&&(o=this._roomRendererFactory.createRenderer(),!o))return null;o.roomObjectVariableAccurateZ=g.OBJECT_ACCURATE_Z_VALUE,a.setRenderer(o);const h=o.createCanvas(e,s,i,r);if(!h)return null;if(a.model.getValue(Yt.RESTRICTS_SCALING)){let l=a.model.getValue(Yt.RESTRICTED_SCALE);l||(l=1),h.setScale(l),h.restrictsScaling=!0}else h.restrictsScaling=!1;if(h.setMouseListener(this._roomObjectEventHandler),h.geometry){h.geometry.z_scale=a.model.getValue(Yt.ROOM_Z_SCALE);const l=a.model.getValue(g.ROOM_DOOR_X),c=a.model.getValue(g.ROOM_DOOR_Y),f=a.model.getValue(g.ROOM_DOOR_Z),p=a.model.getValue(g.ROOM_DOOR_DIR),m=new R(l,c,f);let O=null;p===90&&(O=new R(-2e3,0,0)),p===180&&(O=new R(0,-2e3,0)),h.geometry.setDisplacement(m,O);const A=h.master;if(A){const C=new xt(Ft.EMPTY);C.name=ot.OVERLAY,C.interactive=!1,A.addChild(C)}}return h.master}setRoomInstanceRenderingCanvasMask(t,e,s){const i=this.getRoomInstanceRenderingCanvas(t,e);i&&i.setMask(s)}setRoomInstanceRenderingCanvasScale(t,e,s,i=null,r=null,a=!1,o=!1){const h=this.getRoomInstanceRenderingCanvas(t,e);if(h){if(h.restrictsScaling&&!a)return;h.setScale(s,i,r,a,o),this.events.dispatchEvent(new Ct(Ct.ROOM_ZOOMED,t))}}getRoomInstanceRenderingCanvas(t,e=-1){const s=this.getRoomInstance(t);if(!s)return null;const i=s.renderer;if(!i)return null;e===-1&&(e=this._activeRoomActiveCanvas);const r=i.getCanvas(e);return r||null}getActiveRoomInstanceRenderingCanvas(){return this.getRoomInstanceRenderingCanvas(this._activeRoomId,this._activeRoomActiveCanvas)}getRoomInstanceRenderingCanvasOffset(t,e=-1){e===-1&&(e=this._activeRoomActiveCanvas);const s=this.getRoomInstanceRenderingCanvas(t,e);return s?new K(s.screenOffsetX,s.screenOffsetY):null}setRoomInstanceRenderingCanvasOffset(t,e,s){const i=this.getRoomInstanceRenderingCanvas(t,e);if(!i||!s)return!1;const r=~~s.x,a=~~s.y;if(!(i.screenOffsetX===r&&i.screenOffsetY===a))return this.events.dispatchEvent(new vl(t,-(i.screenOffsetX-r),-(i.screenOffsetY-a))),i.screenOffsetX=r,i.screenOffsetY=a,!0}getRoomInstanceRenderingCanvasScale(t=-1e3,e=-1){t===-1e3&&(t=this._activeRoomId),e===-1&&(e=this._activeRoomActiveCanvas);const s=this.getRoomInstanceRenderingCanvas(t,e);return s?s.scale:1}initializeRoomInstanceRenderingCanvas(t,e,s,i){const r=this.getRoomInstanceRenderingCanvas(t,e);r&&r.initialize(s,i)}getRoomInstanceGeometry(t,e=-1){const s=this.getRoomInstance(t);if(!s)return null;const i=s.renderer;if(!i)return null;e===-1&&(e=this._activeRoomActiveCanvas);const r=i.getCanvas(e);return r?r.geometry:null}getRoomInstanceVariable(t,e){const s=this.getRoomInstance(t);return s&&s.model&&s.model.getValue(e)||null}updateRoomInstancePlaneVisibility(t,e,s=!0){const i=this.getRoomOwnObject(t);return i?(i.processUpdateMessage(new Oi(Oi.WALL_VISIBILITY,e)),i.processUpdateMessage(new Oi(Oi.FLOOR_VISIBILITY,s)),!0):!1}updateRoomInstancePlaneThickness(t,e,s){const i=this.getRoomOwnObject(t);return i?(i.processUpdateMessage(new Ri(Ri.WALL_THICKNESS,e)),i.processUpdateMessage(new Ri(Ri.FLOOR_THICKNESS,s)),!0):!1}updateRoomInstancePlaneType(t,e=null,s=null,i=null,r=!1){const a=this.getRoomOwnObject(t),o=this.getRoomInstance(t);if(!a){let h=this._roomDatas.get(t);return h||(h=new lg(t,null),this._roomDatas.set(t,h)),e&&(h.floorType=e),s&&(h.wallType=s),i&&(h.landscapeType=i),!0}return e&&(o&&!r&&o.model.setValue(g.ROOM_FLOOR_TYPE,e),a.processUpdateMessage(new ne(ne.ROOM_FLOOR_UPDATE,e))),s&&(o&&!r&&o.model.setValue(g.ROOM_WALL_TYPE,s),a.processUpdateMessage(new ne(ne.ROOM_WALL_UPDATE,s))),i&&(o&&!r&&o.model.setValue(g.ROOM_LANDSCAPE_TYPE,i),a.processUpdateMessage(new ne(ne.ROOM_LANDSCAPE_UPDATE,i))),!0}updateObjectRoomColor(t,e,s,i){const r=this.getRoomOwnObject(t);if(!r||!r.logic)return!1;const a=new $a($a.BACKGROUND_COLOR,e,s,i);return r.logic.processUpdateMessage(a),this.events.dispatchEvent(new yl(t,e,s,i)),!0}addRoomInstanceFloorHole(t,e){if(e<0)return;const s=this.getRoomOwnObject(t),i=this.getRoomObjectFloor(t,e);if(s&&s.logic&&i&&i.model){const r=i.getLocation(),a=i.model.getValue(g.FURNITURE_SIZE_X),o=i.model.getValue(g.FURNITURE_SIZE_Y);s.processUpdateMessage(new pi(pi.ADD,e,r.x,r.y,a,o))}}removeRoomInstanceFloorHole(t,e){if(e<0)return;const s=this.getRoomOwnObject(t);s&&s.processUpdateMessage(new pi(pi.REMOVE,e))}setRoomEngineGameMode(t,e){const s=this.getRoomInstance(t);if(!s)return;const i=e?1:0;s.model.setValue(Yt.IS_PLAYING_GAME,i),i===0?this.events.dispatchEvent(new Ct(Ct.NORMAL_MODE,t)):this.events.dispatchEvent(new Ct(Ct.GAME_MODE,t))}isRoomIdPlayingGame(t){const e=this.getRoomInstance(t);return e?e.model.getValue(Yt.IS_PLAYING_GAME)>0:!1}isPlayingGame(){return this.isRoomIdPlayingGame(this._activeRoomId)}disableUpdate(t){t?ui().remove(this.update,this):(ui().remove(this.update,this),ui().add(this.update,this))}runUpdate(){this.update(1)}runVisibilityUpdate(){document.hidden||this.update(1,!0)}update(t,e=!1){this._roomManager&&(t=nt(),ks.turnVisualizationOn(),this.processPendingFurniture(),this._roomManager.update(t,e),this.updateRoomCameras(t),this._mouseCursorUpdate&&this.setPointer(),ks.turnVisualizationOff())}setPointer(){this._mouseCursorUpdate=!1;const t=this.getRoomInstanceData(this._activeRoomId);t&&t.hasButtonMouseCursorOwners()?document.body.style.cursor="pointer":document.body.style.cursor="auto"}processPendingFurniture(){if(this._skipFurnitureCreationForNextFrame){this._skipFurnitureCreationForNextFrame=!1;return}const t=new Date().valueOf(),e=5;for(const s of this._roomInstanceDatas.values()){if(!s)continue;let i=null,r=0,a=!1;for(;i=s.getNextPendingFurnitureFloor();)if(a=this.processPendingFurnitureFloor(s.roomId,i.id,i),!(++r%e)&&new Date().valueOf()-t>=40){this._skipFurnitureCreationForNextFrame=!0;break}for(;!this._skipFurnitureCreationForNextFrame&&(i=s.getNextPendingFurnitureWall());)if(a=this.processPendingFurnitureWall(s.roomId,i.id,i),!(++r%e)&&new Date().valueOf()-t>=40){this._skipFurnitureCreationForNextFrame=!0;break}if(a&&this._roomManager&&(this._roomManager.getRoomInstance(this.getRoomId(s.roomId)).hasUninitializedObjects()||this.objectsInitialized(s.roomId.toString())),this._skipFurnitureCreationForNextFrame)return}}onRoomEngineInitalized(t){if(t){this._ready=!0,this.events.dispatchEvent(new Ct(Ct.ENGINE_INITIALIZED,0));for(const e of this._roomDatas.values())e&&this.createRoomInstance(e.roomId,e.data)}}processPendingFurnitureFloor(t,e,s){if(!s){const h=this.getRoomInstanceData(t);if(h&&(s=h.getPendingFurnitureFloor(e)),!s)return!1}let i=s.type;i||(i=this.getFurnitureFloorName(s.typeId));const r=this.createRoomObjectFloor(t,e,i);if(!r)return!1;const a=r.model;if(a&&(a.setValue(g.FURNITURE_COLOR,this.getFurnitureFloorColorIndex(s.typeId)),a.setValue(g.FURNITURE_TYPE_ID,s.typeId),a.setValue(g.FURNITURE_AD_URL,this.getRoomObjectAdUrl(s.type)),a.setValue(g.FURNITURE_REAL_ROOM_OBJECT,s.realRoomObject?1:0),a.setValue(g.FURNITURE_EXPIRY_TIME,s.expiryTime),a.setValue(g.FURNITURE_EXPIRTY_TIMESTAMP,nt()),a.setValue(g.FURNITURE_USAGE_POLICY,s.usagePolicy),a.setValue(g.FURNITURE_OWNER_ID,s.ownerId),a.setValue(g.FURNITURE_OWNER_NAME,s.ownerName)),!this.updateRoomObjectFloor(t,e,s.location,s.direction,s.state,s.data,s.extra)||s.sizeZ>=0&&!this.updateRoomObjectFloorHeight(t,e,s.sizeZ))return!1;this.events&&this.events.dispatchEvent(new Z(Z.ADDED,t,e,M.FLOOR));const o=this.getPlacedRoomObjectData(t);return o&&o.id===e&&o.category===M.FLOOR&&this.selectRoomObject(t,e,M.FLOOR),r.isReady&&s.synchronized&&this.addObjectToTileMap(t,r),!0}processPendingFurnitureWall(t,e,s){if(!s){const _=this.getRoomInstanceData(t);if(_&&(s=_.getPendingFurnitureWall(e)),!s)return!1}let i="";s.data&&(i=s.data.getLegacyString());let r=this.getFurnitureWallName(s.typeId,i);r||(r="");const a=this.createRoomObjectWall(t,e,r);if(!a)return!1;const o=a.model;if(o&&(o.setValue(g.FURNITURE_COLOR,this.getFurnitureWallColorIndex(s.typeId)),o.setValue(g.FURNITURE_TYPE_ID,s.typeId),o.setValue(g.FURNITURE_AD_URL,this.getRoomObjectAdUrl(s.type)),o.setValue(g.FURNITURE_REAL_ROOM_OBJECT,s.realRoomObject?1:0),o.setValue(g.OBJECT_ACCURATE_Z_VALUE,1),o.setValue(g.FURNITURE_EXPIRY_TIME,s.expiryTime),o.setValue(g.FURNITURE_EXPIRTY_TIMESTAMP,nt()),o.setValue(g.FURNITURE_USAGE_POLICY,s.usagePolicy),o.setValue(g.FURNITURE_OWNER_ID,s.ownerId),o.setValue(g.FURNITURE_OWNER_NAME,s.ownerName)),!this.updateRoomObjectWall(t,e,s.location,s.direction,s.state,i))return!1;this.events&&this.events.dispatchEvent(new Z(Z.ADDED,t,e,M.WALL));const h=this.getPlacedRoomObjectData(t);return h&&Math.abs(h.id)===e&&h.category===M.WALL&&this.selectRoomObject(t,e,M.WALL),!0}setRoomSessionOwnUser(t,e){if(!this._roomSessionManager)return;const s=this._roomSessionManager.getSession(t);s&&s.setOwnRoomIndex(e);const i=this.getRoomCamera(t);i&&(i.targetId=e,i.targetCategory=M.UNIT,i.activateFollowing(this.cameraFollowDuration))}get cameraFollowDuration(){return 1e3}updateRoomCameras(t){for(const e of this._roomInstanceDatas.values()){if(!e)continue;const s=e.roomCamera;if(!s)continue;let i=null;const r=this.getRoomObject(e.roomId,s.targetId,s.targetCategory);r&&(i=r.getLocation()),i&&(e.roomId!==this._activeRoomId||!this._activeRoomIsDragged)&&this.updateRoomCamera(e.roomId,1,i,t)}if(this._activeRoomWasDragged){const e=this.getRoomInstanceRenderingCanvas(this._activeRoomId,1);e&&this.setRoomInstanceRenderingCanvasOffset(this._activeRoomId,1,new K(e.screenOffsetX+this._activeRoomDragX,e.screenOffsetY+this._activeRoomDragY)),this._activeRoomDragX=0,this._activeRoomDragY=0}}updateRoomCamera(t,e,s,i){const r=this.getRoomInstanceRenderingCanvas(t,e),a=this.getRoomInstanceData(t);if(!r||!a||r.scale!==1)return;const o=r.geometry,h=a.roomCamera,_=this.getRoomInstance(t);if(!o||!h||!_)return;const l=this.getRoomCanvasRectangle(t,e);if(!l)return;let c=Math.floor(s.z)+1;const f=Math.round(l.width),p=Math.round(l.height),m=this.getCanvasBoundingRectangle(e);if(m&&(m.right<0||m.bottom<0||m.left>=f||m.top>=p)&&h.reset(),h.screenWd!==f||h.screenHt!==p||h.scale!==o.scale||h.geometryUpdateId!==o.updateId||!R.isEqual(s,h.targetObjectLoc)||h.isMoving){h.targetObjectLoc=s;const O=new R;O.assign(s),O.x=Math.round(O.x),O.y=Math.round(O.y);const A=_.model.getValue(Yt.ROOM_MIN_X)-.5,C=_.model.getValue(Yt.ROOM_MIN_Y)-.5,L=_.model.getValue(Yt.ROOM_MAX_X)+.5,D=_.model.getValue(Yt.ROOM_MAX_Y)+.5,U=Math.round((A+L)/2),P=Math.round((C+D)/2),v=2;let F=new K(O.x-U,O.y-P);const $=o.scale/Math.sqrt(2),et=$/2,at=new Me;at.rotate(-(o.direction.x+90)/180*Math.PI),F=at.apply(F),F.y=F.y*(et/$);const At=l.width/2/$-1,oe=l.height/2/et-1;let zt=0,ds=0,Ms=0,Zs=0,Qt=o.getScreenPoint(new R(U,P,v));if(!Qt)return;if(Qt.x=Qt.x+Math.round(l.width/2),Qt.y=Qt.y+Math.round(l.height/2),m)if(m.x+=-r.screenOffsetX,m.y+=-r.screenOffsetY,m.width>1&&m.height>1)zt=(m.left-Qt.x-o.scale*.25)/$,Ms=(m.right-Qt.x+o.scale*.25)/$,ds=(m.top-Qt.y-o.scale*.5)/et,Zs=(m.bottom-Qt.y+o.scale*.5)/et;else{o.adjustLocation(new R(-30,-30),25);return}else{o.adjustLocation(new R(0,0),25);return}let no=!1,Qn=!1,ol=!1,hl=!1;Math.round((Ms-zt)*$)<l.width?(c=2,F.x=(Ms+zt)/2,ol=!0):(F.x>Ms-At&&(F.x=Ms-At,no=!0),F.x<zt+At&&(F.x=zt+At,no=!0)),Math.round((Zs-ds)*et)<l.height?(c=2,F.y=(Zs+ds)/2,hl=!0):(F.y>Zs-oe&&(F.y=Zs-oe,Qn=!0),F.y<ds+oe&&(F.y=ds+oe,Qn=!0),Qn&&(F.y=F.y/(et/$))),at.invert(),F=at.apply(F),F.x=F.x+U,F.y=F.y+P;let kr=.35,nr=.2,ao=.2;const yE=10,vE=10;if(ao*f>100&&(ao=100/f),kr*p>150&&(kr=150/p),nr*p>150&&(nr=150/p),h.limitedLocationX&&h.screenWd==f&&h.screenHt==p&&(ao=0),h.limitedLocationY&&h.screenWd==f&&h.screenHt==p&&(kr=0,nr=0),l.width=l.width*(1-ao*2),l.height=l.height*(1-(kr+nr)),l.width<yE&&(l.width=yE),l.height<vE&&(l.height=vE),kr+nr>0?(l.x+=-l.width/2,l.y+=-l.height*(nr/(kr+nr))):(l.x+=-l.width/2,l.y+=-l.height/2),Qt=o.getScreenPoint(O),!Qt)return;if(Qt){Qt.x=Qt.x+r.screenOffsetX,Qt.y=Qt.y+r.screenOffsetY,O.z=c,O.x=Math.round(F.x*2)/2,O.y=Math.round(F.y*2)/2,h.location||(o.location=O,this.useOffsetScrolling?h.initializeLocation(new R(0,0,0)):h.initializeLocation(O));const _l=o.getScreenPoint(O),ll=new R(0,0,0);_l&&(ll.x=_l.x,ll.y=_l.y),(Qt.x<l.left||Qt.x>l.right)&&!h.centeredLocX||(Qt.y<l.top||Qt.y>l.bottom)&&!h.centeredLocY||ol&&!h.centeredLocX&&h.screenWd!=f||hl&&!h.centeredLocY&&h.screenHt!=p||h.roomWd!=m.width||h.roomHt!=m.height||h.screenWd!=f||h.screenHt!=p?(h.limitedLocationX=no,h.limitedLocationY=Qn,this.useOffsetScrolling?h.target=ll:h.target=O):(no||(h.limitedLocationX=!1),Qn||(h.limitedLocationY=!1))}h.centeredLocX=ol,h.centeredLocY=hl,h.screenWd=f,h.screenHt=p,h.scale=o.scale,h.geometryUpdateId=o.updateId,h.roomWd=m.width,h.roomHt=m.height,this._sessionDataManager.isCameraFollowDisabled||(this.useOffsetScrolling?h.update(i,8):h.update(i,.5)),this.useOffsetScrolling?this.setRoomInstanceRenderingCanvasOffset(this.activeRoomId,1,new K(-h.location.x,-h.location.y)):o.adjustLocation(h.location,25)}else h.limitedLocationX=!1,h.limitedLocationY=!1,h.centeredLocX=!1,h.centeredLocY=!1}getRoomCanvasRectangle(t,e){const s=this.getRoomInstanceRenderingCanvas(t,e);return s?new we(0,0,s.width,s.height):null}getRoomObjectBoundingRectangle(t,e,s,i){const r=this.getRoomInstanceGeometry(t,i);if(!r)return null;const a=this.getRoomObject(t,e,s);if(!a)return null;const o=a.visualization;if(!o)return null;const h=o.getBoundingRectangle(),_=this.getRoomInstanceRenderingCanvas(t,i),l=_?_.scale:1,c=r.getScreenPoint(a.getLocation());return!c||(c.x=Math.round(c.x),c.y=Math.round(c.y),h.x=h.x*l,h.y=h.y*l,h.width=h.width*l,h.height=h.height*l,c.x=c.x*l,c.y=c.y*l,h.x+=c.x,h.y+=c.y,!_)?null:(h.x+=Math.round(_.width/2)+_.screenOffsetX,h.y+=Math.round(_.height/2)+_.screenOffsetY,h)}getCanvasBoundingRectangle(t){return this.getRoomObjectBoundingRectangle(this._activeRoomId,ot.ROOM_OBJECT_ID,M.ROOM,t)}getFurnitureFloorName(t){return this._roomContentLoader?this._roomContentLoader.getFurnitureFloorNameForTypeId(t):null}getFurnitureWallName(t,e=null){return this._roomContentLoader?this._roomContentLoader.getFurnitureWallNameForTypeId(t,e):null}getFurnitureFloorColorIndex(t){return this._roomContentLoader?this._roomContentLoader.getFurnitureFloorColorIndex(t):null}getFurnitureWallColorIndex(t){return this._roomContentLoader?this._roomContentLoader.getFurnitureWallColorIndex(t):null}getRoomInstanceData(t){const e=this._roomInstanceDatas.get(t);if(e)return e;const s=new X2(t);return this._roomInstanceDatas.set(s.roomId,s),s}getRoomInstanceModelName(t){const e=this.getRoomInstanceData(t);return e?e.modelName:null}setRoomInstanceModelName(t,e){const s=this.getRoomInstanceData(t);s&&s.setModelName(e)}getRoomTileObjectMap(t){const e=this.getRoomInstanceData(t);return e?e.tileObjectMap:null}getCurrentRoomCamera(){return this.getRoomCamera(this._activeRoomId)}getRoomCamera(t){const e=this.getRoomInstanceData(t);return e?e.roomCamera:null}getSelectedRoomObjectData(t){const e=this.getRoomInstanceData(t);return e?e.selectedObject:null}setSelectedRoomObjectData(t,e){const s=this.getRoomInstanceData(t);if(!s)return null;s.setSelectedObject(e),e&&s.setPlacedObject(null)}getPlacedRoomObjectData(t){const e=this.getRoomInstanceData(t);return e?e.placedObject:null}setPlacedRoomObjectData(t,e){const s=this.getRoomInstanceData(t);if(!s)return null;s.setPlacedObject(e)}cancelRoomObjectPlacement(){this._roomObjectEventHandler&&this._roomObjectEventHandler.cancelRoomObjectPlacement(this._activeRoomId)}getFurnitureStackingHeightMap(t){const e=this.getRoomInstanceData(t);return e?e.furnitureStackingHeightMap:null}setFurnitureStackingHeightMap(t,e){const s=this.getRoomInstanceData(t);if(!s)return null;s.setFurnitureStackingHeightMap(e)}getLegacyWallGeometry(t){const e=this.getRoomInstanceData(t);return e?e.legacyGeometry:null}createRoomObjectAndInitialize(t,e,s,i){const r=this.getRoomInstance(t);return r?r.createRoomObjectAndInitalize(e,s,i):null}getTotalObjectsForManager(t,e){const s=this.getRoomInstance(t);return s?s.getTotalObjectsForManager(e):0}getRoomObject(t,e,s){if(!this._ready)return null;let i=this.getRoomId(t);return t===0&&(i=ot.TEMPORARY_ROOM),this.getObject(i,e,s)}getObject(t,e,s){let i=null;if(this._roomManager&&(i=this._roomManager.getRoomInstance(t)),!i)return null;let r=i.getRoomObject(e,s);if(!r)switch(s){case M.FLOOR:this.processPendingFurnitureFloor(this.getRoomIdFromString(t),e,null),r=i.getRoomObject(e,s);break;case M.WALL:this.processPendingFurnitureWall(this.getRoomIdFromString(t),e,null),r=i.getRoomObject(e,s);break}return r}getRoomObjectByIndex(t,e,s){const i=this.getRoomInstance(t);return i?i.getRoomObjectByIndex(e,s):null}getRoomObjectCategoryForType(t){return!t||!this._roomContentLoader?M.MINIMUM:this._roomContentLoader.getCategoryForType(t)}getRoomObjectCursor(t){return this.getObject(this.getRoomId(t),ot.CURSOR_OBJECT_ID,M.CURSOR)}getRoomObjectSelectionArrow(t){return this.getObject(this.getRoomId(t),ot.ARROW_OBJECT_ID,M.CURSOR)}getRoomOwnObject(t){return this.getObject(this.getRoomId(t),ot.ROOM_OBJECT_ID,M.ROOM)}getRoomObjectUser(t,e){return this.getObject(this.getRoomId(t),e,M.UNIT)}removeRoomObjectUser(t,e){return this.removeRoomObject(t,e,M.UNIT)}createRoomObjectUser(t,e,s){return this.createRoomObjectAndInitialize(t,e,s,M.UNIT)}getRoomObjectFloor(t,e){return this.getObject(this.getRoomId(t),e,M.FLOOR)}createRoomObjectFloor(t,e,s){return this.createRoomObjectAndInitialize(t,e,s,M.FLOOR)}removeRoomObjectFloor(t,e,s=-1,i=!1){const r=this.getRoomInstanceData(t);if(r&&r.removePendingFunitureFloor(e),this._sessionDataManager&&s===this._sessionDataManager.userId&&!ch.isBuilderClubId(e)){const a=this.getRoomObject(t,e,M.FLOOR);if(a){const o=this.getRoomObjectScreenLocation(t,e,M.FLOOR,this._activeRoomActiveCanvas);if(o&&!(a.model.getValue(g.FURNITURE_DISABLE_PICKING_ANIMATION)===1)){const _=a.model.getValue(g.FURNITURE_TYPE_ID),l=a.model.getValue(g.FURNITURE_EXTRAS),c=a.model.getValue(g.FURNITURE_DATA_FORMAT),f=Xi.getData(c),p=this.getFurnitureFloorIcon(_,null,l,f).data;if(p){const m=Ut.generateImage(p);if(this.events){const O=new Ro(m,o.x,o.y);O.iconName=Eo.INVENTORY,this.events.dispatchEvent(O)}}}}}this.removeRoomObject(t,e,M.FLOOR),this.setMouseDefault(t,M.FLOOR,e),i&&this.refreshTileObjectMap(t,"RoomEngine.disposeObjectFurniture()")}getRoomObjectWall(t,e){return this.getObject(this.getRoomId(t),e,M.WALL)}removeRoomObjectWall(t,e,s=-1){if(this._sessionDataManager&&s===this._sessionDataManager.userId&&!ch.isBuilderClubId(e)){const i=this.getRoomObject(t,e,M.WALL);if(i&&i.type.indexOf("post_it")===-1&&i.type.indexOf("external_image_wallitem")===-1){const r=this.getRoomObjectScreenLocation(t,e,M.WALL,this._activeRoomActiveCanvas);if(r){const a=i.model.getValue(g.FURNITURE_TYPE_ID),o=i.model.getValue(g.FURNITURE_DATA),h=this.getFurnitureWallIcon(a,null,o).data;if(h){const _=Ut.generateImage(h);if(this.events){const l=new Ro(_,r.x,r.y);l.iconName=Eo.INVENTORY,this.events.dispatchEvent(l)}}}}}this.removeRoomObject(t,e,M.WALL),this.updateRoomObjectMask(t,e,!1),this.setMouseDefault(t,M.WALL,e)}createRoomObjectWall(t,e,s){return this.createRoomObjectAndInitialize(t,e,s,M.WALL)}removeRoomObject(t,e,s){const i=this.getRoomInstance(t);if(!i)return null;i.removeRoomObject(e,s),this.events&&this.events.dispatchEvent(new Z(Z.REMOVED,t,e,s))}addFurnitureFloor(t,e,s,i,r,a,o,h=NaN,_=-1,l=0,c=0,f="",p=!0,m=!0,O=-1){const A=this.getRoomInstanceData(t);if(!A)return!1;const C=new gl(e,s,null,i,r,a,o,h,_,l,c,f,p,m,O);return A.addPendingFurnitureFloor(C),!0}addFurnitureFloorByTypeName(t,e,s,i,r,a,o,h=NaN,_=-1,l=0,c=0,f="",p=!0,m=!0,O=-1){const A=this.getRoomInstanceData(t);if(!A)return!1;const C=new gl(e,0,s,i,r,a,o,h,_,l,c,f,p,m,O);return A.addPendingFurnitureFloor(C),!0}addFurnitureWall(t,e,s,i,r,a,o,h=-1,_=0,l=0,c="",f=!0){const p=this.getRoomInstanceData(t);if(!p)return!1;const m=new Ne;m.setString(o);const O=new gl(e,s,null,i,r,a,m,NaN,h,_,l,c,!0,f);return p.addPendingFurnitureWall(O),!0}updateRoomObjectFloor(t,e,s,i,r,a,o=null){const h=this.getRoomObjectFloor(t,e);return h?(h.processUpdateMessage(new qt(s,i)),h.processUpdateMessage(new St(r,a,o)),!0):!1}updateRoomObjectWall(t,e,s,i,r,a=null){const o=this.getRoomObjectWall(t,e);if(!o||!o.logic)return!1;const h=new qt(s,i),_=new Ne,l=new St(r,_);return _.setString(a),o.logic.processUpdateMessage(h),o.logic.processUpdateMessage(l),this.updateRoomObjectMask(t,e),!0}updateRoomObjectWallItemData(t,e,s){const i=this.getRoomObjectWall(t,e);return!i||!i.logic?!1:(i.logic.processUpdateMessage(new Zd(s)),!0)}updateRoomObjectFloorHeight(t,e,s){const i=this.getRoomObjectFloor(t,e);return i?(i.processUpdateMessage(new ST(null,null,s)),!0):!1}updateRoomObjectFloorExpiration(t,e,s){const i=this.getRoomObjectFloor(t,e);return i?(i.model.setValue(g.FURNITURE_EXPIRY_TIME,s),i.model.setValue(g.FURNITURE_EXPIRTY_TIMESTAMP,nt()),!0):!1}updateRoomObjectWallExpiration(t,e,s){const i=this.getRoomObjectWall(t,e);return i?(i.model.setValue(g.FURNITURE_EXPIRY_TIME,s),i.model.setValue(g.FURNITURE_EXPIRTY_TIMESTAMP,nt()),!0):!1}updateRoomObjectMask(t,e,s=!0){const i=M.WALL+"_"+e,r=this.getRoomObjectWall(t,e);let a=null;if(r&&r.model){if(r.model.getValue(g.FURNITURE_USES_PLANE_MASK)>0){const h=r.model.getValue(g.FURNITURE_PLANE_MASK_TYPE),_=r.getLocation();s?a=new de(de.ADD_MASK,i,h,_):a=new de(de.REMOVE_MASK,i)}}else a=new de(de.REMOVE_MASK,i);const o=this.getRoomOwnObject(t);o&&o.logic&&a&&o.logic.processUpdateMessage(a)}rollRoomObjectFloor(t,e,s,i){const r=this.getRoomObjectFloor(t,e);r&&r.processUpdateMessage(new $i(s,i,null,!!i))}updateRoomObjectWallLocation(t,e,s){const i=this.getRoomObjectWall(t,e);return i?(i.logic&&i.logic.processUpdateMessage(new $i(s,null,null)),this.updateRoomObjectMask(t,e),!0):!1}addRoomObjectUser(t,e,s,i,r,a,o){if(this.getRoomObjectUser(t,e))return!1;let _=pt.getTypeString(a);_===pt.PET&&(_=this.getPetType(o));const l=this.createRoomObjectUser(t,e,_);return l?(l.processUpdateMessage(new $o(this.fixedUserLocation(t,s),null,i,r,!1,0)),o&&l.processUpdateMessage(new Jo(o)),this.events&&this.events.dispatchEvent(new Z(Z.ADDED,t,e,M.UNIT)),!0):!1}updateRoomObjectUserLocation(t,e,s,i,r=!1,a=0,o=null,h=NaN){const _=this.getRoomObjectUser(t,e);if(!_)return!1;s||(s=_.getLocation()),o||(o=_.getDirection()),isNaN(h)&&(h=_.model.getValue(g.HEAD_DIRECTION)),_.processUpdateMessage(new $o(this.fixedUserLocation(t,s),this.fixedUserLocation(t,i),o,h,r,a));const l=this._roomSessionManager&&this._roomSessionManager.getSession(t)||null;return l&&l.ownRoomIndex===e&&this._logicFactory.events.dispatchEvent(new Yn(Yn.ROAME_MOVE_TO,i)),!0}fixedUserLocation(t,e){if(!e)return null;const s=this.getFurnitureStackingHeightMap(t),i=this.getLegacyWallGeometry(t);if(!s||!i)return e;let r=e.z;const a=s.getTileHeight(e.x,e.y),o=i.getHeight(e.x,e.y);return Math.abs(r-a)<.1&&Math.abs(a-o)<.1&&(r=i.getFloorAltitude(e.x,e.y)),new R(e.x,e.y,r)}updateRoomObjectUserAction(t,e,s,i,r=null){const a=this.getRoomObjectUser(t,e);if(!a)return!1;let o=null;switch(s){case g.FIGURE_TALK:o=new qd(i);break;case g.FIGURE_SLEEP:o=new Jd(i===1);break;case g.FIGURE_IS_TYPING:o=new OT(i===1);break;case g.FIGURE_IS_MUTED:o=new fT(i===1);break;case g.FIGURE_CARRY_OBJECT:o=new _T(i,r);break;case g.FIGURE_USE_OBJECT:o=new AT(i);break;case g.FIGURE_DANCE:o=new lT(i);break;case g.FIGURE_GAINED_EXPERIENCE:o=new uT(i);break;case g.FIGURE_NUMBER_VALUE:o=new mT(i);break;case g.FIGURE_SIGN:o=new RT(i);break;case g.FIGURE_EXPRESSION:o=new dT(i);break;case g.FIGURE_IS_PLAYING_GAME:o=new pT(i===1);break;case g.FIGURE_GUIDE_STATUS:o=new TV(i);break}return o?(a.processUpdateMessage(o),!0):!1}updateRoomObjectUserFigure(t,e,s,i=null,r=null,a=!1){const o=this.getRoomObjectUser(t,e);return o?(o.processUpdateMessage(new Jo(s,i,r,a)),!0):!1}updateRoomObjectUserFlatControl(t,e,s){const i=this.getRoomObjectUser(t,e);return i?(i.processUpdateMessage(new ET(parseInt(s))),!0):!1}updateRoomObjectUserEffect(t,e,s,i=0){const r=this.getRoomObjectUser(t,e);return r?(r.processUpdateMessage(new cT(s,i)),!0):!1}updateRoomObjectUserGesture(t,e,s){const i=this.getRoomObjectUser(t,e);return i?(i.processUpdateMessage(new gT(s)),!0):!1}updateRoomObjectUserPetGesture(t,e,s){const i=this.getRoomObjectUser(t,e);return i?(i.processUpdateMessage(new TT(s)),!0):!1}updateRoomObjectUserPosture(t,e,s,i=null){const r=this.getRoomObjectUser(t,e);return r?(r.processUpdateMessage(new Qd(s,i)),!0):!1}updateRoomObjectUserOwn(t,e){const s=this.getRoomObjectUser(t,e);s&&s.processUpdateMessage(new IT)}useRoomObject(t,e){const s=this.getRoomObject(this._activeRoomId,t,e);if(s){const i=s.logic;if(i)return i.useObject(),!0}return!1}objectInitialized(t,e,s){const i=this.getRoomIdFromString(t);s===M.WALL&&this.updateRoomObjectMask(i,e);const r=this.getRoomObject(i,e,s);if(r&&r.model&&r.logic){const a=r.model.getValue(g.FURNITURE_DATA_FORMAT);if(!isNaN(a)){const o=Xi.getData(a);o.initializeFromRoomObjectModel(r.model),r.processUpdateMessage(new St(r.getState(0),o))}this.events.dispatchEvent(new Z(Z.CONTENT_UPDATED,i,e,s))}t!==ot.TEMPORARY_ROOM&&this.addObjectToTileMap(i,r)}changeObjectModelData(t,e,s,i,r){const a=this.getObject(this.getRoomId(t),e,s);if(!a||!a.logic)return!1;const o=new CT(i,r);return a.processUpdateMessage(o),!0}changeObjectState(t,e,s){const i=this.getObject(this.getRoomId(t),e,s);if(!i||!i.model)return;let r=i.model.getValue(g.FURNITURE_AUTOMATIC_STATE_INDEX);isNaN(r)?r=1:r=r+1,i.model.setValue(g.FURNITURE_AUTOMATIC_STATE_INDEX,r);const a=i.model.getValue(g.FURNITURE_DATA_FORMAT),o=Xi.getData(a);o.initializeFromRoomObjectModel(i.model),i.logic&&i.logic.processUpdateMessage(new St(r,o))}loadRoomObjectBadgeImage(t,e,s,i,r=!0){if(!this._sessionDataManager)return;let a=null;if(t===0){const h=this._roomManager.getRoomInstance(ot.TEMPORARY_ROOM);h&&(a=h.getRoomObject(e,s))}else a=this.getRoomObjectFloor(t,e);if(!a||!a.logic)return;let o=r?this._sessionDataManager.loadGroupBadgeImage(i):this._sessionDataManager.loadBadgeImage(i);if(o)this.putBadgeInObjectAssets(a,i,r);else{o="loading_icon",this._badgeListenerObjects||(this._badgeListenerObjects=new Map),this._badgeListenerObjects.size||this._sessionDataManager.events.addEventListener(Hn.IMAGE_READY,this.onBadgeImageReadyEvent);let h=this._badgeListenerObjects.get(i);h||(h=[]),h.push(new q2(a,r)),this._badgeListenerObjects.set(i,h)}a.logic.processUpdateMessage(new Yr(i,o))}onBadgeImageReadyEvent(t){if(!this._sessionDataManager)return;const e=this._badgeListenerObjects&&this._badgeListenerObjects.get(t.badgeId);if(e){for(const s of e){if(!s)continue;this.putBadgeInObjectAssets(s.object,t.badgeId,s.groupBadge);const i=s.groupBadge?this._sessionDataManager.loadGroupBadgeImage(t.badgeId):this._sessionDataManager.loadBadgeImage(t.badgeId);s.object&&s.object.logic&&s.object.logic.processUpdateMessage(new Yr(t.badgeId,i))}this._badgeListenerObjects.delete(t.badgeId),this._badgeListenerObjects.size||this._sessionDataManager.events.removeEventListener(Hn.IMAGE_READY,this.onBadgeImageReadyEvent)}}putBadgeInObjectAssets(t,e,s=!1){if(!this._roomContentLoader||!this._sessionDataManager)return;const i=s?this._sessionDataManager.loadGroupBadgeImage(e):this._sessionDataManager.loadBadgeImage(e),r=s?this._sessionDataManager.getGroupBadgeImage(e):this._sessionDataManager.getBadgeImage(e);r&&this._roomContentLoader.addAssetToCollection(t.type,i,r,!1)}dispatchMouseEvent(t,e,s,i,r,a,o,h){const _=this.getRoomInstanceRenderingCanvas(this._activeRoomId,t);if(!_)return;const l=this.getRenderingCanvasOverlay(_),c=this.getOverlayIconSprite(l,ot.OBJECT_ICON_SPRITE);if(c){const f=c.getLocalBounds();c.x=e-f.width/2,c.y=s-f.height/2}if(!this.handleRoomDragging(_,e,s,i,r,a,o)&&!_.handleMouseEvent(e,s,i,r,a,o,h)){let f=null;i===z.MOUSE_CLICK?(this.events&&this.events.dispatchEvent(new Z(Z.DESELECTED,this._activeRoomId,-1,M.MINIMUM)),f=X.CLICK):i===z.MOUSE_MOVE?f=X.MOUSE_MOVE:i===z.MOUSE_DOWN?f=X.MOUSE_DOWN:i===z.MOUSE_DOWN_LONG?f=X.MOUSE_DOWN_LONG:i===z.MOUSE_UP&&(f=X.MOUSE_UP),this._roomObjectEventHandler.handleRoomObjectEvent(new X(f,this.getRoomObject(this._activeRoomId,ot.ROOM_OBJECT_ID,M.ROOM),null,r),this._activeRoomId)}this._activeRoomActiveCanvas=t,this._activeRoomActiveCanvasMouseX=e,this._activeRoomActiveCanvasMouseY=s}handleRoomDragging(t,e,s,i,r,a,o){let h=e-this._activeRoomActiveCanvasMouseX,_=s-this._activeRoomActiveCanvasMouseY;if(i===z.MOUSE_DOWN)!r&&!a&&!o&&!this.isDecorating&&this._roomAllowsDragging&&(this._activeRoomIsDragged=!0,this._activeRoomWasDragged=!1,this._activeRoomDragStartX=this._activeRoomActiveCanvasMouseX,this._activeRoomDragStartY=this._activeRoomActiveCanvasMouseY);else if(i===z.MOUSE_UP){if(this._activeRoomIsDragged&&(this._activeRoomIsDragged=!1,this._activeRoomWasDragged)){const l=this.getRoomInstanceData(this._activeRoomId);if(l){const c=l.roomCamera;c&&(this.useOffsetScrolling&&(c.isMoving||(c.centeredLocX=!1,c.centeredLocY=!1),c.resetLocation(new R(-t.screenOffsetX,-t.screenOffsetY))),this._roomDraggingAlwaysCenters&&c.reset())}}}else if(i===z.MOUSE_MOVE)this._activeRoomIsDragged&&(this._activeRoomWasDragged||(h=e-this._activeRoomDragStartX,_=s-this._activeRoomDragStartY,(h<=-ot.DRAG_THRESHOLD||h>=ot.DRAG_THRESHOLD||_<=-ot.DRAG_THRESHOLD||_>=ot.DRAG_THRESHOLD)&&(this._activeRoomWasDragged=!0),h=0,_=0),(h!=0||_!=0)&&(this._activeRoomDragX+=h,this._activeRoomDragY+=_,this._activeRoomWasDragged=!0));else if((i===z.MOUSE_CLICK||i===z.DOUBLE_CLICK)&&(this._activeRoomIsDragged=!1,this._activeRoomWasDragged))return this._activeRoomWasDragged=!1,!0;return!1}updateMousePointer(t,e,s){const i=this.getRoomObjectCategoryForType(s);switch(t){case y.MOUSE_BUTTON:this.setMouseButton(this._activeRoomId,i,e);return;default:this.setMouseDefault(this._activeRoomId,i,e);return}}setMouseButton(t,e,s){if(!this._roomSessionManager)return;const i=this._roomSessionManager.getSession(t);if(i&&(e!==M.FLOOR&&e!==M.WALL||i.controllerLevel>=Ii.GUEST)){const r=this.getRoomInstanceData(t);r&&r.addButtonMouseCursorOwner(e+"_"+s)&&(this._mouseCursorUpdate=!0)}}setMouseDefault(t,e,s){if(!this._roomSessionManager)return;const i=this.getRoomInstanceData(t);i&&i.removeButtonMouseCursorOwner(e+"_"+s)&&(this._mouseCursorUpdate=!0)}processRoomObjectOperation(t,e,s){if(!this._roomObjectEventHandler)return!1;this._roomObjectEventHandler.modifyRoomObject(this._activeRoomId,t,e,s)}modifyRoomObjectDataWithMap(t,e,s,i){if(!this._roomObjectEventHandler)return!1;e===M.FLOOR&&this._roomObjectEventHandler.modifyRoomObjectDataWithMap(this._activeRoomId,t,e,s,i)}modifyRoomObjectData(t,e,s,i){if(!this._roomObjectEventHandler)return!1;e===M.WALL&&this._roomObjectEventHandler.modifyWallItemData(this._activeRoomId,t,s,i)}processRoomObjectEvent(t){if(!this._roomObjectEventHandler)return;const e=this.getRoomObjectRoomId(t.object);if(!e)return;const s=this.getRoomIdFromString(e);this._roomObjectEventHandler.handleRoomObjectEvent(t,s)}processRoomObjectPlacement(t,e,s,i,r=null,a=null,o=-1,h=-1,_=null){const l=this.getRoomInstance(this._activeRoomId);return!l||l.model.getValue(Yt.ROOM_IS_PUBLIC)!==0||!this._roomObjectEventHandler?!1:this._roomObjectEventHandler.processRoomObjectPlacement(t,this._activeRoomId,e,s,i,r,a,o,h,_)}getRoomObjectScreenLocation(t,e,s,i=-1){i==-1&&(i=this._activeRoomActiveCanvas);const r=this.getRoomInstanceGeometry(t,i);if(!r)return null;const a=this.getRoomObject(t,e,s);if(!a)return null;const o=r.getScreenPoint(a.getLocation());if(!o)return null;const h=this.getRoomInstanceRenderingCanvas(t,i);return h?(o.x=o.x*h.scale,o.y=o.y*h.scale,o.x+=h.width/2+h.screenOffsetX,o.y+=h.height/2+h.screenOffsetY,o.x=Math.round(o.x),o.y=Math.round(o.y),o):null}selectRoomObject(t,e,s){this._roomObjectEventHandler&&this._roomObjectEventHandler.setSelectedObject(t,e,s)}setSelectedAvatar(t,e){this._roomObjectEventHandler||this._roomObjectEventHandler.setSelectedAvatar(t,e,!0)}cancelRoomObjectInsert(){this._roomObjectEventHandler&&this._roomObjectEventHandler.cancelRoomObjectInsert(this._activeRoomId)}addOverlayIconSprite(t,e,s,i=1){if(!t||!s)return;let r=this.getOverlayIconSprite(t,e);return r?null:(r=new xt(s),r.name=e,r.scale.set(i),t.addChild(r),r)}onRoomContentLoaded(t,e,s){if(!this._roomContentLoader||t===-1)return;this._thumbnailObjectIdBank.freeNumber(t-1);const i=this._thumbnailCallbacks.get(e);if(i){this._thumbnailCallbacks.delete(e);const r=this._roomContentLoader.getImage(e);if(r)for(const a of i)a&&a.imageReady(t,null,r)}}setObjectMoverIconSprite(t,e,s,i=null,r=null,a=-1,o=-1,h=null){let _=null,l=0,c=null;const f=1;if(s)c=this.getRoomObjectImage(this._activeRoomId,t,e,new R,1,null);else if(this._roomContentLoader)if(e===M.FLOOR?(_=this._roomContentLoader.getFurnitureFloorNameForTypeId(t),l=this._roomContentLoader.getFurnitureFloorColorIndex(t)):e===M.WALL&&(_=this._roomContentLoader.getFurnitureWallNameForTypeId(t,i),l=this._roomContentLoader.getFurnitureWallColorIndex(t)),e===M.UNIT)if(_=pt.getTypeString(t),_==="pet"){_=this.getPetType(i);const A=new uh(i);c=this.getRoomObjectPetImage(A.typeId,A.paletteId,A.color,new R(180),64,null,!0,0,A.customParts,h)}else c=this.getGenericRoomObjectImage(_,i,new R(180),64,null,0,null,r,a,o,h);else c=this.getGenericRoomObjectImage(_,l.toString(),new R,1,null,0,i,r,a,o,h);if(!c||!c.data)return;const p=this.getActiveRoomInstanceRenderingCanvas();if(!p)return;const m=this.getRenderingCanvasOverlay(p);this.removeOverlayIconSprite(m,ot.OBJECT_ICON_SPRITE);const O=this.addOverlayIconSprite(m,ot.OBJECT_ICON_SPRITE,c.data,f);O&&(O.x=this._activeRoomActiveCanvasMouseX-c.data.width/2,O.y=this._activeRoomActiveCanvasMouseY-c.data.height/2)}getRoomObjectImage(t,e,s,i,r,a,o=0){if(!this._roomManager)return null;let h=-1,_=null,l=null,c="",f=null;const p=this.getRoomId(t),m=this._roomManager.getRoomInstance(p);if(m){const O=m.getRoomObject(e,s);if(O&&O.model)switch(h=O.id,_=O.type,s){case M.FLOOR:case M.WALL:{c=O.model.getValue(g.FURNITURE_COLOR).toString(),f=O.model.getValue(g.FURNITURE_EXTRAS);const A=O.model.getValue(g.FURNITURE_DATA_FORMAT);A!==Ne.FORMAT_KEY&&(l=Xi.getData(A),l.initializeFromRoomObjectModel(O.model));break}case M.UNIT:c=O.model.getValue(g.FIGURE);break}}return this.getGenericRoomObjectImage(_,c,i,r,a,o,f,l,-1,-1,null,h)}getFurnitureFloorIconUrl(t){let e=null,s="";return this._roomContentLoader?(e=this._roomContentLoader.getFurnitureFloorNameForTypeId(t),s=this._roomContentLoader.getFurnitureFloorColorIndex(t).toString(),this._roomContentLoader.getAssetIconUrl(e,s)):null}getFurnitureFloorIcon(t,e,s=null,i=null){return this.getFurnitureFloorImage(t,new R,1,e,0,s,-1,-1,i)}getFurnitureWallIconUrl(t,e=null){let s=null,i="";return this._roomContentLoader?(s=this._roomContentLoader.getFurnitureWallNameForTypeId(t,e),i=this._roomContentLoader.getFurnitureWallColorIndex(t).toString(),this._roomContentLoader.getAssetIconUrl(s,i)):null}getFurnitureWallIcon(t,e,s=null){return this.getFurnitureWallImage(t,new R,1,e,0,s)}getFurnitureFloorImage(t,e,s,i,r=0,a=null,o=-1,h=-1,_=null){let l=null,c="";return this._roomContentLoader&&(l=this._roomContentLoader.getFurnitureFloorNameForTypeId(t),c=this._roomContentLoader.getFurnitureFloorColorIndex(t).toString()),s===1&&i?this.getGenericRoomObjectThumbnail(l,c,i,a,_):this.getGenericRoomObjectImage(l,c,e,s,i,r,a,_,o,h)}getFurnitureWallImage(t,e,s,i,r=0,a=null,o=-1,h=-1){let _=null,l="";return this._roomContentLoader&&(_=this._roomContentLoader.getFurnitureWallNameForTypeId(t),l=this._roomContentLoader.getFurnitureWallColorIndex(t).toString()),s===1&&i?this.getGenericRoomObjectThumbnail(_,l,i,a,null):this.getGenericRoomObjectImage(_,l,e,s,i,r,a,null,o,h)}getRoomObjectPetImage(t,e,s,i,r,a,o=!1,h=0,_=null,l=null){let c=null,f=t+" "+e+" "+s.toString(16);if(o&&(f=f+" head"),_){f=f+(" "+_.length);for(const p of _)f=f+(" "+p.layerId+" "+p.partId+" "+p.paletteId)}return this._roomContentLoader&&(c=this._roomContentLoader.getPetNameForType(t)),this.getGenericRoomObjectImage(c,f,i,r,a,h,null,null,-1,-1,l)}getGenericRoomObjectImage(t,e,s,i,r,a=0,o=null,h=null,_=-1,l=-1,c=null,f=-1){if(!this._roomManager)return null;const p=new ng;if(p.id=-1,!this._ready||!t)return p;let m=this._roomManager.getRoomInstance(ot.TEMPORARY_ROOM);if(!m&&(m=this._roomManager.createRoomInstance(ot.TEMPORARY_ROOM),!m))return p;let O=this._imageObjectIdBank.reserveNumber();const A=this.getRoomObjectCategoryForType(t);if(O<0)return p;O++;const C=m.createRoomObjectAndInitalize(O,t,A);if(!C||!C.model||!C.logic)return p;const L=C.model;switch(A){case M.FLOOR:case M.WALL:L.setValue(g.FURNITURE_COLOR,parseInt(e)),L.setValue(g.FURNITURE_EXTRAS,o);break;case M.UNIT:if(t===pt.USER||t===pt.BOT||t===pt.RENTABLE_BOT||t===pt.PET)L.setValue(g.FIGURE,e);else{const v=new uh(e);L.setValue(g.PET_PALETTE_INDEX,v.paletteId),L.setValue(g.PET_COLOR,v.color),v.headOnly&&L.setValue(g.PET_HEAD_ONLY,1),v.hasCustomParts&&(L.setValue(g.PET_CUSTOM_LAYER_IDS,v.customLayerIds),L.setValue(g.PET_CUSTOM_PARTS_IDS,v.customPartIds),L.setValue(g.PET_CUSTOM_PALETTE_IDS,v.customPaletteIds)),c&&L.setValue(g.FIGURE_POSTURE,c)}break}C.setDirection(s);const D=C.visualization;if(!D)return m.removeRoomObject(O,A),p;(_>-1||h)&&(h&&h.getLegacyString()!==""?C.logic.processUpdateMessage(new St(parseInt(h.getLegacyString()),h)):C.logic.processUpdateMessage(new St(_,h)));const U=new Vr(i,new R(-135,30,0),new R(11,11,5));if(D.update(U,0,!0,!1),l>0){let v=0;for(;v<l;)D.update(U,0,!0,!1),v++}const P=D.getImage(a,f);if(p.data=P,p.id=O,!this.isRoomContentTypeLoaded(t)&&r){let v=this._imageCallbacks.get(O.toString());v||(v=[],this._imageCallbacks.set(O.toString(),v)),v.push(r),L.setValue(g.IMAGE_QUERY_SCALE,i)}else m.removeRoomObject(O,A),this._imageObjectIdBank.freeNumber(O-1),p.id=0;return U.dispose(),p}getGenericRoomObjectThumbnail(t,e,s,i=null,r=null){if(!this._roomManager)return null;const a=new ng;if(a.id=-1,!this._ready||!t)return a;let o=this._roomManager.getRoomInstance(ot.TEMPORARY_ROOM);if(!o&&(o=this._roomManager.createRoomInstance(ot.TEMPORARY_ROOM),!o))return a;let h=this._thumbnailObjectIdBank.reserveNumber();if(this.getRoomObjectCategoryForType(t),h<0)return a;h++,a.id=h,a.data=null,a.image=null;const _=[t,e].join("_"),l=this._roomContentLoader.getImage(_);if(!l&&s){let c=this._thumbnailCallbacks.get(_);c||(c=[],this._thumbnailCallbacks.set(_,c),this._roomContentLoader.downloadImage(h,t,e,null)),c.push(s)}else l&&(a.image=l),this._thumbnailObjectIdBank.freeNumber(h-1),a.id=0;return a}initalizeTemporaryObjectsByType(t,e){const s=this._roomManager.getRoomInstance(ot.TEMPORARY_ROOM);if(!s||!this._roomContentLoader)return;const i=this._roomContentLoader.getCategoryForType(t),r=s.getManager(i);let a=null,o=0;if(r&&r.objects.length){for(const h of r.objects.getValues())if(h&&h.model&&h.type===t){const _=h.id,l=h.visualization;let c=null;if(l){const p=h.model.getValue(g.IMAGE_QUERY_SCALE);a&&o!==p&&(a.dispose(),a=null),a||(o=p,a=new Vr(p,new R(-135,30,0),new R(11,11,5))),l.update(a,0,!0,!1),c=l.image}s.removeRoomObject(_,i),this._imageObjectIdBank.freeNumber(_-1);const f=this._imageCallbacks.get(_.toString());if(f){this._imageCallbacks.delete(_.toString());for(const p of f)p&&(c?p.imageReady(_,c):p.imageFailed(_))}}}a&&a.dispose()}setObjectMoverIconSpriteVisible(t){const e=this.getActiveRoomInstanceRenderingCanvas();if(!e)return;const s=this.getRenderingCanvasOverlay(e),i=this.getOverlayIconSprite(s,ot.OBJECT_ICON_SPRITE);i&&(i.visible=t)}removeObjectMoverIconSprite(){const t=this.getActiveRoomInstanceRenderingCanvas();if(!t)return;const e=this.getRenderingCanvasOverlay(t);this.removeOverlayIconSprite(e,ot.OBJECT_ICON_SPRITE)}getRenderingCanvasOverlay(t){if(!t)return null;const e=t.master;return e&&e.getChildByName(ot.OVERLAY)||null}removeOverlayIconSprite(t,e){if(!t)return!1;let s=t.children.length-1;for(;s>=0;){const i=t.getChildAt(s);if(i&&i.name===e){if(t.removeChildAt(s),i.children.length){const r=i.getChildAt(0);r.parent.removeChild(r),r.destroy()}return!0}s--}return!1}getOverlayIconSprite(t,e){if(!t)return null;let s=t.children.length-1;for(;s>=0;){const i=t.getChildAt(s);if(i&&i.name===e)return i;s--}return null}getRoomObjects(t,e){if(this._ready){const s=this.getRoomId(t),i=this._roomManager.getRoomInstance(s);if(i)return i.getRoomObjectsForCategory(e)}return[]}addObjectToTileMap(t,e){const s=this.getRoomInstanceData(t).tileObjectMap;s&&s.addRoomObject(e)}refreshTileObjectMap(t,e){const s=this.getRoomInstanceData(t).tileObjectMap;s&&s.populate(this.getRoomObjects(t,M.FLOOR))}getRenderRoomMessage(t,e,s=!1,i=!0,r=!1,a=-1){let o=null;if(a>-1?o=this.getRoomInstanceRenderingCanvas(this._activeRoomId,a):o=this.getActiveRoomInstanceRenderingCanvas(),!o)return null;r&&o.skipSpriteVisibilityChecking();let h=-1;!i&&this._roomSessionManager.getSession(this._activeRoomId)!=null&&(h=this._roomSessionManager.getSession(this._activeRoomId).ownRoomIndex);const _=new Nd,l=_.getFurniData(t,o,this,h),c=_.getRoomRenderingModifiers(this),f=_.getRoomPlanes(t,o,this,e);return r&&o.resumeSpriteVisibilityChecking(),j.log(l,c,f),null}createTextureFromRoom(t,e=-1,s=null){let i=null;e>-1?i=this.getRoomInstanceRenderingCanvas(this._activeRoomId,e):i=this.getActiveRoomInstanceRenderingCanvas();let r=null;return s?r=Ut.generateTexture(i.master,s):r=i.getDisplayAsTexture(),r}saveTextureAsScreenshot(t,e=!1){let s=null;e?s=new Nu:s=new Qo,s.assignBitmap(t),this._communication.connection.send(s)}saveBase64AsScreenshot(t,e=!1){let s=null;e?s=new Nu:s=new Qo,s.assignBase64(t),this._communication.connection.send(s)}objectsInitialized(t){const e=this.getRoomIdFromString(t);this.events.dispatchEvent(new Ct(Ct.OBJECTS_INITIALIZED,e))}getRoomId(t){return t.toString()}getRoomIdFromString(t){if(!t)return-1;const e=t.split("_");return e.length<=0?-1:parseInt(e[0])||0}getRoomObjectRoomId(t){return!t||!t.model?null:t.model.getValue(g.OBJECT_ROOM_ID)}getRoomObjectAdUrl(t){return this._roomContentLoader.getRoomObjectAdUrl(t)}getPetTypeId(t){let e=-1;if(t){const s=t.split(" ");s.length>1&&(e=parseInt(s[0]))}return e}getPetType(t){if(!t)return null;const e=t.split(" ");if(e.length>1){const s=parseInt(e[0]);return this._roomContentLoader?this._roomContentLoader.getPetNameForType(s):"pet"}return null}isRoomContentTypeLoaded(t){return this._roomContentLoader?this._roomContentLoader.getCollection(t)!==null:!1}getPetColorResult(t,e){return this._roomContentLoader?this._roomContentLoader.getPetColorResult(t,e):null}getPetColorResultsForTag(t,e){return this._roomContentLoader?this._roomContentLoader.getPetColorResultsForTag(t,e):null}deleteRoomObject(t,e){return!this._roomObjectEventHandler||e!==M.WALL?!1:this._roomObjectEventHandler.deleteWallItem(this._activeRoomId,t)}get connection(){return this._communication.connection}get sessionDataManager(){return this._sessionDataManager}set sessionDataManager(t){this._sessionDataManager=t}get roomSessionManager(){return this._roomSessionManager}set roomSessionManager(t){this._roomSessionManager=t}get roomManager(){return this._roomManager}set roomManager(t){this._roomManager=t}get objectEventHandler(){return this._roomObjectEventHandler}get roomRendererFactory(){return this._roomRendererFactory}get visualizationFactory(){return this._visualizationFactory}get logicFactory(){return this._logicFactory}get activeRoomId(){return this._activeRoomId}get ready(){return this._ready}get roomContentLoader(){return this._roomContentLoader}get isDecorating(){if(!this._roomSessionManager)return!1;const t=this._roomSessionManager.getSession(this._activeRoomId);return t&&t.isDecorating||!1}get useOffsetScrolling(){return!0}get selectedAvatarId(){return this._roomObjectEventHandler?this._roomObjectEventHandler.selectedAvatarId:-1}getRoomObjectCount(t,e){return this._roomManager==null?0:this._roomManager.getRoomInstance(t.toString()).getRoomObjectsForCategory(e).length}};ot.ROOM_OBJECT_ID=-1,ot.ROOM_OBJECT_TYPE="room",ot.CURSOR_OBJECT_ID=-2,ot.CURSOR_OBJECT_TYPE="tile_cursor",ot.ARROW_OBJECT_ID=-3,ot.ARROW_OBJECT_TYPE="selection_arrow",ot.OVERLAY="overlay",ot.OBJECT_ICON_SPRITE="object_icon_sprite",ot.DRAG_THRESHOLD=15,ot.TEMPORARY_ROOM="temporary_room";let so=ot;const b=class b{constructor(t,e=1){this._previewRoomId=1,this._currentPreviewObjectType=0,this._currentPreviewObjectCategory=0,this._currentPreviewObjectData="",this._currentPreviewRectangle=null,this._currentPreviewCanvasWidth=0,this._currentPreviewCanvasHeight=0,this._currentPreviewScale=64,this._backgroundColor=305148561,this._backgroundSprite=null,this._disableUpdate=!1,this._roomEngine=t,this._planeParser=new kt,this._previewRoomId=vo.makeRoomPreviewerId(e),this._addViewOffset=new K(0,0),this.onRoomObjectAdded=this.onRoomObjectAdded.bind(this),this.onRoomInitializedonRoomInitialized=this.onRoomInitializedonRoomInitialized.bind(this),this.isRoomEngineReady&&this._roomEngine.events&&(this._roomEngine.events.addEventListener(Z.ADDED,this.onRoomObjectAdded),this._roomEngine.events.addEventListener(Z.CONTENT_UPDATED,this.onRoomObjectAdded),this._roomEngine.events.addEventListener(Ct.INITIALIZED,this.onRoomInitializedonRoomInitialized)),this.createRoomForPreview()}dispose(){this.reset(!0),this.isRoomEngineReady&&this._roomEngine.events&&(this._roomEngine.events.removeEventListener(Z.ADDED,this.onRoomObjectAdded),this._roomEngine.events.removeEventListener(Z.CONTENT_UPDATED,this.onRoomObjectAdded),this._roomEngine.events.removeEventListener(Ct.INITIALIZED,this.onRoomInitializedonRoomInitialized)),this._backgroundSprite&&(this._backgroundSprite.destroy(),this._backgroundSprite=null),this._planeParser&&(this._planeParser.dispose(),this._planeParser=null)}createRoomForPreview(){if(this.isRoomEngineReady){const e=new kt;e.initializeTileMap(9,9);let s=1;for(;s<8;){let i=1;for(;i<8;)e.setTileHeight(i,s,0),i++;s++}e.initializeFromTileData(),this._roomEngine.createRoomInstance(this._previewRoomId,e.getMapData()),e.dispose()}}reset(t){this.isRoomEngineReady&&(this._roomEngine.removeRoomObjectFloor(this._previewRoomId,b.PREVIEW_OBJECT_ID),this._roomEngine.removeRoomObjectWall(this._previewRoomId,b.PREVIEW_OBJECT_ID),this._roomEngine.removeRoomObjectUser(this._previewRoomId,b.PREVIEW_OBJECT_ID),t||this.updatePreviewRoomView()),this._currentPreviewObjectCategory=M.MINIMUM}updatePreviewModel(t,e,s=!0){const i=new wo;i.flush(),i.parseModel(t,e,s);const r=this._roomEngine.getLegacyWallGeometry(this._previewRoomId);if(!r)return;this._planeParser.reset();const a=i.width,o=i.height;this._planeParser.initializeTileMap(a,o);const h=null;let _=-1,l=-1,c=0,f=0,p=0;for(;p<o;){let C=0;for(;C<a;){const L=i.getHeight(C,p);(p>0&&p<o-1||C>0&&C<a-1)&&L!=kt.TILE_BLOCKED&&h==null&&(i.getHeight(C,p-1)==kt.TILE_BLOCKED&&i.getHeight(C-1,p)==kt.TILE_BLOCKED&&i.getHeight(C,p+1)==kt.TILE_BLOCKED&&(_=C+.5,l=p,c=L,f=90),i.getHeight(C,p-1)==kt.TILE_BLOCKED&&i.getHeight(C-1,p)==kt.TILE_BLOCKED&&i.getHeight(C+1,p)==kt.TILE_BLOCKED&&(_=C,l=p+.5,c=L,f=180)),this._planeParser.setTileHeight(C,p,L),C++}p++}this._planeParser.setTileHeight(Math.floor(_),Math.floor(l),c),this._planeParser.initializeFromTileData(i.wallHeight),this._planeParser.setTileHeight(Math.floor(_),Math.floor(l),c+this._planeParser.wallHeight),r.scale=lh.DEFAULT_SCALE,r.initialize(a,o,this._planeParser.floorHeight);let m=i.height-1;for(;m>=0;){let C=i.width-1;for(;C>=0;)r.setHeight(C,m,this._planeParser.getTileHeight(C,m)),C--;m--}const O=this._planeParser.getMapData();O.doors.push({x:_,y:l,z:c,dir:f});const A=this.getRoomPreviewOwnRoomObject();A&&A.processUpdateMessage(new th(O))}addFurnitureIntoRoom(t,e,s=null,i=null){if(s||(s=new Ne),this.isRoomEngineReady&&(this.reset(!1),this._currentPreviewObjectType=t,this._currentPreviewObjectCategory=M.FLOOR,this._currentPreviewObjectData="",this._roomEngine.addFurnitureFloor(this._previewRoomId,b.PREVIEW_OBJECT_ID,t,new R(b.PREVIEW_OBJECT_LOCATION_X,b.PREVIEW_OBJECT_LOCATION_Y,0),e,0,s,NaN,-1,0,-1,"",!0,!1))){this._previousAutomaticStateChangeTime=nt(),this._automaticStateChange=!0;const r=this._roomEngine.getRoomObject(this._previewRoomId,b.PREVIEW_OBJECT_ID,this._currentPreviewObjectCategory);return r&&i&&r.model.setValue(g.FURNITURE_EXTRAS,i),this.updatePreviewRoomView(),b.PREVIEW_OBJECT_ID}return-1}addWallItemIntoRoom(t,e,s){if(this.isRoomEngineReady){if(this._currentPreviewObjectCategory===M.WALL&&this._currentPreviewObjectType===t&&this._currentPreviewObjectData===s)return b.PREVIEW_OBJECT_ID;if(this.reset(!1),this._currentPreviewObjectType=t,this._currentPreviewObjectCategory=M.WALL,this._currentPreviewObjectData=s,this._roomEngine.addFurnitureWall(this._previewRoomId,b.PREVIEW_OBJECT_ID,t,new R(.5,2.3,1.8),e,0,s,0,0,-1,"",!1))return this._previousAutomaticStateChangeTime=nt(),this._automaticStateChange=!0,this.updatePreviewRoomView(),b.PREVIEW_OBJECT_ID}return-1}addAvatarIntoRoom(t,e){return this.isRoomEngineReady?(this.reset(!1),this._currentPreviewObjectType=1,this._currentPreviewObjectCategory=M.UNIT,this._currentPreviewObjectData=t,this._roomEngine.addRoomObjectUser(this._previewRoomId,b.PREVIEW_OBJECT_ID,new R(b.PREVIEW_OBJECT_LOCATION_X,b.PREVIEW_OBJECT_LOCATION_Y,0),new R(90,0,0),135,pt.getTypeNumber(pt.USER),t)&&(this._previousAutomaticStateChangeTime=nt(),this._automaticStateChange=!0,this.updateUserGesture(1),this.updateUserEffect(e),this.updateUserPosture("std")),this.updatePreviewRoomView(),b.PREVIEW_OBJECT_ID):-1}addPetIntoRoom(t){return this.isRoomEngineReady?(this.reset(!1),this._currentPreviewObjectType=1,this._currentPreviewObjectCategory=M.UNIT,this._currentPreviewObjectData=t,this._roomEngine.addRoomObjectUser(this._previewRoomId,b.PREVIEW_OBJECT_ID,new R(b.PREVIEW_OBJECT_LOCATION_X,b.PREVIEW_OBJECT_LOCATION_Y,0),new R(90,0,0),90,pt.getTypeNumber(pt.PET),t)&&(this._previousAutomaticStateChangeTime=nt(),this._automaticStateChange=!1,this.updateUserGesture(1),this.updateUserPosture("std")),this.updatePreviewRoomView(),b.PREVIEW_OBJECT_ID):-1}updateUserPosture(t,e=""){this.isRoomEngineReady&&this._roomEngine.updateRoomObjectUserPosture(this._previewRoomId,b.PREVIEW_OBJECT_ID,t,e)}updateUserGesture(t){this.isRoomEngineReady&&this._roomEngine.updateRoomObjectUserGesture(this._previewRoomId,b.PREVIEW_OBJECT_ID,t)}updateUserEffect(t){this.isRoomEngineReady&&this._roomEngine.updateRoomObjectUserEffect(this._previewRoomId,b.PREVIEW_OBJECT_ID,t)}updateObjectUserFigure(t,e=null,s=null,i=!1){return this.isRoomEngineReady?this._roomEngine.updateRoomObjectUserFigure(this._previewRoomId,b.PREVIEW_OBJECT_ID,t,e,s,i):!1}updateObjectUserAction(t,e,s=null){this.isRoomEngineReady&&this._roomEngine.updateRoomObjectUserAction(this._previewRoomId,b.PREVIEW_OBJECT_ID,t,e,s)}updateObjectStuffData(t){this.isRoomEngineReady&&this._roomEngine.updateRoomObjectFloor(this._previewRoomId,b.PREVIEW_OBJECT_ID,null,null,t.state,t)}changeRoomObjectState(){this.isRoomEngineReady&&(this._automaticStateChange=!1,this._currentPreviewObjectCategory!==M.UNIT&&this._roomEngine.changeObjectState(this._previewRoomId,b.PREVIEW_OBJECT_ID,this._currentPreviewObjectCategory))}changeRoomObjectDirection(){if(this.isRoomEngineReady){const t=this._roomEngine.getRoomObject(this._previewRoomId,b.PREVIEW_OBJECT_ID,this._currentPreviewObjectCategory);if(!t)return;const e=this._roomEngine.objectEventHandler.getValidRoomObjectDirection(t,!0);switch(this._currentPreviewObjectCategory){case M.FLOOR:{const s=new R(b.PREVIEW_OBJECT_LOCATION_X,b.PREVIEW_OBJECT_LOCATION_Y),i=new R(e,e,e);this._roomEngine.updateRoomObjectFloor(this._previewRoomId,b.PREVIEW_OBJECT_ID,s,i,null,null);return}case M.WALL:return}}}checkAutomaticRoomObjectStateChange(){if(this._automaticStateChange){const t=nt();t>this._previousAutomaticStateChangeTime+b.AUTOMATIC_STATE_CHANGE_INTERVAL&&(this._previousAutomaticStateChangeTime=t,this.isRoomEngineReady&&this._roomEngine.changeObjectState(this._previewRoomId,b.PREVIEW_OBJECT_ID,this._currentPreviewObjectCategory))}}getRoomCanvas(t,e){if(this.isRoomEngineReady){const s=this._roomEngine.getRoomInstanceDisplay(this._previewRoomId,b.PREVIEW_CANVAS_ID,t,e,this._currentPreviewScale);if(s&&this._backgroundColor!==null){let r=this._backgroundSprite;r||(r=new xt(Ft.WHITE),s.addChildAt(r,0)),r.width=t,r.height=e,r.tint=this._backgroundColor}this._roomEngine.setRoomInstanceRenderingCanvasMask(this._previewRoomId,b.PREVIEW_CANVAS_ID,!0);const i=this._roomEngine.getRoomInstanceGeometry(this._previewRoomId,b.PREVIEW_CANVAS_ID);return i&&i.adjustLocation(new R(b.PREVIEW_OBJECT_LOCATION_X,b.PREVIEW_OBJECT_LOCATION_Y,0),30),this._currentPreviewCanvasWidth=t,this._currentPreviewCanvasHeight=e,s}return null}modifyRoomCanvas(t,e){this.isRoomEngineReady&&(this._currentPreviewCanvasWidth=t,this._currentPreviewCanvasHeight=e,this._backgroundSprite&&(this._backgroundSprite.width=t,this._backgroundSprite.height=e),this._roomEngine.initializeRoomInstanceRenderingCanvas(this._previewRoomId,b.PREVIEW_CANVAS_ID,t,e))}set addViewOffset(t){this._addViewOffset=t}get addViewOffset(){return this._addViewOffset}updatePreviewObjectBoundingRectangle(t){const e=this._roomEngine.getRoomObjectBoundingRectangle(this._previewRoomId,b.PREVIEW_OBJECT_ID,this._currentPreviewObjectCategory,b.PREVIEW_CANVAS_ID);if(e&&t)if(e.x+=-(this._currentPreviewCanvasWidth>>1),e.y+=-(this._currentPreviewCanvasHeight>>1),e.x+=-t.x,e.y+=-t.y,!this._currentPreviewRectangle)this._currentPreviewRectangle=e;else{const s=this._currentPreviewRectangle.clone().enlarge(e);(s.width-this._currentPreviewRectangle.width>this._currentPreviewCanvasWidth-this._currentPreviewRectangle.width>>1||s.height-this._currentPreviewRectangle.height>this._currentPreviewCanvasHeight-this._currentPreviewRectangle.height>>1||this._currentPreviewRectangle.width<1||this._currentPreviewRectangle.height<1)&&(this._currentPreviewRectangle=s)}}validatePreviewSize(t){if(this._currentPreviewRectangle.width<1||this._currentPreviewRectangle.height<1)return t;if(this.isRoomEngineReady){const e=this._roomEngine.getRoomInstanceGeometry(this._previewRoomId,b.PREVIEW_CANVAS_ID);this._currentPreviewRectangle.width>this._currentPreviewCanvasWidth*(1+b.ALLOWED_IMAGE_CUT)||this._currentPreviewRectangle.height>this._currentPreviewCanvasHeight*(1+b.ALLOWED_IMAGE_CUT)?b.ZOOM_ENABLED?this._roomEngine.getRoomInstanceRenderingCanvasScale(this._previewRoomId,b.PREVIEW_CANVAS_ID)!==.5&&(this._roomEngine.setRoomInstanceRenderingCanvasScale(this._previewRoomId,b.PREVIEW_CANVAS_ID,.5,null,null),this._currentPreviewScale=b.SCALE_SMALL,this._currentPreviewNeedsZoomOut=!0,t.x=t.x>>1,t.y=t.y>>1,this._currentPreviewRectangle.x=this._currentPreviewRectangle.x>>2,this._currentPreviewRectangle.y=this._currentPreviewRectangle.y>>2,this._currentPreviewRectangle.width=this._currentPreviewRectangle.width>>2,this._currentPreviewRectangle.height=this._currentPreviewRectangle.height>>2):e.isZoomedIn()&&(e.performZoomOut(),this._currentPreviewScale=b.SCALE_SMALL,this._currentPreviewNeedsZoomOut=!0):this._currentPreviewNeedsZoomOut||(b.ZOOM_ENABLED?this._roomEngine.getRoomInstanceRenderingCanvasScale(this._previewRoomId,b.PREVIEW_CANVAS_ID)!==1&&(this._roomEngine.setRoomInstanceRenderingCanvasScale(this._previewRoomId,b.PREVIEW_CANVAS_ID,1,null,null),this._currentPreviewScale=b.SCALE_NORMAL):e.isZoomedIn()||(e.performZoomIn(),this._currentPreviewScale=b.SCALE_NORMAL))}return t}zoomIn(){this.isRoomEngineReady&&(b.ZOOM_ENABLED?this._roomEngine.setRoomInstanceRenderingCanvasScale(this._previewRoomId,b.PREVIEW_CANVAS_ID,1):this._roomEngine.getRoomInstanceGeometry(this._previewRoomId,b.PREVIEW_CANVAS_ID).performZoomIn()),this._currentPreviewScale=b.SCALE_NORMAL}zoomOut(){this.isRoomEngineReady&&(b.ZOOM_ENABLED?this._roomEngine.setRoomInstanceRenderingCanvasScale(this._previewRoomId,b.PREVIEW_CANVAS_ID,.5):this._roomEngine.getRoomInstanceGeometry(this._previewRoomId,b.PREVIEW_CANVAS_ID).performZoomOut()),this._currentPreviewScale=b.SCALE_SMALL}updateAvatarDirection(t,e){this.isRoomEngineReady&&this._roomEngine.updateRoomObjectUserLocation(this._previewRoomId,b.PREVIEW_OBJECT_ID,new R(b.PREVIEW_OBJECT_LOCATION_X,b.PREVIEW_OBJECT_LOCATION_Y,0),new R(b.PREVIEW_OBJECT_LOCATION_X,b.PREVIEW_OBJECT_LOCATION_Y,0),!1,0,new R(t*45,0,0),e*45)}updateObjectRoom(t=null,e=null,s=null,i=!1){return this.isRoomEngineReady?this._roomEngine.updateRoomInstancePlaneType(this._previewRoomId,t,e,s,i):!1}updateRoomWallsAndFloorVisibility(t,e=!0){this.isRoomEngineReady&&this._roomEngine.updateRoomInstancePlaneVisibility(this._previewRoomId,t,e)}getCanvasOffset(t){if(this._currentPreviewRectangle.width<1||this._currentPreviewRectangle.height<1)return t;let e=-(this._currentPreviewRectangle.left+this._currentPreviewRectangle.right)>>1,s=-(this._currentPreviewRectangle.top+this._currentPreviewRectangle.bottom)>>1;const i=this._currentPreviewCanvasHeight-this._currentPreviewRectangle.height>>1;i>10?s=s+Math.min(15,i-10):this._currentPreviewObjectCategory!==M.UNIT?s=s+(5-Math.max(0,i/2)):s=s-(5-Math.min(0,i/2)),s=s+this._addViewOffset.y,e=e+this._addViewOffset.x;const r=e-t.x,a=s-t.y;if(r!==0||a!==0){const o=Math.sqrt(r*r+a*a);return o>10&&(e=t.x+r*10/o,s=t.y+a*10/o),new K(e,s)}return null}updatePreviewRoomView(t=!1){if(!(this._disableUpdate&&!t)&&(this.checkAutomaticRoomObjectStateChange(),this.isRoomEngineReady)){let e=this._roomEngine.getRoomInstanceRenderingCanvasOffset(this._previewRoomId,b.PREVIEW_CANVAS_ID);if(e&&(this.updatePreviewObjectBoundingRectangle(e),this._currentPreviewRectangle)){const s=this._currentPreviewScale;e=this.validatePreviewSize(e);const i=this.getCanvasOffset(e);i&&this._roomEngine.setRoomInstanceRenderingCanvasOffset(this._previewRoomId,b.PREVIEW_CANVAS_ID,i),this._currentPreviewScale!==s&&(this._currentPreviewRectangle=null)}}}set disableUpdate(t){this._disableUpdate=t}set disableRoomEngineUpdate(t){this.isRoomEngineReady&&this._roomEngine.disableUpdate(t)}onRoomInitializedonRoomInitialized(t){if(t)switch(t.type){case Ct.INITIALIZED:t.roomId===this._previewRoomId&&this.isRoomEngineReady&&this._roomEngine.updateRoomInstancePlaneType(this._previewRoomId,"110","99999");return}}onRoomObjectAdded(t){if(t.roomId===this._previewRoomId&&t.objectId===b.PREVIEW_OBJECT_ID&&t.category===this._currentPreviewObjectCategory){this._currentPreviewRectangle=null,this._currentPreviewNeedsZoomOut=!1;const e=this._roomEngine.getRoomObject(t.roomId,t.objectId,t.category);if(e&&e.model&&t.category===M.WALL){const s=e.model.getValue(g.FURNITURE_SIZE_Z),i=e.model.getValue(g.FURNITURE_CENTER_Z);(s!==null||i!==null)&&this._roomEngine.updateRoomObjectWallLocation(t.roomId,t.objectId,new R(.5,2.3,(3.6-s)/2+i))}}}updateRoomEngine(){this.isRoomEngineReady&&this._roomEngine.runUpdate()}getRenderingCanvas(){const t=this._roomEngine.getRoomInstanceRenderingCanvas(this._previewRoomId,b.PREVIEW_CANVAS_ID);return t||null}getGenericRoomObjectImage(t,e,s,i,r,a=0,o=null,h=null,_=-1,l=-1,c=null){return this.isRoomEngineReady?this._roomEngine.getGenericRoomObjectImage(t,e,s,i,r,a,o,h,_,l,c):null}getRoomObjectImage(t,e,s,i=0){return this.isRoomEngineReady?this._roomEngine.getRoomObjectImage(this._previewRoomId,b.PREVIEW_OBJECT_ID,this._currentPreviewObjectCategory,t,e,s,i):null}getRoomObjectCurrentImage(){if(this.isRoomEngineReady){const t=this._roomEngine.getRoomObject(this._previewRoomId,b.PREVIEW_OBJECT_ID,this._currentPreviewObjectCategory);if(t&&t.visualization)return t.visualization.getImage(16777215,-1)}return null}getRoomPreviewObject(){if(this.isRoomEngineReady){const t=this._roomEngine.getRoomObject(this._previewRoomId,b.PREVIEW_OBJECT_ID,this._currentPreviewObjectCategory);if(t)return t}return null}getRoomPreviewOwnRoomObject(){if(this.isRoomEngineReady){const t=this._roomEngine.getRoomObject(this._previewRoomId,so.ROOM_OBJECT_ID,M.ROOM);if(t)return t}return null}get isRoomEngineReady(){return this._roomEngine&&this._roomEngine.ready}get roomId(){return this._previewRoomId}get backgroundColor(){return this._backgroundColor}set backgroundColor(t){this._backgroundColor=t}get width(){return this._currentPreviewCanvasWidth}get height(){return this._currentPreviewCanvasHeight}};b.SCALE_NORMAL=64,b.SCALE_SMALL=32,b.PREVIEW_COUNTER=0,b.PREVIEW_CANVAS_ID=1,b.PREVIEW_OBJECT_ID=1,b.PREVIEW_OBJECT_LOCATION_X=2,b.PREVIEW_OBJECT_LOCATION_Y=2,b.ALLOWED_IMAGE_CUT=.25,b.AUTOMATIC_STATE_CHANGE_INTERVAL=2500,b.ZOOM_ENABLED=!0;let cg=b;class ug{constructor(t,e){this._image=t,this._placeHolder=e}get image(){return this._image}get placeHolder(){return this._placeHolder}}class $2{constructor(t){this._code=t,this._parts=[]}get code(){return this._code}get parts(){return this._parts}}const Gt=class Gt{constructor(t,e=0,s=0,i=0){this.type=t,this.key=e,this.color=s,this.position=i}get code(){return this.key===0?null:Gt.getCode(this.type,this.key,this.color,this.position)}static getCode(t,e,s,i){return(t===Gt.BASE?t:e>=100?Gt.SYMBOL_ALT:Gt.SYMBOL)+(e<10?"0":"")+(t===Gt.BASE?e:e>=100?e-100:e)+(s<10?"0":"")+s+i}calculatePosition(t){const e=this.calculateGridPos(this.position);let s=Gt.CELL_WIDTH*e.x+Gt.CELL_WIDTH/2-t.width/2,i=Gt.CELL_HEIGHT*e.y+Gt.CELL_HEIGHT/2-t.height/2;return s<0&&(s=0),s+t.width>Gt.IMAGE_WIDTH&&(s=Gt.IMAGE_WIDTH-t.width),i<0&&(i=0),i+t.height>Gt.IMAGE_HEIGHT&&(i=Gt.IMAGE_HEIGHT-t.height),new lo(Math.floor(s),Math.floor(i))}calculateGridPos(t){const e=new lo;return e.x=Math.floor(t%3),e.y=Math.floor(t/3),e}};Gt.BASE="b",Gt.SYMBOL="s",Gt.SYMBOL_ALT="t",Gt.BASE_PART=0,Gt.LAYER_PART=1,Gt.IMAGE_WIDTH=39,Gt.IMAGE_HEIGHT=39,Gt.CELL_WIDTH=13,Gt.CELL_HEIGHT=13;let ea=Gt;const as=class as{constructor(t,e){this._assets=t,this._sessionDataManager=e,this._groupBases=new Map,this._groupSymbols=new Map,this._groupPartColors=new Map,this._requestedBadges=new Map,this._groupBadgesQueue=new Map,this._readyToGenerateGroupBadges=!1}init(){if(this._sessionDataManager&&this._sessionDataManager.communication){this._messages=[new Bg(this.onGroupBadgePartsEvent.bind(this))];for(const t of this._messages)this._sessionDataManager.communication.registerMessageEvent(t)}}dispose(){if(this._messages&&this._messages.length){for(const t of this._messages)this._sessionDataManager.communication.removeMessageEvent(t);this._messages=null}this._sessionDataManager=null}getBadgeImage(t,e=as.NORMAL_BADGE,s=!0){let i=this.getBadgeTexture(t,e);return!i&&s&&(i=this.getBadgePlaceholder()),i}getBadgeInfo(t){const e=this.getBadgeTexture(t);return e?new ug(e,!1):new ug(this.getBadgePlaceholder(),!0)}loadBadgeImage(t,e=as.NORMAL_BADGE){return this._assets.getTexture(this.getBadgeUrl(t,e))?t:(this.getBadgeTexture(t,e),null)}getBadgeTexture(t,e=as.NORMAL_BADGE){const s=this.getBadgeUrl(t,e);if(!s||!s.length)return null;const i=this._assets.getTexture(s);if(i)return i.clone();if(e===as.NORMAL_BADGE){if(this._requestedBadges.get(t))return null;this._requestedBadges.set(t,!0),this._assets.downloadAsset(s).then(r=>{if(!r)return;this._requestedBadges.delete(t);const a=this._assets.getTexture(s);a&&this._sessionDataManager&&this._sessionDataManager.events.dispatchEvent(new Hn(t,a.clone()))}).catch(r=>{})}else if(e===as.GROUP_BADGE){if(this._groupBadgesQueue.get(t))return;this._groupBadgesQueue.set(t,!0),this._readyToGenerateGroupBadges&&this.loadGroupBadge(t)}return null}getBadgePlaceholder(){const t=q.getValue("images.url")+"/loading_icon.png",e=this._assets.getTexture(t);return e?e.clone():null}getBadgeUrl(t,e=as.NORMAL_BADGE){let s=null;switch(e){case as.NORMAL_BADGE:s=q.getValue("badge.asset.url").replace("%badgename%",t);break;case as.GROUP_BADGE:s=t;break}return s}loadGroupBadge(t){const e=new $2(t),s=[...t.matchAll(/[b|s][0-9]{4,6}/g)];for(const i of s){const r=i[0],a=r.length===6,o=r[0],h=parseInt(r.slice(1,a?3:4)),_=parseInt(r.slice(a?3:4,a?5:6)),l=r.length<6?0:parseInt(r.slice(a?5:6,a?6:7)),c=new ea(o,h,_,l);e.parts.push(c)}this.renderGroupBadge(e)}renderGroupBadge(t){const e=new Rs,s=new xt(Rg.EMPTY);s.width=ea.IMAGE_WIDTH,s.height=ea.IMAGE_HEIGHT,e.addChild(s);for(const r of t.parts){let a=!0;const o=r.type==="b"?this._groupBases.get(r.key):this._groupSymbols.get(r.key);if(o)for(const h of o){if(!h||!h.length)continue;const _=this._assets.getTexture(`badgepart_${h}`);if(!_)continue;const{x:l,y:c}=r.calculatePosition(_),f=new xt(_);f.position.set(l,c),a&&(f.tint=parseInt(this._groupPartColors.get(r.color),16)),a=!1,e.addChild(f)}}this._requestedBadges.delete(t.code),this._groupBadgesQueue.delete(t.code);const i=Ut.generateTexture(e);this._assets.setTexture(t.code,i),this._sessionDataManager&&this._sessionDataManager.events.dispatchEvent(new Hn(t.code,i))}onGroupBadgePartsEvent(t){if(!t)return;const e=t.getParser();if(e){e.bases.forEach((s,i)=>this._groupBases.set(i,s.map(r=>r.replace(".png","").replace(".gif","")))),e.symbols.forEach((s,i)=>this._groupSymbols.set(i,s.map(r=>r.replace(".png","").replace(".gif","")))),this._groupPartColors=e.partColors,this._readyToGenerateGroupBadges=!0;for(const s of this._groupBadgesQueue.keys())this.loadGroupBadge(s)}}get disposed(){return!!this._sessionDataManager}};as.GROUP_BADGE="group_badge",as.NORMAL_BADGE="normal_badge";let nn=as;class dg{constructor(t,e,s,i,r,a,o,h,_,l,c,f,p,m,O,A,C,L,D,U,P,v,F,$,et,at,At,oe,zt){this._type=t,this._id=e,this._fullName=s,this._className=i,this._category=r,this._revision=h,this._tileSizeX=_,this._tileSizeY=l,this._tileSizeZ=c,this._colors=f,this._hasIndexedColor=p,this._colourIndex=m,this._localizedName=a,this._description=o,this._adUrl=O,this._purchaseOfferId=A,this._purchaseCouldBeUsedForBuyout=C,this._rentOfferId=L,this._rentCouldBeUsedForBuyout=D,this._customParams=P,this._specialType=v,this._availableForBuildersClub=U,this._canStandOn=F,this._canSitOn=$,this._canLayOn=et,this._excludedFromDynamic=at,this._furniLine=At,this._environment=oe,this._rare=zt}get type(){return this._type}get id(){return this._id}get className(){return this._className}set className(t){this._className=t}get fullName(){return this._fullName}get category(){return this._category}get hasIndexedColor(){return this._hasIndexedColor}get colorIndex(){return this._colourIndex}get revision(){return this._revision}get tileSizeX(){return this._tileSizeX}get tileSizeY(){return this._tileSizeY}get tileSizeZ(){return this._tileSizeZ}get colors(){return this._colors}get name(){return this._localizedName}get description(){return this._description}get adUrl(){return this._adUrl}get purchaseOfferId(){return this._purchaseOfferId}get customParams(){return this._customParams}get specialType(){return this._specialType}get rentOfferId(){return this._rentOfferId}get purchaseCouldBeUsedForBuyout(){return this._purchaseCouldBeUsedForBuyout}get rentCouldBeUsedForBuyout(){return this._rentCouldBeUsedForBuyout}get availableForBuildersClub(){return this._availableForBuildersClub}get canStandOn(){return this._canStandOn}get canSitOn(){return this._canSitOn}get canLayOn(){return this._canLayOn}get isExternalImage(){return this._className.indexOf("external_image")!==-1}get excludeDynamic(){return this._excludedFromDynamic}get furniLine(){return this._furniLine}get environment(){return this._environment}get rare(){return this._rare}}const Fn=class Fn extends $e{constructor(t,e,s){super(),this._floorItems=t,this._wallItems=e,this._localization=s}loadFurnitureData(t){t&&fetch(t).then(e=>e.json()).then(e=>this.onFurnitureDataLoaded(e)).catch(e=>this.onFurnitureDataError(e))}onFurnitureDataLoaded(t){t&&((typeof t.roomitemtypes>"u"||typeof t.wallitemtypes>"u")&&j.warn("Could not find `roomitemtypes` or `wallitemtypes` in furnidata."),t.roomitemtypes&&this.parseFloorItems(t.roomitemtypes),t.wallitemtypes&&this.parseWallItems(t.wallitemtypes),this.dispatchEvent(new gt(Fn.FURNITURE_DATA_READY)))}onFurnitureDataError(t){t&&(j.error(t),this.dispatchEvent(new gt(Fn.FURNITURE_DATA_ERROR)))}parseFloorItems(t){if(!(!t||!t.furnitype))for(const e of t.furnitype){if(!e)continue;const s=[];if(e.partcolors)for(const _ of e.partcolors.color){let l=_;l.charAt(0)==="#"&&(l=l.replace("#","")),s.push(parseInt(l,16))}const i=e.classname.split("*"),r=i[0],a=i.length>1?parseInt(i[1]):0,o=i.length>1,h=new dg(vr.FLOOR,e.id,e.classname,r,e.category,e.name,e.description,e.revision,e.xdim,e.ydim,0,s,o,a,e.adurl,e.offerid,e.buyout,e.rentofferid,e.rentbuyout,e.bc,e.customparams,e.specialtype,e.canstandon,e.cansiton,e.canlayon,e.excludeddynamic,e.furniline,e.environment,e.rare);this._floorItems.set(h.id,h),this.updateLocalizations(h)}}parseWallItems(t){if(!(!t||!t.furnitype))for(const e of t.furnitype){if(!e)continue;const s=new dg(vr.WALL,e.id,e.classname,e.classname,e.category,e.name,e.description,e.revision,0,0,0,null,!1,0,e.adurl,e.offerid,e.buyout,e.rentofferid,e.rentbuyout,e.bc,null,e.specialtype,!1,!1,!1,e.excludeddynamic,e.furniline,e.environment,e.rare);this._wallItems.set(s.id,s),this.updateLocalizations(s)}}updateLocalizations(t){if(this._localization)switch(t.type){case vr.FLOOR:this._localization.setValue("roomItem.name."+t.id,t.name),this._localization.setValue("roomItem.desc."+t.id,t.description);return;case vr.WALL:this._localization.setValue("wallItem.name."+t.id,t.name),this._localization.setValue("wallItem.desc."+t.id,t.description);return}}};Fn.FURNITURE_DATA_READY="FDP_FURNITURE_DATA_READY",Fn.FURNITURE_DATA_ERROR="FDP_FURNITURE_DATA_ERROR";let sa=Fn;class tY{constructor(t){this._sessionDataManager=t,this._groupBadges=new Map}init(){if(this._sessionDataManager&&this._sessionDataManager.communication){this._messages=[new kn(this.onRoomReadyMessageEvent.bind(this)),new Pf(this.onGroupBadgesEvent.bind(this))];for(const t of this._messages)this._sessionDataManager.communication.registerMessageEvent(t)}}dispose(){if(!this.disposed){if(this._messages&&this._messages.length){for(const t of this._messages)this._sessionDataManager.communication.removeMessageEvent(t);this._messages=null}this._groupBadges=null,this._sessionDataManager=null}}onRoomReadyMessageEvent(t){this._sessionDataManager.send(new nT)}onGroupBadgesEvent(t){const e=t.getParser();for(const[s,i]of e.badges.entries())this._groupBadges.set(s,i)}getGroupBadge(t){return this._groupBadges.get(t)}get disposed(){return!!this._sessionDataManager}}const Ya=class Ya{};Ya.NO_CLUB=0,Ya.CLUB=1,Ya.VIP=2;let Eg=Ya;class Cs extends Ye{constructor(t,e){super(),this._connection=t,this._listener=e,this._roomId=0}onDispose(){this._connection=null,this._listener=null}setRoomId(t){this._roomId=t}get connection(){return this._connection}get listener(){return this._listener}get roomId(){return this._roomId}}class eY extends Cs{constructor(t,e){super(t,e),t.addMessageEvent(new Yc(this.onRoomGenericError.bind(this)))}onRoomGenericError(t){if(!(t instanceof Yc))return;const e=t.getParser();if(!e)return;const s=this.listener.getSession(this.roomId);if(!s)return;let i=null;switch(e.errorCode){case Dl.KICKED_OUT_OF_ROOM:i=ce.RSEME_KICKED;break;default:return}!i||i.length==0||this.listener.events.dispatchEvent(new ce(i,s))}}class sY extends Cs{constructor(t,e){super(t,e),t.addMessageEvent(new qg(this.onOpenPetPackageRequested.bind(this))),t.addMessageEvent(new Qg(this.onOpenPetPackageResult.bind(this)))}onOpenPetPackageRequested(t){if(!this.listener)return;const e=t.getParser();if(!e)return;const s=this.listener.getSession(this.roomId);s&&this.listener.events.dispatchEvent(new $r($r.RSOPPE_OPEN_PET_PACKAGE_REQUESTED,s,e.objectId,e.figureData,0,null))}onOpenPetPackageResult(t){if(!this.listener)return;const e=t.getParser();if(!e)return;const s=this.listener.getSession(this.roomId);s&&this.listener.events.dispatchEvent(new $r($r.RSOPPE_OPEN_PET_PACKAGE_RESULT,s,e.objectId,null,e.nameValidationStatus,e.nameValidationInfo))}}class iY extends Cs{constructor(t,e){super(t,e),t.addMessageEvent(new $g(this.onPollContentsEvent.bind(this))),t.addMessageEvent(new ef(this.onPollOfferEvent.bind(this))),t.addMessageEvent(new tf(this.onPollErrorEvent.bind(this))),t.addMessageEvent(new of(this.onStartRoomPollEvent.bind(this))),t.addMessageEvent(new af(this.onRoomPollResultEvent.bind(this)))}onPollContentsEvent(t){if(!this.listener)return;const e=this.listener.getSession(this.roomId);if(!e)return;const s=t.getParser();if(!s)return;const i=new Ni(Ni.CONTENT,e,s.id);i.startMessage=s.startMessage,i.endMessage=s.endMessage,i.numQuestions=s.numQuestions,i.questionArray=s.questionArray,i.npsPoll=s.npsPoll,this.listener.events.dispatchEvent(i)}onPollOfferEvent(t){if(!this.listener)return;const e=this.listener.getSession(this.roomId);if(!e)return;const s=t.getParser();if(!s)return;const i=new Ni(Ni.OFFER,e,s.id);i.summary=s.headline,i.summary=s.summary,this.listener.events.dispatchEvent(i)}onPollErrorEvent(t){if(!this.listener)return;const e=this.listener.getSession(this.roomId);if(!e||!t.getParser())return;const i=new Ni(Ni.ERROR,e,-1);i.headline="???",i.summary="???",this.listener.events.dispatchEvent(i)}onStartRoomPollEvent(t){if(!this.listener)return;const e=this.listener.getSession(this.roomId);if(!e)return;const s=t.getParser();if(!s)return;const i=new tn(tn.VOTE_QUESTION,e,s.question,s.choices);this.listener.events.dispatchEvent(i)}onRoomPollResultEvent(t){if(!this.listener)return;const e=this.listener.getSession(this.roomId);if(!e)return;const s=t.getParser();if(!s)return;const i=new tn(tn.VOTE_RESULT,e,s.question,s.choices,s.SafeStr_7651,s.SafeStr_7654);this.listener.events.dispatchEvent(i)}}class rY extends Cs{constructor(t,e){super(t,e),t.addMessageEvent(new zd(this.onRoomUnitChatEvent.bind(this))),t.addMessageEvent(new jo(this.onRoomUnitChatEvent.bind(this))),t.addMessageEvent(new zo(this.onRoomUnitChatEvent.bind(this))),t.addMessageEvent(new Tf(this.onRoomUnitHandItemReceivedEvent.bind(this))),t.addMessageEvent(new Ff(this.onRespectReceivedEvent.bind(this))),t.addMessageEvent(new vf(this.onPetRespectNoficationEvent.bind(this))),t.addMessageEvent(new bf(this.onPetSupplementedNotificationEvent.bind(this))),t.addMessageEvent(new ff(this.onFloodControlEvent.bind(this))),t.addMessageEvent(new If(this.onRemainingMuteEvent.bind(this)))}onRoomUnitChatEvent(t){if(!this.listener)return;const e=this.listener.getSession(this.roomId);if(!e)return;const s=t.getParser();if(!s)return;let i=Nt.CHAT_TYPE_SPEAK;t instanceof jo?i=Nt.CHAT_TYPE_SHOUT:t instanceof zo&&(i=Nt.CHAT_TYPE_WHISPER);const r=new Nt(Nt.CHAT_EVENT,e,s.roomIndex,s.message,i,s.bubble,s.chatColours);this.listener.events.dispatchEvent(r)}onRoomUnitHandItemReceivedEvent(t){if(!this.listener)return;const e=this.listener.getSession(this.roomId);if(!e)return;const s=t.getParser();s&&this.listener.events.dispatchEvent(new Nt(Nt.CHAT_EVENT,e,s.giverUserId,"",Nt.CHAT_TYPE_HAND_ITEM_RECEIVED,ar.GENERIC,null,s.handItemType))}onRespectReceivedEvent(t){if(!this.listener)return;const e=this.listener.getSession(this.roomId);if(!e)return;const s=t.getParser();if(!s)return;const i=e.userDataManager.getUserData(s.userId);i&&this.listener.events.dispatchEvent(new Nt(Nt.CHAT_EVENT,e,i.roomIndex,"",Nt.CHAT_TYPE_RESPECT,ar.GENERIC))}onPetRespectNoficationEvent(t){if(!this.listener)return;const e=this.listener.getSession(this.roomId);if(!e)return;const s=t.getParser();if(!s)return;const i=e.userDataManager.getPetData(s.petData.id);if(!i)return;let r=Nt.CHAT_TYPE_PETRESPECT;s.isTreat&&(r=Nt.CHAT_TYPE_PETTREAT),this.listener.events.dispatchEvent(new Nt(Nt.CHAT_EVENT,e,i.roomIndex,"",r,ar.GENERIC))}onPetSupplementedNotificationEvent(t){if(!this.listener)return;const e=this.listener.getSession(this.roomId);if(!e)return;const s=t.getParser();if(!s)return;const i=e.userDataManager.getPetData(s.petId);if(!i)return;let r=-1;const a=e.userDataManager.getUserData(s.userId);a&&(r=a.roomIndex);let o=Nt.CHAT_TYPE_PETREVIVE;switch(s.supplementType){case ta.REVIVE:o=Nt.CHAT_TYPE_PETREVIVE;break;case ta.REBREED_FERTILIZER:o=Nt.CHAT_TYPE_PET_REBREED_FERTILIZE;break;case ta.SPEED_FERTILIZER:o=Nt.CHAT_TYPE_PET_SPEED_FERTILIZE;break}this.listener.events.dispatchEvent(new Nt(Nt.CHAT_EVENT,e,i.roomIndex,"",o,ar.GENERIC,null,r))}onFloodControlEvent(t){if(!this.listener)return;const e=this.listener.getSession(this.roomId);if(!e)return;const s=t.getParser();if(!s)return;const i=s.seconds;this.listener.events.dispatchEvent(new Nt(Nt.FLOOD_EVENT,e,-1,i.toString(),0,0))}onRemainingMuteEvent(t){if(!this.listener)return;const e=this.listener.getSession(this.roomId);if(!e)return;const s=t.getParser();s&&this.listener.events.dispatchEvent(new Nt(Nt.CHAT_EVENT,e,e.ownRoomIndex,"",Nt.CHAT_TYPE_MUTE_REMAINING,ar.GENERIC,null,s.seconds))}}class nY extends Cs{constructor(t,e){super(t,e),t.addMessageEvent(new jc(this.onGetGuestRoomResultEvent.bind(this)))}onGetGuestRoomResultEvent(t){if(!(t instanceof jc))return;const e=t.getParser();if(!e||e.roomForward)return;const s=this.listener.getSession(this.roomId);if(!s)return;const i=e.data;s.tradeMode=i.tradeMode,s.isGuildRoom=i.habboGroupId!==0,s.doorMode=i.doorMode,s.allowPets=i.allowPets,s.moderationSettings=e.moderation,this.listener.events.dispatchEvent(new Mo(Mo.RSDUE_ALLOW_PETS,s)),this.listener.events.dispatchEvent(new tt(tt.ROOM_DATA,s))}}class aY extends Cs{constructor(t,e){super(t,e),t.addMessageEvent(new _f(this.onRoomDimmerPresets.bind(this)))}onRoomDimmerPresets(t){if(!t)return;const e=t.getParser();if(!e)return;const s=this.listener.getSession(this.roomId);if(!s)return;const i=new So(So.ROOM_DIMMER_PRESETS,s);i.selectedPresetId=e.selectedPresetId;let r=0;for(;r<e.presetCount;){const a=e.getPreset(r);a&&i.storePreset(a.id,a.type,a.color,a.brightness),r++}this.listener&&this.listener.events.dispatchEvent(i)}}class oY extends Cs{constructor(t,e){super(t,e),t.addMessageEvent(new Xc(this.onRoomRightsEvent.bind(this))),t.addMessageEvent(new Kc(this.onRoomRightsClearEvent.bind(this))),t.addMessageEvent(new qc(this.onRoomRightsOwnerEvent.bind(this)))}onRoomRightsEvent(t){if(!(t instanceof Xc))return;const e=this.listener.getSession(this.roomId);e&&e.setControllerLevel(t.getParser().controllerLevel)}onRoomRightsClearEvent(t){if(!(t instanceof Kc))return;const e=this.listener.getSession(this.roomId);e&&e.setControllerLevel(Ii.NONE)}onRoomRightsOwnerEvent(t){if(!(t instanceof qc))return;const e=this.listener.getSession(this.roomId);e&&e.setRoomOwner()}}class hY extends Cs{constructor(t,e){super(t,e),t&&t.addMessageEvent(new zg(this.onFurnitureGiftOpenedEvent.bind(this)))}onFurnitureGiftOpenedEvent(t){if(!t)return;const e=t.getParser();if(!e)return;const s=this.listener.getSession(this.roomId);s&&this.listener&&this.listener.events&&this.listener.events.dispatchEvent(new Co(Co.RSPE_PRESENT_OPENED,s,e.classId,e.itemType,e.productCode,e.placedItemId,e.placedItemType,e.placedInRoom,e.petFigureString))}}const ci=class ci extends Cs{constructor(t,e){super(t,e),t.addMessageEvent(new Qc(this.onRoomEnterEvent.bind(this))),t.addMessageEvent(new kn(this.onRoomReadyMessageEvent.bind(this))),t.addMessageEvent(new Vc(this.onDesktopViewEvent.bind(this))),t.addMessageEvent(new kc(this.onRoomDoorbellAcceptedEvent.bind(this))),t.addMessageEvent(new Hc(this.onRoomDoorbellRejectedEvent.bind(this))),t.addMessageEvent(new gf(this.onYouAreSpectatorMessageEvent.bind(this)))}onRoomEnterEvent(t){t instanceof Qc&&this.listener&&this.listener.sessionUpdate(this.roomId,ci.RS_CONNECTED)}onRoomReadyMessageEvent(t){if(!(t instanceof kn))return;const e=this.roomId,s=t.getParser().roomId;this.listener&&(this.listener.sessionReinitialize(e,s),this.listener.sessionUpdate(this.roomId,ci.RS_READY))}onDesktopViewEvent(t){t instanceof Vc&&this.listener&&this.listener.sessionUpdate(this.roomId,ci.RS_DISCONNECTED)}onRoomDoorbellAcceptedEvent(t){if(!(t instanceof kc)||!this.listener)return;const e=t.getParser();if(!e)return;const s=e.userName;if(!s||!s.length)this.connection.send(new GI(this.roomId));else if(this.listener.events){const i=this.listener.getSession(this.roomId);if(!i)return;this.listener.events.dispatchEvent(new qi(qi.RSDE_ACCEPTED,i,s))}}onRoomDoorbellRejectedEvent(t){if(!(t instanceof Hc)||!this.listener)return;const e=t.getParser();if(!e)return;const s=e.userName;if(!s||!s.length)this.listener.sessionUpdate(this.roomId,ci.RS_DISCONNECTED);else if(this.listener.events){const i=this.listener.getSession(this.roomId);if(!i)return;this.listener.events.dispatchEvent(new qi(qi.RSDE_REJECTED,i,s))}}onYouAreSpectatorMessageEvent(t){if(this.listener){const e=this.listener.getSession(this.roomId);if(!e)return;e.isSpectator=!0,this.listener.events.dispatchEvent(new No(No.SPECTATOR_MODE,e))}}};ci.RS_CONNECTED="RS_CONNECTED",ci.RS_READY="RS_READY",ci.RS_DISCONNECTED="RS_DISCONNECTED";let an=ci;class _Y{constructor(){this._adultLevel=7}get id(){return this._id}set id(t){this._id=t}get level(){return this._level}set level(t){this._level=t}get maximumLevel(){return this._maximumLevel}set maximumLevel(t){this._maximumLevel=t}get experience(){return this._experience}set experience(t){this._experience=t}get levelExperienceGoal(){return this._levelExperienceGoal}set levelExperienceGoal(t){this._levelExperienceGoal=t}get energy(){return this._energy}set energy(t){this._energy=t}get maximumEnergy(){return this._maximumEnergy}set maximumEnergy(t){this._maximumEnergy=t}get happyness(){return this._happyness}set happyness(t){this._happyness=t}get maximumHappyness(){return this._maximumHappyness}set maximumHappyness(t){this._maximumHappyness=t}get ownerId(){return this._ownerId}set ownerId(t){this._ownerId=t}get ownerName(){return this._ownerName}set ownerName(t){this._ownerName=t}get respect(){return this._respect}set respect(t){this._respect=t}get age(){return this._age}set age(t){this._age=t}get unknownRarity(){return this._unknownRarity}set unknownRarity(t){this._unknownRarity=t}get saddle(){return this._saddle}set saddle(t){this._saddle=t}get rider(){return this._rider}set rider(t){this._rider=t}get skillTresholds(){return this._skillThresholds}set skillTresholds(t){this._skillThresholds=t}get publiclyRideable(){return this._publiclyRideable}set publiclyRideable(t){this._publiclyRideable=t}get breedable(){return this._breedable}set breedable(t){this._breedable=t}get fullyGrown(){return this._fullyGrown}set fullyGrown(t){this._fullyGrown=t}get dead(){return this._dead}set dead(t){this._dead=t}get rarityLevel(){return this._rarityLevel}set rarityLevel(t){this._rarityLevel=t}get maximumTimeToLive(){return this._maximumTimeToLive}set maximumTimeToLive(t){this._maximumTimeToLive=t}get remainingTimeToLive(){return this._remainingTimeToLive}set remainingTimeToLive(t){this._remainingTimeToLive=t}get remainingGrowTime(){return this._remainingGrowTime}set remainingGrowTime(t){this._remainingGrowTime=t}get publiclyBreedable(){return this._publiclyBreedable}set publiclyBreedable(t){this._publiclyBreedable=t}get adultLevel(){return this._adultLevel}}class lY{constructor(t){this._roomIndex=-1,this._name="",this._type=0,this._sex="",this._figure="",this._custom="",this._webID=0,this._groupID=0,this._groupStatus=0,this._groupName="",this._ownerId=0,this._ownerName="",this._petLevel=0,this._rarityLevel=0,this._roomIndex=t}get roomIndex(){return this._roomIndex}get activityPoints(){return this._activityPoints}set activityPoints(t){this._activityPoints=t}get name(){return this._name}set name(t){this._name=t}get type(){return this._type}set type(t){this._type=t}get sex(){return this._sex}set sex(t){this._sex=t}get figure(){return this._figure}set figure(t){this._figure=t}get custom(){return this._custom}set custom(t){this._custom=t}get webID(){return this._webID}set webID(t){this._webID=t}get groupId(){return this._groupID}set groupId(t){this._groupID=t}get groupName(){return this._groupName}set groupName(t){this._groupName=t}get groupStatus(){return this._groupStatus}set groupStatus(t){this._groupStatus=t}get ownerId(){return this._ownerId}set ownerId(t){this._ownerId=t}get ownerName(){return this._ownerName}set ownerName(t){this._ownerName=t}get rarityLevel(){return this._rarityLevel}set rarityLevel(t){this._rarityLevel=t}get hasSaddle(){return this._hasSaddle}set hasSaddle(t){this._hasSaddle=t}get isRiding(){return this._isRiding}set isRiding(t){this._isRiding=t}get canBreed(){return this._canBreed}set canBreed(t){this._canBreed=t}get canHarvest(){return this._canHarvest}set canHarvest(t){this._canHarvest=t}get canRevive(){return this._canRevive}set canRevive(t){this._canRevive=t}get hasBreedingPermission(){return this._hasBreedingPermission}set hasBreedingPermission(t){this._hasBreedingPermission=t}get petLevel(){return this._petLevel}set petLevel(t){this._petLevel=t}get botSkills(){return this._botSkills}set botSkills(t){this._botSkills=t}get isModerator(){return this._isModerator}set isModerator(t){this._isModerator=t}}class cY extends Cs{constructor(t,e){super(t,e),t.addMessageEvent(new ko(this.onRoomUnitEvent.bind(this))),t.addMessageEvent(new Ko(this.onRoomUnitInfoEvent.bind(this))),t.addMessageEvent(new Xo(this.onRoomUnitRemoveEvent.bind(this))),t.addMessageEvent(new Wo(this.onRoomUnitDanceEvent.bind(this))),t.addMessageEvent(new Nf(this.onUserCurrentBadgesEvent.bind(this))),t.addMessageEvent(new kg(this.onRoomDoorbellEvent.bind(this))),t.addMessageEvent(new Wd(this.onUserNameChangeMessageEvent.bind(this))),t.addMessageEvent(new xg(this.onNewFriendRequestEvent.bind(this))),t.addMessageEvent(new uf(this.onPetInfoEvent.bind(this))),t.addMessageEvent(new df(this.onPetStatusUpdateEvent.bind(this))),t.addMessageEvent(new iv(this.onPetBreedingMessageEvent.bind(this))),t.addMessageEvent(new Jg(this.onPetLevelUpdateMessageEvent.bind(this))),t.addMessageEvent(new my(this.onConfirmBreedingResultEvent.bind(this))),t.addMessageEvent(new py(this.onNestBreedingSuccessEvent.bind(this))),t.addMessageEvent(new Ty(this.onConfirmBreedingRequestEvent.bind(this))),t.addMessageEvent(new Ho(this.onPetFigureUpdateEvent.bind(this))),t.addMessageEvent(new lf(this.onPetBreedingResultEvent.bind(this))),t.addMessageEvent(new Xg(this.onPetPlacingError.bind(this))),t.addMessageEvent(new Kg(this.onBotError.bind(this))),t.addMessageEvent(new hf(this.onFavoriteMembershipUpdateMessageEvent.bind(this)))}onRoomUnitEvent(t){if(!this.listener)return;const e=this.listener.getSession(this.roomId);if(!e)return;const s=t.getParser().users,i=[];if(s&&s.length)for(const r of s){if(!r)continue;const a=new lY(r.roomIndex);a.name=r.name,a.custom=r.custom,a.activityPoints=r.activityPoints,a.figure=r.figure,a.type=r.userType,a.webID=r.webID,a.groupId=r.groupID,a.groupName=r.groupName,a.groupStatus=r.groupStatus,a.sex=r.sex,a.ownerId=r.ownerId,a.ownerName=r.ownerName,a.rarityLevel=r.rarityLevel,a.hasSaddle=r.hasSaddle,a.isRiding=r.isRiding,a.canBreed=r.canBreed,a.canHarvest=r.canHarvest,a.canRevive=r.canRevive,a.hasBreedingPermission=r.hasBreedingPermission,a.petLevel=r.petLevel,a.botSkills=r.botSkills,a.isModerator=r.isModerator,e.userDataManager.getUserData(r.roomIndex)||i.push(a),e.userDataManager.updateUserData(a)}this.listener.events.dispatchEvent(new ql(e,i))}onRoomUnitInfoEvent(t){if(!this.listener)return;const e=this.listener.getSession(this.roomId);if(!e)return;const s=t.getParser();s&&(e.userDataManager.updateFigure(s.unitId,s.figure,s.gender,!1,!1),e.userDataManager.updateMotto(s.unitId,s.motto),e.userDataManager.updateAchievementScore(s.unitId,s.achievementScore),this.listener.events.dispatchEvent(new Ql(e,s.unitId,s.figure,s.gender,s.motto,s.achievementScore)))}onRoomUnitRemoveEvent(t){if(!this.listener)return;const e=this.listener.getSession(this.roomId);e&&e.userDataManager.removeUserData(t.getParser().unitId)}onRoomUnitDanceEvent(t){if(!this.listener)return;const e=t.getParser();if(!e)return;const s=this.listener.getSession(this.roomId);s&&this.listener.events.dispatchEvent(new Bl(s,e.unitId,e.danceId))}onUserCurrentBadgesEvent(t){if(!this.listener)return;const e=t.getParser();if(!e)return;const s=this.listener.getSession(this.roomId);s&&(s.userDataManager.setUserBadges(e.userId,e.badges),this.listener.events.dispatchEvent(new Xl(s,e.userId,e.badges)))}onRoomDoorbellEvent(t){if(!this.listener)return;const e=t.getParser();if(!e)return;const s=e.userName;if(!s||!s.length)return;const i=this.listener.getSession(this.roomId);i&&this.listener.events.dispatchEvent(new qi(qi.DOORBELL,i,s))}onUserNameChangeMessageEvent(t){if(!this.listener)return;const e=t.getParser();if(!e)return;const s=this.listener.getSession(this.roomId);s&&s.userDataManager.updateName(e.id,e.newName)}onNewFriendRequestEvent(t){if(!this.listener)return;const e=t.getParser();if(!e)return;const s=this.listener.getSession(this.roomId);if(!s)return;const i=e.request;this.listener.events.dispatchEvent(new Vl(s,i.requestId,i.requesterUserId,i.requesterName))}onPetInfoEvent(t){if(!this.listener)return;const e=t.getParser();if(!e)return;const s=this.listener.getSession(this.roomId);if(!s)return;const i=new _Y;i.id=e.id,i.level=e.level,i.maximumLevel=e.maximumLevel,i.experience=e.experience,i.levelExperienceGoal=e.levelExperienceGoal,i.energy=e.energy,i.maximumEnergy=e.maximumEnergy,i.happyness=e.happyness,i.maximumHappyness=e.maximumHappyness,i.ownerId=e.ownerId,i.ownerName=e.ownerName,i.respect=e.respect,i.age=e.age,i.unknownRarity=e.unknownRarity,i.saddle=e.saddle,i.rider=e.rider,i.breedable=e.breedable,i.fullyGrown=e.fullyGrown,i.rarityLevel=e.rarityLevel,i.dead=e.dead,i.skillTresholds=e.skillTresholds,i.publiclyRideable=e.publiclyRideable,i.maximumTimeToLive=e.maximumTimeToLive,i.remainingTimeToLive=e.remainingTimeToLive,i.remainingGrowTime=e.remainingGrowTime,i.publiclyBreedable=e.publiclyBreedable,this.listener.events.dispatchEvent(new Wl(s,i))}onPetStatusUpdateEvent(t){if(!this.listener)return;const e=t.getParser();if(!e)return;const s=this.listener.getSession(this.roomId);s&&(s.userDataManager.updatePetBreedingStatus(e.roomIndex,e.canBreed,e.canHarvest,e.canRevive,e.hasBreedingPermission),this.listener.events.dispatchEvent(new Kl(s,e.petId,e.canBreed,e.canHarvest,e.canRevive,e.hasBreedingPermission)))}onPetBreedingMessageEvent(t){if(!this.listener)return;const e=t.getParser();if(!e)return;const s=this.listener.getSession(this.roomId);s&&this.listener.events.dispatchEvent(new Hl(s,e.state,e.ownPetId,e.otherPetId))}onPetLevelUpdateMessageEvent(t){if(!this.listener)return;const e=t.getParser();if(!e)return;const s=this.listener.getSession(this.roomId);s&&(s.userDataManager.updatePetLevel(e.roomIndex,e.level),this.listener.events.dispatchEvent(new kl(s,e.petId,e.level)))}onConfirmBreedingResultEvent(t){if(!this.listener)return;const e=t.getParser();if(!e)return;const s=this.listener.getSession(this.roomId);s&&this.listener.events.dispatchEvent(new Gl(s,e.breedingNestStuffId,e.result))}onNestBreedingSuccessEvent(t){if(!this.listener)return;const e=t.getParser();if(!e)return;const s=this.listener.getSession(this.roomId);s&&this.listener.events.dispatchEvent(new Yl(s,e.petId,e.rarityCategory))}onConfirmBreedingRequestEvent(t){if(!this.listener)return;const e=t.getParser();if(!e)return;const s=this.listener.getSession(this.roomId);s&&this.listener.events.dispatchEvent(new xl(s,e.nestId,e.pet1,e.pet2,e.rarityCategories,e.resultPetType))}onPetFigureUpdateEvent(t){if(!this.listener)return;const e=t.getParser();if(!e)return;const s=this.listener.getSession(this.roomId);if(!s)return;const i=e.figureData.figuredata;s.userDataManager.updateFigure(e.roomIndex,i,"",e.hasSaddle,e.isRiding),this.listener.events.dispatchEvent(new zl(s,e.petId,i))}onPetBreedingResultEvent(t){if(!this.listener)return;const e=t.getParser();if(!e)return;const s=this.listener.getSession(this.roomId);s&&this.listener.events.dispatchEvent(new jl(s,e.resultData,e.otherResultData))}onPetPlacingError(t){if(!t||!this.listener)return;const e=t.getParser();if(!e)return;const s=this.listener.getSession(this.roomId);if(!s)return;let i=null;switch(e.errorCode){case 0:i=ce.RSEME_PETS_FORBIDDEN_IN_HOTEL;break;case 1:i=ce.RSEME_PETS_FORBIDDEN_IN_FLAT;break;case 2:i=ce.RSEME_MAX_PETS;break;case 3:i=ce.RSEME_NO_FREE_TILES_FOR_PET;break;case 4:i=ce.RSEME_SELECTED_TILE_NOT_FREE_FOR_PET;break;case 5:i=ce.RSEME_MAX_NUMBER_OF_OWN_PETS;break}!i||i.length==0||this.listener.events.dispatchEvent(new ce(i,s))}onBotError(t){if(!t||!this.listener)return;const e=t.getParser();if(!e)return;const s=this.listener.getSession(this.roomId);if(!s)return;let i=null;switch(e.errorCode){case 0:i=ce.RSEME_BOTS_FORBIDDEN_IN_HOTEL;break;case 1:i=ce.RSEME_BOTS_FORBIDDEN_IN_FLAT;break;case 2:i=ce.RSEME_BOT_LIMIT_REACHED;break;case 3:i=ce.RSEME_SELECTED_TILE_NOT_FREE_FOR_BOT;break;case 4:i=ce.RSEME_BOT_NAME_NOT_ACCEPTED;break}!i||i.length==0||this.listener.events.dispatchEvent(new ce(i,s))}onFavoriteMembershipUpdateMessageEvent(t){if(!this.listener)return;const e=t.getParser(),s=this.listener.getSession(this.roomId);if(!s)return;const i=s.userDataManager.getUserDataByIndex(e.roomIndex);i&&(i.groupId=e.groupId,i.groupName=e.groupName,this.listener.events.dispatchEvent(new wl(s,e.roomIndex,e.groupId,e.status,e.groupName)))}}class uY extends Cs{constructor(t,e){super(t,e),t.addMessageEvent(new rf(this.onQuestionEvent.bind(this))),t.addMessageEvent(new sf(this.onQuestionAnsweredEvent.bind(this))),t.addMessageEvent(new nf(this.onQuestionFinishedEvent.bind(this)))}onQuestionEvent(t){if(!this.listener)return;const e=this.listener.getSession(this.roomId);if(!e)return;const s=t.getParser();if(!s)return;const i=new Di(Di.QUESTION,e,s.pollId);i.question=s.question,i.duration=s.duration,i.pollType=s.pollType,i.questionId=s.questionId,i.pollId=s.pollId,this.listener.events.dispatchEvent(i)}onQuestionAnsweredEvent(t){if(!this.listener)return;const e=this.listener.getSession(this.roomId);if(!e)return;const s=t.getParser();if(!s)return;const i=new Di(Di.ANSWERED,e,s.userId);i.value=s.value,i.userId=s.userId,i.answerCounts=s.answerCounts,this.listener.events.dispatchEvent(i)}onQuestionFinishedEvent(t){if(!this.listener)return;const e=this.listener.getSession(this.roomId);if(!e)return;const s=t.getParser();if(!s)return;const i=new Di(Di.FINISHED,e);i.questionId=s.questionId,i.answerCounts=s.answerCounts,this.listener.events.dispatchEvent(i)}}class dY{constructor(t){this._sessionDataManager=t,this._ignoredUsers=[]}init(){if(this._sessionDataManager&&this._sessionDataManager.communication){this._messages=[new Uf(this.onIgnoredUsersEvent.bind(this)),new kd(this.onIgnoreResultEvent.bind(this))];for(const t of this._messages)this._sessionDataManager.communication.registerMessageEvent(t)}}dispose(){if(!this.disposed){if(this._messages&&this._messages.length){for(const t of this._messages)this._sessionDataManager.communication.removeMessageEvent(t);this._messages=null}this._sessionDataManager=null}}requestIgnoredUsers(){this._sessionDataManager.send(new ZI(this._sessionDataManager.userName))}onIgnoredUsersEvent(t){if(!t)return;const e=t.getParser();e&&(this._ignoredUsers=e.ignoredUsers)}onIgnoreResultEvent(t){if(!t)return;const e=t.getParser();if(!e)return;const s=e.name;switch(e.result){case 0:return;case 1:this.addUserToIgnoreList(s);return;case 2:this.addUserToIgnoreList(s),this._ignoredUsers.shift();return;case 3:this.removeUserFromIgnoreList(s);return}}addUserToIgnoreList(t){this._ignoredUsers.indexOf(t)<0&&this._ignoredUsers.push(t)}removeUserFromIgnoreList(t){const e=this._ignoredUsers.indexOf(t);e>=0&&this._ignoredUsers.splice(e,1)}ignoreUserId(t){this._sessionDataManager.send(new eT(t))}ignoreUser(t){this._sessionDataManager.send(new tT(t))}unignoreUser(t){this._sessionDataManager.send(new sT(t))}isIgnored(t){return this._ignoredUsers.indexOf(t)>=0}get disposed(){return!!this._sessionDataManager}}class EY{constructor(t,e,s){this._type=t,this._name=e,this._description=s}get type(){return this._type}get name(){return this._name}get description(){return this._description}}const xn=class xn extends $e{constructor(t){super(),this._products=t}dispose(){this._products=null}loadProductData(t){t&&fetch(t).then(e=>e.json()).then(e=>this.onProductDataLoadedEvent(e)).catch(e=>this.onProductDataError(e))}onProductDataLoadedEvent(t){t&&(this.parseProducts(t.productdata),this.dispatchEvent(new gt(xn.PDP_PRODUCT_DATA_READY)))}onProductDataError(t){t&&this.dispatchEvent(new gt(xn.PDP_PRODUCT_DATA_FAILED))}parseProducts(t){if(t)for(const e of t.product)e&&this._products.set(e.code,new EY(e.code,e.name,e.description))}};xn.PDP_PRODUCT_DATA_READY="PDP_PRODUCT_DATA_READY",xn.PDP_PRODUCT_DATA_FAILED="PDP_PRODUCT_DATA_FAILED";let ia=xn;const js=class js extends Ye{constructor(){super(),this._connection=null,this._userDataByType=new Map,this._userDataByRoomIndex=new Map,this._userBadges=new Map}onDispose(){this._connection=null}setConnection(t){this._connection=t}getUserData(t){return this.getDataByType(t,js.TYPE_USER)}getPetData(t){return this.getDataByType(t,js.TYPE_PET)}getBotData(t){return this.getDataByType(t,js.TYPE_BOT)}getRentableBotData(t){return this.getDataByType(t,js.TYPE_RENTABLE_BOT)}getDataByType(t,e){const s=this._userDataByType.get(e);if(!s)return null;const i=s.get(t);return i||null}getUserDataByIndex(t){const e=this._userDataByRoomIndex.get(t);return e||null}getUserDataByName(t){for(const e of this._userDataByRoomIndex.values())if(!(!e||e.name!==t))return e;return null}updateUserData(t){if(!t)return;this.removeUserData(t.roomIndex);let e=this._userDataByType.get(t.type);e||(e=new Map,this._userDataByType.set(t.type,e)),e.set(t.webID,t),this._userDataByRoomIndex.set(t.roomIndex,t)}removeUserData(t){const e=this.getUserDataByIndex(t);if(!e)return;this._userDataByRoomIndex.delete(t);const s=this._userDataByType.get(e.type);s&&s.delete(e.webID)}getUserBadges(t){this._connection&&this._connection.send(new iT(t));const e=this._userBadges.get(t);return e||[]}setUserBadges(t,e){this._userBadges.set(t,e)}updateFigure(t,e,s,i,r){const a=this.getUserDataByIndex(t);a&&(a.figure=e,a.sex=s,a.hasSaddle=i,a.isRiding=r)}updateName(t,e){const s=this.getUserDataByIndex(t);s&&(s.name=e)}updateMotto(t,e){const s=this.getUserDataByIndex(t);s&&(s.custom=e)}updateAchievementScore(t,e){const s=this.getUserDataByIndex(t);s&&(s.activityPoints=e)}updatePetLevel(t,e){const s=this.getUserDataByIndex(t);s&&(s.petLevel=e)}updatePetBreedingStatus(t,e,s,i,r){const a=this.getUserDataByIndex(t);a&&(a.canBreed=e,a.canHarvest=s,a.canRevive=i,a.hasBreedingPermission=r)}requestPetInfo(t){!this._connection||!this.getPetData(t)||this._connection.send(new kf(t))}get connection(){return this._connection}};js.TYPE_USER=1,js.TYPE_PET=2,js.TYPE_BOT=3,js.TYPE_RENTABLE_BOT=4;let Dd=js;class gY extends Ye{constructor(){super(),this._connection=null,this._userData=new Dd,this._roomId=0,this._password=null,this._state=tt.CREATED,this._tradeMode=Ll.NO_TRADING,this._doorMode=0,this._controllerLevel=Ii.NONE,this._ownRoomIndex=-1,this._isGuildRoom=!1,this._isRoomOwner=!1,this._isDecorating=!1,this._isSpectator=!1,this._moderationSettings=null}onDispose(){this._userData&&(this._userData.dispose(),this._userData=null),this._connection=null}setConnection(t){this._connection||!t||(this._connection=t,this._userData&&this._userData.setConnection(t))}setControllerLevel(t){if(t>=Ii.NONE&&t<=Ii.MODERATOR){this._controllerLevel=t;return}this._controllerLevel=Ii.NONE}setOwnRoomIndex(t){this._ownRoomIndex=t}setRoomOwner(){this._isRoomOwner=!0}start(){return this._state!==tt.CREATED||!this._connection?!1:(this._state=tt.STARTED,this.enterRoom())}enterRoom(){return this._connection?(this._connection.send(new tI(this._roomId,this._password)),!0):!1}reset(t){t!==this._roomId&&(this._roomId=t)}sendChatMessage(t,e,s){this._connection.send(new Xd(t,e,s))}sendShoutMessage(t,e,s){this._connection.send(new BI(t,e,s))}sendWhisperMessage(t,e,s){this._connection.send(new wI(t,e,s))}sendChatTypingMessage(t){t?this._connection.send(new VI):this._connection.send(new YI)}sendMottoMessage(t){this._connection.send(new rT(t))}sendDanceMessage(t){this._connection.send(new jI(t))}sendExpressionMessage(t){this._connection.send(new HI(t))}sendSignMessage(t){t<0||t>17||this._connection.send(new kI(t))}sendPostureMessage(t){this._connection.send(new WI(t))}sendDoorbellApprovalMessage(t,e){this._connection.send(new $f(t,e))}sendAmbassadorAlertMessage(t){this._connection.send(new eI(t))}sendWhisperGroupMessage(t){this._connection.send(new ChatWhisperGroupComposer(t))}sendKickMessage(t){this._connection.send(new rI(t))}sendMuteMessage(t,e){this._connection.send(new nI(t,e,this._roomId))}sendBanMessage(t,e){this._connection.send(new sI(t,this._roomId,e))}sendGiveRightsMessage(t){this._connection.send(new iI(t))}sendTakeRightsMessage(t){this._connection.send(new aI(t))}sendPollStartMessage(t){this._connection.send(new Zf(t))}sendPollRejectMessage(t){this._connection.send(new Jf(t))}sendPollAnswerMessage(t,e,s){this._connection.send(new Qf(t,e,s))}sendPeerUsersClassificationMessage(t){this._connection.send(new oT(t))}sendOpenPetPackageMessage(t,e){this._connection.send(new vI(t,e))}sendRoomUsersClassificationMessage(t){this._connection.send(new hT(t))}updateMoodlightData(t,e,s,i,r){let a="000000"+s.toString(16).toUpperCase();a="#"+a.substring(a.length-6),this.connection.send(new pI(t,e,a,i,r))}toggleMoodlightState(){this.connection.send(new RI)}pickupPet(t){this._connection&&this._connection.send(new EI(t))}pickupBot(t){this._connection&&this._connection.send(new hI(t))}requestMoodlightSettings(){this._connection&&this._connection.send(new mI)}openGift(t){this._connection.send(new bI(t))}mountPet(t){this._connection.send(new vu(t,!0))}dismountPet(t){this._connection.send(new vu(t,!1))}usePetProduct(t,e){this._connection.send(new qf(t,e))}removePetSaddle(t){this._connection.send(new Wf(t))}togglePetBreeding(t){this._connection.send(new Kf(t))}togglePetRiding(t){this._connection.send(new Xf(t))}useMultistateItem(t){this._connection.send(new Kd(t))}harvestPet(t){this._connection.send(new uI(t))}compostPlant(t){this._connection.send(new lI(t))}requestPetCommands(t){this._connection.send(new jf(t))}sendScriptProceed(){this._connection.send(new Hf)}sendUpdateClothingChangeFurniture(t,e,s){this._connection.send(new fI(t,e,s))}changeQueue(t){this._connection.send(new xI(t))}votePoll(t){this._connection.send(new VotePollCounterMessageComposer(t))}get connection(){return this._connection}get userDataManager(){return this._userData}get roomId(){return this._roomId}set roomId(t){this._roomId=t}get password(){return this._password}set password(t){this._password=t}get state(){return this._state}get isPrivateRoom(){return!0}get tradeMode(){return this._tradeMode}set tradeMode(t){this._tradeMode=t}get doorMode(){return this._doorMode}set doorMode(t){this._doorMode=t}get allowPets(){return this._allowPets}set allowPets(t){this._allowPets=t}get controllerLevel(){return this._controllerLevel}get ownRoomIndex(){return this._ownRoomIndex}get isGuildRoom(){return this._isGuildRoom}set isGuildRoom(t){this._isGuildRoom=t}get isRoomOwner(){return this._isRoomOwner}get isDecorating(){return this._isDecorating}set isDecorating(t){this._isDecorating=t}get isSpectator(){return this._isSpectator}set isSpectator(t){this._isSpectator=t}get moderationSettings(){return this._moderationSettings}set moderationSettings(t){this._moderationSettings=t}}class fY extends Js{constructor(t,e){super(),this._communication=t,this._roomEngine=e,this._handlers=[],this._sessions=new Map,this._pendingSession=null,this._sessionStarting=!1,this._viewerSession=null,this.onRoomEngineEvent=this.onRoomEngineEvent.bind(this)}onInit(){this.createHandlers(),this.processPendingSession(),this._roomEngine.events.addEventListener(Ct.ENGINE_INITIALIZED,this.onRoomEngineEvent)}onDispose(){this._roomEngine.events.removeEventListener(Ct.ENGINE_INITIALIZED,this.onRoomEngineEvent),super.onDispose()}createHandlers(){const t=this._communication&&this._communication.connection;t&&this._handlers.push(new rY(t,this),new nY(t,this),new aY(t,this),new oY(t,this),new an(t,this),new cY(t,this),new hY(t,this),new eY(t,this),new uY(t,this),new iY(t,this),new sY(t,this))}setHandlers(t){if(!(!this._handlers||!this._handlers.length))for(const e of this._handlers)e&&e.setRoomId(t.roomId)}onRoomEngineEvent(t){this.processPendingSession()}processPendingSession(){!this._pendingSession||!this._roomEngine.ready||(this.addSession(this._pendingSession),this._pendingSession=null)}getSession(t){const e=this._sessions.get(this.getRoomId(t));return e||null}createSession(t,e=null){const s=new gY;return s.roomId=t,s.password=e,this.addSession(s)}addSession(t){return this._roomEngine.ready?(this._sessionStarting=!0,this._sessions.get(this.getRoomId(t.roomId))&&this.removeSession(t.roomId,!1),t.setConnection(this._communication.connection),this._sessions.set(this.getRoomId(t.roomId),t),this.events.dispatchEvent(new tt(tt.CREATED,t)),this._viewerSession=t,this.startSession(this._viewerSession),!0):(this._pendingSession=t,!1)}startSession(t){return t.state===tt.STARTED?!1:(this._sessionStarting=!1,t.start()?(this.events.dispatchEvent(new tt(tt.STARTED,t)),this.setHandlers(t),!0):(this.removeSession(t.roomId),!1))}removeSession(t,e=!0){const s=this.getSession(t);s&&(this._sessions.delete(this.getRoomId(t)),this.events.dispatchEvent(new tt(tt.ENDED,s,e)),s.dispose())}sessionUpdate(t,e){if(this.getSession(t))switch(e){case an.RS_CONNECTED:return;case an.RS_READY:return;case an.RS_DISCONNECTED:this.removeSession(t);return}}sessionReinitialize(t,e){const s=this.getSession(t);s&&(this._sessions.delete(this.getRoomId(t)),s.reset(e),this._sessions.set(this.getRoomId(e),s),this.setHandlers(s))}getRoomId(t){return"hard_coded_room_id"}get communication(){return this._communication}get roomEngine(){return this._roomEngine}get viewerSession(){return this._viewerSession}}const Gn=class Gn{static logEventLog(t){try{dt.available&&dt.call("logEventLog",t)}catch{j.log("External interface not working, failed to log event log.")}}static openPage(t){try{dt.available&&dt.call("openPage",t)}catch{j.log("Failed to open web page",t)}}static openWebPage(t){window.open(t)}static sendHeartBeat(){try{dt.available&&dt.call("heartBeat")}catch{j.log("Failed to send heartbeat")}}static openWebPageAndMinimizeClient(t){try{dt.available&&Gn.openPage(t)}catch{j.log("Failed to open web page",t)}}static closeWebPageAndRestoreClient(){try{dt.available&&dt.call("closeWebPageAndRestoreClient")}catch{j.log("Failed to close web page and restore client!")}}static openHabblet(t,e=null){try{dt.available&&dt.call("openHabblet",t,e)}catch{j.log("Failed to open Habblet",t)}}static closeHabblet(t,e=null){try{dt.available&&dt.call("closeHabblet",t,e)}catch{j.log("Failed to close Habblet",t)}}static send(t,e){try{dt.available&&dt.call("disconnect",t,e)}catch{j.log("Failed to close send ")}}static showGame(t){try{dt.available&&dt.callGame("showGame",t)}catch(e){j.log("Failed to open game",e)}}static hideGame(){try{dt.available&&dt.callGame("hideGame")}catch{j.log("Failed to hide game")}}static open(t){try{dt.available&&dt.call("openExternalLink",escape(t))}catch{j.log("External interface not working. Could not request to open: "+t)}}static roomVisited(t){try{dt.available&&dt.call("roomVisited",t)}catch{j.log("External interface not working. Could not store last room visit.")}}static openMinimail(t){try{dt.available&&dt.call("openMinimail",t)}catch{j.log("External interface not working. Could not open minimail.")}}static openNews(){try{dt.available&&dt.call("openNews")}catch{j.log("External interface not working. Could not open news.")}}static closeNews(){try{dt.available&&dt.call("closeNews")}catch{j.log("External interface not working. Could not close news.")}}static openAvatars(){try{dt.available&&dt.call("openAvatars")}catch{j.log("External interface not working. Could not open avatars.")}}static openRoomEnterAd(){try{dt.available&&dt.call("openRoomEnterAd")}catch{j.log("External interface not working. Could not open roomenterad.")}}static updateFigure(t){try{dt.available&&dt.call("updateFigure",t)}catch{j.log("External interface not working. Could not update figure.")}}};Gn.ADVERTISEMENT="advertisement",Gn.OPENLINK="openlink",Gn.OPENROOM="openroom";let Kn=Gn;class IY extends Js{constructor(t){super(),this._communication=t,this.resetUserInfo(),this._ignoredUsersManager=new dY(this),this._groupInformationManager=new tY(this),this._clubLevel=0,this._securityLevel=0,this._isAmbassador=!1,this._noobnessLevel=-1,this._isEmailVerified=!1,this._systemOpen=!1,this._systemShutdown=!1,this._isAuthenticHabbo=!1,this._isRoomCameraFollowDisabled=!1,this._uiFlags=0,this._floorItems=new Map,this._wallItems=new Map,this._products=new Map,this._furnitureData=null,this._furnitureReady=!1,this._productsReady=!1,this._furnitureListenersNotified=!1,this._pendingFurnitureListeners=[],this._pendingProductListeners=[],this._tags=[],this._badgeImageManager=null,this.onFurnitureDataReadyEvent=this.onFurnitureDataReadyEvent.bind(this),this.onProductDataReadyEvent=this.onProductDataReadyEvent.bind(this),this.onNitroSettingsEvent=this.onNitroSettingsEvent.bind(this)}onInit(){this.loadFurnitureData(),this.loadProductData(),this.loadBadgeImageManager(),this._ignoredUsersManager&&this._ignoredUsersManager.init(),this._groupInformationManager&&this._groupInformationManager.init(),this._communication.registerMessageEvent(new bg(this.onUserFigureEvent.bind(this))),this._communication.registerMessageEvent(new qo(this.onUserInfoEvent.bind(this))),this._communication.registerMessageEvent(new Cf(this.onUserPermissionsEvent.bind(this))),this._communication.registerMessageEvent(new vg(this.onAvailabilityStatusMessageEvent.bind(this))),this._communication.registerMessageEvent(new Zg(this.onPetRespectFailed.bind(this))),this._communication.registerMessageEvent(new Za(this.onChangeNameUpdateEvent.bind(this))),this._communication.registerMessageEvent(new Wd(this.onUserNameChangeMessageEvent.bind(this))),this._communication.registerMessageEvent(new Df(this.onUserTags.bind(this))),this._communication.registerMessageEvent(new kn(this.onRoomModelNameEvent.bind(this))),this._communication.registerMessageEvent(new yf(this.onInClientLinkEvent.bind(this))),this._communication.registerMessageEvent(new Wg(this.onMysteryBoxKeysEvent.bind(this))),this._communication.registerMessageEvent(new wg(this.onNoobnessLevelMessageEvent.bind(this))),this._communication.registerMessageEvent(new Mf(this.onAccountSafetyLockStatusChangeMessageEvent.bind(this))),this._communication.registerMessageEvent(new Lf(this.onEmailStatus.bind(this))),W.instance.events.addEventListener(Gr.SETTINGS_UPDATED,this.onNitroSettingsEvent)}onDispose(){this.destroyFurnitureData(),this._ignoredUsersManager&&(this._ignoredUsersManager.dispose(),this._ignoredUsersManager=null),this._groupInformationManager&&(this._groupInformationManager.dispose(),this._groupInformationManager=null),W.instance.events.removeEventListener(Gr.SETTINGS_UPDATED,this.onNitroSettingsEvent),super.onDispose()}resetUserInfo(){this._userId=0,this._name=null,this._figure=null,this._gender=null,this._realName=null,this._canChangeName=!1,this._safetyLocked=!1}loadFurnitureData(){this.destroyFurnitureData(),this._furnitureData=new sa(this._floorItems,this._wallItems,W.instance.localization),this._furnitureData.addEventListener(sa.FURNITURE_DATA_READY,this.onFurnitureDataReadyEvent),this._furnitureData.loadFurnitureData(q.getValue("furnidata.url"))}loadProductData(){this.destroyProductData(),this._productData=new ia(this._products),this._productData.addEventListener(ia.PDP_PRODUCT_DATA_READY,this.onProductDataReadyEvent),this._productData.loadProductData(q.getValue("productdata.url"))}loadBadgeImageManager(){this._badgeImageManager||(this._badgeImageManager=new nn(_s(),this),this._badgeImageManager.init())}hasProductData(t){return this._productsReady?!0:(t&&this._pendingProductListeners.indexOf(t)===-1&&this._pendingProductListeners.push(t),!1)}getAllFurnitureData(t){if(!this._furnitureReady)return this._pendingFurnitureListeners.indexOf(t)===-1&&this._pendingFurnitureListeners.push(t),null;const e=[];for(const s of this._floorItems.values())s&&e.push(s);for(const s of this._wallItems.values())s&&e.push(s);return e}removePendingFurniDataListener(t){if(!this._pendingFurnitureListeners)return;const e=this._pendingFurnitureListeners.indexOf(t);e!==-1&&this._pendingFurnitureListeners.splice(e,1)}onUserFigureEvent(t){!t||!t.connection||(this._figure=t.getParser().figure,this._gender=t.getParser().gender,Kn.updateFigure(this._figure))}onUserInfoEvent(t){if(!t||!t.connection)return;this.resetUserInfo();const e=t.getParser().userInfo;e&&(this._userId=e.userId,this._name=e.username,this._figure=e.figure,this._gender=e.gender,this._realName=e.realName,this._respectsReceived=e.respectsReceived,this._respectsLeft=e.respectsRemaining,this._respectsPetLeft=e.respectsPetRemaining,this._canChangeName=e.canChangeName,this._safetyLocked=e.safetyLocked,this._ignoredUsersManager&&this._ignoredUsersManager.requestIgnoredUsers())}onUserPermissionsEvent(t){!t||!t.connection||(this._clubLevel=t.getParser().clubLevel,this._securityLevel=t.getParser().securityLevel,this._isAmbassador=t.getParser().isAmbassador)}onAvailabilityStatusMessageEvent(t){if(!t||!t.connection)return;const e=t.getParser();e&&(this._systemOpen=e.isOpen,this._systemShutdown=e.onShutdown,this._isAuthenticHabbo=e.isAuthenticUser)}onPetRespectFailed(t){!t||!t.connection||this._respectsPetLeft++}onChangeNameUpdateEvent(t){if(!t||!t.connection)return;const e=t.getParser();e&&e.resultCode===Za.NAME_OK&&(this._canChangeName=!1,this.events.dispatchEvent(new Do(e.name)))}onUserNameChangeMessageEvent(t){if(!t||!t.connection)return;const e=t.getParser();e&&e.webId===this.userId&&(this._name=e.newName,this._canChangeName=!1,this.events.dispatchEvent(new Do(this._name)))}onUserTags(t){if(!t||!t.connection)return;const e=t.getParser();e&&(this._tags=e.tags)}onRoomModelNameEvent(t){if(!t)return;const e=t.getParser();e&&Kn.roomVisited(e.roomId)}onFurnitureDataReadyEvent(t){if(this._furnitureData.removeEventListener(sa.FURNITURE_DATA_READY,this.onFurnitureDataReadyEvent),this._furnitureReady=!0,!this._furnitureListenersNotified&&(this._furnitureListenersNotified=!0,this._pendingFurnitureListeners&&this._pendingFurnitureListeners.length))for(const e of this._pendingFurnitureListeners)e&&e.loadFurnitureData();this._pendingProductListeners=[]}onProductDataReadyEvent(t){this._productData.removeEventListener(ia.PDP_PRODUCT_DATA_READY,this.onProductDataReadyEvent),this._productsReady=!0;for(const e of this._pendingProductListeners)e&&e.loadProductData();this._pendingProductListeners=[]}onInClientLinkEvent(t){if(!t)return;const e=t.getParser();e&&W.instance.createLinkEvent(e.link)}onMysteryBoxKeysEvent(t){if(!t)return;const e=t.getParser();e&&this.events.dispatchEvent(new Fl(e.boxColor,e.keyColor))}onNoobnessLevelMessageEvent(t){this._noobnessLevel=t.getParser().noobnessLevel,this._noobnessLevel!==Zn.OLD_IDENTITY&&q.setValue("new.identity",1)}onAccountSafetyLockStatusChangeMessageEvent(t){if(!t)return;const e=t.getParser();e&&(this._safetyLocked=e.status==xo.SAFETY_LOCK_STATUS_LOCKED)}onEmailStatus(t){if(!t)return;const e=t.getParser();e&&(this._isEmailVerified=e.isVerified)}onNitroSettingsEvent(t){this._isRoomCameraFollowDisabled=t.cameraFollow,this._uiFlags=t.flags,this.events.dispatchEvent(new Jl(this._uiFlags))}destroyFurnitureData(){this._furnitureData&&(this._furnitureData.dispose(),this._furnitureData=null)}destroyProductData(){this._productData&&(this._productData.dispose(),this._productData=null)}getFloorItemData(t){const e=this._floorItems.get(t);return e||null}getFloorItemDataByName(t){if(!t||!this._floorItems||!this._floorItems.size)return null;for(const e of this._floorItems.values())if(!(!e||e.className!==t))return e}getWallItemData(t){const e=this._wallItems.get(t);return e||null}getWallItemDataByName(t){if(!t||!this._wallItems||!this._wallItems.size)return null;for(const e of this._wallItems.values())if(!(!e||e.className!==t))return e}getProductData(t){return this._productsReady||this.loadProductData(),this._products.get(t)}getBadgeUrl(t){return this._badgeImageManager.getBadgeUrl(t)}getGroupBadgeUrl(t){return this._badgeImageManager.getBadgeUrl(t,nn.GROUP_BADGE)}getBadgeImage(t){return this._badgeImageManager.getBadgeImage(t)}getGroupBadgeImage(t){return this._badgeImageManager.getBadgeImage(t,nn.GROUP_BADGE)}getUserTags(t){t<0||this.send(new $I(t))}loadBadgeImage(t){return this._badgeImageManager.loadBadgeImage(t)}loadGroupBadgeImage(t){return this._badgeImageManager.loadBadgeImage(t,nn.GROUP_BADGE)}hasSecurity(t){return this._securityLevel>=t}giveRespect(t){t<0||this._respectsLeft<=0||(this.send(new aT(t)),this._respectsLeft--)}givePetRespect(t){t<0||this._respectsPetLeft<=0||(this.send(new zf(t)),this._respectsPetLeft--)}sendSpecialCommandMessage(t,e=0){this.send(new Xd(t))}ignoreUser(t){this._ignoredUsersManager&&this._ignoredUsersManager.ignoreUser(t)}unignoreUser(t){this._ignoredUsersManager&&this._ignoredUsersManager.unignoreUser(t)}isUserIgnored(t){return this._ignoredUsersManager&&this._ignoredUsersManager.isIgnored(t)}getGroupBadge(t){return this._groupInformationManager&&this._groupInformationManager.getGroupBadge(t)}send(t){this._communication.connection.send(t)}get communication(){return this._communication}get userId(){return this._userId}get userName(){return this._name}get figure(){return this._figure}get gender(){return this._gender}get realName(){return this._realName}get ignoredUsersManager(){return this._ignoredUsersManager}get groupInformationManager(){return this._groupInformationManager}get respectsReceived(){return this._respectsReceived}get respectsLeft(){return this._respectsLeft}get respectsPetLeft(){return this._respectsPetLeft}get canChangeName(){return this._canChangeName}get clubLevel(){return this._clubLevel}get securityLevel(){return this._securityLevel}get isAmbassador(){return this._isAmbassador}get isEmailVerified(){return this._isEmailVerified}get isNoob(){return this._noobnessLevel!==Zn.OLD_IDENTITY}get isRealNoob(){return this._noobnessLevel===Zn.REAL_NOOB}get isSystemOpen(){return this._systemOpen}get isSystemShutdown(){return this._systemShutdown}get isAuthenticHabbo(){return this._isAuthenticHabbo}get isModerator(){return this._securityLevel>=Pl.MODERATOR}get isCameraFollowDisabled(){return this._isRoomCameraFollowDisabled}get uiFlags(){return this._uiFlags}get tags(){return this._tags}}class BT extends nl{constructor(t,e,s,i,r=""){super(t,e,s,i),this._jukeboxDiskId=-1,this._songData=r}get id(){return this._id}get length(){return this._length}get name(){return this._name}get creator(){return this._creator}get songData(){return this._songData}set songData(t){this._songData=t}get diskId(){return this._jukeboxDiskId}set diskId(t){this._jukeboxDiskId=t}}class TY{constructor(t,e,s,i,r){this._songId=t,this._startPos=e,this._playLength=s,this._fadeInSeconds=i,this._fadeOutSeconds=r,this._playRequestTime=Date.now()}get songId(){return this._songId}get startPos(){return this._startPos<0?0:this._startPos+(Date.now()-this._playRequestTime)/1e3}get playLength(){return this._playLength}get playRequestTime(){return this._playRequestTime}get fadeInSeconds(){return this._fadeInSeconds}get fadeOutSeconds(){return this._fadeOutSeconds}}const X_=class X_ extends gt{constructor(t,e){super(X_.NOTIFY_PLAYED_SONG),this._name=t,this._creator=e}get name(){return this._name}get creator(){return this._creator}};X_.NOTIFY_PLAYED_SONG="UIEW_NOTIFY_PLAYED_SONG";let Ld=X_;const Ha=class Ha extends gt{constructor(t,e,s,i){super(t),this._id=s,this._position=i,this._priority=e}get id(){return this._id}get position(){return this._position}get priority(){return this._priority}};Ha.NPE_USER_PLAY_SONG="NPE_USER_PLAY_SONG",Ha.NPW_USER_STOP_SONG="NPW_USER_STOP_SONG",Ha.NPE_SONG_CHANGED="NPE_SONG_CHANGED";let Ji=Ha;const q_=class q_ extends gt{constructor(t){super(t)}};q_.PLUE_PLAY_LIST_UPDATED="PLUE_PLAY_LIST_UPDATED",q_.PLUE_PLAY_LIST_FULL="PLUE_PLAY_LIST_FULL";let Li=q_;const LE=class LE extends gt{constructor(t){super(t)}};LE.SDIR_SONG_DISK_INVENTORY_RECEIVENT_EVENT="SDIR_SONG_DISK_INVENTORY_RECEIVENT_EVENT";let on=LE;const PE=class PE extends gt{constructor(t,e){super(t),this._id=e}get id(){return this._id}};PE.SIR_TRAX_SONG_INFO_RECEIVED="SIR_TRAX_SONG_INFO_RECEIVED";let Xn=PE;const UE=class UE extends gt{constructor(t,e){super(t),this._id=e}get id(){return this._id}};UE.TRAX_SONG_COMPLETE="SME_TRAX_SONG_COMPLETE";let qn=UE;const Pr=class Pr{};Pr.PRIORITY_ROOM_PLAYLIST=0,Pr.PRIORITY_USER_PLAYLIST=1,Pr.PRIORITY_SONG_PLAY=2,Pr.PRIORITY_PURCHASE_PREVIEW=3,Pr.PRIORITY_COUNT=4;let Qe=Pr;class mY{constructor(){this._isPlaying=!1,this._disposed=!1,this._entries=[],this._missingSongInfo=[],this._messageEvents=[new Of(this.onNowPlayingMessageEvent.bind(this)),new Rf(this.onJukeboxSongDisksMessageEvent.bind(this)),new pf(this.onJukeboxPlayListFullMessageEvent.bind(this))],this.onSongInfoReceivedEvent=this.onSongInfoReceivedEvent.bind(this)}init(){this._messageEvents.forEach(t=>W.instance.communication.connection.addMessageEvent(t)),W.instance.soundManager.events.addEventListener(Xn.SIR_TRAX_SONG_INFO_RECEIVED,this.onSongInfoReceivedEvent)}get priority(){return Qe.PRIORITY_ROOM_PLAYLIST}onNowPlayingMessageEvent(t){const e=t.getParser();this._isPlaying=e.currentSongId!==-1,e.currentSongId>=0?(W.instance.soundManager.musicController.playSong(e.currentSongId,Qe.PRIORITY_ROOM_PLAYLIST,e.syncCount/1e3,0,1,1),this._currentEntryId=e.currentSongId):this.stopPlaying(),e.nextSongId>=0&&W.instance.soundManager.musicController.addSongInfoRequest(e.nextSongId),this._playPosition=e.currentPosition,W.instance.soundManager.events.dispatchEvent(new Ji(Ji.NPE_SONG_CHANGED,Qe.PRIORITY_ROOM_PLAYLIST,e.currentSongId,e.currentPosition))}onJukeboxSongDisksMessageEvent(t){const e=t.getParser();this._entries=[];for(let s=0;s<e.songDisks.length;s++){const i=e.songDisks.getWithIndex(s),r=e.songDisks.getKey(s);let a=W.instance.soundManager.musicController.getSongInfo(i);a==null&&(a=new BT(i,-1,null,null,null),this._missingSongInfo.indexOf(i)<0&&(this._missingSongInfo.push(i),W.instance.soundManager.musicController.requestSongInfoWithoutSamples(i))),a.diskId=r,this._entries.push(a)}this._missingSongInfo.length==0&&W.instance.soundManager.events.dispatchEvent(new Li(Li.PLUE_PLAY_LIST_UPDATED))}onJukeboxPlayListFullMessageEvent(t){W.instance.soundManager.events.dispatchEvent(new Li(Li.PLUE_PLAY_LIST_FULL))}onSongInfoReceivedEvent(t){for(let s=0;s<this.length;s++){const i=this._entries[s];if(i.id===t.id){const r=i.diskId,a=W.instance.soundManager.musicController.getSongInfo(t.id);a!=null&&(a.diskId=r,this._entries[s]=a);break}}const e=this._missingSongInfo.indexOf(t.id);e>=0&&this._missingSongInfo.splice(e,1),this._missingSongInfo.length==0&&W.instance.soundManager.events.dispatchEvent(new Li(Li.PLUE_PLAY_LIST_UPDATED))}stopPlaying(){W.instance.soundManager.musicController.stop(this.priority),this._currentEntryId=-1,this._playPosition=-1,this._isPlaying=!1}get length(){return this._entries?this._entries.length:0}get playPosition(){return this._playPosition}get nowPlayingSongId(){return this._currentEntryId}get isPlaying(){return this._isPlaying}get entries(){return this._entries}getEntry(t){return t<0||t>=this._entries.length?null:this._entries[t]}requestPlayList(){W.instance.communication.connection.send(new XI)}dispose(){this._disposed||(this._disposed=!0,this.stopPlaying(),W.instance.soundManager.events&&W.instance.soundManager.events.removeEventListener(Xn.SIR_TRAX_SONG_INFO_RECEIVED,this.onSongInfoReceivedEvent),this._messageEvents.forEach(t=>W.instance.communication.connection.removeMessageEvent(t)),this._messageEvents=null)}}class pY{constructor(t){this._id=t,this._items=[]}addChannelItem(t){this._items.push(t)}get items(){return this._items}}class RY{constructor(t,e){this._id=t,this._length=e}get id(){return this._id}get length(){return this._length}}class Pd{constructor(t){this._channels=[],this._metaData=new Map;let e=[];const s=t.split(":"),i=s[s.length-1];if(i.indexOf("meta")>-1){const r=i.split(";");for(const a of r){const o=a.split(",");this._metaData.set(o[0],o[1])}e=s.slice(0,s.length-1)}else e=s;for(let r=0;r<e.length/2;r++)if(e[r*2].length>0){const a=parseInt(e[r*2]),o=e[r*2+1].split(";"),h=new pY(a);for(const _ of o){const l=_.split(",");if(l.length!==2)return;h.addChannelItem(new RY(parseInt(l[0]),parseInt(l[1])))}this._channels.push(h)}}get channels(){return this._channels}getSampleIds(){const t=[];for(const e of this._channels)for(const s of e.items)t.indexOf(s.id)===-1&&t.push(s.id);return t}get hasMetaData(){return this._metaData.has("meta")}get metaCutMode(){return this._metaData.has("c")}get metaTempo(){const t=this._metaData.get("t");return t?parseInt(t):null}}class OY{constructor(t){this._sampleUrl=t,this._isPlaying=!1,this._startPos=0,this._currentPos=0,this._playLength=0,this._sequence=[],this._cache=new Map}async play(t,e,s=0,i=-1){this.reset(),this._currentSong=new Pd(t),this._startPos=Math.trunc(s),this._playLength=i,this._currentPos=this._startPos,this._currentSongId=e,await this.preload(),this._isPlaying=!0,this.tick(),this._tickerInterval=window.setInterval(()=>this.tick(),1e3)}reset(){this._isPlaying=!1,window.clearInterval(this._tickerInterval),Kr.Howler.stop(),this._currentSongId=-1,this._currentSong=void 0,this._tickerInterval=void 0,this._startPos=0,this._playLength=0,this._sequence=[],this._currentPos=0}pause(){this._isPlaying=!1,Kr.Howler.stop()}resume(){this._isPlaying=!0}stop(){const t=this._currentSongId;this.reset(),W.instance.soundManager.events.dispatchEvent(new qn(qn.TRAX_SONG_COMPLETE,t))}setVolume(t){Kr.Howler.volume(t)}getVolume(){return Kr.Howler.volume()}async getSample(t){let e=this._cache.get(t);return e||(e=await this.loadSong(t)),Promise.resolve(e)}async preload(){if(this._sequence=[],!!this._currentSong){for(const t of this._currentSong.channels){const e=[];for(const s of t.items){const i=await this.getSample(s.id),r=Math.ceil(s.length*2/Math.ceil(i.duration()));for(let a=0;a<r;a++)for(let o=0;o<Math.ceil(i.duration());o++)e.push({sampleId:s.id,offset:o})}this._sequence.push(e)}this._playLength<=0&&(this._playLength=Math.max(...this._sequence.map(t=>t.length)))}}async preloadSamplesForSong(t){const e=new Pd(t);await Promise.all(e.getSampleIds().map(s=>this.getSample(s)))}async loadSong(t){return new Promise((e,s)=>{const i=new Kr.Howl({src:[this._sampleUrl.replace("%sample%",t.toString())],preload:!0});i.once("load",()=>{this._cache.set(t,i),e(i)}),i.once("loaderror",()=>{j.error("failed to load sample "+t),s("failed to load sample "+t)})})}tick(){this._currentPos>this._playLength-1&&this.stop(),this._isPlaying&&(this._currentSong&&this.playPosition(this._currentPos),this._currentPos++)}playPosition(t){if(!(!this._currentSong||!this._sequence)&&Kr.Howler._audioUnlocked)for(const e of this._sequence){const s=e[t];if(!s||s.sampleId===-1||s.sampleId===0)continue;const i=this._cache.get(s.sampleId);i&&(s.offset===0?i.play():i.playing()||(i.seek(s.offset),i.play()))}}}const Ur=class Ur{constructor(){this._priorityPlaying=-1,this._requestNumberPlaying=-1,this._previousNotificationTime=-1,this._timerInstance=-1,this._songRequestList=[],this._requestedSongs=new Map,this._availableSongs=new Map,this._songDiskInventory=new Xt,this._songRequestsPerPriority=[],this._songRequestCountsPerPriority=[],this._diskInventoryMissingData=[],this._songIdPlaying=-1,this._previousNotifiedSongId=-1,this._messageEvents=[new Af(this.onTraxSongInfoMessageEvent.bind(this)),new Sf(this.onSongDiskInventoryMessage.bind(this))],this.onJukeboxInit=this.onJukeboxInit.bind(this),this.onJukeboxDispose=this.onJukeboxDispose.bind(this),this.onSoundMachineInit=this.onSoundMachineInit.bind(this),this.onSoundMachineDispose=this.onSoundMachineDispose.bind(this),this.onTraxSongComplete=this.onTraxSongComplete.bind(this)}init(){this._timerInstance=window.setInterval(this.onTick.bind(this),1e3),this._musicPlayer=new OY(W.instance.getConfiguration("external.samples.url")),this._messageEvents.forEach(t=>W.instance.communication.connection.addMessageEvent(t)),W.instance.roomEngine.events.addEventListener(yt.JUKEBOX_INIT,this.onJukeboxInit),W.instance.roomEngine.events.addEventListener(yt.JUKEBOX_DISPOSE,this.onJukeboxDispose),W.instance.roomEngine.events.addEventListener(yt.SOUND_MACHINE_INIT,this.onSoundMachineInit),W.instance.roomEngine.events.addEventListener(yt.SOUND_MACHINE_DISPOSE,this.onSoundMachineDispose),W.instance.soundManager.events.addEventListener(qn.TRAX_SONG_COMPLETE,this.onTraxSongComplete)}getRoomItemPlaylist(t){return this._roomItemPlaylist}get songDiskInventory(){return this._songDiskInventory}getSongDiskInventorySize(){return this._songDiskInventory.length}getSongDiskInventoryDiskId(t){return t>=0&&t<this._songDiskInventory.length?this._songDiskInventory.getKey(t):-1}getSongDiskInventorySongId(t){return t>=0&&t<this._songDiskInventory.length?this._songDiskInventory.getWithIndex(t):-1}getSongInfo(t){const e=this.getSongDataEntry(t);return e||this.requestSongInfoWithoutSamples(t),e}getSongIdPlayingAtPriority(t){return t!==this._priorityPlaying?-1:this._songIdPlaying}stop(t){const e=t===this._priorityPlaying,s=this.getTopRequestPriority()===t;e?(this.resetSongStartRequest(t),this.stopSongAtPriority(t)):(this.resetSongStartRequest(t),s&&this.reRequestSongAtPriority(this._priorityPlaying))}addSongInfoRequest(t){this.requestSong(t,!0)}requestSongInfoWithoutSamples(t){this.requestSong(t,!1)}requestUserSongDisks(){W.instance.communication.connection.send(new JI)}updateVolume(t){this._musicPlayer.setVolume(t)}dispose(){this._timerInstance&&(clearInterval(this._timerInstance),this._timerInstance=void 0),this._messageEvents.forEach(t=>W.instance.communication.connection.removeMessageEvent(t)),W.instance.roomEngine.events.removeEventListener(yt.JUKEBOX_INIT,this.onJukeboxInit),W.instance.roomEngine.events.removeEventListener(yt.JUKEBOX_DISPOSE,this.onJukeboxDispose),W.instance.roomEngine.events.removeEventListener(yt.SOUND_MACHINE_INIT,this.onSoundMachineInit),W.instance.roomEngine.events.removeEventListener(yt.SOUND_MACHINE_DISPOSE,this.onSoundMachineDispose),W.instance.soundManager.events.removeEventListener(qn.TRAX_SONG_COMPLETE,this.onTraxSongComplete)}get samplesIdsInUse(){let t,e,s=[];for(let i=0;i<this._songRequestsPerPriority.length;i++)if(this._songRequestsPerPriority[i]&&(t=this._songRequestsPerPriority[i],e=this._availableSongs.get(t.songId),e)){const r=e.songData;if(r.length>0){const a=new Pd(r);s=s.concat(a.getSampleIds())}}return s}onSongLoaded(t){const e=this.getTopRequestPriority();if(e>=0){const s=this.getSongIdRequestedAtPriority(e);t===s&&this.playSongObject(e,t)}}samplesUnloaded(t){throw new Error("Method not implemented.")}onTraxSongComplete(t){if(this.getSongIdPlayingAtPriority(this._priorityPlaying)===t.id){this.getTopRequestPriority()===this._priorityPlaying&&this.getSongRequestCountAtPriority(this._priorityPlaying)==this._requestNumberPlaying&&this.resetSongStartRequest(this._priorityPlaying);const e=this._priorityPlaying;this.playSongWithHighestPriority(),e>=Qe.PRIORITY_SONG_PLAY&&W.instance.soundManager.events.dispatchEvent(new Ji(Ji.NPW_USER_STOP_SONG,e,t.id,-1))}}onTraxSongInfoMessageEvent(t){const e=t.getParser();for(const s of e.songs){const i=!!this.getSongDataEntry(s.id);if(this.areSamplesRequested(s.id),!i){const r=new BT(s.id,s.length,s.name,s.creator,s.data);this._availableSongs.set(s.id,r);const a=this.getTopRequestPriority(),o=this.getSongIdRequestedAtPriority(a);for(s.id===o&&this.playSongObject(a,o),W.instance.soundManager.events.dispatchEvent(new Xn(Xn.SIR_TRAX_SONG_INFO_RECEIVED,s.id));this._diskInventoryMissingData.indexOf(s.id)!=-1;)this._diskInventoryMissingData.splice(this._diskInventoryMissingData.indexOf(s.id),1),this._diskInventoryMissingData.length===0&&W.instance.soundManager.events.dispatchEvent(new on(on.SDIR_SONG_DISK_INVENTORY_RECEIVENT_EVENT))}}}onSongDiskInventoryMessage(t){const e=t.getParser();this._songDiskInventory.reset();for(let s=0;s<e.songDiskCount;s++){const i=e.getDiskId(s),r=e.getSongId(s);this._songDiskInventory.add(i,r),this._availableSongs.get(r)||(this._diskInventoryMissingData.push(r),this.requestSongInfoWithoutSamples(r))}this._diskInventoryMissingData.length===0&&W.instance.soundManager.events.dispatchEvent(new on(on.SDIR_SONG_DISK_INVENTORY_RECEIVENT_EVENT))}onTick(){this._songRequestList.length!==0&&(W.instance.communication.connection.send(new QI(...this._songRequestList)),this._songRequestList=[])}requestSong(t,e){this._requestedSongs.get(t)===void 0&&(this._requestedSongs.set(t,e),this._songRequestList.push(t))}areSamplesRequested(t){return this._requestedSongs.get(t)?this._requestedSongs.get(t):!1}processSongEntryForPlaying(t,e=!0){return this.getSongDataEntry(t)?!0:(this.addSongInfoRequest(t),!1)}playSong(t,e,s=0,i=0,r=.5,a=.5){return!this.addSongStartRequest(e,t,s,i,r,a)||!this.processSongEntryForPlaying(t)?!1:(e>=this._priorityPlaying&&this.playSongObject(e,t),!0)}playSongObject(t,e){if(e===-1||t<0||t>=Qe.PRIORITY_COUNT)return!1;let s=!1;this.stopSongAtPriority(this._priorityPlaying)&&(s=!0);const i=this.getSongDataEntry(e);if(!i)return!1;if(s)return!0;this._musicPlayer.setVolume(W.instance.soundManager.traxVolume);let r=Ur.SKIP_POSITION_SET,a=0;const o=this.getSongStartRequest(t);return o&&(r=o.startPos,a=o.playLength,o.fadeInSeconds,o.fadeOutSeconds),r>=i.length/1e3?!1:(r<=Ur.SKIP_POSITION_SET&&(r=0),r=Math.trunc(r),this._priorityPlaying=t,this._requestNumberPlaying=this.getSongRequestCountAtPriority(t),this._songIdPlaying=e,this._priorityPlaying<=Ur.MAXIMUM_NOTIFY_PRIORITY&&this.notifySongPlaying(i),this._musicPlayer.preloadSamplesForSong(i.songData).then(()=>this._musicPlayer.play(i.songData,i.id,r,a)),t>Qe.PRIORITY_ROOM_PLAYLIST&&W.instance.soundManager.events.dispatchEvent(new Ji(Ji.NPE_USER_PLAY_SONG,t,i.id,-1)),!0)}notifySongPlaying(t){const s=Date.now();t.length>=8e3&&(this._previousNotifiedSongId!=t.id||s>this._previousNotificationTime+8e3)&&(W.instance.soundManager.events.dispatchEvent(new Ld(t.name,t.creator)),this._previousNotifiedSongId=t.id,this._previousNotificationTime=s)}addSongStartRequest(t,e,s,i,r,a){if(t<0||t>=Qe.PRIORITY_COUNT)return!1;const o=new TY(e,s,i,r,a);return this._songRequestsPerPriority[t]=o,this._songRequestCountsPerPriority[t]=this._songRequestCountsPerPriority[t]+1,!0}getSongDataEntry(t){let e;return this._availableSongs&&(e=this._availableSongs.get(t)),e}getSongStartRequest(t){return this._songRequestsPerPriority[t]}getTopRequestPriority(){return this._songRequestsPerPriority.length-1}getSongIdRequestedAtPriority(t){return t<0||t>=Qe.PRIORITY_COUNT||!this._songRequestsPerPriority[t]?-1:this._songRequestsPerPriority[t].songId}getSongRequestCountAtPriority(t){return t<0||t>=Qe.PRIORITY_COUNT?-1:this._songRequestCountsPerPriority[t]}playSongWithHighestPriority(){let t;this._priorityPlaying=-1,this._songIdPlaying=-1,this._requestNumberPlaying=-1;let s=this.getTopRequestPriority();for(;s>=0;){if(t=this.getSongIdRequestedAtPriority(s),t>=0&&this.playSongObject(s,t))return;s--}}resetSongStartRequest(t){t>=0&&t<Qe.PRIORITY_COUNT&&(this._songRequestsPerPriority[t]=void 0)}reRequestSongAtPriority(t){this._songRequestCountsPerPriority[t]=this._songRequestCountsPerPriority[t]+1}stopSongAtPriority(t){if(t===this._priorityPlaying&&this._priorityPlaying>=0){const e=this.getSongIdPlayingAtPriority(t);if(e>=0)return this.getSongDataEntry(e),this._musicPlayer.stop(),!0}return!1}onSoundMachineInit(t){this.disposeRoomPlaylist()}onSoundMachineDispose(t){this.disposeRoomPlaylist()}onJukeboxInit(t){this.disposeRoomPlaylist(),this._roomItemPlaylist=new mY,this._roomItemPlaylist.init(),W.instance.communication.connection.send(new qI)}onJukeboxDispose(t){this.disposeRoomPlaylist()}disposeRoomPlaylist(){this._roomItemPlaylist&&(this._roomItemPlaylist.dispose(),this._roomItemPlaylist=void 0)}};Ur.SKIP_POSITION_SET=-1,Ur.MAXIMUM_NOTIFY_PRIORITY=Qe.PRIORITY_ROOM_PLAYLIST;let Ud=Ur;class AY extends Js{constructor(){super(),this._volumeSystem=.5,this._volumeFurni=.5,this._volumeTrax=.5,this._internalSamples=new Xt,this._furniSamples=new Xt,this._furnitureBeingPlayed=new Xt,this._musicController=new Ud,this.onEvent=this.onEvent.bind(this)}onInit(){this._musicController.init(),W.instance.roomEngine.events.addEventListener(qe.PLAY_SAMPLE,this.onEvent),W.instance.roomEngine.events.addEventListener(Z.REMOVED,this.onEvent),W.instance.roomEngine.events.addEventListener(Ct.DISPOSED,this.onEvent),W.instance.events.addEventListener(Gr.SETTINGS_UPDATED,this.onEvent),W.instance.events.addEventListener($n.PLAY_SOUND,this.onEvent)}onDispose(){this._musicController&&(this._musicController.dispose(),this._musicController=null),W.instance.roomEngine.events.removeEventListener(qe.PLAY_SAMPLE,this.onEvent),W.instance.roomEngine.events.removeEventListener(Z.REMOVED,this.onEvent),W.instance.roomEngine.events.removeEventListener(Ct.DISPOSED,this.onEvent),W.instance.events.removeEventListener(Gr.SETTINGS_UPDATED,this.onEvent),W.instance.events.removeEventListener($n.PLAY_SOUND,this.onEvent)}onEvent(t){var e;switch(t.type){case qe.PLAY_SAMPLE:{const s=t;this.playFurniSample(s.objectId,s.sampleId,s.pitch);return}case Z.REMOVED:{const s=t;this.stopFurniSample(s.objectId);return}case Ct.DISPOSED:{this._furnitureBeingPlayed.getKeys().forEach(s=>{this.stopFurniSample(s)});return}case Gr.SETTINGS_UPDATED:{const s=t,i=s.volumeFurni!==this._volumeFurni,r=s.volumeTrax!==this._volumeTrax;this._volumeSystem=s.volumeSystem/100,this._volumeFurni=s.volumeFurni/100,this._volumeTrax=s.volumeTrax/100,i&&this.updateFurniSamplesVolume(this._volumeFurni),r&&((e=this._musicController)==null||e.updateVolume(this._volumeTrax));return}case $n.PLAY_SOUND:{const s=t;this.playInternalSample(s.sampleCode);return}}}playSample(t,e,s=1){t.volume=e,t.currentTime=0;try{t.play()}catch(i){j.error(i)}}playInternalSample(t){let e=this._internalSamples.getValue(t);if(!e){const s=q.getValue("sounds.url");e=new Audio(s.replace("%sample%",t)),this._internalSamples.add(t,e)}this.playSample(e,this._volumeSystem)}playFurniSample(t,e,s){let i=this._furniSamples.getValue(e);if(!i){const r=q.getValue("external.samples.url");i=new Audio(r.replace("%sample%",e.toString())),this._furniSamples.add(e,i)}this._furnitureBeingPlayed.hasKey(t)||this._furnitureBeingPlayed.add(t,e),i.onended=r=>{this.stopFurniSample(t)},i.onpause=r=>{this.stopFurniSample(t)},i.onerror=r=>{this.stopFurniSample(t)},this.playSample(i,this._volumeFurni,s)}stopInternalSample(t){const e=this._internalSamples.getValue(t);if(e)try{e.pause()}catch(s){j.error(s)}}stopFurniSample(t){const e=this._furnitureBeingPlayed.getValue(t);if(!e)return;const s=this._furniSamples.getValue(e);if(this._furnitureBeingPlayed.remove(t),!!s)try{s.pause()}catch(i){j.error(i)}}updateInternalSamplesVolume(t){this._internalSamples.getValues().forEach(e=>{e.volume=t})}updateFurniSamplesVolume(t){this._furniSamples.getValues().forEach(e=>{e.volume=t})}get traxVolume(){return this._volumeTrax}get musicController(){return this._musicController}}dt.available;$_.SCALE_MODE=window.devicePixelRatio%1?ml.LINEAR:ml.NEAREST;$_.ROUND_PIXELS=!0;$_.GC_MAX_IDLE=120;const os=class os{constructor(t,e){os.INSTANCE||(os.INSTANCE=this),this._application=new Kt(e),this._core=t,this._events=new $e,this._communication=new gV(t.communication),this._localization=new IV(this._communication),this._avatar=new vd,this._roomEngine=new so(this._communication),this._sessionDataManager=new IY(this._communication),this._roomSessionManager=new fY(this._communication,this._roomEngine),this._roomManager=new hc(this._roomEngine,this._roomEngine.visualizationFactory,this._roomEngine.logicFactory),this._cameraManager=new ap,this._soundManager=new AY,this._linkTrackers=[],this._isReady=!1,this._isDisposed=!1,this._core.configuration.events.addEventListener(ki.LOADED,this.onConfigurationLoadedEvent.bind(this)),this._roomEngine.events.addEventListener(Ct.ENGINE_INITIALIZED,this.onRoomEngineReady.bind(this))}static bootstrap(){os.INSTANCE&&(os.INSTANCE.dispose(),os.INSTANCE=null);const t=document.createElement("canvas"),e=new this(new Mm,{autoDensity:!1,width:window.innerWidth,height:window.innerHeight,resolution:window.devicePixelRatio,view:t});t.addEventListener("webglcontextlost",()=>e.events.dispatchEvent(new gt(os.WEBGL_CONTEXT_LOST)))}init(){if(!(this._isReady||this._isDisposed)){if(this._avatar&&this._avatar.init(),this._soundManager&&this._soundManager.init(),this._roomEngine&&(this._roomEngine.sessionDataManager=this._sessionDataManager,this._roomEngine.roomSessionManager=this._roomSessionManager,this._roomEngine.roomManager=this._roomManager,this._sessionDataManager&&this._sessionDataManager.init(),this._roomSessionManager&&this._roomSessionManager.init(),this._roomEngine.init()),!this._communication.connection)throw new Error("No connection found");new fV(this._communication.connection),this._isReady=!0}}dispose(){this._isDisposed||(this._roomManager&&(this._roomManager.dispose(),this._roomManager=null),this._roomSessionManager&&(this._roomSessionManager.dispose(),this._roomSessionManager=null),this._sessionDataManager&&(this._sessionDataManager.dispose(),this._sessionDataManager=null),this._roomEngine&&(this._roomEngine.dispose(),this._roomEngine=null),this._avatar&&(this._avatar.dispose(),this._avatar=null),this._soundManager&&(this._soundManager.dispose(),this._soundManager=null),this._communication&&(this._communication.dispose(),this._communication=null),this._application&&(this._application.destroy(),this._application=null),this._isDisposed=!0,this._isReady=!1)}onConfigurationLoadedEvent(t){ui().maxFPS=q.getValue("system.fps.max",24),j.LOG_DEBUG=q.getValue("system.log.debug",!0),j.LOG_WARN=q.getValue("system.log.warn",!1),j.LOG_ERROR=q.getValue("system.log.error",!1),j.LOG_EVENTS=q.getValue("system.log.events",!1),j.LOG_PACKETS=q.getValue("system.log.packets",!1),_h.LANDSCAPES_ENABLED=q.getValue("room.landscapes.enabled",!0)}onRoomEngineReady(t){this.startSendingHeartBeat()}getConfiguration(t,e=null){return q.getValue(t,e)}getLocalization(t){return this._localization.getValue(t)}getLocalizationWithParameter(t,e,s){return this._localization.getValueWithParameter(t,e,s)}getLocalizationWithParameters(t,e,s){return this._localization.getValueWithParameters(t,e,s)}addLinkEventTracker(t){this._linkTrackers.indexOf(t)>=0||this._linkTrackers.push(t)}removeLinkEventTracker(t){const e=this._linkTrackers.indexOf(t);e!==-1&&this._linkTrackers.splice(e,1)}createLinkEvent(t){if(!(!t||t===""))for(const e of this._linkTrackers){if(!e)continue;const s=e.eventUrlPrefix;s.length>0?t.substr(0,s.length)===s&&e.linkReceived(t):e.linkReceived(t)}}startSendingHeartBeat(){this.sendHeartBeat(),setInterval(this.sendHeartBeat,1e4)}sendHeartBeat(){Kn.sendHeartBeat()}get application(){return this._application}get core(){return this._core}get events(){return this._events}get localization(){return this._localization}get communication(){return this._communication}get avatar(){return this._avatar}get roomEngine(){return this._roomEngine}get sessionDataManager(){return this._sessionDataManager}get roomSessionManager(){return this._roomSessionManager}get roomManager(){return this._roomManager}get cameraManager(){return this._cameraManager}get soundManager(){return this._soundManager}get width(){return this._application.renderer.width}get height(){return this._application.renderer.height}get isReady(){return this._isReady}get isDisposed(){return this._isDisposed}static get instance(){return this.INSTANCE||null}};os.WEBGL_CONTEXT_LOST="NE_WEBGL_CONTEXT_LOST",os.WEBGL_UNAVAILABLE="NE_WEBGL_UNAVAILABLE",os.READY="NE_READY!",os.INSTANCE=null;let W=os;const rt=class rt{static format(t,e="",s=3){return t>s*rt.YEAR?rt.getLocalization("friendlytime.years"+e,Math.round(t/rt.YEAR)):t>s*rt.MONTH?rt.getLocalization("friendlytime.months"+e,Math.round(t/rt.MONTH)):t>s*rt.DAY?rt.getLocalization("friendlytime.days"+e,Math.round(t/rt.DAY)):t>s*rt.HOUR?rt.getLocalization("friendlytime.hours"+e,Math.round(t/rt.HOUR)):t>s*rt.MINUTE?rt.getLocalization("friendlytime.minutes"+e,Math.round(t/rt.MINUTE)):rt.getLocalization("friendlytime.seconds"+e,Math.round(t))}static shortFormat(t,e="",s=3){return t>s*rt.YEAR?rt.getLocalization("friendlytime.years.short"+e,Math.round(t/rt.YEAR)):t>s*rt.MONTH?rt.getLocalization("friendlytime.months.short"+e,Math.round(t/rt.MONTH)):t>s*rt.DAY?rt.getLocalization("friendlytime.days.short"+e,Math.round(t/rt.DAY)):t>s*rt.HOUR?rt.getLocalization("friendlytime.hours.short"+e,Math.round(t/rt.HOUR)):t>s*rt.MINUTE?rt.getLocalization("friendlytime.minutes.short"+e,Math.round(t/rt.MINUTE)):rt.getLocalization("friendlytime.seconds.short"+e,Math.round(t))}static getLocalization(t,e){return W.instance.getLocalizationWithParameter(t,"amount",e.toString())}};rt.MINUTE=60,rt.HOUR=60*rt.MINUTE,rt.DAY=24*rt.HOUR,rt.WEEK=7*rt.DAY,rt.MONTH=30*rt.DAY,rt.YEAR=365*rt.DAY;let gg=rt;const Q_=class Q_{static isBuilderClubId(t){return t>=Q_.BUILDER_CLUB_FURNI_ID_BASE}};Q_.BUILDER_CLUB_FURNI_ID_BASE=2147418112;let ch=Q_;const SY=n=>n>>>0,wT=n=>{const t=SY(n);return t>=Math.pow(2,31)?t-Math.pow(2,32):t};class eE{constructor(t){if(this._id=t.id,this._isMain=t.main||!1,this._avatarSets=new Map,this._bodyParts=[],this._allBodyParts=[],t.avatarSets&&t.avatarSets.length>0)for(const s of t.avatarSets){if(!s)continue;const i=new eE(s);this._avatarSets.set(i.id,i)}if(t.bodyParts&&t.bodyParts.length>0)for(const s of t.bodyParts)s&&this._bodyParts.push(s.id);let e=this._bodyParts.concat();for(const s of this._avatarSets.values())s&&(e=e.concat(s.getBodyParts()));this._allBodyParts=e}findAvatarSet(t){if(t===this._id)return this;for(const e of this._avatarSets.values())if(e&&e.findAvatarSet(t))return e;return null}getBodyParts(){return this._allBodyParts.concat()}get id(){return this._id}get isMain(){if(this._isMain)return!0;for(const t of this._avatarSets.values())if(t&&t.isMain)return!0;return!1}}class Ze{constructor(t=0,e=0,s=0){this._x=t,this._y=e,this._z=s}static dot(t,e){return t.x*e.x+t.y*e.y+t.z*e.z}static cross(t,e){const s=new Ze;return s.x=t.y*e.z-t.z*e.y,s.y=t.z*e.x-t.x*e.z,s.z=t.x*e.y-t.y*e.x,s}static subtract(t,e){return new Ze(t.x-e.x,t.y-e.y,t.z-e.z)}dot(t){return this._x*t.x+this._y*t.y+this._z*t.z}cross(t){const e=new Ze;return e.x=this._y*t.z-this._z*t.y,e.y=this._z*t.x-this._x*t.z,e.z=this._x*t.y-this._y*t.x,e}subtract(t){this._x=this._x-t.x,this._y=this._y-t.y,this._z=this._z-t.z}add(t){this._x=this._x+t.x,this._y=this._y+t.y,this._z=this._z+t.z}normalize(){const t=1/this.length();this._x=this._x*t,this._y=this._y*t,this._z=this._z*t}scaleBy(t){this._x*=t,this._y*=t,this._z*=t}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z)}toString(){return"Vector3D: ("+this._x+","+this._y+","+this._z+")"}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get z(){return this._z}set z(t){this._z=t}}class VT{constructor(t,e,s){this._location=new Ze(t,e,s),this._transformedLocation=new Ze,this._needsTransformation=!1,(t!=0||e!=0||s!=0)&&(this._needsTransformation=!0)}get location(){return this._location}get transformedLocation(){return this._transformedLocation}applyTransform(t){this._needsTransformation&&(this._transformedLocation=t.vectorMultiplication(this._location))}}class fg extends VT{constructor(t,e=!1){super(parseFloat(t.x),parseFloat(t.y),parseFloat(t.z)),this._id=t.id,this._radius=parseFloat(t.radius),this._normal=new Ze(parseFloat(t.nx),parseFloat(t.ny),parseFloat(t.nz)),this._isDoubleSided=t.double||!1,this._isDynamic=e}getDistance(t){const e=Math.abs(t.z-this.transformedLocation.z-this._radius),s=Math.abs(t.z-this.transformedLocation.z+this._radius);return Math.min(e,s)}get id(){return this._id}get normal(){return this._normal}get isDoubleSided(){return this._isDoubleSided}toString(){return this._id+": "+this.location+" - "+this.transformedLocation}get isDynamic(){return this._isDynamic}}class CY extends VT{constructor(t){if(super(parseFloat(t.x),parseFloat(t.y),parseFloat(t.z)),this._id=t.id,this._radius=parseFloat(t.radius),this._parts=new Map,this._dynamicParts=new Map,t.items&&t.items.length>0)for(const e of t.items){if(!e)continue;const s=new fg(e);this._parts.set(s.id,s)}}getDynamicParts(t){const e=this._dynamicParts.get(t),s=[];if(e)for(const i in e){const r=e[i];r&&s.push(r)}return s}getPartIds(t){const e=[];for(const s of this._parts.values())s&&e.push(s.id);if(t){const s=this._dynamicParts.get(t);if(s)for(const i in s){const r=s[i];r&&e.push(r.id)}}return e}removeDynamicParts(t){return this._dynamicParts.delete(t),!0}addPart(t,e){if(this.hasPart(t.id,e))return!1;let s=this._dynamicParts.get(e);return s||(s={},this._dynamicParts.set(e,s)),s[t.id]=new fg(t,!0),!0}hasPart(t,e){let s=this._parts.get(t)||null;return!s&&this._dynamicParts.get(e)!==void 0&&(s=this._dynamicParts.get(e)[t]||null),s!==null}getParts(t,e,s,i){const r=[];for(const h of this._parts.values())h&&(h.applyTransform(t),r.push([h.getDistance(e),h]));const a=this._dynamicParts.get(i);if(a)for(const h in a){const _=a[h];_&&(_.applyTransform(t),r.push([_.getDistance(e),_]))}r.sort((h,_)=>{const l=h[0],c=_[0];return l<c?-1:l>c?1:0});const o=[];for(const h of r)h&&o.push(h[1].id);return o}getDistance(t){const e=Math.abs(t.z-this.transformedLocation.z-this._radius),s=Math.abs(t.z-this.transformedLocation.z+this._radius);return Math.min(e,s)}get id(){return this._id}get radius(){return this._radius}}const Xe=class Xe{constructor(t=0,e=0,s=0,i=0,r=0,a=0,o=0,h=0,_=0){this._data=[t,e,s,i,r,a,o,h,_]}static getXRotationMatrix(t){const e=t*Math.PI/180,s=Math.cos(e),i=Math.sin(e);return new Xe(1,0,0,0,s,-i,0,i,s)}static getYRotationMatrix(t){const e=t*Math.PI/180,s=Math.cos(e),i=Math.sin(e);return new Xe(s,0,i,0,1,0,-i,0,s)}static getZRotationMatrix(t){const e=t*Math.PI/180,s=Math.cos(e),i=Math.sin(e);return new Xe(s,-i,0,i,s,0,0,0,1)}identity(){return this._data=[1,0,0,0,1,0,0,0,1],this}vectorMultiplication(t){const e=t.x*this._data[0]+t.y*this._data[3]+t.z*this._data[6],s=t.x*this._data[1]+t.y*this._data[4]+t.z*this._data[7],i=t.x*this._data[2]+t.y*this._data[5]+t.z*this._data[8];return new Ze(e,s,i)}multiply(t){const e=this._data[0]*t.data[0]+this._data[1]*t.data[3]+this._data[2]*t.data[6],s=this._data[0]*t.data[1]+this._data[1]*t.data[4]+this._data[2]*t.data[7],i=this._data[0]*t.data[2]+this._data[1]*t.data[5]+this._data[2]*t.data[8],r=this._data[3]*t.data[0]+this._data[4]*t.data[3]+this._data[5]*t.data[6],a=this._data[3]*t.data[1]+this._data[4]*t.data[4]+this._data[5]*t.data[7],o=this._data[3]*t.data[2]+this._data[4]*t.data[5]+this._data[5]*t.data[8],h=this._data[6]*t.data[0]+this._data[7]*t.data[3]+this._data[8]*t.data[6],_=this._data[6]*t.data[1]+this._data[7]*t.data[4]+this._data[8]*t.data[7],l=this._data[6]*t.data[2]+this._data[7]*t.data[5]+this._data[8]*t.data[8];return new Xe(e,s,i,r,a,o,h,_,l)}scalarMultiply(t){let e=0;for(;e<this._data.length;)this._data[e]=this._data[e]*t,e++}rotateX(t){const e=t*Math.PI/180,s=Math.cos(e),i=Math.sin(e);return new Xe(1,0,0,0,s,-i,0,i,s).multiply(this)}rotateY(t){const e=t*Math.PI/180,s=Math.cos(e),i=Math.sin(e);return new Xe(s,0,i,0,1,0,-i,0,s).multiply(this)}rotateZ(t){const e=t*Math.PI/180,s=Math.cos(e),i=Math.sin(e);return new Xe(s,-i,0,i,s,0,0,0,1).multiply(this)}skew(){}transpose(){return new Xe(this._data[0],this._data[3],this._data[6],this._data[1],this._data[4],this._data[7],this._data[2],this._data[5],this._data[8])}equals(t){return!1}get data(){return this._data}};Xe.IDENTITY=new Xe(1,0,0,0,1,0,0,0,1),Xe.TOLERANS=1e-18;let ra=Xe;class MY{constructor(t){this._camera=new Ze(0,0,10),this._avatarSet=new eE(t.avatarSets[0]),this._geometryTypes=new Map,this._itemIdToBodyPartMap=new Map,this._transformation=new ra,this._canvases=new Map;const e=t.camera;if(e&&(this._camera.x=parseFloat(e.x),this._camera.y=parseFloat(e.y),this._camera.z=parseFloat(e.z)),t.canvases&&t.canvases.length>0)for(const s of t.canvases){if(!s)continue;const i=s.scale,r=new Map;if(s.geometries&&s.geometries.length>0)for(const a of s.geometries){if(!a)continue;const o=new Hm(a,i);r.set(o.id,o)}this._canvases.set(i,r)}if(t.types&&t.types.length>0)for(const s of t.types){if(!s)continue;const i=new Map,r=new Map;if(s.bodyParts&&s.bodyParts.length>0)for(const a of s.bodyParts){if(!a)continue;const o=new CY(a);i.set(o.id,o);for(const h of o.getPartIds(null))r.set(h,o)}this._geometryTypes.set(s.id,i),this._itemIdToBodyPartMap.set(s.id,r)}}removeDynamicItems(t){for(const e of this._geometryTypes.values())if(e)for(const s of e.values())s&&s.removeDynamicParts(t)}getBodyPartIdsInAvatarSet(t){const e=this._avatarSet.findAvatarSet(t);return e?e.getBodyParts():[]}isMainAvatarSet(t){const e=this._avatarSet.findAvatarSet(t);return e?e.isMain:!1}getCanvas(t,e){const s=this._canvases.get(t);return s&&s.get(e)||null}typeExists(t){return!!this._geometryTypes.get(t)}hasBodyPart(t,e){if(this.typeExists(t)){const s=this._geometryTypes.get(t);if(s&&s.get(e))return!0}return!1}getBodyPartIDs(t){const e=this.getBodyPartsOfType(t),s=[];if(e)for(const i of e.values())i&&s.push(i.id);return s}getBodyPartsOfType(t){return this.typeExists(t)?this._geometryTypes.get(t):new Map}getBodyPart(t,e){return this.getBodyPartsOfType(t).get(e)||null}getBodyPartOfItem(t,e,s){const i=this._itemIdToBodyPartMap.get(t);if(i){const r=i.get(e);if(r)return r;const a=this.getBodyPartsOfType(t);if(a){for(const o of a.values())if(o&&o.hasPart(e,s))return o}}return null}getBodyPartsInAvatarSet(t,e){const s=this.getBodyPartIdsInAvatarSet(e),i=[];for(const r of s){if(!r)continue;const a=t.get(r);a&&i.push(a)}return i}getBodyPartsAtAngle(t,e,s){if(!s)return[];const i=this.getBodyPartsOfType(s),r=this.getBodyPartsInAvatarSet(i,t),a=[],o=[];this._transformation=ra.getYRotationMatrix(e);for(const h of r.values())h&&(h.applyTransform(this._transformation),a.push([h.getDistance(this._camera),h]));a.sort((h,_)=>{const l=h[0],c=_[0];return l<c?-1:l>c?1:0});for(const h of a)h&&o.push(h[1].id);return o}getParts(t,e,s,i,r){if(this.hasBodyPart(t,e)){const a=this.getBodyPartsOfType(t).get(e);return this._transformation=ra.getYRotationMatrix(s),a.getParts(this._transformation,this._camera,i,r)}return[]}}class NY extends $e{constructor(t){super(),this._renderManager=t,this._geometry=null,this._figureData=new km,this._partSetsData=new Km,this._animationData=new Ym,this._animationManager=new xm,this._mandatorySetTypeIds={},this._actionManager=null,this._defaultAction=null}init(){}dispose(){this.disposed||(super.dispose(),this._renderManager=null,this._figureData=null,this._partSetsData=null,this._animationData=null,this._mandatorySetTypeIds=null)}initGeometry(t){t&&(this._geometry=new MY(t))}initActions(t,e){e&&(this._actionManager=new Lm(t,e),this._defaultAction=this._actionManager.getDefaultAction())}updateActions(t){this._actionManager.updateActions(t),this._defaultAction=this._actionManager.getDefaultAction()}initPartSets(t){return t&&this._partSetsData.parse(t)?(this._partSetsData.getPartDefinition("ri").appendToFigure=!0,this._partSetsData.getPartDefinition("li").appendToFigure=!0,!0):!1}initAnimation(t){return t?this._animationData.parse(t):!1}initFigureData(t){return t?this._figureData.parse(t):!1}injectFigureData(t){this._figureData.injectJSON(t)}registerAnimations(t,e="fx",s=200){let i=0;for(;i<s;){const r=t.getCollection(e+i);if(r){const a=r.data;this._animationManager.registerAnimation(this,a.animations)}i++}}registerAnimation(t){this._animationManager.registerAnimation(this,t)}getPartColor(t,e,s=0){const i=t.getPartColorIds(e);if(!i||i.length<s)return null;const r=this._figureData.getSetType(e);if(r==null)return null;const a=this._figureData.getPalette(r.paletteID);return a?a.getColor(i[s]):null}getBodyPartData(t,e,s){return this._animationManager.getLayerData(t,e,s)}getAnimation(t){return this._animationManager.getAnimation(t)}getActionDefinition(t){return this._actionManager.getActionDefinition(t)}getActionDefinitionWithState(t){return this._actionManager.getActionDefinitionWithState(t)}isMainAvatarSet(t){return this._geometry.isMainAvatarSet(t)}sortActions(t){return this._actionManager.sortActions(t)}maxFrames(t){let e=0;for(const s of t)e=Math.max(e,this._animationData.getFrameCount(s.definition));return e}getMandatorySetTypeIds(t,e){return this._mandatorySetTypeIds[t]||(this._mandatorySetTypeIds[t]=[]),this._mandatorySetTypeIds[t][e]?this._mandatorySetTypeIds[t][e]:(this._mandatorySetTypeIds[t][e]=this._figureData.getMandatorySetTypeIds(t,e),this._mandatorySetTypeIds[t][e])}getDefaultPartSet(t,e){return this._figureData.getDefaultPartSet(t,e)}getCanvasOffsets(t,e,s){return this._actionManager.getCanvasOffsets(t,e,s)}getCanvas(t,e){return this._geometry.getCanvas(t,e)}removeDynamicItems(t){this._geometry.removeDynamicItems(t)}getActiveBodyPartIds(t,e){let s=[];const i=[],r=t.definition.geometryType;if(t.definition.isAnimation){const a=t.definition.state+"."+t.actionParameter,o=this._animationManager.getAnimation(a);if(o&&(s=o.getAnimatedBodyPartIds(0,t.overridingAction),o.hasAddData())){const h={id:"",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:1},_={setType:""};for(const l of o.addData){const c=this._geometry.getBodyPart(r,l.align);if(c){h.id=l.id,c.addPart(h,e),_.setType=l.id;const f=this._partSetsData.addPartDefinition(_);f.appendToFigure=!0,l.base===""&&(f.staticId=1),i.indexOf(c.id)===-1&&i.push(c.id)}}}for(const h of s){const _=this._geometry.getBodyPart(r,h);_&&i.indexOf(_.id)===-1&&i.push(_.id)}}else{s=this._partSetsData.getActiveParts(t.definition);for(const a of s){const o=this._geometry.getBodyPartOfItem(r,a,e);o&&i.indexOf(o.id)===-1&&i.push(o.id)}}return i}getBodyPartsUnordered(t){return this._geometry.getBodyPartIdsInAvatarSet(t)}getBodyParts(t,e,s){const i=Ki.DIRECTION_TO_ANGLE[s];return this._geometry.getBodyPartsAtAngle(t,i,e)}getFrameBodyPartOffset(t,e,s,i){const r=this._animationData.getAction(t.definition);return r?r.getFrameBodyPartOffset(e,s,i):Ka.DEFAULT_OFFSET}getParts(t,e,s,i,r,a,o,h=null){let _=null,l=[],c=null;if(!s==null)return[];const f=this._partSetsData.getActiveParts(s.definition),p=[];let m=[0];const O=this._animationData.getAction(s.definition);if(s.definition.isAnimation){const D=s.definition.state+"."+s.actionParameter,U=this._animationManager.getAnimation(D);if(U){m=this.getPopulatedArray(U.frameCount(s.overridingAction));for(const P of U.getAnimatedBodyPartIds(0,s.overridingAction))if(P===t){const v=this._geometry.getBodyPart(i,P);if(v)for(const F of v.getDynamicParts(o))f.push(F.id)}}}const A=this._geometry.getParts(i,t,r,f,o),C=e.getPartTypeIds();for(const D of C){if(h&&h.get(D))continue;const U=e.getPartSetId(D),P=e.getPartColorIds(D),v=this._figureData.getSetType(D);if(v){const F=this._figureData.getPalette(v.paletteID);if(F){const $=v.getPartSet(U);if($){a=a.concat($.hiddenLayers);for(const et of $.parts)if(A.indexOf(et.type)>-1){if(O){const ds=O.getPart(et.type);ds?l=ds.frames:l=m}else l=m;_=s.definition,f.indexOf(et.type)===-1&&(_=this._defaultAction);const at=this._partSetsData.getPartDefinition(et.type);let At=at?at.flippedSetType:et.type;(!At||At==="")&&(At=et.type),P&&P.length>et.colorLayerIndex-1&&(c=F.getColor(P[et.colorLayerIndex-1]));const oe=et.colorLayerIndex>0,zt=new dl(t,et.type,et.id.toString(),c,l,_,oe,et.paletteMap,At);p.push(zt)}}}}}const L=[];for(const D of A){let U=null,P=!1;const v=h&&h.get(D);for(const F of p)F.partType===D&&(v?U=F.color:(P=!0,a.indexOf(D)===-1&&L.push(F)));if(!P){if(v){const F=h.get(D);let $=0,et=0;for(;et<F.length;)$=$+F.charCodeAt(et),et++;if(O){const At=O.getPart(D);At?l=At.frames:l=m}else l=m;const at=new dl(t,D,F,U,l,s.definition,U!=null,-1,D,!1,1);L.push(at)}else if(f.indexOf(D)>-1){const F=this._geometry.getBodyPartOfItem(i,D,o);if(t===F.id){const $=this._partSetsData.getPartDefinition(D);let et=!1,at=1;if($.appendToFigure){let At="1";if(s.actionParameter!==""&&(At=s.actionParameter),$.hasStaticId()&&(At=$.staticId.toString()),O){const zt=O.getPart(D);zt?l=zt.frames:l=m}else l=m;const oe=new dl(t,D,At,null,l,s.definition,!1,-1,D,et,at);L.push(oe)}}}}}return L}getPopulatedArray(t){const e=[];let s=0;for(;s<t;)e.push(s),s++;return e}getItemIds(){if(this._actionManager){const t=this._actionManager.getActionDefinition("CarryItem").params,e=[];for(const s of t.values())e.push(s);return e}return[]}get renderManager(){return this._renderManager}get figureData(){return this._figureData}get partData(){return this._partSetsData}get animationManager(){return this._animationManager}}const DY={animations:[{id:"Move",parts:[{setType:"bd",frames:[{number:0,assetPartDefinition:"wlk"},{number:1,assetPartDefinition:"wlk"},{number:2,assetPartDefinition:"wlk"},{number:3,assetPartDefinition:"wlk"}]},{setType:"bds",frames:[{number:0,assetPartDefinition:"wlk"},{number:1,assetPartDefinition:"wlk"},{number:2,assetPartDefinition:"wlk"},{number:3,assetPartDefinition:"wlk"}]},{setType:"ss",frames:[{number:0,assetPartDefinition:"wlk"},{number:1,assetPartDefinition:"wlk"},{number:2,assetPartDefinition:"wlk"},{number:3,assetPartDefinition:"wlk"}]},{setType:"lg",frames:[{number:0,assetPartDefinition:"wlk"},{number:1,assetPartDefinition:"wlk"},{number:2,assetPartDefinition:"wlk"},{number:3,assetPartDefinition:"wlk"}]},{setType:"sh",frames:[{number:0,assetPartDefinition:"wlk"},{number:1,assetPartDefinition:"wlk"},{number:2,assetPartDefinition:"wlk"},{number:3,assetPartDefinition:"wlk"}]},{setType:"lh",frames:[{number:0,assetPartDefinition:"wlk"},{number:1,assetPartDefinition:"wlk"},{number:2,assetPartDefinition:"wlk"},{number:3,assetPartDefinition:"wlk"}]},{setType:"lhs",frames:[{number:0,assetPartDefinition:"wlk"},{number:1,assetPartDefinition:"wlk"},{number:2,assetPartDefinition:"wlk"},{number:3,assetPartDefinition:"wlk"}]},{setType:"ls",frames:[{number:0,assetPartDefinition:"wlk"},{number:1,assetPartDefinition:"wlk"},{number:2,assetPartDefinition:"wlk"},{number:3,assetPartDefinition:"wlk"}]},{setType:"lc",frames:[{number:0,assetPartDefinition:"wlk"},{number:1,assetPartDefinition:"wlk"},{number:2,assetPartDefinition:"wlk"},{number:3,assetPartDefinition:"wlk"}]},{setType:"rh",frames:[{number:0,assetPartDefinition:"wlk"},{number:1,assetPartDefinition:"wlk"},{number:2,assetPartDefinition:"wlk"},{number:3,assetPartDefinition:"wlk"}]},{setType:"rhs",frames:[{number:0,assetPartDefinition:"wlk"},{number:1,assetPartDefinition:"wlk"},{number:2,assetPartDefinition:"wlk"},{number:3,assetPartDefinition:"wlk"}]},{setType:"rs",frames:[{number:0,assetPartDefinition:"wlk"},{number:1,assetPartDefinition:"wlk"},{number:2,assetPartDefinition:"wlk"},{number:3,assetPartDefinition:"wlk"}]},{setType:"rc",frames:[{number:0,assetPartDefinition:"wlk"},{number:1,assetPartDefinition:"wlk"},{number:2,assetPartDefinition:"wlk"},{number:3,assetPartDefinition:"wlk"}]},{setType:"ch",frames:[{number:0,assetPartDefinition:"wlk"},{number:1,assetPartDefinition:"wlk"},{number:2,assetPartDefinition:"wlk"},{number:3,assetPartDefinition:"wlk"}]}]},{id:"Wave",parts:[{setType:"lh",frames:[{number:0,assetPartDefinition:"wav"},{number:1,assetPartDefinition:"wav"}]},{setType:"lhs",frames:[{number:0,assetPartDefinition:"wav"},{number:1,assetPartDefinition:"wav"}]},{setType:"ls",frames:[{number:0,assetPartDefinition:"wav"},{number:1,assetPartDefinition:"wav"}]},{setType:"lc",frames:[{number:0,assetPartDefinition:"wav"},{number:1,assetPartDefinition:"wav"}]},{setType:"ch",frames:[{number:0,assetPartDefinition:"wav"},{number:1,assetPartDefinition:"wav"},{number:2,assetPartDefinition:"wav"},{number:3,assetPartDefinition:"wav"}]}]},{id:"Talk",parts:[{setType:"hd",frames:[{number:0,assetPartDefinition:"spk"},{number:1,assetPartDefinition:"spk"}]},{setType:"fc",frames:[{number:0,assetPartDefinition:"spk"},{number:1,assetPartDefinition:"spk"}]},{setType:"fa",frames:[{number:0,assetPartDefinition:"spk"},{number:1,assetPartDefinition:"spk"}]}]},{id:"Sign",parts:[{setType:"lh",frames:[{number:0,assetPartDefinition:"sig"}]},{setType:"li",frames:[{number:0,assetPartDefinition:"sig"}]},{setType:"ls",frames:[{number:0,assetPartDefinition:"wav"}]},{setType:"lc",frames:[{number:0,assetPartDefinition:"wav"}]}]},{id:"Respect",parts:[{setType:"lh",frames:[{number:0,assetPartDefinition:"respect",repeats:15},{number:1,assetPartDefinition:"respect",repeats:15}]},{setType:"ls",frames:[{number:0,assetPartDefinition:"wav",repeats:15},{number:1,assetPartDefinition:"wav",repeats:15}]},{setType:"lc",frames:[{number:0,assetPartDefinition:"wav",repeats:15},{number:1,assetPartDefinition:"wav",repeats:15}]}]},{id:"Blow",parts:[{setType:"rh",frames:[{number:0,assetPartDefinition:"blw",repeats:10},{number:1,assetPartDefinition:"blw",repeats:10}]},{setType:"rs",frames:[{number:0,assetPartDefinition:"drk"}]},{setType:"rc",frames:[{number:0,assetPartDefinition:"drk"}]},{setType:"ri",frames:[{number:0,assetPartDefinition:""}]},{setType:"ey",frames:[{number:0,assetPartDefinition:"std",repeats:10},{number:0,assetPartDefinition:"eyb",repeats:10}]},{setType:"fc",frames:[{number:0,assetPartDefinition:"std",repeats:10},{number:0,assetPartDefinition:"blw",repeats:10}]}]},{id:"Laugh",parts:[{setType:"rh",frames:[{number:0,assetPartDefinition:"blw"}]},{setType:"rs",frames:[{number:0,assetPartDefinition:"drk"}]},{setType:"rc",frames:[{number:0,assetPartDefinition:"drk"}]},{setType:"ri",frames:[{number:0,assetPartDefinition:""}]},{setType:"ey",frames:[{number:0,assetPartDefinition:"std",repeats:2}]},{setType:"fc",frames:[{number:0,assetPartDefinition:"sml"}]}],offsets:{frames:[{id:0,directions:[{id:0,bodyParts:[{id:"head",dx:0,dy:1}]},{id:1,bodyParts:[{id:"head",dx:0,dy:1}]},{id:2,bodyParts:[{id:"head",dx:0,dy:1}]},{id:3,bodyParts:[{id:"head",dx:0,dy:1}]},{id:4,bodyParts:[{id:"head",dx:0,dy:1}]},{id:5,bodyParts:[{id:"head",dx:0,dy:1}]},{id:6,bodyParts:[{id:"head",dx:0,dy:1}]},{id:7,bodyParts:[{id:"head",dx:0,dy:1}]}]},{id:1,directions:[{id:0,bodyParts:[{id:"head",dx:0,dy:0}]},{id:1,bodyParts:[{id:"head",dx:0,dy:0}]},{id:2,bodyParts:[{id:"head",dx:0,dy:0}]},{id:3,bodyParts:[{id:"head",dx:0,dy:0}]},{id:4,bodyParts:[{id:"head",dx:0,dy:0}]},{id:5,bodyParts:[{id:"head",dx:0,dy:0}]},{id:6,bodyParts:[{id:"head",dx:0,dy:0}]},{id:7,bodyParts:[{id:"head",dx:0,dy:0}]}]}]}}]},LY={geometry:{direction:0,camera:{x:0,y:0,z:10},canvases:[{scale:"h",geometries:[{id:"vertical",width:90,height:130,dx:0,dy:0},{id:"sitting",width:90,height:130,dx:0,dy:0},{id:"horizontal",width:128,height:80,dx:30,dy:0},{id:"swhorizontal",width:192,height:120,dx:0,dy:-40}]},{scale:"sh",geometries:[{id:"vertical",width:45,height:72,dx:0,dy:0},{id:"sitting",width:45,height:72,dx:0,dy:0},{id:"horizontal",width:64,height:50,dx:15,dy:-10},{id:"swhorizontal",width:96,height:70,dx:0,dy:-20},{id:"swim",width:64,height:70,dx:25,dy:10}]}],avatarSets:[{id:"full",avatarSets:[{id:"body",main:!0,bodyParts:[{id:"top"},{id:"bottom"},{id:"behind"},{id:"torso"},{id:"leftitem"},{id:"rightitem"},{id:"leftarm"},{id:"rightarm"}]},{id:"head",bodyParts:[{id:"head"}]}]}],types:[{id:"vertical",bodyParts:[{id:"top",x:0,y:0,z:0,radius:2},{id:"bottom",x:0,y:0,z:0,radius:.001},{id:"behind",x:0,y:0,z:.2,radius:.3},{id:"torso",x:0,y:0,z:0,radius:.4,items:[{id:"bd",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!0},{id:"bds",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!0},{id:"ch",x:0,y:0,z:0,radius:.04,nx:0,ny:0,nz:-1,double:!1},{id:"sh",x:0,y:0,z:0,radius:.02,nx:0,ny:0,nz:-1,double:!1},{id:"lg",x:0,y:0,z:0,radius:.03,nx:0,ny:0,nz:-1,double:!1},{id:"ss",x:0,y:0,z:0,radius:.04,nx:0,ny:0,nz:-1,double:!1},{id:"cp",x:0,y:0,z:0,radius:.045,nx:0,ny:0,nz:-1,double:!1},{id:"wa",x:0,y:0,z:0,radius:.05,nx:0,ny:0,nz:-1,double:!1},{id:"cc",x:0,y:0,z:0,radius:.06,nx:0,ny:0,nz:-1,double:!1},{id:"ca",x:0,y:0,z:0,radius:.07,nx:0,ny:0,nz:-1,double:!1}]},{id:"leftitem",x:0,y:0,z:-.29,radius:.3,items:[{id:"li",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1}]},{id:"rightitem",x:0,y:0,z:-.29,radius:.3,items:[{id:"ri",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1}]},{id:"leftarm",x:-1,y:0,z:-.51,radius:.5,items:[{id:"lh",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1},{id:"lhs",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1},{id:"ls",x:0,y:0,z:0,radius:.02,nx:0,ny:0,nz:-1,double:!1},{id:"lc",x:0,y:0,z:0,radius:.025,nx:0,ny:0,nz:-1,double:!1}]},{id:"rightarm",x:1,y:0,z:-.51,radius:.5,items:[{id:"rh",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1},{id:"rhs",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1},{id:"rs",x:0,y:0,z:0,radius:.02,nx:0,ny:0,nz:-1,double:!1},{id:"rc",x:0,y:0,z:0,radius:.025,nx:0,ny:0,nz:-1,double:!1}]},{id:"head",x:0,y:0,z:0,radius:.5,items:[{id:"hd",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!0},{id:"fc",x:0,y:0,z:0,radius:.02,nx:0,ny:0,nz:-1,double:!1},{id:"ey",x:0,y:0,z:0,radius:.03,nx:0,ny:0,nz:-1,double:!1},{id:"hr",x:0,y:0,z:0,radius:.04,nx:0,ny:0,nz:-1,double:!0},{id:"hrb",x:0,y:0,z:0,radius:.05,nx:0,ny:0,nz:-1,double:!0},{id:"fa",x:0,y:0,z:0,radius:.06,nx:0,ny:0,nz:-1,double:!1},{id:"ea",x:0,y:0,z:0,radius:.07,nx:0,ny:0,nz:-1,double:!1},{id:"ha",x:0,y:0,z:0,radius:.08,nx:0,ny:0,nz:-1,double:!1},{id:"he",x:0,y:0,z:0,radius:.09,nx:0,ny:0,nz:-1,double:!1}]}]},{id:"sitting",bodyParts:[{id:"top",x:0,y:0,z:0,radius:2},{id:"bottom",x:0,y:0,z:0,radius:.001},{id:"behind",x:0,y:0,z:.2,radius:.3},{id:"torso",x:0,y:0,z:0,radius:.4,items:[{id:"bd",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!0},{id:"bds",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!0},{id:"ch",x:0,y:0,z:0,radius:.03,nx:0,ny:0,nz:-1,double:!1},{id:"sh",x:0,y:0,z:0,radius:.04,nx:0,ny:0,nz:-1,double:!1},{id:"lg",x:0,y:0,z:0,radius:.02,nx:0,ny:0,nz:-1,double:!1},{id:"ss",x:0,y:0,z:0,radius:.04,nx:0,ny:0,nz:-1,double:!1},{id:"cp",x:0,y:0,z:0,radius:.045,nx:0,ny:0,nz:-1,double:!1},{id:"wa",x:0,y:0,z:0,radius:.05,nx:0,ny:0,nz:-1,double:!1},{id:"cc",x:0,y:0,z:0,radius:.06,nx:0,ny:0,nz:-1,double:!1},{id:"ca",x:0,y:0,z:0,radius:.07,nx:0,ny:0,nz:-1,double:!1}]},{id:"leftitem",x:0,y:0,z:-.29,radius:.3,items:[{id:"li",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1}]},{id:"rightitem",x:0,y:0,z:-.29,radius:.3,items:[{id:"ri",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1}]},{id:"leftarm",x:-1,y:0,z:-.51,radius:.5,items:[{id:"lh",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1},{id:"lhs",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1},{id:"ls",x:0,y:0,z:0,radius:.02,nx:0,ny:0,nz:-1,double:!1},{id:"lc",x:0,y:0,z:0,radius:.025,nx:0,ny:0,nz:-1,double:!1}]},{id:"rightarm",x:1,y:0,z:-.51,radius:.5,items:[{id:"rh",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1},{id:"rhs",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1},{id:"rs",x:0,y:0,z:0,radius:.02,nx:0,ny:0,nz:-1,double:!1},{id:"rc",x:0,y:0,z:0,radius:.025,nx:0,ny:0,nz:-1,double:!1}]},{id:"head",x:0,y:0,z:0,radius:.5,items:[{id:"hd",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!0},{id:"fc",x:0,y:0,z:0,radius:.02,nx:0,ny:0,nz:-1,double:!1},{id:"ey",x:0,y:0,z:0,radius:.03,nx:0,ny:0,nz:-1,double:!1},{id:"hr",x:0,y:0,z:0,radius:.04,nx:0,ny:0,nz:-1,double:!0},{id:"hrb",x:0,y:0,z:0,radius:.05,nx:0,ny:0,nz:-1,double:!0},{id:"fa",x:0,y:0,z:0,radius:.06,nx:0,ny:0,nz:-1,double:!1},{id:"ea",x:0,y:0,z:0,radius:.07,nx:0,ny:0,nz:-1,double:!1},{id:"ha",x:0,y:0,z:0,radius:.08,nx:0,ny:0,nz:-1,double:!1},{id:"he",x:0,y:0,z:0,radius:.09,nx:0,ny:0,nz:-1,double:!1}]}]},{id:"horizontal",bodyParts:[{id:"torso",x:0,y:0,z:0,radius:.4,items:[{id:"bd",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!0},{id:"bds",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!0},{id:"ch",x:0,y:0,z:0,radius:.02,nx:0,ny:0,nz:-1,double:!1},{id:"cp",x:0,y:0,z:0,radius:.025,nx:0,ny:0,nz:-1,double:!1},{id:"sh",x:0,y:0,z:0,radius:.04,nx:0,ny:0,nz:-1,double:!1},{id:"lg",x:0,y:0,z:0,radius:.03,nx:0,ny:0,nz:-1,double:!1},{id:"ss",x:0,y:0,z:0,radius:.03,nx:0,ny:0,nz:-1,double:!1},{id:"wa",x:0,y:0,z:0,radius:.05,nx:0,ny:0,nz:-1,double:!1},{id:"cc",x:0,y:0,z:0,radius:.06,nx:0,ny:0,nz:-1,double:!1},{id:"ca",x:0,y:0,z:0,radius:.07,nx:0,ny:0,nz:-1,double:!1}]},{id:"leftitem",x:0,y:0,z:-.29,radius:.3,items:[{id:"li",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1}]},{id:"rightitem",x:0,y:0,z:-.29,radius:.3,items:[{id:"ri",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1}]},{id:"leftarm",x:-1,y:0,z:-.51,radius:.6,items:[{id:"lh",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1},{id:"lhs",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1},{id:"ls",x:0,y:0,z:0,radius:.02,nx:0,ny:0,nz:-1,double:!1},{id:"lc",x:0,y:0,z:0,radius:.025,nx:0,ny:0,nz:-1,double:!1}]},{id:"rightarm",x:1,y:0,z:-.51,radius:.6,items:[{id:"rh",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1},{id:"rhs",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1},{id:"rs",x:0,y:0,z:0,radius:.02,nx:0,ny:0,nz:-1,double:!1},{id:"rc",x:0,y:0,z:0,radius:.025,nx:0,ny:0,nz:-1,double:!1}]},{id:"head",x:0,y:0,z:0,radius:.5,items:[{id:"hd",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!0},{id:"fc",x:0,y:0,z:0,radius:.02,nx:0,ny:0,nz:-1,double:!1},{id:"ey",x:0,y:0,z:0,radius:.03,nx:0,ny:0,nz:-1,double:!1},{id:"hr",x:0,y:0,z:0,radius:.04,nx:0,ny:0,nz:-1,double:!0},{id:"hrb",x:0,y:0,z:0,radius:.05,nx:0,ny:0,nz:-1,double:!0},{id:"fa",x:0,y:0,z:0,radius:.06,nx:0,ny:0,nz:-1,double:!1},{id:"ea",x:0,y:0,z:0,radius:.07,nx:0,ny:0,nz:-1,double:!1},{id:"ha",x:0,y:0,z:0,radius:.08,nx:0,ny:0,nz:-1,double:!1},{id:"he",x:0,y:0,z:0,radius:.09,nx:0,ny:0,nz:-1,double:!1}]}]},{id:"swhorizontal",bodyParts:[{id:"torso",x:0,y:0,z:0,radius:.4,items:[{id:"bd",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!0},{id:"bds",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!0},{id:"ch",x:0,y:0,z:0,radius:.02,nx:0,ny:0,nz:-1,double:!1},{id:"cp",x:0,y:0,z:0,radius:.025,nx:0,ny:0,nz:-1,double:!1},{id:"sh",x:0,y:0,z:0,radius:.04,nx:0,ny:0,nz:-1,double:!1},{id:"lg",x:0,y:0,z:0,radius:.03,nx:0,ny:0,nz:-1,double:!1},{id:"ss",x:0,y:0,z:0,radius:.03,nx:0,ny:0,nz:-1,double:!1},{id:"wa",x:0,y:0,z:0,radius:.05,nx:0,ny:0,nz:-1,double:!1},{id:"cc",x:0,y:0,z:0,radius:.06,nx:0,ny:0,nz:-1,double:!1},{id:"ca",x:0,y:0,z:0,radius:.07,nx:0,ny:0,nz:-1,double:!1}]},{id:"leftitem",x:0,y:0,z:-.29,radius:.3,items:[{id:"li",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1}]},{id:"rightitem",x:0,y:0,z:-.29,radius:.3,items:[{id:"ri",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1}]},{id:"leftarm",x:-1,y:0,z:-.51,radius:.6,items:[{id:"lh",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1},{id:"lhs",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1},{id:"ls",x:0,y:0,z:0,radius:.02,nx:0,ny:0,nz:-1,double:!1},{id:"lc",x:0,y:0,z:0,radius:.025,nx:0,ny:0,nz:-1,double:!1}]},{id:"rightarm",x:1,y:0,z:-.51,radius:.6,items:[{id:"rh",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1},{id:"rhs",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!1},{id:"rs",x:0,y:0,z:0,radius:.02,nx:0,ny:0,nz:-1,double:!1},{id:"rc",x:0,y:0,z:0,radius:.025,nx:0,ny:0,nz:-1,double:!1}]},{id:"head",x:0,y:0,z:0,radius:.5,items:[{id:"hd",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!0},{id:"fc",x:0,y:0,z:0,radius:.02,nx:0,ny:0,nz:-1,double:!1},{id:"ey",x:0,y:0,z:0,radius:.03,nx:0,ny:0,nz:-1,double:!1},{id:"hr",x:0,y:0,z:0,radius:.04,nx:0,ny:0,nz:-1,double:!0},{id:"hrb",x:0,y:0,z:0,radius:.05,nx:0,ny:0,nz:-1,double:!0},{id:"fa",x:0,y:0,z:0,radius:.06,nx:0,ny:0,nz:-1,double:!1},{id:"ea",x:0,y:0,z:0,radius:.07,nx:0,ny:0,nz:-1,double:!1},{id:"ha",x:0,y:0,z:0,radius:.08,nx:0,ny:0,nz:-1,double:!1},{id:"he",x:0,y:0,z:0,radius:.09,nx:0,ny:0,nz:-1,double:!1}]}]},{id:"swim",bodyParts:[{id:"torso",x:0,y:0,z:0,radius:.4,items:[{id:"bds",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!0},{id:"ss",x:0,y:0,z:0,radius:.03,nx:0,ny:0,nz:-1,double:!1}]},{id:"head",x:0,y:0,z:0,radius:.5,items:[{id:"hd",x:0,y:0,z:0,radius:.01,nx:0,ny:0,nz:-1,double:!0},{id:"fc",x:0,y:0,z:0,radius:.02,nx:0,ny:0,nz:-1,double:!1},{id:"ey",x:0,y:0,z:0,radius:.03,nx:0,ny:0,nz:-1,double:!1},{id:"hr",x:0,y:0,z:0,radius:.04,nx:0,ny:0,nz:-1,double:!0},{id:"hrb",x:0,y:0,z:0,radius:.05,nx:0,ny:0,nz:-1,double:!0},{id:"fa",x:0,y:0,z:0,radius:.06,nx:0,ny:0,nz:-1,double:!1},{id:"ea",x:0,y:0,z:0,radius:.07,nx:0,ny:0,nz:-1,double:!1},{id:"ha",x:0,y:0,z:0,radius:.08,nx:0,ny:0,nz:-1,double:!1},{id:"he",x:0,y:0,z:0,radius:.09,nx:0,ny:0,nz:-1,double:!1}]}]}]}},PY={partSets:{partSet:[{setType:"ri",flippedSetType:"ri"},{setType:"ri",flippedSetType:"ri"},{setType:"rh",flippedSetType:"lh"},{setType:"rhs",flippedSetType:"lhs"},{setType:"rs",swim:"0",flippedSetType:"ls"},{setType:"rc",flippedSetType:"lc"},{setType:"bd"},{setType:"bds"},{setType:"ss"},{setType:"sh"},{setType:"lg"},{setType:"ch"},{setType:"cp"},{setType:"cc"},{setType:"hd"},{setType:"fc"},{setType:"ey"},{setType:"hr"},{setType:"hrb",removeSetType:"hr"},{setType:"li",flippedSetType:"li"},{setType:"lh",flippedSetType:"rh"},{setType:"lhs",flippedSetType:"rhs"},{setType:"ls",flippedSetType:"rs"},{setType:"lc",flippedSetType:"rc"},{setType:"wa"},{setType:"ea"},{setType:"ca"},{setType:"fa"},{setType:"ha"},{setType:"he"}],activePartSets:[{id:"figure",activeParts:[{setType:"rh"},{setType:"rh"},{setType:"rhs"},{setType:"rs"},{setType:"rc"},{setType:"bd"},{setType:"bds"},{setType:"ss"},{setType:"sh"},{setType:"lg"},{setType:"ch"},{setType:"cp"},{setType:"cc"},{setType:"wa"},{setType:"hd"},{setType:"fc"},{setType:"ey"},{setType:"hr"},{setType:"hrb"},{setType:"lh"},{setType:"lhs"},{setType:"ls"},{setType:"lc"},{setType:"ea"},{setType:"ca"},{setType:"fa"},{setType:"ha"},{setType:"he"}]},{id:"head",activeParts:[{setType:"hd"},{setType:"fc"},{setType:"ey"},{setType:"hr"},{setType:"hrb"},{setType:"ea"},{setType:"fa"},{setType:"ha"},{setType:"he"}]},{id:"speak",activeParts:[{setType:"hd"},{setType:"hr"},{setType:"hrb"},{setType:"fc"},{setType:"fa"},{setType:"ha"}]},{id:"gesture",activeParts:[{setType:"ey"},{setType:"fc"}]},{id:"eye",activeParts:[{setType:"ey"}]},{id:"handRight",activeParts:[{setType:"rh"},{setType:"rhs"},{setType:"rs"},{setType:"rc"},{setType:"ri"}]},{id:"handRightAndHead",activeParts:[{setType:"rh"},{setType:"rhs"},{setType:"rs"},{setType:"rc"},{setType:"ri"},{setType:"ey"},{setType:"fc"},{setType:"hd"}]},{id:"handLeft",activeParts:[{setType:"lh"},{setType:"lhs"},{setType:"ls"},{setType:"lc"},{setType:"li"}]},{id:"walk",activeParts:[{setType:"bd"},{setType:"bds"},{setType:"ss"},{setType:"lg"},{setType:"lh"},{setType:"lhs"},{setType:"rh"},{setType:"rhs"},{setType:"ls"},{setType:"lc"},{setType:"rs"},{setType:"rc"},{setType:"sh"}]},{id:"sit",activeParts:[{setType:"bd"},{setType:"bds"},{setType:"ss"},{setType:"lg"},{setType:"sh"},{setType:"cc"}]},{id:"itemRight",activeParts:[{setType:"ri"}]}]}},Be=class Be extends $e{constructor(t,e,s,i){super(),this._state=Be.NOT_LOADED,this._libraryName=t,this._revision=e,this._downloadUrl=i,this._assets=s,this._animation=null,this._downloadUrl=this._downloadUrl.replace(/%libname%/gi,this._libraryName),this._downloadUrl=this._downloadUrl.replace(/%revision%/gi,this._revision),this._assets.getCollection(this._libraryName)&&(this._state=Be.LOADED)}async downloadAsset(){if(!this._assets||this._state===Be.LOADING||this._state===Be.LOADED)return;if(this._assets.getCollection(this._libraryName)){this._state=Be.LOADED,this.dispatchEvent(new br(br.DOWNLOAD_COMPLETE,this));return}if(this._state=Be.LOADING,!await this._assets.downloadAsset(this._downloadUrl))return;this._state=Be.LOADED;const s=this._assets.getCollection(this._libraryName);s&&(this._animation=s.data.animations),this.dispatchEvent(new br(br.DOWNLOAD_COMPLETE,this))}get libraryName(){return this._libraryName}get animation(){return this._animation}get isLoaded(){return this._state===Be.LOADED}};Be.DOWNLOAD_COMPLETE="EADL_DOWNLOAD_COMPLETE",Be.NOT_LOADED=0,Be.LOADING=1,Be.LOADED=2;let yd=Be;const yr=class yr extends $e{constructor(t,e){super(),this._assets=t,this._structure=e,this._missingMandatoryLibs=q.getValue("avatar.mandatory.effect.libraries"),this._effectMap=new Map,this._effectListeners=new Map,this._incompleteEffects=new Map,this._initDownloadBuffer=[],this._pendingDownloadQueue=[],this._currentDownloads=[],this._libraryNames=[],this._isReady=!1,this.onLibraryLoaded=this.onLibraryLoaded.bind(this),this.onAvatarRenderReady=this.onAvatarRenderReady.bind(this),this.loadEffectMap(),this._structure.renderManager.events.addEventListener(ka.AVATAR_RENDER_READY,this.onAvatarRenderReady)}loadEffectMap(){const t=new XMLHttpRequest;try{t.open("GET",q.getValue("avatar.effectmap.url")),t.send(),t.onloadend=e=>{if(t.responseText){const s=JSON.parse(t.responseText);this.processEffectMap(s.effects),this.processMissingLibraries(),this._isReady=!0,this.dispatchEvent(new gt(yr.DOWNLOADER_READY))}},t.onerror=e=>{throw new Error("invalid_avatar_effect_map")}}catch(e){j.error(e)}}processEffectMap(t){if(t)for(const e of t){if(!e)continue;const s=e.id,i=e.lib,r=e.revision||"";if(this._libraryNames.indexOf(i)>=0)continue;this._libraryNames.push(i);const a=new yd(i,r,this._assets,q.getValue("avatar.asset.effect.url"));a.addEventListener(br.DOWNLOAD_COMPLETE,this.onLibraryLoaded);let o=this._effectMap.get(s);o||(o=[]),o.push(a),this._effectMap.set(s,o)}}downloadAvatarEffect(t,e){if(!this._isReady||!this._structure.renderManager.isReady){this._initDownloadBuffer.push([t,e]);return}const s=this.getAvatarEffectPendingLibraries(t);if(s&&s.length){if(e&&!e.disposed){let i=this._effectListeners.get(t.toString());i||(i=[]),i.push(e),this._effectListeners.set(t.toString(),i)}this._incompleteEffects.set(t.toString(),s);for(const i of s)i&&this.downloadLibrary(i)}else e&&!e.disposed&&e.resetEffect(t)}onAvatarRenderReady(t){if(t){for(const[e,s]of this._initDownloadBuffer)this.downloadAvatarEffect(e,s);this._initDownloadBuffer=[]}}onLibraryLoaded(t){if(!t||!t.library)return;const e=[];this._structure.registerAnimation(t.library.animation);for(const[i,r]of this._incompleteEffects.entries()){let a=!0;for(const o of r)if(!(!o||o.isLoaded)){a=!1;break}if(a){e.push(i);const o=this._effectListeners.get(i);for(const h of o)!h||h.disposed||h.resetEffect(parseInt(i));this._effectListeners.delete(i),this.dispatchEvent(new gt(yr.LIBRARY_LOADED))}}for(const i of e)this._incompleteEffects.delete(i);let s=0;for(;s<this._currentDownloads.length;){const i=this._currentDownloads[s];i&&i.libraryName===t.library.libraryName&&this._currentDownloads.splice(s,1),s++}}processMissingLibraries(){const t=this._missingMandatoryLibs.slice();for(const e of t){if(!e)continue;const s=this._effectMap.get(e);if(s)for(const i of s)i&&this.downloadLibrary(i)}}isAvatarEffectReady(t){return!this._isReady||!this._structure.renderManager.isReady?!1:!this.getAvatarEffectPendingLibraries(t).length}getAvatarEffectPendingLibraries(t){const e=[];if(!this._structure)return e;const s=this._effectMap.get(t.toString());if(s)for(const i of s)!i||i.isLoaded||e.indexOf(i)===-1&&e.push(i);return e}downloadLibrary(t){!t||t.isLoaded||this._pendingDownloadQueue.indexOf(t)>=0||this._currentDownloads.indexOf(t)>=0||(this._pendingDownloadQueue.push(t),this.processDownloadQueue())}processDownloadQueue(){for(;this._pendingDownloadQueue.length;)this._pendingDownloadQueue[0].downloadAsset(),this._currentDownloads.push(this._pendingDownloadQueue.shift())}};yr.DOWNLOADER_READY="EADM_DOWNLOADER_READY",yr.LIBRARY_LOADED="EADM_LIBRARY_LOADED",yr.MAX_DOWNLOADS=2;let lr=yr;class UY extends Po{constructor(t,e,s,i,r){super(t,e,s,i,r,null)}isPlaceholder(){return!0}}const J_=class J_ extends Js{constructor(){super(),this._structure=null,this._avatarAssetDownloadManager=null,this._placeHolderFigure=null,this._figureMapReady=!1,this._effectMapReady=!1,this._actionsReady=!1,this._geometryReady=!1,this._partSetsReady=!1,this._animationsReady=!1,this._isReady=!1,this.onAvatarAssetDownloaderReady=this.onAvatarAssetDownloaderReady.bind(this),this.onAvatarAssetDownloaded=this.onAvatarAssetDownloaded.bind(this),this.onEffectAssetDownloaderReady=this.onEffectAssetDownloaderReady.bind(this),this.onEffectAssetDownloaded=this.onEffectAssetDownloaded.bind(this),this.onAvatarStructureDownloadDone=this.onAvatarStructureDownloadDone.bind(this)}onInit(){this._structure=new NY(this),this.loadGeometry(),this.loadPartSets(),this.loadActions(),this.loadAnimations(),this.loadFigureData(),this._aliasCollection=new Um(this,_s()),this._aliasCollection.init(),this._avatarAssetDownloadManager||(this._avatarAssetDownloadManager=new or(_s(),this._structure),this._avatarAssetDownloadManager.addEventListener(or.DOWNLOADER_READY,this.onAvatarAssetDownloaderReady),this._avatarAssetDownloadManager.addEventListener(or.LIBRARY_LOADED,this.onAvatarAssetDownloaded)),this._effectAssetDownloadManager||(this._effectAssetDownloadManager=new lr(_s(),this._structure),this._effectAssetDownloadManager.addEventListener(lr.DOWNLOADER_READY,this.onEffectAssetDownloaderReady),this._effectAssetDownloadManager.addEventListener(lr.LIBRARY_LOADED,this.onEffectAssetDownloaded)),this.checkReady()}onDispose(){this._avatarAssetDownloadManager&&(this._avatarAssetDownloadManager.removeEventListener(or.DOWNLOADER_READY,this.onAvatarAssetDownloaderReady),this._avatarAssetDownloadManager.removeEventListener(or.LIBRARY_LOADED,this.onAvatarAssetDownloaded)),this._effectAssetDownloadManager&&(this._effectAssetDownloadManager.removeEventListener(lr.DOWNLOADER_READY,this.onEffectAssetDownloaderReady),this._effectAssetDownloadManager.removeEventListener(lr.LIBRARY_LOADED,this.onEffectAssetDownloaded))}loadGeometry(){this._structure&&(this._structure.initGeometry(LY.geometry),this._geometryReady=!0,this.checkReady())}loadPartSets(){this._structure&&(this._structure.initPartSets(PY.partSets),this._partSetsReady=!0,this.checkReady())}loadActions(){const t=q.getValue("avatar.default.actions");t&&this._structure.initActions(_s(),t);const e=new XMLHttpRequest;try{e.open("GET",q.getValue("avatar.actions.url")),e.send(),e.onloadend=s=>{this._structure&&(this._structure.updateActions(JSON.parse(e.responseText)),this._actionsReady=!0,this.checkReady())},e.onerror=s=>{throw new Error("invalid_avatar_actions")}}catch(s){j.error(s)}}loadAnimations(){this._structure&&(this._structure.initAnimation(DY.animations),this._animationsReady=!0,this.checkReady())}loadFigureData(){const t=q.getValue("avatar.default.figuredata");if(!t||typeof t=="string"){j.error("XML figuredata is no longer supported");return}this._structure&&this._structure.initFigureData(t),new Uo(q.getValue("avatar.figuredata.url"),this._structure.figureData).addEventListener(Uo.AVATAR_STRUCTURE_DONE,this.onAvatarStructureDownloadDone)}onAvatarStructureDownloadDone(t){this._structureReady=!0,this._structure.init(),this.checkReady()}onAvatarAssetDownloaderReady(t){t&&(this._figureMapReady=!0,this.checkReady())}onAvatarAssetDownloaded(t){t&&this._aliasCollection.reset()}onEffectAssetDownloaderReady(t){t&&(this._effectMapReady=!0,this.checkReady())}onEffectAssetDownloaded(t){t&&this._aliasCollection.reset()}checkReady(){this._isReady||!this._geometryReady||!this._partSetsReady||!this._actionsReady||!this._animationsReady||!this._figureMapReady||!this._effectMapReady||!this._structureReady||(this._isReady=!0,this.events&&this.events.dispatchEvent(new gt(ka.AVATAR_RENDER_READY)))}createFigureContainer(t){return new oo(t)}isFigureContainerReady(t){return this._avatarAssetDownloadManager?this._avatarAssetDownloadManager.isAvatarFigureContainerReady(t):!1}createAvatarImage(t,e,s,i=null,r=null){if(!this._structure||!this._avatarAssetDownloadManager)return null;const a=new oo(t);return s&&this.validateAvatarFigure(a,s),this._avatarAssetDownloadManager.isAvatarFigureContainerReady(a)?new Po(this._structure,this._aliasCollection,a,e,this._effectAssetDownloadManager,r):(this._placeHolderFigure||(this._placeHolderFigure=new oo(J_.DEFAULT_FIGURE)),this._avatarAssetDownloadManager.downloadAvatarFigure(a,i),new UY(this._structure,this._aliasCollection,this._placeHolderFigure,e,this._effectAssetDownloadManager))}downloadAvatarFigure(t,e){this._avatarAssetDownloadManager&&this._avatarAssetDownloadManager.downloadAvatarFigure(t,e)}validateAvatarFigure(t,e){let s=!1;const i=this._structure.getMandatorySetTypeIds(e,2);if(i){const r=this._structure.figureData;for(const a of i)if(t.hasPartType(a)){const o=r.getSetType(a);if(o&&!o.getPartSet(t.getPartSetId(a))){const _=this._structure.getDefaultPartSet(a,e);_&&(t.updatePart(a,_.id,[0]),s=!0)}}else{const o=this._structure.getDefaultPartSet(a,e);o&&(t.updatePart(a,o.id,[0]),s=!0)}}return!s}getFigureClubLevel(t,e,s=null){if(!this._structure)return 0;const i=this._structure.figureData,r=Array.from(t.getPartTypeIds());let a=0;for(const o of r){const h=i.getSetType(o);if(!h)continue;const _=t.getPartSetId(o),l=h.getPartSet(_);if(l){a=Math.max(l.clubLevel,a);const c=i.getPalette(h.paletteID),f=t.getPartColorIds(o);for(const p of f){const m=c.getColor(p);m&&(a=Math.max(m.clubLevel,a))}}}s||(s=this._structure.getBodyPartsUnordered(Ce.FULL));for(const o of s){const h=i.getSetType(o);h&&r.indexOf(o)===-1&&(a=Math.max(h.optionalFromClubLevel(e),a))}return a}isValidFigureSetForGender(t,e){const i=this.structureData.getFigurePartSet(t);return!!(i&&(i.gender.toUpperCase()==="U"||i.gender.toUpperCase()===e.toUpperCase()))}getFigureStringWithFigureIds(t,e,s){const i=new sc;i.loadAvatarData(t,e);const r=this.resolveFigureSets(s);for(const a of r)i.savePartData(a.type,a.id,i.getColourIds(a.type));return i.getFigureString()}resolveFigureSets(t){const e=this.structureData,s=[];for(const i of t){const r=e.getFigurePartSet(i);r&&s.push(r)}return s}getMandatoryAvatarPartSetIds(t,e){return this._structure?this._structure.getMandatorySetTypeIds(t,e):null}getAssetByName(t){return this._aliasCollection.getAsset(t)}get assets(){return _s()}get isReady(){return this._isReady}get structure(){return this._structure}get structureData(){return this._structure?this._structure.figureData:null}get downloadManager(){return this._avatarAssetDownloadManager}};J_.DEFAULT_FIGURE="hd-99999-99999";let vd=J_;class yY{constructor(t,e,s){this._layerId=t,this._partId=e,this._paletteId=s}get layerId(){return this._layerId}set layerId(t){this._layerId=t}get partId(){return this._partId}set partId(t){this._partId=t}get paletteId(){return this._paletteId}set paletteId(t){this._paletteId=t}}class uh{constructor(t){this._typeId=this.getTypeId(t),this._paletteId=this.getPaletteId(t),this._color=this.getColor(t),this._headOnly=this.getHeadOnly(t);const e=this.getCustomData(t);this._customLayerIds=this.getCustomLayerIds(e),this._customPartIds=this.getCustomPartIds(e),this._customPaletteIds=this.getCustomPaletteIds(e),this._customParts=[];let s=0;for(;s<this._customLayerIds.length;)this._customParts.push(new yY(this._customLayerIds[s],this._customPartIds[s],this._customPaletteIds[s])),s++}get typeId(){return this._typeId}get paletteId(){return this._paletteId}get color(){return this._color}get customLayerIds(){return this._customLayerIds}get customPartIds(){return this._customPartIds}get customPaletteIds(){return this._customPaletteIds}get customParts(){return this._customParts}getCustomPart(t){if(this._customParts){for(const e of this._customParts)if(e.layerId===t)return e}return null}get hasCustomParts(){return this._customLayerIds!=null&&this._customLayerIds.length>0}get headOnly(){return this._headOnly}get figureString(){let t=this.typeId+" "+this.paletteId+" "+this.color.toString(16);t=t+(" "+this.customParts.length);for(const e of this.customParts)t=t+(" "+e.layerId+" "+e.partId+" "+e.paletteId);return t}getCustomData(t){let e=[];if(t){const s=t.split(" "),i=this._headOnly?1:0,r=4+i;if(s.length>r){const a=3+i,o=parseInt(s[a]);e=s.slice(r,r+o*3)}}return e}getCustomLayerIds(t){const e=[];let s=0;for(;s<t.length;)e.push(parseInt(t[s+0])),s=s+3;return e}getCustomPartIds(t){const e=[];let s=0;for(;s<t.length;)e.push(parseInt(t[s+1])),s=s+3;return e}getCustomPaletteIds(t){const e=[];let s=0;for(;s<t.length;)e.push(parseInt(t[s+2])),s=s+3;return e}getTypeId(t){if(t){const e=t.split(" ");if(e.length>=1)return parseInt(e[0])}return 0}getPaletteId(t){if(t){const e=t.split(" ");if(e.length>=2)return parseInt(e[1])}return 0}getColor(t){if(t){const e=t.split(" ");if(e.length>=3)return parseInt(e[2],16)}return 16777215}getHeadOnly(t){if(t){const e=t.split(" ");if(e.length>=4)return e[3]==="head"}return!1}}class al{constructor(t){this._complete=!0,this._target=t}get running(){return this._running&&!!this._target}get complete(){return this._complete}set target(t){this._target=t}get target(){return this._target}set tag(t){this._tag=t}get tag(){return this._tag}start(){this._running=!0}update(t){}stop(){this._target=null,this._running=!1}tick(t){}}class zY extends al{constructor(t){super(t)}tick(t){super.tick(t),this.target&&(this.target.remove(),this.target=null)}}class sE extends al{constructor(t,e){super(t),this._complete=!1,this._duration=e}get duration(){return this._duration}start(){super.start(),this._complete=!1,this._startTimeMs=nt()}tick(t){super.tick(t);const e=(t-this._startTimeMs)/this._duration;e<1?this.update(e):(this.update(1),this._complete=!0)}}class WY extends sE{constructor(t,e,s){super(t,e),this._height=s}start(){super.start(),this._offset=0,this.target.style.top=this._offset-this._height+"px"}update(t){super.update(t),this.target.style.top=this._offset-this._height+this.getBounceOffset(t)*this._height+"px"}getBounceOffset(t){return t<.364?7.5625*t*t:t<.727?(t=t-.545,7.5625*t*t+.75):t<.909?(t=t-.9091,7.5625*t*t+.9375):(t=t-.955,7.5625*t*t+.984375)}stop(){this.target.style.top=this._offset+"px",super.stop()}}class vY extends sE{constructor(t){super(t.target,t.duration),this._interval=t}start(){super.start(),this._interval.start()}update(t){super.update(t),this._interval.update(t)}stop(){super.stop(),this._interval.stop()}}class bY extends vY{constructor(t,e){super(t),this._rate=e}}class kY extends bY{constructor(t,e){super(t,e)}update(t){this._interval.update(Math.pow(t,1/this._rate))}}class KY extends sE{constructor(t,e,s,i,r,a){super(t,e),this._deltaX=s,this._deltaY=i,this._height=-r,this._numJumps=a}start(){super.start(),this._startX=this.target.offsetLeft,this._startY=this.target.offsetTop}update(t){super.update(t),this.target.style.left=this._startX+this._deltaX*t+"px",this.target.style.top=this._startY+this._height*Math.abs(Math.sin(t*Math.PI*this._numJumps))+this._deltaY*t+"px"}}const J=class J{static get TIMER_TIME(){return 1e3/am()}static runMotion(t){return J._RUNNING_MOTIONS.indexOf(t)===-1&&J._QUEUED_MOTIONS.indexOf(t)===-1&&(J._IS_UPDATING?J._QUEUED_MOTIONS.push(t):(J._RUNNING_MOTIONS.push(t),t.start()),J.startTimer()),t}static removeMotion(t){let e=J._RUNNING_MOTIONS.indexOf(t);e>-1?J._IS_UPDATING?(e=J._REMOVED_MOTIONS.indexOf(t),e==-1&&J._REMOVED_MOTIONS.push(t)):(J._RUNNING_MOTIONS.splice(e,1),t.running&&t.stop(),J._RUNNING_MOTIONS.length||J.stopTimer()):(e=J._QUEUED_MOTIONS.indexOf(t),e>-1&&J._QUEUED_MOTIONS.splice(e,1))}static getMotionByTag(t){for(const e of J._RUNNING_MOTIONS)if(e.tag==t)return e;for(const e of J._QUEUED_MOTIONS)if(e.tag==t)return e;return null}static getMotionByTarget(t){for(const e of J._RUNNING_MOTIONS)if(e.target==t)return e;for(const e of J._QUEUED_MOTIONS)if(e.target==t)return e;return null}static getMotionByTagAndTarget(t,e){for(const s of J._RUNNING_MOTIONS)if(s.tag==t&&s.target==e)return s;for(const s of J._QUEUED_MOTIONS)if(s.tag==t&&s.target==e)return s;return null}static get isRunning(){return!!J._TIMER}static get isUpdating(){return J._IS_UPDATING}static onTick(){J._IS_UPDATING=!0;const t=nt();let e=null;for(;e=J._QUEUED_MOTIONS.pop();)J._RUNNING_MOTIONS.push(e);for(;e=J._REMOVED_MOTIONS.pop();)J._RUNNING_MOTIONS.splice(J._RUNNING_MOTIONS.indexOf(e),1),e.running&&e.stop();for(e of J._RUNNING_MOTIONS)e.running?(e.tick(t),e.complete&&J.removeMotion(e)):J.removeMotion(e);J._RUNNING_MOTIONS.length||J.stopTimer(),J._IS_UPDATING=!1}static startTimer(){J._TIMER||(J._TIMER=setInterval(J.onTick,J.TIMER_TIME))}static stopTimer(){J._TIMER&&(clearInterval(J._TIMER),J._TIMER=null)}getNumRunningMotions(t){let e=0;for(const s of J._RUNNING_MOTIONS)s.target===t&&e++;return e}};J._QUEUED_MOTIONS=[],J._RUNNING_MOTIONS=[],J._REMOVED_MOTIONS=[],J._TIMER=null,J._IS_UPDATING=!1;let Ig=J;class XY extends al{constructor(...t){super(t?t[0].target:null),this._queue=[];for(const e of t)this._queue.push(e);this._motion=t[0],this._complete=!this._motion}get running(){return this._running&&this._motion?this._motion.running:!1}start(){super.start(),this._motion.start()}update(t){super.update(t),this._motion.running&&this._motion.update(t)}stop(){super.stop(),this._motion.stop()}tick(t){if(super.tick(t),this._motion.tick(t),this._motion.complete){this._motion.stop();const e=this._queue.indexOf(this._motion);e<this._queue.length-1?(this._motion=this._queue[e+1],this._target=this._motion.target,this._motion.start()):this._complete=!0}}}class qY extends al{constructor(t){super(null),this._waitTimeMs=t}get running(){return this._running}start(){super.start(),this._complete=!1,this._startTimeMs=nt()}tick(t){super.tick(t),this._complete=t-this._startTimeMs>=this._waitTimeMs,this._complete&&this.stop()}}export{yb as $,H as A,Ve as B,Xa as C,GF as D,$e as E,_w as F,oF as G,Kn as H,Ll as I,ja as J,Bo as K,hm as L,z as M,W as N,Xi as O,uh as P,Hn as Q,g as R,Vn as S,wE as T,eV as U,R as V,wY as W,ui as X,ey as Y,sy as Z,iy as _,q as a,xg as a$,DL as a0,Vb as a1,po as a2,Ff as a3,V0 as a4,F0 as a5,G0 as a6,$y as a7,x0 as a8,n0 as a9,Rb as aA,kL as aB,jy as aC,YL as aD,VL as aE,vL as aF,bL as aG,Im as aH,zb as aI,jb as aJ,Ne as aK,gF as aL,CI as aM,eF as aN,Zb as aO,Xb as aP,Wb as aQ,cg as aR,tt as aS,jc as aT,vP as aU,FP as aV,zF as aW,PP as aX,AP as aY,SP as aZ,MP as a_,cL as aa,Ay as ab,H0 as ac,W0 as ad,Y0 as ae,HL as af,dL as ag,Jy as ah,j0 as ai,uL as aj,lL as ak,B0 as al,K0 as am,ks as an,Qc as ao,j as ap,qb as aq,BL as ar,GL as as,sP as at,tP as au,eP as av,QL as aw,$L as ax,nP as ay,XL as az,Ii as b,Zy as b$,kF as b0,jF as b1,HF as b2,JF as b3,XF as b4,VF as b5,wF as b6,bP as b7,qF as b8,XP as b9,dy as bA,Ey as bB,gy as bC,fy as bD,Iy as bE,z1 as bF,Oy as bG,Ry as bH,Sy as bI,rg as bJ,Cy as bK,pc as bL,My as bM,Ny as bN,Dy as bO,Ly as bP,Uy as bQ,yy as bR,vy as bS,by as bT,Fy as bU,J1 as bV,sG as bW,X1 as bX,tG as bY,q1 as bZ,Q1 as b_,xP as ba,qP as bb,Gg as bc,_x as bd,Bg as be,Cx as bf,R1 as bg,FU as bh,ZU as bi,f1 as bj,vU as bk,yU as bl,bU as bm,UU as bn,OL as bo,X0 as bp,iG as bq,rG as br,ly as bs,_y as bt,Y1 as bu,H1 as bv,IL as bw,fL as bx,mL as by,ig as bz,Eg as c,cw as c$,Xy as c0,e0 as c1,qy as c2,Ky as c3,Qy as c4,RL as c5,pL as c6,U0 as c7,c0 as c8,ZG as c9,nV as cA,rV as cB,L0 as cC,vo as cD,Ao as cE,yl as cF,Ct as cG,Z as cH,Vr as cI,Rg as cJ,im as cK,Yt as cL,lt as cM,V as cN,pw as cO,Qs as cP,Nv as cQ,mo as cR,bF as cS,fP as cT,IP as cU,mP as cV,TP as cW,yF as cX,FF as cY,So as cZ,bl as c_,JG as ca,qo as cb,Pl as cc,Cf as cd,Iv as ce,dt as cf,Ov as cg,Wn as ch,Av as ci,kg as cj,kc as ck,Hc as cl,Yc as cm,O0 as cn,C0 as co,b0 as cp,v0 as cq,I0 as cr,p0 as cs,gc as ct,fv as cu,A0 as cv,Ab as cw,Sb as cx,dc as cy,Cb as cz,M as d,fI as d$,Pv as d0,Dv as d1,Lv as d2,BF as d3,dw as d4,Kd as d5,Ew as d6,Yw as d7,Ww as d8,Ji as d9,Wl as dA,Kl as dB,Oo as dC,Nt as dD,sw as dE,HE as dF,VE as dG,nc as dH,bo as dI,qa as dJ,lo as dK,lY as dL,vl as dM,Rv as dN,ar as dO,qi as dP,P0 as dQ,pt as dR,$r as dS,vI as dT,Ni as dU,Di as dV,bg as dW,Dw as dX,Ki as dY,xb as dZ,tV as d_,Ld as da,on as db,Li as dc,Co as dd,bv as de,aw as df,Mv as dg,uw as dh,Ow as di,wv as dj,Bv as dk,Gv as dl,Rw as dm,Aw as dn,Wv as dp,Yv as dq,Hv as dr,jv as ds,xD as dt,Gw as du,FD as dv,ww as dw,bD as dx,Bw as dy,ql as dz,BY as e,wx as e$,uy as e0,Nb as e1,Fb as e2,SL as e3,AL as e4,ML as e5,Bb as e6,wb as e7,HY as e8,Yb as e9,Qw as eA,cb as eB,lF as eC,RF as eD,Yy as eE,cG as eF,gG as eG,Kt as eH,_s as eI,VY as eJ,Vv as eK,du as eL,Cw as eM,Sw as eN,Mw as eO,uu as eP,Iu as eQ,NP as eR,WF as eS,QF as eT,KF as eU,$F as eV,lx as eW,rx as eX,ux as eY,Gx as eZ,Bx as e_,Hb as ea,PL as eb,UL as ec,EF as ed,WL as ee,Jw as ef,iP as eg,hF as eh,fF as ei,nb as ej,Hw as ek,Qe as el,$b as em,_P as en,hP as eo,mF as ep,_c as eq,Wy as er,wy as es,fG as et,EG as eu,_G as ev,dG as ew,oG as ex,zy as ey,By as ez,De as f,jg as f$,Lx as f0,cU as f1,Nx as f2,Mx as f3,xx as f4,dU as f5,Vx as f6,ea as f7,fU as f8,vx as f9,kU as fA,WU as fB,Vg as fC,Yg as fD,zU as fE,gg as fF,Mb as fG,aV as fH,I1 as fI,Wd as fJ,vb as fK,EL as fL,bb as fM,_1 as fN,a1 as fO,o1 as fP,h1 as fQ,c1 as fR,yL as fS,kb as fT,av as fU,BB as fV,xy as fW,nG as fX,Z1 as fY,$1 as fZ,j1 as f_,EU as fa,uU as fb,eg as fc,Ax as fd,Sx as fe,bx as ff,Fx as fg,Dx as fh,gU as fi,Yx as fj,M1 as fk,C1 as fl,N1 as fm,v1 as fn,XU as fo,L1 as fp,A1 as fq,S1 as fr,y1 as fs,sg as ft,P1 as fu,sv as fv,YU as fw,jU as fx,Hg as fy,KU as fz,Rs as g,Cl as g$,i0 as g0,OG as g1,t0 as g2,pG as g3,yu as g4,MG as g5,ky as g6,mG as g7,Uu as g8,bG as g9,$B as gA,Qv as gB,Xv as gC,qv as gD,iw as gE,aI as gF,JB as gG,$v as gH,rw as gI,lB as gJ,VG as gK,IF as gL,cF as gM,aP as gN,Vc as gO,IU as gP,Fl as gQ,jG as gR,rv as gS,nw as gT,yY as gU,YY as gV,YE as gW,TI as gX,Xn as gY,zf as gZ,hI as g_,vG as ga,Yo as gb,a0 as gc,SG as gd,TG as ge,DG as gf,yG as gg,NG as gh,Si as gi,LG as gj,CG as gk,r0 as gl,AG as gm,s0 as gn,RG as go,YG as gp,KG as gq,xw as gr,MB as gs,uB as gt,NB as gu,Ic as gv,sb as gw,ZB as gx,Kv as gy,ew as gz,xt as h,Xl as h0,Ql as h1,wl as h2,db as h3,sV as h4,Pw as h5,eG as h6,Lw as h7,Uw as h8,Tv as h9,_V as hA,hV as hB,lV as hC,Gr as hD,gb as hE,Qr as hF,hs as hG,ki as hH,tw as ha,Bl as hb,_0 as hc,o0 as hd,h0 as he,FG as hf,gw as hg,Nw as hh,Sv as hi,DB as hj,IB as hk,Zr as hl,ce as hm,Ro as hn,Ig as ho,XY as hp,qY as hq,WY as hr,kY as hs,KY as ht,zY as hu,Nf as hv,iT as hw,Eb as hx,fb as hy,oV as hz,Ut as i,GE as j,Ks as k,Ce as l,$n as m,nt as n,Ml as o,fi as p,Xt as q,zn as r,oo as s,Lo as t,Ux as u,Hx as v,Px as w,yx as x,XG as y,gt as z};
