diff --git a/JagEd.js b/JagEd.js index cc55d37d..3e846bcd 100644 --- a/JagEd.js +++ b/JagEd.js @@ -1 +1 @@ -(()=>{"use strict";var t={7444:(t,i,e)=>{t.exports=e.p+"0c791968973e1f25c170.wasm"},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"}},i={};function e(s){var n=i[s];if(void 0!==n)return n.exports;var r=i[s]={exports:{}};return t[s](r,r.exports,e),r.exports}e.m=t,e.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),e.p="/Client2/",e.b=document.baseURI||self.location.href,(()=>{async function t(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,l=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,l,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(a,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}class i{static tt=null;static load=async i=>{this.tt=await t(new WebAssembly.Module(i),{env:void 0})};static read=(t,i,e,s)=>{if(!this.tt)throw new Error('bz2 not found!!');return Int8Array.from(this.tt.read(t,i,e,s))}}let s;function n(t,i){return s=t.exports,r.it=i,s}async function r(t){void 0===t&&(t=new URL(e(7444),e.b));const i={et:{}};('string'==typeof t||'function'==typeof Request&&t instanceof Request||'function'==typeof URL&&t instanceof URL)&&(t=fetch(t));const{instance:s,module:r}=await async function(t,i){if('function'==typeof Response&&t instanceof Response){if('function'==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,i)}catch(i){if('application/wasm'==t.headers.get('Content-Type'))throw i;console.warn('`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n',i)}const e=await t.arrayBuffer();return await WebAssembly.instantiate(e,i)}{const e=await WebAssembly.instantiate(t,i);return e instanceof WebAssembly.Instance?{instance:e,module:t}:e}}(await t,i);return n(s,r)}let h=null,o=!1;class l extends Error{constructor(t){super(t),this.name='DecompressionError'}}let a=0,c=null,f=null;function u(t,i,e){let s;if(e){const n=i;s=t.malloc_u8(n);const r=new Uint8Array(t.memory.buffer,s,n);try{e(r)}catch(i){throw t.free_u8(s,n),i}return a=n,s}if('string'==typeof i){const e=a=function(t){let i=0,e=0,s=0;const n=t.length;for(;i{this.lt=t,this.ct=i,this.ft=e,this.yt(0,0,i,e)};static At=()=>{this.left=0,this.top=0,this.right=this.ct,this.bottom=this.ft,this.ut=this.right-1,this.dt=this.right/2|0};static yt=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.ct&&(e=this.ct),s>this.ft&&(s=this.ft),this.top=i,this.bottom=s,this.left=t,this.right=e,this.ut=this.right-1,this.dt=this.right/2|0,this.wt=this.bottom/2|0};static clear=()=>{const t=this.ct*this.ft;for(let i=0;i{this.gt(t,i,n,e),this.gt(t,i+s-1,n,e),this.It(t,i,n,s),this.It(t+e-1,i,n,s)};static gt=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.ct;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.ct;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(a-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.ct-e;let h=t+i*this.ct;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.lt[h++]=n;h+=r}};static Et(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,l=(n>>8&255)*r,a=(255&n)*r,c=this.ct-e;let f=t+i*this.ct;for(let t=0;t>16&255)*h>>8<<16)+(l+(this.lt[f]>>8&255)*h>>8<<8)+(a+(255&this.lt[f])*h>>8);this.lt[f++]=t}f+=c}}static Tt(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,l=(255&s)*n;let a=i-e;a<0&&(a=0);let c=i+e;c>=this.ft&&(c=this.ft-1);for(let s=a;s<=c;s++){const n=s-i,a=0|Math.sqrt(e*e-n*n);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.ct&&(f=this.ct-1);let u=c+s*this.ct;for(let t=c;t<=f;t++){const t=(h+(this.lt[u]>>16&255)*r>>8<<16)+(o+(this.lt[u]>>8&255)*r>>8<<8)+(l+(255&this.lt[u])*r>>8);this.lt[u++]=t}}}static bt=(t,i,e)=>{t=this.right||i=this.bottom||(this.lt[t+i*this.ct]=e)}}const p=document.getElementById('canvas'),A=p.getContext('2d',{willReadFrequently:!0}),_=document.createElement('canvas'),g=document.createElement('img'),I=_.getContext('2d',{willReadFrequently:!0});class C{Ot;width;height;Rt;vt;lt;constructor(t,i,e=A){this.Rt=e,this.Ot=this.Rt.getImageData(0,0,t,i),this.vt=new Uint32Array(this.Ot.data.buffer),this.lt=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.lt.fill(0)}bind(){m.bind(this.lt,this.width,this.height)}draw(t,i){this.#t(),this.Rt.putImageData(this.Ot,t,i)}#t(){const t=this.lt.length,i=this.lt,e=this.vt;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}const E=async t=>new Promise((i=>setTimeout(i,t))),T=async t=>new Int8Array(await(await fetch(t)).arrayBuffer());class b{Lt;cursor=null;constructor(){const t=new w;t.next=t,t.st=t,this.Lt=t}St(t){t.st&&t.nt(),t.st=this.Lt.st,t.next=this.Lt,t.st&&(t.st.next=t),t.next.st=t}xt(t){t.st&&t.nt(),t.st=this.Lt,t.next=this.Lt.next,t.st.next=t,t.next&&(t.next.st=t)}Mt(){const t=this.Lt.next;return t===this.Lt?null:(t?.nt(),t)}head(){const t=this.Lt.next;return t===this.Lt?(this.cursor=null,null):(this.cursor=t?.next||null,t)}kt(){const t=this.Lt.st;return t===this.Lt?(this.cursor=null,null):(this.cursor=t?.st||null,t)}next(){const t=this.cursor;return t===this.Lt?(this.cursor=null,null):(this.cursor=t?.next||null,t)}st(){const t=this.cursor;return t===this.Lt?(this.cursor=null,null):(this.cursor=t?.st||null,t)}clear(){for(;;){const t=this.Lt.next;if(t===this.Lt)return;t?.nt()}}}class O extends y{static Dt=3988292384;static Nt=new Int32Array(256);static Ft=new Uint32Array(33);static Bt=new b;static Pt=new b;static Ut=new b;static Wt=0;static Gt=0;static Yt=0;static{for(let t=0;t<32;t++)O.Ft[t]=(1<>>=1:i=i>>>1^O.Dt;O.Nt[t]=i}}static Ht=t=>{let i=4294967295;for(let e=0;e>>8^O.Nt[255&(i^t[e])];return~i};view;data;Vt=0;Kt=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.Vt}static Xt=t=>{let i=null;return 0===t&&O.Wt>0?(O.Wt--,i=O.Bt.Mt()):1===t&&O.Gt>0?(O.Gt--,i=O.Pt.Mt()):2===t&&O.Yt>0&&(O.Yt--,i=O.Ut.Mt()),i?(i.Vt=0,i):new O(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.Vt=0,100===this.view.byteLength&&O.Wt<1e3?(O.Bt.St(this),O.Wt++):5e3===this.view.byteLength&&O.Gt<250?(O.Pt.St(this),O.Gt++):3e4===this.view.byteLength&&O.Yt<50&&(O.Ut.St(this),O.Yt++)}get jt(){return this.view.getUint8(this.Vt++)}get zt(){return this.view.getInt8(this.Vt++)}get Zt(){const t=this.view.getUint16(this.Vt);return this.Vt+=2,t}get qt(){const t=this.view.getInt16(this.Vt);return this.Vt+=2,t}get Jt(){const t=this.view.getUint8(this.Vt++)<<16|this.view.getUint16(this.Vt);return this.Vt+=2,t}get $t(){const t=this.view.getInt32(this.Vt);return this.Vt+=4,t}get Qt(){const t=this.view.getBigInt64(this.Vt);return this.Vt+=8,t}get ti(){return this.view.getUint8(this.Vt)<128?this.jt-64:this.Zt-49152}get ii(){return this.view.getUint8(this.Vt)<128?this.jt:this.Zt-32768}get ei(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.Vt++))&&this.Vt>16),this.view.setUint16(this.Vt,t),this.Vt+=2}p4(t){this.view.setInt32(this.Vt,t),this.Vt+=4}oi(t){this.view.setInt32(this.Vt,t,!0),this.Vt+=4}li(t){this.view.setBigInt64(this.Vt,t),this.Vt+=8}ai(t){const i=this.view,e=t.length;for(let s=0;s>>3}wi(t){let i=this.Kt>>>3,e=8-(7&this.Kt),s=0;for(this.Kt+=t;t>e;e=8)s+=(this.view.getUint8(i++)&O.Ft[e])<>>e-t&O.Ft[t],s}yi(t,i){const e=this.Vt;this.Vt=0;const s=new Uint8Array(e);this.si(e,0,s);const n=function(t){const i=[];for(;t>0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}(function(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}(function(t){let i=0n;for(let e=0;e{const s=new O(t.read(i+'.dat')),n=new O(t.read('index.dat'));n.Vt=s.Zt;const r=n.Zt,h=n.Zt,o=n.jt,l=new Int32Array(o);for(let t=1;ts.length||n.Vt>n.length)throw new Error;const a=n.jt,c=n.jt,f=n.Zt,u=n.Zt,d=new R(f,u,l);d.mi=a,d.pi=c,d.Ai=r,d._i=h;const w=d.lt,y=n.jt;if(0===y){const t=d.width*d.height;for(let i=0;im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.Ii(r,n,this.lt,s,o,m.lt,e,h)}Ci(){const t=this.lt,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}Ti(){this.Ai|=0,this._i|=0,this.Ai/=2,this._i/=2,this.Ai|=0,this._i|=0;const t=new Int8Array(this.Ai*this._i);let i=0;for(let e=0;e>1)+(e+this.pi>>1)*this.Ai]=this.lt[i++];this.lt=t,this.width=this.Ai,this.height=this._i,this.mi=0,this.pi=0}bi(){if(this.width===this.Ai&&this.height===this._i)return;const t=new Int8Array(this.Ai*this._i);let i=0;for(let e=0;e>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,s){try{const n=this.width;this.height;let r=0,h=0;const o=this.Ai,l=this._i,a=(o<<16)/e|0,c=(l<<16)/s|0;t=t+(this.mi*e+o-1)/o|0,i=i+(this.pi*s+l-1)/l|0,this.mi*e%o!=0&&(r=(o-this.mi*e%o<<16)/e|0),this.pi*s%l!=0&&(h=(l-this.pi*s%l<<16)/s|0),e=e*(this.width-(r>>16))/o|0,s=s*(this.height-(h>>16))/l|0;let f,u=t+i*m.ct,d=m.ct-e;im.bottom&&(s-=i+s-m.bottom),tm.right&&(f=t+e-m.right,e-=f,d+=f),this.Oi(m.lt,this.lt,this.palette,r,h,u,d,e,s,a,c,n)}catch(t){console.log('error in sprite clipping routine')}}Oi(t,i,e,s,n,r,h,o,l,a,c,f){try{const u=s;for(let d=-l;d<0;d++){const l=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+l];0==n?r++:t[r++]=e[255&n],s+=a}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}class v extends Array{constructor(t,i){super(t);for(let e=0;e{this.vi=null,this.vi=null,this.sin=null,this.cos=null,this.Mi=null,this.Si=null,this.Vi=null,this.Ki=null,this.Bi=null,this.Pi=null,this.Gi=null,this.palette=null,this.Yi=null,console.log('Draw3D unloaded!')};static ji=()=>{this.Mi=new Int32Array(m.ft);for(let t=0;t{this.Mi=new Int32Array(i);for(let e=0;e{this.Bi=null,this.Pi.fill(null)};static qi=t=>{this.xi=0;for(let i=0;i<50;i++)try{this.Si[i]=R.gi(t,i.toString()),this.Ri&&128===this.Si[i]?.Ai?this.Si[i]?.Ti():this.Si[i]?.bi(),this.xi++}catch(t){}};static Ji=t=>{if(0!==this.Ki[t])return this.Ki[t];const i=this.Yi[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.$i(h,1.4),0===h&&(h=1),this.Ki[t]=h,h};static Qi=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,l=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let a=s-.3333333333333333;a<0&&a++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*h|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[e++]=this.$i(a,i)}}for(let t=0;t<50;t++){const e=this.Si[t];if(!e)continue;const s=e.palette;this.Yi[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static ie=t=>{this.Bi||(this.Ui=t,this.Ri?this.Bi=new k(t,16384):this.Bi=new k(t,65536),this.Pi.fill(null))};static ee=(t,i,e,s,n,r,h,o,l)=>{let a=0,c=0;n!==s&&(a=(i-t<<16)/(n-s)|0,c=(o-h<<15)/(n-s)|0);let f=0,u=0;r!==n&&(f=(e-i<<16)/(r-n)|0,u=(l-o<<15)/(r-n)|0);let d=0,w=0;if(r!==s&&(d=(t-e<<16)/(s-r)|0,w=(h-l<<15)/(s-r)|0),s<=n&&s<=r){if(sm.bottom&&(n=m.bottom),r>m.bottom&&(r=m.bottom),nf)for(r-=n,n-=s,s=N.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.se(e>>16,i>>16,l>>7,o>>7,m.lt,s,0),e+=d,i+=f,l+=w,o+=u,s+=m.ct}this.se(e>>16,t>>16,l>>7,h>>7,m.lt,s,0),e+=d,t+=a,l+=w,h+=c,s+=m.ct}else for(r-=n,n-=s,s=N.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.se(i>>16,e>>16,o>>7,l>>7,m.lt,s,0),e+=d,i+=f,l+=w,o+=u,s+=m.ct}this.se(t>>16,e>>16,h>>7,l>>7,m.lt,s,0),e+=d,t+=a,l+=w,h+=c,s+=m.ct}else if(i=t<<=16,o=h<<=15,s<0&&(i-=d*s,t-=a*s,o-=w*s,h-=c*s,s=0),e<<=16,l<<=15,r<0&&(e-=f*r,l-=u*r,r=0),s!==r&&da)for(n-=r,r-=s,s=N.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.se(e>>16,t>>16,l>>7,h>>7,m.lt,s,0),e+=f,t+=a,l+=u,h+=c,s+=m.ct}this.se(i>>16,t>>16,o>>7,h>>7,m.lt,s,0),i+=d,t+=a,o+=w,h+=c,s+=m.ct}else for(n-=r,r-=s,s=N.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.se(t>>16,e>>16,h>>7,l>>7,m.lt,s,0),e+=f,t+=a,l+=u,h+=c,s+=m.ct}this.se(t>>16,i>>16,h>>7,o>>7,m.lt,s,0),i+=d,t+=a,o+=w,h+=c,s+=m.ct}}else if(n<=r){if(nm.bottom&&(r=m.bottom),s>m.bottom&&(s=m.bottom),rd)for(s-=r,r-=n,n=N.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.se(t>>16,e>>16,h>>7,l>>7,m.lt,n,0),t+=a,e+=d,h+=c,l+=w,n+=m.ct}this.se(t>>16,i>>16,h>>7,o>>7,m.lt,n,0),t+=a,i+=f,h+=c,o+=u,n+=m.ct}else for(s-=r,r-=n,n=N.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.se(e>>16,t>>16,l>>7,h>>7,m.lt,n,0),t+=a,e+=d,h+=c,l+=w,n+=m.ct}this.se(i>>16,t>>16,o>>7,h>>7,m.lt,n,0),t+=a,i+=f,h+=c,o+=u,n+=m.ct}else if(e=i<<=16,l=o<<=15,n<0&&(e-=a*n,i-=f*n,l-=c*n,o-=u*n,n=0),t<<=16,h<<=15,s<0&&(t-=d*s,h-=w*s,s=0),r-=s,s-=n,n=N.Mi[n],a>16,i>>16,h>>7,o>>7,m.lt,n,0),t+=d,i+=f,h+=w,o+=u,n+=m.ct}this.se(e>>16,i>>16,l>>7,o>>7,m.lt,n,0),e+=a,i+=f,l+=c,o+=u,n+=m.ct}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.se(i>>16,t>>16,o>>7,h>>7,m.lt,n,0),t+=d,i+=f,h+=w,o+=u,n+=m.ct}this.se(i>>16,e>>16,o>>7,l>>7,m.lt,n,0),e+=a,i+=f,l+=c,o+=u,n+=m.ct}}else if(rm.bottom&&(s=m.bottom),n>m.bottom&&(n=m.bottom),s>16,t>>16,o>>7,h>>7,m.lt,r,0),i+=f,t+=a,o+=u,h+=c,r+=m.ct}this.se(i>>16,e>>16,o>>7,l>>7,m.lt,r,0),i+=f,e+=d,o+=u,l+=w,r+=m.ct}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.se(t>>16,i>>16,h>>7,o>>7,m.lt,r,0),i+=f,t+=a,o+=u,h+=c,r+=m.ct}this.se(e>>16,i>>16,l>>7,o>>7,m.lt,r,0),i+=f,e+=d,o+=u,l+=w,r+=m.ct}else if(t=e<<=16,h=l<<=15,r<0&&(t-=f*r,e-=d*r,h-=u*r,l-=w*r,r=0),i<<=16,o<<=15,n<0&&(i-=a*n,o-=c*n,n=0),s-=n,n-=r,r=N.Mi[r],f>16,e>>16,o>>7,l>>7,m.lt,r,0),i+=a,e+=d,o+=c,l+=w,r+=m.ct}this.se(t>>16,e>>16,h>>7,l>>7,m.lt,r,0),t+=f,e+=d,h+=u,l+=w,r+=m.ct}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.se(e>>16,i>>16,l>>7,o>>7,m.lt,r,0),i+=a,e+=d,o+=c,l+=w,r+=m.ct}this.se(e>>16,t>>16,l>>7,h>>7,m.lt,r,0),t+=f,e+=d,h+=u,l+=w,r+=m.ct}};static se=(t,i,e,s,n,r,h)=>{let o;if(N.Ni){let l;if(N.Fi){if(l=i-t>3?(s-e)/(i-t)|0:0,i>m.ut&&(i=m.ut),t<0&&(e-=t*l,t=0),t>=i)return;r+=t,h=i-t>>2,l<<=2}else{if(!(t>2)>0?(s-e)*N.vi[h]>>15:0}if(0===N.alpha)for(;;){if(--h<0){if((h=i-t&3)>0){o=N.palette[e>>8];do{n[r++]=o,h--}while(h>0);return}break}o=N.palette[e>>8],e+=l,n[r++]=o,n[r++]=o,n[r++]=o,n[r++]=o}else{const s=N.alpha,a=256-N.alpha;for(;;){if(--h<0){if((h=i-t&3)>0){o=N.palette[e>>8],o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280);do{n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),h--}while(h>0)}break}o=N.palette[e>>8],e+=l,o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280)}}}else if(tm.ut&&(i=m.ut),t<0&&(e-=t*l,t=0),t>=i))return;if(r+=t,h=i-t,0===N.alpha)do{n[r++]=N.palette[e>>8],e+=l,h--}while(h>0);else{const t=N.alpha,i=256-N.alpha;do{o=N.palette[e>>8],e+=l,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),n[r++]=o+((16711935&n[r])*t>>8&16711935)+((65280&n[r])*t>>8&65280),h--}while(h>0)}}};static ne=(t,i,e,s,n,r,h)=>{let o=0;n!==s&&(o=(i-t<<16)/(n-s)|0);let l=0;r!==n&&(l=(e-i<<16)/(r-n)|0);let a=0;if(r!==s&&(a=(t-e<<16)/(s-r)|0),s<=n&&s<=r){if(sm.bottom&&(n=m.bottom),r>m.bottom&&(r=m.bottom),nl)for(r-=n,n-=s,s=this.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.re(e>>16,i>>16,m.lt,s,h),e+=a,i+=l,s+=m.ct}this.re(e>>16,t>>16,m.lt,s,h),e+=a,t+=o,s+=m.ct}else for(r-=n,n-=s,s=this.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.re(i>>16,e>>16,m.lt,s,h),e+=a,i+=l,s+=m.ct}this.re(t>>16,e>>16,m.lt,s,h),e+=a,t+=o,s+=m.ct}else if(i=t<<=16,s<0&&(i-=a*s,t-=o*s,s=0),e<<=16,r<0&&(e-=l*r,r=0),s!==r&&ao)for(n-=r,r-=s,s=this.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.re(e>>16,t>>16,m.lt,s,h),e+=l,t+=o,s+=m.ct}this.re(i>>16,t>>16,m.lt,s,h),i+=a,t+=o,s+=m.ct}else for(n-=r,r-=s,s=this.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.re(t>>16,e>>16,m.lt,s,h),e+=l,t+=o,s+=m.ct}this.re(t>>16,i>>16,m.lt,s,h),i+=a,t+=o,s+=m.ct}}else if(n<=r){if(nm.bottom&&(r=m.bottom),s>m.bottom&&(s=m.bottom),ra)for(s-=r,r-=n,n=this.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.re(t>>16,e>>16,m.lt,n,h),t+=o,e+=a,n+=m.ct}this.re(t>>16,i>>16,m.lt,n,h),t+=o,i+=l,n+=m.ct}else for(s-=r,r-=n,n=this.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.re(e>>16,t>>16,m.lt,n,h),t+=o,e+=a,n+=m.ct}this.re(i>>16,t>>16,m.lt,n,h),t+=o,i+=l,n+=m.ct}else if(e=i<<=16,n<0&&(e-=o*n,i-=l*n,n=0),t<<=16,s<0&&(t-=a*s,s=0),o>16,i>>16,m.lt,n,h),t+=a,i+=l,n+=m.ct}this.re(e>>16,i>>16,m.lt,n,h),e+=o,i+=l,n+=m.ct}else for(r-=s,s-=n,n=this.Mi[n];;){if(--s<0)for(;;){if(--r<0)return;this.re(i>>16,t>>16,m.lt,n,h),t+=a,i+=l,n+=m.ct}this.re(i>>16,e>>16,m.lt,n,h),e+=o,i+=l,n+=m.ct}}else if(rm.bottom&&(s=m.bottom),n>m.bottom&&(n=m.bottom),s>16,t>>16,m.lt,r,h),i+=l,t+=o,r+=m.ct}this.re(i>>16,e>>16,m.lt,r,h),i+=l,e+=a,r+=m.ct}else for(n-=s,s-=r,r=this.Mi[r];;){if(--s<0)for(;;){if(--n<0)return;this.re(t>>16,i>>16,m.lt,r,h),i+=l,t+=o,r+=m.ct}this.re(e>>16,i>>16,m.lt,r,h),i+=l,e+=a,r+=m.ct}else if(t=e<<=16,r<0&&(t-=l*r,e-=a*r,r=0),i<<=16,n<0&&(i-=o*n,n=0),l>16,e>>16,m.lt,r,h),i+=o,e+=a,r+=m.ct}this.re(t>>16,e>>16,m.lt,r,h),t+=l,e+=a,r+=m.ct}else for(s-=n,n-=r,r=this.Mi[r];;){if(--n<0)for(;;){if(--s<0)return;this.re(e>>16,i>>16,m.lt,r,h),i+=o,e+=a,r+=m.ct}this.re(e>>16,t>>16,m.lt,r,h),t+=l,e+=a,r+=m.ct}};static he=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,p,A,_)=>{const g=this.oe(_);this.Hi=!this.Vi[_];const I=a-u,C=c-w,E=f-p,T=d-a,b=y-c,O=A-f;let R=T*c-b*a<<14;const v=b*f-O*c<<8,L=O*a-T*f<<5;let S=I*c-C*a<<14;const x=C*f-E*c<<8,M=E*a-I*f<<5;let k=C*T-I*b<<14;const D=E*b-C*O<<8,N=I*O-E*T<<5;let F=0,B=0;n!==s&&(F=(i-t<<16)/(n-s)|0,B=(o-h<<16)/(n-s)|0);let P=0,U=0;r!==n&&(P=(e-i<<16)/(r-n)|0,U=(l-o<<16)/(r-n)|0);let W=0,G=0;if(r!==s&&(W=(t-e<<16)/(s-r)|0,G=(h-l<<16)/(s-r)|0),s<=n&&s<=r){if(sm.bottom&&(n=m.bottom),r>m.bottom&&(r=m.bottom),nP)for(r-=n,n-=s,s=this.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.le(e>>16,i>>16,m.lt,s,g,0,0,R,S,k,v,x,D,l>>8,o>>8),e+=W,i+=P,l+=G,o+=U,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(e>>16,t>>16,m.lt,s,g,0,0,R,S,k,v,x,D,l>>8,h>>8),e+=W,t+=F,l+=G,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(r-=n,n-=s,s=this.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.le(i>>16,e>>16,m.lt,s,g,0,0,R,S,k,v,x,D,o>>8,l>>8),e+=W,i+=P,l+=G,o+=U,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(t>>16,e>>16,m.lt,s,g,0,0,R,S,k,v,x,D,h>>8,l>>8),e+=W,t+=F,l+=G,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}else{i=t<<=16,o=h<<=16,s<0&&(i-=W*s,t-=F*s,o-=G*s,h-=B*s,s=0),e<<=16,l<<=16,r<0&&(e-=P*r,l-=U*r,r=0);const a=s-this.Di;if(R+=L*a,S+=M*a,k+=N*a,R|=0,S|=0,k|=0,(s===r||W>=F)&&(s!==r||P<=F))for(n-=r,r-=s,s=this.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.le(t>>16,e>>16,m.lt,s,g,0,0,R,S,k,v,x,D,h>>8,l>>8),e+=P,t+=F,l+=U,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(t>>16,i>>16,m.lt,s,g,0,0,R,S,k,v,x,D,h>>8,o>>8),i+=W,t+=F,o+=G,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(n-=r,r-=s,s=this.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.le(e>>16,t>>16,m.lt,s,g,0,0,R,S,k,v,x,D,l>>8,h>>8),e+=P,t+=F,l+=U,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(i>>16,t>>16,m.lt,s,g,0,0,R,S,k,v,x,D,o>>8,h>>8),i+=W,t+=F,o+=G,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}}else if(n<=r){if(nm.bottom&&(r=m.bottom),s>m.bottom&&(s=m.bottom),rW)for(s-=r,r-=n,n=this.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.le(t>>16,e>>16,m.lt,n,g,0,0,R,S,k,v,x,D,h>>8,l>>8),t+=F,e+=W,h+=B,l+=G,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(t>>16,i>>16,m.lt,n,g,0,0,R,S,k,v,x,D,h>>8,o>>8),t+=F,i+=P,h+=B,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(s-=r,r-=n,n=this.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.le(e>>16,t>>16,m.lt,n,g,0,0,R,S,k,v,x,D,l>>8,h>>8),t+=F,e+=W,h+=B,l+=G,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(i>>16,t>>16,m.lt,n,g,0,0,R,S,k,v,x,D,o>>8,h>>8),t+=F,i+=P,h+=B,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}else{e=i<<=16,l=o<<=16,n<0&&(e-=F*n,i-=P*n,l-=B*n,o-=U*n,n=0),t<<=16,h<<=16,s<0&&(t-=W*s,h-=G*s,s=0);const a=n-this.Di;if(R+=L*a,S+=M*a,k+=N*a,R|=0,S|=0,k|=0,r-=s,s-=n,n=this.Mi[n],F>16,i>>16,m.lt,n,g,0,0,R,S,k,v,x,D,h>>8,o>>8),t+=W,i+=P,h+=G,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(e>>16,i>>16,m.lt,n,g,0,0,R,S,k,v,x,D,l>>8,o>>8),e+=F,i+=P,l+=B,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.le(i>>16,t>>16,m.lt,n,g,0,0,R,S,k,v,x,D,o>>8,h>>8),t+=W,i+=P,h+=G,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(i>>16,e>>16,m.lt,n,g,0,0,R,S,k,v,x,D,o>>8,l>>8),e+=F,i+=P,l+=B,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}}else if(rm.bottom&&(s=m.bottom),n>m.bottom&&(n=m.bottom),s>16,t>>16,m.lt,r,g,0,0,R,S,k,v,x,D,o>>8,h>>8),i+=P,t+=F,o+=U,h+=B,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(i>>16,e>>16,m.lt,r,g,0,0,R,S,k,v,x,D,o>>8,l>>8),i+=P,e+=W,o+=U,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.le(t>>16,i>>16,m.lt,r,g,0,0,R,S,k,v,x,D,h>>8,o>>8),i+=P,t+=F,o+=U,h+=B,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(e>>16,i>>16,m.lt,r,g,0,0,R,S,k,v,x,D,l>>8,o>>8),i+=P,e+=W,o+=U,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}else{t=e<<=16,h=l<<=16,r<0&&(t-=P*r,e-=W*r,h-=U*r,l-=G*r,r=0),i<<=16,o<<=16,n<0&&(i-=F*n,o-=B*n,n=0);const a=r-this.Di;if(R+=L*a,S+=M*a,k+=N*a,R|=0,S|=0,k|=0,s-=n,n-=r,r=this.Mi[r],P>16,e>>16,m.lt,r,g,0,0,R,S,k,v,x,D,o>>8,l>>8),i+=F,e+=W,o+=B,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(t>>16,e>>16,m.lt,r,g,0,0,R,S,k,v,x,D,h>>8,l>>8),t+=P,e+=W,h+=U,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.le(e>>16,i>>16,m.lt,r,g,0,0,R,S,k,v,x,D,l>>8,o>>8),i+=F,e+=W,o+=B,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(e>>16,t>>16,m.lt,r,g,0,0,R,S,k,v,x,D,l>>8,h>>8),t+=P,e+=W,h+=U,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}};static le=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w)=>{if(t>=i)return;let y,p,A,_,g,I,C,E,T;if(this.Fi){if(y=(w-d)/(i-t)|0,i>m.ut&&(i=m.ut),t<0&&(d-=t*y,t=0),t>=i)return;p=i-t>>3,y<<=12}else i-t>7?(p=i-t>>3,y=(w-d)*this.vi[p]>>6):(p=0,y=0);if(d<<=9,s+=t,this.Ri&&n)if(A=0,_=0,I=t-this.ki,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(h=l/g|0,(r=o/g|0)<0?r=0:r>4032&&(r=4032)),o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>4032&&(A=4032)),C=A-r>>3,E=_-h>>3,r+=d>>3&786432,T=d>>23,this.Hi){for(;p-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r=A,h=_,o+=c,l+=f,g=(a+=u)>>12,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>4032&&(A=4032)),C=A-r>>3,E=_-h>>3,r+=(d+=y)>>3&786432,T=d>>23;for(p=i-t&7;p-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E}else{for(;p-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>T)&&(e[s]=t),s+=1,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s+=1,r=A,h=_,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>4032&&(A=4032)),C=A-r>>3,E=_-h>>3,r+=(d+=y)>>3&786432,T=d>>23}for(p=i-t&7;p-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>T)&&(e[s]=t),s++,r+=C,h+=E}}else if(A=0,_=0,I=t-this.ki,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(h=l/g|0,(r=o/g|0)<0?r=0:r>16256&&(r=16256)),o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>16256&&(A=16256)),C=A-r>>3,E=_-h>>3,r+=6291456&d,T=d>>23,this.Hi&&n){for(;p-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r=A,h=_,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>16256&&(A=16256)),C=A-r>>3,E=_-h>>3,r+=6291456&(d+=y),T=d>>23;for(p=i-t&7;p-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E}else{for(;p-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>T)&&(e[s]=t),s+=1,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,r=A,h=_,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>16256&&(A=16256)),C=A-r>>3,E=_-h>>3,r+=6291456&(d+=y),T=d>>23}for(p=i-t&7;p-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>T)&&(e[s]=t),s++,r+=C,h+=E}}};static re=(t,i,e,s,n)=>{if(this.Fi&&(i>m.ut&&(i=m.ut),t<0&&(t=0)),t>=i)return;s+=t;let r=i-t>>2;if(0===this.alpha)for(;;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n}e[s++]=n,e[s++]=n,e[s++]=n,e[s++]=n}const h=this.alpha,o=256-this.alpha;for(n=((16711935&n)*o>>8&16711935)+((65280&n)*o>>8&65280);;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}};static te=t=>{this.Pi[t]&&this.Bi&&(this.Bi[this.Ui++]=this.Pi[t],this.Pi[t]=null)};static oe=t=>{if(this.Gi[t]=this.Wi++,this.Pi[t])return this.Pi[t];let i;if(this.Ui>0&&this.Bi)i=this.Bi[--this.Ui],this.Bi[this.Ui]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.lt[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.lt[t]];this.Vi[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.Vi[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}const F=['F11','F12'],B={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}};class P{static enabled=!1;static ae=null;static ce=null;static fe=0;static ue=0;static de=0;static we=0;static ye=0;static me=()=>{this.ae=O.Xt(1),this.ce=null,this.fe=performance.now(),this.enabled=!0};static pe=()=>{this.enabled=!1,this.ae=null};static flush=()=>{let t=null;return this.ce&&this.enabled&&(t=this.ce),this.ce=null,t};static stop=()=>{let t=null;return this.ae&&this.ae.Vt>0&&this.enabled&&(t=this.ae),this.pe(),t};static Ae=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.ue++;const s=performance.now();let n=(s-this.fe)/10|0;n>250&&(n=250),this.fe=s,this._e(5),1===e?this.ae?.p1(1):this.ae?.p1(2),this.ae?.p1(n),this.ae?.p3(t+(i<<10))};static ge=t=>{if(!this.enabled)return;this.ue++;const i=performance.now();let e=(i-this.fe)/10|0;e>250&&(e=250),this.fe=i,this._e(2),1===t?this.ae?.p1(3):this.ae?.p1(4),this.ae?.p1(e)};static Ie=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.de>=50){this.de=e,this.ue++;let s=(e-this.fe)/10|0;s>250&&(s=250),this.fe=e,t-this.we<8&&t-this.we>=-8&&i-this.ye<8&&i-this.ye>=-8?(this._e(3),this.ae?.p1(5),this.ae?.p1(s),this.ae?.p1(t+(i-this.ye+8<<4)+8-this.we)):t-this.we<128&&t-this.we>=-128&&i-this.ye<128&&i-this.ye>=-128?(this._e(4),this.ae?.p1(6),this.ae?.p1(s),this.ae?.p1(t+128-this.we),this.ae?.p1(i+128-this.ye)):(this._e(5),this.ae?.p1(7),this.ae?.p1(s),this.ae?.p3(t+(i<<10))),this.we=t,this.ye=i}};static Ce=t=>{if(!this.enabled)return;this.ue++;const i=performance.now();let e=(i-this.fe)/10|0;e>250&&(e=250),this.fe=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this._e(3),this.ae?.p1(8),this.ae?.p1(e),this.ae?.p1(t)};static Ee=t=>{if(!this.enabled)return;this.ue++;const i=performance.now();let e=(i-this.fe)/10|0;e>250&&(e=250),this.fe=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this._e(3),this.ae?.p1(9),this.ae?.p1(e),this.ae?.p1(t)};static Te=()=>{if(!this.enabled)return;this.ue++;const t=performance.now();let i=(t-this.fe)/10|0;i>250&&(i=250),this.fe=t,this._e(2),this.ae?.p1(10),this.ae?.p1(i)};static be=()=>{if(!this.enabled)return;this.ue++;const t=performance.now();let i=(t-this.fe)/10|0;i>250&&(i=250),this.fe=t,this._e(2),this.ae?.p1(11),this.ae?.p1(i)};static Oe=()=>{if(!this.enabled)return;this.ue++;const t=performance.now();let i=(t-this.fe)/10|0;i>250&&(i=250),this.fe=t,this._e(2),this.ae?.p1(12),this.ae?.p1(i)};static Re=()=>{if(!this.enabled)return;this.ue++;const t=performance.now();let i=(t-this.fe)/10|0;i>250&&(i=250),this.fe=t,this._e(2),this.ae?.p1(13),this.ae?.p1(i)};static _e=t=>{if(this.ae&&this.ae.Vt+t>=500){const t=this.ae;this.ae=O.Xt(1),this.ce=t}}}class U{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}ve=0;Le=[];Se=0;xe=null;state=0;Me=20;ke=1;De=[];Ne=0;Fe=0;Be=[];Pe=!0;Ue=!1;We=50;hasFocus=!0;Ge=!1;Ye=0;He=0;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=[];qe=[];Je=0;$e=0;input=null;Qe=!1;ts=!1;es=!1;time=-1;ss=0;ns=0;rs=0;hs=0;os=0;ls=0;constructor(t=!1){p.tabIndex=-1,A.fillStyle='black',A.fillRect(0,0,p.width,p.height),this.Ue=t,this.Ue?this.resize(window.innerWidth,window.innerHeight):this.resize(p.width,p.height)}get width(){return p.width}get height(){return p.height}resize=(t,i)=>{p.width=t,p.height=i,this.xe=new C(t,i),N.ji()};run=async()=>{p.addEventListener('resize',(()=>{this.Ue&&this.resize(window.innerWidth,window.innerHeight)}),!1),p.onmousedown=this.onmousedown,p.onmouseup=this.onmouseup,p.onmouseenter=this.onmouseenter,p.onmouseleave=this.onmouseleave,p.onmousemove=this.onmousemove,window.onbeforeunload=this.Xi,p.onfocus=this.onfocus,p.onblur=this.onblur,this.cs?(p.ontouchstart=this.ontouchstart,p.ontouchend=this.ontouchend,p.ontouchmove=this.ontouchmove):(p.onkeydown=this.onkeydown,p.onkeyup=this.onkeyup),p.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.cs&&'low'===U.getParameter('detail')&&(this.We=30),await this.fs(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.De[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.us();const r=e,h=s;e=300,s=1,t=performance.now();const o=this.De[i];if(0===o?(e=r,s=h):t>o&&(e=2560*this.Me/(t-o)|0),e<25?e=25:e>256&&(e=256,s=this.Me-(t-o)/10|0),this.De[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.De[t]&&(this.De[t]+=s);for(s0&&(this.Ne=1e3*e/(256*this.Me)|0);const l=performance.now();if(this.Pe&&this.refresh(),await this.draw(),this.Be[this.Fe]=(performance.now()-l)/1e3,this.Fe=(this.Fe+1)%this.Be.length,this.We<50){const i=1e3/this.We-(performance.now()-t);i>0&&await E(i)}}-1===this.state&&this.us()};us=()=>{this.state=-2,this.Xi()};ds=t=>{this.Me=1e3/t|0};ws=t=>{this.We=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.Me|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};Xi=()=>{};draw=async()=>{};refresh=()=>{};async fs(t,i){const e=this.width,s=this.height;this.Pe&&(A.fillStyle='black',A.fillRect(0,0,e,s),this.Pe=!1);const n=s/2-18;A.fillStyle='rgb(140, 17, 17)',A.rect((e/2|0)-152,n,304,34),A.fillRect((e/2|0)-150,n+2,3*t,30),A.fillStyle='black',A.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),A.font='bold 13px helvetica, sans-serif',A.textAlign='center',A.fillStyle='white',A.fillText(i,e/2|0,n+22),await E(5)}ys=()=>{let t=-1;return this.$e!==this.Je&&(t=this.qe[this.Je],this.Je=this.Je+1&127),t};get ms(){const t=this.Be.length;let i=0;for(let e=0;ethis.ve&&(this.ve=e),this.Le[this.Se]=e,this.Se=(this.Se+1)%250,e}get ps(){return this.Le.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.Ye=0;const e=B[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===B.ArrowLeft.code?n=1:s===B.ArrowRight.code?n=2:s===B.ArrowUp.code?n=3:s===B.ArrowDown.code?n=4:s===B.Control.code?n=5:s===B.Shift.code?n=6:s===B.Alt.code?n=7:s===B.Backspace.code||s===B.Delete.code?n=8:s===B.Tab.code?n=9:s===B.Enter.code?n=10:s>=B.F1.code&&s<=B.F12.code?n=s+1008-B.F1.code:s===B.Home.code?n=1e3:s===B.End.code?n=1001:s===B.PageUp.code?n=1002:s===B.PageDown.code&&(n=1003),n>0&&n<128&&(this.Ze[n]=1),n>4&&(this.qe[this.$e]=n,this.$e=this.$e+1&127),P.enabled&&P.Ce(n),F.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.Ye=0;const e=B[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===B.ArrowLeft.code?n=1:s===B.ArrowRight.code?n=2:s===B.ArrowUp.code?n=3:s===B.ArrowDown.code?n=4:s===B.Control.code?n=5:s===B.Shift.code?n=6:s===B.Alt.code?n=7:s===B.Backspace.code||s===B.Delete.code?n=8:s===B.Tab.code?n=9:s===B.Enter.code?n=10:s>=B.F1.code&&s<=B.F12.code?n=s+1008-B.F1.code:s===B.Home.code?n=1e3:s===B.End.code?n=1001:s===B.PageUp.code?n=1002:s===B.PageDown.code&&(n=1003),n>0&&n<128&&(this.Ze[n]=0),P.enabled&&P.Ee(n),F.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.Qe=!1,(t.clientX>0||t.clientY>0)&&this.As(t),this.Ye=0,this.je=this.Ve,this.ze=this.Ke,this.cs&&!this._s){if(this.gs()||this.Is()||this.Cs())return this.Xe=1,void(this.He=1);t.timeStamp>=this.time+500?(this.Xe=2,this.He=2):(this.Xe=1,this.He=1)}else 2===t.button?(this.Xe=2,this.He=2):(this.Xe=1,this.He=1);P.enabled&&P.Ae(this.je,this.ze,t.buttons)};onmouseup=t=>{this.As(t),this.Ye=0,this.He=0,P.enabled&&P.ge(t.buttons)};onmouseenter=t=>{this.As(t),P.enabled&&P.Oe()};onmouseleave=t=>{this.As(t),this.Ye=0,this.Ve=-1,this.Ke=-1,this.He=0,this.je=-1,this.ze=-1,P.enabled&&P.Re()};onmousemove=t=>{this.As(t),this.Ye=0,P.enabled&&P.Ie(this.Ve,this.Ke)};onfocus=t=>{this.hasFocus=!0,this.Pe=!0,this.refresh(),P.enabled&&P.Te()};onblur=t=>{this.hasFocus=!1,P.enabled&&P.be()};ontouchstart=t=>{if(!this.cs)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.Qe=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.ss=this.os=this.rs=0|i.screenX,this.ns=this.ls=this.hs=0|i.screenY,this.time=t.timeStamp,this.ts=this.Es(),this.es=this.Ts()};ontouchend=t=>{if(!this.cs||!this.Qe)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.os=0|i.screenX,this.ls=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.ts&&!this.Es())return void(this.Qe=!1);if(this.es&&!this.Ts())return void(this.Qe=!1);if(this.gs()||this.bs()||this.Is()||this.Cs()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.Is()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.Cs()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.gs()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.bs()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.Os?t.setAttribute('type','password'):t.setAttribute('type',this.Cs()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.Os&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.Os&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.Os&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.Qe=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.ss-this.os)>16||Math.abs(this.ns-this.ls)>16;n&&!r?(this.Qe=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.He=0,this.Qe=!1)};ontouchmove=t=>{if(!this.cs||!this.Qe)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.os=0|i.screenX,this.ls=0|i.screenY,this.ts&&-1===this.Rs()?(this.rs-this.os>0?this.rotate(2):this.rs-this.os<0&&this.rotate(0),this.hs-this.ls>0?this.rotate(3):this.hs-this.ls<0&&this.rotate(1)):(this.es||-1!==this.Rs())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.rs=this.os,this.hs=this.ls};get cs(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get Os(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get _s(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}Es=()=>this.Ge&&this.Ve>=8&&this.Ve<=520&&this.Ke>=11&&this.Ke<=345;gs=()=>this.Ge&&-1===this.vs()&&!this.Ls()&&!this.Ss()&&this.Ve>=11&&this.Ve<=506&&this.Ke>=449&&this.Ke<=482;bs=()=>this.Ge&&(this.Ls()||this.Ss())&&this.Ve>=11&&this.Ve<=506&&this.Ke>=383&&this.Ke<=482;Ts=()=>this.Ge&&this.Ve>=562&&this.Ve<=752&&this.Ke>=231&&this.Ke<=492;Is=()=>!this.Ge&&2===this.xs()&&this.Ve>=301&&this.Ve<=562&&this.Ke>=262&&this.Ke<=279;Cs=()=>!this.Ge&&2===this.xs()&&this.Ve>=301&&this.Ve<=562&&this.Ke>=279&&this.Ke<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};Ms=()=>null!==document.fullscreenElement;As=t=>{if(this.Ms()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/p.height,s=(window.innerWidth-p.width*e)/2;this.Ve=0|this.ks(t.clientX-i.left-s,0,p.width*e,0,789),this.Ke=0|this.ks(t.clientY-i.top,0,p.height*e,0,532)}else{const i=p.getBoundingClientRect(),e=p.width/i.width,s=p.height/i.height;this.Ve=(t.clientX-i.left)*e|0,this.Ke=(t.clientY-i.top)*s|0}this.Ve<0&&(this.Ve=0),this.Ke<0&&(this.Ke=0),this.Ve>789&&(this.Ve=789),this.Ke>532&&(this.Ke=532)};ks=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}class W{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));Ds=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Ns=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};Fs=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}class G{static Fs=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.Ps)return null;if(this.Hs[t])return this.Hs[t];const e=this.Ys[t],s=e+this.Gs[t];if(this.Bs){const i=Uint8Array.from(this.buffer.subarray(e,e+s));return this.Hs[t]=i,i}{const e=Uint8Array.from(i.read(this.Ws[t],this.buffer,this.Gs[t],this.Ys[t]));return this.Hs[t]=e,e}}}class Y{static Ks=new Uint8Array(520);Xs;js;store;constructor(t,i,e){this.Xs=new O(t),this.js=new O(i),this.store=e+1}get Ps(){return this.js.length/6}read(t,i=!1){this.js.Vt=6*t;const e=this.js.Jt;let s=this.js.Jt;if(s<=0||s>this.Xs.length/520)return null;const n=new Uint8Array(e);let r=0;for(let i=0;r512&&(h=512),this.Xs.si(h+8,0,Y.Ks);const o=(255&Y.Ks[0])<<8|255&Y.Ks[1],l=(255&Y.Ks[2])<<8|255&Y.Ks[3],a=(255&Y.Ks[4])<<16|(255&Y.Ks[5])<<8|255&Y.Ks[6],c=255&Y.Ks[7];if(o!==t||l!==i||c!==this.store)return null;if(a<0||a>this.Xs.length/520)return null;for(let t=0;t>>0;if(h.free_u8(e,a),4294967295===s){const t=h.error_message(),i=h.error_message_len(),e=new Uint8Array(h.memory.buffer,t,i),s=(new TextDecoder).decode(e);throw new l(s)}const n=h.buffer()>>>0;return new Uint8Array(h.memory.buffer,n,s)}(n)}}class H{static zs=[];static Zs=t=>{const i=new O(t.read('base_head.dat')),e=new O(t.read('base_type.dat')),s=new O(t.read('base_label.dat')),n=i.Zt;i.Vt+=2;for(let t=0;t{const i=new O(t.read('frame_head.dat')),e=new O(t.read('frame_tran1.dat')),s=new O(t.read('frame_tran2.dat')),n=new O(t.read('frame_del.dat')),r=i.Zt;i.Vt+=2;const h=new Int32Array(500),o=new Int32Array(500),l=new Int32Array(500),a=new Int32Array(500);for(let t=0;t0){if(0!==f.types[t])for(let i=t-1;i>d;i--)if(0===f.types[i]){h[w]=i,o[w]=0,l[w]=0,a[w]=0,w++;break}h[w]=t;let e=0;3===f.types[h[w]]&&(e=128),o[w]=1&i?s.ti:e,l[w]=2&i?s.ti:e,a[w]=4&i?s.ti:e,d=t,w++}}r.length=w,r.Js=new Int32Array(w),r.x=new Int32Array(w),r.y=new Int32Array(w),r.z=new Int32Array(w);for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static ir=(t,i,e)=>{const s=t.$s,n=t.Qs,r=t.tn;let h,o,l,a,c;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.$s,r=t.Qs,h=t.tn;let o,l,a,c,f;if(s)o=t.cr,l=t.er,a=t.ur;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let i=0;i{const e=t.$s,s=t.Qs,n=t.tn,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.cr[i],a=t.er[i],c=t.ur[i];for(let t=0;t{if(!j.metadata)throw new Error('cant loading model metadata!!!!!');const i=j.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(j.head&&j.mn&&j.pn&&j.An&&j._n&&j.gn&&j.In&&j.Cn&&j.En&&j.Tn&&j.bn&&j.On&&j.Rn&&j.axis))throw new Error('cant loading model!!!!!');const e=i.$s,s=i.Qs,n=i.tn,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),l=new Int32Array(s),a=new Int32Array(s),c=new Int32Array(s),f=new Int32Array(n),u=new Int32Array(n),d=new Int32Array(n);let w=null;i.hn>=0&&(w=new Int32Array(e));let y=null;i.fn>=0&&(y=new Int32Array(s));let m=null,p=0;i.un>=0?m=new Int32Array(s):p=-i.un-1;let A=null;i.dn>=0&&(A=new Int32Array(s));let _=null;i.wn>=0&&(_=new Int32Array(s));const g=new Int32Array(s);j.In.Vt=i.en,j.Cn.Vt=i.sn,j.En.Vt=i.nn,j.Tn.Vt=i.rn,j.bn.Vt=i.hn;let I,C,E,T=0,b=0,O=0;for(let t=0;t{if(!j.metadata||!j.metadata[i])throw new Error('No model metadata');const e=j.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const s=e.$s,n=e.Qs,r=e.tn,h=new Int32Array(s),o=new Int32Array(s),l=new Int32Array(s),a=new Int32Array(n),c=new Int32Array(n),f=new Int32Array(n),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(r);let y=null;e.hn>=0&&(y=new Int32Array(s));let m=null;e.fn>=0&&(m=new Int32Array(n));let p=null,A=0;e.un>=0?p=new Int32Array(n):A=-e.un-1;let _=null;e.dn>=0&&(_=new Int32Array(n));let g=null;e.wn>=0&&(g=new Int32Array(n));const I=new Int32Array(n),C=new O(e.data);C.Vt=e.en;const E=new O(e.data);E.Vt=e.sn;const T=new O(e.data);T.Vt=e.nn;const b=new O(e.data);b.Vt=e.rn;const R=new O(e.data);R.Vt=e.hn;let v,L,S,x=0,M=0,k=0;for(let t=0;tthis.vr&&(this.vr=-e),e>this.Rr&&(this.Rr=e);const n=i*i+s*s;n>this.Or&&(this.Or=n)}this.Or=Math.sqrt(this.Or)+.99|0,this.Sr=Math.sqrt(this.Or*this.Or+this.vr*this.vr)+.99|0,this.Lr=this.Sr+(Math.sqrt(this.Or*this.Or+this.Rr*this.Rr)+.99|0)}Xr(){this.vr=0,this.Rr=0;for(let t=0;tthis.vr&&(this.vr=-i),i>this.Rr&&(this.Rr=i)}this.Sr=Math.sqrt(this.Or*this.Or+this.vr*this.vr)+.99|0,this.Lr=this.Sr+(Math.sqrt(this.Or*this.Or+this.Rr*this.Rr)+.99|0)}jr(){if(this.kr){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Fr=new v(i+1,null);for(let e=0;e<=i;e++)this.Fr[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Br=new v(i+1,null);for(let e=0;e<=i;e++)this.Br[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;eo;)o=e[h++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==o||0===r.types[i])&&this.Zr(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}j.Xn=0,j.jn=0,j.zn=0,h=0,o=e[h++];for(let t=0;to;)o=e[h++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===o||0===r.types[i])&&this.Zr(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.qr(t)}qr(t){if(!this.Fr||-1===t||!V.zs[t])return;const i=V.zs[t],e=i.qs;j.Xn=0,j.jn=0,j.zn=0;for(let t=0;t>16;this.ur[t]=this.er[t]*i+this.ur[t]*e>>16,this.er[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.sr&&this.nr&&this.rr||(this.sr=new Int32Array(this.Qs),this.nr=new Int32Array(this.Qs),this.rr=new Int32Array(this.Qs)),!this.lr){this.lr=new v(this.$s,null);for(let t=0;t8192||m>8192||p>8192||y<-8192||m<-8192||p<-8192;)y>>=1,m>>=1,p>>=1;let A=0|Math.sqrt(y*y+m*m+p*p);if(A<=0&&(A=1),y=256*y/A|0,m=256*m/A|0,p=256*p/A|0,this.hr&&1&this.hr[i]){const r=t+((e*y+s*m+n*p)/(h+(h/2|0))|0);this.Ar&&(this.sr[i]=j.tr(this.Ar[i],r,this.hr[i]))}else{let t=this.lr[r];t&&(t.x+=y,t.y+=m,t.z+=p,t.w++),t=this.lr[o],t&&(t.x+=y,t.y+=m,t.z+=p,t.w++),t=this.lr[l],t&&(t.x+=y,t.y+=m,t.z+=p,t.w++)}}if(r)this.eh(t,h,e,s,n);else{this.ar=new v(this.$s,null);for(let t=0;t>16;for(let s=0;s>16,A=A*u-p*f>>16,p=m),0!==t&&(m=A*l-_*o>>16,_=A*o+_*l>>16,A=m),0!==i&&(m=_*a+p*c>>16,_=_*c-p*a>>16,p=m),p+=n,A+=r,_+=h,m=A*w-_*d>>16,_=A*d+_*w>>16,A=m,j.Sn&&j.xn&&j.Mn&&(j.Mn[s]=_-y,j.Sn[s]=N.ki+((p<<9)/_|0),j.xn[s]=N.Di+((A<<9)/_|0)),this.tn>0&&j.kn&&j.Dn&&j.Nn&&(j.kn[s]=p,j.Dn[s]=A,j.Nn[s]=_)}try{this.rh(!1,!1,0)}catch(t){}}draw(t,i,e,s,n,r,h,o,l){const a=o*n-r*s>>16,c=h*i+a*e>>16,f=this.Or*e>>16,u=c+f;if(u<=50||c>=3500)return;const d=o*s+r*n>>16;let w=d-this.Or<<9;if((w/u|0)>=m.dt)return;let y=d+this.Or<<9;if((y/u|0)<=-m.dt)return;const p=h*e-a*i>>16,A=this.Or*i>>16;let _=p+A<<9;if((_/u|0)<=-m.wt)return;let g=p-(A+(this.vr*e>>16))<<9;if((g/u|0)>=m.wt)return;let I=c-(f+(this.vr*i>>16))<=50,C=!1;if(l>0&&j.Zn){let t=c-f;t<=50&&(t=50),d>0?(w=w/u|0,y=y/t|0):(y=y/u|0,w=w/t|0),p>0?(g=g/u|0,_=_/t|0):(_=_/u|0,g=g/t|0);const i=j.Ve-N.ki,e=j.Ke-N.Di;i>w&&ig&&e<_&&(this.Hr?j.Jn[j.qn++]=l:C=!0)}const E=N.ki,T=N.Di;let b=0,O=0;0!==t&&(b=N.sin[t],O=N.cos[t]);for(let l=0;l>16,d=d*O-f*b>>16,f=a),f+=r,u+=h,d+=o,a=d*s+f*n>>16,d=d*n-f*s>>16,f=a,a=u*e-d*i>>16,d=u*i+d*e>>16,u=a,j.Mn&&(j.Mn[l]=d-c),d>=50&&j.Sn&&j.xn?(j.Sn[l]=E+((f<<9)/d|0),j.xn[l]=T+((u<<9)/d|0)):j.Sn&&(j.Sn[l]=-5e3,I=!0),(I||this.tn>0)&&j.kn&&j.Dn&&j.Nn&&(j.kn[l]=f,j.Dn[l]=u,j.Nn[l]=d)}try{this.rh(I,C,l)}catch(t){}}rh(t,i,e,s=!1){j.$n&&(this.Vr=-1,this.Kr=-1);for(let t=0;tm.ut||l>m.ut||a>m.ut),j.Bn&&j.Fn){const t=((d+w+y)/3|0)+this.Sr;j.Bn[t][j.Fn[t]++]=s,j.$n&&this.hh(j.Ve,j.Ke,c,f,u,o,l,a)&&this.Kr=0;t--){const i=j.Fn[t];if(!(i<=0)&&j.Bn){const e=j.Bn[t];for(let t=0;t=0;t--){const i=j.Fn[t];if(i>0&&j.Bn){const e=j.Bn[t];for(let s=0;s0||j.Pn[2]>0)&&(n=(j.Yn[1]+j.Yn[2])/(j.Pn[1]+j.Pn[2])|0);let r=0;j.Pn&&j.Yn&&(j.Pn[3]>0||j.Pn[4]>0)&&(r=(j.Yn[3]+j.Yn[4])/(j.Pn[3]+j.Pn[4])|0);let h=0;if(j.Pn&&j.Yn&&(j.Pn[6]>0||j.Pn[8]>0)&&(h=(j.Yn[6]+j.Yn[8])/(j.Pn[6]+j.Pn[8])|0),j.Pn&&j.Un){let t,i=0,e=j.Pn[10],o=j.Un[10],l=j.Wn;i===e&&(i=0,e=j.Pn[11],o=j.Un[11],l=j.Gn),t=in;)try{this.oh(o[i++],s),i===e&&o!==j.Un[11]&&(i=0,e=j.Pn[11],o=j.Un[11],l=j.Gn),t=ir;)try{this.oh(o[i++],s),i===e&&o!==j.Un[11]&&(i=0,e=j.Pn[11],o=j.Un[11],l=j.Gn),t=ih;)try{this.oh(o[i++],s),i===e&&o!==j.Un[11]&&(i=0,e=j.Pn[11],o=j.Un[11],l=j.Gn),t=i>2,r=this._r[i],h=this.gr[i],o=this.Ir[i];N.he(j.Sn[e],j.Sn[s],j.Sn[n],j.xn[e],j.xn[s],j.xn[n],this.sr[t],this.nr[t],this.rr[t],j.kn[r],j.Dn[r],j.Nn[r],j.kn[h],j.kn[o],j.Dn[h],j.Dn[o],j.Nn[h],j.Nn[o],this.Ar[t])}else if(3===r&&this.hr&&this.Ar&&this.sr&&j.Sn&&j.xn&&j.kn&&j.Dn&&j.Nn){const i=this.hr[t]>>2,r=this._r[i],h=this.gr[i],o=this.Ir[i];N.he(j.Sn[e],j.Sn[s],j.Sn[n],j.xn[e],j.xn[s],j.xn[n],this.sr[t],this.sr[t],this.sr[t],j.kn[r],j.Dn[r],j.Nn[r],j.kn[h],j.kn[o],j.Dn[h],j.Dn[o],j.Nn[h],j.Nn[o],this.Ar[t])}}lh(t,i=!1){let e=0;if(j.Nn){const i=N.ki,s=N.Di,n=this.dr[t],r=this.wr[t],h=this.yr[t],o=j.Nn[n],l=j.Nn[r],a=j.Nn[h];if(o>=50&&j.Sn&&j.xn&&this.sr)j.Hn[e]=j.Sn[n],j.Vn[e]=j.xn[n],j.Kn[e++]=this.sr[t];else if(j.kn&&j.Dn&&this.sr){const c=j.kn[n],f=j.Dn[n],u=this.sr[t];if(a>=50&&this.rr){const n=(50-o)*N.Li[a-o];j.Hn[e]=i+((c+((j.kn[h]-c)*n>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[h]-f)*n>>16)<<9)/50|0),j.Kn[e++]=u+((this.rr[t]-u)*n>>16)}if(l>=50&&this.nr){const n=(50-o)*N.Li[l-o];j.Hn[e]=i+((c+((j.kn[r]-c)*n>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[r]-f)*n>>16)<<9)/50|0),j.Kn[e++]=u+((this.nr[t]-u)*n>>16)}}if(l>=50&&j.Sn&&j.xn&&this.nr)j.Hn[e]=j.Sn[r],j.Vn[e]=j.xn[r],j.Kn[e++]=this.nr[t];else if(j.kn&&j.Dn&&this.nr){const c=j.kn[r],f=j.Dn[r],u=this.nr[t];if(o>=50&&this.sr){const r=(50-l)*N.Li[o-l];j.Hn[e]=i+((c+((j.kn[n]-c)*r>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[n]-f)*r>>16)<<9)/50|0),j.Kn[e++]=u+((this.sr[t]-u)*r>>16)}if(a>=50&&this.rr){const n=(50-l)*N.Li[a-l];j.Hn[e]=i+((c+((j.kn[h]-c)*n>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[h]-f)*n>>16)<<9)/50|0),j.Kn[e++]=u+((this.rr[t]-u)*n>>16)}}if(a>=50&&j.Sn&&j.xn&&this.rr)j.Hn[e]=j.Sn[h],j.Vn[e]=j.xn[h],j.Kn[e++]=this.rr[t];else if(j.kn&&j.Dn&&this.rr){const c=j.kn[h],f=j.Dn[h],u=this.rr[t];if(l>=50&&this.nr){const n=(50-a)*N.Li[l-a];j.Hn[e]=i+((c+((j.kn[r]-c)*n>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[r]-f)*n>>16)<<9)/50|0),j.Kn[e++]=u+((this.nr[t]-u)*n>>16)}if(o>=50&&this.sr){const r=(50-a)*N.Li[o-a];j.Hn[e]=i+((c+((j.kn[n]-c)*r>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[n]-f)*r>>16)<<9)/50|0),j.Kn[e++]=u+((this.sr[t]-u)*r>>16)}}}const s=j.Hn[0],n=j.Hn[1],r=j.Hn[2],h=j.Vn[0],o=j.Vn[1],l=j.Vn[2];if(!((s-n)*(l-o)-(h-o)*(r-n)<=0))if(N.Fi=!1,3===e){let e;if((s<0||n<0||r<0||s>m.ut||n>m.ut||r>m.ut)&&(N.Fi=!0),e=this.hr?3&this.hr[t]:0,i)N.Ct(s,n,h,o,j.Kn[0]),N.Ct(n,r,o,l,j.Kn[1]),N.Ct(r,s,l,h,j.Kn[2]);else if(0===e)N.ee(s,n,r,h,o,l,j.Kn[0],j.Kn[1],j.Kn[2]);else if(1===e&&this.sr)N.ne(s,n,r,h,o,l,N.palette[this.sr[t]]);else if(2===e&&this.hr&&this.Ar&&j.kn&&j.Dn&&j.Nn){const i=this.hr[t]>>2,e=this._r[i],a=this.gr[i],c=this.Ir[i];N.he(s,n,r,h,o,l,j.Kn[0],j.Kn[1],j.Kn[2],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t])}else if(3===e&&this.hr&&this.Ar&&this.sr&&j.kn&&j.Dn&&j.Nn){const i=this.hr[t]>>2,e=this._r[i],a=this.gr[i],c=this.Ir[i];N.he(s,n,r,h,o,l,this.sr[t],this.sr[t],this.sr[t],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t])}}else if(4===e){let e;if((s<0||n<0||r<0||s>m.ut||n>m.ut||r>m.ut||j.Hn[3]<0||j.Hn[3]>m.ut)&&(N.Fi=!0),e=this.hr?3&this.hr[t]:0,i)N.Ct(s,n,h,o,j.Kn[0]),N.Ct(n,r,o,l,j.Kn[1]),N.Ct(r,j.Hn[3],l,j.Vn[3],j.Kn[2]),N.Ct(j.Hn[3],s,j.Vn[3],h,j.Kn[3]);else if(0===e)N.ee(s,n,r,h,o,l,j.Kn[0],j.Kn[1],j.Kn[2]),N.ee(s,r,j.Hn[3],h,l,j.Vn[3],j.Kn[0],j.Kn[2],j.Kn[3]);else if(1===e){if(this.sr){const i=N.palette[this.sr[t]];N.ne(s,n,r,h,o,l,i),N.ne(s,r,j.Hn[3],h,l,j.Vn[3],i)}}else if(2===e&&this.hr&&this.Ar&&j.kn&&j.Dn&&j.Nn){const i=this.hr[t]>>2,e=this._r[i],a=this.gr[i],c=this.Ir[i];N.he(s,n,r,h,o,l,j.Kn[0],j.Kn[1],j.Kn[2],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t]),N.he(s,r,j.Hn[3],h,l,j.Vn[3],j.Kn[0],j.Kn[2],j.Kn[3],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t])}else if(3===e&&this.hr&&this.Ar&&this.sr&&j.kn&&j.Dn&&j.Nn){const i=this.hr[t]>>2,e=this._r[i],a=this.gr[i],c=this.Ir[i];N.he(s,n,r,h,o,l,this.sr[t],this.sr[t],this.sr[t],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t]),N.he(s,r,j.Hn[3],h,l,j.Vn[3],this.sr[t],this.sr[t],this.sr[t],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t])}}}Zr(t,i,e,s,n){if(!s)return;const r=s.length;if(0===n){let n=0;j.Xn=0,j.jn=0,j.zn=0;for(let t=0;t0?(j.Xn=(j.Xn/n|0)+t,j.jn=(j.jn/n|0)+i,j.zn=(j.zn/n|0)+e):(j.Xn=t,j.jn=i,j.zn=e)}else if(1===n)for(let n=0;n=this.Fr.length)continue;const h=this.Fr[r];if(h)for(let s=0;s=this.Fr.length)continue;const h=this.Fr[r];if(h)for(let s=0;s>16;this.er[n]=this.er[n]*c-this.cr[n]*a>>16,this.cr[n]=t}if(0!==r){a=N.sin[r],c=N.cos[r];const t=this.er[n]*c-this.ur[n]*a>>16;this.ur[n]=this.er[n]*a+this.ur[n]*c>>16,this.er[n]=t}if(0!==o){a=N.sin[o],c=N.cos[o];const t=this.ur[n]*a+this.cr[n]*c>>16;this.ur[n]=this.ur[n]*c-this.cr[n]*a>>16,this.cr[n]=t}this.cr[n]+=j.Xn,this.er[n]+=j.jn,this.ur[n]+=j.zn}}else if(3===n)for(let n=0;n=this.Fr.length)continue;const h=this.Fr[r];if(h)for(let s=0;s=this.Br.length)continue;const n=this.Br[e];if(n)for(let i=0;i255&&(this.pr[e]=255)}}}sh(){this.vr=0,this.Or=0,this.Rr=0,this.Cr=999999,this.Er=-999999,this.br=-99999,this.Tr=99999;for(let t=0;tthis.Er&&(this.Er=i),sthis.br&&(this.br=s),-e>this.vr&&(this.vr=-e),e>this.Rr&&(this.Rr=e);const n=i*i+s*s;n>this.Or&&(this.Or=n)}this.Or=0|Math.sqrt(this.Or),this.Sr=0|Math.sqrt(this.Or*this.Or+this.vr*this.vr),this.Lr=this.Sr+(0|Math.sqrt(this.Or*this.Or+this.Rr*this.Rr))}hh(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(g.src),g.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>g.onload=()=>t())),I.clearRect(0,0,_.width,_.height);const i=g.naturalWidth,e=g.naturalHeight;return _.width=i,_.height=e,I.drawImage(g,0,0),I.getImageData(0,0,i,e)})(e),n=new J(s.width,s.height),r=new Uint32Array(s.data.buffer),h=n.lt;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static gi=(t,i,e=0)=>{const s=new O(t.read(i+'.dat')),n=new O(t.read('index.dat'));n.Vt=s.Zt;const r=n.Zt,h=n.Zt,o=[],l=n.jt-1;for(let t=0;ts.length||n.Vt>n.length)throw new Error;const a=n.jt,c=n.jt,f=n.Zt,u=n.Zt,d=new J(f,u);d.mi=a,d.pi=c,d.Ai=r,d._i=h;const w=n.jt;if(0===w){const t=d.width*d.height;for(let i=0;im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.mh(r,n,this.lt,s,o,m.lt,e,h)}ph(t,i,e){i|=0,e|=0;let s=(i+=this.mi)+(e+=this.pi)*m.ct,n=0,r=this.height,h=this.width,o=m.ct-h,l=0;if(em.bottom&&(r-=e+r-m.bottom),im.right){const t=i+h-m.right;h-=t,l+=t,o+=t}h>0&&r>0&&this.Ah(h,r,this.lt,n,l,m.lt,s,o,t)}_h(t,i){t|=0,i|=0;let e=(t+=this.mi)+(i+=this.pi)*m.ct,s=0,n=this.height,r=this.width,h=m.ct-r,o=0;if(im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.gh(r,n,this.lt,s,o,m.lt,e,h)}Ci(){const t=this.lt,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.lt[s]=(r<<16)+(h<<8)+o}}}bi(t,i,e,s){t|=0,i|=0,e|=0,s|=0;try{const n=this.width;let r=0,h=0;const o=this.Ai,l=this._i,a=(o<<16)/e|0,c=(l<<16)/s|0;t+=(this.mi*e+o-1)/o|0,i+=(this.pi*s+l-1)/l|0,this.mi*e%o!=0&&(r=(o-this.mi*e%o<<16)/e|0),this.pi*s%l!=0&&(h=(l-this.pi*s%l<<16)/s|0),e=e*(this.width-(r>>16))/o|0,s=s*(this.height-(h>>16))/l|0;let f=t+i*m.ct,u=m.ct-e;if(im.bottom&&(s-=i+s-m.bottom),tm.right){const i=t+e-m.right;e-=i,u+=i}this.scale(e,s,this.lt,r,h,m.lt,u,f,n,a,c)}catch(t){console.error('error in sprite clipping routine')}}Ih(t,i,e,s,n,r,h,o,l,a){t|=0,i|=0,e|=0,s|=0;try{const c=-e/2|0,f=-s/2|0,u=65536*Math.sin(l/326.11)|0,d=65536*Math.cos(l/326.11)|0,w=u*a>>8,y=d*a>>8;let p=(h<<16)+f*w+c*y,A=f*y-c*w+(o<<16),_=t+i*m.ct;for(let t=0;t>16)+(h>>16)*this.width],s+=y,h-=w;p+=w,A+=y,_+=m.ct}}catch(t){}}Ch(t,i,e){t|=0,i|=0;let s=(t+=this.mi)+(i+=this.pi)*m.ct,n=0,r=this.height,h=this.width,o=m.ct-h,l=0;if(im.bottom&&(r-=i+r-m.bottom),tm.right){const i=t+h-m.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.Eh(h,r,this.lt,l,n,m.lt,s,o,e.lt)}scale(t,i,e,s,n,r,h,o,l,a,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*l;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=a}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}gh(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}Ah(t,i,e,s,n,r,h,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}h+=o,s+=n}}mh(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}Eh(t,i,e,s,n,r,h,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++}h+=o,n+=s}}}class ${static Th=['_','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','0','1','2','3','4','5','6','7','8','9'];static bh=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static Oh=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.Th[Number(s-37n*t)]}return e.slice(12-i).join('')};static Rh=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static Lh=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static xh=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static Mh=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}class Q{static zs=[];static kh=null;static Dh=null;static Nh=0;static Fh=1;static Bh=2;static Ph=3;static Uh=4;static Wh=5;static Gh=6;static Yh=7;static Hh=1;static Vh=2;static Kh=3;static Xh=4;static jh=5;static zh=6;static Zh=1;static qh=100;static Jh=101;static $h=200;static Qh=201;static io=202;static eo=203;static so=205;static no=300;static ro=301;static ho=302;static oo=303;static lo=304;static ao=305;static co=306;static fo=307;static uo=308;static do=309;static wo=310;static yo=311;static mo=312;static po=313;static Ao=314;static _o=315;static Io=316;static Co=317;static Eo=318;static To=319;static bo=320;static Oo=321;static Ro=322;static vo=323;static Lo=324;static So=325;static xo=326;static Mo=327;static ko=401;static Do=500;static No=501;static Fo=502;static Bo=503;static Po=600;static Uo=601;static Wo=602;static Go=603;static Yo=604;static Ho=605;static Vo=606;static Ko=607;static Xo=608;static jo=609;static zo=610;static Zo=611;static qo=612;static Jo=613;static $o=650;static Qo=651;static tl=652;static il=653;static el=654;static sl=655;static Zs=(t,i,e)=>{this.kh=new q(5e4),this.Dh=new q(5e4);const s=new O(t.read('data'));let n=-1;for(s.Vt+=2;s.Vt0){r.ll=new Uint8Array(h),r.al=new Uint16Array(h);for(let t=0;t0){r.scripts=new v(o,null);for(let t=0;t0){const s=e.lastIndexOf(',');r.Il[t]=this.Cl(i,e.substring(0,s),parseInt(e.substring(s+1),10))}}r.El=new v(5,null);for(let t=0;t<5;t++){const i=s.ei;r.El[t]=i,0===i.length&&(r.El[t]=null)}}if(r.type===Q.Ph&&(r.fill=1===s.jt),r.type===Q.Uh||r.type===Q.Fh){r.Tl=1===s.jt;const t=s.jt;e&&(r.font=e[t]),r.bl=1===s.jt}if(r.type===Q.Uh&&(r.text=s.ei,r.Ol=s.ei),r.type!==Q.Fh&&r.type!==Q.Ph&&r.type!==Q.Uh||(r.Rl=s.$t),r.type!==Q.Ph&&r.type!==Q.Uh||(r.vl=s.$t,r.Ll=s.$t),r.type===Q.Wh){const t=s.ei;if(t.length>0){const e=t.lastIndexOf(',');r.Sl=this.Cl(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=s.ei;if(e.length>0){const t=e.lastIndexOf(',');r.xl=this.Cl(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(r.type===Q.Gh){const t=s.jt;0!==t&&(r.model=this.Ml((t-1<<8)+s.jt));const i=s.jt;0!==i&&(r.kl=this.Ml((i-1<<8)+s.jt)),r.Dl=s.jt,0===r.Dl?r.Dl=-1:r.Dl=(r.Dl-1<<8)+s.jt,r.Nl=s.jt,0===r.Nl?r.Nl=-1:r.Nl=(r.Nl-1<<8)+s.jt,r.zoom=s.Zt,r.Fl=s.Zt,r.Bl=s.Zt}if(r.type===Q.Yh){r.dl=new Int32Array(r.width*r.height),r.wl=new Int32Array(r.width*r.height),r.Tl=1===s.jt;const t=s.jt;e&&(r.font=e[t]),r.bl=1===s.jt,r.Rl=s.$t,r.pl=s.qt,r.Al=s.qt,r.yl=1===s.jt,r.El=new v(5,null);for(let t=0;t<5;t++){const i=s.ei;r.El[t]=i,0===i.length&&(r.El[t]=null)}}r.rl!==Q.Vh&&r.type!==Q.Bh||(r.Pl=s.ei,r.action=s.ei,r.Ul=s.Zt),r.rl!==Q.Hh&&r.rl!==Q.Xh&&r.rl!==Q.jh&&r.rl!==Q.zh||(r.Wl=s.ei,0===r.Wl.length&&(r.rl===Q.Hh?r.Wl='Ok':r.rl===Q.Xh||r.rl===Q.jh?r.Wl='Select':r.rl===Q.zh&&(r.Wl='Continue')))}this.kh=null,this.Dh=null};static Cl=(t,i,e)=>{const s=$.Mh(i)<<8n|BigInt(e);if(this.kh){const t=this.kh.get(s);if(t)return t}let n;try{n=J.gi(t,i,e),this.kh?.put(s,n)}catch(t){return null}return n};static Ml=t=>{if(this.Dh){const i=this.Dh.get(BigInt(t));if(i)return i}const i=j.model(t);return this.Dh?.put(BigInt(t),i),i};id=-1;nl=-1;type=-1;rl=-1;hl=0;width=0;height=0;ol=-1;ll=null;al=null;scripts=null;scroll=0;hide=!1;draggable=!1;yl=!1;ml=!1;pl=0;Al=0;_l=null;gl=null;Il=null;El=null;fill=!1;Tl=!1;font=null;bl=!1;text=null;Ol=null;Rl=0;vl=0;Ll=0;Sl=null;xl=null;model=null;kl=null;Dl=-1;Nl=-1;zoom=0;Fl=0;Bl=0;Pl=null;action=null;Ul=-1;Wl=null;cl=null;fl=null;ul=null;x=0;y=0;Gl=0;dl=null;wl=null;Yl=0;Hl=0;Ml(t,i,e){let s=this.model;if(e&&(s=this.kl),!s)return null;if(-1===t&&-1===i&&!s.Ar)return s;const n=j.Mr(s,!0,!0,!1);return-1===t&&-1===i||n.jr(),-1!==t&&n.qr(t),-1!==i&&n.qr(i),n.ih(64,768,-50,-10,-50,!0),n}Vl(){if(this.nl===this.id)return this.x;let t=Q.zs[this.nl];if(!t.cl||!t.fl||!t.ul)return this.x;let i=t.cl.indexOf(this.id);if(-1===i)return this.x;let e=t.fl[i];for(;t.nl!==t.id;){const s=Q.zs[t.nl];s.cl&&s.fl&&s.ul&&(i=s.cl.indexOf(t.id),-1!==i&&(e+=s.fl[i])),t=s}return e}Kl(){if(this.nl===this.id)return this.y;let t=Q.zs[this.nl];if(!t.cl||!t.fl||!t.ul)return this.y;let i=t.cl.indexOf(this.id);if(-1===i)return this.y;let e=t.ul[i];for(;t.nl!==t.id;){const s=Q.zs[t.nl];s.cl&&s.fl&&s.ul&&(i=s.cl.indexOf(t.id),-1!==i&&(e+=s.ul[i])),t=s}return e}outline(t){const i=this.Vl(),e=this.Kl();m._t(i,e,this.width,this.height,t)}move(t,i){if(this.nl===this.id)return;this.x=0,this.y=0;const e=Q.zs[this.nl];if(e.cl&&e.fl&&e.ul){const s=e.cl.indexOf(this.id);-1!==s&&(e.fl[s]=t,e.ul[s]=i)}}delete(){if(this.nl===this.id)return;const t=Q.zs[this.nl];if(t.cl&&t.fl&&t.ul){const i=t.cl.indexOf(this.id);-1!==i&&(t.cl.splice(i,1),t.fl.splice(i,1),t.ul.splice(i,1))}}}var tt,it=(tt="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,s,n=void 0!==(t=t||{})?t:{};n.ready=new Promise((function(t,e){i=t,s=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(n.ready,t)||Object.defineProperty(n.ready,t,{get:()=>X('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>X('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var r=Object.assign({},n),h=[],o='object'==typeof window,l='function'==typeof importScripts,a='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,c=!o&&!a&&!l;if(n.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var f,u,d,w='';if(a){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var y,m;w=l?require('path').Xl(w)+'/':__dirname+'/';var p=()=>{m||(y=require('fs'),m=require('path'))};f=(t,i)=>(p(),t=m.normalize(t),y.jl(t,i?void 0:'utf8')),d=t=>{var i=f(t,!0);return i.buffer||(i=new Uint8Array(i)),k(i.buffer),i},u=(t,i,e)=>{p(),t=m.normalize(t),y.zl(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),h=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),n.inspect=function(){return'[Emscripten Module object]'}}else if(c){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(f=function(t){return read(t)}),d=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),k('object'==typeof i),i)},u=function(t,i,e){setTimeout((()=>i(d(t))),0)},'undefined'!=typeof scriptArgs?h=scriptArgs:void 0!==arguments&&(h=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!o&&!l)throw new Error('environment detection error');if(l?w=self.location.href:'undefined'!=typeof document&&document.currentScript&&(w=document.currentScript.src),tt&&(w=tt),w=0!==w.indexOf('blob:')?w.substr(0,w.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');f=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},l&&(d=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),u=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}n.print||console.log.bind(console);var A,_,g=n.printErr||console.warn.bind(console);function I(t,i){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){X('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function C(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(n,r),r=null,A='fetchSettings',Object.getOwnPropertyDescriptor(n,A)&&X('`Module.'+A+'` was supplied but `'+A+'` not included in INCOMING_MODULE_JS_API'),n.arguments&&(h=n.arguments),I('arguments','arguments_'),n.thisProgram&&n.thisProgram,I('thisProgram','thisProgram'),n.quit&&n.quit,I('quit','quit_'),k(void 0===n.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.read,'Module.read option was removed (modify read_ in JS)'),k(void 0===n.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),k(void 0===n.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),k(void 0===n.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),k(void 0===n.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),I('read','read_'),I('readAsync','readAsync'),I('readBinary','readBinary'),I('setWindowTitle','setWindowTitle'),k(!c,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),n.wasmBinary&&(_=n.wasmBinary),I('wasmBinary','wasmBinary');var E;n.noExitRuntime;I('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&X('no native wasm support detected');var T,b,O,R,v,L,S,x,M=!1;function k(t,i){t||X('Assertion failed'+(i?': '+i:''))}function D(t){T=t,n.HEAP8=b=new Int8Array(t),n.HEAP16=R=new Int16Array(t),n.HEAP32=v=new Int32Array(t),n.HEAPU8=O=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=L=new Uint32Array(t),n.HEAPF32=S=new Float32Array(t),n.HEAPF64=x=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var N=5242880;n.TOTAL_STACK&&k(N===n.TOTAL_STACK,'the stack size can no longer be determined at runtime');var F=n.INITIAL_MEMORY||16777216;function B(){if(!M){var t=ft(),i=L[t>>2],e=L[t+4>>2];34821223==i&&2310721022==e||X('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==L[0]&&X('Runtime error: The application has corrupted its heap memory area (address zero)!')}}I('INITIAL_MEMORY','INITIAL_MEMORY'),k(F>=N,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+F+'! (TOTAL_STACK='+N+')'),k('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),k(!n.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),k(16777216==F,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var P=[],U=[],W=[],G=!1;k(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var Y=0,H=null,V=null,K={};function X(t){n.onAbort&&n.onAbort(t),g(t='Aborted('+t+')'),M=!0;var i=new WebAssembly.RuntimeError(t);throw s(i),i}var j={error:function(){X('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){j.error()},Zl:function(){j.error()},ql:function(){j.error()},Jl:function(){j.error()},open:function(){j.error()},$l:function(){j.error()},Ql:function(){j.error()},ta:function(){j.error()},ia:function(){j.error()},ea:function(){j.error()}};n.FS_createDataFile=j.Zl,n.FS_createPreloadedFile=j.ql;var z,Z,q,J,$='data:application/octet-stream;base64,';function Q(t){return t.startsWith($)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=n.asm),k(G,'native function `'+e+'` called before runtime initialization'),s[t]||k(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==z&&_)return new Uint8Array(_);if(d)return d(t);throw"both async and sync fetching of the wasm failed"}catch(t){X(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(n)}function ht(t){ht.sa||(ht.sa={}),ht.sa[t]||(ht.sa[t]=1,a&&(t='warning: '+t),g(t))}function ot(t){try{return E.grow(t-T.byteLength+65535>>>16),D(E.buffer),1}catch(i){g('emscripten_realloc_buffer: Attempted to grow heap from '+T.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}n.locateFile?Q(z='tinymidipcm.wasm')||(Z=z,z=n.locateFile?n.locateFile(Z,w):w+Z):z=new URL(e(8227),e.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,e){O.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=O.length;k((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return g('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return g('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function e(t,i){var e,s=t.exports;n.asm=s,k(E=n.asm.memory,"memory not found in wasm exports"),D(E.buffer),k(n.asm.__indirect_function_table,"table not found in wasm exports"),e=n.asm.__wasm_call_ctors,U.unshift(e),function(t){if(Y--,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(k(K[t]),delete K[t]):g('warning: run dependency removed without ID'),0==Y&&(null!==H&&(clearInterval(H),H=null),V)){var i=V;V=null,i()}}('wasm-instantiate')}t='wasm-instantiate',Y++,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(k(!K[t]),K[t]=1,null===H&&'undefined'!=typeof setInterval&&(H=setInterval((function(){if(M)return clearInterval(H),void(H=null);var t=!1;for(var i in K)t||(t=!0,g('still waiting on run dependencies:')),g('dependency: '+i);t&&g('(end of list)')}),1e4))):g('warning: run dependency added without ID');var r=n;function h(t){k(n===r,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),r=null,e(t.instance)}function c(t){return function(){if(!_&&(o||l)){if('function'==typeof fetch&&!it(z))return fetch(z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+z+"'";return t.arrayBuffer()})).catch((function(){return st(z)}));if(u)return new Promise((function(t,i){u(z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){g('failed to asynchronously prepare wasm: '+t),it(z)&&g('warning: Loading from a file URI ('+z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),X(t)}))}if(n.instantiateWasm)try{return n.instantiateWasm(i,e)}catch(t){g('Module.instantiateWasm callback failed with error: '+t),s(t)}(_||'function'!=typeof WebAssembly.instantiateStreaming||Q(z)||it(z)||a||'function'!=typeof fetch?c(h):fetch(z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return g('wasm streaming compile failed: '+t),g('falling back to ArrayBuffer instantiation'),c(h)}))}))).catch(s)}(),n.___wasm_call_ctors=et("__wasm_call_ctors"),n._malloc=et("malloc"),n._free=et("free"),n._tsf_load_memory=et("tsf_load_memory"),n._tsf_close=et("tsf_close"),n._tsf_reset=et("tsf_reset"),n._tsf_set_output=et("tsf_set_output"),n._tsf_set_max_voices=et("tsf_set_max_voices"),n._realloc=et("realloc"),n._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),n._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),n._tml_load_memory=et("tml_load_memory"),n._midi_render=et("midi_render"),n.___errno_location=et("__errno_location"),n._fflush=et("fflush"),n._emscripten_stack_init=function(){return(ct=n._emscripten_stack_init=n.asm.emscripten_stack_init).apply(null,arguments)}),ft=(n._emscripten_stack_get_free=function(){return(n._emscripten_stack_get_free=n.asm.emscripten_stack_get_free).apply(null,arguments)},n._emscripten_stack_get_base=function(){return(n._emscripten_stack_get_base=n.asm.emscripten_stack_get_base).apply(null,arguments)},n._emscripten_stack_get_end=function(){return(ft=n._emscripten_stack_get_end=n.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),k(!(3&(t=ft()))),L[t>>2]=34821223,L[t+4>>2]=2310721022,L[0]=1668509029}function dt(t){function e(){lt||(lt=!0,n.calledRun=!0,M||(k(!G),G=!0,B(),rt(U),i(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),k(!n._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(B(),n.postRun)for('function'==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),W.unshift(t);var t;rt(W)}()))}t=t||h,Y>0||(ut(),function(){if(n.preRun)for('function'==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),P.unshift(t);var t;rt(P)}(),Y>0||(n.setStatus?(n.setStatus('Running...'),setTimeout((function(){setTimeout((function(){n.setStatus('')}),1),e()}),1)):e(),B()))}if(n.stackSave=et("stackSave"),n.stackRestore=et("stackRestore"),n.stackAlloc=et("stackAlloc"),n.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':b[0|t]=i;break;case'i16':R[t>>1]=i;break;case'i32':v[t>>2]=i;break;case'i64':J=[i>>>0,(q=i,+Math.abs(q)>=1?q>0?(0|Math.min(+Math.floor(q/4294967296),4294967295))>>>0:~~+Math.ceil((q-+(~~q>>>0))/4294967296)>>>0:0)],v[t>>2]=J[0],v[t+4>>2]=J[1];break;case'float':S[t>>2]=i;break;case'double':x[t>>3]=i;break;case'*':L[t>>2]=i;break;default:X('invalid type for setValue: '+e)}},n.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return b[0|t];case'i16':return R[t>>1];case'i32':case'i64':return v[t>>2];case'float':return S[t>>2];case'double':return x[t>>3];case'*':return L[t>>2];default:X('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),X(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),V=function t(){lt||dt(),lt||(V=t)},n.preInit)for('function'==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return dt(),t.ready});const et=it;const st=class{constructor(t={}){this.na=void 0,this.ra=0,this.ha=0,this.oa=0,this.la=t.la||100,this.sampleRate=t.sampleRate||44100,this.aa=t.aa||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.ca(1),this.fa=t.fa||(()=>{}),this.ua=t.ua||(()=>{}),this.da=void 0,this.test=0}async init(){if(!this.na){if('undefined'!=typeof process){const{Xl:t}=await import('path'),{wa:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.na=await et(),this.ya=this.na._malloc(this.bufferSize),this.ma=this.na._malloc(8)}}ca(t){this.bufferSize=4*this.sampleRate*this.aa*t}pa(){if(!this.na)throw new Error(`${this.constructor.name} not initalized. call .init()`)}Aa(t){this.pa();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.na;e(this.ra),this.ra=i(t.length),this.na.HEAPU8.set(t,this.ra),this.ha=s(this.ra,t.length),n(this.ha,2===this.aa?0:2,this.sampleRate,this.gain)}_a(){this.pa();const t=new Uint8Array(this.bufferSize);return t.set(this.na.HEAPU8.subarray(this.ya,this.ya+this.bufferSize)),t}ga(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.na;return e(this.oa),this.oa=i(t.length),this.na.HEAPU8.set(t,this.oa),s(this.oa,t.length)}Ia(t){const{_midi_render:i}=this.na;return i(this.ha,t,this.aa,this.sampleRate,this.ya,this.bufferSize,this.ma)}Ca(t){if(this.pa(),!this.ha)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.da);const{setValue:i,getValue:e}=this.na;i(this.ma,0,'double'),this.na._tsf_reset(this.ha),this.na._tsf_channel_set_bank_preset(this.ha,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.ga(t);const n=()=>{s=this.Ia(s);const t=this._a();this.fa(t),s?this.da=setTimeout(n,this.la):this.ua(e(this.ma,'double'))};this.da=setTimeout(n,16)}};!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{const t=2,i=44100;let e=new Float32Array,s=window.audioContext.createGain();s.gain.value=.1,s.connect(window.audioContext.destination);let n=window.audioContext.currentTime,r=[];const h=new st({la:30,fa:t=>{let i=new Float32Array(t.buffer),s=new Float32Array(e.length+i.length);s.set(e,0),s.set(i,e.length),e=s},ua:t=>{},bufferSize:102400});await h.init();const o=await fetch('./SCC1_Florestan.sf2'),l=new Uint8Array(await o.arrayBuffer());function a(){if(!window.audioContext||!e.length)return;let h=window.audioContext.createBufferSource();const o=e.length/t,l=window.audioContext.createBuffer(t,o,i);for(let i=0;i{t.stop(window.audioContext.currentTime)})),r=[],s.gain.value=t}}function u(t,i){-1!==t&&window._tinyMidiVolume(t),n=window.audioContext.currentTime,c=setInterval(a,250),h.Ca(i)}h.Aa(l),window._tinyMidiStop=async t=>{t?function(t,i){const e=window.audioContext.currentTime;s.gain.cancelScheduledValues(e),s.gain.setValueAtTime(s.gain.value,e),s.gain.linearRampToValueAtTime(t,e+2),setTimeout(i,2e3)}(0,(()=>{f()})):f()},window._tinyMidiVolume=(t=1)=>{s.gain.value=t},window._tinyMidiPlay=async(t,i,e)=>{t&&(await window._tinyMidiStop(e),e?setTimeout((()=>{u(i,t)}),2e3):u(i,t))}})();class nt{level;y;x;z;model;Ea;Ta;ba;Oa;Ra;va;La;info;Sa=0;Wi=0;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.Ea=r,this.Ta=h,this.ba=o,this.Oa=l,this.Ra=a,this.va=c,this.La=f,this.info=u}}class rt extends w{level;x;z;xa;Ma;ka;Da=null;Na=null;Fa=null;Ba=null;Pa=null;Ua=null;Wa=null;Ga=0;Ya=0;Ha=0;visible=!1;update=!1;Va=!1;Ka=0;Xa=0;ja=0;za=0;constructor(t,i,e){super(),this.xa=this.level=t,this.x=i,this.z=e,this.Ma=new v(5,null),this.ka=new Int32Array(5)}}class ht{Za;qa;Ja;$a;type;Cr;Er;Tr;br;Rr;vr;mode=0;Qa=0;tc=0;ic=0;ec=0;sc=0;nc=0;constructor(t,i,e,s,n,r,h,o,l,a,c){this.Za=t,this.qa=i,this.Ja=e,this.$a=s,this.type=n,this.Cr=r,this.Er=h,this.Tr=o,this.br=l,this.Rr=a,this.vr=c}}class ot{static OPEN=0;static rc=1;static hc=2;static oc=4;static lc=8;static ac=ot.rc<<4;static cc=ot.hc<<4;static fc=ot.oc<<4;static uc=ot.lc<<4;static dc=256;static wc=512;static yc=1024;static mc=2048;static Ac=4096;static _c=ot.wc<<4;static gc=ot.yc<<4;static Ic=ot.mc<<4;static Cc=ot.Ac<<4;static Ec=ot.dc<<9;static Tc=524288;static bc=2097152;static Oc=ot.bc|ot.Tc;static Rc=ot.dc|ot.Oc;static vc=ot.hc|ot.Rc;static Lc=ot.lc|ot.Rc;static Sc=ot.hc|ot.oc|ot.Lc;static xc=ot.cc|ot.Rc;static Mc=ot.lc|ot.ac|ot.xc;static kc=ot.uc|ot.Rc;static Dc=ot.rc|ot.hc|ot.kc;static Nc=ot.cc|ot.fc|ot.kc;static Fc=16777215}class lt{static Bc=0;static Pc=1;static Uc=2;static Wc=3}class at{static Gc=0;static Yc=1;static Hc=2;static Vc=3}class ct{static Kc=new ct(0,at.Gc);static Xc=new ct(1,at.Gc);static jc=new ct(2,at.Gc);static zc=new ct(3,at.Gc);static Zc=new ct(4,at.Yc);static qc=new ct(5,at.Yc);static Jc=new ct(6,at.Yc);static $c=new ct(7,at.Yc);static Qc=new ct(8,at.Yc);static tf=new ct(9,at.Hc);static if=new ct(10,at.Hc);static ef=new ct(11,at.Hc);static sf=new ct(12,at.Hc);static nf=new ct(13,at.Hc);static rf=new ct(14,at.Hc);static hf=new ct(15,at.Hc);static lf=new ct(16,at.Hc);static af=new ct(17,at.Hc);static cf=new ct(18,at.Hc);static ff=new ct(19,at.Hc);static uf=new ct(20,at.Hc);static df=new ct(21,at.Hc);static Vc=new ct(22,at.Vc);static values(){return[this.Kc,this.Xc,this.af,this.hf,this.jc,this.rf,this.tf,this.zc,this.Vc,this.sf,this.ef,this.Jc,this.uf,this.if,this.qc,this.nf,this.$c,this.Zc,this.lf,this.Qc,this.ff,this.df,this.cf]}static of(t){const i=this.values();for(let e=0;et*ut.yf+i;offsetX;mf;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.mf=0,this.sizeX=ut.yf,this.sizeZ=ut.yf,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[ut.index(t-this.offsetX,i-this.mf)]|=ot.bc};Af=(t,i)=>{this.flags[ut.index(t-this.offsetX,i-this.mf)]&=~ot.bc};_f=(t,i,e,s,n,r)=>{let h=ot.dc;r&&(h|=ot.Ec);const o=t-this.offsetX,l=i-this.mf;if(n===lt.Pc||n===lt.Wc){const t=e;e=s,s=t}for(let t=o;t=0&&t=0&&i{let h=ot.dc;r&&(h|=ot.Ec);const o=t-this.offsetX,l=i-this.mf;if(n===lt.Pc||n===lt.Wc){const t=e;e=s,s=t}for(let t=o;t=0&&t=0&&i{const r=t-this.offsetX,h=i-this.mf,o=n?ot.Cc:ot.uc,l=n?ot.Ac:ot.lc,a=n?ot.yc:ot.hc,c=n?ot.gc:ot.cc,f=n?ot.wc:ot.rc,u=n?ot._c:ot.ac,d=n?ot.mc:ot.oc,w=n?ot.Ic:ot.fc;e===ct.Kc.id?s===lt.Bc?(this.add(r,h,o),this.add(r-1,h,l)):s===lt.Pc?(this.add(r,h,a),this.add(r,h+1,c)):s===lt.Uc?(this.add(r,h,l),this.add(r+1,h,o)):s===lt.Wc&&(this.add(r,h,c),this.add(r,h-1,a)):e===ct.Xc.id||e===ct.zc.id?s===lt.Bc?(this.add(r,h,f),this.add(r-1,h+1,u)):s===lt.Pc?(this.add(r,h,d),this.add(r+1,h+1,w)):s===lt.Uc?(this.add(r,h,u),this.add(r+1,h-1,f)):s===lt.Wc&&(this.add(r,h,w),this.add(r-1,h-1,d)):e===ct.jc.id&&(s===lt.Bc?(this.add(r,h,a|o),this.add(r-1,h,l),this.add(r,h+1,c)):s===lt.Pc?(this.add(r,h,a|l),this.add(r,h+1,c),this.add(r+1,h,o)):s===lt.Uc?(this.add(r,h,c|l),this.add(r+1,h,o),this.add(r,h-1,a)):s===lt.Wc&&(this.add(r,h,c|o),this.add(r,h-1,a),this.add(r-1,h,l))),n&&this.If(t,i,e,s,!1)};Cf=(t,i,e,s,n)=>{const r=t-this.offsetX,h=i-this.mf,o=n?ot.Cc:ot.uc,l=n?ot.Ac:ot.lc,a=n?ot.yc:ot.hc,c=n?ot.gc:ot.cc,f=n?ot.wc:ot.rc,u=n?ot._c:ot.ac,d=n?ot.mc:ot.oc,w=n?ot.Ic:ot.fc;e===ct.Kc.id?s===lt.Bc?(this.remove(r,h,o),this.remove(r-1,h,l)):s===lt.Pc?(this.remove(r,h,a),this.remove(r,h+1,c)):s===lt.Uc?(this.remove(r,h,l),this.remove(r+1,h,o)):s===lt.Wc&&(this.remove(r,h,c),this.remove(r,h-1,a)):e===ct.Xc.id||e===ct.zc.id?s===lt.Bc?(this.remove(r,h,f),this.remove(r-1,h+1,u)):s===lt.Pc?(this.remove(r,h,d),this.remove(r+1,h+1,w)):s===lt.Uc?(this.remove(r,h,u),this.remove(r+1,h-1,f)):s===lt.Wc&&(this.remove(r,h,w),this.remove(r-1,h-1,d)):e===ct.jc.id&&(s===lt.Bc?(this.remove(r,h,a|o),this.remove(r-1,h,l),this.remove(r,h+1,c)):s===lt.Pc?(this.remove(r,h,a|l),this.remove(r,h+1,c),this.remove(r+1,h,o)):s===lt.Uc?(this.remove(r,h,c|l),this.remove(r+1,h,o),this.remove(r,h-1,a)):s===lt.Wc&&(this.remove(r,h,c|o),this.remove(r,h-1,a),this.remove(r-1,h,l))),n&&this.Cf(t,i,e,s,!1)};Ef=(t,i,e,s,n,r)=>{if(t===e&&i===s)return!0;const h=t-this.offsetX,o=i-this.mf,l=e-this.offsetX,a=s-this.mf,c=ut.index(h,o);if(n===ct.Kc.id){if(r===lt.Bc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.xc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.vc)===ot.OPEN)return!0}else if(r===lt.Pc){if(h===l&&o===a+1)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.Lc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.kc)===ot.OPEN)return!0}else if(r===lt.Uc){if(h===l+1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.xc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.vc)===ot.OPEN)return!0}else if(r===lt.Wc){if(h===l&&o===a-1)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.Lc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.kc)===ot.OPEN)return!0}}else if(n===ct.jc.id){if(r===lt.Bc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.kc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.vc)===ot.OPEN)return!0}else if(r===lt.Pc){if(h===l-1&&o===a&&(this.flags[c]&ot.Lc)===ot.OPEN)return!0;if(h===l&&o===a+1)return!0;if(h===l+1&&o===a)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.vc)===ot.OPEN)return!0}else if(r===lt.Uc){if(h===l-1&&o===a&&(this.flags[c]&ot.Lc)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.xc)===ot.OPEN)return!0;if(h===l+1&&o===a)return!0;if(h===l&&o===a-1)return!0}else if(r===lt.Wc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.xc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.kc)===ot.OPEN)return!0;if(h===l&&o===a-1)return!0}}else if(n===ct.tf.id){if(h===l&&o===a+1&&(this.flags[c]&ot.cc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.hc)===ot.OPEN)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.lc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.uc)===ot.OPEN)return!0}return!1};Tf=(t,i,e,s,n,r)=>{if(t===e&&i===s)return!0;const h=t-this.offsetX,o=i-this.mf,l=e-this.offsetX,a=s-this.mf,c=ut.index(h,o);if(n===ct.Jc.id||n===ct.$c.id){if(n===ct.$c.id&&(r=r+2&3),r===lt.Bc){if(h===l+1&&o===a&&(this.flags[c]&ot.uc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.hc)===ot.OPEN)return!0}else if(r===lt.Pc){if(h===l-1&&o===a&&(this.flags[c]&ot.lc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.hc)===ot.OPEN)return!0}else if(r===lt.Uc){if(h===l-1&&o===a&&(this.flags[c]&ot.lc)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.cc)===ot.OPEN)return!0}else if(r===lt.Wc){if(h===l+1&&o===a&&(this.flags[c]&ot.uc)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.cc)===ot.OPEN)return!0}}else if(n===ct.Qc.id){if(h===l&&o===a+1&&(this.flags[c]&ot.cc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.hc)===ot.OPEN)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.lc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.uc)===ot.OPEN)return!0}return!1};bf=(t,i,e,s,n,r,h)=>{const o=e+n-1,l=s+r-1,a=ut.index(t-this.offsetX,i-this.mf);return t>=e&&t<=o&&i>=s&&i<=l||(t===e-1&&i>=s&&i<=l&&(this.flags[a]&ot.lc)===ot.OPEN&&(h&ft.Bc)===ot.OPEN||(t===o+1&&i>=s&&i<=l&&(this.flags[a]&ot.uc)===ot.OPEN&&(h&ft.Uc)===ot.OPEN||(i===s-1&&t>=e&&t<=o&&(this.flags[a]&ot.hc)===ot.OPEN&&(h&ft.Wc)===ot.OPEN||i===l+1&&t>=e&&t<=o&&(this.flags[a]&ot.cc)===ot.OPEN&&(h&ft.Pc)===ot.OPEN)))};add=(t,i,e)=>{this.flags[ut.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[ut.index(t,i)]&=ot.Fc-e}}class dt{y;x;z;model;La;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.La=n,this.info=r}}class wt{y;x;z;Of;Rf;vf;Lf;La;info;constructor(t,i,e,s,n,r,h,o,l){this.y=t,this.x=i,this.z=e,this.Of=s,this.Rf=n,this.vf=r,this.Lf=h,this.La=o,this.info=l}}class yt{y;x;z;type;angle;model;La;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.La=h,this.info=o}}class mt{y;x;z;Sf;xf;Mf;La;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.Sf=s,this.xf=n,this.Mf=r,this.La=h,this.offset=o}}class pt{kf;Df;Nf;Ff;Bf;color;flat;constructor(t,i,e,s,n,r,h){this.kf=t,this.Df=i,this.Nf=e,this.Ff=s,this.Bf=n,this.color=r,this.flat=h}}class At{static Pf=new Int32Array(6);static Uf=new Int32Array(6);static Wf=new Int32Array(6);static Gf=new Int32Array(6);static Yf=new Int32Array(6);static Hf=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static Vf=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static Kf=128;static Xf=this.Kf/2|0;static jf=this.Kf/4|0;static zf=3*this.Kf/4|0;cr;er;ur;Zf;qf;Jf;$f;Qf;tu;iu;flat;shape;angle;eu;su;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,m,p,A){this.flat=!(m!==s||m!==d||m!==o),this.shape=i,this.angle=r,this.eu=u,this.su=l;const _=At.Hf[i],g=_.length;this.cr=new Int32Array(g),this.er=new Int32Array(g),this.ur=new Int32Array(g);const I=new Int32Array(g),C=new Int32Array(g),E=t*At.Kf,T=p*At.Kf;for(let t=0;t8&&g<=12&&(g=9+(g-r-9&3)),g>12&&g<=16&&(g=13+(g-r-13&3)),1===g?(i=E,l=T,c=m,u=h,p=a):2===g?(i=E+At.Xf,l=T,c=m+s>>1,u=h+A>>1,p=a+e>>1):3===g?(i=E+At.Kf,l=T,c=s,u=A,p=e):4===g?(i=E+At.Kf,l=T+At.Xf,c=s+d>>1,u=A+n>>1,p=e+w>>1):5===g?(i=E+At.Kf,l=T+At.Kf,c=d,u=n,p=w):6===g?(i=E+At.Xf,l=T+At.Kf,c=d+o>>1,u=n+y>>1,p=w+f>>1):7===g?(i=E,l=T+At.Kf,c=o,u=y,p=f):8===g?(i=E,l=T+At.Xf,c=o+m>>1,u=y+h>>1,p=f+a>>1):9===g?(i=E+At.Xf,l=T+At.jf,c=m+s>>1,u=h+A>>1,p=a+e>>1):10===g?(i=E+At.zf,l=T+At.Xf,c=s+d>>1,u=A+n>>1,p=e+w>>1):11===g?(i=E+At.Xf,l=T+At.zf,c=d+o>>1,u=n+y>>1,p=w+f>>1):12===g?(i=E+At.jf,l=T+At.Xf,c=o+m>>1,u=y+h>>1,p=f+a>>1):13===g?(i=E+At.jf,l=T+At.jf,c=m,u=h,p=a):14===g?(i=E+At.zf,l=T+At.jf,c=s,u=A,p=e):15===g?(i=E+At.zf,l=T+At.zf,c=d,u=n,p=w):(i=E+At.jf,l=T+At.zf,c=o,u=y,p=f),this.cr[t]=i,this.er[t]=c,this.ur[t]=l,I[t]=u,C[t]=p}const b=At.Vf[i],O=b.length/4|0;this.$f=new Int32Array(O),this.Qf=new Int32Array(O),this.tu=new Int32Array(O),this.Zf=new Int32Array(O),this.qf=new Int32Array(O),this.Jf=new Int32Array(O),this.iu=-1!==c?new Int32Array(O):null;let R=0;for(let t=0;t{this._u=0,this.gu=0,this.Iu=t,this.Cu=i,this.Eu=t/2|0,this.Tu=i/2|0;const r=new x(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.bu=N.sin[t],this.Ou=N.cos[t],this.Ru=N.sin[i],this.vu=N.cos[i];const h=(t-128)/32|0,o=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const l=128*t,a=128*i;let c=!1;for(let t=-e;t<=s;t+=128)if(this.hd(l,a,n[h]+t)){c=!0;break}r[h][o][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let h=-1;h<=1;h++)for(let o=-1;o<=1;o++){if(r[t][i][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t][(i+1)%31][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t+1][i][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t+1][(i+1)%31][e+h+25+1][s+o+25+1]){n=!0;break t}}this.du[t][i][e+25][s+25]=n}};static Xi=()=>{this.wu=null,this.yu=null,this.mu=null,this.Au=null,this.du=null,this.pu=null,this.Gu=null,console.log('World3D unloaded!')};static od=(t,i,e,s,n,r,h,o)=>{gt.mu[t][gt.yu[t]++]=new ht(e/128|0,r/128|0,n/128|0,o/128|0,i,e,r,n,o,s,h)};static hd=(t,i,e)=>{const s=i*this.Ru+t*this.vu>>16,n=i*this.vu-t*this.Ru>>16,r=e*this.bu+n*this.Ou>>16,h=e*this.Ou-n*this.bu>>16;if(r<50||r>3500)return!1;const o=this.Eu+((s<<9)/r|0),l=this.Tu+((h<<9)/r|0);return o>=this._u&&o<=this.Iu&&l>=this.gu&&l<=this.Cu};ld;qa;$a;ad;fd;ud;dd;wd;yd;md=0;pd=0;Ad=0;constructor(t,i,e,s){this.ld=e,this.qa=s,this.$a=i,this.fd=new S(e,s,i,null),this.dd=new D(e,s+1,i+1),this.ad=t,this.ud=new v(5e3,null),this.wd=new Int32Array(1e4),this.yd=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.pd=t;for(let i=0;i{const e=this.fd[0][t][i];for(let e=0;e<3;e++){this.fd[e][t][i]=this.fd[e+1][t][i];const s=this.fd[e][t][i];s&&s.level--}this.fd[0][t][i]||(this.fd[0][t][i]=new rt(0,t,i));const s=this.fd[0][t][i];s&&(s.Wa=e),this.fd[3][t][i]=null};Id=(t,i,e,s)=>{const n=this.fd[t][i][e];n&&(n.Ha=s)};Cd=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,m,p,A,_)=>{if(s===_t.nu){for(let s=t;s>=0;s--)this.fd[s][i][e]||(this.fd[s][i][e]=new rt(s,i,e));const s=this.fd[t][i][e];s&&(s.Da=new pt(c,f,u,d,-1,A,!1))}else if(s===_t.ru){for(let s=t;s>=0;s--)this.fd[s][i][e]||(this.fd[s][i][e]=new rt(s,i,e));const s=this.fd[t][i][e];s&&(s.Da=new pt(w,y,m,p,r,_,h===o&&h===l&&h===a))}else{for(let s=t;s>=0;s--)this.fd[s][i][e]||(this.fd[s][i][e]=new rt(s,i,e));const g=this.fd[t][i][e];g&&(g.Na=new At(i,s,y,o,u,n,c,a,_,w,r,p,A,l,m,d,h,e,f))}};Ed=(t,i,e,s,n,r,h)=>{this.fd[i][e][s]||(this.fd[i][e][s]=new rt(i,e,s));const o=this.fd[i][e][s];o&&(o.Pa=new dt(n,128*e+64,128*s+64,t,r,h))};Td=(t,i,e)=>{const s=this.fd[t][i][e];s&&(s.Pa=null)};bd=(t,i,e,s,n,r,h,o)=>{let l=0;const a=this.fd[s][t][i];if(a)for(let t=0;tl&&(l=e)}else this.fd[s][t][i]=new rt(s,t,i);const c=this.fd[s][t][i];c&&(c.Ua=new mt(e,128*t+64,128*i+64,r,h,o,n,l))};Od=(t,i,e)=>{const s=this.fd[t][i][e];s&&(s.Ua=null)};If=(t,i,e,s,n,r,h,o,l,a)=>{if(!h&&!o)return;for(let s=t;s>=0;s--)this.fd[s][i][e]||(this.fd[s][i][e]=new rt(s,i,e));const c=this.fd[t][i][e];c&&(c.Fa=new wt(s,128*i+64,128*e+64,n,r,h,o,l,a))};Cf=(t,i,e,s)=>{const n=this.fd[t][i][e];1===s&&n&&(n.Fa=null)};Rd=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!o)return;for(let s=t;s>=0;s--)this.fd[s][i][e]||(this.fd[s][i][e]=new rt(s,i,e));const f=this.fd[t][i][e];f&&(f.Ba=new yt(s,128*i+n+64,128*e+r+64,c,a,o,h,l))};vd=(t,i,e)=>{const s=this.fd[t][i][e];s&&(s.Ba=null)};Ld=(t,i,e,s)=>{const n=this.fd[t][i][e];if(!n)return;const r=n.Ba;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};Sd=(t,i,e,s)=>{if(!s)return;const n=this.fd[t][i][e];if(!n)return;const r=n.Ba;r&&(r.model=s)};xd=(t,i,e,s)=>{if(!s)return;const n=this.fd[t][i][e];if(!n)return;const r=n.Pa;r&&(r.model=s)};Md=(t,i,e,s)=>{if(!s)return;const n=this.fd[t][i][e];if(!n)return;const r=n.Fa;r&&(r.vf=s)};kd=(t,i,e,s,n)=>{if(!s)return;const r=this.fd[e][t][i];if(!r)return;const h=r.Fa;h&&(h.vf=s,h.Lf=n)};_f=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!n&&!r)return!0;const f=128*i+64*l,u=128*e+64*a;return this.Dd(f,u,s,t,i,e,l,a,n,r,h,o,c,!1)};Nd=(t,i,e,s,n,r,h,o,l,a)=>{if(!n&&!r)return!0;let c=i-l,f=s-l,u=i+l,d=s+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Dd(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};Fd=(t,i,e,s,n,r,h,o,l,a,c,f)=>!l&&!a||this.Dd(i,s,e,t,n,r,h+1-n,o-r+1,l,a,c,0,f,!0);gf=(t,i,e)=>{const s=this.fd[t][i][e];if(s)for(let t=0;t>29&3)&&n.ba===i&&n.Ra===e)return void this.Bd(n)}};Pd=(t,i,e,s)=>{if(!s)return;const n=this.fd[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};Ud=()=>{for(let t=0;t{const s=this.fd[t][i][e];return s&&s.Fa?s.Fa.La:0};Gd=(t,i,e)=>{const s=this.fd[t][e][i];return s&&s.Ba?s.Ba.La:0};Yd=(t,i,e)=>{const s=this.fd[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.ba===i&&n.Ra===e)return n.La}return 0};Hd=(t,i,e)=>{const s=this.fd[t][i][e];return s&&s.Pa?s.Pa.La:0};Vd=(t,i,e,s)=>{const n=this.fd[t][i][e];if(n){if(n.Fa&&n.Fa.La===s)return 255&n.Fa.info;if(n.Ba&&n.Ba.La===s)return 255&n.Ba.info;if(n.Pa&&n.Pa.La===s)return 255&n.Pa.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.fd[t][i+1][e-1];n&&n.Pa&&n.Pa.model&&n.Pa.model.lr&&this.jd(s,n.Pa.model,128,0,-128,!0)}};Xd=(t,i,e,s,n,r)=>{let h=!0,o=i;const l=i+s,a=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.ld){for(let u=o;u<=l;u++)if(!(u<0||u>=this.qa))for(let o=a;o<=c;o++){if(o<0||o>=this.$a||h&&u=e||u===i))continue;const a=this.fd[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.ad[f][u][o]+this.ad[f][u+1][o]+this.ad[f][u][o+1]+this.ad[f][u+1][o+1])/4|0)-((this.ad[t][i][e]+this.ad[t][i+1][e]+this.ad[t][i][e+1]+this.ad[t][i+1][e+1])/4|0),m=a.Fa;m&&m.vf&&m.vf.lr&&this.jd(r,m.vf,d,y,w,h),m&&m.Lf&&m.Lf.lr&&this.jd(r,m.Lf,d,y,w,h);for(let t=0;t{this.Ad++;let h=0;const o=i.cr,l=i.$s;if(t.lr&&t.ar)for(let r=0;ri.Rr)continue;const u=t.cr[r]-e;if(ui.Er)continue;const d=t.ur[r]-n;if(di.br)continue;if(i.lr&&i.ar)for(let t=0;t{const h=this.fd[t][i][e];if(!h)return;const o=h.Da;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const l=h.Na;if(!l)return;const a=l.shape,c=l.angle,f=l.eu,u=l.su,d=gt.Qu[a],w=gt.td[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{gt.Wu=!0,gt.Ve=t,gt.Ke=i,gt.nd=-1,gt.rd=-1};draw=(t,i,e,s,n,r,h)=>{t<0?t=0:t>=128*this.qa&&(t=128*this.qa-1),e<0?e=0:e>=128*this.$a&&(e=128*this.$a-1),gt.Wi++,gt.bu=N.sin[r],gt.Ou=N.cos[r],gt.Ru=N.sin[n],gt.vu=N.cos[n],gt.Gu=gt.du[(r-128)/32|0][n/64|0],gt.Lu=t,gt.Su=i,gt.xu=e,gt.Mu=t/128|0,gt.ku=e/128|0,gt.Pu=s,gt.Du=gt.Mu-25,gt.Du<0&&(gt.Du=0),gt.Fu=gt.ku-25,gt.Fu<0&&(gt.Fu=0),gt.Nu=gt.Mu+25,gt.Nu>this.qa&&(gt.Nu=this.qa),gt.Bu=gt.ku+25,gt.Bu>this.$a&&(gt.Bu=this.$a),this.qd(),gt.Uu=0;for(let t=this.pd;t=2e3)?(h.visible=!0,h.update=!0,h.Va=h.Ga>0,gt.Uu++):(h.visible=!1,h.update=!1,h.Ka=0))}}for(let t=this.pd;t=gt.Nu))for(let t=-25;t<=0;t++){const n=gt.ku+t,r=gt.ku-t;let o;if(e>=gt.Du&&(n>=gt.Fu&&(o=i[e][n],o&&o.visible&&this.Jd(o,!0,h)),r=gt.Fu&&(o=i[s][n],o&&o.visible&&this.Jd(o,!0,h)),r=gt.Nu))for(let t=-25;t<=0;t++){const n=gt.ku+t,r=gt.ku-t;let o;if(e>=gt.Du&&(n>=gt.Fu&&(o=i[e][n],o&&o.visible&&this.Jd(o,!1,h)),r=gt.Fu&&(o=i[s][n],o&&o.visible&&this.Jd(o,!1,h)),r{if(!l&&!a)return!1;for(let t=n;t=this.qa||i>=this.$a)return!1;const e=this.fd[s][t][i];if(e&&e.Ga>=5)return!1}const w=new nt(s,e,t,i,l,a,u,n,n+h-1,r,r+o-1,c,f);for(let t=n;tn&&(e|=1),tr&&(e+=8),i=0;e--)this.fd[e][t][i]||(this.fd[e][t][i]=new rt(e,t,i));const l=this.fd[s][t][i];l&&(l.Ma[l.Ga]=w,l.ka[l.Ga]=e,l.Ya|=e,l.Ga++)}return d&&(this.ud[this.md++]=w),!0};Bd=t=>{for(let i=t.ba;i<=t.Oa;i++)for(let e=t.Ra;e<=t.va;e++){const s=this.fd[t.level][i][e];if(s){for(let i=0;i{const t=gt.yu[gt.Pu],i=gt.mu[gt.Pu];gt.sd=0;for(let e=0;e=0&&s<=50){n=t.Ja+25-gt.ku,n<0&&(n=0),r=t.$a+25-gt.ku,r>50&&(r=50);let i=!1;for(;n<=r;)if(gt.Gu&>.Gu[s][n++]){i=!0;break}if(i){if(h=gt.Lu-t.Cr,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.ic=(t.Tr-gt.xu<<8)/h|0,t.ec=(t.br-gt.xu<<8)/h|0,t.sc=(t.Rr-gt.Su<<8)/h|0,t.nc=(t.vr-gt.Su<<8)/h|0,gt.pu[gt.sd++]=t}}}else if(2===t.type){if(s=t.Ja+25-gt.ku,s>=0&&s<=50){n=t.Za+25-gt.Mu,n<0&&(n=0),r=t.qa+25-gt.Mu,r>50&&(r=50);let i=!1;for(;n<=r;)if(gt.Gu&>.Gu[n++][s]){i=!0;break}if(i){if(h=gt.xu-t.Tr,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.Qa=(t.Cr-gt.Lu<<8)/h|0,t.tc=(t.Er-gt.Lu<<8)/h|0,t.sc=(t.Rr-gt.Su<<8)/h|0,t.nc=(t.vr-gt.Su<<8)/h|0,gt.pu[gt.sd++]=t}}}else if(4===t.type&&(s=t.Rr-gt.Su,s>128&&(n=t.Ja+25-gt.ku,n<0&&(n=0),r=t.$a+25-gt.ku,r>50&&(r=50),n<=r))){let i=t.Za+25-gt.Mu;i<0&&(i=0),h=t.qa+25-gt.Mu,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(gt.Gu&>.Gu[t][i]){e=!0;break t}e&&(t.mode=5,t.Qa=(t.Cr-gt.Lu<<8)/s|0,t.tc=(t.Er-gt.Lu<<8)/s|0,t.ic=(t.Tr-gt.xu<<8)/s|0,t.ec=(t.br-gt.xu<<8)/s|0,gt.pu[gt.sd++]=t)}}};Jd=(t,i,e)=>{for(gt.Au.St(t);;){let t;do{if(t=gt.Au.Mt(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.xa,o=this.fd[r];if(t.visible){if(i){if(r>0){const t=this.fd[r-1][s][n];if(t&&t.update)continue}if(s<=gt.Mu&&s>gt.Du){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.Ya)))continue}if(s>=gt.Mu&&sgt.Fu){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.Ya)))continue}if(n>=gt.ku&&nn&&(a+=6),c=gt.Yu[a],t.za=gt.Vu[a]),f&&(f.Of>.Hu[a]?16===f.Of?(t.Ka=3,t.Xa=gt.Ku[a],t.ja=3-t.Xa):32===f.Of?(t.Ka=6,t.Xa=gt.Xu[a],t.ja=6-t.Xa):64===f.Of?(t.Ka=12,t.Xa=gt.ju[a],t.ja=12-t.Xa):(t.Ka=9,t.Xa=gt.zu[a],t.ja=9-t.Xa):t.Ka=0,f.Of&c&&!this.iw(h,s,n,f.Of)&&f.vf?.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,f.x-gt.Lu,f.y-gt.Su,f.z-gt.xu,f.La),f.Rf&c&&!this.iw(h,s,n,f.Rf)&&f.Lf?.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,f.x-gt.Lu,f.y-gt.Su,f.z-gt.xu,f.La)),u&&!this.visible(h,s,n,u.model.vr))if(u.type&c)u.model.draw(u.angle,gt.bu,gt.Ou,gt.Ru,gt.vu,u.x-gt.Lu,u.y-gt.Su,u.z-gt.xu,u.La);else if(768&u.type){const t=u.x-gt.Lu,i=u.y-gt.Su,e=u.z-gt.xu,s=u.angle;let n,r;if(n=s===lt.Pc||s===lt.Uc?-t:t,r=s===lt.Uc||s===lt.Wc?-e:e,256&u.type&&rn){const n=t+gt.Ju[s],r=e+gt.$u[s];u.model.draw(512*s+1280&2047,gt.bu,gt.Ou,gt.Ru,gt.vu,n,i,r,u.La)}}if(l){const i=t.Pa;i&&i.model?.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,i.x-gt.Lu,i.y-gt.Su,i.z-gt.xu,i.La);const e=t.Ua;e&&0===e.offset&&(e.Mf&&e.Mf.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,e.x-gt.Lu,e.y-gt.Su,e.z-gt.xu,e.La),e.xf&&e.xf.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,e.x-gt.Lu,e.y-gt.Su,e.z-gt.xu,e.La),e.Sf&&e.Sf.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,e.x-gt.Lu,e.y-gt.Su,e.z-gt.xu,e.La))}const d=t.Ya;if(0!==d){if(sgt.Mu&&1&d){const t=o[s-1][n];t&&t.update&>.Au.St(t)}if(n>gt.ku&&8&d){const t=o[s][n-1];t&&t.update&>.Au.St(t)}}}if(0!==t.Ka){let i=!0;for(let e=0;ei.ba&&(r+=1),ei.Ra&&(r+=8),ss&&(s=n);const h=gt.ku-i.Ra,l=i.va-gt.ku;i.Sa=l>h?s+l:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.Sa,i=e))}if(-1===i)break;const l=gt.wu[i];if(l){l.Wi=gt.Wi;let t=l.model;t||(t=l.Ea?.draw(e)??null),t&&!this.ew(h,l.ba,l.Oa,l.Ra,l.va,t.vr)&&t.draw(l.Ta,gt.bu,gt.Ou,gt.Ru,gt.vu,l.x-gt.Lu,l.y-gt.Su,l.z-gt.xu,l.La);for(let t=l.ba;t<=l.Oa;t++)for(let i=l.Ra;i<=l.va;i++){const e=o[t][i];e&&(0!==e.Ka?gt.Au.St(e):t===s&&i===n||!e.update||gt.Au.St(e))}}}if(t.Va)continue}if(!t.update||0!==t.Ka)continue;if(s<=gt.Mu&&s>gt.Du){const t=o[s-1][n];if(t&&t.update)continue}if(s>=gt.Mu&&sgt.Fu){const t=o[s][n-1];if(t&&t.update)continue}if(n>=gt.ku&&n=r){const r=t+gt.Zu[n],h=s+gt.qu[n];i.model.draw(512*n+256,gt.bu,gt.Ou,gt.Ru,gt.vu,r,e,h,i.La)}if(512&i.type&&h<=r){const r=t+gt.Ju[n],h=s+gt.$u[n];i.model.draw(512*n+1280&2047,gt.bu,gt.Ou,gt.Ru,gt.vu,r,e,h,i.La)}}const e=t.Fa;e&&(e.Rf&t.za&&!this.iw(h,s,n,e.Rf)&&e.Lf?.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,e.x-gt.Lu,e.y-gt.Su,e.z-gt.xu,e.La),e.Of&t.za&&!this.iw(h,s,n,e.Of)&&e.vf?.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,e.x-gt.Lu,e.y-gt.Su,e.z-gt.xu,e.La))}if(rgt.Mu){const t=o[s-1][n];t&&t.update&>.Au.St(t)}if(n>gt.ku){const t=o[s][n-1];t&&t.update&>.Au.St(t)}}};Qd=(t,i,e,s,n,r,h,o)=>{let l,a,c,f,u=l=(e<<7)-gt.Lu,d=a=(s<<7)-gt.xu,w=c=u+128,y=f=d+128,p=this.ad[i][e][s]-gt.Su,A=this.ad[i][e+1][s]-gt.Su,_=this.ad[i][e+1][s+1]-gt.Su,g=this.ad[i][e][s+1]-gt.Su,I=d*h+u*o>>16;if(d=d*o-u*h>>16,u=I,I=p*r-d*n>>16,d=p*n+d*r>>16,p=I,d<50)return;if(I=a*h+w*o>>16,a=a*o-w*h>>16,w=I,I=A*r-a*n>>16,a=A*n+a*r>>16,A=I,a<50)return;if(I=y*h+c*o>>16,y=y*o-c*h>>16,c=I,I=_*r-y*n>>16,y=_*n+y*r>>16,_=I,y<50)return;if(I=f*h+l*o>>16,f=f*o-l*h>>16,l=I,I=g*r-f*n>>16,f=g*n+f*r>>16,g=I,f<50)return;const C=N.ki+((u<<9)/d|0),E=N.Di+((p<<9)/d|0),T=N.ki+((w<<9)/a|0),b=N.Di+((A<<9)/a|0),O=N.ki+((c<<9)/y|0),R=N.Di+((_<<9)/y|0),v=N.ki+((l<<9)/f|0),L=N.Di+((g<<9)/f|0);if(N.alpha=0,(O-v)*(b-L)-(R-L)*(T-v)>0)if(N.Fi=O<0||v<0||T<0||O>m.ut||v>m.ut||T>m.ut,gt.Wu&&this.sw(gt.Ve,gt.Ke,R,L,b,O,v,T)&&(gt.nd=e,gt.rd=s),-1===t.Bf)12345678!==t.Nf&&N.ee(O,v,T,R,L,b,t.Nf,t.Ff,t.Df);else if(gt.Ri){const i=gt.ed[t.Bf];N.ee(O,v,T,R,L,b,this.nw(i,t.Nf),this.nw(i,t.Ff),this.nw(i,t.Df))}else t.flat?N.he(O,v,T,R,L,b,t.Nf,t.Ff,t.Df,u,p,d,w,l,A,g,a,f,t.Bf):N.he(O,v,T,R,L,b,t.Nf,t.Ff,t.Df,c,_,y,l,w,g,A,f,a,t.Bf);if(!((C-T)*(L-b)-(E-b)*(v-T)<=0))if(N.Fi=C<0||T<0||v<0||C>m.ut||T>m.ut||v>m.ut,gt.Wu&&this.sw(gt.Ve,gt.Ke,E,b,L,C,T,v)&&(gt.nd=e,gt.rd=s),-1!==t.Bf){if(!gt.Ri)return void N.he(C,T,v,E,b,L,t.kf,t.Df,t.Ff,u,p,d,w,l,A,g,a,f,t.Bf);const i=gt.ed[t.Bf];N.ee(C,T,v,E,b,L,this.nw(i,t.kf),this.nw(i,t.Df),this.nw(i,t.Ff))}else 12345678!==t.kf&&N.ee(C,T,v,E,b,L,t.kf,t.Df,t.Ff)};tw=(t,i,e,s,n,r,h)=>{let o=e.cr.length;for(let t=0;t>16;if(l=l*h-i*r>>16,i=a,a=o*n-l*s>>16,l=o*s+l*n>>16,o=a,l<50)return;e.iu&&(At.Wf[t]=i,At.Gf[t]=o,At.Yf[t]=l),At.Pf[t]=N.ki+((i<<9)/l|0),At.Uf[t]=N.Di+((o<<9)/l|0)}N.alpha=0,o=e.$f.length;for(let s=0;s0)if(N.Fi=o<0||l<0||a<0||o>m.ut||l>m.ut||a>m.ut,gt.Wu&&this.sw(gt.Ve,gt.Ke,c,f,u,o,l,a)&&(gt.nd=t,gt.rd=i),e.iu&&-1!==e.iu[s])if(gt.Ri){const t=gt.ed[e.iu[s]];N.ee(o,l,a,c,f,u,this.nw(t,e.Zf[s]),this.nw(t,e.qf[s]),this.nw(t,e.Jf[s]))}else e.flat?N.he(o,l,a,c,f,u,e.Zf[s],e.qf[s],e.Jf[s],At.Wf[0],At.Gf[0],At.Yf[0],At.Wf[1],At.Wf[3],At.Gf[1],At.Gf[3],At.Yf[1],At.Yf[3],e.iu[s]):N.he(o,l,a,c,f,u,e.Zf[s],e.qf[s],e.Jf[s],At.Wf[n],At.Gf[n],At.Yf[n],At.Wf[r],At.Wf[h],At.Gf[r],At.Gf[h],At.Yf[r],At.Yf[h],e.iu[s]);else 12345678!==e.Zf[s]&&N.ee(o,l,a,c,f,u,e.Zf[s],e.qf[s],e.Jf[s])}};$d=(t,i,e)=>{const s=this.dd[t][i][e];if(s===-gt.Wi)return!1;if(s===gt.Wi)return!0;{const s=i<<7,n=e<<7;return this.rw(s+1,this.ad[t][i][e],n+1)&&this.rw(s+128-1,this.ad[t][i+1][e],n+1)&&this.rw(s+128-1,this.ad[t][i+1][e+1],n+128-1)&&this.rw(s+1,this.ad[t][i][e+1],n+128-1)?(this.dd[t][i][e]=gt.Wi,!0):(this.dd[t][i][e]=-gt.Wi,!1)}};iw=(t,i,e,s)=>{if(!this.$d(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.ad[t][i][e]-1,o=h-120,l=h-230,a=h-238;if(s<16){if(1===s){if(n>gt.Lu){if(!this.rw(n,h,r))return!1;if(!this.rw(n,h,r+128))return!1}if(t>0){if(!this.rw(n,o,r))return!1;if(!this.rw(n,o,r+128))return!1}return!!this.rw(n,l,r)&&this.rw(n,l,r+128)}if(2===s){if(r0){if(!this.rw(n,o,r+128))return!1;if(!this.rw(n+128,o,r+128))return!1}return!!this.rw(n,l,r+128)&&this.rw(n+128,l,r+128)}if(4===s){if(n0){if(!this.rw(n+128,o,r))return!1;if(!this.rw(n+128,o,r+128))return!1}return!!this.rw(n+128,l,r)&&this.rw(n+128,l,r+128)}if(8===s){if(r>gt.xu){if(!this.rw(n,h,r))return!1;if(!this.rw(n+128,h,r))return!1}if(t>0){if(!this.rw(n,o,r))return!1;if(!this.rw(n+128,o,r))return!1}return!!this.rw(n,l,r)&&this.rw(n+128,l,r)}}return!!this.rw(n+64,a,r+64)&&(16===s?this.rw(n,l,r+128):32===s?this.rw(n+128,l,r+128):64===s?this.rw(n+128,l,r):128===s?this.rw(n,l,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.$d(t,i,e)){const n=i<<7,r=e<<7;return this.rw(n+1,this.ad[t][i][e]-s,r+1)&&this.rw(n+128-1,this.ad[t][i+1][e]-s,r+1)&&this.rw(n+128-1,this.ad[t][i+1][e+1]-s,r+128-1)&&this.rw(n+1,this.ad[t][i][e+1]-s,r+128-1)}return!1};ew=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.dd[t][h][o]===-gt.Wi)return!1;o=1+(i<<7);const l=2+(s<<7),a=this.ad[t][i][s]-r;if(!this.rw(o,a,l))return!1;const c=(e<<7)-1;if(!this.rw(c,a,l))return!1;const f=(n<<7)-1;return!!this.rw(o,a,f)&&this.rw(c,a,f)}return!!this.$d(t,i,s)&&(h=i<<7,o=s<<7,this.rw(h+1,this.ad[t][i][s]-r,o+1)&&this.rw(h+128-1,this.ad[t][i+1][s]-r,o+1)&&this.rw(h+128-1,this.ad[t][i+1][s+1]-r,o+128-1)&&this.rw(h+1,this.ad[t][i][s+1]-r,o+128-1))};rw=(t,i,e)=>{for(let s=0;s0){const t=n.Tr+(n.ic*s>>8),r=n.br+(n.ec*s>>8),h=n.Rr+(n.sc*s>>8),o=n.vr+(n.nc*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.Cr;if(s>0){const t=n.Tr+(n.ic*s>>8),r=n.br+(n.ec*s>>8),h=n.Rr+(n.sc*s>>8),o=n.vr+(n.nc*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.Tr-e;if(s>0){const e=n.Cr+(n.Qa*s>>8),r=n.Er+(n.tc*s>>8),h=n.Rr+(n.sc*s>>8),o=n.vr+(n.nc*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.Tr;if(s>0){const e=n.Cr+(n.Qa*s>>8),r=n.Er+(n.tc*s>>8),h=n.Rr+(n.sc*s>>8),o=n.vr+(n.nc*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.Rr;if(s>0){const i=n.Cr+(n.Qa*s>>8),r=n.Er+(n.tc*s>>8),h=n.Tr+(n.ic*s>>8),o=n.br+(n.ec*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};sw=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const l=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*l>0&&l*((i-n)*(r-o)-(t-o)*(e-n))>0};nw=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}class It{id;hw=null;constructor(t){this.id=t}ow(t){for(;;){const i=t.jt;if(0===i)break;this.decode(i,t)}return this}}class Ct extends It{static count=0;static zs=[];static Zs=t=>{const i=new O(t.read('flo.dat'));this.count=i.Zt;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static aw=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static cw=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);fw=0;texture=-1;uw=!1;dw=!0;ww=0;yw=0;mw=0;pw=0;Aw=0;_w=0;decode(t,i){1===t?(this.fw=i.Jt,this.setColor(this.fw)):2===t?this.texture=i.jt:3===t?this.uw=!0:5===t?this.dw=!1:6===t?this.hw=i.ei:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(r=e),s>r&&(r=s);let h=0,o=0;const l=(n+r)/2;n!==r&&(l<.5&&(o=(r-n)/(r+n)),l>=.5&&(o=(r-n)/(2-r-n)),i===r?h=(e-s)/(r-n):e===r?h=(s-i)/(r-n)+2:s===r&&(h=(i-e)/(r-n)+4)),h/=6,this.ww=256*h|0,this.yw=256*o|0,this.mw=256*l|0,this.yw<0?this.yw=0:this.yw>255&&(this.yw=255),this.mw<0?this.mw=0:this.mw>255&&(this.mw=255),this.pw=l>.5?(1-l)*o*512|0:l*o*512|0,this.pw<1&&(this.pw=1),this.Aw=h*this.pw|0;let a=this.ww+(16*Math.random()|0)-8;a<0?a=0:a>255&&(a=255);let c=this.yw+(48*Math.random()|0)-24;c<0?c=0:c>255&&(c=255);let f=this.mw+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255),this._w=Ct.lw(a,c,f)}}class Et extends It{static count=0;static cache=null;static Xs=null;static gw=null;static Iw=0;static Cw=new q(500);static Ew=new q(30);static Zs=t=>{this.Xs=new O(t.read('loc.dat'));const i=new O(t.read('loc.idx'));this.count=i.Zt,this.gw=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.gw||!this.Xs)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Iw=(this.Iw+1)%10;const i=this.cache[this.Iw];return this.Xs.Vt=this.gw[t],i.id=t,i.reset(),i.ow(this.Xs),i.Tw||(i.Tw=new Int32Array(1)),-1===i.bw&&i.Tw&&(i.active=i.Tw.length>0&&i.Tw[0]===ct.if.id,i.Ow&&(i.active=!0)),i};static Xi=()=>{this.Cw=null,this.Ew=null,this.gw=null,this.cache=null,this.Xs=null};Rw=null;Tw=null;name=null;Lw=null;Sw=null;xw=null;width=1;length=1;Mw=!0;kw=!0;active=!1;bw=-1;Dw=!1;Nw=!1;dw=!1;Dl=-1;Fw=!1;Bw=16;Pw=0;Uw=0;Ow=null;Ww=-1;Gw=-1;Yw=!1;Hw=!0;Vw=128;Kw=128;Xw=128;jw=0;zw=0;Zw=0;qw=0;Jw=!1;decode(t,i){if(1===t){const t=i.jt;this.Rw=new Int32Array(t),this.Tw=new Int32Array(t);for(let e=0;e=30&&t<39)this.Ow||(this.Ow=new v(5,null)),this.Ow[t-30]=i.ei,'hidden'===this.Ow[t-30]?.toLowerCase()&&(this.Ow[t-30]=null);else if(40===t){const t=i.jt;this.Sw=new Uint16Array(t),this.xw=new Uint16Array(t);for(let e=0;e=this.Rw.length)return null;let c=this.Rw[o];if(-1===c)return null;const f=this.Yw!==i>3;f&&(c+=65536);let u=Et.Cw?.get(BigInt(c));u||(u=j.model(65535&c),f&&u.th(),Et.Cw?.put(BigInt(c),u));const d=128!==this.Vw||128!==this.Kw||128!==this.Xw,w=0!==this.zw||0!==this.Zw||0!==this.qw;let y=j.Mr(u,!this.Sw,!this.Fw,i===lt.Bc&&-1===h&&!d&&!w);for(-1!==h&&(y.jr(),y.qr(h),y.Br=null,y.Fr=null);i-- >0;)y.Jr();if(this.Sw&&this.xw)for(let t=0;t{const i=new O(t.read('seq.dat'));this.count=i.Zt;for(let t=0;t{let e=this.ip(t+45365,i+91923,4)+(this.ip(t+10294,i+37821,2)-128>>1)+(this.ip(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static ip=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.ep(s,r),l=this.ep(s+1,r),a=this.ep(s,r+1),c=this.ep(s+1,r+1),f=this.sp(o,l,n,e),u=this.sp(a,c,n,e);return this.sp(f,u,h,e)};static sp=(t,i,e,s)=>{const n=65536-N.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static ep=(t,i)=>((this.np(t-1,i-1)+this.np(t+1,i-1)+this.np(t-1,i+1)+this.np(t+1,i+1))/16|0)+((this.np(t-1,i)+this.np(t+1,i)+this.np(t,i-1)+this.np(t,i+1))/8|0)+(this.np(t,i)/4|0);static np=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static _f=(t,i,e,s,n,r,h,o,l,a,c)=>{const f=n[c][i][e],u=n[c][i+1][e],d=n[c][i+1][e+1],w=n[c][i][e+1],y=f+u+d+w>>2,m=Et.get(o);let p=i+(e<<7)+(o<<14)+1073741824|0;m.active||(p+=-2147483648),p|=0;const A=(a<<6)+l<<24>>24;if(l===ct.Vc.id)s?.Ed(m.Ml(ct.Vc.id,a,f,u,d,w,-1),t,i,e,y,p,A),m.Mw&&m.active&&h?.pf(i,e),-1!==m.Dl&&r.St(new Tt(o,t,3,i,e,bt.zs[m.Dl],!0));else if(l===ct.if.id||l===ct.ef.id){const n=m.Ml(ct.if.id,a,f,u,d,w,-1);if(n){let r,h,o=0;l===ct.ef.id&&(o+=256),a===lt.Pc||a===lt.Wc?(r=m.length,h=m.width):(r=m.width,h=m.length),s?._f(t,i,e,y,n,null,p,A,r,h,o)}m.Mw&&h?._f(i,e,m.width,m.length,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,2,i,e,bt.zs[m.Dl],!0))}else if(l>=ct.sf.id)s?._f(t,i,e,y,m.Ml(l,a,f,u,d,w,-1),null,p,A,1,1,0),m.Mw&&h?._f(i,e,m.width,m.length,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,2,i,e,bt.zs[m.Dl],!0));else if(l===ct.Kc.id)s?.If(t,i,e,y,Rt.Xm[a],0,m.Ml(ct.Kc.id,a,f,u,d,w,-1),null,p,A),m.Mw&&h?.If(i,e,l,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,0,i,e,bt.zs[m.Dl],!0));else if(l===ct.Xc.id)s?.If(t,i,e,y,Rt.jm[a],0,m.Ml(ct.Xc.id,a,f,u,d,w,-1),null,p,A),m.Mw&&h?.If(i,e,l,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,0,i,e,bt.zs[m.Dl],!0));else if(l===ct.jc.id){const n=a+1&3;s?.If(t,i,e,y,Rt.Xm[a],Rt.Xm[n],m.Ml(ct.jc.id,a+4,f,u,d,w,-1),m.Ml(ct.jc.id,n,f,u,d,w,-1),p,A),m.Mw&&h?.If(i,e,l,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,0,i,e,bt.zs[m.Dl],!0))}else if(l===ct.zc.id)s?.If(t,i,e,y,Rt.jm[a],0,m.Ml(ct.zc.id,a,f,u,d,w,-1),null,p,A),m.Mw&&h?.If(i,e,l,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,0,i,e,bt.zs[m.Dl],!0));else if(l===ct.tf.id)s?._f(t,i,e,y,m.Ml(l,a,f,u,d,w,-1),null,p,A,1,1,0),m.Mw&&h?._f(i,e,m.width,m.length,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,2,i,e,bt.zs[m.Dl],!0));else if(l===ct.Zc.id)s?.Rd(t,i,e,y,0,0,p,m.Ml(ct.Zc.id,lt.Bc,f,u,d,w,-1),A,512*a,Rt.Xm[a]),-1!==m.Dl&&r.St(new Tt(o,t,1,i,e,bt.zs[m.Dl],!0));else if(l===ct.qc.id){let n=16;if(s){const r=s.Wd(t,i,e);r>0&&(n=Et.get(r>>14&32767).Bw)}s?.Rd(t,i,e,y,Rt.zm[a]*n,Rt.Zm[a]*n,p,m.Ml(ct.Zc.id,lt.Bc,f,u,d,w,-1),A,512*a,Rt.Xm[a]),-1!==m.Dl&&r.St(new Tt(o,t,1,i,e,bt.zs[m.Dl],!0))}else l===ct.Jc.id?(s?.Rd(t,i,e,y,0,0,p,m.Ml(ct.Zc.id,lt.Bc,f,u,d,w,-1),A,a,256),-1!==m.Dl&&r.St(new Tt(o,t,1,i,e,bt.zs[m.Dl],!0))):l===ct.$c.id?(s?.Rd(t,i,e,y,0,0,p,m.Ml(ct.Zc.id,lt.Bc,f,u,d,w,-1),A,a,512),-1!==m.Dl&&r.St(new Tt(o,t,1,i,e,bt.zs[m.Dl],!0))):l===ct.Qc.id&&(s?.Rd(t,i,e,y,0,0,p,m.Ml(ct.Zc.id,lt.Bc,f,u,d,w,-1),A,a,768),-1!==m.Dl&&r.St(new Tt(o,t,1,i,e,bt.zs[m.Dl],!0)))};qa;$a;rp;hp;op;lp;ap;cp;fp;up;dp;wp;yp;mp;pp;Ap;constructor(t,i,e,s){this.qa=t,this.$a=i,this.rp=e,this.hp=s,this.op=new M(ut.wf,t,i),this.lp=new M(ut.wf,t,i),this.ap=new M(ut.wf,t,i),this.cp=new M(ut.wf,t,i),this.Ap=new D(ut.wf,t+1,i+1),this.fp=new M(ut.wf,t+1,i+1),this.up=new k(t+1,i+1),this.dp=new Int32Array(i),this.wp=new Int32Array(i),this.yp=new Int32Array(i),this.mp=new Int32Array(i),this.pp=new Int32Array(i)}_p=(t,i)=>{for(let t=0;t=0&&i[n]?.pf(e,s)}Rt.qm+=(5*Math.random()|0)-2,Rt.qm<-8?Rt.qm=-8:Rt.qm>8&&(Rt.qm=8),Rt.Jm+=(5*Math.random()|0)-2,Rt.Jm<-16?Rt.Jm=-16:Rt.Jm>16&&(Rt.Jm=16);for(let i=0;i>8;for(let t=1;t>2)+(e[l+1][t]>>3)+(e[l][t-1]>>2)+(e[l][t+1]>>3)+(e[l][t]>>1);this.up[l][t]=u-d}for(let t=0;t=0&&s0){const i=Ct.zs[e-1];this.dp[t]+=i.Aw,this.wp[t]+=i.yw,this.yp[t]+=i.mw,this.mp[t]+=i.pw,n=this.pp[t]++}}const r=e-5;if(r>=0&&r0){const i=Ct.zs[e-1];this.dp[t]-=i.Aw,this.wp[t]-=i.yw,this.yp[t]-=i.mw,this.mp[t]-=i.pw,n=this.pp[t]--}}}if(e>=1&&e=0&&a=0&&c=1&&l0||c>0){const f=this.rp[i][e][l],u=this.rp[i][e+1][l],d=this.rp[i][e+1][l+1],w=this.rp[i][e][l+1],y=this.up[e][l],m=this.up[e+1][l],p=this.up[e+1][l+1],A=this.up[e][l+1];let _=-1,g=-1;if(a>0){const t=256*s/h|0,i=n/o|0;let e=r/o|0;_=Ct.lw(t,i,e);const l=t+Rt.qm&255;e+=Rt.Jm,e<0?e=0:e>255&&(e=255),g=Ct.lw(l,i,e)}if(i>0){let t=0!==a||this.ap[i][e][l]===_t.nu;c>0&&!Ct.zs[c-1].dw&&(t=!1),t&&f===u&&f===d&&f===w&&(this.Ap[i][e][l]|=2340)}let I=0;if(-1!==_&&(I=N.palette[Ct.aw(g,96)]),0===c)t?.Cd(i,e,l,_t.nu,lt.Bc,-1,f,u,d,w,Ct.aw(_,y),Ct.aw(_,m),Ct.aw(_,p),Ct.aw(_,A),Ot.gy,Ot.gy,Ot.gy,Ot.gy,I,Ot.gy);else{const s=this.ap[i][e][l]+1,n=this.cp[i][e][l],r=Ct.zs[c-1];let h,o,a=r.texture;a>=0?(o=N.Ji(a),h=-1):r.fw===Ot.Ay?(o=0,h=-2,a=-1):(h=Ct.lw(r.ww,r.yw,r.mw),o=N.palette[Ct.cw(r._w,96)]),t?.Cd(i,e,l,s,n,a,f,u,d,w,Ct.aw(_,y),Ct.aw(_,m),Ct.aw(_,p),Ct.aw(_,A),Ct.cw(h,y),Ct.cw(h,m),Ct.cw(h,p),Ct.cw(h,A),I,o)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let n=0;n<=s;n++)for(let r=0;r<=this.$a;r++)for(let h=0;h<=this.qa;h++){if(this.Ap[n][h][r]&t){let i=r,e=r,o=n,l=n;for(;i>0&&this.Ap[n][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.Ap[o-1][h][s]&t))break t;o--}t:for(;l=8){const n=this.rp[l][h][i]-240,r=this.rp[o][h][i];gt.od(s,1,128*h,n,128*i,128*h,r,128*e+128);for(let s=o;s<=l;s++)for(let n=i;n<=e;n++)this.Ap[s][h][n]&=~t}}if(this.Ap[n][h][r]&i){let t=h,e=h,o=n,l=n;for(;t>0&&this.Ap[n][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.Ap[o-1][s][r]&i))break t;o--}t:for(;l=8){const n=this.rp[l][t][r]-240,h=this.rp[o][t][r];gt.od(s,2,128*t,n,128*r,128*e+128,h,128*r);for(let s=o;s<=l;s++)for(let n=t;n<=e;n++)this.Ap[s][n][r]&=~i}}if(this.Ap[n][h][r]&e){let t=h,i=h,o=r,l=r;for(;o>0&&this.Ap[n][h][o-1]&e;)o--;for(;l0;){for(let i=o;i<=l;i++)if(!(this.Ap[n][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.rp[n][t][o];gt.od(s,4,128*t,r,128*o,128*i+128,r,128*l+128);for(let s=t;s<=i;s++)for(let t=o;t<=l;t++)this.Ap[n][s][t]&=~e}}}}}};Ip=(t,i,e,s)=>{let n=0;for(let t=0;t>24;break}for(let r=t;r=0&&t=0&&r{const r=new O(new Uint8Array(n));for(let n=0;n=0&&l=0&&a>24,this.cp[n][l][a]=(c-2&3)<<24>>24):c<=81?this.hp[n][l][a]=c-49<<24>>24:this.op[n][l][a]=c-81<<24>>24}else for(;c=r.jt,0!==c;){if(1===c){r.jt;break}c<=49&&r.jt}}};Ep=(t,i,e,s,n,r)=>{const h=new O(new Uint8Array(s));let o=-1;for(;;){const s=h.ii;if(0===s)return;o+=s;let l=0;for(;;){const s=h.ii;if(0===s)break;l+=s-1;const a=63&l,c=l>>6&63,f=l>>12,u=h.jt,d=u>>2,w=3&u,y=c+n,m=a+r;if(y>0&&m>0&&y=0&&(n=e[s]),this._f(f,y,m,t,i,n,o,d,w)}}}};_f=(t,i,e,s,n,r,h,o,l)=>{if(Rt.Ri){if(16&this.hp[t][i][e])return;if(this.gp(t,i,e)!==Rt.$m)return}const a=this.rp[t][i][e],c=this.rp[t][i+1][e],f=this.rp[t][i+1][e+1],u=this.rp[t][i][e+1],d=a+c+f+u>>2,w=Et.get(h);let y=i+(e<<7)+(h<<14)+1073741824|0;w.active||(y+=-2147483648),y|=0;const m=(l<<6)+o<<24>>24;if(o===ct.Vc.id)(!Rt.Ri||w.active||w.Jw)&&(s?.Ed(w.Ml(ct.Vc.id,l,a,c,f,u,-1),t,i,e,d,y,m),w.Mw&&w.active&&r?.pf(i,e),-1!==w.Dl&&n.St(new Tt(h,t,3,i,e,bt.zs[w.Dl],!0)));else if(o===ct.if.id||o===ct.ef.id){const p=w.Ml(ct.if.id,l,a,c,f,u,-1);if(p){let n,r,h=0;if(o===ct.ef.id&&(h+=256),l===lt.Pc||l===lt.Wc?(n=w.length,r=w.width):(n=w.width,r=w.length),s?._f(t,i,e,d,p,null,y,m,n,r,h)&&w.Hw)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=p.Or/4|0;r>30&&(r=30),r>this.fp[t][i+s][e+n]&&(this.fp[t][i+s][e+n]=r<<24>>24)}}w.Mw&&r?._f(i,e,w.width,w.length,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,2,i,e,bt.zs[w.Dl],!0))}else if(o>=ct.sf.id)s?._f(t,i,e,d,w.Ml(o,l,a,c,f,u,-1),null,y,m,1,1,0),o>=ct.sf.id&&o<=ct.af.id&&o!==ct.nf.id&&t>0&&(this.Ap[t][i][e]|=2340),w.Mw&&r?._f(i,e,w.width,w.length,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,2,i,e,bt.zs[w.Dl],!0));else if(o===ct.Kc.id)s?.If(t,i,e,d,Rt.Xm[l],0,w.Ml(ct.Kc.id,l,a,c,f,u,-1),null,y,m),l===lt.Bc?(w.Hw&&(this.fp[t][i][e]=50,this.fp[t][i][e+1]=50),w.dw&&(this.Ap[t][i][e]|=585)):l===lt.Pc?(w.Hw&&(this.fp[t][i][e+1]=50,this.fp[t][i+1][e+1]=50),w.dw&&(this.Ap[t][i][e+1]|=1170)):l===lt.Uc?(w.Hw&&(this.fp[t][i+1][e]=50,this.fp[t][i+1][e+1]=50),w.dw&&(this.Ap[t][i+1][e]|=585)):l===lt.Wc&&(w.Hw&&(this.fp[t][i][e]=50,this.fp[t][i+1][e]=50),w.dw&&(this.Ap[t][i][e]|=1170)),w.Mw&&r?.If(i,e,o,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,0,i,e,bt.zs[w.Dl],!0)),16!==w.Bw&&s?.Ld(t,i,e,w.Bw);else if(o===ct.Xc.id)s?.If(t,i,e,d,Rt.jm[l],0,w.Ml(ct.Xc.id,l,a,c,f,u,-1),null,y,m),w.Hw&&(l===lt.Bc?this.fp[t][i][e+1]=50:l===lt.Pc?this.fp[t][i+1][e+1]=50:l===lt.Uc?this.fp[t][i+1][e]=50:l===lt.Wc&&(this.fp[t][i][e]=50)),w.Mw&&r?.If(i,e,o,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,0,i,e,bt.zs[w.Dl],!0));else if(o===ct.jc.id){const p=l+1&3;s?.If(t,i,e,d,Rt.Xm[l],Rt.Xm[p],w.Ml(ct.jc.id,l+4,a,c,f,u,-1),w.Ml(ct.jc.id,p,a,c,f,u,-1),y,m),w.dw&&(l===lt.Bc?(this.Ap[t][i][e]|=265,this.Ap[t][i][e+1]|=1170):l===lt.Pc?(this.Ap[t][i][e+1]|=1170,this.Ap[t][i+1][e]|=585):l===lt.Uc?(this.Ap[t][i+1][e]|=585,this.Ap[t][i][e]|=1170):l===lt.Wc&&(this.Ap[t][i][e]|=1170,this.Ap[t][i][e]|=585)),w.Mw&&r?.If(i,e,o,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,0,i,e,bt.zs[w.Dl],!0)),16!==w.Bw&&s?.Ld(t,i,e,w.Bw)}else if(o===ct.zc.id)s?.If(t,i,e,d,Rt.jm[l],0,w.Ml(ct.zc.id,l,a,c,f,u,-1),null,y,m),w.Hw&&(l===lt.Bc?this.fp[t][i][e+1]=50:l===lt.Pc?this.fp[t][i+1][e+1]=50:l===lt.Uc?this.fp[t][i+1][e]=50:l===lt.Wc&&(this.fp[t][i][e]=50)),w.Mw&&r?.If(i,e,o,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,0,i,e,bt.zs[w.Dl],!0));else if(o===ct.tf.id)s?._f(t,i,e,d,w.Ml(o,l,a,c,f,u,-1),null,y,m,1,1,0),w.Mw&&r?._f(i,e,w.width,w.length,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,2,i,e,bt.zs[w.Dl],!0));else if(o===ct.Zc.id)s?.Rd(t,i,e,d,0,0,y,w.Ml(ct.Zc.id,lt.Bc,a,c,f,u,-1),m,512*l,Rt.Xm[l]),-1!==w.Dl&&n.St(new Tt(h,t,1,i,e,bt.zs[w.Dl],!0));else if(o===ct.qc.id){let r=16;if(s){const n=s.Wd(t,i,e);n>0&&(r=Et.get(n>>14&32767).Bw)}s?.Rd(t,i,e,d,Rt.zm[l]*r,Rt.Zm[l]*r,y,w.Ml(ct.Zc.id,lt.Bc,a,c,f,u,-1),m,512*l,Rt.Xm[l]),-1!==w.Dl&&n.St(new Tt(h,t,1,i,e,bt.zs[w.Dl],!0))}else o===ct.Jc.id?(s?.Rd(t,i,e,d,0,0,y,w.Ml(ct.Zc.id,lt.Bc,a,c,f,u,-1),m,l,256),-1!==w.Dl&&n.St(new Tt(h,t,1,i,e,bt.zs[w.Dl],!0))):o===ct.$c.id?(s?.Rd(t,i,e,d,0,0,y,w.Ml(ct.Zc.id,lt.Bc,a,c,f,u,-1),m,l,512),-1!==w.Dl&&n.St(new Tt(h,t,1,i,e,bt.zs[w.Dl],!0))):o===ct.Qc.id&&(s?.Rd(t,i,e,d,0,0,y,w.Ml(ct.Zc.id,lt.Bc,a,c,f,u,-1),m,l,768),-1!==w.Dl&&n.St(new Tt(h,t,1,i,e,bt.zs[w.Dl],!0)))};gp=(t,i,e)=>8&this.hp[t][i][e]?0:t<=0||!(2&this.hp[1][i][e])?t:t-1}class vt extends w{}class Lt extends vt{x=0;z=0;Ta=0;Tp=!1;size=1;bp=-1;Op=-1;Rp=-1;vp=-1;Lp=-1;Sp=-1;xp=-1;Mp=null;kp=100;Dp=0;Np=0;Fp=0;Bp=0;Pp=-1e3;Up=0;Wp=0;Gp=-1;Yp=0;Hp=0;Vp=-1;Kp=0;Xp=0;jp=-1;zp=0;Zp=0;qp=0;Jp=0;$p=-1;Qp=0;tA=0;iA=0;eA=0;sA=0;nA=0;rA=0;hA=0;oA=0;lA=0;aA=0;Wi=0;height=0;cA=0;pathLength=0;fA=new Int32Array(10);uA=new Int32Array(10);dA=new v(10,!1);wA=0;yA=-1;mA=-1;pA=-1;AA=-1;move(t,i,e){if(-1!==this.jp&&bt.zs[this.jp].priority<=1&&(this.jp=-1),!t){const t=i-this.fA[0],s=e-this.uA[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.fA[t]=this.fA[t-1],this.uA[t]=this.uA[t-1],this.dA[t]=this.dA[t-1];return this.fA[0]=i,this.uA[0]=e,void(this.dA[0]=!1)}}this.pathLength=0,this.wA=0,this.fA[0]=i,this.uA[0]=e,this.x=128*this.fA[0]+64*this.size,this.z=128*this.uA[0]+64*this.size}step(t,i){let e=this.fA[0],s=this.uA[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.jp&&bt.zs[this.jp].priority<=1&&(this.jp=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.fA[t]=this.fA[t-1],this.uA[t]=this.uA[t-1],this.dA[t]=this.dA[t-1];this.fA[0]=e,this.uA[0]=s,this.dA[0]=t}}class St extends It{static count=0;static zs=[];static Dh=new q(30);static Zs=t=>{const i=new O(t.read('spotanim.dat'));this.count=i.Zt;for(let t=0;t=40&&t<50?this.Sw[t-40]=i.Zt:t>=50&&t<60?this.xw[t-50]=i.Zt:console.log('Error unrecognised spotanim config code: ',t)}Ml(){let t=St.Dh?.get(BigInt(this.id));if(t)return t;t=j.model(this.model);for(let i=0;i<6;i++)0!==this.Sw[0]&&t.Qr(this.Sw[i],this.xw[i]);return St.Dh?.put(BigInt(this.id),t),t}}class xt extends It{static count=0;static zs=[];static Zs=t=>{const i=new O(t.read('idk.dat'));this.count=i.Zt;for(let t=0;t=40&&t<50?this.Sw[t-40]=i.Zt:t>=50&&t<60?this.xw[t-50]=i.Zt:t>=60&&t<70?this.IA[t-60]=i.Zt:console.log('Error unrecognised config code: ',t)}Ml(){if(!this.Rw)return null;const t=new v(this.Rw.length,null);for(let i=0;i{this.EA=i,this.Xs=new O(t.read('obj.dat'));const e=new O(t.read('obj.idx'));this.count=e.Zt,this.gw=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.gw||!this.Xs)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Iw=(this.Iw+1)%10;const i=this.cache[this.Iw];return this.Xs.Vt=this.gw[t],i.id=t,i.reset(),i.ow(this.Xs),-1!==i.bA&&i.OA(),!this.EA&&i.members&&(i.name='Members Object',i.Lw="Login to a members' server to use this object.",i.Ow=null,i.RA=null),i};static Xi=()=>{this.Dh=null,this.TA=null,this.gw=null,this.cache=null,this.Xs=null};static vA=(t,i)=>{if(Mt.TA){let e=Mt.TA.get(BigInt(t));if(e&&e._i!==i&&-1!==e._i&&(e.nt(),e=null),e)return e}let e=Mt.get(t);if(e.LA||(i=-1),e.LA&&e.SA&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.SA[s]&&0!==e.SA[s]&&(t=e.LA[s]);-1!==t&&(e=Mt.get(t))}const s=new J(32,32),n=N.ki,r=N.Di,h=N.Mi,o=m.lt,l=m.ct,a=m.ft,c=m.left,f=m.right,u=m.top,d=m.bottom;N.Ni=!1,m.bind(s.lt,32,32),m.fillRect(0,0,32,32,Ot.gy),N.ji();const w=e.xA(1),y=N.sin[e.MA]*e.kA>>16,p=N.cos[e.MA]*e.kA>>16;w.nh(0,e.DA,e.NA,e.MA,e.FA,y+(w.vr/2|0)+e.BA,p+e.BA);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.lt[t+32*i]&&(t>0&&s.lt[t+32*i-1]>1||i>0&&s.lt[t+32*(i-1)]>1||t<31&&s.lt[t+32*i+1]>1||i<31&&s.lt[t+32*(i+1)]>1)&&(s.lt[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.lt[t+32*i]&&t>0&&i>0&&s.lt[t+32*(i-1)-1]>0&&(s.lt[t+32*i]=3153952);if(-1!==e.bA){const t=this.vA(e.PA,10),i=t.Ai,s=t._i;t.Ai=32,t._i=32,t.bi(5,5,22,22),t.Ai=i,t._i=s}return Mt.TA?.put(BigInt(t),s),m.bind(o,l,a),m.yt(c,u,f,d),N.ki=n,N.Di=r,N.Mi=h,N.Ni=!0,e.UA?s.Ai=33:s.Ai=32,s._i=i,s};model=0;name=null;Lw=null;Sw=null;xw=null;kA=2e3;MA=0;DA=0;NA=0;FA=0;BA=0;WA=!1;GA=-1;UA=!1;YA=1;members=!1;Ow=null;RA=null;HA=-1;VA=-1;KA=0;XA=-1;jA=-1;zA=0;ZA=-1;qA=-1;JA=-1;$A=-1;QA=-1;t_=-1;LA=null;SA=null;PA=-1;bA=-1;decode(t,i){if(1===t)this.model=i.Zt;else if(2===t)this.name=i.ei;else if(3===t)this.Lw=i.ei;else if(4===t)this.kA=i.Zt;else if(5===t)this.MA=i.Zt;else if(6===t)this.DA=i.Zt;else if(7===t)this.FA=i.qt,this.FA>32767&&(this.FA-=65536);else if(8===t)this.BA=i.qt,this.BA>32767&&(this.BA-=65536);else if(9===t)this.WA=!0;else if(10===t)this.GA=i.Zt;else if(11===t)this.UA=!0;else if(12===t)this.YA=i.$t;else if(16===t)this.members=!0;else if(23===t)this.HA=i.Zt,this.KA=i.zt;else if(24===t)this.VA=i.Zt;else if(25===t)this.XA=i.Zt,this.zA=i.zt;else if(26===t)this.jA=i.Zt;else if(t>=30&&t<35)this.Ow||(this.Ow=new v(5,null)),this.Ow[t-30]=i.ei,'hidden'===this.Ow[t-30]?.toLowerCase()&&(this.Ow[t-30]=null);else if(t>=35&&t<40)this.RA||(this.RA=new v(5,null)),this.RA[t-35]=i.ei;else if(40===t){const t=i.jt;this.Sw=new Uint16Array(t),this.xw=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.LA&&this.SA||(this.LA=new Uint16Array(10),this.SA=new Uint16Array(10)),this.LA[t-100]=i.Zt,this.SA[t-100]=i.Zt)}i_(t){let i=this.HA;if(1===t&&(i=this.XA),-1===i)return null;let e=this.VA,s=this.ZA;1===t&&(e=this.jA,s=this.qA);let n=j.model(i);if(-1!==e){const t=j.model(e);if(-1===s){const i=[n,t];n=j.Wr(i,2)}else{const i=[n,t,j.model(s)];n=j.Wr(i,3)}}if(0===t&&0!==this.KA&&n.translate(this.KA,0,0),1===t&&0!==this.zA&&n.translate(this.zA,0,0),this.Sw&&this.xw)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.SA[e]&&0!==this.SA[e]&&(i=this.LA[e]);if(-1!==i)return Mt.get(i).xA(1)}if(Mt.Dh){const t=Mt.Dh.get(BigInt(this.id));if(t)return t}const i=j.model(this.model);if(this.Sw&&this.xw)for(let t=0;t=this.I_&&(this.b_=null),t>=this.g_&&t=kt.d_[i].length)&&(e=0),this.p_[i]=e}this.bp=t.Zt,65535===this.bp&&(this.bp=-1),this.Op=t.Zt,65535===this.Op&&(this.Op=-1),this.Rp=t.Zt,65535===this.Rp&&(this.Rp=-1),this.vp=t.Zt,65535===this.vp&&(this.vp=-1),this.Lp=t.Zt,65535===this.Lp&&(this.Lp=-1),this.Sp=t.Zt,65535===this.Sp&&(this.Sp=-1),this.xp=t.Zt,65535===this.xp&&(this.xp=-1),this.name=$.xh($.Oh(t.Qt)),this.A_=t.jt,this.visible=!0,this.__=0n;for(let t=0;t<12;t++)this.__<<=0x4n,this.m_[t]>=256&&(this.__+=BigInt(this.m_[t])-256n);this.m_[0]>=256&&(this.__+=BigInt(this.m_[0])-256n>>4n),this.m_[1]>=256&&(this.__+=BigInt(this.m_[1])-256n>>8n);for(let t=0;t<5;t++)this.__<<=0x3n,this.__+=BigInt(this.p_[t]);this.__<<=0x1n,this.__+=BigInt(this.w_)}CA(){if(!this.visible)return null;const t=new v(12,null);let i=0;for(let e=0;e<12;e++){const s=this.m_[e];if(s>=256&&s<512&&(t[i++]=xt.zs[s-256].CA()),s>=512){const e=Mt.get(s-512).CA(this.w_);e&&(t[i++]=e)}}const e=j.Wr(t,i);for(let t=0;t<5;t++)0!==this.p_[t]&&(e.Qr(kt.d_[t][0],kt.d_[t][this.p_[t]]),1===t&&e.Qr(kt.u_[0],kt.u_[this.p_[t]]));return e}O_(){let t=this.__,i=-1,e=-1,s=-1,n=-1;if(this.jp>=0&&0===this.qp){const r=bt.zs[this.jp];if(r.frames&&(i=r.frames[this.zp]),this.Vp>=0&&this.Vp!==this.bp){const t=bt.zs[this.Vp].frames;t&&(e=t[this.Kp])}r.uy>=0&&(s=r.uy,t+=BigInt(s-this.m_[5])<<8n),r.wy>=0&&(n=r.wy,t+=BigInt(n-this.m_[3])<<16n)}else if(this.Vp>=0){const t=bt.zs[this.Vp].frames;t&&(i=t[this.Kp])}let r=kt.Dh?.get(t);if(!r){const i=new v(12,null);let e=0;for(let t=0;t<12;t++){let r=this.m_[t];if(n>=0&&3===t&&(r=n),s>=0&&5===t&&(r=s),r>=256&&r<512){const t=xt.zs[r-256].Ml();t&&(i[e++]=t)}if(r>=512){const t=Mt.get(r-512).i_(this.w_);t&&(i[e++]=t)}}r=j.Wr(i,e);for(let t=0;t<5;t++)0!==this.p_[t]&&(r.Qr(kt.d_[t][0],kt.d_[t][this.p_[t]]),1===t&&r.Qr(kt.u_[0],kt.u_[this.p_[t]]));r.jr(),r.ih(64,850,-30,-50,-30,!0),kt.Dh?.put(t,r)}if(this.Ri)return r;const h=j.Nr(r,!0);return-1!==i&&-1!==e?h.zr(i,e,bt.zs[this.jp].oy):-1!==i&&h.qr(i),h.Ur(),h.Br=null,h.Fr=null,h}}class Dt extends It{static count=0;static cache=null;static Xs=null;static gw=null;static Iw=0;static Dh=new q(30);static Zs=t=>{this.Xs=new O(t.read('npc.dat'));const i=new O(t.read('npc.idx'));this.count=i.Zt,this.gw=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.gw||!this.Xs)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Iw=(this.Iw+1)%20;const i=this.cache[this.Iw]=new Dt(t);return this.Xs.Vt=this.gw[t],i.ow(this.Xs),i};static Xi=()=>{this.Dh=null,this.gw=null,this.cache=null,this.Xs=null};name=null;Lw=null;size=1;Rw=null;IA=null;Fw=!1;R_=-1;v_=-1;L_=-1;S_=-1;x_=-1;Sw=null;xw=null;Ow=null;Vw=-1;Kw=-1;Xw=-1;M_=!0;k_=-1;_A=128;gA=128;decode(t,i){if(1===t){const t=i.jt;this.Rw=new Uint16Array(t);for(let e=0;e=30&&t<40)this.Ow||(this.Ow=new v(5,null)),this.Ow[t-30]=i.ei,'hidden'===this.Ow[t-30]?.toLowerCase()&&(this.Ow[t-30]=null);else if(40===t){const t=i.jt;this.Sw=new Uint16Array(t),this.xw=new Uint16Array(t);for(let e=0;e{const i=new O(t.read('varp.dat'));this.count=i.Zt;for(let t=0;t{if('complete'===t.iceGatheringState){let i;self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(t.localDescription)):console.log(JSON.stringify(t.localDescription));try{for(;null===(i=prompt('Offer copied to clipboard, paste answer here')););t.setRemoteDescription(new RTCSessionDescription(JSON.parse(i)))}catch(t){console.error(t)}}},i.onopen=()=>{i.send(JSON.stringify({type:'id',id:e})),console.log('Connected to peer!')},i.onerror=t=>{console.error(t)},i.onmessage=t=>{const i=JSON.parse(t.data);i.data&&(i.data=Object.values(i.data)),this.Y_&&this.Y_.postMessage(i)}}postMessage(t){const i=this.G_.get(t.data.id),e=t.data;e.data&&(e.data=Array.from(t.data.data)),i&&'open'===i.readyState&&i.send(JSON.stringify(e))}}class Pt{pc;K_=void 0;H_;constructor(t){this.pc=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),this.pc.ondatachannel=i=>{this.K_=i.channel,this.K_.onopen=()=>{console.log('Connected to host!')},this.K_.onerror=t=>{console.error(t)},this.K_.onmessage=i=>{if(!this.H_){const t=JSON.parse(i.data);if('id'===t.type)return void(this.H_=t.id)}t.onmessage&&t.onmessage(i)}},this.pc.onicegatheringstatechange=async()=>{'complete'===this.pc.iceGatheringState&&(self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(this.pc.localDescription)):console.log(JSON.stringify(this.pc.localDescription)))}}async X_(t){await this.pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(t))),await this.pc.setLocalDescription(await this.pc.createAnswer())}}class Ut extends U{static j_=225;static z_=10;static portOffset=0;static members=!0;static Ri=!1;static Z_='';static q_='';static J_=!1;static Q_=2;static tg=!1;static ig='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static eg=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static sg=0;static ng=0;static rg=0;static hg=0;static og=0;static lg=0;static ag=0;static cg=0;static fg=0;static ug=0;static dg=0;static wg=0;static yg=0;static mg=0;static pg=0;static Ag=()=>{gt.Ri=!1,N.Ri=!1,Ut.Ri=!1,Rt.Ri=!1};static _g=()=>{gt.Ri=!0,N.Ri=!0,Ut.Ri=!0,Rt.Ri=!0};gg=2048;Ig=2047;Cg=!1;Eg=!1;Tg=!1;bg=!1;db=null;Og=0;Rg=[];stream=null;in=O.Xt(1);vg=O.Xt(1);Lg=O.Xt(1);Sg=0n;xg=0;Mg=0;kg=0;Dg=null;Ng=0;packetSize=0;Fg=0;Bg=0;Pg=0;Ug=null;Wg=!0;Gg=0;Yg=0;Hg=null;Vg=null;Kg=null;Xg=null;jg=null;zg=null;Zg=null;qg=null;Jg=null;$g=null;Qg=null;tI='';iI='';username='';password='';eI=null;sI=null;nI=null;rI=null;hI=[];oI=!1;lI=null;aI=null;cI=null;fI=null;uI=null;dI=null;wI=null;yI=null;mI=null;pI=null;AI=new Int32Array(256);_I=0;gI=0;II=0;CI=null;EI=null;TI=null;bI=null;OI=null;RI=null;vI=null;LI=null;SI=null;xI=null;MI=null;kI=null;DI=null;NI=null;FI=null;BI=null;UI=null;WI=null;GI=null;YI=null;HI=null;VI=new Int32Array(33);KI=new Int32Array(33);XI=new Int32Array(151);jI=new Int32Array(151);zI=null;ZI=null;qI=null;JI=null;$I=null;QI=null;tC=new v(13,null);iC=null;eC=null;sC=new v(50,null);nC=new v(50,null);rC=new v(20,null);hC=new v(20,null);oC=null;lC=new v(8,null);aC=null;cC=null;fC=null;uC=null;dC=null;wC=null;yC=null;mC=null;pC=null;AC=null;_C=null;gC=null;IC=null;CC=null;EC=null;TC=null;bC=null;OC=null;RC=new v(1e3,null);vC=!1;LC=!1;SC=!1;xC=!1;MC=-1;kC=0;DC=0;NC=0;FC=0;BC=0;PC=0;UC=!1;WC=0;GC=0;YC=0;HC=0;VC=0;KC=0;XC=[];jC=-1;zC=-1;ZC=new Q;qC=78;JC=0;$C=0;QC=[];tE=0;iE=0;eE=0;sE=0;nE=0;rE=0;hE=0;oE=0;lE=[];aE=[];cE=[];fE=[];uE=null;dE=-1;wE=3;yE=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];mE=0;pE=0;AE=0;_E=!1;gE=0;IE=!1;CE='';EE='';TE=0;bE='';OE=!1;RE=-1;vE=new v(100,null);LE=new v(100,null);messageType=new Int32Array(100);SE=new Int32Array(100);xE=0;ME=0;kE=0;DE='';NE=0;FE=0;BE=0;PE=0;UE=0;WE=0;GE=0;YE=0;HE=0;VE=!1;KE=0;XE=0;jE=0;zE=0;ZE=null;qE=0;JE=0;$E=0;QE=0;tT=!1;iT=[];eT=[];sT=0;nT=0;rT=0;hT=null;oT=0;lT=new Int32Array(500);aT=new Int32Array(500);cT=new Int32Array(500);fT=new Int32Array(500);uT=0;dT=0;wT=0;yT='';mT=!1;pT=-1;AT=0;_T=0;gT=0;IT=0;CT=0;ET=new Int32Array(1e3);TT=new Int32Array(1e3);bT=null;OT=0;RT=0;vT=0;LT=0;ST=0;xT=!1;MT=0;kT=0;DT=0;NT=0;FT=2;BT=2;PT=1;UT=new Int32Array(5);WT=new v(5,!1);GT=new Int32Array(5);YT=new Int32Array(5);HT=new Int32Array(5);VT=0;KT=0;XT=0;jT=0;zT=0;ZT=0;qT=0;JT=0;$T=0;QT=1;tb=2;ib=-1;Xn=0;zn=0;eb=0;sb=0;nb=0;rb=0;hb=null;ob=null;lb=null;ab=0;cb=0;fb=new Int8Array(16384);ub=new v(ut.wf,null);wb=0;yb=0;mb=128;pb=0;Ab=0;_b=0;gb=0;Ib=0;rp=null;hp=null;Cb=new k(ut.yf,ut.yf);Eb=0;Tb=0;bb=0;Ob=0;Rb=0;vb=0;Lb=0;Sb=0;xb=0;Mb=0;kb=0;Db=0;Nb=new v(this.gg,null);Fb=0;Bb=new Int32Array(this.gg);Pb=0;Ub=0;Wb=new Int32Array(this.gg);Gb=new Int32Array(1e3);Yb=new v(this.gg,null);Hb=new v(8192,null);Vb=0;Kb=new Int32Array(8192);Xb=new b;jb=new b;zb=new b;ud=new b;Zb=new S(ut.wf,ut.yf,ut.yf,null);qb=new b;Jb=new Int32Array(4e3);$b=new Int32Array(4e3);Qb=new Int32Array(ut.yf*ut.yf);tO=new Int32Array(ut.yf*ut.yf);iO=0;eO=null;sO=0;nO=0;rO=-1;hO=0;oO=0;lO=0;aO=0;cO=!1;fO=!0;uO=!1;dO=new Int32Array(7);wO=new Int32Array(5);yO=0;mO=0;static pO=50;AO=new Int32Array(Ut.pO);_O=new Int32Array(Ut.pO);gO=new Int32Array(Ut.pO);IO=new Int32Array(Ut.pO);CO=new Int32Array(Ut.pO);EO=new Int32Array(Ut.pO);TO=new Int32Array(Ut.pO);bO=new v(Ut.pO,null);OO=new v(100,null);RO=new BigInt64Array(100);vO=new Int32Array(100);LO=null;SO=0;xO=!0;MO=new Int32Array(50);kO=new Int32Array(50);DO=new Int32Array(50);NO=192;FO=-1;BO=-1;PO=0;UO=0;WO=0;GO=!0;YO=null;HO=0;VO=0;KO=192;Y_=void 0;XO=!1;host=null;jO=null;zO=new v(16,null);ZO=0;qO=!1;Xi=()=>{try{this.stream&&this.stream.close()}catch(t){}var t;this.jO&&'998'===Ut.getParameter('world')&&this.jO.K_?.send(JSON.stringify({type:'close',id:this.jO.H_})),this.stream=null,t=!1,window._tinyMidiStop&&window._tinyMidiStop(t),this.vg=null,this.Lg=null,this.in=null,this.lb=null,this.hb=null,this.ob=null,this.rp=null,this.hp=null,this.bT=null,this.ub=null,this.Qb=null,this.tO=null,this.Jb=null,this.$b=null,this.fb=null,this.EI=null,this.TI=null,this.bI=null,this.OI=null,this.RI=null,this.vI=null,this.LI=null,this.SI=null,this.xI=null,this.MI=null,this.kI=null,this.DI=null,this.NI=null,this.FI=null,this.BI=null,this.UI=null,this.WI=null,this.zI=null,this.qI=null,this.ZI=null,this.JI=null,this.$I=null,this.QI=null,this.tC=null,this.yC=null,this.mC=null,this.pC=null,this.AC=null,this._C=null,this.gC=null,this.IC=null,this.CC=null,this.EC=null,this.TC=null,this.eC=null,this.rC=null,this.hC=null,this.lC=null,this.aC=null,this.cC=null,this.fC=null,this.uC=null,this.sC=null,this.nC=null,this.Cb=null,this.Nb=null,this.Bb=null,this.Wb=null,this.Yb=null,this.Gb=null,this.Hb=null,this.Kb=null,this.Zb=null,this.qb=null,this.ud=null,this.Xb=null,this.jb=null,this.zb=null,this.cT=null,this.fT=null,this.lT=null,this.aT=null,this.XC=null,this.iT=null,this.ET=null,this.TT=null,this.RC=null,this.iC=null,this.OO=null,this.RO=null,this.vO=null,this.Xg=null,this.jg=null,this.Hg=null,this.Vg=null,this.Kg=null,this.zg=null,this.Zg=null,this.qg=null,this.Jg=null,this.JO(),Et.Xi(),Dt.Xi(),Mt.Xi(),Ct.zs=null,xt.zs=null,Q.zs=null,bt.zs=null,St.zs=null,St.Dh=null,Nt.zs=null,this.xe=null,kt.Dh=null,N.Xi(),gt.Xi(),j.Xi(),H.zs=[],V.zs=[]};xs(){return this.Gg}Ls(){return this.OE}Ss(){return this.IE}vs(){return this.zC}Rs(){return this.MC}JO=()=>{this.oI=!1,this.CI&&(clearInterval(this.CI),this.CI=null),this.$g=null,this.Qg=null,this.hI=[],this.wI=null,this.yI=null,this.mI=null,this.pI=null,this.fI=null,this.cI=null,this.uI=null,this.dI=null,this.lI=null,this.aI=null};$O=()=>{'999'===Ut.getParameter('world')?(this.Y_=new Worker('worker.js',{type:'module'}),this.Y_.onmessage=this.onmessage,this.host=new Bt(this.Y_)):'998'===Ut.getParameter('world')&&(this.Y_={onmessage:t=>{this.stream.QO.onmessage(t)},postMessage:t=>{this.jO&&this.jO.K_&&'open'===this.jO.K_.readyState&&this.jO.K_.send(JSON.stringify(t))},onerror:null,onmessageerror:null,terminate:()=>{throw new Error},addEventListener:()=>{throw new Error},removeEventListener:()=>{throw new Error},dispatchEvent:()=>{throw new Error}},this.jO=new Pt(this.Y_))};onmessage=t=>{switch(t.data.type){case'ready':return void(this.XO=!0);case'save':return Ft(t.data.value,t.data.path.split('/').pop().split('\\').pop()),void URL.revokeObjectURL(t.data.value);case'close':return void this.Y_?.postMessage({type:'close',id:t.data.id})}this.host?.H_===t.data.id?this.stream.QO.onmessage(t.data):this.host?.postMessage(t)};tR=async()=>{if(999==+Ut.getParameter('world'))this.host&&await this.host.V_();else if(998==+Ut.getParameter('world')&&this.jO){if(this.jO.K_)return void console.log('You are already connected.');const t=prompt('Paste offer here, answer will be copied to clipboard');if(t)try{await this.jO.X_(t)}catch(t){console.error(t)}}};iR=async(t,i,e,s)=>{let n=5,r=await(this.db?.Ds(t));if(r&&O.Ht(r)!==e&&(r=void 0),r)return new G(r);for(;!r;){await this.fs(s,`Requesting ${i}`);try{r=+Ut.getParameter('world')<998?await T(`${Ut.q_}/${t}${e}`):await T(`${Ut.q_}/${t}`)}catch(t){r=void 0;for(let t=n;t>0;t--)await this.fs(s,`Error loading - Will retry in ${t} secs.`),await E(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Ns(t,r)),new G(r)};eR=async(t,e,s,n)=>{let r=await(this.db?.Ds(t+'.mid'));if(r&&12345678!==e&&O.Ht(r)!==e&&(r=void 0),!r)try{r=+Ut.getParameter('world')<998?await T(`${Ut.q_}/${t}_${e}.mid`):await T(`${Ut.q_}/songs/${t}.mid`),s!==r.length&&(r=r.slice(0,s))}catch(t){}if(!r)return;await(this.db?.Ns(t+'.mid',r));const h=new O(Uint8Array.from(r)).$t;!function(t,i,e){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256,e)}(i.read(h,r,s,4),this.KO,n)};sR=()=>{if(A.fillStyle='black',A.fillRect(0,0,this.width,this.height),this.ds(1),this.Tg){this.oI=!1,A.font='bold 16px helvetica, sans-serif',A.textAlign='left',A.fillStyle='yellow';let t=35;A.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,A.fillStyle='white',A.fillText('To fix this try the following (in order):',30,t),t+=50,A.font='bold 12px helvetica, sans-serif',A.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,A.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,A.fillText('3: Try using a different game-world',30,t),t+=30,A.fillText('4: Try rebooting your computer',30,t),t+=30,A.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.bg&&(this.oI=!1,A.font='bold 20px helvetica, sans-serif',A.textAlign='left',A.fillStyle='white',A.fillText('Error - unable to load game!',50,50),A.fillText('To play RuneScape make sure you play from',50,100),A.fillText('https://2004scape.org',50,150)),this.Eg){this.oI=!1,A.font='bold 13px helvetica, sans-serif',A.textAlign='left',A.fillStyle='yellow';let t=35;A.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,A.fillStyle='white',A.fillText('To fix this try the following (in order):',30,t),t+=50,A.font='bold 12px helvetica, sans-serif',A.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,A.fillText('2: Try rebooting your computer, and reloading',30,t)}};nR=t=>{if(!t.ll)return!1;for(let i=0;i=s)return!1}else if(3===t.ll[i]){if(e<=s)return!1}else if(4===t.ll[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};hR=(t,i,e,s,n)=>{this.dC?.draw(t,i),this.wC?.draw(t,i+n-16),m.fillRect(t,i+16,16,n-32,Ot.My);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;m.fillRect(t,i+h+16,16,r,Ot.ky),m.It(t,i+h+16,Ot.Dy,r),m.It(t+1,i+h+16,Ot.Dy,r),m.gt(t,i+h+16,Ot.Dy,16),m.gt(t,i+h+17,Ot.Dy,16),m.It(t+15,i+h+16,Ot.Ny,r),m.It(t+14,i+h+17,Ot.Ny,r-1),m.gt(t,i+h+r+15,Ot.Ny,16),m.gt(t+1,i+h+r+14,Ot.Ny,15)};oR=(t,i)=>{let e=!1;const s=Q.zs[t];if(!s.cl)return!1;for(let t=0;ts.delay[n.Yl];)n.Hl-=s.delay[n.Yl]+1,n.Yl++,n.Yl>=s.ny&&(n.Yl-=s.sy,(n.Yl<0||n.Yl>=s.ny)&&(n.Yl=0)),e=!0}}}return e};lR=(t,i,e,s,n=!1)=>{if(0!==t.type||!t.cl||t.hide&&this.NE!==t.id&&this.FE!==t.id&&this.BE!==t.id)return;const r=m.left,h=m.top,o=m.right,l=m.bottom;m.yt(i,e,i+t.width,e+t.height);const a=t.cl.length;for(let r=0;r0&&this.aR(l),l.type===Q.Nh)l.Gl>l.scroll-l.height&&(l.Gl=l.scroll-l.height),l.Gl<0&&(l.Gl=0),this.lR(l,h,o,l.Gl,n),l.scroll>l.height&&this.hR(h+l.width,o,l.Gl,l.scroll,l.height);else if(l.type===Q.Bh){let t=0;for(let i=0;i0){let i=0,e=0;const r=l.dl[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.WE&&this.UE===t){const h=Mt.vA(r,l.wl[t]);if(0!==this.WE&&this.UE===t&&this.PE===l.id?(i=this.Ve-this.GE,e=this.Ke-this.YE,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.HE<5&&(i=0,e=0),h.ph(128,s+i,n+e)):0!==this.qE&&this.JE===t&&this.$E===l.id?h.ph(128,s,n):h.draw(s,n),33===h.Ai||1!==l.wl[t]){const r=l.wl[t];this.eI?.cR(s+i+1,n+10+e,this.fR(r),Ot.gy),this.eI?.cR(s+i,n+9+e,this.fR(r),Ot.my)}}}else if(l.Il&&t<20){const i=l.Il[t];i?.draw(s,n)}t++}}else if(l.type===Q.Ph)l.fill?m.fillRect(h,o,l.width,l.height,l.Rl):m._t(h,o,l.width,l.height,l.Rl);else if(l.type===Q.Uh){const t=l.font;let i=l.Rl,e=l.text;if(this.BE!==l.id&&this.FE!==l.id&&this.NE!==l.id||0===l.Ll||(i=l.Ll),this.nR(l)&&(i=l.vl,l.Ol&&l.Ol.length>0&&(e=l.Ol)),l.rl===Q.zh&&this.tT&&(e='Please wait...',i=l.Rl),!t||!e)continue;for(let s=o+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.uR(this.rR(l,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.uR(this.rR(l,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.uR(this.rR(l,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.uR(this.rR(l,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.uR(this.rR(l,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),l.Tl?t.dR(h+(l.width/2|0),s,r,i,l.bl):t.wR(h,s,r,i,l.bl)}}else if(l.type===Q.Wh){let t;t=this.nR(l)?l.xl:l.Sl,t?.draw(h,o)}else if(l.type===Q.Gh){const t=N.ki,i=N.Di;N.ki=h+(l.width/2|0),N.Di=o+(l.height/2|0);const e=N.sin[l.Fl]*l.zoom>>16,s=N.cos[l.Fl]*l.zoom>>16,n=this.nR(l);let r;r=n?l.Nl:l.Dl;let a=null;if(-1===r)a=l.Ml(-1,-1,n);else{const t=bt.zs[r];t.frames&&t.hy&&(a=l.Ml(t.frames[l.Yl],t.hy[l.Yl],n))}a&&a.nh(0,l.Bl,0,l.Fl,0,e,s),N.ki=t,N.Di=i}else if(l.type===Q.Yh){const t=l.font;if(!t||!l.dl||!l.wl)continue;let i=0;for(let e=0;e0){const n=Mt.get(l.dl[i]-1);let r=n.name;if((n.UA||1!==l.wl[i])&&(r=r+' x'+this.yR(l.wl[i])),!r)continue;const a=h+s*(l.pl+115),c=o+e*(l.Al+12);l.Tl?t.dR(a+(l.width/2|0),c,r,l.Rl,l.bl):t.wR(a,c,r,l.Rl,l.bl)}i++}}}m.yt(r,h,o,l)};aR=t=>{let i=t.hl;if(i>=Q.Zh&&i<=Q.qh)i--,i>=this.yO?(t.text='',t.rl=0):(t.text=this.OO[i],t.rl=1);else if(i>=Q.Jh&&i<=Q.$h)i-=Q.Jh,i>=this.yO?(t.text='',t.rl=0):(0===this.vO[i]?t.text='@red@Offline':this.vO[i]===Ut.z_?t.text='@gre@World-'+(this.vO[i]-9):t.text='@yel@World-'+(this.vO[i]-9),t.rl=1);else if(i===Q.eo)t.scroll=15*this.yO+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=Q.ko&&i<=Q.Do)i-=Q.ko,i>=this.$C?(t.text='',t.rl=0):(t.text=$.xh($.Oh(this.QC[i])),t.rl=1);else if(i===Q.Bo)t.scroll=15*this.$C+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===Q.Mo){if(t.Fl=150,t.Bl=256*Math.sin(this.Og/40)&2047,this.uO){this.uO=!1;const i=new v(7,null);let e=0;for(let t=0;t<7;t++){const s=this.dO[t];s>=0&&(i[e++]=xt.zs[s].Ml())}const s=j.Wr(i,e);for(let t=0;t<5;t++)0!==this.wO[t]&&(s.Qr(kt.d_[t][0],kt.d_[t][this.wO[t]]),1===t&&s.Qr(kt.u_[0],kt.u_[this.wO[t]]));if(this.eO){const i=bt.zs[this.eO.bp].frames;i&&(s.jr(),s.qr(i[0]),s.ih(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===Q.Lo)this.bC||(this.bC=t.Sl,this.OC=t.xl),this.fO?t.Sl=this.OC:t.Sl=this.bC;else if(i===Q.So)this.bC||(this.bC=t.Sl,this.OC=t.xl),this.fO?t.Sl=this.bC:t.Sl=this.OC;else if(i===Q.Po)t.text=this.yT,this.Og%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===Q.Jo)this.cO?this.mT?(t.Rl=Ot.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Rl=Ot._y,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===Q.$o||i===Q.sl)if(0===this.AT)t.text='';else{let i;i=0===this._T?'earlier today':1===this._T?'yesterday':this._T+' days ago',t.text='You last logged in '+i+' from: '+$.Sh(this.AT)}else if(i===Q.Qo)0===this.IT&&(t.text='0 unread messages',t.Rl=Ot.my),1===this.IT&&(t.text='1 unread message',t.Rl=Ot.GREEN),this.IT>1&&(t.text=this.IT+' unread messages',t.Rl=Ot.GREEN);else if(i===Q.tl)if(201===this.gT)t.text='';else if(200===this.gT)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.gT?'Earlier today':1===this.gT?'Yesterday':this.gT+' days ago',t.text=i+' you changed your recovery questions'}else i===Q.il?201===this.gT?t.text='':200===this.gT?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===Q.el&&(201===this.gT?t.text='':(this.gT,t.text="Do this from the 'account management' area on our front webpage"))};rR=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let s=0,n=0;for(;;){const t=e[n++];if(0===t)return s;if(1===t)s+=this.aE[e[n++]];else if(2===t)s+=this.cE[e[n++]];else if(3===t)s+=this.lE[e[n++]];else if(4===t){const t=Q.zs[e[n++]],i=e[n++]+1;if(t.dl&&t.wl)for(let e=0;et<999999999?String(t):'*';yR=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};fR=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}(new class extends Ut{Cg=!1;Eg=!1;Tg=!1;bg=!1;mR=null;pR=null;AR=null;_R=null;gR=null;IR=null;Lu=0;Su=0;xu=0;CR=0;ER=0;TR=2;model={id:parseInt(U.getParameter('model'))||0,bR:null,x:0,y:0,z:420,Ta:0};OR=null;constructor(){super(!0)}load=async()=>{if(this.Cg)this.Eg=!0;else{this.Cg=!0;try{await async function(t){if(o||h)return;o=!0;const i=await r(t);h||(h=i)}(),await i.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new W(await W.openDatabase()),this.mR=document.getElementById('rightPanel');const t=document.getElementById('mainPanel');t&&(t.ondragover=t=>{t.preventDefault(),t.stopPropagation()},t.ondrop=async t=>{if(t.preventDefault(),t.stopPropagation(),!t.dataTransfer||!t.dataTransfer.files.length)return;const i=['main_file_cache.dat','main_file_cache.idx0','main_file_cache.idx1','main_file_cache.idx2','main_file_cache.idx3','main_file_cache.idx4'],e=[];for(let s=0;s{this.Eg||this.Tg||this.bg||(this.RR(),this.vR())};draw=async()=>{this.Eg||this.Tg||this.bg?this.sR():(j.$n=!0,j.Ve=this.Ve,j.Ke=this.Ke,this.xe?.bind(),m.clear(),m.fillRect(0,0,this.width,this.height,Ot.gy),null!==this.model.bR&&(this.model.bR.draw(this.model.Ta,N.sin[this.CR],N.cos[this.CR],N.sin[this.ER],N.cos[this.ER],this.model.x-this.Lu,this.model.y-this.Su,this.model.z-this.xu,0),-1!==this.model.bR.Vr&&this.model.bR.ah(this.model.bR.Vr)),this.xe?.draw(0,0),this.OR?.draw(this.Ve,this.Ke))};init=async()=>{const t=await(this.db?.Ds('main_file_cache.dat'));if(!t){return document.getElementById('helpme').style.display='block',void(p.style.display='none')}const i=await(this.db?.Ds('main_file_cache.idx0')),e=await(this.db?.Ds('main_file_cache.idx1')),s=await(this.db?.Ds('main_file_cache.idx2')),n=await(this.db?.Ds('main_file_cache.idx3')),r=await(this.db?.Ds('main_file_cache.idx4'));if(!(i&&e&&s&&n&&r)){return document.getElementById('helpme').style.display='block',void(p.style.display='none')}document.getElementById('helpme').style.display='none',p.style.display='block',this.pR=new Y(t,i,0),this.AR=new Y(t,e,1),this._R=new Y(t,s,2),this.gR=new Y(t,n,3),this.IR=new Y(t,r,4),await this.fs(10,'Unpacking textures');const h=this.pR.read(6);N.qi(h),N.Qi(.8),N.ie(20),await this.fs(20,'Loading models...');for(let t=0;t{this.model.id=i,this.LR(i)},t.appendChild(e)}}await this.fs(80,'Finishing up...'),this.OR=new C(512,128),this.OR.bind();for(let t=0;t<512;t++)for(let i=0;i<128;i++){const e=t,s=127-i;m.bt(e,s,N.palette[i+128*t])}this.OR.draw(0,0)};LR(t){if(null===this.AR)return;const i=this.AR.read(t);null!==i?(this.model.bR=j.Gr(i,t),this.model.bR.ih(64,850,-30,-50,-30,!0),document.title=`Model ${t} | 2004Scape Tools`):document.title=`Missing model ${t} | 2004Scape Tools`}RR(){for(;;){const t=this.ys();if(-1===t)break;t==='r'.charCodeAt(0)?(this.TR=2,this.Lu=0,this.Su=0,this.xu=0,this.CR=0,this.ER=0,this.model.x=0,this.model.y=0,this.model.z=420,this.model.Ta=0):t==='1'.charCodeAt(0)?(this.model.id--,j.metadata&&this.model.id<0&&(this.model.id=j.metadata.length-1),this.LR(this.model.id)):t==='2'.charCodeAt(0)&&(this.model.id++,j.metadata&&this.model.id>=j.metadata.length&&(this.model.id=0),this.LR(this.model.id))}}vR(){this.Ze['['.charCodeAt(0)]?this.TR--:this.Ze[']'.charCodeAt(0)]&&this.TR++,this.Ze[1]?this.model.Ta+=this.TR:this.Ze[2]&&(this.model.Ta-=this.TR),this.Ze['w'.charCodeAt(0)]?this.model.z-=this.TR:this.Ze['s'.charCodeAt(0)]&&(this.model.z+=this.TR),this.Ze['a'.charCodeAt(0)]?this.model.x-=this.TR:this.Ze['d'.charCodeAt(0)]&&(this.model.x+=this.TR),this.Ze['q'.charCodeAt(0)]?this.model.y-=this.TR:this.Ze['e'.charCodeAt(0)]&&(this.model.y+=this.TR),this.CR=2047&this.CR,this.ER=2047&this.ER,this.model.Ta=2047&this.model.Ta}}).run().then((()=>{}))})()})(); \ No newline at end of file +(()=>{"use strict";var t={7444:(t,i,e)=>{t.exports=e.p+"0c791968973e1f25c170.wasm"},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"}},i={};function e(s){var n=i[s];if(void 0!==n)return n.exports;var r=i[s]={exports:{}};return t[s](r,r.exports,e),r.exports}e.m=t,e.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),e.p="/Client2/",e.b=document.baseURI||self.location.href,(()=>{async function t(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,l=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,l,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(a,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}class i{static tt=null;static load=async i=>{this.tt=await t(new WebAssembly.Module(i),{env:void 0})};static read=(t,i,e,s)=>{if(!this.tt)throw new Error('bz2 not found!!');return Int8Array.from(this.tt.read(t,i,e,s))}}let s;function n(t,i){return s=t.exports,r.it=i,s}async function r(t){void 0===t&&(t=new URL(e(7444),e.b));const i={et:{}};('string'==typeof t||'function'==typeof Request&&t instanceof Request||'function'==typeof URL&&t instanceof URL)&&(t=fetch(t));const{instance:s,module:r}=await async function(t,i){if('function'==typeof Response&&t instanceof Response){if('function'==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,i)}catch(i){if('application/wasm'==t.headers.get('Content-Type'))throw i;console.warn('`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n',i)}const e=await t.arrayBuffer();return await WebAssembly.instantiate(e,i)}{const e=await WebAssembly.instantiate(t,i);return e instanceof WebAssembly.Instance?{instance:e,module:t}:e}}(await t,i);return n(s,r)}let h=null,o=!1;class l extends Error{constructor(t){super(t),this.name='DecompressionError'}}let a=0,c=null,f=null;function u(t,i,e){let s;if(e){const n=i;s=t.malloc_u8(n);const r=new Uint8Array(t.memory.buffer,s,n);try{e(r)}catch(i){throw t.free_u8(s,n),i}return a=n,s}if('string'==typeof i){const e=a=function(t){let i=0,e=0,s=0;const n=t.length;for(;i{this.lt=t,this.ct=i,this.ft=e,this.yt(0,0,i,e)};static At=()=>{this.left=0,this.top=0,this.right=this.ct,this.bottom=this.ft,this.ut=this.right-1,this.dt=this.right/2|0};static yt=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.ct&&(e=this.ct),s>this.ft&&(s=this.ft),this.top=i,this.bottom=s,this.left=t,this.right=e,this.ut=this.right-1,this.dt=this.right/2|0,this.wt=this.bottom/2|0};static clear=()=>{const t=this.ct*this.ft;for(let i=0;i{this.gt(t,i,n,e),this.gt(t,i+s-1,n,e),this.It(t,i,n,s),this.It(t+e-1,i,n,s)};static gt=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.ct;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.ct;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(a-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.ct-e;let h=t+i*this.ct;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.lt[h++]=n;h+=r}};static Et(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,l=(n>>8&255)*r,a=(255&n)*r,c=this.ct-e;let f=t+i*this.ct;for(let t=0;t>16&255)*h>>8<<16)+(l+(this.lt[f]>>8&255)*h>>8<<8)+(a+(255&this.lt[f])*h>>8);this.lt[f++]=t}f+=c}}static Tt(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,l=(255&s)*n;let a=i-e;a<0&&(a=0);let c=i+e;c>=this.ft&&(c=this.ft-1);for(let s=a;s<=c;s++){const n=s-i,a=0|Math.sqrt(e*e-n*n);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.ct&&(f=this.ct-1);let u=c+s*this.ct;for(let t=c;t<=f;t++){const t=(h+(this.lt[u]>>16&255)*r>>8<<16)+(o+(this.lt[u]>>8&255)*r>>8<<8)+(l+(255&this.lt[u])*r>>8);this.lt[u++]=t}}}static bt=(t,i,e)=>{t=this.right||i=this.bottom||(this.lt[t+i*this.ct]=e)}}const p=document.getElementById('canvas'),A=p.getContext('2d',{willReadFrequently:!0}),_=document.createElement('canvas'),g=document.createElement('img'),I=_.getContext('2d',{willReadFrequently:!0});class C{Ot;width;height;Rt;vt;lt;constructor(t,i,e=A){this.Rt=e,this.Ot=this.Rt.getImageData(0,0,t,i),this.vt=new Uint32Array(this.Ot.data.buffer),this.lt=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.lt.fill(0)}bind(){m.bind(this.lt,this.width,this.height)}draw(t,i){this.#t(),this.Rt.putImageData(this.Ot,t,i)}#t(){const t=this.lt.length,i=this.lt,e=this.vt;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}const E=async t=>new Promise((i=>setTimeout(i,t))),T=async t=>new Int8Array(await(await fetch(t)).arrayBuffer());class b{Lt;cursor=null;constructor(){const t=new w;t.next=t,t.st=t,this.Lt=t}St(t){t.st&&t.nt(),t.st=this.Lt.st,t.next=this.Lt,t.st&&(t.st.next=t),t.next.st=t}xt(t){t.st&&t.nt(),t.st=this.Lt,t.next=this.Lt.next,t.st.next=t,t.next&&(t.next.st=t)}Mt(){const t=this.Lt.next;return t===this.Lt?null:(t?.nt(),t)}head(){const t=this.Lt.next;return t===this.Lt?(this.cursor=null,null):(this.cursor=t?.next||null,t)}kt(){const t=this.Lt.st;return t===this.Lt?(this.cursor=null,null):(this.cursor=t?.st||null,t)}next(){const t=this.cursor;return t===this.Lt?(this.cursor=null,null):(this.cursor=t?.next||null,t)}st(){const t=this.cursor;return t===this.Lt?(this.cursor=null,null):(this.cursor=t?.st||null,t)}clear(){for(;;){const t=this.Lt.next;if(t===this.Lt)return;t?.nt()}}}class O extends y{static Dt=3988292384;static Nt=new Int32Array(256);static Ft=new Uint32Array(33);static Bt=new b;static Pt=new b;static Ut=new b;static Wt=0;static Gt=0;static Yt=0;static{for(let t=0;t<32;t++)O.Ft[t]=(1<>>=1:i=i>>>1^O.Dt;O.Nt[t]=i}}static Ht=t=>{let i=4294967295;for(let e=0;e>>8^O.Nt[255&(i^t[e])];return~i};view;data;Vt=0;Kt=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.Vt}static Xt=t=>{let i=null;return 0===t&&O.Wt>0?(O.Wt--,i=O.Bt.Mt()):1===t&&O.Gt>0?(O.Gt--,i=O.Pt.Mt()):2===t&&O.Yt>0&&(O.Yt--,i=O.Ut.Mt()),i?(i.Vt=0,i):new O(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.Vt=0,100===this.view.byteLength&&O.Wt<1e3?(O.Bt.St(this),O.Wt++):5e3===this.view.byteLength&&O.Gt<250?(O.Pt.St(this),O.Gt++):3e4===this.view.byteLength&&O.Yt<50&&(O.Ut.St(this),O.Yt++)}get jt(){return this.view.getUint8(this.Vt++)}get zt(){return this.view.getInt8(this.Vt++)}get Zt(){const t=this.view.getUint16(this.Vt);return this.Vt+=2,t}get qt(){const t=this.view.getInt16(this.Vt);return this.Vt+=2,t}get Jt(){const t=this.view.getUint8(this.Vt++)<<16|this.view.getUint16(this.Vt);return this.Vt+=2,t}get $t(){const t=this.view.getInt32(this.Vt);return this.Vt+=4,t}get Qt(){const t=this.view.getBigInt64(this.Vt);return this.Vt+=8,t}get ti(){return this.view.getUint8(this.Vt)<128?this.jt-64:this.Zt-49152}get ii(){return this.view.getUint8(this.Vt)<128?this.jt:this.Zt-32768}get ei(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.Vt++))&&this.Vt>16),this.view.setUint16(this.Vt,t),this.Vt+=2}p4(t){this.view.setInt32(this.Vt,t),this.Vt+=4}oi(t){this.view.setInt32(this.Vt,t,!0),this.Vt+=4}li(t){this.view.setBigInt64(this.Vt,t),this.Vt+=8}ai(t){const i=this.view,e=t.length;for(let s=0;s>>3}wi(t){let i=this.Kt>>>3,e=8-(7&this.Kt),s=0;for(this.Kt+=t;t>e;e=8)s+=(this.view.getUint8(i++)&O.Ft[e])<>>e-t&O.Ft[t],s}yi(t,i){const e=this.Vt;this.Vt=0;const s=new Uint8Array(e);this.si(e,0,s);const n=function(t){const i=[];for(;t>0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}(function(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}(function(t){let i=0n;for(let e=0;e{const s=new O(t.read(i+'.dat')),n=new O(t.read('index.dat'));n.Vt=s.Zt;const r=n.Zt,h=n.Zt,o=n.jt,l=new Int32Array(o);for(let t=1;ts.length||n.Vt>n.length)throw new Error;const a=n.jt,c=n.jt,f=n.Zt,u=n.Zt,d=new R(f,u,l);d.mi=a,d.pi=c,d.Ai=r,d._i=h;const w=d.lt,y=n.jt;if(0===y){const t=d.width*d.height;for(let i=0;im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.Ii(r,n,this.lt,s,o,m.lt,e,h)}Ci(){const t=this.lt,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}Ti(){this.Ai|=0,this._i|=0,this.Ai/=2,this._i/=2,this.Ai|=0,this._i|=0;const t=new Int8Array(this.Ai*this._i);let i=0;for(let e=0;e>1)+(e+this.pi>>1)*this.Ai]=this.lt[i++];this.lt=t,this.width=this.Ai,this.height=this._i,this.mi=0,this.pi=0}bi(){if(this.width===this.Ai&&this.height===this._i)return;const t=new Int8Array(this.Ai*this._i);let i=0;for(let e=0;e>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,s){try{const n=this.width;this.height;let r=0,h=0;const o=this.Ai,l=this._i,a=(o<<16)/e|0,c=(l<<16)/s|0;t=t+(this.mi*e+o-1)/o|0,i=i+(this.pi*s+l-1)/l|0,this.mi*e%o!=0&&(r=(o-this.mi*e%o<<16)/e|0),this.pi*s%l!=0&&(h=(l-this.pi*s%l<<16)/s|0),e=e*(this.width-(r>>16))/o|0,s=s*(this.height-(h>>16))/l|0;let f,u=t+i*m.ct,d=m.ct-e;im.bottom&&(s-=i+s-m.bottom),tm.right&&(f=t+e-m.right,e-=f,d+=f),this.Oi(m.lt,this.lt,this.palette,r,h,u,d,e,s,a,c,n)}catch(t){console.log('error in sprite clipping routine')}}Oi(t,i,e,s,n,r,h,o,l,a,c,f){try{const u=s;for(let d=-l;d<0;d++){const l=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+l];0==n?r++:t[r++]=e[255&n],s+=a}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}class v extends Array{constructor(t,i){super(t);for(let e=0;e{this.vi=null,this.vi=null,this.sin=null,this.cos=null,this.Mi=null,this.Si=null,this.Vi=null,this.Ki=null,this.Bi=null,this.Pi=null,this.Gi=null,this.palette=null,this.Yi=null,console.log('Draw3D unloaded!')};static ji=()=>{this.Mi=new Int32Array(m.ft);for(let t=0;t{this.Mi=new Int32Array(i);for(let e=0;e{this.Bi=null,this.Pi.fill(null)};static qi=t=>{this.xi=0;for(let i=0;i<50;i++)try{this.Si[i]=R.gi(t,i.toString()),this.Ri&&128===this.Si[i]?.Ai?this.Si[i]?.Ti():this.Si[i]?.bi(),this.xi++}catch(t){}};static Ji=t=>{if(0!==this.Ki[t])return this.Ki[t];const i=this.Yi[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.$i(h,1.4),0===h&&(h=1),this.Ki[t]=h,h};static Qi=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,l=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let a=s-.3333333333333333;a<0&&a++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*h|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[e++]=this.$i(a,i)}}for(let t=0;t<50;t++){const e=this.Si[t];if(!e)continue;const s=e.palette;this.Yi[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static ie=t=>{this.Bi||(this.Ui=t,this.Ri?this.Bi=new k(t,16384):this.Bi=new k(t,65536),this.Pi.fill(null))};static ee=(t,i,e,s,n,r,h,o,l)=>{let a=0,c=0;n!==s&&(a=(i-t<<16)/(n-s)|0,c=(o-h<<15)/(n-s)|0);let f=0,u=0;r!==n&&(f=(e-i<<16)/(r-n)|0,u=(l-o<<15)/(r-n)|0);let d=0,w=0;if(r!==s&&(d=(t-e<<16)/(s-r)|0,w=(h-l<<15)/(s-r)|0),s<=n&&s<=r){if(sm.bottom&&(n=m.bottom),r>m.bottom&&(r=m.bottom),nf)for(r-=n,n-=s,s=N.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.se(e>>16,i>>16,l>>7,o>>7,m.lt,s,0),e+=d,i+=f,l+=w,o+=u,s+=m.ct}this.se(e>>16,t>>16,l>>7,h>>7,m.lt,s,0),e+=d,t+=a,l+=w,h+=c,s+=m.ct}else for(r-=n,n-=s,s=N.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.se(i>>16,e>>16,o>>7,l>>7,m.lt,s,0),e+=d,i+=f,l+=w,o+=u,s+=m.ct}this.se(t>>16,e>>16,h>>7,l>>7,m.lt,s,0),e+=d,t+=a,l+=w,h+=c,s+=m.ct}else if(i=t<<=16,o=h<<=15,s<0&&(i-=d*s,t-=a*s,o-=w*s,h-=c*s,s=0),e<<=16,l<<=15,r<0&&(e-=f*r,l-=u*r,r=0),s!==r&&da)for(n-=r,r-=s,s=N.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.se(e>>16,t>>16,l>>7,h>>7,m.lt,s,0),e+=f,t+=a,l+=u,h+=c,s+=m.ct}this.se(i>>16,t>>16,o>>7,h>>7,m.lt,s,0),i+=d,t+=a,o+=w,h+=c,s+=m.ct}else for(n-=r,r-=s,s=N.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.se(t>>16,e>>16,h>>7,l>>7,m.lt,s,0),e+=f,t+=a,l+=u,h+=c,s+=m.ct}this.se(t>>16,i>>16,h>>7,o>>7,m.lt,s,0),i+=d,t+=a,o+=w,h+=c,s+=m.ct}}else if(n<=r){if(nm.bottom&&(r=m.bottom),s>m.bottom&&(s=m.bottom),rd)for(s-=r,r-=n,n=N.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.se(t>>16,e>>16,h>>7,l>>7,m.lt,n,0),t+=a,e+=d,h+=c,l+=w,n+=m.ct}this.se(t>>16,i>>16,h>>7,o>>7,m.lt,n,0),t+=a,i+=f,h+=c,o+=u,n+=m.ct}else for(s-=r,r-=n,n=N.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.se(e>>16,t>>16,l>>7,h>>7,m.lt,n,0),t+=a,e+=d,h+=c,l+=w,n+=m.ct}this.se(i>>16,t>>16,o>>7,h>>7,m.lt,n,0),t+=a,i+=f,h+=c,o+=u,n+=m.ct}else if(e=i<<=16,l=o<<=15,n<0&&(e-=a*n,i-=f*n,l-=c*n,o-=u*n,n=0),t<<=16,h<<=15,s<0&&(t-=d*s,h-=w*s,s=0),r-=s,s-=n,n=N.Mi[n],a>16,i>>16,h>>7,o>>7,m.lt,n,0),t+=d,i+=f,h+=w,o+=u,n+=m.ct}this.se(e>>16,i>>16,l>>7,o>>7,m.lt,n,0),e+=a,i+=f,l+=c,o+=u,n+=m.ct}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.se(i>>16,t>>16,o>>7,h>>7,m.lt,n,0),t+=d,i+=f,h+=w,o+=u,n+=m.ct}this.se(i>>16,e>>16,o>>7,l>>7,m.lt,n,0),e+=a,i+=f,l+=c,o+=u,n+=m.ct}}else if(rm.bottom&&(s=m.bottom),n>m.bottom&&(n=m.bottom),s>16,t>>16,o>>7,h>>7,m.lt,r,0),i+=f,t+=a,o+=u,h+=c,r+=m.ct}this.se(i>>16,e>>16,o>>7,l>>7,m.lt,r,0),i+=f,e+=d,o+=u,l+=w,r+=m.ct}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.se(t>>16,i>>16,h>>7,o>>7,m.lt,r,0),i+=f,t+=a,o+=u,h+=c,r+=m.ct}this.se(e>>16,i>>16,l>>7,o>>7,m.lt,r,0),i+=f,e+=d,o+=u,l+=w,r+=m.ct}else if(t=e<<=16,h=l<<=15,r<0&&(t-=f*r,e-=d*r,h-=u*r,l-=w*r,r=0),i<<=16,o<<=15,n<0&&(i-=a*n,o-=c*n,n=0),s-=n,n-=r,r=N.Mi[r],f>16,e>>16,o>>7,l>>7,m.lt,r,0),i+=a,e+=d,o+=c,l+=w,r+=m.ct}this.se(t>>16,e>>16,h>>7,l>>7,m.lt,r,0),t+=f,e+=d,h+=u,l+=w,r+=m.ct}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.se(e>>16,i>>16,l>>7,o>>7,m.lt,r,0),i+=a,e+=d,o+=c,l+=w,r+=m.ct}this.se(e>>16,t>>16,l>>7,h>>7,m.lt,r,0),t+=f,e+=d,h+=u,l+=w,r+=m.ct}};static se=(t,i,e,s,n,r,h)=>{let o;if(N.Ni){let l;if(N.Fi){if(l=i-t>3?(s-e)/(i-t)|0:0,i>m.ut&&(i=m.ut),t<0&&(e-=t*l,t=0),t>=i)return;r+=t,h=i-t>>2,l<<=2}else{if(!(t>2)>0?(s-e)*N.vi[h]>>15:0}if(0===N.alpha)for(;;){if(--h<0){if((h=i-t&3)>0){o=N.palette[e>>8];do{n[r++]=o,h--}while(h>0);return}break}o=N.palette[e>>8],e+=l,n[r++]=o,n[r++]=o,n[r++]=o,n[r++]=o}else{const s=N.alpha,a=256-N.alpha;for(;;){if(--h<0){if((h=i-t&3)>0){o=N.palette[e>>8],o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280);do{n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),h--}while(h>0)}break}o=N.palette[e>>8],e+=l,o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280)}}}else if(tm.ut&&(i=m.ut),t<0&&(e-=t*l,t=0),t>=i))return;if(r+=t,h=i-t,0===N.alpha)do{n[r++]=N.palette[e>>8],e+=l,h--}while(h>0);else{const t=N.alpha,i=256-N.alpha;do{o=N.palette[e>>8],e+=l,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),n[r++]=o+((16711935&n[r])*t>>8&16711935)+((65280&n[r])*t>>8&65280),h--}while(h>0)}}};static ne=(t,i,e,s,n,r,h)=>{let o=0;n!==s&&(o=(i-t<<16)/(n-s)|0);let l=0;r!==n&&(l=(e-i<<16)/(r-n)|0);let a=0;if(r!==s&&(a=(t-e<<16)/(s-r)|0),s<=n&&s<=r){if(sm.bottom&&(n=m.bottom),r>m.bottom&&(r=m.bottom),nl)for(r-=n,n-=s,s=this.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.re(e>>16,i>>16,m.lt,s,h),e+=a,i+=l,s+=m.ct}this.re(e>>16,t>>16,m.lt,s,h),e+=a,t+=o,s+=m.ct}else for(r-=n,n-=s,s=this.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.re(i>>16,e>>16,m.lt,s,h),e+=a,i+=l,s+=m.ct}this.re(t>>16,e>>16,m.lt,s,h),e+=a,t+=o,s+=m.ct}else if(i=t<<=16,s<0&&(i-=a*s,t-=o*s,s=0),e<<=16,r<0&&(e-=l*r,r=0),s!==r&&ao)for(n-=r,r-=s,s=this.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.re(e>>16,t>>16,m.lt,s,h),e+=l,t+=o,s+=m.ct}this.re(i>>16,t>>16,m.lt,s,h),i+=a,t+=o,s+=m.ct}else for(n-=r,r-=s,s=this.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.re(t>>16,e>>16,m.lt,s,h),e+=l,t+=o,s+=m.ct}this.re(t>>16,i>>16,m.lt,s,h),i+=a,t+=o,s+=m.ct}}else if(n<=r){if(nm.bottom&&(r=m.bottom),s>m.bottom&&(s=m.bottom),ra)for(s-=r,r-=n,n=this.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.re(t>>16,e>>16,m.lt,n,h),t+=o,e+=a,n+=m.ct}this.re(t>>16,i>>16,m.lt,n,h),t+=o,i+=l,n+=m.ct}else for(s-=r,r-=n,n=this.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.re(e>>16,t>>16,m.lt,n,h),t+=o,e+=a,n+=m.ct}this.re(i>>16,t>>16,m.lt,n,h),t+=o,i+=l,n+=m.ct}else if(e=i<<=16,n<0&&(e-=o*n,i-=l*n,n=0),t<<=16,s<0&&(t-=a*s,s=0),o>16,i>>16,m.lt,n,h),t+=a,i+=l,n+=m.ct}this.re(e>>16,i>>16,m.lt,n,h),e+=o,i+=l,n+=m.ct}else for(r-=s,s-=n,n=this.Mi[n];;){if(--s<0)for(;;){if(--r<0)return;this.re(i>>16,t>>16,m.lt,n,h),t+=a,i+=l,n+=m.ct}this.re(i>>16,e>>16,m.lt,n,h),e+=o,i+=l,n+=m.ct}}else if(rm.bottom&&(s=m.bottom),n>m.bottom&&(n=m.bottom),s>16,t>>16,m.lt,r,h),i+=l,t+=o,r+=m.ct}this.re(i>>16,e>>16,m.lt,r,h),i+=l,e+=a,r+=m.ct}else for(n-=s,s-=r,r=this.Mi[r];;){if(--s<0)for(;;){if(--n<0)return;this.re(t>>16,i>>16,m.lt,r,h),i+=l,t+=o,r+=m.ct}this.re(e>>16,i>>16,m.lt,r,h),i+=l,e+=a,r+=m.ct}else if(t=e<<=16,r<0&&(t-=l*r,e-=a*r,r=0),i<<=16,n<0&&(i-=o*n,n=0),l>16,e>>16,m.lt,r,h),i+=o,e+=a,r+=m.ct}this.re(t>>16,e>>16,m.lt,r,h),t+=l,e+=a,r+=m.ct}else for(s-=n,n-=r,r=this.Mi[r];;){if(--n<0)for(;;){if(--s<0)return;this.re(e>>16,i>>16,m.lt,r,h),i+=o,e+=a,r+=m.ct}this.re(e>>16,t>>16,m.lt,r,h),t+=l,e+=a,r+=m.ct}};static he=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,p,A,_)=>{const g=this.oe(_);this.Hi=!this.Vi[_];const I=a-u,C=c-w,E=f-p,T=d-a,b=y-c,O=A-f;let R=T*c-b*a<<14;const v=b*f-O*c<<8,L=O*a-T*f<<5;let S=I*c-C*a<<14;const x=C*f-E*c<<8,M=E*a-I*f<<5;let k=C*T-I*b<<14;const D=E*b-C*O<<8,N=I*O-E*T<<5;let F=0,B=0;n!==s&&(F=(i-t<<16)/(n-s)|0,B=(o-h<<16)/(n-s)|0);let P=0,U=0;r!==n&&(P=(e-i<<16)/(r-n)|0,U=(l-o<<16)/(r-n)|0);let W=0,G=0;if(r!==s&&(W=(t-e<<16)/(s-r)|0,G=(h-l<<16)/(s-r)|0),s<=n&&s<=r){if(sm.bottom&&(n=m.bottom),r>m.bottom&&(r=m.bottom),nP)for(r-=n,n-=s,s=this.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.le(e>>16,i>>16,m.lt,s,g,0,0,R,S,k,v,x,D,l>>8,o>>8),e+=W,i+=P,l+=G,o+=U,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(e>>16,t>>16,m.lt,s,g,0,0,R,S,k,v,x,D,l>>8,h>>8),e+=W,t+=F,l+=G,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(r-=n,n-=s,s=this.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.le(i>>16,e>>16,m.lt,s,g,0,0,R,S,k,v,x,D,o>>8,l>>8),e+=W,i+=P,l+=G,o+=U,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(t>>16,e>>16,m.lt,s,g,0,0,R,S,k,v,x,D,h>>8,l>>8),e+=W,t+=F,l+=G,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}else{i=t<<=16,o=h<<=16,s<0&&(i-=W*s,t-=F*s,o-=G*s,h-=B*s,s=0),e<<=16,l<<=16,r<0&&(e-=P*r,l-=U*r,r=0);const a=s-this.Di;if(R+=L*a,S+=M*a,k+=N*a,R|=0,S|=0,k|=0,(s===r||W>=F)&&(s!==r||P<=F))for(n-=r,r-=s,s=this.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.le(t>>16,e>>16,m.lt,s,g,0,0,R,S,k,v,x,D,h>>8,l>>8),e+=P,t+=F,l+=U,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(t>>16,i>>16,m.lt,s,g,0,0,R,S,k,v,x,D,h>>8,o>>8),i+=W,t+=F,o+=G,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(n-=r,r-=s,s=this.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.le(e>>16,t>>16,m.lt,s,g,0,0,R,S,k,v,x,D,l>>8,h>>8),e+=P,t+=F,l+=U,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(i>>16,t>>16,m.lt,s,g,0,0,R,S,k,v,x,D,o>>8,h>>8),i+=W,t+=F,o+=G,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}}else if(n<=r){if(nm.bottom&&(r=m.bottom),s>m.bottom&&(s=m.bottom),rW)for(s-=r,r-=n,n=this.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.le(t>>16,e>>16,m.lt,n,g,0,0,R,S,k,v,x,D,h>>8,l>>8),t+=F,e+=W,h+=B,l+=G,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(t>>16,i>>16,m.lt,n,g,0,0,R,S,k,v,x,D,h>>8,o>>8),t+=F,i+=P,h+=B,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(s-=r,r-=n,n=this.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.le(e>>16,t>>16,m.lt,n,g,0,0,R,S,k,v,x,D,l>>8,h>>8),t+=F,e+=W,h+=B,l+=G,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(i>>16,t>>16,m.lt,n,g,0,0,R,S,k,v,x,D,o>>8,h>>8),t+=F,i+=P,h+=B,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}else{e=i<<=16,l=o<<=16,n<0&&(e-=F*n,i-=P*n,l-=B*n,o-=U*n,n=0),t<<=16,h<<=16,s<0&&(t-=W*s,h-=G*s,s=0);const a=n-this.Di;if(R+=L*a,S+=M*a,k+=N*a,R|=0,S|=0,k|=0,r-=s,s-=n,n=this.Mi[n],F>16,i>>16,m.lt,n,g,0,0,R,S,k,v,x,D,h>>8,o>>8),t+=W,i+=P,h+=G,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(e>>16,i>>16,m.lt,n,g,0,0,R,S,k,v,x,D,l>>8,o>>8),e+=F,i+=P,l+=B,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.le(i>>16,t>>16,m.lt,n,g,0,0,R,S,k,v,x,D,o>>8,h>>8),t+=W,i+=P,h+=G,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(i>>16,e>>16,m.lt,n,g,0,0,R,S,k,v,x,D,o>>8,l>>8),e+=F,i+=P,l+=B,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}}else if(rm.bottom&&(s=m.bottom),n>m.bottom&&(n=m.bottom),s>16,t>>16,m.lt,r,g,0,0,R,S,k,v,x,D,o>>8,h>>8),i+=P,t+=F,o+=U,h+=B,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(i>>16,e>>16,m.lt,r,g,0,0,R,S,k,v,x,D,o>>8,l>>8),i+=P,e+=W,o+=U,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.le(t>>16,i>>16,m.lt,r,g,0,0,R,S,k,v,x,D,h>>8,o>>8),i+=P,t+=F,o+=U,h+=B,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(e>>16,i>>16,m.lt,r,g,0,0,R,S,k,v,x,D,l>>8,o>>8),i+=P,e+=W,o+=U,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}else{t=e<<=16,h=l<<=16,r<0&&(t-=P*r,e-=W*r,h-=U*r,l-=G*r,r=0),i<<=16,o<<=16,n<0&&(i-=F*n,o-=B*n,n=0);const a=r-this.Di;if(R+=L*a,S+=M*a,k+=N*a,R|=0,S|=0,k|=0,s-=n,n-=r,r=this.Mi[r],P>16,e>>16,m.lt,r,g,0,0,R,S,k,v,x,D,o>>8,l>>8),i+=F,e+=W,o+=B,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(t>>16,e>>16,m.lt,r,g,0,0,R,S,k,v,x,D,h>>8,l>>8),t+=P,e+=W,h+=U,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.le(e>>16,i>>16,m.lt,r,g,0,0,R,S,k,v,x,D,l>>8,o>>8),i+=F,e+=W,o+=B,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(e>>16,t>>16,m.lt,r,g,0,0,R,S,k,v,x,D,l>>8,h>>8),t+=P,e+=W,h+=U,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}};static le=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w)=>{if(t>=i)return;let y,p,A,_,g,I,C,E,T;if(this.Fi){if(y=(w-d)/(i-t)|0,i>m.ut&&(i=m.ut),t<0&&(d-=t*y,t=0),t>=i)return;p=i-t>>3,y<<=12}else i-t>7?(p=i-t>>3,y=(w-d)*this.vi[p]>>6):(p=0,y=0);if(d<<=9,s+=t,this.Ri&&n)if(A=0,_=0,I=t-this.ki,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(h=l/g|0,(r=o/g|0)<0?r=0:r>4032&&(r=4032)),o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>4032&&(A=4032)),C=A-r>>3,E=_-h>>3,r+=d>>3&786432,T=d>>23,this.Hi){for(;p-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r=A,h=_,o+=c,l+=f,g=(a+=u)>>12,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>4032&&(A=4032)),C=A-r>>3,E=_-h>>3,r+=(d+=y)>>3&786432,T=d>>23;for(p=i-t&7;p-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E}else{for(;p-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>T)&&(e[s]=t),s+=1,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s+=1,r=A,h=_,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>4032&&(A=4032)),C=A-r>>3,E=_-h>>3,r+=(d+=y)>>3&786432,T=d>>23}for(p=i-t&7;p-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>T)&&(e[s]=t),s++,r+=C,h+=E}}else if(A=0,_=0,I=t-this.ki,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(h=l/g|0,(r=o/g|0)<0?r=0:r>16256&&(r=16256)),o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>16256&&(A=16256)),C=A-r>>3,E=_-h>>3,r+=6291456&d,T=d>>23,this.Hi&&n){for(;p-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r=A,h=_,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>16256&&(A=16256)),C=A-r>>3,E=_-h>>3,r+=6291456&(d+=y),T=d>>23;for(p=i-t&7;p-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E}else{for(;p-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>T)&&(e[s]=t),s+=1,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,r=A,h=_,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>16256&&(A=16256)),C=A-r>>3,E=_-h>>3,r+=6291456&(d+=y),T=d>>23}for(p=i-t&7;p-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>T)&&(e[s]=t),s++,r+=C,h+=E}}};static re=(t,i,e,s,n)=>{if(this.Fi&&(i>m.ut&&(i=m.ut),t<0&&(t=0)),t>=i)return;s+=t;let r=i-t>>2;if(0===this.alpha)for(;;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n}e[s++]=n,e[s++]=n,e[s++]=n,e[s++]=n}const h=this.alpha,o=256-this.alpha;for(n=((16711935&n)*o>>8&16711935)+((65280&n)*o>>8&65280);;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}};static te=t=>{this.Pi[t]&&this.Bi&&(this.Bi[this.Ui++]=this.Pi[t],this.Pi[t]=null)};static oe=t=>{if(this.Gi[t]=this.Wi++,this.Pi[t])return this.Pi[t];let i;if(this.Ui>0&&this.Bi)i=this.Bi[--this.Ui],this.Bi[this.Ui]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.lt[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.lt[t]];this.Vi[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.Vi[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}const F=['F11','F12'],B={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}};class P{static enabled=!1;static ae=null;static ce=null;static fe=0;static ue=0;static de=0;static we=0;static ye=0;static me=()=>{this.ae=O.Xt(1),this.ce=null,this.fe=performance.now(),this.enabled=!0};static pe=()=>{this.enabled=!1,this.ae=null};static flush=()=>{let t=null;return this.ce&&this.enabled&&(t=this.ce),this.ce=null,t};static stop=()=>{let t=null;return this.ae&&this.ae.Vt>0&&this.enabled&&(t=this.ae),this.pe(),t};static Ae=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.ue++;const s=performance.now();let n=(s-this.fe)/10|0;n>250&&(n=250),this.fe=s,this._e(5),1===e?this.ae?.p1(1):this.ae?.p1(2),this.ae?.p1(n),this.ae?.p3(t+(i<<10))};static ge=t=>{if(!this.enabled)return;this.ue++;const i=performance.now();let e=(i-this.fe)/10|0;e>250&&(e=250),this.fe=i,this._e(2),1===t?this.ae?.p1(3):this.ae?.p1(4),this.ae?.p1(e)};static Ie=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.de>=50){this.de=e,this.ue++;let s=(e-this.fe)/10|0;s>250&&(s=250),this.fe=e,t-this.we<8&&t-this.we>=-8&&i-this.ye<8&&i-this.ye>=-8?(this._e(3),this.ae?.p1(5),this.ae?.p1(s),this.ae?.p1(t+(i-this.ye+8<<4)+8-this.we)):t-this.we<128&&t-this.we>=-128&&i-this.ye<128&&i-this.ye>=-128?(this._e(4),this.ae?.p1(6),this.ae?.p1(s),this.ae?.p1(t+128-this.we),this.ae?.p1(i+128-this.ye)):(this._e(5),this.ae?.p1(7),this.ae?.p1(s),this.ae?.p3(t+(i<<10))),this.we=t,this.ye=i}};static Ce=t=>{if(!this.enabled)return;this.ue++;const i=performance.now();let e=(i-this.fe)/10|0;e>250&&(e=250),this.fe=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this._e(3),this.ae?.p1(8),this.ae?.p1(e),this.ae?.p1(t)};static Ee=t=>{if(!this.enabled)return;this.ue++;const i=performance.now();let e=(i-this.fe)/10|0;e>250&&(e=250),this.fe=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this._e(3),this.ae?.p1(9),this.ae?.p1(e),this.ae?.p1(t)};static Te=()=>{if(!this.enabled)return;this.ue++;const t=performance.now();let i=(t-this.fe)/10|0;i>250&&(i=250),this.fe=t,this._e(2),this.ae?.p1(10),this.ae?.p1(i)};static be=()=>{if(!this.enabled)return;this.ue++;const t=performance.now();let i=(t-this.fe)/10|0;i>250&&(i=250),this.fe=t,this._e(2),this.ae?.p1(11),this.ae?.p1(i)};static Oe=()=>{if(!this.enabled)return;this.ue++;const t=performance.now();let i=(t-this.fe)/10|0;i>250&&(i=250),this.fe=t,this._e(2),this.ae?.p1(12),this.ae?.p1(i)};static Re=()=>{if(!this.enabled)return;this.ue++;const t=performance.now();let i=(t-this.fe)/10|0;i>250&&(i=250),this.fe=t,this._e(2),this.ae?.p1(13),this.ae?.p1(i)};static _e=t=>{if(this.ae&&this.ae.Vt+t>=500){const t=this.ae;this.ae=O.Xt(1),this.ce=t}}}class U{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}ve=0;Le=[];Se=0;xe=null;state=0;Me=20;ke=1;De=[];Ne=0;Fe=0;Be=[];Pe=!0;Ue=!1;We=50;hasFocus=!0;Ge=!1;Ye=0;He=0;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=[];qe=[];Je=0;$e=0;input=null;Qe=!1;ts=!1;es=!1;time=-1;ss=0;ns=0;rs=0;hs=0;os=0;ls=0;constructor(t=!1){p.tabIndex=-1,A.fillStyle='black',A.fillRect(0,0,p.width,p.height),this.Ue=t,this.Ue?this.resize(window.innerWidth,window.innerHeight):this.resize(p.width,p.height)}get width(){return p.width}get height(){return p.height}resize=(t,i)=>{p.width=t,p.height=i,this.xe=new C(t,i),N.ji()};run=async()=>{p.addEventListener('resize',(()=>{this.Ue&&this.resize(window.innerWidth,window.innerHeight)}),!1),p.onmousedown=this.onmousedown,p.onmouseup=this.onmouseup,p.onmouseenter=this.onmouseenter,p.onmouseleave=this.onmouseleave,p.onmousemove=this.onmousemove,window.onbeforeunload=this.Xi,p.onfocus=this.onfocus,p.onblur=this.onblur,this.cs?(p.ontouchstart=this.ontouchstart,p.ontouchend=this.ontouchend,p.ontouchmove=this.ontouchmove):(p.onkeydown=this.onkeydown,p.onkeyup=this.onkeyup),p.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.cs&&'low'===U.getParameter('detail')&&(this.We=30),await this.fs(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.De[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.us();const r=e,h=s;e=300,s=1,t=performance.now();const o=this.De[i];if(0===o?(e=r,s=h):t>o&&(e=2560*this.Me/(t-o)|0),e<25?e=25:e>256&&(e=256,s=this.Me-(t-o)/10|0),this.De[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.De[t]&&(this.De[t]+=s);for(s0&&(this.Ne=1e3*e/(256*this.Me)|0);const l=performance.now();if(this.Pe&&this.refresh(),await this.draw(),this.Be[this.Fe]=(performance.now()-l)/1e3,this.Fe=(this.Fe+1)%this.Be.length,this.We<50){const i=1e3/this.We-(performance.now()-t);i>0&&await E(i)}}-1===this.state&&this.us()};us=()=>{this.state=-2,this.Xi()};ds=t=>{this.Me=1e3/t|0};ws=t=>{this.We=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.Me|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};Xi=()=>{};draw=async()=>{};refresh=()=>{};async fs(t,i){const e=this.width,s=this.height;this.Pe&&(A.fillStyle='black',A.fillRect(0,0,e,s),this.Pe=!1);const n=s/2-18;A.fillStyle='rgb(140, 17, 17)',A.rect((e/2|0)-152,n,304,34),A.fillRect((e/2|0)-150,n+2,3*t,30),A.fillStyle='black',A.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),A.font='bold 13px helvetica, sans-serif',A.textAlign='center',A.fillStyle='white',A.fillText(i,e/2|0,n+22),await E(5)}ys=()=>{let t=-1;return this.$e!==this.Je&&(t=this.qe[this.Je],this.Je=this.Je+1&127),t};get ms(){const t=this.Be.length;let i=0;for(let e=0;ethis.ve&&(this.ve=e),this.Le[this.Se]=e,this.Se=(this.Se+1)%250,e}get ps(){return this.Le.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.Ye=0;const e=B[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===B.ArrowLeft.code?n=1:s===B.ArrowRight.code?n=2:s===B.ArrowUp.code?n=3:s===B.ArrowDown.code?n=4:s===B.Control.code?n=5:s===B.Shift.code?n=6:s===B.Alt.code?n=7:s===B.Backspace.code||s===B.Delete.code?n=8:s===B.Tab.code?n=9:s===B.Enter.code?n=10:s>=B.F1.code&&s<=B.F12.code?n=s+1008-B.F1.code:s===B.Home.code?n=1e3:s===B.End.code?n=1001:s===B.PageUp.code?n=1002:s===B.PageDown.code&&(n=1003),n>0&&n<128&&(this.Ze[n]=1),n>4&&(this.qe[this.$e]=n,this.$e=this.$e+1&127),P.enabled&&P.Ce(n),F.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.Ye=0;const e=B[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===B.ArrowLeft.code?n=1:s===B.ArrowRight.code?n=2:s===B.ArrowUp.code?n=3:s===B.ArrowDown.code?n=4:s===B.Control.code?n=5:s===B.Shift.code?n=6:s===B.Alt.code?n=7:s===B.Backspace.code||s===B.Delete.code?n=8:s===B.Tab.code?n=9:s===B.Enter.code?n=10:s>=B.F1.code&&s<=B.F12.code?n=s+1008-B.F1.code:s===B.Home.code?n=1e3:s===B.End.code?n=1001:s===B.PageUp.code?n=1002:s===B.PageDown.code&&(n=1003),n>0&&n<128&&(this.Ze[n]=0),P.enabled&&P.Ee(n),F.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.Qe=!1,(t.clientX>0||t.clientY>0)&&this.As(t),this.Ye=0,this.je=this.Ve,this.ze=this.Ke,this.cs&&!this._s){if(this.gs()||this.Is()||this.Cs())return this.Xe=1,void(this.He=1);t.timeStamp>=this.time+500?(this.Xe=2,this.He=2):(this.Xe=1,this.He=1)}else 2===t.button?(this.Xe=2,this.He=2):(this.Xe=1,this.He=1);P.enabled&&P.Ae(this.je,this.ze,t.buttons)};onmouseup=t=>{this.As(t),this.Ye=0,this.He=0,P.enabled&&P.ge(t.buttons)};onmouseenter=t=>{this.As(t),P.enabled&&P.Oe()};onmouseleave=t=>{this.As(t),this.Ye=0,this.Ve=-1,this.Ke=-1,this.He=0,this.je=-1,this.ze=-1,P.enabled&&P.Re()};onmousemove=t=>{this.As(t),this.Ye=0,P.enabled&&P.Ie(this.Ve,this.Ke)};onfocus=t=>{this.hasFocus=!0,this.Pe=!0,this.refresh(),P.enabled&&P.Te()};onblur=t=>{this.hasFocus=!1,P.enabled&&P.be()};ontouchstart=t=>{if(!this.cs)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.Qe=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.ss=this.os=this.rs=0|i.screenX,this.ns=this.ls=this.hs=0|i.screenY,this.time=t.timeStamp,this.ts=this.Es(),this.es=this.Ts()};ontouchend=t=>{if(!this.cs||!this.Qe)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.os=0|i.screenX,this.ls=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.ts&&!this.Es())return void(this.Qe=!1);if(this.es&&!this.Ts())return void(this.Qe=!1);if(this.gs()||this.bs()||this.Is()||this.Cs()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.Is()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.Cs()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.gs()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.bs()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.Os?t.setAttribute('type','password'):t.setAttribute('type',this.Cs()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.Os&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.Os&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.Os&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.Qe=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.ss-this.os)>16||Math.abs(this.ns-this.ls)>16;n&&!r?(this.Qe=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.He=0,this.Qe=!1)};ontouchmove=t=>{if(!this.cs||!this.Qe)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.os=0|i.screenX,this.ls=0|i.screenY,this.ts&&-1===this.Rs()?(this.rs-this.os>0?this.rotate(2):this.rs-this.os<0&&this.rotate(0),this.hs-this.ls>0?this.rotate(3):this.hs-this.ls<0&&this.rotate(1)):(this.es||-1!==this.Rs())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.rs=this.os,this.hs=this.ls};get cs(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get Os(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get _s(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}Es=()=>this.Ge&&this.Ve>=8&&this.Ve<=520&&this.Ke>=11&&this.Ke<=345;gs=()=>this.Ge&&-1===this.vs()&&!this.Ls()&&!this.Ss()&&this.Ve>=11&&this.Ve<=506&&this.Ke>=449&&this.Ke<=482;bs=()=>this.Ge&&(this.Ls()||this.Ss())&&this.Ve>=11&&this.Ve<=506&&this.Ke>=383&&this.Ke<=482;Ts=()=>this.Ge&&this.Ve>=562&&this.Ve<=752&&this.Ke>=231&&this.Ke<=492;Is=()=>!this.Ge&&2===this.xs()&&this.Ve>=301&&this.Ve<=562&&this.Ke>=262&&this.Ke<=279;Cs=()=>!this.Ge&&2===this.xs()&&this.Ve>=301&&this.Ve<=562&&this.Ke>=279&&this.Ke<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};Ms=()=>null!==document.fullscreenElement;As=t=>{if(this.Ms()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/p.height,s=(window.innerWidth-p.width*e)/2;this.Ve=0|this.ks(t.clientX-i.left-s,0,p.width*e,0,789),this.Ke=0|this.ks(t.clientY-i.top,0,p.height*e,0,532)}else{const i=p.getBoundingClientRect(),e=p.width/i.width,s=p.height/i.height;this.Ve=(t.clientX-i.left)*e|0,this.Ke=(t.clientY-i.top)*s|0}this.Ve<0&&(this.Ve=0),this.Ke<0&&(this.Ke=0),this.Ve>789&&(this.Ve=789),this.Ke>532&&(this.Ke=532)};ks=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}class W{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));Ds=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Ns=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};Fs=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}class G{static Fs=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.Ps)return null;if(this.Hs[t])return this.Hs[t];const e=this.Ys[t],s=e+this.Gs[t];if(this.Bs){const i=Uint8Array.from(this.buffer.subarray(e,e+s));return this.Hs[t]=i,i}{const e=Uint8Array.from(i.read(this.Ws[t],this.buffer,this.Gs[t],this.Ys[t]));return this.Hs[t]=e,e}}}class Y{static Ks=new Uint8Array(520);Xs;js;store;constructor(t,i,e){this.Xs=new O(t),this.js=new O(i),this.store=e+1}get Ps(){return this.js.length/6}read(t,i=!1){this.js.Vt=6*t;const e=this.js.Jt;let s=this.js.Jt;if(s<=0||s>this.Xs.length/520)return null;const n=new Uint8Array(e);let r=0;for(let i=0;r512&&(h=512),this.Xs.si(h+8,0,Y.Ks);const o=(255&Y.Ks[0])<<8|255&Y.Ks[1],l=(255&Y.Ks[2])<<8|255&Y.Ks[3],a=(255&Y.Ks[4])<<16|(255&Y.Ks[5])<<8|255&Y.Ks[6],c=255&Y.Ks[7];if(o!==t||l!==i||c!==this.store)return null;if(a<0||a>this.Xs.length/520)return null;for(let t=0;t>>0;if(h.free_u8(e,a),4294967295===s){const t=h.error_message(),i=h.error_message_len(),e=new Uint8Array(h.memory.buffer,t,i),s=(new TextDecoder).decode(e);throw new l(s)}const n=h.buffer()>>>0;return new Uint8Array(h.memory.buffer,n,s)}(n)}}class H{static zs=[];static Zs=t=>{const i=new O(t.read('base_head.dat')),e=new O(t.read('base_type.dat')),s=new O(t.read('base_label.dat')),n=i.Zt;i.Vt+=2;for(let t=0;t{const i=new O(t.read('frame_head.dat')),e=new O(t.read('frame_tran1.dat')),s=new O(t.read('frame_tran2.dat')),n=new O(t.read('frame_del.dat')),r=i.Zt;i.Vt+=2;const h=new Int32Array(500),o=new Int32Array(500),l=new Int32Array(500),a=new Int32Array(500);for(let t=0;t0){if(0!==f.types[t])for(let i=t-1;i>d;i--)if(0===f.types[i]){h[w]=i,o[w]=0,l[w]=0,a[w]=0,w++;break}h[w]=t;let e=0;3===f.types[h[w]]&&(e=128),o[w]=1&i?s.ti:e,l[w]=2&i?s.ti:e,a[w]=4&i?s.ti:e,d=t,w++}}r.length=w,r.Js=new Int32Array(w),r.x=new Int32Array(w),r.y=new Int32Array(w),r.z=new Int32Array(w);for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static ir=(t,i,e)=>{const s=t.$s,n=t.Qs,r=t.tn;let h,o,l,a,c;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.$s,r=t.Qs,h=t.tn;let o,l,a,c,f;if(s)o=t.cr,l=t.er,a=t.ur;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let i=0;i{const e=t.$s,s=t.Qs,n=t.tn,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.cr[i],a=t.er[i],c=t.ur[i];for(let t=0;t{if(!j.metadata)throw new Error('cant loading model metadata!!!!!');const i=j.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(j.head&&j.mn&&j.pn&&j.An&&j._n&&j.gn&&j.In&&j.Cn&&j.En&&j.Tn&&j.bn&&j.On&&j.Rn&&j.axis))throw new Error('cant loading model!!!!!');const e=i.$s,s=i.Qs,n=i.tn,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),l=new Int32Array(s),a=new Int32Array(s),c=new Int32Array(s),f=new Int32Array(n),u=new Int32Array(n),d=new Int32Array(n);let w=null;i.hn>=0&&(w=new Int32Array(e));let y=null;i.fn>=0&&(y=new Int32Array(s));let m=null,p=0;i.un>=0?m=new Int32Array(s):p=-i.un-1;let A=null;i.dn>=0&&(A=new Int32Array(s));let _=null;i.wn>=0&&(_=new Int32Array(s));const g=new Int32Array(s);j.In.Vt=i.en,j.Cn.Vt=i.sn,j.En.Vt=i.nn,j.Tn.Vt=i.rn,j.bn.Vt=i.hn;let I,C,E,T=0,b=0,O=0;for(let t=0;t{if(!j.metadata||!j.metadata[i])throw new Error('No model metadata');const e=j.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const s=e.$s,n=e.Qs,r=e.tn,h=new Int32Array(s),o=new Int32Array(s),l=new Int32Array(s),a=new Int32Array(n),c=new Int32Array(n),f=new Int32Array(n),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(r);let y=null;e.hn>=0&&(y=new Int32Array(s));let m=null;e.fn>=0&&(m=new Int32Array(n));let p=null,A=0;e.un>=0?p=new Int32Array(n):A=-e.un-1;let _=null;e.dn>=0&&(_=new Int32Array(n));let g=null;e.wn>=0&&(g=new Int32Array(n));const I=new Int32Array(n),C=new O(e.data);C.Vt=e.en;const E=new O(e.data);E.Vt=e.sn;const T=new O(e.data);T.Vt=e.nn;const b=new O(e.data);b.Vt=e.rn;const R=new O(e.data);R.Vt=e.hn;let v,L,S,x=0,M=0,k=0;for(let t=0;tthis.vr&&(this.vr=-e),e>this.Rr&&(this.Rr=e);const n=i*i+s*s;n>this.Or&&(this.Or=n)}this.Or=Math.sqrt(this.Or)+.99|0,this.Sr=Math.sqrt(this.Or*this.Or+this.vr*this.vr)+.99|0,this.Lr=this.Sr+(Math.sqrt(this.Or*this.Or+this.Rr*this.Rr)+.99|0)}Xr(){this.vr=0,this.Rr=0;for(let t=0;tthis.vr&&(this.vr=-i),i>this.Rr&&(this.Rr=i)}this.Sr=Math.sqrt(this.Or*this.Or+this.vr*this.vr)+.99|0,this.Lr=this.Sr+(Math.sqrt(this.Or*this.Or+this.Rr*this.Rr)+.99|0)}jr(){if(this.kr){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Fr=new v(i+1,null);for(let e=0;e<=i;e++)this.Fr[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Br=new v(i+1,null);for(let e=0;e<=i;e++)this.Br[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;eo;)o=e[h++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==o||0===r.types[i])&&this.Zr(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}j.Xn=0,j.jn=0,j.zn=0,h=0,o=e[h++];for(let t=0;to;)o=e[h++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===o||0===r.types[i])&&this.Zr(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.qr(t)}qr(t){if(!this.Fr||-1===t||!V.zs[t])return;const i=V.zs[t],e=i.qs;j.Xn=0,j.jn=0,j.zn=0;for(let t=0;t>16;this.ur[t]=this.er[t]*i+this.ur[t]*e>>16,this.er[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.sr&&this.nr&&this.rr||(this.sr=new Int32Array(this.Qs),this.nr=new Int32Array(this.Qs),this.rr=new Int32Array(this.Qs)),!this.lr){this.lr=new v(this.$s,null);for(let t=0;t8192||m>8192||p>8192||y<-8192||m<-8192||p<-8192;)y>>=1,m>>=1,p>>=1;let A=0|Math.sqrt(y*y+m*m+p*p);if(A<=0&&(A=1),y=256*y/A|0,m=256*m/A|0,p=256*p/A|0,this.hr&&1&this.hr[i]){const r=t+((e*y+s*m+n*p)/(h+(h/2|0))|0);this.Ar&&(this.sr[i]=j.tr(this.Ar[i],r,this.hr[i]))}else{let t=this.lr[r];t&&(t.x+=y,t.y+=m,t.z+=p,t.w++),t=this.lr[o],t&&(t.x+=y,t.y+=m,t.z+=p,t.w++),t=this.lr[l],t&&(t.x+=y,t.y+=m,t.z+=p,t.w++)}}if(r)this.eh(t,h,e,s,n);else{this.ar=new v(this.$s,null);for(let t=0;t>16;for(let s=0;s>16,A=A*u-p*f>>16,p=m),0!==t&&(m=A*l-_*o>>16,_=A*o+_*l>>16,A=m),0!==i&&(m=_*a+p*c>>16,_=_*c-p*a>>16,p=m),p+=n,A+=r,_+=h,m=A*w-_*d>>16,_=A*d+_*w>>16,A=m,j.Sn&&j.xn&&j.Mn&&(j.Mn[s]=_-y,j.Sn[s]=N.ki+((p<<9)/_|0),j.xn[s]=N.Di+((A<<9)/_|0)),this.tn>0&&j.kn&&j.Dn&&j.Nn&&(j.kn[s]=p,j.Dn[s]=A,j.Nn[s]=_)}try{this.rh(!1,!1,0)}catch(t){}}draw(t,i,e,s,n,r,h,o,l){const a=o*n-r*s>>16,c=h*i+a*e>>16,f=this.Or*e>>16,u=c+f;if(u<=50||c>=3500)return;const d=o*s+r*n>>16;let w=d-this.Or<<9;if((w/u|0)>=m.dt)return;let y=d+this.Or<<9;if((y/u|0)<=-m.dt)return;const p=h*e-a*i>>16,A=this.Or*i>>16;let _=p+A<<9;if((_/u|0)<=-m.wt)return;let g=p-(A+(this.vr*e>>16))<<9;if((g/u|0)>=m.wt)return;let I=c-(f+(this.vr*i>>16))<=50,C=!1;if(l>0&&j.Zn){let t=c-f;t<=50&&(t=50),d>0?(w=w/u|0,y=y/t|0):(y=y/u|0,w=w/t|0),p>0?(g=g/u|0,_=_/t|0):(_=_/u|0,g=g/t|0);const i=j.Ve-N.ki,e=j.Ke-N.Di;i>w&&ig&&e<_&&(this.Hr?j.Jn[j.qn++]=l:C=!0)}const E=N.ki,T=N.Di;let b=0,O=0;0!==t&&(b=N.sin[t],O=N.cos[t]);for(let l=0;l>16,d=d*O-f*b>>16,f=a),f+=r,u+=h,d+=o,a=d*s+f*n>>16,d=d*n-f*s>>16,f=a,a=u*e-d*i>>16,d=u*i+d*e>>16,u=a,j.Mn&&(j.Mn[l]=d-c),d>=50&&j.Sn&&j.xn?(j.Sn[l]=E+((f<<9)/d|0),j.xn[l]=T+((u<<9)/d|0)):j.Sn&&(j.Sn[l]=-5e3,I=!0),(I||this.tn>0)&&j.kn&&j.Dn&&j.Nn&&(j.kn[l]=f,j.Dn[l]=u,j.Nn[l]=d)}try{this.rh(I,C,l)}catch(t){}}rh(t,i,e,s=!1){j.$n&&(this.Vr=-1,this.Kr=-1);for(let t=0;tm.ut||l>m.ut||a>m.ut),j.Bn&&j.Fn){const t=((d+w+y)/3|0)+this.Sr;j.Bn[t][j.Fn[t]++]=s,j.$n&&this.hh(j.Ve,j.Ke,c,f,u,o,l,a)&&this.Kr=0;t--){const i=j.Fn[t];if(!(i<=0)&&j.Bn){const e=j.Bn[t];for(let t=0;t=0;t--){const i=j.Fn[t];if(i>0&&j.Bn){const e=j.Bn[t];for(let s=0;s0||j.Pn[2]>0)&&(n=(j.Yn[1]+j.Yn[2])/(j.Pn[1]+j.Pn[2])|0);let r=0;j.Pn&&j.Yn&&(j.Pn[3]>0||j.Pn[4]>0)&&(r=(j.Yn[3]+j.Yn[4])/(j.Pn[3]+j.Pn[4])|0);let h=0;if(j.Pn&&j.Yn&&(j.Pn[6]>0||j.Pn[8]>0)&&(h=(j.Yn[6]+j.Yn[8])/(j.Pn[6]+j.Pn[8])|0),j.Pn&&j.Un){let t,i=0,e=j.Pn[10],o=j.Un[10],l=j.Wn;i===e&&(i=0,e=j.Pn[11],o=j.Un[11],l=j.Gn),t=in;)try{this.oh(o[i++],s),i===e&&o!==j.Un[11]&&(i=0,e=j.Pn[11],o=j.Un[11],l=j.Gn),t=ir;)try{this.oh(o[i++],s),i===e&&o!==j.Un[11]&&(i=0,e=j.Pn[11],o=j.Un[11],l=j.Gn),t=ih;)try{this.oh(o[i++],s),i===e&&o!==j.Un[11]&&(i=0,e=j.Pn[11],o=j.Un[11],l=j.Gn),t=i>2,r=this._r[i],h=this.gr[i],o=this.Ir[i];N.he(j.Sn[e],j.Sn[s],j.Sn[n],j.xn[e],j.xn[s],j.xn[n],this.sr[t],this.nr[t],this.rr[t],j.kn[r],j.Dn[r],j.Nn[r],j.kn[h],j.kn[o],j.Dn[h],j.Dn[o],j.Nn[h],j.Nn[o],this.Ar[t])}else if(3===r&&this.hr&&this.Ar&&this.sr&&j.Sn&&j.xn&&j.kn&&j.Dn&&j.Nn){const i=this.hr[t]>>2,r=this._r[i],h=this.gr[i],o=this.Ir[i];N.he(j.Sn[e],j.Sn[s],j.Sn[n],j.xn[e],j.xn[s],j.xn[n],this.sr[t],this.sr[t],this.sr[t],j.kn[r],j.Dn[r],j.Nn[r],j.kn[h],j.kn[o],j.Dn[h],j.Dn[o],j.Nn[h],j.Nn[o],this.Ar[t])}}lh(t,i=!1){let e=0;if(j.Nn){const i=N.ki,s=N.Di,n=this.dr[t],r=this.wr[t],h=this.yr[t],o=j.Nn[n],l=j.Nn[r],a=j.Nn[h];if(o>=50&&j.Sn&&j.xn&&this.sr)j.Hn[e]=j.Sn[n],j.Vn[e]=j.xn[n],j.Kn[e++]=this.sr[t];else if(j.kn&&j.Dn&&this.sr){const c=j.kn[n],f=j.Dn[n],u=this.sr[t];if(a>=50&&this.rr){const n=(50-o)*N.Li[a-o];j.Hn[e]=i+((c+((j.kn[h]-c)*n>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[h]-f)*n>>16)<<9)/50|0),j.Kn[e++]=u+((this.rr[t]-u)*n>>16)}if(l>=50&&this.nr){const n=(50-o)*N.Li[l-o];j.Hn[e]=i+((c+((j.kn[r]-c)*n>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[r]-f)*n>>16)<<9)/50|0),j.Kn[e++]=u+((this.nr[t]-u)*n>>16)}}if(l>=50&&j.Sn&&j.xn&&this.nr)j.Hn[e]=j.Sn[r],j.Vn[e]=j.xn[r],j.Kn[e++]=this.nr[t];else if(j.kn&&j.Dn&&this.nr){const c=j.kn[r],f=j.Dn[r],u=this.nr[t];if(o>=50&&this.sr){const r=(50-l)*N.Li[o-l];j.Hn[e]=i+((c+((j.kn[n]-c)*r>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[n]-f)*r>>16)<<9)/50|0),j.Kn[e++]=u+((this.sr[t]-u)*r>>16)}if(a>=50&&this.rr){const n=(50-l)*N.Li[a-l];j.Hn[e]=i+((c+((j.kn[h]-c)*n>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[h]-f)*n>>16)<<9)/50|0),j.Kn[e++]=u+((this.rr[t]-u)*n>>16)}}if(a>=50&&j.Sn&&j.xn&&this.rr)j.Hn[e]=j.Sn[h],j.Vn[e]=j.xn[h],j.Kn[e++]=this.rr[t];else if(j.kn&&j.Dn&&this.rr){const c=j.kn[h],f=j.Dn[h],u=this.rr[t];if(l>=50&&this.nr){const n=(50-a)*N.Li[l-a];j.Hn[e]=i+((c+((j.kn[r]-c)*n>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[r]-f)*n>>16)<<9)/50|0),j.Kn[e++]=u+((this.nr[t]-u)*n>>16)}if(o>=50&&this.sr){const r=(50-a)*N.Li[o-a];j.Hn[e]=i+((c+((j.kn[n]-c)*r>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[n]-f)*r>>16)<<9)/50|0),j.Kn[e++]=u+((this.sr[t]-u)*r>>16)}}}const s=j.Hn[0],n=j.Hn[1],r=j.Hn[2],h=j.Vn[0],o=j.Vn[1],l=j.Vn[2];if(!((s-n)*(l-o)-(h-o)*(r-n)<=0))if(N.Fi=!1,3===e){let e;if((s<0||n<0||r<0||s>m.ut||n>m.ut||r>m.ut)&&(N.Fi=!0),e=this.hr?3&this.hr[t]:0,i)N.Ct(s,n,h,o,j.Kn[0]),N.Ct(n,r,o,l,j.Kn[1]),N.Ct(r,s,l,h,j.Kn[2]);else if(0===e)N.ee(s,n,r,h,o,l,j.Kn[0],j.Kn[1],j.Kn[2]);else if(1===e&&this.sr)N.ne(s,n,r,h,o,l,N.palette[this.sr[t]]);else if(2===e&&this.hr&&this.Ar&&j.kn&&j.Dn&&j.Nn){const i=this.hr[t]>>2,e=this._r[i],a=this.gr[i],c=this.Ir[i];N.he(s,n,r,h,o,l,j.Kn[0],j.Kn[1],j.Kn[2],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t])}else if(3===e&&this.hr&&this.Ar&&this.sr&&j.kn&&j.Dn&&j.Nn){const i=this.hr[t]>>2,e=this._r[i],a=this.gr[i],c=this.Ir[i];N.he(s,n,r,h,o,l,this.sr[t],this.sr[t],this.sr[t],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t])}}else if(4===e){let e;if((s<0||n<0||r<0||s>m.ut||n>m.ut||r>m.ut||j.Hn[3]<0||j.Hn[3]>m.ut)&&(N.Fi=!0),e=this.hr?3&this.hr[t]:0,i)N.Ct(s,n,h,o,j.Kn[0]),N.Ct(n,r,o,l,j.Kn[1]),N.Ct(r,j.Hn[3],l,j.Vn[3],j.Kn[2]),N.Ct(j.Hn[3],s,j.Vn[3],h,j.Kn[3]);else if(0===e)N.ee(s,n,r,h,o,l,j.Kn[0],j.Kn[1],j.Kn[2]),N.ee(s,r,j.Hn[3],h,l,j.Vn[3],j.Kn[0],j.Kn[2],j.Kn[3]);else if(1===e){if(this.sr){const i=N.palette[this.sr[t]];N.ne(s,n,r,h,o,l,i),N.ne(s,r,j.Hn[3],h,l,j.Vn[3],i)}}else if(2===e&&this.hr&&this.Ar&&j.kn&&j.Dn&&j.Nn){const i=this.hr[t]>>2,e=this._r[i],a=this.gr[i],c=this.Ir[i];N.he(s,n,r,h,o,l,j.Kn[0],j.Kn[1],j.Kn[2],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t]),N.he(s,r,j.Hn[3],h,l,j.Vn[3],j.Kn[0],j.Kn[2],j.Kn[3],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t])}else if(3===e&&this.hr&&this.Ar&&this.sr&&j.kn&&j.Dn&&j.Nn){const i=this.hr[t]>>2,e=this._r[i],a=this.gr[i],c=this.Ir[i];N.he(s,n,r,h,o,l,this.sr[t],this.sr[t],this.sr[t],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t]),N.he(s,r,j.Hn[3],h,l,j.Vn[3],this.sr[t],this.sr[t],this.sr[t],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t])}}}Zr(t,i,e,s,n){if(!s)return;const r=s.length;if(0===n){let n=0;j.Xn=0,j.jn=0,j.zn=0;for(let t=0;t0?(j.Xn=(j.Xn/n|0)+t,j.jn=(j.jn/n|0)+i,j.zn=(j.zn/n|0)+e):(j.Xn=t,j.jn=i,j.zn=e)}else if(1===n)for(let n=0;n=this.Fr.length)continue;const h=this.Fr[r];if(h)for(let s=0;s=this.Fr.length)continue;const h=this.Fr[r];if(h)for(let s=0;s>16;this.er[n]=this.er[n]*c-this.cr[n]*a>>16,this.cr[n]=t}if(0!==r){a=N.sin[r],c=N.cos[r];const t=this.er[n]*c-this.ur[n]*a>>16;this.ur[n]=this.er[n]*a+this.ur[n]*c>>16,this.er[n]=t}if(0!==o){a=N.sin[o],c=N.cos[o];const t=this.ur[n]*a+this.cr[n]*c>>16;this.ur[n]=this.ur[n]*c-this.cr[n]*a>>16,this.cr[n]=t}this.cr[n]+=j.Xn,this.er[n]+=j.jn,this.ur[n]+=j.zn}}else if(3===n)for(let n=0;n=this.Fr.length)continue;const h=this.Fr[r];if(h)for(let s=0;s=this.Br.length)continue;const n=this.Br[e];if(n)for(let i=0;i255&&(this.pr[e]=255)}}}sh(){this.vr=0,this.Or=0,this.Rr=0,this.Cr=999999,this.Er=-999999,this.br=-99999,this.Tr=99999;for(let t=0;tthis.Er&&(this.Er=i),sthis.br&&(this.br=s),-e>this.vr&&(this.vr=-e),e>this.Rr&&(this.Rr=e);const n=i*i+s*s;n>this.Or&&(this.Or=n)}this.Or=0|Math.sqrt(this.Or),this.Sr=0|Math.sqrt(this.Or*this.Or+this.vr*this.vr),this.Lr=this.Sr+(0|Math.sqrt(this.Or*this.Or+this.Rr*this.Rr))}hh(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(g.src),g.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>g.onload=()=>t())),I.clearRect(0,0,_.width,_.height);const i=g.naturalWidth,e=g.naturalHeight;return _.width=i,_.height=e,I.drawImage(g,0,0),I.getImageData(0,0,i,e)})(e),n=new J(s.width,s.height),r=new Uint32Array(s.data.buffer),h=n.lt;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static gi=(t,i,e=0)=>{const s=new O(t.read(i+'.dat')),n=new O(t.read('index.dat'));n.Vt=s.Zt;const r=n.Zt,h=n.Zt,o=[],l=n.jt-1;for(let t=0;ts.length||n.Vt>n.length)throw new Error;const a=n.jt,c=n.jt,f=n.Zt,u=n.Zt,d=new J(f,u);d.mi=a,d.pi=c,d.Ai=r,d._i=h;const w=n.jt;if(0===w){const t=d.width*d.height;for(let i=0;im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.mh(r,n,this.lt,s,o,m.lt,e,h)}ph(t,i,e){i|=0,e|=0;let s=(i+=this.mi)+(e+=this.pi)*m.ct,n=0,r=this.height,h=this.width,o=m.ct-h,l=0;if(em.bottom&&(r-=e+r-m.bottom),im.right){const t=i+h-m.right;h-=t,l+=t,o+=t}h>0&&r>0&&this.Ah(h,r,this.lt,n,l,m.lt,s,o,t)}_h(t,i){t|=0,i|=0;let e=(t+=this.mi)+(i+=this.pi)*m.ct,s=0,n=this.height,r=this.width,h=m.ct-r,o=0;if(im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.gh(r,n,this.lt,s,o,m.lt,e,h)}Ci(){const t=this.lt,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.lt[s]=(r<<16)+(h<<8)+o}}}bi(t,i,e,s){t|=0,i|=0,e|=0,s|=0;try{const n=this.width;let r=0,h=0;const o=this.Ai,l=this._i,a=(o<<16)/e|0,c=(l<<16)/s|0;t+=(this.mi*e+o-1)/o|0,i+=(this.pi*s+l-1)/l|0,this.mi*e%o!=0&&(r=(o-this.mi*e%o<<16)/e|0),this.pi*s%l!=0&&(h=(l-this.pi*s%l<<16)/s|0),e=e*(this.width-(r>>16))/o|0,s=s*(this.height-(h>>16))/l|0;let f=t+i*m.ct,u=m.ct-e;if(im.bottom&&(s-=i+s-m.bottom),tm.right){const i=t+e-m.right;e-=i,u+=i}this.scale(e,s,this.lt,r,h,m.lt,u,f,n,a,c)}catch(t){console.error('error in sprite clipping routine')}}Ih(t,i,e,s,n,r,h,o,l,a){t|=0,i|=0,e|=0,s|=0;try{const c=-e/2|0,f=-s/2|0,u=65536*Math.sin(l/326.11)|0,d=65536*Math.cos(l/326.11)|0,w=u*a>>8,y=d*a>>8;let p=(h<<16)+f*w+c*y,A=f*y-c*w+(o<<16),_=t+i*m.ct;for(let t=0;t>16)+(h>>16)*this.width],s+=y,h-=w;p+=w,A+=y,_+=m.ct}}catch(t){}}Ch(t,i,e){t|=0,i|=0;let s=(t+=this.mi)+(i+=this.pi)*m.ct,n=0,r=this.height,h=this.width,o=m.ct-h,l=0;if(im.bottom&&(r-=i+r-m.bottom),tm.right){const i=t+h-m.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.Eh(h,r,this.lt,l,n,m.lt,s,o,e.lt)}scale(t,i,e,s,n,r,h,o,l,a,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*l;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=a}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}gh(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}Ah(t,i,e,s,n,r,h,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}h+=o,s+=n}}mh(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}Eh(t,i,e,s,n,r,h,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++}h+=o,n+=s}}}class ${static Th=['_','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','0','1','2','3','4','5','6','7','8','9'];static bh=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static Oh=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.Th[Number(s-37n*t)]}return e.slice(12-i).join('')};static Rh=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static Lh=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static xh=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static Mh=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}class Q{static zs=[];static kh=null;static Dh=null;static Nh=0;static Fh=1;static Bh=2;static Ph=3;static Uh=4;static Wh=5;static Gh=6;static Yh=7;static Hh=1;static Vh=2;static Kh=3;static Xh=4;static jh=5;static zh=6;static Zh=1;static qh=100;static Jh=101;static $h=200;static Qh=201;static io=202;static eo=203;static so=205;static no=300;static ro=301;static ho=302;static oo=303;static lo=304;static ao=305;static co=306;static fo=307;static uo=308;static do=309;static wo=310;static yo=311;static mo=312;static po=313;static Ao=314;static _o=315;static Io=316;static Co=317;static Eo=318;static To=319;static bo=320;static Oo=321;static Ro=322;static vo=323;static Lo=324;static So=325;static xo=326;static Mo=327;static ko=401;static Do=500;static No=501;static Fo=502;static Bo=503;static Po=600;static Uo=601;static Wo=602;static Go=603;static Yo=604;static Ho=605;static Vo=606;static Ko=607;static Xo=608;static jo=609;static zo=610;static Zo=611;static qo=612;static Jo=613;static $o=650;static Qo=651;static tl=652;static il=653;static el=654;static sl=655;static Zs=(t,i,e)=>{this.kh=new q(5e4),this.Dh=new q(5e4);const s=new O(t.read('data'));let n=-1;for(s.Vt+=2;s.Vt0){r.ll=new Uint8Array(h),r.al=new Uint16Array(h);for(let t=0;t0){r.scripts=new v(o,null);for(let t=0;t0){const s=e.lastIndexOf(',');r.Il[t]=this.Cl(i,e.substring(0,s),parseInt(e.substring(s+1),10))}}r.El=new v(5,null);for(let t=0;t<5;t++){const i=s.ei;r.El[t]=i,0===i.length&&(r.El[t]=null)}}if(r.type===Q.Ph&&(r.fill=1===s.jt),r.type===Q.Uh||r.type===Q.Fh){r.Tl=1===s.jt;const t=s.jt;e&&(r.font=e[t]),r.bl=1===s.jt}if(r.type===Q.Uh&&(r.text=s.ei,r.Ol=s.ei),r.type!==Q.Fh&&r.type!==Q.Ph&&r.type!==Q.Uh||(r.Rl=s.$t),r.type!==Q.Ph&&r.type!==Q.Uh||(r.vl=s.$t,r.Ll=s.$t),r.type===Q.Wh){const t=s.ei;if(t.length>0){const e=t.lastIndexOf(',');r.Sl=this.Cl(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=s.ei;if(e.length>0){const t=e.lastIndexOf(',');r.xl=this.Cl(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(r.type===Q.Gh){const t=s.jt;0!==t&&(r.model=this.Ml((t-1<<8)+s.jt));const i=s.jt;0!==i&&(r.kl=this.Ml((i-1<<8)+s.jt)),r.Dl=s.jt,0===r.Dl?r.Dl=-1:r.Dl=(r.Dl-1<<8)+s.jt,r.Nl=s.jt,0===r.Nl?r.Nl=-1:r.Nl=(r.Nl-1<<8)+s.jt,r.zoom=s.Zt,r.Fl=s.Zt,r.Bl=s.Zt}if(r.type===Q.Yh){r.dl=new Int32Array(r.width*r.height),r.wl=new Int32Array(r.width*r.height),r.Tl=1===s.jt;const t=s.jt;e&&(r.font=e[t]),r.bl=1===s.jt,r.Rl=s.$t,r.pl=s.qt,r.Al=s.qt,r.yl=1===s.jt,r.El=new v(5,null);for(let t=0;t<5;t++){const i=s.ei;r.El[t]=i,0===i.length&&(r.El[t]=null)}}r.rl!==Q.Vh&&r.type!==Q.Bh||(r.Pl=s.ei,r.action=s.ei,r.Ul=s.Zt),r.rl!==Q.Hh&&r.rl!==Q.Xh&&r.rl!==Q.jh&&r.rl!==Q.zh||(r.Wl=s.ei,0===r.Wl.length&&(r.rl===Q.Hh?r.Wl='Ok':r.rl===Q.Xh||r.rl===Q.jh?r.Wl='Select':r.rl===Q.zh&&(r.Wl='Continue')))}this.kh=null,this.Dh=null};static Cl=(t,i,e)=>{const s=$.Mh(i)<<8n|BigInt(e);if(this.kh){const t=this.kh.get(s);if(t)return t}let n;try{n=J.gi(t,i,e),this.kh?.put(s,n)}catch(t){return null}return n};static Ml=t=>{if(this.Dh){const i=this.Dh.get(BigInt(t));if(i)return i}const i=j.model(t);return this.Dh?.put(BigInt(t),i),i};id=-1;nl=-1;type=-1;rl=-1;hl=0;width=0;height=0;ol=-1;ll=null;al=null;scripts=null;scroll=0;hide=!1;draggable=!1;yl=!1;ml=!1;pl=0;Al=0;_l=null;gl=null;Il=null;El=null;fill=!1;Tl=!1;font=null;bl=!1;text=null;Ol=null;Rl=0;vl=0;Ll=0;Sl=null;xl=null;model=null;kl=null;Dl=-1;Nl=-1;zoom=0;Fl=0;Bl=0;Pl=null;action=null;Ul=-1;Wl=null;cl=null;fl=null;ul=null;x=0;y=0;Gl=0;dl=null;wl=null;Yl=0;Hl=0;Ml(t,i,e){let s=this.model;if(e&&(s=this.kl),!s)return null;if(-1===t&&-1===i&&!s.Ar)return s;const n=j.Mr(s,!0,!0,!1);return-1===t&&-1===i||n.jr(),-1!==t&&n.qr(t),-1!==i&&n.qr(i),n.ih(64,768,-50,-10,-50,!0),n}Vl(){if(this.nl===this.id)return this.x;let t=Q.zs[this.nl];if(!t.cl||!t.fl||!t.ul)return this.x;let i=t.cl.indexOf(this.id);if(-1===i)return this.x;let e=t.fl[i];for(;t.nl!==t.id;){const s=Q.zs[t.nl];s.cl&&s.fl&&s.ul&&(i=s.cl.indexOf(t.id),-1!==i&&(e+=s.fl[i])),t=s}return e}Kl(){if(this.nl===this.id)return this.y;let t=Q.zs[this.nl];if(!t.cl||!t.fl||!t.ul)return this.y;let i=t.cl.indexOf(this.id);if(-1===i)return this.y;let e=t.ul[i];for(;t.nl!==t.id;){const s=Q.zs[t.nl];s.cl&&s.fl&&s.ul&&(i=s.cl.indexOf(t.id),-1!==i&&(e+=s.ul[i])),t=s}return e}outline(t){const i=this.Vl(),e=this.Kl();m._t(i,e,this.width,this.height,t)}move(t,i){if(this.nl===this.id)return;this.x=0,this.y=0;const e=Q.zs[this.nl];if(e.cl&&e.fl&&e.ul){const s=e.cl.indexOf(this.id);-1!==s&&(e.fl[s]=t,e.ul[s]=i)}}delete(){if(this.nl===this.id)return;const t=Q.zs[this.nl];if(t.cl&&t.fl&&t.ul){const i=t.cl.indexOf(this.id);-1!==i&&(t.cl.splice(i,1),t.fl.splice(i,1),t.ul.splice(i,1))}}}var tt,it=(tt="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,s,n=void 0!==(t=t||{})?t:{};n.ready=new Promise((function(t,e){i=t,s=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(n.ready,t)||Object.defineProperty(n.ready,t,{get:()=>X('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>X('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var r=Object.assign({},n),h=[],o='object'==typeof window,l='function'==typeof importScripts,a='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,c=!o&&!a&&!l;if(n.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var f,u,d,w='';if(a){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var y,m;w=l?require('path').Xl(w)+'/':__dirname+'/';var p=()=>{m||(y=require('fs'),m=require('path'))};f=(t,i)=>(p(),t=m.normalize(t),y.jl(t,i?void 0:'utf8')),d=t=>{var i=f(t,!0);return i.buffer||(i=new Uint8Array(i)),k(i.buffer),i},u=(t,i,e)=>{p(),t=m.normalize(t),y.zl(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),h=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),n.inspect=function(){return'[Emscripten Module object]'}}else if(c){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(f=function(t){return read(t)}),d=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),k('object'==typeof i),i)},u=function(t,i,e){setTimeout((()=>i(d(t))),0)},'undefined'!=typeof scriptArgs?h=scriptArgs:void 0!==arguments&&(h=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!o&&!l)throw new Error('environment detection error');if(l?w=self.location.href:'undefined'!=typeof document&&document.currentScript&&(w=document.currentScript.src),tt&&(w=tt),w=0!==w.indexOf('blob:')?w.substr(0,w.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');f=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},l&&(d=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),u=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}n.print||console.log.bind(console);var A,_,g=n.printErr||console.warn.bind(console);function I(t,i){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){X('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function C(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(n,r),r=null,A='fetchSettings',Object.getOwnPropertyDescriptor(n,A)&&X('`Module.'+A+'` was supplied but `'+A+'` not included in INCOMING_MODULE_JS_API'),n.arguments&&(h=n.arguments),I('arguments','arguments_'),n.thisProgram&&n.thisProgram,I('thisProgram','thisProgram'),n.quit&&n.quit,I('quit','quit_'),k(void 0===n.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.read,'Module.read option was removed (modify read_ in JS)'),k(void 0===n.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),k(void 0===n.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),k(void 0===n.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),k(void 0===n.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),I('read','read_'),I('readAsync','readAsync'),I('readBinary','readBinary'),I('setWindowTitle','setWindowTitle'),k(!c,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),n.wasmBinary&&(_=n.wasmBinary),I('wasmBinary','wasmBinary');var E;n.noExitRuntime;I('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&X('no native wasm support detected');var T,b,O,R,v,L,S,x,M=!1;function k(t,i){t||X('Assertion failed'+(i?': '+i:''))}function D(t){T=t,n.HEAP8=b=new Int8Array(t),n.HEAP16=R=new Int16Array(t),n.HEAP32=v=new Int32Array(t),n.HEAPU8=O=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=L=new Uint32Array(t),n.HEAPF32=S=new Float32Array(t),n.HEAPF64=x=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var N=5242880;n.TOTAL_STACK&&k(N===n.TOTAL_STACK,'the stack size can no longer be determined at runtime');var F=n.INITIAL_MEMORY||16777216;function B(){if(!M){var t=ft(),i=L[t>>2],e=L[t+4>>2];34821223==i&&2310721022==e||X('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==L[0]&&X('Runtime error: The application has corrupted its heap memory area (address zero)!')}}I('INITIAL_MEMORY','INITIAL_MEMORY'),k(F>=N,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+F+'! (TOTAL_STACK='+N+')'),k('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),k(!n.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),k(16777216==F,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var P=[],U=[],W=[],G=!1;k(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var Y=0,H=null,V=null,K={};function X(t){n.onAbort&&n.onAbort(t),g(t='Aborted('+t+')'),M=!0;var i=new WebAssembly.RuntimeError(t);throw s(i),i}var j={error:function(){X('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){j.error()},Zl:function(){j.error()},ql:function(){j.error()},Jl:function(){j.error()},open:function(){j.error()},$l:function(){j.error()},Ql:function(){j.error()},ta:function(){j.error()},ia:function(){j.error()},ea:function(){j.error()}};n.FS_createDataFile=j.Zl,n.FS_createPreloadedFile=j.ql;var z,Z,q,J,$='data:application/octet-stream;base64,';function Q(t){return t.startsWith($)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=n.asm),k(G,'native function `'+e+'` called before runtime initialization'),s[t]||k(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==z&&_)return new Uint8Array(_);if(d)return d(t);throw"both async and sync fetching of the wasm failed"}catch(t){X(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(n)}function ht(t){ht.sa||(ht.sa={}),ht.sa[t]||(ht.sa[t]=1,a&&(t='warning: '+t),g(t))}function ot(t){try{return E.grow(t-T.byteLength+65535>>>16),D(E.buffer),1}catch(i){g('emscripten_realloc_buffer: Attempted to grow heap from '+T.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}n.locateFile?Q(z='tinymidipcm.wasm')||(Z=z,z=n.locateFile?n.locateFile(Z,w):w+Z):z=new URL(e(8227),e.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,e){O.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=O.length;k((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return g('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return g('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function e(t,i){var e,s=t.exports;n.asm=s,k(E=n.asm.memory,"memory not found in wasm exports"),D(E.buffer),k(n.asm.__indirect_function_table,"table not found in wasm exports"),e=n.asm.__wasm_call_ctors,U.unshift(e),function(t){if(Y--,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(k(K[t]),delete K[t]):g('warning: run dependency removed without ID'),0==Y&&(null!==H&&(clearInterval(H),H=null),V)){var i=V;V=null,i()}}('wasm-instantiate')}t='wasm-instantiate',Y++,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(k(!K[t]),K[t]=1,null===H&&'undefined'!=typeof setInterval&&(H=setInterval((function(){if(M)return clearInterval(H),void(H=null);var t=!1;for(var i in K)t||(t=!0,g('still waiting on run dependencies:')),g('dependency: '+i);t&&g('(end of list)')}),1e4))):g('warning: run dependency added without ID');var r=n;function h(t){k(n===r,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),r=null,e(t.instance)}function c(t){return function(){if(!_&&(o||l)){if('function'==typeof fetch&&!it(z))return fetch(z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+z+"'";return t.arrayBuffer()})).catch((function(){return st(z)}));if(u)return new Promise((function(t,i){u(z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){g('failed to asynchronously prepare wasm: '+t),it(z)&&g('warning: Loading from a file URI ('+z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),X(t)}))}if(n.instantiateWasm)try{return n.instantiateWasm(i,e)}catch(t){g('Module.instantiateWasm callback failed with error: '+t),s(t)}(_||'function'!=typeof WebAssembly.instantiateStreaming||Q(z)||it(z)||a||'function'!=typeof fetch?c(h):fetch(z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return g('wasm streaming compile failed: '+t),g('falling back to ArrayBuffer instantiation'),c(h)}))}))).catch(s)}(),n.___wasm_call_ctors=et("__wasm_call_ctors"),n._malloc=et("malloc"),n._free=et("free"),n._tsf_load_memory=et("tsf_load_memory"),n._tsf_close=et("tsf_close"),n._tsf_reset=et("tsf_reset"),n._tsf_set_output=et("tsf_set_output"),n._tsf_set_max_voices=et("tsf_set_max_voices"),n._realloc=et("realloc"),n._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),n._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),n._tml_load_memory=et("tml_load_memory"),n._midi_render=et("midi_render"),n.___errno_location=et("__errno_location"),n._fflush=et("fflush"),n._emscripten_stack_init=function(){return(ct=n._emscripten_stack_init=n.asm.emscripten_stack_init).apply(null,arguments)}),ft=(n._emscripten_stack_get_free=function(){return(n._emscripten_stack_get_free=n.asm.emscripten_stack_get_free).apply(null,arguments)},n._emscripten_stack_get_base=function(){return(n._emscripten_stack_get_base=n.asm.emscripten_stack_get_base).apply(null,arguments)},n._emscripten_stack_get_end=function(){return(ft=n._emscripten_stack_get_end=n.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),k(!(3&(t=ft()))),L[t>>2]=34821223,L[t+4>>2]=2310721022,L[0]=1668509029}function dt(t){function e(){lt||(lt=!0,n.calledRun=!0,M||(k(!G),G=!0,B(),rt(U),i(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),k(!n._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(B(),n.postRun)for('function'==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),W.unshift(t);var t;rt(W)}()))}t=t||h,Y>0||(ut(),function(){if(n.preRun)for('function'==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),P.unshift(t);var t;rt(P)}(),Y>0||(n.setStatus?(n.setStatus('Running...'),setTimeout((function(){setTimeout((function(){n.setStatus('')}),1),e()}),1)):e(),B()))}if(n.stackSave=et("stackSave"),n.stackRestore=et("stackRestore"),n.stackAlloc=et("stackAlloc"),n.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':b[0|t]=i;break;case'i16':R[t>>1]=i;break;case'i32':v[t>>2]=i;break;case'i64':J=[i>>>0,(q=i,+Math.abs(q)>=1?q>0?(0|Math.min(+Math.floor(q/4294967296),4294967295))>>>0:~~+Math.ceil((q-+(~~q>>>0))/4294967296)>>>0:0)],v[t>>2]=J[0],v[t+4>>2]=J[1];break;case'float':S[t>>2]=i;break;case'double':x[t>>3]=i;break;case'*':L[t>>2]=i;break;default:X('invalid type for setValue: '+e)}},n.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return b[0|t];case'i16':return R[t>>1];case'i32':case'i64':return v[t>>2];case'float':return S[t>>2];case'double':return x[t>>3];case'*':return L[t>>2];default:X('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),X(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),V=function t(){lt||dt(),lt||(V=t)},n.preInit)for('function'==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return dt(),t.ready});const et=it;const st=class{constructor(t={}){this.na=void 0,this.ra=0,this.ha=0,this.oa=0,this.la=t.la||100,this.sampleRate=t.sampleRate||44100,this.aa=t.aa||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.ca(1),this.fa=t.fa||(()=>{}),this.ua=t.ua||(()=>{}),this.da=void 0,this.test=0}async init(){if(!this.na){if('undefined'!=typeof process){const{Xl:t}=await import('path'),{wa:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.na=await et(),this.ya=this.na._malloc(this.bufferSize),this.ma=this.na._malloc(8)}}ca(t){this.bufferSize=4*this.sampleRate*this.aa*t}pa(){if(!this.na)throw new Error(`${this.constructor.name} not initalized. call .init()`)}Aa(t){this.pa();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.na;e(this.ra),this.ra=i(t.length),this.na.HEAPU8.set(t,this.ra),this.ha=s(this.ra,t.length),n(this.ha,2===this.aa?0:2,this.sampleRate,this.gain)}_a(){this.pa();const t=new Uint8Array(this.bufferSize);return t.set(this.na.HEAPU8.subarray(this.ya,this.ya+this.bufferSize)),t}ga(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.na;return e(this.oa),this.oa=i(t.length),this.na.HEAPU8.set(t,this.oa),s(this.oa,t.length)}Ia(t){const{_midi_render:i}=this.na;return i(this.ha,t,this.aa,this.sampleRate,this.ya,this.bufferSize,this.ma)}Ca(t){if(this.pa(),!this.ha)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.da);const{setValue:i,getValue:e}=this.na;i(this.ma,0,'double'),this.na._tsf_reset(this.ha),this.na._tsf_channel_set_bank_preset(this.ha,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.ga(t);const n=()=>{s=this.Ia(s);const t=this._a();this.fa(t),s?this.da=setTimeout(n,this.la):this.ua(e(this.ma,'double'))};this.da=setTimeout(n,16)}};!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{const t=2,i=44100;let e=new Float32Array,s=window.audioContext.createGain();s.gain.setValueAtTime(.1,window.audioContext.currentTime),s.connect(window.audioContext.destination);let n=window.audioContext.currentTime,r=[];const h=new st({la:30,fa:t=>{let i=new Float32Array(t.buffer),s=new Float32Array(e.length+i.length);s.set(e,0),s.set(i,e.length),e=s},ua:t=>{},bufferSize:102400});await h.init();const o=await fetch('./SCC1_Florestan.sf2'),l=new Uint8Array(await o.arrayBuffer());function a(){if(!window.audioContext||!e.length)return;let h=window.audioContext.createBufferSource();const o=e.length/t,l=window.audioContext.createBuffer(t,o,i);for(let i=0;i{t.stop(window.audioContext.currentTime)})),r=[],s.gain.setValueAtTime(t,window.audioContext.currentTime)}}function u(t,i){-1!==t&&window._tinyMidiVolume(t),n=window.audioContext.currentTime,c=setInterval(a,250),h.Ca(i)}h.Aa(l),window._tinyMidiStop=async t=>{t?function(t){const i=window.audioContext.currentTime;s.gain.cancelScheduledValues(i),s.gain.setTargetAtTime(0,i,.5),setTimeout(t,2e3)}((()=>{f()})):f()},window._tinyMidiVolume=(t=1)=>{s.gain.setValueAtTime(t,window.audioContext.currentTime)},window._tinyMidiPlay=async(t,i,e)=>{t&&(await window._tinyMidiStop(e),e?setTimeout((()=>{u(i,t)}),2e3):u(i,t))}})();class nt{level;y;x;z;model;Ea;Ta;ba;Oa;Ra;va;La;info;Sa=0;Wi=0;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.Ea=r,this.Ta=h,this.ba=o,this.Oa=l,this.Ra=a,this.va=c,this.La=f,this.info=u}}class rt extends w{level;x;z;xa;Ma;ka;Da=null;Na=null;Fa=null;Ba=null;Pa=null;Ua=null;Wa=null;Ga=0;Ya=0;Ha=0;visible=!1;update=!1;Va=!1;Ka=0;Xa=0;ja=0;za=0;constructor(t,i,e){super(),this.xa=this.level=t,this.x=i,this.z=e,this.Ma=new v(5,null),this.ka=new Int32Array(5)}}class ht{Za;qa;Ja;$a;type;Cr;Er;Tr;br;Rr;vr;mode=0;Qa=0;tc=0;ic=0;ec=0;sc=0;nc=0;constructor(t,i,e,s,n,r,h,o,l,a,c){this.Za=t,this.qa=i,this.Ja=e,this.$a=s,this.type=n,this.Cr=r,this.Er=h,this.Tr=o,this.br=l,this.Rr=a,this.vr=c}}class ot{static OPEN=0;static rc=1;static hc=2;static oc=4;static lc=8;static ac=ot.rc<<4;static cc=ot.hc<<4;static fc=ot.oc<<4;static uc=ot.lc<<4;static dc=256;static wc=512;static yc=1024;static mc=2048;static Ac=4096;static _c=ot.wc<<4;static gc=ot.yc<<4;static Ic=ot.mc<<4;static Cc=ot.Ac<<4;static Ec=ot.dc<<9;static Tc=524288;static bc=2097152;static Oc=ot.bc|ot.Tc;static Rc=ot.dc|ot.Oc;static vc=ot.hc|ot.Rc;static Lc=ot.lc|ot.Rc;static Sc=ot.hc|ot.oc|ot.Lc;static xc=ot.cc|ot.Rc;static Mc=ot.lc|ot.ac|ot.xc;static kc=ot.uc|ot.Rc;static Dc=ot.rc|ot.hc|ot.kc;static Nc=ot.cc|ot.fc|ot.kc;static Fc=16777215}class lt{static Bc=0;static Pc=1;static Uc=2;static Wc=3}class at{static Gc=0;static Yc=1;static Hc=2;static Vc=3}class ct{static Kc=new ct(0,at.Gc);static Xc=new ct(1,at.Gc);static jc=new ct(2,at.Gc);static zc=new ct(3,at.Gc);static Zc=new ct(4,at.Yc);static qc=new ct(5,at.Yc);static Jc=new ct(6,at.Yc);static $c=new ct(7,at.Yc);static Qc=new ct(8,at.Yc);static tf=new ct(9,at.Hc);static if=new ct(10,at.Hc);static ef=new ct(11,at.Hc);static sf=new ct(12,at.Hc);static nf=new ct(13,at.Hc);static rf=new ct(14,at.Hc);static hf=new ct(15,at.Hc);static lf=new ct(16,at.Hc);static af=new ct(17,at.Hc);static cf=new ct(18,at.Hc);static ff=new ct(19,at.Hc);static uf=new ct(20,at.Hc);static df=new ct(21,at.Hc);static Vc=new ct(22,at.Vc);static values(){return[this.Kc,this.Xc,this.af,this.hf,this.jc,this.rf,this.tf,this.zc,this.Vc,this.sf,this.ef,this.Jc,this.uf,this.if,this.qc,this.nf,this.$c,this.Zc,this.lf,this.Qc,this.ff,this.df,this.cf]}static of(t){const i=this.values();for(let e=0;et*ut.yf+i;offsetX;mf;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.mf=0,this.sizeX=ut.yf,this.sizeZ=ut.yf,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[ut.index(t-this.offsetX,i-this.mf)]|=ot.bc};Af=(t,i)=>{this.flags[ut.index(t-this.offsetX,i-this.mf)]&=~ot.bc};_f=(t,i,e,s,n,r)=>{let h=ot.dc;r&&(h|=ot.Ec);const o=t-this.offsetX,l=i-this.mf;if(n===lt.Pc||n===lt.Wc){const t=e;e=s,s=t}for(let t=o;t=0&&t=0&&i{let h=ot.dc;r&&(h|=ot.Ec);const o=t-this.offsetX,l=i-this.mf;if(n===lt.Pc||n===lt.Wc){const t=e;e=s,s=t}for(let t=o;t=0&&t=0&&i{const r=t-this.offsetX,h=i-this.mf,o=n?ot.Cc:ot.uc,l=n?ot.Ac:ot.lc,a=n?ot.yc:ot.hc,c=n?ot.gc:ot.cc,f=n?ot.wc:ot.rc,u=n?ot._c:ot.ac,d=n?ot.mc:ot.oc,w=n?ot.Ic:ot.fc;e===ct.Kc.id?s===lt.Bc?(this.add(r,h,o),this.add(r-1,h,l)):s===lt.Pc?(this.add(r,h,a),this.add(r,h+1,c)):s===lt.Uc?(this.add(r,h,l),this.add(r+1,h,o)):s===lt.Wc&&(this.add(r,h,c),this.add(r,h-1,a)):e===ct.Xc.id||e===ct.zc.id?s===lt.Bc?(this.add(r,h,f),this.add(r-1,h+1,u)):s===lt.Pc?(this.add(r,h,d),this.add(r+1,h+1,w)):s===lt.Uc?(this.add(r,h,u),this.add(r+1,h-1,f)):s===lt.Wc&&(this.add(r,h,w),this.add(r-1,h-1,d)):e===ct.jc.id&&(s===lt.Bc?(this.add(r,h,a|o),this.add(r-1,h,l),this.add(r,h+1,c)):s===lt.Pc?(this.add(r,h,a|l),this.add(r,h+1,c),this.add(r+1,h,o)):s===lt.Uc?(this.add(r,h,c|l),this.add(r+1,h,o),this.add(r,h-1,a)):s===lt.Wc&&(this.add(r,h,c|o),this.add(r,h-1,a),this.add(r-1,h,l))),n&&this.If(t,i,e,s,!1)};Cf=(t,i,e,s,n)=>{const r=t-this.offsetX,h=i-this.mf,o=n?ot.Cc:ot.uc,l=n?ot.Ac:ot.lc,a=n?ot.yc:ot.hc,c=n?ot.gc:ot.cc,f=n?ot.wc:ot.rc,u=n?ot._c:ot.ac,d=n?ot.mc:ot.oc,w=n?ot.Ic:ot.fc;e===ct.Kc.id?s===lt.Bc?(this.remove(r,h,o),this.remove(r-1,h,l)):s===lt.Pc?(this.remove(r,h,a),this.remove(r,h+1,c)):s===lt.Uc?(this.remove(r,h,l),this.remove(r+1,h,o)):s===lt.Wc&&(this.remove(r,h,c),this.remove(r,h-1,a)):e===ct.Xc.id||e===ct.zc.id?s===lt.Bc?(this.remove(r,h,f),this.remove(r-1,h+1,u)):s===lt.Pc?(this.remove(r,h,d),this.remove(r+1,h+1,w)):s===lt.Uc?(this.remove(r,h,u),this.remove(r+1,h-1,f)):s===lt.Wc&&(this.remove(r,h,w),this.remove(r-1,h-1,d)):e===ct.jc.id&&(s===lt.Bc?(this.remove(r,h,a|o),this.remove(r-1,h,l),this.remove(r,h+1,c)):s===lt.Pc?(this.remove(r,h,a|l),this.remove(r,h+1,c),this.remove(r+1,h,o)):s===lt.Uc?(this.remove(r,h,c|l),this.remove(r+1,h,o),this.remove(r,h-1,a)):s===lt.Wc&&(this.remove(r,h,c|o),this.remove(r,h-1,a),this.remove(r-1,h,l))),n&&this.Cf(t,i,e,s,!1)};Ef=(t,i,e,s,n,r)=>{if(t===e&&i===s)return!0;const h=t-this.offsetX,o=i-this.mf,l=e-this.offsetX,a=s-this.mf,c=ut.index(h,o);if(n===ct.Kc.id){if(r===lt.Bc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.xc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.vc)===ot.OPEN)return!0}else if(r===lt.Pc){if(h===l&&o===a+1)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.Lc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.kc)===ot.OPEN)return!0}else if(r===lt.Uc){if(h===l+1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.xc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.vc)===ot.OPEN)return!0}else if(r===lt.Wc){if(h===l&&o===a-1)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.Lc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.kc)===ot.OPEN)return!0}}else if(n===ct.jc.id){if(r===lt.Bc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.kc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.vc)===ot.OPEN)return!0}else if(r===lt.Pc){if(h===l-1&&o===a&&(this.flags[c]&ot.Lc)===ot.OPEN)return!0;if(h===l&&o===a+1)return!0;if(h===l+1&&o===a)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.vc)===ot.OPEN)return!0}else if(r===lt.Uc){if(h===l-1&&o===a&&(this.flags[c]&ot.Lc)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.xc)===ot.OPEN)return!0;if(h===l+1&&o===a)return!0;if(h===l&&o===a-1)return!0}else if(r===lt.Wc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.xc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.kc)===ot.OPEN)return!0;if(h===l&&o===a-1)return!0}}else if(n===ct.tf.id){if(h===l&&o===a+1&&(this.flags[c]&ot.cc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.hc)===ot.OPEN)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.lc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.uc)===ot.OPEN)return!0}return!1};Tf=(t,i,e,s,n,r)=>{if(t===e&&i===s)return!0;const h=t-this.offsetX,o=i-this.mf,l=e-this.offsetX,a=s-this.mf,c=ut.index(h,o);if(n===ct.Jc.id||n===ct.$c.id){if(n===ct.$c.id&&(r=r+2&3),r===lt.Bc){if(h===l+1&&o===a&&(this.flags[c]&ot.uc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.hc)===ot.OPEN)return!0}else if(r===lt.Pc){if(h===l-1&&o===a&&(this.flags[c]&ot.lc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.hc)===ot.OPEN)return!0}else if(r===lt.Uc){if(h===l-1&&o===a&&(this.flags[c]&ot.lc)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.cc)===ot.OPEN)return!0}else if(r===lt.Wc){if(h===l+1&&o===a&&(this.flags[c]&ot.uc)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.cc)===ot.OPEN)return!0}}else if(n===ct.Qc.id){if(h===l&&o===a+1&&(this.flags[c]&ot.cc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.hc)===ot.OPEN)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.lc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.uc)===ot.OPEN)return!0}return!1};bf=(t,i,e,s,n,r,h)=>{const o=e+n-1,l=s+r-1,a=ut.index(t-this.offsetX,i-this.mf);return t>=e&&t<=o&&i>=s&&i<=l||(t===e-1&&i>=s&&i<=l&&(this.flags[a]&ot.lc)===ot.OPEN&&(h&ft.Bc)===ot.OPEN||(t===o+1&&i>=s&&i<=l&&(this.flags[a]&ot.uc)===ot.OPEN&&(h&ft.Uc)===ot.OPEN||(i===s-1&&t>=e&&t<=o&&(this.flags[a]&ot.hc)===ot.OPEN&&(h&ft.Wc)===ot.OPEN||i===l+1&&t>=e&&t<=o&&(this.flags[a]&ot.cc)===ot.OPEN&&(h&ft.Pc)===ot.OPEN)))};add=(t,i,e)=>{this.flags[ut.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[ut.index(t,i)]&=ot.Fc-e}}class dt{y;x;z;model;La;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.La=n,this.info=r}}class wt{y;x;z;Of;Rf;vf;Lf;La;info;constructor(t,i,e,s,n,r,h,o,l){this.y=t,this.x=i,this.z=e,this.Of=s,this.Rf=n,this.vf=r,this.Lf=h,this.La=o,this.info=l}}class yt{y;x;z;type;angle;model;La;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.La=h,this.info=o}}class mt{y;x;z;Sf;xf;Mf;La;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.Sf=s,this.xf=n,this.Mf=r,this.La=h,this.offset=o}}class pt{kf;Df;Nf;Ff;Bf;color;flat;constructor(t,i,e,s,n,r,h){this.kf=t,this.Df=i,this.Nf=e,this.Ff=s,this.Bf=n,this.color=r,this.flat=h}}class At{static Pf=new Int32Array(6);static Uf=new Int32Array(6);static Wf=new Int32Array(6);static Gf=new Int32Array(6);static Yf=new Int32Array(6);static Hf=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static Vf=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static Kf=128;static Xf=this.Kf/2|0;static jf=this.Kf/4|0;static zf=3*this.Kf/4|0;cr;er;ur;Zf;qf;Jf;$f;Qf;tu;iu;flat;shape;angle;eu;su;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,m,p,A){this.flat=!(m!==s||m!==d||m!==o),this.shape=i,this.angle=r,this.eu=u,this.su=l;const _=At.Hf[i],g=_.length;this.cr=new Int32Array(g),this.er=new Int32Array(g),this.ur=new Int32Array(g);const I=new Int32Array(g),C=new Int32Array(g),E=t*At.Kf,T=p*At.Kf;for(let t=0;t8&&g<=12&&(g=9+(g-r-9&3)),g>12&&g<=16&&(g=13+(g-r-13&3)),1===g?(i=E,l=T,c=m,u=h,p=a):2===g?(i=E+At.Xf,l=T,c=m+s>>1,u=h+A>>1,p=a+e>>1):3===g?(i=E+At.Kf,l=T,c=s,u=A,p=e):4===g?(i=E+At.Kf,l=T+At.Xf,c=s+d>>1,u=A+n>>1,p=e+w>>1):5===g?(i=E+At.Kf,l=T+At.Kf,c=d,u=n,p=w):6===g?(i=E+At.Xf,l=T+At.Kf,c=d+o>>1,u=n+y>>1,p=w+f>>1):7===g?(i=E,l=T+At.Kf,c=o,u=y,p=f):8===g?(i=E,l=T+At.Xf,c=o+m>>1,u=y+h>>1,p=f+a>>1):9===g?(i=E+At.Xf,l=T+At.jf,c=m+s>>1,u=h+A>>1,p=a+e>>1):10===g?(i=E+At.zf,l=T+At.Xf,c=s+d>>1,u=A+n>>1,p=e+w>>1):11===g?(i=E+At.Xf,l=T+At.zf,c=d+o>>1,u=n+y>>1,p=w+f>>1):12===g?(i=E+At.jf,l=T+At.Xf,c=o+m>>1,u=y+h>>1,p=f+a>>1):13===g?(i=E+At.jf,l=T+At.jf,c=m,u=h,p=a):14===g?(i=E+At.zf,l=T+At.jf,c=s,u=A,p=e):15===g?(i=E+At.zf,l=T+At.zf,c=d,u=n,p=w):(i=E+At.jf,l=T+At.zf,c=o,u=y,p=f),this.cr[t]=i,this.er[t]=c,this.ur[t]=l,I[t]=u,C[t]=p}const b=At.Vf[i],O=b.length/4|0;this.$f=new Int32Array(O),this.Qf=new Int32Array(O),this.tu=new Int32Array(O),this.Zf=new Int32Array(O),this.qf=new Int32Array(O),this.Jf=new Int32Array(O),this.iu=-1!==c?new Int32Array(O):null;let R=0;for(let t=0;t{this._u=0,this.gu=0,this.Iu=t,this.Cu=i,this.Eu=t/2|0,this.Tu=i/2|0;const r=new x(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.bu=N.sin[t],this.Ou=N.cos[t],this.Ru=N.sin[i],this.vu=N.cos[i];const h=(t-128)/32|0,o=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const l=128*t,a=128*i;let c=!1;for(let t=-e;t<=s;t+=128)if(this.hd(l,a,n[h]+t)){c=!0;break}r[h][o][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let h=-1;h<=1;h++)for(let o=-1;o<=1;o++){if(r[t][i][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t][(i+1)%31][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t+1][i][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t+1][(i+1)%31][e+h+25+1][s+o+25+1]){n=!0;break t}}this.du[t][i][e+25][s+25]=n}};static Xi=()=>{this.wu=null,this.yu=null,this.mu=null,this.Au=null,this.du=null,this.pu=null,this.Gu=null,console.log('World3D unloaded!')};static od=(t,i,e,s,n,r,h,o)=>{gt.mu[t][gt.yu[t]++]=new ht(e/128|0,r/128|0,n/128|0,o/128|0,i,e,r,n,o,s,h)};static hd=(t,i,e)=>{const s=i*this.Ru+t*this.vu>>16,n=i*this.vu-t*this.Ru>>16,r=e*this.bu+n*this.Ou>>16,h=e*this.Ou-n*this.bu>>16;if(r<50||r>3500)return!1;const o=this.Eu+((s<<9)/r|0),l=this.Tu+((h<<9)/r|0);return o>=this._u&&o<=this.Iu&&l>=this.gu&&l<=this.Cu};ld;qa;$a;ad;fd;ud;dd;wd;yd;md=0;pd=0;Ad=0;constructor(t,i,e,s){this.ld=e,this.qa=s,this.$a=i,this.fd=new S(e,s,i,null),this.dd=new D(e,s+1,i+1),this.ad=t,this.ud=new v(5e3,null),this.wd=new Int32Array(1e4),this.yd=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.pd=t;for(let i=0;i{const e=this.fd[0][t][i];for(let e=0;e<3;e++){this.fd[e][t][i]=this.fd[e+1][t][i];const s=this.fd[e][t][i];s&&s.level--}this.fd[0][t][i]||(this.fd[0][t][i]=new rt(0,t,i));const s=this.fd[0][t][i];s&&(s.Wa=e),this.fd[3][t][i]=null};Id=(t,i,e,s)=>{const n=this.fd[t][i][e];n&&(n.Ha=s)};Cd=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,m,p,A,_)=>{if(s===_t.nu){for(let s=t;s>=0;s--)this.fd[s][i][e]||(this.fd[s][i][e]=new rt(s,i,e));const s=this.fd[t][i][e];s&&(s.Da=new pt(c,f,u,d,-1,A,!1))}else if(s===_t.ru){for(let s=t;s>=0;s--)this.fd[s][i][e]||(this.fd[s][i][e]=new rt(s,i,e));const s=this.fd[t][i][e];s&&(s.Da=new pt(w,y,m,p,r,_,h===o&&h===l&&h===a))}else{for(let s=t;s>=0;s--)this.fd[s][i][e]||(this.fd[s][i][e]=new rt(s,i,e));const g=this.fd[t][i][e];g&&(g.Na=new At(i,s,y,o,u,n,c,a,_,w,r,p,A,l,m,d,h,e,f))}};Ed=(t,i,e,s,n,r,h)=>{this.fd[i][e][s]||(this.fd[i][e][s]=new rt(i,e,s));const o=this.fd[i][e][s];o&&(o.Pa=new dt(n,128*e+64,128*s+64,t,r,h))};Td=(t,i,e)=>{const s=this.fd[t][i][e];s&&(s.Pa=null)};bd=(t,i,e,s,n,r,h,o)=>{let l=0;const a=this.fd[s][t][i];if(a)for(let t=0;tl&&(l=e)}else this.fd[s][t][i]=new rt(s,t,i);const c=this.fd[s][t][i];c&&(c.Ua=new mt(e,128*t+64,128*i+64,r,h,o,n,l))};Od=(t,i,e)=>{const s=this.fd[t][i][e];s&&(s.Ua=null)};If=(t,i,e,s,n,r,h,o,l,a)=>{if(!h&&!o)return;for(let s=t;s>=0;s--)this.fd[s][i][e]||(this.fd[s][i][e]=new rt(s,i,e));const c=this.fd[t][i][e];c&&(c.Fa=new wt(s,128*i+64,128*e+64,n,r,h,o,l,a))};Cf=(t,i,e,s)=>{const n=this.fd[t][i][e];1===s&&n&&(n.Fa=null)};Rd=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!o)return;for(let s=t;s>=0;s--)this.fd[s][i][e]||(this.fd[s][i][e]=new rt(s,i,e));const f=this.fd[t][i][e];f&&(f.Ba=new yt(s,128*i+n+64,128*e+r+64,c,a,o,h,l))};vd=(t,i,e)=>{const s=this.fd[t][i][e];s&&(s.Ba=null)};Ld=(t,i,e,s)=>{const n=this.fd[t][i][e];if(!n)return;const r=n.Ba;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};Sd=(t,i,e,s)=>{if(!s)return;const n=this.fd[t][i][e];if(!n)return;const r=n.Ba;r&&(r.model=s)};xd=(t,i,e,s)=>{if(!s)return;const n=this.fd[t][i][e];if(!n)return;const r=n.Pa;r&&(r.model=s)};Md=(t,i,e,s)=>{if(!s)return;const n=this.fd[t][i][e];if(!n)return;const r=n.Fa;r&&(r.vf=s)};kd=(t,i,e,s,n)=>{if(!s)return;const r=this.fd[e][t][i];if(!r)return;const h=r.Fa;h&&(h.vf=s,h.Lf=n)};_f=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!n&&!r)return!0;const f=128*i+64*l,u=128*e+64*a;return this.Dd(f,u,s,t,i,e,l,a,n,r,h,o,c,!1)};Nd=(t,i,e,s,n,r,h,o,l,a)=>{if(!n&&!r)return!0;let c=i-l,f=s-l,u=i+l,d=s+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Dd(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};Fd=(t,i,e,s,n,r,h,o,l,a,c,f)=>!l&&!a||this.Dd(i,s,e,t,n,r,h+1-n,o-r+1,l,a,c,0,f,!0);gf=(t,i,e)=>{const s=this.fd[t][i][e];if(s)for(let t=0;t>29&3)&&n.ba===i&&n.Ra===e)return void this.Bd(n)}};Pd=(t,i,e,s)=>{if(!s)return;const n=this.fd[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};Ud=()=>{for(let t=0;t{const s=this.fd[t][i][e];return s&&s.Fa?s.Fa.La:0};Gd=(t,i,e)=>{const s=this.fd[t][e][i];return s&&s.Ba?s.Ba.La:0};Yd=(t,i,e)=>{const s=this.fd[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.ba===i&&n.Ra===e)return n.La}return 0};Hd=(t,i,e)=>{const s=this.fd[t][i][e];return s&&s.Pa?s.Pa.La:0};Vd=(t,i,e,s)=>{const n=this.fd[t][i][e];if(n){if(n.Fa&&n.Fa.La===s)return 255&n.Fa.info;if(n.Ba&&n.Ba.La===s)return 255&n.Ba.info;if(n.Pa&&n.Pa.La===s)return 255&n.Pa.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.fd[t][i+1][e-1];n&&n.Pa&&n.Pa.model&&n.Pa.model.lr&&this.jd(s,n.Pa.model,128,0,-128,!0)}};Xd=(t,i,e,s,n,r)=>{let h=!0,o=i;const l=i+s,a=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.ld){for(let u=o;u<=l;u++)if(!(u<0||u>=this.qa))for(let o=a;o<=c;o++){if(o<0||o>=this.$a||h&&u=e||u===i))continue;const a=this.fd[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.ad[f][u][o]+this.ad[f][u+1][o]+this.ad[f][u][o+1]+this.ad[f][u+1][o+1])/4|0)-((this.ad[t][i][e]+this.ad[t][i+1][e]+this.ad[t][i][e+1]+this.ad[t][i+1][e+1])/4|0),m=a.Fa;m&&m.vf&&m.vf.lr&&this.jd(r,m.vf,d,y,w,h),m&&m.Lf&&m.Lf.lr&&this.jd(r,m.Lf,d,y,w,h);for(let t=0;t{this.Ad++;let h=0;const o=i.cr,l=i.$s;if(t.lr&&t.ar)for(let r=0;ri.Rr)continue;const u=t.cr[r]-e;if(ui.Er)continue;const d=t.ur[r]-n;if(di.br)continue;if(i.lr&&i.ar)for(let t=0;t{const h=this.fd[t][i][e];if(!h)return;const o=h.Da;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const l=h.Na;if(!l)return;const a=l.shape,c=l.angle,f=l.eu,u=l.su,d=gt.Qu[a],w=gt.td[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{gt.Wu=!0,gt.Ve=t,gt.Ke=i,gt.nd=-1,gt.rd=-1};draw=(t,i,e,s,n,r,h)=>{t<0?t=0:t>=128*this.qa&&(t=128*this.qa-1),e<0?e=0:e>=128*this.$a&&(e=128*this.$a-1),gt.Wi++,gt.bu=N.sin[r],gt.Ou=N.cos[r],gt.Ru=N.sin[n],gt.vu=N.cos[n],gt.Gu=gt.du[(r-128)/32|0][n/64|0],gt.Lu=t,gt.Su=i,gt.xu=e,gt.Mu=t/128|0,gt.ku=e/128|0,gt.Pu=s,gt.Du=gt.Mu-25,gt.Du<0&&(gt.Du=0),gt.Fu=gt.ku-25,gt.Fu<0&&(gt.Fu=0),gt.Nu=gt.Mu+25,gt.Nu>this.qa&&(gt.Nu=this.qa),gt.Bu=gt.ku+25,gt.Bu>this.$a&&(gt.Bu=this.$a),this.qd(),gt.Uu=0;for(let t=this.pd;t=2e3)?(h.visible=!0,h.update=!0,h.Va=h.Ga>0,gt.Uu++):(h.visible=!1,h.update=!1,h.Ka=0))}}for(let t=this.pd;t=gt.Nu))for(let t=-25;t<=0;t++){const n=gt.ku+t,r=gt.ku-t;let o;if(e>=gt.Du&&(n>=gt.Fu&&(o=i[e][n],o&&o.visible&&this.Jd(o,!0,h)),r=gt.Fu&&(o=i[s][n],o&&o.visible&&this.Jd(o,!0,h)),r=gt.Nu))for(let t=-25;t<=0;t++){const n=gt.ku+t,r=gt.ku-t;let o;if(e>=gt.Du&&(n>=gt.Fu&&(o=i[e][n],o&&o.visible&&this.Jd(o,!1,h)),r=gt.Fu&&(o=i[s][n],o&&o.visible&&this.Jd(o,!1,h)),r{if(!l&&!a)return!1;for(let t=n;t=this.qa||i>=this.$a)return!1;const e=this.fd[s][t][i];if(e&&e.Ga>=5)return!1}const w=new nt(s,e,t,i,l,a,u,n,n+h-1,r,r+o-1,c,f);for(let t=n;tn&&(e|=1),tr&&(e+=8),i=0;e--)this.fd[e][t][i]||(this.fd[e][t][i]=new rt(e,t,i));const l=this.fd[s][t][i];l&&(l.Ma[l.Ga]=w,l.ka[l.Ga]=e,l.Ya|=e,l.Ga++)}return d&&(this.ud[this.md++]=w),!0};Bd=t=>{for(let i=t.ba;i<=t.Oa;i++)for(let e=t.Ra;e<=t.va;e++){const s=this.fd[t.level][i][e];if(s){for(let i=0;i{const t=gt.yu[gt.Pu],i=gt.mu[gt.Pu];gt.sd=0;for(let e=0;e=0&&s<=50){n=t.Ja+25-gt.ku,n<0&&(n=0),r=t.$a+25-gt.ku,r>50&&(r=50);let i=!1;for(;n<=r;)if(gt.Gu&>.Gu[s][n++]){i=!0;break}if(i){if(h=gt.Lu-t.Cr,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.ic=(t.Tr-gt.xu<<8)/h|0,t.ec=(t.br-gt.xu<<8)/h|0,t.sc=(t.Rr-gt.Su<<8)/h|0,t.nc=(t.vr-gt.Su<<8)/h|0,gt.pu[gt.sd++]=t}}}else if(2===t.type){if(s=t.Ja+25-gt.ku,s>=0&&s<=50){n=t.Za+25-gt.Mu,n<0&&(n=0),r=t.qa+25-gt.Mu,r>50&&(r=50);let i=!1;for(;n<=r;)if(gt.Gu&>.Gu[n++][s]){i=!0;break}if(i){if(h=gt.xu-t.Tr,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.Qa=(t.Cr-gt.Lu<<8)/h|0,t.tc=(t.Er-gt.Lu<<8)/h|0,t.sc=(t.Rr-gt.Su<<8)/h|0,t.nc=(t.vr-gt.Su<<8)/h|0,gt.pu[gt.sd++]=t}}}else if(4===t.type&&(s=t.Rr-gt.Su,s>128&&(n=t.Ja+25-gt.ku,n<0&&(n=0),r=t.$a+25-gt.ku,r>50&&(r=50),n<=r))){let i=t.Za+25-gt.Mu;i<0&&(i=0),h=t.qa+25-gt.Mu,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(gt.Gu&>.Gu[t][i]){e=!0;break t}e&&(t.mode=5,t.Qa=(t.Cr-gt.Lu<<8)/s|0,t.tc=(t.Er-gt.Lu<<8)/s|0,t.ic=(t.Tr-gt.xu<<8)/s|0,t.ec=(t.br-gt.xu<<8)/s|0,gt.pu[gt.sd++]=t)}}};Jd=(t,i,e)=>{for(gt.Au.St(t);;){let t;do{if(t=gt.Au.Mt(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.xa,o=this.fd[r];if(t.visible){if(i){if(r>0){const t=this.fd[r-1][s][n];if(t&&t.update)continue}if(s<=gt.Mu&&s>gt.Du){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.Ya)))continue}if(s>=gt.Mu&&sgt.Fu){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.Ya)))continue}if(n>=gt.ku&&nn&&(a+=6),c=gt.Yu[a],t.za=gt.Vu[a]),f&&(f.Of>.Hu[a]?16===f.Of?(t.Ka=3,t.Xa=gt.Ku[a],t.ja=3-t.Xa):32===f.Of?(t.Ka=6,t.Xa=gt.Xu[a],t.ja=6-t.Xa):64===f.Of?(t.Ka=12,t.Xa=gt.ju[a],t.ja=12-t.Xa):(t.Ka=9,t.Xa=gt.zu[a],t.ja=9-t.Xa):t.Ka=0,f.Of&c&&!this.iw(h,s,n,f.Of)&&f.vf?.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,f.x-gt.Lu,f.y-gt.Su,f.z-gt.xu,f.La),f.Rf&c&&!this.iw(h,s,n,f.Rf)&&f.Lf?.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,f.x-gt.Lu,f.y-gt.Su,f.z-gt.xu,f.La)),u&&!this.visible(h,s,n,u.model.vr))if(u.type&c)u.model.draw(u.angle,gt.bu,gt.Ou,gt.Ru,gt.vu,u.x-gt.Lu,u.y-gt.Su,u.z-gt.xu,u.La);else if(768&u.type){const t=u.x-gt.Lu,i=u.y-gt.Su,e=u.z-gt.xu,s=u.angle;let n,r;if(n=s===lt.Pc||s===lt.Uc?-t:t,r=s===lt.Uc||s===lt.Wc?-e:e,256&u.type&&rn){const n=t+gt.Ju[s],r=e+gt.$u[s];u.model.draw(512*s+1280&2047,gt.bu,gt.Ou,gt.Ru,gt.vu,n,i,r,u.La)}}if(l){const i=t.Pa;i&&i.model?.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,i.x-gt.Lu,i.y-gt.Su,i.z-gt.xu,i.La);const e=t.Ua;e&&0===e.offset&&(e.Mf&&e.Mf.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,e.x-gt.Lu,e.y-gt.Su,e.z-gt.xu,e.La),e.xf&&e.xf.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,e.x-gt.Lu,e.y-gt.Su,e.z-gt.xu,e.La),e.Sf&&e.Sf.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,e.x-gt.Lu,e.y-gt.Su,e.z-gt.xu,e.La))}const d=t.Ya;if(0!==d){if(sgt.Mu&&1&d){const t=o[s-1][n];t&&t.update&>.Au.St(t)}if(n>gt.ku&&8&d){const t=o[s][n-1];t&&t.update&>.Au.St(t)}}}if(0!==t.Ka){let i=!0;for(let e=0;ei.ba&&(r+=1),ei.Ra&&(r+=8),ss&&(s=n);const h=gt.ku-i.Ra,l=i.va-gt.ku;i.Sa=l>h?s+l:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.Sa,i=e))}if(-1===i)break;const l=gt.wu[i];if(l){l.Wi=gt.Wi;let t=l.model;t||(t=l.Ea?.draw(e)??null),t&&!this.ew(h,l.ba,l.Oa,l.Ra,l.va,t.vr)&&t.draw(l.Ta,gt.bu,gt.Ou,gt.Ru,gt.vu,l.x-gt.Lu,l.y-gt.Su,l.z-gt.xu,l.La);for(let t=l.ba;t<=l.Oa;t++)for(let i=l.Ra;i<=l.va;i++){const e=o[t][i];e&&(0!==e.Ka?gt.Au.St(e):t===s&&i===n||!e.update||gt.Au.St(e))}}}if(t.Va)continue}if(!t.update||0!==t.Ka)continue;if(s<=gt.Mu&&s>gt.Du){const t=o[s-1][n];if(t&&t.update)continue}if(s>=gt.Mu&&sgt.Fu){const t=o[s][n-1];if(t&&t.update)continue}if(n>=gt.ku&&n=r){const r=t+gt.Zu[n],h=s+gt.qu[n];i.model.draw(512*n+256,gt.bu,gt.Ou,gt.Ru,gt.vu,r,e,h,i.La)}if(512&i.type&&h<=r){const r=t+gt.Ju[n],h=s+gt.$u[n];i.model.draw(512*n+1280&2047,gt.bu,gt.Ou,gt.Ru,gt.vu,r,e,h,i.La)}}const e=t.Fa;e&&(e.Rf&t.za&&!this.iw(h,s,n,e.Rf)&&e.Lf?.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,e.x-gt.Lu,e.y-gt.Su,e.z-gt.xu,e.La),e.Of&t.za&&!this.iw(h,s,n,e.Of)&&e.vf?.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,e.x-gt.Lu,e.y-gt.Su,e.z-gt.xu,e.La))}if(rgt.Mu){const t=o[s-1][n];t&&t.update&>.Au.St(t)}if(n>gt.ku){const t=o[s][n-1];t&&t.update&>.Au.St(t)}}};Qd=(t,i,e,s,n,r,h,o)=>{let l,a,c,f,u=l=(e<<7)-gt.Lu,d=a=(s<<7)-gt.xu,w=c=u+128,y=f=d+128,p=this.ad[i][e][s]-gt.Su,A=this.ad[i][e+1][s]-gt.Su,_=this.ad[i][e+1][s+1]-gt.Su,g=this.ad[i][e][s+1]-gt.Su,I=d*h+u*o>>16;if(d=d*o-u*h>>16,u=I,I=p*r-d*n>>16,d=p*n+d*r>>16,p=I,d<50)return;if(I=a*h+w*o>>16,a=a*o-w*h>>16,w=I,I=A*r-a*n>>16,a=A*n+a*r>>16,A=I,a<50)return;if(I=y*h+c*o>>16,y=y*o-c*h>>16,c=I,I=_*r-y*n>>16,y=_*n+y*r>>16,_=I,y<50)return;if(I=f*h+l*o>>16,f=f*o-l*h>>16,l=I,I=g*r-f*n>>16,f=g*n+f*r>>16,g=I,f<50)return;const C=N.ki+((u<<9)/d|0),E=N.Di+((p<<9)/d|0),T=N.ki+((w<<9)/a|0),b=N.Di+((A<<9)/a|0),O=N.ki+((c<<9)/y|0),R=N.Di+((_<<9)/y|0),v=N.ki+((l<<9)/f|0),L=N.Di+((g<<9)/f|0);if(N.alpha=0,(O-v)*(b-L)-(R-L)*(T-v)>0)if(N.Fi=O<0||v<0||T<0||O>m.ut||v>m.ut||T>m.ut,gt.Wu&&this.sw(gt.Ve,gt.Ke,R,L,b,O,v,T)&&(gt.nd=e,gt.rd=s),-1===t.Bf)12345678!==t.Nf&&N.ee(O,v,T,R,L,b,t.Nf,t.Ff,t.Df);else if(gt.Ri){const i=gt.ed[t.Bf];N.ee(O,v,T,R,L,b,this.nw(i,t.Nf),this.nw(i,t.Ff),this.nw(i,t.Df))}else t.flat?N.he(O,v,T,R,L,b,t.Nf,t.Ff,t.Df,u,p,d,w,l,A,g,a,f,t.Bf):N.he(O,v,T,R,L,b,t.Nf,t.Ff,t.Df,c,_,y,l,w,g,A,f,a,t.Bf);if(!((C-T)*(L-b)-(E-b)*(v-T)<=0))if(N.Fi=C<0||T<0||v<0||C>m.ut||T>m.ut||v>m.ut,gt.Wu&&this.sw(gt.Ve,gt.Ke,E,b,L,C,T,v)&&(gt.nd=e,gt.rd=s),-1!==t.Bf){if(!gt.Ri)return void N.he(C,T,v,E,b,L,t.kf,t.Df,t.Ff,u,p,d,w,l,A,g,a,f,t.Bf);const i=gt.ed[t.Bf];N.ee(C,T,v,E,b,L,this.nw(i,t.kf),this.nw(i,t.Df),this.nw(i,t.Ff))}else 12345678!==t.kf&&N.ee(C,T,v,E,b,L,t.kf,t.Df,t.Ff)};tw=(t,i,e,s,n,r,h)=>{let o=e.cr.length;for(let t=0;t>16;if(l=l*h-i*r>>16,i=a,a=o*n-l*s>>16,l=o*s+l*n>>16,o=a,l<50)return;e.iu&&(At.Wf[t]=i,At.Gf[t]=o,At.Yf[t]=l),At.Pf[t]=N.ki+((i<<9)/l|0),At.Uf[t]=N.Di+((o<<9)/l|0)}N.alpha=0,o=e.$f.length;for(let s=0;s0)if(N.Fi=o<0||l<0||a<0||o>m.ut||l>m.ut||a>m.ut,gt.Wu&&this.sw(gt.Ve,gt.Ke,c,f,u,o,l,a)&&(gt.nd=t,gt.rd=i),e.iu&&-1!==e.iu[s])if(gt.Ri){const t=gt.ed[e.iu[s]];N.ee(o,l,a,c,f,u,this.nw(t,e.Zf[s]),this.nw(t,e.qf[s]),this.nw(t,e.Jf[s]))}else e.flat?N.he(o,l,a,c,f,u,e.Zf[s],e.qf[s],e.Jf[s],At.Wf[0],At.Gf[0],At.Yf[0],At.Wf[1],At.Wf[3],At.Gf[1],At.Gf[3],At.Yf[1],At.Yf[3],e.iu[s]):N.he(o,l,a,c,f,u,e.Zf[s],e.qf[s],e.Jf[s],At.Wf[n],At.Gf[n],At.Yf[n],At.Wf[r],At.Wf[h],At.Gf[r],At.Gf[h],At.Yf[r],At.Yf[h],e.iu[s]);else 12345678!==e.Zf[s]&&N.ee(o,l,a,c,f,u,e.Zf[s],e.qf[s],e.Jf[s])}};$d=(t,i,e)=>{const s=this.dd[t][i][e];if(s===-gt.Wi)return!1;if(s===gt.Wi)return!0;{const s=i<<7,n=e<<7;return this.rw(s+1,this.ad[t][i][e],n+1)&&this.rw(s+128-1,this.ad[t][i+1][e],n+1)&&this.rw(s+128-1,this.ad[t][i+1][e+1],n+128-1)&&this.rw(s+1,this.ad[t][i][e+1],n+128-1)?(this.dd[t][i][e]=gt.Wi,!0):(this.dd[t][i][e]=-gt.Wi,!1)}};iw=(t,i,e,s)=>{if(!this.$d(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.ad[t][i][e]-1,o=h-120,l=h-230,a=h-238;if(s<16){if(1===s){if(n>gt.Lu){if(!this.rw(n,h,r))return!1;if(!this.rw(n,h,r+128))return!1}if(t>0){if(!this.rw(n,o,r))return!1;if(!this.rw(n,o,r+128))return!1}return!!this.rw(n,l,r)&&this.rw(n,l,r+128)}if(2===s){if(r0){if(!this.rw(n,o,r+128))return!1;if(!this.rw(n+128,o,r+128))return!1}return!!this.rw(n,l,r+128)&&this.rw(n+128,l,r+128)}if(4===s){if(n0){if(!this.rw(n+128,o,r))return!1;if(!this.rw(n+128,o,r+128))return!1}return!!this.rw(n+128,l,r)&&this.rw(n+128,l,r+128)}if(8===s){if(r>gt.xu){if(!this.rw(n,h,r))return!1;if(!this.rw(n+128,h,r))return!1}if(t>0){if(!this.rw(n,o,r))return!1;if(!this.rw(n+128,o,r))return!1}return!!this.rw(n,l,r)&&this.rw(n+128,l,r)}}return!!this.rw(n+64,a,r+64)&&(16===s?this.rw(n,l,r+128):32===s?this.rw(n+128,l,r+128):64===s?this.rw(n+128,l,r):128===s?this.rw(n,l,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.$d(t,i,e)){const n=i<<7,r=e<<7;return this.rw(n+1,this.ad[t][i][e]-s,r+1)&&this.rw(n+128-1,this.ad[t][i+1][e]-s,r+1)&&this.rw(n+128-1,this.ad[t][i+1][e+1]-s,r+128-1)&&this.rw(n+1,this.ad[t][i][e+1]-s,r+128-1)}return!1};ew=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.dd[t][h][o]===-gt.Wi)return!1;o=1+(i<<7);const l=2+(s<<7),a=this.ad[t][i][s]-r;if(!this.rw(o,a,l))return!1;const c=(e<<7)-1;if(!this.rw(c,a,l))return!1;const f=(n<<7)-1;return!!this.rw(o,a,f)&&this.rw(c,a,f)}return!!this.$d(t,i,s)&&(h=i<<7,o=s<<7,this.rw(h+1,this.ad[t][i][s]-r,o+1)&&this.rw(h+128-1,this.ad[t][i+1][s]-r,o+1)&&this.rw(h+128-1,this.ad[t][i+1][s+1]-r,o+128-1)&&this.rw(h+1,this.ad[t][i][s+1]-r,o+128-1))};rw=(t,i,e)=>{for(let s=0;s0){const t=n.Tr+(n.ic*s>>8),r=n.br+(n.ec*s>>8),h=n.Rr+(n.sc*s>>8),o=n.vr+(n.nc*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.Cr;if(s>0){const t=n.Tr+(n.ic*s>>8),r=n.br+(n.ec*s>>8),h=n.Rr+(n.sc*s>>8),o=n.vr+(n.nc*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.Tr-e;if(s>0){const e=n.Cr+(n.Qa*s>>8),r=n.Er+(n.tc*s>>8),h=n.Rr+(n.sc*s>>8),o=n.vr+(n.nc*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.Tr;if(s>0){const e=n.Cr+(n.Qa*s>>8),r=n.Er+(n.tc*s>>8),h=n.Rr+(n.sc*s>>8),o=n.vr+(n.nc*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.Rr;if(s>0){const i=n.Cr+(n.Qa*s>>8),r=n.Er+(n.tc*s>>8),h=n.Tr+(n.ic*s>>8),o=n.br+(n.ec*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};sw=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const l=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*l>0&&l*((i-n)*(r-o)-(t-o)*(e-n))>0};nw=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}class It{id;hw=null;constructor(t){this.id=t}ow(t){for(;;){const i=t.jt;if(0===i)break;this.decode(i,t)}return this}}class Ct extends It{static count=0;static zs=[];static Zs=t=>{const i=new O(t.read('flo.dat'));this.count=i.Zt;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static aw=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static cw=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);fw=0;texture=-1;uw=!1;dw=!0;ww=0;yw=0;mw=0;pw=0;Aw=0;_w=0;decode(t,i){1===t?(this.fw=i.Jt,this.setColor(this.fw)):2===t?this.texture=i.jt:3===t?this.uw=!0:5===t?this.dw=!1:6===t?this.hw=i.ei:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(r=e),s>r&&(r=s);let h=0,o=0;const l=(n+r)/2;n!==r&&(l<.5&&(o=(r-n)/(r+n)),l>=.5&&(o=(r-n)/(2-r-n)),i===r?h=(e-s)/(r-n):e===r?h=(s-i)/(r-n)+2:s===r&&(h=(i-e)/(r-n)+4)),h/=6,this.ww=256*h|0,this.yw=256*o|0,this.mw=256*l|0,this.yw<0?this.yw=0:this.yw>255&&(this.yw=255),this.mw<0?this.mw=0:this.mw>255&&(this.mw=255),this.pw=l>.5?(1-l)*o*512|0:l*o*512|0,this.pw<1&&(this.pw=1),this.Aw=h*this.pw|0;let a=this.ww+(16*Math.random()|0)-8;a<0?a=0:a>255&&(a=255);let c=this.yw+(48*Math.random()|0)-24;c<0?c=0:c>255&&(c=255);let f=this.mw+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255),this._w=Ct.lw(a,c,f)}}class Et extends It{static count=0;static cache=null;static Xs=null;static gw=null;static Iw=0;static Cw=new q(500);static Ew=new q(30);static Zs=t=>{this.Xs=new O(t.read('loc.dat'));const i=new O(t.read('loc.idx'));this.count=i.Zt,this.gw=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.gw||!this.Xs)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Iw=(this.Iw+1)%10;const i=this.cache[this.Iw];return this.Xs.Vt=this.gw[t],i.id=t,i.reset(),i.ow(this.Xs),i.Tw||(i.Tw=new Int32Array(1)),-1===i.bw&&i.Tw&&(i.active=i.Tw.length>0&&i.Tw[0]===ct.if.id,i.Ow&&(i.active=!0)),i};static Xi=()=>{this.Cw=null,this.Ew=null,this.gw=null,this.cache=null,this.Xs=null};Rw=null;Tw=null;name=null;Lw=null;Sw=null;xw=null;width=1;length=1;Mw=!0;kw=!0;active=!1;bw=-1;Dw=!1;Nw=!1;dw=!1;Dl=-1;Fw=!1;Bw=16;Pw=0;Uw=0;Ow=null;Ww=-1;Gw=-1;Yw=!1;Hw=!0;Vw=128;Kw=128;Xw=128;jw=0;zw=0;Zw=0;qw=0;Jw=!1;decode(t,i){if(1===t){const t=i.jt;this.Rw=new Int32Array(t),this.Tw=new Int32Array(t);for(let e=0;e=30&&t<39)this.Ow||(this.Ow=new v(5,null)),this.Ow[t-30]=i.ei,'hidden'===this.Ow[t-30]?.toLowerCase()&&(this.Ow[t-30]=null);else if(40===t){const t=i.jt;this.Sw=new Uint16Array(t),this.xw=new Uint16Array(t);for(let e=0;e=this.Rw.length)return null;let c=this.Rw[o];if(-1===c)return null;const f=this.Yw!==i>3;f&&(c+=65536);let u=Et.Cw?.get(BigInt(c));u||(u=j.model(65535&c),f&&u.th(),Et.Cw?.put(BigInt(c),u));const d=128!==this.Vw||128!==this.Kw||128!==this.Xw,w=0!==this.zw||0!==this.Zw||0!==this.qw;let y=j.Mr(u,!this.Sw,!this.Fw,i===lt.Bc&&-1===h&&!d&&!w);for(-1!==h&&(y.jr(),y.qr(h),y.Br=null,y.Fr=null);i-- >0;)y.Jr();if(this.Sw&&this.xw)for(let t=0;t{const i=new O(t.read('seq.dat'));this.count=i.Zt;for(let t=0;t{let e=this.ip(t+45365,i+91923,4)+(this.ip(t+10294,i+37821,2)-128>>1)+(this.ip(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static ip=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.ep(s,r),l=this.ep(s+1,r),a=this.ep(s,r+1),c=this.ep(s+1,r+1),f=this.sp(o,l,n,e),u=this.sp(a,c,n,e);return this.sp(f,u,h,e)};static sp=(t,i,e,s)=>{const n=65536-N.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static ep=(t,i)=>((this.np(t-1,i-1)+this.np(t+1,i-1)+this.np(t-1,i+1)+this.np(t+1,i+1))/16|0)+((this.np(t-1,i)+this.np(t+1,i)+this.np(t,i-1)+this.np(t,i+1))/8|0)+(this.np(t,i)/4|0);static np=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static _f=(t,i,e,s,n,r,h,o,l,a,c)=>{const f=n[c][i][e],u=n[c][i+1][e],d=n[c][i+1][e+1],w=n[c][i][e+1],y=f+u+d+w>>2,m=Et.get(o);let p=i+(e<<7)+(o<<14)+1073741824|0;m.active||(p+=-2147483648),p|=0;const A=(a<<6)+l<<24>>24;if(l===ct.Vc.id)s?.Ed(m.Ml(ct.Vc.id,a,f,u,d,w,-1),t,i,e,y,p,A),m.Mw&&m.active&&h?.pf(i,e),-1!==m.Dl&&r.St(new Tt(o,t,3,i,e,bt.zs[m.Dl],!0));else if(l===ct.if.id||l===ct.ef.id){const n=m.Ml(ct.if.id,a,f,u,d,w,-1);if(n){let r,h,o=0;l===ct.ef.id&&(o+=256),a===lt.Pc||a===lt.Wc?(r=m.length,h=m.width):(r=m.width,h=m.length),s?._f(t,i,e,y,n,null,p,A,r,h,o)}m.Mw&&h?._f(i,e,m.width,m.length,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,2,i,e,bt.zs[m.Dl],!0))}else if(l>=ct.sf.id)s?._f(t,i,e,y,m.Ml(l,a,f,u,d,w,-1),null,p,A,1,1,0),m.Mw&&h?._f(i,e,m.width,m.length,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,2,i,e,bt.zs[m.Dl],!0));else if(l===ct.Kc.id)s?.If(t,i,e,y,Rt.Xm[a],0,m.Ml(ct.Kc.id,a,f,u,d,w,-1),null,p,A),m.Mw&&h?.If(i,e,l,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,0,i,e,bt.zs[m.Dl],!0));else if(l===ct.Xc.id)s?.If(t,i,e,y,Rt.jm[a],0,m.Ml(ct.Xc.id,a,f,u,d,w,-1),null,p,A),m.Mw&&h?.If(i,e,l,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,0,i,e,bt.zs[m.Dl],!0));else if(l===ct.jc.id){const n=a+1&3;s?.If(t,i,e,y,Rt.Xm[a],Rt.Xm[n],m.Ml(ct.jc.id,a+4,f,u,d,w,-1),m.Ml(ct.jc.id,n,f,u,d,w,-1),p,A),m.Mw&&h?.If(i,e,l,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,0,i,e,bt.zs[m.Dl],!0))}else if(l===ct.zc.id)s?.If(t,i,e,y,Rt.jm[a],0,m.Ml(ct.zc.id,a,f,u,d,w,-1),null,p,A),m.Mw&&h?.If(i,e,l,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,0,i,e,bt.zs[m.Dl],!0));else if(l===ct.tf.id)s?._f(t,i,e,y,m.Ml(l,a,f,u,d,w,-1),null,p,A,1,1,0),m.Mw&&h?._f(i,e,m.width,m.length,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,2,i,e,bt.zs[m.Dl],!0));else if(l===ct.Zc.id)s?.Rd(t,i,e,y,0,0,p,m.Ml(ct.Zc.id,lt.Bc,f,u,d,w,-1),A,512*a,Rt.Xm[a]),-1!==m.Dl&&r.St(new Tt(o,t,1,i,e,bt.zs[m.Dl],!0));else if(l===ct.qc.id){let n=16;if(s){const r=s.Wd(t,i,e);r>0&&(n=Et.get(r>>14&32767).Bw)}s?.Rd(t,i,e,y,Rt.zm[a]*n,Rt.Zm[a]*n,p,m.Ml(ct.Zc.id,lt.Bc,f,u,d,w,-1),A,512*a,Rt.Xm[a]),-1!==m.Dl&&r.St(new Tt(o,t,1,i,e,bt.zs[m.Dl],!0))}else l===ct.Jc.id?(s?.Rd(t,i,e,y,0,0,p,m.Ml(ct.Zc.id,lt.Bc,f,u,d,w,-1),A,a,256),-1!==m.Dl&&r.St(new Tt(o,t,1,i,e,bt.zs[m.Dl],!0))):l===ct.$c.id?(s?.Rd(t,i,e,y,0,0,p,m.Ml(ct.Zc.id,lt.Bc,f,u,d,w,-1),A,a,512),-1!==m.Dl&&r.St(new Tt(o,t,1,i,e,bt.zs[m.Dl],!0))):l===ct.Qc.id&&(s?.Rd(t,i,e,y,0,0,p,m.Ml(ct.Zc.id,lt.Bc,f,u,d,w,-1),A,a,768),-1!==m.Dl&&r.St(new Tt(o,t,1,i,e,bt.zs[m.Dl],!0)))};qa;$a;rp;hp;op;lp;ap;cp;fp;up;dp;wp;yp;mp;pp;Ap;constructor(t,i,e,s){this.qa=t,this.$a=i,this.rp=e,this.hp=s,this.op=new M(ut.wf,t,i),this.lp=new M(ut.wf,t,i),this.ap=new M(ut.wf,t,i),this.cp=new M(ut.wf,t,i),this.Ap=new D(ut.wf,t+1,i+1),this.fp=new M(ut.wf,t+1,i+1),this.up=new k(t+1,i+1),this.dp=new Int32Array(i),this.wp=new Int32Array(i),this.yp=new Int32Array(i),this.mp=new Int32Array(i),this.pp=new Int32Array(i)}_p=(t,i)=>{for(let t=0;t=0&&i[n]?.pf(e,s)}Rt.qm+=(5*Math.random()|0)-2,Rt.qm<-8?Rt.qm=-8:Rt.qm>8&&(Rt.qm=8),Rt.Jm+=(5*Math.random()|0)-2,Rt.Jm<-16?Rt.Jm=-16:Rt.Jm>16&&(Rt.Jm=16);for(let i=0;i>8;for(let t=1;t>2)+(e[l+1][t]>>3)+(e[l][t-1]>>2)+(e[l][t+1]>>3)+(e[l][t]>>1);this.up[l][t]=u-d}for(let t=0;t=0&&s0){const i=Ct.zs[e-1];this.dp[t]+=i.Aw,this.wp[t]+=i.yw,this.yp[t]+=i.mw,this.mp[t]+=i.pw,n=this.pp[t]++}}const r=e-5;if(r>=0&&r0){const i=Ct.zs[e-1];this.dp[t]-=i.Aw,this.wp[t]-=i.yw,this.yp[t]-=i.mw,this.mp[t]-=i.pw,n=this.pp[t]--}}}if(e>=1&&e=0&&a=0&&c=1&&l0||c>0){const f=this.rp[i][e][l],u=this.rp[i][e+1][l],d=this.rp[i][e+1][l+1],w=this.rp[i][e][l+1],y=this.up[e][l],m=this.up[e+1][l],p=this.up[e+1][l+1],A=this.up[e][l+1];let _=-1,g=-1;if(a>0){const t=256*s/h|0,i=n/o|0;let e=r/o|0;_=Ct.lw(t,i,e);const l=t+Rt.qm&255;e+=Rt.Jm,e<0?e=0:e>255&&(e=255),g=Ct.lw(l,i,e)}if(i>0){let t=0!==a||this.ap[i][e][l]===_t.nu;c>0&&!Ct.zs[c-1].dw&&(t=!1),t&&f===u&&f===d&&f===w&&(this.Ap[i][e][l]|=2340)}let I=0;if(-1!==_&&(I=N.palette[Ct.aw(g,96)]),0===c)t?.Cd(i,e,l,_t.nu,lt.Bc,-1,f,u,d,w,Ct.aw(_,y),Ct.aw(_,m),Ct.aw(_,p),Ct.aw(_,A),Ot.gy,Ot.gy,Ot.gy,Ot.gy,I,Ot.gy);else{const s=this.ap[i][e][l]+1,n=this.cp[i][e][l],r=Ct.zs[c-1];let h,o,a=r.texture;a>=0?(o=N.Ji(a),h=-1):r.fw===Ot.Ay?(o=0,h=-2,a=-1):(h=Ct.lw(r.ww,r.yw,r.mw),o=N.palette[Ct.cw(r._w,96)]),t?.Cd(i,e,l,s,n,a,f,u,d,w,Ct.aw(_,y),Ct.aw(_,m),Ct.aw(_,p),Ct.aw(_,A),Ct.cw(h,y),Ct.cw(h,m),Ct.cw(h,p),Ct.cw(h,A),I,o)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let n=0;n<=s;n++)for(let r=0;r<=this.$a;r++)for(let h=0;h<=this.qa;h++){if(this.Ap[n][h][r]&t){let i=r,e=r,o=n,l=n;for(;i>0&&this.Ap[n][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.Ap[o-1][h][s]&t))break t;o--}t:for(;l=8){const n=this.rp[l][h][i]-240,r=this.rp[o][h][i];gt.od(s,1,128*h,n,128*i,128*h,r,128*e+128);for(let s=o;s<=l;s++)for(let n=i;n<=e;n++)this.Ap[s][h][n]&=~t}}if(this.Ap[n][h][r]&i){let t=h,e=h,o=n,l=n;for(;t>0&&this.Ap[n][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.Ap[o-1][s][r]&i))break t;o--}t:for(;l=8){const n=this.rp[l][t][r]-240,h=this.rp[o][t][r];gt.od(s,2,128*t,n,128*r,128*e+128,h,128*r);for(let s=o;s<=l;s++)for(let n=t;n<=e;n++)this.Ap[s][n][r]&=~i}}if(this.Ap[n][h][r]&e){let t=h,i=h,o=r,l=r;for(;o>0&&this.Ap[n][h][o-1]&e;)o--;for(;l0;){for(let i=o;i<=l;i++)if(!(this.Ap[n][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.rp[n][t][o];gt.od(s,4,128*t,r,128*o,128*i+128,r,128*l+128);for(let s=t;s<=i;s++)for(let t=o;t<=l;t++)this.Ap[n][s][t]&=~e}}}}}};Ip=(t,i,e,s)=>{let n=0;for(let t=0;t>24;break}for(let r=t;r=0&&t=0&&r{const r=new O(new Uint8Array(n));for(let n=0;n=0&&l=0&&a>24,this.cp[n][l][a]=(c-2&3)<<24>>24):c<=81?this.hp[n][l][a]=c-49<<24>>24:this.op[n][l][a]=c-81<<24>>24}else for(;c=r.jt,0!==c;){if(1===c){r.jt;break}c<=49&&r.jt}}};Ep=(t,i,e,s,n,r)=>{const h=new O(new Uint8Array(s));let o=-1;for(;;){const s=h.ii;if(0===s)return;o+=s;let l=0;for(;;){const s=h.ii;if(0===s)break;l+=s-1;const a=63&l,c=l>>6&63,f=l>>12,u=h.jt,d=u>>2,w=3&u,y=c+n,m=a+r;if(y>0&&m>0&&y=0&&(n=e[s]),this._f(f,y,m,t,i,n,o,d,w)}}}};_f=(t,i,e,s,n,r,h,o,l)=>{if(Rt.Ri){if(16&this.hp[t][i][e])return;if(this.gp(t,i,e)!==Rt.$m)return}const a=this.rp[t][i][e],c=this.rp[t][i+1][e],f=this.rp[t][i+1][e+1],u=this.rp[t][i][e+1],d=a+c+f+u>>2,w=Et.get(h);let y=i+(e<<7)+(h<<14)+1073741824|0;w.active||(y+=-2147483648),y|=0;const m=(l<<6)+o<<24>>24;if(o===ct.Vc.id)(!Rt.Ri||w.active||w.Jw)&&(s?.Ed(w.Ml(ct.Vc.id,l,a,c,f,u,-1),t,i,e,d,y,m),w.Mw&&w.active&&r?.pf(i,e),-1!==w.Dl&&n.St(new Tt(h,t,3,i,e,bt.zs[w.Dl],!0)));else if(o===ct.if.id||o===ct.ef.id){const p=w.Ml(ct.if.id,l,a,c,f,u,-1);if(p){let n,r,h=0;if(o===ct.ef.id&&(h+=256),l===lt.Pc||l===lt.Wc?(n=w.length,r=w.width):(n=w.width,r=w.length),s?._f(t,i,e,d,p,null,y,m,n,r,h)&&w.Hw)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=p.Or/4|0;r>30&&(r=30),r>this.fp[t][i+s][e+n]&&(this.fp[t][i+s][e+n]=r<<24>>24)}}w.Mw&&r?._f(i,e,w.width,w.length,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,2,i,e,bt.zs[w.Dl],!0))}else if(o>=ct.sf.id)s?._f(t,i,e,d,w.Ml(o,l,a,c,f,u,-1),null,y,m,1,1,0),o>=ct.sf.id&&o<=ct.af.id&&o!==ct.nf.id&&t>0&&(this.Ap[t][i][e]|=2340),w.Mw&&r?._f(i,e,w.width,w.length,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,2,i,e,bt.zs[w.Dl],!0));else if(o===ct.Kc.id)s?.If(t,i,e,d,Rt.Xm[l],0,w.Ml(ct.Kc.id,l,a,c,f,u,-1),null,y,m),l===lt.Bc?(w.Hw&&(this.fp[t][i][e]=50,this.fp[t][i][e+1]=50),w.dw&&(this.Ap[t][i][e]|=585)):l===lt.Pc?(w.Hw&&(this.fp[t][i][e+1]=50,this.fp[t][i+1][e+1]=50),w.dw&&(this.Ap[t][i][e+1]|=1170)):l===lt.Uc?(w.Hw&&(this.fp[t][i+1][e]=50,this.fp[t][i+1][e+1]=50),w.dw&&(this.Ap[t][i+1][e]|=585)):l===lt.Wc&&(w.Hw&&(this.fp[t][i][e]=50,this.fp[t][i+1][e]=50),w.dw&&(this.Ap[t][i][e]|=1170)),w.Mw&&r?.If(i,e,o,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,0,i,e,bt.zs[w.Dl],!0)),16!==w.Bw&&s?.Ld(t,i,e,w.Bw);else if(o===ct.Xc.id)s?.If(t,i,e,d,Rt.jm[l],0,w.Ml(ct.Xc.id,l,a,c,f,u,-1),null,y,m),w.Hw&&(l===lt.Bc?this.fp[t][i][e+1]=50:l===lt.Pc?this.fp[t][i+1][e+1]=50:l===lt.Uc?this.fp[t][i+1][e]=50:l===lt.Wc&&(this.fp[t][i][e]=50)),w.Mw&&r?.If(i,e,o,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,0,i,e,bt.zs[w.Dl],!0));else if(o===ct.jc.id){const p=l+1&3;s?.If(t,i,e,d,Rt.Xm[l],Rt.Xm[p],w.Ml(ct.jc.id,l+4,a,c,f,u,-1),w.Ml(ct.jc.id,p,a,c,f,u,-1),y,m),w.dw&&(l===lt.Bc?(this.Ap[t][i][e]|=265,this.Ap[t][i][e+1]|=1170):l===lt.Pc?(this.Ap[t][i][e+1]|=1170,this.Ap[t][i+1][e]|=585):l===lt.Uc?(this.Ap[t][i+1][e]|=585,this.Ap[t][i][e]|=1170):l===lt.Wc&&(this.Ap[t][i][e]|=1170,this.Ap[t][i][e]|=585)),w.Mw&&r?.If(i,e,o,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,0,i,e,bt.zs[w.Dl],!0)),16!==w.Bw&&s?.Ld(t,i,e,w.Bw)}else if(o===ct.zc.id)s?.If(t,i,e,d,Rt.jm[l],0,w.Ml(ct.zc.id,l,a,c,f,u,-1),null,y,m),w.Hw&&(l===lt.Bc?this.fp[t][i][e+1]=50:l===lt.Pc?this.fp[t][i+1][e+1]=50:l===lt.Uc?this.fp[t][i+1][e]=50:l===lt.Wc&&(this.fp[t][i][e]=50)),w.Mw&&r?.If(i,e,o,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,0,i,e,bt.zs[w.Dl],!0));else if(o===ct.tf.id)s?._f(t,i,e,d,w.Ml(o,l,a,c,f,u,-1),null,y,m,1,1,0),w.Mw&&r?._f(i,e,w.width,w.length,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,2,i,e,bt.zs[w.Dl],!0));else if(o===ct.Zc.id)s?.Rd(t,i,e,d,0,0,y,w.Ml(ct.Zc.id,lt.Bc,a,c,f,u,-1),m,512*l,Rt.Xm[l]),-1!==w.Dl&&n.St(new Tt(h,t,1,i,e,bt.zs[w.Dl],!0));else if(o===ct.qc.id){let r=16;if(s){const n=s.Wd(t,i,e);n>0&&(r=Et.get(n>>14&32767).Bw)}s?.Rd(t,i,e,d,Rt.zm[l]*r,Rt.Zm[l]*r,y,w.Ml(ct.Zc.id,lt.Bc,a,c,f,u,-1),m,512*l,Rt.Xm[l]),-1!==w.Dl&&n.St(new Tt(h,t,1,i,e,bt.zs[w.Dl],!0))}else o===ct.Jc.id?(s?.Rd(t,i,e,d,0,0,y,w.Ml(ct.Zc.id,lt.Bc,a,c,f,u,-1),m,l,256),-1!==w.Dl&&n.St(new Tt(h,t,1,i,e,bt.zs[w.Dl],!0))):o===ct.$c.id?(s?.Rd(t,i,e,d,0,0,y,w.Ml(ct.Zc.id,lt.Bc,a,c,f,u,-1),m,l,512),-1!==w.Dl&&n.St(new Tt(h,t,1,i,e,bt.zs[w.Dl],!0))):o===ct.Qc.id&&(s?.Rd(t,i,e,d,0,0,y,w.Ml(ct.Zc.id,lt.Bc,a,c,f,u,-1),m,l,768),-1!==w.Dl&&n.St(new Tt(h,t,1,i,e,bt.zs[w.Dl],!0)))};gp=(t,i,e)=>8&this.hp[t][i][e]?0:t<=0||!(2&this.hp[1][i][e])?t:t-1}class vt extends w{}class Lt extends vt{x=0;z=0;Ta=0;Tp=!1;size=1;bp=-1;Op=-1;Rp=-1;vp=-1;Lp=-1;Sp=-1;xp=-1;Mp=null;kp=100;Dp=0;Np=0;Fp=0;Bp=0;Pp=-1e3;Up=0;Wp=0;Gp=-1;Yp=0;Hp=0;Vp=-1;Kp=0;Xp=0;jp=-1;zp=0;Zp=0;qp=0;Jp=0;$p=-1;Qp=0;tA=0;iA=0;eA=0;sA=0;nA=0;rA=0;hA=0;oA=0;lA=0;aA=0;Wi=0;height=0;cA=0;pathLength=0;fA=new Int32Array(10);uA=new Int32Array(10);dA=new v(10,!1);wA=0;yA=-1;mA=-1;pA=-1;AA=-1;move(t,i,e){if(-1!==this.jp&&bt.zs[this.jp].priority<=1&&(this.jp=-1),!t){const t=i-this.fA[0],s=e-this.uA[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.fA[t]=this.fA[t-1],this.uA[t]=this.uA[t-1],this.dA[t]=this.dA[t-1];return this.fA[0]=i,this.uA[0]=e,void(this.dA[0]=!1)}}this.pathLength=0,this.wA=0,this.fA[0]=i,this.uA[0]=e,this.x=128*this.fA[0]+64*this.size,this.z=128*this.uA[0]+64*this.size}step(t,i){let e=this.fA[0],s=this.uA[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.jp&&bt.zs[this.jp].priority<=1&&(this.jp=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.fA[t]=this.fA[t-1],this.uA[t]=this.uA[t-1],this.dA[t]=this.dA[t-1];this.fA[0]=e,this.uA[0]=s,this.dA[0]=t}}class St extends It{static count=0;static zs=[];static Dh=new q(30);static Zs=t=>{const i=new O(t.read('spotanim.dat'));this.count=i.Zt;for(let t=0;t=40&&t<50?this.Sw[t-40]=i.Zt:t>=50&&t<60?this.xw[t-50]=i.Zt:console.log('Error unrecognised spotanim config code: ',t)}Ml(){let t=St.Dh?.get(BigInt(this.id));if(t)return t;t=j.model(this.model);for(let i=0;i<6;i++)0!==this.Sw[0]&&t.Qr(this.Sw[i],this.xw[i]);return St.Dh?.put(BigInt(this.id),t),t}}class xt extends It{static count=0;static zs=[];static Zs=t=>{const i=new O(t.read('idk.dat'));this.count=i.Zt;for(let t=0;t=40&&t<50?this.Sw[t-40]=i.Zt:t>=50&&t<60?this.xw[t-50]=i.Zt:t>=60&&t<70?this.IA[t-60]=i.Zt:console.log('Error unrecognised config code: ',t)}Ml(){if(!this.Rw)return null;const t=new v(this.Rw.length,null);for(let i=0;i{this.EA=i,this.Xs=new O(t.read('obj.dat'));const e=new O(t.read('obj.idx'));this.count=e.Zt,this.gw=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.gw||!this.Xs)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Iw=(this.Iw+1)%10;const i=this.cache[this.Iw];return this.Xs.Vt=this.gw[t],i.id=t,i.reset(),i.ow(this.Xs),-1!==i.bA&&i.OA(),!this.EA&&i.members&&(i.name='Members Object',i.Lw="Login to a members' server to use this object.",i.Ow=null,i.RA=null),i};static Xi=()=>{this.Dh=null,this.TA=null,this.gw=null,this.cache=null,this.Xs=null};static vA=(t,i)=>{if(Mt.TA){let e=Mt.TA.get(BigInt(t));if(e&&e._i!==i&&-1!==e._i&&(e.nt(),e=null),e)return e}let e=Mt.get(t);if(e.LA||(i=-1),e.LA&&e.SA&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.SA[s]&&0!==e.SA[s]&&(t=e.LA[s]);-1!==t&&(e=Mt.get(t))}const s=new J(32,32),n=N.ki,r=N.Di,h=N.Mi,o=m.lt,l=m.ct,a=m.ft,c=m.left,f=m.right,u=m.top,d=m.bottom;N.Ni=!1,m.bind(s.lt,32,32),m.fillRect(0,0,32,32,Ot.gy),N.ji();const w=e.xA(1),y=N.sin[e.MA]*e.kA>>16,p=N.cos[e.MA]*e.kA>>16;w.nh(0,e.DA,e.NA,e.MA,e.FA,y+(w.vr/2|0)+e.BA,p+e.BA);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.lt[t+32*i]&&(t>0&&s.lt[t+32*i-1]>1||i>0&&s.lt[t+32*(i-1)]>1||t<31&&s.lt[t+32*i+1]>1||i<31&&s.lt[t+32*(i+1)]>1)&&(s.lt[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.lt[t+32*i]&&t>0&&i>0&&s.lt[t+32*(i-1)-1]>0&&(s.lt[t+32*i]=3153952);if(-1!==e.bA){const t=this.vA(e.PA,10),i=t.Ai,s=t._i;t.Ai=32,t._i=32,t.bi(5,5,22,22),t.Ai=i,t._i=s}return Mt.TA?.put(BigInt(t),s),m.bind(o,l,a),m.yt(c,u,f,d),N.ki=n,N.Di=r,N.Mi=h,N.Ni=!0,e.UA?s.Ai=33:s.Ai=32,s._i=i,s};model=0;name=null;Lw=null;Sw=null;xw=null;kA=2e3;MA=0;DA=0;NA=0;FA=0;BA=0;WA=!1;GA=-1;UA=!1;YA=1;members=!1;Ow=null;RA=null;HA=-1;VA=-1;KA=0;XA=-1;jA=-1;zA=0;ZA=-1;qA=-1;JA=-1;$A=-1;QA=-1;t_=-1;LA=null;SA=null;PA=-1;bA=-1;decode(t,i){if(1===t)this.model=i.Zt;else if(2===t)this.name=i.ei;else if(3===t)this.Lw=i.ei;else if(4===t)this.kA=i.Zt;else if(5===t)this.MA=i.Zt;else if(6===t)this.DA=i.Zt;else if(7===t)this.FA=i.qt,this.FA>32767&&(this.FA-=65536);else if(8===t)this.BA=i.qt,this.BA>32767&&(this.BA-=65536);else if(9===t)this.WA=!0;else if(10===t)this.GA=i.Zt;else if(11===t)this.UA=!0;else if(12===t)this.YA=i.$t;else if(16===t)this.members=!0;else if(23===t)this.HA=i.Zt,this.KA=i.zt;else if(24===t)this.VA=i.Zt;else if(25===t)this.XA=i.Zt,this.zA=i.zt;else if(26===t)this.jA=i.Zt;else if(t>=30&&t<35)this.Ow||(this.Ow=new v(5,null)),this.Ow[t-30]=i.ei,'hidden'===this.Ow[t-30]?.toLowerCase()&&(this.Ow[t-30]=null);else if(t>=35&&t<40)this.RA||(this.RA=new v(5,null)),this.RA[t-35]=i.ei;else if(40===t){const t=i.jt;this.Sw=new Uint16Array(t),this.xw=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.LA&&this.SA||(this.LA=new Uint16Array(10),this.SA=new Uint16Array(10)),this.LA[t-100]=i.Zt,this.SA[t-100]=i.Zt)}i_(t){let i=this.HA;if(1===t&&(i=this.XA),-1===i)return null;let e=this.VA,s=this.ZA;1===t&&(e=this.jA,s=this.qA);let n=j.model(i);if(-1!==e){const t=j.model(e);if(-1===s){const i=[n,t];n=j.Wr(i,2)}else{const i=[n,t,j.model(s)];n=j.Wr(i,3)}}if(0===t&&0!==this.KA&&n.translate(this.KA,0,0),1===t&&0!==this.zA&&n.translate(this.zA,0,0),this.Sw&&this.xw)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.SA[e]&&0!==this.SA[e]&&(i=this.LA[e]);if(-1!==i)return Mt.get(i).xA(1)}if(Mt.Dh){const t=Mt.Dh.get(BigInt(this.id));if(t)return t}const i=j.model(this.model);if(this.Sw&&this.xw)for(let t=0;t=this.I_&&(this.b_=null),t>=this.g_&&t=kt.d_[i].length)&&(e=0),this.p_[i]=e}this.bp=t.Zt,65535===this.bp&&(this.bp=-1),this.Op=t.Zt,65535===this.Op&&(this.Op=-1),this.Rp=t.Zt,65535===this.Rp&&(this.Rp=-1),this.vp=t.Zt,65535===this.vp&&(this.vp=-1),this.Lp=t.Zt,65535===this.Lp&&(this.Lp=-1),this.Sp=t.Zt,65535===this.Sp&&(this.Sp=-1),this.xp=t.Zt,65535===this.xp&&(this.xp=-1),this.name=$.xh($.Oh(t.Qt)),this.A_=t.jt,this.visible=!0,this.__=0n;for(let t=0;t<12;t++)this.__<<=0x4n,this.m_[t]>=256&&(this.__+=BigInt(this.m_[t])-256n);this.m_[0]>=256&&(this.__+=BigInt(this.m_[0])-256n>>4n),this.m_[1]>=256&&(this.__+=BigInt(this.m_[1])-256n>>8n);for(let t=0;t<5;t++)this.__<<=0x3n,this.__+=BigInt(this.p_[t]);this.__<<=0x1n,this.__+=BigInt(this.w_)}CA(){if(!this.visible)return null;const t=new v(12,null);let i=0;for(let e=0;e<12;e++){const s=this.m_[e];if(s>=256&&s<512&&(t[i++]=xt.zs[s-256].CA()),s>=512){const e=Mt.get(s-512).CA(this.w_);e&&(t[i++]=e)}}const e=j.Wr(t,i);for(let t=0;t<5;t++)0!==this.p_[t]&&(e.Qr(kt.d_[t][0],kt.d_[t][this.p_[t]]),1===t&&e.Qr(kt.u_[0],kt.u_[this.p_[t]]));return e}O_(){let t=this.__,i=-1,e=-1,s=-1,n=-1;if(this.jp>=0&&0===this.qp){const r=bt.zs[this.jp];if(r.frames&&(i=r.frames[this.zp]),this.Vp>=0&&this.Vp!==this.bp){const t=bt.zs[this.Vp].frames;t&&(e=t[this.Kp])}r.uy>=0&&(s=r.uy,t+=BigInt(s-this.m_[5])<<8n),r.wy>=0&&(n=r.wy,t+=BigInt(n-this.m_[3])<<16n)}else if(this.Vp>=0){const t=bt.zs[this.Vp].frames;t&&(i=t[this.Kp])}let r=kt.Dh?.get(t);if(!r){const i=new v(12,null);let e=0;for(let t=0;t<12;t++){let r=this.m_[t];if(n>=0&&3===t&&(r=n),s>=0&&5===t&&(r=s),r>=256&&r<512){const t=xt.zs[r-256].Ml();t&&(i[e++]=t)}if(r>=512){const t=Mt.get(r-512).i_(this.w_);t&&(i[e++]=t)}}r=j.Wr(i,e);for(let t=0;t<5;t++)0!==this.p_[t]&&(r.Qr(kt.d_[t][0],kt.d_[t][this.p_[t]]),1===t&&r.Qr(kt.u_[0],kt.u_[this.p_[t]]));r.jr(),r.ih(64,850,-30,-50,-30,!0),kt.Dh?.put(t,r)}if(this.Ri)return r;const h=j.Nr(r,!0);return-1!==i&&-1!==e?h.zr(i,e,bt.zs[this.jp].oy):-1!==i&&h.qr(i),h.Ur(),h.Br=null,h.Fr=null,h}}class Dt extends It{static count=0;static cache=null;static Xs=null;static gw=null;static Iw=0;static Dh=new q(30);static Zs=t=>{this.Xs=new O(t.read('npc.dat'));const i=new O(t.read('npc.idx'));this.count=i.Zt,this.gw=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.gw||!this.Xs)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Iw=(this.Iw+1)%20;const i=this.cache[this.Iw]=new Dt(t);return this.Xs.Vt=this.gw[t],i.ow(this.Xs),i};static Xi=()=>{this.Dh=null,this.gw=null,this.cache=null,this.Xs=null};name=null;Lw=null;size=1;Rw=null;IA=null;Fw=!1;R_=-1;v_=-1;L_=-1;S_=-1;x_=-1;Sw=null;xw=null;Ow=null;Vw=-1;Kw=-1;Xw=-1;M_=!0;k_=-1;_A=128;gA=128;decode(t,i){if(1===t){const t=i.jt;this.Rw=new Uint16Array(t);for(let e=0;e=30&&t<40)this.Ow||(this.Ow=new v(5,null)),this.Ow[t-30]=i.ei,'hidden'===this.Ow[t-30]?.toLowerCase()&&(this.Ow[t-30]=null);else if(40===t){const t=i.jt;this.Sw=new Uint16Array(t),this.xw=new Uint16Array(t);for(let e=0;e{const i=new O(t.read('varp.dat'));this.count=i.Zt;for(let t=0;t{if('complete'===t.iceGatheringState){let i;self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(t.localDescription)):console.log(JSON.stringify(t.localDescription));try{for(;null===(i=prompt('Offer copied to clipboard, paste answer here')););t.setRemoteDescription(new RTCSessionDescription(JSON.parse(i)))}catch(t){console.error(t)}}},i.onopen=()=>{i.send(JSON.stringify({type:'id',id:e})),console.log('Connected to peer!')},i.onerror=t=>{console.error(t)},i.onmessage=t=>{const i=JSON.parse(t.data);i.data&&(i.data=Object.values(i.data)),this.Y_&&this.Y_.postMessage(i)}}postMessage(t){const i=this.G_.get(t.data.id),e=t.data;e.data&&(e.data=Array.from(t.data.data)),i&&'open'===i.readyState&&i.send(JSON.stringify(e))}}class Pt{pc;K_=void 0;H_;constructor(t){this.pc=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),this.pc.ondatachannel=i=>{this.K_=i.channel,this.K_.onopen=()=>{console.log('Connected to host!')},this.K_.onerror=t=>{console.error(t)},this.K_.onmessage=i=>{if(!this.H_){const t=JSON.parse(i.data);if('id'===t.type)return void(this.H_=t.id)}t.onmessage&&t.onmessage(i)}},this.pc.onicegatheringstatechange=async()=>{'complete'===this.pc.iceGatheringState&&(self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(this.pc.localDescription)):console.log(JSON.stringify(this.pc.localDescription)))}}async X_(t){await this.pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(t))),await this.pc.setLocalDescription(await this.pc.createAnswer())}}class Ut extends U{static j_=225;static z_=10;static portOffset=0;static members=!0;static Ri=!1;static Z_='';static q_='';static J_=!1;static Q_=2;static tg=!1;static ig='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static eg=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static sg=0;static ng=0;static rg=0;static hg=0;static og=0;static lg=0;static ag=0;static cg=0;static fg=0;static ug=0;static dg=0;static wg=0;static yg=0;static mg=0;static pg=0;static Ag=()=>{gt.Ri=!1,N.Ri=!1,Ut.Ri=!1,Rt.Ri=!1};static _g=()=>{gt.Ri=!0,N.Ri=!0,Ut.Ri=!0,Rt.Ri=!0};gg=2048;Ig=2047;Cg=!1;Eg=!1;Tg=!1;bg=!1;db=null;Og=0;Rg=[];stream=null;in=O.Xt(1);vg=O.Xt(1);Lg=O.Xt(1);Sg=0n;xg=0;Mg=0;kg=0;Dg=null;Ng=0;packetSize=0;Fg=0;Bg=0;Pg=0;Ug=null;Wg=!0;Gg=0;Yg=0;Hg=null;Vg=null;Kg=null;Xg=null;jg=null;zg=null;Zg=null;qg=null;Jg=null;$g=null;Qg=null;tI='';iI='';username='';password='';eI=null;sI=null;nI=null;rI=null;hI=[];oI=!1;lI=null;aI=null;cI=null;fI=null;uI=null;dI=null;wI=null;yI=null;mI=null;pI=null;AI=new Int32Array(256);_I=0;gI=0;II=0;CI=null;EI=null;TI=null;bI=null;OI=null;RI=null;vI=null;LI=null;SI=null;xI=null;MI=null;kI=null;DI=null;NI=null;FI=null;BI=null;UI=null;WI=null;GI=null;YI=null;HI=null;VI=new Int32Array(33);KI=new Int32Array(33);XI=new Int32Array(151);jI=new Int32Array(151);zI=null;ZI=null;qI=null;JI=null;$I=null;QI=null;tC=new v(13,null);iC=null;eC=null;sC=new v(50,null);nC=new v(50,null);rC=new v(20,null);hC=new v(20,null);oC=null;lC=new v(8,null);aC=null;cC=null;fC=null;uC=null;dC=null;wC=null;yC=null;mC=null;pC=null;AC=null;_C=null;gC=null;IC=null;CC=null;EC=null;TC=null;bC=null;OC=null;RC=new v(1e3,null);vC=!1;LC=!1;SC=!1;xC=!1;MC=-1;kC=0;DC=0;NC=0;FC=0;BC=0;PC=0;UC=!1;WC=0;GC=0;YC=0;HC=0;VC=0;KC=0;XC=[];jC=-1;zC=-1;ZC=new Q;qC=78;JC=0;$C=0;QC=[];tE=0;iE=0;eE=0;sE=0;nE=0;rE=0;hE=0;oE=0;lE=[];aE=[];cE=[];fE=[];uE=null;dE=-1;wE=3;yE=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];mE=0;pE=0;AE=0;_E=!1;gE=0;IE=!1;CE='';EE='';TE=0;bE='';OE=!1;RE=-1;vE=new v(100,null);LE=new v(100,null);messageType=new Int32Array(100);SE=new Int32Array(100);xE=0;ME=0;kE=0;DE='';NE=0;FE=0;BE=0;PE=0;UE=0;WE=0;GE=0;YE=0;HE=0;VE=!1;KE=0;XE=0;jE=0;zE=0;ZE=null;qE=0;JE=0;$E=0;QE=0;tT=!1;iT=[];eT=[];sT=0;nT=0;rT=0;hT=null;oT=0;lT=new Int32Array(500);aT=new Int32Array(500);cT=new Int32Array(500);fT=new Int32Array(500);uT=0;dT=0;wT=0;yT='';mT=!1;pT=-1;AT=0;_T=0;gT=0;IT=0;CT=0;ET=new Int32Array(1e3);TT=new Int32Array(1e3);bT=null;OT=0;RT=0;vT=0;LT=0;ST=0;xT=!1;MT=0;kT=0;DT=0;NT=0;FT=2;BT=2;PT=1;UT=new Int32Array(5);WT=new v(5,!1);GT=new Int32Array(5);YT=new Int32Array(5);HT=new Int32Array(5);VT=0;KT=0;XT=0;jT=0;zT=0;ZT=0;qT=0;JT=0;$T=0;QT=1;tb=2;ib=-1;Xn=0;zn=0;eb=0;sb=0;nb=0;rb=0;hb=null;ob=null;lb=null;ab=0;cb=0;fb=new Int8Array(16384);ub=new v(ut.wf,null);wb=0;yb=0;mb=128;pb=0;Ab=0;_b=0;gb=0;Ib=0;rp=null;hp=null;Cb=new k(ut.yf,ut.yf);Eb=0;Tb=0;bb=0;Ob=0;Rb=0;vb=0;Lb=0;Sb=0;xb=0;Mb=0;kb=0;Db=0;Nb=new v(this.gg,null);Fb=0;Bb=new Int32Array(this.gg);Pb=0;Ub=0;Wb=new Int32Array(this.gg);Gb=new Int32Array(1e3);Yb=new v(this.gg,null);Hb=new v(8192,null);Vb=0;Kb=new Int32Array(8192);Xb=new b;jb=new b;zb=new b;ud=new b;Zb=new S(ut.wf,ut.yf,ut.yf,null);qb=new b;Jb=new Int32Array(4e3);$b=new Int32Array(4e3);Qb=new Int32Array(ut.yf*ut.yf);tO=new Int32Array(ut.yf*ut.yf);iO=0;eO=null;sO=0;nO=0;rO=-1;hO=0;oO=0;lO=0;aO=0;cO=!1;fO=!0;uO=!1;dO=new Int32Array(7);wO=new Int32Array(5);yO=0;mO=0;static pO=50;AO=new Int32Array(Ut.pO);_O=new Int32Array(Ut.pO);gO=new Int32Array(Ut.pO);IO=new Int32Array(Ut.pO);CO=new Int32Array(Ut.pO);EO=new Int32Array(Ut.pO);TO=new Int32Array(Ut.pO);bO=new v(Ut.pO,null);OO=new v(100,null);RO=new BigInt64Array(100);vO=new Int32Array(100);LO=null;SO=0;xO=!0;MO=new Int32Array(50);kO=new Int32Array(50);DO=new Int32Array(50);NO=192;FO=-1;BO=-1;PO=0;UO=0;WO=0;GO=!0;YO=null;HO=0;VO=0;KO=192;Y_=void 0;XO=!1;host=null;jO=null;zO=new v(16,null);ZO=0;qO=!1;Xi=()=>{try{this.stream&&this.stream.close()}catch(t){}var t;this.jO&&'998'===Ut.getParameter('world')&&this.jO.K_?.send(JSON.stringify({type:'close',id:this.jO.H_})),this.stream=null,t=!1,window._tinyMidiStop&&window._tinyMidiStop(t),this.vg=null,this.Lg=null,this.in=null,this.lb=null,this.hb=null,this.ob=null,this.rp=null,this.hp=null,this.bT=null,this.ub=null,this.Qb=null,this.tO=null,this.Jb=null,this.$b=null,this.fb=null,this.EI=null,this.TI=null,this.bI=null,this.OI=null,this.RI=null,this.vI=null,this.LI=null,this.SI=null,this.xI=null,this.MI=null,this.kI=null,this.DI=null,this.NI=null,this.FI=null,this.BI=null,this.UI=null,this.WI=null,this.zI=null,this.qI=null,this.ZI=null,this.JI=null,this.$I=null,this.QI=null,this.tC=null,this.yC=null,this.mC=null,this.pC=null,this.AC=null,this._C=null,this.gC=null,this.IC=null,this.CC=null,this.EC=null,this.TC=null,this.eC=null,this.rC=null,this.hC=null,this.lC=null,this.aC=null,this.cC=null,this.fC=null,this.uC=null,this.sC=null,this.nC=null,this.Cb=null,this.Nb=null,this.Bb=null,this.Wb=null,this.Yb=null,this.Gb=null,this.Hb=null,this.Kb=null,this.Zb=null,this.qb=null,this.ud=null,this.Xb=null,this.jb=null,this.zb=null,this.cT=null,this.fT=null,this.lT=null,this.aT=null,this.XC=null,this.iT=null,this.ET=null,this.TT=null,this.RC=null,this.iC=null,this.OO=null,this.RO=null,this.vO=null,this.Xg=null,this.jg=null,this.Hg=null,this.Vg=null,this.Kg=null,this.zg=null,this.Zg=null,this.qg=null,this.Jg=null,this.JO(),Et.Xi(),Dt.Xi(),Mt.Xi(),Ct.zs=null,xt.zs=null,Q.zs=null,bt.zs=null,St.zs=null,St.Dh=null,Nt.zs=null,this.xe=null,kt.Dh=null,N.Xi(),gt.Xi(),j.Xi(),H.zs=[],V.zs=[]};xs(){return this.Gg}Ls(){return this.OE}Ss(){return this.IE}vs(){return this.zC}Rs(){return this.MC}JO=()=>{this.oI=!1,this.CI&&(clearInterval(this.CI),this.CI=null),this.$g=null,this.Qg=null,this.hI=[],this.wI=null,this.yI=null,this.mI=null,this.pI=null,this.fI=null,this.cI=null,this.uI=null,this.dI=null,this.lI=null,this.aI=null};$O=()=>{'999'===Ut.getParameter('world')?(this.Y_=new Worker('worker.js',{type:'module'}),this.Y_.onmessage=this.onmessage,this.host=new Bt(this.Y_)):'998'===Ut.getParameter('world')&&(this.Y_={onmessage:t=>{this.stream.QO.onmessage(t)},postMessage:t=>{this.jO&&this.jO.K_&&'open'===this.jO.K_.readyState&&this.jO.K_.send(JSON.stringify(t))},onerror:null,onmessageerror:null,terminate:()=>{throw new Error},addEventListener:()=>{throw new Error},removeEventListener:()=>{throw new Error},dispatchEvent:()=>{throw new Error}},this.jO=new Pt(this.Y_))};onmessage=t=>{switch(t.data.type){case'ready':return void(this.XO=!0);case'save':return Ft(t.data.value,t.data.path.split('/').pop().split('\\').pop()),void URL.revokeObjectURL(t.data.value);case'close':return void this.Y_?.postMessage({type:'close',id:t.data.id})}this.host?.H_===t.data.id?this.stream.QO.onmessage(t.data):this.host?.postMessage(t)};tR=async()=>{if(999==+Ut.getParameter('world'))this.host&&await this.host.V_();else if(998==+Ut.getParameter('world')&&this.jO){if(this.jO.K_)return void console.log('You are already connected.');const t=prompt('Paste offer here, answer will be copied to clipboard');if(t)try{await this.jO.X_(t)}catch(t){console.error(t)}}};iR=async(t,i,e,s)=>{let n=5,r=await(this.db?.Ds(t));if(r&&O.Ht(r)!==e&&(r=void 0),r)return new G(r);for(;!r;){await this.fs(s,`Requesting ${i}`);try{r=+Ut.getParameter('world')<998?await T(`${Ut.q_}/${t}${e}`):await T(`${Ut.q_}/${t}`)}catch(t){r=void 0;for(let t=n;t>0;t--)await this.fs(s,`Error loading - Will retry in ${t} secs.`),await E(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Ns(t,r)),new G(r)};eR=async(t,e,s,n)=>{let r=await(this.db?.Ds(t+'.mid'));if(r&&12345678!==e&&O.Ht(r)!==e&&(r=void 0),!r)try{r=+Ut.getParameter('world')<998?await T(`${Ut.q_}/${t}_${e}.mid`):await T(`${Ut.q_}/songs/${t}.mid`),s!==r.length&&(r=r.slice(0,s))}catch(t){}if(!r)return;await(this.db?.Ns(t+'.mid',r));const h=new O(Uint8Array.from(r)).$t;!function(t,i,e){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256,e)}(i.read(h,r,s,4),this.KO,n)};sR=()=>{if(A.fillStyle='black',A.fillRect(0,0,this.width,this.height),this.ds(1),this.Tg){this.oI=!1,A.font='bold 16px helvetica, sans-serif',A.textAlign='left',A.fillStyle='yellow';let t=35;A.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,A.fillStyle='white',A.fillText('To fix this try the following (in order):',30,t),t+=50,A.font='bold 12px helvetica, sans-serif',A.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,A.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,A.fillText('3: Try using a different game-world',30,t),t+=30,A.fillText('4: Try rebooting your computer',30,t),t+=30,A.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.bg&&(this.oI=!1,A.font='bold 20px helvetica, sans-serif',A.textAlign='left',A.fillStyle='white',A.fillText('Error - unable to load game!',50,50),A.fillText('To play RuneScape make sure you play from',50,100),A.fillText('https://2004scape.org',50,150)),this.Eg){this.oI=!1,A.font='bold 13px helvetica, sans-serif',A.textAlign='left',A.fillStyle='yellow';let t=35;A.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,A.fillStyle='white',A.fillText('To fix this try the following (in order):',30,t),t+=50,A.font='bold 12px helvetica, sans-serif',A.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,A.fillText('2: Try rebooting your computer, and reloading',30,t)}};nR=t=>{if(!t.ll)return!1;for(let i=0;i=s)return!1}else if(3===t.ll[i]){if(e<=s)return!1}else if(4===t.ll[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};hR=(t,i,e,s,n)=>{this.dC?.draw(t,i),this.wC?.draw(t,i+n-16),m.fillRect(t,i+16,16,n-32,Ot.My);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;m.fillRect(t,i+h+16,16,r,Ot.ky),m.It(t,i+h+16,Ot.Dy,r),m.It(t+1,i+h+16,Ot.Dy,r),m.gt(t,i+h+16,Ot.Dy,16),m.gt(t,i+h+17,Ot.Dy,16),m.It(t+15,i+h+16,Ot.Ny,r),m.It(t+14,i+h+17,Ot.Ny,r-1),m.gt(t,i+h+r+15,Ot.Ny,16),m.gt(t+1,i+h+r+14,Ot.Ny,15)};oR=(t,i)=>{let e=!1;const s=Q.zs[t];if(!s.cl)return!1;for(let t=0;ts.delay[n.Yl];)n.Hl-=s.delay[n.Yl]+1,n.Yl++,n.Yl>=s.ny&&(n.Yl-=s.sy,(n.Yl<0||n.Yl>=s.ny)&&(n.Yl=0)),e=!0}}}return e};lR=(t,i,e,s,n=!1)=>{if(0!==t.type||!t.cl||t.hide&&this.NE!==t.id&&this.FE!==t.id&&this.BE!==t.id)return;const r=m.left,h=m.top,o=m.right,l=m.bottom;m.yt(i,e,i+t.width,e+t.height);const a=t.cl.length;for(let r=0;r0&&this.aR(l),l.type===Q.Nh)l.Gl>l.scroll-l.height&&(l.Gl=l.scroll-l.height),l.Gl<0&&(l.Gl=0),this.lR(l,h,o,l.Gl,n),l.scroll>l.height&&this.hR(h+l.width,o,l.Gl,l.scroll,l.height);else if(l.type===Q.Bh){let t=0;for(let i=0;i0){let i=0,e=0;const r=l.dl[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.WE&&this.UE===t){const h=Mt.vA(r,l.wl[t]);if(0!==this.WE&&this.UE===t&&this.PE===l.id?(i=this.Ve-this.GE,e=this.Ke-this.YE,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.HE<5&&(i=0,e=0),h.ph(128,s+i,n+e)):0!==this.qE&&this.JE===t&&this.$E===l.id?h.ph(128,s,n):h.draw(s,n),33===h.Ai||1!==l.wl[t]){const r=l.wl[t];this.eI?.cR(s+i+1,n+10+e,this.fR(r),Ot.gy),this.eI?.cR(s+i,n+9+e,this.fR(r),Ot.my)}}}else if(l.Il&&t<20){const i=l.Il[t];i?.draw(s,n)}t++}}else if(l.type===Q.Ph)l.fill?m.fillRect(h,o,l.width,l.height,l.Rl):m._t(h,o,l.width,l.height,l.Rl);else if(l.type===Q.Uh){const t=l.font;let i=l.Rl,e=l.text;if(this.BE!==l.id&&this.FE!==l.id&&this.NE!==l.id||0===l.Ll||(i=l.Ll),this.nR(l)&&(i=l.vl,l.Ol&&l.Ol.length>0&&(e=l.Ol)),l.rl===Q.zh&&this.tT&&(e='Please wait...',i=l.Rl),!t||!e)continue;for(let s=o+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.uR(this.rR(l,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.uR(this.rR(l,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.uR(this.rR(l,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.uR(this.rR(l,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.uR(this.rR(l,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),l.Tl?t.dR(h+(l.width/2|0),s,r,i,l.bl):t.wR(h,s,r,i,l.bl)}}else if(l.type===Q.Wh){let t;t=this.nR(l)?l.xl:l.Sl,t?.draw(h,o)}else if(l.type===Q.Gh){const t=N.ki,i=N.Di;N.ki=h+(l.width/2|0),N.Di=o+(l.height/2|0);const e=N.sin[l.Fl]*l.zoom>>16,s=N.cos[l.Fl]*l.zoom>>16,n=this.nR(l);let r;r=n?l.Nl:l.Dl;let a=null;if(-1===r)a=l.Ml(-1,-1,n);else{const t=bt.zs[r];t.frames&&t.hy&&(a=l.Ml(t.frames[l.Yl],t.hy[l.Yl],n))}a&&a.nh(0,l.Bl,0,l.Fl,0,e,s),N.ki=t,N.Di=i}else if(l.type===Q.Yh){const t=l.font;if(!t||!l.dl||!l.wl)continue;let i=0;for(let e=0;e0){const n=Mt.get(l.dl[i]-1);let r=n.name;if((n.UA||1!==l.wl[i])&&(r=r+' x'+this.yR(l.wl[i])),!r)continue;const a=h+s*(l.pl+115),c=o+e*(l.Al+12);l.Tl?t.dR(a+(l.width/2|0),c,r,l.Rl,l.bl):t.wR(a,c,r,l.Rl,l.bl)}i++}}}m.yt(r,h,o,l)};aR=t=>{let i=t.hl;if(i>=Q.Zh&&i<=Q.qh)i--,i>=this.yO?(t.text='',t.rl=0):(t.text=this.OO[i],t.rl=1);else if(i>=Q.Jh&&i<=Q.$h)i-=Q.Jh,i>=this.yO?(t.text='',t.rl=0):(0===this.vO[i]?t.text='@red@Offline':this.vO[i]===Ut.z_?t.text='@gre@World-'+(this.vO[i]-9):t.text='@yel@World-'+(this.vO[i]-9),t.rl=1);else if(i===Q.eo)t.scroll=15*this.yO+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=Q.ko&&i<=Q.Do)i-=Q.ko,i>=this.$C?(t.text='',t.rl=0):(t.text=$.xh($.Oh(this.QC[i])),t.rl=1);else if(i===Q.Bo)t.scroll=15*this.$C+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===Q.Mo){if(t.Fl=150,t.Bl=256*Math.sin(this.Og/40)&2047,this.uO){this.uO=!1;const i=new v(7,null);let e=0;for(let t=0;t<7;t++){const s=this.dO[t];s>=0&&(i[e++]=xt.zs[s].Ml())}const s=j.Wr(i,e);for(let t=0;t<5;t++)0!==this.wO[t]&&(s.Qr(kt.d_[t][0],kt.d_[t][this.wO[t]]),1===t&&s.Qr(kt.u_[0],kt.u_[this.wO[t]]));if(this.eO){const i=bt.zs[this.eO.bp].frames;i&&(s.jr(),s.qr(i[0]),s.ih(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===Q.Lo)this.bC||(this.bC=t.Sl,this.OC=t.xl),this.fO?t.Sl=this.OC:t.Sl=this.bC;else if(i===Q.So)this.bC||(this.bC=t.Sl,this.OC=t.xl),this.fO?t.Sl=this.bC:t.Sl=this.OC;else if(i===Q.Po)t.text=this.yT,this.Og%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===Q.Jo)this.cO?this.mT?(t.Rl=Ot.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Rl=Ot._y,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===Q.$o||i===Q.sl)if(0===this.AT)t.text='';else{let i;i=0===this._T?'earlier today':1===this._T?'yesterday':this._T+' days ago',t.text='You last logged in '+i+' from: '+$.Sh(this.AT)}else if(i===Q.Qo)0===this.IT&&(t.text='0 unread messages',t.Rl=Ot.my),1===this.IT&&(t.text='1 unread message',t.Rl=Ot.GREEN),this.IT>1&&(t.text=this.IT+' unread messages',t.Rl=Ot.GREEN);else if(i===Q.tl)if(201===this.gT)t.text='';else if(200===this.gT)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.gT?'Earlier today':1===this.gT?'Yesterday':this.gT+' days ago',t.text=i+' you changed your recovery questions'}else i===Q.il?201===this.gT?t.text='':200===this.gT?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===Q.el&&(201===this.gT?t.text='':(this.gT,t.text="Do this from the 'account management' area on our front webpage"))};rR=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let s=0,n=0;for(;;){const t=e[n++];if(0===t)return s;if(1===t)s+=this.aE[e[n++]];else if(2===t)s+=this.cE[e[n++]];else if(3===t)s+=this.lE[e[n++]];else if(4===t){const t=Q.zs[e[n++]],i=e[n++]+1;if(t.dl&&t.wl)for(let e=0;et<999999999?String(t):'*';yR=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};fR=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}(new class extends Ut{Cg=!1;Eg=!1;Tg=!1;bg=!1;mR=null;pR=null;AR=null;_R=null;gR=null;IR=null;Lu=0;Su=0;xu=0;CR=0;ER=0;TR=2;model={id:parseInt(U.getParameter('model'))||0,bR:null,x:0,y:0,z:420,Ta:0};OR=null;constructor(){super(!0)}load=async()=>{if(this.Cg)this.Eg=!0;else{this.Cg=!0;try{await async function(t){if(o||h)return;o=!0;const i=await r(t);h||(h=i)}(),await i.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new W(await W.openDatabase()),this.mR=document.getElementById('rightPanel');const t=document.getElementById('mainPanel');t&&(t.ondragover=t=>{t.preventDefault(),t.stopPropagation()},t.ondrop=async t=>{if(t.preventDefault(),t.stopPropagation(),!t.dataTransfer||!t.dataTransfer.files.length)return;const i=['main_file_cache.dat','main_file_cache.idx0','main_file_cache.idx1','main_file_cache.idx2','main_file_cache.idx3','main_file_cache.idx4'],e=[];for(let s=0;s{this.Eg||this.Tg||this.bg||(this.RR(),this.vR())};draw=async()=>{this.Eg||this.Tg||this.bg?this.sR():(j.$n=!0,j.Ve=this.Ve,j.Ke=this.Ke,this.xe?.bind(),m.clear(),m.fillRect(0,0,this.width,this.height,Ot.gy),null!==this.model.bR&&(this.model.bR.draw(this.model.Ta,N.sin[this.CR],N.cos[this.CR],N.sin[this.ER],N.cos[this.ER],this.model.x-this.Lu,this.model.y-this.Su,this.model.z-this.xu,0),-1!==this.model.bR.Vr&&this.model.bR.ah(this.model.bR.Vr)),this.xe?.draw(0,0),this.OR?.draw(this.Ve,this.Ke))};init=async()=>{const t=await(this.db?.Ds('main_file_cache.dat'));if(!t){return document.getElementById('helpme').style.display='block',void(p.style.display='none')}const i=await(this.db?.Ds('main_file_cache.idx0')),e=await(this.db?.Ds('main_file_cache.idx1')),s=await(this.db?.Ds('main_file_cache.idx2')),n=await(this.db?.Ds('main_file_cache.idx3')),r=await(this.db?.Ds('main_file_cache.idx4'));if(!(i&&e&&s&&n&&r)){return document.getElementById('helpme').style.display='block',void(p.style.display='none')}document.getElementById('helpme').style.display='none',p.style.display='block',this.pR=new Y(t,i,0),this.AR=new Y(t,e,1),this._R=new Y(t,s,2),this.gR=new Y(t,n,3),this.IR=new Y(t,r,4),await this.fs(10,'Unpacking textures');const h=this.pR.read(6);N.qi(h),N.Qi(.8),N.ie(20),await this.fs(20,'Loading models...');for(let t=0;t{this.model.id=i,this.LR(i)},t.appendChild(e)}}await this.fs(80,'Finishing up...'),this.OR=new C(512,128),this.OR.bind();for(let t=0;t<512;t++)for(let i=0;i<128;i++){const e=t,s=127-i;m.bt(e,s,N.palette[i+128*t])}this.OR.draw(0,0)};LR(t){if(null===this.AR)return;const i=this.AR.read(t);null!==i?(this.model.bR=j.Gr(i,t),this.model.bR.ih(64,850,-30,-50,-30,!0),document.title=`Model ${t} | 2004Scape Tools`):document.title=`Missing model ${t} | 2004Scape Tools`}RR(){for(;;){const t=this.ys();if(-1===t)break;t==='r'.charCodeAt(0)?(this.TR=2,this.Lu=0,this.Su=0,this.xu=0,this.CR=0,this.ER=0,this.model.x=0,this.model.y=0,this.model.z=420,this.model.Ta=0):t==='1'.charCodeAt(0)?(this.model.id--,j.metadata&&this.model.id<0&&(this.model.id=j.metadata.length-1),this.LR(this.model.id)):t==='2'.charCodeAt(0)&&(this.model.id++,j.metadata&&this.model.id>=j.metadata.length&&(this.model.id=0),this.LR(this.model.id))}}vR(){this.Ze['['.charCodeAt(0)]?this.TR--:this.Ze[']'.charCodeAt(0)]&&this.TR++,this.Ze[1]?this.model.Ta+=this.TR:this.Ze[2]&&(this.model.Ta-=this.TR),this.Ze['w'.charCodeAt(0)]?this.model.z-=this.TR:this.Ze['s'.charCodeAt(0)]&&(this.model.z+=this.TR),this.Ze['a'.charCodeAt(0)]?this.model.x-=this.TR:this.Ze['d'.charCodeAt(0)]&&(this.model.x+=this.TR),this.Ze['q'.charCodeAt(0)]?this.model.y-=this.TR:this.Ze['e'.charCodeAt(0)]&&(this.model.y+=this.TR),this.CR=2047&this.CR,this.ER=2047&this.ER,this.model.Ta=2047&this.model.Ta}}).run().then((()=>{}))})()})(); \ No newline at end of file diff --git a/index.js b/index.js index d5613f50..ebded8b5 100644 --- a/index.js +++ b/index.js @@ -1 +1 @@ -(()=>{"use strict";var t,i,s,h,e={1651:(t,i,s)=>{s.d(i,{K:()=>D});var h=s(1120),e=s(4583),n=s(2901),r=s(1069),o=s(7046),l=(s(9896),s(6666)),a=s(3045),c=s(818),f=s(670),u=s(8268),d=s(3867),w=s(7854),y=s(8950),A=s(1302),p=s(9298),m=s(8665),I=s(1312),g=s(3819),E=s(8317),_=s(9234),C=s(1908),T=s(123),O=s(5637),v=s(6948),b=s(2164),L=s(8738),R=s(3764),S=s(8534),M=s(6730),k=s(2604),x=s(5226);class D extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static st=!1;static ht='';static et='';static nt=!1;static rt=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static It=0;static gt=0;static Et=0;static _t=0;static Ct=0;static Tt=0;static Ot=0;static vt=0;static bt=0;static Lt=()=>{a.A.st=!1,e.A.st=!1,D.st=!1,c.A.st=!1};static Rt=()=>{a.A.st=!0,e.A.st=!0,D.st=!0,c.A.st=!0};St=2048;Mt=2047;kt=!1;xt=!1;Dt=!1;Nt=!1;db=null;Pt=0;Ft=[];stream=null;in=r.A.Ut(1);Bt=r.A.Ut(1);Gt=r.A.Ut(1);Ht=0n;Wt=0;Yt=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;$t=!0;Jt=0;Qt=0;ti=null;ii=null;si=null;hi=null;ei=null;ni=null;ri=null;oi=null;li=null;ai=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;Ai=null;pi=[];mi=!1;Ii=null;gi=null;Ei=null;_i=null;Ci=null;Ti=null;Oi=null;vi=null;bi=null;Li=null;Ri=new Int32Array(256);Si=0;Mi=0;ki=0;xi=null;Di=null;Ni=null;Pi=null;Fi=null;Ui=null;Bi=null;Gi=null;Hi=null;Wi=null;Yi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;$i=null;Ji=null;Qi=null;ts=new Int32Array(33);ss=new Int32Array(33);hs=new Int32Array(151);es=new Int32Array(151);ns=null;rs=null;os=null;ls=null;cs=null;fs=null;us=new d.ds(13,null);ws=null;ys=null;As=new d.ds(50,null);ps=new d.ds(50,null);Is=new d.ds(20,null);gs=new d.ds(20,null);Es=null;_s=new d.ds(8,null);Cs=null;Ts=null;Os=null;vs=null;bs=null;Ls=null;Rs=null;Ss=null;Ms=null;ks=null;xs=null;Ds=null;Ns=null;Ps=null;Fs=null;Us=null;Bs=null;Gs=null;Hs=new d.ds(1e3,null);Ws=!1;Ys=!1;Vs=!1;Ks=!1;Xs=-1;js=0;zs=0;Zs=0;qs=0;$s=0;Js=0;Qs=!1;th=0;ih=0;sh=0;hh=0;eh=0;nh=0;rh=[];oh=-1;lh=-1;ah=new h.A;fh=78;uh=0;dh=0;wh=[];yh=0;Ah=0;ph=0;mh=0;Ih=0;gh=0;Eh=0;_h=0;Ch=[];Th=[];Oh=[];bh=[];Lh=null;Rh=-1;Sh=3;Mh=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];kh=0;xh=0;Dh=0;Nh=!1;Ph=0;Fh=!1;Uh='';Bh='';Gh=0;Hh='';Wh=!1;Yh=-1;Vh=new d.ds(100,null);Kh=new d.ds(100,null);messageType=new Int32Array(100);Xh=new Int32Array(100);jh=0;zh=0;Zh=0;qh='';$h=0;Jh=0;Qh=0;te=0;ie=0;se=0;he=0;ee=0;ne=0;re=!1;oe=0;le=0;ae=0;ce=0;fe=null;ue=0;de=0;we=0;ye=0;Ae=!1;pe=[];me=[];Ie=0;ge=0;Ee=0;_e=null;Ce=0;Te=new Int32Array(500);Oe=new Int32Array(500);ve=new Int32Array(500);be=new Int32Array(500);Le=0;Re=0;Se=0;Me='';ke=!1;xe=-1;De=0;Ne=0;Pe=0;Fe=0;Ue=0;Be=new Int32Array(1e3);Ge=new Int32Array(1e3);He=null;We=0;Ye=0;Ve=0;Ke=0;Xe=0;je=!1;ze=0;Ze=0;qe=0;$e=0;Je=2;Qe=2;tn=1;sn=new Int32Array(5);hn=new d.ds(5,!1);en=new Int32Array(5);nn=new Int32Array(5);rn=new Int32Array(5);ln=0;an=0;cn=0;fn=0;un=0;dn=0;wn=0;yn=0;An=0;pn=1;mn=2;In=-1;gn=0;En=0;_n=0;Cn=0;Tn=0;On=0;vn=null;bn=null;Ln=null;Rn=0;Sn=0;Mn=new Int8Array(16384);kn=new d.ds(f.A.xn,null);Dn=0;Nn=0;Pn=128;Fn=0;Un=0;Bn=0;Gn=0;Hn=0;Wn=null;Yn=null;Vn=new d.Kn(f.A.Xn,f.A.Xn);jn=0;zn=0;Zn=0;qn=0;$n=0;Jn=0;Qn=0;tr=0;ir=0;sr=0;hr=0;er=0;nr=new d.ds(this.St,null);rr=0;lr=new Int32Array(this.St);ar=0;cr=0;ur=new Int32Array(this.St);dr=new Int32Array(1e3);wr=new d.ds(this.St,null);yr=new d.ds(8192,null);Ar=0;pr=new Int32Array(8192);mr=new l.A;Ir=new l.A;gr=new l.A;Er=new l.A;_r=new d.Cr(f.A.xn,f.A.Xn,f.A.Xn,null);Tr=new l.A;Or=new Int32Array(4e3);vr=new Int32Array(4e3);br=new Int32Array(f.A.Xn*f.A.Xn);Lr=new Int32Array(f.A.Xn*f.A.Xn);Rr=0;Sr=null;Mr=0;kr=0;Dr=-1;Nr=0;Pr=0;Fr=0;Ur=0;Br=!1;Gr=!0;Hr=!1;Wr=new Int32Array(7);Yr=new Int32Array(5);Vr=0;Kr=0;static Xr=50;jr=new Int32Array(D.Xr);zr=new Int32Array(D.Xr);Zr=new Int32Array(D.Xr);qr=new Int32Array(D.Xr);$r=new Int32Array(D.Xr);Jr=new Int32Array(D.Xr);Qr=new Int32Array(D.Xr);io=new d.ds(D.Xr,null);so=new d.ds(100,null);ho=new BigInt64Array(100);eo=new Int32Array(100);no=null;ro=0;oo=!0;lo=new Int32Array(50);ao=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;Ao=0;po=!0;mo=null;Io=0;Eo=0;_o=192;Co=void 0;To=!1;host=null;Oo=null;vo=new d.ds(16,null);bo=0;Lo=!1;Ro=()=>{try{this.stream&&this.stream.close()}catch(t){}this.Oo&&'998'===D.getParameter('world')&&this.Oo.So?.send(JSON.stringify({type:'close',id:this.Oo.Mo})),this.stream=null,(0,T.ko)(!1),this.Bt=null,this.Gt=null,this.in=null,this.Ln=null,this.vn=null,this.bn=null,this.Wn=null,this.Yn=null,this.He=null,this.kn=null,this.br=null,this.Lr=null,this.Or=null,this.vr=null,this.Mn=null,this.Di=null,this.Ni=null,this.Pi=null,this.Fi=null,this.Ui=null,this.Bi=null,this.Gi=null,this.Hi=null,this.Wi=null,this.Yi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.ns=null,this.os=null,this.rs=null,this.ls=null,this.cs=null,this.fs=null,this.us=null,this.Rs=null,this.Ss=null,this.Ms=null,this.ks=null,this.xs=null,this.Ds=null,this.Ns=null,this.Ps=null,this.Fs=null,this.Us=null,this.ys=null,this.Is=null,this.gs=null,this._s=null,this.Cs=null,this.Ts=null,this.Os=null,this.vs=null,this.As=null,this.ps=null,this.Vn=null,this.nr=null,this.lr=null,this.ur=null,this.wr=null,this.dr=null,this.yr=null,this.pr=null,this._r=null,this.Tr=null,this.Er=null,this.mr=null,this.Ir=null,this.gr=null,this.ve=null,this.be=null,this.Te=null,this.Oe=null,this.rh=null,this.pe=null,this.Be=null,this.Ge=null,this.Hs=null,this.ws=null,this.so=null,this.ho=null,this.eo=null,this.hi=null,this.ei=null,this.ti=null,this.ii=null,this.si=null,this.ni=null,this.ri=null,this.oi=null,this.li=null,this.xo(),O.A.Ro(),v.A.Ro(),A.A.Ro(),b.A.Do=null,E.A.Do=null,h.A.Do=null,I.A.Do=null,L.A.Do=null,L.A.No=null,R.A.Do=null,this.Po=null,u.A.No=null,e.A.Ro(),a.A.Ro(),m.A.Ro(),S.A.Do=[],M.A.Do=[]};Fo(){return this.Jt}Uo(){return this.Wh}Bo(){return this.Fh}Go(){return this.lh}Ho(){return this.Xs}xo=()=>{this.mi=!1,this.xi&&(clearInterval(this.xi),this.xi=null),this.ai=null,this.ci=null,this.pi=[],this.Oi=null,this.vi=null,this.bi=null,this.Li=null,this._i=null,this.Ei=null,this.Ci=null,this.Ti=null,this.Ii=null,this.gi=null};Wo=()=>{'999'===D.getParameter('world')?(this.Co=new Worker('worker.js',{type:'module'}),this.Co.onmessage=this.onmessage,this.host=new x.x(this.Co)):'998'===D.getParameter('world')&&(this.Co={onmessage:t=>{this.stream.Yo.onmessage(t)},postMessage:t=>{this.Oo&&this.Oo.So&&'open'===this.Oo.So.readyState&&this.Oo.So.send(JSON.stringify(t))},onerror:null,onmessageerror:null,terminate:()=>{throw new Error},addEventListener:()=>{throw new Error},removeEventListener:()=>{throw new Error},dispatchEvent:()=>{throw new Error}},this.Oo=new x.Q(this.Co))};onmessage=t=>{switch(t.data.type){case'ready':return void(this.To=!0);case'save':return(0,k.A)(t.data.value,t.data.path.split('/').pop().split('\\').pop()),void URL.revokeObjectURL(t.data.value);case'close':return void this.Co?.postMessage({type:'close',id:t.data.id})}this.host?.Mo===t.data.id?this.stream.Yo.onmessage(t.data):this.host?.postMessage(t)};Vo=async()=>{if(999==+D.getParameter('world'))this.host&&await this.host.Ko();else if(998==+D.getParameter('world')&&this.Oo){if(this.Oo.So)return void console.log('You are already connected.');const t=prompt('Paste offer here, answer will be copied to clipboard');if(t)try{await this.Oo.Xo(t)}catch(t){console.error(t)}}};jo=async(t,i,s,h)=>{let e=5,o=await(this.db?.zo(t));if(o&&r.A.Zo(o)!==s&&(o=void 0),o)return new n.A(o);for(;!o;){await this.qo(h,`Requesting ${i}`);try{o=+D.getParameter('world')<998?await(0,_.$o)(`${D.et}/${t}${s}`):await(0,_.$o)(`${D.et}/${t}`)}catch(t){o=void 0;for(let t=e;t>0;t--)await this.qo(h,`Error loading - Will retry in ${t} secs.`),await(0,_.Jo)(1e3);e*=2,e>60&&(e=60)}}return await(this.db?.Qo(t,o)),new n.A(o)};tl=async(t,i,s,h)=>{let e=await(this.db?.zo(t+'.mid'));if(e&&12345678!==i&&r.A.Zo(e)!==i&&(e=void 0),!e)try{e=+D.getParameter('world')<998?await(0,_.$o)(`${D.et}/${t}_${i}.mid`):await(0,_.$o)(`${D.et}/songs/${t}.mid`),s!==e.length&&(e=e.slice(0,s))}catch(t){}if(!e)return;await(this.db?.Qo(t+'.mid',e));const n=new r.A(Uint8Array.from(e)).il,o=C.A.read(n,e,s,4);(0,T.sl)(o,this._o,h)};hl=()=>{if(w.el.fillStyle='black',w.el.fillRect(0,0,this.width,this.height),this.nl(1),this.Dt){this.mi=!1,w.el.font='bold 16px helvetica, sans-serif',w.el.textAlign='left',w.el.fillStyle='yellow';let t=35;w.el.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.el.fillStyle='white',w.el.fillText('To fix this try the following (in order):',30,t),t+=50,w.el.font='bold 12px helvetica, sans-serif',w.el.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.el.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.el.fillText('3: Try using a different game-world',30,t),t+=30,w.el.fillText('4: Try rebooting your computer',30,t),t+=30,w.el.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.mi=!1,w.el.font='bold 20px helvetica, sans-serif',w.el.textAlign='left',w.el.fillStyle='white',w.el.fillText('Error - unable to load game!',50,50),w.el.fillText('To play RuneScape make sure you play from',50,100),w.el.fillText('https://2004scape.org',50,150)),this.xt){this.mi=!1,w.el.font='bold 13px helvetica, sans-serif',w.el.textAlign='left',w.el.fillStyle='yellow';let t=35;w.el.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.el.fillStyle='white',w.el.fillText('To fix this try the following (in order):',30,t),t+=50,w.el.font='bold 12px helvetica, sans-serif',w.el.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.el.fillText('2: Try rebooting your computer, and reloading',30,t)}};rl=t=>{if(!t.ol)return!1;for(let i=0;i=h)return!1}else if(3===t.ol[i]){if(s<=h)return!1}else if(4===t.ol[i]){if(s===h)return!1}else if(s!==h)return!1}return!0};cl=(t,i,s,h,e)=>{this.bs?.draw(t,i),this.Ls?.draw(t,i+e-16),y.A.fillRect(t,i+16,16,e-32,p.A.fl);let n=(e-32)*e/h|0;n<8&&(n=8);const r=(e-n-32)*s/(h-e)|0;y.A.fillRect(t,i+r+16,16,n,p.A.ul),y.A.dl(t,i+r+16,p.A.wl,n),y.A.dl(t+1,i+r+16,p.A.wl,n),y.A.yl(t,i+r+16,p.A.wl,16),y.A.yl(t,i+r+17,p.A.wl,16),y.A.dl(t+15,i+r+16,p.A.Al,n),y.A.dl(t+14,i+r+17,p.A.Al,n-1),y.A.yl(t,i+r+n+15,p.A.Al,16),y.A.yl(t+1,i+r+n+14,p.A.Al,15)};pl=(t,i)=>{let s=!1;const e=h.A.Do[t];if(!e.ml)return!1;for(let t=0;th.delay[n._l];)n.El-=h.delay[n._l]+1,n._l++,n._l>=h.Cl&&(n._l-=h.Tl,(n._l<0||n._l>=h.Cl)&&(n._l=0)),s=!0}}}return s};Ol=(t,i,s,n,r=!1)=>{if(0!==t.type||!t.ml||t.hide&&this.$h!==t.id&&this.Jh!==t.id&&this.Qh!==t.id)return;const o=y.A.left,l=y.A.top,a=y.A.right,c=y.A.bottom;y.A.vl(i,s,i+t.width,s+t.height);const f=t.ml.length;for(let o=0;o0&&this.kl(c),c.type===h.A.xl)c.Dl>c.scroll-c.height&&(c.Dl=c.scroll-c.height),c.Dl<0&&(c.Dl=0),this.Ol(c,l,a,c.Dl,r),c.scroll>c.height&&this.cl(l+c.width,a,c.Dl,c.scroll,c.height);else if(c.type===h.A.Nl){let t=0;for(let i=0;i0){let i=0,s=0;const n=c.Ul[t]-1;if(h>=-32&&h<=512&&e>=-32&&e<=334||0!==this.se&&this.ie===t){const r=A.A.Wl(n,c.Bl[t]);if(0!==this.se&&this.ie===t&&this.te===c.id?(i=this.Yl-this.he,s=this.Vl-this.ee,i<5&&i>-5&&(i=0),s<5&&s>-5&&(s=0),this.ne<5&&(i=0,s=0),r.Kl(128,h+i,e+s)):0!==this.ue&&this.de===t&&this.we===c.id?r.Kl(128,h,e):r.draw(h,e),33===r.Xl||1!==c.Bl[t]){const n=c.Bl[t];this.di?.jl(h+i+1,e+10+s,this.zl(n),p.A.Zl),this.di?.jl(h+i,e+9+s,this.zl(n),p.A.ql)}}}else if(c.$l&&t<20){const i=c.$l[t];i?.draw(h,e)}t++}}else if(c.type===h.A.Jl)c.fill?y.A.fillRect(l,a,c.width,c.height,c.Ql):y.A.Rl(l,a,c.width,c.height,c.Ql);else if(c.type===h.A.ta){const t=c.font;let i=c.Ql,s=c.text;if(this.Qh!==c.id&&this.Jh!==c.id&&this.$h!==c.id||0===c.ia||(i=c.ia),this.rl(c)&&(i=c.sa,c.ha&&c.ha.length>0&&(s=c.ha)),c.ea===h.A.na&&this.Ae&&(s='Please wait...',i=c.Ql),!t||!s)continue;for(let h=a+t.height;s.length>0;h+=t.height){if(-1!==s.indexOf('%')){for(;;){const t=s.indexOf('%1');if(-1===t)break;s=s.substring(0,t)+this.ra(this.ll(c,0))+s.substring(t+2)}for(;;){const t=s.indexOf('%2');if(-1===t)break;s=s.substring(0,t)+this.ra(this.ll(c,1))+s.substring(t+2)}for(;;){const t=s.indexOf('%3');if(-1===t)break;s=s.substring(0,t)+this.ra(this.ll(c,2))+s.substring(t+2)}for(;;){const t=s.indexOf('%4');if(-1===t)break;s=s.substring(0,t)+this.ra(this.ll(c,3))+s.substring(t+2)}for(;;){const t=s.indexOf('%5');if(-1===t)break;s=s.substring(0,t)+this.ra(this.ll(c,4))+s.substring(t+2)}}const e=s.indexOf('\\n');let n;-1!==e?(n=s.substring(0,e),s=s.substring(e+2)):(n=s,s=''),c.oa?t.la(l+(c.width/2|0),h,n,i,c.aa):t.ca(l,h,n,i,c.aa)}}else if(c.type===h.A.fa){let t;t=this.rl(c)?c.ua:c.da,t?.draw(l,a)}else if(c.type===h.A.wa){const t=e.A.ya,i=e.A.Aa;e.A.ya=l+(c.width/2|0),e.A.Aa=a+(c.height/2|0);const s=e.A.sin[c.pa]*c.zoom>>16,h=e.A.cos[c.pa]*c.zoom>>16,n=this.rl(c);let r;r=n?c.gl:c.Il;let o=null;if(-1===r)o=c.ma(-1,-1,n);else{const t=I.A.Do[r];t.frames&&t.Ia&&(o=c.ma(t.frames[c._l],t.Ia[c._l],n))}o&&o.ga(0,c.Ea,0,c.pa,0,s,h),e.A.ya=t,e.A.Aa=i}else if(c.type===h.A._a){const t=c.font;if(!t||!c.Ul||!c.Bl)continue;let i=0;for(let s=0;s0){const e=A.A.get(c.Ul[i]-1);let n=e.name;if((e.Ca||1!==c.Bl[i])&&(n=n+' x'+this.Ta(c.Bl[i])),!n)continue;const r=l+h*(c.Gl+115),o=a+s*(c.Hl+12);c.oa?t.la(r+(c.width/2|0),o,n,c.Ql,c.aa):t.ca(r,o,n,c.Ql,c.aa)}i++}}}y.A.vl(o,l,a,c)};kl=t=>{let i=t.Ml;if(i>=h.A.Oa&&i<=h.A.va)i--,i>=this.Vr?(t.text='',t.ea=0):(t.text=this.so[i],t.ea=1);else if(i>=h.A.ba&&i<=h.A.La)i-=h.A.ba,i>=this.Vr?(t.text='',t.ea=0):(0===this.eo[i]?t.text='@red@Offline':this.eo[i]===D.it?t.text='@gre@World-'+(this.eo[i]-9):t.text='@yel@World-'+(this.eo[i]-9),t.ea=1);else if(i===h.A.Ra)t.scroll=15*this.Vr+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=h.A.Sa&&i<=h.A.Ma)i-=h.A.Sa,i>=this.dh?(t.text='',t.ea=0):(t.text=g.A.ka(g.A.xa(this.wh[i])),t.ea=1);else if(i===h.A.Da)t.scroll=15*this.dh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===h.A.Na){if(t.pa=150,t.Ea=256*Math.sin(this.Pt/40)&2047,this.Hr){this.Hr=!1;const i=new d.ds(7,null);let s=0;for(let t=0;t<7;t++){const h=this.Wr[t];h>=0&&(i[s++]=E.A.Do[h].ma())}const h=m.A.Pa(i,s);for(let t=0;t<5;t++)0!==this.Yr[t]&&(h.Fa(u.A.Ua[t][0],u.A.Ua[t][this.Yr[t]]),1===t&&h.Fa(u.A.Ba[0],u.A.Ba[this.Yr[t]]));if(this.Sr){const i=I.A.Do[this.Sr.Ga].frames;i&&(h.Ha(),h.Wa(i[0]),h.Ya(64,850,-30,-50,-30,!0),t.model=h)}}}else if(i===h.A.Va)this.Bs||(this.Bs=t.da,this.Gs=t.ua),this.Gr?t.da=this.Gs:t.da=this.Bs;else if(i===h.A.Ka)this.Bs||(this.Bs=t.da,this.Gs=t.ua),this.Gr?t.da=this.Bs:t.da=this.Gs;else if(i===h.A.Xa)t.text=this.Me,this.Pt%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===h.A.ja)this.Br?this.ke?(t.Ql=p.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Ql=p.A.Sl,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===h.A.za||i===h.A.Za)if(0===this.De)t.text='';else{let i;i=0===this.Ne?'earlier today':1===this.Ne?'yesterday':this.Ne+' days ago',t.text='You last logged in '+i+' from: '+g.A.qa(this.De)}else if(i===h.A.$a)0===this.Fe&&(t.text='0 unread messages',t.Ql=p.A.ql),1===this.Fe&&(t.text='1 unread message',t.Ql=p.A.GREEN),this.Fe>1&&(t.text=this.Fe+' unread messages',t.Ql=p.A.GREEN);else if(i===h.A.Ja)if(201===this.Pe)t.text='';else if(200===this.Pe)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Pe?'Earlier today':1===this.Pe?'Yesterday':this.Pe+' days ago',t.text=i+' you changed your recovery questions'}else i===h.A.Qa?201===this.Pe?t.text='':200===this.Pe?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===h.A.tc&&(201===this.Pe?t.text='':(this.Pe,t.text="Do this from the 'account management' area on our front webpage"))};ll=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const s=t.scripts[i];if(!s)return-1;let e=0,n=0;for(;;){const t=s[n++];if(0===t)return e;if(1===t)e+=this.Th[s[n++]];else if(2===t)e+=this.Oh[s[n++]];else if(3===t)e+=this.Ch[s[n++]];else if(4===t){const t=h.A.Do[s[n++]],i=s[n++]+1;if(t.Ul&&t.Bl)for(let s=0;st<999999999?String(t):'*';Ta=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};zl=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,s)=>{s.d(i,{w:()=>r});var h=s(7046),e=s(1651),n=s(9234);async function r(){await async function(){0===h.A.getParameter('world').length&&h.A.setParameter('world','1');['0','998','999'].includes(h.A.getParameter('world'))?function(){if(+h.A.getParameter('world')>=998)return void(e.K.et='data/pack/client');e.K.ht='http://localhost',e.K.et='http://localhost',e.K.portOffset=0}():await async function(t){const i=await o(t,parseInt(h.A.getParameter('world'),10)),s=new URL(i.address);e.K.it=10+i.id-1,e.K.ht=`${s.protocol}//${s.hostname}`,e.K.et=`${s.protocol}//${s.hostname}:${s.port}`,t||(e.K.ht=e.K.ht.replace('https:','http:'));e.K.portOffset=i.portOffset,e.K.members=!0===i?.members,h.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===h.A.getParameter('detail').length&&h.A.setParameter('detail','high');'low'===h.A.getParameter('detail')?e.K.Rt():e.K.Lt()}(),0===h.A.getParameter('method').length&&h.A.setParameter('method','0')}async function o(t,i,s=0){if(s>=10)throw new Error('could not find world to connect!');const h=t?'https:':'http:';let e;try{e=JSON.parse(await(0,n.sc)(`${h}//2004scape.org/api/v1/worldlist`))}catch(h){return await(0,n.Jo)(1e3),o(t,i,++s)}e.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,nr:0});const r=e.find((t=>t.id===i));return r||o(t,i,10)}},7906:(t,i,s)=>{s.a(t,(async(t,i)=>{try{var h=s(1312),e=s(5637),n=s(1302),r=s(6948),o=s(8317),l=s(8738),a=s(3764),c=s(1120),f=s(1183),u=s(8950),d=s(4583),w=s(1673),y=s(2511),A=s(2682),p=s(8665),m=s(9298),I=s(1069),g=s(3554),E=s(353),_=s(2634),C=s(4544),T=s(2215),O=s(3955),v=s(7953),b=s(2646),L=s(3937),R=(s(9896),s(1908)),S=s(6666),M=s(3819),k=s(2595),x=s(3045),D=s(818),N=s(5599),P=s(1023),F=s(6169),U=s(2630),B=s(5327),G=s(670),H=s(9456),W=s(8268),Y=s(8412),V=s(3606),K=s(4197),X=s(254),j=s(7628),z=s(123),Z=s(9234),q=s(3867),$=s(1651),J=s(8534),Q=s(6730),tt=s(2164),it=s(7604),st=s(3795),ht=s(4909),et=s(296);class t extends $.K{load=async()=>{if(this.kt)this.xt=!0;else{this.kt=!0;try{this.Wo(),await this.qo(10,'Connecting to fileserver'),await R.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new C.A(await C.A.openDatabase());const t=new I.A(new Uint8Array(await(0,Z.$o)(`${$.K.et}/crc`)));for(let i=0;i<9;i++)this.Ft[i]=t.il;$.K.st||await this.tl('scape_main',12345678,4e4,!1);const i=await this.jo('title','title screen',this.Ft[1],10);this.qt=i,this.di=A.A.hc(i,'p11'),this.wi=A.A.hc(i,'p12'),this.yi=A.A.hc(i,'b12'),this.Ai=A.A.hc(i,'q8'),await this.ec(),this.nc();const s=await this.jo('config','config',this.Ft[2],15),u=await this.jo('interface','interface',this.Ft[3],20),m=await this.jo('media','2d graphics',this.Ft[4],30),g=await this.jo('models','3d graphics',this.Ft[5],40),E=await this.jo('textures','textures',this.Ft[6],60),_=await this.jo('wordenc','chat system',this.Ft[7],65),T=await this.jo('sounds','sound effects',this.Ft[8],70);this.Yn=new q.rc(G.A.xn,G.A.Xn,G.A.Xn),this.Wn=new q.oc(G.A.xn,G.A.Xn+1,G.A.Xn+1),this.Wn&&(this.He=new x.A(this.Wn,G.A.Xn,G.A.xn,G.A.Xn));for(let t=0;t34||t>34))999===i&&(i=h);else if(999!==i){s=h;break}this.hs[t-9]=i-21,this.es[t-9]=s-i}d.A.Ac(479,96),this.$i=d.A.mc,d.A.Ac(190,261),this.Ji=d.A.mc,d.A.Ac(512,334),this.Qi=d.A.mc;const V=new Int32Array(9);for(let t=0;t<9;t++){const i=32*t+128+15,s=3*i+600,h=d.A.sin[i];V[t]=s*h>>16}x.A.init(512,334,500,800,V),v.A.wc(_),this.Ic()}catch(t){console.error(t),this.Dt=!0}}};update=async()=>{this.xt||this.Dt||this.Nt||(this.Pt++,this.gc?await this.Ec():await this._c())};draw=async()=>{this.xt||this.Dt||this.Nt?this.hl():(this.gc?this.Cc():await this.Tc(),this.js=0)};refresh=()=>{this.$t=!0};qo=async(t,i)=>{if(console.log(`${t}%: ${i}`),await this.Oc(),!this.qt)return void await super.qo(t,i);this.si?.bind();this.yi?.vc(180,54,'RuneScape is loading - please wait...',m.A.Sl);u.A.Rl(28,62,304,34,m.A.bc),u.A.Rl(29,63,302,32,m.A.Zl),u.A.fillRect(30,64,3*t,30,m.A.bc),u.A.fillRect(30+3*t,64,300-3*t,30,m.A.Zl),this.yi?.vc(180,85,i,m.A.Sl),this.si?.draw(214,186),this.$t&&(this.$t=!1,this.mi||(this.hi?.draw(0,0),this.ei?.draw(661,0)),this.ti?.draw(128,0),this.ii?.draw(214,386),this.ni?.draw(0,265),this.ri?.draw(574,265),this.oi?.draw(128,186),this.li?.draw(574,186)),await(0,Z.Jo)(5)};Lc=()=>{this.mi&&(this.Rc(),this.Rc(),this.Sc())};Oc=async()=>{this.ti||(this.Po=null,this.Fi=null,this.Ni=null,this.Di=null,this.Pi=null,this.Ui=null,this.Bi=null,this.Gi=null,this.hi=new f.A(128,265),u.A.clear(),this.ei=new f.A(128,265),u.A.clear(),this.ti=new f.A(533,186),u.A.clear(),this.ii=new f.A(360,146),u.A.clear(),this.si=new f.A(360,200),u.A.clear(),this.ni=new f.A(214,267),u.A.clear(),this.ri=new f.A(215,267),u.A.clear(),this.oi=new f.A(86,79),u.A.clear(),this.li=new f.A(87,79),u.A.clear(),this.qt&&(await this.ec(),this.nc()),this.$t=!0)};ec=async()=>{if(!this.qt)return;const t=await y.A.Mc(this.qt,'title');this.hi?.bind(),t.cc(0,0),this.ei?.bind(),t.cc(-661,0),this.ti?.bind(),t.cc(-128,0),this.ii?.bind(),t.cc(-214,-386),this.si?.bind(),t.cc(-214,-186),this.ni?.bind(),t.cc(0,-265),this.ri?.bind(),t.cc(-128,-186),this.oi?.bind(),t.cc(-128,-186),this.li?.bind(),t.cc(-574,-186),t.lc(),this.hi?.bind(),t.cc(394,0),this.ei?.bind(),t.cc(-267,0),this.ti?.bind(),t.cc(266,0),this.ii?.bind(),t.cc(180,-386),this.si?.bind(),t.cc(180,-186),this.ni?.bind(),t.cc(394,-265),this.ri?.bind(),t.cc(-180,-265),this.oi?.bind(),t.cc(212,-186),this.li?.bind(),t.cc(-180,-186);const i=y.A.hc(this.qt,'logo');this.ti?.bind(),i.draw((this.width/2|0)-(i.width/2|0)-128,18)};kc=t=>{if(!this._i||!this.Ei)return;this._i.fill(0);for(let t=0;t<5e3;t++){const t=128*Math.random()*256|0;this._i[t]=256*Math.random()|0}for(let t=0;t<20;t++){for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);this.Ei[s]=(this._i[s-1]+this._i[s+1]+this._i[s-128]+this._i[s+128])/4|0}const t=this._i;this._i=this.Ei,this.Ei=t}if(t){let i=0;for(let s=0;s{if(this.qt){this.ai=w.A.hc(this.qt,'titlebox'),this.ci=w.A.hc(this.qt,'titlebutton');for(let t=0;t<12;t++)this.pi[t]=w.A.hc(this.qt,'runes',t);this.Ii=new y.A(128,265),this.gi=new y.A(128,265),this.hi&&(0,Z.Nc)(this.hi.yc,0,this.Ii.yc,0,33920),this.ei&&(0,Z.Nc)(this.ei.yc,0,this.gi.yc,0,33920),this.vi=new Int32Array(256);for(let t=0;t<64;t++)this.vi[t]=262144*t;for(let t=0;t<64;t++)this.vi[t+64]=1024*t+m.A.RED;for(let t=0;t<64;t++)this.vi[t+128]=4*t+m.A.ql;for(let t=0;t<64;t++)this.vi[t+192]=m.A.Sl;this.bi=new Int32Array(256);for(let t=0;t<64;t++)this.bi[t]=1024*t;for(let t=0;t<64;t++)this.bi[t+64]=4*t+m.A.GREEN;for(let t=0;t<64;t++)this.bi[t+128]=262144*t+m.A.Pc;for(let t=0;t<64;t++)this.bi[t+192]=m.A.Sl;this.Li=new Int32Array(256);for(let t=0;t<64;t++)this.Li[t]=4*t;for(let t=0;t<64;t++)this.Li[t+64]=262144*t+m.A.BLUE;for(let t=0;t<64;t++)this.Li[t+128]=1024*t+m.A.Fc;for(let t=0;t<64;t++)this.Li[t+192]=m.A.Sl;this.Oi=new Int32Array(256),this._i=new Int32Array(32768),this.Ei=new Int32Array(32768),this.kc(null),this.Ci=new Int32Array(32768),this.Ti=new Int32Array(32768),this.qo(10,'Connecting to fileserver').then((()=>{this.mi||(this.mi=!0,this.xi=setInterval(this.Lc,35))}))}};_c=async()=>{if(0===this.Jt){let t=(this.width/2|0)-80,i=20+(this.height/2|0);if(i+=20,1===this.Uc&&this.Bc>=t-75&&this.Bc<=t+75&&this.Gc>=i-20&&this.Gc<=i+20){if(+$.K.getParameter('world')>=998)return void this.Vo();this.Jt=3,this.Qt=0}t=80+(this.width/2|0),1===this.Uc&&this.Bc>=t-75&&this.Bc<=t+75&&this.Gc>=i-20&&this.Gc<=i+20&&(this.fi='',this.ui='Enter your username & password.',this.Jt=2,this.Qt=0)}else if(2===this.Jt){let t=(this.height/2|0)-40;t+=30,t+=25,1===this.Uc&&this.Gc>=t-15&&this.Gc=t-15&&this.Gc=i-75&&this.Bc<=i+75&&this.Gc>=s-20&&this.Gc<=s+20&&await this.Hc(this.username,this.password,!1),i=80+(this.width/2|0),1===this.Uc&&this.Bc>=i-75&&this.Bc<=i+75&&this.Gc>=s-20&&this.Gc<=s+20&&(this.Jt=0,this.username='',this.password='');;){const t=this.Wc();if(-1===t)return;let i=!1;for(let s=0;s0&&(this.username=this.username.substring(0,this.username.length-1)),9!==t&&10!==t&&13!==t||(this.Qt=1),i&&(this.username=this.username+String.fromCharCode(t)),this.username.length>12&&(this.username=this.username.substring(0,12))):1===this.Qt&&(8===t&&this.password.length>0&&(this.password=this.password.substring(0,this.password.length-1)),9!==t&&10!==t&&13!==t||(this.Qt=0),i&&(this.password=this.password+String.fromCharCode(t)),this.password.length>20&&(this.password=this.password.substring(0,20)))}}else if(3===this.Jt){const t=this.width/2|0;let i=50+(this.height/2|0);i+=20,1===this.Uc&&this.Bc>=t-75&&this.Bc<=t+75&&this.Gc>=i-20&&this.Gc<=i+20&&(this.Jt=0)}};Tc=async()=>{await this.Oc(),this.si?.bind(),this.ai?.draw(0,0);if(0===this.Jt){let t=180,i=80;this.yi?.la(t,i,'Welcome to RuneScape',m.A.ql,!0),t=100,i=120,this.ci?.draw(t-73,i-20),this.yi?.la(t,i+5,'New user',m.A.Sl,!0),t=260,this.ci?.draw(t-73,i-20),this.yi?.la(t,i+5,'Existing User',m.A.Sl,!0)}else if(2===this.Jt){let t=100,i=60;this.fi.length>0?(this.yi?.la(180,i-15,this.fi,m.A.ql,!0),this.yi?.la(180,i,this.ui,m.A.ql,!0),i+=30):(this.yi?.la(180,i-7,this.ui,m.A.ql,!0),i+=30),this.yi?.ca(90,i,`Username: ${this.username}${0===this.Qt&&this.Pt%40<20?'@yel@|':''}`,m.A.Sl,!0),i+=15,this.yi?.ca(92,i,`Password: ${M.A.Vc(this.password)}${1===this.Qt&&this.Pt%40<20?'@yel@|':''}`,m.A.Sl,!0),i=150,this.ci?.draw(t-73,i-20),this.yi?.la(t,i+5,'Login',m.A.Sl,!0),t=260,this.ci?.draw(t-73,i-20),this.yi?.la(t,i+5,'Cancel',m.A.Sl,!0)}else if(3===this.Jt){this.yi?.la(180,40,'Create a free account',m.A.ql,!0);const t=180;let i=65;this.yi?.la(180,i,'To create a new account you need to',m.A.Sl,!0),i+=15,this.yi?.la(180,i,'go back to the main RuneScape webpage',m.A.Sl,!0),i+=15,this.yi?.la(180,i,"and choose the red 'create account'",m.A.Sl,!0),i+=15,this.yi?.la(180,i,'button at the top right of that page.',m.A.Sl,!0),i=150,this.ci?.draw(t-73,i-20),this.yi?.la(t,i+5,'Cancel',m.A.Sl,!0)}this.si?.draw(214,186),this.$t&&(this.$t=!1,this.ti?.draw(128,0),this.ii?.draw(214,386),this.ni?.draw(0,265),this.ri?.draw(574,265),this.oi?.draw(128,186),this.li?.draw(574,186))};Hc=async(i,s,h)=>{try{if(h||(this.fi='',this.ui='Connecting to server...',await this.Tc()),'998'===t.getParameter('world')){if(this.Oo&&!this.Oo.So)return this.fi='You are not connected to a host.',void(this.ui='Please try using world 999.');this.stream=new et.A(this.Co,this.Oo.Mo)}else if('999'===t.getParameter('world')){if(!this.To)return this.fi='The server is starting up.',void(this.ui='Please try again in a moment.');this.stream=new et.A(this.Co,this.host.Mo)}else this.stream=new g.A(await g.A.Kc({host:$.K.ht,port:43594+$.K.portOffset}));await this.stream.Xc(this.in.data,0,8),this.in.jc=0,this.Ht=this.in.zc;const e=new Int32Array([Math.floor(99999999*Math.random()),Math.floor(99999999*Math.random()),Number(this.Ht>>32n),Number(this.Ht&BigInt(4294967295))]);this.Bt.jc=0,this.Bt.p1(10),this.Bt.p4(e[0]),this.Bt.p4(e[1]),this.Bt.p4(e[2]),this.Bt.p4(e[3]),this.Bt.p4(0),this.Bt.Zc(i),this.Bt.Zc(s),this.Bt.qc($.K.ct,$.K.exponent),this.Gt.jc=0,h?this.Gt.p1(18):this.Gt.p1(16),this.Gt.p1(this.Bt.jc+36+1+1),this.Gt.p1($.K.tt),this.Gt.p1($.K.st?1:0);for(let t=0;t<9;t++)this.Gt.p4(this.Ft[t]);this.Gt.$c(this.Bt.data,this.Bt.jc,0),this.Bt.random=new _.A(e);for(let t=0;t<4;t++)e[t]+=50;this.Kt=new _.A(e),this.stream?.write(this.Gt.data,this.Gt.jc);const n=await this.stream.read();if(1===n)return await(0,Z.Jo)(2e3),void await this.Hc(i,s,h);if(2===n||18===n){this.Br=18===n,k.A.Jc(),this.gc=!0,this.Bt.jc=0,this.in.jc=0,this.Xt=-1,this.jt=-1,this.zt=-1,this.Zt=-1,this.packetSize=0,this.Wt=0,this.Vt=0,this.Yt=0,this.yh=0,this.nh=0,this.Qs=!1,this.Qc=0;for(let t=0;t<100;t++)this.Vh[t]=null;this.oe=0,this.Ie=0,this.We=0,this.ro=0,this.Ze=(100*Math.random()|0)-50,this.qe=(110*Math.random()|0)-55,this.$e=(80*Math.random()|0)-40,this.yn=(120*Math.random()|0)-60,this.An=(30*Math.random()|0)-20,this.Fn=(20*Math.random()|0)-10&2047,this.In=-1,this.Ke=0,this.Xe=0,this.rr=0,this.Ar=0;for(let t=0;t{if(null!==this.nr){this.Vt>1&&this.Vt--,this.Yt>0&&this.Yt--;for(let t=0;t<5&&await this.read();t++);if(this.gc){for(let t=0;tthis.yo+(this.wo/22|0)&&(this.wo=i.jc,this.yo=Date.now(),this.uo=this.lo[t],this.do=this.ao[t],await(0,z.hf)(i.data.slice(0,i.jc),this.fo))}catch(t){console.error(t)}this.ro--;for(let i=t;i0&&(this.Ao-=20,this.Ao<0&&(this.Ao=0),0===this.Ao&&this.po&&!$.K.st&&this.mo&&await this.tl(this.mo,this.Io,this.Eo,!1));const t=k.A.flush();if(t&&(this.Bt.ef(O.A.nf),this.Bt.p2(t.jc),this.Bt.$c(t.data,t.jc,0),t.release()),this.Wt++,this.Wt>750&&await this.rf(),this.lf(),this.af(),this.cf(),this.ff(),(1===this.uf[1]||1===this.uf[2]||1===this.uf[3]||1===this.uf[4])&&this.Nn++>5&&(this.Nn=0,this.Bt.ef(O.A.df),this.Bt.p2(this.Pn),this.Bt.p2(this.Fn),this.Bt.p1(this.yn),this.Bt.p1(this.An)),this.Ye++,0!==this.zs&&(this.Zs+=20,this.Zs>=400&&(this.zs=0)),0!==this.ue&&(this.ye++,this.ye>=15&&(2===this.ue&&(this.Ws=!0),3===this.ue&&(this.Ys=!0),this.ue=0)),0!==this.se&&(this.ne++,(this.Yl>this.he+5||this.Ylthis.ee+5||this.Vl=5){if(this.Le=-1,this.yf(),this.Le===this.te&&this.Re!==this.ie){const t=c.A.Do[this.te];if(t.Ul){const i=t.Ul[this.Re];t.Ul[this.Re]=t.Ul[this.ie],t.Ul[this.ie]=i}if(t.Bl){const i=t.Bl[this.Re];t.Bl[this.Re]=t.Bl[this.ie],t.Bl[this.ie]=i}this.Bt.ef(O.A.Af),this.Bt.p2(this.te),this.Bt.p2(this.ie),this.Bt.p2(this.Re)}}else(1===this.Ce||this.pf(this.nh-1))&&this.nh>2?this.mf():this.nh>0&&await this.If(this.nh-1);this.ye=10,this.Uc=0}if($.K.dt++,$.K.dt>127&&($.K.dt=0,this.Bt.ef(O.A.gf),this.Bt.p3(4991788)),-1!==x.A.Ef&&this.Sr){const t=x.A.Ef,i=x.A._f,s=this.Cf(this.Sr.Tf[0],this.Sr.Of[0],t,i,0,0,0,0,0,0,!0);x.A.Ef=-1,s&&(this.qs=this.Bc,this.$s=this.Gc,this.zs=1,this.Zs=0)}1===this.Uc&&this.Lh&&(this.Lh=null,this.Ys=!0,this.Uc=0),await this.vf(),this.bf(),this.Lf(),this.Rf(),1!==this.wf&&1!==this.Uc||this.js++,2===this.We&&($.K.ot?this.Sf():this.Mf()),2===this.We&&this.je&&this.kf();for(let t=0;t<5;t++)this.sn[t]++;if(await this.xf(),this.Qc++,this.Qc>4500&&(this.Yt=250,this.Qc-=500,this.Bt.ef(O.A.Df)),this.ze++,this.ze>500){this.ze=0;const t=8*Math.random()|0;1&~t||(this.Ze+=this.Je),2&~t||(this.qe+=this.Qe),4&~t||(this.$e+=this.tn)}if(this.Ze<-50&&(this.Je=2),this.Ze>50&&(this.Je=-2),this.qe<-55&&(this.Qe=2),this.qe>55&&(this.Qe=-2),this.$e<-40&&(this.tn=1),this.$e>40&&(this.tn=-1),this.wn++,this.wn>500){this.wn=0;const t=8*Math.random()|0;1&~t||(this.yn+=this.mn),2&~t||(this.An+=this.pn)}this.yn<-60&&(this.mn=2),this.yn>60&&(this.mn=-2),this.An<-20&&(this.pn=1),this.An>10&&(this.pn=-1),$.K.wt++,$.K.wt>110&&($.K.wt=0,this.Bt.ef(O.A.Nf),this.Bt.p4(0)),this.Pr++,this.Pr>50&&this.Bt.ef(O.A.Pf);try{this.stream&&this.Bt.jc>0&&(this.stream.write(this.Bt.data,this.Bt.jc),this.Bt.jc=0,this.Pr=0)}catch(t){console.log(t),await this.rf()}}}};Cc=()=>{if(null===this.nr)return;this.$t&&(this.$t=!1,this.Hi?.draw(0,11),this.Wi?.draw(0,375),this.Yi?.draw(729,5),this.Vi?.draw(752,231),this.Ki?.draw(0,0),this.Xi?.draw(561,0),this.ji?.draw(520,11),this.zi?.draw(520,231),this.Zi?.draw(501,375),this.qi?.draw(0,345),this.Ws=!0,this.Ys=!0,this.Vs=!0,this.Ks=!0,2!==this.We&&(this.Pi?.draw(8,11),this.Ni?.draw(561,5))),2===this.We&&this.Ff(),this.Qs&&1===this.th&&(this.Ws=!0);let t=!1;if(-1!==this.oh&&(t=this.pl(this.oh,this.Ye),t&&(this.Ws=!0)),2===this.ue&&(this.Ws=!0),2===this.se&&(this.Ws=!0),this.Ws&&(this.Uf(),this.Ws=!1),-1===this.lh){this.ah.Dl=this.fh-this.uh-77,this.Yl>453&&this.Yl<565&&this.Vl>350&&this.Bf(this.Yl-22,this.Vl-375,this.fh,77,!1,463,0,this.ah);let t=this.fh-this.ah.Dl-77;t<0&&(t=0),t>this.fh-77&&(t=this.fh-77),this.uh!==t&&(this.uh=t,this.Ys=!0)}-1!==this.lh&&(t=this.pl(this.lh,this.Ye),t&&(this.Ys=!0)),3===this.ue&&(this.Ys=!0),3===this.se&&(this.Ys=!0),this.Lh&&(this.Ys=!0),this.Qs&&2===this.th&&(this.Ys=!0),this.Ys&&(this.Gf(),this.Ys=!1),2===this.We&&(this.Hf(),this.Ni?.draw(561,5)),-1!==this.Rh&&(this.Vs=!0),this.Vs&&(-1!==this.Rh&&this.Rh===this.Sh&&(this.Rh=-1,this.Bt.ef(O.A.Wf),this.Bt.p1(this.Sh)),this.Vs=!1,this.Gi?.bind(),this.fs?.draw(0,0),-1===this.oh&&(-1!==this.Mh[this.Sh]&&(0===this.Sh?this.Rs?.draw(29,30):1===this.Sh?this.Ss?.draw(59,29):2===this.Sh?this.Ss?.draw(87,29):3===this.Sh?this.Ms?.draw(115,29):4===this.Sh?this.xs?.draw(156,29):5===this.Sh?this.xs?.draw(184,29):6===this.Sh&&this.ks?.draw(212,30)),-1!==this.Mh[0]&&(0!==this.Rh||this.Pt%20<10)&&this.us[0]?.draw(35,34),-1!==this.Mh[1]&&(1!==this.Rh||this.Pt%20<10)&&this.us[1]?.draw(59,32),-1!==this.Mh[2]&&(2!==this.Rh||this.Pt%20<10)&&this.us[2]?.draw(86,32),-1!==this.Mh[3]&&(3!==this.Rh||this.Pt%20<10)&&this.us[3]?.draw(121,33),-1!==this.Mh[4]&&(4!==this.Rh||this.Pt%20<10)&&this.us[4]?.draw(157,34),-1!==this.Mh[5]&&(5!==this.Rh||this.Pt%20<10)&&this.us[5]?.draw(185,32),-1!==this.Mh[6]&&(6!==this.Rh||this.Pt%20<10)&&this.us[6]?.draw(212,34)),this.Gi?.draw(520,165),this.Bi?.bind(),this.cs?.draw(0,0),-1===this.oh&&(-1!==this.Mh[this.Sh]&&(7===this.Sh?this.Ds?.draw(49,0):8===this.Sh?this.Ns?.draw(81,0):9===this.Sh?this.Ns?.draw(108,0):10===this.Sh?this.Ps?.draw(136,1):11===this.Sh?this.Us?.draw(178,0):12===this.Sh?this.Us?.draw(205,0):13===this.Sh&&this.Fs?.draw(233,0)),-1!==this.Mh[8]&&(8!==this.Rh||this.Pt%20<10)&&this.us[7]?.draw(80,2),-1!==this.Mh[9]&&(9!==this.Rh||this.Pt%20<10)&&this.us[8]?.draw(107,3),-1!==this.Mh[10]&&(10!==this.Rh||this.Pt%20<10)&&this.us[9]?.draw(142,4),-1!==this.Mh[11]&&(11!==this.Rh||this.Pt%20<10)&&this.us[10]?.draw(179,2),-1!==this.Mh[12]&&(12!==this.Rh||this.Pt%20<10)&&this.us[11]?.draw(206,2),-1!==this.Mh[13]&&(13!==this.Rh||this.Pt%20<10)&&this.us[12]?.draw(230,2)),this.Bi?.draw(501,492),this.Pi?.bind()),this.Ks&&(this.Ks=!1,this.Ui?.bind(),this.ls?.draw(0,0),this.wi?.la(57,33,'Public chat',m.A.Sl,!0),0===this.kh&&this.wi?.la(57,46,'On',m.A.GREEN,!0),1===this.kh&&this.wi?.la(57,46,'Friends',m.A.ql,!0),2===this.kh&&this.wi?.la(57,46,'Off',m.A.RED,!0),3===this.kh&&this.wi?.la(57,46,'Hide',m.A.Pc,!0),this.wi?.la(186,33,'Private chat',m.A.Sl,!0),0===this.xh&&this.wi?.la(186,46,'On',m.A.GREEN,!0),1===this.xh&&this.wi?.la(186,46,'Friends',m.A.ql,!0),2===this.xh&&this.wi?.la(186,46,'Off',m.A.RED,!0),this.wi?.la(326,33,'Trade/duel',m.A.Sl,!0),0===this.Dh&&this.wi?.la(326,46,'On',m.A.GREEN,!0),1===this.Dh&&this.wi?.la(326,46,'Friends',m.A.ql,!0),2===this.Dh&&this.wi?.la(326,46,'Off',m.A.RED,!0),this.wi?.la(462,38,'Report abuse',m.A.Sl,!0),this.Ui?.draw(0,471),this.Pi?.bind()),this.Ye=0};Ff=()=>{if(this.Ve++,this.Yf(),this.Vf(),this.Kf(),this.Xf(),this.jf(),!this.je){let t=this.Pn;(this.dn/256|0)>t&&(t=this.dn/256|0),this.hn[4]&&this.nn[4]+128>t&&(t=this.nn[4]+128);const i=this.Fn+this.$e&2047;if(this.Sr&&this.zf(this.Gn,this.Zf(this.Dn,this.Sr.x,this.Sr.z)-50,this.Hn,i,t,3*t+600),$.K.ut++,$.K.ut>1802){$.K.ut=0,this.Bt.ef(O.A.qf),this.Bt.p1(0);const t=this.Bt.jc;this.Bt.p2(29711),this.Bt.p1(70),this.Bt.p1(256*Math.random()|0),this.Bt.p1(242),this.Bt.p1(186),this.Bt.p1(39),this.Bt.p1(61),2*Math.random()|0||this.Bt.p1(13),2*Math.random()|0||this.Bt.p2(57856),this.Bt.p2(65536*Math.random()|0),this.Bt.$f(this.Bt.jc-t)}}let t;t=this.je?this.Jf():this.Qf();const i=this.ln,s=this.an,h=this.cn,e=this.fn,n=this.un;let r;for(let t=0;t<5;t++)this.hn[t]&&(r=Math.random()*(2*this.en[t]+1)-this.en[t]+Math.sin(this.sn[t]*(this.rn[t]/100))*this.nn[t]|0,0===t&&(this.ln+=r),1===t&&(this.an+=r),2===t&&(this.cn+=r),3===t&&(this.un=this.un+r&2047),4===t&&(this.fn+=r,this.fn<128&&(this.fn=128),this.fn>383&&(this.fn=383)));r=d.A.tu,p.A.iu=!0,p.A.su=0,p.A.Yl=this.Yl-8,p.A.Vl=this.Vl-11,u.A.clear(),this.He?.draw(this.ln,this.an,this.cn,t,this.un,this.fn,this.Pt),this.He?.hu(),this.eu(),this.nu(),$.K.nt&&this.ru(),this.ou(r),this.lu(),this.Pi?.draw(8,11),this.ln=i,this.an=s,this.cn=h,this.fn=e,this.un=n};au=()=>{e.A.cu?.clear(),e.A.fu?.clear(),r.A.No?.clear(),n.A.No?.clear(),n.A.uu?.clear(),W.A.No?.clear(),l.A.No?.clear()};du=(t,i)=>{this.wu(t.x,i,t.z)};wu=(t,i,s)=>{if(t<128||s<128||t>13056||s>13056)return this.jn=-1,void(this.zn=-1);const h=this.Zf(this.Dn,t,s)-i;this.yu(t,h,s)};yu=(t,i,s)=>{let h=t-this.ln,e=i-this.an,n=s-this.cn;const r=d.A.sin[this.fn],o=d.A.cos[this.fn],l=d.A.sin[this.un],a=d.A.cos[this.un];let c=n*l+h*a>>16;n=n*a-h*l>>16,h=c,c=e*o-n*r>>16,n=e*r+n*o>>16,e=c,n>=50?(this.jn=d.A.ya+((h<<9)/n|0),this.zn=d.A.Aa+((e<<9)/n|0)):(this.jn=-1,this.zn=-1)};eu=()=>{this.Kr=0;for(let t=-1;t-1))for(let t=0;t<8;t++)h.Au&1<=0&&10===this.yh&&this.Ih===this.lr[t]&&(this.du(i,i.height+15),this.jn>-1&&this.gs[7]?.draw(this.jn-12,this.zn-s))}else 1===this.yh&&this.Ah===this.pr[t-this.rr]&&this.Pt%20<10&&(this.du(i,i.height+15),this.jn>-1&&this.gs[2]?.draw(this.jn-12,this.zn-28));if(i.pu&&(t>=this.rr||0===this.kh||3===this.kh||1===this.kh&&this.mu(i.name))&&(this.du(i,i.height),this.jn>-1&&this.Kr<$.K.Xr&&this.yi&&(this.qr[this.Kr]=this.yi.Iu(i.pu)/2|0,this.Zr[this.Kr]=this.yi.height,this.jr[this.Kr]=this.jn,this.zr[this.Kr]=this.zn,this.$r[this.Kr]=i.gu,this.Jr[this.Kr]=i.Eu,this.Qr[this.Kr]=i._u,this.io[this.Kr++]=i.pu,0===this.Zh&&1===i.Eu&&(this.Zr[this.Kr]+=10,this.zr[this.Kr]+=5),0===this.Zh&&2===i.Eu&&(this.qr[this.Kr]=60))),i.Cu>this.Pt+100&&(this.du(i,i.height+15),this.jn>-1)){let t=30*i.Tu/i.Ou|0;t>30&&(t=30),u.A.fillRect(this.jn-15,this.zn-3,t,5,m.A.GREEN),u.A.fillRect(this.jn-15+t,this.zn-3,30-t,5,m.A.RED)}if(i.Cu>this.Pt+330&&(this.du(i,i.height/2|0),this.jn>-1&&(this.Is[i.vu]?.draw(this.jn-12,this.zn-12),this.di?.vc(this.jn,this.zn+4,i.bu.toString(),m.A.Zl),this.di?.vc(this.jn-1,this.zn+3,i.bu.toString(),m.A.Sl))),$.K.nt){if(i.pathLength>0||i.Lu>=this.Pt||i.Ru>this.Pt){const t=64*i.size;this.Su(128*i.Tf[0]+t,128*i.Of[0]+t,this.Dn,i.size,65535,!1)}this.Su(i.x,i.z,this.Dn,i.size,6710886,!1);let s=0;if(this.du(i,i.height+30),t32767&&(i-=32768),this.di?.vc(this.jn,this.zn+s,'Face Entity: '+i,m.A.Sl),s-=15}(t.Mu&W.A.Uu)===W.A.Uu&&(this.di?.vc(this.jn,this.zn+s,'Say',m.A.Sl),s-=15),(t.Mu&W.A.Bu)===W.A.Bu&&(this.di?.vc(this.jn,this.zn+s,'Hit: Type '+t.vu+' Amount '+t.bu+' HP '+t.Tu+'/'+t.Ou,m.A.Sl),s-=15),(t.Mu&W.A.Gu)===W.A.Gu&&(this.di?.vc(this.jn,this.zn+s,'Face Coord: '+t.Hu/2+' '+t.Wu/2,m.A.Sl),s-=15),(t.Mu&W.A.Yu)===W.A.Yu&&(this.di?.vc(this.jn,this.zn+s,'Chat',m.A.Sl),s-=15),(t.Mu&W.A.Vu)===W.A.Vu&&(this.di?.vc(this.jn,this.zn+s,'Play Spotanim: '+t.Ku,m.A.Sl),s-=15),(t.Mu&W.A.Xu)===W.A.Xu&&(this.di?.vc(this.jn,this.zn+s,'Exact Move',m.A.Sl),s-=15)}}else{const t=i;let s=0;if(this.du(i,i.height+30),this.di?.vc(this.jn,this.zn+s,t.type?.name??null,m.A.Sl),s-=15,-1!==t.Mu&&this.Pt-t.ku<30){if((t.Mu&Y.A.Du)===Y.A.Du&&(this.di?.vc(this.jn,this.zn+s,'Play Seq: '+t.Nu,m.A.Sl),s-=15),(t.Mu&Y.A.Pu)===Y.A.Pu){let i=t.Fu;i>32767&&(i-=32768),this.di?.vc(this.jn,this.zn+s,'Face Entity: '+i,m.A.Sl),s-=15}(t.Mu&Y.A.Uu)===Y.A.Uu&&(this.di?.vc(this.jn,this.zn+s,'Say',m.A.Sl),s-=15),(t.Mu&Y.A.Bu)===Y.A.Bu&&(this.di?.vc(this.jn,this.zn+s,'Hit: Type '+t.vu+' Amount '+t.bu+' HP '+t.Tu+'/'+t.Ou,m.A.Sl),s-=15),(t.Mu&Y.A.ju)===Y.A.ju&&(this.di?.vc(this.jn,this.zn+s,'Change Type: '+t.type?.id??null,m.A.Sl),s-=15),(t.Mu&Y.A.Vu)===Y.A.Vu&&(this.di?.vc(this.jn,this.zn+s,'Play Spotanim: '+t.Ku,m.A.Sl),s-=15),(t.Mu&Y.A.Gu)===Y.A.Gu&&(this.di?.vc(this.jn,this.zn+s,'Face Coord: '+t.Hu/2+' '+t.Wu/2,m.A.Sl),s-=15)}}}}}if($.K.nt)for(let t=0;t=104||i.z>=104||this.Su(128*i.x+64,128*i.z+64,i.level,1,16776960,!1)}for(let t=0;tthis.zr[r]-this.Zr[r]&&s-ethis.jr[r]-this.qr[r]&&this.zr[r]-this.Zr[r]{2===this.yh&&this.gs[2]&&(this.wu((this.gh-this.Tn<<7)+this.ph,2*this._h,(this.Eh-this.On<<7)+this.mh),this.jn>-1&&this.Pt%20<10&&this.gs[2].draw(this.jn-12,this.zn-28))};ru=()=>{const t=507;let i=13;this.Lo?this.di?.$u(t,i,'tock',m.A.ql,!0):this.yi?.$u(t,i,'tick',m.A.ql,!0),i+=13,this.di?.$u(t,i,`Fps: ${this.Ju}, ${this.Qu} ms`,m.A.ql,!0),i+=13,this.di?.$u(t,i,`Draw: ${this.ms.toFixed(1)}, Avg: ${this.td.toFixed(1)}, Slow: ${this.sd.toFixed(1)} ms`,m.A.ql,!0),i+=13,this.di?.$u(t,i,`Occluders: ${x.A.hd[x.A.ed]} Active: ${x.A.nd}`,m.A.ql,!0),i+=13,this.di?.$u(t,i,'Local Pos: '+(this.Sr?.x??-1)+', '+(this.Sr?.z??-1)+', '+(this.Sr?.y??-1),m.A.ql,!0),i+=13,this.di?.$u(t,i,'Camera Pos: '+this.ln+', '+this.cn+', '+this.an,m.A.ql,!0),i+=13,this.di?.$u(t,i,'Camera Angle: '+this.un+', '+this.fn,m.A.ql,!0),i+=13,this.di?.$u(t,i,'Cutscene Source: '+this.tr+', '+this.ir+' '+this.sr+'; '+this.hr+', '+this.er,m.A.ql,!0),i+=13,this.di?.$u(t,i,'Cutscene Destination: '+this.Zn+', '+this.qn+' '+this.$n+'; '+this.Jn+', '+this.Qn,m.A.ql,!0),$.K.ot&&(i+=13,this.di?.$u(t,i,'Instructions:',m.A.ql,!0),i+=13,this.di?.$u(t,i,'- Arrows to move Camera',m.A.ql,!0),i+=13,this.di?.$u(t,i,'- Shift to control Source or Dest',m.A.ql,!0),i+=13,this.di?.$u(t,i,'- Alt to control Height',m.A.ql,!0),i+=13,this.di?.$u(t,i,'- Ctrl to control Modifier',m.A.ql,!0))};Su=(t,i,s,h,e,n)=>{const r=this.Zf(s,t,i),o=64*h;this.yu(t-o,r,i-o);const l=this.jn,a=this.zn;this.yu(t+o,r,i-o);const c=this.jn,f=this.zn;this.yu(t-o,r,i+o);const d=this.jn,w=this.zn;this.yu(t+o,r,i+o);const y=this.jn,A=this.zn;-1!==l&&-1!==c&&-1!==d&&-1!==y&&(n&&(u.A.rd(l,a,y,A,(16711422&e)>>1),u.A.rd(c,f,d,w,(16711422&e)>>1)),u.A.rd(l,a,c,f,e),u.A.rd(l,a,d,w,e),u.A.rd(c,f,y,A,e),u.A.rd(d,w,y,A,e))};Sf(){const t=1==this.uf[5]?2:1;1==this.uf[6]?(1==this.uf[1]?(this.Zn-=t,this.Zn<1&&(this.Zn=1)):1==this.uf[2]&&(this.Zn+=t,this.Zn>102&&(this.Zn=102)),1==this.uf[3]?1==this.uf[7]?this.$n+=2*t:(this.qn+=1,this.qn>102&&(this.qn=102)):1==this.uf[4]&&(1==this.uf[7]?this.$n-=2*t:(this.qn-=1,this.qn<1&&(this.qn=1)))):(1==this.uf[1]?(this.tr-=t,this.tr<1&&(this.tr=1)):1==this.uf[2]&&(this.tr+=t,this.tr>102&&(this.tr=102)),1==this.uf[3]?1==this.uf[7]?this.sr+=2*t:(this.ir+=t,this.ir>102&&(this.ir=102)):1==this.uf[4]&&(1==this.uf[7]?this.sr-=2*t:(this.ir-=t,this.ir<1&&(this.ir=1)))),this.ln=128*this.tr+64,this.cn=128*this.ir+64,this.an=this.Zf(this.Dn,this.tr,this.ir)-this.sr;const i=128*this.Zn+64,s=128*this.qn+64,h=this.Zf(this.Dn,this.Zn,this.qn)-this.$n,e=i-this.ln,n=h-this.an,r=s-this.cn,o=0|Math.sqrt(e*e+r*r);this.fn=325.949*Math.atan2(n,o)&2047,this.un=-325.949*Math.atan2(e,r)&2047,this.fn<128&&(this.fn=128),this.fn>383&&(this.fn=383)}lu=()=>{if(this.od(),1===this.zs&&this._s[this.Zs/100|0]?.draw(this.qs-8-8,this.$s-8-11),2===this.zs&&this._s[4+(this.Zs/100|0)]?.draw(this.qs-8-8,this.$s-8-11),-1!==this.Xs&&(this.pl(this.Xs,this.Ye),this.Ol(c.A.Do[this.Xs],0,0,0)),this.ld(),this.Qs?0===this.th&&this.ad():(this.yf(),this.fd()),1===this.kr&&(this.Fr>0||1===this.Ur?this.gs[1]?.draw(472,258):this.gs[1]?.draw(472,296)),this.Fr>0&&(this.gs[0]?.draw(472,296),this.wi?.vc(484,329,'Level: '+this.Fr,m.A.ql)),1===this.Ur&&(this.gs[6]?.draw(472,296),this.wi?.vc(484,329,'Arena',m.A.ql)),0!==this.Vt){let t=this.Vt/50|0;const i=t/60|0;t%=60,t<10?this.wi?.jl(4,329,'System update in: '+i+':0'+t,m.A.ql):this.wi?.jl(4,329,'System update in: '+i+':'+t,m.A.ql)}};od=()=>{if(0===this.zh)return;const t=this.wi;let i=0;0!==this.Vt&&(i=1);for(let s=0;s<100;s++){if(!this.Vh[s])continue;const h=this.messageType[s];let e;if((3===h||7===h)&&(7===h||0===this.xh||1===this.xh&&this.mu(this.Kh[s]))&&(e=329-13*i,t?.jl(4,e,'From '+this.Kh[s]+': '+this.Vh[s],m.A.Zl),t?.jl(4,e-1,'From '+this.Kh[s]+': '+this.Vh[s],m.A.Pc),i++,i>=5))return;if(5===h&&this.xh<2&&(e=329-13*i,t?.jl(4,e,this.Vh[s],m.A.Zl),t?.jl(4,e-1,this.Vh[s],m.A.Pc),i++,i>=5))return;if(6===h&&this.xh<2&&(e=329-13*i,t?.jl(4,e,'To '+this.Kh[s]+': '+this.Vh[s],m.A.Zl),t?.jl(4,e-1,'To '+this.Kh[s]+': '+this.Vh[s],m.A.Pc),i++,i>=5))return}};ld=()=>{if(!this.Sr)return;const t=(this.Sr.x>>7)+this.Tn,i=(this.Sr.z>>7)+this.On;if(this.Fr=t>=2944&&t<3392&&i>=3520&&i<6400?1+((i-3520)/8|0):t>=2944&&t<3392&&i>=9920&&i<12800?1+((i-9920)/8|0):0,this.Ur=0,t>=3328&&t<3392&&i>=3200&&i<3264){const s=63&t,h=63&i;(s>=4&&s<=29&&h>=44&&h<=58||s>=36&&s<=61&&h>=44&&h<=58||s>=4&&s<=29&&h>=25&&h<=39||s>=36&&s<=61&&h>=25&&h<=39||s>=4&&s<=29&&h>=6&&h<=20||s>=36&&s<=61&&h>=6&&h<=20)&&(this.Ur=1)}0===this.Ur&&t>=3328&&t<=3393&&i>=3203&&i<=3325&&(this.Ur=2),this.Js=0,(t>=3053&&t<=3156&&i>=3056&&i<=3136||t>=3072&&t<=3118&&i>=9492&&i<=9535)&&(this.Js=1),1===this.Js&&t>=3139&&t<=3199&&i>=3008&&i<=3062&&(this.Js=0)};Uf=()=>{this.Di?.bind(),this.Ji&&(d.A.mc=this.Ji),this.ns?.draw(0,0),-1!==this.oh?this.Ol(c.A.Do[this.oh],0,0,0):-1!==this.Mh[this.Sh]&&this.Ol(c.A.Do[this.Mh[this.Sh]],0,0,0),this.Qs&&1===this.th&&this.ad(),this.Di?.draw(562,231),this.Pi?.bind(),this.Qi&&(d.A.mc=this.Qi)};Gf=()=>{if(this.Fi?.bind(),this.$i&&(d.A.mc=this.$i),this.rs?.draw(0,0),this.Fh)this.yi?.vc(239,40,this.Uh,m.A.Zl),this.yi?.vc(239,60,this.Bh+'*',m.A.ud);else if(this.Wh)this.yi?.vc(239,40,'Enter amount:',m.A.Zl),this.yi?.vc(239,60,this.Hh+'*',m.A.ud);else if(this.Lh)this.yi?.vc(239,40,this.Lh,m.A.Zl),this.yi?.vc(239,60,'Click to continue',m.A.ud);else if(-1!==this.lh)this.Ol(c.A.Do[this.lh],0,0,0);else if(-1===this.Yh){let t=this.wi;0===$.K.rt&&(t=this.Ai);let i=0;u.A.vl(0,0,463,77);for(let s=0;s<100;s++){const h=this.Vh[s];if(!h)continue;const e=this.messageType[s],n=this.uh+70-14*i;0===e&&(n>0&&n<110&&t?.jl(4,n,h,m.A.Zl),i++),1===e&&(n>0&&n<110&&(t?.jl(4,n,this.Kh[s]+':',m.A.Sl),t?.jl(t.Iu(this.Kh[s])+12,n,h,m.A.BLUE)),i++),2===e&&(0===this.kh||1===this.kh&&this.mu(this.Kh[s]))&&(n>0&&n<110&&(t?.jl(4,n,this.Kh[s]+':',m.A.Zl),t?.jl(t.Iu(this.Kh[s])+12,n,h,m.A.BLUE)),i++),3!==e&&7!==e||0!==this.zh||!(7===e||0===this.xh||1===this.xh&&this.mu(this.Kh[s]))||(n>0&&n<110&&(t?.jl(4,n,'From '+this.Kh[s]+':',m.A.Zl),t?.jl(t.Iu('From '+this.Kh[s])+12,n,h,m.A.dd)),i++),4===e&&(0===this.Dh||1===this.Dh&&this.mu(this.Kh[s]))&&(n>0&&n<110&&t?.jl(4,n,this.Kh[s]+' '+this.Vh[s],m.A.wd),i++),5===e&&0===this.zh&&this.xh<2&&(n>0&&n<110&&t?.jl(4,n,h,m.A.dd),i++),6===e&&0===this.zh&&this.xh<2&&(n>0&&n<110&&(t?.jl(4,n,'To '+this.Kh[s]+':',m.A.Zl),t?.jl(t.Iu('To '+this.Kh[s])+12,n,h,m.A.dd)),i++),8===e&&(0===this.Dh||1===this.Dh&&this.mu(this.Kh[s]))&&(n>0&&n<110&&t?.jl(4,n,this.Kh[s]+' '+this.Vh[s],m.A.yd),i++)}u.A.qu(),this.fh=14*i+7,this.fh<78&&(this.fh=78),this.cl(463,0,this.fh-this.uh-77,this.fh,77),0==$.K.rt?t?.jl(3,90,this.qh+'*',m.A.Zl):1==$.K.rt?t?.jl(3,90,this.qh+'*',m.A.BLUE):(t?.jl(4,90,M.A.ka(this.username)+':',m.A.Zl),t?.jl(t.Iu(this.username+': ')+6,90,this.qh+'*',m.A.BLUE)),u.A.yl(0,77,m.A.Zl,479)}else this.Ol(c.A.Do[this.Yh],0,0,0);this.Qs&&2===this.th&&this.ad(),this.Fi?.draw(22,375),this.Pi?.bind(),this.Qi&&(d.A.mc=this.Qi)};Hf=()=>{if(this.Ni?.bind(),!this.Sr)return;const t=this.Fn+this.yn&2047;let i=48+(this.Sr.x/32|0),s=464-(this.Sr.z/32|0);this.ws?.Ad(21,9,146,151,this.hs,this.es,i,s,t,this.An+256),this.ys?.Ad(0,0,33,33,this.ts,this.ss,25,25,this.Fn,256);for(let t=0;t{if(!i)return;const h=this.Fn+this.yn&2047,e=s*s+t*t;if(e>6400)return;let n=d.A.sin[h],r=d.A.cos[h];n=256*n/(this.An+256)|0,r=256*r/(this.An+256)|0;const o=t*n+s*r>>16,l=t*r-s*n>>16;e>2500&&this.os?i.gd(o+94-(i.Xl/2|0),83-l-(i.Ed/2|0),this.os):i.draw(o+94-(i.Xl/2|0),83-l-(i.Ed/2|0))};_d=t=>{if(!this.ws)return;const i=this.ws.yc,s=i.length;for(let t=0;t>14&32767;const h=e.A.get(s).vd;if(h<0)continue;let n=t,r=i;if(22!==h&&29!==h&&34!==h&&36!==h&&46!==h&&47!==h&&48!==h){const s=G.A.Xn,h=G.A.Xn,e=this.kn[this.Dn];if(e){const o=e.flags;for(let e=0;e<10;e++){const e=4*Math.random()|0;0===e&&n>0&&n>t-3&&(o[G.A.index(n-1,r)]&H.A.bd)===H.A.OPEN&&n--,1===e&&n0&&r>i-3&&(o[G.A.index(n,r-1)]&H.A.Rd)===H.A.OPEN&&r--,3===e&&r{if(!this.He||!this.ws)return;let r=this.He.Md(s,t,i);if(0!==r){const o=this.He.kd(s,t,i,r),l=o>>6&3,a=31&o;let c=h;r>0&&(c=n);const f=this.ws.yc,u=4*t+512*(103-i)*4+24624,d=r>>14&32767,w=e.A.get(d);if(-1===w.xd)a!==P.A.Dd.id&&a!==P.A.Nd.id||(l===F.A.Pd?(f[u]=c,f[u+512]=c,f[u+1024]=c,f[u+1536]=c):l===F.A.Fd?(f[u]=c,f[u+1]=c,f[u+2]=c,f[u+3]=c):l===F.A.Ud?(f[u+3]=c,f[u+3+512]=c,f[u+3+1024]=c,f[u+3+1536]=c):l===F.A.Bd&&(f[u+1536]=c,f[u+1536+1]=c,f[u+1536+2]=c,f[u+1536+3]=c)),a===P.A.Gd.id&&(l===F.A.Pd?f[u]=c:l===F.A.Fd?f[u+3]=c:l===F.A.Ud?f[u+3+1536]=c:l===F.A.Bd&&(f[u+1536]=c)),a===P.A.Nd.id&&(l===F.A.Bd?(f[u]=c,f[u+512]=c,f[u+1024]=c,f[u+1536]=c):l===F.A.Pd?(f[u]=c,f[u+1]=c,f[u+2]=c,f[u+3]=c):l===F.A.Fd?(f[u+3]=c,f[u+3+512]=c,f[u+3+1024]=c,f[u+3+1536]=c):l===F.A.Ud&&(f[u+1536]=c,f[u+1536+1]=c,f[u+1536+2]=c,f[u+1536+3]=c));else{const s=this.As[w.xd];if(s){const h=(4*w.width-s.width)/2|0,e=(4*w.length-s.height)/2|0;s.draw(4*t+48+h,4*(G.A.Xn-i-w.length)+e+48)}}}if(r=this.He.Hd(s,t,i),0!==r){const h=this.He.kd(s,t,i,r),n=h>>6&3,o=31&h,l=r>>14&32767,a=e.A.get(l);if(-1!==a.xd){const s=this.As[a.xd];if(s){const h=(4*a.width-s.width)/2|0,e=(4*a.length-s.height)/2|0;s.draw(4*t+48+h,4*(G.A.Xn-i-a.length)+e+48)}}else if(o===P.A.Wd.id){let s=15658734;r>0&&(s=15597568);const h=this.ws.yc,e=4*t+512*(G.A.Xn-1-i)*4+24624;n===F.A.Pd||n===F.A.Ud?(h[e+1536]=s,h[e+1024+1]=s,h[e+512+2]=s,h[e+3]=s):(h[e]=s,h[e+512+1]=s,h[e+1024+2]=s,h[e+1536+3]=s)}}if(r=this.He.Od(s,t,i),0!==r){const s=e.A.get(r>>14&32767);if(-1!==s.xd){const h=this.As[s.xd];if(h){const e=(4*s.width-h.width)/2|0,n=(4*s.length-h.height)/2|0;h.draw(4*t+48+e,4*(G.A.Xn-i-s.length)+n+48)}}}};fd=()=>{if(this.nh<2&&0===this.oe&&0===this.Ie)return;let t;t=1===this.oe&&this.nh<2?'Use '+this.fe+' with...':1===this.Ie&&this.nh<2?this._e+'...':this.rh[this.nh-1],this.nh>2&&(t=t+'@whi@ / '+(this.nh-2)+' more options'),this.yi?.Yd(4,15,t,m.A.Sl,!0,this.Pt/1e3|0)};ad=()=>{const t=this.ih,i=this.sh,s=this.hh,h=this.eh,e=m.A.Vd;u.A.fillRect(t,i,s,h,e),u.A.fillRect(t+1,i+1,s-2,16,m.A.Zl),u.A.Rl(t+1,i+18,s-2,h-19,m.A.Zl),this.yi?.jl(t+3,i+14,'Choose Option',e);let n=this.Yl,r=this.Vl;0===this.th&&(n-=8,r-=11),1===this.th&&(n-=562,r-=231),2===this.th&&(n-=22,r-=375);for(let h=0;ht&&ne-13&&r{if(0!==this.se)return;let t=this.Uc;if(1===this.Ie&&this.Bc>=520&&this.Gc>=165&&this.Bc<=788&&this.Gc<=230&&(t=0),this.Qs){if(1!==t){let t=this.Yl,i=this.Vl;0===this.th?(t-=8,i-=11):1===this.th?(t-=562,i-=231):2===this.th&&(t-=22,i-=375),(tthis.ih+this.hh+10||ithis.sh+this.eh+10)&&(this.Qs=!1,1===this.th&&(this.Ws=!0),2===this.th&&(this.Ys=!0))}if(1===t){const t=this.ih,i=this.sh,s=this.hh;let h=this.Bc,e=this.Gc;0===this.th?(h-=8,e-=11):1===this.th?(h-=562,e-=231):2===this.th&&(h-=22,e-=375);let n=-1;for(let r=0;rt&&ho-13&&e0){const t=this.Te[this.nh-1];if(602===t||596===t||22===t||892===t||415===t||405===t||38===t||422===t||478===t||347===t||188===t){const t=this.ve[this.nh-1],i=this.be[this.nh-1];if(c.A.Do[i].draggable)return this.re=!1,this.ne=0,this.te=i,this.ie=t,this.se=2,this.he=this.Bc,this.ee=this.Gc,c.A.Do[i].Kd===this.Xs&&(this.se=1),void(c.A.Do[i].Kd===this.lh&&(this.se=3))}}if(1===t&&(1===this.Ce||this.pf(this.nh-1))&&this.nh>2&&(t=2),1===t&&this.nh>0&&await this.If(this.nh-1),2!==t||this.nh<=0)return;this.mf()}};bf=()=>{if(1===this.Uc&&this.Sr){let t=this.Bc-21-561,i=this.Gc-9-5;if(t>=0&&i>=0&&t<146&&i<151){t-=73,i-=75;const s=this.Fn+this.yn&2047;let h=d.A.sin[s],e=d.A.cos[s];h=h*(this.An+256)>>8,e=e*(this.An+256)>>8;const n=i*h+t*e>>11,r=i*e-t*h>>11,o=this.Sr.x+n>>7,l=this.Sr.z-r>>7;this.Cf(this.Sr.Tf[0],this.Sr.Of[0],o,l,1,0,0,0,0,0,!0)&&(this.Bt.p1(t),this.Bt.p1(i),this.Bt.p2(this.Fn),this.Bt.p1(57),this.Bt.p1(this.yn),this.Bt.p1(this.An),this.Bt.p1(89),this.Bt.p2(this.Sr.x),this.Bt.p2(this.Sr.z),this.Bt.p1(this.Rr),this.Bt.p1(63))}}};pf=t=>{if(t<0)return!1;let i=this.Te[t];return i>=2e3&&(i-=2e3),406===i};If=async t=>{if(t<0)return;this.Wh&&(this.Wh=!1,this.Ys=!0);let i=this.Te[t];const s=this.Oe[t],h=this.ve[t],r=this.be[t];if(i>=2e3&&(i-=2e3),903===i||363===i){let s=this.rh[t];const h=s.indexOf('@whi@');if(-1!==h){s=s.substring(h+5).trim();const t=M.A.ka(M.A.xa(M.A.Id(s)));let e=!1;for(let s=0;s=90&&this.Bt.ef(O.A.$d),this.Bt.ef(O.A.Jd)):347===i?this.Bt.ef(O.A.Qd):422===i?this.Bt.ef(O.A.tw):405===i?($.K.Et+=s,$.K.Et>=97&&(this.Bt.ef(O.A.iw),this.Bt.p3(14953816)),this.Bt.ef(O.A.sw)):38===i&&this.Bt.ef(O.A.hw),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.ye=0,this.we=r,this.de=h,this.ue=2,c.A.Do[r].Kd===this.Xs&&(this.ue=1),c.A.Do[r].Kd===this.lh&&(this.ue=3);else if(728===i||542===i||6===i||963===i||245===i){const t=this.yr[s];t&&this.Sr&&(this.Cf(this.Sr.Tf[0],this.Sr.Of[0],t.Tf[0],t.Of[0],2,1,1,0,0,0,!1),this.qs=this.Bc,this.$s=this.Gc,this.zs=2,this.Zs=0,542===i?this.Bt.ef(O.A.ew):6===i?(3&s||$.K.gt++,$.K.gt>=124&&(this.Bt.ef(O.A.nw),this.Bt.p4(0)),this.Bt.ef(O.A.rw)):963===i?this.Bt.ef(O.A.ow):728===i?this.Bt.ef(O.A.lw):245===i&&(3&s||$.K._t++,$.K._t>=85&&(this.Bt.ef(O.A.aw),this.Bt.p2(39596)),this.Bt.ef(O.A.cw)),this.Bt.p2(s))}else if(217===i){if(this.Sr){this.Cf(this.Sr.Tf[0],this.Sr.Of[0],h,r,2,0,0,0,0,0,!1)||this.Cf(this.Sr.Tf[0],this.Sr.Of[0],h,r,2,1,1,0,0,0,!1),this.qs=this.Bc,this.$s=this.Gc,this.zs=2,this.Zs=0,this.Bt.ef(O.A.fw),this.Bt.p2(h+this.Tn),this.Bt.p2(r+this.On),this.Bt.p2(s),this.Bt.p2(this.ce),this.Bt.p2(this.le),this.Bt.p2(this.ae)}}else if(1175===i){const t=s>>14&32767,i=e.A.get(t);let h;h=i.uw?i.uw:"It's a "+i.name+'.',this.zd(0,h,'')}else if(285===i)this.Zd(O.A.dw,h,r,s);else if(881===i)this.Bt.ef(O.A.ww),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.Bt.p2(this.ce),this.Bt.p2(this.le),this.Bt.p2(this.ae),this.ye=0,this.we=r,this.de=h,this.ue=2,c.A.Do[r].Kd===this.Xs&&(this.ue=1),c.A.Do[r].Kd===this.lh&&(this.ue=3);else if(391===i)this.Bt.ef(O.A.yw),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.Bt.p2(this.ge),this.ye=0,this.we=r,this.de=h,this.ue=2,c.A.Do[r].Kd===this.Xs&&(this.ue=1),c.A.Do[r].Kd===this.lh&&(this.ue=3);else if(660===i)this.Qs?this.He?.click(h-8,r-11):this.He?.click(this.Bc-8,this.Gc-11);else{if(188===i)return this.oe=1,this.le=h,this.ae=r,this.ce=s,this.fe=n.A.get(s).name,void(this.Ie=0);if(44===i)this.Ae||(this.Bt.ef(O.A.Aw),this.Bt.p2(r),this.Ae=!0);else if(1773===i){const t=n.A.get(s);let i;i=r>=1e5?r+' x '+t.name:t.uw?t.uw:"It's a "+t.name+'.',this.zd(0,i,'')}else if(900===i){const t=this.yr[s];t&&this.Sr&&(this.Cf(this.Sr.Tf[0],this.Sr.Of[0],t.Tf[0],t.Of[0],2,1,1,0,0,0,!1),this.qs=this.Bc,this.$s=this.Gc,this.zs=2,this.Zs=0,this.Bt.ef(O.A.pw),this.Bt.p2(s),this.Bt.p2(this.ce),this.Bt.p2(this.le),this.Bt.p2(this.ae))}else if(1373===i||1544===i||151===i||1101===i){const t=this.nr[s];t&&this.Sr&&(this.Cf(this.Sr.Tf[0],this.Sr.Of[0],t.Tf[0],t.Of[0],2,1,1,0,0,0,!1),this.qs=this.Bc,this.$s=this.Gc,this.zs=2,this.Zs=0,1101===i?this.Bt.ef(O.A.jd):151===i?($.K.vt++,$.K.vt>=90&&(this.Bt.ef(O.A.mw),this.Bt.p2(31114)),this.Bt.ef(O.A.Iw)):1373===i?this.Bt.ef(O.A.Xd):1544===i&&this.Bt.ef(O.A.gw),this.Bt.p2(s))}else if(265===i){const t=this.yr[s];t&&this.Sr&&(this.Cf(this.Sr.Tf[0],this.Sr.Of[0],t.Tf[0],t.Of[0],2,1,1,0,0,0,!1),this.qs=this.Bc,this.$s=this.Gc,this.zs=2,this.Zs=0,this.Bt.ef(O.A.Ew),this.Bt.p2(s),this.Bt.p2(this.ge))}else if(679===i){const i=this.rh[t],s=i.indexOf('@whi@');if(-1!==s){const t=M.A.Id(i.substring(s+5).trim());let h=-1;for(let i=0;i0&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=3,this.no=this.ho[h],this.Uh='Enter message to send to '+this.so[h])}}else if(55===i)this.Zd(O.A._w,h,r,s)&&this.Bt.p2(this.ge);else if(224===i||993===i||99===i||746===i||877===i){if(this.Sr){this.Cf(this.Sr.Tf[0],this.Sr.Of[0],h,r,2,0,0,0,0,0,!1)||this.Cf(this.Sr.Tf[0],this.Sr.Of[0],h,r,2,1,1,0,0,0,!1),this.qs=this.Bc,this.$s=this.Gc,this.zs=2,this.Zs=0,224===i?this.Bt.ef(O.A.Cw):746===i?this.Bt.ef(O.A.Tw):877===i?this.Bt.ef(O.A.Ow):99===i?this.Bt.ef(O.A.bw):993===i&&this.Bt.ef(O.A.Lw),this.Bt.p2(h+this.Tn),this.Bt.p2(r+this.On),this.Bt.p2(s)}}else if(1607===i){const t=this.yr[s];if(t&&t.type){let i;i=t.type.uw?t.type.uw:"It's a "+t.type.name+'.',this.zd(0,i,'')}}else if(504===i)this.Zd(O.A.Rw,h,r,s);else{if(930===i){const t=c.A.Do[r];this.Ie=1,this.ge=r,this.Ee=t.Sw,this.oe=0;let i=t.Mw;i&&-1!==i.indexOf(' ')&&(i=i.substring(0,i.indexOf(' ')));let s=t.Mw;return s&&-1!==s.indexOf(' ')&&(s=s.substring(s.indexOf(' ')+1)),this._e=i+' '+t.action+' '+s,void(16===this.Ee&&(this.Ws=!0,this.Sh=3,this.Vs=!0))}if(951===i){const t=c.A.Do[r];let i=!0;t.Ml>0&&(i=this.kw(t)),i&&(this.Bt.ef(O.A.xw),this.Bt.p2(r))}else if(602===i||596===i||22===i||892===i||415===i)22===i?this.Bt.ef(O.A.Dw):415===i?(3&r||$.K.Ot++,$.K.Ot>=55&&(this.Bt.ef(O.A.Nw),this.Bt.p4(0)),this.Bt.ef(O.A.Pw)):602===i?this.Bt.ef(O.A.Fw):892===i?(3&h||$.K.bt++,$.K.bt>=130&&(this.Bt.ef(O.A.Uw),this.Bt.p1(177)),this.Bt.ef(O.A.Bw)):596===i&&this.Bt.ef(O.A.Gw),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.ye=0,this.we=r,this.de=h,this.ue=2,c.A.Do[r].Kd===this.Xs&&(this.ue=1),c.A.Do[r].Kd===this.lh&&(this.ue=3);else if(581===i)3&s||$.K.It++,$.K.It>=99&&(this.Bt.ef(O.A.Hw),this.Bt.p4(0)),this.Zd(O.A.Ww,h,r,s);else if(965===i){if(this.Sr){this.Cf(this.Sr.Tf[0],this.Sr.Of[0],h,r,2,0,0,0,0,0,!1)||this.Cf(this.Sr.Tf[0],this.Sr.Of[0],h,r,2,1,1,0,0,0,!1),this.qs=this.Bc,this.$s=this.Gc,this.zs=2,this.Zs=0,this.Bt.ef(O.A.Yw),this.Bt.p2(h+this.Tn),this.Bt.p2(r+this.On),this.Bt.p2(s),this.Bt.p2(this.ge)}}else if(1501===i)$.K.Tt+=this.On,$.K.Tt>=92&&(this.Bt.ef(O.A.Vw),this.Bt.p4(0)),this.Zd(O.A.Kw,h,r,s);else if(364===i)this.Zd(O.A.Xw,h,r,s);else if(1102===i){const t=n.A.get(s);let i;i=t.uw?t.uw:"It's a "+t.name+'.',this.zd(0,i,'')}else if(960===i){this.Bt.ef(O.A.xw),this.Bt.p2(r);const t=c.A.Do[r];if(t.scripts&&t.scripts[0]&&5===t.scripts[0][0]){const i=t.scripts[0][1];t.al&&this.pe[i]!==t.al[0]&&(this.pe[i]=t.al[0],await this.jw(i),this.Ws=!0)}}else if(34===i){const i=this.rh[t],s=i.indexOf('@whi@');if(-1!==s){this.zw(),this.Me=i.substring(s+5).trim(),this.ke=!1;for(let t=0;t{const i=t.Ml;if(i===c.A.iy&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=1,this.Uh='Enter name of friend to add to list'),i===c.A.sy&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=2,this.Uh='Enter name of friend to delete from list'),i===c.A.hy)return this.Yt=250,!0;if(i===c.A.ey&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=4,this.Uh='Enter name of player to add to list'),i===c.A.ny&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=5,this.Uh='Enter name of player to delete from list'),i>=c.A.oy&&i<=c.A.ly){const t=(i-300)/2|0,s=1&i;let h=this.Wr[t];if(-1!==h)for(;;)if(0===s&&(h--,h<0&&(h=o.A.count-1)),1===s&&(h++,h>=o.A.count&&(h=0)),!o.A.Do[h].disable&&o.A.Do[h].type===t+(this.Gr?0:7)){this.Wr[t]=h,this.Hr=!0;break}}if(i>=c.A.uy&&i<=c.A.wy){const t=(i-314)/2|0,s=1&i;let h=this.Yr[t];0===s&&(h--,h<0&&(h=W.A.Ua[t].length-1)),1===s&&(h++,h>=W.A.Ua[t].length&&(h=0)),this.Yr[t]=h,this.Hr=!0}if(i!==c.A.Va||this.Gr||(this.Gr=!0,this.tf()),i===c.A.Ka&&this.Gr&&(this.Gr=!1,this.tf()),i===c.A.yy){this.Bt.ef(O.A.Ay),this.Bt.p1(this.Gr?0:1);for(let t=0;t<7;t++)this.Bt.p1(this.Wr[t]);for(let t=0;t<5;t++)this.Bt.p1(this.Yr[t]);return!0}return i===c.A.ja&&(this.ke=!this.ke),i>=c.A.py&&i<=c.A.my&&(this.zw(),this.Me.length>0&&(this.Bt.ef(O.A.Iy),this.Bt.gy(M.A.Id(this.Me)),this.Bt.p1(i-601),this.Bt.p1(this.ke?1:0))),!1};tf=()=>{this.Hr=!0;for(let t=0;t<7;t++){this.Wr[t]=-1;for(let i=0;i{if(!this.Sr||!this.He)return!1;const n=h>>14&32767,r=this.He.kd(this.Dn,i,s,h);if(-1===r)return!1;const o=31&r,l=r>>6&3;if(o===P.A.Ey.id||o===P.A._y.id||o===P.A.Cy.id){const t=e.A.get(n);let h,r;l===F.A.Pd||l===F.A.Ud?(h=t.width,r=t.length):(h=t.length,r=t.width);let o=t.Ty;0!==l&&(o=(o<>4-l)),this.Cf(this.Sr.Tf[0],this.Sr.Of[0],i,s,2,h,r,0,0,o,!1)}else this.Cf(this.Sr.Tf[0],this.Sr.Of[0],i,s,2,0,0,l,o+1,0,!1);return this.qs=this.Bc,this.$s=this.Gc,this.zs=2,this.Zs=0,this.Bt.ef(t),this.Bt.p2(i+this.Tn),this.Bt.p2(s+this.On),this.Bt.p2(n),!0};Lf=()=>{1===this.Uc&&(this.Bc>=549&&this.Bc<=583&&this.Gc>=195&&this.Gc<231&&-1!==this.Mh[0]?(this.Ws=!0,this.Sh=0,this.Vs=!0):this.Bc>=579&&this.Bc<=609&&this.Gc>=194&&this.Gc<231&&-1!==this.Mh[1]?(this.Ws=!0,this.Sh=1,this.Vs=!0):this.Bc>=607&&this.Bc<=637&&this.Gc>=194&&this.Gc<231&&-1!==this.Mh[2]?(this.Ws=!0,this.Sh=2,this.Vs=!0):this.Bc>=635&&this.Bc<=679&&this.Gc>=194&&this.Gc<229&&-1!==this.Mh[3]?(this.Ws=!0,this.Sh=3,this.Vs=!0):this.Bc>=676&&this.Bc<=706&&this.Gc>=194&&this.Gc<231&&-1!==this.Mh[4]?(this.Ws=!0,this.Sh=4,this.Vs=!0):this.Bc>=704&&this.Bc<=734&&this.Gc>=194&&this.Gc<231&&-1!==this.Mh[5]?(this.Ws=!0,this.Sh=5,this.Vs=!0):this.Bc>=732&&this.Bc<=766&&this.Gc>=195&&this.Gc<231&&-1!==this.Mh[6]?(this.Ws=!0,this.Sh=6,this.Vs=!0):this.Bc>=550&&this.Bc<=584&&this.Gc>=492&&this.Gc<528&&-1!==this.Mh[7]?(this.Ws=!0,this.Sh=7,this.Vs=!0):this.Bc>=582&&this.Bc<=612&&this.Gc>=492&&this.Gc<529&&-1!==this.Mh[8]?(this.Ws=!0,this.Sh=8,this.Vs=!0):this.Bc>=609&&this.Bc<=639&&this.Gc>=492&&this.Gc<529&&-1!==this.Mh[9]?(this.Ws=!0,this.Sh=9,this.Vs=!0):this.Bc>=637&&this.Bc<=681&&this.Gc>=493&&this.Gc<528&&-1!==this.Mh[10]?(this.Ws=!0,this.Sh=10,this.Vs=!0):this.Bc>=679&&this.Bc<=709&&this.Gc>=492&&this.Gc<529&&-1!==this.Mh[11]?(this.Ws=!0,this.Sh=11,this.Vs=!0):this.Bc>=706&&this.Bc<=736&&this.Gc>=492&&this.Gc<529&&-1!==this.Mh[12]?(this.Ws=!0,this.Sh=12,this.Vs=!0):this.Bc>=734&&this.Bc<=768&&this.Gc>=492&&this.Gc<528&&-1!==this.Mh[13]&&(this.Ws=!0,this.Sh=13,this.Vs=!0),$.K.ft++,$.K.ft>150&&($.K.ft=0,this.Bt.ef(O.A.Oy),this.Bt.p1(43)))};xf=async()=>{for(;;){let t;do{for(;;){if(t=this.Wc(),-1===t)return;if(-1!==this.Xs&&this.Xs===this.xe){8===t&&this.Me.length>0&&(this.Me=this.Me.substring(0,this.Me.length-1));break}if(this.Fh){if(t>=32&&t<=122&&this.Bh.length<80&&(this.Bh=this.Bh+String.fromCharCode(t),this.Ys=!0),8===t&&this.Bh.length>0&&(this.Bh=this.Bh.substring(0,this.Bh.length-1),this.Ys=!0),13===t||10===t){let t;if(this.Fh=!1,this.Ys=!0,1===this.Gh&&(t=M.A.Id(this.Bh),this.qw(t)),2===this.Gh&&this.Vr>0&&(t=M.A.Id(this.Bh),this.Jw(t)),3===this.Gh&&this.Bh.length>0&&this.no){this.Bt.ef(O.A.vy),this.Bt.p1(0);const t=this.Bt.jc;this.Bt.gy(this.no),b.A.by(this.Bt,this.Bh),this.Bt.$f(this.Bt.jc-t),this.Bh=M.A.Ly(this.Bh),this.Bh=v.A.filter(this.Bh),this.zd(6,this.Bh,M.A.ka(M.A.xa(this.no))),2===this.xh&&(this.xh=1,this.Ks=!0,this.Bt.ef(O.A.Ry),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh))}4===this.Gh&&this.dh<100&&(t=M.A.Id(this.Bh),this.$w(t)),5===this.Gh&&this.dh>0&&(t=M.A.Id(this.Bh),this.Qw(t))}}else if(this.Wh){if(t>=48&&t<=57&&this.Hh.length<10&&(this.Hh=this.Hh+String.fromCharCode(t),this.Ys=!0),8===t&&this.Hh.length>0&&(this.Hh=this.Hh.substring(0,this.Hh.length-1),this.Ys=!0),13===t||10===t){if(this.Hh.length>0){let t=0;try{t=parseInt(this.Hh,10)}catch(t){}this.Bt.ef(O.A.Sy),this.Bt.p4(t)}this.Wh=!1,this.Ys=!0}}else if(-1===this.lh&&(t>=32&&t<=122&&this.qh.length<80&&(this.qh=this.qh+String.fromCharCode(t),this.Ys=!0),8===t&&this.qh.length>0&&(this.qh=this.qh.substring(0,this.qh.length-1),this.Ys=!0),(13===t||10===t)&&this.qh.length>0)){if('::clientdrop'===this.qh)await this.rf();else if(this.Br&&'::noclip'===this.qh)for(let t=0;t122)&&(t<65||t>90)&&(t<48||t>57)&&32!==t);this.Me.length<12&&(this.Me=this.Me+String.fromCharCode(t))}};Rf=()=>{if(1===this.Uc)if(this.Bc>=8&&this.Bc<=108&&this.Gc>=490&&this.Gc<=522)this.kh=(this.kh+1)%4,this.Ks=!0,this.Ys=!0,this.Bt.ef(O.A.Ry),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh);else if(this.Bc>=137&&this.Bc<=237&&this.Gc>=490&&this.Gc<=522)this.xh=(this.xh+1)%3,this.Ks=!0,this.Ys=!0,this.Bt.ef(O.A.Ry),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh);else if(this.Bc>=275&&this.Bc<=375&&this.Gc>=490&&this.Gc<=522)this.Dh=(this.Dh+1)%3,this.Ks=!0,this.Ys=!0,this.Bt.ef(O.A.Ry),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh);else if(this.Bc>=416&&this.Bc<=516&&this.Gc>=490&&this.Gc<=522){this.zw(),this.Me='',this.ke=!1;for(let t=0;t{if(this.Nh?this.Ph=32:this.Ph=0,this.Nh=!1,t>=n&&t=r&&i=n&&t=r+h-16&&i=n-this.Ph&&t=r+16&&i0){let t=(h-32)*h/s|0;t<8&&(t=8);const n=i-r-(t/2|0)-16,l=h-t-32;o.Dl=(s-h)*n/l|0,e&&(this.Ws=!0),this.Nh=!0}};if=()=>{this.Fi||(this.xo(),this.Po=null,this.ti=null,this.ii=null,this.si=null,this.hi=null,this.ei=null,this.ni=null,this.ri=null,this.oi=null,this.li=null,this.Fi=new f.A(479,96),this.Ni=new f.A(168,160),u.A.clear(),this.os?.draw(0,0),this.Di=new f.A(190,261),this.Pi=new f.A(512,334),u.A.clear(),this.Ui=new f.A(501,61),this.Bi=new f.A(288,40),this.Gi=new f.A(269,66),this.$t=!0)};mu=t=>{if(!t)return!1;for(let i=0;i{if(0n===t)return;if(this.Vr>=100)return void this.zd(0,'Your friends list is full. Max of 100 hit','');const i=M.A.ka(M.A.xa(t));for(let s=0;s{if(0n!==t)for(let i=0;i{if(0n===t)return;if(this.dh>=100)return void this.zd(0,'Your ignore list is full. Max of 100 hit','');const i=M.A.ka(M.A.xa(t));for(let s=0;s{if(0n!==t)for(let i=0;i{const s=this._r[this.Dn][t][i];if(!s)return void this.He?.By(this.Dn,t,i);let h=-99999999,e=null;for(let t=s.head();t;t=s.next()){const i=n.A.get(t.index);let s=i.Gy;i.Ca&&(s*=t.count+1),s>h&&(h=s,e=t)}if(!e)return;s.Hy(e);let r=-1,o=-1,l=0,a=0;for(let t=s.head();t;t=s.next())t.index!==e.index&&-1===r&&(r=t.index,l=t.count),t.index!==e.index&&t.index!==r&&-1===o&&(o=t.index,a=t.count);let c=null;-1!==r&&(c=n.A.get(r).Wy(l));let f=null;-1!==o&&(f=n.A.get(o).Wy(a));const u=t+(i<<7)+1610612736|0,d=n.A.get(e.index);this.He?.Yy(t,i,this.Zf(this.Dn,128*t+64,128*i+64),this.Dn,u,d.Wy(e.count),f,c)};Vy=(t,i,s,h,n,r,o)=>{if(i<1||s<1||i>102||s>102)return;if($.K.st&&t!==this.Dn)return;if(!this.He)return;let l=0;if(o===N.A.Ky&&(l=this.He.Md(t,i,s)),o===N.A.Xy&&(l=this.He.jy(t,s,i)),o===N.A.zy&&(l=this.He.Hd(t,i,s)),o===N.A.Cy&&(l=this.He.Od(t,i,s)),0!==l){const h=this.He.kd(t,i,s,l),n=l>>14&32767,r=31&h,a=h>>6;if(o===N.A.Ky){this.He?.Zy(t,i,s,1);const h=e.A.get(n);h.qy&&this.kn[t]?.Zy(i,s,r,a,h.$y)}if(o===N.A.Xy&&this.He?.Jy(t,i,s),o===N.A.zy){this.He.Qy(t,i,s);const h=e.A.get(n);if(i+h.width>G.A.Xn-1||s+h.width>G.A.Xn-1||i+h.length>G.A.Xn-1||s+h.length>G.A.Xn-1)return;h.qy&&this.kn[t]?.Qy(i,s,h.width,h.length,a,h.$y)}if(o===N.A.Cy){this.He?.tA(t,i,s);const h=e.A.get(n);h.qy&&h.active&&this.kn[t]?.iA(i,s)}}if(h>=0){let e=t;this.Yn&&t<3&&!(2&~this.Yn[1][i][s])&&(e=t+1),this.Wn&&D.A.Vy(t,i,s,this.He,this.Wn,this.gr,this.kn[t],h,r,n,e)}};zw=()=>{this.Bt.ef(O.A.sA),-1!==this.oh&&(this.oh=-1,this.Ws=!0,this.Ae=!1,this.Vs=!0),-1!==this.lh&&(this.lh=-1,this.Ys=!0,this.Ae=!1),this.Xs=-1};rf=async()=>{this.Yt>0?await this.hA():(this.Pi?.bind(),this.wi?.vc(257,144,'Connection lost',m.A.Zl),this.wi?.vc(256,143,'Connection lost',m.A.Sl),this.wi?.vc(257,159,'Please wait - attempting to reestablish',m.A.Zl),this.wi?.vc(256,158,'Please wait - attempting to reestablish',m.A.Sl),this.Pi?.draw(8,11),this.Ke=0,this.stream?.close(),this.gc=!1,await this.Hc(this.username,this.password,!0),this.gc||await this.hA())};hA=async()=>{this.stream&&this.stream.close(),this.stream=null,this.gc=!1,this.Jt=0,this.username='',this.password='',k.A.Jc(),this.au(),this.He?.reset();for(let t=0;t{if(!this.stream)return!1;try{let t=this.stream.available;if(0===t)return!1;if(-1===this.Xt&&(await this.stream.Xc(this.in.data,0,1),this.Xt=255&this.in.data[0],this.Kt&&(this.Xt=this.Xt-this.Kt.eA&255),this.packetSize=E.A.nA[this.Xt],t--),-1===this.packetSize){if(t<=0)return!1;await this.stream.Xc(this.in.data,0,1),this.packetSize=255&this.in.data[0],t--}if(-2===this.packetSize){if(t<=1)return!1;await this.stream.Xc(this.in.data,0,2),this.in.jc=0,this.packetSize=this.in.rA,t-=2}if(t0&&this.zd(5,s+' has logged in.',''),0===i&&this.zd(5,s+' has logged out.','')),s=null;break}s&&this.Vr<100&&(this.ho[this.Vr]=t,this.so[this.Vr]=s,this.eo[this.Vr]=i,this.Vr++,this.Ws=!0);let h=!1;for(;!h;){h=!0;for(let t=0;t=0&&h>=0&&s=G.A.Xn||t.z>=G.A.Xn)&&t.pA();return 0!==this.Ke&&(this.Ke-=e,this.Xe-=n),this.je=!1,this.Xt=-1,!0}if(this.Xt===T.A.mA)return c.A.Do[this.in.rA].model=this.Sr?.IA()||null,this.Xt=-1,!0;if(this.Xt===T.A.gA)return this.yh=this.in.cA,1===this.yh&&(this.Ah=this.in.rA),this.yh>=2&&this.yh<=6&&(2===this.yh&&(this.ph=64,this.mh=64),3===this.yh&&(this.ph=0,this.mh=64),4===this.yh&&(this.ph=128,this.mh=64),5===this.yh&&(this.ph=64,this.mh=0),6===this.yh&&(this.ph=64,this.mh=128),this.yh=2,this.gh=this.in.rA,this.Eh=this.in.rA,this._h=this.in.cA),10===this.yh&&(this.Ih=this.in.rA),this.Xt=-1,!0;if(this.Xt===T.A.EA){const t=this.in._A,i=this.in.il,s=this.in.il;return t!==this.mo&&this.po&&!$.K.st&&await this.tl(t,i,s,!0),this.mo=t,this.Io=i,this.Eo=s,this.Ao=0,this.Xt=-1,!0}if(this.Xt===T.A.CA)return await this.hA(),this.Xt=-1,!1;if(this.Xt===T.A.TA){const t=this.in.cA,i=this.in.cA;let s=-1;if(this.Ln)for(let h=0;h=100&&(this.ln=128*this.tr+64,this.cn=128*this.ir+64,this.an=this.Zf(this.Dn,this.tr,this.ir)-this.sr),this.Xt=-1,!0;if(this.Xt===T.A.up){this.gn=this.in.cA,this.En=this.in.cA;for(let t=this.gn;t=this.gn&&t.x=this.En&&t.z1?this.zd(7,e,M.A.ka(M.A.xa(t))):this.zd(3,e,M.A.ka(M.A.xa(t)))}catch(t){}return this.Xt=-1,!0}if(this.Xt===T.A.mp){for(let t=0;t=100){const t=128*this.Zn+64,i=128*this.qn+64,s=this.Zf(this.Dn,this.Zn,this.qn)-this.$n,h=t-this.ln,e=s-this.an,n=i-this.cn,r=0|Math.sqrt(h*h+n*n);this.fn=325.949*Math.atan2(e,r)&2047,this.un=-325.949*Math.atan2(h,n)&2047,this.fn<128&&(this.fn=128),this.fn>383&&(this.fn=383)}return this.Xt=-1,!0}if(this.Xt===T.A.Cp)return this.Sh=this.in.cA,this.Ws=!0,this.Vs=!0,this.Xt=-1,!0;if(this.Xt===T.A.Tp){const t=this.in._A;let i;if(t.endsWith(':tradereq:')){const s=t.substring(0,t.indexOf(':'));i=M.A.Id(s);let h=!1;for(let t=0;t>10&31,h=i>>5&31,e=31&i;return c.A.Do[t].Ql=(s<<19)+(h<<11)+(e<<3),this.Xt=-1,!0}if(this.Xt===T.A.Mp){for(let t=0;t=this.bh[s]&&(this.Oh[t]=s+2);return this.Xt=-1,!0}if(this.Xt===T.A.Up){for(this.gn=this.in.cA,this.En=this.in.cA;this.in.jc=0&&t{try{this.In=-1,this.Er.clear(),this.gr.clear(),this.Ir.clear(),this.mr.clear(),d.A.Xp(),this.au(),this.He?.reset();for(let t=0;t>8,s=255&this.Ln[t];if(33===i&&s>=71&&s<=73){D.A.st=!1;break}}if($.K.st?this.He?.jp(this.Dn):this.He?.jp(0),this.Ln&&this.vn){this.Bt.ef(O.A.Pf);for(let s=0;s>8)-this.Tn,h=64*(255&this.Ln[s])-this.On,e=this.vn[s];if(e){const s=new I.A(new Uint8Array(e)).il,n=R.A.read(s,e,e.length-4,4);t.zp(8*(this._n-6),8*(this.Cn-6),i,h,n)}else this.Cn<800&&t.Zp(h,i,64,64)}}if(this.Ln&&this.bn){this.Bt.ef(O.A.Pf);for(let s=0;s>8)-this.Tn,r=64*(255&this.Ln[s])-this.On;t.qp(this.He,this.gr,this.kn,e,n,r)}}}this.Bt.ef(O.A.Pf),t.$p(this.He,this.kn),this.Pi?.bind(),this.Bt.ef(O.A.Pf);for(let t=this.gr.head();t;t=this.gr.next())2===(this.Yn&&2&this.Yn[1][t.Jp][t.Qp])&&(t.tm--,t.tm<0&&t.pA());for(let t=0;t{const i=c.A.Do[t];if(i.ml)for(let t=0;t{let t=0;for(let i=0;i<99;i++){const s=i+1;t+=s+300*Math.pow(2,s/7)|0,this.bh[i]=t/4|0}};zd=(t,i,s)=>{0===t&&-1!==this.Yh&&(this.Lh=i,this.Uc=0),-1===this.lh&&(this.Ys=!0);for(let t=99;t>0;t--)this.messageType[t]=this.messageType[t-1],this.Kh[t]=this.Kh[t-1],this.Vh[t]=this.Vh[t-1];$.K.nt&&0===t&&(i='['+(this.Pt/30|0)+']: '+i),this.messageType[0]=t,this.Kh[0]=s,this.Vh[0]=i};jw=async t=>{const i=a.A.Do[t].sm;if(0!==i){const s=this.pe[t];if(1===i&&(1===s&&d.A.uc(.9),2===s&&d.A.uc(.8),3===s&&d.A.uc(.7),4===s&&d.A.uc(.6),n.A.uu?.clear(),this.$t=!0),3===i){const t=this.po;0===s&&(this._o=256,(0,z.hm)(256),this.po=!0),1===s&&(this._o=192,(0,z.hm)(192),this.po=!0),2===s&&(this._o=128,(0,z.hm)(128),this.po=!0),3===s&&(this._o=64,(0,z.hm)(64),this.po=!0),4===s&&(this.po=!1),this.po!==t&&(this.po&&this.mo?await this.tl(this.mo,this.Io,this.Eo,!1):(0,z.ko)(!1),this.Ao=0)}4===i&&(0===s&&(this.fo=256,(0,z.nm)(256),this.oo=!0),1===s&&(this.fo=192,(0,z.nm)(192),this.oo=!0),2===s&&(this.fo=128,(0,z.nm)(128),this.oo=!0),3===s&&(this.fo=64,(0,z.nm)(64),this.oo=!0),4===s&&(this.oo=!1)),5===i&&(this.Ce=s),6===i&&(this.Zh=s),8===i&&(this.zh=s,this.Ys=!0)}};rm=(t,i)=>{let s=0;for(let t=0;t<100;t++){if(!this.Vh[t])continue;const h=this.messageType[t],e=this.uh+70+4-14*s;if(e<-20)break;0===h&&s++,1!==h&&2!==h||!(1===h||0===this.kh||1===this.kh&&this.mu(this.Kh[t]))||(i>e-14&&i<=e&&this.Sr&&this.Kh[t]!==this.Sr.name&&(this.Br&&(this.rh[this.nh]='Report abuse @whi@'+this.Kh[t],this.Te[this.nh]=34,this.nh++),this.rh[this.nh]='Add ignore @whi@'+this.Kh[t],this.Te[this.nh]=436,this.nh++,this.rh[this.nh]='Add friend @whi@'+this.Kh[t],this.Te[this.nh]=406,this.nh++),s++),3!==h&&7!==h||0!==this.zh||!(7===h||0===this.xh||1===this.xh&&this.mu(this.Kh[t]))||(i>e-14&&i<=e&&(this.Br&&(this.rh[this.nh]='Report abuse @whi@'+this.Kh[t],this.Te[this.nh]=34,this.nh++),this.rh[this.nh]='Add ignore @whi@'+this.Kh[t],this.Te[this.nh]=436,this.nh++,this.rh[this.nh]='Add friend @whi@'+this.Kh[t],this.Te[this.nh]=406,this.nh++),s++),4===h&&(0===this.Dh||1===this.Dh&&this.mu(this.Kh[t]))&&(i>e-14&&i<=e&&(this.rh[this.nh]='Accept trade @whi@'+this.Kh[t],this.Te[this.nh]=903,this.nh++),s++),(5===h||6===h)&&0===this.zh&&this.xh<2&&s++,8===h&&(0===this.Dh||1===this.Dh&&this.mu(this.Kh[t]))&&(i>e-14&&i<=e&&(this.rh[this.nh]='Accept duel @whi@'+this.Kh[t],this.Te[this.nh]=363,this.nh++),s++)}};om=t=>{if(0===this.zh)return;let i=0;0!==this.Vt&&(i=1);for(let s=0;s<100;s++)if(null!==this.Vh[s]){const h=this.messageType[s];if((3===h||7===h)&&(7===h||0===this.xh||1===this.xh&&this.mu(this.Kh[s]))){const h=329-13*i;if(this.Yl>8&&this.Yl<520&&t-11>h-10&&t-11<=h+3&&(this.Br&&(this.rh[this.nh]='Report abuse @whi@'+this.Kh[s],this.Te[this.nh]=2034,this.nh++),this.rh[this.nh]='Add ignore @whi@'+this.Kh[s],this.Te[this.nh]=2436,this.nh++,this.rh[this.nh]='Add friend @whi@'+this.Kh[s],this.Te[this.nh]=2406,this.nh++),i++,i>=5)return}if((5===h||6===h)&&this.xh<2&&(i++,i>=5))return}};lm=(t,i,s,h,e,r)=>{if(0!==t.type||!t.ml||t.hide||ih+t.width||s>e+t.height||!t.bl||!t.Ll)return;const o=t.ml.length;for(let l=0;l=0||0!==f.ia)&&i>=o&&s>=a&&i=0?this.Se=f.am:this.Se=f.id),0===f.type)this.lm(f,i,s,o,a,f.Dl),f.scroll>f.height&&this.Bf(i,s,f.scroll,f.height,!0,o+f.width,a,f);else if(2===f.type){let t=0;for(let h=0;h=r+32||s>=l+32){t++;continue}if(this.Re=t,this.Le=f.id,!f.Ul||f.Ul[t]<=0){t++;continue}const c=n.A.get(f.Ul[t]-1);if(1===this.oe&&f.fm)f.id===this.ae&&t===this.le||(this.rh[this.nh]='Use '+this.fe+' with @lre@'+c.name,this.Te[this.nh]=881,this.Oe[this.nh]=c.id,this.ve[this.nh]=t,this.be[this.nh]=f.id,this.nh++);else if(1===this.Ie&&f.fm)16&~this.Ee||(this.rh[this.nh]=this._e+' @lre@'+c.name,this.Te[this.nh]=391,this.Oe[this.nh]=c.id,this.ve[this.nh]=t,this.be[this.nh]=f.id,this.nh++);else{if(f.fm)for(let i=4;i>=3;i--)c.um&&c.um[i]?(this.rh[this.nh]=c.um[i]+' @lre@'+c.name,3===i?this.Te[this.nh]=478:4===i&&(this.Te[this.nh]=347),this.Oe[this.nh]=c.id,this.ve[this.nh]=t,this.be[this.nh]=f.id,this.nh++):4===i&&(this.rh[this.nh]='Drop @lre@'+c.name,this.Te[this.nh]=347,this.Oe[this.nh]=c.id,this.ve[this.nh]=t,this.be[this.nh]=f.id,this.nh++);if(f.dm&&(this.rh[this.nh]='Use @lre@'+c.name,this.Te[this.nh]=188,this.Oe[this.nh]=c.id,this.ve[this.nh]=t,this.be[this.nh]=f.id,this.nh++),f.fm&&c.um)for(let i=2;i>=0;i--)c.um[i]&&(this.rh[this.nh]=c.um[i]+' @lre@'+c.name,0===i?this.Te[this.nh]=405:1===i?this.Te[this.nh]=38:2===i&&(this.Te[this.nh]=422),this.Oe[this.nh]=c.id,this.ve[this.nh]=t,this.be[this.nh]=f.id,this.nh++);if(f.wm)for(let i=4;i>=0;i--)f.wm[i]&&(this.rh[this.nh]=f.wm[i]+' @lre@'+c.name,0===i?this.Te[this.nh]=602:1===i?this.Te[this.nh]=596:2===i?this.Te[this.nh]=22:3===i?this.Te[this.nh]=892:4===i&&(this.Te[this.nh]=415),this.Oe[this.nh]=c.id,this.ve[this.nh]=t,this.be[this.nh]=f.id,this.nh++);this.rh[this.nh]='Examine @lre@'+c.name,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+c.id+')'),this.Te[this.nh]=1773,this.Oe[this.nh]=c.id,f.Bl&&(this.be[this.nh]=f.Bl[t]),this.nh++}t++}}else if(i>=o&&s>=a&&i{let i=t.Ml;return i>=c.A.Oa&&i<=c.A.La?(i>=c.A.ba?i-=c.A.ba:i--,this.rh[this.nh]='Remove @whi@'+this.so[i],this.Te[this.nh]=557,this.nh++,this.rh[this.nh]='Message @whi@'+this.so[i],this.Te[this.nh]=679,this.nh++,!0):i>=c.A.Sa&&i<=c.A.Ma&&(this.rh[this.nh]='Remove @whi@'+t.text,this.Te[this.nh]=556,this.nh++,!0)};Cm=()=>{0===this.oe&&0===this.Ie&&(this.rh[this.nh]='Walk here',this.Te[this.nh]=660,this.ve[this.nh]=this.Yl,this.be[this.nh]=this.Vl,this.nh++);let t=-1;for(let i=0;i>7&127,o=s>>29&3,l=s>>14&32767;if(s!==t){if(t=s,2===o&&this.He&&this.He.kd(this.Dn,h,r,s)>=0){const t=e.A.get(l);if(1===this.oe)this.rh[this.nh]='Use '+this.fe+' with @cya@'+t.name,this.Te[this.nh]=450,this.Oe[this.nh]=s,this.ve[this.nh]=h,this.be[this.nh]=r,this.nh++;else if(1!==this.Ie){if(t.Om)for(let i=4;i>=0;i--)t.Om[i]&&(this.rh[this.nh]=t.Om[i]+' @cya@'+t.name,0===i&&(this.Te[this.nh]=285),1===i&&(this.Te[this.nh]=504),2===i&&(this.Te[this.nh]=364),3===i&&(this.Te[this.nh]=581),4===i&&(this.Te[this.nh]=1501),this.Oe[this.nh]=s,this.ve[this.nh]=h,this.be[this.nh]=r,this.nh++);this.rh[this.nh]='Examine @cya@'+t.name,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+t.id+')'),this.Te[this.nh]=1175,this.Oe[this.nh]=s,this.ve[this.nh]=h,this.be[this.nh]=r,this.nh++}else 4&~this.Ee||(this.rh[this.nh]=this._e+' @cya@'+t.name,this.Te[this.nh]=55,this.Oe[this.nh]=s,this.ve[this.nh]=h,this.be[this.nh]=r,this.nh++)}if(1===o){const t=this.yr[l];if(t&&t.type&&1===t.type.size&&64==(127&t.x)&&64==(127&t.z))for(let i=0;i=0;s--)t.Om&&t.Om[s]?(this.rh[this.nh]=t.Om[s]+' @lre@'+t.name,0===s&&(this.Te[this.nh]=224),1===s&&(this.Te[this.nh]=993),2===s&&(this.Te[this.nh]=99),3===s&&(this.Te[this.nh]=746),4===s&&(this.Te[this.nh]=877),this.Oe[this.nh]=i.index,this.ve[this.nh]=h,this.be[this.nh]=r,this.nh++):2===s&&(this.rh[this.nh]='Take @lre@'+t.name,this.Te[this.nh]=99,this.Oe[this.nh]=i.index,this.ve[this.nh]=h,this.be[this.nh]=r,this.nh++);this.rh[this.nh]='Examine @lre@'+t.name,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+i.index+')'),this.Te[this.nh]=1102,this.Oe[this.nh]=i.index,this.ve[this.nh]=h,this.be[this.nh]=r,this.nh++}else 1&~this.Ee||(this.rh[this.nh]=this._e+' @lre@'+t.name,this.Te[this.nh]=965,this.Oe[this.nh]=i.index,this.ve[this.nh]=h,this.be[this.nh]=r,this.nh++)}}}}};vm=(t,i,s,h)=>{if(this.nh>=400)return;let e=t.name;if(0!==t.Sm&&this.Sr&&(e=e+this.Mm(this.Sr.ic,t.Sm)+' (level-'+t.Sm+')'),1===this.oe)this.rh[this.nh]='Use '+this.fe+' with @yel@'+e,this.Te[this.nh]=900,this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++;else if(1!==this.Ie){let n;if(t.Om)for(n=4;n>=0;n--)t.Om[n]&&'attack'!==t.Om[n]?.toLowerCase()&&(this.rh[this.nh]=t.Om[n]+' @yel@'+e,0===n?this.Te[this.nh]=728:1===n?this.Te[this.nh]=542:2===n?this.Te[this.nh]=6:3===n?this.Te[this.nh]=963:4===n&&(this.Te[this.nh]=245),this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++);if(t.Om)for(n=4;n>=0;n--)if(t.Om[n]&&'attack'===t.Om[n]?.toLowerCase()){let r=0;this.Sr&&t.Sm>this.Sr.ic&&(r=2e3),this.rh[this.nh]=t.Om[n]+' @yel@'+e,0===n?this.Te[this.nh]=r+728:1===n?this.Te[this.nh]=r+542:2===n?this.Te[this.nh]=r+6:3===n?this.Te[this.nh]=r+963:4===n&&(this.Te[this.nh]=r+245),this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++}this.rh[this.nh]='Examine @yel@'+e,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+t.id+')'),this.Te[this.nh]=1607,this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++}else 2&~this.Ee||(this.rh[this.nh]=this._e+' @yel@'+e,this.Te[this.nh]=265,this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++)};bm=(t,i,s,h)=>{if(t===this.Sr||this.nh>=400)return;let e=null;this.Sr&&(e=t.name+this.Mm(this.Sr.ic,t.ic)+' (level-'+t.ic+')'),1===this.oe?(this.rh[this.nh]='Use '+this.fe+' with @whi@'+e,this.Te[this.nh]=367,this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++):1!==this.Ie?(this.rh[this.nh]='Follow @whi@'+e,this.Te[this.nh]=1544,this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++,0===this.Js&&(this.rh[this.nh]='Trade with @whi@'+e,this.Te[this.nh]=1373,this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++),this.Fr>0&&(this.rh[this.nh]='Attack @whi@'+e,this.Sr&&this.Sr.ic>=t.ic?this.Te[this.nh]=151:this.Te[this.nh]=2151,this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++),1===this.Ur&&(this.rh[this.nh]='Fight @whi@'+e,this.Te[this.nh]=151,this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++),2===this.Ur&&(this.rh[this.nh]='Duel-with @whi@'+e,this.Te[this.nh]=1101,this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++)):8&~this.Ee||(this.rh[this.nh]=this._e+' @whi@'+e,this.Te[this.nh]=651,this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++);for(let t=0;t{const s=t-i;return s<-9?'@red@':s<-6?'@or3@':s<-3?'@or2@':s<0?'@or1@':s>9?'@gre@':s>6?'@gr3@':s>3?'@gr2@':s>0?'@gr1@':'@yel@'};yf=()=>{if(0===this.se){this.rh[0]='Cancel',this.Te[0]=1252,this.nh=1,this.om(this.Vl),this.Se=0,this.Yl>8&&this.Vl>11&&this.Yl<520&&this.Vl<345&&(-1===this.Xs?this.Cm():this.lm(c.A.Do[this.Xs],this.Yl,this.Vl,8,11,0)),this.Se!==this.$h&&(this.$h=this.Se),this.Se=0,this.Yl>562&&this.Vl>231&&this.Yl<752&&this.Vl<492&&(-1!==this.oh?this.lm(c.A.Do[this.oh],this.Yl,this.Vl,562,231,0):-1!==this.Mh[this.Sh]&&this.lm(c.A.Do[this.Mh[this.Sh]],this.Yl,this.Vl,562,231,0)),this.Se!==this.Jh&&(this.Ws=!0,this.Jh=this.Se),this.Se=0,this.Yl>22&&this.Vl>375&&this.Yl<431&&this.Vl<471&&(-1===this.lh?this.rm(this.Yl-22,this.Vl-375):this.lm(c.A.Do[this.lh],this.Yl,this.Vl,22,375,0)),-1!==this.lh&&this.Se!==this.Qh&&(this.Ys=!0,this.Qh=this.Se);let t=!1;for(;!t;){t=!0;for(let i=0;i1e3){const s=this.rh[i];this.rh[i]=this.rh[i+1],this.rh[i+1]=s;const h=this.Te[i];this.Te[i]=this.Te[i+1],this.Te[i+1]=h;const e=this.ve[i];this.ve[i]=this.ve[i+1],this.ve[i+1]=e;const n=this.be[i];this.be[i]=this.be[i+1],this.be[i+1]=n;const r=this.Oe[i];this.Oe[i]=this.Oe[i+1],this.Oe[i+1]=r,t=!1}}}};mf=()=>{let t=0;if(this.yi){let i;t=this.yi.Iu('Choose Option');for(let s=0;st&&(t=i)}t+=8;const i=15*this.nh+21;let s,h;this.Bc>8&&this.Gc>11&&this.Bc<520&&this.Gc<345&&(s=this.Bc-(t/2|0)-8,s+t>512?s=512-t:s<0&&(s=0),h=this.Gc-11,h+i>334?h=334-i:h<0&&(h=0),this.Qs=!0,this.th=0,this.ih=s,this.sh=h,this.hh=t,this.eh=15*this.nh+22),this.Bc>562&&this.Gc>231&&this.Bc<752&&this.Gc<492&&(s=this.Bc-(t/2|0)-562,s<0?s=0:s+t>190&&(s=190-t),h=this.Gc-231,h<0?h=0:h+i>261&&(h=261-i),this.Qs=!0,this.th=1,this.ih=s,this.sh=h,this.hh=t,this.eh=15*this.nh+22),this.Bc>22&&this.Gc>375&&this.Bc<501&&this.Gc<471&&(s=this.Bc-(t/2|0)-22,s<0?s=0:s+t>479&&(s=479-t),h=this.Gc-375,h<0?h=0:h+i>96&&(h=96-i),this.Qs=!0,this.th=2,this.ih=s,this.sh=h,this.hh=t,this.eh=15*this.nh+22)};Cf=(t,i,s,h,e,n,r,o,l,a,c)=>{const f=this.kn[this.Dn];if(!f)return!1;const u=G.A.Xn,d=G.A.Xn;for(let t=0;t0&&0===this.br[i]&&(E[i]&H.A.bd)===H.A.OPEN&&(this.Or[p]=w-1,this.vr[p]=y,p=(p+1)%g,this.br[i]=2,this.Lr[i]=t),i=G.A.index(w+1,y),w0&&0===this.br[i]&&(E[i]&H.A.Rd)===H.A.OPEN&&(this.Or[p]=w,this.vr[p]=y-1,p=(p+1)%g,this.br[i]=1,this.Lr[i]=t),i=G.A.index(w,y+1),y0&&y>0&&0===this.br[i]&&!(E[i]&H.A.Pm)&&(E[G.A.index(w-1,y)]&H.A.bd)===H.A.OPEN&&(E[G.A.index(w,y-1)]&H.A.Rd)===H.A.OPEN&&(this.Or[p]=w-1,this.vr[p]=y-1,p=(p+1)%g,this.br[i]=3,this.Lr[i]=t),i=G.A.index(w+1,y-1),w0&&0===this.br[i]&&!(E[i]&H.A.Fm)&&(E[G.A.index(w+1,y)]&H.A.Ld)===H.A.OPEN&&(E[G.A.index(w,y-1)]&H.A.Rd)===H.A.OPEN&&(this.Or[p]=w+1,this.vr[p]=y-1,p=(p+1)%g,this.br[i]=9,this.Lr[i]=t),i=G.A.index(w-1,y+1),w>0&&y=0&&s>=0&&e0){g=Math.min(m,25),m--;const t=this.Or[m],i=this.vr[m];if($.K.nt&&1===this.uf[6]&&1===this.uf[7]){for(let t=0;t{this.cr=0,this.ar=0,this.Ym(t),this.Vm(t),this.Km(t,i),this.Xm(t);for(let t=0;t{t.jm();if(0!==t.zm(1)){const i=t.zm(2);if(0===i)this.ur[this.ar++]=this.Mt;else if(1===i){const i=t.zm(3);this.Sr?.step(!1,i);1===t.zm(1)&&(this.ur[this.ar++]=this.Mt)}else if(2===i){const i=t.zm(3);this.Sr?.step(!0,i);const s=t.zm(3);this.Sr?.step(!0,s);1===t.zm(1)&&(this.ur[this.ar++]=this.Mt)}else if(3===i){this.Dn=t.zm(2);const i=t.zm(7),s=t.zm(7),h=t.zm(1);this.Sr?.move(1===h,i,s);1===t.zm(1)&&(this.ur[this.ar++]=this.Mt)}}};Vm=t=>{const i=t.zm(8);if(ithis.rr)throw new Error(`eek! ${this.username} Too many players`);this.rr=0;for(let s=0;s{let s;for(;t.Zm+10<8*i&&(s=t.zm(11),2047!==s);){if(!this.nr[s]){this.nr[s]=new W.A;const t=this.wr[s];t&&this.nr[s]?.read(t)}this.lr[this.rr++]=s;const i=this.nr[s];i&&(i.tu=this.Pt);let h=t.zm(5);h>15&&(h-=32);let e=t.zm(5);e>15&&(e-=32);const n=t.zm(1);this.Sr&&i?.move(1===n,this.Sr.Tf[0]+h,this.Sr.Of[0]+e);1===t.zm(1)&&(this.ur[this.ar++]=s)}t.qm()};Xm=t=>{for(let i=0;i{if(t.Mu=s,t.ku=this.Pt,(s&W.A.xu)===W.A.xu){const s=e.cA,h=new Uint8Array(s),n=new I.A(h);e.YA(s,0,h),this.wr[i]=n,t.read(n)}if((s&W.A.Du)===W.A.Du){let i=e.rA;65535===i&&(i=-1),i===t.Nu&&(t.Qm=0);const s=e.cA;(-1===i||-1===t.Nu||h.A.Do[i].priority>h.A.Do[t.Nu].priority||0===h.A.Do[t.Nu].priority)&&(t.Nu=i,t.tI=0,t.iI=0,t.sI=s,t.Qm=0)}if((s&W.A.Pu)===W.A.Pu&&(t.Fu=e.rA,65535===t.Fu&&(t.Fu=-1)),(s&W.A.Uu)===W.A.Uu&&(t.pu=e._A,t.gu=0,t.Eu=0,t._u=150,t.name&&this.zd(2,t.pu,t.name)),(s&W.A.Bu)===W.A.Bu&&(t.bu=e.cA,t.vu=e.cA,t.Cu=this.Pt+400,t.Tu=e.cA,t.Ou=e.cA),(s&W.A.Gu)===W.A.Gu&&(t.hI=e.rA,t.eI=e.rA,t.Hu=t.hI,t.Wu=t.eI),(s&W.A.Yu)===W.A.Yu){const i=e.rA,s=e.cA,h=e.cA,n=e.jc;if(t.name){const n=M.A.Id(t.name);let r=!1;if(s<=1)for(let t=0;t>8,t.Eu=255&i,t._u=150,s>1?this.zd(1,r,t.name):this.zd(2,r,t.name)}catch(t){}}e.jc=n+h}if((s&W.A.Vu)===W.A.Vu){t.Ku=e.rA;const i=e.il;t.nI=i>>16,t.rI=this.Pt+(65535&i),t.oI=0,t.lI=0,t.rI>this.Pt&&(t.oI=-1),65535===t.Ku&&(t.Ku=-1)}(s&W.A.Xu)===W.A.Xu&&(t.aI=e.cA,t.cI=e.cA,t.fI=e.cA,t.uI=e.cA,t.Lu=e.rA+this.Pt,t.Ru=e.rA+this.Pt,t.dI=e.cA,t.pathLength=0,t.Tf[0]=t.fI,t.Of[0]=t.uI)};wA=(t,i)=>{this.cr=0,this.ar=0,this.wI(t),this.yI(t,i),this.AI(t);for(let t=0;t{t.jm();const i=t.zm(8);if(ithis.Ar)throw new Error(`eek! ${this.username} Too many npcs`);this.Ar=0;for(let s=0;s{for(;t.Zm+21<8*i;){const i=t.zm(13);if(8191===i)break;this.yr[i]||(this.yr[i]=new Y.A);const s=this.yr[i];this.pr[this.Ar++]=i,s?(s.tu=this.Pt,s.type=r.A.get(t.zm(11)),s.size=s.type.size,s.pI=s.type.mI,s.II=s.type.gI,s.EI=s.type._I,s.CI=s.type.TI,s.Ga=s.type.OI):t.zm(11);let h=t.zm(5);h>15&&(h-=32);let e=t.zm(5);e>15&&(e-=32),this.Sr&&s?.move(!1,this.Sr.Tf[0]+h,this.Sr.Of[0]+e);1===t.zm(1)&&(this.ur[this.ar++]=i)}t.qm()};AI=t=>{for(let i=0;ih.A.Do[e.Nu].priority||0===h.A.Do[e.Nu].priority)&&(e.Nu=i,e.tI=0,e.iI=0,e.sI=s,e.Qm=0)}if((n&Y.A.Pu)===Y.A.Pu&&(e.Fu=t.rA,65535===e.Fu&&(e.Fu=-1)),(n&Y.A.Uu)===Y.A.Uu&&(e.pu=t._A,e._u=100),(n&Y.A.Bu)===Y.A.Bu&&(e.bu=t.cA,e.vu=t.cA,e.Cu=this.Pt+400,e.Tu=t.cA,e.Ou=t.cA),(n&Y.A.ju)===Y.A.ju&&(e.type=r.A.get(t.rA),e.pI=e.type.mI,e.II=e.type.gI,e.EI=e.type._I,e.CI=e.type.TI,e.Ga=e.type.OI),(n&Y.A.Vu)===Y.A.Vu){e.Ku=t.rA;const i=t.il;e.nI=i>>16,e.rI=this.Pt+(65535&i),e.oI=0,e.lI=0,e.rI>this.Pt&&(e.oI=-1),65535===e.Ku&&(e.Ku=-1)}(n&Y.A.Gu)===Y.A.Gu&&(e.hI=t.rA,e.eI=t.rA,e.Hu=e.hI,e.Wu=e.eI)}};lf=()=>{for(let t=-1;t1406){$.K.At=0,this.Bt.ef(O.A.bI),this.Bt.p1(0);const t=this.Bt.jc;this.Bt.p1(162),this.Bt.p1(22),2*Math.random()|0||this.Bt.p1(84),this.Bt.p2(31824),this.Bt.p2(13490),2*Math.random()|0||this.Bt.p1(123),2*Math.random()|0||this.Bt.p1(134),this.Bt.p1(100),this.Bt.p1(94),this.Bt.p2(35521),this.Bt.$f(this.Bt.jc-t)}};vI=t=>{(t.x<128||t.z<128||t.x>=13184||t.z>=13184)&&(t.Nu=-1,t.Ku=-1,t.Lu=0,t.Ru=0,t.x=128*t.Tf[0]+64*t.size,t.z=128*t.Of[0]+64*t.size,t.pathLength=0),t===this.Sr&&(t.x<1536||t.z<1536||t.x>=11776||t.z>=11776)&&(t.Nu=-1,t.Ku=-1,t.Lu=0,t.Ru=0,t.x=128*t.Tf[0]+64*t.size,t.z=128*t.Of[0]+64*t.size,t.pathLength=0),t.Lu>this.Pt?this.LI(t):t.Ru>=this.Pt?this.RI(t):this.SI(t),this.MI(t),this.kI(t)};Yf=()=>{if(this.Sr){this.Sr.x>>7===this.Ke&&this.Sr.z>>7===this.Xe&&(this.Ke=0);for(let t=-1;t50||this.rr>200)&&-1!==t&&i.xI===i.Ga;const h=i.x>>7,e=i.z>>7;if(!(h<0||h>=G.A.Xn||e<0||e>=G.A.Xn))if(!i.DI||this.Pt=i.FI){if(64==(127&i.x)&&64==(127&i.z)){if(this.Vn[h][e]===this.Ve)continue;this.Vn[h][e]=this.Ve}i.y=this.Zf(this.Dn,i.x,i.z),this.He?.UI(this.Dn,i.x,i.y,i.z,null,i,s,i.BI,60,i.GI)}else i.st=!1,i.y=this.Zf(this.Dn,i.x,i.z),this.He?.HI(this.Dn,i.x,i.y,i.z,i.WI,i.YI,i.VI,i.KI,null,i,s,i.BI)}}};af=()=>{for(let t=0;t{for(let t=0;t>7,e=i.z>>7;if(!(h<0||h>=G.A.Xn||e<0||e>=G.A.Xn)){if(1===i.size&&64==(127&i.x)&&64==(127&i.z)){if(this.Vn[h][e]===this.Ve)continue;this.Vn[h][e]=this.Ve}this.He?.UI(this.Dn,i.x,this.Zf(this.Dn,i.x,i.z),i.z,null,i,s,i.BI,64*(i.size-1)+60,i.GI)}}};Kf=()=>{for(let t=this.mr.head();t;t=this.mr.next())if(t.level!==this.Dn||this.Pt>t.XI)t.pA();else if(this.Pt>=t.jI){if(t.target>0){const i=this.yr[t.target-1];i&&t.zI(i.x,this.Zf(t.level,i.x,i.z)-t.offsetY,i.z,this.Pt)}if(t.target<0){const i=-t.target-1;let s;s=i===this.Dr?this.Sr:this.nr[i],s&&t.zI(s.x,this.Zf(t.level,s.x,s.z)-t.offsetY,s.z,this.Pt)}t.update(this.Ye),this.He?.UI(this.Dn,0|t.x,0|t.y,0|t.z,null,t,-1,t.BI,60,!1)}};Xf=()=>{for(let t=this.Ir.head();t;t=this.Ir.next())t.level!==this.Dn||t.ZI?t.pA():this.Pt>=t.jI&&(t.update(this.Ye),t.ZI?t.pA():this.He?.UI(t.level,t.x,t.y,t.z,null,t,-1,0,60,!1))};jf=()=>{for(let t=this.gr.head();t;t=this.gr.next()){let i=!1;if(t.El+=this.Ye,-1===t._l&&(t._l=0,i=!0),t.qI.delay)for(;t.El>t.qI.delay[t._l];)if(t.El-=t.qI.delay[t._l]+1,t._l++,i=!0,t._l>=t.qI.Cl&&(t._l-=t.qI.Tl,t._l<0||t._l>=t.qI.Cl)){t.pA(),i=!1;break}if(i&&this.He){const i=t.tm,s=t.Jp,h=t.Qp;let n=0;if(0===t.$I?n=this.He.Md(i,s,h):1===t.$I?n=this.He.jy(i,h,s):2===t.$I?n=this.He.Hd(i,s,h):3===t.$I&&(n=this.He.Od(i,s,h)),this.Wn&&0!==n&&(n>>14&32767)===t.index){const r=this.Wn[i][s][h],o=this.Wn[i][s+1][h],l=this.Wn[i][s+1][h+1],a=this.Wn[i][s][h+1],c=e.A.get(t.index);let f=-1;if(-1!==t._l&&t.qI.frames&&(f=t.qI.frames[t._l]),2===t.$I){const t=this.He.kd(i,s,h,n);let e=31&t;const u=t>>6;e===P.A._y.id&&(e=P.A.Ey.id),this.He?.JI(i,s,h,c.ma(e,u,r,o,l,a,f))}else if(1===t.$I)this.He?.QI(i,s,h,c.ma(P.A.tg.id,0,r,o,l,a,f));else if(0===t.$I){const t=this.He.kd(i,s,h,n),e=31&t,u=t>>6;if(e===P.A.Nd.id){const t=u+1&3;this.He?.ig(s,h,i,c.ma(P.A.Nd.id,u+4,r,o,l,a,f),c.ma(P.A.Nd.id,t,r,o,l,a,f))}else this.He?.sg(i,s,h,c.ma(e,u,r,o,l,a,f))}else if(3===t.$I){const t=this.He.kd(i,s,h,n)>>6;this.He?.hg(i,s,h,c.ma(P.A.Cy.id,t,r,o,l,a,f))}}else t.pA()}}};cf=()=>{for(let t=-1;t0&&(s._u--,0===s._u&&(s.pu=null))}for(let t=0;t0&&(s._u--,0===s._u&&(s.pu=null))}};ff=()=>{if(2===this.We){for(let t=this.Er.head();t;t=this.Er.next())this.Pt>=t.XI&&(this.Vy(t.dp,t.x,t.z,t.im,t.angle,t.shape,t.Kd),t.pA());$.K.yt++,$.K.yt>85&&($.K.yt=0,this.Bt.ef(O.A.eg))}};LI=t=>{const i=t.Lu-this.Pt,s=128*t.aI+64*t.size,h=128*t.cI+64*t.size;t.x+=(s-t.x)/i|0,t.z+=(h-t.z)/i|0,t.ng=0,0===t.dI&&(t.rg=1024),1===t.dI&&(t.rg=1536),2===t.dI&&(t.rg=0),3===t.dI&&(t.rg=512)};RI=t=>{if(t.Ru===this.Pt||-1===t.Nu||0!==t.sI||t.iI+1>h.A.Do[t.Nu].delay[t.tI]){const i=t.Ru-t.Lu,s=this.Pt-t.Lu,h=128*t.aI+64*t.size,e=128*t.cI+64*t.size,n=128*t.fI+64*t.size,r=128*t.uI+64*t.size;t.x=(h*(i-s)+n*s)/i|0,t.z=(e*(i-s)+r*s)/i|0}t.ng=0,0===t.dI&&(t.rg=1024),1===t.dI&&(t.rg=1536),2===t.dI&&(t.rg=0),3===t.dI&&(t.rg=512),t.BI=t.rg};MI=t=>{if(-1!==t.Fu&&t.Fu<32768){const i=this.yr[t.Fu];if(i){const s=t.x-i.x,h=t.z-i.z;0===s&&0===h||(t.rg=325.949*Math.atan2(s,h)&2047)}}if(t.Fu>=32768){let i=t.Fu-32768;i===this.Dr&&(i=this.Mt);const s=this.nr[i];if(s){const i=t.x-s.x,h=t.z-s.z;0===i&&0===h||(t.rg=325.949*Math.atan2(i,h)&2047)}}if((0!==t.hI||0!==t.eI)&&(0===t.pathLength||t.ng>0)){const i=t.x-64*(t.hI-this.Tn-this.Tn),s=t.z-64*(t.eI-this.On-this.On);0===i&&0===s||(t.rg=325.949*Math.atan2(i,s)&2047),t.hI=0,t.eI=0}const i=t.rg-t.BI&2047;if(0!==i&&(i<32||i>2016?t.BI=t.rg:i>1024?t.BI-=32:t.BI+=32,t.BI&=2047,t.xI===t.Ga&&t.BI!==t.rg)){if(-1!==t.og)return void(t.xI=t.og);t.xI=t.pI}};kI=t=>{let i;if(t.GI=!1,-1!==t.xI&&(i=h.A.Do[t.xI],t.lg++,i.delay&&t.agi.delay[t.ag]&&(t.lg=0,t.ag++),t.ag>=i.Cl&&(t.lg=0,t.ag=0)),-1!==t.Nu&&0===t.sI){for(i=h.A.Do[t.Nu],t.iI++;i.delay&&t.tIi.delay[t.tI];)t.iI-=i.delay[t.tI],t.tI++;t.tI>=i.Cl&&(t.tI-=i.Tl,t.Qm++,t.Qm>=i.cg&&(t.Nu=-1),(t.tI<0||t.tI>=i.Cl)&&(t.Nu=-1)),t.GI=i.fg}if(t.sI>0&&t.sI--,-1!==t.Ku&&this.Pt>=t.rI){for(t.oI<0&&(t.oI=0),i=l.A.Do[t.Ku].qI,t.lI++;i&&i.delay&&t.oIi.delay[t.oI];)t.lI-=i.delay[t.oI],t.oI++;i&&t.oI>=i.Cl&&(t.oI<0||t.oI>=i.Cl)&&(t.Ku=-1)}};SI=t=>{if(t.xI=t.Ga,0===t.pathLength)return void(t.ng=0);if(-1!==t.Nu&&0===t.sI){if(!h.A.Do[t.Nu].ug)return void t.ng++}const i=t.x,s=t.z,e=128*t.Tf[t.pathLength-1]+64*t.size,n=128*t.Of[t.pathLength-1]+64*t.size;if(e-i<=256&&e-i>=-256&&n-s<=256&&n-s>=-256){t.rg=in?1792:1536:i>e?sn?256:512:s1024&&(h-=2048);let r=t.II;h>=-256&&h<=256?r=t.pI:h>=256&&h<768?r=t.CI:h>=-768&&h<=-256&&(r=t.EI),-1===r&&(r=t.pI),t.xI=r;let o=4;t.BI!==t.rg&&-1===t.Fu&&(o=2),t.pathLength>2&&(o=6),t.pathLength>3&&(o=8),t.ng>0&&t.pathLength>1&&(o=8,t.ng--),t.dg[t.pathLength-1]&&(o<<=1),o>=8&&t.xI===t.pI&&-1!==t.wg&&(t.xI=t.wg),ie&&(t.x=e)):i>e&&(t.x-=o,t.xn&&(t.z=n)):s>n&&(t.z-=o,t.z{let t=3;if(this.fn<310&&this.Sr){let i=this.ln>>7,s=this.cn>>7;const h=this.Sr.x>>7,e=this.Sr.z>>7;let n,r,o,l;if(this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn),n=h>i?h-i:i-h,r=e>s?e-s:s-e,n>r)for(o=65536*r/n|0,l=32768;i!==h;)ih&&i--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn),l+=o,l>=65536&&(l-=65536,se&&s--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn));else for(o=65536*n/r|0,l=32768;s!==e;)se&&s--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn),l+=o,l>=65536&&(l-=65536,ih&&i--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn))}return this.Sr&&this.Yn&&4&this.Yn[this.Dn][this.Sr.x>>7][this.Sr.z>>7]&&(t=this.Dn),t};Jf=()=>{if(!this.Yn)return 0;return this.Zf(this.Dn,this.ln,this.cn)-this.an>=800||!(4&this.Yn[this.Dn][this.ln>>7][this.cn>>7])?3:this.Dn};Zf=(t,i,s)=>{if(!this.Wn)return 0;const h=Math.min(i>>7,G.A.Xn-1),e=Math.min(s>>7,G.A.Xn-1);let n=t;t<3&&this.Yn&&!(2&~this.Yn[1][h][e])&&(n=t+1);const r=127&i,o=127&s;return(this.Wn[n][h][e]*(128-r)+this.Wn[n][h+1][e]*r>>7)*(128-o)+(this.Wn[n][h][e+1]*(128-r)+this.Wn[n][h+1][e+1]*r>>7)*o>>7};zf=(t,i,s,h,e,n)=>{const r=2048-e&2047,o=2048-h&2047;let l,a,c,f=0,u=0,w=n;0!==r&&(l=d.A.sin[r],a=d.A.cos[r],c=u*a-n*l>>16,w=u*l+n*a>>16,u=c),0!==o&&(l=d.A.sin[o],a=d.A.cos[o],c=w*l+f*a>>16,w=w*a-f*l>>16,f=c),this.ln=t-f,this.an=i-u,this.cn=s-w,this.fn=e,this.un=h};Mf=()=>{if(!this.Sr)return;const t=this.Sr.x+this.Ze,i=this.Sr.z+this.qe;(this.Gn-t<-500||this.Gn-t>500||this.Hn-i<-500||this.Hn-i>500)&&(this.Gn=t,this.Hn=i),this.Gn!==t&&(this.Gn+=(t-this.Gn)/16|0),this.Hn!==i&&(this.Hn+=(i-this.Hn)/16|0),1===this.uf[1]?this.Un+=(-this.Un-24)/2|0:1===this.uf[2]?this.Un+=(24-this.Un)/2|0:this.Un=this.Un/2|0,1===this.uf[3]?this.Bn+=(12-this.Bn)/2|0:1===this.uf[4]?this.Bn+=(-this.Bn-12)/2|0:this.Bn=this.Bn/2|0,this.Fn=this.Fn+this.Un/2&2047,this.Pn+=this.Bn/2|0,this.Pn<128&&(this.Pn=128),this.Pn>383&&(this.Pn=383);const s=this.Gn>>7,h=this.Hn>>7,e=this.Zf(this.Dn,this.Gn,this.Hn);let n=0;if(this.Wn&&s>3&&h>3&&s<100&&h<100)for(let t=s-4;t<=s+4;t++)for(let i=h-4;i<=h+4;i++){let s=this.Dn;s<3&&this.Yn&&!(2&~this.Yn[1][t][i])&&s++;const h=e-this.Wn[s][t][i];h>n&&(n=h)}let r=192*n;r>98048&&(r=98048),r<32768&&(r=32768),r>this.dn?this.dn+=(r-this.dn)/24|0:r{let t=128*this.tr+64,i=128*this.ir+64,s=this.Zf(this.Dn,this.tr,this.ir)-this.sr;this.lnt&&(this.ln=t)),this.ln>t&&(this.ln-=this.hr+((this.ln-t)*this.er/1e3|0),this.lns&&(this.an=s)),this.an>s&&(this.an-=this.hr+((this.an-s)*this.er/1e3|0),this.ani&&(this.cn=i)),this.cn>i&&(this.cn-=this.hr+((this.cn-i)*this.er/1e3|0),this.cn383&&(o=383),this.fno&&(this.fn=o)),this.fn>o&&(this.fn-=this.Jn+((this.fn-o)*this.Qn/1e3|0),this.fn1024&&(a-=2048),a<-1024&&(a+=2048),a>0&&(this.un+=this.Jn+(a*this.Qn/1e3|0),this.un&=2047),a<0&&(this.un-=this.Jn+(-a*this.Qn/1e3|0),this.un&=2047);let c=l-this.un;c>1024&&(c-=2048),c<-1024&&(c+=2048),(c<0&&a>0||c>0&&a<0)&&(this.un=l)};FA=(t,i)=>{const s=t.cA;let n=this.gn+(s>>4&7),r=this.En+(7&s);if(i===T.A.PA||i===T.A.NA){const s=t.cA,h=s>>2,e=3&s,o=P.A.of(h).Kd;let l;if(l=i===T.A.NA?-1:t.rA,n>=0&&r>=0&&n>14&32767,h=31&t,e=t>>6}t=new U.A(this.Dn,o,n,r,0,F.A.Pd,P.A.Dd.id,s,e,h),this.Tr.yg(t)}t&&(t.im=l,t.shape=h,t.angle=e),this.Vy(this.Dn,n,r,l,e,h,o)}}else if(i===T.A.DA){const i=t.cA>>2,s=P.A.of(i).Kd,e=t.rA;if(n>=0&&r>=0&&n>14&32767,this.Dn,s,n,r,h.A.Do[e],!1);this.gr.yg(i)}}}else if(i===T.A.xA){const i=t.rA,s=t.rA;if(n>=0&&r>=0&&n=0&&r>=0&&n=0&&r>=0&&n=0&&s>=0&&i=0&&r>=0&&n=0&&r>=0&&n>2,h=3&i,o=P.A.of(s).Kd,l=t.rA,a=t.rA,c=t.rA,f=t.rA;let u,d=t.lA,w=t.lA,y=t.lA,A=t.lA;if(u=f===this.Dr?this.Sr:this.nr[f],u&&this.Wn){const t=new B.A(this.Dn,o,n,r,-1,h,s,a+this.Pt);this.Er.yg(t);const i=new B.A(this.Dn,o,n,r,l,h,s,c+this.Pt);this.Er.yg(i);const f=this.Wn[this.Dn][n][r],p=this.Wn[this.Dn][n+1][r],m=this.Wn[this.Dn][n+1][r+1],I=this.Wn[this.Dn][n][r+1],g=e.A.get(l);u.NI=a+this.Pt,u.FI=c+this.Pt,u.DI=g.ma(s,h,f,p,m,I,-1);let E,_=g.width,C=g.length;h!==F.A.Fd&&h!==F.A.Bd||(_=g.length,C=g.width),u.Ag=128*n+64*_,u.pg=128*r+64*C,u.mg=this.Zf(this.Dn,u.Ag,u.pg),d>y&&(E=d,d=y,y=E),w>A&&(E=w,w=A,A=E),u.WI=n+d,u.VI=n+y,u.YI=r+w,u.KI=r+A}}else if(i===T.A.bA){const i=t.rA,s=t.rA,h=t.rA;if(n>=0&&r>=0&&n{if(!$.K.st){if(d.A.Ig[17]>=t){const t=d.A.gg[17];if(!t)return;const i=t.width*t.height-1,s=t.width*this.Ye*2,h=t.yc,e=this.Mn;for(let t=0;t<=i;t++)e[t]=h[t-s&i];t.yc=e,this.Mn=h,d.A.Eg(17)}if(d.A.Ig[24]>=t){const t=d.A.gg[24];if(!t)return;const i=t.width*t.height-1,s=t.width*this.Ye*2,h=t.yc,e=this.Mn;for(let t=0;t<=i;t++)e[t]=h[t-s&i];t.yc=e,this.Mn=h,d.A.Eg(24)}}};Rc=()=>{if(!(this.Ci&&this.Ti&&this._i&&this.Ri))return;for(let t=10;t<117;t++){(100*Math.random()|0)<50&&(this.Ci[t+32512]=255)}for(let t=0;t<100;t++){const t=2+(124*Math.random()|0)+(128+(128*Math.random()|0)<<7);this.Ci[t]=192}for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);this.Ti[s]=(this.Ci[s-1]+this.Ci[s+1]+this.Ci[s-128]+this.Ci[s+128])/4|0}this.Si+=128,this.Si>this._i.length&&(this.Si-=this._i.length,this.kc(this.pi[12*Math.random()|0]));for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);let h=this.Ti[s+128]-(this._i[s+this.Si&this._i.length-1]/5|0);h<0&&(h=0),this.Ci[s]=h}for(let t=0;t<255;t++)this.Ri[t]=this.Ri[t+1];if(this.Ri[255]=16*Math.sin(this.Pt/14)+14*Math.sin(this.Pt/15)+12*Math.sin(this.Pt/16)|0,this.Mi>0&&(this.Mi-=4),this.ki>0&&(this.ki-=4),0===this.Mi&&0===this.ki){const t=2e3*Math.random()|0;0===t?this.Mi=1024:1===t&&(this.ki=1024)}};_g=(t,i,s)=>{const h=256-i;return((16711935&t)*h+(16711935&s)*i&4278255360)+((65280&t)*h+(65280&s)*i&16711680)>>8};Sc=()=>{if(!(this.Oi&&this.vi&&this.bi&&this.Li&&this.Ri&&this.Ci))return;const t=256;if(this.Mi>0)for(let t=0;t<256;t++)this.Mi>768?this.Oi[t]=this._g(this.vi[t],1024-this.Mi,this.bi[t]):this.Mi>256?this.Oi[t]=this.bi[t]:this.Oi[t]=this._g(this.bi[t],256-this.Mi,this.vi[t]);else if(this.ki>0)for(let t=0;t<256;t++)this.ki>768?this.Oi[t]=this._g(this.vi[t],1024-this.ki,this.Li[t]):this.ki>256?this.Oi[t]=this.Li[t]:this.Oi[t]=this._g(this.Li[t],256-this.ki,this.vi[t]);else for(let t=0;t<256;t++)this.Oi[t]=this.vi[t];for(let t=0;t<33920;t++)this.hi&&this.Ii&&(this.hi.yc[t]=this.Ii.yc[t]);let i=0,s=1152;for(let h=1;h<255;h++){let e=(this.Ri[h]*(t-h)/t|0)+22;e<0&&(e=0),i+=e;for(let t=e;t<128;t++){let t=this.Ci[i++];if(0===t)s++;else{const i=t,h=256-t;if(t=this.Oi[t],this.hi){const e=this.hi.yc[s];this.hi.yc[s++]=((16711935&t)*i+(16711935&e)*h&4278255360)+((65280&t)*i+(65280&e)*h&16711680)>>8}}}s+=e}this.hi?.draw(0,0);for(let t=0;t<33920;t++)this.ei&&this.gi&&(this.ei.yc[t]=this.gi.yc[t]);i=0,s=1176;for(let h=1;h<255;h++){const e=this.Ri[h]*(t-h)/t|0,n=103-e;s+=e;for(let t=0;t>8}}}i+=128-n,s+=128-n-e}this.ei?.draw(661,0)}}console.log(`RS2 user client - release #${$.K.tt}`),await(0,it.w)(),(new t).run().then((()=>{})),i()}catch(t){i(t)}}),1)},7046:(t,i,s)=>{s.d(i,{A:()=>a});var h=s(1183),e=s(4583),n=s(9234),r=s(9091),o=s(2595),l=s(7854);class a{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const s=new URL(window.location.toString());s.searchParams.set(t,i),window.history.pushState(null,'',s.toString())}sd=0;Cg=[];Tg=0;Po=null;state=0;Qu=20;Og=1;vg=[];Ju=0;bg=0;Lg=[];Rg=!0;Sg=!1;Mg=50;hasFocus=!0;gc=!1;Qc=0;wf=0;Yl=0;Vl=0;Uc=0;Bc=0;Gc=0;uf=[];kg=[];xg=0;Dg=0;input=null;Ng=!1;Pg=!1;Fg=!1;time=-1;Ug=0;Bg=0;Gg=0;Hg=0;Wg=0;Yg=0;constructor(t=!1){l.Vg.tabIndex=-1,l.el.fillStyle='black',l.el.fillRect(0,0,l.Vg.width,l.Vg.height),this.Sg=t,this.Sg?this.resize(window.innerWidth,window.innerHeight):this.resize(l.Vg.width,l.Vg.height)}get width(){return l.Vg.width}get height(){return l.Vg.height}resize=(t,i)=>{l.Vg.width=t,l.Vg.height=i,this.Po=new h.A(t,i),e.A.Kg()};run=async()=>{l.Vg.addEventListener('resize',(()=>{this.Sg&&this.resize(window.innerWidth,window.innerHeight)}),!1),l.Vg.onmousedown=this.onmousedown,l.Vg.onmouseup=this.onmouseup,l.Vg.onmouseenter=this.onmouseenter,l.Vg.onmouseleave=this.onmouseleave,l.Vg.onmousemove=this.onmousemove,window.onbeforeunload=this.Ro,l.Vg.onfocus=this.onfocus,l.Vg.onblur=this.onblur,this.Xg?(l.Vg.ontouchstart=this.ontouchstart,l.Vg.ontouchend=this.ontouchend,l.Vg.ontouchmove=this.ontouchmove):(l.Vg.onkeydown=this.onkeydown,l.Vg.onkeyup=this.onkeyup),l.Vg.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Xg&&'low'===a.getParameter('detail')&&(this.Mg=30),await this.qo(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.vg[t]=performance.now();let t,i=0,s=256,h=1,e=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.jg();const r=s,o=h;s=300,h=1,t=performance.now();const l=this.vg[i];if(0===l?(s=r,h=o):t>l&&(s=2560*this.Qu/(t-l)|0),s<25?s=25:s>256&&(s=256,h=this.Qu-(t-l)/10|0),this.vg[i]=t,i=(i+1)%10,h>1)for(let t=0;t<10;t++)0!==this.vg[t]&&(this.vg[t]+=h);for(h0&&(this.Ju=1e3*s/(256*this.Qu)|0);const a=performance.now();if(this.Rg&&this.refresh(),await this.draw(),this.Lg[this.bg]=(performance.now()-a)/1e3,this.bg=(this.bg+1)%this.Lg.length,this.Mg<50){const i=1e3/this.Mg-(performance.now()-t);i>0&&await(0,n.Jo)(i)}}-1===this.state&&this.jg()};jg=()=>{this.state=-2,this.Ro()};nl=t=>{this.Qu=1e3/t|0};My=t=>{this.Mg=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.Qu|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};Ro=()=>{};draw=async()=>{};refresh=()=>{};async qo(t,i){const s=this.width,h=this.height;this.Rg&&(l.el.fillStyle='black',l.el.fillRect(0,0,s,h),this.Rg=!1);const e=h/2-18;l.el.fillStyle='rgb(140, 17, 17)',l.el.rect((s/2|0)-152,e,304,34),l.el.fillRect((s/2|0)-150,e+2,3*t,30),l.el.fillStyle='black',l.el.fillRect((s/2|0)-150+3*t,e+2,300-3*t,30),l.el.font='bold 13px helvetica, sans-serif',l.el.textAlign='center',l.el.fillStyle='white',l.el.fillText(i,s/2|0,e+22),await(0,n.Jo)(5)}Wc=()=>{let t=-1;return this.Dg!==this.xg&&(t=this.kg[this.xg],this.xg=this.xg+1&127),t};get ms(){const t=this.Lg.length;let i=0;for(let s=0;sthis.sd&&(this.sd=s),this.Cg[this.Tg]=s,this.Tg=(this.Tg+1)%250,s}get td(){return this.Cg.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.Qc=0;const s=r.c[i];if(!s||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const h=s.code;let e=s.ch;t.ctrlKey&&(e>='A'.charCodeAt(0)&&e<=']'.charCodeAt(0)||e=='_'.charCodeAt(0)?e-='A'.charCodeAt(0)-1:e>='a'.charCodeAt(0)&&e<='z'.charCodeAt(0)&&(e-='a'.charCodeAt(0)-1)),e<30&&(e=0),h===r.c.ArrowLeft.code?e=1:h===r.c.ArrowRight.code?e=2:h===r.c.ArrowUp.code?e=3:h===r.c.ArrowDown.code?e=4:h===r.c.Control.code?e=5:h===r.c.Shift.code?e=6:h===r.c.Alt.code?e=7:h===r.c.Backspace.code||h===r.c.Delete.code?e=8:h===r.c.Tab.code?e=9:h===r.c.Enter.code?e=10:h>=r.c.F1.code&&h<=r.c.F12.code?e=h+1008-r.c.F1.code:h===r.c.Home.code?e=1e3:h===r.c.End.code?e=1001:h===r.c.PageUp.code?e=1002:h===r.c.PageDown.code&&(e=1003),e>0&&e<128&&(this.uf[e]=1),e>4&&(this.kg[this.Dg]=e,this.Dg=this.Dg+1&127),o.A.enabled&&o.A.zg(e),r.g.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.Qc=0;const s=r.c[i];if(!s||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const h=s.code;let e=s.ch;e<30&&(e=0),h===r.c.ArrowLeft.code?e=1:h===r.c.ArrowRight.code?e=2:h===r.c.ArrowUp.code?e=3:h===r.c.ArrowDown.code?e=4:h===r.c.Control.code?e=5:h===r.c.Shift.code?e=6:h===r.c.Alt.code?e=7:h===r.c.Backspace.code||h===r.c.Delete.code?e=8:h===r.c.Tab.code?e=9:h===r.c.Enter.code?e=10:h>=r.c.F1.code&&h<=r.c.F12.code?e=h+1008-r.c.F1.code:h===r.c.Home.code?e=1e3:h===r.c.End.code?e=1001:h===r.c.PageUp.code?e=1002:h===r.c.PageDown.code&&(e=1003),e>0&&e<128&&(this.uf[e]=0),o.A.enabled&&o.A.Zg(e),r.g.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.Ng=!1,(t.clientX>0||t.clientY>0)&&this.qg(t),this.Qc=0,this.Bc=this.Yl,this.Gc=this.Vl,this.Xg&&!this.$g){if(this.Jg()||this.Qg()||this.tE())return this.Uc=1,void(this.wf=1);t.timeStamp>=this.time+500?(this.Uc=2,this.wf=2):(this.Uc=1,this.wf=1)}else 2===t.button?(this.Uc=2,this.wf=2):(this.Uc=1,this.wf=1);o.A.enabled&&o.A.iE(this.Bc,this.Gc,t.buttons)};onmouseup=t=>{this.qg(t),this.Qc=0,this.wf=0,o.A.enabled&&o.A.sE(t.buttons)};onmouseenter=t=>{this.qg(t),o.A.enabled&&o.A.hE()};onmouseleave=t=>{this.qg(t),this.Qc=0,this.Yl=-1,this.Vl=-1,this.wf=0,this.Bc=-1,this.Gc=-1,o.A.enabled&&o.A.eE()};onmousemove=t=>{this.qg(t),this.Qc=0,o.A.enabled&&o.A.nE(this.Yl,this.Vl)};onfocus=t=>{this.hasFocus=!0,this.Rg=!0,this.refresh(),o.A.enabled&&o.A.rE()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.oE()};ontouchstart=t=>{if(!this.Xg)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.Ng=!0;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.Ug=this.Wg=this.Gg=0|i.screenX,this.Bg=this.Yg=this.Hg=0|i.screenY,this.time=t.timeStamp,this.Pg=this.lE(),this.Fg=this.aE()};ontouchend=t=>{if(!this.Xg||!this.Ng)return;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.Wg=0|i.screenX,this.Yg=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Pg&&!this.lE())return void(this.Ng=!1);if(this.Fg&&!this.aE())return void(this.Ng=!1);if(this.Jg()||this.cE()||this.Qg()||this.tE()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.Qg()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.tE()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Jg()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.cE()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.fE?t.setAttribute('type','password'):t.setAttribute('type',this.tE()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${s}px; top: ${h}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.fE&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,s=i.data;null!==s&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:s,code:s}))}),t.onkeydown=t=>{this.fE&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.fE&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.Ng=!1)}const e=t.timeStamp>=this.time+500,n=Math.abs(this.Ug-this.Wg)>16||Math.abs(this.Bg-this.Yg)>16;e&&!n?(this.Ng=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.wf=0,this.Ng=!1)};ontouchmove=t=>{if(!this.Xg||!this.Ng)return;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.Wg=0|i.screenX,this.Yg=0|i.screenY,this.Pg&&-1===this.Ho()?(this.Gg-this.Wg>0?this.rotate(2):this.Gg-this.Wg<0&&this.rotate(0),this.Hg-this.Yg>0?this.rotate(3):this.Hg-this.Yg<0&&this.rotate(1)):(this.Fg||-1!==this.Ho())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.Gg=this.Wg,this.Hg=this.Yg};get Xg(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get fE(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get $g(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}lE=()=>this.gc&&this.Yl>=8&&this.Yl<=520&&this.Vl>=11&&this.Vl<=345;Jg=()=>this.gc&&-1===this.Go()&&!this.Uo()&&!this.Bo()&&this.Yl>=11&&this.Yl<=506&&this.Vl>=449&&this.Vl<=482;cE=()=>this.gc&&(this.Uo()||this.Bo())&&this.Yl>=11&&this.Yl<=506&&this.Vl>=383&&this.Vl<=482;aE=()=>this.gc&&this.Yl>=562&&this.Yl<=752&&this.Vl>=231&&this.Vl<=492;Qg=()=>!this.gc&&2===this.Fo()&&this.Yl>=301&&this.Yl<=562&&this.Vl>=262&&this.Vl<=279;tE=()=>!this.gc&&2===this.Fo()&&this.Yl>=301&&this.Yl<=562&&this.Vl>=279&&this.Vl<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};uE=()=>null!==document.fullscreenElement;qg=t=>{if(this.uE()){const i=t.target.getBoundingClientRect(),s=window.innerHeight/l.Vg.height,h=(window.innerWidth-l.Vg.width*s)/2;this.Yl=0|this.dE(t.clientX-i.left-h,0,l.Vg.width*s,0,789),this.Vl=0|this.dE(t.clientY-i.top,0,l.Vg.height*s,0,532)}else{const i=l.Vg.getBoundingClientRect(),s=l.Vg.width/i.width,h=l.Vg.height/i.height;this.Yl=(t.clientX-i.left)*s|0,this.Vl=(t.clientY-i.top)*h|0}this.Yl<0&&(this.Yl=0),this.Vl<0&&(this.Vl=0),this.Yl>789&&(this.Yl=789),this.Vl>532&&(this.Vl=532)};dE=(t,i,s,h,e)=>(t-i)*(e-h)/(s-i)+h}},2595:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1069);class e{static enabled=!1;static wE=null;static yE=null;static AE=0;static pE=0;static mE=0;static IE=0;static gE=0;static jA=()=>{this.wE=h.A.Ut(1),this.yE=null,this.AE=performance.now(),this.enabled=!0};static Jc=()=>{this.enabled=!1,this.wE=null};static flush=()=>{let t=null;return this.yE&&this.enabled&&(t=this.yE),this.yE=null,t};static stop=()=>{let t=null;return this.wE&&this.wE.jc>0&&this.enabled&&(t=this.wE),this.Jc(),t};static iE=(t,i,s)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.pE++;const h=performance.now();let e=(h-this.AE)/10|0;e>250&&(e=250),this.AE=h,this.EE(5),1===s?this.wE?.p1(1):this.wE?.p1(2),this.wE?.p1(e),this.wE?.p3(t+(i<<10))};static sE=t=>{if(!this.enabled)return;this.pE++;const i=performance.now();let s=(i-this.AE)/10|0;s>250&&(s=250),this.AE=i,this.EE(2),1===t?this.wE?.p1(3):this.wE?.p1(4),this.wE?.p1(s)};static nE=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const s=performance.now();if(s-this.mE>=50){this.mE=s,this.pE++;let h=(s-this.AE)/10|0;h>250&&(h=250),this.AE=s,t-this.IE<8&&t-this.IE>=-8&&i-this.gE<8&&i-this.gE>=-8?(this.EE(3),this.wE?.p1(5),this.wE?.p1(h),this.wE?.p1(t+(i-this.gE+8<<4)+8-this.IE)):t-this.IE<128&&t-this.IE>=-128&&i-this.gE<128&&i-this.gE>=-128?(this.EE(4),this.wE?.p1(6),this.wE?.p1(h),this.wE?.p1(t+128-this.IE),this.wE?.p1(i+128-this.gE)):(this.EE(5),this.wE?.p1(7),this.wE?.p1(h),this.wE?.p3(t+(i<<10))),this.IE=t,this.gE=i}};static zg=t=>{if(!this.enabled)return;this.pE++;const i=performance.now();let s=(i-this.AE)/10|0;s>250&&(s=250),this.AE=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.EE(3),this.wE?.p1(8),this.wE?.p1(s),this.wE?.p1(t)};static Zg=t=>{if(!this.enabled)return;this.pE++;const i=performance.now();let s=(i-this.AE)/10|0;s>250&&(s=250),this.AE=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.EE(3),this.wE?.p1(9),this.wE?.p1(s),this.wE?.p1(t)};static rE=()=>{if(!this.enabled)return;this.pE++;const t=performance.now();let i=(t-this.AE)/10|0;i>250&&(i=250),this.AE=t,this.EE(2),this.wE?.p1(10),this.wE?.p1(i)};static oE=()=>{if(!this.enabled)return;this.pE++;const t=performance.now();let i=(t-this.AE)/10|0;i>250&&(i=250),this.AE=t,this.EE(2),this.wE?.p1(11),this.wE?.p1(i)};static hE=()=>{if(!this.enabled)return;this.pE++;const t=performance.now();let i=(t-this.AE)/10|0;i>250&&(i=250),this.AE=t,this.EE(2),this.wE?.p1(12),this.wE?.p1(i)};static eE=()=>{if(!this.enabled)return;this.pE++;const t=performance.now();let i=(t-this.AE)/10|0;i>250&&(i=250),this.AE=t,this.EE(2),this.wE?.p1(13),this.wE?.p1(i)};static EE=t=>{if(this.wE&&this.wE.jc+t>=500){const t=this.wE;this.wE=h.A.Ut(1),this.yE=t}}}},9091:(t,i,s)=>{s.d(i,{c:()=>e,g:()=>h});const h=['F11','F12'],e={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}}},1120:(t,i,s)=>{s.d(i,{A:()=>c});var h=s(1069),e=s(8665),n=s(2679),r=s(2511),o=s(3819),l=s(3867),a=s(8950);class c{static Do=[];static _E=null;static No=null;static xl=0;static CE=1;static Nl=2;static Jl=3;static ta=4;static fa=5;static wa=6;static _a=7;static ym=1;static Im=2;static gm=3;static Em=4;static _m=5;static na=6;static Oa=1;static va=100;static ba=101;static La=200;static iy=201;static sy=202;static Ra=203;static hy=205;static oy=300;static TE=301;static OE=302;static vE=303;static bE=304;static LE=305;static RE=306;static SE=307;static ME=308;static kE=309;static xE=310;static DE=311;static NE=312;static ly=313;static uy=314;static PE=315;static FE=316;static UE=317;static BE=318;static GE=319;static HE=320;static WE=321;static YE=322;static wy=323;static Va=324;static Ka=325;static yy=326;static Na=327;static Sa=401;static Ma=500;static ey=501;static ny=502;static Da=503;static Xa=600;static py=601;static VE=602;static KE=603;static XE=604;static jE=605;static zE=606;static ZE=607;static qE=608;static $E=609;static JE=610;static QE=611;static my=612;static ja=613;static za=650;static $a=651;static Ja=652;static Qa=653;static tc=654;static Za=655;static wc=(t,i,s)=>{this._E=new n.A(5e4),this.No=new n.A(5e4);const e=new h.A(t.read('data'));let r=-1;for(e.jc+=2;e.jc0){h.ol=new Uint8Array(n),h.al=new Uint16Array(n);for(let t=0;t0){h.scripts=new l.ds(o,null);for(let t=0;t0){const e=s.lastIndexOf(',');h.$l[t]=this.t_(i,s.substring(0,e),parseInt(s.substring(e+1),10))}}h.wm=new l.ds(5,null);for(let t=0;t<5;t++){const i=e._A;h.wm[t]=i,0===i.length&&(h.wm[t]=null)}}if(h.type===c.Jl&&(h.fill=1===e.cA),h.type===c.ta||h.type===c.CE){h.oa=1===e.cA;const t=e.cA;s&&(h.font=s[t]),h.aa=1===e.cA}if(h.type===c.ta&&(h.text=e._A,h.ha=e._A),h.type!==c.CE&&h.type!==c.Jl&&h.type!==c.ta||(h.Ql=e.il),h.type!==c.Jl&&h.type!==c.ta||(h.sa=e.il,h.ia=e.il),h.type===c.fa){const t=e._A;if(t.length>0){const s=t.lastIndexOf(',');h.da=this.t_(i,t.substring(0,s),parseInt(t.substring(s+1),10))}const s=e._A;if(s.length>0){const t=s.lastIndexOf(',');h.ua=this.t_(i,s.substring(0,t),parseInt(s.substring(t+1),10))}}if(h.type===c.wa){const t=e.cA;0!==t&&(h.model=this.ma((t-1<<8)+e.cA));const i=e.cA;0!==i&&(h.i_=this.ma((i-1<<8)+e.cA)),h.Il=e.cA,0===h.Il?h.Il=-1:h.Il=(h.Il-1<<8)+e.cA,h.gl=e.cA,0===h.gl?h.gl=-1:h.gl=(h.gl-1<<8)+e.cA,h.zoom=e.rA,h.pa=e.rA,h.Ea=e.rA}if(h.type===c._a){h.Ul=new Int32Array(h.width*h.height),h.Bl=new Int32Array(h.width*h.height),h.oa=1===e.cA;const t=e.cA;s&&(h.font=s[t]),h.aa=1===e.cA,h.Ql=e.il,h.Gl=e.cp,h.Hl=e.cp,h.fm=1===e.cA,h.wm=new l.ds(5,null);for(let t=0;t<5;t++){const i=e._A;h.wm[t]=i,0===i.length&&(h.wm[t]=null)}}h.ea!==c.Im&&h.type!==c.Nl||(h.Mw=e._A,h.action=e._A,h.Sw=e.rA),h.ea!==c.ym&&h.ea!==c.Em&&h.ea!==c._m&&h.ea!==c.na||(h.pm=e._A,0===h.pm.length&&(h.ea===c.ym?h.pm='Ok':h.ea===c.Em||h.ea===c._m?h.pm='Select':h.ea===c.na&&(h.pm='Continue')))}this._E=null,this.No=null};static t_=(t,i,s)=>{const h=o.A.s_(i)<<8n|BigInt(s);if(this._E){const t=this._E.get(h);if(t)return t}let e;try{e=r.A.hc(t,i,s),this._E?.put(h,e)}catch(t){return null}return e};static ma=t=>{if(this.No){const i=this.No.get(BigInt(t));if(i)return i}const i=e.A.model(t);return this.No?.put(BigInt(t),i),i};id=-1;Kd=-1;type=-1;ea=-1;Ml=0;width=0;height=0;am=-1;ol=null;al=null;scripts=null;scroll=0;hide=!1;draggable=!1;fm=!1;dm=!1;Gl=0;Hl=0;Pl=null;Fl=null;$l=null;wm=null;fill=!1;oa=!1;font=null;aa=!1;text=null;ha=null;Ql=0;sa=0;ia=0;da=null;ua=null;model=null;i_=null;Il=-1;gl=-1;zoom=0;pa=0;Ea=0;Mw=null;action=null;Sw=-1;pm=null;ml=null;bl=null;Ll=null;x=0;y=0;Dl=0;Ul=null;Bl=null;_l=0;El=0;ma(t,i,s){let h=this.model;if(s&&(h=this.i_),!h)return null;if(-1===t&&-1===i&&!h.h_)return h;const n=e.A.e_(h,!0,!0,!1);return-1===t&&-1===i||n.Ha(),-1!==t&&n.Wa(t),-1!==i&&n.Wa(i),n.Ya(64,768,-50,-10,-50,!0),n}n_(){if(this.Kd===this.id)return this.x;let t=c.Do[this.Kd];if(!t.ml||!t.bl||!t.Ll)return this.x;let i=t.ml.indexOf(this.id);if(-1===i)return this.x;let s=t.bl[i];for(;t.Kd!==t.id;){const h=c.Do[t.Kd];h.ml&&h.bl&&h.Ll&&(i=h.ml.indexOf(t.id),-1!==i&&(s+=h.bl[i])),t=h}return s}r_(){if(this.Kd===this.id)return this.y;let t=c.Do[this.Kd];if(!t.ml||!t.bl||!t.Ll)return this.y;let i=t.ml.indexOf(this.id);if(-1===i)return this.y;let s=t.Ll[i];for(;t.Kd!==t.id;){const h=c.Do[t.Kd];h.ml&&h.bl&&h.Ll&&(i=h.ml.indexOf(t.id),-1!==i&&(s+=h.Ll[i])),t=h}return s}outline(t){const i=this.n_(),s=this.r_();a.A.Rl(i,s,this.width,this.height,t)}move(t,i){if(this.Kd===this.id)return;this.x=0,this.y=0;const s=c.Do[this.Kd];if(s.ml&&s.bl&&s.Ll){const h=s.ml.indexOf(this.id);-1!==h&&(s.bl[h]=t,s.Ll[h]=i)}}delete(){if(this.Kd===this.id)return;const t=c.Do[this.Kd];if(t.ml&&t.bl&&t.Ll){const i=t.ml.indexOf(this.id);-1!==i&&(t.ml.splice(i,1),t.bl.splice(i,1),t.Ll.splice(i,1))}}}},6333:(t,i,s)=>{s.d(i,{$:()=>h});class h{id;o_=null;constructor(t){this.id=t}l_(t){for(;;){const i=t.cA;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1069),e=s(6333);class n extends e.${static count=0;static Do=[];static wc=t=>{const i=new h.A(t.read('flo.dat'));this.count=i.rA;for(let t=0;t(s>179&&(i=i/2|0),s>192&&(i=i/2|0),s>217&&(i=i/2|0),s>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(s/2|0));static c_=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static f_=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);u_=0;texture=-1;d_=!1;w_=!0;y_=0;A_=0;p_=0;m_=0;I_=0;g_=0;decode(t,i){1===t?(this.u_=i.E_,this.setColor(this.u_)):2===t?this.texture=i.cA:3===t?this.d_=!0:5===t?this.w_=!1:6===t?this.o_=i._A:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,s=(t>>8&255)/256,h=(255&t)/256;let e=i;si&&(r=s),h>r&&(r=h);let o=0,l=0;const a=(e+r)/2;e!==r&&(a<.5&&(l=(r-e)/(r+e)),a>=.5&&(l=(r-e)/(2-r-e)),i===r?o=(s-h)/(r-e):s===r?o=(h-i)/(r-e)+2:h===r&&(o=(i-s)/(r-e)+4)),o/=6,this.y_=256*o|0,this.A_=256*l|0,this.p_=256*a|0,this.A_<0?this.A_=0:this.A_>255&&(this.A_=255),this.p_<0?this.p_=0:this.p_>255&&(this.p_=255),this.m_=a>.5?(1-a)*l*512|0:a*l*512|0,this.m_<1&&(this.m_=1),this.I_=o*this.m_|0;let c=this.y_+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.A_+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.p_+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.g_=n.a_(c,f,u)}}},8317:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(1069),e=s(6333),n=s(8665),r=s(3867);class o extends e.${static count=0;static Do=[];static wc=t=>{const i=new h.A(t.read('idk.dat'));this.count=i.rA;for(let t=0;t=40&&t<50?this.T_[t-40]=i.rA:t>=50&&t<60?this.O_[t-50]=i.rA:t>=60&&t<70?this.C_[t-60]=i.rA:console.log('Error unrecognised config code: ',t)}ma(){if(!this.__)return null;const t=new r.ds(this.__.length,null);for(let i=0;i{s.d(i,{A:()=>c});var h=s(6333),e=s(1069),n=s(2679),r=s(8665),o=s(1023),l=s(6169),a=s(3867);class c extends h.${static count=0;static cache=null;static v_=null;static b_=null;static L_=0;static cu=new n.A(500);static fu=new n.A(30);static wc=t=>{this.v_=new e.A(t.read('loc.dat'));const i=new e.A(t.read('loc.idx'));this.count=i.rA,this.b_=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.b_||!this.v_)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const s=this.cache[i];if(s&&s.id===t)return s}this.L_=(this.L_+1)%10;const i=this.cache[this.L_];return this.v_.jc=this.b_[t],i.id=t,i.reset(),i.l_(this.v_),i.R_||(i.R_=new Int32Array(1)),-1===i.S_&&i.R_&&(i.active=i.R_.length>0&&i.R_[0]===o.A.Ey.id,i.Om&&(i.active=!0)),i};static Ro=()=>{this.cu=null,this.fu=null,this.b_=null,this.cache=null,this.v_=null};__=null;R_=null;name=null;uw=null;T_=null;O_=null;width=1;length=1;qy=!0;$y=!0;active=!1;S_=-1;M_=!1;k_=!1;w_=!1;Il=-1;x_=!1;D_=16;N_=0;P_=0;Om=null;vd=-1;xd=-1;F_=!1;U_=!0;B_=128;G_=128;H_=128;Ty=0;W_=0;Y_=0;V_=0;K_=!1;decode(t,i){if(1===t){const t=i.cA;this.__=new Int32Array(t),this.R_=new Int32Array(t);for(let s=0;s=30&&t<39)this.Om||(this.Om=new a.ds(5,null)),this.Om[t-30]=i._A,'hidden'===this.Om[t-30]?.toLowerCase()&&(this.Om[t-30]=null);else if(40===t){const t=i.cA;this.T_=new Uint16Array(t),this.O_=new Uint16Array(t);for(let s=0;s=this.__.length)return null;let d=this.__[a];if(-1===d)return null;const w=this.F_!==i>3;w&&(d+=65536);let y=c.cu?.get(BigInt(d));y||(y=r.A.model(65535&d),w&&y.Q_(),c.cu?.put(BigInt(d),y));const A=128!==this.B_||128!==this.G_||128!==this.H_,p=0!==this.W_||0!==this.Y_||0!==this.V_;let m=r.A.e_(y,!this.T_,!this.x_,i===l.A.Pd&&-1===o&&!A&&!p);for(-1!==o&&(m.Ha(),m.Wa(o),m.tC=null,m.iC=null);i-- >0;)m.sC();if(this.T_&&this.O_)for(let t=0;t{s.d(i,{A:()=>l});var h=s(6333),e=s(1069),n=s(2679),r=s(8665),o=s(3867);class l extends h.${static count=0;static cache=null;static v_=null;static b_=null;static L_=0;static No=new n.A(30);static wc=t=>{this.v_=new e.A(t.read('npc.dat'));const i=new e.A(t.read('npc.idx'));this.count=i.rA,this.b_=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.b_||!this.v_)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const s=this.cache[i];if(s&&s.id===t)return s}this.L_=(this.L_+1)%20;const i=this.cache[this.L_]=new l(t);return this.v_.jc=this.b_[t],i.l_(this.v_),i};static Ro=()=>{this.No=null,this.b_=null,this.cache=null,this.v_=null};name=null;uw=null;size=1;__=null;C_=null;x_=!1;OI=-1;mI=-1;gI=-1;_I=-1;TI=-1;T_=null;O_=null;Om=null;B_=-1;G_=-1;H_=-1;md=!0;Sm=-1;nC=128;rC=128;decode(t,i){if(1===t){const t=i.cA;this.__=new Uint16Array(t);for(let s=0;s=30&&t<40)this.Om||(this.Om=new o.ds(5,null)),this.Om[t-30]=i._A,'hidden'===this.Om[t-30]?.toLowerCase()&&(this.Om[t-30]=null);else if(40===t){const t=i.cA;this.T_=new Uint16Array(t),this.O_=new Uint16Array(t);for(let s=0;s{s.d(i,{A:()=>u});var h=s(6333),e=s(1069),n=s(2511),r=s(2679),o=s(8665),l=s(4583),a=s(8950),c=s(9298),f=s(3867);class u extends h.${static count=0;static cache=null;static v_=null;static b_=null;static L_=0;static uC=!0;static No=new r.A(50);static uu=new r.A(200);static wc=(t,i)=>{this.uC=i,this.v_=new e.A(t.read('obj.dat'));const s=new e.A(t.read('obj.idx'));this.count=s.rA,this.b_=new Int32Array(this.count);let h=2;for(let t=0;t{if(!this.cache||!this.b_||!this.v_)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const s=this.cache[i];if(s&&s.id===t)return s}this.L_=(this.L_+1)%10;const i=this.cache[this.L_];return this.v_.jc=this.b_[t],i.id=t,i.reset(),i.l_(this.v_),-1!==i.dC&&i.wC(),!this.uC&&i.members&&(i.name='Members Object',i.uw="Login to a members' server to use this object.",i.Om=null,i.um=null),i};static Ro=()=>{this.No=null,this.uu=null,this.b_=null,this.cache=null,this.v_=null};static Wl=(t,i)=>{if(u.uu){let s=u.uu.get(BigInt(t));if(s&&s.Ed!==i&&-1!==s.Ed&&(s.pA(),s=null),s)return s}let s=u.get(t);if(s.yC||(i=-1),s.yC&&s.AC&&i>1){let t=-1;for(let h=0;h<10;h++)i>=s.AC[h]&&0!==s.AC[h]&&(t=s.yC[h]);-1!==t&&(s=u.get(t))}const h=new n.A(32,32),e=l.A.ya,r=l.A.Aa,o=l.A.mc,f=a.A.yc,d=a.A.pC,w=a.A.mC,y=a.A.left,A=a.A.right,p=a.A.top,m=a.A.bottom;l.A.IC=!1,a.A.bind(h.yc,32,32),a.A.fillRect(0,0,32,32,c.A.Zl),l.A.Kg();const I=s.Wy(1),g=l.A.sin[s.vp]*s.Lp>>16,E=l.A.cos[s.vp]*s.Lp>>16;I.ga(0,s.bp,s.gC,s.vp,s.EC,g+(I.eC/2|0)+s._C,E+s._C);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===h.yc[t+32*i]&&(t>0&&h.yc[t+32*i-1]>1||i>0&&h.yc[t+32*(i-1)]>1||t<31&&h.yc[t+32*i+1]>1||i<31&&h.yc[t+32*(i+1)]>1)&&(h.yc[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===h.yc[t+32*i]&&t>0&&i>0&&h.yc[t+32*(i-1)-1]>0&&(h.yc[t+32*i]=3153952);if(-1!==s.dC){const t=this.Wl(s.CC,10),i=t.Xl,h=t.Ed;t.Xl=32,t.Ed=32,t.TC(5,5,22,22),t.Xl=i,t.Ed=h}return u.uu?.put(BigInt(t),h),a.A.bind(f,d,w),a.A.vl(y,p,A,m),l.A.ya=e,l.A.Aa=r,l.A.mc=o,l.A.IC=!0,s.Ca?h.Xl=33:h.Xl=32,h.Ed=i,h};model=0;name=null;uw=null;T_=null;O_=null;Lp=2e3;vp=0;bp=0;gC=0;EC=0;_C=0;OC=!1;vC=-1;Ca=!1;Gy=1;members=!1;Om=null;um=null;bC=-1;LC=-1;RC=0;SC=-1;MC=-1;kC=0;xC=-1;DC=-1;NC=-1;PC=-1;FC=-1;UC=-1;yC=null;AC=null;CC=-1;dC=-1;decode(t,i){if(1===t)this.model=i.rA;else if(2===t)this.name=i._A;else if(3===t)this.uw=i._A;else if(4===t)this.Lp=i.rA;else if(5===t)this.vp=i.rA;else if(6===t)this.bp=i.rA;else if(7===t)this.EC=i.cp,this.EC>32767&&(this.EC-=65536);else if(8===t)this._C=i.cp,this._C>32767&&(this._C-=65536);else if(9===t)this.OC=!0;else if(10===t)this.vC=i.rA;else if(11===t)this.Ca=!0;else if(12===t)this.Gy=i.il;else if(16===t)this.members=!0;else if(23===t)this.bC=i.rA,this.RC=i.lA;else if(24===t)this.LC=i.rA;else if(25===t)this.SC=i.rA,this.kC=i.lA;else if(26===t)this.MC=i.rA;else if(t>=30&&t<35)this.Om||(this.Om=new f.ds(5,null)),this.Om[t-30]=i._A,'hidden'===this.Om[t-30]?.toLowerCase()&&(this.Om[t-30]=null);else if(t>=35&&t<40)this.um||(this.um=new f.ds(5,null)),this.um[t-35]=i._A;else if(40===t){const t=i.cA;this.T_=new Uint16Array(t),this.O_=new Uint16Array(t);for(let s=0;s=100&&t<110&&(this.yC&&this.AC||(this.yC=new Uint16Array(10),this.AC=new Uint16Array(10)),this.yC[t-100]=i.rA,this.AC[t-100]=i.rA)}BC(t){let i=this.bC;if(1===t&&(i=this.SC),-1===i)return null;let s=this.LC,h=this.xC;1===t&&(s=this.MC,h=this.DC);let e=o.A.model(i);if(-1!==s){const t=o.A.model(s);if(-1===h){const i=[e,t];e=o.A.Pa(i,2)}else{const i=[e,t,o.A.model(h)];e=o.A.Pa(i,3)}}if(0===t&&0!==this.RC&&e.translate(this.RC,0,0),1===t&&0!==this.kC&&e.translate(this.kC,0,0),this.T_&&this.O_)for(let t=0;t1){let i=-1;for(let s=0;s<10;s++)t>=this.AC[s]&&0!==this.AC[s]&&(i=this.yC[s]);if(-1!==i)return u.get(i).Wy(1)}if(u.No){const t=u.No.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.T_&&this.O_)for(let t=0;t{s.d(i,{A:()=>r});var h=s(6333),e=s(1069),n=s(6730);class r extends h.${static count=0;static Do=[];static wc=t=>{const i=new e.A(t.read('seq.dat'));this.count=i.rA;for(let t=0;t{s.d(i,{A:()=>l});var h=s(6333),e=s(1069),n=s(1312),r=s(8665),o=s(2679);class l extends h.${static count=0;static Do=[];static No=new o.A(30);static wc=t=>{const i=new e.A(t.read('spotanim.dat'));this.count=i.rA;for(let t=0;t=40&&t<50?this.T_[t-40]=i.rA:t>=50&&t<60?this.O_[t-50]=i.rA:console.log('Error unrecognised spotanim config code: ',t)}ma(){let t=l.No?.get(BigInt(this.id));if(t)return t;t=r.A.model(this.model);for(let i=0;i<6;i++)0!==this.T_[0]&&t.Fa(this.T_[i],this.O_[i]);return l.No?.put(BigInt(this.id),t),t}}},3764:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(6333),e=s(1069);class n extends h.${static count=0;static Do=[];static WC=[];static YC=0;static wc=t=>{const i=new e.A(t.read('varp.dat'));this.count=i.rA;for(let t=0;t{s.d(i,{A:()=>h});class h{static OPEN=0;static zC=1;static ZC=2;static qC=4;static $C=8;static JC=h.zC<<4;static QC=h.ZC<<4;static tT=h.qC<<4;static iT=h.$C<<4;static sT=256;static hT=512;static eT=1024;static nT=2048;static rT=4096;static oT=h.hT<<4;static lT=h.eT<<4;static aT=h.nT<<4;static cT=h.rT<<4;static fT=h.sT<<9;static uT=524288;static dT=2097152;static wT=h.dT|h.uT;static yT=h.sT|h.wT;static Rd=h.ZC|h.yT;static bd=h.$C|h.yT;static Pm=h.ZC|h.qC|h.bd;static Sd=h.QC|h.yT;static Um=h.$C|h.JC|h.Sd;static Ld=h.iT|h.yT;static Fm=h.zC|h.ZC|h.Ld;static Bm=h.QC|h.tT|h.Ld;static AT=16777215}},670:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(9456),e=s(6169),n=s(1023),r=s(4909);class o{static xn=4;static Xn=104;static index=(t,i)=>t*o.Xn+i;offsetX;pT;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.pT=0,this.sizeX=o.Xn,this.sizeZ=o.Xn,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.pT)]|=h.A.dT};iA=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.pT)]&=~h.A.dT};Vy=(t,i,s,n,r,o)=>{let l=h.A.sT;o&&(l|=h.A.fT);const a=t-this.offsetX,c=i-this.pT;if(r===e.A.Fd||r===e.A.Bd){const t=s;s=n,n=t}for(let t=a;t=0&&t=0&&i{let l=h.A.sT;o&&(l|=h.A.fT);const a=t-this.offsetX,c=i-this.pT;if(r===e.A.Fd||r===e.A.Bd){const t=s;s=n,n=t}for(let t=a;t=0&&t=0&&i{const l=t-this.offsetX,a=i-this.pT,c=o?h.A.cT:h.A.iT,f=o?h.A.rT:h.A.$C,u=o?h.A.eT:h.A.ZC,d=o?h.A.lT:h.A.QC,w=o?h.A.hT:h.A.zC,y=o?h.A.oT:h.A.JC,A=o?h.A.nT:h.A.qC,p=o?h.A.aT:h.A.tT;s===n.A.Dd.id?r===e.A.Pd?(this.add(l,a,c),this.add(l-1,a,f)):r===e.A.Fd?(this.add(l,a,u),this.add(l,a+1,d)):r===e.A.Ud?(this.add(l,a,f),this.add(l+1,a,c)):r===e.A.Bd&&(this.add(l,a,d),this.add(l,a-1,u)):s===n.A.gT.id||s===n.A.Gd.id?r===e.A.Pd?(this.add(l,a,w),this.add(l-1,a+1,y)):r===e.A.Fd?(this.add(l,a,A),this.add(l+1,a+1,p)):r===e.A.Ud?(this.add(l,a,y),this.add(l+1,a-1,w)):r===e.A.Bd&&(this.add(l,a,p),this.add(l-1,a-1,A)):s===n.A.Nd.id&&(r===e.A.Pd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):r===e.A.Fd?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):r===e.A.Ud?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):r===e.A.Bd&&(this.add(l,a,d|c),this.add(l,a-1,u),this.add(l-1,a,f))),o&&this.IT(t,i,s,r,!1)};Zy=(t,i,s,r,o)=>{const l=t-this.offsetX,a=i-this.pT,c=o?h.A.cT:h.A.iT,f=o?h.A.rT:h.A.$C,u=o?h.A.eT:h.A.ZC,d=o?h.A.lT:h.A.QC,w=o?h.A.hT:h.A.zC,y=o?h.A.oT:h.A.JC,A=o?h.A.nT:h.A.qC,p=o?h.A.aT:h.A.tT;s===n.A.Dd.id?r===e.A.Pd?(this.remove(l,a,c),this.remove(l-1,a,f)):r===e.A.Fd?(this.remove(l,a,u),this.remove(l,a+1,d)):r===e.A.Ud?(this.remove(l,a,f),this.remove(l+1,a,c)):r===e.A.Bd&&(this.remove(l,a,d),this.remove(l,a-1,u)):s===n.A.gT.id||s===n.A.Gd.id?r===e.A.Pd?(this.remove(l,a,w),this.remove(l-1,a+1,y)):r===e.A.Fd?(this.remove(l,a,A),this.remove(l+1,a+1,p)):r===e.A.Ud?(this.remove(l,a,y),this.remove(l+1,a-1,w)):r===e.A.Bd&&(this.remove(l,a,p),this.remove(l-1,a-1,A)):s===n.A.Nd.id&&(r===e.A.Pd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):r===e.A.Fd?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):r===e.A.Ud?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):r===e.A.Bd&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.Zy(t,i,s,r,!1)};xm=(t,i,s,r,l,a)=>{if(t===s&&i===r)return!0;const c=t-this.offsetX,f=i-this.pT,u=s-this.offsetX,d=r-this.pT,w=o.index(c,f);if(l===n.A.Dd.id){if(a===e.A.Pd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.Sd)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Rd)===h.A.OPEN)return!0}else if(a===e.A.Fd){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.bd)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.Ld)===h.A.OPEN)return!0}else if(a===e.A.Ud){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.Sd)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Rd)===h.A.OPEN)return!0}else if(a===e.A.Bd){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.bd)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.Ld)===h.A.OPEN)return!0}}else if(l===n.A.Nd.id){if(a===e.A.Pd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.Ld)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Rd)===h.A.OPEN)return!0}else if(a===e.A.Fd){if(c===u-1&&f===d&&(this.flags[w]&h.A.bd)===h.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Rd)===h.A.OPEN)return!0}else if(a===e.A.Ud){if(c===u-1&&f===d&&(this.flags[w]&h.A.bd)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.Sd)===h.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(a===e.A.Bd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.Sd)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.Ld)===h.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===n.A.Wd.id){if(c===u&&f===d+1&&(this.flags[w]&h.A.QC)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.ZC)===h.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.$C)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.iT)===h.A.OPEN)return!0}return!1};Dm=(t,i,s,r,l,a)=>{if(t===s&&i===r)return!0;const c=t-this.offsetX,f=i-this.pT,u=s-this.offsetX,d=r-this.pT,w=o.index(c,f);if(l===n.A.ET.id||l===n.A._T.id){if(l===n.A._T.id&&(a=a+2&3),a===e.A.Pd){if(c===u+1&&f===d&&(this.flags[w]&h.A.iT)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.ZC)===h.A.OPEN)return!0}else if(a===e.A.Fd){if(c===u-1&&f===d&&(this.flags[w]&h.A.$C)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.ZC)===h.A.OPEN)return!0}else if(a===e.A.Ud){if(c===u-1&&f===d&&(this.flags[w]&h.A.$C)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.QC)===h.A.OPEN)return!0}else if(a===e.A.Bd){if(c===u+1&&f===d&&(this.flags[w]&h.A.iT)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.QC)===h.A.OPEN)return!0}}else if(l===n.A.CT.id){if(c===u&&f===d+1&&(this.flags[w]&h.A.QC)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.ZC)===h.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.$C)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.iT)===h.A.OPEN)return!0}return!1};Nm=(t,i,s,e,n,l,a)=>{const c=s+n-1,f=e+l-1,u=o.index(t-this.offsetX,i-this.pT);return t>=s&&t<=c&&i>=e&&i<=f||(t===s-1&&i>=e&&i<=f&&(this.flags[u]&h.A.$C)===h.A.OPEN&&(a&r.A.Pd)===h.A.OPEN||(t===c+1&&i>=e&&i<=f&&(this.flags[u]&h.A.iT)===h.A.OPEN&&(a&r.A.Ud)===h.A.OPEN||(i===e-1&&t>=s&&t<=c&&(this.flags[u]&h.A.ZC)===h.A.OPEN&&(a&r.A.Bd)===h.A.OPEN||i===f+1&&t>=s&&t<=c&&(this.flags[u]&h.A.QC)===h.A.OPEN&&(a&r.A.Fd)===h.A.OPEN)))};add=(t,i,s)=>{this.flags[o.index(t,i)]|=s};remove=(t,i,s)=>{this.flags[o.index(t,i)]&=h.A.AT-s}}},4909:(t,i,s)=>{s.d(i,{A:()=>h});class h{static Fd=1;static Ud=2;static Bd=4;static Pd=8}},6169:(t,i,s)=>{s.d(i,{A:()=>h});class h{static Pd=0;static Fd=1;static Ud=2;static Bd=3}},5599:(t,i,s)=>{s.d(i,{A:()=>h});class h{static Ky=0;static Xy=1;static zy=2;static Cy=3}},1023:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(5599);class e{static Dd=new e(0,h.A.Ky);static gT=new e(1,h.A.Ky);static Nd=new e(2,h.A.Ky);static Gd=new e(3,h.A.Ky);static tg=new e(4,h.A.Xy);static km=new e(5,h.A.Xy);static ET=new e(6,h.A.Xy);static _T=new e(7,h.A.Xy);static CT=new e(8,h.A.Xy);static Wd=new e(9,h.A.zy);static Ey=new e(10,h.A.zy);static _y=new e(11,h.A.zy);static TT=new e(12,h.A.zy);static OT=new e(13,h.A.zy);static vT=new e(14,h.A.zy);static bT=new e(15,h.A.zy);static LT=new e(16,h.A.zy);static RT=new e(17,h.A.zy);static ST=new e(18,h.A.zy);static MT=new e(19,h.A.zy);static kT=new e(20,h.A.zy);static xT=new e(21,h.A.zy);static Cy=new e(22,h.A.Cy);static values(){return[this.Dd,this.gT,this.RT,this.bT,this.Nd,this.vT,this.Wd,this.Gd,this.Cy,this.TT,this._y,this.ET,this.kT,this.Ey,this.km,this.OT,this._T,this.tg,this.LT,this.CT,this.MT,this.xT,this.ST]}static of(t){const i=this.values();for(let s=0;s{s.d(i,{A:()=>A});var h=s(670),e=s(2164),n=s(1069),r=s(4583),o=s(3045),l=s(5637),a=s(4197),c=s(1312),f=s(1023),u=s(6169),d=s(9298),w=s(5518),y=s(3867);class A{static DT=Int8Array.of(1,2,4,8);static NT=Uint8Array.of(16,32,64,128);static PT=Int8Array.of(1,0,-1,0);static FT=Int8Array.of(0,-1,0,1);static UT=(17*Math.random()|0)-8;static BT=(33*Math.random()|0)-16;static st=!0;static Vp=0;static GT=!1;static HT=(t,i)=>{let s=this.WT(t+45365,i+91923,4)+(this.WT(t+10294,i+37821,2)-128>>1)+(this.WT(t,i,1)-128>>2)-128;return s=35+(.3*s|0),s<10?s=10:s>60&&(s=60),s};static WT=(t,i,s)=>{const h=t/s|0,e=t&s-1,n=i/s|0,r=i&s-1,o=this.YT(h,n),l=this.YT(h+1,n),a=this.YT(h,n+1),c=this.YT(h+1,n+1),f=this.VT(o,l,e,s),u=this.VT(a,c,e,s);return this.VT(f,u,r,s)};static VT=(t,i,s,h)=>{const e=65536-r.A.cos[1024*s/h|0]>>1;return(t*(65536-e)>>16)+(i*e>>16)};static YT=(t,i)=>((this.KT(t-1,i-1)+this.KT(t+1,i-1)+this.KT(t-1,i+1)+this.KT(t+1,i+1))/16|0)+((this.KT(t-1,i)+this.KT(t+1,i)+this.KT(t,i-1)+this.KT(t,i+1))/8|0)+(this.KT(t,i)/4|0);static KT=(t,i)=>{const s=t+57*i,h=BigInt(s<<13^s);return 255&Number((h*(h*h*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static Vy=(t,i,s,h,e,n,r,o,d,w,y)=>{const p=e[y][i][s],m=e[y][i+1][s],I=e[y][i+1][s+1],g=e[y][i][s+1],E=p+m+I+g>>2,_=l.A.get(o);let C=i+(s<<7)+(o<<14)+1073741824|0;_.active||(C+=-2147483648),C|=0;const T=(w<<6)+d<<24>>24;if(d===f.A.Cy.id)h?.XT(_.ma(f.A.Cy.id,w,p,m,I,g,-1),t,i,s,E,C,T),_.qy&&_.active&&r?.mT(i,s),-1!==_.Il&&n.yg(new a.A(o,t,3,i,s,c.A.Do[_.Il],!0));else if(d===f.A.Ey.id||d===f.A._y.id){const e=_.ma(f.A.Ey.id,w,p,m,I,g,-1);if(e){let n,r,o=0;d===f.A._y.id&&(o+=256),w===u.A.Fd||w===u.A.Bd?(n=_.length,r=_.width):(n=_.width,r=_.length),h?.Vy(t,i,s,E,e,null,C,T,n,r,o)}_.qy&&r?.Vy(i,s,_.width,_.length,w,_.$y),-1!==_.Il&&n.yg(new a.A(o,t,2,i,s,c.A.Do[_.Il],!0))}else if(d>=f.A.TT.id)h?.Vy(t,i,s,E,_.ma(d,w,p,m,I,g,-1),null,C,T,1,1,0),_.qy&&r?.Vy(i,s,_.width,_.length,w,_.$y),-1!==_.Il&&n.yg(new a.A(o,t,2,i,s,c.A.Do[_.Il],!0));else if(d===f.A.Dd.id)h?.IT(t,i,s,E,A.DT[w],0,_.ma(f.A.Dd.id,w,p,m,I,g,-1),null,C,T),_.qy&&r?.IT(i,s,d,w,_.$y),-1!==_.Il&&n.yg(new a.A(o,t,0,i,s,c.A.Do[_.Il],!0));else if(d===f.A.gT.id)h?.IT(t,i,s,E,A.NT[w],0,_.ma(f.A.gT.id,w,p,m,I,g,-1),null,C,T),_.qy&&r?.IT(i,s,d,w,_.$y),-1!==_.Il&&n.yg(new a.A(o,t,0,i,s,c.A.Do[_.Il],!0));else if(d===f.A.Nd.id){const e=w+1&3;h?.IT(t,i,s,E,A.DT[w],A.DT[e],_.ma(f.A.Nd.id,w+4,p,m,I,g,-1),_.ma(f.A.Nd.id,e,p,m,I,g,-1),C,T),_.qy&&r?.IT(i,s,d,w,_.$y),-1!==_.Il&&n.yg(new a.A(o,t,0,i,s,c.A.Do[_.Il],!0))}else if(d===f.A.Gd.id)h?.IT(t,i,s,E,A.NT[w],0,_.ma(f.A.Gd.id,w,p,m,I,g,-1),null,C,T),_.qy&&r?.IT(i,s,d,w,_.$y),-1!==_.Il&&n.yg(new a.A(o,t,0,i,s,c.A.Do[_.Il],!0));else if(d===f.A.Wd.id)h?.Vy(t,i,s,E,_.ma(d,w,p,m,I,g,-1),null,C,T,1,1,0),_.qy&&r?.Vy(i,s,_.width,_.length,w,_.$y),-1!==_.Il&&n.yg(new a.A(o,t,2,i,s,c.A.Do[_.Il],!0));else if(d===f.A.tg.id)h?.jT(t,i,s,E,0,0,C,_.ma(f.A.tg.id,u.A.Pd,p,m,I,g,-1),T,512*w,A.DT[w]),-1!==_.Il&&n.yg(new a.A(o,t,1,i,s,c.A.Do[_.Il],!0));else if(d===f.A.km.id){let e=16;if(h){const n=h.Md(t,i,s);n>0&&(e=l.A.get(n>>14&32767).D_)}h?.jT(t,i,s,E,A.PT[w]*e,A.FT[w]*e,C,_.ma(f.A.tg.id,u.A.Pd,p,m,I,g,-1),T,512*w,A.DT[w]),-1!==_.Il&&n.yg(new a.A(o,t,1,i,s,c.A.Do[_.Il],!0))}else d===f.A.ET.id?(h?.jT(t,i,s,E,0,0,C,_.ma(f.A.tg.id,u.A.Pd,p,m,I,g,-1),T,w,256),-1!==_.Il&&n.yg(new a.A(o,t,1,i,s,c.A.Do[_.Il],!0))):d===f.A._T.id?(h?.jT(t,i,s,E,0,0,C,_.ma(f.A.tg.id,u.A.Pd,p,m,I,g,-1),T,w,512),-1!==_.Il&&n.yg(new a.A(o,t,1,i,s,c.A.Do[_.Il],!0))):d===f.A.CT.id&&(h?.jT(t,i,s,E,0,0,C,_.ma(f.A.tg.id,u.A.Pd,p,m,I,g,-1),T,w,768),-1!==_.Il&&n.yg(new a.A(o,t,1,i,s,c.A.Do[_.Il],!0)))};VI;KI;Wn;Yn;zT;ZT;qT;$T;JT;QT;tO;iO;sO;hO;eO;nO;constructor(t,i,s,e){this.VI=t,this.KI=i,this.Wn=s,this.Yn=e,this.zT=new y.rc(h.A.xn,t,i),this.ZT=new y.rc(h.A.xn,t,i),this.qT=new y.rc(h.A.xn,t,i),this.$T=new y.rc(h.A.xn,t,i),this.nO=new y.oc(h.A.xn,t+1,i+1),this.JT=new y.rc(h.A.xn,t+1,i+1),this.QT=new y.Kn(t+1,i+1),this.tO=new Int32Array(i),this.iO=new Int32Array(i),this.sO=new Int32Array(i),this.hO=new Int32Array(i),this.eO=new Int32Array(i)}$p=(t,i)=>{for(let t=0;t=0&&i[h]?.mT(s,e)}A.UT+=(5*Math.random()|0)-2,A.UT<-8?A.UT=-8:A.UT>8&&(A.UT=8),A.BT+=(5*Math.random()|0)-2,A.BT<-16?A.BT=-16:A.BT>16&&(A.BT=16);for(let i=0;i>8;for(let t=1;t>2)+(s[e+1][t]>>3)+(s[e][t-1]>>2)+(s[e][t+1]>>3)+(s[e][t]>>1);this.QT[e][t]=u-d}for(let t=0;t=0&&h0){const i=e.A.Do[s-1];this.tO[t]+=i.I_,this.iO[t]+=i.A_,this.sO[t]+=i.p_,this.hO[t]+=i.m_,n=this.eO[t]++}}const r=s-5;if(r>=0&&r0){const i=e.A.Do[s-1];this.tO[t]-=i.I_,this.iO[t]-=i.A_,this.sO[t]-=i.p_,this.hO[t]-=i.m_,n=this.eO[t]--}}}if(s>=1&&s=0&&f=0&&y=1&&c0||y>0){const p=this.Wn[i][s][c],m=this.Wn[i][s+1][c],I=this.Wn[i][s+1][c+1],g=this.Wn[i][s][c+1],E=this.QT[s][c],_=this.QT[s+1][c],C=this.QT[s+1][c+1],T=this.QT[s][c+1];let O=-1,v=-1;if(f>0){const t=256*h/l|0,i=n/a|0;let s=o/a|0;O=e.A.a_(t,i,s);const r=t+A.UT&255;s+=A.BT,s<0?s=0:s>255&&(s=255),v=e.A.a_(r,i,s)}if(i>0){let t=0!==f||this.qT[i][s][c]===w.A.oO;y>0&&!e.A.Do[y-1].w_&&(t=!1),t&&p===m&&p===I&&p===g&&(this.nO[i][s][c]|=2340)}let b=0;if(-1!==O&&(b=r.A.palette[e.A.c_(v,96)]),0===y)t?.lO(i,s,c,w.A.oO,u.A.Pd,-1,p,m,I,g,e.A.c_(O,E),e.A.c_(O,_),e.A.c_(O,C),e.A.c_(O,T),d.A.Zl,d.A.Zl,d.A.Zl,d.A.Zl,b,d.A.Zl);else{const h=this.qT[i][s][c]+1,n=this.$T[i][s][c],o=e.A.Do[y-1];let l,a,f=o.texture;f>=0?(a=r.A.aO(f),l=-1):o.u_===d.A.Fc?(a=0,l=-2,f=-1):(l=e.A.a_(o.y_,o.A_,o.p_),a=r.A.palette[e.A.f_(o.g_,96)]),t?.lO(i,s,c,h,n,f,p,m,I,g,e.A.c_(O,E),e.A.c_(O,_),e.A.c_(O,C),e.A.c_(O,T),e.A.f_(l,E),e.A.f_(l,_),e.A.f_(l,C),e.A.f_(l,T),b,a)}}}}}}for(let s=1;s0&&(t<<=3,i<<=3,s<<=3);for(let h=0;h<=e;h++)for(let n=0;n<=this.KI;n++)for(let r=0;r<=this.VI;r++){if(this.nO[h][r][n]&t){let i=n,s=n,l=h,a=h;for(;i>0&&this.nO[h][r][i-1]&t;)i--;for(;s0;){for(let h=i;h<=s;h++)if(!(this.nO[l-1][r][h]&t))break t;l--}t:for(;a=8){const h=this.Wn[a][r][i]-240,n=this.Wn[l][r][i];o.A.dO(e,1,128*r,h,128*i,128*r,n,128*s+128);for(let h=l;h<=a;h++)for(let e=i;e<=s;e++)this.nO[h][r][e]&=~t}}if(this.nO[h][r][n]&i){let t=r,s=r,l=h,a=h;for(;t>0&&this.nO[h][t-1][n]&i;)t--;for(;s0;){for(let h=t;h<=s;h++)if(!(this.nO[l-1][h][n]&i))break t;l--}t:for(;a=8){const h=this.Wn[a][t][n]-240,r=this.Wn[l][t][n];o.A.dO(e,2,128*t,h,128*n,128*s+128,r,128*n);for(let h=l;h<=a;h++)for(let e=t;e<=s;e++)this.nO[h][e][n]&=~i}}if(this.nO[h][r][n]&s){let t=r,i=r,l=n,a=n;for(;l>0&&this.nO[h][r][l-1]&s;)l--;for(;a0;){for(let i=l;i<=a;i++)if(!(this.nO[h][t-1][i]&s))break t;t--}t:for(;i=4){const n=this.Wn[h][t][l];o.A.dO(e,4,128*t,n,128*l,128*i+128,n,128*a+128);for(let e=t;e<=i;e++)for(let t=l;t<=a;t++)this.nO[h][e][t]&=~s}}}}}};Zp=(t,i,s,n)=>{let r=0;for(let t=0;t>24;break}for(let e=t;e=0&&t=0&&e{const o=new n.A(new Uint8Array(r));for(let n=0;n=0&&a=0&&c>24,this.$T[n][a][c]=(f-2&3)<<24>>24):f<=81?this.Yn[n][a][c]=f-49<<24>>24:this.zT[n][a][c]=f-81<<24>>24}else for(;f=o.cA,0!==f;){if(1===f){o.cA;break}f<=49&&o.cA}}};qp=(t,i,s,e,r,o)=>{const l=new n.A(new Uint8Array(e));let a=-1;for(;;){const e=l.wO;if(0===e)return;a+=e;let n=0;for(;;){const e=l.wO;if(0===e)break;n+=e-1;const c=63&n,f=n>>6&63,u=n>>12,d=l.cA,w=d>>2,y=3&d,A=f+r,p=c+o;if(A>0&&p>0&&A=0&&(e=s[h]),this.Vy(u,A,p,t,i,e,a,w,y)}}}};Vy=(t,i,s,h,e,n,r,o,d)=>{if(A.st){if(16&this.Yn[t][i][s])return;if(this.rO(t,i,s)!==A.Vp)return}const w=this.Wn[t][i][s],y=this.Wn[t][i+1][s],p=this.Wn[t][i+1][s+1],m=this.Wn[t][i][s+1],I=w+y+p+m>>2,g=l.A.get(r);let E=i+(s<<7)+(r<<14)+1073741824|0;g.active||(E+=-2147483648),E|=0;const _=(d<<6)+o<<24>>24;if(o===f.A.Cy.id)(!A.st||g.active||g.K_)&&(h?.XT(g.ma(f.A.Cy.id,d,w,y,p,m,-1),t,i,s,I,E,_),g.qy&&g.active&&n?.mT(i,s),-1!==g.Il&&e.yg(new a.A(r,t,3,i,s,c.A.Do[g.Il],!0)));else if(o===f.A.Ey.id||o===f.A._y.id){const l=g.ma(f.A.Ey.id,d,w,y,p,m,-1);if(l){let e,n,r=0;if(o===f.A._y.id&&(r+=256),d===u.A.Fd||d===u.A.Bd?(e=g.length,n=g.width):(e=g.width,n=g.length),h?.Vy(t,i,s,I,l,null,E,_,e,n,r)&&g.U_)for(let h=0;h<=e;h++)for(let e=0;e<=n;e++){let n=l.yO/4|0;n>30&&(n=30),n>this.JT[t][i+h][s+e]&&(this.JT[t][i+h][s+e]=n<<24>>24)}}g.qy&&n?.Vy(i,s,g.width,g.length,d,g.$y),-1!==g.Il&&e.yg(new a.A(r,t,2,i,s,c.A.Do[g.Il],!0))}else if(o>=f.A.TT.id)h?.Vy(t,i,s,I,g.ma(o,d,w,y,p,m,-1),null,E,_,1,1,0),o>=f.A.TT.id&&o<=f.A.RT.id&&o!==f.A.OT.id&&t>0&&(this.nO[t][i][s]|=2340),g.qy&&n?.Vy(i,s,g.width,g.length,d,g.$y),-1!==g.Il&&e.yg(new a.A(r,t,2,i,s,c.A.Do[g.Il],!0));else if(o===f.A.Dd.id)h?.IT(t,i,s,I,A.DT[d],0,g.ma(f.A.Dd.id,d,w,y,p,m,-1),null,E,_),d===u.A.Pd?(g.U_&&(this.JT[t][i][s]=50,this.JT[t][i][s+1]=50),g.w_&&(this.nO[t][i][s]|=585)):d===u.A.Fd?(g.U_&&(this.JT[t][i][s+1]=50,this.JT[t][i+1][s+1]=50),g.w_&&(this.nO[t][i][s+1]|=1170)):d===u.A.Ud?(g.U_&&(this.JT[t][i+1][s]=50,this.JT[t][i+1][s+1]=50),g.w_&&(this.nO[t][i+1][s]|=585)):d===u.A.Bd&&(g.U_&&(this.JT[t][i][s]=50,this.JT[t][i+1][s]=50),g.w_&&(this.nO[t][i][s]|=1170)),g.qy&&n?.IT(i,s,o,d,g.$y),-1!==g.Il&&e.yg(new a.A(r,t,0,i,s,c.A.Do[g.Il],!0)),16!==g.D_&&h?.AO(t,i,s,g.D_);else if(o===f.A.gT.id)h?.IT(t,i,s,I,A.NT[d],0,g.ma(f.A.gT.id,d,w,y,p,m,-1),null,E,_),g.U_&&(d===u.A.Pd?this.JT[t][i][s+1]=50:d===u.A.Fd?this.JT[t][i+1][s+1]=50:d===u.A.Ud?this.JT[t][i+1][s]=50:d===u.A.Bd&&(this.JT[t][i][s]=50)),g.qy&&n?.IT(i,s,o,d,g.$y),-1!==g.Il&&e.yg(new a.A(r,t,0,i,s,c.A.Do[g.Il],!0));else if(o===f.A.Nd.id){const l=d+1&3;h?.IT(t,i,s,I,A.DT[d],A.DT[l],g.ma(f.A.Nd.id,d+4,w,y,p,m,-1),g.ma(f.A.Nd.id,l,w,y,p,m,-1),E,_),g.w_&&(d===u.A.Pd?(this.nO[t][i][s]|=265,this.nO[t][i][s+1]|=1170):d===u.A.Fd?(this.nO[t][i][s+1]|=1170,this.nO[t][i+1][s]|=585):d===u.A.Ud?(this.nO[t][i+1][s]|=585,this.nO[t][i][s]|=1170):d===u.A.Bd&&(this.nO[t][i][s]|=1170,this.nO[t][i][s]|=585)),g.qy&&n?.IT(i,s,o,d,g.$y),-1!==g.Il&&e.yg(new a.A(r,t,0,i,s,c.A.Do[g.Il],!0)),16!==g.D_&&h?.AO(t,i,s,g.D_)}else if(o===f.A.Gd.id)h?.IT(t,i,s,I,A.NT[d],0,g.ma(f.A.Gd.id,d,w,y,p,m,-1),null,E,_),g.U_&&(d===u.A.Pd?this.JT[t][i][s+1]=50:d===u.A.Fd?this.JT[t][i+1][s+1]=50:d===u.A.Ud?this.JT[t][i+1][s]=50:d===u.A.Bd&&(this.JT[t][i][s]=50)),g.qy&&n?.IT(i,s,o,d,g.$y),-1!==g.Il&&e.yg(new a.A(r,t,0,i,s,c.A.Do[g.Il],!0));else if(o===f.A.Wd.id)h?.Vy(t,i,s,I,g.ma(o,d,w,y,p,m,-1),null,E,_,1,1,0),g.qy&&n?.Vy(i,s,g.width,g.length,d,g.$y),-1!==g.Il&&e.yg(new a.A(r,t,2,i,s,c.A.Do[g.Il],!0));else if(o===f.A.tg.id)h?.jT(t,i,s,I,0,0,E,g.ma(f.A.tg.id,u.A.Pd,w,y,p,m,-1),_,512*d,A.DT[d]),-1!==g.Il&&e.yg(new a.A(r,t,1,i,s,c.A.Do[g.Il],!0));else if(o===f.A.km.id){let n=16;if(h){const e=h.Md(t,i,s);e>0&&(n=l.A.get(e>>14&32767).D_)}h?.jT(t,i,s,I,A.PT[d]*n,A.FT[d]*n,E,g.ma(f.A.tg.id,u.A.Pd,w,y,p,m,-1),_,512*d,A.DT[d]),-1!==g.Il&&e.yg(new a.A(r,t,1,i,s,c.A.Do[g.Il],!0))}else o===f.A.ET.id?(h?.jT(t,i,s,I,0,0,E,g.ma(f.A.tg.id,u.A.Pd,w,y,p,m,-1),_,d,256),-1!==g.Il&&e.yg(new a.A(r,t,1,i,s,c.A.Do[g.Il],!0))):o===f.A._T.id?(h?.jT(t,i,s,I,0,0,E,g.ma(f.A.tg.id,u.A.Pd,w,y,p,m,-1),_,d,512),-1!==g.Il&&e.yg(new a.A(r,t,1,i,s,c.A.Do[g.Il],!0))):o===f.A.CT.id&&(h?.jT(t,i,s,I,0,0,E,g.ma(f.A.tg.id,u.A.Pd,w,y,p,m,-1),_,d,768),-1!==g.Il&&e.yg(new a.A(r,t,1,i,s,c.A.Do[g.Il],!0)))};rO=(t,i,s)=>8&this.Yn[t][i][s]?0:t<=0||!(2&this.Yn[1][i][s])?t:t-1}},3045:(t,i,s)=>{s.d(i,{A:()=>I});var h=s(4583),e=s(1161),n=s(3795),r=s(8256),o=s(670),l=s(9222),a=s(6855),c=s(7441),f=s(6666),u=s(5748),d=s(3479),w=s(8950),y=s(2771),A=s(5518),p=s(6169),m=s(3867);class I{static pO=new m.mO(8,32,51,51,!1);static IO=new m.ds(100,null);static hd=new Int32Array(o.A.xn);static gO=new m.EO(o.A.xn,500,null);static _O=new m.ds(500,null);static CO=new f.A;static tu=0;static TO=0;static OO=0;static vO=0;static bO=0;static LO=0;static RO=0;static SO=0;static MO=0;static kO=0;static xO=0;static DO=0;static NO=0;static PO=0;static FO=0;static UO=0;static BO=0;static GO=0;static HO=0;static WO=0;static ed=0;static YO=0;static VO=!1;static KO=null;static XO=Uint8Array.of(19,55,38,155,255,110,137,205,76);static jO=Uint8Array.of(160,192,80,96,0,144,80,48,160);static zO=Uint8Array.of(76,8,137,4,0,1,38,2,19);static ZO=Int8Array.of(0,0,2,0,0,2,1,1,0);static qO=Int8Array.of(2,0,0,2,0,0,0,4,4);static $O=Int8Array.of(0,4,4,8,0,0,8,0,0);static JO=Int8Array.of(1,1,0,0,0,8,0,0,8);static QO=Int8Array.of(53,-53,-53,53);static tv=Int8Array.of(-53,-53,53,53);static iv=Int8Array.of(-45,45,45,-45);static sv=Int8Array.of(45,45,-45,-45);static hv=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static ev=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static nv=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static nd=0;static Yl=0;static Vl=0;static Ef=-1;static _f=-1;static st=!0;static init=(t,i,s,e,n)=>{this.TO=0,this.OO=0,this.vO=t,this.bO=i,this.LO=t/2|0,this.RO=i/2|0;const r=new m.mO(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.SO=h.A.sin[t],this.MO=h.A.cos[t],this.kO=h.A.sin[i],this.xO=h.A.cos[i];const o=(t-128)/32|0,l=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const h=128*t,a=128*i;let c=!1;for(let t=-s;t<=e;t+=128)if(this.rv(h,a,n[o]+t)){c=!0;break}r[o][l][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let s=-25;s<25;s++)for(let h=-25;h<25;h++){let e=!1;t:for(let n=-1;n<=1;n++)for(let o=-1;o<=1;o++){if(r[t][i][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t][(i+1)%31][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t+1][i][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t+1][(i+1)%31][s+n+25+1][h+o+25+1]){e=!0;break t}}this.pO[t][i][s+25][h+25]=e}};static Ro=()=>{this.IO=null,this.hd=null,this.gO=null,this.CO=null,this.pO=null,this._O=null,this.KO=null,console.log('World3D unloaded!')};static dO=(t,i,s,h,e,n,o,l)=>{I.gO[t][I.hd[t]++]=new r.A(s/128|0,n/128|0,e/128|0,l/128|0,i,s,n,e,l,h,o)};static rv=(t,i,s)=>{const h=i*this.kO+t*this.xO>>16,e=i*this.xO-t*this.kO>>16,n=s*this.SO+e*this.MO>>16,r=s*this.MO-e*this.SO>>16;if(n<50||n>3500)return!1;const o=this.LO+((h<<9)/n|0),l=this.RO+((r<<9)/n|0);return o>=this.TO&&o<=this.vO&&l>=this.OO&&l<=this.bO};ov;VI;KI;lv;av;Er;cv;fv;uv;dv=0;wv=0;yv=0;constructor(t,i,s,h){this.ov=s,this.VI=h,this.KI=i,this.av=new m.Cr(s,h,i,null),this.cv=new m.oc(s,h+1,i+1),this.lv=t,this.Er=new m.ds(5e3,null),this.fv=new Int32Array(1e4),this.uv=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.wv=t;for(let i=0;i{const s=this.av[0][t][i];for(let s=0;s<3;s++){this.av[s][t][i]=this.av[s+1][t][i];const h=this.av[s][t][i];h&&h.level--}this.av[0][t][i]||(this.av[0][t][i]=new n.A(0,t,i));const h=this.av[0][t][i];h&&(h.Av=s),this.av[3][t][i]=null};cO=(t,i,s,h)=>{const e=this.av[t][i][s];e&&(e.pv=h)};lO=(t,i,s,h,e,r,o,l,a,c,f,u,w,p,m,I,g,E,_,C)=>{if(h===A.A.oO){for(let h=t;h>=0;h--)this.av[h][i][s]||(this.av[h][i][s]=new n.A(h,i,s));const h=this.av[t][i][s];h&&(h.mv=new d.A(f,u,w,p,-1,_,!1))}else if(h===A.A.Iv){for(let h=t;h>=0;h--)this.av[h][i][s]||(this.av[h][i][s]=new n.A(h,i,s));const h=this.av[t][i][s];h&&(h.mv=new d.A(m,I,g,E,r,C,o===l&&o===a&&o===c))}else{for(let h=t;h>=0;h--)this.av[h][i][s]||(this.av[h][i][s]=new n.A(h,i,s));const d=this.av[t][i][s];d&&(d.gv=new y.A(i,h,I,l,w,e,f,c,C,m,r,E,_,a,g,p,o,s,u))}};XT=(t,i,s,h,e,r,o)=>{this.av[i][s][h]||(this.av[i][s][h]=new n.A(i,s,h));const a=this.av[i][s][h];a&&(a.Ev=new l.A(e,128*s+64,128*h+64,t,r,o))};tA=(t,i,s)=>{const h=this.av[t][i][s];h&&(h.Ev=null)};Yy=(t,i,s,h,e,r,o,l)=>{let a=0;const c=this.av[h][t][i];if(c)for(let t=0;ta&&(a=s)}else this.av[h][t][i]=new n.A(h,t,i);const f=this.av[h][t][i];f&&(f.Tv=new u.A(s,128*t+64,128*i+64,r,o,l,e,a))};By=(t,i,s)=>{const h=this.av[t][i][s];h&&(h.Tv=null)};IT=(t,i,s,h,e,r,o,l,c,f)=>{if(!o&&!l)return;for(let h=t;h>=0;h--)this.av[h][i][s]||(this.av[h][i][s]=new n.A(h,i,s));const u=this.av[t][i][s];u&&(u.Ov=new a.A(h,128*i+64,128*s+64,e,r,o,l,c,f))};Zy=(t,i,s,h)=>{const e=this.av[t][i][s];1===h&&e&&(e.Ov=null)};jT=(t,i,s,h,e,r,o,l,a,f,u)=>{if(!l)return;for(let h=t;h>=0;h--)this.av[h][i][s]||(this.av[h][i][s]=new n.A(h,i,s));const d=this.av[t][i][s];d&&(d.vv=new c.A(h,128*i+e+64,128*s+r+64,u,f,l,o,a))};Jy=(t,i,s)=>{const h=this.av[t][i][s];h&&(h.vv=null)};AO=(t,i,s,h)=>{const e=this.av[t][i][s];if(!e)return;const n=e.vv;if(!n)return;const r=128*i+64,o=128*s+64;n.x=r+((n.x-r)*h/16|0),n.z=o+((n.z-o)*h/16|0)};QI=(t,i,s,h)=>{if(!h)return;const e=this.av[t][i][s];if(!e)return;const n=e.vv;n&&(n.model=h)};hg=(t,i,s,h)=>{if(!h)return;const e=this.av[t][i][s];if(!e)return;const n=e.Ev;n&&(n.model=h)};sg=(t,i,s,h)=>{if(!h)return;const e=this.av[t][i][s];if(!e)return;const n=e.Ov;n&&(n.bv=h)};ig=(t,i,s,h,e)=>{if(!h)return;const n=this.av[s][t][i];if(!n)return;const r=n.Ov;r&&(r.bv=h,r.Lv=e)};Vy=(t,i,s,h,e,n,r,o,l,a,c)=>{if(!e&&!n)return!0;const f=128*i+64*l,u=128*s+64*a;return this.Rv(f,u,h,t,i,s,l,a,e,n,r,o,c,!1)};UI=(t,i,s,h,e,n,r,o,l,a)=>{if(!e&&!n)return!0;let c=i-l,f=h-l,u=i+l,d=h+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Rv(i,h,s,t,c,f,u+1-c,d-f+1,e,n,r,0,o,!0)};HI=(t,i,s,h,e,n,r,o,l,a,c,f)=>!l&&!a||this.Rv(i,h,s,t,e,n,r+1-e,o-n+1,l,a,c,0,f,!0);Qy=(t,i,s)=>{const h=this.av[t][i][s];if(h)for(let t=0;t>29&3)&&e.Mv===i&&e.kv===s)return void this.xv(e)}};JI=(t,i,s,h)=>{if(!h)return;const e=this.av[t][i][s];if(e)for(let t=0;t>29&3))return void(i.model=h)}};hu=()=>{for(let t=0;t{const h=this.av[t][i][s];return h&&h.Ov?h.Ov.Sv:0};jy=(t,i,s)=>{const h=this.av[t][s][i];return h&&h.vv?h.vv.Sv:0};Hd=(t,i,s)=>{const h=this.av[t][i][s];if(!h)return 0;for(let t=0;t>29&3)&&e.Mv===i&&e.kv===s)return e.Sv}return 0};Od=(t,i,s)=>{const h=this.av[t][i][s];return h&&h.Ev?h.Ev.Sv:0};kd=(t,i,s,h)=>{const e=this.av[t][i][s];if(e){if(e.Ov&&e.Ov.Sv===h)return 255&e.Ov.info;if(e.vv&&e.vv.Sv===h)return 255&e.vv.info;if(e.Ev&&e.Ev.Sv===h)return 255&e.Ev.info;for(let t=0;t{const n=i*(0|Math.sqrt(s*s+h*h+e*e))>>8;for(let i=0;i{if(i0){const e=this.av[t][i+1][s-1];e&&e.Ev&&e.Ev.model&&e.Ev.model.Dv&&this.Pv(h,e.Ev.model,128,0,-128,!0)}};Nv=(t,i,s,h,e,n)=>{let r=!0,o=i;const l=i+h,a=s-1,c=s+e;for(let f=t;f<=t+1;f++)if(f!==this.ov){for(let u=o;u<=l;u++)if(!(u<0||u>=this.VI))for(let o=a;o<=c;o++){if(o<0||o>=this.KI||r&&u=s||u===i))continue;const a=this.av[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-h),w=128*(o-s)+64*(1-e),y=((this.lv[f][u][o]+this.lv[f][u+1][o]+this.lv[f][u][o+1]+this.lv[f][u+1][o+1])/4|0)-((this.lv[t][i][s]+this.lv[t][i+1][s]+this.lv[t][i][s+1]+this.lv[t][i+1][s+1])/4|0),A=a.Ov;A&&A.bv&&A.bv.Dv&&this.Pv(n,A.bv,d,y,w,r),A&&A.Lv&&A.Lv.Dv&&this.Pv(n,A.Lv,d,y,w,r);for(let t=0;t{this.yv++;let r=0;const o=i.z_,l=i.j_;if(t.Dv&&t.Hv)for(let n=0;ni.Wv)continue;const u=t.z_[n]-s;if(ui.Vv)continue;const d=t.Z_[n]-e;if(di.Xv)continue;if(i.Dv&&i.Hv)for(let t=0;t{const r=this.av[t][i][s];if(!r)return;const o=r.mv;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)h[e]=t,h[e+1]=t,h[e+2]=t,h[e+3]=t,e+=n;return}const l=r.gv;if(!l)return;const a=l.shape,c=l.angle,f=l.Jv,u=l.Qv,d=I.hv[a],w=I.ev[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(h[e]=u),0!==d[w[y++]]&&(h[e+1]=u),0!==d[w[y++]]&&(h[e+2]=u),0!==d[w[y++]]&&(h[e+3]=u),e+=n;else for(let t=0;t<4;t++)h[e]=0===d[w[y++]]?f:u,h[e+1]=0===d[w[y++]]?f:u,h[e+2]=0===d[w[y++]]?f:u,h[e+3]=0===d[w[y++]]?f:u,e+=n};click=(t,i)=>{I.VO=!0,I.Yl=t,I.Vl=i,I.Ef=-1,I._f=-1};draw=(t,i,s,e,n,r,o)=>{t<0?t=0:t>=128*this.VI&&(t=128*this.VI-1),s<0?s=0:s>=128*this.KI&&(s=128*this.KI-1),I.tu++,I.SO=h.A.sin[r],I.MO=h.A.cos[r],I.kO=h.A.sin[n],I.xO=h.A.cos[n],I.KO=I.pO[(r-128)/32|0][n/64|0],I.DO=t,I.NO=i,I.PO=s,I.FO=t/128|0,I.UO=s/128|0,I.ed=e,I.BO=I.FO-25,I.BO<0&&(I.BO=0),I.HO=I.UO-25,I.HO<0&&(I.HO=0),I.GO=I.FO+25,I.GO>this.VI&&(I.GO=this.VI),I.WO=I.UO+25,I.WO>this.KI&&(I.WO=this.KI),this.tb(),I.YO=0;for(let t=this.wv;t=2e3)?(r.visible=!0,r.update=!0,r.ib=r._v>0,I.YO++):(r.visible=!1,r.update=!1,r.sb=0))}}for(let t=this.wv;t=I.GO))for(let t=-25;t<=0;t++){const e=I.UO+t,n=I.UO-t;let r;if(s>=I.BO&&(e>=I.HO&&(r=i[s][e],r&&r.visible&&this.hb(r,!0,o)),n=I.HO&&(r=i[h][e],r&&r.visible&&this.hb(r,!0,o)),n=I.GO))for(let t=-25;t<=0;t++){const e=I.UO+t,n=I.UO-t;let r;if(s>=I.BO&&(e>=I.HO&&(r=i[s][e],r&&r.visible&&this.hb(r,!1,o)),n=I.HO&&(r=i[h][e],r&&r.visible&&this.hb(r,!1,o)),n{if(!c&&!f)return!1;for(let t=r;t=this.VI||i>=this.KI)return!1;const s=this.av[h][t][i];if(s&&s._v>=5)return!1}const A=new e.A(h,s,t,i,c,f,w,r,r+l-1,o,o+a-1,u,d);for(let t=r;tr&&(s|=1),to&&(s+=8),i=0;s--)this.av[s][t][i]||(this.av[s][t][i]=new n.A(s,t,i));const e=this.av[h][t][i];e&&(e.Cv[e._v]=A,e.eb[e._v]=s,e.nb|=s,e._v++)}return y&&(this.Er[this.dv++]=A),!0};xv=t=>{for(let i=t.Mv;i<=t.Uv;i++)for(let s=t.kv;s<=t.Bv;s++){const h=this.av[t.level][i][s];if(h){for(let i=0;i{const t=I.hd[I.ed],i=I.gO[I.ed];I.nd=0;for(let s=0;s=0&&h<=50){e=t.YI+25-I.UO,e<0&&(e=0),n=t.KI+25-I.UO,n>50&&(n=50);let i=!1;for(;e<=n;)if(I.KO&&I.KO[h][e++]){i=!0;break}if(i){if(r=I.DO-t.Yv,r>32)t.mode=1;else{if(r>=-32)continue;t.mode=2,r=-r}t.rb=(t.Kv-I.PO<<8)/r|0,t.ob=(t.Xv-I.PO<<8)/r|0,t.lb=(t.Wv-I.NO<<8)/r|0,t.ab=(t.eC-I.NO<<8)/r|0,I._O[I.nd++]=t}}}else if(2===t.type){if(h=t.YI+25-I.UO,h>=0&&h<=50){e=t.WI+25-I.FO,e<0&&(e=0),n=t.VI+25-I.FO,n>50&&(n=50);let i=!1;for(;e<=n;)if(I.KO&&I.KO[e++][h]){i=!0;break}if(i){if(r=I.PO-t.Kv,r>32)t.mode=3;else{if(r>=-32)continue;t.mode=4,r=-r}t.cb=(t.Yv-I.DO<<8)/r|0,t.fb=(t.Vv-I.DO<<8)/r|0,t.lb=(t.Wv-I.NO<<8)/r|0,t.ab=(t.eC-I.NO<<8)/r|0,I._O[I.nd++]=t}}}else if(4===t.type&&(h=t.Wv-I.NO,h>128&&(e=t.YI+25-I.UO,e<0&&(e=0),n=t.KI+25-I.UO,n>50&&(n=50),e<=n))){let i=t.WI+25-I.FO;i<0&&(i=0),r=t.VI+25-I.FO,r>50&&(r=50);let s=!1;t:for(let t=i;t<=r;t++)for(let i=e;i<=n;i++)if(I.KO&&I.KO[t][i]){s=!0;break t}s&&(t.mode=5,t.cb=(t.Yv-I.DO<<8)/h|0,t.fb=(t.Vv-I.DO<<8)/h|0,t.rb=(t.Kv-I.PO<<8)/h|0,t.ob=(t.Xv-I.PO<<8)/h|0,I._O[I.nd++]=t)}}};hb=(t,i,s)=>{for(I.CO.yg(t);;){let t;do{if(t=I.CO.ub(),!t)return}while(!t.update);const h=t.x,e=t.z,n=t.level,r=t.wb,o=this.av[n];if(t.visible){if(i){if(n>0){const t=this.av[n-1][h][e];if(t&&t.update)continue}if(h<=I.FO&&h>I.BO){const i=o[h-1][e];if(i&&i.update&&(i.visible||!(1&t.nb)))continue}if(h>=I.FO&&hI.HO){const i=o[h][e-1];if(i&&i.update&&(i.visible||!(8&t.nb)))continue}if(e>=I.UO&&ee&&(a+=6),c=I.XO[a],t.Ib=I.zO[a]),f&&(f.gb&I.jO[a]?16===f.gb?(t.sb=3,t.Eb=I.ZO[a],t._b=3-t.Eb):32===f.gb?(t.sb=6,t.Eb=I.qO[a],t._b=6-t.Eb):64===f.gb?(t.sb=12,t.Eb=I.$O[a],t._b=12-t.Eb):(t.sb=9,t.Eb=I.JO[a],t._b=9-t.Eb):t.sb=0,f.gb&c&&!this.Cb(r,h,e,f.gb)&&f.bv?.draw(0,I.SO,I.MO,I.kO,I.xO,f.x-I.DO,f.y-I.NO,f.z-I.PO,f.Sv),f.Tb&c&&!this.Cb(r,h,e,f.Tb)&&f.Lv?.draw(0,I.SO,I.MO,I.kO,I.xO,f.x-I.DO,f.y-I.NO,f.z-I.PO,f.Sv)),u&&!this.visible(r,h,e,u.model.eC))if(u.type&c)u.model.draw(u.angle,I.SO,I.MO,I.kO,I.xO,u.x-I.DO,u.y-I.NO,u.z-I.PO,u.Sv);else if(768&u.type){const t=u.x-I.DO,i=u.y-I.NO,s=u.z-I.PO,h=u.angle;let e,n;if(e=h===p.A.Fd||h===p.A.Ud?-t:t,n=h===p.A.Ud||h===p.A.Bd?-s:s,256&u.type&&ne){const e=t+I.iv[h],n=s+I.sv[h];u.model.draw(512*h+1280&2047,I.SO,I.MO,I.kO,I.xO,e,i,n,u.Sv)}}if(l){const i=t.Ev;i&&i.model?.draw(0,I.SO,I.MO,I.kO,I.xO,i.x-I.DO,i.y-I.NO,i.z-I.PO,i.Sv);const s=t.Tv;s&&0===s.offset&&(s.Ob&&s.Ob.draw(0,I.SO,I.MO,I.kO,I.xO,s.x-I.DO,s.y-I.NO,s.z-I.PO,s.Sv),s.vb&&s.vb.draw(0,I.SO,I.MO,I.kO,I.xO,s.x-I.DO,s.y-I.NO,s.z-I.PO,s.Sv),s.bb&&s.bb.draw(0,I.SO,I.MO,I.kO,I.xO,s.x-I.DO,s.y-I.NO,s.z-I.PO,s.Sv))}const d=t.nb;if(0!==d){if(hI.FO&&1&d){const t=o[h-1][e];t&&t.update&&I.CO.yg(t)}if(e>I.UO&&8&d){const t=o[h][e-1];t&&t.update&&I.CO.yg(t)}}}if(0!==t.sb){let i=!0;for(let s=0;si.Mv&&(n+=1),si.kv&&(n+=8),hh&&(h=e);const r=I.UO-i.kv,l=i.Bv-I.UO;i.Lb=l>r?h+l:h+r}for(;;){let t=-50,i=-1;for(let s=0;st&&(t=h.Lb,i=s))}if(-1===i)break;const l=I.IO[i];if(l){l.tu=I.tu;let t=l.model;t||(t=l.mb?.draw(s)??null),t&&!this.Rb(r,l.Mv,l.Uv,l.kv,l.Bv,t.eC)&&t.draw(l.BI,I.SO,I.MO,I.kO,I.xO,l.x-I.DO,l.y-I.NO,l.z-I.PO,l.Sv);for(let t=l.Mv;t<=l.Uv;t++)for(let i=l.kv;i<=l.Bv;i++){const s=o[t][i];s&&(0!==s.sb?I.CO.yg(s):t===h&&i===e||!s.update||I.CO.yg(s))}}}if(t.ib)continue}if(!t.update||0!==t.sb)continue;if(h<=I.FO&&h>I.BO){const t=o[h-1][e];if(t&&t.update)continue}if(h>=I.FO&&hI.HO){const t=o[h][e-1];if(t&&t.update)continue}if(e>=I.UO&&e=n){const n=t+I.QO[e],r=h+I.tv[e];i.model.draw(512*e+256,I.SO,I.MO,I.kO,I.xO,n,s,r,i.Sv)}if(512&i.type&&r<=n){const n=t+I.iv[e],r=h+I.sv[e];i.model.draw(512*e+1280&2047,I.SO,I.MO,I.kO,I.xO,n,s,r,i.Sv)}}const s=t.Ov;s&&(s.Tb&t.Ib&&!this.Cb(r,h,e,s.Tb)&&s.Lv?.draw(0,I.SO,I.MO,I.kO,I.xO,s.x-I.DO,s.y-I.NO,s.z-I.PO,s.Sv),s.gb&t.Ib&&!this.Cb(r,h,e,s.gb)&&s.bv?.draw(0,I.SO,I.MO,I.kO,I.xO,s.x-I.DO,s.y-I.NO,s.z-I.PO,s.Sv))}if(nI.FO){const t=o[h-1][e];t&&t.update&&I.CO.yg(t)}if(e>I.UO){const t=o[h][e-1];t&&t.update&&I.CO.yg(t)}}};Ab=(t,i,s,e,n,r,o,l)=>{let a,c,f,u,d=a=(s<<7)-I.DO,y=c=(e<<7)-I.PO,A=f=d+128,p=u=y+128,m=this.lv[i][s][e]-I.NO,g=this.lv[i][s+1][e]-I.NO,E=this.lv[i][s+1][e+1]-I.NO,_=this.lv[i][s][e+1]-I.NO,C=y*o+d*l>>16;if(y=y*l-d*o>>16,d=C,C=m*r-y*n>>16,y=m*n+y*r>>16,m=C,y<50)return;if(C=c*o+A*l>>16,c=c*l-A*o>>16,A=C,C=g*r-c*n>>16,c=g*n+c*r>>16,g=C,c<50)return;if(C=p*o+f*l>>16,p=p*l-f*o>>16,f=C,C=E*r-p*n>>16,p=E*n+p*r>>16,E=C,p<50)return;if(C=u*o+a*l>>16,u=u*l-a*o>>16,a=C,C=_*r-u*n>>16,u=_*n+u*r>>16,_=C,u<50)return;const T=h.A.ya+((d<<9)/y|0),O=h.A.Aa+((m<<9)/y|0),v=h.A.ya+((A<<9)/c|0),b=h.A.Aa+((g<<9)/c|0),L=h.A.ya+((f<<9)/p|0),R=h.A.Aa+((E<<9)/p|0),S=h.A.ya+((a<<9)/u|0),M=h.A.Aa+((_<<9)/u|0);if(h.A.alpha=0,(L-S)*(b-M)-(R-M)*(v-S)>0)if(h.A.Sb=L<0||S<0||v<0||L>w.A.Mb||S>w.A.Mb||v>w.A.Mb,I.VO&&this.kb(I.Yl,I.Vl,R,M,b,L,S,v)&&(I.Ef=s,I._f=e),-1===t.xb)12345678!==t.Db&&h.A.Nb(L,S,v,R,M,b,t.Db,t.Pb,t.Fb);else if(I.st){const i=I.nv[t.xb];h.A.Nb(L,S,v,R,M,b,this.Ub(i,t.Db),this.Ub(i,t.Pb),this.Ub(i,t.Fb))}else t.flat?h.A.Bb(L,S,v,R,M,b,t.Db,t.Pb,t.Fb,d,m,y,A,a,g,_,c,u,t.xb):h.A.Bb(L,S,v,R,M,b,t.Db,t.Pb,t.Fb,f,E,p,a,A,_,g,u,c,t.xb);if(!((T-v)*(M-b)-(O-b)*(S-v)<=0))if(h.A.Sb=T<0||v<0||S<0||T>w.A.Mb||v>w.A.Mb||S>w.A.Mb,I.VO&&this.kb(I.Yl,I.Vl,O,b,M,T,v,S)&&(I.Ef=s,I._f=e),-1!==t.xb){if(!I.st)return void h.A.Bb(T,v,S,O,b,M,t.Gb,t.Fb,t.Pb,d,m,y,A,a,g,_,c,u,t.xb);const i=I.nv[t.xb];h.A.Nb(T,v,S,O,b,M,this.Ub(i,t.Gb),this.Ub(i,t.Fb),this.Ub(i,t.Pb))}else 12345678!==t.Gb&&h.A.Nb(T,v,S,O,b,M,t.Gb,t.Fb,t.Pb)};pb=(t,i,s,e,n,r,o)=>{let l=s.z_.length;for(let t=0;t>16;if(a=a*o-i*r>>16,i=c,c=l*n-a*e>>16,a=l*e+a*n>>16,l=c,a<50)return;s.Hb&&(y.A.Wb[t]=i,y.A.Yb[t]=l,y.A.Vb[t]=a),y.A.Kb[t]=h.A.ya+((i<<9)/a|0),y.A.Xb[t]=h.A.Aa+((l<<9)/a|0)}h.A.alpha=0,l=s.jb.length;for(let e=0;e0)if(h.A.Sb=l<0||a<0||c<0||l>w.A.Mb||a>w.A.Mb||c>w.A.Mb,I.VO&&this.kb(I.Yl,I.Vl,f,u,d,l,a,c)&&(I.Ef=t,I._f=i),s.Hb&&-1!==s.Hb[e])if(I.st){const t=I.nv[s.Hb[e]];h.A.Nb(l,a,c,f,u,d,this.Ub(t,s.qb[e]),this.Ub(t,s.$b[e]),this.Ub(t,s.Jb[e]))}else s.flat?h.A.Bb(l,a,c,f,u,d,s.qb[e],s.$b[e],s.Jb[e],y.A.Wb[0],y.A.Yb[0],y.A.Vb[0],y.A.Wb[1],y.A.Wb[3],y.A.Yb[1],y.A.Yb[3],y.A.Vb[1],y.A.Vb[3],s.Hb[e]):h.A.Bb(l,a,c,f,u,d,s.qb[e],s.$b[e],s.Jb[e],y.A.Wb[n],y.A.Yb[n],y.A.Vb[n],y.A.Wb[r],y.A.Wb[o],y.A.Yb[r],y.A.Yb[o],y.A.Vb[r],y.A.Vb[o],s.Hb[e]);else 12345678!==s.qb[e]&&h.A.Nb(l,a,c,f,u,d,s.qb[e],s.$b[e],s.Jb[e])}};yb=(t,i,s)=>{const h=this.cv[t][i][s];if(h===-I.tu)return!1;if(h===I.tu)return!0;{const h=i<<7,e=s<<7;return this.Qb(h+1,this.lv[t][i][s],e+1)&&this.Qb(h+128-1,this.lv[t][i+1][s],e+1)&&this.Qb(h+128-1,this.lv[t][i+1][s+1],e+128-1)&&this.Qb(h+1,this.lv[t][i][s+1],e+128-1)?(this.cv[t][i][s]=I.tu,!0):(this.cv[t][i][s]=-I.tu,!1)}};Cb=(t,i,s,h)=>{if(!this.yb(t,i,s))return!1;const e=i<<7,n=s<<7,r=this.lv[t][i][s]-1,o=r-120,l=r-230,a=r-238;if(h<16){if(1===h){if(e>I.DO){if(!this.Qb(e,r,n))return!1;if(!this.Qb(e,r,n+128))return!1}if(t>0){if(!this.Qb(e,o,n))return!1;if(!this.Qb(e,o,n+128))return!1}return!!this.Qb(e,l,n)&&this.Qb(e,l,n+128)}if(2===h){if(n0){if(!this.Qb(e,o,n+128))return!1;if(!this.Qb(e+128,o,n+128))return!1}return!!this.Qb(e,l,n+128)&&this.Qb(e+128,l,n+128)}if(4===h){if(e0){if(!this.Qb(e+128,o,n))return!1;if(!this.Qb(e+128,o,n+128))return!1}return!!this.Qb(e+128,l,n)&&this.Qb(e+128,l,n+128)}if(8===h){if(n>I.PO){if(!this.Qb(e,r,n))return!1;if(!this.Qb(e+128,r,n))return!1}if(t>0){if(!this.Qb(e,o,n))return!1;if(!this.Qb(e+128,o,n))return!1}return!!this.Qb(e,l,n)&&this.Qb(e+128,l,n)}}return!!this.Qb(e+64,a,n+64)&&(16===h?this.Qb(e,l,n+128):32===h?this.Qb(e+128,l,n+128):64===h?this.Qb(e+128,l,n):128===h?this.Qb(e,l,n):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,s,h)=>{if(this.yb(t,i,s)){const e=i<<7,n=s<<7;return this.Qb(e+1,this.lv[t][i][s]-h,n+1)&&this.Qb(e+128-1,this.lv[t][i+1][s]-h,n+1)&&this.Qb(e+128-1,this.lv[t][i+1][s+1]-h,n+128-1)&&this.Qb(e+1,this.lv[t][i][s+1]-h,n+128-1)}return!1};Rb=(t,i,s,h,e,n)=>{let r,o;if(i!==s||h!==e){for(r=i;r<=s;r++)for(o=h;o<=e;o++)if(this.cv[t][r][o]===-I.tu)return!1;o=1+(i<<7);const l=2+(h<<7),a=this.lv[t][i][h]-n;if(!this.Qb(o,a,l))return!1;const c=(s<<7)-1;if(!this.Qb(c,a,l))return!1;const f=(e<<7)-1;return!!this.Qb(o,a,f)&&this.Qb(c,a,f)}return!!this.yb(t,i,h)&&(r=i<<7,o=h<<7,this.Qb(r+1,this.lv[t][i][h]-n,o+1)&&this.Qb(r+128-1,this.lv[t][i+1][h]-n,o+1)&&this.Qb(r+128-1,this.lv[t][i+1][h+1]-n,o+128-1)&&this.Qb(r+1,this.lv[t][i][h+1]-n,o+128-1))};Qb=(t,i,s)=>{for(let h=0;h0){const t=e.Kv+(e.rb*h>>8),n=e.Xv+(e.ob*h>>8),r=e.Wv+(e.lb*h>>8),o=e.eC+(e.ab*h>>8);if(s>=t&&s<=n&&i>=r&&i<=o)return!0}}else if(2===e.mode){const h=t-e.Yv;if(h>0){const t=e.Kv+(e.rb*h>>8),n=e.Xv+(e.ob*h>>8),r=e.Wv+(e.lb*h>>8),o=e.eC+(e.ab*h>>8);if(s>=t&&s<=n&&i>=r&&i<=o)return!0}}else if(3===e.mode){const h=e.Kv-s;if(h>0){const s=e.Yv+(e.cb*h>>8),n=e.Vv+(e.fb*h>>8),r=e.Wv+(e.lb*h>>8),o=e.eC+(e.ab*h>>8);if(t>=s&&t<=n&&i>=r&&i<=o)return!0}}else if(4===e.mode){const h=s-e.Kv;if(h>0){const s=e.Yv+(e.cb*h>>8),n=e.Vv+(e.fb*h>>8),r=e.Wv+(e.lb*h>>8),o=e.eC+(e.ab*h>>8);if(t>=s&&t<=n&&i>=r&&i<=o)return!0}}else if(5===e.mode){const h=i-e.Wv;if(h>0){const i=e.Yv+(e.cb*h>>8),n=e.Vv+(e.fb*h>>8),r=e.Kv+(e.rb*h>>8),o=e.Xv+(e.ob*h>>8);if(t>=i&&t<=n&&s>=r&&s<=o)return!0}}}return!1};kb=(t,i,s,h,e,n,r,o)=>{if(is&&i>h&&i>e)return!1;if(tn&&t>r&&t>o)return!1;const l=(i-h)*(o-r)-(t-r)*(e-h);return((i-s)*(r-n)-(t-n)*(h-s))*l>0&&l*((i-e)*(n-o)-(t-o)*(s-e))>0};Ub=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{}},4197:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{tm;$I;Jp;Qp;index;qI;_l;El;constructor(t,i,s,h,e,n,r){super(),this.tm=i,this.$I=s,this.Jp=h,this.Qp=e,this.index=t,this.qI=n,r&&-1!==n.Tl&&this.qI.delay?(this._l=Math.random()*this.qI.Cl|0,this.El=Math.random()*this.qI.delay[this._l]|0):(this._l=-1,this.El=0)}}},8412:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(9418),e=s(8665),n=s(8738),r=s(1312);class o extends h.A{static Du=2;static Pu=4;static Uu=8;static Bu=16;static ju=32;static Vu=64;static Gu=128;type=null;draw(t){if(!this.type)return null;if(-1===this.Ku||-1===this.oI)return this.oC();const i=this.oC();if(!i)return null;const s=n.A.Do[this.Ku],h=e.A.e_(s.ma(),!0,!s.x_,!1);h.translate(-this.nI,0,0),h.Ha(),s.qI&&s.qI.frames&&h.Wa(s.qI.frames[this.oI]),h.tC=null,h.iC=null,128===s.nC&&128===s.rC||h.scale(s.nC,s.rC,s.nC),h.Ya(64+s.N_,850+s.P_,-30,-50,-30,!0);const r=[i,h],o=e.A.tL(r,2);return 1===this.type.size&&(o.fC=!0),o}isVisible(){return null!==this.type}oC(){if(!this.type)return null;if(this.Nu>=0&&0===this.sI){const t=r.A.Do[this.Nu].frames;if(t){const i=t[this.tI];let s=-1;if(this.xI>=0&&this.xI!==this.Ga){const t=r.A.Do[this.xI].frames;t&&(s=t[this.ag])}return this.type.oC(i,s,r.A.Do[this.Nu].ug)}}let t=-1;if(this.xI>=0){const i=r.A.Do[this.xI].frames;i&&(t=i[this.ag])}const i=this.type.oC(t,-1,null);return i?(this.height=i.eC,i):null}}},3606:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{index;count;constructor(t,i){super(),this.index=t,this.count=i}}},9418:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(7121),e=s(1312),n=s(3867);class r extends h.A{x=0;z=0;BI=0;GI=!1;size=1;Ga=-1;og=-1;pI=-1;II=-1;EI=-1;CI=-1;wg=-1;pu=null;_u=100;gu=0;Eu=0;bu=0;vu=0;Cu=-1e3;Tu=0;Ou=0;Fu=-1;hI=0;eI=0;xI=-1;ag=0;lg=0;Nu=-1;tI=0;iI=0;sI=0;Qm=0;Ku=-1;oI=0;lI=0;rI=0;nI=0;aI=0;fI=0;cI=0;uI=0;Lu=0;Ru=0;dI=0;tu=0;height=0;rg=0;pathLength=0;Tf=new Int32Array(10);Of=new Int32Array(10);dg=new n.ds(10,!1);ng=0;Mu=-1;ku=-1;Hu=-1;Wu=-1;move(t,i,s){if(-1!==this.Nu&&e.A.Do[this.Nu].priority<=1&&(this.Nu=-1),!t){const t=i-this.Tf[0],h=s-this.Of[0];if(t>=-8&&t<=8&&h>=-8&&h<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.Tf[t]=this.Tf[t-1],this.Of[t]=this.Of[t-1],this.dg[t]=this.dg[t-1];return this.Tf[0]=i,this.Of[0]=s,void(this.dg[0]=!1)}}this.pathLength=0,this.ng=0,this.Tf[0]=i,this.Of[0]=s,this.x=128*this.Tf[0]+64*this.size,this.z=128*this.Of[0]+64*this.size}step(t,i){let s=this.Tf[0],h=this.Of[0];0===i?(s--,h++):1===i?h++:2===i?(s++,h++):3===i?s--:4===i?s++:5===i?(s--,h--):6===i?h--:7===i&&(s++,h--),-1!==this.Nu&&e.A.Do[this.Nu].priority<=1&&(this.Nu=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.Tf[t]=this.Tf[t-1],this.Of[t]=this.Of[t-1],this.dg[t]=this.dg[t-1];this.Tf[0]=s,this.Of[0]=h,this.dg[0]=t}}},8268:(t,i,s)=>{s.d(i,{A:()=>d});var h=s(9418),e=s(8665),n=s(2679),r=s(8738),o=s(1312),l=s(8317),a=s(1302),c=s(3819),f=s(3867),u=s(9298);class d extends h.A{static xu=1;static Du=2;static Pu=4;static Uu=8;static Bu=16;static Gu=32;static Yu=64;static $m=128;static Vu=256;static Xu=512;static Ba=[u.A.iL,u.A.sL,u.A.hL,u.A.eL,u.A.nL,u.A.rL,u.A.oL,u.A.lL,u.A.aL,u.A.cL,u.A.fL,u.A.uL,u.A.dL,u.A.wL,u.A.yL,u.A.pL];static Ua=[[u.A.mL,u.A.IL,u.A.gL,u.A.EL,u.A._L,u.A.CL,u.A.TL,u.A.OL,u.A.vL,u.A.bL,u.A.LL,u.A.RL],[u.A.SL,u.A.ML,u.A.kL,u.A.xL,u.A.DL,u.A.NL,u.A.PL,u.A.FL,u.A.UL,u.A.BL,u.A.HL,u.A.WL,u.A.YL,u.A.VL,u.A.KL,u.A.XL],[u.A.XL-1,u.A.SL+1,u.A.ML,u.A.kL,u.A.xL,u.A.DL,u.A.NL,u.A.PL,u.A.FL,u.A.UL,u.A.BL,u.A.HL,u.A.WL,u.A.YL,u.A.VL,u.A.KL],[u.A.jL,u.A.zL,u.A.ZL,u.A.qL,u.A.$L,u.A.JL],[u.A.QL,u.A.tR,u.A.iR,u.A.sR,u.A.hR,u.A.eR,u.A.nR,u.A.rR]];static No=new n.A(200);name=null;visible=!1;oR=0;Au=0;lR=new Uint16Array(12);aR=new Uint16Array(5);ic=0;cR=0n;y=0;NI=0;FI=0;Ag=0;mg=0;pg=0;DI=null;WI=0;YI=0;VI=0;KI=0;st=!1;draw(t){if(!this.visible)return null;let i=this.oC();if(this.height=i.eC,i.fC=!0,this.st)return i;if(-1!==this.Ku&&-1!==this.oI){const t=r.A.Do[this.Ku],s=e.A.e_(t.ma(),!0,!t.x_,!1);s.translate(-this.nI,0,0),s.Ha(),t.qI&&t.qI.frames&&s.Wa(t.qI.frames[this.oI]),s.tC=null,s.iC=null,128===t.nC&&128===t.rC||s.scale(t.nC,t.rC,t.nC),s.Ya(t.N_+64,t.P_+850,-30,-50,-30,!0);const h=[i,s];i=e.A.tL(h,2)}if(this.DI&&(t>=this.FI&&(this.DI=null),t>=this.NI&&t=d.Ua[i].length)&&(s=0),this.aR[i]=s}this.Ga=t.rA,65535===this.Ga&&(this.Ga=-1),this.og=t.rA,65535===this.og&&(this.og=-1),this.pI=t.rA,65535===this.pI&&(this.pI=-1),this.II=t.rA,65535===this.II&&(this.II=-1),this.EI=t.rA,65535===this.EI&&(this.EI=-1),this.CI=t.rA,65535===this.CI&&(this.CI=-1),this.wg=t.rA,65535===this.wg&&(this.wg=-1),this.name=c.A.ka(c.A.xa(t.zc)),this.ic=t.cA,this.visible=!0,this.cR=0n;for(let t=0;t<12;t++)this.cR<<=0x4n,this.lR[t]>=256&&(this.cR+=BigInt(this.lR[t])-256n);this.lR[0]>=256&&(this.cR+=BigInt(this.lR[0])-256n>>4n),this.lR[1]>=256&&(this.cR+=BigInt(this.lR[1])-256n>>8n);for(let t=0;t<5;t++)this.cR<<=0x3n,this.cR+=BigInt(this.aR[t]);this.cR<<=0x1n,this.cR+=BigInt(this.oR)}IA(){if(!this.visible)return null;const t=new f.ds(12,null);let i=0;for(let s=0;s<12;s++){const h=this.lR[s];if(h>=256&&h<512&&(t[i++]=l.A.Do[h-256].IA()),h>=512){const s=a.A.get(h-512).IA(this.oR);s&&(t[i++]=s)}}const s=e.A.Pa(t,i);for(let t=0;t<5;t++)0!==this.aR[t]&&(s.Fa(d.Ua[t][0],d.Ua[t][this.aR[t]]),1===t&&s.Fa(d.Ba[0],d.Ba[this.aR[t]]));return s}oC(){let t=this.cR,i=-1,s=-1,h=-1,n=-1;if(this.Nu>=0&&0===this.sI){const e=o.A.Do[this.Nu];if(e.frames&&(i=e.frames[this.tI]),this.xI>=0&&this.xI!==this.Ga){const t=o.A.Do[this.xI].frames;t&&(s=t[this.ag])}e.GC>=0&&(h=e.GC,t+=BigInt(h-this.lR[5])<<8n),e.HC>=0&&(n=e.HC,t+=BigInt(n-this.lR[3])<<16n)}else if(this.xI>=0){const t=o.A.Do[this.xI].frames;t&&(i=t[this.ag])}let r=d.No?.get(t);if(!r){const i=new f.ds(12,null);let s=0;for(let t=0;t<12;t++){let e=this.lR[t];if(n>=0&&3===t&&(e=n),h>=0&&5===t&&(e=h),e>=256&&e<512){const t=l.A.Do[e-256].ma();t&&(i[s++]=t)}if(e>=512){const t=a.A.get(e-512).BC(this.oR);t&&(i[s++]=t)}}r=e.A.Pa(i,s);for(let t=0;t<5;t++)0!==this.aR[t]&&(r.Fa(d.Ua[t][0],d.Ua[t][this.aR[t]]),1===t&&r.Fa(d.Ba[0],d.Ba[this.aR[t]]));r.Ha(),r.Ya(64,850,-30,-50,-30,!0),d.No?.put(t,r)}if(this.st)return r;const c=e.A.lC(r,!0);return-1!==i&&-1!==s?c.aC(i,s,o.A.Do[this.Nu].ug):-1!==i&&c.Wa(i),c.cC(),c.tC=null,c.iC=null,c}}},254:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8738),e=s(7121),n=s(8665);class r extends e.A{fR;level;uR;dR;wR;offsetY;jI;XI;yR;arc;target;mobile=!1;x=0;z=0;y=0;velocityX=0;AR=0;pR=0;velocityY=0;mR=0;BI=0;pitch=0;_l=0;El=0;constructor(t,i,s,e,n,r,o,l,a,c,f){super(),this.fR=h.A.Do[t],this.level=i,this.uR=s,this.dR=n,this.wR=e,this.jI=r,this.XI=o,this.yR=l,this.arc=a,this.target=c,this.offsetY=f}zI(t,i,s,h){if(!this.mobile){const i=t-this.uR,h=s-this.dR,e=Math.sqrt(i*i+h*h);this.x=this.uR+i*this.arc/e,this.z=this.dR+h*this.arc/e,this.y=this.wR}const e=this.XI+1-h;this.velocityX=(t-this.x)/e,this.AR=(s-this.z)/e,this.pR=Math.sqrt(this.velocityX*this.velocityX+this.AR*this.AR),this.mobile||(this.velocityY=-this.pR*Math.tan(.02454369*this.yR)),this.mR=2*(i-this.y-this.velocityY*e)/(e*e)}update(t){if(this.mobile=!0,this.x+=this.velocityX*t,this.z+=this.AR*t,this.y+=this.velocityY*t+.5*this.mR*t*t,this.velocityY+=this.mR*t,this.BI=325.949*Math.atan2(this.velocityX,this.AR)+1024&2047,this.pitch=325.949*Math.atan2(this.velocityY,this.pR)&2047,this.fR.qI&&this.fR.qI.delay)for(this.El+=t;this.El>this.fR.qI.delay[this._l];)this.El-=this.fR.qI.delay[this._l]+1,this._l++,this._l>=this.fR.qI.Cl&&(this._l=0)}draw(){const t=this.fR.ma(),i=n.A.e_(t,!0,!this.fR.x_,!1);return this.fR.qI&&this.fR.qI.frames&&(i.Ha(),i.Wa(this.fR.qI.frames[this._l]),i.tC=null,i.iC=null),128===this.fR.nC&&128===this.fR.rC||i.scale(this.fR.nC,this.fR.rC,this.fR.nC),i.IR(this.pitch),i.Ya(64+this.fR.N_,850+this.fR.P_,-30,-50,-30,!0),i}}},7628:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(7121),e=s(8738),n=s(8665);class r extends h.A{type;level;x;z;y;jI;ZI=!1;_l=0;El=0;constructor(t,i,s,h,n,r,o){super(),this.type=e.A.Do[t],this.level=i,this.x=s,this.z=h,this.y=n,this.jI=r+o}update(t){if(this.type.qI&&this.type.qI.delay)for(this.El+=t;this.El>this.type.qI.delay[this._l];)this.El-=this.type.qI.delay[this._l]+1,this._l++,this._l>=this.type.qI.Cl&&(this._l=0,this.ZI=!0)}draw(){const t=this.type.ma(),i=n.A.e_(t,!0,!this.type.x_,!1);return!this.ZI&&this.type.qI&&this.type.qI.frames&&(i.Ha(),i.Wa(this.type.qI.frames[this._l]),i.tC=null,i.iC=null),128===this.type.nC&&128===this.type.rC||i.scale(this.type.nC,this.type.rC,this.type.nC),0!==this.type.orientation&&(90===this.type.orientation?i.sC():180===this.type.orientation?(i.sC(),i.sC()):270===this.type.orientation&&(i.sC(),i.sC(),i.sC())),i.Ya(64+this.type.N_,850+this.type.P_,-30,-50,-30,!0),i}}},9222:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;model;Sv;info;constructor(t,i,s,h,e,n){this.y=t,this.x=i,this.z=s,this.model=h,this.Sv=e,this.info=n}}},1161:(t,i,s)=>{s.d(i,{A:()=>h});class h{level;y;x;z;model;mb;BI;Mv;Uv;kv;Bv;Sv;info;Lb=0;tu=0;constructor(t,i,s,h,e,n,r,o,l,a,c,f,u){this.level=t,this.y=i,this.x=s,this.z=h,this.model=e,this.mb=n,this.BI=r,this.Mv=o,this.Uv=l,this.kv=a,this.Bv=c,this.Sv=f,this.info=u}}},5327:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{dp;Kd;x;z;im;angle;shape;XI;constructor(t,i,s,h,e,n,r,o){super(),this.dp=t,this.Kd=i,this.x=s,this.z=h,this.im=e,this.angle=n,this.shape=r,this.XI=o}}},2630:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{dp;Kd;x;z;im;angle;shape;wp;yp;Ap;constructor(t,i,s,h,e,n,r,o,l,a){super(),this.dp=t,this.Kd=i,this.x=s,this.z=h,this.im=e,this.angle=n,this.shape=r,this.wp=o,this.yp=l,this.Ap=a}}},5748:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;bb;vb;Ob;Sv;offset;constructor(t,i,s,h,e,n,r,o){this.y=t,this.x=i,this.z=s,this.bb=h,this.vb=e,this.Ob=n,this.Sv=r,this.offset=o}}},8256:(t,i,s)=>{s.d(i,{A:()=>h});class h{WI;VI;YI;KI;type;Yv;Vv;Kv;Xv;Wv;eC;mode=0;cb=0;fb=0;rb=0;ob=0;lb=0;ab=0;constructor(t,i,s,h,e,n,r,o,l,a,c){this.WI=t,this.VI=i,this.YI=s,this.KI=h,this.type=e,this.Yv=n,this.Vv=r,this.Kv=o,this.Xv=l,this.Wv=a,this.eC=c}}},3795:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1982),e=s(3867);class n extends h.A{level;x;z;wb;Cv;eb;mv=null;gv=null;Ov=null;vv=null;Ev=null;Tv=null;Av=null;_v=0;nb=0;pv=0;visible=!1;update=!1;ib=!1;sb=0;Eb=0;_b=0;Ib=0;constructor(t,i,s){super(),this.wb=this.level=t,this.x=i,this.z=s,this.Cv=new e.ds(5,null),this.eb=new Int32Array(5)}}},2771:(t,i,s)=>{s.d(i,{A:()=>h});class h{static Kb=new Int32Array(6);static Xb=new Int32Array(6);static Wb=new Int32Array(6);static Yb=new Int32Array(6);static Vb=new Int32Array(6);static gR=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static ER=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static _R=128;static CR=this._R/2|0;static TR=this._R/4|0;static OR=3*this._R/4|0;z_;q_;Z_;qb;$b;Jb;jb;zb;Zb;Hb;flat;shape;angle;Jv;Qv;constructor(t,i,s,e,n,r,o,l,a,c,f,u,d,w,y,A,p,m,I){this.flat=!(p!==e||p!==w||p!==l),this.shape=i,this.angle=r,this.Jv=d,this.Qv=a;const g=h.gR[i],E=g.length;this.z_=new Int32Array(E),this.q_=new Int32Array(E),this.Z_=new Int32Array(E);const _=new Int32Array(E),C=new Int32Array(E),T=t*h._R,O=m*h._R;for(let t=0;t8&&E<=12&&(E=9+(E-r-9&3)),E>12&&E<=16&&(E=13+(E-r-13&3)),1===E?(i=T,a=O,f=p,d=o,m=c):2===E?(i=T+h.CR,a=O,f=p+e>>1,d=o+I>>1,m=c+s>>1):3===E?(i=T+h._R,a=O,f=e,d=I,m=s):4===E?(i=T+h._R,a=O+h.CR,f=e+w>>1,d=I+n>>1,m=s+y>>1):5===E?(i=T+h._R,a=O+h._R,f=w,d=n,m=y):6===E?(i=T+h.CR,a=O+h._R,f=w+l>>1,d=n+A>>1,m=y+u>>1):7===E?(i=T,a=O+h._R,f=l,d=A,m=u):8===E?(i=T,a=O+h.CR,f=l+p>>1,d=A+o>>1,m=u+c>>1):9===E?(i=T+h.CR,a=O+h.TR,f=p+e>>1,d=o+I>>1,m=c+s>>1):10===E?(i=T+h.OR,a=O+h.CR,f=e+w>>1,d=I+n>>1,m=s+y>>1):11===E?(i=T+h.CR,a=O+h.OR,f=w+l>>1,d=n+A>>1,m=y+u>>1):12===E?(i=T+h.TR,a=O+h.CR,f=l+p>>1,d=A+o>>1,m=u+c>>1):13===E?(i=T+h.TR,a=O+h.TR,f=p,d=o,m=c):14===E?(i=T+h.OR,a=O+h.TR,f=e,d=I,m=s):15===E?(i=T+h.OR,a=O+h.OR,f=w,d=n,m=y):(i=T+h.TR,a=O+h.OR,f=l,d=A,m=u),this.z_[t]=i,this.q_[t]=f,this.Z_[t]=a,_[t]=d,C[t]=m}const v=h.ER[i],b=v.length/4|0;this.jb=new Int32Array(b),this.zb=new Int32Array(b),this.Zb=new Int32Array(b),this.qb=new Int32Array(b),this.$b=new Int32Array(b),this.Jb=new Int32Array(b),this.Hb=-1!==f?new Int32Array(b):null;let L=0;for(let t=0;t{s.d(i,{A:()=>h});class h{static oO=0;static Iv=1;static vR=2;static bR=3;static LR=4;static RR=5;static CR=6;static TR=7;static OR=8;static SR=9;static MR=10;static kR=11}},3479:(t,i,s)=>{s.d(i,{A:()=>h});class h{Gb;Fb;Db;Pb;xb;color;flat;constructor(t,i,s,h,e,n,r){this.Gb=t,this.Fb=i,this.Db=s,this.Pb=h,this.xb=e,this.color=n,this.flat=r}}},6855:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;gb;Tb;bv;Lv;Sv;info;constructor(t,i,s,h,e,n,r,o,l){this.y=t,this.x=i,this.z=s,this.gb=h,this.Tb=e,this.bv=n,this.Lv=r,this.Sv=o,this.info=l}}},7441:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;type;angle;model;Sv;info;constructor(t,i,s,h,e,n,r,o){this.y=t,this.x=i,this.z=s,this.type=h,this.angle=e,this.model=n,this.Sv=r,this.info=o}}},7536:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e{xR;DR;constructor(t){this.DR=[],this.xR=t;for(let i=0;i{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{NR;PR;constructor(){super(),this.NR=this,this.PR=this}FR(){this.PR&&this.NR&&(this.PR.NR=this.NR,this.NR.PR=this.PR,this.NR=null,this.PR=null)}}},3819:(t,i,s)=>{s.d(i,{A:()=>h});class h{static UR=['_','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','0','1','2','3','4','5','6','7','8','9'];static Id=t=>{t=t.trim();let i=0n;for(let s=0;s=65&&h<=90?i+=BigInt(h+1-65):h>=97&&h<=122?i+=BigInt(h+1-97):h>=48&&h<=57&&(i+=BigInt(h+27-48))}return i};static xa=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const s=Array(12);for(;0n!==t;){const h=t;t/=37n,s[11-i++]=this.UR[Number(h-37n*t)]}return s.slice(12-i).join('')};static Ly=t=>{const i=[...t.toLowerCase()];let s=!0;for(let t=0;t='a'&&h<='z'&&(i[t]=h.toUpperCase(),s=!1),'.'!==h&&'!'!==h||(s=!0)}return i.join('')};static Vc=t=>{let i='';for(let s=0;s(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static ka=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static s_=t=>{const i=t.toUpperCase();let s=0n;for(let t=0;t>56n)&0xffffffffffffffn;return s}}},6666:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e{BR;cursor=null;constructor(){const t=new h.A;t.next=t,t.Rm=t,this.BR=t}yg(t){t.Rm&&t.pA(),t.Rm=this.BR.Rm,t.next=this.BR,t.Rm&&(t.Rm.next=t),t.next.Rm=t}Hy(t){t.Rm&&t.pA(),t.Rm=this.BR,t.next=this.BR.next,t.Rm.next=t,t.next&&(t.next.Rm=t)}ub(){const t=this.BR.next;return t===this.BR?null:(t?.pA(),t)}head(){const t=this.BR.next;return t===this.BR?(this.cursor=null,null):(this.cursor=t?.next||null,t)}Lm(){const t=this.BR.Rm;return t===this.BR?(this.cursor=null,null):(this.cursor=t?.Rm||null,t)}next(){const t=this.cursor;return t===this.BR?(this.cursor=null,null):(this.cursor=t?.next||null,t)}Rm(){const t=this.cursor;return t===this.BR?(this.cursor=null,null):(this.cursor=t?.Rm||null,t)}clear(){for(;;){const t=this.BR.next;if(t===this.BR)return;t?.pA()}}}},1982:(t,i,s)=>{s.d(i,{A:()=>h});class h{key;next;Rm;constructor(){this.key=0n,this.next=this,this.Rm=this}pA(){this.Rm&&this.next&&(this.Rm.next=this.next,this.next.Rm=this.Rm,this.next=null,this.Rm=null)}}},2679:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(2512),e=s(7536);class n{GR;HR;history;available;constructor(t){this.GR=t,this.available=t,this.HR=new e.A(1024),this.history=new h.A}get(t){const i=this.HR.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.pA(),t?.FR()}else this.available--;this.HR.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.pA(),t.FR()):this.available=this.GR}}},2512:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(4474);class e{head;constructor(){this.head=new h.A}push(t){t.PR&&t.FR(),t.PR=this.head.PR,t.NR=this.head,t.PR&&(t.PR.NR=t),t.NR.PR=t}pop(){const t=this.head.NR;return t===this.head?null:(t?.FR(),t)}}},8534:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1069),e=s(3867);class n{static Do=[];static wc=t=>{const i=new h.A(t.read('base_head.dat')),s=new h.A(t.read('base_type.dat')),r=new h.A(t.read('base_label.dat')),o=i.rA;i.jc+=2;for(let t=0;t{s.d(i,{A:()=>n});var h=s(8534),e=s(1069);class n{static Do=[];static wc=t=>{const i=new e.A(t.read('frame_head.dat')),s=new e.A(t.read('frame_tran1.dat')),r=new e.A(t.read('frame_tran2.dat')),o=new e.A(t.read('frame_del.dat')),l=i.rA;i.jc+=2;const a=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){a[A]=i,c[A]=0,f[A]=0,u[A]=0,A++;break}a[A]=t;let s=0;3===d.types[a[A]]&&(s=128),c[A]=1&i?r.YR:s,f[A]=2&i?r.YR:s,u[A]=4&i?r.YR:s,y=t,A++}}e.length=A,e.VR=new Int32Array(A),e.x=new Int32Array(A),e.y=new Int32Array(A),e.z=new Int32Array(A);for(let t=0;t{s.d(i,{Vg:()=>h,el:()=>e,KR:()=>o,XR:()=>r,jR:()=>n});const h=document.getElementById('canvas'),e=h.getContext('2d',{willReadFrequently:!0}),n=document.createElement('canvas'),r=document.createElement('img'),o=n.getContext('2d',{willReadFrequently:!0})},9298:(t,i,s)=>{s.d(i,{A:()=>h});class h{static RED=16711680;static GREEN=65280;static BLUE=255;static ql=16776960;static Pc=65535;static Fc=16711935;static Sl=16777215;static Zl=0;static zR=16748608;static dd=8388608;static ud=128;static ZR=16756736;static qR=16740352;static $R=16723968;static JR=12648192;static QR=8453888;static tS=4259584;static bc=9179409;static Vd=6116423;static fl=2301979;static ul=5063219;static wl=7759444;static Al=3353893;static wd=8388736;static yd=13350793;static zu=Int32Array.of(h.ql,h.RED,h.GREEN,h.Pc,h.Fc,h.Sl);static mL=6798;static IL=107;static gL=10283;static EL=16;static _L=4797;static CL=7744;static TL=5799;static OL=4634;static vL=33697;static bL=22433;static LL=2983;static RL=54193;static SL=8741;static ML=12;static kL=64030;static xL=43162;static DL=7735;static NL=8404;static PL=1701;static FL=38430;static UL=24094;static BL=10153;static HL=56621;static WL=4783;static YL=1341;static VL=16578;static KL=35003;static XL=25239;static iL=9104;static sL=10275;static hL=7595;static eL=3610;static nL=7975;static rL=8526;static oL=918;static lL=38802;static aL=24466;static cL=10145;static fL=58654;static uL=5027;static dL=1457;static wL=16565;static yL=34991;static pL=25486;static jL=4626;static zL=11146;static ZL=6439;static qL=12;static $L=4758;static JL=10270;static rR=4574;static QL=4550;static tR=4537;static iR=5681;static sR=5673;static hR=5790;static eR=6806;static nR=8076}},8950:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(4474);class e extends h.A{static yc=new Int32Array;static pC=0;static mC=0;static top=0;static bottom=0;static left=0;static right=0;static Mb=0;static iS=0;static sS=0;static bind=(t,i,s)=>{this.yc=t,this.pC=i,this.mC=s,this.vl(0,0,i,s)};static qu=()=>{this.left=0,this.top=0,this.right=this.pC,this.bottom=this.mC,this.Mb=this.right-1,this.iS=this.right/2|0};static vl=(t,i,s,h)=>{t<0&&(t=0),i<0&&(i=0),s>this.pC&&(s=this.pC),h>this.mC&&(h=this.mC),this.top=i,this.bottom=h,this.left=t,this.right=s,this.Mb=this.right-1,this.iS=this.right/2|0,this.sS=this.bottom/2|0};static clear=()=>{const t=this.pC*this.mC;for(let i=0;i{this.yl(t,i,e,s),this.yl(t,i+h-1,e,s),this.dl(t,i,e,h),this.dl(t+s-1,i,e,h)};static yl=(t,i,s,h)=>{if(i=this.bottom)return;tthis.right&&(h=this.right-t);const e=t+i*this.pC;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(h=this.bottom-i);const e=t+i*this.pC;for(let t=0;t{const n=Math.abs(s-t),r=Math.abs(h-i),o=t=this.left&&t=this.top&&i-r&&(a-=r,t+=o),s{tthis.right&&(s=this.right-t),i+h>this.bottom&&(h=this.bottom-i);const n=this.pC-s;let r=t+i*this.pC;for(let t=-h;t<0;t++){for(let t=-s;t<0;t++)this.yc[r++]=e;r+=n}};static hS(t,i,s,h,e,n){tthis.right&&(s=this.right-t),i+h>this.bottom&&(h=this.bottom-i);const r=256-n,o=(e>>16&255)*n,l=(e>>8&255)*n,a=(255&e)*n,c=this.pC-s;let f=t+i*this.pC;for(let t=0;t>16&255)*r>>8<<16)+(l+(this.yc[f]>>8&255)*r>>8<<8)+(a+(255&this.yc[f])*r>>8);this.yc[f++]=t}f+=c}}static eS(t,i,s,h,e){const n=256-e,r=(h>>16&255)*e,o=(h>>8&255)*e,l=(255&h)*e;let a=i-s;a<0&&(a=0);let c=i+s;c>=this.mC&&(c=this.mC-1);for(let h=a;h<=c;h++){const e=h-i,a=0|Math.sqrt(s*s-e*e);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.pC&&(f=this.pC-1);let u=c+h*this.pC;for(let t=c;t<=f;t++){const t=(r+(this.yc[u]>>16&255)*n>>8<<16)+(o+(this.yc[u]>>8&255)*n>>8<<8)+(l+(255&this.yc[u])*n>>8);this.yc[u++]=t}}}static nS=(t,i,s)=>{t=this.right||i=this.bottom||(this.yc[t+i*this.pC]=s)}}},4583:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8950),e=s(1673),n=s(3867);class r extends h.A{static st=!1;static rS=new Int32Array(512);static oS=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static gg=new n.ds(50,null);static lS=0;static mc=new Int32Array;static ya=0;static Aa=0;static IC=!0;static Sb=!1;static alpha=0;static aS=null;static cS=new n.ds(50,null);static fS=0;static tu=0;static Ig=new Int32Array(50);static uS=new n.ds(50,null);static dS=!1;static wS=new n.ds(50,!1);static yS=new Int32Array(50);static{for(let t=1;t<512;t++)this.rS[t]=32768/t|0;for(let t=1;t<2048;t++)this.oS[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static Ro=()=>{this.rS=null,this.rS=null,this.sin=null,this.cos=null,this.mc=null,this.gg=null,this.wS=null,this.yS=null,this.aS=null,this.cS=null,this.Ig=null,this.palette=null,this.uS=null,console.log('Draw3D unloaded!')};static Kg=()=>{this.mc=new Int32Array(h.A.mC);for(let t=0;t{this.mc=new Int32Array(i);for(let s=0;s{this.aS=null,this.cS.fill(null)};static fc=t=>{this.lS=0;for(let i=0;i<50;i++)try{this.gg[i]=e.A.hc(t,i.toString()),this.st&&128===this.gg[i]?.Xl?this.gg[i]?.AS():this.gg[i]?.TC(),this.lS++}catch(t){}};static aO=t=>{if(0!==this.yS[t])return this.yS[t];const i=this.uS[t];if(!i)return 0;let s=0,h=0,e=0;const n=i.length;for(let t=0;t>16&255,h+=i[t]>>8&255,e+=255&i[t];let r=(s/n<<16)+(h/n<<8)+(e/n|0);return r=this.pS(r,1.4),0===r&&(r=1),this.yS[t]=r,r};static uc=t=>{const i=t+.03*Math.random()-.015;let s=0;for(let t=0;t<512;t++){const h=(t/8|0)/64+.0078125,e=(7&t)/8+.0625;for(let t=0;t<128;t++){const n=t/128;let r=n,o=n,l=n;if(0!==e){let t;t=n<.5?n*(e+1):n+e-n*e;const i=2*n-t;let s=h+.3333333333333333;s>1&&s--;let a=h-.3333333333333333;a<0&&a++,r=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,o=6*h<1?i+6*(t-i)*h:2*h<1?t:3*h<2?i+(t-i)*(.6666666666666666-h)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*r|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[s++]=this.pS(a,i)}}for(let t=0;t<50;t++){const s=this.gg[t];if(!s)continue;const h=s.palette;this.uS[t]=new Int32Array(h.length);for(let s=0;s{const s=(t>>16)/256,h=(t>>8&255)/256,e=(255&t)/256;return((256*Math.pow(s,i)|0)<<16)+((256*Math.pow(h,i)|0)<<8)+(256*Math.pow(e,i)|0)};static dc=t=>{this.aS||(this.fS=t,this.st?this.aS=new n.Kn(t,16384):this.aS=new n.Kn(t,65536),this.cS.fill(null))};static Nb=(t,i,s,e,n,o,l,a,c)=>{let f=0,u=0;n!==e&&(f=(i-t<<16)/(n-e)|0,u=(a-l<<15)/(n-e)|0);let d=0,w=0;o!==n&&(d=(s-i<<16)/(o-n)|0,w=(c-a<<15)/(o-n)|0);let y=0,A=0;if(o!==e&&(y=(t-s<<16)/(e-o)|0,A=(l-c<<15)/(e-o)|0),e<=n&&e<=o){if(eh.A.bottom&&(n=h.A.bottom),o>h.A.bottom&&(o=h.A.bottom),nd)for(o-=n,n-=e,e=r.mc[e];;){if(--n<0)for(;;){if(--o<0)return;this.mS(s>>16,i>>16,c>>7,a>>7,h.A.yc,e,0),s+=y,i+=d,c+=A,a+=w,e+=h.A.pC}this.mS(s>>16,t>>16,c>>7,l>>7,h.A.yc,e,0),s+=y,t+=f,c+=A,l+=u,e+=h.A.pC}else for(o-=n,n-=e,e=r.mc[e];;){if(--n<0)for(;;){if(--o<0)return;this.mS(i>>16,s>>16,a>>7,c>>7,h.A.yc,e,0),s+=y,i+=d,c+=A,a+=w,e+=h.A.pC}this.mS(t>>16,s>>16,l>>7,c>>7,h.A.yc,e,0),s+=y,t+=f,c+=A,l+=u,e+=h.A.pC}else if(i=t<<=16,a=l<<=15,e<0&&(i-=y*e,t-=f*e,a-=A*e,l-=u*e,e=0),s<<=16,c<<=15,o<0&&(s-=d*o,c-=w*o,o=0),e!==o&&yf)for(n-=o,o-=e,e=r.mc[e];;){if(--o<0)for(;;){if(--n<0)return;this.mS(s>>16,t>>16,c>>7,l>>7,h.A.yc,e,0),s+=d,t+=f,c+=w,l+=u,e+=h.A.pC}this.mS(i>>16,t>>16,a>>7,l>>7,h.A.yc,e,0),i+=y,t+=f,a+=A,l+=u,e+=h.A.pC}else for(n-=o,o-=e,e=r.mc[e];;){if(--o<0)for(;;){if(--n<0)return;this.mS(t>>16,s>>16,l>>7,c>>7,h.A.yc,e,0),s+=d,t+=f,c+=w,l+=u,e+=h.A.pC}this.mS(t>>16,i>>16,l>>7,a>>7,h.A.yc,e,0),i+=y,t+=f,a+=A,l+=u,e+=h.A.pC}}else if(n<=o){if(nh.A.bottom&&(o=h.A.bottom),e>h.A.bottom&&(e=h.A.bottom),oy)for(e-=o,o-=n,n=r.mc[n];;){if(--o<0)for(;;){if(--e<0)return;this.mS(t>>16,s>>16,l>>7,c>>7,h.A.yc,n,0),t+=f,s+=y,l+=u,c+=A,n+=h.A.pC}this.mS(t>>16,i>>16,l>>7,a>>7,h.A.yc,n,0),t+=f,i+=d,l+=u,a+=w,n+=h.A.pC}else for(e-=o,o-=n,n=r.mc[n];;){if(--o<0)for(;;){if(--e<0)return;this.mS(s>>16,t>>16,c>>7,l>>7,h.A.yc,n,0),t+=f,s+=y,l+=u,c+=A,n+=h.A.pC}this.mS(i>>16,t>>16,a>>7,l>>7,h.A.yc,n,0),t+=f,i+=d,l+=u,a+=w,n+=h.A.pC}else if(s=i<<=16,c=a<<=15,n<0&&(s-=f*n,i-=d*n,c-=u*n,a-=w*n,n=0),t<<=16,l<<=15,e<0&&(t-=y*e,l-=A*e,e=0),o-=e,e-=n,n=r.mc[n],f>16,i>>16,l>>7,a>>7,h.A.yc,n,0),t+=y,i+=d,l+=A,a+=w,n+=h.A.pC}this.mS(s>>16,i>>16,c>>7,a>>7,h.A.yc,n,0),s+=f,i+=d,c+=u,a+=w,n+=h.A.pC}else for(;;){if(--e<0)for(;;){if(--o<0)return;this.mS(i>>16,t>>16,a>>7,l>>7,h.A.yc,n,0),t+=y,i+=d,l+=A,a+=w,n+=h.A.pC}this.mS(i>>16,s>>16,a>>7,c>>7,h.A.yc,n,0),s+=f,i+=d,c+=u,a+=w,n+=h.A.pC}}else if(oh.A.bottom&&(e=h.A.bottom),n>h.A.bottom&&(n=h.A.bottom),e>16,t>>16,a>>7,l>>7,h.A.yc,o,0),i+=d,t+=f,a+=w,l+=u,o+=h.A.pC}this.mS(i>>16,s>>16,a>>7,c>>7,h.A.yc,o,0),i+=d,s+=y,a+=w,c+=A,o+=h.A.pC}else for(;;){if(--e<0)for(;;){if(--n<0)return;this.mS(t>>16,i>>16,l>>7,a>>7,h.A.yc,o,0),i+=d,t+=f,a+=w,l+=u,o+=h.A.pC}this.mS(s>>16,i>>16,c>>7,a>>7,h.A.yc,o,0),i+=d,s+=y,a+=w,c+=A,o+=h.A.pC}else if(t=s<<=16,l=c<<=15,o<0&&(t-=d*o,s-=y*o,l-=w*o,c-=A*o,o=0),i<<=16,a<<=15,n<0&&(i-=f*n,a-=u*n,n=0),e-=n,n-=o,o=r.mc[o],d>16,s>>16,a>>7,c>>7,h.A.yc,o,0),i+=f,s+=y,a+=u,c+=A,o+=h.A.pC}this.mS(t>>16,s>>16,l>>7,c>>7,h.A.yc,o,0),t+=d,s+=y,l+=w,c+=A,o+=h.A.pC}else for(;;){if(--n<0)for(;;){if(--e<0)return;this.mS(s>>16,i>>16,c>>7,a>>7,h.A.yc,o,0),i+=f,s+=y,a+=u,c+=A,o+=h.A.pC}this.mS(s>>16,t>>16,c>>7,l>>7,h.A.yc,o,0),t+=d,s+=y,l+=w,c+=A,o+=h.A.pC}};static mS=(t,i,s,e,n,o,l)=>{let a;if(r.IC){let c;if(r.Sb){if(c=i-t>3?(e-s)/(i-t)|0:0,i>h.A.Mb&&(i=h.A.Mb),t<0&&(s-=t*c,t=0),t>=i)return;o+=t,l=i-t>>2,c<<=2}else{if(!(t>2)>0?(e-s)*r.rS[l]>>15:0}if(0===r.alpha)for(;;){if(--l<0){if((l=i-t&3)>0){a=r.palette[s>>8];do{n[o++]=a,l--}while(l>0);return}break}a=r.palette[s>>8],s+=c,n[o++]=a,n[o++]=a,n[o++]=a,n[o++]=a}else{const h=r.alpha,e=256-r.alpha;for(;;){if(--l<0){if((l=i-t&3)>0){a=r.palette[s>>8],a=((16711935&a)*e>>8&16711935)+((65280&a)*e>>8&65280);do{n[o++]=a+((16711935&n[o])*h>>8&16711935)+((65280&n[o])*h>>8&65280),l--}while(l>0)}break}a=r.palette[s>>8],s+=c,a=((16711935&a)*e>>8&16711935)+((65280&a)*e>>8&65280),n[o++]=a+((16711935&n[o])*h>>8&16711935)+((65280&n[o])*h>>8&65280),n[o++]=a+((16711935&n[o])*h>>8&16711935)+((65280&n[o])*h>>8&65280),n[o++]=a+((16711935&n[o])*h>>8&16711935)+((65280&n[o])*h>>8&65280),n[o++]=a+((16711935&n[o])*h>>8&16711935)+((65280&n[o])*h>>8&65280)}}}else if(th.A.Mb&&(i=h.A.Mb),t<0&&(s-=t*c,t=0),t>=i))return;if(o+=t,l=i-t,0===r.alpha)do{n[o++]=r.palette[s>>8],s+=c,l--}while(l>0);else{const t=r.alpha,i=256-r.alpha;do{a=r.palette[s>>8],s+=c,a=((16711935&a)*i>>8&16711935)+((65280&a)*i>>8&65280),n[o++]=a+((16711935&n[o])*t>>8&16711935)+((65280&n[o])*t>>8&65280),l--}while(l>0)}}};static IS=(t,i,s,e,n,r,o)=>{let l=0;n!==e&&(l=(i-t<<16)/(n-e)|0);let a=0;r!==n&&(a=(s-i<<16)/(r-n)|0);let c=0;if(r!==e&&(c=(t-s<<16)/(e-r)|0),e<=n&&e<=r){if(eh.A.bottom&&(n=h.A.bottom),r>h.A.bottom&&(r=h.A.bottom),na)for(r-=n,n-=e,e=this.mc[e];;){if(--n<0)for(;;){if(--r<0)return;this.gS(s>>16,i>>16,h.A.yc,e,o),s+=c,i+=a,e+=h.A.pC}this.gS(s>>16,t>>16,h.A.yc,e,o),s+=c,t+=l,e+=h.A.pC}else for(r-=n,n-=e,e=this.mc[e];;){if(--n<0)for(;;){if(--r<0)return;this.gS(i>>16,s>>16,h.A.yc,e,o),s+=c,i+=a,e+=h.A.pC}this.gS(t>>16,s>>16,h.A.yc,e,o),s+=c,t+=l,e+=h.A.pC}else if(i=t<<=16,e<0&&(i-=c*e,t-=l*e,e=0),s<<=16,r<0&&(s-=a*r,r=0),e!==r&&cl)for(n-=r,r-=e,e=this.mc[e];;){if(--r<0)for(;;){if(--n<0)return;this.gS(s>>16,t>>16,h.A.yc,e,o),s+=a,t+=l,e+=h.A.pC}this.gS(i>>16,t>>16,h.A.yc,e,o),i+=c,t+=l,e+=h.A.pC}else for(n-=r,r-=e,e=this.mc[e];;){if(--r<0)for(;;){if(--n<0)return;this.gS(t>>16,s>>16,h.A.yc,e,o),s+=a,t+=l,e+=h.A.pC}this.gS(t>>16,i>>16,h.A.yc,e,o),i+=c,t+=l,e+=h.A.pC}}else if(n<=r){if(nh.A.bottom&&(r=h.A.bottom),e>h.A.bottom&&(e=h.A.bottom),rc)for(e-=r,r-=n,n=this.mc[n];;){if(--r<0)for(;;){if(--e<0)return;this.gS(t>>16,s>>16,h.A.yc,n,o),t+=l,s+=c,n+=h.A.pC}this.gS(t>>16,i>>16,h.A.yc,n,o),t+=l,i+=a,n+=h.A.pC}else for(e-=r,r-=n,n=this.mc[n];;){if(--r<0)for(;;){if(--e<0)return;this.gS(s>>16,t>>16,h.A.yc,n,o),t+=l,s+=c,n+=h.A.pC}this.gS(i>>16,t>>16,h.A.yc,n,o),t+=l,i+=a,n+=h.A.pC}else if(s=i<<=16,n<0&&(s-=l*n,i-=a*n,n=0),t<<=16,e<0&&(t-=c*e,e=0),l>16,i>>16,h.A.yc,n,o),t+=c,i+=a,n+=h.A.pC}this.gS(s>>16,i>>16,h.A.yc,n,o),s+=l,i+=a,n+=h.A.pC}else for(r-=e,e-=n,n=this.mc[n];;){if(--e<0)for(;;){if(--r<0)return;this.gS(i>>16,t>>16,h.A.yc,n,o),t+=c,i+=a,n+=h.A.pC}this.gS(i>>16,s>>16,h.A.yc,n,o),s+=l,i+=a,n+=h.A.pC}}else if(rh.A.bottom&&(e=h.A.bottom),n>h.A.bottom&&(n=h.A.bottom),e>16,t>>16,h.A.yc,r,o),i+=a,t+=l,r+=h.A.pC}this.gS(i>>16,s>>16,h.A.yc,r,o),i+=a,s+=c,r+=h.A.pC}else for(n-=e,e-=r,r=this.mc[r];;){if(--e<0)for(;;){if(--n<0)return;this.gS(t>>16,i>>16,h.A.yc,r,o),i+=a,t+=l,r+=h.A.pC}this.gS(s>>16,i>>16,h.A.yc,r,o),i+=a,s+=c,r+=h.A.pC}else if(t=s<<=16,r<0&&(t-=a*r,s-=c*r,r=0),i<<=16,n<0&&(i-=l*n,n=0),a>16,s>>16,h.A.yc,r,o),i+=l,s+=c,r+=h.A.pC}this.gS(t>>16,s>>16,h.A.yc,r,o),t+=a,s+=c,r+=h.A.pC}else for(e-=n,n-=r,r=this.mc[r];;){if(--n<0)for(;;){if(--e<0)return;this.gS(s>>16,i>>16,h.A.yc,r,o),i+=l,s+=c,r+=h.A.pC}this.gS(s>>16,t>>16,h.A.yc,r,o),t+=a,s+=c,r+=h.A.pC}};static Bb=(t,i,s,e,n,r,o,l,a,c,f,u,d,w,y,A,p,m,I)=>{const g=this.ES(I);this.dS=!this.wS[I];const E=c-d,_=f-y,C=u-p,T=w-c,O=A-f,v=m-u;let b=T*f-O*c<<14;const L=O*u-v*f<<8,R=v*c-T*u<<5;let S=E*f-_*c<<14;const M=_*u-C*f<<8,k=C*c-E*u<<5;let x=_*T-E*O<<14;const D=C*O-_*v<<8,N=E*v-C*T<<5;let P=0,F=0;n!==e&&(P=(i-t<<16)/(n-e)|0,F=(l-o<<16)/(n-e)|0);let U=0,B=0;r!==n&&(U=(s-i<<16)/(r-n)|0,B=(a-l<<16)/(r-n)|0);let G=0,H=0;if(r!==e&&(G=(t-s<<16)/(e-r)|0,H=(o-a<<16)/(e-r)|0),e<=n&&e<=r){if(eh.A.bottom&&(n=h.A.bottom),r>h.A.bottom&&(r=h.A.bottom),nU)for(r-=n,n-=e,e=this.mc[e];;){if(--n<0)for(;;){if(--r<0)return;this._S(s>>16,i>>16,h.A.yc,e,g,0,0,b,S,x,L,M,D,a>>8,l>>8),s+=G,i+=U,a+=H,l+=B,e+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(s>>16,t>>16,h.A.yc,e,g,0,0,b,S,x,L,M,D,a>>8,o>>8),s+=G,t+=P,a+=H,o+=F,e+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(r-=n,n-=e,e=this.mc[e];;){if(--n<0)for(;;){if(--r<0)return;this._S(i>>16,s>>16,h.A.yc,e,g,0,0,b,S,x,L,M,D,l>>8,a>>8),s+=G,i+=U,a+=H,l+=B,e+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(t>>16,s>>16,h.A.yc,e,g,0,0,b,S,x,L,M,D,o>>8,a>>8),s+=G,t+=P,a+=H,o+=F,e+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}else{i=t<<=16,l=o<<=16,e<0&&(i-=G*e,t-=P*e,l-=H*e,o-=F*e,e=0),s<<=16,a<<=16,r<0&&(s-=U*r,a-=B*r,r=0);const c=e-this.Aa;if(b+=R*c,S+=k*c,x+=N*c,b|=0,S|=0,x|=0,(e===r||G>=P)&&(e!==r||U<=P))for(n-=r,r-=e,e=this.mc[e];;){if(--r<0)for(;;){if(--n<0)return;this._S(t>>16,s>>16,h.A.yc,e,g,0,0,b,S,x,L,M,D,o>>8,a>>8),s+=U,t+=P,a+=B,o+=F,e+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(t>>16,i>>16,h.A.yc,e,g,0,0,b,S,x,L,M,D,o>>8,l>>8),i+=G,t+=P,l+=H,o+=F,e+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(n-=r,r-=e,e=this.mc[e];;){if(--r<0)for(;;){if(--n<0)return;this._S(s>>16,t>>16,h.A.yc,e,g,0,0,b,S,x,L,M,D,a>>8,o>>8),s+=U,t+=P,a+=B,o+=F,e+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(i>>16,t>>16,h.A.yc,e,g,0,0,b,S,x,L,M,D,l>>8,o>>8),i+=G,t+=P,l+=H,o+=F,e+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}}else if(n<=r){if(nh.A.bottom&&(r=h.A.bottom),e>h.A.bottom&&(e=h.A.bottom),rG)for(e-=r,r-=n,n=this.mc[n];;){if(--r<0)for(;;){if(--e<0)return;this._S(t>>16,s>>16,h.A.yc,n,g,0,0,b,S,x,L,M,D,o>>8,a>>8),t+=P,s+=G,o+=F,a+=H,n+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(t>>16,i>>16,h.A.yc,n,g,0,0,b,S,x,L,M,D,o>>8,l>>8),t+=P,i+=U,o+=F,l+=B,n+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(e-=r,r-=n,n=this.mc[n];;){if(--r<0)for(;;){if(--e<0)return;this._S(s>>16,t>>16,h.A.yc,n,g,0,0,b,S,x,L,M,D,a>>8,o>>8),t+=P,s+=G,o+=F,a+=H,n+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(i>>16,t>>16,h.A.yc,n,g,0,0,b,S,x,L,M,D,l>>8,o>>8),t+=P,i+=U,o+=F,l+=B,n+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}else{s=i<<=16,a=l<<=16,n<0&&(s-=P*n,i-=U*n,a-=F*n,l-=B*n,n=0),t<<=16,o<<=16,e<0&&(t-=G*e,o-=H*e,e=0);const c=n-this.Aa;if(b+=R*c,S+=k*c,x+=N*c,b|=0,S|=0,x|=0,r-=e,e-=n,n=this.mc[n],P>16,i>>16,h.A.yc,n,g,0,0,b,S,x,L,M,D,o>>8,l>>8),t+=G,i+=U,o+=H,l+=B,n+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(s>>16,i>>16,h.A.yc,n,g,0,0,b,S,x,L,M,D,a>>8,l>>8),s+=P,i+=U,a+=F,l+=B,n+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(;;){if(--e<0)for(;;){if(--r<0)return;this._S(i>>16,t>>16,h.A.yc,n,g,0,0,b,S,x,L,M,D,l>>8,o>>8),t+=G,i+=U,o+=H,l+=B,n+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(i>>16,s>>16,h.A.yc,n,g,0,0,b,S,x,L,M,D,l>>8,a>>8),s+=P,i+=U,a+=F,l+=B,n+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}}else if(rh.A.bottom&&(e=h.A.bottom),n>h.A.bottom&&(n=h.A.bottom),e>16,t>>16,h.A.yc,r,g,0,0,b,S,x,L,M,D,l>>8,o>>8),i+=U,t+=P,l+=B,o+=F,r+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(i>>16,s>>16,h.A.yc,r,g,0,0,b,S,x,L,M,D,l>>8,a>>8),i+=U,s+=G,l+=B,a+=H,r+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(;;){if(--e<0)for(;;){if(--n<0)return;this._S(t>>16,i>>16,h.A.yc,r,g,0,0,b,S,x,L,M,D,o>>8,l>>8),i+=U,t+=P,l+=B,o+=F,r+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(s>>16,i>>16,h.A.yc,r,g,0,0,b,S,x,L,M,D,a>>8,l>>8),i+=U,s+=G,l+=B,a+=H,r+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}else{t=s<<=16,o=a<<=16,r<0&&(t-=U*r,s-=G*r,o-=B*r,a-=H*r,r=0),i<<=16,l<<=16,n<0&&(i-=P*n,l-=F*n,n=0);const c=r-this.Aa;if(b+=R*c,S+=k*c,x+=N*c,b|=0,S|=0,x|=0,e-=n,n-=r,r=this.mc[r],U>16,s>>16,h.A.yc,r,g,0,0,b,S,x,L,M,D,l>>8,a>>8),i+=P,s+=G,l+=F,a+=H,r+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(t>>16,s>>16,h.A.yc,r,g,0,0,b,S,x,L,M,D,o>>8,a>>8),t+=U,s+=G,o+=B,a+=H,r+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(;;){if(--n<0)for(;;){if(--e<0)return;this._S(s>>16,i>>16,h.A.yc,r,g,0,0,b,S,x,L,M,D,a>>8,l>>8),i+=P,s+=G,l+=F,a+=H,r+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(s>>16,t>>16,h.A.yc,r,g,0,0,b,S,x,L,M,D,a>>8,o>>8),t+=U,s+=G,o+=B,a+=H,r+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}};static _S=(t,i,s,e,n,r,o,l,a,c,f,u,d,w,y)=>{if(t>=i)return;let A,p,m,I,g,E,_,C,T;if(this.Sb){if(A=(y-w)/(i-t)|0,i>h.A.Mb&&(i=h.A.Mb),t<0&&(w-=t*A,t=0),t>=i)return;p=i-t>>3,A<<=12}else i-t>7?(p=i-t>>3,A=(y-w)*this.rS[p]>>6):(p=0,A=0);if(w<<=9,e+=t,this.st&&n)if(m=0,I=0,E=t-this.ya,l+=(f>>3)*E,a+=(u>>3)*E,c+=(d>>3)*E,l|=0,a|=0,g=(c|=0)>>12,0!==g&&(o=a/g|0,(r=l/g|0)<0?r=0:r>4032&&(r=4032)),l+=f,a+=u,c+=d,l|=0,a|=0,g=(c|=0)>>12,0!==g&&(m=l/g|0,I=a/g|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=I-o>>3,r+=w>>3&786432,T=w>>23,this.dS){for(;p-- >0;)s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r=m,o=I,l+=f,a+=u,g=(c+=d)>>12,0!==g&&(m=l/g|0,I=a/g|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=I-o>>3,r+=(w+=A)>>3&786432,T=w>>23;for(p=i-t&7;p-- >0;)s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C}else{for(;p-- >0;){let t;0!=(t=n[(4032&o)+(r>>6)]>>>T)&&(s[e]=t),e+=1,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e+=1,r=m,o=I,l+=f,a+=u,c+=d,l|=0,a|=0,g=(c|=0)>>12,0!==g&&(m=l/g|0,I=a/g|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=I-o>>3,r+=(w+=A)>>3&786432,T=w>>23}for(p=i-t&7;p-- >0;){let t;0!=(t=n[(4032&o)+(r>>6)]>>>T)&&(s[e]=t),e++,r+=_,o+=C}}else if(m=0,I=0,E=t-this.ya,l+=(f>>3)*E,a+=(u>>3)*E,c+=(d>>3)*E,l|=0,a|=0,g=(c|=0)>>14,0!==g&&(o=a/g|0,(r=l/g|0)<0?r=0:r>16256&&(r=16256)),l+=f,a+=u,c+=d,l|=0,a|=0,g=(c|=0)>>14,0!==g&&(m=l/g|0,I=a/g|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=I-o>>3,r+=6291456&w,T=w>>23,this.dS&&n){for(;p-- >0;)s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r=m,o=I,l+=f,a+=u,c+=d,l|=0,a|=0,g=(c|=0)>>14,0!==g&&(m=l/g|0,I=a/g|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=I-o>>3,r+=6291456&(w+=A),T=w>>23;for(p=i-t&7;p-- >0;)s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C}else{for(;p-- >0&&n;){let t;0!=(t=n[(16256&o)+(r>>7)]>>>T)&&(s[e]=t),e+=1,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,r=m,o=I,l+=f,a+=u,c+=d,l|=0,a|=0,g=(c|=0)>>14,0!==g&&(m=l/g|0,I=a/g|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=I-o>>3,r+=6291456&(w+=A),T=w>>23}for(p=i-t&7;p-- >0&&n;){let t;0!=(t=n[(16256&o)+(r>>7)]>>>T)&&(s[e]=t),e++,r+=_,o+=C}}};static gS=(t,i,s,e,n)=>{if(this.Sb&&(i>h.A.Mb&&(i=h.A.Mb),t<0&&(t=0)),t>=i)return;e+=t;let r=i-t>>2;if(0===this.alpha)for(;;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;s[e++]=n}s[e++]=n,s[e++]=n,s[e++]=n,s[e++]=n}const o=this.alpha,l=256-this.alpha;for(n=((16711935&n)*l>>8&16711935)+((65280&n)*l>>8&65280);;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;s[e++]=n+((16711935&s[e])*o>>8&16711935)+((65280&s[e])*o>>8&65280)}s[e++]=n+((16711935&s[e])*o>>8&16711935)+((65280&s[e])*o>>8&65280),s[e++]=n+((16711935&s[e])*o>>8&16711935)+((65280&s[e])*o>>8&65280),s[e++]=n+((16711935&s[e])*o>>8&16711935)+((65280&s[e])*o>>8&65280),s[e++]=n+((16711935&s[e])*o>>8&16711935)+((65280&s[e])*o>>8&65280)}};static Eg=t=>{this.cS[t]&&this.aS&&(this.aS[this.fS++]=this.cS[t],this.cS[t]=null)};static ES=t=>{if(this.Ig[t]=this.tu++,this.cS[t])return this.cS[t];let i;if(this.fS>0&&this.aS)i=this.aS[--this.fS],this.aS[this.fS]=null;else{let t=0,s=-1;for(let i=0;i>>3)&16316671,i[e+8192]=n-(n>>>2)&16316671,i[e+12288]=n-(n>>>2)-(n>>>3)&16316671}}else{if(64===s.width)for(let t=0;t<128;t++)for(let e=0;e<128;e++)i[e+(t<<7)]=h[s.yc[(e>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=h[s.yc[t]];this.wS[t]=!1;for(let s=0;s<16384;s++){i[s]&=16316671;const h=i[s];0===h&&(this.wS[t]=!0),i[s+16384]=h-(h>>>3)&16316671,i[s+32768]=h-(h>>>2)&16316671,i[s+49152]=h-(h>>>2)-(h>>>3)&16316671}}return i}}},880:(t,i,s)=>{s.d(i,{r:()=>e});var h=s(7854);const e=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(h.XR.src),h.XR.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>h.XR.onload=()=>t())),h.KR.clearRect(0,0,h.jR.width,h.jR.height);const i=h.XR.naturalWidth,s=h.XR.naturalHeight;return h.jR.width=i,h.jR.height=s,h.KR.drawImage(h.XR,0,0),h.KR.getImageData(0,0,i,s)}},8665:(t,i,s)=>{s.d(i,{A:()=>f});var h=s(1069),e=s(8950),n=s(4583),r=s(6730),o=s(4474),l=s(3867);class a{j_=0;zv=0;CS=0;TS=-1;OS=-1;vS=-1;bS=-1;LS=-1;RS=-1;SS=-1;MS=-1;kS=-1;xS=0;DS=-1;NS=-1;PS=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static US=null;static BS=null;static GS=null;static HS=null;static WS=null;static YS=null;static VS=null;static KS=null;static XS=null;static jS=null;static zS=null;static ZS=null;static axis=null;static qS=new l.ds(4096,!1);static $S=new l.ds(4096,!1);static JS=new Int32Array(4096);static QS=new Int32Array(4096);static tM=new Int32Array(4096);static iM=new Int32Array(4096);static sM=new Int32Array(4096);static hM=new Int32Array(4096);static eM=new Int32Array(1500);static nM=new l.Kn(1500,512);static rM=new Int32Array(12);static oM=new l.Kn(12,2e3);static lM=new Int32Array(2e3);static aM=new Int32Array(2e3);static cM=new Int32Array(12);static fM=new Int32Array(10);static uM=new Int32Array(10);static dM=new Int32Array(10);static gn=0;static wM=0;static En=0;static iu=!1;static Yl=0;static Vl=0;static su=0;static Tm=new Int32Array(1e3);static yM=!1;static wc(t){try{f.head=new h.A(t.read('ob_head.dat')),f.US=new h.A(t.read('ob_face1.dat')),f.BS=new h.A(t.read('ob_face2.dat')),f.GS=new h.A(t.read('ob_face3.dat')),f.HS=new h.A(t.read('ob_face4.dat')),f.WS=new h.A(t.read('ob_face5.dat')),f.YS=new h.A(t.read('ob_point1.dat')),f.VS=new h.A(t.read('ob_point2.dat')),f.KS=new h.A(t.read('ob_point3.dat')),f.XS=new h.A(t.read('ob_point4.dat')),f.jS=new h.A(t.read('ob_point5.dat')),f.zS=new h.A(t.read('ob_vertex1.dat')),f.ZS=new h.A(t.read('ob_vertex2.dat')),f.axis=new h.A(t.read('ob_axis.dat')),f.head.jc=0,f.YS.jc=0,f.VS.jc=0,f.KS.jc=0,f.XS.jc=0,f.zS.jc=0,f.ZS.jc=0;const i=f.head.rA;f.metadata=new l.ds(i+100,null);let s=0,e=0,n=0,r=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static X_=(t,i,s)=>{const h=t.j_,e=t.zv,n=t.CS;let r,o,a,u,d;if(i){r=new Int32Array(h);for(let i=0;i{const e=t.j_,n=t.zv,r=t.CS;let o,l,a,c,u;if(h)o=t.z_,l=t.q_,a=t.Z_;else{o=new Int32Array(e),l=new Int32Array(e),a=new Int32Array(e);for(let i=0;i{const s=t.j_,h=t.zv,e=t.CS,n=new Int32Array(s),r=new Int32Array(s),o=new Int32Array(s);for(let i=0;i{let s=!1,h=!1,e=!1,n=!1,r=0,o=0,l=0,a=-1;for(let c=0;c{let s=!1,h=!1,e=!1,n=!1,r=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.z_[i],a=t.q_[i],c=t.Z_[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.US&&f.BS&&f.GS&&f.HS&&f.WS&&f.YS&&f.VS&&f.KS&&f.XS&&f.jS&&f.zS&&f.ZS&&f.axis))throw new Error('cant loading model!!!!!');const s=i.j_,h=i.zv,e=i.CS,n=new Int32Array(s),r=new Int32Array(s),o=new Int32Array(s),l=new Int32Array(h),a=new Int32Array(h),c=new Int32Array(h),u=new Int32Array(e),d=new Int32Array(e),w=new Int32Array(e);let y=null;i.LS>=0&&(y=new Int32Array(s));let A=null;i.kS>=0&&(A=new Int32Array(h));let p=null,m=0;i.xS>=0?p=new Int32Array(h):m=-i.xS-1;let I=null;i.DS>=0&&(I=new Int32Array(h));let g=null;i.NS>=0&&(g=new Int32Array(h));const E=new Int32Array(h);f.YS.jc=i.TS,f.VS.jc=i.OS,f.KS.jc=i.vS,f.XS.jc=i.bS,f.jS.jc=i.LS;let _,C,T,O=0,v=0,b=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const s=f.metadata[i];if(s.data=t,!s.data.length)throw new Error('No model data');const e=s.j_,n=s.zv,r=s.CS,o=new Int32Array(e),l=new Int32Array(e),a=new Int32Array(e),c=new Int32Array(n),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(r),y=new Int32Array(r),A=new Int32Array(r);let p=null;s.LS>=0&&(p=new Int32Array(e));let m=null;s.kS>=0&&(m=new Int32Array(n));let I=null,g=0;s.xS>=0?I=new Int32Array(n):g=-s.xS-1;let E=null;s.DS>=0&&(E=new Int32Array(n));let _=null;s.NS>=0&&(_=new Int32Array(n));const C=new Int32Array(n),T=new h.A(s.data);T.jc=s.TS;const O=new h.A(s.data);O.jc=s.OS;const v=new h.A(s.data);v.jc=s.vS;const b=new h.A(s.data);b.jc=s.bS;const L=new h.A(s.data);L.jc=s.LS;let R,S,M,k=0,x=0,D=0;for(let t=0;tthis.eC&&(this.eC=-s),s>this.Wv&&(this.Wv=s);const e=i*i+h*h;e>this.yO&&(this.yO=e)}this.yO=Math.sqrt(this.yO)+.99|0,this.bM=Math.sqrt(this.yO*this.yO+this.eC*this.eC)+.99|0,this.vM=this.bM+(Math.sqrt(this.yO*this.yO+this.Wv*this.Wv)+.99|0)}J_(){this.eC=0,this.Wv=0;for(let t=0;tthis.eC&&(this.eC=-i),i>this.Wv&&(this.Wv=i)}this.bM=Math.sqrt(this.yO*this.yO+this.eC*this.eC)+.99|0,this.vM=this.bM+(Math.sqrt(this.yO*this.yO+this.Wv*this.Wv)+.99|0)}Ha(){if(this.LM){const t=new Int32Array(256);let i=0;for(let s=0;si&&(i=h)}this.iC=new l.ds(i+1,null);for(let s=0;s<=i;s++)this.iC[s]=new Int32Array(t[s]),t[s]=0;let s=0;for(;si&&(i=h)}this.tC=new l.ds(i+1,null);for(let s=0;s<=i;s++)this.tC[s]=new Int32Array(t[s]),t[s]=0;let s=0;for(;sl;)l=s[o++];n&&n.types&&h.x&&h.y&&h.z&&n.labels&&(i!==l||0===n.types[i])&&this.xM(h.x[t],h.y[t],h.z[t],n.labels[i],n.types[i])}f.gn=0,f.wM=0,f.En=0,o=0,l=s[o++];for(let t=0;tl;)l=s[o++];n&&n.types&&e.x&&e.y&&e.z&&n.labels&&(i===l||0===n.types[i])&&this.xM(e.x[t],e.y[t],e.z[t],n.labels[i],n.types[i])}}else this.Wa(t)}Wa(t){if(!this.iC||-1===t||!r.A.Do[t])return;const i=r.A.Do[t],s=i.WR;f.gn=0,f.wM=0,f.En=0;for(let t=0;t>16;this.Z_[t]=this.q_[t]*i+this.Z_[t]*s>>16,this.q_[t]=h}}translate(t,i,s){for(let h=0;h>8;if(this.mM&&this.IM&&this.gM||(this.mM=new Int32Array(this.zv),this.IM=new Int32Array(this.zv),this.gM=new Int32Array(this.zv)),!this.Dv){this.Dv=new l.ds(this.j_,null);for(let t=0;t8192||p>8192||m>8192||A<-8192||p<-8192||m<-8192;)A>>=1,p>>=1,m>>=1;let I=0|Math.sqrt(A*A+p*p+m*m);if(I<=0&&(I=1),A=256*A/I|0,p=256*p/I|0,m=256*m/I|0,this.jv&&1&this.jv[i]){const n=t+((s*A+h*p+e*m)/(r+(r/2|0))|0);this.h_&&(this.mM[i]=f.pM(this.h_[i],n,this.jv[i]))}else{let t=this.Dv[n];t&&(t.x+=A,t.y+=p,t.z+=m,t.w++),t=this.Dv[o],t&&(t.x+=A,t.y+=p,t.z+=m,t.w++),t=this.Dv[l],t&&(t.x+=A,t.y+=p,t.z+=m,t.w++)}}if(n)this.Fv(t,r,s,h,e);else{this.Hv=new l.ds(this.j_,null);for(let t=0;t>16;for(let h=0;h>16,g=g*w-I*d>>16,I=m),0!==t&&(m=g*a-E*l>>16,E=g*l+E*a>>16,g=m),0!==i&&(m=E*c+I*u>>16,E=E*u-I*c>>16,I=m),I+=e,g+=r,E+=o,m=g*A-E*y>>16,E=g*y+E*A>>16,g=m,f.JS&&f.QS&&f.tM&&(f.tM[h]=E-p,f.JS[h]=n.A.ya+((I<<9)/E|0),f.QS[h]=n.A.Aa+((g<<9)/E|0)),this.CS>0&&f.iM&&f.sM&&f.hM&&(f.iM[h]=I,f.sM[h]=g,f.hM[h]=E)}try{this.NM(!1,!1,0)}catch(t){}}draw(t,i,s,h,r,o,l,a,c){const u=a*r-o*h>>16,d=l*i+u*s>>16,w=this.yO*s>>16,y=d+w;if(y<=50||d>=3500)return;const A=a*h+o*r>>16;let p=A-this.yO<<9;if((p/y|0)>=e.A.iS)return;let m=A+this.yO<<9;if((m/y|0)<=-e.A.iS)return;const I=l*s-u*i>>16,g=this.yO*i>>16;let E=I+g<<9;if((E/y|0)<=-e.A.sS)return;let _=I-(g+(this.eC*s>>16))<<9;if((_/y|0)>=e.A.sS)return;let C=d-(w+(this.eC*i>>16))<=50,T=!1;if(c>0&&f.iu){let t=d-w;t<=50&&(t=50),A>0?(p=p/y|0,m=m/t|0):(m=m/y|0,p=p/t|0),I>0?(_=_/y|0,E=E/t|0):(E=E/y|0,_=_/t|0);const i=f.Yl-n.A.ya,s=f.Vl-n.A.Aa;i>p&&i_&&s>16,w=w*L-c*b>>16,c=n),c+=o,u+=l,w+=a,n=w*h+c*r>>16,w=w*r-c*h>>16,c=n,n=u*s-w*i>>16,w=u*i+w*s>>16,u=n,f.tM&&(f.tM[e]=w-d),w>=50&&f.JS&&f.QS?(f.JS[e]=O+((c<<9)/w|0),f.QS[e]=v+((u<<9)/w|0)):f.JS&&(f.JS[e]=-5e3,C=!0),(C||this.CS>0)&&f.iM&&f.sM&&f.hM&&(f.iM[e]=c,f.sM[e]=u,f.hM[e]=w)}try{this.NM(C,T,c)}catch(t){}}NM(t,i,s,h=!1){f.yM&&(this.MM=-1,this.kM=-1);for(let t=0;te.A.Mb||a>e.A.Mb||c>e.A.Mb),f.nM&&f.eM){const t=((y+A+p)/3|0)+this.bM;f.nM[t][f.eM[t]++]=h,f.yM&&this.PM(f.Yl,f.Vl,u,d,w,l,a,c)&&this.kM=0;t--){const i=f.eM[t];if(!(i<=0)&&f.nM){const s=f.nM[t];for(let t=0;t=0;t--){const i=f.eM[t];if(i>0&&f.nM){const s=f.nM[t];for(let h=0;h0||f.rM[2]>0)&&(n=(f.cM[1]+f.cM[2])/(f.rM[1]+f.rM[2])|0);let r=0;f.rM&&f.cM&&(f.rM[3]>0||f.rM[4]>0)&&(r=(f.cM[3]+f.cM[4])/(f.rM[3]+f.rM[4])|0);let o=0;if(f.rM&&f.cM&&(f.rM[6]>0||f.rM[8]>0)&&(o=(f.cM[6]+f.cM[8])/(f.rM[6]+f.rM[8])|0),f.rM&&f.oM){let t,i=0,s=f.rM[10],e=f.oM[10],l=f.lM;i===s&&(i=0,s=f.rM[11],e=f.oM[11],l=f.aM),t=in;)try{this.FM(e[i++],h),i===s&&e!==f.oM[11]&&(i=0,s=f.rM[11],e=f.oM[11],l=f.aM),t=ir;)try{this.FM(e[i++],h),i===s&&e!==f.oM[11]&&(i=0,s=f.rM[11],e=f.oM[11],l=f.aM),t=io;)try{this.FM(e[i++],h),i===s&&e!==f.oM[11]&&(i=0,s=f.rM[11],e=f.oM[11],l=f.aM),t=i>2,r=this.CM[i],o=this.TM[i],l=this.OM[i];n.A.Bb(f.JS[s],f.JS[h],f.JS[e],f.QS[s],f.QS[h],f.QS[e],this.mM[t],this.IM[t],this.gM[t],f.iM[r],f.sM[r],f.hM[r],f.iM[o],f.iM[l],f.sM[o],f.sM[l],f.hM[o],f.hM[l],this.h_[t])}else if(3===r&&this.jv&&this.h_&&this.mM&&f.JS&&f.QS&&f.iM&&f.sM&&f.hM){const i=this.jv[t]>>2,r=this.CM[i],o=this.TM[i],l=this.OM[i];n.A.Bb(f.JS[s],f.JS[h],f.JS[e],f.QS[s],f.QS[h],f.QS[e],this.mM[t],this.mM[t],this.mM[t],f.iM[r],f.sM[r],f.hM[r],f.iM[o],f.iM[l],f.sM[o],f.sM[l],f.hM[o],f.hM[l],this.h_[t])}}UM(t,i=!1){let s=0;if(f.hM){const i=n.A.ya,h=n.A.Aa,e=this.Zv[t],r=this.qv[t],o=this.$v[t],l=f.hM[e],a=f.hM[r],c=f.hM[o];if(l>=50&&f.JS&&f.QS&&this.mM)f.fM[s]=f.JS[e],f.uM[s]=f.QS[e],f.dM[s++]=this.mM[t];else if(f.iM&&f.sM&&this.mM){const u=f.iM[e],d=f.sM[e],w=this.mM[t];if(c>=50&&this.gM){const e=(50-l)*n.A.oS[c-l];f.fM[s]=i+((u+((f.iM[o]-u)*e>>16)<<9)/50|0),f.uM[s]=h+((d+((f.sM[o]-d)*e>>16)<<9)/50|0),f.dM[s++]=w+((this.gM[t]-w)*e>>16)}if(a>=50&&this.IM){const e=(50-l)*n.A.oS[a-l];f.fM[s]=i+((u+((f.iM[r]-u)*e>>16)<<9)/50|0),f.uM[s]=h+((d+((f.sM[r]-d)*e>>16)<<9)/50|0),f.dM[s++]=w+((this.IM[t]-w)*e>>16)}}if(a>=50&&f.JS&&f.QS&&this.IM)f.fM[s]=f.JS[r],f.uM[s]=f.QS[r],f.dM[s++]=this.IM[t];else if(f.iM&&f.sM&&this.IM){const u=f.iM[r],d=f.sM[r],w=this.IM[t];if(l>=50&&this.mM){const r=(50-a)*n.A.oS[l-a];f.fM[s]=i+((u+((f.iM[e]-u)*r>>16)<<9)/50|0),f.uM[s]=h+((d+((f.sM[e]-d)*r>>16)<<9)/50|0),f.dM[s++]=w+((this.mM[t]-w)*r>>16)}if(c>=50&&this.gM){const e=(50-a)*n.A.oS[c-a];f.fM[s]=i+((u+((f.iM[o]-u)*e>>16)<<9)/50|0),f.uM[s]=h+((d+((f.sM[o]-d)*e>>16)<<9)/50|0),f.dM[s++]=w+((this.gM[t]-w)*e>>16)}}if(c>=50&&f.JS&&f.QS&&this.gM)f.fM[s]=f.JS[o],f.uM[s]=f.QS[o],f.dM[s++]=this.gM[t];else if(f.iM&&f.sM&&this.gM){const u=f.iM[o],d=f.sM[o],w=this.gM[t];if(a>=50&&this.IM){const e=(50-c)*n.A.oS[a-c];f.fM[s]=i+((u+((f.iM[r]-u)*e>>16)<<9)/50|0),f.uM[s]=h+((d+((f.sM[r]-d)*e>>16)<<9)/50|0),f.dM[s++]=w+((this.IM[t]-w)*e>>16)}if(l>=50&&this.mM){const r=(50-c)*n.A.oS[l-c];f.fM[s]=i+((u+((f.iM[e]-u)*r>>16)<<9)/50|0),f.uM[s]=h+((d+((f.sM[e]-d)*r>>16)<<9)/50|0),f.dM[s++]=w+((this.mM[t]-w)*r>>16)}}}const h=f.fM[0],r=f.fM[1],o=f.fM[2],l=f.uM[0],a=f.uM[1],c=f.uM[2];if(!((h-r)*(c-a)-(l-a)*(o-r)<=0))if(n.A.Sb=!1,3===s){let s;if((h<0||r<0||o<0||h>e.A.Mb||r>e.A.Mb||o>e.A.Mb)&&(n.A.Sb=!0),s=this.jv?3&this.jv[t]:0,i)n.A.rd(h,r,l,a,f.dM[0]),n.A.rd(r,o,a,c,f.dM[1]),n.A.rd(o,h,c,l,f.dM[2]);else if(0===s)n.A.Nb(h,r,o,l,a,c,f.dM[0],f.dM[1],f.dM[2]);else if(1===s&&this.mM)n.A.IS(h,r,o,l,a,c,n.A.palette[this.mM[t]]);else if(2===s&&this.jv&&this.h_&&f.iM&&f.sM&&f.hM){const i=this.jv[t]>>2,s=this.CM[i],e=this.TM[i],u=this.OM[i];n.A.Bb(h,r,o,l,a,c,f.dM[0],f.dM[1],f.dM[2],f.iM[s],f.sM[s],f.hM[s],f.iM[e],f.iM[u],f.sM[e],f.sM[u],f.hM[e],f.hM[u],this.h_[t])}else if(3===s&&this.jv&&this.h_&&this.mM&&f.iM&&f.sM&&f.hM){const i=this.jv[t]>>2,s=this.CM[i],e=this.TM[i],u=this.OM[i];n.A.Bb(h,r,o,l,a,c,this.mM[t],this.mM[t],this.mM[t],f.iM[s],f.sM[s],f.hM[s],f.iM[e],f.iM[u],f.sM[e],f.sM[u],f.hM[e],f.hM[u],this.h_[t])}}else if(4===s){let s;if((h<0||r<0||o<0||h>e.A.Mb||r>e.A.Mb||o>e.A.Mb||f.fM[3]<0||f.fM[3]>e.A.Mb)&&(n.A.Sb=!0),s=this.jv?3&this.jv[t]:0,i)n.A.rd(h,r,l,a,f.dM[0]),n.A.rd(r,o,a,c,f.dM[1]),n.A.rd(o,f.fM[3],c,f.uM[3],f.dM[2]),n.A.rd(f.fM[3],h,f.uM[3],l,f.dM[3]);else if(0===s)n.A.Nb(h,r,o,l,a,c,f.dM[0],f.dM[1],f.dM[2]),n.A.Nb(h,o,f.fM[3],l,c,f.uM[3],f.dM[0],f.dM[2],f.dM[3]);else if(1===s){if(this.mM){const i=n.A.palette[this.mM[t]];n.A.IS(h,r,o,l,a,c,i),n.A.IS(h,o,f.fM[3],l,c,f.uM[3],i)}}else if(2===s&&this.jv&&this.h_&&f.iM&&f.sM&&f.hM){const i=this.jv[t]>>2,s=this.CM[i],e=this.TM[i],u=this.OM[i];n.A.Bb(h,r,o,l,a,c,f.dM[0],f.dM[1],f.dM[2],f.iM[s],f.sM[s],f.hM[s],f.iM[e],f.iM[u],f.sM[e],f.sM[u],f.hM[e],f.hM[u],this.h_[t]),n.A.Bb(h,o,f.fM[3],l,c,f.uM[3],f.dM[0],f.dM[2],f.dM[3],f.iM[s],f.sM[s],f.hM[s],f.iM[e],f.iM[u],f.sM[e],f.sM[u],f.hM[e],f.hM[u],this.h_[t])}else if(3===s&&this.jv&&this.h_&&this.mM&&f.iM&&f.sM&&f.hM){const i=this.jv[t]>>2,s=this.CM[i],e=this.TM[i],u=this.OM[i];n.A.Bb(h,r,o,l,a,c,this.mM[t],this.mM[t],this.mM[t],f.iM[s],f.sM[s],f.hM[s],f.iM[e],f.iM[u],f.sM[e],f.sM[u],f.hM[e],f.hM[u],this.h_[t]),n.A.Bb(h,o,f.fM[3],l,c,f.uM[3],this.mM[t],this.mM[t],this.mM[t],f.iM[s],f.sM[s],f.hM[s],f.iM[e],f.iM[u],f.sM[e],f.sM[u],f.hM[e],f.hM[u],this.h_[t])}}}xM(t,i,s,h,e){if(!h)return;const r=h.length;if(0===e){let e=0;f.gn=0,f.wM=0,f.En=0;for(let t=0;t0?(f.gn=(f.gn/e|0)+t,f.wM=(f.wM/e|0)+i,f.En=(f.En/e|0)+s):(f.gn=t,f.wM=i,f.En=s)}else if(1===e)for(let e=0;e=this.iC.length)continue;const r=this.iC[n];if(r)for(let h=0;h=this.iC.length)continue;const o=this.iC[r];if(o)for(let h=0;h>16;this.q_[e]=this.q_[e]*u-this.z_[e]*c>>16,this.z_[e]=t}if(0!==r){c=n.A.sin[r],u=n.A.cos[r];const t=this.q_[e]*u-this.Z_[e]*c>>16;this.Z_[e]=this.q_[e]*c+this.Z_[e]*u>>16,this.q_[e]=t}if(0!==l){c=n.A.sin[l],u=n.A.cos[l];const t=this.Z_[e]*c+this.z_[e]*u>>16;this.Z_[e]=this.Z_[e]*u-this.z_[e]*c>>16,this.z_[e]=t}this.z_[e]+=f.gn,this.q_[e]+=f.wM,this.Z_[e]+=f.En}}else if(3===e)for(let e=0;e=this.iC.length)continue;const r=this.iC[n];if(r)for(let h=0;h=this.tC.length)continue;const e=this.tC[s];if(e)for(let i=0;i255&&(this._M[s]=255)}}}DM(){this.eC=0,this.yO=0,this.Wv=0,this.Yv=999999,this.Vv=-999999,this.Xv=-99999,this.Kv=99999;for(let t=0;tthis.Vv&&(this.Vv=i),hthis.Xv&&(this.Xv=h),-s>this.eC&&(this.eC=-s),s>this.Wv&&(this.Wv=s);const e=i*i+h*h;e>this.yO&&(this.yO=e)}this.yO=0|Math.sqrt(this.yO),this.bM=0|Math.sqrt(this.yO*this.yO+this.eC*this.eC),this.vM=this.bM+(0|Math.sqrt(this.yO*this.yO+this.Wv*this.Wv))}PM(t,i,s,h,e,n,r,o){return!(is&&i>h&&i>e)&&(!(t{s.d(i,{A:()=>o});var h=s(8950),e=s(1069),n=s(4474),r=s(880);class o extends n.A{yc;width;height;xc;Dc;Xl;Ed;constructor(t,i){super(),this.yc=new Int32Array(t*i),this.width=this.Xl=t,this.height=this.Ed=i,this.xc=this.Dc=0}static Mc=async(t,i)=>{const s=t.read(i+'.dat');if(!s)throw new Error(`${i} jpeg not found!`);const h=await(0,r.r)(s),e=new o(h.width,h.height),n=new Uint32Array(h.data.buffer),l=e.yc;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return e};static hc=(t,i,s=0)=>{const h=new e.A(t.read(i+'.dat')),n=new e.A(t.read('index.dat'));n.jc=h.rA;const r=n.rA,l=n.rA,a=[],c=n.cA-1;for(let t=0;th.length||n.jc>n.length)throw new Error;const f=n.cA,u=n.cA,d=n.rA,w=n.rA,y=new o(d,w);y.xc=f,y.Dc=u,y.Xl=r,y.Ed=l;const A=n.cA;if(0===A){const t=y.width*y.height;for(let i=0;ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.GM(r,n,this.yc,e,l,h.A.yc,s,o)}Kl(t,i,s){i|=0,s|=0;let e=(i+=this.xc)+(s+=this.Dc)*h.A.pC,n=0,r=this.height,o=this.width,l=h.A.pC-o,a=0;if(sh.A.bottom&&(r-=s+r-h.A.bottom),ih.A.right){const t=i+o-h.A.right;o-=t,a+=t,l+=t}o>0&&r>0&&this.HM(o,r,this.yc,n,a,h.A.yc,e,l,t)}cc(t,i){t|=0,i|=0;let s=(t+=this.xc)+(i+=this.Dc)*h.A.pC,e=0,n=this.height,r=this.width,o=h.A.pC-r,l=0;if(ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.WM(r,n,this.yc,e,l,h.A.yc,s,o)}lc(){const t=this.yc,i=this.width,s=this.height;for(let h=0;h>16&255;n+=t,n<1?n=1:n>255&&(n=255);let r=e>>8&255;r+=i,r<1?r=1:r>255&&(r=255);let o=255&e;o+=s,o<1?o=1:o>255&&(o=255),this.yc[h]=(n<<16)+(r<<8)+o}}}TC(t,i,s,e){t|=0,i|=0,s|=0,e|=0;try{const n=this.width;let r=0,o=0;const l=this.Xl,a=this.Ed,c=(l<<16)/s|0,f=(a<<16)/e|0;t+=(this.xc*s+l-1)/l|0,i+=(this.Dc*e+a-1)/a|0,this.xc*s%l!=0&&(r=(l-this.xc*s%l<<16)/s|0),this.Dc*e%a!=0&&(o=(a-this.Dc*e%a<<16)/e|0),s=s*(this.width-(r>>16))/l|0,e=e*(this.height-(o>>16))/a|0;let u=t+i*h.A.pC,d=h.A.pC-s;if(ih.A.bottom&&(e-=i+e-h.A.bottom),th.A.right){const i=t+s-h.A.right;s-=i,d+=i}this.scale(s,e,this.yc,r,o,h.A.yc,d,u,n,c,f)}catch(t){console.error('error in sprite clipping routine')}}Ad(t,i,s,e,n,r,o,l,a,c){t|=0,i|=0,s|=0,e|=0;try{const f=-s/2|0,u=-e/2|0,d=65536*Math.sin(a/326.11)|0,w=65536*Math.cos(a/326.11)|0,y=d*c>>8,A=w*c>>8;let p=(o<<16)+u*y+f*A,m=u*A-f*y+(l<<16),I=t+i*h.A.pC;for(let t=0;t>16)+(o>>16)*this.width],e+=A,o-=y;p+=y,m+=A,I+=h.A.pC}}catch(t){}}gd(t,i,s){t|=0,i|=0;let e=(t+=this.xc)+(i+=this.Dc)*h.A.pC,n=0,r=this.height,o=this.width,l=h.A.pC-o,a=0;if(ih.A.bottom&&(r-=i+r-h.A.bottom),th.A.right){const i=t+o-h.A.right;o-=i,a+=i,l+=i}o>0&&r>0&&this.YM(o,r,this.yc,a,n,h.A.yc,e,l,s.yc)}scale(t,i,s,h,e,n,r,o,l,a,c){try{const f=h;for(let u=-i;u<0;u++){const i=(e>>16)*l;for(let e=-t;e<0;e++){const t=s[(h>>16)+i];0===t?o++:n[o++]=t,h+=a}e+=c,h=f,o+=r}}catch(t){console.error('error in plot_scale')}}WM(t,i,s,h,e,n,r,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)n[r++]=s[h++],n[r++]=s[h++],n[r++]=s[h++],n[r++]=s[h++];for(let i=t;i<0;i++)n[r++]=s[h++];r+=o,h+=e}}HM(t,i,s,h,e,n,r,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=s[h++];if(0===t)r++;else{const i=n[r];n[r++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}r+=o,h+=e}}GM(t,i,s,h,e,n,r,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=s[h++];0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t}for(let i=t;i<0;i++){const t=s[h++];0===t?r++:n[r++]=t}r+=o,h+=e}}YM(t,i,s,h,e,n,r,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=s[e++];0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++}for(let i=t;i<0;i++){const t=s[e++];0!==t&&0===l[r]?n[r++]=t:r++}r+=o,e+=h}}}},1673:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8950),e=s(1069),n=s(4474);class r extends n.A{yc;width;height;xc;Dc;Xl;Ed;palette;constructor(t,i,s){super(),this.yc=new Int8Array(t*i),this.width=this.Xl=t,this.height=this.Ed=i,this.xc=this.Dc=0,this.palette=s}static hc=(t,i,s=0)=>{const h=new e.A(t.read(i+'.dat')),n=new e.A(t.read('index.dat'));n.jc=h.rA;const o=n.rA,l=n.rA,a=n.cA,c=new Int32Array(a);for(let t=1;th.length||n.jc>n.length)throw new Error;const f=n.cA,u=n.cA,d=n.rA,w=n.rA,y=new r(d,w,c);y.xc=f,y.Dc=u,y.Xl=o,y.Ed=l;const A=y.yc,p=n.cA;if(0===p){const t=y.width*y.height;for(let i=0;ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.VM(r,n,this.yc,e,l,h.A.yc,s,o)}lc(){const t=this.yc,i=this.width,s=this.height;for(let h=0;h>16&255;e+=t,e<0?e=0:e>255&&(e=255);let n=this.palette[h]>>8&255;n+=i,n<0?n=0:n>255&&(n=255);let r=255&this.palette[h];r+=s,r<0?r=0:r>255&&(r=255),this.palette[h]=(e<<16)+(n<<8)+r}}AS(){this.Xl|=0,this.Ed|=0,this.Xl/=2,this.Ed/=2,this.Xl|=0,this.Ed|=0;const t=new Int8Array(this.Xl*this.Ed);let i=0;for(let s=0;s>1)+(s+this.Dc>>1)*this.Xl]=this.yc[i++];this.yc=t,this.width=this.Xl,this.height=this.Ed,this.xc=0,this.Dc=0}TC(){if(this.width===this.Xl&&this.height===this.Ed)return;const t=new Int8Array(this.Xl*this.Ed);let i=0;for(let s=0;s>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=s[h++];0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=s[h++];0===t?r++:n[r++]=this.palette[255&t]}r+=o,h+=e}}clip(t,i,s,e){try{const n=this.width;this.height;let r=0,o=0;const l=this.Xl,a=this.Ed,c=(l<<16)/s|0,f=(a<<16)/e|0;t=t+(this.xc*s+l-1)/l|0,i=i+(this.Dc*e+a-1)/a|0,this.xc*s%l!=0&&(r=(l-this.xc*s%l<<16)/s|0),this.Dc*e%a!=0&&(o=(a-this.Dc*e%a<<16)/e|0),s=s*(this.width-(r>>16))/l|0,e=e*(this.height-(o>>16))/a|0;let u,d=t+i*h.A.pC,w=h.A.pC-s;ih.A.bottom&&(e-=i+e-h.A.bottom),th.A.right&&(u=t+s-h.A.right,s-=u,w+=u),this.KM(h.A.yc,this.yc,this.palette,r,o,d,w,s,e,c,f,n)}catch(t){console.log('error in sprite clipping routine')}}KM(t,i,s,h,e,n,r,o,l,a,c,f){try{const u=h;for(let d=-l;d<0;d++){const l=(e>>16)*f;for(let e=-o;e<0;e++){const e=i[(h>>16)+l];0==e?n++:t[n++]=s[255&e],h+=a}e+=c,h=u,n+=r}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,s)=>{s.d(i,{A:()=>l});var h=s(8950),e=s(1069),n=s(4474);class r{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}XM(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}eA(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=s(9298);class l extends n.A{static Yc='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static jM=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let s=l.Yc.indexOf(String.fromCharCode(i));t&&s>=63&&s--,-1===s&&(s=74),l.jM[i]=s}}zM=[];ZM=new Int32Array(94);qM=new Int32Array(94);$M=new Int32Array(94);JM=new Int32Array(94);QM=new Int32Array(95);tk=new Int32Array(256);random=new r(BigInt(Date.now()));height=0;static hc=(t,i)=>{const s=new e.A(t.read(i+'.dat')),h=new e.A(t.read('index.dat'));h.jc=s.rA+4;const n=h.cA;n>0&&(h.jc+=3*(n-1));const r=new l;for(let t=0;t<94;t++){r.$M[t]=h.cA,r.JM[t]=h.cA;const i=r.ZM[t]=h.rA,e=r.qM[t]=h.rA,n=h.cA,o=i*e;if(r.zM[t]=new Int8Array(o),0===n)for(let h=0;hr.height&&(r.height=e),r.$M[t]=1,r.QM[t]=i+2;{let s=0;for(let h=e/7|0;h=h.A.bottom&&(n-=s+n+1-h.A.bottom),i=h.A.right){const t=i+e+1-h.A.right;e-=t,a+=t,l+=t}e>0&&n>0&&this.ek(e,n,t,c,a,h.A.yc,o,l,r)}hk(t,i,s,e,n,r,o){s|=0,e|=0;let l=(t|=0)+(i|=0)*h.A.pC,a=h.A.pC-s,c=0,f=0;if(i=h.A.bottom&&(e-=i+e+1-h.A.bottom),t=h.A.right){const i=t+s+1-h.A.right;s-=i,c+=i,a+=i}s>0&&e>0&&this.nk(s,e,h.A.yc,l,a,o,f,c,n,r)}ek(t,i,s,h,e,n,r,o,l){const a=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=a;t<0;t++)0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l;for(let i=t;i<0;i++)0===s[h++]?r++:n[r++]=l;r+=o,h+=e}}nk(t,i,s,h,e,n,r,o,l,a){t|=0;const c=((16711935&l)*a&4278255360)+((65280&l)*a&16711680)>>8,f=256-a;for(let l=-(i|=0);l<0;l++){for(let i=-t;i<0;i++)if(0===n[r++])h++;else{const t=s[h];s[h++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}h+=e,r+=o}}sk(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.ql:'cya'===t?o.A.Pc:'mag'===t?o.A.Fc:'whi'===t?o.A.Sl:'bla'===t?o.A.Zl:'lre'===t?o.A.zR:'dre'===t?o.A.dd:'dbl'===t?o.A.ud:'or1'===t?o.A.ZR:'or2'===t?o.A.qR:'or3'===t?o.A.$R:'gr1'===t?o.A.JR:'gr2'===t?o.A.QR:'gr3'===t?o.A.tS:o.A.Zl}split(t,i){if(0===t.length)return[t];const s=[];for(;t.length>0;){if(this.Iu(t)<=i&&-1===t.indexOf('|')){s.push(t);break}let h=t.length;for(let s=0;si)break;h=s}else if('|'===t[s]){h=s;break}s.push(t.substring(0,h)),t=t.substring(h+1)}return s}}},1183:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(8950),e=s(7854);class n{rk;width;height;lk;ak;yc;constructor(t,i,s=e.el){this.lk=s,this.rk=this.lk.getImageData(0,0,t,i),this.ak=new Uint32Array(this.rk.data.buffer),this.yc=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.yc.fill(0)}bind(){h.A.bind(this.yc,this.width,this.height)}draw(t,i){this.#t(),this.lk.putImageData(this.rk,t,i)}#t(){const t=this.yc.length,i=this.yc,s=this.ak;for(let h=0;h>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},3955:(t,i,s)=>{s.d(i,{A:()=>h});class h{static AA=150;static Pf=108;static Df=70;static nf=81;static df=189;static Hw=7;static nw=88;static iw=30;static aw=176;static $d=220;static Vw=66;static Nw=17;static mw=2;static Uw=238;static Oy=233;static qf=146;static gf=215;static Nf=236;static eg=85;static bI=219;static Cw=140;static Lw=40;static bw=200;static Tw=178;static Ow=247;static Yw=138;static fw=239;static lw=194;static ew=8;static rw=27;static ow=113;static cw=100;static Ew=134;static pw=202;static dw=245;static Rw=172;static Xw=96;static Ww=97;static Kw=116;static _w=9;static qd=75;static jd=164;static Iw=53;static gw=185;static Xd=206;static ty=177;static Zw=248;static sw=195;static hw=71;static tw=133;static Jd=157;static Qd=211;static yw=48;static ww=130;static Fw=31;static Gw=59;static Dw=212;static Bw=38;static Pw=6;static xw=155;static Aw=235;static sA=231;static Sy=237;static Wf=175;static Wm=93;static Iy=190;static Hm=165;static Af=159;static Fy=171;static Py=79;static Ay=52;static Ry=244;static vy=148;static Ny=11;static Dy=118;static ky=4;static xy=158;static Gm=181}},3554:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(6666),e=s(1982),n=s(9234);class r{ck;fk;uk;closed=!1;dk=!1;static Kc=async t=>await new Promise(((i,s)=>{const h=t.host.startsWith('https'),e=h?'wss':'ws',n=t.host.substring(t.host.indexOf('//')+2),r=h?t.port+2:t.port+1,o=new WebSocket(`${e}://${n}:${r}`,'binary');o.addEventListener('open',(()=>{console.log('connection open!'),i(o)})),o.addEventListener('error',(()=>{console.log('connection error!'),s(o)}))}));constructor(t){t.onclose=this.onclose,t.onerror=this.onerror,this.fk=new a(t,5e3),this.uk=new o(t,5e3),this.ck=t}get host(){return this.ck.url.split('/')[2]}get port(){return parseInt(this.ck.url.split(':')[2],10)}get available(){return this.closed?0:this.fk.available}write(t,i){this.uk.write(t,i)}async read(){return this.closed?0:this.fk.wk()??await this.fk.yk()}async Xc(t,i,s){if(!this.closed)for(;s>0;){const h=this.fk.Ak(t,i,s)??await this.fk.pk(t,i,s);if(h.length<=0)throw new Error('EOF');i+=h.length,s-=h.length}}close(){this.closed=!0,this.ck.close(),this.fk.close(),this.uk.close(),console.log('connection close!'),this.dk&&console.log('connection error!')}onclose=t=>{this.closed||this.close()};onerror=t=>{this.closed||(this.dk=!0,this.close())}}class o{ck;mk;closed=!1;dk=!1;constructor(t,i){this.ck=t,this.mk=i}write(t,i){if(!this.closed){if(this.dk)throw this.dk=!1,new Error('Error in writer thread');if(i>this.mk||t.length>this.mk)throw new Error('buffer overflow');try{this.ck.send(t.subarray(0,i))}catch(t){this.dk=!0}}}close(){this.closed=!0}}class l extends e.A{qm;position;constructor(t){super(),this.qm=t,this.position=0}get available(){return this.qm.length-this.position}get read(){return this.qm[this.position++]}get Ik(){return this.qm.length}}class a{mk;queue=new h.A;event=null;gk=null;total=0;closed=!1;constructor(t,i){this.mk=i,t.binaryType='arraybuffer',t.onmessage=this.onmessage}get available(){return this.total}onmessage=t=>{if(this.closed)throw new Error('WebSocketReader is closed!');const i=new l(new Uint8Array(t.data));if(this.event?this.queue.yg(i):this.event=i,this.total+=i.Ik,this.gk&&(this.gk(this.event),this.gk=null,this.total>this.mk))throw new Error('buffer overflow')};Ek(){return this.event&&this.event.available>0?this.event.read:null}async _k(t){for(this.event=this.queue.ub();this.totalthis.gk=t)),(0,n.Jo)(2e3).then((()=>{if(this.closed)throw new Error('WebSocketReader closed while reading.')}))]);return this.event?this.event.read:this._k(t)}Ak(t,i,s){if(this.closed)throw new Error('WebSocketReader is closed!');if(!(this.event&&this.event.available>=s))return null;for(;s>0;){const h=this.Ek();if(null===h)throw new Error('EOF - tried to read a fast byte when there was not enough immediate bytes.');t[i++]=h,this.total--,s--}return t}async pk(t,i,s){if(this.closed)throw new Error('WebSocketReader is closed!');for(;s>0;)t[i++]=this.Ek()??await this._k(s),this.total--,s--;return t}wk(){if(this.closed)throw new Error('WebSocketReader is closed!');const t=this.Ek();return null===t?null:(this.total--,t)}async yk(){if(this.closed)throw new Error('WebSocketReader is closed!');const t=await this._k(1);return this.total--,t}close(){this.closed=!0,this.gk=null,this.total=0,this.event=null,this.queue.clear()}}},296:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(6666),e=s(1982),n=s(9234);class r{Co;Yo;Ck;closed=!1;dk=!1;constructor(t,i){this.Co=t,this.Co.onerror=this.onerror,this.Co.onmessageerror=this.onmessageerror,this.Yo=new a(5e3),this.Ck=new o(this.Co,5e3,i),this.Co.postMessage({type:'connection',id:i})}get available(){return this.closed?0:this.Yo.available}write(t,i){this.Ck.write(t,i)}async read(){return this.closed?0:this.Yo.wk()??await this.Yo.yk()}async Xc(t,i,s){if(!this.closed)for(;s>0;){const h=this.Yo.Ak(t,i,s)??await this.Yo.pk(t,i,s);if(h.length<=0)throw new Error('EOF');i+=h.length,s-=h.length}}close(){this.closed=!0,this.Yo.close(),this.Ck.close(),console.log('connection close!'),this.dk&&console.log('connection error!')}onerror=t=>{this.closed||(this.dk=!0,this.close())};onmessageerror=t=>{this.closed||(this.dk=!0,this.close())}}class o{Co;mk;Mo;closed=!1;dk=!1;constructor(t,i,s){this.Co=t,this.mk=i,this.Mo=s}write(t,i){if(!this.closed){if(this.dk)throw this.dk=!1,new Error('Error in writer thread');if(i>this.mk||t.length>this.mk)throw new Error('buffer overflow');try{this.Co.postMessage({type:'data',data:t.subarray(0,i),id:this.Mo})}catch(t){this.dk=!0}}}close(){this.closed=!0}}class l extends e.A{qm;position;constructor(t){super(),this.qm=t,this.position=0}get available(){return this.qm.length-this.position}get read(){return this.qm[this.position++]}get Ik(){return this.qm.length}}class a{mk;queue=new h.A;event=null;gk=null;total=0;closed=!1;constructor(t){this.mk=t}get available(){return this.total}onmessage=t=>{const i='string'==typeof t.data?JSON.parse(t.data):t;if('data'!==i.type)return void console.error('Unexpected message type: ',i.type);if(this.closed)throw new Error('WorkerReader is closed!');const s=new l(new Uint8Array(i.data));if(this.event?this.queue.yg(s):this.event=s,this.total+=s.Ik,this.gk&&(this.gk(this.event),this.gk=null,this.total>this.mk))throw new Error('buffer overflow')};Ek(){return this.event&&this.event.available>0?this.event.read:null}async _k(t){for(this.event=this.queue.ub();this.totalthis.gk=t)),(0,n.Jo)(2e3).then((()=>{if(this.closed)throw new Error('WorkerReader closed while reading.')}))]);return this.event?this.event.read:this._k(t)}Ak(t,i,s){if(this.closed)throw new Error('WorkerReader is closed!');if(!(this.event&&this.event.available>=s))return null;for(;s>0;){const h=this.Ek();if(null===h)throw new Error('EOF - tried to read a fast byte when there was not enough immediate bytes.');t[i++]=h,this.total--,s--}return t}async pk(t,i,s){if(this.closed)throw new Error('WorkerReader is closed!');for(;s>0;)t[i++]=this.Ek()??await this._k(s),this.total--,s--;return t}wk(){if(this.closed)throw new Error('WorkerReader is closed!');const t=this.Ek();return null===t?null:(this.total--,t)}async yk(){if(this.closed)throw new Error('WorkerReader is closed!');const t=await this._k(1);return this.total--,t}close(){this.closed=!0,this.gk=null,this.total=0,this.event=null,this.queue.clear()}}},4544:(t,i,s)=>{s.d(i,{A:()=>h});class h{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const s=indexedDB.open('lostcity',1);s.onsuccess=i=>{const s=i.target;console.log('database success!'),t(s.result)},s.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},s.onerror=t=>{const s=t.target;console.error('database error!: ',s.error),i(s.result)}}));zo=async t=>await new Promise((i=>{const s=this.db.transaction('cache','readonly').objectStore('cache').get(t);s.onsuccess=()=>{i(s.result)},s.onerror=t=>{i(void 0)}}));Qo=async(t,i)=>await new Promise(((s,h)=>{const e=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);e.onsuccess=()=>{s()},e.onerror=t=>{h()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};Tk=t=>{const i=t.trim();let s=0;for(let t=0;t='A'&&h<='Z'?s+=h.charCodeAt(0)+1-65:h>='a'&&h<='z'?s+=h.charCodeAt(0)+1-97:h>='0'&&h<='9'&&(s+=h.charCodeAt(0)+27-48)}return s}}},2634:(t,i,s)=>{s.d(i,{A:()=>h});class h{count=0;Ok=new Int32Array(256);vk=new Int32Array(256);a=0;b=0;c=0;constructor(t){for(let i=0;i>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i;for(let l=0;l<256;l+=8)t+=this.Ok[l],i+=this.Ok[l+1],s+=this.Ok[l+2],h+=this.Ok[l+3],e+=this.Ok[l+4],n+=this.Ok[l+5],r+=this.Ok[l+6],o+=this.Ok[l+7],t^=i<<11,h+=t,i+=s,i^=s>>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i,this.vk[l]=t,this.vk[l+1]=i,this.vk[l+2]=s,this.vk[l+3]=h,this.vk[l+4]=e,this.vk[l+5]=n,this.vk[l+6]=r,this.vk[l+7]=o;for(let l=0;l<256;l+=8)t+=this.vk[l],i+=this.vk[l+1],s+=this.vk[l+2],h+=this.vk[l+3],e+=this.vk[l+4],n+=this.vk[l+5],r+=this.vk[l+6],o+=this.vk[l+7],t^=i<<11,h+=t,i+=s,i^=s>>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i,this.vk[l]=t,this.vk[l+1]=i,this.vk[l+2]=s,this.vk[l+3]=h,this.vk[l+4]=e,this.vk[l+5]=n,this.vk[l+6]=r,this.vk[l+7]=o;this.bk(),this.count=256}bk(){this.c++,this.b+=this.c;for(let t=0;t<256;t++){const i=this.vk[t],s=3&t;let h;0===s?this.a^=this.a<<13:1===s?this.a^=this.a>>>6:2===s?this.a^=this.a<<2:3===s&&(this.a^=this.a>>>16),this.a+=this.vk[t+128&255],this.vk[t]=h=this.vk[i>>>2&255]+this.a+this.b,this.Ok[t]=this.b=this.vk[h>>>8>>>2&255]+i}}}},2901:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1069),e=s(1908);class n{static Tk=t=>{let i=0;t=t.toUpperCase();for(let s=0;s=this.Rk)return null;if(this.Dk[t])return this.Dk[t];const i=this.xk[t],s=i+this.kk[t];if(this.Lk){const h=Uint8Array.from(this.buffer.subarray(i,i+s));return this.Dk[t]=h,h}{const i=Uint8Array.from(e.A.read(this.Mk[t],this.buffer,this.kk[t],this.xk[t]));return this.Dk[t]=i,i}}}},1069:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(9234),e=s(6666),n=s(4474);class r extends n.A{static Pk=3988292384;static Fk=new Int32Array(256);static Uk=new Uint32Array(33);static Bk=new e.A;static Gk=new e.A;static Hk=new e.A;static Wk=0;static Yk=0;static Vk=0;static{for(let t=0;t<32;t++)r.Uk[t]=(1<>>=1:i=i>>>1^r.Pk;r.Fk[t]=i}}static Zo=t=>{let i=4294967295;for(let s=0;s>>8^r.Fk[255&(i^t[s])];return~i};view;data;jc=0;Zm=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.jc}static Ut=t=>{let i=null;return 0===t&&r.Wk>0?(r.Wk--,i=r.Bk.ub()):1===t&&r.Yk>0?(r.Yk--,i=r.Gk.ub()):2===t&&r.Vk>0&&(r.Vk--,i=r.Hk.ub()),i?(i.jc=0,i):new r(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.jc=0,100===this.view.byteLength&&r.Wk<1e3?(r.Bk.yg(this),r.Wk++):5e3===this.view.byteLength&&r.Yk<250?(r.Gk.yg(this),r.Yk++):3e4===this.view.byteLength&&r.Vk<50&&(r.Hk.yg(this),r.Vk++)}get cA(){return this.view.getUint8(this.jc++)}get lA(){return this.view.getInt8(this.jc++)}get rA(){const t=this.view.getUint16(this.jc);return this.jc+=2,t}get cp(){const t=this.view.getInt16(this.jc);return this.jc+=2,t}get E_(){const t=this.view.getUint8(this.jc++)<<16|this.view.getUint16(this.jc);return this.jc+=2,t}get il(){const t=this.view.getInt32(this.jc);return this.jc+=4,t}get zc(){const t=this.view.getBigInt64(this.jc);return this.jc+=8,t}get YR(){return this.view.getUint8(this.jc)<128?this.cA-64:this.rA-49152}get wO(){return this.view.getUint8(this.jc)<128?this.cA:this.rA-32768}get _A(){const t=this.view,i=t.byteLength;let s,h='';for(;10!==(s=t.getUint8(this.jc++))&&this.jc>16),this.view.setUint16(this.jc,t),this.jc+=2}p4(t){this.view.setInt32(this.jc,t),this.jc+=4}Xk(t){this.view.setInt32(this.jc,t,!0),this.jc+=4}gy(t){this.view.setBigInt64(this.jc,t),this.jc+=8}Zc(t){const i=this.view,s=t.length;for(let h=0;h>>3}zm(t){let i=this.Zm>>>3,s=8-(7&this.Zm),h=0;for(this.Zm+=t;t>s;s=8)h+=(this.view.getUint8(i++)&r.Uk[s])<>>s-t&r.Uk[t],h}qc(t,i){const s=this.jc;this.jc=0;const e=new Uint8Array(s);this.YA(s,0,e);const n=(0,h.jk)(e),r=(0,h.zk)(n,i,t),o=(0,h.Zk)(r);this.jc=0,this.p1(o.length),this.$c(o,o.length,0)}}},353:(t,i,s)=>{s.d(i,{A:()=>h});class h{static qk=[95,218,67,50,253,222,194,60,101,128,8,251,92,111,24,33,223,66,232,59,227,113,153,105,126,98,167,102,177,238,62,190,147,23,150,151,156,144,193,155,81,0,198,22,137,210,179,16,168,170,32,181,248,141,58,87,208,106,180,191,221,241,40,176,196,154,65,145,230,78,30,161,188,41,14,129,18,199,47,247,225,34,51,10,159,75,12,56,61,31,39,91,46,242,134,5,122,123,209,228,104,195,21,3,11,44,107,172,6,186,110,215,205,103,27,185,124,77,252,117,86,115,127,207,52,79,43,97,219,116,169,7,118,162,108,36,20,233,88,135,80,19,42,237,57,152,71,9,250,17,4,119,234,130,26,200,189,163,254,245,197,171,220,235,140,244,184,94,211,231,99,246,121,212,112,204,63,148,83,178,1,255,131,13,183,142,236,45,55,35,243,136,37,85,100,160,38,224,146,174,82,48,109,132,125,90,143,138,240,173,165,164,192,175,29,74,28,114,213,73,64,206,76,139,96,2,229,15,93,25,239,202,49,70,214,201,72,203,68,89,69,157,216,217,249,120,226,84,149,187,54,53,158,166,182,133,0];static nA=[0,-2,4,6,-1,0,0,2,0,0,0,0,5,4,2,2,0,0,0,0,2,-2,2,14,0,6,3,0,4,0,0,0,3,0,0,0,0,0,0,0,0,-1,4,2,6,0,6,0,0,3,7,0,0,0,-1,0,0,0,0,4,0,0,0,0,0,0,0,0,1,15,0,0,0,0,6,0,2,0,0,0,2,0,0,0,1,0,0,4,0,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,-2,0,0,2,0,0,0,2,9,0,0,0,0,0,4,0,0,0,3,7,9,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,3,2,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,-2,2,0,0,0,0,0,6,0,0,0,2,0,2,0,0,0,-2,0,0,4,0,0,0,0,6,0,0,-2,-2,0,0,0,0,0,0,-2,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0]}},5226:(t,i,s)=>{s.d(i,{Q:()=>e,x:()=>h});class h{$k=new Map;Co;Mo=self.isSecureContext?self.crypto.randomUUID():'0';constructor(t){this.Co=t}async Ko(){const t=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),i=t.createDataChannel('channel'),s=crypto.randomUUID();this.$k.set(s,i),await t.setLocalDescription(await t.createOffer()),t.onicegatheringstatechange=async()=>{if('complete'===t.iceGatheringState){let i;self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(t.localDescription)):console.log(JSON.stringify(t.localDescription));try{for(;null===(i=prompt('Offer copied to clipboard, paste answer here')););t.setRemoteDescription(new RTCSessionDescription(JSON.parse(i)))}catch(t){console.error(t)}}},i.onopen=()=>{i.send(JSON.stringify({type:'id',id:s})),console.log('Connected to peer!')},i.onerror=t=>{console.error(t)},i.onmessage=t=>{const i=JSON.parse(t.data);i.data&&(i.data=Object.values(i.data)),this.Co&&this.Co.postMessage(i)}}postMessage(t){const i=this.$k.get(t.data.id),s=t.data;s.data&&(s.data=Array.from(t.data.data)),i&&'open'===i.readyState&&i.send(JSON.stringify(s))}}class e{pc;So=void 0;Mo;constructor(t){this.pc=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),this.pc.ondatachannel=i=>{this.So=i.channel,this.So.onopen=()=>{console.log('Connected to host!')},this.So.onerror=t=>{console.error(t)},this.So.onmessage=i=>{if(!this.Mo){const t=JSON.parse(i.data);if('id'===t.type)return void(this.Mo=t.id)}t.onmessage&&t.onmessage(i)}},this.pc.onicegatheringstatechange=async()=>{'complete'===this.pc.iceGatheringState&&(self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(this.pc.localDescription)):console.log(JSON.stringify(this.pc.localDescription)))}}async Xo(t){await this.pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(t))),await this.pc.setLocalDescription(await this.pc.createAnswer())}}},2215:(t,i,s)=>{s.d(i,{A:()=>h});class h{static lp=14;static UA=28;static Np=129;static HA=167;static Rp=168;static rp=195;static Sp=2;static kp=26;static Op=46;static Cp=84;static Ip=87;static ep=103;static GA=146;static mA=197;static Pp=201;static sp=204;static ap=209;static $A=126;static gp=185;static ZA=15;static KA=98;static Hp=213;static _p=74;static Gp=13;static fp=3;static Dp=239;static dA=1;static Wp=184;static VA=133;static XA=226;static Tp=4;static xp=21;static np=32;static vy=41;static aA=152;static OA=19;static Bp=22;static gA=25;static fA=43;static Fp=44;static Ep=68;static Mp=136;static vA=139;static qA=140;static CA=142;static zA=243;static QA=254;static TA=20;static uA=80;static pp=132;static WA=220;static yA=237;static oA=150;static BA=175;static mp=193;static tp=12;static EA=54;static JA=212;static hp=7;static up=135;static Up=162;static LA=23;static DA=42;static kA=49;static RA=50;static PA=59;static MA=69;static NA=76;static bA=151;static SA=191;static xA=223}},3937:(t,i,s)=>{s.d(i,{A:()=>o});class h{start=0;end=0;form=0;length=0;Jk=null;Qk=null;threshold=0;position=0;delta=0;amplitude=0;tx=0;read(t){this.form=t.cA,this.start=t.il,this.end=t.il,this.length=t.cA,this.Jk=new Int32Array(this.length),this.Qk=new Int32Array(this.length);for(let i=0;i=this.threshold&&this.Qk&&this.Jk&&(this.amplitude=this.Qk[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this.Jk[this.position]/65536*t|0,this.threshold>this.tx&&(this.delta=((this.Qk[this.position]<<15)-this.amplitude)/(this.threshold-this.tx)|0)),this.amplitude+=this.delta,this.tx++,this.amplitude-this.delta>>15}}class e{static buffer=null;static KT=null;static sin=null;static ix=new Int32Array(5);static sx=new Int32Array(5);static hx=new Int32Array(5);static nx=new Int32Array(5);static ox=new Int32Array(5);lx=null;ux=null;wx=null;yx=null;Ax=null;mx=null;release=null;attack=null;Ix=new Int32Array(5);gx=new Int32Array(5);Ex=new Int32Array(5);start=0;length=500;_x=100;Cx=0;static init=()=>{this.KT=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.KT[t]=1:this.KT[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};sf(t,i){for(let i=0;i>1,r+=(i*h>>16)+n}if(this.Ax&&this.mx){const i=this.Ax.evaluate(t),s=this.mx.evaluate(t);c=c*(32768+(this.Tx(s,a,this.Ax.form)>>1))>>15,a+=(i*o>>16)+l}for(let h=0;h<5;h++)if(0!==this.Ix[h]){const n=i+e.sx[h];n>15,e.ix[h],this.lx.form),e.ix[h]+=(s*e.nx[h]>>16)+e.ox[h])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,s=!0;for(let h=0;h>8):this.release.start+((this.release.end-this.release.start)*r>>8),i+=256,i>=o&&(i=0,s=!s),s&&(e.buffer[h]=0)}}if(this.Cx>0&&this._x>0){const i=this.Cx*s;for(let s=i;s32767&&(e.buffer[i]=32767);return e.buffer}Tx(t,i,s){return 1===s?(32767&i)<16384?t:-t:2===s?e.sin[32767&i]*t>>14:3===s?((32767&i)*t>>14)-t:4===s?e.KT[i/2607&32767]*t:0}read(t){this.lx=new h,this.lx.read(t),this.ux=new h,this.ux.read(t),0!==t.cA&&(t.jc--,this.wx=new h,this.wx.read(t),this.yx=new h,this.yx.read(t)),0!==t.cA&&(t.jc--,this.Ax=new h,this.Ax.read(t),this.mx=new h,this.mx.read(t)),0!==t.cA&&(t.jc--,this.release=new h,this.release.read(t),this.attack=new h,this.attack.read(t));for(let i=0;i<10;i++){const s=t.wO;if(0===s)break;this.Ix[i]=s,this.gx[i]=t.YR,this.Ex[i]=t.wO}this.Cx=t.wO,this._x=t.wO,this.length=t.rA,this.start=t.rA}}var n=s(1069),r=s(3867);class o{static ip=new Int32Array(1e3);static Ox=null;static vx=null;static bx=new r.ds(1e3,null);Lx=new r.ds(10,null);Rx=0;loopEnd=0;static wc=t=>{const i=new n.A(t.read('sounds.dat'));for(this.Ox=new Uint8Array(441e3),this.vx=new n.A(this.Ox),e.init();;){const t=i.rA;if(65535===t)break;const s=new o;s.read(i),this.bx[t]=s,this.ip[t]=s.trim()}};static sf=(t,i)=>{if(!this.bx[t])return null;const s=this.bx[t];return s?.Sx(i)??null};read(t){for(let i=0;i<10;i++)0!==t.cA&&(t.jc--,this.Lx[i]=new e,this.Lx[i]?.read(t));this.Rx=t.rA,this.loopEnd=t.rA}trim(){let t=9999999;for(let i=0;i<10;i++)this.Lx[i]&&(this.Lx[i].start/20|0)i&&(i=this.Lx[t].length+this.Lx[t].start);if(0===i)return 0;let s=22050*i/1e3|0,h=22050*this.Rx/1e3|0,e=22050*this.loopEnd/1e3|0;(h<0||e<0||e>s||h>=e)&&(t=0);let n=s+(e-h)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){h+=44,e+=44,s+=44,n+=44;const i=n-s;for(let t=s-1;t>=e;t--)o.Ox&&(o.Ox[t+i]=o.Ox[t]);for(let i=1;i{s.d(i,{oc:()=>a,rc:()=>o,ds:()=>h,EO:()=>e,Cr:()=>n,mO:()=>r,Kn:()=>l});class h extends Array{constructor(t,i){super(t);for(let s=0;s{s.d(i,{Zk:()=>l,$o:()=>e,jk:()=>o,Jo:()=>h,sc:()=>n,Nc:()=>r,zk:()=>a});const h=async t=>new Promise((i=>setTimeout(i,t))),e=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),n=async t=>(await fetch(t)).text();function r(t,i,s,h,e){for(;e--;)s[h++]=t[i++]}function o(t){let i=0n;for(let s=0;s0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function a(t,i,s){let h=1n;for(;i>0n;)i%2n===1n&&(h=h*t%s),t=t*t%s,i>>=1n;return h}},7953:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1069);class e{static Mx=new Uint16Array(['d','o','t'].join('').split('').map((t=>t.charCodeAt(0))));static kx=new Uint16Array(['(','a',')'].join('').split('').map((t=>t.charCodeAt(0))));static xx=new Uint16Array(['s','l','a','s','h'].join('').split('').map((t=>t.charCodeAt(0))));static Dx=['cook',"cook's",'cooks','seeks','sheet'];static Nx=[];static Px=[];static Fx=[];static Ux=[];static Bx=[];static Gx=[];static wc=t=>{const i=new h.A(t.read('fragmentsenc.txt')),s=new h.A(t.read('badenc.txt')),e=new h.A(t.read('domainenc.txt')),n=new h.A(t.read('tldlist.txt'));this.read(s,e,i,n)};static filter=t=>{const i=[...t];this.format(i);const s=i.join('').trim(),h=s.toLowerCase(),e=[...h];this.Hx(e),this.Wx(e),this.Yx(e),this.Vx(e);for(let t=0;t{this.jx(t),this.zx(i),this.Zx(s),this.qx(h)};static qx=t=>{const i=t.il;for(let s=0;st.cA))};static jx=t=>{const i=t.il;for(let s=0;st.cA));const i=new Array(t.cA).fill([]).map((()=>[t.lA,t.lA]));i.length>0&&(this.Ux[s]=i)}};static zx=t=>{const i=t.il;for(let s=0;st.cA))};static Zx=t=>{const i=t.il;for(let s=0;s{const i=[...t],s=[...t];this.$x(null,i,this.Mx),this.$x(null,s,this.xx);for(let h=0;h{for(let i=0;i<2;i++)for(let i=this.Fx.length-1;i>=0;i--)this.$x(this.Ux[i],t,this.Fx[i])};static Yx=t=>{const i=[...t],s=[...t];this.$x(null,i,this.kx),this.$x(null,s,this.Mx);for(let h=this.Bx.length-1;h>=0;h--)this.Qx(s,i,this.Bx[h],t)};static Vx=t=>{for(let i=0;i=0&&e{if(this.rD(t))return!0;const i=this.oD(t),s=this.Gx,h=s.length;if(i===s[0]||i===s[h-1])return!0;let e=0,n=h-1;for(;e<=n;){const t=(e+n)/2|0;if(i===s[t])return!0;i{if(t.length>6)return 0;let i=0;for(let s=0;s{for(let s=i;s=0;s++)if(this.aD(t[s]))return s;return-1};static eD=(t,i)=>{for(let s=t;s=0;s++)if(!this.aD(i[s]))return s;return i.length};static cD=(t,i,s)=>i===s||'o'===i&&'0'===s?1:'o'===i&&'('===s&&')'===t?2:'c'!==i||'('!==s&&'<'!==s&&'['!==s?'e'===i&&'€'===s||'s'===i&&'$'===s||'l'===i&&'i'===s?1:0:1;static Qx=(t,i,s,h)=>{const e=s.length,n=h.length;for(let r=0;r<=n-e;r++){const{fD:e,uD:n}=this.dD(r,s,h);if(!e)continue;const o=this.wD(r,h,3,i,['@']),l=this.yD(n-1,h,3,t,['.',',']);(o>2||l>2)&&this.hD(r,n,h)}};static dD=(t,i,s)=>{const h=i.length;let e=t,n=0;for(;e0)e+=l,n++;else{if(0===n)break;const s=this.cD(o,String.fromCharCode(i[n-1]),r);if(s>0)e+=s,1===n&&t++;else{if(n>=h||!this.iD(r))break;e++}}}return{fD:n>=h,uD:e}};static $x=(t,i,s)=>{if(!(s.length>i.length))for(let h=0;h<=i.length-s.length;h++){let e=h;const{uD:n,AD:r,pD:o,mD:l,ID:a}=this.gD(i,s,e);e=n;let c=i[e],f=e+1=s.length)||l&&a)continue;let u,d=!0;if(o){let t=!1,s=!1;if((h-1<0||this.iD(i[h-1])&&"'"!==i[h-1])&&(t=!0),(e>=i.length||this.iD(i[e])&&"'"!==i[e])&&(s=!0),!t||!s){let s=!1;for(u=h-2,t&&(u=h);!s&&u=0&&(!this.iD(i[u])||"'"===i[u])){const t=[];let h;for(h=0;h<3&&u+h=0&&(!this.iD(i[u-1])||"'"===i[u-1])&&(e=!1),e&&!this.nD(t)&&(s=!0)}u++}s||(d=!1)}}else{c=' ',h-1>=0&&(c=i[h-1]),f=' ',e{let h=s,e=0,n=0,r=!1,o=!1,l=!1;for(;h=t.length||o&&l);){const a=t[h],c=h+10)1===f&&this.aD(a)&&(o=!0),2===f&&(this.aD(a)||this.aD(c))&&(o=!0),h+=f,e++;else{if(0===e)break;let t;if((t=this.TD(c,String.fromCharCode(i[e-1]),a))>0)h+=t;else{if(e>=i.length||!this.sD(a))break;if(this.iD(a)&&"'"!==a&&(r=!0),this.aD(a)&&(l=!0),h++,n++,(100*n/(h-s)|0)>90)break}}}return{uD:h,AD:e,pD:r,mD:o,ID:l}};static TD=(t,i,s)=>{if(i===s)return 1;if(i>='a'&&i<='m'){if('a'===i)return'4'!==s&&'@'!==s&&'^'!==s?'/'===s&&'\\'===t?2:0:1;if('b'===i)return'6'!==s&&'8'!==s?'1'===s&&'3'===t?2:0:1;if('c'===i)return'('!==s&&'<'!==s&&'{'!==s&&'['!==s?0:1;if('d'===i)return'['===s&&')'===t?2:0;if('e'===i)return'3'!==s&&'€'!==s?0:1;if('f'===i)return'p'===s&&'h'===t?2:'£'===s?1:0;if('g'===i)return'9'!==s&&'6'!==s?0:1;if('h'===i)return'#'===s?1:0;if('i'===i)return'y'!==s&&'l'!==s&&'j'!==s&&'1'!==s&&'!'!==s&&':'!==s&&';'!==s&&'|'!==s?0:1;if('j'===i)return 0;if('k'===i)return 0;if('l'===i)return'1'!==s&&'|'!==s&&'i'!==s?0:1;if('m'===i)return 0}if(i>='n'&&i<='z'){if('n'===i)return 0;if('o'===i)return'0'!==s&&'*'!==s?'('===s&&')'===t||'['===s&&']'===t||'{'===s&&'}'===t||'<'===s&&'>'===t?2:0:1;if('p'===i)return 0;if('q'===i)return 0;if('r'===i)return 0;if('s'===i)return'5'!==s&&'z'!==s&&'$'!==s&&'2'!==s?0:1;if('t'===i)return'7'!==s&&'+'!==s?0:1;if('u'===i)return'v'===s?1:'\\'===s&&'/'===t||'\\'===s&&'|'===t||'|'===s&&'/'===t?2:0;if('v'===i)return'\\'===s&&'/'===t||'\\'===s&&'|'===t||'|'===s&&'/'===t?2:0;if('w'===i)return'v'===s&&'v'===t?2:0;if('x'===i)return')'===s&&'('===t||'}'===s&&'{'===t||']'===s&&'['===t||'>'===s&&'<'===t?2:0;if('y'===i)return 0;if('z'===i)return 0}return i>='0'&&i<='9'?'0'===i?'o'===s||'O'===s?1:'('===s&&')'===t||'{'===s&&'}'===t||'['===s&&']'===t?2:0:'1'===i&&'l'===s?1:0:','===i?'.'===s?1:0:'.'===i?','===s?1:0:'!'===i&&'i'===s?1:0};static _D=(t,i,s)=>{let h=0,e=i.length-1;for(;h<=e;){const n=(h+e)/2|0;if(i[n][0]===t&&i[n][1]===s)return!0;tthis.lD(t)?t.charCodeAt(0)+1-'a'.charCodeAt(0):"'"===t?28:this.aD(t)?t.charCodeAt(0)+29-'0'.charCodeAt(0):27;static Jx=(t,i,s,h,e)=>{if(!(h.length>s.length))for(let n=0;n<=s.length-h.length;n++){const{uD:r,OD:o}=this.vD(s,h,n);if(o0&&c>0&&(l=!0),2===i&&(a>2&&c>0||a>0&&c>2)&&(l=!0),3===i&&a>0&&c>2&&(l=!0),!l)continue;let f,u=n,d=r-1,w=!1;if(a>2){if(4===a)for(w=!1,f=n-1;f>=0;f--)if(w){if('*'!==e[f])break;u=f}else'*'===e[f]&&(u=f,w=!0);for(w=!1,f=u-1;f>=0;f--)if(w){if(this.iD(s[f]))break;u=f}else this.iD(s[f])||(w=!0,u=f)}if(c>2){if(4===c)for(w=!1,f=d+1;f{let h=0;for(;s0)s+=r,h++;else{if(0===h)break;let t;if((t=this.cD(n,String.fromCharCode(i[h-1]),e))>0)s+=t;else{if(!this.iD(e))break;s++}}}return{uD:s,OD:h}};static iD=t=>!this.CD(t)&&!this.aD(t);static sD=t=>!this.lD(t)||('v'===t||'x'===t||'j'===t||'q'===t||'z'===t);static CD=t=>this.lD(t)||this.bD(t);static aD=t=>t>='0'&&t<='9';static lD=t=>t>='a'&&t<='z';static bD=t=>t>='A'&&t<='Z';static rD=t=>{for(let i=0;i{for(let h=t;h{let s=0;for(let h=i-1;h>=0&&this.iD(t[h]);h--)'*'===t[h]&&s++;return s};static RD=(t,i)=>{let s=0;for(let h=i+1;h(e?this.LD(i,s):this.RD(i,s))>=h?4:this.iD(e?t[s-1]:t[s+1])?1:0;static wD=(t,i,s,h,e)=>{if(0===t)return 2;for(let s=t-1;s>=0&&this.iD(i[s]);s--)if(e.includes(i[s]))return 3;return this.SD(i,h,t,s,!0)};static yD=(t,i,s,h,e)=>{if(t+1===i.length)return 2;for(let s=t+1;s{let i=0;for(let s=0;st>=' '&&t<=''||' '===t||'\n'===t||'\t'===t||'£'===t||'€'===t;static Kx=(t,i)=>{for(let s=0;s{let i=!0;for(let s=0;s{s.d(i,{A:()=>h});class h{static kD=[' ','e','t','a','o','i','h','n','s','r','d','l','u','m','w','c','y','f','g','p','b','v','k','x','j','q','z','0','1','2','3','4','5','6','7','8','9',' ','!','?','.',',',':',';','(',')','-','&','*','\\','\'','@','#','+','=','£','$','%','"','[',']'];static xD=[];static wc=(t,i)=>{let s,h=0,e=-1;for(let n=0;n>4&15,-1!==e?(this.xD[h++]=this.kD[(e<<4)+s-195],e=-1):s<13?this.xD[h++]=this.kD[s]:e=s,s=15&i,-1!==e?(this.xD[h++]=this.kD[(e<<4)+s-195],e=-1):s<13?this.xD[h++]=this.kD[s]:e=s}let n=!0;for(let t=0;t='a'&&i<='z'&&(this.xD[t]=i.toUpperCase(),n=!1),'.'!==i&&'!'!==i||(n=!0)}return this.xD.slice(0,h).join('')};static by=(t,i)=>{i.length>80&&(i=i.substring(0,80)),i=i.toLowerCase();let s=-1;for(let h=0;h12&&(n+=195),-1===s?n<13?s=n:t.p1(n):n<13?(t.p1((s<<4)+n),s=-1):(t.p1((s<<4)+(n>>4)),s=15&n)}-1!==s&&t.p1(s<<4)}}},1908:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(9763);class e{static DD=null;static load=async t=>{this.DD=await(0,h.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,s,h)=>{if(!this.DD)throw new Error('bz2 not found!!');return Int8Array.from(this.DD.read(t,i,s,h))}}},123:(t,i,s)=>{let h;async function e(t,i){n(i);try{const i=await window.audioContext.decodeAudioData(Uint8Array.from(t).buffer);let s=window.audioContext.createBufferSource();s.buffer=i,s.connect(h),s.start()}catch(t){console.log(t)}}function n(t){h||(h=window.audioContext.createGain(),h.connect(window.audioContext.destination)),h.gain.value=t/256}function r(t,i,s){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256,s)}function o(t){window._tinyMidiVolume&&window._tinyMidiVolume(t/256)}function l(t){window._tinyMidiStop&&window._tinyMidiStop(t)}s.d(i,{hf:()=>e,sl:()=>r,nm:()=>n,ko:()=>l,hm:()=>o})},2604:(t,i,s)=>{function h(t,i){var s;(s=document.createElement('a')).href=t,s.download=i,document.body.appendChild(s),s.style='display: none',s.click(),s.remove()}s.d(i,{A:()=>h})},9763:(t,i,s)=>{async function h(t,i={}){const s={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,s,h){t=r(t>>>0),i=r(i>>>0),s>>>=0,h>>>=0,(()=>{throw Error(`${t} in ${i}:${s}:${h}`)})()}})},{exports:h}=await WebAssembly.instantiate(t,s),e=h.memory||i.env.memory,n=Object.setPrototypeOf({read:(t,i,s,n)=>(i=function(t,i,s,n,r){if(null==n)return 0;const o=n.length,l=h.__pin(h.__new(o<>>0;if(r)new r(e.buffer,l,o).set(n);else for(let i=0;i>>0),n[i]);return h.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,s){if(!s)return null;const h=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(e.buffer),o.getUint32(t,!0)}}(s-4)>>>i,n=new Array(h);for(let e=0;e>>0));return n}(a,0,h.read(t,i,s,n)>>>0))},h);function r(t){if(!t)return null;const i=t+new Uint32Array(e.buffer)[t-4>>>2]>>>1,s=new Uint16Array(e.buffer);let h=t>>>1,n="";for(;i-h>1024;)n+=String.fromCharCode(...s.subarray(h,h+=1024));return n+String.fromCharCode(...s.subarray(h,i))}let o=new DataView(e.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(e.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(e.buffer),o.getInt8(t,!0)}}return n}s.d(i,{F:()=>h})},9896:(t,i,s)=>{var h=s(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var s=window.audioContext.createBuffer(1,1,22050),h=window.audioContext.createBufferSource();h.buffer=s,h.connect(window.audioContext.destination),h.start?h.start(0):h.play?h.play(0):h.noteOn&&h.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{const t=2,i=44100;let s=new Float32Array,e=window.audioContext.createGain();e.gain.value=.1,e.connect(window.audioContext.destination);let n=window.audioContext.currentTime,r=[];const o=new h.A({ND:30,PD:t=>{let i=new Float32Array(t.buffer),h=new Float32Array(s.length+i.length);h.set(s,0),h.set(i,s.length),s=h},FD:t=>{},bufferSize:102400});await o.init();const l=await fetch('./SCC1_Florestan.sf2'),a=new Uint8Array(await l.arrayBuffer());function c(){if(!window.audioContext||!s.length)return;let h=window.audioContext.createBufferSource();const o=s.length/t,l=window.audioContext.createBuffer(t,o,i);for(let i=0;i{t.stop(window.audioContext.currentTime)})),r=[],e.gain.value=t}}function d(t,i){-1!==t&&window._tinyMidiVolume(t),n=window.audioContext.currentTime,f=setInterval(c,250),o.UD(i)}o.BD(a),window._tinyMidiStop=async t=>{t?function(t,i){const s=window.audioContext.currentTime;e.gain.cancelScheduledValues(s),e.gain.setValueAtTime(e.gain.value,s),e.gain.linearRampToValueAtTime(t,s+2),setTimeout(i,2e3)}(0,(()=>{u()})):u()},window._tinyMidiVolume=(t=1)=>{e.gain.value=t},window._tinyMidiPlay=async(t,i,s)=>{t&&(await window._tinyMidiStop(s),s?setTimeout((()=>{d(i,t)}),2e3):d(i,t))}})()},8151:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(5473);const e=class{constructor(t={}){this.GD=void 0,this.HD=0,this.WD=0,this.YD=0,this.ND=t.ND||100,this.sampleRate=t.sampleRate||44100,this.VD=t.VD||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.KD(1),this.PD=t.PD||(()=>{}),this.FD=t.FD||(()=>{}),this.XD=void 0,this.test=0}async init(){if(!this.GD){if('undefined'!=typeof process){const{jD:t}=await import('path'),{zD:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.GD=await(0,h.A)(),this.ZD=this.GD._malloc(this.bufferSize),this.qD=this.GD._malloc(8)}}KD(t){this.bufferSize=4*this.sampleRate*this.VD*t}$D(){if(!this.GD)throw new Error(`${this.constructor.name} not initalized. call .init()`)}BD(t){this.$D();const{_malloc:i,_free:s,_tsf_load_memory:h,_tsf_set_output:e,_tsf_channel_set_bank_preset:n,_tsf_set_max_voices:r,_tsf_channel_set_presetnumber:o}=this.GD;s(this.HD),this.HD=i(t.length),this.GD.HEAPU8.set(t,this.HD),this.WD=h(this.HD,t.length),e(this.WD,2===this.VD?0:2,this.sampleRate,this.gain)}JD(){this.$D();const t=new Uint8Array(this.bufferSize);return t.set(this.GD.HEAPU8.subarray(this.ZD,this.ZD+this.bufferSize)),t}QD(t){const{_malloc:i,_free:s,_tml_load_memory:h}=this.GD;return s(this.YD),this.YD=i(t.length),this.GD.HEAPU8.set(t,this.YD),h(this.YD,t.length)}tN(t){const{_midi_render:i}=this.GD;return i(this.WD,t,this.VD,this.sampleRate,this.ZD,this.bufferSize,this.qD)}UD(t){if(this.$D(),!this.WD)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.XD);const{setValue:i,getValue:s}=this.GD;i(this.qD,0,'double'),this.GD._tsf_reset(this.WD),this.GD._tsf_channel_set_bank_preset(this.WD,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let h=this.QD(t);const e=()=>{h=this.tN(h);const t=this.JD();this.PD(t),h?this.XD=setTimeout(e,this.ND):this.FD(s(this.qD,'double'))};this.XD=setTimeout(e,16)}}},8227:(t,i,s)=>{t.exports=s.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,s)=>{var h;s.d(i,{A:()=>e});const e=(h="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,e,n=void 0!==(t=t||{})?t:{};n.ready=new Promise((function(t,s){i=t,e=s})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(n.ready,t)||Object.defineProperty(n.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var r=Object.assign({},n),o=[],l='object'==typeof window,a='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!l&&!c&&!a;if(n.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var A,p;y=a?require('path').jD(y)+'/':__dirname+'/';var m=()=>{p||(A=require('fs'),p=require('path'))};u=(t,i)=>(m(),t=p.normalize(t),A.iN(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,s)=>{m(),t=p.normalize(t),A.sN(t,(function(t,h){t?s(t):i(h.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof et))throw t})),process.on('unhandledRejection',(function(t){throw t})),n.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,s){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!l&&!a)throw new Error('environment detection error');if(a?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),h&&(y=h),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},a&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,s)=>{var h=new XMLHttpRequest;h.open('GET',t,!0),h.responseType='arraybuffer',h.onload=()=>{200==h.status||0==h.status&&h.response?i(h.response):s()},h.onerror=s,h.send(null)}}n.print||console.log.bind(console);var I,g,E=n.printErr||console.warn.bind(console);function _(t,i){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function C(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(n,r),r=null,I='fetchSettings',Object.getOwnPropertyDescriptor(n,I)&&j('`Module.'+I+'` was supplied but `'+I+'` not included in INCOMING_MODULE_JS_API'),n.arguments&&(o=n.arguments),_('arguments','arguments_'),n.thisProgram&&n.thisProgram,_('thisProgram','thisProgram'),n.quit&&n.quit,_('quit','quit_'),D(void 0===n.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===n.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===n.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===n.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===n.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),_('read','read_'),_('readAsync','readAsync'),_('readBinary','readBinary'),_('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),n.wasmBinary&&(g=n.wasmBinary),_('wasmBinary','wasmBinary');var T;n.noExitRuntime;_('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var O,v,b,L,R,S,M,k,x=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function N(t){O=t,n.HEAP8=v=new Int8Array(t),n.HEAP16=L=new Int16Array(t),n.HEAP32=R=new Int32Array(t),n.HEAPU8=b=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=S=new Uint32Array(t),n.HEAPF32=M=new Float32Array(t),n.HEAPF64=k=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var P=5242880;n.TOTAL_STACK&&D(P===n.TOTAL_STACK,'the stack size can no longer be determined at runtime');var F=n.INITIAL_MEMORY||16777216;function U(){if(!x){var t=ft(),i=S[t>>2],s=S[t+4>>2];34821223==i&&2310721022==s||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+s.toString(16)+' 0x'+i.toString(16)),1668509029!==S[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}_('INITIAL_MEMORY','INITIAL_MEMORY'),D(F>=P,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+F+'! (TOTAL_STACK='+P+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!n.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==F,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var B=[],G=[],H=[],W=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var Y=0,V=null,K=null,X={};function j(t){n.onAbort&&n.onAbort(t),E(t='Aborted('+t+')'),x=!0;var i=new WebAssembly.RuntimeError(t);throw e(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},hN:function(){z.error()},eN:function(){z.error()},nN:function(){z.error()},open:function(){z.error()},rN:function(){z.error()},oN:function(){z.error()},lN:function(){z.error()},aN:function(){z.error()},cN:function(){z.error()}};n.FS_createDataFile=z.hN,n.FS_createPreloadedFile=z.eN;var Z,q,$,J,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function st(t,i){return function(){var s=t,h=i;return i||(h=n.asm),D(W,'native function `'+s+'` called before runtime initialization'),h[t]||D(h[t],'exported native function `'+s+'` not found'),h[t].apply(null,arguments)}}function ht(t){try{if(t==Z&&g)return new Uint8Array(g);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function et(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function nt(t){for(;t.length>0;)t.shift()(n)}function rt(t){rt.fN||(rt.fN={}),rt.fN[t]||(rt.fN[t]=1,c&&(t='warning: '+t),E(t))}function ot(t){try{return T.grow(t-O.byteLength+65535>>>16),N(T.buffer),1}catch(i){E('emscripten_realloc_buffer: Attempted to grow heap from '+O.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}n.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=n.locateFile?n.locateFile(q,y):y+q):Z=new URL(s(8227),s.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,s){b.copyWithin(t,i,i+s)},"emscripten_resize_heap":function(t){var i=b.length;D((t>>>=0)>i);var s,h,e=2147483648;if(t>e)return E('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+e+' bytes!'),!1;for(var n=1;n<=4;n*=2){var r=i*(1+.2/n);r=Math.min(r,t+100663296);var o=Math.min(e,(s=Math.max(t,r))+((h=65536)-s%h)%h);if(ot(o))return!0}return E('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function s(t,i){var s,h=t.exports;n.asm=h,D(T=n.asm.memory,"memory not found in wasm exports"),N(T.buffer),D(n.asm.__indirect_function_table,"table not found in wasm exports"),s=n.asm.__wasm_call_ctors,G.unshift(s),function(t){if(Y--,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(D(X[t]),delete X[t]):E('warning: run dependency removed without ID'),0==Y&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',Y++,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(x)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,E('still waiting on run dependencies:')),E('dependency: '+i);t&&E('(end of list)')}),1e4))):E('warning: run dependency added without ID');var h=n;function r(t){D(n===h,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),h=null,s(t.instance)}function o(t){return function(){if(!g&&(l||a)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return ht(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return ht(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){E('failed to asynchronously prepare wasm: '+t),it(Z)&&E('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(n.instantiateWasm)try{return n.instantiateWasm(i,s)}catch(t){E('Module.instantiateWasm callback failed with error: '+t),e(t)}(g||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(r):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(r,(function(t){return E('wasm streaming compile failed: '+t),E('falling back to ArrayBuffer instantiation'),o(r)}))}))).catch(e)}(),n.___wasm_call_ctors=st("__wasm_call_ctors"),n._malloc=st("malloc"),n._free=st("free"),n._tsf_load_memory=st("tsf_load_memory"),n._tsf_close=st("tsf_close"),n._tsf_reset=st("tsf_reset"),n._tsf_set_output=st("tsf_set_output"),n._tsf_set_max_voices=st("tsf_set_max_voices"),n._realloc=st("realloc"),n._tsf_channel_set_presetnumber=st("tsf_channel_set_presetnumber"),n._tsf_channel_set_bank_preset=st("tsf_channel_set_bank_preset"),n._tml_load_memory=st("tml_load_memory"),n._midi_render=st("midi_render"),n.___errno_location=st("__errno_location"),n._fflush=st("fflush"),n._emscripten_stack_init=function(){return(ct=n._emscripten_stack_init=n.asm.emscripten_stack_init).apply(null,arguments)}),ft=(n._emscripten_stack_get_free=function(){return(n._emscripten_stack_get_free=n.asm.emscripten_stack_get_free).apply(null,arguments)},n._emscripten_stack_get_base=function(){return(n._emscripten_stack_get_base=n.asm.emscripten_stack_get_base).apply(null,arguments)},n._emscripten_stack_get_end=function(){return(ft=n._emscripten_stack_get_end=n.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),S[t>>2]=34821223,S[t+4>>2]=2310721022,S[0]=1668509029}function dt(t){function s(){lt||(lt=!0,n.calledRun=!0,x||(D(!W),W=!0,U(),nt(G),i(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),D(!n._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),n.postRun)for('function'==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),H.unshift(t);var t;nt(H)}()))}t=t||o,Y>0||(ut(),function(){if(n.preRun)for('function'==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),B.unshift(t);var t;nt(B)}(),Y>0||(n.setStatus?(n.setStatus('Running...'),setTimeout((function(){setTimeout((function(){n.setStatus('')}),1),s()}),1)):s(),U()))}if(n.stackSave=st("stackSave"),n.stackRestore=st("stackRestore"),n.stackAlloc=st("stackAlloc"),n.setValue=function(t,i,s="i8"){switch(s.endsWith('*')&&(s='*'),s){case'i1':case'i8':v[0|t]=i;break;case'i16':L[t>>1]=i;break;case'i32':R[t>>2]=i;break;case'i64':J=[i>>>0,($=i,+Math.abs($)>=1?$>0?(0|Math.min(+Math.floor($/4294967296),4294967295))>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],R[t>>2]=J[0],R[t+4>>2]=J[1];break;case'float':M[t>>2]=i;break;case'double':k[t>>3]=i;break;case'*':S[t>>2]=i;break;default:j('invalid type for setValue: '+s)}},n.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return v[0|t];case'i16':return L[t>>1];case'i32':case'i64':return R[t>>2];case'float':return M[t>>2];case'double':return k[t>>3];case'*':return S[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),rt(i)}})})),K=function t(){lt||dt(),lt||(K=t)},n.preInit)for('function'==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return dt(),t.ready})}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var s=n[t]={exports:{}};return e[t](s,s.exports,r),s.exports}r.m=e,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",s="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",h=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},r.a=(e,n,r)=>{var o;r&&((o=[]).d=-1);var l,a,c,f=new Set,u=e.exports,d=new Promise(((t,i)=>{c=i,a=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),e.exports=d,n((e=>{var n;l=(e=>e.map((e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){var n=[];n.d=0,e.then((t=>{r[i]=t,h(n)}),(t=>{r[s]=t,h(n)}));var r={};return r[t]=t=>t(n),r}}var o={};return o[t]=t=>{},o[i]=e,o})))(e);var r=()=>l.map((t=>{if(t[s])throw t[s];return t[i]})),a=new Promise((i=>{(n=()=>i(r)).r=0;var s=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(n.r++,t.push(n)));l.map((i=>i[t](s)))}));return n.r?a:r()}),(t=>(t?c(d[s]=t):a(u),h(o)))),o&&o.d<0&&(o.d=0)},r.d=(t,i)=>{for(var s in i)r.o(i,s)&&!r.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:i[s]})},r.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),r.p="/Client2/",r.b=document.baseURI||self.location.href;r(7906)})(); \ No newline at end of file +(()=>{"use strict";var t,i,s,h,e={1651:(t,i,s)=>{s.d(i,{K:()=>D});var h=s(1120),e=s(4583),n=s(2901),r=s(1069),o=s(7046),l=(s(9896),s(6666)),a=s(3045),c=s(818),f=s(670),u=s(8268),d=s(3867),w=s(7854),y=s(8950),A=s(1302),p=s(9298),m=s(8665),I=s(1312),g=s(3819),E=s(8317),_=s(9234),C=s(1908),T=s(123),O=s(5637),v=s(6948),b=s(2164),L=s(8738),R=s(3764),S=s(8534),M=s(6730),k=s(2604),x=s(5226);class D extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static st=!1;static ht='';static et='';static nt=!1;static rt=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static It=0;static gt=0;static Et=0;static _t=0;static Ct=0;static Tt=0;static Ot=0;static vt=0;static bt=0;static Lt=()=>{a.A.st=!1,e.A.st=!1,D.st=!1,c.A.st=!1};static Rt=()=>{a.A.st=!0,e.A.st=!0,D.st=!0,c.A.st=!0};St=2048;Mt=2047;kt=!1;xt=!1;Dt=!1;Nt=!1;db=null;Pt=0;Ft=[];stream=null;in=r.A.Ut(1);Bt=r.A.Ut(1);Gt=r.A.Ut(1);Ht=0n;Wt=0;Yt=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;$t=!0;Jt=0;Qt=0;ti=null;ii=null;si=null;hi=null;ei=null;ni=null;ri=null;oi=null;li=null;ai=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;Ai=null;pi=[];mi=!1;Ii=null;gi=null;Ei=null;_i=null;Ci=null;Ti=null;Oi=null;vi=null;bi=null;Li=null;Ri=new Int32Array(256);Si=0;Mi=0;ki=0;xi=null;Di=null;Ni=null;Pi=null;Fi=null;Ui=null;Bi=null;Gi=null;Hi=null;Wi=null;Yi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;$i=null;Ji=null;Qi=null;ts=new Int32Array(33);ss=new Int32Array(33);hs=new Int32Array(151);es=new Int32Array(151);ns=null;rs=null;os=null;ls=null;cs=null;fs=null;us=new d.ds(13,null);ws=null;ys=null;As=new d.ds(50,null);ps=new d.ds(50,null);Is=new d.ds(20,null);gs=new d.ds(20,null);Es=null;_s=new d.ds(8,null);Cs=null;Ts=null;Os=null;vs=null;bs=null;Ls=null;Rs=null;Ss=null;Ms=null;ks=null;xs=null;Ds=null;Ns=null;Ps=null;Fs=null;Us=null;Bs=null;Gs=null;Hs=new d.ds(1e3,null);Ws=!1;Ys=!1;Vs=!1;Ks=!1;Xs=-1;js=0;zs=0;Zs=0;qs=0;$s=0;Js=0;Qs=!1;th=0;ih=0;sh=0;hh=0;eh=0;nh=0;rh=[];oh=-1;lh=-1;ah=new h.A;fh=78;uh=0;dh=0;wh=[];yh=0;Ah=0;ph=0;mh=0;Ih=0;gh=0;Eh=0;_h=0;Ch=[];Th=[];Oh=[];bh=[];Lh=null;Rh=-1;Sh=3;Mh=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];kh=0;xh=0;Dh=0;Nh=!1;Ph=0;Fh=!1;Uh='';Bh='';Gh=0;Hh='';Wh=!1;Yh=-1;Vh=new d.ds(100,null);Kh=new d.ds(100,null);messageType=new Int32Array(100);Xh=new Int32Array(100);jh=0;zh=0;Zh=0;qh='';$h=0;Jh=0;Qh=0;te=0;ie=0;se=0;he=0;ee=0;ne=0;re=!1;oe=0;le=0;ae=0;ce=0;fe=null;ue=0;de=0;we=0;ye=0;Ae=!1;pe=[];me=[];Ie=0;ge=0;Ee=0;_e=null;Ce=0;Te=new Int32Array(500);Oe=new Int32Array(500);ve=new Int32Array(500);be=new Int32Array(500);Le=0;Re=0;Se=0;Me='';ke=!1;xe=-1;De=0;Ne=0;Pe=0;Fe=0;Ue=0;Be=new Int32Array(1e3);Ge=new Int32Array(1e3);He=null;We=0;Ye=0;Ve=0;Ke=0;Xe=0;je=!1;ze=0;Ze=0;qe=0;$e=0;Je=2;Qe=2;tn=1;sn=new Int32Array(5);hn=new d.ds(5,!1);en=new Int32Array(5);nn=new Int32Array(5);rn=new Int32Array(5);ln=0;an=0;cn=0;fn=0;un=0;dn=0;wn=0;yn=0;An=0;pn=1;mn=2;In=-1;gn=0;En=0;_n=0;Cn=0;Tn=0;On=0;vn=null;bn=null;Ln=null;Rn=0;Sn=0;Mn=new Int8Array(16384);kn=new d.ds(f.A.xn,null);Dn=0;Nn=0;Pn=128;Fn=0;Un=0;Bn=0;Gn=0;Hn=0;Wn=null;Yn=null;Vn=new d.Kn(f.A.Xn,f.A.Xn);jn=0;zn=0;Zn=0;qn=0;$n=0;Jn=0;Qn=0;tr=0;ir=0;sr=0;hr=0;er=0;nr=new d.ds(this.St,null);rr=0;lr=new Int32Array(this.St);ar=0;cr=0;ur=new Int32Array(this.St);dr=new Int32Array(1e3);wr=new d.ds(this.St,null);yr=new d.ds(8192,null);Ar=0;pr=new Int32Array(8192);mr=new l.A;Ir=new l.A;gr=new l.A;Er=new l.A;_r=new d.Cr(f.A.xn,f.A.Xn,f.A.Xn,null);Tr=new l.A;Or=new Int32Array(4e3);vr=new Int32Array(4e3);br=new Int32Array(f.A.Xn*f.A.Xn);Lr=new Int32Array(f.A.Xn*f.A.Xn);Rr=0;Sr=null;Mr=0;kr=0;Dr=-1;Nr=0;Pr=0;Fr=0;Ur=0;Br=!1;Gr=!0;Hr=!1;Wr=new Int32Array(7);Yr=new Int32Array(5);Vr=0;Kr=0;static Xr=50;jr=new Int32Array(D.Xr);zr=new Int32Array(D.Xr);Zr=new Int32Array(D.Xr);qr=new Int32Array(D.Xr);$r=new Int32Array(D.Xr);Jr=new Int32Array(D.Xr);Qr=new Int32Array(D.Xr);io=new d.ds(D.Xr,null);so=new d.ds(100,null);ho=new BigInt64Array(100);eo=new Int32Array(100);no=null;ro=0;oo=!0;lo=new Int32Array(50);ao=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;Ao=0;po=!0;mo=null;Io=0;Eo=0;_o=192;Co=void 0;To=!1;host=null;Oo=null;vo=new d.ds(16,null);bo=0;Lo=!1;Ro=()=>{try{this.stream&&this.stream.close()}catch(t){}this.Oo&&'998'===D.getParameter('world')&&this.Oo.So?.send(JSON.stringify({type:'close',id:this.Oo.Mo})),this.stream=null,(0,T.ko)(!1),this.Bt=null,this.Gt=null,this.in=null,this.Ln=null,this.vn=null,this.bn=null,this.Wn=null,this.Yn=null,this.He=null,this.kn=null,this.br=null,this.Lr=null,this.Or=null,this.vr=null,this.Mn=null,this.Di=null,this.Ni=null,this.Pi=null,this.Fi=null,this.Ui=null,this.Bi=null,this.Gi=null,this.Hi=null,this.Wi=null,this.Yi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.ns=null,this.os=null,this.rs=null,this.ls=null,this.cs=null,this.fs=null,this.us=null,this.Rs=null,this.Ss=null,this.Ms=null,this.ks=null,this.xs=null,this.Ds=null,this.Ns=null,this.Ps=null,this.Fs=null,this.Us=null,this.ys=null,this.Is=null,this.gs=null,this._s=null,this.Cs=null,this.Ts=null,this.Os=null,this.vs=null,this.As=null,this.ps=null,this.Vn=null,this.nr=null,this.lr=null,this.ur=null,this.wr=null,this.dr=null,this.yr=null,this.pr=null,this._r=null,this.Tr=null,this.Er=null,this.mr=null,this.Ir=null,this.gr=null,this.ve=null,this.be=null,this.Te=null,this.Oe=null,this.rh=null,this.pe=null,this.Be=null,this.Ge=null,this.Hs=null,this.ws=null,this.so=null,this.ho=null,this.eo=null,this.hi=null,this.ei=null,this.ti=null,this.ii=null,this.si=null,this.ni=null,this.ri=null,this.oi=null,this.li=null,this.xo(),O.A.Ro(),v.A.Ro(),A.A.Ro(),b.A.Do=null,E.A.Do=null,h.A.Do=null,I.A.Do=null,L.A.Do=null,L.A.No=null,R.A.Do=null,this.Po=null,u.A.No=null,e.A.Ro(),a.A.Ro(),m.A.Ro(),S.A.Do=[],M.A.Do=[]};Fo(){return this.Jt}Uo(){return this.Wh}Bo(){return this.Fh}Go(){return this.lh}Ho(){return this.Xs}xo=()=>{this.mi=!1,this.xi&&(clearInterval(this.xi),this.xi=null),this.ai=null,this.ci=null,this.pi=[],this.Oi=null,this.vi=null,this.bi=null,this.Li=null,this._i=null,this.Ei=null,this.Ci=null,this.Ti=null,this.Ii=null,this.gi=null};Wo=()=>{'999'===D.getParameter('world')?(this.Co=new Worker('worker.js',{type:'module'}),this.Co.onmessage=this.onmessage,this.host=new x.x(this.Co)):'998'===D.getParameter('world')&&(this.Co={onmessage:t=>{this.stream.Yo.onmessage(t)},postMessage:t=>{this.Oo&&this.Oo.So&&'open'===this.Oo.So.readyState&&this.Oo.So.send(JSON.stringify(t))},onerror:null,onmessageerror:null,terminate:()=>{throw new Error},addEventListener:()=>{throw new Error},removeEventListener:()=>{throw new Error},dispatchEvent:()=>{throw new Error}},this.Oo=new x.Q(this.Co))};onmessage=t=>{switch(t.data.type){case'ready':return void(this.To=!0);case'save':return(0,k.A)(t.data.value,t.data.path.split('/').pop().split('\\').pop()),void URL.revokeObjectURL(t.data.value);case'close':return void this.Co?.postMessage({type:'close',id:t.data.id})}this.host?.Mo===t.data.id?this.stream.Yo.onmessage(t.data):this.host?.postMessage(t)};Vo=async()=>{if(999==+D.getParameter('world'))this.host&&await this.host.Ko();else if(998==+D.getParameter('world')&&this.Oo){if(this.Oo.So)return void console.log('You are already connected.');const t=prompt('Paste offer here, answer will be copied to clipboard');if(t)try{await this.Oo.Xo(t)}catch(t){console.error(t)}}};jo=async(t,i,s,h)=>{let e=5,o=await(this.db?.zo(t));if(o&&r.A.Zo(o)!==s&&(o=void 0),o)return new n.A(o);for(;!o;){await this.qo(h,`Requesting ${i}`);try{o=+D.getParameter('world')<998?await(0,_.$o)(`${D.et}/${t}${s}`):await(0,_.$o)(`${D.et}/${t}`)}catch(t){o=void 0;for(let t=e;t>0;t--)await this.qo(h,`Error loading - Will retry in ${t} secs.`),await(0,_.Jo)(1e3);e*=2,e>60&&(e=60)}}return await(this.db?.Qo(t,o)),new n.A(o)};tl=async(t,i,s,h)=>{let e=await(this.db?.zo(t+'.mid'));if(e&&12345678!==i&&r.A.Zo(e)!==i&&(e=void 0),!e)try{e=+D.getParameter('world')<998?await(0,_.$o)(`${D.et}/${t}_${i}.mid`):await(0,_.$o)(`${D.et}/songs/${t}.mid`),s!==e.length&&(e=e.slice(0,s))}catch(t){}if(!e)return;await(this.db?.Qo(t+'.mid',e));const n=new r.A(Uint8Array.from(e)).il,o=C.A.read(n,e,s,4);(0,T.sl)(o,this._o,h)};hl=()=>{if(w.el.fillStyle='black',w.el.fillRect(0,0,this.width,this.height),this.nl(1),this.Dt){this.mi=!1,w.el.font='bold 16px helvetica, sans-serif',w.el.textAlign='left',w.el.fillStyle='yellow';let t=35;w.el.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.el.fillStyle='white',w.el.fillText('To fix this try the following (in order):',30,t),t+=50,w.el.font='bold 12px helvetica, sans-serif',w.el.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.el.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.el.fillText('3: Try using a different game-world',30,t),t+=30,w.el.fillText('4: Try rebooting your computer',30,t),t+=30,w.el.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.mi=!1,w.el.font='bold 20px helvetica, sans-serif',w.el.textAlign='left',w.el.fillStyle='white',w.el.fillText('Error - unable to load game!',50,50),w.el.fillText('To play RuneScape make sure you play from',50,100),w.el.fillText('https://2004scape.org',50,150)),this.xt){this.mi=!1,w.el.font='bold 13px helvetica, sans-serif',w.el.textAlign='left',w.el.fillStyle='yellow';let t=35;w.el.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.el.fillStyle='white',w.el.fillText('To fix this try the following (in order):',30,t),t+=50,w.el.font='bold 12px helvetica, sans-serif',w.el.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.el.fillText('2: Try rebooting your computer, and reloading',30,t)}};rl=t=>{if(!t.ol)return!1;for(let i=0;i=h)return!1}else if(3===t.ol[i]){if(s<=h)return!1}else if(4===t.ol[i]){if(s===h)return!1}else if(s!==h)return!1}return!0};cl=(t,i,s,h,e)=>{this.bs?.draw(t,i),this.Ls?.draw(t,i+e-16),y.A.fillRect(t,i+16,16,e-32,p.A.fl);let n=(e-32)*e/h|0;n<8&&(n=8);const r=(e-n-32)*s/(h-e)|0;y.A.fillRect(t,i+r+16,16,n,p.A.ul),y.A.dl(t,i+r+16,p.A.wl,n),y.A.dl(t+1,i+r+16,p.A.wl,n),y.A.yl(t,i+r+16,p.A.wl,16),y.A.yl(t,i+r+17,p.A.wl,16),y.A.dl(t+15,i+r+16,p.A.Al,n),y.A.dl(t+14,i+r+17,p.A.Al,n-1),y.A.yl(t,i+r+n+15,p.A.Al,16),y.A.yl(t+1,i+r+n+14,p.A.Al,15)};pl=(t,i)=>{let s=!1;const e=h.A.Do[t];if(!e.ml)return!1;for(let t=0;th.delay[n._l];)n.El-=h.delay[n._l]+1,n._l++,n._l>=h.Cl&&(n._l-=h.Tl,(n._l<0||n._l>=h.Cl)&&(n._l=0)),s=!0}}}return s};Ol=(t,i,s,n,r=!1)=>{if(0!==t.type||!t.ml||t.hide&&this.$h!==t.id&&this.Jh!==t.id&&this.Qh!==t.id)return;const o=y.A.left,l=y.A.top,a=y.A.right,c=y.A.bottom;y.A.vl(i,s,i+t.width,s+t.height);const f=t.ml.length;for(let o=0;o0&&this.kl(c),c.type===h.A.xl)c.Dl>c.scroll-c.height&&(c.Dl=c.scroll-c.height),c.Dl<0&&(c.Dl=0),this.Ol(c,l,a,c.Dl,r),c.scroll>c.height&&this.cl(l+c.width,a,c.Dl,c.scroll,c.height);else if(c.type===h.A.Nl){let t=0;for(let i=0;i0){let i=0,s=0;const n=c.Ul[t]-1;if(h>=-32&&h<=512&&e>=-32&&e<=334||0!==this.se&&this.ie===t){const r=A.A.Wl(n,c.Bl[t]);if(0!==this.se&&this.ie===t&&this.te===c.id?(i=this.Yl-this.he,s=this.Vl-this.ee,i<5&&i>-5&&(i=0),s<5&&s>-5&&(s=0),this.ne<5&&(i=0,s=0),r.Kl(128,h+i,e+s)):0!==this.ue&&this.de===t&&this.we===c.id?r.Kl(128,h,e):r.draw(h,e),33===r.Xl||1!==c.Bl[t]){const n=c.Bl[t];this.di?.jl(h+i+1,e+10+s,this.zl(n),p.A.Zl),this.di?.jl(h+i,e+9+s,this.zl(n),p.A.ql)}}}else if(c.$l&&t<20){const i=c.$l[t];i?.draw(h,e)}t++}}else if(c.type===h.A.Jl)c.fill?y.A.fillRect(l,a,c.width,c.height,c.Ql):y.A.Rl(l,a,c.width,c.height,c.Ql);else if(c.type===h.A.ta){const t=c.font;let i=c.Ql,s=c.text;if(this.Qh!==c.id&&this.Jh!==c.id&&this.$h!==c.id||0===c.ia||(i=c.ia),this.rl(c)&&(i=c.sa,c.ha&&c.ha.length>0&&(s=c.ha)),c.ea===h.A.na&&this.Ae&&(s='Please wait...',i=c.Ql),!t||!s)continue;for(let h=a+t.height;s.length>0;h+=t.height){if(-1!==s.indexOf('%')){for(;;){const t=s.indexOf('%1');if(-1===t)break;s=s.substring(0,t)+this.ra(this.ll(c,0))+s.substring(t+2)}for(;;){const t=s.indexOf('%2');if(-1===t)break;s=s.substring(0,t)+this.ra(this.ll(c,1))+s.substring(t+2)}for(;;){const t=s.indexOf('%3');if(-1===t)break;s=s.substring(0,t)+this.ra(this.ll(c,2))+s.substring(t+2)}for(;;){const t=s.indexOf('%4');if(-1===t)break;s=s.substring(0,t)+this.ra(this.ll(c,3))+s.substring(t+2)}for(;;){const t=s.indexOf('%5');if(-1===t)break;s=s.substring(0,t)+this.ra(this.ll(c,4))+s.substring(t+2)}}const e=s.indexOf('\\n');let n;-1!==e?(n=s.substring(0,e),s=s.substring(e+2)):(n=s,s=''),c.oa?t.la(l+(c.width/2|0),h,n,i,c.aa):t.ca(l,h,n,i,c.aa)}}else if(c.type===h.A.fa){let t;t=this.rl(c)?c.ua:c.da,t?.draw(l,a)}else if(c.type===h.A.wa){const t=e.A.ya,i=e.A.Aa;e.A.ya=l+(c.width/2|0),e.A.Aa=a+(c.height/2|0);const s=e.A.sin[c.pa]*c.zoom>>16,h=e.A.cos[c.pa]*c.zoom>>16,n=this.rl(c);let r;r=n?c.gl:c.Il;let o=null;if(-1===r)o=c.ma(-1,-1,n);else{const t=I.A.Do[r];t.frames&&t.Ia&&(o=c.ma(t.frames[c._l],t.Ia[c._l],n))}o&&o.ga(0,c.Ea,0,c.pa,0,s,h),e.A.ya=t,e.A.Aa=i}else if(c.type===h.A._a){const t=c.font;if(!t||!c.Ul||!c.Bl)continue;let i=0;for(let s=0;s0){const e=A.A.get(c.Ul[i]-1);let n=e.name;if((e.Ca||1!==c.Bl[i])&&(n=n+' x'+this.Ta(c.Bl[i])),!n)continue;const r=l+h*(c.Gl+115),o=a+s*(c.Hl+12);c.oa?t.la(r+(c.width/2|0),o,n,c.Ql,c.aa):t.ca(r,o,n,c.Ql,c.aa)}i++}}}y.A.vl(o,l,a,c)};kl=t=>{let i=t.Ml;if(i>=h.A.Oa&&i<=h.A.va)i--,i>=this.Vr?(t.text='',t.ea=0):(t.text=this.so[i],t.ea=1);else if(i>=h.A.ba&&i<=h.A.La)i-=h.A.ba,i>=this.Vr?(t.text='',t.ea=0):(0===this.eo[i]?t.text='@red@Offline':this.eo[i]===D.it?t.text='@gre@World-'+(this.eo[i]-9):t.text='@yel@World-'+(this.eo[i]-9),t.ea=1);else if(i===h.A.Ra)t.scroll=15*this.Vr+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=h.A.Sa&&i<=h.A.Ma)i-=h.A.Sa,i>=this.dh?(t.text='',t.ea=0):(t.text=g.A.ka(g.A.xa(this.wh[i])),t.ea=1);else if(i===h.A.Da)t.scroll=15*this.dh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===h.A.Na){if(t.pa=150,t.Ea=256*Math.sin(this.Pt/40)&2047,this.Hr){this.Hr=!1;const i=new d.ds(7,null);let s=0;for(let t=0;t<7;t++){const h=this.Wr[t];h>=0&&(i[s++]=E.A.Do[h].ma())}const h=m.A.Pa(i,s);for(let t=0;t<5;t++)0!==this.Yr[t]&&(h.Fa(u.A.Ua[t][0],u.A.Ua[t][this.Yr[t]]),1===t&&h.Fa(u.A.Ba[0],u.A.Ba[this.Yr[t]]));if(this.Sr){const i=I.A.Do[this.Sr.Ga].frames;i&&(h.Ha(),h.Wa(i[0]),h.Ya(64,850,-30,-50,-30,!0),t.model=h)}}}else if(i===h.A.Va)this.Bs||(this.Bs=t.da,this.Gs=t.ua),this.Gr?t.da=this.Gs:t.da=this.Bs;else if(i===h.A.Ka)this.Bs||(this.Bs=t.da,this.Gs=t.ua),this.Gr?t.da=this.Bs:t.da=this.Gs;else if(i===h.A.Xa)t.text=this.Me,this.Pt%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===h.A.ja)this.Br?this.ke?(t.Ql=p.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Ql=p.A.Sl,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===h.A.za||i===h.A.Za)if(0===this.De)t.text='';else{let i;i=0===this.Ne?'earlier today':1===this.Ne?'yesterday':this.Ne+' days ago',t.text='You last logged in '+i+' from: '+g.A.qa(this.De)}else if(i===h.A.$a)0===this.Fe&&(t.text='0 unread messages',t.Ql=p.A.ql),1===this.Fe&&(t.text='1 unread message',t.Ql=p.A.GREEN),this.Fe>1&&(t.text=this.Fe+' unread messages',t.Ql=p.A.GREEN);else if(i===h.A.Ja)if(201===this.Pe)t.text='';else if(200===this.Pe)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Pe?'Earlier today':1===this.Pe?'Yesterday':this.Pe+' days ago',t.text=i+' you changed your recovery questions'}else i===h.A.Qa?201===this.Pe?t.text='':200===this.Pe?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===h.A.tc&&(201===this.Pe?t.text='':(this.Pe,t.text="Do this from the 'account management' area on our front webpage"))};ll=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const s=t.scripts[i];if(!s)return-1;let e=0,n=0;for(;;){const t=s[n++];if(0===t)return e;if(1===t)e+=this.Th[s[n++]];else if(2===t)e+=this.Oh[s[n++]];else if(3===t)e+=this.Ch[s[n++]];else if(4===t){const t=h.A.Do[s[n++]],i=s[n++]+1;if(t.Ul&&t.Bl)for(let s=0;st<999999999?String(t):'*';Ta=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};zl=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,s)=>{s.d(i,{w:()=>r});var h=s(7046),e=s(1651),n=s(9234);async function r(){await async function(){0===h.A.getParameter('world').length&&h.A.setParameter('world','1');['0','998','999'].includes(h.A.getParameter('world'))?function(){if(+h.A.getParameter('world')>=998)return void(e.K.et='data/pack/client');e.K.ht='http://localhost',e.K.et='http://localhost',e.K.portOffset=0}():await async function(t){const i=await o(t,parseInt(h.A.getParameter('world'),10)),s=new URL(i.address);e.K.it=10+i.id-1,e.K.ht=`${s.protocol}//${s.hostname}`,e.K.et=`${s.protocol}//${s.hostname}:${s.port}`,t||(e.K.ht=e.K.ht.replace('https:','http:'));e.K.portOffset=i.portOffset,e.K.members=!0===i?.members,h.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===h.A.getParameter('detail').length&&h.A.setParameter('detail','high');'low'===h.A.getParameter('detail')?e.K.Rt():e.K.Lt()}(),0===h.A.getParameter('method').length&&h.A.setParameter('method','0')}async function o(t,i,s=0){if(s>=10)throw new Error('could not find world to connect!');const h=t?'https:':'http:';let e;try{e=JSON.parse(await(0,n.sc)(`${h}//2004scape.org/api/v1/worldlist`))}catch(h){return await(0,n.Jo)(1e3),o(t,i,++s)}e.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,nr:0});const r=e.find((t=>t.id===i));return r||o(t,i,10)}},7906:(t,i,s)=>{s.a(t,(async(t,i)=>{try{var h=s(1312),e=s(5637),n=s(1302),r=s(6948),o=s(8317),l=s(8738),a=s(3764),c=s(1120),f=s(1183),u=s(8950),d=s(4583),w=s(1673),y=s(2511),A=s(2682),p=s(8665),m=s(9298),I=s(1069),g=s(3554),E=s(353),_=s(2634),C=s(4544),T=s(2215),O=s(3955),v=s(7953),b=s(2646),L=s(3937),R=(s(9896),s(1908)),S=s(6666),M=s(3819),k=s(2595),x=s(3045),D=s(818),N=s(5599),P=s(1023),F=s(6169),U=s(2630),B=s(5327),G=s(670),H=s(9456),W=s(8268),Y=s(8412),V=s(3606),K=s(4197),X=s(254),j=s(7628),z=s(123),Z=s(9234),q=s(3867),$=s(1651),J=s(8534),Q=s(6730),tt=s(2164),it=s(7604),st=s(3795),ht=s(4909),et=s(296);class t extends $.K{load=async()=>{if(this.kt)this.xt=!0;else{this.kt=!0;try{this.Wo(),await this.qo(10,'Connecting to fileserver'),await R.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new C.A(await C.A.openDatabase());const t=new I.A(new Uint8Array(await(0,Z.$o)(`${$.K.et}/crc`)));for(let i=0;i<9;i++)this.Ft[i]=t.il;$.K.st||await this.tl('scape_main',12345678,4e4,!1);const i=await this.jo('title','title screen',this.Ft[1],10);this.qt=i,this.di=A.A.hc(i,'p11'),this.wi=A.A.hc(i,'p12'),this.yi=A.A.hc(i,'b12'),this.Ai=A.A.hc(i,'q8'),await this.ec(),this.nc();const s=await this.jo('config','config',this.Ft[2],15),u=await this.jo('interface','interface',this.Ft[3],20),m=await this.jo('media','2d graphics',this.Ft[4],30),g=await this.jo('models','3d graphics',this.Ft[5],40),E=await this.jo('textures','textures',this.Ft[6],60),_=await this.jo('wordenc','chat system',this.Ft[7],65),T=await this.jo('sounds','sound effects',this.Ft[8],70);this.Yn=new q.rc(G.A.xn,G.A.Xn,G.A.Xn),this.Wn=new q.oc(G.A.xn,G.A.Xn+1,G.A.Xn+1),this.Wn&&(this.He=new x.A(this.Wn,G.A.Xn,G.A.xn,G.A.Xn));for(let t=0;t34||t>34))999===i&&(i=h);else if(999!==i){s=h;break}this.hs[t-9]=i-21,this.es[t-9]=s-i}d.A.Ac(479,96),this.$i=d.A.mc,d.A.Ac(190,261),this.Ji=d.A.mc,d.A.Ac(512,334),this.Qi=d.A.mc;const V=new Int32Array(9);for(let t=0;t<9;t++){const i=32*t+128+15,s=3*i+600,h=d.A.sin[i];V[t]=s*h>>16}x.A.init(512,334,500,800,V),v.A.wc(_),this.Ic()}catch(t){console.error(t),this.Dt=!0}}};update=async()=>{this.xt||this.Dt||this.Nt||(this.Pt++,this.gc?await this.Ec():await this._c())};draw=async()=>{this.xt||this.Dt||this.Nt?this.hl():(this.gc?this.Cc():await this.Tc(),this.js=0)};refresh=()=>{this.$t=!0};qo=async(t,i)=>{if(console.log(`${t}%: ${i}`),await this.Oc(),!this.qt)return void await super.qo(t,i);this.si?.bind();this.yi?.vc(180,54,'RuneScape is loading - please wait...',m.A.Sl);u.A.Rl(28,62,304,34,m.A.bc),u.A.Rl(29,63,302,32,m.A.Zl),u.A.fillRect(30,64,3*t,30,m.A.bc),u.A.fillRect(30+3*t,64,300-3*t,30,m.A.Zl),this.yi?.vc(180,85,i,m.A.Sl),this.si?.draw(214,186),this.$t&&(this.$t=!1,this.mi||(this.hi?.draw(0,0),this.ei?.draw(661,0)),this.ti?.draw(128,0),this.ii?.draw(214,386),this.ni?.draw(0,265),this.ri?.draw(574,265),this.oi?.draw(128,186),this.li?.draw(574,186)),await(0,Z.Jo)(5)};Lc=()=>{this.mi&&(this.Rc(),this.Rc(),this.Sc())};Oc=async()=>{this.ti||(this.Po=null,this.Fi=null,this.Ni=null,this.Di=null,this.Pi=null,this.Ui=null,this.Bi=null,this.Gi=null,this.hi=new f.A(128,265),u.A.clear(),this.ei=new f.A(128,265),u.A.clear(),this.ti=new f.A(533,186),u.A.clear(),this.ii=new f.A(360,146),u.A.clear(),this.si=new f.A(360,200),u.A.clear(),this.ni=new f.A(214,267),u.A.clear(),this.ri=new f.A(215,267),u.A.clear(),this.oi=new f.A(86,79),u.A.clear(),this.li=new f.A(87,79),u.A.clear(),this.qt&&(await this.ec(),this.nc()),this.$t=!0)};ec=async()=>{if(!this.qt)return;const t=await y.A.Mc(this.qt,'title');this.hi?.bind(),t.cc(0,0),this.ei?.bind(),t.cc(-661,0),this.ti?.bind(),t.cc(-128,0),this.ii?.bind(),t.cc(-214,-386),this.si?.bind(),t.cc(-214,-186),this.ni?.bind(),t.cc(0,-265),this.ri?.bind(),t.cc(-128,-186),this.oi?.bind(),t.cc(-128,-186),this.li?.bind(),t.cc(-574,-186),t.lc(),this.hi?.bind(),t.cc(394,0),this.ei?.bind(),t.cc(-267,0),this.ti?.bind(),t.cc(266,0),this.ii?.bind(),t.cc(180,-386),this.si?.bind(),t.cc(180,-186),this.ni?.bind(),t.cc(394,-265),this.ri?.bind(),t.cc(-180,-265),this.oi?.bind(),t.cc(212,-186),this.li?.bind(),t.cc(-180,-186);const i=y.A.hc(this.qt,'logo');this.ti?.bind(),i.draw((this.width/2|0)-(i.width/2|0)-128,18)};kc=t=>{if(!this._i||!this.Ei)return;this._i.fill(0);for(let t=0;t<5e3;t++){const t=128*Math.random()*256|0;this._i[t]=256*Math.random()|0}for(let t=0;t<20;t++){for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);this.Ei[s]=(this._i[s-1]+this._i[s+1]+this._i[s-128]+this._i[s+128])/4|0}const t=this._i;this._i=this.Ei,this.Ei=t}if(t){let i=0;for(let s=0;s{if(this.qt){this.ai=w.A.hc(this.qt,'titlebox'),this.ci=w.A.hc(this.qt,'titlebutton');for(let t=0;t<12;t++)this.pi[t]=w.A.hc(this.qt,'runes',t);this.Ii=new y.A(128,265),this.gi=new y.A(128,265),this.hi&&(0,Z.Nc)(this.hi.yc,0,this.Ii.yc,0,33920),this.ei&&(0,Z.Nc)(this.ei.yc,0,this.gi.yc,0,33920),this.vi=new Int32Array(256);for(let t=0;t<64;t++)this.vi[t]=262144*t;for(let t=0;t<64;t++)this.vi[t+64]=1024*t+m.A.RED;for(let t=0;t<64;t++)this.vi[t+128]=4*t+m.A.ql;for(let t=0;t<64;t++)this.vi[t+192]=m.A.Sl;this.bi=new Int32Array(256);for(let t=0;t<64;t++)this.bi[t]=1024*t;for(let t=0;t<64;t++)this.bi[t+64]=4*t+m.A.GREEN;for(let t=0;t<64;t++)this.bi[t+128]=262144*t+m.A.Pc;for(let t=0;t<64;t++)this.bi[t+192]=m.A.Sl;this.Li=new Int32Array(256);for(let t=0;t<64;t++)this.Li[t]=4*t;for(let t=0;t<64;t++)this.Li[t+64]=262144*t+m.A.BLUE;for(let t=0;t<64;t++)this.Li[t+128]=1024*t+m.A.Fc;for(let t=0;t<64;t++)this.Li[t+192]=m.A.Sl;this.Oi=new Int32Array(256),this._i=new Int32Array(32768),this.Ei=new Int32Array(32768),this.kc(null),this.Ci=new Int32Array(32768),this.Ti=new Int32Array(32768),this.qo(10,'Connecting to fileserver').then((()=>{this.mi||(this.mi=!0,this.xi=setInterval(this.Lc,35))}))}};_c=async()=>{if(0===this.Jt){let t=(this.width/2|0)-80,i=20+(this.height/2|0);if(i+=20,1===this.Uc&&this.Bc>=t-75&&this.Bc<=t+75&&this.Gc>=i-20&&this.Gc<=i+20){if(+$.K.getParameter('world')>=998)return void this.Vo();this.Jt=3,this.Qt=0}t=80+(this.width/2|0),1===this.Uc&&this.Bc>=t-75&&this.Bc<=t+75&&this.Gc>=i-20&&this.Gc<=i+20&&(this.fi='',this.ui='Enter your username & password.',this.Jt=2,this.Qt=0)}else if(2===this.Jt){let t=(this.height/2|0)-40;t+=30,t+=25,1===this.Uc&&this.Gc>=t-15&&this.Gc=t-15&&this.Gc=i-75&&this.Bc<=i+75&&this.Gc>=s-20&&this.Gc<=s+20&&await this.Hc(this.username,this.password,!1),i=80+(this.width/2|0),1===this.Uc&&this.Bc>=i-75&&this.Bc<=i+75&&this.Gc>=s-20&&this.Gc<=s+20&&(this.Jt=0,this.username='',this.password='');;){const t=this.Wc();if(-1===t)return;let i=!1;for(let s=0;s0&&(this.username=this.username.substring(0,this.username.length-1)),9!==t&&10!==t&&13!==t||(this.Qt=1),i&&(this.username=this.username+String.fromCharCode(t)),this.username.length>12&&(this.username=this.username.substring(0,12))):1===this.Qt&&(8===t&&this.password.length>0&&(this.password=this.password.substring(0,this.password.length-1)),9!==t&&10!==t&&13!==t||(this.Qt=0),i&&(this.password=this.password+String.fromCharCode(t)),this.password.length>20&&(this.password=this.password.substring(0,20)))}}else if(3===this.Jt){const t=this.width/2|0;let i=50+(this.height/2|0);i+=20,1===this.Uc&&this.Bc>=t-75&&this.Bc<=t+75&&this.Gc>=i-20&&this.Gc<=i+20&&(this.Jt=0)}};Tc=async()=>{await this.Oc(),this.si?.bind(),this.ai?.draw(0,0);if(0===this.Jt){let t=180,i=80;this.yi?.la(t,i,'Welcome to RuneScape',m.A.ql,!0),t=100,i=120,this.ci?.draw(t-73,i-20),this.yi?.la(t,i+5,'New user',m.A.Sl,!0),t=260,this.ci?.draw(t-73,i-20),this.yi?.la(t,i+5,'Existing User',m.A.Sl,!0)}else if(2===this.Jt){let t=100,i=60;this.fi.length>0?(this.yi?.la(180,i-15,this.fi,m.A.ql,!0),this.yi?.la(180,i,this.ui,m.A.ql,!0),i+=30):(this.yi?.la(180,i-7,this.ui,m.A.ql,!0),i+=30),this.yi?.ca(90,i,`Username: ${this.username}${0===this.Qt&&this.Pt%40<20?'@yel@|':''}`,m.A.Sl,!0),i+=15,this.yi?.ca(92,i,`Password: ${M.A.Vc(this.password)}${1===this.Qt&&this.Pt%40<20?'@yel@|':''}`,m.A.Sl,!0),i=150,this.ci?.draw(t-73,i-20),this.yi?.la(t,i+5,'Login',m.A.Sl,!0),t=260,this.ci?.draw(t-73,i-20),this.yi?.la(t,i+5,'Cancel',m.A.Sl,!0)}else if(3===this.Jt){this.yi?.la(180,40,'Create a free account',m.A.ql,!0);const t=180;let i=65;this.yi?.la(180,i,'To create a new account you need to',m.A.Sl,!0),i+=15,this.yi?.la(180,i,'go back to the main RuneScape webpage',m.A.Sl,!0),i+=15,this.yi?.la(180,i,"and choose the red 'create account'",m.A.Sl,!0),i+=15,this.yi?.la(180,i,'button at the top right of that page.',m.A.Sl,!0),i=150,this.ci?.draw(t-73,i-20),this.yi?.la(t,i+5,'Cancel',m.A.Sl,!0)}this.si?.draw(214,186),this.$t&&(this.$t=!1,this.ti?.draw(128,0),this.ii?.draw(214,386),this.ni?.draw(0,265),this.ri?.draw(574,265),this.oi?.draw(128,186),this.li?.draw(574,186))};Hc=async(i,s,h)=>{try{if(h||(this.fi='',this.ui='Connecting to server...',await this.Tc()),'998'===t.getParameter('world')){if(this.Oo&&!this.Oo.So)return this.fi='You are not connected to a host.',void(this.ui='Please try using world 999.');this.stream=new et.A(this.Co,this.Oo.Mo)}else if('999'===t.getParameter('world')){if(!this.To)return this.fi='The server is starting up.',void(this.ui='Please try again in a moment.');this.stream=new et.A(this.Co,this.host.Mo)}else this.stream=new g.A(await g.A.Kc({host:$.K.ht,port:43594+$.K.portOffset}));await this.stream.Xc(this.in.data,0,8),this.in.jc=0,this.Ht=this.in.zc;const e=new Int32Array([Math.floor(99999999*Math.random()),Math.floor(99999999*Math.random()),Number(this.Ht>>32n),Number(this.Ht&BigInt(4294967295))]);this.Bt.jc=0,this.Bt.p1(10),this.Bt.p4(e[0]),this.Bt.p4(e[1]),this.Bt.p4(e[2]),this.Bt.p4(e[3]),this.Bt.p4(0),this.Bt.Zc(i),this.Bt.Zc(s),this.Bt.qc($.K.ct,$.K.exponent),this.Gt.jc=0,h?this.Gt.p1(18):this.Gt.p1(16),this.Gt.p1(this.Bt.jc+36+1+1),this.Gt.p1($.K.tt),this.Gt.p1($.K.st?1:0);for(let t=0;t<9;t++)this.Gt.p4(this.Ft[t]);this.Gt.$c(this.Bt.data,this.Bt.jc,0),this.Bt.random=new _.A(e);for(let t=0;t<4;t++)e[t]+=50;this.Kt=new _.A(e),this.stream?.write(this.Gt.data,this.Gt.jc);const n=await this.stream.read();if(1===n)return await(0,Z.Jo)(2e3),void await this.Hc(i,s,h);if(2===n||18===n){this.Br=18===n,k.A.Jc(),this.gc=!0,this.Bt.jc=0,this.in.jc=0,this.Xt=-1,this.jt=-1,this.zt=-1,this.Zt=-1,this.packetSize=0,this.Wt=0,this.Vt=0,this.Yt=0,this.yh=0,this.nh=0,this.Qs=!1,this.Qc=0;for(let t=0;t<100;t++)this.Vh[t]=null;this.oe=0,this.Ie=0,this.We=0,this.ro=0,this.Ze=(100*Math.random()|0)-50,this.qe=(110*Math.random()|0)-55,this.$e=(80*Math.random()|0)-40,this.yn=(120*Math.random()|0)-60,this.An=(30*Math.random()|0)-20,this.Fn=(20*Math.random()|0)-10&2047,this.In=-1,this.Ke=0,this.Xe=0,this.rr=0,this.Ar=0;for(let t=0;t{if(null!==this.nr){this.Vt>1&&this.Vt--,this.Yt>0&&this.Yt--;for(let t=0;t<5&&await this.read();t++);if(this.gc){for(let t=0;tthis.yo+(this.wo/22|0)&&(this.wo=i.jc,this.yo=Date.now(),this.uo=this.lo[t],this.do=this.ao[t],await(0,z.hf)(i.data.slice(0,i.jc),this.fo))}catch(t){console.error(t)}this.ro--;for(let i=t;i0&&(this.Ao-=20,this.Ao<0&&(this.Ao=0),0===this.Ao&&this.po&&!$.K.st&&this.mo&&await this.tl(this.mo,this.Io,this.Eo,!1));const t=k.A.flush();if(t&&(this.Bt.ef(O.A.nf),this.Bt.p2(t.jc),this.Bt.$c(t.data,t.jc,0),t.release()),this.Wt++,this.Wt>750&&await this.rf(),this.lf(),this.af(),this.cf(),this.ff(),(1===this.uf[1]||1===this.uf[2]||1===this.uf[3]||1===this.uf[4])&&this.Nn++>5&&(this.Nn=0,this.Bt.ef(O.A.df),this.Bt.p2(this.Pn),this.Bt.p2(this.Fn),this.Bt.p1(this.yn),this.Bt.p1(this.An)),this.Ye++,0!==this.zs&&(this.Zs+=20,this.Zs>=400&&(this.zs=0)),0!==this.ue&&(this.ye++,this.ye>=15&&(2===this.ue&&(this.Ws=!0),3===this.ue&&(this.Ys=!0),this.ue=0)),0!==this.se&&(this.ne++,(this.Yl>this.he+5||this.Ylthis.ee+5||this.Vl=5){if(this.Le=-1,this.yf(),this.Le===this.te&&this.Re!==this.ie){const t=c.A.Do[this.te];if(t.Ul){const i=t.Ul[this.Re];t.Ul[this.Re]=t.Ul[this.ie],t.Ul[this.ie]=i}if(t.Bl){const i=t.Bl[this.Re];t.Bl[this.Re]=t.Bl[this.ie],t.Bl[this.ie]=i}this.Bt.ef(O.A.Af),this.Bt.p2(this.te),this.Bt.p2(this.ie),this.Bt.p2(this.Re)}}else(1===this.Ce||this.pf(this.nh-1))&&this.nh>2?this.mf():this.nh>0&&await this.If(this.nh-1);this.ye=10,this.Uc=0}if($.K.dt++,$.K.dt>127&&($.K.dt=0,this.Bt.ef(O.A.gf),this.Bt.p3(4991788)),-1!==x.A.Ef&&this.Sr){const t=x.A.Ef,i=x.A._f,s=this.Cf(this.Sr.Tf[0],this.Sr.Of[0],t,i,0,0,0,0,0,0,!0);x.A.Ef=-1,s&&(this.qs=this.Bc,this.$s=this.Gc,this.zs=1,this.Zs=0)}1===this.Uc&&this.Lh&&(this.Lh=null,this.Ys=!0,this.Uc=0),await this.vf(),this.bf(),this.Lf(),this.Rf(),1!==this.wf&&1!==this.Uc||this.js++,2===this.We&&($.K.ot?this.Sf():this.Mf()),2===this.We&&this.je&&this.kf();for(let t=0;t<5;t++)this.sn[t]++;if(await this.xf(),this.Qc++,this.Qc>4500&&(this.Yt=250,this.Qc-=500,this.Bt.ef(O.A.Df)),this.ze++,this.ze>500){this.ze=0;const t=8*Math.random()|0;1&~t||(this.Ze+=this.Je),2&~t||(this.qe+=this.Qe),4&~t||(this.$e+=this.tn)}if(this.Ze<-50&&(this.Je=2),this.Ze>50&&(this.Je=-2),this.qe<-55&&(this.Qe=2),this.qe>55&&(this.Qe=-2),this.$e<-40&&(this.tn=1),this.$e>40&&(this.tn=-1),this.wn++,this.wn>500){this.wn=0;const t=8*Math.random()|0;1&~t||(this.yn+=this.mn),2&~t||(this.An+=this.pn)}this.yn<-60&&(this.mn=2),this.yn>60&&(this.mn=-2),this.An<-20&&(this.pn=1),this.An>10&&(this.pn=-1),$.K.wt++,$.K.wt>110&&($.K.wt=0,this.Bt.ef(O.A.Nf),this.Bt.p4(0)),this.Pr++,this.Pr>50&&this.Bt.ef(O.A.Pf);try{this.stream&&this.Bt.jc>0&&(this.stream.write(this.Bt.data,this.Bt.jc),this.Bt.jc=0,this.Pr=0)}catch(t){console.log(t),await this.rf()}}}};Cc=()=>{if(null===this.nr)return;this.$t&&(this.$t=!1,this.Hi?.draw(0,11),this.Wi?.draw(0,375),this.Yi?.draw(729,5),this.Vi?.draw(752,231),this.Ki?.draw(0,0),this.Xi?.draw(561,0),this.ji?.draw(520,11),this.zi?.draw(520,231),this.Zi?.draw(501,375),this.qi?.draw(0,345),this.Ws=!0,this.Ys=!0,this.Vs=!0,this.Ks=!0,2!==this.We&&(this.Pi?.draw(8,11),this.Ni?.draw(561,5))),2===this.We&&this.Ff(),this.Qs&&1===this.th&&(this.Ws=!0);let t=!1;if(-1!==this.oh&&(t=this.pl(this.oh,this.Ye),t&&(this.Ws=!0)),2===this.ue&&(this.Ws=!0),2===this.se&&(this.Ws=!0),this.Ws&&(this.Uf(),this.Ws=!1),-1===this.lh){this.ah.Dl=this.fh-this.uh-77,this.Yl>453&&this.Yl<565&&this.Vl>350&&this.Bf(this.Yl-22,this.Vl-375,this.fh,77,!1,463,0,this.ah);let t=this.fh-this.ah.Dl-77;t<0&&(t=0),t>this.fh-77&&(t=this.fh-77),this.uh!==t&&(this.uh=t,this.Ys=!0)}-1!==this.lh&&(t=this.pl(this.lh,this.Ye),t&&(this.Ys=!0)),3===this.ue&&(this.Ys=!0),3===this.se&&(this.Ys=!0),this.Lh&&(this.Ys=!0),this.Qs&&2===this.th&&(this.Ys=!0),this.Ys&&(this.Gf(),this.Ys=!1),2===this.We&&(this.Hf(),this.Ni?.draw(561,5)),-1!==this.Rh&&(this.Vs=!0),this.Vs&&(-1!==this.Rh&&this.Rh===this.Sh&&(this.Rh=-1,this.Bt.ef(O.A.Wf),this.Bt.p1(this.Sh)),this.Vs=!1,this.Gi?.bind(),this.fs?.draw(0,0),-1===this.oh&&(-1!==this.Mh[this.Sh]&&(0===this.Sh?this.Rs?.draw(29,30):1===this.Sh?this.Ss?.draw(59,29):2===this.Sh?this.Ss?.draw(87,29):3===this.Sh?this.Ms?.draw(115,29):4===this.Sh?this.xs?.draw(156,29):5===this.Sh?this.xs?.draw(184,29):6===this.Sh&&this.ks?.draw(212,30)),-1!==this.Mh[0]&&(0!==this.Rh||this.Pt%20<10)&&this.us[0]?.draw(35,34),-1!==this.Mh[1]&&(1!==this.Rh||this.Pt%20<10)&&this.us[1]?.draw(59,32),-1!==this.Mh[2]&&(2!==this.Rh||this.Pt%20<10)&&this.us[2]?.draw(86,32),-1!==this.Mh[3]&&(3!==this.Rh||this.Pt%20<10)&&this.us[3]?.draw(121,33),-1!==this.Mh[4]&&(4!==this.Rh||this.Pt%20<10)&&this.us[4]?.draw(157,34),-1!==this.Mh[5]&&(5!==this.Rh||this.Pt%20<10)&&this.us[5]?.draw(185,32),-1!==this.Mh[6]&&(6!==this.Rh||this.Pt%20<10)&&this.us[6]?.draw(212,34)),this.Gi?.draw(520,165),this.Bi?.bind(),this.cs?.draw(0,0),-1===this.oh&&(-1!==this.Mh[this.Sh]&&(7===this.Sh?this.Ds?.draw(49,0):8===this.Sh?this.Ns?.draw(81,0):9===this.Sh?this.Ns?.draw(108,0):10===this.Sh?this.Ps?.draw(136,1):11===this.Sh?this.Us?.draw(178,0):12===this.Sh?this.Us?.draw(205,0):13===this.Sh&&this.Fs?.draw(233,0)),-1!==this.Mh[8]&&(8!==this.Rh||this.Pt%20<10)&&this.us[7]?.draw(80,2),-1!==this.Mh[9]&&(9!==this.Rh||this.Pt%20<10)&&this.us[8]?.draw(107,3),-1!==this.Mh[10]&&(10!==this.Rh||this.Pt%20<10)&&this.us[9]?.draw(142,4),-1!==this.Mh[11]&&(11!==this.Rh||this.Pt%20<10)&&this.us[10]?.draw(179,2),-1!==this.Mh[12]&&(12!==this.Rh||this.Pt%20<10)&&this.us[11]?.draw(206,2),-1!==this.Mh[13]&&(13!==this.Rh||this.Pt%20<10)&&this.us[12]?.draw(230,2)),this.Bi?.draw(501,492),this.Pi?.bind()),this.Ks&&(this.Ks=!1,this.Ui?.bind(),this.ls?.draw(0,0),this.wi?.la(57,33,'Public chat',m.A.Sl,!0),0===this.kh&&this.wi?.la(57,46,'On',m.A.GREEN,!0),1===this.kh&&this.wi?.la(57,46,'Friends',m.A.ql,!0),2===this.kh&&this.wi?.la(57,46,'Off',m.A.RED,!0),3===this.kh&&this.wi?.la(57,46,'Hide',m.A.Pc,!0),this.wi?.la(186,33,'Private chat',m.A.Sl,!0),0===this.xh&&this.wi?.la(186,46,'On',m.A.GREEN,!0),1===this.xh&&this.wi?.la(186,46,'Friends',m.A.ql,!0),2===this.xh&&this.wi?.la(186,46,'Off',m.A.RED,!0),this.wi?.la(326,33,'Trade/duel',m.A.Sl,!0),0===this.Dh&&this.wi?.la(326,46,'On',m.A.GREEN,!0),1===this.Dh&&this.wi?.la(326,46,'Friends',m.A.ql,!0),2===this.Dh&&this.wi?.la(326,46,'Off',m.A.RED,!0),this.wi?.la(462,38,'Report abuse',m.A.Sl,!0),this.Ui?.draw(0,471),this.Pi?.bind()),this.Ye=0};Ff=()=>{if(this.Ve++,this.Yf(),this.Vf(),this.Kf(),this.Xf(),this.jf(),!this.je){let t=this.Pn;(this.dn/256|0)>t&&(t=this.dn/256|0),this.hn[4]&&this.nn[4]+128>t&&(t=this.nn[4]+128);const i=this.Fn+this.$e&2047;if(this.Sr&&this.zf(this.Gn,this.Zf(this.Dn,this.Sr.x,this.Sr.z)-50,this.Hn,i,t,3*t+600),$.K.ut++,$.K.ut>1802){$.K.ut=0,this.Bt.ef(O.A.qf),this.Bt.p1(0);const t=this.Bt.jc;this.Bt.p2(29711),this.Bt.p1(70),this.Bt.p1(256*Math.random()|0),this.Bt.p1(242),this.Bt.p1(186),this.Bt.p1(39),this.Bt.p1(61),2*Math.random()|0||this.Bt.p1(13),2*Math.random()|0||this.Bt.p2(57856),this.Bt.p2(65536*Math.random()|0),this.Bt.$f(this.Bt.jc-t)}}let t;t=this.je?this.Jf():this.Qf();const i=this.ln,s=this.an,h=this.cn,e=this.fn,n=this.un;let r;for(let t=0;t<5;t++)this.hn[t]&&(r=Math.random()*(2*this.en[t]+1)-this.en[t]+Math.sin(this.sn[t]*(this.rn[t]/100))*this.nn[t]|0,0===t&&(this.ln+=r),1===t&&(this.an+=r),2===t&&(this.cn+=r),3===t&&(this.un=this.un+r&2047),4===t&&(this.fn+=r,this.fn<128&&(this.fn=128),this.fn>383&&(this.fn=383)));r=d.A.tu,p.A.iu=!0,p.A.su=0,p.A.Yl=this.Yl-8,p.A.Vl=this.Vl-11,u.A.clear(),this.He?.draw(this.ln,this.an,this.cn,t,this.un,this.fn,this.Pt),this.He?.hu(),this.eu(),this.nu(),$.K.nt&&this.ru(),this.ou(r),this.lu(),this.Pi?.draw(8,11),this.ln=i,this.an=s,this.cn=h,this.fn=e,this.un=n};au=()=>{e.A.cu?.clear(),e.A.fu?.clear(),r.A.No?.clear(),n.A.No?.clear(),n.A.uu?.clear(),W.A.No?.clear(),l.A.No?.clear()};du=(t,i)=>{this.wu(t.x,i,t.z)};wu=(t,i,s)=>{if(t<128||s<128||t>13056||s>13056)return this.jn=-1,void(this.zn=-1);const h=this.Zf(this.Dn,t,s)-i;this.yu(t,h,s)};yu=(t,i,s)=>{let h=t-this.ln,e=i-this.an,n=s-this.cn;const r=d.A.sin[this.fn],o=d.A.cos[this.fn],l=d.A.sin[this.un],a=d.A.cos[this.un];let c=n*l+h*a>>16;n=n*a-h*l>>16,h=c,c=e*o-n*r>>16,n=e*r+n*o>>16,e=c,n>=50?(this.jn=d.A.ya+((h<<9)/n|0),this.zn=d.A.Aa+((e<<9)/n|0)):(this.jn=-1,this.zn=-1)};eu=()=>{this.Kr=0;for(let t=-1;t-1))for(let t=0;t<8;t++)h.Au&1<=0&&10===this.yh&&this.Ih===this.lr[t]&&(this.du(i,i.height+15),this.jn>-1&&this.gs[7]?.draw(this.jn-12,this.zn-s))}else 1===this.yh&&this.Ah===this.pr[t-this.rr]&&this.Pt%20<10&&(this.du(i,i.height+15),this.jn>-1&&this.gs[2]?.draw(this.jn-12,this.zn-28));if(i.pu&&(t>=this.rr||0===this.kh||3===this.kh||1===this.kh&&this.mu(i.name))&&(this.du(i,i.height),this.jn>-1&&this.Kr<$.K.Xr&&this.yi&&(this.qr[this.Kr]=this.yi.Iu(i.pu)/2|0,this.Zr[this.Kr]=this.yi.height,this.jr[this.Kr]=this.jn,this.zr[this.Kr]=this.zn,this.$r[this.Kr]=i.gu,this.Jr[this.Kr]=i.Eu,this.Qr[this.Kr]=i._u,this.io[this.Kr++]=i.pu,0===this.Zh&&1===i.Eu&&(this.Zr[this.Kr]+=10,this.zr[this.Kr]+=5),0===this.Zh&&2===i.Eu&&(this.qr[this.Kr]=60))),i.Cu>this.Pt+100&&(this.du(i,i.height+15),this.jn>-1)){let t=30*i.Tu/i.Ou|0;t>30&&(t=30),u.A.fillRect(this.jn-15,this.zn-3,t,5,m.A.GREEN),u.A.fillRect(this.jn-15+t,this.zn-3,30-t,5,m.A.RED)}if(i.Cu>this.Pt+330&&(this.du(i,i.height/2|0),this.jn>-1&&(this.Is[i.vu]?.draw(this.jn-12,this.zn-12),this.di?.vc(this.jn,this.zn+4,i.bu.toString(),m.A.Zl),this.di?.vc(this.jn-1,this.zn+3,i.bu.toString(),m.A.Sl))),$.K.nt){if(i.pathLength>0||i.Lu>=this.Pt||i.Ru>this.Pt){const t=64*i.size;this.Su(128*i.Tf[0]+t,128*i.Of[0]+t,this.Dn,i.size,65535,!1)}this.Su(i.x,i.z,this.Dn,i.size,6710886,!1);let s=0;if(this.du(i,i.height+30),t32767&&(i-=32768),this.di?.vc(this.jn,this.zn+s,'Face Entity: '+i,m.A.Sl),s-=15}(t.Mu&W.A.Uu)===W.A.Uu&&(this.di?.vc(this.jn,this.zn+s,'Say',m.A.Sl),s-=15),(t.Mu&W.A.Bu)===W.A.Bu&&(this.di?.vc(this.jn,this.zn+s,'Hit: Type '+t.vu+' Amount '+t.bu+' HP '+t.Tu+'/'+t.Ou,m.A.Sl),s-=15),(t.Mu&W.A.Gu)===W.A.Gu&&(this.di?.vc(this.jn,this.zn+s,'Face Coord: '+t.Hu/2+' '+t.Wu/2,m.A.Sl),s-=15),(t.Mu&W.A.Yu)===W.A.Yu&&(this.di?.vc(this.jn,this.zn+s,'Chat',m.A.Sl),s-=15),(t.Mu&W.A.Vu)===W.A.Vu&&(this.di?.vc(this.jn,this.zn+s,'Play Spotanim: '+t.Ku,m.A.Sl),s-=15),(t.Mu&W.A.Xu)===W.A.Xu&&(this.di?.vc(this.jn,this.zn+s,'Exact Move',m.A.Sl),s-=15)}}else{const t=i;let s=0;if(this.du(i,i.height+30),this.di?.vc(this.jn,this.zn+s,t.type?.name??null,m.A.Sl),s-=15,-1!==t.Mu&&this.Pt-t.ku<30){if((t.Mu&Y.A.Du)===Y.A.Du&&(this.di?.vc(this.jn,this.zn+s,'Play Seq: '+t.Nu,m.A.Sl),s-=15),(t.Mu&Y.A.Pu)===Y.A.Pu){let i=t.Fu;i>32767&&(i-=32768),this.di?.vc(this.jn,this.zn+s,'Face Entity: '+i,m.A.Sl),s-=15}(t.Mu&Y.A.Uu)===Y.A.Uu&&(this.di?.vc(this.jn,this.zn+s,'Say',m.A.Sl),s-=15),(t.Mu&Y.A.Bu)===Y.A.Bu&&(this.di?.vc(this.jn,this.zn+s,'Hit: Type '+t.vu+' Amount '+t.bu+' HP '+t.Tu+'/'+t.Ou,m.A.Sl),s-=15),(t.Mu&Y.A.ju)===Y.A.ju&&(this.di?.vc(this.jn,this.zn+s,'Change Type: '+t.type?.id??null,m.A.Sl),s-=15),(t.Mu&Y.A.Vu)===Y.A.Vu&&(this.di?.vc(this.jn,this.zn+s,'Play Spotanim: '+t.Ku,m.A.Sl),s-=15),(t.Mu&Y.A.Gu)===Y.A.Gu&&(this.di?.vc(this.jn,this.zn+s,'Face Coord: '+t.Hu/2+' '+t.Wu/2,m.A.Sl),s-=15)}}}}}if($.K.nt)for(let t=0;t=104||i.z>=104||this.Su(128*i.x+64,128*i.z+64,i.level,1,16776960,!1)}for(let t=0;tthis.zr[r]-this.Zr[r]&&s-ethis.jr[r]-this.qr[r]&&this.zr[r]-this.Zr[r]{2===this.yh&&this.gs[2]&&(this.wu((this.gh-this.Tn<<7)+this.ph,2*this._h,(this.Eh-this.On<<7)+this.mh),this.jn>-1&&this.Pt%20<10&&this.gs[2].draw(this.jn-12,this.zn-28))};ru=()=>{const t=507;let i=13;this.Lo?this.di?.$u(t,i,'tock',m.A.ql,!0):this.yi?.$u(t,i,'tick',m.A.ql,!0),i+=13,this.di?.$u(t,i,`Fps: ${this.Ju}, ${this.Qu} ms`,m.A.ql,!0),i+=13,this.di?.$u(t,i,`Draw: ${this.ms.toFixed(1)}, Avg: ${this.td.toFixed(1)}, Slow: ${this.sd.toFixed(1)} ms`,m.A.ql,!0),i+=13,this.di?.$u(t,i,`Occluders: ${x.A.hd[x.A.ed]} Active: ${x.A.nd}`,m.A.ql,!0),i+=13,this.di?.$u(t,i,'Local Pos: '+(this.Sr?.x??-1)+', '+(this.Sr?.z??-1)+', '+(this.Sr?.y??-1),m.A.ql,!0),i+=13,this.di?.$u(t,i,'Camera Pos: '+this.ln+', '+this.cn+', '+this.an,m.A.ql,!0),i+=13,this.di?.$u(t,i,'Camera Angle: '+this.un+', '+this.fn,m.A.ql,!0),i+=13,this.di?.$u(t,i,'Cutscene Source: '+this.tr+', '+this.ir+' '+this.sr+'; '+this.hr+', '+this.er,m.A.ql,!0),i+=13,this.di?.$u(t,i,'Cutscene Destination: '+this.Zn+', '+this.qn+' '+this.$n+'; '+this.Jn+', '+this.Qn,m.A.ql,!0),$.K.ot&&(i+=13,this.di?.$u(t,i,'Instructions:',m.A.ql,!0),i+=13,this.di?.$u(t,i,'- Arrows to move Camera',m.A.ql,!0),i+=13,this.di?.$u(t,i,'- Shift to control Source or Dest',m.A.ql,!0),i+=13,this.di?.$u(t,i,'- Alt to control Height',m.A.ql,!0),i+=13,this.di?.$u(t,i,'- Ctrl to control Modifier',m.A.ql,!0))};Su=(t,i,s,h,e,n)=>{const r=this.Zf(s,t,i),o=64*h;this.yu(t-o,r,i-o);const l=this.jn,a=this.zn;this.yu(t+o,r,i-o);const c=this.jn,f=this.zn;this.yu(t-o,r,i+o);const d=this.jn,w=this.zn;this.yu(t+o,r,i+o);const y=this.jn,A=this.zn;-1!==l&&-1!==c&&-1!==d&&-1!==y&&(n&&(u.A.rd(l,a,y,A,(16711422&e)>>1),u.A.rd(c,f,d,w,(16711422&e)>>1)),u.A.rd(l,a,c,f,e),u.A.rd(l,a,d,w,e),u.A.rd(c,f,y,A,e),u.A.rd(d,w,y,A,e))};Sf(){const t=1==this.uf[5]?2:1;1==this.uf[6]?(1==this.uf[1]?(this.Zn-=t,this.Zn<1&&(this.Zn=1)):1==this.uf[2]&&(this.Zn+=t,this.Zn>102&&(this.Zn=102)),1==this.uf[3]?1==this.uf[7]?this.$n+=2*t:(this.qn+=1,this.qn>102&&(this.qn=102)):1==this.uf[4]&&(1==this.uf[7]?this.$n-=2*t:(this.qn-=1,this.qn<1&&(this.qn=1)))):(1==this.uf[1]?(this.tr-=t,this.tr<1&&(this.tr=1)):1==this.uf[2]&&(this.tr+=t,this.tr>102&&(this.tr=102)),1==this.uf[3]?1==this.uf[7]?this.sr+=2*t:(this.ir+=t,this.ir>102&&(this.ir=102)):1==this.uf[4]&&(1==this.uf[7]?this.sr-=2*t:(this.ir-=t,this.ir<1&&(this.ir=1)))),this.ln=128*this.tr+64,this.cn=128*this.ir+64,this.an=this.Zf(this.Dn,this.tr,this.ir)-this.sr;const i=128*this.Zn+64,s=128*this.qn+64,h=this.Zf(this.Dn,this.Zn,this.qn)-this.$n,e=i-this.ln,n=h-this.an,r=s-this.cn,o=0|Math.sqrt(e*e+r*r);this.fn=325.949*Math.atan2(n,o)&2047,this.un=-325.949*Math.atan2(e,r)&2047,this.fn<128&&(this.fn=128),this.fn>383&&(this.fn=383)}lu=()=>{if(this.od(),1===this.zs&&this._s[this.Zs/100|0]?.draw(this.qs-8-8,this.$s-8-11),2===this.zs&&this._s[4+(this.Zs/100|0)]?.draw(this.qs-8-8,this.$s-8-11),-1!==this.Xs&&(this.pl(this.Xs,this.Ye),this.Ol(c.A.Do[this.Xs],0,0,0)),this.ld(),this.Qs?0===this.th&&this.ad():(this.yf(),this.fd()),1===this.kr&&(this.Fr>0||1===this.Ur?this.gs[1]?.draw(472,258):this.gs[1]?.draw(472,296)),this.Fr>0&&(this.gs[0]?.draw(472,296),this.wi?.vc(484,329,'Level: '+this.Fr,m.A.ql)),1===this.Ur&&(this.gs[6]?.draw(472,296),this.wi?.vc(484,329,'Arena',m.A.ql)),0!==this.Vt){let t=this.Vt/50|0;const i=t/60|0;t%=60,t<10?this.wi?.jl(4,329,'System update in: '+i+':0'+t,m.A.ql):this.wi?.jl(4,329,'System update in: '+i+':'+t,m.A.ql)}};od=()=>{if(0===this.zh)return;const t=this.wi;let i=0;0!==this.Vt&&(i=1);for(let s=0;s<100;s++){if(!this.Vh[s])continue;const h=this.messageType[s];let e;if((3===h||7===h)&&(7===h||0===this.xh||1===this.xh&&this.mu(this.Kh[s]))&&(e=329-13*i,t?.jl(4,e,'From '+this.Kh[s]+': '+this.Vh[s],m.A.Zl),t?.jl(4,e-1,'From '+this.Kh[s]+': '+this.Vh[s],m.A.Pc),i++,i>=5))return;if(5===h&&this.xh<2&&(e=329-13*i,t?.jl(4,e,this.Vh[s],m.A.Zl),t?.jl(4,e-1,this.Vh[s],m.A.Pc),i++,i>=5))return;if(6===h&&this.xh<2&&(e=329-13*i,t?.jl(4,e,'To '+this.Kh[s]+': '+this.Vh[s],m.A.Zl),t?.jl(4,e-1,'To '+this.Kh[s]+': '+this.Vh[s],m.A.Pc),i++,i>=5))return}};ld=()=>{if(!this.Sr)return;const t=(this.Sr.x>>7)+this.Tn,i=(this.Sr.z>>7)+this.On;if(this.Fr=t>=2944&&t<3392&&i>=3520&&i<6400?1+((i-3520)/8|0):t>=2944&&t<3392&&i>=9920&&i<12800?1+((i-9920)/8|0):0,this.Ur=0,t>=3328&&t<3392&&i>=3200&&i<3264){const s=63&t,h=63&i;(s>=4&&s<=29&&h>=44&&h<=58||s>=36&&s<=61&&h>=44&&h<=58||s>=4&&s<=29&&h>=25&&h<=39||s>=36&&s<=61&&h>=25&&h<=39||s>=4&&s<=29&&h>=6&&h<=20||s>=36&&s<=61&&h>=6&&h<=20)&&(this.Ur=1)}0===this.Ur&&t>=3328&&t<=3393&&i>=3203&&i<=3325&&(this.Ur=2),this.Js=0,(t>=3053&&t<=3156&&i>=3056&&i<=3136||t>=3072&&t<=3118&&i>=9492&&i<=9535)&&(this.Js=1),1===this.Js&&t>=3139&&t<=3199&&i>=3008&&i<=3062&&(this.Js=0)};Uf=()=>{this.Di?.bind(),this.Ji&&(d.A.mc=this.Ji),this.ns?.draw(0,0),-1!==this.oh?this.Ol(c.A.Do[this.oh],0,0,0):-1!==this.Mh[this.Sh]&&this.Ol(c.A.Do[this.Mh[this.Sh]],0,0,0),this.Qs&&1===this.th&&this.ad(),this.Di?.draw(562,231),this.Pi?.bind(),this.Qi&&(d.A.mc=this.Qi)};Gf=()=>{if(this.Fi?.bind(),this.$i&&(d.A.mc=this.$i),this.rs?.draw(0,0),this.Fh)this.yi?.vc(239,40,this.Uh,m.A.Zl),this.yi?.vc(239,60,this.Bh+'*',m.A.ud);else if(this.Wh)this.yi?.vc(239,40,'Enter amount:',m.A.Zl),this.yi?.vc(239,60,this.Hh+'*',m.A.ud);else if(this.Lh)this.yi?.vc(239,40,this.Lh,m.A.Zl),this.yi?.vc(239,60,'Click to continue',m.A.ud);else if(-1!==this.lh)this.Ol(c.A.Do[this.lh],0,0,0);else if(-1===this.Yh){let t=this.wi;0===$.K.rt&&(t=this.Ai);let i=0;u.A.vl(0,0,463,77);for(let s=0;s<100;s++){const h=this.Vh[s];if(!h)continue;const e=this.messageType[s],n=this.uh+70-14*i;0===e&&(n>0&&n<110&&t?.jl(4,n,h,m.A.Zl),i++),1===e&&(n>0&&n<110&&(t?.jl(4,n,this.Kh[s]+':',m.A.Sl),t?.jl(t.Iu(this.Kh[s])+12,n,h,m.A.BLUE)),i++),2===e&&(0===this.kh||1===this.kh&&this.mu(this.Kh[s]))&&(n>0&&n<110&&(t?.jl(4,n,this.Kh[s]+':',m.A.Zl),t?.jl(t.Iu(this.Kh[s])+12,n,h,m.A.BLUE)),i++),3!==e&&7!==e||0!==this.zh||!(7===e||0===this.xh||1===this.xh&&this.mu(this.Kh[s]))||(n>0&&n<110&&(t?.jl(4,n,'From '+this.Kh[s]+':',m.A.Zl),t?.jl(t.Iu('From '+this.Kh[s])+12,n,h,m.A.dd)),i++),4===e&&(0===this.Dh||1===this.Dh&&this.mu(this.Kh[s]))&&(n>0&&n<110&&t?.jl(4,n,this.Kh[s]+' '+this.Vh[s],m.A.wd),i++),5===e&&0===this.zh&&this.xh<2&&(n>0&&n<110&&t?.jl(4,n,h,m.A.dd),i++),6===e&&0===this.zh&&this.xh<2&&(n>0&&n<110&&(t?.jl(4,n,'To '+this.Kh[s]+':',m.A.Zl),t?.jl(t.Iu('To '+this.Kh[s])+12,n,h,m.A.dd)),i++),8===e&&(0===this.Dh||1===this.Dh&&this.mu(this.Kh[s]))&&(n>0&&n<110&&t?.jl(4,n,this.Kh[s]+' '+this.Vh[s],m.A.yd),i++)}u.A.qu(),this.fh=14*i+7,this.fh<78&&(this.fh=78),this.cl(463,0,this.fh-this.uh-77,this.fh,77),0==$.K.rt?t?.jl(3,90,this.qh+'*',m.A.Zl):1==$.K.rt?t?.jl(3,90,this.qh+'*',m.A.BLUE):(t?.jl(4,90,M.A.ka(this.username)+':',m.A.Zl),t?.jl(t.Iu(this.username+': ')+6,90,this.qh+'*',m.A.BLUE)),u.A.yl(0,77,m.A.Zl,479)}else this.Ol(c.A.Do[this.Yh],0,0,0);this.Qs&&2===this.th&&this.ad(),this.Fi?.draw(22,375),this.Pi?.bind(),this.Qi&&(d.A.mc=this.Qi)};Hf=()=>{if(this.Ni?.bind(),!this.Sr)return;const t=this.Fn+this.yn&2047;let i=48+(this.Sr.x/32|0),s=464-(this.Sr.z/32|0);this.ws?.Ad(21,9,146,151,this.hs,this.es,i,s,t,this.An+256),this.ys?.Ad(0,0,33,33,this.ts,this.ss,25,25,this.Fn,256);for(let t=0;t{if(!i)return;const h=this.Fn+this.yn&2047,e=s*s+t*t;if(e>6400)return;let n=d.A.sin[h],r=d.A.cos[h];n=256*n/(this.An+256)|0,r=256*r/(this.An+256)|0;const o=t*n+s*r>>16,l=t*r-s*n>>16;e>2500&&this.os?i.gd(o+94-(i.Xl/2|0),83-l-(i.Ed/2|0),this.os):i.draw(o+94-(i.Xl/2|0),83-l-(i.Ed/2|0))};_d=t=>{if(!this.ws)return;const i=this.ws.yc,s=i.length;for(let t=0;t>14&32767;const h=e.A.get(s).vd;if(h<0)continue;let n=t,r=i;if(22!==h&&29!==h&&34!==h&&36!==h&&46!==h&&47!==h&&48!==h){const s=G.A.Xn,h=G.A.Xn,e=this.kn[this.Dn];if(e){const o=e.flags;for(let e=0;e<10;e++){const e=4*Math.random()|0;0===e&&n>0&&n>t-3&&(o[G.A.index(n-1,r)]&H.A.bd)===H.A.OPEN&&n--,1===e&&n0&&r>i-3&&(o[G.A.index(n,r-1)]&H.A.Rd)===H.A.OPEN&&r--,3===e&&r{if(!this.He||!this.ws)return;let r=this.He.Md(s,t,i);if(0!==r){const o=this.He.kd(s,t,i,r),l=o>>6&3,a=31&o;let c=h;r>0&&(c=n);const f=this.ws.yc,u=4*t+512*(103-i)*4+24624,d=r>>14&32767,w=e.A.get(d);if(-1===w.xd)a!==P.A.Dd.id&&a!==P.A.Nd.id||(l===F.A.Pd?(f[u]=c,f[u+512]=c,f[u+1024]=c,f[u+1536]=c):l===F.A.Fd?(f[u]=c,f[u+1]=c,f[u+2]=c,f[u+3]=c):l===F.A.Ud?(f[u+3]=c,f[u+3+512]=c,f[u+3+1024]=c,f[u+3+1536]=c):l===F.A.Bd&&(f[u+1536]=c,f[u+1536+1]=c,f[u+1536+2]=c,f[u+1536+3]=c)),a===P.A.Gd.id&&(l===F.A.Pd?f[u]=c:l===F.A.Fd?f[u+3]=c:l===F.A.Ud?f[u+3+1536]=c:l===F.A.Bd&&(f[u+1536]=c)),a===P.A.Nd.id&&(l===F.A.Bd?(f[u]=c,f[u+512]=c,f[u+1024]=c,f[u+1536]=c):l===F.A.Pd?(f[u]=c,f[u+1]=c,f[u+2]=c,f[u+3]=c):l===F.A.Fd?(f[u+3]=c,f[u+3+512]=c,f[u+3+1024]=c,f[u+3+1536]=c):l===F.A.Ud&&(f[u+1536]=c,f[u+1536+1]=c,f[u+1536+2]=c,f[u+1536+3]=c));else{const s=this.As[w.xd];if(s){const h=(4*w.width-s.width)/2|0,e=(4*w.length-s.height)/2|0;s.draw(4*t+48+h,4*(G.A.Xn-i-w.length)+e+48)}}}if(r=this.He.Hd(s,t,i),0!==r){const h=this.He.kd(s,t,i,r),n=h>>6&3,o=31&h,l=r>>14&32767,a=e.A.get(l);if(-1!==a.xd){const s=this.As[a.xd];if(s){const h=(4*a.width-s.width)/2|0,e=(4*a.length-s.height)/2|0;s.draw(4*t+48+h,4*(G.A.Xn-i-a.length)+e+48)}}else if(o===P.A.Wd.id){let s=15658734;r>0&&(s=15597568);const h=this.ws.yc,e=4*t+512*(G.A.Xn-1-i)*4+24624;n===F.A.Pd||n===F.A.Ud?(h[e+1536]=s,h[e+1024+1]=s,h[e+512+2]=s,h[e+3]=s):(h[e]=s,h[e+512+1]=s,h[e+1024+2]=s,h[e+1536+3]=s)}}if(r=this.He.Od(s,t,i),0!==r){const s=e.A.get(r>>14&32767);if(-1!==s.xd){const h=this.As[s.xd];if(h){const e=(4*s.width-h.width)/2|0,n=(4*s.length-h.height)/2|0;h.draw(4*t+48+e,4*(G.A.Xn-i-s.length)+n+48)}}}};fd=()=>{if(this.nh<2&&0===this.oe&&0===this.Ie)return;let t;t=1===this.oe&&this.nh<2?'Use '+this.fe+' with...':1===this.Ie&&this.nh<2?this._e+'...':this.rh[this.nh-1],this.nh>2&&(t=t+'@whi@ / '+(this.nh-2)+' more options'),this.yi?.Yd(4,15,t,m.A.Sl,!0,this.Pt/1e3|0)};ad=()=>{const t=this.ih,i=this.sh,s=this.hh,h=this.eh,e=m.A.Vd;u.A.fillRect(t,i,s,h,e),u.A.fillRect(t+1,i+1,s-2,16,m.A.Zl),u.A.Rl(t+1,i+18,s-2,h-19,m.A.Zl),this.yi?.jl(t+3,i+14,'Choose Option',e);let n=this.Yl,r=this.Vl;0===this.th&&(n-=8,r-=11),1===this.th&&(n-=562,r-=231),2===this.th&&(n-=22,r-=375);for(let h=0;ht&&ne-13&&r{if(0!==this.se)return;let t=this.Uc;if(1===this.Ie&&this.Bc>=520&&this.Gc>=165&&this.Bc<=788&&this.Gc<=230&&(t=0),this.Qs){if(1!==t){let t=this.Yl,i=this.Vl;0===this.th?(t-=8,i-=11):1===this.th?(t-=562,i-=231):2===this.th&&(t-=22,i-=375),(tthis.ih+this.hh+10||ithis.sh+this.eh+10)&&(this.Qs=!1,1===this.th&&(this.Ws=!0),2===this.th&&(this.Ys=!0))}if(1===t){const t=this.ih,i=this.sh,s=this.hh;let h=this.Bc,e=this.Gc;0===this.th?(h-=8,e-=11):1===this.th?(h-=562,e-=231):2===this.th&&(h-=22,e-=375);let n=-1;for(let r=0;rt&&ho-13&&e0){const t=this.Te[this.nh-1];if(602===t||596===t||22===t||892===t||415===t||405===t||38===t||422===t||478===t||347===t||188===t){const t=this.ve[this.nh-1],i=this.be[this.nh-1];if(c.A.Do[i].draggable)return this.re=!1,this.ne=0,this.te=i,this.ie=t,this.se=2,this.he=this.Bc,this.ee=this.Gc,c.A.Do[i].Kd===this.Xs&&(this.se=1),void(c.A.Do[i].Kd===this.lh&&(this.se=3))}}if(1===t&&(1===this.Ce||this.pf(this.nh-1))&&this.nh>2&&(t=2),1===t&&this.nh>0&&await this.If(this.nh-1),2!==t||this.nh<=0)return;this.mf()}};bf=()=>{if(1===this.Uc&&this.Sr){let t=this.Bc-21-561,i=this.Gc-9-5;if(t>=0&&i>=0&&t<146&&i<151){t-=73,i-=75;const s=this.Fn+this.yn&2047;let h=d.A.sin[s],e=d.A.cos[s];h=h*(this.An+256)>>8,e=e*(this.An+256)>>8;const n=i*h+t*e>>11,r=i*e-t*h>>11,o=this.Sr.x+n>>7,l=this.Sr.z-r>>7;this.Cf(this.Sr.Tf[0],this.Sr.Of[0],o,l,1,0,0,0,0,0,!0)&&(this.Bt.p1(t),this.Bt.p1(i),this.Bt.p2(this.Fn),this.Bt.p1(57),this.Bt.p1(this.yn),this.Bt.p1(this.An),this.Bt.p1(89),this.Bt.p2(this.Sr.x),this.Bt.p2(this.Sr.z),this.Bt.p1(this.Rr),this.Bt.p1(63))}}};pf=t=>{if(t<0)return!1;let i=this.Te[t];return i>=2e3&&(i-=2e3),406===i};If=async t=>{if(t<0)return;this.Wh&&(this.Wh=!1,this.Ys=!0);let i=this.Te[t];const s=this.Oe[t],h=this.ve[t],r=this.be[t];if(i>=2e3&&(i-=2e3),903===i||363===i){let s=this.rh[t];const h=s.indexOf('@whi@');if(-1!==h){s=s.substring(h+5).trim();const t=M.A.ka(M.A.xa(M.A.Id(s)));let e=!1;for(let s=0;s=90&&this.Bt.ef(O.A.$d),this.Bt.ef(O.A.Jd)):347===i?this.Bt.ef(O.A.Qd):422===i?this.Bt.ef(O.A.tw):405===i?($.K.Et+=s,$.K.Et>=97&&(this.Bt.ef(O.A.iw),this.Bt.p3(14953816)),this.Bt.ef(O.A.sw)):38===i&&this.Bt.ef(O.A.hw),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.ye=0,this.we=r,this.de=h,this.ue=2,c.A.Do[r].Kd===this.Xs&&(this.ue=1),c.A.Do[r].Kd===this.lh&&(this.ue=3);else if(728===i||542===i||6===i||963===i||245===i){const t=this.yr[s];t&&this.Sr&&(this.Cf(this.Sr.Tf[0],this.Sr.Of[0],t.Tf[0],t.Of[0],2,1,1,0,0,0,!1),this.qs=this.Bc,this.$s=this.Gc,this.zs=2,this.Zs=0,542===i?this.Bt.ef(O.A.ew):6===i?(3&s||$.K.gt++,$.K.gt>=124&&(this.Bt.ef(O.A.nw),this.Bt.p4(0)),this.Bt.ef(O.A.rw)):963===i?this.Bt.ef(O.A.ow):728===i?this.Bt.ef(O.A.lw):245===i&&(3&s||$.K._t++,$.K._t>=85&&(this.Bt.ef(O.A.aw),this.Bt.p2(39596)),this.Bt.ef(O.A.cw)),this.Bt.p2(s))}else if(217===i){if(this.Sr){this.Cf(this.Sr.Tf[0],this.Sr.Of[0],h,r,2,0,0,0,0,0,!1)||this.Cf(this.Sr.Tf[0],this.Sr.Of[0],h,r,2,1,1,0,0,0,!1),this.qs=this.Bc,this.$s=this.Gc,this.zs=2,this.Zs=0,this.Bt.ef(O.A.fw),this.Bt.p2(h+this.Tn),this.Bt.p2(r+this.On),this.Bt.p2(s),this.Bt.p2(this.ce),this.Bt.p2(this.le),this.Bt.p2(this.ae)}}else if(1175===i){const t=s>>14&32767,i=e.A.get(t);let h;h=i.uw?i.uw:"It's a "+i.name+'.',this.zd(0,h,'')}else if(285===i)this.Zd(O.A.dw,h,r,s);else if(881===i)this.Bt.ef(O.A.ww),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.Bt.p2(this.ce),this.Bt.p2(this.le),this.Bt.p2(this.ae),this.ye=0,this.we=r,this.de=h,this.ue=2,c.A.Do[r].Kd===this.Xs&&(this.ue=1),c.A.Do[r].Kd===this.lh&&(this.ue=3);else if(391===i)this.Bt.ef(O.A.yw),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.Bt.p2(this.ge),this.ye=0,this.we=r,this.de=h,this.ue=2,c.A.Do[r].Kd===this.Xs&&(this.ue=1),c.A.Do[r].Kd===this.lh&&(this.ue=3);else if(660===i)this.Qs?this.He?.click(h-8,r-11):this.He?.click(this.Bc-8,this.Gc-11);else{if(188===i)return this.oe=1,this.le=h,this.ae=r,this.ce=s,this.fe=n.A.get(s).name,void(this.Ie=0);if(44===i)this.Ae||(this.Bt.ef(O.A.Aw),this.Bt.p2(r),this.Ae=!0);else if(1773===i){const t=n.A.get(s);let i;i=r>=1e5?r+' x '+t.name:t.uw?t.uw:"It's a "+t.name+'.',this.zd(0,i,'')}else if(900===i){const t=this.yr[s];t&&this.Sr&&(this.Cf(this.Sr.Tf[0],this.Sr.Of[0],t.Tf[0],t.Of[0],2,1,1,0,0,0,!1),this.qs=this.Bc,this.$s=this.Gc,this.zs=2,this.Zs=0,this.Bt.ef(O.A.pw),this.Bt.p2(s),this.Bt.p2(this.ce),this.Bt.p2(this.le),this.Bt.p2(this.ae))}else if(1373===i||1544===i||151===i||1101===i){const t=this.nr[s];t&&this.Sr&&(this.Cf(this.Sr.Tf[0],this.Sr.Of[0],t.Tf[0],t.Of[0],2,1,1,0,0,0,!1),this.qs=this.Bc,this.$s=this.Gc,this.zs=2,this.Zs=0,1101===i?this.Bt.ef(O.A.jd):151===i?($.K.vt++,$.K.vt>=90&&(this.Bt.ef(O.A.mw),this.Bt.p2(31114)),this.Bt.ef(O.A.Iw)):1373===i?this.Bt.ef(O.A.Xd):1544===i&&this.Bt.ef(O.A.gw),this.Bt.p2(s))}else if(265===i){const t=this.yr[s];t&&this.Sr&&(this.Cf(this.Sr.Tf[0],this.Sr.Of[0],t.Tf[0],t.Of[0],2,1,1,0,0,0,!1),this.qs=this.Bc,this.$s=this.Gc,this.zs=2,this.Zs=0,this.Bt.ef(O.A.Ew),this.Bt.p2(s),this.Bt.p2(this.ge))}else if(679===i){const i=this.rh[t],s=i.indexOf('@whi@');if(-1!==s){const t=M.A.Id(i.substring(s+5).trim());let h=-1;for(let i=0;i0&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=3,this.no=this.ho[h],this.Uh='Enter message to send to '+this.so[h])}}else if(55===i)this.Zd(O.A._w,h,r,s)&&this.Bt.p2(this.ge);else if(224===i||993===i||99===i||746===i||877===i){if(this.Sr){this.Cf(this.Sr.Tf[0],this.Sr.Of[0],h,r,2,0,0,0,0,0,!1)||this.Cf(this.Sr.Tf[0],this.Sr.Of[0],h,r,2,1,1,0,0,0,!1),this.qs=this.Bc,this.$s=this.Gc,this.zs=2,this.Zs=0,224===i?this.Bt.ef(O.A.Cw):746===i?this.Bt.ef(O.A.Tw):877===i?this.Bt.ef(O.A.Ow):99===i?this.Bt.ef(O.A.bw):993===i&&this.Bt.ef(O.A.Lw),this.Bt.p2(h+this.Tn),this.Bt.p2(r+this.On),this.Bt.p2(s)}}else if(1607===i){const t=this.yr[s];if(t&&t.type){let i;i=t.type.uw?t.type.uw:"It's a "+t.type.name+'.',this.zd(0,i,'')}}else if(504===i)this.Zd(O.A.Rw,h,r,s);else{if(930===i){const t=c.A.Do[r];this.Ie=1,this.ge=r,this.Ee=t.Sw,this.oe=0;let i=t.Mw;i&&-1!==i.indexOf(' ')&&(i=i.substring(0,i.indexOf(' ')));let s=t.Mw;return s&&-1!==s.indexOf(' ')&&(s=s.substring(s.indexOf(' ')+1)),this._e=i+' '+t.action+' '+s,void(16===this.Ee&&(this.Ws=!0,this.Sh=3,this.Vs=!0))}if(951===i){const t=c.A.Do[r];let i=!0;t.Ml>0&&(i=this.kw(t)),i&&(this.Bt.ef(O.A.xw),this.Bt.p2(r))}else if(602===i||596===i||22===i||892===i||415===i)22===i?this.Bt.ef(O.A.Dw):415===i?(3&r||$.K.Ot++,$.K.Ot>=55&&(this.Bt.ef(O.A.Nw),this.Bt.p4(0)),this.Bt.ef(O.A.Pw)):602===i?this.Bt.ef(O.A.Fw):892===i?(3&h||$.K.bt++,$.K.bt>=130&&(this.Bt.ef(O.A.Uw),this.Bt.p1(177)),this.Bt.ef(O.A.Bw)):596===i&&this.Bt.ef(O.A.Gw),this.Bt.p2(s),this.Bt.p2(h),this.Bt.p2(r),this.ye=0,this.we=r,this.de=h,this.ue=2,c.A.Do[r].Kd===this.Xs&&(this.ue=1),c.A.Do[r].Kd===this.lh&&(this.ue=3);else if(581===i)3&s||$.K.It++,$.K.It>=99&&(this.Bt.ef(O.A.Hw),this.Bt.p4(0)),this.Zd(O.A.Ww,h,r,s);else if(965===i){if(this.Sr){this.Cf(this.Sr.Tf[0],this.Sr.Of[0],h,r,2,0,0,0,0,0,!1)||this.Cf(this.Sr.Tf[0],this.Sr.Of[0],h,r,2,1,1,0,0,0,!1),this.qs=this.Bc,this.$s=this.Gc,this.zs=2,this.Zs=0,this.Bt.ef(O.A.Yw),this.Bt.p2(h+this.Tn),this.Bt.p2(r+this.On),this.Bt.p2(s),this.Bt.p2(this.ge)}}else if(1501===i)$.K.Tt+=this.On,$.K.Tt>=92&&(this.Bt.ef(O.A.Vw),this.Bt.p4(0)),this.Zd(O.A.Kw,h,r,s);else if(364===i)this.Zd(O.A.Xw,h,r,s);else if(1102===i){const t=n.A.get(s);let i;i=t.uw?t.uw:"It's a "+t.name+'.',this.zd(0,i,'')}else if(960===i){this.Bt.ef(O.A.xw),this.Bt.p2(r);const t=c.A.Do[r];if(t.scripts&&t.scripts[0]&&5===t.scripts[0][0]){const i=t.scripts[0][1];t.al&&this.pe[i]!==t.al[0]&&(this.pe[i]=t.al[0],await this.jw(i),this.Ws=!0)}}else if(34===i){const i=this.rh[t],s=i.indexOf('@whi@');if(-1!==s){this.zw(),this.Me=i.substring(s+5).trim(),this.ke=!1;for(let t=0;t{const i=t.Ml;if(i===c.A.iy&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=1,this.Uh='Enter name of friend to add to list'),i===c.A.sy&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=2,this.Uh='Enter name of friend to delete from list'),i===c.A.hy)return this.Yt=250,!0;if(i===c.A.ey&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=4,this.Uh='Enter name of player to add to list'),i===c.A.ny&&(this.Ys=!0,this.Wh=!1,this.Fh=!0,this.Bh='',this.Gh=5,this.Uh='Enter name of player to delete from list'),i>=c.A.oy&&i<=c.A.ly){const t=(i-300)/2|0,s=1&i;let h=this.Wr[t];if(-1!==h)for(;;)if(0===s&&(h--,h<0&&(h=o.A.count-1)),1===s&&(h++,h>=o.A.count&&(h=0)),!o.A.Do[h].disable&&o.A.Do[h].type===t+(this.Gr?0:7)){this.Wr[t]=h,this.Hr=!0;break}}if(i>=c.A.uy&&i<=c.A.wy){const t=(i-314)/2|0,s=1&i;let h=this.Yr[t];0===s&&(h--,h<0&&(h=W.A.Ua[t].length-1)),1===s&&(h++,h>=W.A.Ua[t].length&&(h=0)),this.Yr[t]=h,this.Hr=!0}if(i!==c.A.Va||this.Gr||(this.Gr=!0,this.tf()),i===c.A.Ka&&this.Gr&&(this.Gr=!1,this.tf()),i===c.A.yy){this.Bt.ef(O.A.Ay),this.Bt.p1(this.Gr?0:1);for(let t=0;t<7;t++)this.Bt.p1(this.Wr[t]);for(let t=0;t<5;t++)this.Bt.p1(this.Yr[t]);return!0}return i===c.A.ja&&(this.ke=!this.ke),i>=c.A.py&&i<=c.A.my&&(this.zw(),this.Me.length>0&&(this.Bt.ef(O.A.Iy),this.Bt.gy(M.A.Id(this.Me)),this.Bt.p1(i-601),this.Bt.p1(this.ke?1:0))),!1};tf=()=>{this.Hr=!0;for(let t=0;t<7;t++){this.Wr[t]=-1;for(let i=0;i{if(!this.Sr||!this.He)return!1;const n=h>>14&32767,r=this.He.kd(this.Dn,i,s,h);if(-1===r)return!1;const o=31&r,l=r>>6&3;if(o===P.A.Ey.id||o===P.A._y.id||o===P.A.Cy.id){const t=e.A.get(n);let h,r;l===F.A.Pd||l===F.A.Ud?(h=t.width,r=t.length):(h=t.length,r=t.width);let o=t.Ty;0!==l&&(o=(o<>4-l)),this.Cf(this.Sr.Tf[0],this.Sr.Of[0],i,s,2,h,r,0,0,o,!1)}else this.Cf(this.Sr.Tf[0],this.Sr.Of[0],i,s,2,0,0,l,o+1,0,!1);return this.qs=this.Bc,this.$s=this.Gc,this.zs=2,this.Zs=0,this.Bt.ef(t),this.Bt.p2(i+this.Tn),this.Bt.p2(s+this.On),this.Bt.p2(n),!0};Lf=()=>{1===this.Uc&&(this.Bc>=549&&this.Bc<=583&&this.Gc>=195&&this.Gc<231&&-1!==this.Mh[0]?(this.Ws=!0,this.Sh=0,this.Vs=!0):this.Bc>=579&&this.Bc<=609&&this.Gc>=194&&this.Gc<231&&-1!==this.Mh[1]?(this.Ws=!0,this.Sh=1,this.Vs=!0):this.Bc>=607&&this.Bc<=637&&this.Gc>=194&&this.Gc<231&&-1!==this.Mh[2]?(this.Ws=!0,this.Sh=2,this.Vs=!0):this.Bc>=635&&this.Bc<=679&&this.Gc>=194&&this.Gc<229&&-1!==this.Mh[3]?(this.Ws=!0,this.Sh=3,this.Vs=!0):this.Bc>=676&&this.Bc<=706&&this.Gc>=194&&this.Gc<231&&-1!==this.Mh[4]?(this.Ws=!0,this.Sh=4,this.Vs=!0):this.Bc>=704&&this.Bc<=734&&this.Gc>=194&&this.Gc<231&&-1!==this.Mh[5]?(this.Ws=!0,this.Sh=5,this.Vs=!0):this.Bc>=732&&this.Bc<=766&&this.Gc>=195&&this.Gc<231&&-1!==this.Mh[6]?(this.Ws=!0,this.Sh=6,this.Vs=!0):this.Bc>=550&&this.Bc<=584&&this.Gc>=492&&this.Gc<528&&-1!==this.Mh[7]?(this.Ws=!0,this.Sh=7,this.Vs=!0):this.Bc>=582&&this.Bc<=612&&this.Gc>=492&&this.Gc<529&&-1!==this.Mh[8]?(this.Ws=!0,this.Sh=8,this.Vs=!0):this.Bc>=609&&this.Bc<=639&&this.Gc>=492&&this.Gc<529&&-1!==this.Mh[9]?(this.Ws=!0,this.Sh=9,this.Vs=!0):this.Bc>=637&&this.Bc<=681&&this.Gc>=493&&this.Gc<528&&-1!==this.Mh[10]?(this.Ws=!0,this.Sh=10,this.Vs=!0):this.Bc>=679&&this.Bc<=709&&this.Gc>=492&&this.Gc<529&&-1!==this.Mh[11]?(this.Ws=!0,this.Sh=11,this.Vs=!0):this.Bc>=706&&this.Bc<=736&&this.Gc>=492&&this.Gc<529&&-1!==this.Mh[12]?(this.Ws=!0,this.Sh=12,this.Vs=!0):this.Bc>=734&&this.Bc<=768&&this.Gc>=492&&this.Gc<528&&-1!==this.Mh[13]&&(this.Ws=!0,this.Sh=13,this.Vs=!0),$.K.ft++,$.K.ft>150&&($.K.ft=0,this.Bt.ef(O.A.Oy),this.Bt.p1(43)))};xf=async()=>{for(;;){let t;do{for(;;){if(t=this.Wc(),-1===t)return;if(-1!==this.Xs&&this.Xs===this.xe){8===t&&this.Me.length>0&&(this.Me=this.Me.substring(0,this.Me.length-1));break}if(this.Fh){if(t>=32&&t<=122&&this.Bh.length<80&&(this.Bh=this.Bh+String.fromCharCode(t),this.Ys=!0),8===t&&this.Bh.length>0&&(this.Bh=this.Bh.substring(0,this.Bh.length-1),this.Ys=!0),13===t||10===t){let t;if(this.Fh=!1,this.Ys=!0,1===this.Gh&&(t=M.A.Id(this.Bh),this.qw(t)),2===this.Gh&&this.Vr>0&&(t=M.A.Id(this.Bh),this.Jw(t)),3===this.Gh&&this.Bh.length>0&&this.no){this.Bt.ef(O.A.vy),this.Bt.p1(0);const t=this.Bt.jc;this.Bt.gy(this.no),b.A.by(this.Bt,this.Bh),this.Bt.$f(this.Bt.jc-t),this.Bh=M.A.Ly(this.Bh),this.Bh=v.A.filter(this.Bh),this.zd(6,this.Bh,M.A.ka(M.A.xa(this.no))),2===this.xh&&(this.xh=1,this.Ks=!0,this.Bt.ef(O.A.Ry),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh))}4===this.Gh&&this.dh<100&&(t=M.A.Id(this.Bh),this.$w(t)),5===this.Gh&&this.dh>0&&(t=M.A.Id(this.Bh),this.Qw(t))}}else if(this.Wh){if(t>=48&&t<=57&&this.Hh.length<10&&(this.Hh=this.Hh+String.fromCharCode(t),this.Ys=!0),8===t&&this.Hh.length>0&&(this.Hh=this.Hh.substring(0,this.Hh.length-1),this.Ys=!0),13===t||10===t){if(this.Hh.length>0){let t=0;try{t=parseInt(this.Hh,10)}catch(t){}this.Bt.ef(O.A.Sy),this.Bt.p4(t)}this.Wh=!1,this.Ys=!0}}else if(-1===this.lh&&(t>=32&&t<=122&&this.qh.length<80&&(this.qh=this.qh+String.fromCharCode(t),this.Ys=!0),8===t&&this.qh.length>0&&(this.qh=this.qh.substring(0,this.qh.length-1),this.Ys=!0),(13===t||10===t)&&this.qh.length>0)){if('::clientdrop'===this.qh)await this.rf();else if(this.Br&&'::noclip'===this.qh)for(let t=0;t122)&&(t<65||t>90)&&(t<48||t>57)&&32!==t);this.Me.length<12&&(this.Me=this.Me+String.fromCharCode(t))}};Rf=()=>{if(1===this.Uc)if(this.Bc>=8&&this.Bc<=108&&this.Gc>=490&&this.Gc<=522)this.kh=(this.kh+1)%4,this.Ks=!0,this.Ys=!0,this.Bt.ef(O.A.Ry),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh);else if(this.Bc>=137&&this.Bc<=237&&this.Gc>=490&&this.Gc<=522)this.xh=(this.xh+1)%3,this.Ks=!0,this.Ys=!0,this.Bt.ef(O.A.Ry),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh);else if(this.Bc>=275&&this.Bc<=375&&this.Gc>=490&&this.Gc<=522)this.Dh=(this.Dh+1)%3,this.Ks=!0,this.Ys=!0,this.Bt.ef(O.A.Ry),this.Bt.p1(this.kh),this.Bt.p1(this.xh),this.Bt.p1(this.Dh);else if(this.Bc>=416&&this.Bc<=516&&this.Gc>=490&&this.Gc<=522){this.zw(),this.Me='',this.ke=!1;for(let t=0;t{if(this.Nh?this.Ph=32:this.Ph=0,this.Nh=!1,t>=n&&t=r&&i=n&&t=r+h-16&&i=n-this.Ph&&t=r+16&&i0){let t=(h-32)*h/s|0;t<8&&(t=8);const n=i-r-(t/2|0)-16,l=h-t-32;o.Dl=(s-h)*n/l|0,e&&(this.Ws=!0),this.Nh=!0}};if=()=>{this.Fi||(this.xo(),this.Po=null,this.ti=null,this.ii=null,this.si=null,this.hi=null,this.ei=null,this.ni=null,this.ri=null,this.oi=null,this.li=null,this.Fi=new f.A(479,96),this.Ni=new f.A(168,160),u.A.clear(),this.os?.draw(0,0),this.Di=new f.A(190,261),this.Pi=new f.A(512,334),u.A.clear(),this.Ui=new f.A(501,61),this.Bi=new f.A(288,40),this.Gi=new f.A(269,66),this.$t=!0)};mu=t=>{if(!t)return!1;for(let i=0;i{if(0n===t)return;if(this.Vr>=100)return void this.zd(0,'Your friends list is full. Max of 100 hit','');const i=M.A.ka(M.A.xa(t));for(let s=0;s{if(0n!==t)for(let i=0;i{if(0n===t)return;if(this.dh>=100)return void this.zd(0,'Your ignore list is full. Max of 100 hit','');const i=M.A.ka(M.A.xa(t));for(let s=0;s{if(0n!==t)for(let i=0;i{const s=this._r[this.Dn][t][i];if(!s)return void this.He?.By(this.Dn,t,i);let h=-99999999,e=null;for(let t=s.head();t;t=s.next()){const i=n.A.get(t.index);let s=i.Gy;i.Ca&&(s*=t.count+1),s>h&&(h=s,e=t)}if(!e)return;s.Hy(e);let r=-1,o=-1,l=0,a=0;for(let t=s.head();t;t=s.next())t.index!==e.index&&-1===r&&(r=t.index,l=t.count),t.index!==e.index&&t.index!==r&&-1===o&&(o=t.index,a=t.count);let c=null;-1!==r&&(c=n.A.get(r).Wy(l));let f=null;-1!==o&&(f=n.A.get(o).Wy(a));const u=t+(i<<7)+1610612736|0,d=n.A.get(e.index);this.He?.Yy(t,i,this.Zf(this.Dn,128*t+64,128*i+64),this.Dn,u,d.Wy(e.count),f,c)};Vy=(t,i,s,h,n,r,o)=>{if(i<1||s<1||i>102||s>102)return;if($.K.st&&t!==this.Dn)return;if(!this.He)return;let l=0;if(o===N.A.Ky&&(l=this.He.Md(t,i,s)),o===N.A.Xy&&(l=this.He.jy(t,s,i)),o===N.A.zy&&(l=this.He.Hd(t,i,s)),o===N.A.Cy&&(l=this.He.Od(t,i,s)),0!==l){const h=this.He.kd(t,i,s,l),n=l>>14&32767,r=31&h,a=h>>6;if(o===N.A.Ky){this.He?.Zy(t,i,s,1);const h=e.A.get(n);h.qy&&this.kn[t]?.Zy(i,s,r,a,h.$y)}if(o===N.A.Xy&&this.He?.Jy(t,i,s),o===N.A.zy){this.He.Qy(t,i,s);const h=e.A.get(n);if(i+h.width>G.A.Xn-1||s+h.width>G.A.Xn-1||i+h.length>G.A.Xn-1||s+h.length>G.A.Xn-1)return;h.qy&&this.kn[t]?.Qy(i,s,h.width,h.length,a,h.$y)}if(o===N.A.Cy){this.He?.tA(t,i,s);const h=e.A.get(n);h.qy&&h.active&&this.kn[t]?.iA(i,s)}}if(h>=0){let e=t;this.Yn&&t<3&&!(2&~this.Yn[1][i][s])&&(e=t+1),this.Wn&&D.A.Vy(t,i,s,this.He,this.Wn,this.gr,this.kn[t],h,r,n,e)}};zw=()=>{this.Bt.ef(O.A.sA),-1!==this.oh&&(this.oh=-1,this.Ws=!0,this.Ae=!1,this.Vs=!0),-1!==this.lh&&(this.lh=-1,this.Ys=!0,this.Ae=!1),this.Xs=-1};rf=async()=>{this.Yt>0?await this.hA():(this.Pi?.bind(),this.wi?.vc(257,144,'Connection lost',m.A.Zl),this.wi?.vc(256,143,'Connection lost',m.A.Sl),this.wi?.vc(257,159,'Please wait - attempting to reestablish',m.A.Zl),this.wi?.vc(256,158,'Please wait - attempting to reestablish',m.A.Sl),this.Pi?.draw(8,11),this.Ke=0,this.stream?.close(),this.gc=!1,await this.Hc(this.username,this.password,!0),this.gc||await this.hA())};hA=async()=>{this.stream&&this.stream.close(),this.stream=null,this.gc=!1,this.Jt=0,this.username='',this.password='',k.A.Jc(),this.au(),this.He?.reset();for(let t=0;t{if(!this.stream)return!1;try{let t=this.stream.available;if(0===t)return!1;if(-1===this.Xt&&(await this.stream.Xc(this.in.data,0,1),this.Xt=255&this.in.data[0],this.Kt&&(this.Xt=this.Xt-this.Kt.eA&255),this.packetSize=E.A.nA[this.Xt],t--),-1===this.packetSize){if(t<=0)return!1;await this.stream.Xc(this.in.data,0,1),this.packetSize=255&this.in.data[0],t--}if(-2===this.packetSize){if(t<=1)return!1;await this.stream.Xc(this.in.data,0,2),this.in.jc=0,this.packetSize=this.in.rA,t-=2}if(t0&&this.zd(5,s+' has logged in.',''),0===i&&this.zd(5,s+' has logged out.','')),s=null;break}s&&this.Vr<100&&(this.ho[this.Vr]=t,this.so[this.Vr]=s,this.eo[this.Vr]=i,this.Vr++,this.Ws=!0);let h=!1;for(;!h;){h=!0;for(let t=0;t=0&&h>=0&&s=G.A.Xn||t.z>=G.A.Xn)&&t.pA();return 0!==this.Ke&&(this.Ke-=e,this.Xe-=n),this.je=!1,this.Xt=-1,!0}if(this.Xt===T.A.mA)return c.A.Do[this.in.rA].model=this.Sr?.IA()||null,this.Xt=-1,!0;if(this.Xt===T.A.gA)return this.yh=this.in.cA,1===this.yh&&(this.Ah=this.in.rA),this.yh>=2&&this.yh<=6&&(2===this.yh&&(this.ph=64,this.mh=64),3===this.yh&&(this.ph=0,this.mh=64),4===this.yh&&(this.ph=128,this.mh=64),5===this.yh&&(this.ph=64,this.mh=0),6===this.yh&&(this.ph=64,this.mh=128),this.yh=2,this.gh=this.in.rA,this.Eh=this.in.rA,this._h=this.in.cA),10===this.yh&&(this.Ih=this.in.rA),this.Xt=-1,!0;if(this.Xt===T.A.EA){const t=this.in._A,i=this.in.il,s=this.in.il;return t!==this.mo&&this.po&&!$.K.st&&await this.tl(t,i,s,!0),this.mo=t,this.Io=i,this.Eo=s,this.Ao=0,this.Xt=-1,!0}if(this.Xt===T.A.CA)return await this.hA(),this.Xt=-1,!1;if(this.Xt===T.A.TA){const t=this.in.cA,i=this.in.cA;let s=-1;if(this.Ln)for(let h=0;h=100&&(this.ln=128*this.tr+64,this.cn=128*this.ir+64,this.an=this.Zf(this.Dn,this.tr,this.ir)-this.sr),this.Xt=-1,!0;if(this.Xt===T.A.up){this.gn=this.in.cA,this.En=this.in.cA;for(let t=this.gn;t=this.gn&&t.x=this.En&&t.z1?this.zd(7,e,M.A.ka(M.A.xa(t))):this.zd(3,e,M.A.ka(M.A.xa(t)))}catch(t){}return this.Xt=-1,!0}if(this.Xt===T.A.mp){for(let t=0;t=100){const t=128*this.Zn+64,i=128*this.qn+64,s=this.Zf(this.Dn,this.Zn,this.qn)-this.$n,h=t-this.ln,e=s-this.an,n=i-this.cn,r=0|Math.sqrt(h*h+n*n);this.fn=325.949*Math.atan2(e,r)&2047,this.un=-325.949*Math.atan2(h,n)&2047,this.fn<128&&(this.fn=128),this.fn>383&&(this.fn=383)}return this.Xt=-1,!0}if(this.Xt===T.A.Cp)return this.Sh=this.in.cA,this.Ws=!0,this.Vs=!0,this.Xt=-1,!0;if(this.Xt===T.A.Tp){const t=this.in._A;let i;if(t.endsWith(':tradereq:')){const s=t.substring(0,t.indexOf(':'));i=M.A.Id(s);let h=!1;for(let t=0;t>10&31,h=i>>5&31,e=31&i;return c.A.Do[t].Ql=(s<<19)+(h<<11)+(e<<3),this.Xt=-1,!0}if(this.Xt===T.A.Mp){for(let t=0;t=this.bh[s]&&(this.Oh[t]=s+2);return this.Xt=-1,!0}if(this.Xt===T.A.Up){for(this.gn=this.in.cA,this.En=this.in.cA;this.in.jc=0&&t{try{this.In=-1,this.Er.clear(),this.gr.clear(),this.Ir.clear(),this.mr.clear(),d.A.Xp(),this.au(),this.He?.reset();for(let t=0;t>8,s=255&this.Ln[t];if(33===i&&s>=71&&s<=73){D.A.st=!1;break}}if($.K.st?this.He?.jp(this.Dn):this.He?.jp(0),this.Ln&&this.vn){this.Bt.ef(O.A.Pf);for(let s=0;s>8)-this.Tn,h=64*(255&this.Ln[s])-this.On,e=this.vn[s];if(e){const s=new I.A(new Uint8Array(e)).il,n=R.A.read(s,e,e.length-4,4);t.zp(8*(this._n-6),8*(this.Cn-6),i,h,n)}else this.Cn<800&&t.Zp(h,i,64,64)}}if(this.Ln&&this.bn){this.Bt.ef(O.A.Pf);for(let s=0;s>8)-this.Tn,r=64*(255&this.Ln[s])-this.On;t.qp(this.He,this.gr,this.kn,e,n,r)}}}this.Bt.ef(O.A.Pf),t.$p(this.He,this.kn),this.Pi?.bind(),this.Bt.ef(O.A.Pf);for(let t=this.gr.head();t;t=this.gr.next())2===(this.Yn&&2&this.Yn[1][t.Jp][t.Qp])&&(t.tm--,t.tm<0&&t.pA());for(let t=0;t{const i=c.A.Do[t];if(i.ml)for(let t=0;t{let t=0;for(let i=0;i<99;i++){const s=i+1;t+=s+300*Math.pow(2,s/7)|0,this.bh[i]=t/4|0}};zd=(t,i,s)=>{0===t&&-1!==this.Yh&&(this.Lh=i,this.Uc=0),-1===this.lh&&(this.Ys=!0);for(let t=99;t>0;t--)this.messageType[t]=this.messageType[t-1],this.Kh[t]=this.Kh[t-1],this.Vh[t]=this.Vh[t-1];$.K.nt&&0===t&&(i='['+(this.Pt/30|0)+']: '+i),this.messageType[0]=t,this.Kh[0]=s,this.Vh[0]=i};jw=async t=>{const i=a.A.Do[t].sm;if(0!==i){const s=this.pe[t];if(1===i&&(1===s&&d.A.uc(.9),2===s&&d.A.uc(.8),3===s&&d.A.uc(.7),4===s&&d.A.uc(.6),n.A.uu?.clear(),this.$t=!0),3===i){const t=this.po;0===s&&(this._o=256,(0,z.hm)(256),this.po=!0),1===s&&(this._o=192,(0,z.hm)(192),this.po=!0),2===s&&(this._o=128,(0,z.hm)(128),this.po=!0),3===s&&(this._o=64,(0,z.hm)(64),this.po=!0),4===s&&(this.po=!1),this.po!==t&&(this.po&&this.mo?await this.tl(this.mo,this.Io,this.Eo,!1):(0,z.ko)(!1),this.Ao=0)}4===i&&(0===s&&(this.fo=256,(0,z.nm)(256),this.oo=!0),1===s&&(this.fo=192,(0,z.nm)(192),this.oo=!0),2===s&&(this.fo=128,(0,z.nm)(128),this.oo=!0),3===s&&(this.fo=64,(0,z.nm)(64),this.oo=!0),4===s&&(this.oo=!1)),5===i&&(this.Ce=s),6===i&&(this.Zh=s),8===i&&(this.zh=s,this.Ys=!0)}};rm=(t,i)=>{let s=0;for(let t=0;t<100;t++){if(!this.Vh[t])continue;const h=this.messageType[t],e=this.uh+70+4-14*s;if(e<-20)break;0===h&&s++,1!==h&&2!==h||!(1===h||0===this.kh||1===this.kh&&this.mu(this.Kh[t]))||(i>e-14&&i<=e&&this.Sr&&this.Kh[t]!==this.Sr.name&&(this.Br&&(this.rh[this.nh]='Report abuse @whi@'+this.Kh[t],this.Te[this.nh]=34,this.nh++),this.rh[this.nh]='Add ignore @whi@'+this.Kh[t],this.Te[this.nh]=436,this.nh++,this.rh[this.nh]='Add friend @whi@'+this.Kh[t],this.Te[this.nh]=406,this.nh++),s++),3!==h&&7!==h||0!==this.zh||!(7===h||0===this.xh||1===this.xh&&this.mu(this.Kh[t]))||(i>e-14&&i<=e&&(this.Br&&(this.rh[this.nh]='Report abuse @whi@'+this.Kh[t],this.Te[this.nh]=34,this.nh++),this.rh[this.nh]='Add ignore @whi@'+this.Kh[t],this.Te[this.nh]=436,this.nh++,this.rh[this.nh]='Add friend @whi@'+this.Kh[t],this.Te[this.nh]=406,this.nh++),s++),4===h&&(0===this.Dh||1===this.Dh&&this.mu(this.Kh[t]))&&(i>e-14&&i<=e&&(this.rh[this.nh]='Accept trade @whi@'+this.Kh[t],this.Te[this.nh]=903,this.nh++),s++),(5===h||6===h)&&0===this.zh&&this.xh<2&&s++,8===h&&(0===this.Dh||1===this.Dh&&this.mu(this.Kh[t]))&&(i>e-14&&i<=e&&(this.rh[this.nh]='Accept duel @whi@'+this.Kh[t],this.Te[this.nh]=363,this.nh++),s++)}};om=t=>{if(0===this.zh)return;let i=0;0!==this.Vt&&(i=1);for(let s=0;s<100;s++)if(null!==this.Vh[s]){const h=this.messageType[s];if((3===h||7===h)&&(7===h||0===this.xh||1===this.xh&&this.mu(this.Kh[s]))){const h=329-13*i;if(this.Yl>8&&this.Yl<520&&t-11>h-10&&t-11<=h+3&&(this.Br&&(this.rh[this.nh]='Report abuse @whi@'+this.Kh[s],this.Te[this.nh]=2034,this.nh++),this.rh[this.nh]='Add ignore @whi@'+this.Kh[s],this.Te[this.nh]=2436,this.nh++,this.rh[this.nh]='Add friend @whi@'+this.Kh[s],this.Te[this.nh]=2406,this.nh++),i++,i>=5)return}if((5===h||6===h)&&this.xh<2&&(i++,i>=5))return}};lm=(t,i,s,h,e,r)=>{if(0!==t.type||!t.ml||t.hide||ih+t.width||s>e+t.height||!t.bl||!t.Ll)return;const o=t.ml.length;for(let l=0;l=0||0!==f.ia)&&i>=o&&s>=a&&i=0?this.Se=f.am:this.Se=f.id),0===f.type)this.lm(f,i,s,o,a,f.Dl),f.scroll>f.height&&this.Bf(i,s,f.scroll,f.height,!0,o+f.width,a,f);else if(2===f.type){let t=0;for(let h=0;h=r+32||s>=l+32){t++;continue}if(this.Re=t,this.Le=f.id,!f.Ul||f.Ul[t]<=0){t++;continue}const c=n.A.get(f.Ul[t]-1);if(1===this.oe&&f.fm)f.id===this.ae&&t===this.le||(this.rh[this.nh]='Use '+this.fe+' with @lre@'+c.name,this.Te[this.nh]=881,this.Oe[this.nh]=c.id,this.ve[this.nh]=t,this.be[this.nh]=f.id,this.nh++);else if(1===this.Ie&&f.fm)16&~this.Ee||(this.rh[this.nh]=this._e+' @lre@'+c.name,this.Te[this.nh]=391,this.Oe[this.nh]=c.id,this.ve[this.nh]=t,this.be[this.nh]=f.id,this.nh++);else{if(f.fm)for(let i=4;i>=3;i--)c.um&&c.um[i]?(this.rh[this.nh]=c.um[i]+' @lre@'+c.name,3===i?this.Te[this.nh]=478:4===i&&(this.Te[this.nh]=347),this.Oe[this.nh]=c.id,this.ve[this.nh]=t,this.be[this.nh]=f.id,this.nh++):4===i&&(this.rh[this.nh]='Drop @lre@'+c.name,this.Te[this.nh]=347,this.Oe[this.nh]=c.id,this.ve[this.nh]=t,this.be[this.nh]=f.id,this.nh++);if(f.dm&&(this.rh[this.nh]='Use @lre@'+c.name,this.Te[this.nh]=188,this.Oe[this.nh]=c.id,this.ve[this.nh]=t,this.be[this.nh]=f.id,this.nh++),f.fm&&c.um)for(let i=2;i>=0;i--)c.um[i]&&(this.rh[this.nh]=c.um[i]+' @lre@'+c.name,0===i?this.Te[this.nh]=405:1===i?this.Te[this.nh]=38:2===i&&(this.Te[this.nh]=422),this.Oe[this.nh]=c.id,this.ve[this.nh]=t,this.be[this.nh]=f.id,this.nh++);if(f.wm)for(let i=4;i>=0;i--)f.wm[i]&&(this.rh[this.nh]=f.wm[i]+' @lre@'+c.name,0===i?this.Te[this.nh]=602:1===i?this.Te[this.nh]=596:2===i?this.Te[this.nh]=22:3===i?this.Te[this.nh]=892:4===i&&(this.Te[this.nh]=415),this.Oe[this.nh]=c.id,this.ve[this.nh]=t,this.be[this.nh]=f.id,this.nh++);this.rh[this.nh]='Examine @lre@'+c.name,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+c.id+')'),this.Te[this.nh]=1773,this.Oe[this.nh]=c.id,f.Bl&&(this.be[this.nh]=f.Bl[t]),this.nh++}t++}}else if(i>=o&&s>=a&&i{let i=t.Ml;return i>=c.A.Oa&&i<=c.A.La?(i>=c.A.ba?i-=c.A.ba:i--,this.rh[this.nh]='Remove @whi@'+this.so[i],this.Te[this.nh]=557,this.nh++,this.rh[this.nh]='Message @whi@'+this.so[i],this.Te[this.nh]=679,this.nh++,!0):i>=c.A.Sa&&i<=c.A.Ma&&(this.rh[this.nh]='Remove @whi@'+t.text,this.Te[this.nh]=556,this.nh++,!0)};Cm=()=>{0===this.oe&&0===this.Ie&&(this.rh[this.nh]='Walk here',this.Te[this.nh]=660,this.ve[this.nh]=this.Yl,this.be[this.nh]=this.Vl,this.nh++);let t=-1;for(let i=0;i>7&127,o=s>>29&3,l=s>>14&32767;if(s!==t){if(t=s,2===o&&this.He&&this.He.kd(this.Dn,h,r,s)>=0){const t=e.A.get(l);if(1===this.oe)this.rh[this.nh]='Use '+this.fe+' with @cya@'+t.name,this.Te[this.nh]=450,this.Oe[this.nh]=s,this.ve[this.nh]=h,this.be[this.nh]=r,this.nh++;else if(1!==this.Ie){if(t.Om)for(let i=4;i>=0;i--)t.Om[i]&&(this.rh[this.nh]=t.Om[i]+' @cya@'+t.name,0===i&&(this.Te[this.nh]=285),1===i&&(this.Te[this.nh]=504),2===i&&(this.Te[this.nh]=364),3===i&&(this.Te[this.nh]=581),4===i&&(this.Te[this.nh]=1501),this.Oe[this.nh]=s,this.ve[this.nh]=h,this.be[this.nh]=r,this.nh++);this.rh[this.nh]='Examine @cya@'+t.name,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+t.id+')'),this.Te[this.nh]=1175,this.Oe[this.nh]=s,this.ve[this.nh]=h,this.be[this.nh]=r,this.nh++}else 4&~this.Ee||(this.rh[this.nh]=this._e+' @cya@'+t.name,this.Te[this.nh]=55,this.Oe[this.nh]=s,this.ve[this.nh]=h,this.be[this.nh]=r,this.nh++)}if(1===o){const t=this.yr[l];if(t&&t.type&&1===t.type.size&&64==(127&t.x)&&64==(127&t.z))for(let i=0;i=0;s--)t.Om&&t.Om[s]?(this.rh[this.nh]=t.Om[s]+' @lre@'+t.name,0===s&&(this.Te[this.nh]=224),1===s&&(this.Te[this.nh]=993),2===s&&(this.Te[this.nh]=99),3===s&&(this.Te[this.nh]=746),4===s&&(this.Te[this.nh]=877),this.Oe[this.nh]=i.index,this.ve[this.nh]=h,this.be[this.nh]=r,this.nh++):2===s&&(this.rh[this.nh]='Take @lre@'+t.name,this.Te[this.nh]=99,this.Oe[this.nh]=i.index,this.ve[this.nh]=h,this.be[this.nh]=r,this.nh++);this.rh[this.nh]='Examine @lre@'+t.name,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+i.index+')'),this.Te[this.nh]=1102,this.Oe[this.nh]=i.index,this.ve[this.nh]=h,this.be[this.nh]=r,this.nh++}else 1&~this.Ee||(this.rh[this.nh]=this._e+' @lre@'+t.name,this.Te[this.nh]=965,this.Oe[this.nh]=i.index,this.ve[this.nh]=h,this.be[this.nh]=r,this.nh++)}}}}};vm=(t,i,s,h)=>{if(this.nh>=400)return;let e=t.name;if(0!==t.Sm&&this.Sr&&(e=e+this.Mm(this.Sr.ic,t.Sm)+' (level-'+t.Sm+')'),1===this.oe)this.rh[this.nh]='Use '+this.fe+' with @yel@'+e,this.Te[this.nh]=900,this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++;else if(1!==this.Ie){let n;if(t.Om)for(n=4;n>=0;n--)t.Om[n]&&'attack'!==t.Om[n]?.toLowerCase()&&(this.rh[this.nh]=t.Om[n]+' @yel@'+e,0===n?this.Te[this.nh]=728:1===n?this.Te[this.nh]=542:2===n?this.Te[this.nh]=6:3===n?this.Te[this.nh]=963:4===n&&(this.Te[this.nh]=245),this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++);if(t.Om)for(n=4;n>=0;n--)if(t.Om[n]&&'attack'===t.Om[n]?.toLowerCase()){let r=0;this.Sr&&t.Sm>this.Sr.ic&&(r=2e3),this.rh[this.nh]=t.Om[n]+' @yel@'+e,0===n?this.Te[this.nh]=r+728:1===n?this.Te[this.nh]=r+542:2===n?this.Te[this.nh]=r+6:3===n?this.Te[this.nh]=r+963:4===n&&(this.Te[this.nh]=r+245),this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++}this.rh[this.nh]='Examine @yel@'+e,$.K.nt&&(this.rh[this.nh]+='@whi@ ('+t.id+')'),this.Te[this.nh]=1607,this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++}else 2&~this.Ee||(this.rh[this.nh]=this._e+' @yel@'+e,this.Te[this.nh]=265,this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++)};bm=(t,i,s,h)=>{if(t===this.Sr||this.nh>=400)return;let e=null;this.Sr&&(e=t.name+this.Mm(this.Sr.ic,t.ic)+' (level-'+t.ic+')'),1===this.oe?(this.rh[this.nh]='Use '+this.fe+' with @whi@'+e,this.Te[this.nh]=367,this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++):1!==this.Ie?(this.rh[this.nh]='Follow @whi@'+e,this.Te[this.nh]=1544,this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++,0===this.Js&&(this.rh[this.nh]='Trade with @whi@'+e,this.Te[this.nh]=1373,this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++),this.Fr>0&&(this.rh[this.nh]='Attack @whi@'+e,this.Sr&&this.Sr.ic>=t.ic?this.Te[this.nh]=151:this.Te[this.nh]=2151,this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++),1===this.Ur&&(this.rh[this.nh]='Fight @whi@'+e,this.Te[this.nh]=151,this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++),2===this.Ur&&(this.rh[this.nh]='Duel-with @whi@'+e,this.Te[this.nh]=1101,this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++)):8&~this.Ee||(this.rh[this.nh]=this._e+' @whi@'+e,this.Te[this.nh]=651,this.Oe[this.nh]=i,this.ve[this.nh]=s,this.be[this.nh]=h,this.nh++);for(let t=0;t{const s=t-i;return s<-9?'@red@':s<-6?'@or3@':s<-3?'@or2@':s<0?'@or1@':s>9?'@gre@':s>6?'@gr3@':s>3?'@gr2@':s>0?'@gr1@':'@yel@'};yf=()=>{if(0===this.se){this.rh[0]='Cancel',this.Te[0]=1252,this.nh=1,this.om(this.Vl),this.Se=0,this.Yl>8&&this.Vl>11&&this.Yl<520&&this.Vl<345&&(-1===this.Xs?this.Cm():this.lm(c.A.Do[this.Xs],this.Yl,this.Vl,8,11,0)),this.Se!==this.$h&&(this.$h=this.Se),this.Se=0,this.Yl>562&&this.Vl>231&&this.Yl<752&&this.Vl<492&&(-1!==this.oh?this.lm(c.A.Do[this.oh],this.Yl,this.Vl,562,231,0):-1!==this.Mh[this.Sh]&&this.lm(c.A.Do[this.Mh[this.Sh]],this.Yl,this.Vl,562,231,0)),this.Se!==this.Jh&&(this.Ws=!0,this.Jh=this.Se),this.Se=0,this.Yl>22&&this.Vl>375&&this.Yl<431&&this.Vl<471&&(-1===this.lh?this.rm(this.Yl-22,this.Vl-375):this.lm(c.A.Do[this.lh],this.Yl,this.Vl,22,375,0)),-1!==this.lh&&this.Se!==this.Qh&&(this.Ys=!0,this.Qh=this.Se);let t=!1;for(;!t;){t=!0;for(let i=0;i1e3){const s=this.rh[i];this.rh[i]=this.rh[i+1],this.rh[i+1]=s;const h=this.Te[i];this.Te[i]=this.Te[i+1],this.Te[i+1]=h;const e=this.ve[i];this.ve[i]=this.ve[i+1],this.ve[i+1]=e;const n=this.be[i];this.be[i]=this.be[i+1],this.be[i+1]=n;const r=this.Oe[i];this.Oe[i]=this.Oe[i+1],this.Oe[i+1]=r,t=!1}}}};mf=()=>{let t=0;if(this.yi){let i;t=this.yi.Iu('Choose Option');for(let s=0;st&&(t=i)}t+=8;const i=15*this.nh+21;let s,h;this.Bc>8&&this.Gc>11&&this.Bc<520&&this.Gc<345&&(s=this.Bc-(t/2|0)-8,s+t>512?s=512-t:s<0&&(s=0),h=this.Gc-11,h+i>334?h=334-i:h<0&&(h=0),this.Qs=!0,this.th=0,this.ih=s,this.sh=h,this.hh=t,this.eh=15*this.nh+22),this.Bc>562&&this.Gc>231&&this.Bc<752&&this.Gc<492&&(s=this.Bc-(t/2|0)-562,s<0?s=0:s+t>190&&(s=190-t),h=this.Gc-231,h<0?h=0:h+i>261&&(h=261-i),this.Qs=!0,this.th=1,this.ih=s,this.sh=h,this.hh=t,this.eh=15*this.nh+22),this.Bc>22&&this.Gc>375&&this.Bc<501&&this.Gc<471&&(s=this.Bc-(t/2|0)-22,s<0?s=0:s+t>479&&(s=479-t),h=this.Gc-375,h<0?h=0:h+i>96&&(h=96-i),this.Qs=!0,this.th=2,this.ih=s,this.sh=h,this.hh=t,this.eh=15*this.nh+22)};Cf=(t,i,s,h,e,n,r,o,l,a,c)=>{const f=this.kn[this.Dn];if(!f)return!1;const u=G.A.Xn,d=G.A.Xn;for(let t=0;t0&&0===this.br[i]&&(E[i]&H.A.bd)===H.A.OPEN&&(this.Or[p]=w-1,this.vr[p]=y,p=(p+1)%g,this.br[i]=2,this.Lr[i]=t),i=G.A.index(w+1,y),w0&&0===this.br[i]&&(E[i]&H.A.Rd)===H.A.OPEN&&(this.Or[p]=w,this.vr[p]=y-1,p=(p+1)%g,this.br[i]=1,this.Lr[i]=t),i=G.A.index(w,y+1),y0&&y>0&&0===this.br[i]&&!(E[i]&H.A.Pm)&&(E[G.A.index(w-1,y)]&H.A.bd)===H.A.OPEN&&(E[G.A.index(w,y-1)]&H.A.Rd)===H.A.OPEN&&(this.Or[p]=w-1,this.vr[p]=y-1,p=(p+1)%g,this.br[i]=3,this.Lr[i]=t),i=G.A.index(w+1,y-1),w0&&0===this.br[i]&&!(E[i]&H.A.Fm)&&(E[G.A.index(w+1,y)]&H.A.Ld)===H.A.OPEN&&(E[G.A.index(w,y-1)]&H.A.Rd)===H.A.OPEN&&(this.Or[p]=w+1,this.vr[p]=y-1,p=(p+1)%g,this.br[i]=9,this.Lr[i]=t),i=G.A.index(w-1,y+1),w>0&&y=0&&s>=0&&e0){g=Math.min(m,25),m--;const t=this.Or[m],i=this.vr[m];if($.K.nt&&1===this.uf[6]&&1===this.uf[7]){for(let t=0;t{this.cr=0,this.ar=0,this.Ym(t),this.Vm(t),this.Km(t,i),this.Xm(t);for(let t=0;t{t.jm();if(0!==t.zm(1)){const i=t.zm(2);if(0===i)this.ur[this.ar++]=this.Mt;else if(1===i){const i=t.zm(3);this.Sr?.step(!1,i);1===t.zm(1)&&(this.ur[this.ar++]=this.Mt)}else if(2===i){const i=t.zm(3);this.Sr?.step(!0,i);const s=t.zm(3);this.Sr?.step(!0,s);1===t.zm(1)&&(this.ur[this.ar++]=this.Mt)}else if(3===i){this.Dn=t.zm(2);const i=t.zm(7),s=t.zm(7),h=t.zm(1);this.Sr?.move(1===h,i,s);1===t.zm(1)&&(this.ur[this.ar++]=this.Mt)}}};Vm=t=>{const i=t.zm(8);if(ithis.rr)throw new Error(`eek! ${this.username} Too many players`);this.rr=0;for(let s=0;s{let s;for(;t.Zm+10<8*i&&(s=t.zm(11),2047!==s);){if(!this.nr[s]){this.nr[s]=new W.A;const t=this.wr[s];t&&this.nr[s]?.read(t)}this.lr[this.rr++]=s;const i=this.nr[s];i&&(i.tu=this.Pt);let h=t.zm(5);h>15&&(h-=32);let e=t.zm(5);e>15&&(e-=32);const n=t.zm(1);this.Sr&&i?.move(1===n,this.Sr.Tf[0]+h,this.Sr.Of[0]+e);1===t.zm(1)&&(this.ur[this.ar++]=s)}t.qm()};Xm=t=>{for(let i=0;i{if(t.Mu=s,t.ku=this.Pt,(s&W.A.xu)===W.A.xu){const s=e.cA,h=new Uint8Array(s),n=new I.A(h);e.YA(s,0,h),this.wr[i]=n,t.read(n)}if((s&W.A.Du)===W.A.Du){let i=e.rA;65535===i&&(i=-1),i===t.Nu&&(t.Qm=0);const s=e.cA;(-1===i||-1===t.Nu||h.A.Do[i].priority>h.A.Do[t.Nu].priority||0===h.A.Do[t.Nu].priority)&&(t.Nu=i,t.tI=0,t.iI=0,t.sI=s,t.Qm=0)}if((s&W.A.Pu)===W.A.Pu&&(t.Fu=e.rA,65535===t.Fu&&(t.Fu=-1)),(s&W.A.Uu)===W.A.Uu&&(t.pu=e._A,t.gu=0,t.Eu=0,t._u=150,t.name&&this.zd(2,t.pu,t.name)),(s&W.A.Bu)===W.A.Bu&&(t.bu=e.cA,t.vu=e.cA,t.Cu=this.Pt+400,t.Tu=e.cA,t.Ou=e.cA),(s&W.A.Gu)===W.A.Gu&&(t.hI=e.rA,t.eI=e.rA,t.Hu=t.hI,t.Wu=t.eI),(s&W.A.Yu)===W.A.Yu){const i=e.rA,s=e.cA,h=e.cA,n=e.jc;if(t.name){const n=M.A.Id(t.name);let r=!1;if(s<=1)for(let t=0;t>8,t.Eu=255&i,t._u=150,s>1?this.zd(1,r,t.name):this.zd(2,r,t.name)}catch(t){}}e.jc=n+h}if((s&W.A.Vu)===W.A.Vu){t.Ku=e.rA;const i=e.il;t.nI=i>>16,t.rI=this.Pt+(65535&i),t.oI=0,t.lI=0,t.rI>this.Pt&&(t.oI=-1),65535===t.Ku&&(t.Ku=-1)}(s&W.A.Xu)===W.A.Xu&&(t.aI=e.cA,t.cI=e.cA,t.fI=e.cA,t.uI=e.cA,t.Lu=e.rA+this.Pt,t.Ru=e.rA+this.Pt,t.dI=e.cA,t.pathLength=0,t.Tf[0]=t.fI,t.Of[0]=t.uI)};wA=(t,i)=>{this.cr=0,this.ar=0,this.wI(t),this.yI(t,i),this.AI(t);for(let t=0;t{t.jm();const i=t.zm(8);if(ithis.Ar)throw new Error(`eek! ${this.username} Too many npcs`);this.Ar=0;for(let s=0;s{for(;t.Zm+21<8*i;){const i=t.zm(13);if(8191===i)break;this.yr[i]||(this.yr[i]=new Y.A);const s=this.yr[i];this.pr[this.Ar++]=i,s?(s.tu=this.Pt,s.type=r.A.get(t.zm(11)),s.size=s.type.size,s.pI=s.type.mI,s.II=s.type.gI,s.EI=s.type._I,s.CI=s.type.TI,s.Ga=s.type.OI):t.zm(11);let h=t.zm(5);h>15&&(h-=32);let e=t.zm(5);e>15&&(e-=32),this.Sr&&s?.move(!1,this.Sr.Tf[0]+h,this.Sr.Of[0]+e);1===t.zm(1)&&(this.ur[this.ar++]=i)}t.qm()};AI=t=>{for(let i=0;ih.A.Do[e.Nu].priority||0===h.A.Do[e.Nu].priority)&&(e.Nu=i,e.tI=0,e.iI=0,e.sI=s,e.Qm=0)}if((n&Y.A.Pu)===Y.A.Pu&&(e.Fu=t.rA,65535===e.Fu&&(e.Fu=-1)),(n&Y.A.Uu)===Y.A.Uu&&(e.pu=t._A,e._u=100),(n&Y.A.Bu)===Y.A.Bu&&(e.bu=t.cA,e.vu=t.cA,e.Cu=this.Pt+400,e.Tu=t.cA,e.Ou=t.cA),(n&Y.A.ju)===Y.A.ju&&(e.type=r.A.get(t.rA),e.pI=e.type.mI,e.II=e.type.gI,e.EI=e.type._I,e.CI=e.type.TI,e.Ga=e.type.OI),(n&Y.A.Vu)===Y.A.Vu){e.Ku=t.rA;const i=t.il;e.nI=i>>16,e.rI=this.Pt+(65535&i),e.oI=0,e.lI=0,e.rI>this.Pt&&(e.oI=-1),65535===e.Ku&&(e.Ku=-1)}(n&Y.A.Gu)===Y.A.Gu&&(e.hI=t.rA,e.eI=t.rA,e.Hu=e.hI,e.Wu=e.eI)}};lf=()=>{for(let t=-1;t1406){$.K.At=0,this.Bt.ef(O.A.bI),this.Bt.p1(0);const t=this.Bt.jc;this.Bt.p1(162),this.Bt.p1(22),2*Math.random()|0||this.Bt.p1(84),this.Bt.p2(31824),this.Bt.p2(13490),2*Math.random()|0||this.Bt.p1(123),2*Math.random()|0||this.Bt.p1(134),this.Bt.p1(100),this.Bt.p1(94),this.Bt.p2(35521),this.Bt.$f(this.Bt.jc-t)}};vI=t=>{(t.x<128||t.z<128||t.x>=13184||t.z>=13184)&&(t.Nu=-1,t.Ku=-1,t.Lu=0,t.Ru=0,t.x=128*t.Tf[0]+64*t.size,t.z=128*t.Of[0]+64*t.size,t.pathLength=0),t===this.Sr&&(t.x<1536||t.z<1536||t.x>=11776||t.z>=11776)&&(t.Nu=-1,t.Ku=-1,t.Lu=0,t.Ru=0,t.x=128*t.Tf[0]+64*t.size,t.z=128*t.Of[0]+64*t.size,t.pathLength=0),t.Lu>this.Pt?this.LI(t):t.Ru>=this.Pt?this.RI(t):this.SI(t),this.MI(t),this.kI(t)};Yf=()=>{if(this.Sr){this.Sr.x>>7===this.Ke&&this.Sr.z>>7===this.Xe&&(this.Ke=0);for(let t=-1;t50||this.rr>200)&&-1!==t&&i.xI===i.Ga;const h=i.x>>7,e=i.z>>7;if(!(h<0||h>=G.A.Xn||e<0||e>=G.A.Xn))if(!i.DI||this.Pt=i.FI){if(64==(127&i.x)&&64==(127&i.z)){if(this.Vn[h][e]===this.Ve)continue;this.Vn[h][e]=this.Ve}i.y=this.Zf(this.Dn,i.x,i.z),this.He?.UI(this.Dn,i.x,i.y,i.z,null,i,s,i.BI,60,i.GI)}else i.st=!1,i.y=this.Zf(this.Dn,i.x,i.z),this.He?.HI(this.Dn,i.x,i.y,i.z,i.WI,i.YI,i.VI,i.KI,null,i,s,i.BI)}}};af=()=>{for(let t=0;t{for(let t=0;t>7,e=i.z>>7;if(!(h<0||h>=G.A.Xn||e<0||e>=G.A.Xn)){if(1===i.size&&64==(127&i.x)&&64==(127&i.z)){if(this.Vn[h][e]===this.Ve)continue;this.Vn[h][e]=this.Ve}this.He?.UI(this.Dn,i.x,this.Zf(this.Dn,i.x,i.z),i.z,null,i,s,i.BI,64*(i.size-1)+60,i.GI)}}};Kf=()=>{for(let t=this.mr.head();t;t=this.mr.next())if(t.level!==this.Dn||this.Pt>t.XI)t.pA();else if(this.Pt>=t.jI){if(t.target>0){const i=this.yr[t.target-1];i&&t.zI(i.x,this.Zf(t.level,i.x,i.z)-t.offsetY,i.z,this.Pt)}if(t.target<0){const i=-t.target-1;let s;s=i===this.Dr?this.Sr:this.nr[i],s&&t.zI(s.x,this.Zf(t.level,s.x,s.z)-t.offsetY,s.z,this.Pt)}t.update(this.Ye),this.He?.UI(this.Dn,0|t.x,0|t.y,0|t.z,null,t,-1,t.BI,60,!1)}};Xf=()=>{for(let t=this.Ir.head();t;t=this.Ir.next())t.level!==this.Dn||t.ZI?t.pA():this.Pt>=t.jI&&(t.update(this.Ye),t.ZI?t.pA():this.He?.UI(t.level,t.x,t.y,t.z,null,t,-1,0,60,!1))};jf=()=>{for(let t=this.gr.head();t;t=this.gr.next()){let i=!1;if(t.El+=this.Ye,-1===t._l&&(t._l=0,i=!0),t.qI.delay)for(;t.El>t.qI.delay[t._l];)if(t.El-=t.qI.delay[t._l]+1,t._l++,i=!0,t._l>=t.qI.Cl&&(t._l-=t.qI.Tl,t._l<0||t._l>=t.qI.Cl)){t.pA(),i=!1;break}if(i&&this.He){const i=t.tm,s=t.Jp,h=t.Qp;let n=0;if(0===t.$I?n=this.He.Md(i,s,h):1===t.$I?n=this.He.jy(i,h,s):2===t.$I?n=this.He.Hd(i,s,h):3===t.$I&&(n=this.He.Od(i,s,h)),this.Wn&&0!==n&&(n>>14&32767)===t.index){const r=this.Wn[i][s][h],o=this.Wn[i][s+1][h],l=this.Wn[i][s+1][h+1],a=this.Wn[i][s][h+1],c=e.A.get(t.index);let f=-1;if(-1!==t._l&&t.qI.frames&&(f=t.qI.frames[t._l]),2===t.$I){const t=this.He.kd(i,s,h,n);let e=31&t;const u=t>>6;e===P.A._y.id&&(e=P.A.Ey.id),this.He?.JI(i,s,h,c.ma(e,u,r,o,l,a,f))}else if(1===t.$I)this.He?.QI(i,s,h,c.ma(P.A.tg.id,0,r,o,l,a,f));else if(0===t.$I){const t=this.He.kd(i,s,h,n),e=31&t,u=t>>6;if(e===P.A.Nd.id){const t=u+1&3;this.He?.ig(s,h,i,c.ma(P.A.Nd.id,u+4,r,o,l,a,f),c.ma(P.A.Nd.id,t,r,o,l,a,f))}else this.He?.sg(i,s,h,c.ma(e,u,r,o,l,a,f))}else if(3===t.$I){const t=this.He.kd(i,s,h,n)>>6;this.He?.hg(i,s,h,c.ma(P.A.Cy.id,t,r,o,l,a,f))}}else t.pA()}}};cf=()=>{for(let t=-1;t0&&(s._u--,0===s._u&&(s.pu=null))}for(let t=0;t0&&(s._u--,0===s._u&&(s.pu=null))}};ff=()=>{if(2===this.We){for(let t=this.Er.head();t;t=this.Er.next())this.Pt>=t.XI&&(this.Vy(t.dp,t.x,t.z,t.im,t.angle,t.shape,t.Kd),t.pA());$.K.yt++,$.K.yt>85&&($.K.yt=0,this.Bt.ef(O.A.eg))}};LI=t=>{const i=t.Lu-this.Pt,s=128*t.aI+64*t.size,h=128*t.cI+64*t.size;t.x+=(s-t.x)/i|0,t.z+=(h-t.z)/i|0,t.ng=0,0===t.dI&&(t.rg=1024),1===t.dI&&(t.rg=1536),2===t.dI&&(t.rg=0),3===t.dI&&(t.rg=512)};RI=t=>{if(t.Ru===this.Pt||-1===t.Nu||0!==t.sI||t.iI+1>h.A.Do[t.Nu].delay[t.tI]){const i=t.Ru-t.Lu,s=this.Pt-t.Lu,h=128*t.aI+64*t.size,e=128*t.cI+64*t.size,n=128*t.fI+64*t.size,r=128*t.uI+64*t.size;t.x=(h*(i-s)+n*s)/i|0,t.z=(e*(i-s)+r*s)/i|0}t.ng=0,0===t.dI&&(t.rg=1024),1===t.dI&&(t.rg=1536),2===t.dI&&(t.rg=0),3===t.dI&&(t.rg=512),t.BI=t.rg};MI=t=>{if(-1!==t.Fu&&t.Fu<32768){const i=this.yr[t.Fu];if(i){const s=t.x-i.x,h=t.z-i.z;0===s&&0===h||(t.rg=325.949*Math.atan2(s,h)&2047)}}if(t.Fu>=32768){let i=t.Fu-32768;i===this.Dr&&(i=this.Mt);const s=this.nr[i];if(s){const i=t.x-s.x,h=t.z-s.z;0===i&&0===h||(t.rg=325.949*Math.atan2(i,h)&2047)}}if((0!==t.hI||0!==t.eI)&&(0===t.pathLength||t.ng>0)){const i=t.x-64*(t.hI-this.Tn-this.Tn),s=t.z-64*(t.eI-this.On-this.On);0===i&&0===s||(t.rg=325.949*Math.atan2(i,s)&2047),t.hI=0,t.eI=0}const i=t.rg-t.BI&2047;if(0!==i&&(i<32||i>2016?t.BI=t.rg:i>1024?t.BI-=32:t.BI+=32,t.BI&=2047,t.xI===t.Ga&&t.BI!==t.rg)){if(-1!==t.og)return void(t.xI=t.og);t.xI=t.pI}};kI=t=>{let i;if(t.GI=!1,-1!==t.xI&&(i=h.A.Do[t.xI],t.lg++,i.delay&&t.agi.delay[t.ag]&&(t.lg=0,t.ag++),t.ag>=i.Cl&&(t.lg=0,t.ag=0)),-1!==t.Nu&&0===t.sI){for(i=h.A.Do[t.Nu],t.iI++;i.delay&&t.tIi.delay[t.tI];)t.iI-=i.delay[t.tI],t.tI++;t.tI>=i.Cl&&(t.tI-=i.Tl,t.Qm++,t.Qm>=i.cg&&(t.Nu=-1),(t.tI<0||t.tI>=i.Cl)&&(t.Nu=-1)),t.GI=i.fg}if(t.sI>0&&t.sI--,-1!==t.Ku&&this.Pt>=t.rI){for(t.oI<0&&(t.oI=0),i=l.A.Do[t.Ku].qI,t.lI++;i&&i.delay&&t.oIi.delay[t.oI];)t.lI-=i.delay[t.oI],t.oI++;i&&t.oI>=i.Cl&&(t.oI<0||t.oI>=i.Cl)&&(t.Ku=-1)}};SI=t=>{if(t.xI=t.Ga,0===t.pathLength)return void(t.ng=0);if(-1!==t.Nu&&0===t.sI){if(!h.A.Do[t.Nu].ug)return void t.ng++}const i=t.x,s=t.z,e=128*t.Tf[t.pathLength-1]+64*t.size,n=128*t.Of[t.pathLength-1]+64*t.size;if(e-i<=256&&e-i>=-256&&n-s<=256&&n-s>=-256){t.rg=in?1792:1536:i>e?sn?256:512:s1024&&(h-=2048);let r=t.II;h>=-256&&h<=256?r=t.pI:h>=256&&h<768?r=t.CI:h>=-768&&h<=-256&&(r=t.EI),-1===r&&(r=t.pI),t.xI=r;let o=4;t.BI!==t.rg&&-1===t.Fu&&(o=2),t.pathLength>2&&(o=6),t.pathLength>3&&(o=8),t.ng>0&&t.pathLength>1&&(o=8,t.ng--),t.dg[t.pathLength-1]&&(o<<=1),o>=8&&t.xI===t.pI&&-1!==t.wg&&(t.xI=t.wg),ie&&(t.x=e)):i>e&&(t.x-=o,t.xn&&(t.z=n)):s>n&&(t.z-=o,t.z{let t=3;if(this.fn<310&&this.Sr){let i=this.ln>>7,s=this.cn>>7;const h=this.Sr.x>>7,e=this.Sr.z>>7;let n,r,o,l;if(this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn),n=h>i?h-i:i-h,r=e>s?e-s:s-e,n>r)for(o=65536*r/n|0,l=32768;i!==h;)ih&&i--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn),l+=o,l>=65536&&(l-=65536,se&&s--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn));else for(o=65536*n/r|0,l=32768;s!==e;)se&&s--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn),l+=o,l>=65536&&(l-=65536,ih&&i--,this.Yn&&4&this.Yn[this.Dn][i][s]&&(t=this.Dn))}return this.Sr&&this.Yn&&4&this.Yn[this.Dn][this.Sr.x>>7][this.Sr.z>>7]&&(t=this.Dn),t};Jf=()=>{if(!this.Yn)return 0;return this.Zf(this.Dn,this.ln,this.cn)-this.an>=800||!(4&this.Yn[this.Dn][this.ln>>7][this.cn>>7])?3:this.Dn};Zf=(t,i,s)=>{if(!this.Wn)return 0;const h=Math.min(i>>7,G.A.Xn-1),e=Math.min(s>>7,G.A.Xn-1);let n=t;t<3&&this.Yn&&!(2&~this.Yn[1][h][e])&&(n=t+1);const r=127&i,o=127&s;return(this.Wn[n][h][e]*(128-r)+this.Wn[n][h+1][e]*r>>7)*(128-o)+(this.Wn[n][h][e+1]*(128-r)+this.Wn[n][h+1][e+1]*r>>7)*o>>7};zf=(t,i,s,h,e,n)=>{const r=2048-e&2047,o=2048-h&2047;let l,a,c,f=0,u=0,w=n;0!==r&&(l=d.A.sin[r],a=d.A.cos[r],c=u*a-n*l>>16,w=u*l+n*a>>16,u=c),0!==o&&(l=d.A.sin[o],a=d.A.cos[o],c=w*l+f*a>>16,w=w*a-f*l>>16,f=c),this.ln=t-f,this.an=i-u,this.cn=s-w,this.fn=e,this.un=h};Mf=()=>{if(!this.Sr)return;const t=this.Sr.x+this.Ze,i=this.Sr.z+this.qe;(this.Gn-t<-500||this.Gn-t>500||this.Hn-i<-500||this.Hn-i>500)&&(this.Gn=t,this.Hn=i),this.Gn!==t&&(this.Gn+=(t-this.Gn)/16|0),this.Hn!==i&&(this.Hn+=(i-this.Hn)/16|0),1===this.uf[1]?this.Un+=(-this.Un-24)/2|0:1===this.uf[2]?this.Un+=(24-this.Un)/2|0:this.Un=this.Un/2|0,1===this.uf[3]?this.Bn+=(12-this.Bn)/2|0:1===this.uf[4]?this.Bn+=(-this.Bn-12)/2|0:this.Bn=this.Bn/2|0,this.Fn=this.Fn+this.Un/2&2047,this.Pn+=this.Bn/2|0,this.Pn<128&&(this.Pn=128),this.Pn>383&&(this.Pn=383);const s=this.Gn>>7,h=this.Hn>>7,e=this.Zf(this.Dn,this.Gn,this.Hn);let n=0;if(this.Wn&&s>3&&h>3&&s<100&&h<100)for(let t=s-4;t<=s+4;t++)for(let i=h-4;i<=h+4;i++){let s=this.Dn;s<3&&this.Yn&&!(2&~this.Yn[1][t][i])&&s++;const h=e-this.Wn[s][t][i];h>n&&(n=h)}let r=192*n;r>98048&&(r=98048),r<32768&&(r=32768),r>this.dn?this.dn+=(r-this.dn)/24|0:r{let t=128*this.tr+64,i=128*this.ir+64,s=this.Zf(this.Dn,this.tr,this.ir)-this.sr;this.lnt&&(this.ln=t)),this.ln>t&&(this.ln-=this.hr+((this.ln-t)*this.er/1e3|0),this.lns&&(this.an=s)),this.an>s&&(this.an-=this.hr+((this.an-s)*this.er/1e3|0),this.ani&&(this.cn=i)),this.cn>i&&(this.cn-=this.hr+((this.cn-i)*this.er/1e3|0),this.cn383&&(o=383),this.fno&&(this.fn=o)),this.fn>o&&(this.fn-=this.Jn+((this.fn-o)*this.Qn/1e3|0),this.fn1024&&(a-=2048),a<-1024&&(a+=2048),a>0&&(this.un+=this.Jn+(a*this.Qn/1e3|0),this.un&=2047),a<0&&(this.un-=this.Jn+(-a*this.Qn/1e3|0),this.un&=2047);let c=l-this.un;c>1024&&(c-=2048),c<-1024&&(c+=2048),(c<0&&a>0||c>0&&a<0)&&(this.un=l)};FA=(t,i)=>{const s=t.cA;let n=this.gn+(s>>4&7),r=this.En+(7&s);if(i===T.A.PA||i===T.A.NA){const s=t.cA,h=s>>2,e=3&s,o=P.A.of(h).Kd;let l;if(l=i===T.A.NA?-1:t.rA,n>=0&&r>=0&&n>14&32767,h=31&t,e=t>>6}t=new U.A(this.Dn,o,n,r,0,F.A.Pd,P.A.Dd.id,s,e,h),this.Tr.yg(t)}t&&(t.im=l,t.shape=h,t.angle=e),this.Vy(this.Dn,n,r,l,e,h,o)}}else if(i===T.A.DA){const i=t.cA>>2,s=P.A.of(i).Kd,e=t.rA;if(n>=0&&r>=0&&n>14&32767,this.Dn,s,n,r,h.A.Do[e],!1);this.gr.yg(i)}}}else if(i===T.A.xA){const i=t.rA,s=t.rA;if(n>=0&&r>=0&&n=0&&r>=0&&n=0&&r>=0&&n=0&&s>=0&&i=0&&r>=0&&n=0&&r>=0&&n>2,h=3&i,o=P.A.of(s).Kd,l=t.rA,a=t.rA,c=t.rA,f=t.rA;let u,d=t.lA,w=t.lA,y=t.lA,A=t.lA;if(u=f===this.Dr?this.Sr:this.nr[f],u&&this.Wn){const t=new B.A(this.Dn,o,n,r,-1,h,s,a+this.Pt);this.Er.yg(t);const i=new B.A(this.Dn,o,n,r,l,h,s,c+this.Pt);this.Er.yg(i);const f=this.Wn[this.Dn][n][r],p=this.Wn[this.Dn][n+1][r],m=this.Wn[this.Dn][n+1][r+1],I=this.Wn[this.Dn][n][r+1],g=e.A.get(l);u.NI=a+this.Pt,u.FI=c+this.Pt,u.DI=g.ma(s,h,f,p,m,I,-1);let E,_=g.width,C=g.length;h!==F.A.Fd&&h!==F.A.Bd||(_=g.length,C=g.width),u.Ag=128*n+64*_,u.pg=128*r+64*C,u.mg=this.Zf(this.Dn,u.Ag,u.pg),d>y&&(E=d,d=y,y=E),w>A&&(E=w,w=A,A=E),u.WI=n+d,u.VI=n+y,u.YI=r+w,u.KI=r+A}}else if(i===T.A.bA){const i=t.rA,s=t.rA,h=t.rA;if(n>=0&&r>=0&&n{if(!$.K.st){if(d.A.Ig[17]>=t){const t=d.A.gg[17];if(!t)return;const i=t.width*t.height-1,s=t.width*this.Ye*2,h=t.yc,e=this.Mn;for(let t=0;t<=i;t++)e[t]=h[t-s&i];t.yc=e,this.Mn=h,d.A.Eg(17)}if(d.A.Ig[24]>=t){const t=d.A.gg[24];if(!t)return;const i=t.width*t.height-1,s=t.width*this.Ye*2,h=t.yc,e=this.Mn;for(let t=0;t<=i;t++)e[t]=h[t-s&i];t.yc=e,this.Mn=h,d.A.Eg(24)}}};Rc=()=>{if(!(this.Ci&&this.Ti&&this._i&&this.Ri))return;for(let t=10;t<117;t++){(100*Math.random()|0)<50&&(this.Ci[t+32512]=255)}for(let t=0;t<100;t++){const t=2+(124*Math.random()|0)+(128+(128*Math.random()|0)<<7);this.Ci[t]=192}for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);this.Ti[s]=(this.Ci[s-1]+this.Ci[s+1]+this.Ci[s-128]+this.Ci[s+128])/4|0}this.Si+=128,this.Si>this._i.length&&(this.Si-=this._i.length,this.kc(this.pi[12*Math.random()|0]));for(let t=1;t<255;t++)for(let i=1;i<127;i++){const s=i+(t<<7);let h=this.Ti[s+128]-(this._i[s+this.Si&this._i.length-1]/5|0);h<0&&(h=0),this.Ci[s]=h}for(let t=0;t<255;t++)this.Ri[t]=this.Ri[t+1];if(this.Ri[255]=16*Math.sin(this.Pt/14)+14*Math.sin(this.Pt/15)+12*Math.sin(this.Pt/16)|0,this.Mi>0&&(this.Mi-=4),this.ki>0&&(this.ki-=4),0===this.Mi&&0===this.ki){const t=2e3*Math.random()|0;0===t?this.Mi=1024:1===t&&(this.ki=1024)}};_g=(t,i,s)=>{const h=256-i;return((16711935&t)*h+(16711935&s)*i&4278255360)+((65280&t)*h+(65280&s)*i&16711680)>>8};Sc=()=>{if(!(this.Oi&&this.vi&&this.bi&&this.Li&&this.Ri&&this.Ci))return;const t=256;if(this.Mi>0)for(let t=0;t<256;t++)this.Mi>768?this.Oi[t]=this._g(this.vi[t],1024-this.Mi,this.bi[t]):this.Mi>256?this.Oi[t]=this.bi[t]:this.Oi[t]=this._g(this.bi[t],256-this.Mi,this.vi[t]);else if(this.ki>0)for(let t=0;t<256;t++)this.ki>768?this.Oi[t]=this._g(this.vi[t],1024-this.ki,this.Li[t]):this.ki>256?this.Oi[t]=this.Li[t]:this.Oi[t]=this._g(this.Li[t],256-this.ki,this.vi[t]);else for(let t=0;t<256;t++)this.Oi[t]=this.vi[t];for(let t=0;t<33920;t++)this.hi&&this.Ii&&(this.hi.yc[t]=this.Ii.yc[t]);let i=0,s=1152;for(let h=1;h<255;h++){let e=(this.Ri[h]*(t-h)/t|0)+22;e<0&&(e=0),i+=e;for(let t=e;t<128;t++){let t=this.Ci[i++];if(0===t)s++;else{const i=t,h=256-t;if(t=this.Oi[t],this.hi){const e=this.hi.yc[s];this.hi.yc[s++]=((16711935&t)*i+(16711935&e)*h&4278255360)+((65280&t)*i+(65280&e)*h&16711680)>>8}}}s+=e}this.hi?.draw(0,0);for(let t=0;t<33920;t++)this.ei&&this.gi&&(this.ei.yc[t]=this.gi.yc[t]);i=0,s=1176;for(let h=1;h<255;h++){const e=this.Ri[h]*(t-h)/t|0,n=103-e;s+=e;for(let t=0;t>8}}}i+=128-n,s+=128-n-e}this.ei?.draw(661,0)}}console.log(`RS2 user client - release #${$.K.tt}`),await(0,it.w)(),(new t).run().then((()=>{})),i()}catch(t){i(t)}}),1)},7046:(t,i,s)=>{s.d(i,{A:()=>a});var h=s(1183),e=s(4583),n=s(9234),r=s(9091),o=s(2595),l=s(7854);class a{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const s=new URL(window.location.toString());s.searchParams.set(t,i),window.history.pushState(null,'',s.toString())}sd=0;Cg=[];Tg=0;Po=null;state=0;Qu=20;Og=1;vg=[];Ju=0;bg=0;Lg=[];Rg=!0;Sg=!1;Mg=50;hasFocus=!0;gc=!1;Qc=0;wf=0;Yl=0;Vl=0;Uc=0;Bc=0;Gc=0;uf=[];kg=[];xg=0;Dg=0;input=null;Ng=!1;Pg=!1;Fg=!1;time=-1;Ug=0;Bg=0;Gg=0;Hg=0;Wg=0;Yg=0;constructor(t=!1){l.Vg.tabIndex=-1,l.el.fillStyle='black',l.el.fillRect(0,0,l.Vg.width,l.Vg.height),this.Sg=t,this.Sg?this.resize(window.innerWidth,window.innerHeight):this.resize(l.Vg.width,l.Vg.height)}get width(){return l.Vg.width}get height(){return l.Vg.height}resize=(t,i)=>{l.Vg.width=t,l.Vg.height=i,this.Po=new h.A(t,i),e.A.Kg()};run=async()=>{l.Vg.addEventListener('resize',(()=>{this.Sg&&this.resize(window.innerWidth,window.innerHeight)}),!1),l.Vg.onmousedown=this.onmousedown,l.Vg.onmouseup=this.onmouseup,l.Vg.onmouseenter=this.onmouseenter,l.Vg.onmouseleave=this.onmouseleave,l.Vg.onmousemove=this.onmousemove,window.onbeforeunload=this.Ro,l.Vg.onfocus=this.onfocus,l.Vg.onblur=this.onblur,this.Xg?(l.Vg.ontouchstart=this.ontouchstart,l.Vg.ontouchend=this.ontouchend,l.Vg.ontouchmove=this.ontouchmove):(l.Vg.onkeydown=this.onkeydown,l.Vg.onkeyup=this.onkeyup),l.Vg.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Xg&&'low'===a.getParameter('detail')&&(this.Mg=30),await this.qo(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.vg[t]=performance.now();let t,i=0,s=256,h=1,e=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.jg();const r=s,o=h;s=300,h=1,t=performance.now();const l=this.vg[i];if(0===l?(s=r,h=o):t>l&&(s=2560*this.Qu/(t-l)|0),s<25?s=25:s>256&&(s=256,h=this.Qu-(t-l)/10|0),this.vg[i]=t,i=(i+1)%10,h>1)for(let t=0;t<10;t++)0!==this.vg[t]&&(this.vg[t]+=h);for(h0&&(this.Ju=1e3*s/(256*this.Qu)|0);const a=performance.now();if(this.Rg&&this.refresh(),await this.draw(),this.Lg[this.bg]=(performance.now()-a)/1e3,this.bg=(this.bg+1)%this.Lg.length,this.Mg<50){const i=1e3/this.Mg-(performance.now()-t);i>0&&await(0,n.Jo)(i)}}-1===this.state&&this.jg()};jg=()=>{this.state=-2,this.Ro()};nl=t=>{this.Qu=1e3/t|0};My=t=>{this.Mg=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.Qu|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};Ro=()=>{};draw=async()=>{};refresh=()=>{};async qo(t,i){const s=this.width,h=this.height;this.Rg&&(l.el.fillStyle='black',l.el.fillRect(0,0,s,h),this.Rg=!1);const e=h/2-18;l.el.fillStyle='rgb(140, 17, 17)',l.el.rect((s/2|0)-152,e,304,34),l.el.fillRect((s/2|0)-150,e+2,3*t,30),l.el.fillStyle='black',l.el.fillRect((s/2|0)-150+3*t,e+2,300-3*t,30),l.el.font='bold 13px helvetica, sans-serif',l.el.textAlign='center',l.el.fillStyle='white',l.el.fillText(i,s/2|0,e+22),await(0,n.Jo)(5)}Wc=()=>{let t=-1;return this.Dg!==this.xg&&(t=this.kg[this.xg],this.xg=this.xg+1&127),t};get ms(){const t=this.Lg.length;let i=0;for(let s=0;sthis.sd&&(this.sd=s),this.Cg[this.Tg]=s,this.Tg=(this.Tg+1)%250,s}get td(){return this.Cg.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.Qc=0;const s=r.c[i];if(!s||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const h=s.code;let e=s.ch;t.ctrlKey&&(e>='A'.charCodeAt(0)&&e<=']'.charCodeAt(0)||e=='_'.charCodeAt(0)?e-='A'.charCodeAt(0)-1:e>='a'.charCodeAt(0)&&e<='z'.charCodeAt(0)&&(e-='a'.charCodeAt(0)-1)),e<30&&(e=0),h===r.c.ArrowLeft.code?e=1:h===r.c.ArrowRight.code?e=2:h===r.c.ArrowUp.code?e=3:h===r.c.ArrowDown.code?e=4:h===r.c.Control.code?e=5:h===r.c.Shift.code?e=6:h===r.c.Alt.code?e=7:h===r.c.Backspace.code||h===r.c.Delete.code?e=8:h===r.c.Tab.code?e=9:h===r.c.Enter.code?e=10:h>=r.c.F1.code&&h<=r.c.F12.code?e=h+1008-r.c.F1.code:h===r.c.Home.code?e=1e3:h===r.c.End.code?e=1001:h===r.c.PageUp.code?e=1002:h===r.c.PageDown.code&&(e=1003),e>0&&e<128&&(this.uf[e]=1),e>4&&(this.kg[this.Dg]=e,this.Dg=this.Dg+1&127),o.A.enabled&&o.A.zg(e),r.g.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.Qc=0;const s=r.c[i];if(!s||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const h=s.code;let e=s.ch;e<30&&(e=0),h===r.c.ArrowLeft.code?e=1:h===r.c.ArrowRight.code?e=2:h===r.c.ArrowUp.code?e=3:h===r.c.ArrowDown.code?e=4:h===r.c.Control.code?e=5:h===r.c.Shift.code?e=6:h===r.c.Alt.code?e=7:h===r.c.Backspace.code||h===r.c.Delete.code?e=8:h===r.c.Tab.code?e=9:h===r.c.Enter.code?e=10:h>=r.c.F1.code&&h<=r.c.F12.code?e=h+1008-r.c.F1.code:h===r.c.Home.code?e=1e3:h===r.c.End.code?e=1001:h===r.c.PageUp.code?e=1002:h===r.c.PageDown.code&&(e=1003),e>0&&e<128&&(this.uf[e]=0),o.A.enabled&&o.A.Zg(e),r.g.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.Ng=!1,(t.clientX>0||t.clientY>0)&&this.qg(t),this.Qc=0,this.Bc=this.Yl,this.Gc=this.Vl,this.Xg&&!this.$g){if(this.Jg()||this.Qg()||this.tE())return this.Uc=1,void(this.wf=1);t.timeStamp>=this.time+500?(this.Uc=2,this.wf=2):(this.Uc=1,this.wf=1)}else 2===t.button?(this.Uc=2,this.wf=2):(this.Uc=1,this.wf=1);o.A.enabled&&o.A.iE(this.Bc,this.Gc,t.buttons)};onmouseup=t=>{this.qg(t),this.Qc=0,this.wf=0,o.A.enabled&&o.A.sE(t.buttons)};onmouseenter=t=>{this.qg(t),o.A.enabled&&o.A.hE()};onmouseleave=t=>{this.qg(t),this.Qc=0,this.Yl=-1,this.Vl=-1,this.wf=0,this.Bc=-1,this.Gc=-1,o.A.enabled&&o.A.eE()};onmousemove=t=>{this.qg(t),this.Qc=0,o.A.enabled&&o.A.nE(this.Yl,this.Vl)};onfocus=t=>{this.hasFocus=!0,this.Rg=!0,this.refresh(),o.A.enabled&&o.A.rE()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.oE()};ontouchstart=t=>{if(!this.Xg)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.Ng=!0;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.Ug=this.Wg=this.Gg=0|i.screenX,this.Bg=this.Yg=this.Hg=0|i.screenY,this.time=t.timeStamp,this.Pg=this.lE(),this.Fg=this.aE()};ontouchend=t=>{if(!this.Xg||!this.Ng)return;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.Wg=0|i.screenX,this.Yg=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Pg&&!this.lE())return void(this.Ng=!1);if(this.Fg&&!this.aE())return void(this.Ng=!1);if(this.Jg()||this.cE()||this.Qg()||this.tE()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.Qg()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.tE()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Jg()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.cE()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.fE?t.setAttribute('type','password'):t.setAttribute('type',this.tE()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${s}px; top: ${h}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.fE&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,s=i.data;null!==s&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:s,code:s}))}),t.onkeydown=t=>{this.fE&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.fE&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.Ng=!1)}const e=t.timeStamp>=this.time+500,n=Math.abs(this.Ug-this.Wg)>16||Math.abs(this.Bg-this.Yg)>16;e&&!n?(this.Ng=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.wf=0,this.Ng=!1)};ontouchmove=t=>{if(!this.Xg||!this.Ng)return;const i=t.changedTouches[0],s=0|i.clientX,h=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:s,clientY:h})),this.Wg=0|i.screenX,this.Yg=0|i.screenY,this.Pg&&-1===this.Ho()?(this.Gg-this.Wg>0?this.rotate(2):this.Gg-this.Wg<0&&this.rotate(0),this.Hg-this.Yg>0?this.rotate(3):this.Hg-this.Yg<0&&this.rotate(1)):(this.Fg||-1!==this.Ho())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.Gg=this.Wg,this.Hg=this.Yg};get Xg(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get fE(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get $g(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}lE=()=>this.gc&&this.Yl>=8&&this.Yl<=520&&this.Vl>=11&&this.Vl<=345;Jg=()=>this.gc&&-1===this.Go()&&!this.Uo()&&!this.Bo()&&this.Yl>=11&&this.Yl<=506&&this.Vl>=449&&this.Vl<=482;cE=()=>this.gc&&(this.Uo()||this.Bo())&&this.Yl>=11&&this.Yl<=506&&this.Vl>=383&&this.Vl<=482;aE=()=>this.gc&&this.Yl>=562&&this.Yl<=752&&this.Vl>=231&&this.Vl<=492;Qg=()=>!this.gc&&2===this.Fo()&&this.Yl>=301&&this.Yl<=562&&this.Vl>=262&&this.Vl<=279;tE=()=>!this.gc&&2===this.Fo()&&this.Yl>=301&&this.Yl<=562&&this.Vl>=279&&this.Vl<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};uE=()=>null!==document.fullscreenElement;qg=t=>{if(this.uE()){const i=t.target.getBoundingClientRect(),s=window.innerHeight/l.Vg.height,h=(window.innerWidth-l.Vg.width*s)/2;this.Yl=0|this.dE(t.clientX-i.left-h,0,l.Vg.width*s,0,789),this.Vl=0|this.dE(t.clientY-i.top,0,l.Vg.height*s,0,532)}else{const i=l.Vg.getBoundingClientRect(),s=l.Vg.width/i.width,h=l.Vg.height/i.height;this.Yl=(t.clientX-i.left)*s|0,this.Vl=(t.clientY-i.top)*h|0}this.Yl<0&&(this.Yl=0),this.Vl<0&&(this.Vl=0),this.Yl>789&&(this.Yl=789),this.Vl>532&&(this.Vl=532)};dE=(t,i,s,h,e)=>(t-i)*(e-h)/(s-i)+h}},2595:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1069);class e{static enabled=!1;static wE=null;static yE=null;static AE=0;static pE=0;static mE=0;static IE=0;static gE=0;static jA=()=>{this.wE=h.A.Ut(1),this.yE=null,this.AE=performance.now(),this.enabled=!0};static Jc=()=>{this.enabled=!1,this.wE=null};static flush=()=>{let t=null;return this.yE&&this.enabled&&(t=this.yE),this.yE=null,t};static stop=()=>{let t=null;return this.wE&&this.wE.jc>0&&this.enabled&&(t=this.wE),this.Jc(),t};static iE=(t,i,s)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.pE++;const h=performance.now();let e=(h-this.AE)/10|0;e>250&&(e=250),this.AE=h,this.EE(5),1===s?this.wE?.p1(1):this.wE?.p1(2),this.wE?.p1(e),this.wE?.p3(t+(i<<10))};static sE=t=>{if(!this.enabled)return;this.pE++;const i=performance.now();let s=(i-this.AE)/10|0;s>250&&(s=250),this.AE=i,this.EE(2),1===t?this.wE?.p1(3):this.wE?.p1(4),this.wE?.p1(s)};static nE=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const s=performance.now();if(s-this.mE>=50){this.mE=s,this.pE++;let h=(s-this.AE)/10|0;h>250&&(h=250),this.AE=s,t-this.IE<8&&t-this.IE>=-8&&i-this.gE<8&&i-this.gE>=-8?(this.EE(3),this.wE?.p1(5),this.wE?.p1(h),this.wE?.p1(t+(i-this.gE+8<<4)+8-this.IE)):t-this.IE<128&&t-this.IE>=-128&&i-this.gE<128&&i-this.gE>=-128?(this.EE(4),this.wE?.p1(6),this.wE?.p1(h),this.wE?.p1(t+128-this.IE),this.wE?.p1(i+128-this.gE)):(this.EE(5),this.wE?.p1(7),this.wE?.p1(h),this.wE?.p3(t+(i<<10))),this.IE=t,this.gE=i}};static zg=t=>{if(!this.enabled)return;this.pE++;const i=performance.now();let s=(i-this.AE)/10|0;s>250&&(s=250),this.AE=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.EE(3),this.wE?.p1(8),this.wE?.p1(s),this.wE?.p1(t)};static Zg=t=>{if(!this.enabled)return;this.pE++;const i=performance.now();let s=(i-this.AE)/10|0;s>250&&(s=250),this.AE=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.EE(3),this.wE?.p1(9),this.wE?.p1(s),this.wE?.p1(t)};static rE=()=>{if(!this.enabled)return;this.pE++;const t=performance.now();let i=(t-this.AE)/10|0;i>250&&(i=250),this.AE=t,this.EE(2),this.wE?.p1(10),this.wE?.p1(i)};static oE=()=>{if(!this.enabled)return;this.pE++;const t=performance.now();let i=(t-this.AE)/10|0;i>250&&(i=250),this.AE=t,this.EE(2),this.wE?.p1(11),this.wE?.p1(i)};static hE=()=>{if(!this.enabled)return;this.pE++;const t=performance.now();let i=(t-this.AE)/10|0;i>250&&(i=250),this.AE=t,this.EE(2),this.wE?.p1(12),this.wE?.p1(i)};static eE=()=>{if(!this.enabled)return;this.pE++;const t=performance.now();let i=(t-this.AE)/10|0;i>250&&(i=250),this.AE=t,this.EE(2),this.wE?.p1(13),this.wE?.p1(i)};static EE=t=>{if(this.wE&&this.wE.jc+t>=500){const t=this.wE;this.wE=h.A.Ut(1),this.yE=t}}}},9091:(t,i,s)=>{s.d(i,{c:()=>e,g:()=>h});const h=['F11','F12'],e={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}}},1120:(t,i,s)=>{s.d(i,{A:()=>c});var h=s(1069),e=s(8665),n=s(2679),r=s(2511),o=s(3819),l=s(3867),a=s(8950);class c{static Do=[];static _E=null;static No=null;static xl=0;static CE=1;static Nl=2;static Jl=3;static ta=4;static fa=5;static wa=6;static _a=7;static ym=1;static Im=2;static gm=3;static Em=4;static _m=5;static na=6;static Oa=1;static va=100;static ba=101;static La=200;static iy=201;static sy=202;static Ra=203;static hy=205;static oy=300;static TE=301;static OE=302;static vE=303;static bE=304;static LE=305;static RE=306;static SE=307;static ME=308;static kE=309;static xE=310;static DE=311;static NE=312;static ly=313;static uy=314;static PE=315;static FE=316;static UE=317;static BE=318;static GE=319;static HE=320;static WE=321;static YE=322;static wy=323;static Va=324;static Ka=325;static yy=326;static Na=327;static Sa=401;static Ma=500;static ey=501;static ny=502;static Da=503;static Xa=600;static py=601;static VE=602;static KE=603;static XE=604;static jE=605;static zE=606;static ZE=607;static qE=608;static $E=609;static JE=610;static QE=611;static my=612;static ja=613;static za=650;static $a=651;static Ja=652;static Qa=653;static tc=654;static Za=655;static wc=(t,i,s)=>{this._E=new n.A(5e4),this.No=new n.A(5e4);const e=new h.A(t.read('data'));let r=-1;for(e.jc+=2;e.jc0){h.ol=new Uint8Array(n),h.al=new Uint16Array(n);for(let t=0;t0){h.scripts=new l.ds(o,null);for(let t=0;t0){const e=s.lastIndexOf(',');h.$l[t]=this.t_(i,s.substring(0,e),parseInt(s.substring(e+1),10))}}h.wm=new l.ds(5,null);for(let t=0;t<5;t++){const i=e._A;h.wm[t]=i,0===i.length&&(h.wm[t]=null)}}if(h.type===c.Jl&&(h.fill=1===e.cA),h.type===c.ta||h.type===c.CE){h.oa=1===e.cA;const t=e.cA;s&&(h.font=s[t]),h.aa=1===e.cA}if(h.type===c.ta&&(h.text=e._A,h.ha=e._A),h.type!==c.CE&&h.type!==c.Jl&&h.type!==c.ta||(h.Ql=e.il),h.type!==c.Jl&&h.type!==c.ta||(h.sa=e.il,h.ia=e.il),h.type===c.fa){const t=e._A;if(t.length>0){const s=t.lastIndexOf(',');h.da=this.t_(i,t.substring(0,s),parseInt(t.substring(s+1),10))}const s=e._A;if(s.length>0){const t=s.lastIndexOf(',');h.ua=this.t_(i,s.substring(0,t),parseInt(s.substring(t+1),10))}}if(h.type===c.wa){const t=e.cA;0!==t&&(h.model=this.ma((t-1<<8)+e.cA));const i=e.cA;0!==i&&(h.i_=this.ma((i-1<<8)+e.cA)),h.Il=e.cA,0===h.Il?h.Il=-1:h.Il=(h.Il-1<<8)+e.cA,h.gl=e.cA,0===h.gl?h.gl=-1:h.gl=(h.gl-1<<8)+e.cA,h.zoom=e.rA,h.pa=e.rA,h.Ea=e.rA}if(h.type===c._a){h.Ul=new Int32Array(h.width*h.height),h.Bl=new Int32Array(h.width*h.height),h.oa=1===e.cA;const t=e.cA;s&&(h.font=s[t]),h.aa=1===e.cA,h.Ql=e.il,h.Gl=e.cp,h.Hl=e.cp,h.fm=1===e.cA,h.wm=new l.ds(5,null);for(let t=0;t<5;t++){const i=e._A;h.wm[t]=i,0===i.length&&(h.wm[t]=null)}}h.ea!==c.Im&&h.type!==c.Nl||(h.Mw=e._A,h.action=e._A,h.Sw=e.rA),h.ea!==c.ym&&h.ea!==c.Em&&h.ea!==c._m&&h.ea!==c.na||(h.pm=e._A,0===h.pm.length&&(h.ea===c.ym?h.pm='Ok':h.ea===c.Em||h.ea===c._m?h.pm='Select':h.ea===c.na&&(h.pm='Continue')))}this._E=null,this.No=null};static t_=(t,i,s)=>{const h=o.A.s_(i)<<8n|BigInt(s);if(this._E){const t=this._E.get(h);if(t)return t}let e;try{e=r.A.hc(t,i,s),this._E?.put(h,e)}catch(t){return null}return e};static ma=t=>{if(this.No){const i=this.No.get(BigInt(t));if(i)return i}const i=e.A.model(t);return this.No?.put(BigInt(t),i),i};id=-1;Kd=-1;type=-1;ea=-1;Ml=0;width=0;height=0;am=-1;ol=null;al=null;scripts=null;scroll=0;hide=!1;draggable=!1;fm=!1;dm=!1;Gl=0;Hl=0;Pl=null;Fl=null;$l=null;wm=null;fill=!1;oa=!1;font=null;aa=!1;text=null;ha=null;Ql=0;sa=0;ia=0;da=null;ua=null;model=null;i_=null;Il=-1;gl=-1;zoom=0;pa=0;Ea=0;Mw=null;action=null;Sw=-1;pm=null;ml=null;bl=null;Ll=null;x=0;y=0;Dl=0;Ul=null;Bl=null;_l=0;El=0;ma(t,i,s){let h=this.model;if(s&&(h=this.i_),!h)return null;if(-1===t&&-1===i&&!h.h_)return h;const n=e.A.e_(h,!0,!0,!1);return-1===t&&-1===i||n.Ha(),-1!==t&&n.Wa(t),-1!==i&&n.Wa(i),n.Ya(64,768,-50,-10,-50,!0),n}n_(){if(this.Kd===this.id)return this.x;let t=c.Do[this.Kd];if(!t.ml||!t.bl||!t.Ll)return this.x;let i=t.ml.indexOf(this.id);if(-1===i)return this.x;let s=t.bl[i];for(;t.Kd!==t.id;){const h=c.Do[t.Kd];h.ml&&h.bl&&h.Ll&&(i=h.ml.indexOf(t.id),-1!==i&&(s+=h.bl[i])),t=h}return s}r_(){if(this.Kd===this.id)return this.y;let t=c.Do[this.Kd];if(!t.ml||!t.bl||!t.Ll)return this.y;let i=t.ml.indexOf(this.id);if(-1===i)return this.y;let s=t.Ll[i];for(;t.Kd!==t.id;){const h=c.Do[t.Kd];h.ml&&h.bl&&h.Ll&&(i=h.ml.indexOf(t.id),-1!==i&&(s+=h.Ll[i])),t=h}return s}outline(t){const i=this.n_(),s=this.r_();a.A.Rl(i,s,this.width,this.height,t)}move(t,i){if(this.Kd===this.id)return;this.x=0,this.y=0;const s=c.Do[this.Kd];if(s.ml&&s.bl&&s.Ll){const h=s.ml.indexOf(this.id);-1!==h&&(s.bl[h]=t,s.Ll[h]=i)}}delete(){if(this.Kd===this.id)return;const t=c.Do[this.Kd];if(t.ml&&t.bl&&t.Ll){const i=t.ml.indexOf(this.id);-1!==i&&(t.ml.splice(i,1),t.bl.splice(i,1),t.Ll.splice(i,1))}}}},6333:(t,i,s)=>{s.d(i,{$:()=>h});class h{id;o_=null;constructor(t){this.id=t}l_(t){for(;;){const i=t.cA;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1069),e=s(6333);class n extends e.${static count=0;static Do=[];static wc=t=>{const i=new h.A(t.read('flo.dat'));this.count=i.rA;for(let t=0;t(s>179&&(i=i/2|0),s>192&&(i=i/2|0),s>217&&(i=i/2|0),s>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(s/2|0));static c_=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static f_=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);u_=0;texture=-1;d_=!1;w_=!0;y_=0;A_=0;p_=0;m_=0;I_=0;g_=0;decode(t,i){1===t?(this.u_=i.E_,this.setColor(this.u_)):2===t?this.texture=i.cA:3===t?this.d_=!0:5===t?this.w_=!1:6===t?this.o_=i._A:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,s=(t>>8&255)/256,h=(255&t)/256;let e=i;si&&(r=s),h>r&&(r=h);let o=0,l=0;const a=(e+r)/2;e!==r&&(a<.5&&(l=(r-e)/(r+e)),a>=.5&&(l=(r-e)/(2-r-e)),i===r?o=(s-h)/(r-e):s===r?o=(h-i)/(r-e)+2:h===r&&(o=(i-s)/(r-e)+4)),o/=6,this.y_=256*o|0,this.A_=256*l|0,this.p_=256*a|0,this.A_<0?this.A_=0:this.A_>255&&(this.A_=255),this.p_<0?this.p_=0:this.p_>255&&(this.p_=255),this.m_=a>.5?(1-a)*l*512|0:a*l*512|0,this.m_<1&&(this.m_=1),this.I_=o*this.m_|0;let c=this.y_+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.A_+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.p_+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.g_=n.a_(c,f,u)}}},8317:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(1069),e=s(6333),n=s(8665),r=s(3867);class o extends e.${static count=0;static Do=[];static wc=t=>{const i=new h.A(t.read('idk.dat'));this.count=i.rA;for(let t=0;t=40&&t<50?this.T_[t-40]=i.rA:t>=50&&t<60?this.O_[t-50]=i.rA:t>=60&&t<70?this.C_[t-60]=i.rA:console.log('Error unrecognised config code: ',t)}ma(){if(!this.__)return null;const t=new r.ds(this.__.length,null);for(let i=0;i{s.d(i,{A:()=>c});var h=s(6333),e=s(1069),n=s(2679),r=s(8665),o=s(1023),l=s(6169),a=s(3867);class c extends h.${static count=0;static cache=null;static v_=null;static b_=null;static L_=0;static cu=new n.A(500);static fu=new n.A(30);static wc=t=>{this.v_=new e.A(t.read('loc.dat'));const i=new e.A(t.read('loc.idx'));this.count=i.rA,this.b_=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.b_||!this.v_)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const s=this.cache[i];if(s&&s.id===t)return s}this.L_=(this.L_+1)%10;const i=this.cache[this.L_];return this.v_.jc=this.b_[t],i.id=t,i.reset(),i.l_(this.v_),i.R_||(i.R_=new Int32Array(1)),-1===i.S_&&i.R_&&(i.active=i.R_.length>0&&i.R_[0]===o.A.Ey.id,i.Om&&(i.active=!0)),i};static Ro=()=>{this.cu=null,this.fu=null,this.b_=null,this.cache=null,this.v_=null};__=null;R_=null;name=null;uw=null;T_=null;O_=null;width=1;length=1;qy=!0;$y=!0;active=!1;S_=-1;M_=!1;k_=!1;w_=!1;Il=-1;x_=!1;D_=16;N_=0;P_=0;Om=null;vd=-1;xd=-1;F_=!1;U_=!0;B_=128;G_=128;H_=128;Ty=0;W_=0;Y_=0;V_=0;K_=!1;decode(t,i){if(1===t){const t=i.cA;this.__=new Int32Array(t),this.R_=new Int32Array(t);for(let s=0;s=30&&t<39)this.Om||(this.Om=new a.ds(5,null)),this.Om[t-30]=i._A,'hidden'===this.Om[t-30]?.toLowerCase()&&(this.Om[t-30]=null);else if(40===t){const t=i.cA;this.T_=new Uint16Array(t),this.O_=new Uint16Array(t);for(let s=0;s=this.__.length)return null;let d=this.__[a];if(-1===d)return null;const w=this.F_!==i>3;w&&(d+=65536);let y=c.cu?.get(BigInt(d));y||(y=r.A.model(65535&d),w&&y.Q_(),c.cu?.put(BigInt(d),y));const A=128!==this.B_||128!==this.G_||128!==this.H_,p=0!==this.W_||0!==this.Y_||0!==this.V_;let m=r.A.e_(y,!this.T_,!this.x_,i===l.A.Pd&&-1===o&&!A&&!p);for(-1!==o&&(m.Ha(),m.Wa(o),m.tC=null,m.iC=null);i-- >0;)m.sC();if(this.T_&&this.O_)for(let t=0;t{s.d(i,{A:()=>l});var h=s(6333),e=s(1069),n=s(2679),r=s(8665),o=s(3867);class l extends h.${static count=0;static cache=null;static v_=null;static b_=null;static L_=0;static No=new n.A(30);static wc=t=>{this.v_=new e.A(t.read('npc.dat'));const i=new e.A(t.read('npc.idx'));this.count=i.rA,this.b_=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.b_||!this.v_)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const s=this.cache[i];if(s&&s.id===t)return s}this.L_=(this.L_+1)%20;const i=this.cache[this.L_]=new l(t);return this.v_.jc=this.b_[t],i.l_(this.v_),i};static Ro=()=>{this.No=null,this.b_=null,this.cache=null,this.v_=null};name=null;uw=null;size=1;__=null;C_=null;x_=!1;OI=-1;mI=-1;gI=-1;_I=-1;TI=-1;T_=null;O_=null;Om=null;B_=-1;G_=-1;H_=-1;md=!0;Sm=-1;nC=128;rC=128;decode(t,i){if(1===t){const t=i.cA;this.__=new Uint16Array(t);for(let s=0;s=30&&t<40)this.Om||(this.Om=new o.ds(5,null)),this.Om[t-30]=i._A,'hidden'===this.Om[t-30]?.toLowerCase()&&(this.Om[t-30]=null);else if(40===t){const t=i.cA;this.T_=new Uint16Array(t),this.O_=new Uint16Array(t);for(let s=0;s{s.d(i,{A:()=>u});var h=s(6333),e=s(1069),n=s(2511),r=s(2679),o=s(8665),l=s(4583),a=s(8950),c=s(9298),f=s(3867);class u extends h.${static count=0;static cache=null;static v_=null;static b_=null;static L_=0;static uC=!0;static No=new r.A(50);static uu=new r.A(200);static wc=(t,i)=>{this.uC=i,this.v_=new e.A(t.read('obj.dat'));const s=new e.A(t.read('obj.idx'));this.count=s.rA,this.b_=new Int32Array(this.count);let h=2;for(let t=0;t{if(!this.cache||!this.b_||!this.v_)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const s=this.cache[i];if(s&&s.id===t)return s}this.L_=(this.L_+1)%10;const i=this.cache[this.L_];return this.v_.jc=this.b_[t],i.id=t,i.reset(),i.l_(this.v_),-1!==i.dC&&i.wC(),!this.uC&&i.members&&(i.name='Members Object',i.uw="Login to a members' server to use this object.",i.Om=null,i.um=null),i};static Ro=()=>{this.No=null,this.uu=null,this.b_=null,this.cache=null,this.v_=null};static Wl=(t,i)=>{if(u.uu){let s=u.uu.get(BigInt(t));if(s&&s.Ed!==i&&-1!==s.Ed&&(s.pA(),s=null),s)return s}let s=u.get(t);if(s.yC||(i=-1),s.yC&&s.AC&&i>1){let t=-1;for(let h=0;h<10;h++)i>=s.AC[h]&&0!==s.AC[h]&&(t=s.yC[h]);-1!==t&&(s=u.get(t))}const h=new n.A(32,32),e=l.A.ya,r=l.A.Aa,o=l.A.mc,f=a.A.yc,d=a.A.pC,w=a.A.mC,y=a.A.left,A=a.A.right,p=a.A.top,m=a.A.bottom;l.A.IC=!1,a.A.bind(h.yc,32,32),a.A.fillRect(0,0,32,32,c.A.Zl),l.A.Kg();const I=s.Wy(1),g=l.A.sin[s.vp]*s.Lp>>16,E=l.A.cos[s.vp]*s.Lp>>16;I.ga(0,s.bp,s.gC,s.vp,s.EC,g+(I.eC/2|0)+s._C,E+s._C);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===h.yc[t+32*i]&&(t>0&&h.yc[t+32*i-1]>1||i>0&&h.yc[t+32*(i-1)]>1||t<31&&h.yc[t+32*i+1]>1||i<31&&h.yc[t+32*(i+1)]>1)&&(h.yc[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===h.yc[t+32*i]&&t>0&&i>0&&h.yc[t+32*(i-1)-1]>0&&(h.yc[t+32*i]=3153952);if(-1!==s.dC){const t=this.Wl(s.CC,10),i=t.Xl,h=t.Ed;t.Xl=32,t.Ed=32,t.TC(5,5,22,22),t.Xl=i,t.Ed=h}return u.uu?.put(BigInt(t),h),a.A.bind(f,d,w),a.A.vl(y,p,A,m),l.A.ya=e,l.A.Aa=r,l.A.mc=o,l.A.IC=!0,s.Ca?h.Xl=33:h.Xl=32,h.Ed=i,h};model=0;name=null;uw=null;T_=null;O_=null;Lp=2e3;vp=0;bp=0;gC=0;EC=0;_C=0;OC=!1;vC=-1;Ca=!1;Gy=1;members=!1;Om=null;um=null;bC=-1;LC=-1;RC=0;SC=-1;MC=-1;kC=0;xC=-1;DC=-1;NC=-1;PC=-1;FC=-1;UC=-1;yC=null;AC=null;CC=-1;dC=-1;decode(t,i){if(1===t)this.model=i.rA;else if(2===t)this.name=i._A;else if(3===t)this.uw=i._A;else if(4===t)this.Lp=i.rA;else if(5===t)this.vp=i.rA;else if(6===t)this.bp=i.rA;else if(7===t)this.EC=i.cp,this.EC>32767&&(this.EC-=65536);else if(8===t)this._C=i.cp,this._C>32767&&(this._C-=65536);else if(9===t)this.OC=!0;else if(10===t)this.vC=i.rA;else if(11===t)this.Ca=!0;else if(12===t)this.Gy=i.il;else if(16===t)this.members=!0;else if(23===t)this.bC=i.rA,this.RC=i.lA;else if(24===t)this.LC=i.rA;else if(25===t)this.SC=i.rA,this.kC=i.lA;else if(26===t)this.MC=i.rA;else if(t>=30&&t<35)this.Om||(this.Om=new f.ds(5,null)),this.Om[t-30]=i._A,'hidden'===this.Om[t-30]?.toLowerCase()&&(this.Om[t-30]=null);else if(t>=35&&t<40)this.um||(this.um=new f.ds(5,null)),this.um[t-35]=i._A;else if(40===t){const t=i.cA;this.T_=new Uint16Array(t),this.O_=new Uint16Array(t);for(let s=0;s=100&&t<110&&(this.yC&&this.AC||(this.yC=new Uint16Array(10),this.AC=new Uint16Array(10)),this.yC[t-100]=i.rA,this.AC[t-100]=i.rA)}BC(t){let i=this.bC;if(1===t&&(i=this.SC),-1===i)return null;let s=this.LC,h=this.xC;1===t&&(s=this.MC,h=this.DC);let e=o.A.model(i);if(-1!==s){const t=o.A.model(s);if(-1===h){const i=[e,t];e=o.A.Pa(i,2)}else{const i=[e,t,o.A.model(h)];e=o.A.Pa(i,3)}}if(0===t&&0!==this.RC&&e.translate(this.RC,0,0),1===t&&0!==this.kC&&e.translate(this.kC,0,0),this.T_&&this.O_)for(let t=0;t1){let i=-1;for(let s=0;s<10;s++)t>=this.AC[s]&&0!==this.AC[s]&&(i=this.yC[s]);if(-1!==i)return u.get(i).Wy(1)}if(u.No){const t=u.No.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.T_&&this.O_)for(let t=0;t{s.d(i,{A:()=>r});var h=s(6333),e=s(1069),n=s(6730);class r extends h.${static count=0;static Do=[];static wc=t=>{const i=new e.A(t.read('seq.dat'));this.count=i.rA;for(let t=0;t{s.d(i,{A:()=>l});var h=s(6333),e=s(1069),n=s(1312),r=s(8665),o=s(2679);class l extends h.${static count=0;static Do=[];static No=new o.A(30);static wc=t=>{const i=new e.A(t.read('spotanim.dat'));this.count=i.rA;for(let t=0;t=40&&t<50?this.T_[t-40]=i.rA:t>=50&&t<60?this.O_[t-50]=i.rA:console.log('Error unrecognised spotanim config code: ',t)}ma(){let t=l.No?.get(BigInt(this.id));if(t)return t;t=r.A.model(this.model);for(let i=0;i<6;i++)0!==this.T_[0]&&t.Fa(this.T_[i],this.O_[i]);return l.No?.put(BigInt(this.id),t),t}}},3764:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(6333),e=s(1069);class n extends h.${static count=0;static Do=[];static WC=[];static YC=0;static wc=t=>{const i=new e.A(t.read('varp.dat'));this.count=i.rA;for(let t=0;t{s.d(i,{A:()=>h});class h{static OPEN=0;static zC=1;static ZC=2;static qC=4;static $C=8;static JC=h.zC<<4;static QC=h.ZC<<4;static tT=h.qC<<4;static iT=h.$C<<4;static sT=256;static hT=512;static eT=1024;static nT=2048;static rT=4096;static oT=h.hT<<4;static lT=h.eT<<4;static aT=h.nT<<4;static cT=h.rT<<4;static fT=h.sT<<9;static uT=524288;static dT=2097152;static wT=h.dT|h.uT;static yT=h.sT|h.wT;static Rd=h.ZC|h.yT;static bd=h.$C|h.yT;static Pm=h.ZC|h.qC|h.bd;static Sd=h.QC|h.yT;static Um=h.$C|h.JC|h.Sd;static Ld=h.iT|h.yT;static Fm=h.zC|h.ZC|h.Ld;static Bm=h.QC|h.tT|h.Ld;static AT=16777215}},670:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(9456),e=s(6169),n=s(1023),r=s(4909);class o{static xn=4;static Xn=104;static index=(t,i)=>t*o.Xn+i;offsetX;pT;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.pT=0,this.sizeX=o.Xn,this.sizeZ=o.Xn,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.pT)]|=h.A.dT};iA=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.pT)]&=~h.A.dT};Vy=(t,i,s,n,r,o)=>{let l=h.A.sT;o&&(l|=h.A.fT);const a=t-this.offsetX,c=i-this.pT;if(r===e.A.Fd||r===e.A.Bd){const t=s;s=n,n=t}for(let t=a;t=0&&t=0&&i{let l=h.A.sT;o&&(l|=h.A.fT);const a=t-this.offsetX,c=i-this.pT;if(r===e.A.Fd||r===e.A.Bd){const t=s;s=n,n=t}for(let t=a;t=0&&t=0&&i{const l=t-this.offsetX,a=i-this.pT,c=o?h.A.cT:h.A.iT,f=o?h.A.rT:h.A.$C,u=o?h.A.eT:h.A.ZC,d=o?h.A.lT:h.A.QC,w=o?h.A.hT:h.A.zC,y=o?h.A.oT:h.A.JC,A=o?h.A.nT:h.A.qC,p=o?h.A.aT:h.A.tT;s===n.A.Dd.id?r===e.A.Pd?(this.add(l,a,c),this.add(l-1,a,f)):r===e.A.Fd?(this.add(l,a,u),this.add(l,a+1,d)):r===e.A.Ud?(this.add(l,a,f),this.add(l+1,a,c)):r===e.A.Bd&&(this.add(l,a,d),this.add(l,a-1,u)):s===n.A.gT.id||s===n.A.Gd.id?r===e.A.Pd?(this.add(l,a,w),this.add(l-1,a+1,y)):r===e.A.Fd?(this.add(l,a,A),this.add(l+1,a+1,p)):r===e.A.Ud?(this.add(l,a,y),this.add(l+1,a-1,w)):r===e.A.Bd&&(this.add(l,a,p),this.add(l-1,a-1,A)):s===n.A.Nd.id&&(r===e.A.Pd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):r===e.A.Fd?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):r===e.A.Ud?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):r===e.A.Bd&&(this.add(l,a,d|c),this.add(l,a-1,u),this.add(l-1,a,f))),o&&this.IT(t,i,s,r,!1)};Zy=(t,i,s,r,o)=>{const l=t-this.offsetX,a=i-this.pT,c=o?h.A.cT:h.A.iT,f=o?h.A.rT:h.A.$C,u=o?h.A.eT:h.A.ZC,d=o?h.A.lT:h.A.QC,w=o?h.A.hT:h.A.zC,y=o?h.A.oT:h.A.JC,A=o?h.A.nT:h.A.qC,p=o?h.A.aT:h.A.tT;s===n.A.Dd.id?r===e.A.Pd?(this.remove(l,a,c),this.remove(l-1,a,f)):r===e.A.Fd?(this.remove(l,a,u),this.remove(l,a+1,d)):r===e.A.Ud?(this.remove(l,a,f),this.remove(l+1,a,c)):r===e.A.Bd&&(this.remove(l,a,d),this.remove(l,a-1,u)):s===n.A.gT.id||s===n.A.Gd.id?r===e.A.Pd?(this.remove(l,a,w),this.remove(l-1,a+1,y)):r===e.A.Fd?(this.remove(l,a,A),this.remove(l+1,a+1,p)):r===e.A.Ud?(this.remove(l,a,y),this.remove(l+1,a-1,w)):r===e.A.Bd&&(this.remove(l,a,p),this.remove(l-1,a-1,A)):s===n.A.Nd.id&&(r===e.A.Pd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):r===e.A.Fd?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):r===e.A.Ud?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):r===e.A.Bd&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.Zy(t,i,s,r,!1)};xm=(t,i,s,r,l,a)=>{if(t===s&&i===r)return!0;const c=t-this.offsetX,f=i-this.pT,u=s-this.offsetX,d=r-this.pT,w=o.index(c,f);if(l===n.A.Dd.id){if(a===e.A.Pd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.Sd)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Rd)===h.A.OPEN)return!0}else if(a===e.A.Fd){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.bd)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.Ld)===h.A.OPEN)return!0}else if(a===e.A.Ud){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.Sd)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Rd)===h.A.OPEN)return!0}else if(a===e.A.Bd){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.bd)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.Ld)===h.A.OPEN)return!0}}else if(l===n.A.Nd.id){if(a===e.A.Pd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.Ld)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Rd)===h.A.OPEN)return!0}else if(a===e.A.Fd){if(c===u-1&&f===d&&(this.flags[w]&h.A.bd)===h.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.Rd)===h.A.OPEN)return!0}else if(a===e.A.Ud){if(c===u-1&&f===d&&(this.flags[w]&h.A.bd)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.Sd)===h.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(a===e.A.Bd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.Sd)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.Ld)===h.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===n.A.Wd.id){if(c===u&&f===d+1&&(this.flags[w]&h.A.QC)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.ZC)===h.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.$C)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.iT)===h.A.OPEN)return!0}return!1};Dm=(t,i,s,r,l,a)=>{if(t===s&&i===r)return!0;const c=t-this.offsetX,f=i-this.pT,u=s-this.offsetX,d=r-this.pT,w=o.index(c,f);if(l===n.A.ET.id||l===n.A._T.id){if(l===n.A._T.id&&(a=a+2&3),a===e.A.Pd){if(c===u+1&&f===d&&(this.flags[w]&h.A.iT)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.ZC)===h.A.OPEN)return!0}else if(a===e.A.Fd){if(c===u-1&&f===d&&(this.flags[w]&h.A.$C)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.ZC)===h.A.OPEN)return!0}else if(a===e.A.Ud){if(c===u-1&&f===d&&(this.flags[w]&h.A.$C)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.QC)===h.A.OPEN)return!0}else if(a===e.A.Bd){if(c===u+1&&f===d&&(this.flags[w]&h.A.iT)===h.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&h.A.QC)===h.A.OPEN)return!0}}else if(l===n.A.CT.id){if(c===u&&f===d+1&&(this.flags[w]&h.A.QC)===h.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&h.A.ZC)===h.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&h.A.$C)===h.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&h.A.iT)===h.A.OPEN)return!0}return!1};Nm=(t,i,s,e,n,l,a)=>{const c=s+n-1,f=e+l-1,u=o.index(t-this.offsetX,i-this.pT);return t>=s&&t<=c&&i>=e&&i<=f||(t===s-1&&i>=e&&i<=f&&(this.flags[u]&h.A.$C)===h.A.OPEN&&(a&r.A.Pd)===h.A.OPEN||(t===c+1&&i>=e&&i<=f&&(this.flags[u]&h.A.iT)===h.A.OPEN&&(a&r.A.Ud)===h.A.OPEN||(i===e-1&&t>=s&&t<=c&&(this.flags[u]&h.A.ZC)===h.A.OPEN&&(a&r.A.Bd)===h.A.OPEN||i===f+1&&t>=s&&t<=c&&(this.flags[u]&h.A.QC)===h.A.OPEN&&(a&r.A.Fd)===h.A.OPEN)))};add=(t,i,s)=>{this.flags[o.index(t,i)]|=s};remove=(t,i,s)=>{this.flags[o.index(t,i)]&=h.A.AT-s}}},4909:(t,i,s)=>{s.d(i,{A:()=>h});class h{static Fd=1;static Ud=2;static Bd=4;static Pd=8}},6169:(t,i,s)=>{s.d(i,{A:()=>h});class h{static Pd=0;static Fd=1;static Ud=2;static Bd=3}},5599:(t,i,s)=>{s.d(i,{A:()=>h});class h{static Ky=0;static Xy=1;static zy=2;static Cy=3}},1023:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(5599);class e{static Dd=new e(0,h.A.Ky);static gT=new e(1,h.A.Ky);static Nd=new e(2,h.A.Ky);static Gd=new e(3,h.A.Ky);static tg=new e(4,h.A.Xy);static km=new e(5,h.A.Xy);static ET=new e(6,h.A.Xy);static _T=new e(7,h.A.Xy);static CT=new e(8,h.A.Xy);static Wd=new e(9,h.A.zy);static Ey=new e(10,h.A.zy);static _y=new e(11,h.A.zy);static TT=new e(12,h.A.zy);static OT=new e(13,h.A.zy);static vT=new e(14,h.A.zy);static bT=new e(15,h.A.zy);static LT=new e(16,h.A.zy);static RT=new e(17,h.A.zy);static ST=new e(18,h.A.zy);static MT=new e(19,h.A.zy);static kT=new e(20,h.A.zy);static xT=new e(21,h.A.zy);static Cy=new e(22,h.A.Cy);static values(){return[this.Dd,this.gT,this.RT,this.bT,this.Nd,this.vT,this.Wd,this.Gd,this.Cy,this.TT,this._y,this.ET,this.kT,this.Ey,this.km,this.OT,this._T,this.tg,this.LT,this.CT,this.MT,this.xT,this.ST]}static of(t){const i=this.values();for(let s=0;s{s.d(i,{A:()=>A});var h=s(670),e=s(2164),n=s(1069),r=s(4583),o=s(3045),l=s(5637),a=s(4197),c=s(1312),f=s(1023),u=s(6169),d=s(9298),w=s(5518),y=s(3867);class A{static DT=Int8Array.of(1,2,4,8);static NT=Uint8Array.of(16,32,64,128);static PT=Int8Array.of(1,0,-1,0);static FT=Int8Array.of(0,-1,0,1);static UT=(17*Math.random()|0)-8;static BT=(33*Math.random()|0)-16;static st=!0;static Vp=0;static GT=!1;static HT=(t,i)=>{let s=this.WT(t+45365,i+91923,4)+(this.WT(t+10294,i+37821,2)-128>>1)+(this.WT(t,i,1)-128>>2)-128;return s=35+(.3*s|0),s<10?s=10:s>60&&(s=60),s};static WT=(t,i,s)=>{const h=t/s|0,e=t&s-1,n=i/s|0,r=i&s-1,o=this.YT(h,n),l=this.YT(h+1,n),a=this.YT(h,n+1),c=this.YT(h+1,n+1),f=this.VT(o,l,e,s),u=this.VT(a,c,e,s);return this.VT(f,u,r,s)};static VT=(t,i,s,h)=>{const e=65536-r.A.cos[1024*s/h|0]>>1;return(t*(65536-e)>>16)+(i*e>>16)};static YT=(t,i)=>((this.KT(t-1,i-1)+this.KT(t+1,i-1)+this.KT(t-1,i+1)+this.KT(t+1,i+1))/16|0)+((this.KT(t-1,i)+this.KT(t+1,i)+this.KT(t,i-1)+this.KT(t,i+1))/8|0)+(this.KT(t,i)/4|0);static KT=(t,i)=>{const s=t+57*i,h=BigInt(s<<13^s);return 255&Number((h*(h*h*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static Vy=(t,i,s,h,e,n,r,o,d,w,y)=>{const p=e[y][i][s],m=e[y][i+1][s],I=e[y][i+1][s+1],g=e[y][i][s+1],E=p+m+I+g>>2,_=l.A.get(o);let C=i+(s<<7)+(o<<14)+1073741824|0;_.active||(C+=-2147483648),C|=0;const T=(w<<6)+d<<24>>24;if(d===f.A.Cy.id)h?.XT(_.ma(f.A.Cy.id,w,p,m,I,g,-1),t,i,s,E,C,T),_.qy&&_.active&&r?.mT(i,s),-1!==_.Il&&n.yg(new a.A(o,t,3,i,s,c.A.Do[_.Il],!0));else if(d===f.A.Ey.id||d===f.A._y.id){const e=_.ma(f.A.Ey.id,w,p,m,I,g,-1);if(e){let n,r,o=0;d===f.A._y.id&&(o+=256),w===u.A.Fd||w===u.A.Bd?(n=_.length,r=_.width):(n=_.width,r=_.length),h?.Vy(t,i,s,E,e,null,C,T,n,r,o)}_.qy&&r?.Vy(i,s,_.width,_.length,w,_.$y),-1!==_.Il&&n.yg(new a.A(o,t,2,i,s,c.A.Do[_.Il],!0))}else if(d>=f.A.TT.id)h?.Vy(t,i,s,E,_.ma(d,w,p,m,I,g,-1),null,C,T,1,1,0),_.qy&&r?.Vy(i,s,_.width,_.length,w,_.$y),-1!==_.Il&&n.yg(new a.A(o,t,2,i,s,c.A.Do[_.Il],!0));else if(d===f.A.Dd.id)h?.IT(t,i,s,E,A.DT[w],0,_.ma(f.A.Dd.id,w,p,m,I,g,-1),null,C,T),_.qy&&r?.IT(i,s,d,w,_.$y),-1!==_.Il&&n.yg(new a.A(o,t,0,i,s,c.A.Do[_.Il],!0));else if(d===f.A.gT.id)h?.IT(t,i,s,E,A.NT[w],0,_.ma(f.A.gT.id,w,p,m,I,g,-1),null,C,T),_.qy&&r?.IT(i,s,d,w,_.$y),-1!==_.Il&&n.yg(new a.A(o,t,0,i,s,c.A.Do[_.Il],!0));else if(d===f.A.Nd.id){const e=w+1&3;h?.IT(t,i,s,E,A.DT[w],A.DT[e],_.ma(f.A.Nd.id,w+4,p,m,I,g,-1),_.ma(f.A.Nd.id,e,p,m,I,g,-1),C,T),_.qy&&r?.IT(i,s,d,w,_.$y),-1!==_.Il&&n.yg(new a.A(o,t,0,i,s,c.A.Do[_.Il],!0))}else if(d===f.A.Gd.id)h?.IT(t,i,s,E,A.NT[w],0,_.ma(f.A.Gd.id,w,p,m,I,g,-1),null,C,T),_.qy&&r?.IT(i,s,d,w,_.$y),-1!==_.Il&&n.yg(new a.A(o,t,0,i,s,c.A.Do[_.Il],!0));else if(d===f.A.Wd.id)h?.Vy(t,i,s,E,_.ma(d,w,p,m,I,g,-1),null,C,T,1,1,0),_.qy&&r?.Vy(i,s,_.width,_.length,w,_.$y),-1!==_.Il&&n.yg(new a.A(o,t,2,i,s,c.A.Do[_.Il],!0));else if(d===f.A.tg.id)h?.jT(t,i,s,E,0,0,C,_.ma(f.A.tg.id,u.A.Pd,p,m,I,g,-1),T,512*w,A.DT[w]),-1!==_.Il&&n.yg(new a.A(o,t,1,i,s,c.A.Do[_.Il],!0));else if(d===f.A.km.id){let e=16;if(h){const n=h.Md(t,i,s);n>0&&(e=l.A.get(n>>14&32767).D_)}h?.jT(t,i,s,E,A.PT[w]*e,A.FT[w]*e,C,_.ma(f.A.tg.id,u.A.Pd,p,m,I,g,-1),T,512*w,A.DT[w]),-1!==_.Il&&n.yg(new a.A(o,t,1,i,s,c.A.Do[_.Il],!0))}else d===f.A.ET.id?(h?.jT(t,i,s,E,0,0,C,_.ma(f.A.tg.id,u.A.Pd,p,m,I,g,-1),T,w,256),-1!==_.Il&&n.yg(new a.A(o,t,1,i,s,c.A.Do[_.Il],!0))):d===f.A._T.id?(h?.jT(t,i,s,E,0,0,C,_.ma(f.A.tg.id,u.A.Pd,p,m,I,g,-1),T,w,512),-1!==_.Il&&n.yg(new a.A(o,t,1,i,s,c.A.Do[_.Il],!0))):d===f.A.CT.id&&(h?.jT(t,i,s,E,0,0,C,_.ma(f.A.tg.id,u.A.Pd,p,m,I,g,-1),T,w,768),-1!==_.Il&&n.yg(new a.A(o,t,1,i,s,c.A.Do[_.Il],!0)))};VI;KI;Wn;Yn;zT;ZT;qT;$T;JT;QT;tO;iO;sO;hO;eO;nO;constructor(t,i,s,e){this.VI=t,this.KI=i,this.Wn=s,this.Yn=e,this.zT=new y.rc(h.A.xn,t,i),this.ZT=new y.rc(h.A.xn,t,i),this.qT=new y.rc(h.A.xn,t,i),this.$T=new y.rc(h.A.xn,t,i),this.nO=new y.oc(h.A.xn,t+1,i+1),this.JT=new y.rc(h.A.xn,t+1,i+1),this.QT=new y.Kn(t+1,i+1),this.tO=new Int32Array(i),this.iO=new Int32Array(i),this.sO=new Int32Array(i),this.hO=new Int32Array(i),this.eO=new Int32Array(i)}$p=(t,i)=>{for(let t=0;t=0&&i[h]?.mT(s,e)}A.UT+=(5*Math.random()|0)-2,A.UT<-8?A.UT=-8:A.UT>8&&(A.UT=8),A.BT+=(5*Math.random()|0)-2,A.BT<-16?A.BT=-16:A.BT>16&&(A.BT=16);for(let i=0;i>8;for(let t=1;t>2)+(s[e+1][t]>>3)+(s[e][t-1]>>2)+(s[e][t+1]>>3)+(s[e][t]>>1);this.QT[e][t]=u-d}for(let t=0;t=0&&h0){const i=e.A.Do[s-1];this.tO[t]+=i.I_,this.iO[t]+=i.A_,this.sO[t]+=i.p_,this.hO[t]+=i.m_,n=this.eO[t]++}}const r=s-5;if(r>=0&&r0){const i=e.A.Do[s-1];this.tO[t]-=i.I_,this.iO[t]-=i.A_,this.sO[t]-=i.p_,this.hO[t]-=i.m_,n=this.eO[t]--}}}if(s>=1&&s=0&&f=0&&y=1&&c0||y>0){const p=this.Wn[i][s][c],m=this.Wn[i][s+1][c],I=this.Wn[i][s+1][c+1],g=this.Wn[i][s][c+1],E=this.QT[s][c],_=this.QT[s+1][c],C=this.QT[s+1][c+1],T=this.QT[s][c+1];let O=-1,v=-1;if(f>0){const t=256*h/l|0,i=n/a|0;let s=o/a|0;O=e.A.a_(t,i,s);const r=t+A.UT&255;s+=A.BT,s<0?s=0:s>255&&(s=255),v=e.A.a_(r,i,s)}if(i>0){let t=0!==f||this.qT[i][s][c]===w.A.oO;y>0&&!e.A.Do[y-1].w_&&(t=!1),t&&p===m&&p===I&&p===g&&(this.nO[i][s][c]|=2340)}let b=0;if(-1!==O&&(b=r.A.palette[e.A.c_(v,96)]),0===y)t?.lO(i,s,c,w.A.oO,u.A.Pd,-1,p,m,I,g,e.A.c_(O,E),e.A.c_(O,_),e.A.c_(O,C),e.A.c_(O,T),d.A.Zl,d.A.Zl,d.A.Zl,d.A.Zl,b,d.A.Zl);else{const h=this.qT[i][s][c]+1,n=this.$T[i][s][c],o=e.A.Do[y-1];let l,a,f=o.texture;f>=0?(a=r.A.aO(f),l=-1):o.u_===d.A.Fc?(a=0,l=-2,f=-1):(l=e.A.a_(o.y_,o.A_,o.p_),a=r.A.palette[e.A.f_(o.g_,96)]),t?.lO(i,s,c,h,n,f,p,m,I,g,e.A.c_(O,E),e.A.c_(O,_),e.A.c_(O,C),e.A.c_(O,T),e.A.f_(l,E),e.A.f_(l,_),e.A.f_(l,C),e.A.f_(l,T),b,a)}}}}}}for(let s=1;s0&&(t<<=3,i<<=3,s<<=3);for(let h=0;h<=e;h++)for(let n=0;n<=this.KI;n++)for(let r=0;r<=this.VI;r++){if(this.nO[h][r][n]&t){let i=n,s=n,l=h,a=h;for(;i>0&&this.nO[h][r][i-1]&t;)i--;for(;s0;){for(let h=i;h<=s;h++)if(!(this.nO[l-1][r][h]&t))break t;l--}t:for(;a=8){const h=this.Wn[a][r][i]-240,n=this.Wn[l][r][i];o.A.dO(e,1,128*r,h,128*i,128*r,n,128*s+128);for(let h=l;h<=a;h++)for(let e=i;e<=s;e++)this.nO[h][r][e]&=~t}}if(this.nO[h][r][n]&i){let t=r,s=r,l=h,a=h;for(;t>0&&this.nO[h][t-1][n]&i;)t--;for(;s0;){for(let h=t;h<=s;h++)if(!(this.nO[l-1][h][n]&i))break t;l--}t:for(;a=8){const h=this.Wn[a][t][n]-240,r=this.Wn[l][t][n];o.A.dO(e,2,128*t,h,128*n,128*s+128,r,128*n);for(let h=l;h<=a;h++)for(let e=t;e<=s;e++)this.nO[h][e][n]&=~i}}if(this.nO[h][r][n]&s){let t=r,i=r,l=n,a=n;for(;l>0&&this.nO[h][r][l-1]&s;)l--;for(;a0;){for(let i=l;i<=a;i++)if(!(this.nO[h][t-1][i]&s))break t;t--}t:for(;i=4){const n=this.Wn[h][t][l];o.A.dO(e,4,128*t,n,128*l,128*i+128,n,128*a+128);for(let e=t;e<=i;e++)for(let t=l;t<=a;t++)this.nO[h][e][t]&=~s}}}}}};Zp=(t,i,s,n)=>{let r=0;for(let t=0;t>24;break}for(let e=t;e=0&&t=0&&e{const o=new n.A(new Uint8Array(r));for(let n=0;n=0&&a=0&&c>24,this.$T[n][a][c]=(f-2&3)<<24>>24):f<=81?this.Yn[n][a][c]=f-49<<24>>24:this.zT[n][a][c]=f-81<<24>>24}else for(;f=o.cA,0!==f;){if(1===f){o.cA;break}f<=49&&o.cA}}};qp=(t,i,s,e,r,o)=>{const l=new n.A(new Uint8Array(e));let a=-1;for(;;){const e=l.wO;if(0===e)return;a+=e;let n=0;for(;;){const e=l.wO;if(0===e)break;n+=e-1;const c=63&n,f=n>>6&63,u=n>>12,d=l.cA,w=d>>2,y=3&d,A=f+r,p=c+o;if(A>0&&p>0&&A=0&&(e=s[h]),this.Vy(u,A,p,t,i,e,a,w,y)}}}};Vy=(t,i,s,h,e,n,r,o,d)=>{if(A.st){if(16&this.Yn[t][i][s])return;if(this.rO(t,i,s)!==A.Vp)return}const w=this.Wn[t][i][s],y=this.Wn[t][i+1][s],p=this.Wn[t][i+1][s+1],m=this.Wn[t][i][s+1],I=w+y+p+m>>2,g=l.A.get(r);let E=i+(s<<7)+(r<<14)+1073741824|0;g.active||(E+=-2147483648),E|=0;const _=(d<<6)+o<<24>>24;if(o===f.A.Cy.id)(!A.st||g.active||g.K_)&&(h?.XT(g.ma(f.A.Cy.id,d,w,y,p,m,-1),t,i,s,I,E,_),g.qy&&g.active&&n?.mT(i,s),-1!==g.Il&&e.yg(new a.A(r,t,3,i,s,c.A.Do[g.Il],!0)));else if(o===f.A.Ey.id||o===f.A._y.id){const l=g.ma(f.A.Ey.id,d,w,y,p,m,-1);if(l){let e,n,r=0;if(o===f.A._y.id&&(r+=256),d===u.A.Fd||d===u.A.Bd?(e=g.length,n=g.width):(e=g.width,n=g.length),h?.Vy(t,i,s,I,l,null,E,_,e,n,r)&&g.U_)for(let h=0;h<=e;h++)for(let e=0;e<=n;e++){let n=l.yO/4|0;n>30&&(n=30),n>this.JT[t][i+h][s+e]&&(this.JT[t][i+h][s+e]=n<<24>>24)}}g.qy&&n?.Vy(i,s,g.width,g.length,d,g.$y),-1!==g.Il&&e.yg(new a.A(r,t,2,i,s,c.A.Do[g.Il],!0))}else if(o>=f.A.TT.id)h?.Vy(t,i,s,I,g.ma(o,d,w,y,p,m,-1),null,E,_,1,1,0),o>=f.A.TT.id&&o<=f.A.RT.id&&o!==f.A.OT.id&&t>0&&(this.nO[t][i][s]|=2340),g.qy&&n?.Vy(i,s,g.width,g.length,d,g.$y),-1!==g.Il&&e.yg(new a.A(r,t,2,i,s,c.A.Do[g.Il],!0));else if(o===f.A.Dd.id)h?.IT(t,i,s,I,A.DT[d],0,g.ma(f.A.Dd.id,d,w,y,p,m,-1),null,E,_),d===u.A.Pd?(g.U_&&(this.JT[t][i][s]=50,this.JT[t][i][s+1]=50),g.w_&&(this.nO[t][i][s]|=585)):d===u.A.Fd?(g.U_&&(this.JT[t][i][s+1]=50,this.JT[t][i+1][s+1]=50),g.w_&&(this.nO[t][i][s+1]|=1170)):d===u.A.Ud?(g.U_&&(this.JT[t][i+1][s]=50,this.JT[t][i+1][s+1]=50),g.w_&&(this.nO[t][i+1][s]|=585)):d===u.A.Bd&&(g.U_&&(this.JT[t][i][s]=50,this.JT[t][i+1][s]=50),g.w_&&(this.nO[t][i][s]|=1170)),g.qy&&n?.IT(i,s,o,d,g.$y),-1!==g.Il&&e.yg(new a.A(r,t,0,i,s,c.A.Do[g.Il],!0)),16!==g.D_&&h?.AO(t,i,s,g.D_);else if(o===f.A.gT.id)h?.IT(t,i,s,I,A.NT[d],0,g.ma(f.A.gT.id,d,w,y,p,m,-1),null,E,_),g.U_&&(d===u.A.Pd?this.JT[t][i][s+1]=50:d===u.A.Fd?this.JT[t][i+1][s+1]=50:d===u.A.Ud?this.JT[t][i+1][s]=50:d===u.A.Bd&&(this.JT[t][i][s]=50)),g.qy&&n?.IT(i,s,o,d,g.$y),-1!==g.Il&&e.yg(new a.A(r,t,0,i,s,c.A.Do[g.Il],!0));else if(o===f.A.Nd.id){const l=d+1&3;h?.IT(t,i,s,I,A.DT[d],A.DT[l],g.ma(f.A.Nd.id,d+4,w,y,p,m,-1),g.ma(f.A.Nd.id,l,w,y,p,m,-1),E,_),g.w_&&(d===u.A.Pd?(this.nO[t][i][s]|=265,this.nO[t][i][s+1]|=1170):d===u.A.Fd?(this.nO[t][i][s+1]|=1170,this.nO[t][i+1][s]|=585):d===u.A.Ud?(this.nO[t][i+1][s]|=585,this.nO[t][i][s]|=1170):d===u.A.Bd&&(this.nO[t][i][s]|=1170,this.nO[t][i][s]|=585)),g.qy&&n?.IT(i,s,o,d,g.$y),-1!==g.Il&&e.yg(new a.A(r,t,0,i,s,c.A.Do[g.Il],!0)),16!==g.D_&&h?.AO(t,i,s,g.D_)}else if(o===f.A.Gd.id)h?.IT(t,i,s,I,A.NT[d],0,g.ma(f.A.Gd.id,d,w,y,p,m,-1),null,E,_),g.U_&&(d===u.A.Pd?this.JT[t][i][s+1]=50:d===u.A.Fd?this.JT[t][i+1][s+1]=50:d===u.A.Ud?this.JT[t][i+1][s]=50:d===u.A.Bd&&(this.JT[t][i][s]=50)),g.qy&&n?.IT(i,s,o,d,g.$y),-1!==g.Il&&e.yg(new a.A(r,t,0,i,s,c.A.Do[g.Il],!0));else if(o===f.A.Wd.id)h?.Vy(t,i,s,I,g.ma(o,d,w,y,p,m,-1),null,E,_,1,1,0),g.qy&&n?.Vy(i,s,g.width,g.length,d,g.$y),-1!==g.Il&&e.yg(new a.A(r,t,2,i,s,c.A.Do[g.Il],!0));else if(o===f.A.tg.id)h?.jT(t,i,s,I,0,0,E,g.ma(f.A.tg.id,u.A.Pd,w,y,p,m,-1),_,512*d,A.DT[d]),-1!==g.Il&&e.yg(new a.A(r,t,1,i,s,c.A.Do[g.Il],!0));else if(o===f.A.km.id){let n=16;if(h){const e=h.Md(t,i,s);e>0&&(n=l.A.get(e>>14&32767).D_)}h?.jT(t,i,s,I,A.PT[d]*n,A.FT[d]*n,E,g.ma(f.A.tg.id,u.A.Pd,w,y,p,m,-1),_,512*d,A.DT[d]),-1!==g.Il&&e.yg(new a.A(r,t,1,i,s,c.A.Do[g.Il],!0))}else o===f.A.ET.id?(h?.jT(t,i,s,I,0,0,E,g.ma(f.A.tg.id,u.A.Pd,w,y,p,m,-1),_,d,256),-1!==g.Il&&e.yg(new a.A(r,t,1,i,s,c.A.Do[g.Il],!0))):o===f.A._T.id?(h?.jT(t,i,s,I,0,0,E,g.ma(f.A.tg.id,u.A.Pd,w,y,p,m,-1),_,d,512),-1!==g.Il&&e.yg(new a.A(r,t,1,i,s,c.A.Do[g.Il],!0))):o===f.A.CT.id&&(h?.jT(t,i,s,I,0,0,E,g.ma(f.A.tg.id,u.A.Pd,w,y,p,m,-1),_,d,768),-1!==g.Il&&e.yg(new a.A(r,t,1,i,s,c.A.Do[g.Il],!0)))};rO=(t,i,s)=>8&this.Yn[t][i][s]?0:t<=0||!(2&this.Yn[1][i][s])?t:t-1}},3045:(t,i,s)=>{s.d(i,{A:()=>I});var h=s(4583),e=s(1161),n=s(3795),r=s(8256),o=s(670),l=s(9222),a=s(6855),c=s(7441),f=s(6666),u=s(5748),d=s(3479),w=s(8950),y=s(2771),A=s(5518),p=s(6169),m=s(3867);class I{static pO=new m.mO(8,32,51,51,!1);static IO=new m.ds(100,null);static hd=new Int32Array(o.A.xn);static gO=new m.EO(o.A.xn,500,null);static _O=new m.ds(500,null);static CO=new f.A;static tu=0;static TO=0;static OO=0;static vO=0;static bO=0;static LO=0;static RO=0;static SO=0;static MO=0;static kO=0;static xO=0;static DO=0;static NO=0;static PO=0;static FO=0;static UO=0;static BO=0;static GO=0;static HO=0;static WO=0;static ed=0;static YO=0;static VO=!1;static KO=null;static XO=Uint8Array.of(19,55,38,155,255,110,137,205,76);static jO=Uint8Array.of(160,192,80,96,0,144,80,48,160);static zO=Uint8Array.of(76,8,137,4,0,1,38,2,19);static ZO=Int8Array.of(0,0,2,0,0,2,1,1,0);static qO=Int8Array.of(2,0,0,2,0,0,0,4,4);static $O=Int8Array.of(0,4,4,8,0,0,8,0,0);static JO=Int8Array.of(1,1,0,0,0,8,0,0,8);static QO=Int8Array.of(53,-53,-53,53);static tv=Int8Array.of(-53,-53,53,53);static iv=Int8Array.of(-45,45,45,-45);static sv=Int8Array.of(45,45,-45,-45);static hv=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static ev=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static nv=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static nd=0;static Yl=0;static Vl=0;static Ef=-1;static _f=-1;static st=!0;static init=(t,i,s,e,n)=>{this.TO=0,this.OO=0,this.vO=t,this.bO=i,this.LO=t/2|0,this.RO=i/2|0;const r=new m.mO(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.SO=h.A.sin[t],this.MO=h.A.cos[t],this.kO=h.A.sin[i],this.xO=h.A.cos[i];const o=(t-128)/32|0,l=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const h=128*t,a=128*i;let c=!1;for(let t=-s;t<=e;t+=128)if(this.rv(h,a,n[o]+t)){c=!0;break}r[o][l][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let s=-25;s<25;s++)for(let h=-25;h<25;h++){let e=!1;t:for(let n=-1;n<=1;n++)for(let o=-1;o<=1;o++){if(r[t][i][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t][(i+1)%31][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t+1][i][s+n+25+1][h+o+25+1]){e=!0;break t}if(r[t+1][(i+1)%31][s+n+25+1][h+o+25+1]){e=!0;break t}}this.pO[t][i][s+25][h+25]=e}};static Ro=()=>{this.IO=null,this.hd=null,this.gO=null,this.CO=null,this.pO=null,this._O=null,this.KO=null,console.log('World3D unloaded!')};static dO=(t,i,s,h,e,n,o,l)=>{I.gO[t][I.hd[t]++]=new r.A(s/128|0,n/128|0,e/128|0,l/128|0,i,s,n,e,l,h,o)};static rv=(t,i,s)=>{const h=i*this.kO+t*this.xO>>16,e=i*this.xO-t*this.kO>>16,n=s*this.SO+e*this.MO>>16,r=s*this.MO-e*this.SO>>16;if(n<50||n>3500)return!1;const o=this.LO+((h<<9)/n|0),l=this.RO+((r<<9)/n|0);return o>=this.TO&&o<=this.vO&&l>=this.OO&&l<=this.bO};ov;VI;KI;lv;av;Er;cv;fv;uv;dv=0;wv=0;yv=0;constructor(t,i,s,h){this.ov=s,this.VI=h,this.KI=i,this.av=new m.Cr(s,h,i,null),this.cv=new m.oc(s,h+1,i+1),this.lv=t,this.Er=new m.ds(5e3,null),this.fv=new Int32Array(1e4),this.uv=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.wv=t;for(let i=0;i{const s=this.av[0][t][i];for(let s=0;s<3;s++){this.av[s][t][i]=this.av[s+1][t][i];const h=this.av[s][t][i];h&&h.level--}this.av[0][t][i]||(this.av[0][t][i]=new n.A(0,t,i));const h=this.av[0][t][i];h&&(h.Av=s),this.av[3][t][i]=null};cO=(t,i,s,h)=>{const e=this.av[t][i][s];e&&(e.pv=h)};lO=(t,i,s,h,e,r,o,l,a,c,f,u,w,p,m,I,g,E,_,C)=>{if(h===A.A.oO){for(let h=t;h>=0;h--)this.av[h][i][s]||(this.av[h][i][s]=new n.A(h,i,s));const h=this.av[t][i][s];h&&(h.mv=new d.A(f,u,w,p,-1,_,!1))}else if(h===A.A.Iv){for(let h=t;h>=0;h--)this.av[h][i][s]||(this.av[h][i][s]=new n.A(h,i,s));const h=this.av[t][i][s];h&&(h.mv=new d.A(m,I,g,E,r,C,o===l&&o===a&&o===c))}else{for(let h=t;h>=0;h--)this.av[h][i][s]||(this.av[h][i][s]=new n.A(h,i,s));const d=this.av[t][i][s];d&&(d.gv=new y.A(i,h,I,l,w,e,f,c,C,m,r,E,_,a,g,p,o,s,u))}};XT=(t,i,s,h,e,r,o)=>{this.av[i][s][h]||(this.av[i][s][h]=new n.A(i,s,h));const a=this.av[i][s][h];a&&(a.Ev=new l.A(e,128*s+64,128*h+64,t,r,o))};tA=(t,i,s)=>{const h=this.av[t][i][s];h&&(h.Ev=null)};Yy=(t,i,s,h,e,r,o,l)=>{let a=0;const c=this.av[h][t][i];if(c)for(let t=0;ta&&(a=s)}else this.av[h][t][i]=new n.A(h,t,i);const f=this.av[h][t][i];f&&(f.Tv=new u.A(s,128*t+64,128*i+64,r,o,l,e,a))};By=(t,i,s)=>{const h=this.av[t][i][s];h&&(h.Tv=null)};IT=(t,i,s,h,e,r,o,l,c,f)=>{if(!o&&!l)return;for(let h=t;h>=0;h--)this.av[h][i][s]||(this.av[h][i][s]=new n.A(h,i,s));const u=this.av[t][i][s];u&&(u.Ov=new a.A(h,128*i+64,128*s+64,e,r,o,l,c,f))};Zy=(t,i,s,h)=>{const e=this.av[t][i][s];1===h&&e&&(e.Ov=null)};jT=(t,i,s,h,e,r,o,l,a,f,u)=>{if(!l)return;for(let h=t;h>=0;h--)this.av[h][i][s]||(this.av[h][i][s]=new n.A(h,i,s));const d=this.av[t][i][s];d&&(d.vv=new c.A(h,128*i+e+64,128*s+r+64,u,f,l,o,a))};Jy=(t,i,s)=>{const h=this.av[t][i][s];h&&(h.vv=null)};AO=(t,i,s,h)=>{const e=this.av[t][i][s];if(!e)return;const n=e.vv;if(!n)return;const r=128*i+64,o=128*s+64;n.x=r+((n.x-r)*h/16|0),n.z=o+((n.z-o)*h/16|0)};QI=(t,i,s,h)=>{if(!h)return;const e=this.av[t][i][s];if(!e)return;const n=e.vv;n&&(n.model=h)};hg=(t,i,s,h)=>{if(!h)return;const e=this.av[t][i][s];if(!e)return;const n=e.Ev;n&&(n.model=h)};sg=(t,i,s,h)=>{if(!h)return;const e=this.av[t][i][s];if(!e)return;const n=e.Ov;n&&(n.bv=h)};ig=(t,i,s,h,e)=>{if(!h)return;const n=this.av[s][t][i];if(!n)return;const r=n.Ov;r&&(r.bv=h,r.Lv=e)};Vy=(t,i,s,h,e,n,r,o,l,a,c)=>{if(!e&&!n)return!0;const f=128*i+64*l,u=128*s+64*a;return this.Rv(f,u,h,t,i,s,l,a,e,n,r,o,c,!1)};UI=(t,i,s,h,e,n,r,o,l,a)=>{if(!e&&!n)return!0;let c=i-l,f=h-l,u=i+l,d=h+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Rv(i,h,s,t,c,f,u+1-c,d-f+1,e,n,r,0,o,!0)};HI=(t,i,s,h,e,n,r,o,l,a,c,f)=>!l&&!a||this.Rv(i,h,s,t,e,n,r+1-e,o-n+1,l,a,c,0,f,!0);Qy=(t,i,s)=>{const h=this.av[t][i][s];if(h)for(let t=0;t>29&3)&&e.Mv===i&&e.kv===s)return void this.xv(e)}};JI=(t,i,s,h)=>{if(!h)return;const e=this.av[t][i][s];if(e)for(let t=0;t>29&3))return void(i.model=h)}};hu=()=>{for(let t=0;t{const h=this.av[t][i][s];return h&&h.Ov?h.Ov.Sv:0};jy=(t,i,s)=>{const h=this.av[t][s][i];return h&&h.vv?h.vv.Sv:0};Hd=(t,i,s)=>{const h=this.av[t][i][s];if(!h)return 0;for(let t=0;t>29&3)&&e.Mv===i&&e.kv===s)return e.Sv}return 0};Od=(t,i,s)=>{const h=this.av[t][i][s];return h&&h.Ev?h.Ev.Sv:0};kd=(t,i,s,h)=>{const e=this.av[t][i][s];if(e){if(e.Ov&&e.Ov.Sv===h)return 255&e.Ov.info;if(e.vv&&e.vv.Sv===h)return 255&e.vv.info;if(e.Ev&&e.Ev.Sv===h)return 255&e.Ev.info;for(let t=0;t{const n=i*(0|Math.sqrt(s*s+h*h+e*e))>>8;for(let i=0;i{if(i0){const e=this.av[t][i+1][s-1];e&&e.Ev&&e.Ev.model&&e.Ev.model.Dv&&this.Pv(h,e.Ev.model,128,0,-128,!0)}};Nv=(t,i,s,h,e,n)=>{let r=!0,o=i;const l=i+h,a=s-1,c=s+e;for(let f=t;f<=t+1;f++)if(f!==this.ov){for(let u=o;u<=l;u++)if(!(u<0||u>=this.VI))for(let o=a;o<=c;o++){if(o<0||o>=this.KI||r&&u=s||u===i))continue;const a=this.av[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-h),w=128*(o-s)+64*(1-e),y=((this.lv[f][u][o]+this.lv[f][u+1][o]+this.lv[f][u][o+1]+this.lv[f][u+1][o+1])/4|0)-((this.lv[t][i][s]+this.lv[t][i+1][s]+this.lv[t][i][s+1]+this.lv[t][i+1][s+1])/4|0),A=a.Ov;A&&A.bv&&A.bv.Dv&&this.Pv(n,A.bv,d,y,w,r),A&&A.Lv&&A.Lv.Dv&&this.Pv(n,A.Lv,d,y,w,r);for(let t=0;t{this.yv++;let r=0;const o=i.z_,l=i.j_;if(t.Dv&&t.Hv)for(let n=0;ni.Wv)continue;const u=t.z_[n]-s;if(ui.Vv)continue;const d=t.Z_[n]-e;if(di.Xv)continue;if(i.Dv&&i.Hv)for(let t=0;t{const r=this.av[t][i][s];if(!r)return;const o=r.mv;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)h[e]=t,h[e+1]=t,h[e+2]=t,h[e+3]=t,e+=n;return}const l=r.gv;if(!l)return;const a=l.shape,c=l.angle,f=l.Jv,u=l.Qv,d=I.hv[a],w=I.ev[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(h[e]=u),0!==d[w[y++]]&&(h[e+1]=u),0!==d[w[y++]]&&(h[e+2]=u),0!==d[w[y++]]&&(h[e+3]=u),e+=n;else for(let t=0;t<4;t++)h[e]=0===d[w[y++]]?f:u,h[e+1]=0===d[w[y++]]?f:u,h[e+2]=0===d[w[y++]]?f:u,h[e+3]=0===d[w[y++]]?f:u,e+=n};click=(t,i)=>{I.VO=!0,I.Yl=t,I.Vl=i,I.Ef=-1,I._f=-1};draw=(t,i,s,e,n,r,o)=>{t<0?t=0:t>=128*this.VI&&(t=128*this.VI-1),s<0?s=0:s>=128*this.KI&&(s=128*this.KI-1),I.tu++,I.SO=h.A.sin[r],I.MO=h.A.cos[r],I.kO=h.A.sin[n],I.xO=h.A.cos[n],I.KO=I.pO[(r-128)/32|0][n/64|0],I.DO=t,I.NO=i,I.PO=s,I.FO=t/128|0,I.UO=s/128|0,I.ed=e,I.BO=I.FO-25,I.BO<0&&(I.BO=0),I.HO=I.UO-25,I.HO<0&&(I.HO=0),I.GO=I.FO+25,I.GO>this.VI&&(I.GO=this.VI),I.WO=I.UO+25,I.WO>this.KI&&(I.WO=this.KI),this.tb(),I.YO=0;for(let t=this.wv;t=2e3)?(r.visible=!0,r.update=!0,r.ib=r._v>0,I.YO++):(r.visible=!1,r.update=!1,r.sb=0))}}for(let t=this.wv;t=I.GO))for(let t=-25;t<=0;t++){const e=I.UO+t,n=I.UO-t;let r;if(s>=I.BO&&(e>=I.HO&&(r=i[s][e],r&&r.visible&&this.hb(r,!0,o)),n=I.HO&&(r=i[h][e],r&&r.visible&&this.hb(r,!0,o)),n=I.GO))for(let t=-25;t<=0;t++){const e=I.UO+t,n=I.UO-t;let r;if(s>=I.BO&&(e>=I.HO&&(r=i[s][e],r&&r.visible&&this.hb(r,!1,o)),n=I.HO&&(r=i[h][e],r&&r.visible&&this.hb(r,!1,o)),n{if(!c&&!f)return!1;for(let t=r;t=this.VI||i>=this.KI)return!1;const s=this.av[h][t][i];if(s&&s._v>=5)return!1}const A=new e.A(h,s,t,i,c,f,w,r,r+l-1,o,o+a-1,u,d);for(let t=r;tr&&(s|=1),to&&(s+=8),i=0;s--)this.av[s][t][i]||(this.av[s][t][i]=new n.A(s,t,i));const e=this.av[h][t][i];e&&(e.Cv[e._v]=A,e.eb[e._v]=s,e.nb|=s,e._v++)}return y&&(this.Er[this.dv++]=A),!0};xv=t=>{for(let i=t.Mv;i<=t.Uv;i++)for(let s=t.kv;s<=t.Bv;s++){const h=this.av[t.level][i][s];if(h){for(let i=0;i{const t=I.hd[I.ed],i=I.gO[I.ed];I.nd=0;for(let s=0;s=0&&h<=50){e=t.YI+25-I.UO,e<0&&(e=0),n=t.KI+25-I.UO,n>50&&(n=50);let i=!1;for(;e<=n;)if(I.KO&&I.KO[h][e++]){i=!0;break}if(i){if(r=I.DO-t.Yv,r>32)t.mode=1;else{if(r>=-32)continue;t.mode=2,r=-r}t.rb=(t.Kv-I.PO<<8)/r|0,t.ob=(t.Xv-I.PO<<8)/r|0,t.lb=(t.Wv-I.NO<<8)/r|0,t.ab=(t.eC-I.NO<<8)/r|0,I._O[I.nd++]=t}}}else if(2===t.type){if(h=t.YI+25-I.UO,h>=0&&h<=50){e=t.WI+25-I.FO,e<0&&(e=0),n=t.VI+25-I.FO,n>50&&(n=50);let i=!1;for(;e<=n;)if(I.KO&&I.KO[e++][h]){i=!0;break}if(i){if(r=I.PO-t.Kv,r>32)t.mode=3;else{if(r>=-32)continue;t.mode=4,r=-r}t.cb=(t.Yv-I.DO<<8)/r|0,t.fb=(t.Vv-I.DO<<8)/r|0,t.lb=(t.Wv-I.NO<<8)/r|0,t.ab=(t.eC-I.NO<<8)/r|0,I._O[I.nd++]=t}}}else if(4===t.type&&(h=t.Wv-I.NO,h>128&&(e=t.YI+25-I.UO,e<0&&(e=0),n=t.KI+25-I.UO,n>50&&(n=50),e<=n))){let i=t.WI+25-I.FO;i<0&&(i=0),r=t.VI+25-I.FO,r>50&&(r=50);let s=!1;t:for(let t=i;t<=r;t++)for(let i=e;i<=n;i++)if(I.KO&&I.KO[t][i]){s=!0;break t}s&&(t.mode=5,t.cb=(t.Yv-I.DO<<8)/h|0,t.fb=(t.Vv-I.DO<<8)/h|0,t.rb=(t.Kv-I.PO<<8)/h|0,t.ob=(t.Xv-I.PO<<8)/h|0,I._O[I.nd++]=t)}}};hb=(t,i,s)=>{for(I.CO.yg(t);;){let t;do{if(t=I.CO.ub(),!t)return}while(!t.update);const h=t.x,e=t.z,n=t.level,r=t.wb,o=this.av[n];if(t.visible){if(i){if(n>0){const t=this.av[n-1][h][e];if(t&&t.update)continue}if(h<=I.FO&&h>I.BO){const i=o[h-1][e];if(i&&i.update&&(i.visible||!(1&t.nb)))continue}if(h>=I.FO&&hI.HO){const i=o[h][e-1];if(i&&i.update&&(i.visible||!(8&t.nb)))continue}if(e>=I.UO&&ee&&(a+=6),c=I.XO[a],t.Ib=I.zO[a]),f&&(f.gb&I.jO[a]?16===f.gb?(t.sb=3,t.Eb=I.ZO[a],t._b=3-t.Eb):32===f.gb?(t.sb=6,t.Eb=I.qO[a],t._b=6-t.Eb):64===f.gb?(t.sb=12,t.Eb=I.$O[a],t._b=12-t.Eb):(t.sb=9,t.Eb=I.JO[a],t._b=9-t.Eb):t.sb=0,f.gb&c&&!this.Cb(r,h,e,f.gb)&&f.bv?.draw(0,I.SO,I.MO,I.kO,I.xO,f.x-I.DO,f.y-I.NO,f.z-I.PO,f.Sv),f.Tb&c&&!this.Cb(r,h,e,f.Tb)&&f.Lv?.draw(0,I.SO,I.MO,I.kO,I.xO,f.x-I.DO,f.y-I.NO,f.z-I.PO,f.Sv)),u&&!this.visible(r,h,e,u.model.eC))if(u.type&c)u.model.draw(u.angle,I.SO,I.MO,I.kO,I.xO,u.x-I.DO,u.y-I.NO,u.z-I.PO,u.Sv);else if(768&u.type){const t=u.x-I.DO,i=u.y-I.NO,s=u.z-I.PO,h=u.angle;let e,n;if(e=h===p.A.Fd||h===p.A.Ud?-t:t,n=h===p.A.Ud||h===p.A.Bd?-s:s,256&u.type&&ne){const e=t+I.iv[h],n=s+I.sv[h];u.model.draw(512*h+1280&2047,I.SO,I.MO,I.kO,I.xO,e,i,n,u.Sv)}}if(l){const i=t.Ev;i&&i.model?.draw(0,I.SO,I.MO,I.kO,I.xO,i.x-I.DO,i.y-I.NO,i.z-I.PO,i.Sv);const s=t.Tv;s&&0===s.offset&&(s.Ob&&s.Ob.draw(0,I.SO,I.MO,I.kO,I.xO,s.x-I.DO,s.y-I.NO,s.z-I.PO,s.Sv),s.vb&&s.vb.draw(0,I.SO,I.MO,I.kO,I.xO,s.x-I.DO,s.y-I.NO,s.z-I.PO,s.Sv),s.bb&&s.bb.draw(0,I.SO,I.MO,I.kO,I.xO,s.x-I.DO,s.y-I.NO,s.z-I.PO,s.Sv))}const d=t.nb;if(0!==d){if(hI.FO&&1&d){const t=o[h-1][e];t&&t.update&&I.CO.yg(t)}if(e>I.UO&&8&d){const t=o[h][e-1];t&&t.update&&I.CO.yg(t)}}}if(0!==t.sb){let i=!0;for(let s=0;si.Mv&&(n+=1),si.kv&&(n+=8),hh&&(h=e);const r=I.UO-i.kv,l=i.Bv-I.UO;i.Lb=l>r?h+l:h+r}for(;;){let t=-50,i=-1;for(let s=0;st&&(t=h.Lb,i=s))}if(-1===i)break;const l=I.IO[i];if(l){l.tu=I.tu;let t=l.model;t||(t=l.mb?.draw(s)??null),t&&!this.Rb(r,l.Mv,l.Uv,l.kv,l.Bv,t.eC)&&t.draw(l.BI,I.SO,I.MO,I.kO,I.xO,l.x-I.DO,l.y-I.NO,l.z-I.PO,l.Sv);for(let t=l.Mv;t<=l.Uv;t++)for(let i=l.kv;i<=l.Bv;i++){const s=o[t][i];s&&(0!==s.sb?I.CO.yg(s):t===h&&i===e||!s.update||I.CO.yg(s))}}}if(t.ib)continue}if(!t.update||0!==t.sb)continue;if(h<=I.FO&&h>I.BO){const t=o[h-1][e];if(t&&t.update)continue}if(h>=I.FO&&hI.HO){const t=o[h][e-1];if(t&&t.update)continue}if(e>=I.UO&&e=n){const n=t+I.QO[e],r=h+I.tv[e];i.model.draw(512*e+256,I.SO,I.MO,I.kO,I.xO,n,s,r,i.Sv)}if(512&i.type&&r<=n){const n=t+I.iv[e],r=h+I.sv[e];i.model.draw(512*e+1280&2047,I.SO,I.MO,I.kO,I.xO,n,s,r,i.Sv)}}const s=t.Ov;s&&(s.Tb&t.Ib&&!this.Cb(r,h,e,s.Tb)&&s.Lv?.draw(0,I.SO,I.MO,I.kO,I.xO,s.x-I.DO,s.y-I.NO,s.z-I.PO,s.Sv),s.gb&t.Ib&&!this.Cb(r,h,e,s.gb)&&s.bv?.draw(0,I.SO,I.MO,I.kO,I.xO,s.x-I.DO,s.y-I.NO,s.z-I.PO,s.Sv))}if(nI.FO){const t=o[h-1][e];t&&t.update&&I.CO.yg(t)}if(e>I.UO){const t=o[h][e-1];t&&t.update&&I.CO.yg(t)}}};Ab=(t,i,s,e,n,r,o,l)=>{let a,c,f,u,d=a=(s<<7)-I.DO,y=c=(e<<7)-I.PO,A=f=d+128,p=u=y+128,m=this.lv[i][s][e]-I.NO,g=this.lv[i][s+1][e]-I.NO,E=this.lv[i][s+1][e+1]-I.NO,_=this.lv[i][s][e+1]-I.NO,C=y*o+d*l>>16;if(y=y*l-d*o>>16,d=C,C=m*r-y*n>>16,y=m*n+y*r>>16,m=C,y<50)return;if(C=c*o+A*l>>16,c=c*l-A*o>>16,A=C,C=g*r-c*n>>16,c=g*n+c*r>>16,g=C,c<50)return;if(C=p*o+f*l>>16,p=p*l-f*o>>16,f=C,C=E*r-p*n>>16,p=E*n+p*r>>16,E=C,p<50)return;if(C=u*o+a*l>>16,u=u*l-a*o>>16,a=C,C=_*r-u*n>>16,u=_*n+u*r>>16,_=C,u<50)return;const T=h.A.ya+((d<<9)/y|0),O=h.A.Aa+((m<<9)/y|0),v=h.A.ya+((A<<9)/c|0),b=h.A.Aa+((g<<9)/c|0),L=h.A.ya+((f<<9)/p|0),R=h.A.Aa+((E<<9)/p|0),S=h.A.ya+((a<<9)/u|0),M=h.A.Aa+((_<<9)/u|0);if(h.A.alpha=0,(L-S)*(b-M)-(R-M)*(v-S)>0)if(h.A.Sb=L<0||S<0||v<0||L>w.A.Mb||S>w.A.Mb||v>w.A.Mb,I.VO&&this.kb(I.Yl,I.Vl,R,M,b,L,S,v)&&(I.Ef=s,I._f=e),-1===t.xb)12345678!==t.Db&&h.A.Nb(L,S,v,R,M,b,t.Db,t.Pb,t.Fb);else if(I.st){const i=I.nv[t.xb];h.A.Nb(L,S,v,R,M,b,this.Ub(i,t.Db),this.Ub(i,t.Pb),this.Ub(i,t.Fb))}else t.flat?h.A.Bb(L,S,v,R,M,b,t.Db,t.Pb,t.Fb,d,m,y,A,a,g,_,c,u,t.xb):h.A.Bb(L,S,v,R,M,b,t.Db,t.Pb,t.Fb,f,E,p,a,A,_,g,u,c,t.xb);if(!((T-v)*(M-b)-(O-b)*(S-v)<=0))if(h.A.Sb=T<0||v<0||S<0||T>w.A.Mb||v>w.A.Mb||S>w.A.Mb,I.VO&&this.kb(I.Yl,I.Vl,O,b,M,T,v,S)&&(I.Ef=s,I._f=e),-1!==t.xb){if(!I.st)return void h.A.Bb(T,v,S,O,b,M,t.Gb,t.Fb,t.Pb,d,m,y,A,a,g,_,c,u,t.xb);const i=I.nv[t.xb];h.A.Nb(T,v,S,O,b,M,this.Ub(i,t.Gb),this.Ub(i,t.Fb),this.Ub(i,t.Pb))}else 12345678!==t.Gb&&h.A.Nb(T,v,S,O,b,M,t.Gb,t.Fb,t.Pb)};pb=(t,i,s,e,n,r,o)=>{let l=s.z_.length;for(let t=0;t>16;if(a=a*o-i*r>>16,i=c,c=l*n-a*e>>16,a=l*e+a*n>>16,l=c,a<50)return;s.Hb&&(y.A.Wb[t]=i,y.A.Yb[t]=l,y.A.Vb[t]=a),y.A.Kb[t]=h.A.ya+((i<<9)/a|0),y.A.Xb[t]=h.A.Aa+((l<<9)/a|0)}h.A.alpha=0,l=s.jb.length;for(let e=0;e0)if(h.A.Sb=l<0||a<0||c<0||l>w.A.Mb||a>w.A.Mb||c>w.A.Mb,I.VO&&this.kb(I.Yl,I.Vl,f,u,d,l,a,c)&&(I.Ef=t,I._f=i),s.Hb&&-1!==s.Hb[e])if(I.st){const t=I.nv[s.Hb[e]];h.A.Nb(l,a,c,f,u,d,this.Ub(t,s.qb[e]),this.Ub(t,s.$b[e]),this.Ub(t,s.Jb[e]))}else s.flat?h.A.Bb(l,a,c,f,u,d,s.qb[e],s.$b[e],s.Jb[e],y.A.Wb[0],y.A.Yb[0],y.A.Vb[0],y.A.Wb[1],y.A.Wb[3],y.A.Yb[1],y.A.Yb[3],y.A.Vb[1],y.A.Vb[3],s.Hb[e]):h.A.Bb(l,a,c,f,u,d,s.qb[e],s.$b[e],s.Jb[e],y.A.Wb[n],y.A.Yb[n],y.A.Vb[n],y.A.Wb[r],y.A.Wb[o],y.A.Yb[r],y.A.Yb[o],y.A.Vb[r],y.A.Vb[o],s.Hb[e]);else 12345678!==s.qb[e]&&h.A.Nb(l,a,c,f,u,d,s.qb[e],s.$b[e],s.Jb[e])}};yb=(t,i,s)=>{const h=this.cv[t][i][s];if(h===-I.tu)return!1;if(h===I.tu)return!0;{const h=i<<7,e=s<<7;return this.Qb(h+1,this.lv[t][i][s],e+1)&&this.Qb(h+128-1,this.lv[t][i+1][s],e+1)&&this.Qb(h+128-1,this.lv[t][i+1][s+1],e+128-1)&&this.Qb(h+1,this.lv[t][i][s+1],e+128-1)?(this.cv[t][i][s]=I.tu,!0):(this.cv[t][i][s]=-I.tu,!1)}};Cb=(t,i,s,h)=>{if(!this.yb(t,i,s))return!1;const e=i<<7,n=s<<7,r=this.lv[t][i][s]-1,o=r-120,l=r-230,a=r-238;if(h<16){if(1===h){if(e>I.DO){if(!this.Qb(e,r,n))return!1;if(!this.Qb(e,r,n+128))return!1}if(t>0){if(!this.Qb(e,o,n))return!1;if(!this.Qb(e,o,n+128))return!1}return!!this.Qb(e,l,n)&&this.Qb(e,l,n+128)}if(2===h){if(n0){if(!this.Qb(e,o,n+128))return!1;if(!this.Qb(e+128,o,n+128))return!1}return!!this.Qb(e,l,n+128)&&this.Qb(e+128,l,n+128)}if(4===h){if(e0){if(!this.Qb(e+128,o,n))return!1;if(!this.Qb(e+128,o,n+128))return!1}return!!this.Qb(e+128,l,n)&&this.Qb(e+128,l,n+128)}if(8===h){if(n>I.PO){if(!this.Qb(e,r,n))return!1;if(!this.Qb(e+128,r,n))return!1}if(t>0){if(!this.Qb(e,o,n))return!1;if(!this.Qb(e+128,o,n))return!1}return!!this.Qb(e,l,n)&&this.Qb(e+128,l,n)}}return!!this.Qb(e+64,a,n+64)&&(16===h?this.Qb(e,l,n+128):32===h?this.Qb(e+128,l,n+128):64===h?this.Qb(e+128,l,n):128===h?this.Qb(e,l,n):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,s,h)=>{if(this.yb(t,i,s)){const e=i<<7,n=s<<7;return this.Qb(e+1,this.lv[t][i][s]-h,n+1)&&this.Qb(e+128-1,this.lv[t][i+1][s]-h,n+1)&&this.Qb(e+128-1,this.lv[t][i+1][s+1]-h,n+128-1)&&this.Qb(e+1,this.lv[t][i][s+1]-h,n+128-1)}return!1};Rb=(t,i,s,h,e,n)=>{let r,o;if(i!==s||h!==e){for(r=i;r<=s;r++)for(o=h;o<=e;o++)if(this.cv[t][r][o]===-I.tu)return!1;o=1+(i<<7);const l=2+(h<<7),a=this.lv[t][i][h]-n;if(!this.Qb(o,a,l))return!1;const c=(s<<7)-1;if(!this.Qb(c,a,l))return!1;const f=(e<<7)-1;return!!this.Qb(o,a,f)&&this.Qb(c,a,f)}return!!this.yb(t,i,h)&&(r=i<<7,o=h<<7,this.Qb(r+1,this.lv[t][i][h]-n,o+1)&&this.Qb(r+128-1,this.lv[t][i+1][h]-n,o+1)&&this.Qb(r+128-1,this.lv[t][i+1][h+1]-n,o+128-1)&&this.Qb(r+1,this.lv[t][i][h+1]-n,o+128-1))};Qb=(t,i,s)=>{for(let h=0;h0){const t=e.Kv+(e.rb*h>>8),n=e.Xv+(e.ob*h>>8),r=e.Wv+(e.lb*h>>8),o=e.eC+(e.ab*h>>8);if(s>=t&&s<=n&&i>=r&&i<=o)return!0}}else if(2===e.mode){const h=t-e.Yv;if(h>0){const t=e.Kv+(e.rb*h>>8),n=e.Xv+(e.ob*h>>8),r=e.Wv+(e.lb*h>>8),o=e.eC+(e.ab*h>>8);if(s>=t&&s<=n&&i>=r&&i<=o)return!0}}else if(3===e.mode){const h=e.Kv-s;if(h>0){const s=e.Yv+(e.cb*h>>8),n=e.Vv+(e.fb*h>>8),r=e.Wv+(e.lb*h>>8),o=e.eC+(e.ab*h>>8);if(t>=s&&t<=n&&i>=r&&i<=o)return!0}}else if(4===e.mode){const h=s-e.Kv;if(h>0){const s=e.Yv+(e.cb*h>>8),n=e.Vv+(e.fb*h>>8),r=e.Wv+(e.lb*h>>8),o=e.eC+(e.ab*h>>8);if(t>=s&&t<=n&&i>=r&&i<=o)return!0}}else if(5===e.mode){const h=i-e.Wv;if(h>0){const i=e.Yv+(e.cb*h>>8),n=e.Vv+(e.fb*h>>8),r=e.Kv+(e.rb*h>>8),o=e.Xv+(e.ob*h>>8);if(t>=i&&t<=n&&s>=r&&s<=o)return!0}}}return!1};kb=(t,i,s,h,e,n,r,o)=>{if(is&&i>h&&i>e)return!1;if(tn&&t>r&&t>o)return!1;const l=(i-h)*(o-r)-(t-r)*(e-h);return((i-s)*(r-n)-(t-n)*(h-s))*l>0&&l*((i-e)*(n-o)-(t-o)*(s-e))>0};Ub=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{}},4197:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{tm;$I;Jp;Qp;index;qI;_l;El;constructor(t,i,s,h,e,n,r){super(),this.tm=i,this.$I=s,this.Jp=h,this.Qp=e,this.index=t,this.qI=n,r&&-1!==n.Tl&&this.qI.delay?(this._l=Math.random()*this.qI.Cl|0,this.El=Math.random()*this.qI.delay[this._l]|0):(this._l=-1,this.El=0)}}},8412:(t,i,s)=>{s.d(i,{A:()=>o});var h=s(9418),e=s(8665),n=s(8738),r=s(1312);class o extends h.A{static Du=2;static Pu=4;static Uu=8;static Bu=16;static ju=32;static Vu=64;static Gu=128;type=null;draw(t){if(!this.type)return null;if(-1===this.Ku||-1===this.oI)return this.oC();const i=this.oC();if(!i)return null;const s=n.A.Do[this.Ku],h=e.A.e_(s.ma(),!0,!s.x_,!1);h.translate(-this.nI,0,0),h.Ha(),s.qI&&s.qI.frames&&h.Wa(s.qI.frames[this.oI]),h.tC=null,h.iC=null,128===s.nC&&128===s.rC||h.scale(s.nC,s.rC,s.nC),h.Ya(64+s.N_,850+s.P_,-30,-50,-30,!0);const r=[i,h],o=e.A.tL(r,2);return 1===this.type.size&&(o.fC=!0),o}isVisible(){return null!==this.type}oC(){if(!this.type)return null;if(this.Nu>=0&&0===this.sI){const t=r.A.Do[this.Nu].frames;if(t){const i=t[this.tI];let s=-1;if(this.xI>=0&&this.xI!==this.Ga){const t=r.A.Do[this.xI].frames;t&&(s=t[this.ag])}return this.type.oC(i,s,r.A.Do[this.Nu].ug)}}let t=-1;if(this.xI>=0){const i=r.A.Do[this.xI].frames;i&&(t=i[this.ag])}const i=this.type.oC(t,-1,null);return i?(this.height=i.eC,i):null}}},3606:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{index;count;constructor(t,i){super(),this.index=t,this.count=i}}},9418:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(7121),e=s(1312),n=s(3867);class r extends h.A{x=0;z=0;BI=0;GI=!1;size=1;Ga=-1;og=-1;pI=-1;II=-1;EI=-1;CI=-1;wg=-1;pu=null;_u=100;gu=0;Eu=0;bu=0;vu=0;Cu=-1e3;Tu=0;Ou=0;Fu=-1;hI=0;eI=0;xI=-1;ag=0;lg=0;Nu=-1;tI=0;iI=0;sI=0;Qm=0;Ku=-1;oI=0;lI=0;rI=0;nI=0;aI=0;fI=0;cI=0;uI=0;Lu=0;Ru=0;dI=0;tu=0;height=0;rg=0;pathLength=0;Tf=new Int32Array(10);Of=new Int32Array(10);dg=new n.ds(10,!1);ng=0;Mu=-1;ku=-1;Hu=-1;Wu=-1;move(t,i,s){if(-1!==this.Nu&&e.A.Do[this.Nu].priority<=1&&(this.Nu=-1),!t){const t=i-this.Tf[0],h=s-this.Of[0];if(t>=-8&&t<=8&&h>=-8&&h<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.Tf[t]=this.Tf[t-1],this.Of[t]=this.Of[t-1],this.dg[t]=this.dg[t-1];return this.Tf[0]=i,this.Of[0]=s,void(this.dg[0]=!1)}}this.pathLength=0,this.ng=0,this.Tf[0]=i,this.Of[0]=s,this.x=128*this.Tf[0]+64*this.size,this.z=128*this.Of[0]+64*this.size}step(t,i){let s=this.Tf[0],h=this.Of[0];0===i?(s--,h++):1===i?h++:2===i?(s++,h++):3===i?s--:4===i?s++:5===i?(s--,h--):6===i?h--:7===i&&(s++,h--),-1!==this.Nu&&e.A.Do[this.Nu].priority<=1&&(this.Nu=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.Tf[t]=this.Tf[t-1],this.Of[t]=this.Of[t-1],this.dg[t]=this.dg[t-1];this.Tf[0]=s,this.Of[0]=h,this.dg[0]=t}}},8268:(t,i,s)=>{s.d(i,{A:()=>d});var h=s(9418),e=s(8665),n=s(2679),r=s(8738),o=s(1312),l=s(8317),a=s(1302),c=s(3819),f=s(3867),u=s(9298);class d extends h.A{static xu=1;static Du=2;static Pu=4;static Uu=8;static Bu=16;static Gu=32;static Yu=64;static $m=128;static Vu=256;static Xu=512;static Ba=[u.A.iL,u.A.sL,u.A.hL,u.A.eL,u.A.nL,u.A.rL,u.A.oL,u.A.lL,u.A.aL,u.A.cL,u.A.fL,u.A.uL,u.A.dL,u.A.wL,u.A.yL,u.A.pL];static Ua=[[u.A.mL,u.A.IL,u.A.gL,u.A.EL,u.A._L,u.A.CL,u.A.TL,u.A.OL,u.A.vL,u.A.bL,u.A.LL,u.A.RL],[u.A.SL,u.A.ML,u.A.kL,u.A.xL,u.A.DL,u.A.NL,u.A.PL,u.A.FL,u.A.UL,u.A.BL,u.A.HL,u.A.WL,u.A.YL,u.A.VL,u.A.KL,u.A.XL],[u.A.XL-1,u.A.SL+1,u.A.ML,u.A.kL,u.A.xL,u.A.DL,u.A.NL,u.A.PL,u.A.FL,u.A.UL,u.A.BL,u.A.HL,u.A.WL,u.A.YL,u.A.VL,u.A.KL],[u.A.jL,u.A.zL,u.A.ZL,u.A.qL,u.A.$L,u.A.JL],[u.A.QL,u.A.tR,u.A.iR,u.A.sR,u.A.hR,u.A.eR,u.A.nR,u.A.rR]];static No=new n.A(200);name=null;visible=!1;oR=0;Au=0;lR=new Uint16Array(12);aR=new Uint16Array(5);ic=0;cR=0n;y=0;NI=0;FI=0;Ag=0;mg=0;pg=0;DI=null;WI=0;YI=0;VI=0;KI=0;st=!1;draw(t){if(!this.visible)return null;let i=this.oC();if(this.height=i.eC,i.fC=!0,this.st)return i;if(-1!==this.Ku&&-1!==this.oI){const t=r.A.Do[this.Ku],s=e.A.e_(t.ma(),!0,!t.x_,!1);s.translate(-this.nI,0,0),s.Ha(),t.qI&&t.qI.frames&&s.Wa(t.qI.frames[this.oI]),s.tC=null,s.iC=null,128===t.nC&&128===t.rC||s.scale(t.nC,t.rC,t.nC),s.Ya(t.N_+64,t.P_+850,-30,-50,-30,!0);const h=[i,s];i=e.A.tL(h,2)}if(this.DI&&(t>=this.FI&&(this.DI=null),t>=this.NI&&t=d.Ua[i].length)&&(s=0),this.aR[i]=s}this.Ga=t.rA,65535===this.Ga&&(this.Ga=-1),this.og=t.rA,65535===this.og&&(this.og=-1),this.pI=t.rA,65535===this.pI&&(this.pI=-1),this.II=t.rA,65535===this.II&&(this.II=-1),this.EI=t.rA,65535===this.EI&&(this.EI=-1),this.CI=t.rA,65535===this.CI&&(this.CI=-1),this.wg=t.rA,65535===this.wg&&(this.wg=-1),this.name=c.A.ka(c.A.xa(t.zc)),this.ic=t.cA,this.visible=!0,this.cR=0n;for(let t=0;t<12;t++)this.cR<<=0x4n,this.lR[t]>=256&&(this.cR+=BigInt(this.lR[t])-256n);this.lR[0]>=256&&(this.cR+=BigInt(this.lR[0])-256n>>4n),this.lR[1]>=256&&(this.cR+=BigInt(this.lR[1])-256n>>8n);for(let t=0;t<5;t++)this.cR<<=0x3n,this.cR+=BigInt(this.aR[t]);this.cR<<=0x1n,this.cR+=BigInt(this.oR)}IA(){if(!this.visible)return null;const t=new f.ds(12,null);let i=0;for(let s=0;s<12;s++){const h=this.lR[s];if(h>=256&&h<512&&(t[i++]=l.A.Do[h-256].IA()),h>=512){const s=a.A.get(h-512).IA(this.oR);s&&(t[i++]=s)}}const s=e.A.Pa(t,i);for(let t=0;t<5;t++)0!==this.aR[t]&&(s.Fa(d.Ua[t][0],d.Ua[t][this.aR[t]]),1===t&&s.Fa(d.Ba[0],d.Ba[this.aR[t]]));return s}oC(){let t=this.cR,i=-1,s=-1,h=-1,n=-1;if(this.Nu>=0&&0===this.sI){const e=o.A.Do[this.Nu];if(e.frames&&(i=e.frames[this.tI]),this.xI>=0&&this.xI!==this.Ga){const t=o.A.Do[this.xI].frames;t&&(s=t[this.ag])}e.GC>=0&&(h=e.GC,t+=BigInt(h-this.lR[5])<<8n),e.HC>=0&&(n=e.HC,t+=BigInt(n-this.lR[3])<<16n)}else if(this.xI>=0){const t=o.A.Do[this.xI].frames;t&&(i=t[this.ag])}let r=d.No?.get(t);if(!r){const i=new f.ds(12,null);let s=0;for(let t=0;t<12;t++){let e=this.lR[t];if(n>=0&&3===t&&(e=n),h>=0&&5===t&&(e=h),e>=256&&e<512){const t=l.A.Do[e-256].ma();t&&(i[s++]=t)}if(e>=512){const t=a.A.get(e-512).BC(this.oR);t&&(i[s++]=t)}}r=e.A.Pa(i,s);for(let t=0;t<5;t++)0!==this.aR[t]&&(r.Fa(d.Ua[t][0],d.Ua[t][this.aR[t]]),1===t&&r.Fa(d.Ba[0],d.Ba[this.aR[t]]));r.Ha(),r.Ya(64,850,-30,-50,-30,!0),d.No?.put(t,r)}if(this.st)return r;const c=e.A.lC(r,!0);return-1!==i&&-1!==s?c.aC(i,s,o.A.Do[this.Nu].ug):-1!==i&&c.Wa(i),c.cC(),c.tC=null,c.iC=null,c}}},254:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8738),e=s(7121),n=s(8665);class r extends e.A{fR;level;uR;dR;wR;offsetY;jI;XI;yR;arc;target;mobile=!1;x=0;z=0;y=0;velocityX=0;AR=0;pR=0;velocityY=0;mR=0;BI=0;pitch=0;_l=0;El=0;constructor(t,i,s,e,n,r,o,l,a,c,f){super(),this.fR=h.A.Do[t],this.level=i,this.uR=s,this.dR=n,this.wR=e,this.jI=r,this.XI=o,this.yR=l,this.arc=a,this.target=c,this.offsetY=f}zI(t,i,s,h){if(!this.mobile){const i=t-this.uR,h=s-this.dR,e=Math.sqrt(i*i+h*h);this.x=this.uR+i*this.arc/e,this.z=this.dR+h*this.arc/e,this.y=this.wR}const e=this.XI+1-h;this.velocityX=(t-this.x)/e,this.AR=(s-this.z)/e,this.pR=Math.sqrt(this.velocityX*this.velocityX+this.AR*this.AR),this.mobile||(this.velocityY=-this.pR*Math.tan(.02454369*this.yR)),this.mR=2*(i-this.y-this.velocityY*e)/(e*e)}update(t){if(this.mobile=!0,this.x+=this.velocityX*t,this.z+=this.AR*t,this.y+=this.velocityY*t+.5*this.mR*t*t,this.velocityY+=this.mR*t,this.BI=325.949*Math.atan2(this.velocityX,this.AR)+1024&2047,this.pitch=325.949*Math.atan2(this.velocityY,this.pR)&2047,this.fR.qI&&this.fR.qI.delay)for(this.El+=t;this.El>this.fR.qI.delay[this._l];)this.El-=this.fR.qI.delay[this._l]+1,this._l++,this._l>=this.fR.qI.Cl&&(this._l=0)}draw(){const t=this.fR.ma(),i=n.A.e_(t,!0,!this.fR.x_,!1);return this.fR.qI&&this.fR.qI.frames&&(i.Ha(),i.Wa(this.fR.qI.frames[this._l]),i.tC=null,i.iC=null),128===this.fR.nC&&128===this.fR.rC||i.scale(this.fR.nC,this.fR.rC,this.fR.nC),i.IR(this.pitch),i.Ya(64+this.fR.N_,850+this.fR.P_,-30,-50,-30,!0),i}}},7628:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(7121),e=s(8738),n=s(8665);class r extends h.A{type;level;x;z;y;jI;ZI=!1;_l=0;El=0;constructor(t,i,s,h,n,r,o){super(),this.type=e.A.Do[t],this.level=i,this.x=s,this.z=h,this.y=n,this.jI=r+o}update(t){if(this.type.qI&&this.type.qI.delay)for(this.El+=t;this.El>this.type.qI.delay[this._l];)this.El-=this.type.qI.delay[this._l]+1,this._l++,this._l>=this.type.qI.Cl&&(this._l=0,this.ZI=!0)}draw(){const t=this.type.ma(),i=n.A.e_(t,!0,!this.type.x_,!1);return!this.ZI&&this.type.qI&&this.type.qI.frames&&(i.Ha(),i.Wa(this.type.qI.frames[this._l]),i.tC=null,i.iC=null),128===this.type.nC&&128===this.type.rC||i.scale(this.type.nC,this.type.rC,this.type.nC),0!==this.type.orientation&&(90===this.type.orientation?i.sC():180===this.type.orientation?(i.sC(),i.sC()):270===this.type.orientation&&(i.sC(),i.sC(),i.sC())),i.Ya(64+this.type.N_,850+this.type.P_,-30,-50,-30,!0),i}}},9222:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;model;Sv;info;constructor(t,i,s,h,e,n){this.y=t,this.x=i,this.z=s,this.model=h,this.Sv=e,this.info=n}}},1161:(t,i,s)=>{s.d(i,{A:()=>h});class h{level;y;x;z;model;mb;BI;Mv;Uv;kv;Bv;Sv;info;Lb=0;tu=0;constructor(t,i,s,h,e,n,r,o,l,a,c,f,u){this.level=t,this.y=i,this.x=s,this.z=h,this.model=e,this.mb=n,this.BI=r,this.Mv=o,this.Uv=l,this.kv=a,this.Bv=c,this.Sv=f,this.info=u}}},5327:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{dp;Kd;x;z;im;angle;shape;XI;constructor(t,i,s,h,e,n,r,o){super(),this.dp=t,this.Kd=i,this.x=s,this.z=h,this.im=e,this.angle=n,this.shape=r,this.XI=o}}},2630:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{dp;Kd;x;z;im;angle;shape;wp;yp;Ap;constructor(t,i,s,h,e,n,r,o,l,a){super(),this.dp=t,this.Kd=i,this.x=s,this.z=h,this.im=e,this.angle=n,this.shape=r,this.wp=o,this.yp=l,this.Ap=a}}},5748:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;bb;vb;Ob;Sv;offset;constructor(t,i,s,h,e,n,r,o){this.y=t,this.x=i,this.z=s,this.bb=h,this.vb=e,this.Ob=n,this.Sv=r,this.offset=o}}},8256:(t,i,s)=>{s.d(i,{A:()=>h});class h{WI;VI;YI;KI;type;Yv;Vv;Kv;Xv;Wv;eC;mode=0;cb=0;fb=0;rb=0;ob=0;lb=0;ab=0;constructor(t,i,s,h,e,n,r,o,l,a,c){this.WI=t,this.VI=i,this.YI=s,this.KI=h,this.type=e,this.Yv=n,this.Vv=r,this.Kv=o,this.Xv=l,this.Wv=a,this.eC=c}}},3795:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1982),e=s(3867);class n extends h.A{level;x;z;wb;Cv;eb;mv=null;gv=null;Ov=null;vv=null;Ev=null;Tv=null;Av=null;_v=0;nb=0;pv=0;visible=!1;update=!1;ib=!1;sb=0;Eb=0;_b=0;Ib=0;constructor(t,i,s){super(),this.wb=this.level=t,this.x=i,this.z=s,this.Cv=new e.ds(5,null),this.eb=new Int32Array(5)}}},2771:(t,i,s)=>{s.d(i,{A:()=>h});class h{static Kb=new Int32Array(6);static Xb=new Int32Array(6);static Wb=new Int32Array(6);static Yb=new Int32Array(6);static Vb=new Int32Array(6);static gR=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static ER=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static _R=128;static CR=this._R/2|0;static TR=this._R/4|0;static OR=3*this._R/4|0;z_;q_;Z_;qb;$b;Jb;jb;zb;Zb;Hb;flat;shape;angle;Jv;Qv;constructor(t,i,s,e,n,r,o,l,a,c,f,u,d,w,y,A,p,m,I){this.flat=!(p!==e||p!==w||p!==l),this.shape=i,this.angle=r,this.Jv=d,this.Qv=a;const g=h.gR[i],E=g.length;this.z_=new Int32Array(E),this.q_=new Int32Array(E),this.Z_=new Int32Array(E);const _=new Int32Array(E),C=new Int32Array(E),T=t*h._R,O=m*h._R;for(let t=0;t8&&E<=12&&(E=9+(E-r-9&3)),E>12&&E<=16&&(E=13+(E-r-13&3)),1===E?(i=T,a=O,f=p,d=o,m=c):2===E?(i=T+h.CR,a=O,f=p+e>>1,d=o+I>>1,m=c+s>>1):3===E?(i=T+h._R,a=O,f=e,d=I,m=s):4===E?(i=T+h._R,a=O+h.CR,f=e+w>>1,d=I+n>>1,m=s+y>>1):5===E?(i=T+h._R,a=O+h._R,f=w,d=n,m=y):6===E?(i=T+h.CR,a=O+h._R,f=w+l>>1,d=n+A>>1,m=y+u>>1):7===E?(i=T,a=O+h._R,f=l,d=A,m=u):8===E?(i=T,a=O+h.CR,f=l+p>>1,d=A+o>>1,m=u+c>>1):9===E?(i=T+h.CR,a=O+h.TR,f=p+e>>1,d=o+I>>1,m=c+s>>1):10===E?(i=T+h.OR,a=O+h.CR,f=e+w>>1,d=I+n>>1,m=s+y>>1):11===E?(i=T+h.CR,a=O+h.OR,f=w+l>>1,d=n+A>>1,m=y+u>>1):12===E?(i=T+h.TR,a=O+h.CR,f=l+p>>1,d=A+o>>1,m=u+c>>1):13===E?(i=T+h.TR,a=O+h.TR,f=p,d=o,m=c):14===E?(i=T+h.OR,a=O+h.TR,f=e,d=I,m=s):15===E?(i=T+h.OR,a=O+h.OR,f=w,d=n,m=y):(i=T+h.TR,a=O+h.OR,f=l,d=A,m=u),this.z_[t]=i,this.q_[t]=f,this.Z_[t]=a,_[t]=d,C[t]=m}const v=h.ER[i],b=v.length/4|0;this.jb=new Int32Array(b),this.zb=new Int32Array(b),this.Zb=new Int32Array(b),this.qb=new Int32Array(b),this.$b=new Int32Array(b),this.Jb=new Int32Array(b),this.Hb=-1!==f?new Int32Array(b):null;let L=0;for(let t=0;t{s.d(i,{A:()=>h});class h{static oO=0;static Iv=1;static vR=2;static bR=3;static LR=4;static RR=5;static CR=6;static TR=7;static OR=8;static SR=9;static MR=10;static kR=11}},3479:(t,i,s)=>{s.d(i,{A:()=>h});class h{Gb;Fb;Db;Pb;xb;color;flat;constructor(t,i,s,h,e,n,r){this.Gb=t,this.Fb=i,this.Db=s,this.Pb=h,this.xb=e,this.color=n,this.flat=r}}},6855:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;gb;Tb;bv;Lv;Sv;info;constructor(t,i,s,h,e,n,r,o,l){this.y=t,this.x=i,this.z=s,this.gb=h,this.Tb=e,this.bv=n,this.Lv=r,this.Sv=o,this.info=l}}},7441:(t,i,s)=>{s.d(i,{A:()=>h});class h{y;x;z;type;angle;model;Sv;info;constructor(t,i,s,h,e,n,r,o){this.y=t,this.x=i,this.z=s,this.type=h,this.angle=e,this.model=n,this.Sv=r,this.info=o}}},7536:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e{xR;DR;constructor(t){this.DR=[],this.xR=t;for(let i=0;i{s.d(i,{A:()=>e});var h=s(1982);class e extends h.A{NR;PR;constructor(){super(),this.NR=this,this.PR=this}FR(){this.PR&&this.NR&&(this.PR.NR=this.NR,this.NR.PR=this.PR,this.NR=null,this.PR=null)}}},3819:(t,i,s)=>{s.d(i,{A:()=>h});class h{static UR=['_','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','0','1','2','3','4','5','6','7','8','9'];static Id=t=>{t=t.trim();let i=0n;for(let s=0;s=65&&h<=90?i+=BigInt(h+1-65):h>=97&&h<=122?i+=BigInt(h+1-97):h>=48&&h<=57&&(i+=BigInt(h+27-48))}return i};static xa=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const s=Array(12);for(;0n!==t;){const h=t;t/=37n,s[11-i++]=this.UR[Number(h-37n*t)]}return s.slice(12-i).join('')};static Ly=t=>{const i=[...t.toLowerCase()];let s=!0;for(let t=0;t='a'&&h<='z'&&(i[t]=h.toUpperCase(),s=!1),'.'!==h&&'!'!==h||(s=!0)}return i.join('')};static Vc=t=>{let i='';for(let s=0;s(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static ka=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static s_=t=>{const i=t.toUpperCase();let s=0n;for(let t=0;t>56n)&0xffffffffffffffn;return s}}},6666:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1982);class e{BR;cursor=null;constructor(){const t=new h.A;t.next=t,t.Rm=t,this.BR=t}yg(t){t.Rm&&t.pA(),t.Rm=this.BR.Rm,t.next=this.BR,t.Rm&&(t.Rm.next=t),t.next.Rm=t}Hy(t){t.Rm&&t.pA(),t.Rm=this.BR,t.next=this.BR.next,t.Rm.next=t,t.next&&(t.next.Rm=t)}ub(){const t=this.BR.next;return t===this.BR?null:(t?.pA(),t)}head(){const t=this.BR.next;return t===this.BR?(this.cursor=null,null):(this.cursor=t?.next||null,t)}Lm(){const t=this.BR.Rm;return t===this.BR?(this.cursor=null,null):(this.cursor=t?.Rm||null,t)}next(){const t=this.cursor;return t===this.BR?(this.cursor=null,null):(this.cursor=t?.next||null,t)}Rm(){const t=this.cursor;return t===this.BR?(this.cursor=null,null):(this.cursor=t?.Rm||null,t)}clear(){for(;;){const t=this.BR.next;if(t===this.BR)return;t?.pA()}}}},1982:(t,i,s)=>{s.d(i,{A:()=>h});class h{key;next;Rm;constructor(){this.key=0n,this.next=this,this.Rm=this}pA(){this.Rm&&this.next&&(this.Rm.next=this.next,this.next.Rm=this.Rm,this.next=null,this.Rm=null)}}},2679:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(2512),e=s(7536);class n{GR;HR;history;available;constructor(t){this.GR=t,this.available=t,this.HR=new e.A(1024),this.history=new h.A}get(t){const i=this.HR.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.pA(),t?.FR()}else this.available--;this.HR.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.pA(),t.FR()):this.available=this.GR}}},2512:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(4474);class e{head;constructor(){this.head=new h.A}push(t){t.PR&&t.FR(),t.PR=this.head.PR,t.NR=this.head,t.PR&&(t.PR.NR=t),t.NR.PR=t}pop(){const t=this.head.NR;return t===this.head?null:(t?.FR(),t)}}},8534:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1069),e=s(3867);class n{static Do=[];static wc=t=>{const i=new h.A(t.read('base_head.dat')),s=new h.A(t.read('base_type.dat')),r=new h.A(t.read('base_label.dat')),o=i.rA;i.jc+=2;for(let t=0;t{s.d(i,{A:()=>n});var h=s(8534),e=s(1069);class n{static Do=[];static wc=t=>{const i=new e.A(t.read('frame_head.dat')),s=new e.A(t.read('frame_tran1.dat')),r=new e.A(t.read('frame_tran2.dat')),o=new e.A(t.read('frame_del.dat')),l=i.rA;i.jc+=2;const a=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){a[A]=i,c[A]=0,f[A]=0,u[A]=0,A++;break}a[A]=t;let s=0;3===d.types[a[A]]&&(s=128),c[A]=1&i?r.YR:s,f[A]=2&i?r.YR:s,u[A]=4&i?r.YR:s,y=t,A++}}e.length=A,e.VR=new Int32Array(A),e.x=new Int32Array(A),e.y=new Int32Array(A),e.z=new Int32Array(A);for(let t=0;t{s.d(i,{Vg:()=>h,el:()=>e,KR:()=>o,XR:()=>r,jR:()=>n});const h=document.getElementById('canvas'),e=h.getContext('2d',{willReadFrequently:!0}),n=document.createElement('canvas'),r=document.createElement('img'),o=n.getContext('2d',{willReadFrequently:!0})},9298:(t,i,s)=>{s.d(i,{A:()=>h});class h{static RED=16711680;static GREEN=65280;static BLUE=255;static ql=16776960;static Pc=65535;static Fc=16711935;static Sl=16777215;static Zl=0;static zR=16748608;static dd=8388608;static ud=128;static ZR=16756736;static qR=16740352;static $R=16723968;static JR=12648192;static QR=8453888;static tS=4259584;static bc=9179409;static Vd=6116423;static fl=2301979;static ul=5063219;static wl=7759444;static Al=3353893;static wd=8388736;static yd=13350793;static zu=Int32Array.of(h.ql,h.RED,h.GREEN,h.Pc,h.Fc,h.Sl);static mL=6798;static IL=107;static gL=10283;static EL=16;static _L=4797;static CL=7744;static TL=5799;static OL=4634;static vL=33697;static bL=22433;static LL=2983;static RL=54193;static SL=8741;static ML=12;static kL=64030;static xL=43162;static DL=7735;static NL=8404;static PL=1701;static FL=38430;static UL=24094;static BL=10153;static HL=56621;static WL=4783;static YL=1341;static VL=16578;static KL=35003;static XL=25239;static iL=9104;static sL=10275;static hL=7595;static eL=3610;static nL=7975;static rL=8526;static oL=918;static lL=38802;static aL=24466;static cL=10145;static fL=58654;static uL=5027;static dL=1457;static wL=16565;static yL=34991;static pL=25486;static jL=4626;static zL=11146;static ZL=6439;static qL=12;static $L=4758;static JL=10270;static rR=4574;static QL=4550;static tR=4537;static iR=5681;static sR=5673;static hR=5790;static eR=6806;static nR=8076}},8950:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(4474);class e extends h.A{static yc=new Int32Array;static pC=0;static mC=0;static top=0;static bottom=0;static left=0;static right=0;static Mb=0;static iS=0;static sS=0;static bind=(t,i,s)=>{this.yc=t,this.pC=i,this.mC=s,this.vl(0,0,i,s)};static qu=()=>{this.left=0,this.top=0,this.right=this.pC,this.bottom=this.mC,this.Mb=this.right-1,this.iS=this.right/2|0};static vl=(t,i,s,h)=>{t<0&&(t=0),i<0&&(i=0),s>this.pC&&(s=this.pC),h>this.mC&&(h=this.mC),this.top=i,this.bottom=h,this.left=t,this.right=s,this.Mb=this.right-1,this.iS=this.right/2|0,this.sS=this.bottom/2|0};static clear=()=>{const t=this.pC*this.mC;for(let i=0;i{this.yl(t,i,e,s),this.yl(t,i+h-1,e,s),this.dl(t,i,e,h),this.dl(t+s-1,i,e,h)};static yl=(t,i,s,h)=>{if(i=this.bottom)return;tthis.right&&(h=this.right-t);const e=t+i*this.pC;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(h=this.bottom-i);const e=t+i*this.pC;for(let t=0;t{const n=Math.abs(s-t),r=Math.abs(h-i),o=t=this.left&&t=this.top&&i-r&&(a-=r,t+=o),s{tthis.right&&(s=this.right-t),i+h>this.bottom&&(h=this.bottom-i);const n=this.pC-s;let r=t+i*this.pC;for(let t=-h;t<0;t++){for(let t=-s;t<0;t++)this.yc[r++]=e;r+=n}};static hS(t,i,s,h,e,n){tthis.right&&(s=this.right-t),i+h>this.bottom&&(h=this.bottom-i);const r=256-n,o=(e>>16&255)*n,l=(e>>8&255)*n,a=(255&e)*n,c=this.pC-s;let f=t+i*this.pC;for(let t=0;t>16&255)*r>>8<<16)+(l+(this.yc[f]>>8&255)*r>>8<<8)+(a+(255&this.yc[f])*r>>8);this.yc[f++]=t}f+=c}}static eS(t,i,s,h,e){const n=256-e,r=(h>>16&255)*e,o=(h>>8&255)*e,l=(255&h)*e;let a=i-s;a<0&&(a=0);let c=i+s;c>=this.mC&&(c=this.mC-1);for(let h=a;h<=c;h++){const e=h-i,a=0|Math.sqrt(s*s-e*e);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.pC&&(f=this.pC-1);let u=c+h*this.pC;for(let t=c;t<=f;t++){const t=(r+(this.yc[u]>>16&255)*n>>8<<16)+(o+(this.yc[u]>>8&255)*n>>8<<8)+(l+(255&this.yc[u])*n>>8);this.yc[u++]=t}}}static nS=(t,i,s)=>{t=this.right||i=this.bottom||(this.yc[t+i*this.pC]=s)}}},4583:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8950),e=s(1673),n=s(3867);class r extends h.A{static st=!1;static rS=new Int32Array(512);static oS=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static gg=new n.ds(50,null);static lS=0;static mc=new Int32Array;static ya=0;static Aa=0;static IC=!0;static Sb=!1;static alpha=0;static aS=null;static cS=new n.ds(50,null);static fS=0;static tu=0;static Ig=new Int32Array(50);static uS=new n.ds(50,null);static dS=!1;static wS=new n.ds(50,!1);static yS=new Int32Array(50);static{for(let t=1;t<512;t++)this.rS[t]=32768/t|0;for(let t=1;t<2048;t++)this.oS[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static Ro=()=>{this.rS=null,this.rS=null,this.sin=null,this.cos=null,this.mc=null,this.gg=null,this.wS=null,this.yS=null,this.aS=null,this.cS=null,this.Ig=null,this.palette=null,this.uS=null,console.log('Draw3D unloaded!')};static Kg=()=>{this.mc=new Int32Array(h.A.mC);for(let t=0;t{this.mc=new Int32Array(i);for(let s=0;s{this.aS=null,this.cS.fill(null)};static fc=t=>{this.lS=0;for(let i=0;i<50;i++)try{this.gg[i]=e.A.hc(t,i.toString()),this.st&&128===this.gg[i]?.Xl?this.gg[i]?.AS():this.gg[i]?.TC(),this.lS++}catch(t){}};static aO=t=>{if(0!==this.yS[t])return this.yS[t];const i=this.uS[t];if(!i)return 0;let s=0,h=0,e=0;const n=i.length;for(let t=0;t>16&255,h+=i[t]>>8&255,e+=255&i[t];let r=(s/n<<16)+(h/n<<8)+(e/n|0);return r=this.pS(r,1.4),0===r&&(r=1),this.yS[t]=r,r};static uc=t=>{const i=t+.03*Math.random()-.015;let s=0;for(let t=0;t<512;t++){const h=(t/8|0)/64+.0078125,e=(7&t)/8+.0625;for(let t=0;t<128;t++){const n=t/128;let r=n,o=n,l=n;if(0!==e){let t;t=n<.5?n*(e+1):n+e-n*e;const i=2*n-t;let s=h+.3333333333333333;s>1&&s--;let a=h-.3333333333333333;a<0&&a++,r=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,o=6*h<1?i+6*(t-i)*h:2*h<1?t:3*h<2?i+(t-i)*(.6666666666666666-h)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*r|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[s++]=this.pS(a,i)}}for(let t=0;t<50;t++){const s=this.gg[t];if(!s)continue;const h=s.palette;this.uS[t]=new Int32Array(h.length);for(let s=0;s{const s=(t>>16)/256,h=(t>>8&255)/256,e=(255&t)/256;return((256*Math.pow(s,i)|0)<<16)+((256*Math.pow(h,i)|0)<<8)+(256*Math.pow(e,i)|0)};static dc=t=>{this.aS||(this.fS=t,this.st?this.aS=new n.Kn(t,16384):this.aS=new n.Kn(t,65536),this.cS.fill(null))};static Nb=(t,i,s,e,n,o,l,a,c)=>{let f=0,u=0;n!==e&&(f=(i-t<<16)/(n-e)|0,u=(a-l<<15)/(n-e)|0);let d=0,w=0;o!==n&&(d=(s-i<<16)/(o-n)|0,w=(c-a<<15)/(o-n)|0);let y=0,A=0;if(o!==e&&(y=(t-s<<16)/(e-o)|0,A=(l-c<<15)/(e-o)|0),e<=n&&e<=o){if(eh.A.bottom&&(n=h.A.bottom),o>h.A.bottom&&(o=h.A.bottom),nd)for(o-=n,n-=e,e=r.mc[e];;){if(--n<0)for(;;){if(--o<0)return;this.mS(s>>16,i>>16,c>>7,a>>7,h.A.yc,e,0),s+=y,i+=d,c+=A,a+=w,e+=h.A.pC}this.mS(s>>16,t>>16,c>>7,l>>7,h.A.yc,e,0),s+=y,t+=f,c+=A,l+=u,e+=h.A.pC}else for(o-=n,n-=e,e=r.mc[e];;){if(--n<0)for(;;){if(--o<0)return;this.mS(i>>16,s>>16,a>>7,c>>7,h.A.yc,e,0),s+=y,i+=d,c+=A,a+=w,e+=h.A.pC}this.mS(t>>16,s>>16,l>>7,c>>7,h.A.yc,e,0),s+=y,t+=f,c+=A,l+=u,e+=h.A.pC}else if(i=t<<=16,a=l<<=15,e<0&&(i-=y*e,t-=f*e,a-=A*e,l-=u*e,e=0),s<<=16,c<<=15,o<0&&(s-=d*o,c-=w*o,o=0),e!==o&&yf)for(n-=o,o-=e,e=r.mc[e];;){if(--o<0)for(;;){if(--n<0)return;this.mS(s>>16,t>>16,c>>7,l>>7,h.A.yc,e,0),s+=d,t+=f,c+=w,l+=u,e+=h.A.pC}this.mS(i>>16,t>>16,a>>7,l>>7,h.A.yc,e,0),i+=y,t+=f,a+=A,l+=u,e+=h.A.pC}else for(n-=o,o-=e,e=r.mc[e];;){if(--o<0)for(;;){if(--n<0)return;this.mS(t>>16,s>>16,l>>7,c>>7,h.A.yc,e,0),s+=d,t+=f,c+=w,l+=u,e+=h.A.pC}this.mS(t>>16,i>>16,l>>7,a>>7,h.A.yc,e,0),i+=y,t+=f,a+=A,l+=u,e+=h.A.pC}}else if(n<=o){if(nh.A.bottom&&(o=h.A.bottom),e>h.A.bottom&&(e=h.A.bottom),oy)for(e-=o,o-=n,n=r.mc[n];;){if(--o<0)for(;;){if(--e<0)return;this.mS(t>>16,s>>16,l>>7,c>>7,h.A.yc,n,0),t+=f,s+=y,l+=u,c+=A,n+=h.A.pC}this.mS(t>>16,i>>16,l>>7,a>>7,h.A.yc,n,0),t+=f,i+=d,l+=u,a+=w,n+=h.A.pC}else for(e-=o,o-=n,n=r.mc[n];;){if(--o<0)for(;;){if(--e<0)return;this.mS(s>>16,t>>16,c>>7,l>>7,h.A.yc,n,0),t+=f,s+=y,l+=u,c+=A,n+=h.A.pC}this.mS(i>>16,t>>16,a>>7,l>>7,h.A.yc,n,0),t+=f,i+=d,l+=u,a+=w,n+=h.A.pC}else if(s=i<<=16,c=a<<=15,n<0&&(s-=f*n,i-=d*n,c-=u*n,a-=w*n,n=0),t<<=16,l<<=15,e<0&&(t-=y*e,l-=A*e,e=0),o-=e,e-=n,n=r.mc[n],f>16,i>>16,l>>7,a>>7,h.A.yc,n,0),t+=y,i+=d,l+=A,a+=w,n+=h.A.pC}this.mS(s>>16,i>>16,c>>7,a>>7,h.A.yc,n,0),s+=f,i+=d,c+=u,a+=w,n+=h.A.pC}else for(;;){if(--e<0)for(;;){if(--o<0)return;this.mS(i>>16,t>>16,a>>7,l>>7,h.A.yc,n,0),t+=y,i+=d,l+=A,a+=w,n+=h.A.pC}this.mS(i>>16,s>>16,a>>7,c>>7,h.A.yc,n,0),s+=f,i+=d,c+=u,a+=w,n+=h.A.pC}}else if(oh.A.bottom&&(e=h.A.bottom),n>h.A.bottom&&(n=h.A.bottom),e>16,t>>16,a>>7,l>>7,h.A.yc,o,0),i+=d,t+=f,a+=w,l+=u,o+=h.A.pC}this.mS(i>>16,s>>16,a>>7,c>>7,h.A.yc,o,0),i+=d,s+=y,a+=w,c+=A,o+=h.A.pC}else for(;;){if(--e<0)for(;;){if(--n<0)return;this.mS(t>>16,i>>16,l>>7,a>>7,h.A.yc,o,0),i+=d,t+=f,a+=w,l+=u,o+=h.A.pC}this.mS(s>>16,i>>16,c>>7,a>>7,h.A.yc,o,0),i+=d,s+=y,a+=w,c+=A,o+=h.A.pC}else if(t=s<<=16,l=c<<=15,o<0&&(t-=d*o,s-=y*o,l-=w*o,c-=A*o,o=0),i<<=16,a<<=15,n<0&&(i-=f*n,a-=u*n,n=0),e-=n,n-=o,o=r.mc[o],d>16,s>>16,a>>7,c>>7,h.A.yc,o,0),i+=f,s+=y,a+=u,c+=A,o+=h.A.pC}this.mS(t>>16,s>>16,l>>7,c>>7,h.A.yc,o,0),t+=d,s+=y,l+=w,c+=A,o+=h.A.pC}else for(;;){if(--n<0)for(;;){if(--e<0)return;this.mS(s>>16,i>>16,c>>7,a>>7,h.A.yc,o,0),i+=f,s+=y,a+=u,c+=A,o+=h.A.pC}this.mS(s>>16,t>>16,c>>7,l>>7,h.A.yc,o,0),t+=d,s+=y,l+=w,c+=A,o+=h.A.pC}};static mS=(t,i,s,e,n,o,l)=>{let a;if(r.IC){let c;if(r.Sb){if(c=i-t>3?(e-s)/(i-t)|0:0,i>h.A.Mb&&(i=h.A.Mb),t<0&&(s-=t*c,t=0),t>=i)return;o+=t,l=i-t>>2,c<<=2}else{if(!(t>2)>0?(e-s)*r.rS[l]>>15:0}if(0===r.alpha)for(;;){if(--l<0){if((l=i-t&3)>0){a=r.palette[s>>8];do{n[o++]=a,l--}while(l>0);return}break}a=r.palette[s>>8],s+=c,n[o++]=a,n[o++]=a,n[o++]=a,n[o++]=a}else{const h=r.alpha,e=256-r.alpha;for(;;){if(--l<0){if((l=i-t&3)>0){a=r.palette[s>>8],a=((16711935&a)*e>>8&16711935)+((65280&a)*e>>8&65280);do{n[o++]=a+((16711935&n[o])*h>>8&16711935)+((65280&n[o])*h>>8&65280),l--}while(l>0)}break}a=r.palette[s>>8],s+=c,a=((16711935&a)*e>>8&16711935)+((65280&a)*e>>8&65280),n[o++]=a+((16711935&n[o])*h>>8&16711935)+((65280&n[o])*h>>8&65280),n[o++]=a+((16711935&n[o])*h>>8&16711935)+((65280&n[o])*h>>8&65280),n[o++]=a+((16711935&n[o])*h>>8&16711935)+((65280&n[o])*h>>8&65280),n[o++]=a+((16711935&n[o])*h>>8&16711935)+((65280&n[o])*h>>8&65280)}}}else if(th.A.Mb&&(i=h.A.Mb),t<0&&(s-=t*c,t=0),t>=i))return;if(o+=t,l=i-t,0===r.alpha)do{n[o++]=r.palette[s>>8],s+=c,l--}while(l>0);else{const t=r.alpha,i=256-r.alpha;do{a=r.palette[s>>8],s+=c,a=((16711935&a)*i>>8&16711935)+((65280&a)*i>>8&65280),n[o++]=a+((16711935&n[o])*t>>8&16711935)+((65280&n[o])*t>>8&65280),l--}while(l>0)}}};static IS=(t,i,s,e,n,r,o)=>{let l=0;n!==e&&(l=(i-t<<16)/(n-e)|0);let a=0;r!==n&&(a=(s-i<<16)/(r-n)|0);let c=0;if(r!==e&&(c=(t-s<<16)/(e-r)|0),e<=n&&e<=r){if(eh.A.bottom&&(n=h.A.bottom),r>h.A.bottom&&(r=h.A.bottom),na)for(r-=n,n-=e,e=this.mc[e];;){if(--n<0)for(;;){if(--r<0)return;this.gS(s>>16,i>>16,h.A.yc,e,o),s+=c,i+=a,e+=h.A.pC}this.gS(s>>16,t>>16,h.A.yc,e,o),s+=c,t+=l,e+=h.A.pC}else for(r-=n,n-=e,e=this.mc[e];;){if(--n<0)for(;;){if(--r<0)return;this.gS(i>>16,s>>16,h.A.yc,e,o),s+=c,i+=a,e+=h.A.pC}this.gS(t>>16,s>>16,h.A.yc,e,o),s+=c,t+=l,e+=h.A.pC}else if(i=t<<=16,e<0&&(i-=c*e,t-=l*e,e=0),s<<=16,r<0&&(s-=a*r,r=0),e!==r&&cl)for(n-=r,r-=e,e=this.mc[e];;){if(--r<0)for(;;){if(--n<0)return;this.gS(s>>16,t>>16,h.A.yc,e,o),s+=a,t+=l,e+=h.A.pC}this.gS(i>>16,t>>16,h.A.yc,e,o),i+=c,t+=l,e+=h.A.pC}else for(n-=r,r-=e,e=this.mc[e];;){if(--r<0)for(;;){if(--n<0)return;this.gS(t>>16,s>>16,h.A.yc,e,o),s+=a,t+=l,e+=h.A.pC}this.gS(t>>16,i>>16,h.A.yc,e,o),i+=c,t+=l,e+=h.A.pC}}else if(n<=r){if(nh.A.bottom&&(r=h.A.bottom),e>h.A.bottom&&(e=h.A.bottom),rc)for(e-=r,r-=n,n=this.mc[n];;){if(--r<0)for(;;){if(--e<0)return;this.gS(t>>16,s>>16,h.A.yc,n,o),t+=l,s+=c,n+=h.A.pC}this.gS(t>>16,i>>16,h.A.yc,n,o),t+=l,i+=a,n+=h.A.pC}else for(e-=r,r-=n,n=this.mc[n];;){if(--r<0)for(;;){if(--e<0)return;this.gS(s>>16,t>>16,h.A.yc,n,o),t+=l,s+=c,n+=h.A.pC}this.gS(i>>16,t>>16,h.A.yc,n,o),t+=l,i+=a,n+=h.A.pC}else if(s=i<<=16,n<0&&(s-=l*n,i-=a*n,n=0),t<<=16,e<0&&(t-=c*e,e=0),l>16,i>>16,h.A.yc,n,o),t+=c,i+=a,n+=h.A.pC}this.gS(s>>16,i>>16,h.A.yc,n,o),s+=l,i+=a,n+=h.A.pC}else for(r-=e,e-=n,n=this.mc[n];;){if(--e<0)for(;;){if(--r<0)return;this.gS(i>>16,t>>16,h.A.yc,n,o),t+=c,i+=a,n+=h.A.pC}this.gS(i>>16,s>>16,h.A.yc,n,o),s+=l,i+=a,n+=h.A.pC}}else if(rh.A.bottom&&(e=h.A.bottom),n>h.A.bottom&&(n=h.A.bottom),e>16,t>>16,h.A.yc,r,o),i+=a,t+=l,r+=h.A.pC}this.gS(i>>16,s>>16,h.A.yc,r,o),i+=a,s+=c,r+=h.A.pC}else for(n-=e,e-=r,r=this.mc[r];;){if(--e<0)for(;;){if(--n<0)return;this.gS(t>>16,i>>16,h.A.yc,r,o),i+=a,t+=l,r+=h.A.pC}this.gS(s>>16,i>>16,h.A.yc,r,o),i+=a,s+=c,r+=h.A.pC}else if(t=s<<=16,r<0&&(t-=a*r,s-=c*r,r=0),i<<=16,n<0&&(i-=l*n,n=0),a>16,s>>16,h.A.yc,r,o),i+=l,s+=c,r+=h.A.pC}this.gS(t>>16,s>>16,h.A.yc,r,o),t+=a,s+=c,r+=h.A.pC}else for(e-=n,n-=r,r=this.mc[r];;){if(--n<0)for(;;){if(--e<0)return;this.gS(s>>16,i>>16,h.A.yc,r,o),i+=l,s+=c,r+=h.A.pC}this.gS(s>>16,t>>16,h.A.yc,r,o),t+=a,s+=c,r+=h.A.pC}};static Bb=(t,i,s,e,n,r,o,l,a,c,f,u,d,w,y,A,p,m,I)=>{const g=this.ES(I);this.dS=!this.wS[I];const E=c-d,_=f-y,C=u-p,T=w-c,O=A-f,v=m-u;let b=T*f-O*c<<14;const L=O*u-v*f<<8,R=v*c-T*u<<5;let S=E*f-_*c<<14;const M=_*u-C*f<<8,k=C*c-E*u<<5;let x=_*T-E*O<<14;const D=C*O-_*v<<8,N=E*v-C*T<<5;let P=0,F=0;n!==e&&(P=(i-t<<16)/(n-e)|0,F=(l-o<<16)/(n-e)|0);let U=0,B=0;r!==n&&(U=(s-i<<16)/(r-n)|0,B=(a-l<<16)/(r-n)|0);let G=0,H=0;if(r!==e&&(G=(t-s<<16)/(e-r)|0,H=(o-a<<16)/(e-r)|0),e<=n&&e<=r){if(eh.A.bottom&&(n=h.A.bottom),r>h.A.bottom&&(r=h.A.bottom),nU)for(r-=n,n-=e,e=this.mc[e];;){if(--n<0)for(;;){if(--r<0)return;this._S(s>>16,i>>16,h.A.yc,e,g,0,0,b,S,x,L,M,D,a>>8,l>>8),s+=G,i+=U,a+=H,l+=B,e+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(s>>16,t>>16,h.A.yc,e,g,0,0,b,S,x,L,M,D,a>>8,o>>8),s+=G,t+=P,a+=H,o+=F,e+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(r-=n,n-=e,e=this.mc[e];;){if(--n<0)for(;;){if(--r<0)return;this._S(i>>16,s>>16,h.A.yc,e,g,0,0,b,S,x,L,M,D,l>>8,a>>8),s+=G,i+=U,a+=H,l+=B,e+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(t>>16,s>>16,h.A.yc,e,g,0,0,b,S,x,L,M,D,o>>8,a>>8),s+=G,t+=P,a+=H,o+=F,e+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}else{i=t<<=16,l=o<<=16,e<0&&(i-=G*e,t-=P*e,l-=H*e,o-=F*e,e=0),s<<=16,a<<=16,r<0&&(s-=U*r,a-=B*r,r=0);const c=e-this.Aa;if(b+=R*c,S+=k*c,x+=N*c,b|=0,S|=0,x|=0,(e===r||G>=P)&&(e!==r||U<=P))for(n-=r,r-=e,e=this.mc[e];;){if(--r<0)for(;;){if(--n<0)return;this._S(t>>16,s>>16,h.A.yc,e,g,0,0,b,S,x,L,M,D,o>>8,a>>8),s+=U,t+=P,a+=B,o+=F,e+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(t>>16,i>>16,h.A.yc,e,g,0,0,b,S,x,L,M,D,o>>8,l>>8),i+=G,t+=P,l+=H,o+=F,e+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(n-=r,r-=e,e=this.mc[e];;){if(--r<0)for(;;){if(--n<0)return;this._S(s>>16,t>>16,h.A.yc,e,g,0,0,b,S,x,L,M,D,a>>8,o>>8),s+=U,t+=P,a+=B,o+=F,e+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(i>>16,t>>16,h.A.yc,e,g,0,0,b,S,x,L,M,D,l>>8,o>>8),i+=G,t+=P,l+=H,o+=F,e+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}}else if(n<=r){if(nh.A.bottom&&(r=h.A.bottom),e>h.A.bottom&&(e=h.A.bottom),rG)for(e-=r,r-=n,n=this.mc[n];;){if(--r<0)for(;;){if(--e<0)return;this._S(t>>16,s>>16,h.A.yc,n,g,0,0,b,S,x,L,M,D,o>>8,a>>8),t+=P,s+=G,o+=F,a+=H,n+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(t>>16,i>>16,h.A.yc,n,g,0,0,b,S,x,L,M,D,o>>8,l>>8),t+=P,i+=U,o+=F,l+=B,n+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(e-=r,r-=n,n=this.mc[n];;){if(--r<0)for(;;){if(--e<0)return;this._S(s>>16,t>>16,h.A.yc,n,g,0,0,b,S,x,L,M,D,a>>8,o>>8),t+=P,s+=G,o+=F,a+=H,n+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(i>>16,t>>16,h.A.yc,n,g,0,0,b,S,x,L,M,D,l>>8,o>>8),t+=P,i+=U,o+=F,l+=B,n+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}else{s=i<<=16,a=l<<=16,n<0&&(s-=P*n,i-=U*n,a-=F*n,l-=B*n,n=0),t<<=16,o<<=16,e<0&&(t-=G*e,o-=H*e,e=0);const c=n-this.Aa;if(b+=R*c,S+=k*c,x+=N*c,b|=0,S|=0,x|=0,r-=e,e-=n,n=this.mc[n],P>16,i>>16,h.A.yc,n,g,0,0,b,S,x,L,M,D,o>>8,l>>8),t+=G,i+=U,o+=H,l+=B,n+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(s>>16,i>>16,h.A.yc,n,g,0,0,b,S,x,L,M,D,a>>8,l>>8),s+=P,i+=U,a+=F,l+=B,n+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(;;){if(--e<0)for(;;){if(--r<0)return;this._S(i>>16,t>>16,h.A.yc,n,g,0,0,b,S,x,L,M,D,l>>8,o>>8),t+=G,i+=U,o+=H,l+=B,n+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(i>>16,s>>16,h.A.yc,n,g,0,0,b,S,x,L,M,D,l>>8,a>>8),s+=P,i+=U,a+=F,l+=B,n+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}}else if(rh.A.bottom&&(e=h.A.bottom),n>h.A.bottom&&(n=h.A.bottom),e>16,t>>16,h.A.yc,r,g,0,0,b,S,x,L,M,D,l>>8,o>>8),i+=U,t+=P,l+=B,o+=F,r+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(i>>16,s>>16,h.A.yc,r,g,0,0,b,S,x,L,M,D,l>>8,a>>8),i+=U,s+=G,l+=B,a+=H,r+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(;;){if(--e<0)for(;;){if(--n<0)return;this._S(t>>16,i>>16,h.A.yc,r,g,0,0,b,S,x,L,M,D,o>>8,l>>8),i+=U,t+=P,l+=B,o+=F,r+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(s>>16,i>>16,h.A.yc,r,g,0,0,b,S,x,L,M,D,a>>8,l>>8),i+=U,s+=G,l+=B,a+=H,r+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}else{t=s<<=16,o=a<<=16,r<0&&(t-=U*r,s-=G*r,o-=B*r,a-=H*r,r=0),i<<=16,l<<=16,n<0&&(i-=P*n,l-=F*n,n=0);const c=r-this.Aa;if(b+=R*c,S+=k*c,x+=N*c,b|=0,S|=0,x|=0,e-=n,n-=r,r=this.mc[r],U>16,s>>16,h.A.yc,r,g,0,0,b,S,x,L,M,D,l>>8,a>>8),i+=P,s+=G,l+=F,a+=H,r+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(t>>16,s>>16,h.A.yc,r,g,0,0,b,S,x,L,M,D,o>>8,a>>8),t+=U,s+=G,o+=B,a+=H,r+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}else for(;;){if(--n<0)for(;;){if(--e<0)return;this._S(s>>16,i>>16,h.A.yc,r,g,0,0,b,S,x,L,M,D,a>>8,l>>8),i+=P,s+=G,l+=F,a+=H,r+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}this._S(s>>16,t>>16,h.A.yc,r,g,0,0,b,S,x,L,M,D,a>>8,o>>8),t+=U,s+=G,o+=B,a+=H,r+=h.A.pC,b+=R,S+=k,x+=N,b|=0,S|=0,x|=0}}};static _S=(t,i,s,e,n,r,o,l,a,c,f,u,d,w,y)=>{if(t>=i)return;let A,p,m,I,g,E,_,C,T;if(this.Sb){if(A=(y-w)/(i-t)|0,i>h.A.Mb&&(i=h.A.Mb),t<0&&(w-=t*A,t=0),t>=i)return;p=i-t>>3,A<<=12}else i-t>7?(p=i-t>>3,A=(y-w)*this.rS[p]>>6):(p=0,A=0);if(w<<=9,e+=t,this.st&&n)if(m=0,I=0,E=t-this.ya,l+=(f>>3)*E,a+=(u>>3)*E,c+=(d>>3)*E,l|=0,a|=0,g=(c|=0)>>12,0!==g&&(o=a/g|0,(r=l/g|0)<0?r=0:r>4032&&(r=4032)),l+=f,a+=u,c+=d,l|=0,a|=0,g=(c|=0)>>12,0!==g&&(m=l/g|0,I=a/g|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=I-o>>3,r+=w>>3&786432,T=w>>23,this.dS){for(;p-- >0;)s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C,s[e++]=n[(4032&o)+(r>>6)]>>>T,r=m,o=I,l+=f,a+=u,g=(c+=d)>>12,0!==g&&(m=l/g|0,I=a/g|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=I-o>>3,r+=(w+=A)>>3&786432,T=w>>23;for(p=i-t&7;p-- >0;)s[e++]=n[(4032&o)+(r>>6)]>>>T,r+=_,o+=C}else{for(;p-- >0;){let t;0!=(t=n[(4032&o)+(r>>6)]>>>T)&&(s[e]=t),e+=1,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e++,0!=(t=n[(4032&(o+=C))+((r+=_)>>6)]>>>T)&&(s[e]=t),e+=1,r=m,o=I,l+=f,a+=u,c+=d,l|=0,a|=0,g=(c|=0)>>12,0!==g&&(m=l/g|0,I=a/g|0,m<7?m=7:m>4032&&(m=4032)),_=m-r>>3,C=I-o>>3,r+=(w+=A)>>3&786432,T=w>>23}for(p=i-t&7;p-- >0;){let t;0!=(t=n[(4032&o)+(r>>6)]>>>T)&&(s[e]=t),e++,r+=_,o+=C}}else if(m=0,I=0,E=t-this.ya,l+=(f>>3)*E,a+=(u>>3)*E,c+=(d>>3)*E,l|=0,a|=0,g=(c|=0)>>14,0!==g&&(o=a/g|0,(r=l/g|0)<0?r=0:r>16256&&(r=16256)),l+=f,a+=u,c+=d,l|=0,a|=0,g=(c|=0)>>14,0!==g&&(m=l/g|0,I=a/g|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=I-o>>3,r+=6291456&w,T=w>>23,this.dS&&n){for(;p-- >0;)s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C,s[e++]=n[(16256&o)+(r>>7)]>>>T,r=m,o=I,l+=f,a+=u,c+=d,l|=0,a|=0,g=(c|=0)>>14,0!==g&&(m=l/g|0,I=a/g|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=I-o>>3,r+=6291456&(w+=A),T=w>>23;for(p=i-t&7;p-- >0;)s[e++]=n[(16256&o)+(r>>7)]>>>T,r+=_,o+=C}else{for(;p-- >0&&n;){let t;0!=(t=n[(16256&o)+(r>>7)]>>>T)&&(s[e]=t),e+=1,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,0!=(t=n[(16256&(o+=C))+((r+=_)>>7)]>>>T)&&(s[e]=t),e++,r=m,o=I,l+=f,a+=u,c+=d,l|=0,a|=0,g=(c|=0)>>14,0!==g&&(m=l/g|0,I=a/g|0,m<7?m=7:m>16256&&(m=16256)),_=m-r>>3,C=I-o>>3,r+=6291456&(w+=A),T=w>>23}for(p=i-t&7;p-- >0&&n;){let t;0!=(t=n[(16256&o)+(r>>7)]>>>T)&&(s[e]=t),e++,r+=_,o+=C}}};static gS=(t,i,s,e,n)=>{if(this.Sb&&(i>h.A.Mb&&(i=h.A.Mb),t<0&&(t=0)),t>=i)return;e+=t;let r=i-t>>2;if(0===this.alpha)for(;;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;s[e++]=n}s[e++]=n,s[e++]=n,s[e++]=n,s[e++]=n}const o=this.alpha,l=256-this.alpha;for(n=((16711935&n)*l>>8&16711935)+((65280&n)*l>>8&65280);;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;s[e++]=n+((16711935&s[e])*o>>8&16711935)+((65280&s[e])*o>>8&65280)}s[e++]=n+((16711935&s[e])*o>>8&16711935)+((65280&s[e])*o>>8&65280),s[e++]=n+((16711935&s[e])*o>>8&16711935)+((65280&s[e])*o>>8&65280),s[e++]=n+((16711935&s[e])*o>>8&16711935)+((65280&s[e])*o>>8&65280),s[e++]=n+((16711935&s[e])*o>>8&16711935)+((65280&s[e])*o>>8&65280)}};static Eg=t=>{this.cS[t]&&this.aS&&(this.aS[this.fS++]=this.cS[t],this.cS[t]=null)};static ES=t=>{if(this.Ig[t]=this.tu++,this.cS[t])return this.cS[t];let i;if(this.fS>0&&this.aS)i=this.aS[--this.fS],this.aS[this.fS]=null;else{let t=0,s=-1;for(let i=0;i>>3)&16316671,i[e+8192]=n-(n>>>2)&16316671,i[e+12288]=n-(n>>>2)-(n>>>3)&16316671}}else{if(64===s.width)for(let t=0;t<128;t++)for(let e=0;e<128;e++)i[e+(t<<7)]=h[s.yc[(e>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=h[s.yc[t]];this.wS[t]=!1;for(let s=0;s<16384;s++){i[s]&=16316671;const h=i[s];0===h&&(this.wS[t]=!0),i[s+16384]=h-(h>>>3)&16316671,i[s+32768]=h-(h>>>2)&16316671,i[s+49152]=h-(h>>>2)-(h>>>3)&16316671}}return i}}},880:(t,i,s)=>{s.d(i,{r:()=>e});var h=s(7854);const e=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(h.XR.src),h.XR.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>h.XR.onload=()=>t())),h.KR.clearRect(0,0,h.jR.width,h.jR.height);const i=h.XR.naturalWidth,s=h.XR.naturalHeight;return h.jR.width=i,h.jR.height=s,h.KR.drawImage(h.XR,0,0),h.KR.getImageData(0,0,i,s)}},8665:(t,i,s)=>{s.d(i,{A:()=>f});var h=s(1069),e=s(8950),n=s(4583),r=s(6730),o=s(4474),l=s(3867);class a{j_=0;zv=0;CS=0;TS=-1;OS=-1;vS=-1;bS=-1;LS=-1;RS=-1;SS=-1;MS=-1;kS=-1;xS=0;DS=-1;NS=-1;PS=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static US=null;static BS=null;static GS=null;static HS=null;static WS=null;static YS=null;static VS=null;static KS=null;static XS=null;static jS=null;static zS=null;static ZS=null;static axis=null;static qS=new l.ds(4096,!1);static $S=new l.ds(4096,!1);static JS=new Int32Array(4096);static QS=new Int32Array(4096);static tM=new Int32Array(4096);static iM=new Int32Array(4096);static sM=new Int32Array(4096);static hM=new Int32Array(4096);static eM=new Int32Array(1500);static nM=new l.Kn(1500,512);static rM=new Int32Array(12);static oM=new l.Kn(12,2e3);static lM=new Int32Array(2e3);static aM=new Int32Array(2e3);static cM=new Int32Array(12);static fM=new Int32Array(10);static uM=new Int32Array(10);static dM=new Int32Array(10);static gn=0;static wM=0;static En=0;static iu=!1;static Yl=0;static Vl=0;static su=0;static Tm=new Int32Array(1e3);static yM=!1;static wc(t){try{f.head=new h.A(t.read('ob_head.dat')),f.US=new h.A(t.read('ob_face1.dat')),f.BS=new h.A(t.read('ob_face2.dat')),f.GS=new h.A(t.read('ob_face3.dat')),f.HS=new h.A(t.read('ob_face4.dat')),f.WS=new h.A(t.read('ob_face5.dat')),f.YS=new h.A(t.read('ob_point1.dat')),f.VS=new h.A(t.read('ob_point2.dat')),f.KS=new h.A(t.read('ob_point3.dat')),f.XS=new h.A(t.read('ob_point4.dat')),f.jS=new h.A(t.read('ob_point5.dat')),f.zS=new h.A(t.read('ob_vertex1.dat')),f.ZS=new h.A(t.read('ob_vertex2.dat')),f.axis=new h.A(t.read('ob_axis.dat')),f.head.jc=0,f.YS.jc=0,f.VS.jc=0,f.KS.jc=0,f.XS.jc=0,f.zS.jc=0,f.ZS.jc=0;const i=f.head.rA;f.metadata=new l.ds(i+100,null);let s=0,e=0,n=0,r=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static X_=(t,i,s)=>{const h=t.j_,e=t.zv,n=t.CS;let r,o,a,u,d;if(i){r=new Int32Array(h);for(let i=0;i{const e=t.j_,n=t.zv,r=t.CS;let o,l,a,c,u;if(h)o=t.z_,l=t.q_,a=t.Z_;else{o=new Int32Array(e),l=new Int32Array(e),a=new Int32Array(e);for(let i=0;i{const s=t.j_,h=t.zv,e=t.CS,n=new Int32Array(s),r=new Int32Array(s),o=new Int32Array(s);for(let i=0;i{let s=!1,h=!1,e=!1,n=!1,r=0,o=0,l=0,a=-1;for(let c=0;c{let s=!1,h=!1,e=!1,n=!1,r=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.z_[i],a=t.q_[i],c=t.Z_[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.US&&f.BS&&f.GS&&f.HS&&f.WS&&f.YS&&f.VS&&f.KS&&f.XS&&f.jS&&f.zS&&f.ZS&&f.axis))throw new Error('cant loading model!!!!!');const s=i.j_,h=i.zv,e=i.CS,n=new Int32Array(s),r=new Int32Array(s),o=new Int32Array(s),l=new Int32Array(h),a=new Int32Array(h),c=new Int32Array(h),u=new Int32Array(e),d=new Int32Array(e),w=new Int32Array(e);let y=null;i.LS>=0&&(y=new Int32Array(s));let A=null;i.kS>=0&&(A=new Int32Array(h));let p=null,m=0;i.xS>=0?p=new Int32Array(h):m=-i.xS-1;let I=null;i.DS>=0&&(I=new Int32Array(h));let g=null;i.NS>=0&&(g=new Int32Array(h));const E=new Int32Array(h);f.YS.jc=i.TS,f.VS.jc=i.OS,f.KS.jc=i.vS,f.XS.jc=i.bS,f.jS.jc=i.LS;let _,C,T,O=0,v=0,b=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const s=f.metadata[i];if(s.data=t,!s.data.length)throw new Error('No model data');const e=s.j_,n=s.zv,r=s.CS,o=new Int32Array(e),l=new Int32Array(e),a=new Int32Array(e),c=new Int32Array(n),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(r),y=new Int32Array(r),A=new Int32Array(r);let p=null;s.LS>=0&&(p=new Int32Array(e));let m=null;s.kS>=0&&(m=new Int32Array(n));let I=null,g=0;s.xS>=0?I=new Int32Array(n):g=-s.xS-1;let E=null;s.DS>=0&&(E=new Int32Array(n));let _=null;s.NS>=0&&(_=new Int32Array(n));const C=new Int32Array(n),T=new h.A(s.data);T.jc=s.TS;const O=new h.A(s.data);O.jc=s.OS;const v=new h.A(s.data);v.jc=s.vS;const b=new h.A(s.data);b.jc=s.bS;const L=new h.A(s.data);L.jc=s.LS;let R,S,M,k=0,x=0,D=0;for(let t=0;tthis.eC&&(this.eC=-s),s>this.Wv&&(this.Wv=s);const e=i*i+h*h;e>this.yO&&(this.yO=e)}this.yO=Math.sqrt(this.yO)+.99|0,this.bM=Math.sqrt(this.yO*this.yO+this.eC*this.eC)+.99|0,this.vM=this.bM+(Math.sqrt(this.yO*this.yO+this.Wv*this.Wv)+.99|0)}J_(){this.eC=0,this.Wv=0;for(let t=0;tthis.eC&&(this.eC=-i),i>this.Wv&&(this.Wv=i)}this.bM=Math.sqrt(this.yO*this.yO+this.eC*this.eC)+.99|0,this.vM=this.bM+(Math.sqrt(this.yO*this.yO+this.Wv*this.Wv)+.99|0)}Ha(){if(this.LM){const t=new Int32Array(256);let i=0;for(let s=0;si&&(i=h)}this.iC=new l.ds(i+1,null);for(let s=0;s<=i;s++)this.iC[s]=new Int32Array(t[s]),t[s]=0;let s=0;for(;si&&(i=h)}this.tC=new l.ds(i+1,null);for(let s=0;s<=i;s++)this.tC[s]=new Int32Array(t[s]),t[s]=0;let s=0;for(;sl;)l=s[o++];n&&n.types&&h.x&&h.y&&h.z&&n.labels&&(i!==l||0===n.types[i])&&this.xM(h.x[t],h.y[t],h.z[t],n.labels[i],n.types[i])}f.gn=0,f.wM=0,f.En=0,o=0,l=s[o++];for(let t=0;tl;)l=s[o++];n&&n.types&&e.x&&e.y&&e.z&&n.labels&&(i===l||0===n.types[i])&&this.xM(e.x[t],e.y[t],e.z[t],n.labels[i],n.types[i])}}else this.Wa(t)}Wa(t){if(!this.iC||-1===t||!r.A.Do[t])return;const i=r.A.Do[t],s=i.WR;f.gn=0,f.wM=0,f.En=0;for(let t=0;t>16;this.Z_[t]=this.q_[t]*i+this.Z_[t]*s>>16,this.q_[t]=h}}translate(t,i,s){for(let h=0;h>8;if(this.mM&&this.IM&&this.gM||(this.mM=new Int32Array(this.zv),this.IM=new Int32Array(this.zv),this.gM=new Int32Array(this.zv)),!this.Dv){this.Dv=new l.ds(this.j_,null);for(let t=0;t8192||p>8192||m>8192||A<-8192||p<-8192||m<-8192;)A>>=1,p>>=1,m>>=1;let I=0|Math.sqrt(A*A+p*p+m*m);if(I<=0&&(I=1),A=256*A/I|0,p=256*p/I|0,m=256*m/I|0,this.jv&&1&this.jv[i]){const n=t+((s*A+h*p+e*m)/(r+(r/2|0))|0);this.h_&&(this.mM[i]=f.pM(this.h_[i],n,this.jv[i]))}else{let t=this.Dv[n];t&&(t.x+=A,t.y+=p,t.z+=m,t.w++),t=this.Dv[o],t&&(t.x+=A,t.y+=p,t.z+=m,t.w++),t=this.Dv[l],t&&(t.x+=A,t.y+=p,t.z+=m,t.w++)}}if(n)this.Fv(t,r,s,h,e);else{this.Hv=new l.ds(this.j_,null);for(let t=0;t>16;for(let h=0;h>16,g=g*w-I*d>>16,I=m),0!==t&&(m=g*a-E*l>>16,E=g*l+E*a>>16,g=m),0!==i&&(m=E*c+I*u>>16,E=E*u-I*c>>16,I=m),I+=e,g+=r,E+=o,m=g*A-E*y>>16,E=g*y+E*A>>16,g=m,f.JS&&f.QS&&f.tM&&(f.tM[h]=E-p,f.JS[h]=n.A.ya+((I<<9)/E|0),f.QS[h]=n.A.Aa+((g<<9)/E|0)),this.CS>0&&f.iM&&f.sM&&f.hM&&(f.iM[h]=I,f.sM[h]=g,f.hM[h]=E)}try{this.NM(!1,!1,0)}catch(t){}}draw(t,i,s,h,r,o,l,a,c){const u=a*r-o*h>>16,d=l*i+u*s>>16,w=this.yO*s>>16,y=d+w;if(y<=50||d>=3500)return;const A=a*h+o*r>>16;let p=A-this.yO<<9;if((p/y|0)>=e.A.iS)return;let m=A+this.yO<<9;if((m/y|0)<=-e.A.iS)return;const I=l*s-u*i>>16,g=this.yO*i>>16;let E=I+g<<9;if((E/y|0)<=-e.A.sS)return;let _=I-(g+(this.eC*s>>16))<<9;if((_/y|0)>=e.A.sS)return;let C=d-(w+(this.eC*i>>16))<=50,T=!1;if(c>0&&f.iu){let t=d-w;t<=50&&(t=50),A>0?(p=p/y|0,m=m/t|0):(m=m/y|0,p=p/t|0),I>0?(_=_/y|0,E=E/t|0):(E=E/y|0,_=_/t|0);const i=f.Yl-n.A.ya,s=f.Vl-n.A.Aa;i>p&&i_&&s>16,w=w*L-c*b>>16,c=n),c+=o,u+=l,w+=a,n=w*h+c*r>>16,w=w*r-c*h>>16,c=n,n=u*s-w*i>>16,w=u*i+w*s>>16,u=n,f.tM&&(f.tM[e]=w-d),w>=50&&f.JS&&f.QS?(f.JS[e]=O+((c<<9)/w|0),f.QS[e]=v+((u<<9)/w|0)):f.JS&&(f.JS[e]=-5e3,C=!0),(C||this.CS>0)&&f.iM&&f.sM&&f.hM&&(f.iM[e]=c,f.sM[e]=u,f.hM[e]=w)}try{this.NM(C,T,c)}catch(t){}}NM(t,i,s,h=!1){f.yM&&(this.MM=-1,this.kM=-1);for(let t=0;te.A.Mb||a>e.A.Mb||c>e.A.Mb),f.nM&&f.eM){const t=((y+A+p)/3|0)+this.bM;f.nM[t][f.eM[t]++]=h,f.yM&&this.PM(f.Yl,f.Vl,u,d,w,l,a,c)&&this.kM=0;t--){const i=f.eM[t];if(!(i<=0)&&f.nM){const s=f.nM[t];for(let t=0;t=0;t--){const i=f.eM[t];if(i>0&&f.nM){const s=f.nM[t];for(let h=0;h0||f.rM[2]>0)&&(n=(f.cM[1]+f.cM[2])/(f.rM[1]+f.rM[2])|0);let r=0;f.rM&&f.cM&&(f.rM[3]>0||f.rM[4]>0)&&(r=(f.cM[3]+f.cM[4])/(f.rM[3]+f.rM[4])|0);let o=0;if(f.rM&&f.cM&&(f.rM[6]>0||f.rM[8]>0)&&(o=(f.cM[6]+f.cM[8])/(f.rM[6]+f.rM[8])|0),f.rM&&f.oM){let t,i=0,s=f.rM[10],e=f.oM[10],l=f.lM;i===s&&(i=0,s=f.rM[11],e=f.oM[11],l=f.aM),t=in;)try{this.FM(e[i++],h),i===s&&e!==f.oM[11]&&(i=0,s=f.rM[11],e=f.oM[11],l=f.aM),t=ir;)try{this.FM(e[i++],h),i===s&&e!==f.oM[11]&&(i=0,s=f.rM[11],e=f.oM[11],l=f.aM),t=io;)try{this.FM(e[i++],h),i===s&&e!==f.oM[11]&&(i=0,s=f.rM[11],e=f.oM[11],l=f.aM),t=i>2,r=this.CM[i],o=this.TM[i],l=this.OM[i];n.A.Bb(f.JS[s],f.JS[h],f.JS[e],f.QS[s],f.QS[h],f.QS[e],this.mM[t],this.IM[t],this.gM[t],f.iM[r],f.sM[r],f.hM[r],f.iM[o],f.iM[l],f.sM[o],f.sM[l],f.hM[o],f.hM[l],this.h_[t])}else if(3===r&&this.jv&&this.h_&&this.mM&&f.JS&&f.QS&&f.iM&&f.sM&&f.hM){const i=this.jv[t]>>2,r=this.CM[i],o=this.TM[i],l=this.OM[i];n.A.Bb(f.JS[s],f.JS[h],f.JS[e],f.QS[s],f.QS[h],f.QS[e],this.mM[t],this.mM[t],this.mM[t],f.iM[r],f.sM[r],f.hM[r],f.iM[o],f.iM[l],f.sM[o],f.sM[l],f.hM[o],f.hM[l],this.h_[t])}}UM(t,i=!1){let s=0;if(f.hM){const i=n.A.ya,h=n.A.Aa,e=this.Zv[t],r=this.qv[t],o=this.$v[t],l=f.hM[e],a=f.hM[r],c=f.hM[o];if(l>=50&&f.JS&&f.QS&&this.mM)f.fM[s]=f.JS[e],f.uM[s]=f.QS[e],f.dM[s++]=this.mM[t];else if(f.iM&&f.sM&&this.mM){const u=f.iM[e],d=f.sM[e],w=this.mM[t];if(c>=50&&this.gM){const e=(50-l)*n.A.oS[c-l];f.fM[s]=i+((u+((f.iM[o]-u)*e>>16)<<9)/50|0),f.uM[s]=h+((d+((f.sM[o]-d)*e>>16)<<9)/50|0),f.dM[s++]=w+((this.gM[t]-w)*e>>16)}if(a>=50&&this.IM){const e=(50-l)*n.A.oS[a-l];f.fM[s]=i+((u+((f.iM[r]-u)*e>>16)<<9)/50|0),f.uM[s]=h+((d+((f.sM[r]-d)*e>>16)<<9)/50|0),f.dM[s++]=w+((this.IM[t]-w)*e>>16)}}if(a>=50&&f.JS&&f.QS&&this.IM)f.fM[s]=f.JS[r],f.uM[s]=f.QS[r],f.dM[s++]=this.IM[t];else if(f.iM&&f.sM&&this.IM){const u=f.iM[r],d=f.sM[r],w=this.IM[t];if(l>=50&&this.mM){const r=(50-a)*n.A.oS[l-a];f.fM[s]=i+((u+((f.iM[e]-u)*r>>16)<<9)/50|0),f.uM[s]=h+((d+((f.sM[e]-d)*r>>16)<<9)/50|0),f.dM[s++]=w+((this.mM[t]-w)*r>>16)}if(c>=50&&this.gM){const e=(50-a)*n.A.oS[c-a];f.fM[s]=i+((u+((f.iM[o]-u)*e>>16)<<9)/50|0),f.uM[s]=h+((d+((f.sM[o]-d)*e>>16)<<9)/50|0),f.dM[s++]=w+((this.gM[t]-w)*e>>16)}}if(c>=50&&f.JS&&f.QS&&this.gM)f.fM[s]=f.JS[o],f.uM[s]=f.QS[o],f.dM[s++]=this.gM[t];else if(f.iM&&f.sM&&this.gM){const u=f.iM[o],d=f.sM[o],w=this.gM[t];if(a>=50&&this.IM){const e=(50-c)*n.A.oS[a-c];f.fM[s]=i+((u+((f.iM[r]-u)*e>>16)<<9)/50|0),f.uM[s]=h+((d+((f.sM[r]-d)*e>>16)<<9)/50|0),f.dM[s++]=w+((this.IM[t]-w)*e>>16)}if(l>=50&&this.mM){const r=(50-c)*n.A.oS[l-c];f.fM[s]=i+((u+((f.iM[e]-u)*r>>16)<<9)/50|0),f.uM[s]=h+((d+((f.sM[e]-d)*r>>16)<<9)/50|0),f.dM[s++]=w+((this.mM[t]-w)*r>>16)}}}const h=f.fM[0],r=f.fM[1],o=f.fM[2],l=f.uM[0],a=f.uM[1],c=f.uM[2];if(!((h-r)*(c-a)-(l-a)*(o-r)<=0))if(n.A.Sb=!1,3===s){let s;if((h<0||r<0||o<0||h>e.A.Mb||r>e.A.Mb||o>e.A.Mb)&&(n.A.Sb=!0),s=this.jv?3&this.jv[t]:0,i)n.A.rd(h,r,l,a,f.dM[0]),n.A.rd(r,o,a,c,f.dM[1]),n.A.rd(o,h,c,l,f.dM[2]);else if(0===s)n.A.Nb(h,r,o,l,a,c,f.dM[0],f.dM[1],f.dM[2]);else if(1===s&&this.mM)n.A.IS(h,r,o,l,a,c,n.A.palette[this.mM[t]]);else if(2===s&&this.jv&&this.h_&&f.iM&&f.sM&&f.hM){const i=this.jv[t]>>2,s=this.CM[i],e=this.TM[i],u=this.OM[i];n.A.Bb(h,r,o,l,a,c,f.dM[0],f.dM[1],f.dM[2],f.iM[s],f.sM[s],f.hM[s],f.iM[e],f.iM[u],f.sM[e],f.sM[u],f.hM[e],f.hM[u],this.h_[t])}else if(3===s&&this.jv&&this.h_&&this.mM&&f.iM&&f.sM&&f.hM){const i=this.jv[t]>>2,s=this.CM[i],e=this.TM[i],u=this.OM[i];n.A.Bb(h,r,o,l,a,c,this.mM[t],this.mM[t],this.mM[t],f.iM[s],f.sM[s],f.hM[s],f.iM[e],f.iM[u],f.sM[e],f.sM[u],f.hM[e],f.hM[u],this.h_[t])}}else if(4===s){let s;if((h<0||r<0||o<0||h>e.A.Mb||r>e.A.Mb||o>e.A.Mb||f.fM[3]<0||f.fM[3]>e.A.Mb)&&(n.A.Sb=!0),s=this.jv?3&this.jv[t]:0,i)n.A.rd(h,r,l,a,f.dM[0]),n.A.rd(r,o,a,c,f.dM[1]),n.A.rd(o,f.fM[3],c,f.uM[3],f.dM[2]),n.A.rd(f.fM[3],h,f.uM[3],l,f.dM[3]);else if(0===s)n.A.Nb(h,r,o,l,a,c,f.dM[0],f.dM[1],f.dM[2]),n.A.Nb(h,o,f.fM[3],l,c,f.uM[3],f.dM[0],f.dM[2],f.dM[3]);else if(1===s){if(this.mM){const i=n.A.palette[this.mM[t]];n.A.IS(h,r,o,l,a,c,i),n.A.IS(h,o,f.fM[3],l,c,f.uM[3],i)}}else if(2===s&&this.jv&&this.h_&&f.iM&&f.sM&&f.hM){const i=this.jv[t]>>2,s=this.CM[i],e=this.TM[i],u=this.OM[i];n.A.Bb(h,r,o,l,a,c,f.dM[0],f.dM[1],f.dM[2],f.iM[s],f.sM[s],f.hM[s],f.iM[e],f.iM[u],f.sM[e],f.sM[u],f.hM[e],f.hM[u],this.h_[t]),n.A.Bb(h,o,f.fM[3],l,c,f.uM[3],f.dM[0],f.dM[2],f.dM[3],f.iM[s],f.sM[s],f.hM[s],f.iM[e],f.iM[u],f.sM[e],f.sM[u],f.hM[e],f.hM[u],this.h_[t])}else if(3===s&&this.jv&&this.h_&&this.mM&&f.iM&&f.sM&&f.hM){const i=this.jv[t]>>2,s=this.CM[i],e=this.TM[i],u=this.OM[i];n.A.Bb(h,r,o,l,a,c,this.mM[t],this.mM[t],this.mM[t],f.iM[s],f.sM[s],f.hM[s],f.iM[e],f.iM[u],f.sM[e],f.sM[u],f.hM[e],f.hM[u],this.h_[t]),n.A.Bb(h,o,f.fM[3],l,c,f.uM[3],this.mM[t],this.mM[t],this.mM[t],f.iM[s],f.sM[s],f.hM[s],f.iM[e],f.iM[u],f.sM[e],f.sM[u],f.hM[e],f.hM[u],this.h_[t])}}}xM(t,i,s,h,e){if(!h)return;const r=h.length;if(0===e){let e=0;f.gn=0,f.wM=0,f.En=0;for(let t=0;t0?(f.gn=(f.gn/e|0)+t,f.wM=(f.wM/e|0)+i,f.En=(f.En/e|0)+s):(f.gn=t,f.wM=i,f.En=s)}else if(1===e)for(let e=0;e=this.iC.length)continue;const r=this.iC[n];if(r)for(let h=0;h=this.iC.length)continue;const o=this.iC[r];if(o)for(let h=0;h>16;this.q_[e]=this.q_[e]*u-this.z_[e]*c>>16,this.z_[e]=t}if(0!==r){c=n.A.sin[r],u=n.A.cos[r];const t=this.q_[e]*u-this.Z_[e]*c>>16;this.Z_[e]=this.q_[e]*c+this.Z_[e]*u>>16,this.q_[e]=t}if(0!==l){c=n.A.sin[l],u=n.A.cos[l];const t=this.Z_[e]*c+this.z_[e]*u>>16;this.Z_[e]=this.Z_[e]*u-this.z_[e]*c>>16,this.z_[e]=t}this.z_[e]+=f.gn,this.q_[e]+=f.wM,this.Z_[e]+=f.En}}else if(3===e)for(let e=0;e=this.iC.length)continue;const r=this.iC[n];if(r)for(let h=0;h=this.tC.length)continue;const e=this.tC[s];if(e)for(let i=0;i255&&(this._M[s]=255)}}}DM(){this.eC=0,this.yO=0,this.Wv=0,this.Yv=999999,this.Vv=-999999,this.Xv=-99999,this.Kv=99999;for(let t=0;tthis.Vv&&(this.Vv=i),hthis.Xv&&(this.Xv=h),-s>this.eC&&(this.eC=-s),s>this.Wv&&(this.Wv=s);const e=i*i+h*h;e>this.yO&&(this.yO=e)}this.yO=0|Math.sqrt(this.yO),this.bM=0|Math.sqrt(this.yO*this.yO+this.eC*this.eC),this.vM=this.bM+(0|Math.sqrt(this.yO*this.yO+this.Wv*this.Wv))}PM(t,i,s,h,e,n,r,o){return!(is&&i>h&&i>e)&&(!(t{s.d(i,{A:()=>o});var h=s(8950),e=s(1069),n=s(4474),r=s(880);class o extends n.A{yc;width;height;xc;Dc;Xl;Ed;constructor(t,i){super(),this.yc=new Int32Array(t*i),this.width=this.Xl=t,this.height=this.Ed=i,this.xc=this.Dc=0}static Mc=async(t,i)=>{const s=t.read(i+'.dat');if(!s)throw new Error(`${i} jpeg not found!`);const h=await(0,r.r)(s),e=new o(h.width,h.height),n=new Uint32Array(h.data.buffer),l=e.yc;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return e};static hc=(t,i,s=0)=>{const h=new e.A(t.read(i+'.dat')),n=new e.A(t.read('index.dat'));n.jc=h.rA;const r=n.rA,l=n.rA,a=[],c=n.cA-1;for(let t=0;th.length||n.jc>n.length)throw new Error;const f=n.cA,u=n.cA,d=n.rA,w=n.rA,y=new o(d,w);y.xc=f,y.Dc=u,y.Xl=r,y.Ed=l;const A=n.cA;if(0===A){const t=y.width*y.height;for(let i=0;ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.GM(r,n,this.yc,e,l,h.A.yc,s,o)}Kl(t,i,s){i|=0,s|=0;let e=(i+=this.xc)+(s+=this.Dc)*h.A.pC,n=0,r=this.height,o=this.width,l=h.A.pC-o,a=0;if(sh.A.bottom&&(r-=s+r-h.A.bottom),ih.A.right){const t=i+o-h.A.right;o-=t,a+=t,l+=t}o>0&&r>0&&this.HM(o,r,this.yc,n,a,h.A.yc,e,l,t)}cc(t,i){t|=0,i|=0;let s=(t+=this.xc)+(i+=this.Dc)*h.A.pC,e=0,n=this.height,r=this.width,o=h.A.pC-r,l=0;if(ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.WM(r,n,this.yc,e,l,h.A.yc,s,o)}lc(){const t=this.yc,i=this.width,s=this.height;for(let h=0;h>16&255;n+=t,n<1?n=1:n>255&&(n=255);let r=e>>8&255;r+=i,r<1?r=1:r>255&&(r=255);let o=255&e;o+=s,o<1?o=1:o>255&&(o=255),this.yc[h]=(n<<16)+(r<<8)+o}}}TC(t,i,s,e){t|=0,i|=0,s|=0,e|=0;try{const n=this.width;let r=0,o=0;const l=this.Xl,a=this.Ed,c=(l<<16)/s|0,f=(a<<16)/e|0;t+=(this.xc*s+l-1)/l|0,i+=(this.Dc*e+a-1)/a|0,this.xc*s%l!=0&&(r=(l-this.xc*s%l<<16)/s|0),this.Dc*e%a!=0&&(o=(a-this.Dc*e%a<<16)/e|0),s=s*(this.width-(r>>16))/l|0,e=e*(this.height-(o>>16))/a|0;let u=t+i*h.A.pC,d=h.A.pC-s;if(ih.A.bottom&&(e-=i+e-h.A.bottom),th.A.right){const i=t+s-h.A.right;s-=i,d+=i}this.scale(s,e,this.yc,r,o,h.A.yc,d,u,n,c,f)}catch(t){console.error('error in sprite clipping routine')}}Ad(t,i,s,e,n,r,o,l,a,c){t|=0,i|=0,s|=0,e|=0;try{const f=-s/2|0,u=-e/2|0,d=65536*Math.sin(a/326.11)|0,w=65536*Math.cos(a/326.11)|0,y=d*c>>8,A=w*c>>8;let p=(o<<16)+u*y+f*A,m=u*A-f*y+(l<<16),I=t+i*h.A.pC;for(let t=0;t>16)+(o>>16)*this.width],e+=A,o-=y;p+=y,m+=A,I+=h.A.pC}}catch(t){}}gd(t,i,s){t|=0,i|=0;let e=(t+=this.xc)+(i+=this.Dc)*h.A.pC,n=0,r=this.height,o=this.width,l=h.A.pC-o,a=0;if(ih.A.bottom&&(r-=i+r-h.A.bottom),th.A.right){const i=t+o-h.A.right;o-=i,a+=i,l+=i}o>0&&r>0&&this.YM(o,r,this.yc,a,n,h.A.yc,e,l,s.yc)}scale(t,i,s,h,e,n,r,o,l,a,c){try{const f=h;for(let u=-i;u<0;u++){const i=(e>>16)*l;for(let e=-t;e<0;e++){const t=s[(h>>16)+i];0===t?o++:n[o++]=t,h+=a}e+=c,h=f,o+=r}}catch(t){console.error('error in plot_scale')}}WM(t,i,s,h,e,n,r,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)n[r++]=s[h++],n[r++]=s[h++],n[r++]=s[h++],n[r++]=s[h++];for(let i=t;i<0;i++)n[r++]=s[h++];r+=o,h+=e}}HM(t,i,s,h,e,n,r,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=s[h++];if(0===t)r++;else{const i=n[r];n[r++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}r+=o,h+=e}}GM(t,i,s,h,e,n,r,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=s[h++];0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t,t=s[h++],0===t?r++:n[r++]=t}for(let i=t;i<0;i++){const t=s[h++];0===t?r++:n[r++]=t}r+=o,h+=e}}YM(t,i,s,h,e,n,r,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=s[e++];0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++,t=s[e++],0!==t&&0===l[r]?n[r++]=t:r++}for(let i=t;i<0;i++){const t=s[e++];0!==t&&0===l[r]?n[r++]=t:r++}r+=o,e+=h}}}},1673:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(8950),e=s(1069),n=s(4474);class r extends n.A{yc;width;height;xc;Dc;Xl;Ed;palette;constructor(t,i,s){super(),this.yc=new Int8Array(t*i),this.width=this.Xl=t,this.height=this.Ed=i,this.xc=this.Dc=0,this.palette=s}static hc=(t,i,s=0)=>{const h=new e.A(t.read(i+'.dat')),n=new e.A(t.read('index.dat'));n.jc=h.rA;const o=n.rA,l=n.rA,a=n.cA,c=new Int32Array(a);for(let t=1;th.length||n.jc>n.length)throw new Error;const f=n.cA,u=n.cA,d=n.rA,w=n.rA,y=new r(d,w,c);y.xc=f,y.Dc=u,y.Xl=o,y.Ed=l;const A=y.yc,p=n.cA;if(0===p){const t=y.width*y.height;for(let i=0;ih.A.bottom&&(n-=i+n-h.A.bottom),th.A.right){const i=t+r-h.A.right;r-=i,l+=i,o+=i}r>0&&n>0&&this.VM(r,n,this.yc,e,l,h.A.yc,s,o)}lc(){const t=this.yc,i=this.width,s=this.height;for(let h=0;h>16&255;e+=t,e<0?e=0:e>255&&(e=255);let n=this.palette[h]>>8&255;n+=i,n<0?n=0:n>255&&(n=255);let r=255&this.palette[h];r+=s,r<0?r=0:r>255&&(r=255),this.palette[h]=(e<<16)+(n<<8)+r}}AS(){this.Xl|=0,this.Ed|=0,this.Xl/=2,this.Ed/=2,this.Xl|=0,this.Ed|=0;const t=new Int8Array(this.Xl*this.Ed);let i=0;for(let s=0;s>1)+(s+this.Dc>>1)*this.Xl]=this.yc[i++];this.yc=t,this.width=this.Xl,this.height=this.Ed,this.xc=0,this.Dc=0}TC(){if(this.width===this.Xl&&this.height===this.Ed)return;const t=new Int8Array(this.Xl*this.Ed);let i=0;for(let s=0;s>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=s[h++];0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t],t=s[h++],0===t?r++:n[r++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=s[h++];0===t?r++:n[r++]=this.palette[255&t]}r+=o,h+=e}}clip(t,i,s,e){try{const n=this.width;this.height;let r=0,o=0;const l=this.Xl,a=this.Ed,c=(l<<16)/s|0,f=(a<<16)/e|0;t=t+(this.xc*s+l-1)/l|0,i=i+(this.Dc*e+a-1)/a|0,this.xc*s%l!=0&&(r=(l-this.xc*s%l<<16)/s|0),this.Dc*e%a!=0&&(o=(a-this.Dc*e%a<<16)/e|0),s=s*(this.width-(r>>16))/l|0,e=e*(this.height-(o>>16))/a|0;let u,d=t+i*h.A.pC,w=h.A.pC-s;ih.A.bottom&&(e-=i+e-h.A.bottom),th.A.right&&(u=t+s-h.A.right,s-=u,w+=u),this.KM(h.A.yc,this.yc,this.palette,r,o,d,w,s,e,c,f,n)}catch(t){console.log('error in sprite clipping routine')}}KM(t,i,s,h,e,n,r,o,l,a,c,f){try{const u=h;for(let d=-l;d<0;d++){const l=(e>>16)*f;for(let e=-o;e<0;e++){const e=i[(h>>16)+l];0==e?n++:t[n++]=s[255&e],h+=a}e+=c,h=u,n+=r}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,s)=>{s.d(i,{A:()=>l});var h=s(8950),e=s(1069),n=s(4474);class r{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}XM(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}eA(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=s(9298);class l extends n.A{static Yc='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static jM=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let s=l.Yc.indexOf(String.fromCharCode(i));t&&s>=63&&s--,-1===s&&(s=74),l.jM[i]=s}}zM=[];ZM=new Int32Array(94);qM=new Int32Array(94);$M=new Int32Array(94);JM=new Int32Array(94);QM=new Int32Array(95);tk=new Int32Array(256);random=new r(BigInt(Date.now()));height=0;static hc=(t,i)=>{const s=new e.A(t.read(i+'.dat')),h=new e.A(t.read('index.dat'));h.jc=s.rA+4;const n=h.cA;n>0&&(h.jc+=3*(n-1));const r=new l;for(let t=0;t<94;t++){r.$M[t]=h.cA,r.JM[t]=h.cA;const i=r.ZM[t]=h.rA,e=r.qM[t]=h.rA,n=h.cA,o=i*e;if(r.zM[t]=new Int8Array(o),0===n)for(let h=0;hr.height&&(r.height=e),r.$M[t]=1,r.QM[t]=i+2;{let s=0;for(let h=e/7|0;h=h.A.bottom&&(n-=s+n+1-h.A.bottom),i=h.A.right){const t=i+e+1-h.A.right;e-=t,a+=t,l+=t}e>0&&n>0&&this.ek(e,n,t,c,a,h.A.yc,o,l,r)}hk(t,i,s,e,n,r,o){s|=0,e|=0;let l=(t|=0)+(i|=0)*h.A.pC,a=h.A.pC-s,c=0,f=0;if(i=h.A.bottom&&(e-=i+e+1-h.A.bottom),t=h.A.right){const i=t+s+1-h.A.right;s-=i,c+=i,a+=i}s>0&&e>0&&this.nk(s,e,h.A.yc,l,a,o,f,c,n,r)}ek(t,i,s,h,e,n,r,o,l){const a=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=a;t<0;t++)0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l,0===s[h++]?r++:n[r++]=l;for(let i=t;i<0;i++)0===s[h++]?r++:n[r++]=l;r+=o,h+=e}}nk(t,i,s,h,e,n,r,o,l,a){t|=0;const c=((16711935&l)*a&4278255360)+((65280&l)*a&16711680)>>8,f=256-a;for(let l=-(i|=0);l<0;l++){for(let i=-t;i<0;i++)if(0===n[r++])h++;else{const t=s[h];s[h++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}h+=e,r+=o}}sk(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.ql:'cya'===t?o.A.Pc:'mag'===t?o.A.Fc:'whi'===t?o.A.Sl:'bla'===t?o.A.Zl:'lre'===t?o.A.zR:'dre'===t?o.A.dd:'dbl'===t?o.A.ud:'or1'===t?o.A.ZR:'or2'===t?o.A.qR:'or3'===t?o.A.$R:'gr1'===t?o.A.JR:'gr2'===t?o.A.QR:'gr3'===t?o.A.tS:o.A.Zl}split(t,i){if(0===t.length)return[t];const s=[];for(;t.length>0;){if(this.Iu(t)<=i&&-1===t.indexOf('|')){s.push(t);break}let h=t.length;for(let s=0;si)break;h=s}else if('|'===t[s]){h=s;break}s.push(t.substring(0,h)),t=t.substring(h+1)}return s}}},1183:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(8950),e=s(7854);class n{rk;width;height;lk;ak;yc;constructor(t,i,s=e.el){this.lk=s,this.rk=this.lk.getImageData(0,0,t,i),this.ak=new Uint32Array(this.rk.data.buffer),this.yc=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.yc.fill(0)}bind(){h.A.bind(this.yc,this.width,this.height)}draw(t,i){this.#t(),this.lk.putImageData(this.rk,t,i)}#t(){const t=this.yc.length,i=this.yc,s=this.ak;for(let h=0;h>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},3955:(t,i,s)=>{s.d(i,{A:()=>h});class h{static AA=150;static Pf=108;static Df=70;static nf=81;static df=189;static Hw=7;static nw=88;static iw=30;static aw=176;static $d=220;static Vw=66;static Nw=17;static mw=2;static Uw=238;static Oy=233;static qf=146;static gf=215;static Nf=236;static eg=85;static bI=219;static Cw=140;static Lw=40;static bw=200;static Tw=178;static Ow=247;static Yw=138;static fw=239;static lw=194;static ew=8;static rw=27;static ow=113;static cw=100;static Ew=134;static pw=202;static dw=245;static Rw=172;static Xw=96;static Ww=97;static Kw=116;static _w=9;static qd=75;static jd=164;static Iw=53;static gw=185;static Xd=206;static ty=177;static Zw=248;static sw=195;static hw=71;static tw=133;static Jd=157;static Qd=211;static yw=48;static ww=130;static Fw=31;static Gw=59;static Dw=212;static Bw=38;static Pw=6;static xw=155;static Aw=235;static sA=231;static Sy=237;static Wf=175;static Wm=93;static Iy=190;static Hm=165;static Af=159;static Fy=171;static Py=79;static Ay=52;static Ry=244;static vy=148;static Ny=11;static Dy=118;static ky=4;static xy=158;static Gm=181}},3554:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(6666),e=s(1982),n=s(9234);class r{ck;fk;uk;closed=!1;dk=!1;static Kc=async t=>await new Promise(((i,s)=>{const h=t.host.startsWith('https'),e=h?'wss':'ws',n=t.host.substring(t.host.indexOf('//')+2),r=h?t.port+2:t.port+1,o=new WebSocket(`${e}://${n}:${r}`,'binary');o.addEventListener('open',(()=>{console.log('connection open!'),i(o)})),o.addEventListener('error',(()=>{console.log('connection error!'),s(o)}))}));constructor(t){t.onclose=this.onclose,t.onerror=this.onerror,this.fk=new a(t,5e3),this.uk=new o(t,5e3),this.ck=t}get host(){return this.ck.url.split('/')[2]}get port(){return parseInt(this.ck.url.split(':')[2],10)}get available(){return this.closed?0:this.fk.available}write(t,i){this.uk.write(t,i)}async read(){return this.closed?0:this.fk.wk()??await this.fk.yk()}async Xc(t,i,s){if(!this.closed)for(;s>0;){const h=this.fk.Ak(t,i,s)??await this.fk.pk(t,i,s);if(h.length<=0)throw new Error('EOF');i+=h.length,s-=h.length}}close(){this.closed=!0,this.ck.close(),this.fk.close(),this.uk.close(),console.log('connection close!'),this.dk&&console.log('connection error!')}onclose=t=>{this.closed||this.close()};onerror=t=>{this.closed||(this.dk=!0,this.close())}}class o{ck;mk;closed=!1;dk=!1;constructor(t,i){this.ck=t,this.mk=i}write(t,i){if(!this.closed){if(this.dk)throw this.dk=!1,new Error('Error in writer thread');if(i>this.mk||t.length>this.mk)throw new Error('buffer overflow');try{this.ck.send(t.subarray(0,i))}catch(t){this.dk=!0}}}close(){this.closed=!0}}class l extends e.A{qm;position;constructor(t){super(),this.qm=t,this.position=0}get available(){return this.qm.length-this.position}get read(){return this.qm[this.position++]}get Ik(){return this.qm.length}}class a{mk;queue=new h.A;event=null;gk=null;total=0;closed=!1;constructor(t,i){this.mk=i,t.binaryType='arraybuffer',t.onmessage=this.onmessage}get available(){return this.total}onmessage=t=>{if(this.closed)throw new Error('WebSocketReader is closed!');const i=new l(new Uint8Array(t.data));if(this.event?this.queue.yg(i):this.event=i,this.total+=i.Ik,this.gk&&(this.gk(this.event),this.gk=null,this.total>this.mk))throw new Error('buffer overflow')};Ek(){return this.event&&this.event.available>0?this.event.read:null}async _k(t){for(this.event=this.queue.ub();this.totalthis.gk=t)),(0,n.Jo)(2e3).then((()=>{if(this.closed)throw new Error('WebSocketReader closed while reading.')}))]);return this.event?this.event.read:this._k(t)}Ak(t,i,s){if(this.closed)throw new Error('WebSocketReader is closed!');if(!(this.event&&this.event.available>=s))return null;for(;s>0;){const h=this.Ek();if(null===h)throw new Error('EOF - tried to read a fast byte when there was not enough immediate bytes.');t[i++]=h,this.total--,s--}return t}async pk(t,i,s){if(this.closed)throw new Error('WebSocketReader is closed!');for(;s>0;)t[i++]=this.Ek()??await this._k(s),this.total--,s--;return t}wk(){if(this.closed)throw new Error('WebSocketReader is closed!');const t=this.Ek();return null===t?null:(this.total--,t)}async yk(){if(this.closed)throw new Error('WebSocketReader is closed!');const t=await this._k(1);return this.total--,t}close(){this.closed=!0,this.gk=null,this.total=0,this.event=null,this.queue.clear()}}},296:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(6666),e=s(1982),n=s(9234);class r{Co;Yo;Ck;closed=!1;dk=!1;constructor(t,i){this.Co=t,this.Co.onerror=this.onerror,this.Co.onmessageerror=this.onmessageerror,this.Yo=new a(5e3),this.Ck=new o(this.Co,5e3,i),this.Co.postMessage({type:'connection',id:i})}get available(){return this.closed?0:this.Yo.available}write(t,i){this.Ck.write(t,i)}async read(){return this.closed?0:this.Yo.wk()??await this.Yo.yk()}async Xc(t,i,s){if(!this.closed)for(;s>0;){const h=this.Yo.Ak(t,i,s)??await this.Yo.pk(t,i,s);if(h.length<=0)throw new Error('EOF');i+=h.length,s-=h.length}}close(){this.closed=!0,this.Yo.close(),this.Ck.close(),console.log('connection close!'),this.dk&&console.log('connection error!')}onerror=t=>{this.closed||(this.dk=!0,this.close())};onmessageerror=t=>{this.closed||(this.dk=!0,this.close())}}class o{Co;mk;Mo;closed=!1;dk=!1;constructor(t,i,s){this.Co=t,this.mk=i,this.Mo=s}write(t,i){if(!this.closed){if(this.dk)throw this.dk=!1,new Error('Error in writer thread');if(i>this.mk||t.length>this.mk)throw new Error('buffer overflow');try{this.Co.postMessage({type:'data',data:t.subarray(0,i),id:this.Mo})}catch(t){this.dk=!0}}}close(){this.closed=!0}}class l extends e.A{qm;position;constructor(t){super(),this.qm=t,this.position=0}get available(){return this.qm.length-this.position}get read(){return this.qm[this.position++]}get Ik(){return this.qm.length}}class a{mk;queue=new h.A;event=null;gk=null;total=0;closed=!1;constructor(t){this.mk=t}get available(){return this.total}onmessage=t=>{const i='string'==typeof t.data?JSON.parse(t.data):t;if('data'!==i.type)return void console.error('Unexpected message type: ',i.type);if(this.closed)throw new Error('WorkerReader is closed!');const s=new l(new Uint8Array(i.data));if(this.event?this.queue.yg(s):this.event=s,this.total+=s.Ik,this.gk&&(this.gk(this.event),this.gk=null,this.total>this.mk))throw new Error('buffer overflow')};Ek(){return this.event&&this.event.available>0?this.event.read:null}async _k(t){for(this.event=this.queue.ub();this.totalthis.gk=t)),(0,n.Jo)(2e3).then((()=>{if(this.closed)throw new Error('WorkerReader closed while reading.')}))]);return this.event?this.event.read:this._k(t)}Ak(t,i,s){if(this.closed)throw new Error('WorkerReader is closed!');if(!(this.event&&this.event.available>=s))return null;for(;s>0;){const h=this.Ek();if(null===h)throw new Error('EOF - tried to read a fast byte when there was not enough immediate bytes.');t[i++]=h,this.total--,s--}return t}async pk(t,i,s){if(this.closed)throw new Error('WorkerReader is closed!');for(;s>0;)t[i++]=this.Ek()??await this._k(s),this.total--,s--;return t}wk(){if(this.closed)throw new Error('WorkerReader is closed!');const t=this.Ek();return null===t?null:(this.total--,t)}async yk(){if(this.closed)throw new Error('WorkerReader is closed!');const t=await this._k(1);return this.total--,t}close(){this.closed=!0,this.gk=null,this.total=0,this.event=null,this.queue.clear()}}},4544:(t,i,s)=>{s.d(i,{A:()=>h});class h{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const s=indexedDB.open('lostcity',1);s.onsuccess=i=>{const s=i.target;console.log('database success!'),t(s.result)},s.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},s.onerror=t=>{const s=t.target;console.error('database error!: ',s.error),i(s.result)}}));zo=async t=>await new Promise((i=>{const s=this.db.transaction('cache','readonly').objectStore('cache').get(t);s.onsuccess=()=>{i(s.result)},s.onerror=t=>{i(void 0)}}));Qo=async(t,i)=>await new Promise(((s,h)=>{const e=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);e.onsuccess=()=>{s()},e.onerror=t=>{h()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};Tk=t=>{const i=t.trim();let s=0;for(let t=0;t='A'&&h<='Z'?s+=h.charCodeAt(0)+1-65:h>='a'&&h<='z'?s+=h.charCodeAt(0)+1-97:h>='0'&&h<='9'&&(s+=h.charCodeAt(0)+27-48)}return s}}},2634:(t,i,s)=>{s.d(i,{A:()=>h});class h{count=0;Ok=new Int32Array(256);vk=new Int32Array(256);a=0;b=0;c=0;constructor(t){for(let i=0;i>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i;for(let l=0;l<256;l+=8)t+=this.Ok[l],i+=this.Ok[l+1],s+=this.Ok[l+2],h+=this.Ok[l+3],e+=this.Ok[l+4],n+=this.Ok[l+5],r+=this.Ok[l+6],o+=this.Ok[l+7],t^=i<<11,h+=t,i+=s,i^=s>>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i,this.vk[l]=t,this.vk[l+1]=i,this.vk[l+2]=s,this.vk[l+3]=h,this.vk[l+4]=e,this.vk[l+5]=n,this.vk[l+6]=r,this.vk[l+7]=o;for(let l=0;l<256;l+=8)t+=this.vk[l],i+=this.vk[l+1],s+=this.vk[l+2],h+=this.vk[l+3],e+=this.vk[l+4],n+=this.vk[l+5],r+=this.vk[l+6],o+=this.vk[l+7],t^=i<<11,h+=t,i+=s,i^=s>>>2,e+=i,s+=h,s^=h<<8,n+=s,h+=e,h^=e>>>16,r+=h,e+=n,e^=n<<10,o+=e,n+=r,n^=r>>>4,t+=n,r+=o,r^=o<<8,i+=r,o+=t,o^=t>>>9,s+=o,t+=i,this.vk[l]=t,this.vk[l+1]=i,this.vk[l+2]=s,this.vk[l+3]=h,this.vk[l+4]=e,this.vk[l+5]=n,this.vk[l+6]=r,this.vk[l+7]=o;this.bk(),this.count=256}bk(){this.c++,this.b+=this.c;for(let t=0;t<256;t++){const i=this.vk[t],s=3&t;let h;0===s?this.a^=this.a<<13:1===s?this.a^=this.a>>>6:2===s?this.a^=this.a<<2:3===s&&(this.a^=this.a>>>16),this.a+=this.vk[t+128&255],this.vk[t]=h=this.vk[i>>>2&255]+this.a+this.b,this.Ok[t]=this.b=this.vk[h>>>8>>>2&255]+i}}}},2901:(t,i,s)=>{s.d(i,{A:()=>n});var h=s(1069),e=s(1908);class n{static Tk=t=>{let i=0;t=t.toUpperCase();for(let s=0;s=this.Rk)return null;if(this.Dk[t])return this.Dk[t];const i=this.xk[t],s=i+this.kk[t];if(this.Lk){const h=Uint8Array.from(this.buffer.subarray(i,i+s));return this.Dk[t]=h,h}{const i=Uint8Array.from(e.A.read(this.Mk[t],this.buffer,this.kk[t],this.xk[t]));return this.Dk[t]=i,i}}}},1069:(t,i,s)=>{s.d(i,{A:()=>r});var h=s(9234),e=s(6666),n=s(4474);class r extends n.A{static Pk=3988292384;static Fk=new Int32Array(256);static Uk=new Uint32Array(33);static Bk=new e.A;static Gk=new e.A;static Hk=new e.A;static Wk=0;static Yk=0;static Vk=0;static{for(let t=0;t<32;t++)r.Uk[t]=(1<>>=1:i=i>>>1^r.Pk;r.Fk[t]=i}}static Zo=t=>{let i=4294967295;for(let s=0;s>>8^r.Fk[255&(i^t[s])];return~i};view;data;jc=0;Zm=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.jc}static Ut=t=>{let i=null;return 0===t&&r.Wk>0?(r.Wk--,i=r.Bk.ub()):1===t&&r.Yk>0?(r.Yk--,i=r.Gk.ub()):2===t&&r.Vk>0&&(r.Vk--,i=r.Hk.ub()),i?(i.jc=0,i):new r(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.jc=0,100===this.view.byteLength&&r.Wk<1e3?(r.Bk.yg(this),r.Wk++):5e3===this.view.byteLength&&r.Yk<250?(r.Gk.yg(this),r.Yk++):3e4===this.view.byteLength&&r.Vk<50&&(r.Hk.yg(this),r.Vk++)}get cA(){return this.view.getUint8(this.jc++)}get lA(){return this.view.getInt8(this.jc++)}get rA(){const t=this.view.getUint16(this.jc);return this.jc+=2,t}get cp(){const t=this.view.getInt16(this.jc);return this.jc+=2,t}get E_(){const t=this.view.getUint8(this.jc++)<<16|this.view.getUint16(this.jc);return this.jc+=2,t}get il(){const t=this.view.getInt32(this.jc);return this.jc+=4,t}get zc(){const t=this.view.getBigInt64(this.jc);return this.jc+=8,t}get YR(){return this.view.getUint8(this.jc)<128?this.cA-64:this.rA-49152}get wO(){return this.view.getUint8(this.jc)<128?this.cA:this.rA-32768}get _A(){const t=this.view,i=t.byteLength;let s,h='';for(;10!==(s=t.getUint8(this.jc++))&&this.jc>16),this.view.setUint16(this.jc,t),this.jc+=2}p4(t){this.view.setInt32(this.jc,t),this.jc+=4}Xk(t){this.view.setInt32(this.jc,t,!0),this.jc+=4}gy(t){this.view.setBigInt64(this.jc,t),this.jc+=8}Zc(t){const i=this.view,s=t.length;for(let h=0;h>>3}zm(t){let i=this.Zm>>>3,s=8-(7&this.Zm),h=0;for(this.Zm+=t;t>s;s=8)h+=(this.view.getUint8(i++)&r.Uk[s])<>>s-t&r.Uk[t],h}qc(t,i){const s=this.jc;this.jc=0;const e=new Uint8Array(s);this.YA(s,0,e);const n=(0,h.jk)(e),r=(0,h.zk)(n,i,t),o=(0,h.Zk)(r);this.jc=0,this.p1(o.length),this.$c(o,o.length,0)}}},353:(t,i,s)=>{s.d(i,{A:()=>h});class h{static qk=[95,218,67,50,253,222,194,60,101,128,8,251,92,111,24,33,223,66,232,59,227,113,153,105,126,98,167,102,177,238,62,190,147,23,150,151,156,144,193,155,81,0,198,22,137,210,179,16,168,170,32,181,248,141,58,87,208,106,180,191,221,241,40,176,196,154,65,145,230,78,30,161,188,41,14,129,18,199,47,247,225,34,51,10,159,75,12,56,61,31,39,91,46,242,134,5,122,123,209,228,104,195,21,3,11,44,107,172,6,186,110,215,205,103,27,185,124,77,252,117,86,115,127,207,52,79,43,97,219,116,169,7,118,162,108,36,20,233,88,135,80,19,42,237,57,152,71,9,250,17,4,119,234,130,26,200,189,163,254,245,197,171,220,235,140,244,184,94,211,231,99,246,121,212,112,204,63,148,83,178,1,255,131,13,183,142,236,45,55,35,243,136,37,85,100,160,38,224,146,174,82,48,109,132,125,90,143,138,240,173,165,164,192,175,29,74,28,114,213,73,64,206,76,139,96,2,229,15,93,25,239,202,49,70,214,201,72,203,68,89,69,157,216,217,249,120,226,84,149,187,54,53,158,166,182,133,0];static nA=[0,-2,4,6,-1,0,0,2,0,0,0,0,5,4,2,2,0,0,0,0,2,-2,2,14,0,6,3,0,4,0,0,0,3,0,0,0,0,0,0,0,0,-1,4,2,6,0,6,0,0,3,7,0,0,0,-1,0,0,0,0,4,0,0,0,0,0,0,0,0,1,15,0,0,0,0,6,0,2,0,0,0,2,0,0,0,1,0,0,4,0,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,-2,0,0,2,0,0,0,2,9,0,0,0,0,0,4,0,0,0,3,7,9,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,3,2,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,-2,2,0,0,0,0,0,6,0,0,0,2,0,2,0,0,0,-2,0,0,4,0,0,0,0,6,0,0,-2,-2,0,0,0,0,0,0,-2,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0]}},5226:(t,i,s)=>{s.d(i,{Q:()=>e,x:()=>h});class h{$k=new Map;Co;Mo=self.isSecureContext?self.crypto.randomUUID():'0';constructor(t){this.Co=t}async Ko(){const t=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),i=t.createDataChannel('channel'),s=crypto.randomUUID();this.$k.set(s,i),await t.setLocalDescription(await t.createOffer()),t.onicegatheringstatechange=async()=>{if('complete'===t.iceGatheringState){let i;self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(t.localDescription)):console.log(JSON.stringify(t.localDescription));try{for(;null===(i=prompt('Offer copied to clipboard, paste answer here')););t.setRemoteDescription(new RTCSessionDescription(JSON.parse(i)))}catch(t){console.error(t)}}},i.onopen=()=>{i.send(JSON.stringify({type:'id',id:s})),console.log('Connected to peer!')},i.onerror=t=>{console.error(t)},i.onmessage=t=>{const i=JSON.parse(t.data);i.data&&(i.data=Object.values(i.data)),this.Co&&this.Co.postMessage(i)}}postMessage(t){const i=this.$k.get(t.data.id),s=t.data;s.data&&(s.data=Array.from(t.data.data)),i&&'open'===i.readyState&&i.send(JSON.stringify(s))}}class e{pc;So=void 0;Mo;constructor(t){this.pc=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),this.pc.ondatachannel=i=>{this.So=i.channel,this.So.onopen=()=>{console.log('Connected to host!')},this.So.onerror=t=>{console.error(t)},this.So.onmessage=i=>{if(!this.Mo){const t=JSON.parse(i.data);if('id'===t.type)return void(this.Mo=t.id)}t.onmessage&&t.onmessage(i)}},this.pc.onicegatheringstatechange=async()=>{'complete'===this.pc.iceGatheringState&&(self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(this.pc.localDescription)):console.log(JSON.stringify(this.pc.localDescription)))}}async Xo(t){await this.pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(t))),await this.pc.setLocalDescription(await this.pc.createAnswer())}}},2215:(t,i,s)=>{s.d(i,{A:()=>h});class h{static lp=14;static UA=28;static Np=129;static HA=167;static Rp=168;static rp=195;static Sp=2;static kp=26;static Op=46;static Cp=84;static Ip=87;static ep=103;static GA=146;static mA=197;static Pp=201;static sp=204;static ap=209;static $A=126;static gp=185;static ZA=15;static KA=98;static Hp=213;static _p=74;static Gp=13;static fp=3;static Dp=239;static dA=1;static Wp=184;static VA=133;static XA=226;static Tp=4;static xp=21;static np=32;static vy=41;static aA=152;static OA=19;static Bp=22;static gA=25;static fA=43;static Fp=44;static Ep=68;static Mp=136;static vA=139;static qA=140;static CA=142;static zA=243;static QA=254;static TA=20;static uA=80;static pp=132;static WA=220;static yA=237;static oA=150;static BA=175;static mp=193;static tp=12;static EA=54;static JA=212;static hp=7;static up=135;static Up=162;static LA=23;static DA=42;static kA=49;static RA=50;static PA=59;static MA=69;static NA=76;static bA=151;static SA=191;static xA=223}},3937:(t,i,s)=>{s.d(i,{A:()=>o});class h{start=0;end=0;form=0;length=0;Jk=null;Qk=null;threshold=0;position=0;delta=0;amplitude=0;tx=0;read(t){this.form=t.cA,this.start=t.il,this.end=t.il,this.length=t.cA,this.Jk=new Int32Array(this.length),this.Qk=new Int32Array(this.length);for(let i=0;i=this.threshold&&this.Qk&&this.Jk&&(this.amplitude=this.Qk[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this.Jk[this.position]/65536*t|0,this.threshold>this.tx&&(this.delta=((this.Qk[this.position]<<15)-this.amplitude)/(this.threshold-this.tx)|0)),this.amplitude+=this.delta,this.tx++,this.amplitude-this.delta>>15}}class e{static buffer=null;static KT=null;static sin=null;static ix=new Int32Array(5);static sx=new Int32Array(5);static hx=new Int32Array(5);static nx=new Int32Array(5);static ox=new Int32Array(5);lx=null;ux=null;wx=null;yx=null;Ax=null;mx=null;release=null;attack=null;Ix=new Int32Array(5);gx=new Int32Array(5);Ex=new Int32Array(5);start=0;length=500;_x=100;Cx=0;static init=()=>{this.KT=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.KT[t]=1:this.KT[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};sf(t,i){for(let i=0;i>1,r+=(i*h>>16)+n}if(this.Ax&&this.mx){const i=this.Ax.evaluate(t),s=this.mx.evaluate(t);c=c*(32768+(this.Tx(s,a,this.Ax.form)>>1))>>15,a+=(i*o>>16)+l}for(let h=0;h<5;h++)if(0!==this.Ix[h]){const n=i+e.sx[h];n>15,e.ix[h],this.lx.form),e.ix[h]+=(s*e.nx[h]>>16)+e.ox[h])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,s=!0;for(let h=0;h>8):this.release.start+((this.release.end-this.release.start)*r>>8),i+=256,i>=o&&(i=0,s=!s),s&&(e.buffer[h]=0)}}if(this.Cx>0&&this._x>0){const i=this.Cx*s;for(let s=i;s32767&&(e.buffer[i]=32767);return e.buffer}Tx(t,i,s){return 1===s?(32767&i)<16384?t:-t:2===s?e.sin[32767&i]*t>>14:3===s?((32767&i)*t>>14)-t:4===s?e.KT[i/2607&32767]*t:0}read(t){this.lx=new h,this.lx.read(t),this.ux=new h,this.ux.read(t),0!==t.cA&&(t.jc--,this.wx=new h,this.wx.read(t),this.yx=new h,this.yx.read(t)),0!==t.cA&&(t.jc--,this.Ax=new h,this.Ax.read(t),this.mx=new h,this.mx.read(t)),0!==t.cA&&(t.jc--,this.release=new h,this.release.read(t),this.attack=new h,this.attack.read(t));for(let i=0;i<10;i++){const s=t.wO;if(0===s)break;this.Ix[i]=s,this.gx[i]=t.YR,this.Ex[i]=t.wO}this.Cx=t.wO,this._x=t.wO,this.length=t.rA,this.start=t.rA}}var n=s(1069),r=s(3867);class o{static ip=new Int32Array(1e3);static Ox=null;static vx=null;static bx=new r.ds(1e3,null);Lx=new r.ds(10,null);Rx=0;loopEnd=0;static wc=t=>{const i=new n.A(t.read('sounds.dat'));for(this.Ox=new Uint8Array(441e3),this.vx=new n.A(this.Ox),e.init();;){const t=i.rA;if(65535===t)break;const s=new o;s.read(i),this.bx[t]=s,this.ip[t]=s.trim()}};static sf=(t,i)=>{if(!this.bx[t])return null;const s=this.bx[t];return s?.Sx(i)??null};read(t){for(let i=0;i<10;i++)0!==t.cA&&(t.jc--,this.Lx[i]=new e,this.Lx[i]?.read(t));this.Rx=t.rA,this.loopEnd=t.rA}trim(){let t=9999999;for(let i=0;i<10;i++)this.Lx[i]&&(this.Lx[i].start/20|0)i&&(i=this.Lx[t].length+this.Lx[t].start);if(0===i)return 0;let s=22050*i/1e3|0,h=22050*this.Rx/1e3|0,e=22050*this.loopEnd/1e3|0;(h<0||e<0||e>s||h>=e)&&(t=0);let n=s+(e-h)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){h+=44,e+=44,s+=44,n+=44;const i=n-s;for(let t=s-1;t>=e;t--)o.Ox&&(o.Ox[t+i]=o.Ox[t]);for(let i=1;i{s.d(i,{oc:()=>a,rc:()=>o,ds:()=>h,EO:()=>e,Cr:()=>n,mO:()=>r,Kn:()=>l});class h extends Array{constructor(t,i){super(t);for(let s=0;s{s.d(i,{Zk:()=>l,$o:()=>e,jk:()=>o,Jo:()=>h,sc:()=>n,Nc:()=>r,zk:()=>a});const h=async t=>new Promise((i=>setTimeout(i,t))),e=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),n=async t=>(await fetch(t)).text();function r(t,i,s,h,e){for(;e--;)s[h++]=t[i++]}function o(t){let i=0n;for(let s=0;s0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function a(t,i,s){let h=1n;for(;i>0n;)i%2n===1n&&(h=h*t%s),t=t*t%s,i>>=1n;return h}},7953:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(1069);class e{static Mx=new Uint16Array(['d','o','t'].join('').split('').map((t=>t.charCodeAt(0))));static kx=new Uint16Array(['(','a',')'].join('').split('').map((t=>t.charCodeAt(0))));static xx=new Uint16Array(['s','l','a','s','h'].join('').split('').map((t=>t.charCodeAt(0))));static Dx=['cook',"cook's",'cooks','seeks','sheet'];static Nx=[];static Px=[];static Fx=[];static Ux=[];static Bx=[];static Gx=[];static wc=t=>{const i=new h.A(t.read('fragmentsenc.txt')),s=new h.A(t.read('badenc.txt')),e=new h.A(t.read('domainenc.txt')),n=new h.A(t.read('tldlist.txt'));this.read(s,e,i,n)};static filter=t=>{const i=[...t];this.format(i);const s=i.join('').trim(),h=s.toLowerCase(),e=[...h];this.Hx(e),this.Wx(e),this.Yx(e),this.Vx(e);for(let t=0;t{this.jx(t),this.zx(i),this.Zx(s),this.qx(h)};static qx=t=>{const i=t.il;for(let s=0;st.cA))};static jx=t=>{const i=t.il;for(let s=0;st.cA));const i=new Array(t.cA).fill([]).map((()=>[t.lA,t.lA]));i.length>0&&(this.Ux[s]=i)}};static zx=t=>{const i=t.il;for(let s=0;st.cA))};static Zx=t=>{const i=t.il;for(let s=0;s{const i=[...t],s=[...t];this.$x(null,i,this.Mx),this.$x(null,s,this.xx);for(let h=0;h{for(let i=0;i<2;i++)for(let i=this.Fx.length-1;i>=0;i--)this.$x(this.Ux[i],t,this.Fx[i])};static Yx=t=>{const i=[...t],s=[...t];this.$x(null,i,this.kx),this.$x(null,s,this.Mx);for(let h=this.Bx.length-1;h>=0;h--)this.Qx(s,i,this.Bx[h],t)};static Vx=t=>{for(let i=0;i=0&&e{if(this.rD(t))return!0;const i=this.oD(t),s=this.Gx,h=s.length;if(i===s[0]||i===s[h-1])return!0;let e=0,n=h-1;for(;e<=n;){const t=(e+n)/2|0;if(i===s[t])return!0;i{if(t.length>6)return 0;let i=0;for(let s=0;s{for(let s=i;s=0;s++)if(this.aD(t[s]))return s;return-1};static eD=(t,i)=>{for(let s=t;s=0;s++)if(!this.aD(i[s]))return s;return i.length};static cD=(t,i,s)=>i===s||'o'===i&&'0'===s?1:'o'===i&&'('===s&&')'===t?2:'c'!==i||'('!==s&&'<'!==s&&'['!==s?'e'===i&&'€'===s||'s'===i&&'$'===s||'l'===i&&'i'===s?1:0:1;static Qx=(t,i,s,h)=>{const e=s.length,n=h.length;for(let r=0;r<=n-e;r++){const{fD:e,uD:n}=this.dD(r,s,h);if(!e)continue;const o=this.wD(r,h,3,i,['@']),l=this.yD(n-1,h,3,t,['.',',']);(o>2||l>2)&&this.hD(r,n,h)}};static dD=(t,i,s)=>{const h=i.length;let e=t,n=0;for(;e0)e+=l,n++;else{if(0===n)break;const s=this.cD(o,String.fromCharCode(i[n-1]),r);if(s>0)e+=s,1===n&&t++;else{if(n>=h||!this.iD(r))break;e++}}}return{fD:n>=h,uD:e}};static $x=(t,i,s)=>{if(!(s.length>i.length))for(let h=0;h<=i.length-s.length;h++){let e=h;const{uD:n,AD:r,pD:o,mD:l,ID:a}=this.gD(i,s,e);e=n;let c=i[e],f=e+1=s.length)||l&&a)continue;let u,d=!0;if(o){let t=!1,s=!1;if((h-1<0||this.iD(i[h-1])&&"'"!==i[h-1])&&(t=!0),(e>=i.length||this.iD(i[e])&&"'"!==i[e])&&(s=!0),!t||!s){let s=!1;for(u=h-2,t&&(u=h);!s&&u=0&&(!this.iD(i[u])||"'"===i[u])){const t=[];let h;for(h=0;h<3&&u+h=0&&(!this.iD(i[u-1])||"'"===i[u-1])&&(e=!1),e&&!this.nD(t)&&(s=!0)}u++}s||(d=!1)}}else{c=' ',h-1>=0&&(c=i[h-1]),f=' ',e{let h=s,e=0,n=0,r=!1,o=!1,l=!1;for(;h=t.length||o&&l);){const a=t[h],c=h+10)1===f&&this.aD(a)&&(o=!0),2===f&&(this.aD(a)||this.aD(c))&&(o=!0),h+=f,e++;else{if(0===e)break;let t;if((t=this.TD(c,String.fromCharCode(i[e-1]),a))>0)h+=t;else{if(e>=i.length||!this.sD(a))break;if(this.iD(a)&&"'"!==a&&(r=!0),this.aD(a)&&(l=!0),h++,n++,(100*n/(h-s)|0)>90)break}}}return{uD:h,AD:e,pD:r,mD:o,ID:l}};static TD=(t,i,s)=>{if(i===s)return 1;if(i>='a'&&i<='m'){if('a'===i)return'4'!==s&&'@'!==s&&'^'!==s?'/'===s&&'\\'===t?2:0:1;if('b'===i)return'6'!==s&&'8'!==s?'1'===s&&'3'===t?2:0:1;if('c'===i)return'('!==s&&'<'!==s&&'{'!==s&&'['!==s?0:1;if('d'===i)return'['===s&&')'===t?2:0;if('e'===i)return'3'!==s&&'€'!==s?0:1;if('f'===i)return'p'===s&&'h'===t?2:'£'===s?1:0;if('g'===i)return'9'!==s&&'6'!==s?0:1;if('h'===i)return'#'===s?1:0;if('i'===i)return'y'!==s&&'l'!==s&&'j'!==s&&'1'!==s&&'!'!==s&&':'!==s&&';'!==s&&'|'!==s?0:1;if('j'===i)return 0;if('k'===i)return 0;if('l'===i)return'1'!==s&&'|'!==s&&'i'!==s?0:1;if('m'===i)return 0}if(i>='n'&&i<='z'){if('n'===i)return 0;if('o'===i)return'0'!==s&&'*'!==s?'('===s&&')'===t||'['===s&&']'===t||'{'===s&&'}'===t||'<'===s&&'>'===t?2:0:1;if('p'===i)return 0;if('q'===i)return 0;if('r'===i)return 0;if('s'===i)return'5'!==s&&'z'!==s&&'$'!==s&&'2'!==s?0:1;if('t'===i)return'7'!==s&&'+'!==s?0:1;if('u'===i)return'v'===s?1:'\\'===s&&'/'===t||'\\'===s&&'|'===t||'|'===s&&'/'===t?2:0;if('v'===i)return'\\'===s&&'/'===t||'\\'===s&&'|'===t||'|'===s&&'/'===t?2:0;if('w'===i)return'v'===s&&'v'===t?2:0;if('x'===i)return')'===s&&'('===t||'}'===s&&'{'===t||']'===s&&'['===t||'>'===s&&'<'===t?2:0;if('y'===i)return 0;if('z'===i)return 0}return i>='0'&&i<='9'?'0'===i?'o'===s||'O'===s?1:'('===s&&')'===t||'{'===s&&'}'===t||'['===s&&']'===t?2:0:'1'===i&&'l'===s?1:0:','===i?'.'===s?1:0:'.'===i?','===s?1:0:'!'===i&&'i'===s?1:0};static _D=(t,i,s)=>{let h=0,e=i.length-1;for(;h<=e;){const n=(h+e)/2|0;if(i[n][0]===t&&i[n][1]===s)return!0;tthis.lD(t)?t.charCodeAt(0)+1-'a'.charCodeAt(0):"'"===t?28:this.aD(t)?t.charCodeAt(0)+29-'0'.charCodeAt(0):27;static Jx=(t,i,s,h,e)=>{if(!(h.length>s.length))for(let n=0;n<=s.length-h.length;n++){const{uD:r,OD:o}=this.vD(s,h,n);if(o0&&c>0&&(l=!0),2===i&&(a>2&&c>0||a>0&&c>2)&&(l=!0),3===i&&a>0&&c>2&&(l=!0),!l)continue;let f,u=n,d=r-1,w=!1;if(a>2){if(4===a)for(w=!1,f=n-1;f>=0;f--)if(w){if('*'!==e[f])break;u=f}else'*'===e[f]&&(u=f,w=!0);for(w=!1,f=u-1;f>=0;f--)if(w){if(this.iD(s[f]))break;u=f}else this.iD(s[f])||(w=!0,u=f)}if(c>2){if(4===c)for(w=!1,f=d+1;f{let h=0;for(;s0)s+=r,h++;else{if(0===h)break;let t;if((t=this.cD(n,String.fromCharCode(i[h-1]),e))>0)s+=t;else{if(!this.iD(e))break;s++}}}return{uD:s,OD:h}};static iD=t=>!this.CD(t)&&!this.aD(t);static sD=t=>!this.lD(t)||('v'===t||'x'===t||'j'===t||'q'===t||'z'===t);static CD=t=>this.lD(t)||this.bD(t);static aD=t=>t>='0'&&t<='9';static lD=t=>t>='a'&&t<='z';static bD=t=>t>='A'&&t<='Z';static rD=t=>{for(let i=0;i{for(let h=t;h{let s=0;for(let h=i-1;h>=0&&this.iD(t[h]);h--)'*'===t[h]&&s++;return s};static RD=(t,i)=>{let s=0;for(let h=i+1;h(e?this.LD(i,s):this.RD(i,s))>=h?4:this.iD(e?t[s-1]:t[s+1])?1:0;static wD=(t,i,s,h,e)=>{if(0===t)return 2;for(let s=t-1;s>=0&&this.iD(i[s]);s--)if(e.includes(i[s]))return 3;return this.SD(i,h,t,s,!0)};static yD=(t,i,s,h,e)=>{if(t+1===i.length)return 2;for(let s=t+1;s{let i=0;for(let s=0;st>=' '&&t<=''||' '===t||'\n'===t||'\t'===t||'£'===t||'€'===t;static Kx=(t,i)=>{for(let s=0;s{let i=!0;for(let s=0;s{s.d(i,{A:()=>h});class h{static kD=[' ','e','t','a','o','i','h','n','s','r','d','l','u','m','w','c','y','f','g','p','b','v','k','x','j','q','z','0','1','2','3','4','5','6','7','8','9',' ','!','?','.',',',':',';','(',')','-','&','*','\\','\'','@','#','+','=','£','$','%','"','[',']'];static xD=[];static wc=(t,i)=>{let s,h=0,e=-1;for(let n=0;n>4&15,-1!==e?(this.xD[h++]=this.kD[(e<<4)+s-195],e=-1):s<13?this.xD[h++]=this.kD[s]:e=s,s=15&i,-1!==e?(this.xD[h++]=this.kD[(e<<4)+s-195],e=-1):s<13?this.xD[h++]=this.kD[s]:e=s}let n=!0;for(let t=0;t='a'&&i<='z'&&(this.xD[t]=i.toUpperCase(),n=!1),'.'!==i&&'!'!==i||(n=!0)}return this.xD.slice(0,h).join('')};static by=(t,i)=>{i.length>80&&(i=i.substring(0,80)),i=i.toLowerCase();let s=-1;for(let h=0;h12&&(n+=195),-1===s?n<13?s=n:t.p1(n):n<13?(t.p1((s<<4)+n),s=-1):(t.p1((s<<4)+(n>>4)),s=15&n)}-1!==s&&t.p1(s<<4)}}},1908:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(9763);class e{static DD=null;static load=async t=>{this.DD=await(0,h.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,s,h)=>{if(!this.DD)throw new Error('bz2 not found!!');return Int8Array.from(this.DD.read(t,i,s,h))}}},123:(t,i,s)=>{let h;async function e(t,i){n(i);try{const i=await window.audioContext.decodeAudioData(Uint8Array.from(t).buffer);let s=window.audioContext.createBufferSource();s.buffer=i,s.connect(h),s.start()}catch(t){console.log(t)}}function n(t){h||(h=window.audioContext.createGain(),h.connect(window.audioContext.destination)),h.gain.value=t/256}function r(t,i,s){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256,s)}function o(t){window._tinyMidiVolume&&window._tinyMidiVolume(t/256)}function l(t){window._tinyMidiStop&&window._tinyMidiStop(t)}s.d(i,{hf:()=>e,sl:()=>r,nm:()=>n,ko:()=>l,hm:()=>o})},2604:(t,i,s)=>{function h(t,i){var s;(s=document.createElement('a')).href=t,s.download=i,document.body.appendChild(s),s.style='display: none',s.click(),s.remove()}s.d(i,{A:()=>h})},9763:(t,i,s)=>{async function h(t,i={}){const s={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,s,h){t=r(t>>>0),i=r(i>>>0),s>>>=0,h>>>=0,(()=>{throw Error(`${t} in ${i}:${s}:${h}`)})()}})},{exports:h}=await WebAssembly.instantiate(t,s),e=h.memory||i.env.memory,n=Object.setPrototypeOf({read:(t,i,s,n)=>(i=function(t,i,s,n,r){if(null==n)return 0;const o=n.length,l=h.__pin(h.__new(o<>>0;if(r)new r(e.buffer,l,o).set(n);else for(let i=0;i>>0),n[i]);return h.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,s){if(!s)return null;const h=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(e.buffer),o.getUint32(t,!0)}}(s-4)>>>i,n=new Array(h);for(let e=0;e>>0));return n}(a,0,h.read(t,i,s,n)>>>0))},h);function r(t){if(!t)return null;const i=t+new Uint32Array(e.buffer)[t-4>>>2]>>>1,s=new Uint16Array(e.buffer);let h=t>>>1,n="";for(;i-h>1024;)n+=String.fromCharCode(...s.subarray(h,h+=1024));return n+String.fromCharCode(...s.subarray(h,i))}let o=new DataView(e.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(e.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(e.buffer),o.getInt8(t,!0)}}return n}s.d(i,{F:()=>h})},9896:(t,i,s)=>{var h=s(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var s=window.audioContext.createBuffer(1,1,22050),h=window.audioContext.createBufferSource();h.buffer=s,h.connect(window.audioContext.destination),h.start?h.start(0):h.play?h.play(0):h.noteOn&&h.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{const t=2,i=44100;let s=new Float32Array,e=window.audioContext.createGain();e.gain.setValueAtTime(.1,window.audioContext.currentTime),e.connect(window.audioContext.destination);let n=window.audioContext.currentTime,r=[];const o=new h.A({ND:30,PD:t=>{let i=new Float32Array(t.buffer),h=new Float32Array(s.length+i.length);h.set(s,0),h.set(i,s.length),s=h},FD:t=>{},bufferSize:102400});await o.init();const l=await fetch('./SCC1_Florestan.sf2'),a=new Uint8Array(await l.arrayBuffer());function c(){if(!window.audioContext||!s.length)return;let h=window.audioContext.createBufferSource();const o=s.length/t,l=window.audioContext.createBuffer(t,o,i);for(let i=0;i{t.stop(window.audioContext.currentTime)})),r=[],e.gain.setValueAtTime(t,window.audioContext.currentTime)}}function d(t,i){-1!==t&&window._tinyMidiVolume(t),n=window.audioContext.currentTime,f=setInterval(c,250),o.UD(i)}o.BD(a),window._tinyMidiStop=async t=>{t?function(t){const i=window.audioContext.currentTime;e.gain.cancelScheduledValues(i),e.gain.setTargetAtTime(0,i,.5),setTimeout(t,2e3)}((()=>{u()})):u()},window._tinyMidiVolume=(t=1)=>{e.gain.setValueAtTime(t,window.audioContext.currentTime)},window._tinyMidiPlay=async(t,i,s)=>{t&&(await window._tinyMidiStop(s),s?setTimeout((()=>{d(i,t)}),2e3):d(i,t))}})()},8151:(t,i,s)=>{s.d(i,{A:()=>e});var h=s(5473);const e=class{constructor(t={}){this.GD=void 0,this.HD=0,this.WD=0,this.YD=0,this.ND=t.ND||100,this.sampleRate=t.sampleRate||44100,this.VD=t.VD||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.KD(1),this.PD=t.PD||(()=>{}),this.FD=t.FD||(()=>{}),this.XD=void 0,this.test=0}async init(){if(!this.GD){if('undefined'!=typeof process){const{jD:t}=await import('path'),{zD:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.GD=await(0,h.A)(),this.ZD=this.GD._malloc(this.bufferSize),this.qD=this.GD._malloc(8)}}KD(t){this.bufferSize=4*this.sampleRate*this.VD*t}$D(){if(!this.GD)throw new Error(`${this.constructor.name} not initalized. call .init()`)}BD(t){this.$D();const{_malloc:i,_free:s,_tsf_load_memory:h,_tsf_set_output:e,_tsf_channel_set_bank_preset:n,_tsf_set_max_voices:r,_tsf_channel_set_presetnumber:o}=this.GD;s(this.HD),this.HD=i(t.length),this.GD.HEAPU8.set(t,this.HD),this.WD=h(this.HD,t.length),e(this.WD,2===this.VD?0:2,this.sampleRate,this.gain)}JD(){this.$D();const t=new Uint8Array(this.bufferSize);return t.set(this.GD.HEAPU8.subarray(this.ZD,this.ZD+this.bufferSize)),t}QD(t){const{_malloc:i,_free:s,_tml_load_memory:h}=this.GD;return s(this.YD),this.YD=i(t.length),this.GD.HEAPU8.set(t,this.YD),h(this.YD,t.length)}tN(t){const{_midi_render:i}=this.GD;return i(this.WD,t,this.VD,this.sampleRate,this.ZD,this.bufferSize,this.qD)}UD(t){if(this.$D(),!this.WD)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.XD);const{setValue:i,getValue:s}=this.GD;i(this.qD,0,'double'),this.GD._tsf_reset(this.WD),this.GD._tsf_channel_set_bank_preset(this.WD,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let h=this.QD(t);const e=()=>{h=this.tN(h);const t=this.JD();this.PD(t),h?this.XD=setTimeout(e,this.ND):this.FD(s(this.qD,'double'))};this.XD=setTimeout(e,16)}}},8227:(t,i,s)=>{t.exports=s.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,s)=>{var h;s.d(i,{A:()=>e});const e=(h="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,e,n=void 0!==(t=t||{})?t:{};n.ready=new Promise((function(t,s){i=t,e=s})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(n.ready,t)||Object.defineProperty(n.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var r=Object.assign({},n),o=[],l='object'==typeof window,a='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!l&&!c&&!a;if(n.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var A,p;y=a?require('path').jD(y)+'/':__dirname+'/';var m=()=>{p||(A=require('fs'),p=require('path'))};u=(t,i)=>(m(),t=p.normalize(t),A.iN(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,s)=>{m(),t=p.normalize(t),A.sN(t,(function(t,h){t?s(t):i(h.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof et))throw t})),process.on('unhandledRejection',(function(t){throw t})),n.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,s){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!l&&!a)throw new Error('environment detection error');if(a?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),h&&(y=h),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},a&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,s)=>{var h=new XMLHttpRequest;h.open('GET',t,!0),h.responseType='arraybuffer',h.onload=()=>{200==h.status||0==h.status&&h.response?i(h.response):s()},h.onerror=s,h.send(null)}}n.print||console.log.bind(console);var I,g,E=n.printErr||console.warn.bind(console);function _(t,i){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function C(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(n,r),r=null,I='fetchSettings',Object.getOwnPropertyDescriptor(n,I)&&j('`Module.'+I+'` was supplied but `'+I+'` not included in INCOMING_MODULE_JS_API'),n.arguments&&(o=n.arguments),_('arguments','arguments_'),n.thisProgram&&n.thisProgram,_('thisProgram','thisProgram'),n.quit&&n.quit,_('quit','quit_'),D(void 0===n.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===n.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===n.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===n.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===n.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===n.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),_('read','read_'),_('readAsync','readAsync'),_('readBinary','readBinary'),_('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),n.wasmBinary&&(g=n.wasmBinary),_('wasmBinary','wasmBinary');var T;n.noExitRuntime;_('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var O,v,b,L,R,S,M,k,x=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function N(t){O=t,n.HEAP8=v=new Int8Array(t),n.HEAP16=L=new Int16Array(t),n.HEAP32=R=new Int32Array(t),n.HEAPU8=b=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=S=new Uint32Array(t),n.HEAPF32=M=new Float32Array(t),n.HEAPF64=k=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var P=5242880;n.TOTAL_STACK&&D(P===n.TOTAL_STACK,'the stack size can no longer be determined at runtime');var F=n.INITIAL_MEMORY||16777216;function U(){if(!x){var t=ft(),i=S[t>>2],s=S[t+4>>2];34821223==i&&2310721022==s||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+s.toString(16)+' 0x'+i.toString(16)),1668509029!==S[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}_('INITIAL_MEMORY','INITIAL_MEMORY'),D(F>=P,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+F+'! (TOTAL_STACK='+P+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!n.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==F,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var B=[],G=[],H=[],W=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var Y=0,V=null,K=null,X={};function j(t){n.onAbort&&n.onAbort(t),E(t='Aborted('+t+')'),x=!0;var i=new WebAssembly.RuntimeError(t);throw e(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},hN:function(){z.error()},eN:function(){z.error()},nN:function(){z.error()},open:function(){z.error()},rN:function(){z.error()},oN:function(){z.error()},lN:function(){z.error()},aN:function(){z.error()},cN:function(){z.error()}};n.FS_createDataFile=z.hN,n.FS_createPreloadedFile=z.eN;var Z,q,$,J,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function st(t,i){return function(){var s=t,h=i;return i||(h=n.asm),D(W,'native function `'+s+'` called before runtime initialization'),h[t]||D(h[t],'exported native function `'+s+'` not found'),h[t].apply(null,arguments)}}function ht(t){try{if(t==Z&&g)return new Uint8Array(g);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function et(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function nt(t){for(;t.length>0;)t.shift()(n)}function rt(t){rt.fN||(rt.fN={}),rt.fN[t]||(rt.fN[t]=1,c&&(t='warning: '+t),E(t))}function ot(t){try{return T.grow(t-O.byteLength+65535>>>16),N(T.buffer),1}catch(i){E('emscripten_realloc_buffer: Attempted to grow heap from '+O.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}n.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=n.locateFile?n.locateFile(q,y):y+q):Z=new URL(s(8227),s.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,s){b.copyWithin(t,i,i+s)},"emscripten_resize_heap":function(t){var i=b.length;D((t>>>=0)>i);var s,h,e=2147483648;if(t>e)return E('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+e+' bytes!'),!1;for(var n=1;n<=4;n*=2){var r=i*(1+.2/n);r=Math.min(r,t+100663296);var o=Math.min(e,(s=Math.max(t,r))+((h=65536)-s%h)%h);if(ot(o))return!0}return E('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function s(t,i){var s,h=t.exports;n.asm=h,D(T=n.asm.memory,"memory not found in wasm exports"),N(T.buffer),D(n.asm.__indirect_function_table,"table not found in wasm exports"),s=n.asm.__wasm_call_ctors,G.unshift(s),function(t){if(Y--,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(D(X[t]),delete X[t]):E('warning: run dependency removed without ID'),0==Y&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',Y++,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(x)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,E('still waiting on run dependencies:')),E('dependency: '+i);t&&E('(end of list)')}),1e4))):E('warning: run dependency added without ID');var h=n;function r(t){D(n===h,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),h=null,s(t.instance)}function o(t){return function(){if(!g&&(l||a)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return ht(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return ht(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){E('failed to asynchronously prepare wasm: '+t),it(Z)&&E('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(n.instantiateWasm)try{return n.instantiateWasm(i,s)}catch(t){E('Module.instantiateWasm callback failed with error: '+t),e(t)}(g||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(r):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(r,(function(t){return E('wasm streaming compile failed: '+t),E('falling back to ArrayBuffer instantiation'),o(r)}))}))).catch(e)}(),n.___wasm_call_ctors=st("__wasm_call_ctors"),n._malloc=st("malloc"),n._free=st("free"),n._tsf_load_memory=st("tsf_load_memory"),n._tsf_close=st("tsf_close"),n._tsf_reset=st("tsf_reset"),n._tsf_set_output=st("tsf_set_output"),n._tsf_set_max_voices=st("tsf_set_max_voices"),n._realloc=st("realloc"),n._tsf_channel_set_presetnumber=st("tsf_channel_set_presetnumber"),n._tsf_channel_set_bank_preset=st("tsf_channel_set_bank_preset"),n._tml_load_memory=st("tml_load_memory"),n._midi_render=st("midi_render"),n.___errno_location=st("__errno_location"),n._fflush=st("fflush"),n._emscripten_stack_init=function(){return(ct=n._emscripten_stack_init=n.asm.emscripten_stack_init).apply(null,arguments)}),ft=(n._emscripten_stack_get_free=function(){return(n._emscripten_stack_get_free=n.asm.emscripten_stack_get_free).apply(null,arguments)},n._emscripten_stack_get_base=function(){return(n._emscripten_stack_get_base=n.asm.emscripten_stack_get_base).apply(null,arguments)},n._emscripten_stack_get_end=function(){return(ft=n._emscripten_stack_get_end=n.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),S[t>>2]=34821223,S[t+4>>2]=2310721022,S[0]=1668509029}function dt(t){function s(){lt||(lt=!0,n.calledRun=!0,x||(D(!W),W=!0,U(),nt(G),i(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),D(!n._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),n.postRun)for('function'==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),H.unshift(t);var t;nt(H)}()))}t=t||o,Y>0||(ut(),function(){if(n.preRun)for('function'==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),B.unshift(t);var t;nt(B)}(),Y>0||(n.setStatus?(n.setStatus('Running...'),setTimeout((function(){setTimeout((function(){n.setStatus('')}),1),s()}),1)):s(),U()))}if(n.stackSave=st("stackSave"),n.stackRestore=st("stackRestore"),n.stackAlloc=st("stackAlloc"),n.setValue=function(t,i,s="i8"){switch(s.endsWith('*')&&(s='*'),s){case'i1':case'i8':v[0|t]=i;break;case'i16':L[t>>1]=i;break;case'i32':R[t>>2]=i;break;case'i64':J=[i>>>0,($=i,+Math.abs($)>=1?$>0?(0|Math.min(+Math.floor($/4294967296),4294967295))>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],R[t>>2]=J[0],R[t+4>>2]=J[1];break;case'float':M[t>>2]=i;break;case'double':k[t>>3]=i;break;case'*':S[t>>2]=i;break;default:j('invalid type for setValue: '+s)}},n.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return v[0|t];case'i16':return L[t>>1];case'i32':case'i64':return R[t>>2];case'float':return M[t>>2];case'double':return k[t>>3];case'*':return S[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),rt(i)}})})),K=function t(){lt||dt(),lt||(K=t)},n.preInit)for('function'==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return dt(),t.ready})}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var s=n[t]={exports:{}};return e[t](s,s.exports,r),s.exports}r.m=e,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",s="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",h=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},r.a=(e,n,r)=>{var o;r&&((o=[]).d=-1);var l,a,c,f=new Set,u=e.exports,d=new Promise(((t,i)=>{c=i,a=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),e.exports=d,n((e=>{var n;l=(e=>e.map((e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){var n=[];n.d=0,e.then((t=>{r[i]=t,h(n)}),(t=>{r[s]=t,h(n)}));var r={};return r[t]=t=>t(n),r}}var o={};return o[t]=t=>{},o[i]=e,o})))(e);var r=()=>l.map((t=>{if(t[s])throw t[s];return t[i]})),a=new Promise((i=>{(n=()=>i(r)).r=0;var s=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(n.r++,t.push(n)));l.map((i=>i[t](s)))}));return n.r?a:r()}),(t=>(t?c(d[s]=t):a(u),h(o)))),o&&o.d<0&&(o.d=0)},r.d=(t,i)=>{for(var s in i)r.o(i,s)&&!r.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:i[s]})},r.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),r.p="/Client2/",r.b=document.baseURI||self.location.href;r(7906)})(); \ No newline at end of file diff --git a/interface-editor.js b/interface-editor.js index 9bfb26a9..1a6c307e 100644 --- a/interface-editor.js +++ b/interface-editor.js @@ -1 +1 @@ -(()=>{"use strict";var t,i,e,s,n={1651:(t,i,e)=>{e.d(i,{K:()=>D});var s=e(1120),n=e(4583),r=e(2901),h=e(1069),o=e(7046),a=(e(9896),e(6666)),l=e(3045),c=e(818),f=e(670),u=e(8268),d=e(3867),w=e(7854),y=e(8950),A=e(1302),m=e(9298),p=e(8665),g=e(1312),I=e(3819),_=e(8317),C=e(9234),E=e(1908),v=e(123),b=e(5637),T=e(6948),O=e(2164),R=e(8738),S=e(3764),L=e(8534),x=e(6730),k=e(2604),M=e(5226);class D extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static et=!1;static st='';static nt='';static rt=!1;static ht=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static gt=0;static It=0;static _t=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Ot=0;static Rt=()=>{l.A.et=!1,n.A.et=!1,D.et=!1,c.A.et=!1};static St=()=>{l.A.et=!0,n.A.et=!0,D.et=!0,c.A.et=!0};Lt=2048;xt=2047;kt=!1;Mt=!1;Dt=!1;Nt=!1;db=null;Ft=0;Bt=[];stream=null;in=h.A.Ut(1);Pt=h.A.Ut(1);Wt=h.A.Ut(1);Gt=0n;Yt=0;Ht=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;Jt=!0;$t=0;Qt=0;ti=null;ii=null;ei=null;si=null;ni=null;ri=null;hi=null;oi=null;ai=null;li=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;Ai=null;mi=[];pi=!1;gi=null;Ii=null;_i=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Oi=null;Ri=null;Si=new Int32Array(256);Li=0;xi=0;ki=0;Mi=null;Di=null;Ni=null;Fi=null;Bi=null;Ui=null;Pi=null;Wi=null;Gi=null;Yi=null;Hi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;Ji=null;$i=null;Qi=null;te=new Int32Array(33);ie=new Int32Array(33);ee=new Int32Array(151);se=new Int32Array(151);ne=null;re=null;he=null;oe=null;ae=null;le=null;ce=new d.fe(13,null);ue=null;de=null;we=new d.fe(50,null);ye=new d.fe(50,null);Ae=new d.fe(20,null);me=new d.fe(20,null);pe=null;ge=new d.fe(8,null);Ie=null;_e=null;Ce=null;Ee=null;ve=null;be=null;Te=null;Oe=null;Re=null;Se=null;Le=null;xe=null;ke=null;Me=null;De=null;Ne=null;Fe=null;Be=null;Ue=new d.fe(1e3,null);Pe=!1;We=!1;Ge=!1;Ye=!1;He=-1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=!1;Je=0;$e=0;Qe=0;ts=0;es=0;ss=0;ns=[];rs=-1;hs=-1;os=new s.A;ls=78;cs=0;fs=0;us=[];ds=0;ws=0;ys=0;As=0;ps=0;gs=0;Is=0;_s=0;Cs=[];Es=[];vs=[];bs=[];Ts=null;Os=-1;Rs=3;Ss=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Ls=0;xs=0;ks=0;Ms=!1;Ds=0;Ns=!1;Fs='';Bs='';Us=0;Ps='';Ws=!1;Gs=-1;Ys=new d.fe(100,null);Hs=new d.fe(100,null);messageType=new Int32Array(100);Vs=new Int32Array(100);Ks=0;Xs=0;js=0;zs='';Zs=0;qs=0;Js=0;$s=0;Qs=0;tn=0;en=0;sn=0;nn=0;rn=!1;hn=0;an=0;ln=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;An=!1;mn=[];pn=[];gn=0;In=0;_n=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);On=new Int32Array(500);Rn=0;Sn=0;Ln=0;xn='';kn=!1;Mn=-1;Dn=0;Nn=0;Fn=0;Bn=0;Un=0;Pn=new Int32Array(1e3);Wn=new Int32Array(1e3);Gn=null;Yn=0;Hn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;Jn=0;$n=2;Qn=2;tr=1;ir=new Int32Array(5);er=new d.fe(5,!1);sr=new Int32Array(5);nr=new Int32Array(5);rr=new Int32Array(5);hr=0;ar=0;lr=0;cr=0;ur=0;dr=0;wr=0;yr=0;Ar=0;mr=1;pr=2;gr=-1;Ir=0;_r=0;Cr=0;Er=0;vr=0;br=0;Tr=null;Or=null;Rr=null;Sr=0;Lr=0;kr=new Int8Array(16384);Mr=new d.fe(f.A.Dr,null);Nr=0;Fr=0;Br=128;Ur=0;Pr=0;Wr=0;Gr=0;Yr=0;Hr=null;Vr=null;Kr=new d.Xr(f.A.jr,f.A.jr);zr=0;Zr=0;qr=0;Jr=0;$r=0;Qr=0;th=0;ih=0;eh=0;sh=0;nh=0;rh=0;hh=new d.fe(this.Lt,null);oh=0;ah=new Int32Array(this.Lt);lh=0;fh=0;uh=new Int32Array(this.Lt);dh=new Int32Array(1e3);wh=new d.fe(this.Lt,null);yh=new d.fe(8192,null);Ah=0;mh=new Int32Array(8192);ph=new a.A;gh=new a.A;Ih=new a.A;_h=new a.A;Ch=new d.Eh(f.A.Dr,f.A.jr,f.A.jr,null);bh=new a.A;Th=new Int32Array(4e3);Oh=new Int32Array(4e3);Rh=new Int32Array(f.A.jr*f.A.jr);Sh=new Int32Array(f.A.jr*f.A.jr);Lh=0;xh=null;kh=0;Mh=0;Dh=-1;Nh=0;Fh=0;Bh=0;Uh=0;Ph=!1;Wh=!0;Gh=!1;Yh=new Int32Array(7);Hh=new Int32Array(5);Vh=0;Kh=0;static Xh=50;jh=new Int32Array(D.Xh);zh=new Int32Array(D.Xh);Zh=new Int32Array(D.Xh);qh=new Int32Array(D.Xh);Jh=new Int32Array(D.Xh);$h=new Int32Array(D.Xh);Qh=new Int32Array(D.Xh);io=new d.fe(D.Xh,null);eo=new d.fe(100,null);so=new BigInt64Array(100);no=new Int32Array(100);ro=null;ho=0;oo=!0;ao=new Int32Array(50);lo=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;Ao=0;mo=!0;po=null;Io=0;_o=0;Co=192;Eo=void 0;vo=!1;host=null;bo=null;To=new d.fe(16,null);Oo=0;Ro=!1;So=()=>{try{this.stream&&this.stream.close()}catch(t){}this.bo&&'998'===D.getParameter('world')&&this.bo.Lo?.send(JSON.stringify({type:'close',id:this.bo.xo})),this.stream=null,(0,v.ko)(!1),this.Pt=null,this.Wt=null,this.in=null,this.Rr=null,this.Tr=null,this.Or=null,this.Hr=null,this.Vr=null,this.Gn=null,this.Mr=null,this.Rh=null,this.Sh=null,this.Th=null,this.Oh=null,this.kr=null,this.Di=null,this.Ni=null,this.Fi=null,this.Bi=null,this.Ui=null,this.Pi=null,this.Wi=null,this.Gi=null,this.Yi=null,this.Hi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.ne=null,this.he=null,this.re=null,this.oe=null,this.ae=null,this.le=null,this.ce=null,this.Te=null,this.Oe=null,this.Re=null,this.Se=null,this.Le=null,this.xe=null,this.ke=null,this.Me=null,this.De=null,this.Ne=null,this.de=null,this.Ae=null,this.me=null,this.ge=null,this.Ie=null,this._e=null,this.Ce=null,this.Ee=null,this.we=null,this.ye=null,this.Kr=null,this.hh=null,this.ah=null,this.uh=null,this.wh=null,this.dh=null,this.yh=null,this.mh=null,this.Ch=null,this.bh=null,this._h=null,this.ph=null,this.gh=null,this.Ih=null,this.Tn=null,this.On=null,this.vn=null,this.bn=null,this.ns=null,this.mn=null,this.Pn=null,this.Wn=null,this.Ue=null,this.ue=null,this.eo=null,this.so=null,this.no=null,this.si=null,this.ni=null,this.ti=null,this.ii=null,this.ei=null,this.ri=null,this.hi=null,this.oi=null,this.ai=null,this.Mo(),b.A.So(),T.A.So(),A.A.So(),O.A.Do=null,_.A.Do=null,s.A.Do=null,g.A.Do=null,R.A.Do=null,R.A.No=null,S.A.Do=null,this.Fo=null,u.A.No=null,n.A.So(),l.A.So(),p.A.So(),L.A.Do=[],x.A.Do=[]};Bo(){return this.$t}Uo(){return this.Ws}Po(){return this.Ns}Wo(){return this.hs}Go(){return this.He}Mo=()=>{this.pi=!1,this.Mi&&(clearInterval(this.Mi),this.Mi=null),this.li=null,this.ci=null,this.mi=[],this.bi=null,this.Ti=null,this.Oi=null,this.Ri=null,this.Ci=null,this._i=null,this.Ei=null,this.vi=null,this.gi=null,this.Ii=null};Yo=()=>{'999'===D.getParameter('world')?(this.Eo=new Worker('worker.js',{type:'module'}),this.Eo.onmessage=this.onmessage,this.host=new M.x(this.Eo)):'998'===D.getParameter('world')&&(this.Eo={onmessage:t=>{this.stream.Ho.onmessage(t)},postMessage:t=>{this.bo&&this.bo.Lo&&'open'===this.bo.Lo.readyState&&this.bo.Lo.send(JSON.stringify(t))},onerror:null,onmessageerror:null,terminate:()=>{throw new Error},addEventListener:()=>{throw new Error},removeEventListener:()=>{throw new Error},dispatchEvent:()=>{throw new Error}},this.bo=new M.Q(this.Eo))};onmessage=t=>{switch(t.data.type){case'ready':return void(this.vo=!0);case'save':return(0,k.A)(t.data.value,t.data.path.split('/').pop().split('\\').pop()),void URL.revokeObjectURL(t.data.value);case'close':return void this.Eo?.postMessage({type:'close',id:t.data.id})}this.host?.xo===t.data.id?this.stream.Ho.onmessage(t.data):this.host?.postMessage(t)};Vo=async()=>{if(999==+D.getParameter('world'))this.host&&await this.host.Ko();else if(998==+D.getParameter('world')&&this.bo){if(this.bo.Lo)return void console.log('You are already connected.');const t=prompt('Paste offer here, answer will be copied to clipboard');if(t)try{await this.bo.Xo(t)}catch(t){console.error(t)}}};jo=async(t,i,e,s)=>{let n=5,o=await(this.db?.zo(t));if(o&&h.A.Zo(o)!==e&&(o=void 0),o)return new r.A(o);for(;!o;){await this.qo(s,`Requesting ${i}`);try{o=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}${e}`):await(0,C.Jo)(`${D.nt}/${t}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.qo(s,`Error loading - Will retry in ${t} secs.`),await(0,C.$o)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Qo(t,o)),new r.A(o)};ta=async(t,i,e,s)=>{let n=await(this.db?.zo(t+'.mid'));if(n&&12345678!==i&&h.A.Zo(n)!==i&&(n=void 0),!n)try{n=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}_${i}.mid`):await(0,C.Jo)(`${D.nt}/songs/${t}.mid`),e!==n.length&&(n=n.slice(0,e))}catch(t){}if(!n)return;await(this.db?.Qo(t+'.mid',n));const r=new h.A(Uint8Array.from(n)).ia,o=E.A.read(r,n,e,4);(0,v.ea)(o,this.Co,s)};sa=()=>{if(w.na.fillStyle='black',w.na.fillRect(0,0,this.width,this.height),this.ra(1),this.Dt){this.pi=!1,w.na.font='bold 16px helvetica, sans-serif',w.na.textAlign='left',w.na.fillStyle='yellow';let t=35;w.na.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.na.fillStyle='white',w.na.fillText('To fix this try the following (in order):',30,t),t+=50,w.na.font='bold 12px helvetica, sans-serif',w.na.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.na.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.na.fillText('3: Try using a different game-world',30,t),t+=30,w.na.fillText('4: Try rebooting your computer',30,t),t+=30,w.na.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.pi=!1,w.na.font='bold 20px helvetica, sans-serif',w.na.textAlign='left',w.na.fillStyle='white',w.na.fillText('Error - unable to load game!',50,50),w.na.fillText('To play RuneScape make sure you play from',50,100),w.na.fillText('https://2004scape.org',50,150)),this.Mt){this.pi=!1,w.na.font='bold 13px helvetica, sans-serif',w.na.textAlign='left',w.na.fillStyle='yellow';let t=35;w.na.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.na.fillStyle='white',w.na.fillText('To fix this try the following (in order):',30,t),t+=50,w.na.font='bold 12px helvetica, sans-serif',w.na.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.na.fillText('2: Try rebooting your computer, and reloading',30,t)}};ha=t=>{if(!t.oa)return!1;for(let i=0;i=s)return!1}else if(3===t.oa[i]){if(e<=s)return!1}else if(4===t.oa[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};ca=(t,i,e,s,n)=>{this.ve?.draw(t,i),this.be?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,m.A.fa);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;y.A.fillRect(t,i+h+16,16,r,m.A.ua),y.A.da(t,i+h+16,m.A.wa,r),y.A.da(t+1,i+h+16,m.A.wa,r),y.A.ya(t,i+h+16,m.A.wa,16),y.A.ya(t,i+h+17,m.A.wa,16),y.A.da(t+15,i+h+16,m.A.Aa,r),y.A.da(t+14,i+h+17,m.A.Aa,r-1),y.A.ya(t,i+h+r+15,m.A.Aa,16),y.A.ya(t+1,i+h+r+14,m.A.Aa,15)};ma=(t,i)=>{let e=!1;const n=s.A.Do[t];if(!n.pa)return!1;for(let t=0;ts.delay[r.Ca];)r._a-=s.delay[r.Ca]+1,r.Ca++,r.Ca>=s.Ea&&(r.Ca-=s.va,(r.Ca<0||r.Ca>=s.Ea)&&(r.Ca=0)),e=!0}}}return e};ba=(t,i,e,r,h=!1)=>{if(0!==t.type||!t.pa||t.hide&&this.Zs!==t.id&&this.qs!==t.id&&this.Js!==t.id)return;const o=y.A.left,a=y.A.top,l=y.A.right,c=y.A.bottom;y.A.Ta(i,e,i+t.width,e+t.height);const f=t.pa.length;for(let o=0;o0&&this.ka(c),c.type===s.A.Ma)c.Da>c.scroll-c.height&&(c.Da=c.scroll-c.height),c.Da<0&&(c.Da=0),this.ba(c,a,l,c.Da,h),c.scroll>c.height&&this.ca(a+c.width,l,c.Da,c.scroll,c.height);else if(c.type===s.A.Na){let t=0;for(let i=0;i0){let i=0,e=0;const r=c.Ua[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qs===t){const h=A.A.Ya(r,c.Pa[t]);if(0!==this.tn&&this.Qs===t&&this.$s===c.id?(i=this.Ha-this.en,e=this.Va-this.sn,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.nn<5&&(i=0,e=0),h.Ka(128,s+i,n+e)):0!==this.un&&this.dn===t&&this.wn===c.id?h.Ka(128,s,n):h.draw(s,n),33===h.Xa||1!==c.Pa[t]){const r=c.Pa[t];this.di?.ja(s+i+1,n+10+e,this.za(r),m.A.Za),this.di?.ja(s+i,n+9+e,this.za(r),m.A.qa)}}}else if(c.Ja&&t<20){const i=c.Ja[t];i?.draw(s,n)}t++}}else if(c.type===s.A.$a)c.fill?y.A.fillRect(a,l,c.width,c.height,c.Qa):y.A.Sa(a,l,c.width,c.height,c.Qa);else if(c.type===s.A.tl){const t=c.font;let i=c.Qa,e=c.text;if(this.Js!==c.id&&this.qs!==c.id&&this.Zs!==c.id||0===c.il||(i=c.il),this.ha(c)&&(i=c.el,c.sl&&c.sl.length>0&&(e=c.sl)),c.nl===s.A.rl&&this.An&&(e='Please wait...',i=c.Qa),!t||!e)continue;for(let s=l+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),c.ol?t.al(a+(c.width/2|0),s,r,i,c.ll):t.cl(a,s,r,i,c.ll)}}else if(c.type===s.A.fl){let t;t=this.ha(c)?c.ul:c.dl,t?.draw(a,l)}else if(c.type===s.A.wl){const t=n.A.yl,i=n.A.Al;n.A.yl=a+(c.width/2|0),n.A.Al=l+(c.height/2|0);const e=n.A.sin[c.ml]*c.zoom>>16,s=n.A.cos[c.ml]*c.zoom>>16,r=this.ha(c);let h;h=r?c.Ia:c.ga;let o=null;if(-1===h)o=c.pl(-1,-1,r);else{const t=g.A.Do[h];t.frames&&t.gl&&(o=c.pl(t.frames[c.Ca],t.gl[c.Ca],r))}o&&o.Il(0,c._l,0,c.ml,0,e,s),n.A.yl=t,n.A.Al=i}else if(c.type===s.A.Cl){const t=c.font;if(!t||!c.Ua||!c.Pa)continue;let i=0;for(let e=0;e0){const n=A.A.get(c.Ua[i]-1);let r=n.name;if((n.El||1!==c.Pa[i])&&(r=r+' x'+this.vl(c.Pa[i])),!r)continue;const h=a+s*(c.Wa+115),o=l+e*(c.Ga+12);c.ol?t.al(h+(c.width/2|0),o,r,c.Qa,c.ll):t.cl(h,o,r,c.Qa,c.ll)}i++}}}y.A.Ta(o,a,l,c)};ka=t=>{let i=t.xa;if(i>=s.A.bl&&i<=s.A.Tl)i--,i>=this.Vh?(t.text='',t.nl=0):(t.text=this.eo[i],t.nl=1);else if(i>=s.A.Ol&&i<=s.A.Rl)i-=s.A.Ol,i>=this.Vh?(t.text='',t.nl=0):(0===this.no[i]?t.text='@red@Offline':this.no[i]===D.it?t.text='@gre@World-'+(this.no[i]-9):t.text='@yel@World-'+(this.no[i]-9),t.nl=1);else if(i===s.A.Sl)t.scroll=15*this.Vh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=s.A.Ll&&i<=s.A.xl)i-=s.A.Ll,i>=this.fs?(t.text='',t.nl=0):(t.text=I.A.kl(I.A.Ml(this.us[i])),t.nl=1);else if(i===s.A.Dl)t.scroll=15*this.fs+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===s.A.Nl){if(t.ml=150,t._l=256*Math.sin(this.Ft/40)&2047,this.Gh){this.Gh=!1;const i=new d.fe(7,null);let e=0;for(let t=0;t<7;t++){const s=this.Yh[t];s>=0&&(i[e++]=_.A.Do[s].pl())}const s=p.A.Fl(i,e);for(let t=0;t<5;t++)0!==this.Hh[t]&&(s.Bl(u.A.Ul[t][0],u.A.Ul[t][this.Hh[t]]),1===t&&s.Bl(u.A.Pl[0],u.A.Pl[this.Hh[t]]));if(this.xh){const i=g.A.Do[this.xh.Wl].frames;i&&(s.Gl(),s.Yl(i[0]),s.Hl(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===s.A.Vl)this.Fe||(this.Fe=t.dl,this.Be=t.ul),this.Wh?t.dl=this.Be:t.dl=this.Fe;else if(i===s.A.Kl)this.Fe||(this.Fe=t.dl,this.Be=t.ul),this.Wh?t.dl=this.Fe:t.dl=this.Be;else if(i===s.A.Xl)t.text=this.xn,this.Ft%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===s.A.jl)this.Ph?this.kn?(t.Qa=m.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Qa=m.A.La,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===s.A.zl||i===s.A.Zl)if(0===this.Dn)t.text='';else{let i;i=0===this.Nn?'earlier today':1===this.Nn?'yesterday':this.Nn+' days ago',t.text='You last logged in '+i+' from: '+I.A.ql(this.Dn)}else if(i===s.A.Jl)0===this.Bn&&(t.text='0 unread messages',t.Qa=m.A.qa),1===this.Bn&&(t.text='1 unread message',t.Qa=m.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Qa=m.A.GREEN);else if(i===s.A.$l)if(201===this.Fn)t.text='';else if(200===this.Fn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Fn?'Earlier today':1===this.Fn?'Yesterday':this.Fn+' days ago',t.text=i+' you changed your recovery questions'}else i===s.A.Ql?201===this.Fn?t.text='':200===this.Fn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===s.A.tc&&(201===this.Fn?t.text='':(this.Fn,t.text="Do this from the 'account management' area on our front webpage"))};aa=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let n=0,r=0;for(;;){const t=e[r++];if(0===t)return n;if(1===t)n+=this.Es[e[r++]];else if(2===t)n+=this.vs[e[r++]];else if(3===t)n+=this.Cs[e[r++]];else if(4===t){const t=s.A.Do[e[r++]],i=e[r++]+1;if(t.Ua&&t.Pa)for(let e=0;et<999999999?String(t):'*';vl=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};za=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,e)=>{e.d(i,{w:()=>h});var s=e(7046),n=e(1651),r=e(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');['0','998','999'].includes(s.A.getParameter('world'))?function(){if(+s.A.getParameter('world')>=998)return void(n.K.nt='data/pack/client');n.K.st='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0}():await async function(t){const i=await o(t,parseInt(s.A.getParameter('world'),10)),e=new URL(i.address);n.K.it=10+i.id-1,n.K.st=`${e.protocol}//${e.hostname}`,n.K.nt=`${e.protocol}//${e.hostname}:${e.port}`,t||(n.K.st=n.K.st.replace('https:','http:'));n.K.portOffset=i.portOffset,n.K.members=!0===i?.members,s.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===s.A.getParameter('detail').length&&s.A.setParameter('detail','high');'low'===s.A.getParameter('detail')?n.K.St():n.K.Rt()}(),0===s.A.getParameter('method').length&&s.A.setParameter('method','0')}async function o(t,i,e=0){if(e>=10)throw new Error('could not find world to connect!');const s=t?'https:':'http:';let n;try{n=JSON.parse(await(0,r.ec)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.$o)(1e3),o(t,i,++e)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hh:0});const h=n.find((t=>t.id===i));return h||o(t,i,10)}},1375:(t,i,e)=>{e.a(t,(async(t,i)=>{try{var s=e(1312),n=e(5637),r=e(2164),h=e(1302),o=e(6948),a=e(8317),l=e(8738),c=e(3764),f=e(1120),u=e(4583),d=e(2682),w=e(8665),y=e(8534),A=e(6730),m=e(7953),p=e(9234),g=e(8950),I=e(1069),_=e(3937),C=e(4544),E=e(1908),v=e(9298),b=e(1651),T=e(7604),O=e(1673);class t extends b.K{constructor(){super(!1)}sc=null;nc=null;rc=!1;hc=!1;oc=0;ac=0;lc='';load=async()=>{try{await this.qo(10,'Connecting to fileserver'),await E.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new C.A(await C.A.openDatabase());const t=new I.A(new Uint8Array(await(0,p.Jo)(`${b.K.nt}/crc`))),i=[];for(let e=0;e<9;e++)i[e]=t.ia;const e=await this.jo('title','title screen',i[1],10);this.di=d.A.cc(e,'p11'),this.wi=d.A.cc(e,'p12'),this.yi=d.A.cc(e,'b12'),this.Ai=d.A.cc(e,'q8');const g=await this.jo('config','config',i[2],15),v=await this.jo('interface','interface',i[3],20),T=await this.jo('media','2d graphics',i[4],30),R=await this.jo('models','3d graphics',i[5],40),S=await this.jo('textures','textures',i[6],60),L=await this.jo('wordenc','chat system',i[7],65),x=await this.jo('sounds','sound effects',i[8],70);await this.qo(75,'Unpacking media'),this.ve=O.A.cc(T,'scrollbar',0),this.be=O.A.cc(T,'scrollbar',1),await this.qo(80,'Unpacking textures'),u.A.fc(S),u.A.uc(.8),u.A.dc(20),await this.qo(83,'Unpacking models'),w.A.wc(R),y.A.wc(R),A.A.wc(R),await this.qo(86,'Unpacking config'),s.A.wc(g),n.A.wc(g),r.A.wc(g),h.A.wc(g,!0),o.A.wc(g),a.A.wc(g),l.A.wc(g),c.A.wc(g),await this.qo(90,'Unpacking sounds'),_.A.wc(x),await this.qo(92,'Unpacking interfaces'),f.A.wc(v,T,[this.di,this.wi,this.yi,this.Ai]),await this.qo(97,'Preparing game engine'),m.A.wc(L);for(let t=0;t{this.Mt||this.Dt||this.Nt||(!this.hc&&this.sc&&(this.lc='',this.Ac(this.sc,this.Ha,this.Va,0,0,0),this.Zs=this.Ln,this.Ln=-1,this.rc||(this.nc=this.mc(this.sc,this.Ha,this.Va,0,0,0))),this.nc&&(1===this.gc?(this.hc||(this.oc=this.nc.Ic()-this.Ha,this.ac=this.nc._c()-this.Va),this.hc=!0):this.hc=!1,this.hc&&this.nc.move(this.Ha+this.oc,this.Va+this.ac)),this.Cc(),this.Ec(),this.vc=-1,this.bc=-1,this.Tc=0)};draw=async()=>{this.Mt||this.Dt||this.Nt?this.sa():(g.A.clear(),g.A.fillRect(0,0,this.width,this.height,0),this.Oc(8,8,16,16,5263440),this.sc&&(this.ba(this.sc,0,0,0,!1),this.yi?.Rc(4,15,this.lc,v.A.La,!0,0)),this.nc&&this.nc.outline(65535),this.Fo?.draw(0,0))};Cc(){for(;;){const t=this.Sc();if(-1===t)break;this.nc&&(8===t?(this.nc.delete(),this.nc=null,this.rc=!1):9===t&&(this.rc=!1))}}Ec(){if(this.nc){if(this.Lc[1]){const t=this.nc.Ic();this.nc.move(t-1,this.nc._c())}else if(this.Lc[2]){const t=this.nc.Ic();this.nc.move(t+1,this.nc._c())}if(this.Lc[3]){const t=this.nc._c();this.nc.move(this.nc.Ic(),t-1)}else if(this.Lc[4]){const t=this.nc._c();this.nc.move(this.nc.Ic(),t+1)}}}Oc=(t,i,e,s,n)=>{const r=(this.width+t)/e,h=(this.height+i)/s;t=-t,i=-i;for(let o=0;o{if(0!==t.type||!t.pa||!t.Oa||!t.Ra||is+t.width||e>n+t.height)return;const h=t.pa.length;for(let o=0;o=0||0!==l.il)&&i>=h&&e>=a&&i=0?this.Ln=l.kc:this.Ln=l.id),0===l.type?this.Ac(l,i,e,h,a,l.Da):i>=h&&e>=a&&i{if(0!==t.type||!t.pa||!t.Oa||!t.Ra||is+t.width||e>n+t.height)return null;let h=null;const o=t.pa.length;for(let a=0;a=o&&e>=l&&i{})),i()}catch(t){i(t)}}),1)},7046:(t,i,e)=>{e.d(i,{A:()=>l});var s=e(1183),n=e(4583),r=e(9234),h=e(9091),o=e(2595),a=e(7854);class l{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}Nc=0;Fc=[];Bc=0;Fo=null;state=0;Uc=20;Pc=1;Wc=[];Gc=0;Yc=0;Hc=[];Vc=!0;Kc=!1;Xc=50;hasFocus=!0;jc=!1;zc=0;gc=0;Ha=0;Va=0;Tc=0;vc=0;bc=0;Lc=[];Zc=[];qc=0;Jc=0;input=null;$c=!1;Qc=!1;tf=!1;time=-1;if=0;ef=0;sf=0;nf=0;rf=0;hf=0;constructor(t=!1){a.af.tabIndex=-1,a.na.fillStyle='black',a.na.fillRect(0,0,a.af.width,a.af.height),this.Kc=t,this.Kc?this.resize(window.innerWidth,window.innerHeight):this.resize(a.af.width,a.af.height)}get width(){return a.af.width}get height(){return a.af.height}resize=(t,i)=>{a.af.width=t,a.af.height=i,this.Fo=new s.A(t,i),n.A.yc()};run=async()=>{a.af.addEventListener('resize',(()=>{this.Kc&&this.resize(window.innerWidth,window.innerHeight)}),!1),a.af.onmousedown=this.onmousedown,a.af.onmouseup=this.onmouseup,a.af.onmouseenter=this.onmouseenter,a.af.onmouseleave=this.onmouseleave,a.af.onmousemove=this.onmousemove,window.onbeforeunload=this.So,a.af.onfocus=this.onfocus,a.af.onblur=this.onblur,this.lf?(a.af.ontouchstart=this.ontouchstart,a.af.ontouchend=this.ontouchend,a.af.ontouchmove=this.ontouchmove):(a.af.onkeydown=this.onkeydown,a.af.onkeyup=this.onkeyup),a.af.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.lf&&'low'===l.getParameter('detail')&&(this.Xc=30),await this.qo(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.Wc[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.cf();const h=e,o=s;e=300,s=1,t=performance.now();const a=this.Wc[i];if(0===a?(e=h,s=o):t>a&&(e=2560*this.Uc/(t-a)|0),e<25?e=25:e>256&&(e=256,s=this.Uc-(t-a)/10|0),this.Wc[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.Wc[t]&&(this.Wc[t]+=s);for(s0&&(this.Gc=1e3*e/(256*this.Uc)|0);const l=performance.now();if(this.Vc&&this.refresh(),await this.draw(),this.Hc[this.Yc]=(performance.now()-l)/1e3,this.Yc=(this.Yc+1)%this.Hc.length,this.Xc<50){const i=1e3/this.Xc-(performance.now()-t);i>0&&await(0,r.$o)(i)}}-1===this.state&&this.cf()};cf=()=>{this.state=-2,this.So()};ra=t=>{this.Uc=1e3/t|0};ff=t=>{this.Xc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.Uc|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};So=()=>{};draw=async()=>{};refresh=()=>{};async qo(t,i){const e=this.width,s=this.height;this.Vc&&(a.na.fillStyle='black',a.na.fillRect(0,0,e,s),this.Vc=!1);const n=s/2-18;a.na.fillStyle='rgb(140, 17, 17)',a.na.rect((e/2|0)-152,n,304,34),a.na.fillRect((e/2|0)-150,n+2,3*t,30),a.na.fillStyle='black',a.na.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),a.na.font='bold 13px helvetica, sans-serif',a.na.textAlign='center',a.na.fillStyle='white',a.na.fillText(i,e/2|0,n+22),await(0,r.$o)(5)}Sc=()=>{let t=-1;return this.Jc!==this.qc&&(t=this.Zc[this.qc],this.qc=this.qc+1&127),t};get ms(){const t=this.Hc.length;let i=0;for(let e=0;ethis.Nc&&(this.Nc=e),this.Fc[this.Bc]=e,this.Bc=(this.Bc+1)%250,e}get uf(){return this.Fc.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.zc=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Lc[n]=1),n>4&&(this.Zc[this.Jc]=n,this.Jc=this.Jc+1&127),o.A.enabled&&o.A.df(n),h.g.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.zc=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Lc[n]=0),o.A.enabled&&o.A.wf(n),h.g.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.$c=!1,(t.clientX>0||t.clientY>0)&&this.yf(t),this.zc=0,this.vc=this.Ha,this.bc=this.Va,this.lf&&!this.Af){if(this.mf()||this.pf()||this.gf())return this.Tc=1,void(this.gc=1);t.timeStamp>=this.time+500?(this.Tc=2,this.gc=2):(this.Tc=1,this.gc=1)}else 2===t.button?(this.Tc=2,this.gc=2):(this.Tc=1,this.gc=1);o.A.enabled&&o.A.If(this.vc,this.bc,t.buttons)};onmouseup=t=>{this.yf(t),this.zc=0,this.gc=0,o.A.enabled&&o.A._f(t.buttons)};onmouseenter=t=>{this.yf(t),o.A.enabled&&o.A.Cf()};onmouseleave=t=>{this.yf(t),this.zc=0,this.Ha=-1,this.Va=-1,this.gc=0,this.vc=-1,this.bc=-1,o.A.enabled&&o.A.Ef()};onmousemove=t=>{this.yf(t),this.zc=0,o.A.enabled&&o.A.vf(this.Ha,this.Va)};onfocus=t=>{this.hasFocus=!0,this.Vc=!0,this.refresh(),o.A.enabled&&o.A.bf()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.Tf()};ontouchstart=t=>{if(!this.lf)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.$c=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.if=this.rf=this.sf=0|i.screenX,this.ef=this.hf=this.nf=0|i.screenY,this.time=t.timeStamp,this.Qc=this.Of(),this.tf=this.Rf()};ontouchend=t=>{if(!this.lf||!this.$c)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.rf=0|i.screenX,this.hf=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Qc&&!this.Of())return void(this.$c=!1);if(this.tf&&!this.Rf())return void(this.$c=!1);if(this.mf()||this.Sf()||this.pf()||this.gf()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.pf()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.gf()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.mf()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.Sf()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.Lf?t.setAttribute('type','password'):t.setAttribute('type',this.gf()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.Lf&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.Lf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.Lf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.$c=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.if-this.rf)>16||Math.abs(this.ef-this.hf)>16;n&&!r?(this.$c=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.gc=0,this.$c=!1)};ontouchmove=t=>{if(!this.lf||!this.$c)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.rf=0|i.screenX,this.hf=0|i.screenY,this.Qc&&-1===this.Go()?(this.sf-this.rf>0?this.rotate(2):this.sf-this.rf<0&&this.rotate(0),this.nf-this.hf>0?this.rotate(3):this.nf-this.hf<0&&this.rotate(1)):(this.tf||-1!==this.Go())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.sf=this.rf,this.nf=this.hf};get lf(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get Lf(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Af(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}Of=()=>this.jc&&this.Ha>=8&&this.Ha<=520&&this.Va>=11&&this.Va<=345;mf=()=>this.jc&&-1===this.Wo()&&!this.Uo()&&!this.Po()&&this.Ha>=11&&this.Ha<=506&&this.Va>=449&&this.Va<=482;Sf=()=>this.jc&&(this.Uo()||this.Po())&&this.Ha>=11&&this.Ha<=506&&this.Va>=383&&this.Va<=482;Rf=()=>this.jc&&this.Ha>=562&&this.Ha<=752&&this.Va>=231&&this.Va<=492;pf=()=>!this.jc&&2===this.Bo()&&this.Ha>=301&&this.Ha<=562&&this.Va>=262&&this.Va<=279;gf=()=>!this.jc&&2===this.Bo()&&this.Ha>=301&&this.Ha<=562&&this.Va>=279&&this.Va<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};xf=()=>null!==document.fullscreenElement;yf=t=>{if(this.xf()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/a.af.height,s=(window.innerWidth-a.af.width*e)/2;this.Ha=0|this.kf(t.clientX-i.left-s,0,a.af.width*e,0,789),this.Va=0|this.kf(t.clientY-i.top,0,a.af.height*e,0,532)}else{const i=a.af.getBoundingClientRect(),e=a.af.width/i.width,s=a.af.height/i.height;this.Ha=(t.clientX-i.left)*e|0,this.Va=(t.clientY-i.top)*s|0}this.Ha<0&&(this.Ha=0),this.Va<0&&(this.Va=0),this.Ha>789&&(this.Ha=789),this.Va>532&&(this.Va=532)};kf=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}},2595:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static enabled=!1;static Mf=null;static Df=null;static Nf=0;static Ff=0;static Bf=0;static Uf=0;static Pf=0;static Wf=()=>{this.Mf=s.A.Ut(1),this.Df=null,this.Nf=performance.now(),this.enabled=!0};static Gf=()=>{this.enabled=!1,this.Mf=null};static flush=()=>{let t=null;return this.Df&&this.enabled&&(t=this.Df),this.Df=null,t};static stop=()=>{let t=null;return this.Mf&&this.Mf.Yf>0&&this.enabled&&(t=this.Mf),this.Gf(),t};static If=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.Ff++;const s=performance.now();let n=(s-this.Nf)/10|0;n>250&&(n=250),this.Nf=s,this.Hf(5),1===e?this.Mf?.p1(1):this.Mf?.p1(2),this.Mf?.p1(n),this.Mf?.p3(t+(i<<10))};static _f=t=>{if(!this.enabled)return;this.Ff++;const i=performance.now();let e=(i-this.Nf)/10|0;e>250&&(e=250),this.Nf=i,this.Hf(2),1===t?this.Mf?.p1(3):this.Mf?.p1(4),this.Mf?.p1(e)};static vf=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.Bf>=50){this.Bf=e,this.Ff++;let s=(e-this.Nf)/10|0;s>250&&(s=250),this.Nf=e,t-this.Uf<8&&t-this.Uf>=-8&&i-this.Pf<8&&i-this.Pf>=-8?(this.Hf(3),this.Mf?.p1(5),this.Mf?.p1(s),this.Mf?.p1(t+(i-this.Pf+8<<4)+8-this.Uf)):t-this.Uf<128&&t-this.Uf>=-128&&i-this.Pf<128&&i-this.Pf>=-128?(this.Hf(4),this.Mf?.p1(6),this.Mf?.p1(s),this.Mf?.p1(t+128-this.Uf),this.Mf?.p1(i+128-this.Pf)):(this.Hf(5),this.Mf?.p1(7),this.Mf?.p1(s),this.Mf?.p3(t+(i<<10))),this.Uf=t,this.Pf=i}};static df=t=>{if(!this.enabled)return;this.Ff++;const i=performance.now();let e=(i-this.Nf)/10|0;e>250&&(e=250),this.Nf=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.Hf(3),this.Mf?.p1(8),this.Mf?.p1(e),this.Mf?.p1(t)};static wf=t=>{if(!this.enabled)return;this.Ff++;const i=performance.now();let e=(i-this.Nf)/10|0;e>250&&(e=250),this.Nf=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.Hf(3),this.Mf?.p1(9),this.Mf?.p1(e),this.Mf?.p1(t)};static bf=()=>{if(!this.enabled)return;this.Ff++;const t=performance.now();let i=(t-this.Nf)/10|0;i>250&&(i=250),this.Nf=t,this.Hf(2),this.Mf?.p1(10),this.Mf?.p1(i)};static Tf=()=>{if(!this.enabled)return;this.Ff++;const t=performance.now();let i=(t-this.Nf)/10|0;i>250&&(i=250),this.Nf=t,this.Hf(2),this.Mf?.p1(11),this.Mf?.p1(i)};static Cf=()=>{if(!this.enabled)return;this.Ff++;const t=performance.now();let i=(t-this.Nf)/10|0;i>250&&(i=250),this.Nf=t,this.Hf(2),this.Mf?.p1(12),this.Mf?.p1(i)};static Ef=()=>{if(!this.enabled)return;this.Ff++;const t=performance.now();let i=(t-this.Nf)/10|0;i>250&&(i=250),this.Nf=t,this.Hf(2),this.Mf?.p1(13),this.Mf?.p1(i)};static Hf=t=>{if(this.Mf&&this.Mf.Yf+t>=500){const t=this.Mf;this.Mf=s.A.Ut(1),this.Df=t}}}},9091:(t,i,e)=>{e.d(i,{c:()=>n,g:()=>s});const s=['F11','F12'],n={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}}},1120:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1069),n=e(8665),r=e(2679),h=e(2511),o=e(3819),a=e(3867),l=e(8950);class c{static Do=[];static Vf=null;static No=null;static Ma=0;static Kf=1;static Na=2;static $a=3;static tl=4;static fl=5;static wl=6;static Cl=7;static Xf=1;static jf=2;static Dc=3;static zf=4;static Zf=5;static rl=6;static bl=1;static Tl=100;static Ol=101;static Rl=200;static qf=201;static Jf=202;static Sl=203;static $f=205;static Qf=300;static tu=301;static iu=302;static eu=303;static su=304;static nu=305;static ru=306;static hu=307;static ou=308;static au=309;static lu=310;static cu=311;static fu=312;static uu=313;static du=314;static wu=315;static yu=316;static Au=317;static mu=318;static pu=319;static gu=320;static Iu=321;static _u=322;static Cu=323;static Vl=324;static Kl=325;static Eu=326;static Nl=327;static Ll=401;static xl=500;static vu=501;static bu=502;static Dl=503;static Xl=600;static Tu=601;static Ou=602;static Ru=603;static Su=604;static Lu=605;static xu=606;static ku=607;static Mu=608;static Du=609;static Nu=610;static Fu=611;static Bu=612;static jl=613;static zl=650;static Jl=651;static $l=652;static Ql=653;static tc=654;static Zl=655;static wc=(t,i,e)=>{this.Vf=new r.A(5e4),this.No=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.Yf+=2;n.Yf0){s.oa=new Uint8Array(r),s.la=new Uint16Array(r);for(let t=0;t0){s.scripts=new a.fe(o,null);for(let t=0;t0){const n=e.lastIndexOf(',');s.Ja[t]=this.Ku(i,e.substring(0,n),parseInt(e.substring(n+1),10))}}s.Xu=new a.fe(5,null);for(let t=0;t<5;t++){const i=n.Vu;s.Xu[t]=i,0===i.length&&(s.Xu[t]=null)}}if(s.type===c.$a&&(s.fill=1===n.Wu),s.type===c.tl||s.type===c.Kf){s.ol=1===n.Wu;const t=n.Wu;e&&(s.font=e[t]),s.ll=1===n.Wu}if(s.type===c.tl&&(s.text=n.Vu,s.sl=n.Vu),s.type!==c.Kf&&s.type!==c.$a&&s.type!==c.tl||(s.Qa=n.ia),s.type!==c.$a&&s.type!==c.tl||(s.el=n.ia,s.il=n.ia),s.type===c.fl){const t=n.Vu;if(t.length>0){const e=t.lastIndexOf(',');s.dl=this.Ku(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=n.Vu;if(e.length>0){const t=e.lastIndexOf(',');s.ul=this.Ku(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(s.type===c.wl){const t=n.Wu;0!==t&&(s.model=this.pl((t-1<<8)+n.Wu));const i=n.Wu;0!==i&&(s.ju=this.pl((i-1<<8)+n.Wu)),s.ga=n.Wu,0===s.ga?s.ga=-1:s.ga=(s.ga-1<<8)+n.Wu,s.Ia=n.Wu,0===s.Ia?s.Ia=-1:s.Ia=(s.Ia-1<<8)+n.Wu,s.zoom=n.Uu,s.ml=n.Uu,s._l=n.Uu}if(s.type===c.Cl){s.Ua=new Int32Array(s.width*s.height),s.Pa=new Int32Array(s.width*s.height),s.ol=1===n.Wu;const t=n.Wu;e&&(s.font=e[t]),s.ll=1===n.Wu,s.Qa=n.ia,s.Wa=n.Gu,s.Ga=n.Gu,s.Yu=1===n.Wu,s.Xu=new a.fe(5,null);for(let t=0;t<5;t++){const i=n.Vu;s.Xu[t]=i,0===i.length&&(s.Xu[t]=null)}}s.nl!==c.jf&&s.type!==c.Na||(s.zu=n.Vu,s.action=n.Vu,s.Zu=n.Uu),s.nl!==c.Xf&&s.nl!==c.zf&&s.nl!==c.Zf&&s.nl!==c.rl||(s.Mc=n.Vu,0===s.Mc.length&&(s.nl===c.Xf?s.Mc='Ok':s.nl===c.zf||s.nl===c.Zf?s.Mc='Select':s.nl===c.rl&&(s.Mc='Continue')))}this.Vf=null,this.No=null};static Ku=(t,i,e)=>{const s=o.A.qu(i)<<8n|BigInt(e);if(this.Vf){const t=this.Vf.get(s);if(t)return t}let n;try{n=h.A.cc(t,i,e),this.Vf?.put(s,n)}catch(t){return null}return n};static pl=t=>{if(this.No){const i=this.No.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.No?.put(BigInt(t),i),i};id=-1;Pu=-1;type=-1;nl=-1;xa=0;width=0;height=0;kc=-1;oa=null;la=null;scripts=null;scroll=0;hide=!1;draggable=!1;Yu=!1;Hu=!1;Wa=0;Ga=0;Fa=null;Ba=null;Ja=null;Xu=null;fill=!1;ol=!1;font=null;ll=!1;text=null;sl=null;Qa=0;el=0;il=0;dl=null;ul=null;model=null;ju=null;ga=-1;Ia=-1;zoom=0;ml=0;_l=0;zu=null;action=null;Zu=-1;Mc=null;pa=null;Oa=null;Ra=null;x=0;y=0;Da=0;Ua=null;Pa=null;Ca=0;_a=0;pl(t,i,e){let s=this.model;if(e&&(s=this.ju),!s)return null;if(-1===t&&-1===i&&!s.Ju)return s;const r=n.A.$u(s,!0,!0,!1);return-1===t&&-1===i||r.Gl(),-1!==t&&r.Yl(t),-1!==i&&r.Yl(i),r.Hl(64,768,-50,-10,-50,!0),r}Ic(){if(this.Pu===this.id)return this.x;let t=c.Do[this.Pu];if(!t.pa||!t.Oa||!t.Ra)return this.x;let i=t.pa.indexOf(this.id);if(-1===i)return this.x;let e=t.Oa[i];for(;t.Pu!==t.id;){const s=c.Do[t.Pu];s.pa&&s.Oa&&s.Ra&&(i=s.pa.indexOf(t.id),-1!==i&&(e+=s.Oa[i])),t=s}return e}_c(){if(this.Pu===this.id)return this.y;let t=c.Do[this.Pu];if(!t.pa||!t.Oa||!t.Ra)return this.y;let i=t.pa.indexOf(this.id);if(-1===i)return this.y;let e=t.Ra[i];for(;t.Pu!==t.id;){const s=c.Do[t.Pu];s.pa&&s.Oa&&s.Ra&&(i=s.pa.indexOf(t.id),-1!==i&&(e+=s.Ra[i])),t=s}return e}outline(t){const i=this.Ic(),e=this._c();l.A.Sa(i,e,this.width,this.height,t)}move(t,i){if(this.Pu===this.id)return;this.x=0,this.y=0;const e=c.Do[this.Pu];if(e.pa&&e.Oa&&e.Ra){const s=e.pa.indexOf(this.id);-1!==s&&(e.Oa[s]=t,e.Ra[s]=i)}}delete(){if(this.Pu===this.id)return;const t=c.Do[this.Pu];if(t.pa&&t.Oa&&t.Ra){const i=t.pa.indexOf(this.id);-1!==i&&(t.pa.splice(i,1),t.Oa.splice(i,1),t.Ra.splice(i,1))}}}},6333:(t,i,e)=>{e.d(i,{$:()=>s});class s{id;Qu=null;constructor(t){this.id=t}td(t){for(;;){const i=t.Wu;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(6333);class r extends n.${static count=0;static Do=[];static wc=t=>{const i=new s.A(t.read('flo.dat'));this.count=i.Uu;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static sd=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static nd=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);rd=0;texture=-1;hd=!1;od=!0;ad=0;ld=0;fd=0;ud=0;dd=0;wd=0;decode(t,i){1===t?(this.rd=i.yd,this.setColor(this.rd)):2===t?this.texture=i.Wu:3===t?this.hd=!0:5===t?this.od=!1:6===t?this.Qu=i.Vu:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(h=e),s>h&&(h=s);let o=0,a=0;const l=(n+h)/2;n!==h&&(l<.5&&(a=(h-n)/(h+n)),l>=.5&&(a=(h-n)/(2-h-n)),i===h?o=(e-s)/(h-n):e===h?o=(s-i)/(h-n)+2:s===h&&(o=(i-e)/(h-n)+4)),o/=6,this.ad=256*o|0,this.ld=256*a|0,this.fd=256*l|0,this.ld<0?this.ld=0:this.ld>255&&(this.ld=255),this.fd<0?this.fd=0:this.fd>255&&(this.fd=255),this.ud=l>.5?(1-l)*a*512|0:l*a*512|0,this.ud<1&&(this.ud=1),this.dd=o*this.ud|0;let c=this.ad+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.ld+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.fd+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.wd=r.ed(c,f,u)}}},8317:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(1069),n=e(6333),r=e(8665),h=e(3867);class o extends n.${static count=0;static Do=[];static wc=t=>{const i=new s.A(t.read('idk.dat'));this.count=i.Uu;for(let t=0;t=40&&t<50?this.pd[t-40]=i.Uu:t>=50&&t<60?this.gd[t-50]=i.Uu:t>=60&&t<70?this.md[t-60]=i.Uu:console.log('Error unrecognised config code: ',t)}pl(){if(!this.Ad)return null;const t=new h.fe(this.Ad.length,null);for(let i=0;i{e.d(i,{A:()=>c});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(1023),a=e(6169),l=e(3867);class c extends s.${static count=0;static cache=null;static _d=null;static Cd=null;static Ed=0;static vd=new r.A(500);static bd=new r.A(30);static wc=t=>{this._d=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.Uu,this.Cd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.Cd||!this._d)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Ed=(this.Ed+1)%10;const i=this.cache[this.Ed];return this._d.Yf=this.Cd[t],i.id=t,i.reset(),i.td(this._d),i.Td||(i.Td=new Int32Array(1)),-1===i.Od&&i.Td&&(i.active=i.Td.length>0&&i.Td[0]===o.A.Rd.id,i.Sd&&(i.active=!0)),i};static So=()=>{this.vd=null,this.bd=null,this.Cd=null,this.cache=null,this._d=null};Ad=null;Td=null;name=null;Ld=null;pd=null;gd=null;width=1;length=1;xd=!0;kd=!0;active=!1;Od=-1;Md=!1;Dd=!1;od=!1;ga=-1;Nd=!1;Fd=16;Bd=0;Ud=0;Sd=null;Pd=-1;Wd=-1;Gd=!1;Yd=!0;Hd=128;Vd=128;Kd=128;Xd=0;jd=0;zd=0;Zd=0;qd=!1;decode(t,i){if(1===t){const t=i.Wu;this.Ad=new Int32Array(t),this.Td=new Int32Array(t);for(let e=0;e=30&&t<39)this.Sd||(this.Sd=new l.fe(5,null)),this.Sd[t-30]=i.Vu,'hidden'===this.Sd[t-30]?.toLowerCase()&&(this.Sd[t-30]=null);else if(40===t){const t=i.Wu;this.pd=new Uint16Array(t),this.gd=new Uint16Array(t);for(let e=0;e=this.Ad.length)return null;let d=this.Ad[l];if(-1===d)return null;const w=this.Gd!==i>3;w&&(d+=65536);let y=c.vd?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.nw(),c.vd?.put(BigInt(d),y));const A=128!==this.Hd||128!==this.Vd||128!==this.Kd,m=0!==this.jd||0!==this.zd||0!==this.Zd;let p=h.A.$u(y,!this.pd,!this.Nd,i===a.A.rw&&-1===o&&!A&&!m);for(-1!==o&&(p.Gl(),p.Yl(o),p.hw=null,p.ow=null);i-- >0;)p.aw();if(this.pd&&this.gd)for(let t=0;t{e.d(i,{A:()=>a});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(3867);class a extends s.${static count=0;static cache=null;static _d=null;static Cd=null;static Ed=0;static No=new r.A(30);static wc=t=>{this._d=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.Uu,this.Cd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.Cd||!this._d)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Ed=(this.Ed+1)%20;const i=this.cache[this.Ed]=new a(t);return this._d.Yf=this.Cd[t],i.td(this._d),i};static So=()=>{this.No=null,this.Cd=null,this.cache=null,this._d=null};name=null;Ld=null;size=1;Ad=null;md=null;Nd=!1;fw=-1;uw=-1;dw=-1;ww=-1;yw=-1;pd=null;gd=null;Sd=null;Hd=-1;Vd=-1;Kd=-1;Aw=!0;mw=-1;pw=128;gw=128;decode(t,i){if(1===t){const t=i.Wu;this.Ad=new Uint16Array(t);for(let e=0;e=30&&t<40)this.Sd||(this.Sd=new o.fe(5,null)),this.Sd[t-30]=i.Vu,'hidden'===this.Sd[t-30]?.toLowerCase()&&(this.Sd[t-30]=null);else if(40===t){const t=i.Wu;this.pd=new Uint16Array(t),this.gd=new Uint16Array(t);for(let e=0;e{e.d(i,{A:()=>u});var s=e(6333),n=e(1069),r=e(2511),h=e(2679),o=e(8665),a=e(4583),l=e(8950),c=e(9298),f=e(3867);class u extends s.${static count=0;static cache=null;static _d=null;static Cd=null;static Ed=0;static Tw=!0;static No=new h.A(50);static Ow=new h.A(200);static wc=(t,i)=>{this.Tw=i,this._d=new n.A(t.read('obj.dat'));const e=new n.A(t.read('obj.idx'));this.count=e.Uu,this.Cd=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.Cd||!this._d)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Ed=(this.Ed+1)%10;const i=this.cache[this.Ed];return this._d.Yf=this.Cd[t],i.id=t,i.reset(),i.td(this._d),-1!==i.Rw&&i.Sw(),!this.Tw&&i.members&&(i.name='Members Object',i.Ld="Login to a members' server to use this object.",i.Sd=null,i.Lw=null),i};static So=()=>{this.No=null,this.Ow=null,this.Cd=null,this.cache=null,this._d=null};static Ya=(t,i)=>{if(u.Ow){let e=u.Ow.get(BigInt(t));if(e&&e.xw!==i&&-1!==e.xw&&(e.kw(),e=null),e)return e}let e=u.get(t);if(e.Mw||(i=-1),e.Mw&&e.Dw&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.Dw[s]&&0!==e.Dw[s]&&(t=e.Mw[s]);-1!==t&&(e=u.get(t))}const s=new r.A(32,32),n=a.A.yl,h=a.A.Al,o=a.A.Nw,f=l.A.Fw,d=l.A.Bw,w=l.A.Uw,y=l.A.left,A=l.A.right,m=l.A.top,p=l.A.bottom;a.A.Pw=!1,l.A.bind(s.Fw,32,32),l.A.fillRect(0,0,32,32,c.A.Za),a.A.yc();const g=e.Ww(1),I=a.A.sin[e.Gw]*e.Yw>>16,_=a.A.cos[e.Gw]*e.Yw>>16;g.Il(0,e.Hw,e.Vw,e.Gw,e.Kw,I+(g.cw/2|0)+e.Xw,_+e.Xw);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.Fw[t+32*i]&&(t>0&&s.Fw[t+32*i-1]>1||i>0&&s.Fw[t+32*(i-1)]>1||t<31&&s.Fw[t+32*i+1]>1||i<31&&s.Fw[t+32*(i+1)]>1)&&(s.Fw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.Fw[t+32*i]&&t>0&&i>0&&s.Fw[t+32*(i-1)-1]>0&&(s.Fw[t+32*i]=3153952);if(-1!==e.Rw){const t=this.Ya(e.jw,10),i=t.Xa,s=t.xw;t.Xa=32,t.xw=32,t.zw(5,5,22,22),t.Xa=i,t.xw=s}return u.Ow?.put(BigInt(t),s),l.A.bind(f,d,w),l.A.Ta(y,m,A,p),a.A.yl=n,a.A.Al=h,a.A.Nw=o,a.A.Pw=!0,e.El?s.Xa=33:s.Xa=32,s.xw=i,s};model=0;name=null;Ld=null;pd=null;gd=null;Yw=2e3;Gw=0;Hw=0;Vw=0;Kw=0;Xw=0;Zw=!1;qw=-1;El=!1;Jw=1;members=!1;Sd=null;Lw=null;$w=-1;Qw=-1;ty=0;iy=-1;ey=-1;sy=0;ny=-1;hy=-1;oy=-1;ly=-1;uy=-1;wy=-1;Mw=null;Dw=null;jw=-1;Rw=-1;decode(t,i){if(1===t)this.model=i.Uu;else if(2===t)this.name=i.Vu;else if(3===t)this.Ld=i.Vu;else if(4===t)this.Yw=i.Uu;else if(5===t)this.Gw=i.Uu;else if(6===t)this.Hw=i.Uu;else if(7===t)this.Kw=i.Gu,this.Kw>32767&&(this.Kw-=65536);else if(8===t)this.Xw=i.Gu,this.Xw>32767&&(this.Xw-=65536);else if(9===t)this.Zw=!0;else if(10===t)this.qw=i.Uu;else if(11===t)this.El=!0;else if(12===t)this.Jw=i.ia;else if(16===t)this.members=!0;else if(23===t)this.$w=i.Uu,this.ty=i.Jd;else if(24===t)this.Qw=i.Uu;else if(25===t)this.iy=i.Uu,this.sy=i.Jd;else if(26===t)this.ey=i.Uu;else if(t>=30&&t<35)this.Sd||(this.Sd=new f.fe(5,null)),this.Sd[t-30]=i.Vu,'hidden'===this.Sd[t-30]?.toLowerCase()&&(this.Sd[t-30]=null);else if(t>=35&&t<40)this.Lw||(this.Lw=new f.fe(5,null)),this.Lw[t-35]=i.Vu;else if(40===t){const t=i.Wu;this.pd=new Uint16Array(t),this.gd=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.Mw&&this.Dw||(this.Mw=new Uint16Array(10),this.Dw=new Uint16Array(10)),this.Mw[t-100]=i.Uu,this.Dw[t-100]=i.Uu)}yy(t){let i=this.$w;if(1===t&&(i=this.iy),-1===i)return null;let e=this.Qw,s=this.ny;1===t&&(e=this.ey,s=this.hy);let n=o.A.model(i);if(-1!==e){const t=o.A.model(e);if(-1===s){const i=[n,t];n=o.A.Fl(i,2)}else{const i=[n,t,o.A.model(s)];n=o.A.Fl(i,3)}}if(0===t&&0!==this.ty&&n.translate(this.ty,0,0),1===t&&0!==this.sy&&n.translate(this.sy,0,0),this.pd&&this.gd)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.Dw[e]&&0!==this.Dw[e]&&(i=this.Mw[e]);if(-1!==i)return u.get(i).Ww(1)}if(u.No){const t=u.No.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.pd&&this.gd)for(let t=0;t{e.d(i,{A:()=>h});var s=e(6333),n=e(1069),r=e(6730);class h extends s.${static count=0;static Do=[];static wc=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.Uu;for(let t=0;t{e.d(i,{A:()=>a});var s=e(6333),n=e(1069),r=e(1312),h=e(8665),o=e(2679);class a extends s.${static count=0;static Do=[];static No=new o.A(30);static wc=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.Uu;for(let t=0;t=40&&t<50?this.pd[t-40]=i.Uu:t>=50&&t<60?this.gd[t-50]=i.Uu:console.log('Error unrecognised spotanim config code: ',t)}pl(){let t=a.No?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let i=0;i<6;i++)0!==this.pd[0]&&t.Bl(this.pd[i],this.gd[i]);return a.No?.put(BigInt(this.id),t),t}}},3764:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(6333),n=e(1069);class r extends s.${static count=0;static Do=[];static Cy=[];static Ey=0;static wc=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.Uu;for(let t=0;t{e.d(i,{A:()=>s});class s{static OPEN=0;static Sy=1;static Ly=2;static xy=4;static ky=8;static My=s.Sy<<4;static Dy=s.Ly<<4;static Ny=s.xy<<4;static Fy=s.ky<<4;static By=256;static Uy=512;static Py=1024;static Wy=2048;static Gy=4096;static Yy=s.Uy<<4;static Hy=s.Py<<4;static Vy=s.Wy<<4;static Ky=s.Gy<<4;static Xy=s.By<<9;static jy=524288;static zy=2097152;static Zy=s.zy|s.jy;static qy=s.By|s.Zy;static Jy=s.Ly|s.qy;static $y=s.ky|s.qy;static Qy=s.Ly|s.xy|s.$y;static tA=s.Dy|s.qy;static iA=s.ky|s.My|s.tA;static eA=s.Fy|s.qy;static sA=s.Sy|s.Ly|s.eA;static nA=s.Dy|s.Ny|s.eA;static rA=16777215}},670:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(9456),n=e(6169),r=e(1023),h=e(4909);class o{static Dr=4;static jr=104;static index=(t,i)=>t*o.jr+i;offsetX;hA;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.hA=0,this.sizeX=o.jr,this.sizeZ=o.jr,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.hA)]|=s.A.zy};aA=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.hA)]&=~s.A.zy};lA=(t,i,e,r,h,o)=>{let a=s.A.By;o&&(a|=s.A.Xy);const l=t-this.offsetX,c=i-this.hA;if(h===n.A.cA||h===n.A.fA){const t=e;e=r,r=t}for(let t=l;t=0&&t=0&&i{let a=s.A.By;o&&(a|=s.A.Xy);const l=t-this.offsetX,c=i-this.hA;if(h===n.A.cA||h===n.A.fA){const t=e;e=r,r=t}for(let t=l;t=0&&t=0&&i{const a=t-this.offsetX,l=i-this.hA,c=o?s.A.Ky:s.A.Fy,f=o?s.A.Gy:s.A.ky,u=o?s.A.Py:s.A.Ly,d=o?s.A.Hy:s.A.Dy,w=o?s.A.Uy:s.A.Sy,y=o?s.A.Yy:s.A.My,A=o?s.A.Wy:s.A.xy,m=o?s.A.Vy:s.A.Ny;e===r.A.wA.id?h===n.A.rw?(this.add(a,l,c),this.add(a-1,l,f)):h===n.A.cA?(this.add(a,l,u),this.add(a,l+1,d)):h===n.A.yA?(this.add(a,l,f),this.add(a+1,l,c)):h===n.A.fA&&(this.add(a,l,d),this.add(a,l-1,u)):e===r.A.AA.id||e===r.A.mA.id?h===n.A.rw?(this.add(a,l,w),this.add(a-1,l+1,y)):h===n.A.cA?(this.add(a,l,A),this.add(a+1,l+1,m)):h===n.A.yA?(this.add(a,l,y),this.add(a+1,l-1,w)):h===n.A.fA&&(this.add(a,l,m),this.add(a-1,l-1,A)):e===r.A.pA.id&&(h===n.A.rw?(this.add(a,l,u|c),this.add(a-1,l,f),this.add(a,l+1,d)):h===n.A.cA?(this.add(a,l,u|f),this.add(a,l+1,d),this.add(a+1,l,c)):h===n.A.yA?(this.add(a,l,d|f),this.add(a+1,l,c),this.add(a,l-1,u)):h===n.A.fA&&(this.add(a,l,d|c),this.add(a,l-1,u),this.add(a-1,l,f))),o&&this.dA(t,i,e,h,!1)};gA=(t,i,e,h,o)=>{const a=t-this.offsetX,l=i-this.hA,c=o?s.A.Ky:s.A.Fy,f=o?s.A.Gy:s.A.ky,u=o?s.A.Py:s.A.Ly,d=o?s.A.Hy:s.A.Dy,w=o?s.A.Uy:s.A.Sy,y=o?s.A.Yy:s.A.My,A=o?s.A.Wy:s.A.xy,m=o?s.A.Vy:s.A.Ny;e===r.A.wA.id?h===n.A.rw?(this.remove(a,l,c),this.remove(a-1,l,f)):h===n.A.cA?(this.remove(a,l,u),this.remove(a,l+1,d)):h===n.A.yA?(this.remove(a,l,f),this.remove(a+1,l,c)):h===n.A.fA&&(this.remove(a,l,d),this.remove(a,l-1,u)):e===r.A.AA.id||e===r.A.mA.id?h===n.A.rw?(this.remove(a,l,w),this.remove(a-1,l+1,y)):h===n.A.cA?(this.remove(a,l,A),this.remove(a+1,l+1,m)):h===n.A.yA?(this.remove(a,l,y),this.remove(a+1,l-1,w)):h===n.A.fA&&(this.remove(a,l,m),this.remove(a-1,l-1,A)):e===r.A.pA.id&&(h===n.A.rw?(this.remove(a,l,u|c),this.remove(a-1,l,f),this.remove(a,l+1,d)):h===n.A.cA?(this.remove(a,l,u|f),this.remove(a,l+1,d),this.remove(a+1,l,c)):h===n.A.yA?(this.remove(a,l,d|f),this.remove(a+1,l,c),this.remove(a,l-1,u)):h===n.A.fA&&(this.remove(a,l,d|c),this.remove(a,l-1,u),this.remove(a-1,l,f))),o&&this.gA(t,i,e,h,!1)};IA=(t,i,e,h,a,l)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.hA,u=e-this.offsetX,d=h-this.hA,w=o.index(c,f);if(a===r.A.wA.id){if(l===n.A.rw){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.tA)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Jy)===s.A.OPEN)return!0}else if(l===n.A.cA){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.$y)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.eA)===s.A.OPEN)return!0}else if(l===n.A.yA){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.tA)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Jy)===s.A.OPEN)return!0}else if(l===n.A.fA){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.$y)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.eA)===s.A.OPEN)return!0}}else if(a===r.A.pA.id){if(l===n.A.rw){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.eA)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Jy)===s.A.OPEN)return!0}else if(l===n.A.cA){if(c===u-1&&f===d&&(this.flags[w]&s.A.$y)===s.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Jy)===s.A.OPEN)return!0}else if(l===n.A.yA){if(c===u-1&&f===d&&(this.flags[w]&s.A.$y)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.tA)===s.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(l===n.A.fA){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.tA)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.eA)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(a===r.A._A.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ly)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.ky)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Fy)===s.A.OPEN)return!0}return!1};CA=(t,i,e,h,a,l)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.hA,u=e-this.offsetX,d=h-this.hA,w=o.index(c,f);if(a===r.A.EA.id||a===r.A.vA.id){if(a===r.A.vA.id&&(l=l+2&3),l===n.A.rw){if(c===u+1&&f===d&&(this.flags[w]&s.A.Fy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ly)===s.A.OPEN)return!0}else if(l===n.A.cA){if(c===u-1&&f===d&&(this.flags[w]&s.A.ky)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ly)===s.A.OPEN)return!0}else if(l===n.A.yA){if(c===u-1&&f===d&&(this.flags[w]&s.A.ky)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(l===n.A.fA){if(c===u+1&&f===d&&(this.flags[w]&s.A.Fy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}}else if(a===r.A.bA.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ly)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.ky)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Fy)===s.A.OPEN)return!0}return!1};TA=(t,i,e,n,r,a,l)=>{const c=e+r-1,f=n+a-1,u=o.index(t-this.offsetX,i-this.hA);return t>=e&&t<=c&&i>=n&&i<=f||(t===e-1&&i>=n&&i<=f&&(this.flags[u]&s.A.ky)===s.A.OPEN&&(l&h.A.rw)===s.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&s.A.Fy)===s.A.OPEN&&(l&h.A.yA)===s.A.OPEN||(i===n-1&&t>=e&&t<=c&&(this.flags[u]&s.A.Ly)===s.A.OPEN&&(l&h.A.fA)===s.A.OPEN||i===f+1&&t>=e&&t<=c&&(this.flags[u]&s.A.Dy)===s.A.OPEN&&(l&h.A.cA)===s.A.OPEN)))};add=(t,i,e)=>{this.flags[o.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[o.index(t,i)]&=s.A.rA-e}}},4909:(t,i,e)=>{e.d(i,{A:()=>s});class s{static cA=1;static yA=2;static fA=4;static rw=8}},6169:(t,i,e)=>{e.d(i,{A:()=>s});class s{static rw=0;static cA=1;static yA=2;static fA=3}},5599:(t,i,e)=>{e.d(i,{A:()=>s});class s{static OA=0;static RA=1;static SA=2;static LA=3}},1023:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5599);class n{static wA=new n(0,s.A.OA);static AA=new n(1,s.A.OA);static pA=new n(2,s.A.OA);static mA=new n(3,s.A.OA);static xA=new n(4,s.A.RA);static kA=new n(5,s.A.RA);static EA=new n(6,s.A.RA);static vA=new n(7,s.A.RA);static bA=new n(8,s.A.RA);static _A=new n(9,s.A.SA);static Rd=new n(10,s.A.SA);static MA=new n(11,s.A.SA);static DA=new n(12,s.A.SA);static NA=new n(13,s.A.SA);static FA=new n(14,s.A.SA);static BA=new n(15,s.A.SA);static UA=new n(16,s.A.SA);static PA=new n(17,s.A.SA);static WA=new n(18,s.A.SA);static GA=new n(19,s.A.SA);static YA=new n(20,s.A.SA);static HA=new n(21,s.A.SA);static LA=new n(22,s.A.LA);static values(){return[this.wA,this.AA,this.PA,this.BA,this.pA,this.FA,this._A,this.mA,this.LA,this.DA,this.MA,this.EA,this.YA,this.Rd,this.kA,this.NA,this.vA,this.xA,this.UA,this.bA,this.GA,this.HA,this.WA]}static of(t){const i=this.values();for(let e=0;e{e.d(i,{A:()=>A});var s=e(670),n=e(2164),r=e(1069),h=e(4583),o=e(3045),a=e(5637),l=e(4197),c=e(1312),f=e(1023),u=e(6169),d=e(9298),w=e(5518),y=e(3867);class A{static VA=Int8Array.of(1,2,4,8);static KA=Uint8Array.of(16,32,64,128);static XA=Int8Array.of(1,0,-1,0);static jA=Int8Array.of(0,-1,0,1);static zA=(17*Math.random()|0)-8;static ZA=(33*Math.random()|0)-16;static et=!0;static qA=0;static JA=!1;static $A=(t,i)=>{let e=this.QA(t+45365,i+91923,4)+(this.QA(t+10294,i+37821,2)-128>>1)+(this.QA(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static QA=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.tm(s,r),a=this.tm(s+1,r),l=this.tm(s,r+1),c=this.tm(s+1,r+1),f=this.im(o,a,n,e),u=this.im(l,c,n,e);return this.im(f,u,h,e)};static im=(t,i,e,s)=>{const n=65536-h.A.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static tm=(t,i)=>((this.sm(t-1,i-1)+this.sm(t+1,i-1)+this.sm(t-1,i+1)+this.sm(t+1,i+1))/16|0)+((this.sm(t-1,i)+this.sm(t+1,i)+this.sm(t,i-1)+this.sm(t,i+1))/8|0)+(this.sm(t,i)/4|0);static sm=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static lA=(t,i,e,s,n,r,h,o,d,w,y)=>{const m=n[y][i][e],p=n[y][i+1][e],g=n[y][i+1][e+1],I=n[y][i][e+1],_=m+p+g+I>>2,C=a.A.get(o);let E=i+(e<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A.LA.id)s?.nm(C.pl(f.A.LA.id,w,m,p,g,I,-1),t,i,e,_,E,v),C.xd&&C.active&&h?.oA(i,e),-1!==C.ga&&r.rm(new l.A(o,t,3,i,e,c.A.Do[C.ga],!0));else if(d===f.A.Rd.id||d===f.A.MA.id){const n=C.pl(f.A.Rd.id,w,m,p,g,I,-1);if(n){let r,h,o=0;d===f.A.MA.id&&(o+=256),w===u.A.cA||w===u.A.fA?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.lA(t,i,e,_,n,null,E,v,r,h,o)}C.xd&&h?.lA(i,e,C.width,C.length,w,C.kd),-1!==C.ga&&r.rm(new l.A(o,t,2,i,e,c.A.Do[C.ga],!0))}else if(d>=f.A.DA.id)s?.lA(t,i,e,_,C.pl(d,w,m,p,g,I,-1),null,E,v,1,1,0),C.xd&&h?.lA(i,e,C.width,C.length,w,C.kd),-1!==C.ga&&r.rm(new l.A(o,t,2,i,e,c.A.Do[C.ga],!0));else if(d===f.A.wA.id)s?.dA(t,i,e,_,A.VA[w],0,C.pl(f.A.wA.id,w,m,p,g,I,-1),null,E,v),C.xd&&h?.dA(i,e,d,w,C.kd),-1!==C.ga&&r.rm(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0));else if(d===f.A.AA.id)s?.dA(t,i,e,_,A.KA[w],0,C.pl(f.A.AA.id,w,m,p,g,I,-1),null,E,v),C.xd&&h?.dA(i,e,d,w,C.kd),-1!==C.ga&&r.rm(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0));else if(d===f.A.pA.id){const n=w+1&3;s?.dA(t,i,e,_,A.VA[w],A.VA[n],C.pl(f.A.pA.id,w+4,m,p,g,I,-1),C.pl(f.A.pA.id,n,m,p,g,I,-1),E,v),C.xd&&h?.dA(i,e,d,w,C.kd),-1!==C.ga&&r.rm(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0))}else if(d===f.A.mA.id)s?.dA(t,i,e,_,A.KA[w],0,C.pl(f.A.mA.id,w,m,p,g,I,-1),null,E,v),C.xd&&h?.dA(i,e,d,w,C.kd),-1!==C.ga&&r.rm(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0));else if(d===f.A._A.id)s?.lA(t,i,e,_,C.pl(d,w,m,p,g,I,-1),null,E,v,1,1,0),C.xd&&h?.lA(i,e,C.width,C.length,w,C.kd),-1!==C.ga&&r.rm(new l.A(o,t,2,i,e,c.A.Do[C.ga],!0));else if(d===f.A.xA.id)s?.hm(t,i,e,_,0,0,E,C.pl(f.A.xA.id,u.A.rw,m,p,g,I,-1),v,512*w,A.VA[w]),-1!==C.ga&&r.rm(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0));else if(d===f.A.kA.id){let n=16;if(s){const r=s.om(t,i,e);r>0&&(n=a.A.get(r>>14&32767).Fd)}s?.hm(t,i,e,_,A.XA[w]*n,A.jA[w]*n,E,C.pl(f.A.xA.id,u.A.rw,m,p,g,I,-1),v,512*w,A.VA[w]),-1!==C.ga&&r.rm(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0))}else d===f.A.EA.id?(s?.hm(t,i,e,_,0,0,E,C.pl(f.A.xA.id,u.A.rw,m,p,g,I,-1),v,w,256),-1!==C.ga&&r.rm(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0))):d===f.A.vA.id?(s?.hm(t,i,e,_,0,0,E,C.pl(f.A.xA.id,u.A.rw,m,p,g,I,-1),v,w,512),-1!==C.ga&&r.rm(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0))):d===f.A.bA.id&&(s?.hm(t,i,e,_,0,0,E,C.pl(f.A.xA.id,u.A.rw,m,p,g,I,-1),v,w,768),-1!==C.ga&&r.rm(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0)))};am;lm;Hr;Vr;fm;um;dm;wm;ym;Am;pm;gm;Im;_m;Cm;Em;constructor(t,i,e,n){this.am=t,this.lm=i,this.Hr=e,this.Vr=n,this.fm=new y.vm(s.A.Dr,t,i),this.um=new y.vm(s.A.Dr,t,i),this.dm=new y.vm(s.A.Dr,t,i),this.wm=new y.vm(s.A.Dr,t,i),this.Em=new y.bm(s.A.Dr,t+1,i+1),this.ym=new y.vm(s.A.Dr,t+1,i+1),this.Am=new y.Xr(t+1,i+1),this.pm=new Int32Array(i),this.gm=new Int32Array(i),this.Im=new Int32Array(i),this._m=new Int32Array(i),this.Cm=new Int32Array(i)}Tm=(t,i)=>{for(let t=0;t=0&&i[s]?.oA(e,n)}A.zA+=(5*Math.random()|0)-2,A.zA<-8?A.zA=-8:A.zA>8&&(A.zA=8),A.ZA+=(5*Math.random()|0)-2,A.ZA<-16?A.ZA=-16:A.ZA>16&&(A.ZA=16);for(let i=0;i>8;for(let t=1;t>2)+(e[n+1][t]>>3)+(e[n][t-1]>>2)+(e[n][t+1]>>3)+(e[n][t]>>1);this.Am[n][t]=u-d}for(let t=0;t=0&&s0){const i=n.A.Do[e-1];this.pm[t]+=i.dd,this.gm[t]+=i.ld,this.Im[t]+=i.fd,this._m[t]+=i.ud,r=this.Cm[t]++}}const h=e-5;if(h>=0&&h0){const i=n.A.Do[e-1];this.pm[t]-=i.dd,this.gm[t]-=i.ld,this.Im[t]-=i.fd,this._m[t]-=i.ud,r=this.Cm[t]--}}}if(e>=1&&e=0&&f=0&&y=1&&c0||y>0){const m=this.Hr[i][e][c],p=this.Hr[i][e+1][c],g=this.Hr[i][e+1][c+1],I=this.Hr[i][e][c+1],_=this.Am[e][c],C=this.Am[e+1][c],E=this.Am[e+1][c+1],v=this.Am[e][c+1];let b=-1,T=-1;if(f>0){const t=256*s/a|0,i=r/l|0;let e=o/l|0;b=n.A.ed(t,i,e);const h=t+A.zA&255;e+=A.ZA,e<0?e=0:e>255&&(e=255),T=n.A.ed(h,i,e)}if(i>0){let t=0!==f||this.dm[i][e][c]===w.A.Rm;y>0&&!n.A.Do[y-1].od&&(t=!1),t&&m===p&&m===g&&m===I&&(this.Em[i][e][c]|=2340)}let O=0;if(-1!==b&&(O=h.A.palette[n.A.sd(T,96)]),0===y)t?.Sm(i,e,c,w.A.Rm,u.A.rw,-1,m,p,g,I,n.A.sd(b,_),n.A.sd(b,C),n.A.sd(b,E),n.A.sd(b,v),d.A.Za,d.A.Za,d.A.Za,d.A.Za,O,d.A.Za);else{const s=this.dm[i][e][c]+1,r=this.wm[i][e][c],o=n.A.Do[y-1];let a,l,f=o.texture;f>=0?(l=h.A.Lm(f),a=-1):o.rd===d.A.xm?(l=0,a=-2,f=-1):(a=n.A.ed(o.ad,o.ld,o.fd),l=h.A.palette[n.A.nd(o.wd,96)]),t?.Sm(i,e,c,s,r,f,m,p,g,I,n.A.sd(b,_),n.A.sd(b,C),n.A.sd(b,E),n.A.sd(b,v),n.A.nd(a,_),n.A.nd(a,C),n.A.nd(a,E),n.A.nd(a,v),O,l)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let s=0;s<=n;s++)for(let r=0;r<=this.lm;r++)for(let h=0;h<=this.am;h++){if(this.Em[s][h][r]&t){let i=r,e=r,a=s,l=s;for(;i>0&&this.Em[s][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.Em[a-1][h][s]&t))break t;a--}t:for(;l=8){const s=this.Hr[l][h][i]-240,r=this.Hr[a][h][i];o.A.Nm(n,1,128*h,s,128*i,128*h,r,128*e+128);for(let s=a;s<=l;s++)for(let n=i;n<=e;n++)this.Em[s][h][n]&=~t}}if(this.Em[s][h][r]&i){let t=h,e=h,a=s,l=s;for(;t>0&&this.Em[s][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.Em[a-1][s][r]&i))break t;a--}t:for(;l=8){const s=this.Hr[l][t][r]-240,h=this.Hr[a][t][r];o.A.Nm(n,2,128*t,s,128*r,128*e+128,h,128*r);for(let s=a;s<=l;s++)for(let n=t;n<=e;n++)this.Em[s][n][r]&=~i}}if(this.Em[s][h][r]&e){let t=h,i=h,a=r,l=r;for(;a>0&&this.Em[s][h][a-1]&e;)a--;for(;l0;){for(let i=a;i<=l;i++)if(!(this.Em[s][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.Hr[s][t][a];o.A.Nm(n,4,128*t,r,128*a,128*i+128,r,128*l+128);for(let n=t;n<=i;n++)for(let t=a;t<=l;t++)this.Em[s][n][t]&=~e}}}}}};Fm=(t,i,e,r)=>{let h=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new r.A(new Uint8Array(h));for(let r=0;r=0&&l=0&&c>24,this.wm[r][l][c]=(f-2&3)<<24>>24):f<=81?this.Vr[r][l][c]=f-49<<24>>24:this.fm[r][l][c]=f-81<<24>>24}else for(;f=o.Wu,0!==f;){if(1===f){o.Wu;break}f<=49&&o.Wu}}};Um=(t,i,e,n,h,o)=>{const a=new r.A(new Uint8Array(n));let l=-1;for(;;){const n=a.Pm;if(0===n)return;l+=n;let r=0;for(;;){const n=a.Pm;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=a.Wu,w=d>>2,y=3&d,A=f+h,m=c+o;if(A>0&&m>0&&A=0&&(n=e[s]),this.lA(u,A,m,t,i,n,l,w,y)}}}};lA=(t,i,e,s,n,r,h,o,d)=>{if(A.et){if(16&this.Vr[t][i][e])return;if(this.Om(t,i,e)!==A.qA)return}const w=this.Hr[t][i][e],y=this.Hr[t][i+1][e],m=this.Hr[t][i+1][e+1],p=this.Hr[t][i][e+1],g=w+y+m+p>>2,I=a.A.get(h);let _=i+(e<<7)+(h<<14)+1073741824|0;I.active||(_+=-2147483648),_|=0;const C=(d<<6)+o<<24>>24;if(o===f.A.LA.id)(!A.et||I.active||I.qd)&&(s?.nm(I.pl(f.A.LA.id,d,w,y,m,p,-1),t,i,e,g,_,C),I.xd&&I.active&&r?.oA(i,e),-1!==I.ga&&n.rm(new l.A(h,t,3,i,e,c.A.Do[I.ga],!0)));else if(o===f.A.Rd.id||o===f.A.MA.id){const a=I.pl(f.A.Rd.id,d,w,y,m,p,-1);if(a){let n,r,h=0;if(o===f.A.MA.id&&(h+=256),d===u.A.cA||d===u.A.fA?(n=I.length,r=I.width):(n=I.width,r=I.length),s?.lA(t,i,e,g,a,null,_,C,n,r,h)&&I.Yd)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=a.Wm/4|0;r>30&&(r=30),r>this.ym[t][i+s][e+n]&&(this.ym[t][i+s][e+n]=r<<24>>24)}}I.xd&&r?.lA(i,e,I.width,I.length,d,I.kd),-1!==I.ga&&n.rm(new l.A(h,t,2,i,e,c.A.Do[I.ga],!0))}else if(o>=f.A.DA.id)s?.lA(t,i,e,g,I.pl(o,d,w,y,m,p,-1),null,_,C,1,1,0),o>=f.A.DA.id&&o<=f.A.PA.id&&o!==f.A.NA.id&&t>0&&(this.Em[t][i][e]|=2340),I.xd&&r?.lA(i,e,I.width,I.length,d,I.kd),-1!==I.ga&&n.rm(new l.A(h,t,2,i,e,c.A.Do[I.ga],!0));else if(o===f.A.wA.id)s?.dA(t,i,e,g,A.VA[d],0,I.pl(f.A.wA.id,d,w,y,m,p,-1),null,_,C),d===u.A.rw?(I.Yd&&(this.ym[t][i][e]=50,this.ym[t][i][e+1]=50),I.od&&(this.Em[t][i][e]|=585)):d===u.A.cA?(I.Yd&&(this.ym[t][i][e+1]=50,this.ym[t][i+1][e+1]=50),I.od&&(this.Em[t][i][e+1]|=1170)):d===u.A.yA?(I.Yd&&(this.ym[t][i+1][e]=50,this.ym[t][i+1][e+1]=50),I.od&&(this.Em[t][i+1][e]|=585)):d===u.A.fA&&(I.Yd&&(this.ym[t][i][e]=50,this.ym[t][i+1][e]=50),I.od&&(this.Em[t][i][e]|=1170)),I.xd&&r?.dA(i,e,o,d,I.kd),-1!==I.ga&&n.rm(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0)),16!==I.Fd&&s?.Gm(t,i,e,I.Fd);else if(o===f.A.AA.id)s?.dA(t,i,e,g,A.KA[d],0,I.pl(f.A.AA.id,d,w,y,m,p,-1),null,_,C),I.Yd&&(d===u.A.rw?this.ym[t][i][e+1]=50:d===u.A.cA?this.ym[t][i+1][e+1]=50:d===u.A.yA?this.ym[t][i+1][e]=50:d===u.A.fA&&(this.ym[t][i][e]=50)),I.xd&&r?.dA(i,e,o,d,I.kd),-1!==I.ga&&n.rm(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0));else if(o===f.A.pA.id){const a=d+1&3;s?.dA(t,i,e,g,A.VA[d],A.VA[a],I.pl(f.A.pA.id,d+4,w,y,m,p,-1),I.pl(f.A.pA.id,a,w,y,m,p,-1),_,C),I.od&&(d===u.A.rw?(this.Em[t][i][e]|=265,this.Em[t][i][e+1]|=1170):d===u.A.cA?(this.Em[t][i][e+1]|=1170,this.Em[t][i+1][e]|=585):d===u.A.yA?(this.Em[t][i+1][e]|=585,this.Em[t][i][e]|=1170):d===u.A.fA&&(this.Em[t][i][e]|=1170,this.Em[t][i][e]|=585)),I.xd&&r?.dA(i,e,o,d,I.kd),-1!==I.ga&&n.rm(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0)),16!==I.Fd&&s?.Gm(t,i,e,I.Fd)}else if(o===f.A.mA.id)s?.dA(t,i,e,g,A.KA[d],0,I.pl(f.A.mA.id,d,w,y,m,p,-1),null,_,C),I.Yd&&(d===u.A.rw?this.ym[t][i][e+1]=50:d===u.A.cA?this.ym[t][i+1][e+1]=50:d===u.A.yA?this.ym[t][i+1][e]=50:d===u.A.fA&&(this.ym[t][i][e]=50)),I.xd&&r?.dA(i,e,o,d,I.kd),-1!==I.ga&&n.rm(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0));else if(o===f.A._A.id)s?.lA(t,i,e,g,I.pl(o,d,w,y,m,p,-1),null,_,C,1,1,0),I.xd&&r?.lA(i,e,I.width,I.length,d,I.kd),-1!==I.ga&&n.rm(new l.A(h,t,2,i,e,c.A.Do[I.ga],!0));else if(o===f.A.xA.id)s?.hm(t,i,e,g,0,0,_,I.pl(f.A.xA.id,u.A.rw,w,y,m,p,-1),C,512*d,A.VA[d]),-1!==I.ga&&n.rm(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0));else if(o===f.A.kA.id){let r=16;if(s){const n=s.om(t,i,e);n>0&&(r=a.A.get(n>>14&32767).Fd)}s?.hm(t,i,e,g,A.XA[d]*r,A.jA[d]*r,_,I.pl(f.A.xA.id,u.A.rw,w,y,m,p,-1),C,512*d,A.VA[d]),-1!==I.ga&&n.rm(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0))}else o===f.A.EA.id?(s?.hm(t,i,e,g,0,0,_,I.pl(f.A.xA.id,u.A.rw,w,y,m,p,-1),C,d,256),-1!==I.ga&&n.rm(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0))):o===f.A.vA.id?(s?.hm(t,i,e,g,0,0,_,I.pl(f.A.xA.id,u.A.rw,w,y,m,p,-1),C,d,512),-1!==I.ga&&n.rm(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0))):o===f.A.bA.id&&(s?.hm(t,i,e,g,0,0,_,I.pl(f.A.xA.id,u.A.rw,w,y,m,p,-1),C,d,768),-1!==I.ga&&n.rm(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0)))};Om=(t,i,e)=>8&this.Vr[t][i][e]?0:t<=0||!(2&this.Vr[1][i][e])?t:t-1}},3045:(t,i,e)=>{e.d(i,{A:()=>g});var s=e(4583),n=e(1161),r=e(3795),h=e(8256),o=e(670),a=e(9222),l=e(6855),c=e(7441),f=e(6666),u=e(5748),d=e(3479),w=e(8950),y=e(2771),A=e(5518),m=e(6169),p=e(3867);class g{static Ym=new p.Hm(8,32,51,51,!1);static Vm=new p.fe(100,null);static Km=new Int32Array(o.A.Dr);static Xm=new p.jm(o.A.Dr,500,null);static zm=new p.fe(500,null);static Zm=new f.A;static qm=0;static Jm=0;static $m=0;static Qm=0;static tp=0;static ip=0;static ep=0;static sp=0;static np=0;static rp=0;static hp=0;static op=0;static ap=0;static lp=0;static cp=0;static fp=0;static up=0;static dp=0;static wp=0;static yp=0;static Ap=0;static mp=0;static pp=!1;static gp=null;static Ip=Uint8Array.of(19,55,38,155,255,110,137,205,76);static _p=Uint8Array.of(160,192,80,96,0,144,80,48,160);static Cp=Uint8Array.of(76,8,137,4,0,1,38,2,19);static Ep=Int8Array.of(0,0,2,0,0,2,1,1,0);static vp=Int8Array.of(2,0,0,2,0,0,0,4,4);static bp=Int8Array.of(0,4,4,8,0,0,8,0,0);static Tp=Int8Array.of(1,1,0,0,0,8,0,0,8);static Op=Int8Array.of(53,-53,-53,53);static Rp=Int8Array.of(-53,-53,53,53);static Sp=Int8Array.of(-45,45,45,-45);static Lp=Int8Array.of(45,45,-45,-45);static xp=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static kp=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static Mp=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static Dp=0;static Ha=0;static Va=0;static Np=-1;static Fp=-1;static et=!0;static init=(t,i,e,n,r)=>{this.Jm=0,this.$m=0,this.Qm=t,this.tp=i,this.ip=t/2|0,this.ep=i/2|0;const h=new p.Hm(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.sp=s.A.sin[t],this.np=s.A.cos[t],this.rp=s.A.sin[i],this.hp=s.A.cos[i];const o=(t-128)/32|0,a=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const s=128*t,l=128*i;let c=!1;for(let t=-e;t<=n;t+=128)if(this.Bp(s,l,r[o]+t)){c=!0;break}h[o][a][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let r=-1;r<=1;r++)for(let o=-1;o<=1;o++){if(h[t][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}}this.Ym[t][i][e+25][s+25]=n}};static So=()=>{this.Vm=null,this.Km=null,this.Xm=null,this.Zm=null,this.Ym=null,this.zm=null,this.gp=null,console.log('World3D unloaded!')};static Nm=(t,i,e,s,n,r,o,a)=>{g.Xm[t][g.Km[t]++]=new h.A(e/128|0,r/128|0,n/128|0,a/128|0,i,e,r,n,a,s,o)};static Bp=(t,i,e)=>{const s=i*this.rp+t*this.hp>>16,n=i*this.hp-t*this.rp>>16,r=e*this.sp+n*this.np>>16,h=e*this.np-n*this.sp>>16;if(r<50||r>3500)return!1;const o=this.ip+((s<<9)/r|0),a=this.ep+((h<<9)/r|0);return o>=this.Jm&&o<=this.Qm&&a>=this.$m&&a<=this.tp};Up;am;lm;Pp;Wp;_h;Gp;Yp;Hp;Vp=0;Kp=0;Xp=0;constructor(t,i,e,s){this.Up=e,this.am=s,this.lm=i,this.Wp=new p.Eh(e,s,i,null),this.Gp=new p.bm(e,s+1,i+1),this.Pp=t,this._h=new p.fe(5e3,null),this.Yp=new Int32Array(1e4),this.Hp=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.Kp=t;for(let i=0;i{const e=this.Wp[0][t][i];for(let e=0;e<3;e++){this.Wp[e][t][i]=this.Wp[e+1][t][i];const s=this.Wp[e][t][i];s&&s.level--}this.Wp[0][t][i]||(this.Wp[0][t][i]=new r.A(0,t,i));const s=this.Wp[0][t][i];s&&(s.zp=e),this.Wp[3][t][i]=null};km=(t,i,e,s)=>{const n=this.Wp[t][i][e];n&&(n.Zp=s)};Sm=(t,i,e,s,n,h,o,a,l,c,f,u,w,m,p,g,I,_,C,E)=>{if(s===A.A.Rm){for(let s=t;s>=0;s--)this.Wp[s][i][e]||(this.Wp[s][i][e]=new r.A(s,i,e));const s=this.Wp[t][i][e];s&&(s.qp=new d.A(f,u,w,m,-1,C,!1))}else if(s===A.A.Jp){for(let s=t;s>=0;s--)this.Wp[s][i][e]||(this.Wp[s][i][e]=new r.A(s,i,e));const s=this.Wp[t][i][e];s&&(s.qp=new d.A(p,g,I,_,h,E,o===a&&o===l&&o===c))}else{for(let s=t;s>=0;s--)this.Wp[s][i][e]||(this.Wp[s][i][e]=new r.A(s,i,e));const d=this.Wp[t][i][e];d&&(d.$p=new y.A(i,s,g,a,w,n,f,c,E,p,h,_,C,l,I,m,o,e,u))}};nm=(t,i,e,s,n,h,o)=>{this.Wp[i][e][s]||(this.Wp[i][e][s]=new r.A(i,e,s));const l=this.Wp[i][e][s];l&&(l.Qp=new a.A(n,128*e+64,128*s+64,t,h,o))};tg=(t,i,e)=>{const s=this.Wp[t][i][e];s&&(s.Qp=null)};ig=(t,i,e,s,n,h,o,a)=>{let l=0;const c=this.Wp[s][t][i];if(c)for(let t=0;tl&&(l=e)}else this.Wp[s][t][i]=new r.A(s,t,i);const f=this.Wp[s][t][i];f&&(f.ng=new u.A(e,128*t+64,128*i+64,h,o,a,n,l))};rg=(t,i,e)=>{const s=this.Wp[t][i][e];s&&(s.ng=null)};dA=(t,i,e,s,n,h,o,a,c,f)=>{if(!o&&!a)return;for(let s=t;s>=0;s--)this.Wp[s][i][e]||(this.Wp[s][i][e]=new r.A(s,i,e));const u=this.Wp[t][i][e];u&&(u.hg=new l.A(s,128*i+64,128*e+64,n,h,o,a,c,f))};gA=(t,i,e,s)=>{const n=this.Wp[t][i][e];1===s&&n&&(n.hg=null)};hm=(t,i,e,s,n,h,o,a,l,f,u)=>{if(!a)return;for(let s=t;s>=0;s--)this.Wp[s][i][e]||(this.Wp[s][i][e]=new r.A(s,i,e));const d=this.Wp[t][i][e];d&&(d.og=new c.A(s,128*i+n+64,128*e+h+64,u,f,a,o,l))};ag=(t,i,e)=>{const s=this.Wp[t][i][e];s&&(s.og=null)};Gm=(t,i,e,s)=>{const n=this.Wp[t][i][e];if(!n)return;const r=n.og;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};lg=(t,i,e,s)=>{if(!s)return;const n=this.Wp[t][i][e];if(!n)return;const r=n.og;r&&(r.model=s)};cg=(t,i,e,s)=>{if(!s)return;const n=this.Wp[t][i][e];if(!n)return;const r=n.Qp;r&&(r.model=s)};fg=(t,i,e,s)=>{if(!s)return;const n=this.Wp[t][i][e];if(!n)return;const r=n.hg;r&&(r.ug=s)};dg=(t,i,e,s,n)=>{if(!s)return;const r=this.Wp[e][t][i];if(!r)return;const h=r.hg;h&&(h.ug=s,h.wg=n)};lA=(t,i,e,s,n,r,h,o,a,l,c)=>{if(!n&&!r)return!0;const f=128*i+64*a,u=128*e+64*l;return this.yg(f,u,s,t,i,e,a,l,n,r,h,o,c,!1)};Ag=(t,i,e,s,n,r,h,o,a,l)=>{if(!n&&!r)return!0;let c=i-a,f=s-a,u=i+a,d=s+a;return l&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.yg(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};mg=(t,i,e,s,n,r,h,o,a,l,c,f)=>!a&&!l||this.yg(i,s,e,t,n,r,h+1-n,o-r+1,a,l,c,0,f,!0);uA=(t,i,e)=>{const s=this.Wp[t][i][e];if(s)for(let t=0;t>29&3)&&n.gg===i&&n.Ig===e)return void this._g(n)}};Cg=(t,i,e,s)=>{if(!s)return;const n=this.Wp[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};Eg=()=>{for(let t=0;t{const s=this.Wp[t][i][e];return s&&s.hg?s.hg.pg:0};vg=(t,i,e)=>{const s=this.Wp[t][e][i];return s&&s.og?s.og.pg:0};bg=(t,i,e)=>{const s=this.Wp[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.gg===i&&n.Ig===e)return n.pg}return 0};Tg=(t,i,e)=>{const s=this.Wp[t][i][e];return s&&s.Qp?s.Qp.pg:0};Og=(t,i,e,s)=>{const n=this.Wp[t][i][e];if(n){if(n.hg&&n.hg.pg===s)return 255&n.hg.info;if(n.og&&n.og.pg===s)return 255&n.og.info;if(n.Qp&&n.Qp.pg===s)return 255&n.Qp.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.Wp[t][i+1][e-1];n&&n.Qp&&n.Qp.model&&n.Qp.model.Rg&&this.Lg(s,n.Qp.model,128,0,-128,!0)}};Sg=(t,i,e,s,n,r)=>{let h=!0,o=i;const a=i+s,l=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.Up){for(let u=o;u<=a;u++)if(!(u<0||u>=this.am))for(let o=l;o<=c;o++){if(o<0||o>=this.lm||h&&u=e||u===i))continue;const l=this.Wp[f][u][o];if(!l)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.Pp[f][u][o]+this.Pp[f][u+1][o]+this.Pp[f][u][o+1]+this.Pp[f][u+1][o+1])/4|0)-((this.Pp[t][i][e]+this.Pp[t][i+1][e]+this.Pp[t][i][e+1]+this.Pp[t][i+1][e+1])/4|0),A=l.hg;A&&A.ug&&A.ug.Rg&&this.Lg(r,A.ug,d,y,w,h),A&&A.wg&&A.wg.Rg&&this.Lg(r,A.wg,d,y,w,h);for(let t=0;t{this.Xp++;let h=0;const o=i.tw,a=i.Qd;if(t.Rg&&t.Ng)for(let r=0;ri.Fg)continue;const u=t.tw[r]-e;if(ui.Ug)continue;const d=t.iw[r]-n;if(di.Wg)continue;if(i.Rg&&i.Ng)for(let t=0;t{const h=this.Wp[t][i][e];if(!h)return;const o=h.qp;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const a=h.$p;if(!a)return;const l=a.shape,c=a.angle,f=a.jg,u=a.zg,d=g.xp[l],w=g.kp[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{g.pp=!0,g.Ha=t,g.Va=i,g.Np=-1,g.Fp=-1};draw=(t,i,e,n,r,h,o)=>{t<0?t=0:t>=128*this.am&&(t=128*this.am-1),e<0?e=0:e>=128*this.lm&&(e=128*this.lm-1),g.qm++,g.sp=s.A.sin[h],g.np=s.A.cos[h],g.rp=s.A.sin[r],g.hp=s.A.cos[r],g.gp=g.Ym[(h-128)/32|0][r/64|0],g.op=t,g.ap=i,g.lp=e,g.cp=t/128|0,g.fp=e/128|0,g.Ap=n,g.up=g.cp-25,g.up<0&&(g.up=0),g.wp=g.fp-25,g.wp<0&&(g.wp=0),g.dp=g.cp+25,g.dp>this.am&&(g.dp=this.am),g.yp=g.fp+25,g.yp>this.lm&&(g.yp=this.lm),this.Zg(),g.mp=0;for(let t=this.Kp;t=2e3)?(h.visible=!0,h.update=!0,h.qg=h.eg>0,g.mp++):(h.visible=!1,h.update=!1,h.Jg=0))}}for(let t=this.Kp;t=g.dp))for(let t=-25;t<=0;t++){const n=g.fp+t,r=g.fp-t;let h;if(e>=g.up&&(n>=g.wp&&(h=i[e][n],h&&h.visible&&this.$g(h,!0,o)),r=g.wp&&(h=i[s][n],h&&h.visible&&this.$g(h,!0,o)),r=g.dp))for(let t=-25;t<=0;t++){const n=g.fp+t,r=g.fp-t;let h;if(e>=g.up&&(n>=g.wp&&(h=i[e][n],h&&h.visible&&this.$g(h,!1,o)),r=g.wp&&(h=i[s][n],h&&h.visible&&this.$g(h,!1,o)),r{if(!c&&!f)return!1;for(let t=h;t=this.am||i>=this.lm)return!1;const e=this.Wp[s][t][i];if(e&&e.eg>=5)return!1}const A=new n.A(s,e,t,i,c,f,w,h,h+a-1,o,o+l-1,u,d);for(let t=h;th&&(e|=1),to&&(e+=8),i=0;e--)this.Wp[e][t][i]||(this.Wp[e][t][i]=new r.A(e,t,i));const n=this.Wp[s][t][i];n&&(n.sg[n.eg]=A,n.Qg[n.eg]=e,n.tI|=e,n.eg++)}return y&&(this._h[this.Vp++]=A),!0};_g=t=>{for(let i=t.gg;i<=t.kg;i++)for(let e=t.Ig;e<=t.Mg;e++){const s=this.Wp[t.level][i][e];if(s){for(let i=0;i{const t=g.Km[g.Ap],i=g.Xm[g.Ap];g.Dp=0;for(let e=0;e=0&&s<=50){n=t.eI+25-g.fp,n<0&&(n=0),r=t.lm+25-g.fp,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.gp&&g.gp[s][n++]){i=!0;break}if(i){if(h=g.op-t.Bg,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.sI=(t.Pg-g.lp<<8)/h|0,t.nI=(t.Wg-g.lp<<8)/h|0,t.rI=(t.Fg-g.ap<<8)/h|0,t.hI=(t.cw-g.ap<<8)/h|0,g.zm[g.Dp++]=t}}}else if(2===t.type){if(s=t.eI+25-g.fp,s>=0&&s<=50){n=t.iI+25-g.cp,n<0&&(n=0),r=t.am+25-g.cp,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.gp&&g.gp[n++][s]){i=!0;break}if(i){if(h=g.lp-t.Pg,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.oI=(t.Bg-g.op<<8)/h|0,t.aI=(t.Ug-g.op<<8)/h|0,t.rI=(t.Fg-g.ap<<8)/h|0,t.hI=(t.cw-g.ap<<8)/h|0,g.zm[g.Dp++]=t}}}else if(4===t.type&&(s=t.Fg-g.ap,s>128&&(n=t.eI+25-g.fp,n<0&&(n=0),r=t.lm+25-g.fp,r>50&&(r=50),n<=r))){let i=t.iI+25-g.cp;i<0&&(i=0),h=t.am+25-g.cp,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(g.gp&&g.gp[t][i]){e=!0;break t}e&&(t.mode=5,t.oI=(t.Bg-g.op<<8)/s|0,t.aI=(t.Ug-g.op<<8)/s|0,t.sI=(t.Pg-g.lp<<8)/s|0,t.nI=(t.Wg-g.lp<<8)/s|0,g.zm[g.Dp++]=t)}}};$g=(t,i,e)=>{for(g.Zm.rm(t);;){let t;do{if(t=g.Zm.lI(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.cI,o=this.Wp[r];if(t.visible){if(i){if(r>0){const t=this.Wp[r-1][s][n];if(t&&t.update)continue}if(s<=g.cp&&s>g.up){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.tI)))continue}if(s>=g.cp&&sg.wp){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.tI)))continue}if(n>=g.fp&&nn&&(l+=6),c=g.Ip[l],t.AI=g.Cp[l]),f&&(f.mI&g._p[l]?16===f.mI?(t.Jg=3,t.pI=g.Ep[l],t.gI=3-t.pI):32===f.mI?(t.Jg=6,t.pI=g.vp[l],t.gI=6-t.pI):64===f.mI?(t.Jg=12,t.pI=g.bp[l],t.gI=12-t.pI):(t.Jg=9,t.pI=g.Tp[l],t.gI=9-t.pI):t.Jg=0,f.mI&c&&!this.II(h,s,n,f.mI)&&f.ug?.draw(0,g.sp,g.np,g.rp,g.hp,f.x-g.op,f.y-g.ap,f.z-g.lp,f.pg),f._I&c&&!this.II(h,s,n,f._I)&&f.wg?.draw(0,g.sp,g.np,g.rp,g.hp,f.x-g.op,f.y-g.ap,f.z-g.lp,f.pg)),u&&!this.visible(h,s,n,u.model.cw))if(u.type&c)u.model.draw(u.angle,g.sp,g.np,g.rp,g.hp,u.x-g.op,u.y-g.ap,u.z-g.lp,u.pg);else if(768&u.type){const t=u.x-g.op,i=u.y-g.ap,e=u.z-g.lp,s=u.angle;let n,r;if(n=s===m.A.cA||s===m.A.yA?-t:t,r=s===m.A.yA||s===m.A.fA?-e:e,256&u.type&&rn){const n=t+g.Sp[s],r=e+g.Lp[s];u.model.draw(512*s+1280&2047,g.sp,g.np,g.rp,g.hp,n,i,r,u.pg)}}if(a){const i=t.Qp;i&&i.model?.draw(0,g.sp,g.np,g.rp,g.hp,i.x-g.op,i.y-g.ap,i.z-g.lp,i.pg);const e=t.ng;e&&0===e.offset&&(e.CI&&e.CI.draw(0,g.sp,g.np,g.rp,g.hp,e.x-g.op,e.y-g.ap,e.z-g.lp,e.pg),e.EI&&e.EI.draw(0,g.sp,g.np,g.rp,g.hp,e.x-g.op,e.y-g.ap,e.z-g.lp,e.pg),e.vI&&e.vI.draw(0,g.sp,g.np,g.rp,g.hp,e.x-g.op,e.y-g.ap,e.z-g.lp,e.pg))}const d=t.tI;if(0!==d){if(sg.cp&&1&d){const t=o[s-1][n];t&&t.update&&g.Zm.rm(t)}if(n>g.fp&&8&d){const t=o[s][n-1];t&&t.update&&g.Zm.rm(t)}}}if(0!==t.Jg){let i=!0;for(let e=0;ei.gg&&(r+=1),ei.Ig&&(r+=8),ss&&(s=n);const h=g.fp-i.Ig,a=i.Mg-g.fp;i.bI=a>h?s+a:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.bI,i=e))}if(-1===i)break;const a=g.Vm[i];if(a){a.qm=g.qm;let t=a.model;t||(t=a.wI?.draw(e)??null),t&&!this.TI(h,a.gg,a.kg,a.Ig,a.Mg,t.cw)&&t.draw(a.yI,g.sp,g.np,g.rp,g.hp,a.x-g.op,a.y-g.ap,a.z-g.lp,a.pg);for(let t=a.gg;t<=a.kg;t++)for(let i=a.Ig;i<=a.Mg;i++){const e=o[t][i];e&&(0!==e.Jg?g.Zm.rm(e):t===s&&i===n||!e.update||g.Zm.rm(e))}}}if(t.qg)continue}if(!t.update||0!==t.Jg)continue;if(s<=g.cp&&s>g.up){const t=o[s-1][n];if(t&&t.update)continue}if(s>=g.cp&&sg.wp){const t=o[s][n-1];if(t&&t.update)continue}if(n>=g.fp&&n=r){const r=t+g.Op[n],h=s+g.Rp[n];i.model.draw(512*n+256,g.sp,g.np,g.rp,g.hp,r,e,h,i.pg)}if(512&i.type&&h<=r){const r=t+g.Sp[n],h=s+g.Lp[n];i.model.draw(512*n+1280&2047,g.sp,g.np,g.rp,g.hp,r,e,h,i.pg)}}const e=t.hg;e&&(e._I&t.AI&&!this.II(h,s,n,e._I)&&e.wg?.draw(0,g.sp,g.np,g.rp,g.hp,e.x-g.op,e.y-g.ap,e.z-g.lp,e.pg),e.mI&t.AI&&!this.II(h,s,n,e.mI)&&e.ug?.draw(0,g.sp,g.np,g.rp,g.hp,e.x-g.op,e.y-g.ap,e.z-g.lp,e.pg))}if(rg.cp){const t=o[s-1][n];t&&t.update&&g.Zm.rm(t)}if(n>g.fp){const t=o[s][n-1];t&&t.update&&g.Zm.rm(t)}}};uI=(t,i,e,n,r,h,o,a)=>{let l,c,f,u,d=l=(e<<7)-g.op,y=c=(n<<7)-g.lp,A=f=d+128,m=u=y+128,p=this.Pp[i][e][n]-g.ap,I=this.Pp[i][e+1][n]-g.ap,_=this.Pp[i][e+1][n+1]-g.ap,C=this.Pp[i][e][n+1]-g.ap,E=y*o+d*a>>16;if(y=y*a-d*o>>16,d=E,E=p*h-y*r>>16,y=p*r+y*h>>16,p=E,y<50)return;if(E=c*o+A*a>>16,c=c*a-A*o>>16,A=E,E=I*h-c*r>>16,c=I*r+c*h>>16,I=E,c<50)return;if(E=m*o+f*a>>16,m=m*a-f*o>>16,f=E,E=_*h-m*r>>16,m=_*r+m*h>>16,_=E,m<50)return;if(E=u*o+l*a>>16,u=u*a-l*o>>16,l=E,E=C*h-u*r>>16,u=C*r+u*h>>16,C=E,u<50)return;const v=s.A.yl+((d<<9)/y|0),b=s.A.Al+((p<<9)/y|0),T=s.A.yl+((A<<9)/c|0),O=s.A.Al+((I<<9)/c|0),R=s.A.yl+((f<<9)/m|0),S=s.A.Al+((_<<9)/m|0),L=s.A.yl+((l<<9)/u|0),x=s.A.Al+((C<<9)/u|0);if(s.A.alpha=0,(R-L)*(O-x)-(S-x)*(T-L)>0)if(s.A.OI=R<0||L<0||T<0||R>w.A.RI||L>w.A.RI||T>w.A.RI,g.pp&&this.SI(g.Ha,g.Va,S,x,O,R,L,T)&&(g.Np=e,g.Fp=n),-1===t.LI)12345678!==t.xI&&s.A.kI(R,L,T,S,x,O,t.xI,t.MI,t.DI);else if(g.et){const i=g.Mp[t.LI];s.A.kI(R,L,T,S,x,O,this.NI(i,t.xI),this.NI(i,t.MI),this.NI(i,t.DI))}else t.flat?s.A.FI(R,L,T,S,x,O,t.xI,t.MI,t.DI,d,p,y,A,l,I,C,c,u,t.LI):s.A.FI(R,L,T,S,x,O,t.xI,t.MI,t.DI,f,_,m,l,A,C,I,u,c,t.LI);if(!((v-T)*(x-O)-(b-O)*(L-T)<=0))if(s.A.OI=v<0||T<0||L<0||v>w.A.RI||T>w.A.RI||L>w.A.RI,g.pp&&this.SI(g.Ha,g.Va,b,O,x,v,T,L)&&(g.Np=e,g.Fp=n),-1!==t.LI){if(!g.et)return void s.A.FI(v,T,L,b,O,x,t.BI,t.DI,t.MI,d,p,y,A,l,I,C,c,u,t.LI);const i=g.Mp[t.LI];s.A.kI(v,T,L,b,O,x,this.NI(i,t.BI),this.NI(i,t.DI),this.NI(i,t.MI))}else 12345678!==t.BI&&s.A.kI(v,T,L,b,O,x,t.BI,t.DI,t.MI)};dI=(t,i,e,n,r,h,o)=>{let a=e.tw.length;for(let t=0;t>16;if(l=l*o-i*h>>16,i=c,c=a*r-l*n>>16,l=a*n+l*r>>16,a=c,l<50)return;e.UI&&(y.A.WI[t]=i,y.A.GI[t]=a,y.A.YI[t]=l),y.A.HI[t]=s.A.yl+((i<<9)/l|0),y.A.VI[t]=s.A.Al+((a<<9)/l|0)}s.A.alpha=0,a=e.KI.length;for(let n=0;n0)if(s.A.OI=a<0||l<0||c<0||a>w.A.RI||l>w.A.RI||c>w.A.RI,g.pp&&this.SI(g.Ha,g.Va,f,u,d,a,l,c)&&(g.Np=t,g.Fp=i),e.UI&&-1!==e.UI[n])if(g.et){const t=g.Mp[e.UI[n]];s.A.kI(a,l,c,f,u,d,this.NI(t,e.zI[n]),this.NI(t,e.ZI[n]),this.NI(t,e.qI[n]))}else e.flat?s.A.FI(a,l,c,f,u,d,e.zI[n],e.ZI[n],e.qI[n],y.A.WI[0],y.A.GI[0],y.A.YI[0],y.A.WI[1],y.A.WI[3],y.A.GI[1],y.A.GI[3],y.A.YI[1],y.A.YI[3],e.UI[n]):s.A.FI(a,l,c,f,u,d,e.zI[n],e.ZI[n],e.qI[n],y.A.WI[r],y.A.GI[r],y.A.YI[r],y.A.WI[h],y.A.WI[o],y.A.GI[h],y.A.GI[o],y.A.YI[h],y.A.YI[o],e.UI[n]);else 12345678!==e.zI[n]&&s.A.kI(a,l,c,f,u,d,e.zI[n],e.ZI[n],e.qI[n])}};fI=(t,i,e)=>{const s=this.Gp[t][i][e];if(s===-g.qm)return!1;if(s===g.qm)return!0;{const s=i<<7,n=e<<7;return this.JI(s+1,this.Pp[t][i][e],n+1)&&this.JI(s+128-1,this.Pp[t][i+1][e],n+1)&&this.JI(s+128-1,this.Pp[t][i+1][e+1],n+128-1)&&this.JI(s+1,this.Pp[t][i][e+1],n+128-1)?(this.Gp[t][i][e]=g.qm,!0):(this.Gp[t][i][e]=-g.qm,!1)}};II=(t,i,e,s)=>{if(!this.fI(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.Pp[t][i][e]-1,o=h-120,a=h-230,l=h-238;if(s<16){if(1===s){if(n>g.op){if(!this.JI(n,h,r))return!1;if(!this.JI(n,h,r+128))return!1}if(t>0){if(!this.JI(n,o,r))return!1;if(!this.JI(n,o,r+128))return!1}return!!this.JI(n,a,r)&&this.JI(n,a,r+128)}if(2===s){if(r0){if(!this.JI(n,o,r+128))return!1;if(!this.JI(n+128,o,r+128))return!1}return!!this.JI(n,a,r+128)&&this.JI(n+128,a,r+128)}if(4===s){if(n0){if(!this.JI(n+128,o,r))return!1;if(!this.JI(n+128,o,r+128))return!1}return!!this.JI(n+128,a,r)&&this.JI(n+128,a,r+128)}if(8===s){if(r>g.lp){if(!this.JI(n,h,r))return!1;if(!this.JI(n+128,h,r))return!1}if(t>0){if(!this.JI(n,o,r))return!1;if(!this.JI(n+128,o,r))return!1}return!!this.JI(n,a,r)&&this.JI(n+128,a,r)}}return!!this.JI(n+64,l,r+64)&&(16===s?this.JI(n,a,r+128):32===s?this.JI(n+128,a,r+128):64===s?this.JI(n+128,a,r):128===s?this.JI(n,a,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.fI(t,i,e)){const n=i<<7,r=e<<7;return this.JI(n+1,this.Pp[t][i][e]-s,r+1)&&this.JI(n+128-1,this.Pp[t][i+1][e]-s,r+1)&&this.JI(n+128-1,this.Pp[t][i+1][e+1]-s,r+128-1)&&this.JI(n+1,this.Pp[t][i][e+1]-s,r+128-1)}return!1};TI=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.Gp[t][h][o]===-g.qm)return!1;o=1+(i<<7);const a=2+(s<<7),l=this.Pp[t][i][s]-r;if(!this.JI(o,l,a))return!1;const c=(e<<7)-1;if(!this.JI(c,l,a))return!1;const f=(n<<7)-1;return!!this.JI(o,l,f)&&this.JI(c,l,f)}return!!this.fI(t,i,s)&&(h=i<<7,o=s<<7,this.JI(h+1,this.Pp[t][i][s]-r,o+1)&&this.JI(h+128-1,this.Pp[t][i+1][s]-r,o+1)&&this.JI(h+128-1,this.Pp[t][i+1][s+1]-r,o+128-1)&&this.JI(h+1,this.Pp[t][i][s+1]-r,o+128-1))};JI=(t,i,e)=>{for(let s=0;s0){const t=n.Pg+(n.sI*s>>8),r=n.Wg+(n.nI*s>>8),h=n.Fg+(n.rI*s>>8),o=n.cw+(n.hI*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.Bg;if(s>0){const t=n.Pg+(n.sI*s>>8),r=n.Wg+(n.nI*s>>8),h=n.Fg+(n.rI*s>>8),o=n.cw+(n.hI*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.Pg-e;if(s>0){const e=n.Bg+(n.oI*s>>8),r=n.Ug+(n.aI*s>>8),h=n.Fg+(n.rI*s>>8),o=n.cw+(n.hI*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.Pg;if(s>0){const e=n.Bg+(n.oI*s>>8),r=n.Ug+(n.aI*s>>8),h=n.Fg+(n.rI*s>>8),o=n.cw+(n.hI*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.Fg;if(s>0){const i=n.Bg+(n.oI*s>>8),r=n.Ug+(n.aI*s>>8),h=n.Pg+(n.sI*s>>8),o=n.Wg+(n.nI*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};SI=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const a=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*a>0&&a*((i-n)*(r-o)-(t-o)*(e-n))>0};NI=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{}},4197:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{$I;QI;t_;i_;index;_y;Ca;_a;constructor(t,i,e,s,n,r,h){super(),this.$I=i,this.QI=e,this.t_=s,this.i_=n,this.index=t,this._y=r,h&&-1!==r.va&&this._y.delay?(this.Ca=Math.random()*this._y.Ea|0,this._a=Math.random()*this._y.delay[this.Ca]|0):(this.Ca=-1,this._a=0)}}},9418:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(7121),n=e(1312),r=e(3867);class h extends s.A{x=0;z=0;yI=0;e_=!1;size=1;Wl=-1;s_=-1;n_=-1;r_=-1;h_=-1;o_=-1;a_=-1;l_=null;c_=100;f_=0;u_=0;d_=0;w_=0;y_=-1e3;A_=0;m_=0;p_=-1;g_=0;I_=0;__=-1;C_=0;E_=0;v_=-1;b_=0;T_=0;O_=0;R_=0;S_=-1;L_=0;x_=0;k_=0;M_=0;D_=0;N_=0;F_=0;B_=0;U_=0;P_=0;W_=0;qm=0;height=0;G_=0;pathLength=0;Y_=new Int32Array(10);H_=new Int32Array(10);V_=new r.fe(10,!1);K_=0;X_=-1;j_=-1;z_=-1;Z_=-1;move(t,i,e){if(-1!==this.v_&&n.A.Do[this.v_].priority<=1&&(this.v_=-1),!t){const t=i-this.Y_[0],s=e-this.H_[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.Y_[t]=this.Y_[t-1],this.H_[t]=this.H_[t-1],this.V_[t]=this.V_[t-1];return this.Y_[0]=i,this.H_[0]=e,void(this.V_[0]=!1)}}this.pathLength=0,this.K_=0,this.Y_[0]=i,this.H_[0]=e,this.x=128*this.Y_[0]+64*this.size,this.z=128*this.H_[0]+64*this.size}step(t,i){let e=this.Y_[0],s=this.H_[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.v_&&n.A.Do[this.v_].priority<=1&&(this.v_=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.Y_[t]=this.Y_[t-1],this.H_[t]=this.H_[t-1],this.V_[t]=this.V_[t-1];this.Y_[0]=e,this.H_[0]=s,this.V_[0]=t}}},8268:(t,i,e)=>{e.d(i,{A:()=>d});var s=e(9418),n=e(8665),r=e(2679),h=e(8738),o=e(1312),a=e(8317),l=e(1302),c=e(3819),f=e(3867),u=e(9298);class d extends s.A{static q_=1;static J_=2;static Q_=4;static tC=8;static iC=16;static eC=32;static sC=64;static nC=128;static rC=256;static hC=512;static Pl=[u.A.oC,u.A.aC,u.A.lC,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.AC,u.A.mC,u.A.pC,u.A.gC,u.A.IC,u.A._C,u.A.CC];static Ul=[[u.A.EC,u.A.vC,u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.SC,u.A.LC,u.A.xC,u.A.kC,u.A.MC,u.A.DC],[u.A.NC,u.A.FC,u.A.BC,u.A.UC,u.A.PC,u.A.WC,u.A.GC,u.A.YC,u.A.HC,u.A.VC,u.A.KC,u.A.XC,u.A.jC,u.A.zC,u.A.ZC,u.A.qC],[u.A.qC-1,u.A.NC+1,u.A.FC,u.A.BC,u.A.UC,u.A.PC,u.A.WC,u.A.GC,u.A.YC,u.A.HC,u.A.VC,u.A.KC,u.A.XC,u.A.jC,u.A.zC,u.A.ZC],[u.A.JC,u.A.$C,u.A.QC,u.A.tE,u.A.iE,u.A.eE],[u.A.sE,u.A.nE,u.A.rE,u.A.hE,u.A.oE,u.A.aE,u.A.lE,u.A.cE]];static No=new r.A(200);name=null;visible=!1;fE=0;uE=0;dE=new Uint16Array(12);wE=new Uint16Array(5);ic=0;yE=0n;y=0;AE=0;mE=0;pE=0;gE=0;IE=0;_E=null;iI=0;eI=0;am=0;lm=0;et=!1;draw(t){if(!this.visible)return null;let i=this.Iw();if(this.height=i.cw,i.bw=!0,this.et)return i;if(-1!==this.S_&&-1!==this.L_){const t=h.A.Do[this.S_],e=n.A.$u(t.pl(),!0,!t.Nd,!1);e.translate(-this.M_,0,0),e.Gl(),t._y&&t._y.frames&&e.Yl(t._y.frames[this.L_]),e.hw=null,e.ow=null,128===t.pw&&128===t.gw||e.scale(t.pw,t.gw,t.pw),e.Hl(t.Bd+64,t.Ud+850,-30,-50,-30,!0);const s=[i,e];i=n.A.CE(s,2)}if(this._E&&(t>=this.mE&&(this._E=null),t>=this.AE&&t=d.Ul[i].length)&&(e=0),this.wE[i]=e}this.Wl=t.Uu,65535===this.Wl&&(this.Wl=-1),this.s_=t.Uu,65535===this.s_&&(this.s_=-1),this.n_=t.Uu,65535===this.n_&&(this.n_=-1),this.r_=t.Uu,65535===this.r_&&(this.r_=-1),this.h_=t.Uu,65535===this.h_&&(this.h_=-1),this.o_=t.Uu,65535===this.o_&&(this.o_=-1),this.a_=t.Uu,65535===this.a_&&(this.a_=-1),this.name=c.A.kl(c.A.Ml(t.EE)),this.ic=t.Wu,this.visible=!0,this.yE=0n;for(let t=0;t<12;t++)this.yE<<=0x4n,this.dE[t]>=256&&(this.yE+=BigInt(this.dE[t])-256n);this.dE[0]>=256&&(this.yE+=BigInt(this.dE[0])-256n>>4n),this.dE[1]>=256&&(this.yE+=BigInt(this.dE[1])-256n>>8n);for(let t=0;t<5;t++)this.yE<<=0x3n,this.yE+=BigInt(this.wE[t]);this.yE<<=0x1n,this.yE+=BigInt(this.fE)}Id(){if(!this.visible)return null;const t=new f.fe(12,null);let i=0;for(let e=0;e<12;e++){const s=this.dE[e];if(s>=256&&s<512&&(t[i++]=a.A.Do[s-256].Id()),s>=512){const e=l.A.get(s-512).Id(this.fE);e&&(t[i++]=e)}}const e=n.A.Fl(t,i);for(let t=0;t<5;t++)0!==this.wE[t]&&(e.Bl(d.Ul[t][0],d.Ul[t][this.wE[t]]),1===t&&e.Bl(d.Pl[0],d.Pl[this.wE[t]]));return e}Iw(){let t=this.yE,i=-1,e=-1,s=-1,r=-1;if(this.v_>=0&&0===this.O_){const n=o.A.Do[this.v_];if(n.frames&&(i=n.frames[this.b_]),this.__>=0&&this.__!==this.Wl){const t=o.A.Do[this.__].frames;t&&(e=t[this.C_])}n.py>=0&&(s=n.py,t+=BigInt(s-this.dE[5])<<8n),n.gy>=0&&(r=n.gy,t+=BigInt(r-this.dE[3])<<16n)}else if(this.__>=0){const t=o.A.Do[this.__].frames;t&&(i=t[this.C_])}let h=d.No?.get(t);if(!h){const i=new f.fe(12,null);let e=0;for(let t=0;t<12;t++){let n=this.dE[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=a.A.Do[n-256].pl();t&&(i[e++]=t)}if(n>=512){const t=l.A.get(n-512).yy(this.fE);t&&(i[e++]=t)}}h=n.A.Fl(i,e);for(let t=0;t<5;t++)0!==this.wE[t]&&(h.Bl(d.Ul[t][0],d.Ul[t][this.wE[t]]),1===t&&h.Bl(d.Pl[0],d.Pl[this.wE[t]]));h.Gl(),h.Hl(64,850,-30,-50,-30,!0),d.No?.put(t,h)}if(this.et)return h;const c=n.A._w(h,!0);return-1!==i&&-1!==e?c.Cw(i,e,o.A.Do[this.v_].Ay):-1!==i&&c.Yl(i),c.Ew(),c.hw=null,c.ow=null,c}}},9222:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;model;pg;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.pg=n,this.info=r}}},1161:(t,i,e)=>{e.d(i,{A:()=>s});class s{level;y;x;z;model;wI;yI;gg;kg;Ig;Mg;pg;info;bI=0;qm=0;constructor(t,i,e,s,n,r,h,o,a,l,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.wI=r,this.yI=h,this.gg=o,this.kg=a,this.Ig=l,this.Mg=c,this.pg=f,this.info=u}}},5748:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;vI;EI;CI;pg;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.vI=s,this.EI=n,this.CI=r,this.pg=h,this.offset=o}}},8256:(t,i,e)=>{e.d(i,{A:()=>s});class s{iI;am;eI;lm;type;Bg;Ug;Pg;Wg;Fg;cw;mode=0;oI=0;aI=0;sI=0;nI=0;rI=0;hI=0;constructor(t,i,e,s,n,r,h,o,a,l,c){this.iI=t,this.am=i,this.eI=e,this.lm=s,this.type=n,this.Bg=r,this.Ug=h,this.Pg=o,this.Wg=a,this.Fg=l,this.cw=c}}},3795:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1982),n=e(3867);class r extends s.A{level;x;z;cI;sg;Qg;qp=null;$p=null;hg=null;og=null;Qp=null;ng=null;zp=null;eg=0;tI=0;Zp=0;visible=!1;update=!1;qg=!1;Jg=0;pI=0;gI=0;AI=0;constructor(t,i,e){super(),this.cI=this.level=t,this.x=i,this.z=e,this.sg=new n.fe(5,null),this.Qg=new Int32Array(5)}}},2771:(t,i,e)=>{e.d(i,{A:()=>s});class s{static HI=new Int32Array(6);static VI=new Int32Array(6);static WI=new Int32Array(6);static GI=new Int32Array(6);static YI=new Int32Array(6);static vE=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static bE=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static TE=128;static OE=this.TE/2|0;static RE=this.TE/4|0;static SE=3*this.TE/4|0;tw;ew;iw;zI;ZI;qI;KI;XI;jI;UI;flat;shape;angle;jg;zg;constructor(t,i,e,n,r,h,o,a,l,c,f,u,d,w,y,A,m,p,g){this.flat=!(m!==n||m!==w||m!==a),this.shape=i,this.angle=h,this.jg=d,this.zg=l;const I=s.vE[i],_=I.length;this.tw=new Int32Array(_),this.ew=new Int32Array(_),this.iw=new Int32Array(_);const C=new Int32Array(_),E=new Int32Array(_),v=t*s.TE,b=p*s.TE;for(let t=0;t<_;t++){let i,l,f,d,p,_=I[t];!(1&_)&&_<=8&&(_=1+(_-h-h-1&7)),_>8&&_<=12&&(_=9+(_-h-9&3)),_>12&&_<=16&&(_=13+(_-h-13&3)),1===_?(i=v,l=b,f=m,d=o,p=c):2===_?(i=v+s.OE,l=b,f=m+n>>1,d=o+g>>1,p=c+e>>1):3===_?(i=v+s.TE,l=b,f=n,d=g,p=e):4===_?(i=v+s.TE,l=b+s.OE,f=n+w>>1,d=g+r>>1,p=e+y>>1):5===_?(i=v+s.TE,l=b+s.TE,f=w,d=r,p=y):6===_?(i=v+s.OE,l=b+s.TE,f=w+a>>1,d=r+A>>1,p=y+u>>1):7===_?(i=v,l=b+s.TE,f=a,d=A,p=u):8===_?(i=v,l=b+s.OE,f=a+m>>1,d=A+o>>1,p=u+c>>1):9===_?(i=v+s.OE,l=b+s.RE,f=m+n>>1,d=o+g>>1,p=c+e>>1):10===_?(i=v+s.SE,l=b+s.OE,f=n+w>>1,d=g+r>>1,p=e+y>>1):11===_?(i=v+s.OE,l=b+s.SE,f=w+a>>1,d=r+A>>1,p=y+u>>1):12===_?(i=v+s.RE,l=b+s.OE,f=a+m>>1,d=A+o>>1,p=u+c>>1):13===_?(i=v+s.RE,l=b+s.RE,f=m,d=o,p=c):14===_?(i=v+s.SE,l=b+s.RE,f=n,d=g,p=e):15===_?(i=v+s.SE,l=b+s.SE,f=w,d=r,p=y):(i=v+s.RE,l=b+s.SE,f=a,d=A,p=u),this.tw[t]=i,this.ew[t]=f,this.iw[t]=l,C[t]=d,E[t]=p}const T=s.bE[i],O=T.length/4|0;this.KI=new Int32Array(O),this.XI=new Int32Array(O),this.jI=new Int32Array(O),this.zI=new Int32Array(O),this.ZI=new Int32Array(O),this.qI=new Int32Array(O),this.UI=-1!==f?new Int32Array(O):null;let R=0;for(let t=0;t{e.d(i,{A:()=>s});class s{static Rm=0;static Jp=1;static LE=2;static xE=3;static kE=4;static ME=5;static OE=6;static RE=7;static SE=8;static DE=9;static NE=10;static FE=11}},3479:(t,i,e)=>{e.d(i,{A:()=>s});class s{BI;DI;xI;MI;LI;color;flat;constructor(t,i,e,s,n,r,h){this.BI=t,this.DI=i,this.xI=e,this.MI=s,this.LI=n,this.color=r,this.flat=h}}},6855:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;mI;_I;ug;wg;pg;info;constructor(t,i,e,s,n,r,h,o,a){this.y=t,this.x=i,this.z=e,this.mI=s,this._I=n,this.ug=r,this.wg=h,this.pg=o,this.info=a}}},7441:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;type;angle;model;pg;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.pg=h,this.info=o}}},7536:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{BE;UE;constructor(t){this.UE=[],this.BE=t;for(let i=0;i{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{WE;GE;constructor(){super(),this.WE=this,this.GE=this}YE(){this.GE&&this.WE&&(this.GE.WE=this.WE,this.WE.GE=this.GE,this.WE=null,this.GE=null)}}},3819:(t,i,e)=>{e.d(i,{A:()=>s});class s{static HE=['_','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','0','1','2','3','4','5','6','7','8','9'];static VE=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static Ml=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.HE[Number(s-37n*t)]}return e.slice(12-i).join('')};static KE=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static XE=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static kl=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static qu=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}},6666:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{jE;cursor=null;constructor(){const t=new s.A;t.next=t,t.PE=t,this.jE=t}rm(t){t.PE&&t.kw(),t.PE=this.jE.PE,t.next=this.jE,t.PE&&(t.PE.next=t),t.next.PE=t}zE(t){t.PE&&t.kw(),t.PE=this.jE,t.next=this.jE.next,t.PE.next=t,t.next&&(t.next.PE=t)}lI(){const t=this.jE.next;return t===this.jE?null:(t?.kw(),t)}head(){const t=this.jE.next;return t===this.jE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}ZE(){const t=this.jE.PE;return t===this.jE?(this.cursor=null,null):(this.cursor=t?.PE||null,t)}next(){const t=this.cursor;return t===this.jE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}PE(){const t=this.cursor;return t===this.jE?(this.cursor=null,null):(this.cursor=t?.PE||null,t)}clear(){for(;;){const t=this.jE.next;if(t===this.jE)return;t?.kw()}}}},1982:(t,i,e)=>{e.d(i,{A:()=>s});class s{key;next;PE;constructor(){this.key=0n,this.next=this,this.PE=this}kw(){this.PE&&this.next&&(this.PE.next=this.next,this.next.PE=this.PE,this.next=null,this.PE=null)}}},2679:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(2512),n=e(7536);class r{qE;JE;history;available;constructor(t){this.qE=t,this.available=t,this.JE=new n.A(1024),this.history=new s.A}get(t){const i=this.JE.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.kw(),t?.YE()}else this.available--;this.JE.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.kw(),t.YE()):this.available=this.qE}}},2512:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n{head;constructor(){this.head=new s.A}push(t){t.GE&&t.YE(),t.GE=this.head.GE,t.WE=this.head,t.GE&&(t.GE.WE=t),t.WE.GE=t}pop(){const t=this.head.WE;return t===this.head?null:(t?.YE(),t)}}},8534:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(3867);class r{static Do=[];static wc=t=>{const i=new s.A(t.read('base_head.dat')),e=new s.A(t.read('base_type.dat')),h=new s.A(t.read('base_label.dat')),o=i.Uu;i.Yf+=2;for(let t=0;t{e.d(i,{A:()=>r});var s=e(8534),n=e(1069);class r{static Do=[];static wc=t=>{const i=new n.A(t.read('frame_head.dat')),e=new n.A(t.read('frame_tran1.dat')),h=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),a=i.Uu;i.Yf+=2;const l=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){l[A]=i,c[A]=0,f[A]=0,u[A]=0,A++;break}l[A]=t;let e=0;3===d.types[l[A]]&&(e=128),c[A]=1&i?h.QE:e,f[A]=2&i?h.QE:e,u[A]=4&i?h.QE:e,y=t,A++}}n.length=A,n.tv=new Int32Array(A),n.x=new Int32Array(A),n.y=new Int32Array(A),n.z=new Int32Array(A);for(let t=0;t{e.d(i,{af:()=>s,na:()=>n,iv:()=>o,ev:()=>h,sv:()=>r});const s=document.getElementById('canvas'),n=s.getContext('2d',{willReadFrequently:!0}),r=document.createElement('canvas'),h=document.createElement('img'),o=r.getContext('2d',{willReadFrequently:!0})},9298:(t,i,e)=>{e.d(i,{A:()=>s});class s{static RED=16711680;static GREEN=65280;static BLUE=255;static qa=16776960;static nv=65535;static xm=16711935;static La=16777215;static Za=0;static rv=16748608;static hv=8388608;static ov=128;static av=16756736;static lv=16740352;static cv=16723968;static fv=12648192;static uv=8453888;static dv=4259584;static wv=9179409;static yv=6116423;static fa=2301979;static ua=5063219;static wa=7759444;static Aa=3353893;static Av=8388736;static mv=13350793;static pv=Int32Array.of(s.qa,s.RED,s.GREEN,s.nv,s.xm,s.La);static EC=6798;static vC=107;static bC=10283;static TC=16;static OC=4797;static RC=7744;static SC=5799;static LC=4634;static xC=33697;static kC=22433;static MC=2983;static DC=54193;static NC=8741;static FC=12;static BC=64030;static UC=43162;static PC=7735;static WC=8404;static GC=1701;static YC=38430;static HC=24094;static VC=10153;static KC=56621;static XC=4783;static jC=1341;static zC=16578;static ZC=35003;static qC=25239;static oC=9104;static aC=10275;static lC=7595;static cC=3610;static fC=7975;static uC=8526;static dC=918;static wC=38802;static yC=24466;static AC=10145;static mC=58654;static pC=5027;static gC=1457;static IC=16565;static _C=34991;static CC=25486;static JC=4626;static $C=11146;static QC=6439;static tE=12;static iE=4758;static eE=10270;static cE=4574;static sE=4550;static nE=4537;static rE=5681;static hE=5673;static oE=5790;static aE=6806;static lE=8076}},8950:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n extends s.A{static Fw=new Int32Array;static Bw=0;static Uw=0;static top=0;static bottom=0;static left=0;static right=0;static RI=0;static gv=0;static Iv=0;static bind=(t,i,e)=>{this.Fw=t,this.Bw=i,this.Uw=e,this.Ta(0,0,i,e)};static _v=()=>{this.left=0,this.top=0,this.right=this.Bw,this.bottom=this.Uw,this.RI=this.right-1,this.gv=this.right/2|0};static Ta=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.Bw&&(e=this.Bw),s>this.Uw&&(s=this.Uw),this.top=i,this.bottom=s,this.left=t,this.right=e,this.RI=this.right-1,this.gv=this.right/2|0,this.Iv=this.bottom/2|0};static clear=()=>{const t=this.Bw*this.Uw;for(let i=0;i{this.ya(t,i,n,e),this.ya(t,i+s-1,n,e),this.da(t,i,n,s),this.da(t+e-1,i,n,s)};static ya=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.Bw;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.Bw;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(l-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.Bw-e;let h=t+i*this.Bw;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.Fw[h++]=n;h+=r}};static Cv(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,a=(n>>8&255)*r,l=(255&n)*r,c=this.Bw-e;let f=t+i*this.Bw;for(let t=0;t>16&255)*h>>8<<16)+(a+(this.Fw[f]>>8&255)*h>>8<<8)+(l+(255&this.Fw[f])*h>>8);this.Fw[f++]=t}f+=c}}static Ev(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,a=(255&s)*n;let l=i-e;l<0&&(l=0);let c=i+e;c>=this.Uw&&(c=this.Uw-1);for(let s=l;s<=c;s++){const n=s-i,l=0|Math.sqrt(e*e-n*n);let c=t-l;c<0&&(c=0);let f=t+l;f>=this.Bw&&(f=this.Bw-1);let u=c+s*this.Bw;for(let t=c;t<=f;t++){const t=(h+(this.Fw[u]>>16&255)*r>>8<<16)+(o+(this.Fw[u]>>8&255)*r>>8<<8)+(a+(255&this.Fw[u])*r>>8);this.Fw[u++]=t}}}static vv=(t,i,e)=>{t=this.right||i=this.bottom||(this.Fw[t+i*this.Bw]=e)}}},4583:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1673),r=e(3867);class h extends s.A{static et=!1;static bv=new Int32Array(512);static Tv=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static Ov=new r.fe(50,null);static Rv=0;static Nw=new Int32Array;static yl=0;static Al=0;static Pw=!0;static OI=!1;static alpha=0;static Sv=null;static Lv=new r.fe(50,null);static xv=0;static qm=0;static kv=new Int32Array(50);static Mv=new r.fe(50,null);static Dv=!1;static Nv=new r.fe(50,!1);static Fv=new Int32Array(50);static{for(let t=1;t<512;t++)this.bv[t]=32768/t|0;for(let t=1;t<2048;t++)this.Tv[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static So=()=>{this.bv=null,this.bv=null,this.sin=null,this.cos=null,this.Nw=null,this.Ov=null,this.Nv=null,this.Fv=null,this.Sv=null,this.Lv=null,this.kv=null,this.palette=null,this.Mv=null,console.log('Draw3D unloaded!')};static yc=()=>{this.Nw=new Int32Array(s.A.Uw);for(let t=0;t{this.Nw=new Int32Array(i);for(let e=0;e{this.Sv=null,this.Lv.fill(null)};static fc=t=>{this.Rv=0;for(let i=0;i<50;i++)try{this.Ov[i]=n.A.cc(t,i.toString()),this.et&&128===this.Ov[i]?.Xa?this.Ov[i]?.Pv():this.Ov[i]?.zw(),this.Rv++}catch(t){}};static Lm=t=>{if(0!==this.Fv[t])return this.Fv[t];const i=this.Mv[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.Wv(h,1.4),0===h&&(h=1),this.Fv[t]=h,h};static uc=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,a=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let l=s-.3333333333333333;l<0&&l++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,a=6*l<1?i+6*(t-i)*l:2*l<1?t:3*l<2?i+(t-i)*(.6666666666666666-l)*6:i}const l=((256*h|0)<<16)+((256*o|0)<<8)+(256*a|0);this.palette[e++]=this.Wv(l,i)}}for(let t=0;t<50;t++){const e=this.Ov[t];if(!e)continue;const s=e.palette;this.Mv[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static dc=t=>{this.Sv||(this.xv=t,this.et?this.Sv=new r.Xr(t,16384):this.Sv=new r.Xr(t,65536),this.Lv.fill(null))};static kI=(t,i,e,n,r,o,a,l,c)=>{let f=0,u=0;r!==n&&(f=(i-t<<16)/(r-n)|0,u=(l-a<<15)/(r-n)|0);let d=0,w=0;o!==r&&(d=(e-i<<16)/(o-r)|0,w=(c-l<<15)/(o-r)|0);let y=0,A=0;if(o!==n&&(y=(t-e<<16)/(n-o)|0,A=(a-c<<15)/(n-o)|0),n<=r&&n<=o){if(ns.A.bottom&&(r=s.A.bottom),o>s.A.bottom&&(o=s.A.bottom),rd)for(o-=r,r-=n,n=h.Nw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Yv(e>>16,i>>16,c>>7,l>>7,s.A.Fw,n,0),e+=y,i+=d,c+=A,l+=w,n+=s.A.Bw}this.Yv(e>>16,t>>16,c>>7,a>>7,s.A.Fw,n,0),e+=y,t+=f,c+=A,a+=u,n+=s.A.Bw}else for(o-=r,r-=n,n=h.Nw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Yv(i>>16,e>>16,l>>7,c>>7,s.A.Fw,n,0),e+=y,i+=d,c+=A,l+=w,n+=s.A.Bw}this.Yv(t>>16,e>>16,a>>7,c>>7,s.A.Fw,n,0),e+=y,t+=f,c+=A,a+=u,n+=s.A.Bw}else if(i=t<<=16,l=a<<=15,n<0&&(i-=y*n,t-=f*n,l-=A*n,a-=u*n,n=0),e<<=16,c<<=15,o<0&&(e-=d*o,c-=w*o,o=0),n!==o&&yf)for(r-=o,o-=n,n=h.Nw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Yv(e>>16,t>>16,c>>7,a>>7,s.A.Fw,n,0),e+=d,t+=f,c+=w,a+=u,n+=s.A.Bw}this.Yv(i>>16,t>>16,l>>7,a>>7,s.A.Fw,n,0),i+=y,t+=f,l+=A,a+=u,n+=s.A.Bw}else for(r-=o,o-=n,n=h.Nw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Yv(t>>16,e>>16,a>>7,c>>7,s.A.Fw,n,0),e+=d,t+=f,c+=w,a+=u,n+=s.A.Bw}this.Yv(t>>16,i>>16,a>>7,l>>7,s.A.Fw,n,0),i+=y,t+=f,l+=A,a+=u,n+=s.A.Bw}}else if(r<=o){if(rs.A.bottom&&(o=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),oy)for(n-=o,o-=r,r=h.Nw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Yv(t>>16,e>>16,a>>7,c>>7,s.A.Fw,r,0),t+=f,e+=y,a+=u,c+=A,r+=s.A.Bw}this.Yv(t>>16,i>>16,a>>7,l>>7,s.A.Fw,r,0),t+=f,i+=d,a+=u,l+=w,r+=s.A.Bw}else for(n-=o,o-=r,r=h.Nw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Yv(e>>16,t>>16,c>>7,a>>7,s.A.Fw,r,0),t+=f,e+=y,a+=u,c+=A,r+=s.A.Bw}this.Yv(i>>16,t>>16,l>>7,a>>7,s.A.Fw,r,0),t+=f,i+=d,a+=u,l+=w,r+=s.A.Bw}else if(e=i<<=16,c=l<<=15,r<0&&(e-=f*r,i-=d*r,c-=u*r,l-=w*r,r=0),t<<=16,a<<=15,n<0&&(t-=y*n,a-=A*n,n=0),o-=n,n-=r,r=h.Nw[r],f>16,i>>16,a>>7,l>>7,s.A.Fw,r,0),t+=y,i+=d,a+=A,l+=w,r+=s.A.Bw}this.Yv(e>>16,i>>16,c>>7,l>>7,s.A.Fw,r,0),e+=f,i+=d,c+=u,l+=w,r+=s.A.Bw}else for(;;){if(--n<0)for(;;){if(--o<0)return;this.Yv(i>>16,t>>16,l>>7,a>>7,s.A.Fw,r,0),t+=y,i+=d,a+=A,l+=w,r+=s.A.Bw}this.Yv(i>>16,e>>16,l>>7,c>>7,s.A.Fw,r,0),e+=f,i+=d,c+=u,l+=w,r+=s.A.Bw}}else if(os.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,l>>7,a>>7,s.A.Fw,o,0),i+=d,t+=f,l+=w,a+=u,o+=s.A.Bw}this.Yv(i>>16,e>>16,l>>7,c>>7,s.A.Fw,o,0),i+=d,e+=y,l+=w,c+=A,o+=s.A.Bw}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Yv(t>>16,i>>16,a>>7,l>>7,s.A.Fw,o,0),i+=d,t+=f,l+=w,a+=u,o+=s.A.Bw}this.Yv(e>>16,i>>16,c>>7,l>>7,s.A.Fw,o,0),i+=d,e+=y,l+=w,c+=A,o+=s.A.Bw}else if(t=e<<=16,a=c<<=15,o<0&&(t-=d*o,e-=y*o,a-=w*o,c-=A*o,o=0),i<<=16,l<<=15,r<0&&(i-=f*r,l-=u*r,r=0),n-=r,r-=o,o=h.Nw[o],d>16,e>>16,l>>7,c>>7,s.A.Fw,o,0),i+=f,e+=y,l+=u,c+=A,o+=s.A.Bw}this.Yv(t>>16,e>>16,a>>7,c>>7,s.A.Fw,o,0),t+=d,e+=y,a+=w,c+=A,o+=s.A.Bw}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Yv(e>>16,i>>16,c>>7,l>>7,s.A.Fw,o,0),i+=f,e+=y,l+=u,c+=A,o+=s.A.Bw}this.Yv(e>>16,t>>16,c>>7,a>>7,s.A.Fw,o,0),t+=d,e+=y,a+=w,c+=A,o+=s.A.Bw}};static Yv=(t,i,e,n,r,o,a)=>{let l;if(h.Pw){let c;if(h.OI){if(c=i-t>3?(n-e)/(i-t)|0:0,i>s.A.RI&&(i=s.A.RI),t<0&&(e-=t*c,t=0),t>=i)return;o+=t,a=i-t>>2,c<<=2}else{if(!(t>2)>0?(n-e)*h.bv[a]>>15:0}if(0===h.alpha)for(;;){if(--a<0){if((a=i-t&3)>0){l=h.palette[e>>8];do{r[o++]=l,a--}while(a>0);return}break}l=h.palette[e>>8],e+=c,r[o++]=l,r[o++]=l,r[o++]=l,r[o++]=l}else{const s=h.alpha,n=256-h.alpha;for(;;){if(--a<0){if((a=i-t&3)>0){l=h.palette[e>>8],l=((16711935&l)*n>>8&16711935)+((65280&l)*n>>8&65280);do{r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),a--}while(a>0)}break}l=h.palette[e>>8],e+=c,l=((16711935&l)*n>>8&16711935)+((65280&l)*n>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280)}}}else if(ts.A.RI&&(i=s.A.RI),t<0&&(e-=t*c,t=0),t>=i))return;if(o+=t,a=i-t,0===h.alpha)do{r[o++]=h.palette[e>>8],e+=c,a--}while(a>0);else{const t=h.alpha,i=256-h.alpha;do{l=h.palette[e>>8],e+=c,l=((16711935&l)*i>>8&16711935)+((65280&l)*i>>8&65280),r[o++]=l+((16711935&r[o])*t>>8&16711935)+((65280&r[o])*t>>8&65280),a--}while(a>0)}}};static Hv=(t,i,e,n,r,h,o)=>{let a=0;r!==n&&(a=(i-t<<16)/(r-n)|0);let l=0;h!==r&&(l=(e-i<<16)/(h-r)|0);let c=0;if(h!==n&&(c=(t-e<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),rl)for(h-=r,r-=n,n=this.Nw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Vv(e>>16,i>>16,s.A.Fw,n,o),e+=c,i+=l,n+=s.A.Bw}this.Vv(e>>16,t>>16,s.A.Fw,n,o),e+=c,t+=a,n+=s.A.Bw}else for(h-=r,r-=n,n=this.Nw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Vv(i>>16,e>>16,s.A.Fw,n,o),e+=c,i+=l,n+=s.A.Bw}this.Vv(t>>16,e>>16,s.A.Fw,n,o),e+=c,t+=a,n+=s.A.Bw}else if(i=t<<=16,n<0&&(i-=c*n,t-=a*n,n=0),e<<=16,h<0&&(e-=l*h,h=0),n!==h&&ca)for(r-=h,h-=n,n=this.Nw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Vv(e>>16,t>>16,s.A.Fw,n,o),e+=l,t+=a,n+=s.A.Bw}this.Vv(i>>16,t>>16,s.A.Fw,n,o),i+=c,t+=a,n+=s.A.Bw}else for(r-=h,h-=n,n=this.Nw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Vv(t>>16,e>>16,s.A.Fw,n,o),e+=l,t+=a,n+=s.A.Bw}this.Vv(t>>16,i>>16,s.A.Fw,n,o),i+=c,t+=a,n+=s.A.Bw}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hc)for(n-=h,h-=r,r=this.Nw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Vv(t>>16,e>>16,s.A.Fw,r,o),t+=a,e+=c,r+=s.A.Bw}this.Vv(t>>16,i>>16,s.A.Fw,r,o),t+=a,i+=l,r+=s.A.Bw}else for(n-=h,h-=r,r=this.Nw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Vv(e>>16,t>>16,s.A.Fw,r,o),t+=a,e+=c,r+=s.A.Bw}this.Vv(i>>16,t>>16,s.A.Fw,r,o),t+=a,i+=l,r+=s.A.Bw}else if(e=i<<=16,r<0&&(e-=a*r,i-=l*r,r=0),t<<=16,n<0&&(t-=c*n,n=0),a>16,i>>16,s.A.Fw,r,o),t+=c,i+=l,r+=s.A.Bw}this.Vv(e>>16,i>>16,s.A.Fw,r,o),e+=a,i+=l,r+=s.A.Bw}else for(h-=n,n-=r,r=this.Nw[r];;){if(--n<0)for(;;){if(--h<0)return;this.Vv(i>>16,t>>16,s.A.Fw,r,o),t+=c,i+=l,r+=s.A.Bw}this.Vv(i>>16,e>>16,s.A.Fw,r,o),e+=a,i+=l,r+=s.A.Bw}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.Fw,h,o),i+=l,t+=a,h+=s.A.Bw}this.Vv(i>>16,e>>16,s.A.Fw,h,o),i+=l,e+=c,h+=s.A.Bw}else for(r-=n,n-=h,h=this.Nw[h];;){if(--n<0)for(;;){if(--r<0)return;this.Vv(t>>16,i>>16,s.A.Fw,h,o),i+=l,t+=a,h+=s.A.Bw}this.Vv(e>>16,i>>16,s.A.Fw,h,o),i+=l,e+=c,h+=s.A.Bw}else if(t=e<<=16,h<0&&(t-=l*h,e-=c*h,h=0),i<<=16,r<0&&(i-=a*r,r=0),l>16,e>>16,s.A.Fw,h,o),i+=a,e+=c,h+=s.A.Bw}this.Vv(t>>16,e>>16,s.A.Fw,h,o),t+=l,e+=c,h+=s.A.Bw}else for(n-=r,r-=h,h=this.Nw[h];;){if(--r<0)for(;;){if(--n<0)return;this.Vv(e>>16,i>>16,s.A.Fw,h,o),i+=a,e+=c,h+=s.A.Bw}this.Vv(e>>16,t>>16,s.A.Fw,h,o),t+=l,e+=c,h+=s.A.Bw}};static FI=(t,i,e,n,r,h,o,a,l,c,f,u,d,w,y,A,m,p,g)=>{const I=this.Kv(g);this.Dv=!this.Nv[g];const _=c-d,C=f-y,E=u-m,v=w-c,b=A-f,T=p-u;let O=v*f-b*c<<14;const R=b*u-T*f<<8,S=T*c-v*u<<5;let L=_*f-C*c<<14;const x=C*u-E*f<<8,k=E*c-_*u<<5;let M=C*v-_*b<<14;const D=E*b-C*T<<8,N=_*T-E*v<<5;let F=0,B=0;r!==n&&(F=(i-t<<16)/(r-n)|0,B=(a-o<<16)/(r-n)|0);let U=0,P=0;h!==r&&(U=(e-i<<16)/(h-r)|0,P=(l-a<<16)/(h-r)|0);let W=0,G=0;if(h!==n&&(W=(t-e<<16)/(n-h)|0,G=(o-l<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),rU)for(h-=r,r-=n,n=this.Nw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Xv(e>>16,i>>16,s.A.Fw,n,I,0,0,O,L,M,R,x,D,l>>8,a>>8),e+=W,i+=U,l+=G,a+=P,n+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(e>>16,t>>16,s.A.Fw,n,I,0,0,O,L,M,R,x,D,l>>8,o>>8),e+=W,t+=F,l+=G,o+=B,n+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(h-=r,r-=n,n=this.Nw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Xv(i>>16,e>>16,s.A.Fw,n,I,0,0,O,L,M,R,x,D,a>>8,l>>8),e+=W,i+=U,l+=G,a+=P,n+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(t>>16,e>>16,s.A.Fw,n,I,0,0,O,L,M,R,x,D,o>>8,l>>8),e+=W,t+=F,l+=G,o+=B,n+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}else{i=t<<=16,a=o<<=16,n<0&&(i-=W*n,t-=F*n,a-=G*n,o-=B*n,n=0),e<<=16,l<<=16,h<0&&(e-=U*h,l-=P*h,h=0);const c=n-this.Al;if(O+=S*c,L+=k*c,M+=N*c,O|=0,L|=0,M|=0,(n===h||W>=F)&&(n!==h||U<=F))for(r-=h,h-=n,n=this.Nw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Xv(t>>16,e>>16,s.A.Fw,n,I,0,0,O,L,M,R,x,D,o>>8,l>>8),e+=U,t+=F,l+=P,o+=B,n+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(t>>16,i>>16,s.A.Fw,n,I,0,0,O,L,M,R,x,D,o>>8,a>>8),i+=W,t+=F,a+=G,o+=B,n+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(r-=h,h-=n,n=this.Nw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Xv(e>>16,t>>16,s.A.Fw,n,I,0,0,O,L,M,R,x,D,l>>8,o>>8),e+=U,t+=F,l+=P,o+=B,n+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(i>>16,t>>16,s.A.Fw,n,I,0,0,O,L,M,R,x,D,a>>8,o>>8),i+=W,t+=F,a+=G,o+=B,n+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hW)for(n-=h,h-=r,r=this.Nw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Xv(t>>16,e>>16,s.A.Fw,r,I,0,0,O,L,M,R,x,D,o>>8,l>>8),t+=F,e+=W,o+=B,l+=G,r+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(t>>16,i>>16,s.A.Fw,r,I,0,0,O,L,M,R,x,D,o>>8,a>>8),t+=F,i+=U,o+=B,a+=P,r+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(n-=h,h-=r,r=this.Nw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Xv(e>>16,t>>16,s.A.Fw,r,I,0,0,O,L,M,R,x,D,l>>8,o>>8),t+=F,e+=W,o+=B,l+=G,r+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(i>>16,t>>16,s.A.Fw,r,I,0,0,O,L,M,R,x,D,a>>8,o>>8),t+=F,i+=U,o+=B,a+=P,r+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}else{e=i<<=16,l=a<<=16,r<0&&(e-=F*r,i-=U*r,l-=B*r,a-=P*r,r=0),t<<=16,o<<=16,n<0&&(t-=W*n,o-=G*n,n=0);const c=r-this.Al;if(O+=S*c,L+=k*c,M+=N*c,O|=0,L|=0,M|=0,h-=n,n-=r,r=this.Nw[r],F>16,i>>16,s.A.Fw,r,I,0,0,O,L,M,R,x,D,o>>8,a>>8),t+=W,i+=U,o+=G,a+=P,r+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(e>>16,i>>16,s.A.Fw,r,I,0,0,O,L,M,R,x,D,l>>8,a>>8),e+=F,i+=U,l+=B,a+=P,r+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(;;){if(--n<0)for(;;){if(--h<0)return;this.Xv(i>>16,t>>16,s.A.Fw,r,I,0,0,O,L,M,R,x,D,a>>8,o>>8),t+=W,i+=U,o+=G,a+=P,r+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(i>>16,e>>16,s.A.Fw,r,I,0,0,O,L,M,R,x,D,a>>8,l>>8),e+=F,i+=U,l+=B,a+=P,r+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.Fw,h,I,0,0,O,L,M,R,x,D,a>>8,o>>8),i+=U,t+=F,a+=P,o+=B,h+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(i>>16,e>>16,s.A.Fw,h,I,0,0,O,L,M,R,x,D,a>>8,l>>8),i+=U,e+=W,a+=P,l+=G,h+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Xv(t>>16,i>>16,s.A.Fw,h,I,0,0,O,L,M,R,x,D,o>>8,a>>8),i+=U,t+=F,a+=P,o+=B,h+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(e>>16,i>>16,s.A.Fw,h,I,0,0,O,L,M,R,x,D,l>>8,a>>8),i+=U,e+=W,a+=P,l+=G,h+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}else{t=e<<=16,o=l<<=16,h<0&&(t-=U*h,e-=W*h,o-=P*h,l-=G*h,h=0),i<<=16,a<<=16,r<0&&(i-=F*r,a-=B*r,r=0);const c=h-this.Al;if(O+=S*c,L+=k*c,M+=N*c,O|=0,L|=0,M|=0,n-=r,r-=h,h=this.Nw[h],U>16,e>>16,s.A.Fw,h,I,0,0,O,L,M,R,x,D,a>>8,l>>8),i+=F,e+=W,a+=B,l+=G,h+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(t>>16,e>>16,s.A.Fw,h,I,0,0,O,L,M,R,x,D,o>>8,l>>8),t+=U,e+=W,o+=P,l+=G,h+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Xv(e>>16,i>>16,s.A.Fw,h,I,0,0,O,L,M,R,x,D,l>>8,a>>8),i+=F,e+=W,a+=B,l+=G,h+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(e>>16,t>>16,s.A.Fw,h,I,0,0,O,L,M,R,x,D,l>>8,o>>8),t+=U,e+=W,o+=P,l+=G,h+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}};static Xv=(t,i,e,n,r,h,o,a,l,c,f,u,d,w,y)=>{if(t>=i)return;let A,m,p,g,I,_,C,E,v;if(this.OI){if(A=(y-w)/(i-t)|0,i>s.A.RI&&(i=s.A.RI),t<0&&(w-=t*A,t=0),t>=i)return;m=i-t>>3,A<<=12}else i-t>7?(m=i-t>>3,A=(y-w)*this.bv[m]>>6):(m=0,A=0);if(w<<=9,n+=t,this.et&&r)if(p=0,g=0,_=t-this.yl,a+=(f>>3)*_,l+=(u>>3)*_,c+=(d>>3)*_,a|=0,l|=0,I=(c|=0)>>12,0!==I&&(o=l/I|0,(h=a/I|0)<0?h=0:h>4032&&(h=4032)),a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>12,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=g-o>>3,h+=w>>3&786432,v=w>>23,this.Dv){for(;m-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h=p,o=g,a+=f,l+=u,I=(c+=d)>>12,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=g-o>>3,h+=(w+=A)>>3&786432,v=w>>23;for(m=i-t&7;m-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E}else{for(;m-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n+=1,h=p,o=g,a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>12,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=g-o>>3,h+=(w+=A)>>3&786432,v=w>>23}for(m=i-t&7;m-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}else if(p=0,g=0,_=t-this.yl,a+=(f>>3)*_,l+=(u>>3)*_,c+=(d>>3)*_,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(o=l/I|0,(h=a/I|0)<0?h=0:h>16256&&(h=16256)),a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=g-o>>3,h+=6291456&w,v=w>>23,this.Dv&&r){for(;m-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h=p,o=g,a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=g-o>>3,h+=6291456&(w+=A),v=w>>23;for(m=i-t&7;m-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E}else{for(;m-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,h=p,o=g,a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=g-o>>3,h+=6291456&(w+=A),v=w>>23}for(m=i-t&7;m-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}};static Vv=(t,i,e,n,r)=>{if(this.OI&&(i>s.A.RI&&(i=s.A.RI),t<0&&(t=0)),t>=i)return;n+=t;let h=i-t>>2;if(0===this.alpha)for(;;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;e[n++]=r}e[n++]=r,e[n++]=r,e[n++]=r,e[n++]=r}const o=this.alpha,a=256-this.alpha;for(r=((16711935&r)*a>>8&16711935)+((65280&r)*a>>8&65280);;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}};static Gv=t=>{this.Lv[t]&&this.Sv&&(this.Sv[this.xv++]=this.Lv[t],this.Lv[t]=null)};static Kv=t=>{if(this.kv[t]=this.qm++,this.Lv[t])return this.Lv[t];let i;if(this.xv>0&&this.Sv)i=this.Sv[--this.xv],this.Sv[this.xv]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.Fw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.Fw[t]];this.Nv[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.Nv[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}},880:(t,i,e)=>{e.d(i,{r:()=>n});var s=e(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(s.ev.src),s.ev.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>s.ev.onload=()=>t())),s.iv.clearRect(0,0,s.sv.width,s.sv.height);const i=s.ev.naturalWidth,e=s.ev.naturalHeight;return s.sv.width=i,s.sv.height=e,s.iv.drawImage(s.ev,0,0),s.iv.getImageData(0,0,i,e)}},8665:(t,i,e)=>{e.d(i,{A:()=>f});var s=e(1069),n=e(8950),r=e(4583),h=e(6730),o=e(4474),a=e(3867);class l{Qd=0;Yg=0;jv=0;zv=-1;Zv=-1;qv=-1;Jv=-1;$v=-1;Qv=-1;tb=-1;ib=-1;eb=-1;sb=0;nb=-1;rb=-1;hb=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static ob=null;static ab=null;static lb=null;static cb=null;static fb=null;static ub=null;static wb=null;static yb=null;static Ab=null;static mb=null;static pb=null;static gb=null;static axis=null;static Ib=new a.fe(4096,!1);static _b=new a.fe(4096,!1);static Cb=new Int32Array(4096);static Eb=new Int32Array(4096);static vb=new Int32Array(4096);static bb=new Int32Array(4096);static Tb=new Int32Array(4096);static Ob=new Int32Array(4096);static Rb=new Int32Array(1500);static Sb=new a.Xr(1500,512);static Lb=new Int32Array(12);static xb=new a.Xr(12,2e3);static kb=new Int32Array(2e3);static Mb=new Int32Array(2e3);static Db=new Int32Array(12);static Nb=new Int32Array(10);static Fb=new Int32Array(10);static Bb=new Int32Array(10);static Ir=0;static Ub=0;static _r=0;static Pb=!1;static Ha=0;static Va=0;static Wb=0;static Gb=new Int32Array(1e3);static Yb=!1;static wc(t){try{f.head=new s.A(t.read('ob_head.dat')),f.ob=new s.A(t.read('ob_face1.dat')),f.ab=new s.A(t.read('ob_face2.dat')),f.lb=new s.A(t.read('ob_face3.dat')),f.cb=new s.A(t.read('ob_face4.dat')),f.fb=new s.A(t.read('ob_face5.dat')),f.ub=new s.A(t.read('ob_point1.dat')),f.wb=new s.A(t.read('ob_point2.dat')),f.yb=new s.A(t.read('ob_point3.dat')),f.Ab=new s.A(t.read('ob_point4.dat')),f.mb=new s.A(t.read('ob_point5.dat')),f.pb=new s.A(t.read('ob_vertex1.dat')),f.gb=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.Yf=0,f.ub.Yf=0,f.wb.Yf=0,f.yb.Yf=0,f.Ab.Yf=0,f.pb.Yf=0,f.gb.Yf=0;const i=f.head.Uu;f.metadata=new a.fe(i+100,null);let e=0,n=0,r=0,h=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static $d=(t,i,e)=>{const s=t.Qd,n=t.Yg,r=t.jv;let h,o,l,u,d;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.Qd,r=t.Yg,h=t.jv;let o,a,l,c,u;if(s)o=t.tw,a=t.ew,l=t.iw;else{o=new Int32Array(n),a=new Int32Array(n),l=new Int32Array(n);for(let i=0;i{const e=t.Qd,s=t.Yg,n=t.jv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,a=0,l=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,a=0,l=-1;for(let c=0;c{let o=-1;const a=t.tw[i],l=t.ew[i],c=t.iw[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.ob&&f.ab&&f.lb&&f.cb&&f.fb&&f.ub&&f.wb&&f.yb&&f.Ab&&f.mb&&f.pb&&f.gb&&f.axis))throw new Error('cant loading model!!!!!');const e=i.Qd,s=i.Yg,n=i.jv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),a=new Int32Array(s),l=new Int32Array(s),c=new Int32Array(s),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;i.$v>=0&&(y=new Int32Array(e));let A=null;i.eb>=0&&(A=new Int32Array(s));let m=null,p=0;i.sb>=0?m=new Int32Array(s):p=-i.sb-1;let g=null;i.nb>=0&&(g=new Int32Array(s));let I=null;i.rb>=0&&(I=new Int32Array(s));const _=new Int32Array(s);f.ub.Yf=i.zv,f.wb.Yf=i.Zv,f.yb.Yf=i.qv,f.Ab.Yf=i.Jv,f.mb.Yf=i.$v;let C,E,v,b=0,T=0,O=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const e=f.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const n=e.Qd,r=e.Yg,h=e.jv,o=new Int32Array(n),a=new Int32Array(n),l=new Int32Array(n),c=new Int32Array(r),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(h),y=new Int32Array(h),A=new Int32Array(h);let m=null;e.$v>=0&&(m=new Int32Array(n));let p=null;e.eb>=0&&(p=new Int32Array(r));let g=null,I=0;e.sb>=0?g=new Int32Array(r):I=-e.sb-1;let _=null;e.nb>=0&&(_=new Int32Array(r));let C=null;e.rb>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(e.data);v.Yf=e.zv;const b=new s.A(e.data);b.Yf=e.Zv;const T=new s.A(e.data);T.Yf=e.qv;const O=new s.A(e.data);O.Yf=e.Jv;const R=new s.A(e.data);R.Yf=e.$v;let S,L,x,k=0,M=0,D=0;for(let t=0;tthis.cw&&(this.cw=-e),e>this.Fg&&(this.Fg=e);const n=i*i+s*s;n>this.Wm&&(this.Wm=n)}this.Wm=Math.sqrt(this.Wm)+.99|0,this.tT=Math.sqrt(this.Wm*this.Wm+this.cw*this.cw)+.99|0,this.Qb=this.tT+(Math.sqrt(this.Wm*this.Wm+this.Fg*this.Fg)+.99|0)}sw(){this.cw=0,this.Fg=0;for(let t=0;tthis.cw&&(this.cw=-i),i>this.Fg&&(this.Fg=i)}this.tT=Math.sqrt(this.Wm*this.Wm+this.cw*this.cw)+.99|0,this.Qb=this.tT+(Math.sqrt(this.Wm*this.Wm+this.Fg*this.Fg)+.99|0)}Gl(){if(this.iT){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.ow=new a.fe(i+1,null);for(let e=0;e<=i;e++)this.ow[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.hw=new a.fe(i+1,null);for(let e=0;e<=i;e++)this.hw[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ea;)a=e[o++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==a||0===r.types[i])&&this.hT(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}f.Ir=0,f.Ub=0,f._r=0,o=0,a=e[o++];for(let t=0;ta;)a=e[o++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===a||0===r.types[i])&&this.hT(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.Yl(t)}Yl(t){if(!this.ow||-1===t||!h.A.Do[t])return;const i=h.A.Do[t],e=i.$E;f.Ir=0,f.Ub=0,f._r=0;for(let t=0;t>16;this.iw[t]=this.ew[t]*i+this.iw[t]*e>>16,this.ew[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.Kb&&this.Xb&&this.jb||(this.Kb=new Int32Array(this.Yg),this.Xb=new Int32Array(this.Yg),this.jb=new Int32Array(this.Yg)),!this.Rg){this.Rg=new a.fe(this.Qd,null);for(let t=0;t8192||m>8192||p>8192||A<-8192||m<-8192||p<-8192;)A>>=1,m>>=1,p>>=1;let g=0|Math.sqrt(A*A+m*m+p*p);if(g<=0&&(g=1),A=256*A/g|0,m=256*m/g|0,p=256*p/g|0,this.Gg&&1&this.Gg[i]){const r=t+((e*A+s*m+n*p)/(h+(h/2|0))|0);this.Ju&&(this.Kb[i]=f.Vb(this.Ju[i],r,this.Gg[i]))}else{let t=this.Rg[r];t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.Rg[o],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.Rg[a],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++)}}if(r)this.xg(t,h,e,s,n);else{this.Ng=new a.fe(this.Qd,null);for(let t=0;t>16;for(let s=0;s>16,I=I*w-g*d>>16,g=p),0!==t&&(p=I*l-_*a>>16,_=I*a+_*l>>16,I=p),0!==i&&(p=_*c+g*u>>16,_=_*u-g*c>>16,g=p),g+=n,I+=h,_+=o,p=I*A-_*y>>16,_=I*y+_*A>>16,I=p,f.Cb&&f.Eb&&f.vb&&(f.vb[s]=_-m,f.Cb[s]=r.A.yl+((g<<9)/_|0),f.Eb[s]=r.A.Al+((I<<9)/_|0)),this.jv>0&&f.bb&&f.Tb&&f.Ob&&(f.bb[s]=g,f.Tb[s]=I,f.Ob[s]=_)}try{this.lT(!1,!1,0)}catch(t){}}draw(t,i,e,s,h,o,a,l,c){const u=l*h-o*s>>16,d=a*i+u*e>>16,w=this.Wm*e>>16,y=d+w;if(y<=50||d>=3500)return;const A=l*s+o*h>>16;let m=A-this.Wm<<9;if((m/y|0)>=n.A.gv)return;let p=A+this.Wm<<9;if((p/y|0)<=-n.A.gv)return;const g=a*e-u*i>>16,I=this.Wm*i>>16;let _=g+I<<9;if((_/y|0)<=-n.A.Iv)return;let C=g-(I+(this.cw*e>>16))<<9;if((C/y|0)>=n.A.Iv)return;let E=d-(w+(this.cw*i>>16))<=50,v=!1;if(c>0&&f.Pb){let t=d-w;t<=50&&(t=50),A>0?(m=m/y|0,p=p/t|0):(p=p/y|0,m=m/t|0),g>0?(C=C/y|0,_=_/t|0):(_=_/y|0,C=C/t|0);const i=f.Ha-r.A.yl,e=f.Va-r.A.Al;i>m&&iC&&e<_&&(this.bw?f.Gb[f.Wb++]=c:v=!0)}const b=r.A.yl,T=r.A.Al;let O=0,R=0;0!==t&&(O=r.A.sin[t],R=r.A.cos[t]);for(let n=0;n>16,w=w*R-c*O>>16,c=r),c+=o,u+=a,w+=l,r=w*s+c*h>>16,w=w*h-c*s>>16,c=r,r=u*e-w*i>>16,w=u*i+w*e>>16,u=r,f.vb&&(f.vb[n]=w-d),w>=50&&f.Cb&&f.Eb?(f.Cb[n]=b+((c<<9)/w|0),f.Eb[n]=T+((u<<9)/w|0)):f.Cb&&(f.Cb[n]=-5e3,E=!0),(E||this.jv>0)&&f.bb&&f.Tb&&f.Ob&&(f.bb[n]=c,f.Tb[n]=u,f.Ob[n]=w)}try{this.lT(E,v,c)}catch(t){}}lT(t,i,e,s=!1){f.Yb&&(this.nT=-1,this.rT=-1);for(let t=0;tn.A.RI||l>n.A.RI||c>n.A.RI),f.Sb&&f.Rb){const t=((y+A+m)/3|0)+this.tT;f.Sb[t][f.Rb[t]++]=s,f.Yb&&this.cT(f.Ha,f.Va,u,d,w,a,l,c)&&this.rT=0;t--){const i=f.Rb[t];if(!(i<=0)&&f.Sb){const e=f.Sb[t];for(let t=0;t=0;t--){const i=f.Rb[t];if(i>0&&f.Sb){const e=f.Sb[t];for(let s=0;s0||f.Lb[2]>0)&&(r=(f.Db[1]+f.Db[2])/(f.Lb[1]+f.Lb[2])|0);let h=0;f.Lb&&f.Db&&(f.Lb[3]>0||f.Lb[4]>0)&&(h=(f.Db[3]+f.Db[4])/(f.Lb[3]+f.Lb[4])|0);let o=0;if(f.Lb&&f.Db&&(f.Lb[6]>0||f.Lb[8]>0)&&(o=(f.Db[6]+f.Db[8])/(f.Lb[6]+f.Lb[8])|0),f.Lb&&f.xb){let t,i=0,e=f.Lb[10],n=f.xb[10],a=f.kb;i===e&&(i=0,e=f.Lb[11],n=f.xb[11],a=f.Mb),t=ir;)try{this.fT(n[i++],s),i===e&&n!==f.xb[11]&&(i=0,e=f.Lb[11],n=f.xb[11],a=f.Mb),t=ih;)try{this.fT(n[i++],s),i===e&&n!==f.xb[11]&&(i=0,e=f.Lb[11],n=f.xb[11],a=f.Mb),t=io;)try{this.fT(n[i++],s),i===e&&n!==f.xb[11]&&(i=0,e=f.Lb[11],n=f.xb[11],a=f.Mb),t=i>2,h=this.qb[i],o=this.Jb[i],a=this.$b[i];r.A.FI(f.Cb[e],f.Cb[s],f.Cb[n],f.Eb[e],f.Eb[s],f.Eb[n],this.Kb[t],this.Xb[t],this.jb[t],f.bb[h],f.Tb[h],f.Ob[h],f.bb[o],f.bb[a],f.Tb[o],f.Tb[a],f.Ob[o],f.Ob[a],this.Ju[t])}else if(3===h&&this.Gg&&this.Ju&&this.Kb&&f.Cb&&f.Eb&&f.bb&&f.Tb&&f.Ob){const i=this.Gg[t]>>2,h=this.qb[i],o=this.Jb[i],a=this.$b[i];r.A.FI(f.Cb[e],f.Cb[s],f.Cb[n],f.Eb[e],f.Eb[s],f.Eb[n],this.Kb[t],this.Kb[t],this.Kb[t],f.bb[h],f.Tb[h],f.Ob[h],f.bb[o],f.bb[a],f.Tb[o],f.Tb[a],f.Ob[o],f.Ob[a],this.Ju[t])}}uT(t,i=!1){let e=0;if(f.Ob){const i=r.A.yl,s=r.A.Al,n=this.Hg[t],h=this.Vg[t],o=this.Kg[t],a=f.Ob[n],l=f.Ob[h],c=f.Ob[o];if(a>=50&&f.Cb&&f.Eb&&this.Kb)f.Nb[e]=f.Cb[n],f.Fb[e]=f.Eb[n],f.Bb[e++]=this.Kb[t];else if(f.bb&&f.Tb&&this.Kb){const u=f.bb[n],d=f.Tb[n],w=this.Kb[t];if(c>=50&&this.jb){const n=(50-a)*r.A.Tv[c-a];f.Nb[e]=i+((u+((f.bb[o]-u)*n>>16)<<9)/50|0),f.Fb[e]=s+((d+((f.Tb[o]-d)*n>>16)<<9)/50|0),f.Bb[e++]=w+((this.jb[t]-w)*n>>16)}if(l>=50&&this.Xb){const n=(50-a)*r.A.Tv[l-a];f.Nb[e]=i+((u+((f.bb[h]-u)*n>>16)<<9)/50|0),f.Fb[e]=s+((d+((f.Tb[h]-d)*n>>16)<<9)/50|0),f.Bb[e++]=w+((this.Xb[t]-w)*n>>16)}}if(l>=50&&f.Cb&&f.Eb&&this.Xb)f.Nb[e]=f.Cb[h],f.Fb[e]=f.Eb[h],f.Bb[e++]=this.Xb[t];else if(f.bb&&f.Tb&&this.Xb){const u=f.bb[h],d=f.Tb[h],w=this.Xb[t];if(a>=50&&this.Kb){const h=(50-l)*r.A.Tv[a-l];f.Nb[e]=i+((u+((f.bb[n]-u)*h>>16)<<9)/50|0),f.Fb[e]=s+((d+((f.Tb[n]-d)*h>>16)<<9)/50|0),f.Bb[e++]=w+((this.Kb[t]-w)*h>>16)}if(c>=50&&this.jb){const n=(50-l)*r.A.Tv[c-l];f.Nb[e]=i+((u+((f.bb[o]-u)*n>>16)<<9)/50|0),f.Fb[e]=s+((d+((f.Tb[o]-d)*n>>16)<<9)/50|0),f.Bb[e++]=w+((this.jb[t]-w)*n>>16)}}if(c>=50&&f.Cb&&f.Eb&&this.jb)f.Nb[e]=f.Cb[o],f.Fb[e]=f.Eb[o],f.Bb[e++]=this.jb[t];else if(f.bb&&f.Tb&&this.jb){const u=f.bb[o],d=f.Tb[o],w=this.jb[t];if(l>=50&&this.Xb){const n=(50-c)*r.A.Tv[l-c];f.Nb[e]=i+((u+((f.bb[h]-u)*n>>16)<<9)/50|0),f.Fb[e]=s+((d+((f.Tb[h]-d)*n>>16)<<9)/50|0),f.Bb[e++]=w+((this.Xb[t]-w)*n>>16)}if(a>=50&&this.Kb){const h=(50-c)*r.A.Tv[a-c];f.Nb[e]=i+((u+((f.bb[n]-u)*h>>16)<<9)/50|0),f.Fb[e]=s+((d+((f.Tb[n]-d)*h>>16)<<9)/50|0),f.Bb[e++]=w+((this.Kb[t]-w)*h>>16)}}}const s=f.Nb[0],h=f.Nb[1],o=f.Nb[2],a=f.Fb[0],l=f.Fb[1],c=f.Fb[2];if(!((s-h)*(c-l)-(a-l)*(o-h)<=0))if(r.A.OI=!1,3===e){let e;if((s<0||h<0||o<0||s>n.A.RI||h>n.A.RI||o>n.A.RI)&&(r.A.OI=!0),e=this.Gg?3&this.Gg[t]:0,i)r.A.xc(s,h,a,l,f.Bb[0]),r.A.xc(h,o,l,c,f.Bb[1]),r.A.xc(o,s,c,a,f.Bb[2]);else if(0===e)r.A.kI(s,h,o,a,l,c,f.Bb[0],f.Bb[1],f.Bb[2]);else if(1===e&&this.Kb)r.A.Hv(s,h,o,a,l,c,r.A.palette[this.Kb[t]]);else if(2===e&&this.Gg&&this.Ju&&f.bb&&f.Tb&&f.Ob){const i=this.Gg[t]>>2,e=this.qb[i],n=this.Jb[i],u=this.$b[i];r.A.FI(s,h,o,a,l,c,f.Bb[0],f.Bb[1],f.Bb[2],f.bb[e],f.Tb[e],f.Ob[e],f.bb[n],f.bb[u],f.Tb[n],f.Tb[u],f.Ob[n],f.Ob[u],this.Ju[t])}else if(3===e&&this.Gg&&this.Ju&&this.Kb&&f.bb&&f.Tb&&f.Ob){const i=this.Gg[t]>>2,e=this.qb[i],n=this.Jb[i],u=this.$b[i];r.A.FI(s,h,o,a,l,c,this.Kb[t],this.Kb[t],this.Kb[t],f.bb[e],f.Tb[e],f.Ob[e],f.bb[n],f.bb[u],f.Tb[n],f.Tb[u],f.Ob[n],f.Ob[u],this.Ju[t])}}else if(4===e){let e;if((s<0||h<0||o<0||s>n.A.RI||h>n.A.RI||o>n.A.RI||f.Nb[3]<0||f.Nb[3]>n.A.RI)&&(r.A.OI=!0),e=this.Gg?3&this.Gg[t]:0,i)r.A.xc(s,h,a,l,f.Bb[0]),r.A.xc(h,o,l,c,f.Bb[1]),r.A.xc(o,f.Nb[3],c,f.Fb[3],f.Bb[2]),r.A.xc(f.Nb[3],s,f.Fb[3],a,f.Bb[3]);else if(0===e)r.A.kI(s,h,o,a,l,c,f.Bb[0],f.Bb[1],f.Bb[2]),r.A.kI(s,o,f.Nb[3],a,c,f.Fb[3],f.Bb[0],f.Bb[2],f.Bb[3]);else if(1===e){if(this.Kb){const i=r.A.palette[this.Kb[t]];r.A.Hv(s,h,o,a,l,c,i),r.A.Hv(s,o,f.Nb[3],a,c,f.Fb[3],i)}}else if(2===e&&this.Gg&&this.Ju&&f.bb&&f.Tb&&f.Ob){const i=this.Gg[t]>>2,e=this.qb[i],n=this.Jb[i],u=this.$b[i];r.A.FI(s,h,o,a,l,c,f.Bb[0],f.Bb[1],f.Bb[2],f.bb[e],f.Tb[e],f.Ob[e],f.bb[n],f.bb[u],f.Tb[n],f.Tb[u],f.Ob[n],f.Ob[u],this.Ju[t]),r.A.FI(s,o,f.Nb[3],a,c,f.Fb[3],f.Bb[0],f.Bb[2],f.Bb[3],f.bb[e],f.Tb[e],f.Ob[e],f.bb[n],f.bb[u],f.Tb[n],f.Tb[u],f.Ob[n],f.Ob[u],this.Ju[t])}else if(3===e&&this.Gg&&this.Ju&&this.Kb&&f.bb&&f.Tb&&f.Ob){const i=this.Gg[t]>>2,e=this.qb[i],n=this.Jb[i],u=this.$b[i];r.A.FI(s,h,o,a,l,c,this.Kb[t],this.Kb[t],this.Kb[t],f.bb[e],f.Tb[e],f.Ob[e],f.bb[n],f.bb[u],f.Tb[n],f.Tb[u],f.Ob[n],f.Ob[u],this.Ju[t]),r.A.FI(s,o,f.Nb[3],a,c,f.Fb[3],this.Kb[t],this.Kb[t],this.Kb[t],f.bb[e],f.Tb[e],f.Ob[e],f.bb[n],f.bb[u],f.Tb[n],f.Tb[u],f.Ob[n],f.Ob[u],this.Ju[t])}}}hT(t,i,e,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f.Ir=0,f.Ub=0,f._r=0;for(let t=0;t0?(f.Ir=(f.Ir/n|0)+t,f.Ub=(f.Ub/n|0)+i,f._r=(f._r/n|0)+e):(f.Ir=t,f.Ub=i,f._r=e)}else if(1===n)for(let n=0;n=this.ow.length)continue;const h=this.ow[r];if(h)for(let s=0;s=this.ow.length)continue;const o=this.ow[h];if(o)for(let s=0;s>16;this.ew[n]=this.ew[n]*u-this.tw[n]*c>>16,this.tw[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.ew[n]*u-this.iw[n]*c>>16;this.iw[n]=this.ew[n]*c+this.iw[n]*u>>16,this.ew[n]=t}if(0!==a){c=r.A.sin[a],u=r.A.cos[a];const t=this.iw[n]*c+this.tw[n]*u>>16;this.iw[n]=this.iw[n]*u-this.tw[n]*c>>16,this.tw[n]=t}this.tw[n]+=f.Ir,this.ew[n]+=f.Ub,this.iw[n]+=f._r}}else if(3===n)for(let n=0;n=this.ow.length)continue;const h=this.ow[r];if(h)for(let s=0;s=this.hw.length)continue;const n=this.hw[e];if(n)for(let i=0;i255&&(this.Zb[e]=255)}}}aT(){this.cw=0,this.Wm=0,this.Fg=0,this.Bg=999999,this.Ug=-999999,this.Wg=-99999,this.Pg=99999;for(let t=0;tthis.Ug&&(this.Ug=i),sthis.Wg&&(this.Wg=s),-e>this.cw&&(this.cw=-e),e>this.Fg&&(this.Fg=e);const n=i*i+s*s;n>this.Wm&&(this.Wm=n)}this.Wm=0|Math.sqrt(this.Wm),this.tT=0|Math.sqrt(this.Wm*this.Wm+this.cw*this.cw),this.Qb=this.tT+(0|Math.sqrt(this.Wm*this.Wm+this.Fg*this.Fg))}cT(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{e.d(i,{A:()=>o});var s=e(8950),n=e(1069),r=e(4474),h=e(880);class o extends r.A{Fw;width;height;wT;yT;Xa;xw;constructor(t,i){super(),this.Fw=new Int32Array(t*i),this.width=this.Xa=t,this.height=this.xw=i,this.wT=this.yT=0}static AT=async(t,i)=>{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(0,h.r)(e),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),a=n.Fw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static cc=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.Yf=s.Uu;const h=r.Uu,a=r.Uu,l=[],c=r.Wu-1;for(let t=0;ts.length||r.Yf>r.length)throw new Error;const f=r.Wu,u=r.Wu,d=r.Uu,w=r.Uu,y=new o(d,w);y.wT=f,y.yT=u,y.Xa=h,y.xw=a;const A=r.Wu;if(0===A){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.mT(h,r,this.Fw,n,a,s.A.Fw,e,o)}Ka(t,i,e){i|=0,e|=0;let n=(i+=this.wT)+(e+=this.yT)*s.A.Bw,r=0,h=this.height,o=this.width,a=s.A.Bw-o,l=0;if(es.A.bottom&&(h-=e+h-s.A.bottom),is.A.right){const t=i+o-s.A.right;o-=t,l+=t,a+=t}o>0&&h>0&&this.pT(o,h,this.Fw,r,l,s.A.Fw,n,a,t)}gT(t,i){t|=0,i|=0;let e=(t+=this.wT)+(i+=this.yT)*s.A.Bw,n=0,r=this.height,h=this.width,o=s.A.Bw-h,a=0;if(is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.IT(h,r,this.Fw,n,a,s.A.Fw,e,o)}_T(){const t=this.Fw,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.Fw[s]=(r<<16)+(h<<8)+o}}}zw(t,i,e,n){t|=0,i|=0,e|=0,n|=0;try{const r=this.width;let h=0,o=0;const a=this.Xa,l=this.xw,c=(a<<16)/e|0,f=(l<<16)/n|0;t+=(this.wT*e+a-1)/a|0,i+=(this.yT*n+l-1)/l|0,this.wT*e%a!=0&&(h=(a-this.wT*e%a<<16)/e|0),this.yT*n%l!=0&&(o=(l-this.yT*n%l<<16)/n|0),e=e*(this.width-(h>>16))/a|0,n=n*(this.height-(o>>16))/l|0;let u=t+i*s.A.Bw,d=s.A.Bw-e;if(is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right){const i=t+e-s.A.right;e-=i,d+=i}this.scale(e,n,this.Fw,h,o,s.A.Fw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}ET(t,i,e,n,r,h,o,a,l,c){t|=0,i|=0,e|=0,n|=0;try{const f=-e/2|0,u=-n/2|0,d=65536*Math.sin(l/326.11)|0,w=65536*Math.cos(l/326.11)|0,y=d*c>>8,A=w*c>>8;let m=(o<<16)+u*y+f*A,p=u*A-f*y+(a<<16),g=t+i*s.A.Bw;for(let t=0;t>16)+(o>>16)*this.width],n+=A,o-=y;m+=y,p+=A,g+=s.A.Bw}}catch(t){}}vT(t,i,e){t|=0,i|=0;let n=(t+=this.wT)+(i+=this.yT)*s.A.Bw,r=0,h=this.height,o=this.width,a=s.A.Bw-o,l=0;if(is.A.bottom&&(h-=i+h-s.A.bottom),ts.A.right){const i=t+o-s.A.right;o-=i,l+=i,a+=i}o>0&&h>0&&this.bT(o,h,this.Fw,l,r,s.A.Fw,n,a,e.Fw)}scale(t,i,e,s,n,r,h,o,a,l,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*a;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=l}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}IT(t,i,e,s,n,r,h,o){const a=-(t>>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}pT(t,i,e,s,n,r,h,o,a){const l=256-a;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*a+(16711935&i)*l&4278255360)+((65280&t)*a+(65280&i)*l&16711680)>>8}}h+=o,s+=n}}mT(t,i,e,s,n,r,h,o){const a=-(t>>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}bT(t,i,e,s,n,r,h,o,a){const l=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=l;t<0;t++){let t=e[n++];0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===a[h]?r[h++]=t:h++}h+=o,n+=s}}}},1673:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1069),r=e(4474);class h extends r.A{Fw;width;height;wT;yT;Xa;xw;palette;constructor(t,i,e){super(),this.Fw=new Int8Array(t*i),this.width=this.Xa=t,this.height=this.xw=i,this.wT=this.yT=0,this.palette=e}static cc=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.Yf=s.Uu;const o=r.Uu,a=r.Uu,l=r.Wu,c=new Int32Array(l);for(let t=1;ts.length||r.Yf>r.length)throw new Error;const f=r.Wu,u=r.Wu,d=r.Uu,w=r.Uu,y=new h(d,w,c);y.wT=f,y.yT=u,y.Xa=o,y.xw=a;const A=y.Fw,m=r.Wu;if(0===m){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.TT(h,r,this.Fw,n,a,s.A.Fw,e,o)}_T(){const t=this.Fw,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}Pv(){this.Xa|=0,this.xw|=0,this.Xa/=2,this.xw/=2,this.Xa|=0,this.xw|=0;const t=new Int8Array(this.Xa*this.xw);let i=0;for(let e=0;e>1)+(e+this.yT>>1)*this.Xa]=this.Fw[i++];this.Fw=t,this.width=this.Xa,this.height=this.xw,this.wT=0,this.yT=0}zw(){if(this.width===this.Xa&&this.height===this.xw)return;const t=new Int8Array(this.Xa*this.xw);let i=0;for(let e=0;e>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,n){try{const r=this.width;this.height;let h=0,o=0;const a=this.Xa,l=this.xw,c=(a<<16)/e|0,f=(l<<16)/n|0;t=t+(this.wT*e+a-1)/a|0,i=i+(this.yT*n+l-1)/l|0,this.wT*e%a!=0&&(h=(a-this.wT*e%a<<16)/e|0),this.yT*n%l!=0&&(o=(l-this.yT*n%l<<16)/n|0),e=e*(this.width-(h>>16))/a|0,n=n*(this.height-(o>>16))/l|0;let u,d=t+i*s.A.Bw,w=s.A.Bw-e;is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right&&(u=t+e-s.A.right,e-=u,w+=u),this.OT(s.A.Fw,this.Fw,this.palette,h,o,d,w,e,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}OT(t,i,e,s,n,r,h,o,a,l,c,f){try{const u=s;for(let d=-a;d<0;d++){const a=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+a];0==n?r++:t[r++]=e[255&n],s+=l}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(8950),n=e(1069),r=e(4474);class h{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}RT(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}ST(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=e(9298);class a extends r.A{static LT='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static xT=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let e=a.LT.indexOf(String.fromCharCode(i));t&&e>=63&&e--,-1===e&&(e=74),a.xT[i]=e}}kT=[];MT=new Int32Array(94);DT=new Int32Array(94);NT=new Int32Array(94);FT=new Int32Array(94);BT=new Int32Array(95);UT=new Int32Array(256);random=new h(BigInt(Date.now()));height=0;static cc=(t,i)=>{const e=new n.A(t.read(i+'.dat')),s=new n.A(t.read('index.dat'));s.Yf=e.Uu+4;const r=s.Wu;r>0&&(s.Yf+=3*(r-1));const h=new a;for(let t=0;t<94;t++){h.NT[t]=s.Wu,h.FT[t]=s.Wu;const i=h.MT[t]=s.Uu,n=h.DT[t]=s.Uu,r=s.Wu,o=i*n;if(h.kT[t]=new Int8Array(o),0===r)for(let s=0;sh.height&&(h.height=n),h.NT[t]=1,h.BT[t]=i+2;{let e=0;for(let s=n/7|0;s=s.A.bottom&&(r-=e+r+1-s.A.bottom),i=s.A.right){const t=i+n+1-s.A.right;n-=t,l+=t,a+=t}n>0&&r>0&&this.XT(n,r,t,c,l,s.A.Fw,o,a,h)}HT(t,i,e,n,r,h,o){e|=0,n|=0;let a=(t|=0)+(i|=0)*s.A.Bw,l=s.A.Bw-e,c=0,f=0;if(i=s.A.bottom&&(n-=i+n+1-s.A.bottom),t=s.A.right){const i=t+e+1-s.A.right;e-=i,c+=i,l+=i}e>0&&n>0&&this.jT(e,n,s.A.Fw,a,l,o,f,c,r,h)}XT(t,i,e,s,n,r,h,o,a){const l=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=l;t<0;t++)0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a;for(let i=t;i<0;i++)0===e[s++]?h++:r[h++]=a;h+=o,s+=n}}jT(t,i,e,s,n,r,h,o,a,l){t|=0;const c=((16711935&a)*l&4278255360)+((65280&a)*l&16711680)>>8,f=256-l;for(let a=-(i|=0);a<0;a++){for(let i=-t;i<0;i++)if(0===r[h++])s++;else{const t=e[s];e[s++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}s+=n,h+=o}}WT(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.qa:'cya'===t?o.A.nv:'mag'===t?o.A.xm:'whi'===t?o.A.La:'bla'===t?o.A.Za:'lre'===t?o.A.rv:'dre'===t?o.A.hv:'dbl'===t?o.A.ov:'or1'===t?o.A.av:'or2'===t?o.A.lv:'or3'===t?o.A.cv:'gr1'===t?o.A.fv:'gr2'===t?o.A.uv:'gr3'===t?o.A.dv:o.A.Za}split(t,i){if(0===t.length)return[t];const e=[];for(;t.length>0;){if(this.GT(t)<=i&&-1===t.indexOf('|')){e.push(t);break}let s=t.length;for(let e=0;ei)break;s=e}else if('|'===t[e]){s=e;break}e.push(t.substring(0,s)),t=t.substring(s+1)}return e}}},1183:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(8950),n=e(7854);class r{zT;width;height;ZT;qT;Fw;constructor(t,i,e=n.na){this.ZT=e,this.zT=this.ZT.getImageData(0,0,t,i),this.qT=new Uint32Array(this.zT.data.buffer),this.Fw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.Fw.fill(0)}bind(){s.A.bind(this.Fw,this.width,this.height)}draw(t,i){this.#t(),this.ZT.putImageData(this.zT,t,i)}#t(){const t=this.Fw.length,i=this.Fw,e=this.qT;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,i,e)=>{e.d(i,{A:()=>s});class s{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));zo=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Qo=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};JT=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}},2901:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(1908);class r{static JT=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.QT)return null;if(this.nO[t])return this.nO[t];const i=this.sO[t],e=i+this.eO[t];if(this.$T){const s=Uint8Array.from(this.buffer.subarray(i,i+e));return this.nO[t]=s,s}{const i=Uint8Array.from(n.A.read(this.iO[t],this.buffer,this.eO[t],this.sO[t]));return this.nO[t]=i,i}}}},1069:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(9234),n=e(6666),r=e(4474);class h extends r.A{static hO=3988292384;static oO=new Int32Array(256);static aO=new Uint32Array(33);static lO=new n.A;static cO=new n.A;static fO=new n.A;static uO=0;static dO=0;static wO=0;static{for(let t=0;t<32;t++)h.aO[t]=(1<>>=1:i=i>>>1^h.hO;h.oO[t]=i}}static Zo=t=>{let i=4294967295;for(let e=0;e>>8^h.oO[255&(i^t[e])];return~i};view;data;Yf=0;yO=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.Yf}static Ut=t=>{let i=null;return 0===t&&h.uO>0?(h.uO--,i=h.lO.lI()):1===t&&h.dO>0?(h.dO--,i=h.cO.lI()):2===t&&h.wO>0&&(h.wO--,i=h.fO.lI()),i?(i.Yf=0,i):new h(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.Yf=0,100===this.view.byteLength&&h.uO<1e3?(h.lO.rm(this),h.uO++):5e3===this.view.byteLength&&h.dO<250?(h.cO.rm(this),h.dO++):3e4===this.view.byteLength&&h.wO<50&&(h.fO.rm(this),h.wO++)}get Wu(){return this.view.getUint8(this.Yf++)}get Jd(){return this.view.getInt8(this.Yf++)}get Uu(){const t=this.view.getUint16(this.Yf);return this.Yf+=2,t}get Gu(){const t=this.view.getInt16(this.Yf);return this.Yf+=2,t}get yd(){const t=this.view.getUint8(this.Yf++)<<16|this.view.getUint16(this.Yf);return this.Yf+=2,t}get ia(){const t=this.view.getInt32(this.Yf);return this.Yf+=4,t}get EE(){const t=this.view.getBigInt64(this.Yf);return this.Yf+=8,t}get QE(){return this.view.getUint8(this.Yf)<128?this.Wu-64:this.Uu-49152}get Pm(){return this.view.getUint8(this.Yf)<128?this.Wu:this.Uu-32768}get Vu(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.Yf++))&&this.Yf>16),this.view.setUint16(this.Yf,t),this.Yf+=2}p4(t){this.view.setInt32(this.Yf,t),this.Yf+=4}gO(t){this.view.setInt32(this.Yf,t,!0),this.Yf+=4}IO(t){this.view.setBigInt64(this.Yf,t),this.Yf+=8}_O(t){const i=this.view,e=t.length;for(let s=0;s>>3}TO(t){let i=this.yO>>>3,e=8-(7&this.yO),s=0;for(this.yO+=t;t>e;e=8)s+=(this.view.getUint8(i++)&h.aO[e])<>>e-t&h.aO[t],s}OO(t,i){const e=this.Yf;this.Yf=0;const n=new Uint8Array(e);this.AO(e,0,n);const r=(0,s.RO)(n),h=(0,s.SO)(r,i,t),o=(0,s.LO)(h);this.Yf=0,this.p1(o.length),this.CO(o,o.length,0)}}},5226:(t,i,e)=>{e.d(i,{Q:()=>n,x:()=>s});class s{xO=new Map;Eo;xo=self.isSecureContext?self.crypto.randomUUID():'0';constructor(t){this.Eo=t}async Ko(){const t=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),i=t.createDataChannel('channel'),e=crypto.randomUUID();this.xO.set(e,i),await t.setLocalDescription(await t.createOffer()),t.onicegatheringstatechange=async()=>{if('complete'===t.iceGatheringState){let i;self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(t.localDescription)):console.log(JSON.stringify(t.localDescription));try{for(;null===(i=prompt('Offer copied to clipboard, paste answer here')););t.setRemoteDescription(new RTCSessionDescription(JSON.parse(i)))}catch(t){console.error(t)}}},i.onopen=()=>{i.send(JSON.stringify({type:'id',id:e})),console.log('Connected to peer!')},i.onerror=t=>{console.error(t)},i.onmessage=t=>{const i=JSON.parse(t.data);i.data&&(i.data=Object.values(i.data)),this.Eo&&this.Eo.postMessage(i)}}postMessage(t){const i=this.xO.get(t.data.id),e=t.data;e.data&&(e.data=Array.from(t.data.data)),i&&'open'===i.readyState&&i.send(JSON.stringify(e))}}class n{pc;Lo=void 0;xo;constructor(t){this.pc=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),this.pc.ondatachannel=i=>{this.Lo=i.channel,this.Lo.onopen=()=>{console.log('Connected to host!')},this.Lo.onerror=t=>{console.error(t)},this.Lo.onmessage=i=>{if(!this.xo){const t=JSON.parse(i.data);if('id'===t.type)return void(this.xo=t.id)}t.onmessage&&t.onmessage(i)}},this.pc.onicegatheringstatechange=async()=>{'complete'===this.pc.iceGatheringState&&(self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(this.pc.localDescription)):console.log(JSON.stringify(this.pc.localDescription)))}}async Xo(t){await this.pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(t))),await this.pc.setLocalDescription(await this.pc.createAnswer())}}},3937:(t,i,e)=>{e.d(i,{A:()=>o});class s{start=0;end=0;form=0;length=0;kO=null;MO=null;threshold=0;position=0;delta=0;amplitude=0;DO=0;read(t){this.form=t.Wu,this.start=t.ia,this.end=t.ia,this.length=t.Wu,this.kO=new Int32Array(this.length),this.MO=new Int32Array(this.length);for(let i=0;i=this.threshold&&this.MO&&this.kO&&(this.amplitude=this.MO[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this.kO[this.position]/65536*t|0,this.threshold>this.DO&&(this.delta=((this.MO[this.position]<<15)-this.amplitude)/(this.threshold-this.DO)|0)),this.amplitude+=this.delta,this.DO++,this.amplitude-this.delta>>15}}class n{static buffer=null;static sm=null;static sin=null;static NO=new Int32Array(5);static FO=new Int32Array(5);static BO=new Int32Array(5);static UO=new Int32Array(5);static PO=new Int32Array(5);WO=null;GO=null;YO=null;HO=null;VO=null;KO=null;release=null;attack=null;XO=new Int32Array(5);jO=new Int32Array(5);zO=new Int32Array(5);start=0;length=500;ZO=100;qO=0;static init=()=>{this.sm=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.sm[t]=1:this.sm[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};JO(t,i){for(let i=0;i>1,h+=(i*s>>16)+r}if(this.VO&&this.KO){const i=this.VO.evaluate(t),e=this.KO.evaluate(t);c=c*(32768+(this.$O(e,l,this.VO.form)>>1))>>15,l+=(i*o>>16)+a}for(let s=0;s<5;s++)if(0!==this.XO[s]){const r=i+n.FO[s];r>15,n.NO[s],this.WO.form),n.NO[s]+=(e*n.UO[s]>>16)+n.PO[s])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,e=!0;for(let s=0;s>8):this.release.start+((this.release.end-this.release.start)*h>>8),i+=256,i>=o&&(i=0,e=!e),e&&(n.buffer[s]=0)}}if(this.qO>0&&this.ZO>0){const i=this.qO*e;for(let e=i;e32767&&(n.buffer[i]=32767);return n.buffer}$O(t,i,e){return 1===e?(32767&i)<16384?t:-t:2===e?n.sin[32767&i]*t>>14:3===e?((32767&i)*t>>14)-t:4===e?n.sm[i/2607&32767]*t:0}read(t){this.WO=new s,this.WO.read(t),this.GO=new s,this.GO.read(t),0!==t.Wu&&(t.Yf--,this.YO=new s,this.YO.read(t),this.HO=new s,this.HO.read(t)),0!==t.Wu&&(t.Yf--,this.VO=new s,this.VO.read(t),this.KO=new s,this.KO.read(t)),0!==t.Wu&&(t.Yf--,this.release=new s,this.release.read(t),this.attack=new s,this.attack.read(t));for(let i=0;i<10;i++){const e=t.Pm;if(0===e)break;this.XO[i]=e,this.jO[i]=t.QE,this.zO[i]=t.Pm}this.qO=t.Pm,this.ZO=t.Pm,this.length=t.Uu,this.start=t.Uu}}var r=e(1069),h=e(3867);class o{static QO=new Int32Array(1e3);static tR=null;static iR=null;static eR=new h.fe(1e3,null);sR=new h.fe(10,null);nR=0;loopEnd=0;static wc=t=>{const i=new r.A(t.read('sounds.dat'));for(this.tR=new Uint8Array(441e3),this.iR=new r.A(this.tR),n.init();;){const t=i.Uu;if(65535===t)break;const e=new o;e.read(i),this.eR[t]=e,this.QO[t]=e.trim()}};static JO=(t,i)=>{if(!this.eR[t])return null;const e=this.eR[t];return e?.rR(i)??null};read(t){for(let i=0;i<10;i++)0!==t.Wu&&(t.Yf--,this.sR[i]=new n,this.sR[i]?.read(t));this.nR=t.Uu,this.loopEnd=t.Uu}trim(){let t=9999999;for(let i=0;i<10;i++)this.sR[i]&&(this.sR[i].start/20|0)i&&(i=this.sR[t].length+this.sR[t].start);if(0===i)return 0;let e=22050*i/1e3|0,s=22050*this.nR/1e3|0,n=22050*this.loopEnd/1e3|0;(s<0||n<0||n>e||s>=n)&&(t=0);let r=e+(n-s)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){s+=44,n+=44,e+=44,r+=44;const i=r-e;for(let t=e-1;t>=n;t--)o.tR&&(o.tR[t+i]=o.tR[t]);for(let i=1;i{e.d(i,{bm:()=>l,vm:()=>o,fe:()=>s,jm:()=>n,Eh:()=>r,Hm:()=>h,Xr:()=>a});class s extends Array{constructor(t,i){super(t);for(let e=0;e{e.d(i,{LO:()=>o,Jo:()=>n,RO:()=>h,$o:()=>s,ec:()=>r,SO:()=>a});const s=async t=>new Promise((i=>setTimeout(i,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),r=async t=>(await fetch(t)).text();function h(t){let i=0n;for(let e=0;e0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function a(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}},7953:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static hR=new Uint16Array(['d','o','t'].join('').split('').map((t=>t.charCodeAt(0))));static oR=new Uint16Array(['(','a',')'].join('').split('').map((t=>t.charCodeAt(0))));static aR=new Uint16Array(['s','l','a','s','h'].join('').split('').map((t=>t.charCodeAt(0))));static lR=['cook',"cook's",'cooks','seeks','sheet'];static cR=[];static fR=[];static uR=[];static dR=[];static wR=[];static yR=[];static wc=t=>{const i=new s.A(t.read('fragmentsenc.txt')),e=new s.A(t.read('badenc.txt')),n=new s.A(t.read('domainenc.txt')),r=new s.A(t.read('tldlist.txt'));this.read(e,n,i,r)};static filter=t=>{const i=[...t];this.format(i);const e=i.join('').trim(),s=e.toLowerCase(),n=[...s];this.AR(n),this.mR(n),this.pR(n),this.gR(n);for(let t=0;t{this.CR(t),this.ER(i),this.vR(e),this.bR(s)};static bR=t=>{const i=t.ia;for(let e=0;et.Wu))};static CR=t=>{const i=t.ia;for(let e=0;et.Wu));const i=new Array(t.Wu).fill([]).map((()=>[t.Jd,t.Jd]));i.length>0&&(this.dR[e]=i)}};static ER=t=>{const i=t.ia;for(let e=0;et.Wu))};static vR=t=>{const i=t.ia;for(let e=0;e{const i=[...t],e=[...t];this.TR(null,i,this.hR),this.TR(null,e,this.aR);for(let s=0;s{for(let i=0;i<2;i++)for(let i=this.uR.length-1;i>=0;i--)this.TR(this.dR[i],t,this.uR[i])};static pR=t=>{const i=[...t],e=[...t];this.TR(null,i,this.oR),this.TR(null,e,this.hR);for(let s=this.wR.length-1;s>=0;s--)this.RR(e,i,this.wR[s],t)};static gR=t=>{for(let i=0;i=0&&n{if(this.NR(t))return!0;const i=this.FR(t),e=this.yR,s=e.length;if(i===e[0]||i===e[s-1])return!0;let n=0,r=s-1;for(;n<=r;){const t=(n+r)/2|0;if(i===e[t])return!0;i{if(t.length>6)return 0;let i=0;for(let e=0;e{for(let e=i;e=0;e++)if(this.UR(t[e]))return e;return-1};static MR=(t,i)=>{for(let e=t;e=0;e++)if(!this.UR(i[e]))return e;return i.length};static PR=(t,i,e)=>i===e||'o'===i&&'0'===e?1:'o'===i&&'('===e&&')'===t?2:'c'!==i||'('!==e&&'<'!==e&&'['!==e?'e'===i&&'€'===e||'s'===i&&'$'===e||'l'===i&&'i'===e?1:0:1;static RR=(t,i,e,s)=>{const n=e.length,r=s.length;for(let h=0;h<=r-n;h++){const{WR:n,GR:r}=this.YR(h,e,s);if(!n)continue;const o=this.HR(h,s,3,i,['@']),a=this.VR(r-1,s,3,t,['.',',']);(o>2||a>2)&&this.kR(h,r,s)}};static YR=(t,i,e)=>{const s=i.length;let n=t,r=0;for(;n0)n+=a,r++;else{if(0===r)break;const e=this.PR(o,String.fromCharCode(i[r-1]),h);if(e>0)n+=e,1===r&&t++;else{if(r>=s||!this.LR(h))break;n++}}}return{WR:r>=s,GR:n}};static TR=(t,i,e)=>{if(!(e.length>i.length))for(let s=0;s<=i.length-e.length;s++){let n=s;const{GR:r,KR:h,XR:o,jR:a,zR:l}=this.ZR(i,e,n);n=r;let c=i[n],f=n+1=e.length)||a&&l)continue;let u,d=!0;if(o){let t=!1,e=!1;if((s-1<0||this.LR(i[s-1])&&"'"!==i[s-1])&&(t=!0),(n>=i.length||this.LR(i[n])&&"'"!==i[n])&&(e=!0),!t||!e){let e=!1;for(u=s-2,t&&(u=s);!e&&u=0&&(!this.LR(i[u])||"'"===i[u])){const t=[];let s;for(s=0;s<3&&u+s=0&&(!this.LR(i[u-1])||"'"===i[u-1])&&(n=!1),n&&!this.DR(t)&&(e=!0)}u++}e||(d=!1)}}else{c=' ',s-1>=0&&(c=i[s-1]),f=' ',n{let s=e,n=0,r=0,h=!1,o=!1,a=!1;for(;s=t.length||o&&a);){const l=t[s],c=s+10)1===f&&this.UR(l)&&(o=!0),2===f&&(this.UR(l)||this.UR(c))&&(o=!0),s+=f,n++;else{if(0===n)break;let t;if((t=this.QR(c,String.fromCharCode(i[n-1]),l))>0)s+=t;else{if(n>=i.length||!this.xR(l))break;if(this.LR(l)&&"'"!==l&&(h=!0),this.UR(l)&&(a=!0),s++,r++,(100*r/(s-e)|0)>90)break}}}return{GR:s,KR:n,XR:h,jR:o,zR:a}};static QR=(t,i,e)=>{if(i===e)return 1;if(i>='a'&&i<='m'){if('a'===i)return'4'!==e&&'@'!==e&&'^'!==e?'/'===e&&'\\'===t?2:0:1;if('b'===i)return'6'!==e&&'8'!==e?'1'===e&&'3'===t?2:0:1;if('c'===i)return'('!==e&&'<'!==e&&'{'!==e&&'['!==e?0:1;if('d'===i)return'['===e&&')'===t?2:0;if('e'===i)return'3'!==e&&'€'!==e?0:1;if('f'===i)return'p'===e&&'h'===t?2:'£'===e?1:0;if('g'===i)return'9'!==e&&'6'!==e?0:1;if('h'===i)return'#'===e?1:0;if('i'===i)return'y'!==e&&'l'!==e&&'j'!==e&&'1'!==e&&'!'!==e&&':'!==e&&';'!==e&&'|'!==e?0:1;if('j'===i)return 0;if('k'===i)return 0;if('l'===i)return'1'!==e&&'|'!==e&&'i'!==e?0:1;if('m'===i)return 0}if(i>='n'&&i<='z'){if('n'===i)return 0;if('o'===i)return'0'!==e&&'*'!==e?'('===e&&')'===t||'['===e&&']'===t||'{'===e&&'}'===t||'<'===e&&'>'===t?2:0:1;if('p'===i)return 0;if('q'===i)return 0;if('r'===i)return 0;if('s'===i)return'5'!==e&&'z'!==e&&'$'!==e&&'2'!==e?0:1;if('t'===i)return'7'!==e&&'+'!==e?0:1;if('u'===i)return'v'===e?1:'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('v'===i)return'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('w'===i)return'v'===e&&'v'===t?2:0;if('x'===i)return')'===e&&'('===t||'}'===e&&'{'===t||']'===e&&'['===t||'>'===e&&'<'===t?2:0;if('y'===i)return 0;if('z'===i)return 0}return i>='0'&&i<='9'?'0'===i?'o'===e||'O'===e?1:'('===e&&')'===t||'{'===e&&'}'===t||'['===e&&']'===t?2:0:'1'===i&&'l'===e?1:0:','===i?'.'===e?1:0:'.'===i?','===e?1:0:'!'===i&&'i'===e?1:0};static JR=(t,i,e)=>{let s=0,n=i.length-1;for(;s<=n;){const r=(s+n)/2|0;if(i[r][0]===t&&i[r][1]===e)return!0;tthis.BR(t)?t.charCodeAt(0)+1-'a'.charCodeAt(0):"'"===t?28:this.UR(t)?t.charCodeAt(0)+29-'0'.charCodeAt(0):27;static OR=(t,i,e,s,n)=>{if(!(s.length>e.length))for(let r=0;r<=e.length-s.length;r++){const{GR:h,tS:o}=this.iS(e,s,r);if(o0&&c>0&&(a=!0),2===i&&(l>2&&c>0||l>0&&c>2)&&(a=!0),3===i&&l>0&&c>2&&(a=!0),!a)continue;let f,u=r,d=h-1,w=!1;if(l>2){if(4===l)for(w=!1,f=r-1;f>=0;f--)if(w){if('*'!==n[f])break;u=f}else'*'===n[f]&&(u=f,w=!0);for(w=!1,f=u-1;f>=0;f--)if(w){if(this.LR(e[f]))break;u=f}else this.LR(e[f])||(w=!0,u=f)}if(c>2){if(4===c)for(w=!1,f=d+1;f{let s=0;for(;e0)e+=h,s++;else{if(0===s)break;let t;if((t=this.PR(r,String.fromCharCode(i[s-1]),n))>0)e+=t;else{if(!this.LR(n))break;e++}}}return{GR:e,tS:s}};static LR=t=>!this.$R(t)&&!this.UR(t);static xR=t=>!this.BR(t)||('v'===t||'x'===t||'j'===t||'q'===t||'z'===t);static $R=t=>this.BR(t)||this.eS(t);static UR=t=>t>='0'&&t<='9';static BR=t=>t>='a'&&t<='z';static eS=t=>t>='A'&&t<='Z';static NR=t=>{for(let i=0;i{for(let s=t;s{let e=0;for(let s=i-1;s>=0&&this.LR(t[s]);s--)'*'===t[s]&&e++;return e};static nS=(t,i)=>{let e=0;for(let s=i+1;s(n?this.sS(i,e):this.nS(i,e))>=s?4:this.LR(n?t[e-1]:t[e+1])?1:0;static HR=(t,i,e,s,n)=>{if(0===t)return 2;for(let e=t-1;e>=0&&this.LR(i[e]);e--)if(n.includes(i[e]))return 3;return this.rS(i,s,t,e,!0)};static VR=(t,i,e,s,n)=>{if(t+1===i.length)return 2;for(let e=t+1;e{let i=0;for(let e=0;et>=' '&&t<=''||' '===t||'\n'===t||'\t'===t||'£'===t||'€'===t;static IR=(t,i)=>{for(let e=0;e{let i=!0;for(let e=0;e{e.d(i,{A:()=>n});var s=e(9763);class n{static oS=null;static load=async t=>{this.oS=await(0,s.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,e,s)=>{if(!this.oS)throw new Error('bz2 not found!!');return Int8Array.from(this.oS.read(t,i,e,s))}}},123:(t,i,e)=>{function s(t,i,e){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256,e)}function n(t){window._tinyMidiStop&&window._tinyMidiStop(t)}e.d(i,{ea:()=>s,ko:()=>n})},2604:(t,i,e)=>{function s(t,i){var e;(e=document.createElement('a')).href=t,e.download=i,document.body.appendChild(e),e.style='display: none',e.click(),e.remove()}e.d(i,{A:()=>s})},9763:(t,i,e)=>{async function s(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,a=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,a,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(a),a}(a,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(l,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function a(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function l(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}e.d(i,{F:()=>s})},9896:(t,i,e)=>{var s=e(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{const t=2,i=44100;let e=new Float32Array,n=window.audioContext.createGain();n.gain.value=.1,n.connect(window.audioContext.destination);let r=window.audioContext.currentTime,h=[];const o=new s.A({aS:30,lS:t=>{let i=new Float32Array(t.buffer),s=new Float32Array(e.length+i.length);s.set(e,0),s.set(i,e.length),e=s},cS:t=>{},bufferSize:102400});await o.init();const a=await fetch('./SCC1_Florestan.sf2'),l=new Uint8Array(await a.arrayBuffer());function c(){if(!window.audioContext||!e.length)return;let s=window.audioContext.createBufferSource();const o=e.length/t,a=window.audioContext.createBuffer(t,o,i);for(let i=0;i{t.stop(window.audioContext.currentTime)})),h=[],n.gain.value=t}}function d(t,i){-1!==t&&window._tinyMidiVolume(t),r=window.audioContext.currentTime,f=setInterval(c,250),o.fS(i)}o.uS(l),window._tinyMidiStop=async t=>{t?function(t,i){const e=window.audioContext.currentTime;n.gain.cancelScheduledValues(e),n.gain.setValueAtTime(n.gain.value,e),n.gain.linearRampToValueAtTime(t,e+2),setTimeout(i,2e3)}(0,(()=>{u()})):u()},window._tinyMidiVolume=(t=1)=>{n.gain.value=t},window._tinyMidiPlay=async(t,i,e)=>{t&&(await window._tinyMidiStop(e),e?setTimeout((()=>{d(i,t)}),2e3):d(i,t))}})()},8151:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5473);const n=class{constructor(t={}){this.dS=void 0,this.wS=0,this.yS=0,this.AS=0,this.aS=t.aS||100,this.sampleRate=t.sampleRate||44100,this.mS=t.mS||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.pS(1),this.lS=t.lS||(()=>{}),this.cS=t.cS||(()=>{}),this.gS=void 0,this.test=0}async init(){if(!this.dS){if('undefined'!=typeof process){const{IS:t}=await import('path'),{_S:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.dS=await(0,s.A)(),this.CS=this.dS._malloc(this.bufferSize),this.ES=this.dS._malloc(8)}}pS(t){this.bufferSize=4*this.sampleRate*this.mS*t}vS(){if(!this.dS)throw new Error(`${this.constructor.name} not initalized. call .init()`)}uS(t){this.vS();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.dS;e(this.wS),this.wS=i(t.length),this.dS.HEAPU8.set(t,this.wS),this.yS=s(this.wS,t.length),n(this.yS,2===this.mS?0:2,this.sampleRate,this.gain)}bS(){this.vS();const t=new Uint8Array(this.bufferSize);return t.set(this.dS.HEAPU8.subarray(this.CS,this.CS+this.bufferSize)),t}TS(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.dS;return e(this.AS),this.AS=i(t.length),this.dS.HEAPU8.set(t,this.AS),s(this.AS,t.length)}OS(t){const{_midi_render:i}=this.dS;return i(this.yS,t,this.mS,this.sampleRate,this.CS,this.bufferSize,this.ES)}fS(t){if(this.vS(),!this.yS)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.gS);const{setValue:i,getValue:e}=this.dS;i(this.ES,0,'double'),this.dS._tsf_reset(this.yS),this.dS._tsf_channel_set_bank_preset(this.yS,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.TS(t);const n=()=>{s=this.OS(s);const t=this.bS();this.lS(t),s?this.gS=setTimeout(n,this.aS):this.cS(e(this.ES,'double'))};this.gS=setTimeout(n,16)}}},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,e)=>{var s;e.d(i,{A:()=>n});const n=(s="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,n,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,e){i=t,n=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(r.ready,t)||Object.defineProperty(r.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var h=Object.assign({},r),o=[],a='object'==typeof window,l='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!a&&!c&&!l;if(r.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var A,m;y=l?require('path').IS(y)+'/':__dirname+'/';var p=()=>{m||(A=require('fs'),m=require('path'))};u=(t,i)=>(p(),t=m.normalize(t),A.RS(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,e)=>{p(),t=m.normalize(t),A.SS(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),r.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,e){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!a&&!l)throw new Error('environment detection error');if(l?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),s&&(y=s),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},l&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}r.print||console.log.bind(console);var g,I,_=r.printErr||console.warn.bind(console);function C(t,i){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(r,h),h=null,g='fetchSettings',Object.getOwnPropertyDescriptor(r,g)&&j('`Module.'+g+'` was supplied but `'+g+'` not included in INCOMING_MODULE_JS_API'),r.arguments&&(o=r.arguments),C('arguments','arguments_'),r.thisProgram&&r.thisProgram,C('thisProgram','thisProgram'),r.quit&&r.quit,C('quit','quit_'),D(void 0===r.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===r.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===r.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===r.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===r.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),r.wasmBinary&&(I=r.wasmBinary),C('wasmBinary','wasmBinary');var v;r.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,O,R,S,L,x,k,M=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function N(t){b=t,r.HEAP8=T=new Int8Array(t),r.HEAP16=R=new Int16Array(t),r.HEAP32=S=new Int32Array(t),r.HEAPU8=O=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=L=new Uint32Array(t),r.HEAPF32=x=new Float32Array(t),r.HEAPF64=k=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var F=5242880;r.TOTAL_STACK&&D(F===r.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=r.INITIAL_MEMORY||16777216;function U(){if(!M){var t=ft(),i=L[t>>2],e=L[t+4>>2];34821223==i&&2310721022==e||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==L[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=F,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+F+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!r.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var P=[],W=[],G=[],Y=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var H=0,V=null,K=null,X={};function j(t){r.onAbort&&r.onAbort(t),_(t='Aborted('+t+')'),M=!0;var i=new WebAssembly.RuntimeError(t);throw n(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},LS:function(){z.error()},xS:function(){z.error()},kS:function(){z.error()},open:function(){z.error()},MS:function(){z.error()},DS:function(){z.error()},NS:function(){z.error()},BS:function(){z.error()},US:function(){z.error()}};r.FS_createDataFile=z.LS,r.FS_createPreloadedFile=z.xS;var Z,q,J,$,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=r.asm),D(Y,'native function `'+e+'` called before runtime initialization'),s[t]||D(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==Z&&I)return new Uint8Array(I);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(r)}function ht(t){ht.PS||(ht.PS={}),ht.PS[t]||(ht.PS[t]=1,c&&(t='warning: '+t),_(t))}function ot(t){try{return v.grow(t-b.byteLength+65535>>>16),N(v.buffer),1}catch(i){_('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}r.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=r.locateFile?r.locateFile(q,y):y+q):Z=new URL(e(8227),e.b).toString();var at,lt={"emscripten_memcpy_big":function(t,i,e){O.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=O.length;D((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return _('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return _('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':lt,'wasi_snapshot_preview1':lt};function e(t,i){var e,s=t.exports;r.asm=s,D(v=r.asm.memory,"memory not found in wasm exports"),N(v.buffer),D(r.asm.__indirect_function_table,"table not found in wasm exports"),e=r.asm.__wasm_call_ctors,W.unshift(e),function(t){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(X[t]),delete X[t]):_('warning: run dependency removed without ID'),0==H&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',H++,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(M)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,_('still waiting on run dependencies:')),_('dependency: '+i);t&&_('(end of list)')}),1e4))):_('warning: run dependency added without ID');var s=r;function h(t){D(r===s,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),s=null,e(t.instance)}function o(t){return function(){if(!I&&(a||l)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return st(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){_('failed to asynchronously prepare wasm: '+t),it(Z)&&_('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(r.instantiateWasm)try{return r.instantiateWasm(i,e)}catch(t){_('Module.instantiateWasm callback failed with error: '+t),n(t)}(I||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(h):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return _('wasm streaming compile failed: '+t),_('falling back to ArrayBuffer instantiation'),o(h)}))}))).catch(n)}(),r.___wasm_call_ctors=et("__wasm_call_ctors"),r._malloc=et("malloc"),r._free=et("free"),r._tsf_load_memory=et("tsf_load_memory"),r._tsf_close=et("tsf_close"),r._tsf_reset=et("tsf_reset"),r._tsf_set_output=et("tsf_set_output"),r._tsf_set_max_voices=et("tsf_set_max_voices"),r._realloc=et("realloc"),r._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),r._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),r._tml_load_memory=et("tml_load_memory"),r._midi_render=et("midi_render"),r.___errno_location=et("__errno_location"),r._fflush=et("fflush"),r._emscripten_stack_init=function(){return(ct=r._emscripten_stack_init=r.asm.emscripten_stack_init).apply(null,arguments)}),ft=(r._emscripten_stack_get_free=function(){return(r._emscripten_stack_get_free=r.asm.emscripten_stack_get_free).apply(null,arguments)},r._emscripten_stack_get_base=function(){return(r._emscripten_stack_get_base=r.asm.emscripten_stack_get_base).apply(null,arguments)},r._emscripten_stack_get_end=function(){return(ft=r._emscripten_stack_get_end=r.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),L[t>>2]=34821223,L[t+4>>2]=2310721022,L[0]=1668509029}function dt(t){function e(){at||(at=!0,r.calledRun=!0,M||(D(!Y),Y=!0,U(),rt(W),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),D(!r._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),G.unshift(t);var t;rt(G)}()))}t=t||o,H>0||(ut(),function(){if(r.preRun)for('function'==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),P.unshift(t);var t;rt(P)}(),H>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),e()}),1)):e(),U()))}if(r.stackSave=et("stackSave"),r.stackRestore=et("stackRestore"),r.stackAlloc=et("stackAlloc"),r.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':T[0|t]=i;break;case'i16':R[t>>1]=i;break;case'i32':S[t>>2]=i;break;case'i64':$=[i>>>0,(J=i,+Math.abs(J)>=1?J>0?(0|Math.min(+Math.floor(J/4294967296),4294967295))>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],S[t>>2]=$[0],S[t+4>>2]=$[1];break;case'float':x[t>>2]=i;break;case'double':k[t>>3]=i;break;case'*':L[t>>2]=i;break;default:j('invalid type for setValue: '+e)}},r.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return T[0|t];case'i16':return R[t>>1];case'i32':case'i64':return S[t>>2];case'float':return x[t>>2];case'double':return k[t>>3];case'*':return L[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),K=function t(){at||dt(),at||(K=t)},r.preInit)for('function'==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return dt(),t.ready})}},r={};function h(t){var i=r[t];if(void 0!==i)return i.exports;var e=r[t]={exports:{}};return n[t](e,e.exports,h),e.exports}h.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",e="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",s=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},h.a=(n,r,h)=>{var o;h&&((o=[]).d=-1);var a,l,c,f=new Set,u=n.exports,d=new Promise(((t,i)=>{c=i,l=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,r((n=>{var r;a=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var r=[];r.d=0,n.then((t=>{h[i]=t,s(r)}),(t=>{h[e]=t,s(r)}));var h={};return h[t]=t=>t(r),h}}var o={};return o[t]=t=>{},o[i]=n,o})))(n);var h=()=>a.map((t=>{if(t[e])throw t[e];return t[i]})),l=new Promise((i=>{(r=()=>i(h)).r=0;var e=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(r.r++,t.push(r)));a.map((i=>i[t](e)))}));return r.r?l:h()}),(t=>(t?c(d[e]=t):l(u),s(o)))),o&&o.d<0&&(o.d=0)},h.d=(t,i)=>{for(var e in i)h.o(i,e)&&!h.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},h.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),h.p="/Client2/",h.b=document.baseURI||self.location.href;h(1375)})(); \ No newline at end of file +(()=>{"use strict";var t,i,e,s,n={1651:(t,i,e)=>{e.d(i,{K:()=>D});var s=e(1120),n=e(4583),r=e(2901),h=e(1069),o=e(7046),a=(e(9896),e(6666)),l=e(3045),c=e(818),f=e(670),u=e(8268),d=e(3867),w=e(7854),y=e(8950),A=e(1302),m=e(9298),p=e(8665),g=e(1312),I=e(3819),_=e(8317),C=e(9234),E=e(1908),v=e(123),b=e(5637),T=e(6948),O=e(2164),R=e(8738),S=e(3764),L=e(8534),x=e(6730),k=e(2604),M=e(5226);class D extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static et=!1;static st='';static nt='';static rt=!1;static ht=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static gt=0;static It=0;static _t=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Ot=0;static Rt=()=>{l.A.et=!1,n.A.et=!1,D.et=!1,c.A.et=!1};static St=()=>{l.A.et=!0,n.A.et=!0,D.et=!0,c.A.et=!0};Lt=2048;xt=2047;kt=!1;Mt=!1;Dt=!1;Nt=!1;db=null;Ft=0;Bt=[];stream=null;in=h.A.Ut(1);Pt=h.A.Ut(1);Wt=h.A.Ut(1);Gt=0n;Yt=0;Ht=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;Jt=!0;$t=0;Qt=0;ti=null;ii=null;ei=null;si=null;ni=null;ri=null;hi=null;oi=null;ai=null;li=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;Ai=null;mi=[];pi=!1;gi=null;Ii=null;_i=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Oi=null;Ri=null;Si=new Int32Array(256);Li=0;xi=0;ki=0;Mi=null;Di=null;Ni=null;Fi=null;Bi=null;Ui=null;Pi=null;Wi=null;Gi=null;Yi=null;Hi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;Ji=null;$i=null;Qi=null;te=new Int32Array(33);ie=new Int32Array(33);ee=new Int32Array(151);se=new Int32Array(151);ne=null;re=null;he=null;oe=null;ae=null;le=null;ce=new d.fe(13,null);ue=null;de=null;we=new d.fe(50,null);ye=new d.fe(50,null);Ae=new d.fe(20,null);me=new d.fe(20,null);pe=null;ge=new d.fe(8,null);Ie=null;_e=null;Ce=null;Ee=null;ve=null;be=null;Te=null;Oe=null;Re=null;Se=null;Le=null;xe=null;ke=null;Me=null;De=null;Ne=null;Fe=null;Be=null;Ue=new d.fe(1e3,null);Pe=!1;We=!1;Ge=!1;Ye=!1;He=-1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=!1;Je=0;$e=0;Qe=0;ts=0;es=0;ss=0;ns=[];rs=-1;hs=-1;os=new s.A;ls=78;cs=0;fs=0;us=[];ds=0;ws=0;ys=0;As=0;ps=0;gs=0;Is=0;_s=0;Cs=[];Es=[];vs=[];bs=[];Ts=null;Os=-1;Rs=3;Ss=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Ls=0;xs=0;ks=0;Ms=!1;Ds=0;Ns=!1;Fs='';Bs='';Us=0;Ps='';Ws=!1;Gs=-1;Ys=new d.fe(100,null);Hs=new d.fe(100,null);messageType=new Int32Array(100);Vs=new Int32Array(100);Ks=0;Xs=0;js=0;zs='';Zs=0;qs=0;Js=0;$s=0;Qs=0;tn=0;en=0;sn=0;nn=0;rn=!1;hn=0;an=0;ln=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;An=!1;mn=[];pn=[];gn=0;In=0;_n=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);On=new Int32Array(500);Rn=0;Sn=0;Ln=0;xn='';kn=!1;Mn=-1;Dn=0;Nn=0;Fn=0;Bn=0;Un=0;Pn=new Int32Array(1e3);Wn=new Int32Array(1e3);Gn=null;Yn=0;Hn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;Jn=0;$n=2;Qn=2;tr=1;ir=new Int32Array(5);er=new d.fe(5,!1);sr=new Int32Array(5);nr=new Int32Array(5);rr=new Int32Array(5);hr=0;ar=0;lr=0;cr=0;ur=0;dr=0;wr=0;yr=0;Ar=0;mr=1;pr=2;gr=-1;Ir=0;_r=0;Cr=0;Er=0;vr=0;br=0;Tr=null;Or=null;Rr=null;Sr=0;Lr=0;kr=new Int8Array(16384);Mr=new d.fe(f.A.Dr,null);Nr=0;Fr=0;Br=128;Ur=0;Pr=0;Wr=0;Gr=0;Yr=0;Hr=null;Vr=null;Kr=new d.Xr(f.A.jr,f.A.jr);zr=0;Zr=0;qr=0;Jr=0;$r=0;Qr=0;th=0;ih=0;eh=0;sh=0;nh=0;rh=0;hh=new d.fe(this.Lt,null);oh=0;ah=new Int32Array(this.Lt);lh=0;fh=0;uh=new Int32Array(this.Lt);dh=new Int32Array(1e3);wh=new d.fe(this.Lt,null);yh=new d.fe(8192,null);Ah=0;mh=new Int32Array(8192);ph=new a.A;gh=new a.A;Ih=new a.A;_h=new a.A;Ch=new d.Eh(f.A.Dr,f.A.jr,f.A.jr,null);bh=new a.A;Th=new Int32Array(4e3);Oh=new Int32Array(4e3);Rh=new Int32Array(f.A.jr*f.A.jr);Sh=new Int32Array(f.A.jr*f.A.jr);Lh=0;xh=null;kh=0;Mh=0;Dh=-1;Nh=0;Fh=0;Bh=0;Uh=0;Ph=!1;Wh=!0;Gh=!1;Yh=new Int32Array(7);Hh=new Int32Array(5);Vh=0;Kh=0;static Xh=50;jh=new Int32Array(D.Xh);zh=new Int32Array(D.Xh);Zh=new Int32Array(D.Xh);qh=new Int32Array(D.Xh);Jh=new Int32Array(D.Xh);$h=new Int32Array(D.Xh);Qh=new Int32Array(D.Xh);io=new d.fe(D.Xh,null);eo=new d.fe(100,null);so=new BigInt64Array(100);no=new Int32Array(100);ro=null;ho=0;oo=!0;ao=new Int32Array(50);lo=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;Ao=0;mo=!0;po=null;Io=0;_o=0;Co=192;Eo=void 0;vo=!1;host=null;bo=null;To=new d.fe(16,null);Oo=0;Ro=!1;So=()=>{try{this.stream&&this.stream.close()}catch(t){}this.bo&&'998'===D.getParameter('world')&&this.bo.Lo?.send(JSON.stringify({type:'close',id:this.bo.xo})),this.stream=null,(0,v.ko)(!1),this.Pt=null,this.Wt=null,this.in=null,this.Rr=null,this.Tr=null,this.Or=null,this.Hr=null,this.Vr=null,this.Gn=null,this.Mr=null,this.Rh=null,this.Sh=null,this.Th=null,this.Oh=null,this.kr=null,this.Di=null,this.Ni=null,this.Fi=null,this.Bi=null,this.Ui=null,this.Pi=null,this.Wi=null,this.Gi=null,this.Yi=null,this.Hi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.ne=null,this.he=null,this.re=null,this.oe=null,this.ae=null,this.le=null,this.ce=null,this.Te=null,this.Oe=null,this.Re=null,this.Se=null,this.Le=null,this.xe=null,this.ke=null,this.Me=null,this.De=null,this.Ne=null,this.de=null,this.Ae=null,this.me=null,this.ge=null,this.Ie=null,this._e=null,this.Ce=null,this.Ee=null,this.we=null,this.ye=null,this.Kr=null,this.hh=null,this.ah=null,this.uh=null,this.wh=null,this.dh=null,this.yh=null,this.mh=null,this.Ch=null,this.bh=null,this._h=null,this.ph=null,this.gh=null,this.Ih=null,this.Tn=null,this.On=null,this.vn=null,this.bn=null,this.ns=null,this.mn=null,this.Pn=null,this.Wn=null,this.Ue=null,this.ue=null,this.eo=null,this.so=null,this.no=null,this.si=null,this.ni=null,this.ti=null,this.ii=null,this.ei=null,this.ri=null,this.hi=null,this.oi=null,this.ai=null,this.Mo(),b.A.So(),T.A.So(),A.A.So(),O.A.Do=null,_.A.Do=null,s.A.Do=null,g.A.Do=null,R.A.Do=null,R.A.No=null,S.A.Do=null,this.Fo=null,u.A.No=null,n.A.So(),l.A.So(),p.A.So(),L.A.Do=[],x.A.Do=[]};Bo(){return this.$t}Uo(){return this.Ws}Po(){return this.Ns}Wo(){return this.hs}Go(){return this.He}Mo=()=>{this.pi=!1,this.Mi&&(clearInterval(this.Mi),this.Mi=null),this.li=null,this.ci=null,this.mi=[],this.bi=null,this.Ti=null,this.Oi=null,this.Ri=null,this.Ci=null,this._i=null,this.Ei=null,this.vi=null,this.gi=null,this.Ii=null};Yo=()=>{'999'===D.getParameter('world')?(this.Eo=new Worker('worker.js',{type:'module'}),this.Eo.onmessage=this.onmessage,this.host=new M.x(this.Eo)):'998'===D.getParameter('world')&&(this.Eo={onmessage:t=>{this.stream.Ho.onmessage(t)},postMessage:t=>{this.bo&&this.bo.Lo&&'open'===this.bo.Lo.readyState&&this.bo.Lo.send(JSON.stringify(t))},onerror:null,onmessageerror:null,terminate:()=>{throw new Error},addEventListener:()=>{throw new Error},removeEventListener:()=>{throw new Error},dispatchEvent:()=>{throw new Error}},this.bo=new M.Q(this.Eo))};onmessage=t=>{switch(t.data.type){case'ready':return void(this.vo=!0);case'save':return(0,k.A)(t.data.value,t.data.path.split('/').pop().split('\\').pop()),void URL.revokeObjectURL(t.data.value);case'close':return void this.Eo?.postMessage({type:'close',id:t.data.id})}this.host?.xo===t.data.id?this.stream.Ho.onmessage(t.data):this.host?.postMessage(t)};Vo=async()=>{if(999==+D.getParameter('world'))this.host&&await this.host.Ko();else if(998==+D.getParameter('world')&&this.bo){if(this.bo.Lo)return void console.log('You are already connected.');const t=prompt('Paste offer here, answer will be copied to clipboard');if(t)try{await this.bo.Xo(t)}catch(t){console.error(t)}}};jo=async(t,i,e,s)=>{let n=5,o=await(this.db?.zo(t));if(o&&h.A.Zo(o)!==e&&(o=void 0),o)return new r.A(o);for(;!o;){await this.qo(s,`Requesting ${i}`);try{o=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}${e}`):await(0,C.Jo)(`${D.nt}/${t}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.qo(s,`Error loading - Will retry in ${t} secs.`),await(0,C.$o)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Qo(t,o)),new r.A(o)};ta=async(t,i,e,s)=>{let n=await(this.db?.zo(t+'.mid'));if(n&&12345678!==i&&h.A.Zo(n)!==i&&(n=void 0),!n)try{n=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}_${i}.mid`):await(0,C.Jo)(`${D.nt}/songs/${t}.mid`),e!==n.length&&(n=n.slice(0,e))}catch(t){}if(!n)return;await(this.db?.Qo(t+'.mid',n));const r=new h.A(Uint8Array.from(n)).ia,o=E.A.read(r,n,e,4);(0,v.ea)(o,this.Co,s)};sa=()=>{if(w.na.fillStyle='black',w.na.fillRect(0,0,this.width,this.height),this.ra(1),this.Dt){this.pi=!1,w.na.font='bold 16px helvetica, sans-serif',w.na.textAlign='left',w.na.fillStyle='yellow';let t=35;w.na.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.na.fillStyle='white',w.na.fillText('To fix this try the following (in order):',30,t),t+=50,w.na.font='bold 12px helvetica, sans-serif',w.na.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.na.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.na.fillText('3: Try using a different game-world',30,t),t+=30,w.na.fillText('4: Try rebooting your computer',30,t),t+=30,w.na.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.pi=!1,w.na.font='bold 20px helvetica, sans-serif',w.na.textAlign='left',w.na.fillStyle='white',w.na.fillText('Error - unable to load game!',50,50),w.na.fillText('To play RuneScape make sure you play from',50,100),w.na.fillText('https://2004scape.org',50,150)),this.Mt){this.pi=!1,w.na.font='bold 13px helvetica, sans-serif',w.na.textAlign='left',w.na.fillStyle='yellow';let t=35;w.na.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.na.fillStyle='white',w.na.fillText('To fix this try the following (in order):',30,t),t+=50,w.na.font='bold 12px helvetica, sans-serif',w.na.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.na.fillText('2: Try rebooting your computer, and reloading',30,t)}};ha=t=>{if(!t.oa)return!1;for(let i=0;i=s)return!1}else if(3===t.oa[i]){if(e<=s)return!1}else if(4===t.oa[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};ca=(t,i,e,s,n)=>{this.ve?.draw(t,i),this.be?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,m.A.fa);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;y.A.fillRect(t,i+h+16,16,r,m.A.ua),y.A.da(t,i+h+16,m.A.wa,r),y.A.da(t+1,i+h+16,m.A.wa,r),y.A.ya(t,i+h+16,m.A.wa,16),y.A.ya(t,i+h+17,m.A.wa,16),y.A.da(t+15,i+h+16,m.A.Aa,r),y.A.da(t+14,i+h+17,m.A.Aa,r-1),y.A.ya(t,i+h+r+15,m.A.Aa,16),y.A.ya(t+1,i+h+r+14,m.A.Aa,15)};ma=(t,i)=>{let e=!1;const n=s.A.Do[t];if(!n.pa)return!1;for(let t=0;ts.delay[r.Ca];)r._a-=s.delay[r.Ca]+1,r.Ca++,r.Ca>=s.Ea&&(r.Ca-=s.va,(r.Ca<0||r.Ca>=s.Ea)&&(r.Ca=0)),e=!0}}}return e};ba=(t,i,e,r,h=!1)=>{if(0!==t.type||!t.pa||t.hide&&this.Zs!==t.id&&this.qs!==t.id&&this.Js!==t.id)return;const o=y.A.left,a=y.A.top,l=y.A.right,c=y.A.bottom;y.A.Ta(i,e,i+t.width,e+t.height);const f=t.pa.length;for(let o=0;o0&&this.ka(c),c.type===s.A.Ma)c.Da>c.scroll-c.height&&(c.Da=c.scroll-c.height),c.Da<0&&(c.Da=0),this.ba(c,a,l,c.Da,h),c.scroll>c.height&&this.ca(a+c.width,l,c.Da,c.scroll,c.height);else if(c.type===s.A.Na){let t=0;for(let i=0;i0){let i=0,e=0;const r=c.Ua[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qs===t){const h=A.A.Ya(r,c.Pa[t]);if(0!==this.tn&&this.Qs===t&&this.$s===c.id?(i=this.Ha-this.en,e=this.Va-this.sn,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.nn<5&&(i=0,e=0),h.Ka(128,s+i,n+e)):0!==this.un&&this.dn===t&&this.wn===c.id?h.Ka(128,s,n):h.draw(s,n),33===h.Xa||1!==c.Pa[t]){const r=c.Pa[t];this.di?.ja(s+i+1,n+10+e,this.za(r),m.A.Za),this.di?.ja(s+i,n+9+e,this.za(r),m.A.qa)}}}else if(c.Ja&&t<20){const i=c.Ja[t];i?.draw(s,n)}t++}}else if(c.type===s.A.$a)c.fill?y.A.fillRect(a,l,c.width,c.height,c.Qa):y.A.Sa(a,l,c.width,c.height,c.Qa);else if(c.type===s.A.tl){const t=c.font;let i=c.Qa,e=c.text;if(this.Js!==c.id&&this.qs!==c.id&&this.Zs!==c.id||0===c.il||(i=c.il),this.ha(c)&&(i=c.el,c.sl&&c.sl.length>0&&(e=c.sl)),c.nl===s.A.rl&&this.An&&(e='Please wait...',i=c.Qa),!t||!e)continue;for(let s=l+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),c.ol?t.al(a+(c.width/2|0),s,r,i,c.ll):t.cl(a,s,r,i,c.ll)}}else if(c.type===s.A.fl){let t;t=this.ha(c)?c.ul:c.dl,t?.draw(a,l)}else if(c.type===s.A.wl){const t=n.A.yl,i=n.A.Al;n.A.yl=a+(c.width/2|0),n.A.Al=l+(c.height/2|0);const e=n.A.sin[c.ml]*c.zoom>>16,s=n.A.cos[c.ml]*c.zoom>>16,r=this.ha(c);let h;h=r?c.Ia:c.ga;let o=null;if(-1===h)o=c.pl(-1,-1,r);else{const t=g.A.Do[h];t.frames&&t.gl&&(o=c.pl(t.frames[c.Ca],t.gl[c.Ca],r))}o&&o.Il(0,c._l,0,c.ml,0,e,s),n.A.yl=t,n.A.Al=i}else if(c.type===s.A.Cl){const t=c.font;if(!t||!c.Ua||!c.Pa)continue;let i=0;for(let e=0;e0){const n=A.A.get(c.Ua[i]-1);let r=n.name;if((n.El||1!==c.Pa[i])&&(r=r+' x'+this.vl(c.Pa[i])),!r)continue;const h=a+s*(c.Wa+115),o=l+e*(c.Ga+12);c.ol?t.al(h+(c.width/2|0),o,r,c.Qa,c.ll):t.cl(h,o,r,c.Qa,c.ll)}i++}}}y.A.Ta(o,a,l,c)};ka=t=>{let i=t.xa;if(i>=s.A.bl&&i<=s.A.Tl)i--,i>=this.Vh?(t.text='',t.nl=0):(t.text=this.eo[i],t.nl=1);else if(i>=s.A.Ol&&i<=s.A.Rl)i-=s.A.Ol,i>=this.Vh?(t.text='',t.nl=0):(0===this.no[i]?t.text='@red@Offline':this.no[i]===D.it?t.text='@gre@World-'+(this.no[i]-9):t.text='@yel@World-'+(this.no[i]-9),t.nl=1);else if(i===s.A.Sl)t.scroll=15*this.Vh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=s.A.Ll&&i<=s.A.xl)i-=s.A.Ll,i>=this.fs?(t.text='',t.nl=0):(t.text=I.A.kl(I.A.Ml(this.us[i])),t.nl=1);else if(i===s.A.Dl)t.scroll=15*this.fs+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===s.A.Nl){if(t.ml=150,t._l=256*Math.sin(this.Ft/40)&2047,this.Gh){this.Gh=!1;const i=new d.fe(7,null);let e=0;for(let t=0;t<7;t++){const s=this.Yh[t];s>=0&&(i[e++]=_.A.Do[s].pl())}const s=p.A.Fl(i,e);for(let t=0;t<5;t++)0!==this.Hh[t]&&(s.Bl(u.A.Ul[t][0],u.A.Ul[t][this.Hh[t]]),1===t&&s.Bl(u.A.Pl[0],u.A.Pl[this.Hh[t]]));if(this.xh){const i=g.A.Do[this.xh.Wl].frames;i&&(s.Gl(),s.Yl(i[0]),s.Hl(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===s.A.Vl)this.Fe||(this.Fe=t.dl,this.Be=t.ul),this.Wh?t.dl=this.Be:t.dl=this.Fe;else if(i===s.A.Kl)this.Fe||(this.Fe=t.dl,this.Be=t.ul),this.Wh?t.dl=this.Fe:t.dl=this.Be;else if(i===s.A.Xl)t.text=this.xn,this.Ft%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===s.A.jl)this.Ph?this.kn?(t.Qa=m.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Qa=m.A.La,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===s.A.zl||i===s.A.Zl)if(0===this.Dn)t.text='';else{let i;i=0===this.Nn?'earlier today':1===this.Nn?'yesterday':this.Nn+' days ago',t.text='You last logged in '+i+' from: '+I.A.ql(this.Dn)}else if(i===s.A.Jl)0===this.Bn&&(t.text='0 unread messages',t.Qa=m.A.qa),1===this.Bn&&(t.text='1 unread message',t.Qa=m.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Qa=m.A.GREEN);else if(i===s.A.$l)if(201===this.Fn)t.text='';else if(200===this.Fn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Fn?'Earlier today':1===this.Fn?'Yesterday':this.Fn+' days ago',t.text=i+' you changed your recovery questions'}else i===s.A.Ql?201===this.Fn?t.text='':200===this.Fn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===s.A.tc&&(201===this.Fn?t.text='':(this.Fn,t.text="Do this from the 'account management' area on our front webpage"))};aa=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let n=0,r=0;for(;;){const t=e[r++];if(0===t)return n;if(1===t)n+=this.Es[e[r++]];else if(2===t)n+=this.vs[e[r++]];else if(3===t)n+=this.Cs[e[r++]];else if(4===t){const t=s.A.Do[e[r++]],i=e[r++]+1;if(t.Ua&&t.Pa)for(let e=0;et<999999999?String(t):'*';vl=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};za=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,e)=>{e.d(i,{w:()=>h});var s=e(7046),n=e(1651),r=e(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');['0','998','999'].includes(s.A.getParameter('world'))?function(){if(+s.A.getParameter('world')>=998)return void(n.K.nt='data/pack/client');n.K.st='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0}():await async function(t){const i=await o(t,parseInt(s.A.getParameter('world'),10)),e=new URL(i.address);n.K.it=10+i.id-1,n.K.st=`${e.protocol}//${e.hostname}`,n.K.nt=`${e.protocol}//${e.hostname}:${e.port}`,t||(n.K.st=n.K.st.replace('https:','http:'));n.K.portOffset=i.portOffset,n.K.members=!0===i?.members,s.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===s.A.getParameter('detail').length&&s.A.setParameter('detail','high');'low'===s.A.getParameter('detail')?n.K.St():n.K.Rt()}(),0===s.A.getParameter('method').length&&s.A.setParameter('method','0')}async function o(t,i,e=0){if(e>=10)throw new Error('could not find world to connect!');const s=t?'https:':'http:';let n;try{n=JSON.parse(await(0,r.ec)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.$o)(1e3),o(t,i,++e)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hh:0});const h=n.find((t=>t.id===i));return h||o(t,i,10)}},1375:(t,i,e)=>{e.a(t,(async(t,i)=>{try{var s=e(1312),n=e(5637),r=e(2164),h=e(1302),o=e(6948),a=e(8317),l=e(8738),c=e(3764),f=e(1120),u=e(4583),d=e(2682),w=e(8665),y=e(8534),A=e(6730),m=e(7953),p=e(9234),g=e(8950),I=e(1069),_=e(3937),C=e(4544),E=e(1908),v=e(9298),b=e(1651),T=e(7604),O=e(1673);class t extends b.K{constructor(){super(!1)}sc=null;nc=null;rc=!1;hc=!1;oc=0;ac=0;lc='';load=async()=>{try{await this.qo(10,'Connecting to fileserver'),await E.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new C.A(await C.A.openDatabase());const t=new I.A(new Uint8Array(await(0,p.Jo)(`${b.K.nt}/crc`))),i=[];for(let e=0;e<9;e++)i[e]=t.ia;const e=await this.jo('title','title screen',i[1],10);this.di=d.A.cc(e,'p11'),this.wi=d.A.cc(e,'p12'),this.yi=d.A.cc(e,'b12'),this.Ai=d.A.cc(e,'q8');const g=await this.jo('config','config',i[2],15),v=await this.jo('interface','interface',i[3],20),T=await this.jo('media','2d graphics',i[4],30),R=await this.jo('models','3d graphics',i[5],40),S=await this.jo('textures','textures',i[6],60),L=await this.jo('wordenc','chat system',i[7],65),x=await this.jo('sounds','sound effects',i[8],70);await this.qo(75,'Unpacking media'),this.ve=O.A.cc(T,'scrollbar',0),this.be=O.A.cc(T,'scrollbar',1),await this.qo(80,'Unpacking textures'),u.A.fc(S),u.A.uc(.8),u.A.dc(20),await this.qo(83,'Unpacking models'),w.A.wc(R),y.A.wc(R),A.A.wc(R),await this.qo(86,'Unpacking config'),s.A.wc(g),n.A.wc(g),r.A.wc(g),h.A.wc(g,!0),o.A.wc(g),a.A.wc(g),l.A.wc(g),c.A.wc(g),await this.qo(90,'Unpacking sounds'),_.A.wc(x),await this.qo(92,'Unpacking interfaces'),f.A.wc(v,T,[this.di,this.wi,this.yi,this.Ai]),await this.qo(97,'Preparing game engine'),m.A.wc(L);for(let t=0;t{this.Mt||this.Dt||this.Nt||(!this.hc&&this.sc&&(this.lc='',this.Ac(this.sc,this.Ha,this.Va,0,0,0),this.Zs=this.Ln,this.Ln=-1,this.rc||(this.nc=this.mc(this.sc,this.Ha,this.Va,0,0,0))),this.nc&&(1===this.gc?(this.hc||(this.oc=this.nc.Ic()-this.Ha,this.ac=this.nc._c()-this.Va),this.hc=!0):this.hc=!1,this.hc&&this.nc.move(this.Ha+this.oc,this.Va+this.ac)),this.Cc(),this.Ec(),this.vc=-1,this.bc=-1,this.Tc=0)};draw=async()=>{this.Mt||this.Dt||this.Nt?this.sa():(g.A.clear(),g.A.fillRect(0,0,this.width,this.height,0),this.Oc(8,8,16,16,5263440),this.sc&&(this.ba(this.sc,0,0,0,!1),this.yi?.Rc(4,15,this.lc,v.A.La,!0,0)),this.nc&&this.nc.outline(65535),this.Fo?.draw(0,0))};Cc(){for(;;){const t=this.Sc();if(-1===t)break;this.nc&&(8===t?(this.nc.delete(),this.nc=null,this.rc=!1):9===t&&(this.rc=!1))}}Ec(){if(this.nc){if(this.Lc[1]){const t=this.nc.Ic();this.nc.move(t-1,this.nc._c())}else if(this.Lc[2]){const t=this.nc.Ic();this.nc.move(t+1,this.nc._c())}if(this.Lc[3]){const t=this.nc._c();this.nc.move(this.nc.Ic(),t-1)}else if(this.Lc[4]){const t=this.nc._c();this.nc.move(this.nc.Ic(),t+1)}}}Oc=(t,i,e,s,n)=>{const r=(this.width+t)/e,h=(this.height+i)/s;t=-t,i=-i;for(let o=0;o{if(0!==t.type||!t.pa||!t.Oa||!t.Ra||is+t.width||e>n+t.height)return;const h=t.pa.length;for(let o=0;o=0||0!==l.il)&&i>=h&&e>=a&&i=0?this.Ln=l.kc:this.Ln=l.id),0===l.type?this.Ac(l,i,e,h,a,l.Da):i>=h&&e>=a&&i{if(0!==t.type||!t.pa||!t.Oa||!t.Ra||is+t.width||e>n+t.height)return null;let h=null;const o=t.pa.length;for(let a=0;a=o&&e>=l&&i{})),i()}catch(t){i(t)}}),1)},7046:(t,i,e)=>{e.d(i,{A:()=>l});var s=e(1183),n=e(4583),r=e(9234),h=e(9091),o=e(2595),a=e(7854);class l{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}Nc=0;Fc=[];Bc=0;Fo=null;state=0;Uc=20;Pc=1;Wc=[];Gc=0;Yc=0;Hc=[];Vc=!0;Kc=!1;Xc=50;hasFocus=!0;jc=!1;zc=0;gc=0;Ha=0;Va=0;Tc=0;vc=0;bc=0;Lc=[];Zc=[];qc=0;Jc=0;input=null;$c=!1;Qc=!1;tf=!1;time=-1;if=0;ef=0;sf=0;nf=0;rf=0;hf=0;constructor(t=!1){a.af.tabIndex=-1,a.na.fillStyle='black',a.na.fillRect(0,0,a.af.width,a.af.height),this.Kc=t,this.Kc?this.resize(window.innerWidth,window.innerHeight):this.resize(a.af.width,a.af.height)}get width(){return a.af.width}get height(){return a.af.height}resize=(t,i)=>{a.af.width=t,a.af.height=i,this.Fo=new s.A(t,i),n.A.yc()};run=async()=>{a.af.addEventListener('resize',(()=>{this.Kc&&this.resize(window.innerWidth,window.innerHeight)}),!1),a.af.onmousedown=this.onmousedown,a.af.onmouseup=this.onmouseup,a.af.onmouseenter=this.onmouseenter,a.af.onmouseleave=this.onmouseleave,a.af.onmousemove=this.onmousemove,window.onbeforeunload=this.So,a.af.onfocus=this.onfocus,a.af.onblur=this.onblur,this.lf?(a.af.ontouchstart=this.ontouchstart,a.af.ontouchend=this.ontouchend,a.af.ontouchmove=this.ontouchmove):(a.af.onkeydown=this.onkeydown,a.af.onkeyup=this.onkeyup),a.af.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.lf&&'low'===l.getParameter('detail')&&(this.Xc=30),await this.qo(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.Wc[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.cf();const h=e,o=s;e=300,s=1,t=performance.now();const a=this.Wc[i];if(0===a?(e=h,s=o):t>a&&(e=2560*this.Uc/(t-a)|0),e<25?e=25:e>256&&(e=256,s=this.Uc-(t-a)/10|0),this.Wc[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.Wc[t]&&(this.Wc[t]+=s);for(s0&&(this.Gc=1e3*e/(256*this.Uc)|0);const l=performance.now();if(this.Vc&&this.refresh(),await this.draw(),this.Hc[this.Yc]=(performance.now()-l)/1e3,this.Yc=(this.Yc+1)%this.Hc.length,this.Xc<50){const i=1e3/this.Xc-(performance.now()-t);i>0&&await(0,r.$o)(i)}}-1===this.state&&this.cf()};cf=()=>{this.state=-2,this.So()};ra=t=>{this.Uc=1e3/t|0};ff=t=>{this.Xc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.Uc|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};So=()=>{};draw=async()=>{};refresh=()=>{};async qo(t,i){const e=this.width,s=this.height;this.Vc&&(a.na.fillStyle='black',a.na.fillRect(0,0,e,s),this.Vc=!1);const n=s/2-18;a.na.fillStyle='rgb(140, 17, 17)',a.na.rect((e/2|0)-152,n,304,34),a.na.fillRect((e/2|0)-150,n+2,3*t,30),a.na.fillStyle='black',a.na.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),a.na.font='bold 13px helvetica, sans-serif',a.na.textAlign='center',a.na.fillStyle='white',a.na.fillText(i,e/2|0,n+22),await(0,r.$o)(5)}Sc=()=>{let t=-1;return this.Jc!==this.qc&&(t=this.Zc[this.qc],this.qc=this.qc+1&127),t};get ms(){const t=this.Hc.length;let i=0;for(let e=0;ethis.Nc&&(this.Nc=e),this.Fc[this.Bc]=e,this.Bc=(this.Bc+1)%250,e}get uf(){return this.Fc.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.zc=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Lc[n]=1),n>4&&(this.Zc[this.Jc]=n,this.Jc=this.Jc+1&127),o.A.enabled&&o.A.df(n),h.g.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.zc=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Lc[n]=0),o.A.enabled&&o.A.wf(n),h.g.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.$c=!1,(t.clientX>0||t.clientY>0)&&this.yf(t),this.zc=0,this.vc=this.Ha,this.bc=this.Va,this.lf&&!this.Af){if(this.mf()||this.pf()||this.gf())return this.Tc=1,void(this.gc=1);t.timeStamp>=this.time+500?(this.Tc=2,this.gc=2):(this.Tc=1,this.gc=1)}else 2===t.button?(this.Tc=2,this.gc=2):(this.Tc=1,this.gc=1);o.A.enabled&&o.A.If(this.vc,this.bc,t.buttons)};onmouseup=t=>{this.yf(t),this.zc=0,this.gc=0,o.A.enabled&&o.A._f(t.buttons)};onmouseenter=t=>{this.yf(t),o.A.enabled&&o.A.Cf()};onmouseleave=t=>{this.yf(t),this.zc=0,this.Ha=-1,this.Va=-1,this.gc=0,this.vc=-1,this.bc=-1,o.A.enabled&&o.A.Ef()};onmousemove=t=>{this.yf(t),this.zc=0,o.A.enabled&&o.A.vf(this.Ha,this.Va)};onfocus=t=>{this.hasFocus=!0,this.Vc=!0,this.refresh(),o.A.enabled&&o.A.bf()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.Tf()};ontouchstart=t=>{if(!this.lf)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.$c=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.if=this.rf=this.sf=0|i.screenX,this.ef=this.hf=this.nf=0|i.screenY,this.time=t.timeStamp,this.Qc=this.Of(),this.tf=this.Rf()};ontouchend=t=>{if(!this.lf||!this.$c)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.rf=0|i.screenX,this.hf=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Qc&&!this.Of())return void(this.$c=!1);if(this.tf&&!this.Rf())return void(this.$c=!1);if(this.mf()||this.Sf()||this.pf()||this.gf()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.pf()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.gf()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.mf()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.Sf()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.Lf?t.setAttribute('type','password'):t.setAttribute('type',this.gf()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.Lf&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.Lf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.Lf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.$c=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.if-this.rf)>16||Math.abs(this.ef-this.hf)>16;n&&!r?(this.$c=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.gc=0,this.$c=!1)};ontouchmove=t=>{if(!this.lf||!this.$c)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.rf=0|i.screenX,this.hf=0|i.screenY,this.Qc&&-1===this.Go()?(this.sf-this.rf>0?this.rotate(2):this.sf-this.rf<0&&this.rotate(0),this.nf-this.hf>0?this.rotate(3):this.nf-this.hf<0&&this.rotate(1)):(this.tf||-1!==this.Go())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.sf=this.rf,this.nf=this.hf};get lf(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get Lf(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Af(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}Of=()=>this.jc&&this.Ha>=8&&this.Ha<=520&&this.Va>=11&&this.Va<=345;mf=()=>this.jc&&-1===this.Wo()&&!this.Uo()&&!this.Po()&&this.Ha>=11&&this.Ha<=506&&this.Va>=449&&this.Va<=482;Sf=()=>this.jc&&(this.Uo()||this.Po())&&this.Ha>=11&&this.Ha<=506&&this.Va>=383&&this.Va<=482;Rf=()=>this.jc&&this.Ha>=562&&this.Ha<=752&&this.Va>=231&&this.Va<=492;pf=()=>!this.jc&&2===this.Bo()&&this.Ha>=301&&this.Ha<=562&&this.Va>=262&&this.Va<=279;gf=()=>!this.jc&&2===this.Bo()&&this.Ha>=301&&this.Ha<=562&&this.Va>=279&&this.Va<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};xf=()=>null!==document.fullscreenElement;yf=t=>{if(this.xf()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/a.af.height,s=(window.innerWidth-a.af.width*e)/2;this.Ha=0|this.kf(t.clientX-i.left-s,0,a.af.width*e,0,789),this.Va=0|this.kf(t.clientY-i.top,0,a.af.height*e,0,532)}else{const i=a.af.getBoundingClientRect(),e=a.af.width/i.width,s=a.af.height/i.height;this.Ha=(t.clientX-i.left)*e|0,this.Va=(t.clientY-i.top)*s|0}this.Ha<0&&(this.Ha=0),this.Va<0&&(this.Va=0),this.Ha>789&&(this.Ha=789),this.Va>532&&(this.Va=532)};kf=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}},2595:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static enabled=!1;static Mf=null;static Df=null;static Nf=0;static Ff=0;static Bf=0;static Uf=0;static Pf=0;static Wf=()=>{this.Mf=s.A.Ut(1),this.Df=null,this.Nf=performance.now(),this.enabled=!0};static Gf=()=>{this.enabled=!1,this.Mf=null};static flush=()=>{let t=null;return this.Df&&this.enabled&&(t=this.Df),this.Df=null,t};static stop=()=>{let t=null;return this.Mf&&this.Mf.Yf>0&&this.enabled&&(t=this.Mf),this.Gf(),t};static If=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.Ff++;const s=performance.now();let n=(s-this.Nf)/10|0;n>250&&(n=250),this.Nf=s,this.Hf(5),1===e?this.Mf?.p1(1):this.Mf?.p1(2),this.Mf?.p1(n),this.Mf?.p3(t+(i<<10))};static _f=t=>{if(!this.enabled)return;this.Ff++;const i=performance.now();let e=(i-this.Nf)/10|0;e>250&&(e=250),this.Nf=i,this.Hf(2),1===t?this.Mf?.p1(3):this.Mf?.p1(4),this.Mf?.p1(e)};static vf=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.Bf>=50){this.Bf=e,this.Ff++;let s=(e-this.Nf)/10|0;s>250&&(s=250),this.Nf=e,t-this.Uf<8&&t-this.Uf>=-8&&i-this.Pf<8&&i-this.Pf>=-8?(this.Hf(3),this.Mf?.p1(5),this.Mf?.p1(s),this.Mf?.p1(t+(i-this.Pf+8<<4)+8-this.Uf)):t-this.Uf<128&&t-this.Uf>=-128&&i-this.Pf<128&&i-this.Pf>=-128?(this.Hf(4),this.Mf?.p1(6),this.Mf?.p1(s),this.Mf?.p1(t+128-this.Uf),this.Mf?.p1(i+128-this.Pf)):(this.Hf(5),this.Mf?.p1(7),this.Mf?.p1(s),this.Mf?.p3(t+(i<<10))),this.Uf=t,this.Pf=i}};static df=t=>{if(!this.enabled)return;this.Ff++;const i=performance.now();let e=(i-this.Nf)/10|0;e>250&&(e=250),this.Nf=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.Hf(3),this.Mf?.p1(8),this.Mf?.p1(e),this.Mf?.p1(t)};static wf=t=>{if(!this.enabled)return;this.Ff++;const i=performance.now();let e=(i-this.Nf)/10|0;e>250&&(e=250),this.Nf=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.Hf(3),this.Mf?.p1(9),this.Mf?.p1(e),this.Mf?.p1(t)};static bf=()=>{if(!this.enabled)return;this.Ff++;const t=performance.now();let i=(t-this.Nf)/10|0;i>250&&(i=250),this.Nf=t,this.Hf(2),this.Mf?.p1(10),this.Mf?.p1(i)};static Tf=()=>{if(!this.enabled)return;this.Ff++;const t=performance.now();let i=(t-this.Nf)/10|0;i>250&&(i=250),this.Nf=t,this.Hf(2),this.Mf?.p1(11),this.Mf?.p1(i)};static Cf=()=>{if(!this.enabled)return;this.Ff++;const t=performance.now();let i=(t-this.Nf)/10|0;i>250&&(i=250),this.Nf=t,this.Hf(2),this.Mf?.p1(12),this.Mf?.p1(i)};static Ef=()=>{if(!this.enabled)return;this.Ff++;const t=performance.now();let i=(t-this.Nf)/10|0;i>250&&(i=250),this.Nf=t,this.Hf(2),this.Mf?.p1(13),this.Mf?.p1(i)};static Hf=t=>{if(this.Mf&&this.Mf.Yf+t>=500){const t=this.Mf;this.Mf=s.A.Ut(1),this.Df=t}}}},9091:(t,i,e)=>{e.d(i,{c:()=>n,g:()=>s});const s=['F11','F12'],n={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}}},1120:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1069),n=e(8665),r=e(2679),h=e(2511),o=e(3819),a=e(3867),l=e(8950);class c{static Do=[];static Vf=null;static No=null;static Ma=0;static Kf=1;static Na=2;static $a=3;static tl=4;static fl=5;static wl=6;static Cl=7;static Xf=1;static jf=2;static Dc=3;static zf=4;static Zf=5;static rl=6;static bl=1;static Tl=100;static Ol=101;static Rl=200;static qf=201;static Jf=202;static Sl=203;static $f=205;static Qf=300;static tu=301;static iu=302;static eu=303;static su=304;static nu=305;static ru=306;static hu=307;static ou=308;static au=309;static lu=310;static cu=311;static fu=312;static uu=313;static du=314;static wu=315;static yu=316;static Au=317;static mu=318;static pu=319;static gu=320;static Iu=321;static _u=322;static Cu=323;static Vl=324;static Kl=325;static Eu=326;static Nl=327;static Ll=401;static xl=500;static vu=501;static bu=502;static Dl=503;static Xl=600;static Tu=601;static Ou=602;static Ru=603;static Su=604;static Lu=605;static xu=606;static ku=607;static Mu=608;static Du=609;static Nu=610;static Fu=611;static Bu=612;static jl=613;static zl=650;static Jl=651;static $l=652;static Ql=653;static tc=654;static Zl=655;static wc=(t,i,e)=>{this.Vf=new r.A(5e4),this.No=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.Yf+=2;n.Yf0){s.oa=new Uint8Array(r),s.la=new Uint16Array(r);for(let t=0;t0){s.scripts=new a.fe(o,null);for(let t=0;t0){const n=e.lastIndexOf(',');s.Ja[t]=this.Ku(i,e.substring(0,n),parseInt(e.substring(n+1),10))}}s.Xu=new a.fe(5,null);for(let t=0;t<5;t++){const i=n.Vu;s.Xu[t]=i,0===i.length&&(s.Xu[t]=null)}}if(s.type===c.$a&&(s.fill=1===n.Wu),s.type===c.tl||s.type===c.Kf){s.ol=1===n.Wu;const t=n.Wu;e&&(s.font=e[t]),s.ll=1===n.Wu}if(s.type===c.tl&&(s.text=n.Vu,s.sl=n.Vu),s.type!==c.Kf&&s.type!==c.$a&&s.type!==c.tl||(s.Qa=n.ia),s.type!==c.$a&&s.type!==c.tl||(s.el=n.ia,s.il=n.ia),s.type===c.fl){const t=n.Vu;if(t.length>0){const e=t.lastIndexOf(',');s.dl=this.Ku(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=n.Vu;if(e.length>0){const t=e.lastIndexOf(',');s.ul=this.Ku(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(s.type===c.wl){const t=n.Wu;0!==t&&(s.model=this.pl((t-1<<8)+n.Wu));const i=n.Wu;0!==i&&(s.ju=this.pl((i-1<<8)+n.Wu)),s.ga=n.Wu,0===s.ga?s.ga=-1:s.ga=(s.ga-1<<8)+n.Wu,s.Ia=n.Wu,0===s.Ia?s.Ia=-1:s.Ia=(s.Ia-1<<8)+n.Wu,s.zoom=n.Uu,s.ml=n.Uu,s._l=n.Uu}if(s.type===c.Cl){s.Ua=new Int32Array(s.width*s.height),s.Pa=new Int32Array(s.width*s.height),s.ol=1===n.Wu;const t=n.Wu;e&&(s.font=e[t]),s.ll=1===n.Wu,s.Qa=n.ia,s.Wa=n.Gu,s.Ga=n.Gu,s.Yu=1===n.Wu,s.Xu=new a.fe(5,null);for(let t=0;t<5;t++){const i=n.Vu;s.Xu[t]=i,0===i.length&&(s.Xu[t]=null)}}s.nl!==c.jf&&s.type!==c.Na||(s.zu=n.Vu,s.action=n.Vu,s.Zu=n.Uu),s.nl!==c.Xf&&s.nl!==c.zf&&s.nl!==c.Zf&&s.nl!==c.rl||(s.Mc=n.Vu,0===s.Mc.length&&(s.nl===c.Xf?s.Mc='Ok':s.nl===c.zf||s.nl===c.Zf?s.Mc='Select':s.nl===c.rl&&(s.Mc='Continue')))}this.Vf=null,this.No=null};static Ku=(t,i,e)=>{const s=o.A.qu(i)<<8n|BigInt(e);if(this.Vf){const t=this.Vf.get(s);if(t)return t}let n;try{n=h.A.cc(t,i,e),this.Vf?.put(s,n)}catch(t){return null}return n};static pl=t=>{if(this.No){const i=this.No.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.No?.put(BigInt(t),i),i};id=-1;Pu=-1;type=-1;nl=-1;xa=0;width=0;height=0;kc=-1;oa=null;la=null;scripts=null;scroll=0;hide=!1;draggable=!1;Yu=!1;Hu=!1;Wa=0;Ga=0;Fa=null;Ba=null;Ja=null;Xu=null;fill=!1;ol=!1;font=null;ll=!1;text=null;sl=null;Qa=0;el=0;il=0;dl=null;ul=null;model=null;ju=null;ga=-1;Ia=-1;zoom=0;ml=0;_l=0;zu=null;action=null;Zu=-1;Mc=null;pa=null;Oa=null;Ra=null;x=0;y=0;Da=0;Ua=null;Pa=null;Ca=0;_a=0;pl(t,i,e){let s=this.model;if(e&&(s=this.ju),!s)return null;if(-1===t&&-1===i&&!s.Ju)return s;const r=n.A.$u(s,!0,!0,!1);return-1===t&&-1===i||r.Gl(),-1!==t&&r.Yl(t),-1!==i&&r.Yl(i),r.Hl(64,768,-50,-10,-50,!0),r}Ic(){if(this.Pu===this.id)return this.x;let t=c.Do[this.Pu];if(!t.pa||!t.Oa||!t.Ra)return this.x;let i=t.pa.indexOf(this.id);if(-1===i)return this.x;let e=t.Oa[i];for(;t.Pu!==t.id;){const s=c.Do[t.Pu];s.pa&&s.Oa&&s.Ra&&(i=s.pa.indexOf(t.id),-1!==i&&(e+=s.Oa[i])),t=s}return e}_c(){if(this.Pu===this.id)return this.y;let t=c.Do[this.Pu];if(!t.pa||!t.Oa||!t.Ra)return this.y;let i=t.pa.indexOf(this.id);if(-1===i)return this.y;let e=t.Ra[i];for(;t.Pu!==t.id;){const s=c.Do[t.Pu];s.pa&&s.Oa&&s.Ra&&(i=s.pa.indexOf(t.id),-1!==i&&(e+=s.Ra[i])),t=s}return e}outline(t){const i=this.Ic(),e=this._c();l.A.Sa(i,e,this.width,this.height,t)}move(t,i){if(this.Pu===this.id)return;this.x=0,this.y=0;const e=c.Do[this.Pu];if(e.pa&&e.Oa&&e.Ra){const s=e.pa.indexOf(this.id);-1!==s&&(e.Oa[s]=t,e.Ra[s]=i)}}delete(){if(this.Pu===this.id)return;const t=c.Do[this.Pu];if(t.pa&&t.Oa&&t.Ra){const i=t.pa.indexOf(this.id);-1!==i&&(t.pa.splice(i,1),t.Oa.splice(i,1),t.Ra.splice(i,1))}}}},6333:(t,i,e)=>{e.d(i,{$:()=>s});class s{id;Qu=null;constructor(t){this.id=t}td(t){for(;;){const i=t.Wu;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(6333);class r extends n.${static count=0;static Do=[];static wc=t=>{const i=new s.A(t.read('flo.dat'));this.count=i.Uu;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static sd=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static nd=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);rd=0;texture=-1;hd=!1;od=!0;ad=0;ld=0;fd=0;ud=0;dd=0;wd=0;decode(t,i){1===t?(this.rd=i.yd,this.setColor(this.rd)):2===t?this.texture=i.Wu:3===t?this.hd=!0:5===t?this.od=!1:6===t?this.Qu=i.Vu:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(h=e),s>h&&(h=s);let o=0,a=0;const l=(n+h)/2;n!==h&&(l<.5&&(a=(h-n)/(h+n)),l>=.5&&(a=(h-n)/(2-h-n)),i===h?o=(e-s)/(h-n):e===h?o=(s-i)/(h-n)+2:s===h&&(o=(i-e)/(h-n)+4)),o/=6,this.ad=256*o|0,this.ld=256*a|0,this.fd=256*l|0,this.ld<0?this.ld=0:this.ld>255&&(this.ld=255),this.fd<0?this.fd=0:this.fd>255&&(this.fd=255),this.ud=l>.5?(1-l)*a*512|0:l*a*512|0,this.ud<1&&(this.ud=1),this.dd=o*this.ud|0;let c=this.ad+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.ld+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.fd+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.wd=r.ed(c,f,u)}}},8317:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(1069),n=e(6333),r=e(8665),h=e(3867);class o extends n.${static count=0;static Do=[];static wc=t=>{const i=new s.A(t.read('idk.dat'));this.count=i.Uu;for(let t=0;t=40&&t<50?this.pd[t-40]=i.Uu:t>=50&&t<60?this.gd[t-50]=i.Uu:t>=60&&t<70?this.md[t-60]=i.Uu:console.log('Error unrecognised config code: ',t)}pl(){if(!this.Ad)return null;const t=new h.fe(this.Ad.length,null);for(let i=0;i{e.d(i,{A:()=>c});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(1023),a=e(6169),l=e(3867);class c extends s.${static count=0;static cache=null;static _d=null;static Cd=null;static Ed=0;static vd=new r.A(500);static bd=new r.A(30);static wc=t=>{this._d=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.Uu,this.Cd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.Cd||!this._d)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Ed=(this.Ed+1)%10;const i=this.cache[this.Ed];return this._d.Yf=this.Cd[t],i.id=t,i.reset(),i.td(this._d),i.Td||(i.Td=new Int32Array(1)),-1===i.Od&&i.Td&&(i.active=i.Td.length>0&&i.Td[0]===o.A.Rd.id,i.Sd&&(i.active=!0)),i};static So=()=>{this.vd=null,this.bd=null,this.Cd=null,this.cache=null,this._d=null};Ad=null;Td=null;name=null;Ld=null;pd=null;gd=null;width=1;length=1;xd=!0;kd=!0;active=!1;Od=-1;Md=!1;Dd=!1;od=!1;ga=-1;Nd=!1;Fd=16;Bd=0;Ud=0;Sd=null;Pd=-1;Wd=-1;Gd=!1;Yd=!0;Hd=128;Vd=128;Kd=128;Xd=0;jd=0;zd=0;Zd=0;qd=!1;decode(t,i){if(1===t){const t=i.Wu;this.Ad=new Int32Array(t),this.Td=new Int32Array(t);for(let e=0;e=30&&t<39)this.Sd||(this.Sd=new l.fe(5,null)),this.Sd[t-30]=i.Vu,'hidden'===this.Sd[t-30]?.toLowerCase()&&(this.Sd[t-30]=null);else if(40===t){const t=i.Wu;this.pd=new Uint16Array(t),this.gd=new Uint16Array(t);for(let e=0;e=this.Ad.length)return null;let d=this.Ad[l];if(-1===d)return null;const w=this.Gd!==i>3;w&&(d+=65536);let y=c.vd?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.nw(),c.vd?.put(BigInt(d),y));const A=128!==this.Hd||128!==this.Vd||128!==this.Kd,m=0!==this.jd||0!==this.zd||0!==this.Zd;let p=h.A.$u(y,!this.pd,!this.Nd,i===a.A.rw&&-1===o&&!A&&!m);for(-1!==o&&(p.Gl(),p.Yl(o),p.hw=null,p.ow=null);i-- >0;)p.aw();if(this.pd&&this.gd)for(let t=0;t{e.d(i,{A:()=>a});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(3867);class a extends s.${static count=0;static cache=null;static _d=null;static Cd=null;static Ed=0;static No=new r.A(30);static wc=t=>{this._d=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.Uu,this.Cd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.Cd||!this._d)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Ed=(this.Ed+1)%20;const i=this.cache[this.Ed]=new a(t);return this._d.Yf=this.Cd[t],i.td(this._d),i};static So=()=>{this.No=null,this.Cd=null,this.cache=null,this._d=null};name=null;Ld=null;size=1;Ad=null;md=null;Nd=!1;fw=-1;uw=-1;dw=-1;ww=-1;yw=-1;pd=null;gd=null;Sd=null;Hd=-1;Vd=-1;Kd=-1;Aw=!0;mw=-1;pw=128;gw=128;decode(t,i){if(1===t){const t=i.Wu;this.Ad=new Uint16Array(t);for(let e=0;e=30&&t<40)this.Sd||(this.Sd=new o.fe(5,null)),this.Sd[t-30]=i.Vu,'hidden'===this.Sd[t-30]?.toLowerCase()&&(this.Sd[t-30]=null);else if(40===t){const t=i.Wu;this.pd=new Uint16Array(t),this.gd=new Uint16Array(t);for(let e=0;e{e.d(i,{A:()=>u});var s=e(6333),n=e(1069),r=e(2511),h=e(2679),o=e(8665),a=e(4583),l=e(8950),c=e(9298),f=e(3867);class u extends s.${static count=0;static cache=null;static _d=null;static Cd=null;static Ed=0;static Tw=!0;static No=new h.A(50);static Ow=new h.A(200);static wc=(t,i)=>{this.Tw=i,this._d=new n.A(t.read('obj.dat'));const e=new n.A(t.read('obj.idx'));this.count=e.Uu,this.Cd=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.Cd||!this._d)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Ed=(this.Ed+1)%10;const i=this.cache[this.Ed];return this._d.Yf=this.Cd[t],i.id=t,i.reset(),i.td(this._d),-1!==i.Rw&&i.Sw(),!this.Tw&&i.members&&(i.name='Members Object',i.Ld="Login to a members' server to use this object.",i.Sd=null,i.Lw=null),i};static So=()=>{this.No=null,this.Ow=null,this.Cd=null,this.cache=null,this._d=null};static Ya=(t,i)=>{if(u.Ow){let e=u.Ow.get(BigInt(t));if(e&&e.xw!==i&&-1!==e.xw&&(e.kw(),e=null),e)return e}let e=u.get(t);if(e.Mw||(i=-1),e.Mw&&e.Dw&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.Dw[s]&&0!==e.Dw[s]&&(t=e.Mw[s]);-1!==t&&(e=u.get(t))}const s=new r.A(32,32),n=a.A.yl,h=a.A.Al,o=a.A.Nw,f=l.A.Fw,d=l.A.Bw,w=l.A.Uw,y=l.A.left,A=l.A.right,m=l.A.top,p=l.A.bottom;a.A.Pw=!1,l.A.bind(s.Fw,32,32),l.A.fillRect(0,0,32,32,c.A.Za),a.A.yc();const g=e.Ww(1),I=a.A.sin[e.Gw]*e.Yw>>16,_=a.A.cos[e.Gw]*e.Yw>>16;g.Il(0,e.Hw,e.Vw,e.Gw,e.Kw,I+(g.cw/2|0)+e.Xw,_+e.Xw);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.Fw[t+32*i]&&(t>0&&s.Fw[t+32*i-1]>1||i>0&&s.Fw[t+32*(i-1)]>1||t<31&&s.Fw[t+32*i+1]>1||i<31&&s.Fw[t+32*(i+1)]>1)&&(s.Fw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.Fw[t+32*i]&&t>0&&i>0&&s.Fw[t+32*(i-1)-1]>0&&(s.Fw[t+32*i]=3153952);if(-1!==e.Rw){const t=this.Ya(e.jw,10),i=t.Xa,s=t.xw;t.Xa=32,t.xw=32,t.zw(5,5,22,22),t.Xa=i,t.xw=s}return u.Ow?.put(BigInt(t),s),l.A.bind(f,d,w),l.A.Ta(y,m,A,p),a.A.yl=n,a.A.Al=h,a.A.Nw=o,a.A.Pw=!0,e.El?s.Xa=33:s.Xa=32,s.xw=i,s};model=0;name=null;Ld=null;pd=null;gd=null;Yw=2e3;Gw=0;Hw=0;Vw=0;Kw=0;Xw=0;Zw=!1;qw=-1;El=!1;Jw=1;members=!1;Sd=null;Lw=null;$w=-1;Qw=-1;ty=0;iy=-1;ey=-1;sy=0;ny=-1;hy=-1;oy=-1;ly=-1;uy=-1;wy=-1;Mw=null;Dw=null;jw=-1;Rw=-1;decode(t,i){if(1===t)this.model=i.Uu;else if(2===t)this.name=i.Vu;else if(3===t)this.Ld=i.Vu;else if(4===t)this.Yw=i.Uu;else if(5===t)this.Gw=i.Uu;else if(6===t)this.Hw=i.Uu;else if(7===t)this.Kw=i.Gu,this.Kw>32767&&(this.Kw-=65536);else if(8===t)this.Xw=i.Gu,this.Xw>32767&&(this.Xw-=65536);else if(9===t)this.Zw=!0;else if(10===t)this.qw=i.Uu;else if(11===t)this.El=!0;else if(12===t)this.Jw=i.ia;else if(16===t)this.members=!0;else if(23===t)this.$w=i.Uu,this.ty=i.Jd;else if(24===t)this.Qw=i.Uu;else if(25===t)this.iy=i.Uu,this.sy=i.Jd;else if(26===t)this.ey=i.Uu;else if(t>=30&&t<35)this.Sd||(this.Sd=new f.fe(5,null)),this.Sd[t-30]=i.Vu,'hidden'===this.Sd[t-30]?.toLowerCase()&&(this.Sd[t-30]=null);else if(t>=35&&t<40)this.Lw||(this.Lw=new f.fe(5,null)),this.Lw[t-35]=i.Vu;else if(40===t){const t=i.Wu;this.pd=new Uint16Array(t),this.gd=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.Mw&&this.Dw||(this.Mw=new Uint16Array(10),this.Dw=new Uint16Array(10)),this.Mw[t-100]=i.Uu,this.Dw[t-100]=i.Uu)}yy(t){let i=this.$w;if(1===t&&(i=this.iy),-1===i)return null;let e=this.Qw,s=this.ny;1===t&&(e=this.ey,s=this.hy);let n=o.A.model(i);if(-1!==e){const t=o.A.model(e);if(-1===s){const i=[n,t];n=o.A.Fl(i,2)}else{const i=[n,t,o.A.model(s)];n=o.A.Fl(i,3)}}if(0===t&&0!==this.ty&&n.translate(this.ty,0,0),1===t&&0!==this.sy&&n.translate(this.sy,0,0),this.pd&&this.gd)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.Dw[e]&&0!==this.Dw[e]&&(i=this.Mw[e]);if(-1!==i)return u.get(i).Ww(1)}if(u.No){const t=u.No.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.pd&&this.gd)for(let t=0;t{e.d(i,{A:()=>h});var s=e(6333),n=e(1069),r=e(6730);class h extends s.${static count=0;static Do=[];static wc=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.Uu;for(let t=0;t{e.d(i,{A:()=>a});var s=e(6333),n=e(1069),r=e(1312),h=e(8665),o=e(2679);class a extends s.${static count=0;static Do=[];static No=new o.A(30);static wc=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.Uu;for(let t=0;t=40&&t<50?this.pd[t-40]=i.Uu:t>=50&&t<60?this.gd[t-50]=i.Uu:console.log('Error unrecognised spotanim config code: ',t)}pl(){let t=a.No?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let i=0;i<6;i++)0!==this.pd[0]&&t.Bl(this.pd[i],this.gd[i]);return a.No?.put(BigInt(this.id),t),t}}},3764:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(6333),n=e(1069);class r extends s.${static count=0;static Do=[];static Cy=[];static Ey=0;static wc=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.Uu;for(let t=0;t{e.d(i,{A:()=>s});class s{static OPEN=0;static Sy=1;static Ly=2;static xy=4;static ky=8;static My=s.Sy<<4;static Dy=s.Ly<<4;static Ny=s.xy<<4;static Fy=s.ky<<4;static By=256;static Uy=512;static Py=1024;static Wy=2048;static Gy=4096;static Yy=s.Uy<<4;static Hy=s.Py<<4;static Vy=s.Wy<<4;static Ky=s.Gy<<4;static Xy=s.By<<9;static jy=524288;static zy=2097152;static Zy=s.zy|s.jy;static qy=s.By|s.Zy;static Jy=s.Ly|s.qy;static $y=s.ky|s.qy;static Qy=s.Ly|s.xy|s.$y;static tA=s.Dy|s.qy;static iA=s.ky|s.My|s.tA;static eA=s.Fy|s.qy;static sA=s.Sy|s.Ly|s.eA;static nA=s.Dy|s.Ny|s.eA;static rA=16777215}},670:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(9456),n=e(6169),r=e(1023),h=e(4909);class o{static Dr=4;static jr=104;static index=(t,i)=>t*o.jr+i;offsetX;hA;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.hA=0,this.sizeX=o.jr,this.sizeZ=o.jr,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.hA)]|=s.A.zy};aA=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.hA)]&=~s.A.zy};lA=(t,i,e,r,h,o)=>{let a=s.A.By;o&&(a|=s.A.Xy);const l=t-this.offsetX,c=i-this.hA;if(h===n.A.cA||h===n.A.fA){const t=e;e=r,r=t}for(let t=l;t=0&&t=0&&i{let a=s.A.By;o&&(a|=s.A.Xy);const l=t-this.offsetX,c=i-this.hA;if(h===n.A.cA||h===n.A.fA){const t=e;e=r,r=t}for(let t=l;t=0&&t=0&&i{const a=t-this.offsetX,l=i-this.hA,c=o?s.A.Ky:s.A.Fy,f=o?s.A.Gy:s.A.ky,u=o?s.A.Py:s.A.Ly,d=o?s.A.Hy:s.A.Dy,w=o?s.A.Uy:s.A.Sy,y=o?s.A.Yy:s.A.My,A=o?s.A.Wy:s.A.xy,m=o?s.A.Vy:s.A.Ny;e===r.A.wA.id?h===n.A.rw?(this.add(a,l,c),this.add(a-1,l,f)):h===n.A.cA?(this.add(a,l,u),this.add(a,l+1,d)):h===n.A.yA?(this.add(a,l,f),this.add(a+1,l,c)):h===n.A.fA&&(this.add(a,l,d),this.add(a,l-1,u)):e===r.A.AA.id||e===r.A.mA.id?h===n.A.rw?(this.add(a,l,w),this.add(a-1,l+1,y)):h===n.A.cA?(this.add(a,l,A),this.add(a+1,l+1,m)):h===n.A.yA?(this.add(a,l,y),this.add(a+1,l-1,w)):h===n.A.fA&&(this.add(a,l,m),this.add(a-1,l-1,A)):e===r.A.pA.id&&(h===n.A.rw?(this.add(a,l,u|c),this.add(a-1,l,f),this.add(a,l+1,d)):h===n.A.cA?(this.add(a,l,u|f),this.add(a,l+1,d),this.add(a+1,l,c)):h===n.A.yA?(this.add(a,l,d|f),this.add(a+1,l,c),this.add(a,l-1,u)):h===n.A.fA&&(this.add(a,l,d|c),this.add(a,l-1,u),this.add(a-1,l,f))),o&&this.dA(t,i,e,h,!1)};gA=(t,i,e,h,o)=>{const a=t-this.offsetX,l=i-this.hA,c=o?s.A.Ky:s.A.Fy,f=o?s.A.Gy:s.A.ky,u=o?s.A.Py:s.A.Ly,d=o?s.A.Hy:s.A.Dy,w=o?s.A.Uy:s.A.Sy,y=o?s.A.Yy:s.A.My,A=o?s.A.Wy:s.A.xy,m=o?s.A.Vy:s.A.Ny;e===r.A.wA.id?h===n.A.rw?(this.remove(a,l,c),this.remove(a-1,l,f)):h===n.A.cA?(this.remove(a,l,u),this.remove(a,l+1,d)):h===n.A.yA?(this.remove(a,l,f),this.remove(a+1,l,c)):h===n.A.fA&&(this.remove(a,l,d),this.remove(a,l-1,u)):e===r.A.AA.id||e===r.A.mA.id?h===n.A.rw?(this.remove(a,l,w),this.remove(a-1,l+1,y)):h===n.A.cA?(this.remove(a,l,A),this.remove(a+1,l+1,m)):h===n.A.yA?(this.remove(a,l,y),this.remove(a+1,l-1,w)):h===n.A.fA&&(this.remove(a,l,m),this.remove(a-1,l-1,A)):e===r.A.pA.id&&(h===n.A.rw?(this.remove(a,l,u|c),this.remove(a-1,l,f),this.remove(a,l+1,d)):h===n.A.cA?(this.remove(a,l,u|f),this.remove(a,l+1,d),this.remove(a+1,l,c)):h===n.A.yA?(this.remove(a,l,d|f),this.remove(a+1,l,c),this.remove(a,l-1,u)):h===n.A.fA&&(this.remove(a,l,d|c),this.remove(a,l-1,u),this.remove(a-1,l,f))),o&&this.gA(t,i,e,h,!1)};IA=(t,i,e,h,a,l)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.hA,u=e-this.offsetX,d=h-this.hA,w=o.index(c,f);if(a===r.A.wA.id){if(l===n.A.rw){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.tA)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Jy)===s.A.OPEN)return!0}else if(l===n.A.cA){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.$y)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.eA)===s.A.OPEN)return!0}else if(l===n.A.yA){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.tA)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Jy)===s.A.OPEN)return!0}else if(l===n.A.fA){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.$y)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.eA)===s.A.OPEN)return!0}}else if(a===r.A.pA.id){if(l===n.A.rw){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.eA)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Jy)===s.A.OPEN)return!0}else if(l===n.A.cA){if(c===u-1&&f===d&&(this.flags[w]&s.A.$y)===s.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Jy)===s.A.OPEN)return!0}else if(l===n.A.yA){if(c===u-1&&f===d&&(this.flags[w]&s.A.$y)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.tA)===s.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(l===n.A.fA){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.tA)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.eA)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(a===r.A._A.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ly)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.ky)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Fy)===s.A.OPEN)return!0}return!1};CA=(t,i,e,h,a,l)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.hA,u=e-this.offsetX,d=h-this.hA,w=o.index(c,f);if(a===r.A.EA.id||a===r.A.vA.id){if(a===r.A.vA.id&&(l=l+2&3),l===n.A.rw){if(c===u+1&&f===d&&(this.flags[w]&s.A.Fy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ly)===s.A.OPEN)return!0}else if(l===n.A.cA){if(c===u-1&&f===d&&(this.flags[w]&s.A.ky)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ly)===s.A.OPEN)return!0}else if(l===n.A.yA){if(c===u-1&&f===d&&(this.flags[w]&s.A.ky)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(l===n.A.fA){if(c===u+1&&f===d&&(this.flags[w]&s.A.Fy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}}else if(a===r.A.bA.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ly)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.ky)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Fy)===s.A.OPEN)return!0}return!1};TA=(t,i,e,n,r,a,l)=>{const c=e+r-1,f=n+a-1,u=o.index(t-this.offsetX,i-this.hA);return t>=e&&t<=c&&i>=n&&i<=f||(t===e-1&&i>=n&&i<=f&&(this.flags[u]&s.A.ky)===s.A.OPEN&&(l&h.A.rw)===s.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&s.A.Fy)===s.A.OPEN&&(l&h.A.yA)===s.A.OPEN||(i===n-1&&t>=e&&t<=c&&(this.flags[u]&s.A.Ly)===s.A.OPEN&&(l&h.A.fA)===s.A.OPEN||i===f+1&&t>=e&&t<=c&&(this.flags[u]&s.A.Dy)===s.A.OPEN&&(l&h.A.cA)===s.A.OPEN)))};add=(t,i,e)=>{this.flags[o.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[o.index(t,i)]&=s.A.rA-e}}},4909:(t,i,e)=>{e.d(i,{A:()=>s});class s{static cA=1;static yA=2;static fA=4;static rw=8}},6169:(t,i,e)=>{e.d(i,{A:()=>s});class s{static rw=0;static cA=1;static yA=2;static fA=3}},5599:(t,i,e)=>{e.d(i,{A:()=>s});class s{static OA=0;static RA=1;static SA=2;static LA=3}},1023:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5599);class n{static wA=new n(0,s.A.OA);static AA=new n(1,s.A.OA);static pA=new n(2,s.A.OA);static mA=new n(3,s.A.OA);static xA=new n(4,s.A.RA);static kA=new n(5,s.A.RA);static EA=new n(6,s.A.RA);static vA=new n(7,s.A.RA);static bA=new n(8,s.A.RA);static _A=new n(9,s.A.SA);static Rd=new n(10,s.A.SA);static MA=new n(11,s.A.SA);static DA=new n(12,s.A.SA);static NA=new n(13,s.A.SA);static FA=new n(14,s.A.SA);static BA=new n(15,s.A.SA);static UA=new n(16,s.A.SA);static PA=new n(17,s.A.SA);static WA=new n(18,s.A.SA);static GA=new n(19,s.A.SA);static YA=new n(20,s.A.SA);static HA=new n(21,s.A.SA);static LA=new n(22,s.A.LA);static values(){return[this.wA,this.AA,this.PA,this.BA,this.pA,this.FA,this._A,this.mA,this.LA,this.DA,this.MA,this.EA,this.YA,this.Rd,this.kA,this.NA,this.vA,this.xA,this.UA,this.bA,this.GA,this.HA,this.WA]}static of(t){const i=this.values();for(let e=0;e{e.d(i,{A:()=>A});var s=e(670),n=e(2164),r=e(1069),h=e(4583),o=e(3045),a=e(5637),l=e(4197),c=e(1312),f=e(1023),u=e(6169),d=e(9298),w=e(5518),y=e(3867);class A{static VA=Int8Array.of(1,2,4,8);static KA=Uint8Array.of(16,32,64,128);static XA=Int8Array.of(1,0,-1,0);static jA=Int8Array.of(0,-1,0,1);static zA=(17*Math.random()|0)-8;static ZA=(33*Math.random()|0)-16;static et=!0;static qA=0;static JA=!1;static $A=(t,i)=>{let e=this.QA(t+45365,i+91923,4)+(this.QA(t+10294,i+37821,2)-128>>1)+(this.QA(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static QA=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.tm(s,r),a=this.tm(s+1,r),l=this.tm(s,r+1),c=this.tm(s+1,r+1),f=this.im(o,a,n,e),u=this.im(l,c,n,e);return this.im(f,u,h,e)};static im=(t,i,e,s)=>{const n=65536-h.A.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static tm=(t,i)=>((this.sm(t-1,i-1)+this.sm(t+1,i-1)+this.sm(t-1,i+1)+this.sm(t+1,i+1))/16|0)+((this.sm(t-1,i)+this.sm(t+1,i)+this.sm(t,i-1)+this.sm(t,i+1))/8|0)+(this.sm(t,i)/4|0);static sm=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static lA=(t,i,e,s,n,r,h,o,d,w,y)=>{const m=n[y][i][e],p=n[y][i+1][e],g=n[y][i+1][e+1],I=n[y][i][e+1],_=m+p+g+I>>2,C=a.A.get(o);let E=i+(e<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A.LA.id)s?.nm(C.pl(f.A.LA.id,w,m,p,g,I,-1),t,i,e,_,E,v),C.xd&&C.active&&h?.oA(i,e),-1!==C.ga&&r.rm(new l.A(o,t,3,i,e,c.A.Do[C.ga],!0));else if(d===f.A.Rd.id||d===f.A.MA.id){const n=C.pl(f.A.Rd.id,w,m,p,g,I,-1);if(n){let r,h,o=0;d===f.A.MA.id&&(o+=256),w===u.A.cA||w===u.A.fA?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.lA(t,i,e,_,n,null,E,v,r,h,o)}C.xd&&h?.lA(i,e,C.width,C.length,w,C.kd),-1!==C.ga&&r.rm(new l.A(o,t,2,i,e,c.A.Do[C.ga],!0))}else if(d>=f.A.DA.id)s?.lA(t,i,e,_,C.pl(d,w,m,p,g,I,-1),null,E,v,1,1,0),C.xd&&h?.lA(i,e,C.width,C.length,w,C.kd),-1!==C.ga&&r.rm(new l.A(o,t,2,i,e,c.A.Do[C.ga],!0));else if(d===f.A.wA.id)s?.dA(t,i,e,_,A.VA[w],0,C.pl(f.A.wA.id,w,m,p,g,I,-1),null,E,v),C.xd&&h?.dA(i,e,d,w,C.kd),-1!==C.ga&&r.rm(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0));else if(d===f.A.AA.id)s?.dA(t,i,e,_,A.KA[w],0,C.pl(f.A.AA.id,w,m,p,g,I,-1),null,E,v),C.xd&&h?.dA(i,e,d,w,C.kd),-1!==C.ga&&r.rm(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0));else if(d===f.A.pA.id){const n=w+1&3;s?.dA(t,i,e,_,A.VA[w],A.VA[n],C.pl(f.A.pA.id,w+4,m,p,g,I,-1),C.pl(f.A.pA.id,n,m,p,g,I,-1),E,v),C.xd&&h?.dA(i,e,d,w,C.kd),-1!==C.ga&&r.rm(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0))}else if(d===f.A.mA.id)s?.dA(t,i,e,_,A.KA[w],0,C.pl(f.A.mA.id,w,m,p,g,I,-1),null,E,v),C.xd&&h?.dA(i,e,d,w,C.kd),-1!==C.ga&&r.rm(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0));else if(d===f.A._A.id)s?.lA(t,i,e,_,C.pl(d,w,m,p,g,I,-1),null,E,v,1,1,0),C.xd&&h?.lA(i,e,C.width,C.length,w,C.kd),-1!==C.ga&&r.rm(new l.A(o,t,2,i,e,c.A.Do[C.ga],!0));else if(d===f.A.xA.id)s?.hm(t,i,e,_,0,0,E,C.pl(f.A.xA.id,u.A.rw,m,p,g,I,-1),v,512*w,A.VA[w]),-1!==C.ga&&r.rm(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0));else if(d===f.A.kA.id){let n=16;if(s){const r=s.om(t,i,e);r>0&&(n=a.A.get(r>>14&32767).Fd)}s?.hm(t,i,e,_,A.XA[w]*n,A.jA[w]*n,E,C.pl(f.A.xA.id,u.A.rw,m,p,g,I,-1),v,512*w,A.VA[w]),-1!==C.ga&&r.rm(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0))}else d===f.A.EA.id?(s?.hm(t,i,e,_,0,0,E,C.pl(f.A.xA.id,u.A.rw,m,p,g,I,-1),v,w,256),-1!==C.ga&&r.rm(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0))):d===f.A.vA.id?(s?.hm(t,i,e,_,0,0,E,C.pl(f.A.xA.id,u.A.rw,m,p,g,I,-1),v,w,512),-1!==C.ga&&r.rm(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0))):d===f.A.bA.id&&(s?.hm(t,i,e,_,0,0,E,C.pl(f.A.xA.id,u.A.rw,m,p,g,I,-1),v,w,768),-1!==C.ga&&r.rm(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0)))};am;lm;Hr;Vr;fm;um;dm;wm;ym;Am;pm;gm;Im;_m;Cm;Em;constructor(t,i,e,n){this.am=t,this.lm=i,this.Hr=e,this.Vr=n,this.fm=new y.vm(s.A.Dr,t,i),this.um=new y.vm(s.A.Dr,t,i),this.dm=new y.vm(s.A.Dr,t,i),this.wm=new y.vm(s.A.Dr,t,i),this.Em=new y.bm(s.A.Dr,t+1,i+1),this.ym=new y.vm(s.A.Dr,t+1,i+1),this.Am=new y.Xr(t+1,i+1),this.pm=new Int32Array(i),this.gm=new Int32Array(i),this.Im=new Int32Array(i),this._m=new Int32Array(i),this.Cm=new Int32Array(i)}Tm=(t,i)=>{for(let t=0;t=0&&i[s]?.oA(e,n)}A.zA+=(5*Math.random()|0)-2,A.zA<-8?A.zA=-8:A.zA>8&&(A.zA=8),A.ZA+=(5*Math.random()|0)-2,A.ZA<-16?A.ZA=-16:A.ZA>16&&(A.ZA=16);for(let i=0;i>8;for(let t=1;t>2)+(e[n+1][t]>>3)+(e[n][t-1]>>2)+(e[n][t+1]>>3)+(e[n][t]>>1);this.Am[n][t]=u-d}for(let t=0;t=0&&s0){const i=n.A.Do[e-1];this.pm[t]+=i.dd,this.gm[t]+=i.ld,this.Im[t]+=i.fd,this._m[t]+=i.ud,r=this.Cm[t]++}}const h=e-5;if(h>=0&&h0){const i=n.A.Do[e-1];this.pm[t]-=i.dd,this.gm[t]-=i.ld,this.Im[t]-=i.fd,this._m[t]-=i.ud,r=this.Cm[t]--}}}if(e>=1&&e=0&&f=0&&y=1&&c0||y>0){const m=this.Hr[i][e][c],p=this.Hr[i][e+1][c],g=this.Hr[i][e+1][c+1],I=this.Hr[i][e][c+1],_=this.Am[e][c],C=this.Am[e+1][c],E=this.Am[e+1][c+1],v=this.Am[e][c+1];let b=-1,T=-1;if(f>0){const t=256*s/a|0,i=r/l|0;let e=o/l|0;b=n.A.ed(t,i,e);const h=t+A.zA&255;e+=A.ZA,e<0?e=0:e>255&&(e=255),T=n.A.ed(h,i,e)}if(i>0){let t=0!==f||this.dm[i][e][c]===w.A.Rm;y>0&&!n.A.Do[y-1].od&&(t=!1),t&&m===p&&m===g&&m===I&&(this.Em[i][e][c]|=2340)}let O=0;if(-1!==b&&(O=h.A.palette[n.A.sd(T,96)]),0===y)t?.Sm(i,e,c,w.A.Rm,u.A.rw,-1,m,p,g,I,n.A.sd(b,_),n.A.sd(b,C),n.A.sd(b,E),n.A.sd(b,v),d.A.Za,d.A.Za,d.A.Za,d.A.Za,O,d.A.Za);else{const s=this.dm[i][e][c]+1,r=this.wm[i][e][c],o=n.A.Do[y-1];let a,l,f=o.texture;f>=0?(l=h.A.Lm(f),a=-1):o.rd===d.A.xm?(l=0,a=-2,f=-1):(a=n.A.ed(o.ad,o.ld,o.fd),l=h.A.palette[n.A.nd(o.wd,96)]),t?.Sm(i,e,c,s,r,f,m,p,g,I,n.A.sd(b,_),n.A.sd(b,C),n.A.sd(b,E),n.A.sd(b,v),n.A.nd(a,_),n.A.nd(a,C),n.A.nd(a,E),n.A.nd(a,v),O,l)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let s=0;s<=n;s++)for(let r=0;r<=this.lm;r++)for(let h=0;h<=this.am;h++){if(this.Em[s][h][r]&t){let i=r,e=r,a=s,l=s;for(;i>0&&this.Em[s][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.Em[a-1][h][s]&t))break t;a--}t:for(;l=8){const s=this.Hr[l][h][i]-240,r=this.Hr[a][h][i];o.A.Nm(n,1,128*h,s,128*i,128*h,r,128*e+128);for(let s=a;s<=l;s++)for(let n=i;n<=e;n++)this.Em[s][h][n]&=~t}}if(this.Em[s][h][r]&i){let t=h,e=h,a=s,l=s;for(;t>0&&this.Em[s][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.Em[a-1][s][r]&i))break t;a--}t:for(;l=8){const s=this.Hr[l][t][r]-240,h=this.Hr[a][t][r];o.A.Nm(n,2,128*t,s,128*r,128*e+128,h,128*r);for(let s=a;s<=l;s++)for(let n=t;n<=e;n++)this.Em[s][n][r]&=~i}}if(this.Em[s][h][r]&e){let t=h,i=h,a=r,l=r;for(;a>0&&this.Em[s][h][a-1]&e;)a--;for(;l0;){for(let i=a;i<=l;i++)if(!(this.Em[s][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.Hr[s][t][a];o.A.Nm(n,4,128*t,r,128*a,128*i+128,r,128*l+128);for(let n=t;n<=i;n++)for(let t=a;t<=l;t++)this.Em[s][n][t]&=~e}}}}}};Fm=(t,i,e,r)=>{let h=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new r.A(new Uint8Array(h));for(let r=0;r=0&&l=0&&c>24,this.wm[r][l][c]=(f-2&3)<<24>>24):f<=81?this.Vr[r][l][c]=f-49<<24>>24:this.fm[r][l][c]=f-81<<24>>24}else for(;f=o.Wu,0!==f;){if(1===f){o.Wu;break}f<=49&&o.Wu}}};Um=(t,i,e,n,h,o)=>{const a=new r.A(new Uint8Array(n));let l=-1;for(;;){const n=a.Pm;if(0===n)return;l+=n;let r=0;for(;;){const n=a.Pm;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=a.Wu,w=d>>2,y=3&d,A=f+h,m=c+o;if(A>0&&m>0&&A=0&&(n=e[s]),this.lA(u,A,m,t,i,n,l,w,y)}}}};lA=(t,i,e,s,n,r,h,o,d)=>{if(A.et){if(16&this.Vr[t][i][e])return;if(this.Om(t,i,e)!==A.qA)return}const w=this.Hr[t][i][e],y=this.Hr[t][i+1][e],m=this.Hr[t][i+1][e+1],p=this.Hr[t][i][e+1],g=w+y+m+p>>2,I=a.A.get(h);let _=i+(e<<7)+(h<<14)+1073741824|0;I.active||(_+=-2147483648),_|=0;const C=(d<<6)+o<<24>>24;if(o===f.A.LA.id)(!A.et||I.active||I.qd)&&(s?.nm(I.pl(f.A.LA.id,d,w,y,m,p,-1),t,i,e,g,_,C),I.xd&&I.active&&r?.oA(i,e),-1!==I.ga&&n.rm(new l.A(h,t,3,i,e,c.A.Do[I.ga],!0)));else if(o===f.A.Rd.id||o===f.A.MA.id){const a=I.pl(f.A.Rd.id,d,w,y,m,p,-1);if(a){let n,r,h=0;if(o===f.A.MA.id&&(h+=256),d===u.A.cA||d===u.A.fA?(n=I.length,r=I.width):(n=I.width,r=I.length),s?.lA(t,i,e,g,a,null,_,C,n,r,h)&&I.Yd)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=a.Wm/4|0;r>30&&(r=30),r>this.ym[t][i+s][e+n]&&(this.ym[t][i+s][e+n]=r<<24>>24)}}I.xd&&r?.lA(i,e,I.width,I.length,d,I.kd),-1!==I.ga&&n.rm(new l.A(h,t,2,i,e,c.A.Do[I.ga],!0))}else if(o>=f.A.DA.id)s?.lA(t,i,e,g,I.pl(o,d,w,y,m,p,-1),null,_,C,1,1,0),o>=f.A.DA.id&&o<=f.A.PA.id&&o!==f.A.NA.id&&t>0&&(this.Em[t][i][e]|=2340),I.xd&&r?.lA(i,e,I.width,I.length,d,I.kd),-1!==I.ga&&n.rm(new l.A(h,t,2,i,e,c.A.Do[I.ga],!0));else if(o===f.A.wA.id)s?.dA(t,i,e,g,A.VA[d],0,I.pl(f.A.wA.id,d,w,y,m,p,-1),null,_,C),d===u.A.rw?(I.Yd&&(this.ym[t][i][e]=50,this.ym[t][i][e+1]=50),I.od&&(this.Em[t][i][e]|=585)):d===u.A.cA?(I.Yd&&(this.ym[t][i][e+1]=50,this.ym[t][i+1][e+1]=50),I.od&&(this.Em[t][i][e+1]|=1170)):d===u.A.yA?(I.Yd&&(this.ym[t][i+1][e]=50,this.ym[t][i+1][e+1]=50),I.od&&(this.Em[t][i+1][e]|=585)):d===u.A.fA&&(I.Yd&&(this.ym[t][i][e]=50,this.ym[t][i+1][e]=50),I.od&&(this.Em[t][i][e]|=1170)),I.xd&&r?.dA(i,e,o,d,I.kd),-1!==I.ga&&n.rm(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0)),16!==I.Fd&&s?.Gm(t,i,e,I.Fd);else if(o===f.A.AA.id)s?.dA(t,i,e,g,A.KA[d],0,I.pl(f.A.AA.id,d,w,y,m,p,-1),null,_,C),I.Yd&&(d===u.A.rw?this.ym[t][i][e+1]=50:d===u.A.cA?this.ym[t][i+1][e+1]=50:d===u.A.yA?this.ym[t][i+1][e]=50:d===u.A.fA&&(this.ym[t][i][e]=50)),I.xd&&r?.dA(i,e,o,d,I.kd),-1!==I.ga&&n.rm(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0));else if(o===f.A.pA.id){const a=d+1&3;s?.dA(t,i,e,g,A.VA[d],A.VA[a],I.pl(f.A.pA.id,d+4,w,y,m,p,-1),I.pl(f.A.pA.id,a,w,y,m,p,-1),_,C),I.od&&(d===u.A.rw?(this.Em[t][i][e]|=265,this.Em[t][i][e+1]|=1170):d===u.A.cA?(this.Em[t][i][e+1]|=1170,this.Em[t][i+1][e]|=585):d===u.A.yA?(this.Em[t][i+1][e]|=585,this.Em[t][i][e]|=1170):d===u.A.fA&&(this.Em[t][i][e]|=1170,this.Em[t][i][e]|=585)),I.xd&&r?.dA(i,e,o,d,I.kd),-1!==I.ga&&n.rm(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0)),16!==I.Fd&&s?.Gm(t,i,e,I.Fd)}else if(o===f.A.mA.id)s?.dA(t,i,e,g,A.KA[d],0,I.pl(f.A.mA.id,d,w,y,m,p,-1),null,_,C),I.Yd&&(d===u.A.rw?this.ym[t][i][e+1]=50:d===u.A.cA?this.ym[t][i+1][e+1]=50:d===u.A.yA?this.ym[t][i+1][e]=50:d===u.A.fA&&(this.ym[t][i][e]=50)),I.xd&&r?.dA(i,e,o,d,I.kd),-1!==I.ga&&n.rm(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0));else if(o===f.A._A.id)s?.lA(t,i,e,g,I.pl(o,d,w,y,m,p,-1),null,_,C,1,1,0),I.xd&&r?.lA(i,e,I.width,I.length,d,I.kd),-1!==I.ga&&n.rm(new l.A(h,t,2,i,e,c.A.Do[I.ga],!0));else if(o===f.A.xA.id)s?.hm(t,i,e,g,0,0,_,I.pl(f.A.xA.id,u.A.rw,w,y,m,p,-1),C,512*d,A.VA[d]),-1!==I.ga&&n.rm(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0));else if(o===f.A.kA.id){let r=16;if(s){const n=s.om(t,i,e);n>0&&(r=a.A.get(n>>14&32767).Fd)}s?.hm(t,i,e,g,A.XA[d]*r,A.jA[d]*r,_,I.pl(f.A.xA.id,u.A.rw,w,y,m,p,-1),C,512*d,A.VA[d]),-1!==I.ga&&n.rm(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0))}else o===f.A.EA.id?(s?.hm(t,i,e,g,0,0,_,I.pl(f.A.xA.id,u.A.rw,w,y,m,p,-1),C,d,256),-1!==I.ga&&n.rm(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0))):o===f.A.vA.id?(s?.hm(t,i,e,g,0,0,_,I.pl(f.A.xA.id,u.A.rw,w,y,m,p,-1),C,d,512),-1!==I.ga&&n.rm(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0))):o===f.A.bA.id&&(s?.hm(t,i,e,g,0,0,_,I.pl(f.A.xA.id,u.A.rw,w,y,m,p,-1),C,d,768),-1!==I.ga&&n.rm(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0)))};Om=(t,i,e)=>8&this.Vr[t][i][e]?0:t<=0||!(2&this.Vr[1][i][e])?t:t-1}},3045:(t,i,e)=>{e.d(i,{A:()=>g});var s=e(4583),n=e(1161),r=e(3795),h=e(8256),o=e(670),a=e(9222),l=e(6855),c=e(7441),f=e(6666),u=e(5748),d=e(3479),w=e(8950),y=e(2771),A=e(5518),m=e(6169),p=e(3867);class g{static Ym=new p.Hm(8,32,51,51,!1);static Vm=new p.fe(100,null);static Km=new Int32Array(o.A.Dr);static Xm=new p.jm(o.A.Dr,500,null);static zm=new p.fe(500,null);static Zm=new f.A;static qm=0;static Jm=0;static $m=0;static Qm=0;static tp=0;static ip=0;static ep=0;static sp=0;static np=0;static rp=0;static hp=0;static op=0;static ap=0;static lp=0;static cp=0;static fp=0;static up=0;static dp=0;static wp=0;static yp=0;static Ap=0;static mp=0;static pp=!1;static gp=null;static Ip=Uint8Array.of(19,55,38,155,255,110,137,205,76);static _p=Uint8Array.of(160,192,80,96,0,144,80,48,160);static Cp=Uint8Array.of(76,8,137,4,0,1,38,2,19);static Ep=Int8Array.of(0,0,2,0,0,2,1,1,0);static vp=Int8Array.of(2,0,0,2,0,0,0,4,4);static bp=Int8Array.of(0,4,4,8,0,0,8,0,0);static Tp=Int8Array.of(1,1,0,0,0,8,0,0,8);static Op=Int8Array.of(53,-53,-53,53);static Rp=Int8Array.of(-53,-53,53,53);static Sp=Int8Array.of(-45,45,45,-45);static Lp=Int8Array.of(45,45,-45,-45);static xp=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static kp=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static Mp=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static Dp=0;static Ha=0;static Va=0;static Np=-1;static Fp=-1;static et=!0;static init=(t,i,e,n,r)=>{this.Jm=0,this.$m=0,this.Qm=t,this.tp=i,this.ip=t/2|0,this.ep=i/2|0;const h=new p.Hm(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.sp=s.A.sin[t],this.np=s.A.cos[t],this.rp=s.A.sin[i],this.hp=s.A.cos[i];const o=(t-128)/32|0,a=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const s=128*t,l=128*i;let c=!1;for(let t=-e;t<=n;t+=128)if(this.Bp(s,l,r[o]+t)){c=!0;break}h[o][a][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let r=-1;r<=1;r++)for(let o=-1;o<=1;o++){if(h[t][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}}this.Ym[t][i][e+25][s+25]=n}};static So=()=>{this.Vm=null,this.Km=null,this.Xm=null,this.Zm=null,this.Ym=null,this.zm=null,this.gp=null,console.log('World3D unloaded!')};static Nm=(t,i,e,s,n,r,o,a)=>{g.Xm[t][g.Km[t]++]=new h.A(e/128|0,r/128|0,n/128|0,a/128|0,i,e,r,n,a,s,o)};static Bp=(t,i,e)=>{const s=i*this.rp+t*this.hp>>16,n=i*this.hp-t*this.rp>>16,r=e*this.sp+n*this.np>>16,h=e*this.np-n*this.sp>>16;if(r<50||r>3500)return!1;const o=this.ip+((s<<9)/r|0),a=this.ep+((h<<9)/r|0);return o>=this.Jm&&o<=this.Qm&&a>=this.$m&&a<=this.tp};Up;am;lm;Pp;Wp;_h;Gp;Yp;Hp;Vp=0;Kp=0;Xp=0;constructor(t,i,e,s){this.Up=e,this.am=s,this.lm=i,this.Wp=new p.Eh(e,s,i,null),this.Gp=new p.bm(e,s+1,i+1),this.Pp=t,this._h=new p.fe(5e3,null),this.Yp=new Int32Array(1e4),this.Hp=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.Kp=t;for(let i=0;i{const e=this.Wp[0][t][i];for(let e=0;e<3;e++){this.Wp[e][t][i]=this.Wp[e+1][t][i];const s=this.Wp[e][t][i];s&&s.level--}this.Wp[0][t][i]||(this.Wp[0][t][i]=new r.A(0,t,i));const s=this.Wp[0][t][i];s&&(s.zp=e),this.Wp[3][t][i]=null};km=(t,i,e,s)=>{const n=this.Wp[t][i][e];n&&(n.Zp=s)};Sm=(t,i,e,s,n,h,o,a,l,c,f,u,w,m,p,g,I,_,C,E)=>{if(s===A.A.Rm){for(let s=t;s>=0;s--)this.Wp[s][i][e]||(this.Wp[s][i][e]=new r.A(s,i,e));const s=this.Wp[t][i][e];s&&(s.qp=new d.A(f,u,w,m,-1,C,!1))}else if(s===A.A.Jp){for(let s=t;s>=0;s--)this.Wp[s][i][e]||(this.Wp[s][i][e]=new r.A(s,i,e));const s=this.Wp[t][i][e];s&&(s.qp=new d.A(p,g,I,_,h,E,o===a&&o===l&&o===c))}else{for(let s=t;s>=0;s--)this.Wp[s][i][e]||(this.Wp[s][i][e]=new r.A(s,i,e));const d=this.Wp[t][i][e];d&&(d.$p=new y.A(i,s,g,a,w,n,f,c,E,p,h,_,C,l,I,m,o,e,u))}};nm=(t,i,e,s,n,h,o)=>{this.Wp[i][e][s]||(this.Wp[i][e][s]=new r.A(i,e,s));const l=this.Wp[i][e][s];l&&(l.Qp=new a.A(n,128*e+64,128*s+64,t,h,o))};tg=(t,i,e)=>{const s=this.Wp[t][i][e];s&&(s.Qp=null)};ig=(t,i,e,s,n,h,o,a)=>{let l=0;const c=this.Wp[s][t][i];if(c)for(let t=0;tl&&(l=e)}else this.Wp[s][t][i]=new r.A(s,t,i);const f=this.Wp[s][t][i];f&&(f.ng=new u.A(e,128*t+64,128*i+64,h,o,a,n,l))};rg=(t,i,e)=>{const s=this.Wp[t][i][e];s&&(s.ng=null)};dA=(t,i,e,s,n,h,o,a,c,f)=>{if(!o&&!a)return;for(let s=t;s>=0;s--)this.Wp[s][i][e]||(this.Wp[s][i][e]=new r.A(s,i,e));const u=this.Wp[t][i][e];u&&(u.hg=new l.A(s,128*i+64,128*e+64,n,h,o,a,c,f))};gA=(t,i,e,s)=>{const n=this.Wp[t][i][e];1===s&&n&&(n.hg=null)};hm=(t,i,e,s,n,h,o,a,l,f,u)=>{if(!a)return;for(let s=t;s>=0;s--)this.Wp[s][i][e]||(this.Wp[s][i][e]=new r.A(s,i,e));const d=this.Wp[t][i][e];d&&(d.og=new c.A(s,128*i+n+64,128*e+h+64,u,f,a,o,l))};ag=(t,i,e)=>{const s=this.Wp[t][i][e];s&&(s.og=null)};Gm=(t,i,e,s)=>{const n=this.Wp[t][i][e];if(!n)return;const r=n.og;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};lg=(t,i,e,s)=>{if(!s)return;const n=this.Wp[t][i][e];if(!n)return;const r=n.og;r&&(r.model=s)};cg=(t,i,e,s)=>{if(!s)return;const n=this.Wp[t][i][e];if(!n)return;const r=n.Qp;r&&(r.model=s)};fg=(t,i,e,s)=>{if(!s)return;const n=this.Wp[t][i][e];if(!n)return;const r=n.hg;r&&(r.ug=s)};dg=(t,i,e,s,n)=>{if(!s)return;const r=this.Wp[e][t][i];if(!r)return;const h=r.hg;h&&(h.ug=s,h.wg=n)};lA=(t,i,e,s,n,r,h,o,a,l,c)=>{if(!n&&!r)return!0;const f=128*i+64*a,u=128*e+64*l;return this.yg(f,u,s,t,i,e,a,l,n,r,h,o,c,!1)};Ag=(t,i,e,s,n,r,h,o,a,l)=>{if(!n&&!r)return!0;let c=i-a,f=s-a,u=i+a,d=s+a;return l&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.yg(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};mg=(t,i,e,s,n,r,h,o,a,l,c,f)=>!a&&!l||this.yg(i,s,e,t,n,r,h+1-n,o-r+1,a,l,c,0,f,!0);uA=(t,i,e)=>{const s=this.Wp[t][i][e];if(s)for(let t=0;t>29&3)&&n.gg===i&&n.Ig===e)return void this._g(n)}};Cg=(t,i,e,s)=>{if(!s)return;const n=this.Wp[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};Eg=()=>{for(let t=0;t{const s=this.Wp[t][i][e];return s&&s.hg?s.hg.pg:0};vg=(t,i,e)=>{const s=this.Wp[t][e][i];return s&&s.og?s.og.pg:0};bg=(t,i,e)=>{const s=this.Wp[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.gg===i&&n.Ig===e)return n.pg}return 0};Tg=(t,i,e)=>{const s=this.Wp[t][i][e];return s&&s.Qp?s.Qp.pg:0};Og=(t,i,e,s)=>{const n=this.Wp[t][i][e];if(n){if(n.hg&&n.hg.pg===s)return 255&n.hg.info;if(n.og&&n.og.pg===s)return 255&n.og.info;if(n.Qp&&n.Qp.pg===s)return 255&n.Qp.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.Wp[t][i+1][e-1];n&&n.Qp&&n.Qp.model&&n.Qp.model.Rg&&this.Lg(s,n.Qp.model,128,0,-128,!0)}};Sg=(t,i,e,s,n,r)=>{let h=!0,o=i;const a=i+s,l=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.Up){for(let u=o;u<=a;u++)if(!(u<0||u>=this.am))for(let o=l;o<=c;o++){if(o<0||o>=this.lm||h&&u=e||u===i))continue;const l=this.Wp[f][u][o];if(!l)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.Pp[f][u][o]+this.Pp[f][u+1][o]+this.Pp[f][u][o+1]+this.Pp[f][u+1][o+1])/4|0)-((this.Pp[t][i][e]+this.Pp[t][i+1][e]+this.Pp[t][i][e+1]+this.Pp[t][i+1][e+1])/4|0),A=l.hg;A&&A.ug&&A.ug.Rg&&this.Lg(r,A.ug,d,y,w,h),A&&A.wg&&A.wg.Rg&&this.Lg(r,A.wg,d,y,w,h);for(let t=0;t{this.Xp++;let h=0;const o=i.tw,a=i.Qd;if(t.Rg&&t.Ng)for(let r=0;ri.Fg)continue;const u=t.tw[r]-e;if(ui.Ug)continue;const d=t.iw[r]-n;if(di.Wg)continue;if(i.Rg&&i.Ng)for(let t=0;t{const h=this.Wp[t][i][e];if(!h)return;const o=h.qp;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const a=h.$p;if(!a)return;const l=a.shape,c=a.angle,f=a.jg,u=a.zg,d=g.xp[l],w=g.kp[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{g.pp=!0,g.Ha=t,g.Va=i,g.Np=-1,g.Fp=-1};draw=(t,i,e,n,r,h,o)=>{t<0?t=0:t>=128*this.am&&(t=128*this.am-1),e<0?e=0:e>=128*this.lm&&(e=128*this.lm-1),g.qm++,g.sp=s.A.sin[h],g.np=s.A.cos[h],g.rp=s.A.sin[r],g.hp=s.A.cos[r],g.gp=g.Ym[(h-128)/32|0][r/64|0],g.op=t,g.ap=i,g.lp=e,g.cp=t/128|0,g.fp=e/128|0,g.Ap=n,g.up=g.cp-25,g.up<0&&(g.up=0),g.wp=g.fp-25,g.wp<0&&(g.wp=0),g.dp=g.cp+25,g.dp>this.am&&(g.dp=this.am),g.yp=g.fp+25,g.yp>this.lm&&(g.yp=this.lm),this.Zg(),g.mp=0;for(let t=this.Kp;t=2e3)?(h.visible=!0,h.update=!0,h.qg=h.eg>0,g.mp++):(h.visible=!1,h.update=!1,h.Jg=0))}}for(let t=this.Kp;t=g.dp))for(let t=-25;t<=0;t++){const n=g.fp+t,r=g.fp-t;let h;if(e>=g.up&&(n>=g.wp&&(h=i[e][n],h&&h.visible&&this.$g(h,!0,o)),r=g.wp&&(h=i[s][n],h&&h.visible&&this.$g(h,!0,o)),r=g.dp))for(let t=-25;t<=0;t++){const n=g.fp+t,r=g.fp-t;let h;if(e>=g.up&&(n>=g.wp&&(h=i[e][n],h&&h.visible&&this.$g(h,!1,o)),r=g.wp&&(h=i[s][n],h&&h.visible&&this.$g(h,!1,o)),r{if(!c&&!f)return!1;for(let t=h;t=this.am||i>=this.lm)return!1;const e=this.Wp[s][t][i];if(e&&e.eg>=5)return!1}const A=new n.A(s,e,t,i,c,f,w,h,h+a-1,o,o+l-1,u,d);for(let t=h;th&&(e|=1),to&&(e+=8),i=0;e--)this.Wp[e][t][i]||(this.Wp[e][t][i]=new r.A(e,t,i));const n=this.Wp[s][t][i];n&&(n.sg[n.eg]=A,n.Qg[n.eg]=e,n.tI|=e,n.eg++)}return y&&(this._h[this.Vp++]=A),!0};_g=t=>{for(let i=t.gg;i<=t.kg;i++)for(let e=t.Ig;e<=t.Mg;e++){const s=this.Wp[t.level][i][e];if(s){for(let i=0;i{const t=g.Km[g.Ap],i=g.Xm[g.Ap];g.Dp=0;for(let e=0;e=0&&s<=50){n=t.eI+25-g.fp,n<0&&(n=0),r=t.lm+25-g.fp,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.gp&&g.gp[s][n++]){i=!0;break}if(i){if(h=g.op-t.Bg,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.sI=(t.Pg-g.lp<<8)/h|0,t.nI=(t.Wg-g.lp<<8)/h|0,t.rI=(t.Fg-g.ap<<8)/h|0,t.hI=(t.cw-g.ap<<8)/h|0,g.zm[g.Dp++]=t}}}else if(2===t.type){if(s=t.eI+25-g.fp,s>=0&&s<=50){n=t.iI+25-g.cp,n<0&&(n=0),r=t.am+25-g.cp,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.gp&&g.gp[n++][s]){i=!0;break}if(i){if(h=g.lp-t.Pg,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.oI=(t.Bg-g.op<<8)/h|0,t.aI=(t.Ug-g.op<<8)/h|0,t.rI=(t.Fg-g.ap<<8)/h|0,t.hI=(t.cw-g.ap<<8)/h|0,g.zm[g.Dp++]=t}}}else if(4===t.type&&(s=t.Fg-g.ap,s>128&&(n=t.eI+25-g.fp,n<0&&(n=0),r=t.lm+25-g.fp,r>50&&(r=50),n<=r))){let i=t.iI+25-g.cp;i<0&&(i=0),h=t.am+25-g.cp,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(g.gp&&g.gp[t][i]){e=!0;break t}e&&(t.mode=5,t.oI=(t.Bg-g.op<<8)/s|0,t.aI=(t.Ug-g.op<<8)/s|0,t.sI=(t.Pg-g.lp<<8)/s|0,t.nI=(t.Wg-g.lp<<8)/s|0,g.zm[g.Dp++]=t)}}};$g=(t,i,e)=>{for(g.Zm.rm(t);;){let t;do{if(t=g.Zm.lI(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.cI,o=this.Wp[r];if(t.visible){if(i){if(r>0){const t=this.Wp[r-1][s][n];if(t&&t.update)continue}if(s<=g.cp&&s>g.up){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.tI)))continue}if(s>=g.cp&&sg.wp){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.tI)))continue}if(n>=g.fp&&nn&&(l+=6),c=g.Ip[l],t.AI=g.Cp[l]),f&&(f.mI&g._p[l]?16===f.mI?(t.Jg=3,t.pI=g.Ep[l],t.gI=3-t.pI):32===f.mI?(t.Jg=6,t.pI=g.vp[l],t.gI=6-t.pI):64===f.mI?(t.Jg=12,t.pI=g.bp[l],t.gI=12-t.pI):(t.Jg=9,t.pI=g.Tp[l],t.gI=9-t.pI):t.Jg=0,f.mI&c&&!this.II(h,s,n,f.mI)&&f.ug?.draw(0,g.sp,g.np,g.rp,g.hp,f.x-g.op,f.y-g.ap,f.z-g.lp,f.pg),f._I&c&&!this.II(h,s,n,f._I)&&f.wg?.draw(0,g.sp,g.np,g.rp,g.hp,f.x-g.op,f.y-g.ap,f.z-g.lp,f.pg)),u&&!this.visible(h,s,n,u.model.cw))if(u.type&c)u.model.draw(u.angle,g.sp,g.np,g.rp,g.hp,u.x-g.op,u.y-g.ap,u.z-g.lp,u.pg);else if(768&u.type){const t=u.x-g.op,i=u.y-g.ap,e=u.z-g.lp,s=u.angle;let n,r;if(n=s===m.A.cA||s===m.A.yA?-t:t,r=s===m.A.yA||s===m.A.fA?-e:e,256&u.type&&rn){const n=t+g.Sp[s],r=e+g.Lp[s];u.model.draw(512*s+1280&2047,g.sp,g.np,g.rp,g.hp,n,i,r,u.pg)}}if(a){const i=t.Qp;i&&i.model?.draw(0,g.sp,g.np,g.rp,g.hp,i.x-g.op,i.y-g.ap,i.z-g.lp,i.pg);const e=t.ng;e&&0===e.offset&&(e.CI&&e.CI.draw(0,g.sp,g.np,g.rp,g.hp,e.x-g.op,e.y-g.ap,e.z-g.lp,e.pg),e.EI&&e.EI.draw(0,g.sp,g.np,g.rp,g.hp,e.x-g.op,e.y-g.ap,e.z-g.lp,e.pg),e.vI&&e.vI.draw(0,g.sp,g.np,g.rp,g.hp,e.x-g.op,e.y-g.ap,e.z-g.lp,e.pg))}const d=t.tI;if(0!==d){if(sg.cp&&1&d){const t=o[s-1][n];t&&t.update&&g.Zm.rm(t)}if(n>g.fp&&8&d){const t=o[s][n-1];t&&t.update&&g.Zm.rm(t)}}}if(0!==t.Jg){let i=!0;for(let e=0;ei.gg&&(r+=1),ei.Ig&&(r+=8),ss&&(s=n);const h=g.fp-i.Ig,a=i.Mg-g.fp;i.bI=a>h?s+a:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.bI,i=e))}if(-1===i)break;const a=g.Vm[i];if(a){a.qm=g.qm;let t=a.model;t||(t=a.wI?.draw(e)??null),t&&!this.TI(h,a.gg,a.kg,a.Ig,a.Mg,t.cw)&&t.draw(a.yI,g.sp,g.np,g.rp,g.hp,a.x-g.op,a.y-g.ap,a.z-g.lp,a.pg);for(let t=a.gg;t<=a.kg;t++)for(let i=a.Ig;i<=a.Mg;i++){const e=o[t][i];e&&(0!==e.Jg?g.Zm.rm(e):t===s&&i===n||!e.update||g.Zm.rm(e))}}}if(t.qg)continue}if(!t.update||0!==t.Jg)continue;if(s<=g.cp&&s>g.up){const t=o[s-1][n];if(t&&t.update)continue}if(s>=g.cp&&sg.wp){const t=o[s][n-1];if(t&&t.update)continue}if(n>=g.fp&&n=r){const r=t+g.Op[n],h=s+g.Rp[n];i.model.draw(512*n+256,g.sp,g.np,g.rp,g.hp,r,e,h,i.pg)}if(512&i.type&&h<=r){const r=t+g.Sp[n],h=s+g.Lp[n];i.model.draw(512*n+1280&2047,g.sp,g.np,g.rp,g.hp,r,e,h,i.pg)}}const e=t.hg;e&&(e._I&t.AI&&!this.II(h,s,n,e._I)&&e.wg?.draw(0,g.sp,g.np,g.rp,g.hp,e.x-g.op,e.y-g.ap,e.z-g.lp,e.pg),e.mI&t.AI&&!this.II(h,s,n,e.mI)&&e.ug?.draw(0,g.sp,g.np,g.rp,g.hp,e.x-g.op,e.y-g.ap,e.z-g.lp,e.pg))}if(rg.cp){const t=o[s-1][n];t&&t.update&&g.Zm.rm(t)}if(n>g.fp){const t=o[s][n-1];t&&t.update&&g.Zm.rm(t)}}};uI=(t,i,e,n,r,h,o,a)=>{let l,c,f,u,d=l=(e<<7)-g.op,y=c=(n<<7)-g.lp,A=f=d+128,m=u=y+128,p=this.Pp[i][e][n]-g.ap,I=this.Pp[i][e+1][n]-g.ap,_=this.Pp[i][e+1][n+1]-g.ap,C=this.Pp[i][e][n+1]-g.ap,E=y*o+d*a>>16;if(y=y*a-d*o>>16,d=E,E=p*h-y*r>>16,y=p*r+y*h>>16,p=E,y<50)return;if(E=c*o+A*a>>16,c=c*a-A*o>>16,A=E,E=I*h-c*r>>16,c=I*r+c*h>>16,I=E,c<50)return;if(E=m*o+f*a>>16,m=m*a-f*o>>16,f=E,E=_*h-m*r>>16,m=_*r+m*h>>16,_=E,m<50)return;if(E=u*o+l*a>>16,u=u*a-l*o>>16,l=E,E=C*h-u*r>>16,u=C*r+u*h>>16,C=E,u<50)return;const v=s.A.yl+((d<<9)/y|0),b=s.A.Al+((p<<9)/y|0),T=s.A.yl+((A<<9)/c|0),O=s.A.Al+((I<<9)/c|0),R=s.A.yl+((f<<9)/m|0),S=s.A.Al+((_<<9)/m|0),L=s.A.yl+((l<<9)/u|0),x=s.A.Al+((C<<9)/u|0);if(s.A.alpha=0,(R-L)*(O-x)-(S-x)*(T-L)>0)if(s.A.OI=R<0||L<0||T<0||R>w.A.RI||L>w.A.RI||T>w.A.RI,g.pp&&this.SI(g.Ha,g.Va,S,x,O,R,L,T)&&(g.Np=e,g.Fp=n),-1===t.LI)12345678!==t.xI&&s.A.kI(R,L,T,S,x,O,t.xI,t.MI,t.DI);else if(g.et){const i=g.Mp[t.LI];s.A.kI(R,L,T,S,x,O,this.NI(i,t.xI),this.NI(i,t.MI),this.NI(i,t.DI))}else t.flat?s.A.FI(R,L,T,S,x,O,t.xI,t.MI,t.DI,d,p,y,A,l,I,C,c,u,t.LI):s.A.FI(R,L,T,S,x,O,t.xI,t.MI,t.DI,f,_,m,l,A,C,I,u,c,t.LI);if(!((v-T)*(x-O)-(b-O)*(L-T)<=0))if(s.A.OI=v<0||T<0||L<0||v>w.A.RI||T>w.A.RI||L>w.A.RI,g.pp&&this.SI(g.Ha,g.Va,b,O,x,v,T,L)&&(g.Np=e,g.Fp=n),-1!==t.LI){if(!g.et)return void s.A.FI(v,T,L,b,O,x,t.BI,t.DI,t.MI,d,p,y,A,l,I,C,c,u,t.LI);const i=g.Mp[t.LI];s.A.kI(v,T,L,b,O,x,this.NI(i,t.BI),this.NI(i,t.DI),this.NI(i,t.MI))}else 12345678!==t.BI&&s.A.kI(v,T,L,b,O,x,t.BI,t.DI,t.MI)};dI=(t,i,e,n,r,h,o)=>{let a=e.tw.length;for(let t=0;t>16;if(l=l*o-i*h>>16,i=c,c=a*r-l*n>>16,l=a*n+l*r>>16,a=c,l<50)return;e.UI&&(y.A.WI[t]=i,y.A.GI[t]=a,y.A.YI[t]=l),y.A.HI[t]=s.A.yl+((i<<9)/l|0),y.A.VI[t]=s.A.Al+((a<<9)/l|0)}s.A.alpha=0,a=e.KI.length;for(let n=0;n0)if(s.A.OI=a<0||l<0||c<0||a>w.A.RI||l>w.A.RI||c>w.A.RI,g.pp&&this.SI(g.Ha,g.Va,f,u,d,a,l,c)&&(g.Np=t,g.Fp=i),e.UI&&-1!==e.UI[n])if(g.et){const t=g.Mp[e.UI[n]];s.A.kI(a,l,c,f,u,d,this.NI(t,e.zI[n]),this.NI(t,e.ZI[n]),this.NI(t,e.qI[n]))}else e.flat?s.A.FI(a,l,c,f,u,d,e.zI[n],e.ZI[n],e.qI[n],y.A.WI[0],y.A.GI[0],y.A.YI[0],y.A.WI[1],y.A.WI[3],y.A.GI[1],y.A.GI[3],y.A.YI[1],y.A.YI[3],e.UI[n]):s.A.FI(a,l,c,f,u,d,e.zI[n],e.ZI[n],e.qI[n],y.A.WI[r],y.A.GI[r],y.A.YI[r],y.A.WI[h],y.A.WI[o],y.A.GI[h],y.A.GI[o],y.A.YI[h],y.A.YI[o],e.UI[n]);else 12345678!==e.zI[n]&&s.A.kI(a,l,c,f,u,d,e.zI[n],e.ZI[n],e.qI[n])}};fI=(t,i,e)=>{const s=this.Gp[t][i][e];if(s===-g.qm)return!1;if(s===g.qm)return!0;{const s=i<<7,n=e<<7;return this.JI(s+1,this.Pp[t][i][e],n+1)&&this.JI(s+128-1,this.Pp[t][i+1][e],n+1)&&this.JI(s+128-1,this.Pp[t][i+1][e+1],n+128-1)&&this.JI(s+1,this.Pp[t][i][e+1],n+128-1)?(this.Gp[t][i][e]=g.qm,!0):(this.Gp[t][i][e]=-g.qm,!1)}};II=(t,i,e,s)=>{if(!this.fI(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.Pp[t][i][e]-1,o=h-120,a=h-230,l=h-238;if(s<16){if(1===s){if(n>g.op){if(!this.JI(n,h,r))return!1;if(!this.JI(n,h,r+128))return!1}if(t>0){if(!this.JI(n,o,r))return!1;if(!this.JI(n,o,r+128))return!1}return!!this.JI(n,a,r)&&this.JI(n,a,r+128)}if(2===s){if(r0){if(!this.JI(n,o,r+128))return!1;if(!this.JI(n+128,o,r+128))return!1}return!!this.JI(n,a,r+128)&&this.JI(n+128,a,r+128)}if(4===s){if(n0){if(!this.JI(n+128,o,r))return!1;if(!this.JI(n+128,o,r+128))return!1}return!!this.JI(n+128,a,r)&&this.JI(n+128,a,r+128)}if(8===s){if(r>g.lp){if(!this.JI(n,h,r))return!1;if(!this.JI(n+128,h,r))return!1}if(t>0){if(!this.JI(n,o,r))return!1;if(!this.JI(n+128,o,r))return!1}return!!this.JI(n,a,r)&&this.JI(n+128,a,r)}}return!!this.JI(n+64,l,r+64)&&(16===s?this.JI(n,a,r+128):32===s?this.JI(n+128,a,r+128):64===s?this.JI(n+128,a,r):128===s?this.JI(n,a,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.fI(t,i,e)){const n=i<<7,r=e<<7;return this.JI(n+1,this.Pp[t][i][e]-s,r+1)&&this.JI(n+128-1,this.Pp[t][i+1][e]-s,r+1)&&this.JI(n+128-1,this.Pp[t][i+1][e+1]-s,r+128-1)&&this.JI(n+1,this.Pp[t][i][e+1]-s,r+128-1)}return!1};TI=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.Gp[t][h][o]===-g.qm)return!1;o=1+(i<<7);const a=2+(s<<7),l=this.Pp[t][i][s]-r;if(!this.JI(o,l,a))return!1;const c=(e<<7)-1;if(!this.JI(c,l,a))return!1;const f=(n<<7)-1;return!!this.JI(o,l,f)&&this.JI(c,l,f)}return!!this.fI(t,i,s)&&(h=i<<7,o=s<<7,this.JI(h+1,this.Pp[t][i][s]-r,o+1)&&this.JI(h+128-1,this.Pp[t][i+1][s]-r,o+1)&&this.JI(h+128-1,this.Pp[t][i+1][s+1]-r,o+128-1)&&this.JI(h+1,this.Pp[t][i][s+1]-r,o+128-1))};JI=(t,i,e)=>{for(let s=0;s0){const t=n.Pg+(n.sI*s>>8),r=n.Wg+(n.nI*s>>8),h=n.Fg+(n.rI*s>>8),o=n.cw+(n.hI*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.Bg;if(s>0){const t=n.Pg+(n.sI*s>>8),r=n.Wg+(n.nI*s>>8),h=n.Fg+(n.rI*s>>8),o=n.cw+(n.hI*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.Pg-e;if(s>0){const e=n.Bg+(n.oI*s>>8),r=n.Ug+(n.aI*s>>8),h=n.Fg+(n.rI*s>>8),o=n.cw+(n.hI*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.Pg;if(s>0){const e=n.Bg+(n.oI*s>>8),r=n.Ug+(n.aI*s>>8),h=n.Fg+(n.rI*s>>8),o=n.cw+(n.hI*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.Fg;if(s>0){const i=n.Bg+(n.oI*s>>8),r=n.Ug+(n.aI*s>>8),h=n.Pg+(n.sI*s>>8),o=n.Wg+(n.nI*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};SI=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const a=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*a>0&&a*((i-n)*(r-o)-(t-o)*(e-n))>0};NI=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{}},4197:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{$I;QI;t_;i_;index;_y;Ca;_a;constructor(t,i,e,s,n,r,h){super(),this.$I=i,this.QI=e,this.t_=s,this.i_=n,this.index=t,this._y=r,h&&-1!==r.va&&this._y.delay?(this.Ca=Math.random()*this._y.Ea|0,this._a=Math.random()*this._y.delay[this.Ca]|0):(this.Ca=-1,this._a=0)}}},9418:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(7121),n=e(1312),r=e(3867);class h extends s.A{x=0;z=0;yI=0;e_=!1;size=1;Wl=-1;s_=-1;n_=-1;r_=-1;h_=-1;o_=-1;a_=-1;l_=null;c_=100;f_=0;u_=0;d_=0;w_=0;y_=-1e3;A_=0;m_=0;p_=-1;g_=0;I_=0;__=-1;C_=0;E_=0;v_=-1;b_=0;T_=0;O_=0;R_=0;S_=-1;L_=0;x_=0;k_=0;M_=0;D_=0;N_=0;F_=0;B_=0;U_=0;P_=0;W_=0;qm=0;height=0;G_=0;pathLength=0;Y_=new Int32Array(10);H_=new Int32Array(10);V_=new r.fe(10,!1);K_=0;X_=-1;j_=-1;z_=-1;Z_=-1;move(t,i,e){if(-1!==this.v_&&n.A.Do[this.v_].priority<=1&&(this.v_=-1),!t){const t=i-this.Y_[0],s=e-this.H_[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.Y_[t]=this.Y_[t-1],this.H_[t]=this.H_[t-1],this.V_[t]=this.V_[t-1];return this.Y_[0]=i,this.H_[0]=e,void(this.V_[0]=!1)}}this.pathLength=0,this.K_=0,this.Y_[0]=i,this.H_[0]=e,this.x=128*this.Y_[0]+64*this.size,this.z=128*this.H_[0]+64*this.size}step(t,i){let e=this.Y_[0],s=this.H_[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.v_&&n.A.Do[this.v_].priority<=1&&(this.v_=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.Y_[t]=this.Y_[t-1],this.H_[t]=this.H_[t-1],this.V_[t]=this.V_[t-1];this.Y_[0]=e,this.H_[0]=s,this.V_[0]=t}}},8268:(t,i,e)=>{e.d(i,{A:()=>d});var s=e(9418),n=e(8665),r=e(2679),h=e(8738),o=e(1312),a=e(8317),l=e(1302),c=e(3819),f=e(3867),u=e(9298);class d extends s.A{static q_=1;static J_=2;static Q_=4;static tC=8;static iC=16;static eC=32;static sC=64;static nC=128;static rC=256;static hC=512;static Pl=[u.A.oC,u.A.aC,u.A.lC,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.AC,u.A.mC,u.A.pC,u.A.gC,u.A.IC,u.A._C,u.A.CC];static Ul=[[u.A.EC,u.A.vC,u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.SC,u.A.LC,u.A.xC,u.A.kC,u.A.MC,u.A.DC],[u.A.NC,u.A.FC,u.A.BC,u.A.UC,u.A.PC,u.A.WC,u.A.GC,u.A.YC,u.A.HC,u.A.VC,u.A.KC,u.A.XC,u.A.jC,u.A.zC,u.A.ZC,u.A.qC],[u.A.qC-1,u.A.NC+1,u.A.FC,u.A.BC,u.A.UC,u.A.PC,u.A.WC,u.A.GC,u.A.YC,u.A.HC,u.A.VC,u.A.KC,u.A.XC,u.A.jC,u.A.zC,u.A.ZC],[u.A.JC,u.A.$C,u.A.QC,u.A.tE,u.A.iE,u.A.eE],[u.A.sE,u.A.nE,u.A.rE,u.A.hE,u.A.oE,u.A.aE,u.A.lE,u.A.cE]];static No=new r.A(200);name=null;visible=!1;fE=0;uE=0;dE=new Uint16Array(12);wE=new Uint16Array(5);ic=0;yE=0n;y=0;AE=0;mE=0;pE=0;gE=0;IE=0;_E=null;iI=0;eI=0;am=0;lm=0;et=!1;draw(t){if(!this.visible)return null;let i=this.Iw();if(this.height=i.cw,i.bw=!0,this.et)return i;if(-1!==this.S_&&-1!==this.L_){const t=h.A.Do[this.S_],e=n.A.$u(t.pl(),!0,!t.Nd,!1);e.translate(-this.M_,0,0),e.Gl(),t._y&&t._y.frames&&e.Yl(t._y.frames[this.L_]),e.hw=null,e.ow=null,128===t.pw&&128===t.gw||e.scale(t.pw,t.gw,t.pw),e.Hl(t.Bd+64,t.Ud+850,-30,-50,-30,!0);const s=[i,e];i=n.A.CE(s,2)}if(this._E&&(t>=this.mE&&(this._E=null),t>=this.AE&&t=d.Ul[i].length)&&(e=0),this.wE[i]=e}this.Wl=t.Uu,65535===this.Wl&&(this.Wl=-1),this.s_=t.Uu,65535===this.s_&&(this.s_=-1),this.n_=t.Uu,65535===this.n_&&(this.n_=-1),this.r_=t.Uu,65535===this.r_&&(this.r_=-1),this.h_=t.Uu,65535===this.h_&&(this.h_=-1),this.o_=t.Uu,65535===this.o_&&(this.o_=-1),this.a_=t.Uu,65535===this.a_&&(this.a_=-1),this.name=c.A.kl(c.A.Ml(t.EE)),this.ic=t.Wu,this.visible=!0,this.yE=0n;for(let t=0;t<12;t++)this.yE<<=0x4n,this.dE[t]>=256&&(this.yE+=BigInt(this.dE[t])-256n);this.dE[0]>=256&&(this.yE+=BigInt(this.dE[0])-256n>>4n),this.dE[1]>=256&&(this.yE+=BigInt(this.dE[1])-256n>>8n);for(let t=0;t<5;t++)this.yE<<=0x3n,this.yE+=BigInt(this.wE[t]);this.yE<<=0x1n,this.yE+=BigInt(this.fE)}Id(){if(!this.visible)return null;const t=new f.fe(12,null);let i=0;for(let e=0;e<12;e++){const s=this.dE[e];if(s>=256&&s<512&&(t[i++]=a.A.Do[s-256].Id()),s>=512){const e=l.A.get(s-512).Id(this.fE);e&&(t[i++]=e)}}const e=n.A.Fl(t,i);for(let t=0;t<5;t++)0!==this.wE[t]&&(e.Bl(d.Ul[t][0],d.Ul[t][this.wE[t]]),1===t&&e.Bl(d.Pl[0],d.Pl[this.wE[t]]));return e}Iw(){let t=this.yE,i=-1,e=-1,s=-1,r=-1;if(this.v_>=0&&0===this.O_){const n=o.A.Do[this.v_];if(n.frames&&(i=n.frames[this.b_]),this.__>=0&&this.__!==this.Wl){const t=o.A.Do[this.__].frames;t&&(e=t[this.C_])}n.py>=0&&(s=n.py,t+=BigInt(s-this.dE[5])<<8n),n.gy>=0&&(r=n.gy,t+=BigInt(r-this.dE[3])<<16n)}else if(this.__>=0){const t=o.A.Do[this.__].frames;t&&(i=t[this.C_])}let h=d.No?.get(t);if(!h){const i=new f.fe(12,null);let e=0;for(let t=0;t<12;t++){let n=this.dE[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=a.A.Do[n-256].pl();t&&(i[e++]=t)}if(n>=512){const t=l.A.get(n-512).yy(this.fE);t&&(i[e++]=t)}}h=n.A.Fl(i,e);for(let t=0;t<5;t++)0!==this.wE[t]&&(h.Bl(d.Ul[t][0],d.Ul[t][this.wE[t]]),1===t&&h.Bl(d.Pl[0],d.Pl[this.wE[t]]));h.Gl(),h.Hl(64,850,-30,-50,-30,!0),d.No?.put(t,h)}if(this.et)return h;const c=n.A._w(h,!0);return-1!==i&&-1!==e?c.Cw(i,e,o.A.Do[this.v_].Ay):-1!==i&&c.Yl(i),c.Ew(),c.hw=null,c.ow=null,c}}},9222:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;model;pg;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.pg=n,this.info=r}}},1161:(t,i,e)=>{e.d(i,{A:()=>s});class s{level;y;x;z;model;wI;yI;gg;kg;Ig;Mg;pg;info;bI=0;qm=0;constructor(t,i,e,s,n,r,h,o,a,l,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.wI=r,this.yI=h,this.gg=o,this.kg=a,this.Ig=l,this.Mg=c,this.pg=f,this.info=u}}},5748:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;vI;EI;CI;pg;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.vI=s,this.EI=n,this.CI=r,this.pg=h,this.offset=o}}},8256:(t,i,e)=>{e.d(i,{A:()=>s});class s{iI;am;eI;lm;type;Bg;Ug;Pg;Wg;Fg;cw;mode=0;oI=0;aI=0;sI=0;nI=0;rI=0;hI=0;constructor(t,i,e,s,n,r,h,o,a,l,c){this.iI=t,this.am=i,this.eI=e,this.lm=s,this.type=n,this.Bg=r,this.Ug=h,this.Pg=o,this.Wg=a,this.Fg=l,this.cw=c}}},3795:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1982),n=e(3867);class r extends s.A{level;x;z;cI;sg;Qg;qp=null;$p=null;hg=null;og=null;Qp=null;ng=null;zp=null;eg=0;tI=0;Zp=0;visible=!1;update=!1;qg=!1;Jg=0;pI=0;gI=0;AI=0;constructor(t,i,e){super(),this.cI=this.level=t,this.x=i,this.z=e,this.sg=new n.fe(5,null),this.Qg=new Int32Array(5)}}},2771:(t,i,e)=>{e.d(i,{A:()=>s});class s{static HI=new Int32Array(6);static VI=new Int32Array(6);static WI=new Int32Array(6);static GI=new Int32Array(6);static YI=new Int32Array(6);static vE=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static bE=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static TE=128;static OE=this.TE/2|0;static RE=this.TE/4|0;static SE=3*this.TE/4|0;tw;ew;iw;zI;ZI;qI;KI;XI;jI;UI;flat;shape;angle;jg;zg;constructor(t,i,e,n,r,h,o,a,l,c,f,u,d,w,y,A,m,p,g){this.flat=!(m!==n||m!==w||m!==a),this.shape=i,this.angle=h,this.jg=d,this.zg=l;const I=s.vE[i],_=I.length;this.tw=new Int32Array(_),this.ew=new Int32Array(_),this.iw=new Int32Array(_);const C=new Int32Array(_),E=new Int32Array(_),v=t*s.TE,b=p*s.TE;for(let t=0;t<_;t++){let i,l,f,d,p,_=I[t];!(1&_)&&_<=8&&(_=1+(_-h-h-1&7)),_>8&&_<=12&&(_=9+(_-h-9&3)),_>12&&_<=16&&(_=13+(_-h-13&3)),1===_?(i=v,l=b,f=m,d=o,p=c):2===_?(i=v+s.OE,l=b,f=m+n>>1,d=o+g>>1,p=c+e>>1):3===_?(i=v+s.TE,l=b,f=n,d=g,p=e):4===_?(i=v+s.TE,l=b+s.OE,f=n+w>>1,d=g+r>>1,p=e+y>>1):5===_?(i=v+s.TE,l=b+s.TE,f=w,d=r,p=y):6===_?(i=v+s.OE,l=b+s.TE,f=w+a>>1,d=r+A>>1,p=y+u>>1):7===_?(i=v,l=b+s.TE,f=a,d=A,p=u):8===_?(i=v,l=b+s.OE,f=a+m>>1,d=A+o>>1,p=u+c>>1):9===_?(i=v+s.OE,l=b+s.RE,f=m+n>>1,d=o+g>>1,p=c+e>>1):10===_?(i=v+s.SE,l=b+s.OE,f=n+w>>1,d=g+r>>1,p=e+y>>1):11===_?(i=v+s.OE,l=b+s.SE,f=w+a>>1,d=r+A>>1,p=y+u>>1):12===_?(i=v+s.RE,l=b+s.OE,f=a+m>>1,d=A+o>>1,p=u+c>>1):13===_?(i=v+s.RE,l=b+s.RE,f=m,d=o,p=c):14===_?(i=v+s.SE,l=b+s.RE,f=n,d=g,p=e):15===_?(i=v+s.SE,l=b+s.SE,f=w,d=r,p=y):(i=v+s.RE,l=b+s.SE,f=a,d=A,p=u),this.tw[t]=i,this.ew[t]=f,this.iw[t]=l,C[t]=d,E[t]=p}const T=s.bE[i],O=T.length/4|0;this.KI=new Int32Array(O),this.XI=new Int32Array(O),this.jI=new Int32Array(O),this.zI=new Int32Array(O),this.ZI=new Int32Array(O),this.qI=new Int32Array(O),this.UI=-1!==f?new Int32Array(O):null;let R=0;for(let t=0;t{e.d(i,{A:()=>s});class s{static Rm=0;static Jp=1;static LE=2;static xE=3;static kE=4;static ME=5;static OE=6;static RE=7;static SE=8;static DE=9;static NE=10;static FE=11}},3479:(t,i,e)=>{e.d(i,{A:()=>s});class s{BI;DI;xI;MI;LI;color;flat;constructor(t,i,e,s,n,r,h){this.BI=t,this.DI=i,this.xI=e,this.MI=s,this.LI=n,this.color=r,this.flat=h}}},6855:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;mI;_I;ug;wg;pg;info;constructor(t,i,e,s,n,r,h,o,a){this.y=t,this.x=i,this.z=e,this.mI=s,this._I=n,this.ug=r,this.wg=h,this.pg=o,this.info=a}}},7441:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;type;angle;model;pg;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.pg=h,this.info=o}}},7536:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{BE;UE;constructor(t){this.UE=[],this.BE=t;for(let i=0;i{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{WE;GE;constructor(){super(),this.WE=this,this.GE=this}YE(){this.GE&&this.WE&&(this.GE.WE=this.WE,this.WE.GE=this.GE,this.WE=null,this.GE=null)}}},3819:(t,i,e)=>{e.d(i,{A:()=>s});class s{static HE=['_','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','0','1','2','3','4','5','6','7','8','9'];static VE=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static Ml=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.HE[Number(s-37n*t)]}return e.slice(12-i).join('')};static KE=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static XE=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static kl=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static qu=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}},6666:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{jE;cursor=null;constructor(){const t=new s.A;t.next=t,t.PE=t,this.jE=t}rm(t){t.PE&&t.kw(),t.PE=this.jE.PE,t.next=this.jE,t.PE&&(t.PE.next=t),t.next.PE=t}zE(t){t.PE&&t.kw(),t.PE=this.jE,t.next=this.jE.next,t.PE.next=t,t.next&&(t.next.PE=t)}lI(){const t=this.jE.next;return t===this.jE?null:(t?.kw(),t)}head(){const t=this.jE.next;return t===this.jE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}ZE(){const t=this.jE.PE;return t===this.jE?(this.cursor=null,null):(this.cursor=t?.PE||null,t)}next(){const t=this.cursor;return t===this.jE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}PE(){const t=this.cursor;return t===this.jE?(this.cursor=null,null):(this.cursor=t?.PE||null,t)}clear(){for(;;){const t=this.jE.next;if(t===this.jE)return;t?.kw()}}}},1982:(t,i,e)=>{e.d(i,{A:()=>s});class s{key;next;PE;constructor(){this.key=0n,this.next=this,this.PE=this}kw(){this.PE&&this.next&&(this.PE.next=this.next,this.next.PE=this.PE,this.next=null,this.PE=null)}}},2679:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(2512),n=e(7536);class r{qE;JE;history;available;constructor(t){this.qE=t,this.available=t,this.JE=new n.A(1024),this.history=new s.A}get(t){const i=this.JE.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.kw(),t?.YE()}else this.available--;this.JE.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.kw(),t.YE()):this.available=this.qE}}},2512:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n{head;constructor(){this.head=new s.A}push(t){t.GE&&t.YE(),t.GE=this.head.GE,t.WE=this.head,t.GE&&(t.GE.WE=t),t.WE.GE=t}pop(){const t=this.head.WE;return t===this.head?null:(t?.YE(),t)}}},8534:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(3867);class r{static Do=[];static wc=t=>{const i=new s.A(t.read('base_head.dat')),e=new s.A(t.read('base_type.dat')),h=new s.A(t.read('base_label.dat')),o=i.Uu;i.Yf+=2;for(let t=0;t{e.d(i,{A:()=>r});var s=e(8534),n=e(1069);class r{static Do=[];static wc=t=>{const i=new n.A(t.read('frame_head.dat')),e=new n.A(t.read('frame_tran1.dat')),h=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),a=i.Uu;i.Yf+=2;const l=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){l[A]=i,c[A]=0,f[A]=0,u[A]=0,A++;break}l[A]=t;let e=0;3===d.types[l[A]]&&(e=128),c[A]=1&i?h.QE:e,f[A]=2&i?h.QE:e,u[A]=4&i?h.QE:e,y=t,A++}}n.length=A,n.tv=new Int32Array(A),n.x=new Int32Array(A),n.y=new Int32Array(A),n.z=new Int32Array(A);for(let t=0;t{e.d(i,{af:()=>s,na:()=>n,iv:()=>o,ev:()=>h,sv:()=>r});const s=document.getElementById('canvas'),n=s.getContext('2d',{willReadFrequently:!0}),r=document.createElement('canvas'),h=document.createElement('img'),o=r.getContext('2d',{willReadFrequently:!0})},9298:(t,i,e)=>{e.d(i,{A:()=>s});class s{static RED=16711680;static GREEN=65280;static BLUE=255;static qa=16776960;static nv=65535;static xm=16711935;static La=16777215;static Za=0;static rv=16748608;static hv=8388608;static ov=128;static av=16756736;static lv=16740352;static cv=16723968;static fv=12648192;static uv=8453888;static dv=4259584;static wv=9179409;static yv=6116423;static fa=2301979;static ua=5063219;static wa=7759444;static Aa=3353893;static Av=8388736;static mv=13350793;static pv=Int32Array.of(s.qa,s.RED,s.GREEN,s.nv,s.xm,s.La);static EC=6798;static vC=107;static bC=10283;static TC=16;static OC=4797;static RC=7744;static SC=5799;static LC=4634;static xC=33697;static kC=22433;static MC=2983;static DC=54193;static NC=8741;static FC=12;static BC=64030;static UC=43162;static PC=7735;static WC=8404;static GC=1701;static YC=38430;static HC=24094;static VC=10153;static KC=56621;static XC=4783;static jC=1341;static zC=16578;static ZC=35003;static qC=25239;static oC=9104;static aC=10275;static lC=7595;static cC=3610;static fC=7975;static uC=8526;static dC=918;static wC=38802;static yC=24466;static AC=10145;static mC=58654;static pC=5027;static gC=1457;static IC=16565;static _C=34991;static CC=25486;static JC=4626;static $C=11146;static QC=6439;static tE=12;static iE=4758;static eE=10270;static cE=4574;static sE=4550;static nE=4537;static rE=5681;static hE=5673;static oE=5790;static aE=6806;static lE=8076}},8950:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n extends s.A{static Fw=new Int32Array;static Bw=0;static Uw=0;static top=0;static bottom=0;static left=0;static right=0;static RI=0;static gv=0;static Iv=0;static bind=(t,i,e)=>{this.Fw=t,this.Bw=i,this.Uw=e,this.Ta(0,0,i,e)};static _v=()=>{this.left=0,this.top=0,this.right=this.Bw,this.bottom=this.Uw,this.RI=this.right-1,this.gv=this.right/2|0};static Ta=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.Bw&&(e=this.Bw),s>this.Uw&&(s=this.Uw),this.top=i,this.bottom=s,this.left=t,this.right=e,this.RI=this.right-1,this.gv=this.right/2|0,this.Iv=this.bottom/2|0};static clear=()=>{const t=this.Bw*this.Uw;for(let i=0;i{this.ya(t,i,n,e),this.ya(t,i+s-1,n,e),this.da(t,i,n,s),this.da(t+e-1,i,n,s)};static ya=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.Bw;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.Bw;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(l-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.Bw-e;let h=t+i*this.Bw;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.Fw[h++]=n;h+=r}};static Cv(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,a=(n>>8&255)*r,l=(255&n)*r,c=this.Bw-e;let f=t+i*this.Bw;for(let t=0;t>16&255)*h>>8<<16)+(a+(this.Fw[f]>>8&255)*h>>8<<8)+(l+(255&this.Fw[f])*h>>8);this.Fw[f++]=t}f+=c}}static Ev(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,a=(255&s)*n;let l=i-e;l<0&&(l=0);let c=i+e;c>=this.Uw&&(c=this.Uw-1);for(let s=l;s<=c;s++){const n=s-i,l=0|Math.sqrt(e*e-n*n);let c=t-l;c<0&&(c=0);let f=t+l;f>=this.Bw&&(f=this.Bw-1);let u=c+s*this.Bw;for(let t=c;t<=f;t++){const t=(h+(this.Fw[u]>>16&255)*r>>8<<16)+(o+(this.Fw[u]>>8&255)*r>>8<<8)+(a+(255&this.Fw[u])*r>>8);this.Fw[u++]=t}}}static vv=(t,i,e)=>{t=this.right||i=this.bottom||(this.Fw[t+i*this.Bw]=e)}}},4583:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1673),r=e(3867);class h extends s.A{static et=!1;static bv=new Int32Array(512);static Tv=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static Ov=new r.fe(50,null);static Rv=0;static Nw=new Int32Array;static yl=0;static Al=0;static Pw=!0;static OI=!1;static alpha=0;static Sv=null;static Lv=new r.fe(50,null);static xv=0;static qm=0;static kv=new Int32Array(50);static Mv=new r.fe(50,null);static Dv=!1;static Nv=new r.fe(50,!1);static Fv=new Int32Array(50);static{for(let t=1;t<512;t++)this.bv[t]=32768/t|0;for(let t=1;t<2048;t++)this.Tv[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static So=()=>{this.bv=null,this.bv=null,this.sin=null,this.cos=null,this.Nw=null,this.Ov=null,this.Nv=null,this.Fv=null,this.Sv=null,this.Lv=null,this.kv=null,this.palette=null,this.Mv=null,console.log('Draw3D unloaded!')};static yc=()=>{this.Nw=new Int32Array(s.A.Uw);for(let t=0;t{this.Nw=new Int32Array(i);for(let e=0;e{this.Sv=null,this.Lv.fill(null)};static fc=t=>{this.Rv=0;for(let i=0;i<50;i++)try{this.Ov[i]=n.A.cc(t,i.toString()),this.et&&128===this.Ov[i]?.Xa?this.Ov[i]?.Pv():this.Ov[i]?.zw(),this.Rv++}catch(t){}};static Lm=t=>{if(0!==this.Fv[t])return this.Fv[t];const i=this.Mv[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.Wv(h,1.4),0===h&&(h=1),this.Fv[t]=h,h};static uc=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,a=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let l=s-.3333333333333333;l<0&&l++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,a=6*l<1?i+6*(t-i)*l:2*l<1?t:3*l<2?i+(t-i)*(.6666666666666666-l)*6:i}const l=((256*h|0)<<16)+((256*o|0)<<8)+(256*a|0);this.palette[e++]=this.Wv(l,i)}}for(let t=0;t<50;t++){const e=this.Ov[t];if(!e)continue;const s=e.palette;this.Mv[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static dc=t=>{this.Sv||(this.xv=t,this.et?this.Sv=new r.Xr(t,16384):this.Sv=new r.Xr(t,65536),this.Lv.fill(null))};static kI=(t,i,e,n,r,o,a,l,c)=>{let f=0,u=0;r!==n&&(f=(i-t<<16)/(r-n)|0,u=(l-a<<15)/(r-n)|0);let d=0,w=0;o!==r&&(d=(e-i<<16)/(o-r)|0,w=(c-l<<15)/(o-r)|0);let y=0,A=0;if(o!==n&&(y=(t-e<<16)/(n-o)|0,A=(a-c<<15)/(n-o)|0),n<=r&&n<=o){if(ns.A.bottom&&(r=s.A.bottom),o>s.A.bottom&&(o=s.A.bottom),rd)for(o-=r,r-=n,n=h.Nw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Yv(e>>16,i>>16,c>>7,l>>7,s.A.Fw,n,0),e+=y,i+=d,c+=A,l+=w,n+=s.A.Bw}this.Yv(e>>16,t>>16,c>>7,a>>7,s.A.Fw,n,0),e+=y,t+=f,c+=A,a+=u,n+=s.A.Bw}else for(o-=r,r-=n,n=h.Nw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Yv(i>>16,e>>16,l>>7,c>>7,s.A.Fw,n,0),e+=y,i+=d,c+=A,l+=w,n+=s.A.Bw}this.Yv(t>>16,e>>16,a>>7,c>>7,s.A.Fw,n,0),e+=y,t+=f,c+=A,a+=u,n+=s.A.Bw}else if(i=t<<=16,l=a<<=15,n<0&&(i-=y*n,t-=f*n,l-=A*n,a-=u*n,n=0),e<<=16,c<<=15,o<0&&(e-=d*o,c-=w*o,o=0),n!==o&&yf)for(r-=o,o-=n,n=h.Nw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Yv(e>>16,t>>16,c>>7,a>>7,s.A.Fw,n,0),e+=d,t+=f,c+=w,a+=u,n+=s.A.Bw}this.Yv(i>>16,t>>16,l>>7,a>>7,s.A.Fw,n,0),i+=y,t+=f,l+=A,a+=u,n+=s.A.Bw}else for(r-=o,o-=n,n=h.Nw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Yv(t>>16,e>>16,a>>7,c>>7,s.A.Fw,n,0),e+=d,t+=f,c+=w,a+=u,n+=s.A.Bw}this.Yv(t>>16,i>>16,a>>7,l>>7,s.A.Fw,n,0),i+=y,t+=f,l+=A,a+=u,n+=s.A.Bw}}else if(r<=o){if(rs.A.bottom&&(o=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),oy)for(n-=o,o-=r,r=h.Nw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Yv(t>>16,e>>16,a>>7,c>>7,s.A.Fw,r,0),t+=f,e+=y,a+=u,c+=A,r+=s.A.Bw}this.Yv(t>>16,i>>16,a>>7,l>>7,s.A.Fw,r,0),t+=f,i+=d,a+=u,l+=w,r+=s.A.Bw}else for(n-=o,o-=r,r=h.Nw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Yv(e>>16,t>>16,c>>7,a>>7,s.A.Fw,r,0),t+=f,e+=y,a+=u,c+=A,r+=s.A.Bw}this.Yv(i>>16,t>>16,l>>7,a>>7,s.A.Fw,r,0),t+=f,i+=d,a+=u,l+=w,r+=s.A.Bw}else if(e=i<<=16,c=l<<=15,r<0&&(e-=f*r,i-=d*r,c-=u*r,l-=w*r,r=0),t<<=16,a<<=15,n<0&&(t-=y*n,a-=A*n,n=0),o-=n,n-=r,r=h.Nw[r],f>16,i>>16,a>>7,l>>7,s.A.Fw,r,0),t+=y,i+=d,a+=A,l+=w,r+=s.A.Bw}this.Yv(e>>16,i>>16,c>>7,l>>7,s.A.Fw,r,0),e+=f,i+=d,c+=u,l+=w,r+=s.A.Bw}else for(;;){if(--n<0)for(;;){if(--o<0)return;this.Yv(i>>16,t>>16,l>>7,a>>7,s.A.Fw,r,0),t+=y,i+=d,a+=A,l+=w,r+=s.A.Bw}this.Yv(i>>16,e>>16,l>>7,c>>7,s.A.Fw,r,0),e+=f,i+=d,c+=u,l+=w,r+=s.A.Bw}}else if(os.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,l>>7,a>>7,s.A.Fw,o,0),i+=d,t+=f,l+=w,a+=u,o+=s.A.Bw}this.Yv(i>>16,e>>16,l>>7,c>>7,s.A.Fw,o,0),i+=d,e+=y,l+=w,c+=A,o+=s.A.Bw}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Yv(t>>16,i>>16,a>>7,l>>7,s.A.Fw,o,0),i+=d,t+=f,l+=w,a+=u,o+=s.A.Bw}this.Yv(e>>16,i>>16,c>>7,l>>7,s.A.Fw,o,0),i+=d,e+=y,l+=w,c+=A,o+=s.A.Bw}else if(t=e<<=16,a=c<<=15,o<0&&(t-=d*o,e-=y*o,a-=w*o,c-=A*o,o=0),i<<=16,l<<=15,r<0&&(i-=f*r,l-=u*r,r=0),n-=r,r-=o,o=h.Nw[o],d>16,e>>16,l>>7,c>>7,s.A.Fw,o,0),i+=f,e+=y,l+=u,c+=A,o+=s.A.Bw}this.Yv(t>>16,e>>16,a>>7,c>>7,s.A.Fw,o,0),t+=d,e+=y,a+=w,c+=A,o+=s.A.Bw}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Yv(e>>16,i>>16,c>>7,l>>7,s.A.Fw,o,0),i+=f,e+=y,l+=u,c+=A,o+=s.A.Bw}this.Yv(e>>16,t>>16,c>>7,a>>7,s.A.Fw,o,0),t+=d,e+=y,a+=w,c+=A,o+=s.A.Bw}};static Yv=(t,i,e,n,r,o,a)=>{let l;if(h.Pw){let c;if(h.OI){if(c=i-t>3?(n-e)/(i-t)|0:0,i>s.A.RI&&(i=s.A.RI),t<0&&(e-=t*c,t=0),t>=i)return;o+=t,a=i-t>>2,c<<=2}else{if(!(t>2)>0?(n-e)*h.bv[a]>>15:0}if(0===h.alpha)for(;;){if(--a<0){if((a=i-t&3)>0){l=h.palette[e>>8];do{r[o++]=l,a--}while(a>0);return}break}l=h.palette[e>>8],e+=c,r[o++]=l,r[o++]=l,r[o++]=l,r[o++]=l}else{const s=h.alpha,n=256-h.alpha;for(;;){if(--a<0){if((a=i-t&3)>0){l=h.palette[e>>8],l=((16711935&l)*n>>8&16711935)+((65280&l)*n>>8&65280);do{r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),a--}while(a>0)}break}l=h.palette[e>>8],e+=c,l=((16711935&l)*n>>8&16711935)+((65280&l)*n>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280)}}}else if(ts.A.RI&&(i=s.A.RI),t<0&&(e-=t*c,t=0),t>=i))return;if(o+=t,a=i-t,0===h.alpha)do{r[o++]=h.palette[e>>8],e+=c,a--}while(a>0);else{const t=h.alpha,i=256-h.alpha;do{l=h.palette[e>>8],e+=c,l=((16711935&l)*i>>8&16711935)+((65280&l)*i>>8&65280),r[o++]=l+((16711935&r[o])*t>>8&16711935)+((65280&r[o])*t>>8&65280),a--}while(a>0)}}};static Hv=(t,i,e,n,r,h,o)=>{let a=0;r!==n&&(a=(i-t<<16)/(r-n)|0);let l=0;h!==r&&(l=(e-i<<16)/(h-r)|0);let c=0;if(h!==n&&(c=(t-e<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),rl)for(h-=r,r-=n,n=this.Nw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Vv(e>>16,i>>16,s.A.Fw,n,o),e+=c,i+=l,n+=s.A.Bw}this.Vv(e>>16,t>>16,s.A.Fw,n,o),e+=c,t+=a,n+=s.A.Bw}else for(h-=r,r-=n,n=this.Nw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Vv(i>>16,e>>16,s.A.Fw,n,o),e+=c,i+=l,n+=s.A.Bw}this.Vv(t>>16,e>>16,s.A.Fw,n,o),e+=c,t+=a,n+=s.A.Bw}else if(i=t<<=16,n<0&&(i-=c*n,t-=a*n,n=0),e<<=16,h<0&&(e-=l*h,h=0),n!==h&&ca)for(r-=h,h-=n,n=this.Nw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Vv(e>>16,t>>16,s.A.Fw,n,o),e+=l,t+=a,n+=s.A.Bw}this.Vv(i>>16,t>>16,s.A.Fw,n,o),i+=c,t+=a,n+=s.A.Bw}else for(r-=h,h-=n,n=this.Nw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Vv(t>>16,e>>16,s.A.Fw,n,o),e+=l,t+=a,n+=s.A.Bw}this.Vv(t>>16,i>>16,s.A.Fw,n,o),i+=c,t+=a,n+=s.A.Bw}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hc)for(n-=h,h-=r,r=this.Nw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Vv(t>>16,e>>16,s.A.Fw,r,o),t+=a,e+=c,r+=s.A.Bw}this.Vv(t>>16,i>>16,s.A.Fw,r,o),t+=a,i+=l,r+=s.A.Bw}else for(n-=h,h-=r,r=this.Nw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Vv(e>>16,t>>16,s.A.Fw,r,o),t+=a,e+=c,r+=s.A.Bw}this.Vv(i>>16,t>>16,s.A.Fw,r,o),t+=a,i+=l,r+=s.A.Bw}else if(e=i<<=16,r<0&&(e-=a*r,i-=l*r,r=0),t<<=16,n<0&&(t-=c*n,n=0),a>16,i>>16,s.A.Fw,r,o),t+=c,i+=l,r+=s.A.Bw}this.Vv(e>>16,i>>16,s.A.Fw,r,o),e+=a,i+=l,r+=s.A.Bw}else for(h-=n,n-=r,r=this.Nw[r];;){if(--n<0)for(;;){if(--h<0)return;this.Vv(i>>16,t>>16,s.A.Fw,r,o),t+=c,i+=l,r+=s.A.Bw}this.Vv(i>>16,e>>16,s.A.Fw,r,o),e+=a,i+=l,r+=s.A.Bw}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.Fw,h,o),i+=l,t+=a,h+=s.A.Bw}this.Vv(i>>16,e>>16,s.A.Fw,h,o),i+=l,e+=c,h+=s.A.Bw}else for(r-=n,n-=h,h=this.Nw[h];;){if(--n<0)for(;;){if(--r<0)return;this.Vv(t>>16,i>>16,s.A.Fw,h,o),i+=l,t+=a,h+=s.A.Bw}this.Vv(e>>16,i>>16,s.A.Fw,h,o),i+=l,e+=c,h+=s.A.Bw}else if(t=e<<=16,h<0&&(t-=l*h,e-=c*h,h=0),i<<=16,r<0&&(i-=a*r,r=0),l>16,e>>16,s.A.Fw,h,o),i+=a,e+=c,h+=s.A.Bw}this.Vv(t>>16,e>>16,s.A.Fw,h,o),t+=l,e+=c,h+=s.A.Bw}else for(n-=r,r-=h,h=this.Nw[h];;){if(--r<0)for(;;){if(--n<0)return;this.Vv(e>>16,i>>16,s.A.Fw,h,o),i+=a,e+=c,h+=s.A.Bw}this.Vv(e>>16,t>>16,s.A.Fw,h,o),t+=l,e+=c,h+=s.A.Bw}};static FI=(t,i,e,n,r,h,o,a,l,c,f,u,d,w,y,A,m,p,g)=>{const I=this.Kv(g);this.Dv=!this.Nv[g];const _=c-d,C=f-y,E=u-m,v=w-c,b=A-f,T=p-u;let O=v*f-b*c<<14;const R=b*u-T*f<<8,S=T*c-v*u<<5;let L=_*f-C*c<<14;const x=C*u-E*f<<8,k=E*c-_*u<<5;let M=C*v-_*b<<14;const D=E*b-C*T<<8,N=_*T-E*v<<5;let F=0,B=0;r!==n&&(F=(i-t<<16)/(r-n)|0,B=(a-o<<16)/(r-n)|0);let U=0,P=0;h!==r&&(U=(e-i<<16)/(h-r)|0,P=(l-a<<16)/(h-r)|0);let W=0,G=0;if(h!==n&&(W=(t-e<<16)/(n-h)|0,G=(o-l<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),rU)for(h-=r,r-=n,n=this.Nw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Xv(e>>16,i>>16,s.A.Fw,n,I,0,0,O,L,M,R,x,D,l>>8,a>>8),e+=W,i+=U,l+=G,a+=P,n+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(e>>16,t>>16,s.A.Fw,n,I,0,0,O,L,M,R,x,D,l>>8,o>>8),e+=W,t+=F,l+=G,o+=B,n+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(h-=r,r-=n,n=this.Nw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Xv(i>>16,e>>16,s.A.Fw,n,I,0,0,O,L,M,R,x,D,a>>8,l>>8),e+=W,i+=U,l+=G,a+=P,n+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(t>>16,e>>16,s.A.Fw,n,I,0,0,O,L,M,R,x,D,o>>8,l>>8),e+=W,t+=F,l+=G,o+=B,n+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}else{i=t<<=16,a=o<<=16,n<0&&(i-=W*n,t-=F*n,a-=G*n,o-=B*n,n=0),e<<=16,l<<=16,h<0&&(e-=U*h,l-=P*h,h=0);const c=n-this.Al;if(O+=S*c,L+=k*c,M+=N*c,O|=0,L|=0,M|=0,(n===h||W>=F)&&(n!==h||U<=F))for(r-=h,h-=n,n=this.Nw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Xv(t>>16,e>>16,s.A.Fw,n,I,0,0,O,L,M,R,x,D,o>>8,l>>8),e+=U,t+=F,l+=P,o+=B,n+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(t>>16,i>>16,s.A.Fw,n,I,0,0,O,L,M,R,x,D,o>>8,a>>8),i+=W,t+=F,a+=G,o+=B,n+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(r-=h,h-=n,n=this.Nw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Xv(e>>16,t>>16,s.A.Fw,n,I,0,0,O,L,M,R,x,D,l>>8,o>>8),e+=U,t+=F,l+=P,o+=B,n+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(i>>16,t>>16,s.A.Fw,n,I,0,0,O,L,M,R,x,D,a>>8,o>>8),i+=W,t+=F,a+=G,o+=B,n+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hW)for(n-=h,h-=r,r=this.Nw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Xv(t>>16,e>>16,s.A.Fw,r,I,0,0,O,L,M,R,x,D,o>>8,l>>8),t+=F,e+=W,o+=B,l+=G,r+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(t>>16,i>>16,s.A.Fw,r,I,0,0,O,L,M,R,x,D,o>>8,a>>8),t+=F,i+=U,o+=B,a+=P,r+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(n-=h,h-=r,r=this.Nw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Xv(e>>16,t>>16,s.A.Fw,r,I,0,0,O,L,M,R,x,D,l>>8,o>>8),t+=F,e+=W,o+=B,l+=G,r+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(i>>16,t>>16,s.A.Fw,r,I,0,0,O,L,M,R,x,D,a>>8,o>>8),t+=F,i+=U,o+=B,a+=P,r+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}else{e=i<<=16,l=a<<=16,r<0&&(e-=F*r,i-=U*r,l-=B*r,a-=P*r,r=0),t<<=16,o<<=16,n<0&&(t-=W*n,o-=G*n,n=0);const c=r-this.Al;if(O+=S*c,L+=k*c,M+=N*c,O|=0,L|=0,M|=0,h-=n,n-=r,r=this.Nw[r],F>16,i>>16,s.A.Fw,r,I,0,0,O,L,M,R,x,D,o>>8,a>>8),t+=W,i+=U,o+=G,a+=P,r+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(e>>16,i>>16,s.A.Fw,r,I,0,0,O,L,M,R,x,D,l>>8,a>>8),e+=F,i+=U,l+=B,a+=P,r+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(;;){if(--n<0)for(;;){if(--h<0)return;this.Xv(i>>16,t>>16,s.A.Fw,r,I,0,0,O,L,M,R,x,D,a>>8,o>>8),t+=W,i+=U,o+=G,a+=P,r+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(i>>16,e>>16,s.A.Fw,r,I,0,0,O,L,M,R,x,D,a>>8,l>>8),e+=F,i+=U,l+=B,a+=P,r+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.Fw,h,I,0,0,O,L,M,R,x,D,a>>8,o>>8),i+=U,t+=F,a+=P,o+=B,h+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(i>>16,e>>16,s.A.Fw,h,I,0,0,O,L,M,R,x,D,a>>8,l>>8),i+=U,e+=W,a+=P,l+=G,h+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Xv(t>>16,i>>16,s.A.Fw,h,I,0,0,O,L,M,R,x,D,o>>8,a>>8),i+=U,t+=F,a+=P,o+=B,h+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(e>>16,i>>16,s.A.Fw,h,I,0,0,O,L,M,R,x,D,l>>8,a>>8),i+=U,e+=W,a+=P,l+=G,h+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}else{t=e<<=16,o=l<<=16,h<0&&(t-=U*h,e-=W*h,o-=P*h,l-=G*h,h=0),i<<=16,a<<=16,r<0&&(i-=F*r,a-=B*r,r=0);const c=h-this.Al;if(O+=S*c,L+=k*c,M+=N*c,O|=0,L|=0,M|=0,n-=r,r-=h,h=this.Nw[h],U>16,e>>16,s.A.Fw,h,I,0,0,O,L,M,R,x,D,a>>8,l>>8),i+=F,e+=W,a+=B,l+=G,h+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(t>>16,e>>16,s.A.Fw,h,I,0,0,O,L,M,R,x,D,o>>8,l>>8),t+=U,e+=W,o+=P,l+=G,h+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Xv(e>>16,i>>16,s.A.Fw,h,I,0,0,O,L,M,R,x,D,l>>8,a>>8),i+=F,e+=W,a+=B,l+=G,h+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Xv(e>>16,t>>16,s.A.Fw,h,I,0,0,O,L,M,R,x,D,l>>8,o>>8),t+=U,e+=W,o+=P,l+=G,h+=s.A.Bw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}};static Xv=(t,i,e,n,r,h,o,a,l,c,f,u,d,w,y)=>{if(t>=i)return;let A,m,p,g,I,_,C,E,v;if(this.OI){if(A=(y-w)/(i-t)|0,i>s.A.RI&&(i=s.A.RI),t<0&&(w-=t*A,t=0),t>=i)return;m=i-t>>3,A<<=12}else i-t>7?(m=i-t>>3,A=(y-w)*this.bv[m]>>6):(m=0,A=0);if(w<<=9,n+=t,this.et&&r)if(p=0,g=0,_=t-this.yl,a+=(f>>3)*_,l+=(u>>3)*_,c+=(d>>3)*_,a|=0,l|=0,I=(c|=0)>>12,0!==I&&(o=l/I|0,(h=a/I|0)<0?h=0:h>4032&&(h=4032)),a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>12,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=g-o>>3,h+=w>>3&786432,v=w>>23,this.Dv){for(;m-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h=p,o=g,a+=f,l+=u,I=(c+=d)>>12,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=g-o>>3,h+=(w+=A)>>3&786432,v=w>>23;for(m=i-t&7;m-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E}else{for(;m-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n+=1,h=p,o=g,a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>12,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=g-o>>3,h+=(w+=A)>>3&786432,v=w>>23}for(m=i-t&7;m-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}else if(p=0,g=0,_=t-this.yl,a+=(f>>3)*_,l+=(u>>3)*_,c+=(d>>3)*_,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(o=l/I|0,(h=a/I|0)<0?h=0:h>16256&&(h=16256)),a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=g-o>>3,h+=6291456&w,v=w>>23,this.Dv&&r){for(;m-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h=p,o=g,a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=g-o>>3,h+=6291456&(w+=A),v=w>>23;for(m=i-t&7;m-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E}else{for(;m-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,h=p,o=g,a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=g-o>>3,h+=6291456&(w+=A),v=w>>23}for(m=i-t&7;m-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}};static Vv=(t,i,e,n,r)=>{if(this.OI&&(i>s.A.RI&&(i=s.A.RI),t<0&&(t=0)),t>=i)return;n+=t;let h=i-t>>2;if(0===this.alpha)for(;;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;e[n++]=r}e[n++]=r,e[n++]=r,e[n++]=r,e[n++]=r}const o=this.alpha,a=256-this.alpha;for(r=((16711935&r)*a>>8&16711935)+((65280&r)*a>>8&65280);;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}};static Gv=t=>{this.Lv[t]&&this.Sv&&(this.Sv[this.xv++]=this.Lv[t],this.Lv[t]=null)};static Kv=t=>{if(this.kv[t]=this.qm++,this.Lv[t])return this.Lv[t];let i;if(this.xv>0&&this.Sv)i=this.Sv[--this.xv],this.Sv[this.xv]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.Fw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.Fw[t]];this.Nv[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.Nv[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}},880:(t,i,e)=>{e.d(i,{r:()=>n});var s=e(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(s.ev.src),s.ev.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>s.ev.onload=()=>t())),s.iv.clearRect(0,0,s.sv.width,s.sv.height);const i=s.ev.naturalWidth,e=s.ev.naturalHeight;return s.sv.width=i,s.sv.height=e,s.iv.drawImage(s.ev,0,0),s.iv.getImageData(0,0,i,e)}},8665:(t,i,e)=>{e.d(i,{A:()=>f});var s=e(1069),n=e(8950),r=e(4583),h=e(6730),o=e(4474),a=e(3867);class l{Qd=0;Yg=0;jv=0;zv=-1;Zv=-1;qv=-1;Jv=-1;$v=-1;Qv=-1;tb=-1;ib=-1;eb=-1;sb=0;nb=-1;rb=-1;hb=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static ob=null;static ab=null;static lb=null;static cb=null;static fb=null;static ub=null;static wb=null;static yb=null;static Ab=null;static mb=null;static pb=null;static gb=null;static axis=null;static Ib=new a.fe(4096,!1);static _b=new a.fe(4096,!1);static Cb=new Int32Array(4096);static Eb=new Int32Array(4096);static vb=new Int32Array(4096);static bb=new Int32Array(4096);static Tb=new Int32Array(4096);static Ob=new Int32Array(4096);static Rb=new Int32Array(1500);static Sb=new a.Xr(1500,512);static Lb=new Int32Array(12);static xb=new a.Xr(12,2e3);static kb=new Int32Array(2e3);static Mb=new Int32Array(2e3);static Db=new Int32Array(12);static Nb=new Int32Array(10);static Fb=new Int32Array(10);static Bb=new Int32Array(10);static Ir=0;static Ub=0;static _r=0;static Pb=!1;static Ha=0;static Va=0;static Wb=0;static Gb=new Int32Array(1e3);static Yb=!1;static wc(t){try{f.head=new s.A(t.read('ob_head.dat')),f.ob=new s.A(t.read('ob_face1.dat')),f.ab=new s.A(t.read('ob_face2.dat')),f.lb=new s.A(t.read('ob_face3.dat')),f.cb=new s.A(t.read('ob_face4.dat')),f.fb=new s.A(t.read('ob_face5.dat')),f.ub=new s.A(t.read('ob_point1.dat')),f.wb=new s.A(t.read('ob_point2.dat')),f.yb=new s.A(t.read('ob_point3.dat')),f.Ab=new s.A(t.read('ob_point4.dat')),f.mb=new s.A(t.read('ob_point5.dat')),f.pb=new s.A(t.read('ob_vertex1.dat')),f.gb=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.Yf=0,f.ub.Yf=0,f.wb.Yf=0,f.yb.Yf=0,f.Ab.Yf=0,f.pb.Yf=0,f.gb.Yf=0;const i=f.head.Uu;f.metadata=new a.fe(i+100,null);let e=0,n=0,r=0,h=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static $d=(t,i,e)=>{const s=t.Qd,n=t.Yg,r=t.jv;let h,o,l,u,d;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.Qd,r=t.Yg,h=t.jv;let o,a,l,c,u;if(s)o=t.tw,a=t.ew,l=t.iw;else{o=new Int32Array(n),a=new Int32Array(n),l=new Int32Array(n);for(let i=0;i{const e=t.Qd,s=t.Yg,n=t.jv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,a=0,l=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,a=0,l=-1;for(let c=0;c{let o=-1;const a=t.tw[i],l=t.ew[i],c=t.iw[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.ob&&f.ab&&f.lb&&f.cb&&f.fb&&f.ub&&f.wb&&f.yb&&f.Ab&&f.mb&&f.pb&&f.gb&&f.axis))throw new Error('cant loading model!!!!!');const e=i.Qd,s=i.Yg,n=i.jv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),a=new Int32Array(s),l=new Int32Array(s),c=new Int32Array(s),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;i.$v>=0&&(y=new Int32Array(e));let A=null;i.eb>=0&&(A=new Int32Array(s));let m=null,p=0;i.sb>=0?m=new Int32Array(s):p=-i.sb-1;let g=null;i.nb>=0&&(g=new Int32Array(s));let I=null;i.rb>=0&&(I=new Int32Array(s));const _=new Int32Array(s);f.ub.Yf=i.zv,f.wb.Yf=i.Zv,f.yb.Yf=i.qv,f.Ab.Yf=i.Jv,f.mb.Yf=i.$v;let C,E,v,b=0,T=0,O=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const e=f.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const n=e.Qd,r=e.Yg,h=e.jv,o=new Int32Array(n),a=new Int32Array(n),l=new Int32Array(n),c=new Int32Array(r),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(h),y=new Int32Array(h),A=new Int32Array(h);let m=null;e.$v>=0&&(m=new Int32Array(n));let p=null;e.eb>=0&&(p=new Int32Array(r));let g=null,I=0;e.sb>=0?g=new Int32Array(r):I=-e.sb-1;let _=null;e.nb>=0&&(_=new Int32Array(r));let C=null;e.rb>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(e.data);v.Yf=e.zv;const b=new s.A(e.data);b.Yf=e.Zv;const T=new s.A(e.data);T.Yf=e.qv;const O=new s.A(e.data);O.Yf=e.Jv;const R=new s.A(e.data);R.Yf=e.$v;let S,L,x,k=0,M=0,D=0;for(let t=0;tthis.cw&&(this.cw=-e),e>this.Fg&&(this.Fg=e);const n=i*i+s*s;n>this.Wm&&(this.Wm=n)}this.Wm=Math.sqrt(this.Wm)+.99|0,this.tT=Math.sqrt(this.Wm*this.Wm+this.cw*this.cw)+.99|0,this.Qb=this.tT+(Math.sqrt(this.Wm*this.Wm+this.Fg*this.Fg)+.99|0)}sw(){this.cw=0,this.Fg=0;for(let t=0;tthis.cw&&(this.cw=-i),i>this.Fg&&(this.Fg=i)}this.tT=Math.sqrt(this.Wm*this.Wm+this.cw*this.cw)+.99|0,this.Qb=this.tT+(Math.sqrt(this.Wm*this.Wm+this.Fg*this.Fg)+.99|0)}Gl(){if(this.iT){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.ow=new a.fe(i+1,null);for(let e=0;e<=i;e++)this.ow[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.hw=new a.fe(i+1,null);for(let e=0;e<=i;e++)this.hw[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ea;)a=e[o++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==a||0===r.types[i])&&this.hT(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}f.Ir=0,f.Ub=0,f._r=0,o=0,a=e[o++];for(let t=0;ta;)a=e[o++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===a||0===r.types[i])&&this.hT(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.Yl(t)}Yl(t){if(!this.ow||-1===t||!h.A.Do[t])return;const i=h.A.Do[t],e=i.$E;f.Ir=0,f.Ub=0,f._r=0;for(let t=0;t>16;this.iw[t]=this.ew[t]*i+this.iw[t]*e>>16,this.ew[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.Kb&&this.Xb&&this.jb||(this.Kb=new Int32Array(this.Yg),this.Xb=new Int32Array(this.Yg),this.jb=new Int32Array(this.Yg)),!this.Rg){this.Rg=new a.fe(this.Qd,null);for(let t=0;t8192||m>8192||p>8192||A<-8192||m<-8192||p<-8192;)A>>=1,m>>=1,p>>=1;let g=0|Math.sqrt(A*A+m*m+p*p);if(g<=0&&(g=1),A=256*A/g|0,m=256*m/g|0,p=256*p/g|0,this.Gg&&1&this.Gg[i]){const r=t+((e*A+s*m+n*p)/(h+(h/2|0))|0);this.Ju&&(this.Kb[i]=f.Vb(this.Ju[i],r,this.Gg[i]))}else{let t=this.Rg[r];t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.Rg[o],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.Rg[a],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++)}}if(r)this.xg(t,h,e,s,n);else{this.Ng=new a.fe(this.Qd,null);for(let t=0;t>16;for(let s=0;s>16,I=I*w-g*d>>16,g=p),0!==t&&(p=I*l-_*a>>16,_=I*a+_*l>>16,I=p),0!==i&&(p=_*c+g*u>>16,_=_*u-g*c>>16,g=p),g+=n,I+=h,_+=o,p=I*A-_*y>>16,_=I*y+_*A>>16,I=p,f.Cb&&f.Eb&&f.vb&&(f.vb[s]=_-m,f.Cb[s]=r.A.yl+((g<<9)/_|0),f.Eb[s]=r.A.Al+((I<<9)/_|0)),this.jv>0&&f.bb&&f.Tb&&f.Ob&&(f.bb[s]=g,f.Tb[s]=I,f.Ob[s]=_)}try{this.lT(!1,!1,0)}catch(t){}}draw(t,i,e,s,h,o,a,l,c){const u=l*h-o*s>>16,d=a*i+u*e>>16,w=this.Wm*e>>16,y=d+w;if(y<=50||d>=3500)return;const A=l*s+o*h>>16;let m=A-this.Wm<<9;if((m/y|0)>=n.A.gv)return;let p=A+this.Wm<<9;if((p/y|0)<=-n.A.gv)return;const g=a*e-u*i>>16,I=this.Wm*i>>16;let _=g+I<<9;if((_/y|0)<=-n.A.Iv)return;let C=g-(I+(this.cw*e>>16))<<9;if((C/y|0)>=n.A.Iv)return;let E=d-(w+(this.cw*i>>16))<=50,v=!1;if(c>0&&f.Pb){let t=d-w;t<=50&&(t=50),A>0?(m=m/y|0,p=p/t|0):(p=p/y|0,m=m/t|0),g>0?(C=C/y|0,_=_/t|0):(_=_/y|0,C=C/t|0);const i=f.Ha-r.A.yl,e=f.Va-r.A.Al;i>m&&iC&&e<_&&(this.bw?f.Gb[f.Wb++]=c:v=!0)}const b=r.A.yl,T=r.A.Al;let O=0,R=0;0!==t&&(O=r.A.sin[t],R=r.A.cos[t]);for(let n=0;n>16,w=w*R-c*O>>16,c=r),c+=o,u+=a,w+=l,r=w*s+c*h>>16,w=w*h-c*s>>16,c=r,r=u*e-w*i>>16,w=u*i+w*e>>16,u=r,f.vb&&(f.vb[n]=w-d),w>=50&&f.Cb&&f.Eb?(f.Cb[n]=b+((c<<9)/w|0),f.Eb[n]=T+((u<<9)/w|0)):f.Cb&&(f.Cb[n]=-5e3,E=!0),(E||this.jv>0)&&f.bb&&f.Tb&&f.Ob&&(f.bb[n]=c,f.Tb[n]=u,f.Ob[n]=w)}try{this.lT(E,v,c)}catch(t){}}lT(t,i,e,s=!1){f.Yb&&(this.nT=-1,this.rT=-1);for(let t=0;tn.A.RI||l>n.A.RI||c>n.A.RI),f.Sb&&f.Rb){const t=((y+A+m)/3|0)+this.tT;f.Sb[t][f.Rb[t]++]=s,f.Yb&&this.cT(f.Ha,f.Va,u,d,w,a,l,c)&&this.rT=0;t--){const i=f.Rb[t];if(!(i<=0)&&f.Sb){const e=f.Sb[t];for(let t=0;t=0;t--){const i=f.Rb[t];if(i>0&&f.Sb){const e=f.Sb[t];for(let s=0;s0||f.Lb[2]>0)&&(r=(f.Db[1]+f.Db[2])/(f.Lb[1]+f.Lb[2])|0);let h=0;f.Lb&&f.Db&&(f.Lb[3]>0||f.Lb[4]>0)&&(h=(f.Db[3]+f.Db[4])/(f.Lb[3]+f.Lb[4])|0);let o=0;if(f.Lb&&f.Db&&(f.Lb[6]>0||f.Lb[8]>0)&&(o=(f.Db[6]+f.Db[8])/(f.Lb[6]+f.Lb[8])|0),f.Lb&&f.xb){let t,i=0,e=f.Lb[10],n=f.xb[10],a=f.kb;i===e&&(i=0,e=f.Lb[11],n=f.xb[11],a=f.Mb),t=ir;)try{this.fT(n[i++],s),i===e&&n!==f.xb[11]&&(i=0,e=f.Lb[11],n=f.xb[11],a=f.Mb),t=ih;)try{this.fT(n[i++],s),i===e&&n!==f.xb[11]&&(i=0,e=f.Lb[11],n=f.xb[11],a=f.Mb),t=io;)try{this.fT(n[i++],s),i===e&&n!==f.xb[11]&&(i=0,e=f.Lb[11],n=f.xb[11],a=f.Mb),t=i>2,h=this.qb[i],o=this.Jb[i],a=this.$b[i];r.A.FI(f.Cb[e],f.Cb[s],f.Cb[n],f.Eb[e],f.Eb[s],f.Eb[n],this.Kb[t],this.Xb[t],this.jb[t],f.bb[h],f.Tb[h],f.Ob[h],f.bb[o],f.bb[a],f.Tb[o],f.Tb[a],f.Ob[o],f.Ob[a],this.Ju[t])}else if(3===h&&this.Gg&&this.Ju&&this.Kb&&f.Cb&&f.Eb&&f.bb&&f.Tb&&f.Ob){const i=this.Gg[t]>>2,h=this.qb[i],o=this.Jb[i],a=this.$b[i];r.A.FI(f.Cb[e],f.Cb[s],f.Cb[n],f.Eb[e],f.Eb[s],f.Eb[n],this.Kb[t],this.Kb[t],this.Kb[t],f.bb[h],f.Tb[h],f.Ob[h],f.bb[o],f.bb[a],f.Tb[o],f.Tb[a],f.Ob[o],f.Ob[a],this.Ju[t])}}uT(t,i=!1){let e=0;if(f.Ob){const i=r.A.yl,s=r.A.Al,n=this.Hg[t],h=this.Vg[t],o=this.Kg[t],a=f.Ob[n],l=f.Ob[h],c=f.Ob[o];if(a>=50&&f.Cb&&f.Eb&&this.Kb)f.Nb[e]=f.Cb[n],f.Fb[e]=f.Eb[n],f.Bb[e++]=this.Kb[t];else if(f.bb&&f.Tb&&this.Kb){const u=f.bb[n],d=f.Tb[n],w=this.Kb[t];if(c>=50&&this.jb){const n=(50-a)*r.A.Tv[c-a];f.Nb[e]=i+((u+((f.bb[o]-u)*n>>16)<<9)/50|0),f.Fb[e]=s+((d+((f.Tb[o]-d)*n>>16)<<9)/50|0),f.Bb[e++]=w+((this.jb[t]-w)*n>>16)}if(l>=50&&this.Xb){const n=(50-a)*r.A.Tv[l-a];f.Nb[e]=i+((u+((f.bb[h]-u)*n>>16)<<9)/50|0),f.Fb[e]=s+((d+((f.Tb[h]-d)*n>>16)<<9)/50|0),f.Bb[e++]=w+((this.Xb[t]-w)*n>>16)}}if(l>=50&&f.Cb&&f.Eb&&this.Xb)f.Nb[e]=f.Cb[h],f.Fb[e]=f.Eb[h],f.Bb[e++]=this.Xb[t];else if(f.bb&&f.Tb&&this.Xb){const u=f.bb[h],d=f.Tb[h],w=this.Xb[t];if(a>=50&&this.Kb){const h=(50-l)*r.A.Tv[a-l];f.Nb[e]=i+((u+((f.bb[n]-u)*h>>16)<<9)/50|0),f.Fb[e]=s+((d+((f.Tb[n]-d)*h>>16)<<9)/50|0),f.Bb[e++]=w+((this.Kb[t]-w)*h>>16)}if(c>=50&&this.jb){const n=(50-l)*r.A.Tv[c-l];f.Nb[e]=i+((u+((f.bb[o]-u)*n>>16)<<9)/50|0),f.Fb[e]=s+((d+((f.Tb[o]-d)*n>>16)<<9)/50|0),f.Bb[e++]=w+((this.jb[t]-w)*n>>16)}}if(c>=50&&f.Cb&&f.Eb&&this.jb)f.Nb[e]=f.Cb[o],f.Fb[e]=f.Eb[o],f.Bb[e++]=this.jb[t];else if(f.bb&&f.Tb&&this.jb){const u=f.bb[o],d=f.Tb[o],w=this.jb[t];if(l>=50&&this.Xb){const n=(50-c)*r.A.Tv[l-c];f.Nb[e]=i+((u+((f.bb[h]-u)*n>>16)<<9)/50|0),f.Fb[e]=s+((d+((f.Tb[h]-d)*n>>16)<<9)/50|0),f.Bb[e++]=w+((this.Xb[t]-w)*n>>16)}if(a>=50&&this.Kb){const h=(50-c)*r.A.Tv[a-c];f.Nb[e]=i+((u+((f.bb[n]-u)*h>>16)<<9)/50|0),f.Fb[e]=s+((d+((f.Tb[n]-d)*h>>16)<<9)/50|0),f.Bb[e++]=w+((this.Kb[t]-w)*h>>16)}}}const s=f.Nb[0],h=f.Nb[1],o=f.Nb[2],a=f.Fb[0],l=f.Fb[1],c=f.Fb[2];if(!((s-h)*(c-l)-(a-l)*(o-h)<=0))if(r.A.OI=!1,3===e){let e;if((s<0||h<0||o<0||s>n.A.RI||h>n.A.RI||o>n.A.RI)&&(r.A.OI=!0),e=this.Gg?3&this.Gg[t]:0,i)r.A.xc(s,h,a,l,f.Bb[0]),r.A.xc(h,o,l,c,f.Bb[1]),r.A.xc(o,s,c,a,f.Bb[2]);else if(0===e)r.A.kI(s,h,o,a,l,c,f.Bb[0],f.Bb[1],f.Bb[2]);else if(1===e&&this.Kb)r.A.Hv(s,h,o,a,l,c,r.A.palette[this.Kb[t]]);else if(2===e&&this.Gg&&this.Ju&&f.bb&&f.Tb&&f.Ob){const i=this.Gg[t]>>2,e=this.qb[i],n=this.Jb[i],u=this.$b[i];r.A.FI(s,h,o,a,l,c,f.Bb[0],f.Bb[1],f.Bb[2],f.bb[e],f.Tb[e],f.Ob[e],f.bb[n],f.bb[u],f.Tb[n],f.Tb[u],f.Ob[n],f.Ob[u],this.Ju[t])}else if(3===e&&this.Gg&&this.Ju&&this.Kb&&f.bb&&f.Tb&&f.Ob){const i=this.Gg[t]>>2,e=this.qb[i],n=this.Jb[i],u=this.$b[i];r.A.FI(s,h,o,a,l,c,this.Kb[t],this.Kb[t],this.Kb[t],f.bb[e],f.Tb[e],f.Ob[e],f.bb[n],f.bb[u],f.Tb[n],f.Tb[u],f.Ob[n],f.Ob[u],this.Ju[t])}}else if(4===e){let e;if((s<0||h<0||o<0||s>n.A.RI||h>n.A.RI||o>n.A.RI||f.Nb[3]<0||f.Nb[3]>n.A.RI)&&(r.A.OI=!0),e=this.Gg?3&this.Gg[t]:0,i)r.A.xc(s,h,a,l,f.Bb[0]),r.A.xc(h,o,l,c,f.Bb[1]),r.A.xc(o,f.Nb[3],c,f.Fb[3],f.Bb[2]),r.A.xc(f.Nb[3],s,f.Fb[3],a,f.Bb[3]);else if(0===e)r.A.kI(s,h,o,a,l,c,f.Bb[0],f.Bb[1],f.Bb[2]),r.A.kI(s,o,f.Nb[3],a,c,f.Fb[3],f.Bb[0],f.Bb[2],f.Bb[3]);else if(1===e){if(this.Kb){const i=r.A.palette[this.Kb[t]];r.A.Hv(s,h,o,a,l,c,i),r.A.Hv(s,o,f.Nb[3],a,c,f.Fb[3],i)}}else if(2===e&&this.Gg&&this.Ju&&f.bb&&f.Tb&&f.Ob){const i=this.Gg[t]>>2,e=this.qb[i],n=this.Jb[i],u=this.$b[i];r.A.FI(s,h,o,a,l,c,f.Bb[0],f.Bb[1],f.Bb[2],f.bb[e],f.Tb[e],f.Ob[e],f.bb[n],f.bb[u],f.Tb[n],f.Tb[u],f.Ob[n],f.Ob[u],this.Ju[t]),r.A.FI(s,o,f.Nb[3],a,c,f.Fb[3],f.Bb[0],f.Bb[2],f.Bb[3],f.bb[e],f.Tb[e],f.Ob[e],f.bb[n],f.bb[u],f.Tb[n],f.Tb[u],f.Ob[n],f.Ob[u],this.Ju[t])}else if(3===e&&this.Gg&&this.Ju&&this.Kb&&f.bb&&f.Tb&&f.Ob){const i=this.Gg[t]>>2,e=this.qb[i],n=this.Jb[i],u=this.$b[i];r.A.FI(s,h,o,a,l,c,this.Kb[t],this.Kb[t],this.Kb[t],f.bb[e],f.Tb[e],f.Ob[e],f.bb[n],f.bb[u],f.Tb[n],f.Tb[u],f.Ob[n],f.Ob[u],this.Ju[t]),r.A.FI(s,o,f.Nb[3],a,c,f.Fb[3],this.Kb[t],this.Kb[t],this.Kb[t],f.bb[e],f.Tb[e],f.Ob[e],f.bb[n],f.bb[u],f.Tb[n],f.Tb[u],f.Ob[n],f.Ob[u],this.Ju[t])}}}hT(t,i,e,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f.Ir=0,f.Ub=0,f._r=0;for(let t=0;t0?(f.Ir=(f.Ir/n|0)+t,f.Ub=(f.Ub/n|0)+i,f._r=(f._r/n|0)+e):(f.Ir=t,f.Ub=i,f._r=e)}else if(1===n)for(let n=0;n=this.ow.length)continue;const h=this.ow[r];if(h)for(let s=0;s=this.ow.length)continue;const o=this.ow[h];if(o)for(let s=0;s>16;this.ew[n]=this.ew[n]*u-this.tw[n]*c>>16,this.tw[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.ew[n]*u-this.iw[n]*c>>16;this.iw[n]=this.ew[n]*c+this.iw[n]*u>>16,this.ew[n]=t}if(0!==a){c=r.A.sin[a],u=r.A.cos[a];const t=this.iw[n]*c+this.tw[n]*u>>16;this.iw[n]=this.iw[n]*u-this.tw[n]*c>>16,this.tw[n]=t}this.tw[n]+=f.Ir,this.ew[n]+=f.Ub,this.iw[n]+=f._r}}else if(3===n)for(let n=0;n=this.ow.length)continue;const h=this.ow[r];if(h)for(let s=0;s=this.hw.length)continue;const n=this.hw[e];if(n)for(let i=0;i255&&(this.Zb[e]=255)}}}aT(){this.cw=0,this.Wm=0,this.Fg=0,this.Bg=999999,this.Ug=-999999,this.Wg=-99999,this.Pg=99999;for(let t=0;tthis.Ug&&(this.Ug=i),sthis.Wg&&(this.Wg=s),-e>this.cw&&(this.cw=-e),e>this.Fg&&(this.Fg=e);const n=i*i+s*s;n>this.Wm&&(this.Wm=n)}this.Wm=0|Math.sqrt(this.Wm),this.tT=0|Math.sqrt(this.Wm*this.Wm+this.cw*this.cw),this.Qb=this.tT+(0|Math.sqrt(this.Wm*this.Wm+this.Fg*this.Fg))}cT(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{e.d(i,{A:()=>o});var s=e(8950),n=e(1069),r=e(4474),h=e(880);class o extends r.A{Fw;width;height;wT;yT;Xa;xw;constructor(t,i){super(),this.Fw=new Int32Array(t*i),this.width=this.Xa=t,this.height=this.xw=i,this.wT=this.yT=0}static AT=async(t,i)=>{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(0,h.r)(e),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),a=n.Fw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static cc=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.Yf=s.Uu;const h=r.Uu,a=r.Uu,l=[],c=r.Wu-1;for(let t=0;ts.length||r.Yf>r.length)throw new Error;const f=r.Wu,u=r.Wu,d=r.Uu,w=r.Uu,y=new o(d,w);y.wT=f,y.yT=u,y.Xa=h,y.xw=a;const A=r.Wu;if(0===A){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.mT(h,r,this.Fw,n,a,s.A.Fw,e,o)}Ka(t,i,e){i|=0,e|=0;let n=(i+=this.wT)+(e+=this.yT)*s.A.Bw,r=0,h=this.height,o=this.width,a=s.A.Bw-o,l=0;if(es.A.bottom&&(h-=e+h-s.A.bottom),is.A.right){const t=i+o-s.A.right;o-=t,l+=t,a+=t}o>0&&h>0&&this.pT(o,h,this.Fw,r,l,s.A.Fw,n,a,t)}gT(t,i){t|=0,i|=0;let e=(t+=this.wT)+(i+=this.yT)*s.A.Bw,n=0,r=this.height,h=this.width,o=s.A.Bw-h,a=0;if(is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.IT(h,r,this.Fw,n,a,s.A.Fw,e,o)}_T(){const t=this.Fw,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.Fw[s]=(r<<16)+(h<<8)+o}}}zw(t,i,e,n){t|=0,i|=0,e|=0,n|=0;try{const r=this.width;let h=0,o=0;const a=this.Xa,l=this.xw,c=(a<<16)/e|0,f=(l<<16)/n|0;t+=(this.wT*e+a-1)/a|0,i+=(this.yT*n+l-1)/l|0,this.wT*e%a!=0&&(h=(a-this.wT*e%a<<16)/e|0),this.yT*n%l!=0&&(o=(l-this.yT*n%l<<16)/n|0),e=e*(this.width-(h>>16))/a|0,n=n*(this.height-(o>>16))/l|0;let u=t+i*s.A.Bw,d=s.A.Bw-e;if(is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right){const i=t+e-s.A.right;e-=i,d+=i}this.scale(e,n,this.Fw,h,o,s.A.Fw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}ET(t,i,e,n,r,h,o,a,l,c){t|=0,i|=0,e|=0,n|=0;try{const f=-e/2|0,u=-n/2|0,d=65536*Math.sin(l/326.11)|0,w=65536*Math.cos(l/326.11)|0,y=d*c>>8,A=w*c>>8;let m=(o<<16)+u*y+f*A,p=u*A-f*y+(a<<16),g=t+i*s.A.Bw;for(let t=0;t>16)+(o>>16)*this.width],n+=A,o-=y;m+=y,p+=A,g+=s.A.Bw}}catch(t){}}vT(t,i,e){t|=0,i|=0;let n=(t+=this.wT)+(i+=this.yT)*s.A.Bw,r=0,h=this.height,o=this.width,a=s.A.Bw-o,l=0;if(is.A.bottom&&(h-=i+h-s.A.bottom),ts.A.right){const i=t+o-s.A.right;o-=i,l+=i,a+=i}o>0&&h>0&&this.bT(o,h,this.Fw,l,r,s.A.Fw,n,a,e.Fw)}scale(t,i,e,s,n,r,h,o,a,l,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*a;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=l}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}IT(t,i,e,s,n,r,h,o){const a=-(t>>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}pT(t,i,e,s,n,r,h,o,a){const l=256-a;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*a+(16711935&i)*l&4278255360)+((65280&t)*a+(65280&i)*l&16711680)>>8}}h+=o,s+=n}}mT(t,i,e,s,n,r,h,o){const a=-(t>>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}bT(t,i,e,s,n,r,h,o,a){const l=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=l;t<0;t++){let t=e[n++];0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===a[h]?r[h++]=t:h++}h+=o,n+=s}}}},1673:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1069),r=e(4474);class h extends r.A{Fw;width;height;wT;yT;Xa;xw;palette;constructor(t,i,e){super(),this.Fw=new Int8Array(t*i),this.width=this.Xa=t,this.height=this.xw=i,this.wT=this.yT=0,this.palette=e}static cc=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.Yf=s.Uu;const o=r.Uu,a=r.Uu,l=r.Wu,c=new Int32Array(l);for(let t=1;ts.length||r.Yf>r.length)throw new Error;const f=r.Wu,u=r.Wu,d=r.Uu,w=r.Uu,y=new h(d,w,c);y.wT=f,y.yT=u,y.Xa=o,y.xw=a;const A=y.Fw,m=r.Wu;if(0===m){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.TT(h,r,this.Fw,n,a,s.A.Fw,e,o)}_T(){const t=this.Fw,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}Pv(){this.Xa|=0,this.xw|=0,this.Xa/=2,this.xw/=2,this.Xa|=0,this.xw|=0;const t=new Int8Array(this.Xa*this.xw);let i=0;for(let e=0;e>1)+(e+this.yT>>1)*this.Xa]=this.Fw[i++];this.Fw=t,this.width=this.Xa,this.height=this.xw,this.wT=0,this.yT=0}zw(){if(this.width===this.Xa&&this.height===this.xw)return;const t=new Int8Array(this.Xa*this.xw);let i=0;for(let e=0;e>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,n){try{const r=this.width;this.height;let h=0,o=0;const a=this.Xa,l=this.xw,c=(a<<16)/e|0,f=(l<<16)/n|0;t=t+(this.wT*e+a-1)/a|0,i=i+(this.yT*n+l-1)/l|0,this.wT*e%a!=0&&(h=(a-this.wT*e%a<<16)/e|0),this.yT*n%l!=0&&(o=(l-this.yT*n%l<<16)/n|0),e=e*(this.width-(h>>16))/a|0,n=n*(this.height-(o>>16))/l|0;let u,d=t+i*s.A.Bw,w=s.A.Bw-e;is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right&&(u=t+e-s.A.right,e-=u,w+=u),this.OT(s.A.Fw,this.Fw,this.palette,h,o,d,w,e,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}OT(t,i,e,s,n,r,h,o,a,l,c,f){try{const u=s;for(let d=-a;d<0;d++){const a=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+a];0==n?r++:t[r++]=e[255&n],s+=l}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(8950),n=e(1069),r=e(4474);class h{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}RT(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}ST(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=e(9298);class a extends r.A{static LT='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static xT=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let e=a.LT.indexOf(String.fromCharCode(i));t&&e>=63&&e--,-1===e&&(e=74),a.xT[i]=e}}kT=[];MT=new Int32Array(94);DT=new Int32Array(94);NT=new Int32Array(94);FT=new Int32Array(94);BT=new Int32Array(95);UT=new Int32Array(256);random=new h(BigInt(Date.now()));height=0;static cc=(t,i)=>{const e=new n.A(t.read(i+'.dat')),s=new n.A(t.read('index.dat'));s.Yf=e.Uu+4;const r=s.Wu;r>0&&(s.Yf+=3*(r-1));const h=new a;for(let t=0;t<94;t++){h.NT[t]=s.Wu,h.FT[t]=s.Wu;const i=h.MT[t]=s.Uu,n=h.DT[t]=s.Uu,r=s.Wu,o=i*n;if(h.kT[t]=new Int8Array(o),0===r)for(let s=0;sh.height&&(h.height=n),h.NT[t]=1,h.BT[t]=i+2;{let e=0;for(let s=n/7|0;s=s.A.bottom&&(r-=e+r+1-s.A.bottom),i=s.A.right){const t=i+n+1-s.A.right;n-=t,l+=t,a+=t}n>0&&r>0&&this.XT(n,r,t,c,l,s.A.Fw,o,a,h)}HT(t,i,e,n,r,h,o){e|=0,n|=0;let a=(t|=0)+(i|=0)*s.A.Bw,l=s.A.Bw-e,c=0,f=0;if(i=s.A.bottom&&(n-=i+n+1-s.A.bottom),t=s.A.right){const i=t+e+1-s.A.right;e-=i,c+=i,l+=i}e>0&&n>0&&this.jT(e,n,s.A.Fw,a,l,o,f,c,r,h)}XT(t,i,e,s,n,r,h,o,a){const l=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=l;t<0;t++)0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a;for(let i=t;i<0;i++)0===e[s++]?h++:r[h++]=a;h+=o,s+=n}}jT(t,i,e,s,n,r,h,o,a,l){t|=0;const c=((16711935&a)*l&4278255360)+((65280&a)*l&16711680)>>8,f=256-l;for(let a=-(i|=0);a<0;a++){for(let i=-t;i<0;i++)if(0===r[h++])s++;else{const t=e[s];e[s++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}s+=n,h+=o}}WT(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.qa:'cya'===t?o.A.nv:'mag'===t?o.A.xm:'whi'===t?o.A.La:'bla'===t?o.A.Za:'lre'===t?o.A.rv:'dre'===t?o.A.hv:'dbl'===t?o.A.ov:'or1'===t?o.A.av:'or2'===t?o.A.lv:'or3'===t?o.A.cv:'gr1'===t?o.A.fv:'gr2'===t?o.A.uv:'gr3'===t?o.A.dv:o.A.Za}split(t,i){if(0===t.length)return[t];const e=[];for(;t.length>0;){if(this.GT(t)<=i&&-1===t.indexOf('|')){e.push(t);break}let s=t.length;for(let e=0;ei)break;s=e}else if('|'===t[e]){s=e;break}e.push(t.substring(0,s)),t=t.substring(s+1)}return e}}},1183:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(8950),n=e(7854);class r{zT;width;height;ZT;qT;Fw;constructor(t,i,e=n.na){this.ZT=e,this.zT=this.ZT.getImageData(0,0,t,i),this.qT=new Uint32Array(this.zT.data.buffer),this.Fw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.Fw.fill(0)}bind(){s.A.bind(this.Fw,this.width,this.height)}draw(t,i){this.#t(),this.ZT.putImageData(this.zT,t,i)}#t(){const t=this.Fw.length,i=this.Fw,e=this.qT;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,i,e)=>{e.d(i,{A:()=>s});class s{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));zo=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Qo=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};JT=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}},2901:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(1908);class r{static JT=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.QT)return null;if(this.nO[t])return this.nO[t];const i=this.sO[t],e=i+this.eO[t];if(this.$T){const s=Uint8Array.from(this.buffer.subarray(i,i+e));return this.nO[t]=s,s}{const i=Uint8Array.from(n.A.read(this.iO[t],this.buffer,this.eO[t],this.sO[t]));return this.nO[t]=i,i}}}},1069:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(9234),n=e(6666),r=e(4474);class h extends r.A{static hO=3988292384;static oO=new Int32Array(256);static aO=new Uint32Array(33);static lO=new n.A;static cO=new n.A;static fO=new n.A;static uO=0;static dO=0;static wO=0;static{for(let t=0;t<32;t++)h.aO[t]=(1<>>=1:i=i>>>1^h.hO;h.oO[t]=i}}static Zo=t=>{let i=4294967295;for(let e=0;e>>8^h.oO[255&(i^t[e])];return~i};view;data;Yf=0;yO=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.Yf}static Ut=t=>{let i=null;return 0===t&&h.uO>0?(h.uO--,i=h.lO.lI()):1===t&&h.dO>0?(h.dO--,i=h.cO.lI()):2===t&&h.wO>0&&(h.wO--,i=h.fO.lI()),i?(i.Yf=0,i):new h(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.Yf=0,100===this.view.byteLength&&h.uO<1e3?(h.lO.rm(this),h.uO++):5e3===this.view.byteLength&&h.dO<250?(h.cO.rm(this),h.dO++):3e4===this.view.byteLength&&h.wO<50&&(h.fO.rm(this),h.wO++)}get Wu(){return this.view.getUint8(this.Yf++)}get Jd(){return this.view.getInt8(this.Yf++)}get Uu(){const t=this.view.getUint16(this.Yf);return this.Yf+=2,t}get Gu(){const t=this.view.getInt16(this.Yf);return this.Yf+=2,t}get yd(){const t=this.view.getUint8(this.Yf++)<<16|this.view.getUint16(this.Yf);return this.Yf+=2,t}get ia(){const t=this.view.getInt32(this.Yf);return this.Yf+=4,t}get EE(){const t=this.view.getBigInt64(this.Yf);return this.Yf+=8,t}get QE(){return this.view.getUint8(this.Yf)<128?this.Wu-64:this.Uu-49152}get Pm(){return this.view.getUint8(this.Yf)<128?this.Wu:this.Uu-32768}get Vu(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.Yf++))&&this.Yf>16),this.view.setUint16(this.Yf,t),this.Yf+=2}p4(t){this.view.setInt32(this.Yf,t),this.Yf+=4}gO(t){this.view.setInt32(this.Yf,t,!0),this.Yf+=4}IO(t){this.view.setBigInt64(this.Yf,t),this.Yf+=8}_O(t){const i=this.view,e=t.length;for(let s=0;s>>3}TO(t){let i=this.yO>>>3,e=8-(7&this.yO),s=0;for(this.yO+=t;t>e;e=8)s+=(this.view.getUint8(i++)&h.aO[e])<>>e-t&h.aO[t],s}OO(t,i){const e=this.Yf;this.Yf=0;const n=new Uint8Array(e);this.AO(e,0,n);const r=(0,s.RO)(n),h=(0,s.SO)(r,i,t),o=(0,s.LO)(h);this.Yf=0,this.p1(o.length),this.CO(o,o.length,0)}}},5226:(t,i,e)=>{e.d(i,{Q:()=>n,x:()=>s});class s{xO=new Map;Eo;xo=self.isSecureContext?self.crypto.randomUUID():'0';constructor(t){this.Eo=t}async Ko(){const t=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),i=t.createDataChannel('channel'),e=crypto.randomUUID();this.xO.set(e,i),await t.setLocalDescription(await t.createOffer()),t.onicegatheringstatechange=async()=>{if('complete'===t.iceGatheringState){let i;self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(t.localDescription)):console.log(JSON.stringify(t.localDescription));try{for(;null===(i=prompt('Offer copied to clipboard, paste answer here')););t.setRemoteDescription(new RTCSessionDescription(JSON.parse(i)))}catch(t){console.error(t)}}},i.onopen=()=>{i.send(JSON.stringify({type:'id',id:e})),console.log('Connected to peer!')},i.onerror=t=>{console.error(t)},i.onmessage=t=>{const i=JSON.parse(t.data);i.data&&(i.data=Object.values(i.data)),this.Eo&&this.Eo.postMessage(i)}}postMessage(t){const i=this.xO.get(t.data.id),e=t.data;e.data&&(e.data=Array.from(t.data.data)),i&&'open'===i.readyState&&i.send(JSON.stringify(e))}}class n{pc;Lo=void 0;xo;constructor(t){this.pc=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),this.pc.ondatachannel=i=>{this.Lo=i.channel,this.Lo.onopen=()=>{console.log('Connected to host!')},this.Lo.onerror=t=>{console.error(t)},this.Lo.onmessage=i=>{if(!this.xo){const t=JSON.parse(i.data);if('id'===t.type)return void(this.xo=t.id)}t.onmessage&&t.onmessage(i)}},this.pc.onicegatheringstatechange=async()=>{'complete'===this.pc.iceGatheringState&&(self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(this.pc.localDescription)):console.log(JSON.stringify(this.pc.localDescription)))}}async Xo(t){await this.pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(t))),await this.pc.setLocalDescription(await this.pc.createAnswer())}}},3937:(t,i,e)=>{e.d(i,{A:()=>o});class s{start=0;end=0;form=0;length=0;kO=null;MO=null;threshold=0;position=0;delta=0;amplitude=0;DO=0;read(t){this.form=t.Wu,this.start=t.ia,this.end=t.ia,this.length=t.Wu,this.kO=new Int32Array(this.length),this.MO=new Int32Array(this.length);for(let i=0;i=this.threshold&&this.MO&&this.kO&&(this.amplitude=this.MO[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this.kO[this.position]/65536*t|0,this.threshold>this.DO&&(this.delta=((this.MO[this.position]<<15)-this.amplitude)/(this.threshold-this.DO)|0)),this.amplitude+=this.delta,this.DO++,this.amplitude-this.delta>>15}}class n{static buffer=null;static sm=null;static sin=null;static NO=new Int32Array(5);static FO=new Int32Array(5);static BO=new Int32Array(5);static UO=new Int32Array(5);static PO=new Int32Array(5);WO=null;GO=null;YO=null;HO=null;VO=null;KO=null;release=null;attack=null;XO=new Int32Array(5);jO=new Int32Array(5);zO=new Int32Array(5);start=0;length=500;ZO=100;qO=0;static init=()=>{this.sm=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.sm[t]=1:this.sm[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};JO(t,i){for(let i=0;i>1,h+=(i*s>>16)+r}if(this.VO&&this.KO){const i=this.VO.evaluate(t),e=this.KO.evaluate(t);c=c*(32768+(this.$O(e,l,this.VO.form)>>1))>>15,l+=(i*o>>16)+a}for(let s=0;s<5;s++)if(0!==this.XO[s]){const r=i+n.FO[s];r>15,n.NO[s],this.WO.form),n.NO[s]+=(e*n.UO[s]>>16)+n.PO[s])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,e=!0;for(let s=0;s>8):this.release.start+((this.release.end-this.release.start)*h>>8),i+=256,i>=o&&(i=0,e=!e),e&&(n.buffer[s]=0)}}if(this.qO>0&&this.ZO>0){const i=this.qO*e;for(let e=i;e32767&&(n.buffer[i]=32767);return n.buffer}$O(t,i,e){return 1===e?(32767&i)<16384?t:-t:2===e?n.sin[32767&i]*t>>14:3===e?((32767&i)*t>>14)-t:4===e?n.sm[i/2607&32767]*t:0}read(t){this.WO=new s,this.WO.read(t),this.GO=new s,this.GO.read(t),0!==t.Wu&&(t.Yf--,this.YO=new s,this.YO.read(t),this.HO=new s,this.HO.read(t)),0!==t.Wu&&(t.Yf--,this.VO=new s,this.VO.read(t),this.KO=new s,this.KO.read(t)),0!==t.Wu&&(t.Yf--,this.release=new s,this.release.read(t),this.attack=new s,this.attack.read(t));for(let i=0;i<10;i++){const e=t.Pm;if(0===e)break;this.XO[i]=e,this.jO[i]=t.QE,this.zO[i]=t.Pm}this.qO=t.Pm,this.ZO=t.Pm,this.length=t.Uu,this.start=t.Uu}}var r=e(1069),h=e(3867);class o{static QO=new Int32Array(1e3);static tR=null;static iR=null;static eR=new h.fe(1e3,null);sR=new h.fe(10,null);nR=0;loopEnd=0;static wc=t=>{const i=new r.A(t.read('sounds.dat'));for(this.tR=new Uint8Array(441e3),this.iR=new r.A(this.tR),n.init();;){const t=i.Uu;if(65535===t)break;const e=new o;e.read(i),this.eR[t]=e,this.QO[t]=e.trim()}};static JO=(t,i)=>{if(!this.eR[t])return null;const e=this.eR[t];return e?.rR(i)??null};read(t){for(let i=0;i<10;i++)0!==t.Wu&&(t.Yf--,this.sR[i]=new n,this.sR[i]?.read(t));this.nR=t.Uu,this.loopEnd=t.Uu}trim(){let t=9999999;for(let i=0;i<10;i++)this.sR[i]&&(this.sR[i].start/20|0)i&&(i=this.sR[t].length+this.sR[t].start);if(0===i)return 0;let e=22050*i/1e3|0,s=22050*this.nR/1e3|0,n=22050*this.loopEnd/1e3|0;(s<0||n<0||n>e||s>=n)&&(t=0);let r=e+(n-s)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){s+=44,n+=44,e+=44,r+=44;const i=r-e;for(let t=e-1;t>=n;t--)o.tR&&(o.tR[t+i]=o.tR[t]);for(let i=1;i{e.d(i,{bm:()=>l,vm:()=>o,fe:()=>s,jm:()=>n,Eh:()=>r,Hm:()=>h,Xr:()=>a});class s extends Array{constructor(t,i){super(t);for(let e=0;e{e.d(i,{LO:()=>o,Jo:()=>n,RO:()=>h,$o:()=>s,ec:()=>r,SO:()=>a});const s=async t=>new Promise((i=>setTimeout(i,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),r=async t=>(await fetch(t)).text();function h(t){let i=0n;for(let e=0;e0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function a(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}},7953:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static hR=new Uint16Array(['d','o','t'].join('').split('').map((t=>t.charCodeAt(0))));static oR=new Uint16Array(['(','a',')'].join('').split('').map((t=>t.charCodeAt(0))));static aR=new Uint16Array(['s','l','a','s','h'].join('').split('').map((t=>t.charCodeAt(0))));static lR=['cook',"cook's",'cooks','seeks','sheet'];static cR=[];static fR=[];static uR=[];static dR=[];static wR=[];static yR=[];static wc=t=>{const i=new s.A(t.read('fragmentsenc.txt')),e=new s.A(t.read('badenc.txt')),n=new s.A(t.read('domainenc.txt')),r=new s.A(t.read('tldlist.txt'));this.read(e,n,i,r)};static filter=t=>{const i=[...t];this.format(i);const e=i.join('').trim(),s=e.toLowerCase(),n=[...s];this.AR(n),this.mR(n),this.pR(n),this.gR(n);for(let t=0;t{this.CR(t),this.ER(i),this.vR(e),this.bR(s)};static bR=t=>{const i=t.ia;for(let e=0;et.Wu))};static CR=t=>{const i=t.ia;for(let e=0;et.Wu));const i=new Array(t.Wu).fill([]).map((()=>[t.Jd,t.Jd]));i.length>0&&(this.dR[e]=i)}};static ER=t=>{const i=t.ia;for(let e=0;et.Wu))};static vR=t=>{const i=t.ia;for(let e=0;e{const i=[...t],e=[...t];this.TR(null,i,this.hR),this.TR(null,e,this.aR);for(let s=0;s{for(let i=0;i<2;i++)for(let i=this.uR.length-1;i>=0;i--)this.TR(this.dR[i],t,this.uR[i])};static pR=t=>{const i=[...t],e=[...t];this.TR(null,i,this.oR),this.TR(null,e,this.hR);for(let s=this.wR.length-1;s>=0;s--)this.RR(e,i,this.wR[s],t)};static gR=t=>{for(let i=0;i=0&&n{if(this.NR(t))return!0;const i=this.FR(t),e=this.yR,s=e.length;if(i===e[0]||i===e[s-1])return!0;let n=0,r=s-1;for(;n<=r;){const t=(n+r)/2|0;if(i===e[t])return!0;i{if(t.length>6)return 0;let i=0;for(let e=0;e{for(let e=i;e=0;e++)if(this.UR(t[e]))return e;return-1};static MR=(t,i)=>{for(let e=t;e=0;e++)if(!this.UR(i[e]))return e;return i.length};static PR=(t,i,e)=>i===e||'o'===i&&'0'===e?1:'o'===i&&'('===e&&')'===t?2:'c'!==i||'('!==e&&'<'!==e&&'['!==e?'e'===i&&'€'===e||'s'===i&&'$'===e||'l'===i&&'i'===e?1:0:1;static RR=(t,i,e,s)=>{const n=e.length,r=s.length;for(let h=0;h<=r-n;h++){const{WR:n,GR:r}=this.YR(h,e,s);if(!n)continue;const o=this.HR(h,s,3,i,['@']),a=this.VR(r-1,s,3,t,['.',',']);(o>2||a>2)&&this.kR(h,r,s)}};static YR=(t,i,e)=>{const s=i.length;let n=t,r=0;for(;n0)n+=a,r++;else{if(0===r)break;const e=this.PR(o,String.fromCharCode(i[r-1]),h);if(e>0)n+=e,1===r&&t++;else{if(r>=s||!this.LR(h))break;n++}}}return{WR:r>=s,GR:n}};static TR=(t,i,e)=>{if(!(e.length>i.length))for(let s=0;s<=i.length-e.length;s++){let n=s;const{GR:r,KR:h,XR:o,jR:a,zR:l}=this.ZR(i,e,n);n=r;let c=i[n],f=n+1=e.length)||a&&l)continue;let u,d=!0;if(o){let t=!1,e=!1;if((s-1<0||this.LR(i[s-1])&&"'"!==i[s-1])&&(t=!0),(n>=i.length||this.LR(i[n])&&"'"!==i[n])&&(e=!0),!t||!e){let e=!1;for(u=s-2,t&&(u=s);!e&&u=0&&(!this.LR(i[u])||"'"===i[u])){const t=[];let s;for(s=0;s<3&&u+s=0&&(!this.LR(i[u-1])||"'"===i[u-1])&&(n=!1),n&&!this.DR(t)&&(e=!0)}u++}e||(d=!1)}}else{c=' ',s-1>=0&&(c=i[s-1]),f=' ',n{let s=e,n=0,r=0,h=!1,o=!1,a=!1;for(;s=t.length||o&&a);){const l=t[s],c=s+10)1===f&&this.UR(l)&&(o=!0),2===f&&(this.UR(l)||this.UR(c))&&(o=!0),s+=f,n++;else{if(0===n)break;let t;if((t=this.QR(c,String.fromCharCode(i[n-1]),l))>0)s+=t;else{if(n>=i.length||!this.xR(l))break;if(this.LR(l)&&"'"!==l&&(h=!0),this.UR(l)&&(a=!0),s++,r++,(100*r/(s-e)|0)>90)break}}}return{GR:s,KR:n,XR:h,jR:o,zR:a}};static QR=(t,i,e)=>{if(i===e)return 1;if(i>='a'&&i<='m'){if('a'===i)return'4'!==e&&'@'!==e&&'^'!==e?'/'===e&&'\\'===t?2:0:1;if('b'===i)return'6'!==e&&'8'!==e?'1'===e&&'3'===t?2:0:1;if('c'===i)return'('!==e&&'<'!==e&&'{'!==e&&'['!==e?0:1;if('d'===i)return'['===e&&')'===t?2:0;if('e'===i)return'3'!==e&&'€'!==e?0:1;if('f'===i)return'p'===e&&'h'===t?2:'£'===e?1:0;if('g'===i)return'9'!==e&&'6'!==e?0:1;if('h'===i)return'#'===e?1:0;if('i'===i)return'y'!==e&&'l'!==e&&'j'!==e&&'1'!==e&&'!'!==e&&':'!==e&&';'!==e&&'|'!==e?0:1;if('j'===i)return 0;if('k'===i)return 0;if('l'===i)return'1'!==e&&'|'!==e&&'i'!==e?0:1;if('m'===i)return 0}if(i>='n'&&i<='z'){if('n'===i)return 0;if('o'===i)return'0'!==e&&'*'!==e?'('===e&&')'===t||'['===e&&']'===t||'{'===e&&'}'===t||'<'===e&&'>'===t?2:0:1;if('p'===i)return 0;if('q'===i)return 0;if('r'===i)return 0;if('s'===i)return'5'!==e&&'z'!==e&&'$'!==e&&'2'!==e?0:1;if('t'===i)return'7'!==e&&'+'!==e?0:1;if('u'===i)return'v'===e?1:'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('v'===i)return'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('w'===i)return'v'===e&&'v'===t?2:0;if('x'===i)return')'===e&&'('===t||'}'===e&&'{'===t||']'===e&&'['===t||'>'===e&&'<'===t?2:0;if('y'===i)return 0;if('z'===i)return 0}return i>='0'&&i<='9'?'0'===i?'o'===e||'O'===e?1:'('===e&&')'===t||'{'===e&&'}'===t||'['===e&&']'===t?2:0:'1'===i&&'l'===e?1:0:','===i?'.'===e?1:0:'.'===i?','===e?1:0:'!'===i&&'i'===e?1:0};static JR=(t,i,e)=>{let s=0,n=i.length-1;for(;s<=n;){const r=(s+n)/2|0;if(i[r][0]===t&&i[r][1]===e)return!0;tthis.BR(t)?t.charCodeAt(0)+1-'a'.charCodeAt(0):"'"===t?28:this.UR(t)?t.charCodeAt(0)+29-'0'.charCodeAt(0):27;static OR=(t,i,e,s,n)=>{if(!(s.length>e.length))for(let r=0;r<=e.length-s.length;r++){const{GR:h,tS:o}=this.iS(e,s,r);if(o0&&c>0&&(a=!0),2===i&&(l>2&&c>0||l>0&&c>2)&&(a=!0),3===i&&l>0&&c>2&&(a=!0),!a)continue;let f,u=r,d=h-1,w=!1;if(l>2){if(4===l)for(w=!1,f=r-1;f>=0;f--)if(w){if('*'!==n[f])break;u=f}else'*'===n[f]&&(u=f,w=!0);for(w=!1,f=u-1;f>=0;f--)if(w){if(this.LR(e[f]))break;u=f}else this.LR(e[f])||(w=!0,u=f)}if(c>2){if(4===c)for(w=!1,f=d+1;f{let s=0;for(;e0)e+=h,s++;else{if(0===s)break;let t;if((t=this.PR(r,String.fromCharCode(i[s-1]),n))>0)e+=t;else{if(!this.LR(n))break;e++}}}return{GR:e,tS:s}};static LR=t=>!this.$R(t)&&!this.UR(t);static xR=t=>!this.BR(t)||('v'===t||'x'===t||'j'===t||'q'===t||'z'===t);static $R=t=>this.BR(t)||this.eS(t);static UR=t=>t>='0'&&t<='9';static BR=t=>t>='a'&&t<='z';static eS=t=>t>='A'&&t<='Z';static NR=t=>{for(let i=0;i{for(let s=t;s{let e=0;for(let s=i-1;s>=0&&this.LR(t[s]);s--)'*'===t[s]&&e++;return e};static nS=(t,i)=>{let e=0;for(let s=i+1;s(n?this.sS(i,e):this.nS(i,e))>=s?4:this.LR(n?t[e-1]:t[e+1])?1:0;static HR=(t,i,e,s,n)=>{if(0===t)return 2;for(let e=t-1;e>=0&&this.LR(i[e]);e--)if(n.includes(i[e]))return 3;return this.rS(i,s,t,e,!0)};static VR=(t,i,e,s,n)=>{if(t+1===i.length)return 2;for(let e=t+1;e{let i=0;for(let e=0;et>=' '&&t<=''||' '===t||'\n'===t||'\t'===t||'£'===t||'€'===t;static IR=(t,i)=>{for(let e=0;e{let i=!0;for(let e=0;e{e.d(i,{A:()=>n});var s=e(9763);class n{static oS=null;static load=async t=>{this.oS=await(0,s.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,e,s)=>{if(!this.oS)throw new Error('bz2 not found!!');return Int8Array.from(this.oS.read(t,i,e,s))}}},123:(t,i,e)=>{function s(t,i,e){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256,e)}function n(t){window._tinyMidiStop&&window._tinyMidiStop(t)}e.d(i,{ea:()=>s,ko:()=>n})},2604:(t,i,e)=>{function s(t,i){var e;(e=document.createElement('a')).href=t,e.download=i,document.body.appendChild(e),e.style='display: none',e.click(),e.remove()}e.d(i,{A:()=>s})},9763:(t,i,e)=>{async function s(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,a=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,a,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(a),a}(a,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(l,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function a(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function l(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}e.d(i,{F:()=>s})},9896:(t,i,e)=>{var s=e(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{const t=2,i=44100;let e=new Float32Array,n=window.audioContext.createGain();n.gain.setValueAtTime(.1,window.audioContext.currentTime),n.connect(window.audioContext.destination);let r=window.audioContext.currentTime,h=[];const o=new s.A({aS:30,lS:t=>{let i=new Float32Array(t.buffer),s=new Float32Array(e.length+i.length);s.set(e,0),s.set(i,e.length),e=s},cS:t=>{},bufferSize:102400});await o.init();const a=await fetch('./SCC1_Florestan.sf2'),l=new Uint8Array(await a.arrayBuffer());function c(){if(!window.audioContext||!e.length)return;let s=window.audioContext.createBufferSource();const o=e.length/t,a=window.audioContext.createBuffer(t,o,i);for(let i=0;i{t.stop(window.audioContext.currentTime)})),h=[],n.gain.setValueAtTime(t,window.audioContext.currentTime)}}function d(t,i){-1!==t&&window._tinyMidiVolume(t),r=window.audioContext.currentTime,f=setInterval(c,250),o.fS(i)}o.uS(l),window._tinyMidiStop=async t=>{t?function(t){const i=window.audioContext.currentTime;n.gain.cancelScheduledValues(i),n.gain.setTargetAtTime(0,i,.5),setTimeout(t,2e3)}((()=>{u()})):u()},window._tinyMidiVolume=(t=1)=>{n.gain.setValueAtTime(t,window.audioContext.currentTime)},window._tinyMidiPlay=async(t,i,e)=>{t&&(await window._tinyMidiStop(e),e?setTimeout((()=>{d(i,t)}),2e3):d(i,t))}})()},8151:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5473);const n=class{constructor(t={}){this.dS=void 0,this.wS=0,this.yS=0,this.AS=0,this.aS=t.aS||100,this.sampleRate=t.sampleRate||44100,this.mS=t.mS||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.pS(1),this.lS=t.lS||(()=>{}),this.cS=t.cS||(()=>{}),this.gS=void 0,this.test=0}async init(){if(!this.dS){if('undefined'!=typeof process){const{IS:t}=await import('path'),{_S:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.dS=await(0,s.A)(),this.CS=this.dS._malloc(this.bufferSize),this.ES=this.dS._malloc(8)}}pS(t){this.bufferSize=4*this.sampleRate*this.mS*t}vS(){if(!this.dS)throw new Error(`${this.constructor.name} not initalized. call .init()`)}uS(t){this.vS();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.dS;e(this.wS),this.wS=i(t.length),this.dS.HEAPU8.set(t,this.wS),this.yS=s(this.wS,t.length),n(this.yS,2===this.mS?0:2,this.sampleRate,this.gain)}bS(){this.vS();const t=new Uint8Array(this.bufferSize);return t.set(this.dS.HEAPU8.subarray(this.CS,this.CS+this.bufferSize)),t}TS(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.dS;return e(this.AS),this.AS=i(t.length),this.dS.HEAPU8.set(t,this.AS),s(this.AS,t.length)}OS(t){const{_midi_render:i}=this.dS;return i(this.yS,t,this.mS,this.sampleRate,this.CS,this.bufferSize,this.ES)}fS(t){if(this.vS(),!this.yS)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.gS);const{setValue:i,getValue:e}=this.dS;i(this.ES,0,'double'),this.dS._tsf_reset(this.yS),this.dS._tsf_channel_set_bank_preset(this.yS,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.TS(t);const n=()=>{s=this.OS(s);const t=this.bS();this.lS(t),s?this.gS=setTimeout(n,this.aS):this.cS(e(this.ES,'double'))};this.gS=setTimeout(n,16)}}},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,e)=>{var s;e.d(i,{A:()=>n});const n=(s="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,n,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,e){i=t,n=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(r.ready,t)||Object.defineProperty(r.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var h=Object.assign({},r),o=[],a='object'==typeof window,l='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!a&&!c&&!l;if(r.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var A,m;y=l?require('path').IS(y)+'/':__dirname+'/';var p=()=>{m||(A=require('fs'),m=require('path'))};u=(t,i)=>(p(),t=m.normalize(t),A.RS(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,e)=>{p(),t=m.normalize(t),A.SS(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),r.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,e){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!a&&!l)throw new Error('environment detection error');if(l?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),s&&(y=s),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},l&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}r.print||console.log.bind(console);var g,I,_=r.printErr||console.warn.bind(console);function C(t,i){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(r,h),h=null,g='fetchSettings',Object.getOwnPropertyDescriptor(r,g)&&j('`Module.'+g+'` was supplied but `'+g+'` not included in INCOMING_MODULE_JS_API'),r.arguments&&(o=r.arguments),C('arguments','arguments_'),r.thisProgram&&r.thisProgram,C('thisProgram','thisProgram'),r.quit&&r.quit,C('quit','quit_'),D(void 0===r.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===r.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===r.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===r.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===r.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),r.wasmBinary&&(I=r.wasmBinary),C('wasmBinary','wasmBinary');var v;r.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,O,R,S,L,x,k,M=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function N(t){b=t,r.HEAP8=T=new Int8Array(t),r.HEAP16=R=new Int16Array(t),r.HEAP32=S=new Int32Array(t),r.HEAPU8=O=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=L=new Uint32Array(t),r.HEAPF32=x=new Float32Array(t),r.HEAPF64=k=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var F=5242880;r.TOTAL_STACK&&D(F===r.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=r.INITIAL_MEMORY||16777216;function U(){if(!M){var t=ft(),i=L[t>>2],e=L[t+4>>2];34821223==i&&2310721022==e||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==L[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=F,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+F+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!r.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var P=[],W=[],G=[],Y=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var H=0,V=null,K=null,X={};function j(t){r.onAbort&&r.onAbort(t),_(t='Aborted('+t+')'),M=!0;var i=new WebAssembly.RuntimeError(t);throw n(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},LS:function(){z.error()},xS:function(){z.error()},kS:function(){z.error()},open:function(){z.error()},MS:function(){z.error()},DS:function(){z.error()},NS:function(){z.error()},BS:function(){z.error()},US:function(){z.error()}};r.FS_createDataFile=z.LS,r.FS_createPreloadedFile=z.xS;var Z,q,J,$,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=r.asm),D(Y,'native function `'+e+'` called before runtime initialization'),s[t]||D(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==Z&&I)return new Uint8Array(I);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(r)}function ht(t){ht.PS||(ht.PS={}),ht.PS[t]||(ht.PS[t]=1,c&&(t='warning: '+t),_(t))}function ot(t){try{return v.grow(t-b.byteLength+65535>>>16),N(v.buffer),1}catch(i){_('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}r.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=r.locateFile?r.locateFile(q,y):y+q):Z=new URL(e(8227),e.b).toString();var at,lt={"emscripten_memcpy_big":function(t,i,e){O.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=O.length;D((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return _('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return _('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':lt,'wasi_snapshot_preview1':lt};function e(t,i){var e,s=t.exports;r.asm=s,D(v=r.asm.memory,"memory not found in wasm exports"),N(v.buffer),D(r.asm.__indirect_function_table,"table not found in wasm exports"),e=r.asm.__wasm_call_ctors,W.unshift(e),function(t){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(X[t]),delete X[t]):_('warning: run dependency removed without ID'),0==H&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',H++,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(M)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,_('still waiting on run dependencies:')),_('dependency: '+i);t&&_('(end of list)')}),1e4))):_('warning: run dependency added without ID');var s=r;function h(t){D(r===s,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),s=null,e(t.instance)}function o(t){return function(){if(!I&&(a||l)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return st(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){_('failed to asynchronously prepare wasm: '+t),it(Z)&&_('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(r.instantiateWasm)try{return r.instantiateWasm(i,e)}catch(t){_('Module.instantiateWasm callback failed with error: '+t),n(t)}(I||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(h):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return _('wasm streaming compile failed: '+t),_('falling back to ArrayBuffer instantiation'),o(h)}))}))).catch(n)}(),r.___wasm_call_ctors=et("__wasm_call_ctors"),r._malloc=et("malloc"),r._free=et("free"),r._tsf_load_memory=et("tsf_load_memory"),r._tsf_close=et("tsf_close"),r._tsf_reset=et("tsf_reset"),r._tsf_set_output=et("tsf_set_output"),r._tsf_set_max_voices=et("tsf_set_max_voices"),r._realloc=et("realloc"),r._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),r._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),r._tml_load_memory=et("tml_load_memory"),r._midi_render=et("midi_render"),r.___errno_location=et("__errno_location"),r._fflush=et("fflush"),r._emscripten_stack_init=function(){return(ct=r._emscripten_stack_init=r.asm.emscripten_stack_init).apply(null,arguments)}),ft=(r._emscripten_stack_get_free=function(){return(r._emscripten_stack_get_free=r.asm.emscripten_stack_get_free).apply(null,arguments)},r._emscripten_stack_get_base=function(){return(r._emscripten_stack_get_base=r.asm.emscripten_stack_get_base).apply(null,arguments)},r._emscripten_stack_get_end=function(){return(ft=r._emscripten_stack_get_end=r.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),L[t>>2]=34821223,L[t+4>>2]=2310721022,L[0]=1668509029}function dt(t){function e(){at||(at=!0,r.calledRun=!0,M||(D(!Y),Y=!0,U(),rt(W),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),D(!r._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),G.unshift(t);var t;rt(G)}()))}t=t||o,H>0||(ut(),function(){if(r.preRun)for('function'==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),P.unshift(t);var t;rt(P)}(),H>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),e()}),1)):e(),U()))}if(r.stackSave=et("stackSave"),r.stackRestore=et("stackRestore"),r.stackAlloc=et("stackAlloc"),r.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':T[0|t]=i;break;case'i16':R[t>>1]=i;break;case'i32':S[t>>2]=i;break;case'i64':$=[i>>>0,(J=i,+Math.abs(J)>=1?J>0?(0|Math.min(+Math.floor(J/4294967296),4294967295))>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],S[t>>2]=$[0],S[t+4>>2]=$[1];break;case'float':x[t>>2]=i;break;case'double':k[t>>3]=i;break;case'*':L[t>>2]=i;break;default:j('invalid type for setValue: '+e)}},r.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return T[0|t];case'i16':return R[t>>1];case'i32':case'i64':return S[t>>2];case'float':return x[t>>2];case'double':return k[t>>3];case'*':return L[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),K=function t(){at||dt(),at||(K=t)},r.preInit)for('function'==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return dt(),t.ready})}},r={};function h(t){var i=r[t];if(void 0!==i)return i.exports;var e=r[t]={exports:{}};return n[t](e,e.exports,h),e.exports}h.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",e="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",s=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},h.a=(n,r,h)=>{var o;h&&((o=[]).d=-1);var a,l,c,f=new Set,u=n.exports,d=new Promise(((t,i)=>{c=i,l=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,r((n=>{var r;a=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var r=[];r.d=0,n.then((t=>{h[i]=t,s(r)}),(t=>{h[e]=t,s(r)}));var h={};return h[t]=t=>t(r),h}}var o={};return o[t]=t=>{},o[i]=n,o})))(n);var h=()=>a.map((t=>{if(t[e])throw t[e];return t[i]})),l=new Promise((i=>{(r=()=>i(h)).r=0;var e=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(r.r++,t.push(r)));a.map((i=>i[t](e)))}));return r.r?l:h()}),(t=>(t?c(d[e]=t):l(u),s(o)))),o&&o.d<0&&(o.d=0)},h.d=(t,i)=>{for(var e in i)h.o(i,e)&&!h.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},h.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),h.p="/Client2/",h.b=document.baseURI||self.location.href;h(1375)})(); \ No newline at end of file diff --git a/items.js b/items.js index 84c76521..d99ef3ce 100644 --- a/items.js +++ b/items.js @@ -1 +1 @@ -(()=>{"use strict";var t,e,i,s,n={1651:(t,e,i)=>{i.d(e,{K:()=>D});var s=i(1120),n=i(4583),r=i(2901),h=i(1069),o=i(7046),l=(i(9896),i(6666)),a=i(3045),c=i(818),f=i(670),u=i(8268),d=i(3867),w=i(7854),y=i(8950),A=i(1302),m=i(9298),p=i(8665),g=i(1312),_=i(3819),I=i(8317),C=i(9234),E=i(1908),v=i(123),b=i(5637),T=i(6948),O=i(2164),R=i(8738),L=i(3764),S=i(8534),x=i(6730),M=i(2604),k=i(5226);class D extends o.A{static tt=225;static et=10;static portOffset=0;static members=!0;static it=!1;static st='';static nt='';static rt=!1;static ht=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static gt=0;static _t=0;static It=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Ot=0;static Rt=()=>{a.A.it=!1,n.A.it=!1,D.it=!1,c.A.it=!1};static Lt=()=>{a.A.it=!0,n.A.it=!0,D.it=!0,c.A.it=!0};St=2048;xt=2047;Mt=!1;kt=!1;Dt=!1;Nt=!1;db=null;Ft=0;Bt=[];stream=null;in=h.A.Pt(1);Ut=h.A.Pt(1);Gt=h.A.Pt(1);Wt=0n;Yt=0;Ht=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;Jt=!0;$t=0;Qt=0;te=null;ee=null;ie=null;se=null;ne=null;re=null;he=null;oe=null;le=null;ae=null;ce=null;fe='';ue='';username='';password='';de=null;we=null;ye=null;Ae=null;me=[];pe=!1;ge=null;_e=null;Ie=null;Ce=null;Ee=null;ve=null;be=null;Te=null;Oe=null;Re=null;Le=new Int32Array(256);Se=0;xe=0;Me=0;ke=null;De=null;Ne=null;Fe=null;Be=null;Pe=null;Ue=null;Ge=null;We=null;Ye=null;He=null;Ve=null;Ke=null;Xe=null;je=null;ze=null;Ze=null;qe=null;Je=null;$e=null;Qe=null;ti=new Int32Array(33);ei=new Int32Array(33);ii=new Int32Array(151);si=new Int32Array(151);ni=null;ri=null;hi=null;oi=null;li=null;ai=null;ci=new d.fi(13,null);ui=null;di=null;wi=new d.fi(50,null);yi=new d.fi(50,null);Ai=new d.fi(20,null);mi=new d.fi(20,null);pi=null;gi=new d.fi(8,null);_i=null;Ii=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Oi=null;Ri=null;Li=null;Si=null;xi=null;Mi=null;ki=null;Di=null;Ni=null;Fi=null;Bi=null;Pi=new d.fi(1e3,null);Ui=!1;Gi=!1;Wi=!1;Yi=!1;Hi=-1;Vi=0;Ki=0;Xi=0;ji=0;zi=0;Zi=0;qi=!1;Ji=0;$i=0;Qi=0;ts=0;es=0;ss=0;ns=[];rs=-1;hs=-1;os=new s.A;ls=78;cs=0;fs=0;us=[];ds=0;ws=0;ys=0;As=0;ps=0;gs=0;_s=0;Is=0;Cs=[];Es=[];vs=[];bs=[];Ts=null;Os=-1;Rs=3;Ls=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Ss=0;xs=0;Ms=0;ks=!1;Ds=0;Ns=!1;Fs='';Bs='';Ps=0;Us='';Gs=!1;Ws=-1;Ys=new d.fi(100,null);Hs=new d.fi(100,null);messageType=new Int32Array(100);Vs=new Int32Array(100);Ks=0;Xs=0;js=0;zs='';Zs=0;qs=0;Js=0;$s=0;Qs=0;tn=0;en=0;sn=0;nn=0;rn=!1;hn=0;ln=0;an=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;An=!1;mn=[];pn=[];gn=0;_n=0;In=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);On=new Int32Array(500);Rn=0;Ln=0;Sn=0;xn='';Mn=!1;kn=-1;Dn=0;Nn=0;Fn=0;Bn=0;Pn=0;Un=new Int32Array(1e3);Gn=new Int32Array(1e3);Wn=null;Yn=0;Hn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;Jn=0;$n=2;Qn=2;tr=1;er=new Int32Array(5);ir=new d.fi(5,!1);sr=new Int32Array(5);nr=new Int32Array(5);rr=new Int32Array(5);hr=0;lr=0;ar=0;cr=0;ur=0;dr=0;wr=0;yr=0;Ar=0;mr=1;pr=2;gr=-1;_r=0;Ir=0;Cr=0;Er=0;vr=0;br=0;Tr=null;Or=null;Rr=null;Lr=0;Sr=0;Mr=new Int8Array(16384);kr=new d.fi(f.A.Dr,null);Nr=0;Fr=0;Br=128;Pr=0;Ur=0;Gr=0;Wr=0;Yr=0;Hr=null;Vr=null;Kr=new d.Xr(f.A.jr,f.A.jr);zr=0;Zr=0;qr=0;Jr=0;$r=0;Qr=0;th=0;eh=0;ih=0;sh=0;nh=0;rh=0;hh=new d.fi(this.St,null);oh=0;lh=new Int32Array(this.St);ah=0;fh=0;uh=new Int32Array(this.St);dh=new Int32Array(1e3);wh=new d.fi(this.St,null);yh=new d.fi(8192,null);Ah=0;mh=new Int32Array(8192);ph=new l.A;gh=new l.A;_h=new l.A;Ih=new l.A;Ch=new d.Eh(f.A.Dr,f.A.jr,f.A.jr,null);bh=new l.A;Th=new Int32Array(4e3);Oh=new Int32Array(4e3);Rh=new Int32Array(f.A.jr*f.A.jr);Lh=new Int32Array(f.A.jr*f.A.jr);Sh=0;xh=null;Mh=0;kh=0;Dh=-1;Nh=0;Fh=0;Bh=0;Ph=0;Uh=!1;Gh=!0;Wh=!1;Yh=new Int32Array(7);Hh=new Int32Array(5);Vh=0;Kh=0;static Xh=50;jh=new Int32Array(D.Xh);zh=new Int32Array(D.Xh);Zh=new Int32Array(D.Xh);qh=new Int32Array(D.Xh);Jh=new Int32Array(D.Xh);$h=new Int32Array(D.Xh);Qh=new Int32Array(D.Xh);eo=new d.fi(D.Xh,null);io=new d.fi(100,null);so=new BigInt64Array(100);no=new Int32Array(100);ro=null;ho=0;oo=!0;lo=new Int32Array(50);ao=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;Ao=0;mo=!0;po=null;_o=0;Io=0;Co=192;Eo=void 0;vo=!1;host=null;bo=null;To=new d.fi(16,null);Oo=0;Ro=!1;Lo=()=>{try{this.stream&&this.stream.close()}catch(t){}this.bo&&'998'===D.getParameter('world')&&this.bo.So?.send(JSON.stringify({type:'close',id:this.bo.xo})),this.stream=null,(0,v.Mo)(!1),this.Ut=null,this.Gt=null,this.in=null,this.Rr=null,this.Tr=null,this.Or=null,this.Hr=null,this.Vr=null,this.Wn=null,this.kr=null,this.Rh=null,this.Lh=null,this.Th=null,this.Oh=null,this.Mr=null,this.De=null,this.Ne=null,this.Fe=null,this.Be=null,this.Pe=null,this.Ue=null,this.Ge=null,this.We=null,this.Ye=null,this.He=null,this.Ve=null,this.Ke=null,this.Xe=null,this.je=null,this.ze=null,this.Ze=null,this.qe=null,this.ni=null,this.hi=null,this.ri=null,this.oi=null,this.li=null,this.ai=null,this.ci=null,this.Ti=null,this.Oi=null,this.Ri=null,this.Li=null,this.Si=null,this.xi=null,this.Mi=null,this.ki=null,this.Di=null,this.Ni=null,this.di=null,this.Ai=null,this.mi=null,this.gi=null,this._i=null,this.Ii=null,this.Ci=null,this.Ei=null,this.wi=null,this.yi=null,this.Kr=null,this.hh=null,this.lh=null,this.uh=null,this.wh=null,this.dh=null,this.yh=null,this.mh=null,this.Ch=null,this.bh=null,this.Ih=null,this.ph=null,this.gh=null,this._h=null,this.Tn=null,this.On=null,this.vn=null,this.bn=null,this.ns=null,this.mn=null,this.Un=null,this.Gn=null,this.Pi=null,this.ui=null,this.io=null,this.so=null,this.no=null,this.se=null,this.ne=null,this.te=null,this.ee=null,this.ie=null,this.re=null,this.he=null,this.oe=null,this.le=null,this.ko(),b.A.Lo(),T.A.Lo(),A.A.Lo(),O.A.Do=null,I.A.Do=null,s.A.Do=null,g.A.Do=null,R.A.Do=null,R.A.No=null,L.A.Do=null,this.Fo=null,u.A.No=null,n.A.Lo(),a.A.Lo(),p.A.Lo(),S.A.Do=[],x.A.Do=[]};Bo(){return this.$t}Po(){return this.Gs}Uo(){return this.Ns}Go(){return this.hs}Wo(){return this.Hi}ko=()=>{this.pe=!1,this.ke&&(clearInterval(this.ke),this.ke=null),this.ae=null,this.ce=null,this.me=[],this.be=null,this.Te=null,this.Oe=null,this.Re=null,this.Ce=null,this.Ie=null,this.Ee=null,this.ve=null,this.ge=null,this._e=null};Yo=()=>{'999'===D.getParameter('world')?(this.Eo=new Worker('worker.js',{type:'module'}),this.Eo.onmessage=this.onmessage,this.host=new k.x(this.Eo)):'998'===D.getParameter('world')&&(this.Eo={onmessage:t=>{this.stream.Ho.onmessage(t)},postMessage:t=>{this.bo&&this.bo.So&&'open'===this.bo.So.readyState&&this.bo.So.send(JSON.stringify(t))},onerror:null,onmessageerror:null,terminate:()=>{throw new Error},addEventListener:()=>{throw new Error},removeEventListener:()=>{throw new Error},dispatchEvent:()=>{throw new Error}},this.bo=new k.Q(this.Eo))};onmessage=t=>{switch(t.data.type){case'ready':return void(this.vo=!0);case'save':return(0,M.A)(t.data.value,t.data.path.split('/').pop().split('\\').pop()),void URL.revokeObjectURL(t.data.value);case'close':return void this.Eo?.postMessage({type:'close',id:t.data.id})}this.host?.xo===t.data.id?this.stream.Ho.onmessage(t.data):this.host?.postMessage(t)};Vo=async()=>{if(999==+D.getParameter('world'))this.host&&await this.host.Ko();else if(998==+D.getParameter('world')&&this.bo){if(this.bo.So)return void console.log('You are already connected.');const t=prompt('Paste offer here, answer will be copied to clipboard');if(t)try{await this.bo.Xo(t)}catch(t){console.error(t)}}};jo=async(t,e,i,s)=>{let n=5,o=await(this.db?.zo(t));if(o&&h.A.Zo(o)!==i&&(o=void 0),o)return new r.A(o);for(;!o;){await this.qo(s,`Requesting ${e}`);try{o=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}${i}`):await(0,C.Jo)(`${D.nt}/${t}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.qo(s,`Error loading - Will retry in ${t} secs.`),await(0,C.$o)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Qo(t,o)),new r.A(o)};tl=async(t,e,i,s)=>{let n=await(this.db?.zo(t+'.mid'));if(n&&12345678!==e&&h.A.Zo(n)!==e&&(n=void 0),!n)try{n=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}_${e}.mid`):await(0,C.Jo)(`${D.nt}/songs/${t}.mid`),i!==n.length&&(n=n.slice(0,i))}catch(t){}if(!n)return;await(this.db?.Qo(t+'.mid',n));const r=new h.A(Uint8Array.from(n)).el,o=E.A.read(r,n,i,4);(0,v.il)(o,this.Co,s)};sl=()=>{if(w.nl.fillStyle='black',w.nl.fillRect(0,0,this.width,this.height),this.rl(1),this.Dt){this.pe=!1,w.nl.font='bold 16px helvetica, sans-serif',w.nl.textAlign='left',w.nl.fillStyle='yellow';let t=35;w.nl.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.nl.fillStyle='white',w.nl.fillText('To fix this try the following (in order):',30,t),t+=50,w.nl.font='bold 12px helvetica, sans-serif',w.nl.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.nl.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.nl.fillText('3: Try using a different game-world',30,t),t+=30,w.nl.fillText('4: Try rebooting your computer',30,t),t+=30,w.nl.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.pe=!1,w.nl.font='bold 20px helvetica, sans-serif',w.nl.textAlign='left',w.nl.fillStyle='white',w.nl.fillText('Error - unable to load game!',50,50),w.nl.fillText('To play RuneScape make sure you play from',50,100),w.nl.fillText('https://2004scape.org',50,150)),this.kt){this.pe=!1,w.nl.font='bold 13px helvetica, sans-serif',w.nl.textAlign='left',w.nl.fillStyle='yellow';let t=35;w.nl.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.nl.fillStyle='white',w.nl.fillText('To fix this try the following (in order):',30,t),t+=50,w.nl.font='bold 12px helvetica, sans-serif',w.nl.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.nl.fillText('2: Try rebooting your computer, and reloading',30,t)}};hl=t=>{if(!t.ol)return!1;for(let e=0;e=s)return!1}else if(3===t.ol[e]){if(i<=s)return!1}else if(4===t.ol[e]){if(i===s)return!1}else if(i!==s)return!1}return!0};cl=(t,e,i,s,n)=>{this.vi?.draw(t,e),this.bi?.draw(t,e+n-16),y.A.fillRect(t,e+16,16,n-32,m.A.fl);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*i/(s-n)|0;y.A.fillRect(t,e+h+16,16,r,m.A.ul),y.A.dl(t,e+h+16,m.A.wl,r),y.A.dl(t+1,e+h+16,m.A.wl,r),y.A.yl(t,e+h+16,m.A.wl,16),y.A.yl(t,e+h+17,m.A.wl,16),y.A.dl(t+15,e+h+16,m.A.Al,r),y.A.dl(t+14,e+h+17,m.A.Al,r-1),y.A.yl(t,e+h+r+15,m.A.Al,16),y.A.yl(t+1,e+h+r+14,m.A.Al,15)};ml=(t,e)=>{let i=!1;const n=s.A.Do[t];if(!n.pl)return!1;for(let t=0;ts.delay[r.Cl];)r.Il-=s.delay[r.Cl]+1,r.Cl++,r.Cl>=s.El&&(r.Cl-=s.vl,(r.Cl<0||r.Cl>=s.El)&&(r.Cl=0)),i=!0}}}return i};bl=(t,e,i,r,h=!1)=>{if(0!==t.type||!t.pl||t.hide&&this.Zs!==t.id&&this.qs!==t.id&&this.Js!==t.id)return;const o=y.A.left,l=y.A.top,a=y.A.right,c=y.A.bottom;y.A.Tl(e,i,e+t.width,i+t.height);const f=t.pl.length;for(let o=0;o0&&this.Ml(c),c.type===s.A.kl)c.Dl>c.scroll-c.height&&(c.Dl=c.scroll-c.height),c.Dl<0&&(c.Dl=0),this.bl(c,l,a,c.Dl,h),c.scroll>c.height&&this.cl(l+c.width,a,c.Dl,c.scroll,c.height);else if(c.type===s.A.Nl){let t=0;for(let e=0;e0){let e=0,i=0;const r=c.Pl[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qs===t){const h=A.A.Yl(r,c.Ul[t]);if(0!==this.tn&&this.Qs===t&&this.$s===c.id?(e=this.Hl-this.en,i=this.Vl-this.sn,e<5&&e>-5&&(e=0),i<5&&i>-5&&(i=0),this.nn<5&&(e=0,i=0),h.Kl(128,s+e,n+i)):0!==this.un&&this.dn===t&&this.wn===c.id?h.Kl(128,s,n):h.draw(s,n),33===h.Xl||1!==c.Ul[t]){const r=c.Ul[t];this.de?.jl(s+e+1,n+10+i,this.zl(r),m.A.Zl),this.de?.jl(s+e,n+9+i,this.zl(r),m.A.ql)}}}else if(c.Jl&&t<20){const e=c.Jl[t];e?.draw(s,n)}t++}}else if(c.type===s.A.$l)c.fill?y.A.fillRect(l,a,c.width,c.height,c.Ql):y.A.Ll(l,a,c.width,c.height,c.Ql);else if(c.type===s.A.ta){const t=c.font;let e=c.Ql,i=c.text;if(this.Js!==c.id&&this.qs!==c.id&&this.Zs!==c.id||0===c.ea||(e=c.ea),this.hl(c)&&(e=c.ia,c.sa&&c.sa.length>0&&(i=c.sa)),c.na===s.A.ra&&this.An&&(i='Please wait...',e=c.Ql),!t||!i)continue;for(let s=a+t.height;i.length>0;s+=t.height){if(-1!==i.indexOf('%')){for(;;){const t=i.indexOf('%1');if(-1===t)break;i=i.substring(0,t)+this.ha(this.ll(c,0))+i.substring(t+2)}for(;;){const t=i.indexOf('%2');if(-1===t)break;i=i.substring(0,t)+this.ha(this.ll(c,1))+i.substring(t+2)}for(;;){const t=i.indexOf('%3');if(-1===t)break;i=i.substring(0,t)+this.ha(this.ll(c,2))+i.substring(t+2)}for(;;){const t=i.indexOf('%4');if(-1===t)break;i=i.substring(0,t)+this.ha(this.ll(c,3))+i.substring(t+2)}for(;;){const t=i.indexOf('%5');if(-1===t)break;i=i.substring(0,t)+this.ha(this.ll(c,4))+i.substring(t+2)}}const n=i.indexOf('\\n');let r;-1!==n?(r=i.substring(0,n),i=i.substring(n+2)):(r=i,i=''),c.oa?t.la(l+(c.width/2|0),s,r,e,c.aa):t.ca(l,s,r,e,c.aa)}}else if(c.type===s.A.fa){let t;t=this.hl(c)?c.ua:c.da,t?.draw(l,a)}else if(c.type===s.A.wa){const t=n.A.ya,e=n.A.Aa;n.A.ya=l+(c.width/2|0),n.A.Aa=a+(c.height/2|0);const i=n.A.sin[c.ma]*c.zoom>>16,s=n.A.cos[c.ma]*c.zoom>>16,r=this.hl(c);let h;h=r?c._l:c.gl;let o=null;if(-1===h)o=c.pa(-1,-1,r);else{const t=g.A.Do[h];t.frames&&t.ga&&(o=c.pa(t.frames[c.Cl],t.ga[c.Cl],r))}o&&o._a(0,c.Ia,0,c.ma,0,i,s),n.A.ya=t,n.A.Aa=e}else if(c.type===s.A.Ca){const t=c.font;if(!t||!c.Pl||!c.Ul)continue;let e=0;for(let i=0;i0){const n=A.A.get(c.Pl[e]-1);let r=n.name;if((n.Ea||1!==c.Ul[e])&&(r=r+' x'+this.va(c.Ul[e])),!r)continue;const h=l+s*(c.Gl+115),o=a+i*(c.Wl+12);c.oa?t.la(h+(c.width/2|0),o,r,c.Ql,c.aa):t.ca(h,o,r,c.Ql,c.aa)}e++}}}y.A.Tl(o,l,a,c)};Ml=t=>{let e=t.xl;if(e>=s.A.ba&&e<=s.A.Ta)e--,e>=this.Vh?(t.text='',t.na=0):(t.text=this.io[e],t.na=1);else if(e>=s.A.Oa&&e<=s.A.Ra)e-=s.A.Oa,e>=this.Vh?(t.text='',t.na=0):(0===this.no[e]?t.text='@red@Offline':this.no[e]===D.et?t.text='@gre@World-'+(this.no[e]-9):t.text='@yel@World-'+(this.no[e]-9),t.na=1);else if(e===s.A.La)t.scroll=15*this.Vh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(e>=s.A.Sa&&e<=s.A.xa)e-=s.A.Sa,e>=this.fs?(t.text='',t.na=0):(t.text=_.A.Ma(_.A.ka(this.us[e])),t.na=1);else if(e===s.A.Da)t.scroll=15*this.fs+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(e===s.A.Na){if(t.ma=150,t.Ia=256*Math.sin(this.Ft/40)&2047,this.Wh){this.Wh=!1;const e=new d.fi(7,null);let i=0;for(let t=0;t<7;t++){const s=this.Yh[t];s>=0&&(e[i++]=I.A.Do[s].pa())}const s=p.A.Fa(e,i);for(let t=0;t<5;t++)0!==this.Hh[t]&&(s.Ba(u.A.Pa[t][0],u.A.Pa[t][this.Hh[t]]),1===t&&s.Ba(u.A.Ua[0],u.A.Ua[this.Hh[t]]));if(this.xh){const e=g.A.Do[this.xh.Ga].frames;e&&(s.Wa(),s.Ya(e[0]),s.Ha(64,850,-30,-50,-30,!0),t.model=s)}}}else if(e===s.A.Va)this.Fi||(this.Fi=t.da,this.Bi=t.ua),this.Gh?t.da=this.Bi:t.da=this.Fi;else if(e===s.A.Ka)this.Fi||(this.Fi=t.da,this.Bi=t.ua),this.Gh?t.da=this.Fi:t.da=this.Bi;else if(e===s.A.Xa)t.text=this.xn,this.Ft%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(e===s.A.ja)this.Uh?this.Mn?(t.Ql=m.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Ql=m.A.Sl,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(e===s.A.za||e===s.A.Za)if(0===this.Dn)t.text='';else{let e;e=0===this.Nn?'earlier today':1===this.Nn?'yesterday':this.Nn+' days ago',t.text='You last logged in '+e+' from: '+_.A.qa(this.Dn)}else if(e===s.A.Ja)0===this.Bn&&(t.text='0 unread messages',t.Ql=m.A.ql),1===this.Bn&&(t.text='1 unread message',t.Ql=m.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Ql=m.A.GREEN);else if(e===s.A.$a)if(201===this.Fn)t.text='';else if(200===this.Fn)t.text='You have not yet set any password recovery questions.';else{let e;e=0===this.Fn?'Earlier today':1===this.Fn?'Yesterday':this.Fn+' days ago',t.text=e+' you changed your recovery questions'}else e===s.A.Qa?201===this.Fn?t.text='':200===this.Fn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':e===s.A.tc&&(201===this.Fn?t.text='':(this.Fn,t.text="Do this from the 'account management' area on our front webpage"))};ll=(t,e)=>{if(!t.scripts||e>=t.scripts.length)return-2;try{const i=t.scripts[e];if(!i)return-1;let n=0,r=0;for(;;){const t=i[r++];if(0===t)return n;if(1===t)n+=this.Es[i[r++]];else if(2===t)n+=this.vs[i[r++]];else if(3===t)n+=this.Cs[i[r++]];else if(4===t){const t=s.A.Do[i[r++]],e=i[r++]+1;if(t.Pl&&t.Ul)for(let i=0;it<999999999?String(t):'*';va=t=>{let e=String(t);for(let t=e.length-3;t>0;t-=3)e=e.substring(0,t)+','+e.substring(t);return e.length>8?e='@gre@'+e.substring(0,e.length-8)+' million @whi@('+e+')':e.length>4&&(e='@cya@'+e.substring(0,e.length-4)+'K @whi@('+e+')'),' '+e};zl=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,e,i)=>{i.d(e,{w:()=>h});var s=i(7046),n=i(1651),r=i(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');['0','998','999'].includes(s.A.getParameter('world'))?function(){if(+s.A.getParameter('world')>=998)return void(n.K.nt='data/pack/client');n.K.st='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0}():await async function(t){const e=await o(t,parseInt(s.A.getParameter('world'),10)),i=new URL(e.address);n.K.et=10+e.id-1,n.K.st=`${i.protocol}//${i.hostname}`,n.K.nt=`${i.protocol}//${i.hostname}:${i.port}`,t||(n.K.st=n.K.st.replace('https:','http:'));n.K.portOffset=e.portOffset,n.K.members=!0===e?.members,s.A.setParameter('world',e.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===s.A.getParameter('detail').length&&s.A.setParameter('detail','high');'low'===s.A.getParameter('detail')?n.K.Lt():n.K.Rt()}(),0===s.A.getParameter('method').length&&s.A.setParameter('method','0')}async function o(t,e,i=0){if(i>=10)throw new Error('could not find world to connect!');const s=t?'https:':'http:';let n;try{n=JSON.parse(await(0,r.ic)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.$o)(1e3),o(t,e,++i)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hh:0});const h=n.find((t=>t.id===e));return h||o(t,e,10)}},9858:(t,e,i)=>{i.a(t,(async(t,e)=>{try{var s=i(1312),n=i(1302),r=i(4583),h=i(2682),o=i(8665),l=i(8534),a=i(6730),c=i(9234),f=i(1069),u=i(4544),d=i(7854),w=i(1908),y=i(1183),A=i(1651),m=i(7604);class t extends A.K{sc=[];async nc(t){const e=new Map,i=(await(0,c.ic)(t)).split('\n');for(let t=0;t{if(this.Mt)this.kt=!0;else{this.Mt=!0;try{await this.qo(10,'Connecting to fileserver'),await w.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new u.A(await u.A.openDatabase());const t=new f.A(new Uint8Array(await(0,c.Jo)(`${A.K.nt}/crc`)));for(let e=0;e<9;e++)this.Bt[e]=t.el;const e=await this.jo('title','title screen',this.Bt[1],10);this.de=h.A.rc(e,'p11'),this.we=h.A.rc(e,'p12'),this.ye=h.A.rc(e,'b12'),this.Ae=h.A.rc(e,'q8');const i=await this.jo('config','config',this.Bt[2],15),d=await this.jo('models','3d graphics',this.Bt[5],40),y=await this.jo('textures','textures',this.Bt[6],60);await this.qo(80,'Unpacking textures'),r.A.hc(y),r.A.oc(.8),r.A.lc(20),await this.qo(83,'Unpacking models'),o.A.ac(d),l.A.ac(d),a.A.ac(d),await this.qo(86,'Unpacking config'),s.A.ac(i),n.A.ac(i,!0),await this.qo(100,'Getting ready to start...'),await this.cc()}catch(t){this.Dt=!0,console.error(t)}}};async cc(){const t=document.getElementById('items');if(!t)return;t.innerHTML='',this.sc[1]=await this.nc(`${A.K.lt}/data/src/pack/obj.pack`);const e=document.createElement('input');e.type='text',e.placeholder='::give',e.tabIndex=-1,t.appendChild(e);const i=document.createElement('input');i.type='search',i.placeholder='Search',i.tabIndex=1,i.oninput=()=>{const t=document.querySelector('#itemList');if(!t)return;const e=i.value.toLowerCase().replaceAll(' ','_');for(let i=0;i-1||n.indexOf(e)>-1||r.indexOf(e)>-1||h.indexOf(e)>-1?s.style.display='':s.style.display='none'}},t.appendChild(i);const s=document.createElement('ul');s.id='itemList',s.className='list-group',t.appendChild(s);const h=new Set;for(const[t,e]of this.sc[1]){const e=n.A.get(t);if(null!==e.fc&&null!==e.uc)for(let t=0;t{const t=s.querySelector('.active');t&&(t.className='list-group-item list-group-item-center'),l.className='list-group-item list-group-item-center active',e.value=`::give ${i} 1`};const a=document.createElement('canvas');a.className='icon',a.width=32,a.height=32,l.appendChild(a);const c=document.createElement('p');null===o.name?c.innerText=i:c.innerText=o.name+' - '+i,l.appendChild(c);const f=new y.A(32,32,a.getContext('2d',{willReadFrequently:!0})??d.nl),u=n.A.Yl(t,1e4);f.bind(),r.A.wc(),u.draw(0,0),f.draw(0,0),s.appendChild(l)}}}await(0,m.w)(),(new t).run().then((()=>{})),window.onkeydown=function(t){return!(' '===t.key&&t.target===document.body)},e()}catch(t){e(t)}}),1)},7046:(t,e,i)=>{i.d(e,{A:()=>a});var s=i(1183),n=i(4583),r=i(9234),h=i(9091),o=i(2595),l=i(7854);class a{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,e){const i=new URL(window.location.toString());i.searchParams.set(t,e),window.history.pushState(null,'',i.toString())}yc=0;Ac=[];mc=0;Fo=null;state=0;gc=20;_c=1;Ic=[];Cc=0;Ec=0;vc=[];bc=!0;Tc=!1;Oc=50;hasFocus=!0;Rc=!1;Lc=0;Sc=0;Hl=0;Vl=0;xc=0;Mc=0;kc=0;Dc=[];Nc=[];Fc=0;Bc=0;input=null;Pc=!1;Uc=!1;Gc=!1;time=-1;Wc=0;Yc=0;Hc=0;Vc=0;Kc=0;Xc=0;constructor(t=!1){l.jc.tabIndex=-1,l.nl.fillStyle='black',l.nl.fillRect(0,0,l.jc.width,l.jc.height),this.Tc=t,this.Tc?this.resize(window.innerWidth,window.innerHeight):this.resize(l.jc.width,l.jc.height)}get width(){return l.jc.width}get height(){return l.jc.height}resize=(t,e)=>{l.jc.width=t,l.jc.height=e,this.Fo=new s.A(t,e),n.A.wc()};run=async()=>{l.jc.addEventListener('resize',(()=>{this.Tc&&this.resize(window.innerWidth,window.innerHeight)}),!1),l.jc.onmousedown=this.onmousedown,l.jc.onmouseup=this.onmouseup,l.jc.onmouseenter=this.onmouseenter,l.jc.onmouseleave=this.onmouseleave,l.jc.onmousemove=this.onmousemove,window.onbeforeunload=this.Lo,l.jc.onfocus=this.onfocus,l.jc.onblur=this.onblur,this.zc?(l.jc.ontouchstart=this.ontouchstart,l.jc.ontouchend=this.ontouchend,l.jc.ontouchmove=this.ontouchmove):(l.jc.onkeydown=this.onkeydown,l.jc.onkeyup=this.onkeyup),l.jc.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.zc&&'low'===a.getParameter('detail')&&(this.Oc=30),await this.qo(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.Ic[t]=performance.now();let t,e=0,i=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.Zc();const h=i,o=s;i=300,s=1,t=performance.now();const l=this.Ic[e];if(0===l?(i=h,s=o):t>l&&(i=2560*this.gc/(t-l)|0),i<25?i=25:i>256&&(i=256,s=this.gc-(t-l)/10|0),this.Ic[e]=t,e=(e+1)%10,s>1)for(let t=0;t<10;t++)0!==this.Ic[t]&&(this.Ic[t]+=s);for(s0&&(this.Cc=1e3*i/(256*this.gc)|0);const a=performance.now();if(this.bc&&this.refresh(),await this.draw(),this.vc[this.Ec]=(performance.now()-a)/1e3,this.Ec=(this.Ec+1)%this.vc.length,this.Oc<50){const e=1e3/this.Oc-(performance.now()-t);e>0&&await(0,r.$o)(e)}}-1===this.state&&this.Zc()};Zc=()=>{this.state=-2,this.Lo()};rl=t=>{this.gc=1e3/t|0};qc=t=>{this.Oc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.gc|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};Lo=()=>{};draw=async()=>{};refresh=()=>{};async qo(t,e){const i=this.width,s=this.height;this.bc&&(l.nl.fillStyle='black',l.nl.fillRect(0,0,i,s),this.bc=!1);const n=s/2-18;l.nl.fillStyle='rgb(140, 17, 17)',l.nl.rect((i/2|0)-152,n,304,34),l.nl.fillRect((i/2|0)-150,n+2,3*t,30),l.nl.fillStyle='black',l.nl.fillRect((i/2|0)-150+3*t,n+2,300-3*t,30),l.nl.font='bold 13px helvetica, sans-serif',l.nl.textAlign='center',l.nl.fillStyle='white',l.nl.fillText(e,i/2|0,n+22),await(0,r.$o)(5)}Jc=()=>{let t=-1;return this.Bc!==this.Fc&&(t=this.Nc[this.Fc],this.Fc=this.Fc+1&127),t};get ms(){const t=this.vc.length;let e=0;for(let i=0;ithis.yc&&(this.yc=i),this.Ac[this.mc]=i,this.mc=(this.mc+1)%250,i}get $c(){return this.Ac.reduce(((t,e)=>t+e),0)/250}onkeydown=t=>{const e=t.key;this.Lc=0;const i=h.c[e];if(!i||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${e}`);const s=i.code;let n=i.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Dc[n]=1),n>4&&(this.Nc[this.Bc]=n,this.Bc=this.Bc+1&127),o.A.enabled&&o.A.Qc(n),h.g.includes(e)||t.preventDefault()};onkeyup=t=>{const e=t.key;this.Lc=0;const i=h.c[e];if(!i||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${e}`);const s=i.code;let n=i.ch;n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Dc[n]=0),o.A.enabled&&o.A.tf(n),h.g.includes(e)||t.preventDefault()};onmousedown=t=>{if(this.Pc=!1,(t.clientX>0||t.clientY>0)&&this.ef(t),this.Lc=0,this.Mc=this.Hl,this.kc=this.Vl,this.zc&&!this.if){if(this.sf()||this.nf()||this.rf())return this.xc=1,void(this.Sc=1);t.timeStamp>=this.time+500?(this.xc=2,this.Sc=2):(this.xc=1,this.Sc=1)}else 2===t.button?(this.xc=2,this.Sc=2):(this.xc=1,this.Sc=1);o.A.enabled&&o.A.hf(this.Mc,this.kc,t.buttons)};onmouseup=t=>{this.ef(t),this.Lc=0,this.Sc=0,o.A.enabled&&o.A.lf(t.buttons)};onmouseenter=t=>{this.ef(t),o.A.enabled&&o.A.af()};onmouseleave=t=>{this.ef(t),this.Lc=0,this.Hl=-1,this.Vl=-1,this.Sc=0,this.Mc=-1,this.kc=-1,o.A.enabled&&o.A.cf()};onmousemove=t=>{this.ef(t),this.Lc=0,o.A.enabled&&o.A.ff(this.Hl,this.Vl)};onfocus=t=>{this.hasFocus=!0,this.bc=!0,this.refresh(),o.A.enabled&&o.A.uf()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.df()};ontouchstart=t=>{if(!this.zc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.Pc=!0;const e=t.changedTouches[0],i=0|e.clientX,s=0|e.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:i,clientY:s})),this.Wc=this.Kc=this.Hc=0|e.screenX,this.Yc=this.Xc=this.Vc=0|e.screenY,this.time=t.timeStamp,this.Uc=this.wf(),this.Gc=this.yf()};ontouchend=t=>{if(!this.zc||!this.Pc)return;const e=t.changedTouches[0],i=0|e.clientX,s=0|e.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:i,clientY:s})),this.Kc=0|e.screenX,this.Xc=0|e.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Uc&&!this.wf())return void(this.Pc=!1);if(this.Gc&&!this.yf())return void(this.Pc=!1);if(this.sf()||this.Af()||this.nf()||this.rf()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.nf()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.rf()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.sf()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.Af()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.mf?t.setAttribute('type','password'):t.setAttribute('type',this.rf()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${i}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.mf&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const e=t,i=e.data;null!==i&&'insertText'===e.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:i,code:i}))}),t.onkeydown=t=>{this.mf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.mf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.Pc=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.Wc-this.Kc)>16||Math.abs(this.Yc-this.Xc)>16;n&&!r?(this.Pc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.Sc=0,this.Pc=!1)};ontouchmove=t=>{if(!this.zc||!this.Pc)return;const e=t.changedTouches[0],i=0|e.clientX,s=0|e.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:i,clientY:s})),this.Kc=0|e.screenX,this.Xc=0|e.screenY,this.Uc&&-1===this.Wo()?(this.Hc-this.Kc>0?this.rotate(2):this.Hc-this.Kc<0&&this.rotate(0),this.Vc-this.Xc>0?this.rotate(3):this.Vc-this.Xc<0&&this.rotate(1)):(this.Gc||-1!==this.Wo())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.Hc=this.Kc,this.Vc=this.Xc};get zc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get mf(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get if(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}wf=()=>this.Rc&&this.Hl>=8&&this.Hl<=520&&this.Vl>=11&&this.Vl<=345;sf=()=>this.Rc&&-1===this.Go()&&!this.Po()&&!this.Uo()&&this.Hl>=11&&this.Hl<=506&&this.Vl>=449&&this.Vl<=482;Af=()=>this.Rc&&(this.Po()||this.Uo())&&this.Hl>=11&&this.Hl<=506&&this.Vl>=383&&this.Vl<=482;yf=()=>this.Rc&&this.Hl>=562&&this.Hl<=752&&this.Vl>=231&&this.Vl<=492;nf=()=>!this.Rc&&2===this.Bo()&&this.Hl>=301&&this.Hl<=562&&this.Vl>=262&&this.Vl<=279;rf=()=>!this.Rc&&2===this.Bo()&&this.Hl>=301&&this.Hl<=562&&this.Vl>=279&&this.Vl<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};pf=()=>null!==document.fullscreenElement;ef=t=>{if(this.pf()){const e=t.target.getBoundingClientRect(),i=window.innerHeight/l.jc.height,s=(window.innerWidth-l.jc.width*i)/2;this.Hl=0|this.gf(t.clientX-e.left-s,0,l.jc.width*i,0,789),this.Vl=0|this.gf(t.clientY-e.top,0,l.jc.height*i,0,532)}else{const e=l.jc.getBoundingClientRect(),i=l.jc.width/e.width,s=l.jc.height/e.height;this.Hl=(t.clientX-e.left)*i|0,this.Vl=(t.clientY-e.top)*s|0}this.Hl<0&&(this.Hl=0),this.Vl<0&&(this.Vl=0),this.Hl>789&&(this.Hl=789),this.Vl>532&&(this.Vl=532)};gf=(t,e,i,s,n)=>(t-e)*(n-s)/(i-e)+s}},2595:(t,e,i)=>{i.d(e,{A:()=>n});var s=i(1069);class n{static enabled=!1;static _f=null;static If=null;static Cf=0;static Ef=0;static vf=0;static bf=0;static Tf=0;static Of=()=>{this._f=s.A.Pt(1),this.If=null,this.Cf=performance.now(),this.enabled=!0};static Rf=()=>{this.enabled=!1,this._f=null};static flush=()=>{let t=null;return this.If&&this.enabled&&(t=this.If),this.If=null,t};static stop=()=>{let t=null;return this._f&&this._f.Lf>0&&this.enabled&&(t=this._f),this.Rf(),t};static hf=(t,e,i)=>{if(!(this.enabled&&t>=0&&t<789&&e>=0&&e<532))return;this.Ef++;const s=performance.now();let n=(s-this.Cf)/10|0;n>250&&(n=250),this.Cf=s,this.Sf(5),1===i?this._f?.p1(1):this._f?.p1(2),this._f?.p1(n),this._f?.p3(t+(e<<10))};static lf=t=>{if(!this.enabled)return;this.Ef++;const e=performance.now();let i=(e-this.Cf)/10|0;i>250&&(i=250),this.Cf=e,this.Sf(2),1===t?this._f?.p1(3):this._f?.p1(4),this._f?.p1(i)};static ff=(t,e)=>{if(!(this.enabled&&t>=0&&t<789&&e>=0&&e<532))return;const i=performance.now();if(i-this.vf>=50){this.vf=i,this.Ef++;let s=(i-this.Cf)/10|0;s>250&&(s=250),this.Cf=i,t-this.bf<8&&t-this.bf>=-8&&e-this.Tf<8&&e-this.Tf>=-8?(this.Sf(3),this._f?.p1(5),this._f?.p1(s),this._f?.p1(t+(e-this.Tf+8<<4)+8-this.bf)):t-this.bf<128&&t-this.bf>=-128&&e-this.Tf<128&&e-this.Tf>=-128?(this.Sf(4),this._f?.p1(6),this._f?.p1(s),this._f?.p1(t+128-this.bf),this._f?.p1(e+128-this.Tf)):(this.Sf(5),this._f?.p1(7),this._f?.p1(s),this._f?.p3(t+(e<<10))),this.bf=t,this.Tf=e}};static Qc=t=>{if(!this.enabled)return;this.Ef++;const e=performance.now();let i=(e-this.Cf)/10|0;i>250&&(i=250),this.Cf=e,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.Sf(3),this._f?.p1(8),this._f?.p1(i),this._f?.p1(t)};static tf=t=>{if(!this.enabled)return;this.Ef++;const e=performance.now();let i=(e-this.Cf)/10|0;i>250&&(i=250),this.Cf=e,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.Sf(3),this._f?.p1(9),this._f?.p1(i),this._f?.p1(t)};static uf=()=>{if(!this.enabled)return;this.Ef++;const t=performance.now();let e=(t-this.Cf)/10|0;e>250&&(e=250),this.Cf=t,this.Sf(2),this._f?.p1(10),this._f?.p1(e)};static df=()=>{if(!this.enabled)return;this.Ef++;const t=performance.now();let e=(t-this.Cf)/10|0;e>250&&(e=250),this.Cf=t,this.Sf(2),this._f?.p1(11),this._f?.p1(e)};static af=()=>{if(!this.enabled)return;this.Ef++;const t=performance.now();let e=(t-this.Cf)/10|0;e>250&&(e=250),this.Cf=t,this.Sf(2),this._f?.p1(12),this._f?.p1(e)};static cf=()=>{if(!this.enabled)return;this.Ef++;const t=performance.now();let e=(t-this.Cf)/10|0;e>250&&(e=250),this.Cf=t,this.Sf(2),this._f?.p1(13),this._f?.p1(e)};static Sf=t=>{if(this._f&&this._f.Lf+t>=500){const t=this._f;this._f=s.A.Pt(1),this.If=t}}}},9091:(t,e,i)=>{i.d(e,{c:()=>n,g:()=>s});const s=['F11','F12'],n={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}}},1120:(t,e,i)=>{i.d(e,{A:()=>c});var s=i(1069),n=i(8665),r=i(2679),h=i(2511),o=i(3819),l=i(3867),a=i(8950);class c{static Do=[];static xf=null;static No=null;static kl=0;static Mf=1;static Nl=2;static $l=3;static ta=4;static fa=5;static wa=6;static Ca=7;static kf=1;static Df=2;static Nf=3;static Ff=4;static Bf=5;static ra=6;static ba=1;static Ta=100;static Oa=101;static Ra=200;static Pf=201;static Uf=202;static La=203;static Gf=205;static Wf=300;static Yf=301;static Hf=302;static Vf=303;static Kf=304;static Xf=305;static jf=306;static zf=307;static Zf=308;static qf=309;static Jf=310;static $f=311;static Qf=312;static tu=313;static eu=314;static iu=315;static su=316;static nu=317;static ru=318;static hu=319;static ou=320;static lu=321;static au=322;static cu=323;static Va=324;static Ka=325;static fu=326;static Na=327;static Sa=401;static xa=500;static uu=501;static du=502;static Da=503;static Xa=600;static wu=601;static yu=602;static Au=603;static mu=604;static pu=605;static gu=606;static _u=607;static Iu=608;static Cu=609;static Eu=610;static vu=611;static bu=612;static ja=613;static za=650;static Ja=651;static $a=652;static Qa=653;static tc=654;static Za=655;static ac=(t,e,i)=>{this.xf=new r.A(5e4),this.No=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.Lf+=2;n.Lf0){s.ol=new Uint8Array(r),s.al=new Uint16Array(r);for(let t=0;t0){s.scripts=new l.fi(o,null);for(let t=0;t0){const n=i.lastIndexOf(',');s.Jl[t]=this.Du(e,i.substring(0,n),parseInt(i.substring(n+1),10))}}s.Nu=new l.fi(5,null);for(let t=0;t<5;t++){const e=n.ku;s.Nu[t]=e,0===e.length&&(s.Nu[t]=null)}}if(s.type===c.$l&&(s.fill=1===n.Ru),s.type===c.ta||s.type===c.Mf){s.oa=1===n.Ru;const t=n.Ru;i&&(s.font=i[t]),s.aa=1===n.Ru}if(s.type===c.ta&&(s.text=n.ku,s.sa=n.ku),s.type!==c.Mf&&s.type!==c.$l&&s.type!==c.ta||(s.Ql=n.el),s.type!==c.$l&&s.type!==c.ta||(s.ia=n.el,s.ea=n.el),s.type===c.fa){const t=n.ku;if(t.length>0){const i=t.lastIndexOf(',');s.da=this.Du(e,t.substring(0,i),parseInt(t.substring(i+1),10))}const i=n.ku;if(i.length>0){const t=i.lastIndexOf(',');s.ua=this.Du(e,i.substring(0,t),parseInt(i.substring(t+1),10))}}if(s.type===c.wa){const t=n.Ru;0!==t&&(s.model=this.pa((t-1<<8)+n.Ru));const e=n.Ru;0!==e&&(s.Fu=this.pa((e-1<<8)+n.Ru)),s.gl=n.Ru,0===s.gl?s.gl=-1:s.gl=(s.gl-1<<8)+n.Ru,s._l=n.Ru,0===s._l?s._l=-1:s._l=(s._l-1<<8)+n.Ru,s.zoom=n.Tu,s.ma=n.Tu,s.Ia=n.Tu}if(s.type===c.Ca){s.Pl=new Int32Array(s.width*s.height),s.Ul=new Int32Array(s.width*s.height),s.oa=1===n.Ru;const t=n.Ru;i&&(s.font=i[t]),s.aa=1===n.Ru,s.Ql=n.el,s.Gl=n.Su,s.Wl=n.Su,s.xu=1===n.Ru,s.Nu=new l.fi(5,null);for(let t=0;t<5;t++){const e=n.ku;s.Nu[t]=e,0===e.length&&(s.Nu[t]=null)}}s.na!==c.Df&&s.type!==c.Nl||(s.Bu=n.ku,s.action=n.ku,s.Pu=n.Tu),s.na!==c.kf&&s.na!==c.Ff&&s.na!==c.Bf&&s.na!==c.ra||(s.Uu=n.ku,0===s.Uu.length&&(s.na===c.kf?s.Uu='Ok':s.na===c.Ff||s.na===c.Bf?s.Uu='Select':s.na===c.ra&&(s.Uu='Continue')))}this.xf=null,this.No=null};static Du=(t,e,i)=>{const s=o.A.Gu(e)<<8n|BigInt(i);if(this.xf){const t=this.xf.get(s);if(t)return t}let n;try{n=h.A.rc(t,e,i),this.xf?.put(s,n)}catch(t){return null}return n};static pa=t=>{if(this.No){const e=this.No.get(BigInt(t));if(e)return e}const e=n.A.model(t);return this.No?.put(BigInt(t),e),e};id=-1;Ou=-1;type=-1;na=-1;xl=0;width=0;height=0;Lu=-1;ol=null;al=null;scripts=null;scroll=0;hide=!1;draggable=!1;xu=!1;Mu=!1;Gl=0;Wl=0;Fl=null;Bl=null;Jl=null;Nu=null;fill=!1;oa=!1;font=null;aa=!1;text=null;sa=null;Ql=0;ia=0;ea=0;da=null;ua=null;model=null;Fu=null;gl=-1;_l=-1;zoom=0;ma=0;Ia=0;Bu=null;action=null;Pu=-1;Uu=null;pl=null;Ol=null;Rl=null;x=0;y=0;Dl=0;Pl=null;Ul=null;Cl=0;Il=0;pa(t,e,i){let s=this.model;if(i&&(s=this.Fu),!s)return null;if(-1===t&&-1===e&&!s.Wu)return s;const r=n.A.Yu(s,!0,!0,!1);return-1===t&&-1===e||r.Wa(),-1!==t&&r.Ya(t),-1!==e&&r.Ya(e),r.Ha(64,768,-50,-10,-50,!0),r}Hu(){if(this.Ou===this.id)return this.x;let t=c.Do[this.Ou];if(!t.pl||!t.Ol||!t.Rl)return this.x;let e=t.pl.indexOf(this.id);if(-1===e)return this.x;let i=t.Ol[e];for(;t.Ou!==t.id;){const s=c.Do[t.Ou];s.pl&&s.Ol&&s.Rl&&(e=s.pl.indexOf(t.id),-1!==e&&(i+=s.Ol[e])),t=s}return i}Vu(){if(this.Ou===this.id)return this.y;let t=c.Do[this.Ou];if(!t.pl||!t.Ol||!t.Rl)return this.y;let e=t.pl.indexOf(this.id);if(-1===e)return this.y;let i=t.Rl[e];for(;t.Ou!==t.id;){const s=c.Do[t.Ou];s.pl&&s.Ol&&s.Rl&&(e=s.pl.indexOf(t.id),-1!==e&&(i+=s.Rl[e])),t=s}return i}outline(t){const e=this.Hu(),i=this.Vu();a.A.Ll(e,i,this.width,this.height,t)}move(t,e){if(this.Ou===this.id)return;this.x=0,this.y=0;const i=c.Do[this.Ou];if(i.pl&&i.Ol&&i.Rl){const s=i.pl.indexOf(this.id);-1!==s&&(i.Ol[s]=t,i.Rl[s]=e)}}delete(){if(this.Ou===this.id)return;const t=c.Do[this.Ou];if(t.pl&&t.Ol&&t.Rl){const e=t.pl.indexOf(this.id);-1!==e&&(t.pl.splice(e,1),t.Ol.splice(e,1),t.Rl.splice(e,1))}}}},6333:(t,e,i)=>{i.d(e,{$:()=>s});class s{id;Ku=null;constructor(t){this.id=t}Xu(t){for(;;){const e=t.Ru;if(0===e)break;this.decode(e,t)}return this}}},2164:(t,e,i)=>{i.d(e,{A:()=>r});var s=i(1069),n=i(6333);class r extends n.${static count=0;static Do=[];static ac=t=>{const e=new s.A(t.read('flo.dat'));this.count=e.Tu;for(let t=0;t(i>179&&(e=e/2|0),i>192&&(e=e/2|0),i>217&&(e=e/2|0),i>243&&(e=e/2|0),(t/4<<10)+(e/32<<7)+(i/2|0));static zu=(t,e)=>-1===t?12345678:((e=e*(127&t)/128|0)<2?e=2:e>126&&(e=126),(65408&t)+e);static Zu=(t,e)=>-2===t?12345678:-1===t?(e<0?e=0:e>127&&(e=127),127-e):((e=e*(127&t)/128|0)<2?e=2:e>126&&(e=126),(65408&t)+e);qu=0;texture=-1;Ju=!1;$u=!0;Qu=0;td=0;ed=0;sd=0;nd=0;rd=0;decode(t,e){1===t?(this.qu=e.hd,this.setColor(this.qu)):2===t?this.texture=e.Ru:3===t?this.Ju=!0:5===t?this.$u=!1:6===t?this.Ku=e.ku:console.log('Error unrecognised config code: ',t)}setColor(t){const e=(t>>16&255)/256,i=(t>>8&255)/256,s=(255&t)/256;let n=e;ie&&(h=i),s>h&&(h=s);let o=0,l=0;const a=(n+h)/2;n!==h&&(a<.5&&(l=(h-n)/(h+n)),a>=.5&&(l=(h-n)/(2-h-n)),e===h?o=(i-s)/(h-n):i===h?o=(s-e)/(h-n)+2:s===h&&(o=(e-i)/(h-n)+4)),o/=6,this.Qu=256*o|0,this.td=256*l|0,this.ed=256*a|0,this.td<0?this.td=0:this.td>255&&(this.td=255),this.ed<0?this.ed=0:this.ed>255&&(this.ed=255),this.sd=a>.5?(1-a)*l*512|0:a*l*512|0,this.sd<1&&(this.sd=1),this.nd=o*this.sd|0;let c=this.Qu+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.td+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.ed+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.rd=r.ju(c,f,u)}}},8317:(t,e,i)=>{i.d(e,{A:()=>o});var s=i(1069),n=i(6333),r=i(8665),h=i(3867);class o extends n.${static count=0;static Do=[];static ac=t=>{const e=new s.A(t.read('idk.dat'));this.count=e.Tu;for(let t=0;t=40&&t<50?this.ad[t-40]=e.Tu:t>=50&&t<60?this.fd[t-50]=e.Tu:t>=60&&t<70?this.ld[t-60]=e.Tu:console.log('Error unrecognised config code: ',t)}pa(){if(!this.od)return null;const t=new h.fi(this.od.length,null);for(let e=0;e{i.d(e,{A:()=>c});var s=i(6333),n=i(1069),r=i(2679),h=i(8665),o=i(1023),l=i(6169),a=i(3867);class c extends s.${static count=0;static cache=null;static dd=null;static wd=null;static yd=0;static Ad=new r.A(500);static md=new r.A(30);static ac=t=>{this.dd=new n.A(t.read('loc.dat'));const e=new n.A(t.read('loc.idx'));this.count=e.Tu,this.wd=new Int32Array(this.count);let i=2;for(let t=0;t{if(!this.cache||!this.wd||!this.dd)throw new Error('LocType not loaded!!!');for(let e=0;e<10;e++){const i=this.cache[e];if(i&&i.id===t)return i}this.yd=(this.yd+1)%10;const e=this.cache[this.yd];return this.dd.Lf=this.wd[t],e.id=t,e.reset(),e.Xu(this.dd),e.pd||(e.pd=new Int32Array(1)),-1===e.gd&&e.pd&&(e.active=e.pd.length>0&&e.pd[0]===o.A._d.id,e.Id&&(e.active=!0)),e};static Lo=()=>{this.Ad=null,this.md=null,this.wd=null,this.cache=null,this.dd=null};od=null;pd=null;name=null;Cd=null;ad=null;fd=null;width=1;length=1;Ed=!0;vd=!0;active=!1;gd=-1;bd=!1;Td=!1;$u=!1;gl=-1;Od=!1;Rd=16;Ld=0;Sd=0;Id=null;xd=-1;Md=-1;kd=!1;Dd=!0;Nd=128;Fd=128;Bd=128;Pd=0;Ud=0;Gd=0;Wd=0;Yd=!1;decode(t,e){if(1===t){const t=e.Ru;this.od=new Int32Array(t),this.pd=new Int32Array(t);for(let i=0;i=30&&t<39)this.Id||(this.Id=new a.fi(5,null)),this.Id[t-30]=e.ku,'hidden'===this.Id[t-30]?.toLowerCase()&&(this.Id[t-30]=null);else if(40===t){const t=e.Ru;this.ad=new Uint16Array(t),this.fd=new Uint16Array(t);for(let i=0;i=this.od.length)return null;let d=this.od[a];if(-1===d)return null;const w=this.kd!==e>3;w&&(d+=65536);let y=c.Ad?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.qd(),c.Ad?.put(BigInt(d),y));const A=128!==this.Nd||128!==this.Fd||128!==this.Bd,m=0!==this.Ud||0!==this.Gd||0!==this.Wd;let p=h.A.Yu(y,!this.ad,!this.Od,e===l.A.Jd&&-1===o&&!A&&!m);for(-1!==o&&(p.Wa(),p.Ya(o),p.$d=null,p.Qd=null);e-- >0;)p.tw();if(this.ad&&this.fd)for(let t=0;t{i.d(e,{A:()=>l});var s=i(6333),n=i(1069),r=i(2679),h=i(8665),o=i(3867);class l extends s.${static count=0;static cache=null;static dd=null;static wd=null;static yd=0;static No=new r.A(30);static ac=t=>{this.dd=new n.A(t.read('npc.dat'));const e=new n.A(t.read('npc.idx'));this.count=e.Tu,this.wd=new Int32Array(this.count);let i=2;for(let t=0;t{if(!this.cache||!this.wd||!this.dd)throw new Error('NpcType not loaded!!!');for(let e=0;e<20;e++){const i=this.cache[e];if(i&&i.id===t)return i}this.yd=(this.yd+1)%20;const e=this.cache[this.yd]=new l(t);return this.dd.Lf=this.wd[t],e.Xu(this.dd),e};static Lo=()=>{this.No=null,this.wd=null,this.cache=null,this.dd=null};name=null;Cd=null;size=1;od=null;ld=null;Od=!1;sw=-1;nw=-1;rw=-1;hw=-1;ow=-1;ad=null;fd=null;Id=null;Nd=-1;Fd=-1;Bd=-1;lw=!0;aw=-1;cw=128;fw=128;decode(t,e){if(1===t){const t=e.Ru;this.od=new Uint16Array(t);for(let i=0;i=30&&t<40)this.Id||(this.Id=new o.fi(5,null)),this.Id[t-30]=e.ku,'hidden'===this.Id[t-30]?.toLowerCase()&&(this.Id[t-30]=null);else if(40===t){const t=e.Ru;this.ad=new Uint16Array(t),this.fd=new Uint16Array(t);for(let i=0;i{i.d(e,{A:()=>u});var s=i(6333),n=i(1069),r=i(2511),h=i(2679),o=i(8665),l=i(4583),a=i(8950),c=i(9298),f=i(3867);class u extends s.${static count=0;static cache=null;static dd=null;static wd=null;static yd=0;static mw=!0;static No=new h.A(50);static pw=new h.A(200);static ac=(t,e)=>{this.mw=e,this.dd=new n.A(t.read('obj.dat'));const i=new n.A(t.read('obj.idx'));this.count=i.Tu,this.wd=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.wd||!this.dd)throw new Error('ObjType not loaded!!!');for(let e=0;e<10;e++){const i=this.cache[e];if(i&&i.id===t)return i}this.yd=(this.yd+1)%10;const e=this.cache[this.yd];return this.dd.Lf=this.wd[t],e.id=t,e.reset(),e.Xu(this.dd),-1!==e.dc&&e.gw(),!this.mw&&e.members&&(e.name='Members Object',e.Cd="Login to a members' server to use this object.",e.Id=null,e._w=null),e};static Lo=()=>{this.No=null,this.pw=null,this.wd=null,this.cache=null,this.dd=null};static Yl=(t,e)=>{if(u.pw){let i=u.pw.get(BigInt(t));if(i&&i.Iw!==e&&-1!==i.Iw&&(i.Cw(),i=null),i)return i}let i=u.get(t);if(i.fc||(e=-1),i.fc&&i.uc&&e>1){let t=-1;for(let s=0;s<10;s++)e>=i.uc[s]&&0!==i.uc[s]&&(t=i.fc[s]);-1!==t&&(i=u.get(t))}const s=new r.A(32,32),n=l.A.ya,h=l.A.Aa,o=l.A.Ew,f=a.A.bw,d=a.A.Tw,w=a.A.Ow,y=a.A.left,A=a.A.right,m=a.A.top,p=a.A.bottom;l.A.Rw=!1,a.A.bind(s.bw,32,32),a.A.fillRect(0,0,32,32,c.A.Zl),l.A.wc();const g=i.Lw(1),_=l.A.sin[i.Sw]*i.xw>>16,I=l.A.cos[i.Sw]*i.xw>>16;g._a(0,i.Mw,i.kw,i.Sw,i.Dw,_+(g.iw/2|0)+i.Nw,I+i.Nw);for(let t=31;t>=0;t--)for(let e=31;e>=0;e--)0===s.bw[t+32*e]&&(t>0&&s.bw[t+32*e-1]>1||e>0&&s.bw[t+32*(e-1)]>1||t<31&&s.bw[t+32*e+1]>1||e<31&&s.bw[t+32*(e+1)]>1)&&(s.bw[t+32*e]=1);for(let t=31;t>=0;t--)for(let e=31;e>=0;e--)0===s.bw[t+32*e]&&t>0&&e>0&&s.bw[t+32*(e-1)-1]>0&&(s.bw[t+32*e]=3153952);if(-1!==i.dc){const t=this.Yl(i.Fw,10),e=t.Xl,s=t.Iw;t.Xl=32,t.Iw=32,t.Bw(5,5,22,22),t.Xl=e,t.Iw=s}return u.pw?.put(BigInt(t),s),a.A.bind(f,d,w),a.A.Tl(y,m,A,p),l.A.ya=n,l.A.Aa=h,l.A.Ew=o,l.A.Rw=!0,i.Ea?s.Xl=33:s.Xl=32,s.Iw=e,s};model=0;name=null;Cd=null;ad=null;fd=null;xw=2e3;Sw=0;Mw=0;kw=0;Dw=0;Nw=0;Pw=!1;Uw=-1;Ea=!1;Gw=1;members=!1;Id=null;_w=null;Ww=-1;Yw=-1;Hw=0;Vw=-1;Kw=-1;Xw=0;jw=-1;zw=-1;Zw=-1;qw=-1;Jw=-1;$w=-1;fc=null;uc=null;Fw=-1;dc=-1;decode(t,e){if(1===t)this.model=e.Tu;else if(2===t)this.name=e.ku;else if(3===t)this.Cd=e.ku;else if(4===t)this.xw=e.Tu;else if(5===t)this.Sw=e.Tu;else if(6===t)this.Mw=e.Tu;else if(7===t)this.Dw=e.Su,this.Dw>32767&&(this.Dw-=65536);else if(8===t)this.Nw=e.Su,this.Nw>32767&&(this.Nw-=65536);else if(9===t)this.Pw=!0;else if(10===t)this.Uw=e.Tu;else if(11===t)this.Ea=!0;else if(12===t)this.Gw=e.el;else if(16===t)this.members=!0;else if(23===t)this.Ww=e.Tu,this.Hw=e.Hd;else if(24===t)this.Yw=e.Tu;else if(25===t)this.Vw=e.Tu,this.Xw=e.Hd;else if(26===t)this.Kw=e.Tu;else if(t>=30&&t<35)this.Id||(this.Id=new f.fi(5,null)),this.Id[t-30]=e.ku,'hidden'===this.Id[t-30]?.toLowerCase()&&(this.Id[t-30]=null);else if(t>=35&&t<40)this._w||(this._w=new f.fi(5,null)),this._w[t-35]=e.ku;else if(40===t){const t=e.Ru;this.ad=new Uint16Array(t),this.fd=new Uint16Array(t);for(let i=0;i=100&&t<110&&(this.fc&&this.uc||(this.fc=new Uint16Array(10),this.uc=new Uint16Array(10)),this.fc[t-100]=e.Tu,this.uc[t-100]=e.Tu)}Qw(t){let e=this.Ww;if(1===t&&(e=this.Vw),-1===e)return null;let i=this.Yw,s=this.jw;1===t&&(i=this.Kw,s=this.zw);let n=o.A.model(e);if(-1!==i){const t=o.A.model(i);if(-1===s){const e=[n,t];n=o.A.Fa(e,2)}else{const e=[n,t,o.A.model(s)];n=o.A.Fa(e,3)}}if(0===t&&0!==this.Hw&&n.translate(this.Hw,0,0),1===t&&0!==this.Xw&&n.translate(this.Xw,0,0),this.ad&&this.fd)for(let t=0;t1){let e=-1;for(let i=0;i<10;i++)t>=this.uc[i]&&0!==this.uc[i]&&(e=this.fc[i]);if(-1!==e)return u.get(e).Lw(1)}if(u.No){const t=u.No.get(BigInt(this.id));if(t)return t}const e=o.A.model(this.model);if(this.ad&&this.fd)for(let t=0;t{i.d(e,{A:()=>h});var s=i(6333),n=i(1069),r=i(6730);class h extends s.${static count=0;static Do=[];static ac=t=>{const e=new n.A(t.read('seq.dat'));this.count=e.Tu;for(let t=0;t{i.d(e,{A:()=>l});var s=i(6333),n=i(1069),r=i(1312),h=i(8665),o=i(2679);class l extends s.${static count=0;static Do=[];static No=new o.A(30);static ac=t=>{const e=new n.A(t.read('spotanim.dat'));this.count=e.Tu;for(let t=0;t=40&&t<50?this.ad[t-40]=e.Tu:t>=50&&t<60?this.fd[t-50]=e.Tu:console.log('Error unrecognised spotanim config code: ',t)}pa(){let t=l.No?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let e=0;e<6;e++)0!==this.ad[0]&&t.Ba(this.ad[e],this.fd[e]);return l.No?.put(BigInt(this.id),t),t}}},3764:(t,e,i)=>{i.d(e,{A:()=>r});var s=i(6333),n=i(1069);class r extends s.${static count=0;static Do=[];static oy=[];static ly=0;static ac=t=>{const e=new n.A(t.read('varp.dat'));this.count=e.Tu;for(let t=0;t{i.d(e,{A:()=>s});class s{static OPEN=0;static py=1;static gy=2;static _y=4;static Iy=8;static Cy=s.py<<4;static Ey=s.gy<<4;static vy=s._y<<4;static by=s.Iy<<4;static Ty=256;static Oy=512;static Ry=1024;static Ly=2048;static Sy=4096;static xy=s.Oy<<4;static My=s.Ry<<4;static ky=s.Ly<<4;static Dy=s.Sy<<4;static Ny=s.Ty<<9;static Fy=524288;static By=2097152;static Py=s.By|s.Fy;static Uy=s.Ty|s.Py;static Gy=s.gy|s.Uy;static Wy=s.Iy|s.Uy;static Yy=s.gy|s._y|s.Wy;static Hy=s.Ey|s.Uy;static Vy=s.Iy|s.Cy|s.Hy;static Ky=s.by|s.Uy;static Xy=s.py|s.gy|s.Ky;static jy=s.Ey|s.vy|s.Ky;static zy=16777215}},670:(t,e,i)=>{i.d(e,{A:()=>o});var s=i(9456),n=i(6169),r=i(1023),h=i(4909);class o{static Dr=4;static jr=104;static index=(t,e)=>t*o.jr+e;offsetX;Zy;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Zy=0,this.sizeX=o.jr,this.sizeZ=o.jr,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,e-this.Zy)]|=s.A.By};Jy=(t,e)=>{this.flags[o.index(t-this.offsetX,e-this.Zy)]&=~s.A.By};$y=(t,e,i,r,h,o)=>{let l=s.A.Ty;o&&(l|=s.A.Ny);const a=t-this.offsetX,c=e-this.Zy;if(h===n.A.Qy||h===n.A.tA){const t=i;i=r,r=t}for(let t=a;t=0&&t=0&&e{let l=s.A.Ty;o&&(l|=s.A.Ny);const a=t-this.offsetX,c=e-this.Zy;if(h===n.A.Qy||h===n.A.tA){const t=i;i=r,r=t}for(let t=a;t=0&&t=0&&e{const l=t-this.offsetX,a=e-this.Zy,c=o?s.A.Dy:s.A.by,f=o?s.A.Sy:s.A.Iy,u=o?s.A.Ry:s.A.gy,d=o?s.A.My:s.A.Ey,w=o?s.A.Oy:s.A.py,y=o?s.A.xy:s.A.Cy,A=o?s.A.Ly:s.A._y,m=o?s.A.ky:s.A.vy;i===r.A.sA.id?h===n.A.Jd?(this.add(l,a,c),this.add(l-1,a,f)):h===n.A.Qy?(this.add(l,a,u),this.add(l,a+1,d)):h===n.A.nA?(this.add(l,a,f),this.add(l+1,a,c)):h===n.A.tA&&(this.add(l,a,d),this.add(l,a-1,u)):i===r.A.rA.id||i===r.A.hA.id?h===n.A.Jd?(this.add(l,a,w),this.add(l-1,a+1,y)):h===n.A.Qy?(this.add(l,a,A),this.add(l+1,a+1,m)):h===n.A.nA?(this.add(l,a,y),this.add(l+1,a-1,w)):h===n.A.tA&&(this.add(l,a,m),this.add(l-1,a-1,A)):i===r.A.oA.id&&(h===n.A.Jd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):h===n.A.Qy?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):h===n.A.nA?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):h===n.A.tA&&(this.add(l,a,d|c),this.add(l,a-1,u),this.add(l-1,a,f))),o&&this.iA(t,e,i,h,!1)};lA=(t,e,i,h,o)=>{const l=t-this.offsetX,a=e-this.Zy,c=o?s.A.Dy:s.A.by,f=o?s.A.Sy:s.A.Iy,u=o?s.A.Ry:s.A.gy,d=o?s.A.My:s.A.Ey,w=o?s.A.Oy:s.A.py,y=o?s.A.xy:s.A.Cy,A=o?s.A.Ly:s.A._y,m=o?s.A.ky:s.A.vy;i===r.A.sA.id?h===n.A.Jd?(this.remove(l,a,c),this.remove(l-1,a,f)):h===n.A.Qy?(this.remove(l,a,u),this.remove(l,a+1,d)):h===n.A.nA?(this.remove(l,a,f),this.remove(l+1,a,c)):h===n.A.tA&&(this.remove(l,a,d),this.remove(l,a-1,u)):i===r.A.rA.id||i===r.A.hA.id?h===n.A.Jd?(this.remove(l,a,w),this.remove(l-1,a+1,y)):h===n.A.Qy?(this.remove(l,a,A),this.remove(l+1,a+1,m)):h===n.A.nA?(this.remove(l,a,y),this.remove(l+1,a-1,w)):h===n.A.tA&&(this.remove(l,a,m),this.remove(l-1,a-1,A)):i===r.A.oA.id&&(h===n.A.Jd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):h===n.A.Qy?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):h===n.A.nA?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):h===n.A.tA&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.lA(t,e,i,h,!1)};aA=(t,e,i,h,l,a)=>{if(t===i&&e===h)return!0;const c=t-this.offsetX,f=e-this.Zy,u=i-this.offsetX,d=h-this.Zy,w=o.index(c,f);if(l===r.A.sA.id){if(a===n.A.Jd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Hy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Gy)===s.A.OPEN)return!0}else if(a===n.A.Qy){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Wy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Ky)===s.A.OPEN)return!0}else if(a===n.A.nA){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Hy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Gy)===s.A.OPEN)return!0}else if(a===n.A.tA){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Wy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Ky)===s.A.OPEN)return!0}}else if(l===r.A.oA.id){if(a===n.A.Jd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Ky)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Gy)===s.A.OPEN)return!0}else if(a===n.A.Qy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Wy)===s.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Gy)===s.A.OPEN)return!0}else if(a===n.A.nA){if(c===u-1&&f===d&&(this.flags[w]&s.A.Wy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Hy)===s.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(a===n.A.tA){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Hy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Ky)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===r.A.cA.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.Ey)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Iy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}return!1};fA=(t,e,i,h,l,a)=>{if(t===i&&e===h)return!0;const c=t-this.offsetX,f=e-this.Zy,u=i-this.offsetX,d=h-this.Zy,w=o.index(c,f);if(l===r.A.uA.id||l===r.A.dA.id){if(l===r.A.dA.id&&(a=a+2&3),a===n.A.Jd){if(c===u+1&&f===d&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0}else if(a===n.A.Qy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Iy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0}else if(a===n.A.nA){if(c===u-1&&f===d&&(this.flags[w]&s.A.Iy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ey)===s.A.OPEN)return!0}else if(a===n.A.tA){if(c===u+1&&f===d&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ey)===s.A.OPEN)return!0}}else if(l===r.A.wA.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.Ey)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Iy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}return!1};yA=(t,e,i,n,r,l,a)=>{const c=i+r-1,f=n+l-1,u=o.index(t-this.offsetX,e-this.Zy);return t>=i&&t<=c&&e>=n&&e<=f||(t===i-1&&e>=n&&e<=f&&(this.flags[u]&s.A.Iy)===s.A.OPEN&&(a&h.A.Jd)===s.A.OPEN||(t===c+1&&e>=n&&e<=f&&(this.flags[u]&s.A.by)===s.A.OPEN&&(a&h.A.nA)===s.A.OPEN||(e===n-1&&t>=i&&t<=c&&(this.flags[u]&s.A.gy)===s.A.OPEN&&(a&h.A.tA)===s.A.OPEN||e===f+1&&t>=i&&t<=c&&(this.flags[u]&s.A.Ey)===s.A.OPEN&&(a&h.A.Qy)===s.A.OPEN)))};add=(t,e,i)=>{this.flags[o.index(t,e)]|=i};remove=(t,e,i)=>{this.flags[o.index(t,e)]&=s.A.zy-i}}},4909:(t,e,i)=>{i.d(e,{A:()=>s});class s{static Qy=1;static nA=2;static tA=4;static Jd=8}},6169:(t,e,i)=>{i.d(e,{A:()=>s});class s{static Jd=0;static Qy=1;static nA=2;static tA=3}},5599:(t,e,i)=>{i.d(e,{A:()=>s});class s{static AA=0;static mA=1;static pA=2;static gA=3}},1023:(t,e,i)=>{i.d(e,{A:()=>n});var s=i(5599);class n{static sA=new n(0,s.A.AA);static rA=new n(1,s.A.AA);static oA=new n(2,s.A.AA);static hA=new n(3,s.A.AA);static _A=new n(4,s.A.mA);static IA=new n(5,s.A.mA);static uA=new n(6,s.A.mA);static dA=new n(7,s.A.mA);static wA=new n(8,s.A.mA);static cA=new n(9,s.A.pA);static _d=new n(10,s.A.pA);static CA=new n(11,s.A.pA);static EA=new n(12,s.A.pA);static vA=new n(13,s.A.pA);static bA=new n(14,s.A.pA);static TA=new n(15,s.A.pA);static OA=new n(16,s.A.pA);static RA=new n(17,s.A.pA);static LA=new n(18,s.A.pA);static SA=new n(19,s.A.pA);static xA=new n(20,s.A.pA);static MA=new n(21,s.A.pA);static gA=new n(22,s.A.gA);static values(){return[this.sA,this.rA,this.RA,this.TA,this.oA,this.bA,this.cA,this.hA,this.gA,this.EA,this.CA,this.uA,this.xA,this._d,this.IA,this.vA,this.dA,this._A,this.OA,this.wA,this.SA,this.MA,this.LA]}static of(t){const e=this.values();for(let i=0;i{i.d(e,{A:()=>A});var s=i(670),n=i(2164),r=i(1069),h=i(4583),o=i(3045),l=i(5637),a=i(4197),c=i(1312),f=i(1023),u=i(6169),d=i(9298),w=i(5518),y=i(3867);class A{static kA=Int8Array.of(1,2,4,8);static DA=Uint8Array.of(16,32,64,128);static NA=Int8Array.of(1,0,-1,0);static FA=Int8Array.of(0,-1,0,1);static BA=(17*Math.random()|0)-8;static PA=(33*Math.random()|0)-16;static it=!0;static UA=0;static GA=!1;static WA=(t,e)=>{let i=this.YA(t+45365,e+91923,4)+(this.YA(t+10294,e+37821,2)-128>>1)+(this.YA(t,e,1)-128>>2)-128;return i=35+(.3*i|0),i<10?i=10:i>60&&(i=60),i};static YA=(t,e,i)=>{const s=t/i|0,n=t&i-1,r=e/i|0,h=e&i-1,o=this.HA(s,r),l=this.HA(s+1,r),a=this.HA(s,r+1),c=this.HA(s+1,r+1),f=this.VA(o,l,n,i),u=this.VA(a,c,n,i);return this.VA(f,u,h,i)};static VA=(t,e,i,s)=>{const n=65536-h.A.cos[1024*i/s|0]>>1;return(t*(65536-n)>>16)+(e*n>>16)};static HA=(t,e)=>((this.KA(t-1,e-1)+this.KA(t+1,e-1)+this.KA(t-1,e+1)+this.KA(t+1,e+1))/16|0)+((this.KA(t-1,e)+this.KA(t+1,e)+this.KA(t,e-1)+this.KA(t,e+1))/8|0)+(this.KA(t,e)/4|0);static KA=(t,e)=>{const i=t+57*e,s=BigInt(i<<13^i);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static $y=(t,e,i,s,n,r,h,o,d,w,y)=>{const m=n[y][e][i],p=n[y][e+1][i],g=n[y][e+1][i+1],_=n[y][e][i+1],I=m+p+g+_>>2,C=l.A.get(o);let E=e+(i<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A.gA.id)s?.XA(C.pa(f.A.gA.id,w,m,p,g,_,-1),t,e,i,I,E,v),C.Ed&&C.active&&h?.qy(e,i),-1!==C.gl&&r.jA(new a.A(o,t,3,e,i,c.A.Do[C.gl],!0));else if(d===f.A._d.id||d===f.A.CA.id){const n=C.pa(f.A._d.id,w,m,p,g,_,-1);if(n){let r,h,o=0;d===f.A.CA.id&&(o+=256),w===u.A.Qy||w===u.A.tA?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.$y(t,e,i,I,n,null,E,v,r,h,o)}C.Ed&&h?.$y(e,i,C.width,C.length,w,C.vd),-1!==C.gl&&r.jA(new a.A(o,t,2,e,i,c.A.Do[C.gl],!0))}else if(d>=f.A.EA.id)s?.$y(t,e,i,I,C.pa(d,w,m,p,g,_,-1),null,E,v,1,1,0),C.Ed&&h?.$y(e,i,C.width,C.length,w,C.vd),-1!==C.gl&&r.jA(new a.A(o,t,2,e,i,c.A.Do[C.gl],!0));else if(d===f.A.sA.id)s?.iA(t,e,i,I,A.kA[w],0,C.pa(f.A.sA.id,w,m,p,g,_,-1),null,E,v),C.Ed&&h?.iA(e,i,d,w,C.vd),-1!==C.gl&&r.jA(new a.A(o,t,0,e,i,c.A.Do[C.gl],!0));else if(d===f.A.rA.id)s?.iA(t,e,i,I,A.DA[w],0,C.pa(f.A.rA.id,w,m,p,g,_,-1),null,E,v),C.Ed&&h?.iA(e,i,d,w,C.vd),-1!==C.gl&&r.jA(new a.A(o,t,0,e,i,c.A.Do[C.gl],!0));else if(d===f.A.oA.id){const n=w+1&3;s?.iA(t,e,i,I,A.kA[w],A.kA[n],C.pa(f.A.oA.id,w+4,m,p,g,_,-1),C.pa(f.A.oA.id,n,m,p,g,_,-1),E,v),C.Ed&&h?.iA(e,i,d,w,C.vd),-1!==C.gl&&r.jA(new a.A(o,t,0,e,i,c.A.Do[C.gl],!0))}else if(d===f.A.hA.id)s?.iA(t,e,i,I,A.DA[w],0,C.pa(f.A.hA.id,w,m,p,g,_,-1),null,E,v),C.Ed&&h?.iA(e,i,d,w,C.vd),-1!==C.gl&&r.jA(new a.A(o,t,0,e,i,c.A.Do[C.gl],!0));else if(d===f.A.cA.id)s?.$y(t,e,i,I,C.pa(d,w,m,p,g,_,-1),null,E,v,1,1,0),C.Ed&&h?.$y(e,i,C.width,C.length,w,C.vd),-1!==C.gl&&r.jA(new a.A(o,t,2,e,i,c.A.Do[C.gl],!0));else if(d===f.A._A.id)s?.zA(t,e,i,I,0,0,E,C.pa(f.A._A.id,u.A.Jd,m,p,g,_,-1),v,512*w,A.kA[w]),-1!==C.gl&&r.jA(new a.A(o,t,1,e,i,c.A.Do[C.gl],!0));else if(d===f.A.IA.id){let n=16;if(s){const r=s.ZA(t,e,i);r>0&&(n=l.A.get(r>>14&32767).Rd)}s?.zA(t,e,i,I,A.NA[w]*n,A.FA[w]*n,E,C.pa(f.A._A.id,u.A.Jd,m,p,g,_,-1),v,512*w,A.kA[w]),-1!==C.gl&&r.jA(new a.A(o,t,1,e,i,c.A.Do[C.gl],!0))}else d===f.A.uA.id?(s?.zA(t,e,i,I,0,0,E,C.pa(f.A._A.id,u.A.Jd,m,p,g,_,-1),v,w,256),-1!==C.gl&&r.jA(new a.A(o,t,1,e,i,c.A.Do[C.gl],!0))):d===f.A.dA.id?(s?.zA(t,e,i,I,0,0,E,C.pa(f.A._A.id,u.A.Jd,m,p,g,_,-1),v,w,512),-1!==C.gl&&r.jA(new a.A(o,t,1,e,i,c.A.Do[C.gl],!0))):d===f.A.wA.id&&(s?.zA(t,e,i,I,0,0,E,C.pa(f.A._A.id,u.A.Jd,m,p,g,_,-1),v,w,768),-1!==C.gl&&r.jA(new a.A(o,t,1,e,i,c.A.Do[C.gl],!0)))};qA;JA;Hr;Vr;$A;QA;tm;im;sm;nm;rm;hm;om;lm;am;fm;constructor(t,e,i,n){this.qA=t,this.JA=e,this.Hr=i,this.Vr=n,this.$A=new y.um(s.A.Dr,t,e),this.QA=new y.um(s.A.Dr,t,e),this.tm=new y.um(s.A.Dr,t,e),this.im=new y.um(s.A.Dr,t,e),this.fm=new y.dm(s.A.Dr,t+1,e+1),this.sm=new y.um(s.A.Dr,t+1,e+1),this.nm=new y.Xr(t+1,e+1),this.rm=new Int32Array(e),this.hm=new Int32Array(e),this.om=new Int32Array(e),this.lm=new Int32Array(e),this.am=new Int32Array(e)}wm=(t,e)=>{for(let t=0;t=0&&e[s]?.qy(i,n)}A.BA+=(5*Math.random()|0)-2,A.BA<-8?A.BA=-8:A.BA>8&&(A.BA=8),A.PA+=(5*Math.random()|0)-2,A.PA<-16?A.PA=-16:A.PA>16&&(A.PA=16);for(let e=0;e>8;for(let t=1;t>2)+(i[n+1][t]>>3)+(i[n][t-1]>>2)+(i[n][t+1]>>3)+(i[n][t]>>1);this.nm[n][t]=u-d}for(let t=0;t=0&&s0){const e=n.A.Do[i-1];this.rm[t]+=e.nd,this.hm[t]+=e.td,this.om[t]+=e.ed,this.lm[t]+=e.sd,r=this.am[t]++}}const h=i-5;if(h>=0&&h0){const e=n.A.Do[i-1];this.rm[t]-=e.nd,this.hm[t]-=e.td,this.om[t]-=e.ed,this.lm[t]-=e.sd,r=this.am[t]--}}}if(i>=1&&i=0&&f=0&&y=1&&c0||y>0){const m=this.Hr[e][i][c],p=this.Hr[e][i+1][c],g=this.Hr[e][i+1][c+1],_=this.Hr[e][i][c+1],I=this.nm[i][c],C=this.nm[i+1][c],E=this.nm[i+1][c+1],v=this.nm[i][c+1];let b=-1,T=-1;if(f>0){const t=256*s/l|0,e=r/a|0;let i=o/a|0;b=n.A.ju(t,e,i);const h=t+A.BA&255;i+=A.PA,i<0?i=0:i>255&&(i=255),T=n.A.ju(h,e,i)}if(e>0){let t=0!==f||this.tm[e][i][c]===w.A.Am;y>0&&!n.A.Do[y-1].$u&&(t=!1),t&&m===p&&m===g&&m===_&&(this.fm[e][i][c]|=2340)}let O=0;if(-1!==b&&(O=h.A.palette[n.A.zu(T,96)]),0===y)t?.pm(e,i,c,w.A.Am,u.A.Jd,-1,m,p,g,_,n.A.zu(b,I),n.A.zu(b,C),n.A.zu(b,E),n.A.zu(b,v),d.A.Zl,d.A.Zl,d.A.Zl,d.A.Zl,O,d.A.Zl);else{const s=this.tm[e][i][c]+1,r=this.im[e][i][c],o=n.A.Do[y-1];let l,a,f=o.texture;f>=0?(a=h.A.gm(f),l=-1):o.qu===d.A._m?(a=0,l=-2,f=-1):(l=n.A.ju(o.Qu,o.td,o.ed),a=h.A.palette[n.A.Zu(o.rd,96)]),t?.pm(e,i,c,s,r,f,m,p,g,_,n.A.zu(b,I),n.A.zu(b,C),n.A.zu(b,E),n.A.zu(b,v),n.A.Zu(l,I),n.A.Zu(l,C),n.A.Zu(l,E),n.A.Zu(l,v),O,a)}}}}}}for(let i=1;i0&&(t<<=3,e<<=3,i<<=3);for(let s=0;s<=n;s++)for(let r=0;r<=this.JA;r++)for(let h=0;h<=this.qA;h++){if(this.fm[s][h][r]&t){let e=r,i=r,l=s,a=s;for(;e>0&&this.fm[s][h][e-1]&t;)e--;for(;i0;){for(let s=e;s<=i;s++)if(!(this.fm[l-1][h][s]&t))break t;l--}t:for(;a=8){const s=this.Hr[a][h][e]-240,r=this.Hr[l][h][e];o.A.vm(n,1,128*h,s,128*e,128*h,r,128*i+128);for(let s=l;s<=a;s++)for(let n=e;n<=i;n++)this.fm[s][h][n]&=~t}}if(this.fm[s][h][r]&e){let t=h,i=h,l=s,a=s;for(;t>0&&this.fm[s][t-1][r]&e;)t--;for(;i0;){for(let s=t;s<=i;s++)if(!(this.fm[l-1][s][r]&e))break t;l--}t:for(;a=8){const s=this.Hr[a][t][r]-240,h=this.Hr[l][t][r];o.A.vm(n,2,128*t,s,128*r,128*i+128,h,128*r);for(let s=l;s<=a;s++)for(let n=t;n<=i;n++)this.fm[s][n][r]&=~e}}if(this.fm[s][h][r]&i){let t=h,e=h,l=r,a=r;for(;l>0&&this.fm[s][h][l-1]&i;)l--;for(;a0;){for(let e=l;e<=a;e++)if(!(this.fm[s][t-1][e]&i))break t;t--}t:for(;e=4){const r=this.Hr[s][t][l];o.A.vm(n,4,128*t,r,128*l,128*e+128,r,128*a+128);for(let n=t;n<=e;n++)for(let t=l;t<=a;t++)this.fm[s][n][t]&=~i}}}}}};bm=(t,e,i,r)=>{let h=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new r.A(new Uint8Array(h));for(let r=0;r=0&&a=0&&c>24,this.im[r][a][c]=(f-2&3)<<24>>24):f<=81?this.Vr[r][a][c]=f-49<<24>>24:this.$A[r][a][c]=f-81<<24>>24}else for(;f=o.Ru,0!==f;){if(1===f){o.Ru;break}f<=49&&o.Ru}}};Om=(t,e,i,n,h,o)=>{const l=new r.A(new Uint8Array(n));let a=-1;for(;;){const n=l.Rm;if(0===n)return;a+=n;let r=0;for(;;){const n=l.Rm;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=l.Ru,w=d>>2,y=3&d,A=f+h,m=c+o;if(A>0&&m>0&&A=0&&(n=i[s]),this.$y(u,A,m,t,e,n,a,w,y)}}}};$y=(t,e,i,s,n,r,h,o,d)=>{if(A.it){if(16&this.Vr[t][e][i])return;if(this.ym(t,e,i)!==A.UA)return}const w=this.Hr[t][e][i],y=this.Hr[t][e+1][i],m=this.Hr[t][e+1][i+1],p=this.Hr[t][e][i+1],g=w+y+m+p>>2,_=l.A.get(h);let I=e+(i<<7)+(h<<14)+1073741824|0;_.active||(I+=-2147483648),I|=0;const C=(d<<6)+o<<24>>24;if(o===f.A.gA.id)(!A.it||_.active||_.Yd)&&(s?.XA(_.pa(f.A.gA.id,d,w,y,m,p,-1),t,e,i,g,I,C),_.Ed&&_.active&&r?.qy(e,i),-1!==_.gl&&n.jA(new a.A(h,t,3,e,i,c.A.Do[_.gl],!0)));else if(o===f.A._d.id||o===f.A.CA.id){const l=_.pa(f.A._d.id,d,w,y,m,p,-1);if(l){let n,r,h=0;if(o===f.A.CA.id&&(h+=256),d===u.A.Qy||d===u.A.tA?(n=_.length,r=_.width):(n=_.width,r=_.length),s?.$y(t,e,i,g,l,null,I,C,n,r,h)&&_.Dd)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=l.Lm/4|0;r>30&&(r=30),r>this.sm[t][e+s][i+n]&&(this.sm[t][e+s][i+n]=r<<24>>24)}}_.Ed&&r?.$y(e,i,_.width,_.length,d,_.vd),-1!==_.gl&&n.jA(new a.A(h,t,2,e,i,c.A.Do[_.gl],!0))}else if(o>=f.A.EA.id)s?.$y(t,e,i,g,_.pa(o,d,w,y,m,p,-1),null,I,C,1,1,0),o>=f.A.EA.id&&o<=f.A.RA.id&&o!==f.A.vA.id&&t>0&&(this.fm[t][e][i]|=2340),_.Ed&&r?.$y(e,i,_.width,_.length,d,_.vd),-1!==_.gl&&n.jA(new a.A(h,t,2,e,i,c.A.Do[_.gl],!0));else if(o===f.A.sA.id)s?.iA(t,e,i,g,A.kA[d],0,_.pa(f.A.sA.id,d,w,y,m,p,-1),null,I,C),d===u.A.Jd?(_.Dd&&(this.sm[t][e][i]=50,this.sm[t][e][i+1]=50),_.$u&&(this.fm[t][e][i]|=585)):d===u.A.Qy?(_.Dd&&(this.sm[t][e][i+1]=50,this.sm[t][e+1][i+1]=50),_.$u&&(this.fm[t][e][i+1]|=1170)):d===u.A.nA?(_.Dd&&(this.sm[t][e+1][i]=50,this.sm[t][e+1][i+1]=50),_.$u&&(this.fm[t][e+1][i]|=585)):d===u.A.tA&&(_.Dd&&(this.sm[t][e][i]=50,this.sm[t][e+1][i]=50),_.$u&&(this.fm[t][e][i]|=1170)),_.Ed&&r?.iA(e,i,o,d,_.vd),-1!==_.gl&&n.jA(new a.A(h,t,0,e,i,c.A.Do[_.gl],!0)),16!==_.Rd&&s?.Sm(t,e,i,_.Rd);else if(o===f.A.rA.id)s?.iA(t,e,i,g,A.DA[d],0,_.pa(f.A.rA.id,d,w,y,m,p,-1),null,I,C),_.Dd&&(d===u.A.Jd?this.sm[t][e][i+1]=50:d===u.A.Qy?this.sm[t][e+1][i+1]=50:d===u.A.nA?this.sm[t][e+1][i]=50:d===u.A.tA&&(this.sm[t][e][i]=50)),_.Ed&&r?.iA(e,i,o,d,_.vd),-1!==_.gl&&n.jA(new a.A(h,t,0,e,i,c.A.Do[_.gl],!0));else if(o===f.A.oA.id){const l=d+1&3;s?.iA(t,e,i,g,A.kA[d],A.kA[l],_.pa(f.A.oA.id,d+4,w,y,m,p,-1),_.pa(f.A.oA.id,l,w,y,m,p,-1),I,C),_.$u&&(d===u.A.Jd?(this.fm[t][e][i]|=265,this.fm[t][e][i+1]|=1170):d===u.A.Qy?(this.fm[t][e][i+1]|=1170,this.fm[t][e+1][i]|=585):d===u.A.nA?(this.fm[t][e+1][i]|=585,this.fm[t][e][i]|=1170):d===u.A.tA&&(this.fm[t][e][i]|=1170,this.fm[t][e][i]|=585)),_.Ed&&r?.iA(e,i,o,d,_.vd),-1!==_.gl&&n.jA(new a.A(h,t,0,e,i,c.A.Do[_.gl],!0)),16!==_.Rd&&s?.Sm(t,e,i,_.Rd)}else if(o===f.A.hA.id)s?.iA(t,e,i,g,A.DA[d],0,_.pa(f.A.hA.id,d,w,y,m,p,-1),null,I,C),_.Dd&&(d===u.A.Jd?this.sm[t][e][i+1]=50:d===u.A.Qy?this.sm[t][e+1][i+1]=50:d===u.A.nA?this.sm[t][e+1][i]=50:d===u.A.tA&&(this.sm[t][e][i]=50)),_.Ed&&r?.iA(e,i,o,d,_.vd),-1!==_.gl&&n.jA(new a.A(h,t,0,e,i,c.A.Do[_.gl],!0));else if(o===f.A.cA.id)s?.$y(t,e,i,g,_.pa(o,d,w,y,m,p,-1),null,I,C,1,1,0),_.Ed&&r?.$y(e,i,_.width,_.length,d,_.vd),-1!==_.gl&&n.jA(new a.A(h,t,2,e,i,c.A.Do[_.gl],!0));else if(o===f.A._A.id)s?.zA(t,e,i,g,0,0,I,_.pa(f.A._A.id,u.A.Jd,w,y,m,p,-1),C,512*d,A.kA[d]),-1!==_.gl&&n.jA(new a.A(h,t,1,e,i,c.A.Do[_.gl],!0));else if(o===f.A.IA.id){let r=16;if(s){const n=s.ZA(t,e,i);n>0&&(r=l.A.get(n>>14&32767).Rd)}s?.zA(t,e,i,g,A.NA[d]*r,A.FA[d]*r,I,_.pa(f.A._A.id,u.A.Jd,w,y,m,p,-1),C,512*d,A.kA[d]),-1!==_.gl&&n.jA(new a.A(h,t,1,e,i,c.A.Do[_.gl],!0))}else o===f.A.uA.id?(s?.zA(t,e,i,g,0,0,I,_.pa(f.A._A.id,u.A.Jd,w,y,m,p,-1),C,d,256),-1!==_.gl&&n.jA(new a.A(h,t,1,e,i,c.A.Do[_.gl],!0))):o===f.A.dA.id?(s?.zA(t,e,i,g,0,0,I,_.pa(f.A._A.id,u.A.Jd,w,y,m,p,-1),C,d,512),-1!==_.gl&&n.jA(new a.A(h,t,1,e,i,c.A.Do[_.gl],!0))):o===f.A.wA.id&&(s?.zA(t,e,i,g,0,0,I,_.pa(f.A._A.id,u.A.Jd,w,y,m,p,-1),C,d,768),-1!==_.gl&&n.jA(new a.A(h,t,1,e,i,c.A.Do[_.gl],!0)))};ym=(t,e,i)=>8&this.Vr[t][e][i]?0:t<=0||!(2&this.Vr[1][e][i])?t:t-1}},3045:(t,e,i)=>{i.d(e,{A:()=>g});var s=i(4583),n=i(1161),r=i(3795),h=i(8256),o=i(670),l=i(9222),a=i(6855),c=i(7441),f=i(6666),u=i(5748),d=i(3479),w=i(8950),y=i(2771),A=i(5518),m=i(6169),p=i(3867);class g{static xm=new p.Mm(8,32,51,51,!1);static km=new p.fi(100,null);static Dm=new Int32Array(o.A.Dr);static Nm=new p.Fm(o.A.Dr,500,null);static Bm=new p.fi(500,null);static Pm=new f.A;static Um=0;static Gm=0;static Wm=0;static Ym=0;static Hm=0;static Vm=0;static Km=0;static Xm=0;static jm=0;static zm=0;static Zm=0;static qm=0;static Jm=0;static $m=0;static Qm=0;static tp=0;static ep=0;static ip=0;static sp=0;static np=0;static rp=0;static hp=0;static op=!1;static lp=null;static ap=Uint8Array.of(19,55,38,155,255,110,137,205,76);static cp=Uint8Array.of(160,192,80,96,0,144,80,48,160);static fp=Uint8Array.of(76,8,137,4,0,1,38,2,19);static up=Int8Array.of(0,0,2,0,0,2,1,1,0);static dp=Int8Array.of(2,0,0,2,0,0,0,4,4);static wp=Int8Array.of(0,4,4,8,0,0,8,0,0);static yp=Int8Array.of(1,1,0,0,0,8,0,0,8);static Ap=Int8Array.of(53,-53,-53,53);static mp=Int8Array.of(-53,-53,53,53);static pp=Int8Array.of(-45,45,45,-45);static gp=Int8Array.of(45,45,-45,-45);static _p=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static Ip=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static Cp=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static Ep=0;static Hl=0;static Vl=0;static vp=-1;static bp=-1;static it=!0;static init=(t,e,i,n,r)=>{this.Gm=0,this.Wm=0,this.Ym=t,this.Hm=e,this.Vm=t/2|0,this.Km=e/2|0;const h=new p.Mm(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let e=0;e<2048;e+=64){this.Xm=s.A.sin[t],this.jm=s.A.cos[t],this.zm=s.A.sin[e],this.Zm=s.A.cos[e];const o=(t-128)/32|0,l=e/64|0;for(let t=-26;t<=26;t++)for(let e=-26;e<=26;e++){const s=128*t,a=128*e;let c=!1;for(let t=-i;t<=n;t+=128)if(this.Tp(s,a,r[o]+t)){c=!0;break}h[o][l][t+25+1][e+25+1]=c}}for(let t=0;t<8;t++)for(let e=0;e<32;e++)for(let i=-25;i<25;i++)for(let s=-25;s<25;s++){let n=!1;t:for(let r=-1;r<=1;r++)for(let o=-1;o<=1;o++){if(h[t][e][i+r+25+1][s+o+25+1]){n=!0;break t}if(h[t][(e+1)%31][i+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][e][i+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][(e+1)%31][i+r+25+1][s+o+25+1]){n=!0;break t}}this.xm[t][e][i+25][s+25]=n}};static Lo=()=>{this.km=null,this.Dm=null,this.Nm=null,this.Pm=null,this.xm=null,this.Bm=null,this.lp=null,console.log('World3D unloaded!')};static vm=(t,e,i,s,n,r,o,l)=>{g.Nm[t][g.Dm[t]++]=new h.A(i/128|0,r/128|0,n/128|0,l/128|0,e,i,r,n,l,s,o)};static Tp=(t,e,i)=>{const s=e*this.zm+t*this.Zm>>16,n=e*this.Zm-t*this.zm>>16,r=i*this.Xm+n*this.jm>>16,h=i*this.jm-n*this.Xm>>16;if(r<50||r>3500)return!1;const o=this.Vm+((s<<9)/r|0),l=this.Km+((h<<9)/r|0);return o>=this.Gm&&o<=this.Ym&&l>=this.Wm&&l<=this.Hm};Op;qA;JA;Rp;Lp;Ih;Sp;xp;Mp;kp=0;Dp=0;Np=0;constructor(t,e,i,s){this.Op=i,this.qA=s,this.JA=e,this.Lp=new p.Eh(i,s,e,null),this.Sp=new p.dm(i,s+1,e+1),this.Rp=t,this.Ih=new p.fi(5e3,null),this.xp=new Int32Array(1e4),this.Mp=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.Dp=t;for(let e=0;e{const i=this.Lp[0][t][e];for(let i=0;i<3;i++){this.Lp[i][t][e]=this.Lp[i+1][t][e];const s=this.Lp[i][t][e];s&&s.level--}this.Lp[0][t][e]||(this.Lp[0][t][e]=new r.A(0,t,e));const s=this.Lp[0][t][e];s&&(s.Bp=i),this.Lp[3][t][e]=null};Im=(t,e,i,s)=>{const n=this.Lp[t][e][i];n&&(n.Pp=s)};pm=(t,e,i,s,n,h,o,l,a,c,f,u,w,m,p,g,_,I,C,E)=>{if(s===A.A.Am){for(let s=t;s>=0;s--)this.Lp[s][e][i]||(this.Lp[s][e][i]=new r.A(s,e,i));const s=this.Lp[t][e][i];s&&(s.Up=new d.A(f,u,w,m,-1,C,!1))}else if(s===A.A.Gp){for(let s=t;s>=0;s--)this.Lp[s][e][i]||(this.Lp[s][e][i]=new r.A(s,e,i));const s=this.Lp[t][e][i];s&&(s.Up=new d.A(p,g,_,I,h,E,o===l&&o===a&&o===c))}else{for(let s=t;s>=0;s--)this.Lp[s][e][i]||(this.Lp[s][e][i]=new r.A(s,e,i));const d=this.Lp[t][e][i];d&&(d.Wp=new y.A(e,s,g,l,w,n,f,c,E,p,h,I,C,a,_,m,o,i,u))}};XA=(t,e,i,s,n,h,o)=>{this.Lp[e][i][s]||(this.Lp[e][i][s]=new r.A(e,i,s));const a=this.Lp[e][i][s];a&&(a.Yp=new l.A(n,128*i+64,128*s+64,t,h,o))};Hp=(t,e,i)=>{const s=this.Lp[t][e][i];s&&(s.Yp=null)};Vp=(t,e,i,s,n,h,o,l)=>{let a=0;const c=this.Lp[s][t][e];if(c)for(let t=0;ta&&(a=i)}else this.Lp[s][t][e]=new r.A(s,t,e);const f=this.Lp[s][t][e];f&&(f.jp=new u.A(i,128*t+64,128*e+64,h,o,l,n,a))};zp=(t,e,i)=>{const s=this.Lp[t][e][i];s&&(s.jp=null)};iA=(t,e,i,s,n,h,o,l,c,f)=>{if(!o&&!l)return;for(let s=t;s>=0;s--)this.Lp[s][e][i]||(this.Lp[s][e][i]=new r.A(s,e,i));const u=this.Lp[t][e][i];u&&(u.Zp=new a.A(s,128*e+64,128*i+64,n,h,o,l,c,f))};lA=(t,e,i,s)=>{const n=this.Lp[t][e][i];1===s&&n&&(n.Zp=null)};zA=(t,e,i,s,n,h,o,l,a,f,u)=>{if(!l)return;for(let s=t;s>=0;s--)this.Lp[s][e][i]||(this.Lp[s][e][i]=new r.A(s,e,i));const d=this.Lp[t][e][i];d&&(d.qp=new c.A(s,128*e+n+64,128*i+h+64,u,f,l,o,a))};Jp=(t,e,i)=>{const s=this.Lp[t][e][i];s&&(s.qp=null)};Sm=(t,e,i,s)=>{const n=this.Lp[t][e][i];if(!n)return;const r=n.qp;if(!r)return;const h=128*e+64,o=128*i+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};$p=(t,e,i,s)=>{if(!s)return;const n=this.Lp[t][e][i];if(!n)return;const r=n.qp;r&&(r.model=s)};Qp=(t,e,i,s)=>{if(!s)return;const n=this.Lp[t][e][i];if(!n)return;const r=n.Yp;r&&(r.model=s)};tg=(t,e,i,s)=>{if(!s)return;const n=this.Lp[t][e][i];if(!n)return;const r=n.Zp;r&&(r.eg=s)};ig=(t,e,i,s,n)=>{if(!s)return;const r=this.Lp[i][t][e];if(!r)return;const h=r.Zp;h&&(h.eg=s,h.sg=n)};$y=(t,e,i,s,n,r,h,o,l,a,c)=>{if(!n&&!r)return!0;const f=128*e+64*l,u=128*i+64*a;return this.ng(f,u,s,t,e,i,l,a,n,r,h,o,c,!1)};rg=(t,e,i,s,n,r,h,o,l,a)=>{if(!n&&!r)return!0;let c=e-l,f=s-l,u=e+l,d=s+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.ng(e,s,i,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};hg=(t,e,i,s,n,r,h,o,l,a,c,f)=>!l&&!a||this.ng(e,s,i,t,n,r,h+1-n,o-r+1,l,a,c,0,f,!0);eA=(t,e,i)=>{const s=this.Lp[t][e][i];if(s)for(let t=0;t>29&3)&&n.lg===e&&n.ag===i)return void this.cg(n)}};fg=(t,e,i,s)=>{if(!s)return;const n=this.Lp[t][e][i];if(n)for(let t=0;t>29&3))return void(e.model=s)}};ug=()=>{for(let t=0;t{const s=this.Lp[t][e][i];return s&&s.Zp?s.Zp.og:0};dg=(t,e,i)=>{const s=this.Lp[t][i][e];return s&&s.qp?s.qp.og:0};wg=(t,e,i)=>{const s=this.Lp[t][e][i];if(!s)return 0;for(let t=0;t>29&3)&&n.lg===e&&n.ag===i)return n.og}return 0};yg=(t,e,i)=>{const s=this.Lp[t][e][i];return s&&s.Yp?s.Yp.og:0};Ag=(t,e,i,s)=>{const n=this.Lp[t][e][i];if(n){if(n.Zp&&n.Zp.og===s)return 255&n.Zp.info;if(n.qp&&n.qp.og===s)return 255&n.qp.info;if(n.Yp&&n.Yp.og===s)return 255&n.Yp.info;for(let t=0;t{const r=e*(0|Math.sqrt(i*i+s*s+n*n))>>8;for(let e=0;e{if(e0){const n=this.Lp[t][e+1][i-1];n&&n.Yp&&n.Yp.model&&n.Yp.model.mg&&this.gg(s,n.Yp.model,128,0,-128,!0)}};pg=(t,e,i,s,n,r)=>{let h=!0,o=e;const l=e+s,a=i-1,c=i+n;for(let f=t;f<=t+1;f++)if(f!==this.Op){for(let u=o;u<=l;u++)if(!(u<0||u>=this.qA))for(let o=a;o<=c;o++){if(o<0||o>=this.JA||h&&u=i||u===e))continue;const a=this.Lp[f][u][o];if(!a)continue;const d=128*(u-e)+64*(1-s),w=128*(o-i)+64*(1-n),y=((this.Rp[f][u][o]+this.Rp[f][u+1][o]+this.Rp[f][u][o+1]+this.Rp[f][u+1][o+1])/4|0)-((this.Rp[t][e][i]+this.Rp[t][e+1][i]+this.Rp[t][e][i+1]+this.Rp[t][e+1][i+1])/4|0),A=a.Zp;A&&A.eg&&A.eg.mg&&this.gg(r,A.eg,d,y,w,h),A&&A.sg&&A.sg.mg&&this.gg(r,A.sg,d,y,w,h);for(let t=0;t{this.Np++;let h=0;const o=e.Xd,l=e.Kd;if(t.mg&&t.vg)for(let r=0;re.bg)continue;const u=t.Xd[r]-i;if(ue.Og)continue;const d=t.jd[r]-n;if(de.Lg)continue;if(e.mg&&e.vg)for(let t=0;t{const h=this.Lp[t][e][i];if(!h)return;const o=h.Up;if(o){const t=o.color;if(0!==t)for(let e=0;e<4;e++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const l=h.Wp;if(!l)return;const a=l.shape,c=l.angle,f=l.Fg,u=l.Bg,d=g._p[a],w=g.Ip[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,e)=>{g.op=!0,g.Hl=t,g.Vl=e,g.vp=-1,g.bp=-1};draw=(t,e,i,n,r,h,o)=>{t<0?t=0:t>=128*this.qA&&(t=128*this.qA-1),i<0?i=0:i>=128*this.JA&&(i=128*this.JA-1),g.Um++,g.Xm=s.A.sin[h],g.jm=s.A.cos[h],g.zm=s.A.sin[r],g.Zm=s.A.cos[r],g.lp=g.xm[(h-128)/32|0][r/64|0],g.qm=t,g.Jm=e,g.$m=i,g.Qm=t/128|0,g.tp=i/128|0,g.rp=n,g.ep=g.Qm-25,g.ep<0&&(g.ep=0),g.sp=g.tp-25,g.sp<0&&(g.sp=0),g.ip=g.Qm+25,g.ip>this.qA&&(g.ip=this.qA),g.np=g.tp+25,g.np>this.JA&&(g.np=this.JA),this.Pg(),g.hp=0;for(let t=this.Dp;t=2e3)?(h.visible=!0,h.update=!0,h.Ug=h.Kp>0,g.hp++):(h.visible=!1,h.update=!1,h.Gg=0))}}for(let t=this.Dp;t=g.ip))for(let t=-25;t<=0;t++){const n=g.tp+t,r=g.tp-t;let h;if(i>=g.ep&&(n>=g.sp&&(h=e[i][n],h&&h.visible&&this.Wg(h,!0,o)),r=g.sp&&(h=e[s][n],h&&h.visible&&this.Wg(h,!0,o)),r=g.ip))for(let t=-25;t<=0;t++){const n=g.tp+t,r=g.tp-t;let h;if(i>=g.ep&&(n>=g.sp&&(h=e[i][n],h&&h.visible&&this.Wg(h,!1,o)),r=g.sp&&(h=e[s][n],h&&h.visible&&this.Wg(h,!1,o)),r{if(!c&&!f)return!1;for(let t=h;t=this.qA||e>=this.JA)return!1;const i=this.Lp[s][t][e];if(i&&i.Kp>=5)return!1}const A=new n.A(s,i,t,e,c,f,w,h,h+l-1,o,o+a-1,u,d);for(let t=h;th&&(i|=1),to&&(i+=8),e=0;i--)this.Lp[i][t][e]||(this.Lp[i][t][e]=new r.A(i,t,e));const n=this.Lp[s][t][e];n&&(n.Xp[n.Kp]=A,n.Yg[n.Kp]=i,n.Hg|=i,n.Kp++)}return y&&(this.Ih[this.kp++]=A),!0};cg=t=>{for(let e=t.lg;e<=t.Ig;e++)for(let i=t.ag;i<=t.Cg;i++){const s=this.Lp[t.level][e][i];if(s){for(let e=0;e{const t=g.Dm[g.rp],e=g.Nm[g.rp];g.Ep=0;for(let i=0;i=0&&s<=50){n=t.Kg+25-g.tp,n<0&&(n=0),r=t.JA+25-g.tp,r>50&&(r=50);let e=!1;for(;n<=r;)if(g.lp&&g.lp[s][n++]){e=!0;break}if(e){if(h=g.qm-t.Tg,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.Xg=(t.Rg-g.$m<<8)/h|0,t.jg=(t.Lg-g.$m<<8)/h|0,t.zg=(t.bg-g.Jm<<8)/h|0,t.Zg=(t.iw-g.Jm<<8)/h|0,g.Bm[g.Ep++]=t}}}else if(2===t.type){if(s=t.Kg+25-g.tp,s>=0&&s<=50){n=t.Vg+25-g.Qm,n<0&&(n=0),r=t.qA+25-g.Qm,r>50&&(r=50);let e=!1;for(;n<=r;)if(g.lp&&g.lp[n++][s]){e=!0;break}if(e){if(h=g.$m-t.Rg,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.qg=(t.Tg-g.qm<<8)/h|0,t.Jg=(t.Og-g.qm<<8)/h|0,t.zg=(t.bg-g.Jm<<8)/h|0,t.Zg=(t.iw-g.Jm<<8)/h|0,g.Bm[g.Ep++]=t}}}else if(4===t.type&&(s=t.bg-g.Jm,s>128&&(n=t.Kg+25-g.tp,n<0&&(n=0),r=t.JA+25-g.tp,r>50&&(r=50),n<=r))){let e=t.Vg+25-g.Qm;e<0&&(e=0),h=t.qA+25-g.Qm,h>50&&(h=50);let i=!1;t:for(let t=e;t<=h;t++)for(let e=n;e<=r;e++)if(g.lp&&g.lp[t][e]){i=!0;break t}i&&(t.mode=5,t.qg=(t.Tg-g.qm<<8)/s|0,t.Jg=(t.Og-g.qm<<8)/s|0,t.Xg=(t.Rg-g.$m<<8)/s|0,t.jg=(t.Lg-g.$m<<8)/s|0,g.Bm[g.Ep++]=t)}}};Wg=(t,e,i)=>{for(g.Pm.jA(t);;){let t;do{if(t=g.Pm.$g(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.Qg,o=this.Lp[r];if(t.visible){if(e){if(r>0){const t=this.Lp[r-1][s][n];if(t&&t.update)continue}if(s<=g.Qm&&s>g.ep){const e=o[s-1][n];if(e&&e.update&&(e.visible||!(1&t.Hg)))continue}if(s>=g.Qm&&sg.sp){const e=o[s][n-1];if(e&&e.update&&(e.visible||!(8&t.Hg)))continue}if(n>=g.tp&&nn&&(a+=6),c=g.ap[a],t.r_=g.fp[a]),f&&(f.h_&g.cp[a]?16===f.h_?(t.Gg=3,t.o_=g.up[a],t.l_=3-t.o_):32===f.h_?(t.Gg=6,t.o_=g.dp[a],t.l_=6-t.o_):64===f.h_?(t.Gg=12,t.o_=g.wp[a],t.l_=12-t.o_):(t.Gg=9,t.o_=g.yp[a],t.l_=9-t.o_):t.Gg=0,f.h_&c&&!this.a_(h,s,n,f.h_)&&f.eg?.draw(0,g.Xm,g.jm,g.zm,g.Zm,f.x-g.qm,f.y-g.Jm,f.z-g.$m,f.og),f.c_&c&&!this.a_(h,s,n,f.c_)&&f.sg?.draw(0,g.Xm,g.jm,g.zm,g.Zm,f.x-g.qm,f.y-g.Jm,f.z-g.$m,f.og)),u&&!this.visible(h,s,n,u.model.iw))if(u.type&c)u.model.draw(u.angle,g.Xm,g.jm,g.zm,g.Zm,u.x-g.qm,u.y-g.Jm,u.z-g.$m,u.og);else if(768&u.type){const t=u.x-g.qm,e=u.y-g.Jm,i=u.z-g.$m,s=u.angle;let n,r;if(n=s===m.A.Qy||s===m.A.nA?-t:t,r=s===m.A.nA||s===m.A.tA?-i:i,256&u.type&&rn){const n=t+g.pp[s],r=i+g.gp[s];u.model.draw(512*s+1280&2047,g.Xm,g.jm,g.zm,g.Zm,n,e,r,u.og)}}if(l){const e=t.Yp;e&&e.model?.draw(0,g.Xm,g.jm,g.zm,g.Zm,e.x-g.qm,e.y-g.Jm,e.z-g.$m,e.og);const i=t.jp;i&&0===i.offset&&(i.f_&&i.f_.draw(0,g.Xm,g.jm,g.zm,g.Zm,i.x-g.qm,i.y-g.Jm,i.z-g.$m,i.og),i.u_&&i.u_.draw(0,g.Xm,g.jm,g.zm,g.Zm,i.x-g.qm,i.y-g.Jm,i.z-g.$m,i.og),i.d_&&i.d_.draw(0,g.Xm,g.jm,g.zm,g.Zm,i.x-g.qm,i.y-g.Jm,i.z-g.$m,i.og))}const d=t.Hg;if(0!==d){if(sg.Qm&&1&d){const t=o[s-1][n];t&&t.update&&g.Pm.jA(t)}if(n>g.tp&&8&d){const t=o[s][n-1];t&&t.update&&g.Pm.jA(t)}}}if(0!==t.Gg){let e=!0;for(let i=0;ie.lg&&(r+=1),ie.ag&&(r+=8),ss&&(s=n);const h=g.tp-e.ag,l=e.Cg-g.tp;e.w_=l>h?s+l:s+h}for(;;){let t=-50,e=-1;for(let i=0;it&&(t=s.w_,e=i))}if(-1===e)break;const l=g.km[e];if(l){l.Um=g.Um;let t=l.model;t||(t=l.s_?.draw(i)??null),t&&!this.y_(h,l.lg,l.Ig,l.ag,l.Cg,t.iw)&&t.draw(l.n_,g.Xm,g.jm,g.zm,g.Zm,l.x-g.qm,l.y-g.Jm,l.z-g.$m,l.og);for(let t=l.lg;t<=l.Ig;t++)for(let e=l.ag;e<=l.Cg;e++){const i=o[t][e];i&&(0!==i.Gg?g.Pm.jA(i):t===s&&e===n||!i.update||g.Pm.jA(i))}}}if(t.Ug)continue}if(!t.update||0!==t.Gg)continue;if(s<=g.Qm&&s>g.ep){const t=o[s-1][n];if(t&&t.update)continue}if(s>=g.Qm&&sg.sp){const t=o[s][n-1];if(t&&t.update)continue}if(n>=g.tp&&n=r){const r=t+g.Ap[n],h=s+g.mp[n];e.model.draw(512*n+256,g.Xm,g.jm,g.zm,g.Zm,r,i,h,e.og)}if(512&e.type&&h<=r){const r=t+g.pp[n],h=s+g.gp[n];e.model.draw(512*n+1280&2047,g.Xm,g.jm,g.zm,g.Zm,r,i,h,e.og)}}const i=t.Zp;i&&(i.c_&t.r_&&!this.a_(h,s,n,i.c_)&&i.sg?.draw(0,g.Xm,g.jm,g.zm,g.Zm,i.x-g.qm,i.y-g.Jm,i.z-g.$m,i.og),i.h_&t.r_&&!this.a_(h,s,n,i.h_)&&i.eg?.draw(0,g.Xm,g.jm,g.zm,g.Zm,i.x-g.qm,i.y-g.Jm,i.z-g.$m,i.og))}if(rg.Qm){const t=o[s-1][n];t&&t.update&&g.Pm.jA(t)}if(n>g.tp){const t=o[s][n-1];t&&t.update&&g.Pm.jA(t)}}};e_=(t,e,i,n,r,h,o,l)=>{let a,c,f,u,d=a=(i<<7)-g.qm,y=c=(n<<7)-g.$m,A=f=d+128,m=u=y+128,p=this.Rp[e][i][n]-g.Jm,_=this.Rp[e][i+1][n]-g.Jm,I=this.Rp[e][i+1][n+1]-g.Jm,C=this.Rp[e][i][n+1]-g.Jm,E=y*o+d*l>>16;if(y=y*l-d*o>>16,d=E,E=p*h-y*r>>16,y=p*r+y*h>>16,p=E,y<50)return;if(E=c*o+A*l>>16,c=c*l-A*o>>16,A=E,E=_*h-c*r>>16,c=_*r+c*h>>16,_=E,c<50)return;if(E=m*o+f*l>>16,m=m*l-f*o>>16,f=E,E=I*h-m*r>>16,m=I*r+m*h>>16,I=E,m<50)return;if(E=u*o+a*l>>16,u=u*l-a*o>>16,a=E,E=C*h-u*r>>16,u=C*r+u*h>>16,C=E,u<50)return;const v=s.A.ya+((d<<9)/y|0),b=s.A.Aa+((p<<9)/y|0),T=s.A.ya+((A<<9)/c|0),O=s.A.Aa+((_<<9)/c|0),R=s.A.ya+((f<<9)/m|0),L=s.A.Aa+((I<<9)/m|0),S=s.A.ya+((a<<9)/u|0),x=s.A.Aa+((C<<9)/u|0);if(s.A.alpha=0,(R-S)*(O-x)-(L-x)*(T-S)>0)if(s.A.A_=R<0||S<0||T<0||R>w.A.m_||S>w.A.m_||T>w.A.m_,g.op&&this.p_(g.Hl,g.Vl,L,x,O,R,S,T)&&(g.vp=i,g.bp=n),-1===t.g_)12345678!==t.__&&s.A.I_(R,S,T,L,x,O,t.__,t.C_,t.E_);else if(g.it){const e=g.Cp[t.g_];s.A.I_(R,S,T,L,x,O,this.v_(e,t.__),this.v_(e,t.C_),this.v_(e,t.E_))}else t.flat?s.A.b_(R,S,T,L,x,O,t.__,t.C_,t.E_,d,p,y,A,a,_,C,c,u,t.g_):s.A.b_(R,S,T,L,x,O,t.__,t.C_,t.E_,f,I,m,a,A,C,_,u,c,t.g_);if(!((v-T)*(x-O)-(b-O)*(S-T)<=0))if(s.A.A_=v<0||T<0||S<0||v>w.A.m_||T>w.A.m_||S>w.A.m_,g.op&&this.p_(g.Hl,g.Vl,b,O,x,v,T,S)&&(g.vp=i,g.bp=n),-1!==t.g_){if(!g.it)return void s.A.b_(v,T,S,b,O,x,t.T_,t.E_,t.C_,d,p,y,A,a,_,C,c,u,t.g_);const e=g.Cp[t.g_];s.A.I_(v,T,S,b,O,x,this.v_(e,t.T_),this.v_(e,t.E_),this.v_(e,t.C_))}else 12345678!==t.T_&&s.A.I_(v,T,S,b,O,x,t.T_,t.E_,t.C_)};i_=(t,e,i,n,r,h,o)=>{let l=i.Xd.length;for(let t=0;t>16;if(a=a*o-e*h>>16,e=c,c=l*r-a*n>>16,a=l*n+a*r>>16,l=c,a<50)return;i.O_&&(y.A.R_[t]=e,y.A.L_[t]=l,y.A.S_[t]=a),y.A.x_[t]=s.A.ya+((e<<9)/a|0),y.A.M_[t]=s.A.Aa+((l<<9)/a|0)}s.A.alpha=0,l=i.k_.length;for(let n=0;n0)if(s.A.A_=l<0||a<0||c<0||l>w.A.m_||a>w.A.m_||c>w.A.m_,g.op&&this.p_(g.Hl,g.Vl,f,u,d,l,a,c)&&(g.vp=t,g.bp=e),i.O_&&-1!==i.O_[n])if(g.it){const t=g.Cp[i.O_[n]];s.A.I_(l,a,c,f,u,d,this.v_(t,i.F_[n]),this.v_(t,i.B_[n]),this.v_(t,i.P_[n]))}else i.flat?s.A.b_(l,a,c,f,u,d,i.F_[n],i.B_[n],i.P_[n],y.A.R_[0],y.A.L_[0],y.A.S_[0],y.A.R_[1],y.A.R_[3],y.A.L_[1],y.A.L_[3],y.A.S_[1],y.A.S_[3],i.O_[n]):s.A.b_(l,a,c,f,u,d,i.F_[n],i.B_[n],i.P_[n],y.A.R_[r],y.A.L_[r],y.A.S_[r],y.A.R_[h],y.A.R_[o],y.A.L_[h],y.A.L_[o],y.A.S_[h],y.A.S_[o],i.O_[n]);else 12345678!==i.F_[n]&&s.A.I_(l,a,c,f,u,d,i.F_[n],i.B_[n],i.P_[n])}};t_=(t,e,i)=>{const s=this.Sp[t][e][i];if(s===-g.Um)return!1;if(s===g.Um)return!0;{const s=e<<7,n=i<<7;return this.U_(s+1,this.Rp[t][e][i],n+1)&&this.U_(s+128-1,this.Rp[t][e+1][i],n+1)&&this.U_(s+128-1,this.Rp[t][e+1][i+1],n+128-1)&&this.U_(s+1,this.Rp[t][e][i+1],n+128-1)?(this.Sp[t][e][i]=g.Um,!0):(this.Sp[t][e][i]=-g.Um,!1)}};a_=(t,e,i,s)=>{if(!this.t_(t,e,i))return!1;const n=e<<7,r=i<<7,h=this.Rp[t][e][i]-1,o=h-120,l=h-230,a=h-238;if(s<16){if(1===s){if(n>g.qm){if(!this.U_(n,h,r))return!1;if(!this.U_(n,h,r+128))return!1}if(t>0){if(!this.U_(n,o,r))return!1;if(!this.U_(n,o,r+128))return!1}return!!this.U_(n,l,r)&&this.U_(n,l,r+128)}if(2===s){if(r0){if(!this.U_(n,o,r+128))return!1;if(!this.U_(n+128,o,r+128))return!1}return!!this.U_(n,l,r+128)&&this.U_(n+128,l,r+128)}if(4===s){if(n0){if(!this.U_(n+128,o,r))return!1;if(!this.U_(n+128,o,r+128))return!1}return!!this.U_(n+128,l,r)&&this.U_(n+128,l,r+128)}if(8===s){if(r>g.$m){if(!this.U_(n,h,r))return!1;if(!this.U_(n+128,h,r))return!1}if(t>0){if(!this.U_(n,o,r))return!1;if(!this.U_(n+128,o,r))return!1}return!!this.U_(n,l,r)&&this.U_(n+128,l,r)}}return!!this.U_(n+64,a,r+64)&&(16===s?this.U_(n,l,r+128):32===s?this.U_(n+128,l,r+128):64===s?this.U_(n+128,l,r):128===s?this.U_(n,l,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,e,i,s)=>{if(this.t_(t,e,i)){const n=e<<7,r=i<<7;return this.U_(n+1,this.Rp[t][e][i]-s,r+1)&&this.U_(n+128-1,this.Rp[t][e+1][i]-s,r+1)&&this.U_(n+128-1,this.Rp[t][e+1][i+1]-s,r+128-1)&&this.U_(n+1,this.Rp[t][e][i+1]-s,r+128-1)}return!1};y_=(t,e,i,s,n,r)=>{let h,o;if(e!==i||s!==n){for(h=e;h<=i;h++)for(o=s;o<=n;o++)if(this.Sp[t][h][o]===-g.Um)return!1;o=1+(e<<7);const l=2+(s<<7),a=this.Rp[t][e][s]-r;if(!this.U_(o,a,l))return!1;const c=(i<<7)-1;if(!this.U_(c,a,l))return!1;const f=(n<<7)-1;return!!this.U_(o,a,f)&&this.U_(c,a,f)}return!!this.t_(t,e,s)&&(h=e<<7,o=s<<7,this.U_(h+1,this.Rp[t][e][s]-r,o+1)&&this.U_(h+128-1,this.Rp[t][e+1][s]-r,o+1)&&this.U_(h+128-1,this.Rp[t][e+1][s+1]-r,o+128-1)&&this.U_(h+1,this.Rp[t][e][s+1]-r,o+128-1))};U_=(t,e,i)=>{for(let s=0;s0){const t=n.Rg+(n.Xg*s>>8),r=n.Lg+(n.jg*s>>8),h=n.bg+(n.zg*s>>8),o=n.iw+(n.Zg*s>>8);if(i>=t&&i<=r&&e>=h&&e<=o)return!0}}else if(2===n.mode){const s=t-n.Tg;if(s>0){const t=n.Rg+(n.Xg*s>>8),r=n.Lg+(n.jg*s>>8),h=n.bg+(n.zg*s>>8),o=n.iw+(n.Zg*s>>8);if(i>=t&&i<=r&&e>=h&&e<=o)return!0}}else if(3===n.mode){const s=n.Rg-i;if(s>0){const i=n.Tg+(n.qg*s>>8),r=n.Og+(n.Jg*s>>8),h=n.bg+(n.zg*s>>8),o=n.iw+(n.Zg*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}else if(4===n.mode){const s=i-n.Rg;if(s>0){const i=n.Tg+(n.qg*s>>8),r=n.Og+(n.Jg*s>>8),h=n.bg+(n.zg*s>>8),o=n.iw+(n.Zg*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}else if(5===n.mode){const s=e-n.bg;if(s>0){const e=n.Tg+(n.qg*s>>8),r=n.Og+(n.Jg*s>>8),h=n.Rg+(n.Xg*s>>8),o=n.Lg+(n.jg*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}}return!1};p_=(t,e,i,s,n,r,h,o)=>{if(ei&&e>s&&e>n)return!1;if(tr&&t>h&&t>o)return!1;const l=(e-s)*(o-h)-(t-h)*(n-s);return((e-i)*(h-r)-(t-r)*(s-i))*l>0&&l*((e-n)*(r-o)-(t-o)*(i-n))>0};v_=(t,e)=>((e=(127-e)*(127&t)/160|0)<2?e=2:e>126&&(e=126),(65408&t)+e)}},7121:(t,e,i)=>{i.d(e,{A:()=>n});var s=i(1982);class n extends s.A{}},4197:(t,e,i)=>{i.d(e,{A:()=>n});var s=i(1982);class n extends s.A{G_;W_;Y_;H_;index;hy;Cl;Il;constructor(t,e,i,s,n,r,h){super(),this.G_=e,this.W_=i,this.Y_=s,this.H_=n,this.index=t,this.hy=r,h&&-1!==r.vl&&this.hy.delay?(this.Cl=Math.random()*this.hy.El|0,this.Il=Math.random()*this.hy.delay[this.Cl]|0):(this.Cl=-1,this.Il=0)}}},9418:(t,e,i)=>{i.d(e,{A:()=>h});var s=i(7121),n=i(1312),r=i(3867);class h extends s.A{x=0;z=0;n_=0;V_=!1;size=1;Ga=-1;K_=-1;X_=-1;j_=-1;z_=-1;Z_=-1;q_=-1;J_=null;Q_=100;tI=0;eI=0;iI=0;sI=0;nI=-1e3;rI=0;hI=0;oI=-1;lI=0;aI=0;cI=-1;fI=0;uI=0;dI=-1;wI=0;yI=0;AI=0;mI=0;pI=-1;gI=0;_I=0;II=0;CI=0;EI=0;vI=0;bI=0;TI=0;OI=0;RI=0;LI=0;Um=0;height=0;SI=0;pathLength=0;xI=new Int32Array(10);MI=new Int32Array(10);kI=new r.fi(10,!1);DI=0;NI=-1;FI=-1;BI=-1;UI=-1;move(t,e,i){if(-1!==this.dI&&n.A.Do[this.dI].priority<=1&&(this.dI=-1),!t){const t=e-this.xI[0],s=i-this.MI[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.xI[t]=this.xI[t-1],this.MI[t]=this.MI[t-1],this.kI[t]=this.kI[t-1];return this.xI[0]=e,this.MI[0]=i,void(this.kI[0]=!1)}}this.pathLength=0,this.DI=0,this.xI[0]=e,this.MI[0]=i,this.x=128*this.xI[0]+64*this.size,this.z=128*this.MI[0]+64*this.size}step(t,e){let i=this.xI[0],s=this.MI[0];0===e?(i--,s++):1===e?s++:2===e?(i++,s++):3===e?i--:4===e?i++:5===e?(i--,s--):6===e?s--:7===e&&(i++,s--),-1!==this.dI&&n.A.Do[this.dI].priority<=1&&(this.dI=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.xI[t]=this.xI[t-1],this.MI[t]=this.MI[t-1],this.kI[t]=this.kI[t-1];this.xI[0]=i,this.MI[0]=s,this.kI[0]=t}}},8268:(t,e,i)=>{i.d(e,{A:()=>d});var s=i(9418),n=i(8665),r=i(2679),h=i(8738),o=i(1312),l=i(8317),a=i(1302),c=i(3819),f=i(3867),u=i(9298);class d extends s.A{static GI=1;static WI=2;static YI=4;static HI=8;static VI=16;static KI=32;static XI=64;static jI=128;static zI=256;static ZI=512;static Ua=[u.A.qI,u.A.JI,u.A.$I,u.A.QI,u.A.tC,u.A.eC,u.A.iC,u.A.sC,u.A.nC,u.A.rC,u.A.hC,u.A.oC,u.A.lC,u.A.aC,u.A.cC,u.A.fC];static Pa=[[u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.AC,u.A.mC,u.A.pC,u.A.gC,u.A._C,u.A.IC,u.A.CC,u.A.EC],[u.A.vC,u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.LC,u.A.SC,u.A.xC,u.A.MC,u.A.kC,u.A.DC,u.A.NC,u.A.FC,u.A.BC,u.A.PC,u.A.UC],[u.A.UC-1,u.A.vC+1,u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.LC,u.A.SC,u.A.xC,u.A.MC,u.A.kC,u.A.DC,u.A.NC,u.A.FC,u.A.BC,u.A.PC],[u.A.GC,u.A.WC,u.A.YC,u.A.HC,u.A.VC,u.A.KC],[u.A.XC,u.A.jC,u.A.zC,u.A.ZC,u.A.qC,u.A.JC,u.A.$C,u.A.QC]];static No=new r.A(200);name=null;visible=!1;tE=0;eE=0;iE=new Uint16Array(12);sE=new Uint16Array(5);ec=0;nE=0n;y=0;rE=0;hE=0;oE=0;lE=0;aE=0;cE=null;Vg=0;Kg=0;qA=0;JA=0;it=!1;draw(t){if(!this.visible)return null;let e=this.uw();if(this.height=e.iw,e.Aw=!0,this.it)return e;if(-1!==this.pI&&-1!==this.gI){const t=h.A.Do[this.pI],i=n.A.Yu(t.pa(),!0,!t.Od,!1);i.translate(-this.CI,0,0),i.Wa(),t.hy&&t.hy.frames&&i.Ya(t.hy.frames[this.gI]),i.$d=null,i.Qd=null,128===t.cw&&128===t.fw||i.scale(t.cw,t.fw,t.cw),i.Ha(t.Ld+64,t.Sd+850,-30,-50,-30,!0);const s=[e,i];e=n.A.fE(s,2)}if(this.cE&&(t>=this.hE&&(this.cE=null),t>=this.rE&&t=d.Pa[e].length)&&(i=0),this.sE[e]=i}this.Ga=t.Tu,65535===this.Ga&&(this.Ga=-1),this.K_=t.Tu,65535===this.K_&&(this.K_=-1),this.X_=t.Tu,65535===this.X_&&(this.X_=-1),this.j_=t.Tu,65535===this.j_&&(this.j_=-1),this.z_=t.Tu,65535===this.z_&&(this.z_=-1),this.Z_=t.Tu,65535===this.Z_&&(this.Z_=-1),this.q_=t.Tu,65535===this.q_&&(this.q_=-1),this.name=c.A.Ma(c.A.ka(t.uE)),this.ec=t.Ru,this.visible=!0,this.nE=0n;for(let t=0;t<12;t++)this.nE<<=0x4n,this.iE[t]>=256&&(this.nE+=BigInt(this.iE[t])-256n);this.iE[0]>=256&&(this.nE+=BigInt(this.iE[0])-256n>>4n),this.iE[1]>=256&&(this.nE+=BigInt(this.iE[1])-256n>>8n);for(let t=0;t<5;t++)this.nE<<=0x3n,this.nE+=BigInt(this.sE[t]);this.nE<<=0x1n,this.nE+=BigInt(this.tE)}ud(){if(!this.visible)return null;const t=new f.fi(12,null);let e=0;for(let i=0;i<12;i++){const s=this.iE[i];if(s>=256&&s<512&&(t[e++]=l.A.Do[s-256].ud()),s>=512){const i=a.A.get(s-512).ud(this.tE);i&&(t[e++]=i)}}const i=n.A.Fa(t,e);for(let t=0;t<5;t++)0!==this.sE[t]&&(i.Ba(d.Pa[t][0],d.Pa[t][this.sE[t]]),1===t&&i.Ba(d.Ua[0],d.Ua[this.sE[t]]));return i}uw(){let t=this.nE,e=-1,i=-1,s=-1,r=-1;if(this.dI>=0&&0===this.AI){const n=o.A.Do[this.dI];if(n.frames&&(e=n.frames[this.wI]),this.cI>=0&&this.cI!==this.Ga){const t=o.A.Do[this.cI].frames;t&&(i=t[this.fI])}n.iy>=0&&(s=n.iy,t+=BigInt(s-this.iE[5])<<8n),n.sy>=0&&(r=n.sy,t+=BigInt(r-this.iE[3])<<16n)}else if(this.cI>=0){const t=o.A.Do[this.cI].frames;t&&(e=t[this.fI])}let h=d.No?.get(t);if(!h){const e=new f.fi(12,null);let i=0;for(let t=0;t<12;t++){let n=this.iE[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=l.A.Do[n-256].pa();t&&(e[i++]=t)}if(n>=512){const t=a.A.get(n-512).Qw(this.tE);t&&(e[i++]=t)}}h=n.A.Fa(e,i);for(let t=0;t<5;t++)0!==this.sE[t]&&(h.Ba(d.Pa[t][0],d.Pa[t][this.sE[t]]),1===t&&h.Ba(d.Ua[0],d.Ua[this.sE[t]]));h.Wa(),h.Ha(64,850,-30,-50,-30,!0),d.No?.put(t,h)}if(this.it)return h;const c=n.A.dw(h,!0);return-1!==e&&-1!==i?c.ww(e,i,o.A.Do[this.dI].ty):-1!==e&&c.Ya(e),c.yw(),c.$d=null,c.Qd=null,c}}},9222:(t,e,i)=>{i.d(e,{A:()=>s});class s{y;x;z;model;og;info;constructor(t,e,i,s,n,r){this.y=t,this.x=e,this.z=i,this.model=s,this.og=n,this.info=r}}},1161:(t,e,i)=>{i.d(e,{A:()=>s});class s{level;y;x;z;model;s_;n_;lg;Ig;ag;Cg;og;info;w_=0;Um=0;constructor(t,e,i,s,n,r,h,o,l,a,c,f,u){this.level=t,this.y=e,this.x=i,this.z=s,this.model=n,this.s_=r,this.n_=h,this.lg=o,this.Ig=l,this.ag=a,this.Cg=c,this.og=f,this.info=u}}},5748:(t,e,i)=>{i.d(e,{A:()=>s});class s{y;x;z;d_;u_;f_;og;offset;constructor(t,e,i,s,n,r,h,o){this.y=t,this.x=e,this.z=i,this.d_=s,this.u_=n,this.f_=r,this.og=h,this.offset=o}}},8256:(t,e,i)=>{i.d(e,{A:()=>s});class s{Vg;qA;Kg;JA;type;Tg;Og;Rg;Lg;bg;iw;mode=0;qg=0;Jg=0;Xg=0;jg=0;zg=0;Zg=0;constructor(t,e,i,s,n,r,h,o,l,a,c){this.Vg=t,this.qA=e,this.Kg=i,this.JA=s,this.type=n,this.Tg=r,this.Og=h,this.Rg=o,this.Lg=l,this.bg=a,this.iw=c}}},3795:(t,e,i)=>{i.d(e,{A:()=>r});var s=i(1982),n=i(3867);class r extends s.A{level;x;z;Qg;Xp;Yg;Up=null;Wp=null;Zp=null;qp=null;Yp=null;jp=null;Bp=null;Kp=0;Hg=0;Pp=0;visible=!1;update=!1;Ug=!1;Gg=0;o_=0;l_=0;r_=0;constructor(t,e,i){super(),this.Qg=this.level=t,this.x=e,this.z=i,this.Xp=new n.fi(5,null),this.Yg=new Int32Array(5)}}},2771:(t,e,i)=>{i.d(e,{A:()=>s});class s{static x_=new Int32Array(6);static M_=new Int32Array(6);static R_=new Int32Array(6);static L_=new Int32Array(6);static S_=new Int32Array(6);static dE=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static wE=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static yE=128;static AE=this.yE/2|0;static mE=this.yE/4|0;static pE=3*this.yE/4|0;Xd;zd;jd;F_;B_;P_;k_;D_;N_;O_;flat;shape;angle;Fg;Bg;constructor(t,e,i,n,r,h,o,l,a,c,f,u,d,w,y,A,m,p,g){this.flat=!(m!==n||m!==w||m!==l),this.shape=e,this.angle=h,this.Fg=d,this.Bg=a;const _=s.dE[e],I=_.length;this.Xd=new Int32Array(I),this.zd=new Int32Array(I),this.jd=new Int32Array(I);const C=new Int32Array(I),E=new Int32Array(I),v=t*s.yE,b=p*s.yE;for(let t=0;t8&&I<=12&&(I=9+(I-h-9&3)),I>12&&I<=16&&(I=13+(I-h-13&3)),1===I?(e=v,a=b,f=m,d=o,p=c):2===I?(e=v+s.AE,a=b,f=m+n>>1,d=o+g>>1,p=c+i>>1):3===I?(e=v+s.yE,a=b,f=n,d=g,p=i):4===I?(e=v+s.yE,a=b+s.AE,f=n+w>>1,d=g+r>>1,p=i+y>>1):5===I?(e=v+s.yE,a=b+s.yE,f=w,d=r,p=y):6===I?(e=v+s.AE,a=b+s.yE,f=w+l>>1,d=r+A>>1,p=y+u>>1):7===I?(e=v,a=b+s.yE,f=l,d=A,p=u):8===I?(e=v,a=b+s.AE,f=l+m>>1,d=A+o>>1,p=u+c>>1):9===I?(e=v+s.AE,a=b+s.mE,f=m+n>>1,d=o+g>>1,p=c+i>>1):10===I?(e=v+s.pE,a=b+s.AE,f=n+w>>1,d=g+r>>1,p=i+y>>1):11===I?(e=v+s.AE,a=b+s.pE,f=w+l>>1,d=r+A>>1,p=y+u>>1):12===I?(e=v+s.mE,a=b+s.AE,f=l+m>>1,d=A+o>>1,p=u+c>>1):13===I?(e=v+s.mE,a=b+s.mE,f=m,d=o,p=c):14===I?(e=v+s.pE,a=b+s.mE,f=n,d=g,p=i):15===I?(e=v+s.pE,a=b+s.pE,f=w,d=r,p=y):(e=v+s.mE,a=b+s.pE,f=l,d=A,p=u),this.Xd[t]=e,this.zd[t]=f,this.jd[t]=a,C[t]=d,E[t]=p}const T=s.wE[e],O=T.length/4|0;this.k_=new Int32Array(O),this.D_=new Int32Array(O),this.N_=new Int32Array(O),this.F_=new Int32Array(O),this.B_=new Int32Array(O),this.P_=new Int32Array(O),this.O_=-1!==f?new Int32Array(O):null;let R=0;for(let t=0;t{i.d(e,{A:()=>s});class s{static Am=0;static Gp=1;static gE=2;static _E=3;static IE=4;static CE=5;static AE=6;static mE=7;static pE=8;static EE=9;static vE=10;static bE=11}},3479:(t,e,i)=>{i.d(e,{A:()=>s});class s{T_;E_;__;C_;g_;color;flat;constructor(t,e,i,s,n,r,h){this.T_=t,this.E_=e,this.__=i,this.C_=s,this.g_=n,this.color=r,this.flat=h}}},6855:(t,e,i)=>{i.d(e,{A:()=>s});class s{y;x;z;h_;c_;eg;sg;og;info;constructor(t,e,i,s,n,r,h,o,l){this.y=t,this.x=e,this.z=i,this.h_=s,this.c_=n,this.eg=r,this.sg=h,this.og=o,this.info=l}}},7441:(t,e,i)=>{i.d(e,{A:()=>s});class s{y;x;z;type;angle;model;og;info;constructor(t,e,i,s,n,r,h,o){this.y=t,this.x=e,this.z=i,this.type=s,this.angle=n,this.model=r,this.og=h,this.info=o}}},7536:(t,e,i)=>{i.d(e,{A:()=>n});var s=i(1982);class n{TE;OE;constructor(t){this.OE=[],this.TE=t;for(let e=0;e{i.d(e,{A:()=>n});var s=i(1982);class n extends s.A{LE;SE;constructor(){super(),this.LE=this,this.SE=this}xE(){this.SE&&this.LE&&(this.SE.LE=this.LE,this.LE.SE=this.SE,this.LE=null,this.SE=null)}}},3819:(t,e,i)=>{i.d(e,{A:()=>s});class s{static ME=['_','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','0','1','2','3','4','5','6','7','8','9'];static kE=t=>{t=t.trim();let e=0n;for(let i=0;i=65&&s<=90?e+=BigInt(s+1-65):s>=97&&s<=122?e+=BigInt(s+1-97):s>=48&&s<=57&&(e+=BigInt(s+27-48))}return e};static ka=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let e=0;const i=Array(12);for(;0n!==t;){const s=t;t/=37n,i[11-e++]=this.ME[Number(s-37n*t)]}return i.slice(12-e).join('')};static DE=t=>{const e=[...t.toLowerCase()];let i=!0;for(let t=0;t='a'&&s<='z'&&(e[t]=s.toUpperCase(),i=!1),'.'!==s&&'!'!==s||(i=!0)}return e.join('')};static NE=t=>{let e='';for(let i=0;i(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static Ma=t=>{if(0===t.length)return t;const e=[...t];for(let t=0;t='a'&&e[t+1]<='z'&&(e[t+1]=String.fromCharCode(e[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return e[0]>='a'&&e[0]<='z'&&(e[0]=String.fromCharCode(e[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),e.join('')};static Gu=t=>{const e=t.toUpperCase();let i=0n;for(let t=0;t>56n)&0xffffffffffffffn;return i}}},6666:(t,e,i)=>{i.d(e,{A:()=>n});var s=i(1982);class n{FE;cursor=null;constructor(){const t=new s.A;t.next=t,t.RE=t,this.FE=t}jA(t){t.RE&&t.Cw(),t.RE=this.FE.RE,t.next=this.FE,t.RE&&(t.RE.next=t),t.next.RE=t}BE(t){t.RE&&t.Cw(),t.RE=this.FE,t.next=this.FE.next,t.RE.next=t,t.next&&(t.next.RE=t)}$g(){const t=this.FE.next;return t===this.FE?null:(t?.Cw(),t)}head(){const t=this.FE.next;return t===this.FE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}PE(){const t=this.FE.RE;return t===this.FE?(this.cursor=null,null):(this.cursor=t?.RE||null,t)}next(){const t=this.cursor;return t===this.FE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}RE(){const t=this.cursor;return t===this.FE?(this.cursor=null,null):(this.cursor=t?.RE||null,t)}clear(){for(;;){const t=this.FE.next;if(t===this.FE)return;t?.Cw()}}}},1982:(t,e,i)=>{i.d(e,{A:()=>s});class s{key;next;RE;constructor(){this.key=0n,this.next=this,this.RE=this}Cw(){this.RE&&this.next&&(this.RE.next=this.next,this.next.RE=this.RE,this.next=null,this.RE=null)}}},2679:(t,e,i)=>{i.d(e,{A:()=>r});var s=i(2512),n=i(7536);class r{UE;GE;history;available;constructor(t){this.UE=t,this.available=t,this.GE=new n.A(1024),this.history=new s.A}get(t){const e=this.GE.get(t);return e&&this.history.push(e),e}put(t,e){if(0===this.available){const t=this.history.pop();t?.Cw(),t?.xE()}else this.available--;this.GE.put(t,e),this.history.push(e)}clear(){const t=this.history.pop();t?(t.Cw(),t.xE()):this.available=this.UE}}},2512:(t,e,i)=>{i.d(e,{A:()=>n});var s=i(4474);class n{head;constructor(){this.head=new s.A}push(t){t.SE&&t.xE(),t.SE=this.head.SE,t.LE=this.head,t.SE&&(t.SE.LE=t),t.LE.SE=t}pop(){const t=this.head.LE;return t===this.head?null:(t?.xE(),t)}}},8534:(t,e,i)=>{i.d(e,{A:()=>r});var s=i(1069),n=i(3867);class r{static Do=[];static ac=t=>{const e=new s.A(t.read('base_head.dat')),i=new s.A(t.read('base_type.dat')),h=new s.A(t.read('base_label.dat')),o=e.Tu;e.Lf+=2;for(let t=0;t{i.d(e,{A:()=>r});var s=i(8534),n=i(1069);class r{static Do=[];static ac=t=>{const e=new n.A(t.read('frame_head.dat')),i=new n.A(t.read('frame_tran1.dat')),h=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),l=e.Tu;e.Lf+=2;const a=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let e=t-1;e>y;e--)if(0===d.types[e]){a[A]=e,c[A]=0,f[A]=0,u[A]=0,A++;break}a[A]=t;let i=0;3===d.types[a[A]]&&(i=128),c[A]=1&e?h.YE:i,f[A]=2&e?h.YE:i,u[A]=4&e?h.YE:i,y=t,A++}}n.length=A,n.HE=new Int32Array(A),n.x=new Int32Array(A),n.y=new Int32Array(A),n.z=new Int32Array(A);for(let t=0;t{i.d(e,{jc:()=>s,nl:()=>n,VE:()=>o,KE:()=>h,XE:()=>r});const s=document.getElementById('canvas'),n=s.getContext('2d',{willReadFrequently:!0}),r=document.createElement('canvas'),h=document.createElement('img'),o=r.getContext('2d',{willReadFrequently:!0})},9298:(t,e,i)=>{i.d(e,{A:()=>s});class s{static RED=16711680;static GREEN=65280;static BLUE=255;static ql=16776960;static jE=65535;static _m=16711935;static Sl=16777215;static Zl=0;static zE=16748608;static ZE=8388608;static qE=128;static JE=16756736;static $E=16740352;static QE=16723968;static tv=12648192;static ev=8453888;static iv=4259584;static sv=9179409;static nv=6116423;static fl=2301979;static ul=5063219;static wl=7759444;static Al=3353893;static rv=8388736;static hv=13350793;static ov=Int32Array.of(s.ql,s.RED,s.GREEN,s.jE,s._m,s.Sl);static uC=6798;static dC=107;static wC=10283;static yC=16;static AC=4797;static mC=7744;static pC=5799;static gC=4634;static _C=33697;static IC=22433;static CC=2983;static EC=54193;static vC=8741;static bC=12;static TC=64030;static OC=43162;static RC=7735;static LC=8404;static SC=1701;static xC=38430;static MC=24094;static kC=10153;static DC=56621;static NC=4783;static FC=1341;static BC=16578;static PC=35003;static UC=25239;static qI=9104;static JI=10275;static $I=7595;static QI=3610;static tC=7975;static eC=8526;static iC=918;static sC=38802;static nC=24466;static rC=10145;static hC=58654;static oC=5027;static lC=1457;static aC=16565;static cC=34991;static fC=25486;static GC=4626;static WC=11146;static YC=6439;static HC=12;static VC=4758;static KC=10270;static QC=4574;static XC=4550;static jC=4537;static zC=5681;static ZC=5673;static qC=5790;static JC=6806;static $C=8076}},8950:(t,e,i)=>{i.d(e,{A:()=>n});var s=i(4474);class n extends s.A{static bw=new Int32Array;static Tw=0;static Ow=0;static top=0;static bottom=0;static left=0;static right=0;static m_=0;static lv=0;static av=0;static bind=(t,e,i)=>{this.bw=t,this.Tw=e,this.Ow=i,this.Tl(0,0,e,i)};static cv=()=>{this.left=0,this.top=0,this.right=this.Tw,this.bottom=this.Ow,this.m_=this.right-1,this.lv=this.right/2|0};static Tl=(t,e,i,s)=>{t<0&&(t=0),e<0&&(e=0),i>this.Tw&&(i=this.Tw),s>this.Ow&&(s=this.Ow),this.top=e,this.bottom=s,this.left=t,this.right=i,this.m_=this.right-1,this.lv=this.right/2|0,this.av=this.bottom/2|0};static clear=()=>{const t=this.Tw*this.Ow;for(let e=0;e{this.yl(t,e,n,i),this.yl(t,e+s-1,n,i),this.dl(t,e,n,s),this.dl(t+i-1,e,n,s)};static yl=(t,e,i,s)=>{if(e=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+e*this.Tw;for(let t=0;t{if(t=this.right)return;ethis.bottom&&(s=this.bottom-e);const n=t+e*this.Tw;for(let t=0;t{const r=Math.abs(i-t),h=Math.abs(s-e),o=t=this.left&&t=this.top&&e-h&&(a-=h,t+=o),i{tthis.right&&(i=this.right-t),e+s>this.bottom&&(s=this.bottom-e);const r=this.Tw-i;let h=t+e*this.Tw;for(let t=-s;t<0;t++){for(let t=-i;t<0;t++)this.bw[h++]=n;h+=r}};static uv(t,e,i,s,n,r){tthis.right&&(i=this.right-t),e+s>this.bottom&&(s=this.bottom-e);const h=256-r,o=(n>>16&255)*r,l=(n>>8&255)*r,a=(255&n)*r,c=this.Tw-i;let f=t+e*this.Tw;for(let t=0;t>16&255)*h>>8<<16)+(l+(this.bw[f]>>8&255)*h>>8<<8)+(a+(255&this.bw[f])*h>>8);this.bw[f++]=t}f+=c}}static dv(t,e,i,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,l=(255&s)*n;let a=e-i;a<0&&(a=0);let c=e+i;c>=this.Ow&&(c=this.Ow-1);for(let s=a;s<=c;s++){const n=s-e,a=0|Math.sqrt(i*i-n*n);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.Tw&&(f=this.Tw-1);let u=c+s*this.Tw;for(let t=c;t<=f;t++){const t=(h+(this.bw[u]>>16&255)*r>>8<<16)+(o+(this.bw[u]>>8&255)*r>>8<<8)+(l+(255&this.bw[u])*r>>8);this.bw[u++]=t}}}static wv=(t,e,i)=>{t=this.right||e=this.bottom||(this.bw[t+e*this.Tw]=i)}}},4583:(t,e,i)=>{i.d(e,{A:()=>h});var s=i(8950),n=i(1673),r=i(3867);class h extends s.A{static it=!1;static yv=new Int32Array(512);static Av=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static mv=new r.fi(50,null);static pv=0;static Ew=new Int32Array;static ya=0;static Aa=0;static Rw=!0;static A_=!1;static alpha=0;static gv=null;static _v=new r.fi(50,null);static Iv=0;static Um=0;static Cv=new Int32Array(50);static Ev=new r.fi(50,null);static vv=!1;static bv=new r.fi(50,!1);static Tv=new Int32Array(50);static{for(let t=1;t<512;t++)this.yv[t]=32768/t|0;for(let t=1;t<2048;t++)this.Av[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static Lo=()=>{this.yv=null,this.yv=null,this.sin=null,this.cos=null,this.Ew=null,this.mv=null,this.bv=null,this.Tv=null,this.gv=null,this._v=null,this.Cv=null,this.palette=null,this.Ev=null,console.log('Draw3D unloaded!')};static wc=()=>{this.Ew=new Int32Array(s.A.Ow);for(let t=0;t{this.Ew=new Int32Array(e);for(let i=0;i{this.gv=null,this._v.fill(null)};static hc=t=>{this.pv=0;for(let e=0;e<50;e++)try{this.mv[e]=n.A.rc(t,e.toString()),this.it&&128===this.mv[e]?.Xl?this.mv[e]?.Lv():this.mv[e]?.Bw(),this.pv++}catch(t){}};static gm=t=>{if(0!==this.Tv[t])return this.Tv[t];const e=this.Ev[t];if(!e)return 0;let i=0,s=0,n=0;const r=e.length;for(let t=0;t>16&255,s+=e[t]>>8&255,n+=255&e[t];let h=(i/r<<16)+(s/r<<8)+(n/r|0);return h=this.Sv(h,1.4),0===h&&(h=1),this.Tv[t]=h,h};static oc=t=>{const e=t+.03*Math.random()-.015;let i=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,l=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const e=2*r-t;let i=s+.3333333333333333;i>1&&i--;let a=s-.3333333333333333;a<0&&a++,h=6*i<1?e+6*(t-e)*i:2*i<1?t:3*i<2?e+(t-e)*(.6666666666666666-i)*6:e,o=6*s<1?e+6*(t-e)*s:2*s<1?t:3*s<2?e+(t-e)*(.6666666666666666-s)*6:e,l=6*a<1?e+6*(t-e)*a:2*a<1?t:3*a<2?e+(t-e)*(.6666666666666666-a)*6:e}const a=((256*h|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[i++]=this.Sv(a,e)}}for(let t=0;t<50;t++){const i=this.mv[t];if(!i)continue;const s=i.palette;this.Ev[t]=new Int32Array(s.length);for(let i=0;i{const i=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(i,e)|0)<<16)+((256*Math.pow(s,e)|0)<<8)+(256*Math.pow(n,e)|0)};static lc=t=>{this.gv||(this.Iv=t,this.it?this.gv=new r.Xr(t,16384):this.gv=new r.Xr(t,65536),this._v.fill(null))};static I_=(t,e,i,n,r,o,l,a,c)=>{let f=0,u=0;r!==n&&(f=(e-t<<16)/(r-n)|0,u=(a-l<<15)/(r-n)|0);let d=0,w=0;o!==r&&(d=(i-e<<16)/(o-r)|0,w=(c-a<<15)/(o-r)|0);let y=0,A=0;if(o!==n&&(y=(t-i<<16)/(n-o)|0,A=(l-c<<15)/(n-o)|0),n<=r&&n<=o){if(ns.A.bottom&&(r=s.A.bottom),o>s.A.bottom&&(o=s.A.bottom),rd)for(o-=r,r-=n,n=h.Ew[n];;){if(--r<0)for(;;){if(--o<0)return;this.Mv(i>>16,e>>16,c>>7,a>>7,s.A.bw,n,0),i+=y,e+=d,c+=A,a+=w,n+=s.A.Tw}this.Mv(i>>16,t>>16,c>>7,l>>7,s.A.bw,n,0),i+=y,t+=f,c+=A,l+=u,n+=s.A.Tw}else for(o-=r,r-=n,n=h.Ew[n];;){if(--r<0)for(;;){if(--o<0)return;this.Mv(e>>16,i>>16,a>>7,c>>7,s.A.bw,n,0),i+=y,e+=d,c+=A,a+=w,n+=s.A.Tw}this.Mv(t>>16,i>>16,l>>7,c>>7,s.A.bw,n,0),i+=y,t+=f,c+=A,l+=u,n+=s.A.Tw}else if(e=t<<=16,a=l<<=15,n<0&&(e-=y*n,t-=f*n,a-=A*n,l-=u*n,n=0),i<<=16,c<<=15,o<0&&(i-=d*o,c-=w*o,o=0),n!==o&&yf)for(r-=o,o-=n,n=h.Ew[n];;){if(--o<0)for(;;){if(--r<0)return;this.Mv(i>>16,t>>16,c>>7,l>>7,s.A.bw,n,0),i+=d,t+=f,c+=w,l+=u,n+=s.A.Tw}this.Mv(e>>16,t>>16,a>>7,l>>7,s.A.bw,n,0),e+=y,t+=f,a+=A,l+=u,n+=s.A.Tw}else for(r-=o,o-=n,n=h.Ew[n];;){if(--o<0)for(;;){if(--r<0)return;this.Mv(t>>16,i>>16,l>>7,c>>7,s.A.bw,n,0),i+=d,t+=f,c+=w,l+=u,n+=s.A.Tw}this.Mv(t>>16,e>>16,l>>7,a>>7,s.A.bw,n,0),e+=y,t+=f,a+=A,l+=u,n+=s.A.Tw}}else if(r<=o){if(rs.A.bottom&&(o=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),oy)for(n-=o,o-=r,r=h.Ew[r];;){if(--o<0)for(;;){if(--n<0)return;this.Mv(t>>16,i>>16,l>>7,c>>7,s.A.bw,r,0),t+=f,i+=y,l+=u,c+=A,r+=s.A.Tw}this.Mv(t>>16,e>>16,l>>7,a>>7,s.A.bw,r,0),t+=f,e+=d,l+=u,a+=w,r+=s.A.Tw}else for(n-=o,o-=r,r=h.Ew[r];;){if(--o<0)for(;;){if(--n<0)return;this.Mv(i>>16,t>>16,c>>7,l>>7,s.A.bw,r,0),t+=f,i+=y,l+=u,c+=A,r+=s.A.Tw}this.Mv(e>>16,t>>16,a>>7,l>>7,s.A.bw,r,0),t+=f,e+=d,l+=u,a+=w,r+=s.A.Tw}else if(i=e<<=16,c=a<<=15,r<0&&(i-=f*r,e-=d*r,c-=u*r,a-=w*r,r=0),t<<=16,l<<=15,n<0&&(t-=y*n,l-=A*n,n=0),o-=n,n-=r,r=h.Ew[r],f>16,e>>16,l>>7,a>>7,s.A.bw,r,0),t+=y,e+=d,l+=A,a+=w,r+=s.A.Tw}this.Mv(i>>16,e>>16,c>>7,a>>7,s.A.bw,r,0),i+=f,e+=d,c+=u,a+=w,r+=s.A.Tw}else for(;;){if(--n<0)for(;;){if(--o<0)return;this.Mv(e>>16,t>>16,a>>7,l>>7,s.A.bw,r,0),t+=y,e+=d,l+=A,a+=w,r+=s.A.Tw}this.Mv(e>>16,i>>16,a>>7,c>>7,s.A.bw,r,0),i+=f,e+=d,c+=u,a+=w,r+=s.A.Tw}}else if(os.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,a>>7,l>>7,s.A.bw,o,0),e+=d,t+=f,a+=w,l+=u,o+=s.A.Tw}this.Mv(e>>16,i>>16,a>>7,c>>7,s.A.bw,o,0),e+=d,i+=y,a+=w,c+=A,o+=s.A.Tw}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Mv(t>>16,e>>16,l>>7,a>>7,s.A.bw,o,0),e+=d,t+=f,a+=w,l+=u,o+=s.A.Tw}this.Mv(i>>16,e>>16,c>>7,a>>7,s.A.bw,o,0),e+=d,i+=y,a+=w,c+=A,o+=s.A.Tw}else if(t=i<<=16,l=c<<=15,o<0&&(t-=d*o,i-=y*o,l-=w*o,c-=A*o,o=0),e<<=16,a<<=15,r<0&&(e-=f*r,a-=u*r,r=0),n-=r,r-=o,o=h.Ew[o],d>16,i>>16,a>>7,c>>7,s.A.bw,o,0),e+=f,i+=y,a+=u,c+=A,o+=s.A.Tw}this.Mv(t>>16,i>>16,l>>7,c>>7,s.A.bw,o,0),t+=d,i+=y,l+=w,c+=A,o+=s.A.Tw}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Mv(i>>16,e>>16,c>>7,a>>7,s.A.bw,o,0),e+=f,i+=y,a+=u,c+=A,o+=s.A.Tw}this.Mv(i>>16,t>>16,c>>7,l>>7,s.A.bw,o,0),t+=d,i+=y,l+=w,c+=A,o+=s.A.Tw}};static Mv=(t,e,i,n,r,o,l)=>{let a;if(h.Rw){let c;if(h.A_){if(c=e-t>3?(n-i)/(e-t)|0:0,e>s.A.m_&&(e=s.A.m_),t<0&&(i-=t*c,t=0),t>=e)return;o+=t,l=e-t>>2,c<<=2}else{if(!(t>2)>0?(n-i)*h.yv[l]>>15:0}if(0===h.alpha)for(;;){if(--l<0){if((l=e-t&3)>0){a=h.palette[i>>8];do{r[o++]=a,l--}while(l>0);return}break}a=h.palette[i>>8],i+=c,r[o++]=a,r[o++]=a,r[o++]=a,r[o++]=a}else{const s=h.alpha,n=256-h.alpha;for(;;){if(--l<0){if((l=e-t&3)>0){a=h.palette[i>>8],a=((16711935&a)*n>>8&16711935)+((65280&a)*n>>8&65280);do{r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),l--}while(l>0)}break}a=h.palette[i>>8],i+=c,a=((16711935&a)*n>>8&16711935)+((65280&a)*n>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280)}}}else if(ts.A.m_&&(e=s.A.m_),t<0&&(i-=t*c,t=0),t>=e))return;if(o+=t,l=e-t,0===h.alpha)do{r[o++]=h.palette[i>>8],i+=c,l--}while(l>0);else{const t=h.alpha,e=256-h.alpha;do{a=h.palette[i>>8],i+=c,a=((16711935&a)*e>>8&16711935)+((65280&a)*e>>8&65280),r[o++]=a+((16711935&r[o])*t>>8&16711935)+((65280&r[o])*t>>8&65280),l--}while(l>0)}}};static kv=(t,e,i,n,r,h,o)=>{let l=0;r!==n&&(l=(e-t<<16)/(r-n)|0);let a=0;h!==r&&(a=(i-e<<16)/(h-r)|0);let c=0;if(h!==n&&(c=(t-i<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),ra)for(h-=r,r-=n,n=this.Ew[n];;){if(--r<0)for(;;){if(--h<0)return;this.Dv(i>>16,e>>16,s.A.bw,n,o),i+=c,e+=a,n+=s.A.Tw}this.Dv(i>>16,t>>16,s.A.bw,n,o),i+=c,t+=l,n+=s.A.Tw}else for(h-=r,r-=n,n=this.Ew[n];;){if(--r<0)for(;;){if(--h<0)return;this.Dv(e>>16,i>>16,s.A.bw,n,o),i+=c,e+=a,n+=s.A.Tw}this.Dv(t>>16,i>>16,s.A.bw,n,o),i+=c,t+=l,n+=s.A.Tw}else if(e=t<<=16,n<0&&(e-=c*n,t-=l*n,n=0),i<<=16,h<0&&(i-=a*h,h=0),n!==h&&cl)for(r-=h,h-=n,n=this.Ew[n];;){if(--h<0)for(;;){if(--r<0)return;this.Dv(i>>16,t>>16,s.A.bw,n,o),i+=a,t+=l,n+=s.A.Tw}this.Dv(e>>16,t>>16,s.A.bw,n,o),e+=c,t+=l,n+=s.A.Tw}else for(r-=h,h-=n,n=this.Ew[n];;){if(--h<0)for(;;){if(--r<0)return;this.Dv(t>>16,i>>16,s.A.bw,n,o),i+=a,t+=l,n+=s.A.Tw}this.Dv(t>>16,e>>16,s.A.bw,n,o),e+=c,t+=l,n+=s.A.Tw}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hc)for(n-=h,h-=r,r=this.Ew[r];;){if(--h<0)for(;;){if(--n<0)return;this.Dv(t>>16,i>>16,s.A.bw,r,o),t+=l,i+=c,r+=s.A.Tw}this.Dv(t>>16,e>>16,s.A.bw,r,o),t+=l,e+=a,r+=s.A.Tw}else for(n-=h,h-=r,r=this.Ew[r];;){if(--h<0)for(;;){if(--n<0)return;this.Dv(i>>16,t>>16,s.A.bw,r,o),t+=l,i+=c,r+=s.A.Tw}this.Dv(e>>16,t>>16,s.A.bw,r,o),t+=l,e+=a,r+=s.A.Tw}else if(i=e<<=16,r<0&&(i-=l*r,e-=a*r,r=0),t<<=16,n<0&&(t-=c*n,n=0),l>16,e>>16,s.A.bw,r,o),t+=c,e+=a,r+=s.A.Tw}this.Dv(i>>16,e>>16,s.A.bw,r,o),i+=l,e+=a,r+=s.A.Tw}else for(h-=n,n-=r,r=this.Ew[r];;){if(--n<0)for(;;){if(--h<0)return;this.Dv(e>>16,t>>16,s.A.bw,r,o),t+=c,e+=a,r+=s.A.Tw}this.Dv(e>>16,i>>16,s.A.bw,r,o),i+=l,e+=a,r+=s.A.Tw}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.bw,h,o),e+=a,t+=l,h+=s.A.Tw}this.Dv(e>>16,i>>16,s.A.bw,h,o),e+=a,i+=c,h+=s.A.Tw}else for(r-=n,n-=h,h=this.Ew[h];;){if(--n<0)for(;;){if(--r<0)return;this.Dv(t>>16,e>>16,s.A.bw,h,o),e+=a,t+=l,h+=s.A.Tw}this.Dv(i>>16,e>>16,s.A.bw,h,o),e+=a,i+=c,h+=s.A.Tw}else if(t=i<<=16,h<0&&(t-=a*h,i-=c*h,h=0),e<<=16,r<0&&(e-=l*r,r=0),a>16,i>>16,s.A.bw,h,o),e+=l,i+=c,h+=s.A.Tw}this.Dv(t>>16,i>>16,s.A.bw,h,o),t+=a,i+=c,h+=s.A.Tw}else for(n-=r,r-=h,h=this.Ew[h];;){if(--r<0)for(;;){if(--n<0)return;this.Dv(i>>16,e>>16,s.A.bw,h,o),e+=l,i+=c,h+=s.A.Tw}this.Dv(i>>16,t>>16,s.A.bw,h,o),t+=a,i+=c,h+=s.A.Tw}};static b_=(t,e,i,n,r,h,o,l,a,c,f,u,d,w,y,A,m,p,g)=>{const _=this.Nv(g);this.vv=!this.bv[g];const I=c-d,C=f-y,E=u-m,v=w-c,b=A-f,T=p-u;let O=v*f-b*c<<14;const R=b*u-T*f<<8,L=T*c-v*u<<5;let S=I*f-C*c<<14;const x=C*u-E*f<<8,M=E*c-I*u<<5;let k=C*v-I*b<<14;const D=E*b-C*T<<8,N=I*T-E*v<<5;let F=0,B=0;r!==n&&(F=(e-t<<16)/(r-n)|0,B=(l-o<<16)/(r-n)|0);let P=0,U=0;h!==r&&(P=(i-e<<16)/(h-r)|0,U=(a-l<<16)/(h-r)|0);let G=0,W=0;if(h!==n&&(G=(t-i<<16)/(n-h)|0,W=(o-a<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),rP)for(h-=r,r-=n,n=this.Ew[n];;){if(--r<0)for(;;){if(--h<0)return;this.Fv(i>>16,e>>16,s.A.bw,n,_,0,0,O,S,k,R,x,D,a>>8,l>>8),i+=G,e+=P,a+=W,l+=U,n+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(i>>16,t>>16,s.A.bw,n,_,0,0,O,S,k,R,x,D,a>>8,o>>8),i+=G,t+=F,a+=W,o+=B,n+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(h-=r,r-=n,n=this.Ew[n];;){if(--r<0)for(;;){if(--h<0)return;this.Fv(e>>16,i>>16,s.A.bw,n,_,0,0,O,S,k,R,x,D,l>>8,a>>8),i+=G,e+=P,a+=W,l+=U,n+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(t>>16,i>>16,s.A.bw,n,_,0,0,O,S,k,R,x,D,o>>8,a>>8),i+=G,t+=F,a+=W,o+=B,n+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}else{e=t<<=16,l=o<<=16,n<0&&(e-=G*n,t-=F*n,l-=W*n,o-=B*n,n=0),i<<=16,a<<=16,h<0&&(i-=P*h,a-=U*h,h=0);const c=n-this.Aa;if(O+=L*c,S+=M*c,k+=N*c,O|=0,S|=0,k|=0,(n===h||G>=F)&&(n!==h||P<=F))for(r-=h,h-=n,n=this.Ew[n];;){if(--h<0)for(;;){if(--r<0)return;this.Fv(t>>16,i>>16,s.A.bw,n,_,0,0,O,S,k,R,x,D,o>>8,a>>8),i+=P,t+=F,a+=U,o+=B,n+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(t>>16,e>>16,s.A.bw,n,_,0,0,O,S,k,R,x,D,o>>8,l>>8),e+=G,t+=F,l+=W,o+=B,n+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(r-=h,h-=n,n=this.Ew[n];;){if(--h<0)for(;;){if(--r<0)return;this.Fv(i>>16,t>>16,s.A.bw,n,_,0,0,O,S,k,R,x,D,a>>8,o>>8),i+=P,t+=F,a+=U,o+=B,n+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(e>>16,t>>16,s.A.bw,n,_,0,0,O,S,k,R,x,D,l>>8,o>>8),e+=G,t+=F,l+=W,o+=B,n+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hG)for(n-=h,h-=r,r=this.Ew[r];;){if(--h<0)for(;;){if(--n<0)return;this.Fv(t>>16,i>>16,s.A.bw,r,_,0,0,O,S,k,R,x,D,o>>8,a>>8),t+=F,i+=G,o+=B,a+=W,r+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(t>>16,e>>16,s.A.bw,r,_,0,0,O,S,k,R,x,D,o>>8,l>>8),t+=F,e+=P,o+=B,l+=U,r+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(n-=h,h-=r,r=this.Ew[r];;){if(--h<0)for(;;){if(--n<0)return;this.Fv(i>>16,t>>16,s.A.bw,r,_,0,0,O,S,k,R,x,D,a>>8,o>>8),t+=F,i+=G,o+=B,a+=W,r+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(e>>16,t>>16,s.A.bw,r,_,0,0,O,S,k,R,x,D,l>>8,o>>8),t+=F,e+=P,o+=B,l+=U,r+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}else{i=e<<=16,a=l<<=16,r<0&&(i-=F*r,e-=P*r,a-=B*r,l-=U*r,r=0),t<<=16,o<<=16,n<0&&(t-=G*n,o-=W*n,n=0);const c=r-this.Aa;if(O+=L*c,S+=M*c,k+=N*c,O|=0,S|=0,k|=0,h-=n,n-=r,r=this.Ew[r],F>16,e>>16,s.A.bw,r,_,0,0,O,S,k,R,x,D,o>>8,l>>8),t+=G,e+=P,o+=W,l+=U,r+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(i>>16,e>>16,s.A.bw,r,_,0,0,O,S,k,R,x,D,a>>8,l>>8),i+=F,e+=P,a+=B,l+=U,r+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--h<0)return;this.Fv(e>>16,t>>16,s.A.bw,r,_,0,0,O,S,k,R,x,D,l>>8,o>>8),t+=G,e+=P,o+=W,l+=U,r+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(e>>16,i>>16,s.A.bw,r,_,0,0,O,S,k,R,x,D,l>>8,a>>8),i+=F,e+=P,a+=B,l+=U,r+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.bw,h,_,0,0,O,S,k,R,x,D,l>>8,o>>8),e+=P,t+=F,l+=U,o+=B,h+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(e>>16,i>>16,s.A.bw,h,_,0,0,O,S,k,R,x,D,l>>8,a>>8),e+=P,i+=G,l+=U,a+=W,h+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Fv(t>>16,e>>16,s.A.bw,h,_,0,0,O,S,k,R,x,D,o>>8,l>>8),e+=P,t+=F,l+=U,o+=B,h+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(i>>16,e>>16,s.A.bw,h,_,0,0,O,S,k,R,x,D,a>>8,l>>8),e+=P,i+=G,l+=U,a+=W,h+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}else{t=i<<=16,o=a<<=16,h<0&&(t-=P*h,i-=G*h,o-=U*h,a-=W*h,h=0),e<<=16,l<<=16,r<0&&(e-=F*r,l-=B*r,r=0);const c=h-this.Aa;if(O+=L*c,S+=M*c,k+=N*c,O|=0,S|=0,k|=0,n-=r,r-=h,h=this.Ew[h],P>16,i>>16,s.A.bw,h,_,0,0,O,S,k,R,x,D,l>>8,a>>8),e+=F,i+=G,l+=B,a+=W,h+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(t>>16,i>>16,s.A.bw,h,_,0,0,O,S,k,R,x,D,o>>8,a>>8),t+=P,i+=G,o+=U,a+=W,h+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Fv(i>>16,e>>16,s.A.bw,h,_,0,0,O,S,k,R,x,D,a>>8,l>>8),e+=F,i+=G,l+=B,a+=W,h+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(i>>16,t>>16,s.A.bw,h,_,0,0,O,S,k,R,x,D,a>>8,o>>8),t+=P,i+=G,o+=U,a+=W,h+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}};static Fv=(t,e,i,n,r,h,o,l,a,c,f,u,d,w,y)=>{if(t>=e)return;let A,m,p,g,_,I,C,E,v;if(this.A_){if(A=(y-w)/(e-t)|0,e>s.A.m_&&(e=s.A.m_),t<0&&(w-=t*A,t=0),t>=e)return;m=e-t>>3,A<<=12}else e-t>7?(m=e-t>>3,A=(y-w)*this.yv[m]>>6):(m=0,A=0);if(w<<=9,n+=t,this.it&&r)if(p=0,g=0,I=t-this.ya,l+=(f>>3)*I,a+=(u>>3)*I,c+=(d>>3)*I,l|=0,a|=0,_=(c|=0)>>12,0!==_&&(o=a/_|0,(h=l/_|0)<0?h=0:h>4032&&(h=4032)),l+=f,a+=u,c+=d,l|=0,a|=0,_=(c|=0)>>12,0!==_&&(p=l/_|0,g=a/_|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=g-o>>3,h+=w>>3&786432,v=w>>23,this.vv){for(;m-- >0;)i[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,i[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,i[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,i[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,i[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,i[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,i[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,i[n++]=r[(4032&o)+(h>>6)]>>>v,h=p,o=g,l+=f,a+=u,_=(c+=d)>>12,0!==_&&(p=l/_|0,g=a/_|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=g-o>>3,h+=(w+=A)>>3&786432,v=w>>23;for(m=e-t&7;m-- >0;)i[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E}else{for(;m-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(i[n]=t),n+=1,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(i[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(i[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(i[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(i[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(i[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(i[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(i[n]=t),n+=1,h=p,o=g,l+=f,a+=u,c+=d,l|=0,a|=0,_=(c|=0)>>12,0!==_&&(p=l/_|0,g=a/_|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=g-o>>3,h+=(w+=A)>>3&786432,v=w>>23}for(m=e-t&7;m-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(i[n]=t),n++,h+=C,o+=E}}else if(p=0,g=0,I=t-this.ya,l+=(f>>3)*I,a+=(u>>3)*I,c+=(d>>3)*I,l|=0,a|=0,_=(c|=0)>>14,0!==_&&(o=a/_|0,(h=l/_|0)<0?h=0:h>16256&&(h=16256)),l+=f,a+=u,c+=d,l|=0,a|=0,_=(c|=0)>>14,0!==_&&(p=l/_|0,g=a/_|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=g-o>>3,h+=6291456&w,v=w>>23,this.vv&&r){for(;m-- >0;)i[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,i[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,i[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,i[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,i[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,i[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,i[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,i[n++]=r[(16256&o)+(h>>7)]>>>v,h=p,o=g,l+=f,a+=u,c+=d,l|=0,a|=0,_=(c|=0)>>14,0!==_&&(p=l/_|0,g=a/_|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=g-o>>3,h+=6291456&(w+=A),v=w>>23;for(m=e-t&7;m-- >0;)i[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E}else{for(;m-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(i[n]=t),n+=1,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(i[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(i[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(i[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(i[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(i[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(i[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(i[n]=t),n++,h=p,o=g,l+=f,a+=u,c+=d,l|=0,a|=0,_=(c|=0)>>14,0!==_&&(p=l/_|0,g=a/_|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=g-o>>3,h+=6291456&(w+=A),v=w>>23}for(m=e-t&7;m-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(i[n]=t),n++,h+=C,o+=E}}};static Dv=(t,e,i,n,r)=>{if(this.A_&&(e>s.A.m_&&(e=s.A.m_),t<0&&(t=0)),t>=e)return;n+=t;let h=e-t>>2;if(0===this.alpha)for(;;){if(h--,h<0)for(h=e-t&3;;){if(h--,h<0)return;i[n++]=r}i[n++]=r,i[n++]=r,i[n++]=r,i[n++]=r}const o=this.alpha,l=256-this.alpha;for(r=((16711935&r)*l>>8&16711935)+((65280&r)*l>>8&65280);;){if(h--,h<0)for(h=e-t&3;;){if(h--,h<0)return;i[n++]=r+((16711935&i[n])*o>>8&16711935)+((65280&i[n])*o>>8&65280)}i[n++]=r+((16711935&i[n])*o>>8&16711935)+((65280&i[n])*o>>8&65280),i[n++]=r+((16711935&i[n])*o>>8&16711935)+((65280&i[n])*o>>8&65280),i[n++]=r+((16711935&i[n])*o>>8&16711935)+((65280&i[n])*o>>8&65280),i[n++]=r+((16711935&i[n])*o>>8&16711935)+((65280&i[n])*o>>8&65280)}};static xv=t=>{this._v[t]&&this.gv&&(this.gv[this.Iv++]=this._v[t],this._v[t]=null)};static Nv=t=>{if(this.Cv[t]=this.Um++,this._v[t])return this._v[t];let e;if(this.Iv>0&&this.gv)e=this.gv[--this.Iv],this.gv[this.Iv]=null;else{let t=0,i=-1;for(let e=0;e>>3)&16316671,e[n+8192]=r-(r>>>2)&16316671,e[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===i.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)e[n+(t<<7)]=s[i.bw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)e[t]=s[i.bw[t]];this.bv[t]=!1;for(let i=0;i<16384;i++){e[i]&=16316671;const s=e[i];0===s&&(this.bv[t]=!0),e[i+16384]=s-(s>>>3)&16316671,e[i+32768]=s-(s>>>2)&16316671,e[i+49152]=s-(s>>>2)-(s>>>3)&16316671}}return e}}},880:(t,e,i)=>{i.d(e,{r:()=>n});var s=i(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(s.KE.src),s.KE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>s.KE.onload=()=>t())),s.VE.clearRect(0,0,s.XE.width,s.XE.height);const e=s.KE.naturalWidth,i=s.KE.naturalHeight;return s.XE.width=e,s.XE.height=i,s.VE.drawImage(s.KE,0,0),s.VE.getImageData(0,0,e,i)}},8665:(t,e,i)=>{i.d(e,{A:()=>f});var s=i(1069),n=i(8950),r=i(4583),h=i(6730),o=i(4474),l=i(3867);class a{Kd=0;xg=0;Bv=0;Pv=-1;Uv=-1;Gv=-1;Wv=-1;Yv=-1;Hv=-1;Vv=-1;Kv=-1;Xv=-1;jv=0;zv=-1;Zv=-1;qv=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static Jv=null;static $v=null;static Qv=null;static tb=null;static eb=null;static ib=null;static sb=null;static nb=null;static rb=null;static hb=null;static ob=null;static lb=null;static axis=null;static ab=new l.fi(4096,!1);static cb=new l.fi(4096,!1);static fb=new Int32Array(4096);static ub=new Int32Array(4096);static wb=new Int32Array(4096);static yb=new Int32Array(4096);static Ab=new Int32Array(4096);static mb=new Int32Array(4096);static pb=new Int32Array(1500);static gb=new l.Xr(1500,512);static _b=new Int32Array(12);static Ib=new l.Xr(12,2e3);static Cb=new Int32Array(2e3);static Eb=new Int32Array(2e3);static vb=new Int32Array(12);static bb=new Int32Array(10);static Tb=new Int32Array(10);static Ob=new Int32Array(10);static _r=0;static Rb=0;static Ir=0;static Lb=!1;static Hl=0;static Vl=0;static Sb=0;static xb=new Int32Array(1e3);static Mb=!1;static ac(t){try{f.head=new s.A(t.read('ob_head.dat')),f.Jv=new s.A(t.read('ob_face1.dat')),f.$v=new s.A(t.read('ob_face2.dat')),f.Qv=new s.A(t.read('ob_face3.dat')),f.tb=new s.A(t.read('ob_face4.dat')),f.eb=new s.A(t.read('ob_face5.dat')),f.ib=new s.A(t.read('ob_point1.dat')),f.sb=new s.A(t.read('ob_point2.dat')),f.nb=new s.A(t.read('ob_point3.dat')),f.rb=new s.A(t.read('ob_point4.dat')),f.hb=new s.A(t.read('ob_point5.dat')),f.ob=new s.A(t.read('ob_vertex1.dat')),f.lb=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.Lf=0,f.ib.Lf=0,f.sb.Lf=0,f.nb.Lf=0,f.rb.Lf=0,f.ob.Lf=0,f.lb.Lf=0;const e=f.head.Tu;f.metadata=new l.fi(e+100,null);let i=0,n=0,r=0,h=0,o=0,c=0,u=0;for(let t=0;t>7)<2?e=2:e>126&&(e=126),(65408&t)+e):(e<0?e=0:e>127&&(e=127),127-e)}static Vd=(t,e,i)=>{const s=t.Kd,n=t.xg,r=t.Bv;let h,o,a,u,d;if(e){h=new Int32Array(s);for(let e=0;e{const n=t.Kd,r=t.xg,h=t.Bv;let o,l,a,c,u;if(s)o=t.Xd,l=t.zd,a=t.jd;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let e=0;e{const i=t.Kd,s=t.xg,n=t.Bv,r=new Int32Array(i),h=new Int32Array(i),o=new Int32Array(i);for(let e=0;e{let i=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let i=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.Xd[e],a=t.zd[e],c=t.jd[e];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const e=f.metadata[t];if(!e)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.Jv&&f.$v&&f.Qv&&f.tb&&f.eb&&f.ib&&f.sb&&f.nb&&f.rb&&f.hb&&f.ob&&f.lb&&f.axis))throw new Error('cant loading model!!!!!');const i=e.Kd,s=e.xg,n=e.Bv,r=new Int32Array(i),h=new Int32Array(i),o=new Int32Array(i),l=new Int32Array(s),a=new Int32Array(s),c=new Int32Array(s),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;e.Yv>=0&&(y=new Int32Array(i));let A=null;e.Xv>=0&&(A=new Int32Array(s));let m=null,p=0;e.jv>=0?m=new Int32Array(s):p=-e.jv-1;let g=null;e.zv>=0&&(g=new Int32Array(s));let _=null;e.Zv>=0&&(_=new Int32Array(s));const I=new Int32Array(s);f.ib.Lf=e.Pv,f.sb.Lf=e.Uv,f.nb.Lf=e.Gv,f.rb.Lf=e.Wv,f.hb.Lf=e.Yv;let C,E,v,b=0,T=0,O=0;for(let t=0;t{if(!f.metadata||!f.metadata[e])throw new Error('No model metadata');const i=f.metadata[e];if(i.data=t,!i.data.length)throw new Error('No model data');const n=i.Kd,r=i.xg,h=i.Bv,o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n),c=new Int32Array(r),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(h),y=new Int32Array(h),A=new Int32Array(h);let m=null;i.Yv>=0&&(m=new Int32Array(n));let p=null;i.Xv>=0&&(p=new Int32Array(r));let g=null,_=0;i.jv>=0?g=new Int32Array(r):_=-i.jv-1;let I=null;i.zv>=0&&(I=new Int32Array(r));let C=null;i.Zv>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(i.data);v.Lf=i.Pv;const b=new s.A(i.data);b.Lf=i.Uv;const T=new s.A(i.data);T.Lf=i.Gv;const O=new s.A(i.data);O.Lf=i.Wv;const R=new s.A(i.data);R.Lf=i.Yv;let L,S,x,M=0,k=0,D=0;for(let t=0;tthis.iw&&(this.iw=-i),i>this.bg&&(this.bg=i);const n=e*e+s*s;n>this.Lm&&(this.Lm=n)}this.Lm=Math.sqrt(this.Lm)+.99|0,this.Vb=Math.sqrt(this.Lm*this.Lm+this.iw*this.iw)+.99|0,this.Hb=this.Vb+(Math.sqrt(this.Lm*this.Lm+this.bg*this.bg)+.99|0)}Zd(){this.iw=0,this.bg=0;for(let t=0;tthis.iw&&(this.iw=-e),e>this.bg&&(this.bg=e)}this.Vb=Math.sqrt(this.Lm*this.Lm+this.iw*this.iw)+.99|0,this.Hb=this.Vb+(Math.sqrt(this.Lm*this.Lm+this.bg*this.bg)+.99|0)}Wa(){if(this.Kb){const t=new Int32Array(256);let e=0;for(let i=0;ie&&(e=s)}this.Qd=new l.fi(e+1,null);for(let i=0;i<=e;i++)this.Qd[i]=new Int32Array(t[i]),t[i]=0;let i=0;for(;ie&&(e=s)}this.$d=new l.fi(e+1,null);for(let i=0;i<=e;i++)this.$d[i]=new Int32Array(t[i]),t[i]=0;let i=0;for(;il;)l=i[o++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(e!==l||0===r.types[e])&&this.qb(s.x[t],s.y[t],s.z[t],r.labels[e],r.types[e])}f._r=0,f.Rb=0,f.Ir=0,o=0,l=i[o++];for(let t=0;tl;)l=i[o++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(e===l||0===r.types[e])&&this.qb(n.x[t],n.y[t],n.z[t],r.labels[e],r.types[e])}}else this.Ya(t)}Ya(t){if(!this.Qd||-1===t||!h.A.Do[t])return;const e=h.A.Do[t],i=e.WE;f._r=0,f.Rb=0,f.Ir=0;for(let t=0;t>16;this.jd[t]=this.zd[t]*e+this.jd[t]*i>>16,this.zd[t]=s}}translate(t,e,i){for(let s=0;s>8;if(this.Nb&&this.Fb&&this.Bb||(this.Nb=new Int32Array(this.xg),this.Fb=new Int32Array(this.xg),this.Bb=new Int32Array(this.xg)),!this.mg){this.mg=new l.fi(this.Kd,null);for(let t=0;t8192||m>8192||p>8192||A<-8192||m<-8192||p<-8192;)A>>=1,m>>=1,p>>=1;let g=0|Math.sqrt(A*A+m*m+p*p);if(g<=0&&(g=1),A=256*A/g|0,m=256*m/g|0,p=256*p/g|0,this.Sg&&1&this.Sg[e]){const r=t+((i*A+s*m+n*p)/(h+(h/2|0))|0);this.Wu&&(this.Nb[e]=f.Db(this.Wu[e],r,this.Sg[e]))}else{let t=this.mg[r];t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.mg[o],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.mg[l],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++)}}if(r)this._g(t,h,i,s,n);else{this.vg=new l.fi(this.Kd,null);for(let t=0;t>16;for(let s=0;s>16,_=_*w-g*d>>16,g=p),0!==t&&(p=_*a-I*l>>16,I=_*l+I*a>>16,_=p),0!==e&&(p=I*c+g*u>>16,I=I*u-g*c>>16,g=p),g+=n,_+=h,I+=o,p=_*A-I*y>>16,I=_*y+I*A>>16,_=p,f.fb&&f.ub&&f.wb&&(f.wb[s]=I-m,f.fb[s]=r.A.ya+((g<<9)/I|0),f.ub[s]=r.A.Aa+((_<<9)/I|0)),this.Bv>0&&f.yb&&f.Ab&&f.mb&&(f.yb[s]=g,f.Ab[s]=_,f.mb[s]=I)}try{this.Qb(!1,!1,0)}catch(t){}}draw(t,e,i,s,h,o,l,a,c){const u=a*h-o*s>>16,d=l*e+u*i>>16,w=this.Lm*i>>16,y=d+w;if(y<=50||d>=3500)return;const A=a*s+o*h>>16;let m=A-this.Lm<<9;if((m/y|0)>=n.A.lv)return;let p=A+this.Lm<<9;if((p/y|0)<=-n.A.lv)return;const g=l*i-u*e>>16,_=this.Lm*e>>16;let I=g+_<<9;if((I/y|0)<=-n.A.av)return;let C=g-(_+(this.iw*i>>16))<<9;if((C/y|0)>=n.A.av)return;let E=d-(w+(this.iw*e>>16))<=50,v=!1;if(c>0&&f.Lb){let t=d-w;t<=50&&(t=50),A>0?(m=m/y|0,p=p/t|0):(p=p/y|0,m=m/t|0),g>0?(C=C/y|0,I=I/t|0):(I=I/y|0,C=C/t|0);const e=f.Hl-r.A.ya,i=f.Vl-r.A.Aa;e>m&&eC&&i>16,w=w*R-c*O>>16,c=r),c+=o,u+=l,w+=a,r=w*s+c*h>>16,w=w*h-c*s>>16,c=r,r=u*i-w*e>>16,w=u*e+w*i>>16,u=r,f.wb&&(f.wb[n]=w-d),w>=50&&f.fb&&f.ub?(f.fb[n]=b+((c<<9)/w|0),f.ub[n]=T+((u<<9)/w|0)):f.fb&&(f.fb[n]=-5e3,E=!0),(E||this.Bv>0)&&f.yb&&f.Ab&&f.mb&&(f.yb[n]=c,f.Ab[n]=u,f.mb[n]=w)}try{this.Qb(E,v,c)}catch(t){}}Qb(t,e,i,s=!1){f.Mb&&(this.zb=-1,this.Zb=-1);for(let t=0;tn.A.m_||a>n.A.m_||c>n.A.m_),f.gb&&f.pb){const t=((y+A+m)/3|0)+this.Vb;f.gb[t][f.pb[t]++]=s,f.Mb&&this.tT(f.Hl,f.Vl,u,d,w,l,a,c)&&this.Zb=0;t--){const e=f.pb[t];if(!(e<=0)&&f.gb){const i=f.gb[t];for(let t=0;t=0;t--){const e=f.pb[t];if(e>0&&f.gb){const i=f.gb[t];for(let s=0;s0||f._b[2]>0)&&(r=(f.vb[1]+f.vb[2])/(f._b[1]+f._b[2])|0);let h=0;f._b&&f.vb&&(f._b[3]>0||f._b[4]>0)&&(h=(f.vb[3]+f.vb[4])/(f._b[3]+f._b[4])|0);let o=0;if(f._b&&f.vb&&(f._b[6]>0||f._b[8]>0)&&(o=(f.vb[6]+f.vb[8])/(f._b[6]+f._b[8])|0),f._b&&f.Ib){let t,e=0,i=f._b[10],n=f.Ib[10],l=f.Cb;e===i&&(e=0,i=f._b[11],n=f.Ib[11],l=f.Eb),t=er;)try{this.eT(n[e++],s),e===i&&n!==f.Ib[11]&&(e=0,i=f._b[11],n=f.Ib[11],l=f.Eb),t=eh;)try{this.eT(n[e++],s),e===i&&n!==f.Ib[11]&&(e=0,i=f._b[11],n=f.Ib[11],l=f.Eb),t=eo;)try{this.eT(n[e++],s),e===i&&n!==f.Ib[11]&&(e=0,i=f._b[11],n=f.Ib[11],l=f.Eb),t=e>2,h=this.Gb[e],o=this.Wb[e],l=this.Yb[e];r.A.b_(f.fb[i],f.fb[s],f.fb[n],f.ub[i],f.ub[s],f.ub[n],this.Nb[t],this.Fb[t],this.Bb[t],f.yb[h],f.Ab[h],f.mb[h],f.yb[o],f.yb[l],f.Ab[o],f.Ab[l],f.mb[o],f.mb[l],this.Wu[t])}else if(3===h&&this.Sg&&this.Wu&&this.Nb&&f.fb&&f.ub&&f.yb&&f.Ab&&f.mb){const e=this.Sg[t]>>2,h=this.Gb[e],o=this.Wb[e],l=this.Yb[e];r.A.b_(f.fb[i],f.fb[s],f.fb[n],f.ub[i],f.ub[s],f.ub[n],this.Nb[t],this.Nb[t],this.Nb[t],f.yb[h],f.Ab[h],f.mb[h],f.yb[o],f.yb[l],f.Ab[o],f.Ab[l],f.mb[o],f.mb[l],this.Wu[t])}}iT(t,e=!1){let i=0;if(f.mb){const e=r.A.ya,s=r.A.Aa,n=this.Mg[t],h=this.kg[t],o=this.Dg[t],l=f.mb[n],a=f.mb[h],c=f.mb[o];if(l>=50&&f.fb&&f.ub&&this.Nb)f.bb[i]=f.fb[n],f.Tb[i]=f.ub[n],f.Ob[i++]=this.Nb[t];else if(f.yb&&f.Ab&&this.Nb){const u=f.yb[n],d=f.Ab[n],w=this.Nb[t];if(c>=50&&this.Bb){const n=(50-l)*r.A.Av[c-l];f.bb[i]=e+((u+((f.yb[o]-u)*n>>16)<<9)/50|0),f.Tb[i]=s+((d+((f.Ab[o]-d)*n>>16)<<9)/50|0),f.Ob[i++]=w+((this.Bb[t]-w)*n>>16)}if(a>=50&&this.Fb){const n=(50-l)*r.A.Av[a-l];f.bb[i]=e+((u+((f.yb[h]-u)*n>>16)<<9)/50|0),f.Tb[i]=s+((d+((f.Ab[h]-d)*n>>16)<<9)/50|0),f.Ob[i++]=w+((this.Fb[t]-w)*n>>16)}}if(a>=50&&f.fb&&f.ub&&this.Fb)f.bb[i]=f.fb[h],f.Tb[i]=f.ub[h],f.Ob[i++]=this.Fb[t];else if(f.yb&&f.Ab&&this.Fb){const u=f.yb[h],d=f.Ab[h],w=this.Fb[t];if(l>=50&&this.Nb){const h=(50-a)*r.A.Av[l-a];f.bb[i]=e+((u+((f.yb[n]-u)*h>>16)<<9)/50|0),f.Tb[i]=s+((d+((f.Ab[n]-d)*h>>16)<<9)/50|0),f.Ob[i++]=w+((this.Nb[t]-w)*h>>16)}if(c>=50&&this.Bb){const n=(50-a)*r.A.Av[c-a];f.bb[i]=e+((u+((f.yb[o]-u)*n>>16)<<9)/50|0),f.Tb[i]=s+((d+((f.Ab[o]-d)*n>>16)<<9)/50|0),f.Ob[i++]=w+((this.Bb[t]-w)*n>>16)}}if(c>=50&&f.fb&&f.ub&&this.Bb)f.bb[i]=f.fb[o],f.Tb[i]=f.ub[o],f.Ob[i++]=this.Bb[t];else if(f.yb&&f.Ab&&this.Bb){const u=f.yb[o],d=f.Ab[o],w=this.Bb[t];if(a>=50&&this.Fb){const n=(50-c)*r.A.Av[a-c];f.bb[i]=e+((u+((f.yb[h]-u)*n>>16)<<9)/50|0),f.Tb[i]=s+((d+((f.Ab[h]-d)*n>>16)<<9)/50|0),f.Ob[i++]=w+((this.Fb[t]-w)*n>>16)}if(l>=50&&this.Nb){const h=(50-c)*r.A.Av[l-c];f.bb[i]=e+((u+((f.yb[n]-u)*h>>16)<<9)/50|0),f.Tb[i]=s+((d+((f.Ab[n]-d)*h>>16)<<9)/50|0),f.Ob[i++]=w+((this.Nb[t]-w)*h>>16)}}}const s=f.bb[0],h=f.bb[1],o=f.bb[2],l=f.Tb[0],a=f.Tb[1],c=f.Tb[2];if(!((s-h)*(c-a)-(l-a)*(o-h)<=0))if(r.A.A_=!1,3===i){let i;if((s<0||h<0||o<0||s>n.A.m_||h>n.A.m_||o>n.A.m_)&&(r.A.A_=!0),i=this.Sg?3&this.Sg[t]:0,e)r.A.fv(s,h,l,a,f.Ob[0]),r.A.fv(h,o,a,c,f.Ob[1]),r.A.fv(o,s,c,l,f.Ob[2]);else if(0===i)r.A.I_(s,h,o,l,a,c,f.Ob[0],f.Ob[1],f.Ob[2]);else if(1===i&&this.Nb)r.A.kv(s,h,o,l,a,c,r.A.palette[this.Nb[t]]);else if(2===i&&this.Sg&&this.Wu&&f.yb&&f.Ab&&f.mb){const e=this.Sg[t]>>2,i=this.Gb[e],n=this.Wb[e],u=this.Yb[e];r.A.b_(s,h,o,l,a,c,f.Ob[0],f.Ob[1],f.Ob[2],f.yb[i],f.Ab[i],f.mb[i],f.yb[n],f.yb[u],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],this.Wu[t])}else if(3===i&&this.Sg&&this.Wu&&this.Nb&&f.yb&&f.Ab&&f.mb){const e=this.Sg[t]>>2,i=this.Gb[e],n=this.Wb[e],u=this.Yb[e];r.A.b_(s,h,o,l,a,c,this.Nb[t],this.Nb[t],this.Nb[t],f.yb[i],f.Ab[i],f.mb[i],f.yb[n],f.yb[u],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],this.Wu[t])}}else if(4===i){let i;if((s<0||h<0||o<0||s>n.A.m_||h>n.A.m_||o>n.A.m_||f.bb[3]<0||f.bb[3]>n.A.m_)&&(r.A.A_=!0),i=this.Sg?3&this.Sg[t]:0,e)r.A.fv(s,h,l,a,f.Ob[0]),r.A.fv(h,o,a,c,f.Ob[1]),r.A.fv(o,f.bb[3],c,f.Tb[3],f.Ob[2]),r.A.fv(f.bb[3],s,f.Tb[3],l,f.Ob[3]);else if(0===i)r.A.I_(s,h,o,l,a,c,f.Ob[0],f.Ob[1],f.Ob[2]),r.A.I_(s,o,f.bb[3],l,c,f.Tb[3],f.Ob[0],f.Ob[2],f.Ob[3]);else if(1===i){if(this.Nb){const e=r.A.palette[this.Nb[t]];r.A.kv(s,h,o,l,a,c,e),r.A.kv(s,o,f.bb[3],l,c,f.Tb[3],e)}}else if(2===i&&this.Sg&&this.Wu&&f.yb&&f.Ab&&f.mb){const e=this.Sg[t]>>2,i=this.Gb[e],n=this.Wb[e],u=this.Yb[e];r.A.b_(s,h,o,l,a,c,f.Ob[0],f.Ob[1],f.Ob[2],f.yb[i],f.Ab[i],f.mb[i],f.yb[n],f.yb[u],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],this.Wu[t]),r.A.b_(s,o,f.bb[3],l,c,f.Tb[3],f.Ob[0],f.Ob[2],f.Ob[3],f.yb[i],f.Ab[i],f.mb[i],f.yb[n],f.yb[u],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],this.Wu[t])}else if(3===i&&this.Sg&&this.Wu&&this.Nb&&f.yb&&f.Ab&&f.mb){const e=this.Sg[t]>>2,i=this.Gb[e],n=this.Wb[e],u=this.Yb[e];r.A.b_(s,h,o,l,a,c,this.Nb[t],this.Nb[t],this.Nb[t],f.yb[i],f.Ab[i],f.mb[i],f.yb[n],f.yb[u],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],this.Wu[t]),r.A.b_(s,o,f.bb[3],l,c,f.Tb[3],this.Nb[t],this.Nb[t],this.Nb[t],f.yb[i],f.Ab[i],f.mb[i],f.yb[n],f.yb[u],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],this.Wu[t])}}}qb(t,e,i,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f._r=0,f.Rb=0,f.Ir=0;for(let t=0;t0?(f._r=(f._r/n|0)+t,f.Rb=(f.Rb/n|0)+e,f.Ir=(f.Ir/n|0)+i):(f._r=t,f.Rb=e,f.Ir=i)}else if(1===n)for(let n=0;n=this.Qd.length)continue;const h=this.Qd[r];if(h)for(let s=0;s=this.Qd.length)continue;const o=this.Qd[h];if(o)for(let s=0;s>16;this.zd[n]=this.zd[n]*u-this.Xd[n]*c>>16,this.Xd[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.zd[n]*u-this.jd[n]*c>>16;this.jd[n]=this.zd[n]*c+this.jd[n]*u>>16,this.zd[n]=t}if(0!==l){c=r.A.sin[l],u=r.A.cos[l];const t=this.jd[n]*c+this.Xd[n]*u>>16;this.jd[n]=this.jd[n]*u-this.Xd[n]*c>>16,this.Xd[n]=t}this.Xd[n]+=f._r,this.zd[n]+=f.Rb,this.jd[n]+=f.Ir}}else if(3===n)for(let n=0;n=this.Qd.length)continue;const h=this.Qd[r];if(h)for(let s=0;s=this.$d.length)continue;const n=this.$d[i];if(n)for(let e=0;e255&&(this.Ub[i]=255)}}}$b(){this.iw=0,this.Lm=0,this.bg=0,this.Tg=999999,this.Og=-999999,this.Lg=-99999,this.Rg=99999;for(let t=0;tthis.Og&&(this.Og=e),sthis.Lg&&(this.Lg=s),-i>this.iw&&(this.iw=-i),i>this.bg&&(this.bg=i);const n=e*e+s*s;n>this.Lm&&(this.Lm=n)}this.Lm=0|Math.sqrt(this.Lm),this.Vb=0|Math.sqrt(this.Lm*this.Lm+this.iw*this.iw),this.Hb=this.Vb+(0|Math.sqrt(this.Lm*this.Lm+this.bg*this.bg))}tT(t,e,i,s,n,r,h,o){return!(ei&&e>s&&e>n)&&(!(t{i.d(e,{A:()=>o});var s=i(8950),n=i(1069),r=i(4474),h=i(880);class o extends r.A{bw;width;height;nT;rT;Xl;Iw;constructor(t,e){super(),this.bw=new Int32Array(t*e),this.width=this.Xl=t,this.height=this.Iw=e,this.nT=this.rT=0}static hT=async(t,e)=>{const i=t.read(e+'.dat');if(!i)throw new Error(`${e} jpeg not found!`);const s=await(0,h.r)(i),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),l=n.bw;for(let t=0;t>24&255)<<24|(255&e)<<16|(e>>8&255)<<8|e>>16&255}return n};static rc=(t,e,i=0)=>{const s=new n.A(t.read(e+'.dat')),r=new n.A(t.read('index.dat'));r.Lf=s.Tu;const h=r.Tu,l=r.Tu,a=[],c=r.Ru-1;for(let t=0;ts.length||r.Lf>r.length)throw new Error;const f=r.Ru,u=r.Ru,d=r.Tu,w=r.Tu,y=new o(d,w);y.nT=f,y.rT=u,y.Xl=h,y.Iw=l;const A=r.Ru;if(0===A){const t=y.width*y.height;for(let e=0;es.A.bottom&&(r-=e+r-s.A.bottom),ts.A.right){const e=t+h-s.A.right;h-=e,l+=e,o+=e}h>0&&r>0&&this.oT(h,r,this.bw,n,l,s.A.bw,i,o)}Kl(t,e,i){e|=0,i|=0;let n=(e+=this.nT)+(i+=this.rT)*s.A.Tw,r=0,h=this.height,o=this.width,l=s.A.Tw-o,a=0;if(is.A.bottom&&(h-=i+h-s.A.bottom),es.A.right){const t=e+o-s.A.right;o-=t,a+=t,l+=t}o>0&&h>0&&this.lT(o,h,this.bw,r,a,s.A.bw,n,l,t)}aT(t,e){t|=0,e|=0;let i=(t+=this.nT)+(e+=this.rT)*s.A.Tw,n=0,r=this.height,h=this.width,o=s.A.Tw-h,l=0;if(es.A.bottom&&(r-=e+r-s.A.bottom),ts.A.right){const e=t+h-s.A.right;h-=e,l+=e,o+=e}h>0&&r>0&&this.cT(h,r,this.bw,n,l,s.A.bw,i,o)}fT(){const t=this.bw,e=this.width,i=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=e,h<1?h=1:h>255&&(h=255);let o=255&n;o+=i,o<1?o=1:o>255&&(o=255),this.bw[s]=(r<<16)+(h<<8)+o}}}Bw(t,e,i,n){t|=0,e|=0,i|=0,n|=0;try{const r=this.width;let h=0,o=0;const l=this.Xl,a=this.Iw,c=(l<<16)/i|0,f=(a<<16)/n|0;t+=(this.nT*i+l-1)/l|0,e+=(this.rT*n+a-1)/a|0,this.nT*i%l!=0&&(h=(l-this.nT*i%l<<16)/i|0),this.rT*n%a!=0&&(o=(a-this.rT*n%a<<16)/n|0),i=i*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u=t+e*s.A.Tw,d=s.A.Tw-i;if(es.A.bottom&&(n-=e+n-s.A.bottom),ts.A.right){const e=t+i-s.A.right;i-=e,d+=e}this.scale(i,n,this.bw,h,o,s.A.bw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}dT(t,e,i,n,r,h,o,l,a,c){t|=0,e|=0,i|=0,n|=0;try{const f=-i/2|0,u=-n/2|0,d=65536*Math.sin(a/326.11)|0,w=65536*Math.cos(a/326.11)|0,y=d*c>>8,A=w*c>>8;let m=(o<<16)+u*y+f*A,p=u*A-f*y+(l<<16),g=t+e*s.A.Tw;for(let t=0;t>16)+(o>>16)*this.width],n+=A,o-=y;m+=y,p+=A,g+=s.A.Tw}}catch(t){}}wT(t,e,i){t|=0,e|=0;let n=(t+=this.nT)+(e+=this.rT)*s.A.Tw,r=0,h=this.height,o=this.width,l=s.A.Tw-o,a=0;if(es.A.bottom&&(h-=e+h-s.A.bottom),ts.A.right){const e=t+o-s.A.right;o-=e,a+=e,l+=e}o>0&&h>0&&this.yT(o,h,this.bw,a,r,s.A.bw,n,l,i.bw)}scale(t,e,i,s,n,r,h,o,l,a,c){try{const f=s;for(let u=-e;u<0;u++){const e=(n>>16)*l;for(let n=-t;n<0;n++){const t=i[(s>>16)+e];0===t?o++:r[o++]=t,s+=a}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}cT(t,e,i,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-e;a<0;a++){for(let t=l;t<0;t++)r[h++]=i[s++],r[h++]=i[s++],r[h++]=i[s++],r[h++]=i[s++];for(let e=t;e<0;e++)r[h++]=i[s++];h+=o,s+=n}}lT(t,e,i,s,n,r,h,o,l){const a=256-l;for(let c=-e;c<0;c++){for(let e=-t;e<0;e++){const t=i[s++];if(0===t)h++;else{const e=r[h];r[h++]=((16711935&t)*l+(16711935&e)*a&4278255360)+((65280&t)*l+(65280&e)*a&16711680)>>8}}h+=o,s+=n}}oT(t,e,i,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-e;a<0;a++){for(let t=l;t<0;t++){let t=i[s++];0===t?h++:r[h++]=t,t=i[s++],0===t?h++:r[h++]=t,t=i[s++],0===t?h++:r[h++]=t,t=i[s++],0===t?h++:r[h++]=t}for(let e=t;e<0;e++){const t=i[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}yT(t,e,i,s,n,r,h,o,l){const a=-(t>>2);t=-(3&t);for(let c=-e;c<0;c++){for(let t=a;t<0;t++){let t=i[n++];0!==t&&0===l[h]?r[h++]=t:h++,t=i[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=i[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=i[n++],0!==t&&0===l[h]?r[h++]=t:h++}for(let e=t;e<0;e++){const t=i[n++];0!==t&&0===l[h]?r[h++]=t:h++}h+=o,n+=s}}}},1673:(t,e,i)=>{i.d(e,{A:()=>h});var s=i(8950),n=i(1069),r=i(4474);class h extends r.A{bw;width;height;nT;rT;Xl;Iw;palette;constructor(t,e,i){super(),this.bw=new Int8Array(t*e),this.width=this.Xl=t,this.height=this.Iw=e,this.nT=this.rT=0,this.palette=i}static rc=(t,e,i=0)=>{const s=new n.A(t.read(e+'.dat')),r=new n.A(t.read('index.dat'));r.Lf=s.Tu;const o=r.Tu,l=r.Tu,a=r.Ru,c=new Int32Array(a);for(let t=1;ts.length||r.Lf>r.length)throw new Error;const f=r.Ru,u=r.Ru,d=r.Tu,w=r.Tu,y=new h(d,w,c);y.nT=f,y.rT=u,y.Xl=o,y.Iw=l;const A=y.bw,m=r.Ru;if(0===m){const t=y.width*y.height;for(let e=0;es.A.bottom&&(r-=e+r-s.A.bottom),ts.A.right){const e=t+h-s.A.right;h-=e,l+=e,o+=e}h>0&&r>0&&this.AT(h,r,this.bw,n,l,s.A.bw,i,o)}fT(){const t=this.bw,e=this.width,i=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=e,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=i,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}Lv(){this.Xl|=0,this.Iw|=0,this.Xl/=2,this.Iw/=2,this.Xl|=0,this.Iw|=0;const t=new Int8Array(this.Xl*this.Iw);let e=0;for(let i=0;i>1)+(i+this.rT>>1)*this.Xl]=this.bw[e++];this.bw=t,this.width=this.Xl,this.height=this.Iw,this.nT=0,this.rT=0}Bw(){if(this.width===this.Xl&&this.height===this.Iw)return;const t=new Int8Array(this.Xl*this.Iw);let e=0;for(let i=0;i>2);t=-(3&t);for(let a=-e;a<0;a++){for(let t=l;t<0;t++){let t=i[s++];0===t?h++:r[h++]=this.palette[255&t],t=i[s++],0===t?h++:r[h++]=this.palette[255&t],t=i[s++],0===t?h++:r[h++]=this.palette[255&t],t=i[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let e=t;e<0;e++){const t=i[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,e,i,n){try{const r=this.width;this.height;let h=0,o=0;const l=this.Xl,a=this.Iw,c=(l<<16)/i|0,f=(a<<16)/n|0;t=t+(this.nT*i+l-1)/l|0,e=e+(this.rT*n+a-1)/a|0,this.nT*i%l!=0&&(h=(l-this.nT*i%l<<16)/i|0),this.rT*n%a!=0&&(o=(a-this.rT*n%a<<16)/n|0),i=i*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u,d=t+e*s.A.Tw,w=s.A.Tw-i;es.A.bottom&&(n-=e+n-s.A.bottom),ts.A.right&&(u=t+i-s.A.right,i-=u,w+=u),this.mT(s.A.bw,this.bw,this.palette,h,o,d,w,i,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}mT(t,e,i,s,n,r,h,o,l,a,c,f){try{const u=s;for(let d=-l;d<0;d++){const l=(n>>16)*f;for(let n=-o;n<0;n++){const n=e[(s>>16)+l];0==n?r++:t[r++]=i[255&n],s+=a}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}},2682:(t,e,i)=>{i.d(e,{A:()=>l});var s=i(8950),n=i(1069),r=i(4474);class h{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}pT(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}gT(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=i(9298);class l extends r.A{static _T='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static IT=[];static{const t=navigator.userAgent.includes('Capacitor');for(let e=0;e<256;e++){let i=l._T.indexOf(String.fromCharCode(e));t&&i>=63&&i--,-1===i&&(i=74),l.IT[e]=i}}CT=[];ET=new Int32Array(94);vT=new Int32Array(94);bT=new Int32Array(94);TT=new Int32Array(94);OT=new Int32Array(95);RT=new Int32Array(256);random=new h(BigInt(Date.now()));height=0;static rc=(t,e)=>{const i=new n.A(t.read(e+'.dat')),s=new n.A(t.read('index.dat'));s.Lf=i.Tu+4;const r=s.Ru;r>0&&(s.Lf+=3*(r-1));const h=new l;for(let t=0;t<94;t++){h.bT[t]=s.Ru,h.TT[t]=s.Ru;const e=h.ET[t]=s.Tu,n=h.vT[t]=s.Tu,r=s.Ru,o=e*n;if(h.CT[t]=new Int8Array(o),0===r)for(let s=0;sh.height&&(h.height=n),h.bT[t]=1,h.OT[t]=e+2;{let i=0;for(let s=n/7|0;s=s.A.bottom&&(r-=i+r+1-s.A.bottom),e=s.A.right){const t=e+n+1-s.A.right;n-=t,a+=t,l+=t}n>0&&r>0&&this.BT(n,r,t,c,a,s.A.bw,o,l,h)}DT(t,e,i,n,r,h,o){i|=0,n|=0;let l=(t|=0)+(e|=0)*s.A.Tw,a=s.A.Tw-i,c=0,f=0;if(e=s.A.bottom&&(n-=e+n+1-s.A.bottom),t=s.A.right){const e=t+i+1-s.A.right;i-=e,c+=e,a+=e}i>0&&n>0&&this.PT(i,n,s.A.bw,l,a,o,f,c,r,h)}BT(t,e,i,s,n,r,h,o,l){const a=-((t|=0)>>2);t=-(3&t);for(let c=-(e|=0);c<0;c++){for(let t=a;t<0;t++)0===i[s++]?h++:r[h++]=l,0===i[s++]?h++:r[h++]=l,0===i[s++]?h++:r[h++]=l,0===i[s++]?h++:r[h++]=l;for(let e=t;e<0;e++)0===i[s++]?h++:r[h++]=l;h+=o,s+=n}}PT(t,e,i,s,n,r,h,o,l,a){t|=0;const c=((16711935&l)*a&4278255360)+((65280&l)*a&16711680)>>8,f=256-a;for(let l=-(e|=0);l<0;l++){for(let e=-t;e<0;e++)if(0===r[h++])s++;else{const t=i[s];i[s++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}s+=n,h+=o}}ST(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.ql:'cya'===t?o.A.jE:'mag'===t?o.A._m:'whi'===t?o.A.Sl:'bla'===t?o.A.Zl:'lre'===t?o.A.zE:'dre'===t?o.A.ZE:'dbl'===t?o.A.qE:'or1'===t?o.A.JE:'or2'===t?o.A.$E:'or3'===t?o.A.QE:'gr1'===t?o.A.tv:'gr2'===t?o.A.ev:'gr3'===t?o.A.iv:o.A.Zl}split(t,e){if(0===t.length)return[t];const i=[];for(;t.length>0;){if(this.xT(t)<=e&&-1===t.indexOf('|')){i.push(t);break}let s=t.length;for(let i=0;ie)break;s=i}else if('|'===t[i]){s=i;break}i.push(t.substring(0,s)),t=t.substring(s+1)}return i}}},1183:(t,e,i)=>{i.d(e,{A:()=>r});var s=i(8950),n=i(7854);class r{UT;width;height;GT;WT;bw;constructor(t,e,i=n.nl){this.GT=i,this.UT=this.GT.getImageData(0,0,t,e),this.WT=new Uint32Array(this.UT.data.buffer),this.bw=new Int32Array(t*e),this.width=t,this.height=e,this.bind()}clear(){this.bw.fill(0)}bind(){s.A.bind(this.bw,this.width,this.height)}draw(t,e){this.#t(),this.GT.putImageData(this.UT,t,e)}#t(){const t=this.bw.length,e=this.bw,i=this.WT;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,e,i)=>{i.d(e,{A:()=>s});class s{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,e)=>{const i=indexedDB.open('lostcity',1);i.onsuccess=e=>{const i=e.target;console.log('database success!'),t(i.result)},i.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},i.onerror=t=>{const i=t.target;console.error('database error!: ',i.error),e(i.result)}}));zo=async t=>await new Promise((e=>{const i=this.db.transaction('cache','readonly').objectStore('cache').get(t);i.onsuccess=()=>{e(i.result)},i.onerror=t=>{e(void 0)}}));Qo=async(t,e)=>await new Promise(((i,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(e,t);n.onsuccess=()=>{i()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};YT=t=>{const e=t.trim();let i=0;for(let t=0;t='A'&&s<='Z'?i+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?i+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(i+=s.charCodeAt(0)+27-48)}return i}}},2901:(t,e,i)=>{i.d(e,{A:()=>r});var s=i(1069),n=i(1908);class r{static YT=t=>{let e=0;t=t.toUpperCase();for(let i=0;i=this.VT)return null;if(this.ZT[t])return this.ZT[t];const e=this.zT[t],i=e+this.jT[t];if(this.HT){const s=Uint8Array.from(this.buffer.subarray(e,e+i));return this.ZT[t]=s,s}{const e=Uint8Array.from(n.A.read(this.XT[t],this.buffer,this.jT[t],this.zT[t]));return this.ZT[t]=e,e}}}},1069:(t,e,i)=>{i.d(e,{A:()=>h});var s=i(9234),n=i(6666),r=i(4474);class h extends r.A{static JT=3988292384;static $T=new Int32Array(256);static QT=new Uint32Array(33);static tO=new n.A;static eO=new n.A;static iO=new n.A;static sO=0;static nO=0;static rO=0;static{for(let t=0;t<32;t++)h.QT[t]=(1<>>=1:e=e>>>1^h.JT;h.$T[t]=e}}static Zo=t=>{let e=4294967295;for(let i=0;i>>8^h.$T[255&(e^t[i])];return~e};view;data;Lf=0;hO=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.Lf}static Pt=t=>{let e=null;return 0===t&&h.sO>0?(h.sO--,e=h.tO.$g()):1===t&&h.nO>0?(h.nO--,e=h.eO.$g()):2===t&&h.rO>0&&(h.rO--,e=h.iO.$g()),e?(e.Lf=0,e):new h(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.Lf=0,100===this.view.byteLength&&h.sO<1e3?(h.tO.jA(this),h.sO++):5e3===this.view.byteLength&&h.nO<250?(h.eO.jA(this),h.nO++):3e4===this.view.byteLength&&h.rO<50&&(h.iO.jA(this),h.rO++)}get Ru(){return this.view.getUint8(this.Lf++)}get Hd(){return this.view.getInt8(this.Lf++)}get Tu(){const t=this.view.getUint16(this.Lf);return this.Lf+=2,t}get Su(){const t=this.view.getInt16(this.Lf);return this.Lf+=2,t}get hd(){const t=this.view.getUint8(this.Lf++)<<16|this.view.getUint16(this.Lf);return this.Lf+=2,t}get el(){const t=this.view.getInt32(this.Lf);return this.Lf+=4,t}get uE(){const t=this.view.getBigInt64(this.Lf);return this.Lf+=8,t}get YE(){return this.view.getUint8(this.Lf)<128?this.Ru-64:this.Tu-49152}get Rm(){return this.view.getUint8(this.Lf)<128?this.Ru:this.Tu-32768}get ku(){const t=this.view,e=t.byteLength;let i,s='';for(;10!==(i=t.getUint8(this.Lf++))&&this.Lf>16),this.view.setUint16(this.Lf,t),this.Lf+=2}p4(t){this.view.setInt32(this.Lf,t),this.Lf+=4}cO(t){this.view.setInt32(this.Lf,t,!0),this.Lf+=4}fO(t){this.view.setBigInt64(this.Lf,t),this.Lf+=8}uO(t){const e=this.view,i=t.length;for(let s=0;s>>3}mO(t){let e=this.hO>>>3,i=8-(7&this.hO),s=0;for(this.hO+=t;t>i;i=8)s+=(this.view.getUint8(e++)&h.QT[i])<>>i-t&h.QT[t],s}pO(t,e){const i=this.Lf;this.Lf=0;const n=new Uint8Array(i);this.oO(i,0,n);const r=(0,s.gO)(n),h=(0,s._O)(r,e,t),o=(0,s.IO)(h);this.Lf=0,this.p1(o.length),this.dO(o,o.length,0)}}},5226:(t,e,i)=>{i.d(e,{Q:()=>n,x:()=>s});class s{CO=new Map;Eo;xo=self.isSecureContext?self.crypto.randomUUID():'0';constructor(t){this.Eo=t}async Ko(){const t=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),e=t.createDataChannel('channel'),i=crypto.randomUUID();this.CO.set(i,e),await t.setLocalDescription(await t.createOffer()),t.onicegatheringstatechange=async()=>{if('complete'===t.iceGatheringState){let e;self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(t.localDescription)):console.log(JSON.stringify(t.localDescription));try{for(;null===(e=prompt('Offer copied to clipboard, paste answer here')););t.setRemoteDescription(new RTCSessionDescription(JSON.parse(e)))}catch(t){console.error(t)}}},e.onopen=()=>{e.send(JSON.stringify({type:'id',id:i})),console.log('Connected to peer!')},e.onerror=t=>{console.error(t)},e.onmessage=t=>{const e=JSON.parse(t.data);e.data&&(e.data=Object.values(e.data)),this.Eo&&this.Eo.postMessage(e)}}postMessage(t){const e=this.CO.get(t.data.id),i=t.data;i.data&&(i.data=Array.from(t.data.data)),e&&'open'===e.readyState&&e.send(JSON.stringify(i))}}class n{pc;So=void 0;xo;constructor(t){this.pc=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),this.pc.ondatachannel=e=>{this.So=e.channel,this.So.onopen=()=>{console.log('Connected to host!')},this.So.onerror=t=>{console.error(t)},this.So.onmessage=e=>{if(!this.xo){const t=JSON.parse(e.data);if('id'===t.type)return void(this.xo=t.id)}t.onmessage&&t.onmessage(e)}},this.pc.onicegatheringstatechange=async()=>{'complete'===this.pc.iceGatheringState&&(self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(this.pc.localDescription)):console.log(JSON.stringify(this.pc.localDescription)))}}async Xo(t){await this.pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(t))),await this.pc.setLocalDescription(await this.pc.createAnswer())}}},3867:(t,e,i)=>{i.d(e,{dm:()=>a,um:()=>o,fi:()=>s,Fm:()=>n,Eh:()=>r,Mm:()=>h,Xr:()=>l});class s extends Array{constructor(t,e){super(t);for(let i=0;i{i.d(e,{IO:()=>o,Jo:()=>n,gO:()=>h,$o:()=>s,ic:()=>r,_O:()=>l});const s=async t=>new Promise((e=>setTimeout(e,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),r=async t=>(await fetch(t)).text();function h(t){let e=0n;for(let i=0;i0n;)e.unshift(Number(0xffn&t)),t>>=8n;return 128&e[0]&&e.unshift(0),new Uint8Array(e)}function l(t,e,i){let s=1n;for(;e>0n;)e%2n===1n&&(s=s*t%i),t=t*t%i,e>>=1n;return s}},1908:(t,e,i)=>{i.d(e,{A:()=>n});var s=i(9763);class n{static EO=null;static load=async t=>{this.EO=await(0,s.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,e,i,s)=>{if(!this.EO)throw new Error('bz2 not found!!');return Int8Array.from(this.EO.read(t,e,i,s))}}},123:(t,e,i)=>{function s(t,e,i){window._tinyMidiPlay&&window._tinyMidiPlay(t,e/256,i)}function n(t){window._tinyMidiStop&&window._tinyMidiStop(t)}i.d(e,{il:()=>s,Mo:()=>n})},2604:(t,e,i)=>{function s(t,e){var i;(i=document.createElement('a')).href=t,i.download=e,document.body.appendChild(i),i.style='display: none',i.click(),i.remove()}i.d(e,{A:()=>s})},9763:(t,e,i)=>{async function s(t,e={}){const i={env:Object.assign(Object.create(globalThis),e.env||{},{abort(t,e,i,s){t=h(t>>>0),e=h(e>>>0),i>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${e}:${i}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,i),n=s.memory||e.env.memory,r=Object.setPrototypeOf({read:(t,e,i,r)=>(e=function(t,e,i,r,h){if(null==r)return 0;const o=r.length,l=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,l,o).set(r);else for(let e=0;e>>0),r[e]);return s.__unpin(l),l}(l,6,0,e,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,e,i){if(!i)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(i-4)>>>e,r=new Array(s);for(let n=0;n>>0));return r}(a,0,s.read(t,e,i,r)>>>0))},s);function h(t){if(!t)return null;const e=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,i=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;e-s>1024;)r+=String.fromCharCode(...i.subarray(s,s+=1024));return r+String.fromCharCode(...i.subarray(s,e))}let o=new DataView(n.buffer);function l(t,e){try{o.setUint8(t,e,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,e,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}i.d(e,{F:()=>s})},9896:(t,e,i)=>{var s=i(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(e){if(window.audioContext){var i=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=i,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{const t=2,e=44100;let i=new Float32Array,n=window.audioContext.createGain();n.gain.value=.1,n.connect(window.audioContext.destination);let r=window.audioContext.currentTime,h=[];const o=new s.A({vO:30,bO:t=>{let e=new Float32Array(t.buffer),s=new Float32Array(i.length+e.length);s.set(i,0),s.set(e,i.length),i=s},TO:t=>{},bufferSize:102400});await o.init();const l=await fetch('./SCC1_Florestan.sf2'),a=new Uint8Array(await l.arrayBuffer());function c(){if(!window.audioContext||!i.length)return;let s=window.audioContext.createBufferSource();const o=i.length/t,l=window.audioContext.createBuffer(t,o,e);for(let e=0;e{t.stop(window.audioContext.currentTime)})),h=[],n.gain.value=t}}function d(t,e){-1!==t&&window._tinyMidiVolume(t),r=window.audioContext.currentTime,f=setInterval(c,250),o.OO(e)}o.RO(a),window._tinyMidiStop=async t=>{t?function(t,e){const i=window.audioContext.currentTime;n.gain.cancelScheduledValues(i),n.gain.setValueAtTime(n.gain.value,i),n.gain.linearRampToValueAtTime(t,i+2),setTimeout(e,2e3)}(0,(()=>{u()})):u()},window._tinyMidiVolume=(t=1)=>{n.gain.value=t},window._tinyMidiPlay=async(t,e,i)=>{t&&(await window._tinyMidiStop(i),i?setTimeout((()=>{d(e,t)}),2e3):d(e,t))}})()},8151:(t,e,i)=>{i.d(e,{A:()=>n});var s=i(5473);const n=class{constructor(t={}){this.LO=void 0,this.SO=0,this.xO=0,this.MO=0,this.vO=t.vO||100,this.sampleRate=t.sampleRate||44100,this.kO=t.kO||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.DO(1),this.bO=t.bO||(()=>{}),this.TO=t.TO||(()=>{}),this.NO=void 0,this.test=0}async init(){if(!this.LO){if('undefined'!=typeof process){const{FO:t}=await import('path'),{BO:e}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=e("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.LO=await(0,s.A)(),this.PO=this.LO._malloc(this.bufferSize),this.UO=this.LO._malloc(8)}}DO(t){this.bufferSize=4*this.sampleRate*this.kO*t}GO(){if(!this.LO)throw new Error(`${this.constructor.name} not initalized. call .init()`)}RO(t){this.GO();const{_malloc:e,_free:i,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.LO;i(this.SO),this.SO=e(t.length),this.LO.HEAPU8.set(t,this.SO),this.xO=s(this.SO,t.length),n(this.xO,2===this.kO?0:2,this.sampleRate,this.gain)}WO(){this.GO();const t=new Uint8Array(this.bufferSize);return t.set(this.LO.HEAPU8.subarray(this.PO,this.PO+this.bufferSize)),t}YO(t){const{_malloc:e,_free:i,_tml_load_memory:s}=this.LO;return i(this.MO),this.MO=e(t.length),this.LO.HEAPU8.set(t,this.MO),s(this.MO,t.length)}HO(t){const{_midi_render:e}=this.LO;return e(this.xO,t,this.kO,this.sampleRate,this.PO,this.bufferSize,this.UO)}OO(t){if(this.GO(),!this.xO)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.NO);const{setValue:e,getValue:i}=this.LO;e(this.UO,0,'double'),this.LO._tsf_reset(this.xO),this.LO._tsf_channel_set_bank_preset(this.xO,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.YO(t);const n=()=>{s=this.HO(s);const t=this.WO();this.bO(t),s?this.NO=setTimeout(n,this.vO):this.TO(i(this.UO,'double'))};this.NO=setTimeout(n,16)}}},8227:(t,e,i)=>{t.exports=i.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,e,i)=>{var s;i.d(e,{A:()=>n});const n=(s="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var e,n,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,i){e=t,n=i})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(r.ready,t)||Object.defineProperty(r.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var h=Object.assign({},r),o=[],l='object'==typeof window,a='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!l&&!c&&!a;if(r.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var A,m;y=a?require('path').FO(y)+'/':__dirname+'/';var p=()=>{m||(A=require('fs'),m=require('path'))};u=(t,e)=>(p(),t=m.normalize(t),A.VO(t,e?void 0:'utf8')),w=t=>{var e=u(t,!0);return e.buffer||(e=new Uint8Array(e)),D(e.buffer),e},d=(t,e,i)=>{p(),t=m.normalize(t),A.KO(t,(function(t,s){t?i(t):e(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),r.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let e;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(e=read(t,'binary'),D('object'==typeof e),e)},d=function(t,e,i){setTimeout((()=>e(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!l&&!a)throw new Error('environment detection error');if(a?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),s&&(y=s),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var e=new XMLHttpRequest;return e.open('GET',t,!1),e.send(null),e.responseText},a&&(w=t=>{var e=new XMLHttpRequest;return e.open('GET',t,!1),e.responseType='arraybuffer',e.send(null),new Uint8Array(e.response)}),d=(t,e,i)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?e(s.response):i()},s.onerror=i,s.send(null)}}r.print||console.log.bind(console);var g,_,I=r.printErr||console.warn.bind(console);function C(t,e){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+e+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(r,h),h=null,g='fetchSettings',Object.getOwnPropertyDescriptor(r,g)&&j('`Module.'+g+'` was supplied but `'+g+'` not included in INCOMING_MODULE_JS_API'),r.arguments&&(o=r.arguments),C('arguments','arguments_'),r.thisProgram&&r.thisProgram,C('thisProgram','thisProgram'),r.quit&&r.quit,C('quit','quit_'),D(void 0===r.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===r.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===r.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===r.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===r.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),r.wasmBinary&&(_=r.wasmBinary),C('wasmBinary','wasmBinary');var v;r.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,O,R,L,S,x,M,k=!1;function D(t,e){t||j('Assertion failed'+(e?': '+e:''))}function N(t){b=t,r.HEAP8=T=new Int8Array(t),r.HEAP16=R=new Int16Array(t),r.HEAP32=L=new Int32Array(t),r.HEAPU8=O=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=S=new Uint32Array(t),r.HEAPF32=x=new Float32Array(t),r.HEAPF64=M=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var F=5242880;r.TOTAL_STACK&&D(F===r.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=r.INITIAL_MEMORY||16777216;function P(){if(!k){var t=ft(),e=S[t>>2],i=S[t+4>>2];34821223==e&&2310721022==i||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+i.toString(16)+' 0x'+e.toString(16)),1668509029!==S[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=F,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+F+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!r.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),e=new Int8Array(t.buffer);if(t[0]=25459,115!==e[0]||99!==e[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var U=[],G=[],W=[],Y=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var H=0,V=null,K=null,X={};function j(t){r.onAbort&&r.onAbort(t),I(t='Aborted('+t+')'),k=!0;var e=new WebAssembly.RuntimeError(t);throw n(e),e}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},XO:function(){z.error()},jO:function(){z.error()},zO:function(){z.error()},open:function(){z.error()},ZO:function(){z.error()},qO:function(){z.error()},JO:function(){z.error()},$O:function(){z.error()},QO:function(){z.error()}};r.FS_createDataFile=z.XO,r.FS_createPreloadedFile=z.jO;var Z,q,J,$,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function et(t){return t.startsWith('file://')}function it(t,e){return function(){var i=t,s=e;return e||(s=r.asm),D(Y,'native function `'+i+'` called before runtime initialization'),s[t]||D(s[t],'exported native function `'+i+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==Z&&_)return new Uint8Array(_);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(r)}function ht(t){ht.tR||(ht.tR={}),ht.tR[t]||(ht.tR[t]=1,c&&(t='warning: '+t),I(t))}function ot(t){try{return v.grow(t-b.byteLength+65535>>>16),N(v.buffer),1}catch(e){I('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+e)}}r.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=r.locateFile?r.locateFile(q,y):y+q):Z=new URL(i(8227),i.b).toString();var lt,at={"emscripten_memcpy_big":function(t,e,i){O.copyWithin(t,e,e+i)},"emscripten_resize_heap":function(t){var e=O.length;D((t>>>=0)>e);var i,s,n=2147483648;if(t>n)return I('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=e*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(i=Math.max(t,h))+((s=65536)-i%s)%s);if(ot(o))return!0}return I('Failed to grow the heap from '+e+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,e={'env':at,'wasi_snapshot_preview1':at};function i(t,e){var i,s=t.exports;r.asm=s,D(v=r.asm.memory,"memory not found in wasm exports"),N(v.buffer),D(r.asm.__indirect_function_table,"table not found in wasm exports"),i=r.asm.__wasm_call_ctors,G.unshift(i),function(t){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(X[t]),delete X[t]):I('warning: run dependency removed without ID'),0==H&&(null!==V&&(clearInterval(V),V=null),K)){var e=K;K=null,e()}}('wasm-instantiate')}t='wasm-instantiate',H++,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(k)return clearInterval(V),void(V=null);var t=!1;for(var e in X)t||(t=!0,I('still waiting on run dependencies:')),I('dependency: '+e);t&&I('(end of list)')}),1e4))):I('warning: run dependency added without ID');var s=r;function h(t){D(r===s,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),s=null,i(t.instance)}function o(t){return function(){if(!_&&(l||a)){if('function'==typeof fetch&&!et(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return st(Z)}));if(d)return new Promise((function(t,e){d(Z,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return st(Z)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then((function(t){return t})).then(t,(function(t){I('failed to asynchronously prepare wasm: '+t),et(Z)&&I('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(r.instantiateWasm)try{return r.instantiateWasm(e,i)}catch(t){I('Module.instantiateWasm callback failed with error: '+t),n(t)}(_||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||et(Z)||c||'function'!=typeof fetch?o(h):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(h,(function(t){return I('wasm streaming compile failed: '+t),I('falling back to ArrayBuffer instantiation'),o(h)}))}))).catch(n)}(),r.___wasm_call_ctors=it("__wasm_call_ctors"),r._malloc=it("malloc"),r._free=it("free"),r._tsf_load_memory=it("tsf_load_memory"),r._tsf_close=it("tsf_close"),r._tsf_reset=it("tsf_reset"),r._tsf_set_output=it("tsf_set_output"),r._tsf_set_max_voices=it("tsf_set_max_voices"),r._realloc=it("realloc"),r._tsf_channel_set_presetnumber=it("tsf_channel_set_presetnumber"),r._tsf_channel_set_bank_preset=it("tsf_channel_set_bank_preset"),r._tml_load_memory=it("tml_load_memory"),r._midi_render=it("midi_render"),r.___errno_location=it("__errno_location"),r._fflush=it("fflush"),r._emscripten_stack_init=function(){return(ct=r._emscripten_stack_init=r.asm.emscripten_stack_init).apply(null,arguments)}),ft=(r._emscripten_stack_get_free=function(){return(r._emscripten_stack_get_free=r.asm.emscripten_stack_get_free).apply(null,arguments)},r._emscripten_stack_get_base=function(){return(r._emscripten_stack_get_base=r.asm.emscripten_stack_get_base).apply(null,arguments)},r._emscripten_stack_get_end=function(){return(ft=r._emscripten_stack_get_end=r.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),S[t>>2]=34821223,S[t+4>>2]=2310721022,S[0]=1668509029}function dt(t){function i(){lt||(lt=!0,r.calledRun=!0,k||(D(!Y),Y=!0,P(),rt(G),e(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),D(!r._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(P(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),W.unshift(t);var t;rt(W)}()))}t=t||o,H>0||(ut(),function(){if(r.preRun)for('function'==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),U.unshift(t);var t;rt(U)}(),H>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),i()}),1)):i(),P()))}if(r.stackSave=it("stackSave"),r.stackRestore=it("stackRestore"),r.stackAlloc=it("stackAlloc"),r.setValue=function(t,e,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':T[0|t]=e;break;case'i16':R[t>>1]=e;break;case'i32':L[t>>2]=e;break;case'i64':$=[e>>>0,(J=e,+Math.abs(J)>=1?J>0?(0|Math.min(+Math.floor(J/4294967296),4294967295))>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],L[t>>2]=$[0],L[t+4>>2]=$[1];break;case'float':x[t>>2]=e;break;case'double':M[t>>3]=e;break;case'*':S[t>>2]=e;break;default:j('invalid type for setValue: '+i)}},r.getValue=function(t,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':return T[0|t];case'i16':return R[t>>1];case'i32':case'i64':return L[t>>2];case'float':return x[t>>2];case'double':return M[t>>3];case'*':return S[t>>2];default:j('invalid type for getValue: '+e)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){var e="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(e+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(e)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var e='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(e+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(e)}})})),K=function t(){lt||dt(),lt||(K=t)},r.preInit)for('function'==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return dt(),t.ready})}},r={};function h(t){var e=r[t];if(void 0!==e)return e.exports;var i=r[t]={exports:{}};return n[t](i,i.exports,h),i.exports}h.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",e="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",i="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",s=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},h.a=(n,r,h)=>{var o;h&&((o=[]).d=-1);var l,a,c,f=new Set,u=n.exports,d=new Promise(((t,e)=>{c=e,a=t}));d[e]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,r((n=>{var r;l=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var r=[];r.d=0,n.then((t=>{h[e]=t,s(r)}),(t=>{h[i]=t,s(r)}));var h={};return h[t]=t=>t(r),h}}var o={};return o[t]=t=>{},o[e]=n,o})))(n);var h=()=>l.map((t=>{if(t[i])throw t[i];return t[e]})),a=new Promise((e=>{(r=()=>e(h)).r=0;var i=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(r.r++,t.push(r)));l.map((e=>e[t](i)))}));return r.r?a:h()}),(t=>(t?c(d[i]=t):a(u),s(o)))),o&&o.d<0&&(o.d=0)},h.d=(t,e)=>{for(var i in e)h.o(e,i)&&!h.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},h.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),h.p="/Client2/",h.b=document.baseURI||self.location.href;h(9858)})(); \ No newline at end of file +(()=>{"use strict";var t,e,i,s,n={1651:(t,e,i)=>{i.d(e,{K:()=>D});var s=i(1120),n=i(4583),r=i(2901),h=i(1069),o=i(7046),l=(i(9896),i(6666)),a=i(3045),c=i(818),f=i(670),u=i(8268),d=i(3867),w=i(7854),y=i(8950),A=i(1302),m=i(9298),p=i(8665),g=i(1312),_=i(3819),I=i(8317),C=i(9234),E=i(1908),v=i(123),b=i(5637),T=i(6948),O=i(2164),R=i(8738),L=i(3764),S=i(8534),x=i(6730),M=i(2604),k=i(5226);class D extends o.A{static tt=225;static et=10;static portOffset=0;static members=!0;static it=!1;static st='';static nt='';static rt=!1;static ht=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static gt=0;static _t=0;static It=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Ot=0;static Rt=()=>{a.A.it=!1,n.A.it=!1,D.it=!1,c.A.it=!1};static Lt=()=>{a.A.it=!0,n.A.it=!0,D.it=!0,c.A.it=!0};St=2048;xt=2047;Mt=!1;kt=!1;Dt=!1;Nt=!1;db=null;Ft=0;Bt=[];stream=null;in=h.A.Pt(1);Ut=h.A.Pt(1);Gt=h.A.Pt(1);Wt=0n;Yt=0;Ht=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;Jt=!0;$t=0;Qt=0;te=null;ee=null;ie=null;se=null;ne=null;re=null;he=null;oe=null;le=null;ae=null;ce=null;fe='';ue='';username='';password='';de=null;we=null;ye=null;Ae=null;me=[];pe=!1;ge=null;_e=null;Ie=null;Ce=null;Ee=null;ve=null;be=null;Te=null;Oe=null;Re=null;Le=new Int32Array(256);Se=0;xe=0;Me=0;ke=null;De=null;Ne=null;Fe=null;Be=null;Pe=null;Ue=null;Ge=null;We=null;Ye=null;He=null;Ve=null;Ke=null;Xe=null;je=null;ze=null;Ze=null;qe=null;Je=null;$e=null;Qe=null;ti=new Int32Array(33);ei=new Int32Array(33);ii=new Int32Array(151);si=new Int32Array(151);ni=null;ri=null;hi=null;oi=null;li=null;ai=null;ci=new d.fi(13,null);ui=null;di=null;wi=new d.fi(50,null);yi=new d.fi(50,null);Ai=new d.fi(20,null);mi=new d.fi(20,null);pi=null;gi=new d.fi(8,null);_i=null;Ii=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Oi=null;Ri=null;Li=null;Si=null;xi=null;Mi=null;ki=null;Di=null;Ni=null;Fi=null;Bi=null;Pi=new d.fi(1e3,null);Ui=!1;Gi=!1;Wi=!1;Yi=!1;Hi=-1;Vi=0;Ki=0;Xi=0;ji=0;zi=0;Zi=0;qi=!1;Ji=0;$i=0;Qi=0;ts=0;es=0;ss=0;ns=[];rs=-1;hs=-1;os=new s.A;ls=78;cs=0;fs=0;us=[];ds=0;ws=0;ys=0;As=0;ps=0;gs=0;_s=0;Is=0;Cs=[];Es=[];vs=[];bs=[];Ts=null;Os=-1;Rs=3;Ls=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Ss=0;xs=0;Ms=0;ks=!1;Ds=0;Ns=!1;Fs='';Bs='';Ps=0;Us='';Gs=!1;Ws=-1;Ys=new d.fi(100,null);Hs=new d.fi(100,null);messageType=new Int32Array(100);Vs=new Int32Array(100);Ks=0;Xs=0;js=0;zs='';Zs=0;qs=0;Js=0;$s=0;Qs=0;tn=0;en=0;sn=0;nn=0;rn=!1;hn=0;ln=0;an=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;An=!1;mn=[];pn=[];gn=0;_n=0;In=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);On=new Int32Array(500);Rn=0;Ln=0;Sn=0;xn='';Mn=!1;kn=-1;Dn=0;Nn=0;Fn=0;Bn=0;Pn=0;Un=new Int32Array(1e3);Gn=new Int32Array(1e3);Wn=null;Yn=0;Hn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;Jn=0;$n=2;Qn=2;tr=1;er=new Int32Array(5);ir=new d.fi(5,!1);sr=new Int32Array(5);nr=new Int32Array(5);rr=new Int32Array(5);hr=0;lr=0;ar=0;cr=0;ur=0;dr=0;wr=0;yr=0;Ar=0;mr=1;pr=2;gr=-1;_r=0;Ir=0;Cr=0;Er=0;vr=0;br=0;Tr=null;Or=null;Rr=null;Lr=0;Sr=0;Mr=new Int8Array(16384);kr=new d.fi(f.A.Dr,null);Nr=0;Fr=0;Br=128;Pr=0;Ur=0;Gr=0;Wr=0;Yr=0;Hr=null;Vr=null;Kr=new d.Xr(f.A.jr,f.A.jr);zr=0;Zr=0;qr=0;Jr=0;$r=0;Qr=0;th=0;eh=0;ih=0;sh=0;nh=0;rh=0;hh=new d.fi(this.St,null);oh=0;lh=new Int32Array(this.St);ah=0;fh=0;uh=new Int32Array(this.St);dh=new Int32Array(1e3);wh=new d.fi(this.St,null);yh=new d.fi(8192,null);Ah=0;mh=new Int32Array(8192);ph=new l.A;gh=new l.A;_h=new l.A;Ih=new l.A;Ch=new d.Eh(f.A.Dr,f.A.jr,f.A.jr,null);bh=new l.A;Th=new Int32Array(4e3);Oh=new Int32Array(4e3);Rh=new Int32Array(f.A.jr*f.A.jr);Lh=new Int32Array(f.A.jr*f.A.jr);Sh=0;xh=null;Mh=0;kh=0;Dh=-1;Nh=0;Fh=0;Bh=0;Ph=0;Uh=!1;Gh=!0;Wh=!1;Yh=new Int32Array(7);Hh=new Int32Array(5);Vh=0;Kh=0;static Xh=50;jh=new Int32Array(D.Xh);zh=new Int32Array(D.Xh);Zh=new Int32Array(D.Xh);qh=new Int32Array(D.Xh);Jh=new Int32Array(D.Xh);$h=new Int32Array(D.Xh);Qh=new Int32Array(D.Xh);eo=new d.fi(D.Xh,null);io=new d.fi(100,null);so=new BigInt64Array(100);no=new Int32Array(100);ro=null;ho=0;oo=!0;lo=new Int32Array(50);ao=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;Ao=0;mo=!0;po=null;_o=0;Io=0;Co=192;Eo=void 0;vo=!1;host=null;bo=null;To=new d.fi(16,null);Oo=0;Ro=!1;Lo=()=>{try{this.stream&&this.stream.close()}catch(t){}this.bo&&'998'===D.getParameter('world')&&this.bo.So?.send(JSON.stringify({type:'close',id:this.bo.xo})),this.stream=null,(0,v.Mo)(!1),this.Ut=null,this.Gt=null,this.in=null,this.Rr=null,this.Tr=null,this.Or=null,this.Hr=null,this.Vr=null,this.Wn=null,this.kr=null,this.Rh=null,this.Lh=null,this.Th=null,this.Oh=null,this.Mr=null,this.De=null,this.Ne=null,this.Fe=null,this.Be=null,this.Pe=null,this.Ue=null,this.Ge=null,this.We=null,this.Ye=null,this.He=null,this.Ve=null,this.Ke=null,this.Xe=null,this.je=null,this.ze=null,this.Ze=null,this.qe=null,this.ni=null,this.hi=null,this.ri=null,this.oi=null,this.li=null,this.ai=null,this.ci=null,this.Ti=null,this.Oi=null,this.Ri=null,this.Li=null,this.Si=null,this.xi=null,this.Mi=null,this.ki=null,this.Di=null,this.Ni=null,this.di=null,this.Ai=null,this.mi=null,this.gi=null,this._i=null,this.Ii=null,this.Ci=null,this.Ei=null,this.wi=null,this.yi=null,this.Kr=null,this.hh=null,this.lh=null,this.uh=null,this.wh=null,this.dh=null,this.yh=null,this.mh=null,this.Ch=null,this.bh=null,this.Ih=null,this.ph=null,this.gh=null,this._h=null,this.Tn=null,this.On=null,this.vn=null,this.bn=null,this.ns=null,this.mn=null,this.Un=null,this.Gn=null,this.Pi=null,this.ui=null,this.io=null,this.so=null,this.no=null,this.se=null,this.ne=null,this.te=null,this.ee=null,this.ie=null,this.re=null,this.he=null,this.oe=null,this.le=null,this.ko(),b.A.Lo(),T.A.Lo(),A.A.Lo(),O.A.Do=null,I.A.Do=null,s.A.Do=null,g.A.Do=null,R.A.Do=null,R.A.No=null,L.A.Do=null,this.Fo=null,u.A.No=null,n.A.Lo(),a.A.Lo(),p.A.Lo(),S.A.Do=[],x.A.Do=[]};Bo(){return this.$t}Po(){return this.Gs}Uo(){return this.Ns}Go(){return this.hs}Wo(){return this.Hi}ko=()=>{this.pe=!1,this.ke&&(clearInterval(this.ke),this.ke=null),this.ae=null,this.ce=null,this.me=[],this.be=null,this.Te=null,this.Oe=null,this.Re=null,this.Ce=null,this.Ie=null,this.Ee=null,this.ve=null,this.ge=null,this._e=null};Yo=()=>{'999'===D.getParameter('world')?(this.Eo=new Worker('worker.js',{type:'module'}),this.Eo.onmessage=this.onmessage,this.host=new k.x(this.Eo)):'998'===D.getParameter('world')&&(this.Eo={onmessage:t=>{this.stream.Ho.onmessage(t)},postMessage:t=>{this.bo&&this.bo.So&&'open'===this.bo.So.readyState&&this.bo.So.send(JSON.stringify(t))},onerror:null,onmessageerror:null,terminate:()=>{throw new Error},addEventListener:()=>{throw new Error},removeEventListener:()=>{throw new Error},dispatchEvent:()=>{throw new Error}},this.bo=new k.Q(this.Eo))};onmessage=t=>{switch(t.data.type){case'ready':return void(this.vo=!0);case'save':return(0,M.A)(t.data.value,t.data.path.split('/').pop().split('\\').pop()),void URL.revokeObjectURL(t.data.value);case'close':return void this.Eo?.postMessage({type:'close',id:t.data.id})}this.host?.xo===t.data.id?this.stream.Ho.onmessage(t.data):this.host?.postMessage(t)};Vo=async()=>{if(999==+D.getParameter('world'))this.host&&await this.host.Ko();else if(998==+D.getParameter('world')&&this.bo){if(this.bo.So)return void console.log('You are already connected.');const t=prompt('Paste offer here, answer will be copied to clipboard');if(t)try{await this.bo.Xo(t)}catch(t){console.error(t)}}};jo=async(t,e,i,s)=>{let n=5,o=await(this.db?.zo(t));if(o&&h.A.Zo(o)!==i&&(o=void 0),o)return new r.A(o);for(;!o;){await this.qo(s,`Requesting ${e}`);try{o=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}${i}`):await(0,C.Jo)(`${D.nt}/${t}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.qo(s,`Error loading - Will retry in ${t} secs.`),await(0,C.$o)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Qo(t,o)),new r.A(o)};tl=async(t,e,i,s)=>{let n=await(this.db?.zo(t+'.mid'));if(n&&12345678!==e&&h.A.Zo(n)!==e&&(n=void 0),!n)try{n=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}_${e}.mid`):await(0,C.Jo)(`${D.nt}/songs/${t}.mid`),i!==n.length&&(n=n.slice(0,i))}catch(t){}if(!n)return;await(this.db?.Qo(t+'.mid',n));const r=new h.A(Uint8Array.from(n)).el,o=E.A.read(r,n,i,4);(0,v.il)(o,this.Co,s)};sl=()=>{if(w.nl.fillStyle='black',w.nl.fillRect(0,0,this.width,this.height),this.rl(1),this.Dt){this.pe=!1,w.nl.font='bold 16px helvetica, sans-serif',w.nl.textAlign='left',w.nl.fillStyle='yellow';let t=35;w.nl.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.nl.fillStyle='white',w.nl.fillText('To fix this try the following (in order):',30,t),t+=50,w.nl.font='bold 12px helvetica, sans-serif',w.nl.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.nl.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.nl.fillText('3: Try using a different game-world',30,t),t+=30,w.nl.fillText('4: Try rebooting your computer',30,t),t+=30,w.nl.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.pe=!1,w.nl.font='bold 20px helvetica, sans-serif',w.nl.textAlign='left',w.nl.fillStyle='white',w.nl.fillText('Error - unable to load game!',50,50),w.nl.fillText('To play RuneScape make sure you play from',50,100),w.nl.fillText('https://2004scape.org',50,150)),this.kt){this.pe=!1,w.nl.font='bold 13px helvetica, sans-serif',w.nl.textAlign='left',w.nl.fillStyle='yellow';let t=35;w.nl.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.nl.fillStyle='white',w.nl.fillText('To fix this try the following (in order):',30,t),t+=50,w.nl.font='bold 12px helvetica, sans-serif',w.nl.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.nl.fillText('2: Try rebooting your computer, and reloading',30,t)}};hl=t=>{if(!t.ol)return!1;for(let e=0;e=s)return!1}else if(3===t.ol[e]){if(i<=s)return!1}else if(4===t.ol[e]){if(i===s)return!1}else if(i!==s)return!1}return!0};cl=(t,e,i,s,n)=>{this.vi?.draw(t,e),this.bi?.draw(t,e+n-16),y.A.fillRect(t,e+16,16,n-32,m.A.fl);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*i/(s-n)|0;y.A.fillRect(t,e+h+16,16,r,m.A.ul),y.A.dl(t,e+h+16,m.A.wl,r),y.A.dl(t+1,e+h+16,m.A.wl,r),y.A.yl(t,e+h+16,m.A.wl,16),y.A.yl(t,e+h+17,m.A.wl,16),y.A.dl(t+15,e+h+16,m.A.Al,r),y.A.dl(t+14,e+h+17,m.A.Al,r-1),y.A.yl(t,e+h+r+15,m.A.Al,16),y.A.yl(t+1,e+h+r+14,m.A.Al,15)};ml=(t,e)=>{let i=!1;const n=s.A.Do[t];if(!n.pl)return!1;for(let t=0;ts.delay[r.Cl];)r.Il-=s.delay[r.Cl]+1,r.Cl++,r.Cl>=s.El&&(r.Cl-=s.vl,(r.Cl<0||r.Cl>=s.El)&&(r.Cl=0)),i=!0}}}return i};bl=(t,e,i,r,h=!1)=>{if(0!==t.type||!t.pl||t.hide&&this.Zs!==t.id&&this.qs!==t.id&&this.Js!==t.id)return;const o=y.A.left,l=y.A.top,a=y.A.right,c=y.A.bottom;y.A.Tl(e,i,e+t.width,i+t.height);const f=t.pl.length;for(let o=0;o0&&this.Ml(c),c.type===s.A.kl)c.Dl>c.scroll-c.height&&(c.Dl=c.scroll-c.height),c.Dl<0&&(c.Dl=0),this.bl(c,l,a,c.Dl,h),c.scroll>c.height&&this.cl(l+c.width,a,c.Dl,c.scroll,c.height);else if(c.type===s.A.Nl){let t=0;for(let e=0;e0){let e=0,i=0;const r=c.Pl[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qs===t){const h=A.A.Yl(r,c.Ul[t]);if(0!==this.tn&&this.Qs===t&&this.$s===c.id?(e=this.Hl-this.en,i=this.Vl-this.sn,e<5&&e>-5&&(e=0),i<5&&i>-5&&(i=0),this.nn<5&&(e=0,i=0),h.Kl(128,s+e,n+i)):0!==this.un&&this.dn===t&&this.wn===c.id?h.Kl(128,s,n):h.draw(s,n),33===h.Xl||1!==c.Ul[t]){const r=c.Ul[t];this.de?.jl(s+e+1,n+10+i,this.zl(r),m.A.Zl),this.de?.jl(s+e,n+9+i,this.zl(r),m.A.ql)}}}else if(c.Jl&&t<20){const e=c.Jl[t];e?.draw(s,n)}t++}}else if(c.type===s.A.$l)c.fill?y.A.fillRect(l,a,c.width,c.height,c.Ql):y.A.Ll(l,a,c.width,c.height,c.Ql);else if(c.type===s.A.ta){const t=c.font;let e=c.Ql,i=c.text;if(this.Js!==c.id&&this.qs!==c.id&&this.Zs!==c.id||0===c.ea||(e=c.ea),this.hl(c)&&(e=c.ia,c.sa&&c.sa.length>0&&(i=c.sa)),c.na===s.A.ra&&this.An&&(i='Please wait...',e=c.Ql),!t||!i)continue;for(let s=a+t.height;i.length>0;s+=t.height){if(-1!==i.indexOf('%')){for(;;){const t=i.indexOf('%1');if(-1===t)break;i=i.substring(0,t)+this.ha(this.ll(c,0))+i.substring(t+2)}for(;;){const t=i.indexOf('%2');if(-1===t)break;i=i.substring(0,t)+this.ha(this.ll(c,1))+i.substring(t+2)}for(;;){const t=i.indexOf('%3');if(-1===t)break;i=i.substring(0,t)+this.ha(this.ll(c,2))+i.substring(t+2)}for(;;){const t=i.indexOf('%4');if(-1===t)break;i=i.substring(0,t)+this.ha(this.ll(c,3))+i.substring(t+2)}for(;;){const t=i.indexOf('%5');if(-1===t)break;i=i.substring(0,t)+this.ha(this.ll(c,4))+i.substring(t+2)}}const n=i.indexOf('\\n');let r;-1!==n?(r=i.substring(0,n),i=i.substring(n+2)):(r=i,i=''),c.oa?t.la(l+(c.width/2|0),s,r,e,c.aa):t.ca(l,s,r,e,c.aa)}}else if(c.type===s.A.fa){let t;t=this.hl(c)?c.ua:c.da,t?.draw(l,a)}else if(c.type===s.A.wa){const t=n.A.ya,e=n.A.Aa;n.A.ya=l+(c.width/2|0),n.A.Aa=a+(c.height/2|0);const i=n.A.sin[c.ma]*c.zoom>>16,s=n.A.cos[c.ma]*c.zoom>>16,r=this.hl(c);let h;h=r?c._l:c.gl;let o=null;if(-1===h)o=c.pa(-1,-1,r);else{const t=g.A.Do[h];t.frames&&t.ga&&(o=c.pa(t.frames[c.Cl],t.ga[c.Cl],r))}o&&o._a(0,c.Ia,0,c.ma,0,i,s),n.A.ya=t,n.A.Aa=e}else if(c.type===s.A.Ca){const t=c.font;if(!t||!c.Pl||!c.Ul)continue;let e=0;for(let i=0;i0){const n=A.A.get(c.Pl[e]-1);let r=n.name;if((n.Ea||1!==c.Ul[e])&&(r=r+' x'+this.va(c.Ul[e])),!r)continue;const h=l+s*(c.Gl+115),o=a+i*(c.Wl+12);c.oa?t.la(h+(c.width/2|0),o,r,c.Ql,c.aa):t.ca(h,o,r,c.Ql,c.aa)}e++}}}y.A.Tl(o,l,a,c)};Ml=t=>{let e=t.xl;if(e>=s.A.ba&&e<=s.A.Ta)e--,e>=this.Vh?(t.text='',t.na=0):(t.text=this.io[e],t.na=1);else if(e>=s.A.Oa&&e<=s.A.Ra)e-=s.A.Oa,e>=this.Vh?(t.text='',t.na=0):(0===this.no[e]?t.text='@red@Offline':this.no[e]===D.et?t.text='@gre@World-'+(this.no[e]-9):t.text='@yel@World-'+(this.no[e]-9),t.na=1);else if(e===s.A.La)t.scroll=15*this.Vh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(e>=s.A.Sa&&e<=s.A.xa)e-=s.A.Sa,e>=this.fs?(t.text='',t.na=0):(t.text=_.A.Ma(_.A.ka(this.us[e])),t.na=1);else if(e===s.A.Da)t.scroll=15*this.fs+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(e===s.A.Na){if(t.ma=150,t.Ia=256*Math.sin(this.Ft/40)&2047,this.Wh){this.Wh=!1;const e=new d.fi(7,null);let i=0;for(let t=0;t<7;t++){const s=this.Yh[t];s>=0&&(e[i++]=I.A.Do[s].pa())}const s=p.A.Fa(e,i);for(let t=0;t<5;t++)0!==this.Hh[t]&&(s.Ba(u.A.Pa[t][0],u.A.Pa[t][this.Hh[t]]),1===t&&s.Ba(u.A.Ua[0],u.A.Ua[this.Hh[t]]));if(this.xh){const e=g.A.Do[this.xh.Ga].frames;e&&(s.Wa(),s.Ya(e[0]),s.Ha(64,850,-30,-50,-30,!0),t.model=s)}}}else if(e===s.A.Va)this.Fi||(this.Fi=t.da,this.Bi=t.ua),this.Gh?t.da=this.Bi:t.da=this.Fi;else if(e===s.A.Ka)this.Fi||(this.Fi=t.da,this.Bi=t.ua),this.Gh?t.da=this.Fi:t.da=this.Bi;else if(e===s.A.Xa)t.text=this.xn,this.Ft%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(e===s.A.ja)this.Uh?this.Mn?(t.Ql=m.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Ql=m.A.Sl,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(e===s.A.za||e===s.A.Za)if(0===this.Dn)t.text='';else{let e;e=0===this.Nn?'earlier today':1===this.Nn?'yesterday':this.Nn+' days ago',t.text='You last logged in '+e+' from: '+_.A.qa(this.Dn)}else if(e===s.A.Ja)0===this.Bn&&(t.text='0 unread messages',t.Ql=m.A.ql),1===this.Bn&&(t.text='1 unread message',t.Ql=m.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Ql=m.A.GREEN);else if(e===s.A.$a)if(201===this.Fn)t.text='';else if(200===this.Fn)t.text='You have not yet set any password recovery questions.';else{let e;e=0===this.Fn?'Earlier today':1===this.Fn?'Yesterday':this.Fn+' days ago',t.text=e+' you changed your recovery questions'}else e===s.A.Qa?201===this.Fn?t.text='':200===this.Fn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':e===s.A.tc&&(201===this.Fn?t.text='':(this.Fn,t.text="Do this from the 'account management' area on our front webpage"))};ll=(t,e)=>{if(!t.scripts||e>=t.scripts.length)return-2;try{const i=t.scripts[e];if(!i)return-1;let n=0,r=0;for(;;){const t=i[r++];if(0===t)return n;if(1===t)n+=this.Es[i[r++]];else if(2===t)n+=this.vs[i[r++]];else if(3===t)n+=this.Cs[i[r++]];else if(4===t){const t=s.A.Do[i[r++]],e=i[r++]+1;if(t.Pl&&t.Ul)for(let i=0;it<999999999?String(t):'*';va=t=>{let e=String(t);for(let t=e.length-3;t>0;t-=3)e=e.substring(0,t)+','+e.substring(t);return e.length>8?e='@gre@'+e.substring(0,e.length-8)+' million @whi@('+e+')':e.length>4&&(e='@cya@'+e.substring(0,e.length-4)+'K @whi@('+e+')'),' '+e};zl=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,e,i)=>{i.d(e,{w:()=>h});var s=i(7046),n=i(1651),r=i(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');['0','998','999'].includes(s.A.getParameter('world'))?function(){if(+s.A.getParameter('world')>=998)return void(n.K.nt='data/pack/client');n.K.st='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0}():await async function(t){const e=await o(t,parseInt(s.A.getParameter('world'),10)),i=new URL(e.address);n.K.et=10+e.id-1,n.K.st=`${i.protocol}//${i.hostname}`,n.K.nt=`${i.protocol}//${i.hostname}:${i.port}`,t||(n.K.st=n.K.st.replace('https:','http:'));n.K.portOffset=e.portOffset,n.K.members=!0===e?.members,s.A.setParameter('world',e.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===s.A.getParameter('detail').length&&s.A.setParameter('detail','high');'low'===s.A.getParameter('detail')?n.K.Lt():n.K.Rt()}(),0===s.A.getParameter('method').length&&s.A.setParameter('method','0')}async function o(t,e,i=0){if(i>=10)throw new Error('could not find world to connect!');const s=t?'https:':'http:';let n;try{n=JSON.parse(await(0,r.ic)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.$o)(1e3),o(t,e,++i)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hh:0});const h=n.find((t=>t.id===e));return h||o(t,e,10)}},9858:(t,e,i)=>{i.a(t,(async(t,e)=>{try{var s=i(1312),n=i(1302),r=i(4583),h=i(2682),o=i(8665),l=i(8534),a=i(6730),c=i(9234),f=i(1069),u=i(4544),d=i(7854),w=i(1908),y=i(1183),A=i(1651),m=i(7604);class t extends A.K{sc=[];async nc(t){const e=new Map,i=(await(0,c.ic)(t)).split('\n');for(let t=0;t{if(this.Mt)this.kt=!0;else{this.Mt=!0;try{await this.qo(10,'Connecting to fileserver'),await w.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new u.A(await u.A.openDatabase());const t=new f.A(new Uint8Array(await(0,c.Jo)(`${A.K.nt}/crc`)));for(let e=0;e<9;e++)this.Bt[e]=t.el;const e=await this.jo('title','title screen',this.Bt[1],10);this.de=h.A.rc(e,'p11'),this.we=h.A.rc(e,'p12'),this.ye=h.A.rc(e,'b12'),this.Ae=h.A.rc(e,'q8');const i=await this.jo('config','config',this.Bt[2],15),d=await this.jo('models','3d graphics',this.Bt[5],40),y=await this.jo('textures','textures',this.Bt[6],60);await this.qo(80,'Unpacking textures'),r.A.hc(y),r.A.oc(.8),r.A.lc(20),await this.qo(83,'Unpacking models'),o.A.ac(d),l.A.ac(d),a.A.ac(d),await this.qo(86,'Unpacking config'),s.A.ac(i),n.A.ac(i,!0),await this.qo(100,'Getting ready to start...'),await this.cc()}catch(t){this.Dt=!0,console.error(t)}}};async cc(){const t=document.getElementById('items');if(!t)return;t.innerHTML='',this.sc[1]=await this.nc(`${A.K.lt}/data/src/pack/obj.pack`);const e=document.createElement('input');e.type='text',e.placeholder='::give',e.tabIndex=-1,t.appendChild(e);const i=document.createElement('input');i.type='search',i.placeholder='Search',i.tabIndex=1,i.oninput=()=>{const t=document.querySelector('#itemList');if(!t)return;const e=i.value.toLowerCase().replaceAll(' ','_');for(let i=0;i-1||n.indexOf(e)>-1||r.indexOf(e)>-1||h.indexOf(e)>-1?s.style.display='':s.style.display='none'}},t.appendChild(i);const s=document.createElement('ul');s.id='itemList',s.className='list-group',t.appendChild(s);const h=new Set;for(const[t,e]of this.sc[1]){const e=n.A.get(t);if(null!==e.fc&&null!==e.uc)for(let t=0;t{const t=s.querySelector('.active');t&&(t.className='list-group-item list-group-item-center'),l.className='list-group-item list-group-item-center active',e.value=`::give ${i} 1`};const a=document.createElement('canvas');a.className='icon',a.width=32,a.height=32,l.appendChild(a);const c=document.createElement('p');null===o.name?c.innerText=i:c.innerText=o.name+' - '+i,l.appendChild(c);const f=new y.A(32,32,a.getContext('2d',{willReadFrequently:!0})??d.nl),u=n.A.Yl(t,1e4);f.bind(),r.A.wc(),u.draw(0,0),f.draw(0,0),s.appendChild(l)}}}await(0,m.w)(),(new t).run().then((()=>{})),window.onkeydown=function(t){return!(' '===t.key&&t.target===document.body)},e()}catch(t){e(t)}}),1)},7046:(t,e,i)=>{i.d(e,{A:()=>a});var s=i(1183),n=i(4583),r=i(9234),h=i(9091),o=i(2595),l=i(7854);class a{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,e){const i=new URL(window.location.toString());i.searchParams.set(t,e),window.history.pushState(null,'',i.toString())}yc=0;Ac=[];mc=0;Fo=null;state=0;gc=20;_c=1;Ic=[];Cc=0;Ec=0;vc=[];bc=!0;Tc=!1;Oc=50;hasFocus=!0;Rc=!1;Lc=0;Sc=0;Hl=0;Vl=0;xc=0;Mc=0;kc=0;Dc=[];Nc=[];Fc=0;Bc=0;input=null;Pc=!1;Uc=!1;Gc=!1;time=-1;Wc=0;Yc=0;Hc=0;Vc=0;Kc=0;Xc=0;constructor(t=!1){l.jc.tabIndex=-1,l.nl.fillStyle='black',l.nl.fillRect(0,0,l.jc.width,l.jc.height),this.Tc=t,this.Tc?this.resize(window.innerWidth,window.innerHeight):this.resize(l.jc.width,l.jc.height)}get width(){return l.jc.width}get height(){return l.jc.height}resize=(t,e)=>{l.jc.width=t,l.jc.height=e,this.Fo=new s.A(t,e),n.A.wc()};run=async()=>{l.jc.addEventListener('resize',(()=>{this.Tc&&this.resize(window.innerWidth,window.innerHeight)}),!1),l.jc.onmousedown=this.onmousedown,l.jc.onmouseup=this.onmouseup,l.jc.onmouseenter=this.onmouseenter,l.jc.onmouseleave=this.onmouseleave,l.jc.onmousemove=this.onmousemove,window.onbeforeunload=this.Lo,l.jc.onfocus=this.onfocus,l.jc.onblur=this.onblur,this.zc?(l.jc.ontouchstart=this.ontouchstart,l.jc.ontouchend=this.ontouchend,l.jc.ontouchmove=this.ontouchmove):(l.jc.onkeydown=this.onkeydown,l.jc.onkeyup=this.onkeyup),l.jc.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.zc&&'low'===a.getParameter('detail')&&(this.Oc=30),await this.qo(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.Ic[t]=performance.now();let t,e=0,i=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.Zc();const h=i,o=s;i=300,s=1,t=performance.now();const l=this.Ic[e];if(0===l?(i=h,s=o):t>l&&(i=2560*this.gc/(t-l)|0),i<25?i=25:i>256&&(i=256,s=this.gc-(t-l)/10|0),this.Ic[e]=t,e=(e+1)%10,s>1)for(let t=0;t<10;t++)0!==this.Ic[t]&&(this.Ic[t]+=s);for(s0&&(this.Cc=1e3*i/(256*this.gc)|0);const a=performance.now();if(this.bc&&this.refresh(),await this.draw(),this.vc[this.Ec]=(performance.now()-a)/1e3,this.Ec=(this.Ec+1)%this.vc.length,this.Oc<50){const e=1e3/this.Oc-(performance.now()-t);e>0&&await(0,r.$o)(e)}}-1===this.state&&this.Zc()};Zc=()=>{this.state=-2,this.Lo()};rl=t=>{this.gc=1e3/t|0};qc=t=>{this.Oc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.gc|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};Lo=()=>{};draw=async()=>{};refresh=()=>{};async qo(t,e){const i=this.width,s=this.height;this.bc&&(l.nl.fillStyle='black',l.nl.fillRect(0,0,i,s),this.bc=!1);const n=s/2-18;l.nl.fillStyle='rgb(140, 17, 17)',l.nl.rect((i/2|0)-152,n,304,34),l.nl.fillRect((i/2|0)-150,n+2,3*t,30),l.nl.fillStyle='black',l.nl.fillRect((i/2|0)-150+3*t,n+2,300-3*t,30),l.nl.font='bold 13px helvetica, sans-serif',l.nl.textAlign='center',l.nl.fillStyle='white',l.nl.fillText(e,i/2|0,n+22),await(0,r.$o)(5)}Jc=()=>{let t=-1;return this.Bc!==this.Fc&&(t=this.Nc[this.Fc],this.Fc=this.Fc+1&127),t};get ms(){const t=this.vc.length;let e=0;for(let i=0;ithis.yc&&(this.yc=i),this.Ac[this.mc]=i,this.mc=(this.mc+1)%250,i}get $c(){return this.Ac.reduce(((t,e)=>t+e),0)/250}onkeydown=t=>{const e=t.key;this.Lc=0;const i=h.c[e];if(!i||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${e}`);const s=i.code;let n=i.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Dc[n]=1),n>4&&(this.Nc[this.Bc]=n,this.Bc=this.Bc+1&127),o.A.enabled&&o.A.Qc(n),h.g.includes(e)||t.preventDefault()};onkeyup=t=>{const e=t.key;this.Lc=0;const i=h.c[e];if(!i||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${e}`);const s=i.code;let n=i.ch;n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Dc[n]=0),o.A.enabled&&o.A.tf(n),h.g.includes(e)||t.preventDefault()};onmousedown=t=>{if(this.Pc=!1,(t.clientX>0||t.clientY>0)&&this.ef(t),this.Lc=0,this.Mc=this.Hl,this.kc=this.Vl,this.zc&&!this.if){if(this.sf()||this.nf()||this.rf())return this.xc=1,void(this.Sc=1);t.timeStamp>=this.time+500?(this.xc=2,this.Sc=2):(this.xc=1,this.Sc=1)}else 2===t.button?(this.xc=2,this.Sc=2):(this.xc=1,this.Sc=1);o.A.enabled&&o.A.hf(this.Mc,this.kc,t.buttons)};onmouseup=t=>{this.ef(t),this.Lc=0,this.Sc=0,o.A.enabled&&o.A.lf(t.buttons)};onmouseenter=t=>{this.ef(t),o.A.enabled&&o.A.af()};onmouseleave=t=>{this.ef(t),this.Lc=0,this.Hl=-1,this.Vl=-1,this.Sc=0,this.Mc=-1,this.kc=-1,o.A.enabled&&o.A.cf()};onmousemove=t=>{this.ef(t),this.Lc=0,o.A.enabled&&o.A.ff(this.Hl,this.Vl)};onfocus=t=>{this.hasFocus=!0,this.bc=!0,this.refresh(),o.A.enabled&&o.A.uf()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.df()};ontouchstart=t=>{if(!this.zc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.Pc=!0;const e=t.changedTouches[0],i=0|e.clientX,s=0|e.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:i,clientY:s})),this.Wc=this.Kc=this.Hc=0|e.screenX,this.Yc=this.Xc=this.Vc=0|e.screenY,this.time=t.timeStamp,this.Uc=this.wf(),this.Gc=this.yf()};ontouchend=t=>{if(!this.zc||!this.Pc)return;const e=t.changedTouches[0],i=0|e.clientX,s=0|e.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:i,clientY:s})),this.Kc=0|e.screenX,this.Xc=0|e.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Uc&&!this.wf())return void(this.Pc=!1);if(this.Gc&&!this.yf())return void(this.Pc=!1);if(this.sf()||this.Af()||this.nf()||this.rf()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.nf()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.rf()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.sf()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.Af()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.mf?t.setAttribute('type','password'):t.setAttribute('type',this.rf()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${i}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.mf&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const e=t,i=e.data;null!==i&&'insertText'===e.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:i,code:i}))}),t.onkeydown=t=>{this.mf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.mf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.Pc=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.Wc-this.Kc)>16||Math.abs(this.Yc-this.Xc)>16;n&&!r?(this.Pc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.Sc=0,this.Pc=!1)};ontouchmove=t=>{if(!this.zc||!this.Pc)return;const e=t.changedTouches[0],i=0|e.clientX,s=0|e.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:i,clientY:s})),this.Kc=0|e.screenX,this.Xc=0|e.screenY,this.Uc&&-1===this.Wo()?(this.Hc-this.Kc>0?this.rotate(2):this.Hc-this.Kc<0&&this.rotate(0),this.Vc-this.Xc>0?this.rotate(3):this.Vc-this.Xc<0&&this.rotate(1)):(this.Gc||-1!==this.Wo())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.Hc=this.Kc,this.Vc=this.Xc};get zc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get mf(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get if(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}wf=()=>this.Rc&&this.Hl>=8&&this.Hl<=520&&this.Vl>=11&&this.Vl<=345;sf=()=>this.Rc&&-1===this.Go()&&!this.Po()&&!this.Uo()&&this.Hl>=11&&this.Hl<=506&&this.Vl>=449&&this.Vl<=482;Af=()=>this.Rc&&(this.Po()||this.Uo())&&this.Hl>=11&&this.Hl<=506&&this.Vl>=383&&this.Vl<=482;yf=()=>this.Rc&&this.Hl>=562&&this.Hl<=752&&this.Vl>=231&&this.Vl<=492;nf=()=>!this.Rc&&2===this.Bo()&&this.Hl>=301&&this.Hl<=562&&this.Vl>=262&&this.Vl<=279;rf=()=>!this.Rc&&2===this.Bo()&&this.Hl>=301&&this.Hl<=562&&this.Vl>=279&&this.Vl<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};pf=()=>null!==document.fullscreenElement;ef=t=>{if(this.pf()){const e=t.target.getBoundingClientRect(),i=window.innerHeight/l.jc.height,s=(window.innerWidth-l.jc.width*i)/2;this.Hl=0|this.gf(t.clientX-e.left-s,0,l.jc.width*i,0,789),this.Vl=0|this.gf(t.clientY-e.top,0,l.jc.height*i,0,532)}else{const e=l.jc.getBoundingClientRect(),i=l.jc.width/e.width,s=l.jc.height/e.height;this.Hl=(t.clientX-e.left)*i|0,this.Vl=(t.clientY-e.top)*s|0}this.Hl<0&&(this.Hl=0),this.Vl<0&&(this.Vl=0),this.Hl>789&&(this.Hl=789),this.Vl>532&&(this.Vl=532)};gf=(t,e,i,s,n)=>(t-e)*(n-s)/(i-e)+s}},2595:(t,e,i)=>{i.d(e,{A:()=>n});var s=i(1069);class n{static enabled=!1;static _f=null;static If=null;static Cf=0;static Ef=0;static vf=0;static bf=0;static Tf=0;static Of=()=>{this._f=s.A.Pt(1),this.If=null,this.Cf=performance.now(),this.enabled=!0};static Rf=()=>{this.enabled=!1,this._f=null};static flush=()=>{let t=null;return this.If&&this.enabled&&(t=this.If),this.If=null,t};static stop=()=>{let t=null;return this._f&&this._f.Lf>0&&this.enabled&&(t=this._f),this.Rf(),t};static hf=(t,e,i)=>{if(!(this.enabled&&t>=0&&t<789&&e>=0&&e<532))return;this.Ef++;const s=performance.now();let n=(s-this.Cf)/10|0;n>250&&(n=250),this.Cf=s,this.Sf(5),1===i?this._f?.p1(1):this._f?.p1(2),this._f?.p1(n),this._f?.p3(t+(e<<10))};static lf=t=>{if(!this.enabled)return;this.Ef++;const e=performance.now();let i=(e-this.Cf)/10|0;i>250&&(i=250),this.Cf=e,this.Sf(2),1===t?this._f?.p1(3):this._f?.p1(4),this._f?.p1(i)};static ff=(t,e)=>{if(!(this.enabled&&t>=0&&t<789&&e>=0&&e<532))return;const i=performance.now();if(i-this.vf>=50){this.vf=i,this.Ef++;let s=(i-this.Cf)/10|0;s>250&&(s=250),this.Cf=i,t-this.bf<8&&t-this.bf>=-8&&e-this.Tf<8&&e-this.Tf>=-8?(this.Sf(3),this._f?.p1(5),this._f?.p1(s),this._f?.p1(t+(e-this.Tf+8<<4)+8-this.bf)):t-this.bf<128&&t-this.bf>=-128&&e-this.Tf<128&&e-this.Tf>=-128?(this.Sf(4),this._f?.p1(6),this._f?.p1(s),this._f?.p1(t+128-this.bf),this._f?.p1(e+128-this.Tf)):(this.Sf(5),this._f?.p1(7),this._f?.p1(s),this._f?.p3(t+(e<<10))),this.bf=t,this.Tf=e}};static Qc=t=>{if(!this.enabled)return;this.Ef++;const e=performance.now();let i=(e-this.Cf)/10|0;i>250&&(i=250),this.Cf=e,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.Sf(3),this._f?.p1(8),this._f?.p1(i),this._f?.p1(t)};static tf=t=>{if(!this.enabled)return;this.Ef++;const e=performance.now();let i=(e-this.Cf)/10|0;i>250&&(i=250),this.Cf=e,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.Sf(3),this._f?.p1(9),this._f?.p1(i),this._f?.p1(t)};static uf=()=>{if(!this.enabled)return;this.Ef++;const t=performance.now();let e=(t-this.Cf)/10|0;e>250&&(e=250),this.Cf=t,this.Sf(2),this._f?.p1(10),this._f?.p1(e)};static df=()=>{if(!this.enabled)return;this.Ef++;const t=performance.now();let e=(t-this.Cf)/10|0;e>250&&(e=250),this.Cf=t,this.Sf(2),this._f?.p1(11),this._f?.p1(e)};static af=()=>{if(!this.enabled)return;this.Ef++;const t=performance.now();let e=(t-this.Cf)/10|0;e>250&&(e=250),this.Cf=t,this.Sf(2),this._f?.p1(12),this._f?.p1(e)};static cf=()=>{if(!this.enabled)return;this.Ef++;const t=performance.now();let e=(t-this.Cf)/10|0;e>250&&(e=250),this.Cf=t,this.Sf(2),this._f?.p1(13),this._f?.p1(e)};static Sf=t=>{if(this._f&&this._f.Lf+t>=500){const t=this._f;this._f=s.A.Pt(1),this.If=t}}}},9091:(t,e,i)=>{i.d(e,{c:()=>n,g:()=>s});const s=['F11','F12'],n={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}}},1120:(t,e,i)=>{i.d(e,{A:()=>c});var s=i(1069),n=i(8665),r=i(2679),h=i(2511),o=i(3819),l=i(3867),a=i(8950);class c{static Do=[];static xf=null;static No=null;static kl=0;static Mf=1;static Nl=2;static $l=3;static ta=4;static fa=5;static wa=6;static Ca=7;static kf=1;static Df=2;static Nf=3;static Ff=4;static Bf=5;static ra=6;static ba=1;static Ta=100;static Oa=101;static Ra=200;static Pf=201;static Uf=202;static La=203;static Gf=205;static Wf=300;static Yf=301;static Hf=302;static Vf=303;static Kf=304;static Xf=305;static jf=306;static zf=307;static Zf=308;static qf=309;static Jf=310;static $f=311;static Qf=312;static tu=313;static eu=314;static iu=315;static su=316;static nu=317;static ru=318;static hu=319;static ou=320;static lu=321;static au=322;static cu=323;static Va=324;static Ka=325;static fu=326;static Na=327;static Sa=401;static xa=500;static uu=501;static du=502;static Da=503;static Xa=600;static wu=601;static yu=602;static Au=603;static mu=604;static pu=605;static gu=606;static _u=607;static Iu=608;static Cu=609;static Eu=610;static vu=611;static bu=612;static ja=613;static za=650;static Ja=651;static $a=652;static Qa=653;static tc=654;static Za=655;static ac=(t,e,i)=>{this.xf=new r.A(5e4),this.No=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.Lf+=2;n.Lf0){s.ol=new Uint8Array(r),s.al=new Uint16Array(r);for(let t=0;t0){s.scripts=new l.fi(o,null);for(let t=0;t0){const n=i.lastIndexOf(',');s.Jl[t]=this.Du(e,i.substring(0,n),parseInt(i.substring(n+1),10))}}s.Nu=new l.fi(5,null);for(let t=0;t<5;t++){const e=n.ku;s.Nu[t]=e,0===e.length&&(s.Nu[t]=null)}}if(s.type===c.$l&&(s.fill=1===n.Ru),s.type===c.ta||s.type===c.Mf){s.oa=1===n.Ru;const t=n.Ru;i&&(s.font=i[t]),s.aa=1===n.Ru}if(s.type===c.ta&&(s.text=n.ku,s.sa=n.ku),s.type!==c.Mf&&s.type!==c.$l&&s.type!==c.ta||(s.Ql=n.el),s.type!==c.$l&&s.type!==c.ta||(s.ia=n.el,s.ea=n.el),s.type===c.fa){const t=n.ku;if(t.length>0){const i=t.lastIndexOf(',');s.da=this.Du(e,t.substring(0,i),parseInt(t.substring(i+1),10))}const i=n.ku;if(i.length>0){const t=i.lastIndexOf(',');s.ua=this.Du(e,i.substring(0,t),parseInt(i.substring(t+1),10))}}if(s.type===c.wa){const t=n.Ru;0!==t&&(s.model=this.pa((t-1<<8)+n.Ru));const e=n.Ru;0!==e&&(s.Fu=this.pa((e-1<<8)+n.Ru)),s.gl=n.Ru,0===s.gl?s.gl=-1:s.gl=(s.gl-1<<8)+n.Ru,s._l=n.Ru,0===s._l?s._l=-1:s._l=(s._l-1<<8)+n.Ru,s.zoom=n.Tu,s.ma=n.Tu,s.Ia=n.Tu}if(s.type===c.Ca){s.Pl=new Int32Array(s.width*s.height),s.Ul=new Int32Array(s.width*s.height),s.oa=1===n.Ru;const t=n.Ru;i&&(s.font=i[t]),s.aa=1===n.Ru,s.Ql=n.el,s.Gl=n.Su,s.Wl=n.Su,s.xu=1===n.Ru,s.Nu=new l.fi(5,null);for(let t=0;t<5;t++){const e=n.ku;s.Nu[t]=e,0===e.length&&(s.Nu[t]=null)}}s.na!==c.Df&&s.type!==c.Nl||(s.Bu=n.ku,s.action=n.ku,s.Pu=n.Tu),s.na!==c.kf&&s.na!==c.Ff&&s.na!==c.Bf&&s.na!==c.ra||(s.Uu=n.ku,0===s.Uu.length&&(s.na===c.kf?s.Uu='Ok':s.na===c.Ff||s.na===c.Bf?s.Uu='Select':s.na===c.ra&&(s.Uu='Continue')))}this.xf=null,this.No=null};static Du=(t,e,i)=>{const s=o.A.Gu(e)<<8n|BigInt(i);if(this.xf){const t=this.xf.get(s);if(t)return t}let n;try{n=h.A.rc(t,e,i),this.xf?.put(s,n)}catch(t){return null}return n};static pa=t=>{if(this.No){const e=this.No.get(BigInt(t));if(e)return e}const e=n.A.model(t);return this.No?.put(BigInt(t),e),e};id=-1;Ou=-1;type=-1;na=-1;xl=0;width=0;height=0;Lu=-1;ol=null;al=null;scripts=null;scroll=0;hide=!1;draggable=!1;xu=!1;Mu=!1;Gl=0;Wl=0;Fl=null;Bl=null;Jl=null;Nu=null;fill=!1;oa=!1;font=null;aa=!1;text=null;sa=null;Ql=0;ia=0;ea=0;da=null;ua=null;model=null;Fu=null;gl=-1;_l=-1;zoom=0;ma=0;Ia=0;Bu=null;action=null;Pu=-1;Uu=null;pl=null;Ol=null;Rl=null;x=0;y=0;Dl=0;Pl=null;Ul=null;Cl=0;Il=0;pa(t,e,i){let s=this.model;if(i&&(s=this.Fu),!s)return null;if(-1===t&&-1===e&&!s.Wu)return s;const r=n.A.Yu(s,!0,!0,!1);return-1===t&&-1===e||r.Wa(),-1!==t&&r.Ya(t),-1!==e&&r.Ya(e),r.Ha(64,768,-50,-10,-50,!0),r}Hu(){if(this.Ou===this.id)return this.x;let t=c.Do[this.Ou];if(!t.pl||!t.Ol||!t.Rl)return this.x;let e=t.pl.indexOf(this.id);if(-1===e)return this.x;let i=t.Ol[e];for(;t.Ou!==t.id;){const s=c.Do[t.Ou];s.pl&&s.Ol&&s.Rl&&(e=s.pl.indexOf(t.id),-1!==e&&(i+=s.Ol[e])),t=s}return i}Vu(){if(this.Ou===this.id)return this.y;let t=c.Do[this.Ou];if(!t.pl||!t.Ol||!t.Rl)return this.y;let e=t.pl.indexOf(this.id);if(-1===e)return this.y;let i=t.Rl[e];for(;t.Ou!==t.id;){const s=c.Do[t.Ou];s.pl&&s.Ol&&s.Rl&&(e=s.pl.indexOf(t.id),-1!==e&&(i+=s.Rl[e])),t=s}return i}outline(t){const e=this.Hu(),i=this.Vu();a.A.Ll(e,i,this.width,this.height,t)}move(t,e){if(this.Ou===this.id)return;this.x=0,this.y=0;const i=c.Do[this.Ou];if(i.pl&&i.Ol&&i.Rl){const s=i.pl.indexOf(this.id);-1!==s&&(i.Ol[s]=t,i.Rl[s]=e)}}delete(){if(this.Ou===this.id)return;const t=c.Do[this.Ou];if(t.pl&&t.Ol&&t.Rl){const e=t.pl.indexOf(this.id);-1!==e&&(t.pl.splice(e,1),t.Ol.splice(e,1),t.Rl.splice(e,1))}}}},6333:(t,e,i)=>{i.d(e,{$:()=>s});class s{id;Ku=null;constructor(t){this.id=t}Xu(t){for(;;){const e=t.Ru;if(0===e)break;this.decode(e,t)}return this}}},2164:(t,e,i)=>{i.d(e,{A:()=>r});var s=i(1069),n=i(6333);class r extends n.${static count=0;static Do=[];static ac=t=>{const e=new s.A(t.read('flo.dat'));this.count=e.Tu;for(let t=0;t(i>179&&(e=e/2|0),i>192&&(e=e/2|0),i>217&&(e=e/2|0),i>243&&(e=e/2|0),(t/4<<10)+(e/32<<7)+(i/2|0));static zu=(t,e)=>-1===t?12345678:((e=e*(127&t)/128|0)<2?e=2:e>126&&(e=126),(65408&t)+e);static Zu=(t,e)=>-2===t?12345678:-1===t?(e<0?e=0:e>127&&(e=127),127-e):((e=e*(127&t)/128|0)<2?e=2:e>126&&(e=126),(65408&t)+e);qu=0;texture=-1;Ju=!1;$u=!0;Qu=0;td=0;ed=0;sd=0;nd=0;rd=0;decode(t,e){1===t?(this.qu=e.hd,this.setColor(this.qu)):2===t?this.texture=e.Ru:3===t?this.Ju=!0:5===t?this.$u=!1:6===t?this.Ku=e.ku:console.log('Error unrecognised config code: ',t)}setColor(t){const e=(t>>16&255)/256,i=(t>>8&255)/256,s=(255&t)/256;let n=e;ie&&(h=i),s>h&&(h=s);let o=0,l=0;const a=(n+h)/2;n!==h&&(a<.5&&(l=(h-n)/(h+n)),a>=.5&&(l=(h-n)/(2-h-n)),e===h?o=(i-s)/(h-n):i===h?o=(s-e)/(h-n)+2:s===h&&(o=(e-i)/(h-n)+4)),o/=6,this.Qu=256*o|0,this.td=256*l|0,this.ed=256*a|0,this.td<0?this.td=0:this.td>255&&(this.td=255),this.ed<0?this.ed=0:this.ed>255&&(this.ed=255),this.sd=a>.5?(1-a)*l*512|0:a*l*512|0,this.sd<1&&(this.sd=1),this.nd=o*this.sd|0;let c=this.Qu+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.td+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.ed+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.rd=r.ju(c,f,u)}}},8317:(t,e,i)=>{i.d(e,{A:()=>o});var s=i(1069),n=i(6333),r=i(8665),h=i(3867);class o extends n.${static count=0;static Do=[];static ac=t=>{const e=new s.A(t.read('idk.dat'));this.count=e.Tu;for(let t=0;t=40&&t<50?this.ad[t-40]=e.Tu:t>=50&&t<60?this.fd[t-50]=e.Tu:t>=60&&t<70?this.ld[t-60]=e.Tu:console.log('Error unrecognised config code: ',t)}pa(){if(!this.od)return null;const t=new h.fi(this.od.length,null);for(let e=0;e{i.d(e,{A:()=>c});var s=i(6333),n=i(1069),r=i(2679),h=i(8665),o=i(1023),l=i(6169),a=i(3867);class c extends s.${static count=0;static cache=null;static dd=null;static wd=null;static yd=0;static Ad=new r.A(500);static md=new r.A(30);static ac=t=>{this.dd=new n.A(t.read('loc.dat'));const e=new n.A(t.read('loc.idx'));this.count=e.Tu,this.wd=new Int32Array(this.count);let i=2;for(let t=0;t{if(!this.cache||!this.wd||!this.dd)throw new Error('LocType not loaded!!!');for(let e=0;e<10;e++){const i=this.cache[e];if(i&&i.id===t)return i}this.yd=(this.yd+1)%10;const e=this.cache[this.yd];return this.dd.Lf=this.wd[t],e.id=t,e.reset(),e.Xu(this.dd),e.pd||(e.pd=new Int32Array(1)),-1===e.gd&&e.pd&&(e.active=e.pd.length>0&&e.pd[0]===o.A._d.id,e.Id&&(e.active=!0)),e};static Lo=()=>{this.Ad=null,this.md=null,this.wd=null,this.cache=null,this.dd=null};od=null;pd=null;name=null;Cd=null;ad=null;fd=null;width=1;length=1;Ed=!0;vd=!0;active=!1;gd=-1;bd=!1;Td=!1;$u=!1;gl=-1;Od=!1;Rd=16;Ld=0;Sd=0;Id=null;xd=-1;Md=-1;kd=!1;Dd=!0;Nd=128;Fd=128;Bd=128;Pd=0;Ud=0;Gd=0;Wd=0;Yd=!1;decode(t,e){if(1===t){const t=e.Ru;this.od=new Int32Array(t),this.pd=new Int32Array(t);for(let i=0;i=30&&t<39)this.Id||(this.Id=new a.fi(5,null)),this.Id[t-30]=e.ku,'hidden'===this.Id[t-30]?.toLowerCase()&&(this.Id[t-30]=null);else if(40===t){const t=e.Ru;this.ad=new Uint16Array(t),this.fd=new Uint16Array(t);for(let i=0;i=this.od.length)return null;let d=this.od[a];if(-1===d)return null;const w=this.kd!==e>3;w&&(d+=65536);let y=c.Ad?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.qd(),c.Ad?.put(BigInt(d),y));const A=128!==this.Nd||128!==this.Fd||128!==this.Bd,m=0!==this.Ud||0!==this.Gd||0!==this.Wd;let p=h.A.Yu(y,!this.ad,!this.Od,e===l.A.Jd&&-1===o&&!A&&!m);for(-1!==o&&(p.Wa(),p.Ya(o),p.$d=null,p.Qd=null);e-- >0;)p.tw();if(this.ad&&this.fd)for(let t=0;t{i.d(e,{A:()=>l});var s=i(6333),n=i(1069),r=i(2679),h=i(8665),o=i(3867);class l extends s.${static count=0;static cache=null;static dd=null;static wd=null;static yd=0;static No=new r.A(30);static ac=t=>{this.dd=new n.A(t.read('npc.dat'));const e=new n.A(t.read('npc.idx'));this.count=e.Tu,this.wd=new Int32Array(this.count);let i=2;for(let t=0;t{if(!this.cache||!this.wd||!this.dd)throw new Error('NpcType not loaded!!!');for(let e=0;e<20;e++){const i=this.cache[e];if(i&&i.id===t)return i}this.yd=(this.yd+1)%20;const e=this.cache[this.yd]=new l(t);return this.dd.Lf=this.wd[t],e.Xu(this.dd),e};static Lo=()=>{this.No=null,this.wd=null,this.cache=null,this.dd=null};name=null;Cd=null;size=1;od=null;ld=null;Od=!1;sw=-1;nw=-1;rw=-1;hw=-1;ow=-1;ad=null;fd=null;Id=null;Nd=-1;Fd=-1;Bd=-1;lw=!0;aw=-1;cw=128;fw=128;decode(t,e){if(1===t){const t=e.Ru;this.od=new Uint16Array(t);for(let i=0;i=30&&t<40)this.Id||(this.Id=new o.fi(5,null)),this.Id[t-30]=e.ku,'hidden'===this.Id[t-30]?.toLowerCase()&&(this.Id[t-30]=null);else if(40===t){const t=e.Ru;this.ad=new Uint16Array(t),this.fd=new Uint16Array(t);for(let i=0;i{i.d(e,{A:()=>u});var s=i(6333),n=i(1069),r=i(2511),h=i(2679),o=i(8665),l=i(4583),a=i(8950),c=i(9298),f=i(3867);class u extends s.${static count=0;static cache=null;static dd=null;static wd=null;static yd=0;static mw=!0;static No=new h.A(50);static pw=new h.A(200);static ac=(t,e)=>{this.mw=e,this.dd=new n.A(t.read('obj.dat'));const i=new n.A(t.read('obj.idx'));this.count=i.Tu,this.wd=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.wd||!this.dd)throw new Error('ObjType not loaded!!!');for(let e=0;e<10;e++){const i=this.cache[e];if(i&&i.id===t)return i}this.yd=(this.yd+1)%10;const e=this.cache[this.yd];return this.dd.Lf=this.wd[t],e.id=t,e.reset(),e.Xu(this.dd),-1!==e.dc&&e.gw(),!this.mw&&e.members&&(e.name='Members Object',e.Cd="Login to a members' server to use this object.",e.Id=null,e._w=null),e};static Lo=()=>{this.No=null,this.pw=null,this.wd=null,this.cache=null,this.dd=null};static Yl=(t,e)=>{if(u.pw){let i=u.pw.get(BigInt(t));if(i&&i.Iw!==e&&-1!==i.Iw&&(i.Cw(),i=null),i)return i}let i=u.get(t);if(i.fc||(e=-1),i.fc&&i.uc&&e>1){let t=-1;for(let s=0;s<10;s++)e>=i.uc[s]&&0!==i.uc[s]&&(t=i.fc[s]);-1!==t&&(i=u.get(t))}const s=new r.A(32,32),n=l.A.ya,h=l.A.Aa,o=l.A.Ew,f=a.A.bw,d=a.A.Tw,w=a.A.Ow,y=a.A.left,A=a.A.right,m=a.A.top,p=a.A.bottom;l.A.Rw=!1,a.A.bind(s.bw,32,32),a.A.fillRect(0,0,32,32,c.A.Zl),l.A.wc();const g=i.Lw(1),_=l.A.sin[i.Sw]*i.xw>>16,I=l.A.cos[i.Sw]*i.xw>>16;g._a(0,i.Mw,i.kw,i.Sw,i.Dw,_+(g.iw/2|0)+i.Nw,I+i.Nw);for(let t=31;t>=0;t--)for(let e=31;e>=0;e--)0===s.bw[t+32*e]&&(t>0&&s.bw[t+32*e-1]>1||e>0&&s.bw[t+32*(e-1)]>1||t<31&&s.bw[t+32*e+1]>1||e<31&&s.bw[t+32*(e+1)]>1)&&(s.bw[t+32*e]=1);for(let t=31;t>=0;t--)for(let e=31;e>=0;e--)0===s.bw[t+32*e]&&t>0&&e>0&&s.bw[t+32*(e-1)-1]>0&&(s.bw[t+32*e]=3153952);if(-1!==i.dc){const t=this.Yl(i.Fw,10),e=t.Xl,s=t.Iw;t.Xl=32,t.Iw=32,t.Bw(5,5,22,22),t.Xl=e,t.Iw=s}return u.pw?.put(BigInt(t),s),a.A.bind(f,d,w),a.A.Tl(y,m,A,p),l.A.ya=n,l.A.Aa=h,l.A.Ew=o,l.A.Rw=!0,i.Ea?s.Xl=33:s.Xl=32,s.Iw=e,s};model=0;name=null;Cd=null;ad=null;fd=null;xw=2e3;Sw=0;Mw=0;kw=0;Dw=0;Nw=0;Pw=!1;Uw=-1;Ea=!1;Gw=1;members=!1;Id=null;_w=null;Ww=-1;Yw=-1;Hw=0;Vw=-1;Kw=-1;Xw=0;jw=-1;zw=-1;Zw=-1;qw=-1;Jw=-1;$w=-1;fc=null;uc=null;Fw=-1;dc=-1;decode(t,e){if(1===t)this.model=e.Tu;else if(2===t)this.name=e.ku;else if(3===t)this.Cd=e.ku;else if(4===t)this.xw=e.Tu;else if(5===t)this.Sw=e.Tu;else if(6===t)this.Mw=e.Tu;else if(7===t)this.Dw=e.Su,this.Dw>32767&&(this.Dw-=65536);else if(8===t)this.Nw=e.Su,this.Nw>32767&&(this.Nw-=65536);else if(9===t)this.Pw=!0;else if(10===t)this.Uw=e.Tu;else if(11===t)this.Ea=!0;else if(12===t)this.Gw=e.el;else if(16===t)this.members=!0;else if(23===t)this.Ww=e.Tu,this.Hw=e.Hd;else if(24===t)this.Yw=e.Tu;else if(25===t)this.Vw=e.Tu,this.Xw=e.Hd;else if(26===t)this.Kw=e.Tu;else if(t>=30&&t<35)this.Id||(this.Id=new f.fi(5,null)),this.Id[t-30]=e.ku,'hidden'===this.Id[t-30]?.toLowerCase()&&(this.Id[t-30]=null);else if(t>=35&&t<40)this._w||(this._w=new f.fi(5,null)),this._w[t-35]=e.ku;else if(40===t){const t=e.Ru;this.ad=new Uint16Array(t),this.fd=new Uint16Array(t);for(let i=0;i=100&&t<110&&(this.fc&&this.uc||(this.fc=new Uint16Array(10),this.uc=new Uint16Array(10)),this.fc[t-100]=e.Tu,this.uc[t-100]=e.Tu)}Qw(t){let e=this.Ww;if(1===t&&(e=this.Vw),-1===e)return null;let i=this.Yw,s=this.jw;1===t&&(i=this.Kw,s=this.zw);let n=o.A.model(e);if(-1!==i){const t=o.A.model(i);if(-1===s){const e=[n,t];n=o.A.Fa(e,2)}else{const e=[n,t,o.A.model(s)];n=o.A.Fa(e,3)}}if(0===t&&0!==this.Hw&&n.translate(this.Hw,0,0),1===t&&0!==this.Xw&&n.translate(this.Xw,0,0),this.ad&&this.fd)for(let t=0;t1){let e=-1;for(let i=0;i<10;i++)t>=this.uc[i]&&0!==this.uc[i]&&(e=this.fc[i]);if(-1!==e)return u.get(e).Lw(1)}if(u.No){const t=u.No.get(BigInt(this.id));if(t)return t}const e=o.A.model(this.model);if(this.ad&&this.fd)for(let t=0;t{i.d(e,{A:()=>h});var s=i(6333),n=i(1069),r=i(6730);class h extends s.${static count=0;static Do=[];static ac=t=>{const e=new n.A(t.read('seq.dat'));this.count=e.Tu;for(let t=0;t{i.d(e,{A:()=>l});var s=i(6333),n=i(1069),r=i(1312),h=i(8665),o=i(2679);class l extends s.${static count=0;static Do=[];static No=new o.A(30);static ac=t=>{const e=new n.A(t.read('spotanim.dat'));this.count=e.Tu;for(let t=0;t=40&&t<50?this.ad[t-40]=e.Tu:t>=50&&t<60?this.fd[t-50]=e.Tu:console.log('Error unrecognised spotanim config code: ',t)}pa(){let t=l.No?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let e=0;e<6;e++)0!==this.ad[0]&&t.Ba(this.ad[e],this.fd[e]);return l.No?.put(BigInt(this.id),t),t}}},3764:(t,e,i)=>{i.d(e,{A:()=>r});var s=i(6333),n=i(1069);class r extends s.${static count=0;static Do=[];static oy=[];static ly=0;static ac=t=>{const e=new n.A(t.read('varp.dat'));this.count=e.Tu;for(let t=0;t{i.d(e,{A:()=>s});class s{static OPEN=0;static py=1;static gy=2;static _y=4;static Iy=8;static Cy=s.py<<4;static Ey=s.gy<<4;static vy=s._y<<4;static by=s.Iy<<4;static Ty=256;static Oy=512;static Ry=1024;static Ly=2048;static Sy=4096;static xy=s.Oy<<4;static My=s.Ry<<4;static ky=s.Ly<<4;static Dy=s.Sy<<4;static Ny=s.Ty<<9;static Fy=524288;static By=2097152;static Py=s.By|s.Fy;static Uy=s.Ty|s.Py;static Gy=s.gy|s.Uy;static Wy=s.Iy|s.Uy;static Yy=s.gy|s._y|s.Wy;static Hy=s.Ey|s.Uy;static Vy=s.Iy|s.Cy|s.Hy;static Ky=s.by|s.Uy;static Xy=s.py|s.gy|s.Ky;static jy=s.Ey|s.vy|s.Ky;static zy=16777215}},670:(t,e,i)=>{i.d(e,{A:()=>o});var s=i(9456),n=i(6169),r=i(1023),h=i(4909);class o{static Dr=4;static jr=104;static index=(t,e)=>t*o.jr+e;offsetX;Zy;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Zy=0,this.sizeX=o.jr,this.sizeZ=o.jr,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,e-this.Zy)]|=s.A.By};Jy=(t,e)=>{this.flags[o.index(t-this.offsetX,e-this.Zy)]&=~s.A.By};$y=(t,e,i,r,h,o)=>{let l=s.A.Ty;o&&(l|=s.A.Ny);const a=t-this.offsetX,c=e-this.Zy;if(h===n.A.Qy||h===n.A.tA){const t=i;i=r,r=t}for(let t=a;t=0&&t=0&&e{let l=s.A.Ty;o&&(l|=s.A.Ny);const a=t-this.offsetX,c=e-this.Zy;if(h===n.A.Qy||h===n.A.tA){const t=i;i=r,r=t}for(let t=a;t=0&&t=0&&e{const l=t-this.offsetX,a=e-this.Zy,c=o?s.A.Dy:s.A.by,f=o?s.A.Sy:s.A.Iy,u=o?s.A.Ry:s.A.gy,d=o?s.A.My:s.A.Ey,w=o?s.A.Oy:s.A.py,y=o?s.A.xy:s.A.Cy,A=o?s.A.Ly:s.A._y,m=o?s.A.ky:s.A.vy;i===r.A.sA.id?h===n.A.Jd?(this.add(l,a,c),this.add(l-1,a,f)):h===n.A.Qy?(this.add(l,a,u),this.add(l,a+1,d)):h===n.A.nA?(this.add(l,a,f),this.add(l+1,a,c)):h===n.A.tA&&(this.add(l,a,d),this.add(l,a-1,u)):i===r.A.rA.id||i===r.A.hA.id?h===n.A.Jd?(this.add(l,a,w),this.add(l-1,a+1,y)):h===n.A.Qy?(this.add(l,a,A),this.add(l+1,a+1,m)):h===n.A.nA?(this.add(l,a,y),this.add(l+1,a-1,w)):h===n.A.tA&&(this.add(l,a,m),this.add(l-1,a-1,A)):i===r.A.oA.id&&(h===n.A.Jd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):h===n.A.Qy?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):h===n.A.nA?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):h===n.A.tA&&(this.add(l,a,d|c),this.add(l,a-1,u),this.add(l-1,a,f))),o&&this.iA(t,e,i,h,!1)};lA=(t,e,i,h,o)=>{const l=t-this.offsetX,a=e-this.Zy,c=o?s.A.Dy:s.A.by,f=o?s.A.Sy:s.A.Iy,u=o?s.A.Ry:s.A.gy,d=o?s.A.My:s.A.Ey,w=o?s.A.Oy:s.A.py,y=o?s.A.xy:s.A.Cy,A=o?s.A.Ly:s.A._y,m=o?s.A.ky:s.A.vy;i===r.A.sA.id?h===n.A.Jd?(this.remove(l,a,c),this.remove(l-1,a,f)):h===n.A.Qy?(this.remove(l,a,u),this.remove(l,a+1,d)):h===n.A.nA?(this.remove(l,a,f),this.remove(l+1,a,c)):h===n.A.tA&&(this.remove(l,a,d),this.remove(l,a-1,u)):i===r.A.rA.id||i===r.A.hA.id?h===n.A.Jd?(this.remove(l,a,w),this.remove(l-1,a+1,y)):h===n.A.Qy?(this.remove(l,a,A),this.remove(l+1,a+1,m)):h===n.A.nA?(this.remove(l,a,y),this.remove(l+1,a-1,w)):h===n.A.tA&&(this.remove(l,a,m),this.remove(l-1,a-1,A)):i===r.A.oA.id&&(h===n.A.Jd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):h===n.A.Qy?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):h===n.A.nA?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):h===n.A.tA&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.lA(t,e,i,h,!1)};aA=(t,e,i,h,l,a)=>{if(t===i&&e===h)return!0;const c=t-this.offsetX,f=e-this.Zy,u=i-this.offsetX,d=h-this.Zy,w=o.index(c,f);if(l===r.A.sA.id){if(a===n.A.Jd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Hy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Gy)===s.A.OPEN)return!0}else if(a===n.A.Qy){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Wy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Ky)===s.A.OPEN)return!0}else if(a===n.A.nA){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Hy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Gy)===s.A.OPEN)return!0}else if(a===n.A.tA){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Wy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Ky)===s.A.OPEN)return!0}}else if(l===r.A.oA.id){if(a===n.A.Jd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Ky)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Gy)===s.A.OPEN)return!0}else if(a===n.A.Qy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Wy)===s.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Gy)===s.A.OPEN)return!0}else if(a===n.A.nA){if(c===u-1&&f===d&&(this.flags[w]&s.A.Wy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Hy)===s.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(a===n.A.tA){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Hy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Ky)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===r.A.cA.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.Ey)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Iy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}return!1};fA=(t,e,i,h,l,a)=>{if(t===i&&e===h)return!0;const c=t-this.offsetX,f=e-this.Zy,u=i-this.offsetX,d=h-this.Zy,w=o.index(c,f);if(l===r.A.uA.id||l===r.A.dA.id){if(l===r.A.dA.id&&(a=a+2&3),a===n.A.Jd){if(c===u+1&&f===d&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0}else if(a===n.A.Qy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Iy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0}else if(a===n.A.nA){if(c===u-1&&f===d&&(this.flags[w]&s.A.Iy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ey)===s.A.OPEN)return!0}else if(a===n.A.tA){if(c===u+1&&f===d&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ey)===s.A.OPEN)return!0}}else if(l===r.A.wA.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.Ey)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Iy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.by)===s.A.OPEN)return!0}return!1};yA=(t,e,i,n,r,l,a)=>{const c=i+r-1,f=n+l-1,u=o.index(t-this.offsetX,e-this.Zy);return t>=i&&t<=c&&e>=n&&e<=f||(t===i-1&&e>=n&&e<=f&&(this.flags[u]&s.A.Iy)===s.A.OPEN&&(a&h.A.Jd)===s.A.OPEN||(t===c+1&&e>=n&&e<=f&&(this.flags[u]&s.A.by)===s.A.OPEN&&(a&h.A.nA)===s.A.OPEN||(e===n-1&&t>=i&&t<=c&&(this.flags[u]&s.A.gy)===s.A.OPEN&&(a&h.A.tA)===s.A.OPEN||e===f+1&&t>=i&&t<=c&&(this.flags[u]&s.A.Ey)===s.A.OPEN&&(a&h.A.Qy)===s.A.OPEN)))};add=(t,e,i)=>{this.flags[o.index(t,e)]|=i};remove=(t,e,i)=>{this.flags[o.index(t,e)]&=s.A.zy-i}}},4909:(t,e,i)=>{i.d(e,{A:()=>s});class s{static Qy=1;static nA=2;static tA=4;static Jd=8}},6169:(t,e,i)=>{i.d(e,{A:()=>s});class s{static Jd=0;static Qy=1;static nA=2;static tA=3}},5599:(t,e,i)=>{i.d(e,{A:()=>s});class s{static AA=0;static mA=1;static pA=2;static gA=3}},1023:(t,e,i)=>{i.d(e,{A:()=>n});var s=i(5599);class n{static sA=new n(0,s.A.AA);static rA=new n(1,s.A.AA);static oA=new n(2,s.A.AA);static hA=new n(3,s.A.AA);static _A=new n(4,s.A.mA);static IA=new n(5,s.A.mA);static uA=new n(6,s.A.mA);static dA=new n(7,s.A.mA);static wA=new n(8,s.A.mA);static cA=new n(9,s.A.pA);static _d=new n(10,s.A.pA);static CA=new n(11,s.A.pA);static EA=new n(12,s.A.pA);static vA=new n(13,s.A.pA);static bA=new n(14,s.A.pA);static TA=new n(15,s.A.pA);static OA=new n(16,s.A.pA);static RA=new n(17,s.A.pA);static LA=new n(18,s.A.pA);static SA=new n(19,s.A.pA);static xA=new n(20,s.A.pA);static MA=new n(21,s.A.pA);static gA=new n(22,s.A.gA);static values(){return[this.sA,this.rA,this.RA,this.TA,this.oA,this.bA,this.cA,this.hA,this.gA,this.EA,this.CA,this.uA,this.xA,this._d,this.IA,this.vA,this.dA,this._A,this.OA,this.wA,this.SA,this.MA,this.LA]}static of(t){const e=this.values();for(let i=0;i{i.d(e,{A:()=>A});var s=i(670),n=i(2164),r=i(1069),h=i(4583),o=i(3045),l=i(5637),a=i(4197),c=i(1312),f=i(1023),u=i(6169),d=i(9298),w=i(5518),y=i(3867);class A{static kA=Int8Array.of(1,2,4,8);static DA=Uint8Array.of(16,32,64,128);static NA=Int8Array.of(1,0,-1,0);static FA=Int8Array.of(0,-1,0,1);static BA=(17*Math.random()|0)-8;static PA=(33*Math.random()|0)-16;static it=!0;static UA=0;static GA=!1;static WA=(t,e)=>{let i=this.YA(t+45365,e+91923,4)+(this.YA(t+10294,e+37821,2)-128>>1)+(this.YA(t,e,1)-128>>2)-128;return i=35+(.3*i|0),i<10?i=10:i>60&&(i=60),i};static YA=(t,e,i)=>{const s=t/i|0,n=t&i-1,r=e/i|0,h=e&i-1,o=this.HA(s,r),l=this.HA(s+1,r),a=this.HA(s,r+1),c=this.HA(s+1,r+1),f=this.VA(o,l,n,i),u=this.VA(a,c,n,i);return this.VA(f,u,h,i)};static VA=(t,e,i,s)=>{const n=65536-h.A.cos[1024*i/s|0]>>1;return(t*(65536-n)>>16)+(e*n>>16)};static HA=(t,e)=>((this.KA(t-1,e-1)+this.KA(t+1,e-1)+this.KA(t-1,e+1)+this.KA(t+1,e+1))/16|0)+((this.KA(t-1,e)+this.KA(t+1,e)+this.KA(t,e-1)+this.KA(t,e+1))/8|0)+(this.KA(t,e)/4|0);static KA=(t,e)=>{const i=t+57*e,s=BigInt(i<<13^i);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static $y=(t,e,i,s,n,r,h,o,d,w,y)=>{const m=n[y][e][i],p=n[y][e+1][i],g=n[y][e+1][i+1],_=n[y][e][i+1],I=m+p+g+_>>2,C=l.A.get(o);let E=e+(i<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A.gA.id)s?.XA(C.pa(f.A.gA.id,w,m,p,g,_,-1),t,e,i,I,E,v),C.Ed&&C.active&&h?.qy(e,i),-1!==C.gl&&r.jA(new a.A(o,t,3,e,i,c.A.Do[C.gl],!0));else if(d===f.A._d.id||d===f.A.CA.id){const n=C.pa(f.A._d.id,w,m,p,g,_,-1);if(n){let r,h,o=0;d===f.A.CA.id&&(o+=256),w===u.A.Qy||w===u.A.tA?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.$y(t,e,i,I,n,null,E,v,r,h,o)}C.Ed&&h?.$y(e,i,C.width,C.length,w,C.vd),-1!==C.gl&&r.jA(new a.A(o,t,2,e,i,c.A.Do[C.gl],!0))}else if(d>=f.A.EA.id)s?.$y(t,e,i,I,C.pa(d,w,m,p,g,_,-1),null,E,v,1,1,0),C.Ed&&h?.$y(e,i,C.width,C.length,w,C.vd),-1!==C.gl&&r.jA(new a.A(o,t,2,e,i,c.A.Do[C.gl],!0));else if(d===f.A.sA.id)s?.iA(t,e,i,I,A.kA[w],0,C.pa(f.A.sA.id,w,m,p,g,_,-1),null,E,v),C.Ed&&h?.iA(e,i,d,w,C.vd),-1!==C.gl&&r.jA(new a.A(o,t,0,e,i,c.A.Do[C.gl],!0));else if(d===f.A.rA.id)s?.iA(t,e,i,I,A.DA[w],0,C.pa(f.A.rA.id,w,m,p,g,_,-1),null,E,v),C.Ed&&h?.iA(e,i,d,w,C.vd),-1!==C.gl&&r.jA(new a.A(o,t,0,e,i,c.A.Do[C.gl],!0));else if(d===f.A.oA.id){const n=w+1&3;s?.iA(t,e,i,I,A.kA[w],A.kA[n],C.pa(f.A.oA.id,w+4,m,p,g,_,-1),C.pa(f.A.oA.id,n,m,p,g,_,-1),E,v),C.Ed&&h?.iA(e,i,d,w,C.vd),-1!==C.gl&&r.jA(new a.A(o,t,0,e,i,c.A.Do[C.gl],!0))}else if(d===f.A.hA.id)s?.iA(t,e,i,I,A.DA[w],0,C.pa(f.A.hA.id,w,m,p,g,_,-1),null,E,v),C.Ed&&h?.iA(e,i,d,w,C.vd),-1!==C.gl&&r.jA(new a.A(o,t,0,e,i,c.A.Do[C.gl],!0));else if(d===f.A.cA.id)s?.$y(t,e,i,I,C.pa(d,w,m,p,g,_,-1),null,E,v,1,1,0),C.Ed&&h?.$y(e,i,C.width,C.length,w,C.vd),-1!==C.gl&&r.jA(new a.A(o,t,2,e,i,c.A.Do[C.gl],!0));else if(d===f.A._A.id)s?.zA(t,e,i,I,0,0,E,C.pa(f.A._A.id,u.A.Jd,m,p,g,_,-1),v,512*w,A.kA[w]),-1!==C.gl&&r.jA(new a.A(o,t,1,e,i,c.A.Do[C.gl],!0));else if(d===f.A.IA.id){let n=16;if(s){const r=s.ZA(t,e,i);r>0&&(n=l.A.get(r>>14&32767).Rd)}s?.zA(t,e,i,I,A.NA[w]*n,A.FA[w]*n,E,C.pa(f.A._A.id,u.A.Jd,m,p,g,_,-1),v,512*w,A.kA[w]),-1!==C.gl&&r.jA(new a.A(o,t,1,e,i,c.A.Do[C.gl],!0))}else d===f.A.uA.id?(s?.zA(t,e,i,I,0,0,E,C.pa(f.A._A.id,u.A.Jd,m,p,g,_,-1),v,w,256),-1!==C.gl&&r.jA(new a.A(o,t,1,e,i,c.A.Do[C.gl],!0))):d===f.A.dA.id?(s?.zA(t,e,i,I,0,0,E,C.pa(f.A._A.id,u.A.Jd,m,p,g,_,-1),v,w,512),-1!==C.gl&&r.jA(new a.A(o,t,1,e,i,c.A.Do[C.gl],!0))):d===f.A.wA.id&&(s?.zA(t,e,i,I,0,0,E,C.pa(f.A._A.id,u.A.Jd,m,p,g,_,-1),v,w,768),-1!==C.gl&&r.jA(new a.A(o,t,1,e,i,c.A.Do[C.gl],!0)))};qA;JA;Hr;Vr;$A;QA;tm;im;sm;nm;rm;hm;om;lm;am;fm;constructor(t,e,i,n){this.qA=t,this.JA=e,this.Hr=i,this.Vr=n,this.$A=new y.um(s.A.Dr,t,e),this.QA=new y.um(s.A.Dr,t,e),this.tm=new y.um(s.A.Dr,t,e),this.im=new y.um(s.A.Dr,t,e),this.fm=new y.dm(s.A.Dr,t+1,e+1),this.sm=new y.um(s.A.Dr,t+1,e+1),this.nm=new y.Xr(t+1,e+1),this.rm=new Int32Array(e),this.hm=new Int32Array(e),this.om=new Int32Array(e),this.lm=new Int32Array(e),this.am=new Int32Array(e)}wm=(t,e)=>{for(let t=0;t=0&&e[s]?.qy(i,n)}A.BA+=(5*Math.random()|0)-2,A.BA<-8?A.BA=-8:A.BA>8&&(A.BA=8),A.PA+=(5*Math.random()|0)-2,A.PA<-16?A.PA=-16:A.PA>16&&(A.PA=16);for(let e=0;e>8;for(let t=1;t>2)+(i[n+1][t]>>3)+(i[n][t-1]>>2)+(i[n][t+1]>>3)+(i[n][t]>>1);this.nm[n][t]=u-d}for(let t=0;t=0&&s0){const e=n.A.Do[i-1];this.rm[t]+=e.nd,this.hm[t]+=e.td,this.om[t]+=e.ed,this.lm[t]+=e.sd,r=this.am[t]++}}const h=i-5;if(h>=0&&h0){const e=n.A.Do[i-1];this.rm[t]-=e.nd,this.hm[t]-=e.td,this.om[t]-=e.ed,this.lm[t]-=e.sd,r=this.am[t]--}}}if(i>=1&&i=0&&f=0&&y=1&&c0||y>0){const m=this.Hr[e][i][c],p=this.Hr[e][i+1][c],g=this.Hr[e][i+1][c+1],_=this.Hr[e][i][c+1],I=this.nm[i][c],C=this.nm[i+1][c],E=this.nm[i+1][c+1],v=this.nm[i][c+1];let b=-1,T=-1;if(f>0){const t=256*s/l|0,e=r/a|0;let i=o/a|0;b=n.A.ju(t,e,i);const h=t+A.BA&255;i+=A.PA,i<0?i=0:i>255&&(i=255),T=n.A.ju(h,e,i)}if(e>0){let t=0!==f||this.tm[e][i][c]===w.A.Am;y>0&&!n.A.Do[y-1].$u&&(t=!1),t&&m===p&&m===g&&m===_&&(this.fm[e][i][c]|=2340)}let O=0;if(-1!==b&&(O=h.A.palette[n.A.zu(T,96)]),0===y)t?.pm(e,i,c,w.A.Am,u.A.Jd,-1,m,p,g,_,n.A.zu(b,I),n.A.zu(b,C),n.A.zu(b,E),n.A.zu(b,v),d.A.Zl,d.A.Zl,d.A.Zl,d.A.Zl,O,d.A.Zl);else{const s=this.tm[e][i][c]+1,r=this.im[e][i][c],o=n.A.Do[y-1];let l,a,f=o.texture;f>=0?(a=h.A.gm(f),l=-1):o.qu===d.A._m?(a=0,l=-2,f=-1):(l=n.A.ju(o.Qu,o.td,o.ed),a=h.A.palette[n.A.Zu(o.rd,96)]),t?.pm(e,i,c,s,r,f,m,p,g,_,n.A.zu(b,I),n.A.zu(b,C),n.A.zu(b,E),n.A.zu(b,v),n.A.Zu(l,I),n.A.Zu(l,C),n.A.Zu(l,E),n.A.Zu(l,v),O,a)}}}}}}for(let i=1;i0&&(t<<=3,e<<=3,i<<=3);for(let s=0;s<=n;s++)for(let r=0;r<=this.JA;r++)for(let h=0;h<=this.qA;h++){if(this.fm[s][h][r]&t){let e=r,i=r,l=s,a=s;for(;e>0&&this.fm[s][h][e-1]&t;)e--;for(;i0;){for(let s=e;s<=i;s++)if(!(this.fm[l-1][h][s]&t))break t;l--}t:for(;a=8){const s=this.Hr[a][h][e]-240,r=this.Hr[l][h][e];o.A.vm(n,1,128*h,s,128*e,128*h,r,128*i+128);for(let s=l;s<=a;s++)for(let n=e;n<=i;n++)this.fm[s][h][n]&=~t}}if(this.fm[s][h][r]&e){let t=h,i=h,l=s,a=s;for(;t>0&&this.fm[s][t-1][r]&e;)t--;for(;i0;){for(let s=t;s<=i;s++)if(!(this.fm[l-1][s][r]&e))break t;l--}t:for(;a=8){const s=this.Hr[a][t][r]-240,h=this.Hr[l][t][r];o.A.vm(n,2,128*t,s,128*r,128*i+128,h,128*r);for(let s=l;s<=a;s++)for(let n=t;n<=i;n++)this.fm[s][n][r]&=~e}}if(this.fm[s][h][r]&i){let t=h,e=h,l=r,a=r;for(;l>0&&this.fm[s][h][l-1]&i;)l--;for(;a0;){for(let e=l;e<=a;e++)if(!(this.fm[s][t-1][e]&i))break t;t--}t:for(;e=4){const r=this.Hr[s][t][l];o.A.vm(n,4,128*t,r,128*l,128*e+128,r,128*a+128);for(let n=t;n<=e;n++)for(let t=l;t<=a;t++)this.fm[s][n][t]&=~i}}}}}};bm=(t,e,i,r)=>{let h=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new r.A(new Uint8Array(h));for(let r=0;r=0&&a=0&&c>24,this.im[r][a][c]=(f-2&3)<<24>>24):f<=81?this.Vr[r][a][c]=f-49<<24>>24:this.$A[r][a][c]=f-81<<24>>24}else for(;f=o.Ru,0!==f;){if(1===f){o.Ru;break}f<=49&&o.Ru}}};Om=(t,e,i,n,h,o)=>{const l=new r.A(new Uint8Array(n));let a=-1;for(;;){const n=l.Rm;if(0===n)return;a+=n;let r=0;for(;;){const n=l.Rm;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=l.Ru,w=d>>2,y=3&d,A=f+h,m=c+o;if(A>0&&m>0&&A=0&&(n=i[s]),this.$y(u,A,m,t,e,n,a,w,y)}}}};$y=(t,e,i,s,n,r,h,o,d)=>{if(A.it){if(16&this.Vr[t][e][i])return;if(this.ym(t,e,i)!==A.UA)return}const w=this.Hr[t][e][i],y=this.Hr[t][e+1][i],m=this.Hr[t][e+1][i+1],p=this.Hr[t][e][i+1],g=w+y+m+p>>2,_=l.A.get(h);let I=e+(i<<7)+(h<<14)+1073741824|0;_.active||(I+=-2147483648),I|=0;const C=(d<<6)+o<<24>>24;if(o===f.A.gA.id)(!A.it||_.active||_.Yd)&&(s?.XA(_.pa(f.A.gA.id,d,w,y,m,p,-1),t,e,i,g,I,C),_.Ed&&_.active&&r?.qy(e,i),-1!==_.gl&&n.jA(new a.A(h,t,3,e,i,c.A.Do[_.gl],!0)));else if(o===f.A._d.id||o===f.A.CA.id){const l=_.pa(f.A._d.id,d,w,y,m,p,-1);if(l){let n,r,h=0;if(o===f.A.CA.id&&(h+=256),d===u.A.Qy||d===u.A.tA?(n=_.length,r=_.width):(n=_.width,r=_.length),s?.$y(t,e,i,g,l,null,I,C,n,r,h)&&_.Dd)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=l.Lm/4|0;r>30&&(r=30),r>this.sm[t][e+s][i+n]&&(this.sm[t][e+s][i+n]=r<<24>>24)}}_.Ed&&r?.$y(e,i,_.width,_.length,d,_.vd),-1!==_.gl&&n.jA(new a.A(h,t,2,e,i,c.A.Do[_.gl],!0))}else if(o>=f.A.EA.id)s?.$y(t,e,i,g,_.pa(o,d,w,y,m,p,-1),null,I,C,1,1,0),o>=f.A.EA.id&&o<=f.A.RA.id&&o!==f.A.vA.id&&t>0&&(this.fm[t][e][i]|=2340),_.Ed&&r?.$y(e,i,_.width,_.length,d,_.vd),-1!==_.gl&&n.jA(new a.A(h,t,2,e,i,c.A.Do[_.gl],!0));else if(o===f.A.sA.id)s?.iA(t,e,i,g,A.kA[d],0,_.pa(f.A.sA.id,d,w,y,m,p,-1),null,I,C),d===u.A.Jd?(_.Dd&&(this.sm[t][e][i]=50,this.sm[t][e][i+1]=50),_.$u&&(this.fm[t][e][i]|=585)):d===u.A.Qy?(_.Dd&&(this.sm[t][e][i+1]=50,this.sm[t][e+1][i+1]=50),_.$u&&(this.fm[t][e][i+1]|=1170)):d===u.A.nA?(_.Dd&&(this.sm[t][e+1][i]=50,this.sm[t][e+1][i+1]=50),_.$u&&(this.fm[t][e+1][i]|=585)):d===u.A.tA&&(_.Dd&&(this.sm[t][e][i]=50,this.sm[t][e+1][i]=50),_.$u&&(this.fm[t][e][i]|=1170)),_.Ed&&r?.iA(e,i,o,d,_.vd),-1!==_.gl&&n.jA(new a.A(h,t,0,e,i,c.A.Do[_.gl],!0)),16!==_.Rd&&s?.Sm(t,e,i,_.Rd);else if(o===f.A.rA.id)s?.iA(t,e,i,g,A.DA[d],0,_.pa(f.A.rA.id,d,w,y,m,p,-1),null,I,C),_.Dd&&(d===u.A.Jd?this.sm[t][e][i+1]=50:d===u.A.Qy?this.sm[t][e+1][i+1]=50:d===u.A.nA?this.sm[t][e+1][i]=50:d===u.A.tA&&(this.sm[t][e][i]=50)),_.Ed&&r?.iA(e,i,o,d,_.vd),-1!==_.gl&&n.jA(new a.A(h,t,0,e,i,c.A.Do[_.gl],!0));else if(o===f.A.oA.id){const l=d+1&3;s?.iA(t,e,i,g,A.kA[d],A.kA[l],_.pa(f.A.oA.id,d+4,w,y,m,p,-1),_.pa(f.A.oA.id,l,w,y,m,p,-1),I,C),_.$u&&(d===u.A.Jd?(this.fm[t][e][i]|=265,this.fm[t][e][i+1]|=1170):d===u.A.Qy?(this.fm[t][e][i+1]|=1170,this.fm[t][e+1][i]|=585):d===u.A.nA?(this.fm[t][e+1][i]|=585,this.fm[t][e][i]|=1170):d===u.A.tA&&(this.fm[t][e][i]|=1170,this.fm[t][e][i]|=585)),_.Ed&&r?.iA(e,i,o,d,_.vd),-1!==_.gl&&n.jA(new a.A(h,t,0,e,i,c.A.Do[_.gl],!0)),16!==_.Rd&&s?.Sm(t,e,i,_.Rd)}else if(o===f.A.hA.id)s?.iA(t,e,i,g,A.DA[d],0,_.pa(f.A.hA.id,d,w,y,m,p,-1),null,I,C),_.Dd&&(d===u.A.Jd?this.sm[t][e][i+1]=50:d===u.A.Qy?this.sm[t][e+1][i+1]=50:d===u.A.nA?this.sm[t][e+1][i]=50:d===u.A.tA&&(this.sm[t][e][i]=50)),_.Ed&&r?.iA(e,i,o,d,_.vd),-1!==_.gl&&n.jA(new a.A(h,t,0,e,i,c.A.Do[_.gl],!0));else if(o===f.A.cA.id)s?.$y(t,e,i,g,_.pa(o,d,w,y,m,p,-1),null,I,C,1,1,0),_.Ed&&r?.$y(e,i,_.width,_.length,d,_.vd),-1!==_.gl&&n.jA(new a.A(h,t,2,e,i,c.A.Do[_.gl],!0));else if(o===f.A._A.id)s?.zA(t,e,i,g,0,0,I,_.pa(f.A._A.id,u.A.Jd,w,y,m,p,-1),C,512*d,A.kA[d]),-1!==_.gl&&n.jA(new a.A(h,t,1,e,i,c.A.Do[_.gl],!0));else if(o===f.A.IA.id){let r=16;if(s){const n=s.ZA(t,e,i);n>0&&(r=l.A.get(n>>14&32767).Rd)}s?.zA(t,e,i,g,A.NA[d]*r,A.FA[d]*r,I,_.pa(f.A._A.id,u.A.Jd,w,y,m,p,-1),C,512*d,A.kA[d]),-1!==_.gl&&n.jA(new a.A(h,t,1,e,i,c.A.Do[_.gl],!0))}else o===f.A.uA.id?(s?.zA(t,e,i,g,0,0,I,_.pa(f.A._A.id,u.A.Jd,w,y,m,p,-1),C,d,256),-1!==_.gl&&n.jA(new a.A(h,t,1,e,i,c.A.Do[_.gl],!0))):o===f.A.dA.id?(s?.zA(t,e,i,g,0,0,I,_.pa(f.A._A.id,u.A.Jd,w,y,m,p,-1),C,d,512),-1!==_.gl&&n.jA(new a.A(h,t,1,e,i,c.A.Do[_.gl],!0))):o===f.A.wA.id&&(s?.zA(t,e,i,g,0,0,I,_.pa(f.A._A.id,u.A.Jd,w,y,m,p,-1),C,d,768),-1!==_.gl&&n.jA(new a.A(h,t,1,e,i,c.A.Do[_.gl],!0)))};ym=(t,e,i)=>8&this.Vr[t][e][i]?0:t<=0||!(2&this.Vr[1][e][i])?t:t-1}},3045:(t,e,i)=>{i.d(e,{A:()=>g});var s=i(4583),n=i(1161),r=i(3795),h=i(8256),o=i(670),l=i(9222),a=i(6855),c=i(7441),f=i(6666),u=i(5748),d=i(3479),w=i(8950),y=i(2771),A=i(5518),m=i(6169),p=i(3867);class g{static xm=new p.Mm(8,32,51,51,!1);static km=new p.fi(100,null);static Dm=new Int32Array(o.A.Dr);static Nm=new p.Fm(o.A.Dr,500,null);static Bm=new p.fi(500,null);static Pm=new f.A;static Um=0;static Gm=0;static Wm=0;static Ym=0;static Hm=0;static Vm=0;static Km=0;static Xm=0;static jm=0;static zm=0;static Zm=0;static qm=0;static Jm=0;static $m=0;static Qm=0;static tp=0;static ep=0;static ip=0;static sp=0;static np=0;static rp=0;static hp=0;static op=!1;static lp=null;static ap=Uint8Array.of(19,55,38,155,255,110,137,205,76);static cp=Uint8Array.of(160,192,80,96,0,144,80,48,160);static fp=Uint8Array.of(76,8,137,4,0,1,38,2,19);static up=Int8Array.of(0,0,2,0,0,2,1,1,0);static dp=Int8Array.of(2,0,0,2,0,0,0,4,4);static wp=Int8Array.of(0,4,4,8,0,0,8,0,0);static yp=Int8Array.of(1,1,0,0,0,8,0,0,8);static Ap=Int8Array.of(53,-53,-53,53);static mp=Int8Array.of(-53,-53,53,53);static pp=Int8Array.of(-45,45,45,-45);static gp=Int8Array.of(45,45,-45,-45);static _p=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static Ip=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static Cp=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static Ep=0;static Hl=0;static Vl=0;static vp=-1;static bp=-1;static it=!0;static init=(t,e,i,n,r)=>{this.Gm=0,this.Wm=0,this.Ym=t,this.Hm=e,this.Vm=t/2|0,this.Km=e/2|0;const h=new p.Mm(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let e=0;e<2048;e+=64){this.Xm=s.A.sin[t],this.jm=s.A.cos[t],this.zm=s.A.sin[e],this.Zm=s.A.cos[e];const o=(t-128)/32|0,l=e/64|0;for(let t=-26;t<=26;t++)for(let e=-26;e<=26;e++){const s=128*t,a=128*e;let c=!1;for(let t=-i;t<=n;t+=128)if(this.Tp(s,a,r[o]+t)){c=!0;break}h[o][l][t+25+1][e+25+1]=c}}for(let t=0;t<8;t++)for(let e=0;e<32;e++)for(let i=-25;i<25;i++)for(let s=-25;s<25;s++){let n=!1;t:for(let r=-1;r<=1;r++)for(let o=-1;o<=1;o++){if(h[t][e][i+r+25+1][s+o+25+1]){n=!0;break t}if(h[t][(e+1)%31][i+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][e][i+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][(e+1)%31][i+r+25+1][s+o+25+1]){n=!0;break t}}this.xm[t][e][i+25][s+25]=n}};static Lo=()=>{this.km=null,this.Dm=null,this.Nm=null,this.Pm=null,this.xm=null,this.Bm=null,this.lp=null,console.log('World3D unloaded!')};static vm=(t,e,i,s,n,r,o,l)=>{g.Nm[t][g.Dm[t]++]=new h.A(i/128|0,r/128|0,n/128|0,l/128|0,e,i,r,n,l,s,o)};static Tp=(t,e,i)=>{const s=e*this.zm+t*this.Zm>>16,n=e*this.Zm-t*this.zm>>16,r=i*this.Xm+n*this.jm>>16,h=i*this.jm-n*this.Xm>>16;if(r<50||r>3500)return!1;const o=this.Vm+((s<<9)/r|0),l=this.Km+((h<<9)/r|0);return o>=this.Gm&&o<=this.Ym&&l>=this.Wm&&l<=this.Hm};Op;qA;JA;Rp;Lp;Ih;Sp;xp;Mp;kp=0;Dp=0;Np=0;constructor(t,e,i,s){this.Op=i,this.qA=s,this.JA=e,this.Lp=new p.Eh(i,s,e,null),this.Sp=new p.dm(i,s+1,e+1),this.Rp=t,this.Ih=new p.fi(5e3,null),this.xp=new Int32Array(1e4),this.Mp=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.Dp=t;for(let e=0;e{const i=this.Lp[0][t][e];for(let i=0;i<3;i++){this.Lp[i][t][e]=this.Lp[i+1][t][e];const s=this.Lp[i][t][e];s&&s.level--}this.Lp[0][t][e]||(this.Lp[0][t][e]=new r.A(0,t,e));const s=this.Lp[0][t][e];s&&(s.Bp=i),this.Lp[3][t][e]=null};Im=(t,e,i,s)=>{const n=this.Lp[t][e][i];n&&(n.Pp=s)};pm=(t,e,i,s,n,h,o,l,a,c,f,u,w,m,p,g,_,I,C,E)=>{if(s===A.A.Am){for(let s=t;s>=0;s--)this.Lp[s][e][i]||(this.Lp[s][e][i]=new r.A(s,e,i));const s=this.Lp[t][e][i];s&&(s.Up=new d.A(f,u,w,m,-1,C,!1))}else if(s===A.A.Gp){for(let s=t;s>=0;s--)this.Lp[s][e][i]||(this.Lp[s][e][i]=new r.A(s,e,i));const s=this.Lp[t][e][i];s&&(s.Up=new d.A(p,g,_,I,h,E,o===l&&o===a&&o===c))}else{for(let s=t;s>=0;s--)this.Lp[s][e][i]||(this.Lp[s][e][i]=new r.A(s,e,i));const d=this.Lp[t][e][i];d&&(d.Wp=new y.A(e,s,g,l,w,n,f,c,E,p,h,I,C,a,_,m,o,i,u))}};XA=(t,e,i,s,n,h,o)=>{this.Lp[e][i][s]||(this.Lp[e][i][s]=new r.A(e,i,s));const a=this.Lp[e][i][s];a&&(a.Yp=new l.A(n,128*i+64,128*s+64,t,h,o))};Hp=(t,e,i)=>{const s=this.Lp[t][e][i];s&&(s.Yp=null)};Vp=(t,e,i,s,n,h,o,l)=>{let a=0;const c=this.Lp[s][t][e];if(c)for(let t=0;ta&&(a=i)}else this.Lp[s][t][e]=new r.A(s,t,e);const f=this.Lp[s][t][e];f&&(f.jp=new u.A(i,128*t+64,128*e+64,h,o,l,n,a))};zp=(t,e,i)=>{const s=this.Lp[t][e][i];s&&(s.jp=null)};iA=(t,e,i,s,n,h,o,l,c,f)=>{if(!o&&!l)return;for(let s=t;s>=0;s--)this.Lp[s][e][i]||(this.Lp[s][e][i]=new r.A(s,e,i));const u=this.Lp[t][e][i];u&&(u.Zp=new a.A(s,128*e+64,128*i+64,n,h,o,l,c,f))};lA=(t,e,i,s)=>{const n=this.Lp[t][e][i];1===s&&n&&(n.Zp=null)};zA=(t,e,i,s,n,h,o,l,a,f,u)=>{if(!l)return;for(let s=t;s>=0;s--)this.Lp[s][e][i]||(this.Lp[s][e][i]=new r.A(s,e,i));const d=this.Lp[t][e][i];d&&(d.qp=new c.A(s,128*e+n+64,128*i+h+64,u,f,l,o,a))};Jp=(t,e,i)=>{const s=this.Lp[t][e][i];s&&(s.qp=null)};Sm=(t,e,i,s)=>{const n=this.Lp[t][e][i];if(!n)return;const r=n.qp;if(!r)return;const h=128*e+64,o=128*i+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};$p=(t,e,i,s)=>{if(!s)return;const n=this.Lp[t][e][i];if(!n)return;const r=n.qp;r&&(r.model=s)};Qp=(t,e,i,s)=>{if(!s)return;const n=this.Lp[t][e][i];if(!n)return;const r=n.Yp;r&&(r.model=s)};tg=(t,e,i,s)=>{if(!s)return;const n=this.Lp[t][e][i];if(!n)return;const r=n.Zp;r&&(r.eg=s)};ig=(t,e,i,s,n)=>{if(!s)return;const r=this.Lp[i][t][e];if(!r)return;const h=r.Zp;h&&(h.eg=s,h.sg=n)};$y=(t,e,i,s,n,r,h,o,l,a,c)=>{if(!n&&!r)return!0;const f=128*e+64*l,u=128*i+64*a;return this.ng(f,u,s,t,e,i,l,a,n,r,h,o,c,!1)};rg=(t,e,i,s,n,r,h,o,l,a)=>{if(!n&&!r)return!0;let c=e-l,f=s-l,u=e+l,d=s+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.ng(e,s,i,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};hg=(t,e,i,s,n,r,h,o,l,a,c,f)=>!l&&!a||this.ng(e,s,i,t,n,r,h+1-n,o-r+1,l,a,c,0,f,!0);eA=(t,e,i)=>{const s=this.Lp[t][e][i];if(s)for(let t=0;t>29&3)&&n.lg===e&&n.ag===i)return void this.cg(n)}};fg=(t,e,i,s)=>{if(!s)return;const n=this.Lp[t][e][i];if(n)for(let t=0;t>29&3))return void(e.model=s)}};ug=()=>{for(let t=0;t{const s=this.Lp[t][e][i];return s&&s.Zp?s.Zp.og:0};dg=(t,e,i)=>{const s=this.Lp[t][i][e];return s&&s.qp?s.qp.og:0};wg=(t,e,i)=>{const s=this.Lp[t][e][i];if(!s)return 0;for(let t=0;t>29&3)&&n.lg===e&&n.ag===i)return n.og}return 0};yg=(t,e,i)=>{const s=this.Lp[t][e][i];return s&&s.Yp?s.Yp.og:0};Ag=(t,e,i,s)=>{const n=this.Lp[t][e][i];if(n){if(n.Zp&&n.Zp.og===s)return 255&n.Zp.info;if(n.qp&&n.qp.og===s)return 255&n.qp.info;if(n.Yp&&n.Yp.og===s)return 255&n.Yp.info;for(let t=0;t{const r=e*(0|Math.sqrt(i*i+s*s+n*n))>>8;for(let e=0;e{if(e0){const n=this.Lp[t][e+1][i-1];n&&n.Yp&&n.Yp.model&&n.Yp.model.mg&&this.gg(s,n.Yp.model,128,0,-128,!0)}};pg=(t,e,i,s,n,r)=>{let h=!0,o=e;const l=e+s,a=i-1,c=i+n;for(let f=t;f<=t+1;f++)if(f!==this.Op){for(let u=o;u<=l;u++)if(!(u<0||u>=this.qA))for(let o=a;o<=c;o++){if(o<0||o>=this.JA||h&&u=i||u===e))continue;const a=this.Lp[f][u][o];if(!a)continue;const d=128*(u-e)+64*(1-s),w=128*(o-i)+64*(1-n),y=((this.Rp[f][u][o]+this.Rp[f][u+1][o]+this.Rp[f][u][o+1]+this.Rp[f][u+1][o+1])/4|0)-((this.Rp[t][e][i]+this.Rp[t][e+1][i]+this.Rp[t][e][i+1]+this.Rp[t][e+1][i+1])/4|0),A=a.Zp;A&&A.eg&&A.eg.mg&&this.gg(r,A.eg,d,y,w,h),A&&A.sg&&A.sg.mg&&this.gg(r,A.sg,d,y,w,h);for(let t=0;t{this.Np++;let h=0;const o=e.Xd,l=e.Kd;if(t.mg&&t.vg)for(let r=0;re.bg)continue;const u=t.Xd[r]-i;if(ue.Og)continue;const d=t.jd[r]-n;if(de.Lg)continue;if(e.mg&&e.vg)for(let t=0;t{const h=this.Lp[t][e][i];if(!h)return;const o=h.Up;if(o){const t=o.color;if(0!==t)for(let e=0;e<4;e++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const l=h.Wp;if(!l)return;const a=l.shape,c=l.angle,f=l.Fg,u=l.Bg,d=g._p[a],w=g.Ip[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,e)=>{g.op=!0,g.Hl=t,g.Vl=e,g.vp=-1,g.bp=-1};draw=(t,e,i,n,r,h,o)=>{t<0?t=0:t>=128*this.qA&&(t=128*this.qA-1),i<0?i=0:i>=128*this.JA&&(i=128*this.JA-1),g.Um++,g.Xm=s.A.sin[h],g.jm=s.A.cos[h],g.zm=s.A.sin[r],g.Zm=s.A.cos[r],g.lp=g.xm[(h-128)/32|0][r/64|0],g.qm=t,g.Jm=e,g.$m=i,g.Qm=t/128|0,g.tp=i/128|0,g.rp=n,g.ep=g.Qm-25,g.ep<0&&(g.ep=0),g.sp=g.tp-25,g.sp<0&&(g.sp=0),g.ip=g.Qm+25,g.ip>this.qA&&(g.ip=this.qA),g.np=g.tp+25,g.np>this.JA&&(g.np=this.JA),this.Pg(),g.hp=0;for(let t=this.Dp;t=2e3)?(h.visible=!0,h.update=!0,h.Ug=h.Kp>0,g.hp++):(h.visible=!1,h.update=!1,h.Gg=0))}}for(let t=this.Dp;t=g.ip))for(let t=-25;t<=0;t++){const n=g.tp+t,r=g.tp-t;let h;if(i>=g.ep&&(n>=g.sp&&(h=e[i][n],h&&h.visible&&this.Wg(h,!0,o)),r=g.sp&&(h=e[s][n],h&&h.visible&&this.Wg(h,!0,o)),r=g.ip))for(let t=-25;t<=0;t++){const n=g.tp+t,r=g.tp-t;let h;if(i>=g.ep&&(n>=g.sp&&(h=e[i][n],h&&h.visible&&this.Wg(h,!1,o)),r=g.sp&&(h=e[s][n],h&&h.visible&&this.Wg(h,!1,o)),r{if(!c&&!f)return!1;for(let t=h;t=this.qA||e>=this.JA)return!1;const i=this.Lp[s][t][e];if(i&&i.Kp>=5)return!1}const A=new n.A(s,i,t,e,c,f,w,h,h+l-1,o,o+a-1,u,d);for(let t=h;th&&(i|=1),to&&(i+=8),e=0;i--)this.Lp[i][t][e]||(this.Lp[i][t][e]=new r.A(i,t,e));const n=this.Lp[s][t][e];n&&(n.Xp[n.Kp]=A,n.Yg[n.Kp]=i,n.Hg|=i,n.Kp++)}return y&&(this.Ih[this.kp++]=A),!0};cg=t=>{for(let e=t.lg;e<=t.Ig;e++)for(let i=t.ag;i<=t.Cg;i++){const s=this.Lp[t.level][e][i];if(s){for(let e=0;e{const t=g.Dm[g.rp],e=g.Nm[g.rp];g.Ep=0;for(let i=0;i=0&&s<=50){n=t.Kg+25-g.tp,n<0&&(n=0),r=t.JA+25-g.tp,r>50&&(r=50);let e=!1;for(;n<=r;)if(g.lp&&g.lp[s][n++]){e=!0;break}if(e){if(h=g.qm-t.Tg,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.Xg=(t.Rg-g.$m<<8)/h|0,t.jg=(t.Lg-g.$m<<8)/h|0,t.zg=(t.bg-g.Jm<<8)/h|0,t.Zg=(t.iw-g.Jm<<8)/h|0,g.Bm[g.Ep++]=t}}}else if(2===t.type){if(s=t.Kg+25-g.tp,s>=0&&s<=50){n=t.Vg+25-g.Qm,n<0&&(n=0),r=t.qA+25-g.Qm,r>50&&(r=50);let e=!1;for(;n<=r;)if(g.lp&&g.lp[n++][s]){e=!0;break}if(e){if(h=g.$m-t.Rg,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.qg=(t.Tg-g.qm<<8)/h|0,t.Jg=(t.Og-g.qm<<8)/h|0,t.zg=(t.bg-g.Jm<<8)/h|0,t.Zg=(t.iw-g.Jm<<8)/h|0,g.Bm[g.Ep++]=t}}}else if(4===t.type&&(s=t.bg-g.Jm,s>128&&(n=t.Kg+25-g.tp,n<0&&(n=0),r=t.JA+25-g.tp,r>50&&(r=50),n<=r))){let e=t.Vg+25-g.Qm;e<0&&(e=0),h=t.qA+25-g.Qm,h>50&&(h=50);let i=!1;t:for(let t=e;t<=h;t++)for(let e=n;e<=r;e++)if(g.lp&&g.lp[t][e]){i=!0;break t}i&&(t.mode=5,t.qg=(t.Tg-g.qm<<8)/s|0,t.Jg=(t.Og-g.qm<<8)/s|0,t.Xg=(t.Rg-g.$m<<8)/s|0,t.jg=(t.Lg-g.$m<<8)/s|0,g.Bm[g.Ep++]=t)}}};Wg=(t,e,i)=>{for(g.Pm.jA(t);;){let t;do{if(t=g.Pm.$g(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.Qg,o=this.Lp[r];if(t.visible){if(e){if(r>0){const t=this.Lp[r-1][s][n];if(t&&t.update)continue}if(s<=g.Qm&&s>g.ep){const e=o[s-1][n];if(e&&e.update&&(e.visible||!(1&t.Hg)))continue}if(s>=g.Qm&&sg.sp){const e=o[s][n-1];if(e&&e.update&&(e.visible||!(8&t.Hg)))continue}if(n>=g.tp&&nn&&(a+=6),c=g.ap[a],t.r_=g.fp[a]),f&&(f.h_&g.cp[a]?16===f.h_?(t.Gg=3,t.o_=g.up[a],t.l_=3-t.o_):32===f.h_?(t.Gg=6,t.o_=g.dp[a],t.l_=6-t.o_):64===f.h_?(t.Gg=12,t.o_=g.wp[a],t.l_=12-t.o_):(t.Gg=9,t.o_=g.yp[a],t.l_=9-t.o_):t.Gg=0,f.h_&c&&!this.a_(h,s,n,f.h_)&&f.eg?.draw(0,g.Xm,g.jm,g.zm,g.Zm,f.x-g.qm,f.y-g.Jm,f.z-g.$m,f.og),f.c_&c&&!this.a_(h,s,n,f.c_)&&f.sg?.draw(0,g.Xm,g.jm,g.zm,g.Zm,f.x-g.qm,f.y-g.Jm,f.z-g.$m,f.og)),u&&!this.visible(h,s,n,u.model.iw))if(u.type&c)u.model.draw(u.angle,g.Xm,g.jm,g.zm,g.Zm,u.x-g.qm,u.y-g.Jm,u.z-g.$m,u.og);else if(768&u.type){const t=u.x-g.qm,e=u.y-g.Jm,i=u.z-g.$m,s=u.angle;let n,r;if(n=s===m.A.Qy||s===m.A.nA?-t:t,r=s===m.A.nA||s===m.A.tA?-i:i,256&u.type&&rn){const n=t+g.pp[s],r=i+g.gp[s];u.model.draw(512*s+1280&2047,g.Xm,g.jm,g.zm,g.Zm,n,e,r,u.og)}}if(l){const e=t.Yp;e&&e.model?.draw(0,g.Xm,g.jm,g.zm,g.Zm,e.x-g.qm,e.y-g.Jm,e.z-g.$m,e.og);const i=t.jp;i&&0===i.offset&&(i.f_&&i.f_.draw(0,g.Xm,g.jm,g.zm,g.Zm,i.x-g.qm,i.y-g.Jm,i.z-g.$m,i.og),i.u_&&i.u_.draw(0,g.Xm,g.jm,g.zm,g.Zm,i.x-g.qm,i.y-g.Jm,i.z-g.$m,i.og),i.d_&&i.d_.draw(0,g.Xm,g.jm,g.zm,g.Zm,i.x-g.qm,i.y-g.Jm,i.z-g.$m,i.og))}const d=t.Hg;if(0!==d){if(sg.Qm&&1&d){const t=o[s-1][n];t&&t.update&&g.Pm.jA(t)}if(n>g.tp&&8&d){const t=o[s][n-1];t&&t.update&&g.Pm.jA(t)}}}if(0!==t.Gg){let e=!0;for(let i=0;ie.lg&&(r+=1),ie.ag&&(r+=8),ss&&(s=n);const h=g.tp-e.ag,l=e.Cg-g.tp;e.w_=l>h?s+l:s+h}for(;;){let t=-50,e=-1;for(let i=0;it&&(t=s.w_,e=i))}if(-1===e)break;const l=g.km[e];if(l){l.Um=g.Um;let t=l.model;t||(t=l.s_?.draw(i)??null),t&&!this.y_(h,l.lg,l.Ig,l.ag,l.Cg,t.iw)&&t.draw(l.n_,g.Xm,g.jm,g.zm,g.Zm,l.x-g.qm,l.y-g.Jm,l.z-g.$m,l.og);for(let t=l.lg;t<=l.Ig;t++)for(let e=l.ag;e<=l.Cg;e++){const i=o[t][e];i&&(0!==i.Gg?g.Pm.jA(i):t===s&&e===n||!i.update||g.Pm.jA(i))}}}if(t.Ug)continue}if(!t.update||0!==t.Gg)continue;if(s<=g.Qm&&s>g.ep){const t=o[s-1][n];if(t&&t.update)continue}if(s>=g.Qm&&sg.sp){const t=o[s][n-1];if(t&&t.update)continue}if(n>=g.tp&&n=r){const r=t+g.Ap[n],h=s+g.mp[n];e.model.draw(512*n+256,g.Xm,g.jm,g.zm,g.Zm,r,i,h,e.og)}if(512&e.type&&h<=r){const r=t+g.pp[n],h=s+g.gp[n];e.model.draw(512*n+1280&2047,g.Xm,g.jm,g.zm,g.Zm,r,i,h,e.og)}}const i=t.Zp;i&&(i.c_&t.r_&&!this.a_(h,s,n,i.c_)&&i.sg?.draw(0,g.Xm,g.jm,g.zm,g.Zm,i.x-g.qm,i.y-g.Jm,i.z-g.$m,i.og),i.h_&t.r_&&!this.a_(h,s,n,i.h_)&&i.eg?.draw(0,g.Xm,g.jm,g.zm,g.Zm,i.x-g.qm,i.y-g.Jm,i.z-g.$m,i.og))}if(rg.Qm){const t=o[s-1][n];t&&t.update&&g.Pm.jA(t)}if(n>g.tp){const t=o[s][n-1];t&&t.update&&g.Pm.jA(t)}}};e_=(t,e,i,n,r,h,o,l)=>{let a,c,f,u,d=a=(i<<7)-g.qm,y=c=(n<<7)-g.$m,A=f=d+128,m=u=y+128,p=this.Rp[e][i][n]-g.Jm,_=this.Rp[e][i+1][n]-g.Jm,I=this.Rp[e][i+1][n+1]-g.Jm,C=this.Rp[e][i][n+1]-g.Jm,E=y*o+d*l>>16;if(y=y*l-d*o>>16,d=E,E=p*h-y*r>>16,y=p*r+y*h>>16,p=E,y<50)return;if(E=c*o+A*l>>16,c=c*l-A*o>>16,A=E,E=_*h-c*r>>16,c=_*r+c*h>>16,_=E,c<50)return;if(E=m*o+f*l>>16,m=m*l-f*o>>16,f=E,E=I*h-m*r>>16,m=I*r+m*h>>16,I=E,m<50)return;if(E=u*o+a*l>>16,u=u*l-a*o>>16,a=E,E=C*h-u*r>>16,u=C*r+u*h>>16,C=E,u<50)return;const v=s.A.ya+((d<<9)/y|0),b=s.A.Aa+((p<<9)/y|0),T=s.A.ya+((A<<9)/c|0),O=s.A.Aa+((_<<9)/c|0),R=s.A.ya+((f<<9)/m|0),L=s.A.Aa+((I<<9)/m|0),S=s.A.ya+((a<<9)/u|0),x=s.A.Aa+((C<<9)/u|0);if(s.A.alpha=0,(R-S)*(O-x)-(L-x)*(T-S)>0)if(s.A.A_=R<0||S<0||T<0||R>w.A.m_||S>w.A.m_||T>w.A.m_,g.op&&this.p_(g.Hl,g.Vl,L,x,O,R,S,T)&&(g.vp=i,g.bp=n),-1===t.g_)12345678!==t.__&&s.A.I_(R,S,T,L,x,O,t.__,t.C_,t.E_);else if(g.it){const e=g.Cp[t.g_];s.A.I_(R,S,T,L,x,O,this.v_(e,t.__),this.v_(e,t.C_),this.v_(e,t.E_))}else t.flat?s.A.b_(R,S,T,L,x,O,t.__,t.C_,t.E_,d,p,y,A,a,_,C,c,u,t.g_):s.A.b_(R,S,T,L,x,O,t.__,t.C_,t.E_,f,I,m,a,A,C,_,u,c,t.g_);if(!((v-T)*(x-O)-(b-O)*(S-T)<=0))if(s.A.A_=v<0||T<0||S<0||v>w.A.m_||T>w.A.m_||S>w.A.m_,g.op&&this.p_(g.Hl,g.Vl,b,O,x,v,T,S)&&(g.vp=i,g.bp=n),-1!==t.g_){if(!g.it)return void s.A.b_(v,T,S,b,O,x,t.T_,t.E_,t.C_,d,p,y,A,a,_,C,c,u,t.g_);const e=g.Cp[t.g_];s.A.I_(v,T,S,b,O,x,this.v_(e,t.T_),this.v_(e,t.E_),this.v_(e,t.C_))}else 12345678!==t.T_&&s.A.I_(v,T,S,b,O,x,t.T_,t.E_,t.C_)};i_=(t,e,i,n,r,h,o)=>{let l=i.Xd.length;for(let t=0;t>16;if(a=a*o-e*h>>16,e=c,c=l*r-a*n>>16,a=l*n+a*r>>16,l=c,a<50)return;i.O_&&(y.A.R_[t]=e,y.A.L_[t]=l,y.A.S_[t]=a),y.A.x_[t]=s.A.ya+((e<<9)/a|0),y.A.M_[t]=s.A.Aa+((l<<9)/a|0)}s.A.alpha=0,l=i.k_.length;for(let n=0;n0)if(s.A.A_=l<0||a<0||c<0||l>w.A.m_||a>w.A.m_||c>w.A.m_,g.op&&this.p_(g.Hl,g.Vl,f,u,d,l,a,c)&&(g.vp=t,g.bp=e),i.O_&&-1!==i.O_[n])if(g.it){const t=g.Cp[i.O_[n]];s.A.I_(l,a,c,f,u,d,this.v_(t,i.F_[n]),this.v_(t,i.B_[n]),this.v_(t,i.P_[n]))}else i.flat?s.A.b_(l,a,c,f,u,d,i.F_[n],i.B_[n],i.P_[n],y.A.R_[0],y.A.L_[0],y.A.S_[0],y.A.R_[1],y.A.R_[3],y.A.L_[1],y.A.L_[3],y.A.S_[1],y.A.S_[3],i.O_[n]):s.A.b_(l,a,c,f,u,d,i.F_[n],i.B_[n],i.P_[n],y.A.R_[r],y.A.L_[r],y.A.S_[r],y.A.R_[h],y.A.R_[o],y.A.L_[h],y.A.L_[o],y.A.S_[h],y.A.S_[o],i.O_[n]);else 12345678!==i.F_[n]&&s.A.I_(l,a,c,f,u,d,i.F_[n],i.B_[n],i.P_[n])}};t_=(t,e,i)=>{const s=this.Sp[t][e][i];if(s===-g.Um)return!1;if(s===g.Um)return!0;{const s=e<<7,n=i<<7;return this.U_(s+1,this.Rp[t][e][i],n+1)&&this.U_(s+128-1,this.Rp[t][e+1][i],n+1)&&this.U_(s+128-1,this.Rp[t][e+1][i+1],n+128-1)&&this.U_(s+1,this.Rp[t][e][i+1],n+128-1)?(this.Sp[t][e][i]=g.Um,!0):(this.Sp[t][e][i]=-g.Um,!1)}};a_=(t,e,i,s)=>{if(!this.t_(t,e,i))return!1;const n=e<<7,r=i<<7,h=this.Rp[t][e][i]-1,o=h-120,l=h-230,a=h-238;if(s<16){if(1===s){if(n>g.qm){if(!this.U_(n,h,r))return!1;if(!this.U_(n,h,r+128))return!1}if(t>0){if(!this.U_(n,o,r))return!1;if(!this.U_(n,o,r+128))return!1}return!!this.U_(n,l,r)&&this.U_(n,l,r+128)}if(2===s){if(r0){if(!this.U_(n,o,r+128))return!1;if(!this.U_(n+128,o,r+128))return!1}return!!this.U_(n,l,r+128)&&this.U_(n+128,l,r+128)}if(4===s){if(n0){if(!this.U_(n+128,o,r))return!1;if(!this.U_(n+128,o,r+128))return!1}return!!this.U_(n+128,l,r)&&this.U_(n+128,l,r+128)}if(8===s){if(r>g.$m){if(!this.U_(n,h,r))return!1;if(!this.U_(n+128,h,r))return!1}if(t>0){if(!this.U_(n,o,r))return!1;if(!this.U_(n+128,o,r))return!1}return!!this.U_(n,l,r)&&this.U_(n+128,l,r)}}return!!this.U_(n+64,a,r+64)&&(16===s?this.U_(n,l,r+128):32===s?this.U_(n+128,l,r+128):64===s?this.U_(n+128,l,r):128===s?this.U_(n,l,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,e,i,s)=>{if(this.t_(t,e,i)){const n=e<<7,r=i<<7;return this.U_(n+1,this.Rp[t][e][i]-s,r+1)&&this.U_(n+128-1,this.Rp[t][e+1][i]-s,r+1)&&this.U_(n+128-1,this.Rp[t][e+1][i+1]-s,r+128-1)&&this.U_(n+1,this.Rp[t][e][i+1]-s,r+128-1)}return!1};y_=(t,e,i,s,n,r)=>{let h,o;if(e!==i||s!==n){for(h=e;h<=i;h++)for(o=s;o<=n;o++)if(this.Sp[t][h][o]===-g.Um)return!1;o=1+(e<<7);const l=2+(s<<7),a=this.Rp[t][e][s]-r;if(!this.U_(o,a,l))return!1;const c=(i<<7)-1;if(!this.U_(c,a,l))return!1;const f=(n<<7)-1;return!!this.U_(o,a,f)&&this.U_(c,a,f)}return!!this.t_(t,e,s)&&(h=e<<7,o=s<<7,this.U_(h+1,this.Rp[t][e][s]-r,o+1)&&this.U_(h+128-1,this.Rp[t][e+1][s]-r,o+1)&&this.U_(h+128-1,this.Rp[t][e+1][s+1]-r,o+128-1)&&this.U_(h+1,this.Rp[t][e][s+1]-r,o+128-1))};U_=(t,e,i)=>{for(let s=0;s0){const t=n.Rg+(n.Xg*s>>8),r=n.Lg+(n.jg*s>>8),h=n.bg+(n.zg*s>>8),o=n.iw+(n.Zg*s>>8);if(i>=t&&i<=r&&e>=h&&e<=o)return!0}}else if(2===n.mode){const s=t-n.Tg;if(s>0){const t=n.Rg+(n.Xg*s>>8),r=n.Lg+(n.jg*s>>8),h=n.bg+(n.zg*s>>8),o=n.iw+(n.Zg*s>>8);if(i>=t&&i<=r&&e>=h&&e<=o)return!0}}else if(3===n.mode){const s=n.Rg-i;if(s>0){const i=n.Tg+(n.qg*s>>8),r=n.Og+(n.Jg*s>>8),h=n.bg+(n.zg*s>>8),o=n.iw+(n.Zg*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}else if(4===n.mode){const s=i-n.Rg;if(s>0){const i=n.Tg+(n.qg*s>>8),r=n.Og+(n.Jg*s>>8),h=n.bg+(n.zg*s>>8),o=n.iw+(n.Zg*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}else if(5===n.mode){const s=e-n.bg;if(s>0){const e=n.Tg+(n.qg*s>>8),r=n.Og+(n.Jg*s>>8),h=n.Rg+(n.Xg*s>>8),o=n.Lg+(n.jg*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}}return!1};p_=(t,e,i,s,n,r,h,o)=>{if(ei&&e>s&&e>n)return!1;if(tr&&t>h&&t>o)return!1;const l=(e-s)*(o-h)-(t-h)*(n-s);return((e-i)*(h-r)-(t-r)*(s-i))*l>0&&l*((e-n)*(r-o)-(t-o)*(i-n))>0};v_=(t,e)=>((e=(127-e)*(127&t)/160|0)<2?e=2:e>126&&(e=126),(65408&t)+e)}},7121:(t,e,i)=>{i.d(e,{A:()=>n});var s=i(1982);class n extends s.A{}},4197:(t,e,i)=>{i.d(e,{A:()=>n});var s=i(1982);class n extends s.A{G_;W_;Y_;H_;index;hy;Cl;Il;constructor(t,e,i,s,n,r,h){super(),this.G_=e,this.W_=i,this.Y_=s,this.H_=n,this.index=t,this.hy=r,h&&-1!==r.vl&&this.hy.delay?(this.Cl=Math.random()*this.hy.El|0,this.Il=Math.random()*this.hy.delay[this.Cl]|0):(this.Cl=-1,this.Il=0)}}},9418:(t,e,i)=>{i.d(e,{A:()=>h});var s=i(7121),n=i(1312),r=i(3867);class h extends s.A{x=0;z=0;n_=0;V_=!1;size=1;Ga=-1;K_=-1;X_=-1;j_=-1;z_=-1;Z_=-1;q_=-1;J_=null;Q_=100;tI=0;eI=0;iI=0;sI=0;nI=-1e3;rI=0;hI=0;oI=-1;lI=0;aI=0;cI=-1;fI=0;uI=0;dI=-1;wI=0;yI=0;AI=0;mI=0;pI=-1;gI=0;_I=0;II=0;CI=0;EI=0;vI=0;bI=0;TI=0;OI=0;RI=0;LI=0;Um=0;height=0;SI=0;pathLength=0;xI=new Int32Array(10);MI=new Int32Array(10);kI=new r.fi(10,!1);DI=0;NI=-1;FI=-1;BI=-1;UI=-1;move(t,e,i){if(-1!==this.dI&&n.A.Do[this.dI].priority<=1&&(this.dI=-1),!t){const t=e-this.xI[0],s=i-this.MI[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.xI[t]=this.xI[t-1],this.MI[t]=this.MI[t-1],this.kI[t]=this.kI[t-1];return this.xI[0]=e,this.MI[0]=i,void(this.kI[0]=!1)}}this.pathLength=0,this.DI=0,this.xI[0]=e,this.MI[0]=i,this.x=128*this.xI[0]+64*this.size,this.z=128*this.MI[0]+64*this.size}step(t,e){let i=this.xI[0],s=this.MI[0];0===e?(i--,s++):1===e?s++:2===e?(i++,s++):3===e?i--:4===e?i++:5===e?(i--,s--):6===e?s--:7===e&&(i++,s--),-1!==this.dI&&n.A.Do[this.dI].priority<=1&&(this.dI=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.xI[t]=this.xI[t-1],this.MI[t]=this.MI[t-1],this.kI[t]=this.kI[t-1];this.xI[0]=i,this.MI[0]=s,this.kI[0]=t}}},8268:(t,e,i)=>{i.d(e,{A:()=>d});var s=i(9418),n=i(8665),r=i(2679),h=i(8738),o=i(1312),l=i(8317),a=i(1302),c=i(3819),f=i(3867),u=i(9298);class d extends s.A{static GI=1;static WI=2;static YI=4;static HI=8;static VI=16;static KI=32;static XI=64;static jI=128;static zI=256;static ZI=512;static Ua=[u.A.qI,u.A.JI,u.A.$I,u.A.QI,u.A.tC,u.A.eC,u.A.iC,u.A.sC,u.A.nC,u.A.rC,u.A.hC,u.A.oC,u.A.lC,u.A.aC,u.A.cC,u.A.fC];static Pa=[[u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.AC,u.A.mC,u.A.pC,u.A.gC,u.A._C,u.A.IC,u.A.CC,u.A.EC],[u.A.vC,u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.LC,u.A.SC,u.A.xC,u.A.MC,u.A.kC,u.A.DC,u.A.NC,u.A.FC,u.A.BC,u.A.PC,u.A.UC],[u.A.UC-1,u.A.vC+1,u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.LC,u.A.SC,u.A.xC,u.A.MC,u.A.kC,u.A.DC,u.A.NC,u.A.FC,u.A.BC,u.A.PC],[u.A.GC,u.A.WC,u.A.YC,u.A.HC,u.A.VC,u.A.KC],[u.A.XC,u.A.jC,u.A.zC,u.A.ZC,u.A.qC,u.A.JC,u.A.$C,u.A.QC]];static No=new r.A(200);name=null;visible=!1;tE=0;eE=0;iE=new Uint16Array(12);sE=new Uint16Array(5);ec=0;nE=0n;y=0;rE=0;hE=0;oE=0;lE=0;aE=0;cE=null;Vg=0;Kg=0;qA=0;JA=0;it=!1;draw(t){if(!this.visible)return null;let e=this.uw();if(this.height=e.iw,e.Aw=!0,this.it)return e;if(-1!==this.pI&&-1!==this.gI){const t=h.A.Do[this.pI],i=n.A.Yu(t.pa(),!0,!t.Od,!1);i.translate(-this.CI,0,0),i.Wa(),t.hy&&t.hy.frames&&i.Ya(t.hy.frames[this.gI]),i.$d=null,i.Qd=null,128===t.cw&&128===t.fw||i.scale(t.cw,t.fw,t.cw),i.Ha(t.Ld+64,t.Sd+850,-30,-50,-30,!0);const s=[e,i];e=n.A.fE(s,2)}if(this.cE&&(t>=this.hE&&(this.cE=null),t>=this.rE&&t=d.Pa[e].length)&&(i=0),this.sE[e]=i}this.Ga=t.Tu,65535===this.Ga&&(this.Ga=-1),this.K_=t.Tu,65535===this.K_&&(this.K_=-1),this.X_=t.Tu,65535===this.X_&&(this.X_=-1),this.j_=t.Tu,65535===this.j_&&(this.j_=-1),this.z_=t.Tu,65535===this.z_&&(this.z_=-1),this.Z_=t.Tu,65535===this.Z_&&(this.Z_=-1),this.q_=t.Tu,65535===this.q_&&(this.q_=-1),this.name=c.A.Ma(c.A.ka(t.uE)),this.ec=t.Ru,this.visible=!0,this.nE=0n;for(let t=0;t<12;t++)this.nE<<=0x4n,this.iE[t]>=256&&(this.nE+=BigInt(this.iE[t])-256n);this.iE[0]>=256&&(this.nE+=BigInt(this.iE[0])-256n>>4n),this.iE[1]>=256&&(this.nE+=BigInt(this.iE[1])-256n>>8n);for(let t=0;t<5;t++)this.nE<<=0x3n,this.nE+=BigInt(this.sE[t]);this.nE<<=0x1n,this.nE+=BigInt(this.tE)}ud(){if(!this.visible)return null;const t=new f.fi(12,null);let e=0;for(let i=0;i<12;i++){const s=this.iE[i];if(s>=256&&s<512&&(t[e++]=l.A.Do[s-256].ud()),s>=512){const i=a.A.get(s-512).ud(this.tE);i&&(t[e++]=i)}}const i=n.A.Fa(t,e);for(let t=0;t<5;t++)0!==this.sE[t]&&(i.Ba(d.Pa[t][0],d.Pa[t][this.sE[t]]),1===t&&i.Ba(d.Ua[0],d.Ua[this.sE[t]]));return i}uw(){let t=this.nE,e=-1,i=-1,s=-1,r=-1;if(this.dI>=0&&0===this.AI){const n=o.A.Do[this.dI];if(n.frames&&(e=n.frames[this.wI]),this.cI>=0&&this.cI!==this.Ga){const t=o.A.Do[this.cI].frames;t&&(i=t[this.fI])}n.iy>=0&&(s=n.iy,t+=BigInt(s-this.iE[5])<<8n),n.sy>=0&&(r=n.sy,t+=BigInt(r-this.iE[3])<<16n)}else if(this.cI>=0){const t=o.A.Do[this.cI].frames;t&&(e=t[this.fI])}let h=d.No?.get(t);if(!h){const e=new f.fi(12,null);let i=0;for(let t=0;t<12;t++){let n=this.iE[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=l.A.Do[n-256].pa();t&&(e[i++]=t)}if(n>=512){const t=a.A.get(n-512).Qw(this.tE);t&&(e[i++]=t)}}h=n.A.Fa(e,i);for(let t=0;t<5;t++)0!==this.sE[t]&&(h.Ba(d.Pa[t][0],d.Pa[t][this.sE[t]]),1===t&&h.Ba(d.Ua[0],d.Ua[this.sE[t]]));h.Wa(),h.Ha(64,850,-30,-50,-30,!0),d.No?.put(t,h)}if(this.it)return h;const c=n.A.dw(h,!0);return-1!==e&&-1!==i?c.ww(e,i,o.A.Do[this.dI].ty):-1!==e&&c.Ya(e),c.yw(),c.$d=null,c.Qd=null,c}}},9222:(t,e,i)=>{i.d(e,{A:()=>s});class s{y;x;z;model;og;info;constructor(t,e,i,s,n,r){this.y=t,this.x=e,this.z=i,this.model=s,this.og=n,this.info=r}}},1161:(t,e,i)=>{i.d(e,{A:()=>s});class s{level;y;x;z;model;s_;n_;lg;Ig;ag;Cg;og;info;w_=0;Um=0;constructor(t,e,i,s,n,r,h,o,l,a,c,f,u){this.level=t,this.y=e,this.x=i,this.z=s,this.model=n,this.s_=r,this.n_=h,this.lg=o,this.Ig=l,this.ag=a,this.Cg=c,this.og=f,this.info=u}}},5748:(t,e,i)=>{i.d(e,{A:()=>s});class s{y;x;z;d_;u_;f_;og;offset;constructor(t,e,i,s,n,r,h,o){this.y=t,this.x=e,this.z=i,this.d_=s,this.u_=n,this.f_=r,this.og=h,this.offset=o}}},8256:(t,e,i)=>{i.d(e,{A:()=>s});class s{Vg;qA;Kg;JA;type;Tg;Og;Rg;Lg;bg;iw;mode=0;qg=0;Jg=0;Xg=0;jg=0;zg=0;Zg=0;constructor(t,e,i,s,n,r,h,o,l,a,c){this.Vg=t,this.qA=e,this.Kg=i,this.JA=s,this.type=n,this.Tg=r,this.Og=h,this.Rg=o,this.Lg=l,this.bg=a,this.iw=c}}},3795:(t,e,i)=>{i.d(e,{A:()=>r});var s=i(1982),n=i(3867);class r extends s.A{level;x;z;Qg;Xp;Yg;Up=null;Wp=null;Zp=null;qp=null;Yp=null;jp=null;Bp=null;Kp=0;Hg=0;Pp=0;visible=!1;update=!1;Ug=!1;Gg=0;o_=0;l_=0;r_=0;constructor(t,e,i){super(),this.Qg=this.level=t,this.x=e,this.z=i,this.Xp=new n.fi(5,null),this.Yg=new Int32Array(5)}}},2771:(t,e,i)=>{i.d(e,{A:()=>s});class s{static x_=new Int32Array(6);static M_=new Int32Array(6);static R_=new Int32Array(6);static L_=new Int32Array(6);static S_=new Int32Array(6);static dE=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static wE=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static yE=128;static AE=this.yE/2|0;static mE=this.yE/4|0;static pE=3*this.yE/4|0;Xd;zd;jd;F_;B_;P_;k_;D_;N_;O_;flat;shape;angle;Fg;Bg;constructor(t,e,i,n,r,h,o,l,a,c,f,u,d,w,y,A,m,p,g){this.flat=!(m!==n||m!==w||m!==l),this.shape=e,this.angle=h,this.Fg=d,this.Bg=a;const _=s.dE[e],I=_.length;this.Xd=new Int32Array(I),this.zd=new Int32Array(I),this.jd=new Int32Array(I);const C=new Int32Array(I),E=new Int32Array(I),v=t*s.yE,b=p*s.yE;for(let t=0;t8&&I<=12&&(I=9+(I-h-9&3)),I>12&&I<=16&&(I=13+(I-h-13&3)),1===I?(e=v,a=b,f=m,d=o,p=c):2===I?(e=v+s.AE,a=b,f=m+n>>1,d=o+g>>1,p=c+i>>1):3===I?(e=v+s.yE,a=b,f=n,d=g,p=i):4===I?(e=v+s.yE,a=b+s.AE,f=n+w>>1,d=g+r>>1,p=i+y>>1):5===I?(e=v+s.yE,a=b+s.yE,f=w,d=r,p=y):6===I?(e=v+s.AE,a=b+s.yE,f=w+l>>1,d=r+A>>1,p=y+u>>1):7===I?(e=v,a=b+s.yE,f=l,d=A,p=u):8===I?(e=v,a=b+s.AE,f=l+m>>1,d=A+o>>1,p=u+c>>1):9===I?(e=v+s.AE,a=b+s.mE,f=m+n>>1,d=o+g>>1,p=c+i>>1):10===I?(e=v+s.pE,a=b+s.AE,f=n+w>>1,d=g+r>>1,p=i+y>>1):11===I?(e=v+s.AE,a=b+s.pE,f=w+l>>1,d=r+A>>1,p=y+u>>1):12===I?(e=v+s.mE,a=b+s.AE,f=l+m>>1,d=A+o>>1,p=u+c>>1):13===I?(e=v+s.mE,a=b+s.mE,f=m,d=o,p=c):14===I?(e=v+s.pE,a=b+s.mE,f=n,d=g,p=i):15===I?(e=v+s.pE,a=b+s.pE,f=w,d=r,p=y):(e=v+s.mE,a=b+s.pE,f=l,d=A,p=u),this.Xd[t]=e,this.zd[t]=f,this.jd[t]=a,C[t]=d,E[t]=p}const T=s.wE[e],O=T.length/4|0;this.k_=new Int32Array(O),this.D_=new Int32Array(O),this.N_=new Int32Array(O),this.F_=new Int32Array(O),this.B_=new Int32Array(O),this.P_=new Int32Array(O),this.O_=-1!==f?new Int32Array(O):null;let R=0;for(let t=0;t{i.d(e,{A:()=>s});class s{static Am=0;static Gp=1;static gE=2;static _E=3;static IE=4;static CE=5;static AE=6;static mE=7;static pE=8;static EE=9;static vE=10;static bE=11}},3479:(t,e,i)=>{i.d(e,{A:()=>s});class s{T_;E_;__;C_;g_;color;flat;constructor(t,e,i,s,n,r,h){this.T_=t,this.E_=e,this.__=i,this.C_=s,this.g_=n,this.color=r,this.flat=h}}},6855:(t,e,i)=>{i.d(e,{A:()=>s});class s{y;x;z;h_;c_;eg;sg;og;info;constructor(t,e,i,s,n,r,h,o,l){this.y=t,this.x=e,this.z=i,this.h_=s,this.c_=n,this.eg=r,this.sg=h,this.og=o,this.info=l}}},7441:(t,e,i)=>{i.d(e,{A:()=>s});class s{y;x;z;type;angle;model;og;info;constructor(t,e,i,s,n,r,h,o){this.y=t,this.x=e,this.z=i,this.type=s,this.angle=n,this.model=r,this.og=h,this.info=o}}},7536:(t,e,i)=>{i.d(e,{A:()=>n});var s=i(1982);class n{TE;OE;constructor(t){this.OE=[],this.TE=t;for(let e=0;e{i.d(e,{A:()=>n});var s=i(1982);class n extends s.A{LE;SE;constructor(){super(),this.LE=this,this.SE=this}xE(){this.SE&&this.LE&&(this.SE.LE=this.LE,this.LE.SE=this.SE,this.LE=null,this.SE=null)}}},3819:(t,e,i)=>{i.d(e,{A:()=>s});class s{static ME=['_','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','0','1','2','3','4','5','6','7','8','9'];static kE=t=>{t=t.trim();let e=0n;for(let i=0;i=65&&s<=90?e+=BigInt(s+1-65):s>=97&&s<=122?e+=BigInt(s+1-97):s>=48&&s<=57&&(e+=BigInt(s+27-48))}return e};static ka=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let e=0;const i=Array(12);for(;0n!==t;){const s=t;t/=37n,i[11-e++]=this.ME[Number(s-37n*t)]}return i.slice(12-e).join('')};static DE=t=>{const e=[...t.toLowerCase()];let i=!0;for(let t=0;t='a'&&s<='z'&&(e[t]=s.toUpperCase(),i=!1),'.'!==s&&'!'!==s||(i=!0)}return e.join('')};static NE=t=>{let e='';for(let i=0;i(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static Ma=t=>{if(0===t.length)return t;const e=[...t];for(let t=0;t='a'&&e[t+1]<='z'&&(e[t+1]=String.fromCharCode(e[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return e[0]>='a'&&e[0]<='z'&&(e[0]=String.fromCharCode(e[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),e.join('')};static Gu=t=>{const e=t.toUpperCase();let i=0n;for(let t=0;t>56n)&0xffffffffffffffn;return i}}},6666:(t,e,i)=>{i.d(e,{A:()=>n});var s=i(1982);class n{FE;cursor=null;constructor(){const t=new s.A;t.next=t,t.RE=t,this.FE=t}jA(t){t.RE&&t.Cw(),t.RE=this.FE.RE,t.next=this.FE,t.RE&&(t.RE.next=t),t.next.RE=t}BE(t){t.RE&&t.Cw(),t.RE=this.FE,t.next=this.FE.next,t.RE.next=t,t.next&&(t.next.RE=t)}$g(){const t=this.FE.next;return t===this.FE?null:(t?.Cw(),t)}head(){const t=this.FE.next;return t===this.FE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}PE(){const t=this.FE.RE;return t===this.FE?(this.cursor=null,null):(this.cursor=t?.RE||null,t)}next(){const t=this.cursor;return t===this.FE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}RE(){const t=this.cursor;return t===this.FE?(this.cursor=null,null):(this.cursor=t?.RE||null,t)}clear(){for(;;){const t=this.FE.next;if(t===this.FE)return;t?.Cw()}}}},1982:(t,e,i)=>{i.d(e,{A:()=>s});class s{key;next;RE;constructor(){this.key=0n,this.next=this,this.RE=this}Cw(){this.RE&&this.next&&(this.RE.next=this.next,this.next.RE=this.RE,this.next=null,this.RE=null)}}},2679:(t,e,i)=>{i.d(e,{A:()=>r});var s=i(2512),n=i(7536);class r{UE;GE;history;available;constructor(t){this.UE=t,this.available=t,this.GE=new n.A(1024),this.history=new s.A}get(t){const e=this.GE.get(t);return e&&this.history.push(e),e}put(t,e){if(0===this.available){const t=this.history.pop();t?.Cw(),t?.xE()}else this.available--;this.GE.put(t,e),this.history.push(e)}clear(){const t=this.history.pop();t?(t.Cw(),t.xE()):this.available=this.UE}}},2512:(t,e,i)=>{i.d(e,{A:()=>n});var s=i(4474);class n{head;constructor(){this.head=new s.A}push(t){t.SE&&t.xE(),t.SE=this.head.SE,t.LE=this.head,t.SE&&(t.SE.LE=t),t.LE.SE=t}pop(){const t=this.head.LE;return t===this.head?null:(t?.xE(),t)}}},8534:(t,e,i)=>{i.d(e,{A:()=>r});var s=i(1069),n=i(3867);class r{static Do=[];static ac=t=>{const e=new s.A(t.read('base_head.dat')),i=new s.A(t.read('base_type.dat')),h=new s.A(t.read('base_label.dat')),o=e.Tu;e.Lf+=2;for(let t=0;t{i.d(e,{A:()=>r});var s=i(8534),n=i(1069);class r{static Do=[];static ac=t=>{const e=new n.A(t.read('frame_head.dat')),i=new n.A(t.read('frame_tran1.dat')),h=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),l=e.Tu;e.Lf+=2;const a=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let e=t-1;e>y;e--)if(0===d.types[e]){a[A]=e,c[A]=0,f[A]=0,u[A]=0,A++;break}a[A]=t;let i=0;3===d.types[a[A]]&&(i=128),c[A]=1&e?h.YE:i,f[A]=2&e?h.YE:i,u[A]=4&e?h.YE:i,y=t,A++}}n.length=A,n.HE=new Int32Array(A),n.x=new Int32Array(A),n.y=new Int32Array(A),n.z=new Int32Array(A);for(let t=0;t{i.d(e,{jc:()=>s,nl:()=>n,VE:()=>o,KE:()=>h,XE:()=>r});const s=document.getElementById('canvas'),n=s.getContext('2d',{willReadFrequently:!0}),r=document.createElement('canvas'),h=document.createElement('img'),o=r.getContext('2d',{willReadFrequently:!0})},9298:(t,e,i)=>{i.d(e,{A:()=>s});class s{static RED=16711680;static GREEN=65280;static BLUE=255;static ql=16776960;static jE=65535;static _m=16711935;static Sl=16777215;static Zl=0;static zE=16748608;static ZE=8388608;static qE=128;static JE=16756736;static $E=16740352;static QE=16723968;static tv=12648192;static ev=8453888;static iv=4259584;static sv=9179409;static nv=6116423;static fl=2301979;static ul=5063219;static wl=7759444;static Al=3353893;static rv=8388736;static hv=13350793;static ov=Int32Array.of(s.ql,s.RED,s.GREEN,s.jE,s._m,s.Sl);static uC=6798;static dC=107;static wC=10283;static yC=16;static AC=4797;static mC=7744;static pC=5799;static gC=4634;static _C=33697;static IC=22433;static CC=2983;static EC=54193;static vC=8741;static bC=12;static TC=64030;static OC=43162;static RC=7735;static LC=8404;static SC=1701;static xC=38430;static MC=24094;static kC=10153;static DC=56621;static NC=4783;static FC=1341;static BC=16578;static PC=35003;static UC=25239;static qI=9104;static JI=10275;static $I=7595;static QI=3610;static tC=7975;static eC=8526;static iC=918;static sC=38802;static nC=24466;static rC=10145;static hC=58654;static oC=5027;static lC=1457;static aC=16565;static cC=34991;static fC=25486;static GC=4626;static WC=11146;static YC=6439;static HC=12;static VC=4758;static KC=10270;static QC=4574;static XC=4550;static jC=4537;static zC=5681;static ZC=5673;static qC=5790;static JC=6806;static $C=8076}},8950:(t,e,i)=>{i.d(e,{A:()=>n});var s=i(4474);class n extends s.A{static bw=new Int32Array;static Tw=0;static Ow=0;static top=0;static bottom=0;static left=0;static right=0;static m_=0;static lv=0;static av=0;static bind=(t,e,i)=>{this.bw=t,this.Tw=e,this.Ow=i,this.Tl(0,0,e,i)};static cv=()=>{this.left=0,this.top=0,this.right=this.Tw,this.bottom=this.Ow,this.m_=this.right-1,this.lv=this.right/2|0};static Tl=(t,e,i,s)=>{t<0&&(t=0),e<0&&(e=0),i>this.Tw&&(i=this.Tw),s>this.Ow&&(s=this.Ow),this.top=e,this.bottom=s,this.left=t,this.right=i,this.m_=this.right-1,this.lv=this.right/2|0,this.av=this.bottom/2|0};static clear=()=>{const t=this.Tw*this.Ow;for(let e=0;e{this.yl(t,e,n,i),this.yl(t,e+s-1,n,i),this.dl(t,e,n,s),this.dl(t+i-1,e,n,s)};static yl=(t,e,i,s)=>{if(e=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+e*this.Tw;for(let t=0;t{if(t=this.right)return;ethis.bottom&&(s=this.bottom-e);const n=t+e*this.Tw;for(let t=0;t{const r=Math.abs(i-t),h=Math.abs(s-e),o=t=this.left&&t=this.top&&e-h&&(a-=h,t+=o),i{tthis.right&&(i=this.right-t),e+s>this.bottom&&(s=this.bottom-e);const r=this.Tw-i;let h=t+e*this.Tw;for(let t=-s;t<0;t++){for(let t=-i;t<0;t++)this.bw[h++]=n;h+=r}};static uv(t,e,i,s,n,r){tthis.right&&(i=this.right-t),e+s>this.bottom&&(s=this.bottom-e);const h=256-r,o=(n>>16&255)*r,l=(n>>8&255)*r,a=(255&n)*r,c=this.Tw-i;let f=t+e*this.Tw;for(let t=0;t>16&255)*h>>8<<16)+(l+(this.bw[f]>>8&255)*h>>8<<8)+(a+(255&this.bw[f])*h>>8);this.bw[f++]=t}f+=c}}static dv(t,e,i,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,l=(255&s)*n;let a=e-i;a<0&&(a=0);let c=e+i;c>=this.Ow&&(c=this.Ow-1);for(let s=a;s<=c;s++){const n=s-e,a=0|Math.sqrt(i*i-n*n);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.Tw&&(f=this.Tw-1);let u=c+s*this.Tw;for(let t=c;t<=f;t++){const t=(h+(this.bw[u]>>16&255)*r>>8<<16)+(o+(this.bw[u]>>8&255)*r>>8<<8)+(l+(255&this.bw[u])*r>>8);this.bw[u++]=t}}}static wv=(t,e,i)=>{t=this.right||e=this.bottom||(this.bw[t+e*this.Tw]=i)}}},4583:(t,e,i)=>{i.d(e,{A:()=>h});var s=i(8950),n=i(1673),r=i(3867);class h extends s.A{static it=!1;static yv=new Int32Array(512);static Av=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static mv=new r.fi(50,null);static pv=0;static Ew=new Int32Array;static ya=0;static Aa=0;static Rw=!0;static A_=!1;static alpha=0;static gv=null;static _v=new r.fi(50,null);static Iv=0;static Um=0;static Cv=new Int32Array(50);static Ev=new r.fi(50,null);static vv=!1;static bv=new r.fi(50,!1);static Tv=new Int32Array(50);static{for(let t=1;t<512;t++)this.yv[t]=32768/t|0;for(let t=1;t<2048;t++)this.Av[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static Lo=()=>{this.yv=null,this.yv=null,this.sin=null,this.cos=null,this.Ew=null,this.mv=null,this.bv=null,this.Tv=null,this.gv=null,this._v=null,this.Cv=null,this.palette=null,this.Ev=null,console.log('Draw3D unloaded!')};static wc=()=>{this.Ew=new Int32Array(s.A.Ow);for(let t=0;t{this.Ew=new Int32Array(e);for(let i=0;i{this.gv=null,this._v.fill(null)};static hc=t=>{this.pv=0;for(let e=0;e<50;e++)try{this.mv[e]=n.A.rc(t,e.toString()),this.it&&128===this.mv[e]?.Xl?this.mv[e]?.Lv():this.mv[e]?.Bw(),this.pv++}catch(t){}};static gm=t=>{if(0!==this.Tv[t])return this.Tv[t];const e=this.Ev[t];if(!e)return 0;let i=0,s=0,n=0;const r=e.length;for(let t=0;t>16&255,s+=e[t]>>8&255,n+=255&e[t];let h=(i/r<<16)+(s/r<<8)+(n/r|0);return h=this.Sv(h,1.4),0===h&&(h=1),this.Tv[t]=h,h};static oc=t=>{const e=t+.03*Math.random()-.015;let i=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,l=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const e=2*r-t;let i=s+.3333333333333333;i>1&&i--;let a=s-.3333333333333333;a<0&&a++,h=6*i<1?e+6*(t-e)*i:2*i<1?t:3*i<2?e+(t-e)*(.6666666666666666-i)*6:e,o=6*s<1?e+6*(t-e)*s:2*s<1?t:3*s<2?e+(t-e)*(.6666666666666666-s)*6:e,l=6*a<1?e+6*(t-e)*a:2*a<1?t:3*a<2?e+(t-e)*(.6666666666666666-a)*6:e}const a=((256*h|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[i++]=this.Sv(a,e)}}for(let t=0;t<50;t++){const i=this.mv[t];if(!i)continue;const s=i.palette;this.Ev[t]=new Int32Array(s.length);for(let i=0;i{const i=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(i,e)|0)<<16)+((256*Math.pow(s,e)|0)<<8)+(256*Math.pow(n,e)|0)};static lc=t=>{this.gv||(this.Iv=t,this.it?this.gv=new r.Xr(t,16384):this.gv=new r.Xr(t,65536),this._v.fill(null))};static I_=(t,e,i,n,r,o,l,a,c)=>{let f=0,u=0;r!==n&&(f=(e-t<<16)/(r-n)|0,u=(a-l<<15)/(r-n)|0);let d=0,w=0;o!==r&&(d=(i-e<<16)/(o-r)|0,w=(c-a<<15)/(o-r)|0);let y=0,A=0;if(o!==n&&(y=(t-i<<16)/(n-o)|0,A=(l-c<<15)/(n-o)|0),n<=r&&n<=o){if(ns.A.bottom&&(r=s.A.bottom),o>s.A.bottom&&(o=s.A.bottom),rd)for(o-=r,r-=n,n=h.Ew[n];;){if(--r<0)for(;;){if(--o<0)return;this.Mv(i>>16,e>>16,c>>7,a>>7,s.A.bw,n,0),i+=y,e+=d,c+=A,a+=w,n+=s.A.Tw}this.Mv(i>>16,t>>16,c>>7,l>>7,s.A.bw,n,0),i+=y,t+=f,c+=A,l+=u,n+=s.A.Tw}else for(o-=r,r-=n,n=h.Ew[n];;){if(--r<0)for(;;){if(--o<0)return;this.Mv(e>>16,i>>16,a>>7,c>>7,s.A.bw,n,0),i+=y,e+=d,c+=A,a+=w,n+=s.A.Tw}this.Mv(t>>16,i>>16,l>>7,c>>7,s.A.bw,n,0),i+=y,t+=f,c+=A,l+=u,n+=s.A.Tw}else if(e=t<<=16,a=l<<=15,n<0&&(e-=y*n,t-=f*n,a-=A*n,l-=u*n,n=0),i<<=16,c<<=15,o<0&&(i-=d*o,c-=w*o,o=0),n!==o&&yf)for(r-=o,o-=n,n=h.Ew[n];;){if(--o<0)for(;;){if(--r<0)return;this.Mv(i>>16,t>>16,c>>7,l>>7,s.A.bw,n,0),i+=d,t+=f,c+=w,l+=u,n+=s.A.Tw}this.Mv(e>>16,t>>16,a>>7,l>>7,s.A.bw,n,0),e+=y,t+=f,a+=A,l+=u,n+=s.A.Tw}else for(r-=o,o-=n,n=h.Ew[n];;){if(--o<0)for(;;){if(--r<0)return;this.Mv(t>>16,i>>16,l>>7,c>>7,s.A.bw,n,0),i+=d,t+=f,c+=w,l+=u,n+=s.A.Tw}this.Mv(t>>16,e>>16,l>>7,a>>7,s.A.bw,n,0),e+=y,t+=f,a+=A,l+=u,n+=s.A.Tw}}else if(r<=o){if(rs.A.bottom&&(o=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),oy)for(n-=o,o-=r,r=h.Ew[r];;){if(--o<0)for(;;){if(--n<0)return;this.Mv(t>>16,i>>16,l>>7,c>>7,s.A.bw,r,0),t+=f,i+=y,l+=u,c+=A,r+=s.A.Tw}this.Mv(t>>16,e>>16,l>>7,a>>7,s.A.bw,r,0),t+=f,e+=d,l+=u,a+=w,r+=s.A.Tw}else for(n-=o,o-=r,r=h.Ew[r];;){if(--o<0)for(;;){if(--n<0)return;this.Mv(i>>16,t>>16,c>>7,l>>7,s.A.bw,r,0),t+=f,i+=y,l+=u,c+=A,r+=s.A.Tw}this.Mv(e>>16,t>>16,a>>7,l>>7,s.A.bw,r,0),t+=f,e+=d,l+=u,a+=w,r+=s.A.Tw}else if(i=e<<=16,c=a<<=15,r<0&&(i-=f*r,e-=d*r,c-=u*r,a-=w*r,r=0),t<<=16,l<<=15,n<0&&(t-=y*n,l-=A*n,n=0),o-=n,n-=r,r=h.Ew[r],f>16,e>>16,l>>7,a>>7,s.A.bw,r,0),t+=y,e+=d,l+=A,a+=w,r+=s.A.Tw}this.Mv(i>>16,e>>16,c>>7,a>>7,s.A.bw,r,0),i+=f,e+=d,c+=u,a+=w,r+=s.A.Tw}else for(;;){if(--n<0)for(;;){if(--o<0)return;this.Mv(e>>16,t>>16,a>>7,l>>7,s.A.bw,r,0),t+=y,e+=d,l+=A,a+=w,r+=s.A.Tw}this.Mv(e>>16,i>>16,a>>7,c>>7,s.A.bw,r,0),i+=f,e+=d,c+=u,a+=w,r+=s.A.Tw}}else if(os.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,a>>7,l>>7,s.A.bw,o,0),e+=d,t+=f,a+=w,l+=u,o+=s.A.Tw}this.Mv(e>>16,i>>16,a>>7,c>>7,s.A.bw,o,0),e+=d,i+=y,a+=w,c+=A,o+=s.A.Tw}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Mv(t>>16,e>>16,l>>7,a>>7,s.A.bw,o,0),e+=d,t+=f,a+=w,l+=u,o+=s.A.Tw}this.Mv(i>>16,e>>16,c>>7,a>>7,s.A.bw,o,0),e+=d,i+=y,a+=w,c+=A,o+=s.A.Tw}else if(t=i<<=16,l=c<<=15,o<0&&(t-=d*o,i-=y*o,l-=w*o,c-=A*o,o=0),e<<=16,a<<=15,r<0&&(e-=f*r,a-=u*r,r=0),n-=r,r-=o,o=h.Ew[o],d>16,i>>16,a>>7,c>>7,s.A.bw,o,0),e+=f,i+=y,a+=u,c+=A,o+=s.A.Tw}this.Mv(t>>16,i>>16,l>>7,c>>7,s.A.bw,o,0),t+=d,i+=y,l+=w,c+=A,o+=s.A.Tw}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Mv(i>>16,e>>16,c>>7,a>>7,s.A.bw,o,0),e+=f,i+=y,a+=u,c+=A,o+=s.A.Tw}this.Mv(i>>16,t>>16,c>>7,l>>7,s.A.bw,o,0),t+=d,i+=y,l+=w,c+=A,o+=s.A.Tw}};static Mv=(t,e,i,n,r,o,l)=>{let a;if(h.Rw){let c;if(h.A_){if(c=e-t>3?(n-i)/(e-t)|0:0,e>s.A.m_&&(e=s.A.m_),t<0&&(i-=t*c,t=0),t>=e)return;o+=t,l=e-t>>2,c<<=2}else{if(!(t>2)>0?(n-i)*h.yv[l]>>15:0}if(0===h.alpha)for(;;){if(--l<0){if((l=e-t&3)>0){a=h.palette[i>>8];do{r[o++]=a,l--}while(l>0);return}break}a=h.palette[i>>8],i+=c,r[o++]=a,r[o++]=a,r[o++]=a,r[o++]=a}else{const s=h.alpha,n=256-h.alpha;for(;;){if(--l<0){if((l=e-t&3)>0){a=h.palette[i>>8],a=((16711935&a)*n>>8&16711935)+((65280&a)*n>>8&65280);do{r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),l--}while(l>0)}break}a=h.palette[i>>8],i+=c,a=((16711935&a)*n>>8&16711935)+((65280&a)*n>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280)}}}else if(ts.A.m_&&(e=s.A.m_),t<0&&(i-=t*c,t=0),t>=e))return;if(o+=t,l=e-t,0===h.alpha)do{r[o++]=h.palette[i>>8],i+=c,l--}while(l>0);else{const t=h.alpha,e=256-h.alpha;do{a=h.palette[i>>8],i+=c,a=((16711935&a)*e>>8&16711935)+((65280&a)*e>>8&65280),r[o++]=a+((16711935&r[o])*t>>8&16711935)+((65280&r[o])*t>>8&65280),l--}while(l>0)}}};static kv=(t,e,i,n,r,h,o)=>{let l=0;r!==n&&(l=(e-t<<16)/(r-n)|0);let a=0;h!==r&&(a=(i-e<<16)/(h-r)|0);let c=0;if(h!==n&&(c=(t-i<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),ra)for(h-=r,r-=n,n=this.Ew[n];;){if(--r<0)for(;;){if(--h<0)return;this.Dv(i>>16,e>>16,s.A.bw,n,o),i+=c,e+=a,n+=s.A.Tw}this.Dv(i>>16,t>>16,s.A.bw,n,o),i+=c,t+=l,n+=s.A.Tw}else for(h-=r,r-=n,n=this.Ew[n];;){if(--r<0)for(;;){if(--h<0)return;this.Dv(e>>16,i>>16,s.A.bw,n,o),i+=c,e+=a,n+=s.A.Tw}this.Dv(t>>16,i>>16,s.A.bw,n,o),i+=c,t+=l,n+=s.A.Tw}else if(e=t<<=16,n<0&&(e-=c*n,t-=l*n,n=0),i<<=16,h<0&&(i-=a*h,h=0),n!==h&&cl)for(r-=h,h-=n,n=this.Ew[n];;){if(--h<0)for(;;){if(--r<0)return;this.Dv(i>>16,t>>16,s.A.bw,n,o),i+=a,t+=l,n+=s.A.Tw}this.Dv(e>>16,t>>16,s.A.bw,n,o),e+=c,t+=l,n+=s.A.Tw}else for(r-=h,h-=n,n=this.Ew[n];;){if(--h<0)for(;;){if(--r<0)return;this.Dv(t>>16,i>>16,s.A.bw,n,o),i+=a,t+=l,n+=s.A.Tw}this.Dv(t>>16,e>>16,s.A.bw,n,o),e+=c,t+=l,n+=s.A.Tw}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hc)for(n-=h,h-=r,r=this.Ew[r];;){if(--h<0)for(;;){if(--n<0)return;this.Dv(t>>16,i>>16,s.A.bw,r,o),t+=l,i+=c,r+=s.A.Tw}this.Dv(t>>16,e>>16,s.A.bw,r,o),t+=l,e+=a,r+=s.A.Tw}else for(n-=h,h-=r,r=this.Ew[r];;){if(--h<0)for(;;){if(--n<0)return;this.Dv(i>>16,t>>16,s.A.bw,r,o),t+=l,i+=c,r+=s.A.Tw}this.Dv(e>>16,t>>16,s.A.bw,r,o),t+=l,e+=a,r+=s.A.Tw}else if(i=e<<=16,r<0&&(i-=l*r,e-=a*r,r=0),t<<=16,n<0&&(t-=c*n,n=0),l>16,e>>16,s.A.bw,r,o),t+=c,e+=a,r+=s.A.Tw}this.Dv(i>>16,e>>16,s.A.bw,r,o),i+=l,e+=a,r+=s.A.Tw}else for(h-=n,n-=r,r=this.Ew[r];;){if(--n<0)for(;;){if(--h<0)return;this.Dv(e>>16,t>>16,s.A.bw,r,o),t+=c,e+=a,r+=s.A.Tw}this.Dv(e>>16,i>>16,s.A.bw,r,o),i+=l,e+=a,r+=s.A.Tw}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.bw,h,o),e+=a,t+=l,h+=s.A.Tw}this.Dv(e>>16,i>>16,s.A.bw,h,o),e+=a,i+=c,h+=s.A.Tw}else for(r-=n,n-=h,h=this.Ew[h];;){if(--n<0)for(;;){if(--r<0)return;this.Dv(t>>16,e>>16,s.A.bw,h,o),e+=a,t+=l,h+=s.A.Tw}this.Dv(i>>16,e>>16,s.A.bw,h,o),e+=a,i+=c,h+=s.A.Tw}else if(t=i<<=16,h<0&&(t-=a*h,i-=c*h,h=0),e<<=16,r<0&&(e-=l*r,r=0),a>16,i>>16,s.A.bw,h,o),e+=l,i+=c,h+=s.A.Tw}this.Dv(t>>16,i>>16,s.A.bw,h,o),t+=a,i+=c,h+=s.A.Tw}else for(n-=r,r-=h,h=this.Ew[h];;){if(--r<0)for(;;){if(--n<0)return;this.Dv(i>>16,e>>16,s.A.bw,h,o),e+=l,i+=c,h+=s.A.Tw}this.Dv(i>>16,t>>16,s.A.bw,h,o),t+=a,i+=c,h+=s.A.Tw}};static b_=(t,e,i,n,r,h,o,l,a,c,f,u,d,w,y,A,m,p,g)=>{const _=this.Nv(g);this.vv=!this.bv[g];const I=c-d,C=f-y,E=u-m,v=w-c,b=A-f,T=p-u;let O=v*f-b*c<<14;const R=b*u-T*f<<8,L=T*c-v*u<<5;let S=I*f-C*c<<14;const x=C*u-E*f<<8,M=E*c-I*u<<5;let k=C*v-I*b<<14;const D=E*b-C*T<<8,N=I*T-E*v<<5;let F=0,B=0;r!==n&&(F=(e-t<<16)/(r-n)|0,B=(l-o<<16)/(r-n)|0);let P=0,U=0;h!==r&&(P=(i-e<<16)/(h-r)|0,U=(a-l<<16)/(h-r)|0);let G=0,W=0;if(h!==n&&(G=(t-i<<16)/(n-h)|0,W=(o-a<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),rP)for(h-=r,r-=n,n=this.Ew[n];;){if(--r<0)for(;;){if(--h<0)return;this.Fv(i>>16,e>>16,s.A.bw,n,_,0,0,O,S,k,R,x,D,a>>8,l>>8),i+=G,e+=P,a+=W,l+=U,n+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(i>>16,t>>16,s.A.bw,n,_,0,0,O,S,k,R,x,D,a>>8,o>>8),i+=G,t+=F,a+=W,o+=B,n+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(h-=r,r-=n,n=this.Ew[n];;){if(--r<0)for(;;){if(--h<0)return;this.Fv(e>>16,i>>16,s.A.bw,n,_,0,0,O,S,k,R,x,D,l>>8,a>>8),i+=G,e+=P,a+=W,l+=U,n+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(t>>16,i>>16,s.A.bw,n,_,0,0,O,S,k,R,x,D,o>>8,a>>8),i+=G,t+=F,a+=W,o+=B,n+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}else{e=t<<=16,l=o<<=16,n<0&&(e-=G*n,t-=F*n,l-=W*n,o-=B*n,n=0),i<<=16,a<<=16,h<0&&(i-=P*h,a-=U*h,h=0);const c=n-this.Aa;if(O+=L*c,S+=M*c,k+=N*c,O|=0,S|=0,k|=0,(n===h||G>=F)&&(n!==h||P<=F))for(r-=h,h-=n,n=this.Ew[n];;){if(--h<0)for(;;){if(--r<0)return;this.Fv(t>>16,i>>16,s.A.bw,n,_,0,0,O,S,k,R,x,D,o>>8,a>>8),i+=P,t+=F,a+=U,o+=B,n+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(t>>16,e>>16,s.A.bw,n,_,0,0,O,S,k,R,x,D,o>>8,l>>8),e+=G,t+=F,l+=W,o+=B,n+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(r-=h,h-=n,n=this.Ew[n];;){if(--h<0)for(;;){if(--r<0)return;this.Fv(i>>16,t>>16,s.A.bw,n,_,0,0,O,S,k,R,x,D,a>>8,o>>8),i+=P,t+=F,a+=U,o+=B,n+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(e>>16,t>>16,s.A.bw,n,_,0,0,O,S,k,R,x,D,l>>8,o>>8),e+=G,t+=F,l+=W,o+=B,n+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hG)for(n-=h,h-=r,r=this.Ew[r];;){if(--h<0)for(;;){if(--n<0)return;this.Fv(t>>16,i>>16,s.A.bw,r,_,0,0,O,S,k,R,x,D,o>>8,a>>8),t+=F,i+=G,o+=B,a+=W,r+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(t>>16,e>>16,s.A.bw,r,_,0,0,O,S,k,R,x,D,o>>8,l>>8),t+=F,e+=P,o+=B,l+=U,r+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(n-=h,h-=r,r=this.Ew[r];;){if(--h<0)for(;;){if(--n<0)return;this.Fv(i>>16,t>>16,s.A.bw,r,_,0,0,O,S,k,R,x,D,a>>8,o>>8),t+=F,i+=G,o+=B,a+=W,r+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(e>>16,t>>16,s.A.bw,r,_,0,0,O,S,k,R,x,D,l>>8,o>>8),t+=F,e+=P,o+=B,l+=U,r+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}else{i=e<<=16,a=l<<=16,r<0&&(i-=F*r,e-=P*r,a-=B*r,l-=U*r,r=0),t<<=16,o<<=16,n<0&&(t-=G*n,o-=W*n,n=0);const c=r-this.Aa;if(O+=L*c,S+=M*c,k+=N*c,O|=0,S|=0,k|=0,h-=n,n-=r,r=this.Ew[r],F>16,e>>16,s.A.bw,r,_,0,0,O,S,k,R,x,D,o>>8,l>>8),t+=G,e+=P,o+=W,l+=U,r+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(i>>16,e>>16,s.A.bw,r,_,0,0,O,S,k,R,x,D,a>>8,l>>8),i+=F,e+=P,a+=B,l+=U,r+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--h<0)return;this.Fv(e>>16,t>>16,s.A.bw,r,_,0,0,O,S,k,R,x,D,l>>8,o>>8),t+=G,e+=P,o+=W,l+=U,r+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(e>>16,i>>16,s.A.bw,r,_,0,0,O,S,k,R,x,D,l>>8,a>>8),i+=F,e+=P,a+=B,l+=U,r+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.bw,h,_,0,0,O,S,k,R,x,D,l>>8,o>>8),e+=P,t+=F,l+=U,o+=B,h+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(e>>16,i>>16,s.A.bw,h,_,0,0,O,S,k,R,x,D,l>>8,a>>8),e+=P,i+=G,l+=U,a+=W,h+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Fv(t>>16,e>>16,s.A.bw,h,_,0,0,O,S,k,R,x,D,o>>8,l>>8),e+=P,t+=F,l+=U,o+=B,h+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(i>>16,e>>16,s.A.bw,h,_,0,0,O,S,k,R,x,D,a>>8,l>>8),e+=P,i+=G,l+=U,a+=W,h+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}else{t=i<<=16,o=a<<=16,h<0&&(t-=P*h,i-=G*h,o-=U*h,a-=W*h,h=0),e<<=16,l<<=16,r<0&&(e-=F*r,l-=B*r,r=0);const c=h-this.Aa;if(O+=L*c,S+=M*c,k+=N*c,O|=0,S|=0,k|=0,n-=r,r-=h,h=this.Ew[h],P>16,i>>16,s.A.bw,h,_,0,0,O,S,k,R,x,D,l>>8,a>>8),e+=F,i+=G,l+=B,a+=W,h+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(t>>16,i>>16,s.A.bw,h,_,0,0,O,S,k,R,x,D,o>>8,a>>8),t+=P,i+=G,o+=U,a+=W,h+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Fv(i>>16,e>>16,s.A.bw,h,_,0,0,O,S,k,R,x,D,a>>8,l>>8),e+=F,i+=G,l+=B,a+=W,h+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.Fv(i>>16,t>>16,s.A.bw,h,_,0,0,O,S,k,R,x,D,a>>8,o>>8),t+=P,i+=G,o+=U,a+=W,h+=s.A.Tw,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}};static Fv=(t,e,i,n,r,h,o,l,a,c,f,u,d,w,y)=>{if(t>=e)return;let A,m,p,g,_,I,C,E,v;if(this.A_){if(A=(y-w)/(e-t)|0,e>s.A.m_&&(e=s.A.m_),t<0&&(w-=t*A,t=0),t>=e)return;m=e-t>>3,A<<=12}else e-t>7?(m=e-t>>3,A=(y-w)*this.yv[m]>>6):(m=0,A=0);if(w<<=9,n+=t,this.it&&r)if(p=0,g=0,I=t-this.ya,l+=(f>>3)*I,a+=(u>>3)*I,c+=(d>>3)*I,l|=0,a|=0,_=(c|=0)>>12,0!==_&&(o=a/_|0,(h=l/_|0)<0?h=0:h>4032&&(h=4032)),l+=f,a+=u,c+=d,l|=0,a|=0,_=(c|=0)>>12,0!==_&&(p=l/_|0,g=a/_|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=g-o>>3,h+=w>>3&786432,v=w>>23,this.vv){for(;m-- >0;)i[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,i[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,i[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,i[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,i[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,i[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,i[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,i[n++]=r[(4032&o)+(h>>6)]>>>v,h=p,o=g,l+=f,a+=u,_=(c+=d)>>12,0!==_&&(p=l/_|0,g=a/_|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=g-o>>3,h+=(w+=A)>>3&786432,v=w>>23;for(m=e-t&7;m-- >0;)i[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E}else{for(;m-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(i[n]=t),n+=1,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(i[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(i[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(i[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(i[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(i[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(i[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(i[n]=t),n+=1,h=p,o=g,l+=f,a+=u,c+=d,l|=0,a|=0,_=(c|=0)>>12,0!==_&&(p=l/_|0,g=a/_|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=g-o>>3,h+=(w+=A)>>3&786432,v=w>>23}for(m=e-t&7;m-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(i[n]=t),n++,h+=C,o+=E}}else if(p=0,g=0,I=t-this.ya,l+=(f>>3)*I,a+=(u>>3)*I,c+=(d>>3)*I,l|=0,a|=0,_=(c|=0)>>14,0!==_&&(o=a/_|0,(h=l/_|0)<0?h=0:h>16256&&(h=16256)),l+=f,a+=u,c+=d,l|=0,a|=0,_=(c|=0)>>14,0!==_&&(p=l/_|0,g=a/_|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=g-o>>3,h+=6291456&w,v=w>>23,this.vv&&r){for(;m-- >0;)i[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,i[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,i[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,i[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,i[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,i[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,i[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,i[n++]=r[(16256&o)+(h>>7)]>>>v,h=p,o=g,l+=f,a+=u,c+=d,l|=0,a|=0,_=(c|=0)>>14,0!==_&&(p=l/_|0,g=a/_|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=g-o>>3,h+=6291456&(w+=A),v=w>>23;for(m=e-t&7;m-- >0;)i[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E}else{for(;m-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(i[n]=t),n+=1,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(i[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(i[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(i[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(i[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(i[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(i[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(i[n]=t),n++,h=p,o=g,l+=f,a+=u,c+=d,l|=0,a|=0,_=(c|=0)>>14,0!==_&&(p=l/_|0,g=a/_|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=g-o>>3,h+=6291456&(w+=A),v=w>>23}for(m=e-t&7;m-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(i[n]=t),n++,h+=C,o+=E}}};static Dv=(t,e,i,n,r)=>{if(this.A_&&(e>s.A.m_&&(e=s.A.m_),t<0&&(t=0)),t>=e)return;n+=t;let h=e-t>>2;if(0===this.alpha)for(;;){if(h--,h<0)for(h=e-t&3;;){if(h--,h<0)return;i[n++]=r}i[n++]=r,i[n++]=r,i[n++]=r,i[n++]=r}const o=this.alpha,l=256-this.alpha;for(r=((16711935&r)*l>>8&16711935)+((65280&r)*l>>8&65280);;){if(h--,h<0)for(h=e-t&3;;){if(h--,h<0)return;i[n++]=r+((16711935&i[n])*o>>8&16711935)+((65280&i[n])*o>>8&65280)}i[n++]=r+((16711935&i[n])*o>>8&16711935)+((65280&i[n])*o>>8&65280),i[n++]=r+((16711935&i[n])*o>>8&16711935)+((65280&i[n])*o>>8&65280),i[n++]=r+((16711935&i[n])*o>>8&16711935)+((65280&i[n])*o>>8&65280),i[n++]=r+((16711935&i[n])*o>>8&16711935)+((65280&i[n])*o>>8&65280)}};static xv=t=>{this._v[t]&&this.gv&&(this.gv[this.Iv++]=this._v[t],this._v[t]=null)};static Nv=t=>{if(this.Cv[t]=this.Um++,this._v[t])return this._v[t];let e;if(this.Iv>0&&this.gv)e=this.gv[--this.Iv],this.gv[this.Iv]=null;else{let t=0,i=-1;for(let e=0;e>>3)&16316671,e[n+8192]=r-(r>>>2)&16316671,e[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===i.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)e[n+(t<<7)]=s[i.bw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)e[t]=s[i.bw[t]];this.bv[t]=!1;for(let i=0;i<16384;i++){e[i]&=16316671;const s=e[i];0===s&&(this.bv[t]=!0),e[i+16384]=s-(s>>>3)&16316671,e[i+32768]=s-(s>>>2)&16316671,e[i+49152]=s-(s>>>2)-(s>>>3)&16316671}}return e}}},880:(t,e,i)=>{i.d(e,{r:()=>n});var s=i(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(s.KE.src),s.KE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>s.KE.onload=()=>t())),s.VE.clearRect(0,0,s.XE.width,s.XE.height);const e=s.KE.naturalWidth,i=s.KE.naturalHeight;return s.XE.width=e,s.XE.height=i,s.VE.drawImage(s.KE,0,0),s.VE.getImageData(0,0,e,i)}},8665:(t,e,i)=>{i.d(e,{A:()=>f});var s=i(1069),n=i(8950),r=i(4583),h=i(6730),o=i(4474),l=i(3867);class a{Kd=0;xg=0;Bv=0;Pv=-1;Uv=-1;Gv=-1;Wv=-1;Yv=-1;Hv=-1;Vv=-1;Kv=-1;Xv=-1;jv=0;zv=-1;Zv=-1;qv=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static Jv=null;static $v=null;static Qv=null;static tb=null;static eb=null;static ib=null;static sb=null;static nb=null;static rb=null;static hb=null;static ob=null;static lb=null;static axis=null;static ab=new l.fi(4096,!1);static cb=new l.fi(4096,!1);static fb=new Int32Array(4096);static ub=new Int32Array(4096);static wb=new Int32Array(4096);static yb=new Int32Array(4096);static Ab=new Int32Array(4096);static mb=new Int32Array(4096);static pb=new Int32Array(1500);static gb=new l.Xr(1500,512);static _b=new Int32Array(12);static Ib=new l.Xr(12,2e3);static Cb=new Int32Array(2e3);static Eb=new Int32Array(2e3);static vb=new Int32Array(12);static bb=new Int32Array(10);static Tb=new Int32Array(10);static Ob=new Int32Array(10);static _r=0;static Rb=0;static Ir=0;static Lb=!1;static Hl=0;static Vl=0;static Sb=0;static xb=new Int32Array(1e3);static Mb=!1;static ac(t){try{f.head=new s.A(t.read('ob_head.dat')),f.Jv=new s.A(t.read('ob_face1.dat')),f.$v=new s.A(t.read('ob_face2.dat')),f.Qv=new s.A(t.read('ob_face3.dat')),f.tb=new s.A(t.read('ob_face4.dat')),f.eb=new s.A(t.read('ob_face5.dat')),f.ib=new s.A(t.read('ob_point1.dat')),f.sb=new s.A(t.read('ob_point2.dat')),f.nb=new s.A(t.read('ob_point3.dat')),f.rb=new s.A(t.read('ob_point4.dat')),f.hb=new s.A(t.read('ob_point5.dat')),f.ob=new s.A(t.read('ob_vertex1.dat')),f.lb=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.Lf=0,f.ib.Lf=0,f.sb.Lf=0,f.nb.Lf=0,f.rb.Lf=0,f.ob.Lf=0,f.lb.Lf=0;const e=f.head.Tu;f.metadata=new l.fi(e+100,null);let i=0,n=0,r=0,h=0,o=0,c=0,u=0;for(let t=0;t>7)<2?e=2:e>126&&(e=126),(65408&t)+e):(e<0?e=0:e>127&&(e=127),127-e)}static Vd=(t,e,i)=>{const s=t.Kd,n=t.xg,r=t.Bv;let h,o,a,u,d;if(e){h=new Int32Array(s);for(let e=0;e{const n=t.Kd,r=t.xg,h=t.Bv;let o,l,a,c,u;if(s)o=t.Xd,l=t.zd,a=t.jd;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let e=0;e{const i=t.Kd,s=t.xg,n=t.Bv,r=new Int32Array(i),h=new Int32Array(i),o=new Int32Array(i);for(let e=0;e{let i=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let i=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.Xd[e],a=t.zd[e],c=t.jd[e];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const e=f.metadata[t];if(!e)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.Jv&&f.$v&&f.Qv&&f.tb&&f.eb&&f.ib&&f.sb&&f.nb&&f.rb&&f.hb&&f.ob&&f.lb&&f.axis))throw new Error('cant loading model!!!!!');const i=e.Kd,s=e.xg,n=e.Bv,r=new Int32Array(i),h=new Int32Array(i),o=new Int32Array(i),l=new Int32Array(s),a=new Int32Array(s),c=new Int32Array(s),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;e.Yv>=0&&(y=new Int32Array(i));let A=null;e.Xv>=0&&(A=new Int32Array(s));let m=null,p=0;e.jv>=0?m=new Int32Array(s):p=-e.jv-1;let g=null;e.zv>=0&&(g=new Int32Array(s));let _=null;e.Zv>=0&&(_=new Int32Array(s));const I=new Int32Array(s);f.ib.Lf=e.Pv,f.sb.Lf=e.Uv,f.nb.Lf=e.Gv,f.rb.Lf=e.Wv,f.hb.Lf=e.Yv;let C,E,v,b=0,T=0,O=0;for(let t=0;t{if(!f.metadata||!f.metadata[e])throw new Error('No model metadata');const i=f.metadata[e];if(i.data=t,!i.data.length)throw new Error('No model data');const n=i.Kd,r=i.xg,h=i.Bv,o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n),c=new Int32Array(r),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(h),y=new Int32Array(h),A=new Int32Array(h);let m=null;i.Yv>=0&&(m=new Int32Array(n));let p=null;i.Xv>=0&&(p=new Int32Array(r));let g=null,_=0;i.jv>=0?g=new Int32Array(r):_=-i.jv-1;let I=null;i.zv>=0&&(I=new Int32Array(r));let C=null;i.Zv>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(i.data);v.Lf=i.Pv;const b=new s.A(i.data);b.Lf=i.Uv;const T=new s.A(i.data);T.Lf=i.Gv;const O=new s.A(i.data);O.Lf=i.Wv;const R=new s.A(i.data);R.Lf=i.Yv;let L,S,x,M=0,k=0,D=0;for(let t=0;tthis.iw&&(this.iw=-i),i>this.bg&&(this.bg=i);const n=e*e+s*s;n>this.Lm&&(this.Lm=n)}this.Lm=Math.sqrt(this.Lm)+.99|0,this.Vb=Math.sqrt(this.Lm*this.Lm+this.iw*this.iw)+.99|0,this.Hb=this.Vb+(Math.sqrt(this.Lm*this.Lm+this.bg*this.bg)+.99|0)}Zd(){this.iw=0,this.bg=0;for(let t=0;tthis.iw&&(this.iw=-e),e>this.bg&&(this.bg=e)}this.Vb=Math.sqrt(this.Lm*this.Lm+this.iw*this.iw)+.99|0,this.Hb=this.Vb+(Math.sqrt(this.Lm*this.Lm+this.bg*this.bg)+.99|0)}Wa(){if(this.Kb){const t=new Int32Array(256);let e=0;for(let i=0;ie&&(e=s)}this.Qd=new l.fi(e+1,null);for(let i=0;i<=e;i++)this.Qd[i]=new Int32Array(t[i]),t[i]=0;let i=0;for(;ie&&(e=s)}this.$d=new l.fi(e+1,null);for(let i=0;i<=e;i++)this.$d[i]=new Int32Array(t[i]),t[i]=0;let i=0;for(;il;)l=i[o++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(e!==l||0===r.types[e])&&this.qb(s.x[t],s.y[t],s.z[t],r.labels[e],r.types[e])}f._r=0,f.Rb=0,f.Ir=0,o=0,l=i[o++];for(let t=0;tl;)l=i[o++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(e===l||0===r.types[e])&&this.qb(n.x[t],n.y[t],n.z[t],r.labels[e],r.types[e])}}else this.Ya(t)}Ya(t){if(!this.Qd||-1===t||!h.A.Do[t])return;const e=h.A.Do[t],i=e.WE;f._r=0,f.Rb=0,f.Ir=0;for(let t=0;t>16;this.jd[t]=this.zd[t]*e+this.jd[t]*i>>16,this.zd[t]=s}}translate(t,e,i){for(let s=0;s>8;if(this.Nb&&this.Fb&&this.Bb||(this.Nb=new Int32Array(this.xg),this.Fb=new Int32Array(this.xg),this.Bb=new Int32Array(this.xg)),!this.mg){this.mg=new l.fi(this.Kd,null);for(let t=0;t8192||m>8192||p>8192||A<-8192||m<-8192||p<-8192;)A>>=1,m>>=1,p>>=1;let g=0|Math.sqrt(A*A+m*m+p*p);if(g<=0&&(g=1),A=256*A/g|0,m=256*m/g|0,p=256*p/g|0,this.Sg&&1&this.Sg[e]){const r=t+((i*A+s*m+n*p)/(h+(h/2|0))|0);this.Wu&&(this.Nb[e]=f.Db(this.Wu[e],r,this.Sg[e]))}else{let t=this.mg[r];t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.mg[o],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.mg[l],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++)}}if(r)this._g(t,h,i,s,n);else{this.vg=new l.fi(this.Kd,null);for(let t=0;t>16;for(let s=0;s>16,_=_*w-g*d>>16,g=p),0!==t&&(p=_*a-I*l>>16,I=_*l+I*a>>16,_=p),0!==e&&(p=I*c+g*u>>16,I=I*u-g*c>>16,g=p),g+=n,_+=h,I+=o,p=_*A-I*y>>16,I=_*y+I*A>>16,_=p,f.fb&&f.ub&&f.wb&&(f.wb[s]=I-m,f.fb[s]=r.A.ya+((g<<9)/I|0),f.ub[s]=r.A.Aa+((_<<9)/I|0)),this.Bv>0&&f.yb&&f.Ab&&f.mb&&(f.yb[s]=g,f.Ab[s]=_,f.mb[s]=I)}try{this.Qb(!1,!1,0)}catch(t){}}draw(t,e,i,s,h,o,l,a,c){const u=a*h-o*s>>16,d=l*e+u*i>>16,w=this.Lm*i>>16,y=d+w;if(y<=50||d>=3500)return;const A=a*s+o*h>>16;let m=A-this.Lm<<9;if((m/y|0)>=n.A.lv)return;let p=A+this.Lm<<9;if((p/y|0)<=-n.A.lv)return;const g=l*i-u*e>>16,_=this.Lm*e>>16;let I=g+_<<9;if((I/y|0)<=-n.A.av)return;let C=g-(_+(this.iw*i>>16))<<9;if((C/y|0)>=n.A.av)return;let E=d-(w+(this.iw*e>>16))<=50,v=!1;if(c>0&&f.Lb){let t=d-w;t<=50&&(t=50),A>0?(m=m/y|0,p=p/t|0):(p=p/y|0,m=m/t|0),g>0?(C=C/y|0,I=I/t|0):(I=I/y|0,C=C/t|0);const e=f.Hl-r.A.ya,i=f.Vl-r.A.Aa;e>m&&eC&&i>16,w=w*R-c*O>>16,c=r),c+=o,u+=l,w+=a,r=w*s+c*h>>16,w=w*h-c*s>>16,c=r,r=u*i-w*e>>16,w=u*e+w*i>>16,u=r,f.wb&&(f.wb[n]=w-d),w>=50&&f.fb&&f.ub?(f.fb[n]=b+((c<<9)/w|0),f.ub[n]=T+((u<<9)/w|0)):f.fb&&(f.fb[n]=-5e3,E=!0),(E||this.Bv>0)&&f.yb&&f.Ab&&f.mb&&(f.yb[n]=c,f.Ab[n]=u,f.mb[n]=w)}try{this.Qb(E,v,c)}catch(t){}}Qb(t,e,i,s=!1){f.Mb&&(this.zb=-1,this.Zb=-1);for(let t=0;tn.A.m_||a>n.A.m_||c>n.A.m_),f.gb&&f.pb){const t=((y+A+m)/3|0)+this.Vb;f.gb[t][f.pb[t]++]=s,f.Mb&&this.tT(f.Hl,f.Vl,u,d,w,l,a,c)&&this.Zb=0;t--){const e=f.pb[t];if(!(e<=0)&&f.gb){const i=f.gb[t];for(let t=0;t=0;t--){const e=f.pb[t];if(e>0&&f.gb){const i=f.gb[t];for(let s=0;s0||f._b[2]>0)&&(r=(f.vb[1]+f.vb[2])/(f._b[1]+f._b[2])|0);let h=0;f._b&&f.vb&&(f._b[3]>0||f._b[4]>0)&&(h=(f.vb[3]+f.vb[4])/(f._b[3]+f._b[4])|0);let o=0;if(f._b&&f.vb&&(f._b[6]>0||f._b[8]>0)&&(o=(f.vb[6]+f.vb[8])/(f._b[6]+f._b[8])|0),f._b&&f.Ib){let t,e=0,i=f._b[10],n=f.Ib[10],l=f.Cb;e===i&&(e=0,i=f._b[11],n=f.Ib[11],l=f.Eb),t=er;)try{this.eT(n[e++],s),e===i&&n!==f.Ib[11]&&(e=0,i=f._b[11],n=f.Ib[11],l=f.Eb),t=eh;)try{this.eT(n[e++],s),e===i&&n!==f.Ib[11]&&(e=0,i=f._b[11],n=f.Ib[11],l=f.Eb),t=eo;)try{this.eT(n[e++],s),e===i&&n!==f.Ib[11]&&(e=0,i=f._b[11],n=f.Ib[11],l=f.Eb),t=e>2,h=this.Gb[e],o=this.Wb[e],l=this.Yb[e];r.A.b_(f.fb[i],f.fb[s],f.fb[n],f.ub[i],f.ub[s],f.ub[n],this.Nb[t],this.Fb[t],this.Bb[t],f.yb[h],f.Ab[h],f.mb[h],f.yb[o],f.yb[l],f.Ab[o],f.Ab[l],f.mb[o],f.mb[l],this.Wu[t])}else if(3===h&&this.Sg&&this.Wu&&this.Nb&&f.fb&&f.ub&&f.yb&&f.Ab&&f.mb){const e=this.Sg[t]>>2,h=this.Gb[e],o=this.Wb[e],l=this.Yb[e];r.A.b_(f.fb[i],f.fb[s],f.fb[n],f.ub[i],f.ub[s],f.ub[n],this.Nb[t],this.Nb[t],this.Nb[t],f.yb[h],f.Ab[h],f.mb[h],f.yb[o],f.yb[l],f.Ab[o],f.Ab[l],f.mb[o],f.mb[l],this.Wu[t])}}iT(t,e=!1){let i=0;if(f.mb){const e=r.A.ya,s=r.A.Aa,n=this.Mg[t],h=this.kg[t],o=this.Dg[t],l=f.mb[n],a=f.mb[h],c=f.mb[o];if(l>=50&&f.fb&&f.ub&&this.Nb)f.bb[i]=f.fb[n],f.Tb[i]=f.ub[n],f.Ob[i++]=this.Nb[t];else if(f.yb&&f.Ab&&this.Nb){const u=f.yb[n],d=f.Ab[n],w=this.Nb[t];if(c>=50&&this.Bb){const n=(50-l)*r.A.Av[c-l];f.bb[i]=e+((u+((f.yb[o]-u)*n>>16)<<9)/50|0),f.Tb[i]=s+((d+((f.Ab[o]-d)*n>>16)<<9)/50|0),f.Ob[i++]=w+((this.Bb[t]-w)*n>>16)}if(a>=50&&this.Fb){const n=(50-l)*r.A.Av[a-l];f.bb[i]=e+((u+((f.yb[h]-u)*n>>16)<<9)/50|0),f.Tb[i]=s+((d+((f.Ab[h]-d)*n>>16)<<9)/50|0),f.Ob[i++]=w+((this.Fb[t]-w)*n>>16)}}if(a>=50&&f.fb&&f.ub&&this.Fb)f.bb[i]=f.fb[h],f.Tb[i]=f.ub[h],f.Ob[i++]=this.Fb[t];else if(f.yb&&f.Ab&&this.Fb){const u=f.yb[h],d=f.Ab[h],w=this.Fb[t];if(l>=50&&this.Nb){const h=(50-a)*r.A.Av[l-a];f.bb[i]=e+((u+((f.yb[n]-u)*h>>16)<<9)/50|0),f.Tb[i]=s+((d+((f.Ab[n]-d)*h>>16)<<9)/50|0),f.Ob[i++]=w+((this.Nb[t]-w)*h>>16)}if(c>=50&&this.Bb){const n=(50-a)*r.A.Av[c-a];f.bb[i]=e+((u+((f.yb[o]-u)*n>>16)<<9)/50|0),f.Tb[i]=s+((d+((f.Ab[o]-d)*n>>16)<<9)/50|0),f.Ob[i++]=w+((this.Bb[t]-w)*n>>16)}}if(c>=50&&f.fb&&f.ub&&this.Bb)f.bb[i]=f.fb[o],f.Tb[i]=f.ub[o],f.Ob[i++]=this.Bb[t];else if(f.yb&&f.Ab&&this.Bb){const u=f.yb[o],d=f.Ab[o],w=this.Bb[t];if(a>=50&&this.Fb){const n=(50-c)*r.A.Av[a-c];f.bb[i]=e+((u+((f.yb[h]-u)*n>>16)<<9)/50|0),f.Tb[i]=s+((d+((f.Ab[h]-d)*n>>16)<<9)/50|0),f.Ob[i++]=w+((this.Fb[t]-w)*n>>16)}if(l>=50&&this.Nb){const h=(50-c)*r.A.Av[l-c];f.bb[i]=e+((u+((f.yb[n]-u)*h>>16)<<9)/50|0),f.Tb[i]=s+((d+((f.Ab[n]-d)*h>>16)<<9)/50|0),f.Ob[i++]=w+((this.Nb[t]-w)*h>>16)}}}const s=f.bb[0],h=f.bb[1],o=f.bb[2],l=f.Tb[0],a=f.Tb[1],c=f.Tb[2];if(!((s-h)*(c-a)-(l-a)*(o-h)<=0))if(r.A.A_=!1,3===i){let i;if((s<0||h<0||o<0||s>n.A.m_||h>n.A.m_||o>n.A.m_)&&(r.A.A_=!0),i=this.Sg?3&this.Sg[t]:0,e)r.A.fv(s,h,l,a,f.Ob[0]),r.A.fv(h,o,a,c,f.Ob[1]),r.A.fv(o,s,c,l,f.Ob[2]);else if(0===i)r.A.I_(s,h,o,l,a,c,f.Ob[0],f.Ob[1],f.Ob[2]);else if(1===i&&this.Nb)r.A.kv(s,h,o,l,a,c,r.A.palette[this.Nb[t]]);else if(2===i&&this.Sg&&this.Wu&&f.yb&&f.Ab&&f.mb){const e=this.Sg[t]>>2,i=this.Gb[e],n=this.Wb[e],u=this.Yb[e];r.A.b_(s,h,o,l,a,c,f.Ob[0],f.Ob[1],f.Ob[2],f.yb[i],f.Ab[i],f.mb[i],f.yb[n],f.yb[u],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],this.Wu[t])}else if(3===i&&this.Sg&&this.Wu&&this.Nb&&f.yb&&f.Ab&&f.mb){const e=this.Sg[t]>>2,i=this.Gb[e],n=this.Wb[e],u=this.Yb[e];r.A.b_(s,h,o,l,a,c,this.Nb[t],this.Nb[t],this.Nb[t],f.yb[i],f.Ab[i],f.mb[i],f.yb[n],f.yb[u],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],this.Wu[t])}}else if(4===i){let i;if((s<0||h<0||o<0||s>n.A.m_||h>n.A.m_||o>n.A.m_||f.bb[3]<0||f.bb[3]>n.A.m_)&&(r.A.A_=!0),i=this.Sg?3&this.Sg[t]:0,e)r.A.fv(s,h,l,a,f.Ob[0]),r.A.fv(h,o,a,c,f.Ob[1]),r.A.fv(o,f.bb[3],c,f.Tb[3],f.Ob[2]),r.A.fv(f.bb[3],s,f.Tb[3],l,f.Ob[3]);else if(0===i)r.A.I_(s,h,o,l,a,c,f.Ob[0],f.Ob[1],f.Ob[2]),r.A.I_(s,o,f.bb[3],l,c,f.Tb[3],f.Ob[0],f.Ob[2],f.Ob[3]);else if(1===i){if(this.Nb){const e=r.A.palette[this.Nb[t]];r.A.kv(s,h,o,l,a,c,e),r.A.kv(s,o,f.bb[3],l,c,f.Tb[3],e)}}else if(2===i&&this.Sg&&this.Wu&&f.yb&&f.Ab&&f.mb){const e=this.Sg[t]>>2,i=this.Gb[e],n=this.Wb[e],u=this.Yb[e];r.A.b_(s,h,o,l,a,c,f.Ob[0],f.Ob[1],f.Ob[2],f.yb[i],f.Ab[i],f.mb[i],f.yb[n],f.yb[u],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],this.Wu[t]),r.A.b_(s,o,f.bb[3],l,c,f.Tb[3],f.Ob[0],f.Ob[2],f.Ob[3],f.yb[i],f.Ab[i],f.mb[i],f.yb[n],f.yb[u],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],this.Wu[t])}else if(3===i&&this.Sg&&this.Wu&&this.Nb&&f.yb&&f.Ab&&f.mb){const e=this.Sg[t]>>2,i=this.Gb[e],n=this.Wb[e],u=this.Yb[e];r.A.b_(s,h,o,l,a,c,this.Nb[t],this.Nb[t],this.Nb[t],f.yb[i],f.Ab[i],f.mb[i],f.yb[n],f.yb[u],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],this.Wu[t]),r.A.b_(s,o,f.bb[3],l,c,f.Tb[3],this.Nb[t],this.Nb[t],this.Nb[t],f.yb[i],f.Ab[i],f.mb[i],f.yb[n],f.yb[u],f.Ab[n],f.Ab[u],f.mb[n],f.mb[u],this.Wu[t])}}}qb(t,e,i,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f._r=0,f.Rb=0,f.Ir=0;for(let t=0;t0?(f._r=(f._r/n|0)+t,f.Rb=(f.Rb/n|0)+e,f.Ir=(f.Ir/n|0)+i):(f._r=t,f.Rb=e,f.Ir=i)}else if(1===n)for(let n=0;n=this.Qd.length)continue;const h=this.Qd[r];if(h)for(let s=0;s=this.Qd.length)continue;const o=this.Qd[h];if(o)for(let s=0;s>16;this.zd[n]=this.zd[n]*u-this.Xd[n]*c>>16,this.Xd[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.zd[n]*u-this.jd[n]*c>>16;this.jd[n]=this.zd[n]*c+this.jd[n]*u>>16,this.zd[n]=t}if(0!==l){c=r.A.sin[l],u=r.A.cos[l];const t=this.jd[n]*c+this.Xd[n]*u>>16;this.jd[n]=this.jd[n]*u-this.Xd[n]*c>>16,this.Xd[n]=t}this.Xd[n]+=f._r,this.zd[n]+=f.Rb,this.jd[n]+=f.Ir}}else if(3===n)for(let n=0;n=this.Qd.length)continue;const h=this.Qd[r];if(h)for(let s=0;s=this.$d.length)continue;const n=this.$d[i];if(n)for(let e=0;e255&&(this.Ub[i]=255)}}}$b(){this.iw=0,this.Lm=0,this.bg=0,this.Tg=999999,this.Og=-999999,this.Lg=-99999,this.Rg=99999;for(let t=0;tthis.Og&&(this.Og=e),sthis.Lg&&(this.Lg=s),-i>this.iw&&(this.iw=-i),i>this.bg&&(this.bg=i);const n=e*e+s*s;n>this.Lm&&(this.Lm=n)}this.Lm=0|Math.sqrt(this.Lm),this.Vb=0|Math.sqrt(this.Lm*this.Lm+this.iw*this.iw),this.Hb=this.Vb+(0|Math.sqrt(this.Lm*this.Lm+this.bg*this.bg))}tT(t,e,i,s,n,r,h,o){return!(ei&&e>s&&e>n)&&(!(t{i.d(e,{A:()=>o});var s=i(8950),n=i(1069),r=i(4474),h=i(880);class o extends r.A{bw;width;height;nT;rT;Xl;Iw;constructor(t,e){super(),this.bw=new Int32Array(t*e),this.width=this.Xl=t,this.height=this.Iw=e,this.nT=this.rT=0}static hT=async(t,e)=>{const i=t.read(e+'.dat');if(!i)throw new Error(`${e} jpeg not found!`);const s=await(0,h.r)(i),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),l=n.bw;for(let t=0;t>24&255)<<24|(255&e)<<16|(e>>8&255)<<8|e>>16&255}return n};static rc=(t,e,i=0)=>{const s=new n.A(t.read(e+'.dat')),r=new n.A(t.read('index.dat'));r.Lf=s.Tu;const h=r.Tu,l=r.Tu,a=[],c=r.Ru-1;for(let t=0;ts.length||r.Lf>r.length)throw new Error;const f=r.Ru,u=r.Ru,d=r.Tu,w=r.Tu,y=new o(d,w);y.nT=f,y.rT=u,y.Xl=h,y.Iw=l;const A=r.Ru;if(0===A){const t=y.width*y.height;for(let e=0;es.A.bottom&&(r-=e+r-s.A.bottom),ts.A.right){const e=t+h-s.A.right;h-=e,l+=e,o+=e}h>0&&r>0&&this.oT(h,r,this.bw,n,l,s.A.bw,i,o)}Kl(t,e,i){e|=0,i|=0;let n=(e+=this.nT)+(i+=this.rT)*s.A.Tw,r=0,h=this.height,o=this.width,l=s.A.Tw-o,a=0;if(is.A.bottom&&(h-=i+h-s.A.bottom),es.A.right){const t=e+o-s.A.right;o-=t,a+=t,l+=t}o>0&&h>0&&this.lT(o,h,this.bw,r,a,s.A.bw,n,l,t)}aT(t,e){t|=0,e|=0;let i=(t+=this.nT)+(e+=this.rT)*s.A.Tw,n=0,r=this.height,h=this.width,o=s.A.Tw-h,l=0;if(es.A.bottom&&(r-=e+r-s.A.bottom),ts.A.right){const e=t+h-s.A.right;h-=e,l+=e,o+=e}h>0&&r>0&&this.cT(h,r,this.bw,n,l,s.A.bw,i,o)}fT(){const t=this.bw,e=this.width,i=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=e,h<1?h=1:h>255&&(h=255);let o=255&n;o+=i,o<1?o=1:o>255&&(o=255),this.bw[s]=(r<<16)+(h<<8)+o}}}Bw(t,e,i,n){t|=0,e|=0,i|=0,n|=0;try{const r=this.width;let h=0,o=0;const l=this.Xl,a=this.Iw,c=(l<<16)/i|0,f=(a<<16)/n|0;t+=(this.nT*i+l-1)/l|0,e+=(this.rT*n+a-1)/a|0,this.nT*i%l!=0&&(h=(l-this.nT*i%l<<16)/i|0),this.rT*n%a!=0&&(o=(a-this.rT*n%a<<16)/n|0),i=i*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u=t+e*s.A.Tw,d=s.A.Tw-i;if(es.A.bottom&&(n-=e+n-s.A.bottom),ts.A.right){const e=t+i-s.A.right;i-=e,d+=e}this.scale(i,n,this.bw,h,o,s.A.bw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}dT(t,e,i,n,r,h,o,l,a,c){t|=0,e|=0,i|=0,n|=0;try{const f=-i/2|0,u=-n/2|0,d=65536*Math.sin(a/326.11)|0,w=65536*Math.cos(a/326.11)|0,y=d*c>>8,A=w*c>>8;let m=(o<<16)+u*y+f*A,p=u*A-f*y+(l<<16),g=t+e*s.A.Tw;for(let t=0;t>16)+(o>>16)*this.width],n+=A,o-=y;m+=y,p+=A,g+=s.A.Tw}}catch(t){}}wT(t,e,i){t|=0,e|=0;let n=(t+=this.nT)+(e+=this.rT)*s.A.Tw,r=0,h=this.height,o=this.width,l=s.A.Tw-o,a=0;if(es.A.bottom&&(h-=e+h-s.A.bottom),ts.A.right){const e=t+o-s.A.right;o-=e,a+=e,l+=e}o>0&&h>0&&this.yT(o,h,this.bw,a,r,s.A.bw,n,l,i.bw)}scale(t,e,i,s,n,r,h,o,l,a,c){try{const f=s;for(let u=-e;u<0;u++){const e=(n>>16)*l;for(let n=-t;n<0;n++){const t=i[(s>>16)+e];0===t?o++:r[o++]=t,s+=a}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}cT(t,e,i,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-e;a<0;a++){for(let t=l;t<0;t++)r[h++]=i[s++],r[h++]=i[s++],r[h++]=i[s++],r[h++]=i[s++];for(let e=t;e<0;e++)r[h++]=i[s++];h+=o,s+=n}}lT(t,e,i,s,n,r,h,o,l){const a=256-l;for(let c=-e;c<0;c++){for(let e=-t;e<0;e++){const t=i[s++];if(0===t)h++;else{const e=r[h];r[h++]=((16711935&t)*l+(16711935&e)*a&4278255360)+((65280&t)*l+(65280&e)*a&16711680)>>8}}h+=o,s+=n}}oT(t,e,i,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-e;a<0;a++){for(let t=l;t<0;t++){let t=i[s++];0===t?h++:r[h++]=t,t=i[s++],0===t?h++:r[h++]=t,t=i[s++],0===t?h++:r[h++]=t,t=i[s++],0===t?h++:r[h++]=t}for(let e=t;e<0;e++){const t=i[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}yT(t,e,i,s,n,r,h,o,l){const a=-(t>>2);t=-(3&t);for(let c=-e;c<0;c++){for(let t=a;t<0;t++){let t=i[n++];0!==t&&0===l[h]?r[h++]=t:h++,t=i[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=i[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=i[n++],0!==t&&0===l[h]?r[h++]=t:h++}for(let e=t;e<0;e++){const t=i[n++];0!==t&&0===l[h]?r[h++]=t:h++}h+=o,n+=s}}}},1673:(t,e,i)=>{i.d(e,{A:()=>h});var s=i(8950),n=i(1069),r=i(4474);class h extends r.A{bw;width;height;nT;rT;Xl;Iw;palette;constructor(t,e,i){super(),this.bw=new Int8Array(t*e),this.width=this.Xl=t,this.height=this.Iw=e,this.nT=this.rT=0,this.palette=i}static rc=(t,e,i=0)=>{const s=new n.A(t.read(e+'.dat')),r=new n.A(t.read('index.dat'));r.Lf=s.Tu;const o=r.Tu,l=r.Tu,a=r.Ru,c=new Int32Array(a);for(let t=1;ts.length||r.Lf>r.length)throw new Error;const f=r.Ru,u=r.Ru,d=r.Tu,w=r.Tu,y=new h(d,w,c);y.nT=f,y.rT=u,y.Xl=o,y.Iw=l;const A=y.bw,m=r.Ru;if(0===m){const t=y.width*y.height;for(let e=0;es.A.bottom&&(r-=e+r-s.A.bottom),ts.A.right){const e=t+h-s.A.right;h-=e,l+=e,o+=e}h>0&&r>0&&this.AT(h,r,this.bw,n,l,s.A.bw,i,o)}fT(){const t=this.bw,e=this.width,i=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=e,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=i,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}Lv(){this.Xl|=0,this.Iw|=0,this.Xl/=2,this.Iw/=2,this.Xl|=0,this.Iw|=0;const t=new Int8Array(this.Xl*this.Iw);let e=0;for(let i=0;i>1)+(i+this.rT>>1)*this.Xl]=this.bw[e++];this.bw=t,this.width=this.Xl,this.height=this.Iw,this.nT=0,this.rT=0}Bw(){if(this.width===this.Xl&&this.height===this.Iw)return;const t=new Int8Array(this.Xl*this.Iw);let e=0;for(let i=0;i>2);t=-(3&t);for(let a=-e;a<0;a++){for(let t=l;t<0;t++){let t=i[s++];0===t?h++:r[h++]=this.palette[255&t],t=i[s++],0===t?h++:r[h++]=this.palette[255&t],t=i[s++],0===t?h++:r[h++]=this.palette[255&t],t=i[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let e=t;e<0;e++){const t=i[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,e,i,n){try{const r=this.width;this.height;let h=0,o=0;const l=this.Xl,a=this.Iw,c=(l<<16)/i|0,f=(a<<16)/n|0;t=t+(this.nT*i+l-1)/l|0,e=e+(this.rT*n+a-1)/a|0,this.nT*i%l!=0&&(h=(l-this.nT*i%l<<16)/i|0),this.rT*n%a!=0&&(o=(a-this.rT*n%a<<16)/n|0),i=i*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u,d=t+e*s.A.Tw,w=s.A.Tw-i;es.A.bottom&&(n-=e+n-s.A.bottom),ts.A.right&&(u=t+i-s.A.right,i-=u,w+=u),this.mT(s.A.bw,this.bw,this.palette,h,o,d,w,i,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}mT(t,e,i,s,n,r,h,o,l,a,c,f){try{const u=s;for(let d=-l;d<0;d++){const l=(n>>16)*f;for(let n=-o;n<0;n++){const n=e[(s>>16)+l];0==n?r++:t[r++]=i[255&n],s+=a}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}},2682:(t,e,i)=>{i.d(e,{A:()=>l});var s=i(8950),n=i(1069),r=i(4474);class h{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}pT(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}gT(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=i(9298);class l extends r.A{static _T='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static IT=[];static{const t=navigator.userAgent.includes('Capacitor');for(let e=0;e<256;e++){let i=l._T.indexOf(String.fromCharCode(e));t&&i>=63&&i--,-1===i&&(i=74),l.IT[e]=i}}CT=[];ET=new Int32Array(94);vT=new Int32Array(94);bT=new Int32Array(94);TT=new Int32Array(94);OT=new Int32Array(95);RT=new Int32Array(256);random=new h(BigInt(Date.now()));height=0;static rc=(t,e)=>{const i=new n.A(t.read(e+'.dat')),s=new n.A(t.read('index.dat'));s.Lf=i.Tu+4;const r=s.Ru;r>0&&(s.Lf+=3*(r-1));const h=new l;for(let t=0;t<94;t++){h.bT[t]=s.Ru,h.TT[t]=s.Ru;const e=h.ET[t]=s.Tu,n=h.vT[t]=s.Tu,r=s.Ru,o=e*n;if(h.CT[t]=new Int8Array(o),0===r)for(let s=0;sh.height&&(h.height=n),h.bT[t]=1,h.OT[t]=e+2;{let i=0;for(let s=n/7|0;s=s.A.bottom&&(r-=i+r+1-s.A.bottom),e=s.A.right){const t=e+n+1-s.A.right;n-=t,a+=t,l+=t}n>0&&r>0&&this.BT(n,r,t,c,a,s.A.bw,o,l,h)}DT(t,e,i,n,r,h,o){i|=0,n|=0;let l=(t|=0)+(e|=0)*s.A.Tw,a=s.A.Tw-i,c=0,f=0;if(e=s.A.bottom&&(n-=e+n+1-s.A.bottom),t=s.A.right){const e=t+i+1-s.A.right;i-=e,c+=e,a+=e}i>0&&n>0&&this.PT(i,n,s.A.bw,l,a,o,f,c,r,h)}BT(t,e,i,s,n,r,h,o,l){const a=-((t|=0)>>2);t=-(3&t);for(let c=-(e|=0);c<0;c++){for(let t=a;t<0;t++)0===i[s++]?h++:r[h++]=l,0===i[s++]?h++:r[h++]=l,0===i[s++]?h++:r[h++]=l,0===i[s++]?h++:r[h++]=l;for(let e=t;e<0;e++)0===i[s++]?h++:r[h++]=l;h+=o,s+=n}}PT(t,e,i,s,n,r,h,o,l,a){t|=0;const c=((16711935&l)*a&4278255360)+((65280&l)*a&16711680)>>8,f=256-a;for(let l=-(e|=0);l<0;l++){for(let e=-t;e<0;e++)if(0===r[h++])s++;else{const t=i[s];i[s++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}s+=n,h+=o}}ST(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.ql:'cya'===t?o.A.jE:'mag'===t?o.A._m:'whi'===t?o.A.Sl:'bla'===t?o.A.Zl:'lre'===t?o.A.zE:'dre'===t?o.A.ZE:'dbl'===t?o.A.qE:'or1'===t?o.A.JE:'or2'===t?o.A.$E:'or3'===t?o.A.QE:'gr1'===t?o.A.tv:'gr2'===t?o.A.ev:'gr3'===t?o.A.iv:o.A.Zl}split(t,e){if(0===t.length)return[t];const i=[];for(;t.length>0;){if(this.xT(t)<=e&&-1===t.indexOf('|')){i.push(t);break}let s=t.length;for(let i=0;ie)break;s=i}else if('|'===t[i]){s=i;break}i.push(t.substring(0,s)),t=t.substring(s+1)}return i}}},1183:(t,e,i)=>{i.d(e,{A:()=>r});var s=i(8950),n=i(7854);class r{UT;width;height;GT;WT;bw;constructor(t,e,i=n.nl){this.GT=i,this.UT=this.GT.getImageData(0,0,t,e),this.WT=new Uint32Array(this.UT.data.buffer),this.bw=new Int32Array(t*e),this.width=t,this.height=e,this.bind()}clear(){this.bw.fill(0)}bind(){s.A.bind(this.bw,this.width,this.height)}draw(t,e){this.#t(),this.GT.putImageData(this.UT,t,e)}#t(){const t=this.bw.length,e=this.bw,i=this.WT;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,e,i)=>{i.d(e,{A:()=>s});class s{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,e)=>{const i=indexedDB.open('lostcity',1);i.onsuccess=e=>{const i=e.target;console.log('database success!'),t(i.result)},i.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},i.onerror=t=>{const i=t.target;console.error('database error!: ',i.error),e(i.result)}}));zo=async t=>await new Promise((e=>{const i=this.db.transaction('cache','readonly').objectStore('cache').get(t);i.onsuccess=()=>{e(i.result)},i.onerror=t=>{e(void 0)}}));Qo=async(t,e)=>await new Promise(((i,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(e,t);n.onsuccess=()=>{i()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};YT=t=>{const e=t.trim();let i=0;for(let t=0;t='A'&&s<='Z'?i+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?i+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(i+=s.charCodeAt(0)+27-48)}return i}}},2901:(t,e,i)=>{i.d(e,{A:()=>r});var s=i(1069),n=i(1908);class r{static YT=t=>{let e=0;t=t.toUpperCase();for(let i=0;i=this.VT)return null;if(this.ZT[t])return this.ZT[t];const e=this.zT[t],i=e+this.jT[t];if(this.HT){const s=Uint8Array.from(this.buffer.subarray(e,e+i));return this.ZT[t]=s,s}{const e=Uint8Array.from(n.A.read(this.XT[t],this.buffer,this.jT[t],this.zT[t]));return this.ZT[t]=e,e}}}},1069:(t,e,i)=>{i.d(e,{A:()=>h});var s=i(9234),n=i(6666),r=i(4474);class h extends r.A{static JT=3988292384;static $T=new Int32Array(256);static QT=new Uint32Array(33);static tO=new n.A;static eO=new n.A;static iO=new n.A;static sO=0;static nO=0;static rO=0;static{for(let t=0;t<32;t++)h.QT[t]=(1<>>=1:e=e>>>1^h.JT;h.$T[t]=e}}static Zo=t=>{let e=4294967295;for(let i=0;i>>8^h.$T[255&(e^t[i])];return~e};view;data;Lf=0;hO=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.Lf}static Pt=t=>{let e=null;return 0===t&&h.sO>0?(h.sO--,e=h.tO.$g()):1===t&&h.nO>0?(h.nO--,e=h.eO.$g()):2===t&&h.rO>0&&(h.rO--,e=h.iO.$g()),e?(e.Lf=0,e):new h(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.Lf=0,100===this.view.byteLength&&h.sO<1e3?(h.tO.jA(this),h.sO++):5e3===this.view.byteLength&&h.nO<250?(h.eO.jA(this),h.nO++):3e4===this.view.byteLength&&h.rO<50&&(h.iO.jA(this),h.rO++)}get Ru(){return this.view.getUint8(this.Lf++)}get Hd(){return this.view.getInt8(this.Lf++)}get Tu(){const t=this.view.getUint16(this.Lf);return this.Lf+=2,t}get Su(){const t=this.view.getInt16(this.Lf);return this.Lf+=2,t}get hd(){const t=this.view.getUint8(this.Lf++)<<16|this.view.getUint16(this.Lf);return this.Lf+=2,t}get el(){const t=this.view.getInt32(this.Lf);return this.Lf+=4,t}get uE(){const t=this.view.getBigInt64(this.Lf);return this.Lf+=8,t}get YE(){return this.view.getUint8(this.Lf)<128?this.Ru-64:this.Tu-49152}get Rm(){return this.view.getUint8(this.Lf)<128?this.Ru:this.Tu-32768}get ku(){const t=this.view,e=t.byteLength;let i,s='';for(;10!==(i=t.getUint8(this.Lf++))&&this.Lf>16),this.view.setUint16(this.Lf,t),this.Lf+=2}p4(t){this.view.setInt32(this.Lf,t),this.Lf+=4}cO(t){this.view.setInt32(this.Lf,t,!0),this.Lf+=4}fO(t){this.view.setBigInt64(this.Lf,t),this.Lf+=8}uO(t){const e=this.view,i=t.length;for(let s=0;s>>3}mO(t){let e=this.hO>>>3,i=8-(7&this.hO),s=0;for(this.hO+=t;t>i;i=8)s+=(this.view.getUint8(e++)&h.QT[i])<>>i-t&h.QT[t],s}pO(t,e){const i=this.Lf;this.Lf=0;const n=new Uint8Array(i);this.oO(i,0,n);const r=(0,s.gO)(n),h=(0,s._O)(r,e,t),o=(0,s.IO)(h);this.Lf=0,this.p1(o.length),this.dO(o,o.length,0)}}},5226:(t,e,i)=>{i.d(e,{Q:()=>n,x:()=>s});class s{CO=new Map;Eo;xo=self.isSecureContext?self.crypto.randomUUID():'0';constructor(t){this.Eo=t}async Ko(){const t=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),e=t.createDataChannel('channel'),i=crypto.randomUUID();this.CO.set(i,e),await t.setLocalDescription(await t.createOffer()),t.onicegatheringstatechange=async()=>{if('complete'===t.iceGatheringState){let e;self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(t.localDescription)):console.log(JSON.stringify(t.localDescription));try{for(;null===(e=prompt('Offer copied to clipboard, paste answer here')););t.setRemoteDescription(new RTCSessionDescription(JSON.parse(e)))}catch(t){console.error(t)}}},e.onopen=()=>{e.send(JSON.stringify({type:'id',id:i})),console.log('Connected to peer!')},e.onerror=t=>{console.error(t)},e.onmessage=t=>{const e=JSON.parse(t.data);e.data&&(e.data=Object.values(e.data)),this.Eo&&this.Eo.postMessage(e)}}postMessage(t){const e=this.CO.get(t.data.id),i=t.data;i.data&&(i.data=Array.from(t.data.data)),e&&'open'===e.readyState&&e.send(JSON.stringify(i))}}class n{pc;So=void 0;xo;constructor(t){this.pc=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),this.pc.ondatachannel=e=>{this.So=e.channel,this.So.onopen=()=>{console.log('Connected to host!')},this.So.onerror=t=>{console.error(t)},this.So.onmessage=e=>{if(!this.xo){const t=JSON.parse(e.data);if('id'===t.type)return void(this.xo=t.id)}t.onmessage&&t.onmessage(e)}},this.pc.onicegatheringstatechange=async()=>{'complete'===this.pc.iceGatheringState&&(self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(this.pc.localDescription)):console.log(JSON.stringify(this.pc.localDescription)))}}async Xo(t){await this.pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(t))),await this.pc.setLocalDescription(await this.pc.createAnswer())}}},3867:(t,e,i)=>{i.d(e,{dm:()=>a,um:()=>o,fi:()=>s,Fm:()=>n,Eh:()=>r,Mm:()=>h,Xr:()=>l});class s extends Array{constructor(t,e){super(t);for(let i=0;i{i.d(e,{IO:()=>o,Jo:()=>n,gO:()=>h,$o:()=>s,ic:()=>r,_O:()=>l});const s=async t=>new Promise((e=>setTimeout(e,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),r=async t=>(await fetch(t)).text();function h(t){let e=0n;for(let i=0;i0n;)e.unshift(Number(0xffn&t)),t>>=8n;return 128&e[0]&&e.unshift(0),new Uint8Array(e)}function l(t,e,i){let s=1n;for(;e>0n;)e%2n===1n&&(s=s*t%i),t=t*t%i,e>>=1n;return s}},1908:(t,e,i)=>{i.d(e,{A:()=>n});var s=i(9763);class n{static EO=null;static load=async t=>{this.EO=await(0,s.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,e,i,s)=>{if(!this.EO)throw new Error('bz2 not found!!');return Int8Array.from(this.EO.read(t,e,i,s))}}},123:(t,e,i)=>{function s(t,e,i){window._tinyMidiPlay&&window._tinyMidiPlay(t,e/256,i)}function n(t){window._tinyMidiStop&&window._tinyMidiStop(t)}i.d(e,{il:()=>s,Mo:()=>n})},2604:(t,e,i)=>{function s(t,e){var i;(i=document.createElement('a')).href=t,i.download=e,document.body.appendChild(i),i.style='display: none',i.click(),i.remove()}i.d(e,{A:()=>s})},9763:(t,e,i)=>{async function s(t,e={}){const i={env:Object.assign(Object.create(globalThis),e.env||{},{abort(t,e,i,s){t=h(t>>>0),e=h(e>>>0),i>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${e}:${i}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,i),n=s.memory||e.env.memory,r=Object.setPrototypeOf({read:(t,e,i,r)=>(e=function(t,e,i,r,h){if(null==r)return 0;const o=r.length,l=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,l,o).set(r);else for(let e=0;e>>0),r[e]);return s.__unpin(l),l}(l,6,0,e,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,e,i){if(!i)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(i-4)>>>e,r=new Array(s);for(let n=0;n>>0));return r}(a,0,s.read(t,e,i,r)>>>0))},s);function h(t){if(!t)return null;const e=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,i=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;e-s>1024;)r+=String.fromCharCode(...i.subarray(s,s+=1024));return r+String.fromCharCode(...i.subarray(s,e))}let o=new DataView(n.buffer);function l(t,e){try{o.setUint8(t,e,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,e,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}i.d(e,{F:()=>s})},9896:(t,e,i)=>{var s=i(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(e){if(window.audioContext){var i=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=i,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{const t=2,e=44100;let i=new Float32Array,n=window.audioContext.createGain();n.gain.setValueAtTime(.1,window.audioContext.currentTime),n.connect(window.audioContext.destination);let r=window.audioContext.currentTime,h=[];const o=new s.A({vO:30,bO:t=>{let e=new Float32Array(t.buffer),s=new Float32Array(i.length+e.length);s.set(i,0),s.set(e,i.length),i=s},TO:t=>{},bufferSize:102400});await o.init();const l=await fetch('./SCC1_Florestan.sf2'),a=new Uint8Array(await l.arrayBuffer());function c(){if(!window.audioContext||!i.length)return;let s=window.audioContext.createBufferSource();const o=i.length/t,l=window.audioContext.createBuffer(t,o,e);for(let e=0;e{t.stop(window.audioContext.currentTime)})),h=[],n.gain.setValueAtTime(t,window.audioContext.currentTime)}}function d(t,e){-1!==t&&window._tinyMidiVolume(t),r=window.audioContext.currentTime,f=setInterval(c,250),o.OO(e)}o.RO(a),window._tinyMidiStop=async t=>{t?function(t){const e=window.audioContext.currentTime;n.gain.cancelScheduledValues(e),n.gain.setTargetAtTime(0,e,.5),setTimeout(t,2e3)}((()=>{u()})):u()},window._tinyMidiVolume=(t=1)=>{n.gain.setValueAtTime(t,window.audioContext.currentTime)},window._tinyMidiPlay=async(t,e,i)=>{t&&(await window._tinyMidiStop(i),i?setTimeout((()=>{d(e,t)}),2e3):d(e,t))}})()},8151:(t,e,i)=>{i.d(e,{A:()=>n});var s=i(5473);const n=class{constructor(t={}){this.LO=void 0,this.SO=0,this.xO=0,this.MO=0,this.vO=t.vO||100,this.sampleRate=t.sampleRate||44100,this.kO=t.kO||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.DO(1),this.bO=t.bO||(()=>{}),this.TO=t.TO||(()=>{}),this.NO=void 0,this.test=0}async init(){if(!this.LO){if('undefined'!=typeof process){const{FO:t}=await import('path'),{BO:e}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=e("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.LO=await(0,s.A)(),this.PO=this.LO._malloc(this.bufferSize),this.UO=this.LO._malloc(8)}}DO(t){this.bufferSize=4*this.sampleRate*this.kO*t}GO(){if(!this.LO)throw new Error(`${this.constructor.name} not initalized. call .init()`)}RO(t){this.GO();const{_malloc:e,_free:i,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.LO;i(this.SO),this.SO=e(t.length),this.LO.HEAPU8.set(t,this.SO),this.xO=s(this.SO,t.length),n(this.xO,2===this.kO?0:2,this.sampleRate,this.gain)}WO(){this.GO();const t=new Uint8Array(this.bufferSize);return t.set(this.LO.HEAPU8.subarray(this.PO,this.PO+this.bufferSize)),t}YO(t){const{_malloc:e,_free:i,_tml_load_memory:s}=this.LO;return i(this.MO),this.MO=e(t.length),this.LO.HEAPU8.set(t,this.MO),s(this.MO,t.length)}HO(t){const{_midi_render:e}=this.LO;return e(this.xO,t,this.kO,this.sampleRate,this.PO,this.bufferSize,this.UO)}OO(t){if(this.GO(),!this.xO)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.NO);const{setValue:e,getValue:i}=this.LO;e(this.UO,0,'double'),this.LO._tsf_reset(this.xO),this.LO._tsf_channel_set_bank_preset(this.xO,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.YO(t);const n=()=>{s=this.HO(s);const t=this.WO();this.bO(t),s?this.NO=setTimeout(n,this.vO):this.TO(i(this.UO,'double'))};this.NO=setTimeout(n,16)}}},8227:(t,e,i)=>{t.exports=i.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,e,i)=>{var s;i.d(e,{A:()=>n});const n=(s="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var e,n,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,i){e=t,n=i})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(r.ready,t)||Object.defineProperty(r.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var h=Object.assign({},r),o=[],l='object'==typeof window,a='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!l&&!c&&!a;if(r.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var A,m;y=a?require('path').FO(y)+'/':__dirname+'/';var p=()=>{m||(A=require('fs'),m=require('path'))};u=(t,e)=>(p(),t=m.normalize(t),A.VO(t,e?void 0:'utf8')),w=t=>{var e=u(t,!0);return e.buffer||(e=new Uint8Array(e)),D(e.buffer),e},d=(t,e,i)=>{p(),t=m.normalize(t),A.KO(t,(function(t,s){t?i(t):e(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),r.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let e;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(e=read(t,'binary'),D('object'==typeof e),e)},d=function(t,e,i){setTimeout((()=>e(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!l&&!a)throw new Error('environment detection error');if(a?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),s&&(y=s),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var e=new XMLHttpRequest;return e.open('GET',t,!1),e.send(null),e.responseText},a&&(w=t=>{var e=new XMLHttpRequest;return e.open('GET',t,!1),e.responseType='arraybuffer',e.send(null),new Uint8Array(e.response)}),d=(t,e,i)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?e(s.response):i()},s.onerror=i,s.send(null)}}r.print||console.log.bind(console);var g,_,I=r.printErr||console.warn.bind(console);function C(t,e){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+e+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(r,h),h=null,g='fetchSettings',Object.getOwnPropertyDescriptor(r,g)&&j('`Module.'+g+'` was supplied but `'+g+'` not included in INCOMING_MODULE_JS_API'),r.arguments&&(o=r.arguments),C('arguments','arguments_'),r.thisProgram&&r.thisProgram,C('thisProgram','thisProgram'),r.quit&&r.quit,C('quit','quit_'),D(void 0===r.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===r.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===r.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===r.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===r.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),r.wasmBinary&&(_=r.wasmBinary),C('wasmBinary','wasmBinary');var v;r.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,O,R,L,S,x,M,k=!1;function D(t,e){t||j('Assertion failed'+(e?': '+e:''))}function N(t){b=t,r.HEAP8=T=new Int8Array(t),r.HEAP16=R=new Int16Array(t),r.HEAP32=L=new Int32Array(t),r.HEAPU8=O=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=S=new Uint32Array(t),r.HEAPF32=x=new Float32Array(t),r.HEAPF64=M=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var F=5242880;r.TOTAL_STACK&&D(F===r.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=r.INITIAL_MEMORY||16777216;function P(){if(!k){var t=ft(),e=S[t>>2],i=S[t+4>>2];34821223==e&&2310721022==i||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+i.toString(16)+' 0x'+e.toString(16)),1668509029!==S[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=F,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+F+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!r.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),e=new Int8Array(t.buffer);if(t[0]=25459,115!==e[0]||99!==e[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var U=[],G=[],W=[],Y=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var H=0,V=null,K=null,X={};function j(t){r.onAbort&&r.onAbort(t),I(t='Aborted('+t+')'),k=!0;var e=new WebAssembly.RuntimeError(t);throw n(e),e}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},XO:function(){z.error()},jO:function(){z.error()},zO:function(){z.error()},open:function(){z.error()},ZO:function(){z.error()},qO:function(){z.error()},JO:function(){z.error()},$O:function(){z.error()},QO:function(){z.error()}};r.FS_createDataFile=z.XO,r.FS_createPreloadedFile=z.jO;var Z,q,J,$,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function et(t){return t.startsWith('file://')}function it(t,e){return function(){var i=t,s=e;return e||(s=r.asm),D(Y,'native function `'+i+'` called before runtime initialization'),s[t]||D(s[t],'exported native function `'+i+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==Z&&_)return new Uint8Array(_);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(r)}function ht(t){ht.tR||(ht.tR={}),ht.tR[t]||(ht.tR[t]=1,c&&(t='warning: '+t),I(t))}function ot(t){try{return v.grow(t-b.byteLength+65535>>>16),N(v.buffer),1}catch(e){I('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+e)}}r.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=r.locateFile?r.locateFile(q,y):y+q):Z=new URL(i(8227),i.b).toString();var lt,at={"emscripten_memcpy_big":function(t,e,i){O.copyWithin(t,e,e+i)},"emscripten_resize_heap":function(t){var e=O.length;D((t>>>=0)>e);var i,s,n=2147483648;if(t>n)return I('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=e*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(i=Math.max(t,h))+((s=65536)-i%s)%s);if(ot(o))return!0}return I('Failed to grow the heap from '+e+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,e={'env':at,'wasi_snapshot_preview1':at};function i(t,e){var i,s=t.exports;r.asm=s,D(v=r.asm.memory,"memory not found in wasm exports"),N(v.buffer),D(r.asm.__indirect_function_table,"table not found in wasm exports"),i=r.asm.__wasm_call_ctors,G.unshift(i),function(t){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(X[t]),delete X[t]):I('warning: run dependency removed without ID'),0==H&&(null!==V&&(clearInterval(V),V=null),K)){var e=K;K=null,e()}}('wasm-instantiate')}t='wasm-instantiate',H++,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(k)return clearInterval(V),void(V=null);var t=!1;for(var e in X)t||(t=!0,I('still waiting on run dependencies:')),I('dependency: '+e);t&&I('(end of list)')}),1e4))):I('warning: run dependency added without ID');var s=r;function h(t){D(r===s,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),s=null,i(t.instance)}function o(t){return function(){if(!_&&(l||a)){if('function'==typeof fetch&&!et(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return st(Z)}));if(d)return new Promise((function(t,e){d(Z,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return st(Z)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then((function(t){return t})).then(t,(function(t){I('failed to asynchronously prepare wasm: '+t),et(Z)&&I('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(r.instantiateWasm)try{return r.instantiateWasm(e,i)}catch(t){I('Module.instantiateWasm callback failed with error: '+t),n(t)}(_||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||et(Z)||c||'function'!=typeof fetch?o(h):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(h,(function(t){return I('wasm streaming compile failed: '+t),I('falling back to ArrayBuffer instantiation'),o(h)}))}))).catch(n)}(),r.___wasm_call_ctors=it("__wasm_call_ctors"),r._malloc=it("malloc"),r._free=it("free"),r._tsf_load_memory=it("tsf_load_memory"),r._tsf_close=it("tsf_close"),r._tsf_reset=it("tsf_reset"),r._tsf_set_output=it("tsf_set_output"),r._tsf_set_max_voices=it("tsf_set_max_voices"),r._realloc=it("realloc"),r._tsf_channel_set_presetnumber=it("tsf_channel_set_presetnumber"),r._tsf_channel_set_bank_preset=it("tsf_channel_set_bank_preset"),r._tml_load_memory=it("tml_load_memory"),r._midi_render=it("midi_render"),r.___errno_location=it("__errno_location"),r._fflush=it("fflush"),r._emscripten_stack_init=function(){return(ct=r._emscripten_stack_init=r.asm.emscripten_stack_init).apply(null,arguments)}),ft=(r._emscripten_stack_get_free=function(){return(r._emscripten_stack_get_free=r.asm.emscripten_stack_get_free).apply(null,arguments)},r._emscripten_stack_get_base=function(){return(r._emscripten_stack_get_base=r.asm.emscripten_stack_get_base).apply(null,arguments)},r._emscripten_stack_get_end=function(){return(ft=r._emscripten_stack_get_end=r.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),S[t>>2]=34821223,S[t+4>>2]=2310721022,S[0]=1668509029}function dt(t){function i(){lt||(lt=!0,r.calledRun=!0,k||(D(!Y),Y=!0,P(),rt(G),e(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),D(!r._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(P(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),W.unshift(t);var t;rt(W)}()))}t=t||o,H>0||(ut(),function(){if(r.preRun)for('function'==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),U.unshift(t);var t;rt(U)}(),H>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),i()}),1)):i(),P()))}if(r.stackSave=it("stackSave"),r.stackRestore=it("stackRestore"),r.stackAlloc=it("stackAlloc"),r.setValue=function(t,e,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':T[0|t]=e;break;case'i16':R[t>>1]=e;break;case'i32':L[t>>2]=e;break;case'i64':$=[e>>>0,(J=e,+Math.abs(J)>=1?J>0?(0|Math.min(+Math.floor(J/4294967296),4294967295))>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],L[t>>2]=$[0],L[t+4>>2]=$[1];break;case'float':x[t>>2]=e;break;case'double':M[t>>3]=e;break;case'*':S[t>>2]=e;break;default:j('invalid type for setValue: '+i)}},r.getValue=function(t,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':return T[0|t];case'i16':return R[t>>1];case'i32':case'i64':return L[t>>2];case'float':return x[t>>2];case'double':return M[t>>3];case'*':return S[t>>2];default:j('invalid type for getValue: '+e)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){var e="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(e+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(e)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var e='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(e+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(e)}})})),K=function t(){lt||dt(),lt||(K=t)},r.preInit)for('function'==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return dt(),t.ready})}},r={};function h(t){var e=r[t];if(void 0!==e)return e.exports;var i=r[t]={exports:{}};return n[t](i,i.exports,h),i.exports}h.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",e="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",i="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",s=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},h.a=(n,r,h)=>{var o;h&&((o=[]).d=-1);var l,a,c,f=new Set,u=n.exports,d=new Promise(((t,e)=>{c=e,a=t}));d[e]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,r((n=>{var r;l=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var r=[];r.d=0,n.then((t=>{h[e]=t,s(r)}),(t=>{h[i]=t,s(r)}));var h={};return h[t]=t=>t(r),h}}var o={};return o[t]=t=>{},o[e]=n,o})))(n);var h=()=>l.map((t=>{if(t[i])throw t[i];return t[e]})),a=new Promise((e=>{(r=()=>e(h)).r=0;var i=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(r.r++,t.push(r)));l.map((e=>e[t](i)))}));return r.r?a:h()}),(t=>(t?c(d[i]=t):a(u),s(o)))),o&&o.d<0&&(o.d=0)},h.d=(t,e)=>{for(var i in e)h.o(e,i)&&!h.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},h.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),h.p="/Client2/",h.b=document.baseURI||self.location.href;h(9858)})(); \ No newline at end of file diff --git a/mapview.js b/mapview.js index 8e5c8b58..b8eb6be5 100644 --- a/mapview.js +++ b/mapview.js @@ -1 +1 @@ -(()=>{"use strict";var t,i,e,s,n={1651:(t,i,e)=>{e.d(i,{K:()=>D});var s=e(1120),n=e(4583),r=e(2901),h=e(1069),o=e(7046),l=(e(9896),e(6666)),a=e(3045),c=e(818),f=e(670),u=e(8268),d=e(3867),w=e(7854),y=e(8950),p=e(1302),A=e(9298),m=e(8665),g=e(1312),I=e(3819),_=e(8317),C=e(9234),E=e(1908),v=e(123),b=e(5637),T=e(6948),O=e(2164),R=e(8738),S=e(3764),L=e(8534),x=e(6730),M=e(2604),k=e(5226);class D extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static et=!1;static st='';static nt='';static rt=!1;static ht=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static gt=0;static It=0;static _t=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Ot=0;static Rt=()=>{a.A.et=!1,n.A.et=!1,D.et=!1,c.A.et=!1};static St=()=>{a.A.et=!0,n.A.et=!0,D.et=!0,c.A.et=!0};Lt=2048;xt=2047;Mt=!1;kt=!1;Dt=!1;Nt=!1;db=null;Ft=0;Bt=[];stream=null;in=h.A.Pt(1);Ut=h.A.Pt(1);Wt=h.A.Pt(1);Gt=0n;Yt=0;Ht=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;Jt=!0;$t=0;Qt=0;ti=null;ii=null;ei=null;si=null;ni=null;ri=null;hi=null;oi=null;li=null;ai=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;pi=null;Ai=[];mi=!1;gi=null;Ii=null;_i=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Oi=null;Ri=null;Si=new Int32Array(256);Li=0;xi=0;Mi=0;ki=null;Di=null;Ni=null;Fi=null;Bi=null;Pi=null;Ui=null;Wi=null;Gi=null;Yi=null;Hi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;Ji=null;$i=null;Qi=null;te=new Int32Array(33);ie=new Int32Array(33);ee=new Int32Array(151);se=new Int32Array(151);ne=null;re=null;he=null;oe=null;le=null;ae=null;ce=new d.fe(13,null);ue=null;de=null;we=new d.fe(50,null);ye=new d.fe(50,null);pe=new d.fe(20,null);Ae=new d.fe(20,null);me=null;ge=new d.fe(8,null);Ie=null;_e=null;Ce=null;Ee=null;ve=null;be=null;Te=null;Oe=null;Re=null;Se=null;Le=null;xe=null;Me=null;ke=null;De=null;Ne=null;Fe=null;Be=null;Pe=new d.fe(1e3,null);Ue=!1;We=!1;Ge=!1;Ye=!1;He=-1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=!1;Je=0;$e=0;Qe=0;ts=0;es=0;ss=0;ns=[];rs=-1;hs=-1;os=new s.A;ls=78;cs=0;fs=0;us=[];ds=0;ws=0;ys=0;ps=0;As=0;gs=0;Is=0;_s=0;Cs=[];Es=[];vs=[];bs=[];Ts=null;Os=-1;Rs=3;Ss=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Ls=0;xs=0;Ms=0;ks=!1;Ds=0;Ns=!1;Fs='';Bs='';Ps=0;Us='';Ws=!1;Gs=-1;Ys=new d.fe(100,null);Hs=new d.fe(100,null);messageType=new Int32Array(100);Vs=new Int32Array(100);Ks=0;Xs=0;js=0;zs='';Zs=0;qs=0;Js=0;$s=0;Qs=0;tn=0;en=0;sn=0;nn=0;rn=!1;hn=0;ln=0;an=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;pn=!1;An=[];mn=[];gn=0;In=0;_n=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);On=new Int32Array(500);Rn=0;Sn=0;Ln=0;xn='';Mn=!1;kn=-1;Dn=0;Nn=0;Fn=0;Bn=0;Pn=0;Un=new Int32Array(1e3);Wn=new Int32Array(1e3);Gn=null;Yn=0;Hn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;Jn=0;$n=2;Qn=2;tr=1;ir=new Int32Array(5);er=new d.fe(5,!1);sr=new Int32Array(5);nr=new Int32Array(5);rr=new Int32Array(5);hr=0;lr=0;ar=0;cr=0;ur=0;dr=0;wr=0;yr=0;pr=0;Ar=1;mr=2;gr=-1;Ir=0;_r=0;Cr=0;Er=0;vr=0;br=0;Tr=null;Or=null;Rr=null;Sr=0;Lr=0;Mr=new Int8Array(16384);kr=new d.fe(f.A.Dr,null);Nr=0;Fr=0;Br=128;Pr=0;Ur=0;Wr=0;Gr=0;Yr=0;Hr=null;Vr=null;Kr=new d.Xr(f.A.jr,f.A.jr);zr=0;Zr=0;qr=0;Jr=0;$r=0;Qr=0;th=0;ih=0;eh=0;sh=0;nh=0;rh=0;hh=new d.fe(this.Lt,null);oh=0;lh=new Int32Array(this.Lt);ah=0;fh=0;uh=new Int32Array(this.Lt);dh=new Int32Array(1e3);wh=new d.fe(this.Lt,null);yh=new d.fe(8192,null);ph=0;Ah=new Int32Array(8192);mh=new l.A;gh=new l.A;Ih=new l.A;_h=new l.A;Ch=new d.Eh(f.A.Dr,f.A.jr,f.A.jr,null);bh=new l.A;Th=new Int32Array(4e3);Oh=new Int32Array(4e3);Rh=new Int32Array(f.A.jr*f.A.jr);Sh=new Int32Array(f.A.jr*f.A.jr);Lh=0;xh=null;Mh=0;kh=0;Dh=-1;Nh=0;Fh=0;Bh=0;Ph=0;Uh=!1;Wh=!0;Gh=!1;Yh=new Int32Array(7);Hh=new Int32Array(5);Vh=0;Kh=0;static Xh=50;jh=new Int32Array(D.Xh);zh=new Int32Array(D.Xh);Zh=new Int32Array(D.Xh);qh=new Int32Array(D.Xh);Jh=new Int32Array(D.Xh);$h=new Int32Array(D.Xh);Qh=new Int32Array(D.Xh);io=new d.fe(D.Xh,null);eo=new d.fe(100,null);so=new BigInt64Array(100);no=new Int32Array(100);ro=null;ho=0;oo=!0;lo=new Int32Array(50);ao=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;po=0;Ao=!0;mo=null;Io=0;_o=0;Co=192;Eo=void 0;vo=!1;host=null;bo=null;To=new d.fe(16,null);Oo=0;Ro=!1;So=()=>{try{this.stream&&this.stream.close()}catch(t){}this.bo&&'998'===D.getParameter('world')&&this.bo.Lo?.send(JSON.stringify({type:'close',id:this.bo.xo})),this.stream=null,(0,v.Mo)(!1),this.Ut=null,this.Wt=null,this.in=null,this.Rr=null,this.Tr=null,this.Or=null,this.Hr=null,this.Vr=null,this.Gn=null,this.kr=null,this.Rh=null,this.Sh=null,this.Th=null,this.Oh=null,this.Mr=null,this.Di=null,this.Ni=null,this.Fi=null,this.Bi=null,this.Pi=null,this.Ui=null,this.Wi=null,this.Gi=null,this.Yi=null,this.Hi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.ne=null,this.he=null,this.re=null,this.oe=null,this.le=null,this.ae=null,this.ce=null,this.Te=null,this.Oe=null,this.Re=null,this.Se=null,this.Le=null,this.xe=null,this.Me=null,this.ke=null,this.De=null,this.Ne=null,this.de=null,this.pe=null,this.Ae=null,this.ge=null,this.Ie=null,this._e=null,this.Ce=null,this.Ee=null,this.we=null,this.ye=null,this.Kr=null,this.hh=null,this.lh=null,this.uh=null,this.wh=null,this.dh=null,this.yh=null,this.Ah=null,this.Ch=null,this.bh=null,this._h=null,this.mh=null,this.gh=null,this.Ih=null,this.Tn=null,this.On=null,this.vn=null,this.bn=null,this.ns=null,this.An=null,this.Un=null,this.Wn=null,this.Pe=null,this.ue=null,this.eo=null,this.so=null,this.no=null,this.si=null,this.ni=null,this.ti=null,this.ii=null,this.ei=null,this.ri=null,this.hi=null,this.oi=null,this.li=null,this.ko(),b.A.So(),T.A.So(),p.A.So(),O.A.Do=null,_.A.Do=null,s.A.Do=null,g.A.Do=null,R.A.Do=null,R.A.No=null,S.A.Do=null,this.Fo=null,u.A.No=null,n.A.So(),a.A.So(),m.A.So(),L.A.Do=[],x.A.Do=[]};Bo(){return this.$t}Po(){return this.Ws}Uo(){return this.Ns}Wo(){return this.hs}Go(){return this.He}ko=()=>{this.mi=!1,this.ki&&(clearInterval(this.ki),this.ki=null),this.ai=null,this.ci=null,this.Ai=[],this.bi=null,this.Ti=null,this.Oi=null,this.Ri=null,this.Ci=null,this._i=null,this.Ei=null,this.vi=null,this.gi=null,this.Ii=null};Yo=()=>{'999'===D.getParameter('world')?(this.Eo=new Worker('worker.js',{type:'module'}),this.Eo.onmessage=this.onmessage,this.host=new k.x(this.Eo)):'998'===D.getParameter('world')&&(this.Eo={onmessage:t=>{this.stream.Ho.onmessage(t)},postMessage:t=>{this.bo&&this.bo.Lo&&'open'===this.bo.Lo.readyState&&this.bo.Lo.send(JSON.stringify(t))},onerror:null,onmessageerror:null,terminate:()=>{throw new Error},addEventListener:()=>{throw new Error},removeEventListener:()=>{throw new Error},dispatchEvent:()=>{throw new Error}},this.bo=new k.Q(this.Eo))};onmessage=t=>{switch(t.data.type){case'ready':return void(this.vo=!0);case'save':return(0,M.A)(t.data.value,t.data.path.split('/').pop().split('\\').pop()),void URL.revokeObjectURL(t.data.value);case'close':return void this.Eo?.postMessage({type:'close',id:t.data.id})}this.host?.xo===t.data.id?this.stream.Ho.onmessage(t.data):this.host?.postMessage(t)};Vo=async()=>{if(999==+D.getParameter('world'))this.host&&await this.host.Ko();else if(998==+D.getParameter('world')&&this.bo){if(this.bo.Lo)return void console.log('You are already connected.');const t=prompt('Paste offer here, answer will be copied to clipboard');if(t)try{await this.bo.Xo(t)}catch(t){console.error(t)}}};jo=async(t,i,e,s)=>{let n=5,o=await(this.db?.zo(t));if(o&&h.A.Zo(o)!==e&&(o=void 0),o)return new r.A(o);for(;!o;){await this.qo(s,`Requesting ${i}`);try{o=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}${e}`):await(0,C.Jo)(`${D.nt}/${t}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.qo(s,`Error loading - Will retry in ${t} secs.`),await(0,C.$o)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Qo(t,o)),new r.A(o)};tl=async(t,i,e,s)=>{let n=await(this.db?.zo(t+'.mid'));if(n&&12345678!==i&&h.A.Zo(n)!==i&&(n=void 0),!n)try{n=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}_${i}.mid`):await(0,C.Jo)(`${D.nt}/songs/${t}.mid`),e!==n.length&&(n=n.slice(0,e))}catch(t){}if(!n)return;await(this.db?.Qo(t+'.mid',n));const r=new h.A(Uint8Array.from(n)).il,o=E.A.read(r,n,e,4);(0,v.el)(o,this.Co,s)};sl=()=>{if(w.nl.fillStyle='black',w.nl.fillRect(0,0,this.width,this.height),this.rl(1),this.Dt){this.mi=!1,w.nl.font='bold 16px helvetica, sans-serif',w.nl.textAlign='left',w.nl.fillStyle='yellow';let t=35;w.nl.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.nl.fillStyle='white',w.nl.fillText('To fix this try the following (in order):',30,t),t+=50,w.nl.font='bold 12px helvetica, sans-serif',w.nl.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.nl.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.nl.fillText('3: Try using a different game-world',30,t),t+=30,w.nl.fillText('4: Try rebooting your computer',30,t),t+=30,w.nl.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.mi=!1,w.nl.font='bold 20px helvetica, sans-serif',w.nl.textAlign='left',w.nl.fillStyle='white',w.nl.fillText('Error - unable to load game!',50,50),w.nl.fillText('To play RuneScape make sure you play from',50,100),w.nl.fillText('https://2004scape.org',50,150)),this.kt){this.mi=!1,w.nl.font='bold 13px helvetica, sans-serif',w.nl.textAlign='left',w.nl.fillStyle='yellow';let t=35;w.nl.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.nl.fillStyle='white',w.nl.fillText('To fix this try the following (in order):',30,t),t+=50,w.nl.font='bold 12px helvetica, sans-serif',w.nl.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.nl.fillText('2: Try rebooting your computer, and reloading',30,t)}};hl=t=>{if(!t.ol)return!1;for(let i=0;i=s)return!1}else if(3===t.ol[i]){if(e<=s)return!1}else if(4===t.ol[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};cl=(t,i,e,s,n)=>{this.ve?.draw(t,i),this.be?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,A.A.fl);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;y.A.fillRect(t,i+h+16,16,r,A.A.ul),y.A.dl(t,i+h+16,A.A.wl,r),y.A.dl(t+1,i+h+16,A.A.wl,r),y.A.yl(t,i+h+16,A.A.wl,16),y.A.yl(t,i+h+17,A.A.wl,16),y.A.dl(t+15,i+h+16,A.A.pl,r),y.A.dl(t+14,i+h+17,A.A.pl,r-1),y.A.yl(t,i+h+r+15,A.A.pl,16),y.A.yl(t+1,i+h+r+14,A.A.pl,15)};Al=(t,i)=>{let e=!1;const n=s.A.Do[t];if(!n.ml)return!1;for(let t=0;ts.delay[r.Cl];)r._l-=s.delay[r.Cl]+1,r.Cl++,r.Cl>=s.El&&(r.Cl-=s.vl,(r.Cl<0||r.Cl>=s.El)&&(r.Cl=0)),e=!0}}}return e};bl=(t,i,e,r,h=!1)=>{if(0!==t.type||!t.ml||t.hide&&this.Zs!==t.id&&this.qs!==t.id&&this.Js!==t.id)return;const o=y.A.left,l=y.A.top,a=y.A.right,c=y.A.bottom;y.A.Tl(i,e,i+t.width,e+t.height);const f=t.ml.length;for(let o=0;o0&&this.Ml(c),c.type===s.A.kl)c.Dl>c.scroll-c.height&&(c.Dl=c.scroll-c.height),c.Dl<0&&(c.Dl=0),this.bl(c,l,a,c.Dl,h),c.scroll>c.height&&this.cl(l+c.width,a,c.Dl,c.scroll,c.height);else if(c.type===s.A.Nl){let t=0;for(let i=0;i0){let i=0,e=0;const r=c.Pl[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qs===t){const h=p.A.Yl(r,c.Ul[t]);if(0!==this.tn&&this.Qs===t&&this.$s===c.id?(i=this.Hl-this.en,e=this.Vl-this.sn,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.nn<5&&(i=0,e=0),h.Kl(128,s+i,n+e)):0!==this.un&&this.dn===t&&this.wn===c.id?h.Kl(128,s,n):h.draw(s,n),33===h.Xl||1!==c.Ul[t]){const r=c.Ul[t];this.di?.jl(s+i+1,n+10+e,this.zl(r),A.A.Zl),this.di?.jl(s+i,n+9+e,this.zl(r),A.A.ql)}}}else if(c.Jl&&t<20){const i=c.Jl[t];i?.draw(s,n)}t++}}else if(c.type===s.A.$l)c.fill?y.A.fillRect(l,a,c.width,c.height,c.Ql):y.A.Sl(l,a,c.width,c.height,c.Ql);else if(c.type===s.A.ta){const t=c.font;let i=c.Ql,e=c.text;if(this.Js!==c.id&&this.qs!==c.id&&this.Zs!==c.id||0===c.ia||(i=c.ia),this.hl(c)&&(i=c.ea,c.sa&&c.sa.length>0&&(e=c.sa)),c.na===s.A.ra&&this.pn&&(e='Please wait...',i=c.Ql),!t||!e)continue;for(let s=a+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.ha(this.ll(c,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.ha(this.ll(c,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.ha(this.ll(c,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.ha(this.ll(c,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.ha(this.ll(c,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),c.oa?t.la(l+(c.width/2|0),s,r,i,c.aa):t.ca(l,s,r,i,c.aa)}}else if(c.type===s.A.fa){let t;t=this.hl(c)?c.ua:c.da,t?.draw(l,a)}else if(c.type===s.A.wa){const t=n.A.ya,i=n.A.pa;n.A.ya=l+(c.width/2|0),n.A.pa=a+(c.height/2|0);const e=n.A.sin[c.Aa]*c.zoom>>16,s=n.A.cos[c.Aa]*c.zoom>>16,r=this.hl(c);let h;h=r?c.Il:c.gl;let o=null;if(-1===h)o=c.ma(-1,-1,r);else{const t=g.A.Do[h];t.frames&&t.ga&&(o=c.ma(t.frames[c.Cl],t.ga[c.Cl],r))}o&&o.Ia(0,c._a,0,c.Aa,0,e,s),n.A.ya=t,n.A.pa=i}else if(c.type===s.A.Ca){const t=c.font;if(!t||!c.Pl||!c.Ul)continue;let i=0;for(let e=0;e0){const n=p.A.get(c.Pl[i]-1);let r=n.name;if((n.Ea||1!==c.Ul[i])&&(r=r+' x'+this.va(c.Ul[i])),!r)continue;const h=l+s*(c.Wl+115),o=a+e*(c.Gl+12);c.oa?t.la(h+(c.width/2|0),o,r,c.Ql,c.aa):t.ca(h,o,r,c.Ql,c.aa)}i++}}}y.A.Tl(o,l,a,c)};Ml=t=>{let i=t.xl;if(i>=s.A.ba&&i<=s.A.Ta)i--,i>=this.Vh?(t.text='',t.na=0):(t.text=this.eo[i],t.na=1);else if(i>=s.A.Oa&&i<=s.A.Ra)i-=s.A.Oa,i>=this.Vh?(t.text='',t.na=0):(0===this.no[i]?t.text='@red@Offline':this.no[i]===D.it?t.text='@gre@World-'+(this.no[i]-9):t.text='@yel@World-'+(this.no[i]-9),t.na=1);else if(i===s.A.Sa)t.scroll=15*this.Vh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=s.A.La&&i<=s.A.xa)i-=s.A.La,i>=this.fs?(t.text='',t.na=0):(t.text=I.A.Ma(I.A.ka(this.us[i])),t.na=1);else if(i===s.A.Da)t.scroll=15*this.fs+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===s.A.Na){if(t.Aa=150,t._a=256*Math.sin(this.Ft/40)&2047,this.Gh){this.Gh=!1;const i=new d.fe(7,null);let e=0;for(let t=0;t<7;t++){const s=this.Yh[t];s>=0&&(i[e++]=_.A.Do[s].ma())}const s=m.A.Fa(i,e);for(let t=0;t<5;t++)0!==this.Hh[t]&&(s.Ba(u.A.Pa[t][0],u.A.Pa[t][this.Hh[t]]),1===t&&s.Ba(u.A.Ua[0],u.A.Ua[this.Hh[t]]));if(this.xh){const i=g.A.Do[this.xh.Wa].frames;i&&(s.Ga(),s.Ya(i[0]),s.Ha(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===s.A.Va)this.Fe||(this.Fe=t.da,this.Be=t.ua),this.Wh?t.da=this.Be:t.da=this.Fe;else if(i===s.A.Ka)this.Fe||(this.Fe=t.da,this.Be=t.ua),this.Wh?t.da=this.Fe:t.da=this.Be;else if(i===s.A.Xa)t.text=this.xn,this.Ft%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===s.A.ja)this.Uh?this.Mn?(t.Ql=A.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Ql=A.A.Ll,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===s.A.za||i===s.A.Za)if(0===this.Dn)t.text='';else{let i;i=0===this.Nn?'earlier today':1===this.Nn?'yesterday':this.Nn+' days ago',t.text='You last logged in '+i+' from: '+I.A.qa(this.Dn)}else if(i===s.A.Ja)0===this.Bn&&(t.text='0 unread messages',t.Ql=A.A.ql),1===this.Bn&&(t.text='1 unread message',t.Ql=A.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Ql=A.A.GREEN);else if(i===s.A.$a)if(201===this.Fn)t.text='';else if(200===this.Fn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Fn?'Earlier today':1===this.Fn?'Yesterday':this.Fn+' days ago',t.text=i+' you changed your recovery questions'}else i===s.A.Qa?201===this.Fn?t.text='':200===this.Fn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===s.A.tc&&(201===this.Fn?t.text='':(this.Fn,t.text="Do this from the 'account management' area on our front webpage"))};ll=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let n=0,r=0;for(;;){const t=e[r++];if(0===t)return n;if(1===t)n+=this.Es[e[r++]];else if(2===t)n+=this.vs[e[r++]];else if(3===t)n+=this.Cs[e[r++]];else if(4===t){const t=s.A.Do[e[r++]],i=e[r++]+1;if(t.Pl&&t.Ul)for(let e=0;et<999999999?String(t):'*';va=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};zl=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,e)=>{e.d(i,{w:()=>h});var s=e(7046),n=e(1651),r=e(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');['0','998','999'].includes(s.A.getParameter('world'))?function(){if(+s.A.getParameter('world')>=998)return void(n.K.nt='data/pack/client');n.K.st='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0}():await async function(t){const i=await o(t,parseInt(s.A.getParameter('world'),10)),e=new URL(i.address);n.K.it=10+i.id-1,n.K.st=`${e.protocol}//${e.hostname}`,n.K.nt=`${e.protocol}//${e.hostname}:${e.port}`,t||(n.K.st=n.K.st.replace('https:','http:'));n.K.portOffset=i.portOffset,n.K.members=!0===i?.members,s.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===s.A.getParameter('detail').length&&s.A.setParameter('detail','high');'low'===s.A.getParameter('detail')?n.K.St():n.K.Rt()}(),0===s.A.getParameter('method').length&&s.A.setParameter('method','0')}async function o(t,i,e=0){if(e>=10)throw new Error('could not find world to connect!');const s=t?'https:':'http:';let n;try{n=JSON.parse(await(0,r.ec)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.$o)(1e3),o(t,i,++e)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hh:0});const h=n.find((t=>t.id===i));return h||o(t,i,10)}},7046:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(1183),n=e(4583),r=e(9234),h=e(9091),o=e(2595),l=e(7854);class a{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}sc=0;nc=[];rc=0;Fo=null;state=0;hc=20;oc=1;lc=[];ac=0;cc=0;fc=[];uc=!0;dc=!1;wc=50;hasFocus=!0;yc=!1;Ac=0;mc=0;Hl=0;Vl=0;gc=0;Ic=0;_c=0;Cc=[];Ec=[];vc=0;bc=0;input=null;Tc=!1;Oc=!1;Rc=!1;time=-1;Sc=0;Lc=0;xc=0;Mc=0;kc=0;Dc=0;constructor(t=!1){l.Nc.tabIndex=-1,l.nl.fillStyle='black',l.nl.fillRect(0,0,l.Nc.width,l.Nc.height),this.dc=t,this.dc?this.resize(window.innerWidth,window.innerHeight):this.resize(l.Nc.width,l.Nc.height)}get width(){return l.Nc.width}get height(){return l.Nc.height}resize=(t,i)=>{l.Nc.width=t,l.Nc.height=i,this.Fo=new s.A(t,i),n.A.Fc()};run=async()=>{l.Nc.addEventListener('resize',(()=>{this.dc&&this.resize(window.innerWidth,window.innerHeight)}),!1),l.Nc.onmousedown=this.onmousedown,l.Nc.onmouseup=this.onmouseup,l.Nc.onmouseenter=this.onmouseenter,l.Nc.onmouseleave=this.onmouseleave,l.Nc.onmousemove=this.onmousemove,window.onbeforeunload=this.So,l.Nc.onfocus=this.onfocus,l.Nc.onblur=this.onblur,this.Bc?(l.Nc.ontouchstart=this.ontouchstart,l.Nc.ontouchend=this.ontouchend,l.Nc.ontouchmove=this.ontouchmove):(l.Nc.onkeydown=this.onkeydown,l.Nc.onkeyup=this.onkeyup),l.Nc.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Bc&&'low'===a.getParameter('detail')&&(this.wc=30),await this.qo(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.lc[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.Pc();const h=e,o=s;e=300,s=1,t=performance.now();const l=this.lc[i];if(0===l?(e=h,s=o):t>l&&(e=2560*this.hc/(t-l)|0),e<25?e=25:e>256&&(e=256,s=this.hc-(t-l)/10|0),this.lc[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.lc[t]&&(this.lc[t]+=s);for(s0&&(this.ac=1e3*e/(256*this.hc)|0);const a=performance.now();if(this.uc&&this.refresh(),await this.draw(),this.fc[this.cc]=(performance.now()-a)/1e3,this.cc=(this.cc+1)%this.fc.length,this.wc<50){const i=1e3/this.wc-(performance.now()-t);i>0&&await(0,r.$o)(i)}}-1===this.state&&this.Pc()};Pc=()=>{this.state=-2,this.So()};rl=t=>{this.hc=1e3/t|0};Uc=t=>{this.wc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.hc|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};So=()=>{};draw=async()=>{};refresh=()=>{};async qo(t,i){const e=this.width,s=this.height;this.uc&&(l.nl.fillStyle='black',l.nl.fillRect(0,0,e,s),this.uc=!1);const n=s/2-18;l.nl.fillStyle='rgb(140, 17, 17)',l.nl.rect((e/2|0)-152,n,304,34),l.nl.fillRect((e/2|0)-150,n+2,3*t,30),l.nl.fillStyle='black',l.nl.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),l.nl.font='bold 13px helvetica, sans-serif',l.nl.textAlign='center',l.nl.fillStyle='white',l.nl.fillText(i,e/2|0,n+22),await(0,r.$o)(5)}Wc=()=>{let t=-1;return this.bc!==this.vc&&(t=this.Ec[this.vc],this.vc=this.vc+1&127),t};get ms(){const t=this.fc.length;let i=0;for(let e=0;ethis.sc&&(this.sc=e),this.nc[this.rc]=e,this.rc=(this.rc+1)%250,e}get Gc(){return this.nc.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.Ac=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Cc[n]=1),n>4&&(this.Ec[this.bc]=n,this.bc=this.bc+1&127),o.A.enabled&&o.A.Yc(n),h.g.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.Ac=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Cc[n]=0),o.A.enabled&&o.A.Hc(n),h.g.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.Tc=!1,(t.clientX>0||t.clientY>0)&&this.Vc(t),this.Ac=0,this.Ic=this.Hl,this._c=this.Vl,this.Bc&&!this.Kc){if(this.Xc()||this.jc()||this.zc())return this.gc=1,void(this.mc=1);t.timeStamp>=this.time+500?(this.gc=2,this.mc=2):(this.gc=1,this.mc=1)}else 2===t.button?(this.gc=2,this.mc=2):(this.gc=1,this.mc=1);o.A.enabled&&o.A.Zc(this.Ic,this._c,t.buttons)};onmouseup=t=>{this.Vc(t),this.Ac=0,this.mc=0,o.A.enabled&&o.A.qc(t.buttons)};onmouseenter=t=>{this.Vc(t),o.A.enabled&&o.A.Jc()};onmouseleave=t=>{this.Vc(t),this.Ac=0,this.Hl=-1,this.Vl=-1,this.mc=0,this.Ic=-1,this._c=-1,o.A.enabled&&o.A.$c()};onmousemove=t=>{this.Vc(t),this.Ac=0,o.A.enabled&&o.A.Qc(this.Hl,this.Vl)};onfocus=t=>{this.hasFocus=!0,this.uc=!0,this.refresh(),o.A.enabled&&o.A.tf()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.if()};ontouchstart=t=>{if(!this.Bc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.Tc=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Sc=this.kc=this.xc=0|i.screenX,this.Lc=this.Dc=this.Mc=0|i.screenY,this.time=t.timeStamp,this.Oc=this.ef(),this.Rc=this.sf()};ontouchend=t=>{if(!this.Bc||!this.Tc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.kc=0|i.screenX,this.Dc=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Oc&&!this.ef())return void(this.Tc=!1);if(this.Rc&&!this.sf())return void(this.Tc=!1);if(this.Xc()||this.nf()||this.jc()||this.zc()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.jc()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.zc()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Xc()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.nf()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.rf?t.setAttribute('type','password'):t.setAttribute('type',this.zc()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.rf&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.rf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.rf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.Tc=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.Sc-this.kc)>16||Math.abs(this.Lc-this.Dc)>16;n&&!r?(this.Tc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.mc=0,this.Tc=!1)};ontouchmove=t=>{if(!this.Bc||!this.Tc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.kc=0|i.screenX,this.Dc=0|i.screenY,this.Oc&&-1===this.Go()?(this.xc-this.kc>0?this.rotate(2):this.xc-this.kc<0&&this.rotate(0),this.Mc-this.Dc>0?this.rotate(3):this.Mc-this.Dc<0&&this.rotate(1)):(this.Rc||-1!==this.Go())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.xc=this.kc,this.Mc=this.Dc};get Bc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get rf(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Kc(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}ef=()=>this.yc&&this.Hl>=8&&this.Hl<=520&&this.Vl>=11&&this.Vl<=345;Xc=()=>this.yc&&-1===this.Wo()&&!this.Po()&&!this.Uo()&&this.Hl>=11&&this.Hl<=506&&this.Vl>=449&&this.Vl<=482;nf=()=>this.yc&&(this.Po()||this.Uo())&&this.Hl>=11&&this.Hl<=506&&this.Vl>=383&&this.Vl<=482;sf=()=>this.yc&&this.Hl>=562&&this.Hl<=752&&this.Vl>=231&&this.Vl<=492;jc=()=>!this.yc&&2===this.Bo()&&this.Hl>=301&&this.Hl<=562&&this.Vl>=262&&this.Vl<=279;zc=()=>!this.yc&&2===this.Bo()&&this.Hl>=301&&this.Hl<=562&&this.Vl>=279&&this.Vl<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};hf=()=>null!==document.fullscreenElement;Vc=t=>{if(this.hf()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/l.Nc.height,s=(window.innerWidth-l.Nc.width*e)/2;this.Hl=0|this.lf(t.clientX-i.left-s,0,l.Nc.width*e,0,789),this.Vl=0|this.lf(t.clientY-i.top,0,l.Nc.height*e,0,532)}else{const i=l.Nc.getBoundingClientRect(),e=l.Nc.width/i.width,s=l.Nc.height/i.height;this.Hl=(t.clientX-i.left)*e|0,this.Vl=(t.clientY-i.top)*s|0}this.Hl<0&&(this.Hl=0),this.Vl<0&&(this.Vl=0),this.Hl>789&&(this.Hl=789),this.Vl>532&&(this.Vl=532)};lf=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}},2595:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static enabled=!1;static af=null;static cf=null;static ff=0;static uf=0;static df=0;static wf=0;static yf=0;static pf=()=>{this.af=s.A.Pt(1),this.cf=null,this.ff=performance.now(),this.enabled=!0};static Af=()=>{this.enabled=!1,this.af=null};static flush=()=>{let t=null;return this.cf&&this.enabled&&(t=this.cf),this.cf=null,t};static stop=()=>{let t=null;return this.af&&this.af.mf>0&&this.enabled&&(t=this.af),this.Af(),t};static Zc=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.uf++;const s=performance.now();let n=(s-this.ff)/10|0;n>250&&(n=250),this.ff=s,this.gf(5),1===e?this.af?.p1(1):this.af?.p1(2),this.af?.p1(n),this.af?.p3(t+(i<<10))};static qc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,this.gf(2),1===t?this.af?.p1(3):this.af?.p1(4),this.af?.p1(e)};static Qc=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.df>=50){this.df=e,this.uf++;let s=(e-this.ff)/10|0;s>250&&(s=250),this.ff=e,t-this.wf<8&&t-this.wf>=-8&&i-this.yf<8&&i-this.yf>=-8?(this.gf(3),this.af?.p1(5),this.af?.p1(s),this.af?.p1(t+(i-this.yf+8<<4)+8-this.wf)):t-this.wf<128&&t-this.wf>=-128&&i-this.yf<128&&i-this.yf>=-128?(this.gf(4),this.af?.p1(6),this.af?.p1(s),this.af?.p1(t+128-this.wf),this.af?.p1(i+128-this.yf)):(this.gf(5),this.af?.p1(7),this.af?.p1(s),this.af?.p3(t+(i<<10))),this.wf=t,this.yf=i}};static Yc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.gf(3),this.af?.p1(8),this.af?.p1(e),this.af?.p1(t)};static Hc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.gf(3),this.af?.p1(9),this.af?.p1(e),this.af?.p1(t)};static tf=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.af?.p1(10),this.af?.p1(i)};static if=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.af?.p1(11),this.af?.p1(i)};static Jc=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.af?.p1(12),this.af?.p1(i)};static $c=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.af?.p1(13),this.af?.p1(i)};static gf=t=>{if(this.af&&this.af.mf+t>=500){const t=this.af;this.af=s.A.Pt(1),this.cf=t}}}},9091:(t,i,e)=>{e.d(i,{c:()=>n,g:()=>s});const s=['F11','F12'],n={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}}},1120:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1069),n=e(8665),r=e(2679),h=e(2511),o=e(3819),l=e(3867),a=e(8950);class c{static Do=[];static If=null;static No=null;static kl=0;static _f=1;static Nl=2;static $l=3;static ta=4;static fa=5;static wa=6;static Ca=7;static Cf=1;static Ef=2;static vf=3;static bf=4;static Tf=5;static ra=6;static ba=1;static Ta=100;static Oa=101;static Ra=200;static Of=201;static Rf=202;static Sa=203;static Sf=205;static Lf=300;static xf=301;static Mf=302;static kf=303;static Df=304;static Nf=305;static Ff=306;static Bf=307;static Pf=308;static Uf=309;static Wf=310;static Gf=311;static Yf=312;static Hf=313;static Vf=314;static Kf=315;static Xf=316;static jf=317;static zf=318;static Zf=319;static qf=320;static Jf=321;static $f=322;static Qf=323;static Va=324;static Ka=325;static tu=326;static Na=327;static La=401;static xa=500;static iu=501;static eu=502;static Da=503;static Xa=600;static su=601;static nu=602;static ru=603;static hu=604;static ou=605;static lu=606;static au=607;static cu=608;static fu=609;static uu=610;static du=611;static wu=612;static ja=613;static za=650;static Ja=651;static $a=652;static Qa=653;static tc=654;static Za=655;static yu=(t,i,e)=>{this.If=new r.A(5e4),this.No=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.mf+=2;n.mf0){s.ol=new Uint8Array(r),s.al=new Uint16Array(r);for(let t=0;t0){s.scripts=new l.fe(o,null);for(let t=0;t0){const n=e.lastIndexOf(',');s.Jl[t]=this.vu(i,e.substring(0,n),parseInt(e.substring(n+1),10))}}s.bu=new l.fe(5,null);for(let t=0;t<5;t++){const i=n.Eu;s.bu[t]=i,0===i.length&&(s.bu[t]=null)}}if(s.type===c.$l&&(s.fill=1===n.mu),s.type===c.ta||s.type===c._f){s.oa=1===n.mu;const t=n.mu;e&&(s.font=e[t]),s.aa=1===n.mu}if(s.type===c.ta&&(s.text=n.Eu,s.sa=n.Eu),s.type!==c._f&&s.type!==c.$l&&s.type!==c.ta||(s.Ql=n.il),s.type!==c.$l&&s.type!==c.ta||(s.ea=n.il,s.ia=n.il),s.type===c.fa){const t=n.Eu;if(t.length>0){const e=t.lastIndexOf(',');s.da=this.vu(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=n.Eu;if(e.length>0){const t=e.lastIndexOf(',');s.ua=this.vu(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(s.type===c.wa){const t=n.mu;0!==t&&(s.model=this.ma((t-1<<8)+n.mu));const i=n.mu;0!==i&&(s.Tu=this.ma((i-1<<8)+n.mu)),s.gl=n.mu,0===s.gl?s.gl=-1:s.gl=(s.gl-1<<8)+n.mu,s.Il=n.mu,0===s.Il?s.Il=-1:s.Il=(s.Il-1<<8)+n.mu,s.zoom=n.pu,s.Aa=n.pu,s._a=n.pu}if(s.type===c.Ca){s.Pl=new Int32Array(s.width*s.height),s.Ul=new Int32Array(s.width*s.height),s.oa=1===n.mu;const t=n.mu;e&&(s.font=e[t]),s.aa=1===n.mu,s.Ql=n.il,s.Wl=n.Iu,s.Gl=n.Iu,s._u=1===n.mu,s.bu=new l.fe(5,null);for(let t=0;t<5;t++){const i=n.Eu;s.bu[t]=i,0===i.length&&(s.bu[t]=null)}}s.na!==c.Ef&&s.type!==c.Nl||(s.Ou=n.Eu,s.action=n.Eu,s.Ru=n.pu),s.na!==c.Cf&&s.na!==c.bf&&s.na!==c.Tf&&s.na!==c.ra||(s.Su=n.Eu,0===s.Su.length&&(s.na===c.Cf?s.Su='Ok':s.na===c.bf||s.na===c.Tf?s.Su='Select':s.na===c.ra&&(s.Su='Continue')))}this.If=null,this.No=null};static vu=(t,i,e)=>{const s=o.A.Lu(i)<<8n|BigInt(e);if(this.If){const t=this.If.get(s);if(t)return t}let n;try{n=h.A.xu(t,i,e),this.If?.put(s,n)}catch(t){return null}return n};static ma=t=>{if(this.No){const i=this.No.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.No?.put(BigInt(t),i),i};id=-1;Au=-1;type=-1;na=-1;xl=0;width=0;height=0;gu=-1;ol=null;al=null;scripts=null;scroll=0;hide=!1;draggable=!1;_u=!1;Cu=!1;Wl=0;Gl=0;Fl=null;Bl=null;Jl=null;bu=null;fill=!1;oa=!1;font=null;aa=!1;text=null;sa=null;Ql=0;ea=0;ia=0;da=null;ua=null;model=null;Tu=null;gl=-1;Il=-1;zoom=0;Aa=0;_a=0;Ou=null;action=null;Ru=-1;Su=null;ml=null;Ol=null;Rl=null;x=0;y=0;Dl=0;Pl=null;Ul=null;Cl=0;_l=0;ma(t,i,e){let s=this.model;if(e&&(s=this.Tu),!s)return null;if(-1===t&&-1===i&&!s.Mu)return s;const r=n.A.ku(s,!0,!0,!1);return-1===t&&-1===i||r.Ga(),-1!==t&&r.Ya(t),-1!==i&&r.Ya(i),r.Ha(64,768,-50,-10,-50,!0),r}Du(){if(this.Au===this.id)return this.x;let t=c.Do[this.Au];if(!t.ml||!t.Ol||!t.Rl)return this.x;let i=t.ml.indexOf(this.id);if(-1===i)return this.x;let e=t.Ol[i];for(;t.Au!==t.id;){const s=c.Do[t.Au];s.ml&&s.Ol&&s.Rl&&(i=s.ml.indexOf(t.id),-1!==i&&(e+=s.Ol[i])),t=s}return e}Nu(){if(this.Au===this.id)return this.y;let t=c.Do[this.Au];if(!t.ml||!t.Ol||!t.Rl)return this.y;let i=t.ml.indexOf(this.id);if(-1===i)return this.y;let e=t.Rl[i];for(;t.Au!==t.id;){const s=c.Do[t.Au];s.ml&&s.Ol&&s.Rl&&(i=s.ml.indexOf(t.id),-1!==i&&(e+=s.Rl[i])),t=s}return e}outline(t){const i=this.Du(),e=this.Nu();a.A.Sl(i,e,this.width,this.height,t)}move(t,i){if(this.Au===this.id)return;this.x=0,this.y=0;const e=c.Do[this.Au];if(e.ml&&e.Ol&&e.Rl){const s=e.ml.indexOf(this.id);-1!==s&&(e.Ol[s]=t,e.Rl[s]=i)}}delete(){if(this.Au===this.id)return;const t=c.Do[this.Au];if(t.ml&&t.Ol&&t.Rl){const i=t.ml.indexOf(this.id);-1!==i&&(t.ml.splice(i,1),t.Ol.splice(i,1),t.Rl.splice(i,1))}}}},6333:(t,i,e)=>{e.d(i,{$:()=>s});class s{id;Fu=null;constructor(t){this.id=t}Bu(t){for(;;){const i=t.mu;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(6333);class r extends n.${static count=0;static Do=[];static yu=t=>{const i=new s.A(t.read('flo.dat'));this.count=i.pu;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static Uu=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static Wu=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);Gu=0;texture=-1;Yu=!1;Hu=!0;Vu=0;Ku=0;Xu=0;ju=0;zu=0;Zu=0;decode(t,i){1===t?(this.Gu=i.qu,this.setColor(this.Gu)):2===t?this.texture=i.mu:3===t?this.Yu=!0:5===t?this.Hu=!1:6===t?this.Fu=i.Eu:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(h=e),s>h&&(h=s);let o=0,l=0;const a=(n+h)/2;n!==h&&(a<.5&&(l=(h-n)/(h+n)),a>=.5&&(l=(h-n)/(2-h-n)),i===h?o=(e-s)/(h-n):e===h?o=(s-i)/(h-n)+2:s===h&&(o=(i-e)/(h-n)+4)),o/=6,this.Vu=256*o|0,this.Ku=256*l|0,this.Xu=256*a|0,this.Ku<0?this.Ku=0:this.Ku>255&&(this.Ku=255),this.Xu<0?this.Xu=0:this.Xu>255&&(this.Xu=255),this.ju=a>.5?(1-a)*l*512|0:a*l*512|0,this.ju<1&&(this.ju=1),this.zu=o*this.ju|0;let c=this.Vu+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.Ku+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.Xu+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.Zu=r.Pu(c,f,u)}}},8317:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(1069),n=e(6333),r=e(8665),h=e(3867);class o extends n.${static count=0;static Do=[];static yu=t=>{const i=new s.A(t.read('idk.dat'));this.count=i.pu;for(let t=0;t=40&&t<50?this.Qu[t-40]=i.pu:t>=50&&t<60?this.td[t-50]=i.pu:t>=60&&t<70?this.$u[t-60]=i.pu:console.log('Error unrecognised config code: ',t)}ma(){if(!this.Ju)return null;const t=new h.fe(this.Ju.length,null);for(let i=0;i{e.d(i,{A:()=>c});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(1023),l=e(6169),a=e(3867);class c extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static hd=new r.A(500);static od=new r.A(30);static yu=t=>{this.sd=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.pu,this.nd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%10;const i=this.cache[this.rd];return this.sd.mf=this.nd[t],i.id=t,i.reset(),i.Bu(this.sd),i.ld||(i.ld=new Int32Array(1)),-1===i.ad&&i.ld&&(i.active=i.ld.length>0&&i.ld[0]===o.A.fd.id,i.ud&&(i.active=!0)),i};static So=()=>{this.hd=null,this.od=null,this.nd=null,this.cache=null,this.sd=null};Ju=null;ld=null;name=null;dd=null;Qu=null;td=null;width=1;length=1;wd=!0;yd=!0;active=!1;ad=-1;pd=!1;Ad=!1;Hu=!1;gl=-1;md=!1;gd=16;Id=0;_d=0;ud=null;Cd=-1;Ed=-1;vd=!1;bd=!0;Td=128;Od=128;Rd=128;Sd=0;Ld=0;xd=0;Md=0;kd=!1;decode(t,i){if(1===t){const t=i.mu;this.Ju=new Int32Array(t),this.ld=new Int32Array(t);for(let e=0;e=30&&t<39)this.ud||(this.ud=new a.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(40===t){const t=i.mu;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e=this.Ju.length)return null;let d=this.Ju[a];if(-1===d)return null;const w=this.vd!==i>3;w&&(d+=65536);let y=c.hd?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.Gd(),c.hd?.put(BigInt(d),y));const p=128!==this.Td||128!==this.Od||128!==this.Rd,A=0!==this.Ld||0!==this.xd||0!==this.Md;let m=h.A.ku(y,!this.Qu,!this.md,i===l.A.Yd&&-1===o&&!p&&!A);for(-1!==o&&(m.Ga(),m.Ya(o),m.Hd=null,m.Vd=null);i-- >0;)m.Kd();if(this.Qu&&this.td)for(let t=0;t{e.d(i,{A:()=>l});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(3867);class l extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static No=new r.A(30);static yu=t=>{this.sd=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.pu,this.nd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%20;const i=this.cache[this.rd]=new l(t);return this.sd.mf=this.nd[t],i.Bu(this.sd),i};static So=()=>{this.No=null,this.nd=null,this.cache=null,this.sd=null};name=null;dd=null;size=1;Ju=null;$u=null;md=!1;zd=-1;Zd=-1;qd=-1;Jd=-1;$d=-1;Qu=null;td=null;ud=null;Td=-1;Od=-1;Rd=-1;Qd=!0;tw=-1;iw=128;ew=128;decode(t,i){if(1===t){const t=i.mu;this.Ju=new Uint16Array(t);for(let e=0;e=30&&t<40)this.ud||(this.ud=new o.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(40===t){const t=i.mu;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e{e.d(i,{A:()=>u});var s=e(6333),n=e(1069),r=e(2511),h=e(2679),o=e(8665),l=e(4583),a=e(8950),c=e(9298),f=e(3867);class u extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static lw=!0;static No=new h.A(50);static aw=new h.A(200);static yu=(t,i)=>{this.lw=i,this.sd=new n.A(t.read('obj.dat'));const e=new n.A(t.read('obj.idx'));this.count=e.pu,this.nd=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%10;const i=this.cache[this.rd];return this.sd.mf=this.nd[t],i.id=t,i.reset(),i.Bu(this.sd),-1!==i.cw&&i.fw(),!this.lw&&i.members&&(i.name='Members Object',i.dd="Login to a members' server to use this object.",i.ud=null,i.uw=null),i};static So=()=>{this.No=null,this.aw=null,this.nd=null,this.cache=null,this.sd=null};static Yl=(t,i)=>{if(u.aw){let e=u.aw.get(BigInt(t));if(e&&e.dw!==i&&-1!==e.dw&&(e.ww(),e=null),e)return e}let e=u.get(t);if(e.yw||(i=-1),e.yw&&e.pw&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.pw[s]&&0!==e.pw[s]&&(t=e.yw[s]);-1!==t&&(e=u.get(t))}const s=new r.A(32,32),n=l.A.ya,h=l.A.pa,o=l.A.Aw,f=a.A.mw,d=a.A.gw,w=a.A.Iw,y=a.A.left,p=a.A.right,A=a.A.top,m=a.A.bottom;l.A._w=!1,a.A.bind(s.mw,32,32),a.A.fillRect(0,0,32,32,c.A.Zl),l.A.Fc();const g=e.Cw(1),I=l.A.sin[e.Ew]*e.bw>>16,_=l.A.cos[e.Ew]*e.bw>>16;g.Ia(0,e.Tw,e.Ow,e.Ew,e.Rw,I+(g.jd/2|0)+e.Sw,_+e.Sw);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.mw[t+32*i]&&(t>0&&s.mw[t+32*i-1]>1||i>0&&s.mw[t+32*(i-1)]>1||t<31&&s.mw[t+32*i+1]>1||i<31&&s.mw[t+32*(i+1)]>1)&&(s.mw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.mw[t+32*i]&&t>0&&i>0&&s.mw[t+32*(i-1)-1]>0&&(s.mw[t+32*i]=3153952);if(-1!==e.cw){const t=this.Yl(e.Lw,10),i=t.Xl,s=t.dw;t.Xl=32,t.dw=32,t.xw(5,5,22,22),t.Xl=i,t.dw=s}return u.aw?.put(BigInt(t),s),a.A.bind(f,d,w),a.A.Tl(y,A,p,m),l.A.ya=n,l.A.pa=h,l.A.Aw=o,l.A._w=!0,e.Ea?s.Xl=33:s.Xl=32,s.dw=i,s};model=0;name=null;dd=null;Qu=null;td=null;bw=2e3;Ew=0;Tw=0;Ow=0;Rw=0;Sw=0;Mw=!1;kw=-1;Ea=!1;Dw=1;members=!1;ud=null;uw=null;Nw=-1;Fw=-1;Bw=0;Pw=-1;Uw=-1;Ww=0;Gw=-1;Yw=-1;Hw=-1;Vw=-1;Kw=-1;Xw=-1;yw=null;pw=null;Lw=-1;cw=-1;decode(t,i){if(1===t)this.model=i.pu;else if(2===t)this.name=i.Eu;else if(3===t)this.dd=i.Eu;else if(4===t)this.bw=i.pu;else if(5===t)this.Ew=i.pu;else if(6===t)this.Tw=i.pu;else if(7===t)this.Rw=i.Iu,this.Rw>32767&&(this.Rw-=65536);else if(8===t)this.Sw=i.Iu,this.Sw>32767&&(this.Sw-=65536);else if(9===t)this.Mw=!0;else if(10===t)this.kw=i.pu;else if(11===t)this.Ea=!0;else if(12===t)this.Dw=i.il;else if(16===t)this.members=!0;else if(23===t)this.Nw=i.pu,this.Bw=i.Dd;else if(24===t)this.Fw=i.pu;else if(25===t)this.Pw=i.pu,this.Ww=i.Dd;else if(26===t)this.Uw=i.pu;else if(t>=30&&t<35)this.ud||(this.ud=new f.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(t>=35&&t<40)this.uw||(this.uw=new f.fe(5,null)),this.uw[t-35]=i.Eu;else if(40===t){const t=i.mu;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.yw&&this.pw||(this.yw=new Uint16Array(10),this.pw=new Uint16Array(10)),this.yw[t-100]=i.pu,this.pw[t-100]=i.pu)}jw(t){let i=this.Nw;if(1===t&&(i=this.Pw),-1===i)return null;let e=this.Fw,s=this.Gw;1===t&&(e=this.Uw,s=this.Yw);let n=o.A.model(i);if(-1!==e){const t=o.A.model(e);if(-1===s){const i=[n,t];n=o.A.Fa(i,2)}else{const i=[n,t,o.A.model(s)];n=o.A.Fa(i,3)}}if(0===t&&0!==this.Bw&&n.translate(this.Bw,0,0),1===t&&0!==this.Ww&&n.translate(this.Ww,0,0),this.Qu&&this.td)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.pw[e]&&0!==this.pw[e]&&(i=this.yw[e]);if(-1!==i)return u.get(i).Cw(1)}if(u.No){const t=u.No.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.Qu&&this.td)for(let t=0;t{e.d(i,{A:()=>h});var s=e(6333),n=e(1069),r=e(6730);class h extends s.${static count=0;static Do=[];static yu=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.pu;for(let t=0;t{e.d(i,{A:()=>l});var s=e(6333),n=e(1069),r=e(1312),h=e(8665),o=e(2679);class l extends s.${static count=0;static Do=[];static No=new o.A(30);static yu=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.pu;for(let t=0;t=40&&t<50?this.Qu[t-40]=i.pu:t>=50&&t<60?this.td[t-50]=i.pu:console.log('Error unrecognised spotanim config code: ',t)}ma(){let t=l.No?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let i=0;i<6;i++)0!==this.Qu[0]&&t.Ba(this.Qu[i],this.td[i]);return l.No?.put(BigInt(this.id),t),t}}},3764:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(6333),n=e(1069);class r extends s.${static count=0;static Do=[];static ty=[];static iy=0;static yu=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.pu;for(let t=0;t{e.d(i,{A:()=>s});class s{static OPEN=0;static ly=1;static uy=2;static wy=4;static yy=8;static py=s.ly<<4;static Ay=s.uy<<4;static my=s.wy<<4;static gy=s.yy<<4;static Iy=256;static _y=512;static Cy=1024;static Ey=2048;static vy=4096;static by=s._y<<4;static Ty=s.Cy<<4;static Oy=s.Ey<<4;static Ry=s.vy<<4;static Sy=s.Iy<<9;static Ly=524288;static xy=2097152;static My=s.xy|s.Ly;static ky=s.Iy|s.My;static Dy=s.uy|s.ky;static Ny=s.yy|s.ky;static Fy=s.uy|s.wy|s.Ny;static By=s.Ay|s.ky;static Py=s.yy|s.py|s.By;static Uy=s.gy|s.ky;static Wy=s.ly|s.uy|s.Uy;static Gy=s.Ay|s.my|s.Uy;static Yy=16777215}},670:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(9456),n=e(6169),r=e(1023),h=e(4909);class o{static Dr=4;static jr=104;static index=(t,i)=>t*o.jr+i;offsetX;Hy;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Hy=0,this.sizeX=o.jr,this.sizeZ=o.jr,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.Hy)]|=s.A.xy};Ky=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.Hy)]&=~s.A.xy};Xy=(t,i,e,r,h,o)=>{let l=s.A.Iy;o&&(l|=s.A.Sy);const a=t-this.offsetX,c=i-this.Hy;if(h===n.A.jy||h===n.A.zy){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{let l=s.A.Iy;o&&(l|=s.A.Sy);const a=t-this.offsetX,c=i-this.Hy;if(h===n.A.jy||h===n.A.zy){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{const l=t-this.offsetX,a=i-this.Hy,c=o?s.A.Ry:s.A.gy,f=o?s.A.vy:s.A.yy,u=o?s.A.Cy:s.A.uy,d=o?s.A.Ty:s.A.Ay,w=o?s.A._y:s.A.ly,y=o?s.A.by:s.A.py,p=o?s.A.Ey:s.A.wy,A=o?s.A.Oy:s.A.my;e===r.A.Jy.id?h===n.A.Yd?(this.add(l,a,c),this.add(l-1,a,f)):h===n.A.jy?(this.add(l,a,u),this.add(l,a+1,d)):h===n.A.$y?(this.add(l,a,f),this.add(l+1,a,c)):h===n.A.zy&&(this.add(l,a,d),this.add(l,a-1,u)):e===r.A.Qy.id||e===r.A.tp.id?h===n.A.Yd?(this.add(l,a,w),this.add(l-1,a+1,y)):h===n.A.jy?(this.add(l,a,p),this.add(l+1,a+1,A)):h===n.A.$y?(this.add(l,a,y),this.add(l+1,a-1,w)):h===n.A.zy&&(this.add(l,a,A),this.add(l-1,a-1,p)):e===r.A.ip.id&&(h===n.A.Yd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):h===n.A.jy?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):h===n.A.$y?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):h===n.A.zy&&(this.add(l,a,d|c),this.add(l,a-1,u),this.add(l-1,a,f))),o&&this.qy(t,i,e,h,!1)};ep=(t,i,e,h,o)=>{const l=t-this.offsetX,a=i-this.Hy,c=o?s.A.Ry:s.A.gy,f=o?s.A.vy:s.A.yy,u=o?s.A.Cy:s.A.uy,d=o?s.A.Ty:s.A.Ay,w=o?s.A._y:s.A.ly,y=o?s.A.by:s.A.py,p=o?s.A.Ey:s.A.wy,A=o?s.A.Oy:s.A.my;e===r.A.Jy.id?h===n.A.Yd?(this.remove(l,a,c),this.remove(l-1,a,f)):h===n.A.jy?(this.remove(l,a,u),this.remove(l,a+1,d)):h===n.A.$y?(this.remove(l,a,f),this.remove(l+1,a,c)):h===n.A.zy&&(this.remove(l,a,d),this.remove(l,a-1,u)):e===r.A.Qy.id||e===r.A.tp.id?h===n.A.Yd?(this.remove(l,a,w),this.remove(l-1,a+1,y)):h===n.A.jy?(this.remove(l,a,p),this.remove(l+1,a+1,A)):h===n.A.$y?(this.remove(l,a,y),this.remove(l+1,a-1,w)):h===n.A.zy&&(this.remove(l,a,A),this.remove(l-1,a-1,p)):e===r.A.ip.id&&(h===n.A.Yd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):h===n.A.jy?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):h===n.A.$y?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):h===n.A.zy&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.ep(t,i,e,h,!1)};sp=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Hy,u=e-this.offsetX,d=h-this.Hy,w=o.index(c,f);if(l===r.A.Jy.id){if(a===n.A.Yd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(a===n.A.jy){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0}else if(a===n.A.$y){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(a===n.A.zy){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0}}else if(l===r.A.ip.id){if(a===n.A.Yd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(a===n.A.jy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(a===n.A.$y){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(a===n.A.zy){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===r.A.np.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0}return!1};rp=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Hy,u=e-this.offsetX,d=h-this.Hy,w=o.index(c,f);if(l===r.A.hp.id||l===r.A.op.id){if(l===r.A.op.id&&(a=a+2&3),a===n.A.Yd){if(c===u+1&&f===d&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0}else if(a===n.A.jy){if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0}else if(a===n.A.$y){if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0}else if(a===n.A.zy){if(c===u+1&&f===d&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0}}else if(l===r.A.lp.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0}return!1};ap=(t,i,e,n,r,l,a)=>{const c=e+r-1,f=n+l-1,u=o.index(t-this.offsetX,i-this.Hy);return t>=e&&t<=c&&i>=n&&i<=f||(t===e-1&&i>=n&&i<=f&&(this.flags[u]&s.A.yy)===s.A.OPEN&&(a&h.A.Yd)===s.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&s.A.gy)===s.A.OPEN&&(a&h.A.$y)===s.A.OPEN||(i===n-1&&t>=e&&t<=c&&(this.flags[u]&s.A.uy)===s.A.OPEN&&(a&h.A.zy)===s.A.OPEN||i===f+1&&t>=e&&t<=c&&(this.flags[u]&s.A.Ay)===s.A.OPEN&&(a&h.A.jy)===s.A.OPEN)))};add=(t,i,e)=>{this.flags[o.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[o.index(t,i)]&=s.A.Yy-e}}},4909:(t,i,e)=>{e.d(i,{A:()=>s});class s{static jy=1;static $y=2;static zy=4;static Yd=8}},6169:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Yd=0;static jy=1;static $y=2;static zy=3}},5599:(t,i,e)=>{e.d(i,{A:()=>s});class s{static cp=0;static fp=1;static up=2;static dp=3}},1023:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5599);class n{static Jy=new n(0,s.A.cp);static Qy=new n(1,s.A.cp);static ip=new n(2,s.A.cp);static tp=new n(3,s.A.cp);static wp=new n(4,s.A.fp);static yp=new n(5,s.A.fp);static hp=new n(6,s.A.fp);static op=new n(7,s.A.fp);static lp=new n(8,s.A.fp);static np=new n(9,s.A.up);static fd=new n(10,s.A.up);static pp=new n(11,s.A.up);static Ap=new n(12,s.A.up);static mp=new n(13,s.A.up);static gp=new n(14,s.A.up);static Ip=new n(15,s.A.up);static _p=new n(16,s.A.up);static Cp=new n(17,s.A.up);static Ep=new n(18,s.A.up);static vp=new n(19,s.A.up);static bp=new n(20,s.A.up);static Tp=new n(21,s.A.up);static dp=new n(22,s.A.dp);static values(){return[this.Jy,this.Qy,this.Cp,this.Ip,this.ip,this.gp,this.np,this.tp,this.dp,this.Ap,this.pp,this.hp,this.bp,this.fd,this.yp,this.mp,this.op,this.wp,this._p,this.lp,this.vp,this.Tp,this.Ep]}static of(t){const i=this.values();for(let e=0;e{e.d(i,{A:()=>p});var s=e(670),n=e(2164),r=e(1069),h=e(4583),o=e(3045),l=e(5637),a=e(4197),c=e(1312),f=e(1023),u=e(6169),d=e(9298),w=e(5518),y=e(3867);class p{static Op=Int8Array.of(1,2,4,8);static Rp=Uint8Array.of(16,32,64,128);static Sp=Int8Array.of(1,0,-1,0);static Lp=Int8Array.of(0,-1,0,1);static xp=(17*Math.random()|0)-8;static Mp=(33*Math.random()|0)-16;static et=!0;static kp=0;static Dp=!1;static Np=(t,i)=>{let e=this.Fp(t+45365,i+91923,4)+(this.Fp(t+10294,i+37821,2)-128>>1)+(this.Fp(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static Fp=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.Bp(s,r),l=this.Bp(s+1,r),a=this.Bp(s,r+1),c=this.Bp(s+1,r+1),f=this.Pp(o,l,n,e),u=this.Pp(a,c,n,e);return this.Pp(f,u,h,e)};static Pp=(t,i,e,s)=>{const n=65536-h.A.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static Bp=(t,i)=>((this.Up(t-1,i-1)+this.Up(t+1,i-1)+this.Up(t-1,i+1)+this.Up(t+1,i+1))/16|0)+((this.Up(t-1,i)+this.Up(t+1,i)+this.Up(t,i-1)+this.Up(t,i+1))/8|0)+(this.Up(t,i)/4|0);static Up=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static Xy=(t,i,e,s,n,r,h,o,d,w,y)=>{const A=n[y][i][e],m=n[y][i+1][e],g=n[y][i+1][e+1],I=n[y][i][e+1],_=A+m+g+I>>2,C=l.A.get(o);let E=i+(e<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A.dp.id)s?.Wp(C.ma(f.A.dp.id,w,A,m,g,I,-1),t,i,e,_,E,v),C.wd&&C.active&&h?.Vy(i,e),-1!==C.gl&&r.Gp(new a.A(o,t,3,i,e,c.A.Do[C.gl],!0));else if(d===f.A.fd.id||d===f.A.pp.id){const n=C.ma(f.A.fd.id,w,A,m,g,I,-1);if(n){let r,h,o=0;d===f.A.pp.id&&(o+=256),w===u.A.jy||w===u.A.zy?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.Xy(t,i,e,_,n,null,E,v,r,h,o)}C.wd&&h?.Xy(i,e,C.width,C.length,w,C.yd),-1!==C.gl&&r.Gp(new a.A(o,t,2,i,e,c.A.Do[C.gl],!0))}else if(d>=f.A.Ap.id)s?.Xy(t,i,e,_,C.ma(d,w,A,m,g,I,-1),null,E,v,1,1,0),C.wd&&h?.Xy(i,e,C.width,C.length,w,C.yd),-1!==C.gl&&r.Gp(new a.A(o,t,2,i,e,c.A.Do[C.gl],!0));else if(d===f.A.Jy.id)s?.qy(t,i,e,_,p.Op[w],0,C.ma(f.A.Jy.id,w,A,m,g,I,-1),null,E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C.gl&&r.Gp(new a.A(o,t,0,i,e,c.A.Do[C.gl],!0));else if(d===f.A.Qy.id)s?.qy(t,i,e,_,p.Rp[w],0,C.ma(f.A.Qy.id,w,A,m,g,I,-1),null,E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C.gl&&r.Gp(new a.A(o,t,0,i,e,c.A.Do[C.gl],!0));else if(d===f.A.ip.id){const n=w+1&3;s?.qy(t,i,e,_,p.Op[w],p.Op[n],C.ma(f.A.ip.id,w+4,A,m,g,I,-1),C.ma(f.A.ip.id,n,A,m,g,I,-1),E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C.gl&&r.Gp(new a.A(o,t,0,i,e,c.A.Do[C.gl],!0))}else if(d===f.A.tp.id)s?.qy(t,i,e,_,p.Rp[w],0,C.ma(f.A.tp.id,w,A,m,g,I,-1),null,E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C.gl&&r.Gp(new a.A(o,t,0,i,e,c.A.Do[C.gl],!0));else if(d===f.A.np.id)s?.Xy(t,i,e,_,C.ma(d,w,A,m,g,I,-1),null,E,v,1,1,0),C.wd&&h?.Xy(i,e,C.width,C.length,w,C.yd),-1!==C.gl&&r.Gp(new a.A(o,t,2,i,e,c.A.Do[C.gl],!0));else if(d===f.A.wp.id)s?.Yp(t,i,e,_,0,0,E,C.ma(f.A.wp.id,u.A.Yd,A,m,g,I,-1),v,512*w,p.Op[w]),-1!==C.gl&&r.Gp(new a.A(o,t,1,i,e,c.A.Do[C.gl],!0));else if(d===f.A.yp.id){let n=16;if(s){const r=s.Hp(t,i,e);r>0&&(n=l.A.get(r>>14&32767).gd)}s?.Yp(t,i,e,_,p.Sp[w]*n,p.Lp[w]*n,E,C.ma(f.A.wp.id,u.A.Yd,A,m,g,I,-1),v,512*w,p.Op[w]),-1!==C.gl&&r.Gp(new a.A(o,t,1,i,e,c.A.Do[C.gl],!0))}else d===f.A.hp.id?(s?.Yp(t,i,e,_,0,0,E,C.ma(f.A.wp.id,u.A.Yd,A,m,g,I,-1),v,w,256),-1!==C.gl&&r.Gp(new a.A(o,t,1,i,e,c.A.Do[C.gl],!0))):d===f.A.op.id?(s?.Yp(t,i,e,_,0,0,E,C.ma(f.A.wp.id,u.A.Yd,A,m,g,I,-1),v,w,512),-1!==C.gl&&r.Gp(new a.A(o,t,1,i,e,c.A.Do[C.gl],!0))):d===f.A.lp.id&&(s?.Yp(t,i,e,_,0,0,E,C.ma(f.A.wp.id,u.A.Yd,A,m,g,I,-1),v,w,768),-1!==C.gl&&r.Gp(new a.A(o,t,1,i,e,c.A.Do[C.gl],!0)))};Vp;Kp;Hr;Vr;Xp;jp;zp;Zp;qp;Jp;$p;Qp;tA;iA;eA;sA;constructor(t,i,e,n){this.Vp=t,this.Kp=i,this.Hr=e,this.Vr=n,this.Xp=new y.nA(s.A.Dr,t,i),this.jp=new y.nA(s.A.Dr,t,i),this.zp=new y.nA(s.A.Dr,t,i),this.Zp=new y.nA(s.A.Dr,t,i),this.sA=new y.rA(s.A.Dr,t+1,i+1),this.qp=new y.nA(s.A.Dr,t+1,i+1),this.Jp=new y.Xr(t+1,i+1),this.$p=new Int32Array(i),this.Qp=new Int32Array(i),this.tA=new Int32Array(i),this.iA=new Int32Array(i),this.eA=new Int32Array(i)}hA=(t,i)=>{for(let t=0;t=0&&i[s]?.Vy(e,n)}p.xp+=(5*Math.random()|0)-2,p.xp<-8?p.xp=-8:p.xp>8&&(p.xp=8),p.Mp+=(5*Math.random()|0)-2,p.Mp<-16?p.Mp=-16:p.Mp>16&&(p.Mp=16);for(let i=0;i>8;for(let t=1;t>2)+(e[n+1][t]>>3)+(e[n][t-1]>>2)+(e[n][t+1]>>3)+(e[n][t]>>1);this.Jp[n][t]=u-d}for(let t=0;t=0&&s0){const i=n.A.Do[e-1];this.$p[t]+=i.zu,this.Qp[t]+=i.Ku,this.tA[t]+=i.Xu,this.iA[t]+=i.ju,r=this.eA[t]++}}const h=e-5;if(h>=0&&h0){const i=n.A.Do[e-1];this.$p[t]-=i.zu,this.Qp[t]-=i.Ku,this.tA[t]-=i.Xu,this.iA[t]-=i.ju,r=this.eA[t]--}}}if(e>=1&&e=0&&f=0&&y=1&&c0||y>0){const A=this.Hr[i][e][c],m=this.Hr[i][e+1][c],g=this.Hr[i][e+1][c+1],I=this.Hr[i][e][c+1],_=this.Jp[e][c],C=this.Jp[e+1][c],E=this.Jp[e+1][c+1],v=this.Jp[e][c+1];let b=-1,T=-1;if(f>0){const t=256*s/l|0,i=r/a|0;let e=o/a|0;b=n.A.Pu(t,i,e);const h=t+p.xp&255;e+=p.Mp,e<0?e=0:e>255&&(e=255),T=n.A.Pu(h,i,e)}if(i>0){let t=0!==f||this.zp[i][e][c]===w.A.lA;y>0&&!n.A.Do[y-1].Hu&&(t=!1),t&&A===m&&A===g&&A===I&&(this.sA[i][e][c]|=2340)}let O=0;if(-1!==b&&(O=h.A.palette[n.A.Uu(T,96)]),0===y)t?.aA(i,e,c,w.A.lA,u.A.Yd,-1,A,m,g,I,n.A.Uu(b,_),n.A.Uu(b,C),n.A.Uu(b,E),n.A.Uu(b,v),d.A.Zl,d.A.Zl,d.A.Zl,d.A.Zl,O,d.A.Zl);else{const s=this.zp[i][e][c]+1,r=this.Zp[i][e][c],o=n.A.Do[y-1];let l,a,f=o.texture;f>=0?(a=h.A.cA(f),l=-1):o.Gu===d.A.fA?(a=0,l=-2,f=-1):(l=n.A.Pu(o.Vu,o.Ku,o.Xu),a=h.A.palette[n.A.Wu(o.Zu,96)]),t?.aA(i,e,c,s,r,f,A,m,g,I,n.A.Uu(b,_),n.A.Uu(b,C),n.A.Uu(b,E),n.A.Uu(b,v),n.A.Wu(l,_),n.A.Wu(l,C),n.A.Wu(l,E),n.A.Wu(l,v),O,a)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let s=0;s<=n;s++)for(let r=0;r<=this.Kp;r++)for(let h=0;h<=this.Vp;h++){if(this.sA[s][h][r]&t){let i=r,e=r,l=s,a=s;for(;i>0&&this.sA[s][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.sA[l-1][h][s]&t))break t;l--}t:for(;a=8){const s=this.Hr[a][h][i]-240,r=this.Hr[l][h][i];o.A.yA(n,1,128*h,s,128*i,128*h,r,128*e+128);for(let s=l;s<=a;s++)for(let n=i;n<=e;n++)this.sA[s][h][n]&=~t}}if(this.sA[s][h][r]&i){let t=h,e=h,l=s,a=s;for(;t>0&&this.sA[s][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.sA[l-1][s][r]&i))break t;l--}t:for(;a=8){const s=this.Hr[a][t][r]-240,h=this.Hr[l][t][r];o.A.yA(n,2,128*t,s,128*r,128*e+128,h,128*r);for(let s=l;s<=a;s++)for(let n=t;n<=e;n++)this.sA[s][n][r]&=~i}}if(this.sA[s][h][r]&e){let t=h,i=h,l=r,a=r;for(;l>0&&this.sA[s][h][l-1]&e;)l--;for(;a0;){for(let i=l;i<=a;i++)if(!(this.sA[s][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.Hr[s][t][l];o.A.yA(n,4,128*t,r,128*l,128*i+128,r,128*a+128);for(let n=t;n<=i;n++)for(let t=l;t<=a;t++)this.sA[s][n][t]&=~e}}}}}};pA=(t,i,e,r)=>{let h=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new r.A(new Uint8Array(h));for(let r=0;r=0&&a=0&&c>24,this.Zp[r][a][c]=(f-2&3)<<24>>24):f<=81?this.Vr[r][a][c]=f-49<<24>>24:this.Xp[r][a][c]=f-81<<24>>24}else for(;f=o.mu,0!==f;){if(1===f){o.mu;break}f<=49&&o.mu}}};mA=(t,i,e,n,h,o)=>{const l=new r.A(new Uint8Array(n));let a=-1;for(;;){const n=l.gA;if(0===n)return;a+=n;let r=0;for(;;){const n=l.gA;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=l.mu,w=d>>2,y=3&d,p=f+h,A=c+o;if(p>0&&A>0&&p=0&&(n=e[s]),this.Xy(u,p,A,t,i,n,a,w,y)}}}};Xy=(t,i,e,s,n,r,h,o,d)=>{if(p.et){if(16&this.Vr[t][i][e])return;if(this.oA(t,i,e)!==p.kp)return}const w=this.Hr[t][i][e],y=this.Hr[t][i+1][e],A=this.Hr[t][i+1][e+1],m=this.Hr[t][i][e+1],g=w+y+A+m>>2,I=l.A.get(h);let _=i+(e<<7)+(h<<14)+1073741824|0;I.active||(_+=-2147483648),_|=0;const C=(d<<6)+o<<24>>24;if(o===f.A.dp.id)(!p.et||I.active||I.kd)&&(s?.Wp(I.ma(f.A.dp.id,d,w,y,A,m,-1),t,i,e,g,_,C),I.wd&&I.active&&r?.Vy(i,e),-1!==I.gl&&n.Gp(new a.A(h,t,3,i,e,c.A.Do[I.gl],!0)));else if(o===f.A.fd.id||o===f.A.pp.id){const l=I.ma(f.A.fd.id,d,w,y,A,m,-1);if(l){let n,r,h=0;if(o===f.A.pp.id&&(h+=256),d===u.A.jy||d===u.A.zy?(n=I.length,r=I.width):(n=I.width,r=I.length),s?.Xy(t,i,e,g,l,null,_,C,n,r,h)&&I.bd)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=l.IA/4|0;r>30&&(r=30),r>this.qp[t][i+s][e+n]&&(this.qp[t][i+s][e+n]=r<<24>>24)}}I.wd&&r?.Xy(i,e,I.width,I.length,d,I.yd),-1!==I.gl&&n.Gp(new a.A(h,t,2,i,e,c.A.Do[I.gl],!0))}else if(o>=f.A.Ap.id)s?.Xy(t,i,e,g,I.ma(o,d,w,y,A,m,-1),null,_,C,1,1,0),o>=f.A.Ap.id&&o<=f.A.Cp.id&&o!==f.A.mp.id&&t>0&&(this.sA[t][i][e]|=2340),I.wd&&r?.Xy(i,e,I.width,I.length,d,I.yd),-1!==I.gl&&n.Gp(new a.A(h,t,2,i,e,c.A.Do[I.gl],!0));else if(o===f.A.Jy.id)s?.qy(t,i,e,g,p.Op[d],0,I.ma(f.A.Jy.id,d,w,y,A,m,-1),null,_,C),d===u.A.Yd?(I.bd&&(this.qp[t][i][e]=50,this.qp[t][i][e+1]=50),I.Hu&&(this.sA[t][i][e]|=585)):d===u.A.jy?(I.bd&&(this.qp[t][i][e+1]=50,this.qp[t][i+1][e+1]=50),I.Hu&&(this.sA[t][i][e+1]|=1170)):d===u.A.$y?(I.bd&&(this.qp[t][i+1][e]=50,this.qp[t][i+1][e+1]=50),I.Hu&&(this.sA[t][i+1][e]|=585)):d===u.A.zy&&(I.bd&&(this.qp[t][i][e]=50,this.qp[t][i+1][e]=50),I.Hu&&(this.sA[t][i][e]|=1170)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I.gl&&n.Gp(new a.A(h,t,0,i,e,c.A.Do[I.gl],!0)),16!==I.gd&&s?._A(t,i,e,I.gd);else if(o===f.A.Qy.id)s?.qy(t,i,e,g,p.Rp[d],0,I.ma(f.A.Qy.id,d,w,y,A,m,-1),null,_,C),I.bd&&(d===u.A.Yd?this.qp[t][i][e+1]=50:d===u.A.jy?this.qp[t][i+1][e+1]=50:d===u.A.$y?this.qp[t][i+1][e]=50:d===u.A.zy&&(this.qp[t][i][e]=50)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I.gl&&n.Gp(new a.A(h,t,0,i,e,c.A.Do[I.gl],!0));else if(o===f.A.ip.id){const l=d+1&3;s?.qy(t,i,e,g,p.Op[d],p.Op[l],I.ma(f.A.ip.id,d+4,w,y,A,m,-1),I.ma(f.A.ip.id,l,w,y,A,m,-1),_,C),I.Hu&&(d===u.A.Yd?(this.sA[t][i][e]|=265,this.sA[t][i][e+1]|=1170):d===u.A.jy?(this.sA[t][i][e+1]|=1170,this.sA[t][i+1][e]|=585):d===u.A.$y?(this.sA[t][i+1][e]|=585,this.sA[t][i][e]|=1170):d===u.A.zy&&(this.sA[t][i][e]|=1170,this.sA[t][i][e]|=585)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I.gl&&n.Gp(new a.A(h,t,0,i,e,c.A.Do[I.gl],!0)),16!==I.gd&&s?._A(t,i,e,I.gd)}else if(o===f.A.tp.id)s?.qy(t,i,e,g,p.Rp[d],0,I.ma(f.A.tp.id,d,w,y,A,m,-1),null,_,C),I.bd&&(d===u.A.Yd?this.qp[t][i][e+1]=50:d===u.A.jy?this.qp[t][i+1][e+1]=50:d===u.A.$y?this.qp[t][i+1][e]=50:d===u.A.zy&&(this.qp[t][i][e]=50)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I.gl&&n.Gp(new a.A(h,t,0,i,e,c.A.Do[I.gl],!0));else if(o===f.A.np.id)s?.Xy(t,i,e,g,I.ma(o,d,w,y,A,m,-1),null,_,C,1,1,0),I.wd&&r?.Xy(i,e,I.width,I.length,d,I.yd),-1!==I.gl&&n.Gp(new a.A(h,t,2,i,e,c.A.Do[I.gl],!0));else if(o===f.A.wp.id)s?.Yp(t,i,e,g,0,0,_,I.ma(f.A.wp.id,u.A.Yd,w,y,A,m,-1),C,512*d,p.Op[d]),-1!==I.gl&&n.Gp(new a.A(h,t,1,i,e,c.A.Do[I.gl],!0));else if(o===f.A.yp.id){let r=16;if(s){const n=s.Hp(t,i,e);n>0&&(r=l.A.get(n>>14&32767).gd)}s?.Yp(t,i,e,g,p.Sp[d]*r,p.Lp[d]*r,_,I.ma(f.A.wp.id,u.A.Yd,w,y,A,m,-1),C,512*d,p.Op[d]),-1!==I.gl&&n.Gp(new a.A(h,t,1,i,e,c.A.Do[I.gl],!0))}else o===f.A.hp.id?(s?.Yp(t,i,e,g,0,0,_,I.ma(f.A.wp.id,u.A.Yd,w,y,A,m,-1),C,d,256),-1!==I.gl&&n.Gp(new a.A(h,t,1,i,e,c.A.Do[I.gl],!0))):o===f.A.op.id?(s?.Yp(t,i,e,g,0,0,_,I.ma(f.A.wp.id,u.A.Yd,w,y,A,m,-1),C,d,512),-1!==I.gl&&n.Gp(new a.A(h,t,1,i,e,c.A.Do[I.gl],!0))):o===f.A.lp.id&&(s?.Yp(t,i,e,g,0,0,_,I.ma(f.A.wp.id,u.A.Yd,w,y,A,m,-1),C,d,768),-1!==I.gl&&n.Gp(new a.A(h,t,1,i,e,c.A.Do[I.gl],!0)))};oA=(t,i,e)=>8&this.Vr[t][i][e]?0:t<=0||!(2&this.Vr[1][i][e])?t:t-1}},3045:(t,i,e)=>{e.d(i,{A:()=>g});var s=e(4583),n=e(1161),r=e(3795),h=e(8256),o=e(670),l=e(9222),a=e(6855),c=e(7441),f=e(6666),u=e(5748),d=e(3479),w=e(8950),y=e(2771),p=e(5518),A=e(6169),m=e(3867);class g{static CA=new m.EA(8,32,51,51,!1);static vA=new m.fe(100,null);static bA=new Int32Array(o.A.Dr);static TA=new m.OA(o.A.Dr,500,null);static RA=new m.fe(500,null);static SA=new f.A;static LA=0;static xA=0;static MA=0;static kA=0;static DA=0;static NA=0;static FA=0;static BA=0;static PA=0;static UA=0;static WA=0;static GA=0;static YA=0;static HA=0;static VA=0;static KA=0;static XA=0;static jA=0;static zA=0;static ZA=0;static qA=0;static JA=0;static $A=!1;static QA=null;static tm=Uint8Array.of(19,55,38,155,255,110,137,205,76);static im=Uint8Array.of(160,192,80,96,0,144,80,48,160);static sm=Uint8Array.of(76,8,137,4,0,1,38,2,19);static nm=Int8Array.of(0,0,2,0,0,2,1,1,0);static rm=Int8Array.of(2,0,0,2,0,0,0,4,4);static hm=Int8Array.of(0,4,4,8,0,0,8,0,0);static om=Int8Array.of(1,1,0,0,0,8,0,0,8);static lm=Int8Array.of(53,-53,-53,53);static am=Int8Array.of(-53,-53,53,53);static fm=Int8Array.of(-45,45,45,-45);static um=Int8Array.of(45,45,-45,-45);static dm=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static wm=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static ym=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static pm=0;static Hl=0;static Vl=0;static Am=-1;static gm=-1;static et=!0;static init=(t,i,e,n,r)=>{this.xA=0,this.MA=0,this.kA=t,this.DA=i,this.NA=t/2|0,this.FA=i/2|0;const h=new m.EA(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.BA=s.A.sin[t],this.PA=s.A.cos[t],this.UA=s.A.sin[i],this.WA=s.A.cos[i];const o=(t-128)/32|0,l=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const s=128*t,a=128*i;let c=!1;for(let t=-e;t<=n;t+=128)if(this.Im(s,a,r[o]+t)){c=!0;break}h[o][l][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let r=-1;r<=1;r++)for(let o=-1;o<=1;o++){if(h[t][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}}this.CA[t][i][e+25][s+25]=n}};static So=()=>{this.vA=null,this.bA=null,this.TA=null,this.SA=null,this.CA=null,this.RA=null,this.QA=null,console.log('World3D unloaded!')};static yA=(t,i,e,s,n,r,o,l)=>{g.TA[t][g.bA[t]++]=new h.A(e/128|0,r/128|0,n/128|0,l/128|0,i,e,r,n,l,s,o)};static Im=(t,i,e)=>{const s=i*this.UA+t*this.WA>>16,n=i*this.WA-t*this.UA>>16,r=e*this.BA+n*this.PA>>16,h=e*this.PA-n*this.BA>>16;if(r<50||r>3500)return!1;const o=this.NA+((s<<9)/r|0),l=this.FA+((h<<9)/r|0);return o>=this.xA&&o<=this.kA&&l>=this.MA&&l<=this.DA};_m;Vp;Kp;Cm;Em;_h;vm;bm;Tm;Om=0;Rm=0;Sm=0;constructor(t,i,e,s){this._m=e,this.Vp=s,this.Kp=i,this.Em=new m.Eh(e,s,i,null),this.vm=new m.rA(e,s+1,i+1),this.Cm=t,this._h=new m.fe(5e3,null),this.bm=new Int32Array(1e4),this.Tm=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.Rm=t;for(let i=0;i{const e=this.Em[0][t][i];for(let e=0;e<3;e++){this.Em[e][t][i]=this.Em[e+1][t][i];const s=this.Em[e][t][i];s&&s.level--}this.Em[0][t][i]||(this.Em[0][t][i]=new r.A(0,t,i));const s=this.Em[0][t][i];s&&(s.xm=e),this.Em[3][t][i]=null};uA=(t,i,e,s)=>{const n=this.Em[t][i][e];n&&(n.Mm=s)};aA=(t,i,e,s,n,h,o,l,a,c,f,u,w,A,m,g,I,_,C,E)=>{if(s===p.A.lA){for(let s=t;s>=0;s--)this.Em[s][i][e]||(this.Em[s][i][e]=new r.A(s,i,e));const s=this.Em[t][i][e];s&&(s.km=new d.A(f,u,w,A,-1,C,!1))}else if(s===p.A.Dm){for(let s=t;s>=0;s--)this.Em[s][i][e]||(this.Em[s][i][e]=new r.A(s,i,e));const s=this.Em[t][i][e];s&&(s.km=new d.A(m,g,I,_,h,E,o===l&&o===a&&o===c))}else{for(let s=t;s>=0;s--)this.Em[s][i][e]||(this.Em[s][i][e]=new r.A(s,i,e));const d=this.Em[t][i][e];d&&(d.Nm=new y.A(i,s,g,l,w,n,f,c,E,m,h,_,C,a,I,A,o,e,u))}};Wp=(t,i,e,s,n,h,o)=>{this.Em[i][e][s]||(this.Em[i][e][s]=new r.A(i,e,s));const a=this.Em[i][e][s];a&&(a.Fm=new l.A(n,128*e+64,128*s+64,t,h,o))};Bm=(t,i,e)=>{const s=this.Em[t][i][e];s&&(s.Fm=null)};Pm=(t,i,e,s,n,h,o,l)=>{let a=0;const c=this.Em[s][t][i];if(c)for(let t=0;ta&&(a=e)}else this.Em[s][t][i]=new r.A(s,t,i);const f=this.Em[s][t][i];f&&(f.Gm=new u.A(e,128*t+64,128*i+64,h,o,l,n,a))};Ym=(t,i,e)=>{const s=this.Em[t][i][e];s&&(s.Gm=null)};qy=(t,i,e,s,n,h,o,l,c,f)=>{if(!o&&!l)return;for(let s=t;s>=0;s--)this.Em[s][i][e]||(this.Em[s][i][e]=new r.A(s,i,e));const u=this.Em[t][i][e];u&&(u.Hm=new a.A(s,128*i+64,128*e+64,n,h,o,l,c,f))};ep=(t,i,e,s)=>{const n=this.Em[t][i][e];1===s&&n&&(n.Hm=null)};Yp=(t,i,e,s,n,h,o,l,a,f,u)=>{if(!l)return;for(let s=t;s>=0;s--)this.Em[s][i][e]||(this.Em[s][i][e]=new r.A(s,i,e));const d=this.Em[t][i][e];d&&(d.Vm=new c.A(s,128*i+n+64,128*e+h+64,u,f,l,o,a))};Km=(t,i,e)=>{const s=this.Em[t][i][e];s&&(s.Vm=null)};_A=(t,i,e,s)=>{const n=this.Em[t][i][e];if(!n)return;const r=n.Vm;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};Xm=(t,i,e,s)=>{if(!s)return;const n=this.Em[t][i][e];if(!n)return;const r=n.Vm;r&&(r.model=s)};jm=(t,i,e,s)=>{if(!s)return;const n=this.Em[t][i][e];if(!n)return;const r=n.Fm;r&&(r.model=s)};zm=(t,i,e,s)=>{if(!s)return;const n=this.Em[t][i][e];if(!n)return;const r=n.Hm;r&&(r.Zm=s)};qm=(t,i,e,s,n)=>{if(!s)return;const r=this.Em[e][t][i];if(!r)return;const h=r.Hm;h&&(h.Zm=s,h.Jm=n)};Xy=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!n&&!r)return!0;const f=128*i+64*l,u=128*e+64*a;return this.$m(f,u,s,t,i,e,l,a,n,r,h,o,c,!1)};Qm=(t,i,e,s,n,r,h,o,l,a)=>{if(!n&&!r)return!0;let c=i-l,f=s-l,u=i+l,d=s+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.$m(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};tg=(t,i,e,s,n,r,h,o,l,a,c,f)=>!l&&!a||this.$m(i,s,e,t,n,r,h+1-n,o-r+1,l,a,c,0,f,!0);Zy=(t,i,e)=>{const s=this.Em[t][i][e];if(s)for(let t=0;t>29&3)&&n.eg===i&&n.sg===e)return void this.ng(n)}};rg=(t,i,e,s)=>{if(!s)return;const n=this.Em[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};hg=()=>{for(let t=0;t{const s=this.Em[t][i][e];return s&&s.Hm?s.Hm.ig:0};og=(t,i,e)=>{const s=this.Em[t][e][i];return s&&s.Vm?s.Vm.ig:0};lg=(t,i,e)=>{const s=this.Em[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.eg===i&&n.sg===e)return n.ig}return 0};ag=(t,i,e)=>{const s=this.Em[t][i][e];return s&&s.Fm?s.Fm.ig:0};cg=(t,i,e,s)=>{const n=this.Em[t][i][e];if(n){if(n.Hm&&n.Hm.ig===s)return 255&n.Hm.info;if(n.Vm&&n.Vm.ig===s)return 255&n.Vm.info;if(n.Fm&&n.Fm.ig===s)return 255&n.Fm.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.Em[t][i+1][e-1];n&&n.Fm&&n.Fm.model&&n.Fm.model.fg&&this.dg(s,n.Fm.model,128,0,-128,!0)}};ug=(t,i,e,s,n,r)=>{let h=!0,o=i;const l=i+s,a=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this._m){for(let u=o;u<=l;u++)if(!(u<0||u>=this.Vp))for(let o=a;o<=c;o++){if(o<0||o>=this.Kp||h&&u=e||u===i))continue;const a=this.Em[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.Cm[f][u][o]+this.Cm[f][u+1][o]+this.Cm[f][u][o+1]+this.Cm[f][u+1][o+1])/4|0)-((this.Cm[t][i][e]+this.Cm[t][i+1][e]+this.Cm[t][i][e+1]+this.Cm[t][i+1][e+1])/4|0),p=a.Hm;p&&p.Zm&&p.Zm.fg&&this.dg(r,p.Zm,d,y,w,h),p&&p.Jm&&p.Jm.fg&&this.dg(r,p.Jm,d,y,w,h);for(let t=0;t{this.Sm++;let h=0;const o=i.Bd,l=i.Fd;if(t.fg&&t.mg)for(let r=0;ri.gg)continue;const u=t.Bd[r]-e;if(ui._g)continue;const d=t.Pd[r]-n;if(di.Eg)continue;if(i.fg&&i.mg)for(let t=0;t{const h=this.Em[t][i][e];if(!h)return;const o=h.km;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const l=h.Nm;if(!l)return;const a=l.shape,c=l.angle,f=l.Lg,u=l.xg,d=g.dm[a],w=g.wm[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{g.$A=!0,g.Hl=t,g.Vl=i,g.Am=-1,g.gm=-1};draw=(t,i,e,n,r,h,o)=>{t<0?t=0:t>=128*this.Vp&&(t=128*this.Vp-1),e<0?e=0:e>=128*this.Kp&&(e=128*this.Kp-1),g.LA++,g.BA=s.A.sin[h],g.PA=s.A.cos[h],g.UA=s.A.sin[r],g.WA=s.A.cos[r],g.QA=g.CA[(h-128)/32|0][r/64|0],g.GA=t,g.YA=i,g.HA=e,g.VA=t/128|0,g.KA=e/128|0,g.qA=n,g.XA=g.VA-25,g.XA<0&&(g.XA=0),g.zA=g.KA-25,g.zA<0&&(g.zA=0),g.jA=g.VA+25,g.jA>this.Vp&&(g.jA=this.Vp),g.ZA=g.KA+25,g.ZA>this.Kp&&(g.ZA=this.Kp),this.Mg(),g.JA=0;for(let t=this.Rm;t=2e3)?(h.visible=!0,h.update=!0,h.kg=h.Um>0,g.JA++):(h.visible=!1,h.update=!1,h.Dg=0))}}for(let t=this.Rm;t=g.jA))for(let t=-25;t<=0;t++){const n=g.KA+t,r=g.KA-t;let h;if(e>=g.XA&&(n>=g.zA&&(h=i[e][n],h&&h.visible&&this.Ng(h,!0,o)),r=g.zA&&(h=i[s][n],h&&h.visible&&this.Ng(h,!0,o)),r=g.jA))for(let t=-25;t<=0;t++){const n=g.KA+t,r=g.KA-t;let h;if(e>=g.XA&&(n>=g.zA&&(h=i[e][n],h&&h.visible&&this.Ng(h,!1,o)),r=g.zA&&(h=i[s][n],h&&h.visible&&this.Ng(h,!1,o)),r{if(!c&&!f)return!1;for(let t=h;t=this.Vp||i>=this.Kp)return!1;const e=this.Em[s][t][i];if(e&&e.Um>=5)return!1}const p=new n.A(s,e,t,i,c,f,w,h,h+l-1,o,o+a-1,u,d);for(let t=h;th&&(e|=1),to&&(e+=8),i=0;e--)this.Em[e][t][i]||(this.Em[e][t][i]=new r.A(e,t,i));const n=this.Em[s][t][i];n&&(n.Wm[n.Um]=p,n.Fg[n.Um]=e,n.Bg|=e,n.Um++)}return y&&(this._h[this.Om++]=p),!0};ng=t=>{for(let i=t.eg;i<=t.yg;i++)for(let e=t.sg;e<=t.pg;e++){const s=this.Em[t.level][i][e];if(s){for(let i=0;i{const t=g.bA[g.qA],i=g.TA[g.qA];g.pm=0;for(let e=0;e=0&&s<=50){n=t.Ug+25-g.KA,n<0&&(n=0),r=t.Kp+25-g.KA,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.QA&&g.QA[s][n++]){i=!0;break}if(i){if(h=g.GA-t.Ig,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.Wg=(t.Cg-g.HA<<8)/h|0,t.Gg=(t.Eg-g.HA<<8)/h|0,t.Yg=(t.gg-g.YA<<8)/h|0,t.Hg=(t.jd-g.YA<<8)/h|0,g.RA[g.pm++]=t}}}else if(2===t.type){if(s=t.Ug+25-g.KA,s>=0&&s<=50){n=t.Pg+25-g.VA,n<0&&(n=0),r=t.Vp+25-g.VA,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.QA&&g.QA[n++][s]){i=!0;break}if(i){if(h=g.HA-t.Cg,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.Vg=(t.Ig-g.GA<<8)/h|0,t.Kg=(t._g-g.GA<<8)/h|0,t.Yg=(t.gg-g.YA<<8)/h|0,t.Hg=(t.jd-g.YA<<8)/h|0,g.RA[g.pm++]=t}}}else if(4===t.type&&(s=t.gg-g.YA,s>128&&(n=t.Ug+25-g.KA,n<0&&(n=0),r=t.Kp+25-g.KA,r>50&&(r=50),n<=r))){let i=t.Pg+25-g.VA;i<0&&(i=0),h=t.Vp+25-g.VA,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(g.QA&&g.QA[t][i]){e=!0;break t}e&&(t.mode=5,t.Vg=(t.Ig-g.GA<<8)/s|0,t.Kg=(t._g-g.GA<<8)/s|0,t.Wg=(t.Cg-g.HA<<8)/s|0,t.Gg=(t.Eg-g.HA<<8)/s|0,g.RA[g.pm++]=t)}}};Ng=(t,i,e)=>{for(g.SA.Gp(t);;){let t;do{if(t=g.SA.Xg(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.jg,o=this.Em[r];if(t.visible){if(i){if(r>0){const t=this.Em[r-1][s][n];if(t&&t.update)continue}if(s<=g.VA&&s>g.XA){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.Bg)))continue}if(s>=g.VA&&sg.zA){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.Bg)))continue}if(n>=g.KA&&nn&&(a+=6),c=g.tm[a],t.Qg=g.sm[a]),f&&(f.tI&g.im[a]?16===f.tI?(t.Dg=3,t.iI=g.nm[a],t.eI=3-t.iI):32===f.tI?(t.Dg=6,t.iI=g.rm[a],t.eI=6-t.iI):64===f.tI?(t.Dg=12,t.iI=g.hm[a],t.eI=12-t.iI):(t.Dg=9,t.iI=g.om[a],t.eI=9-t.iI):t.Dg=0,f.tI&c&&!this.sI(h,s,n,f.tI)&&f.Zm?.draw(0,g.BA,g.PA,g.UA,g.WA,f.x-g.GA,f.y-g.YA,f.z-g.HA,f.ig),f.nI&c&&!this.sI(h,s,n,f.nI)&&f.Jm?.draw(0,g.BA,g.PA,g.UA,g.WA,f.x-g.GA,f.y-g.YA,f.z-g.HA,f.ig)),u&&!this.visible(h,s,n,u.model.jd))if(u.type&c)u.model.draw(u.angle,g.BA,g.PA,g.UA,g.WA,u.x-g.GA,u.y-g.YA,u.z-g.HA,u.ig);else if(768&u.type){const t=u.x-g.GA,i=u.y-g.YA,e=u.z-g.HA,s=u.angle;let n,r;if(n=s===A.A.jy||s===A.A.$y?-t:t,r=s===A.A.$y||s===A.A.zy?-e:e,256&u.type&&rn){const n=t+g.fm[s],r=e+g.um[s];u.model.draw(512*s+1280&2047,g.BA,g.PA,g.UA,g.WA,n,i,r,u.ig)}}if(l){const i=t.Fm;i&&i.model?.draw(0,g.BA,g.PA,g.UA,g.WA,i.x-g.GA,i.y-g.YA,i.z-g.HA,i.ig);const e=t.Gm;e&&0===e.offset&&(e.rI&&e.rI.draw(0,g.BA,g.PA,g.UA,g.WA,e.x-g.GA,e.y-g.YA,e.z-g.HA,e.ig),e.hI&&e.hI.draw(0,g.BA,g.PA,g.UA,g.WA,e.x-g.GA,e.y-g.YA,e.z-g.HA,e.ig),e.oI&&e.oI.draw(0,g.BA,g.PA,g.UA,g.WA,e.x-g.GA,e.y-g.YA,e.z-g.HA,e.ig))}const d=t.Bg;if(0!==d){if(sg.VA&&1&d){const t=o[s-1][n];t&&t.update&&g.SA.Gp(t)}if(n>g.KA&&8&d){const t=o[s][n-1];t&&t.update&&g.SA.Gp(t)}}}if(0!==t.Dg){let i=!0;for(let e=0;ei.eg&&(r+=1),ei.sg&&(r+=8),ss&&(s=n);const h=g.KA-i.sg,l=i.pg-g.KA;i.lI=l>h?s+l:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.lI,i=e))}if(-1===i)break;const l=g.vA[i];if(l){l.LA=g.LA;let t=l.model;t||(t=l.Jg?.draw(e)??null),t&&!this.aI(h,l.eg,l.yg,l.sg,l.pg,t.jd)&&t.draw(l.$g,g.BA,g.PA,g.UA,g.WA,l.x-g.GA,l.y-g.YA,l.z-g.HA,l.ig);for(let t=l.eg;t<=l.yg;t++)for(let i=l.sg;i<=l.pg;i++){const e=o[t][i];e&&(0!==e.Dg?g.SA.Gp(e):t===s&&i===n||!e.update||g.SA.Gp(e))}}}if(t.kg)continue}if(!t.update||0!==t.Dg)continue;if(s<=g.VA&&s>g.XA){const t=o[s-1][n];if(t&&t.update)continue}if(s>=g.VA&&sg.zA){const t=o[s][n-1];if(t&&t.update)continue}if(n>=g.KA&&n=r){const r=t+g.lm[n],h=s+g.am[n];i.model.draw(512*n+256,g.BA,g.PA,g.UA,g.WA,r,e,h,i.ig)}if(512&i.type&&h<=r){const r=t+g.fm[n],h=s+g.um[n];i.model.draw(512*n+1280&2047,g.BA,g.PA,g.UA,g.WA,r,e,h,i.ig)}}const e=t.Hm;e&&(e.nI&t.Qg&&!this.sI(h,s,n,e.nI)&&e.Jm?.draw(0,g.BA,g.PA,g.UA,g.WA,e.x-g.GA,e.y-g.YA,e.z-g.HA,e.ig),e.tI&t.Qg&&!this.sI(h,s,n,e.tI)&&e.Zm?.draw(0,g.BA,g.PA,g.UA,g.WA,e.x-g.GA,e.y-g.YA,e.z-g.HA,e.ig))}if(rg.VA){const t=o[s-1][n];t&&t.update&&g.SA.Gp(t)}if(n>g.KA){const t=o[s][n-1];t&&t.update&&g.SA.Gp(t)}}};Zg=(t,i,e,n,r,h,o,l)=>{let a,c,f,u,d=a=(e<<7)-g.GA,y=c=(n<<7)-g.HA,p=f=d+128,A=u=y+128,m=this.Cm[i][e][n]-g.YA,I=this.Cm[i][e+1][n]-g.YA,_=this.Cm[i][e+1][n+1]-g.YA,C=this.Cm[i][e][n+1]-g.YA,E=y*o+d*l>>16;if(y=y*l-d*o>>16,d=E,E=m*h-y*r>>16,y=m*r+y*h>>16,m=E,y<50)return;if(E=c*o+p*l>>16,c=c*l-p*o>>16,p=E,E=I*h-c*r>>16,c=I*r+c*h>>16,I=E,c<50)return;if(E=A*o+f*l>>16,A=A*l-f*o>>16,f=E,E=_*h-A*r>>16,A=_*r+A*h>>16,_=E,A<50)return;if(E=u*o+a*l>>16,u=u*l-a*o>>16,a=E,E=C*h-u*r>>16,u=C*r+u*h>>16,C=E,u<50)return;const v=s.A.ya+((d<<9)/y|0),b=s.A.pa+((m<<9)/y|0),T=s.A.ya+((p<<9)/c|0),O=s.A.pa+((I<<9)/c|0),R=s.A.ya+((f<<9)/A|0),S=s.A.pa+((_<<9)/A|0),L=s.A.ya+((a<<9)/u|0),x=s.A.pa+((C<<9)/u|0);if(s.A.alpha=0,(R-L)*(O-x)-(S-x)*(T-L)>0)if(s.A.cI=R<0||L<0||T<0||R>w.A.fI||L>w.A.fI||T>w.A.fI,g.$A&&this.uI(g.Hl,g.Vl,S,x,O,R,L,T)&&(g.Am=e,g.gm=n),-1===t.dI)12345678!==t.wI&&s.A.yI(R,L,T,S,x,O,t.wI,t.pI,t.AI);else if(g.et){const i=g.ym[t.dI];s.A.yI(R,L,T,S,x,O,this.mI(i,t.wI),this.mI(i,t.pI),this.mI(i,t.AI))}else t.flat?s.A.gI(R,L,T,S,x,O,t.wI,t.pI,t.AI,d,m,y,p,a,I,C,c,u,t.dI):s.A.gI(R,L,T,S,x,O,t.wI,t.pI,t.AI,f,_,A,a,p,C,I,u,c,t.dI);if(!((v-T)*(x-O)-(b-O)*(L-T)<=0))if(s.A.cI=v<0||T<0||L<0||v>w.A.fI||T>w.A.fI||L>w.A.fI,g.$A&&this.uI(g.Hl,g.Vl,b,O,x,v,T,L)&&(g.Am=e,g.gm=n),-1!==t.dI){if(!g.et)return void s.A.gI(v,T,L,b,O,x,t.II,t.AI,t.pI,d,m,y,p,a,I,C,c,u,t.dI);const i=g.ym[t.dI];s.A.yI(v,T,L,b,O,x,this.mI(i,t.II),this.mI(i,t.AI),this.mI(i,t.pI))}else 12345678!==t.II&&s.A.yI(v,T,L,b,O,x,t.II,t.AI,t.pI)};qg=(t,i,e,n,r,h,o)=>{let l=e.Bd.length;for(let t=0;t>16;if(a=a*o-i*h>>16,i=c,c=l*r-a*n>>16,a=l*n+a*r>>16,l=c,a<50)return;e._I&&(y.A.CI[t]=i,y.A.EI[t]=l,y.A.vI[t]=a),y.A.bI[t]=s.A.ya+((i<<9)/a|0),y.A.TI[t]=s.A.pa+((l<<9)/a|0)}s.A.alpha=0,l=e.OI.length;for(let n=0;n0)if(s.A.cI=l<0||a<0||c<0||l>w.A.fI||a>w.A.fI||c>w.A.fI,g.$A&&this.uI(g.Hl,g.Vl,f,u,d,l,a,c)&&(g.Am=t,g.gm=i),e._I&&-1!==e._I[n])if(g.et){const t=g.ym[e._I[n]];s.A.yI(l,a,c,f,u,d,this.mI(t,e.LI[n]),this.mI(t,e.xI[n]),this.mI(t,e.MI[n]))}else e.flat?s.A.gI(l,a,c,f,u,d,e.LI[n],e.xI[n],e.MI[n],y.A.CI[0],y.A.EI[0],y.A.vI[0],y.A.CI[1],y.A.CI[3],y.A.EI[1],y.A.EI[3],y.A.vI[1],y.A.vI[3],e._I[n]):s.A.gI(l,a,c,f,u,d,e.LI[n],e.xI[n],e.MI[n],y.A.CI[r],y.A.EI[r],y.A.vI[r],y.A.CI[h],y.A.CI[o],y.A.EI[h],y.A.EI[o],y.A.vI[h],y.A.vI[o],e._I[n]);else 12345678!==e.LI[n]&&s.A.yI(l,a,c,f,u,d,e.LI[n],e.xI[n],e.MI[n])}};zg=(t,i,e)=>{const s=this.vm[t][i][e];if(s===-g.LA)return!1;if(s===g.LA)return!0;{const s=i<<7,n=e<<7;return this.kI(s+1,this.Cm[t][i][e],n+1)&&this.kI(s+128-1,this.Cm[t][i+1][e],n+1)&&this.kI(s+128-1,this.Cm[t][i+1][e+1],n+128-1)&&this.kI(s+1,this.Cm[t][i][e+1],n+128-1)?(this.vm[t][i][e]=g.LA,!0):(this.vm[t][i][e]=-g.LA,!1)}};sI=(t,i,e,s)=>{if(!this.zg(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.Cm[t][i][e]-1,o=h-120,l=h-230,a=h-238;if(s<16){if(1===s){if(n>g.GA){if(!this.kI(n,h,r))return!1;if(!this.kI(n,h,r+128))return!1}if(t>0){if(!this.kI(n,o,r))return!1;if(!this.kI(n,o,r+128))return!1}return!!this.kI(n,l,r)&&this.kI(n,l,r+128)}if(2===s){if(r0){if(!this.kI(n,o,r+128))return!1;if(!this.kI(n+128,o,r+128))return!1}return!!this.kI(n,l,r+128)&&this.kI(n+128,l,r+128)}if(4===s){if(n0){if(!this.kI(n+128,o,r))return!1;if(!this.kI(n+128,o,r+128))return!1}return!!this.kI(n+128,l,r)&&this.kI(n+128,l,r+128)}if(8===s){if(r>g.HA){if(!this.kI(n,h,r))return!1;if(!this.kI(n+128,h,r))return!1}if(t>0){if(!this.kI(n,o,r))return!1;if(!this.kI(n+128,o,r))return!1}return!!this.kI(n,l,r)&&this.kI(n+128,l,r)}}return!!this.kI(n+64,a,r+64)&&(16===s?this.kI(n,l,r+128):32===s?this.kI(n+128,l,r+128):64===s?this.kI(n+128,l,r):128===s?this.kI(n,l,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.zg(t,i,e)){const n=i<<7,r=e<<7;return this.kI(n+1,this.Cm[t][i][e]-s,r+1)&&this.kI(n+128-1,this.Cm[t][i+1][e]-s,r+1)&&this.kI(n+128-1,this.Cm[t][i+1][e+1]-s,r+128-1)&&this.kI(n+1,this.Cm[t][i][e+1]-s,r+128-1)}return!1};aI=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.vm[t][h][o]===-g.LA)return!1;o=1+(i<<7);const l=2+(s<<7),a=this.Cm[t][i][s]-r;if(!this.kI(o,a,l))return!1;const c=(e<<7)-1;if(!this.kI(c,a,l))return!1;const f=(n<<7)-1;return!!this.kI(o,a,f)&&this.kI(c,a,f)}return!!this.zg(t,i,s)&&(h=i<<7,o=s<<7,this.kI(h+1,this.Cm[t][i][s]-r,o+1)&&this.kI(h+128-1,this.Cm[t][i+1][s]-r,o+1)&&this.kI(h+128-1,this.Cm[t][i+1][s+1]-r,o+128-1)&&this.kI(h+1,this.Cm[t][i][s+1]-r,o+128-1))};kI=(t,i,e)=>{for(let s=0;s0){const t=n.Cg+(n.Wg*s>>8),r=n.Eg+(n.Gg*s>>8),h=n.gg+(n.Yg*s>>8),o=n.jd+(n.Hg*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.Ig;if(s>0){const t=n.Cg+(n.Wg*s>>8),r=n.Eg+(n.Gg*s>>8),h=n.gg+(n.Yg*s>>8),o=n.jd+(n.Hg*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.Cg-e;if(s>0){const e=n.Ig+(n.Vg*s>>8),r=n._g+(n.Kg*s>>8),h=n.gg+(n.Yg*s>>8),o=n.jd+(n.Hg*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.Cg;if(s>0){const e=n.Ig+(n.Vg*s>>8),r=n._g+(n.Kg*s>>8),h=n.gg+(n.Yg*s>>8),o=n.jd+(n.Hg*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.gg;if(s>0){const i=n.Ig+(n.Vg*s>>8),r=n._g+(n.Kg*s>>8),h=n.Cg+(n.Wg*s>>8),o=n.Eg+(n.Gg*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};uI=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const l=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*l>0&&l*((i-n)*(r-o)-(t-o)*(e-n))>0};mI=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{}},4197:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{DI;NI;FI;BI;index;Qw;Cl;_l;constructor(t,i,e,s,n,r,h){super(),this.DI=i,this.NI=e,this.FI=s,this.BI=n,this.index=t,this.Qw=r,h&&-1!==r.vl&&this.Qw.delay?(this.Cl=Math.random()*this.Qw.El|0,this._l=Math.random()*this.Qw.delay[this.Cl]|0):(this.Cl=-1,this._l=0)}}},9418:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(7121),n=e(1312),r=e(3867);class h extends s.A{x=0;z=0;$g=0;UI=!1;size=1;Wa=-1;WI=-1;GI=-1;YI=-1;HI=-1;VI=-1;KI=-1;XI=null;jI=100;zI=0;ZI=0;qI=0;JI=0;$I=-1e3;QI=0;t_=0;i_=-1;e_=0;s_=0;n_=-1;r_=0;h_=0;o_=-1;l_=0;a_=0;c_=0;f_=0;u_=-1;d_=0;w_=0;y_=0;p_=0;A_=0;m_=0;g_=0;I_=0;__=0;C_=0;E_=0;LA=0;height=0;v_=0;pathLength=0;b_=new Int32Array(10);T_=new Int32Array(10);O_=new r.fe(10,!1);R_=0;S_=-1;L_=-1;x_=-1;M_=-1;move(t,i,e){if(-1!==this.o_&&n.A.Do[this.o_].priority<=1&&(this.o_=-1),!t){const t=i-this.b_[0],s=e-this.T_[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.b_[t]=this.b_[t-1],this.T_[t]=this.T_[t-1],this.O_[t]=this.O_[t-1];return this.b_[0]=i,this.T_[0]=e,void(this.O_[0]=!1)}}this.pathLength=0,this.R_=0,this.b_[0]=i,this.T_[0]=e,this.x=128*this.b_[0]+64*this.size,this.z=128*this.T_[0]+64*this.size}step(t,i){let e=this.b_[0],s=this.T_[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.o_&&n.A.Do[this.o_].priority<=1&&(this.o_=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.b_[t]=this.b_[t-1],this.T_[t]=this.T_[t-1],this.O_[t]=this.O_[t-1];this.b_[0]=e,this.T_[0]=s,this.O_[0]=t}}},8268:(t,i,e)=>{e.d(i,{A:()=>d});var s=e(9418),n=e(8665),r=e(2679),h=e(8738),o=e(1312),l=e(8317),a=e(1302),c=e(3819),f=e(3867),u=e(9298);class d extends s.A{static k_=1;static D_=2;static N_=4;static F_=8;static B_=16;static P_=32;static U_=64;static W_=128;static G_=256;static Y_=512;static Ua=[u.A.H_,u.A.V_,u.A.K_,u.A.X_,u.A.j_,u.A.z_,u.A.Z_,u.A.q_,u.A.J_,u.A.Q_,u.A.tC,u.A.iC,u.A.eC,u.A.sC,u.A.nC,u.A.rC];static Pa=[[u.A.hC,u.A.oC,u.A.lC,u.A.aC,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.pC,u.A.AC],[u.A.mC,u.A.gC,u.A.IC,u.A._C,u.A.CC,u.A.EC,u.A.vC,u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.SC,u.A.LC,u.A.xC,u.A.MC,u.A.kC],[u.A.kC-1,u.A.mC+1,u.A.gC,u.A.IC,u.A._C,u.A.CC,u.A.EC,u.A.vC,u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.SC,u.A.LC,u.A.xC,u.A.MC],[u.A.DC,u.A.NC,u.A.FC,u.A.BC,u.A.PC,u.A.UC],[u.A.WC,u.A.GC,u.A.YC,u.A.HC,u.A.VC,u.A.KC,u.A.XC,u.A.jC]];static No=new r.A(200);name=null;visible=!1;zC=0;ZC=0;qC=new Uint16Array(12);JC=new Uint16Array(5);ic=0;$C=0n;y=0;QC=0;tE=0;iE=0;eE=0;sE=0;nE=null;Pg=0;Ug=0;Vp=0;Kp=0;et=!1;draw(t){if(!this.visible)return null;let i=this.sw();if(this.height=i.jd,i.ow=!0,this.et)return i;if(-1!==this.u_&&-1!==this.d_){const t=h.A.Do[this.u_],e=n.A.ku(t.ma(),!0,!t.md,!1);e.translate(-this.p_,0,0),e.Ga(),t.Qw&&t.Qw.frames&&e.Ya(t.Qw.frames[this.d_]),e.Hd=null,e.Vd=null,128===t.iw&&128===t.ew||e.scale(t.iw,t.ew,t.iw),e.Ha(t.Id+64,t._d+850,-30,-50,-30,!0);const s=[i,e];i=n.A.rE(s,2)}if(this.nE&&(t>=this.tE&&(this.nE=null),t>=this.QC&&t=d.Pa[i].length)&&(e=0),this.JC[i]=e}this.Wa=t.pu,65535===this.Wa&&(this.Wa=-1),this.WI=t.pu,65535===this.WI&&(this.WI=-1),this.GI=t.pu,65535===this.GI&&(this.GI=-1),this.YI=t.pu,65535===this.YI&&(this.YI=-1),this.HI=t.pu,65535===this.HI&&(this.HI=-1),this.VI=t.pu,65535===this.VI&&(this.VI=-1),this.KI=t.pu,65535===this.KI&&(this.KI=-1),this.name=c.A.Ma(c.A.ka(t.hE)),this.ic=t.mu,this.visible=!0,this.$C=0n;for(let t=0;t<12;t++)this.$C<<=0x4n,this.qC[t]>=256&&(this.$C+=BigInt(this.qC[t])-256n);this.qC[0]>=256&&(this.$C+=BigInt(this.qC[0])-256n>>4n),this.qC[1]>=256&&(this.$C+=BigInt(this.qC[1])-256n>>8n);for(let t=0;t<5;t++)this.$C<<=0x3n,this.$C+=BigInt(this.JC[t]);this.$C<<=0x1n,this.$C+=BigInt(this.zC)}ed(){if(!this.visible)return null;const t=new f.fe(12,null);let i=0;for(let e=0;e<12;e++){const s=this.qC[e];if(s>=256&&s<512&&(t[i++]=l.A.Do[s-256].ed()),s>=512){const e=a.A.get(s-512).ed(this.zC);e&&(t[i++]=e)}}const e=n.A.Fa(t,i);for(let t=0;t<5;t++)0!==this.JC[t]&&(e.Ba(d.Pa[t][0],d.Pa[t][this.JC[t]]),1===t&&e.Ba(d.Ua[0],d.Ua[this.JC[t]]));return e}sw(){let t=this.$C,i=-1,e=-1,s=-1,r=-1;if(this.o_>=0&&0===this.c_){const n=o.A.Do[this.o_];if(n.frames&&(i=n.frames[this.l_]),this.n_>=0&&this.n_!==this.Wa){const t=o.A.Do[this.n_].frames;t&&(e=t[this.r_])}n.qw>=0&&(s=n.qw,t+=BigInt(s-this.qC[5])<<8n),n.Jw>=0&&(r=n.Jw,t+=BigInt(r-this.qC[3])<<16n)}else if(this.n_>=0){const t=o.A.Do[this.n_].frames;t&&(i=t[this.r_])}let h=d.No?.get(t);if(!h){const i=new f.fe(12,null);let e=0;for(let t=0;t<12;t++){let n=this.qC[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=l.A.Do[n-256].ma();t&&(i[e++]=t)}if(n>=512){const t=a.A.get(n-512).jw(this.zC);t&&(i[e++]=t)}}h=n.A.Fa(i,e);for(let t=0;t<5;t++)0!==this.JC[t]&&(h.Ba(d.Pa[t][0],d.Pa[t][this.JC[t]]),1===t&&h.Ba(d.Ua[0],d.Ua[this.JC[t]]));h.Ga(),h.Ha(64,850,-30,-50,-30,!0),d.No?.put(t,h)}if(this.et)return h;const c=n.A.nw(h,!0);return-1!==i&&-1!==e?c.rw(i,e,o.A.Do[this.o_].zw):-1!==i&&c.Ya(i),c.hw(),c.Hd=null,c.Vd=null,c}}},9222:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;model;ig;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.ig=n,this.info=r}}},1161:(t,i,e)=>{e.d(i,{A:()=>s});class s{level;y;x;z;model;Jg;$g;eg;yg;sg;pg;ig;info;lI=0;LA=0;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.Jg=r,this.$g=h,this.eg=o,this.yg=l,this.sg=a,this.pg=c,this.ig=f,this.info=u}}},5748:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;oI;hI;rI;ig;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.oI=s,this.hI=n,this.rI=r,this.ig=h,this.offset=o}}},8256:(t,i,e)=>{e.d(i,{A:()=>s});class s{Pg;Vp;Ug;Kp;type;Ig;_g;Cg;Eg;gg;jd;mode=0;Vg=0;Kg=0;Wg=0;Gg=0;Yg=0;Hg=0;constructor(t,i,e,s,n,r,h,o,l,a,c){this.Pg=t,this.Vp=i,this.Ug=e,this.Kp=s,this.type=n,this.Ig=r,this._g=h,this.Cg=o,this.Eg=l,this.gg=a,this.jd=c}}},3795:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1982),n=e(3867);class r extends s.A{level;x;z;jg;Wm;Fg;km=null;Nm=null;Hm=null;Vm=null;Fm=null;Gm=null;xm=null;Um=0;Bg=0;Mm=0;visible=!1;update=!1;kg=!1;Dg=0;iI=0;eI=0;Qg=0;constructor(t,i,e){super(),this.jg=this.level=t,this.x=i,this.z=e,this.Wm=new n.fe(5,null),this.Fg=new Int32Array(5)}}},2771:(t,i,e)=>{e.d(i,{A:()=>s});class s{static bI=new Int32Array(6);static TI=new Int32Array(6);static CI=new Int32Array(6);static EI=new Int32Array(6);static vI=new Int32Array(6);static oE=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static lE=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static aE=128;static cE=this.aE/2|0;static fE=this.aE/4|0;static uE=3*this.aE/4|0;Bd;Ud;Pd;LI;xI;MI;OI;RI;SI;_I;flat;shape;angle;Lg;xg;constructor(t,i,e,n,r,h,o,l,a,c,f,u,d,w,y,p,A,m,g){this.flat=!(A!==n||A!==w||A!==l),this.shape=i,this.angle=h,this.Lg=d,this.xg=a;const I=s.oE[i],_=I.length;this.Bd=new Int32Array(_),this.Ud=new Int32Array(_),this.Pd=new Int32Array(_);const C=new Int32Array(_),E=new Int32Array(_),v=t*s.aE,b=m*s.aE;for(let t=0;t<_;t++){let i,a,f,d,m,_=I[t];!(1&_)&&_<=8&&(_=1+(_-h-h-1&7)),_>8&&_<=12&&(_=9+(_-h-9&3)),_>12&&_<=16&&(_=13+(_-h-13&3)),1===_?(i=v,a=b,f=A,d=o,m=c):2===_?(i=v+s.cE,a=b,f=A+n>>1,d=o+g>>1,m=c+e>>1):3===_?(i=v+s.aE,a=b,f=n,d=g,m=e):4===_?(i=v+s.aE,a=b+s.cE,f=n+w>>1,d=g+r>>1,m=e+y>>1):5===_?(i=v+s.aE,a=b+s.aE,f=w,d=r,m=y):6===_?(i=v+s.cE,a=b+s.aE,f=w+l>>1,d=r+p>>1,m=y+u>>1):7===_?(i=v,a=b+s.aE,f=l,d=p,m=u):8===_?(i=v,a=b+s.cE,f=l+A>>1,d=p+o>>1,m=u+c>>1):9===_?(i=v+s.cE,a=b+s.fE,f=A+n>>1,d=o+g>>1,m=c+e>>1):10===_?(i=v+s.uE,a=b+s.cE,f=n+w>>1,d=g+r>>1,m=e+y>>1):11===_?(i=v+s.cE,a=b+s.uE,f=w+l>>1,d=r+p>>1,m=y+u>>1):12===_?(i=v+s.fE,a=b+s.cE,f=l+A>>1,d=p+o>>1,m=u+c>>1):13===_?(i=v+s.fE,a=b+s.fE,f=A,d=o,m=c):14===_?(i=v+s.uE,a=b+s.fE,f=n,d=g,m=e):15===_?(i=v+s.uE,a=b+s.uE,f=w,d=r,m=y):(i=v+s.fE,a=b+s.uE,f=l,d=p,m=u),this.Bd[t]=i,this.Ud[t]=f,this.Pd[t]=a,C[t]=d,E[t]=m}const T=s.lE[i],O=T.length/4|0;this.OI=new Int32Array(O),this.RI=new Int32Array(O),this.SI=new Int32Array(O),this.LI=new Int32Array(O),this.xI=new Int32Array(O),this.MI=new Int32Array(O),this._I=-1!==f?new Int32Array(O):null;let R=0;for(let t=0;t{e.d(i,{A:()=>s});class s{static lA=0;static Dm=1;static dE=2;static wE=3;static yE=4;static pE=5;static cE=6;static fE=7;static uE=8;static AE=9;static mE=10;static gE=11}},3479:(t,i,e)=>{e.d(i,{A:()=>s});class s{II;AI;wI;pI;dI;color;flat;constructor(t,i,e,s,n,r,h){this.II=t,this.AI=i,this.wI=e,this.pI=s,this.dI=n,this.color=r,this.flat=h}}},6855:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;tI;nI;Zm;Jm;ig;info;constructor(t,i,e,s,n,r,h,o,l){this.y=t,this.x=i,this.z=e,this.tI=s,this.nI=n,this.Zm=r,this.Jm=h,this.ig=o,this.info=l}}},7441:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;type;angle;model;ig;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.ig=h,this.info=o}}},7536:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{IE;_E;constructor(t){this._E=[],this.IE=t;for(let i=0;i{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{EE;vE;constructor(){super(),this.EE=this,this.vE=this}bE(){this.vE&&this.EE&&(this.vE.EE=this.EE,this.EE.vE=this.vE,this.EE=null,this.vE=null)}}},3819:(t,i,e)=>{e.d(i,{A:()=>s});class s{static TE=['_','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','0','1','2','3','4','5','6','7','8','9'];static OE=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static ka=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.TE[Number(s-37n*t)]}return e.slice(12-i).join('')};static RE=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static SE=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static Ma=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static Lu=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}},6666:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{LE;cursor=null;constructor(){const t=new s.A;t.next=t,t.CE=t,this.LE=t}Gp(t){t.CE&&t.ww(),t.CE=this.LE.CE,t.next=this.LE,t.CE&&(t.CE.next=t),t.next.CE=t}xE(t){t.CE&&t.ww(),t.CE=this.LE,t.next=this.LE.next,t.CE.next=t,t.next&&(t.next.CE=t)}Xg(){const t=this.LE.next;return t===this.LE?null:(t?.ww(),t)}head(){const t=this.LE.next;return t===this.LE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}ME(){const t=this.LE.CE;return t===this.LE?(this.cursor=null,null):(this.cursor=t?.CE||null,t)}next(){const t=this.cursor;return t===this.LE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}CE(){const t=this.cursor;return t===this.LE?(this.cursor=null,null):(this.cursor=t?.CE||null,t)}clear(){for(;;){const t=this.LE.next;if(t===this.LE)return;t?.ww()}}}},1982:(t,i,e)=>{e.d(i,{A:()=>s});class s{key;next;CE;constructor(){this.key=0n,this.next=this,this.CE=this}ww(){this.CE&&this.next&&(this.CE.next=this.next,this.next.CE=this.CE,this.next=null,this.CE=null)}}},2679:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(2512),n=e(7536);class r{kE;DE;history;available;constructor(t){this.kE=t,this.available=t,this.DE=new n.A(1024),this.history=new s.A}get(t){const i=this.DE.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.ww(),t?.bE()}else this.available--;this.DE.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.ww(),t.bE()):this.available=this.kE}}},2512:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n{head;constructor(){this.head=new s.A}push(t){t.vE&&t.bE(),t.vE=this.head.vE,t.EE=this.head,t.vE&&(t.vE.EE=t),t.EE.vE=t}pop(){const t=this.head.EE;return t===this.head?null:(t?.bE(),t)}}},8534:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(3867);class r{static Do=[];static yu=t=>{const i=new s.A(t.read('base_head.dat')),e=new s.A(t.read('base_type.dat')),h=new s.A(t.read('base_label.dat')),o=i.pu;i.mf+=2;for(let t=0;t{e.d(i,{A:()=>r});var s=e(8534),n=e(1069);class r{static Do=[];static yu=t=>{const i=new n.A(t.read('frame_head.dat')),e=new n.A(t.read('frame_tran1.dat')),h=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),l=i.pu;i.mf+=2;const a=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){a[p]=i,c[p]=0,f[p]=0,u[p]=0,p++;break}a[p]=t;let e=0;3===d.types[a[p]]&&(e=128),c[p]=1&i?h.FE:e,f[p]=2&i?h.FE:e,u[p]=4&i?h.FE:e,y=t,p++}}n.length=p,n.BE=new Int32Array(p),n.x=new Int32Array(p),n.y=new Int32Array(p),n.z=new Int32Array(p);for(let t=0;t{e.d(i,{Nc:()=>s,nl:()=>n,PE:()=>o,UE:()=>h,WE:()=>r});const s=document.getElementById('canvas'),n=s.getContext('2d',{willReadFrequently:!0}),r=document.createElement('canvas'),h=document.createElement('img'),o=r.getContext('2d',{willReadFrequently:!0})},9298:(t,i,e)=>{e.d(i,{A:()=>s});class s{static RED=16711680;static GREEN=65280;static BLUE=255;static ql=16776960;static GE=65535;static fA=16711935;static Ll=16777215;static Zl=0;static YE=16748608;static HE=8388608;static VE=128;static KE=16756736;static XE=16740352;static jE=16723968;static zE=12648192;static ZE=8453888;static qE=4259584;static JE=9179409;static $E=6116423;static fl=2301979;static ul=5063219;static wl=7759444;static pl=3353893;static QE=8388736;static tv=13350793;static iv=Int32Array.of(s.ql,s.RED,s.GREEN,s.GE,s.fA,s.Ll);static hC=6798;static oC=107;static lC=10283;static aC=16;static cC=4797;static fC=7744;static uC=5799;static dC=4634;static wC=33697;static yC=22433;static pC=2983;static AC=54193;static mC=8741;static gC=12;static IC=64030;static _C=43162;static CC=7735;static EC=8404;static vC=1701;static bC=38430;static TC=24094;static OC=10153;static RC=56621;static SC=4783;static LC=1341;static xC=16578;static MC=35003;static kC=25239;static H_=9104;static V_=10275;static K_=7595;static X_=3610;static j_=7975;static z_=8526;static Z_=918;static q_=38802;static J_=24466;static Q_=10145;static tC=58654;static iC=5027;static eC=1457;static sC=16565;static nC=34991;static rC=25486;static DC=4626;static NC=11146;static FC=6439;static BC=12;static PC=4758;static UC=10270;static jC=4574;static WC=4550;static GC=4537;static YC=5681;static HC=5673;static VC=5790;static KC=6806;static XC=8076}},8950:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n extends s.A{static mw=new Int32Array;static gw=0;static Iw=0;static top=0;static bottom=0;static left=0;static right=0;static fI=0;static ev=0;static sv=0;static bind=(t,i,e)=>{this.mw=t,this.gw=i,this.Iw=e,this.Tl(0,0,i,e)};static nv=()=>{this.left=0,this.top=0,this.right=this.gw,this.bottom=this.Iw,this.fI=this.right-1,this.ev=this.right/2|0};static Tl=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.gw&&(e=this.gw),s>this.Iw&&(s=this.Iw),this.top=i,this.bottom=s,this.left=t,this.right=e,this.fI=this.right-1,this.ev=this.right/2|0,this.sv=this.bottom/2|0};static clear=()=>{const t=this.gw*this.Iw;for(let i=0;i{this.yl(t,i,n,e),this.yl(t,i+s-1,n,e),this.dl(t,i,n,s),this.dl(t+e-1,i,n,s)};static yl=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.gw;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.gw;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(a-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.gw-e;let h=t+i*this.gw;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.mw[h++]=n;h+=r}};static hv(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,l=(n>>8&255)*r,a=(255&n)*r,c=this.gw-e;let f=t+i*this.gw;for(let t=0;t>16&255)*h>>8<<16)+(l+(this.mw[f]>>8&255)*h>>8<<8)+(a+(255&this.mw[f])*h>>8);this.mw[f++]=t}f+=c}}static ov(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,l=(255&s)*n;let a=i-e;a<0&&(a=0);let c=i+e;c>=this.Iw&&(c=this.Iw-1);for(let s=a;s<=c;s++){const n=s-i,a=0|Math.sqrt(e*e-n*n);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.gw&&(f=this.gw-1);let u=c+s*this.gw;for(let t=c;t<=f;t++){const t=(h+(this.mw[u]>>16&255)*r>>8<<16)+(o+(this.mw[u]>>8&255)*r>>8<<8)+(l+(255&this.mw[u])*r>>8);this.mw[u++]=t}}}static lv=(t,i,e)=>{t=this.right||i=this.bottom||(this.mw[t+i*this.gw]=e)}}},4583:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1673),r=e(3867);class h extends s.A{static et=!1;static av=new Int32Array(512);static cv=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static fv=new r.fe(50,null);static uv=0;static Aw=new Int32Array;static ya=0;static pa=0;static _w=!0;static cI=!1;static alpha=0;static dv=null;static wv=new r.fe(50,null);static yv=0;static LA=0;static pv=new Int32Array(50);static Av=new r.fe(50,null);static mv=!1;static gv=new r.fe(50,!1);static Iv=new Int32Array(50);static{for(let t=1;t<512;t++)this.av[t]=32768/t|0;for(let t=1;t<2048;t++)this.cv[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static So=()=>{this.av=null,this.av=null,this.sin=null,this.cos=null,this.Aw=null,this.fv=null,this.gv=null,this.Iv=null,this.dv=null,this.wv=null,this.pv=null,this.palette=null,this.Av=null,console.log('Draw3D unloaded!')};static Fc=()=>{this.Aw=new Int32Array(s.A.Iw);for(let t=0;t{this.Aw=new Int32Array(i);for(let e=0;e{this.dv=null,this.wv.fill(null)};static Ev=t=>{this.uv=0;for(let i=0;i<50;i++)try{this.fv[i]=n.A.xu(t,i.toString()),this.et&&128===this.fv[i]?.Xl?this.fv[i]?.vv():this.fv[i]?.xw(),this.uv++}catch(t){}};static cA=t=>{if(0!==this.Iv[t])return this.Iv[t];const i=this.Av[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.bv(h,1.4),0===h&&(h=1),this.Iv[t]=h,h};static Tv=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,l=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let a=s-.3333333333333333;a<0&&a++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*h|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[e++]=this.bv(a,i)}}for(let t=0;t<50;t++){const e=this.fv[t];if(!e)continue;const s=e.palette;this.Av[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static Rv=t=>{this.dv||(this.yv=t,this.et?this.dv=new r.Xr(t,16384):this.dv=new r.Xr(t,65536),this.wv.fill(null))};static yI=(t,i,e,n,r,o,l,a,c)=>{let f=0,u=0;r!==n&&(f=(i-t<<16)/(r-n)|0,u=(a-l<<15)/(r-n)|0);let d=0,w=0;o!==r&&(d=(e-i<<16)/(o-r)|0,w=(c-a<<15)/(o-r)|0);let y=0,p=0;if(o!==n&&(y=(t-e<<16)/(n-o)|0,p=(l-c<<15)/(n-o)|0),n<=r&&n<=o){if(ns.A.bottom&&(r=s.A.bottom),o>s.A.bottom&&(o=s.A.bottom),rd)for(o-=r,r-=n,n=h.Aw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Sv(e>>16,i>>16,c>>7,a>>7,s.A.mw,n,0),e+=y,i+=d,c+=p,a+=w,n+=s.A.gw}this.Sv(e>>16,t>>16,c>>7,l>>7,s.A.mw,n,0),e+=y,t+=f,c+=p,l+=u,n+=s.A.gw}else for(o-=r,r-=n,n=h.Aw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Sv(i>>16,e>>16,a>>7,c>>7,s.A.mw,n,0),e+=y,i+=d,c+=p,a+=w,n+=s.A.gw}this.Sv(t>>16,e>>16,l>>7,c>>7,s.A.mw,n,0),e+=y,t+=f,c+=p,l+=u,n+=s.A.gw}else if(i=t<<=16,a=l<<=15,n<0&&(i-=y*n,t-=f*n,a-=p*n,l-=u*n,n=0),e<<=16,c<<=15,o<0&&(e-=d*o,c-=w*o,o=0),n!==o&&yf)for(r-=o,o-=n,n=h.Aw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Sv(e>>16,t>>16,c>>7,l>>7,s.A.mw,n,0),e+=d,t+=f,c+=w,l+=u,n+=s.A.gw}this.Sv(i>>16,t>>16,a>>7,l>>7,s.A.mw,n,0),i+=y,t+=f,a+=p,l+=u,n+=s.A.gw}else for(r-=o,o-=n,n=h.Aw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Sv(t>>16,e>>16,l>>7,c>>7,s.A.mw,n,0),e+=d,t+=f,c+=w,l+=u,n+=s.A.gw}this.Sv(t>>16,i>>16,l>>7,a>>7,s.A.mw,n,0),i+=y,t+=f,a+=p,l+=u,n+=s.A.gw}}else if(r<=o){if(rs.A.bottom&&(o=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),oy)for(n-=o,o-=r,r=h.Aw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Sv(t>>16,e>>16,l>>7,c>>7,s.A.mw,r,0),t+=f,e+=y,l+=u,c+=p,r+=s.A.gw}this.Sv(t>>16,i>>16,l>>7,a>>7,s.A.mw,r,0),t+=f,i+=d,l+=u,a+=w,r+=s.A.gw}else for(n-=o,o-=r,r=h.Aw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Sv(e>>16,t>>16,c>>7,l>>7,s.A.mw,r,0),t+=f,e+=y,l+=u,c+=p,r+=s.A.gw}this.Sv(i>>16,t>>16,a>>7,l>>7,s.A.mw,r,0),t+=f,i+=d,l+=u,a+=w,r+=s.A.gw}else if(e=i<<=16,c=a<<=15,r<0&&(e-=f*r,i-=d*r,c-=u*r,a-=w*r,r=0),t<<=16,l<<=15,n<0&&(t-=y*n,l-=p*n,n=0),o-=n,n-=r,r=h.Aw[r],f>16,i>>16,l>>7,a>>7,s.A.mw,r,0),t+=y,i+=d,l+=p,a+=w,r+=s.A.gw}this.Sv(e>>16,i>>16,c>>7,a>>7,s.A.mw,r,0),e+=f,i+=d,c+=u,a+=w,r+=s.A.gw}else for(;;){if(--n<0)for(;;){if(--o<0)return;this.Sv(i>>16,t>>16,a>>7,l>>7,s.A.mw,r,0),t+=y,i+=d,l+=p,a+=w,r+=s.A.gw}this.Sv(i>>16,e>>16,a>>7,c>>7,s.A.mw,r,0),e+=f,i+=d,c+=u,a+=w,r+=s.A.gw}}else if(os.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,a>>7,l>>7,s.A.mw,o,0),i+=d,t+=f,a+=w,l+=u,o+=s.A.gw}this.Sv(i>>16,e>>16,a>>7,c>>7,s.A.mw,o,0),i+=d,e+=y,a+=w,c+=p,o+=s.A.gw}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Sv(t>>16,i>>16,l>>7,a>>7,s.A.mw,o,0),i+=d,t+=f,a+=w,l+=u,o+=s.A.gw}this.Sv(e>>16,i>>16,c>>7,a>>7,s.A.mw,o,0),i+=d,e+=y,a+=w,c+=p,o+=s.A.gw}else if(t=e<<=16,l=c<<=15,o<0&&(t-=d*o,e-=y*o,l-=w*o,c-=p*o,o=0),i<<=16,a<<=15,r<0&&(i-=f*r,a-=u*r,r=0),n-=r,r-=o,o=h.Aw[o],d>16,e>>16,a>>7,c>>7,s.A.mw,o,0),i+=f,e+=y,a+=u,c+=p,o+=s.A.gw}this.Sv(t>>16,e>>16,l>>7,c>>7,s.A.mw,o,0),t+=d,e+=y,l+=w,c+=p,o+=s.A.gw}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Sv(e>>16,i>>16,c>>7,a>>7,s.A.mw,o,0),i+=f,e+=y,a+=u,c+=p,o+=s.A.gw}this.Sv(e>>16,t>>16,c>>7,l>>7,s.A.mw,o,0),t+=d,e+=y,l+=w,c+=p,o+=s.A.gw}};static Sv=(t,i,e,n,r,o,l)=>{let a;if(h._w){let c;if(h.cI){if(c=i-t>3?(n-e)/(i-t)|0:0,i>s.A.fI&&(i=s.A.fI),t<0&&(e-=t*c,t=0),t>=i)return;o+=t,l=i-t>>2,c<<=2}else{if(!(t>2)>0?(n-e)*h.av[l]>>15:0}if(0===h.alpha)for(;;){if(--l<0){if((l=i-t&3)>0){a=h.palette[e>>8];do{r[o++]=a,l--}while(l>0);return}break}a=h.palette[e>>8],e+=c,r[o++]=a,r[o++]=a,r[o++]=a,r[o++]=a}else{const s=h.alpha,n=256-h.alpha;for(;;){if(--l<0){if((l=i-t&3)>0){a=h.palette[e>>8],a=((16711935&a)*n>>8&16711935)+((65280&a)*n>>8&65280);do{r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),l--}while(l>0)}break}a=h.palette[e>>8],e+=c,a=((16711935&a)*n>>8&16711935)+((65280&a)*n>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280)}}}else if(ts.A.fI&&(i=s.A.fI),t<0&&(e-=t*c,t=0),t>=i))return;if(o+=t,l=i-t,0===h.alpha)do{r[o++]=h.palette[e>>8],e+=c,l--}while(l>0);else{const t=h.alpha,i=256-h.alpha;do{a=h.palette[e>>8],e+=c,a=((16711935&a)*i>>8&16711935)+((65280&a)*i>>8&65280),r[o++]=a+((16711935&r[o])*t>>8&16711935)+((65280&r[o])*t>>8&65280),l--}while(l>0)}}};static Lv=(t,i,e,n,r,h,o)=>{let l=0;r!==n&&(l=(i-t<<16)/(r-n)|0);let a=0;h!==r&&(a=(e-i<<16)/(h-r)|0);let c=0;if(h!==n&&(c=(t-e<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),ra)for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.xv(e>>16,i>>16,s.A.mw,n,o),e+=c,i+=a,n+=s.A.gw}this.xv(e>>16,t>>16,s.A.mw,n,o),e+=c,t+=l,n+=s.A.gw}else for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.xv(i>>16,e>>16,s.A.mw,n,o),e+=c,i+=a,n+=s.A.gw}this.xv(t>>16,e>>16,s.A.mw,n,o),e+=c,t+=l,n+=s.A.gw}else if(i=t<<=16,n<0&&(i-=c*n,t-=l*n,n=0),e<<=16,h<0&&(e-=a*h,h=0),n!==h&&cl)for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.xv(e>>16,t>>16,s.A.mw,n,o),e+=a,t+=l,n+=s.A.gw}this.xv(i>>16,t>>16,s.A.mw,n,o),i+=c,t+=l,n+=s.A.gw}else for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.xv(t>>16,e>>16,s.A.mw,n,o),e+=a,t+=l,n+=s.A.gw}this.xv(t>>16,i>>16,s.A.mw,n,o),i+=c,t+=l,n+=s.A.gw}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hc)for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.xv(t>>16,e>>16,s.A.mw,r,o),t+=l,e+=c,r+=s.A.gw}this.xv(t>>16,i>>16,s.A.mw,r,o),t+=l,i+=a,r+=s.A.gw}else for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.xv(e>>16,t>>16,s.A.mw,r,o),t+=l,e+=c,r+=s.A.gw}this.xv(i>>16,t>>16,s.A.mw,r,o),t+=l,i+=a,r+=s.A.gw}else if(e=i<<=16,r<0&&(e-=l*r,i-=a*r,r=0),t<<=16,n<0&&(t-=c*n,n=0),l>16,i>>16,s.A.mw,r,o),t+=c,i+=a,r+=s.A.gw}this.xv(e>>16,i>>16,s.A.mw,r,o),e+=l,i+=a,r+=s.A.gw}else for(h-=n,n-=r,r=this.Aw[r];;){if(--n<0)for(;;){if(--h<0)return;this.xv(i>>16,t>>16,s.A.mw,r,o),t+=c,i+=a,r+=s.A.gw}this.xv(i>>16,e>>16,s.A.mw,r,o),e+=l,i+=a,r+=s.A.gw}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.mw,h,o),i+=a,t+=l,h+=s.A.gw}this.xv(i>>16,e>>16,s.A.mw,h,o),i+=a,e+=c,h+=s.A.gw}else for(r-=n,n-=h,h=this.Aw[h];;){if(--n<0)for(;;){if(--r<0)return;this.xv(t>>16,i>>16,s.A.mw,h,o),i+=a,t+=l,h+=s.A.gw}this.xv(e>>16,i>>16,s.A.mw,h,o),i+=a,e+=c,h+=s.A.gw}else if(t=e<<=16,h<0&&(t-=a*h,e-=c*h,h=0),i<<=16,r<0&&(i-=l*r,r=0),a>16,e>>16,s.A.mw,h,o),i+=l,e+=c,h+=s.A.gw}this.xv(t>>16,e>>16,s.A.mw,h,o),t+=a,e+=c,h+=s.A.gw}else for(n-=r,r-=h,h=this.Aw[h];;){if(--r<0)for(;;){if(--n<0)return;this.xv(e>>16,i>>16,s.A.mw,h,o),i+=l,e+=c,h+=s.A.gw}this.xv(e>>16,t>>16,s.A.mw,h,o),t+=a,e+=c,h+=s.A.gw}};static gI=(t,i,e,n,r,h,o,l,a,c,f,u,d,w,y,p,A,m,g)=>{const I=this.Mv(g);this.mv=!this.gv[g];const _=c-d,C=f-y,E=u-A,v=w-c,b=p-f,T=m-u;let O=v*f-b*c<<14;const R=b*u-T*f<<8,S=T*c-v*u<<5;let L=_*f-C*c<<14;const x=C*u-E*f<<8,M=E*c-_*u<<5;let k=C*v-_*b<<14;const D=E*b-C*T<<8,N=_*T-E*v<<5;let F=0,B=0;r!==n&&(F=(i-t<<16)/(r-n)|0,B=(l-o<<16)/(r-n)|0);let P=0,U=0;h!==r&&(P=(e-i<<16)/(h-r)|0,U=(a-l<<16)/(h-r)|0);let W=0,G=0;if(h!==n&&(W=(t-e<<16)/(n-h)|0,G=(o-a<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),rP)for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.kv(e>>16,i>>16,s.A.mw,n,I,0,0,O,L,k,R,x,D,a>>8,l>>8),e+=W,i+=P,a+=G,l+=U,n+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(e>>16,t>>16,s.A.mw,n,I,0,0,O,L,k,R,x,D,a>>8,o>>8),e+=W,t+=F,a+=G,o+=B,n+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.kv(i>>16,e>>16,s.A.mw,n,I,0,0,O,L,k,R,x,D,l>>8,a>>8),e+=W,i+=P,a+=G,l+=U,n+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(t>>16,e>>16,s.A.mw,n,I,0,0,O,L,k,R,x,D,o>>8,a>>8),e+=W,t+=F,a+=G,o+=B,n+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}else{i=t<<=16,l=o<<=16,n<0&&(i-=W*n,t-=F*n,l-=G*n,o-=B*n,n=0),e<<=16,a<<=16,h<0&&(e-=P*h,a-=U*h,h=0);const c=n-this.pa;if(O+=S*c,L+=M*c,k+=N*c,O|=0,L|=0,k|=0,(n===h||W>=F)&&(n!==h||P<=F))for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.kv(t>>16,e>>16,s.A.mw,n,I,0,0,O,L,k,R,x,D,o>>8,a>>8),e+=P,t+=F,a+=U,o+=B,n+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(t>>16,i>>16,s.A.mw,n,I,0,0,O,L,k,R,x,D,o>>8,l>>8),i+=W,t+=F,l+=G,o+=B,n+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.kv(e>>16,t>>16,s.A.mw,n,I,0,0,O,L,k,R,x,D,a>>8,o>>8),e+=P,t+=F,a+=U,o+=B,n+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(i>>16,t>>16,s.A.mw,n,I,0,0,O,L,k,R,x,D,l>>8,o>>8),i+=W,t+=F,l+=G,o+=B,n+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hW)for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.kv(t>>16,e>>16,s.A.mw,r,I,0,0,O,L,k,R,x,D,o>>8,a>>8),t+=F,e+=W,o+=B,a+=G,r+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(t>>16,i>>16,s.A.mw,r,I,0,0,O,L,k,R,x,D,o>>8,l>>8),t+=F,i+=P,o+=B,l+=U,r+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.kv(e>>16,t>>16,s.A.mw,r,I,0,0,O,L,k,R,x,D,a>>8,o>>8),t+=F,e+=W,o+=B,a+=G,r+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(i>>16,t>>16,s.A.mw,r,I,0,0,O,L,k,R,x,D,l>>8,o>>8),t+=F,i+=P,o+=B,l+=U,r+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}else{e=i<<=16,a=l<<=16,r<0&&(e-=F*r,i-=P*r,a-=B*r,l-=U*r,r=0),t<<=16,o<<=16,n<0&&(t-=W*n,o-=G*n,n=0);const c=r-this.pa;if(O+=S*c,L+=M*c,k+=N*c,O|=0,L|=0,k|=0,h-=n,n-=r,r=this.Aw[r],F>16,i>>16,s.A.mw,r,I,0,0,O,L,k,R,x,D,o>>8,l>>8),t+=W,i+=P,o+=G,l+=U,r+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(e>>16,i>>16,s.A.mw,r,I,0,0,O,L,k,R,x,D,a>>8,l>>8),e+=F,i+=P,a+=B,l+=U,r+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--h<0)return;this.kv(i>>16,t>>16,s.A.mw,r,I,0,0,O,L,k,R,x,D,l>>8,o>>8),t+=W,i+=P,o+=G,l+=U,r+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(i>>16,e>>16,s.A.mw,r,I,0,0,O,L,k,R,x,D,l>>8,a>>8),e+=F,i+=P,a+=B,l+=U,r+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.mw,h,I,0,0,O,L,k,R,x,D,l>>8,o>>8),i+=P,t+=F,l+=U,o+=B,h+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(i>>16,e>>16,s.A.mw,h,I,0,0,O,L,k,R,x,D,l>>8,a>>8),i+=P,e+=W,l+=U,a+=G,h+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.kv(t>>16,i>>16,s.A.mw,h,I,0,0,O,L,k,R,x,D,o>>8,l>>8),i+=P,t+=F,l+=U,o+=B,h+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(e>>16,i>>16,s.A.mw,h,I,0,0,O,L,k,R,x,D,a>>8,l>>8),i+=P,e+=W,l+=U,a+=G,h+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}else{t=e<<=16,o=a<<=16,h<0&&(t-=P*h,e-=W*h,o-=U*h,a-=G*h,h=0),i<<=16,l<<=16,r<0&&(i-=F*r,l-=B*r,r=0);const c=h-this.pa;if(O+=S*c,L+=M*c,k+=N*c,O|=0,L|=0,k|=0,n-=r,r-=h,h=this.Aw[h],P>16,e>>16,s.A.mw,h,I,0,0,O,L,k,R,x,D,l>>8,a>>8),i+=F,e+=W,l+=B,a+=G,h+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(t>>16,e>>16,s.A.mw,h,I,0,0,O,L,k,R,x,D,o>>8,a>>8),t+=P,e+=W,o+=U,a+=G,h+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.kv(e>>16,i>>16,s.A.mw,h,I,0,0,O,L,k,R,x,D,a>>8,l>>8),i+=F,e+=W,l+=B,a+=G,h+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(e>>16,t>>16,s.A.mw,h,I,0,0,O,L,k,R,x,D,a>>8,o>>8),t+=P,e+=W,o+=U,a+=G,h+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}};static kv=(t,i,e,n,r,h,o,l,a,c,f,u,d,w,y)=>{if(t>=i)return;let p,A,m,g,I,_,C,E,v;if(this.cI){if(p=(y-w)/(i-t)|0,i>s.A.fI&&(i=s.A.fI),t<0&&(w-=t*p,t=0),t>=i)return;A=i-t>>3,p<<=12}else i-t>7?(A=i-t>>3,p=(y-w)*this.av[A]>>6):(A=0,p=0);if(w<<=9,n+=t,this.et&&r)if(m=0,g=0,_=t-this.ya,l+=(f>>3)*_,a+=(u>>3)*_,c+=(d>>3)*_,l|=0,a|=0,I=(c|=0)>>12,0!==I&&(o=a/I|0,(h=l/I|0)<0?h=0:h>4032&&(h=4032)),l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>12,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>4032&&(m=4032)),C=m-h>>3,E=g-o>>3,h+=w>>3&786432,v=w>>23,this.mv){for(;A-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h=m,o=g,l+=f,a+=u,I=(c+=d)>>12,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>4032&&(m=4032)),C=m-h>>3,E=g-o>>3,h+=(w+=p)>>3&786432,v=w>>23;for(A=i-t&7;A-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E}else{for(;A-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n+=1,h=m,o=g,l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>12,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>4032&&(m=4032)),C=m-h>>3,E=g-o>>3,h+=(w+=p)>>3&786432,v=w>>23}for(A=i-t&7;A-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}else if(m=0,g=0,_=t-this.ya,l+=(f>>3)*_,a+=(u>>3)*_,c+=(d>>3)*_,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(o=a/I|0,(h=l/I|0)<0?h=0:h>16256&&(h=16256)),l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>16256&&(m=16256)),C=m-h>>3,E=g-o>>3,h+=6291456&w,v=w>>23,this.mv&&r){for(;A-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h=m,o=g,l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>16256&&(m=16256)),C=m-h>>3,E=g-o>>3,h+=6291456&(w+=p),v=w>>23;for(A=i-t&7;A-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E}else{for(;A-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,h=m,o=g,l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>16256&&(m=16256)),C=m-h>>3,E=g-o>>3,h+=6291456&(w+=p),v=w>>23}for(A=i-t&7;A-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}};static xv=(t,i,e,n,r)=>{if(this.cI&&(i>s.A.fI&&(i=s.A.fI),t<0&&(t=0)),t>=i)return;n+=t;let h=i-t>>2;if(0===this.alpha)for(;;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;e[n++]=r}e[n++]=r,e[n++]=r,e[n++]=r,e[n++]=r}const o=this.alpha,l=256-this.alpha;for(r=((16711935&r)*l>>8&16711935)+((65280&r)*l>>8&65280);;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}};static Ov=t=>{this.wv[t]&&this.dv&&(this.dv[this.yv++]=this.wv[t],this.wv[t]=null)};static Mv=t=>{if(this.pv[t]=this.LA++,this.wv[t])return this.wv[t];let i;if(this.yv>0&&this.dv)i=this.dv[--this.yv],this.dv[this.yv]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.mw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.mw[t]];this.gv[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.gv[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}},880:(t,i,e)=>{e.d(i,{r:()=>n});var s=e(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(s.UE.src),s.UE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>s.UE.onload=()=>t())),s.PE.clearRect(0,0,s.WE.width,s.WE.height);const i=s.UE.naturalWidth,e=s.UE.naturalHeight;return s.WE.width=i,s.WE.height=e,s.PE.drawImage(s.UE,0,0),s.PE.getImageData(0,0,i,e)}},8665:(t,i,e)=>{e.d(i,{A:()=>f});var s=e(1069),n=e(8950),r=e(4583),h=e(6730),o=e(4474),l=e(3867);class a{Fd=0;bg=0;Dv=0;Nv=-1;Fv=-1;Bv=-1;Pv=-1;Uv=-1;Wv=-1;Gv=-1;Yv=-1;Hv=-1;Vv=0;Kv=-1;Xv=-1;jv=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static zv=null;static Zv=null;static qv=null;static Jv=null;static $v=null;static Qv=null;static tb=null;static ib=null;static eb=null;static sb=null;static nb=null;static rb=null;static axis=null;static hb=new l.fe(4096,!1);static ob=new l.fe(4096,!1);static lb=new Int32Array(4096);static ab=new Int32Array(4096);static cb=new Int32Array(4096);static fb=new Int32Array(4096);static ub=new Int32Array(4096);static wb=new Int32Array(4096);static yb=new Int32Array(1500);static pb=new l.Xr(1500,512);static Ab=new Int32Array(12);static mb=new l.Xr(12,2e3);static gb=new Int32Array(2e3);static Ib=new Int32Array(2e3);static _b=new Int32Array(12);static Cb=new Int32Array(10);static Eb=new Int32Array(10);static vb=new Int32Array(10);static Ir=0;static bb=0;static _r=0;static Tb=!1;static Hl=0;static Vl=0;static Ob=0;static Rb=new Int32Array(1e3);static Sb=!1;static yu(t){try{f.head=new s.A(t.read('ob_head.dat')),f.zv=new s.A(t.read('ob_face1.dat')),f.Zv=new s.A(t.read('ob_face2.dat')),f.qv=new s.A(t.read('ob_face3.dat')),f.Jv=new s.A(t.read('ob_face4.dat')),f.$v=new s.A(t.read('ob_face5.dat')),f.Qv=new s.A(t.read('ob_point1.dat')),f.tb=new s.A(t.read('ob_point2.dat')),f.ib=new s.A(t.read('ob_point3.dat')),f.eb=new s.A(t.read('ob_point4.dat')),f.sb=new s.A(t.read('ob_point5.dat')),f.nb=new s.A(t.read('ob_vertex1.dat')),f.rb=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.mf=0,f.Qv.mf=0,f.tb.mf=0,f.ib.mf=0,f.eb.mf=0,f.nb.mf=0,f.rb.mf=0;const i=f.head.pu;f.metadata=new l.fe(i+100,null);let e=0,n=0,r=0,h=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Nd=(t,i,e)=>{const s=t.Fd,n=t.bg,r=t.Dv;let h,o,a,u,d;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.Fd,r=t.bg,h=t.Dv;let o,l,a,c,u;if(s)o=t.Bd,l=t.Ud,a=t.Pd;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let i=0;i{const e=t.Fd,s=t.bg,n=t.Dv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.Bd[i],a=t.Ud[i],c=t.Pd[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.zv&&f.Zv&&f.qv&&f.Jv&&f.$v&&f.Qv&&f.tb&&f.ib&&f.eb&&f.sb&&f.nb&&f.rb&&f.axis))throw new Error('cant loading model!!!!!');const e=i.Fd,s=i.bg,n=i.Dv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),l=new Int32Array(s),a=new Int32Array(s),c=new Int32Array(s),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;i.Uv>=0&&(y=new Int32Array(e));let p=null;i.Hv>=0&&(p=new Int32Array(s));let A=null,m=0;i.Vv>=0?A=new Int32Array(s):m=-i.Vv-1;let g=null;i.Kv>=0&&(g=new Int32Array(s));let I=null;i.Xv>=0&&(I=new Int32Array(s));const _=new Int32Array(s);f.Qv.mf=i.Nv,f.tb.mf=i.Fv,f.ib.mf=i.Bv,f.eb.mf=i.Pv,f.sb.mf=i.Uv;let C,E,v,b=0,T=0,O=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const e=f.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const n=e.Fd,r=e.bg,h=e.Dv,o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n),c=new Int32Array(r),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(h),y=new Int32Array(h),p=new Int32Array(h);let A=null;e.Uv>=0&&(A=new Int32Array(n));let m=null;e.Hv>=0&&(m=new Int32Array(r));let g=null,I=0;e.Vv>=0?g=new Int32Array(r):I=-e.Vv-1;let _=null;e.Kv>=0&&(_=new Int32Array(r));let C=null;e.Xv>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(e.data);v.mf=e.Nv;const b=new s.A(e.data);b.mf=e.Fv;const T=new s.A(e.data);T.mf=e.Bv;const O=new s.A(e.data);O.mf=e.Pv;const R=new s.A(e.data);R.mf=e.Uv;let S,L,x,M=0,k=0,D=0;for(let t=0;tthis.jd&&(this.jd=-e),e>this.gg&&(this.gg=e);const n=i*i+s*s;n>this.IA&&(this.IA=n)}this.IA=Math.sqrt(this.IA)+.99|0,this.Gb=Math.sqrt(this.IA*this.IA+this.jd*this.jd)+.99|0,this.Wb=this.Gb+(Math.sqrt(this.IA*this.IA+this.gg*this.gg)+.99|0)}Wd(){this.jd=0,this.gg=0;for(let t=0;tthis.jd&&(this.jd=-i),i>this.gg&&(this.gg=i)}this.Gb=Math.sqrt(this.IA*this.IA+this.jd*this.jd)+.99|0,this.Wb=this.Gb+(Math.sqrt(this.IA*this.IA+this.gg*this.gg)+.99|0)}Ga(){if(this.Yb){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Vd=new l.fe(i+1,null);for(let e=0;e<=i;e++)this.Vd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Hd=new l.fe(i+1,null);for(let e=0;e<=i;e++)this.Hd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;el;)l=e[o++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==l||0===r.types[i])&&this.jb(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}f.Ir=0,f.bb=0,f._r=0,o=0,l=e[o++];for(let t=0;tl;)l=e[o++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===l||0===r.types[i])&&this.jb(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.Ya(t)}Ya(t){if(!this.Vd||-1===t||!h.A.Do[t])return;const i=h.A.Do[t],e=i.NE;f.Ir=0,f.bb=0,f._r=0;for(let t=0;t>16;this.Pd[t]=this.Ud[t]*i+this.Pd[t]*e>>16,this.Ud[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.Mb&&this.kb&&this.Db||(this.Mb=new Int32Array(this.bg),this.kb=new Int32Array(this.bg),this.Db=new Int32Array(this.bg)),!this.fg){this.fg=new l.fe(this.Fd,null);for(let t=0;t8192||A>8192||m>8192||p<-8192||A<-8192||m<-8192;)p>>=1,A>>=1,m>>=1;let g=0|Math.sqrt(p*p+A*A+m*m);if(g<=0&&(g=1),p=256*p/g|0,A=256*A/g|0,m=256*m/g|0,this.vg&&1&this.vg[i]){const r=t+((e*p+s*A+n*m)/(h+(h/2|0))|0);this.Mu&&(this.Mb[i]=f.xb(this.Mu[i],r,this.vg[i]))}else{let t=this.fg[r];t&&(t.x+=p,t.y+=A,t.z+=m,t.w++),t=this.fg[o],t&&(t.x+=p,t.y+=A,t.z+=m,t.w++),t=this.fg[l],t&&(t.x+=p,t.y+=A,t.z+=m,t.w++)}}if(r)this.wg(t,h,e,s,n);else{this.mg=new l.fe(this.Fd,null);for(let t=0;t>16;for(let s=0;s>16,I=I*w-g*d>>16,g=m),0!==t&&(m=I*a-_*l>>16,_=I*l+_*a>>16,I=m),0!==i&&(m=_*c+g*u>>16,_=_*u-g*c>>16,g=m),g+=n,I+=h,_+=o,m=I*p-_*y>>16,_=I*y+_*p>>16,I=m,f.lb&&f.ab&&f.cb&&(f.cb[s]=_-A,f.lb[s]=r.A.ya+((g<<9)/_|0),f.ab[s]=r.A.pa+((I<<9)/_|0)),this.Dv>0&&f.fb&&f.ub&&f.wb&&(f.fb[s]=g,f.ub[s]=I,f.wb[s]=_)}try{this.qb(!1,!1,0)}catch(t){}}draw(t,i,e,s,h,o,l,a,c){const u=a*h-o*s>>16,d=l*i+u*e>>16,w=this.IA*e>>16,y=d+w;if(y<=50||d>=3500)return;const p=a*s+o*h>>16;let A=p-this.IA<<9;if((A/y|0)>=n.A.ev)return;let m=p+this.IA<<9;if((m/y|0)<=-n.A.ev)return;const g=l*e-u*i>>16,I=this.IA*i>>16;let _=g+I<<9;if((_/y|0)<=-n.A.sv)return;let C=g-(I+(this.jd*e>>16))<<9;if((C/y|0)>=n.A.sv)return;let E=d-(w+(this.jd*i>>16))<=50,v=!1;if(c>0&&f.Tb){let t=d-w;t<=50&&(t=50),p>0?(A=A/y|0,m=m/t|0):(m=m/y|0,A=A/t|0),g>0?(C=C/y|0,_=_/t|0):(_=_/y|0,C=C/t|0);const i=f.Hl-r.A.ya,e=f.Vl-r.A.pa;i>A&&iC&&e<_&&(this.ow?f.Rb[f.Ob++]=c:v=!0)}const b=r.A.ya,T=r.A.pa;let O=0,R=0;0!==t&&(O=r.A.sin[t],R=r.A.cos[t]);for(let n=0;n>16,w=w*R-c*O>>16,c=r),c+=o,u+=l,w+=a,r=w*s+c*h>>16,w=w*h-c*s>>16,c=r,r=u*e-w*i>>16,w=u*i+w*e>>16,u=r,f.cb&&(f.cb[n]=w-d),w>=50&&f.lb&&f.ab?(f.lb[n]=b+((c<<9)/w|0),f.ab[n]=T+((u<<9)/w|0)):f.lb&&(f.lb[n]=-5e3,E=!0),(E||this.Dv>0)&&f.fb&&f.ub&&f.wb&&(f.fb[n]=c,f.ub[n]=u,f.wb[n]=w)}try{this.qb(E,v,c)}catch(t){}}qb(t,i,e,s=!1){f.Sb&&(this.Kb=-1,this.Xb=-1);for(let t=0;tn.A.fI||a>n.A.fI||c>n.A.fI),f.pb&&f.yb){const t=((y+p+A)/3|0)+this.Gb;f.pb[t][f.yb[t]++]=s,f.Sb&&this.Jb(f.Hl,f.Vl,u,d,w,l,a,c)&&this.Xb=0;t--){const i=f.yb[t];if(!(i<=0)&&f.pb){const e=f.pb[t];for(let t=0;t=0;t--){const i=f.yb[t];if(i>0&&f.pb){const e=f.pb[t];for(let s=0;s0||f.Ab[2]>0)&&(r=(f._b[1]+f._b[2])/(f.Ab[1]+f.Ab[2])|0);let h=0;f.Ab&&f._b&&(f.Ab[3]>0||f.Ab[4]>0)&&(h=(f._b[3]+f._b[4])/(f.Ab[3]+f.Ab[4])|0);let o=0;if(f.Ab&&f._b&&(f.Ab[6]>0||f.Ab[8]>0)&&(o=(f._b[6]+f._b[8])/(f.Ab[6]+f.Ab[8])|0),f.Ab&&f.mb){let t,i=0,e=f.Ab[10],n=f.mb[10],l=f.gb;i===e&&(i=0,e=f.Ab[11],n=f.mb[11],l=f.Ib),t=ir;)try{this.$b(n[i++],s),i===e&&n!==f.mb[11]&&(i=0,e=f.Ab[11],n=f.mb[11],l=f.Ib),t=ih;)try{this.$b(n[i++],s),i===e&&n!==f.mb[11]&&(i=0,e=f.Ab[11],n=f.mb[11],l=f.Ib),t=io;)try{this.$b(n[i++],s),i===e&&n!==f.mb[11]&&(i=0,e=f.Ab[11],n=f.mb[11],l=f.Ib),t=i>2,h=this.Bb[i],o=this.Pb[i],l=this.Ub[i];r.A.gI(f.lb[e],f.lb[s],f.lb[n],f.ab[e],f.ab[s],f.ab[n],this.Mb[t],this.kb[t],this.Db[t],f.fb[h],f.ub[h],f.wb[h],f.fb[o],f.fb[l],f.ub[o],f.ub[l],f.wb[o],f.wb[l],this.Mu[t])}else if(3===h&&this.vg&&this.Mu&&this.Mb&&f.lb&&f.ab&&f.fb&&f.ub&&f.wb){const i=this.vg[t]>>2,h=this.Bb[i],o=this.Pb[i],l=this.Ub[i];r.A.gI(f.lb[e],f.lb[s],f.lb[n],f.ab[e],f.ab[s],f.ab[n],this.Mb[t],this.Mb[t],this.Mb[t],f.fb[h],f.ub[h],f.wb[h],f.fb[o],f.fb[l],f.ub[o],f.ub[l],f.wb[o],f.wb[l],this.Mu[t])}}Qb(t,i=!1){let e=0;if(f.wb){const i=r.A.ya,s=r.A.pa,n=this.Tg[t],h=this.Og[t],o=this.Rg[t],l=f.wb[n],a=f.wb[h],c=f.wb[o];if(l>=50&&f.lb&&f.ab&&this.Mb)f.Cb[e]=f.lb[n],f.Eb[e]=f.ab[n],f.vb[e++]=this.Mb[t];else if(f.fb&&f.ub&&this.Mb){const u=f.fb[n],d=f.ub[n],w=this.Mb[t];if(c>=50&&this.Db){const n=(50-l)*r.A.cv[c-l];f.Cb[e]=i+((u+((f.fb[o]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[o]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.Db[t]-w)*n>>16)}if(a>=50&&this.kb){const n=(50-l)*r.A.cv[a-l];f.Cb[e]=i+((u+((f.fb[h]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[h]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.kb[t]-w)*n>>16)}}if(a>=50&&f.lb&&f.ab&&this.kb)f.Cb[e]=f.lb[h],f.Eb[e]=f.ab[h],f.vb[e++]=this.kb[t];else if(f.fb&&f.ub&&this.kb){const u=f.fb[h],d=f.ub[h],w=this.kb[t];if(l>=50&&this.Mb){const h=(50-a)*r.A.cv[l-a];f.Cb[e]=i+((u+((f.fb[n]-u)*h>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[n]-d)*h>>16)<<9)/50|0),f.vb[e++]=w+((this.Mb[t]-w)*h>>16)}if(c>=50&&this.Db){const n=(50-a)*r.A.cv[c-a];f.Cb[e]=i+((u+((f.fb[o]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[o]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.Db[t]-w)*n>>16)}}if(c>=50&&f.lb&&f.ab&&this.Db)f.Cb[e]=f.lb[o],f.Eb[e]=f.ab[o],f.vb[e++]=this.Db[t];else if(f.fb&&f.ub&&this.Db){const u=f.fb[o],d=f.ub[o],w=this.Db[t];if(a>=50&&this.kb){const n=(50-c)*r.A.cv[a-c];f.Cb[e]=i+((u+((f.fb[h]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[h]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.kb[t]-w)*n>>16)}if(l>=50&&this.Mb){const h=(50-c)*r.A.cv[l-c];f.Cb[e]=i+((u+((f.fb[n]-u)*h>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[n]-d)*h>>16)<<9)/50|0),f.vb[e++]=w+((this.Mb[t]-w)*h>>16)}}}const s=f.Cb[0],h=f.Cb[1],o=f.Cb[2],l=f.Eb[0],a=f.Eb[1],c=f.Eb[2];if(!((s-h)*(c-a)-(l-a)*(o-h)<=0))if(r.A.cI=!1,3===e){let e;if((s<0||h<0||o<0||s>n.A.fI||h>n.A.fI||o>n.A.fI)&&(r.A.cI=!0),e=this.vg?3&this.vg[t]:0,i)r.A.rv(s,h,l,a,f.vb[0]),r.A.rv(h,o,a,c,f.vb[1]),r.A.rv(o,s,c,l,f.vb[2]);else if(0===e)r.A.yI(s,h,o,l,a,c,f.vb[0],f.vb[1],f.vb[2]);else if(1===e&&this.Mb)r.A.Lv(s,h,o,l,a,c,r.A.palette[this.Mb[t]]);else if(2===e&&this.vg&&this.Mu&&f.fb&&f.ub&&f.wb){const i=this.vg[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.gI(s,h,o,l,a,c,f.vb[0],f.vb[1],f.vb[2],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t])}else if(3===e&&this.vg&&this.Mu&&this.Mb&&f.fb&&f.ub&&f.wb){const i=this.vg[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.gI(s,h,o,l,a,c,this.Mb[t],this.Mb[t],this.Mb[t],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t])}}else if(4===e){let e;if((s<0||h<0||o<0||s>n.A.fI||h>n.A.fI||o>n.A.fI||f.Cb[3]<0||f.Cb[3]>n.A.fI)&&(r.A.cI=!0),e=this.vg?3&this.vg[t]:0,i)r.A.rv(s,h,l,a,f.vb[0]),r.A.rv(h,o,a,c,f.vb[1]),r.A.rv(o,f.Cb[3],c,f.Eb[3],f.vb[2]),r.A.rv(f.Cb[3],s,f.Eb[3],l,f.vb[3]);else if(0===e)r.A.yI(s,h,o,l,a,c,f.vb[0],f.vb[1],f.vb[2]),r.A.yI(s,o,f.Cb[3],l,c,f.Eb[3],f.vb[0],f.vb[2],f.vb[3]);else if(1===e){if(this.Mb){const i=r.A.palette[this.Mb[t]];r.A.Lv(s,h,o,l,a,c,i),r.A.Lv(s,o,f.Cb[3],l,c,f.Eb[3],i)}}else if(2===e&&this.vg&&this.Mu&&f.fb&&f.ub&&f.wb){const i=this.vg[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.gI(s,h,o,l,a,c,f.vb[0],f.vb[1],f.vb[2],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t]),r.A.gI(s,o,f.Cb[3],l,c,f.Eb[3],f.vb[0],f.vb[2],f.vb[3],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t])}else if(3===e&&this.vg&&this.Mu&&this.Mb&&f.fb&&f.ub&&f.wb){const i=this.vg[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.gI(s,h,o,l,a,c,this.Mb[t],this.Mb[t],this.Mb[t],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t]),r.A.gI(s,o,f.Cb[3],l,c,f.Eb[3],this.Mb[t],this.Mb[t],this.Mb[t],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t])}}}jb(t,i,e,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f.Ir=0,f.bb=0,f._r=0;for(let t=0;t0?(f.Ir=(f.Ir/n|0)+t,f.bb=(f.bb/n|0)+i,f._r=(f._r/n|0)+e):(f.Ir=t,f.bb=i,f._r=e)}else if(1===n)for(let n=0;n=this.Vd.length)continue;const h=this.Vd[r];if(h)for(let s=0;s=this.Vd.length)continue;const o=this.Vd[h];if(o)for(let s=0;s>16;this.Ud[n]=this.Ud[n]*u-this.Bd[n]*c>>16,this.Bd[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.Ud[n]*u-this.Pd[n]*c>>16;this.Pd[n]=this.Ud[n]*c+this.Pd[n]*u>>16,this.Ud[n]=t}if(0!==l){c=r.A.sin[l],u=r.A.cos[l];const t=this.Pd[n]*c+this.Bd[n]*u>>16;this.Pd[n]=this.Pd[n]*u-this.Bd[n]*c>>16,this.Bd[n]=t}this.Bd[n]+=f.Ir,this.Ud[n]+=f.bb,this.Pd[n]+=f._r}}else if(3===n)for(let n=0;n=this.Vd.length)continue;const h=this.Vd[r];if(h)for(let s=0;s=this.Hd.length)continue;const n=this.Hd[e];if(n)for(let i=0;i255&&(this.Fb[e]=255)}}}Zb(){this.jd=0,this.IA=0,this.gg=0,this.Ig=999999,this._g=-999999,this.Eg=-99999,this.Cg=99999;for(let t=0;tthis._g&&(this._g=i),sthis.Eg&&(this.Eg=s),-e>this.jd&&(this.jd=-e),e>this.gg&&(this.gg=e);const n=i*i+s*s;n>this.IA&&(this.IA=n)}this.IA=0|Math.sqrt(this.IA),this.Gb=0|Math.sqrt(this.IA*this.IA+this.jd*this.jd),this.Wb=this.Gb+(0|Math.sqrt(this.IA*this.IA+this.gg*this.gg))}Jb(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{e.d(i,{A:()=>o});var s=e(8950),n=e(1069),r=e(4474),h=e(880);class o extends r.A{mw;width;height;iT;eT;Xl;dw;constructor(t,i){super(),this.mw=new Int32Array(t*i),this.width=this.Xl=t,this.height=this.dw=i,this.iT=this.eT=0}static sT=async(t,i)=>{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(0,h.r)(e),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),l=n.mw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static xu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.mf=s.pu;const h=r.pu,l=r.pu,a=[],c=r.mu-1;for(let t=0;ts.length||r.mf>r.length)throw new Error;const f=r.mu,u=r.mu,d=r.pu,w=r.pu,y=new o(d,w);y.iT=f,y.eT=u,y.Xl=h,y.dw=l;const p=r.mu;if(0===p){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.nT(h,r,this.mw,n,l,s.A.mw,e,o)}Kl(t,i,e){i|=0,e|=0;let n=(i+=this.iT)+(e+=this.eT)*s.A.gw,r=0,h=this.height,o=this.width,l=s.A.gw-o,a=0;if(es.A.bottom&&(h-=e+h-s.A.bottom),is.A.right){const t=i+o-s.A.right;o-=t,a+=t,l+=t}o>0&&h>0&&this.rT(o,h,this.mw,r,a,s.A.mw,n,l,t)}hT(t,i){t|=0,i|=0;let e=(t+=this.iT)+(i+=this.eT)*s.A.gw,n=0,r=this.height,h=this.width,o=s.A.gw-h,l=0;if(is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.oT(h,r,this.mw,n,l,s.A.mw,e,o)}lT(){const t=this.mw,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.mw[s]=(r<<16)+(h<<8)+o}}}xw(t,i,e,n){t|=0,i|=0,e|=0,n|=0;try{const r=this.width;let h=0,o=0;const l=this.Xl,a=this.dw,c=(l<<16)/e|0,f=(a<<16)/n|0;t+=(this.iT*e+l-1)/l|0,i+=(this.eT*n+a-1)/a|0,this.iT*e%l!=0&&(h=(l-this.iT*e%l<<16)/e|0),this.eT*n%a!=0&&(o=(a-this.eT*n%a<<16)/n|0),e=e*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u=t+i*s.A.gw,d=s.A.gw-e;if(is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right){const i=t+e-s.A.right;e-=i,d+=i}this.scale(e,n,this.mw,h,o,s.A.mw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}cT(t,i,e,n,r,h,o,l,a,c){t|=0,i|=0,e|=0,n|=0;try{const f=-e/2|0,u=-n/2|0,d=65536*Math.sin(a/326.11)|0,w=65536*Math.cos(a/326.11)|0,y=d*c>>8,p=w*c>>8;let A=(o<<16)+u*y+f*p,m=u*p-f*y+(l<<16),g=t+i*s.A.gw;for(let t=0;t>16)+(o>>16)*this.width],n+=p,o-=y;A+=y,m+=p,g+=s.A.gw}}catch(t){}}fT(t,i,e){t|=0,i|=0;let n=(t+=this.iT)+(i+=this.eT)*s.A.gw,r=0,h=this.height,o=this.width,l=s.A.gw-o,a=0;if(is.A.bottom&&(h-=i+h-s.A.bottom),ts.A.right){const i=t+o-s.A.right;o-=i,a+=i,l+=i}o>0&&h>0&&this.uT(o,h,this.mw,a,r,s.A.mw,n,l,e.mw)}scale(t,i,e,s,n,r,h,o,l,a,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*l;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=a}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}oT(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}rT(t,i,e,s,n,r,h,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}h+=o,s+=n}}nT(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}uT(t,i,e,s,n,r,h,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++}h+=o,n+=s}}}},1673:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1069),r=e(4474);class h extends r.A{mw;width;height;iT;eT;Xl;dw;palette;constructor(t,i,e){super(),this.mw=new Int8Array(t*i),this.width=this.Xl=t,this.height=this.dw=i,this.iT=this.eT=0,this.palette=e}static xu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.mf=s.pu;const o=r.pu,l=r.pu,a=r.mu,c=new Int32Array(a);for(let t=1;ts.length||r.mf>r.length)throw new Error;const f=r.mu,u=r.mu,d=r.pu,w=r.pu,y=new h(d,w,c);y.iT=f,y.eT=u,y.Xl=o,y.dw=l;const p=y.mw,A=r.mu;if(0===A){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.dT(h,r,this.mw,n,l,s.A.mw,e,o)}lT(){const t=this.mw,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}vv(){this.Xl|=0,this.dw|=0,this.Xl/=2,this.dw/=2,this.Xl|=0,this.dw|=0;const t=new Int8Array(this.Xl*this.dw);let i=0;for(let e=0;e>1)+(e+this.eT>>1)*this.Xl]=this.mw[i++];this.mw=t,this.width=this.Xl,this.height=this.dw,this.iT=0,this.eT=0}xw(){if(this.width===this.Xl&&this.height===this.dw)return;const t=new Int8Array(this.Xl*this.dw);let i=0;for(let e=0;e>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,n){try{const r=this.width;this.height;let h=0,o=0;const l=this.Xl,a=this.dw,c=(l<<16)/e|0,f=(a<<16)/n|0;t=t+(this.iT*e+l-1)/l|0,i=i+(this.eT*n+a-1)/a|0,this.iT*e%l!=0&&(h=(l-this.iT*e%l<<16)/e|0),this.eT*n%a!=0&&(o=(a-this.eT*n%a<<16)/n|0),e=e*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u,d=t+i*s.A.gw,w=s.A.gw-e;is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right&&(u=t+e-s.A.right,e-=u,w+=u),this.wT(s.A.mw,this.mw,this.palette,h,o,d,w,e,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}wT(t,i,e,s,n,r,h,o,l,a,c,f){try{const u=s;for(let d=-l;d<0;d++){const l=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+l];0==n?r++:t[r++]=e[255&n],s+=a}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,e)=>{e.d(i,{A:()=>l});var s=e(8950),n=e(1069),r=e(4474);class h{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}yT(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}pT(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=e(9298);class l extends r.A{static AT='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static mT=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let e=l.AT.indexOf(String.fromCharCode(i));t&&e>=63&&e--,-1===e&&(e=74),l.mT[i]=e}}gT=[];IT=new Int32Array(94);_T=new Int32Array(94);CT=new Int32Array(94);ET=new Int32Array(94);vT=new Int32Array(95);bT=new Int32Array(256);random=new h(BigInt(Date.now()));height=0;static xu=(t,i)=>{const e=new n.A(t.read(i+'.dat')),s=new n.A(t.read('index.dat'));s.mf=e.pu+4;const r=s.mu;r>0&&(s.mf+=3*(r-1));const h=new l;for(let t=0;t<94;t++){h.CT[t]=s.mu,h.ET[t]=s.mu;const i=h.IT[t]=s.pu,n=h._T[t]=s.pu,r=s.mu,o=i*n;if(h.gT[t]=new Int8Array(o),0===r)for(let s=0;sh.height&&(h.height=n),h.CT[t]=1,h.vT[t]=i+2;{let e=0;for(let s=n/7|0;s=s.A.bottom&&(r-=e+r+1-s.A.bottom),i=s.A.right){const t=i+n+1-s.A.right;n-=t,a+=t,l+=t}n>0&&r>0&&this.DT(n,r,t,c,a,s.A.mw,o,l,h)}xT(t,i,e,n,r,h,o){e|=0,n|=0;let l=(t|=0)+(i|=0)*s.A.gw,a=s.A.gw-e,c=0,f=0;if(i=s.A.bottom&&(n-=i+n+1-s.A.bottom),t=s.A.right){const i=t+e+1-s.A.right;e-=i,c+=i,a+=i}e>0&&n>0&&this.NT(e,n,s.A.mw,l,a,o,f,c,r,h)}DT(t,i,e,s,n,r,h,o,l){const a=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=a;t<0;t++)0===e[s++]?h++:r[h++]=l,0===e[s++]?h++:r[h++]=l,0===e[s++]?h++:r[h++]=l,0===e[s++]?h++:r[h++]=l;for(let i=t;i<0;i++)0===e[s++]?h++:r[h++]=l;h+=o,s+=n}}NT(t,i,e,s,n,r,h,o,l,a){t|=0;const c=((16711935&l)*a&4278255360)+((65280&l)*a&16711680)>>8,f=256-a;for(let l=-(i|=0);l<0;l++){for(let i=-t;i<0;i++)if(0===r[h++])s++;else{const t=e[s];e[s++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}s+=n,h+=o}}OT(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.ql:'cya'===t?o.A.GE:'mag'===t?o.A.fA:'whi'===t?o.A.Ll:'bla'===t?o.A.Zl:'lre'===t?o.A.YE:'dre'===t?o.A.HE:'dbl'===t?o.A.VE:'or1'===t?o.A.KE:'or2'===t?o.A.XE:'or3'===t?o.A.jE:'gr1'===t?o.A.zE:'gr2'===t?o.A.ZE:'gr3'===t?o.A.qE:o.A.Zl}split(t,i){if(0===t.length)return[t];const e=[];for(;t.length>0;){if(this.RT(t)<=i&&-1===t.indexOf('|')){e.push(t);break}let s=t.length;for(let e=0;ei)break;s=e}else if('|'===t[e]){s=e;break}e.push(t.substring(0,s)),t=t.substring(s+1)}return e}}},1183:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(8950),n=e(7854);class r{FT;width;height;BT;PT;mw;constructor(t,i,e=n.nl){this.BT=e,this.FT=this.BT.getImageData(0,0,t,i),this.PT=new Uint32Array(this.FT.data.buffer),this.mw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.mw.fill(0)}bind(){s.A.bind(this.mw,this.width,this.height)}draw(t,i){this.#t(),this.BT.putImageData(this.FT,t,i)}#t(){const t=this.mw.length,i=this.mw,e=this.PT;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,i,e)=>{e.d(i,{A:()=>s});class s{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));zo=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Qo=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};UT=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}},2901:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(1908);class r{static UT=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.GT)return null;if(this.XT[t])return this.XT[t];const i=this.KT[t],e=i+this.VT[t];if(this.WT){const s=Uint8Array.from(this.buffer.subarray(i,i+e));return this.XT[t]=s,s}{const i=Uint8Array.from(n.A.read(this.HT[t],this.buffer,this.VT[t],this.KT[t]));return this.XT[t]=i,i}}}},1069:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(9234),n=e(6666),r=e(4474);class h extends r.A{static zT=3988292384;static ZT=new Int32Array(256);static qT=new Uint32Array(33);static JT=new n.A;static $T=new n.A;static QT=new n.A;static tO=0;static iO=0;static eO=0;static{for(let t=0;t<32;t++)h.qT[t]=(1<>>=1:i=i>>>1^h.zT;h.ZT[t]=i}}static Zo=t=>{let i=4294967295;for(let e=0;e>>8^h.ZT[255&(i^t[e])];return~i};view;data;mf=0;sO=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.mf}static Pt=t=>{let i=null;return 0===t&&h.tO>0?(h.tO--,i=h.JT.Xg()):1===t&&h.iO>0?(h.iO--,i=h.$T.Xg()):2===t&&h.eO>0&&(h.eO--,i=h.QT.Xg()),i?(i.mf=0,i):new h(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.mf=0,100===this.view.byteLength&&h.tO<1e3?(h.JT.Gp(this),h.tO++):5e3===this.view.byteLength&&h.iO<250?(h.$T.Gp(this),h.iO++):3e4===this.view.byteLength&&h.eO<50&&(h.QT.Gp(this),h.eO++)}get mu(){return this.view.getUint8(this.mf++)}get Dd(){return this.view.getInt8(this.mf++)}get pu(){const t=this.view.getUint16(this.mf);return this.mf+=2,t}get Iu(){const t=this.view.getInt16(this.mf);return this.mf+=2,t}get qu(){const t=this.view.getUint8(this.mf++)<<16|this.view.getUint16(this.mf);return this.mf+=2,t}get il(){const t=this.view.getInt32(this.mf);return this.mf+=4,t}get hE(){const t=this.view.getBigInt64(this.mf);return this.mf+=8,t}get FE(){return this.view.getUint8(this.mf)<128?this.mu-64:this.pu-49152}get gA(){return this.view.getUint8(this.mf)<128?this.mu:this.pu-32768}get Eu(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.mf++))&&this.mf>16),this.view.setUint16(this.mf,t),this.mf+=2}p4(t){this.view.setInt32(this.mf,t),this.mf+=4}oO(t){this.view.setInt32(this.mf,t,!0),this.mf+=4}lO(t){this.view.setBigInt64(this.mf,t),this.mf+=8}aO(t){const i=this.view,e=t.length;for(let s=0;s>>3}wO(t){let i=this.sO>>>3,e=8-(7&this.sO),s=0;for(this.sO+=t;t>e;e=8)s+=(this.view.getUint8(i++)&h.qT[e])<>>e-t&h.qT[t],s}yO(t,i){const e=this.mf;this.mf=0;const n=new Uint8Array(e);this.nO(e,0,n);const r=(0,s.pO)(n),h=(0,s.AO)(r,i,t),o=(0,s.mO)(h);this.mf=0,this.p1(o.length),this.cO(o,o.length,0)}}},5226:(t,i,e)=>{e.d(i,{Q:()=>n,x:()=>s});class s{gO=new Map;Eo;xo=self.isSecureContext?self.crypto.randomUUID():'0';constructor(t){this.Eo=t}async Ko(){const t=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),i=t.createDataChannel('channel'),e=crypto.randomUUID();this.gO.set(e,i),await t.setLocalDescription(await t.createOffer()),t.onicegatheringstatechange=async()=>{if('complete'===t.iceGatheringState){let i;self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(t.localDescription)):console.log(JSON.stringify(t.localDescription));try{for(;null===(i=prompt('Offer copied to clipboard, paste answer here')););t.setRemoteDescription(new RTCSessionDescription(JSON.parse(i)))}catch(t){console.error(t)}}},i.onopen=()=>{i.send(JSON.stringify({type:'id',id:e})),console.log('Connected to peer!')},i.onerror=t=>{console.error(t)},i.onmessage=t=>{const i=JSON.parse(t.data);i.data&&(i.data=Object.values(i.data)),this.Eo&&this.Eo.postMessage(i)}}postMessage(t){const i=this.gO.get(t.data.id),e=t.data;e.data&&(e.data=Array.from(t.data.data)),i&&'open'===i.readyState&&i.send(JSON.stringify(e))}}class n{pc;Lo=void 0;xo;constructor(t){this.pc=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),this.pc.ondatachannel=i=>{this.Lo=i.channel,this.Lo.onopen=()=>{console.log('Connected to host!')},this.Lo.onerror=t=>{console.error(t)},this.Lo.onmessage=i=>{if(!this.xo){const t=JSON.parse(i.data);if('id'===t.type)return void(this.xo=t.id)}t.onmessage&&t.onmessage(i)}},this.pc.onicegatheringstatechange=async()=>{'complete'===this.pc.iceGatheringState&&(self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(this.pc.localDescription)):console.log(JSON.stringify(this.pc.localDescription)))}}async Xo(t){await this.pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(t))),await this.pc.setLocalDescription(await this.pc.createAnswer())}}},3867:(t,i,e)=>{e.d(i,{rA:()=>a,nA:()=>o,fe:()=>s,OA:()=>n,Eh:()=>r,EA:()=>h,Xr:()=>l});class s extends Array{constructor(t,i){super(t);for(let e=0;e{e.d(i,{mO:()=>o,Jo:()=>n,pO:()=>h,$o:()=>s,ec:()=>r,AO:()=>l});const s=async t=>new Promise((i=>setTimeout(i,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),r=async t=>(await fetch(t)).text();function h(t){let i=0n;for(let e=0;e0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function l(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}},9073:(t,i,e)=>{e.a(t,(async(t,i)=>{try{var s=e(1908),n=e(2901),r=e(9234),h=e(1069),o=e(7604),l=e(7046),a=e(3867),c=e(1673),f=e(2511),u=e(2682),d=e(8950),w=e(4544),y=e(1651);class t extends l.A{static IO=!1;static _O=!0;db=null;CO=3200;EO=3200;sizeX=1280;sizeZ=1344;vO=2240;bO=2752;TO=1e3;OO=0;RO=[];SO=[];LO=[];xO=[];MO=[0];kO=[0];DO=[];NO=[];FO=[];BO=[];PO=[];UO=[];WO=[];GO=[];we=[];ye=[];Ie=null;_e=null;Ce=null;Ee=null;YO=null;HO=[];VO=!0;KO=0;XO=-1;jO=-1;zO=-1;ZO=-1;qO=!1;JO=['General Store','Sword Shop','Magic Shop','Axe Shop','Helmet Shop','Bank','Quest Start','Amulet Shop','Mining Site','Furnace','Anvil','Combat Training','Dungeon','Staff Shop','Platebody Shop','Platelegs Shop','Scimitar Shop','Archery Shop','Shield Shop','Altar','Herbalist','Jewelery','Gem Shop','Crafting Shop','Candle Shop','Fishing Shop','Fishing Spot','Clothes Shop','Apothecary','Silk Trader','Kebab Seller','Pub/Bar','Mace Shop','Tannery','Rare Trees','Spinning Wheel','Food Shop','Cookery Shop','???','Water Source','Cooking Range','Skirt Shop','Potters Wheel','Windmill','Mining Shop','Chainmail Shop','Silver Shop','Fur Trader','Spice Shop'];$O=5;QO=13;tR=140;iR=470;eR=!1;sR=0;nR=0;rR=-1;hR=0;oR=0;lR=0;aR=new Int32Array(2e3);cR=new Int32Array(2e3);fR=new Int32Array(2e3);Un=new Int32Array(2e3);Wn=new Int32Array(2e3);Pe=new Int32Array(2e3);Pn=0;uR=null;dR=200;wR=this.dR*this.sizeX/this.sizeZ|0;yR=635-this.wR-5;pR=503-this.dR-20;AR=!1;mR=8943445;gR=7824964;IR=6706483;_R=11141120;CR=10027008;ER=8912896;zoom=4;vR=4;offsetX=this.CO-this.vO;Hy=this.bO+this.sizeZ-this.EO;load=async()=>{await s.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new w.A(await w.A.openDatabase());const t=await this.bR();await this.qo(100,'Please wait... Rendering Map');const i=new h.A(t.read('labels.dat'));this.OO=i.pu;for(let t=0;t{if(this.VO){this.VO=!1,this.KO=0,d.A.clear();const t=this.offsetX-(635/this.zoom|0),i=this.Hy-(503/this.zoom|0),e=this.offsetX+(635/this.zoom|0),s=this.Hy+(503/this.zoom|0);if(this.kR(t,i,e,s,0,0,635,503),this.AR&&(this.uR?.hT(this.yR,this.pR),d.A.hv(this.yR+this.wR*t/this.sizeX|0,this.pR+this.dR*i/this.sizeZ|0,(e-t)*this.wR/this.sizeX|0,(s-i)*this.dR/this.sizeZ|0,16711680,128),d.A.Sl(this.yR+this.wR*t/this.sizeX|0,this.pR+this.dR*i/this.sizeZ|0,(e-t)*this.wR/this.sizeX|0,(s-i)*this.dR/this.sizeZ|0,16711680),this.lR>0&&this.lR%10<5))for(let t=0;t0&&this.lR%10<5&&this.oR==i+this.nR&&(e=16776960),this.YO?.jl(this.$O+20,t+13,this.JO[i+this.nR],e)}t+=17}}this.jl(this.yR,this.pR+this.dR,this.wR,18,this.mR,this.gR,this.IR,'Overview'),this.jl(this.$O,this.QO+this.iR,this.tR,18,this.mR,this.gR,this.IR,'Key'),3==this.vR?this.jl(170,471,50,30,this._R,this.CR,this.ER,'37%'):this.jl(170,471,50,30,this.mR,this.gR,this.IR,'37%'),4==this.vR?this.jl(230,471,50,30,this._R,this.CR,this.ER,'50%'):this.jl(230,471,50,30,this.mR,this.gR,this.IR,'50%'),6==this.vR?this.jl(290,471,50,30,this._R,this.CR,this.ER,'75%'):this.jl(290,471,50,30,this.mR,this.gR,this.IR,'75%'),8==this.vR?this.jl(350,471,50,30,this._R,this.CR,this.ER,'100%'):this.jl(350,471,50,30,this.mR,this.gR,this.IR,'100%')}this.KO--,this.KO<=0&&(this.Fo?.draw(0,0),this.KO=50)};refresh=async()=>{this.KO=0};update=async()=>{1==this.Cc[1]&&(this.offsetX=this.offsetX-16/this.zoom|0,this.VO=!0),1==this.Cc[2]&&(this.offsetX=this.offsetX+16/this.zoom|0,this.VO=!0),1==this.Cc[3]&&(this.Hy=this.Hy-16/this.zoom|0,this.VO=!0),1==this.Cc[4]&&(this.Hy=this.Hy+16/this.zoom|0,this.VO=!0);let t=1;for(;t>0;)t=this.Wc(),49==t?(this.vR=3,this.VO=!0):50==t?(this.vR=4,this.VO=!0):51==t?(this.vR=6,this.VO=!0):52==t?(this.vR=8,this.VO=!0):107==t||75==t?(this.eR=!this.eR,this.VO=!0):111!=t&&79!=t||(this.AR=!this.AR,this.VO=!0);if(1==this.gc&&(this.XO=this.Ic,this.jO=this._c,this.zO=this.offsetX,this.ZO=this.Hy,this.Ic>170&&this.Ic<220&&this._c>471&&this._c<503?(this.vR=3,this.XO=-1):this.Ic>230&&this.Ic<280&&this._c>471&&this._c<503?(this.vR=4,this.XO=-1):this.Ic>290&&this.Ic<340&&this._c>471&&this._c<503?(this.vR=6,this.XO=-1):this.Ic>350&&this.Ic<400&&this._c>471&&this._c<503?(this.vR=8,this.XO=-1):this.Ic>this.$O&&this._c>this.QO+this.iR&&this.Icthis.yR&&this._c>this.pR+this.dR&&this.Icthis.$O&&this._c>this.QO&&this.Icthis.$O&&this._c>this.QO&&this.Icthis.$O&&this._c>this.QO+this.iR-18&&this.Icthis.$O&&this.Hl=t&&this.Vlthis.yR&&i>this.pR&&tthis.vR&&(this.zoom=this.vR)),this.zoom>this.vR&&(this.VO=!0,this.zoom-=this.zoom/30,this.zoomthis.sR&&(this.VO=!0,this.nR--),this.lR>0&&(this.VO=!0,this.lR--);const i=this.offsetX-(635/this.zoom|0),e=this.Hy-(503/this.zoom|0),s=this.offsetX+(635/this.zoom|0),n=this.Hy+(503/this.zoom|0);i<48&&(this.offsetX=48+(635/this.zoom|0)),e<48&&(this.Hy=48+(503/this.zoom|0)),s>this.sizeX-48&&(this.offsetX=this.sizeX-48-(635/this.zoom|0)),n>this.sizeZ-48&&(this.Hy=this.sizeZ-48-(503/this.zoom|0))};async bR(){let t=await(this.db?.zo('worldmap.dat'));if(t)return new n.A(t);let i=5;for(;!t;){await this.qo(0,'Requesting map');try{console.log(`${y.K.nt}/worldmap.jag`),t=await(0,r.Jo)(`${y.K.nt}/worldmap.jag`)}catch(e){t=void 0;for(let t=i;t>0;t--)await this.qo(0,`Error loading - Will retry in ${t} secs.`),await(0,r.$o)(1e3);i*=2,i>60&&(i=60)}}return await(this.db?.Qo('worldmap.dat',t)),new n.A(t)}jl(t,i,e,s,n,r,h,o){t=Math.trunc(t),i=Math.trunc(i),e=Math.trunc(e),s=Math.trunc(s),d.A.Sl(t,i,e,s,0);const l=t+1,a=i+1,c=e-2,f=s-2;d.A.fillRect(l,a,c,f,r),d.A.yl(l,a,n,c),d.A.dl(l,a,n,f),d.A.yl(l,a+f-1,h,c),d.A.dl(l+c-1,a,h,f),this.YO?.ST(l+c/2+1,a+f/2+1+4,o,0),this.YO?.ST(l+c/2,a+f/2+4,o,16777215)}MR(){for(let t=0;t10&&s>20)-(o>>20),n+=(i>>10&1023)-(o>>10&1023),r+=(1023&i)-(1023&o),r>0&&(this.HO[s][h]=this.DR(t/8533,n/8533,r/8533))}}}}TR(t){for(;t.available>0;){const i=64*t.mu-this.vO,e=64*t.mu-this.bO;if(i>0&&e>0&&i+640;){const i=64*t.mu-this.vO,e=64*t.mu-this.bO;if(i>0&&e>0&&i+640;){const i=64*t.mu-this.vO,e=64*t.mu-this.bO;if(i>0&&e>0&&i+640;){const i=64*t.mu-this.vO,e=64*t.mu-this.bO;if(i>0&&e>0&&i+640;){const i=64*t.mu-this.vO,e=64*t.mu-this.bO;if(i>0&&e>0&&i+641&&l--;let a=t-.3333333333333333;a<0&&a++,s=6*l<1?o+6*(h-o)*l:2*l<1?h:3*l<2?o+(h-o)*(.6666666666666666-l)*6:o,n=6*t<1?o+6*(h-o)*t:2*t<1?h:3*t<2?o+(h-o)*(.6666666666666666-t)*6:o,r=6*a<1?o+6*(h-o)*a:2*a<1?h:3*a<2?o+(h-o)*(.6666666666666666-a)*6:o}return((256*s|0)<<16)+((256*n|0)<<8)+(256*r|0)}kR(i,e,s,n,r,h,o,l){const a=s-i,c=n-e,f=(o-r<<16)/a|0,u=(l-h<<16)/c|0;for(let t=0;t>16,n=f*(t+1)>>16;const o=n-s;if(!(o<=0)){s+=r,n+=r;for(let r=0;r>16,a=u*(r+1)>>16;const c=a-l;if(c<=0)continue;l+=h,a+=h;const f=this.NO[t+i][r+e];if(0===f)d.A.fillRect(s,l,n-s,a-l,this.HO[t+i][r+e]);else{const n=this.FO[t+i][r+e],h=252&n;0==h||o<=1||c<=1?d.A.fillRect(s,l,o,c,f):this.NR(d.A.mw,l*d.A.gw+s,this.HO[t+i][r+e],f,o,c,h>>2,3&n)}}}}if(s-i>o-r)return;let w=0;for(let t=0;t>16,n=f*(t+1)>>16;const o=n-s;if(!(o<=0)){s+=r,n+=r;for(let r=0;r>16,a=u*(r+1)>>16;const c=a-l;if(c<=0)continue;l+=h,a+=h;let f=255&this.BO[t+i][r+e];if(0!=f){let t,i;t=1==o?s:n-1,i=1==c?l:a-1;let e=13421772;if((f>=5&&f<=8||f>=13&&f<=16||f>=21&&f<=24)&&(e=13369344,f-=4),27!=f&&28!=f||(e=13369344,f-=2),1==f)d.A.dl(s,l,e,c);else if(2==f)d.A.yl(s,l,e,o);else if(3==f)d.A.dl(t,l,e,c);else if(4==f)d.A.yl(s,i,e,o);else if(9==f)d.A.dl(s,l,16777215,c),d.A.yl(s,l,e,o);else if(10==f)d.A.dl(t,l,16777215,c),d.A.yl(s,l,e,o);else if(11==f)d.A.dl(t,l,16777215,c),d.A.yl(s,i,e,o);else if(12==f)d.A.dl(s,l,16777215,c),d.A.yl(s,i,e,o);else if(17==f)d.A.yl(s,l,e,1);else if(18==f)d.A.yl(t,l,e,1);else if(19==f)d.A.yl(t,i,e,1);else if(20==f)d.A.yl(s,i,e,1);else if(25==f)for(let t=0;t>16,n=f*(t+1)>>16;if(!(n-s<=0)){s+=r,n+=r;for(let n=0;n>16,o=u*(n+1)>>16;o-r<=0||(r+=h,o+=h,this.WO[t+i][n+e]&&this.Ie?.draw(s,r))}}}for(let t=0;t>16,n=f*(t+1)>>16;if(!(n-s<=0)){s+=r,n+=r;for(let n=0;n>16,o=u*(n+1)>>16;o-r<=0||(r+=h,o+=h,this.GO[t+i][n+e]&&this._e?.draw(s,r))}}}for(let t=0;t0)for(let t=0;t=71&&a<=73?this.YO?.ST((y+u)/2,(p+w)/2,'u_pass',16711680):t>=32&&t<=34&&a>=70&&a<=74&&this.YO?.ST((y+u)/2,(p+w)/2,'u_pass',16776960)}}NR(t,i,e,s,n,r,h,o){const l=d.A.gw-n;if(9==h?(h=1,o=o+1&3):10==h?(h=1,o=o+3&3):11==h&&(h=8,o=o+3&3),1==h){if(0==o)for(let h=0;h=0;h--){for(let r=0;r=h?s:e;i+=l}else if(3==o)for(let h=r-1;h>=0;h--){for(let r=0;r=h?s:e;i+=l}}else if(2==h){if(0==o)for(let h=r-1;h>=0;h--){for(let r=0;r>1?s:e;i+=l}else if(1==o)for(let h=0;h=h<<1?s:e;i+=l}else if(2==o)for(let h=0;h=0;r--)t[i++]=r<=h>>1?s:e;i+=l}else if(3==o)for(let h=r-1;h>=0;h--){for(let r=n-1;r>=0;r--)t[i++]=r>=h<<1?s:e;i+=l}}else if(3==h){if(0==o)for(let h=r-1;h>=0;h--){for(let r=n-1;r>=0;r--)t[i++]=r<=h>>1?s:e;i+=l}else if(1==o)for(let h=r-1;h>=0;h--){for(let r=0;r=h<<1?s:e;i+=l}else if(2==o)for(let h=0;h>1?s:e;i+=l}else if(3==o)for(let h=0;h=0;r--)t[i++]=r>=h<<1?s:e;i+=l}}else if(4==h){if(0==o)for(let h=r-1;h>=0;h--){for(let r=0;r=h>>1?s:e;i+=l}else if(1==o)for(let h=0;h=0;r--)t[i++]=r>=h>>1?s:e;i+=l}else if(3==o)for(let h=r-1;h>=0;h--){for(let r=n-1;r>=0;r--)t[i++]=r<=h<<1?s:e;i+=l}}else if(5==h){if(0==o)for(let h=r-1;h>=0;h--){for(let r=n-1;r>=0;r--)t[i++]=r>=h>>1?s:e;i+=l}else if(1==o)for(let h=r-1;h>=0;h--){for(let r=0;r=h>>1?s:e;i+=l}else if(3==o)for(let h=0;h=0;r--)t[i++]=r<=h<<1?s:e;i+=l}}else if(6==h){if(0==o)for(let h=0;h=n/2?s:e;i+=l}else if(3==o)for(let h=0;h=r/2?s:e;i+=l}}else if(7==h){if(0==o)for(let h=0;h=0;h--){for(let o=0;o=0;h--){for(let o=n-1;o>=0;o--)t[i++]=o<=h-r/2?s:e;i+=l}else if(3==o)for(let h=0;h=0;o--)t[i++]=o<=h-r/2?s:e;i+=l}}else if(8==h)if(0==o)for(let h=0;h=h-r/2?s:e;i+=l}else if(1==o)for(let h=r-1;h>=0;h--){for(let o=0;o=h-r/2?s:e;i+=l}else if(2==o)for(let h=r-1;h>=0;h--){for(let o=n-1;o>=0;o--)t[i++]=o>=h-r/2?s:e;i+=l}else if(3==o)for(let h=0;h=0;o--)t[i++]=o>=h-r/2?s:e;i+=l}}Bo(){return 0}Po(){return!1}Uo(){return!1}Wo(){return-1}Go(){return-1}}await(0,o.w)(),(new t).run().then((()=>{})),window.onkeydown=function(t){return!(' '===t.key&&t.target===document.body)},i()}catch(t){i(t)}}),1)},1908:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(9763);class n{static FR=null;static load=async t=>{this.FR=await(0,s.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,e,s)=>{if(!this.FR)throw new Error('bz2 not found!!');return Int8Array.from(this.FR.read(t,i,e,s))}}},123:(t,i,e)=>{function s(t,i,e){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256,e)}function n(t){window._tinyMidiStop&&window._tinyMidiStop(t)}e.d(i,{el:()=>s,Mo:()=>n})},2604:(t,i,e)=>{function s(t,i){var e;(e=document.createElement('a')).href=t,e.download=i,document.body.appendChild(e),e.style='display: none',e.click(),e.remove()}e.d(i,{A:()=>s})},9763:(t,i,e)=>{async function s(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,l=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,l,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(a,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}e.d(i,{F:()=>s})},9896:(t,i,e)=>{var s=e(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{const t=2,i=44100;let e=new Float32Array,n=window.audioContext.createGain();n.gain.value=.1,n.connect(window.audioContext.destination);let r=window.audioContext.currentTime,h=[];const o=new s.A({BR:30,PR:t=>{let i=new Float32Array(t.buffer),s=new Float32Array(e.length+i.length);s.set(e,0),s.set(i,e.length),e=s},UR:t=>{},bufferSize:102400});await o.init();const l=await fetch('./SCC1_Florestan.sf2'),a=new Uint8Array(await l.arrayBuffer());function c(){if(!window.audioContext||!e.length)return;let s=window.audioContext.createBufferSource();const o=e.length/t,l=window.audioContext.createBuffer(t,o,i);for(let i=0;i{t.stop(window.audioContext.currentTime)})),h=[],n.gain.value=t}}function d(t,i){-1!==t&&window._tinyMidiVolume(t),r=window.audioContext.currentTime,f=setInterval(c,250),o.WR(i)}o.GR(a),window._tinyMidiStop=async t=>{t?function(t,i){const e=window.audioContext.currentTime;n.gain.cancelScheduledValues(e),n.gain.setValueAtTime(n.gain.value,e),n.gain.linearRampToValueAtTime(t,e+2),setTimeout(i,2e3)}(0,(()=>{u()})):u()},window._tinyMidiVolume=(t=1)=>{n.gain.value=t},window._tinyMidiPlay=async(t,i,e)=>{t&&(await window._tinyMidiStop(e),e?setTimeout((()=>{d(i,t)}),2e3):d(i,t))}})()},8151:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5473);const n=class{constructor(t={}){this.YR=void 0,this.HR=0,this.VR=0,this.KR=0,this.BR=t.BR||100,this.sampleRate=t.sampleRate||44100,this.XR=t.XR||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.jR(1),this.PR=t.PR||(()=>{}),this.UR=t.UR||(()=>{}),this.zR=void 0,this.test=0}async init(){if(!this.YR){if('undefined'!=typeof process){const{ZR:t}=await import('path'),{qR:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.YR=await(0,s.A)(),this.JR=this.YR._malloc(this.bufferSize),this.$R=this.YR._malloc(8)}}jR(t){this.bufferSize=4*this.sampleRate*this.XR*t}QR(){if(!this.YR)throw new Error(`${this.constructor.name} not initalized. call .init()`)}GR(t){this.QR();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.YR;e(this.HR),this.HR=i(t.length),this.YR.HEAPU8.set(t,this.HR),this.VR=s(this.HR,t.length),n(this.VR,2===this.XR?0:2,this.sampleRate,this.gain)}tS(){this.QR();const t=new Uint8Array(this.bufferSize);return t.set(this.YR.HEAPU8.subarray(this.JR,this.JR+this.bufferSize)),t}iS(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.YR;return e(this.KR),this.KR=i(t.length),this.YR.HEAPU8.set(t,this.KR),s(this.KR,t.length)}eS(t){const{_midi_render:i}=this.YR;return i(this.VR,t,this.XR,this.sampleRate,this.JR,this.bufferSize,this.$R)}WR(t){if(this.QR(),!this.VR)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.zR);const{setValue:i,getValue:e}=this.YR;i(this.$R,0,'double'),this.YR._tsf_reset(this.VR),this.YR._tsf_channel_set_bank_preset(this.VR,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.iS(t);const n=()=>{s=this.eS(s);const t=this.tS();this.PR(t),s?this.zR=setTimeout(n,this.BR):this.UR(e(this.$R,'double'))};this.zR=setTimeout(n,16)}}},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,e)=>{var s;e.d(i,{A:()=>n});const n=(s="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,n,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,e){i=t,n=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(r.ready,t)||Object.defineProperty(r.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var h=Object.assign({},r),o=[],l='object'==typeof window,a='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!l&&!c&&!a;if(r.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var p,A;y=a?require('path').ZR(y)+'/':__dirname+'/';var m=()=>{A||(p=require('fs'),A=require('path'))};u=(t,i)=>(m(),t=A.normalize(t),p.sS(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,e)=>{m(),t=A.normalize(t),p.nS(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),r.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,e){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!l&&!a)throw new Error('environment detection error');if(a?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),s&&(y=s),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},a&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}r.print||console.log.bind(console);var g,I,_=r.printErr||console.warn.bind(console);function C(t,i){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(r,h),h=null,g='fetchSettings',Object.getOwnPropertyDescriptor(r,g)&&j('`Module.'+g+'` was supplied but `'+g+'` not included in INCOMING_MODULE_JS_API'),r.arguments&&(o=r.arguments),C('arguments','arguments_'),r.thisProgram&&r.thisProgram,C('thisProgram','thisProgram'),r.quit&&r.quit,C('quit','quit_'),D(void 0===r.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===r.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===r.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===r.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===r.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),r.wasmBinary&&(I=r.wasmBinary),C('wasmBinary','wasmBinary');var v;r.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,O,R,S,L,x,M,k=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function N(t){b=t,r.HEAP8=T=new Int8Array(t),r.HEAP16=R=new Int16Array(t),r.HEAP32=S=new Int32Array(t),r.HEAPU8=O=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=L=new Uint32Array(t),r.HEAPF32=x=new Float32Array(t),r.HEAPF64=M=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var F=5242880;r.TOTAL_STACK&&D(F===r.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=r.INITIAL_MEMORY||16777216;function P(){if(!k){var t=ft(),i=L[t>>2],e=L[t+4>>2];34821223==i&&2310721022==e||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==L[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=F,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+F+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!r.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var U=[],W=[],G=[],Y=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var H=0,V=null,K=null,X={};function j(t){r.onAbort&&r.onAbort(t),_(t='Aborted('+t+')'),k=!0;var i=new WebAssembly.RuntimeError(t);throw n(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},rS:function(){z.error()},hS:function(){z.error()},oS:function(){z.error()},open:function(){z.error()},lS:function(){z.error()},aS:function(){z.error()},cS:function(){z.error()},fS:function(){z.error()},uS:function(){z.error()}};r.FS_createDataFile=z.rS,r.FS_createPreloadedFile=z.hS;var Z,q,J,$,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=r.asm),D(Y,'native function `'+e+'` called before runtime initialization'),s[t]||D(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==Z&&I)return new Uint8Array(I);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(r)}function ht(t){ht.dS||(ht.dS={}),ht.dS[t]||(ht.dS[t]=1,c&&(t='warning: '+t),_(t))}function ot(t){try{return v.grow(t-b.byteLength+65535>>>16),N(v.buffer),1}catch(i){_('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}r.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=r.locateFile?r.locateFile(q,y):y+q):Z=new URL(e(8227),e.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,e){O.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=O.length;D((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return _('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return _('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function e(t,i){var e,s=t.exports;r.asm=s,D(v=r.asm.memory,"memory not found in wasm exports"),N(v.buffer),D(r.asm.__indirect_function_table,"table not found in wasm exports"),e=r.asm.__wasm_call_ctors,W.unshift(e),function(t){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(X[t]),delete X[t]):_('warning: run dependency removed without ID'),0==H&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',H++,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(k)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,_('still waiting on run dependencies:')),_('dependency: '+i);t&&_('(end of list)')}),1e4))):_('warning: run dependency added without ID');var s=r;function h(t){D(r===s,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),s=null,e(t.instance)}function o(t){return function(){if(!I&&(l||a)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return st(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){_('failed to asynchronously prepare wasm: '+t),it(Z)&&_('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(r.instantiateWasm)try{return r.instantiateWasm(i,e)}catch(t){_('Module.instantiateWasm callback failed with error: '+t),n(t)}(I||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(h):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return _('wasm streaming compile failed: '+t),_('falling back to ArrayBuffer instantiation'),o(h)}))}))).catch(n)}(),r.___wasm_call_ctors=et("__wasm_call_ctors"),r._malloc=et("malloc"),r._free=et("free"),r._tsf_load_memory=et("tsf_load_memory"),r._tsf_close=et("tsf_close"),r._tsf_reset=et("tsf_reset"),r._tsf_set_output=et("tsf_set_output"),r._tsf_set_max_voices=et("tsf_set_max_voices"),r._realloc=et("realloc"),r._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),r._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),r._tml_load_memory=et("tml_load_memory"),r._midi_render=et("midi_render"),r.___errno_location=et("__errno_location"),r._fflush=et("fflush"),r._emscripten_stack_init=function(){return(ct=r._emscripten_stack_init=r.asm.emscripten_stack_init).apply(null,arguments)}),ft=(r._emscripten_stack_get_free=function(){return(r._emscripten_stack_get_free=r.asm.emscripten_stack_get_free).apply(null,arguments)},r._emscripten_stack_get_base=function(){return(r._emscripten_stack_get_base=r.asm.emscripten_stack_get_base).apply(null,arguments)},r._emscripten_stack_get_end=function(){return(ft=r._emscripten_stack_get_end=r.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),L[t>>2]=34821223,L[t+4>>2]=2310721022,L[0]=1668509029}function dt(t){function e(){lt||(lt=!0,r.calledRun=!0,k||(D(!Y),Y=!0,P(),rt(W),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),D(!r._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(P(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),G.unshift(t);var t;rt(G)}()))}t=t||o,H>0||(ut(),function(){if(r.preRun)for('function'==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),U.unshift(t);var t;rt(U)}(),H>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),e()}),1)):e(),P()))}if(r.stackSave=et("stackSave"),r.stackRestore=et("stackRestore"),r.stackAlloc=et("stackAlloc"),r.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':T[0|t]=i;break;case'i16':R[t>>1]=i;break;case'i32':S[t>>2]=i;break;case'i64':$=[i>>>0,(J=i,+Math.abs(J)>=1?J>0?(0|Math.min(+Math.floor(J/4294967296),4294967295))>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],S[t>>2]=$[0],S[t+4>>2]=$[1];break;case'float':x[t>>2]=i;break;case'double':M[t>>3]=i;break;case'*':L[t>>2]=i;break;default:j('invalid type for setValue: '+e)}},r.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return T[0|t];case'i16':return R[t>>1];case'i32':case'i64':return S[t>>2];case'float':return x[t>>2];case'double':return M[t>>3];case'*':return L[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),K=function t(){lt||dt(),lt||(K=t)},r.preInit)for('function'==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return dt(),t.ready})}},r={};function h(t){var i=r[t];if(void 0!==i)return i.exports;var e=r[t]={exports:{}};return n[t](e,e.exports,h),e.exports}h.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",e="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",s=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},h.a=(n,r,h)=>{var o;h&&((o=[]).d=-1);var l,a,c,f=new Set,u=n.exports,d=new Promise(((t,i)=>{c=i,a=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,r((n=>{var r;l=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var r=[];r.d=0,n.then((t=>{h[i]=t,s(r)}),(t=>{h[e]=t,s(r)}));var h={};return h[t]=t=>t(r),h}}var o={};return o[t]=t=>{},o[i]=n,o})))(n);var h=()=>l.map((t=>{if(t[e])throw t[e];return t[i]})),a=new Promise((i=>{(r=()=>i(h)).r=0;var e=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(r.r++,t.push(r)));l.map((i=>i[t](e)))}));return r.r?a:h()}),(t=>(t?c(d[e]=t):a(u),s(o)))),o&&o.d<0&&(o.d=0)},h.d=(t,i)=>{for(var e in i)h.o(i,e)&&!h.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},h.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),h.p="/Client2/",h.b=document.baseURI||self.location.href;h(9073)})(); \ No newline at end of file +(()=>{"use strict";var t,i,e,s,n={1651:(t,i,e)=>{e.d(i,{K:()=>D});var s=e(1120),n=e(4583),r=e(2901),h=e(1069),o=e(7046),l=(e(9896),e(6666)),a=e(3045),c=e(818),f=e(670),u=e(8268),d=e(3867),w=e(7854),y=e(8950),p=e(1302),A=e(9298),m=e(8665),g=e(1312),I=e(3819),_=e(8317),C=e(9234),E=e(1908),v=e(123),b=e(5637),T=e(6948),O=e(2164),R=e(8738),S=e(3764),L=e(8534),x=e(6730),M=e(2604),k=e(5226);class D extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static et=!1;static st='';static nt='';static rt=!1;static ht=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static gt=0;static It=0;static _t=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Ot=0;static Rt=()=>{a.A.et=!1,n.A.et=!1,D.et=!1,c.A.et=!1};static St=()=>{a.A.et=!0,n.A.et=!0,D.et=!0,c.A.et=!0};Lt=2048;xt=2047;Mt=!1;kt=!1;Dt=!1;Nt=!1;db=null;Ft=0;Bt=[];stream=null;in=h.A.Pt(1);Ut=h.A.Pt(1);Wt=h.A.Pt(1);Gt=0n;Yt=0;Ht=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;Jt=!0;$t=0;Qt=0;ti=null;ii=null;ei=null;si=null;ni=null;ri=null;hi=null;oi=null;li=null;ai=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;pi=null;Ai=[];mi=!1;gi=null;Ii=null;_i=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Oi=null;Ri=null;Si=new Int32Array(256);Li=0;xi=0;Mi=0;ki=null;Di=null;Ni=null;Fi=null;Bi=null;Pi=null;Ui=null;Wi=null;Gi=null;Yi=null;Hi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;Ji=null;$i=null;Qi=null;te=new Int32Array(33);ie=new Int32Array(33);ee=new Int32Array(151);se=new Int32Array(151);ne=null;re=null;he=null;oe=null;le=null;ae=null;ce=new d.fe(13,null);ue=null;de=null;we=new d.fe(50,null);ye=new d.fe(50,null);pe=new d.fe(20,null);Ae=new d.fe(20,null);me=null;ge=new d.fe(8,null);Ie=null;_e=null;Ce=null;Ee=null;ve=null;be=null;Te=null;Oe=null;Re=null;Se=null;Le=null;xe=null;Me=null;ke=null;De=null;Ne=null;Fe=null;Be=null;Pe=new d.fe(1e3,null);Ue=!1;We=!1;Ge=!1;Ye=!1;He=-1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=!1;Je=0;$e=0;Qe=0;ts=0;es=0;ss=0;ns=[];rs=-1;hs=-1;os=new s.A;ls=78;cs=0;fs=0;us=[];ds=0;ws=0;ys=0;ps=0;As=0;gs=0;Is=0;_s=0;Cs=[];Es=[];vs=[];bs=[];Ts=null;Os=-1;Rs=3;Ss=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Ls=0;xs=0;Ms=0;ks=!1;Ds=0;Ns=!1;Fs='';Bs='';Ps=0;Us='';Ws=!1;Gs=-1;Ys=new d.fe(100,null);Hs=new d.fe(100,null);messageType=new Int32Array(100);Vs=new Int32Array(100);Ks=0;Xs=0;js=0;zs='';Zs=0;qs=0;Js=0;$s=0;Qs=0;tn=0;en=0;sn=0;nn=0;rn=!1;hn=0;ln=0;an=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;pn=!1;An=[];mn=[];gn=0;In=0;_n=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);On=new Int32Array(500);Rn=0;Sn=0;Ln=0;xn='';Mn=!1;kn=-1;Dn=0;Nn=0;Fn=0;Bn=0;Pn=0;Un=new Int32Array(1e3);Wn=new Int32Array(1e3);Gn=null;Yn=0;Hn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;Jn=0;$n=2;Qn=2;tr=1;ir=new Int32Array(5);er=new d.fe(5,!1);sr=new Int32Array(5);nr=new Int32Array(5);rr=new Int32Array(5);hr=0;lr=0;ar=0;cr=0;ur=0;dr=0;wr=0;yr=0;pr=0;Ar=1;mr=2;gr=-1;Ir=0;_r=0;Cr=0;Er=0;vr=0;br=0;Tr=null;Or=null;Rr=null;Sr=0;Lr=0;Mr=new Int8Array(16384);kr=new d.fe(f.A.Dr,null);Nr=0;Fr=0;Br=128;Pr=0;Ur=0;Wr=0;Gr=0;Yr=0;Hr=null;Vr=null;Kr=new d.Xr(f.A.jr,f.A.jr);zr=0;Zr=0;qr=0;Jr=0;$r=0;Qr=0;th=0;ih=0;eh=0;sh=0;nh=0;rh=0;hh=new d.fe(this.Lt,null);oh=0;lh=new Int32Array(this.Lt);ah=0;fh=0;uh=new Int32Array(this.Lt);dh=new Int32Array(1e3);wh=new d.fe(this.Lt,null);yh=new d.fe(8192,null);ph=0;Ah=new Int32Array(8192);mh=new l.A;gh=new l.A;Ih=new l.A;_h=new l.A;Ch=new d.Eh(f.A.Dr,f.A.jr,f.A.jr,null);bh=new l.A;Th=new Int32Array(4e3);Oh=new Int32Array(4e3);Rh=new Int32Array(f.A.jr*f.A.jr);Sh=new Int32Array(f.A.jr*f.A.jr);Lh=0;xh=null;Mh=0;kh=0;Dh=-1;Nh=0;Fh=0;Bh=0;Ph=0;Uh=!1;Wh=!0;Gh=!1;Yh=new Int32Array(7);Hh=new Int32Array(5);Vh=0;Kh=0;static Xh=50;jh=new Int32Array(D.Xh);zh=new Int32Array(D.Xh);Zh=new Int32Array(D.Xh);qh=new Int32Array(D.Xh);Jh=new Int32Array(D.Xh);$h=new Int32Array(D.Xh);Qh=new Int32Array(D.Xh);io=new d.fe(D.Xh,null);eo=new d.fe(100,null);so=new BigInt64Array(100);no=new Int32Array(100);ro=null;ho=0;oo=!0;lo=new Int32Array(50);ao=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;po=0;Ao=!0;mo=null;Io=0;_o=0;Co=192;Eo=void 0;vo=!1;host=null;bo=null;To=new d.fe(16,null);Oo=0;Ro=!1;So=()=>{try{this.stream&&this.stream.close()}catch(t){}this.bo&&'998'===D.getParameter('world')&&this.bo.Lo?.send(JSON.stringify({type:'close',id:this.bo.xo})),this.stream=null,(0,v.Mo)(!1),this.Ut=null,this.Wt=null,this.in=null,this.Rr=null,this.Tr=null,this.Or=null,this.Hr=null,this.Vr=null,this.Gn=null,this.kr=null,this.Rh=null,this.Sh=null,this.Th=null,this.Oh=null,this.Mr=null,this.Di=null,this.Ni=null,this.Fi=null,this.Bi=null,this.Pi=null,this.Ui=null,this.Wi=null,this.Gi=null,this.Yi=null,this.Hi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.ne=null,this.he=null,this.re=null,this.oe=null,this.le=null,this.ae=null,this.ce=null,this.Te=null,this.Oe=null,this.Re=null,this.Se=null,this.Le=null,this.xe=null,this.Me=null,this.ke=null,this.De=null,this.Ne=null,this.de=null,this.pe=null,this.Ae=null,this.ge=null,this.Ie=null,this._e=null,this.Ce=null,this.Ee=null,this.we=null,this.ye=null,this.Kr=null,this.hh=null,this.lh=null,this.uh=null,this.wh=null,this.dh=null,this.yh=null,this.Ah=null,this.Ch=null,this.bh=null,this._h=null,this.mh=null,this.gh=null,this.Ih=null,this.Tn=null,this.On=null,this.vn=null,this.bn=null,this.ns=null,this.An=null,this.Un=null,this.Wn=null,this.Pe=null,this.ue=null,this.eo=null,this.so=null,this.no=null,this.si=null,this.ni=null,this.ti=null,this.ii=null,this.ei=null,this.ri=null,this.hi=null,this.oi=null,this.li=null,this.ko(),b.A.So(),T.A.So(),p.A.So(),O.A.Do=null,_.A.Do=null,s.A.Do=null,g.A.Do=null,R.A.Do=null,R.A.No=null,S.A.Do=null,this.Fo=null,u.A.No=null,n.A.So(),a.A.So(),m.A.So(),L.A.Do=[],x.A.Do=[]};Bo(){return this.$t}Po(){return this.Ws}Uo(){return this.Ns}Wo(){return this.hs}Go(){return this.He}ko=()=>{this.mi=!1,this.ki&&(clearInterval(this.ki),this.ki=null),this.ai=null,this.ci=null,this.Ai=[],this.bi=null,this.Ti=null,this.Oi=null,this.Ri=null,this.Ci=null,this._i=null,this.Ei=null,this.vi=null,this.gi=null,this.Ii=null};Yo=()=>{'999'===D.getParameter('world')?(this.Eo=new Worker('worker.js',{type:'module'}),this.Eo.onmessage=this.onmessage,this.host=new k.x(this.Eo)):'998'===D.getParameter('world')&&(this.Eo={onmessage:t=>{this.stream.Ho.onmessage(t)},postMessage:t=>{this.bo&&this.bo.Lo&&'open'===this.bo.Lo.readyState&&this.bo.Lo.send(JSON.stringify(t))},onerror:null,onmessageerror:null,terminate:()=>{throw new Error},addEventListener:()=>{throw new Error},removeEventListener:()=>{throw new Error},dispatchEvent:()=>{throw new Error}},this.bo=new k.Q(this.Eo))};onmessage=t=>{switch(t.data.type){case'ready':return void(this.vo=!0);case'save':return(0,M.A)(t.data.value,t.data.path.split('/').pop().split('\\').pop()),void URL.revokeObjectURL(t.data.value);case'close':return void this.Eo?.postMessage({type:'close',id:t.data.id})}this.host?.xo===t.data.id?this.stream.Ho.onmessage(t.data):this.host?.postMessage(t)};Vo=async()=>{if(999==+D.getParameter('world'))this.host&&await this.host.Ko();else if(998==+D.getParameter('world')&&this.bo){if(this.bo.Lo)return void console.log('You are already connected.');const t=prompt('Paste offer here, answer will be copied to clipboard');if(t)try{await this.bo.Xo(t)}catch(t){console.error(t)}}};jo=async(t,i,e,s)=>{let n=5,o=await(this.db?.zo(t));if(o&&h.A.Zo(o)!==e&&(o=void 0),o)return new r.A(o);for(;!o;){await this.qo(s,`Requesting ${i}`);try{o=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}${e}`):await(0,C.Jo)(`${D.nt}/${t}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.qo(s,`Error loading - Will retry in ${t} secs.`),await(0,C.$o)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Qo(t,o)),new r.A(o)};tl=async(t,i,e,s)=>{let n=await(this.db?.zo(t+'.mid'));if(n&&12345678!==i&&h.A.Zo(n)!==i&&(n=void 0),!n)try{n=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}_${i}.mid`):await(0,C.Jo)(`${D.nt}/songs/${t}.mid`),e!==n.length&&(n=n.slice(0,e))}catch(t){}if(!n)return;await(this.db?.Qo(t+'.mid',n));const r=new h.A(Uint8Array.from(n)).il,o=E.A.read(r,n,e,4);(0,v.el)(o,this.Co,s)};sl=()=>{if(w.nl.fillStyle='black',w.nl.fillRect(0,0,this.width,this.height),this.rl(1),this.Dt){this.mi=!1,w.nl.font='bold 16px helvetica, sans-serif',w.nl.textAlign='left',w.nl.fillStyle='yellow';let t=35;w.nl.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.nl.fillStyle='white',w.nl.fillText('To fix this try the following (in order):',30,t),t+=50,w.nl.font='bold 12px helvetica, sans-serif',w.nl.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.nl.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.nl.fillText('3: Try using a different game-world',30,t),t+=30,w.nl.fillText('4: Try rebooting your computer',30,t),t+=30,w.nl.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.mi=!1,w.nl.font='bold 20px helvetica, sans-serif',w.nl.textAlign='left',w.nl.fillStyle='white',w.nl.fillText('Error - unable to load game!',50,50),w.nl.fillText('To play RuneScape make sure you play from',50,100),w.nl.fillText('https://2004scape.org',50,150)),this.kt){this.mi=!1,w.nl.font='bold 13px helvetica, sans-serif',w.nl.textAlign='left',w.nl.fillStyle='yellow';let t=35;w.nl.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.nl.fillStyle='white',w.nl.fillText('To fix this try the following (in order):',30,t),t+=50,w.nl.font='bold 12px helvetica, sans-serif',w.nl.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.nl.fillText('2: Try rebooting your computer, and reloading',30,t)}};hl=t=>{if(!t.ol)return!1;for(let i=0;i=s)return!1}else if(3===t.ol[i]){if(e<=s)return!1}else if(4===t.ol[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};cl=(t,i,e,s,n)=>{this.ve?.draw(t,i),this.be?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,A.A.fl);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;y.A.fillRect(t,i+h+16,16,r,A.A.ul),y.A.dl(t,i+h+16,A.A.wl,r),y.A.dl(t+1,i+h+16,A.A.wl,r),y.A.yl(t,i+h+16,A.A.wl,16),y.A.yl(t,i+h+17,A.A.wl,16),y.A.dl(t+15,i+h+16,A.A.pl,r),y.A.dl(t+14,i+h+17,A.A.pl,r-1),y.A.yl(t,i+h+r+15,A.A.pl,16),y.A.yl(t+1,i+h+r+14,A.A.pl,15)};Al=(t,i)=>{let e=!1;const n=s.A.Do[t];if(!n.ml)return!1;for(let t=0;ts.delay[r.Cl];)r._l-=s.delay[r.Cl]+1,r.Cl++,r.Cl>=s.El&&(r.Cl-=s.vl,(r.Cl<0||r.Cl>=s.El)&&(r.Cl=0)),e=!0}}}return e};bl=(t,i,e,r,h=!1)=>{if(0!==t.type||!t.ml||t.hide&&this.Zs!==t.id&&this.qs!==t.id&&this.Js!==t.id)return;const o=y.A.left,l=y.A.top,a=y.A.right,c=y.A.bottom;y.A.Tl(i,e,i+t.width,e+t.height);const f=t.ml.length;for(let o=0;o0&&this.Ml(c),c.type===s.A.kl)c.Dl>c.scroll-c.height&&(c.Dl=c.scroll-c.height),c.Dl<0&&(c.Dl=0),this.bl(c,l,a,c.Dl,h),c.scroll>c.height&&this.cl(l+c.width,a,c.Dl,c.scroll,c.height);else if(c.type===s.A.Nl){let t=0;for(let i=0;i0){let i=0,e=0;const r=c.Pl[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qs===t){const h=p.A.Yl(r,c.Ul[t]);if(0!==this.tn&&this.Qs===t&&this.$s===c.id?(i=this.Hl-this.en,e=this.Vl-this.sn,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.nn<5&&(i=0,e=0),h.Kl(128,s+i,n+e)):0!==this.un&&this.dn===t&&this.wn===c.id?h.Kl(128,s,n):h.draw(s,n),33===h.Xl||1!==c.Ul[t]){const r=c.Ul[t];this.di?.jl(s+i+1,n+10+e,this.zl(r),A.A.Zl),this.di?.jl(s+i,n+9+e,this.zl(r),A.A.ql)}}}else if(c.Jl&&t<20){const i=c.Jl[t];i?.draw(s,n)}t++}}else if(c.type===s.A.$l)c.fill?y.A.fillRect(l,a,c.width,c.height,c.Ql):y.A.Sl(l,a,c.width,c.height,c.Ql);else if(c.type===s.A.ta){const t=c.font;let i=c.Ql,e=c.text;if(this.Js!==c.id&&this.qs!==c.id&&this.Zs!==c.id||0===c.ia||(i=c.ia),this.hl(c)&&(i=c.ea,c.sa&&c.sa.length>0&&(e=c.sa)),c.na===s.A.ra&&this.pn&&(e='Please wait...',i=c.Ql),!t||!e)continue;for(let s=a+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.ha(this.ll(c,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.ha(this.ll(c,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.ha(this.ll(c,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.ha(this.ll(c,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.ha(this.ll(c,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),c.oa?t.la(l+(c.width/2|0),s,r,i,c.aa):t.ca(l,s,r,i,c.aa)}}else if(c.type===s.A.fa){let t;t=this.hl(c)?c.ua:c.da,t?.draw(l,a)}else if(c.type===s.A.wa){const t=n.A.ya,i=n.A.pa;n.A.ya=l+(c.width/2|0),n.A.pa=a+(c.height/2|0);const e=n.A.sin[c.Aa]*c.zoom>>16,s=n.A.cos[c.Aa]*c.zoom>>16,r=this.hl(c);let h;h=r?c.Il:c.gl;let o=null;if(-1===h)o=c.ma(-1,-1,r);else{const t=g.A.Do[h];t.frames&&t.ga&&(o=c.ma(t.frames[c.Cl],t.ga[c.Cl],r))}o&&o.Ia(0,c._a,0,c.Aa,0,e,s),n.A.ya=t,n.A.pa=i}else if(c.type===s.A.Ca){const t=c.font;if(!t||!c.Pl||!c.Ul)continue;let i=0;for(let e=0;e0){const n=p.A.get(c.Pl[i]-1);let r=n.name;if((n.Ea||1!==c.Ul[i])&&(r=r+' x'+this.va(c.Ul[i])),!r)continue;const h=l+s*(c.Wl+115),o=a+e*(c.Gl+12);c.oa?t.la(h+(c.width/2|0),o,r,c.Ql,c.aa):t.ca(h,o,r,c.Ql,c.aa)}i++}}}y.A.Tl(o,l,a,c)};Ml=t=>{let i=t.xl;if(i>=s.A.ba&&i<=s.A.Ta)i--,i>=this.Vh?(t.text='',t.na=0):(t.text=this.eo[i],t.na=1);else if(i>=s.A.Oa&&i<=s.A.Ra)i-=s.A.Oa,i>=this.Vh?(t.text='',t.na=0):(0===this.no[i]?t.text='@red@Offline':this.no[i]===D.it?t.text='@gre@World-'+(this.no[i]-9):t.text='@yel@World-'+(this.no[i]-9),t.na=1);else if(i===s.A.Sa)t.scroll=15*this.Vh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=s.A.La&&i<=s.A.xa)i-=s.A.La,i>=this.fs?(t.text='',t.na=0):(t.text=I.A.Ma(I.A.ka(this.us[i])),t.na=1);else if(i===s.A.Da)t.scroll=15*this.fs+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===s.A.Na){if(t.Aa=150,t._a=256*Math.sin(this.Ft/40)&2047,this.Gh){this.Gh=!1;const i=new d.fe(7,null);let e=0;for(let t=0;t<7;t++){const s=this.Yh[t];s>=0&&(i[e++]=_.A.Do[s].ma())}const s=m.A.Fa(i,e);for(let t=0;t<5;t++)0!==this.Hh[t]&&(s.Ba(u.A.Pa[t][0],u.A.Pa[t][this.Hh[t]]),1===t&&s.Ba(u.A.Ua[0],u.A.Ua[this.Hh[t]]));if(this.xh){const i=g.A.Do[this.xh.Wa].frames;i&&(s.Ga(),s.Ya(i[0]),s.Ha(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===s.A.Va)this.Fe||(this.Fe=t.da,this.Be=t.ua),this.Wh?t.da=this.Be:t.da=this.Fe;else if(i===s.A.Ka)this.Fe||(this.Fe=t.da,this.Be=t.ua),this.Wh?t.da=this.Fe:t.da=this.Be;else if(i===s.A.Xa)t.text=this.xn,this.Ft%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===s.A.ja)this.Uh?this.Mn?(t.Ql=A.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Ql=A.A.Ll,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===s.A.za||i===s.A.Za)if(0===this.Dn)t.text='';else{let i;i=0===this.Nn?'earlier today':1===this.Nn?'yesterday':this.Nn+' days ago',t.text='You last logged in '+i+' from: '+I.A.qa(this.Dn)}else if(i===s.A.Ja)0===this.Bn&&(t.text='0 unread messages',t.Ql=A.A.ql),1===this.Bn&&(t.text='1 unread message',t.Ql=A.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Ql=A.A.GREEN);else if(i===s.A.$a)if(201===this.Fn)t.text='';else if(200===this.Fn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Fn?'Earlier today':1===this.Fn?'Yesterday':this.Fn+' days ago',t.text=i+' you changed your recovery questions'}else i===s.A.Qa?201===this.Fn?t.text='':200===this.Fn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===s.A.tc&&(201===this.Fn?t.text='':(this.Fn,t.text="Do this from the 'account management' area on our front webpage"))};ll=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let n=0,r=0;for(;;){const t=e[r++];if(0===t)return n;if(1===t)n+=this.Es[e[r++]];else if(2===t)n+=this.vs[e[r++]];else if(3===t)n+=this.Cs[e[r++]];else if(4===t){const t=s.A.Do[e[r++]],i=e[r++]+1;if(t.Pl&&t.Ul)for(let e=0;et<999999999?String(t):'*';va=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};zl=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,e)=>{e.d(i,{w:()=>h});var s=e(7046),n=e(1651),r=e(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');['0','998','999'].includes(s.A.getParameter('world'))?function(){if(+s.A.getParameter('world')>=998)return void(n.K.nt='data/pack/client');n.K.st='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0}():await async function(t){const i=await o(t,parseInt(s.A.getParameter('world'),10)),e=new URL(i.address);n.K.it=10+i.id-1,n.K.st=`${e.protocol}//${e.hostname}`,n.K.nt=`${e.protocol}//${e.hostname}:${e.port}`,t||(n.K.st=n.K.st.replace('https:','http:'));n.K.portOffset=i.portOffset,n.K.members=!0===i?.members,s.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===s.A.getParameter('detail').length&&s.A.setParameter('detail','high');'low'===s.A.getParameter('detail')?n.K.St():n.K.Rt()}(),0===s.A.getParameter('method').length&&s.A.setParameter('method','0')}async function o(t,i,e=0){if(e>=10)throw new Error('could not find world to connect!');const s=t?'https:':'http:';let n;try{n=JSON.parse(await(0,r.ec)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.$o)(1e3),o(t,i,++e)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hh:0});const h=n.find((t=>t.id===i));return h||o(t,i,10)}},7046:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(1183),n=e(4583),r=e(9234),h=e(9091),o=e(2595),l=e(7854);class a{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}sc=0;nc=[];rc=0;Fo=null;state=0;hc=20;oc=1;lc=[];ac=0;cc=0;fc=[];uc=!0;dc=!1;wc=50;hasFocus=!0;yc=!1;Ac=0;mc=0;Hl=0;Vl=0;gc=0;Ic=0;_c=0;Cc=[];Ec=[];vc=0;bc=0;input=null;Tc=!1;Oc=!1;Rc=!1;time=-1;Sc=0;Lc=0;xc=0;Mc=0;kc=0;Dc=0;constructor(t=!1){l.Nc.tabIndex=-1,l.nl.fillStyle='black',l.nl.fillRect(0,0,l.Nc.width,l.Nc.height),this.dc=t,this.dc?this.resize(window.innerWidth,window.innerHeight):this.resize(l.Nc.width,l.Nc.height)}get width(){return l.Nc.width}get height(){return l.Nc.height}resize=(t,i)=>{l.Nc.width=t,l.Nc.height=i,this.Fo=new s.A(t,i),n.A.Fc()};run=async()=>{l.Nc.addEventListener('resize',(()=>{this.dc&&this.resize(window.innerWidth,window.innerHeight)}),!1),l.Nc.onmousedown=this.onmousedown,l.Nc.onmouseup=this.onmouseup,l.Nc.onmouseenter=this.onmouseenter,l.Nc.onmouseleave=this.onmouseleave,l.Nc.onmousemove=this.onmousemove,window.onbeforeunload=this.So,l.Nc.onfocus=this.onfocus,l.Nc.onblur=this.onblur,this.Bc?(l.Nc.ontouchstart=this.ontouchstart,l.Nc.ontouchend=this.ontouchend,l.Nc.ontouchmove=this.ontouchmove):(l.Nc.onkeydown=this.onkeydown,l.Nc.onkeyup=this.onkeyup),l.Nc.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Bc&&'low'===a.getParameter('detail')&&(this.wc=30),await this.qo(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.lc[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.Pc();const h=e,o=s;e=300,s=1,t=performance.now();const l=this.lc[i];if(0===l?(e=h,s=o):t>l&&(e=2560*this.hc/(t-l)|0),e<25?e=25:e>256&&(e=256,s=this.hc-(t-l)/10|0),this.lc[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.lc[t]&&(this.lc[t]+=s);for(s0&&(this.ac=1e3*e/(256*this.hc)|0);const a=performance.now();if(this.uc&&this.refresh(),await this.draw(),this.fc[this.cc]=(performance.now()-a)/1e3,this.cc=(this.cc+1)%this.fc.length,this.wc<50){const i=1e3/this.wc-(performance.now()-t);i>0&&await(0,r.$o)(i)}}-1===this.state&&this.Pc()};Pc=()=>{this.state=-2,this.So()};rl=t=>{this.hc=1e3/t|0};Uc=t=>{this.wc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.hc|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};So=()=>{};draw=async()=>{};refresh=()=>{};async qo(t,i){const e=this.width,s=this.height;this.uc&&(l.nl.fillStyle='black',l.nl.fillRect(0,0,e,s),this.uc=!1);const n=s/2-18;l.nl.fillStyle='rgb(140, 17, 17)',l.nl.rect((e/2|0)-152,n,304,34),l.nl.fillRect((e/2|0)-150,n+2,3*t,30),l.nl.fillStyle='black',l.nl.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),l.nl.font='bold 13px helvetica, sans-serif',l.nl.textAlign='center',l.nl.fillStyle='white',l.nl.fillText(i,e/2|0,n+22),await(0,r.$o)(5)}Wc=()=>{let t=-1;return this.bc!==this.vc&&(t=this.Ec[this.vc],this.vc=this.vc+1&127),t};get ms(){const t=this.fc.length;let i=0;for(let e=0;ethis.sc&&(this.sc=e),this.nc[this.rc]=e,this.rc=(this.rc+1)%250,e}get Gc(){return this.nc.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.Ac=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Cc[n]=1),n>4&&(this.Ec[this.bc]=n,this.bc=this.bc+1&127),o.A.enabled&&o.A.Yc(n),h.g.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.Ac=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Cc[n]=0),o.A.enabled&&o.A.Hc(n),h.g.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.Tc=!1,(t.clientX>0||t.clientY>0)&&this.Vc(t),this.Ac=0,this.Ic=this.Hl,this._c=this.Vl,this.Bc&&!this.Kc){if(this.Xc()||this.jc()||this.zc())return this.gc=1,void(this.mc=1);t.timeStamp>=this.time+500?(this.gc=2,this.mc=2):(this.gc=1,this.mc=1)}else 2===t.button?(this.gc=2,this.mc=2):(this.gc=1,this.mc=1);o.A.enabled&&o.A.Zc(this.Ic,this._c,t.buttons)};onmouseup=t=>{this.Vc(t),this.Ac=0,this.mc=0,o.A.enabled&&o.A.qc(t.buttons)};onmouseenter=t=>{this.Vc(t),o.A.enabled&&o.A.Jc()};onmouseleave=t=>{this.Vc(t),this.Ac=0,this.Hl=-1,this.Vl=-1,this.mc=0,this.Ic=-1,this._c=-1,o.A.enabled&&o.A.$c()};onmousemove=t=>{this.Vc(t),this.Ac=0,o.A.enabled&&o.A.Qc(this.Hl,this.Vl)};onfocus=t=>{this.hasFocus=!0,this.uc=!0,this.refresh(),o.A.enabled&&o.A.tf()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.if()};ontouchstart=t=>{if(!this.Bc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.Tc=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Sc=this.kc=this.xc=0|i.screenX,this.Lc=this.Dc=this.Mc=0|i.screenY,this.time=t.timeStamp,this.Oc=this.ef(),this.Rc=this.sf()};ontouchend=t=>{if(!this.Bc||!this.Tc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.kc=0|i.screenX,this.Dc=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Oc&&!this.ef())return void(this.Tc=!1);if(this.Rc&&!this.sf())return void(this.Tc=!1);if(this.Xc()||this.nf()||this.jc()||this.zc()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.jc()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.zc()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Xc()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.nf()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.rf?t.setAttribute('type','password'):t.setAttribute('type',this.zc()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.rf&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.rf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.rf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.Tc=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.Sc-this.kc)>16||Math.abs(this.Lc-this.Dc)>16;n&&!r?(this.Tc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.mc=0,this.Tc=!1)};ontouchmove=t=>{if(!this.Bc||!this.Tc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.kc=0|i.screenX,this.Dc=0|i.screenY,this.Oc&&-1===this.Go()?(this.xc-this.kc>0?this.rotate(2):this.xc-this.kc<0&&this.rotate(0),this.Mc-this.Dc>0?this.rotate(3):this.Mc-this.Dc<0&&this.rotate(1)):(this.Rc||-1!==this.Go())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.xc=this.kc,this.Mc=this.Dc};get Bc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get rf(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Kc(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}ef=()=>this.yc&&this.Hl>=8&&this.Hl<=520&&this.Vl>=11&&this.Vl<=345;Xc=()=>this.yc&&-1===this.Wo()&&!this.Po()&&!this.Uo()&&this.Hl>=11&&this.Hl<=506&&this.Vl>=449&&this.Vl<=482;nf=()=>this.yc&&(this.Po()||this.Uo())&&this.Hl>=11&&this.Hl<=506&&this.Vl>=383&&this.Vl<=482;sf=()=>this.yc&&this.Hl>=562&&this.Hl<=752&&this.Vl>=231&&this.Vl<=492;jc=()=>!this.yc&&2===this.Bo()&&this.Hl>=301&&this.Hl<=562&&this.Vl>=262&&this.Vl<=279;zc=()=>!this.yc&&2===this.Bo()&&this.Hl>=301&&this.Hl<=562&&this.Vl>=279&&this.Vl<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};hf=()=>null!==document.fullscreenElement;Vc=t=>{if(this.hf()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/l.Nc.height,s=(window.innerWidth-l.Nc.width*e)/2;this.Hl=0|this.lf(t.clientX-i.left-s,0,l.Nc.width*e,0,789),this.Vl=0|this.lf(t.clientY-i.top,0,l.Nc.height*e,0,532)}else{const i=l.Nc.getBoundingClientRect(),e=l.Nc.width/i.width,s=l.Nc.height/i.height;this.Hl=(t.clientX-i.left)*e|0,this.Vl=(t.clientY-i.top)*s|0}this.Hl<0&&(this.Hl=0),this.Vl<0&&(this.Vl=0),this.Hl>789&&(this.Hl=789),this.Vl>532&&(this.Vl=532)};lf=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}},2595:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static enabled=!1;static af=null;static cf=null;static ff=0;static uf=0;static df=0;static wf=0;static yf=0;static pf=()=>{this.af=s.A.Pt(1),this.cf=null,this.ff=performance.now(),this.enabled=!0};static Af=()=>{this.enabled=!1,this.af=null};static flush=()=>{let t=null;return this.cf&&this.enabled&&(t=this.cf),this.cf=null,t};static stop=()=>{let t=null;return this.af&&this.af.mf>0&&this.enabled&&(t=this.af),this.Af(),t};static Zc=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.uf++;const s=performance.now();let n=(s-this.ff)/10|0;n>250&&(n=250),this.ff=s,this.gf(5),1===e?this.af?.p1(1):this.af?.p1(2),this.af?.p1(n),this.af?.p3(t+(i<<10))};static qc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,this.gf(2),1===t?this.af?.p1(3):this.af?.p1(4),this.af?.p1(e)};static Qc=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.df>=50){this.df=e,this.uf++;let s=(e-this.ff)/10|0;s>250&&(s=250),this.ff=e,t-this.wf<8&&t-this.wf>=-8&&i-this.yf<8&&i-this.yf>=-8?(this.gf(3),this.af?.p1(5),this.af?.p1(s),this.af?.p1(t+(i-this.yf+8<<4)+8-this.wf)):t-this.wf<128&&t-this.wf>=-128&&i-this.yf<128&&i-this.yf>=-128?(this.gf(4),this.af?.p1(6),this.af?.p1(s),this.af?.p1(t+128-this.wf),this.af?.p1(i+128-this.yf)):(this.gf(5),this.af?.p1(7),this.af?.p1(s),this.af?.p3(t+(i<<10))),this.wf=t,this.yf=i}};static Yc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.gf(3),this.af?.p1(8),this.af?.p1(e),this.af?.p1(t)};static Hc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.gf(3),this.af?.p1(9),this.af?.p1(e),this.af?.p1(t)};static tf=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.af?.p1(10),this.af?.p1(i)};static if=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.af?.p1(11),this.af?.p1(i)};static Jc=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.af?.p1(12),this.af?.p1(i)};static $c=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.af?.p1(13),this.af?.p1(i)};static gf=t=>{if(this.af&&this.af.mf+t>=500){const t=this.af;this.af=s.A.Pt(1),this.cf=t}}}},9091:(t,i,e)=>{e.d(i,{c:()=>n,g:()=>s});const s=['F11','F12'],n={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}}},1120:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1069),n=e(8665),r=e(2679),h=e(2511),o=e(3819),l=e(3867),a=e(8950);class c{static Do=[];static If=null;static No=null;static kl=0;static _f=1;static Nl=2;static $l=3;static ta=4;static fa=5;static wa=6;static Ca=7;static Cf=1;static Ef=2;static vf=3;static bf=4;static Tf=5;static ra=6;static ba=1;static Ta=100;static Oa=101;static Ra=200;static Of=201;static Rf=202;static Sa=203;static Sf=205;static Lf=300;static xf=301;static Mf=302;static kf=303;static Df=304;static Nf=305;static Ff=306;static Bf=307;static Pf=308;static Uf=309;static Wf=310;static Gf=311;static Yf=312;static Hf=313;static Vf=314;static Kf=315;static Xf=316;static jf=317;static zf=318;static Zf=319;static qf=320;static Jf=321;static $f=322;static Qf=323;static Va=324;static Ka=325;static tu=326;static Na=327;static La=401;static xa=500;static iu=501;static eu=502;static Da=503;static Xa=600;static su=601;static nu=602;static ru=603;static hu=604;static ou=605;static lu=606;static au=607;static cu=608;static fu=609;static uu=610;static du=611;static wu=612;static ja=613;static za=650;static Ja=651;static $a=652;static Qa=653;static tc=654;static Za=655;static yu=(t,i,e)=>{this.If=new r.A(5e4),this.No=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.mf+=2;n.mf0){s.ol=new Uint8Array(r),s.al=new Uint16Array(r);for(let t=0;t0){s.scripts=new l.fe(o,null);for(let t=0;t0){const n=e.lastIndexOf(',');s.Jl[t]=this.vu(i,e.substring(0,n),parseInt(e.substring(n+1),10))}}s.bu=new l.fe(5,null);for(let t=0;t<5;t++){const i=n.Eu;s.bu[t]=i,0===i.length&&(s.bu[t]=null)}}if(s.type===c.$l&&(s.fill=1===n.mu),s.type===c.ta||s.type===c._f){s.oa=1===n.mu;const t=n.mu;e&&(s.font=e[t]),s.aa=1===n.mu}if(s.type===c.ta&&(s.text=n.Eu,s.sa=n.Eu),s.type!==c._f&&s.type!==c.$l&&s.type!==c.ta||(s.Ql=n.il),s.type!==c.$l&&s.type!==c.ta||(s.ea=n.il,s.ia=n.il),s.type===c.fa){const t=n.Eu;if(t.length>0){const e=t.lastIndexOf(',');s.da=this.vu(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=n.Eu;if(e.length>0){const t=e.lastIndexOf(',');s.ua=this.vu(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(s.type===c.wa){const t=n.mu;0!==t&&(s.model=this.ma((t-1<<8)+n.mu));const i=n.mu;0!==i&&(s.Tu=this.ma((i-1<<8)+n.mu)),s.gl=n.mu,0===s.gl?s.gl=-1:s.gl=(s.gl-1<<8)+n.mu,s.Il=n.mu,0===s.Il?s.Il=-1:s.Il=(s.Il-1<<8)+n.mu,s.zoom=n.pu,s.Aa=n.pu,s._a=n.pu}if(s.type===c.Ca){s.Pl=new Int32Array(s.width*s.height),s.Ul=new Int32Array(s.width*s.height),s.oa=1===n.mu;const t=n.mu;e&&(s.font=e[t]),s.aa=1===n.mu,s.Ql=n.il,s.Wl=n.Iu,s.Gl=n.Iu,s._u=1===n.mu,s.bu=new l.fe(5,null);for(let t=0;t<5;t++){const i=n.Eu;s.bu[t]=i,0===i.length&&(s.bu[t]=null)}}s.na!==c.Ef&&s.type!==c.Nl||(s.Ou=n.Eu,s.action=n.Eu,s.Ru=n.pu),s.na!==c.Cf&&s.na!==c.bf&&s.na!==c.Tf&&s.na!==c.ra||(s.Su=n.Eu,0===s.Su.length&&(s.na===c.Cf?s.Su='Ok':s.na===c.bf||s.na===c.Tf?s.Su='Select':s.na===c.ra&&(s.Su='Continue')))}this.If=null,this.No=null};static vu=(t,i,e)=>{const s=o.A.Lu(i)<<8n|BigInt(e);if(this.If){const t=this.If.get(s);if(t)return t}let n;try{n=h.A.xu(t,i,e),this.If?.put(s,n)}catch(t){return null}return n};static ma=t=>{if(this.No){const i=this.No.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.No?.put(BigInt(t),i),i};id=-1;Au=-1;type=-1;na=-1;xl=0;width=0;height=0;gu=-1;ol=null;al=null;scripts=null;scroll=0;hide=!1;draggable=!1;_u=!1;Cu=!1;Wl=0;Gl=0;Fl=null;Bl=null;Jl=null;bu=null;fill=!1;oa=!1;font=null;aa=!1;text=null;sa=null;Ql=0;ea=0;ia=0;da=null;ua=null;model=null;Tu=null;gl=-1;Il=-1;zoom=0;Aa=0;_a=0;Ou=null;action=null;Ru=-1;Su=null;ml=null;Ol=null;Rl=null;x=0;y=0;Dl=0;Pl=null;Ul=null;Cl=0;_l=0;ma(t,i,e){let s=this.model;if(e&&(s=this.Tu),!s)return null;if(-1===t&&-1===i&&!s.Mu)return s;const r=n.A.ku(s,!0,!0,!1);return-1===t&&-1===i||r.Ga(),-1!==t&&r.Ya(t),-1!==i&&r.Ya(i),r.Ha(64,768,-50,-10,-50,!0),r}Du(){if(this.Au===this.id)return this.x;let t=c.Do[this.Au];if(!t.ml||!t.Ol||!t.Rl)return this.x;let i=t.ml.indexOf(this.id);if(-1===i)return this.x;let e=t.Ol[i];for(;t.Au!==t.id;){const s=c.Do[t.Au];s.ml&&s.Ol&&s.Rl&&(i=s.ml.indexOf(t.id),-1!==i&&(e+=s.Ol[i])),t=s}return e}Nu(){if(this.Au===this.id)return this.y;let t=c.Do[this.Au];if(!t.ml||!t.Ol||!t.Rl)return this.y;let i=t.ml.indexOf(this.id);if(-1===i)return this.y;let e=t.Rl[i];for(;t.Au!==t.id;){const s=c.Do[t.Au];s.ml&&s.Ol&&s.Rl&&(i=s.ml.indexOf(t.id),-1!==i&&(e+=s.Rl[i])),t=s}return e}outline(t){const i=this.Du(),e=this.Nu();a.A.Sl(i,e,this.width,this.height,t)}move(t,i){if(this.Au===this.id)return;this.x=0,this.y=0;const e=c.Do[this.Au];if(e.ml&&e.Ol&&e.Rl){const s=e.ml.indexOf(this.id);-1!==s&&(e.Ol[s]=t,e.Rl[s]=i)}}delete(){if(this.Au===this.id)return;const t=c.Do[this.Au];if(t.ml&&t.Ol&&t.Rl){const i=t.ml.indexOf(this.id);-1!==i&&(t.ml.splice(i,1),t.Ol.splice(i,1),t.Rl.splice(i,1))}}}},6333:(t,i,e)=>{e.d(i,{$:()=>s});class s{id;Fu=null;constructor(t){this.id=t}Bu(t){for(;;){const i=t.mu;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(6333);class r extends n.${static count=0;static Do=[];static yu=t=>{const i=new s.A(t.read('flo.dat'));this.count=i.pu;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static Uu=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static Wu=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);Gu=0;texture=-1;Yu=!1;Hu=!0;Vu=0;Ku=0;Xu=0;ju=0;zu=0;Zu=0;decode(t,i){1===t?(this.Gu=i.qu,this.setColor(this.Gu)):2===t?this.texture=i.mu:3===t?this.Yu=!0:5===t?this.Hu=!1:6===t?this.Fu=i.Eu:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(h=e),s>h&&(h=s);let o=0,l=0;const a=(n+h)/2;n!==h&&(a<.5&&(l=(h-n)/(h+n)),a>=.5&&(l=(h-n)/(2-h-n)),i===h?o=(e-s)/(h-n):e===h?o=(s-i)/(h-n)+2:s===h&&(o=(i-e)/(h-n)+4)),o/=6,this.Vu=256*o|0,this.Ku=256*l|0,this.Xu=256*a|0,this.Ku<0?this.Ku=0:this.Ku>255&&(this.Ku=255),this.Xu<0?this.Xu=0:this.Xu>255&&(this.Xu=255),this.ju=a>.5?(1-a)*l*512|0:a*l*512|0,this.ju<1&&(this.ju=1),this.zu=o*this.ju|0;let c=this.Vu+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.Ku+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.Xu+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.Zu=r.Pu(c,f,u)}}},8317:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(1069),n=e(6333),r=e(8665),h=e(3867);class o extends n.${static count=0;static Do=[];static yu=t=>{const i=new s.A(t.read('idk.dat'));this.count=i.pu;for(let t=0;t=40&&t<50?this.Qu[t-40]=i.pu:t>=50&&t<60?this.td[t-50]=i.pu:t>=60&&t<70?this.$u[t-60]=i.pu:console.log('Error unrecognised config code: ',t)}ma(){if(!this.Ju)return null;const t=new h.fe(this.Ju.length,null);for(let i=0;i{e.d(i,{A:()=>c});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(1023),l=e(6169),a=e(3867);class c extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static hd=new r.A(500);static od=new r.A(30);static yu=t=>{this.sd=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.pu,this.nd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%10;const i=this.cache[this.rd];return this.sd.mf=this.nd[t],i.id=t,i.reset(),i.Bu(this.sd),i.ld||(i.ld=new Int32Array(1)),-1===i.ad&&i.ld&&(i.active=i.ld.length>0&&i.ld[0]===o.A.fd.id,i.ud&&(i.active=!0)),i};static So=()=>{this.hd=null,this.od=null,this.nd=null,this.cache=null,this.sd=null};Ju=null;ld=null;name=null;dd=null;Qu=null;td=null;width=1;length=1;wd=!0;yd=!0;active=!1;ad=-1;pd=!1;Ad=!1;Hu=!1;gl=-1;md=!1;gd=16;Id=0;_d=0;ud=null;Cd=-1;Ed=-1;vd=!1;bd=!0;Td=128;Od=128;Rd=128;Sd=0;Ld=0;xd=0;Md=0;kd=!1;decode(t,i){if(1===t){const t=i.mu;this.Ju=new Int32Array(t),this.ld=new Int32Array(t);for(let e=0;e=30&&t<39)this.ud||(this.ud=new a.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(40===t){const t=i.mu;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e=this.Ju.length)return null;let d=this.Ju[a];if(-1===d)return null;const w=this.vd!==i>3;w&&(d+=65536);let y=c.hd?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.Gd(),c.hd?.put(BigInt(d),y));const p=128!==this.Td||128!==this.Od||128!==this.Rd,A=0!==this.Ld||0!==this.xd||0!==this.Md;let m=h.A.ku(y,!this.Qu,!this.md,i===l.A.Yd&&-1===o&&!p&&!A);for(-1!==o&&(m.Ga(),m.Ya(o),m.Hd=null,m.Vd=null);i-- >0;)m.Kd();if(this.Qu&&this.td)for(let t=0;t{e.d(i,{A:()=>l});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(3867);class l extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static No=new r.A(30);static yu=t=>{this.sd=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.pu,this.nd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%20;const i=this.cache[this.rd]=new l(t);return this.sd.mf=this.nd[t],i.Bu(this.sd),i};static So=()=>{this.No=null,this.nd=null,this.cache=null,this.sd=null};name=null;dd=null;size=1;Ju=null;$u=null;md=!1;zd=-1;Zd=-1;qd=-1;Jd=-1;$d=-1;Qu=null;td=null;ud=null;Td=-1;Od=-1;Rd=-1;Qd=!0;tw=-1;iw=128;ew=128;decode(t,i){if(1===t){const t=i.mu;this.Ju=new Uint16Array(t);for(let e=0;e=30&&t<40)this.ud||(this.ud=new o.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(40===t){const t=i.mu;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e{e.d(i,{A:()=>u});var s=e(6333),n=e(1069),r=e(2511),h=e(2679),o=e(8665),l=e(4583),a=e(8950),c=e(9298),f=e(3867);class u extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static lw=!0;static No=new h.A(50);static aw=new h.A(200);static yu=(t,i)=>{this.lw=i,this.sd=new n.A(t.read('obj.dat'));const e=new n.A(t.read('obj.idx'));this.count=e.pu,this.nd=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%10;const i=this.cache[this.rd];return this.sd.mf=this.nd[t],i.id=t,i.reset(),i.Bu(this.sd),-1!==i.cw&&i.fw(),!this.lw&&i.members&&(i.name='Members Object',i.dd="Login to a members' server to use this object.",i.ud=null,i.uw=null),i};static So=()=>{this.No=null,this.aw=null,this.nd=null,this.cache=null,this.sd=null};static Yl=(t,i)=>{if(u.aw){let e=u.aw.get(BigInt(t));if(e&&e.dw!==i&&-1!==e.dw&&(e.ww(),e=null),e)return e}let e=u.get(t);if(e.yw||(i=-1),e.yw&&e.pw&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.pw[s]&&0!==e.pw[s]&&(t=e.yw[s]);-1!==t&&(e=u.get(t))}const s=new r.A(32,32),n=l.A.ya,h=l.A.pa,o=l.A.Aw,f=a.A.mw,d=a.A.gw,w=a.A.Iw,y=a.A.left,p=a.A.right,A=a.A.top,m=a.A.bottom;l.A._w=!1,a.A.bind(s.mw,32,32),a.A.fillRect(0,0,32,32,c.A.Zl),l.A.Fc();const g=e.Cw(1),I=l.A.sin[e.Ew]*e.bw>>16,_=l.A.cos[e.Ew]*e.bw>>16;g.Ia(0,e.Tw,e.Ow,e.Ew,e.Rw,I+(g.jd/2|0)+e.Sw,_+e.Sw);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.mw[t+32*i]&&(t>0&&s.mw[t+32*i-1]>1||i>0&&s.mw[t+32*(i-1)]>1||t<31&&s.mw[t+32*i+1]>1||i<31&&s.mw[t+32*(i+1)]>1)&&(s.mw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.mw[t+32*i]&&t>0&&i>0&&s.mw[t+32*(i-1)-1]>0&&(s.mw[t+32*i]=3153952);if(-1!==e.cw){const t=this.Yl(e.Lw,10),i=t.Xl,s=t.dw;t.Xl=32,t.dw=32,t.xw(5,5,22,22),t.Xl=i,t.dw=s}return u.aw?.put(BigInt(t),s),a.A.bind(f,d,w),a.A.Tl(y,A,p,m),l.A.ya=n,l.A.pa=h,l.A.Aw=o,l.A._w=!0,e.Ea?s.Xl=33:s.Xl=32,s.dw=i,s};model=0;name=null;dd=null;Qu=null;td=null;bw=2e3;Ew=0;Tw=0;Ow=0;Rw=0;Sw=0;Mw=!1;kw=-1;Ea=!1;Dw=1;members=!1;ud=null;uw=null;Nw=-1;Fw=-1;Bw=0;Pw=-1;Uw=-1;Ww=0;Gw=-1;Yw=-1;Hw=-1;Vw=-1;Kw=-1;Xw=-1;yw=null;pw=null;Lw=-1;cw=-1;decode(t,i){if(1===t)this.model=i.pu;else if(2===t)this.name=i.Eu;else if(3===t)this.dd=i.Eu;else if(4===t)this.bw=i.pu;else if(5===t)this.Ew=i.pu;else if(6===t)this.Tw=i.pu;else if(7===t)this.Rw=i.Iu,this.Rw>32767&&(this.Rw-=65536);else if(8===t)this.Sw=i.Iu,this.Sw>32767&&(this.Sw-=65536);else if(9===t)this.Mw=!0;else if(10===t)this.kw=i.pu;else if(11===t)this.Ea=!0;else if(12===t)this.Dw=i.il;else if(16===t)this.members=!0;else if(23===t)this.Nw=i.pu,this.Bw=i.Dd;else if(24===t)this.Fw=i.pu;else if(25===t)this.Pw=i.pu,this.Ww=i.Dd;else if(26===t)this.Uw=i.pu;else if(t>=30&&t<35)this.ud||(this.ud=new f.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(t>=35&&t<40)this.uw||(this.uw=new f.fe(5,null)),this.uw[t-35]=i.Eu;else if(40===t){const t=i.mu;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.yw&&this.pw||(this.yw=new Uint16Array(10),this.pw=new Uint16Array(10)),this.yw[t-100]=i.pu,this.pw[t-100]=i.pu)}jw(t){let i=this.Nw;if(1===t&&(i=this.Pw),-1===i)return null;let e=this.Fw,s=this.Gw;1===t&&(e=this.Uw,s=this.Yw);let n=o.A.model(i);if(-1!==e){const t=o.A.model(e);if(-1===s){const i=[n,t];n=o.A.Fa(i,2)}else{const i=[n,t,o.A.model(s)];n=o.A.Fa(i,3)}}if(0===t&&0!==this.Bw&&n.translate(this.Bw,0,0),1===t&&0!==this.Ww&&n.translate(this.Ww,0,0),this.Qu&&this.td)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.pw[e]&&0!==this.pw[e]&&(i=this.yw[e]);if(-1!==i)return u.get(i).Cw(1)}if(u.No){const t=u.No.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.Qu&&this.td)for(let t=0;t{e.d(i,{A:()=>h});var s=e(6333),n=e(1069),r=e(6730);class h extends s.${static count=0;static Do=[];static yu=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.pu;for(let t=0;t{e.d(i,{A:()=>l});var s=e(6333),n=e(1069),r=e(1312),h=e(8665),o=e(2679);class l extends s.${static count=0;static Do=[];static No=new o.A(30);static yu=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.pu;for(let t=0;t=40&&t<50?this.Qu[t-40]=i.pu:t>=50&&t<60?this.td[t-50]=i.pu:console.log('Error unrecognised spotanim config code: ',t)}ma(){let t=l.No?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let i=0;i<6;i++)0!==this.Qu[0]&&t.Ba(this.Qu[i],this.td[i]);return l.No?.put(BigInt(this.id),t),t}}},3764:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(6333),n=e(1069);class r extends s.${static count=0;static Do=[];static ty=[];static iy=0;static yu=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.pu;for(let t=0;t{e.d(i,{A:()=>s});class s{static OPEN=0;static ly=1;static uy=2;static wy=4;static yy=8;static py=s.ly<<4;static Ay=s.uy<<4;static my=s.wy<<4;static gy=s.yy<<4;static Iy=256;static _y=512;static Cy=1024;static Ey=2048;static vy=4096;static by=s._y<<4;static Ty=s.Cy<<4;static Oy=s.Ey<<4;static Ry=s.vy<<4;static Sy=s.Iy<<9;static Ly=524288;static xy=2097152;static My=s.xy|s.Ly;static ky=s.Iy|s.My;static Dy=s.uy|s.ky;static Ny=s.yy|s.ky;static Fy=s.uy|s.wy|s.Ny;static By=s.Ay|s.ky;static Py=s.yy|s.py|s.By;static Uy=s.gy|s.ky;static Wy=s.ly|s.uy|s.Uy;static Gy=s.Ay|s.my|s.Uy;static Yy=16777215}},670:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(9456),n=e(6169),r=e(1023),h=e(4909);class o{static Dr=4;static jr=104;static index=(t,i)=>t*o.jr+i;offsetX;Hy;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Hy=0,this.sizeX=o.jr,this.sizeZ=o.jr,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.Hy)]|=s.A.xy};Ky=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.Hy)]&=~s.A.xy};Xy=(t,i,e,r,h,o)=>{let l=s.A.Iy;o&&(l|=s.A.Sy);const a=t-this.offsetX,c=i-this.Hy;if(h===n.A.jy||h===n.A.zy){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{let l=s.A.Iy;o&&(l|=s.A.Sy);const a=t-this.offsetX,c=i-this.Hy;if(h===n.A.jy||h===n.A.zy){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{const l=t-this.offsetX,a=i-this.Hy,c=o?s.A.Ry:s.A.gy,f=o?s.A.vy:s.A.yy,u=o?s.A.Cy:s.A.uy,d=o?s.A.Ty:s.A.Ay,w=o?s.A._y:s.A.ly,y=o?s.A.by:s.A.py,p=o?s.A.Ey:s.A.wy,A=o?s.A.Oy:s.A.my;e===r.A.Jy.id?h===n.A.Yd?(this.add(l,a,c),this.add(l-1,a,f)):h===n.A.jy?(this.add(l,a,u),this.add(l,a+1,d)):h===n.A.$y?(this.add(l,a,f),this.add(l+1,a,c)):h===n.A.zy&&(this.add(l,a,d),this.add(l,a-1,u)):e===r.A.Qy.id||e===r.A.tp.id?h===n.A.Yd?(this.add(l,a,w),this.add(l-1,a+1,y)):h===n.A.jy?(this.add(l,a,p),this.add(l+1,a+1,A)):h===n.A.$y?(this.add(l,a,y),this.add(l+1,a-1,w)):h===n.A.zy&&(this.add(l,a,A),this.add(l-1,a-1,p)):e===r.A.ip.id&&(h===n.A.Yd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):h===n.A.jy?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):h===n.A.$y?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):h===n.A.zy&&(this.add(l,a,d|c),this.add(l,a-1,u),this.add(l-1,a,f))),o&&this.qy(t,i,e,h,!1)};ep=(t,i,e,h,o)=>{const l=t-this.offsetX,a=i-this.Hy,c=o?s.A.Ry:s.A.gy,f=o?s.A.vy:s.A.yy,u=o?s.A.Cy:s.A.uy,d=o?s.A.Ty:s.A.Ay,w=o?s.A._y:s.A.ly,y=o?s.A.by:s.A.py,p=o?s.A.Ey:s.A.wy,A=o?s.A.Oy:s.A.my;e===r.A.Jy.id?h===n.A.Yd?(this.remove(l,a,c),this.remove(l-1,a,f)):h===n.A.jy?(this.remove(l,a,u),this.remove(l,a+1,d)):h===n.A.$y?(this.remove(l,a,f),this.remove(l+1,a,c)):h===n.A.zy&&(this.remove(l,a,d),this.remove(l,a-1,u)):e===r.A.Qy.id||e===r.A.tp.id?h===n.A.Yd?(this.remove(l,a,w),this.remove(l-1,a+1,y)):h===n.A.jy?(this.remove(l,a,p),this.remove(l+1,a+1,A)):h===n.A.$y?(this.remove(l,a,y),this.remove(l+1,a-1,w)):h===n.A.zy&&(this.remove(l,a,A),this.remove(l-1,a-1,p)):e===r.A.ip.id&&(h===n.A.Yd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):h===n.A.jy?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):h===n.A.$y?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):h===n.A.zy&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.ep(t,i,e,h,!1)};sp=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Hy,u=e-this.offsetX,d=h-this.Hy,w=o.index(c,f);if(l===r.A.Jy.id){if(a===n.A.Yd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(a===n.A.jy){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0}else if(a===n.A.$y){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(a===n.A.zy){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0}}else if(l===r.A.ip.id){if(a===n.A.Yd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(a===n.A.jy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(a===n.A.$y){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(a===n.A.zy){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===r.A.np.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0}return!1};rp=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Hy,u=e-this.offsetX,d=h-this.Hy,w=o.index(c,f);if(l===r.A.hp.id||l===r.A.op.id){if(l===r.A.op.id&&(a=a+2&3),a===n.A.Yd){if(c===u+1&&f===d&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0}else if(a===n.A.jy){if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0}else if(a===n.A.$y){if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0}else if(a===n.A.zy){if(c===u+1&&f===d&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0}}else if(l===r.A.lp.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0}return!1};ap=(t,i,e,n,r,l,a)=>{const c=e+r-1,f=n+l-1,u=o.index(t-this.offsetX,i-this.Hy);return t>=e&&t<=c&&i>=n&&i<=f||(t===e-1&&i>=n&&i<=f&&(this.flags[u]&s.A.yy)===s.A.OPEN&&(a&h.A.Yd)===s.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&s.A.gy)===s.A.OPEN&&(a&h.A.$y)===s.A.OPEN||(i===n-1&&t>=e&&t<=c&&(this.flags[u]&s.A.uy)===s.A.OPEN&&(a&h.A.zy)===s.A.OPEN||i===f+1&&t>=e&&t<=c&&(this.flags[u]&s.A.Ay)===s.A.OPEN&&(a&h.A.jy)===s.A.OPEN)))};add=(t,i,e)=>{this.flags[o.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[o.index(t,i)]&=s.A.Yy-e}}},4909:(t,i,e)=>{e.d(i,{A:()=>s});class s{static jy=1;static $y=2;static zy=4;static Yd=8}},6169:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Yd=0;static jy=1;static $y=2;static zy=3}},5599:(t,i,e)=>{e.d(i,{A:()=>s});class s{static cp=0;static fp=1;static up=2;static dp=3}},1023:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5599);class n{static Jy=new n(0,s.A.cp);static Qy=new n(1,s.A.cp);static ip=new n(2,s.A.cp);static tp=new n(3,s.A.cp);static wp=new n(4,s.A.fp);static yp=new n(5,s.A.fp);static hp=new n(6,s.A.fp);static op=new n(7,s.A.fp);static lp=new n(8,s.A.fp);static np=new n(9,s.A.up);static fd=new n(10,s.A.up);static pp=new n(11,s.A.up);static Ap=new n(12,s.A.up);static mp=new n(13,s.A.up);static gp=new n(14,s.A.up);static Ip=new n(15,s.A.up);static _p=new n(16,s.A.up);static Cp=new n(17,s.A.up);static Ep=new n(18,s.A.up);static vp=new n(19,s.A.up);static bp=new n(20,s.A.up);static Tp=new n(21,s.A.up);static dp=new n(22,s.A.dp);static values(){return[this.Jy,this.Qy,this.Cp,this.Ip,this.ip,this.gp,this.np,this.tp,this.dp,this.Ap,this.pp,this.hp,this.bp,this.fd,this.yp,this.mp,this.op,this.wp,this._p,this.lp,this.vp,this.Tp,this.Ep]}static of(t){const i=this.values();for(let e=0;e{e.d(i,{A:()=>p});var s=e(670),n=e(2164),r=e(1069),h=e(4583),o=e(3045),l=e(5637),a=e(4197),c=e(1312),f=e(1023),u=e(6169),d=e(9298),w=e(5518),y=e(3867);class p{static Op=Int8Array.of(1,2,4,8);static Rp=Uint8Array.of(16,32,64,128);static Sp=Int8Array.of(1,0,-1,0);static Lp=Int8Array.of(0,-1,0,1);static xp=(17*Math.random()|0)-8;static Mp=(33*Math.random()|0)-16;static et=!0;static kp=0;static Dp=!1;static Np=(t,i)=>{let e=this.Fp(t+45365,i+91923,4)+(this.Fp(t+10294,i+37821,2)-128>>1)+(this.Fp(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static Fp=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.Bp(s,r),l=this.Bp(s+1,r),a=this.Bp(s,r+1),c=this.Bp(s+1,r+1),f=this.Pp(o,l,n,e),u=this.Pp(a,c,n,e);return this.Pp(f,u,h,e)};static Pp=(t,i,e,s)=>{const n=65536-h.A.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static Bp=(t,i)=>((this.Up(t-1,i-1)+this.Up(t+1,i-1)+this.Up(t-1,i+1)+this.Up(t+1,i+1))/16|0)+((this.Up(t-1,i)+this.Up(t+1,i)+this.Up(t,i-1)+this.Up(t,i+1))/8|0)+(this.Up(t,i)/4|0);static Up=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static Xy=(t,i,e,s,n,r,h,o,d,w,y)=>{const A=n[y][i][e],m=n[y][i+1][e],g=n[y][i+1][e+1],I=n[y][i][e+1],_=A+m+g+I>>2,C=l.A.get(o);let E=i+(e<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A.dp.id)s?.Wp(C.ma(f.A.dp.id,w,A,m,g,I,-1),t,i,e,_,E,v),C.wd&&C.active&&h?.Vy(i,e),-1!==C.gl&&r.Gp(new a.A(o,t,3,i,e,c.A.Do[C.gl],!0));else if(d===f.A.fd.id||d===f.A.pp.id){const n=C.ma(f.A.fd.id,w,A,m,g,I,-1);if(n){let r,h,o=0;d===f.A.pp.id&&(o+=256),w===u.A.jy||w===u.A.zy?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.Xy(t,i,e,_,n,null,E,v,r,h,o)}C.wd&&h?.Xy(i,e,C.width,C.length,w,C.yd),-1!==C.gl&&r.Gp(new a.A(o,t,2,i,e,c.A.Do[C.gl],!0))}else if(d>=f.A.Ap.id)s?.Xy(t,i,e,_,C.ma(d,w,A,m,g,I,-1),null,E,v,1,1,0),C.wd&&h?.Xy(i,e,C.width,C.length,w,C.yd),-1!==C.gl&&r.Gp(new a.A(o,t,2,i,e,c.A.Do[C.gl],!0));else if(d===f.A.Jy.id)s?.qy(t,i,e,_,p.Op[w],0,C.ma(f.A.Jy.id,w,A,m,g,I,-1),null,E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C.gl&&r.Gp(new a.A(o,t,0,i,e,c.A.Do[C.gl],!0));else if(d===f.A.Qy.id)s?.qy(t,i,e,_,p.Rp[w],0,C.ma(f.A.Qy.id,w,A,m,g,I,-1),null,E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C.gl&&r.Gp(new a.A(o,t,0,i,e,c.A.Do[C.gl],!0));else if(d===f.A.ip.id){const n=w+1&3;s?.qy(t,i,e,_,p.Op[w],p.Op[n],C.ma(f.A.ip.id,w+4,A,m,g,I,-1),C.ma(f.A.ip.id,n,A,m,g,I,-1),E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C.gl&&r.Gp(new a.A(o,t,0,i,e,c.A.Do[C.gl],!0))}else if(d===f.A.tp.id)s?.qy(t,i,e,_,p.Rp[w],0,C.ma(f.A.tp.id,w,A,m,g,I,-1),null,E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C.gl&&r.Gp(new a.A(o,t,0,i,e,c.A.Do[C.gl],!0));else if(d===f.A.np.id)s?.Xy(t,i,e,_,C.ma(d,w,A,m,g,I,-1),null,E,v,1,1,0),C.wd&&h?.Xy(i,e,C.width,C.length,w,C.yd),-1!==C.gl&&r.Gp(new a.A(o,t,2,i,e,c.A.Do[C.gl],!0));else if(d===f.A.wp.id)s?.Yp(t,i,e,_,0,0,E,C.ma(f.A.wp.id,u.A.Yd,A,m,g,I,-1),v,512*w,p.Op[w]),-1!==C.gl&&r.Gp(new a.A(o,t,1,i,e,c.A.Do[C.gl],!0));else if(d===f.A.yp.id){let n=16;if(s){const r=s.Hp(t,i,e);r>0&&(n=l.A.get(r>>14&32767).gd)}s?.Yp(t,i,e,_,p.Sp[w]*n,p.Lp[w]*n,E,C.ma(f.A.wp.id,u.A.Yd,A,m,g,I,-1),v,512*w,p.Op[w]),-1!==C.gl&&r.Gp(new a.A(o,t,1,i,e,c.A.Do[C.gl],!0))}else d===f.A.hp.id?(s?.Yp(t,i,e,_,0,0,E,C.ma(f.A.wp.id,u.A.Yd,A,m,g,I,-1),v,w,256),-1!==C.gl&&r.Gp(new a.A(o,t,1,i,e,c.A.Do[C.gl],!0))):d===f.A.op.id?(s?.Yp(t,i,e,_,0,0,E,C.ma(f.A.wp.id,u.A.Yd,A,m,g,I,-1),v,w,512),-1!==C.gl&&r.Gp(new a.A(o,t,1,i,e,c.A.Do[C.gl],!0))):d===f.A.lp.id&&(s?.Yp(t,i,e,_,0,0,E,C.ma(f.A.wp.id,u.A.Yd,A,m,g,I,-1),v,w,768),-1!==C.gl&&r.Gp(new a.A(o,t,1,i,e,c.A.Do[C.gl],!0)))};Vp;Kp;Hr;Vr;Xp;jp;zp;Zp;qp;Jp;$p;Qp;tA;iA;eA;sA;constructor(t,i,e,n){this.Vp=t,this.Kp=i,this.Hr=e,this.Vr=n,this.Xp=new y.nA(s.A.Dr,t,i),this.jp=new y.nA(s.A.Dr,t,i),this.zp=new y.nA(s.A.Dr,t,i),this.Zp=new y.nA(s.A.Dr,t,i),this.sA=new y.rA(s.A.Dr,t+1,i+1),this.qp=new y.nA(s.A.Dr,t+1,i+1),this.Jp=new y.Xr(t+1,i+1),this.$p=new Int32Array(i),this.Qp=new Int32Array(i),this.tA=new Int32Array(i),this.iA=new Int32Array(i),this.eA=new Int32Array(i)}hA=(t,i)=>{for(let t=0;t=0&&i[s]?.Vy(e,n)}p.xp+=(5*Math.random()|0)-2,p.xp<-8?p.xp=-8:p.xp>8&&(p.xp=8),p.Mp+=(5*Math.random()|0)-2,p.Mp<-16?p.Mp=-16:p.Mp>16&&(p.Mp=16);for(let i=0;i>8;for(let t=1;t>2)+(e[n+1][t]>>3)+(e[n][t-1]>>2)+(e[n][t+1]>>3)+(e[n][t]>>1);this.Jp[n][t]=u-d}for(let t=0;t=0&&s0){const i=n.A.Do[e-1];this.$p[t]+=i.zu,this.Qp[t]+=i.Ku,this.tA[t]+=i.Xu,this.iA[t]+=i.ju,r=this.eA[t]++}}const h=e-5;if(h>=0&&h0){const i=n.A.Do[e-1];this.$p[t]-=i.zu,this.Qp[t]-=i.Ku,this.tA[t]-=i.Xu,this.iA[t]-=i.ju,r=this.eA[t]--}}}if(e>=1&&e=0&&f=0&&y=1&&c0||y>0){const A=this.Hr[i][e][c],m=this.Hr[i][e+1][c],g=this.Hr[i][e+1][c+1],I=this.Hr[i][e][c+1],_=this.Jp[e][c],C=this.Jp[e+1][c],E=this.Jp[e+1][c+1],v=this.Jp[e][c+1];let b=-1,T=-1;if(f>0){const t=256*s/l|0,i=r/a|0;let e=o/a|0;b=n.A.Pu(t,i,e);const h=t+p.xp&255;e+=p.Mp,e<0?e=0:e>255&&(e=255),T=n.A.Pu(h,i,e)}if(i>0){let t=0!==f||this.zp[i][e][c]===w.A.lA;y>0&&!n.A.Do[y-1].Hu&&(t=!1),t&&A===m&&A===g&&A===I&&(this.sA[i][e][c]|=2340)}let O=0;if(-1!==b&&(O=h.A.palette[n.A.Uu(T,96)]),0===y)t?.aA(i,e,c,w.A.lA,u.A.Yd,-1,A,m,g,I,n.A.Uu(b,_),n.A.Uu(b,C),n.A.Uu(b,E),n.A.Uu(b,v),d.A.Zl,d.A.Zl,d.A.Zl,d.A.Zl,O,d.A.Zl);else{const s=this.zp[i][e][c]+1,r=this.Zp[i][e][c],o=n.A.Do[y-1];let l,a,f=o.texture;f>=0?(a=h.A.cA(f),l=-1):o.Gu===d.A.fA?(a=0,l=-2,f=-1):(l=n.A.Pu(o.Vu,o.Ku,o.Xu),a=h.A.palette[n.A.Wu(o.Zu,96)]),t?.aA(i,e,c,s,r,f,A,m,g,I,n.A.Uu(b,_),n.A.Uu(b,C),n.A.Uu(b,E),n.A.Uu(b,v),n.A.Wu(l,_),n.A.Wu(l,C),n.A.Wu(l,E),n.A.Wu(l,v),O,a)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let s=0;s<=n;s++)for(let r=0;r<=this.Kp;r++)for(let h=0;h<=this.Vp;h++){if(this.sA[s][h][r]&t){let i=r,e=r,l=s,a=s;for(;i>0&&this.sA[s][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.sA[l-1][h][s]&t))break t;l--}t:for(;a=8){const s=this.Hr[a][h][i]-240,r=this.Hr[l][h][i];o.A.yA(n,1,128*h,s,128*i,128*h,r,128*e+128);for(let s=l;s<=a;s++)for(let n=i;n<=e;n++)this.sA[s][h][n]&=~t}}if(this.sA[s][h][r]&i){let t=h,e=h,l=s,a=s;for(;t>0&&this.sA[s][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.sA[l-1][s][r]&i))break t;l--}t:for(;a=8){const s=this.Hr[a][t][r]-240,h=this.Hr[l][t][r];o.A.yA(n,2,128*t,s,128*r,128*e+128,h,128*r);for(let s=l;s<=a;s++)for(let n=t;n<=e;n++)this.sA[s][n][r]&=~i}}if(this.sA[s][h][r]&e){let t=h,i=h,l=r,a=r;for(;l>0&&this.sA[s][h][l-1]&e;)l--;for(;a0;){for(let i=l;i<=a;i++)if(!(this.sA[s][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.Hr[s][t][l];o.A.yA(n,4,128*t,r,128*l,128*i+128,r,128*a+128);for(let n=t;n<=i;n++)for(let t=l;t<=a;t++)this.sA[s][n][t]&=~e}}}}}};pA=(t,i,e,r)=>{let h=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new r.A(new Uint8Array(h));for(let r=0;r=0&&a=0&&c>24,this.Zp[r][a][c]=(f-2&3)<<24>>24):f<=81?this.Vr[r][a][c]=f-49<<24>>24:this.Xp[r][a][c]=f-81<<24>>24}else for(;f=o.mu,0!==f;){if(1===f){o.mu;break}f<=49&&o.mu}}};mA=(t,i,e,n,h,o)=>{const l=new r.A(new Uint8Array(n));let a=-1;for(;;){const n=l.gA;if(0===n)return;a+=n;let r=0;for(;;){const n=l.gA;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=l.mu,w=d>>2,y=3&d,p=f+h,A=c+o;if(p>0&&A>0&&p=0&&(n=e[s]),this.Xy(u,p,A,t,i,n,a,w,y)}}}};Xy=(t,i,e,s,n,r,h,o,d)=>{if(p.et){if(16&this.Vr[t][i][e])return;if(this.oA(t,i,e)!==p.kp)return}const w=this.Hr[t][i][e],y=this.Hr[t][i+1][e],A=this.Hr[t][i+1][e+1],m=this.Hr[t][i][e+1],g=w+y+A+m>>2,I=l.A.get(h);let _=i+(e<<7)+(h<<14)+1073741824|0;I.active||(_+=-2147483648),_|=0;const C=(d<<6)+o<<24>>24;if(o===f.A.dp.id)(!p.et||I.active||I.kd)&&(s?.Wp(I.ma(f.A.dp.id,d,w,y,A,m,-1),t,i,e,g,_,C),I.wd&&I.active&&r?.Vy(i,e),-1!==I.gl&&n.Gp(new a.A(h,t,3,i,e,c.A.Do[I.gl],!0)));else if(o===f.A.fd.id||o===f.A.pp.id){const l=I.ma(f.A.fd.id,d,w,y,A,m,-1);if(l){let n,r,h=0;if(o===f.A.pp.id&&(h+=256),d===u.A.jy||d===u.A.zy?(n=I.length,r=I.width):(n=I.width,r=I.length),s?.Xy(t,i,e,g,l,null,_,C,n,r,h)&&I.bd)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=l.IA/4|0;r>30&&(r=30),r>this.qp[t][i+s][e+n]&&(this.qp[t][i+s][e+n]=r<<24>>24)}}I.wd&&r?.Xy(i,e,I.width,I.length,d,I.yd),-1!==I.gl&&n.Gp(new a.A(h,t,2,i,e,c.A.Do[I.gl],!0))}else if(o>=f.A.Ap.id)s?.Xy(t,i,e,g,I.ma(o,d,w,y,A,m,-1),null,_,C,1,1,0),o>=f.A.Ap.id&&o<=f.A.Cp.id&&o!==f.A.mp.id&&t>0&&(this.sA[t][i][e]|=2340),I.wd&&r?.Xy(i,e,I.width,I.length,d,I.yd),-1!==I.gl&&n.Gp(new a.A(h,t,2,i,e,c.A.Do[I.gl],!0));else if(o===f.A.Jy.id)s?.qy(t,i,e,g,p.Op[d],0,I.ma(f.A.Jy.id,d,w,y,A,m,-1),null,_,C),d===u.A.Yd?(I.bd&&(this.qp[t][i][e]=50,this.qp[t][i][e+1]=50),I.Hu&&(this.sA[t][i][e]|=585)):d===u.A.jy?(I.bd&&(this.qp[t][i][e+1]=50,this.qp[t][i+1][e+1]=50),I.Hu&&(this.sA[t][i][e+1]|=1170)):d===u.A.$y?(I.bd&&(this.qp[t][i+1][e]=50,this.qp[t][i+1][e+1]=50),I.Hu&&(this.sA[t][i+1][e]|=585)):d===u.A.zy&&(I.bd&&(this.qp[t][i][e]=50,this.qp[t][i+1][e]=50),I.Hu&&(this.sA[t][i][e]|=1170)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I.gl&&n.Gp(new a.A(h,t,0,i,e,c.A.Do[I.gl],!0)),16!==I.gd&&s?._A(t,i,e,I.gd);else if(o===f.A.Qy.id)s?.qy(t,i,e,g,p.Rp[d],0,I.ma(f.A.Qy.id,d,w,y,A,m,-1),null,_,C),I.bd&&(d===u.A.Yd?this.qp[t][i][e+1]=50:d===u.A.jy?this.qp[t][i+1][e+1]=50:d===u.A.$y?this.qp[t][i+1][e]=50:d===u.A.zy&&(this.qp[t][i][e]=50)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I.gl&&n.Gp(new a.A(h,t,0,i,e,c.A.Do[I.gl],!0));else if(o===f.A.ip.id){const l=d+1&3;s?.qy(t,i,e,g,p.Op[d],p.Op[l],I.ma(f.A.ip.id,d+4,w,y,A,m,-1),I.ma(f.A.ip.id,l,w,y,A,m,-1),_,C),I.Hu&&(d===u.A.Yd?(this.sA[t][i][e]|=265,this.sA[t][i][e+1]|=1170):d===u.A.jy?(this.sA[t][i][e+1]|=1170,this.sA[t][i+1][e]|=585):d===u.A.$y?(this.sA[t][i+1][e]|=585,this.sA[t][i][e]|=1170):d===u.A.zy&&(this.sA[t][i][e]|=1170,this.sA[t][i][e]|=585)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I.gl&&n.Gp(new a.A(h,t,0,i,e,c.A.Do[I.gl],!0)),16!==I.gd&&s?._A(t,i,e,I.gd)}else if(o===f.A.tp.id)s?.qy(t,i,e,g,p.Rp[d],0,I.ma(f.A.tp.id,d,w,y,A,m,-1),null,_,C),I.bd&&(d===u.A.Yd?this.qp[t][i][e+1]=50:d===u.A.jy?this.qp[t][i+1][e+1]=50:d===u.A.$y?this.qp[t][i+1][e]=50:d===u.A.zy&&(this.qp[t][i][e]=50)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I.gl&&n.Gp(new a.A(h,t,0,i,e,c.A.Do[I.gl],!0));else if(o===f.A.np.id)s?.Xy(t,i,e,g,I.ma(o,d,w,y,A,m,-1),null,_,C,1,1,0),I.wd&&r?.Xy(i,e,I.width,I.length,d,I.yd),-1!==I.gl&&n.Gp(new a.A(h,t,2,i,e,c.A.Do[I.gl],!0));else if(o===f.A.wp.id)s?.Yp(t,i,e,g,0,0,_,I.ma(f.A.wp.id,u.A.Yd,w,y,A,m,-1),C,512*d,p.Op[d]),-1!==I.gl&&n.Gp(new a.A(h,t,1,i,e,c.A.Do[I.gl],!0));else if(o===f.A.yp.id){let r=16;if(s){const n=s.Hp(t,i,e);n>0&&(r=l.A.get(n>>14&32767).gd)}s?.Yp(t,i,e,g,p.Sp[d]*r,p.Lp[d]*r,_,I.ma(f.A.wp.id,u.A.Yd,w,y,A,m,-1),C,512*d,p.Op[d]),-1!==I.gl&&n.Gp(new a.A(h,t,1,i,e,c.A.Do[I.gl],!0))}else o===f.A.hp.id?(s?.Yp(t,i,e,g,0,0,_,I.ma(f.A.wp.id,u.A.Yd,w,y,A,m,-1),C,d,256),-1!==I.gl&&n.Gp(new a.A(h,t,1,i,e,c.A.Do[I.gl],!0))):o===f.A.op.id?(s?.Yp(t,i,e,g,0,0,_,I.ma(f.A.wp.id,u.A.Yd,w,y,A,m,-1),C,d,512),-1!==I.gl&&n.Gp(new a.A(h,t,1,i,e,c.A.Do[I.gl],!0))):o===f.A.lp.id&&(s?.Yp(t,i,e,g,0,0,_,I.ma(f.A.wp.id,u.A.Yd,w,y,A,m,-1),C,d,768),-1!==I.gl&&n.Gp(new a.A(h,t,1,i,e,c.A.Do[I.gl],!0)))};oA=(t,i,e)=>8&this.Vr[t][i][e]?0:t<=0||!(2&this.Vr[1][i][e])?t:t-1}},3045:(t,i,e)=>{e.d(i,{A:()=>g});var s=e(4583),n=e(1161),r=e(3795),h=e(8256),o=e(670),l=e(9222),a=e(6855),c=e(7441),f=e(6666),u=e(5748),d=e(3479),w=e(8950),y=e(2771),p=e(5518),A=e(6169),m=e(3867);class g{static CA=new m.EA(8,32,51,51,!1);static vA=new m.fe(100,null);static bA=new Int32Array(o.A.Dr);static TA=new m.OA(o.A.Dr,500,null);static RA=new m.fe(500,null);static SA=new f.A;static LA=0;static xA=0;static MA=0;static kA=0;static DA=0;static NA=0;static FA=0;static BA=0;static PA=0;static UA=0;static WA=0;static GA=0;static YA=0;static HA=0;static VA=0;static KA=0;static XA=0;static jA=0;static zA=0;static ZA=0;static qA=0;static JA=0;static $A=!1;static QA=null;static tm=Uint8Array.of(19,55,38,155,255,110,137,205,76);static im=Uint8Array.of(160,192,80,96,0,144,80,48,160);static sm=Uint8Array.of(76,8,137,4,0,1,38,2,19);static nm=Int8Array.of(0,0,2,0,0,2,1,1,0);static rm=Int8Array.of(2,0,0,2,0,0,0,4,4);static hm=Int8Array.of(0,4,4,8,0,0,8,0,0);static om=Int8Array.of(1,1,0,0,0,8,0,0,8);static lm=Int8Array.of(53,-53,-53,53);static am=Int8Array.of(-53,-53,53,53);static fm=Int8Array.of(-45,45,45,-45);static um=Int8Array.of(45,45,-45,-45);static dm=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static wm=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static ym=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static pm=0;static Hl=0;static Vl=0;static Am=-1;static gm=-1;static et=!0;static init=(t,i,e,n,r)=>{this.xA=0,this.MA=0,this.kA=t,this.DA=i,this.NA=t/2|0,this.FA=i/2|0;const h=new m.EA(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.BA=s.A.sin[t],this.PA=s.A.cos[t],this.UA=s.A.sin[i],this.WA=s.A.cos[i];const o=(t-128)/32|0,l=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const s=128*t,a=128*i;let c=!1;for(let t=-e;t<=n;t+=128)if(this.Im(s,a,r[o]+t)){c=!0;break}h[o][l][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let r=-1;r<=1;r++)for(let o=-1;o<=1;o++){if(h[t][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}}this.CA[t][i][e+25][s+25]=n}};static So=()=>{this.vA=null,this.bA=null,this.TA=null,this.SA=null,this.CA=null,this.RA=null,this.QA=null,console.log('World3D unloaded!')};static yA=(t,i,e,s,n,r,o,l)=>{g.TA[t][g.bA[t]++]=new h.A(e/128|0,r/128|0,n/128|0,l/128|0,i,e,r,n,l,s,o)};static Im=(t,i,e)=>{const s=i*this.UA+t*this.WA>>16,n=i*this.WA-t*this.UA>>16,r=e*this.BA+n*this.PA>>16,h=e*this.PA-n*this.BA>>16;if(r<50||r>3500)return!1;const o=this.NA+((s<<9)/r|0),l=this.FA+((h<<9)/r|0);return o>=this.xA&&o<=this.kA&&l>=this.MA&&l<=this.DA};_m;Vp;Kp;Cm;Em;_h;vm;bm;Tm;Om=0;Rm=0;Sm=0;constructor(t,i,e,s){this._m=e,this.Vp=s,this.Kp=i,this.Em=new m.Eh(e,s,i,null),this.vm=new m.rA(e,s+1,i+1),this.Cm=t,this._h=new m.fe(5e3,null),this.bm=new Int32Array(1e4),this.Tm=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.Rm=t;for(let i=0;i{const e=this.Em[0][t][i];for(let e=0;e<3;e++){this.Em[e][t][i]=this.Em[e+1][t][i];const s=this.Em[e][t][i];s&&s.level--}this.Em[0][t][i]||(this.Em[0][t][i]=new r.A(0,t,i));const s=this.Em[0][t][i];s&&(s.xm=e),this.Em[3][t][i]=null};uA=(t,i,e,s)=>{const n=this.Em[t][i][e];n&&(n.Mm=s)};aA=(t,i,e,s,n,h,o,l,a,c,f,u,w,A,m,g,I,_,C,E)=>{if(s===p.A.lA){for(let s=t;s>=0;s--)this.Em[s][i][e]||(this.Em[s][i][e]=new r.A(s,i,e));const s=this.Em[t][i][e];s&&(s.km=new d.A(f,u,w,A,-1,C,!1))}else if(s===p.A.Dm){for(let s=t;s>=0;s--)this.Em[s][i][e]||(this.Em[s][i][e]=new r.A(s,i,e));const s=this.Em[t][i][e];s&&(s.km=new d.A(m,g,I,_,h,E,o===l&&o===a&&o===c))}else{for(let s=t;s>=0;s--)this.Em[s][i][e]||(this.Em[s][i][e]=new r.A(s,i,e));const d=this.Em[t][i][e];d&&(d.Nm=new y.A(i,s,g,l,w,n,f,c,E,m,h,_,C,a,I,A,o,e,u))}};Wp=(t,i,e,s,n,h,o)=>{this.Em[i][e][s]||(this.Em[i][e][s]=new r.A(i,e,s));const a=this.Em[i][e][s];a&&(a.Fm=new l.A(n,128*e+64,128*s+64,t,h,o))};Bm=(t,i,e)=>{const s=this.Em[t][i][e];s&&(s.Fm=null)};Pm=(t,i,e,s,n,h,o,l)=>{let a=0;const c=this.Em[s][t][i];if(c)for(let t=0;ta&&(a=e)}else this.Em[s][t][i]=new r.A(s,t,i);const f=this.Em[s][t][i];f&&(f.Gm=new u.A(e,128*t+64,128*i+64,h,o,l,n,a))};Ym=(t,i,e)=>{const s=this.Em[t][i][e];s&&(s.Gm=null)};qy=(t,i,e,s,n,h,o,l,c,f)=>{if(!o&&!l)return;for(let s=t;s>=0;s--)this.Em[s][i][e]||(this.Em[s][i][e]=new r.A(s,i,e));const u=this.Em[t][i][e];u&&(u.Hm=new a.A(s,128*i+64,128*e+64,n,h,o,l,c,f))};ep=(t,i,e,s)=>{const n=this.Em[t][i][e];1===s&&n&&(n.Hm=null)};Yp=(t,i,e,s,n,h,o,l,a,f,u)=>{if(!l)return;for(let s=t;s>=0;s--)this.Em[s][i][e]||(this.Em[s][i][e]=new r.A(s,i,e));const d=this.Em[t][i][e];d&&(d.Vm=new c.A(s,128*i+n+64,128*e+h+64,u,f,l,o,a))};Km=(t,i,e)=>{const s=this.Em[t][i][e];s&&(s.Vm=null)};_A=(t,i,e,s)=>{const n=this.Em[t][i][e];if(!n)return;const r=n.Vm;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};Xm=(t,i,e,s)=>{if(!s)return;const n=this.Em[t][i][e];if(!n)return;const r=n.Vm;r&&(r.model=s)};jm=(t,i,e,s)=>{if(!s)return;const n=this.Em[t][i][e];if(!n)return;const r=n.Fm;r&&(r.model=s)};zm=(t,i,e,s)=>{if(!s)return;const n=this.Em[t][i][e];if(!n)return;const r=n.Hm;r&&(r.Zm=s)};qm=(t,i,e,s,n)=>{if(!s)return;const r=this.Em[e][t][i];if(!r)return;const h=r.Hm;h&&(h.Zm=s,h.Jm=n)};Xy=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!n&&!r)return!0;const f=128*i+64*l,u=128*e+64*a;return this.$m(f,u,s,t,i,e,l,a,n,r,h,o,c,!1)};Qm=(t,i,e,s,n,r,h,o,l,a)=>{if(!n&&!r)return!0;let c=i-l,f=s-l,u=i+l,d=s+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.$m(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};tg=(t,i,e,s,n,r,h,o,l,a,c,f)=>!l&&!a||this.$m(i,s,e,t,n,r,h+1-n,o-r+1,l,a,c,0,f,!0);Zy=(t,i,e)=>{const s=this.Em[t][i][e];if(s)for(let t=0;t>29&3)&&n.eg===i&&n.sg===e)return void this.ng(n)}};rg=(t,i,e,s)=>{if(!s)return;const n=this.Em[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};hg=()=>{for(let t=0;t{const s=this.Em[t][i][e];return s&&s.Hm?s.Hm.ig:0};og=(t,i,e)=>{const s=this.Em[t][e][i];return s&&s.Vm?s.Vm.ig:0};lg=(t,i,e)=>{const s=this.Em[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.eg===i&&n.sg===e)return n.ig}return 0};ag=(t,i,e)=>{const s=this.Em[t][i][e];return s&&s.Fm?s.Fm.ig:0};cg=(t,i,e,s)=>{const n=this.Em[t][i][e];if(n){if(n.Hm&&n.Hm.ig===s)return 255&n.Hm.info;if(n.Vm&&n.Vm.ig===s)return 255&n.Vm.info;if(n.Fm&&n.Fm.ig===s)return 255&n.Fm.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.Em[t][i+1][e-1];n&&n.Fm&&n.Fm.model&&n.Fm.model.fg&&this.dg(s,n.Fm.model,128,0,-128,!0)}};ug=(t,i,e,s,n,r)=>{let h=!0,o=i;const l=i+s,a=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this._m){for(let u=o;u<=l;u++)if(!(u<0||u>=this.Vp))for(let o=a;o<=c;o++){if(o<0||o>=this.Kp||h&&u=e||u===i))continue;const a=this.Em[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.Cm[f][u][o]+this.Cm[f][u+1][o]+this.Cm[f][u][o+1]+this.Cm[f][u+1][o+1])/4|0)-((this.Cm[t][i][e]+this.Cm[t][i+1][e]+this.Cm[t][i][e+1]+this.Cm[t][i+1][e+1])/4|0),p=a.Hm;p&&p.Zm&&p.Zm.fg&&this.dg(r,p.Zm,d,y,w,h),p&&p.Jm&&p.Jm.fg&&this.dg(r,p.Jm,d,y,w,h);for(let t=0;t{this.Sm++;let h=0;const o=i.Bd,l=i.Fd;if(t.fg&&t.mg)for(let r=0;ri.gg)continue;const u=t.Bd[r]-e;if(ui._g)continue;const d=t.Pd[r]-n;if(di.Eg)continue;if(i.fg&&i.mg)for(let t=0;t{const h=this.Em[t][i][e];if(!h)return;const o=h.km;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const l=h.Nm;if(!l)return;const a=l.shape,c=l.angle,f=l.Lg,u=l.xg,d=g.dm[a],w=g.wm[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{g.$A=!0,g.Hl=t,g.Vl=i,g.Am=-1,g.gm=-1};draw=(t,i,e,n,r,h,o)=>{t<0?t=0:t>=128*this.Vp&&(t=128*this.Vp-1),e<0?e=0:e>=128*this.Kp&&(e=128*this.Kp-1),g.LA++,g.BA=s.A.sin[h],g.PA=s.A.cos[h],g.UA=s.A.sin[r],g.WA=s.A.cos[r],g.QA=g.CA[(h-128)/32|0][r/64|0],g.GA=t,g.YA=i,g.HA=e,g.VA=t/128|0,g.KA=e/128|0,g.qA=n,g.XA=g.VA-25,g.XA<0&&(g.XA=0),g.zA=g.KA-25,g.zA<0&&(g.zA=0),g.jA=g.VA+25,g.jA>this.Vp&&(g.jA=this.Vp),g.ZA=g.KA+25,g.ZA>this.Kp&&(g.ZA=this.Kp),this.Mg(),g.JA=0;for(let t=this.Rm;t=2e3)?(h.visible=!0,h.update=!0,h.kg=h.Um>0,g.JA++):(h.visible=!1,h.update=!1,h.Dg=0))}}for(let t=this.Rm;t=g.jA))for(let t=-25;t<=0;t++){const n=g.KA+t,r=g.KA-t;let h;if(e>=g.XA&&(n>=g.zA&&(h=i[e][n],h&&h.visible&&this.Ng(h,!0,o)),r=g.zA&&(h=i[s][n],h&&h.visible&&this.Ng(h,!0,o)),r=g.jA))for(let t=-25;t<=0;t++){const n=g.KA+t,r=g.KA-t;let h;if(e>=g.XA&&(n>=g.zA&&(h=i[e][n],h&&h.visible&&this.Ng(h,!1,o)),r=g.zA&&(h=i[s][n],h&&h.visible&&this.Ng(h,!1,o)),r{if(!c&&!f)return!1;for(let t=h;t=this.Vp||i>=this.Kp)return!1;const e=this.Em[s][t][i];if(e&&e.Um>=5)return!1}const p=new n.A(s,e,t,i,c,f,w,h,h+l-1,o,o+a-1,u,d);for(let t=h;th&&(e|=1),to&&(e+=8),i=0;e--)this.Em[e][t][i]||(this.Em[e][t][i]=new r.A(e,t,i));const n=this.Em[s][t][i];n&&(n.Wm[n.Um]=p,n.Fg[n.Um]=e,n.Bg|=e,n.Um++)}return y&&(this._h[this.Om++]=p),!0};ng=t=>{for(let i=t.eg;i<=t.yg;i++)for(let e=t.sg;e<=t.pg;e++){const s=this.Em[t.level][i][e];if(s){for(let i=0;i{const t=g.bA[g.qA],i=g.TA[g.qA];g.pm=0;for(let e=0;e=0&&s<=50){n=t.Ug+25-g.KA,n<0&&(n=0),r=t.Kp+25-g.KA,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.QA&&g.QA[s][n++]){i=!0;break}if(i){if(h=g.GA-t.Ig,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.Wg=(t.Cg-g.HA<<8)/h|0,t.Gg=(t.Eg-g.HA<<8)/h|0,t.Yg=(t.gg-g.YA<<8)/h|0,t.Hg=(t.jd-g.YA<<8)/h|0,g.RA[g.pm++]=t}}}else if(2===t.type){if(s=t.Ug+25-g.KA,s>=0&&s<=50){n=t.Pg+25-g.VA,n<0&&(n=0),r=t.Vp+25-g.VA,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.QA&&g.QA[n++][s]){i=!0;break}if(i){if(h=g.HA-t.Cg,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.Vg=(t.Ig-g.GA<<8)/h|0,t.Kg=(t._g-g.GA<<8)/h|0,t.Yg=(t.gg-g.YA<<8)/h|0,t.Hg=(t.jd-g.YA<<8)/h|0,g.RA[g.pm++]=t}}}else if(4===t.type&&(s=t.gg-g.YA,s>128&&(n=t.Ug+25-g.KA,n<0&&(n=0),r=t.Kp+25-g.KA,r>50&&(r=50),n<=r))){let i=t.Pg+25-g.VA;i<0&&(i=0),h=t.Vp+25-g.VA,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(g.QA&&g.QA[t][i]){e=!0;break t}e&&(t.mode=5,t.Vg=(t.Ig-g.GA<<8)/s|0,t.Kg=(t._g-g.GA<<8)/s|0,t.Wg=(t.Cg-g.HA<<8)/s|0,t.Gg=(t.Eg-g.HA<<8)/s|0,g.RA[g.pm++]=t)}}};Ng=(t,i,e)=>{for(g.SA.Gp(t);;){let t;do{if(t=g.SA.Xg(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.jg,o=this.Em[r];if(t.visible){if(i){if(r>0){const t=this.Em[r-1][s][n];if(t&&t.update)continue}if(s<=g.VA&&s>g.XA){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.Bg)))continue}if(s>=g.VA&&sg.zA){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.Bg)))continue}if(n>=g.KA&&nn&&(a+=6),c=g.tm[a],t.Qg=g.sm[a]),f&&(f.tI&g.im[a]?16===f.tI?(t.Dg=3,t.iI=g.nm[a],t.eI=3-t.iI):32===f.tI?(t.Dg=6,t.iI=g.rm[a],t.eI=6-t.iI):64===f.tI?(t.Dg=12,t.iI=g.hm[a],t.eI=12-t.iI):(t.Dg=9,t.iI=g.om[a],t.eI=9-t.iI):t.Dg=0,f.tI&c&&!this.sI(h,s,n,f.tI)&&f.Zm?.draw(0,g.BA,g.PA,g.UA,g.WA,f.x-g.GA,f.y-g.YA,f.z-g.HA,f.ig),f.nI&c&&!this.sI(h,s,n,f.nI)&&f.Jm?.draw(0,g.BA,g.PA,g.UA,g.WA,f.x-g.GA,f.y-g.YA,f.z-g.HA,f.ig)),u&&!this.visible(h,s,n,u.model.jd))if(u.type&c)u.model.draw(u.angle,g.BA,g.PA,g.UA,g.WA,u.x-g.GA,u.y-g.YA,u.z-g.HA,u.ig);else if(768&u.type){const t=u.x-g.GA,i=u.y-g.YA,e=u.z-g.HA,s=u.angle;let n,r;if(n=s===A.A.jy||s===A.A.$y?-t:t,r=s===A.A.$y||s===A.A.zy?-e:e,256&u.type&&rn){const n=t+g.fm[s],r=e+g.um[s];u.model.draw(512*s+1280&2047,g.BA,g.PA,g.UA,g.WA,n,i,r,u.ig)}}if(l){const i=t.Fm;i&&i.model?.draw(0,g.BA,g.PA,g.UA,g.WA,i.x-g.GA,i.y-g.YA,i.z-g.HA,i.ig);const e=t.Gm;e&&0===e.offset&&(e.rI&&e.rI.draw(0,g.BA,g.PA,g.UA,g.WA,e.x-g.GA,e.y-g.YA,e.z-g.HA,e.ig),e.hI&&e.hI.draw(0,g.BA,g.PA,g.UA,g.WA,e.x-g.GA,e.y-g.YA,e.z-g.HA,e.ig),e.oI&&e.oI.draw(0,g.BA,g.PA,g.UA,g.WA,e.x-g.GA,e.y-g.YA,e.z-g.HA,e.ig))}const d=t.Bg;if(0!==d){if(sg.VA&&1&d){const t=o[s-1][n];t&&t.update&&g.SA.Gp(t)}if(n>g.KA&&8&d){const t=o[s][n-1];t&&t.update&&g.SA.Gp(t)}}}if(0!==t.Dg){let i=!0;for(let e=0;ei.eg&&(r+=1),ei.sg&&(r+=8),ss&&(s=n);const h=g.KA-i.sg,l=i.pg-g.KA;i.lI=l>h?s+l:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.lI,i=e))}if(-1===i)break;const l=g.vA[i];if(l){l.LA=g.LA;let t=l.model;t||(t=l.Jg?.draw(e)??null),t&&!this.aI(h,l.eg,l.yg,l.sg,l.pg,t.jd)&&t.draw(l.$g,g.BA,g.PA,g.UA,g.WA,l.x-g.GA,l.y-g.YA,l.z-g.HA,l.ig);for(let t=l.eg;t<=l.yg;t++)for(let i=l.sg;i<=l.pg;i++){const e=o[t][i];e&&(0!==e.Dg?g.SA.Gp(e):t===s&&i===n||!e.update||g.SA.Gp(e))}}}if(t.kg)continue}if(!t.update||0!==t.Dg)continue;if(s<=g.VA&&s>g.XA){const t=o[s-1][n];if(t&&t.update)continue}if(s>=g.VA&&sg.zA){const t=o[s][n-1];if(t&&t.update)continue}if(n>=g.KA&&n=r){const r=t+g.lm[n],h=s+g.am[n];i.model.draw(512*n+256,g.BA,g.PA,g.UA,g.WA,r,e,h,i.ig)}if(512&i.type&&h<=r){const r=t+g.fm[n],h=s+g.um[n];i.model.draw(512*n+1280&2047,g.BA,g.PA,g.UA,g.WA,r,e,h,i.ig)}}const e=t.Hm;e&&(e.nI&t.Qg&&!this.sI(h,s,n,e.nI)&&e.Jm?.draw(0,g.BA,g.PA,g.UA,g.WA,e.x-g.GA,e.y-g.YA,e.z-g.HA,e.ig),e.tI&t.Qg&&!this.sI(h,s,n,e.tI)&&e.Zm?.draw(0,g.BA,g.PA,g.UA,g.WA,e.x-g.GA,e.y-g.YA,e.z-g.HA,e.ig))}if(rg.VA){const t=o[s-1][n];t&&t.update&&g.SA.Gp(t)}if(n>g.KA){const t=o[s][n-1];t&&t.update&&g.SA.Gp(t)}}};Zg=(t,i,e,n,r,h,o,l)=>{let a,c,f,u,d=a=(e<<7)-g.GA,y=c=(n<<7)-g.HA,p=f=d+128,A=u=y+128,m=this.Cm[i][e][n]-g.YA,I=this.Cm[i][e+1][n]-g.YA,_=this.Cm[i][e+1][n+1]-g.YA,C=this.Cm[i][e][n+1]-g.YA,E=y*o+d*l>>16;if(y=y*l-d*o>>16,d=E,E=m*h-y*r>>16,y=m*r+y*h>>16,m=E,y<50)return;if(E=c*o+p*l>>16,c=c*l-p*o>>16,p=E,E=I*h-c*r>>16,c=I*r+c*h>>16,I=E,c<50)return;if(E=A*o+f*l>>16,A=A*l-f*o>>16,f=E,E=_*h-A*r>>16,A=_*r+A*h>>16,_=E,A<50)return;if(E=u*o+a*l>>16,u=u*l-a*o>>16,a=E,E=C*h-u*r>>16,u=C*r+u*h>>16,C=E,u<50)return;const v=s.A.ya+((d<<9)/y|0),b=s.A.pa+((m<<9)/y|0),T=s.A.ya+((p<<9)/c|0),O=s.A.pa+((I<<9)/c|0),R=s.A.ya+((f<<9)/A|0),S=s.A.pa+((_<<9)/A|0),L=s.A.ya+((a<<9)/u|0),x=s.A.pa+((C<<9)/u|0);if(s.A.alpha=0,(R-L)*(O-x)-(S-x)*(T-L)>0)if(s.A.cI=R<0||L<0||T<0||R>w.A.fI||L>w.A.fI||T>w.A.fI,g.$A&&this.uI(g.Hl,g.Vl,S,x,O,R,L,T)&&(g.Am=e,g.gm=n),-1===t.dI)12345678!==t.wI&&s.A.yI(R,L,T,S,x,O,t.wI,t.pI,t.AI);else if(g.et){const i=g.ym[t.dI];s.A.yI(R,L,T,S,x,O,this.mI(i,t.wI),this.mI(i,t.pI),this.mI(i,t.AI))}else t.flat?s.A.gI(R,L,T,S,x,O,t.wI,t.pI,t.AI,d,m,y,p,a,I,C,c,u,t.dI):s.A.gI(R,L,T,S,x,O,t.wI,t.pI,t.AI,f,_,A,a,p,C,I,u,c,t.dI);if(!((v-T)*(x-O)-(b-O)*(L-T)<=0))if(s.A.cI=v<0||T<0||L<0||v>w.A.fI||T>w.A.fI||L>w.A.fI,g.$A&&this.uI(g.Hl,g.Vl,b,O,x,v,T,L)&&(g.Am=e,g.gm=n),-1!==t.dI){if(!g.et)return void s.A.gI(v,T,L,b,O,x,t.II,t.AI,t.pI,d,m,y,p,a,I,C,c,u,t.dI);const i=g.ym[t.dI];s.A.yI(v,T,L,b,O,x,this.mI(i,t.II),this.mI(i,t.AI),this.mI(i,t.pI))}else 12345678!==t.II&&s.A.yI(v,T,L,b,O,x,t.II,t.AI,t.pI)};qg=(t,i,e,n,r,h,o)=>{let l=e.Bd.length;for(let t=0;t>16;if(a=a*o-i*h>>16,i=c,c=l*r-a*n>>16,a=l*n+a*r>>16,l=c,a<50)return;e._I&&(y.A.CI[t]=i,y.A.EI[t]=l,y.A.vI[t]=a),y.A.bI[t]=s.A.ya+((i<<9)/a|0),y.A.TI[t]=s.A.pa+((l<<9)/a|0)}s.A.alpha=0,l=e.OI.length;for(let n=0;n0)if(s.A.cI=l<0||a<0||c<0||l>w.A.fI||a>w.A.fI||c>w.A.fI,g.$A&&this.uI(g.Hl,g.Vl,f,u,d,l,a,c)&&(g.Am=t,g.gm=i),e._I&&-1!==e._I[n])if(g.et){const t=g.ym[e._I[n]];s.A.yI(l,a,c,f,u,d,this.mI(t,e.LI[n]),this.mI(t,e.xI[n]),this.mI(t,e.MI[n]))}else e.flat?s.A.gI(l,a,c,f,u,d,e.LI[n],e.xI[n],e.MI[n],y.A.CI[0],y.A.EI[0],y.A.vI[0],y.A.CI[1],y.A.CI[3],y.A.EI[1],y.A.EI[3],y.A.vI[1],y.A.vI[3],e._I[n]):s.A.gI(l,a,c,f,u,d,e.LI[n],e.xI[n],e.MI[n],y.A.CI[r],y.A.EI[r],y.A.vI[r],y.A.CI[h],y.A.CI[o],y.A.EI[h],y.A.EI[o],y.A.vI[h],y.A.vI[o],e._I[n]);else 12345678!==e.LI[n]&&s.A.yI(l,a,c,f,u,d,e.LI[n],e.xI[n],e.MI[n])}};zg=(t,i,e)=>{const s=this.vm[t][i][e];if(s===-g.LA)return!1;if(s===g.LA)return!0;{const s=i<<7,n=e<<7;return this.kI(s+1,this.Cm[t][i][e],n+1)&&this.kI(s+128-1,this.Cm[t][i+1][e],n+1)&&this.kI(s+128-1,this.Cm[t][i+1][e+1],n+128-1)&&this.kI(s+1,this.Cm[t][i][e+1],n+128-1)?(this.vm[t][i][e]=g.LA,!0):(this.vm[t][i][e]=-g.LA,!1)}};sI=(t,i,e,s)=>{if(!this.zg(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.Cm[t][i][e]-1,o=h-120,l=h-230,a=h-238;if(s<16){if(1===s){if(n>g.GA){if(!this.kI(n,h,r))return!1;if(!this.kI(n,h,r+128))return!1}if(t>0){if(!this.kI(n,o,r))return!1;if(!this.kI(n,o,r+128))return!1}return!!this.kI(n,l,r)&&this.kI(n,l,r+128)}if(2===s){if(r0){if(!this.kI(n,o,r+128))return!1;if(!this.kI(n+128,o,r+128))return!1}return!!this.kI(n,l,r+128)&&this.kI(n+128,l,r+128)}if(4===s){if(n0){if(!this.kI(n+128,o,r))return!1;if(!this.kI(n+128,o,r+128))return!1}return!!this.kI(n+128,l,r)&&this.kI(n+128,l,r+128)}if(8===s){if(r>g.HA){if(!this.kI(n,h,r))return!1;if(!this.kI(n+128,h,r))return!1}if(t>0){if(!this.kI(n,o,r))return!1;if(!this.kI(n+128,o,r))return!1}return!!this.kI(n,l,r)&&this.kI(n+128,l,r)}}return!!this.kI(n+64,a,r+64)&&(16===s?this.kI(n,l,r+128):32===s?this.kI(n+128,l,r+128):64===s?this.kI(n+128,l,r):128===s?this.kI(n,l,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.zg(t,i,e)){const n=i<<7,r=e<<7;return this.kI(n+1,this.Cm[t][i][e]-s,r+1)&&this.kI(n+128-1,this.Cm[t][i+1][e]-s,r+1)&&this.kI(n+128-1,this.Cm[t][i+1][e+1]-s,r+128-1)&&this.kI(n+1,this.Cm[t][i][e+1]-s,r+128-1)}return!1};aI=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.vm[t][h][o]===-g.LA)return!1;o=1+(i<<7);const l=2+(s<<7),a=this.Cm[t][i][s]-r;if(!this.kI(o,a,l))return!1;const c=(e<<7)-1;if(!this.kI(c,a,l))return!1;const f=(n<<7)-1;return!!this.kI(o,a,f)&&this.kI(c,a,f)}return!!this.zg(t,i,s)&&(h=i<<7,o=s<<7,this.kI(h+1,this.Cm[t][i][s]-r,o+1)&&this.kI(h+128-1,this.Cm[t][i+1][s]-r,o+1)&&this.kI(h+128-1,this.Cm[t][i+1][s+1]-r,o+128-1)&&this.kI(h+1,this.Cm[t][i][s+1]-r,o+128-1))};kI=(t,i,e)=>{for(let s=0;s0){const t=n.Cg+(n.Wg*s>>8),r=n.Eg+(n.Gg*s>>8),h=n.gg+(n.Yg*s>>8),o=n.jd+(n.Hg*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.Ig;if(s>0){const t=n.Cg+(n.Wg*s>>8),r=n.Eg+(n.Gg*s>>8),h=n.gg+(n.Yg*s>>8),o=n.jd+(n.Hg*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.Cg-e;if(s>0){const e=n.Ig+(n.Vg*s>>8),r=n._g+(n.Kg*s>>8),h=n.gg+(n.Yg*s>>8),o=n.jd+(n.Hg*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.Cg;if(s>0){const e=n.Ig+(n.Vg*s>>8),r=n._g+(n.Kg*s>>8),h=n.gg+(n.Yg*s>>8),o=n.jd+(n.Hg*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.gg;if(s>0){const i=n.Ig+(n.Vg*s>>8),r=n._g+(n.Kg*s>>8),h=n.Cg+(n.Wg*s>>8),o=n.Eg+(n.Gg*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};uI=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const l=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*l>0&&l*((i-n)*(r-o)-(t-o)*(e-n))>0};mI=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{}},4197:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{DI;NI;FI;BI;index;Qw;Cl;_l;constructor(t,i,e,s,n,r,h){super(),this.DI=i,this.NI=e,this.FI=s,this.BI=n,this.index=t,this.Qw=r,h&&-1!==r.vl&&this.Qw.delay?(this.Cl=Math.random()*this.Qw.El|0,this._l=Math.random()*this.Qw.delay[this.Cl]|0):(this.Cl=-1,this._l=0)}}},9418:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(7121),n=e(1312),r=e(3867);class h extends s.A{x=0;z=0;$g=0;UI=!1;size=1;Wa=-1;WI=-1;GI=-1;YI=-1;HI=-1;VI=-1;KI=-1;XI=null;jI=100;zI=0;ZI=0;qI=0;JI=0;$I=-1e3;QI=0;t_=0;i_=-1;e_=0;s_=0;n_=-1;r_=0;h_=0;o_=-1;l_=0;a_=0;c_=0;f_=0;u_=-1;d_=0;w_=0;y_=0;p_=0;A_=0;m_=0;g_=0;I_=0;__=0;C_=0;E_=0;LA=0;height=0;v_=0;pathLength=0;b_=new Int32Array(10);T_=new Int32Array(10);O_=new r.fe(10,!1);R_=0;S_=-1;L_=-1;x_=-1;M_=-1;move(t,i,e){if(-1!==this.o_&&n.A.Do[this.o_].priority<=1&&(this.o_=-1),!t){const t=i-this.b_[0],s=e-this.T_[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.b_[t]=this.b_[t-1],this.T_[t]=this.T_[t-1],this.O_[t]=this.O_[t-1];return this.b_[0]=i,this.T_[0]=e,void(this.O_[0]=!1)}}this.pathLength=0,this.R_=0,this.b_[0]=i,this.T_[0]=e,this.x=128*this.b_[0]+64*this.size,this.z=128*this.T_[0]+64*this.size}step(t,i){let e=this.b_[0],s=this.T_[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.o_&&n.A.Do[this.o_].priority<=1&&(this.o_=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.b_[t]=this.b_[t-1],this.T_[t]=this.T_[t-1],this.O_[t]=this.O_[t-1];this.b_[0]=e,this.T_[0]=s,this.O_[0]=t}}},8268:(t,i,e)=>{e.d(i,{A:()=>d});var s=e(9418),n=e(8665),r=e(2679),h=e(8738),o=e(1312),l=e(8317),a=e(1302),c=e(3819),f=e(3867),u=e(9298);class d extends s.A{static k_=1;static D_=2;static N_=4;static F_=8;static B_=16;static P_=32;static U_=64;static W_=128;static G_=256;static Y_=512;static Ua=[u.A.H_,u.A.V_,u.A.K_,u.A.X_,u.A.j_,u.A.z_,u.A.Z_,u.A.q_,u.A.J_,u.A.Q_,u.A.tC,u.A.iC,u.A.eC,u.A.sC,u.A.nC,u.A.rC];static Pa=[[u.A.hC,u.A.oC,u.A.lC,u.A.aC,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.pC,u.A.AC],[u.A.mC,u.A.gC,u.A.IC,u.A._C,u.A.CC,u.A.EC,u.A.vC,u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.SC,u.A.LC,u.A.xC,u.A.MC,u.A.kC],[u.A.kC-1,u.A.mC+1,u.A.gC,u.A.IC,u.A._C,u.A.CC,u.A.EC,u.A.vC,u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.SC,u.A.LC,u.A.xC,u.A.MC],[u.A.DC,u.A.NC,u.A.FC,u.A.BC,u.A.PC,u.A.UC],[u.A.WC,u.A.GC,u.A.YC,u.A.HC,u.A.VC,u.A.KC,u.A.XC,u.A.jC]];static No=new r.A(200);name=null;visible=!1;zC=0;ZC=0;qC=new Uint16Array(12);JC=new Uint16Array(5);ic=0;$C=0n;y=0;QC=0;tE=0;iE=0;eE=0;sE=0;nE=null;Pg=0;Ug=0;Vp=0;Kp=0;et=!1;draw(t){if(!this.visible)return null;let i=this.sw();if(this.height=i.jd,i.ow=!0,this.et)return i;if(-1!==this.u_&&-1!==this.d_){const t=h.A.Do[this.u_],e=n.A.ku(t.ma(),!0,!t.md,!1);e.translate(-this.p_,0,0),e.Ga(),t.Qw&&t.Qw.frames&&e.Ya(t.Qw.frames[this.d_]),e.Hd=null,e.Vd=null,128===t.iw&&128===t.ew||e.scale(t.iw,t.ew,t.iw),e.Ha(t.Id+64,t._d+850,-30,-50,-30,!0);const s=[i,e];i=n.A.rE(s,2)}if(this.nE&&(t>=this.tE&&(this.nE=null),t>=this.QC&&t=d.Pa[i].length)&&(e=0),this.JC[i]=e}this.Wa=t.pu,65535===this.Wa&&(this.Wa=-1),this.WI=t.pu,65535===this.WI&&(this.WI=-1),this.GI=t.pu,65535===this.GI&&(this.GI=-1),this.YI=t.pu,65535===this.YI&&(this.YI=-1),this.HI=t.pu,65535===this.HI&&(this.HI=-1),this.VI=t.pu,65535===this.VI&&(this.VI=-1),this.KI=t.pu,65535===this.KI&&(this.KI=-1),this.name=c.A.Ma(c.A.ka(t.hE)),this.ic=t.mu,this.visible=!0,this.$C=0n;for(let t=0;t<12;t++)this.$C<<=0x4n,this.qC[t]>=256&&(this.$C+=BigInt(this.qC[t])-256n);this.qC[0]>=256&&(this.$C+=BigInt(this.qC[0])-256n>>4n),this.qC[1]>=256&&(this.$C+=BigInt(this.qC[1])-256n>>8n);for(let t=0;t<5;t++)this.$C<<=0x3n,this.$C+=BigInt(this.JC[t]);this.$C<<=0x1n,this.$C+=BigInt(this.zC)}ed(){if(!this.visible)return null;const t=new f.fe(12,null);let i=0;for(let e=0;e<12;e++){const s=this.qC[e];if(s>=256&&s<512&&(t[i++]=l.A.Do[s-256].ed()),s>=512){const e=a.A.get(s-512).ed(this.zC);e&&(t[i++]=e)}}const e=n.A.Fa(t,i);for(let t=0;t<5;t++)0!==this.JC[t]&&(e.Ba(d.Pa[t][0],d.Pa[t][this.JC[t]]),1===t&&e.Ba(d.Ua[0],d.Ua[this.JC[t]]));return e}sw(){let t=this.$C,i=-1,e=-1,s=-1,r=-1;if(this.o_>=0&&0===this.c_){const n=o.A.Do[this.o_];if(n.frames&&(i=n.frames[this.l_]),this.n_>=0&&this.n_!==this.Wa){const t=o.A.Do[this.n_].frames;t&&(e=t[this.r_])}n.qw>=0&&(s=n.qw,t+=BigInt(s-this.qC[5])<<8n),n.Jw>=0&&(r=n.Jw,t+=BigInt(r-this.qC[3])<<16n)}else if(this.n_>=0){const t=o.A.Do[this.n_].frames;t&&(i=t[this.r_])}let h=d.No?.get(t);if(!h){const i=new f.fe(12,null);let e=0;for(let t=0;t<12;t++){let n=this.qC[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=l.A.Do[n-256].ma();t&&(i[e++]=t)}if(n>=512){const t=a.A.get(n-512).jw(this.zC);t&&(i[e++]=t)}}h=n.A.Fa(i,e);for(let t=0;t<5;t++)0!==this.JC[t]&&(h.Ba(d.Pa[t][0],d.Pa[t][this.JC[t]]),1===t&&h.Ba(d.Ua[0],d.Ua[this.JC[t]]));h.Ga(),h.Ha(64,850,-30,-50,-30,!0),d.No?.put(t,h)}if(this.et)return h;const c=n.A.nw(h,!0);return-1!==i&&-1!==e?c.rw(i,e,o.A.Do[this.o_].zw):-1!==i&&c.Ya(i),c.hw(),c.Hd=null,c.Vd=null,c}}},9222:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;model;ig;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.ig=n,this.info=r}}},1161:(t,i,e)=>{e.d(i,{A:()=>s});class s{level;y;x;z;model;Jg;$g;eg;yg;sg;pg;ig;info;lI=0;LA=0;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.Jg=r,this.$g=h,this.eg=o,this.yg=l,this.sg=a,this.pg=c,this.ig=f,this.info=u}}},5748:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;oI;hI;rI;ig;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.oI=s,this.hI=n,this.rI=r,this.ig=h,this.offset=o}}},8256:(t,i,e)=>{e.d(i,{A:()=>s});class s{Pg;Vp;Ug;Kp;type;Ig;_g;Cg;Eg;gg;jd;mode=0;Vg=0;Kg=0;Wg=0;Gg=0;Yg=0;Hg=0;constructor(t,i,e,s,n,r,h,o,l,a,c){this.Pg=t,this.Vp=i,this.Ug=e,this.Kp=s,this.type=n,this.Ig=r,this._g=h,this.Cg=o,this.Eg=l,this.gg=a,this.jd=c}}},3795:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1982),n=e(3867);class r extends s.A{level;x;z;jg;Wm;Fg;km=null;Nm=null;Hm=null;Vm=null;Fm=null;Gm=null;xm=null;Um=0;Bg=0;Mm=0;visible=!1;update=!1;kg=!1;Dg=0;iI=0;eI=0;Qg=0;constructor(t,i,e){super(),this.jg=this.level=t,this.x=i,this.z=e,this.Wm=new n.fe(5,null),this.Fg=new Int32Array(5)}}},2771:(t,i,e)=>{e.d(i,{A:()=>s});class s{static bI=new Int32Array(6);static TI=new Int32Array(6);static CI=new Int32Array(6);static EI=new Int32Array(6);static vI=new Int32Array(6);static oE=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static lE=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static aE=128;static cE=this.aE/2|0;static fE=this.aE/4|0;static uE=3*this.aE/4|0;Bd;Ud;Pd;LI;xI;MI;OI;RI;SI;_I;flat;shape;angle;Lg;xg;constructor(t,i,e,n,r,h,o,l,a,c,f,u,d,w,y,p,A,m,g){this.flat=!(A!==n||A!==w||A!==l),this.shape=i,this.angle=h,this.Lg=d,this.xg=a;const I=s.oE[i],_=I.length;this.Bd=new Int32Array(_),this.Ud=new Int32Array(_),this.Pd=new Int32Array(_);const C=new Int32Array(_),E=new Int32Array(_),v=t*s.aE,b=m*s.aE;for(let t=0;t<_;t++){let i,a,f,d,m,_=I[t];!(1&_)&&_<=8&&(_=1+(_-h-h-1&7)),_>8&&_<=12&&(_=9+(_-h-9&3)),_>12&&_<=16&&(_=13+(_-h-13&3)),1===_?(i=v,a=b,f=A,d=o,m=c):2===_?(i=v+s.cE,a=b,f=A+n>>1,d=o+g>>1,m=c+e>>1):3===_?(i=v+s.aE,a=b,f=n,d=g,m=e):4===_?(i=v+s.aE,a=b+s.cE,f=n+w>>1,d=g+r>>1,m=e+y>>1):5===_?(i=v+s.aE,a=b+s.aE,f=w,d=r,m=y):6===_?(i=v+s.cE,a=b+s.aE,f=w+l>>1,d=r+p>>1,m=y+u>>1):7===_?(i=v,a=b+s.aE,f=l,d=p,m=u):8===_?(i=v,a=b+s.cE,f=l+A>>1,d=p+o>>1,m=u+c>>1):9===_?(i=v+s.cE,a=b+s.fE,f=A+n>>1,d=o+g>>1,m=c+e>>1):10===_?(i=v+s.uE,a=b+s.cE,f=n+w>>1,d=g+r>>1,m=e+y>>1):11===_?(i=v+s.cE,a=b+s.uE,f=w+l>>1,d=r+p>>1,m=y+u>>1):12===_?(i=v+s.fE,a=b+s.cE,f=l+A>>1,d=p+o>>1,m=u+c>>1):13===_?(i=v+s.fE,a=b+s.fE,f=A,d=o,m=c):14===_?(i=v+s.uE,a=b+s.fE,f=n,d=g,m=e):15===_?(i=v+s.uE,a=b+s.uE,f=w,d=r,m=y):(i=v+s.fE,a=b+s.uE,f=l,d=p,m=u),this.Bd[t]=i,this.Ud[t]=f,this.Pd[t]=a,C[t]=d,E[t]=m}const T=s.lE[i],O=T.length/4|0;this.OI=new Int32Array(O),this.RI=new Int32Array(O),this.SI=new Int32Array(O),this.LI=new Int32Array(O),this.xI=new Int32Array(O),this.MI=new Int32Array(O),this._I=-1!==f?new Int32Array(O):null;let R=0;for(let t=0;t{e.d(i,{A:()=>s});class s{static lA=0;static Dm=1;static dE=2;static wE=3;static yE=4;static pE=5;static cE=6;static fE=7;static uE=8;static AE=9;static mE=10;static gE=11}},3479:(t,i,e)=>{e.d(i,{A:()=>s});class s{II;AI;wI;pI;dI;color;flat;constructor(t,i,e,s,n,r,h){this.II=t,this.AI=i,this.wI=e,this.pI=s,this.dI=n,this.color=r,this.flat=h}}},6855:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;tI;nI;Zm;Jm;ig;info;constructor(t,i,e,s,n,r,h,o,l){this.y=t,this.x=i,this.z=e,this.tI=s,this.nI=n,this.Zm=r,this.Jm=h,this.ig=o,this.info=l}}},7441:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;type;angle;model;ig;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.ig=h,this.info=o}}},7536:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{IE;_E;constructor(t){this._E=[],this.IE=t;for(let i=0;i{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{EE;vE;constructor(){super(),this.EE=this,this.vE=this}bE(){this.vE&&this.EE&&(this.vE.EE=this.EE,this.EE.vE=this.vE,this.EE=null,this.vE=null)}}},3819:(t,i,e)=>{e.d(i,{A:()=>s});class s{static TE=['_','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','0','1','2','3','4','5','6','7','8','9'];static OE=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static ka=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.TE[Number(s-37n*t)]}return e.slice(12-i).join('')};static RE=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static SE=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static Ma=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static Lu=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}},6666:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{LE;cursor=null;constructor(){const t=new s.A;t.next=t,t.CE=t,this.LE=t}Gp(t){t.CE&&t.ww(),t.CE=this.LE.CE,t.next=this.LE,t.CE&&(t.CE.next=t),t.next.CE=t}xE(t){t.CE&&t.ww(),t.CE=this.LE,t.next=this.LE.next,t.CE.next=t,t.next&&(t.next.CE=t)}Xg(){const t=this.LE.next;return t===this.LE?null:(t?.ww(),t)}head(){const t=this.LE.next;return t===this.LE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}ME(){const t=this.LE.CE;return t===this.LE?(this.cursor=null,null):(this.cursor=t?.CE||null,t)}next(){const t=this.cursor;return t===this.LE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}CE(){const t=this.cursor;return t===this.LE?(this.cursor=null,null):(this.cursor=t?.CE||null,t)}clear(){for(;;){const t=this.LE.next;if(t===this.LE)return;t?.ww()}}}},1982:(t,i,e)=>{e.d(i,{A:()=>s});class s{key;next;CE;constructor(){this.key=0n,this.next=this,this.CE=this}ww(){this.CE&&this.next&&(this.CE.next=this.next,this.next.CE=this.CE,this.next=null,this.CE=null)}}},2679:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(2512),n=e(7536);class r{kE;DE;history;available;constructor(t){this.kE=t,this.available=t,this.DE=new n.A(1024),this.history=new s.A}get(t){const i=this.DE.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.ww(),t?.bE()}else this.available--;this.DE.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.ww(),t.bE()):this.available=this.kE}}},2512:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n{head;constructor(){this.head=new s.A}push(t){t.vE&&t.bE(),t.vE=this.head.vE,t.EE=this.head,t.vE&&(t.vE.EE=t),t.EE.vE=t}pop(){const t=this.head.EE;return t===this.head?null:(t?.bE(),t)}}},8534:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(3867);class r{static Do=[];static yu=t=>{const i=new s.A(t.read('base_head.dat')),e=new s.A(t.read('base_type.dat')),h=new s.A(t.read('base_label.dat')),o=i.pu;i.mf+=2;for(let t=0;t{e.d(i,{A:()=>r});var s=e(8534),n=e(1069);class r{static Do=[];static yu=t=>{const i=new n.A(t.read('frame_head.dat')),e=new n.A(t.read('frame_tran1.dat')),h=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),l=i.pu;i.mf+=2;const a=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){a[p]=i,c[p]=0,f[p]=0,u[p]=0,p++;break}a[p]=t;let e=0;3===d.types[a[p]]&&(e=128),c[p]=1&i?h.FE:e,f[p]=2&i?h.FE:e,u[p]=4&i?h.FE:e,y=t,p++}}n.length=p,n.BE=new Int32Array(p),n.x=new Int32Array(p),n.y=new Int32Array(p),n.z=new Int32Array(p);for(let t=0;t{e.d(i,{Nc:()=>s,nl:()=>n,PE:()=>o,UE:()=>h,WE:()=>r});const s=document.getElementById('canvas'),n=s.getContext('2d',{willReadFrequently:!0}),r=document.createElement('canvas'),h=document.createElement('img'),o=r.getContext('2d',{willReadFrequently:!0})},9298:(t,i,e)=>{e.d(i,{A:()=>s});class s{static RED=16711680;static GREEN=65280;static BLUE=255;static ql=16776960;static GE=65535;static fA=16711935;static Ll=16777215;static Zl=0;static YE=16748608;static HE=8388608;static VE=128;static KE=16756736;static XE=16740352;static jE=16723968;static zE=12648192;static ZE=8453888;static qE=4259584;static JE=9179409;static $E=6116423;static fl=2301979;static ul=5063219;static wl=7759444;static pl=3353893;static QE=8388736;static tv=13350793;static iv=Int32Array.of(s.ql,s.RED,s.GREEN,s.GE,s.fA,s.Ll);static hC=6798;static oC=107;static lC=10283;static aC=16;static cC=4797;static fC=7744;static uC=5799;static dC=4634;static wC=33697;static yC=22433;static pC=2983;static AC=54193;static mC=8741;static gC=12;static IC=64030;static _C=43162;static CC=7735;static EC=8404;static vC=1701;static bC=38430;static TC=24094;static OC=10153;static RC=56621;static SC=4783;static LC=1341;static xC=16578;static MC=35003;static kC=25239;static H_=9104;static V_=10275;static K_=7595;static X_=3610;static j_=7975;static z_=8526;static Z_=918;static q_=38802;static J_=24466;static Q_=10145;static tC=58654;static iC=5027;static eC=1457;static sC=16565;static nC=34991;static rC=25486;static DC=4626;static NC=11146;static FC=6439;static BC=12;static PC=4758;static UC=10270;static jC=4574;static WC=4550;static GC=4537;static YC=5681;static HC=5673;static VC=5790;static KC=6806;static XC=8076}},8950:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n extends s.A{static mw=new Int32Array;static gw=0;static Iw=0;static top=0;static bottom=0;static left=0;static right=0;static fI=0;static ev=0;static sv=0;static bind=(t,i,e)=>{this.mw=t,this.gw=i,this.Iw=e,this.Tl(0,0,i,e)};static nv=()=>{this.left=0,this.top=0,this.right=this.gw,this.bottom=this.Iw,this.fI=this.right-1,this.ev=this.right/2|0};static Tl=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.gw&&(e=this.gw),s>this.Iw&&(s=this.Iw),this.top=i,this.bottom=s,this.left=t,this.right=e,this.fI=this.right-1,this.ev=this.right/2|0,this.sv=this.bottom/2|0};static clear=()=>{const t=this.gw*this.Iw;for(let i=0;i{this.yl(t,i,n,e),this.yl(t,i+s-1,n,e),this.dl(t,i,n,s),this.dl(t+e-1,i,n,s)};static yl=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.gw;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.gw;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(a-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.gw-e;let h=t+i*this.gw;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.mw[h++]=n;h+=r}};static hv(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,l=(n>>8&255)*r,a=(255&n)*r,c=this.gw-e;let f=t+i*this.gw;for(let t=0;t>16&255)*h>>8<<16)+(l+(this.mw[f]>>8&255)*h>>8<<8)+(a+(255&this.mw[f])*h>>8);this.mw[f++]=t}f+=c}}static ov(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,l=(255&s)*n;let a=i-e;a<0&&(a=0);let c=i+e;c>=this.Iw&&(c=this.Iw-1);for(let s=a;s<=c;s++){const n=s-i,a=0|Math.sqrt(e*e-n*n);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.gw&&(f=this.gw-1);let u=c+s*this.gw;for(let t=c;t<=f;t++){const t=(h+(this.mw[u]>>16&255)*r>>8<<16)+(o+(this.mw[u]>>8&255)*r>>8<<8)+(l+(255&this.mw[u])*r>>8);this.mw[u++]=t}}}static lv=(t,i,e)=>{t=this.right||i=this.bottom||(this.mw[t+i*this.gw]=e)}}},4583:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1673),r=e(3867);class h extends s.A{static et=!1;static av=new Int32Array(512);static cv=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static fv=new r.fe(50,null);static uv=0;static Aw=new Int32Array;static ya=0;static pa=0;static _w=!0;static cI=!1;static alpha=0;static dv=null;static wv=new r.fe(50,null);static yv=0;static LA=0;static pv=new Int32Array(50);static Av=new r.fe(50,null);static mv=!1;static gv=new r.fe(50,!1);static Iv=new Int32Array(50);static{for(let t=1;t<512;t++)this.av[t]=32768/t|0;for(let t=1;t<2048;t++)this.cv[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static So=()=>{this.av=null,this.av=null,this.sin=null,this.cos=null,this.Aw=null,this.fv=null,this.gv=null,this.Iv=null,this.dv=null,this.wv=null,this.pv=null,this.palette=null,this.Av=null,console.log('Draw3D unloaded!')};static Fc=()=>{this.Aw=new Int32Array(s.A.Iw);for(let t=0;t{this.Aw=new Int32Array(i);for(let e=0;e{this.dv=null,this.wv.fill(null)};static Ev=t=>{this.uv=0;for(let i=0;i<50;i++)try{this.fv[i]=n.A.xu(t,i.toString()),this.et&&128===this.fv[i]?.Xl?this.fv[i]?.vv():this.fv[i]?.xw(),this.uv++}catch(t){}};static cA=t=>{if(0!==this.Iv[t])return this.Iv[t];const i=this.Av[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.bv(h,1.4),0===h&&(h=1),this.Iv[t]=h,h};static Tv=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,l=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let a=s-.3333333333333333;a<0&&a++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*h|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[e++]=this.bv(a,i)}}for(let t=0;t<50;t++){const e=this.fv[t];if(!e)continue;const s=e.palette;this.Av[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static Rv=t=>{this.dv||(this.yv=t,this.et?this.dv=new r.Xr(t,16384):this.dv=new r.Xr(t,65536),this.wv.fill(null))};static yI=(t,i,e,n,r,o,l,a,c)=>{let f=0,u=0;r!==n&&(f=(i-t<<16)/(r-n)|0,u=(a-l<<15)/(r-n)|0);let d=0,w=0;o!==r&&(d=(e-i<<16)/(o-r)|0,w=(c-a<<15)/(o-r)|0);let y=0,p=0;if(o!==n&&(y=(t-e<<16)/(n-o)|0,p=(l-c<<15)/(n-o)|0),n<=r&&n<=o){if(ns.A.bottom&&(r=s.A.bottom),o>s.A.bottom&&(o=s.A.bottom),rd)for(o-=r,r-=n,n=h.Aw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Sv(e>>16,i>>16,c>>7,a>>7,s.A.mw,n,0),e+=y,i+=d,c+=p,a+=w,n+=s.A.gw}this.Sv(e>>16,t>>16,c>>7,l>>7,s.A.mw,n,0),e+=y,t+=f,c+=p,l+=u,n+=s.A.gw}else for(o-=r,r-=n,n=h.Aw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Sv(i>>16,e>>16,a>>7,c>>7,s.A.mw,n,0),e+=y,i+=d,c+=p,a+=w,n+=s.A.gw}this.Sv(t>>16,e>>16,l>>7,c>>7,s.A.mw,n,0),e+=y,t+=f,c+=p,l+=u,n+=s.A.gw}else if(i=t<<=16,a=l<<=15,n<0&&(i-=y*n,t-=f*n,a-=p*n,l-=u*n,n=0),e<<=16,c<<=15,o<0&&(e-=d*o,c-=w*o,o=0),n!==o&&yf)for(r-=o,o-=n,n=h.Aw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Sv(e>>16,t>>16,c>>7,l>>7,s.A.mw,n,0),e+=d,t+=f,c+=w,l+=u,n+=s.A.gw}this.Sv(i>>16,t>>16,a>>7,l>>7,s.A.mw,n,0),i+=y,t+=f,a+=p,l+=u,n+=s.A.gw}else for(r-=o,o-=n,n=h.Aw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Sv(t>>16,e>>16,l>>7,c>>7,s.A.mw,n,0),e+=d,t+=f,c+=w,l+=u,n+=s.A.gw}this.Sv(t>>16,i>>16,l>>7,a>>7,s.A.mw,n,0),i+=y,t+=f,a+=p,l+=u,n+=s.A.gw}}else if(r<=o){if(rs.A.bottom&&(o=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),oy)for(n-=o,o-=r,r=h.Aw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Sv(t>>16,e>>16,l>>7,c>>7,s.A.mw,r,0),t+=f,e+=y,l+=u,c+=p,r+=s.A.gw}this.Sv(t>>16,i>>16,l>>7,a>>7,s.A.mw,r,0),t+=f,i+=d,l+=u,a+=w,r+=s.A.gw}else for(n-=o,o-=r,r=h.Aw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Sv(e>>16,t>>16,c>>7,l>>7,s.A.mw,r,0),t+=f,e+=y,l+=u,c+=p,r+=s.A.gw}this.Sv(i>>16,t>>16,a>>7,l>>7,s.A.mw,r,0),t+=f,i+=d,l+=u,a+=w,r+=s.A.gw}else if(e=i<<=16,c=a<<=15,r<0&&(e-=f*r,i-=d*r,c-=u*r,a-=w*r,r=0),t<<=16,l<<=15,n<0&&(t-=y*n,l-=p*n,n=0),o-=n,n-=r,r=h.Aw[r],f>16,i>>16,l>>7,a>>7,s.A.mw,r,0),t+=y,i+=d,l+=p,a+=w,r+=s.A.gw}this.Sv(e>>16,i>>16,c>>7,a>>7,s.A.mw,r,0),e+=f,i+=d,c+=u,a+=w,r+=s.A.gw}else for(;;){if(--n<0)for(;;){if(--o<0)return;this.Sv(i>>16,t>>16,a>>7,l>>7,s.A.mw,r,0),t+=y,i+=d,l+=p,a+=w,r+=s.A.gw}this.Sv(i>>16,e>>16,a>>7,c>>7,s.A.mw,r,0),e+=f,i+=d,c+=u,a+=w,r+=s.A.gw}}else if(os.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,a>>7,l>>7,s.A.mw,o,0),i+=d,t+=f,a+=w,l+=u,o+=s.A.gw}this.Sv(i>>16,e>>16,a>>7,c>>7,s.A.mw,o,0),i+=d,e+=y,a+=w,c+=p,o+=s.A.gw}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Sv(t>>16,i>>16,l>>7,a>>7,s.A.mw,o,0),i+=d,t+=f,a+=w,l+=u,o+=s.A.gw}this.Sv(e>>16,i>>16,c>>7,a>>7,s.A.mw,o,0),i+=d,e+=y,a+=w,c+=p,o+=s.A.gw}else if(t=e<<=16,l=c<<=15,o<0&&(t-=d*o,e-=y*o,l-=w*o,c-=p*o,o=0),i<<=16,a<<=15,r<0&&(i-=f*r,a-=u*r,r=0),n-=r,r-=o,o=h.Aw[o],d>16,e>>16,a>>7,c>>7,s.A.mw,o,0),i+=f,e+=y,a+=u,c+=p,o+=s.A.gw}this.Sv(t>>16,e>>16,l>>7,c>>7,s.A.mw,o,0),t+=d,e+=y,l+=w,c+=p,o+=s.A.gw}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Sv(e>>16,i>>16,c>>7,a>>7,s.A.mw,o,0),i+=f,e+=y,a+=u,c+=p,o+=s.A.gw}this.Sv(e>>16,t>>16,c>>7,l>>7,s.A.mw,o,0),t+=d,e+=y,l+=w,c+=p,o+=s.A.gw}};static Sv=(t,i,e,n,r,o,l)=>{let a;if(h._w){let c;if(h.cI){if(c=i-t>3?(n-e)/(i-t)|0:0,i>s.A.fI&&(i=s.A.fI),t<0&&(e-=t*c,t=0),t>=i)return;o+=t,l=i-t>>2,c<<=2}else{if(!(t>2)>0?(n-e)*h.av[l]>>15:0}if(0===h.alpha)for(;;){if(--l<0){if((l=i-t&3)>0){a=h.palette[e>>8];do{r[o++]=a,l--}while(l>0);return}break}a=h.palette[e>>8],e+=c,r[o++]=a,r[o++]=a,r[o++]=a,r[o++]=a}else{const s=h.alpha,n=256-h.alpha;for(;;){if(--l<0){if((l=i-t&3)>0){a=h.palette[e>>8],a=((16711935&a)*n>>8&16711935)+((65280&a)*n>>8&65280);do{r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),l--}while(l>0)}break}a=h.palette[e>>8],e+=c,a=((16711935&a)*n>>8&16711935)+((65280&a)*n>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280)}}}else if(ts.A.fI&&(i=s.A.fI),t<0&&(e-=t*c,t=0),t>=i))return;if(o+=t,l=i-t,0===h.alpha)do{r[o++]=h.palette[e>>8],e+=c,l--}while(l>0);else{const t=h.alpha,i=256-h.alpha;do{a=h.palette[e>>8],e+=c,a=((16711935&a)*i>>8&16711935)+((65280&a)*i>>8&65280),r[o++]=a+((16711935&r[o])*t>>8&16711935)+((65280&r[o])*t>>8&65280),l--}while(l>0)}}};static Lv=(t,i,e,n,r,h,o)=>{let l=0;r!==n&&(l=(i-t<<16)/(r-n)|0);let a=0;h!==r&&(a=(e-i<<16)/(h-r)|0);let c=0;if(h!==n&&(c=(t-e<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),ra)for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.xv(e>>16,i>>16,s.A.mw,n,o),e+=c,i+=a,n+=s.A.gw}this.xv(e>>16,t>>16,s.A.mw,n,o),e+=c,t+=l,n+=s.A.gw}else for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.xv(i>>16,e>>16,s.A.mw,n,o),e+=c,i+=a,n+=s.A.gw}this.xv(t>>16,e>>16,s.A.mw,n,o),e+=c,t+=l,n+=s.A.gw}else if(i=t<<=16,n<0&&(i-=c*n,t-=l*n,n=0),e<<=16,h<0&&(e-=a*h,h=0),n!==h&&cl)for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.xv(e>>16,t>>16,s.A.mw,n,o),e+=a,t+=l,n+=s.A.gw}this.xv(i>>16,t>>16,s.A.mw,n,o),i+=c,t+=l,n+=s.A.gw}else for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.xv(t>>16,e>>16,s.A.mw,n,o),e+=a,t+=l,n+=s.A.gw}this.xv(t>>16,i>>16,s.A.mw,n,o),i+=c,t+=l,n+=s.A.gw}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hc)for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.xv(t>>16,e>>16,s.A.mw,r,o),t+=l,e+=c,r+=s.A.gw}this.xv(t>>16,i>>16,s.A.mw,r,o),t+=l,i+=a,r+=s.A.gw}else for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.xv(e>>16,t>>16,s.A.mw,r,o),t+=l,e+=c,r+=s.A.gw}this.xv(i>>16,t>>16,s.A.mw,r,o),t+=l,i+=a,r+=s.A.gw}else if(e=i<<=16,r<0&&(e-=l*r,i-=a*r,r=0),t<<=16,n<0&&(t-=c*n,n=0),l>16,i>>16,s.A.mw,r,o),t+=c,i+=a,r+=s.A.gw}this.xv(e>>16,i>>16,s.A.mw,r,o),e+=l,i+=a,r+=s.A.gw}else for(h-=n,n-=r,r=this.Aw[r];;){if(--n<0)for(;;){if(--h<0)return;this.xv(i>>16,t>>16,s.A.mw,r,o),t+=c,i+=a,r+=s.A.gw}this.xv(i>>16,e>>16,s.A.mw,r,o),e+=l,i+=a,r+=s.A.gw}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.mw,h,o),i+=a,t+=l,h+=s.A.gw}this.xv(i>>16,e>>16,s.A.mw,h,o),i+=a,e+=c,h+=s.A.gw}else for(r-=n,n-=h,h=this.Aw[h];;){if(--n<0)for(;;){if(--r<0)return;this.xv(t>>16,i>>16,s.A.mw,h,o),i+=a,t+=l,h+=s.A.gw}this.xv(e>>16,i>>16,s.A.mw,h,o),i+=a,e+=c,h+=s.A.gw}else if(t=e<<=16,h<0&&(t-=a*h,e-=c*h,h=0),i<<=16,r<0&&(i-=l*r,r=0),a>16,e>>16,s.A.mw,h,o),i+=l,e+=c,h+=s.A.gw}this.xv(t>>16,e>>16,s.A.mw,h,o),t+=a,e+=c,h+=s.A.gw}else for(n-=r,r-=h,h=this.Aw[h];;){if(--r<0)for(;;){if(--n<0)return;this.xv(e>>16,i>>16,s.A.mw,h,o),i+=l,e+=c,h+=s.A.gw}this.xv(e>>16,t>>16,s.A.mw,h,o),t+=a,e+=c,h+=s.A.gw}};static gI=(t,i,e,n,r,h,o,l,a,c,f,u,d,w,y,p,A,m,g)=>{const I=this.Mv(g);this.mv=!this.gv[g];const _=c-d,C=f-y,E=u-A,v=w-c,b=p-f,T=m-u;let O=v*f-b*c<<14;const R=b*u-T*f<<8,S=T*c-v*u<<5;let L=_*f-C*c<<14;const x=C*u-E*f<<8,M=E*c-_*u<<5;let k=C*v-_*b<<14;const D=E*b-C*T<<8,N=_*T-E*v<<5;let F=0,B=0;r!==n&&(F=(i-t<<16)/(r-n)|0,B=(l-o<<16)/(r-n)|0);let P=0,U=0;h!==r&&(P=(e-i<<16)/(h-r)|0,U=(a-l<<16)/(h-r)|0);let W=0,G=0;if(h!==n&&(W=(t-e<<16)/(n-h)|0,G=(o-a<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),rP)for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.kv(e>>16,i>>16,s.A.mw,n,I,0,0,O,L,k,R,x,D,a>>8,l>>8),e+=W,i+=P,a+=G,l+=U,n+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(e>>16,t>>16,s.A.mw,n,I,0,0,O,L,k,R,x,D,a>>8,o>>8),e+=W,t+=F,a+=G,o+=B,n+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.kv(i>>16,e>>16,s.A.mw,n,I,0,0,O,L,k,R,x,D,l>>8,a>>8),e+=W,i+=P,a+=G,l+=U,n+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(t>>16,e>>16,s.A.mw,n,I,0,0,O,L,k,R,x,D,o>>8,a>>8),e+=W,t+=F,a+=G,o+=B,n+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}else{i=t<<=16,l=o<<=16,n<0&&(i-=W*n,t-=F*n,l-=G*n,o-=B*n,n=0),e<<=16,a<<=16,h<0&&(e-=P*h,a-=U*h,h=0);const c=n-this.pa;if(O+=S*c,L+=M*c,k+=N*c,O|=0,L|=0,k|=0,(n===h||W>=F)&&(n!==h||P<=F))for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.kv(t>>16,e>>16,s.A.mw,n,I,0,0,O,L,k,R,x,D,o>>8,a>>8),e+=P,t+=F,a+=U,o+=B,n+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(t>>16,i>>16,s.A.mw,n,I,0,0,O,L,k,R,x,D,o>>8,l>>8),i+=W,t+=F,l+=G,o+=B,n+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.kv(e>>16,t>>16,s.A.mw,n,I,0,0,O,L,k,R,x,D,a>>8,o>>8),e+=P,t+=F,a+=U,o+=B,n+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(i>>16,t>>16,s.A.mw,n,I,0,0,O,L,k,R,x,D,l>>8,o>>8),i+=W,t+=F,l+=G,o+=B,n+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hW)for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.kv(t>>16,e>>16,s.A.mw,r,I,0,0,O,L,k,R,x,D,o>>8,a>>8),t+=F,e+=W,o+=B,a+=G,r+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(t>>16,i>>16,s.A.mw,r,I,0,0,O,L,k,R,x,D,o>>8,l>>8),t+=F,i+=P,o+=B,l+=U,r+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.kv(e>>16,t>>16,s.A.mw,r,I,0,0,O,L,k,R,x,D,a>>8,o>>8),t+=F,e+=W,o+=B,a+=G,r+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(i>>16,t>>16,s.A.mw,r,I,0,0,O,L,k,R,x,D,l>>8,o>>8),t+=F,i+=P,o+=B,l+=U,r+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}else{e=i<<=16,a=l<<=16,r<0&&(e-=F*r,i-=P*r,a-=B*r,l-=U*r,r=0),t<<=16,o<<=16,n<0&&(t-=W*n,o-=G*n,n=0);const c=r-this.pa;if(O+=S*c,L+=M*c,k+=N*c,O|=0,L|=0,k|=0,h-=n,n-=r,r=this.Aw[r],F>16,i>>16,s.A.mw,r,I,0,0,O,L,k,R,x,D,o>>8,l>>8),t+=W,i+=P,o+=G,l+=U,r+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(e>>16,i>>16,s.A.mw,r,I,0,0,O,L,k,R,x,D,a>>8,l>>8),e+=F,i+=P,a+=B,l+=U,r+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--h<0)return;this.kv(i>>16,t>>16,s.A.mw,r,I,0,0,O,L,k,R,x,D,l>>8,o>>8),t+=W,i+=P,o+=G,l+=U,r+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(i>>16,e>>16,s.A.mw,r,I,0,0,O,L,k,R,x,D,l>>8,a>>8),e+=F,i+=P,a+=B,l+=U,r+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.mw,h,I,0,0,O,L,k,R,x,D,l>>8,o>>8),i+=P,t+=F,l+=U,o+=B,h+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(i>>16,e>>16,s.A.mw,h,I,0,0,O,L,k,R,x,D,l>>8,a>>8),i+=P,e+=W,l+=U,a+=G,h+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.kv(t>>16,i>>16,s.A.mw,h,I,0,0,O,L,k,R,x,D,o>>8,l>>8),i+=P,t+=F,l+=U,o+=B,h+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(e>>16,i>>16,s.A.mw,h,I,0,0,O,L,k,R,x,D,a>>8,l>>8),i+=P,e+=W,l+=U,a+=G,h+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}else{t=e<<=16,o=a<<=16,h<0&&(t-=P*h,e-=W*h,o-=U*h,a-=G*h,h=0),i<<=16,l<<=16,r<0&&(i-=F*r,l-=B*r,r=0);const c=h-this.pa;if(O+=S*c,L+=M*c,k+=N*c,O|=0,L|=0,k|=0,n-=r,r-=h,h=this.Aw[h],P>16,e>>16,s.A.mw,h,I,0,0,O,L,k,R,x,D,l>>8,a>>8),i+=F,e+=W,l+=B,a+=G,h+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(t>>16,e>>16,s.A.mw,h,I,0,0,O,L,k,R,x,D,o>>8,a>>8),t+=P,e+=W,o+=U,a+=G,h+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.kv(e>>16,i>>16,s.A.mw,h,I,0,0,O,L,k,R,x,D,a>>8,l>>8),i+=F,e+=W,l+=B,a+=G,h+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}this.kv(e>>16,t>>16,s.A.mw,h,I,0,0,O,L,k,R,x,D,a>>8,o>>8),t+=P,e+=W,o+=U,a+=G,h+=s.A.gw,O+=S,L+=M,k+=N,O|=0,L|=0,k|=0}}};static kv=(t,i,e,n,r,h,o,l,a,c,f,u,d,w,y)=>{if(t>=i)return;let p,A,m,g,I,_,C,E,v;if(this.cI){if(p=(y-w)/(i-t)|0,i>s.A.fI&&(i=s.A.fI),t<0&&(w-=t*p,t=0),t>=i)return;A=i-t>>3,p<<=12}else i-t>7?(A=i-t>>3,p=(y-w)*this.av[A]>>6):(A=0,p=0);if(w<<=9,n+=t,this.et&&r)if(m=0,g=0,_=t-this.ya,l+=(f>>3)*_,a+=(u>>3)*_,c+=(d>>3)*_,l|=0,a|=0,I=(c|=0)>>12,0!==I&&(o=a/I|0,(h=l/I|0)<0?h=0:h>4032&&(h=4032)),l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>12,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>4032&&(m=4032)),C=m-h>>3,E=g-o>>3,h+=w>>3&786432,v=w>>23,this.mv){for(;A-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h=m,o=g,l+=f,a+=u,I=(c+=d)>>12,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>4032&&(m=4032)),C=m-h>>3,E=g-o>>3,h+=(w+=p)>>3&786432,v=w>>23;for(A=i-t&7;A-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E}else{for(;A-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n+=1,h=m,o=g,l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>12,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>4032&&(m=4032)),C=m-h>>3,E=g-o>>3,h+=(w+=p)>>3&786432,v=w>>23}for(A=i-t&7;A-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}else if(m=0,g=0,_=t-this.ya,l+=(f>>3)*_,a+=(u>>3)*_,c+=(d>>3)*_,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(o=a/I|0,(h=l/I|0)<0?h=0:h>16256&&(h=16256)),l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>16256&&(m=16256)),C=m-h>>3,E=g-o>>3,h+=6291456&w,v=w>>23,this.mv&&r){for(;A-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h=m,o=g,l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>16256&&(m=16256)),C=m-h>>3,E=g-o>>3,h+=6291456&(w+=p),v=w>>23;for(A=i-t&7;A-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E}else{for(;A-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,h=m,o=g,l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(m=l/I|0,g=a/I|0,m<7?m=7:m>16256&&(m=16256)),C=m-h>>3,E=g-o>>3,h+=6291456&(w+=p),v=w>>23}for(A=i-t&7;A-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}};static xv=(t,i,e,n,r)=>{if(this.cI&&(i>s.A.fI&&(i=s.A.fI),t<0&&(t=0)),t>=i)return;n+=t;let h=i-t>>2;if(0===this.alpha)for(;;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;e[n++]=r}e[n++]=r,e[n++]=r,e[n++]=r,e[n++]=r}const o=this.alpha,l=256-this.alpha;for(r=((16711935&r)*l>>8&16711935)+((65280&r)*l>>8&65280);;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}};static Ov=t=>{this.wv[t]&&this.dv&&(this.dv[this.yv++]=this.wv[t],this.wv[t]=null)};static Mv=t=>{if(this.pv[t]=this.LA++,this.wv[t])return this.wv[t];let i;if(this.yv>0&&this.dv)i=this.dv[--this.yv],this.dv[this.yv]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.mw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.mw[t]];this.gv[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.gv[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}},880:(t,i,e)=>{e.d(i,{r:()=>n});var s=e(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(s.UE.src),s.UE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>s.UE.onload=()=>t())),s.PE.clearRect(0,0,s.WE.width,s.WE.height);const i=s.UE.naturalWidth,e=s.UE.naturalHeight;return s.WE.width=i,s.WE.height=e,s.PE.drawImage(s.UE,0,0),s.PE.getImageData(0,0,i,e)}},8665:(t,i,e)=>{e.d(i,{A:()=>f});var s=e(1069),n=e(8950),r=e(4583),h=e(6730),o=e(4474),l=e(3867);class a{Fd=0;bg=0;Dv=0;Nv=-1;Fv=-1;Bv=-1;Pv=-1;Uv=-1;Wv=-1;Gv=-1;Yv=-1;Hv=-1;Vv=0;Kv=-1;Xv=-1;jv=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static zv=null;static Zv=null;static qv=null;static Jv=null;static $v=null;static Qv=null;static tb=null;static ib=null;static eb=null;static sb=null;static nb=null;static rb=null;static axis=null;static hb=new l.fe(4096,!1);static ob=new l.fe(4096,!1);static lb=new Int32Array(4096);static ab=new Int32Array(4096);static cb=new Int32Array(4096);static fb=new Int32Array(4096);static ub=new Int32Array(4096);static wb=new Int32Array(4096);static yb=new Int32Array(1500);static pb=new l.Xr(1500,512);static Ab=new Int32Array(12);static mb=new l.Xr(12,2e3);static gb=new Int32Array(2e3);static Ib=new Int32Array(2e3);static _b=new Int32Array(12);static Cb=new Int32Array(10);static Eb=new Int32Array(10);static vb=new Int32Array(10);static Ir=0;static bb=0;static _r=0;static Tb=!1;static Hl=0;static Vl=0;static Ob=0;static Rb=new Int32Array(1e3);static Sb=!1;static yu(t){try{f.head=new s.A(t.read('ob_head.dat')),f.zv=new s.A(t.read('ob_face1.dat')),f.Zv=new s.A(t.read('ob_face2.dat')),f.qv=new s.A(t.read('ob_face3.dat')),f.Jv=new s.A(t.read('ob_face4.dat')),f.$v=new s.A(t.read('ob_face5.dat')),f.Qv=new s.A(t.read('ob_point1.dat')),f.tb=new s.A(t.read('ob_point2.dat')),f.ib=new s.A(t.read('ob_point3.dat')),f.eb=new s.A(t.read('ob_point4.dat')),f.sb=new s.A(t.read('ob_point5.dat')),f.nb=new s.A(t.read('ob_vertex1.dat')),f.rb=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.mf=0,f.Qv.mf=0,f.tb.mf=0,f.ib.mf=0,f.eb.mf=0,f.nb.mf=0,f.rb.mf=0;const i=f.head.pu;f.metadata=new l.fe(i+100,null);let e=0,n=0,r=0,h=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Nd=(t,i,e)=>{const s=t.Fd,n=t.bg,r=t.Dv;let h,o,a,u,d;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.Fd,r=t.bg,h=t.Dv;let o,l,a,c,u;if(s)o=t.Bd,l=t.Ud,a=t.Pd;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let i=0;i{const e=t.Fd,s=t.bg,n=t.Dv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.Bd[i],a=t.Ud[i],c=t.Pd[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.zv&&f.Zv&&f.qv&&f.Jv&&f.$v&&f.Qv&&f.tb&&f.ib&&f.eb&&f.sb&&f.nb&&f.rb&&f.axis))throw new Error('cant loading model!!!!!');const e=i.Fd,s=i.bg,n=i.Dv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),l=new Int32Array(s),a=new Int32Array(s),c=new Int32Array(s),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;i.Uv>=0&&(y=new Int32Array(e));let p=null;i.Hv>=0&&(p=new Int32Array(s));let A=null,m=0;i.Vv>=0?A=new Int32Array(s):m=-i.Vv-1;let g=null;i.Kv>=0&&(g=new Int32Array(s));let I=null;i.Xv>=0&&(I=new Int32Array(s));const _=new Int32Array(s);f.Qv.mf=i.Nv,f.tb.mf=i.Fv,f.ib.mf=i.Bv,f.eb.mf=i.Pv,f.sb.mf=i.Uv;let C,E,v,b=0,T=0,O=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const e=f.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const n=e.Fd,r=e.bg,h=e.Dv,o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n),c=new Int32Array(r),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(h),y=new Int32Array(h),p=new Int32Array(h);let A=null;e.Uv>=0&&(A=new Int32Array(n));let m=null;e.Hv>=0&&(m=new Int32Array(r));let g=null,I=0;e.Vv>=0?g=new Int32Array(r):I=-e.Vv-1;let _=null;e.Kv>=0&&(_=new Int32Array(r));let C=null;e.Xv>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(e.data);v.mf=e.Nv;const b=new s.A(e.data);b.mf=e.Fv;const T=new s.A(e.data);T.mf=e.Bv;const O=new s.A(e.data);O.mf=e.Pv;const R=new s.A(e.data);R.mf=e.Uv;let S,L,x,M=0,k=0,D=0;for(let t=0;tthis.jd&&(this.jd=-e),e>this.gg&&(this.gg=e);const n=i*i+s*s;n>this.IA&&(this.IA=n)}this.IA=Math.sqrt(this.IA)+.99|0,this.Gb=Math.sqrt(this.IA*this.IA+this.jd*this.jd)+.99|0,this.Wb=this.Gb+(Math.sqrt(this.IA*this.IA+this.gg*this.gg)+.99|0)}Wd(){this.jd=0,this.gg=0;for(let t=0;tthis.jd&&(this.jd=-i),i>this.gg&&(this.gg=i)}this.Gb=Math.sqrt(this.IA*this.IA+this.jd*this.jd)+.99|0,this.Wb=this.Gb+(Math.sqrt(this.IA*this.IA+this.gg*this.gg)+.99|0)}Ga(){if(this.Yb){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Vd=new l.fe(i+1,null);for(let e=0;e<=i;e++)this.Vd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Hd=new l.fe(i+1,null);for(let e=0;e<=i;e++)this.Hd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;el;)l=e[o++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==l||0===r.types[i])&&this.jb(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}f.Ir=0,f.bb=0,f._r=0,o=0,l=e[o++];for(let t=0;tl;)l=e[o++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===l||0===r.types[i])&&this.jb(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.Ya(t)}Ya(t){if(!this.Vd||-1===t||!h.A.Do[t])return;const i=h.A.Do[t],e=i.NE;f.Ir=0,f.bb=0,f._r=0;for(let t=0;t>16;this.Pd[t]=this.Ud[t]*i+this.Pd[t]*e>>16,this.Ud[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.Mb&&this.kb&&this.Db||(this.Mb=new Int32Array(this.bg),this.kb=new Int32Array(this.bg),this.Db=new Int32Array(this.bg)),!this.fg){this.fg=new l.fe(this.Fd,null);for(let t=0;t8192||A>8192||m>8192||p<-8192||A<-8192||m<-8192;)p>>=1,A>>=1,m>>=1;let g=0|Math.sqrt(p*p+A*A+m*m);if(g<=0&&(g=1),p=256*p/g|0,A=256*A/g|0,m=256*m/g|0,this.vg&&1&this.vg[i]){const r=t+((e*p+s*A+n*m)/(h+(h/2|0))|0);this.Mu&&(this.Mb[i]=f.xb(this.Mu[i],r,this.vg[i]))}else{let t=this.fg[r];t&&(t.x+=p,t.y+=A,t.z+=m,t.w++),t=this.fg[o],t&&(t.x+=p,t.y+=A,t.z+=m,t.w++),t=this.fg[l],t&&(t.x+=p,t.y+=A,t.z+=m,t.w++)}}if(r)this.wg(t,h,e,s,n);else{this.mg=new l.fe(this.Fd,null);for(let t=0;t>16;for(let s=0;s>16,I=I*w-g*d>>16,g=m),0!==t&&(m=I*a-_*l>>16,_=I*l+_*a>>16,I=m),0!==i&&(m=_*c+g*u>>16,_=_*u-g*c>>16,g=m),g+=n,I+=h,_+=o,m=I*p-_*y>>16,_=I*y+_*p>>16,I=m,f.lb&&f.ab&&f.cb&&(f.cb[s]=_-A,f.lb[s]=r.A.ya+((g<<9)/_|0),f.ab[s]=r.A.pa+((I<<9)/_|0)),this.Dv>0&&f.fb&&f.ub&&f.wb&&(f.fb[s]=g,f.ub[s]=I,f.wb[s]=_)}try{this.qb(!1,!1,0)}catch(t){}}draw(t,i,e,s,h,o,l,a,c){const u=a*h-o*s>>16,d=l*i+u*e>>16,w=this.IA*e>>16,y=d+w;if(y<=50||d>=3500)return;const p=a*s+o*h>>16;let A=p-this.IA<<9;if((A/y|0)>=n.A.ev)return;let m=p+this.IA<<9;if((m/y|0)<=-n.A.ev)return;const g=l*e-u*i>>16,I=this.IA*i>>16;let _=g+I<<9;if((_/y|0)<=-n.A.sv)return;let C=g-(I+(this.jd*e>>16))<<9;if((C/y|0)>=n.A.sv)return;let E=d-(w+(this.jd*i>>16))<=50,v=!1;if(c>0&&f.Tb){let t=d-w;t<=50&&(t=50),p>0?(A=A/y|0,m=m/t|0):(m=m/y|0,A=A/t|0),g>0?(C=C/y|0,_=_/t|0):(_=_/y|0,C=C/t|0);const i=f.Hl-r.A.ya,e=f.Vl-r.A.pa;i>A&&iC&&e<_&&(this.ow?f.Rb[f.Ob++]=c:v=!0)}const b=r.A.ya,T=r.A.pa;let O=0,R=0;0!==t&&(O=r.A.sin[t],R=r.A.cos[t]);for(let n=0;n>16,w=w*R-c*O>>16,c=r),c+=o,u+=l,w+=a,r=w*s+c*h>>16,w=w*h-c*s>>16,c=r,r=u*e-w*i>>16,w=u*i+w*e>>16,u=r,f.cb&&(f.cb[n]=w-d),w>=50&&f.lb&&f.ab?(f.lb[n]=b+((c<<9)/w|0),f.ab[n]=T+((u<<9)/w|0)):f.lb&&(f.lb[n]=-5e3,E=!0),(E||this.Dv>0)&&f.fb&&f.ub&&f.wb&&(f.fb[n]=c,f.ub[n]=u,f.wb[n]=w)}try{this.qb(E,v,c)}catch(t){}}qb(t,i,e,s=!1){f.Sb&&(this.Kb=-1,this.Xb=-1);for(let t=0;tn.A.fI||a>n.A.fI||c>n.A.fI),f.pb&&f.yb){const t=((y+p+A)/3|0)+this.Gb;f.pb[t][f.yb[t]++]=s,f.Sb&&this.Jb(f.Hl,f.Vl,u,d,w,l,a,c)&&this.Xb=0;t--){const i=f.yb[t];if(!(i<=0)&&f.pb){const e=f.pb[t];for(let t=0;t=0;t--){const i=f.yb[t];if(i>0&&f.pb){const e=f.pb[t];for(let s=0;s0||f.Ab[2]>0)&&(r=(f._b[1]+f._b[2])/(f.Ab[1]+f.Ab[2])|0);let h=0;f.Ab&&f._b&&(f.Ab[3]>0||f.Ab[4]>0)&&(h=(f._b[3]+f._b[4])/(f.Ab[3]+f.Ab[4])|0);let o=0;if(f.Ab&&f._b&&(f.Ab[6]>0||f.Ab[8]>0)&&(o=(f._b[6]+f._b[8])/(f.Ab[6]+f.Ab[8])|0),f.Ab&&f.mb){let t,i=0,e=f.Ab[10],n=f.mb[10],l=f.gb;i===e&&(i=0,e=f.Ab[11],n=f.mb[11],l=f.Ib),t=ir;)try{this.$b(n[i++],s),i===e&&n!==f.mb[11]&&(i=0,e=f.Ab[11],n=f.mb[11],l=f.Ib),t=ih;)try{this.$b(n[i++],s),i===e&&n!==f.mb[11]&&(i=0,e=f.Ab[11],n=f.mb[11],l=f.Ib),t=io;)try{this.$b(n[i++],s),i===e&&n!==f.mb[11]&&(i=0,e=f.Ab[11],n=f.mb[11],l=f.Ib),t=i>2,h=this.Bb[i],o=this.Pb[i],l=this.Ub[i];r.A.gI(f.lb[e],f.lb[s],f.lb[n],f.ab[e],f.ab[s],f.ab[n],this.Mb[t],this.kb[t],this.Db[t],f.fb[h],f.ub[h],f.wb[h],f.fb[o],f.fb[l],f.ub[o],f.ub[l],f.wb[o],f.wb[l],this.Mu[t])}else if(3===h&&this.vg&&this.Mu&&this.Mb&&f.lb&&f.ab&&f.fb&&f.ub&&f.wb){const i=this.vg[t]>>2,h=this.Bb[i],o=this.Pb[i],l=this.Ub[i];r.A.gI(f.lb[e],f.lb[s],f.lb[n],f.ab[e],f.ab[s],f.ab[n],this.Mb[t],this.Mb[t],this.Mb[t],f.fb[h],f.ub[h],f.wb[h],f.fb[o],f.fb[l],f.ub[o],f.ub[l],f.wb[o],f.wb[l],this.Mu[t])}}Qb(t,i=!1){let e=0;if(f.wb){const i=r.A.ya,s=r.A.pa,n=this.Tg[t],h=this.Og[t],o=this.Rg[t],l=f.wb[n],a=f.wb[h],c=f.wb[o];if(l>=50&&f.lb&&f.ab&&this.Mb)f.Cb[e]=f.lb[n],f.Eb[e]=f.ab[n],f.vb[e++]=this.Mb[t];else if(f.fb&&f.ub&&this.Mb){const u=f.fb[n],d=f.ub[n],w=this.Mb[t];if(c>=50&&this.Db){const n=(50-l)*r.A.cv[c-l];f.Cb[e]=i+((u+((f.fb[o]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[o]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.Db[t]-w)*n>>16)}if(a>=50&&this.kb){const n=(50-l)*r.A.cv[a-l];f.Cb[e]=i+((u+((f.fb[h]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[h]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.kb[t]-w)*n>>16)}}if(a>=50&&f.lb&&f.ab&&this.kb)f.Cb[e]=f.lb[h],f.Eb[e]=f.ab[h],f.vb[e++]=this.kb[t];else if(f.fb&&f.ub&&this.kb){const u=f.fb[h],d=f.ub[h],w=this.kb[t];if(l>=50&&this.Mb){const h=(50-a)*r.A.cv[l-a];f.Cb[e]=i+((u+((f.fb[n]-u)*h>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[n]-d)*h>>16)<<9)/50|0),f.vb[e++]=w+((this.Mb[t]-w)*h>>16)}if(c>=50&&this.Db){const n=(50-a)*r.A.cv[c-a];f.Cb[e]=i+((u+((f.fb[o]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[o]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.Db[t]-w)*n>>16)}}if(c>=50&&f.lb&&f.ab&&this.Db)f.Cb[e]=f.lb[o],f.Eb[e]=f.ab[o],f.vb[e++]=this.Db[t];else if(f.fb&&f.ub&&this.Db){const u=f.fb[o],d=f.ub[o],w=this.Db[t];if(a>=50&&this.kb){const n=(50-c)*r.A.cv[a-c];f.Cb[e]=i+((u+((f.fb[h]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[h]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.kb[t]-w)*n>>16)}if(l>=50&&this.Mb){const h=(50-c)*r.A.cv[l-c];f.Cb[e]=i+((u+((f.fb[n]-u)*h>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[n]-d)*h>>16)<<9)/50|0),f.vb[e++]=w+((this.Mb[t]-w)*h>>16)}}}const s=f.Cb[0],h=f.Cb[1],o=f.Cb[2],l=f.Eb[0],a=f.Eb[1],c=f.Eb[2];if(!((s-h)*(c-a)-(l-a)*(o-h)<=0))if(r.A.cI=!1,3===e){let e;if((s<0||h<0||o<0||s>n.A.fI||h>n.A.fI||o>n.A.fI)&&(r.A.cI=!0),e=this.vg?3&this.vg[t]:0,i)r.A.rv(s,h,l,a,f.vb[0]),r.A.rv(h,o,a,c,f.vb[1]),r.A.rv(o,s,c,l,f.vb[2]);else if(0===e)r.A.yI(s,h,o,l,a,c,f.vb[0],f.vb[1],f.vb[2]);else if(1===e&&this.Mb)r.A.Lv(s,h,o,l,a,c,r.A.palette[this.Mb[t]]);else if(2===e&&this.vg&&this.Mu&&f.fb&&f.ub&&f.wb){const i=this.vg[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.gI(s,h,o,l,a,c,f.vb[0],f.vb[1],f.vb[2],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t])}else if(3===e&&this.vg&&this.Mu&&this.Mb&&f.fb&&f.ub&&f.wb){const i=this.vg[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.gI(s,h,o,l,a,c,this.Mb[t],this.Mb[t],this.Mb[t],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t])}}else if(4===e){let e;if((s<0||h<0||o<0||s>n.A.fI||h>n.A.fI||o>n.A.fI||f.Cb[3]<0||f.Cb[3]>n.A.fI)&&(r.A.cI=!0),e=this.vg?3&this.vg[t]:0,i)r.A.rv(s,h,l,a,f.vb[0]),r.A.rv(h,o,a,c,f.vb[1]),r.A.rv(o,f.Cb[3],c,f.Eb[3],f.vb[2]),r.A.rv(f.Cb[3],s,f.Eb[3],l,f.vb[3]);else if(0===e)r.A.yI(s,h,o,l,a,c,f.vb[0],f.vb[1],f.vb[2]),r.A.yI(s,o,f.Cb[3],l,c,f.Eb[3],f.vb[0],f.vb[2],f.vb[3]);else if(1===e){if(this.Mb){const i=r.A.palette[this.Mb[t]];r.A.Lv(s,h,o,l,a,c,i),r.A.Lv(s,o,f.Cb[3],l,c,f.Eb[3],i)}}else if(2===e&&this.vg&&this.Mu&&f.fb&&f.ub&&f.wb){const i=this.vg[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.gI(s,h,o,l,a,c,f.vb[0],f.vb[1],f.vb[2],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t]),r.A.gI(s,o,f.Cb[3],l,c,f.Eb[3],f.vb[0],f.vb[2],f.vb[3],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t])}else if(3===e&&this.vg&&this.Mu&&this.Mb&&f.fb&&f.ub&&f.wb){const i=this.vg[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.gI(s,h,o,l,a,c,this.Mb[t],this.Mb[t],this.Mb[t],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t]),r.A.gI(s,o,f.Cb[3],l,c,f.Eb[3],this.Mb[t],this.Mb[t],this.Mb[t],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t])}}}jb(t,i,e,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f.Ir=0,f.bb=0,f._r=0;for(let t=0;t0?(f.Ir=(f.Ir/n|0)+t,f.bb=(f.bb/n|0)+i,f._r=(f._r/n|0)+e):(f.Ir=t,f.bb=i,f._r=e)}else if(1===n)for(let n=0;n=this.Vd.length)continue;const h=this.Vd[r];if(h)for(let s=0;s=this.Vd.length)continue;const o=this.Vd[h];if(o)for(let s=0;s>16;this.Ud[n]=this.Ud[n]*u-this.Bd[n]*c>>16,this.Bd[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.Ud[n]*u-this.Pd[n]*c>>16;this.Pd[n]=this.Ud[n]*c+this.Pd[n]*u>>16,this.Ud[n]=t}if(0!==l){c=r.A.sin[l],u=r.A.cos[l];const t=this.Pd[n]*c+this.Bd[n]*u>>16;this.Pd[n]=this.Pd[n]*u-this.Bd[n]*c>>16,this.Bd[n]=t}this.Bd[n]+=f.Ir,this.Ud[n]+=f.bb,this.Pd[n]+=f._r}}else if(3===n)for(let n=0;n=this.Vd.length)continue;const h=this.Vd[r];if(h)for(let s=0;s=this.Hd.length)continue;const n=this.Hd[e];if(n)for(let i=0;i255&&(this.Fb[e]=255)}}}Zb(){this.jd=0,this.IA=0,this.gg=0,this.Ig=999999,this._g=-999999,this.Eg=-99999,this.Cg=99999;for(let t=0;tthis._g&&(this._g=i),sthis.Eg&&(this.Eg=s),-e>this.jd&&(this.jd=-e),e>this.gg&&(this.gg=e);const n=i*i+s*s;n>this.IA&&(this.IA=n)}this.IA=0|Math.sqrt(this.IA),this.Gb=0|Math.sqrt(this.IA*this.IA+this.jd*this.jd),this.Wb=this.Gb+(0|Math.sqrt(this.IA*this.IA+this.gg*this.gg))}Jb(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{e.d(i,{A:()=>o});var s=e(8950),n=e(1069),r=e(4474),h=e(880);class o extends r.A{mw;width;height;iT;eT;Xl;dw;constructor(t,i){super(),this.mw=new Int32Array(t*i),this.width=this.Xl=t,this.height=this.dw=i,this.iT=this.eT=0}static sT=async(t,i)=>{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(0,h.r)(e),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),l=n.mw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static xu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.mf=s.pu;const h=r.pu,l=r.pu,a=[],c=r.mu-1;for(let t=0;ts.length||r.mf>r.length)throw new Error;const f=r.mu,u=r.mu,d=r.pu,w=r.pu,y=new o(d,w);y.iT=f,y.eT=u,y.Xl=h,y.dw=l;const p=r.mu;if(0===p){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.nT(h,r,this.mw,n,l,s.A.mw,e,o)}Kl(t,i,e){i|=0,e|=0;let n=(i+=this.iT)+(e+=this.eT)*s.A.gw,r=0,h=this.height,o=this.width,l=s.A.gw-o,a=0;if(es.A.bottom&&(h-=e+h-s.A.bottom),is.A.right){const t=i+o-s.A.right;o-=t,a+=t,l+=t}o>0&&h>0&&this.rT(o,h,this.mw,r,a,s.A.mw,n,l,t)}hT(t,i){t|=0,i|=0;let e=(t+=this.iT)+(i+=this.eT)*s.A.gw,n=0,r=this.height,h=this.width,o=s.A.gw-h,l=0;if(is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.oT(h,r,this.mw,n,l,s.A.mw,e,o)}lT(){const t=this.mw,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.mw[s]=(r<<16)+(h<<8)+o}}}xw(t,i,e,n){t|=0,i|=0,e|=0,n|=0;try{const r=this.width;let h=0,o=0;const l=this.Xl,a=this.dw,c=(l<<16)/e|0,f=(a<<16)/n|0;t+=(this.iT*e+l-1)/l|0,i+=(this.eT*n+a-1)/a|0,this.iT*e%l!=0&&(h=(l-this.iT*e%l<<16)/e|0),this.eT*n%a!=0&&(o=(a-this.eT*n%a<<16)/n|0),e=e*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u=t+i*s.A.gw,d=s.A.gw-e;if(is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right){const i=t+e-s.A.right;e-=i,d+=i}this.scale(e,n,this.mw,h,o,s.A.mw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}cT(t,i,e,n,r,h,o,l,a,c){t|=0,i|=0,e|=0,n|=0;try{const f=-e/2|0,u=-n/2|0,d=65536*Math.sin(a/326.11)|0,w=65536*Math.cos(a/326.11)|0,y=d*c>>8,p=w*c>>8;let A=(o<<16)+u*y+f*p,m=u*p-f*y+(l<<16),g=t+i*s.A.gw;for(let t=0;t>16)+(o>>16)*this.width],n+=p,o-=y;A+=y,m+=p,g+=s.A.gw}}catch(t){}}fT(t,i,e){t|=0,i|=0;let n=(t+=this.iT)+(i+=this.eT)*s.A.gw,r=0,h=this.height,o=this.width,l=s.A.gw-o,a=0;if(is.A.bottom&&(h-=i+h-s.A.bottom),ts.A.right){const i=t+o-s.A.right;o-=i,a+=i,l+=i}o>0&&h>0&&this.uT(o,h,this.mw,a,r,s.A.mw,n,l,e.mw)}scale(t,i,e,s,n,r,h,o,l,a,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*l;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=a}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}oT(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}rT(t,i,e,s,n,r,h,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}h+=o,s+=n}}nT(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}uT(t,i,e,s,n,r,h,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++}h+=o,n+=s}}}},1673:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1069),r=e(4474);class h extends r.A{mw;width;height;iT;eT;Xl;dw;palette;constructor(t,i,e){super(),this.mw=new Int8Array(t*i),this.width=this.Xl=t,this.height=this.dw=i,this.iT=this.eT=0,this.palette=e}static xu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.mf=s.pu;const o=r.pu,l=r.pu,a=r.mu,c=new Int32Array(a);for(let t=1;ts.length||r.mf>r.length)throw new Error;const f=r.mu,u=r.mu,d=r.pu,w=r.pu,y=new h(d,w,c);y.iT=f,y.eT=u,y.Xl=o,y.dw=l;const p=y.mw,A=r.mu;if(0===A){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.dT(h,r,this.mw,n,l,s.A.mw,e,o)}lT(){const t=this.mw,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}vv(){this.Xl|=0,this.dw|=0,this.Xl/=2,this.dw/=2,this.Xl|=0,this.dw|=0;const t=new Int8Array(this.Xl*this.dw);let i=0;for(let e=0;e>1)+(e+this.eT>>1)*this.Xl]=this.mw[i++];this.mw=t,this.width=this.Xl,this.height=this.dw,this.iT=0,this.eT=0}xw(){if(this.width===this.Xl&&this.height===this.dw)return;const t=new Int8Array(this.Xl*this.dw);let i=0;for(let e=0;e>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,n){try{const r=this.width;this.height;let h=0,o=0;const l=this.Xl,a=this.dw,c=(l<<16)/e|0,f=(a<<16)/n|0;t=t+(this.iT*e+l-1)/l|0,i=i+(this.eT*n+a-1)/a|0,this.iT*e%l!=0&&(h=(l-this.iT*e%l<<16)/e|0),this.eT*n%a!=0&&(o=(a-this.eT*n%a<<16)/n|0),e=e*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u,d=t+i*s.A.gw,w=s.A.gw-e;is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right&&(u=t+e-s.A.right,e-=u,w+=u),this.wT(s.A.mw,this.mw,this.palette,h,o,d,w,e,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}wT(t,i,e,s,n,r,h,o,l,a,c,f){try{const u=s;for(let d=-l;d<0;d++){const l=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+l];0==n?r++:t[r++]=e[255&n],s+=a}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,e)=>{e.d(i,{A:()=>l});var s=e(8950),n=e(1069),r=e(4474);class h{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}yT(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}pT(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=e(9298);class l extends r.A{static AT='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static mT=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let e=l.AT.indexOf(String.fromCharCode(i));t&&e>=63&&e--,-1===e&&(e=74),l.mT[i]=e}}gT=[];IT=new Int32Array(94);_T=new Int32Array(94);CT=new Int32Array(94);ET=new Int32Array(94);vT=new Int32Array(95);bT=new Int32Array(256);random=new h(BigInt(Date.now()));height=0;static xu=(t,i)=>{const e=new n.A(t.read(i+'.dat')),s=new n.A(t.read('index.dat'));s.mf=e.pu+4;const r=s.mu;r>0&&(s.mf+=3*(r-1));const h=new l;for(let t=0;t<94;t++){h.CT[t]=s.mu,h.ET[t]=s.mu;const i=h.IT[t]=s.pu,n=h._T[t]=s.pu,r=s.mu,o=i*n;if(h.gT[t]=new Int8Array(o),0===r)for(let s=0;sh.height&&(h.height=n),h.CT[t]=1,h.vT[t]=i+2;{let e=0;for(let s=n/7|0;s=s.A.bottom&&(r-=e+r+1-s.A.bottom),i=s.A.right){const t=i+n+1-s.A.right;n-=t,a+=t,l+=t}n>0&&r>0&&this.DT(n,r,t,c,a,s.A.mw,o,l,h)}xT(t,i,e,n,r,h,o){e|=0,n|=0;let l=(t|=0)+(i|=0)*s.A.gw,a=s.A.gw-e,c=0,f=0;if(i=s.A.bottom&&(n-=i+n+1-s.A.bottom),t=s.A.right){const i=t+e+1-s.A.right;e-=i,c+=i,a+=i}e>0&&n>0&&this.NT(e,n,s.A.mw,l,a,o,f,c,r,h)}DT(t,i,e,s,n,r,h,o,l){const a=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=a;t<0;t++)0===e[s++]?h++:r[h++]=l,0===e[s++]?h++:r[h++]=l,0===e[s++]?h++:r[h++]=l,0===e[s++]?h++:r[h++]=l;for(let i=t;i<0;i++)0===e[s++]?h++:r[h++]=l;h+=o,s+=n}}NT(t,i,e,s,n,r,h,o,l,a){t|=0;const c=((16711935&l)*a&4278255360)+((65280&l)*a&16711680)>>8,f=256-a;for(let l=-(i|=0);l<0;l++){for(let i=-t;i<0;i++)if(0===r[h++])s++;else{const t=e[s];e[s++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}s+=n,h+=o}}OT(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.ql:'cya'===t?o.A.GE:'mag'===t?o.A.fA:'whi'===t?o.A.Ll:'bla'===t?o.A.Zl:'lre'===t?o.A.YE:'dre'===t?o.A.HE:'dbl'===t?o.A.VE:'or1'===t?o.A.KE:'or2'===t?o.A.XE:'or3'===t?o.A.jE:'gr1'===t?o.A.zE:'gr2'===t?o.A.ZE:'gr3'===t?o.A.qE:o.A.Zl}split(t,i){if(0===t.length)return[t];const e=[];for(;t.length>0;){if(this.RT(t)<=i&&-1===t.indexOf('|')){e.push(t);break}let s=t.length;for(let e=0;ei)break;s=e}else if('|'===t[e]){s=e;break}e.push(t.substring(0,s)),t=t.substring(s+1)}return e}}},1183:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(8950),n=e(7854);class r{FT;width;height;BT;PT;mw;constructor(t,i,e=n.nl){this.BT=e,this.FT=this.BT.getImageData(0,0,t,i),this.PT=new Uint32Array(this.FT.data.buffer),this.mw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.mw.fill(0)}bind(){s.A.bind(this.mw,this.width,this.height)}draw(t,i){this.#t(),this.BT.putImageData(this.FT,t,i)}#t(){const t=this.mw.length,i=this.mw,e=this.PT;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,i,e)=>{e.d(i,{A:()=>s});class s{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));zo=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Qo=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};UT=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}},2901:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(1908);class r{static UT=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.GT)return null;if(this.XT[t])return this.XT[t];const i=this.KT[t],e=i+this.VT[t];if(this.WT){const s=Uint8Array.from(this.buffer.subarray(i,i+e));return this.XT[t]=s,s}{const i=Uint8Array.from(n.A.read(this.HT[t],this.buffer,this.VT[t],this.KT[t]));return this.XT[t]=i,i}}}},1069:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(9234),n=e(6666),r=e(4474);class h extends r.A{static zT=3988292384;static ZT=new Int32Array(256);static qT=new Uint32Array(33);static JT=new n.A;static $T=new n.A;static QT=new n.A;static tO=0;static iO=0;static eO=0;static{for(let t=0;t<32;t++)h.qT[t]=(1<>>=1:i=i>>>1^h.zT;h.ZT[t]=i}}static Zo=t=>{let i=4294967295;for(let e=0;e>>8^h.ZT[255&(i^t[e])];return~i};view;data;mf=0;sO=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.mf}static Pt=t=>{let i=null;return 0===t&&h.tO>0?(h.tO--,i=h.JT.Xg()):1===t&&h.iO>0?(h.iO--,i=h.$T.Xg()):2===t&&h.eO>0&&(h.eO--,i=h.QT.Xg()),i?(i.mf=0,i):new h(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.mf=0,100===this.view.byteLength&&h.tO<1e3?(h.JT.Gp(this),h.tO++):5e3===this.view.byteLength&&h.iO<250?(h.$T.Gp(this),h.iO++):3e4===this.view.byteLength&&h.eO<50&&(h.QT.Gp(this),h.eO++)}get mu(){return this.view.getUint8(this.mf++)}get Dd(){return this.view.getInt8(this.mf++)}get pu(){const t=this.view.getUint16(this.mf);return this.mf+=2,t}get Iu(){const t=this.view.getInt16(this.mf);return this.mf+=2,t}get qu(){const t=this.view.getUint8(this.mf++)<<16|this.view.getUint16(this.mf);return this.mf+=2,t}get il(){const t=this.view.getInt32(this.mf);return this.mf+=4,t}get hE(){const t=this.view.getBigInt64(this.mf);return this.mf+=8,t}get FE(){return this.view.getUint8(this.mf)<128?this.mu-64:this.pu-49152}get gA(){return this.view.getUint8(this.mf)<128?this.mu:this.pu-32768}get Eu(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.mf++))&&this.mf>16),this.view.setUint16(this.mf,t),this.mf+=2}p4(t){this.view.setInt32(this.mf,t),this.mf+=4}oO(t){this.view.setInt32(this.mf,t,!0),this.mf+=4}lO(t){this.view.setBigInt64(this.mf,t),this.mf+=8}aO(t){const i=this.view,e=t.length;for(let s=0;s>>3}wO(t){let i=this.sO>>>3,e=8-(7&this.sO),s=0;for(this.sO+=t;t>e;e=8)s+=(this.view.getUint8(i++)&h.qT[e])<>>e-t&h.qT[t],s}yO(t,i){const e=this.mf;this.mf=0;const n=new Uint8Array(e);this.nO(e,0,n);const r=(0,s.pO)(n),h=(0,s.AO)(r,i,t),o=(0,s.mO)(h);this.mf=0,this.p1(o.length),this.cO(o,o.length,0)}}},5226:(t,i,e)=>{e.d(i,{Q:()=>n,x:()=>s});class s{gO=new Map;Eo;xo=self.isSecureContext?self.crypto.randomUUID():'0';constructor(t){this.Eo=t}async Ko(){const t=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),i=t.createDataChannel('channel'),e=crypto.randomUUID();this.gO.set(e,i),await t.setLocalDescription(await t.createOffer()),t.onicegatheringstatechange=async()=>{if('complete'===t.iceGatheringState){let i;self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(t.localDescription)):console.log(JSON.stringify(t.localDescription));try{for(;null===(i=prompt('Offer copied to clipboard, paste answer here')););t.setRemoteDescription(new RTCSessionDescription(JSON.parse(i)))}catch(t){console.error(t)}}},i.onopen=()=>{i.send(JSON.stringify({type:'id',id:e})),console.log('Connected to peer!')},i.onerror=t=>{console.error(t)},i.onmessage=t=>{const i=JSON.parse(t.data);i.data&&(i.data=Object.values(i.data)),this.Eo&&this.Eo.postMessage(i)}}postMessage(t){const i=this.gO.get(t.data.id),e=t.data;e.data&&(e.data=Array.from(t.data.data)),i&&'open'===i.readyState&&i.send(JSON.stringify(e))}}class n{pc;Lo=void 0;xo;constructor(t){this.pc=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),this.pc.ondatachannel=i=>{this.Lo=i.channel,this.Lo.onopen=()=>{console.log('Connected to host!')},this.Lo.onerror=t=>{console.error(t)},this.Lo.onmessage=i=>{if(!this.xo){const t=JSON.parse(i.data);if('id'===t.type)return void(this.xo=t.id)}t.onmessage&&t.onmessage(i)}},this.pc.onicegatheringstatechange=async()=>{'complete'===this.pc.iceGatheringState&&(self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(this.pc.localDescription)):console.log(JSON.stringify(this.pc.localDescription)))}}async Xo(t){await this.pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(t))),await this.pc.setLocalDescription(await this.pc.createAnswer())}}},3867:(t,i,e)=>{e.d(i,{rA:()=>a,nA:()=>o,fe:()=>s,OA:()=>n,Eh:()=>r,EA:()=>h,Xr:()=>l});class s extends Array{constructor(t,i){super(t);for(let e=0;e{e.d(i,{mO:()=>o,Jo:()=>n,pO:()=>h,$o:()=>s,ec:()=>r,AO:()=>l});const s=async t=>new Promise((i=>setTimeout(i,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),r=async t=>(await fetch(t)).text();function h(t){let i=0n;for(let e=0;e0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function l(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}},9073:(t,i,e)=>{e.a(t,(async(t,i)=>{try{var s=e(1908),n=e(2901),r=e(9234),h=e(1069),o=e(7604),l=e(7046),a=e(3867),c=e(1673),f=e(2511),u=e(2682),d=e(8950),w=e(4544),y=e(1651);class t extends l.A{static IO=!1;static _O=!0;db=null;CO=3200;EO=3200;sizeX=1280;sizeZ=1344;vO=2240;bO=2752;TO=1e3;OO=0;RO=[];SO=[];LO=[];xO=[];MO=[0];kO=[0];DO=[];NO=[];FO=[];BO=[];PO=[];UO=[];WO=[];GO=[];we=[];ye=[];Ie=null;_e=null;Ce=null;Ee=null;YO=null;HO=[];VO=!0;KO=0;XO=-1;jO=-1;zO=-1;ZO=-1;qO=!1;JO=['General Store','Sword Shop','Magic Shop','Axe Shop','Helmet Shop','Bank','Quest Start','Amulet Shop','Mining Site','Furnace','Anvil','Combat Training','Dungeon','Staff Shop','Platebody Shop','Platelegs Shop','Scimitar Shop','Archery Shop','Shield Shop','Altar','Herbalist','Jewelery','Gem Shop','Crafting Shop','Candle Shop','Fishing Shop','Fishing Spot','Clothes Shop','Apothecary','Silk Trader','Kebab Seller','Pub/Bar','Mace Shop','Tannery','Rare Trees','Spinning Wheel','Food Shop','Cookery Shop','???','Water Source','Cooking Range','Skirt Shop','Potters Wheel','Windmill','Mining Shop','Chainmail Shop','Silver Shop','Fur Trader','Spice Shop'];$O=5;QO=13;tR=140;iR=470;eR=!1;sR=0;nR=0;rR=-1;hR=0;oR=0;lR=0;aR=new Int32Array(2e3);cR=new Int32Array(2e3);fR=new Int32Array(2e3);Un=new Int32Array(2e3);Wn=new Int32Array(2e3);Pe=new Int32Array(2e3);Pn=0;uR=null;dR=200;wR=this.dR*this.sizeX/this.sizeZ|0;yR=635-this.wR-5;pR=503-this.dR-20;AR=!1;mR=8943445;gR=7824964;IR=6706483;_R=11141120;CR=10027008;ER=8912896;zoom=4;vR=4;offsetX=this.CO-this.vO;Hy=this.bO+this.sizeZ-this.EO;load=async()=>{await s.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new w.A(await w.A.openDatabase());const t=await this.bR();await this.qo(100,'Please wait... Rendering Map');const i=new h.A(t.read('labels.dat'));this.OO=i.pu;for(let t=0;t{if(this.VO){this.VO=!1,this.KO=0,d.A.clear();const t=this.offsetX-(635/this.zoom|0),i=this.Hy-(503/this.zoom|0),e=this.offsetX+(635/this.zoom|0),s=this.Hy+(503/this.zoom|0);if(this.kR(t,i,e,s,0,0,635,503),this.AR&&(this.uR?.hT(this.yR,this.pR),d.A.hv(this.yR+this.wR*t/this.sizeX|0,this.pR+this.dR*i/this.sizeZ|0,(e-t)*this.wR/this.sizeX|0,(s-i)*this.dR/this.sizeZ|0,16711680,128),d.A.Sl(this.yR+this.wR*t/this.sizeX|0,this.pR+this.dR*i/this.sizeZ|0,(e-t)*this.wR/this.sizeX|0,(s-i)*this.dR/this.sizeZ|0,16711680),this.lR>0&&this.lR%10<5))for(let t=0;t0&&this.lR%10<5&&this.oR==i+this.nR&&(e=16776960),this.YO?.jl(this.$O+20,t+13,this.JO[i+this.nR],e)}t+=17}}this.jl(this.yR,this.pR+this.dR,this.wR,18,this.mR,this.gR,this.IR,'Overview'),this.jl(this.$O,this.QO+this.iR,this.tR,18,this.mR,this.gR,this.IR,'Key'),3==this.vR?this.jl(170,471,50,30,this._R,this.CR,this.ER,'37%'):this.jl(170,471,50,30,this.mR,this.gR,this.IR,'37%'),4==this.vR?this.jl(230,471,50,30,this._R,this.CR,this.ER,'50%'):this.jl(230,471,50,30,this.mR,this.gR,this.IR,'50%'),6==this.vR?this.jl(290,471,50,30,this._R,this.CR,this.ER,'75%'):this.jl(290,471,50,30,this.mR,this.gR,this.IR,'75%'),8==this.vR?this.jl(350,471,50,30,this._R,this.CR,this.ER,'100%'):this.jl(350,471,50,30,this.mR,this.gR,this.IR,'100%')}this.KO--,this.KO<=0&&(this.Fo?.draw(0,0),this.KO=50)};refresh=async()=>{this.KO=0};update=async()=>{1==this.Cc[1]&&(this.offsetX=this.offsetX-16/this.zoom|0,this.VO=!0),1==this.Cc[2]&&(this.offsetX=this.offsetX+16/this.zoom|0,this.VO=!0),1==this.Cc[3]&&(this.Hy=this.Hy-16/this.zoom|0,this.VO=!0),1==this.Cc[4]&&(this.Hy=this.Hy+16/this.zoom|0,this.VO=!0);let t=1;for(;t>0;)t=this.Wc(),49==t?(this.vR=3,this.VO=!0):50==t?(this.vR=4,this.VO=!0):51==t?(this.vR=6,this.VO=!0):52==t?(this.vR=8,this.VO=!0):107==t||75==t?(this.eR=!this.eR,this.VO=!0):111!=t&&79!=t||(this.AR=!this.AR,this.VO=!0);if(1==this.gc&&(this.XO=this.Ic,this.jO=this._c,this.zO=this.offsetX,this.ZO=this.Hy,this.Ic>170&&this.Ic<220&&this._c>471&&this._c<503?(this.vR=3,this.XO=-1):this.Ic>230&&this.Ic<280&&this._c>471&&this._c<503?(this.vR=4,this.XO=-1):this.Ic>290&&this.Ic<340&&this._c>471&&this._c<503?(this.vR=6,this.XO=-1):this.Ic>350&&this.Ic<400&&this._c>471&&this._c<503?(this.vR=8,this.XO=-1):this.Ic>this.$O&&this._c>this.QO+this.iR&&this.Icthis.yR&&this._c>this.pR+this.dR&&this.Icthis.$O&&this._c>this.QO&&this.Icthis.$O&&this._c>this.QO&&this.Icthis.$O&&this._c>this.QO+this.iR-18&&this.Icthis.$O&&this.Hl=t&&this.Vlthis.yR&&i>this.pR&&tthis.vR&&(this.zoom=this.vR)),this.zoom>this.vR&&(this.VO=!0,this.zoom-=this.zoom/30,this.zoomthis.sR&&(this.VO=!0,this.nR--),this.lR>0&&(this.VO=!0,this.lR--);const i=this.offsetX-(635/this.zoom|0),e=this.Hy-(503/this.zoom|0),s=this.offsetX+(635/this.zoom|0),n=this.Hy+(503/this.zoom|0);i<48&&(this.offsetX=48+(635/this.zoom|0)),e<48&&(this.Hy=48+(503/this.zoom|0)),s>this.sizeX-48&&(this.offsetX=this.sizeX-48-(635/this.zoom|0)),n>this.sizeZ-48&&(this.Hy=this.sizeZ-48-(503/this.zoom|0))};async bR(){let t=await(this.db?.zo('worldmap.dat'));if(t)return new n.A(t);let i=5;for(;!t;){await this.qo(0,'Requesting map');try{console.log(`${y.K.nt}/worldmap.jag`),t=await(0,r.Jo)(`${y.K.nt}/worldmap.jag`)}catch(e){t=void 0;for(let t=i;t>0;t--)await this.qo(0,`Error loading - Will retry in ${t} secs.`),await(0,r.$o)(1e3);i*=2,i>60&&(i=60)}}return await(this.db?.Qo('worldmap.dat',t)),new n.A(t)}jl(t,i,e,s,n,r,h,o){t=Math.trunc(t),i=Math.trunc(i),e=Math.trunc(e),s=Math.trunc(s),d.A.Sl(t,i,e,s,0);const l=t+1,a=i+1,c=e-2,f=s-2;d.A.fillRect(l,a,c,f,r),d.A.yl(l,a,n,c),d.A.dl(l,a,n,f),d.A.yl(l,a+f-1,h,c),d.A.dl(l+c-1,a,h,f),this.YO?.ST(l+c/2+1,a+f/2+1+4,o,0),this.YO?.ST(l+c/2,a+f/2+4,o,16777215)}MR(){for(let t=0;t10&&s>20)-(o>>20),n+=(i>>10&1023)-(o>>10&1023),r+=(1023&i)-(1023&o),r>0&&(this.HO[s][h]=this.DR(t/8533,n/8533,r/8533))}}}}TR(t){for(;t.available>0;){const i=64*t.mu-this.vO,e=64*t.mu-this.bO;if(i>0&&e>0&&i+640;){const i=64*t.mu-this.vO,e=64*t.mu-this.bO;if(i>0&&e>0&&i+640;){const i=64*t.mu-this.vO,e=64*t.mu-this.bO;if(i>0&&e>0&&i+640;){const i=64*t.mu-this.vO,e=64*t.mu-this.bO;if(i>0&&e>0&&i+640;){const i=64*t.mu-this.vO,e=64*t.mu-this.bO;if(i>0&&e>0&&i+641&&l--;let a=t-.3333333333333333;a<0&&a++,s=6*l<1?o+6*(h-o)*l:2*l<1?h:3*l<2?o+(h-o)*(.6666666666666666-l)*6:o,n=6*t<1?o+6*(h-o)*t:2*t<1?h:3*t<2?o+(h-o)*(.6666666666666666-t)*6:o,r=6*a<1?o+6*(h-o)*a:2*a<1?h:3*a<2?o+(h-o)*(.6666666666666666-a)*6:o}return((256*s|0)<<16)+((256*n|0)<<8)+(256*r|0)}kR(i,e,s,n,r,h,o,l){const a=s-i,c=n-e,f=(o-r<<16)/a|0,u=(l-h<<16)/c|0;for(let t=0;t>16,n=f*(t+1)>>16;const o=n-s;if(!(o<=0)){s+=r,n+=r;for(let r=0;r>16,a=u*(r+1)>>16;const c=a-l;if(c<=0)continue;l+=h,a+=h;const f=this.NO[t+i][r+e];if(0===f)d.A.fillRect(s,l,n-s,a-l,this.HO[t+i][r+e]);else{const n=this.FO[t+i][r+e],h=252&n;0==h||o<=1||c<=1?d.A.fillRect(s,l,o,c,f):this.NR(d.A.mw,l*d.A.gw+s,this.HO[t+i][r+e],f,o,c,h>>2,3&n)}}}}if(s-i>o-r)return;let w=0;for(let t=0;t>16,n=f*(t+1)>>16;const o=n-s;if(!(o<=0)){s+=r,n+=r;for(let r=0;r>16,a=u*(r+1)>>16;const c=a-l;if(c<=0)continue;l+=h,a+=h;let f=255&this.BO[t+i][r+e];if(0!=f){let t,i;t=1==o?s:n-1,i=1==c?l:a-1;let e=13421772;if((f>=5&&f<=8||f>=13&&f<=16||f>=21&&f<=24)&&(e=13369344,f-=4),27!=f&&28!=f||(e=13369344,f-=2),1==f)d.A.dl(s,l,e,c);else if(2==f)d.A.yl(s,l,e,o);else if(3==f)d.A.dl(t,l,e,c);else if(4==f)d.A.yl(s,i,e,o);else if(9==f)d.A.dl(s,l,16777215,c),d.A.yl(s,l,e,o);else if(10==f)d.A.dl(t,l,16777215,c),d.A.yl(s,l,e,o);else if(11==f)d.A.dl(t,l,16777215,c),d.A.yl(s,i,e,o);else if(12==f)d.A.dl(s,l,16777215,c),d.A.yl(s,i,e,o);else if(17==f)d.A.yl(s,l,e,1);else if(18==f)d.A.yl(t,l,e,1);else if(19==f)d.A.yl(t,i,e,1);else if(20==f)d.A.yl(s,i,e,1);else if(25==f)for(let t=0;t>16,n=f*(t+1)>>16;if(!(n-s<=0)){s+=r,n+=r;for(let n=0;n>16,o=u*(n+1)>>16;o-r<=0||(r+=h,o+=h,this.WO[t+i][n+e]&&this.Ie?.draw(s,r))}}}for(let t=0;t>16,n=f*(t+1)>>16;if(!(n-s<=0)){s+=r,n+=r;for(let n=0;n>16,o=u*(n+1)>>16;o-r<=0||(r+=h,o+=h,this.GO[t+i][n+e]&&this._e?.draw(s,r))}}}for(let t=0;t0)for(let t=0;t=71&&a<=73?this.YO?.ST((y+u)/2,(p+w)/2,'u_pass',16711680):t>=32&&t<=34&&a>=70&&a<=74&&this.YO?.ST((y+u)/2,(p+w)/2,'u_pass',16776960)}}NR(t,i,e,s,n,r,h,o){const l=d.A.gw-n;if(9==h?(h=1,o=o+1&3):10==h?(h=1,o=o+3&3):11==h&&(h=8,o=o+3&3),1==h){if(0==o)for(let h=0;h=0;h--){for(let r=0;r=h?s:e;i+=l}else if(3==o)for(let h=r-1;h>=0;h--){for(let r=0;r=h?s:e;i+=l}}else if(2==h){if(0==o)for(let h=r-1;h>=0;h--){for(let r=0;r>1?s:e;i+=l}else if(1==o)for(let h=0;h=h<<1?s:e;i+=l}else if(2==o)for(let h=0;h=0;r--)t[i++]=r<=h>>1?s:e;i+=l}else if(3==o)for(let h=r-1;h>=0;h--){for(let r=n-1;r>=0;r--)t[i++]=r>=h<<1?s:e;i+=l}}else if(3==h){if(0==o)for(let h=r-1;h>=0;h--){for(let r=n-1;r>=0;r--)t[i++]=r<=h>>1?s:e;i+=l}else if(1==o)for(let h=r-1;h>=0;h--){for(let r=0;r=h<<1?s:e;i+=l}else if(2==o)for(let h=0;h>1?s:e;i+=l}else if(3==o)for(let h=0;h=0;r--)t[i++]=r>=h<<1?s:e;i+=l}}else if(4==h){if(0==o)for(let h=r-1;h>=0;h--){for(let r=0;r=h>>1?s:e;i+=l}else if(1==o)for(let h=0;h=0;r--)t[i++]=r>=h>>1?s:e;i+=l}else if(3==o)for(let h=r-1;h>=0;h--){for(let r=n-1;r>=0;r--)t[i++]=r<=h<<1?s:e;i+=l}}else if(5==h){if(0==o)for(let h=r-1;h>=0;h--){for(let r=n-1;r>=0;r--)t[i++]=r>=h>>1?s:e;i+=l}else if(1==o)for(let h=r-1;h>=0;h--){for(let r=0;r=h>>1?s:e;i+=l}else if(3==o)for(let h=0;h=0;r--)t[i++]=r<=h<<1?s:e;i+=l}}else if(6==h){if(0==o)for(let h=0;h=n/2?s:e;i+=l}else if(3==o)for(let h=0;h=r/2?s:e;i+=l}}else if(7==h){if(0==o)for(let h=0;h=0;h--){for(let o=0;o=0;h--){for(let o=n-1;o>=0;o--)t[i++]=o<=h-r/2?s:e;i+=l}else if(3==o)for(let h=0;h=0;o--)t[i++]=o<=h-r/2?s:e;i+=l}}else if(8==h)if(0==o)for(let h=0;h=h-r/2?s:e;i+=l}else if(1==o)for(let h=r-1;h>=0;h--){for(let o=0;o=h-r/2?s:e;i+=l}else if(2==o)for(let h=r-1;h>=0;h--){for(let o=n-1;o>=0;o--)t[i++]=o>=h-r/2?s:e;i+=l}else if(3==o)for(let h=0;h=0;o--)t[i++]=o>=h-r/2?s:e;i+=l}}Bo(){return 0}Po(){return!1}Uo(){return!1}Wo(){return-1}Go(){return-1}}await(0,o.w)(),(new t).run().then((()=>{})),window.onkeydown=function(t){return!(' '===t.key&&t.target===document.body)},i()}catch(t){i(t)}}),1)},1908:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(9763);class n{static FR=null;static load=async t=>{this.FR=await(0,s.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,e,s)=>{if(!this.FR)throw new Error('bz2 not found!!');return Int8Array.from(this.FR.read(t,i,e,s))}}},123:(t,i,e)=>{function s(t,i,e){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256,e)}function n(t){window._tinyMidiStop&&window._tinyMidiStop(t)}e.d(i,{el:()=>s,Mo:()=>n})},2604:(t,i,e)=>{function s(t,i){var e;(e=document.createElement('a')).href=t,e.download=i,document.body.appendChild(e),e.style='display: none',e.click(),e.remove()}e.d(i,{A:()=>s})},9763:(t,i,e)=>{async function s(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,l=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,l,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(a,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}e.d(i,{F:()=>s})},9896:(t,i,e)=>{var s=e(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{const t=2,i=44100;let e=new Float32Array,n=window.audioContext.createGain();n.gain.setValueAtTime(.1,window.audioContext.currentTime),n.connect(window.audioContext.destination);let r=window.audioContext.currentTime,h=[];const o=new s.A({BR:30,PR:t=>{let i=new Float32Array(t.buffer),s=new Float32Array(e.length+i.length);s.set(e,0),s.set(i,e.length),e=s},UR:t=>{},bufferSize:102400});await o.init();const l=await fetch('./SCC1_Florestan.sf2'),a=new Uint8Array(await l.arrayBuffer());function c(){if(!window.audioContext||!e.length)return;let s=window.audioContext.createBufferSource();const o=e.length/t,l=window.audioContext.createBuffer(t,o,i);for(let i=0;i{t.stop(window.audioContext.currentTime)})),h=[],n.gain.setValueAtTime(t,window.audioContext.currentTime)}}function d(t,i){-1!==t&&window._tinyMidiVolume(t),r=window.audioContext.currentTime,f=setInterval(c,250),o.WR(i)}o.GR(a),window._tinyMidiStop=async t=>{t?function(t){const i=window.audioContext.currentTime;n.gain.cancelScheduledValues(i),n.gain.setTargetAtTime(0,i,.5),setTimeout(t,2e3)}((()=>{u()})):u()},window._tinyMidiVolume=(t=1)=>{n.gain.setValueAtTime(t,window.audioContext.currentTime)},window._tinyMidiPlay=async(t,i,e)=>{t&&(await window._tinyMidiStop(e),e?setTimeout((()=>{d(i,t)}),2e3):d(i,t))}})()},8151:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5473);const n=class{constructor(t={}){this.YR=void 0,this.HR=0,this.VR=0,this.KR=0,this.BR=t.BR||100,this.sampleRate=t.sampleRate||44100,this.XR=t.XR||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.jR(1),this.PR=t.PR||(()=>{}),this.UR=t.UR||(()=>{}),this.zR=void 0,this.test=0}async init(){if(!this.YR){if('undefined'!=typeof process){const{ZR:t}=await import('path'),{qR:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.YR=await(0,s.A)(),this.JR=this.YR._malloc(this.bufferSize),this.$R=this.YR._malloc(8)}}jR(t){this.bufferSize=4*this.sampleRate*this.XR*t}QR(){if(!this.YR)throw new Error(`${this.constructor.name} not initalized. call .init()`)}GR(t){this.QR();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.YR;e(this.HR),this.HR=i(t.length),this.YR.HEAPU8.set(t,this.HR),this.VR=s(this.HR,t.length),n(this.VR,2===this.XR?0:2,this.sampleRate,this.gain)}tS(){this.QR();const t=new Uint8Array(this.bufferSize);return t.set(this.YR.HEAPU8.subarray(this.JR,this.JR+this.bufferSize)),t}iS(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.YR;return e(this.KR),this.KR=i(t.length),this.YR.HEAPU8.set(t,this.KR),s(this.KR,t.length)}eS(t){const{_midi_render:i}=this.YR;return i(this.VR,t,this.XR,this.sampleRate,this.JR,this.bufferSize,this.$R)}WR(t){if(this.QR(),!this.VR)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.zR);const{setValue:i,getValue:e}=this.YR;i(this.$R,0,'double'),this.YR._tsf_reset(this.VR),this.YR._tsf_channel_set_bank_preset(this.VR,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.iS(t);const n=()=>{s=this.eS(s);const t=this.tS();this.PR(t),s?this.zR=setTimeout(n,this.BR):this.UR(e(this.$R,'double'))};this.zR=setTimeout(n,16)}}},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,e)=>{var s;e.d(i,{A:()=>n});const n=(s="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,n,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,e){i=t,n=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(r.ready,t)||Object.defineProperty(r.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var h=Object.assign({},r),o=[],l='object'==typeof window,a='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!l&&!c&&!a;if(r.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var p,A;y=a?require('path').ZR(y)+'/':__dirname+'/';var m=()=>{A||(p=require('fs'),A=require('path'))};u=(t,i)=>(m(),t=A.normalize(t),p.sS(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,e)=>{m(),t=A.normalize(t),p.nS(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),r.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,e){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!l&&!a)throw new Error('environment detection error');if(a?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),s&&(y=s),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},a&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}r.print||console.log.bind(console);var g,I,_=r.printErr||console.warn.bind(console);function C(t,i){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(r,h),h=null,g='fetchSettings',Object.getOwnPropertyDescriptor(r,g)&&j('`Module.'+g+'` was supplied but `'+g+'` not included in INCOMING_MODULE_JS_API'),r.arguments&&(o=r.arguments),C('arguments','arguments_'),r.thisProgram&&r.thisProgram,C('thisProgram','thisProgram'),r.quit&&r.quit,C('quit','quit_'),D(void 0===r.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===r.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===r.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===r.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===r.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),r.wasmBinary&&(I=r.wasmBinary),C('wasmBinary','wasmBinary');var v;r.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,O,R,S,L,x,M,k=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function N(t){b=t,r.HEAP8=T=new Int8Array(t),r.HEAP16=R=new Int16Array(t),r.HEAP32=S=new Int32Array(t),r.HEAPU8=O=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=L=new Uint32Array(t),r.HEAPF32=x=new Float32Array(t),r.HEAPF64=M=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var F=5242880;r.TOTAL_STACK&&D(F===r.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=r.INITIAL_MEMORY||16777216;function P(){if(!k){var t=ft(),i=L[t>>2],e=L[t+4>>2];34821223==i&&2310721022==e||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==L[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=F,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+F+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!r.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var U=[],W=[],G=[],Y=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var H=0,V=null,K=null,X={};function j(t){r.onAbort&&r.onAbort(t),_(t='Aborted('+t+')'),k=!0;var i=new WebAssembly.RuntimeError(t);throw n(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},rS:function(){z.error()},hS:function(){z.error()},oS:function(){z.error()},open:function(){z.error()},lS:function(){z.error()},aS:function(){z.error()},cS:function(){z.error()},fS:function(){z.error()},uS:function(){z.error()}};r.FS_createDataFile=z.rS,r.FS_createPreloadedFile=z.hS;var Z,q,J,$,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=r.asm),D(Y,'native function `'+e+'` called before runtime initialization'),s[t]||D(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==Z&&I)return new Uint8Array(I);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(r)}function ht(t){ht.dS||(ht.dS={}),ht.dS[t]||(ht.dS[t]=1,c&&(t='warning: '+t),_(t))}function ot(t){try{return v.grow(t-b.byteLength+65535>>>16),N(v.buffer),1}catch(i){_('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}r.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=r.locateFile?r.locateFile(q,y):y+q):Z=new URL(e(8227),e.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,e){O.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=O.length;D((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return _('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return _('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function e(t,i){var e,s=t.exports;r.asm=s,D(v=r.asm.memory,"memory not found in wasm exports"),N(v.buffer),D(r.asm.__indirect_function_table,"table not found in wasm exports"),e=r.asm.__wasm_call_ctors,W.unshift(e),function(t){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(X[t]),delete X[t]):_('warning: run dependency removed without ID'),0==H&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',H++,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(k)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,_('still waiting on run dependencies:')),_('dependency: '+i);t&&_('(end of list)')}),1e4))):_('warning: run dependency added without ID');var s=r;function h(t){D(r===s,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),s=null,e(t.instance)}function o(t){return function(){if(!I&&(l||a)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return st(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){_('failed to asynchronously prepare wasm: '+t),it(Z)&&_('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(r.instantiateWasm)try{return r.instantiateWasm(i,e)}catch(t){_('Module.instantiateWasm callback failed with error: '+t),n(t)}(I||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(h):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return _('wasm streaming compile failed: '+t),_('falling back to ArrayBuffer instantiation'),o(h)}))}))).catch(n)}(),r.___wasm_call_ctors=et("__wasm_call_ctors"),r._malloc=et("malloc"),r._free=et("free"),r._tsf_load_memory=et("tsf_load_memory"),r._tsf_close=et("tsf_close"),r._tsf_reset=et("tsf_reset"),r._tsf_set_output=et("tsf_set_output"),r._tsf_set_max_voices=et("tsf_set_max_voices"),r._realloc=et("realloc"),r._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),r._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),r._tml_load_memory=et("tml_load_memory"),r._midi_render=et("midi_render"),r.___errno_location=et("__errno_location"),r._fflush=et("fflush"),r._emscripten_stack_init=function(){return(ct=r._emscripten_stack_init=r.asm.emscripten_stack_init).apply(null,arguments)}),ft=(r._emscripten_stack_get_free=function(){return(r._emscripten_stack_get_free=r.asm.emscripten_stack_get_free).apply(null,arguments)},r._emscripten_stack_get_base=function(){return(r._emscripten_stack_get_base=r.asm.emscripten_stack_get_base).apply(null,arguments)},r._emscripten_stack_get_end=function(){return(ft=r._emscripten_stack_get_end=r.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),L[t>>2]=34821223,L[t+4>>2]=2310721022,L[0]=1668509029}function dt(t){function e(){lt||(lt=!0,r.calledRun=!0,k||(D(!Y),Y=!0,P(),rt(W),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),D(!r._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(P(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),G.unshift(t);var t;rt(G)}()))}t=t||o,H>0||(ut(),function(){if(r.preRun)for('function'==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),U.unshift(t);var t;rt(U)}(),H>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),e()}),1)):e(),P()))}if(r.stackSave=et("stackSave"),r.stackRestore=et("stackRestore"),r.stackAlloc=et("stackAlloc"),r.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':T[0|t]=i;break;case'i16':R[t>>1]=i;break;case'i32':S[t>>2]=i;break;case'i64':$=[i>>>0,(J=i,+Math.abs(J)>=1?J>0?(0|Math.min(+Math.floor(J/4294967296),4294967295))>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],S[t>>2]=$[0],S[t+4>>2]=$[1];break;case'float':x[t>>2]=i;break;case'double':M[t>>3]=i;break;case'*':L[t>>2]=i;break;default:j('invalid type for setValue: '+e)}},r.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return T[0|t];case'i16':return R[t>>1];case'i32':case'i64':return S[t>>2];case'float':return x[t>>2];case'double':return M[t>>3];case'*':return L[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),K=function t(){lt||dt(),lt||(K=t)},r.preInit)for('function'==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return dt(),t.ready})}},r={};function h(t){var i=r[t];if(void 0!==i)return i.exports;var e=r[t]={exports:{}};return n[t](e,e.exports,h),e.exports}h.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",e="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",s=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},h.a=(n,r,h)=>{var o;h&&((o=[]).d=-1);var l,a,c,f=new Set,u=n.exports,d=new Promise(((t,i)=>{c=i,a=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,r((n=>{var r;l=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var r=[];r.d=0,n.then((t=>{h[i]=t,s(r)}),(t=>{h[e]=t,s(r)}));var h={};return h[t]=t=>t(r),h}}var o={};return o[t]=t=>{},o[i]=n,o})))(n);var h=()=>l.map((t=>{if(t[e])throw t[e];return t[i]})),a=new Promise((i=>{(r=()=>i(h)).r=0;var e=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(r.r++,t.push(r)));l.map((i=>i[t](e)))}));return r.r?a:h()}),(t=>(t?c(d[e]=t):a(u),s(o)))),o&&o.d<0&&(o.d=0)},h.d=(t,i)=>{for(var e in i)h.o(i,e)&&!h.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},h.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),h.p="/Client2/",h.b=document.baseURI||self.location.href;h(9073)})(); \ No newline at end of file diff --git a/mesanim.js b/mesanim.js index aee0b476..3e72f09e 100644 --- a/mesanim.js +++ b/mesanim.js @@ -1 +1 @@ -(()=>{"use strict";var t,i,e,s,n={1651:(t,i,e)=>{e.d(i,{K:()=>D});var s=e(1120),n=e(4583),r=e(2901),h=e(1069),o=e(7046),a=(e(9896),e(6666)),l=e(3045),c=e(818),f=e(670),u=e(8268),d=e(3867),w=e(7854),y=e(8950),m=e(1302),p=e(9298),A=e(8665),g=e(1312),I=e(3819),_=e(8317),C=e(9234),E=e(1908),v=e(123),b=e(5637),T=e(6948),O=e(2164),R=e(8738),S=e(3764),L=e(8534),x=e(6730),k=e(2604),M=e(5226);class D extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static et=!1;static st='';static nt='';static rt=!1;static ht=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static gt=0;static It=0;static _t=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Ot=0;static Rt=()=>{l.A.et=!1,n.A.et=!1,D.et=!1,c.A.et=!1};static St=()=>{l.A.et=!0,n.A.et=!0,D.et=!0,c.A.et=!0};Lt=2048;xt=2047;kt=!1;Mt=!1;Dt=!1;Nt=!1;db=null;Ft=0;Bt=[];stream=null;in=h.A.Pt(1);Ut=h.A.Pt(1);Gt=h.A.Pt(1);Wt=0n;Yt=0;Ht=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;Jt=!0;$t=0;Qt=0;ti=null;ii=null;ei=null;si=null;ni=null;ri=null;hi=null;oi=null;ai=null;li=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;mi=null;pi=[];Ai=!1;gi=null;Ii=null;_i=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Oi=null;Ri=null;Si=new Int32Array(256);Li=0;xi=0;ki=0;Mi=null;Di=null;Ni=null;Fi=null;Bi=null;Pi=null;Ui=null;Gi=null;Wi=null;Yi=null;Hi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;Ji=null;$i=null;Qi=null;te=new Int32Array(33);ie=new Int32Array(33);ee=new Int32Array(151);se=new Int32Array(151);ne=null;re=null;he=null;oe=null;ae=null;le=null;ce=new d.fe(13,null);ue=null;de=null;we=new d.fe(50,null);ye=new d.fe(50,null);me=new d.fe(20,null);pe=new d.fe(20,null);Ae=null;ge=new d.fe(8,null);Ie=null;_e=null;Ce=null;Ee=null;ve=null;be=null;Te=null;Oe=null;Re=null;Se=null;Le=null;xe=null;ke=null;Me=null;De=null;Ne=null;Fe=null;Be=null;Pe=new d.fe(1e3,null);Ue=!1;Ge=!1;We=!1;Ye=!1;He=-1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=!1;Je=0;$e=0;Qe=0;ts=0;es=0;ss=0;ns=[];rs=-1;hs=-1;os=new s.A;ls=78;cs=0;fs=0;us=[];ds=0;ws=0;ys=0;ps=0;As=0;gs=0;Is=0;_s=0;Cs=[];Es=[];vs=[];bs=[];Ts=null;Os=-1;Rs=3;Ss=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Ls=0;xs=0;ks=0;Ms=!1;Ds=0;Ns=!1;Fs='';Bs='';Ps=0;Us='';Gs=!1;Ws=-1;Ys=new d.fe(100,null);Hs=new d.fe(100,null);messageType=new Int32Array(100);Vs=new Int32Array(100);Ks=0;Xs=0;js=0;zs='';Zs=0;qs=0;Js=0;$s=0;Qs=0;tn=0;en=0;sn=0;nn=0;rn=!1;hn=0;an=0;ln=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;mn=!1;pn=[];An=[];gn=0;In=0;_n=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);On=new Int32Array(500);Rn=0;Sn=0;Ln=0;xn='';kn=!1;Mn=-1;Dn=0;Nn=0;Fn=0;Bn=0;Pn=0;Un=new Int32Array(1e3);Gn=new Int32Array(1e3);Wn=null;Yn=0;Hn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;Jn=0;$n=2;Qn=2;tr=1;ir=new Int32Array(5);er=new d.fe(5,!1);sr=new Int32Array(5);nr=new Int32Array(5);rr=new Int32Array(5);hr=0;ar=0;lr=0;cr=0;ur=0;dr=0;wr=0;yr=0;mr=0;pr=1;Ar=2;gr=-1;Ir=0;_r=0;Cr=0;Er=0;vr=0;br=0;Tr=null;Or=null;Rr=null;Sr=0;Lr=0;kr=new Int8Array(16384);Mr=new d.fe(f.A.Dr,null);Nr=0;Fr=0;Br=128;Pr=0;Ur=0;Gr=0;Wr=0;Yr=0;Hr=null;Vr=null;Kr=new d.Xr(f.A.jr,f.A.jr);zr=0;Zr=0;qr=0;Jr=0;$r=0;Qr=0;th=0;ih=0;eh=0;sh=0;nh=0;rh=0;hh=new d.fe(this.Lt,null);oh=0;ah=new Int32Array(this.Lt);lh=0;fh=0;uh=new Int32Array(this.Lt);dh=new Int32Array(1e3);wh=new d.fe(this.Lt,null);yh=new d.fe(8192,null);mh=0;ph=new Int32Array(8192);Ah=new a.A;gh=new a.A;Ih=new a.A;_h=new a.A;Ch=new d.Eh(f.A.Dr,f.A.jr,f.A.jr,null);bh=new a.A;Th=new Int32Array(4e3);Oh=new Int32Array(4e3);Rh=new Int32Array(f.A.jr*f.A.jr);Sh=new Int32Array(f.A.jr*f.A.jr);Lh=0;xh=null;kh=0;Mh=0;Dh=-1;Nh=0;Fh=0;Bh=0;Ph=0;Uh=!1;Gh=!0;Wh=!1;Yh=new Int32Array(7);Hh=new Int32Array(5);Vh=0;Kh=0;static Xh=50;jh=new Int32Array(D.Xh);zh=new Int32Array(D.Xh);Zh=new Int32Array(D.Xh);qh=new Int32Array(D.Xh);Jh=new Int32Array(D.Xh);$h=new Int32Array(D.Xh);Qh=new Int32Array(D.Xh);io=new d.fe(D.Xh,null);eo=new d.fe(100,null);so=new BigInt64Array(100);no=new Int32Array(100);ro=null;ho=0;oo=!0;ao=new Int32Array(50);lo=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;mo=0;po=!0;Ao=null;Io=0;_o=0;Co=192;Eo=void 0;vo=!1;host=null;bo=null;To=new d.fe(16,null);Oo=0;Ro=!1;So=()=>{try{this.stream&&this.stream.close()}catch(t){}this.bo&&'998'===D.getParameter('world')&&this.bo.Lo?.send(JSON.stringify({type:'close',id:this.bo.xo})),this.stream=null,(0,v.ko)(!1),this.Ut=null,this.Gt=null,this.in=null,this.Rr=null,this.Tr=null,this.Or=null,this.Hr=null,this.Vr=null,this.Wn=null,this.Mr=null,this.Rh=null,this.Sh=null,this.Th=null,this.Oh=null,this.kr=null,this.Di=null,this.Ni=null,this.Fi=null,this.Bi=null,this.Pi=null,this.Ui=null,this.Gi=null,this.Wi=null,this.Yi=null,this.Hi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.ne=null,this.he=null,this.re=null,this.oe=null,this.ae=null,this.le=null,this.ce=null,this.Te=null,this.Oe=null,this.Re=null,this.Se=null,this.Le=null,this.xe=null,this.ke=null,this.Me=null,this.De=null,this.Ne=null,this.de=null,this.me=null,this.pe=null,this.ge=null,this.Ie=null,this._e=null,this.Ce=null,this.Ee=null,this.we=null,this.ye=null,this.Kr=null,this.hh=null,this.ah=null,this.uh=null,this.wh=null,this.dh=null,this.yh=null,this.ph=null,this.Ch=null,this.bh=null,this._h=null,this.Ah=null,this.gh=null,this.Ih=null,this.Tn=null,this.On=null,this.vn=null,this.bn=null,this.ns=null,this.pn=null,this.Un=null,this.Gn=null,this.Pe=null,this.ue=null,this.eo=null,this.so=null,this.no=null,this.si=null,this.ni=null,this.ti=null,this.ii=null,this.ei=null,this.ri=null,this.hi=null,this.oi=null,this.ai=null,this.Mo(),b.A.So(),T.A.So(),m.A.So(),O.A.Do=null,_.A.Do=null,s.A.Do=null,g.A.Do=null,R.A.Do=null,R.A.No=null,S.A.Do=null,this.Fo=null,u.A.No=null,n.A.So(),l.A.So(),A.A.So(),L.A.Do=[],x.A.Do=[]};Bo(){return this.$t}Po(){return this.Gs}Uo(){return this.Ns}Go(){return this.hs}Wo(){return this.He}Mo=()=>{this.Ai=!1,this.Mi&&(clearInterval(this.Mi),this.Mi=null),this.li=null,this.ci=null,this.pi=[],this.bi=null,this.Ti=null,this.Oi=null,this.Ri=null,this.Ci=null,this._i=null,this.Ei=null,this.vi=null,this.gi=null,this.Ii=null};Yo=()=>{'999'===D.getParameter('world')?(this.Eo=new Worker('worker.js',{type:'module'}),this.Eo.onmessage=this.onmessage,this.host=new M.x(this.Eo)):'998'===D.getParameter('world')&&(this.Eo={onmessage:t=>{this.stream.Ho.onmessage(t)},postMessage:t=>{this.bo&&this.bo.Lo&&'open'===this.bo.Lo.readyState&&this.bo.Lo.send(JSON.stringify(t))},onerror:null,onmessageerror:null,terminate:()=>{throw new Error},addEventListener:()=>{throw new Error},removeEventListener:()=>{throw new Error},dispatchEvent:()=>{throw new Error}},this.bo=new M.Q(this.Eo))};onmessage=t=>{switch(t.data.type){case'ready':return void(this.vo=!0);case'save':return(0,k.A)(t.data.value,t.data.path.split('/').pop().split('\\').pop()),void URL.revokeObjectURL(t.data.value);case'close':return void this.Eo?.postMessage({type:'close',id:t.data.id})}this.host?.xo===t.data.id?this.stream.Ho.onmessage(t.data):this.host?.postMessage(t)};Vo=async()=>{if(999==+D.getParameter('world'))this.host&&await this.host.Ko();else if(998==+D.getParameter('world')&&this.bo){if(this.bo.Lo)return void console.log('You are already connected.');const t=prompt('Paste offer here, answer will be copied to clipboard');if(t)try{await this.bo.Xo(t)}catch(t){console.error(t)}}};jo=async(t,i,e,s)=>{let n=5,o=await(this.db?.zo(t));if(o&&h.A.Zo(o)!==e&&(o=void 0),o)return new r.A(o);for(;!o;){await this.qo(s,`Requesting ${i}`);try{o=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}${e}`):await(0,C.Jo)(`${D.nt}/${t}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.qo(s,`Error loading - Will retry in ${t} secs.`),await(0,C.$o)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Qo(t,o)),new r.A(o)};ta=async(t,i,e,s)=>{let n=await(this.db?.zo(t+'.mid'));if(n&&12345678!==i&&h.A.Zo(n)!==i&&(n=void 0),!n)try{n=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}_${i}.mid`):await(0,C.Jo)(`${D.nt}/songs/${t}.mid`),e!==n.length&&(n=n.slice(0,e))}catch(t){}if(!n)return;await(this.db?.Qo(t+'.mid',n));const r=new h.A(Uint8Array.from(n)).ia,o=E.A.read(r,n,e,4);(0,v.ea)(o,this.Co,s)};sa=()=>{if(w.na.fillStyle='black',w.na.fillRect(0,0,this.width,this.height),this.ra(1),this.Dt){this.Ai=!1,w.na.font='bold 16px helvetica, sans-serif',w.na.textAlign='left',w.na.fillStyle='yellow';let t=35;w.na.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.na.fillStyle='white',w.na.fillText('To fix this try the following (in order):',30,t),t+=50,w.na.font='bold 12px helvetica, sans-serif',w.na.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.na.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.na.fillText('3: Try using a different game-world',30,t),t+=30,w.na.fillText('4: Try rebooting your computer',30,t),t+=30,w.na.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.Ai=!1,w.na.font='bold 20px helvetica, sans-serif',w.na.textAlign='left',w.na.fillStyle='white',w.na.fillText('Error - unable to load game!',50,50),w.na.fillText('To play RuneScape make sure you play from',50,100),w.na.fillText('https://2004scape.org',50,150)),this.Mt){this.Ai=!1,w.na.font='bold 13px helvetica, sans-serif',w.na.textAlign='left',w.na.fillStyle='yellow';let t=35;w.na.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.na.fillStyle='white',w.na.fillText('To fix this try the following (in order):',30,t),t+=50,w.na.font='bold 12px helvetica, sans-serif',w.na.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.na.fillText('2: Try rebooting your computer, and reloading',30,t)}};ha=t=>{if(!t.oa)return!1;for(let i=0;i=s)return!1}else if(3===t.oa[i]){if(e<=s)return!1}else if(4===t.oa[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};ca=(t,i,e,s,n)=>{this.ve?.draw(t,i),this.be?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,p.A.fa);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;y.A.fillRect(t,i+h+16,16,r,p.A.ua),y.A.da(t,i+h+16,p.A.wa,r),y.A.da(t+1,i+h+16,p.A.wa,r),y.A.ya(t,i+h+16,p.A.wa,16),y.A.ya(t,i+h+17,p.A.wa,16),y.A.da(t+15,i+h+16,p.A.ma,r),y.A.da(t+14,i+h+17,p.A.ma,r-1),y.A.ya(t,i+h+r+15,p.A.ma,16),y.A.ya(t+1,i+h+r+14,p.A.ma,15)};pa=(t,i)=>{let e=!1;const n=s.A.Do[t];if(!n.Aa)return!1;for(let t=0;ts.delay[r.Ca];)r._a-=s.delay[r.Ca]+1,r.Ca++,r.Ca>=s.Ea&&(r.Ca-=s.va,(r.Ca<0||r.Ca>=s.Ea)&&(r.Ca=0)),e=!0}}}return e};ba=(t,i,e,r,h=!1)=>{if(0!==t.type||!t.Aa||t.hide&&this.Zs!==t.id&&this.qs!==t.id&&this.Js!==t.id)return;const o=y.A.left,a=y.A.top,l=y.A.right,c=y.A.bottom;y.A.Ta(i,e,i+t.width,e+t.height);const f=t.Aa.length;for(let o=0;o0&&this.ka(c),c.type===s.A.Ma)c.Da>c.scroll-c.height&&(c.Da=c.scroll-c.height),c.Da<0&&(c.Da=0),this.ba(c,a,l,c.Da,h),c.scroll>c.height&&this.ca(a+c.width,l,c.Da,c.scroll,c.height);else if(c.type===s.A.Na){let t=0;for(let i=0;i0){let i=0,e=0;const r=c.Pa[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qs===t){const h=m.A.Ya(r,c.Ua[t]);if(0!==this.tn&&this.Qs===t&&this.$s===c.id?(i=this.Ha-this.en,e=this.Va-this.sn,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.nn<5&&(i=0,e=0),h.Ka(128,s+i,n+e)):0!==this.un&&this.dn===t&&this.wn===c.id?h.Ka(128,s,n):h.draw(s,n),33===h.Xa||1!==c.Ua[t]){const r=c.Ua[t];this.di?.ja(s+i+1,n+10+e,this.za(r),p.A.Za),this.di?.ja(s+i,n+9+e,this.za(r),p.A.qa)}}}else if(c.Ja&&t<20){const i=c.Ja[t];i?.draw(s,n)}t++}}else if(c.type===s.A.$a)c.fill?y.A.fillRect(a,l,c.width,c.height,c.Qa):y.A.Sa(a,l,c.width,c.height,c.Qa);else if(c.type===s.A.tl){const t=c.font;let i=c.Qa,e=c.text;if(this.Js!==c.id&&this.qs!==c.id&&this.Zs!==c.id||0===c.il||(i=c.il),this.ha(c)&&(i=c.el,c.sl&&c.sl.length>0&&(e=c.sl)),c.nl===s.A.rl&&this.mn&&(e='Please wait...',i=c.Qa),!t||!e)continue;for(let s=l+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),c.ol?t.al(a+(c.width/2|0),s,r,i,c.ll):t.cl(a,s,r,i,c.ll)}}else if(c.type===s.A.fl){let t;t=this.ha(c)?c.ul:c.dl,t?.draw(a,l)}else if(c.type===s.A.wl){const t=n.A.yl,i=n.A.ml;n.A.yl=a+(c.width/2|0),n.A.ml=l+(c.height/2|0);const e=n.A.sin[c.pl]*c.zoom>>16,s=n.A.cos[c.pl]*c.zoom>>16,r=this.ha(c);let h;h=r?c.Ia:c.ga;let o=null;if(-1===h)o=c.Al(-1,-1,r);else{const t=g.A.Do[h];t.frames&&t.gl&&(o=c.Al(t.frames[c.Ca],t.gl[c.Ca],r))}o&&o.Il(0,c._l,0,c.pl,0,e,s),n.A.yl=t,n.A.ml=i}else if(c.type===s.A.Cl){const t=c.font;if(!t||!c.Pa||!c.Ua)continue;let i=0;for(let e=0;e0){const n=m.A.get(c.Pa[i]-1);let r=n.name;if((n.El||1!==c.Ua[i])&&(r=r+' x'+this.vl(c.Ua[i])),!r)continue;const h=a+s*(c.Ga+115),o=l+e*(c.Wa+12);c.ol?t.al(h+(c.width/2|0),o,r,c.Qa,c.ll):t.cl(h,o,r,c.Qa,c.ll)}i++}}}y.A.Ta(o,a,l,c)};ka=t=>{let i=t.xa;if(i>=s.A.bl&&i<=s.A.Tl)i--,i>=this.Vh?(t.text='',t.nl=0):(t.text=this.eo[i],t.nl=1);else if(i>=s.A.Ol&&i<=s.A.Rl)i-=s.A.Ol,i>=this.Vh?(t.text='',t.nl=0):(0===this.no[i]?t.text='@red@Offline':this.no[i]===D.it?t.text='@gre@World-'+(this.no[i]-9):t.text='@yel@World-'+(this.no[i]-9),t.nl=1);else if(i===s.A.Sl)t.scroll=15*this.Vh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=s.A.Ll&&i<=s.A.xl)i-=s.A.Ll,i>=this.fs?(t.text='',t.nl=0):(t.text=I.A.kl(I.A.Ml(this.us[i])),t.nl=1);else if(i===s.A.Dl)t.scroll=15*this.fs+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===s.A.Nl){if(t.pl=150,t._l=256*Math.sin(this.Ft/40)&2047,this.Wh){this.Wh=!1;const i=new d.fe(7,null);let e=0;for(let t=0;t<7;t++){const s=this.Yh[t];s>=0&&(i[e++]=_.A.Do[s].Al())}const s=A.A.Fl(i,e);for(let t=0;t<5;t++)0!==this.Hh[t]&&(s.Bl(u.A.Pl[t][0],u.A.Pl[t][this.Hh[t]]),1===t&&s.Bl(u.A.Ul[0],u.A.Ul[this.Hh[t]]));if(this.xh){const i=g.A.Do[this.xh.Gl].frames;i&&(s.Wl(),s.Yl(i[0]),s.Hl(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===s.A.Vl)this.Fe||(this.Fe=t.dl,this.Be=t.ul),this.Gh?t.dl=this.Be:t.dl=this.Fe;else if(i===s.A.Kl)this.Fe||(this.Fe=t.dl,this.Be=t.ul),this.Gh?t.dl=this.Fe:t.dl=this.Be;else if(i===s.A.Xl)t.text=this.xn,this.Ft%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===s.A.jl)this.Uh?this.kn?(t.Qa=p.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Qa=p.A.La,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===s.A.zl||i===s.A.Zl)if(0===this.Dn)t.text='';else{let i;i=0===this.Nn?'earlier today':1===this.Nn?'yesterday':this.Nn+' days ago',t.text='You last logged in '+i+' from: '+I.A.ql(this.Dn)}else if(i===s.A.Jl)0===this.Bn&&(t.text='0 unread messages',t.Qa=p.A.qa),1===this.Bn&&(t.text='1 unread message',t.Qa=p.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Qa=p.A.GREEN);else if(i===s.A.$l)if(201===this.Fn)t.text='';else if(200===this.Fn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Fn?'Earlier today':1===this.Fn?'Yesterday':this.Fn+' days ago',t.text=i+' you changed your recovery questions'}else i===s.A.Ql?201===this.Fn?t.text='':200===this.Fn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===s.A.tc&&(201===this.Fn?t.text='':(this.Fn,t.text="Do this from the 'account management' area on our front webpage"))};aa=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let n=0,r=0;for(;;){const t=e[r++];if(0===t)return n;if(1===t)n+=this.Es[e[r++]];else if(2===t)n+=this.vs[e[r++]];else if(3===t)n+=this.Cs[e[r++]];else if(4===t){const t=s.A.Do[e[r++]],i=e[r++]+1;if(t.Pa&&t.Ua)for(let e=0;et<999999999?String(t):'*';vl=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};za=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,e)=>{e.d(i,{w:()=>h});var s=e(7046),n=e(1651),r=e(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');['0','998','999'].includes(s.A.getParameter('world'))?function(){if(+s.A.getParameter('world')>=998)return void(n.K.nt='data/pack/client');n.K.st='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0}():await async function(t){const i=await o(t,parseInt(s.A.getParameter('world'),10)),e=new URL(i.address);n.K.it=10+i.id-1,n.K.st=`${e.protocol}//${e.hostname}`,n.K.nt=`${e.protocol}//${e.hostname}:${e.port}`,t||(n.K.st=n.K.st.replace('https:','http:'));n.K.portOffset=i.portOffset,n.K.members=!0===i?.members,s.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===s.A.getParameter('detail').length&&s.A.setParameter('detail','high');'low'===s.A.getParameter('detail')?n.K.St():n.K.Rt()}(),0===s.A.getParameter('method').length&&s.A.setParameter('method','0')}async function o(t,i,e=0){if(e>=10)throw new Error('could not find world to connect!');const s=t?'https:':'http:';let n;try{n=JSON.parse(await(0,r.ec)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.$o)(1e3),o(t,i,++e)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hh:0});const h=n.find((t=>t.id===i));return h||o(t,i,10)}},7046:(t,i,e)=>{e.d(i,{A:()=>l});var s=e(1183),n=e(4583),r=e(9234),h=e(9091),o=e(2595),a=e(7854);class l{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}sc=0;nc=[];rc=0;Fo=null;state=0;hc=20;oc=1;ac=[];lc=0;cc=0;fc=[];uc=!0;dc=!1;wc=50;hasFocus=!0;yc=!1;mc=0;Ac=0;Ha=0;Va=0;gc=0;Ic=0;_c=0;Cc=[];Ec=[];vc=0;bc=0;input=null;Tc=!1;Oc=!1;Rc=!1;time=-1;Sc=0;Lc=0;xc=0;kc=0;Mc=0;Dc=0;constructor(t=!1){a.Nc.tabIndex=-1,a.na.fillStyle='black',a.na.fillRect(0,0,a.Nc.width,a.Nc.height),this.dc=t,this.dc?this.resize(window.innerWidth,window.innerHeight):this.resize(a.Nc.width,a.Nc.height)}get width(){return a.Nc.width}get height(){return a.Nc.height}resize=(t,i)=>{a.Nc.width=t,a.Nc.height=i,this.Fo=new s.A(t,i),n.A.Fc()};run=async()=>{a.Nc.addEventListener('resize',(()=>{this.dc&&this.resize(window.innerWidth,window.innerHeight)}),!1),a.Nc.onmousedown=this.onmousedown,a.Nc.onmouseup=this.onmouseup,a.Nc.onmouseenter=this.onmouseenter,a.Nc.onmouseleave=this.onmouseleave,a.Nc.onmousemove=this.onmousemove,window.onbeforeunload=this.So,a.Nc.onfocus=this.onfocus,a.Nc.onblur=this.onblur,this.Bc?(a.Nc.ontouchstart=this.ontouchstart,a.Nc.ontouchend=this.ontouchend,a.Nc.ontouchmove=this.ontouchmove):(a.Nc.onkeydown=this.onkeydown,a.Nc.onkeyup=this.onkeyup),a.Nc.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Bc&&'low'===l.getParameter('detail')&&(this.wc=30),await this.qo(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.ac[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.Pc();const h=e,o=s;e=300,s=1,t=performance.now();const a=this.ac[i];if(0===a?(e=h,s=o):t>a&&(e=2560*this.hc/(t-a)|0),e<25?e=25:e>256&&(e=256,s=this.hc-(t-a)/10|0),this.ac[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.ac[t]&&(this.ac[t]+=s);for(s0&&(this.lc=1e3*e/(256*this.hc)|0);const l=performance.now();if(this.uc&&this.refresh(),await this.draw(),this.fc[this.cc]=(performance.now()-l)/1e3,this.cc=(this.cc+1)%this.fc.length,this.wc<50){const i=1e3/this.wc-(performance.now()-t);i>0&&await(0,r.$o)(i)}}-1===this.state&&this.Pc()};Pc=()=>{this.state=-2,this.So()};ra=t=>{this.hc=1e3/t|0};Uc=t=>{this.wc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.hc|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};So=()=>{};draw=async()=>{};refresh=()=>{};async qo(t,i){const e=this.width,s=this.height;this.uc&&(a.na.fillStyle='black',a.na.fillRect(0,0,e,s),this.uc=!1);const n=s/2-18;a.na.fillStyle='rgb(140, 17, 17)',a.na.rect((e/2|0)-152,n,304,34),a.na.fillRect((e/2|0)-150,n+2,3*t,30),a.na.fillStyle='black',a.na.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),a.na.font='bold 13px helvetica, sans-serif',a.na.textAlign='center',a.na.fillStyle='white',a.na.fillText(i,e/2|0,n+22),await(0,r.$o)(5)}Gc=()=>{let t=-1;return this.bc!==this.vc&&(t=this.Ec[this.vc],this.vc=this.vc+1&127),t};get ms(){const t=this.fc.length;let i=0;for(let e=0;ethis.sc&&(this.sc=e),this.nc[this.rc]=e,this.rc=(this.rc+1)%250,e}get Wc(){return this.nc.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.mc=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Cc[n]=1),n>4&&(this.Ec[this.bc]=n,this.bc=this.bc+1&127),o.A.enabled&&o.A.Yc(n),h.g.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.mc=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Cc[n]=0),o.A.enabled&&o.A.Hc(n),h.g.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.Tc=!1,(t.clientX>0||t.clientY>0)&&this.Vc(t),this.mc=0,this.Ic=this.Ha,this._c=this.Va,this.Bc&&!this.Kc){if(this.Xc()||this.jc()||this.zc())return this.gc=1,void(this.Ac=1);t.timeStamp>=this.time+500?(this.gc=2,this.Ac=2):(this.gc=1,this.Ac=1)}else 2===t.button?(this.gc=2,this.Ac=2):(this.gc=1,this.Ac=1);o.A.enabled&&o.A.Zc(this.Ic,this._c,t.buttons)};onmouseup=t=>{this.Vc(t),this.mc=0,this.Ac=0,o.A.enabled&&o.A.qc(t.buttons)};onmouseenter=t=>{this.Vc(t),o.A.enabled&&o.A.Jc()};onmouseleave=t=>{this.Vc(t),this.mc=0,this.Ha=-1,this.Va=-1,this.Ac=0,this.Ic=-1,this._c=-1,o.A.enabled&&o.A.$c()};onmousemove=t=>{this.Vc(t),this.mc=0,o.A.enabled&&o.A.Qc(this.Ha,this.Va)};onfocus=t=>{this.hasFocus=!0,this.uc=!0,this.refresh(),o.A.enabled&&o.A.tf()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.if()};ontouchstart=t=>{if(!this.Bc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.Tc=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Sc=this.Mc=this.xc=0|i.screenX,this.Lc=this.Dc=this.kc=0|i.screenY,this.time=t.timeStamp,this.Oc=this.ef(),this.Rc=this.sf()};ontouchend=t=>{if(!this.Bc||!this.Tc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Mc=0|i.screenX,this.Dc=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Oc&&!this.ef())return void(this.Tc=!1);if(this.Rc&&!this.sf())return void(this.Tc=!1);if(this.Xc()||this.nf()||this.jc()||this.zc()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.jc()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.zc()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Xc()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.nf()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.rf?t.setAttribute('type','password'):t.setAttribute('type',this.zc()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.rf&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.rf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.rf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.Tc=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.Sc-this.Mc)>16||Math.abs(this.Lc-this.Dc)>16;n&&!r?(this.Tc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.Ac=0,this.Tc=!1)};ontouchmove=t=>{if(!this.Bc||!this.Tc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Mc=0|i.screenX,this.Dc=0|i.screenY,this.Oc&&-1===this.Wo()?(this.xc-this.Mc>0?this.rotate(2):this.xc-this.Mc<0&&this.rotate(0),this.kc-this.Dc>0?this.rotate(3):this.kc-this.Dc<0&&this.rotate(1)):(this.Rc||-1!==this.Wo())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.xc=this.Mc,this.kc=this.Dc};get Bc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get rf(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Kc(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}ef=()=>this.yc&&this.Ha>=8&&this.Ha<=520&&this.Va>=11&&this.Va<=345;Xc=()=>this.yc&&-1===this.Go()&&!this.Po()&&!this.Uo()&&this.Ha>=11&&this.Ha<=506&&this.Va>=449&&this.Va<=482;nf=()=>this.yc&&(this.Po()||this.Uo())&&this.Ha>=11&&this.Ha<=506&&this.Va>=383&&this.Va<=482;sf=()=>this.yc&&this.Ha>=562&&this.Ha<=752&&this.Va>=231&&this.Va<=492;jc=()=>!this.yc&&2===this.Bo()&&this.Ha>=301&&this.Ha<=562&&this.Va>=262&&this.Va<=279;zc=()=>!this.yc&&2===this.Bo()&&this.Ha>=301&&this.Ha<=562&&this.Va>=279&&this.Va<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};hf=()=>null!==document.fullscreenElement;Vc=t=>{if(this.hf()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/a.Nc.height,s=(window.innerWidth-a.Nc.width*e)/2;this.Ha=0|this.af(t.clientX-i.left-s,0,a.Nc.width*e,0,789),this.Va=0|this.af(t.clientY-i.top,0,a.Nc.height*e,0,532)}else{const i=a.Nc.getBoundingClientRect(),e=a.Nc.width/i.width,s=a.Nc.height/i.height;this.Ha=(t.clientX-i.left)*e|0,this.Va=(t.clientY-i.top)*s|0}this.Ha<0&&(this.Ha=0),this.Va<0&&(this.Va=0),this.Ha>789&&(this.Ha=789),this.Va>532&&(this.Va=532)};af=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}},2595:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static enabled=!1;static lf=null;static cf=null;static ff=0;static uf=0;static df=0;static wf=0;static yf=0;static mf=()=>{this.lf=s.A.Pt(1),this.cf=null,this.ff=performance.now(),this.enabled=!0};static pf=()=>{this.enabled=!1,this.lf=null};static flush=()=>{let t=null;return this.cf&&this.enabled&&(t=this.cf),this.cf=null,t};static stop=()=>{let t=null;return this.lf&&this.lf.Af>0&&this.enabled&&(t=this.lf),this.pf(),t};static Zc=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.uf++;const s=performance.now();let n=(s-this.ff)/10|0;n>250&&(n=250),this.ff=s,this.gf(5),1===e?this.lf?.p1(1):this.lf?.p1(2),this.lf?.p1(n),this.lf?.p3(t+(i<<10))};static qc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,this.gf(2),1===t?this.lf?.p1(3):this.lf?.p1(4),this.lf?.p1(e)};static Qc=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.df>=50){this.df=e,this.uf++;let s=(e-this.ff)/10|0;s>250&&(s=250),this.ff=e,t-this.wf<8&&t-this.wf>=-8&&i-this.yf<8&&i-this.yf>=-8?(this.gf(3),this.lf?.p1(5),this.lf?.p1(s),this.lf?.p1(t+(i-this.yf+8<<4)+8-this.wf)):t-this.wf<128&&t-this.wf>=-128&&i-this.yf<128&&i-this.yf>=-128?(this.gf(4),this.lf?.p1(6),this.lf?.p1(s),this.lf?.p1(t+128-this.wf),this.lf?.p1(i+128-this.yf)):(this.gf(5),this.lf?.p1(7),this.lf?.p1(s),this.lf?.p3(t+(i<<10))),this.wf=t,this.yf=i}};static Yc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.gf(3),this.lf?.p1(8),this.lf?.p1(e),this.lf?.p1(t)};static Hc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.gf(3),this.lf?.p1(9),this.lf?.p1(e),this.lf?.p1(t)};static tf=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.lf?.p1(10),this.lf?.p1(i)};static if=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.lf?.p1(11),this.lf?.p1(i)};static Jc=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.lf?.p1(12),this.lf?.p1(i)};static $c=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.lf?.p1(13),this.lf?.p1(i)};static gf=t=>{if(this.lf&&this.lf.Af+t>=500){const t=this.lf;this.lf=s.A.Pt(1),this.cf=t}}}},9091:(t,i,e)=>{e.d(i,{c:()=>n,g:()=>s});const s=['F11','F12'],n={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}}},1120:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1069),n=e(8665),r=e(2679),h=e(2511),o=e(3819),a=e(3867),l=e(8950);class c{static Do=[];static If=null;static No=null;static Ma=0;static _f=1;static Na=2;static $a=3;static tl=4;static fl=5;static wl=6;static Cl=7;static Cf=1;static Ef=2;static vf=3;static bf=4;static Tf=5;static rl=6;static bl=1;static Tl=100;static Ol=101;static Rl=200;static Of=201;static Rf=202;static Sl=203;static Sf=205;static Lf=300;static xf=301;static kf=302;static Mf=303;static Df=304;static Nf=305;static Ff=306;static Bf=307;static Pf=308;static Uf=309;static Gf=310;static Wf=311;static Yf=312;static Hf=313;static Vf=314;static Kf=315;static Xf=316;static jf=317;static zf=318;static Zf=319;static qf=320;static Jf=321;static $f=322;static Qf=323;static Vl=324;static Kl=325;static tu=326;static Nl=327;static Ll=401;static xl=500;static iu=501;static eu=502;static Dl=503;static Xl=600;static su=601;static nu=602;static ru=603;static hu=604;static ou=605;static au=606;static lu=607;static cu=608;static fu=609;static uu=610;static du=611;static wu=612;static jl=613;static zl=650;static Jl=651;static $l=652;static Ql=653;static tc=654;static Zl=655;static yu=(t,i,e)=>{this.If=new r.A(5e4),this.No=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.Af+=2;n.Af0){s.oa=new Uint8Array(r),s.la=new Uint16Array(r);for(let t=0;t0){s.scripts=new a.fe(o,null);for(let t=0;t0){const n=e.lastIndexOf(',');s.Ja[t]=this.vu(i,e.substring(0,n),parseInt(e.substring(n+1),10))}}s.bu=new a.fe(5,null);for(let t=0;t<5;t++){const i=n.Eu;s.bu[t]=i,0===i.length&&(s.bu[t]=null)}}if(s.type===c.$a&&(s.fill=1===n.Au),s.type===c.tl||s.type===c._f){s.ol=1===n.Au;const t=n.Au;e&&(s.font=e[t]),s.ll=1===n.Au}if(s.type===c.tl&&(s.text=n.Eu,s.sl=n.Eu),s.type!==c._f&&s.type!==c.$a&&s.type!==c.tl||(s.Qa=n.ia),s.type!==c.$a&&s.type!==c.tl||(s.el=n.ia,s.il=n.ia),s.type===c.fl){const t=n.Eu;if(t.length>0){const e=t.lastIndexOf(',');s.dl=this.vu(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=n.Eu;if(e.length>0){const t=e.lastIndexOf(',');s.ul=this.vu(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(s.type===c.wl){const t=n.Au;0!==t&&(s.model=this.Al((t-1<<8)+n.Au));const i=n.Au;0!==i&&(s.Tu=this.Al((i-1<<8)+n.Au)),s.ga=n.Au,0===s.ga?s.ga=-1:s.ga=(s.ga-1<<8)+n.Au,s.Ia=n.Au,0===s.Ia?s.Ia=-1:s.Ia=(s.Ia-1<<8)+n.Au,s.zoom=n.mu,s.pl=n.mu,s._l=n.mu}if(s.type===c.Cl){s.Pa=new Int32Array(s.width*s.height),s.Ua=new Int32Array(s.width*s.height),s.ol=1===n.Au;const t=n.Au;e&&(s.font=e[t]),s.ll=1===n.Au,s.Qa=n.ia,s.Ga=n.Iu,s.Wa=n.Iu,s._u=1===n.Au,s.bu=new a.fe(5,null);for(let t=0;t<5;t++){const i=n.Eu;s.bu[t]=i,0===i.length&&(s.bu[t]=null)}}s.nl!==c.Ef&&s.type!==c.Na||(s.Ou=n.Eu,s.action=n.Eu,s.Ru=n.mu),s.nl!==c.Cf&&s.nl!==c.bf&&s.nl!==c.Tf&&s.nl!==c.rl||(s.Su=n.Eu,0===s.Su.length&&(s.nl===c.Cf?s.Su='Ok':s.nl===c.bf||s.nl===c.Tf?s.Su='Select':s.nl===c.rl&&(s.Su='Continue')))}this.If=null,this.No=null};static vu=(t,i,e)=>{const s=o.A.Lu(i)<<8n|BigInt(e);if(this.If){const t=this.If.get(s);if(t)return t}let n;try{n=h.A.xu(t,i,e),this.If?.put(s,n)}catch(t){return null}return n};static Al=t=>{if(this.No){const i=this.No.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.No?.put(BigInt(t),i),i};id=-1;pu=-1;type=-1;nl=-1;xa=0;width=0;height=0;gu=-1;oa=null;la=null;scripts=null;scroll=0;hide=!1;draggable=!1;_u=!1;Cu=!1;Ga=0;Wa=0;Fa=null;Ba=null;Ja=null;bu=null;fill=!1;ol=!1;font=null;ll=!1;text=null;sl=null;Qa=0;el=0;il=0;dl=null;ul=null;model=null;Tu=null;ga=-1;Ia=-1;zoom=0;pl=0;_l=0;Ou=null;action=null;Ru=-1;Su=null;Aa=null;Oa=null;Ra=null;x=0;y=0;Da=0;Pa=null;Ua=null;Ca=0;_a=0;Al(t,i,e){let s=this.model;if(e&&(s=this.Tu),!s)return null;if(-1===t&&-1===i&&!s.ku)return s;const r=n.A.Mu(s,!0,!0,!1);return-1===t&&-1===i||r.Wl(),-1!==t&&r.Yl(t),-1!==i&&r.Yl(i),r.Hl(64,768,-50,-10,-50,!0),r}Du(){if(this.pu===this.id)return this.x;let t=c.Do[this.pu];if(!t.Aa||!t.Oa||!t.Ra)return this.x;let i=t.Aa.indexOf(this.id);if(-1===i)return this.x;let e=t.Oa[i];for(;t.pu!==t.id;){const s=c.Do[t.pu];s.Aa&&s.Oa&&s.Ra&&(i=s.Aa.indexOf(t.id),-1!==i&&(e+=s.Oa[i])),t=s}return e}Nu(){if(this.pu===this.id)return this.y;let t=c.Do[this.pu];if(!t.Aa||!t.Oa||!t.Ra)return this.y;let i=t.Aa.indexOf(this.id);if(-1===i)return this.y;let e=t.Ra[i];for(;t.pu!==t.id;){const s=c.Do[t.pu];s.Aa&&s.Oa&&s.Ra&&(i=s.Aa.indexOf(t.id),-1!==i&&(e+=s.Ra[i])),t=s}return e}outline(t){const i=this.Du(),e=this.Nu();l.A.Sa(i,e,this.width,this.height,t)}move(t,i){if(this.pu===this.id)return;this.x=0,this.y=0;const e=c.Do[this.pu];if(e.Aa&&e.Oa&&e.Ra){const s=e.Aa.indexOf(this.id);-1!==s&&(e.Oa[s]=t,e.Ra[s]=i)}}delete(){if(this.pu===this.id)return;const t=c.Do[this.pu];if(t.Aa&&t.Oa&&t.Ra){const i=t.Aa.indexOf(this.id);-1!==i&&(t.Aa.splice(i,1),t.Oa.splice(i,1),t.Ra.splice(i,1))}}}},6333:(t,i,e)=>{e.d(i,{$:()=>s});class s{id;Fu=null;constructor(t){this.id=t}Bu(t){for(;;){const i=t.Au;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(6333);class r extends n.${static count=0;static Do=[];static yu=t=>{const i=new s.A(t.read('flo.dat'));this.count=i.mu;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static Uu=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static Gu=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);Wu=0;texture=-1;Yu=!1;Hu=!0;Vu=0;Ku=0;Xu=0;ju=0;zu=0;Zu=0;decode(t,i){1===t?(this.Wu=i.qu,this.setColor(this.Wu)):2===t?this.texture=i.Au:3===t?this.Yu=!0:5===t?this.Hu=!1:6===t?this.Fu=i.Eu:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(h=e),s>h&&(h=s);let o=0,a=0;const l=(n+h)/2;n!==h&&(l<.5&&(a=(h-n)/(h+n)),l>=.5&&(a=(h-n)/(2-h-n)),i===h?o=(e-s)/(h-n):e===h?o=(s-i)/(h-n)+2:s===h&&(o=(i-e)/(h-n)+4)),o/=6,this.Vu=256*o|0,this.Ku=256*a|0,this.Xu=256*l|0,this.Ku<0?this.Ku=0:this.Ku>255&&(this.Ku=255),this.Xu<0?this.Xu=0:this.Xu>255&&(this.Xu=255),this.ju=l>.5?(1-l)*a*512|0:l*a*512|0,this.ju<1&&(this.ju=1),this.zu=o*this.ju|0;let c=this.Vu+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.Ku+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.Xu+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.Zu=r.Pu(c,f,u)}}},8317:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(1069),n=e(6333),r=e(8665),h=e(3867);class o extends n.${static count=0;static Do=[];static yu=t=>{const i=new s.A(t.read('idk.dat'));this.count=i.mu;for(let t=0;t=40&&t<50?this.Qu[t-40]=i.mu:t>=50&&t<60?this.td[t-50]=i.mu:t>=60&&t<70?this.$u[t-60]=i.mu:console.log('Error unrecognised config code: ',t)}Al(){if(!this.Ju)return null;const t=new h.fe(this.Ju.length,null);for(let i=0;i{e.d(i,{A:()=>c});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(1023),a=e(6169),l=e(3867);class c extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static hd=new r.A(500);static od=new r.A(30);static yu=t=>{this.sd=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.mu,this.nd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%10;const i=this.cache[this.rd];return this.sd.Af=this.nd[t],i.id=t,i.reset(),i.Bu(this.sd),i.ad||(i.ad=new Int32Array(1)),-1===i.ld&&i.ad&&(i.active=i.ad.length>0&&i.ad[0]===o.A.fd.id,i.ud&&(i.active=!0)),i};static So=()=>{this.hd=null,this.od=null,this.nd=null,this.cache=null,this.sd=null};Ju=null;ad=null;name=null;dd=null;Qu=null;td=null;width=1;length=1;wd=!0;yd=!0;active=!1;ld=-1;md=!1;pd=!1;Hu=!1;ga=-1;Ad=!1;gd=16;Id=0;_d=0;ud=null;Cd=-1;Ed=-1;vd=!1;bd=!0;Td=128;Od=128;Rd=128;Sd=0;Ld=0;xd=0;kd=0;Md=!1;decode(t,i){if(1===t){const t=i.Au;this.Ju=new Int32Array(t),this.ad=new Int32Array(t);for(let e=0;e=30&&t<39)this.ud||(this.ud=new l.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(40===t){const t=i.Au;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e=this.Ju.length)return null;let d=this.Ju[l];if(-1===d)return null;const w=this.vd!==i>3;w&&(d+=65536);let y=c.hd?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.Wd(),c.hd?.put(BigInt(d),y));const m=128!==this.Td||128!==this.Od||128!==this.Rd,p=0!==this.Ld||0!==this.xd||0!==this.kd;let A=h.A.Mu(y,!this.Qu,!this.Ad,i===a.A.Yd&&-1===o&&!m&&!p);for(-1!==o&&(A.Wl(),A.Yl(o),A.Hd=null,A.Vd=null);i-- >0;)A.Kd();if(this.Qu&&this.td)for(let t=0;t{e.d(i,{A:()=>n});var s=e(6333);class n extends s.${static count=0;static Do=[];static yu=t=>{this.count=t.mu;for(let i=0;i=1&&t<5?this.zd[t-1]=i.mu:250===t?this.Fu=i.Eu:console.log('Error unrecognised mesanim config code: ',t)}}},6948:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(3867);class a extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static No=new r.A(30);static yu=t=>{this.sd=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.mu,this.nd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%20;const i=this.cache[this.rd]=new a(t);return this.sd.Af=this.nd[t],i.Bu(this.sd),i};static So=()=>{this.No=null,this.nd=null,this.cache=null,this.sd=null};name=null;dd=null;size=1;Ju=null;$u=null;Ad=!1;Zd=-1;qd=-1;Jd=-1;$d=-1;Qd=-1;Qu=null;td=null;ud=null;Td=-1;Od=-1;Rd=-1;tw=!0;iw=-1;ew=128;sw=128;decode(t,i){if(1===t){const t=i.Au;this.Ju=new Uint16Array(t);for(let e=0;e=30&&t<40)this.ud||(this.ud=new o.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(40===t){const t=i.Au;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e{e.d(i,{A:()=>u});var s=e(6333),n=e(1069),r=e(2511),h=e(2679),o=e(8665),a=e(4583),l=e(8950),c=e(9298),f=e(3867);class u extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static lw=!0;static No=new h.A(50);static cw=new h.A(200);static yu=(t,i)=>{this.lw=i,this.sd=new n.A(t.read('obj.dat'));const e=new n.A(t.read('obj.idx'));this.count=e.mu,this.nd=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%10;const i=this.cache[this.rd];return this.sd.Af=this.nd[t],i.id=t,i.reset(),i.Bu(this.sd),-1!==i.fw&&i.uw(),!this.lw&&i.members&&(i.name='Members Object',i.dd="Login to a members' server to use this object.",i.ud=null,i.dw=null),i};static So=()=>{this.No=null,this.cw=null,this.nd=null,this.cache=null,this.sd=null};static Ya=(t,i)=>{if(u.cw){let e=u.cw.get(BigInt(t));if(e&&e.ww!==i&&-1!==e.ww&&(e.yw(),e=null),e)return e}let e=u.get(t);if(e.mw||(i=-1),e.mw&&e.pw&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.pw[s]&&0!==e.pw[s]&&(t=e.mw[s]);-1!==t&&(e=u.get(t))}const s=new r.A(32,32),n=a.A.yl,h=a.A.ml,o=a.A.Aw,f=l.A.gw,d=l.A.Iw,w=l.A._w,y=l.A.left,m=l.A.right,p=l.A.top,A=l.A.bottom;a.A.Cw=!1,l.A.bind(s.gw,32,32),l.A.fillRect(0,0,32,32,c.A.Za),a.A.Fc();const g=e.Ew(1),I=a.A.sin[e.bw]*e.Tw>>16,_=a.A.cos[e.bw]*e.Tw>>16;g.Il(0,e.Ow,e.Rw,e.bw,e.Sw,I+(g.jd/2|0)+e.Lw,_+e.Lw);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.gw[t+32*i]&&(t>0&&s.gw[t+32*i-1]>1||i>0&&s.gw[t+32*(i-1)]>1||t<31&&s.gw[t+32*i+1]>1||i<31&&s.gw[t+32*(i+1)]>1)&&(s.gw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.gw[t+32*i]&&t>0&&i>0&&s.gw[t+32*(i-1)-1]>0&&(s.gw[t+32*i]=3153952);if(-1!==e.fw){const t=this.Ya(e.xw,10),i=t.Xa,s=t.ww;t.Xa=32,t.ww=32,t.kw(5,5,22,22),t.Xa=i,t.ww=s}return u.cw?.put(BigInt(t),s),l.A.bind(f,d,w),l.A.Ta(y,p,m,A),a.A.yl=n,a.A.ml=h,a.A.Aw=o,a.A.Cw=!0,e.El?s.Xa=33:s.Xa=32,s.ww=i,s};model=0;name=null;dd=null;Qu=null;td=null;Tw=2e3;bw=0;Ow=0;Rw=0;Sw=0;Lw=0;Mw=!1;Dw=-1;El=!1;Nw=1;members=!1;ud=null;dw=null;Fw=-1;Bw=-1;Pw=0;Uw=-1;Gw=-1;Ww=0;Yw=-1;Hw=-1;Vw=-1;Kw=-1;Xw=-1;jw=-1;mw=null;pw=null;xw=-1;fw=-1;decode(t,i){if(1===t)this.model=i.mu;else if(2===t)this.name=i.Eu;else if(3===t)this.dd=i.Eu;else if(4===t)this.Tw=i.mu;else if(5===t)this.bw=i.mu;else if(6===t)this.Ow=i.mu;else if(7===t)this.Sw=i.Iu,this.Sw>32767&&(this.Sw-=65536);else if(8===t)this.Lw=i.Iu,this.Lw>32767&&(this.Lw-=65536);else if(9===t)this.Mw=!0;else if(10===t)this.Dw=i.mu;else if(11===t)this.El=!0;else if(12===t)this.Nw=i.ia;else if(16===t)this.members=!0;else if(23===t)this.Fw=i.mu,this.Pw=i.Dd;else if(24===t)this.Bw=i.mu;else if(25===t)this.Uw=i.mu,this.Ww=i.Dd;else if(26===t)this.Gw=i.mu;else if(t>=30&&t<35)this.ud||(this.ud=new f.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(t>=35&&t<40)this.dw||(this.dw=new f.fe(5,null)),this.dw[t-35]=i.Eu;else if(40===t){const t=i.Au;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.mw&&this.pw||(this.mw=new Uint16Array(10),this.pw=new Uint16Array(10)),this.mw[t-100]=i.mu,this.pw[t-100]=i.mu)}zw(t){let i=this.Fw;if(1===t&&(i=this.Uw),-1===i)return null;let e=this.Bw,s=this.Yw;1===t&&(e=this.Gw,s=this.Hw);let n=o.A.model(i);if(-1!==e){const t=o.A.model(e);if(-1===s){const i=[n,t];n=o.A.Fl(i,2)}else{const i=[n,t,o.A.model(s)];n=o.A.Fl(i,3)}}if(0===t&&0!==this.Pw&&n.translate(this.Pw,0,0),1===t&&0!==this.Ww&&n.translate(this.Ww,0,0),this.Qu&&this.td)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.pw[e]&&0!==this.pw[e]&&(i=this.mw[e]);if(-1!==i)return u.get(i).Ew(1)}if(u.No){const t=u.No.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.Qu&&this.td)for(let t=0;t{e.d(i,{A:()=>h});var s=e(6333),n=e(1069),r=e(6730);class h extends s.${static count=0;static Do=[];static yu=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.mu;for(let t=0;t{e.d(i,{A:()=>a});var s=e(6333),n=e(1069),r=e(1312),h=e(8665),o=e(2679);class a extends s.${static count=0;static Do=[];static No=new o.A(30);static yu=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.mu;for(let t=0;t=40&&t<50?this.Qu[t-40]=i.mu:t>=50&&t<60?this.td[t-50]=i.mu:console.log('Error unrecognised spotanim config code: ',t)}Al(){let t=a.No?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let i=0;i<6;i++)0!==this.Qu[0]&&t.Bl(this.Qu[i],this.td[i]);return a.No?.put(BigInt(this.id),t),t}}},3764:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(6333),n=e(1069);class r extends s.${static count=0;static Do=[];static iy=[];static ey=0;static yu=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.mu;for(let t=0;t{e.d(i,{A:()=>s});class s{static OPEN=0;static uy=1;static wy=2;static yy=4;static my=8;static py=s.uy<<4;static Ay=s.wy<<4;static gy=s.yy<<4;static Iy=s.my<<4;static _y=256;static Cy=512;static Ey=1024;static vy=2048;static by=4096;static Ty=s.Cy<<4;static Oy=s.Ey<<4;static Ry=s.vy<<4;static Sy=s.by<<4;static Ly=s._y<<9;static xy=524288;static ky=2097152;static My=s.ky|s.xy;static Dy=s._y|s.My;static Ny=s.wy|s.Dy;static Fy=s.my|s.Dy;static By=s.wy|s.yy|s.Fy;static Py=s.Ay|s.Dy;static Uy=s.my|s.py|s.Py;static Gy=s.Iy|s.Dy;static Wy=s.uy|s.wy|s.Gy;static Yy=s.Ay|s.gy|s.Gy;static Hy=16777215}},670:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(9456),n=e(6169),r=e(1023),h=e(4909);class o{static Dr=4;static jr=104;static index=(t,i)=>t*o.jr+i;offsetX;Vy;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Vy=0,this.sizeX=o.jr,this.sizeZ=o.jr,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.Vy)]|=s.A.ky};Xy=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.Vy)]&=~s.A.ky};jy=(t,i,e,r,h,o)=>{let a=s.A._y;o&&(a|=s.A.Ly);const l=t-this.offsetX,c=i-this.Vy;if(h===n.A.zy||h===n.A.Zy){const t=e;e=r,r=t}for(let t=l;t=0&&t=0&&i{let a=s.A._y;o&&(a|=s.A.Ly);const l=t-this.offsetX,c=i-this.Vy;if(h===n.A.zy||h===n.A.Zy){const t=e;e=r,r=t}for(let t=l;t=0&&t=0&&i{const a=t-this.offsetX,l=i-this.Vy,c=o?s.A.Sy:s.A.Iy,f=o?s.A.by:s.A.my,u=o?s.A.Ey:s.A.wy,d=o?s.A.Oy:s.A.Ay,w=o?s.A.Cy:s.A.uy,y=o?s.A.Ty:s.A.py,m=o?s.A.vy:s.A.yy,p=o?s.A.Ry:s.A.gy;e===r.A.$y.id?h===n.A.Yd?(this.add(a,l,c),this.add(a-1,l,f)):h===n.A.zy?(this.add(a,l,u),this.add(a,l+1,d)):h===n.A.Qy?(this.add(a,l,f),this.add(a+1,l,c)):h===n.A.Zy&&(this.add(a,l,d),this.add(a,l-1,u)):e===r.A.tm.id||e===r.A.im.id?h===n.A.Yd?(this.add(a,l,w),this.add(a-1,l+1,y)):h===n.A.zy?(this.add(a,l,m),this.add(a+1,l+1,p)):h===n.A.Qy?(this.add(a,l,y),this.add(a+1,l-1,w)):h===n.A.Zy&&(this.add(a,l,p),this.add(a-1,l-1,m)):e===r.A.sm.id&&(h===n.A.Yd?(this.add(a,l,u|c),this.add(a-1,l,f),this.add(a,l+1,d)):h===n.A.zy?(this.add(a,l,u|f),this.add(a,l+1,d),this.add(a+1,l,c)):h===n.A.Qy?(this.add(a,l,d|f),this.add(a+1,l,c),this.add(a,l-1,u)):h===n.A.Zy&&(this.add(a,l,d|c),this.add(a,l-1,u),this.add(a-1,l,f))),o&&this.Jy(t,i,e,h,!1)};nm=(t,i,e,h,o)=>{const a=t-this.offsetX,l=i-this.Vy,c=o?s.A.Sy:s.A.Iy,f=o?s.A.by:s.A.my,u=o?s.A.Ey:s.A.wy,d=o?s.A.Oy:s.A.Ay,w=o?s.A.Cy:s.A.uy,y=o?s.A.Ty:s.A.py,m=o?s.A.vy:s.A.yy,p=o?s.A.Ry:s.A.gy;e===r.A.$y.id?h===n.A.Yd?(this.remove(a,l,c),this.remove(a-1,l,f)):h===n.A.zy?(this.remove(a,l,u),this.remove(a,l+1,d)):h===n.A.Qy?(this.remove(a,l,f),this.remove(a+1,l,c)):h===n.A.Zy&&(this.remove(a,l,d),this.remove(a,l-1,u)):e===r.A.tm.id||e===r.A.im.id?h===n.A.Yd?(this.remove(a,l,w),this.remove(a-1,l+1,y)):h===n.A.zy?(this.remove(a,l,m),this.remove(a+1,l+1,p)):h===n.A.Qy?(this.remove(a,l,y),this.remove(a+1,l-1,w)):h===n.A.Zy&&(this.remove(a,l,p),this.remove(a-1,l-1,m)):e===r.A.sm.id&&(h===n.A.Yd?(this.remove(a,l,u|c),this.remove(a-1,l,f),this.remove(a,l+1,d)):h===n.A.zy?(this.remove(a,l,u|f),this.remove(a,l+1,d),this.remove(a+1,l,c)):h===n.A.Qy?(this.remove(a,l,d|f),this.remove(a+1,l,c),this.remove(a,l-1,u)):h===n.A.Zy&&(this.remove(a,l,d|c),this.remove(a,l-1,u),this.remove(a-1,l,f))),o&&this.nm(t,i,e,h,!1)};rm=(t,i,e,h,a,l)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Vy,u=e-this.offsetX,d=h-this.Vy,w=o.index(c,f);if(a===r.A.$y.id){if(l===n.A.Yd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Py)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0}else if(l===n.A.zy){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Fy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Gy)===s.A.OPEN)return!0}else if(l===n.A.Qy){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Py)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0}else if(l===n.A.Zy){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Fy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Gy)===s.A.OPEN)return!0}}else if(a===r.A.sm.id){if(l===n.A.Yd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Gy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0}else if(l===n.A.zy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Fy)===s.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0}else if(l===n.A.Qy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Fy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Py)===s.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(l===n.A.Zy){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Py)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Gy)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(a===r.A.hm.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.wy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.my)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Iy)===s.A.OPEN)return!0}return!1};om=(t,i,e,h,a,l)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Vy,u=e-this.offsetX,d=h-this.Vy,w=o.index(c,f);if(a===r.A.am.id||a===r.A.lm.id){if(a===r.A.lm.id&&(l=l+2&3),l===n.A.Yd){if(c===u+1&&f===d&&(this.flags[w]&s.A.Iy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.wy)===s.A.OPEN)return!0}else if(l===n.A.zy){if(c===u-1&&f===d&&(this.flags[w]&s.A.my)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.wy)===s.A.OPEN)return!0}else if(l===n.A.Qy){if(c===u-1&&f===d&&(this.flags[w]&s.A.my)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0}else if(l===n.A.Zy){if(c===u+1&&f===d&&(this.flags[w]&s.A.Iy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0}}else if(a===r.A.fm.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.wy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.my)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Iy)===s.A.OPEN)return!0}return!1};um=(t,i,e,n,r,a,l)=>{const c=e+r-1,f=n+a-1,u=o.index(t-this.offsetX,i-this.Vy);return t>=e&&t<=c&&i>=n&&i<=f||(t===e-1&&i>=n&&i<=f&&(this.flags[u]&s.A.my)===s.A.OPEN&&(l&h.A.Yd)===s.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&s.A.Iy)===s.A.OPEN&&(l&h.A.Qy)===s.A.OPEN||(i===n-1&&t>=e&&t<=c&&(this.flags[u]&s.A.wy)===s.A.OPEN&&(l&h.A.Zy)===s.A.OPEN||i===f+1&&t>=e&&t<=c&&(this.flags[u]&s.A.Ay)===s.A.OPEN&&(l&h.A.zy)===s.A.OPEN)))};add=(t,i,e)=>{this.flags[o.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[o.index(t,i)]&=s.A.Hy-e}}},4909:(t,i,e)=>{e.d(i,{A:()=>s});class s{static zy=1;static Qy=2;static Zy=4;static Yd=8}},6169:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Yd=0;static zy=1;static Qy=2;static Zy=3}},5599:(t,i,e)=>{e.d(i,{A:()=>s});class s{static dm=0;static wm=1;static ym=2;static pm=3}},1023:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5599);class n{static $y=new n(0,s.A.dm);static tm=new n(1,s.A.dm);static sm=new n(2,s.A.dm);static im=new n(3,s.A.dm);static Am=new n(4,s.A.wm);static gm=new n(5,s.A.wm);static am=new n(6,s.A.wm);static lm=new n(7,s.A.wm);static fm=new n(8,s.A.wm);static hm=new n(9,s.A.ym);static fd=new n(10,s.A.ym);static Im=new n(11,s.A.ym);static _m=new n(12,s.A.ym);static Cm=new n(13,s.A.ym);static Em=new n(14,s.A.ym);static vm=new n(15,s.A.ym);static bm=new n(16,s.A.ym);static Tm=new n(17,s.A.ym);static Om=new n(18,s.A.ym);static Rm=new n(19,s.A.ym);static Sm=new n(20,s.A.ym);static Lm=new n(21,s.A.ym);static pm=new n(22,s.A.pm);static values(){return[this.$y,this.tm,this.Tm,this.vm,this.sm,this.Em,this.hm,this.im,this.pm,this._m,this.Im,this.am,this.Sm,this.fd,this.gm,this.Cm,this.lm,this.Am,this.bm,this.fm,this.Rm,this.Lm,this.Om]}static of(t){const i=this.values();for(let e=0;e{e.d(i,{A:()=>m});var s=e(670),n=e(2164),r=e(1069),h=e(4583),o=e(3045),a=e(5637),l=e(4197),c=e(1312),f=e(1023),u=e(6169),d=e(9298),w=e(5518),y=e(3867);class m{static xm=Int8Array.of(1,2,4,8);static km=Uint8Array.of(16,32,64,128);static Mm=Int8Array.of(1,0,-1,0);static Dm=Int8Array.of(0,-1,0,1);static Nm=(17*Math.random()|0)-8;static Fm=(33*Math.random()|0)-16;static et=!0;static Bm=0;static Pm=!1;static Um=(t,i)=>{let e=this.Gm(t+45365,i+91923,4)+(this.Gm(t+10294,i+37821,2)-128>>1)+(this.Gm(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static Gm=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.Wm(s,r),a=this.Wm(s+1,r),l=this.Wm(s,r+1),c=this.Wm(s+1,r+1),f=this.Ym(o,a,n,e),u=this.Ym(l,c,n,e);return this.Ym(f,u,h,e)};static Ym=(t,i,e,s)=>{const n=65536-h.A.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static Wm=(t,i)=>((this.Hm(t-1,i-1)+this.Hm(t+1,i-1)+this.Hm(t-1,i+1)+this.Hm(t+1,i+1))/16|0)+((this.Hm(t-1,i)+this.Hm(t+1,i)+this.Hm(t,i-1)+this.Hm(t,i+1))/8|0)+(this.Hm(t,i)/4|0);static Hm=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static jy=(t,i,e,s,n,r,h,o,d,w,y)=>{const p=n[y][i][e],A=n[y][i+1][e],g=n[y][i+1][e+1],I=n[y][i][e+1],_=p+A+g+I>>2,C=a.A.get(o);let E=i+(e<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A.pm.id)s?.Vm(C.Al(f.A.pm.id,w,p,A,g,I,-1),t,i,e,_,E,v),C.wd&&C.active&&h?.Ky(i,e),-1!==C.ga&&r.Km(new l.A(o,t,3,i,e,c.A.Do[C.ga],!0));else if(d===f.A.fd.id||d===f.A.Im.id){const n=C.Al(f.A.fd.id,w,p,A,g,I,-1);if(n){let r,h,o=0;d===f.A.Im.id&&(o+=256),w===u.A.zy||w===u.A.Zy?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.jy(t,i,e,_,n,null,E,v,r,h,o)}C.wd&&h?.jy(i,e,C.width,C.length,w,C.yd),-1!==C.ga&&r.Km(new l.A(o,t,2,i,e,c.A.Do[C.ga],!0))}else if(d>=f.A._m.id)s?.jy(t,i,e,_,C.Al(d,w,p,A,g,I,-1),null,E,v,1,1,0),C.wd&&h?.jy(i,e,C.width,C.length,w,C.yd),-1!==C.ga&&r.Km(new l.A(o,t,2,i,e,c.A.Do[C.ga],!0));else if(d===f.A.$y.id)s?.Jy(t,i,e,_,m.xm[w],0,C.Al(f.A.$y.id,w,p,A,g,I,-1),null,E,v),C.wd&&h?.Jy(i,e,d,w,C.yd),-1!==C.ga&&r.Km(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0));else if(d===f.A.tm.id)s?.Jy(t,i,e,_,m.km[w],0,C.Al(f.A.tm.id,w,p,A,g,I,-1),null,E,v),C.wd&&h?.Jy(i,e,d,w,C.yd),-1!==C.ga&&r.Km(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0));else if(d===f.A.sm.id){const n=w+1&3;s?.Jy(t,i,e,_,m.xm[w],m.xm[n],C.Al(f.A.sm.id,w+4,p,A,g,I,-1),C.Al(f.A.sm.id,n,p,A,g,I,-1),E,v),C.wd&&h?.Jy(i,e,d,w,C.yd),-1!==C.ga&&r.Km(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0))}else if(d===f.A.im.id)s?.Jy(t,i,e,_,m.km[w],0,C.Al(f.A.im.id,w,p,A,g,I,-1),null,E,v),C.wd&&h?.Jy(i,e,d,w,C.yd),-1!==C.ga&&r.Km(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0));else if(d===f.A.hm.id)s?.jy(t,i,e,_,C.Al(d,w,p,A,g,I,-1),null,E,v,1,1,0),C.wd&&h?.jy(i,e,C.width,C.length,w,C.yd),-1!==C.ga&&r.Km(new l.A(o,t,2,i,e,c.A.Do[C.ga],!0));else if(d===f.A.Am.id)s?.Xm(t,i,e,_,0,0,E,C.Al(f.A.Am.id,u.A.Yd,p,A,g,I,-1),v,512*w,m.xm[w]),-1!==C.ga&&r.Km(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0));else if(d===f.A.gm.id){let n=16;if(s){const r=s.jm(t,i,e);r>0&&(n=a.A.get(r>>14&32767).gd)}s?.Xm(t,i,e,_,m.Mm[w]*n,m.Dm[w]*n,E,C.Al(f.A.Am.id,u.A.Yd,p,A,g,I,-1),v,512*w,m.xm[w]),-1!==C.ga&&r.Km(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0))}else d===f.A.am.id?(s?.Xm(t,i,e,_,0,0,E,C.Al(f.A.Am.id,u.A.Yd,p,A,g,I,-1),v,w,256),-1!==C.ga&&r.Km(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0))):d===f.A.lm.id?(s?.Xm(t,i,e,_,0,0,E,C.Al(f.A.Am.id,u.A.Yd,p,A,g,I,-1),v,w,512),-1!==C.ga&&r.Km(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0))):d===f.A.fm.id&&(s?.Xm(t,i,e,_,0,0,E,C.Al(f.A.Am.id,u.A.Yd,p,A,g,I,-1),v,w,768),-1!==C.ga&&r.Km(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0)))};zm;Zm;Hr;Vr;qm;Jm;$m;Qm;tp;ip;ep;sp;np;rp;hp;op;constructor(t,i,e,n){this.zm=t,this.Zm=i,this.Hr=e,this.Vr=n,this.qm=new y.ap(s.A.Dr,t,i),this.Jm=new y.ap(s.A.Dr,t,i),this.$m=new y.ap(s.A.Dr,t,i),this.Qm=new y.ap(s.A.Dr,t,i),this.op=new y.lp(s.A.Dr,t+1,i+1),this.tp=new y.ap(s.A.Dr,t+1,i+1),this.ip=new y.Xr(t+1,i+1),this.ep=new Int32Array(i),this.sp=new Int32Array(i),this.np=new Int32Array(i),this.rp=new Int32Array(i),this.hp=new Int32Array(i)}cp=(t,i)=>{for(let t=0;t=0&&i[s]?.Ky(e,n)}m.Nm+=(5*Math.random()|0)-2,m.Nm<-8?m.Nm=-8:m.Nm>8&&(m.Nm=8),m.Fm+=(5*Math.random()|0)-2,m.Fm<-16?m.Fm=-16:m.Fm>16&&(m.Fm=16);for(let i=0;i>8;for(let t=1;t>2)+(e[n+1][t]>>3)+(e[n][t-1]>>2)+(e[n][t+1]>>3)+(e[n][t]>>1);this.ip[n][t]=u-d}for(let t=0;t=0&&s0){const i=n.A.Do[e-1];this.ep[t]+=i.zu,this.sp[t]+=i.Ku,this.np[t]+=i.Xu,this.rp[t]+=i.ju,r=this.hp[t]++}}const h=e-5;if(h>=0&&h0){const i=n.A.Do[e-1];this.ep[t]-=i.zu,this.sp[t]-=i.Ku,this.np[t]-=i.Xu,this.rp[t]-=i.ju,r=this.hp[t]--}}}if(e>=1&&e=0&&f=0&&y=1&&c0||y>0){const p=this.Hr[i][e][c],A=this.Hr[i][e+1][c],g=this.Hr[i][e+1][c+1],I=this.Hr[i][e][c+1],_=this.ip[e][c],C=this.ip[e+1][c],E=this.ip[e+1][c+1],v=this.ip[e][c+1];let b=-1,T=-1;if(f>0){const t=256*s/a|0,i=r/l|0;let e=o/l|0;b=n.A.Pu(t,i,e);const h=t+m.Nm&255;e+=m.Fm,e<0?e=0:e>255&&(e=255),T=n.A.Pu(h,i,e)}if(i>0){let t=0!==f||this.$m[i][e][c]===w.A.up;y>0&&!n.A.Do[y-1].Hu&&(t=!1),t&&p===A&&p===g&&p===I&&(this.op[i][e][c]|=2340)}let O=0;if(-1!==b&&(O=h.A.palette[n.A.Uu(T,96)]),0===y)t?.dp(i,e,c,w.A.up,u.A.Yd,-1,p,A,g,I,n.A.Uu(b,_),n.A.Uu(b,C),n.A.Uu(b,E),n.A.Uu(b,v),d.A.Za,d.A.Za,d.A.Za,d.A.Za,O,d.A.Za);else{const s=this.$m[i][e][c]+1,r=this.Qm[i][e][c],o=n.A.Do[y-1];let a,l,f=o.texture;f>=0?(l=h.A.wp(f),a=-1):o.Wu===d.A.yp?(l=0,a=-2,f=-1):(a=n.A.Pu(o.Vu,o.Ku,o.Xu),l=h.A.palette[n.A.Gu(o.Zu,96)]),t?.dp(i,e,c,s,r,f,p,A,g,I,n.A.Uu(b,_),n.A.Uu(b,C),n.A.Uu(b,E),n.A.Uu(b,v),n.A.Gu(a,_),n.A.Gu(a,C),n.A.Gu(a,E),n.A.Gu(a,v),O,l)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let s=0;s<=n;s++)for(let r=0;r<=this.Zm;r++)for(let h=0;h<=this.zm;h++){if(this.op[s][h][r]&t){let i=r,e=r,a=s,l=s;for(;i>0&&this.op[s][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.op[a-1][h][s]&t))break t;a--}t:for(;l=8){const s=this.Hr[l][h][i]-240,r=this.Hr[a][h][i];o.A.gp(n,1,128*h,s,128*i,128*h,r,128*e+128);for(let s=a;s<=l;s++)for(let n=i;n<=e;n++)this.op[s][h][n]&=~t}}if(this.op[s][h][r]&i){let t=h,e=h,a=s,l=s;for(;t>0&&this.op[s][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.op[a-1][s][r]&i))break t;a--}t:for(;l=8){const s=this.Hr[l][t][r]-240,h=this.Hr[a][t][r];o.A.gp(n,2,128*t,s,128*r,128*e+128,h,128*r);for(let s=a;s<=l;s++)for(let n=t;n<=e;n++)this.op[s][n][r]&=~i}}if(this.op[s][h][r]&e){let t=h,i=h,a=r,l=r;for(;a>0&&this.op[s][h][a-1]&e;)a--;for(;l0;){for(let i=a;i<=l;i++)if(!(this.op[s][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.Hr[s][t][a];o.A.gp(n,4,128*t,r,128*a,128*i+128,r,128*l+128);for(let n=t;n<=i;n++)for(let t=a;t<=l;t++)this.op[s][n][t]&=~e}}}}}};Ip=(t,i,e,r)=>{let h=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new r.A(new Uint8Array(h));for(let r=0;r=0&&l=0&&c>24,this.Qm[r][l][c]=(f-2&3)<<24>>24):f<=81?this.Vr[r][l][c]=f-49<<24>>24:this.qm[r][l][c]=f-81<<24>>24}else for(;f=o.Au,0!==f;){if(1===f){o.Au;break}f<=49&&o.Au}}};Cp=(t,i,e,n,h,o)=>{const a=new r.A(new Uint8Array(n));let l=-1;for(;;){const n=a.Ep;if(0===n)return;l+=n;let r=0;for(;;){const n=a.Ep;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=a.Au,w=d>>2,y=3&d,m=f+h,p=c+o;if(m>0&&p>0&&m=0&&(n=e[s]),this.jy(u,m,p,t,i,n,l,w,y)}}}};jy=(t,i,e,s,n,r,h,o,d)=>{if(m.et){if(16&this.Vr[t][i][e])return;if(this.fp(t,i,e)!==m.Bm)return}const w=this.Hr[t][i][e],y=this.Hr[t][i+1][e],p=this.Hr[t][i+1][e+1],A=this.Hr[t][i][e+1],g=w+y+p+A>>2,I=a.A.get(h);let _=i+(e<<7)+(h<<14)+1073741824|0;I.active||(_+=-2147483648),_|=0;const C=(d<<6)+o<<24>>24;if(o===f.A.pm.id)(!m.et||I.active||I.Md)&&(s?.Vm(I.Al(f.A.pm.id,d,w,y,p,A,-1),t,i,e,g,_,C),I.wd&&I.active&&r?.Ky(i,e),-1!==I.ga&&n.Km(new l.A(h,t,3,i,e,c.A.Do[I.ga],!0)));else if(o===f.A.fd.id||o===f.A.Im.id){const a=I.Al(f.A.fd.id,d,w,y,p,A,-1);if(a){let n,r,h=0;if(o===f.A.Im.id&&(h+=256),d===u.A.zy||d===u.A.Zy?(n=I.length,r=I.width):(n=I.width,r=I.length),s?.jy(t,i,e,g,a,null,_,C,n,r,h)&&I.bd)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=a.vp/4|0;r>30&&(r=30),r>this.tp[t][i+s][e+n]&&(this.tp[t][i+s][e+n]=r<<24>>24)}}I.wd&&r?.jy(i,e,I.width,I.length,d,I.yd),-1!==I.ga&&n.Km(new l.A(h,t,2,i,e,c.A.Do[I.ga],!0))}else if(o>=f.A._m.id)s?.jy(t,i,e,g,I.Al(o,d,w,y,p,A,-1),null,_,C,1,1,0),o>=f.A._m.id&&o<=f.A.Tm.id&&o!==f.A.Cm.id&&t>0&&(this.op[t][i][e]|=2340),I.wd&&r?.jy(i,e,I.width,I.length,d,I.yd),-1!==I.ga&&n.Km(new l.A(h,t,2,i,e,c.A.Do[I.ga],!0));else if(o===f.A.$y.id)s?.Jy(t,i,e,g,m.xm[d],0,I.Al(f.A.$y.id,d,w,y,p,A,-1),null,_,C),d===u.A.Yd?(I.bd&&(this.tp[t][i][e]=50,this.tp[t][i][e+1]=50),I.Hu&&(this.op[t][i][e]|=585)):d===u.A.zy?(I.bd&&(this.tp[t][i][e+1]=50,this.tp[t][i+1][e+1]=50),I.Hu&&(this.op[t][i][e+1]|=1170)):d===u.A.Qy?(I.bd&&(this.tp[t][i+1][e]=50,this.tp[t][i+1][e+1]=50),I.Hu&&(this.op[t][i+1][e]|=585)):d===u.A.Zy&&(I.bd&&(this.tp[t][i][e]=50,this.tp[t][i+1][e]=50),I.Hu&&(this.op[t][i][e]|=1170)),I.wd&&r?.Jy(i,e,o,d,I.yd),-1!==I.ga&&n.Km(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0)),16!==I.gd&&s?.bp(t,i,e,I.gd);else if(o===f.A.tm.id)s?.Jy(t,i,e,g,m.km[d],0,I.Al(f.A.tm.id,d,w,y,p,A,-1),null,_,C),I.bd&&(d===u.A.Yd?this.tp[t][i][e+1]=50:d===u.A.zy?this.tp[t][i+1][e+1]=50:d===u.A.Qy?this.tp[t][i+1][e]=50:d===u.A.Zy&&(this.tp[t][i][e]=50)),I.wd&&r?.Jy(i,e,o,d,I.yd),-1!==I.ga&&n.Km(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0));else if(o===f.A.sm.id){const a=d+1&3;s?.Jy(t,i,e,g,m.xm[d],m.xm[a],I.Al(f.A.sm.id,d+4,w,y,p,A,-1),I.Al(f.A.sm.id,a,w,y,p,A,-1),_,C),I.Hu&&(d===u.A.Yd?(this.op[t][i][e]|=265,this.op[t][i][e+1]|=1170):d===u.A.zy?(this.op[t][i][e+1]|=1170,this.op[t][i+1][e]|=585):d===u.A.Qy?(this.op[t][i+1][e]|=585,this.op[t][i][e]|=1170):d===u.A.Zy&&(this.op[t][i][e]|=1170,this.op[t][i][e]|=585)),I.wd&&r?.Jy(i,e,o,d,I.yd),-1!==I.ga&&n.Km(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0)),16!==I.gd&&s?.bp(t,i,e,I.gd)}else if(o===f.A.im.id)s?.Jy(t,i,e,g,m.km[d],0,I.Al(f.A.im.id,d,w,y,p,A,-1),null,_,C),I.bd&&(d===u.A.Yd?this.tp[t][i][e+1]=50:d===u.A.zy?this.tp[t][i+1][e+1]=50:d===u.A.Qy?this.tp[t][i+1][e]=50:d===u.A.Zy&&(this.tp[t][i][e]=50)),I.wd&&r?.Jy(i,e,o,d,I.yd),-1!==I.ga&&n.Km(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0));else if(o===f.A.hm.id)s?.jy(t,i,e,g,I.Al(o,d,w,y,p,A,-1),null,_,C,1,1,0),I.wd&&r?.jy(i,e,I.width,I.length,d,I.yd),-1!==I.ga&&n.Km(new l.A(h,t,2,i,e,c.A.Do[I.ga],!0));else if(o===f.A.Am.id)s?.Xm(t,i,e,g,0,0,_,I.Al(f.A.Am.id,u.A.Yd,w,y,p,A,-1),C,512*d,m.xm[d]),-1!==I.ga&&n.Km(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0));else if(o===f.A.gm.id){let r=16;if(s){const n=s.jm(t,i,e);n>0&&(r=a.A.get(n>>14&32767).gd)}s?.Xm(t,i,e,g,m.Mm[d]*r,m.Dm[d]*r,_,I.Al(f.A.Am.id,u.A.Yd,w,y,p,A,-1),C,512*d,m.xm[d]),-1!==I.ga&&n.Km(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0))}else o===f.A.am.id?(s?.Xm(t,i,e,g,0,0,_,I.Al(f.A.Am.id,u.A.Yd,w,y,p,A,-1),C,d,256),-1!==I.ga&&n.Km(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0))):o===f.A.lm.id?(s?.Xm(t,i,e,g,0,0,_,I.Al(f.A.Am.id,u.A.Yd,w,y,p,A,-1),C,d,512),-1!==I.ga&&n.Km(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0))):o===f.A.fm.id&&(s?.Xm(t,i,e,g,0,0,_,I.Al(f.A.Am.id,u.A.Yd,w,y,p,A,-1),C,d,768),-1!==I.ga&&n.Km(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0)))};fp=(t,i,e)=>8&this.Vr[t][i][e]?0:t<=0||!(2&this.Vr[1][i][e])?t:t-1}},3045:(t,i,e)=>{e.d(i,{A:()=>g});var s=e(4583),n=e(1161),r=e(3795),h=e(8256),o=e(670),a=e(9222),l=e(6855),c=e(7441),f=e(6666),u=e(5748),d=e(3479),w=e(8950),y=e(2771),m=e(5518),p=e(6169),A=e(3867);class g{static Tp=new A.Op(8,32,51,51,!1);static Rp=new A.fe(100,null);static Sp=new Int32Array(o.A.Dr);static Lp=new A.xp(o.A.Dr,500,null);static kp=new A.fe(500,null);static Mp=new f.A;static Dp=0;static Np=0;static Fp=0;static Bp=0;static Pp=0;static Up=0;static Gp=0;static Wp=0;static Yp=0;static Hp=0;static Vp=0;static Kp=0;static Xp=0;static jp=0;static zp=0;static Zp=0;static qp=0;static Jp=0;static $p=0;static Qp=0;static tA=0;static iA=0;static eA=!1;static sA=null;static nA=Uint8Array.of(19,55,38,155,255,110,137,205,76);static rA=Uint8Array.of(160,192,80,96,0,144,80,48,160);static hA=Uint8Array.of(76,8,137,4,0,1,38,2,19);static oA=Int8Array.of(0,0,2,0,0,2,1,1,0);static aA=Int8Array.of(2,0,0,2,0,0,0,4,4);static lA=Int8Array.of(0,4,4,8,0,0,8,0,0);static cA=Int8Array.of(1,1,0,0,0,8,0,0,8);static fA=Int8Array.of(53,-53,-53,53);static uA=Int8Array.of(-53,-53,53,53);static dA=Int8Array.of(-45,45,45,-45);static wA=Int8Array.of(45,45,-45,-45);static yA=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static mA=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static pA=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static AA=0;static Ha=0;static Va=0;static gA=-1;static IA=-1;static et=!0;static init=(t,i,e,n,r)=>{this.Np=0,this.Fp=0,this.Bp=t,this.Pp=i,this.Up=t/2|0,this.Gp=i/2|0;const h=new A.Op(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.Wp=s.A.sin[t],this.Yp=s.A.cos[t],this.Hp=s.A.sin[i],this.Vp=s.A.cos[i];const o=(t-128)/32|0,a=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const s=128*t,l=128*i;let c=!1;for(let t=-e;t<=n;t+=128)if(this._A(s,l,r[o]+t)){c=!0;break}h[o][a][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let r=-1;r<=1;r++)for(let o=-1;o<=1;o++){if(h[t][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}}this.Tp[t][i][e+25][s+25]=n}};static So=()=>{this.Rp=null,this.Sp=null,this.Lp=null,this.Mp=null,this.Tp=null,this.kp=null,this.sA=null,console.log('World3D unloaded!')};static gp=(t,i,e,s,n,r,o,a)=>{g.Lp[t][g.Sp[t]++]=new h.A(e/128|0,r/128|0,n/128|0,a/128|0,i,e,r,n,a,s,o)};static _A=(t,i,e)=>{const s=i*this.Hp+t*this.Vp>>16,n=i*this.Vp-t*this.Hp>>16,r=e*this.Wp+n*this.Yp>>16,h=e*this.Yp-n*this.Wp>>16;if(r<50||r>3500)return!1;const o=this.Up+((s<<9)/r|0),a=this.Gp+((h<<9)/r|0);return o>=this.Np&&o<=this.Bp&&a>=this.Fp&&a<=this.Pp};CA;zm;Zm;EA;vA;_h;bA;TA;OA;RA=0;SA=0;LA=0;constructor(t,i,e,s){this.CA=e,this.zm=s,this.Zm=i,this.vA=new A.Eh(e,s,i,null),this.bA=new A.lp(e,s+1,i+1),this.EA=t,this._h=new A.fe(5e3,null),this.TA=new Int32Array(1e4),this.OA=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.SA=t;for(let i=0;i{const e=this.vA[0][t][i];for(let e=0;e<3;e++){this.vA[e][t][i]=this.vA[e+1][t][i];const s=this.vA[e][t][i];s&&s.level--}this.vA[0][t][i]||(this.vA[0][t][i]=new r.A(0,t,i));const s=this.vA[0][t][i];s&&(s.kA=e),this.vA[3][t][i]=null};mp=(t,i,e,s)=>{const n=this.vA[t][i][e];n&&(n.MA=s)};dp=(t,i,e,s,n,h,o,a,l,c,f,u,w,p,A,g,I,_,C,E)=>{if(s===m.A.up){for(let s=t;s>=0;s--)this.vA[s][i][e]||(this.vA[s][i][e]=new r.A(s,i,e));const s=this.vA[t][i][e];s&&(s.DA=new d.A(f,u,w,p,-1,C,!1))}else if(s===m.A.NA){for(let s=t;s>=0;s--)this.vA[s][i][e]||(this.vA[s][i][e]=new r.A(s,i,e));const s=this.vA[t][i][e];s&&(s.DA=new d.A(A,g,I,_,h,E,o===a&&o===l&&o===c))}else{for(let s=t;s>=0;s--)this.vA[s][i][e]||(this.vA[s][i][e]=new r.A(s,i,e));const d=this.vA[t][i][e];d&&(d.FA=new y.A(i,s,g,a,w,n,f,c,E,A,h,_,C,l,I,p,o,e,u))}};Vm=(t,i,e,s,n,h,o)=>{this.vA[i][e][s]||(this.vA[i][e][s]=new r.A(i,e,s));const l=this.vA[i][e][s];l&&(l.BA=new a.A(n,128*e+64,128*s+64,t,h,o))};PA=(t,i,e)=>{const s=this.vA[t][i][e];s&&(s.BA=null)};UA=(t,i,e,s,n,h,o,a)=>{let l=0;const c=this.vA[s][t][i];if(c)for(let t=0;tl&&(l=e)}else this.vA[s][t][i]=new r.A(s,t,i);const f=this.vA[s][t][i];f&&(f.YA=new u.A(e,128*t+64,128*i+64,h,o,a,n,l))};HA=(t,i,e)=>{const s=this.vA[t][i][e];s&&(s.YA=null)};Jy=(t,i,e,s,n,h,o,a,c,f)=>{if(!o&&!a)return;for(let s=t;s>=0;s--)this.vA[s][i][e]||(this.vA[s][i][e]=new r.A(s,i,e));const u=this.vA[t][i][e];u&&(u.VA=new l.A(s,128*i+64,128*e+64,n,h,o,a,c,f))};nm=(t,i,e,s)=>{const n=this.vA[t][i][e];1===s&&n&&(n.VA=null)};Xm=(t,i,e,s,n,h,o,a,l,f,u)=>{if(!a)return;for(let s=t;s>=0;s--)this.vA[s][i][e]||(this.vA[s][i][e]=new r.A(s,i,e));const d=this.vA[t][i][e];d&&(d.KA=new c.A(s,128*i+n+64,128*e+h+64,u,f,a,o,l))};XA=(t,i,e)=>{const s=this.vA[t][i][e];s&&(s.KA=null)};bp=(t,i,e,s)=>{const n=this.vA[t][i][e];if(!n)return;const r=n.KA;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};jA=(t,i,e,s)=>{if(!s)return;const n=this.vA[t][i][e];if(!n)return;const r=n.KA;r&&(r.model=s)};zA=(t,i,e,s)=>{if(!s)return;const n=this.vA[t][i][e];if(!n)return;const r=n.BA;r&&(r.model=s)};ZA=(t,i,e,s)=>{if(!s)return;const n=this.vA[t][i][e];if(!n)return;const r=n.VA;r&&(r.qA=s)};JA=(t,i,e,s,n)=>{if(!s)return;const r=this.vA[e][t][i];if(!r)return;const h=r.VA;h&&(h.qA=s,h.$A=n)};jy=(t,i,e,s,n,r,h,o,a,l,c)=>{if(!n&&!r)return!0;const f=128*i+64*a,u=128*e+64*l;return this.QA(f,u,s,t,i,e,a,l,n,r,h,o,c,!1)};tg=(t,i,e,s,n,r,h,o,a,l)=>{if(!n&&!r)return!0;let c=i-a,f=s-a,u=i+a,d=s+a;return l&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.QA(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};ig=(t,i,e,s,n,r,h,o,a,l,c,f)=>!a&&!l||this.QA(i,s,e,t,n,r,h+1-n,o-r+1,a,l,c,0,f,!0);qy=(t,i,e)=>{const s=this.vA[t][i][e];if(s)for(let t=0;t>29&3)&&n.sg===i&&n.ng===e)return void this.rg(n)}};hg=(t,i,e,s)=>{if(!s)return;const n=this.vA[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};og=()=>{for(let t=0;t{const s=this.vA[t][i][e];return s&&s.VA?s.VA.eg:0};ag=(t,i,e)=>{const s=this.vA[t][e][i];return s&&s.KA?s.KA.eg:0};lg=(t,i,e)=>{const s=this.vA[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.sg===i&&n.ng===e)return n.eg}return 0};cg=(t,i,e)=>{const s=this.vA[t][i][e];return s&&s.BA?s.BA.eg:0};fg=(t,i,e,s)=>{const n=this.vA[t][i][e];if(n){if(n.VA&&n.VA.eg===s)return 255&n.VA.info;if(n.KA&&n.KA.eg===s)return 255&n.KA.info;if(n.BA&&n.BA.eg===s)return 255&n.BA.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.vA[t][i+1][e-1];n&&n.BA&&n.BA.model&&n.BA.model.ug&&this.wg(s,n.BA.model,128,0,-128,!0)}};dg=(t,i,e,s,n,r)=>{let h=!0,o=i;const a=i+s,l=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.CA){for(let u=o;u<=a;u++)if(!(u<0||u>=this.zm))for(let o=l;o<=c;o++){if(o<0||o>=this.Zm||h&&u=e||u===i))continue;const l=this.vA[f][u][o];if(!l)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.EA[f][u][o]+this.EA[f][u+1][o]+this.EA[f][u][o+1]+this.EA[f][u+1][o+1])/4|0)-((this.EA[t][i][e]+this.EA[t][i+1][e]+this.EA[t][i][e+1]+this.EA[t][i+1][e+1])/4|0),m=l.VA;m&&m.qA&&m.qA.ug&&this.wg(r,m.qA,d,y,w,h),m&&m.$A&&m.$A.ug&&this.wg(r,m.$A,d,y,w,h);for(let t=0;t{this.LA++;let h=0;const o=i.Bd,a=i.Fd;if(t.ug&&t.gg)for(let r=0;ri.Ig)continue;const u=t.Bd[r]-e;if(ui.Cg)continue;const d=t.Pd[r]-n;if(di.vg)continue;if(i.ug&&i.gg)for(let t=0;t{const h=this.vA[t][i][e];if(!h)return;const o=h.DA;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const a=h.FA;if(!a)return;const l=a.shape,c=a.angle,f=a.xg,u=a.kg,d=g.yA[l],w=g.mA[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{g.eA=!0,g.Ha=t,g.Va=i,g.gA=-1,g.IA=-1};draw=(t,i,e,n,r,h,o)=>{t<0?t=0:t>=128*this.zm&&(t=128*this.zm-1),e<0?e=0:e>=128*this.Zm&&(e=128*this.Zm-1),g.Dp++,g.Wp=s.A.sin[h],g.Yp=s.A.cos[h],g.Hp=s.A.sin[r],g.Vp=s.A.cos[r],g.sA=g.Tp[(h-128)/32|0][r/64|0],g.Kp=t,g.Xp=i,g.jp=e,g.zp=t/128|0,g.Zp=e/128|0,g.tA=n,g.qp=g.zp-25,g.qp<0&&(g.qp=0),g.$p=g.Zp-25,g.$p<0&&(g.$p=0),g.Jp=g.zp+25,g.Jp>this.zm&&(g.Jp=this.zm),g.Qp=g.Zp+25,g.Qp>this.Zm&&(g.Qp=this.Zm),this.Mg(),g.iA=0;for(let t=this.SA;t=2e3)?(h.visible=!0,h.update=!0,h.Dg=h.GA>0,g.iA++):(h.visible=!1,h.update=!1,h.Ng=0))}}for(let t=this.SA;t=g.Jp))for(let t=-25;t<=0;t++){const n=g.Zp+t,r=g.Zp-t;let h;if(e>=g.qp&&(n>=g.$p&&(h=i[e][n],h&&h.visible&&this.Fg(h,!0,o)),r=g.$p&&(h=i[s][n],h&&h.visible&&this.Fg(h,!0,o)),r=g.Jp))for(let t=-25;t<=0;t++){const n=g.Zp+t,r=g.Zp-t;let h;if(e>=g.qp&&(n>=g.$p&&(h=i[e][n],h&&h.visible&&this.Fg(h,!1,o)),r=g.$p&&(h=i[s][n],h&&h.visible&&this.Fg(h,!1,o)),r{if(!c&&!f)return!1;for(let t=h;t=this.zm||i>=this.Zm)return!1;const e=this.vA[s][t][i];if(e&&e.GA>=5)return!1}const m=new n.A(s,e,t,i,c,f,w,h,h+a-1,o,o+l-1,u,d);for(let t=h;th&&(e|=1),to&&(e+=8),i=0;e--)this.vA[e][t][i]||(this.vA[e][t][i]=new r.A(e,t,i));const n=this.vA[s][t][i];n&&(n.WA[n.GA]=m,n.Bg[n.GA]=e,n.Pg|=e,n.GA++)}return y&&(this._h[this.RA++]=m),!0};rg=t=>{for(let i=t.sg;i<=t.mg;i++)for(let e=t.ng;e<=t.pg;e++){const s=this.vA[t.level][i][e];if(s){for(let i=0;i{const t=g.Sp[g.tA],i=g.Lp[g.tA];g.AA=0;for(let e=0;e=0&&s<=50){n=t.Gg+25-g.Zp,n<0&&(n=0),r=t.Zm+25-g.Zp,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.sA&&g.sA[s][n++]){i=!0;break}if(i){if(h=g.Kp-t._g,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.Wg=(t.Eg-g.jp<<8)/h|0,t.Yg=(t.vg-g.jp<<8)/h|0,t.Hg=(t.Ig-g.Xp<<8)/h|0,t.Vg=(t.jd-g.Xp<<8)/h|0,g.kp[g.AA++]=t}}}else if(2===t.type){if(s=t.Gg+25-g.Zp,s>=0&&s<=50){n=t.Ug+25-g.zp,n<0&&(n=0),r=t.zm+25-g.zp,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.sA&&g.sA[n++][s]){i=!0;break}if(i){if(h=g.jp-t.Eg,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.Kg=(t._g-g.Kp<<8)/h|0,t.Xg=(t.Cg-g.Kp<<8)/h|0,t.Hg=(t.Ig-g.Xp<<8)/h|0,t.Vg=(t.jd-g.Xp<<8)/h|0,g.kp[g.AA++]=t}}}else if(4===t.type&&(s=t.Ig-g.Xp,s>128&&(n=t.Gg+25-g.Zp,n<0&&(n=0),r=t.Zm+25-g.Zp,r>50&&(r=50),n<=r))){let i=t.Ug+25-g.zp;i<0&&(i=0),h=t.zm+25-g.zp,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(g.sA&&g.sA[t][i]){e=!0;break t}e&&(t.mode=5,t.Kg=(t._g-g.Kp<<8)/s|0,t.Xg=(t.Cg-g.Kp<<8)/s|0,t.Wg=(t.Eg-g.jp<<8)/s|0,t.Yg=(t.vg-g.jp<<8)/s|0,g.kp[g.AA++]=t)}}};Fg=(t,i,e)=>{for(g.Mp.Km(t);;){let t;do{if(t=g.Mp.jg(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.zg,o=this.vA[r];if(t.visible){if(i){if(r>0){const t=this.vA[r-1][s][n];if(t&&t.update)continue}if(s<=g.zp&&s>g.qp){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.Pg)))continue}if(s>=g.zp&&sg.$p){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.Pg)))continue}if(n>=g.Zp&&nn&&(l+=6),c=g.nA[l],t.tI=g.hA[l]),f&&(f.iI&g.rA[l]?16===f.iI?(t.Ng=3,t.eI=g.oA[l],t.sI=3-t.eI):32===f.iI?(t.Ng=6,t.eI=g.aA[l],t.sI=6-t.eI):64===f.iI?(t.Ng=12,t.eI=g.lA[l],t.sI=12-t.eI):(t.Ng=9,t.eI=g.cA[l],t.sI=9-t.eI):t.Ng=0,f.iI&c&&!this.nI(h,s,n,f.iI)&&f.qA?.draw(0,g.Wp,g.Yp,g.Hp,g.Vp,f.x-g.Kp,f.y-g.Xp,f.z-g.jp,f.eg),f.rI&c&&!this.nI(h,s,n,f.rI)&&f.$A?.draw(0,g.Wp,g.Yp,g.Hp,g.Vp,f.x-g.Kp,f.y-g.Xp,f.z-g.jp,f.eg)),u&&!this.visible(h,s,n,u.model.jd))if(u.type&c)u.model.draw(u.angle,g.Wp,g.Yp,g.Hp,g.Vp,u.x-g.Kp,u.y-g.Xp,u.z-g.jp,u.eg);else if(768&u.type){const t=u.x-g.Kp,i=u.y-g.Xp,e=u.z-g.jp,s=u.angle;let n,r;if(n=s===p.A.zy||s===p.A.Qy?-t:t,r=s===p.A.Qy||s===p.A.Zy?-e:e,256&u.type&&rn){const n=t+g.dA[s],r=e+g.wA[s];u.model.draw(512*s+1280&2047,g.Wp,g.Yp,g.Hp,g.Vp,n,i,r,u.eg)}}if(a){const i=t.BA;i&&i.model?.draw(0,g.Wp,g.Yp,g.Hp,g.Vp,i.x-g.Kp,i.y-g.Xp,i.z-g.jp,i.eg);const e=t.YA;e&&0===e.offset&&(e.hI&&e.hI.draw(0,g.Wp,g.Yp,g.Hp,g.Vp,e.x-g.Kp,e.y-g.Xp,e.z-g.jp,e.eg),e.oI&&e.oI.draw(0,g.Wp,g.Yp,g.Hp,g.Vp,e.x-g.Kp,e.y-g.Xp,e.z-g.jp,e.eg),e.aI&&e.aI.draw(0,g.Wp,g.Yp,g.Hp,g.Vp,e.x-g.Kp,e.y-g.Xp,e.z-g.jp,e.eg))}const d=t.Pg;if(0!==d){if(sg.zp&&1&d){const t=o[s-1][n];t&&t.update&&g.Mp.Km(t)}if(n>g.Zp&&8&d){const t=o[s][n-1];t&&t.update&&g.Mp.Km(t)}}}if(0!==t.Ng){let i=!0;for(let e=0;ei.sg&&(r+=1),ei.ng&&(r+=8),ss&&(s=n);const h=g.Zp-i.ng,a=i.pg-g.Zp;i.lI=a>h?s+a:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.lI,i=e))}if(-1===i)break;const a=g.Rp[i];if(a){a.Dp=g.Dp;let t=a.model;t||(t=a.$g?.draw(e)??null),t&&!this.cI(h,a.sg,a.mg,a.ng,a.pg,t.jd)&&t.draw(a.Qg,g.Wp,g.Yp,g.Hp,g.Vp,a.x-g.Kp,a.y-g.Xp,a.z-g.jp,a.eg);for(let t=a.sg;t<=a.mg;t++)for(let i=a.ng;i<=a.pg;i++){const e=o[t][i];e&&(0!==e.Ng?g.Mp.Km(e):t===s&&i===n||!e.update||g.Mp.Km(e))}}}if(t.Dg)continue}if(!t.update||0!==t.Ng)continue;if(s<=g.zp&&s>g.qp){const t=o[s-1][n];if(t&&t.update)continue}if(s>=g.zp&&sg.$p){const t=o[s][n-1];if(t&&t.update)continue}if(n>=g.Zp&&n=r){const r=t+g.fA[n],h=s+g.uA[n];i.model.draw(512*n+256,g.Wp,g.Yp,g.Hp,g.Vp,r,e,h,i.eg)}if(512&i.type&&h<=r){const r=t+g.dA[n],h=s+g.wA[n];i.model.draw(512*n+1280&2047,g.Wp,g.Yp,g.Hp,g.Vp,r,e,h,i.eg)}}const e=t.VA;e&&(e.rI&t.tI&&!this.nI(h,s,n,e.rI)&&e.$A?.draw(0,g.Wp,g.Yp,g.Hp,g.Vp,e.x-g.Kp,e.y-g.Xp,e.z-g.jp,e.eg),e.iI&t.tI&&!this.nI(h,s,n,e.iI)&&e.qA?.draw(0,g.Wp,g.Yp,g.Hp,g.Vp,e.x-g.Kp,e.y-g.Xp,e.z-g.jp,e.eg))}if(rg.zp){const t=o[s-1][n];t&&t.update&&g.Mp.Km(t)}if(n>g.Zp){const t=o[s][n-1];t&&t.update&&g.Mp.Km(t)}}};qg=(t,i,e,n,r,h,o,a)=>{let l,c,f,u,d=l=(e<<7)-g.Kp,y=c=(n<<7)-g.jp,m=f=d+128,p=u=y+128,A=this.EA[i][e][n]-g.Xp,I=this.EA[i][e+1][n]-g.Xp,_=this.EA[i][e+1][n+1]-g.Xp,C=this.EA[i][e][n+1]-g.Xp,E=y*o+d*a>>16;if(y=y*a-d*o>>16,d=E,E=A*h-y*r>>16,y=A*r+y*h>>16,A=E,y<50)return;if(E=c*o+m*a>>16,c=c*a-m*o>>16,m=E,E=I*h-c*r>>16,c=I*r+c*h>>16,I=E,c<50)return;if(E=p*o+f*a>>16,p=p*a-f*o>>16,f=E,E=_*h-p*r>>16,p=_*r+p*h>>16,_=E,p<50)return;if(E=u*o+l*a>>16,u=u*a-l*o>>16,l=E,E=C*h-u*r>>16,u=C*r+u*h>>16,C=E,u<50)return;const v=s.A.yl+((d<<9)/y|0),b=s.A.ml+((A<<9)/y|0),T=s.A.yl+((m<<9)/c|0),O=s.A.ml+((I<<9)/c|0),R=s.A.yl+((f<<9)/p|0),S=s.A.ml+((_<<9)/p|0),L=s.A.yl+((l<<9)/u|0),x=s.A.ml+((C<<9)/u|0);if(s.A.alpha=0,(R-L)*(O-x)-(S-x)*(T-L)>0)if(s.A.fI=R<0||L<0||T<0||R>w.A.uI||L>w.A.uI||T>w.A.uI,g.eA&&this.dI(g.Ha,g.Va,S,x,O,R,L,T)&&(g.gA=e,g.IA=n),-1===t.wI)12345678!==t.yI&&s.A.mI(R,L,T,S,x,O,t.yI,t.pI,t.AI);else if(g.et){const i=g.pA[t.wI];s.A.mI(R,L,T,S,x,O,this.gI(i,t.yI),this.gI(i,t.pI),this.gI(i,t.AI))}else t.flat?s.A.II(R,L,T,S,x,O,t.yI,t.pI,t.AI,d,A,y,m,l,I,C,c,u,t.wI):s.A.II(R,L,T,S,x,O,t.yI,t.pI,t.AI,f,_,p,l,m,C,I,u,c,t.wI);if(!((v-T)*(x-O)-(b-O)*(L-T)<=0))if(s.A.fI=v<0||T<0||L<0||v>w.A.uI||T>w.A.uI||L>w.A.uI,g.eA&&this.dI(g.Ha,g.Va,b,O,x,v,T,L)&&(g.gA=e,g.IA=n),-1!==t.wI){if(!g.et)return void s.A.II(v,T,L,b,O,x,t._I,t.AI,t.pI,d,A,y,m,l,I,C,c,u,t.wI);const i=g.pA[t.wI];s.A.mI(v,T,L,b,O,x,this.gI(i,t._I),this.gI(i,t.AI),this.gI(i,t.pI))}else 12345678!==t._I&&s.A.mI(v,T,L,b,O,x,t._I,t.AI,t.pI)};Jg=(t,i,e,n,r,h,o)=>{let a=e.Bd.length;for(let t=0;t>16;if(l=l*o-i*h>>16,i=c,c=a*r-l*n>>16,l=a*n+l*r>>16,a=c,l<50)return;e.CI&&(y.A.EI[t]=i,y.A.vI[t]=a,y.A.bI[t]=l),y.A.TI[t]=s.A.yl+((i<<9)/l|0),y.A.OI[t]=s.A.ml+((a<<9)/l|0)}s.A.alpha=0,a=e.RI.length;for(let n=0;n0)if(s.A.fI=a<0||l<0||c<0||a>w.A.uI||l>w.A.uI||c>w.A.uI,g.eA&&this.dI(g.Ha,g.Va,f,u,d,a,l,c)&&(g.gA=t,g.IA=i),e.CI&&-1!==e.CI[n])if(g.et){const t=g.pA[e.CI[n]];s.A.mI(a,l,c,f,u,d,this.gI(t,e.xI[n]),this.gI(t,e.kI[n]),this.gI(t,e.MI[n]))}else e.flat?s.A.II(a,l,c,f,u,d,e.xI[n],e.kI[n],e.MI[n],y.A.EI[0],y.A.vI[0],y.A.bI[0],y.A.EI[1],y.A.EI[3],y.A.vI[1],y.A.vI[3],y.A.bI[1],y.A.bI[3],e.CI[n]):s.A.II(a,l,c,f,u,d,e.xI[n],e.kI[n],e.MI[n],y.A.EI[r],y.A.vI[r],y.A.bI[r],y.A.EI[h],y.A.EI[o],y.A.vI[h],y.A.vI[o],y.A.bI[h],y.A.bI[o],e.CI[n]);else 12345678!==e.xI[n]&&s.A.mI(a,l,c,f,u,d,e.xI[n],e.kI[n],e.MI[n])}};Zg=(t,i,e)=>{const s=this.bA[t][i][e];if(s===-g.Dp)return!1;if(s===g.Dp)return!0;{const s=i<<7,n=e<<7;return this.DI(s+1,this.EA[t][i][e],n+1)&&this.DI(s+128-1,this.EA[t][i+1][e],n+1)&&this.DI(s+128-1,this.EA[t][i+1][e+1],n+128-1)&&this.DI(s+1,this.EA[t][i][e+1],n+128-1)?(this.bA[t][i][e]=g.Dp,!0):(this.bA[t][i][e]=-g.Dp,!1)}};nI=(t,i,e,s)=>{if(!this.Zg(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.EA[t][i][e]-1,o=h-120,a=h-230,l=h-238;if(s<16){if(1===s){if(n>g.Kp){if(!this.DI(n,h,r))return!1;if(!this.DI(n,h,r+128))return!1}if(t>0){if(!this.DI(n,o,r))return!1;if(!this.DI(n,o,r+128))return!1}return!!this.DI(n,a,r)&&this.DI(n,a,r+128)}if(2===s){if(r0){if(!this.DI(n,o,r+128))return!1;if(!this.DI(n+128,o,r+128))return!1}return!!this.DI(n,a,r+128)&&this.DI(n+128,a,r+128)}if(4===s){if(n0){if(!this.DI(n+128,o,r))return!1;if(!this.DI(n+128,o,r+128))return!1}return!!this.DI(n+128,a,r)&&this.DI(n+128,a,r+128)}if(8===s){if(r>g.jp){if(!this.DI(n,h,r))return!1;if(!this.DI(n+128,h,r))return!1}if(t>0){if(!this.DI(n,o,r))return!1;if(!this.DI(n+128,o,r))return!1}return!!this.DI(n,a,r)&&this.DI(n+128,a,r)}}return!!this.DI(n+64,l,r+64)&&(16===s?this.DI(n,a,r+128):32===s?this.DI(n+128,a,r+128):64===s?this.DI(n+128,a,r):128===s?this.DI(n,a,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.Zg(t,i,e)){const n=i<<7,r=e<<7;return this.DI(n+1,this.EA[t][i][e]-s,r+1)&&this.DI(n+128-1,this.EA[t][i+1][e]-s,r+1)&&this.DI(n+128-1,this.EA[t][i+1][e+1]-s,r+128-1)&&this.DI(n+1,this.EA[t][i][e+1]-s,r+128-1)}return!1};cI=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.bA[t][h][o]===-g.Dp)return!1;o=1+(i<<7);const a=2+(s<<7),l=this.EA[t][i][s]-r;if(!this.DI(o,l,a))return!1;const c=(e<<7)-1;if(!this.DI(c,l,a))return!1;const f=(n<<7)-1;return!!this.DI(o,l,f)&&this.DI(c,l,f)}return!!this.Zg(t,i,s)&&(h=i<<7,o=s<<7,this.DI(h+1,this.EA[t][i][s]-r,o+1)&&this.DI(h+128-1,this.EA[t][i+1][s]-r,o+1)&&this.DI(h+128-1,this.EA[t][i+1][s+1]-r,o+128-1)&&this.DI(h+1,this.EA[t][i][s+1]-r,o+128-1))};DI=(t,i,e)=>{for(let s=0;s0){const t=n.Eg+(n.Wg*s>>8),r=n.vg+(n.Yg*s>>8),h=n.Ig+(n.Hg*s>>8),o=n.jd+(n.Vg*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n._g;if(s>0){const t=n.Eg+(n.Wg*s>>8),r=n.vg+(n.Yg*s>>8),h=n.Ig+(n.Hg*s>>8),o=n.jd+(n.Vg*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.Eg-e;if(s>0){const e=n._g+(n.Kg*s>>8),r=n.Cg+(n.Xg*s>>8),h=n.Ig+(n.Hg*s>>8),o=n.jd+(n.Vg*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.Eg;if(s>0){const e=n._g+(n.Kg*s>>8),r=n.Cg+(n.Xg*s>>8),h=n.Ig+(n.Hg*s>>8),o=n.jd+(n.Vg*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.Ig;if(s>0){const i=n._g+(n.Kg*s>>8),r=n.Cg+(n.Xg*s>>8),h=n.Eg+(n.Wg*s>>8),o=n.vg+(n.Yg*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};dI=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const a=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*a>0&&a*((i-n)*(r-o)-(t-o)*(e-n))>0};gI=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{}},4197:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{NI;FI;BI;UI;index;ty;Ca;_a;constructor(t,i,e,s,n,r,h){super(),this.NI=i,this.FI=e,this.BI=s,this.UI=n,this.index=t,this.ty=r,h&&-1!==r.va&&this.ty.delay?(this.Ca=Math.random()*this.ty.Ea|0,this._a=Math.random()*this.ty.delay[this.Ca]|0):(this.Ca=-1,this._a=0)}}},9418:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(7121),n=e(1312),r=e(3867);class h extends s.A{x=0;z=0;Qg=0;GI=!1;size=1;Gl=-1;WI=-1;YI=-1;HI=-1;VI=-1;KI=-1;XI=-1;jI=null;zI=100;ZI=0;qI=0;JI=0;$I=0;QI=-1e3;t_=0;i_=0;e_=-1;s_=0;n_=0;r_=-1;h_=0;o_=0;a_=-1;l_=0;c_=0;f_=0;u_=0;d_=-1;w_=0;y_=0;m_=0;p_=0;A_=0;g_=0;I_=0;__=0;C_=0;E_=0;v_=0;Dp=0;height=0;b_=0;pathLength=0;T_=new Int32Array(10);O_=new Int32Array(10);R_=new r.fe(10,!1);S_=0;L_=-1;x_=-1;k_=-1;M_=-1;move(t,i,e){if(-1!==this.a_&&n.A.Do[this.a_].priority<=1&&(this.a_=-1),!t){const t=i-this.T_[0],s=e-this.O_[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.T_[t]=this.T_[t-1],this.O_[t]=this.O_[t-1],this.R_[t]=this.R_[t-1];return this.T_[0]=i,this.O_[0]=e,void(this.R_[0]=!1)}}this.pathLength=0,this.S_=0,this.T_[0]=i,this.O_[0]=e,this.x=128*this.T_[0]+64*this.size,this.z=128*this.O_[0]+64*this.size}step(t,i){let e=this.T_[0],s=this.O_[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.a_&&n.A.Do[this.a_].priority<=1&&(this.a_=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.T_[t]=this.T_[t-1],this.O_[t]=this.O_[t-1],this.R_[t]=this.R_[t-1];this.T_[0]=e,this.O_[0]=s,this.R_[0]=t}}},8268:(t,i,e)=>{e.d(i,{A:()=>d});var s=e(9418),n=e(8665),r=e(2679),h=e(8738),o=e(1312),a=e(8317),l=e(1302),c=e(3819),f=e(3867),u=e(9298);class d extends s.A{static D_=1;static N_=2;static F_=4;static B_=8;static P_=16;static U_=32;static G_=64;static W_=128;static Y_=256;static H_=512;static Ul=[u.A.V_,u.A.K_,u.A.X_,u.A.j_,u.A.z_,u.A.Z_,u.A.q_,u.A.J_,u.A.Q_,u.A.tC,u.A.iC,u.A.eC,u.A.sC,u.A.nC,u.A.rC,u.A.hC];static Pl=[[u.A.oC,u.A.aC,u.A.lC,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.mC,u.A.pC,u.A.AC],[u.A.gC,u.A.IC,u.A._C,u.A.CC,u.A.EC,u.A.vC,u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.SC,u.A.LC,u.A.xC,u.A.kC,u.A.MC,u.A.DC],[u.A.DC-1,u.A.gC+1,u.A.IC,u.A._C,u.A.CC,u.A.EC,u.A.vC,u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.SC,u.A.LC,u.A.xC,u.A.kC,u.A.MC],[u.A.NC,u.A.FC,u.A.BC,u.A.PC,u.A.UC,u.A.GC],[u.A.WC,u.A.YC,u.A.HC,u.A.VC,u.A.KC,u.A.XC,u.A.jC,u.A.zC]];static No=new r.A(200);name=null;visible=!1;ZC=0;qC=0;JC=new Uint16Array(12);$C=new Uint16Array(5);ic=0;QC=0n;y=0;tE=0;iE=0;eE=0;sE=0;nE=0;rE=null;Ug=0;Gg=0;zm=0;Zm=0;et=!1;draw(t){if(!this.visible)return null;let i=this.nw();if(this.height=i.jd,i.aw=!0,this.et)return i;if(-1!==this.d_&&-1!==this.w_){const t=h.A.Do[this.d_],e=n.A.Mu(t.Al(),!0,!t.Ad,!1);e.translate(-this.p_,0,0),e.Wl(),t.ty&&t.ty.frames&&e.Yl(t.ty.frames[this.w_]),e.Hd=null,e.Vd=null,128===t.ew&&128===t.sw||e.scale(t.ew,t.sw,t.ew),e.Hl(t.Id+64,t._d+850,-30,-50,-30,!0);const s=[i,e];i=n.A.hE(s,2)}if(this.rE&&(t>=this.iE&&(this.rE=null),t>=this.tE&&t=d.Pl[i].length)&&(e=0),this.$C[i]=e}this.Gl=t.mu,65535===this.Gl&&(this.Gl=-1),this.WI=t.mu,65535===this.WI&&(this.WI=-1),this.YI=t.mu,65535===this.YI&&(this.YI=-1),this.HI=t.mu,65535===this.HI&&(this.HI=-1),this.VI=t.mu,65535===this.VI&&(this.VI=-1),this.KI=t.mu,65535===this.KI&&(this.KI=-1),this.XI=t.mu,65535===this.XI&&(this.XI=-1),this.name=c.A.kl(c.A.Ml(t.oE)),this.ic=t.Au,this.visible=!0,this.QC=0n;for(let t=0;t<12;t++)this.QC<<=0x4n,this.JC[t]>=256&&(this.QC+=BigInt(this.JC[t])-256n);this.JC[0]>=256&&(this.QC+=BigInt(this.JC[0])-256n>>4n),this.JC[1]>=256&&(this.QC+=BigInt(this.JC[1])-256n>>8n);for(let t=0;t<5;t++)this.QC<<=0x3n,this.QC+=BigInt(this.$C[t]);this.QC<<=0x1n,this.QC+=BigInt(this.ZC)}ed(){if(!this.visible)return null;const t=new f.fe(12,null);let i=0;for(let e=0;e<12;e++){const s=this.JC[e];if(s>=256&&s<512&&(t[i++]=a.A.Do[s-256].ed()),s>=512){const e=l.A.get(s-512).ed(this.ZC);e&&(t[i++]=e)}}const e=n.A.Fl(t,i);for(let t=0;t<5;t++)0!==this.$C[t]&&(e.Bl(d.Pl[t][0],d.Pl[t][this.$C[t]]),1===t&&e.Bl(d.Ul[0],d.Ul[this.$C[t]]));return e}nw(){let t=this.QC,i=-1,e=-1,s=-1,r=-1;if(this.a_>=0&&0===this.f_){const n=o.A.Do[this.a_];if(n.frames&&(i=n.frames[this.l_]),this.r_>=0&&this.r_!==this.Gl){const t=o.A.Do[this.r_].frames;t&&(e=t[this.h_])}n.Jw>=0&&(s=n.Jw,t+=BigInt(s-this.JC[5])<<8n),n.$w>=0&&(r=n.$w,t+=BigInt(r-this.JC[3])<<16n)}else if(this.r_>=0){const t=o.A.Do[this.r_].frames;t&&(i=t[this.h_])}let h=d.No?.get(t);if(!h){const i=new f.fe(12,null);let e=0;for(let t=0;t<12;t++){let n=this.JC[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=a.A.Do[n-256].Al();t&&(i[e++]=t)}if(n>=512){const t=l.A.get(n-512).zw(this.ZC);t&&(i[e++]=t)}}h=n.A.Fl(i,e);for(let t=0;t<5;t++)0!==this.$C[t]&&(h.Bl(d.Pl[t][0],d.Pl[t][this.$C[t]]),1===t&&h.Bl(d.Ul[0],d.Ul[this.$C[t]]));h.Wl(),h.Hl(64,850,-30,-50,-30,!0),d.No?.put(t,h)}if(this.et)return h;const c=n.A.rw(h,!0);return-1!==i&&-1!==e?c.hw(i,e,o.A.Do[this.a_].Zw):-1!==i&&c.Yl(i),c.ow(),c.Hd=null,c.Vd=null,c}}},9222:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;model;eg;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.eg=n,this.info=r}}},1161:(t,i,e)=>{e.d(i,{A:()=>s});class s{level;y;x;z;model;$g;Qg;sg;mg;ng;pg;eg;info;lI=0;Dp=0;constructor(t,i,e,s,n,r,h,o,a,l,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.$g=r,this.Qg=h,this.sg=o,this.mg=a,this.ng=l,this.pg=c,this.eg=f,this.info=u}}},5748:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;aI;oI;hI;eg;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.aI=s,this.oI=n,this.hI=r,this.eg=h,this.offset=o}}},8256:(t,i,e)=>{e.d(i,{A:()=>s});class s{Ug;zm;Gg;Zm;type;_g;Cg;Eg;vg;Ig;jd;mode=0;Kg=0;Xg=0;Wg=0;Yg=0;Hg=0;Vg=0;constructor(t,i,e,s,n,r,h,o,a,l,c){this.Ug=t,this.zm=i,this.Gg=e,this.Zm=s,this.type=n,this._g=r,this.Cg=h,this.Eg=o,this.vg=a,this.Ig=l,this.jd=c}}},3795:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1982),n=e(3867);class r extends s.A{level;x;z;zg;WA;Bg;DA=null;FA=null;VA=null;KA=null;BA=null;YA=null;kA=null;GA=0;Pg=0;MA=0;visible=!1;update=!1;Dg=!1;Ng=0;eI=0;sI=0;tI=0;constructor(t,i,e){super(),this.zg=this.level=t,this.x=i,this.z=e,this.WA=new n.fe(5,null),this.Bg=new Int32Array(5)}}},2771:(t,i,e)=>{e.d(i,{A:()=>s});class s{static TI=new Int32Array(6);static OI=new Int32Array(6);static EI=new Int32Array(6);static vI=new Int32Array(6);static bI=new Int32Array(6);static aE=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static lE=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static cE=128;static fE=this.cE/2|0;static uE=this.cE/4|0;static dE=3*this.cE/4|0;Bd;Ud;Pd;xI;kI;MI;RI;SI;LI;CI;flat;shape;angle;xg;kg;constructor(t,i,e,n,r,h,o,a,l,c,f,u,d,w,y,m,p,A,g){this.flat=!(p!==n||p!==w||p!==a),this.shape=i,this.angle=h,this.xg=d,this.kg=l;const I=s.aE[i],_=I.length;this.Bd=new Int32Array(_),this.Ud=new Int32Array(_),this.Pd=new Int32Array(_);const C=new Int32Array(_),E=new Int32Array(_),v=t*s.cE,b=A*s.cE;for(let t=0;t<_;t++){let i,l,f,d,A,_=I[t];!(1&_)&&_<=8&&(_=1+(_-h-h-1&7)),_>8&&_<=12&&(_=9+(_-h-9&3)),_>12&&_<=16&&(_=13+(_-h-13&3)),1===_?(i=v,l=b,f=p,d=o,A=c):2===_?(i=v+s.fE,l=b,f=p+n>>1,d=o+g>>1,A=c+e>>1):3===_?(i=v+s.cE,l=b,f=n,d=g,A=e):4===_?(i=v+s.cE,l=b+s.fE,f=n+w>>1,d=g+r>>1,A=e+y>>1):5===_?(i=v+s.cE,l=b+s.cE,f=w,d=r,A=y):6===_?(i=v+s.fE,l=b+s.cE,f=w+a>>1,d=r+m>>1,A=y+u>>1):7===_?(i=v,l=b+s.cE,f=a,d=m,A=u):8===_?(i=v,l=b+s.fE,f=a+p>>1,d=m+o>>1,A=u+c>>1):9===_?(i=v+s.fE,l=b+s.uE,f=p+n>>1,d=o+g>>1,A=c+e>>1):10===_?(i=v+s.dE,l=b+s.fE,f=n+w>>1,d=g+r>>1,A=e+y>>1):11===_?(i=v+s.fE,l=b+s.dE,f=w+a>>1,d=r+m>>1,A=y+u>>1):12===_?(i=v+s.uE,l=b+s.fE,f=a+p>>1,d=m+o>>1,A=u+c>>1):13===_?(i=v+s.uE,l=b+s.uE,f=p,d=o,A=c):14===_?(i=v+s.dE,l=b+s.uE,f=n,d=g,A=e):15===_?(i=v+s.dE,l=b+s.dE,f=w,d=r,A=y):(i=v+s.uE,l=b+s.dE,f=a,d=m,A=u),this.Bd[t]=i,this.Ud[t]=f,this.Pd[t]=l,C[t]=d,E[t]=A}const T=s.lE[i],O=T.length/4|0;this.RI=new Int32Array(O),this.SI=new Int32Array(O),this.LI=new Int32Array(O),this.xI=new Int32Array(O),this.kI=new Int32Array(O),this.MI=new Int32Array(O),this.CI=-1!==f?new Int32Array(O):null;let R=0;for(let t=0;t{e.d(i,{A:()=>s});class s{static up=0;static NA=1;static wE=2;static yE=3;static mE=4;static pE=5;static fE=6;static uE=7;static dE=8;static AE=9;static gE=10;static IE=11}},3479:(t,i,e)=>{e.d(i,{A:()=>s});class s{_I;AI;yI;pI;wI;color;flat;constructor(t,i,e,s,n,r,h){this._I=t,this.AI=i,this.yI=e,this.pI=s,this.wI=n,this.color=r,this.flat=h}}},6855:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;iI;rI;qA;$A;eg;info;constructor(t,i,e,s,n,r,h,o,a){this.y=t,this.x=i,this.z=e,this.iI=s,this.rI=n,this.qA=r,this.$A=h,this.eg=o,this.info=a}}},7441:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;type;angle;model;eg;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.eg=h,this.info=o}}},7536:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{_E;CE;constructor(t){this.CE=[],this._E=t;for(let i=0;i{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{vE;bE;constructor(){super(),this.vE=this,this.bE=this}TE(){this.bE&&this.vE&&(this.bE.vE=this.vE,this.vE.bE=this.bE,this.vE=null,this.bE=null)}}},3819:(t,i,e)=>{e.d(i,{A:()=>s});class s{static OE=['_','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','0','1','2','3','4','5','6','7','8','9'];static RE=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static Ml=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.OE[Number(s-37n*t)]}return e.slice(12-i).join('')};static SE=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static LE=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static kl=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static Lu=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}},6666:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{xE;cursor=null;constructor(){const t=new s.A;t.next=t,t.EE=t,this.xE=t}Km(t){t.EE&&t.yw(),t.EE=this.xE.EE,t.next=this.xE,t.EE&&(t.EE.next=t),t.next.EE=t}kE(t){t.EE&&t.yw(),t.EE=this.xE,t.next=this.xE.next,t.EE.next=t,t.next&&(t.next.EE=t)}jg(){const t=this.xE.next;return t===this.xE?null:(t?.yw(),t)}head(){const t=this.xE.next;return t===this.xE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}ME(){const t=this.xE.EE;return t===this.xE?(this.cursor=null,null):(this.cursor=t?.EE||null,t)}next(){const t=this.cursor;return t===this.xE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}EE(){const t=this.cursor;return t===this.xE?(this.cursor=null,null):(this.cursor=t?.EE||null,t)}clear(){for(;;){const t=this.xE.next;if(t===this.xE)return;t?.yw()}}}},1982:(t,i,e)=>{e.d(i,{A:()=>s});class s{key;next;EE;constructor(){this.key=0n,this.next=this,this.EE=this}yw(){this.EE&&this.next&&(this.EE.next=this.next,this.next.EE=this.EE,this.next=null,this.EE=null)}}},2679:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(2512),n=e(7536);class r{DE;NE;history;available;constructor(t){this.DE=t,this.available=t,this.NE=new n.A(1024),this.history=new s.A}get(t){const i=this.NE.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.yw(),t?.TE()}else this.available--;this.NE.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.yw(),t.TE()):this.available=this.DE}}},2512:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n{head;constructor(){this.head=new s.A}push(t){t.bE&&t.TE(),t.bE=this.head.bE,t.vE=this.head,t.bE&&(t.bE.vE=t),t.vE.bE=t}pop(){const t=this.head.vE;return t===this.head?null:(t?.TE(),t)}}},8534:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(3867);class r{static Do=[];static yu=t=>{const i=new s.A(t.read('base_head.dat')),e=new s.A(t.read('base_type.dat')),h=new s.A(t.read('base_label.dat')),o=i.mu;i.Af+=2;for(let t=0;t{e.d(i,{A:()=>r});var s=e(8534),n=e(1069);class r{static Do=[];static yu=t=>{const i=new n.A(t.read('frame_head.dat')),e=new n.A(t.read('frame_tran1.dat')),h=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),a=i.mu;i.Af+=2;const l=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){l[m]=i,c[m]=0,f[m]=0,u[m]=0,m++;break}l[m]=t;let e=0;3===d.types[l[m]]&&(e=128),c[m]=1&i?h.BE:e,f[m]=2&i?h.BE:e,u[m]=4&i?h.BE:e,y=t,m++}}n.length=m,n.PE=new Int32Array(m),n.x=new Int32Array(m),n.y=new Int32Array(m),n.z=new Int32Array(m);for(let t=0;t{e.d(i,{Nc:()=>s,na:()=>n,UE:()=>o,GE:()=>h,WE:()=>r});const s=document.getElementById('canvas'),n=s.getContext('2d',{willReadFrequently:!0}),r=document.createElement('canvas'),h=document.createElement('img'),o=r.getContext('2d',{willReadFrequently:!0})},9298:(t,i,e)=>{e.d(i,{A:()=>s});class s{static RED=16711680;static GREEN=65280;static BLUE=255;static qa=16776960;static YE=65535;static yp=16711935;static La=16777215;static Za=0;static HE=16748608;static VE=8388608;static KE=128;static XE=16756736;static jE=16740352;static zE=16723968;static ZE=12648192;static qE=8453888;static JE=4259584;static $E=9179409;static QE=6116423;static fa=2301979;static ua=5063219;static wa=7759444;static ma=3353893;static tv=8388736;static iv=13350793;static ev=Int32Array.of(s.qa,s.RED,s.GREEN,s.YE,s.yp,s.La);static oC=6798;static aC=107;static lC=10283;static cC=16;static fC=4797;static uC=7744;static dC=5799;static wC=4634;static yC=33697;static mC=22433;static pC=2983;static AC=54193;static gC=8741;static IC=12;static _C=64030;static CC=43162;static EC=7735;static vC=8404;static bC=1701;static TC=38430;static OC=24094;static RC=10153;static SC=56621;static LC=4783;static xC=1341;static kC=16578;static MC=35003;static DC=25239;static V_=9104;static K_=10275;static X_=7595;static j_=3610;static z_=7975;static Z_=8526;static q_=918;static J_=38802;static Q_=24466;static tC=10145;static iC=58654;static eC=5027;static sC=1457;static nC=16565;static rC=34991;static hC=25486;static NC=4626;static FC=11146;static BC=6439;static PC=12;static UC=4758;static GC=10270;static zC=4574;static WC=4550;static YC=4537;static HC=5681;static VC=5673;static KC=5790;static XC=6806;static jC=8076}},8950:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n extends s.A{static gw=new Int32Array;static Iw=0;static _w=0;static top=0;static bottom=0;static left=0;static right=0;static uI=0;static sv=0;static nv=0;static bind=(t,i,e)=>{this.gw=t,this.Iw=i,this._w=e,this.Ta(0,0,i,e)};static rv=()=>{this.left=0,this.top=0,this.right=this.Iw,this.bottom=this._w,this.uI=this.right-1,this.sv=this.right/2|0};static Ta=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.Iw&&(e=this.Iw),s>this._w&&(s=this._w),this.top=i,this.bottom=s,this.left=t,this.right=e,this.uI=this.right-1,this.sv=this.right/2|0,this.nv=this.bottom/2|0};static clear=()=>{const t=this.Iw*this._w;for(let i=0;i{this.ya(t,i,n,e),this.ya(t,i+s-1,n,e),this.da(t,i,n,s),this.da(t+e-1,i,n,s)};static ya=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.Iw;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.Iw;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(l-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.Iw-e;let h=t+i*this.Iw;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.gw[h++]=n;h+=r}};static ov(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,a=(n>>8&255)*r,l=(255&n)*r,c=this.Iw-e;let f=t+i*this.Iw;for(let t=0;t>16&255)*h>>8<<16)+(a+(this.gw[f]>>8&255)*h>>8<<8)+(l+(255&this.gw[f])*h>>8);this.gw[f++]=t}f+=c}}static av(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,a=(255&s)*n;let l=i-e;l<0&&(l=0);let c=i+e;c>=this._w&&(c=this._w-1);for(let s=l;s<=c;s++){const n=s-i,l=0|Math.sqrt(e*e-n*n);let c=t-l;c<0&&(c=0);let f=t+l;f>=this.Iw&&(f=this.Iw-1);let u=c+s*this.Iw;for(let t=c;t<=f;t++){const t=(h+(this.gw[u]>>16&255)*r>>8<<16)+(o+(this.gw[u]>>8&255)*r>>8<<8)+(a+(255&this.gw[u])*r>>8);this.gw[u++]=t}}}static lv=(t,i,e)=>{t=this.right||i=this.bottom||(this.gw[t+i*this.Iw]=e)}}},4583:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1673),r=e(3867);class h extends s.A{static et=!1;static cv=new Int32Array(512);static fv=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static uv=new r.fe(50,null);static dv=0;static Aw=new Int32Array;static yl=0;static ml=0;static Cw=!0;static fI=!1;static alpha=0;static wv=null;static yv=new r.fe(50,null);static mv=0;static Dp=0;static pv=new Int32Array(50);static Av=new r.fe(50,null);static gv=!1;static Iv=new r.fe(50,!1);static _v=new Int32Array(50);static{for(let t=1;t<512;t++)this.cv[t]=32768/t|0;for(let t=1;t<2048;t++)this.fv[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static So=()=>{this.cv=null,this.cv=null,this.sin=null,this.cos=null,this.Aw=null,this.uv=null,this.Iv=null,this._v=null,this.wv=null,this.yv=null,this.pv=null,this.palette=null,this.Av=null,console.log('Draw3D unloaded!')};static Fc=()=>{this.Aw=new Int32Array(s.A._w);for(let t=0;t{this.Aw=new Int32Array(i);for(let e=0;e{this.wv=null,this.yv.fill(null)};static vv=t=>{this.dv=0;for(let i=0;i<50;i++)try{this.uv[i]=n.A.xu(t,i.toString()),this.et&&128===this.uv[i]?.Xa?this.uv[i]?.bv():this.uv[i]?.kw(),this.dv++}catch(t){}};static wp=t=>{if(0!==this._v[t])return this._v[t];const i=this.Av[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.Tv(h,1.4),0===h&&(h=1),this._v[t]=h,h};static Ov=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,a=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let l=s-.3333333333333333;l<0&&l++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,a=6*l<1?i+6*(t-i)*l:2*l<1?t:3*l<2?i+(t-i)*(.6666666666666666-l)*6:i}const l=((256*h|0)<<16)+((256*o|0)<<8)+(256*a|0);this.palette[e++]=this.Tv(l,i)}}for(let t=0;t<50;t++){const e=this.uv[t];if(!e)continue;const s=e.palette;this.Av[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static Sv=t=>{this.wv||(this.mv=t,this.et?this.wv=new r.Xr(t,16384):this.wv=new r.Xr(t,65536),this.yv.fill(null))};static mI=(t,i,e,n,r,o,a,l,c)=>{let f=0,u=0;r!==n&&(f=(i-t<<16)/(r-n)|0,u=(l-a<<15)/(r-n)|0);let d=0,w=0;o!==r&&(d=(e-i<<16)/(o-r)|0,w=(c-l<<15)/(o-r)|0);let y=0,m=0;if(o!==n&&(y=(t-e<<16)/(n-o)|0,m=(a-c<<15)/(n-o)|0),n<=r&&n<=o){if(ns.A.bottom&&(r=s.A.bottom),o>s.A.bottom&&(o=s.A.bottom),rd)for(o-=r,r-=n,n=h.Aw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Lv(e>>16,i>>16,c>>7,l>>7,s.A.gw,n,0),e+=y,i+=d,c+=m,l+=w,n+=s.A.Iw}this.Lv(e>>16,t>>16,c>>7,a>>7,s.A.gw,n,0),e+=y,t+=f,c+=m,a+=u,n+=s.A.Iw}else for(o-=r,r-=n,n=h.Aw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Lv(i>>16,e>>16,l>>7,c>>7,s.A.gw,n,0),e+=y,i+=d,c+=m,l+=w,n+=s.A.Iw}this.Lv(t>>16,e>>16,a>>7,c>>7,s.A.gw,n,0),e+=y,t+=f,c+=m,a+=u,n+=s.A.Iw}else if(i=t<<=16,l=a<<=15,n<0&&(i-=y*n,t-=f*n,l-=m*n,a-=u*n,n=0),e<<=16,c<<=15,o<0&&(e-=d*o,c-=w*o,o=0),n!==o&&yf)for(r-=o,o-=n,n=h.Aw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Lv(e>>16,t>>16,c>>7,a>>7,s.A.gw,n,0),e+=d,t+=f,c+=w,a+=u,n+=s.A.Iw}this.Lv(i>>16,t>>16,l>>7,a>>7,s.A.gw,n,0),i+=y,t+=f,l+=m,a+=u,n+=s.A.Iw}else for(r-=o,o-=n,n=h.Aw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Lv(t>>16,e>>16,a>>7,c>>7,s.A.gw,n,0),e+=d,t+=f,c+=w,a+=u,n+=s.A.Iw}this.Lv(t>>16,i>>16,a>>7,l>>7,s.A.gw,n,0),i+=y,t+=f,l+=m,a+=u,n+=s.A.Iw}}else if(r<=o){if(rs.A.bottom&&(o=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),oy)for(n-=o,o-=r,r=h.Aw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Lv(t>>16,e>>16,a>>7,c>>7,s.A.gw,r,0),t+=f,e+=y,a+=u,c+=m,r+=s.A.Iw}this.Lv(t>>16,i>>16,a>>7,l>>7,s.A.gw,r,0),t+=f,i+=d,a+=u,l+=w,r+=s.A.Iw}else for(n-=o,o-=r,r=h.Aw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Lv(e>>16,t>>16,c>>7,a>>7,s.A.gw,r,0),t+=f,e+=y,a+=u,c+=m,r+=s.A.Iw}this.Lv(i>>16,t>>16,l>>7,a>>7,s.A.gw,r,0),t+=f,i+=d,a+=u,l+=w,r+=s.A.Iw}else if(e=i<<=16,c=l<<=15,r<0&&(e-=f*r,i-=d*r,c-=u*r,l-=w*r,r=0),t<<=16,a<<=15,n<0&&(t-=y*n,a-=m*n,n=0),o-=n,n-=r,r=h.Aw[r],f>16,i>>16,a>>7,l>>7,s.A.gw,r,0),t+=y,i+=d,a+=m,l+=w,r+=s.A.Iw}this.Lv(e>>16,i>>16,c>>7,l>>7,s.A.gw,r,0),e+=f,i+=d,c+=u,l+=w,r+=s.A.Iw}else for(;;){if(--n<0)for(;;){if(--o<0)return;this.Lv(i>>16,t>>16,l>>7,a>>7,s.A.gw,r,0),t+=y,i+=d,a+=m,l+=w,r+=s.A.Iw}this.Lv(i>>16,e>>16,l>>7,c>>7,s.A.gw,r,0),e+=f,i+=d,c+=u,l+=w,r+=s.A.Iw}}else if(os.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,l>>7,a>>7,s.A.gw,o,0),i+=d,t+=f,l+=w,a+=u,o+=s.A.Iw}this.Lv(i>>16,e>>16,l>>7,c>>7,s.A.gw,o,0),i+=d,e+=y,l+=w,c+=m,o+=s.A.Iw}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Lv(t>>16,i>>16,a>>7,l>>7,s.A.gw,o,0),i+=d,t+=f,l+=w,a+=u,o+=s.A.Iw}this.Lv(e>>16,i>>16,c>>7,l>>7,s.A.gw,o,0),i+=d,e+=y,l+=w,c+=m,o+=s.A.Iw}else if(t=e<<=16,a=c<<=15,o<0&&(t-=d*o,e-=y*o,a-=w*o,c-=m*o,o=0),i<<=16,l<<=15,r<0&&(i-=f*r,l-=u*r,r=0),n-=r,r-=o,o=h.Aw[o],d>16,e>>16,l>>7,c>>7,s.A.gw,o,0),i+=f,e+=y,l+=u,c+=m,o+=s.A.Iw}this.Lv(t>>16,e>>16,a>>7,c>>7,s.A.gw,o,0),t+=d,e+=y,a+=w,c+=m,o+=s.A.Iw}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Lv(e>>16,i>>16,c>>7,l>>7,s.A.gw,o,0),i+=f,e+=y,l+=u,c+=m,o+=s.A.Iw}this.Lv(e>>16,t>>16,c>>7,a>>7,s.A.gw,o,0),t+=d,e+=y,a+=w,c+=m,o+=s.A.Iw}};static Lv=(t,i,e,n,r,o,a)=>{let l;if(h.Cw){let c;if(h.fI){if(c=i-t>3?(n-e)/(i-t)|0:0,i>s.A.uI&&(i=s.A.uI),t<0&&(e-=t*c,t=0),t>=i)return;o+=t,a=i-t>>2,c<<=2}else{if(!(t>2)>0?(n-e)*h.cv[a]>>15:0}if(0===h.alpha)for(;;){if(--a<0){if((a=i-t&3)>0){l=h.palette[e>>8];do{r[o++]=l,a--}while(a>0);return}break}l=h.palette[e>>8],e+=c,r[o++]=l,r[o++]=l,r[o++]=l,r[o++]=l}else{const s=h.alpha,n=256-h.alpha;for(;;){if(--a<0){if((a=i-t&3)>0){l=h.palette[e>>8],l=((16711935&l)*n>>8&16711935)+((65280&l)*n>>8&65280);do{r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),a--}while(a>0)}break}l=h.palette[e>>8],e+=c,l=((16711935&l)*n>>8&16711935)+((65280&l)*n>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280)}}}else if(ts.A.uI&&(i=s.A.uI),t<0&&(e-=t*c,t=0),t>=i))return;if(o+=t,a=i-t,0===h.alpha)do{r[o++]=h.palette[e>>8],e+=c,a--}while(a>0);else{const t=h.alpha,i=256-h.alpha;do{l=h.palette[e>>8],e+=c,l=((16711935&l)*i>>8&16711935)+((65280&l)*i>>8&65280),r[o++]=l+((16711935&r[o])*t>>8&16711935)+((65280&r[o])*t>>8&65280),a--}while(a>0)}}};static xv=(t,i,e,n,r,h,o)=>{let a=0;r!==n&&(a=(i-t<<16)/(r-n)|0);let l=0;h!==r&&(l=(e-i<<16)/(h-r)|0);let c=0;if(h!==n&&(c=(t-e<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),rl)for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.kv(e>>16,i>>16,s.A.gw,n,o),e+=c,i+=l,n+=s.A.Iw}this.kv(e>>16,t>>16,s.A.gw,n,o),e+=c,t+=a,n+=s.A.Iw}else for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.kv(i>>16,e>>16,s.A.gw,n,o),e+=c,i+=l,n+=s.A.Iw}this.kv(t>>16,e>>16,s.A.gw,n,o),e+=c,t+=a,n+=s.A.Iw}else if(i=t<<=16,n<0&&(i-=c*n,t-=a*n,n=0),e<<=16,h<0&&(e-=l*h,h=0),n!==h&&ca)for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.kv(e>>16,t>>16,s.A.gw,n,o),e+=l,t+=a,n+=s.A.Iw}this.kv(i>>16,t>>16,s.A.gw,n,o),i+=c,t+=a,n+=s.A.Iw}else for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.kv(t>>16,e>>16,s.A.gw,n,o),e+=l,t+=a,n+=s.A.Iw}this.kv(t>>16,i>>16,s.A.gw,n,o),i+=c,t+=a,n+=s.A.Iw}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hc)for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.kv(t>>16,e>>16,s.A.gw,r,o),t+=a,e+=c,r+=s.A.Iw}this.kv(t>>16,i>>16,s.A.gw,r,o),t+=a,i+=l,r+=s.A.Iw}else for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.kv(e>>16,t>>16,s.A.gw,r,o),t+=a,e+=c,r+=s.A.Iw}this.kv(i>>16,t>>16,s.A.gw,r,o),t+=a,i+=l,r+=s.A.Iw}else if(e=i<<=16,r<0&&(e-=a*r,i-=l*r,r=0),t<<=16,n<0&&(t-=c*n,n=0),a>16,i>>16,s.A.gw,r,o),t+=c,i+=l,r+=s.A.Iw}this.kv(e>>16,i>>16,s.A.gw,r,o),e+=a,i+=l,r+=s.A.Iw}else for(h-=n,n-=r,r=this.Aw[r];;){if(--n<0)for(;;){if(--h<0)return;this.kv(i>>16,t>>16,s.A.gw,r,o),t+=c,i+=l,r+=s.A.Iw}this.kv(i>>16,e>>16,s.A.gw,r,o),e+=a,i+=l,r+=s.A.Iw}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.gw,h,o),i+=l,t+=a,h+=s.A.Iw}this.kv(i>>16,e>>16,s.A.gw,h,o),i+=l,e+=c,h+=s.A.Iw}else for(r-=n,n-=h,h=this.Aw[h];;){if(--n<0)for(;;){if(--r<0)return;this.kv(t>>16,i>>16,s.A.gw,h,o),i+=l,t+=a,h+=s.A.Iw}this.kv(e>>16,i>>16,s.A.gw,h,o),i+=l,e+=c,h+=s.A.Iw}else if(t=e<<=16,h<0&&(t-=l*h,e-=c*h,h=0),i<<=16,r<0&&(i-=a*r,r=0),l>16,e>>16,s.A.gw,h,o),i+=a,e+=c,h+=s.A.Iw}this.kv(t>>16,e>>16,s.A.gw,h,o),t+=l,e+=c,h+=s.A.Iw}else for(n-=r,r-=h,h=this.Aw[h];;){if(--r<0)for(;;){if(--n<0)return;this.kv(e>>16,i>>16,s.A.gw,h,o),i+=a,e+=c,h+=s.A.Iw}this.kv(e>>16,t>>16,s.A.gw,h,o),t+=l,e+=c,h+=s.A.Iw}};static II=(t,i,e,n,r,h,o,a,l,c,f,u,d,w,y,m,p,A,g)=>{const I=this.Mv(g);this.gv=!this.Iv[g];const _=c-d,C=f-y,E=u-p,v=w-c,b=m-f,T=A-u;let O=v*f-b*c<<14;const R=b*u-T*f<<8,S=T*c-v*u<<5;let L=_*f-C*c<<14;const x=C*u-E*f<<8,k=E*c-_*u<<5;let M=C*v-_*b<<14;const D=E*b-C*T<<8,N=_*T-E*v<<5;let F=0,B=0;r!==n&&(F=(i-t<<16)/(r-n)|0,B=(a-o<<16)/(r-n)|0);let P=0,U=0;h!==r&&(P=(e-i<<16)/(h-r)|0,U=(l-a<<16)/(h-r)|0);let G=0,W=0;if(h!==n&&(G=(t-e<<16)/(n-h)|0,W=(o-l<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),rP)for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Dv(e>>16,i>>16,s.A.gw,n,I,0,0,O,L,M,R,x,D,l>>8,a>>8),e+=G,i+=P,l+=W,a+=U,n+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(e>>16,t>>16,s.A.gw,n,I,0,0,O,L,M,R,x,D,l>>8,o>>8),e+=G,t+=F,l+=W,o+=B,n+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Dv(i>>16,e>>16,s.A.gw,n,I,0,0,O,L,M,R,x,D,a>>8,l>>8),e+=G,i+=P,l+=W,a+=U,n+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(t>>16,e>>16,s.A.gw,n,I,0,0,O,L,M,R,x,D,o>>8,l>>8),e+=G,t+=F,l+=W,o+=B,n+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}else{i=t<<=16,a=o<<=16,n<0&&(i-=G*n,t-=F*n,a-=W*n,o-=B*n,n=0),e<<=16,l<<=16,h<0&&(e-=P*h,l-=U*h,h=0);const c=n-this.ml;if(O+=S*c,L+=k*c,M+=N*c,O|=0,L|=0,M|=0,(n===h||G>=F)&&(n!==h||P<=F))for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Dv(t>>16,e>>16,s.A.gw,n,I,0,0,O,L,M,R,x,D,o>>8,l>>8),e+=P,t+=F,l+=U,o+=B,n+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(t>>16,i>>16,s.A.gw,n,I,0,0,O,L,M,R,x,D,o>>8,a>>8),i+=G,t+=F,a+=W,o+=B,n+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Dv(e>>16,t>>16,s.A.gw,n,I,0,0,O,L,M,R,x,D,l>>8,o>>8),e+=P,t+=F,l+=U,o+=B,n+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(i>>16,t>>16,s.A.gw,n,I,0,0,O,L,M,R,x,D,a>>8,o>>8),i+=G,t+=F,a+=W,o+=B,n+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hG)for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Dv(t>>16,e>>16,s.A.gw,r,I,0,0,O,L,M,R,x,D,o>>8,l>>8),t+=F,e+=G,o+=B,l+=W,r+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(t>>16,i>>16,s.A.gw,r,I,0,0,O,L,M,R,x,D,o>>8,a>>8),t+=F,i+=P,o+=B,a+=U,r+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Dv(e>>16,t>>16,s.A.gw,r,I,0,0,O,L,M,R,x,D,l>>8,o>>8),t+=F,e+=G,o+=B,l+=W,r+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(i>>16,t>>16,s.A.gw,r,I,0,0,O,L,M,R,x,D,a>>8,o>>8),t+=F,i+=P,o+=B,a+=U,r+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}else{e=i<<=16,l=a<<=16,r<0&&(e-=F*r,i-=P*r,l-=B*r,a-=U*r,r=0),t<<=16,o<<=16,n<0&&(t-=G*n,o-=W*n,n=0);const c=r-this.ml;if(O+=S*c,L+=k*c,M+=N*c,O|=0,L|=0,M|=0,h-=n,n-=r,r=this.Aw[r],F>16,i>>16,s.A.gw,r,I,0,0,O,L,M,R,x,D,o>>8,a>>8),t+=G,i+=P,o+=W,a+=U,r+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(e>>16,i>>16,s.A.gw,r,I,0,0,O,L,M,R,x,D,l>>8,a>>8),e+=F,i+=P,l+=B,a+=U,r+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(;;){if(--n<0)for(;;){if(--h<0)return;this.Dv(i>>16,t>>16,s.A.gw,r,I,0,0,O,L,M,R,x,D,a>>8,o>>8),t+=G,i+=P,o+=W,a+=U,r+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(i>>16,e>>16,s.A.gw,r,I,0,0,O,L,M,R,x,D,a>>8,l>>8),e+=F,i+=P,l+=B,a+=U,r+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.gw,h,I,0,0,O,L,M,R,x,D,a>>8,o>>8),i+=P,t+=F,a+=U,o+=B,h+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(i>>16,e>>16,s.A.gw,h,I,0,0,O,L,M,R,x,D,a>>8,l>>8),i+=P,e+=G,a+=U,l+=W,h+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Dv(t>>16,i>>16,s.A.gw,h,I,0,0,O,L,M,R,x,D,o>>8,a>>8),i+=P,t+=F,a+=U,o+=B,h+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(e>>16,i>>16,s.A.gw,h,I,0,0,O,L,M,R,x,D,l>>8,a>>8),i+=P,e+=G,a+=U,l+=W,h+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}else{t=e<<=16,o=l<<=16,h<0&&(t-=P*h,e-=G*h,o-=U*h,l-=W*h,h=0),i<<=16,a<<=16,r<0&&(i-=F*r,a-=B*r,r=0);const c=h-this.ml;if(O+=S*c,L+=k*c,M+=N*c,O|=0,L|=0,M|=0,n-=r,r-=h,h=this.Aw[h],P>16,e>>16,s.A.gw,h,I,0,0,O,L,M,R,x,D,a>>8,l>>8),i+=F,e+=G,a+=B,l+=W,h+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(t>>16,e>>16,s.A.gw,h,I,0,0,O,L,M,R,x,D,o>>8,l>>8),t+=P,e+=G,o+=U,l+=W,h+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Dv(e>>16,i>>16,s.A.gw,h,I,0,0,O,L,M,R,x,D,l>>8,a>>8),i+=F,e+=G,a+=B,l+=W,h+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(e>>16,t>>16,s.A.gw,h,I,0,0,O,L,M,R,x,D,l>>8,o>>8),t+=P,e+=G,o+=U,l+=W,h+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}};static Dv=(t,i,e,n,r,h,o,a,l,c,f,u,d,w,y)=>{if(t>=i)return;let m,p,A,g,I,_,C,E,v;if(this.fI){if(m=(y-w)/(i-t)|0,i>s.A.uI&&(i=s.A.uI),t<0&&(w-=t*m,t=0),t>=i)return;p=i-t>>3,m<<=12}else i-t>7?(p=i-t>>3,m=(y-w)*this.cv[p]>>6):(p=0,m=0);if(w<<=9,n+=t,this.et&&r)if(A=0,g=0,_=t-this.yl,a+=(f>>3)*_,l+=(u>>3)*_,c+=(d>>3)*_,a|=0,l|=0,I=(c|=0)>>12,0!==I&&(o=l/I|0,(h=a/I|0)<0?h=0:h>4032&&(h=4032)),a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>12,0!==I&&(A=a/I|0,g=l/I|0,A<7?A=7:A>4032&&(A=4032)),C=A-h>>3,E=g-o>>3,h+=w>>3&786432,v=w>>23,this.gv){for(;p-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h=A,o=g,a+=f,l+=u,I=(c+=d)>>12,0!==I&&(A=a/I|0,g=l/I|0,A<7?A=7:A>4032&&(A=4032)),C=A-h>>3,E=g-o>>3,h+=(w+=m)>>3&786432,v=w>>23;for(p=i-t&7;p-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E}else{for(;p-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n+=1,h=A,o=g,a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>12,0!==I&&(A=a/I|0,g=l/I|0,A<7?A=7:A>4032&&(A=4032)),C=A-h>>3,E=g-o>>3,h+=(w+=m)>>3&786432,v=w>>23}for(p=i-t&7;p-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}else if(A=0,g=0,_=t-this.yl,a+=(f>>3)*_,l+=(u>>3)*_,c+=(d>>3)*_,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(o=l/I|0,(h=a/I|0)<0?h=0:h>16256&&(h=16256)),a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(A=a/I|0,g=l/I|0,A<7?A=7:A>16256&&(A=16256)),C=A-h>>3,E=g-o>>3,h+=6291456&w,v=w>>23,this.gv&&r){for(;p-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h=A,o=g,a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(A=a/I|0,g=l/I|0,A<7?A=7:A>16256&&(A=16256)),C=A-h>>3,E=g-o>>3,h+=6291456&(w+=m),v=w>>23;for(p=i-t&7;p-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E}else{for(;p-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,h=A,o=g,a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(A=a/I|0,g=l/I|0,A<7?A=7:A>16256&&(A=16256)),C=A-h>>3,E=g-o>>3,h+=6291456&(w+=m),v=w>>23}for(p=i-t&7;p-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}};static kv=(t,i,e,n,r)=>{if(this.fI&&(i>s.A.uI&&(i=s.A.uI),t<0&&(t=0)),t>=i)return;n+=t;let h=i-t>>2;if(0===this.alpha)for(;;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;e[n++]=r}e[n++]=r,e[n++]=r,e[n++]=r,e[n++]=r}const o=this.alpha,a=256-this.alpha;for(r=((16711935&r)*a>>8&16711935)+((65280&r)*a>>8&65280);;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}};static Rv=t=>{this.yv[t]&&this.wv&&(this.wv[this.mv++]=this.yv[t],this.yv[t]=null)};static Mv=t=>{if(this.pv[t]=this.Dp++,this.yv[t])return this.yv[t];let i;if(this.mv>0&&this.wv)i=this.wv[--this.mv],this.wv[this.mv]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.gw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.gw[t]];this.Iv[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.Iv[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}},880:(t,i,e)=>{e.d(i,{r:()=>n});var s=e(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(s.GE.src),s.GE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>s.GE.onload=()=>t())),s.UE.clearRect(0,0,s.WE.width,s.WE.height);const i=s.GE.naturalWidth,e=s.GE.naturalHeight;return s.WE.width=i,s.WE.height=e,s.UE.drawImage(s.GE,0,0),s.UE.getImageData(0,0,i,e)}},8665:(t,i,e)=>{e.d(i,{A:()=>f});var s=e(1069),n=e(8950),r=e(4583),h=e(6730),o=e(4474),a=e(3867);class l{Fd=0;Tg=0;Nv=0;Fv=-1;Bv=-1;Pv=-1;Uv=-1;Gv=-1;Wv=-1;Yv=-1;Hv=-1;Vv=-1;Kv=0;Xv=-1;jv=-1;zv=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static Zv=null;static qv=null;static Jv=null;static $v=null;static Qv=null;static tb=null;static ib=null;static eb=null;static sb=null;static nb=null;static rb=null;static hb=null;static axis=null;static ob=new a.fe(4096,!1);static ab=new a.fe(4096,!1);static lb=new Int32Array(4096);static cb=new Int32Array(4096);static fb=new Int32Array(4096);static ub=new Int32Array(4096);static wb=new Int32Array(4096);static yb=new Int32Array(4096);static mb=new Int32Array(1500);static pb=new a.Xr(1500,512);static Ab=new Int32Array(12);static gb=new a.Xr(12,2e3);static Ib=new Int32Array(2e3);static _b=new Int32Array(2e3);static Cb=new Int32Array(12);static Eb=new Int32Array(10);static vb=new Int32Array(10);static bb=new Int32Array(10);static Ir=0;static Tb=0;static _r=0;static Ob=!1;static Ha=0;static Va=0;static Rb=0;static Sb=new Int32Array(1e3);static Lb=!1;static yu(t){try{f.head=new s.A(t.read('ob_head.dat')),f.Zv=new s.A(t.read('ob_face1.dat')),f.qv=new s.A(t.read('ob_face2.dat')),f.Jv=new s.A(t.read('ob_face3.dat')),f.$v=new s.A(t.read('ob_face4.dat')),f.Qv=new s.A(t.read('ob_face5.dat')),f.tb=new s.A(t.read('ob_point1.dat')),f.ib=new s.A(t.read('ob_point2.dat')),f.eb=new s.A(t.read('ob_point3.dat')),f.sb=new s.A(t.read('ob_point4.dat')),f.nb=new s.A(t.read('ob_point5.dat')),f.rb=new s.A(t.read('ob_vertex1.dat')),f.hb=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.Af=0,f.tb.Af=0,f.ib.Af=0,f.eb.Af=0,f.sb.Af=0,f.rb.Af=0,f.hb.Af=0;const i=f.head.mu;f.metadata=new a.fe(i+100,null);let e=0,n=0,r=0,h=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Nd=(t,i,e)=>{const s=t.Fd,n=t.Tg,r=t.Nv;let h,o,l,u,d;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.Fd,r=t.Tg,h=t.Nv;let o,a,l,c,u;if(s)o=t.Bd,a=t.Ud,l=t.Pd;else{o=new Int32Array(n),a=new Int32Array(n),l=new Int32Array(n);for(let i=0;i{const e=t.Fd,s=t.Tg,n=t.Nv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,a=0,l=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,a=0,l=-1;for(let c=0;c{let o=-1;const a=t.Bd[i],l=t.Ud[i],c=t.Pd[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.Zv&&f.qv&&f.Jv&&f.$v&&f.Qv&&f.tb&&f.ib&&f.eb&&f.sb&&f.nb&&f.rb&&f.hb&&f.axis))throw new Error('cant loading model!!!!!');const e=i.Fd,s=i.Tg,n=i.Nv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),a=new Int32Array(s),l=new Int32Array(s),c=new Int32Array(s),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;i.Gv>=0&&(y=new Int32Array(e));let m=null;i.Vv>=0&&(m=new Int32Array(s));let p=null,A=0;i.Kv>=0?p=new Int32Array(s):A=-i.Kv-1;let g=null;i.Xv>=0&&(g=new Int32Array(s));let I=null;i.jv>=0&&(I=new Int32Array(s));const _=new Int32Array(s);f.tb.Af=i.Fv,f.ib.Af=i.Bv,f.eb.Af=i.Pv,f.sb.Af=i.Uv,f.nb.Af=i.Gv;let C,E,v,b=0,T=0,O=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const e=f.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const n=e.Fd,r=e.Tg,h=e.Nv,o=new Int32Array(n),a=new Int32Array(n),l=new Int32Array(n),c=new Int32Array(r),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(h),y=new Int32Array(h),m=new Int32Array(h);let p=null;e.Gv>=0&&(p=new Int32Array(n));let A=null;e.Vv>=0&&(A=new Int32Array(r));let g=null,I=0;e.Kv>=0?g=new Int32Array(r):I=-e.Kv-1;let _=null;e.Xv>=0&&(_=new Int32Array(r));let C=null;e.jv>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(e.data);v.Af=e.Fv;const b=new s.A(e.data);b.Af=e.Bv;const T=new s.A(e.data);T.Af=e.Pv;const O=new s.A(e.data);O.Af=e.Uv;const R=new s.A(e.data);R.Af=e.Gv;let S,L,x,k=0,M=0,D=0;for(let t=0;tthis.jd&&(this.jd=-e),e>this.Ig&&(this.Ig=e);const n=i*i+s*s;n>this.vp&&(this.vp=n)}this.vp=Math.sqrt(this.vp)+.99|0,this.Yb=Math.sqrt(this.vp*this.vp+this.jd*this.jd)+.99|0,this.Wb=this.Yb+(Math.sqrt(this.vp*this.vp+this.Ig*this.Ig)+.99|0)}Gd(){this.jd=0,this.Ig=0;for(let t=0;tthis.jd&&(this.jd=-i),i>this.Ig&&(this.Ig=i)}this.Yb=Math.sqrt(this.vp*this.vp+this.jd*this.jd)+.99|0,this.Wb=this.Yb+(Math.sqrt(this.vp*this.vp+this.Ig*this.Ig)+.99|0)}Wl(){if(this.Hb){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Vd=new a.fe(i+1,null);for(let e=0;e<=i;e++)this.Vd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Hd=new a.fe(i+1,null);for(let e=0;e<=i;e++)this.Hd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ea;)a=e[o++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==a||0===r.types[i])&&this.zb(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}f.Ir=0,f.Tb=0,f._r=0,o=0,a=e[o++];for(let t=0;ta;)a=e[o++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===a||0===r.types[i])&&this.zb(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.Yl(t)}Yl(t){if(!this.Vd||-1===t||!h.A.Do[t])return;const i=h.A.Do[t],e=i.FE;f.Ir=0,f.Tb=0,f._r=0;for(let t=0;t>16;this.Pd[t]=this.Ud[t]*i+this.Pd[t]*e>>16,this.Ud[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.Mb&&this.Db&&this.Nb||(this.Mb=new Int32Array(this.Tg),this.Db=new Int32Array(this.Tg),this.Nb=new Int32Array(this.Tg)),!this.ug){this.ug=new a.fe(this.Fd,null);for(let t=0;t8192||p>8192||A>8192||m<-8192||p<-8192||A<-8192;)m>>=1,p>>=1,A>>=1;let g=0|Math.sqrt(m*m+p*p+A*A);if(g<=0&&(g=1),m=256*m/g|0,p=256*p/g|0,A=256*A/g|0,this.bg&&1&this.bg[i]){const r=t+((e*m+s*p+n*A)/(h+(h/2|0))|0);this.ku&&(this.Mb[i]=f.kb(this.ku[i],r,this.bg[i]))}else{let t=this.ug[r];t&&(t.x+=m,t.y+=p,t.z+=A,t.w++),t=this.ug[o],t&&(t.x+=m,t.y+=p,t.z+=A,t.w++),t=this.ug[a],t&&(t.x+=m,t.y+=p,t.z+=A,t.w++)}}if(r)this.yg(t,h,e,s,n);else{this.gg=new a.fe(this.Fd,null);for(let t=0;t>16;for(let s=0;s>16,I=I*w-g*d>>16,g=A),0!==t&&(A=I*l-_*a>>16,_=I*a+_*l>>16,I=A),0!==i&&(A=_*c+g*u>>16,_=_*u-g*c>>16,g=A),g+=n,I+=h,_+=o,A=I*m-_*y>>16,_=I*y+_*m>>16,I=A,f.lb&&f.cb&&f.fb&&(f.fb[s]=_-p,f.lb[s]=r.A.yl+((g<<9)/_|0),f.cb[s]=r.A.ml+((I<<9)/_|0)),this.Nv>0&&f.ub&&f.wb&&f.yb&&(f.ub[s]=g,f.wb[s]=I,f.yb[s]=_)}try{this.Jb(!1,!1,0)}catch(t){}}draw(t,i,e,s,h,o,a,l,c){const u=l*h-o*s>>16,d=a*i+u*e>>16,w=this.vp*e>>16,y=d+w;if(y<=50||d>=3500)return;const m=l*s+o*h>>16;let p=m-this.vp<<9;if((p/y|0)>=n.A.sv)return;let A=m+this.vp<<9;if((A/y|0)<=-n.A.sv)return;const g=a*e-u*i>>16,I=this.vp*i>>16;let _=g+I<<9;if((_/y|0)<=-n.A.nv)return;let C=g-(I+(this.jd*e>>16))<<9;if((C/y|0)>=n.A.nv)return;let E=d-(w+(this.jd*i>>16))<=50,v=!1;if(c>0&&f.Ob){let t=d-w;t<=50&&(t=50),m>0?(p=p/y|0,A=A/t|0):(A=A/y|0,p=p/t|0),g>0?(C=C/y|0,_=_/t|0):(_=_/y|0,C=C/t|0);const i=f.Ha-r.A.yl,e=f.Va-r.A.ml;i>p&&iC&&e<_&&(this.aw?f.Sb[f.Rb++]=c:v=!0)}const b=r.A.yl,T=r.A.ml;let O=0,R=0;0!==t&&(O=r.A.sin[t],R=r.A.cos[t]);for(let n=0;n>16,w=w*R-c*O>>16,c=r),c+=o,u+=a,w+=l,r=w*s+c*h>>16,w=w*h-c*s>>16,c=r,r=u*e-w*i>>16,w=u*i+w*e>>16,u=r,f.fb&&(f.fb[n]=w-d),w>=50&&f.lb&&f.cb?(f.lb[n]=b+((c<<9)/w|0),f.cb[n]=T+((u<<9)/w|0)):f.lb&&(f.lb[n]=-5e3,E=!0),(E||this.Nv>0)&&f.ub&&f.wb&&f.yb&&(f.ub[n]=c,f.wb[n]=u,f.yb[n]=w)}try{this.Jb(E,v,c)}catch(t){}}Jb(t,i,e,s=!1){f.Lb&&(this.Xb=-1,this.jb=-1);for(let t=0;tn.A.uI||l>n.A.uI||c>n.A.uI),f.pb&&f.mb){const t=((y+m+p)/3|0)+this.Yb;f.pb[t][f.mb[t]++]=s,f.Lb&&this.$b(f.Ha,f.Va,u,d,w,a,l,c)&&this.jb=0;t--){const i=f.mb[t];if(!(i<=0)&&f.pb){const e=f.pb[t];for(let t=0;t=0;t--){const i=f.mb[t];if(i>0&&f.pb){const e=f.pb[t];for(let s=0;s0||f.Ab[2]>0)&&(r=(f.Cb[1]+f.Cb[2])/(f.Ab[1]+f.Ab[2])|0);let h=0;f.Ab&&f.Cb&&(f.Ab[3]>0||f.Ab[4]>0)&&(h=(f.Cb[3]+f.Cb[4])/(f.Ab[3]+f.Ab[4])|0);let o=0;if(f.Ab&&f.Cb&&(f.Ab[6]>0||f.Ab[8]>0)&&(o=(f.Cb[6]+f.Cb[8])/(f.Ab[6]+f.Ab[8])|0),f.Ab&&f.gb){let t,i=0,e=f.Ab[10],n=f.gb[10],a=f.Ib;i===e&&(i=0,e=f.Ab[11],n=f.gb[11],a=f._b),t=ir;)try{this.Qb(n[i++],s),i===e&&n!==f.gb[11]&&(i=0,e=f.Ab[11],n=f.gb[11],a=f._b),t=ih;)try{this.Qb(n[i++],s),i===e&&n!==f.gb[11]&&(i=0,e=f.Ab[11],n=f.gb[11],a=f._b),t=io;)try{this.Qb(n[i++],s),i===e&&n!==f.gb[11]&&(i=0,e=f.Ab[11],n=f.gb[11],a=f._b),t=i>2,h=this.Pb[i],o=this.Ub[i],a=this.Gb[i];r.A.II(f.lb[e],f.lb[s],f.lb[n],f.cb[e],f.cb[s],f.cb[n],this.Mb[t],this.Db[t],this.Nb[t],f.ub[h],f.wb[h],f.yb[h],f.ub[o],f.ub[a],f.wb[o],f.wb[a],f.yb[o],f.yb[a],this.ku[t])}else if(3===h&&this.bg&&this.ku&&this.Mb&&f.lb&&f.cb&&f.ub&&f.wb&&f.yb){const i=this.bg[t]>>2,h=this.Pb[i],o=this.Ub[i],a=this.Gb[i];r.A.II(f.lb[e],f.lb[s],f.lb[n],f.cb[e],f.cb[s],f.cb[n],this.Mb[t],this.Mb[t],this.Mb[t],f.ub[h],f.wb[h],f.yb[h],f.ub[o],f.ub[a],f.wb[o],f.wb[a],f.yb[o],f.yb[a],this.ku[t])}}tT(t,i=!1){let e=0;if(f.yb){const i=r.A.yl,s=r.A.ml,n=this.Og[t],h=this.Rg[t],o=this.Sg[t],a=f.yb[n],l=f.yb[h],c=f.yb[o];if(a>=50&&f.lb&&f.cb&&this.Mb)f.Eb[e]=f.lb[n],f.vb[e]=f.cb[n],f.bb[e++]=this.Mb[t];else if(f.ub&&f.wb&&this.Mb){const u=f.ub[n],d=f.wb[n],w=this.Mb[t];if(c>=50&&this.Nb){const n=(50-a)*r.A.fv[c-a];f.Eb[e]=i+((u+((f.ub[o]-u)*n>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[o]-d)*n>>16)<<9)/50|0),f.bb[e++]=w+((this.Nb[t]-w)*n>>16)}if(l>=50&&this.Db){const n=(50-a)*r.A.fv[l-a];f.Eb[e]=i+((u+((f.ub[h]-u)*n>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[h]-d)*n>>16)<<9)/50|0),f.bb[e++]=w+((this.Db[t]-w)*n>>16)}}if(l>=50&&f.lb&&f.cb&&this.Db)f.Eb[e]=f.lb[h],f.vb[e]=f.cb[h],f.bb[e++]=this.Db[t];else if(f.ub&&f.wb&&this.Db){const u=f.ub[h],d=f.wb[h],w=this.Db[t];if(a>=50&&this.Mb){const h=(50-l)*r.A.fv[a-l];f.Eb[e]=i+((u+((f.ub[n]-u)*h>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[n]-d)*h>>16)<<9)/50|0),f.bb[e++]=w+((this.Mb[t]-w)*h>>16)}if(c>=50&&this.Nb){const n=(50-l)*r.A.fv[c-l];f.Eb[e]=i+((u+((f.ub[o]-u)*n>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[o]-d)*n>>16)<<9)/50|0),f.bb[e++]=w+((this.Nb[t]-w)*n>>16)}}if(c>=50&&f.lb&&f.cb&&this.Nb)f.Eb[e]=f.lb[o],f.vb[e]=f.cb[o],f.bb[e++]=this.Nb[t];else if(f.ub&&f.wb&&this.Nb){const u=f.ub[o],d=f.wb[o],w=this.Nb[t];if(l>=50&&this.Db){const n=(50-c)*r.A.fv[l-c];f.Eb[e]=i+((u+((f.ub[h]-u)*n>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[h]-d)*n>>16)<<9)/50|0),f.bb[e++]=w+((this.Db[t]-w)*n>>16)}if(a>=50&&this.Mb){const h=(50-c)*r.A.fv[a-c];f.Eb[e]=i+((u+((f.ub[n]-u)*h>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[n]-d)*h>>16)<<9)/50|0),f.bb[e++]=w+((this.Mb[t]-w)*h>>16)}}}const s=f.Eb[0],h=f.Eb[1],o=f.Eb[2],a=f.vb[0],l=f.vb[1],c=f.vb[2];if(!((s-h)*(c-l)-(a-l)*(o-h)<=0))if(r.A.fI=!1,3===e){let e;if((s<0||h<0||o<0||s>n.A.uI||h>n.A.uI||o>n.A.uI)&&(r.A.fI=!0),e=this.bg?3&this.bg[t]:0,i)r.A.hv(s,h,a,l,f.bb[0]),r.A.hv(h,o,l,c,f.bb[1]),r.A.hv(o,s,c,a,f.bb[2]);else if(0===e)r.A.mI(s,h,o,a,l,c,f.bb[0],f.bb[1],f.bb[2]);else if(1===e&&this.Mb)r.A.xv(s,h,o,a,l,c,r.A.palette[this.Mb[t]]);else if(2===e&&this.bg&&this.ku&&f.ub&&f.wb&&f.yb){const i=this.bg[t]>>2,e=this.Pb[i],n=this.Ub[i],u=this.Gb[i];r.A.II(s,h,o,a,l,c,f.bb[0],f.bb[1],f.bb[2],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t])}else if(3===e&&this.bg&&this.ku&&this.Mb&&f.ub&&f.wb&&f.yb){const i=this.bg[t]>>2,e=this.Pb[i],n=this.Ub[i],u=this.Gb[i];r.A.II(s,h,o,a,l,c,this.Mb[t],this.Mb[t],this.Mb[t],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t])}}else if(4===e){let e;if((s<0||h<0||o<0||s>n.A.uI||h>n.A.uI||o>n.A.uI||f.Eb[3]<0||f.Eb[3]>n.A.uI)&&(r.A.fI=!0),e=this.bg?3&this.bg[t]:0,i)r.A.hv(s,h,a,l,f.bb[0]),r.A.hv(h,o,l,c,f.bb[1]),r.A.hv(o,f.Eb[3],c,f.vb[3],f.bb[2]),r.A.hv(f.Eb[3],s,f.vb[3],a,f.bb[3]);else if(0===e)r.A.mI(s,h,o,a,l,c,f.bb[0],f.bb[1],f.bb[2]),r.A.mI(s,o,f.Eb[3],a,c,f.vb[3],f.bb[0],f.bb[2],f.bb[3]);else if(1===e){if(this.Mb){const i=r.A.palette[this.Mb[t]];r.A.xv(s,h,o,a,l,c,i),r.A.xv(s,o,f.Eb[3],a,c,f.vb[3],i)}}else if(2===e&&this.bg&&this.ku&&f.ub&&f.wb&&f.yb){const i=this.bg[t]>>2,e=this.Pb[i],n=this.Ub[i],u=this.Gb[i];r.A.II(s,h,o,a,l,c,f.bb[0],f.bb[1],f.bb[2],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t]),r.A.II(s,o,f.Eb[3],a,c,f.vb[3],f.bb[0],f.bb[2],f.bb[3],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t])}else if(3===e&&this.bg&&this.ku&&this.Mb&&f.ub&&f.wb&&f.yb){const i=this.bg[t]>>2,e=this.Pb[i],n=this.Ub[i],u=this.Gb[i];r.A.II(s,h,o,a,l,c,this.Mb[t],this.Mb[t],this.Mb[t],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t]),r.A.II(s,o,f.Eb[3],a,c,f.vb[3],this.Mb[t],this.Mb[t],this.Mb[t],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t])}}}zb(t,i,e,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f.Ir=0,f.Tb=0,f._r=0;for(let t=0;t0?(f.Ir=(f.Ir/n|0)+t,f.Tb=(f.Tb/n|0)+i,f._r=(f._r/n|0)+e):(f.Ir=t,f.Tb=i,f._r=e)}else if(1===n)for(let n=0;n=this.Vd.length)continue;const h=this.Vd[r];if(h)for(let s=0;s=this.Vd.length)continue;const o=this.Vd[h];if(o)for(let s=0;s>16;this.Ud[n]=this.Ud[n]*u-this.Bd[n]*c>>16,this.Bd[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.Ud[n]*u-this.Pd[n]*c>>16;this.Pd[n]=this.Ud[n]*c+this.Pd[n]*u>>16,this.Ud[n]=t}if(0!==a){c=r.A.sin[a],u=r.A.cos[a];const t=this.Pd[n]*c+this.Bd[n]*u>>16;this.Pd[n]=this.Pd[n]*u-this.Bd[n]*c>>16,this.Bd[n]=t}this.Bd[n]+=f.Ir,this.Ud[n]+=f.Tb,this.Pd[n]+=f._r}}else if(3===n)for(let n=0;n=this.Vd.length)continue;const h=this.Vd[r];if(h)for(let s=0;s=this.Hd.length)continue;const n=this.Hd[e];if(n)for(let i=0;i255&&(this.Bb[e]=255)}}}qb(){this.jd=0,this.vp=0,this.Ig=0,this._g=999999,this.Cg=-999999,this.vg=-99999,this.Eg=99999;for(let t=0;tthis.Cg&&(this.Cg=i),sthis.vg&&(this.vg=s),-e>this.jd&&(this.jd=-e),e>this.Ig&&(this.Ig=e);const n=i*i+s*s;n>this.vp&&(this.vp=n)}this.vp=0|Math.sqrt(this.vp),this.Yb=0|Math.sqrt(this.vp*this.vp+this.jd*this.jd),this.Wb=this.Yb+(0|Math.sqrt(this.vp*this.vp+this.Ig*this.Ig))}$b(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{e.d(i,{A:()=>o});var s=e(8950),n=e(1069),r=e(4474),h=e(880);class o extends r.A{gw;width;height;eT;sT;Xa;ww;constructor(t,i){super(),this.gw=new Int32Array(t*i),this.width=this.Xa=t,this.height=this.ww=i,this.eT=this.sT=0}static nT=async(t,i)=>{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(0,h.r)(e),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),a=n.gw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static xu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.Af=s.mu;const h=r.mu,a=r.mu,l=[],c=r.Au-1;for(let t=0;ts.length||r.Af>r.length)throw new Error;const f=r.Au,u=r.Au,d=r.mu,w=r.mu,y=new o(d,w);y.eT=f,y.sT=u,y.Xa=h,y.ww=a;const m=r.Au;if(0===m){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.rT(h,r,this.gw,n,a,s.A.gw,e,o)}Ka(t,i,e){i|=0,e|=0;let n=(i+=this.eT)+(e+=this.sT)*s.A.Iw,r=0,h=this.height,o=this.width,a=s.A.Iw-o,l=0;if(es.A.bottom&&(h-=e+h-s.A.bottom),is.A.right){const t=i+o-s.A.right;o-=t,l+=t,a+=t}o>0&&h>0&&this.hT(o,h,this.gw,r,l,s.A.gw,n,a,t)}oT(t,i){t|=0,i|=0;let e=(t+=this.eT)+(i+=this.sT)*s.A.Iw,n=0,r=this.height,h=this.width,o=s.A.Iw-h,a=0;if(is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.aT(h,r,this.gw,n,a,s.A.gw,e,o)}lT(){const t=this.gw,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.gw[s]=(r<<16)+(h<<8)+o}}}kw(t,i,e,n){t|=0,i|=0,e|=0,n|=0;try{const r=this.width;let h=0,o=0;const a=this.Xa,l=this.ww,c=(a<<16)/e|0,f=(l<<16)/n|0;t+=(this.eT*e+a-1)/a|0,i+=(this.sT*n+l-1)/l|0,this.eT*e%a!=0&&(h=(a-this.eT*e%a<<16)/e|0),this.sT*n%l!=0&&(o=(l-this.sT*n%l<<16)/n|0),e=e*(this.width-(h>>16))/a|0,n=n*(this.height-(o>>16))/l|0;let u=t+i*s.A.Iw,d=s.A.Iw-e;if(is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right){const i=t+e-s.A.right;e-=i,d+=i}this.scale(e,n,this.gw,h,o,s.A.gw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}fT(t,i,e,n,r,h,o,a,l,c){t|=0,i|=0,e|=0,n|=0;try{const f=-e/2|0,u=-n/2|0,d=65536*Math.sin(l/326.11)|0,w=65536*Math.cos(l/326.11)|0,y=d*c>>8,m=w*c>>8;let p=(o<<16)+u*y+f*m,A=u*m-f*y+(a<<16),g=t+i*s.A.Iw;for(let t=0;t>16)+(o>>16)*this.width],n+=m,o-=y;p+=y,A+=m,g+=s.A.Iw}}catch(t){}}uT(t,i,e){t|=0,i|=0;let n=(t+=this.eT)+(i+=this.sT)*s.A.Iw,r=0,h=this.height,o=this.width,a=s.A.Iw-o,l=0;if(is.A.bottom&&(h-=i+h-s.A.bottom),ts.A.right){const i=t+o-s.A.right;o-=i,l+=i,a+=i}o>0&&h>0&&this.dT(o,h,this.gw,l,r,s.A.gw,n,a,e.gw)}scale(t,i,e,s,n,r,h,o,a,l,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*a;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=l}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}aT(t,i,e,s,n,r,h,o){const a=-(t>>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}hT(t,i,e,s,n,r,h,o,a){const l=256-a;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*a+(16711935&i)*l&4278255360)+((65280&t)*a+(65280&i)*l&16711680)>>8}}h+=o,s+=n}}rT(t,i,e,s,n,r,h,o){const a=-(t>>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}dT(t,i,e,s,n,r,h,o,a){const l=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=l;t<0;t++){let t=e[n++];0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===a[h]?r[h++]=t:h++}h+=o,n+=s}}}},1673:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1069),r=e(4474);class h extends r.A{gw;width;height;eT;sT;Xa;ww;palette;constructor(t,i,e){super(),this.gw=new Int8Array(t*i),this.width=this.Xa=t,this.height=this.ww=i,this.eT=this.sT=0,this.palette=e}static xu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.Af=s.mu;const o=r.mu,a=r.mu,l=r.Au,c=new Int32Array(l);for(let t=1;ts.length||r.Af>r.length)throw new Error;const f=r.Au,u=r.Au,d=r.mu,w=r.mu,y=new h(d,w,c);y.eT=f,y.sT=u,y.Xa=o,y.ww=a;const m=y.gw,p=r.Au;if(0===p){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.wT(h,r,this.gw,n,a,s.A.gw,e,o)}lT(){const t=this.gw,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}bv(){this.Xa|=0,this.ww|=0,this.Xa/=2,this.ww/=2,this.Xa|=0,this.ww|=0;const t=new Int8Array(this.Xa*this.ww);let i=0;for(let e=0;e>1)+(e+this.sT>>1)*this.Xa]=this.gw[i++];this.gw=t,this.width=this.Xa,this.height=this.ww,this.eT=0,this.sT=0}kw(){if(this.width===this.Xa&&this.height===this.ww)return;const t=new Int8Array(this.Xa*this.ww);let i=0;for(let e=0;e>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,n){try{const r=this.width;this.height;let h=0,o=0;const a=this.Xa,l=this.ww,c=(a<<16)/e|0,f=(l<<16)/n|0;t=t+(this.eT*e+a-1)/a|0,i=i+(this.sT*n+l-1)/l|0,this.eT*e%a!=0&&(h=(a-this.eT*e%a<<16)/e|0),this.sT*n%l!=0&&(o=(l-this.sT*n%l<<16)/n|0),e=e*(this.width-(h>>16))/a|0,n=n*(this.height-(o>>16))/l|0;let u,d=t+i*s.A.Iw,w=s.A.Iw-e;is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right&&(u=t+e-s.A.right,e-=u,w+=u),this.yT(s.A.gw,this.gw,this.palette,h,o,d,w,e,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}yT(t,i,e,s,n,r,h,o,a,l,c,f){try{const u=s;for(let d=-a;d<0;d++){const a=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+a];0==n?r++:t[r++]=e[255&n],s+=l}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(8950),n=e(1069),r=e(4474);class h{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}mT(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}pT(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=e(9298);class a extends r.A{static AT='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static gT=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let e=a.AT.indexOf(String.fromCharCode(i));t&&e>=63&&e--,-1===e&&(e=74),a.gT[i]=e}}IT=[];_T=new Int32Array(94);CT=new Int32Array(94);ET=new Int32Array(94);vT=new Int32Array(94);bT=new Int32Array(95);TT=new Int32Array(256);random=new h(BigInt(Date.now()));height=0;static xu=(t,i)=>{const e=new n.A(t.read(i+'.dat')),s=new n.A(t.read('index.dat'));s.Af=e.mu+4;const r=s.Au;r>0&&(s.Af+=3*(r-1));const h=new a;for(let t=0;t<94;t++){h.ET[t]=s.Au,h.vT[t]=s.Au;const i=h._T[t]=s.mu,n=h.CT[t]=s.mu,r=s.Au,o=i*n;if(h.IT[t]=new Int8Array(o),0===r)for(let s=0;sh.height&&(h.height=n),h.ET[t]=1,h.bT[t]=i+2;{let e=0;for(let s=n/7|0;s=s.A.bottom&&(r-=e+r+1-s.A.bottom),i=s.A.right){const t=i+n+1-s.A.right;n-=t,l+=t,a+=t}n>0&&r>0&&this.NT(n,r,t,c,l,s.A.gw,o,a,h)}kT(t,i,e,n,r,h,o){e|=0,n|=0;let a=(t|=0)+(i|=0)*s.A.Iw,l=s.A.Iw-e,c=0,f=0;if(i=s.A.bottom&&(n-=i+n+1-s.A.bottom),t=s.A.right){const i=t+e+1-s.A.right;e-=i,c+=i,l+=i}e>0&&n>0&&this.FT(e,n,s.A.gw,a,l,o,f,c,r,h)}NT(t,i,e,s,n,r,h,o,a){const l=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=l;t<0;t++)0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a;for(let i=t;i<0;i++)0===e[s++]?h++:r[h++]=a;h+=o,s+=n}}FT(t,i,e,s,n,r,h,o,a,l){t|=0;const c=((16711935&a)*l&4278255360)+((65280&a)*l&16711680)>>8,f=256-l;for(let a=-(i|=0);a<0;a++){for(let i=-t;i<0;i++)if(0===r[h++])s++;else{const t=e[s];e[s++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}s+=n,h+=o}}RT(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.qa:'cya'===t?o.A.YE:'mag'===t?o.A.yp:'whi'===t?o.A.La:'bla'===t?o.A.Za:'lre'===t?o.A.HE:'dre'===t?o.A.VE:'dbl'===t?o.A.KE:'or1'===t?o.A.XE:'or2'===t?o.A.jE:'or3'===t?o.A.zE:'gr1'===t?o.A.ZE:'gr2'===t?o.A.qE:'gr3'===t?o.A.JE:o.A.Za}split(t,i){if(0===t.length)return[t];const e=[];for(;t.length>0;){if(this.ST(t)<=i&&-1===t.indexOf('|')){e.push(t);break}let s=t.length;for(let e=0;ei)break;s=e}else if('|'===t[e]){s=e;break}e.push(t.substring(0,s)),t=t.substring(s+1)}return e}}},1183:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(8950),n=e(7854);class r{BT;width;height;PT;UT;gw;constructor(t,i,e=n.na){this.PT=e,this.BT=this.PT.getImageData(0,0,t,i),this.UT=new Uint32Array(this.BT.data.buffer),this.gw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.gw.fill(0)}bind(){s.A.bind(this.gw,this.width,this.height)}draw(t,i){this.#t(),this.PT.putImageData(this.BT,t,i)}#t(){const t=this.gw.length,i=this.gw,e=this.UT;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,i,e)=>{e.d(i,{A:()=>s});class s{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));zo=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Qo=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};GT=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}},2901:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(1908);class r{static GT=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.YT)return null;if(this.jT[t])return this.jT[t];const i=this.XT[t],e=i+this.KT[t];if(this.WT){const s=Uint8Array.from(this.buffer.subarray(i,i+e));return this.jT[t]=s,s}{const i=Uint8Array.from(n.A.read(this.VT[t],this.buffer,this.KT[t],this.XT[t]));return this.jT[t]=i,i}}}},1069:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(9234),n=e(6666),r=e(4474);class h extends r.A{static ZT=3988292384;static qT=new Int32Array(256);static JT=new Uint32Array(33);static $T=new n.A;static QT=new n.A;static tO=new n.A;static iO=0;static eO=0;static sO=0;static{for(let t=0;t<32;t++)h.JT[t]=(1<>>=1:i=i>>>1^h.ZT;h.qT[t]=i}}static Zo=t=>{let i=4294967295;for(let e=0;e>>8^h.qT[255&(i^t[e])];return~i};view;data;Af=0;nO=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.Af}static Pt=t=>{let i=null;return 0===t&&h.iO>0?(h.iO--,i=h.$T.jg()):1===t&&h.eO>0?(h.eO--,i=h.QT.jg()):2===t&&h.sO>0&&(h.sO--,i=h.tO.jg()),i?(i.Af=0,i):new h(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.Af=0,100===this.view.byteLength&&h.iO<1e3?(h.$T.Km(this),h.iO++):5e3===this.view.byteLength&&h.eO<250?(h.QT.Km(this),h.eO++):3e4===this.view.byteLength&&h.sO<50&&(h.tO.Km(this),h.sO++)}get Au(){return this.view.getUint8(this.Af++)}get Dd(){return this.view.getInt8(this.Af++)}get mu(){const t=this.view.getUint16(this.Af);return this.Af+=2,t}get Iu(){const t=this.view.getInt16(this.Af);return this.Af+=2,t}get qu(){const t=this.view.getUint8(this.Af++)<<16|this.view.getUint16(this.Af);return this.Af+=2,t}get ia(){const t=this.view.getInt32(this.Af);return this.Af+=4,t}get oE(){const t=this.view.getBigInt64(this.Af);return this.Af+=8,t}get BE(){return this.view.getUint8(this.Af)<128?this.Au-64:this.mu-49152}get Ep(){return this.view.getUint8(this.Af)<128?this.Au:this.mu-32768}get Eu(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.Af++))&&this.Af>16),this.view.setUint16(this.Af,t),this.Af+=2}p4(t){this.view.setInt32(this.Af,t),this.Af+=4}aO(t){this.view.setInt32(this.Af,t,!0),this.Af+=4}lO(t){this.view.setBigInt64(this.Af,t),this.Af+=8}cO(t){const i=this.view,e=t.length;for(let s=0;s>>3}yO(t){let i=this.nO>>>3,e=8-(7&this.nO),s=0;for(this.nO+=t;t>e;e=8)s+=(this.view.getUint8(i++)&h.JT[e])<>>e-t&h.JT[t],s}mO(t,i){const e=this.Af;this.Af=0;const n=new Uint8Array(e);this.rO(e,0,n);const r=(0,s.pO)(n),h=(0,s.AO)(r,i,t),o=(0,s.gO)(h);this.Af=0,this.p1(o.length),this.fO(o,o.length,0)}}},5226:(t,i,e)=>{e.d(i,{Q:()=>n,x:()=>s});class s{IO=new Map;Eo;xo=self.isSecureContext?self.crypto.randomUUID():'0';constructor(t){this.Eo=t}async Ko(){const t=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),i=t.createDataChannel('channel'),e=crypto.randomUUID();this.IO.set(e,i),await t.setLocalDescription(await t.createOffer()),t.onicegatheringstatechange=async()=>{if('complete'===t.iceGatheringState){let i;self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(t.localDescription)):console.log(JSON.stringify(t.localDescription));try{for(;null===(i=prompt('Offer copied to clipboard, paste answer here')););t.setRemoteDescription(new RTCSessionDescription(JSON.parse(i)))}catch(t){console.error(t)}}},i.onopen=()=>{i.send(JSON.stringify({type:'id',id:e})),console.log('Connected to peer!')},i.onerror=t=>{console.error(t)},i.onmessage=t=>{const i=JSON.parse(t.data);i.data&&(i.data=Object.values(i.data)),this.Eo&&this.Eo.postMessage(i)}}postMessage(t){const i=this.IO.get(t.data.id),e=t.data;e.data&&(e.data=Array.from(t.data.data)),i&&'open'===i.readyState&&i.send(JSON.stringify(e))}}class n{pc;Lo=void 0;xo;constructor(t){this.pc=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),this.pc.ondatachannel=i=>{this.Lo=i.channel,this.Lo.onopen=()=>{console.log('Connected to host!')},this.Lo.onerror=t=>{console.error(t)},this.Lo.onmessage=i=>{if(!this.xo){const t=JSON.parse(i.data);if('id'===t.type)return void(this.xo=t.id)}t.onmessage&&t.onmessage(i)}},this.pc.onicegatheringstatechange=async()=>{'complete'===this.pc.iceGatheringState&&(self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(this.pc.localDescription)):console.log(JSON.stringify(this.pc.localDescription)))}}async Xo(t){await this.pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(t))),await this.pc.setLocalDescription(await this.pc.createAnswer())}}},3937:(t,i,e)=>{e.d(i,{A:()=>o});class s{start=0;end=0;form=0;length=0;_O=null;CO=null;threshold=0;position=0;delta=0;amplitude=0;EO=0;read(t){this.form=t.Au,this.start=t.ia,this.end=t.ia,this.length=t.Au,this._O=new Int32Array(this.length),this.CO=new Int32Array(this.length);for(let i=0;i=this.threshold&&this.CO&&this._O&&(this.amplitude=this.CO[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this._O[this.position]/65536*t|0,this.threshold>this.EO&&(this.delta=((this.CO[this.position]<<15)-this.amplitude)/(this.threshold-this.EO)|0)),this.amplitude+=this.delta,this.EO++,this.amplitude-this.delta>>15}}class n{static buffer=null;static Hm=null;static sin=null;static vO=new Int32Array(5);static bO=new Int32Array(5);static TO=new Int32Array(5);static OO=new Int32Array(5);static RO=new Int32Array(5);SO=null;LO=null;xO=null;kO=null;MO=null;DO=null;release=null;attack=null;NO=new Int32Array(5);FO=new Int32Array(5);BO=new Int32Array(5);start=0;length=500;PO=100;UO=0;static init=()=>{this.Hm=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.Hm[t]=1:this.Hm[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};GO(t,i){for(let i=0;i>1,h+=(i*s>>16)+r}if(this.MO&&this.DO){const i=this.MO.evaluate(t),e=this.DO.evaluate(t);c=c*(32768+(this.WO(e,l,this.MO.form)>>1))>>15,l+=(i*o>>16)+a}for(let s=0;s<5;s++)if(0!==this.NO[s]){const r=i+n.bO[s];r>15,n.vO[s],this.SO.form),n.vO[s]+=(e*n.OO[s]>>16)+n.RO[s])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,e=!0;for(let s=0;s>8):this.release.start+((this.release.end-this.release.start)*h>>8),i+=256,i>=o&&(i=0,e=!e),e&&(n.buffer[s]=0)}}if(this.UO>0&&this.PO>0){const i=this.UO*e;for(let e=i;e32767&&(n.buffer[i]=32767);return n.buffer}WO(t,i,e){return 1===e?(32767&i)<16384?t:-t:2===e?n.sin[32767&i]*t>>14:3===e?((32767&i)*t>>14)-t:4===e?n.Hm[i/2607&32767]*t:0}read(t){this.SO=new s,this.SO.read(t),this.LO=new s,this.LO.read(t),0!==t.Au&&(t.Af--,this.xO=new s,this.xO.read(t),this.kO=new s,this.kO.read(t)),0!==t.Au&&(t.Af--,this.MO=new s,this.MO.read(t),this.DO=new s,this.DO.read(t)),0!==t.Au&&(t.Af--,this.release=new s,this.release.read(t),this.attack=new s,this.attack.read(t));for(let i=0;i<10;i++){const e=t.Ep;if(0===e)break;this.NO[i]=e,this.FO[i]=t.BE,this.BO[i]=t.Ep}this.UO=t.Ep,this.PO=t.Ep,this.length=t.mu,this.start=t.mu}}var r=e(1069),h=e(3867);class o{static YO=new Int32Array(1e3);static HO=null;static VO=null;static KO=new h.fe(1e3,null);XO=new h.fe(10,null);jO=0;loopEnd=0;static yu=t=>{const i=new r.A(t.read('sounds.dat'));for(this.HO=new Uint8Array(441e3),this.VO=new r.A(this.HO),n.init();;){const t=i.mu;if(65535===t)break;const e=new o;e.read(i),this.KO[t]=e,this.YO[t]=e.trim()}};static GO=(t,i)=>{if(!this.KO[t])return null;const e=this.KO[t];return e?.zO(i)??null};read(t){for(let i=0;i<10;i++)0!==t.Au&&(t.Af--,this.XO[i]=new n,this.XO[i]?.read(t));this.jO=t.mu,this.loopEnd=t.mu}trim(){let t=9999999;for(let i=0;i<10;i++)this.XO[i]&&(this.XO[i].start/20|0)i&&(i=this.XO[t].length+this.XO[t].start);if(0===i)return 0;let e=22050*i/1e3|0,s=22050*this.jO/1e3|0,n=22050*this.loopEnd/1e3|0;(s<0||n<0||n>e||s>=n)&&(t=0);let r=e+(n-s)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){s+=44,n+=44,e+=44,r+=44;const i=r-e;for(let t=e-1;t>=n;t--)o.HO&&(o.HO[t+i]=o.HO[t]);for(let i=1;i{e.d(i,{lp:()=>l,ap:()=>o,fe:()=>s,xp:()=>n,Eh:()=>r,Op:()=>h,Xr:()=>a});class s extends Array{constructor(t,i){super(t);for(let e=0;e{e.d(i,{gO:()=>o,Jo:()=>n,pO:()=>h,$o:()=>s,ec:()=>r,AO:()=>a});const s=async t=>new Promise((i=>setTimeout(i,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),r=async t=>(await fetch(t)).text();function h(t){let i=0n;for(let e=0;e0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function a(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}},7953:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static ZO=new Uint16Array(['d','o','t'].join('').split('').map((t=>t.charCodeAt(0))));static qO=new Uint16Array(['(','a',')'].join('').split('').map((t=>t.charCodeAt(0))));static JO=new Uint16Array(['s','l','a','s','h'].join('').split('').map((t=>t.charCodeAt(0))));static $O=['cook',"cook's",'cooks','seeks','sheet'];static QO=[];static tR=[];static iR=[];static eR=[];static sR=[];static nR=[];static yu=t=>{const i=new s.A(t.read('fragmentsenc.txt')),e=new s.A(t.read('badenc.txt')),n=new s.A(t.read('domainenc.txt')),r=new s.A(t.read('tldlist.txt'));this.read(e,n,i,r)};static filter=t=>{const i=[...t];this.format(i);const e=i.join('').trim(),s=e.toLowerCase(),n=[...s];this.rR(n),this.hR(n),this.oR(n),this.aR(n);for(let t=0;t{this.fR(t),this.uR(i),this.dR(e),this.wR(s)};static wR=t=>{const i=t.ia;for(let e=0;et.Au))};static fR=t=>{const i=t.ia;for(let e=0;et.Au));const i=new Array(t.Au).fill([]).map((()=>[t.Dd,t.Dd]));i.length>0&&(this.eR[e]=i)}};static uR=t=>{const i=t.ia;for(let e=0;et.Au))};static dR=t=>{const i=t.ia;for(let e=0;e{const i=[...t],e=[...t];this.yR(null,i,this.ZO),this.yR(null,e,this.JO);for(let s=0;s{for(let i=0;i<2;i++)for(let i=this.iR.length-1;i>=0;i--)this.yR(this.eR[i],t,this.iR[i])};static oR=t=>{const i=[...t],e=[...t];this.yR(null,i,this.qO),this.yR(null,e,this.ZO);for(let s=this.sR.length-1;s>=0;s--)this.pR(e,i,this.sR[s],t)};static aR=t=>{for(let i=0;i=0&&n{if(this.vR(t))return!0;const i=this.bR(t),e=this.nR,s=e.length;if(i===e[0]||i===e[s-1])return!0;let n=0,r=s-1;for(;n<=r;){const t=(n+r)/2|0;if(i===e[t])return!0;i{if(t.length>6)return 0;let i=0;for(let e=0;e{for(let e=i;e=0;e++)if(this.OR(t[e]))return e;return-1};static CR=(t,i)=>{for(let e=t;e=0;e++)if(!this.OR(i[e]))return e;return i.length};static RR=(t,i,e)=>i===e||'o'===i&&'0'===e?1:'o'===i&&'('===e&&')'===t?2:'c'!==i||'('!==e&&'<'!==e&&'['!==e?'e'===i&&'€'===e||'s'===i&&'$'===e||'l'===i&&'i'===e?1:0:1;static pR=(t,i,e,s)=>{const n=e.length,r=s.length;for(let h=0;h<=r-n;h++){const{SR:n,LR:r}=this.xR(h,e,s);if(!n)continue;const o=this.kR(h,s,3,i,['@']),a=this.MR(r-1,s,3,t,['.',',']);(o>2||a>2)&&this._R(h,r,s)}};static xR=(t,i,e)=>{const s=i.length;let n=t,r=0;for(;n0)n+=a,r++;else{if(0===r)break;const e=this.RR(o,String.fromCharCode(i[r-1]),h);if(e>0)n+=e,1===r&&t++;else{if(r>=s||!this.gR(h))break;n++}}}return{SR:r>=s,LR:n}};static yR=(t,i,e)=>{if(!(e.length>i.length))for(let s=0;s<=i.length-e.length;s++){let n=s;const{LR:r,DR:h,NR:o,FR:a,BR:l}=this.PR(i,e,n);n=r;let c=i[n],f=n+1=e.length)||a&&l)continue;let u,d=!0;if(o){let t=!1,e=!1;if((s-1<0||this.gR(i[s-1])&&"'"!==i[s-1])&&(t=!0),(n>=i.length||this.gR(i[n])&&"'"!==i[n])&&(e=!0),!t||!e){let e=!1;for(u=s-2,t&&(u=s);!e&&u=0&&(!this.gR(i[u])||"'"===i[u])){const t=[];let s;for(s=0;s<3&&u+s=0&&(!this.gR(i[u-1])||"'"===i[u-1])&&(n=!1),n&&!this.ER(t)&&(e=!0)}u++}e||(d=!1)}}else{c=' ',s-1>=0&&(c=i[s-1]),f=' ',n{let s=e,n=0,r=0,h=!1,o=!1,a=!1;for(;s=t.length||o&&a);){const l=t[s],c=s+10)1===f&&this.OR(l)&&(o=!0),2===f&&(this.OR(l)||this.OR(c))&&(o=!0),s+=f,n++;else{if(0===n)break;let t;if((t=this.YR(c,String.fromCharCode(i[n-1]),l))>0)s+=t;else{if(n>=i.length||!this.IR(l))break;if(this.gR(l)&&"'"!==l&&(h=!0),this.OR(l)&&(a=!0),s++,r++,(100*r/(s-e)|0)>90)break}}}return{LR:s,DR:n,NR:h,FR:o,BR:a}};static YR=(t,i,e)=>{if(i===e)return 1;if(i>='a'&&i<='m'){if('a'===i)return'4'!==e&&'@'!==e&&'^'!==e?'/'===e&&'\\'===t?2:0:1;if('b'===i)return'6'!==e&&'8'!==e?'1'===e&&'3'===t?2:0:1;if('c'===i)return'('!==e&&'<'!==e&&'{'!==e&&'['!==e?0:1;if('d'===i)return'['===e&&')'===t?2:0;if('e'===i)return'3'!==e&&'€'!==e?0:1;if('f'===i)return'p'===e&&'h'===t?2:'£'===e?1:0;if('g'===i)return'9'!==e&&'6'!==e?0:1;if('h'===i)return'#'===e?1:0;if('i'===i)return'y'!==e&&'l'!==e&&'j'!==e&&'1'!==e&&'!'!==e&&':'!==e&&';'!==e&&'|'!==e?0:1;if('j'===i)return 0;if('k'===i)return 0;if('l'===i)return'1'!==e&&'|'!==e&&'i'!==e?0:1;if('m'===i)return 0}if(i>='n'&&i<='z'){if('n'===i)return 0;if('o'===i)return'0'!==e&&'*'!==e?'('===e&&')'===t||'['===e&&']'===t||'{'===e&&'}'===t||'<'===e&&'>'===t?2:0:1;if('p'===i)return 0;if('q'===i)return 0;if('r'===i)return 0;if('s'===i)return'5'!==e&&'z'!==e&&'$'!==e&&'2'!==e?0:1;if('t'===i)return'7'!==e&&'+'!==e?0:1;if('u'===i)return'v'===e?1:'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('v'===i)return'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('w'===i)return'v'===e&&'v'===t?2:0;if('x'===i)return')'===e&&'('===t||'}'===e&&'{'===t||']'===e&&'['===t||'>'===e&&'<'===t?2:0;if('y'===i)return 0;if('z'===i)return 0}return i>='0'&&i<='9'?'0'===i?'o'===e||'O'===e?1:'('===e&&')'===t||'{'===e&&'}'===t||'['===e&&']'===t?2:0:'1'===i&&'l'===e?1:0:','===i?'.'===e?1:0:'.'===i?','===e?1:0:'!'===i&&'i'===e?1:0};static GR=(t,i,e)=>{let s=0,n=i.length-1;for(;s<=n;){const r=(s+n)/2|0;if(i[r][0]===t&&i[r][1]===e)return!0;tthis.TR(t)?t.charCodeAt(0)+1-'a'.charCodeAt(0):"'"===t?28:this.OR(t)?t.charCodeAt(0)+29-'0'.charCodeAt(0):27;static mR=(t,i,e,s,n)=>{if(!(s.length>e.length))for(let r=0;r<=e.length-s.length;r++){const{LR:h,HR:o}=this.VR(e,s,r);if(o0&&c>0&&(a=!0),2===i&&(l>2&&c>0||l>0&&c>2)&&(a=!0),3===i&&l>0&&c>2&&(a=!0),!a)continue;let f,u=r,d=h-1,w=!1;if(l>2){if(4===l)for(w=!1,f=r-1;f>=0;f--)if(w){if('*'!==n[f])break;u=f}else'*'===n[f]&&(u=f,w=!0);for(w=!1,f=u-1;f>=0;f--)if(w){if(this.gR(e[f]))break;u=f}else this.gR(e[f])||(w=!0,u=f)}if(c>2){if(4===c)for(w=!1,f=d+1;f{let s=0;for(;e0)e+=h,s++;else{if(0===s)break;let t;if((t=this.RR(r,String.fromCharCode(i[s-1]),n))>0)e+=t;else{if(!this.gR(n))break;e++}}}return{LR:e,HR:s}};static gR=t=>!this.WR(t)&&!this.OR(t);static IR=t=>!this.TR(t)||('v'===t||'x'===t||'j'===t||'q'===t||'z'===t);static WR=t=>this.TR(t)||this.KR(t);static OR=t=>t>='0'&&t<='9';static TR=t=>t>='a'&&t<='z';static KR=t=>t>='A'&&t<='Z';static vR=t=>{for(let i=0;i{for(let s=t;s{let e=0;for(let s=i-1;s>=0&&this.gR(t[s]);s--)'*'===t[s]&&e++;return e};static jR=(t,i)=>{let e=0;for(let s=i+1;s(n?this.XR(i,e):this.jR(i,e))>=s?4:this.gR(n?t[e-1]:t[e+1])?1:0;static kR=(t,i,e,s,n)=>{if(0===t)return 2;for(let e=t-1;e>=0&&this.gR(i[e]);e--)if(n.includes(i[e]))return 3;return this.zR(i,s,t,e,!0)};static MR=(t,i,e,s,n)=>{if(t+1===i.length)return 2;for(let e=t+1;e{let i=0;for(let e=0;et>=' '&&t<=''||' '===t||'\n'===t||'\t'===t||'£'===t||'€'===t;static lR=(t,i)=>{for(let e=0;e{let i=!0;for(let e=0;e{e.a(t,(async(t,i)=>{try{var s=e(1312),n=e(5637),r=e(2164),h=e(1302),o=e(6948),a=e(8317),l=e(8738),c=e(3764),f=e(1120),u=e(3709),d=e(8950),w=e(4583),y=e(2682),m=e(8665),p=e(8534),A=e(6730),g=e(7953),I=e(9234),_=e(1069),C=e(3937),E=e(4544),v=e(7854),b=e(1673),T=e(1908),O=e(1651),R=e(7604);class t extends O.K{qR=[];JR=[];$R=-1;QR=new o.A(-1);tS=-1;iS='';async eS(t){const i=new Map,e=(await(0,I.ec)(t)).split('\n');for(let t=0;t{if(this.kt)this.Mt=!0;else{this.kt=!0;try{await this.qo(10,'Connecting to fileserver'),await T.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new E.A(await E.A.openDatabase());const t=new _.A(new Uint8Array(await(0,I.Jo)(`${O.K.nt}/crc`)));for(let i=0;i<9;i++)this.Bt[i]=t.ia;const i=await this.jo('title','title screen',this.Bt[1],10);this.di=y.A.xu(i,'p11'),this.wi=y.A.xu(i,'p12'),this.yi=y.A.xu(i,'b12'),this.mi=y.A.xu(i,'q8');const e=await this.jo('config','config',this.Bt[2],15),d=await this.jo('interface','interface',this.Bt[3],20),v=await this.jo('media','2d graphics',this.Bt[4],30),R=await this.jo('models','3d graphics',this.Bt[5],40),S=await this.jo('textures','textures',this.Bt[6],60),L=await this.jo('wordenc','chat system',this.Bt[7],65),x=await this.jo('sounds','sound effects',this.Bt[8],70),k=new _.A(new Uint8Array(await(0,I.Jo)(`${O.K.nt}/server/mesanim.dat`)));await this.qo(75,'Unpacking media'),this.re=b.A.xu(v,'chatback',0),await this.qo(80,'Unpacking textures'),w.A.vv(S),w.A.Ov(.8),w.A.Sv(20),await this.qo(83,'Unpacking models'),m.A.yu(R),p.A.yu(R),A.A.yu(R),await this.qo(86,'Unpacking config'),s.A.yu(e),n.A.yu(e),r.A.yu(e),h.A.yu(e,!0),o.A.yu(e),a.A.yu(e),l.A.yu(e),c.A.yu(e),u.A.yu(k),await this.sS(),await this.nS(),await this.qo(90,'Unpacking sounds'),C.A.yu(x),await this.qo(92,'Unpacking interfaces'),f.A.yu(d,v,[this.di,this.wi,this.yi,this.mi]),await this.qo(97,'Preparing game engine'),g.A.yu(L),await this.qo(100,'Getting ready to start...'),this.Fo?.bind(),w.A.Fc();const M=document.querySelector('#authentic');null!==M&&(M.onchange=()=>{this.rS()});const D=document.querySelector('#newline');null!==D&&(D.onclick=()=>{this.iS+='|',this.rS()});const N=document.querySelector('#clear');null!==N&&(N.onclick=()=>{this.iS='',this.rS()}),this.hS('bla'),this.hS('red'),this.hS('gre'),this.hS('blu'),this.hS('yel'),this.hS('cya'),this.hS('mag'),this.hS('whi'),this.hS('lre'),this.hS('dre'),this.hS('dbl'),this.hS('or1'),this.hS('or2'),this.hS('or3'),this.hS('gr1'),this.hS('gr2'),this.hS('gr3'),this.QR=o.A.get(0),this.tS=0,this.rS()}catch(t){this.Dt=!0,console.error(t)}}};update=async()=>{this.Mt||this.Dt||this.Nt||(this.Ft++,this.oS())};draw=async()=>{this.Mt||this.Dt||this.Nt?this.sa():(d.A.clear(),this.aS(),this.Fo?.draw(0,0))};async sS(){this.qR[1]=await this.eS(`${O.K.lt}/data/src/pack/npc.pack`);const t=document.querySelector('#npcs');if(!t)return;t.innerHTML='';const i=document.createElement('input');i.type='search',i.placeholder='Search',i.tabIndex=1,i.oninput=()=>{const t=i.value.toLowerCase().replaceAll(' ','_'),e=document.querySelector('#npcList');if(e)for(let i=0;i-1?s.style.display='':s.style.display='none'}},t.appendChild(i);const e=document.createElement('ul');e.id='npcList',e.className='list-group',t.appendChild(e);for(const[t,i]of this.qR[1]){const s=o.A.get(t);if(null===s.$u||0===s.$u.length)continue;const n=document.createElement('li');n.id=i,n.className='list-group-item',0===t&&(n.className+=' active'),n.innerText=i+' ('+t+')',n.onclick=()=>{const i=e.querySelector('.active');i&&(i.className='list-group-item'),n.className='list-group-item active',this.QR=o.A.get(t),this.lS(this.QR,this.tS,this.iS)},e.appendChild(n)}}async nS(){const t=document.querySelector('#mesanims');if(!t)return;t.innerHTML='';const i=document.createElement('input');i.type='search',i.placeholder='Search',i.tabIndex=2,i.oninput=()=>{const t=i.value.toLowerCase().replaceAll(' ','_'),e=document.querySelector('#mesanimList');if(e)for(let i=0;i-1?s.style.display='':s.style.display='none'}},t.appendChild(i);const e=document.createElement('ul');e.id='mesanimList',e.className='list-group',t.appendChild(e);for(const t of u.A.Do){const i=t.id,s=t.Fu??`mesanim_${t.id}`,n=document.createElement('li');n.id=s,n.className='list-group-item',0===i&&(n.className+=' active'),n.innerText=s+' ('+i+')',n.onclick=()=>{const t=e.querySelector('.active');t&&(t.className='list-group-item'),n.className='list-group-item active',this.tS=i,this.rS()},e.appendChild(n)}}hS(t){const i=document.querySelector(`#${t}`);null!==i&&(i.onclick=()=>{this.iS+=`@${t}@`,this.rS()})}oS(){let t=!1;for(;;){const i=this.Gc();if(-1===i)break;if(document.activeElement!==v.Nc)continue;-1!==y.A.AT.indexOf(String.fromCharCode(i))?(this.iS+=String.fromCharCode(i),t=!0):8===i&&this.iS.length>0?(this.iS=this.iS.substring(0,this.iS.length-1),t=!0):10!==i&&13!==i||(this.iS+='|',t=!0)}t&&-1!==this.iS.indexOf('\\n')&&(this.iS=this.iS.replaceAll('\\n','|')),t&&this.rS()}aS(){this.re?.draw(0,0),this.pa(this.hs,1);try{this.ba(f.A.Do[this.hs],0,0,0)}catch(t){console.error(t)}}rS(){if(-1===this.tS||!this.mi)return;this.cS(this.iS,380,4,this.mi,this.tS),this.fS()>1&&(this.iS=''),this.lS(this.QR,this.tS,this.iS);const t=document.querySelector('#export');if(t){const i=u.A.Do[this.tS],e=document.querySelector('#authentic');if(null===e||!1===e.checked){const e='default'===i.Fu?'"default"':i.Fu??`mesanim_${i.id}`;t.value=`~chatnpc(${e}, "${this.iS}");`}else t.value=`~chatnpc("${this.iS}");`}}cS(t,i,e,s,n){const r=s.split(t,i);for(this.JR=[],this.$R=n;r.length>0;)this.JR.push(r.splice(0,e))}uS(t,i){return this.JR[t][i]}fS(){return this.JR.length}dS(t){return this.JR[t].length}wS(t){if(-1===this.$R)return-1;const i=u.A.Do[this.$R],e=this.dS(t);return i.zd[e-1]}lS(t,i,e){if(!this.mi||-1===i)return;this.cS(e,380,4,this.mi,i);const s=this.fS();for(let i=0;i{})),window.onkeydown=function(t){return!(' '===t.key&&(t.target===document.body||t.target===v.Nc))},i()}catch(t){i(t)}}),1)},1908:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(9763);class n{static mS=null;static load=async t=>{this.mS=await(0,s.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,e,s)=>{if(!this.mS)throw new Error('bz2 not found!!');return Int8Array.from(this.mS.read(t,i,e,s))}}},123:(t,i,e)=>{function s(t,i,e){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256,e)}function n(t){window._tinyMidiStop&&window._tinyMidiStop(t)}e.d(i,{ea:()=>s,ko:()=>n})},2604:(t,i,e)=>{function s(t,i){var e;(e=document.createElement('a')).href=t,e.download=i,document.body.appendChild(e),e.style='display: none',e.click(),e.remove()}e.d(i,{A:()=>s})},9763:(t,i,e)=>{async function s(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,a=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,a,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(a),a}(a,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(l,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function a(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function l(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}e.d(i,{F:()=>s})},9896:(t,i,e)=>{var s=e(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{const t=2,i=44100;let e=new Float32Array,n=window.audioContext.createGain();n.gain.value=.1,n.connect(window.audioContext.destination);let r=window.audioContext.currentTime,h=[];const o=new s.A({pS:30,AS:t=>{let i=new Float32Array(t.buffer),s=new Float32Array(e.length+i.length);s.set(e,0),s.set(i,e.length),e=s},gS:t=>{},bufferSize:102400});await o.init();const a=await fetch('./SCC1_Florestan.sf2'),l=new Uint8Array(await a.arrayBuffer());function c(){if(!window.audioContext||!e.length)return;let s=window.audioContext.createBufferSource();const o=e.length/t,a=window.audioContext.createBuffer(t,o,i);for(let i=0;i{t.stop(window.audioContext.currentTime)})),h=[],n.gain.value=t}}function d(t,i){-1!==t&&window._tinyMidiVolume(t),r=window.audioContext.currentTime,f=setInterval(c,250),o.IS(i)}o._S(l),window._tinyMidiStop=async t=>{t?function(t,i){const e=window.audioContext.currentTime;n.gain.cancelScheduledValues(e),n.gain.setValueAtTime(n.gain.value,e),n.gain.linearRampToValueAtTime(t,e+2),setTimeout(i,2e3)}(0,(()=>{u()})):u()},window._tinyMidiVolume=(t=1)=>{n.gain.value=t},window._tinyMidiPlay=async(t,i,e)=>{t&&(await window._tinyMidiStop(e),e?setTimeout((()=>{d(i,t)}),2e3):d(i,t))}})()},8151:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5473);const n=class{constructor(t={}){this.CS=void 0,this.ES=0,this.vS=0,this.bS=0,this.pS=t.pS||100,this.sampleRate=t.sampleRate||44100,this.TS=t.TS||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.OS(1),this.AS=t.AS||(()=>{}),this.gS=t.gS||(()=>{}),this.RS=void 0,this.test=0}async init(){if(!this.CS){if('undefined'!=typeof process){const{SS:t}=await import('path'),{LS:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.CS=await(0,s.A)(),this.xS=this.CS._malloc(this.bufferSize),this.kS=this.CS._malloc(8)}}OS(t){this.bufferSize=4*this.sampleRate*this.TS*t}MS(){if(!this.CS)throw new Error(`${this.constructor.name} not initalized. call .init()`)}_S(t){this.MS();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.CS;e(this.ES),this.ES=i(t.length),this.CS.HEAPU8.set(t,this.ES),this.vS=s(this.ES,t.length),n(this.vS,2===this.TS?0:2,this.sampleRate,this.gain)}DS(){this.MS();const t=new Uint8Array(this.bufferSize);return t.set(this.CS.HEAPU8.subarray(this.xS,this.xS+this.bufferSize)),t}NS(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.CS;return e(this.bS),this.bS=i(t.length),this.CS.HEAPU8.set(t,this.bS),s(this.bS,t.length)}BS(t){const{_midi_render:i}=this.CS;return i(this.vS,t,this.TS,this.sampleRate,this.xS,this.bufferSize,this.kS)}IS(t){if(this.MS(),!this.vS)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.RS);const{setValue:i,getValue:e}=this.CS;i(this.kS,0,'double'),this.CS._tsf_reset(this.vS),this.CS._tsf_channel_set_bank_preset(this.vS,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.NS(t);const n=()=>{s=this.BS(s);const t=this.DS();this.AS(t),s?this.RS=setTimeout(n,this.pS):this.gS(e(this.kS,'double'))};this.RS=setTimeout(n,16)}}},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,e)=>{var s;e.d(i,{A:()=>n});const n=(s="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,n,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,e){i=t,n=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(r.ready,t)||Object.defineProperty(r.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var h=Object.assign({},r),o=[],a='object'==typeof window,l='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!a&&!c&&!l;if(r.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var m,p;y=l?require('path').SS(y)+'/':__dirname+'/';var A=()=>{p||(m=require('fs'),p=require('path'))};u=(t,i)=>(A(),t=p.normalize(t),m.PS(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,e)=>{A(),t=p.normalize(t),m.US(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),r.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,e){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!a&&!l)throw new Error('environment detection error');if(l?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),s&&(y=s),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},l&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}r.print||console.log.bind(console);var g,I,_=r.printErr||console.warn.bind(console);function C(t,i){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(r,h),h=null,g='fetchSettings',Object.getOwnPropertyDescriptor(r,g)&&j('`Module.'+g+'` was supplied but `'+g+'` not included in INCOMING_MODULE_JS_API'),r.arguments&&(o=r.arguments),C('arguments','arguments_'),r.thisProgram&&r.thisProgram,C('thisProgram','thisProgram'),r.quit&&r.quit,C('quit','quit_'),D(void 0===r.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===r.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===r.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===r.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===r.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),r.wasmBinary&&(I=r.wasmBinary),C('wasmBinary','wasmBinary');var v;r.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,O,R,S,L,x,k,M=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function N(t){b=t,r.HEAP8=T=new Int8Array(t),r.HEAP16=R=new Int16Array(t),r.HEAP32=S=new Int32Array(t),r.HEAPU8=O=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=L=new Uint32Array(t),r.HEAPF32=x=new Float32Array(t),r.HEAPF64=k=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var F=5242880;r.TOTAL_STACK&&D(F===r.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=r.INITIAL_MEMORY||16777216;function P(){if(!M){var t=ft(),i=L[t>>2],e=L[t+4>>2];34821223==i&&2310721022==e||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==L[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=F,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+F+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!r.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var U=[],G=[],W=[],Y=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var H=0,V=null,K=null,X={};function j(t){r.onAbort&&r.onAbort(t),_(t='Aborted('+t+')'),M=!0;var i=new WebAssembly.RuntimeError(t);throw n(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},GS:function(){z.error()},WS:function(){z.error()},YS:function(){z.error()},open:function(){z.error()},HS:function(){z.error()},VS:function(){z.error()},KS:function(){z.error()},XS:function(){z.error()},jS:function(){z.error()}};r.FS_createDataFile=z.GS,r.FS_createPreloadedFile=z.WS;var Z,q,J,$,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=r.asm),D(Y,'native function `'+e+'` called before runtime initialization'),s[t]||D(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==Z&&I)return new Uint8Array(I);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(r)}function ht(t){ht.zS||(ht.zS={}),ht.zS[t]||(ht.zS[t]=1,c&&(t='warning: '+t),_(t))}function ot(t){try{return v.grow(t-b.byteLength+65535>>>16),N(v.buffer),1}catch(i){_('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}r.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=r.locateFile?r.locateFile(q,y):y+q):Z=new URL(e(8227),e.b).toString();var at,lt={"emscripten_memcpy_big":function(t,i,e){O.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=O.length;D((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return _('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return _('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':lt,'wasi_snapshot_preview1':lt};function e(t,i){var e,s=t.exports;r.asm=s,D(v=r.asm.memory,"memory not found in wasm exports"),N(v.buffer),D(r.asm.__indirect_function_table,"table not found in wasm exports"),e=r.asm.__wasm_call_ctors,G.unshift(e),function(t){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(X[t]),delete X[t]):_('warning: run dependency removed without ID'),0==H&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',H++,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(M)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,_('still waiting on run dependencies:')),_('dependency: '+i);t&&_('(end of list)')}),1e4))):_('warning: run dependency added without ID');var s=r;function h(t){D(r===s,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),s=null,e(t.instance)}function o(t){return function(){if(!I&&(a||l)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return st(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){_('failed to asynchronously prepare wasm: '+t),it(Z)&&_('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(r.instantiateWasm)try{return r.instantiateWasm(i,e)}catch(t){_('Module.instantiateWasm callback failed with error: '+t),n(t)}(I||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(h):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return _('wasm streaming compile failed: '+t),_('falling back to ArrayBuffer instantiation'),o(h)}))}))).catch(n)}(),r.___wasm_call_ctors=et("__wasm_call_ctors"),r._malloc=et("malloc"),r._free=et("free"),r._tsf_load_memory=et("tsf_load_memory"),r._tsf_close=et("tsf_close"),r._tsf_reset=et("tsf_reset"),r._tsf_set_output=et("tsf_set_output"),r._tsf_set_max_voices=et("tsf_set_max_voices"),r._realloc=et("realloc"),r._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),r._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),r._tml_load_memory=et("tml_load_memory"),r._midi_render=et("midi_render"),r.___errno_location=et("__errno_location"),r._fflush=et("fflush"),r._emscripten_stack_init=function(){return(ct=r._emscripten_stack_init=r.asm.emscripten_stack_init).apply(null,arguments)}),ft=(r._emscripten_stack_get_free=function(){return(r._emscripten_stack_get_free=r.asm.emscripten_stack_get_free).apply(null,arguments)},r._emscripten_stack_get_base=function(){return(r._emscripten_stack_get_base=r.asm.emscripten_stack_get_base).apply(null,arguments)},r._emscripten_stack_get_end=function(){return(ft=r._emscripten_stack_get_end=r.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),L[t>>2]=34821223,L[t+4>>2]=2310721022,L[0]=1668509029}function dt(t){function e(){at||(at=!0,r.calledRun=!0,M||(D(!Y),Y=!0,P(),rt(G),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),D(!r._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(P(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),W.unshift(t);var t;rt(W)}()))}t=t||o,H>0||(ut(),function(){if(r.preRun)for('function'==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),U.unshift(t);var t;rt(U)}(),H>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),e()}),1)):e(),P()))}if(r.stackSave=et("stackSave"),r.stackRestore=et("stackRestore"),r.stackAlloc=et("stackAlloc"),r.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':T[0|t]=i;break;case'i16':R[t>>1]=i;break;case'i32':S[t>>2]=i;break;case'i64':$=[i>>>0,(J=i,+Math.abs(J)>=1?J>0?(0|Math.min(+Math.floor(J/4294967296),4294967295))>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],S[t>>2]=$[0],S[t+4>>2]=$[1];break;case'float':x[t>>2]=i;break;case'double':k[t>>3]=i;break;case'*':L[t>>2]=i;break;default:j('invalid type for setValue: '+e)}},r.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return T[0|t];case'i16':return R[t>>1];case'i32':case'i64':return S[t>>2];case'float':return x[t>>2];case'double':return k[t>>3];case'*':return L[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),K=function t(){at||dt(),at||(K=t)},r.preInit)for('function'==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return dt(),t.ready})}},r={};function h(t){var i=r[t];if(void 0!==i)return i.exports;var e=r[t]={exports:{}};return n[t](e,e.exports,h),e.exports}h.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",e="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",s=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},h.a=(n,r,h)=>{var o;h&&((o=[]).d=-1);var a,l,c,f=new Set,u=n.exports,d=new Promise(((t,i)=>{c=i,l=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,r((n=>{var r;a=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var r=[];r.d=0,n.then((t=>{h[i]=t,s(r)}),(t=>{h[e]=t,s(r)}));var h={};return h[t]=t=>t(r),h}}var o={};return o[t]=t=>{},o[i]=n,o})))(n);var h=()=>a.map((t=>{if(t[e])throw t[e];return t[i]})),l=new Promise((i=>{(r=()=>i(h)).r=0;var e=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(r.r++,t.push(r)));a.map((i=>i[t](e)))}));return r.r?l:h()}),(t=>(t?c(d[e]=t):l(u),s(o)))),o&&o.d<0&&(o.d=0)},h.d=(t,i)=>{for(var e in i)h.o(i,e)&&!h.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},h.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),h.p="/Client2/",h.b=document.baseURI||self.location.href;h(5532)})(); \ No newline at end of file +(()=>{"use strict";var t,i,e,s,n={1651:(t,i,e)=>{e.d(i,{K:()=>D});var s=e(1120),n=e(4583),r=e(2901),h=e(1069),o=e(7046),a=(e(9896),e(6666)),l=e(3045),c=e(818),f=e(670),u=e(8268),d=e(3867),w=e(7854),y=e(8950),m=e(1302),p=e(9298),A=e(8665),g=e(1312),I=e(3819),_=e(8317),C=e(9234),E=e(1908),v=e(123),b=e(5637),T=e(6948),O=e(2164),R=e(8738),S=e(3764),L=e(8534),x=e(6730),k=e(2604),M=e(5226);class D extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static et=!1;static st='';static nt='';static rt=!1;static ht=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static gt=0;static It=0;static _t=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Ot=0;static Rt=()=>{l.A.et=!1,n.A.et=!1,D.et=!1,c.A.et=!1};static St=()=>{l.A.et=!0,n.A.et=!0,D.et=!0,c.A.et=!0};Lt=2048;xt=2047;kt=!1;Mt=!1;Dt=!1;Nt=!1;db=null;Ft=0;Bt=[];stream=null;in=h.A.Pt(1);Ut=h.A.Pt(1);Gt=h.A.Pt(1);Wt=0n;Yt=0;Ht=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;Jt=!0;$t=0;Qt=0;ti=null;ii=null;ei=null;si=null;ni=null;ri=null;hi=null;oi=null;ai=null;li=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;mi=null;pi=[];Ai=!1;gi=null;Ii=null;_i=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Oi=null;Ri=null;Si=new Int32Array(256);Li=0;xi=0;ki=0;Mi=null;Di=null;Ni=null;Fi=null;Bi=null;Pi=null;Ui=null;Gi=null;Wi=null;Yi=null;Hi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;Ji=null;$i=null;Qi=null;te=new Int32Array(33);ie=new Int32Array(33);ee=new Int32Array(151);se=new Int32Array(151);ne=null;re=null;he=null;oe=null;ae=null;le=null;ce=new d.fe(13,null);ue=null;de=null;we=new d.fe(50,null);ye=new d.fe(50,null);me=new d.fe(20,null);pe=new d.fe(20,null);Ae=null;ge=new d.fe(8,null);Ie=null;_e=null;Ce=null;Ee=null;ve=null;be=null;Te=null;Oe=null;Re=null;Se=null;Le=null;xe=null;ke=null;Me=null;De=null;Ne=null;Fe=null;Be=null;Pe=new d.fe(1e3,null);Ue=!1;Ge=!1;We=!1;Ye=!1;He=-1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=!1;Je=0;$e=0;Qe=0;ts=0;es=0;ss=0;ns=[];rs=-1;hs=-1;os=new s.A;ls=78;cs=0;fs=0;us=[];ds=0;ws=0;ys=0;ps=0;As=0;gs=0;Is=0;_s=0;Cs=[];Es=[];vs=[];bs=[];Ts=null;Os=-1;Rs=3;Ss=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Ls=0;xs=0;ks=0;Ms=!1;Ds=0;Ns=!1;Fs='';Bs='';Ps=0;Us='';Gs=!1;Ws=-1;Ys=new d.fe(100,null);Hs=new d.fe(100,null);messageType=new Int32Array(100);Vs=new Int32Array(100);Ks=0;Xs=0;js=0;zs='';Zs=0;qs=0;Js=0;$s=0;Qs=0;tn=0;en=0;sn=0;nn=0;rn=!1;hn=0;an=0;ln=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;mn=!1;pn=[];An=[];gn=0;In=0;_n=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);On=new Int32Array(500);Rn=0;Sn=0;Ln=0;xn='';kn=!1;Mn=-1;Dn=0;Nn=0;Fn=0;Bn=0;Pn=0;Un=new Int32Array(1e3);Gn=new Int32Array(1e3);Wn=null;Yn=0;Hn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;Jn=0;$n=2;Qn=2;tr=1;ir=new Int32Array(5);er=new d.fe(5,!1);sr=new Int32Array(5);nr=new Int32Array(5);rr=new Int32Array(5);hr=0;ar=0;lr=0;cr=0;ur=0;dr=0;wr=0;yr=0;mr=0;pr=1;Ar=2;gr=-1;Ir=0;_r=0;Cr=0;Er=0;vr=0;br=0;Tr=null;Or=null;Rr=null;Sr=0;Lr=0;kr=new Int8Array(16384);Mr=new d.fe(f.A.Dr,null);Nr=0;Fr=0;Br=128;Pr=0;Ur=0;Gr=0;Wr=0;Yr=0;Hr=null;Vr=null;Kr=new d.Xr(f.A.jr,f.A.jr);zr=0;Zr=0;qr=0;Jr=0;$r=0;Qr=0;th=0;ih=0;eh=0;sh=0;nh=0;rh=0;hh=new d.fe(this.Lt,null);oh=0;ah=new Int32Array(this.Lt);lh=0;fh=0;uh=new Int32Array(this.Lt);dh=new Int32Array(1e3);wh=new d.fe(this.Lt,null);yh=new d.fe(8192,null);mh=0;ph=new Int32Array(8192);Ah=new a.A;gh=new a.A;Ih=new a.A;_h=new a.A;Ch=new d.Eh(f.A.Dr,f.A.jr,f.A.jr,null);bh=new a.A;Th=new Int32Array(4e3);Oh=new Int32Array(4e3);Rh=new Int32Array(f.A.jr*f.A.jr);Sh=new Int32Array(f.A.jr*f.A.jr);Lh=0;xh=null;kh=0;Mh=0;Dh=-1;Nh=0;Fh=0;Bh=0;Ph=0;Uh=!1;Gh=!0;Wh=!1;Yh=new Int32Array(7);Hh=new Int32Array(5);Vh=0;Kh=0;static Xh=50;jh=new Int32Array(D.Xh);zh=new Int32Array(D.Xh);Zh=new Int32Array(D.Xh);qh=new Int32Array(D.Xh);Jh=new Int32Array(D.Xh);$h=new Int32Array(D.Xh);Qh=new Int32Array(D.Xh);io=new d.fe(D.Xh,null);eo=new d.fe(100,null);so=new BigInt64Array(100);no=new Int32Array(100);ro=null;ho=0;oo=!0;ao=new Int32Array(50);lo=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;mo=0;po=!0;Ao=null;Io=0;_o=0;Co=192;Eo=void 0;vo=!1;host=null;bo=null;To=new d.fe(16,null);Oo=0;Ro=!1;So=()=>{try{this.stream&&this.stream.close()}catch(t){}this.bo&&'998'===D.getParameter('world')&&this.bo.Lo?.send(JSON.stringify({type:'close',id:this.bo.xo})),this.stream=null,(0,v.ko)(!1),this.Ut=null,this.Gt=null,this.in=null,this.Rr=null,this.Tr=null,this.Or=null,this.Hr=null,this.Vr=null,this.Wn=null,this.Mr=null,this.Rh=null,this.Sh=null,this.Th=null,this.Oh=null,this.kr=null,this.Di=null,this.Ni=null,this.Fi=null,this.Bi=null,this.Pi=null,this.Ui=null,this.Gi=null,this.Wi=null,this.Yi=null,this.Hi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.ne=null,this.he=null,this.re=null,this.oe=null,this.ae=null,this.le=null,this.ce=null,this.Te=null,this.Oe=null,this.Re=null,this.Se=null,this.Le=null,this.xe=null,this.ke=null,this.Me=null,this.De=null,this.Ne=null,this.de=null,this.me=null,this.pe=null,this.ge=null,this.Ie=null,this._e=null,this.Ce=null,this.Ee=null,this.we=null,this.ye=null,this.Kr=null,this.hh=null,this.ah=null,this.uh=null,this.wh=null,this.dh=null,this.yh=null,this.ph=null,this.Ch=null,this.bh=null,this._h=null,this.Ah=null,this.gh=null,this.Ih=null,this.Tn=null,this.On=null,this.vn=null,this.bn=null,this.ns=null,this.pn=null,this.Un=null,this.Gn=null,this.Pe=null,this.ue=null,this.eo=null,this.so=null,this.no=null,this.si=null,this.ni=null,this.ti=null,this.ii=null,this.ei=null,this.ri=null,this.hi=null,this.oi=null,this.ai=null,this.Mo(),b.A.So(),T.A.So(),m.A.So(),O.A.Do=null,_.A.Do=null,s.A.Do=null,g.A.Do=null,R.A.Do=null,R.A.No=null,S.A.Do=null,this.Fo=null,u.A.No=null,n.A.So(),l.A.So(),A.A.So(),L.A.Do=[],x.A.Do=[]};Bo(){return this.$t}Po(){return this.Gs}Uo(){return this.Ns}Go(){return this.hs}Wo(){return this.He}Mo=()=>{this.Ai=!1,this.Mi&&(clearInterval(this.Mi),this.Mi=null),this.li=null,this.ci=null,this.pi=[],this.bi=null,this.Ti=null,this.Oi=null,this.Ri=null,this.Ci=null,this._i=null,this.Ei=null,this.vi=null,this.gi=null,this.Ii=null};Yo=()=>{'999'===D.getParameter('world')?(this.Eo=new Worker('worker.js',{type:'module'}),this.Eo.onmessage=this.onmessage,this.host=new M.x(this.Eo)):'998'===D.getParameter('world')&&(this.Eo={onmessage:t=>{this.stream.Ho.onmessage(t)},postMessage:t=>{this.bo&&this.bo.Lo&&'open'===this.bo.Lo.readyState&&this.bo.Lo.send(JSON.stringify(t))},onerror:null,onmessageerror:null,terminate:()=>{throw new Error},addEventListener:()=>{throw new Error},removeEventListener:()=>{throw new Error},dispatchEvent:()=>{throw new Error}},this.bo=new M.Q(this.Eo))};onmessage=t=>{switch(t.data.type){case'ready':return void(this.vo=!0);case'save':return(0,k.A)(t.data.value,t.data.path.split('/').pop().split('\\').pop()),void URL.revokeObjectURL(t.data.value);case'close':return void this.Eo?.postMessage({type:'close',id:t.data.id})}this.host?.xo===t.data.id?this.stream.Ho.onmessage(t.data):this.host?.postMessage(t)};Vo=async()=>{if(999==+D.getParameter('world'))this.host&&await this.host.Ko();else if(998==+D.getParameter('world')&&this.bo){if(this.bo.Lo)return void console.log('You are already connected.');const t=prompt('Paste offer here, answer will be copied to clipboard');if(t)try{await this.bo.Xo(t)}catch(t){console.error(t)}}};jo=async(t,i,e,s)=>{let n=5,o=await(this.db?.zo(t));if(o&&h.A.Zo(o)!==e&&(o=void 0),o)return new r.A(o);for(;!o;){await this.qo(s,`Requesting ${i}`);try{o=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}${e}`):await(0,C.Jo)(`${D.nt}/${t}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.qo(s,`Error loading - Will retry in ${t} secs.`),await(0,C.$o)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Qo(t,o)),new r.A(o)};ta=async(t,i,e,s)=>{let n=await(this.db?.zo(t+'.mid'));if(n&&12345678!==i&&h.A.Zo(n)!==i&&(n=void 0),!n)try{n=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}_${i}.mid`):await(0,C.Jo)(`${D.nt}/songs/${t}.mid`),e!==n.length&&(n=n.slice(0,e))}catch(t){}if(!n)return;await(this.db?.Qo(t+'.mid',n));const r=new h.A(Uint8Array.from(n)).ia,o=E.A.read(r,n,e,4);(0,v.ea)(o,this.Co,s)};sa=()=>{if(w.na.fillStyle='black',w.na.fillRect(0,0,this.width,this.height),this.ra(1),this.Dt){this.Ai=!1,w.na.font='bold 16px helvetica, sans-serif',w.na.textAlign='left',w.na.fillStyle='yellow';let t=35;w.na.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.na.fillStyle='white',w.na.fillText('To fix this try the following (in order):',30,t),t+=50,w.na.font='bold 12px helvetica, sans-serif',w.na.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.na.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.na.fillText('3: Try using a different game-world',30,t),t+=30,w.na.fillText('4: Try rebooting your computer',30,t),t+=30,w.na.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.Ai=!1,w.na.font='bold 20px helvetica, sans-serif',w.na.textAlign='left',w.na.fillStyle='white',w.na.fillText('Error - unable to load game!',50,50),w.na.fillText('To play RuneScape make sure you play from',50,100),w.na.fillText('https://2004scape.org',50,150)),this.Mt){this.Ai=!1,w.na.font='bold 13px helvetica, sans-serif',w.na.textAlign='left',w.na.fillStyle='yellow';let t=35;w.na.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.na.fillStyle='white',w.na.fillText('To fix this try the following (in order):',30,t),t+=50,w.na.font='bold 12px helvetica, sans-serif',w.na.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.na.fillText('2: Try rebooting your computer, and reloading',30,t)}};ha=t=>{if(!t.oa)return!1;for(let i=0;i=s)return!1}else if(3===t.oa[i]){if(e<=s)return!1}else if(4===t.oa[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};ca=(t,i,e,s,n)=>{this.ve?.draw(t,i),this.be?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,p.A.fa);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;y.A.fillRect(t,i+h+16,16,r,p.A.ua),y.A.da(t,i+h+16,p.A.wa,r),y.A.da(t+1,i+h+16,p.A.wa,r),y.A.ya(t,i+h+16,p.A.wa,16),y.A.ya(t,i+h+17,p.A.wa,16),y.A.da(t+15,i+h+16,p.A.ma,r),y.A.da(t+14,i+h+17,p.A.ma,r-1),y.A.ya(t,i+h+r+15,p.A.ma,16),y.A.ya(t+1,i+h+r+14,p.A.ma,15)};pa=(t,i)=>{let e=!1;const n=s.A.Do[t];if(!n.Aa)return!1;for(let t=0;ts.delay[r.Ca];)r._a-=s.delay[r.Ca]+1,r.Ca++,r.Ca>=s.Ea&&(r.Ca-=s.va,(r.Ca<0||r.Ca>=s.Ea)&&(r.Ca=0)),e=!0}}}return e};ba=(t,i,e,r,h=!1)=>{if(0!==t.type||!t.Aa||t.hide&&this.Zs!==t.id&&this.qs!==t.id&&this.Js!==t.id)return;const o=y.A.left,a=y.A.top,l=y.A.right,c=y.A.bottom;y.A.Ta(i,e,i+t.width,e+t.height);const f=t.Aa.length;for(let o=0;o0&&this.ka(c),c.type===s.A.Ma)c.Da>c.scroll-c.height&&(c.Da=c.scroll-c.height),c.Da<0&&(c.Da=0),this.ba(c,a,l,c.Da,h),c.scroll>c.height&&this.ca(a+c.width,l,c.Da,c.scroll,c.height);else if(c.type===s.A.Na){let t=0;for(let i=0;i0){let i=0,e=0;const r=c.Pa[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qs===t){const h=m.A.Ya(r,c.Ua[t]);if(0!==this.tn&&this.Qs===t&&this.$s===c.id?(i=this.Ha-this.en,e=this.Va-this.sn,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.nn<5&&(i=0,e=0),h.Ka(128,s+i,n+e)):0!==this.un&&this.dn===t&&this.wn===c.id?h.Ka(128,s,n):h.draw(s,n),33===h.Xa||1!==c.Ua[t]){const r=c.Ua[t];this.di?.ja(s+i+1,n+10+e,this.za(r),p.A.Za),this.di?.ja(s+i,n+9+e,this.za(r),p.A.qa)}}}else if(c.Ja&&t<20){const i=c.Ja[t];i?.draw(s,n)}t++}}else if(c.type===s.A.$a)c.fill?y.A.fillRect(a,l,c.width,c.height,c.Qa):y.A.Sa(a,l,c.width,c.height,c.Qa);else if(c.type===s.A.tl){const t=c.font;let i=c.Qa,e=c.text;if(this.Js!==c.id&&this.qs!==c.id&&this.Zs!==c.id||0===c.il||(i=c.il),this.ha(c)&&(i=c.el,c.sl&&c.sl.length>0&&(e=c.sl)),c.nl===s.A.rl&&this.mn&&(e='Please wait...',i=c.Qa),!t||!e)continue;for(let s=l+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),c.ol?t.al(a+(c.width/2|0),s,r,i,c.ll):t.cl(a,s,r,i,c.ll)}}else if(c.type===s.A.fl){let t;t=this.ha(c)?c.ul:c.dl,t?.draw(a,l)}else if(c.type===s.A.wl){const t=n.A.yl,i=n.A.ml;n.A.yl=a+(c.width/2|0),n.A.ml=l+(c.height/2|0);const e=n.A.sin[c.pl]*c.zoom>>16,s=n.A.cos[c.pl]*c.zoom>>16,r=this.ha(c);let h;h=r?c.Ia:c.ga;let o=null;if(-1===h)o=c.Al(-1,-1,r);else{const t=g.A.Do[h];t.frames&&t.gl&&(o=c.Al(t.frames[c.Ca],t.gl[c.Ca],r))}o&&o.Il(0,c._l,0,c.pl,0,e,s),n.A.yl=t,n.A.ml=i}else if(c.type===s.A.Cl){const t=c.font;if(!t||!c.Pa||!c.Ua)continue;let i=0;for(let e=0;e0){const n=m.A.get(c.Pa[i]-1);let r=n.name;if((n.El||1!==c.Ua[i])&&(r=r+' x'+this.vl(c.Ua[i])),!r)continue;const h=a+s*(c.Ga+115),o=l+e*(c.Wa+12);c.ol?t.al(h+(c.width/2|0),o,r,c.Qa,c.ll):t.cl(h,o,r,c.Qa,c.ll)}i++}}}y.A.Ta(o,a,l,c)};ka=t=>{let i=t.xa;if(i>=s.A.bl&&i<=s.A.Tl)i--,i>=this.Vh?(t.text='',t.nl=0):(t.text=this.eo[i],t.nl=1);else if(i>=s.A.Ol&&i<=s.A.Rl)i-=s.A.Ol,i>=this.Vh?(t.text='',t.nl=0):(0===this.no[i]?t.text='@red@Offline':this.no[i]===D.it?t.text='@gre@World-'+(this.no[i]-9):t.text='@yel@World-'+(this.no[i]-9),t.nl=1);else if(i===s.A.Sl)t.scroll=15*this.Vh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=s.A.Ll&&i<=s.A.xl)i-=s.A.Ll,i>=this.fs?(t.text='',t.nl=0):(t.text=I.A.kl(I.A.Ml(this.us[i])),t.nl=1);else if(i===s.A.Dl)t.scroll=15*this.fs+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===s.A.Nl){if(t.pl=150,t._l=256*Math.sin(this.Ft/40)&2047,this.Wh){this.Wh=!1;const i=new d.fe(7,null);let e=0;for(let t=0;t<7;t++){const s=this.Yh[t];s>=0&&(i[e++]=_.A.Do[s].Al())}const s=A.A.Fl(i,e);for(let t=0;t<5;t++)0!==this.Hh[t]&&(s.Bl(u.A.Pl[t][0],u.A.Pl[t][this.Hh[t]]),1===t&&s.Bl(u.A.Ul[0],u.A.Ul[this.Hh[t]]));if(this.xh){const i=g.A.Do[this.xh.Gl].frames;i&&(s.Wl(),s.Yl(i[0]),s.Hl(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===s.A.Vl)this.Fe||(this.Fe=t.dl,this.Be=t.ul),this.Gh?t.dl=this.Be:t.dl=this.Fe;else if(i===s.A.Kl)this.Fe||(this.Fe=t.dl,this.Be=t.ul),this.Gh?t.dl=this.Fe:t.dl=this.Be;else if(i===s.A.Xl)t.text=this.xn,this.Ft%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===s.A.jl)this.Uh?this.kn?(t.Qa=p.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Qa=p.A.La,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===s.A.zl||i===s.A.Zl)if(0===this.Dn)t.text='';else{let i;i=0===this.Nn?'earlier today':1===this.Nn?'yesterday':this.Nn+' days ago',t.text='You last logged in '+i+' from: '+I.A.ql(this.Dn)}else if(i===s.A.Jl)0===this.Bn&&(t.text='0 unread messages',t.Qa=p.A.qa),1===this.Bn&&(t.text='1 unread message',t.Qa=p.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Qa=p.A.GREEN);else if(i===s.A.$l)if(201===this.Fn)t.text='';else if(200===this.Fn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Fn?'Earlier today':1===this.Fn?'Yesterday':this.Fn+' days ago',t.text=i+' you changed your recovery questions'}else i===s.A.Ql?201===this.Fn?t.text='':200===this.Fn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===s.A.tc&&(201===this.Fn?t.text='':(this.Fn,t.text="Do this from the 'account management' area on our front webpage"))};aa=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let n=0,r=0;for(;;){const t=e[r++];if(0===t)return n;if(1===t)n+=this.Es[e[r++]];else if(2===t)n+=this.vs[e[r++]];else if(3===t)n+=this.Cs[e[r++]];else if(4===t){const t=s.A.Do[e[r++]],i=e[r++]+1;if(t.Pa&&t.Ua)for(let e=0;et<999999999?String(t):'*';vl=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};za=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,e)=>{e.d(i,{w:()=>h});var s=e(7046),n=e(1651),r=e(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');['0','998','999'].includes(s.A.getParameter('world'))?function(){if(+s.A.getParameter('world')>=998)return void(n.K.nt='data/pack/client');n.K.st='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0}():await async function(t){const i=await o(t,parseInt(s.A.getParameter('world'),10)),e=new URL(i.address);n.K.it=10+i.id-1,n.K.st=`${e.protocol}//${e.hostname}`,n.K.nt=`${e.protocol}//${e.hostname}:${e.port}`,t||(n.K.st=n.K.st.replace('https:','http:'));n.K.portOffset=i.portOffset,n.K.members=!0===i?.members,s.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===s.A.getParameter('detail').length&&s.A.setParameter('detail','high');'low'===s.A.getParameter('detail')?n.K.St():n.K.Rt()}(),0===s.A.getParameter('method').length&&s.A.setParameter('method','0')}async function o(t,i,e=0){if(e>=10)throw new Error('could not find world to connect!');const s=t?'https:':'http:';let n;try{n=JSON.parse(await(0,r.ec)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.$o)(1e3),o(t,i,++e)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hh:0});const h=n.find((t=>t.id===i));return h||o(t,i,10)}},7046:(t,i,e)=>{e.d(i,{A:()=>l});var s=e(1183),n=e(4583),r=e(9234),h=e(9091),o=e(2595),a=e(7854);class l{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}sc=0;nc=[];rc=0;Fo=null;state=0;hc=20;oc=1;ac=[];lc=0;cc=0;fc=[];uc=!0;dc=!1;wc=50;hasFocus=!0;yc=!1;mc=0;Ac=0;Ha=0;Va=0;gc=0;Ic=0;_c=0;Cc=[];Ec=[];vc=0;bc=0;input=null;Tc=!1;Oc=!1;Rc=!1;time=-1;Sc=0;Lc=0;xc=0;kc=0;Mc=0;Dc=0;constructor(t=!1){a.Nc.tabIndex=-1,a.na.fillStyle='black',a.na.fillRect(0,0,a.Nc.width,a.Nc.height),this.dc=t,this.dc?this.resize(window.innerWidth,window.innerHeight):this.resize(a.Nc.width,a.Nc.height)}get width(){return a.Nc.width}get height(){return a.Nc.height}resize=(t,i)=>{a.Nc.width=t,a.Nc.height=i,this.Fo=new s.A(t,i),n.A.Fc()};run=async()=>{a.Nc.addEventListener('resize',(()=>{this.dc&&this.resize(window.innerWidth,window.innerHeight)}),!1),a.Nc.onmousedown=this.onmousedown,a.Nc.onmouseup=this.onmouseup,a.Nc.onmouseenter=this.onmouseenter,a.Nc.onmouseleave=this.onmouseleave,a.Nc.onmousemove=this.onmousemove,window.onbeforeunload=this.So,a.Nc.onfocus=this.onfocus,a.Nc.onblur=this.onblur,this.Bc?(a.Nc.ontouchstart=this.ontouchstart,a.Nc.ontouchend=this.ontouchend,a.Nc.ontouchmove=this.ontouchmove):(a.Nc.onkeydown=this.onkeydown,a.Nc.onkeyup=this.onkeyup),a.Nc.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Bc&&'low'===l.getParameter('detail')&&(this.wc=30),await this.qo(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.ac[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.Pc();const h=e,o=s;e=300,s=1,t=performance.now();const a=this.ac[i];if(0===a?(e=h,s=o):t>a&&(e=2560*this.hc/(t-a)|0),e<25?e=25:e>256&&(e=256,s=this.hc-(t-a)/10|0),this.ac[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.ac[t]&&(this.ac[t]+=s);for(s0&&(this.lc=1e3*e/(256*this.hc)|0);const l=performance.now();if(this.uc&&this.refresh(),await this.draw(),this.fc[this.cc]=(performance.now()-l)/1e3,this.cc=(this.cc+1)%this.fc.length,this.wc<50){const i=1e3/this.wc-(performance.now()-t);i>0&&await(0,r.$o)(i)}}-1===this.state&&this.Pc()};Pc=()=>{this.state=-2,this.So()};ra=t=>{this.hc=1e3/t|0};Uc=t=>{this.wc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.hc|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};So=()=>{};draw=async()=>{};refresh=()=>{};async qo(t,i){const e=this.width,s=this.height;this.uc&&(a.na.fillStyle='black',a.na.fillRect(0,0,e,s),this.uc=!1);const n=s/2-18;a.na.fillStyle='rgb(140, 17, 17)',a.na.rect((e/2|0)-152,n,304,34),a.na.fillRect((e/2|0)-150,n+2,3*t,30),a.na.fillStyle='black',a.na.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),a.na.font='bold 13px helvetica, sans-serif',a.na.textAlign='center',a.na.fillStyle='white',a.na.fillText(i,e/2|0,n+22),await(0,r.$o)(5)}Gc=()=>{let t=-1;return this.bc!==this.vc&&(t=this.Ec[this.vc],this.vc=this.vc+1&127),t};get ms(){const t=this.fc.length;let i=0;for(let e=0;ethis.sc&&(this.sc=e),this.nc[this.rc]=e,this.rc=(this.rc+1)%250,e}get Wc(){return this.nc.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.mc=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Cc[n]=1),n>4&&(this.Ec[this.bc]=n,this.bc=this.bc+1&127),o.A.enabled&&o.A.Yc(n),h.g.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.mc=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Cc[n]=0),o.A.enabled&&o.A.Hc(n),h.g.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.Tc=!1,(t.clientX>0||t.clientY>0)&&this.Vc(t),this.mc=0,this.Ic=this.Ha,this._c=this.Va,this.Bc&&!this.Kc){if(this.Xc()||this.jc()||this.zc())return this.gc=1,void(this.Ac=1);t.timeStamp>=this.time+500?(this.gc=2,this.Ac=2):(this.gc=1,this.Ac=1)}else 2===t.button?(this.gc=2,this.Ac=2):(this.gc=1,this.Ac=1);o.A.enabled&&o.A.Zc(this.Ic,this._c,t.buttons)};onmouseup=t=>{this.Vc(t),this.mc=0,this.Ac=0,o.A.enabled&&o.A.qc(t.buttons)};onmouseenter=t=>{this.Vc(t),o.A.enabled&&o.A.Jc()};onmouseleave=t=>{this.Vc(t),this.mc=0,this.Ha=-1,this.Va=-1,this.Ac=0,this.Ic=-1,this._c=-1,o.A.enabled&&o.A.$c()};onmousemove=t=>{this.Vc(t),this.mc=0,o.A.enabled&&o.A.Qc(this.Ha,this.Va)};onfocus=t=>{this.hasFocus=!0,this.uc=!0,this.refresh(),o.A.enabled&&o.A.tf()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.if()};ontouchstart=t=>{if(!this.Bc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.Tc=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Sc=this.Mc=this.xc=0|i.screenX,this.Lc=this.Dc=this.kc=0|i.screenY,this.time=t.timeStamp,this.Oc=this.ef(),this.Rc=this.sf()};ontouchend=t=>{if(!this.Bc||!this.Tc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Mc=0|i.screenX,this.Dc=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Oc&&!this.ef())return void(this.Tc=!1);if(this.Rc&&!this.sf())return void(this.Tc=!1);if(this.Xc()||this.nf()||this.jc()||this.zc()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.jc()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.zc()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Xc()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.nf()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.rf?t.setAttribute('type','password'):t.setAttribute('type',this.zc()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.rf&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.rf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.rf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.Tc=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.Sc-this.Mc)>16||Math.abs(this.Lc-this.Dc)>16;n&&!r?(this.Tc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.Ac=0,this.Tc=!1)};ontouchmove=t=>{if(!this.Bc||!this.Tc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Mc=0|i.screenX,this.Dc=0|i.screenY,this.Oc&&-1===this.Wo()?(this.xc-this.Mc>0?this.rotate(2):this.xc-this.Mc<0&&this.rotate(0),this.kc-this.Dc>0?this.rotate(3):this.kc-this.Dc<0&&this.rotate(1)):(this.Rc||-1!==this.Wo())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.xc=this.Mc,this.kc=this.Dc};get Bc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get rf(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Kc(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}ef=()=>this.yc&&this.Ha>=8&&this.Ha<=520&&this.Va>=11&&this.Va<=345;Xc=()=>this.yc&&-1===this.Go()&&!this.Po()&&!this.Uo()&&this.Ha>=11&&this.Ha<=506&&this.Va>=449&&this.Va<=482;nf=()=>this.yc&&(this.Po()||this.Uo())&&this.Ha>=11&&this.Ha<=506&&this.Va>=383&&this.Va<=482;sf=()=>this.yc&&this.Ha>=562&&this.Ha<=752&&this.Va>=231&&this.Va<=492;jc=()=>!this.yc&&2===this.Bo()&&this.Ha>=301&&this.Ha<=562&&this.Va>=262&&this.Va<=279;zc=()=>!this.yc&&2===this.Bo()&&this.Ha>=301&&this.Ha<=562&&this.Va>=279&&this.Va<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};hf=()=>null!==document.fullscreenElement;Vc=t=>{if(this.hf()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/a.Nc.height,s=(window.innerWidth-a.Nc.width*e)/2;this.Ha=0|this.af(t.clientX-i.left-s,0,a.Nc.width*e,0,789),this.Va=0|this.af(t.clientY-i.top,0,a.Nc.height*e,0,532)}else{const i=a.Nc.getBoundingClientRect(),e=a.Nc.width/i.width,s=a.Nc.height/i.height;this.Ha=(t.clientX-i.left)*e|0,this.Va=(t.clientY-i.top)*s|0}this.Ha<0&&(this.Ha=0),this.Va<0&&(this.Va=0),this.Ha>789&&(this.Ha=789),this.Va>532&&(this.Va=532)};af=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}},2595:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static enabled=!1;static lf=null;static cf=null;static ff=0;static uf=0;static df=0;static wf=0;static yf=0;static mf=()=>{this.lf=s.A.Pt(1),this.cf=null,this.ff=performance.now(),this.enabled=!0};static pf=()=>{this.enabled=!1,this.lf=null};static flush=()=>{let t=null;return this.cf&&this.enabled&&(t=this.cf),this.cf=null,t};static stop=()=>{let t=null;return this.lf&&this.lf.Af>0&&this.enabled&&(t=this.lf),this.pf(),t};static Zc=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.uf++;const s=performance.now();let n=(s-this.ff)/10|0;n>250&&(n=250),this.ff=s,this.gf(5),1===e?this.lf?.p1(1):this.lf?.p1(2),this.lf?.p1(n),this.lf?.p3(t+(i<<10))};static qc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,this.gf(2),1===t?this.lf?.p1(3):this.lf?.p1(4),this.lf?.p1(e)};static Qc=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.df>=50){this.df=e,this.uf++;let s=(e-this.ff)/10|0;s>250&&(s=250),this.ff=e,t-this.wf<8&&t-this.wf>=-8&&i-this.yf<8&&i-this.yf>=-8?(this.gf(3),this.lf?.p1(5),this.lf?.p1(s),this.lf?.p1(t+(i-this.yf+8<<4)+8-this.wf)):t-this.wf<128&&t-this.wf>=-128&&i-this.yf<128&&i-this.yf>=-128?(this.gf(4),this.lf?.p1(6),this.lf?.p1(s),this.lf?.p1(t+128-this.wf),this.lf?.p1(i+128-this.yf)):(this.gf(5),this.lf?.p1(7),this.lf?.p1(s),this.lf?.p3(t+(i<<10))),this.wf=t,this.yf=i}};static Yc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.gf(3),this.lf?.p1(8),this.lf?.p1(e),this.lf?.p1(t)};static Hc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.gf(3),this.lf?.p1(9),this.lf?.p1(e),this.lf?.p1(t)};static tf=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.lf?.p1(10),this.lf?.p1(i)};static if=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.lf?.p1(11),this.lf?.p1(i)};static Jc=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.lf?.p1(12),this.lf?.p1(i)};static $c=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.lf?.p1(13),this.lf?.p1(i)};static gf=t=>{if(this.lf&&this.lf.Af+t>=500){const t=this.lf;this.lf=s.A.Pt(1),this.cf=t}}}},9091:(t,i,e)=>{e.d(i,{c:()=>n,g:()=>s});const s=['F11','F12'],n={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}}},1120:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1069),n=e(8665),r=e(2679),h=e(2511),o=e(3819),a=e(3867),l=e(8950);class c{static Do=[];static If=null;static No=null;static Ma=0;static _f=1;static Na=2;static $a=3;static tl=4;static fl=5;static wl=6;static Cl=7;static Cf=1;static Ef=2;static vf=3;static bf=4;static Tf=5;static rl=6;static bl=1;static Tl=100;static Ol=101;static Rl=200;static Of=201;static Rf=202;static Sl=203;static Sf=205;static Lf=300;static xf=301;static kf=302;static Mf=303;static Df=304;static Nf=305;static Ff=306;static Bf=307;static Pf=308;static Uf=309;static Gf=310;static Wf=311;static Yf=312;static Hf=313;static Vf=314;static Kf=315;static Xf=316;static jf=317;static zf=318;static Zf=319;static qf=320;static Jf=321;static $f=322;static Qf=323;static Vl=324;static Kl=325;static tu=326;static Nl=327;static Ll=401;static xl=500;static iu=501;static eu=502;static Dl=503;static Xl=600;static su=601;static nu=602;static ru=603;static hu=604;static ou=605;static au=606;static lu=607;static cu=608;static fu=609;static uu=610;static du=611;static wu=612;static jl=613;static zl=650;static Jl=651;static $l=652;static Ql=653;static tc=654;static Zl=655;static yu=(t,i,e)=>{this.If=new r.A(5e4),this.No=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.Af+=2;n.Af0){s.oa=new Uint8Array(r),s.la=new Uint16Array(r);for(let t=0;t0){s.scripts=new a.fe(o,null);for(let t=0;t0){const n=e.lastIndexOf(',');s.Ja[t]=this.vu(i,e.substring(0,n),parseInt(e.substring(n+1),10))}}s.bu=new a.fe(5,null);for(let t=0;t<5;t++){const i=n.Eu;s.bu[t]=i,0===i.length&&(s.bu[t]=null)}}if(s.type===c.$a&&(s.fill=1===n.Au),s.type===c.tl||s.type===c._f){s.ol=1===n.Au;const t=n.Au;e&&(s.font=e[t]),s.ll=1===n.Au}if(s.type===c.tl&&(s.text=n.Eu,s.sl=n.Eu),s.type!==c._f&&s.type!==c.$a&&s.type!==c.tl||(s.Qa=n.ia),s.type!==c.$a&&s.type!==c.tl||(s.el=n.ia,s.il=n.ia),s.type===c.fl){const t=n.Eu;if(t.length>0){const e=t.lastIndexOf(',');s.dl=this.vu(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=n.Eu;if(e.length>0){const t=e.lastIndexOf(',');s.ul=this.vu(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(s.type===c.wl){const t=n.Au;0!==t&&(s.model=this.Al((t-1<<8)+n.Au));const i=n.Au;0!==i&&(s.Tu=this.Al((i-1<<8)+n.Au)),s.ga=n.Au,0===s.ga?s.ga=-1:s.ga=(s.ga-1<<8)+n.Au,s.Ia=n.Au,0===s.Ia?s.Ia=-1:s.Ia=(s.Ia-1<<8)+n.Au,s.zoom=n.mu,s.pl=n.mu,s._l=n.mu}if(s.type===c.Cl){s.Pa=new Int32Array(s.width*s.height),s.Ua=new Int32Array(s.width*s.height),s.ol=1===n.Au;const t=n.Au;e&&(s.font=e[t]),s.ll=1===n.Au,s.Qa=n.ia,s.Ga=n.Iu,s.Wa=n.Iu,s._u=1===n.Au,s.bu=new a.fe(5,null);for(let t=0;t<5;t++){const i=n.Eu;s.bu[t]=i,0===i.length&&(s.bu[t]=null)}}s.nl!==c.Ef&&s.type!==c.Na||(s.Ou=n.Eu,s.action=n.Eu,s.Ru=n.mu),s.nl!==c.Cf&&s.nl!==c.bf&&s.nl!==c.Tf&&s.nl!==c.rl||(s.Su=n.Eu,0===s.Su.length&&(s.nl===c.Cf?s.Su='Ok':s.nl===c.bf||s.nl===c.Tf?s.Su='Select':s.nl===c.rl&&(s.Su='Continue')))}this.If=null,this.No=null};static vu=(t,i,e)=>{const s=o.A.Lu(i)<<8n|BigInt(e);if(this.If){const t=this.If.get(s);if(t)return t}let n;try{n=h.A.xu(t,i,e),this.If?.put(s,n)}catch(t){return null}return n};static Al=t=>{if(this.No){const i=this.No.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.No?.put(BigInt(t),i),i};id=-1;pu=-1;type=-1;nl=-1;xa=0;width=0;height=0;gu=-1;oa=null;la=null;scripts=null;scroll=0;hide=!1;draggable=!1;_u=!1;Cu=!1;Ga=0;Wa=0;Fa=null;Ba=null;Ja=null;bu=null;fill=!1;ol=!1;font=null;ll=!1;text=null;sl=null;Qa=0;el=0;il=0;dl=null;ul=null;model=null;Tu=null;ga=-1;Ia=-1;zoom=0;pl=0;_l=0;Ou=null;action=null;Ru=-1;Su=null;Aa=null;Oa=null;Ra=null;x=0;y=0;Da=0;Pa=null;Ua=null;Ca=0;_a=0;Al(t,i,e){let s=this.model;if(e&&(s=this.Tu),!s)return null;if(-1===t&&-1===i&&!s.ku)return s;const r=n.A.Mu(s,!0,!0,!1);return-1===t&&-1===i||r.Wl(),-1!==t&&r.Yl(t),-1!==i&&r.Yl(i),r.Hl(64,768,-50,-10,-50,!0),r}Du(){if(this.pu===this.id)return this.x;let t=c.Do[this.pu];if(!t.Aa||!t.Oa||!t.Ra)return this.x;let i=t.Aa.indexOf(this.id);if(-1===i)return this.x;let e=t.Oa[i];for(;t.pu!==t.id;){const s=c.Do[t.pu];s.Aa&&s.Oa&&s.Ra&&(i=s.Aa.indexOf(t.id),-1!==i&&(e+=s.Oa[i])),t=s}return e}Nu(){if(this.pu===this.id)return this.y;let t=c.Do[this.pu];if(!t.Aa||!t.Oa||!t.Ra)return this.y;let i=t.Aa.indexOf(this.id);if(-1===i)return this.y;let e=t.Ra[i];for(;t.pu!==t.id;){const s=c.Do[t.pu];s.Aa&&s.Oa&&s.Ra&&(i=s.Aa.indexOf(t.id),-1!==i&&(e+=s.Ra[i])),t=s}return e}outline(t){const i=this.Du(),e=this.Nu();l.A.Sa(i,e,this.width,this.height,t)}move(t,i){if(this.pu===this.id)return;this.x=0,this.y=0;const e=c.Do[this.pu];if(e.Aa&&e.Oa&&e.Ra){const s=e.Aa.indexOf(this.id);-1!==s&&(e.Oa[s]=t,e.Ra[s]=i)}}delete(){if(this.pu===this.id)return;const t=c.Do[this.pu];if(t.Aa&&t.Oa&&t.Ra){const i=t.Aa.indexOf(this.id);-1!==i&&(t.Aa.splice(i,1),t.Oa.splice(i,1),t.Ra.splice(i,1))}}}},6333:(t,i,e)=>{e.d(i,{$:()=>s});class s{id;Fu=null;constructor(t){this.id=t}Bu(t){for(;;){const i=t.Au;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(6333);class r extends n.${static count=0;static Do=[];static yu=t=>{const i=new s.A(t.read('flo.dat'));this.count=i.mu;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static Uu=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static Gu=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);Wu=0;texture=-1;Yu=!1;Hu=!0;Vu=0;Ku=0;Xu=0;ju=0;zu=0;Zu=0;decode(t,i){1===t?(this.Wu=i.qu,this.setColor(this.Wu)):2===t?this.texture=i.Au:3===t?this.Yu=!0:5===t?this.Hu=!1:6===t?this.Fu=i.Eu:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(h=e),s>h&&(h=s);let o=0,a=0;const l=(n+h)/2;n!==h&&(l<.5&&(a=(h-n)/(h+n)),l>=.5&&(a=(h-n)/(2-h-n)),i===h?o=(e-s)/(h-n):e===h?o=(s-i)/(h-n)+2:s===h&&(o=(i-e)/(h-n)+4)),o/=6,this.Vu=256*o|0,this.Ku=256*a|0,this.Xu=256*l|0,this.Ku<0?this.Ku=0:this.Ku>255&&(this.Ku=255),this.Xu<0?this.Xu=0:this.Xu>255&&(this.Xu=255),this.ju=l>.5?(1-l)*a*512|0:l*a*512|0,this.ju<1&&(this.ju=1),this.zu=o*this.ju|0;let c=this.Vu+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.Ku+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.Xu+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.Zu=r.Pu(c,f,u)}}},8317:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(1069),n=e(6333),r=e(8665),h=e(3867);class o extends n.${static count=0;static Do=[];static yu=t=>{const i=new s.A(t.read('idk.dat'));this.count=i.mu;for(let t=0;t=40&&t<50?this.Qu[t-40]=i.mu:t>=50&&t<60?this.td[t-50]=i.mu:t>=60&&t<70?this.$u[t-60]=i.mu:console.log('Error unrecognised config code: ',t)}Al(){if(!this.Ju)return null;const t=new h.fe(this.Ju.length,null);for(let i=0;i{e.d(i,{A:()=>c});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(1023),a=e(6169),l=e(3867);class c extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static hd=new r.A(500);static od=new r.A(30);static yu=t=>{this.sd=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.mu,this.nd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%10;const i=this.cache[this.rd];return this.sd.Af=this.nd[t],i.id=t,i.reset(),i.Bu(this.sd),i.ad||(i.ad=new Int32Array(1)),-1===i.ld&&i.ad&&(i.active=i.ad.length>0&&i.ad[0]===o.A.fd.id,i.ud&&(i.active=!0)),i};static So=()=>{this.hd=null,this.od=null,this.nd=null,this.cache=null,this.sd=null};Ju=null;ad=null;name=null;dd=null;Qu=null;td=null;width=1;length=1;wd=!0;yd=!0;active=!1;ld=-1;md=!1;pd=!1;Hu=!1;ga=-1;Ad=!1;gd=16;Id=0;_d=0;ud=null;Cd=-1;Ed=-1;vd=!1;bd=!0;Td=128;Od=128;Rd=128;Sd=0;Ld=0;xd=0;kd=0;Md=!1;decode(t,i){if(1===t){const t=i.Au;this.Ju=new Int32Array(t),this.ad=new Int32Array(t);for(let e=0;e=30&&t<39)this.ud||(this.ud=new l.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(40===t){const t=i.Au;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e=this.Ju.length)return null;let d=this.Ju[l];if(-1===d)return null;const w=this.vd!==i>3;w&&(d+=65536);let y=c.hd?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.Wd(),c.hd?.put(BigInt(d),y));const m=128!==this.Td||128!==this.Od||128!==this.Rd,p=0!==this.Ld||0!==this.xd||0!==this.kd;let A=h.A.Mu(y,!this.Qu,!this.Ad,i===a.A.Yd&&-1===o&&!m&&!p);for(-1!==o&&(A.Wl(),A.Yl(o),A.Hd=null,A.Vd=null);i-- >0;)A.Kd();if(this.Qu&&this.td)for(let t=0;t{e.d(i,{A:()=>n});var s=e(6333);class n extends s.${static count=0;static Do=[];static yu=t=>{this.count=t.mu;for(let i=0;i=1&&t<5?this.zd[t-1]=i.mu:250===t?this.Fu=i.Eu:console.log('Error unrecognised mesanim config code: ',t)}}},6948:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(3867);class a extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static No=new r.A(30);static yu=t=>{this.sd=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.mu,this.nd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%20;const i=this.cache[this.rd]=new a(t);return this.sd.Af=this.nd[t],i.Bu(this.sd),i};static So=()=>{this.No=null,this.nd=null,this.cache=null,this.sd=null};name=null;dd=null;size=1;Ju=null;$u=null;Ad=!1;Zd=-1;qd=-1;Jd=-1;$d=-1;Qd=-1;Qu=null;td=null;ud=null;Td=-1;Od=-1;Rd=-1;tw=!0;iw=-1;ew=128;sw=128;decode(t,i){if(1===t){const t=i.Au;this.Ju=new Uint16Array(t);for(let e=0;e=30&&t<40)this.ud||(this.ud=new o.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(40===t){const t=i.Au;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e{e.d(i,{A:()=>u});var s=e(6333),n=e(1069),r=e(2511),h=e(2679),o=e(8665),a=e(4583),l=e(8950),c=e(9298),f=e(3867);class u extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static lw=!0;static No=new h.A(50);static cw=new h.A(200);static yu=(t,i)=>{this.lw=i,this.sd=new n.A(t.read('obj.dat'));const e=new n.A(t.read('obj.idx'));this.count=e.mu,this.nd=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%10;const i=this.cache[this.rd];return this.sd.Af=this.nd[t],i.id=t,i.reset(),i.Bu(this.sd),-1!==i.fw&&i.uw(),!this.lw&&i.members&&(i.name='Members Object',i.dd="Login to a members' server to use this object.",i.ud=null,i.dw=null),i};static So=()=>{this.No=null,this.cw=null,this.nd=null,this.cache=null,this.sd=null};static Ya=(t,i)=>{if(u.cw){let e=u.cw.get(BigInt(t));if(e&&e.ww!==i&&-1!==e.ww&&(e.yw(),e=null),e)return e}let e=u.get(t);if(e.mw||(i=-1),e.mw&&e.pw&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.pw[s]&&0!==e.pw[s]&&(t=e.mw[s]);-1!==t&&(e=u.get(t))}const s=new r.A(32,32),n=a.A.yl,h=a.A.ml,o=a.A.Aw,f=l.A.gw,d=l.A.Iw,w=l.A._w,y=l.A.left,m=l.A.right,p=l.A.top,A=l.A.bottom;a.A.Cw=!1,l.A.bind(s.gw,32,32),l.A.fillRect(0,0,32,32,c.A.Za),a.A.Fc();const g=e.Ew(1),I=a.A.sin[e.bw]*e.Tw>>16,_=a.A.cos[e.bw]*e.Tw>>16;g.Il(0,e.Ow,e.Rw,e.bw,e.Sw,I+(g.jd/2|0)+e.Lw,_+e.Lw);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.gw[t+32*i]&&(t>0&&s.gw[t+32*i-1]>1||i>0&&s.gw[t+32*(i-1)]>1||t<31&&s.gw[t+32*i+1]>1||i<31&&s.gw[t+32*(i+1)]>1)&&(s.gw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.gw[t+32*i]&&t>0&&i>0&&s.gw[t+32*(i-1)-1]>0&&(s.gw[t+32*i]=3153952);if(-1!==e.fw){const t=this.Ya(e.xw,10),i=t.Xa,s=t.ww;t.Xa=32,t.ww=32,t.kw(5,5,22,22),t.Xa=i,t.ww=s}return u.cw?.put(BigInt(t),s),l.A.bind(f,d,w),l.A.Ta(y,p,m,A),a.A.yl=n,a.A.ml=h,a.A.Aw=o,a.A.Cw=!0,e.El?s.Xa=33:s.Xa=32,s.ww=i,s};model=0;name=null;dd=null;Qu=null;td=null;Tw=2e3;bw=0;Ow=0;Rw=0;Sw=0;Lw=0;Mw=!1;Dw=-1;El=!1;Nw=1;members=!1;ud=null;dw=null;Fw=-1;Bw=-1;Pw=0;Uw=-1;Gw=-1;Ww=0;Yw=-1;Hw=-1;Vw=-1;Kw=-1;Xw=-1;jw=-1;mw=null;pw=null;xw=-1;fw=-1;decode(t,i){if(1===t)this.model=i.mu;else if(2===t)this.name=i.Eu;else if(3===t)this.dd=i.Eu;else if(4===t)this.Tw=i.mu;else if(5===t)this.bw=i.mu;else if(6===t)this.Ow=i.mu;else if(7===t)this.Sw=i.Iu,this.Sw>32767&&(this.Sw-=65536);else if(8===t)this.Lw=i.Iu,this.Lw>32767&&(this.Lw-=65536);else if(9===t)this.Mw=!0;else if(10===t)this.Dw=i.mu;else if(11===t)this.El=!0;else if(12===t)this.Nw=i.ia;else if(16===t)this.members=!0;else if(23===t)this.Fw=i.mu,this.Pw=i.Dd;else if(24===t)this.Bw=i.mu;else if(25===t)this.Uw=i.mu,this.Ww=i.Dd;else if(26===t)this.Gw=i.mu;else if(t>=30&&t<35)this.ud||(this.ud=new f.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(t>=35&&t<40)this.dw||(this.dw=new f.fe(5,null)),this.dw[t-35]=i.Eu;else if(40===t){const t=i.Au;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.mw&&this.pw||(this.mw=new Uint16Array(10),this.pw=new Uint16Array(10)),this.mw[t-100]=i.mu,this.pw[t-100]=i.mu)}zw(t){let i=this.Fw;if(1===t&&(i=this.Uw),-1===i)return null;let e=this.Bw,s=this.Yw;1===t&&(e=this.Gw,s=this.Hw);let n=o.A.model(i);if(-1!==e){const t=o.A.model(e);if(-1===s){const i=[n,t];n=o.A.Fl(i,2)}else{const i=[n,t,o.A.model(s)];n=o.A.Fl(i,3)}}if(0===t&&0!==this.Pw&&n.translate(this.Pw,0,0),1===t&&0!==this.Ww&&n.translate(this.Ww,0,0),this.Qu&&this.td)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.pw[e]&&0!==this.pw[e]&&(i=this.mw[e]);if(-1!==i)return u.get(i).Ew(1)}if(u.No){const t=u.No.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.Qu&&this.td)for(let t=0;t{e.d(i,{A:()=>h});var s=e(6333),n=e(1069),r=e(6730);class h extends s.${static count=0;static Do=[];static yu=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.mu;for(let t=0;t{e.d(i,{A:()=>a});var s=e(6333),n=e(1069),r=e(1312),h=e(8665),o=e(2679);class a extends s.${static count=0;static Do=[];static No=new o.A(30);static yu=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.mu;for(let t=0;t=40&&t<50?this.Qu[t-40]=i.mu:t>=50&&t<60?this.td[t-50]=i.mu:console.log('Error unrecognised spotanim config code: ',t)}Al(){let t=a.No?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let i=0;i<6;i++)0!==this.Qu[0]&&t.Bl(this.Qu[i],this.td[i]);return a.No?.put(BigInt(this.id),t),t}}},3764:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(6333),n=e(1069);class r extends s.${static count=0;static Do=[];static iy=[];static ey=0;static yu=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.mu;for(let t=0;t{e.d(i,{A:()=>s});class s{static OPEN=0;static uy=1;static wy=2;static yy=4;static my=8;static py=s.uy<<4;static Ay=s.wy<<4;static gy=s.yy<<4;static Iy=s.my<<4;static _y=256;static Cy=512;static Ey=1024;static vy=2048;static by=4096;static Ty=s.Cy<<4;static Oy=s.Ey<<4;static Ry=s.vy<<4;static Sy=s.by<<4;static Ly=s._y<<9;static xy=524288;static ky=2097152;static My=s.ky|s.xy;static Dy=s._y|s.My;static Ny=s.wy|s.Dy;static Fy=s.my|s.Dy;static By=s.wy|s.yy|s.Fy;static Py=s.Ay|s.Dy;static Uy=s.my|s.py|s.Py;static Gy=s.Iy|s.Dy;static Wy=s.uy|s.wy|s.Gy;static Yy=s.Ay|s.gy|s.Gy;static Hy=16777215}},670:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(9456),n=e(6169),r=e(1023),h=e(4909);class o{static Dr=4;static jr=104;static index=(t,i)=>t*o.jr+i;offsetX;Vy;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Vy=0,this.sizeX=o.jr,this.sizeZ=o.jr,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.Vy)]|=s.A.ky};Xy=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.Vy)]&=~s.A.ky};jy=(t,i,e,r,h,o)=>{let a=s.A._y;o&&(a|=s.A.Ly);const l=t-this.offsetX,c=i-this.Vy;if(h===n.A.zy||h===n.A.Zy){const t=e;e=r,r=t}for(let t=l;t=0&&t=0&&i{let a=s.A._y;o&&(a|=s.A.Ly);const l=t-this.offsetX,c=i-this.Vy;if(h===n.A.zy||h===n.A.Zy){const t=e;e=r,r=t}for(let t=l;t=0&&t=0&&i{const a=t-this.offsetX,l=i-this.Vy,c=o?s.A.Sy:s.A.Iy,f=o?s.A.by:s.A.my,u=o?s.A.Ey:s.A.wy,d=o?s.A.Oy:s.A.Ay,w=o?s.A.Cy:s.A.uy,y=o?s.A.Ty:s.A.py,m=o?s.A.vy:s.A.yy,p=o?s.A.Ry:s.A.gy;e===r.A.$y.id?h===n.A.Yd?(this.add(a,l,c),this.add(a-1,l,f)):h===n.A.zy?(this.add(a,l,u),this.add(a,l+1,d)):h===n.A.Qy?(this.add(a,l,f),this.add(a+1,l,c)):h===n.A.Zy&&(this.add(a,l,d),this.add(a,l-1,u)):e===r.A.tm.id||e===r.A.im.id?h===n.A.Yd?(this.add(a,l,w),this.add(a-1,l+1,y)):h===n.A.zy?(this.add(a,l,m),this.add(a+1,l+1,p)):h===n.A.Qy?(this.add(a,l,y),this.add(a+1,l-1,w)):h===n.A.Zy&&(this.add(a,l,p),this.add(a-1,l-1,m)):e===r.A.sm.id&&(h===n.A.Yd?(this.add(a,l,u|c),this.add(a-1,l,f),this.add(a,l+1,d)):h===n.A.zy?(this.add(a,l,u|f),this.add(a,l+1,d),this.add(a+1,l,c)):h===n.A.Qy?(this.add(a,l,d|f),this.add(a+1,l,c),this.add(a,l-1,u)):h===n.A.Zy&&(this.add(a,l,d|c),this.add(a,l-1,u),this.add(a-1,l,f))),o&&this.Jy(t,i,e,h,!1)};nm=(t,i,e,h,o)=>{const a=t-this.offsetX,l=i-this.Vy,c=o?s.A.Sy:s.A.Iy,f=o?s.A.by:s.A.my,u=o?s.A.Ey:s.A.wy,d=o?s.A.Oy:s.A.Ay,w=o?s.A.Cy:s.A.uy,y=o?s.A.Ty:s.A.py,m=o?s.A.vy:s.A.yy,p=o?s.A.Ry:s.A.gy;e===r.A.$y.id?h===n.A.Yd?(this.remove(a,l,c),this.remove(a-1,l,f)):h===n.A.zy?(this.remove(a,l,u),this.remove(a,l+1,d)):h===n.A.Qy?(this.remove(a,l,f),this.remove(a+1,l,c)):h===n.A.Zy&&(this.remove(a,l,d),this.remove(a,l-1,u)):e===r.A.tm.id||e===r.A.im.id?h===n.A.Yd?(this.remove(a,l,w),this.remove(a-1,l+1,y)):h===n.A.zy?(this.remove(a,l,m),this.remove(a+1,l+1,p)):h===n.A.Qy?(this.remove(a,l,y),this.remove(a+1,l-1,w)):h===n.A.Zy&&(this.remove(a,l,p),this.remove(a-1,l-1,m)):e===r.A.sm.id&&(h===n.A.Yd?(this.remove(a,l,u|c),this.remove(a-1,l,f),this.remove(a,l+1,d)):h===n.A.zy?(this.remove(a,l,u|f),this.remove(a,l+1,d),this.remove(a+1,l,c)):h===n.A.Qy?(this.remove(a,l,d|f),this.remove(a+1,l,c),this.remove(a,l-1,u)):h===n.A.Zy&&(this.remove(a,l,d|c),this.remove(a,l-1,u),this.remove(a-1,l,f))),o&&this.nm(t,i,e,h,!1)};rm=(t,i,e,h,a,l)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Vy,u=e-this.offsetX,d=h-this.Vy,w=o.index(c,f);if(a===r.A.$y.id){if(l===n.A.Yd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Py)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0}else if(l===n.A.zy){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Fy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Gy)===s.A.OPEN)return!0}else if(l===n.A.Qy){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Py)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0}else if(l===n.A.Zy){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Fy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Gy)===s.A.OPEN)return!0}}else if(a===r.A.sm.id){if(l===n.A.Yd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Gy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0}else if(l===n.A.zy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Fy)===s.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0}else if(l===n.A.Qy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Fy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Py)===s.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(l===n.A.Zy){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Py)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Gy)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(a===r.A.hm.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.wy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.my)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Iy)===s.A.OPEN)return!0}return!1};om=(t,i,e,h,a,l)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Vy,u=e-this.offsetX,d=h-this.Vy,w=o.index(c,f);if(a===r.A.am.id||a===r.A.lm.id){if(a===r.A.lm.id&&(l=l+2&3),l===n.A.Yd){if(c===u+1&&f===d&&(this.flags[w]&s.A.Iy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.wy)===s.A.OPEN)return!0}else if(l===n.A.zy){if(c===u-1&&f===d&&(this.flags[w]&s.A.my)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.wy)===s.A.OPEN)return!0}else if(l===n.A.Qy){if(c===u-1&&f===d&&(this.flags[w]&s.A.my)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0}else if(l===n.A.Zy){if(c===u+1&&f===d&&(this.flags[w]&s.A.Iy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0}}else if(a===r.A.fm.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.wy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.my)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Iy)===s.A.OPEN)return!0}return!1};um=(t,i,e,n,r,a,l)=>{const c=e+r-1,f=n+a-1,u=o.index(t-this.offsetX,i-this.Vy);return t>=e&&t<=c&&i>=n&&i<=f||(t===e-1&&i>=n&&i<=f&&(this.flags[u]&s.A.my)===s.A.OPEN&&(l&h.A.Yd)===s.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&s.A.Iy)===s.A.OPEN&&(l&h.A.Qy)===s.A.OPEN||(i===n-1&&t>=e&&t<=c&&(this.flags[u]&s.A.wy)===s.A.OPEN&&(l&h.A.Zy)===s.A.OPEN||i===f+1&&t>=e&&t<=c&&(this.flags[u]&s.A.Ay)===s.A.OPEN&&(l&h.A.zy)===s.A.OPEN)))};add=(t,i,e)=>{this.flags[o.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[o.index(t,i)]&=s.A.Hy-e}}},4909:(t,i,e)=>{e.d(i,{A:()=>s});class s{static zy=1;static Qy=2;static Zy=4;static Yd=8}},6169:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Yd=0;static zy=1;static Qy=2;static Zy=3}},5599:(t,i,e)=>{e.d(i,{A:()=>s});class s{static dm=0;static wm=1;static ym=2;static pm=3}},1023:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5599);class n{static $y=new n(0,s.A.dm);static tm=new n(1,s.A.dm);static sm=new n(2,s.A.dm);static im=new n(3,s.A.dm);static Am=new n(4,s.A.wm);static gm=new n(5,s.A.wm);static am=new n(6,s.A.wm);static lm=new n(7,s.A.wm);static fm=new n(8,s.A.wm);static hm=new n(9,s.A.ym);static fd=new n(10,s.A.ym);static Im=new n(11,s.A.ym);static _m=new n(12,s.A.ym);static Cm=new n(13,s.A.ym);static Em=new n(14,s.A.ym);static vm=new n(15,s.A.ym);static bm=new n(16,s.A.ym);static Tm=new n(17,s.A.ym);static Om=new n(18,s.A.ym);static Rm=new n(19,s.A.ym);static Sm=new n(20,s.A.ym);static Lm=new n(21,s.A.ym);static pm=new n(22,s.A.pm);static values(){return[this.$y,this.tm,this.Tm,this.vm,this.sm,this.Em,this.hm,this.im,this.pm,this._m,this.Im,this.am,this.Sm,this.fd,this.gm,this.Cm,this.lm,this.Am,this.bm,this.fm,this.Rm,this.Lm,this.Om]}static of(t){const i=this.values();for(let e=0;e{e.d(i,{A:()=>m});var s=e(670),n=e(2164),r=e(1069),h=e(4583),o=e(3045),a=e(5637),l=e(4197),c=e(1312),f=e(1023),u=e(6169),d=e(9298),w=e(5518),y=e(3867);class m{static xm=Int8Array.of(1,2,4,8);static km=Uint8Array.of(16,32,64,128);static Mm=Int8Array.of(1,0,-1,0);static Dm=Int8Array.of(0,-1,0,1);static Nm=(17*Math.random()|0)-8;static Fm=(33*Math.random()|0)-16;static et=!0;static Bm=0;static Pm=!1;static Um=(t,i)=>{let e=this.Gm(t+45365,i+91923,4)+(this.Gm(t+10294,i+37821,2)-128>>1)+(this.Gm(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static Gm=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.Wm(s,r),a=this.Wm(s+1,r),l=this.Wm(s,r+1),c=this.Wm(s+1,r+1),f=this.Ym(o,a,n,e),u=this.Ym(l,c,n,e);return this.Ym(f,u,h,e)};static Ym=(t,i,e,s)=>{const n=65536-h.A.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static Wm=(t,i)=>((this.Hm(t-1,i-1)+this.Hm(t+1,i-1)+this.Hm(t-1,i+1)+this.Hm(t+1,i+1))/16|0)+((this.Hm(t-1,i)+this.Hm(t+1,i)+this.Hm(t,i-1)+this.Hm(t,i+1))/8|0)+(this.Hm(t,i)/4|0);static Hm=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static jy=(t,i,e,s,n,r,h,o,d,w,y)=>{const p=n[y][i][e],A=n[y][i+1][e],g=n[y][i+1][e+1],I=n[y][i][e+1],_=p+A+g+I>>2,C=a.A.get(o);let E=i+(e<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A.pm.id)s?.Vm(C.Al(f.A.pm.id,w,p,A,g,I,-1),t,i,e,_,E,v),C.wd&&C.active&&h?.Ky(i,e),-1!==C.ga&&r.Km(new l.A(o,t,3,i,e,c.A.Do[C.ga],!0));else if(d===f.A.fd.id||d===f.A.Im.id){const n=C.Al(f.A.fd.id,w,p,A,g,I,-1);if(n){let r,h,o=0;d===f.A.Im.id&&(o+=256),w===u.A.zy||w===u.A.Zy?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.jy(t,i,e,_,n,null,E,v,r,h,o)}C.wd&&h?.jy(i,e,C.width,C.length,w,C.yd),-1!==C.ga&&r.Km(new l.A(o,t,2,i,e,c.A.Do[C.ga],!0))}else if(d>=f.A._m.id)s?.jy(t,i,e,_,C.Al(d,w,p,A,g,I,-1),null,E,v,1,1,0),C.wd&&h?.jy(i,e,C.width,C.length,w,C.yd),-1!==C.ga&&r.Km(new l.A(o,t,2,i,e,c.A.Do[C.ga],!0));else if(d===f.A.$y.id)s?.Jy(t,i,e,_,m.xm[w],0,C.Al(f.A.$y.id,w,p,A,g,I,-1),null,E,v),C.wd&&h?.Jy(i,e,d,w,C.yd),-1!==C.ga&&r.Km(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0));else if(d===f.A.tm.id)s?.Jy(t,i,e,_,m.km[w],0,C.Al(f.A.tm.id,w,p,A,g,I,-1),null,E,v),C.wd&&h?.Jy(i,e,d,w,C.yd),-1!==C.ga&&r.Km(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0));else if(d===f.A.sm.id){const n=w+1&3;s?.Jy(t,i,e,_,m.xm[w],m.xm[n],C.Al(f.A.sm.id,w+4,p,A,g,I,-1),C.Al(f.A.sm.id,n,p,A,g,I,-1),E,v),C.wd&&h?.Jy(i,e,d,w,C.yd),-1!==C.ga&&r.Km(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0))}else if(d===f.A.im.id)s?.Jy(t,i,e,_,m.km[w],0,C.Al(f.A.im.id,w,p,A,g,I,-1),null,E,v),C.wd&&h?.Jy(i,e,d,w,C.yd),-1!==C.ga&&r.Km(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0));else if(d===f.A.hm.id)s?.jy(t,i,e,_,C.Al(d,w,p,A,g,I,-1),null,E,v,1,1,0),C.wd&&h?.jy(i,e,C.width,C.length,w,C.yd),-1!==C.ga&&r.Km(new l.A(o,t,2,i,e,c.A.Do[C.ga],!0));else if(d===f.A.Am.id)s?.Xm(t,i,e,_,0,0,E,C.Al(f.A.Am.id,u.A.Yd,p,A,g,I,-1),v,512*w,m.xm[w]),-1!==C.ga&&r.Km(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0));else if(d===f.A.gm.id){let n=16;if(s){const r=s.jm(t,i,e);r>0&&(n=a.A.get(r>>14&32767).gd)}s?.Xm(t,i,e,_,m.Mm[w]*n,m.Dm[w]*n,E,C.Al(f.A.Am.id,u.A.Yd,p,A,g,I,-1),v,512*w,m.xm[w]),-1!==C.ga&&r.Km(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0))}else d===f.A.am.id?(s?.Xm(t,i,e,_,0,0,E,C.Al(f.A.Am.id,u.A.Yd,p,A,g,I,-1),v,w,256),-1!==C.ga&&r.Km(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0))):d===f.A.lm.id?(s?.Xm(t,i,e,_,0,0,E,C.Al(f.A.Am.id,u.A.Yd,p,A,g,I,-1),v,w,512),-1!==C.ga&&r.Km(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0))):d===f.A.fm.id&&(s?.Xm(t,i,e,_,0,0,E,C.Al(f.A.Am.id,u.A.Yd,p,A,g,I,-1),v,w,768),-1!==C.ga&&r.Km(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0)))};zm;Zm;Hr;Vr;qm;Jm;$m;Qm;tp;ip;ep;sp;np;rp;hp;op;constructor(t,i,e,n){this.zm=t,this.Zm=i,this.Hr=e,this.Vr=n,this.qm=new y.ap(s.A.Dr,t,i),this.Jm=new y.ap(s.A.Dr,t,i),this.$m=new y.ap(s.A.Dr,t,i),this.Qm=new y.ap(s.A.Dr,t,i),this.op=new y.lp(s.A.Dr,t+1,i+1),this.tp=new y.ap(s.A.Dr,t+1,i+1),this.ip=new y.Xr(t+1,i+1),this.ep=new Int32Array(i),this.sp=new Int32Array(i),this.np=new Int32Array(i),this.rp=new Int32Array(i),this.hp=new Int32Array(i)}cp=(t,i)=>{for(let t=0;t=0&&i[s]?.Ky(e,n)}m.Nm+=(5*Math.random()|0)-2,m.Nm<-8?m.Nm=-8:m.Nm>8&&(m.Nm=8),m.Fm+=(5*Math.random()|0)-2,m.Fm<-16?m.Fm=-16:m.Fm>16&&(m.Fm=16);for(let i=0;i>8;for(let t=1;t>2)+(e[n+1][t]>>3)+(e[n][t-1]>>2)+(e[n][t+1]>>3)+(e[n][t]>>1);this.ip[n][t]=u-d}for(let t=0;t=0&&s0){const i=n.A.Do[e-1];this.ep[t]+=i.zu,this.sp[t]+=i.Ku,this.np[t]+=i.Xu,this.rp[t]+=i.ju,r=this.hp[t]++}}const h=e-5;if(h>=0&&h0){const i=n.A.Do[e-1];this.ep[t]-=i.zu,this.sp[t]-=i.Ku,this.np[t]-=i.Xu,this.rp[t]-=i.ju,r=this.hp[t]--}}}if(e>=1&&e=0&&f=0&&y=1&&c0||y>0){const p=this.Hr[i][e][c],A=this.Hr[i][e+1][c],g=this.Hr[i][e+1][c+1],I=this.Hr[i][e][c+1],_=this.ip[e][c],C=this.ip[e+1][c],E=this.ip[e+1][c+1],v=this.ip[e][c+1];let b=-1,T=-1;if(f>0){const t=256*s/a|0,i=r/l|0;let e=o/l|0;b=n.A.Pu(t,i,e);const h=t+m.Nm&255;e+=m.Fm,e<0?e=0:e>255&&(e=255),T=n.A.Pu(h,i,e)}if(i>0){let t=0!==f||this.$m[i][e][c]===w.A.up;y>0&&!n.A.Do[y-1].Hu&&(t=!1),t&&p===A&&p===g&&p===I&&(this.op[i][e][c]|=2340)}let O=0;if(-1!==b&&(O=h.A.palette[n.A.Uu(T,96)]),0===y)t?.dp(i,e,c,w.A.up,u.A.Yd,-1,p,A,g,I,n.A.Uu(b,_),n.A.Uu(b,C),n.A.Uu(b,E),n.A.Uu(b,v),d.A.Za,d.A.Za,d.A.Za,d.A.Za,O,d.A.Za);else{const s=this.$m[i][e][c]+1,r=this.Qm[i][e][c],o=n.A.Do[y-1];let a,l,f=o.texture;f>=0?(l=h.A.wp(f),a=-1):o.Wu===d.A.yp?(l=0,a=-2,f=-1):(a=n.A.Pu(o.Vu,o.Ku,o.Xu),l=h.A.palette[n.A.Gu(o.Zu,96)]),t?.dp(i,e,c,s,r,f,p,A,g,I,n.A.Uu(b,_),n.A.Uu(b,C),n.A.Uu(b,E),n.A.Uu(b,v),n.A.Gu(a,_),n.A.Gu(a,C),n.A.Gu(a,E),n.A.Gu(a,v),O,l)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let s=0;s<=n;s++)for(let r=0;r<=this.Zm;r++)for(let h=0;h<=this.zm;h++){if(this.op[s][h][r]&t){let i=r,e=r,a=s,l=s;for(;i>0&&this.op[s][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.op[a-1][h][s]&t))break t;a--}t:for(;l=8){const s=this.Hr[l][h][i]-240,r=this.Hr[a][h][i];o.A.gp(n,1,128*h,s,128*i,128*h,r,128*e+128);for(let s=a;s<=l;s++)for(let n=i;n<=e;n++)this.op[s][h][n]&=~t}}if(this.op[s][h][r]&i){let t=h,e=h,a=s,l=s;for(;t>0&&this.op[s][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.op[a-1][s][r]&i))break t;a--}t:for(;l=8){const s=this.Hr[l][t][r]-240,h=this.Hr[a][t][r];o.A.gp(n,2,128*t,s,128*r,128*e+128,h,128*r);for(let s=a;s<=l;s++)for(let n=t;n<=e;n++)this.op[s][n][r]&=~i}}if(this.op[s][h][r]&e){let t=h,i=h,a=r,l=r;for(;a>0&&this.op[s][h][a-1]&e;)a--;for(;l0;){for(let i=a;i<=l;i++)if(!(this.op[s][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.Hr[s][t][a];o.A.gp(n,4,128*t,r,128*a,128*i+128,r,128*l+128);for(let n=t;n<=i;n++)for(let t=a;t<=l;t++)this.op[s][n][t]&=~e}}}}}};Ip=(t,i,e,r)=>{let h=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new r.A(new Uint8Array(h));for(let r=0;r=0&&l=0&&c>24,this.Qm[r][l][c]=(f-2&3)<<24>>24):f<=81?this.Vr[r][l][c]=f-49<<24>>24:this.qm[r][l][c]=f-81<<24>>24}else for(;f=o.Au,0!==f;){if(1===f){o.Au;break}f<=49&&o.Au}}};Cp=(t,i,e,n,h,o)=>{const a=new r.A(new Uint8Array(n));let l=-1;for(;;){const n=a.Ep;if(0===n)return;l+=n;let r=0;for(;;){const n=a.Ep;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=a.Au,w=d>>2,y=3&d,m=f+h,p=c+o;if(m>0&&p>0&&m=0&&(n=e[s]),this.jy(u,m,p,t,i,n,l,w,y)}}}};jy=(t,i,e,s,n,r,h,o,d)=>{if(m.et){if(16&this.Vr[t][i][e])return;if(this.fp(t,i,e)!==m.Bm)return}const w=this.Hr[t][i][e],y=this.Hr[t][i+1][e],p=this.Hr[t][i+1][e+1],A=this.Hr[t][i][e+1],g=w+y+p+A>>2,I=a.A.get(h);let _=i+(e<<7)+(h<<14)+1073741824|0;I.active||(_+=-2147483648),_|=0;const C=(d<<6)+o<<24>>24;if(o===f.A.pm.id)(!m.et||I.active||I.Md)&&(s?.Vm(I.Al(f.A.pm.id,d,w,y,p,A,-1),t,i,e,g,_,C),I.wd&&I.active&&r?.Ky(i,e),-1!==I.ga&&n.Km(new l.A(h,t,3,i,e,c.A.Do[I.ga],!0)));else if(o===f.A.fd.id||o===f.A.Im.id){const a=I.Al(f.A.fd.id,d,w,y,p,A,-1);if(a){let n,r,h=0;if(o===f.A.Im.id&&(h+=256),d===u.A.zy||d===u.A.Zy?(n=I.length,r=I.width):(n=I.width,r=I.length),s?.jy(t,i,e,g,a,null,_,C,n,r,h)&&I.bd)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=a.vp/4|0;r>30&&(r=30),r>this.tp[t][i+s][e+n]&&(this.tp[t][i+s][e+n]=r<<24>>24)}}I.wd&&r?.jy(i,e,I.width,I.length,d,I.yd),-1!==I.ga&&n.Km(new l.A(h,t,2,i,e,c.A.Do[I.ga],!0))}else if(o>=f.A._m.id)s?.jy(t,i,e,g,I.Al(o,d,w,y,p,A,-1),null,_,C,1,1,0),o>=f.A._m.id&&o<=f.A.Tm.id&&o!==f.A.Cm.id&&t>0&&(this.op[t][i][e]|=2340),I.wd&&r?.jy(i,e,I.width,I.length,d,I.yd),-1!==I.ga&&n.Km(new l.A(h,t,2,i,e,c.A.Do[I.ga],!0));else if(o===f.A.$y.id)s?.Jy(t,i,e,g,m.xm[d],0,I.Al(f.A.$y.id,d,w,y,p,A,-1),null,_,C),d===u.A.Yd?(I.bd&&(this.tp[t][i][e]=50,this.tp[t][i][e+1]=50),I.Hu&&(this.op[t][i][e]|=585)):d===u.A.zy?(I.bd&&(this.tp[t][i][e+1]=50,this.tp[t][i+1][e+1]=50),I.Hu&&(this.op[t][i][e+1]|=1170)):d===u.A.Qy?(I.bd&&(this.tp[t][i+1][e]=50,this.tp[t][i+1][e+1]=50),I.Hu&&(this.op[t][i+1][e]|=585)):d===u.A.Zy&&(I.bd&&(this.tp[t][i][e]=50,this.tp[t][i+1][e]=50),I.Hu&&(this.op[t][i][e]|=1170)),I.wd&&r?.Jy(i,e,o,d,I.yd),-1!==I.ga&&n.Km(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0)),16!==I.gd&&s?.bp(t,i,e,I.gd);else if(o===f.A.tm.id)s?.Jy(t,i,e,g,m.km[d],0,I.Al(f.A.tm.id,d,w,y,p,A,-1),null,_,C),I.bd&&(d===u.A.Yd?this.tp[t][i][e+1]=50:d===u.A.zy?this.tp[t][i+1][e+1]=50:d===u.A.Qy?this.tp[t][i+1][e]=50:d===u.A.Zy&&(this.tp[t][i][e]=50)),I.wd&&r?.Jy(i,e,o,d,I.yd),-1!==I.ga&&n.Km(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0));else if(o===f.A.sm.id){const a=d+1&3;s?.Jy(t,i,e,g,m.xm[d],m.xm[a],I.Al(f.A.sm.id,d+4,w,y,p,A,-1),I.Al(f.A.sm.id,a,w,y,p,A,-1),_,C),I.Hu&&(d===u.A.Yd?(this.op[t][i][e]|=265,this.op[t][i][e+1]|=1170):d===u.A.zy?(this.op[t][i][e+1]|=1170,this.op[t][i+1][e]|=585):d===u.A.Qy?(this.op[t][i+1][e]|=585,this.op[t][i][e]|=1170):d===u.A.Zy&&(this.op[t][i][e]|=1170,this.op[t][i][e]|=585)),I.wd&&r?.Jy(i,e,o,d,I.yd),-1!==I.ga&&n.Km(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0)),16!==I.gd&&s?.bp(t,i,e,I.gd)}else if(o===f.A.im.id)s?.Jy(t,i,e,g,m.km[d],0,I.Al(f.A.im.id,d,w,y,p,A,-1),null,_,C),I.bd&&(d===u.A.Yd?this.tp[t][i][e+1]=50:d===u.A.zy?this.tp[t][i+1][e+1]=50:d===u.A.Qy?this.tp[t][i+1][e]=50:d===u.A.Zy&&(this.tp[t][i][e]=50)),I.wd&&r?.Jy(i,e,o,d,I.yd),-1!==I.ga&&n.Km(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0));else if(o===f.A.hm.id)s?.jy(t,i,e,g,I.Al(o,d,w,y,p,A,-1),null,_,C,1,1,0),I.wd&&r?.jy(i,e,I.width,I.length,d,I.yd),-1!==I.ga&&n.Km(new l.A(h,t,2,i,e,c.A.Do[I.ga],!0));else if(o===f.A.Am.id)s?.Xm(t,i,e,g,0,0,_,I.Al(f.A.Am.id,u.A.Yd,w,y,p,A,-1),C,512*d,m.xm[d]),-1!==I.ga&&n.Km(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0));else if(o===f.A.gm.id){let r=16;if(s){const n=s.jm(t,i,e);n>0&&(r=a.A.get(n>>14&32767).gd)}s?.Xm(t,i,e,g,m.Mm[d]*r,m.Dm[d]*r,_,I.Al(f.A.Am.id,u.A.Yd,w,y,p,A,-1),C,512*d,m.xm[d]),-1!==I.ga&&n.Km(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0))}else o===f.A.am.id?(s?.Xm(t,i,e,g,0,0,_,I.Al(f.A.Am.id,u.A.Yd,w,y,p,A,-1),C,d,256),-1!==I.ga&&n.Km(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0))):o===f.A.lm.id?(s?.Xm(t,i,e,g,0,0,_,I.Al(f.A.Am.id,u.A.Yd,w,y,p,A,-1),C,d,512),-1!==I.ga&&n.Km(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0))):o===f.A.fm.id&&(s?.Xm(t,i,e,g,0,0,_,I.Al(f.A.Am.id,u.A.Yd,w,y,p,A,-1),C,d,768),-1!==I.ga&&n.Km(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0)))};fp=(t,i,e)=>8&this.Vr[t][i][e]?0:t<=0||!(2&this.Vr[1][i][e])?t:t-1}},3045:(t,i,e)=>{e.d(i,{A:()=>g});var s=e(4583),n=e(1161),r=e(3795),h=e(8256),o=e(670),a=e(9222),l=e(6855),c=e(7441),f=e(6666),u=e(5748),d=e(3479),w=e(8950),y=e(2771),m=e(5518),p=e(6169),A=e(3867);class g{static Tp=new A.Op(8,32,51,51,!1);static Rp=new A.fe(100,null);static Sp=new Int32Array(o.A.Dr);static Lp=new A.xp(o.A.Dr,500,null);static kp=new A.fe(500,null);static Mp=new f.A;static Dp=0;static Np=0;static Fp=0;static Bp=0;static Pp=0;static Up=0;static Gp=0;static Wp=0;static Yp=0;static Hp=0;static Vp=0;static Kp=0;static Xp=0;static jp=0;static zp=0;static Zp=0;static qp=0;static Jp=0;static $p=0;static Qp=0;static tA=0;static iA=0;static eA=!1;static sA=null;static nA=Uint8Array.of(19,55,38,155,255,110,137,205,76);static rA=Uint8Array.of(160,192,80,96,0,144,80,48,160);static hA=Uint8Array.of(76,8,137,4,0,1,38,2,19);static oA=Int8Array.of(0,0,2,0,0,2,1,1,0);static aA=Int8Array.of(2,0,0,2,0,0,0,4,4);static lA=Int8Array.of(0,4,4,8,0,0,8,0,0);static cA=Int8Array.of(1,1,0,0,0,8,0,0,8);static fA=Int8Array.of(53,-53,-53,53);static uA=Int8Array.of(-53,-53,53,53);static dA=Int8Array.of(-45,45,45,-45);static wA=Int8Array.of(45,45,-45,-45);static yA=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static mA=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static pA=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static AA=0;static Ha=0;static Va=0;static gA=-1;static IA=-1;static et=!0;static init=(t,i,e,n,r)=>{this.Np=0,this.Fp=0,this.Bp=t,this.Pp=i,this.Up=t/2|0,this.Gp=i/2|0;const h=new A.Op(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.Wp=s.A.sin[t],this.Yp=s.A.cos[t],this.Hp=s.A.sin[i],this.Vp=s.A.cos[i];const o=(t-128)/32|0,a=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const s=128*t,l=128*i;let c=!1;for(let t=-e;t<=n;t+=128)if(this._A(s,l,r[o]+t)){c=!0;break}h[o][a][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let r=-1;r<=1;r++)for(let o=-1;o<=1;o++){if(h[t][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}}this.Tp[t][i][e+25][s+25]=n}};static So=()=>{this.Rp=null,this.Sp=null,this.Lp=null,this.Mp=null,this.Tp=null,this.kp=null,this.sA=null,console.log('World3D unloaded!')};static gp=(t,i,e,s,n,r,o,a)=>{g.Lp[t][g.Sp[t]++]=new h.A(e/128|0,r/128|0,n/128|0,a/128|0,i,e,r,n,a,s,o)};static _A=(t,i,e)=>{const s=i*this.Hp+t*this.Vp>>16,n=i*this.Vp-t*this.Hp>>16,r=e*this.Wp+n*this.Yp>>16,h=e*this.Yp-n*this.Wp>>16;if(r<50||r>3500)return!1;const o=this.Up+((s<<9)/r|0),a=this.Gp+((h<<9)/r|0);return o>=this.Np&&o<=this.Bp&&a>=this.Fp&&a<=this.Pp};CA;zm;Zm;EA;vA;_h;bA;TA;OA;RA=0;SA=0;LA=0;constructor(t,i,e,s){this.CA=e,this.zm=s,this.Zm=i,this.vA=new A.Eh(e,s,i,null),this.bA=new A.lp(e,s+1,i+1),this.EA=t,this._h=new A.fe(5e3,null),this.TA=new Int32Array(1e4),this.OA=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.SA=t;for(let i=0;i{const e=this.vA[0][t][i];for(let e=0;e<3;e++){this.vA[e][t][i]=this.vA[e+1][t][i];const s=this.vA[e][t][i];s&&s.level--}this.vA[0][t][i]||(this.vA[0][t][i]=new r.A(0,t,i));const s=this.vA[0][t][i];s&&(s.kA=e),this.vA[3][t][i]=null};mp=(t,i,e,s)=>{const n=this.vA[t][i][e];n&&(n.MA=s)};dp=(t,i,e,s,n,h,o,a,l,c,f,u,w,p,A,g,I,_,C,E)=>{if(s===m.A.up){for(let s=t;s>=0;s--)this.vA[s][i][e]||(this.vA[s][i][e]=new r.A(s,i,e));const s=this.vA[t][i][e];s&&(s.DA=new d.A(f,u,w,p,-1,C,!1))}else if(s===m.A.NA){for(let s=t;s>=0;s--)this.vA[s][i][e]||(this.vA[s][i][e]=new r.A(s,i,e));const s=this.vA[t][i][e];s&&(s.DA=new d.A(A,g,I,_,h,E,o===a&&o===l&&o===c))}else{for(let s=t;s>=0;s--)this.vA[s][i][e]||(this.vA[s][i][e]=new r.A(s,i,e));const d=this.vA[t][i][e];d&&(d.FA=new y.A(i,s,g,a,w,n,f,c,E,A,h,_,C,l,I,p,o,e,u))}};Vm=(t,i,e,s,n,h,o)=>{this.vA[i][e][s]||(this.vA[i][e][s]=new r.A(i,e,s));const l=this.vA[i][e][s];l&&(l.BA=new a.A(n,128*e+64,128*s+64,t,h,o))};PA=(t,i,e)=>{const s=this.vA[t][i][e];s&&(s.BA=null)};UA=(t,i,e,s,n,h,o,a)=>{let l=0;const c=this.vA[s][t][i];if(c)for(let t=0;tl&&(l=e)}else this.vA[s][t][i]=new r.A(s,t,i);const f=this.vA[s][t][i];f&&(f.YA=new u.A(e,128*t+64,128*i+64,h,o,a,n,l))};HA=(t,i,e)=>{const s=this.vA[t][i][e];s&&(s.YA=null)};Jy=(t,i,e,s,n,h,o,a,c,f)=>{if(!o&&!a)return;for(let s=t;s>=0;s--)this.vA[s][i][e]||(this.vA[s][i][e]=new r.A(s,i,e));const u=this.vA[t][i][e];u&&(u.VA=new l.A(s,128*i+64,128*e+64,n,h,o,a,c,f))};nm=(t,i,e,s)=>{const n=this.vA[t][i][e];1===s&&n&&(n.VA=null)};Xm=(t,i,e,s,n,h,o,a,l,f,u)=>{if(!a)return;for(let s=t;s>=0;s--)this.vA[s][i][e]||(this.vA[s][i][e]=new r.A(s,i,e));const d=this.vA[t][i][e];d&&(d.KA=new c.A(s,128*i+n+64,128*e+h+64,u,f,a,o,l))};XA=(t,i,e)=>{const s=this.vA[t][i][e];s&&(s.KA=null)};bp=(t,i,e,s)=>{const n=this.vA[t][i][e];if(!n)return;const r=n.KA;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};jA=(t,i,e,s)=>{if(!s)return;const n=this.vA[t][i][e];if(!n)return;const r=n.KA;r&&(r.model=s)};zA=(t,i,e,s)=>{if(!s)return;const n=this.vA[t][i][e];if(!n)return;const r=n.BA;r&&(r.model=s)};ZA=(t,i,e,s)=>{if(!s)return;const n=this.vA[t][i][e];if(!n)return;const r=n.VA;r&&(r.qA=s)};JA=(t,i,e,s,n)=>{if(!s)return;const r=this.vA[e][t][i];if(!r)return;const h=r.VA;h&&(h.qA=s,h.$A=n)};jy=(t,i,e,s,n,r,h,o,a,l,c)=>{if(!n&&!r)return!0;const f=128*i+64*a,u=128*e+64*l;return this.QA(f,u,s,t,i,e,a,l,n,r,h,o,c,!1)};tg=(t,i,e,s,n,r,h,o,a,l)=>{if(!n&&!r)return!0;let c=i-a,f=s-a,u=i+a,d=s+a;return l&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.QA(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};ig=(t,i,e,s,n,r,h,o,a,l,c,f)=>!a&&!l||this.QA(i,s,e,t,n,r,h+1-n,o-r+1,a,l,c,0,f,!0);qy=(t,i,e)=>{const s=this.vA[t][i][e];if(s)for(let t=0;t>29&3)&&n.sg===i&&n.ng===e)return void this.rg(n)}};hg=(t,i,e,s)=>{if(!s)return;const n=this.vA[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};og=()=>{for(let t=0;t{const s=this.vA[t][i][e];return s&&s.VA?s.VA.eg:0};ag=(t,i,e)=>{const s=this.vA[t][e][i];return s&&s.KA?s.KA.eg:0};lg=(t,i,e)=>{const s=this.vA[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.sg===i&&n.ng===e)return n.eg}return 0};cg=(t,i,e)=>{const s=this.vA[t][i][e];return s&&s.BA?s.BA.eg:0};fg=(t,i,e,s)=>{const n=this.vA[t][i][e];if(n){if(n.VA&&n.VA.eg===s)return 255&n.VA.info;if(n.KA&&n.KA.eg===s)return 255&n.KA.info;if(n.BA&&n.BA.eg===s)return 255&n.BA.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.vA[t][i+1][e-1];n&&n.BA&&n.BA.model&&n.BA.model.ug&&this.wg(s,n.BA.model,128,0,-128,!0)}};dg=(t,i,e,s,n,r)=>{let h=!0,o=i;const a=i+s,l=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.CA){for(let u=o;u<=a;u++)if(!(u<0||u>=this.zm))for(let o=l;o<=c;o++){if(o<0||o>=this.Zm||h&&u=e||u===i))continue;const l=this.vA[f][u][o];if(!l)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.EA[f][u][o]+this.EA[f][u+1][o]+this.EA[f][u][o+1]+this.EA[f][u+1][o+1])/4|0)-((this.EA[t][i][e]+this.EA[t][i+1][e]+this.EA[t][i][e+1]+this.EA[t][i+1][e+1])/4|0),m=l.VA;m&&m.qA&&m.qA.ug&&this.wg(r,m.qA,d,y,w,h),m&&m.$A&&m.$A.ug&&this.wg(r,m.$A,d,y,w,h);for(let t=0;t{this.LA++;let h=0;const o=i.Bd,a=i.Fd;if(t.ug&&t.gg)for(let r=0;ri.Ig)continue;const u=t.Bd[r]-e;if(ui.Cg)continue;const d=t.Pd[r]-n;if(di.vg)continue;if(i.ug&&i.gg)for(let t=0;t{const h=this.vA[t][i][e];if(!h)return;const o=h.DA;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const a=h.FA;if(!a)return;const l=a.shape,c=a.angle,f=a.xg,u=a.kg,d=g.yA[l],w=g.mA[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{g.eA=!0,g.Ha=t,g.Va=i,g.gA=-1,g.IA=-1};draw=(t,i,e,n,r,h,o)=>{t<0?t=0:t>=128*this.zm&&(t=128*this.zm-1),e<0?e=0:e>=128*this.Zm&&(e=128*this.Zm-1),g.Dp++,g.Wp=s.A.sin[h],g.Yp=s.A.cos[h],g.Hp=s.A.sin[r],g.Vp=s.A.cos[r],g.sA=g.Tp[(h-128)/32|0][r/64|0],g.Kp=t,g.Xp=i,g.jp=e,g.zp=t/128|0,g.Zp=e/128|0,g.tA=n,g.qp=g.zp-25,g.qp<0&&(g.qp=0),g.$p=g.Zp-25,g.$p<0&&(g.$p=0),g.Jp=g.zp+25,g.Jp>this.zm&&(g.Jp=this.zm),g.Qp=g.Zp+25,g.Qp>this.Zm&&(g.Qp=this.Zm),this.Mg(),g.iA=0;for(let t=this.SA;t=2e3)?(h.visible=!0,h.update=!0,h.Dg=h.GA>0,g.iA++):(h.visible=!1,h.update=!1,h.Ng=0))}}for(let t=this.SA;t=g.Jp))for(let t=-25;t<=0;t++){const n=g.Zp+t,r=g.Zp-t;let h;if(e>=g.qp&&(n>=g.$p&&(h=i[e][n],h&&h.visible&&this.Fg(h,!0,o)),r=g.$p&&(h=i[s][n],h&&h.visible&&this.Fg(h,!0,o)),r=g.Jp))for(let t=-25;t<=0;t++){const n=g.Zp+t,r=g.Zp-t;let h;if(e>=g.qp&&(n>=g.$p&&(h=i[e][n],h&&h.visible&&this.Fg(h,!1,o)),r=g.$p&&(h=i[s][n],h&&h.visible&&this.Fg(h,!1,o)),r{if(!c&&!f)return!1;for(let t=h;t=this.zm||i>=this.Zm)return!1;const e=this.vA[s][t][i];if(e&&e.GA>=5)return!1}const m=new n.A(s,e,t,i,c,f,w,h,h+a-1,o,o+l-1,u,d);for(let t=h;th&&(e|=1),to&&(e+=8),i=0;e--)this.vA[e][t][i]||(this.vA[e][t][i]=new r.A(e,t,i));const n=this.vA[s][t][i];n&&(n.WA[n.GA]=m,n.Bg[n.GA]=e,n.Pg|=e,n.GA++)}return y&&(this._h[this.RA++]=m),!0};rg=t=>{for(let i=t.sg;i<=t.mg;i++)for(let e=t.ng;e<=t.pg;e++){const s=this.vA[t.level][i][e];if(s){for(let i=0;i{const t=g.Sp[g.tA],i=g.Lp[g.tA];g.AA=0;for(let e=0;e=0&&s<=50){n=t.Gg+25-g.Zp,n<0&&(n=0),r=t.Zm+25-g.Zp,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.sA&&g.sA[s][n++]){i=!0;break}if(i){if(h=g.Kp-t._g,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.Wg=(t.Eg-g.jp<<8)/h|0,t.Yg=(t.vg-g.jp<<8)/h|0,t.Hg=(t.Ig-g.Xp<<8)/h|0,t.Vg=(t.jd-g.Xp<<8)/h|0,g.kp[g.AA++]=t}}}else if(2===t.type){if(s=t.Gg+25-g.Zp,s>=0&&s<=50){n=t.Ug+25-g.zp,n<0&&(n=0),r=t.zm+25-g.zp,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.sA&&g.sA[n++][s]){i=!0;break}if(i){if(h=g.jp-t.Eg,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.Kg=(t._g-g.Kp<<8)/h|0,t.Xg=(t.Cg-g.Kp<<8)/h|0,t.Hg=(t.Ig-g.Xp<<8)/h|0,t.Vg=(t.jd-g.Xp<<8)/h|0,g.kp[g.AA++]=t}}}else if(4===t.type&&(s=t.Ig-g.Xp,s>128&&(n=t.Gg+25-g.Zp,n<0&&(n=0),r=t.Zm+25-g.Zp,r>50&&(r=50),n<=r))){let i=t.Ug+25-g.zp;i<0&&(i=0),h=t.zm+25-g.zp,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(g.sA&&g.sA[t][i]){e=!0;break t}e&&(t.mode=5,t.Kg=(t._g-g.Kp<<8)/s|0,t.Xg=(t.Cg-g.Kp<<8)/s|0,t.Wg=(t.Eg-g.jp<<8)/s|0,t.Yg=(t.vg-g.jp<<8)/s|0,g.kp[g.AA++]=t)}}};Fg=(t,i,e)=>{for(g.Mp.Km(t);;){let t;do{if(t=g.Mp.jg(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.zg,o=this.vA[r];if(t.visible){if(i){if(r>0){const t=this.vA[r-1][s][n];if(t&&t.update)continue}if(s<=g.zp&&s>g.qp){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.Pg)))continue}if(s>=g.zp&&sg.$p){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.Pg)))continue}if(n>=g.Zp&&nn&&(l+=6),c=g.nA[l],t.tI=g.hA[l]),f&&(f.iI&g.rA[l]?16===f.iI?(t.Ng=3,t.eI=g.oA[l],t.sI=3-t.eI):32===f.iI?(t.Ng=6,t.eI=g.aA[l],t.sI=6-t.eI):64===f.iI?(t.Ng=12,t.eI=g.lA[l],t.sI=12-t.eI):(t.Ng=9,t.eI=g.cA[l],t.sI=9-t.eI):t.Ng=0,f.iI&c&&!this.nI(h,s,n,f.iI)&&f.qA?.draw(0,g.Wp,g.Yp,g.Hp,g.Vp,f.x-g.Kp,f.y-g.Xp,f.z-g.jp,f.eg),f.rI&c&&!this.nI(h,s,n,f.rI)&&f.$A?.draw(0,g.Wp,g.Yp,g.Hp,g.Vp,f.x-g.Kp,f.y-g.Xp,f.z-g.jp,f.eg)),u&&!this.visible(h,s,n,u.model.jd))if(u.type&c)u.model.draw(u.angle,g.Wp,g.Yp,g.Hp,g.Vp,u.x-g.Kp,u.y-g.Xp,u.z-g.jp,u.eg);else if(768&u.type){const t=u.x-g.Kp,i=u.y-g.Xp,e=u.z-g.jp,s=u.angle;let n,r;if(n=s===p.A.zy||s===p.A.Qy?-t:t,r=s===p.A.Qy||s===p.A.Zy?-e:e,256&u.type&&rn){const n=t+g.dA[s],r=e+g.wA[s];u.model.draw(512*s+1280&2047,g.Wp,g.Yp,g.Hp,g.Vp,n,i,r,u.eg)}}if(a){const i=t.BA;i&&i.model?.draw(0,g.Wp,g.Yp,g.Hp,g.Vp,i.x-g.Kp,i.y-g.Xp,i.z-g.jp,i.eg);const e=t.YA;e&&0===e.offset&&(e.hI&&e.hI.draw(0,g.Wp,g.Yp,g.Hp,g.Vp,e.x-g.Kp,e.y-g.Xp,e.z-g.jp,e.eg),e.oI&&e.oI.draw(0,g.Wp,g.Yp,g.Hp,g.Vp,e.x-g.Kp,e.y-g.Xp,e.z-g.jp,e.eg),e.aI&&e.aI.draw(0,g.Wp,g.Yp,g.Hp,g.Vp,e.x-g.Kp,e.y-g.Xp,e.z-g.jp,e.eg))}const d=t.Pg;if(0!==d){if(sg.zp&&1&d){const t=o[s-1][n];t&&t.update&&g.Mp.Km(t)}if(n>g.Zp&&8&d){const t=o[s][n-1];t&&t.update&&g.Mp.Km(t)}}}if(0!==t.Ng){let i=!0;for(let e=0;ei.sg&&(r+=1),ei.ng&&(r+=8),ss&&(s=n);const h=g.Zp-i.ng,a=i.pg-g.Zp;i.lI=a>h?s+a:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.lI,i=e))}if(-1===i)break;const a=g.Rp[i];if(a){a.Dp=g.Dp;let t=a.model;t||(t=a.$g?.draw(e)??null),t&&!this.cI(h,a.sg,a.mg,a.ng,a.pg,t.jd)&&t.draw(a.Qg,g.Wp,g.Yp,g.Hp,g.Vp,a.x-g.Kp,a.y-g.Xp,a.z-g.jp,a.eg);for(let t=a.sg;t<=a.mg;t++)for(let i=a.ng;i<=a.pg;i++){const e=o[t][i];e&&(0!==e.Ng?g.Mp.Km(e):t===s&&i===n||!e.update||g.Mp.Km(e))}}}if(t.Dg)continue}if(!t.update||0!==t.Ng)continue;if(s<=g.zp&&s>g.qp){const t=o[s-1][n];if(t&&t.update)continue}if(s>=g.zp&&sg.$p){const t=o[s][n-1];if(t&&t.update)continue}if(n>=g.Zp&&n=r){const r=t+g.fA[n],h=s+g.uA[n];i.model.draw(512*n+256,g.Wp,g.Yp,g.Hp,g.Vp,r,e,h,i.eg)}if(512&i.type&&h<=r){const r=t+g.dA[n],h=s+g.wA[n];i.model.draw(512*n+1280&2047,g.Wp,g.Yp,g.Hp,g.Vp,r,e,h,i.eg)}}const e=t.VA;e&&(e.rI&t.tI&&!this.nI(h,s,n,e.rI)&&e.$A?.draw(0,g.Wp,g.Yp,g.Hp,g.Vp,e.x-g.Kp,e.y-g.Xp,e.z-g.jp,e.eg),e.iI&t.tI&&!this.nI(h,s,n,e.iI)&&e.qA?.draw(0,g.Wp,g.Yp,g.Hp,g.Vp,e.x-g.Kp,e.y-g.Xp,e.z-g.jp,e.eg))}if(rg.zp){const t=o[s-1][n];t&&t.update&&g.Mp.Km(t)}if(n>g.Zp){const t=o[s][n-1];t&&t.update&&g.Mp.Km(t)}}};qg=(t,i,e,n,r,h,o,a)=>{let l,c,f,u,d=l=(e<<7)-g.Kp,y=c=(n<<7)-g.jp,m=f=d+128,p=u=y+128,A=this.EA[i][e][n]-g.Xp,I=this.EA[i][e+1][n]-g.Xp,_=this.EA[i][e+1][n+1]-g.Xp,C=this.EA[i][e][n+1]-g.Xp,E=y*o+d*a>>16;if(y=y*a-d*o>>16,d=E,E=A*h-y*r>>16,y=A*r+y*h>>16,A=E,y<50)return;if(E=c*o+m*a>>16,c=c*a-m*o>>16,m=E,E=I*h-c*r>>16,c=I*r+c*h>>16,I=E,c<50)return;if(E=p*o+f*a>>16,p=p*a-f*o>>16,f=E,E=_*h-p*r>>16,p=_*r+p*h>>16,_=E,p<50)return;if(E=u*o+l*a>>16,u=u*a-l*o>>16,l=E,E=C*h-u*r>>16,u=C*r+u*h>>16,C=E,u<50)return;const v=s.A.yl+((d<<9)/y|0),b=s.A.ml+((A<<9)/y|0),T=s.A.yl+((m<<9)/c|0),O=s.A.ml+((I<<9)/c|0),R=s.A.yl+((f<<9)/p|0),S=s.A.ml+((_<<9)/p|0),L=s.A.yl+((l<<9)/u|0),x=s.A.ml+((C<<9)/u|0);if(s.A.alpha=0,(R-L)*(O-x)-(S-x)*(T-L)>0)if(s.A.fI=R<0||L<0||T<0||R>w.A.uI||L>w.A.uI||T>w.A.uI,g.eA&&this.dI(g.Ha,g.Va,S,x,O,R,L,T)&&(g.gA=e,g.IA=n),-1===t.wI)12345678!==t.yI&&s.A.mI(R,L,T,S,x,O,t.yI,t.pI,t.AI);else if(g.et){const i=g.pA[t.wI];s.A.mI(R,L,T,S,x,O,this.gI(i,t.yI),this.gI(i,t.pI),this.gI(i,t.AI))}else t.flat?s.A.II(R,L,T,S,x,O,t.yI,t.pI,t.AI,d,A,y,m,l,I,C,c,u,t.wI):s.A.II(R,L,T,S,x,O,t.yI,t.pI,t.AI,f,_,p,l,m,C,I,u,c,t.wI);if(!((v-T)*(x-O)-(b-O)*(L-T)<=0))if(s.A.fI=v<0||T<0||L<0||v>w.A.uI||T>w.A.uI||L>w.A.uI,g.eA&&this.dI(g.Ha,g.Va,b,O,x,v,T,L)&&(g.gA=e,g.IA=n),-1!==t.wI){if(!g.et)return void s.A.II(v,T,L,b,O,x,t._I,t.AI,t.pI,d,A,y,m,l,I,C,c,u,t.wI);const i=g.pA[t.wI];s.A.mI(v,T,L,b,O,x,this.gI(i,t._I),this.gI(i,t.AI),this.gI(i,t.pI))}else 12345678!==t._I&&s.A.mI(v,T,L,b,O,x,t._I,t.AI,t.pI)};Jg=(t,i,e,n,r,h,o)=>{let a=e.Bd.length;for(let t=0;t>16;if(l=l*o-i*h>>16,i=c,c=a*r-l*n>>16,l=a*n+l*r>>16,a=c,l<50)return;e.CI&&(y.A.EI[t]=i,y.A.vI[t]=a,y.A.bI[t]=l),y.A.TI[t]=s.A.yl+((i<<9)/l|0),y.A.OI[t]=s.A.ml+((a<<9)/l|0)}s.A.alpha=0,a=e.RI.length;for(let n=0;n0)if(s.A.fI=a<0||l<0||c<0||a>w.A.uI||l>w.A.uI||c>w.A.uI,g.eA&&this.dI(g.Ha,g.Va,f,u,d,a,l,c)&&(g.gA=t,g.IA=i),e.CI&&-1!==e.CI[n])if(g.et){const t=g.pA[e.CI[n]];s.A.mI(a,l,c,f,u,d,this.gI(t,e.xI[n]),this.gI(t,e.kI[n]),this.gI(t,e.MI[n]))}else e.flat?s.A.II(a,l,c,f,u,d,e.xI[n],e.kI[n],e.MI[n],y.A.EI[0],y.A.vI[0],y.A.bI[0],y.A.EI[1],y.A.EI[3],y.A.vI[1],y.A.vI[3],y.A.bI[1],y.A.bI[3],e.CI[n]):s.A.II(a,l,c,f,u,d,e.xI[n],e.kI[n],e.MI[n],y.A.EI[r],y.A.vI[r],y.A.bI[r],y.A.EI[h],y.A.EI[o],y.A.vI[h],y.A.vI[o],y.A.bI[h],y.A.bI[o],e.CI[n]);else 12345678!==e.xI[n]&&s.A.mI(a,l,c,f,u,d,e.xI[n],e.kI[n],e.MI[n])}};Zg=(t,i,e)=>{const s=this.bA[t][i][e];if(s===-g.Dp)return!1;if(s===g.Dp)return!0;{const s=i<<7,n=e<<7;return this.DI(s+1,this.EA[t][i][e],n+1)&&this.DI(s+128-1,this.EA[t][i+1][e],n+1)&&this.DI(s+128-1,this.EA[t][i+1][e+1],n+128-1)&&this.DI(s+1,this.EA[t][i][e+1],n+128-1)?(this.bA[t][i][e]=g.Dp,!0):(this.bA[t][i][e]=-g.Dp,!1)}};nI=(t,i,e,s)=>{if(!this.Zg(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.EA[t][i][e]-1,o=h-120,a=h-230,l=h-238;if(s<16){if(1===s){if(n>g.Kp){if(!this.DI(n,h,r))return!1;if(!this.DI(n,h,r+128))return!1}if(t>0){if(!this.DI(n,o,r))return!1;if(!this.DI(n,o,r+128))return!1}return!!this.DI(n,a,r)&&this.DI(n,a,r+128)}if(2===s){if(r0){if(!this.DI(n,o,r+128))return!1;if(!this.DI(n+128,o,r+128))return!1}return!!this.DI(n,a,r+128)&&this.DI(n+128,a,r+128)}if(4===s){if(n0){if(!this.DI(n+128,o,r))return!1;if(!this.DI(n+128,o,r+128))return!1}return!!this.DI(n+128,a,r)&&this.DI(n+128,a,r+128)}if(8===s){if(r>g.jp){if(!this.DI(n,h,r))return!1;if(!this.DI(n+128,h,r))return!1}if(t>0){if(!this.DI(n,o,r))return!1;if(!this.DI(n+128,o,r))return!1}return!!this.DI(n,a,r)&&this.DI(n+128,a,r)}}return!!this.DI(n+64,l,r+64)&&(16===s?this.DI(n,a,r+128):32===s?this.DI(n+128,a,r+128):64===s?this.DI(n+128,a,r):128===s?this.DI(n,a,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.Zg(t,i,e)){const n=i<<7,r=e<<7;return this.DI(n+1,this.EA[t][i][e]-s,r+1)&&this.DI(n+128-1,this.EA[t][i+1][e]-s,r+1)&&this.DI(n+128-1,this.EA[t][i+1][e+1]-s,r+128-1)&&this.DI(n+1,this.EA[t][i][e+1]-s,r+128-1)}return!1};cI=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.bA[t][h][o]===-g.Dp)return!1;o=1+(i<<7);const a=2+(s<<7),l=this.EA[t][i][s]-r;if(!this.DI(o,l,a))return!1;const c=(e<<7)-1;if(!this.DI(c,l,a))return!1;const f=(n<<7)-1;return!!this.DI(o,l,f)&&this.DI(c,l,f)}return!!this.Zg(t,i,s)&&(h=i<<7,o=s<<7,this.DI(h+1,this.EA[t][i][s]-r,o+1)&&this.DI(h+128-1,this.EA[t][i+1][s]-r,o+1)&&this.DI(h+128-1,this.EA[t][i+1][s+1]-r,o+128-1)&&this.DI(h+1,this.EA[t][i][s+1]-r,o+128-1))};DI=(t,i,e)=>{for(let s=0;s0){const t=n.Eg+(n.Wg*s>>8),r=n.vg+(n.Yg*s>>8),h=n.Ig+(n.Hg*s>>8),o=n.jd+(n.Vg*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n._g;if(s>0){const t=n.Eg+(n.Wg*s>>8),r=n.vg+(n.Yg*s>>8),h=n.Ig+(n.Hg*s>>8),o=n.jd+(n.Vg*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.Eg-e;if(s>0){const e=n._g+(n.Kg*s>>8),r=n.Cg+(n.Xg*s>>8),h=n.Ig+(n.Hg*s>>8),o=n.jd+(n.Vg*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.Eg;if(s>0){const e=n._g+(n.Kg*s>>8),r=n.Cg+(n.Xg*s>>8),h=n.Ig+(n.Hg*s>>8),o=n.jd+(n.Vg*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.Ig;if(s>0){const i=n._g+(n.Kg*s>>8),r=n.Cg+(n.Xg*s>>8),h=n.Eg+(n.Wg*s>>8),o=n.vg+(n.Yg*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};dI=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const a=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*a>0&&a*((i-n)*(r-o)-(t-o)*(e-n))>0};gI=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{}},4197:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{NI;FI;BI;UI;index;ty;Ca;_a;constructor(t,i,e,s,n,r,h){super(),this.NI=i,this.FI=e,this.BI=s,this.UI=n,this.index=t,this.ty=r,h&&-1!==r.va&&this.ty.delay?(this.Ca=Math.random()*this.ty.Ea|0,this._a=Math.random()*this.ty.delay[this.Ca]|0):(this.Ca=-1,this._a=0)}}},9418:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(7121),n=e(1312),r=e(3867);class h extends s.A{x=0;z=0;Qg=0;GI=!1;size=1;Gl=-1;WI=-1;YI=-1;HI=-1;VI=-1;KI=-1;XI=-1;jI=null;zI=100;ZI=0;qI=0;JI=0;$I=0;QI=-1e3;t_=0;i_=0;e_=-1;s_=0;n_=0;r_=-1;h_=0;o_=0;a_=-1;l_=0;c_=0;f_=0;u_=0;d_=-1;w_=0;y_=0;m_=0;p_=0;A_=0;g_=0;I_=0;__=0;C_=0;E_=0;v_=0;Dp=0;height=0;b_=0;pathLength=0;T_=new Int32Array(10);O_=new Int32Array(10);R_=new r.fe(10,!1);S_=0;L_=-1;x_=-1;k_=-1;M_=-1;move(t,i,e){if(-1!==this.a_&&n.A.Do[this.a_].priority<=1&&(this.a_=-1),!t){const t=i-this.T_[0],s=e-this.O_[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.T_[t]=this.T_[t-1],this.O_[t]=this.O_[t-1],this.R_[t]=this.R_[t-1];return this.T_[0]=i,this.O_[0]=e,void(this.R_[0]=!1)}}this.pathLength=0,this.S_=0,this.T_[0]=i,this.O_[0]=e,this.x=128*this.T_[0]+64*this.size,this.z=128*this.O_[0]+64*this.size}step(t,i){let e=this.T_[0],s=this.O_[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.a_&&n.A.Do[this.a_].priority<=1&&(this.a_=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.T_[t]=this.T_[t-1],this.O_[t]=this.O_[t-1],this.R_[t]=this.R_[t-1];this.T_[0]=e,this.O_[0]=s,this.R_[0]=t}}},8268:(t,i,e)=>{e.d(i,{A:()=>d});var s=e(9418),n=e(8665),r=e(2679),h=e(8738),o=e(1312),a=e(8317),l=e(1302),c=e(3819),f=e(3867),u=e(9298);class d extends s.A{static D_=1;static N_=2;static F_=4;static B_=8;static P_=16;static U_=32;static G_=64;static W_=128;static Y_=256;static H_=512;static Ul=[u.A.V_,u.A.K_,u.A.X_,u.A.j_,u.A.z_,u.A.Z_,u.A.q_,u.A.J_,u.A.Q_,u.A.tC,u.A.iC,u.A.eC,u.A.sC,u.A.nC,u.A.rC,u.A.hC];static Pl=[[u.A.oC,u.A.aC,u.A.lC,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.mC,u.A.pC,u.A.AC],[u.A.gC,u.A.IC,u.A._C,u.A.CC,u.A.EC,u.A.vC,u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.SC,u.A.LC,u.A.xC,u.A.kC,u.A.MC,u.A.DC],[u.A.DC-1,u.A.gC+1,u.A.IC,u.A._C,u.A.CC,u.A.EC,u.A.vC,u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.SC,u.A.LC,u.A.xC,u.A.kC,u.A.MC],[u.A.NC,u.A.FC,u.A.BC,u.A.PC,u.A.UC,u.A.GC],[u.A.WC,u.A.YC,u.A.HC,u.A.VC,u.A.KC,u.A.XC,u.A.jC,u.A.zC]];static No=new r.A(200);name=null;visible=!1;ZC=0;qC=0;JC=new Uint16Array(12);$C=new Uint16Array(5);ic=0;QC=0n;y=0;tE=0;iE=0;eE=0;sE=0;nE=0;rE=null;Ug=0;Gg=0;zm=0;Zm=0;et=!1;draw(t){if(!this.visible)return null;let i=this.nw();if(this.height=i.jd,i.aw=!0,this.et)return i;if(-1!==this.d_&&-1!==this.w_){const t=h.A.Do[this.d_],e=n.A.Mu(t.Al(),!0,!t.Ad,!1);e.translate(-this.p_,0,0),e.Wl(),t.ty&&t.ty.frames&&e.Yl(t.ty.frames[this.w_]),e.Hd=null,e.Vd=null,128===t.ew&&128===t.sw||e.scale(t.ew,t.sw,t.ew),e.Hl(t.Id+64,t._d+850,-30,-50,-30,!0);const s=[i,e];i=n.A.hE(s,2)}if(this.rE&&(t>=this.iE&&(this.rE=null),t>=this.tE&&t=d.Pl[i].length)&&(e=0),this.$C[i]=e}this.Gl=t.mu,65535===this.Gl&&(this.Gl=-1),this.WI=t.mu,65535===this.WI&&(this.WI=-1),this.YI=t.mu,65535===this.YI&&(this.YI=-1),this.HI=t.mu,65535===this.HI&&(this.HI=-1),this.VI=t.mu,65535===this.VI&&(this.VI=-1),this.KI=t.mu,65535===this.KI&&(this.KI=-1),this.XI=t.mu,65535===this.XI&&(this.XI=-1),this.name=c.A.kl(c.A.Ml(t.oE)),this.ic=t.Au,this.visible=!0,this.QC=0n;for(let t=0;t<12;t++)this.QC<<=0x4n,this.JC[t]>=256&&(this.QC+=BigInt(this.JC[t])-256n);this.JC[0]>=256&&(this.QC+=BigInt(this.JC[0])-256n>>4n),this.JC[1]>=256&&(this.QC+=BigInt(this.JC[1])-256n>>8n);for(let t=0;t<5;t++)this.QC<<=0x3n,this.QC+=BigInt(this.$C[t]);this.QC<<=0x1n,this.QC+=BigInt(this.ZC)}ed(){if(!this.visible)return null;const t=new f.fe(12,null);let i=0;for(let e=0;e<12;e++){const s=this.JC[e];if(s>=256&&s<512&&(t[i++]=a.A.Do[s-256].ed()),s>=512){const e=l.A.get(s-512).ed(this.ZC);e&&(t[i++]=e)}}const e=n.A.Fl(t,i);for(let t=0;t<5;t++)0!==this.$C[t]&&(e.Bl(d.Pl[t][0],d.Pl[t][this.$C[t]]),1===t&&e.Bl(d.Ul[0],d.Ul[this.$C[t]]));return e}nw(){let t=this.QC,i=-1,e=-1,s=-1,r=-1;if(this.a_>=0&&0===this.f_){const n=o.A.Do[this.a_];if(n.frames&&(i=n.frames[this.l_]),this.r_>=0&&this.r_!==this.Gl){const t=o.A.Do[this.r_].frames;t&&(e=t[this.h_])}n.Jw>=0&&(s=n.Jw,t+=BigInt(s-this.JC[5])<<8n),n.$w>=0&&(r=n.$w,t+=BigInt(r-this.JC[3])<<16n)}else if(this.r_>=0){const t=o.A.Do[this.r_].frames;t&&(i=t[this.h_])}let h=d.No?.get(t);if(!h){const i=new f.fe(12,null);let e=0;for(let t=0;t<12;t++){let n=this.JC[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=a.A.Do[n-256].Al();t&&(i[e++]=t)}if(n>=512){const t=l.A.get(n-512).zw(this.ZC);t&&(i[e++]=t)}}h=n.A.Fl(i,e);for(let t=0;t<5;t++)0!==this.$C[t]&&(h.Bl(d.Pl[t][0],d.Pl[t][this.$C[t]]),1===t&&h.Bl(d.Ul[0],d.Ul[this.$C[t]]));h.Wl(),h.Hl(64,850,-30,-50,-30,!0),d.No?.put(t,h)}if(this.et)return h;const c=n.A.rw(h,!0);return-1!==i&&-1!==e?c.hw(i,e,o.A.Do[this.a_].Zw):-1!==i&&c.Yl(i),c.ow(),c.Hd=null,c.Vd=null,c}}},9222:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;model;eg;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.eg=n,this.info=r}}},1161:(t,i,e)=>{e.d(i,{A:()=>s});class s{level;y;x;z;model;$g;Qg;sg;mg;ng;pg;eg;info;lI=0;Dp=0;constructor(t,i,e,s,n,r,h,o,a,l,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.$g=r,this.Qg=h,this.sg=o,this.mg=a,this.ng=l,this.pg=c,this.eg=f,this.info=u}}},5748:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;aI;oI;hI;eg;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.aI=s,this.oI=n,this.hI=r,this.eg=h,this.offset=o}}},8256:(t,i,e)=>{e.d(i,{A:()=>s});class s{Ug;zm;Gg;Zm;type;_g;Cg;Eg;vg;Ig;jd;mode=0;Kg=0;Xg=0;Wg=0;Yg=0;Hg=0;Vg=0;constructor(t,i,e,s,n,r,h,o,a,l,c){this.Ug=t,this.zm=i,this.Gg=e,this.Zm=s,this.type=n,this._g=r,this.Cg=h,this.Eg=o,this.vg=a,this.Ig=l,this.jd=c}}},3795:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1982),n=e(3867);class r extends s.A{level;x;z;zg;WA;Bg;DA=null;FA=null;VA=null;KA=null;BA=null;YA=null;kA=null;GA=0;Pg=0;MA=0;visible=!1;update=!1;Dg=!1;Ng=0;eI=0;sI=0;tI=0;constructor(t,i,e){super(),this.zg=this.level=t,this.x=i,this.z=e,this.WA=new n.fe(5,null),this.Bg=new Int32Array(5)}}},2771:(t,i,e)=>{e.d(i,{A:()=>s});class s{static TI=new Int32Array(6);static OI=new Int32Array(6);static EI=new Int32Array(6);static vI=new Int32Array(6);static bI=new Int32Array(6);static aE=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static lE=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static cE=128;static fE=this.cE/2|0;static uE=this.cE/4|0;static dE=3*this.cE/4|0;Bd;Ud;Pd;xI;kI;MI;RI;SI;LI;CI;flat;shape;angle;xg;kg;constructor(t,i,e,n,r,h,o,a,l,c,f,u,d,w,y,m,p,A,g){this.flat=!(p!==n||p!==w||p!==a),this.shape=i,this.angle=h,this.xg=d,this.kg=l;const I=s.aE[i],_=I.length;this.Bd=new Int32Array(_),this.Ud=new Int32Array(_),this.Pd=new Int32Array(_);const C=new Int32Array(_),E=new Int32Array(_),v=t*s.cE,b=A*s.cE;for(let t=0;t<_;t++){let i,l,f,d,A,_=I[t];!(1&_)&&_<=8&&(_=1+(_-h-h-1&7)),_>8&&_<=12&&(_=9+(_-h-9&3)),_>12&&_<=16&&(_=13+(_-h-13&3)),1===_?(i=v,l=b,f=p,d=o,A=c):2===_?(i=v+s.fE,l=b,f=p+n>>1,d=o+g>>1,A=c+e>>1):3===_?(i=v+s.cE,l=b,f=n,d=g,A=e):4===_?(i=v+s.cE,l=b+s.fE,f=n+w>>1,d=g+r>>1,A=e+y>>1):5===_?(i=v+s.cE,l=b+s.cE,f=w,d=r,A=y):6===_?(i=v+s.fE,l=b+s.cE,f=w+a>>1,d=r+m>>1,A=y+u>>1):7===_?(i=v,l=b+s.cE,f=a,d=m,A=u):8===_?(i=v,l=b+s.fE,f=a+p>>1,d=m+o>>1,A=u+c>>1):9===_?(i=v+s.fE,l=b+s.uE,f=p+n>>1,d=o+g>>1,A=c+e>>1):10===_?(i=v+s.dE,l=b+s.fE,f=n+w>>1,d=g+r>>1,A=e+y>>1):11===_?(i=v+s.fE,l=b+s.dE,f=w+a>>1,d=r+m>>1,A=y+u>>1):12===_?(i=v+s.uE,l=b+s.fE,f=a+p>>1,d=m+o>>1,A=u+c>>1):13===_?(i=v+s.uE,l=b+s.uE,f=p,d=o,A=c):14===_?(i=v+s.dE,l=b+s.uE,f=n,d=g,A=e):15===_?(i=v+s.dE,l=b+s.dE,f=w,d=r,A=y):(i=v+s.uE,l=b+s.dE,f=a,d=m,A=u),this.Bd[t]=i,this.Ud[t]=f,this.Pd[t]=l,C[t]=d,E[t]=A}const T=s.lE[i],O=T.length/4|0;this.RI=new Int32Array(O),this.SI=new Int32Array(O),this.LI=new Int32Array(O),this.xI=new Int32Array(O),this.kI=new Int32Array(O),this.MI=new Int32Array(O),this.CI=-1!==f?new Int32Array(O):null;let R=0;for(let t=0;t{e.d(i,{A:()=>s});class s{static up=0;static NA=1;static wE=2;static yE=3;static mE=4;static pE=5;static fE=6;static uE=7;static dE=8;static AE=9;static gE=10;static IE=11}},3479:(t,i,e)=>{e.d(i,{A:()=>s});class s{_I;AI;yI;pI;wI;color;flat;constructor(t,i,e,s,n,r,h){this._I=t,this.AI=i,this.yI=e,this.pI=s,this.wI=n,this.color=r,this.flat=h}}},6855:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;iI;rI;qA;$A;eg;info;constructor(t,i,e,s,n,r,h,o,a){this.y=t,this.x=i,this.z=e,this.iI=s,this.rI=n,this.qA=r,this.$A=h,this.eg=o,this.info=a}}},7441:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;type;angle;model;eg;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.eg=h,this.info=o}}},7536:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{_E;CE;constructor(t){this.CE=[],this._E=t;for(let i=0;i{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{vE;bE;constructor(){super(),this.vE=this,this.bE=this}TE(){this.bE&&this.vE&&(this.bE.vE=this.vE,this.vE.bE=this.bE,this.vE=null,this.bE=null)}}},3819:(t,i,e)=>{e.d(i,{A:()=>s});class s{static OE=['_','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','0','1','2','3','4','5','6','7','8','9'];static RE=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static Ml=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.OE[Number(s-37n*t)]}return e.slice(12-i).join('')};static SE=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static LE=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static kl=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static Lu=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}},6666:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{xE;cursor=null;constructor(){const t=new s.A;t.next=t,t.EE=t,this.xE=t}Km(t){t.EE&&t.yw(),t.EE=this.xE.EE,t.next=this.xE,t.EE&&(t.EE.next=t),t.next.EE=t}kE(t){t.EE&&t.yw(),t.EE=this.xE,t.next=this.xE.next,t.EE.next=t,t.next&&(t.next.EE=t)}jg(){const t=this.xE.next;return t===this.xE?null:(t?.yw(),t)}head(){const t=this.xE.next;return t===this.xE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}ME(){const t=this.xE.EE;return t===this.xE?(this.cursor=null,null):(this.cursor=t?.EE||null,t)}next(){const t=this.cursor;return t===this.xE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}EE(){const t=this.cursor;return t===this.xE?(this.cursor=null,null):(this.cursor=t?.EE||null,t)}clear(){for(;;){const t=this.xE.next;if(t===this.xE)return;t?.yw()}}}},1982:(t,i,e)=>{e.d(i,{A:()=>s});class s{key;next;EE;constructor(){this.key=0n,this.next=this,this.EE=this}yw(){this.EE&&this.next&&(this.EE.next=this.next,this.next.EE=this.EE,this.next=null,this.EE=null)}}},2679:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(2512),n=e(7536);class r{DE;NE;history;available;constructor(t){this.DE=t,this.available=t,this.NE=new n.A(1024),this.history=new s.A}get(t){const i=this.NE.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.yw(),t?.TE()}else this.available--;this.NE.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.yw(),t.TE()):this.available=this.DE}}},2512:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n{head;constructor(){this.head=new s.A}push(t){t.bE&&t.TE(),t.bE=this.head.bE,t.vE=this.head,t.bE&&(t.bE.vE=t),t.vE.bE=t}pop(){const t=this.head.vE;return t===this.head?null:(t?.TE(),t)}}},8534:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(3867);class r{static Do=[];static yu=t=>{const i=new s.A(t.read('base_head.dat')),e=new s.A(t.read('base_type.dat')),h=new s.A(t.read('base_label.dat')),o=i.mu;i.Af+=2;for(let t=0;t{e.d(i,{A:()=>r});var s=e(8534),n=e(1069);class r{static Do=[];static yu=t=>{const i=new n.A(t.read('frame_head.dat')),e=new n.A(t.read('frame_tran1.dat')),h=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),a=i.mu;i.Af+=2;const l=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){l[m]=i,c[m]=0,f[m]=0,u[m]=0,m++;break}l[m]=t;let e=0;3===d.types[l[m]]&&(e=128),c[m]=1&i?h.BE:e,f[m]=2&i?h.BE:e,u[m]=4&i?h.BE:e,y=t,m++}}n.length=m,n.PE=new Int32Array(m),n.x=new Int32Array(m),n.y=new Int32Array(m),n.z=new Int32Array(m);for(let t=0;t{e.d(i,{Nc:()=>s,na:()=>n,UE:()=>o,GE:()=>h,WE:()=>r});const s=document.getElementById('canvas'),n=s.getContext('2d',{willReadFrequently:!0}),r=document.createElement('canvas'),h=document.createElement('img'),o=r.getContext('2d',{willReadFrequently:!0})},9298:(t,i,e)=>{e.d(i,{A:()=>s});class s{static RED=16711680;static GREEN=65280;static BLUE=255;static qa=16776960;static YE=65535;static yp=16711935;static La=16777215;static Za=0;static HE=16748608;static VE=8388608;static KE=128;static XE=16756736;static jE=16740352;static zE=16723968;static ZE=12648192;static qE=8453888;static JE=4259584;static $E=9179409;static QE=6116423;static fa=2301979;static ua=5063219;static wa=7759444;static ma=3353893;static tv=8388736;static iv=13350793;static ev=Int32Array.of(s.qa,s.RED,s.GREEN,s.YE,s.yp,s.La);static oC=6798;static aC=107;static lC=10283;static cC=16;static fC=4797;static uC=7744;static dC=5799;static wC=4634;static yC=33697;static mC=22433;static pC=2983;static AC=54193;static gC=8741;static IC=12;static _C=64030;static CC=43162;static EC=7735;static vC=8404;static bC=1701;static TC=38430;static OC=24094;static RC=10153;static SC=56621;static LC=4783;static xC=1341;static kC=16578;static MC=35003;static DC=25239;static V_=9104;static K_=10275;static X_=7595;static j_=3610;static z_=7975;static Z_=8526;static q_=918;static J_=38802;static Q_=24466;static tC=10145;static iC=58654;static eC=5027;static sC=1457;static nC=16565;static rC=34991;static hC=25486;static NC=4626;static FC=11146;static BC=6439;static PC=12;static UC=4758;static GC=10270;static zC=4574;static WC=4550;static YC=4537;static HC=5681;static VC=5673;static KC=5790;static XC=6806;static jC=8076}},8950:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n extends s.A{static gw=new Int32Array;static Iw=0;static _w=0;static top=0;static bottom=0;static left=0;static right=0;static uI=0;static sv=0;static nv=0;static bind=(t,i,e)=>{this.gw=t,this.Iw=i,this._w=e,this.Ta(0,0,i,e)};static rv=()=>{this.left=0,this.top=0,this.right=this.Iw,this.bottom=this._w,this.uI=this.right-1,this.sv=this.right/2|0};static Ta=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.Iw&&(e=this.Iw),s>this._w&&(s=this._w),this.top=i,this.bottom=s,this.left=t,this.right=e,this.uI=this.right-1,this.sv=this.right/2|0,this.nv=this.bottom/2|0};static clear=()=>{const t=this.Iw*this._w;for(let i=0;i{this.ya(t,i,n,e),this.ya(t,i+s-1,n,e),this.da(t,i,n,s),this.da(t+e-1,i,n,s)};static ya=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.Iw;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.Iw;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(l-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.Iw-e;let h=t+i*this.Iw;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.gw[h++]=n;h+=r}};static ov(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,a=(n>>8&255)*r,l=(255&n)*r,c=this.Iw-e;let f=t+i*this.Iw;for(let t=0;t>16&255)*h>>8<<16)+(a+(this.gw[f]>>8&255)*h>>8<<8)+(l+(255&this.gw[f])*h>>8);this.gw[f++]=t}f+=c}}static av(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,a=(255&s)*n;let l=i-e;l<0&&(l=0);let c=i+e;c>=this._w&&(c=this._w-1);for(let s=l;s<=c;s++){const n=s-i,l=0|Math.sqrt(e*e-n*n);let c=t-l;c<0&&(c=0);let f=t+l;f>=this.Iw&&(f=this.Iw-1);let u=c+s*this.Iw;for(let t=c;t<=f;t++){const t=(h+(this.gw[u]>>16&255)*r>>8<<16)+(o+(this.gw[u]>>8&255)*r>>8<<8)+(a+(255&this.gw[u])*r>>8);this.gw[u++]=t}}}static lv=(t,i,e)=>{t=this.right||i=this.bottom||(this.gw[t+i*this.Iw]=e)}}},4583:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1673),r=e(3867);class h extends s.A{static et=!1;static cv=new Int32Array(512);static fv=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static uv=new r.fe(50,null);static dv=0;static Aw=new Int32Array;static yl=0;static ml=0;static Cw=!0;static fI=!1;static alpha=0;static wv=null;static yv=new r.fe(50,null);static mv=0;static Dp=0;static pv=new Int32Array(50);static Av=new r.fe(50,null);static gv=!1;static Iv=new r.fe(50,!1);static _v=new Int32Array(50);static{for(let t=1;t<512;t++)this.cv[t]=32768/t|0;for(let t=1;t<2048;t++)this.fv[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static So=()=>{this.cv=null,this.cv=null,this.sin=null,this.cos=null,this.Aw=null,this.uv=null,this.Iv=null,this._v=null,this.wv=null,this.yv=null,this.pv=null,this.palette=null,this.Av=null,console.log('Draw3D unloaded!')};static Fc=()=>{this.Aw=new Int32Array(s.A._w);for(let t=0;t{this.Aw=new Int32Array(i);for(let e=0;e{this.wv=null,this.yv.fill(null)};static vv=t=>{this.dv=0;for(let i=0;i<50;i++)try{this.uv[i]=n.A.xu(t,i.toString()),this.et&&128===this.uv[i]?.Xa?this.uv[i]?.bv():this.uv[i]?.kw(),this.dv++}catch(t){}};static wp=t=>{if(0!==this._v[t])return this._v[t];const i=this.Av[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.Tv(h,1.4),0===h&&(h=1),this._v[t]=h,h};static Ov=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,a=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let l=s-.3333333333333333;l<0&&l++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,a=6*l<1?i+6*(t-i)*l:2*l<1?t:3*l<2?i+(t-i)*(.6666666666666666-l)*6:i}const l=((256*h|0)<<16)+((256*o|0)<<8)+(256*a|0);this.palette[e++]=this.Tv(l,i)}}for(let t=0;t<50;t++){const e=this.uv[t];if(!e)continue;const s=e.palette;this.Av[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static Sv=t=>{this.wv||(this.mv=t,this.et?this.wv=new r.Xr(t,16384):this.wv=new r.Xr(t,65536),this.yv.fill(null))};static mI=(t,i,e,n,r,o,a,l,c)=>{let f=0,u=0;r!==n&&(f=(i-t<<16)/(r-n)|0,u=(l-a<<15)/(r-n)|0);let d=0,w=0;o!==r&&(d=(e-i<<16)/(o-r)|0,w=(c-l<<15)/(o-r)|0);let y=0,m=0;if(o!==n&&(y=(t-e<<16)/(n-o)|0,m=(a-c<<15)/(n-o)|0),n<=r&&n<=o){if(ns.A.bottom&&(r=s.A.bottom),o>s.A.bottom&&(o=s.A.bottom),rd)for(o-=r,r-=n,n=h.Aw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Lv(e>>16,i>>16,c>>7,l>>7,s.A.gw,n,0),e+=y,i+=d,c+=m,l+=w,n+=s.A.Iw}this.Lv(e>>16,t>>16,c>>7,a>>7,s.A.gw,n,0),e+=y,t+=f,c+=m,a+=u,n+=s.A.Iw}else for(o-=r,r-=n,n=h.Aw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Lv(i>>16,e>>16,l>>7,c>>7,s.A.gw,n,0),e+=y,i+=d,c+=m,l+=w,n+=s.A.Iw}this.Lv(t>>16,e>>16,a>>7,c>>7,s.A.gw,n,0),e+=y,t+=f,c+=m,a+=u,n+=s.A.Iw}else if(i=t<<=16,l=a<<=15,n<0&&(i-=y*n,t-=f*n,l-=m*n,a-=u*n,n=0),e<<=16,c<<=15,o<0&&(e-=d*o,c-=w*o,o=0),n!==o&&yf)for(r-=o,o-=n,n=h.Aw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Lv(e>>16,t>>16,c>>7,a>>7,s.A.gw,n,0),e+=d,t+=f,c+=w,a+=u,n+=s.A.Iw}this.Lv(i>>16,t>>16,l>>7,a>>7,s.A.gw,n,0),i+=y,t+=f,l+=m,a+=u,n+=s.A.Iw}else for(r-=o,o-=n,n=h.Aw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Lv(t>>16,e>>16,a>>7,c>>7,s.A.gw,n,0),e+=d,t+=f,c+=w,a+=u,n+=s.A.Iw}this.Lv(t>>16,i>>16,a>>7,l>>7,s.A.gw,n,0),i+=y,t+=f,l+=m,a+=u,n+=s.A.Iw}}else if(r<=o){if(rs.A.bottom&&(o=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),oy)for(n-=o,o-=r,r=h.Aw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Lv(t>>16,e>>16,a>>7,c>>7,s.A.gw,r,0),t+=f,e+=y,a+=u,c+=m,r+=s.A.Iw}this.Lv(t>>16,i>>16,a>>7,l>>7,s.A.gw,r,0),t+=f,i+=d,a+=u,l+=w,r+=s.A.Iw}else for(n-=o,o-=r,r=h.Aw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Lv(e>>16,t>>16,c>>7,a>>7,s.A.gw,r,0),t+=f,e+=y,a+=u,c+=m,r+=s.A.Iw}this.Lv(i>>16,t>>16,l>>7,a>>7,s.A.gw,r,0),t+=f,i+=d,a+=u,l+=w,r+=s.A.Iw}else if(e=i<<=16,c=l<<=15,r<0&&(e-=f*r,i-=d*r,c-=u*r,l-=w*r,r=0),t<<=16,a<<=15,n<0&&(t-=y*n,a-=m*n,n=0),o-=n,n-=r,r=h.Aw[r],f>16,i>>16,a>>7,l>>7,s.A.gw,r,0),t+=y,i+=d,a+=m,l+=w,r+=s.A.Iw}this.Lv(e>>16,i>>16,c>>7,l>>7,s.A.gw,r,0),e+=f,i+=d,c+=u,l+=w,r+=s.A.Iw}else for(;;){if(--n<0)for(;;){if(--o<0)return;this.Lv(i>>16,t>>16,l>>7,a>>7,s.A.gw,r,0),t+=y,i+=d,a+=m,l+=w,r+=s.A.Iw}this.Lv(i>>16,e>>16,l>>7,c>>7,s.A.gw,r,0),e+=f,i+=d,c+=u,l+=w,r+=s.A.Iw}}else if(os.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,l>>7,a>>7,s.A.gw,o,0),i+=d,t+=f,l+=w,a+=u,o+=s.A.Iw}this.Lv(i>>16,e>>16,l>>7,c>>7,s.A.gw,o,0),i+=d,e+=y,l+=w,c+=m,o+=s.A.Iw}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Lv(t>>16,i>>16,a>>7,l>>7,s.A.gw,o,0),i+=d,t+=f,l+=w,a+=u,o+=s.A.Iw}this.Lv(e>>16,i>>16,c>>7,l>>7,s.A.gw,o,0),i+=d,e+=y,l+=w,c+=m,o+=s.A.Iw}else if(t=e<<=16,a=c<<=15,o<0&&(t-=d*o,e-=y*o,a-=w*o,c-=m*o,o=0),i<<=16,l<<=15,r<0&&(i-=f*r,l-=u*r,r=0),n-=r,r-=o,o=h.Aw[o],d>16,e>>16,l>>7,c>>7,s.A.gw,o,0),i+=f,e+=y,l+=u,c+=m,o+=s.A.Iw}this.Lv(t>>16,e>>16,a>>7,c>>7,s.A.gw,o,0),t+=d,e+=y,a+=w,c+=m,o+=s.A.Iw}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Lv(e>>16,i>>16,c>>7,l>>7,s.A.gw,o,0),i+=f,e+=y,l+=u,c+=m,o+=s.A.Iw}this.Lv(e>>16,t>>16,c>>7,a>>7,s.A.gw,o,0),t+=d,e+=y,a+=w,c+=m,o+=s.A.Iw}};static Lv=(t,i,e,n,r,o,a)=>{let l;if(h.Cw){let c;if(h.fI){if(c=i-t>3?(n-e)/(i-t)|0:0,i>s.A.uI&&(i=s.A.uI),t<0&&(e-=t*c,t=0),t>=i)return;o+=t,a=i-t>>2,c<<=2}else{if(!(t>2)>0?(n-e)*h.cv[a]>>15:0}if(0===h.alpha)for(;;){if(--a<0){if((a=i-t&3)>0){l=h.palette[e>>8];do{r[o++]=l,a--}while(a>0);return}break}l=h.palette[e>>8],e+=c,r[o++]=l,r[o++]=l,r[o++]=l,r[o++]=l}else{const s=h.alpha,n=256-h.alpha;for(;;){if(--a<0){if((a=i-t&3)>0){l=h.palette[e>>8],l=((16711935&l)*n>>8&16711935)+((65280&l)*n>>8&65280);do{r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),a--}while(a>0)}break}l=h.palette[e>>8],e+=c,l=((16711935&l)*n>>8&16711935)+((65280&l)*n>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280)}}}else if(ts.A.uI&&(i=s.A.uI),t<0&&(e-=t*c,t=0),t>=i))return;if(o+=t,a=i-t,0===h.alpha)do{r[o++]=h.palette[e>>8],e+=c,a--}while(a>0);else{const t=h.alpha,i=256-h.alpha;do{l=h.palette[e>>8],e+=c,l=((16711935&l)*i>>8&16711935)+((65280&l)*i>>8&65280),r[o++]=l+((16711935&r[o])*t>>8&16711935)+((65280&r[o])*t>>8&65280),a--}while(a>0)}}};static xv=(t,i,e,n,r,h,o)=>{let a=0;r!==n&&(a=(i-t<<16)/(r-n)|0);let l=0;h!==r&&(l=(e-i<<16)/(h-r)|0);let c=0;if(h!==n&&(c=(t-e<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),rl)for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.kv(e>>16,i>>16,s.A.gw,n,o),e+=c,i+=l,n+=s.A.Iw}this.kv(e>>16,t>>16,s.A.gw,n,o),e+=c,t+=a,n+=s.A.Iw}else for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.kv(i>>16,e>>16,s.A.gw,n,o),e+=c,i+=l,n+=s.A.Iw}this.kv(t>>16,e>>16,s.A.gw,n,o),e+=c,t+=a,n+=s.A.Iw}else if(i=t<<=16,n<0&&(i-=c*n,t-=a*n,n=0),e<<=16,h<0&&(e-=l*h,h=0),n!==h&&ca)for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.kv(e>>16,t>>16,s.A.gw,n,o),e+=l,t+=a,n+=s.A.Iw}this.kv(i>>16,t>>16,s.A.gw,n,o),i+=c,t+=a,n+=s.A.Iw}else for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.kv(t>>16,e>>16,s.A.gw,n,o),e+=l,t+=a,n+=s.A.Iw}this.kv(t>>16,i>>16,s.A.gw,n,o),i+=c,t+=a,n+=s.A.Iw}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hc)for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.kv(t>>16,e>>16,s.A.gw,r,o),t+=a,e+=c,r+=s.A.Iw}this.kv(t>>16,i>>16,s.A.gw,r,o),t+=a,i+=l,r+=s.A.Iw}else for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.kv(e>>16,t>>16,s.A.gw,r,o),t+=a,e+=c,r+=s.A.Iw}this.kv(i>>16,t>>16,s.A.gw,r,o),t+=a,i+=l,r+=s.A.Iw}else if(e=i<<=16,r<0&&(e-=a*r,i-=l*r,r=0),t<<=16,n<0&&(t-=c*n,n=0),a>16,i>>16,s.A.gw,r,o),t+=c,i+=l,r+=s.A.Iw}this.kv(e>>16,i>>16,s.A.gw,r,o),e+=a,i+=l,r+=s.A.Iw}else for(h-=n,n-=r,r=this.Aw[r];;){if(--n<0)for(;;){if(--h<0)return;this.kv(i>>16,t>>16,s.A.gw,r,o),t+=c,i+=l,r+=s.A.Iw}this.kv(i>>16,e>>16,s.A.gw,r,o),e+=a,i+=l,r+=s.A.Iw}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.gw,h,o),i+=l,t+=a,h+=s.A.Iw}this.kv(i>>16,e>>16,s.A.gw,h,o),i+=l,e+=c,h+=s.A.Iw}else for(r-=n,n-=h,h=this.Aw[h];;){if(--n<0)for(;;){if(--r<0)return;this.kv(t>>16,i>>16,s.A.gw,h,o),i+=l,t+=a,h+=s.A.Iw}this.kv(e>>16,i>>16,s.A.gw,h,o),i+=l,e+=c,h+=s.A.Iw}else if(t=e<<=16,h<0&&(t-=l*h,e-=c*h,h=0),i<<=16,r<0&&(i-=a*r,r=0),l>16,e>>16,s.A.gw,h,o),i+=a,e+=c,h+=s.A.Iw}this.kv(t>>16,e>>16,s.A.gw,h,o),t+=l,e+=c,h+=s.A.Iw}else for(n-=r,r-=h,h=this.Aw[h];;){if(--r<0)for(;;){if(--n<0)return;this.kv(e>>16,i>>16,s.A.gw,h,o),i+=a,e+=c,h+=s.A.Iw}this.kv(e>>16,t>>16,s.A.gw,h,o),t+=l,e+=c,h+=s.A.Iw}};static II=(t,i,e,n,r,h,o,a,l,c,f,u,d,w,y,m,p,A,g)=>{const I=this.Mv(g);this.gv=!this.Iv[g];const _=c-d,C=f-y,E=u-p,v=w-c,b=m-f,T=A-u;let O=v*f-b*c<<14;const R=b*u-T*f<<8,S=T*c-v*u<<5;let L=_*f-C*c<<14;const x=C*u-E*f<<8,k=E*c-_*u<<5;let M=C*v-_*b<<14;const D=E*b-C*T<<8,N=_*T-E*v<<5;let F=0,B=0;r!==n&&(F=(i-t<<16)/(r-n)|0,B=(a-o<<16)/(r-n)|0);let P=0,U=0;h!==r&&(P=(e-i<<16)/(h-r)|0,U=(l-a<<16)/(h-r)|0);let G=0,W=0;if(h!==n&&(G=(t-e<<16)/(n-h)|0,W=(o-l<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),rP)for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Dv(e>>16,i>>16,s.A.gw,n,I,0,0,O,L,M,R,x,D,l>>8,a>>8),e+=G,i+=P,l+=W,a+=U,n+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(e>>16,t>>16,s.A.gw,n,I,0,0,O,L,M,R,x,D,l>>8,o>>8),e+=G,t+=F,l+=W,o+=B,n+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Dv(i>>16,e>>16,s.A.gw,n,I,0,0,O,L,M,R,x,D,a>>8,l>>8),e+=G,i+=P,l+=W,a+=U,n+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(t>>16,e>>16,s.A.gw,n,I,0,0,O,L,M,R,x,D,o>>8,l>>8),e+=G,t+=F,l+=W,o+=B,n+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}else{i=t<<=16,a=o<<=16,n<0&&(i-=G*n,t-=F*n,a-=W*n,o-=B*n,n=0),e<<=16,l<<=16,h<0&&(e-=P*h,l-=U*h,h=0);const c=n-this.ml;if(O+=S*c,L+=k*c,M+=N*c,O|=0,L|=0,M|=0,(n===h||G>=F)&&(n!==h||P<=F))for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Dv(t>>16,e>>16,s.A.gw,n,I,0,0,O,L,M,R,x,D,o>>8,l>>8),e+=P,t+=F,l+=U,o+=B,n+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(t>>16,i>>16,s.A.gw,n,I,0,0,O,L,M,R,x,D,o>>8,a>>8),i+=G,t+=F,a+=W,o+=B,n+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Dv(e>>16,t>>16,s.A.gw,n,I,0,0,O,L,M,R,x,D,l>>8,o>>8),e+=P,t+=F,l+=U,o+=B,n+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(i>>16,t>>16,s.A.gw,n,I,0,0,O,L,M,R,x,D,a>>8,o>>8),i+=G,t+=F,a+=W,o+=B,n+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hG)for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Dv(t>>16,e>>16,s.A.gw,r,I,0,0,O,L,M,R,x,D,o>>8,l>>8),t+=F,e+=G,o+=B,l+=W,r+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(t>>16,i>>16,s.A.gw,r,I,0,0,O,L,M,R,x,D,o>>8,a>>8),t+=F,i+=P,o+=B,a+=U,r+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Dv(e>>16,t>>16,s.A.gw,r,I,0,0,O,L,M,R,x,D,l>>8,o>>8),t+=F,e+=G,o+=B,l+=W,r+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(i>>16,t>>16,s.A.gw,r,I,0,0,O,L,M,R,x,D,a>>8,o>>8),t+=F,i+=P,o+=B,a+=U,r+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}else{e=i<<=16,l=a<<=16,r<0&&(e-=F*r,i-=P*r,l-=B*r,a-=U*r,r=0),t<<=16,o<<=16,n<0&&(t-=G*n,o-=W*n,n=0);const c=r-this.ml;if(O+=S*c,L+=k*c,M+=N*c,O|=0,L|=0,M|=0,h-=n,n-=r,r=this.Aw[r],F>16,i>>16,s.A.gw,r,I,0,0,O,L,M,R,x,D,o>>8,a>>8),t+=G,i+=P,o+=W,a+=U,r+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(e>>16,i>>16,s.A.gw,r,I,0,0,O,L,M,R,x,D,l>>8,a>>8),e+=F,i+=P,l+=B,a+=U,r+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(;;){if(--n<0)for(;;){if(--h<0)return;this.Dv(i>>16,t>>16,s.A.gw,r,I,0,0,O,L,M,R,x,D,a>>8,o>>8),t+=G,i+=P,o+=W,a+=U,r+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(i>>16,e>>16,s.A.gw,r,I,0,0,O,L,M,R,x,D,a>>8,l>>8),e+=F,i+=P,l+=B,a+=U,r+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.gw,h,I,0,0,O,L,M,R,x,D,a>>8,o>>8),i+=P,t+=F,a+=U,o+=B,h+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(i>>16,e>>16,s.A.gw,h,I,0,0,O,L,M,R,x,D,a>>8,l>>8),i+=P,e+=G,a+=U,l+=W,h+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Dv(t>>16,i>>16,s.A.gw,h,I,0,0,O,L,M,R,x,D,o>>8,a>>8),i+=P,t+=F,a+=U,o+=B,h+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(e>>16,i>>16,s.A.gw,h,I,0,0,O,L,M,R,x,D,l>>8,a>>8),i+=P,e+=G,a+=U,l+=W,h+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}else{t=e<<=16,o=l<<=16,h<0&&(t-=P*h,e-=G*h,o-=U*h,l-=W*h,h=0),i<<=16,a<<=16,r<0&&(i-=F*r,a-=B*r,r=0);const c=h-this.ml;if(O+=S*c,L+=k*c,M+=N*c,O|=0,L|=0,M|=0,n-=r,r-=h,h=this.Aw[h],P>16,e>>16,s.A.gw,h,I,0,0,O,L,M,R,x,D,a>>8,l>>8),i+=F,e+=G,a+=B,l+=W,h+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(t>>16,e>>16,s.A.gw,h,I,0,0,O,L,M,R,x,D,o>>8,l>>8),t+=P,e+=G,o+=U,l+=W,h+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Dv(e>>16,i>>16,s.A.gw,h,I,0,0,O,L,M,R,x,D,l>>8,a>>8),i+=F,e+=G,a+=B,l+=W,h+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Dv(e>>16,t>>16,s.A.gw,h,I,0,0,O,L,M,R,x,D,l>>8,o>>8),t+=P,e+=G,o+=U,l+=W,h+=s.A.Iw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}};static Dv=(t,i,e,n,r,h,o,a,l,c,f,u,d,w,y)=>{if(t>=i)return;let m,p,A,g,I,_,C,E,v;if(this.fI){if(m=(y-w)/(i-t)|0,i>s.A.uI&&(i=s.A.uI),t<0&&(w-=t*m,t=0),t>=i)return;p=i-t>>3,m<<=12}else i-t>7?(p=i-t>>3,m=(y-w)*this.cv[p]>>6):(p=0,m=0);if(w<<=9,n+=t,this.et&&r)if(A=0,g=0,_=t-this.yl,a+=(f>>3)*_,l+=(u>>3)*_,c+=(d>>3)*_,a|=0,l|=0,I=(c|=0)>>12,0!==I&&(o=l/I|0,(h=a/I|0)<0?h=0:h>4032&&(h=4032)),a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>12,0!==I&&(A=a/I|0,g=l/I|0,A<7?A=7:A>4032&&(A=4032)),C=A-h>>3,E=g-o>>3,h+=w>>3&786432,v=w>>23,this.gv){for(;p-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h=A,o=g,a+=f,l+=u,I=(c+=d)>>12,0!==I&&(A=a/I|0,g=l/I|0,A<7?A=7:A>4032&&(A=4032)),C=A-h>>3,E=g-o>>3,h+=(w+=m)>>3&786432,v=w>>23;for(p=i-t&7;p-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E}else{for(;p-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n+=1,h=A,o=g,a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>12,0!==I&&(A=a/I|0,g=l/I|0,A<7?A=7:A>4032&&(A=4032)),C=A-h>>3,E=g-o>>3,h+=(w+=m)>>3&786432,v=w>>23}for(p=i-t&7;p-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}else if(A=0,g=0,_=t-this.yl,a+=(f>>3)*_,l+=(u>>3)*_,c+=(d>>3)*_,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(o=l/I|0,(h=a/I|0)<0?h=0:h>16256&&(h=16256)),a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(A=a/I|0,g=l/I|0,A<7?A=7:A>16256&&(A=16256)),C=A-h>>3,E=g-o>>3,h+=6291456&w,v=w>>23,this.gv&&r){for(;p-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h=A,o=g,a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(A=a/I|0,g=l/I|0,A<7?A=7:A>16256&&(A=16256)),C=A-h>>3,E=g-o>>3,h+=6291456&(w+=m),v=w>>23;for(p=i-t&7;p-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E}else{for(;p-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,h=A,o=g,a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(A=a/I|0,g=l/I|0,A<7?A=7:A>16256&&(A=16256)),C=A-h>>3,E=g-o>>3,h+=6291456&(w+=m),v=w>>23}for(p=i-t&7;p-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}};static kv=(t,i,e,n,r)=>{if(this.fI&&(i>s.A.uI&&(i=s.A.uI),t<0&&(t=0)),t>=i)return;n+=t;let h=i-t>>2;if(0===this.alpha)for(;;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;e[n++]=r}e[n++]=r,e[n++]=r,e[n++]=r,e[n++]=r}const o=this.alpha,a=256-this.alpha;for(r=((16711935&r)*a>>8&16711935)+((65280&r)*a>>8&65280);;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}};static Rv=t=>{this.yv[t]&&this.wv&&(this.wv[this.mv++]=this.yv[t],this.yv[t]=null)};static Mv=t=>{if(this.pv[t]=this.Dp++,this.yv[t])return this.yv[t];let i;if(this.mv>0&&this.wv)i=this.wv[--this.mv],this.wv[this.mv]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.gw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.gw[t]];this.Iv[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.Iv[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}},880:(t,i,e)=>{e.d(i,{r:()=>n});var s=e(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(s.GE.src),s.GE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>s.GE.onload=()=>t())),s.UE.clearRect(0,0,s.WE.width,s.WE.height);const i=s.GE.naturalWidth,e=s.GE.naturalHeight;return s.WE.width=i,s.WE.height=e,s.UE.drawImage(s.GE,0,0),s.UE.getImageData(0,0,i,e)}},8665:(t,i,e)=>{e.d(i,{A:()=>f});var s=e(1069),n=e(8950),r=e(4583),h=e(6730),o=e(4474),a=e(3867);class l{Fd=0;Tg=0;Nv=0;Fv=-1;Bv=-1;Pv=-1;Uv=-1;Gv=-1;Wv=-1;Yv=-1;Hv=-1;Vv=-1;Kv=0;Xv=-1;jv=-1;zv=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static Zv=null;static qv=null;static Jv=null;static $v=null;static Qv=null;static tb=null;static ib=null;static eb=null;static sb=null;static nb=null;static rb=null;static hb=null;static axis=null;static ob=new a.fe(4096,!1);static ab=new a.fe(4096,!1);static lb=new Int32Array(4096);static cb=new Int32Array(4096);static fb=new Int32Array(4096);static ub=new Int32Array(4096);static wb=new Int32Array(4096);static yb=new Int32Array(4096);static mb=new Int32Array(1500);static pb=new a.Xr(1500,512);static Ab=new Int32Array(12);static gb=new a.Xr(12,2e3);static Ib=new Int32Array(2e3);static _b=new Int32Array(2e3);static Cb=new Int32Array(12);static Eb=new Int32Array(10);static vb=new Int32Array(10);static bb=new Int32Array(10);static Ir=0;static Tb=0;static _r=0;static Ob=!1;static Ha=0;static Va=0;static Rb=0;static Sb=new Int32Array(1e3);static Lb=!1;static yu(t){try{f.head=new s.A(t.read('ob_head.dat')),f.Zv=new s.A(t.read('ob_face1.dat')),f.qv=new s.A(t.read('ob_face2.dat')),f.Jv=new s.A(t.read('ob_face3.dat')),f.$v=new s.A(t.read('ob_face4.dat')),f.Qv=new s.A(t.read('ob_face5.dat')),f.tb=new s.A(t.read('ob_point1.dat')),f.ib=new s.A(t.read('ob_point2.dat')),f.eb=new s.A(t.read('ob_point3.dat')),f.sb=new s.A(t.read('ob_point4.dat')),f.nb=new s.A(t.read('ob_point5.dat')),f.rb=new s.A(t.read('ob_vertex1.dat')),f.hb=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.Af=0,f.tb.Af=0,f.ib.Af=0,f.eb.Af=0,f.sb.Af=0,f.rb.Af=0,f.hb.Af=0;const i=f.head.mu;f.metadata=new a.fe(i+100,null);let e=0,n=0,r=0,h=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Nd=(t,i,e)=>{const s=t.Fd,n=t.Tg,r=t.Nv;let h,o,l,u,d;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.Fd,r=t.Tg,h=t.Nv;let o,a,l,c,u;if(s)o=t.Bd,a=t.Ud,l=t.Pd;else{o=new Int32Array(n),a=new Int32Array(n),l=new Int32Array(n);for(let i=0;i{const e=t.Fd,s=t.Tg,n=t.Nv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,a=0,l=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,a=0,l=-1;for(let c=0;c{let o=-1;const a=t.Bd[i],l=t.Ud[i],c=t.Pd[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.Zv&&f.qv&&f.Jv&&f.$v&&f.Qv&&f.tb&&f.ib&&f.eb&&f.sb&&f.nb&&f.rb&&f.hb&&f.axis))throw new Error('cant loading model!!!!!');const e=i.Fd,s=i.Tg,n=i.Nv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),a=new Int32Array(s),l=new Int32Array(s),c=new Int32Array(s),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;i.Gv>=0&&(y=new Int32Array(e));let m=null;i.Vv>=0&&(m=new Int32Array(s));let p=null,A=0;i.Kv>=0?p=new Int32Array(s):A=-i.Kv-1;let g=null;i.Xv>=0&&(g=new Int32Array(s));let I=null;i.jv>=0&&(I=new Int32Array(s));const _=new Int32Array(s);f.tb.Af=i.Fv,f.ib.Af=i.Bv,f.eb.Af=i.Pv,f.sb.Af=i.Uv,f.nb.Af=i.Gv;let C,E,v,b=0,T=0,O=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const e=f.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const n=e.Fd,r=e.Tg,h=e.Nv,o=new Int32Array(n),a=new Int32Array(n),l=new Int32Array(n),c=new Int32Array(r),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(h),y=new Int32Array(h),m=new Int32Array(h);let p=null;e.Gv>=0&&(p=new Int32Array(n));let A=null;e.Vv>=0&&(A=new Int32Array(r));let g=null,I=0;e.Kv>=0?g=new Int32Array(r):I=-e.Kv-1;let _=null;e.Xv>=0&&(_=new Int32Array(r));let C=null;e.jv>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(e.data);v.Af=e.Fv;const b=new s.A(e.data);b.Af=e.Bv;const T=new s.A(e.data);T.Af=e.Pv;const O=new s.A(e.data);O.Af=e.Uv;const R=new s.A(e.data);R.Af=e.Gv;let S,L,x,k=0,M=0,D=0;for(let t=0;tthis.jd&&(this.jd=-e),e>this.Ig&&(this.Ig=e);const n=i*i+s*s;n>this.vp&&(this.vp=n)}this.vp=Math.sqrt(this.vp)+.99|0,this.Yb=Math.sqrt(this.vp*this.vp+this.jd*this.jd)+.99|0,this.Wb=this.Yb+(Math.sqrt(this.vp*this.vp+this.Ig*this.Ig)+.99|0)}Gd(){this.jd=0,this.Ig=0;for(let t=0;tthis.jd&&(this.jd=-i),i>this.Ig&&(this.Ig=i)}this.Yb=Math.sqrt(this.vp*this.vp+this.jd*this.jd)+.99|0,this.Wb=this.Yb+(Math.sqrt(this.vp*this.vp+this.Ig*this.Ig)+.99|0)}Wl(){if(this.Hb){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Vd=new a.fe(i+1,null);for(let e=0;e<=i;e++)this.Vd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Hd=new a.fe(i+1,null);for(let e=0;e<=i;e++)this.Hd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ea;)a=e[o++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==a||0===r.types[i])&&this.zb(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}f.Ir=0,f.Tb=0,f._r=0,o=0,a=e[o++];for(let t=0;ta;)a=e[o++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===a||0===r.types[i])&&this.zb(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.Yl(t)}Yl(t){if(!this.Vd||-1===t||!h.A.Do[t])return;const i=h.A.Do[t],e=i.FE;f.Ir=0,f.Tb=0,f._r=0;for(let t=0;t>16;this.Pd[t]=this.Ud[t]*i+this.Pd[t]*e>>16,this.Ud[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.Mb&&this.Db&&this.Nb||(this.Mb=new Int32Array(this.Tg),this.Db=new Int32Array(this.Tg),this.Nb=new Int32Array(this.Tg)),!this.ug){this.ug=new a.fe(this.Fd,null);for(let t=0;t8192||p>8192||A>8192||m<-8192||p<-8192||A<-8192;)m>>=1,p>>=1,A>>=1;let g=0|Math.sqrt(m*m+p*p+A*A);if(g<=0&&(g=1),m=256*m/g|0,p=256*p/g|0,A=256*A/g|0,this.bg&&1&this.bg[i]){const r=t+((e*m+s*p+n*A)/(h+(h/2|0))|0);this.ku&&(this.Mb[i]=f.kb(this.ku[i],r,this.bg[i]))}else{let t=this.ug[r];t&&(t.x+=m,t.y+=p,t.z+=A,t.w++),t=this.ug[o],t&&(t.x+=m,t.y+=p,t.z+=A,t.w++),t=this.ug[a],t&&(t.x+=m,t.y+=p,t.z+=A,t.w++)}}if(r)this.yg(t,h,e,s,n);else{this.gg=new a.fe(this.Fd,null);for(let t=0;t>16;for(let s=0;s>16,I=I*w-g*d>>16,g=A),0!==t&&(A=I*l-_*a>>16,_=I*a+_*l>>16,I=A),0!==i&&(A=_*c+g*u>>16,_=_*u-g*c>>16,g=A),g+=n,I+=h,_+=o,A=I*m-_*y>>16,_=I*y+_*m>>16,I=A,f.lb&&f.cb&&f.fb&&(f.fb[s]=_-p,f.lb[s]=r.A.yl+((g<<9)/_|0),f.cb[s]=r.A.ml+((I<<9)/_|0)),this.Nv>0&&f.ub&&f.wb&&f.yb&&(f.ub[s]=g,f.wb[s]=I,f.yb[s]=_)}try{this.Jb(!1,!1,0)}catch(t){}}draw(t,i,e,s,h,o,a,l,c){const u=l*h-o*s>>16,d=a*i+u*e>>16,w=this.vp*e>>16,y=d+w;if(y<=50||d>=3500)return;const m=l*s+o*h>>16;let p=m-this.vp<<9;if((p/y|0)>=n.A.sv)return;let A=m+this.vp<<9;if((A/y|0)<=-n.A.sv)return;const g=a*e-u*i>>16,I=this.vp*i>>16;let _=g+I<<9;if((_/y|0)<=-n.A.nv)return;let C=g-(I+(this.jd*e>>16))<<9;if((C/y|0)>=n.A.nv)return;let E=d-(w+(this.jd*i>>16))<=50,v=!1;if(c>0&&f.Ob){let t=d-w;t<=50&&(t=50),m>0?(p=p/y|0,A=A/t|0):(A=A/y|0,p=p/t|0),g>0?(C=C/y|0,_=_/t|0):(_=_/y|0,C=C/t|0);const i=f.Ha-r.A.yl,e=f.Va-r.A.ml;i>p&&iC&&e<_&&(this.aw?f.Sb[f.Rb++]=c:v=!0)}const b=r.A.yl,T=r.A.ml;let O=0,R=0;0!==t&&(O=r.A.sin[t],R=r.A.cos[t]);for(let n=0;n>16,w=w*R-c*O>>16,c=r),c+=o,u+=a,w+=l,r=w*s+c*h>>16,w=w*h-c*s>>16,c=r,r=u*e-w*i>>16,w=u*i+w*e>>16,u=r,f.fb&&(f.fb[n]=w-d),w>=50&&f.lb&&f.cb?(f.lb[n]=b+((c<<9)/w|0),f.cb[n]=T+((u<<9)/w|0)):f.lb&&(f.lb[n]=-5e3,E=!0),(E||this.Nv>0)&&f.ub&&f.wb&&f.yb&&(f.ub[n]=c,f.wb[n]=u,f.yb[n]=w)}try{this.Jb(E,v,c)}catch(t){}}Jb(t,i,e,s=!1){f.Lb&&(this.Xb=-1,this.jb=-1);for(let t=0;tn.A.uI||l>n.A.uI||c>n.A.uI),f.pb&&f.mb){const t=((y+m+p)/3|0)+this.Yb;f.pb[t][f.mb[t]++]=s,f.Lb&&this.$b(f.Ha,f.Va,u,d,w,a,l,c)&&this.jb=0;t--){const i=f.mb[t];if(!(i<=0)&&f.pb){const e=f.pb[t];for(let t=0;t=0;t--){const i=f.mb[t];if(i>0&&f.pb){const e=f.pb[t];for(let s=0;s0||f.Ab[2]>0)&&(r=(f.Cb[1]+f.Cb[2])/(f.Ab[1]+f.Ab[2])|0);let h=0;f.Ab&&f.Cb&&(f.Ab[3]>0||f.Ab[4]>0)&&(h=(f.Cb[3]+f.Cb[4])/(f.Ab[3]+f.Ab[4])|0);let o=0;if(f.Ab&&f.Cb&&(f.Ab[6]>0||f.Ab[8]>0)&&(o=(f.Cb[6]+f.Cb[8])/(f.Ab[6]+f.Ab[8])|0),f.Ab&&f.gb){let t,i=0,e=f.Ab[10],n=f.gb[10],a=f.Ib;i===e&&(i=0,e=f.Ab[11],n=f.gb[11],a=f._b),t=ir;)try{this.Qb(n[i++],s),i===e&&n!==f.gb[11]&&(i=0,e=f.Ab[11],n=f.gb[11],a=f._b),t=ih;)try{this.Qb(n[i++],s),i===e&&n!==f.gb[11]&&(i=0,e=f.Ab[11],n=f.gb[11],a=f._b),t=io;)try{this.Qb(n[i++],s),i===e&&n!==f.gb[11]&&(i=0,e=f.Ab[11],n=f.gb[11],a=f._b),t=i>2,h=this.Pb[i],o=this.Ub[i],a=this.Gb[i];r.A.II(f.lb[e],f.lb[s],f.lb[n],f.cb[e],f.cb[s],f.cb[n],this.Mb[t],this.Db[t],this.Nb[t],f.ub[h],f.wb[h],f.yb[h],f.ub[o],f.ub[a],f.wb[o],f.wb[a],f.yb[o],f.yb[a],this.ku[t])}else if(3===h&&this.bg&&this.ku&&this.Mb&&f.lb&&f.cb&&f.ub&&f.wb&&f.yb){const i=this.bg[t]>>2,h=this.Pb[i],o=this.Ub[i],a=this.Gb[i];r.A.II(f.lb[e],f.lb[s],f.lb[n],f.cb[e],f.cb[s],f.cb[n],this.Mb[t],this.Mb[t],this.Mb[t],f.ub[h],f.wb[h],f.yb[h],f.ub[o],f.ub[a],f.wb[o],f.wb[a],f.yb[o],f.yb[a],this.ku[t])}}tT(t,i=!1){let e=0;if(f.yb){const i=r.A.yl,s=r.A.ml,n=this.Og[t],h=this.Rg[t],o=this.Sg[t],a=f.yb[n],l=f.yb[h],c=f.yb[o];if(a>=50&&f.lb&&f.cb&&this.Mb)f.Eb[e]=f.lb[n],f.vb[e]=f.cb[n],f.bb[e++]=this.Mb[t];else if(f.ub&&f.wb&&this.Mb){const u=f.ub[n],d=f.wb[n],w=this.Mb[t];if(c>=50&&this.Nb){const n=(50-a)*r.A.fv[c-a];f.Eb[e]=i+((u+((f.ub[o]-u)*n>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[o]-d)*n>>16)<<9)/50|0),f.bb[e++]=w+((this.Nb[t]-w)*n>>16)}if(l>=50&&this.Db){const n=(50-a)*r.A.fv[l-a];f.Eb[e]=i+((u+((f.ub[h]-u)*n>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[h]-d)*n>>16)<<9)/50|0),f.bb[e++]=w+((this.Db[t]-w)*n>>16)}}if(l>=50&&f.lb&&f.cb&&this.Db)f.Eb[e]=f.lb[h],f.vb[e]=f.cb[h],f.bb[e++]=this.Db[t];else if(f.ub&&f.wb&&this.Db){const u=f.ub[h],d=f.wb[h],w=this.Db[t];if(a>=50&&this.Mb){const h=(50-l)*r.A.fv[a-l];f.Eb[e]=i+((u+((f.ub[n]-u)*h>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[n]-d)*h>>16)<<9)/50|0),f.bb[e++]=w+((this.Mb[t]-w)*h>>16)}if(c>=50&&this.Nb){const n=(50-l)*r.A.fv[c-l];f.Eb[e]=i+((u+((f.ub[o]-u)*n>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[o]-d)*n>>16)<<9)/50|0),f.bb[e++]=w+((this.Nb[t]-w)*n>>16)}}if(c>=50&&f.lb&&f.cb&&this.Nb)f.Eb[e]=f.lb[o],f.vb[e]=f.cb[o],f.bb[e++]=this.Nb[t];else if(f.ub&&f.wb&&this.Nb){const u=f.ub[o],d=f.wb[o],w=this.Nb[t];if(l>=50&&this.Db){const n=(50-c)*r.A.fv[l-c];f.Eb[e]=i+((u+((f.ub[h]-u)*n>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[h]-d)*n>>16)<<9)/50|0),f.bb[e++]=w+((this.Db[t]-w)*n>>16)}if(a>=50&&this.Mb){const h=(50-c)*r.A.fv[a-c];f.Eb[e]=i+((u+((f.ub[n]-u)*h>>16)<<9)/50|0),f.vb[e]=s+((d+((f.wb[n]-d)*h>>16)<<9)/50|0),f.bb[e++]=w+((this.Mb[t]-w)*h>>16)}}}const s=f.Eb[0],h=f.Eb[1],o=f.Eb[2],a=f.vb[0],l=f.vb[1],c=f.vb[2];if(!((s-h)*(c-l)-(a-l)*(o-h)<=0))if(r.A.fI=!1,3===e){let e;if((s<0||h<0||o<0||s>n.A.uI||h>n.A.uI||o>n.A.uI)&&(r.A.fI=!0),e=this.bg?3&this.bg[t]:0,i)r.A.hv(s,h,a,l,f.bb[0]),r.A.hv(h,o,l,c,f.bb[1]),r.A.hv(o,s,c,a,f.bb[2]);else if(0===e)r.A.mI(s,h,o,a,l,c,f.bb[0],f.bb[1],f.bb[2]);else if(1===e&&this.Mb)r.A.xv(s,h,o,a,l,c,r.A.palette[this.Mb[t]]);else if(2===e&&this.bg&&this.ku&&f.ub&&f.wb&&f.yb){const i=this.bg[t]>>2,e=this.Pb[i],n=this.Ub[i],u=this.Gb[i];r.A.II(s,h,o,a,l,c,f.bb[0],f.bb[1],f.bb[2],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t])}else if(3===e&&this.bg&&this.ku&&this.Mb&&f.ub&&f.wb&&f.yb){const i=this.bg[t]>>2,e=this.Pb[i],n=this.Ub[i],u=this.Gb[i];r.A.II(s,h,o,a,l,c,this.Mb[t],this.Mb[t],this.Mb[t],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t])}}else if(4===e){let e;if((s<0||h<0||o<0||s>n.A.uI||h>n.A.uI||o>n.A.uI||f.Eb[3]<0||f.Eb[3]>n.A.uI)&&(r.A.fI=!0),e=this.bg?3&this.bg[t]:0,i)r.A.hv(s,h,a,l,f.bb[0]),r.A.hv(h,o,l,c,f.bb[1]),r.A.hv(o,f.Eb[3],c,f.vb[3],f.bb[2]),r.A.hv(f.Eb[3],s,f.vb[3],a,f.bb[3]);else if(0===e)r.A.mI(s,h,o,a,l,c,f.bb[0],f.bb[1],f.bb[2]),r.A.mI(s,o,f.Eb[3],a,c,f.vb[3],f.bb[0],f.bb[2],f.bb[3]);else if(1===e){if(this.Mb){const i=r.A.palette[this.Mb[t]];r.A.xv(s,h,o,a,l,c,i),r.A.xv(s,o,f.Eb[3],a,c,f.vb[3],i)}}else if(2===e&&this.bg&&this.ku&&f.ub&&f.wb&&f.yb){const i=this.bg[t]>>2,e=this.Pb[i],n=this.Ub[i],u=this.Gb[i];r.A.II(s,h,o,a,l,c,f.bb[0],f.bb[1],f.bb[2],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t]),r.A.II(s,o,f.Eb[3],a,c,f.vb[3],f.bb[0],f.bb[2],f.bb[3],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t])}else if(3===e&&this.bg&&this.ku&&this.Mb&&f.ub&&f.wb&&f.yb){const i=this.bg[t]>>2,e=this.Pb[i],n=this.Ub[i],u=this.Gb[i];r.A.II(s,h,o,a,l,c,this.Mb[t],this.Mb[t],this.Mb[t],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t]),r.A.II(s,o,f.Eb[3],a,c,f.vb[3],this.Mb[t],this.Mb[t],this.Mb[t],f.ub[e],f.wb[e],f.yb[e],f.ub[n],f.ub[u],f.wb[n],f.wb[u],f.yb[n],f.yb[u],this.ku[t])}}}zb(t,i,e,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f.Ir=0,f.Tb=0,f._r=0;for(let t=0;t0?(f.Ir=(f.Ir/n|0)+t,f.Tb=(f.Tb/n|0)+i,f._r=(f._r/n|0)+e):(f.Ir=t,f.Tb=i,f._r=e)}else if(1===n)for(let n=0;n=this.Vd.length)continue;const h=this.Vd[r];if(h)for(let s=0;s=this.Vd.length)continue;const o=this.Vd[h];if(o)for(let s=0;s>16;this.Ud[n]=this.Ud[n]*u-this.Bd[n]*c>>16,this.Bd[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.Ud[n]*u-this.Pd[n]*c>>16;this.Pd[n]=this.Ud[n]*c+this.Pd[n]*u>>16,this.Ud[n]=t}if(0!==a){c=r.A.sin[a],u=r.A.cos[a];const t=this.Pd[n]*c+this.Bd[n]*u>>16;this.Pd[n]=this.Pd[n]*u-this.Bd[n]*c>>16,this.Bd[n]=t}this.Bd[n]+=f.Ir,this.Ud[n]+=f.Tb,this.Pd[n]+=f._r}}else if(3===n)for(let n=0;n=this.Vd.length)continue;const h=this.Vd[r];if(h)for(let s=0;s=this.Hd.length)continue;const n=this.Hd[e];if(n)for(let i=0;i255&&(this.Bb[e]=255)}}}qb(){this.jd=0,this.vp=0,this.Ig=0,this._g=999999,this.Cg=-999999,this.vg=-99999,this.Eg=99999;for(let t=0;tthis.Cg&&(this.Cg=i),sthis.vg&&(this.vg=s),-e>this.jd&&(this.jd=-e),e>this.Ig&&(this.Ig=e);const n=i*i+s*s;n>this.vp&&(this.vp=n)}this.vp=0|Math.sqrt(this.vp),this.Yb=0|Math.sqrt(this.vp*this.vp+this.jd*this.jd),this.Wb=this.Yb+(0|Math.sqrt(this.vp*this.vp+this.Ig*this.Ig))}$b(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{e.d(i,{A:()=>o});var s=e(8950),n=e(1069),r=e(4474),h=e(880);class o extends r.A{gw;width;height;eT;sT;Xa;ww;constructor(t,i){super(),this.gw=new Int32Array(t*i),this.width=this.Xa=t,this.height=this.ww=i,this.eT=this.sT=0}static nT=async(t,i)=>{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(0,h.r)(e),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),a=n.gw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static xu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.Af=s.mu;const h=r.mu,a=r.mu,l=[],c=r.Au-1;for(let t=0;ts.length||r.Af>r.length)throw new Error;const f=r.Au,u=r.Au,d=r.mu,w=r.mu,y=new o(d,w);y.eT=f,y.sT=u,y.Xa=h,y.ww=a;const m=r.Au;if(0===m){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.rT(h,r,this.gw,n,a,s.A.gw,e,o)}Ka(t,i,e){i|=0,e|=0;let n=(i+=this.eT)+(e+=this.sT)*s.A.Iw,r=0,h=this.height,o=this.width,a=s.A.Iw-o,l=0;if(es.A.bottom&&(h-=e+h-s.A.bottom),is.A.right){const t=i+o-s.A.right;o-=t,l+=t,a+=t}o>0&&h>0&&this.hT(o,h,this.gw,r,l,s.A.gw,n,a,t)}oT(t,i){t|=0,i|=0;let e=(t+=this.eT)+(i+=this.sT)*s.A.Iw,n=0,r=this.height,h=this.width,o=s.A.Iw-h,a=0;if(is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.aT(h,r,this.gw,n,a,s.A.gw,e,o)}lT(){const t=this.gw,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.gw[s]=(r<<16)+(h<<8)+o}}}kw(t,i,e,n){t|=0,i|=0,e|=0,n|=0;try{const r=this.width;let h=0,o=0;const a=this.Xa,l=this.ww,c=(a<<16)/e|0,f=(l<<16)/n|0;t+=(this.eT*e+a-1)/a|0,i+=(this.sT*n+l-1)/l|0,this.eT*e%a!=0&&(h=(a-this.eT*e%a<<16)/e|0),this.sT*n%l!=0&&(o=(l-this.sT*n%l<<16)/n|0),e=e*(this.width-(h>>16))/a|0,n=n*(this.height-(o>>16))/l|0;let u=t+i*s.A.Iw,d=s.A.Iw-e;if(is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right){const i=t+e-s.A.right;e-=i,d+=i}this.scale(e,n,this.gw,h,o,s.A.gw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}fT(t,i,e,n,r,h,o,a,l,c){t|=0,i|=0,e|=0,n|=0;try{const f=-e/2|0,u=-n/2|0,d=65536*Math.sin(l/326.11)|0,w=65536*Math.cos(l/326.11)|0,y=d*c>>8,m=w*c>>8;let p=(o<<16)+u*y+f*m,A=u*m-f*y+(a<<16),g=t+i*s.A.Iw;for(let t=0;t>16)+(o>>16)*this.width],n+=m,o-=y;p+=y,A+=m,g+=s.A.Iw}}catch(t){}}uT(t,i,e){t|=0,i|=0;let n=(t+=this.eT)+(i+=this.sT)*s.A.Iw,r=0,h=this.height,o=this.width,a=s.A.Iw-o,l=0;if(is.A.bottom&&(h-=i+h-s.A.bottom),ts.A.right){const i=t+o-s.A.right;o-=i,l+=i,a+=i}o>0&&h>0&&this.dT(o,h,this.gw,l,r,s.A.gw,n,a,e.gw)}scale(t,i,e,s,n,r,h,o,a,l,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*a;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=l}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}aT(t,i,e,s,n,r,h,o){const a=-(t>>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}hT(t,i,e,s,n,r,h,o,a){const l=256-a;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*a+(16711935&i)*l&4278255360)+((65280&t)*a+(65280&i)*l&16711680)>>8}}h+=o,s+=n}}rT(t,i,e,s,n,r,h,o){const a=-(t>>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}dT(t,i,e,s,n,r,h,o,a){const l=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=l;t<0;t++){let t=e[n++];0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===a[h]?r[h++]=t:h++}h+=o,n+=s}}}},1673:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1069),r=e(4474);class h extends r.A{gw;width;height;eT;sT;Xa;ww;palette;constructor(t,i,e){super(),this.gw=new Int8Array(t*i),this.width=this.Xa=t,this.height=this.ww=i,this.eT=this.sT=0,this.palette=e}static xu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.Af=s.mu;const o=r.mu,a=r.mu,l=r.Au,c=new Int32Array(l);for(let t=1;ts.length||r.Af>r.length)throw new Error;const f=r.Au,u=r.Au,d=r.mu,w=r.mu,y=new h(d,w,c);y.eT=f,y.sT=u,y.Xa=o,y.ww=a;const m=y.gw,p=r.Au;if(0===p){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.wT(h,r,this.gw,n,a,s.A.gw,e,o)}lT(){const t=this.gw,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}bv(){this.Xa|=0,this.ww|=0,this.Xa/=2,this.ww/=2,this.Xa|=0,this.ww|=0;const t=new Int8Array(this.Xa*this.ww);let i=0;for(let e=0;e>1)+(e+this.sT>>1)*this.Xa]=this.gw[i++];this.gw=t,this.width=this.Xa,this.height=this.ww,this.eT=0,this.sT=0}kw(){if(this.width===this.Xa&&this.height===this.ww)return;const t=new Int8Array(this.Xa*this.ww);let i=0;for(let e=0;e>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,n){try{const r=this.width;this.height;let h=0,o=0;const a=this.Xa,l=this.ww,c=(a<<16)/e|0,f=(l<<16)/n|0;t=t+(this.eT*e+a-1)/a|0,i=i+(this.sT*n+l-1)/l|0,this.eT*e%a!=0&&(h=(a-this.eT*e%a<<16)/e|0),this.sT*n%l!=0&&(o=(l-this.sT*n%l<<16)/n|0),e=e*(this.width-(h>>16))/a|0,n=n*(this.height-(o>>16))/l|0;let u,d=t+i*s.A.Iw,w=s.A.Iw-e;is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right&&(u=t+e-s.A.right,e-=u,w+=u),this.yT(s.A.gw,this.gw,this.palette,h,o,d,w,e,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}yT(t,i,e,s,n,r,h,o,a,l,c,f){try{const u=s;for(let d=-a;d<0;d++){const a=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+a];0==n?r++:t[r++]=e[255&n],s+=l}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(8950),n=e(1069),r=e(4474);class h{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}mT(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}pT(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=e(9298);class a extends r.A{static AT='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static gT=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let e=a.AT.indexOf(String.fromCharCode(i));t&&e>=63&&e--,-1===e&&(e=74),a.gT[i]=e}}IT=[];_T=new Int32Array(94);CT=new Int32Array(94);ET=new Int32Array(94);vT=new Int32Array(94);bT=new Int32Array(95);TT=new Int32Array(256);random=new h(BigInt(Date.now()));height=0;static xu=(t,i)=>{const e=new n.A(t.read(i+'.dat')),s=new n.A(t.read('index.dat'));s.Af=e.mu+4;const r=s.Au;r>0&&(s.Af+=3*(r-1));const h=new a;for(let t=0;t<94;t++){h.ET[t]=s.Au,h.vT[t]=s.Au;const i=h._T[t]=s.mu,n=h.CT[t]=s.mu,r=s.Au,o=i*n;if(h.IT[t]=new Int8Array(o),0===r)for(let s=0;sh.height&&(h.height=n),h.ET[t]=1,h.bT[t]=i+2;{let e=0;for(let s=n/7|0;s=s.A.bottom&&(r-=e+r+1-s.A.bottom),i=s.A.right){const t=i+n+1-s.A.right;n-=t,l+=t,a+=t}n>0&&r>0&&this.NT(n,r,t,c,l,s.A.gw,o,a,h)}kT(t,i,e,n,r,h,o){e|=0,n|=0;let a=(t|=0)+(i|=0)*s.A.Iw,l=s.A.Iw-e,c=0,f=0;if(i=s.A.bottom&&(n-=i+n+1-s.A.bottom),t=s.A.right){const i=t+e+1-s.A.right;e-=i,c+=i,l+=i}e>0&&n>0&&this.FT(e,n,s.A.gw,a,l,o,f,c,r,h)}NT(t,i,e,s,n,r,h,o,a){const l=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=l;t<0;t++)0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a;for(let i=t;i<0;i++)0===e[s++]?h++:r[h++]=a;h+=o,s+=n}}FT(t,i,e,s,n,r,h,o,a,l){t|=0;const c=((16711935&a)*l&4278255360)+((65280&a)*l&16711680)>>8,f=256-l;for(let a=-(i|=0);a<0;a++){for(let i=-t;i<0;i++)if(0===r[h++])s++;else{const t=e[s];e[s++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}s+=n,h+=o}}RT(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.qa:'cya'===t?o.A.YE:'mag'===t?o.A.yp:'whi'===t?o.A.La:'bla'===t?o.A.Za:'lre'===t?o.A.HE:'dre'===t?o.A.VE:'dbl'===t?o.A.KE:'or1'===t?o.A.XE:'or2'===t?o.A.jE:'or3'===t?o.A.zE:'gr1'===t?o.A.ZE:'gr2'===t?o.A.qE:'gr3'===t?o.A.JE:o.A.Za}split(t,i){if(0===t.length)return[t];const e=[];for(;t.length>0;){if(this.ST(t)<=i&&-1===t.indexOf('|')){e.push(t);break}let s=t.length;for(let e=0;ei)break;s=e}else if('|'===t[e]){s=e;break}e.push(t.substring(0,s)),t=t.substring(s+1)}return e}}},1183:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(8950),n=e(7854);class r{BT;width;height;PT;UT;gw;constructor(t,i,e=n.na){this.PT=e,this.BT=this.PT.getImageData(0,0,t,i),this.UT=new Uint32Array(this.BT.data.buffer),this.gw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.gw.fill(0)}bind(){s.A.bind(this.gw,this.width,this.height)}draw(t,i){this.#t(),this.PT.putImageData(this.BT,t,i)}#t(){const t=this.gw.length,i=this.gw,e=this.UT;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,i,e)=>{e.d(i,{A:()=>s});class s{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));zo=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Qo=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};GT=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}},2901:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(1908);class r{static GT=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.YT)return null;if(this.jT[t])return this.jT[t];const i=this.XT[t],e=i+this.KT[t];if(this.WT){const s=Uint8Array.from(this.buffer.subarray(i,i+e));return this.jT[t]=s,s}{const i=Uint8Array.from(n.A.read(this.VT[t],this.buffer,this.KT[t],this.XT[t]));return this.jT[t]=i,i}}}},1069:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(9234),n=e(6666),r=e(4474);class h extends r.A{static ZT=3988292384;static qT=new Int32Array(256);static JT=new Uint32Array(33);static $T=new n.A;static QT=new n.A;static tO=new n.A;static iO=0;static eO=0;static sO=0;static{for(let t=0;t<32;t++)h.JT[t]=(1<>>=1:i=i>>>1^h.ZT;h.qT[t]=i}}static Zo=t=>{let i=4294967295;for(let e=0;e>>8^h.qT[255&(i^t[e])];return~i};view;data;Af=0;nO=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.Af}static Pt=t=>{let i=null;return 0===t&&h.iO>0?(h.iO--,i=h.$T.jg()):1===t&&h.eO>0?(h.eO--,i=h.QT.jg()):2===t&&h.sO>0&&(h.sO--,i=h.tO.jg()),i?(i.Af=0,i):new h(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.Af=0,100===this.view.byteLength&&h.iO<1e3?(h.$T.Km(this),h.iO++):5e3===this.view.byteLength&&h.eO<250?(h.QT.Km(this),h.eO++):3e4===this.view.byteLength&&h.sO<50&&(h.tO.Km(this),h.sO++)}get Au(){return this.view.getUint8(this.Af++)}get Dd(){return this.view.getInt8(this.Af++)}get mu(){const t=this.view.getUint16(this.Af);return this.Af+=2,t}get Iu(){const t=this.view.getInt16(this.Af);return this.Af+=2,t}get qu(){const t=this.view.getUint8(this.Af++)<<16|this.view.getUint16(this.Af);return this.Af+=2,t}get ia(){const t=this.view.getInt32(this.Af);return this.Af+=4,t}get oE(){const t=this.view.getBigInt64(this.Af);return this.Af+=8,t}get BE(){return this.view.getUint8(this.Af)<128?this.Au-64:this.mu-49152}get Ep(){return this.view.getUint8(this.Af)<128?this.Au:this.mu-32768}get Eu(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.Af++))&&this.Af>16),this.view.setUint16(this.Af,t),this.Af+=2}p4(t){this.view.setInt32(this.Af,t),this.Af+=4}aO(t){this.view.setInt32(this.Af,t,!0),this.Af+=4}lO(t){this.view.setBigInt64(this.Af,t),this.Af+=8}cO(t){const i=this.view,e=t.length;for(let s=0;s>>3}yO(t){let i=this.nO>>>3,e=8-(7&this.nO),s=0;for(this.nO+=t;t>e;e=8)s+=(this.view.getUint8(i++)&h.JT[e])<>>e-t&h.JT[t],s}mO(t,i){const e=this.Af;this.Af=0;const n=new Uint8Array(e);this.rO(e,0,n);const r=(0,s.pO)(n),h=(0,s.AO)(r,i,t),o=(0,s.gO)(h);this.Af=0,this.p1(o.length),this.fO(o,o.length,0)}}},5226:(t,i,e)=>{e.d(i,{Q:()=>n,x:()=>s});class s{IO=new Map;Eo;xo=self.isSecureContext?self.crypto.randomUUID():'0';constructor(t){this.Eo=t}async Ko(){const t=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),i=t.createDataChannel('channel'),e=crypto.randomUUID();this.IO.set(e,i),await t.setLocalDescription(await t.createOffer()),t.onicegatheringstatechange=async()=>{if('complete'===t.iceGatheringState){let i;self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(t.localDescription)):console.log(JSON.stringify(t.localDescription));try{for(;null===(i=prompt('Offer copied to clipboard, paste answer here')););t.setRemoteDescription(new RTCSessionDescription(JSON.parse(i)))}catch(t){console.error(t)}}},i.onopen=()=>{i.send(JSON.stringify({type:'id',id:e})),console.log('Connected to peer!')},i.onerror=t=>{console.error(t)},i.onmessage=t=>{const i=JSON.parse(t.data);i.data&&(i.data=Object.values(i.data)),this.Eo&&this.Eo.postMessage(i)}}postMessage(t){const i=this.IO.get(t.data.id),e=t.data;e.data&&(e.data=Array.from(t.data.data)),i&&'open'===i.readyState&&i.send(JSON.stringify(e))}}class n{pc;Lo=void 0;xo;constructor(t){this.pc=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),this.pc.ondatachannel=i=>{this.Lo=i.channel,this.Lo.onopen=()=>{console.log('Connected to host!')},this.Lo.onerror=t=>{console.error(t)},this.Lo.onmessage=i=>{if(!this.xo){const t=JSON.parse(i.data);if('id'===t.type)return void(this.xo=t.id)}t.onmessage&&t.onmessage(i)}},this.pc.onicegatheringstatechange=async()=>{'complete'===this.pc.iceGatheringState&&(self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(this.pc.localDescription)):console.log(JSON.stringify(this.pc.localDescription)))}}async Xo(t){await this.pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(t))),await this.pc.setLocalDescription(await this.pc.createAnswer())}}},3937:(t,i,e)=>{e.d(i,{A:()=>o});class s{start=0;end=0;form=0;length=0;_O=null;CO=null;threshold=0;position=0;delta=0;amplitude=0;EO=0;read(t){this.form=t.Au,this.start=t.ia,this.end=t.ia,this.length=t.Au,this._O=new Int32Array(this.length),this.CO=new Int32Array(this.length);for(let i=0;i=this.threshold&&this.CO&&this._O&&(this.amplitude=this.CO[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this._O[this.position]/65536*t|0,this.threshold>this.EO&&(this.delta=((this.CO[this.position]<<15)-this.amplitude)/(this.threshold-this.EO)|0)),this.amplitude+=this.delta,this.EO++,this.amplitude-this.delta>>15}}class n{static buffer=null;static Hm=null;static sin=null;static vO=new Int32Array(5);static bO=new Int32Array(5);static TO=new Int32Array(5);static OO=new Int32Array(5);static RO=new Int32Array(5);SO=null;LO=null;xO=null;kO=null;MO=null;DO=null;release=null;attack=null;NO=new Int32Array(5);FO=new Int32Array(5);BO=new Int32Array(5);start=0;length=500;PO=100;UO=0;static init=()=>{this.Hm=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.Hm[t]=1:this.Hm[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};GO(t,i){for(let i=0;i>1,h+=(i*s>>16)+r}if(this.MO&&this.DO){const i=this.MO.evaluate(t),e=this.DO.evaluate(t);c=c*(32768+(this.WO(e,l,this.MO.form)>>1))>>15,l+=(i*o>>16)+a}for(let s=0;s<5;s++)if(0!==this.NO[s]){const r=i+n.bO[s];r>15,n.vO[s],this.SO.form),n.vO[s]+=(e*n.OO[s]>>16)+n.RO[s])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,e=!0;for(let s=0;s>8):this.release.start+((this.release.end-this.release.start)*h>>8),i+=256,i>=o&&(i=0,e=!e),e&&(n.buffer[s]=0)}}if(this.UO>0&&this.PO>0){const i=this.UO*e;for(let e=i;e32767&&(n.buffer[i]=32767);return n.buffer}WO(t,i,e){return 1===e?(32767&i)<16384?t:-t:2===e?n.sin[32767&i]*t>>14:3===e?((32767&i)*t>>14)-t:4===e?n.Hm[i/2607&32767]*t:0}read(t){this.SO=new s,this.SO.read(t),this.LO=new s,this.LO.read(t),0!==t.Au&&(t.Af--,this.xO=new s,this.xO.read(t),this.kO=new s,this.kO.read(t)),0!==t.Au&&(t.Af--,this.MO=new s,this.MO.read(t),this.DO=new s,this.DO.read(t)),0!==t.Au&&(t.Af--,this.release=new s,this.release.read(t),this.attack=new s,this.attack.read(t));for(let i=0;i<10;i++){const e=t.Ep;if(0===e)break;this.NO[i]=e,this.FO[i]=t.BE,this.BO[i]=t.Ep}this.UO=t.Ep,this.PO=t.Ep,this.length=t.mu,this.start=t.mu}}var r=e(1069),h=e(3867);class o{static YO=new Int32Array(1e3);static HO=null;static VO=null;static KO=new h.fe(1e3,null);XO=new h.fe(10,null);jO=0;loopEnd=0;static yu=t=>{const i=new r.A(t.read('sounds.dat'));for(this.HO=new Uint8Array(441e3),this.VO=new r.A(this.HO),n.init();;){const t=i.mu;if(65535===t)break;const e=new o;e.read(i),this.KO[t]=e,this.YO[t]=e.trim()}};static GO=(t,i)=>{if(!this.KO[t])return null;const e=this.KO[t];return e?.zO(i)??null};read(t){for(let i=0;i<10;i++)0!==t.Au&&(t.Af--,this.XO[i]=new n,this.XO[i]?.read(t));this.jO=t.mu,this.loopEnd=t.mu}trim(){let t=9999999;for(let i=0;i<10;i++)this.XO[i]&&(this.XO[i].start/20|0)i&&(i=this.XO[t].length+this.XO[t].start);if(0===i)return 0;let e=22050*i/1e3|0,s=22050*this.jO/1e3|0,n=22050*this.loopEnd/1e3|0;(s<0||n<0||n>e||s>=n)&&(t=0);let r=e+(n-s)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){s+=44,n+=44,e+=44,r+=44;const i=r-e;for(let t=e-1;t>=n;t--)o.HO&&(o.HO[t+i]=o.HO[t]);for(let i=1;i{e.d(i,{lp:()=>l,ap:()=>o,fe:()=>s,xp:()=>n,Eh:()=>r,Op:()=>h,Xr:()=>a});class s extends Array{constructor(t,i){super(t);for(let e=0;e{e.d(i,{gO:()=>o,Jo:()=>n,pO:()=>h,$o:()=>s,ec:()=>r,AO:()=>a});const s=async t=>new Promise((i=>setTimeout(i,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),r=async t=>(await fetch(t)).text();function h(t){let i=0n;for(let e=0;e0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function a(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}},7953:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static ZO=new Uint16Array(['d','o','t'].join('').split('').map((t=>t.charCodeAt(0))));static qO=new Uint16Array(['(','a',')'].join('').split('').map((t=>t.charCodeAt(0))));static JO=new Uint16Array(['s','l','a','s','h'].join('').split('').map((t=>t.charCodeAt(0))));static $O=['cook',"cook's",'cooks','seeks','sheet'];static QO=[];static tR=[];static iR=[];static eR=[];static sR=[];static nR=[];static yu=t=>{const i=new s.A(t.read('fragmentsenc.txt')),e=new s.A(t.read('badenc.txt')),n=new s.A(t.read('domainenc.txt')),r=new s.A(t.read('tldlist.txt'));this.read(e,n,i,r)};static filter=t=>{const i=[...t];this.format(i);const e=i.join('').trim(),s=e.toLowerCase(),n=[...s];this.rR(n),this.hR(n),this.oR(n),this.aR(n);for(let t=0;t{this.fR(t),this.uR(i),this.dR(e),this.wR(s)};static wR=t=>{const i=t.ia;for(let e=0;et.Au))};static fR=t=>{const i=t.ia;for(let e=0;et.Au));const i=new Array(t.Au).fill([]).map((()=>[t.Dd,t.Dd]));i.length>0&&(this.eR[e]=i)}};static uR=t=>{const i=t.ia;for(let e=0;et.Au))};static dR=t=>{const i=t.ia;for(let e=0;e{const i=[...t],e=[...t];this.yR(null,i,this.ZO),this.yR(null,e,this.JO);for(let s=0;s{for(let i=0;i<2;i++)for(let i=this.iR.length-1;i>=0;i--)this.yR(this.eR[i],t,this.iR[i])};static oR=t=>{const i=[...t],e=[...t];this.yR(null,i,this.qO),this.yR(null,e,this.ZO);for(let s=this.sR.length-1;s>=0;s--)this.pR(e,i,this.sR[s],t)};static aR=t=>{for(let i=0;i=0&&n{if(this.vR(t))return!0;const i=this.bR(t),e=this.nR,s=e.length;if(i===e[0]||i===e[s-1])return!0;let n=0,r=s-1;for(;n<=r;){const t=(n+r)/2|0;if(i===e[t])return!0;i{if(t.length>6)return 0;let i=0;for(let e=0;e{for(let e=i;e=0;e++)if(this.OR(t[e]))return e;return-1};static CR=(t,i)=>{for(let e=t;e=0;e++)if(!this.OR(i[e]))return e;return i.length};static RR=(t,i,e)=>i===e||'o'===i&&'0'===e?1:'o'===i&&'('===e&&')'===t?2:'c'!==i||'('!==e&&'<'!==e&&'['!==e?'e'===i&&'€'===e||'s'===i&&'$'===e||'l'===i&&'i'===e?1:0:1;static pR=(t,i,e,s)=>{const n=e.length,r=s.length;for(let h=0;h<=r-n;h++){const{SR:n,LR:r}=this.xR(h,e,s);if(!n)continue;const o=this.kR(h,s,3,i,['@']),a=this.MR(r-1,s,3,t,['.',',']);(o>2||a>2)&&this._R(h,r,s)}};static xR=(t,i,e)=>{const s=i.length;let n=t,r=0;for(;n0)n+=a,r++;else{if(0===r)break;const e=this.RR(o,String.fromCharCode(i[r-1]),h);if(e>0)n+=e,1===r&&t++;else{if(r>=s||!this.gR(h))break;n++}}}return{SR:r>=s,LR:n}};static yR=(t,i,e)=>{if(!(e.length>i.length))for(let s=0;s<=i.length-e.length;s++){let n=s;const{LR:r,DR:h,NR:o,FR:a,BR:l}=this.PR(i,e,n);n=r;let c=i[n],f=n+1=e.length)||a&&l)continue;let u,d=!0;if(o){let t=!1,e=!1;if((s-1<0||this.gR(i[s-1])&&"'"!==i[s-1])&&(t=!0),(n>=i.length||this.gR(i[n])&&"'"!==i[n])&&(e=!0),!t||!e){let e=!1;for(u=s-2,t&&(u=s);!e&&u=0&&(!this.gR(i[u])||"'"===i[u])){const t=[];let s;for(s=0;s<3&&u+s=0&&(!this.gR(i[u-1])||"'"===i[u-1])&&(n=!1),n&&!this.ER(t)&&(e=!0)}u++}e||(d=!1)}}else{c=' ',s-1>=0&&(c=i[s-1]),f=' ',n{let s=e,n=0,r=0,h=!1,o=!1,a=!1;for(;s=t.length||o&&a);){const l=t[s],c=s+10)1===f&&this.OR(l)&&(o=!0),2===f&&(this.OR(l)||this.OR(c))&&(o=!0),s+=f,n++;else{if(0===n)break;let t;if((t=this.YR(c,String.fromCharCode(i[n-1]),l))>0)s+=t;else{if(n>=i.length||!this.IR(l))break;if(this.gR(l)&&"'"!==l&&(h=!0),this.OR(l)&&(a=!0),s++,r++,(100*r/(s-e)|0)>90)break}}}return{LR:s,DR:n,NR:h,FR:o,BR:a}};static YR=(t,i,e)=>{if(i===e)return 1;if(i>='a'&&i<='m'){if('a'===i)return'4'!==e&&'@'!==e&&'^'!==e?'/'===e&&'\\'===t?2:0:1;if('b'===i)return'6'!==e&&'8'!==e?'1'===e&&'3'===t?2:0:1;if('c'===i)return'('!==e&&'<'!==e&&'{'!==e&&'['!==e?0:1;if('d'===i)return'['===e&&')'===t?2:0;if('e'===i)return'3'!==e&&'€'!==e?0:1;if('f'===i)return'p'===e&&'h'===t?2:'£'===e?1:0;if('g'===i)return'9'!==e&&'6'!==e?0:1;if('h'===i)return'#'===e?1:0;if('i'===i)return'y'!==e&&'l'!==e&&'j'!==e&&'1'!==e&&'!'!==e&&':'!==e&&';'!==e&&'|'!==e?0:1;if('j'===i)return 0;if('k'===i)return 0;if('l'===i)return'1'!==e&&'|'!==e&&'i'!==e?0:1;if('m'===i)return 0}if(i>='n'&&i<='z'){if('n'===i)return 0;if('o'===i)return'0'!==e&&'*'!==e?'('===e&&')'===t||'['===e&&']'===t||'{'===e&&'}'===t||'<'===e&&'>'===t?2:0:1;if('p'===i)return 0;if('q'===i)return 0;if('r'===i)return 0;if('s'===i)return'5'!==e&&'z'!==e&&'$'!==e&&'2'!==e?0:1;if('t'===i)return'7'!==e&&'+'!==e?0:1;if('u'===i)return'v'===e?1:'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('v'===i)return'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('w'===i)return'v'===e&&'v'===t?2:0;if('x'===i)return')'===e&&'('===t||'}'===e&&'{'===t||']'===e&&'['===t||'>'===e&&'<'===t?2:0;if('y'===i)return 0;if('z'===i)return 0}return i>='0'&&i<='9'?'0'===i?'o'===e||'O'===e?1:'('===e&&')'===t||'{'===e&&'}'===t||'['===e&&']'===t?2:0:'1'===i&&'l'===e?1:0:','===i?'.'===e?1:0:'.'===i?','===e?1:0:'!'===i&&'i'===e?1:0};static GR=(t,i,e)=>{let s=0,n=i.length-1;for(;s<=n;){const r=(s+n)/2|0;if(i[r][0]===t&&i[r][1]===e)return!0;tthis.TR(t)?t.charCodeAt(0)+1-'a'.charCodeAt(0):"'"===t?28:this.OR(t)?t.charCodeAt(0)+29-'0'.charCodeAt(0):27;static mR=(t,i,e,s,n)=>{if(!(s.length>e.length))for(let r=0;r<=e.length-s.length;r++){const{LR:h,HR:o}=this.VR(e,s,r);if(o0&&c>0&&(a=!0),2===i&&(l>2&&c>0||l>0&&c>2)&&(a=!0),3===i&&l>0&&c>2&&(a=!0),!a)continue;let f,u=r,d=h-1,w=!1;if(l>2){if(4===l)for(w=!1,f=r-1;f>=0;f--)if(w){if('*'!==n[f])break;u=f}else'*'===n[f]&&(u=f,w=!0);for(w=!1,f=u-1;f>=0;f--)if(w){if(this.gR(e[f]))break;u=f}else this.gR(e[f])||(w=!0,u=f)}if(c>2){if(4===c)for(w=!1,f=d+1;f{let s=0;for(;e0)e+=h,s++;else{if(0===s)break;let t;if((t=this.RR(r,String.fromCharCode(i[s-1]),n))>0)e+=t;else{if(!this.gR(n))break;e++}}}return{LR:e,HR:s}};static gR=t=>!this.WR(t)&&!this.OR(t);static IR=t=>!this.TR(t)||('v'===t||'x'===t||'j'===t||'q'===t||'z'===t);static WR=t=>this.TR(t)||this.KR(t);static OR=t=>t>='0'&&t<='9';static TR=t=>t>='a'&&t<='z';static KR=t=>t>='A'&&t<='Z';static vR=t=>{for(let i=0;i{for(let s=t;s{let e=0;for(let s=i-1;s>=0&&this.gR(t[s]);s--)'*'===t[s]&&e++;return e};static jR=(t,i)=>{let e=0;for(let s=i+1;s(n?this.XR(i,e):this.jR(i,e))>=s?4:this.gR(n?t[e-1]:t[e+1])?1:0;static kR=(t,i,e,s,n)=>{if(0===t)return 2;for(let e=t-1;e>=0&&this.gR(i[e]);e--)if(n.includes(i[e]))return 3;return this.zR(i,s,t,e,!0)};static MR=(t,i,e,s,n)=>{if(t+1===i.length)return 2;for(let e=t+1;e{let i=0;for(let e=0;et>=' '&&t<=''||' '===t||'\n'===t||'\t'===t||'£'===t||'€'===t;static lR=(t,i)=>{for(let e=0;e{let i=!0;for(let e=0;e{e.a(t,(async(t,i)=>{try{var s=e(1312),n=e(5637),r=e(2164),h=e(1302),o=e(6948),a=e(8317),l=e(8738),c=e(3764),f=e(1120),u=e(3709),d=e(8950),w=e(4583),y=e(2682),m=e(8665),p=e(8534),A=e(6730),g=e(7953),I=e(9234),_=e(1069),C=e(3937),E=e(4544),v=e(7854),b=e(1673),T=e(1908),O=e(1651),R=e(7604);class t extends O.K{qR=[];JR=[];$R=-1;QR=new o.A(-1);tS=-1;iS='';async eS(t){const i=new Map,e=(await(0,I.ec)(t)).split('\n');for(let t=0;t{if(this.kt)this.Mt=!0;else{this.kt=!0;try{await this.qo(10,'Connecting to fileserver'),await T.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new E.A(await E.A.openDatabase());const t=new _.A(new Uint8Array(await(0,I.Jo)(`${O.K.nt}/crc`)));for(let i=0;i<9;i++)this.Bt[i]=t.ia;const i=await this.jo('title','title screen',this.Bt[1],10);this.di=y.A.xu(i,'p11'),this.wi=y.A.xu(i,'p12'),this.yi=y.A.xu(i,'b12'),this.mi=y.A.xu(i,'q8');const e=await this.jo('config','config',this.Bt[2],15),d=await this.jo('interface','interface',this.Bt[3],20),v=await this.jo('media','2d graphics',this.Bt[4],30),R=await this.jo('models','3d graphics',this.Bt[5],40),S=await this.jo('textures','textures',this.Bt[6],60),L=await this.jo('wordenc','chat system',this.Bt[7],65),x=await this.jo('sounds','sound effects',this.Bt[8],70),k=new _.A(new Uint8Array(await(0,I.Jo)(`${O.K.nt}/server/mesanim.dat`)));await this.qo(75,'Unpacking media'),this.re=b.A.xu(v,'chatback',0),await this.qo(80,'Unpacking textures'),w.A.vv(S),w.A.Ov(.8),w.A.Sv(20),await this.qo(83,'Unpacking models'),m.A.yu(R),p.A.yu(R),A.A.yu(R),await this.qo(86,'Unpacking config'),s.A.yu(e),n.A.yu(e),r.A.yu(e),h.A.yu(e,!0),o.A.yu(e),a.A.yu(e),l.A.yu(e),c.A.yu(e),u.A.yu(k),await this.sS(),await this.nS(),await this.qo(90,'Unpacking sounds'),C.A.yu(x),await this.qo(92,'Unpacking interfaces'),f.A.yu(d,v,[this.di,this.wi,this.yi,this.mi]),await this.qo(97,'Preparing game engine'),g.A.yu(L),await this.qo(100,'Getting ready to start...'),this.Fo?.bind(),w.A.Fc();const M=document.querySelector('#authentic');null!==M&&(M.onchange=()=>{this.rS()});const D=document.querySelector('#newline');null!==D&&(D.onclick=()=>{this.iS+='|',this.rS()});const N=document.querySelector('#clear');null!==N&&(N.onclick=()=>{this.iS='',this.rS()}),this.hS('bla'),this.hS('red'),this.hS('gre'),this.hS('blu'),this.hS('yel'),this.hS('cya'),this.hS('mag'),this.hS('whi'),this.hS('lre'),this.hS('dre'),this.hS('dbl'),this.hS('or1'),this.hS('or2'),this.hS('or3'),this.hS('gr1'),this.hS('gr2'),this.hS('gr3'),this.QR=o.A.get(0),this.tS=0,this.rS()}catch(t){this.Dt=!0,console.error(t)}}};update=async()=>{this.Mt||this.Dt||this.Nt||(this.Ft++,this.oS())};draw=async()=>{this.Mt||this.Dt||this.Nt?this.sa():(d.A.clear(),this.aS(),this.Fo?.draw(0,0))};async sS(){this.qR[1]=await this.eS(`${O.K.lt}/data/src/pack/npc.pack`);const t=document.querySelector('#npcs');if(!t)return;t.innerHTML='';const i=document.createElement('input');i.type='search',i.placeholder='Search',i.tabIndex=1,i.oninput=()=>{const t=i.value.toLowerCase().replaceAll(' ','_'),e=document.querySelector('#npcList');if(e)for(let i=0;i-1?s.style.display='':s.style.display='none'}},t.appendChild(i);const e=document.createElement('ul');e.id='npcList',e.className='list-group',t.appendChild(e);for(const[t,i]of this.qR[1]){const s=o.A.get(t);if(null===s.$u||0===s.$u.length)continue;const n=document.createElement('li');n.id=i,n.className='list-group-item',0===t&&(n.className+=' active'),n.innerText=i+' ('+t+')',n.onclick=()=>{const i=e.querySelector('.active');i&&(i.className='list-group-item'),n.className='list-group-item active',this.QR=o.A.get(t),this.lS(this.QR,this.tS,this.iS)},e.appendChild(n)}}async nS(){const t=document.querySelector('#mesanims');if(!t)return;t.innerHTML='';const i=document.createElement('input');i.type='search',i.placeholder='Search',i.tabIndex=2,i.oninput=()=>{const t=i.value.toLowerCase().replaceAll(' ','_'),e=document.querySelector('#mesanimList');if(e)for(let i=0;i-1?s.style.display='':s.style.display='none'}},t.appendChild(i);const e=document.createElement('ul');e.id='mesanimList',e.className='list-group',t.appendChild(e);for(const t of u.A.Do){const i=t.id,s=t.Fu??`mesanim_${t.id}`,n=document.createElement('li');n.id=s,n.className='list-group-item',0===i&&(n.className+=' active'),n.innerText=s+' ('+i+')',n.onclick=()=>{const t=e.querySelector('.active');t&&(t.className='list-group-item'),n.className='list-group-item active',this.tS=i,this.rS()},e.appendChild(n)}}hS(t){const i=document.querySelector(`#${t}`);null!==i&&(i.onclick=()=>{this.iS+=`@${t}@`,this.rS()})}oS(){let t=!1;for(;;){const i=this.Gc();if(-1===i)break;if(document.activeElement!==v.Nc)continue;-1!==y.A.AT.indexOf(String.fromCharCode(i))?(this.iS+=String.fromCharCode(i),t=!0):8===i&&this.iS.length>0?(this.iS=this.iS.substring(0,this.iS.length-1),t=!0):10!==i&&13!==i||(this.iS+='|',t=!0)}t&&-1!==this.iS.indexOf('\\n')&&(this.iS=this.iS.replaceAll('\\n','|')),t&&this.rS()}aS(){this.re?.draw(0,0),this.pa(this.hs,1);try{this.ba(f.A.Do[this.hs],0,0,0)}catch(t){console.error(t)}}rS(){if(-1===this.tS||!this.mi)return;this.cS(this.iS,380,4,this.mi,this.tS),this.fS()>1&&(this.iS=''),this.lS(this.QR,this.tS,this.iS);const t=document.querySelector('#export');if(t){const i=u.A.Do[this.tS],e=document.querySelector('#authentic');if(null===e||!1===e.checked){const e='default'===i.Fu?'"default"':i.Fu??`mesanim_${i.id}`;t.value=`~chatnpc(${e}, "${this.iS}");`}else t.value=`~chatnpc("${this.iS}");`}}cS(t,i,e,s,n){const r=s.split(t,i);for(this.JR=[],this.$R=n;r.length>0;)this.JR.push(r.splice(0,e))}uS(t,i){return this.JR[t][i]}fS(){return this.JR.length}dS(t){return this.JR[t].length}wS(t){if(-1===this.$R)return-1;const i=u.A.Do[this.$R],e=this.dS(t);return i.zd[e-1]}lS(t,i,e){if(!this.mi||-1===i)return;this.cS(e,380,4,this.mi,i);const s=this.fS();for(let i=0;i{})),window.onkeydown=function(t){return!(' '===t.key&&(t.target===document.body||t.target===v.Nc))},i()}catch(t){i(t)}}),1)},1908:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(9763);class n{static mS=null;static load=async t=>{this.mS=await(0,s.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,e,s)=>{if(!this.mS)throw new Error('bz2 not found!!');return Int8Array.from(this.mS.read(t,i,e,s))}}},123:(t,i,e)=>{function s(t,i,e){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256,e)}function n(t){window._tinyMidiStop&&window._tinyMidiStop(t)}e.d(i,{ea:()=>s,ko:()=>n})},2604:(t,i,e)=>{function s(t,i){var e;(e=document.createElement('a')).href=t,e.download=i,document.body.appendChild(e),e.style='display: none',e.click(),e.remove()}e.d(i,{A:()=>s})},9763:(t,i,e)=>{async function s(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,a=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,a,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(a),a}(a,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(l,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function a(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function l(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}e.d(i,{F:()=>s})},9896:(t,i,e)=>{var s=e(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{const t=2,i=44100;let e=new Float32Array,n=window.audioContext.createGain();n.gain.setValueAtTime(.1,window.audioContext.currentTime),n.connect(window.audioContext.destination);let r=window.audioContext.currentTime,h=[];const o=new s.A({pS:30,AS:t=>{let i=new Float32Array(t.buffer),s=new Float32Array(e.length+i.length);s.set(e,0),s.set(i,e.length),e=s},gS:t=>{},bufferSize:102400});await o.init();const a=await fetch('./SCC1_Florestan.sf2'),l=new Uint8Array(await a.arrayBuffer());function c(){if(!window.audioContext||!e.length)return;let s=window.audioContext.createBufferSource();const o=e.length/t,a=window.audioContext.createBuffer(t,o,i);for(let i=0;i{t.stop(window.audioContext.currentTime)})),h=[],n.gain.setValueAtTime(t,window.audioContext.currentTime)}}function d(t,i){-1!==t&&window._tinyMidiVolume(t),r=window.audioContext.currentTime,f=setInterval(c,250),o.IS(i)}o._S(l),window._tinyMidiStop=async t=>{t?function(t){const i=window.audioContext.currentTime;n.gain.cancelScheduledValues(i),n.gain.setTargetAtTime(0,i,.5),setTimeout(t,2e3)}((()=>{u()})):u()},window._tinyMidiVolume=(t=1)=>{n.gain.setValueAtTime(t,window.audioContext.currentTime)},window._tinyMidiPlay=async(t,i,e)=>{t&&(await window._tinyMidiStop(e),e?setTimeout((()=>{d(i,t)}),2e3):d(i,t))}})()},8151:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5473);const n=class{constructor(t={}){this.CS=void 0,this.ES=0,this.vS=0,this.bS=0,this.pS=t.pS||100,this.sampleRate=t.sampleRate||44100,this.TS=t.TS||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.OS(1),this.AS=t.AS||(()=>{}),this.gS=t.gS||(()=>{}),this.RS=void 0,this.test=0}async init(){if(!this.CS){if('undefined'!=typeof process){const{SS:t}=await import('path'),{LS:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.CS=await(0,s.A)(),this.xS=this.CS._malloc(this.bufferSize),this.kS=this.CS._malloc(8)}}OS(t){this.bufferSize=4*this.sampleRate*this.TS*t}MS(){if(!this.CS)throw new Error(`${this.constructor.name} not initalized. call .init()`)}_S(t){this.MS();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.CS;e(this.ES),this.ES=i(t.length),this.CS.HEAPU8.set(t,this.ES),this.vS=s(this.ES,t.length),n(this.vS,2===this.TS?0:2,this.sampleRate,this.gain)}DS(){this.MS();const t=new Uint8Array(this.bufferSize);return t.set(this.CS.HEAPU8.subarray(this.xS,this.xS+this.bufferSize)),t}NS(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.CS;return e(this.bS),this.bS=i(t.length),this.CS.HEAPU8.set(t,this.bS),s(this.bS,t.length)}BS(t){const{_midi_render:i}=this.CS;return i(this.vS,t,this.TS,this.sampleRate,this.xS,this.bufferSize,this.kS)}IS(t){if(this.MS(),!this.vS)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.RS);const{setValue:i,getValue:e}=this.CS;i(this.kS,0,'double'),this.CS._tsf_reset(this.vS),this.CS._tsf_channel_set_bank_preset(this.vS,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.NS(t);const n=()=>{s=this.BS(s);const t=this.DS();this.AS(t),s?this.RS=setTimeout(n,this.pS):this.gS(e(this.kS,'double'))};this.RS=setTimeout(n,16)}}},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,e)=>{var s;e.d(i,{A:()=>n});const n=(s="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,n,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,e){i=t,n=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(r.ready,t)||Object.defineProperty(r.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var h=Object.assign({},r),o=[],a='object'==typeof window,l='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!a&&!c&&!l;if(r.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var m,p;y=l?require('path').SS(y)+'/':__dirname+'/';var A=()=>{p||(m=require('fs'),p=require('path'))};u=(t,i)=>(A(),t=p.normalize(t),m.PS(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,e)=>{A(),t=p.normalize(t),m.US(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),r.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,e){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!a&&!l)throw new Error('environment detection error');if(l?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),s&&(y=s),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},l&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}r.print||console.log.bind(console);var g,I,_=r.printErr||console.warn.bind(console);function C(t,i){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(r,h),h=null,g='fetchSettings',Object.getOwnPropertyDescriptor(r,g)&&j('`Module.'+g+'` was supplied but `'+g+'` not included in INCOMING_MODULE_JS_API'),r.arguments&&(o=r.arguments),C('arguments','arguments_'),r.thisProgram&&r.thisProgram,C('thisProgram','thisProgram'),r.quit&&r.quit,C('quit','quit_'),D(void 0===r.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===r.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===r.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===r.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===r.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),r.wasmBinary&&(I=r.wasmBinary),C('wasmBinary','wasmBinary');var v;r.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,O,R,S,L,x,k,M=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function N(t){b=t,r.HEAP8=T=new Int8Array(t),r.HEAP16=R=new Int16Array(t),r.HEAP32=S=new Int32Array(t),r.HEAPU8=O=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=L=new Uint32Array(t),r.HEAPF32=x=new Float32Array(t),r.HEAPF64=k=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var F=5242880;r.TOTAL_STACK&&D(F===r.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=r.INITIAL_MEMORY||16777216;function P(){if(!M){var t=ft(),i=L[t>>2],e=L[t+4>>2];34821223==i&&2310721022==e||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==L[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=F,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+F+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!r.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var U=[],G=[],W=[],Y=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var H=0,V=null,K=null,X={};function j(t){r.onAbort&&r.onAbort(t),_(t='Aborted('+t+')'),M=!0;var i=new WebAssembly.RuntimeError(t);throw n(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},GS:function(){z.error()},WS:function(){z.error()},YS:function(){z.error()},open:function(){z.error()},HS:function(){z.error()},VS:function(){z.error()},KS:function(){z.error()},XS:function(){z.error()},jS:function(){z.error()}};r.FS_createDataFile=z.GS,r.FS_createPreloadedFile=z.WS;var Z,q,J,$,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=r.asm),D(Y,'native function `'+e+'` called before runtime initialization'),s[t]||D(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==Z&&I)return new Uint8Array(I);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(r)}function ht(t){ht.zS||(ht.zS={}),ht.zS[t]||(ht.zS[t]=1,c&&(t='warning: '+t),_(t))}function ot(t){try{return v.grow(t-b.byteLength+65535>>>16),N(v.buffer),1}catch(i){_('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}r.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=r.locateFile?r.locateFile(q,y):y+q):Z=new URL(e(8227),e.b).toString();var at,lt={"emscripten_memcpy_big":function(t,i,e){O.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=O.length;D((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return _('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return _('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':lt,'wasi_snapshot_preview1':lt};function e(t,i){var e,s=t.exports;r.asm=s,D(v=r.asm.memory,"memory not found in wasm exports"),N(v.buffer),D(r.asm.__indirect_function_table,"table not found in wasm exports"),e=r.asm.__wasm_call_ctors,G.unshift(e),function(t){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(X[t]),delete X[t]):_('warning: run dependency removed without ID'),0==H&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',H++,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(M)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,_('still waiting on run dependencies:')),_('dependency: '+i);t&&_('(end of list)')}),1e4))):_('warning: run dependency added without ID');var s=r;function h(t){D(r===s,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),s=null,e(t.instance)}function o(t){return function(){if(!I&&(a||l)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return st(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){_('failed to asynchronously prepare wasm: '+t),it(Z)&&_('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(r.instantiateWasm)try{return r.instantiateWasm(i,e)}catch(t){_('Module.instantiateWasm callback failed with error: '+t),n(t)}(I||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(h):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return _('wasm streaming compile failed: '+t),_('falling back to ArrayBuffer instantiation'),o(h)}))}))).catch(n)}(),r.___wasm_call_ctors=et("__wasm_call_ctors"),r._malloc=et("malloc"),r._free=et("free"),r._tsf_load_memory=et("tsf_load_memory"),r._tsf_close=et("tsf_close"),r._tsf_reset=et("tsf_reset"),r._tsf_set_output=et("tsf_set_output"),r._tsf_set_max_voices=et("tsf_set_max_voices"),r._realloc=et("realloc"),r._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),r._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),r._tml_load_memory=et("tml_load_memory"),r._midi_render=et("midi_render"),r.___errno_location=et("__errno_location"),r._fflush=et("fflush"),r._emscripten_stack_init=function(){return(ct=r._emscripten_stack_init=r.asm.emscripten_stack_init).apply(null,arguments)}),ft=(r._emscripten_stack_get_free=function(){return(r._emscripten_stack_get_free=r.asm.emscripten_stack_get_free).apply(null,arguments)},r._emscripten_stack_get_base=function(){return(r._emscripten_stack_get_base=r.asm.emscripten_stack_get_base).apply(null,arguments)},r._emscripten_stack_get_end=function(){return(ft=r._emscripten_stack_get_end=r.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),L[t>>2]=34821223,L[t+4>>2]=2310721022,L[0]=1668509029}function dt(t){function e(){at||(at=!0,r.calledRun=!0,M||(D(!Y),Y=!0,P(),rt(G),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),D(!r._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(P(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),W.unshift(t);var t;rt(W)}()))}t=t||o,H>0||(ut(),function(){if(r.preRun)for('function'==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),U.unshift(t);var t;rt(U)}(),H>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),e()}),1)):e(),P()))}if(r.stackSave=et("stackSave"),r.stackRestore=et("stackRestore"),r.stackAlloc=et("stackAlloc"),r.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':T[0|t]=i;break;case'i16':R[t>>1]=i;break;case'i32':S[t>>2]=i;break;case'i64':$=[i>>>0,(J=i,+Math.abs(J)>=1?J>0?(0|Math.min(+Math.floor(J/4294967296),4294967295))>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],S[t>>2]=$[0],S[t+4>>2]=$[1];break;case'float':x[t>>2]=i;break;case'double':k[t>>3]=i;break;case'*':L[t>>2]=i;break;default:j('invalid type for setValue: '+e)}},r.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return T[0|t];case'i16':return R[t>>1];case'i32':case'i64':return S[t>>2];case'float':return x[t>>2];case'double':return k[t>>3];case'*':return L[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),K=function t(){at||dt(),at||(K=t)},r.preInit)for('function'==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return dt(),t.ready})}},r={};function h(t){var i=r[t];if(void 0!==i)return i.exports;var e=r[t]={exports:{}};return n[t](e,e.exports,h),e.exports}h.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",e="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",s=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},h.a=(n,r,h)=>{var o;h&&((o=[]).d=-1);var a,l,c,f=new Set,u=n.exports,d=new Promise(((t,i)=>{c=i,l=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,r((n=>{var r;a=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var r=[];r.d=0,n.then((t=>{h[i]=t,s(r)}),(t=>{h[e]=t,s(r)}));var h={};return h[t]=t=>t(r),h}}var o={};return o[t]=t=>{},o[i]=n,o})))(n);var h=()=>a.map((t=>{if(t[e])throw t[e];return t[i]})),l=new Promise((i=>{(r=()=>i(h)).r=0;var e=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(r.r++,t.push(r)));a.map((i=>i[t](e)))}));return r.r?l:h()}),(t=>(t?c(d[e]=t):l(u),s(o)))),o&&o.d<0&&(o.d=0)},h.d=(t,i)=>{for(var e in i)h.o(i,e)&&!h.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},h.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),h.p="/Client2/",h.b=document.baseURI||self.location.href;h(5532)})(); \ No newline at end of file diff --git a/playground.js b/playground.js index 223ae379..40896e07 100644 --- a/playground.js +++ b/playground.js @@ -1 +1 @@ -(()=>{"use strict";var t,i,e,s,n={1651:(t,i,e)=>{e.d(i,{K:()=>D});var s=e(1120),n=e(4583),r=e(2901),h=e(1069),o=e(7046),a=(e(9896),e(6666)),l=e(3045),c=e(818),f=e(670),u=e(8268),d=e(3867),w=e(7854),y=e(8950),m=e(1302),A=e(9298),p=e(8665),g=e(1312),I=e(3819),_=e(8317),C=e(9234),E=e(1908),v=e(123),b=e(5637),T=e(6948),O=e(2164),R=e(8738),S=e(3764),L=e(8534),x=e(6730),k=e(2604),M=e(5226);class D extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static et=!1;static st='';static nt='';static rt=!1;static ht=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static gt=0;static It=0;static _t=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Ot=0;static Rt=()=>{l.A.et=!1,n.A.et=!1,D.et=!1,c.A.et=!1};static St=()=>{l.A.et=!0,n.A.et=!0,D.et=!0,c.A.et=!0};Lt=2048;xt=2047;kt=!1;Mt=!1;Dt=!1;Nt=!1;db=null;Ft=0;Bt=[];stream=null;in=h.A.Pt(1);Ut=h.A.Pt(1);Wt=h.A.Pt(1);Gt=0n;Yt=0;Ht=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;Jt=!0;$t=0;Qt=0;ti=null;ii=null;ei=null;si=null;ni=null;ri=null;hi=null;oi=null;ai=null;li=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;mi=null;Ai=[];pi=!1;gi=null;Ii=null;_i=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Oi=null;Ri=null;Si=new Int32Array(256);Li=0;xi=0;ki=0;Mi=null;Di=null;Ni=null;Fi=null;Bi=null;Pi=null;Ui=null;Wi=null;Gi=null;Yi=null;Hi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;Ji=null;$i=null;Qi=null;te=new Int32Array(33);ie=new Int32Array(33);ee=new Int32Array(151);se=new Int32Array(151);ne=null;re=null;he=null;oe=null;ae=null;le=null;ce=new d.fe(13,null);ue=null;de=null;we=new d.fe(50,null);ye=new d.fe(50,null);me=new d.fe(20,null);Ae=new d.fe(20,null);pe=null;ge=new d.fe(8,null);Ie=null;_e=null;Ce=null;Ee=null;ve=null;be=null;Te=null;Oe=null;Re=null;Se=null;Le=null;xe=null;ke=null;Me=null;De=null;Ne=null;Fe=null;Be=null;Pe=new d.fe(1e3,null);Ue=!1;We=!1;Ge=!1;Ye=!1;He=-1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=!1;Je=0;$e=0;Qe=0;ts=0;es=0;ss=0;ns=[];rs=-1;hs=-1;os=new s.A;ls=78;cs=0;fs=0;us=[];ds=0;ws=0;ys=0;As=0;ps=0;gs=0;Is=0;_s=0;Cs=[];Es=[];vs=[];bs=[];Ts=null;Os=-1;Rs=3;Ss=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Ls=0;xs=0;ks=0;Ms=!1;Ds=0;Ns=!1;Fs='';Bs='';Ps=0;Us='';Ws=!1;Gs=-1;Ys=new d.fe(100,null);Hs=new d.fe(100,null);messageType=new Int32Array(100);Vs=new Int32Array(100);Ks=0;Xs=0;js=0;zs='';Zs=0;qs=0;Js=0;$s=0;Qs=0;tn=0;en=0;sn=0;nn=0;rn=!1;hn=0;an=0;ln=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;mn=!1;An=[];pn=[];gn=0;In=0;_n=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);On=new Int32Array(500);Rn=0;Sn=0;Ln=0;xn='';kn=!1;Mn=-1;Dn=0;Nn=0;Fn=0;Bn=0;Pn=0;Un=new Int32Array(1e3);Wn=new Int32Array(1e3);Gn=null;Yn=0;Hn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;Jn=0;$n=2;Qn=2;tr=1;ir=new Int32Array(5);er=new d.fe(5,!1);sr=new Int32Array(5);nr=new Int32Array(5);rr=new Int32Array(5);hr=0;ar=0;lr=0;cr=0;ur=0;dr=0;wr=0;yr=0;mr=0;Ar=1;pr=2;gr=-1;Ir=0;_r=0;Cr=0;Er=0;vr=0;br=0;Tr=null;Or=null;Rr=null;Sr=0;Lr=0;kr=new Int8Array(16384);Mr=new d.fe(f.A.Dr,null);Nr=0;Fr=0;Br=128;Pr=0;Ur=0;Wr=0;Gr=0;Yr=0;Hr=null;Vr=null;Kr=new d.Xr(f.A.jr,f.A.jr);zr=0;Zr=0;qr=0;Jr=0;$r=0;Qr=0;th=0;ih=0;eh=0;sh=0;nh=0;rh=0;hh=new d.fe(this.Lt,null);oh=0;ah=new Int32Array(this.Lt);lh=0;fh=0;uh=new Int32Array(this.Lt);dh=new Int32Array(1e3);wh=new d.fe(this.Lt,null);yh=new d.fe(8192,null);mh=0;Ah=new Int32Array(8192);ph=new a.A;gh=new a.A;Ih=new a.A;_h=new a.A;Ch=new d.Eh(f.A.Dr,f.A.jr,f.A.jr,null);bh=new a.A;Th=new Int32Array(4e3);Oh=new Int32Array(4e3);Rh=new Int32Array(f.A.jr*f.A.jr);Sh=new Int32Array(f.A.jr*f.A.jr);Lh=0;xh=null;kh=0;Mh=0;Dh=-1;Nh=0;Fh=0;Bh=0;Ph=0;Uh=!1;Wh=!0;Gh=!1;Yh=new Int32Array(7);Hh=new Int32Array(5);Vh=0;Kh=0;static Xh=50;jh=new Int32Array(D.Xh);zh=new Int32Array(D.Xh);Zh=new Int32Array(D.Xh);qh=new Int32Array(D.Xh);Jh=new Int32Array(D.Xh);$h=new Int32Array(D.Xh);Qh=new Int32Array(D.Xh);io=new d.fe(D.Xh,null);eo=new d.fe(100,null);so=new BigInt64Array(100);no=new Int32Array(100);ro=null;ho=0;oo=!0;ao=new Int32Array(50);lo=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;mo=0;Ao=!0;po=null;Io=0;_o=0;Co=192;Eo=void 0;vo=!1;host=null;bo=null;To=new d.fe(16,null);Oo=0;Ro=!1;So=()=>{try{this.stream&&this.stream.close()}catch(t){}this.bo&&'998'===D.getParameter('world')&&this.bo.Lo?.send(JSON.stringify({type:'close',id:this.bo.xo})),this.stream=null,(0,v.ko)(!1),this.Ut=null,this.Wt=null,this.in=null,this.Rr=null,this.Tr=null,this.Or=null,this.Hr=null,this.Vr=null,this.Gn=null,this.Mr=null,this.Rh=null,this.Sh=null,this.Th=null,this.Oh=null,this.kr=null,this.Di=null,this.Ni=null,this.Fi=null,this.Bi=null,this.Pi=null,this.Ui=null,this.Wi=null,this.Gi=null,this.Yi=null,this.Hi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.ne=null,this.he=null,this.re=null,this.oe=null,this.ae=null,this.le=null,this.ce=null,this.Te=null,this.Oe=null,this.Re=null,this.Se=null,this.Le=null,this.xe=null,this.ke=null,this.Me=null,this.De=null,this.Ne=null,this.de=null,this.me=null,this.Ae=null,this.ge=null,this.Ie=null,this._e=null,this.Ce=null,this.Ee=null,this.we=null,this.ye=null,this.Kr=null,this.hh=null,this.ah=null,this.uh=null,this.wh=null,this.dh=null,this.yh=null,this.Ah=null,this.Ch=null,this.bh=null,this._h=null,this.ph=null,this.gh=null,this.Ih=null,this.Tn=null,this.On=null,this.vn=null,this.bn=null,this.ns=null,this.An=null,this.Un=null,this.Wn=null,this.Pe=null,this.ue=null,this.eo=null,this.so=null,this.no=null,this.si=null,this.ni=null,this.ti=null,this.ii=null,this.ei=null,this.ri=null,this.hi=null,this.oi=null,this.ai=null,this.Mo(),b.A.So(),T.A.So(),m.A.So(),O.A.Do=null,_.A.Do=null,s.A.Do=null,g.A.Do=null,R.A.Do=null,R.A.No=null,S.A.Do=null,this.Fo=null,u.A.No=null,n.A.So(),l.A.So(),p.A.So(),L.A.Do=[],x.A.Do=[]};Bo(){return this.$t}Po(){return this.Ws}Uo(){return this.Ns}Wo(){return this.hs}Go(){return this.He}Mo=()=>{this.pi=!1,this.Mi&&(clearInterval(this.Mi),this.Mi=null),this.li=null,this.ci=null,this.Ai=[],this.bi=null,this.Ti=null,this.Oi=null,this.Ri=null,this.Ci=null,this._i=null,this.Ei=null,this.vi=null,this.gi=null,this.Ii=null};Yo=()=>{'999'===D.getParameter('world')?(this.Eo=new Worker('worker.js',{type:'module'}),this.Eo.onmessage=this.onmessage,this.host=new M.x(this.Eo)):'998'===D.getParameter('world')&&(this.Eo={onmessage:t=>{this.stream.Ho.onmessage(t)},postMessage:t=>{this.bo&&this.bo.Lo&&'open'===this.bo.Lo.readyState&&this.bo.Lo.send(JSON.stringify(t))},onerror:null,onmessageerror:null,terminate:()=>{throw new Error},addEventListener:()=>{throw new Error},removeEventListener:()=>{throw new Error},dispatchEvent:()=>{throw new Error}},this.bo=new M.Q(this.Eo))};onmessage=t=>{switch(t.data.type){case'ready':return void(this.vo=!0);case'save':return(0,k.A)(t.data.value,t.data.path.split('/').pop().split('\\').pop()),void URL.revokeObjectURL(t.data.value);case'close':return void this.Eo?.postMessage({type:'close',id:t.data.id})}this.host?.xo===t.data.id?this.stream.Ho.onmessage(t.data):this.host?.postMessage(t)};Vo=async()=>{if(999==+D.getParameter('world'))this.host&&await this.host.Ko();else if(998==+D.getParameter('world')&&this.bo){if(this.bo.Lo)return void console.log('You are already connected.');const t=prompt('Paste offer here, answer will be copied to clipboard');if(t)try{await this.bo.Xo(t)}catch(t){console.error(t)}}};jo=async(t,i,e,s)=>{let n=5,o=await(this.db?.zo(t));if(o&&h.A.Zo(o)!==e&&(o=void 0),o)return new r.A(o);for(;!o;){await this.qo(s,`Requesting ${i}`);try{o=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}${e}`):await(0,C.Jo)(`${D.nt}/${t}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.qo(s,`Error loading - Will retry in ${t} secs.`),await(0,C.$o)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Qo(t,o)),new r.A(o)};ta=async(t,i,e,s)=>{let n=await(this.db?.zo(t+'.mid'));if(n&&12345678!==i&&h.A.Zo(n)!==i&&(n=void 0),!n)try{n=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}_${i}.mid`):await(0,C.Jo)(`${D.nt}/songs/${t}.mid`),e!==n.length&&(n=n.slice(0,e))}catch(t){}if(!n)return;await(this.db?.Qo(t+'.mid',n));const r=new h.A(Uint8Array.from(n)).ia,o=E.A.read(r,n,e,4);(0,v.ea)(o,this.Co,s)};sa=()=>{if(w.na.fillStyle='black',w.na.fillRect(0,0,this.width,this.height),this.ra(1),this.Dt){this.pi=!1,w.na.font='bold 16px helvetica, sans-serif',w.na.textAlign='left',w.na.fillStyle='yellow';let t=35;w.na.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.na.fillStyle='white',w.na.fillText('To fix this try the following (in order):',30,t),t+=50,w.na.font='bold 12px helvetica, sans-serif',w.na.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.na.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.na.fillText('3: Try using a different game-world',30,t),t+=30,w.na.fillText('4: Try rebooting your computer',30,t),t+=30,w.na.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.pi=!1,w.na.font='bold 20px helvetica, sans-serif',w.na.textAlign='left',w.na.fillStyle='white',w.na.fillText('Error - unable to load game!',50,50),w.na.fillText('To play RuneScape make sure you play from',50,100),w.na.fillText('https://2004scape.org',50,150)),this.Mt){this.pi=!1,w.na.font='bold 13px helvetica, sans-serif',w.na.textAlign='left',w.na.fillStyle='yellow';let t=35;w.na.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.na.fillStyle='white',w.na.fillText('To fix this try the following (in order):',30,t),t+=50,w.na.font='bold 12px helvetica, sans-serif',w.na.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.na.fillText('2: Try rebooting your computer, and reloading',30,t)}};ha=t=>{if(!t.oa)return!1;for(let i=0;i=s)return!1}else if(3===t.oa[i]){if(e<=s)return!1}else if(4===t.oa[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};ca=(t,i,e,s,n)=>{this.ve?.draw(t,i),this.be?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,A.A.fa);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;y.A.fillRect(t,i+h+16,16,r,A.A.ua),y.A.da(t,i+h+16,A.A.wa,r),y.A.da(t+1,i+h+16,A.A.wa,r),y.A.ya(t,i+h+16,A.A.wa,16),y.A.ya(t,i+h+17,A.A.wa,16),y.A.da(t+15,i+h+16,A.A.ma,r),y.A.da(t+14,i+h+17,A.A.ma,r-1),y.A.ya(t,i+h+r+15,A.A.ma,16),y.A.ya(t+1,i+h+r+14,A.A.ma,15)};Aa=(t,i)=>{let e=!1;const n=s.A.Do[t];if(!n.pa)return!1;for(let t=0;ts.delay[r.Ca];)r._a-=s.delay[r.Ca]+1,r.Ca++,r.Ca>=s.Ea&&(r.Ca-=s.va,(r.Ca<0||r.Ca>=s.Ea)&&(r.Ca=0)),e=!0}}}return e};ba=(t,i,e,r,h=!1)=>{if(0!==t.type||!t.pa||t.hide&&this.Zs!==t.id&&this.qs!==t.id&&this.Js!==t.id)return;const o=y.A.left,a=y.A.top,l=y.A.right,c=y.A.bottom;y.A.Ta(i,e,i+t.width,e+t.height);const f=t.pa.length;for(let o=0;o0&&this.ka(c),c.type===s.A.Ma)c.Da>c.scroll-c.height&&(c.Da=c.scroll-c.height),c.Da<0&&(c.Da=0),this.ba(c,a,l,c.Da,h),c.scroll>c.height&&this.ca(a+c.width,l,c.Da,c.scroll,c.height);else if(c.type===s.A.Na){let t=0;for(let i=0;i0){let i=0,e=0;const r=c.Pa[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qs===t){const h=m.A.Ya(r,c.Ua[t]);if(0!==this.tn&&this.Qs===t&&this.$s===c.id?(i=this.Ha-this.en,e=this.Va-this.sn,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.nn<5&&(i=0,e=0),h.Ka(128,s+i,n+e)):0!==this.un&&this.dn===t&&this.wn===c.id?h.Ka(128,s,n):h.draw(s,n),33===h.Xa||1!==c.Ua[t]){const r=c.Ua[t];this.di?.ja(s+i+1,n+10+e,this.za(r),A.A.Za),this.di?.ja(s+i,n+9+e,this.za(r),A.A.qa)}}}else if(c.Ja&&t<20){const i=c.Ja[t];i?.draw(s,n)}t++}}else if(c.type===s.A.$a)c.fill?y.A.fillRect(a,l,c.width,c.height,c.Qa):y.A.Sa(a,l,c.width,c.height,c.Qa);else if(c.type===s.A.tl){const t=c.font;let i=c.Qa,e=c.text;if(this.Js!==c.id&&this.qs!==c.id&&this.Zs!==c.id||0===c.il||(i=c.il),this.ha(c)&&(i=c.el,c.sl&&c.sl.length>0&&(e=c.sl)),c.nl===s.A.rl&&this.mn&&(e='Please wait...',i=c.Qa),!t||!e)continue;for(let s=l+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),c.ol?t.al(a+(c.width/2|0),s,r,i,c.ll):t.cl(a,s,r,i,c.ll)}}else if(c.type===s.A.fl){let t;t=this.ha(c)?c.ul:c.dl,t?.draw(a,l)}else if(c.type===s.A.wl){const t=n.A.yl,i=n.A.ml;n.A.yl=a+(c.width/2|0),n.A.ml=l+(c.height/2|0);const e=n.A.sin[c.Al]*c.zoom>>16,s=n.A.cos[c.Al]*c.zoom>>16,r=this.ha(c);let h;h=r?c.Ia:c.ga;let o=null;if(-1===h)o=c.pl(-1,-1,r);else{const t=g.A.Do[h];t.frames&&t.gl&&(o=c.pl(t.frames[c.Ca],t.gl[c.Ca],r))}o&&o.Il(0,c._l,0,c.Al,0,e,s),n.A.yl=t,n.A.ml=i}else if(c.type===s.A.Cl){const t=c.font;if(!t||!c.Pa||!c.Ua)continue;let i=0;for(let e=0;e0){const n=m.A.get(c.Pa[i]-1);let r=n.name;if((n.El||1!==c.Ua[i])&&(r=r+' x'+this.vl(c.Ua[i])),!r)continue;const h=a+s*(c.Wa+115),o=l+e*(c.Ga+12);c.ol?t.al(h+(c.width/2|0),o,r,c.Qa,c.ll):t.cl(h,o,r,c.Qa,c.ll)}i++}}}y.A.Ta(o,a,l,c)};ka=t=>{let i=t.xa;if(i>=s.A.bl&&i<=s.A.Tl)i--,i>=this.Vh?(t.text='',t.nl=0):(t.text=this.eo[i],t.nl=1);else if(i>=s.A.Ol&&i<=s.A.Rl)i-=s.A.Ol,i>=this.Vh?(t.text='',t.nl=0):(0===this.no[i]?t.text='@red@Offline':this.no[i]===D.it?t.text='@gre@World-'+(this.no[i]-9):t.text='@yel@World-'+(this.no[i]-9),t.nl=1);else if(i===s.A.Sl)t.scroll=15*this.Vh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=s.A.Ll&&i<=s.A.xl)i-=s.A.Ll,i>=this.fs?(t.text='',t.nl=0):(t.text=I.A.kl(I.A.Ml(this.us[i])),t.nl=1);else if(i===s.A.Dl)t.scroll=15*this.fs+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===s.A.Nl){if(t.Al=150,t._l=256*Math.sin(this.Ft/40)&2047,this.Gh){this.Gh=!1;const i=new d.fe(7,null);let e=0;for(let t=0;t<7;t++){const s=this.Yh[t];s>=0&&(i[e++]=_.A.Do[s].pl())}const s=p.A.Fl(i,e);for(let t=0;t<5;t++)0!==this.Hh[t]&&(s.Bl(u.A.Pl[t][0],u.A.Pl[t][this.Hh[t]]),1===t&&s.Bl(u.A.Ul[0],u.A.Ul[this.Hh[t]]));if(this.xh){const i=g.A.Do[this.xh.Wl].frames;i&&(s.Gl(),s.Yl(i[0]),s.Hl(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===s.A.Vl)this.Fe||(this.Fe=t.dl,this.Be=t.ul),this.Wh?t.dl=this.Be:t.dl=this.Fe;else if(i===s.A.Kl)this.Fe||(this.Fe=t.dl,this.Be=t.ul),this.Wh?t.dl=this.Fe:t.dl=this.Be;else if(i===s.A.Xl)t.text=this.xn,this.Ft%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===s.A.jl)this.Uh?this.kn?(t.Qa=A.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Qa=A.A.La,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===s.A.zl||i===s.A.Zl)if(0===this.Dn)t.text='';else{let i;i=0===this.Nn?'earlier today':1===this.Nn?'yesterday':this.Nn+' days ago',t.text='You last logged in '+i+' from: '+I.A.ql(this.Dn)}else if(i===s.A.Jl)0===this.Bn&&(t.text='0 unread messages',t.Qa=A.A.qa),1===this.Bn&&(t.text='1 unread message',t.Qa=A.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Qa=A.A.GREEN);else if(i===s.A.$l)if(201===this.Fn)t.text='';else if(200===this.Fn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Fn?'Earlier today':1===this.Fn?'Yesterday':this.Fn+' days ago',t.text=i+' you changed your recovery questions'}else i===s.A.Ql?201===this.Fn?t.text='':200===this.Fn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===s.A.tc&&(201===this.Fn?t.text='':(this.Fn,t.text="Do this from the 'account management' area on our front webpage"))};aa=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let n=0,r=0;for(;;){const t=e[r++];if(0===t)return n;if(1===t)n+=this.Es[e[r++]];else if(2===t)n+=this.vs[e[r++]];else if(3===t)n+=this.Cs[e[r++]];else if(4===t){const t=s.A.Do[e[r++]],i=e[r++]+1;if(t.Pa&&t.Ua)for(let e=0;et<999999999?String(t):'*';vl=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};za=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,e)=>{e.d(i,{w:()=>h});var s=e(7046),n=e(1651),r=e(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');['0','998','999'].includes(s.A.getParameter('world'))?function(){if(+s.A.getParameter('world')>=998)return void(n.K.nt='data/pack/client');n.K.st='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0}():await async function(t){const i=await o(t,parseInt(s.A.getParameter('world'),10)),e=new URL(i.address);n.K.it=10+i.id-1,n.K.st=`${e.protocol}//${e.hostname}`,n.K.nt=`${e.protocol}//${e.hostname}:${e.port}`,t||(n.K.st=n.K.st.replace('https:','http:'));n.K.portOffset=i.portOffset,n.K.members=!0===i?.members,s.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===s.A.getParameter('detail').length&&s.A.setParameter('detail','high');'low'===s.A.getParameter('detail')?n.K.St():n.K.Rt()}(),0===s.A.getParameter('method').length&&s.A.setParameter('method','0')}async function o(t,i,e=0){if(e>=10)throw new Error('could not find world to connect!');const s=t?'https:':'http:';let n;try{n=JSON.parse(await(0,r.ec)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.$o)(1e3),o(t,i,++e)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hh:0});const h=n.find((t=>t.id===i));return h||o(t,i,10)}},7046:(t,i,e)=>{e.d(i,{A:()=>l});var s=e(1183),n=e(4583),r=e(9234),h=e(9091),o=e(2595),a=e(7854);class l{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}sc=0;nc=[];rc=0;Fo=null;state=0;hc=20;oc=1;ac=[];lc=0;cc=0;fc=[];uc=!0;dc=!1;wc=50;hasFocus=!0;yc=!1;mc=0;Ac=0;Ha=0;Va=0;gc=0;Ic=0;_c=0;Cc=[];Ec=[];vc=0;bc=0;input=null;Tc=!1;Oc=!1;Rc=!1;time=-1;Sc=0;Lc=0;xc=0;kc=0;Mc=0;Dc=0;constructor(t=!1){a.Nc.tabIndex=-1,a.na.fillStyle='black',a.na.fillRect(0,0,a.Nc.width,a.Nc.height),this.dc=t,this.dc?this.resize(window.innerWidth,window.innerHeight):this.resize(a.Nc.width,a.Nc.height)}get width(){return a.Nc.width}get height(){return a.Nc.height}resize=(t,i)=>{a.Nc.width=t,a.Nc.height=i,this.Fo=new s.A(t,i),n.A.Fc()};run=async()=>{a.Nc.addEventListener('resize',(()=>{this.dc&&this.resize(window.innerWidth,window.innerHeight)}),!1),a.Nc.onmousedown=this.onmousedown,a.Nc.onmouseup=this.onmouseup,a.Nc.onmouseenter=this.onmouseenter,a.Nc.onmouseleave=this.onmouseleave,a.Nc.onmousemove=this.onmousemove,window.onbeforeunload=this.So,a.Nc.onfocus=this.onfocus,a.Nc.onblur=this.onblur,this.Bc?(a.Nc.ontouchstart=this.ontouchstart,a.Nc.ontouchend=this.ontouchend,a.Nc.ontouchmove=this.ontouchmove):(a.Nc.onkeydown=this.onkeydown,a.Nc.onkeyup=this.onkeyup),a.Nc.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Bc&&'low'===l.getParameter('detail')&&(this.wc=30),await this.qo(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.ac[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.Pc();const h=e,o=s;e=300,s=1,t=performance.now();const a=this.ac[i];if(0===a?(e=h,s=o):t>a&&(e=2560*this.hc/(t-a)|0),e<25?e=25:e>256&&(e=256,s=this.hc-(t-a)/10|0),this.ac[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.ac[t]&&(this.ac[t]+=s);for(s0&&(this.lc=1e3*e/(256*this.hc)|0);const l=performance.now();if(this.uc&&this.refresh(),await this.draw(),this.fc[this.cc]=(performance.now()-l)/1e3,this.cc=(this.cc+1)%this.fc.length,this.wc<50){const i=1e3/this.wc-(performance.now()-t);i>0&&await(0,r.$o)(i)}}-1===this.state&&this.Pc()};Pc=()=>{this.state=-2,this.So()};ra=t=>{this.hc=1e3/t|0};Uc=t=>{this.wc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.hc|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};So=()=>{};draw=async()=>{};refresh=()=>{};async qo(t,i){const e=this.width,s=this.height;this.uc&&(a.na.fillStyle='black',a.na.fillRect(0,0,e,s),this.uc=!1);const n=s/2-18;a.na.fillStyle='rgb(140, 17, 17)',a.na.rect((e/2|0)-152,n,304,34),a.na.fillRect((e/2|0)-150,n+2,3*t,30),a.na.fillStyle='black',a.na.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),a.na.font='bold 13px helvetica, sans-serif',a.na.textAlign='center',a.na.fillStyle='white',a.na.fillText(i,e/2|0,n+22),await(0,r.$o)(5)}Wc=()=>{let t=-1;return this.bc!==this.vc&&(t=this.Ec[this.vc],this.vc=this.vc+1&127),t};get ms(){const t=this.fc.length;let i=0;for(let e=0;ethis.sc&&(this.sc=e),this.nc[this.rc]=e,this.rc=(this.rc+1)%250,e}get Gc(){return this.nc.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.mc=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Cc[n]=1),n>4&&(this.Ec[this.bc]=n,this.bc=this.bc+1&127),o.A.enabled&&o.A.Yc(n),h.g.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.mc=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Cc[n]=0),o.A.enabled&&o.A.Hc(n),h.g.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.Tc=!1,(t.clientX>0||t.clientY>0)&&this.Vc(t),this.mc=0,this.Ic=this.Ha,this._c=this.Va,this.Bc&&!this.Kc){if(this.Xc()||this.jc()||this.zc())return this.gc=1,void(this.Ac=1);t.timeStamp>=this.time+500?(this.gc=2,this.Ac=2):(this.gc=1,this.Ac=1)}else 2===t.button?(this.gc=2,this.Ac=2):(this.gc=1,this.Ac=1);o.A.enabled&&o.A.Zc(this.Ic,this._c,t.buttons)};onmouseup=t=>{this.Vc(t),this.mc=0,this.Ac=0,o.A.enabled&&o.A.qc(t.buttons)};onmouseenter=t=>{this.Vc(t),o.A.enabled&&o.A.Jc()};onmouseleave=t=>{this.Vc(t),this.mc=0,this.Ha=-1,this.Va=-1,this.Ac=0,this.Ic=-1,this._c=-1,o.A.enabled&&o.A.$c()};onmousemove=t=>{this.Vc(t),this.mc=0,o.A.enabled&&o.A.Qc(this.Ha,this.Va)};onfocus=t=>{this.hasFocus=!0,this.uc=!0,this.refresh(),o.A.enabled&&o.A.tf()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.if()};ontouchstart=t=>{if(!this.Bc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.Tc=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Sc=this.Mc=this.xc=0|i.screenX,this.Lc=this.Dc=this.kc=0|i.screenY,this.time=t.timeStamp,this.Oc=this.ef(),this.Rc=this.sf()};ontouchend=t=>{if(!this.Bc||!this.Tc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Mc=0|i.screenX,this.Dc=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Oc&&!this.ef())return void(this.Tc=!1);if(this.Rc&&!this.sf())return void(this.Tc=!1);if(this.Xc()||this.nf()||this.jc()||this.zc()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.jc()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.zc()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Xc()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.nf()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.rf?t.setAttribute('type','password'):t.setAttribute('type',this.zc()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.rf&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.rf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.rf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.Tc=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.Sc-this.Mc)>16||Math.abs(this.Lc-this.Dc)>16;n&&!r?(this.Tc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.Ac=0,this.Tc=!1)};ontouchmove=t=>{if(!this.Bc||!this.Tc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Mc=0|i.screenX,this.Dc=0|i.screenY,this.Oc&&-1===this.Go()?(this.xc-this.Mc>0?this.rotate(2):this.xc-this.Mc<0&&this.rotate(0),this.kc-this.Dc>0?this.rotate(3):this.kc-this.Dc<0&&this.rotate(1)):(this.Rc||-1!==this.Go())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.xc=this.Mc,this.kc=this.Dc};get Bc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get rf(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Kc(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}ef=()=>this.yc&&this.Ha>=8&&this.Ha<=520&&this.Va>=11&&this.Va<=345;Xc=()=>this.yc&&-1===this.Wo()&&!this.Po()&&!this.Uo()&&this.Ha>=11&&this.Ha<=506&&this.Va>=449&&this.Va<=482;nf=()=>this.yc&&(this.Po()||this.Uo())&&this.Ha>=11&&this.Ha<=506&&this.Va>=383&&this.Va<=482;sf=()=>this.yc&&this.Ha>=562&&this.Ha<=752&&this.Va>=231&&this.Va<=492;jc=()=>!this.yc&&2===this.Bo()&&this.Ha>=301&&this.Ha<=562&&this.Va>=262&&this.Va<=279;zc=()=>!this.yc&&2===this.Bo()&&this.Ha>=301&&this.Ha<=562&&this.Va>=279&&this.Va<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};hf=()=>null!==document.fullscreenElement;Vc=t=>{if(this.hf()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/a.Nc.height,s=(window.innerWidth-a.Nc.width*e)/2;this.Ha=0|this.af(t.clientX-i.left-s,0,a.Nc.width*e,0,789),this.Va=0|this.af(t.clientY-i.top,0,a.Nc.height*e,0,532)}else{const i=a.Nc.getBoundingClientRect(),e=a.Nc.width/i.width,s=a.Nc.height/i.height;this.Ha=(t.clientX-i.left)*e|0,this.Va=(t.clientY-i.top)*s|0}this.Ha<0&&(this.Ha=0),this.Va<0&&(this.Va=0),this.Ha>789&&(this.Ha=789),this.Va>532&&(this.Va=532)};af=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}},2595:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static enabled=!1;static lf=null;static cf=null;static ff=0;static uf=0;static df=0;static wf=0;static yf=0;static mf=()=>{this.lf=s.A.Pt(1),this.cf=null,this.ff=performance.now(),this.enabled=!0};static Af=()=>{this.enabled=!1,this.lf=null};static flush=()=>{let t=null;return this.cf&&this.enabled&&(t=this.cf),this.cf=null,t};static stop=()=>{let t=null;return this.lf&&this.lf.pf>0&&this.enabled&&(t=this.lf),this.Af(),t};static Zc=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.uf++;const s=performance.now();let n=(s-this.ff)/10|0;n>250&&(n=250),this.ff=s,this.gf(5),1===e?this.lf?.p1(1):this.lf?.p1(2),this.lf?.p1(n),this.lf?.p3(t+(i<<10))};static qc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,this.gf(2),1===t?this.lf?.p1(3):this.lf?.p1(4),this.lf?.p1(e)};static Qc=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.df>=50){this.df=e,this.uf++;let s=(e-this.ff)/10|0;s>250&&(s=250),this.ff=e,t-this.wf<8&&t-this.wf>=-8&&i-this.yf<8&&i-this.yf>=-8?(this.gf(3),this.lf?.p1(5),this.lf?.p1(s),this.lf?.p1(t+(i-this.yf+8<<4)+8-this.wf)):t-this.wf<128&&t-this.wf>=-128&&i-this.yf<128&&i-this.yf>=-128?(this.gf(4),this.lf?.p1(6),this.lf?.p1(s),this.lf?.p1(t+128-this.wf),this.lf?.p1(i+128-this.yf)):(this.gf(5),this.lf?.p1(7),this.lf?.p1(s),this.lf?.p3(t+(i<<10))),this.wf=t,this.yf=i}};static Yc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.gf(3),this.lf?.p1(8),this.lf?.p1(e),this.lf?.p1(t)};static Hc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.gf(3),this.lf?.p1(9),this.lf?.p1(e),this.lf?.p1(t)};static tf=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.lf?.p1(10),this.lf?.p1(i)};static if=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.lf?.p1(11),this.lf?.p1(i)};static Jc=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.lf?.p1(12),this.lf?.p1(i)};static $c=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.lf?.p1(13),this.lf?.p1(i)};static gf=t=>{if(this.lf&&this.lf.pf+t>=500){const t=this.lf;this.lf=s.A.Pt(1),this.cf=t}}}},9091:(t,i,e)=>{e.d(i,{c:()=>n,g:()=>s});const s=['F11','F12'],n={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}}},1120:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1069),n=e(8665),r=e(2679),h=e(2511),o=e(3819),a=e(3867),l=e(8950);class c{static Do=[];static If=null;static No=null;static Ma=0;static _f=1;static Na=2;static $a=3;static tl=4;static fl=5;static wl=6;static Cl=7;static Cf=1;static Ef=2;static vf=3;static bf=4;static Tf=5;static rl=6;static bl=1;static Tl=100;static Ol=101;static Rl=200;static Of=201;static Rf=202;static Sl=203;static Sf=205;static Lf=300;static xf=301;static kf=302;static Mf=303;static Df=304;static Nf=305;static Ff=306;static Bf=307;static Pf=308;static Uf=309;static Wf=310;static Gf=311;static Yf=312;static Hf=313;static Vf=314;static Kf=315;static Xf=316;static jf=317;static zf=318;static Zf=319;static qf=320;static Jf=321;static $f=322;static Qf=323;static Vl=324;static Kl=325;static tu=326;static Nl=327;static Ll=401;static xl=500;static iu=501;static eu=502;static Dl=503;static Xl=600;static su=601;static nu=602;static ru=603;static hu=604;static ou=605;static au=606;static lu=607;static cu=608;static fu=609;static uu=610;static du=611;static wu=612;static jl=613;static zl=650;static Jl=651;static $l=652;static Ql=653;static tc=654;static Zl=655;static yu=(t,i,e)=>{this.If=new r.A(5e4),this.No=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.pf+=2;n.pf0){s.oa=new Uint8Array(r),s.la=new Uint16Array(r);for(let t=0;t0){s.scripts=new a.fe(o,null);for(let t=0;t0){const n=e.lastIndexOf(',');s.Ja[t]=this.vu(i,e.substring(0,n),parseInt(e.substring(n+1),10))}}s.bu=new a.fe(5,null);for(let t=0;t<5;t++){const i=n.Eu;s.bu[t]=i,0===i.length&&(s.bu[t]=null)}}if(s.type===c.$a&&(s.fill=1===n.pu),s.type===c.tl||s.type===c._f){s.ol=1===n.pu;const t=n.pu;e&&(s.font=e[t]),s.ll=1===n.pu}if(s.type===c.tl&&(s.text=n.Eu,s.sl=n.Eu),s.type!==c._f&&s.type!==c.$a&&s.type!==c.tl||(s.Qa=n.ia),s.type!==c.$a&&s.type!==c.tl||(s.el=n.ia,s.il=n.ia),s.type===c.fl){const t=n.Eu;if(t.length>0){const e=t.lastIndexOf(',');s.dl=this.vu(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=n.Eu;if(e.length>0){const t=e.lastIndexOf(',');s.ul=this.vu(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(s.type===c.wl){const t=n.pu;0!==t&&(s.model=this.pl((t-1<<8)+n.pu));const i=n.pu;0!==i&&(s.Tu=this.pl((i-1<<8)+n.pu)),s.ga=n.pu,0===s.ga?s.ga=-1:s.ga=(s.ga-1<<8)+n.pu,s.Ia=n.pu,0===s.Ia?s.Ia=-1:s.Ia=(s.Ia-1<<8)+n.pu,s.zoom=n.mu,s.Al=n.mu,s._l=n.mu}if(s.type===c.Cl){s.Pa=new Int32Array(s.width*s.height),s.Ua=new Int32Array(s.width*s.height),s.ol=1===n.pu;const t=n.pu;e&&(s.font=e[t]),s.ll=1===n.pu,s.Qa=n.ia,s.Wa=n.Iu,s.Ga=n.Iu,s._u=1===n.pu,s.bu=new a.fe(5,null);for(let t=0;t<5;t++){const i=n.Eu;s.bu[t]=i,0===i.length&&(s.bu[t]=null)}}s.nl!==c.Ef&&s.type!==c.Na||(s.Ou=n.Eu,s.action=n.Eu,s.Ru=n.mu),s.nl!==c.Cf&&s.nl!==c.bf&&s.nl!==c.Tf&&s.nl!==c.rl||(s.Su=n.Eu,0===s.Su.length&&(s.nl===c.Cf?s.Su='Ok':s.nl===c.bf||s.nl===c.Tf?s.Su='Select':s.nl===c.rl&&(s.Su='Continue')))}this.If=null,this.No=null};static vu=(t,i,e)=>{const s=o.A.Lu(i)<<8n|BigInt(e);if(this.If){const t=this.If.get(s);if(t)return t}let n;try{n=h.A.xu(t,i,e),this.If?.put(s,n)}catch(t){return null}return n};static pl=t=>{if(this.No){const i=this.No.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.No?.put(BigInt(t),i),i};id=-1;Au=-1;type=-1;nl=-1;xa=0;width=0;height=0;gu=-1;oa=null;la=null;scripts=null;scroll=0;hide=!1;draggable=!1;_u=!1;Cu=!1;Wa=0;Ga=0;Fa=null;Ba=null;Ja=null;bu=null;fill=!1;ol=!1;font=null;ll=!1;text=null;sl=null;Qa=0;el=0;il=0;dl=null;ul=null;model=null;Tu=null;ga=-1;Ia=-1;zoom=0;Al=0;_l=0;Ou=null;action=null;Ru=-1;Su=null;pa=null;Oa=null;Ra=null;x=0;y=0;Da=0;Pa=null;Ua=null;Ca=0;_a=0;pl(t,i,e){let s=this.model;if(e&&(s=this.Tu),!s)return null;if(-1===t&&-1===i&&!s.ku)return s;const r=n.A.Mu(s,!0,!0,!1);return-1===t&&-1===i||r.Gl(),-1!==t&&r.Yl(t),-1!==i&&r.Yl(i),r.Hl(64,768,-50,-10,-50,!0),r}Du(){if(this.Au===this.id)return this.x;let t=c.Do[this.Au];if(!t.pa||!t.Oa||!t.Ra)return this.x;let i=t.pa.indexOf(this.id);if(-1===i)return this.x;let e=t.Oa[i];for(;t.Au!==t.id;){const s=c.Do[t.Au];s.pa&&s.Oa&&s.Ra&&(i=s.pa.indexOf(t.id),-1!==i&&(e+=s.Oa[i])),t=s}return e}Nu(){if(this.Au===this.id)return this.y;let t=c.Do[this.Au];if(!t.pa||!t.Oa||!t.Ra)return this.y;let i=t.pa.indexOf(this.id);if(-1===i)return this.y;let e=t.Ra[i];for(;t.Au!==t.id;){const s=c.Do[t.Au];s.pa&&s.Oa&&s.Ra&&(i=s.pa.indexOf(t.id),-1!==i&&(e+=s.Ra[i])),t=s}return e}outline(t){const i=this.Du(),e=this.Nu();l.A.Sa(i,e,this.width,this.height,t)}move(t,i){if(this.Au===this.id)return;this.x=0,this.y=0;const e=c.Do[this.Au];if(e.pa&&e.Oa&&e.Ra){const s=e.pa.indexOf(this.id);-1!==s&&(e.Oa[s]=t,e.Ra[s]=i)}}delete(){if(this.Au===this.id)return;const t=c.Do[this.Au];if(t.pa&&t.Oa&&t.Ra){const i=t.pa.indexOf(this.id);-1!==i&&(t.pa.splice(i,1),t.Oa.splice(i,1),t.Ra.splice(i,1))}}}},6333:(t,i,e)=>{e.d(i,{$:()=>s});class s{id;Fu=null;constructor(t){this.id=t}Bu(t){for(;;){const i=t.pu;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(6333);class r extends n.${static count=0;static Do=[];static yu=t=>{const i=new s.A(t.read('flo.dat'));this.count=i.mu;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static Uu=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static Wu=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);Gu=0;texture=-1;Yu=!1;Hu=!0;Vu=0;Ku=0;Xu=0;ju=0;zu=0;Zu=0;decode(t,i){1===t?(this.Gu=i.qu,this.setColor(this.Gu)):2===t?this.texture=i.pu:3===t?this.Yu=!0:5===t?this.Hu=!1:6===t?this.Fu=i.Eu:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(h=e),s>h&&(h=s);let o=0,a=0;const l=(n+h)/2;n!==h&&(l<.5&&(a=(h-n)/(h+n)),l>=.5&&(a=(h-n)/(2-h-n)),i===h?o=(e-s)/(h-n):e===h?o=(s-i)/(h-n)+2:s===h&&(o=(i-e)/(h-n)+4)),o/=6,this.Vu=256*o|0,this.Ku=256*a|0,this.Xu=256*l|0,this.Ku<0?this.Ku=0:this.Ku>255&&(this.Ku=255),this.Xu<0?this.Xu=0:this.Xu>255&&(this.Xu=255),this.ju=l>.5?(1-l)*a*512|0:l*a*512|0,this.ju<1&&(this.ju=1),this.zu=o*this.ju|0;let c=this.Vu+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.Ku+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.Xu+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.Zu=r.Pu(c,f,u)}}},8317:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(1069),n=e(6333),r=e(8665),h=e(3867);class o extends n.${static count=0;static Do=[];static yu=t=>{const i=new s.A(t.read('idk.dat'));this.count=i.mu;for(let t=0;t=40&&t<50?this.Qu[t-40]=i.mu:t>=50&&t<60?this.td[t-50]=i.mu:t>=60&&t<70?this.$u[t-60]=i.mu:console.log('Error unrecognised config code: ',t)}pl(){if(!this.Ju)return null;const t=new h.fe(this.Ju.length,null);for(let i=0;i{e.d(i,{A:()=>c});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(1023),a=e(6169),l=e(3867);class c extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static hd=new r.A(500);static od=new r.A(30);static yu=t=>{this.sd=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.mu,this.nd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%10;const i=this.cache[this.rd];return this.sd.pf=this.nd[t],i.id=t,i.reset(),i.Bu(this.sd),i.ad||(i.ad=new Int32Array(1)),-1===i.ld&&i.ad&&(i.active=i.ad.length>0&&i.ad[0]===o.A.fd.id,i.ud&&(i.active=!0)),i};static So=()=>{this.hd=null,this.od=null,this.nd=null,this.cache=null,this.sd=null};Ju=null;ad=null;name=null;dd=null;Qu=null;td=null;width=1;length=1;wd=!0;yd=!0;active=!1;ld=-1;md=!1;Ad=!1;Hu=!1;ga=-1;pd=!1;gd=16;Id=0;_d=0;ud=null;Cd=-1;Ed=-1;vd=!1;bd=!0;Td=128;Od=128;Rd=128;Sd=0;Ld=0;xd=0;kd=0;Md=!1;decode(t,i){if(1===t){const t=i.pu;this.Ju=new Int32Array(t),this.ad=new Int32Array(t);for(let e=0;e=30&&t<39)this.ud||(this.ud=new l.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(40===t){const t=i.pu;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e=this.Ju.length)return null;let d=this.Ju[l];if(-1===d)return null;const w=this.vd!==i>3;w&&(d+=65536);let y=c.hd?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.Gd(),c.hd?.put(BigInt(d),y));const m=128!==this.Td||128!==this.Od||128!==this.Rd,A=0!==this.Ld||0!==this.xd||0!==this.kd;let p=h.A.Mu(y,!this.Qu,!this.pd,i===a.A.Yd&&-1===o&&!m&&!A);for(-1!==o&&(p.Gl(),p.Yl(o),p.Hd=null,p.Vd=null);i-- >0;)p.Kd();if(this.Qu&&this.td)for(let t=0;t{e.d(i,{A:()=>a});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(3867);class a extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static No=new r.A(30);static yu=t=>{this.sd=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.mu,this.nd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%20;const i=this.cache[this.rd]=new a(t);return this.sd.pf=this.nd[t],i.Bu(this.sd),i};static So=()=>{this.No=null,this.nd=null,this.cache=null,this.sd=null};name=null;dd=null;size=1;Ju=null;$u=null;pd=!1;zd=-1;Zd=-1;qd=-1;Jd=-1;$d=-1;Qu=null;td=null;ud=null;Td=-1;Od=-1;Rd=-1;Qd=!0;tw=-1;iw=128;ew=128;decode(t,i){if(1===t){const t=i.pu;this.Ju=new Uint16Array(t);for(let e=0;e=30&&t<40)this.ud||(this.ud=new o.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(40===t){const t=i.pu;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e{e.d(i,{A:()=>u});var s=e(6333),n=e(1069),r=e(2511),h=e(2679),o=e(8665),a=e(4583),l=e(8950),c=e(9298),f=e(3867);class u extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static aw=!0;static No=new h.A(50);static lw=new h.A(200);static yu=(t,i)=>{this.aw=i,this.sd=new n.A(t.read('obj.dat'));const e=new n.A(t.read('obj.idx'));this.count=e.mu,this.nd=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%10;const i=this.cache[this.rd];return this.sd.pf=this.nd[t],i.id=t,i.reset(),i.Bu(this.sd),-1!==i.cw&&i.fw(),!this.aw&&i.members&&(i.name='Members Object',i.dd="Login to a members' server to use this object.",i.ud=null,i.uw=null),i};static So=()=>{this.No=null,this.lw=null,this.nd=null,this.cache=null,this.sd=null};static Ya=(t,i)=>{if(u.lw){let e=u.lw.get(BigInt(t));if(e&&e.dw!==i&&-1!==e.dw&&(e.ww(),e=null),e)return e}let e=u.get(t);if(e.yw||(i=-1),e.yw&&e.mw&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.mw[s]&&0!==e.mw[s]&&(t=e.yw[s]);-1!==t&&(e=u.get(t))}const s=new r.A(32,32),n=a.A.yl,h=a.A.ml,o=a.A.Aw,f=l.A.pw,d=l.A.gw,w=l.A.Iw,y=l.A.left,m=l.A.right,A=l.A.top,p=l.A.bottom;a.A._w=!1,l.A.bind(s.pw,32,32),l.A.fillRect(0,0,32,32,c.A.Za),a.A.Fc();const g=e.Cw(1),I=a.A.sin[e.Ew]*e.bw>>16,_=a.A.cos[e.Ew]*e.bw>>16;g.Il(0,e.Tw,e.Ow,e.Ew,e.Rw,I+(g.jd/2|0)+e.Sw,_+e.Sw);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.pw[t+32*i]&&(t>0&&s.pw[t+32*i-1]>1||i>0&&s.pw[t+32*(i-1)]>1||t<31&&s.pw[t+32*i+1]>1||i<31&&s.pw[t+32*(i+1)]>1)&&(s.pw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.pw[t+32*i]&&t>0&&i>0&&s.pw[t+32*(i-1)-1]>0&&(s.pw[t+32*i]=3153952);if(-1!==e.cw){const t=this.Ya(e.Lw,10),i=t.Xa,s=t.dw;t.Xa=32,t.dw=32,t.xw(5,5,22,22),t.Xa=i,t.dw=s}return u.lw?.put(BigInt(t),s),l.A.bind(f,d,w),l.A.Ta(y,A,m,p),a.A.yl=n,a.A.ml=h,a.A.Aw=o,a.A._w=!0,e.El?s.Xa=33:s.Xa=32,s.dw=i,s};model=0;name=null;dd=null;Qu=null;td=null;bw=2e3;Ew=0;Tw=0;Ow=0;Rw=0;Sw=0;kw=!1;Mw=-1;El=!1;Dw=1;members=!1;ud=null;uw=null;Nw=-1;Fw=-1;Bw=0;Pw=-1;Uw=-1;Ww=0;Gw=-1;Yw=-1;Hw=-1;Vw=-1;Kw=-1;Xw=-1;yw=null;mw=null;Lw=-1;cw=-1;decode(t,i){if(1===t)this.model=i.mu;else if(2===t)this.name=i.Eu;else if(3===t)this.dd=i.Eu;else if(4===t)this.bw=i.mu;else if(5===t)this.Ew=i.mu;else if(6===t)this.Tw=i.mu;else if(7===t)this.Rw=i.Iu,this.Rw>32767&&(this.Rw-=65536);else if(8===t)this.Sw=i.Iu,this.Sw>32767&&(this.Sw-=65536);else if(9===t)this.kw=!0;else if(10===t)this.Mw=i.mu;else if(11===t)this.El=!0;else if(12===t)this.Dw=i.ia;else if(16===t)this.members=!0;else if(23===t)this.Nw=i.mu,this.Bw=i.Dd;else if(24===t)this.Fw=i.mu;else if(25===t)this.Pw=i.mu,this.Ww=i.Dd;else if(26===t)this.Uw=i.mu;else if(t>=30&&t<35)this.ud||(this.ud=new f.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(t>=35&&t<40)this.uw||(this.uw=new f.fe(5,null)),this.uw[t-35]=i.Eu;else if(40===t){const t=i.pu;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.yw&&this.mw||(this.yw=new Uint16Array(10),this.mw=new Uint16Array(10)),this.yw[t-100]=i.mu,this.mw[t-100]=i.mu)}jw(t){let i=this.Nw;if(1===t&&(i=this.Pw),-1===i)return null;let e=this.Fw,s=this.Gw;1===t&&(e=this.Uw,s=this.Yw);let n=o.A.model(i);if(-1!==e){const t=o.A.model(e);if(-1===s){const i=[n,t];n=o.A.Fl(i,2)}else{const i=[n,t,o.A.model(s)];n=o.A.Fl(i,3)}}if(0===t&&0!==this.Bw&&n.translate(this.Bw,0,0),1===t&&0!==this.Ww&&n.translate(this.Ww,0,0),this.Qu&&this.td)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.mw[e]&&0!==this.mw[e]&&(i=this.yw[e]);if(-1!==i)return u.get(i).Cw(1)}if(u.No){const t=u.No.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.Qu&&this.td)for(let t=0;t{e.d(i,{A:()=>h});var s=e(6333),n=e(1069),r=e(6730);class h extends s.${static count=0;static Do=[];static yu=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.mu;for(let t=0;t{e.d(i,{A:()=>a});var s=e(6333),n=e(1069),r=e(1312),h=e(8665),o=e(2679);class a extends s.${static count=0;static Do=[];static No=new o.A(30);static yu=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.mu;for(let t=0;t=40&&t<50?this.Qu[t-40]=i.mu:t>=50&&t<60?this.td[t-50]=i.mu:console.log('Error unrecognised spotanim config code: ',t)}pl(){let t=a.No?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let i=0;i<6;i++)0!==this.Qu[0]&&t.Bl(this.Qu[i],this.td[i]);return a.No?.put(BigInt(this.id),t),t}}},3764:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(6333),n=e(1069);class r extends s.${static count=0;static Do=[];static ty=[];static iy=0;static yu=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.mu;for(let t=0;t{e.d(i,{A:()=>s});class s{static OPEN=0;static ly=1;static uy=2;static wy=4;static yy=8;static my=s.ly<<4;static Ay=s.uy<<4;static py=s.wy<<4;static gy=s.yy<<4;static Iy=256;static _y=512;static Cy=1024;static Ey=2048;static vy=4096;static by=s._y<<4;static Ty=s.Cy<<4;static Oy=s.Ey<<4;static Ry=s.vy<<4;static Sy=s.Iy<<9;static Ly=524288;static xy=2097152;static ky=s.xy|s.Ly;static My=s.Iy|s.ky;static Dy=s.uy|s.My;static Ny=s.yy|s.My;static Fy=s.uy|s.wy|s.Ny;static By=s.Ay|s.My;static Py=s.yy|s.my|s.By;static Uy=s.gy|s.My;static Wy=s.ly|s.uy|s.Uy;static Gy=s.Ay|s.py|s.Uy;static Yy=16777215}},670:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(9456),n=e(6169),r=e(1023),h=e(4909);class o{static Dr=4;static jr=104;static index=(t,i)=>t*o.jr+i;offsetX;Hy;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Hy=0,this.sizeX=o.jr,this.sizeZ=o.jr,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.Hy)]|=s.A.xy};Ky=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.Hy)]&=~s.A.xy};Xy=(t,i,e,r,h,o)=>{let a=s.A.Iy;o&&(a|=s.A.Sy);const l=t-this.offsetX,c=i-this.Hy;if(h===n.A.jy||h===n.A.zy){const t=e;e=r,r=t}for(let t=l;t=0&&t=0&&i{let a=s.A.Iy;o&&(a|=s.A.Sy);const l=t-this.offsetX,c=i-this.Hy;if(h===n.A.jy||h===n.A.zy){const t=e;e=r,r=t}for(let t=l;t=0&&t=0&&i{const a=t-this.offsetX,l=i-this.Hy,c=o?s.A.Ry:s.A.gy,f=o?s.A.vy:s.A.yy,u=o?s.A.Cy:s.A.uy,d=o?s.A.Ty:s.A.Ay,w=o?s.A._y:s.A.ly,y=o?s.A.by:s.A.my,m=o?s.A.Ey:s.A.wy,A=o?s.A.Oy:s.A.py;e===r.A.Jy.id?h===n.A.Yd?(this.add(a,l,c),this.add(a-1,l,f)):h===n.A.jy?(this.add(a,l,u),this.add(a,l+1,d)):h===n.A.$y?(this.add(a,l,f),this.add(a+1,l,c)):h===n.A.zy&&(this.add(a,l,d),this.add(a,l-1,u)):e===r.A.Qy.id||e===r.A.tm.id?h===n.A.Yd?(this.add(a,l,w),this.add(a-1,l+1,y)):h===n.A.jy?(this.add(a,l,m),this.add(a+1,l+1,A)):h===n.A.$y?(this.add(a,l,y),this.add(a+1,l-1,w)):h===n.A.zy&&(this.add(a,l,A),this.add(a-1,l-1,m)):e===r.A.im.id&&(h===n.A.Yd?(this.add(a,l,u|c),this.add(a-1,l,f),this.add(a,l+1,d)):h===n.A.jy?(this.add(a,l,u|f),this.add(a,l+1,d),this.add(a+1,l,c)):h===n.A.$y?(this.add(a,l,d|f),this.add(a+1,l,c),this.add(a,l-1,u)):h===n.A.zy&&(this.add(a,l,d|c),this.add(a,l-1,u),this.add(a-1,l,f))),o&&this.qy(t,i,e,h,!1)};sm=(t,i,e,h,o)=>{const a=t-this.offsetX,l=i-this.Hy,c=o?s.A.Ry:s.A.gy,f=o?s.A.vy:s.A.yy,u=o?s.A.Cy:s.A.uy,d=o?s.A.Ty:s.A.Ay,w=o?s.A._y:s.A.ly,y=o?s.A.by:s.A.my,m=o?s.A.Ey:s.A.wy,A=o?s.A.Oy:s.A.py;e===r.A.Jy.id?h===n.A.Yd?(this.remove(a,l,c),this.remove(a-1,l,f)):h===n.A.jy?(this.remove(a,l,u),this.remove(a,l+1,d)):h===n.A.$y?(this.remove(a,l,f),this.remove(a+1,l,c)):h===n.A.zy&&(this.remove(a,l,d),this.remove(a,l-1,u)):e===r.A.Qy.id||e===r.A.tm.id?h===n.A.Yd?(this.remove(a,l,w),this.remove(a-1,l+1,y)):h===n.A.jy?(this.remove(a,l,m),this.remove(a+1,l+1,A)):h===n.A.$y?(this.remove(a,l,y),this.remove(a+1,l-1,w)):h===n.A.zy&&(this.remove(a,l,A),this.remove(a-1,l-1,m)):e===r.A.im.id&&(h===n.A.Yd?(this.remove(a,l,u|c),this.remove(a-1,l,f),this.remove(a,l+1,d)):h===n.A.jy?(this.remove(a,l,u|f),this.remove(a,l+1,d),this.remove(a+1,l,c)):h===n.A.$y?(this.remove(a,l,d|f),this.remove(a+1,l,c),this.remove(a,l-1,u)):h===n.A.zy&&(this.remove(a,l,d|c),this.remove(a,l-1,u),this.remove(a-1,l,f))),o&&this.sm(t,i,e,h,!1)};nm=(t,i,e,h,a,l)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Hy,u=e-this.offsetX,d=h-this.Hy,w=o.index(c,f);if(a===r.A.Jy.id){if(l===n.A.Yd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(l===n.A.jy){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0}else if(l===n.A.$y){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(l===n.A.zy){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0}}else if(a===r.A.im.id){if(l===n.A.Yd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(l===n.A.jy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(l===n.A.$y){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(l===n.A.zy){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(a===r.A.rm.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0}return!1};hm=(t,i,e,h,a,l)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Hy,u=e-this.offsetX,d=h-this.Hy,w=o.index(c,f);if(a===r.A.om.id||a===r.A.am.id){if(a===r.A.am.id&&(l=l+2&3),l===n.A.Yd){if(c===u+1&&f===d&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0}else if(l===n.A.jy){if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0}else if(l===n.A.$y){if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0}else if(l===n.A.zy){if(c===u+1&&f===d&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0}}else if(a===r.A.lm.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0}return!1};fm=(t,i,e,n,r,a,l)=>{const c=e+r-1,f=n+a-1,u=o.index(t-this.offsetX,i-this.Hy);return t>=e&&t<=c&&i>=n&&i<=f||(t===e-1&&i>=n&&i<=f&&(this.flags[u]&s.A.yy)===s.A.OPEN&&(l&h.A.Yd)===s.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&s.A.gy)===s.A.OPEN&&(l&h.A.$y)===s.A.OPEN||(i===n-1&&t>=e&&t<=c&&(this.flags[u]&s.A.uy)===s.A.OPEN&&(l&h.A.zy)===s.A.OPEN||i===f+1&&t>=e&&t<=c&&(this.flags[u]&s.A.Ay)===s.A.OPEN&&(l&h.A.jy)===s.A.OPEN)))};add=(t,i,e)=>{this.flags[o.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[o.index(t,i)]&=s.A.Yy-e}}},4909:(t,i,e)=>{e.d(i,{A:()=>s});class s{static jy=1;static $y=2;static zy=4;static Yd=8}},6169:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Yd=0;static jy=1;static $y=2;static zy=3}},5599:(t,i,e)=>{e.d(i,{A:()=>s});class s{static um=0;static dm=1;static wm=2;static ym=3}},1023:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5599);class n{static Jy=new n(0,s.A.um);static Qy=new n(1,s.A.um);static im=new n(2,s.A.um);static tm=new n(3,s.A.um);static Am=new n(4,s.A.dm);static pm=new n(5,s.A.dm);static om=new n(6,s.A.dm);static am=new n(7,s.A.dm);static lm=new n(8,s.A.dm);static rm=new n(9,s.A.wm);static fd=new n(10,s.A.wm);static gm=new n(11,s.A.wm);static Im=new n(12,s.A.wm);static _m=new n(13,s.A.wm);static Cm=new n(14,s.A.wm);static Em=new n(15,s.A.wm);static vm=new n(16,s.A.wm);static bm=new n(17,s.A.wm);static Tm=new n(18,s.A.wm);static Om=new n(19,s.A.wm);static Rm=new n(20,s.A.wm);static Sm=new n(21,s.A.wm);static ym=new n(22,s.A.ym);static values(){return[this.Jy,this.Qy,this.bm,this.Em,this.im,this.Cm,this.rm,this.tm,this.ym,this.Im,this.gm,this.om,this.Rm,this.fd,this.pm,this._m,this.am,this.Am,this.vm,this.lm,this.Om,this.Sm,this.Tm]}static of(t){const i=this.values();for(let e=0;e{e.d(i,{A:()=>m});var s=e(670),n=e(2164),r=e(1069),h=e(4583),o=e(3045),a=e(5637),l=e(4197),c=e(1312),f=e(1023),u=e(6169),d=e(9298),w=e(5518),y=e(3867);class m{static Lm=Int8Array.of(1,2,4,8);static xm=Uint8Array.of(16,32,64,128);static km=Int8Array.of(1,0,-1,0);static Mm=Int8Array.of(0,-1,0,1);static Dm=(17*Math.random()|0)-8;static Nm=(33*Math.random()|0)-16;static et=!0;static Fm=0;static Bm=!1;static Pm=(t,i)=>{let e=this.Um(t+45365,i+91923,4)+(this.Um(t+10294,i+37821,2)-128>>1)+(this.Um(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static Um=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.Wm(s,r),a=this.Wm(s+1,r),l=this.Wm(s,r+1),c=this.Wm(s+1,r+1),f=this.Gm(o,a,n,e),u=this.Gm(l,c,n,e);return this.Gm(f,u,h,e)};static Gm=(t,i,e,s)=>{const n=65536-h.A.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static Wm=(t,i)=>((this.Ym(t-1,i-1)+this.Ym(t+1,i-1)+this.Ym(t-1,i+1)+this.Ym(t+1,i+1))/16|0)+((this.Ym(t-1,i)+this.Ym(t+1,i)+this.Ym(t,i-1)+this.Ym(t,i+1))/8|0)+(this.Ym(t,i)/4|0);static Ym=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static Xy=(t,i,e,s,n,r,h,o,d,w,y)=>{const A=n[y][i][e],p=n[y][i+1][e],g=n[y][i+1][e+1],I=n[y][i][e+1],_=A+p+g+I>>2,C=a.A.get(o);let E=i+(e<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A.ym.id)s?.Hm(C.pl(f.A.ym.id,w,A,p,g,I,-1),t,i,e,_,E,v),C.wd&&C.active&&h?.Vy(i,e),-1!==C.ga&&r.Vm(new l.A(o,t,3,i,e,c.A.Do[C.ga],!0));else if(d===f.A.fd.id||d===f.A.gm.id){const n=C.pl(f.A.fd.id,w,A,p,g,I,-1);if(n){let r,h,o=0;d===f.A.gm.id&&(o+=256),w===u.A.jy||w===u.A.zy?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.Xy(t,i,e,_,n,null,E,v,r,h,o)}C.wd&&h?.Xy(i,e,C.width,C.length,w,C.yd),-1!==C.ga&&r.Vm(new l.A(o,t,2,i,e,c.A.Do[C.ga],!0))}else if(d>=f.A.Im.id)s?.Xy(t,i,e,_,C.pl(d,w,A,p,g,I,-1),null,E,v,1,1,0),C.wd&&h?.Xy(i,e,C.width,C.length,w,C.yd),-1!==C.ga&&r.Vm(new l.A(o,t,2,i,e,c.A.Do[C.ga],!0));else if(d===f.A.Jy.id)s?.qy(t,i,e,_,m.Lm[w],0,C.pl(f.A.Jy.id,w,A,p,g,I,-1),null,E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C.ga&&r.Vm(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0));else if(d===f.A.Qy.id)s?.qy(t,i,e,_,m.xm[w],0,C.pl(f.A.Qy.id,w,A,p,g,I,-1),null,E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C.ga&&r.Vm(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0));else if(d===f.A.im.id){const n=w+1&3;s?.qy(t,i,e,_,m.Lm[w],m.Lm[n],C.pl(f.A.im.id,w+4,A,p,g,I,-1),C.pl(f.A.im.id,n,A,p,g,I,-1),E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C.ga&&r.Vm(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0))}else if(d===f.A.tm.id)s?.qy(t,i,e,_,m.xm[w],0,C.pl(f.A.tm.id,w,A,p,g,I,-1),null,E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C.ga&&r.Vm(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0));else if(d===f.A.rm.id)s?.Xy(t,i,e,_,C.pl(d,w,A,p,g,I,-1),null,E,v,1,1,0),C.wd&&h?.Xy(i,e,C.width,C.length,w,C.yd),-1!==C.ga&&r.Vm(new l.A(o,t,2,i,e,c.A.Do[C.ga],!0));else if(d===f.A.Am.id)s?.Km(t,i,e,_,0,0,E,C.pl(f.A.Am.id,u.A.Yd,A,p,g,I,-1),v,512*w,m.Lm[w]),-1!==C.ga&&r.Vm(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0));else if(d===f.A.pm.id){let n=16;if(s){const r=s.Xm(t,i,e);r>0&&(n=a.A.get(r>>14&32767).gd)}s?.Km(t,i,e,_,m.km[w]*n,m.Mm[w]*n,E,C.pl(f.A.Am.id,u.A.Yd,A,p,g,I,-1),v,512*w,m.Lm[w]),-1!==C.ga&&r.Vm(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0))}else d===f.A.om.id?(s?.Km(t,i,e,_,0,0,E,C.pl(f.A.Am.id,u.A.Yd,A,p,g,I,-1),v,w,256),-1!==C.ga&&r.Vm(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0))):d===f.A.am.id?(s?.Km(t,i,e,_,0,0,E,C.pl(f.A.Am.id,u.A.Yd,A,p,g,I,-1),v,w,512),-1!==C.ga&&r.Vm(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0))):d===f.A.lm.id&&(s?.Km(t,i,e,_,0,0,E,C.pl(f.A.Am.id,u.A.Yd,A,p,g,I,-1),v,w,768),-1!==C.ga&&r.Vm(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0)))};jm;zm;Hr;Vr;Zm;qm;Jm;$m;Qm;tA;iA;eA;sA;nA;rA;hA;constructor(t,i,e,n){this.jm=t,this.zm=i,this.Hr=e,this.Vr=n,this.Zm=new y.oA(s.A.Dr,t,i),this.qm=new y.oA(s.A.Dr,t,i),this.Jm=new y.oA(s.A.Dr,t,i),this.$m=new y.oA(s.A.Dr,t,i),this.hA=new y.aA(s.A.Dr,t+1,i+1),this.Qm=new y.oA(s.A.Dr,t+1,i+1),this.tA=new y.Xr(t+1,i+1),this.iA=new Int32Array(i),this.eA=new Int32Array(i),this.sA=new Int32Array(i),this.nA=new Int32Array(i),this.rA=new Int32Array(i)}lA=(t,i)=>{for(let t=0;t=0&&i[s]?.Vy(e,n)}m.Dm+=(5*Math.random()|0)-2,m.Dm<-8?m.Dm=-8:m.Dm>8&&(m.Dm=8),m.Nm+=(5*Math.random()|0)-2,m.Nm<-16?m.Nm=-16:m.Nm>16&&(m.Nm=16);for(let i=0;i>8;for(let t=1;t>2)+(e[n+1][t]>>3)+(e[n][t-1]>>2)+(e[n][t+1]>>3)+(e[n][t]>>1);this.tA[n][t]=u-d}for(let t=0;t=0&&s0){const i=n.A.Do[e-1];this.iA[t]+=i.zu,this.eA[t]+=i.Ku,this.sA[t]+=i.Xu,this.nA[t]+=i.ju,r=this.rA[t]++}}const h=e-5;if(h>=0&&h0){const i=n.A.Do[e-1];this.iA[t]-=i.zu,this.eA[t]-=i.Ku,this.sA[t]-=i.Xu,this.nA[t]-=i.ju,r=this.rA[t]--}}}if(e>=1&&e=0&&f=0&&y=1&&c0||y>0){const A=this.Hr[i][e][c],p=this.Hr[i][e+1][c],g=this.Hr[i][e+1][c+1],I=this.Hr[i][e][c+1],_=this.tA[e][c],C=this.tA[e+1][c],E=this.tA[e+1][c+1],v=this.tA[e][c+1];let b=-1,T=-1;if(f>0){const t=256*s/a|0,i=r/l|0;let e=o/l|0;b=n.A.Pu(t,i,e);const h=t+m.Dm&255;e+=m.Nm,e<0?e=0:e>255&&(e=255),T=n.A.Pu(h,i,e)}if(i>0){let t=0!==f||this.Jm[i][e][c]===w.A.fA;y>0&&!n.A.Do[y-1].Hu&&(t=!1),t&&A===p&&A===g&&A===I&&(this.hA[i][e][c]|=2340)}let O=0;if(-1!==b&&(O=h.A.palette[n.A.Uu(T,96)]),0===y)t?.uA(i,e,c,w.A.fA,u.A.Yd,-1,A,p,g,I,n.A.Uu(b,_),n.A.Uu(b,C),n.A.Uu(b,E),n.A.Uu(b,v),d.A.Za,d.A.Za,d.A.Za,d.A.Za,O,d.A.Za);else{const s=this.Jm[i][e][c]+1,r=this.$m[i][e][c],o=n.A.Do[y-1];let a,l,f=o.texture;f>=0?(l=h.A.dA(f),a=-1):o.Gu===d.A.wA?(l=0,a=-2,f=-1):(a=n.A.Pu(o.Vu,o.Ku,o.Xu),l=h.A.palette[n.A.Wu(o.Zu,96)]),t?.uA(i,e,c,s,r,f,A,p,g,I,n.A.Uu(b,_),n.A.Uu(b,C),n.A.Uu(b,E),n.A.Uu(b,v),n.A.Wu(a,_),n.A.Wu(a,C),n.A.Wu(a,E),n.A.Wu(a,v),O,l)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let s=0;s<=n;s++)for(let r=0;r<=this.zm;r++)for(let h=0;h<=this.jm;h++){if(this.hA[s][h][r]&t){let i=r,e=r,a=s,l=s;for(;i>0&&this.hA[s][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.hA[a-1][h][s]&t))break t;a--}t:for(;l=8){const s=this.Hr[l][h][i]-240,r=this.Hr[a][h][i];o.A.pA(n,1,128*h,s,128*i,128*h,r,128*e+128);for(let s=a;s<=l;s++)for(let n=i;n<=e;n++)this.hA[s][h][n]&=~t}}if(this.hA[s][h][r]&i){let t=h,e=h,a=s,l=s;for(;t>0&&this.hA[s][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.hA[a-1][s][r]&i))break t;a--}t:for(;l=8){const s=this.Hr[l][t][r]-240,h=this.Hr[a][t][r];o.A.pA(n,2,128*t,s,128*r,128*e+128,h,128*r);for(let s=a;s<=l;s++)for(let n=t;n<=e;n++)this.hA[s][n][r]&=~i}}if(this.hA[s][h][r]&e){let t=h,i=h,a=r,l=r;for(;a>0&&this.hA[s][h][a-1]&e;)a--;for(;l0;){for(let i=a;i<=l;i++)if(!(this.hA[s][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.Hr[s][t][a];o.A.pA(n,4,128*t,r,128*a,128*i+128,r,128*l+128);for(let n=t;n<=i;n++)for(let t=a;t<=l;t++)this.hA[s][n][t]&=~e}}}}}};gA=(t,i,e,r)=>{let h=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new r.A(new Uint8Array(h));for(let r=0;r=0&&l=0&&c>24,this.$m[r][l][c]=(f-2&3)<<24>>24):f<=81?this.Vr[r][l][c]=f-49<<24>>24:this.Zm[r][l][c]=f-81<<24>>24}else for(;f=o.pu,0!==f;){if(1===f){o.pu;break}f<=49&&o.pu}}};_A=(t,i,e,n,h,o)=>{const a=new r.A(new Uint8Array(n));let l=-1;for(;;){const n=a.CA;if(0===n)return;l+=n;let r=0;for(;;){const n=a.CA;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=a.pu,w=d>>2,y=3&d,m=f+h,A=c+o;if(m>0&&A>0&&m=0&&(n=e[s]),this.Xy(u,m,A,t,i,n,l,w,y)}}}};Xy=(t,i,e,s,n,r,h,o,d)=>{if(m.et){if(16&this.Vr[t][i][e])return;if(this.cA(t,i,e)!==m.Fm)return}const w=this.Hr[t][i][e],y=this.Hr[t][i+1][e],A=this.Hr[t][i+1][e+1],p=this.Hr[t][i][e+1],g=w+y+A+p>>2,I=a.A.get(h);let _=i+(e<<7)+(h<<14)+1073741824|0;I.active||(_+=-2147483648),_|=0;const C=(d<<6)+o<<24>>24;if(o===f.A.ym.id)(!m.et||I.active||I.Md)&&(s?.Hm(I.pl(f.A.ym.id,d,w,y,A,p,-1),t,i,e,g,_,C),I.wd&&I.active&&r?.Vy(i,e),-1!==I.ga&&n.Vm(new l.A(h,t,3,i,e,c.A.Do[I.ga],!0)));else if(o===f.A.fd.id||o===f.A.gm.id){const a=I.pl(f.A.fd.id,d,w,y,A,p,-1);if(a){let n,r,h=0;if(o===f.A.gm.id&&(h+=256),d===u.A.jy||d===u.A.zy?(n=I.length,r=I.width):(n=I.width,r=I.length),s?.Xy(t,i,e,g,a,null,_,C,n,r,h)&&I.bd)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=a.EA/4|0;r>30&&(r=30),r>this.Qm[t][i+s][e+n]&&(this.Qm[t][i+s][e+n]=r<<24>>24)}}I.wd&&r?.Xy(i,e,I.width,I.length,d,I.yd),-1!==I.ga&&n.Vm(new l.A(h,t,2,i,e,c.A.Do[I.ga],!0))}else if(o>=f.A.Im.id)s?.Xy(t,i,e,g,I.pl(o,d,w,y,A,p,-1),null,_,C,1,1,0),o>=f.A.Im.id&&o<=f.A.bm.id&&o!==f.A._m.id&&t>0&&(this.hA[t][i][e]|=2340),I.wd&&r?.Xy(i,e,I.width,I.length,d,I.yd),-1!==I.ga&&n.Vm(new l.A(h,t,2,i,e,c.A.Do[I.ga],!0));else if(o===f.A.Jy.id)s?.qy(t,i,e,g,m.Lm[d],0,I.pl(f.A.Jy.id,d,w,y,A,p,-1),null,_,C),d===u.A.Yd?(I.bd&&(this.Qm[t][i][e]=50,this.Qm[t][i][e+1]=50),I.Hu&&(this.hA[t][i][e]|=585)):d===u.A.jy?(I.bd&&(this.Qm[t][i][e+1]=50,this.Qm[t][i+1][e+1]=50),I.Hu&&(this.hA[t][i][e+1]|=1170)):d===u.A.$y?(I.bd&&(this.Qm[t][i+1][e]=50,this.Qm[t][i+1][e+1]=50),I.Hu&&(this.hA[t][i+1][e]|=585)):d===u.A.zy&&(I.bd&&(this.Qm[t][i][e]=50,this.Qm[t][i+1][e]=50),I.Hu&&(this.hA[t][i][e]|=1170)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I.ga&&n.Vm(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0)),16!==I.gd&&s?.vA(t,i,e,I.gd);else if(o===f.A.Qy.id)s?.qy(t,i,e,g,m.xm[d],0,I.pl(f.A.Qy.id,d,w,y,A,p,-1),null,_,C),I.bd&&(d===u.A.Yd?this.Qm[t][i][e+1]=50:d===u.A.jy?this.Qm[t][i+1][e+1]=50:d===u.A.$y?this.Qm[t][i+1][e]=50:d===u.A.zy&&(this.Qm[t][i][e]=50)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I.ga&&n.Vm(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0));else if(o===f.A.im.id){const a=d+1&3;s?.qy(t,i,e,g,m.Lm[d],m.Lm[a],I.pl(f.A.im.id,d+4,w,y,A,p,-1),I.pl(f.A.im.id,a,w,y,A,p,-1),_,C),I.Hu&&(d===u.A.Yd?(this.hA[t][i][e]|=265,this.hA[t][i][e+1]|=1170):d===u.A.jy?(this.hA[t][i][e+1]|=1170,this.hA[t][i+1][e]|=585):d===u.A.$y?(this.hA[t][i+1][e]|=585,this.hA[t][i][e]|=1170):d===u.A.zy&&(this.hA[t][i][e]|=1170,this.hA[t][i][e]|=585)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I.ga&&n.Vm(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0)),16!==I.gd&&s?.vA(t,i,e,I.gd)}else if(o===f.A.tm.id)s?.qy(t,i,e,g,m.xm[d],0,I.pl(f.A.tm.id,d,w,y,A,p,-1),null,_,C),I.bd&&(d===u.A.Yd?this.Qm[t][i][e+1]=50:d===u.A.jy?this.Qm[t][i+1][e+1]=50:d===u.A.$y?this.Qm[t][i+1][e]=50:d===u.A.zy&&(this.Qm[t][i][e]=50)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I.ga&&n.Vm(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0));else if(o===f.A.rm.id)s?.Xy(t,i,e,g,I.pl(o,d,w,y,A,p,-1),null,_,C,1,1,0),I.wd&&r?.Xy(i,e,I.width,I.length,d,I.yd),-1!==I.ga&&n.Vm(new l.A(h,t,2,i,e,c.A.Do[I.ga],!0));else if(o===f.A.Am.id)s?.Km(t,i,e,g,0,0,_,I.pl(f.A.Am.id,u.A.Yd,w,y,A,p,-1),C,512*d,m.Lm[d]),-1!==I.ga&&n.Vm(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0));else if(o===f.A.pm.id){let r=16;if(s){const n=s.Xm(t,i,e);n>0&&(r=a.A.get(n>>14&32767).gd)}s?.Km(t,i,e,g,m.km[d]*r,m.Mm[d]*r,_,I.pl(f.A.Am.id,u.A.Yd,w,y,A,p,-1),C,512*d,m.Lm[d]),-1!==I.ga&&n.Vm(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0))}else o===f.A.om.id?(s?.Km(t,i,e,g,0,0,_,I.pl(f.A.Am.id,u.A.Yd,w,y,A,p,-1),C,d,256),-1!==I.ga&&n.Vm(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0))):o===f.A.am.id?(s?.Km(t,i,e,g,0,0,_,I.pl(f.A.Am.id,u.A.Yd,w,y,A,p,-1),C,d,512),-1!==I.ga&&n.Vm(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0))):o===f.A.lm.id&&(s?.Km(t,i,e,g,0,0,_,I.pl(f.A.Am.id,u.A.Yd,w,y,A,p,-1),C,d,768),-1!==I.ga&&n.Vm(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0)))};cA=(t,i,e)=>8&this.Vr[t][i][e]?0:t<=0||!(2&this.Vr[1][i][e])?t:t-1}},3045:(t,i,e)=>{e.d(i,{A:()=>g});var s=e(4583),n=e(1161),r=e(3795),h=e(8256),o=e(670),a=e(9222),l=e(6855),c=e(7441),f=e(6666),u=e(5748),d=e(3479),w=e(8950),y=e(2771),m=e(5518),A=e(6169),p=e(3867);class g{static bA=new p.TA(8,32,51,51,!1);static OA=new p.fe(100,null);static RA=new Int32Array(o.A.Dr);static SA=new p.LA(o.A.Dr,500,null);static xA=new p.fe(500,null);static kA=new f.A;static MA=0;static DA=0;static NA=0;static FA=0;static BA=0;static PA=0;static UA=0;static WA=0;static GA=0;static YA=0;static HA=0;static VA=0;static KA=0;static XA=0;static jA=0;static zA=0;static ZA=0;static qA=0;static JA=0;static $A=0;static QA=0;static tp=0;static ip=!1;static ep=null;static sp=Uint8Array.of(19,55,38,155,255,110,137,205,76);static np=Uint8Array.of(160,192,80,96,0,144,80,48,160);static rp=Uint8Array.of(76,8,137,4,0,1,38,2,19);static hp=Int8Array.of(0,0,2,0,0,2,1,1,0);static op=Int8Array.of(2,0,0,2,0,0,0,4,4);static ap=Int8Array.of(0,4,4,8,0,0,8,0,0);static lp=Int8Array.of(1,1,0,0,0,8,0,0,8);static cp=Int8Array.of(53,-53,-53,53);static fp=Int8Array.of(-53,-53,53,53);static up=Int8Array.of(-45,45,45,-45);static dp=Int8Array.of(45,45,-45,-45);static wp=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static yp=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static mp=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static Ap=0;static Ha=0;static Va=0;static pp=-1;static gp=-1;static et=!0;static init=(t,i,e,n,r)=>{this.DA=0,this.NA=0,this.FA=t,this.BA=i,this.PA=t/2|0,this.UA=i/2|0;const h=new p.TA(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.WA=s.A.sin[t],this.GA=s.A.cos[t],this.YA=s.A.sin[i],this.HA=s.A.cos[i];const o=(t-128)/32|0,a=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const s=128*t,l=128*i;let c=!1;for(let t=-e;t<=n;t+=128)if(this.Ip(s,l,r[o]+t)){c=!0;break}h[o][a][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let r=-1;r<=1;r++)for(let o=-1;o<=1;o++){if(h[t][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}}this.bA[t][i][e+25][s+25]=n}};static So=()=>{this.OA=null,this.RA=null,this.SA=null,this.kA=null,this.bA=null,this.xA=null,this.ep=null,console.log('World3D unloaded!')};static pA=(t,i,e,s,n,r,o,a)=>{g.SA[t][g.RA[t]++]=new h.A(e/128|0,r/128|0,n/128|0,a/128|0,i,e,r,n,a,s,o)};static Ip=(t,i,e)=>{const s=i*this.YA+t*this.HA>>16,n=i*this.HA-t*this.YA>>16,r=e*this.WA+n*this.GA>>16,h=e*this.GA-n*this.WA>>16;if(r<50||r>3500)return!1;const o=this.PA+((s<<9)/r|0),a=this.UA+((h<<9)/r|0);return o>=this.DA&&o<=this.FA&&a>=this.NA&&a<=this.BA};_p;jm;zm;Cp;Ep;_h;vp;bp;Tp;Op=0;Rp=0;Sp=0;constructor(t,i,e,s){this._p=e,this.jm=s,this.zm=i,this.Ep=new p.Eh(e,s,i,null),this.vp=new p.aA(e,s+1,i+1),this.Cp=t,this._h=new p.fe(5e3,null),this.bp=new Int32Array(1e4),this.Tp=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.Rp=t;for(let i=0;i{const e=this.Ep[0][t][i];for(let e=0;e<3;e++){this.Ep[e][t][i]=this.Ep[e+1][t][i];const s=this.Ep[e][t][i];s&&s.level--}this.Ep[0][t][i]||(this.Ep[0][t][i]=new r.A(0,t,i));const s=this.Ep[0][t][i];s&&(s.xp=e),this.Ep[3][t][i]=null};yA=(t,i,e,s)=>{const n=this.Ep[t][i][e];n&&(n.kp=s)};uA=(t,i,e,s,n,h,o,a,l,c,f,u,w,A,p,g,I,_,C,E)=>{if(s===m.A.fA){for(let s=t;s>=0;s--)this.Ep[s][i][e]||(this.Ep[s][i][e]=new r.A(s,i,e));const s=this.Ep[t][i][e];s&&(s.Mp=new d.A(f,u,w,A,-1,C,!1))}else if(s===m.A.Dp){for(let s=t;s>=0;s--)this.Ep[s][i][e]||(this.Ep[s][i][e]=new r.A(s,i,e));const s=this.Ep[t][i][e];s&&(s.Mp=new d.A(p,g,I,_,h,E,o===a&&o===l&&o===c))}else{for(let s=t;s>=0;s--)this.Ep[s][i][e]||(this.Ep[s][i][e]=new r.A(s,i,e));const d=this.Ep[t][i][e];d&&(d.Np=new y.A(i,s,g,a,w,n,f,c,E,p,h,_,C,l,I,A,o,e,u))}};Hm=(t,i,e,s,n,h,o)=>{this.Ep[i][e][s]||(this.Ep[i][e][s]=new r.A(i,e,s));const l=this.Ep[i][e][s];l&&(l.Fp=new a.A(n,128*e+64,128*s+64,t,h,o))};Bp=(t,i,e)=>{const s=this.Ep[t][i][e];s&&(s.Fp=null)};Pp=(t,i,e,s,n,h,o,a)=>{let l=0;const c=this.Ep[s][t][i];if(c)for(let t=0;tl&&(l=e)}else this.Ep[s][t][i]=new r.A(s,t,i);const f=this.Ep[s][t][i];f&&(f.Gp=new u.A(e,128*t+64,128*i+64,h,o,a,n,l))};Yp=(t,i,e)=>{const s=this.Ep[t][i][e];s&&(s.Gp=null)};qy=(t,i,e,s,n,h,o,a,c,f)=>{if(!o&&!a)return;for(let s=t;s>=0;s--)this.Ep[s][i][e]||(this.Ep[s][i][e]=new r.A(s,i,e));const u=this.Ep[t][i][e];u&&(u.Hp=new l.A(s,128*i+64,128*e+64,n,h,o,a,c,f))};sm=(t,i,e,s)=>{const n=this.Ep[t][i][e];1===s&&n&&(n.Hp=null)};Km=(t,i,e,s,n,h,o,a,l,f,u)=>{if(!a)return;for(let s=t;s>=0;s--)this.Ep[s][i][e]||(this.Ep[s][i][e]=new r.A(s,i,e));const d=this.Ep[t][i][e];d&&(d.Vp=new c.A(s,128*i+n+64,128*e+h+64,u,f,a,o,l))};Kp=(t,i,e)=>{const s=this.Ep[t][i][e];s&&(s.Vp=null)};vA=(t,i,e,s)=>{const n=this.Ep[t][i][e];if(!n)return;const r=n.Vp;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};Xp=(t,i,e,s)=>{if(!s)return;const n=this.Ep[t][i][e];if(!n)return;const r=n.Vp;r&&(r.model=s)};jp=(t,i,e,s)=>{if(!s)return;const n=this.Ep[t][i][e];if(!n)return;const r=n.Fp;r&&(r.model=s)};zp=(t,i,e,s)=>{if(!s)return;const n=this.Ep[t][i][e];if(!n)return;const r=n.Hp;r&&(r.Zp=s)};qp=(t,i,e,s,n)=>{if(!s)return;const r=this.Ep[e][t][i];if(!r)return;const h=r.Hp;h&&(h.Zp=s,h.Jp=n)};Xy=(t,i,e,s,n,r,h,o,a,l,c)=>{if(!n&&!r)return!0;const f=128*i+64*a,u=128*e+64*l;return this.$p(f,u,s,t,i,e,a,l,n,r,h,o,c,!1)};Qp=(t,i,e,s,n,r,h,o,a,l)=>{if(!n&&!r)return!0;let c=i-a,f=s-a,u=i+a,d=s+a;return l&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.$p(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};tg=(t,i,e,s,n,r,h,o,a,l,c,f)=>!a&&!l||this.$p(i,s,e,t,n,r,h+1-n,o-r+1,a,l,c,0,f,!0);Zy=(t,i,e)=>{const s=this.Ep[t][i][e];if(s)for(let t=0;t>29&3)&&n.eg===i&&n.sg===e)return void this.ng(n)}};rg=(t,i,e,s)=>{if(!s)return;const n=this.Ep[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};hg=()=>{for(let t=0;t{const s=this.Ep[t][i][e];return s&&s.Hp?s.Hp.ig:0};og=(t,i,e)=>{const s=this.Ep[t][e][i];return s&&s.Vp?s.Vp.ig:0};ag=(t,i,e)=>{const s=this.Ep[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.eg===i&&n.sg===e)return n.ig}return 0};lg=(t,i,e)=>{const s=this.Ep[t][i][e];return s&&s.Fp?s.Fp.ig:0};cg=(t,i,e,s)=>{const n=this.Ep[t][i][e];if(n){if(n.Hp&&n.Hp.ig===s)return 255&n.Hp.info;if(n.Vp&&n.Vp.ig===s)return 255&n.Vp.info;if(n.Fp&&n.Fp.ig===s)return 255&n.Fp.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.Ep[t][i+1][e-1];n&&n.Fp&&n.Fp.model&&n.Fp.model.fg&&this.dg(s,n.Fp.model,128,0,-128,!0)}};ug=(t,i,e,s,n,r)=>{let h=!0,o=i;const a=i+s,l=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this._p){for(let u=o;u<=a;u++)if(!(u<0||u>=this.jm))for(let o=l;o<=c;o++){if(o<0||o>=this.zm||h&&u=e||u===i))continue;const l=this.Ep[f][u][o];if(!l)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.Cp[f][u][o]+this.Cp[f][u+1][o]+this.Cp[f][u][o+1]+this.Cp[f][u+1][o+1])/4|0)-((this.Cp[t][i][e]+this.Cp[t][i+1][e]+this.Cp[t][i][e+1]+this.Cp[t][i+1][e+1])/4|0),m=l.Hp;m&&m.Zp&&m.Zp.fg&&this.dg(r,m.Zp,d,y,w,h),m&&m.Jp&&m.Jp.fg&&this.dg(r,m.Jp,d,y,w,h);for(let t=0;t{this.Sp++;let h=0;const o=i.Bd,a=i.Fd;if(t.fg&&t.pg)for(let r=0;ri.gg)continue;const u=t.Bd[r]-e;if(ui._g)continue;const d=t.Pd[r]-n;if(di.Eg)continue;if(i.fg&&i.pg)for(let t=0;t{const h=this.Ep[t][i][e];if(!h)return;const o=h.Mp;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const a=h.Np;if(!a)return;const l=a.shape,c=a.angle,f=a.Lg,u=a.xg,d=g.wp[l],w=g.yp[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{g.ip=!0,g.Ha=t,g.Va=i,g.pp=-1,g.gp=-1};draw=(t,i,e,n,r,h,o)=>{t<0?t=0:t>=128*this.jm&&(t=128*this.jm-1),e<0?e=0:e>=128*this.zm&&(e=128*this.zm-1),g.MA++,g.WA=s.A.sin[h],g.GA=s.A.cos[h],g.YA=s.A.sin[r],g.HA=s.A.cos[r],g.ep=g.bA[(h-128)/32|0][r/64|0],g.VA=t,g.KA=i,g.XA=e,g.jA=t/128|0,g.zA=e/128|0,g.QA=n,g.ZA=g.jA-25,g.ZA<0&&(g.ZA=0),g.JA=g.zA-25,g.JA<0&&(g.JA=0),g.qA=g.jA+25,g.qA>this.jm&&(g.qA=this.jm),g.$A=g.zA+25,g.$A>this.zm&&(g.$A=this.zm),this.kg(),g.tp=0;for(let t=this.Rp;t=2e3)?(h.visible=!0,h.update=!0,h.Mg=h.Up>0,g.tp++):(h.visible=!1,h.update=!1,h.Dg=0))}}for(let t=this.Rp;t=g.qA))for(let t=-25;t<=0;t++){const n=g.zA+t,r=g.zA-t;let h;if(e>=g.ZA&&(n>=g.JA&&(h=i[e][n],h&&h.visible&&this.Ng(h,!0,o)),r=g.JA&&(h=i[s][n],h&&h.visible&&this.Ng(h,!0,o)),r=g.qA))for(let t=-25;t<=0;t++){const n=g.zA+t,r=g.zA-t;let h;if(e>=g.ZA&&(n>=g.JA&&(h=i[e][n],h&&h.visible&&this.Ng(h,!1,o)),r=g.JA&&(h=i[s][n],h&&h.visible&&this.Ng(h,!1,o)),r{if(!c&&!f)return!1;for(let t=h;t=this.jm||i>=this.zm)return!1;const e=this.Ep[s][t][i];if(e&&e.Up>=5)return!1}const m=new n.A(s,e,t,i,c,f,w,h,h+a-1,o,o+l-1,u,d);for(let t=h;th&&(e|=1),to&&(e+=8),i=0;e--)this.Ep[e][t][i]||(this.Ep[e][t][i]=new r.A(e,t,i));const n=this.Ep[s][t][i];n&&(n.Wp[n.Up]=m,n.Fg[n.Up]=e,n.Bg|=e,n.Up++)}return y&&(this._h[this.Op++]=m),!0};ng=t=>{for(let i=t.eg;i<=t.yg;i++)for(let e=t.sg;e<=t.mg;e++){const s=this.Ep[t.level][i][e];if(s){for(let i=0;i{const t=g.RA[g.QA],i=g.SA[g.QA];g.Ap=0;for(let e=0;e=0&&s<=50){n=t.Ug+25-g.zA,n<0&&(n=0),r=t.zm+25-g.zA,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.ep&&g.ep[s][n++]){i=!0;break}if(i){if(h=g.VA-t.Ig,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.Wg=(t.Cg-g.XA<<8)/h|0,t.Gg=(t.Eg-g.XA<<8)/h|0,t.Yg=(t.gg-g.KA<<8)/h|0,t.Hg=(t.jd-g.KA<<8)/h|0,g.xA[g.Ap++]=t}}}else if(2===t.type){if(s=t.Ug+25-g.zA,s>=0&&s<=50){n=t.Pg+25-g.jA,n<0&&(n=0),r=t.jm+25-g.jA,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.ep&&g.ep[n++][s]){i=!0;break}if(i){if(h=g.XA-t.Cg,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.Vg=(t.Ig-g.VA<<8)/h|0,t.Kg=(t._g-g.VA<<8)/h|0,t.Yg=(t.gg-g.KA<<8)/h|0,t.Hg=(t.jd-g.KA<<8)/h|0,g.xA[g.Ap++]=t}}}else if(4===t.type&&(s=t.gg-g.KA,s>128&&(n=t.Ug+25-g.zA,n<0&&(n=0),r=t.zm+25-g.zA,r>50&&(r=50),n<=r))){let i=t.Pg+25-g.jA;i<0&&(i=0),h=t.jm+25-g.jA,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(g.ep&&g.ep[t][i]){e=!0;break t}e&&(t.mode=5,t.Vg=(t.Ig-g.VA<<8)/s|0,t.Kg=(t._g-g.VA<<8)/s|0,t.Wg=(t.Cg-g.XA<<8)/s|0,t.Gg=(t.Eg-g.XA<<8)/s|0,g.xA[g.Ap++]=t)}}};Ng=(t,i,e)=>{for(g.kA.Vm(t);;){let t;do{if(t=g.kA.Xg(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.jg,o=this.Ep[r];if(t.visible){if(i){if(r>0){const t=this.Ep[r-1][s][n];if(t&&t.update)continue}if(s<=g.jA&&s>g.ZA){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.Bg)))continue}if(s>=g.jA&&sg.JA){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.Bg)))continue}if(n>=g.zA&&nn&&(l+=6),c=g.sp[l],t.Qg=g.rp[l]),f&&(f.tI&g.np[l]?16===f.tI?(t.Dg=3,t.iI=g.hp[l],t.eI=3-t.iI):32===f.tI?(t.Dg=6,t.iI=g.op[l],t.eI=6-t.iI):64===f.tI?(t.Dg=12,t.iI=g.ap[l],t.eI=12-t.iI):(t.Dg=9,t.iI=g.lp[l],t.eI=9-t.iI):t.Dg=0,f.tI&c&&!this.sI(h,s,n,f.tI)&&f.Zp?.draw(0,g.WA,g.GA,g.YA,g.HA,f.x-g.VA,f.y-g.KA,f.z-g.XA,f.ig),f.nI&c&&!this.sI(h,s,n,f.nI)&&f.Jp?.draw(0,g.WA,g.GA,g.YA,g.HA,f.x-g.VA,f.y-g.KA,f.z-g.XA,f.ig)),u&&!this.visible(h,s,n,u.model.jd))if(u.type&c)u.model.draw(u.angle,g.WA,g.GA,g.YA,g.HA,u.x-g.VA,u.y-g.KA,u.z-g.XA,u.ig);else if(768&u.type){const t=u.x-g.VA,i=u.y-g.KA,e=u.z-g.XA,s=u.angle;let n,r;if(n=s===A.A.jy||s===A.A.$y?-t:t,r=s===A.A.$y||s===A.A.zy?-e:e,256&u.type&&rn){const n=t+g.up[s],r=e+g.dp[s];u.model.draw(512*s+1280&2047,g.WA,g.GA,g.YA,g.HA,n,i,r,u.ig)}}if(a){const i=t.Fp;i&&i.model?.draw(0,g.WA,g.GA,g.YA,g.HA,i.x-g.VA,i.y-g.KA,i.z-g.XA,i.ig);const e=t.Gp;e&&0===e.offset&&(e.rI&&e.rI.draw(0,g.WA,g.GA,g.YA,g.HA,e.x-g.VA,e.y-g.KA,e.z-g.XA,e.ig),e.hI&&e.hI.draw(0,g.WA,g.GA,g.YA,g.HA,e.x-g.VA,e.y-g.KA,e.z-g.XA,e.ig),e.oI&&e.oI.draw(0,g.WA,g.GA,g.YA,g.HA,e.x-g.VA,e.y-g.KA,e.z-g.XA,e.ig))}const d=t.Bg;if(0!==d){if(sg.jA&&1&d){const t=o[s-1][n];t&&t.update&&g.kA.Vm(t)}if(n>g.zA&&8&d){const t=o[s][n-1];t&&t.update&&g.kA.Vm(t)}}}if(0!==t.Dg){let i=!0;for(let e=0;ei.eg&&(r+=1),ei.sg&&(r+=8),ss&&(s=n);const h=g.zA-i.sg,a=i.mg-g.zA;i.aI=a>h?s+a:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.aI,i=e))}if(-1===i)break;const a=g.OA[i];if(a){a.MA=g.MA;let t=a.model;t||(t=a.Jg?.draw(e)??null),t&&!this.lI(h,a.eg,a.yg,a.sg,a.mg,t.jd)&&t.draw(a.$g,g.WA,g.GA,g.YA,g.HA,a.x-g.VA,a.y-g.KA,a.z-g.XA,a.ig);for(let t=a.eg;t<=a.yg;t++)for(let i=a.sg;i<=a.mg;i++){const e=o[t][i];e&&(0!==e.Dg?g.kA.Vm(e):t===s&&i===n||!e.update||g.kA.Vm(e))}}}if(t.Mg)continue}if(!t.update||0!==t.Dg)continue;if(s<=g.jA&&s>g.ZA){const t=o[s-1][n];if(t&&t.update)continue}if(s>=g.jA&&sg.JA){const t=o[s][n-1];if(t&&t.update)continue}if(n>=g.zA&&n=r){const r=t+g.cp[n],h=s+g.fp[n];i.model.draw(512*n+256,g.WA,g.GA,g.YA,g.HA,r,e,h,i.ig)}if(512&i.type&&h<=r){const r=t+g.up[n],h=s+g.dp[n];i.model.draw(512*n+1280&2047,g.WA,g.GA,g.YA,g.HA,r,e,h,i.ig)}}const e=t.Hp;e&&(e.nI&t.Qg&&!this.sI(h,s,n,e.nI)&&e.Jp?.draw(0,g.WA,g.GA,g.YA,g.HA,e.x-g.VA,e.y-g.KA,e.z-g.XA,e.ig),e.tI&t.Qg&&!this.sI(h,s,n,e.tI)&&e.Zp?.draw(0,g.WA,g.GA,g.YA,g.HA,e.x-g.VA,e.y-g.KA,e.z-g.XA,e.ig))}if(rg.jA){const t=o[s-1][n];t&&t.update&&g.kA.Vm(t)}if(n>g.zA){const t=o[s][n-1];t&&t.update&&g.kA.Vm(t)}}};Zg=(t,i,e,n,r,h,o,a)=>{let l,c,f,u,d=l=(e<<7)-g.VA,y=c=(n<<7)-g.XA,m=f=d+128,A=u=y+128,p=this.Cp[i][e][n]-g.KA,I=this.Cp[i][e+1][n]-g.KA,_=this.Cp[i][e+1][n+1]-g.KA,C=this.Cp[i][e][n+1]-g.KA,E=y*o+d*a>>16;if(y=y*a-d*o>>16,d=E,E=p*h-y*r>>16,y=p*r+y*h>>16,p=E,y<50)return;if(E=c*o+m*a>>16,c=c*a-m*o>>16,m=E,E=I*h-c*r>>16,c=I*r+c*h>>16,I=E,c<50)return;if(E=A*o+f*a>>16,A=A*a-f*o>>16,f=E,E=_*h-A*r>>16,A=_*r+A*h>>16,_=E,A<50)return;if(E=u*o+l*a>>16,u=u*a-l*o>>16,l=E,E=C*h-u*r>>16,u=C*r+u*h>>16,C=E,u<50)return;const v=s.A.yl+((d<<9)/y|0),b=s.A.ml+((p<<9)/y|0),T=s.A.yl+((m<<9)/c|0),O=s.A.ml+((I<<9)/c|0),R=s.A.yl+((f<<9)/A|0),S=s.A.ml+((_<<9)/A|0),L=s.A.yl+((l<<9)/u|0),x=s.A.ml+((C<<9)/u|0);if(s.A.alpha=0,(R-L)*(O-x)-(S-x)*(T-L)>0)if(s.A.cI=R<0||L<0||T<0||R>w.A.fI||L>w.A.fI||T>w.A.fI,g.ip&&this.uI(g.Ha,g.Va,S,x,O,R,L,T)&&(g.pp=e,g.gp=n),-1===t.dI)12345678!==t.wI&&s.A.yI(R,L,T,S,x,O,t.wI,t.mI,t.AI);else if(g.et){const i=g.mp[t.dI];s.A.yI(R,L,T,S,x,O,this.pI(i,t.wI),this.pI(i,t.mI),this.pI(i,t.AI))}else t.flat?s.A.gI(R,L,T,S,x,O,t.wI,t.mI,t.AI,d,p,y,m,l,I,C,c,u,t.dI):s.A.gI(R,L,T,S,x,O,t.wI,t.mI,t.AI,f,_,A,l,m,C,I,u,c,t.dI);if(!((v-T)*(x-O)-(b-O)*(L-T)<=0))if(s.A.cI=v<0||T<0||L<0||v>w.A.fI||T>w.A.fI||L>w.A.fI,g.ip&&this.uI(g.Ha,g.Va,b,O,x,v,T,L)&&(g.pp=e,g.gp=n),-1!==t.dI){if(!g.et)return void s.A.gI(v,T,L,b,O,x,t.II,t.AI,t.mI,d,p,y,m,l,I,C,c,u,t.dI);const i=g.mp[t.dI];s.A.yI(v,T,L,b,O,x,this.pI(i,t.II),this.pI(i,t.AI),this.pI(i,t.mI))}else 12345678!==t.II&&s.A.yI(v,T,L,b,O,x,t.II,t.AI,t.mI)};qg=(t,i,e,n,r,h,o)=>{let a=e.Bd.length;for(let t=0;t>16;if(l=l*o-i*h>>16,i=c,c=a*r-l*n>>16,l=a*n+l*r>>16,a=c,l<50)return;e._I&&(y.A.CI[t]=i,y.A.EI[t]=a,y.A.vI[t]=l),y.A.bI[t]=s.A.yl+((i<<9)/l|0),y.A.TI[t]=s.A.ml+((a<<9)/l|0)}s.A.alpha=0,a=e.OI.length;for(let n=0;n0)if(s.A.cI=a<0||l<0||c<0||a>w.A.fI||l>w.A.fI||c>w.A.fI,g.ip&&this.uI(g.Ha,g.Va,f,u,d,a,l,c)&&(g.pp=t,g.gp=i),e._I&&-1!==e._I[n])if(g.et){const t=g.mp[e._I[n]];s.A.yI(a,l,c,f,u,d,this.pI(t,e.LI[n]),this.pI(t,e.xI[n]),this.pI(t,e.kI[n]))}else e.flat?s.A.gI(a,l,c,f,u,d,e.LI[n],e.xI[n],e.kI[n],y.A.CI[0],y.A.EI[0],y.A.vI[0],y.A.CI[1],y.A.CI[3],y.A.EI[1],y.A.EI[3],y.A.vI[1],y.A.vI[3],e._I[n]):s.A.gI(a,l,c,f,u,d,e.LI[n],e.xI[n],e.kI[n],y.A.CI[r],y.A.EI[r],y.A.vI[r],y.A.CI[h],y.A.CI[o],y.A.EI[h],y.A.EI[o],y.A.vI[h],y.A.vI[o],e._I[n]);else 12345678!==e.LI[n]&&s.A.yI(a,l,c,f,u,d,e.LI[n],e.xI[n],e.kI[n])}};zg=(t,i,e)=>{const s=this.vp[t][i][e];if(s===-g.MA)return!1;if(s===g.MA)return!0;{const s=i<<7,n=e<<7;return this.MI(s+1,this.Cp[t][i][e],n+1)&&this.MI(s+128-1,this.Cp[t][i+1][e],n+1)&&this.MI(s+128-1,this.Cp[t][i+1][e+1],n+128-1)&&this.MI(s+1,this.Cp[t][i][e+1],n+128-1)?(this.vp[t][i][e]=g.MA,!0):(this.vp[t][i][e]=-g.MA,!1)}};sI=(t,i,e,s)=>{if(!this.zg(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.Cp[t][i][e]-1,o=h-120,a=h-230,l=h-238;if(s<16){if(1===s){if(n>g.VA){if(!this.MI(n,h,r))return!1;if(!this.MI(n,h,r+128))return!1}if(t>0){if(!this.MI(n,o,r))return!1;if(!this.MI(n,o,r+128))return!1}return!!this.MI(n,a,r)&&this.MI(n,a,r+128)}if(2===s){if(r0){if(!this.MI(n,o,r+128))return!1;if(!this.MI(n+128,o,r+128))return!1}return!!this.MI(n,a,r+128)&&this.MI(n+128,a,r+128)}if(4===s){if(n0){if(!this.MI(n+128,o,r))return!1;if(!this.MI(n+128,o,r+128))return!1}return!!this.MI(n+128,a,r)&&this.MI(n+128,a,r+128)}if(8===s){if(r>g.XA){if(!this.MI(n,h,r))return!1;if(!this.MI(n+128,h,r))return!1}if(t>0){if(!this.MI(n,o,r))return!1;if(!this.MI(n+128,o,r))return!1}return!!this.MI(n,a,r)&&this.MI(n+128,a,r)}}return!!this.MI(n+64,l,r+64)&&(16===s?this.MI(n,a,r+128):32===s?this.MI(n+128,a,r+128):64===s?this.MI(n+128,a,r):128===s?this.MI(n,a,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.zg(t,i,e)){const n=i<<7,r=e<<7;return this.MI(n+1,this.Cp[t][i][e]-s,r+1)&&this.MI(n+128-1,this.Cp[t][i+1][e]-s,r+1)&&this.MI(n+128-1,this.Cp[t][i+1][e+1]-s,r+128-1)&&this.MI(n+1,this.Cp[t][i][e+1]-s,r+128-1)}return!1};lI=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.vp[t][h][o]===-g.MA)return!1;o=1+(i<<7);const a=2+(s<<7),l=this.Cp[t][i][s]-r;if(!this.MI(o,l,a))return!1;const c=(e<<7)-1;if(!this.MI(c,l,a))return!1;const f=(n<<7)-1;return!!this.MI(o,l,f)&&this.MI(c,l,f)}return!!this.zg(t,i,s)&&(h=i<<7,o=s<<7,this.MI(h+1,this.Cp[t][i][s]-r,o+1)&&this.MI(h+128-1,this.Cp[t][i+1][s]-r,o+1)&&this.MI(h+128-1,this.Cp[t][i+1][s+1]-r,o+128-1)&&this.MI(h+1,this.Cp[t][i][s+1]-r,o+128-1))};MI=(t,i,e)=>{for(let s=0;s0){const t=n.Cg+(n.Wg*s>>8),r=n.Eg+(n.Gg*s>>8),h=n.gg+(n.Yg*s>>8),o=n.jd+(n.Hg*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.Ig;if(s>0){const t=n.Cg+(n.Wg*s>>8),r=n.Eg+(n.Gg*s>>8),h=n.gg+(n.Yg*s>>8),o=n.jd+(n.Hg*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.Cg-e;if(s>0){const e=n.Ig+(n.Vg*s>>8),r=n._g+(n.Kg*s>>8),h=n.gg+(n.Yg*s>>8),o=n.jd+(n.Hg*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.Cg;if(s>0){const e=n.Ig+(n.Vg*s>>8),r=n._g+(n.Kg*s>>8),h=n.gg+(n.Yg*s>>8),o=n.jd+(n.Hg*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.gg;if(s>0){const i=n.Ig+(n.Vg*s>>8),r=n._g+(n.Kg*s>>8),h=n.Cg+(n.Wg*s>>8),o=n.Eg+(n.Gg*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};uI=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const a=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*a>0&&a*((i-n)*(r-o)-(t-o)*(e-n))>0};pI=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{}},4197:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{DI;NI;FI;BI;index;Qw;Ca;_a;constructor(t,i,e,s,n,r,h){super(),this.DI=i,this.NI=e,this.FI=s,this.BI=n,this.index=t,this.Qw=r,h&&-1!==r.va&&this.Qw.delay?(this.Ca=Math.random()*this.Qw.Ea|0,this._a=Math.random()*this.Qw.delay[this.Ca]|0):(this.Ca=-1,this._a=0)}}},9418:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(7121),n=e(1312),r=e(3867);class h extends s.A{x=0;z=0;$g=0;UI=!1;size=1;Wl=-1;WI=-1;GI=-1;YI=-1;HI=-1;VI=-1;KI=-1;XI=null;jI=100;zI=0;ZI=0;qI=0;JI=0;$I=-1e3;QI=0;t_=0;i_=-1;e_=0;s_=0;n_=-1;r_=0;h_=0;o_=-1;a_=0;l_=0;c_=0;f_=0;u_=-1;d_=0;w_=0;y_=0;m_=0;A_=0;p_=0;g_=0;I_=0;__=0;C_=0;E_=0;MA=0;height=0;v_=0;pathLength=0;b_=new Int32Array(10);T_=new Int32Array(10);O_=new r.fe(10,!1);R_=0;S_=-1;L_=-1;x_=-1;k_=-1;move(t,i,e){if(-1!==this.o_&&n.A.Do[this.o_].priority<=1&&(this.o_=-1),!t){const t=i-this.b_[0],s=e-this.T_[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.b_[t]=this.b_[t-1],this.T_[t]=this.T_[t-1],this.O_[t]=this.O_[t-1];return this.b_[0]=i,this.T_[0]=e,void(this.O_[0]=!1)}}this.pathLength=0,this.R_=0,this.b_[0]=i,this.T_[0]=e,this.x=128*this.b_[0]+64*this.size,this.z=128*this.T_[0]+64*this.size}step(t,i){let e=this.b_[0],s=this.T_[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.o_&&n.A.Do[this.o_].priority<=1&&(this.o_=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.b_[t]=this.b_[t-1],this.T_[t]=this.T_[t-1],this.O_[t]=this.O_[t-1];this.b_[0]=e,this.T_[0]=s,this.O_[0]=t}}},8268:(t,i,e)=>{e.d(i,{A:()=>d});var s=e(9418),n=e(8665),r=e(2679),h=e(8738),o=e(1312),a=e(8317),l=e(1302),c=e(3819),f=e(3867),u=e(9298);class d extends s.A{static M_=1;static D_=2;static N_=4;static F_=8;static B_=16;static P_=32;static U_=64;static W_=128;static G_=256;static Y_=512;static Ul=[u.A.H_,u.A.V_,u.A.K_,u.A.X_,u.A.j_,u.A.z_,u.A.Z_,u.A.q_,u.A.J_,u.A.Q_,u.A.tC,u.A.iC,u.A.eC,u.A.sC,u.A.nC,u.A.rC];static Pl=[[u.A.hC,u.A.oC,u.A.aC,u.A.lC,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.mC,u.A.AC],[u.A.pC,u.A.gC,u.A.IC,u.A._C,u.A.CC,u.A.EC,u.A.vC,u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.SC,u.A.LC,u.A.xC,u.A.kC,u.A.MC],[u.A.MC-1,u.A.pC+1,u.A.gC,u.A.IC,u.A._C,u.A.CC,u.A.EC,u.A.vC,u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.SC,u.A.LC,u.A.xC,u.A.kC],[u.A.DC,u.A.NC,u.A.FC,u.A.BC,u.A.PC,u.A.UC],[u.A.WC,u.A.GC,u.A.YC,u.A.HC,u.A.VC,u.A.KC,u.A.XC,u.A.jC]];static No=new r.A(200);name=null;visible=!1;zC=0;ZC=0;qC=new Uint16Array(12);JC=new Uint16Array(5);ic=0;$C=0n;y=0;QC=0;tE=0;iE=0;eE=0;sE=0;nE=null;Pg=0;Ug=0;jm=0;zm=0;et=!1;draw(t){if(!this.visible)return null;let i=this.sw();if(this.height=i.jd,i.ow=!0,this.et)return i;if(-1!==this.u_&&-1!==this.d_){const t=h.A.Do[this.u_],e=n.A.Mu(t.pl(),!0,!t.pd,!1);e.translate(-this.m_,0,0),e.Gl(),t.Qw&&t.Qw.frames&&e.Yl(t.Qw.frames[this.d_]),e.Hd=null,e.Vd=null,128===t.iw&&128===t.ew||e.scale(t.iw,t.ew,t.iw),e.Hl(t.Id+64,t._d+850,-30,-50,-30,!0);const s=[i,e];i=n.A.rE(s,2)}if(this.nE&&(t>=this.tE&&(this.nE=null),t>=this.QC&&t=d.Pl[i].length)&&(e=0),this.JC[i]=e}this.Wl=t.mu,65535===this.Wl&&(this.Wl=-1),this.WI=t.mu,65535===this.WI&&(this.WI=-1),this.GI=t.mu,65535===this.GI&&(this.GI=-1),this.YI=t.mu,65535===this.YI&&(this.YI=-1),this.HI=t.mu,65535===this.HI&&(this.HI=-1),this.VI=t.mu,65535===this.VI&&(this.VI=-1),this.KI=t.mu,65535===this.KI&&(this.KI=-1),this.name=c.A.kl(c.A.Ml(t.hE)),this.ic=t.pu,this.visible=!0,this.$C=0n;for(let t=0;t<12;t++)this.$C<<=0x4n,this.qC[t]>=256&&(this.$C+=BigInt(this.qC[t])-256n);this.qC[0]>=256&&(this.$C+=BigInt(this.qC[0])-256n>>4n),this.qC[1]>=256&&(this.$C+=BigInt(this.qC[1])-256n>>8n);for(let t=0;t<5;t++)this.$C<<=0x3n,this.$C+=BigInt(this.JC[t]);this.$C<<=0x1n,this.$C+=BigInt(this.zC)}ed(){if(!this.visible)return null;const t=new f.fe(12,null);let i=0;for(let e=0;e<12;e++){const s=this.qC[e];if(s>=256&&s<512&&(t[i++]=a.A.Do[s-256].ed()),s>=512){const e=l.A.get(s-512).ed(this.zC);e&&(t[i++]=e)}}const e=n.A.Fl(t,i);for(let t=0;t<5;t++)0!==this.JC[t]&&(e.Bl(d.Pl[t][0],d.Pl[t][this.JC[t]]),1===t&&e.Bl(d.Ul[0],d.Ul[this.JC[t]]));return e}sw(){let t=this.$C,i=-1,e=-1,s=-1,r=-1;if(this.o_>=0&&0===this.c_){const n=o.A.Do[this.o_];if(n.frames&&(i=n.frames[this.a_]),this.n_>=0&&this.n_!==this.Wl){const t=o.A.Do[this.n_].frames;t&&(e=t[this.r_])}n.qw>=0&&(s=n.qw,t+=BigInt(s-this.qC[5])<<8n),n.Jw>=0&&(r=n.Jw,t+=BigInt(r-this.qC[3])<<16n)}else if(this.n_>=0){const t=o.A.Do[this.n_].frames;t&&(i=t[this.r_])}let h=d.No?.get(t);if(!h){const i=new f.fe(12,null);let e=0;for(let t=0;t<12;t++){let n=this.qC[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=a.A.Do[n-256].pl();t&&(i[e++]=t)}if(n>=512){const t=l.A.get(n-512).jw(this.zC);t&&(i[e++]=t)}}h=n.A.Fl(i,e);for(let t=0;t<5;t++)0!==this.JC[t]&&(h.Bl(d.Pl[t][0],d.Pl[t][this.JC[t]]),1===t&&h.Bl(d.Ul[0],d.Ul[this.JC[t]]));h.Gl(),h.Hl(64,850,-30,-50,-30,!0),d.No?.put(t,h)}if(this.et)return h;const c=n.A.nw(h,!0);return-1!==i&&-1!==e?c.rw(i,e,o.A.Do[this.o_].zw):-1!==i&&c.Yl(i),c.hw(),c.Hd=null,c.Vd=null,c}}},9222:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;model;ig;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.ig=n,this.info=r}}},1161:(t,i,e)=>{e.d(i,{A:()=>s});class s{level;y;x;z;model;Jg;$g;eg;yg;sg;mg;ig;info;aI=0;MA=0;constructor(t,i,e,s,n,r,h,o,a,l,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.Jg=r,this.$g=h,this.eg=o,this.yg=a,this.sg=l,this.mg=c,this.ig=f,this.info=u}}},5748:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;oI;hI;rI;ig;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.oI=s,this.hI=n,this.rI=r,this.ig=h,this.offset=o}}},8256:(t,i,e)=>{e.d(i,{A:()=>s});class s{Pg;jm;Ug;zm;type;Ig;_g;Cg;Eg;gg;jd;mode=0;Vg=0;Kg=0;Wg=0;Gg=0;Yg=0;Hg=0;constructor(t,i,e,s,n,r,h,o,a,l,c){this.Pg=t,this.jm=i,this.Ug=e,this.zm=s,this.type=n,this.Ig=r,this._g=h,this.Cg=o,this.Eg=a,this.gg=l,this.jd=c}}},3795:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1982),n=e(3867);class r extends s.A{level;x;z;jg;Wp;Fg;Mp=null;Np=null;Hp=null;Vp=null;Fp=null;Gp=null;xp=null;Up=0;Bg=0;kp=0;visible=!1;update=!1;Mg=!1;Dg=0;iI=0;eI=0;Qg=0;constructor(t,i,e){super(),this.jg=this.level=t,this.x=i,this.z=e,this.Wp=new n.fe(5,null),this.Fg=new Int32Array(5)}}},2771:(t,i,e)=>{e.d(i,{A:()=>s});class s{static bI=new Int32Array(6);static TI=new Int32Array(6);static CI=new Int32Array(6);static EI=new Int32Array(6);static vI=new Int32Array(6);static oE=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static aE=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static lE=128;static cE=this.lE/2|0;static fE=this.lE/4|0;static uE=3*this.lE/4|0;Bd;Ud;Pd;LI;xI;kI;OI;RI;SI;_I;flat;shape;angle;Lg;xg;constructor(t,i,e,n,r,h,o,a,l,c,f,u,d,w,y,m,A,p,g){this.flat=!(A!==n||A!==w||A!==a),this.shape=i,this.angle=h,this.Lg=d,this.xg=l;const I=s.oE[i],_=I.length;this.Bd=new Int32Array(_),this.Ud=new Int32Array(_),this.Pd=new Int32Array(_);const C=new Int32Array(_),E=new Int32Array(_),v=t*s.lE,b=p*s.lE;for(let t=0;t<_;t++){let i,l,f,d,p,_=I[t];!(1&_)&&_<=8&&(_=1+(_-h-h-1&7)),_>8&&_<=12&&(_=9+(_-h-9&3)),_>12&&_<=16&&(_=13+(_-h-13&3)),1===_?(i=v,l=b,f=A,d=o,p=c):2===_?(i=v+s.cE,l=b,f=A+n>>1,d=o+g>>1,p=c+e>>1):3===_?(i=v+s.lE,l=b,f=n,d=g,p=e):4===_?(i=v+s.lE,l=b+s.cE,f=n+w>>1,d=g+r>>1,p=e+y>>1):5===_?(i=v+s.lE,l=b+s.lE,f=w,d=r,p=y):6===_?(i=v+s.cE,l=b+s.lE,f=w+a>>1,d=r+m>>1,p=y+u>>1):7===_?(i=v,l=b+s.lE,f=a,d=m,p=u):8===_?(i=v,l=b+s.cE,f=a+A>>1,d=m+o>>1,p=u+c>>1):9===_?(i=v+s.cE,l=b+s.fE,f=A+n>>1,d=o+g>>1,p=c+e>>1):10===_?(i=v+s.uE,l=b+s.cE,f=n+w>>1,d=g+r>>1,p=e+y>>1):11===_?(i=v+s.cE,l=b+s.uE,f=w+a>>1,d=r+m>>1,p=y+u>>1):12===_?(i=v+s.fE,l=b+s.cE,f=a+A>>1,d=m+o>>1,p=u+c>>1):13===_?(i=v+s.fE,l=b+s.fE,f=A,d=o,p=c):14===_?(i=v+s.uE,l=b+s.fE,f=n,d=g,p=e):15===_?(i=v+s.uE,l=b+s.uE,f=w,d=r,p=y):(i=v+s.fE,l=b+s.uE,f=a,d=m,p=u),this.Bd[t]=i,this.Ud[t]=f,this.Pd[t]=l,C[t]=d,E[t]=p}const T=s.aE[i],O=T.length/4|0;this.OI=new Int32Array(O),this.RI=new Int32Array(O),this.SI=new Int32Array(O),this.LI=new Int32Array(O),this.xI=new Int32Array(O),this.kI=new Int32Array(O),this._I=-1!==f?new Int32Array(O):null;let R=0;for(let t=0;t{e.d(i,{A:()=>s});class s{static fA=0;static Dp=1;static dE=2;static wE=3;static yE=4;static mE=5;static cE=6;static fE=7;static uE=8;static AE=9;static pE=10;static gE=11}},3479:(t,i,e)=>{e.d(i,{A:()=>s});class s{II;AI;wI;mI;dI;color;flat;constructor(t,i,e,s,n,r,h){this.II=t,this.AI=i,this.wI=e,this.mI=s,this.dI=n,this.color=r,this.flat=h}}},6855:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;tI;nI;Zp;Jp;ig;info;constructor(t,i,e,s,n,r,h,o,a){this.y=t,this.x=i,this.z=e,this.tI=s,this.nI=n,this.Zp=r,this.Jp=h,this.ig=o,this.info=a}}},7441:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;type;angle;model;ig;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.ig=h,this.info=o}}},7536:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{IE;_E;constructor(t){this._E=[],this.IE=t;for(let i=0;i{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{EE;vE;constructor(){super(),this.EE=this,this.vE=this}bE(){this.vE&&this.EE&&(this.vE.EE=this.EE,this.EE.vE=this.vE,this.EE=null,this.vE=null)}}},3819:(t,i,e)=>{e.d(i,{A:()=>s});class s{static TE=['_','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','0','1','2','3','4','5','6','7','8','9'];static OE=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static Ml=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.TE[Number(s-37n*t)]}return e.slice(12-i).join('')};static RE=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static SE=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static kl=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static Lu=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}},6666:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{LE;cursor=null;constructor(){const t=new s.A;t.next=t,t.CE=t,this.LE=t}Vm(t){t.CE&&t.ww(),t.CE=this.LE.CE,t.next=this.LE,t.CE&&(t.CE.next=t),t.next.CE=t}xE(t){t.CE&&t.ww(),t.CE=this.LE,t.next=this.LE.next,t.CE.next=t,t.next&&(t.next.CE=t)}Xg(){const t=this.LE.next;return t===this.LE?null:(t?.ww(),t)}head(){const t=this.LE.next;return t===this.LE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}kE(){const t=this.LE.CE;return t===this.LE?(this.cursor=null,null):(this.cursor=t?.CE||null,t)}next(){const t=this.cursor;return t===this.LE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}CE(){const t=this.cursor;return t===this.LE?(this.cursor=null,null):(this.cursor=t?.CE||null,t)}clear(){for(;;){const t=this.LE.next;if(t===this.LE)return;t?.ww()}}}},1982:(t,i,e)=>{e.d(i,{A:()=>s});class s{key;next;CE;constructor(){this.key=0n,this.next=this,this.CE=this}ww(){this.CE&&this.next&&(this.CE.next=this.next,this.next.CE=this.CE,this.next=null,this.CE=null)}}},2679:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(2512),n=e(7536);class r{ME;DE;history;available;constructor(t){this.ME=t,this.available=t,this.DE=new n.A(1024),this.history=new s.A}get(t){const i=this.DE.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.ww(),t?.bE()}else this.available--;this.DE.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.ww(),t.bE()):this.available=this.ME}}},2512:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n{head;constructor(){this.head=new s.A}push(t){t.vE&&t.bE(),t.vE=this.head.vE,t.EE=this.head,t.vE&&(t.vE.EE=t),t.EE.vE=t}pop(){const t=this.head.EE;return t===this.head?null:(t?.bE(),t)}}},8534:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(3867);class r{static Do=[];static yu=t=>{const i=new s.A(t.read('base_head.dat')),e=new s.A(t.read('base_type.dat')),h=new s.A(t.read('base_label.dat')),o=i.mu;i.pf+=2;for(let t=0;t{e.d(i,{A:()=>r});var s=e(8534),n=e(1069);class r{static Do=[];static yu=t=>{const i=new n.A(t.read('frame_head.dat')),e=new n.A(t.read('frame_tran1.dat')),h=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),a=i.mu;i.pf+=2;const l=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){l[m]=i,c[m]=0,f[m]=0,u[m]=0,m++;break}l[m]=t;let e=0;3===d.types[l[m]]&&(e=128),c[m]=1&i?h.FE:e,f[m]=2&i?h.FE:e,u[m]=4&i?h.FE:e,y=t,m++}}n.length=m,n.BE=new Int32Array(m),n.x=new Int32Array(m),n.y=new Int32Array(m),n.z=new Int32Array(m);for(let t=0;t{e.d(i,{Nc:()=>s,na:()=>n,PE:()=>o,UE:()=>h,WE:()=>r});const s=document.getElementById('canvas'),n=s.getContext('2d',{willReadFrequently:!0}),r=document.createElement('canvas'),h=document.createElement('img'),o=r.getContext('2d',{willReadFrequently:!0})},9298:(t,i,e)=>{e.d(i,{A:()=>s});class s{static RED=16711680;static GREEN=65280;static BLUE=255;static qa=16776960;static GE=65535;static wA=16711935;static La=16777215;static Za=0;static YE=16748608;static HE=8388608;static VE=128;static KE=16756736;static XE=16740352;static jE=16723968;static zE=12648192;static ZE=8453888;static qE=4259584;static JE=9179409;static $E=6116423;static fa=2301979;static ua=5063219;static wa=7759444;static ma=3353893;static QE=8388736;static tv=13350793;static iv=Int32Array.of(s.qa,s.RED,s.GREEN,s.GE,s.wA,s.La);static hC=6798;static oC=107;static aC=10283;static lC=16;static cC=4797;static fC=7744;static uC=5799;static dC=4634;static wC=33697;static yC=22433;static mC=2983;static AC=54193;static pC=8741;static gC=12;static IC=64030;static _C=43162;static CC=7735;static EC=8404;static vC=1701;static bC=38430;static TC=24094;static OC=10153;static RC=56621;static SC=4783;static LC=1341;static xC=16578;static kC=35003;static MC=25239;static H_=9104;static V_=10275;static K_=7595;static X_=3610;static j_=7975;static z_=8526;static Z_=918;static q_=38802;static J_=24466;static Q_=10145;static tC=58654;static iC=5027;static eC=1457;static sC=16565;static nC=34991;static rC=25486;static DC=4626;static NC=11146;static FC=6439;static BC=12;static PC=4758;static UC=10270;static jC=4574;static WC=4550;static GC=4537;static YC=5681;static HC=5673;static VC=5790;static KC=6806;static XC=8076}},8950:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n extends s.A{static pw=new Int32Array;static gw=0;static Iw=0;static top=0;static bottom=0;static left=0;static right=0;static fI=0;static ev=0;static sv=0;static bind=(t,i,e)=>{this.pw=t,this.gw=i,this.Iw=e,this.Ta(0,0,i,e)};static nv=()=>{this.left=0,this.top=0,this.right=this.gw,this.bottom=this.Iw,this.fI=this.right-1,this.ev=this.right/2|0};static Ta=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.gw&&(e=this.gw),s>this.Iw&&(s=this.Iw),this.top=i,this.bottom=s,this.left=t,this.right=e,this.fI=this.right-1,this.ev=this.right/2|0,this.sv=this.bottom/2|0};static clear=()=>{const t=this.gw*this.Iw;for(let i=0;i{this.ya(t,i,n,e),this.ya(t,i+s-1,n,e),this.da(t,i,n,s),this.da(t+e-1,i,n,s)};static ya=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.gw;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.gw;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(l-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.gw-e;let h=t+i*this.gw;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.pw[h++]=n;h+=r}};static hv(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,a=(n>>8&255)*r,l=(255&n)*r,c=this.gw-e;let f=t+i*this.gw;for(let t=0;t>16&255)*h>>8<<16)+(a+(this.pw[f]>>8&255)*h>>8<<8)+(l+(255&this.pw[f])*h>>8);this.pw[f++]=t}f+=c}}static ov(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,a=(255&s)*n;let l=i-e;l<0&&(l=0);let c=i+e;c>=this.Iw&&(c=this.Iw-1);for(let s=l;s<=c;s++){const n=s-i,l=0|Math.sqrt(e*e-n*n);let c=t-l;c<0&&(c=0);let f=t+l;f>=this.gw&&(f=this.gw-1);let u=c+s*this.gw;for(let t=c;t<=f;t++){const t=(h+(this.pw[u]>>16&255)*r>>8<<16)+(o+(this.pw[u]>>8&255)*r>>8<<8)+(a+(255&this.pw[u])*r>>8);this.pw[u++]=t}}}static av=(t,i,e)=>{t=this.right||i=this.bottom||(this.pw[t+i*this.gw]=e)}}},4583:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1673),r=e(3867);class h extends s.A{static et=!1;static lv=new Int32Array(512);static cv=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static fv=new r.fe(50,null);static uv=0;static Aw=new Int32Array;static yl=0;static ml=0;static _w=!0;static cI=!1;static alpha=0;static dv=null;static wv=new r.fe(50,null);static yv=0;static MA=0;static mv=new Int32Array(50);static Av=new r.fe(50,null);static pv=!1;static gv=new r.fe(50,!1);static Iv=new Int32Array(50);static{for(let t=1;t<512;t++)this.lv[t]=32768/t|0;for(let t=1;t<2048;t++)this.cv[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static So=()=>{this.lv=null,this.lv=null,this.sin=null,this.cos=null,this.Aw=null,this.fv=null,this.gv=null,this.Iv=null,this.dv=null,this.wv=null,this.mv=null,this.palette=null,this.Av=null,console.log('Draw3D unloaded!')};static Fc=()=>{this.Aw=new Int32Array(s.A.Iw);for(let t=0;t{this.Aw=new Int32Array(i);for(let e=0;e{this.dv=null,this.wv.fill(null)};static Ev=t=>{this.uv=0;for(let i=0;i<50;i++)try{this.fv[i]=n.A.xu(t,i.toString()),this.et&&128===this.fv[i]?.Xa?this.fv[i]?.vv():this.fv[i]?.xw(),this.uv++}catch(t){}};static dA=t=>{if(0!==this.Iv[t])return this.Iv[t];const i=this.Av[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.bv(h,1.4),0===h&&(h=1),this.Iv[t]=h,h};static Tv=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,a=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let l=s-.3333333333333333;l<0&&l++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,a=6*l<1?i+6*(t-i)*l:2*l<1?t:3*l<2?i+(t-i)*(.6666666666666666-l)*6:i}const l=((256*h|0)<<16)+((256*o|0)<<8)+(256*a|0);this.palette[e++]=this.bv(l,i)}}for(let t=0;t<50;t++){const e=this.fv[t];if(!e)continue;const s=e.palette;this.Av[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static Rv=t=>{this.dv||(this.yv=t,this.et?this.dv=new r.Xr(t,16384):this.dv=new r.Xr(t,65536),this.wv.fill(null))};static yI=(t,i,e,n,r,o,a,l,c)=>{let f=0,u=0;r!==n&&(f=(i-t<<16)/(r-n)|0,u=(l-a<<15)/(r-n)|0);let d=0,w=0;o!==r&&(d=(e-i<<16)/(o-r)|0,w=(c-l<<15)/(o-r)|0);let y=0,m=0;if(o!==n&&(y=(t-e<<16)/(n-o)|0,m=(a-c<<15)/(n-o)|0),n<=r&&n<=o){if(ns.A.bottom&&(r=s.A.bottom),o>s.A.bottom&&(o=s.A.bottom),rd)for(o-=r,r-=n,n=h.Aw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Sv(e>>16,i>>16,c>>7,l>>7,s.A.pw,n,0),e+=y,i+=d,c+=m,l+=w,n+=s.A.gw}this.Sv(e>>16,t>>16,c>>7,a>>7,s.A.pw,n,0),e+=y,t+=f,c+=m,a+=u,n+=s.A.gw}else for(o-=r,r-=n,n=h.Aw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Sv(i>>16,e>>16,l>>7,c>>7,s.A.pw,n,0),e+=y,i+=d,c+=m,l+=w,n+=s.A.gw}this.Sv(t>>16,e>>16,a>>7,c>>7,s.A.pw,n,0),e+=y,t+=f,c+=m,a+=u,n+=s.A.gw}else if(i=t<<=16,l=a<<=15,n<0&&(i-=y*n,t-=f*n,l-=m*n,a-=u*n,n=0),e<<=16,c<<=15,o<0&&(e-=d*o,c-=w*o,o=0),n!==o&&yf)for(r-=o,o-=n,n=h.Aw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Sv(e>>16,t>>16,c>>7,a>>7,s.A.pw,n,0),e+=d,t+=f,c+=w,a+=u,n+=s.A.gw}this.Sv(i>>16,t>>16,l>>7,a>>7,s.A.pw,n,0),i+=y,t+=f,l+=m,a+=u,n+=s.A.gw}else for(r-=o,o-=n,n=h.Aw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Sv(t>>16,e>>16,a>>7,c>>7,s.A.pw,n,0),e+=d,t+=f,c+=w,a+=u,n+=s.A.gw}this.Sv(t>>16,i>>16,a>>7,l>>7,s.A.pw,n,0),i+=y,t+=f,l+=m,a+=u,n+=s.A.gw}}else if(r<=o){if(rs.A.bottom&&(o=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),oy)for(n-=o,o-=r,r=h.Aw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Sv(t>>16,e>>16,a>>7,c>>7,s.A.pw,r,0),t+=f,e+=y,a+=u,c+=m,r+=s.A.gw}this.Sv(t>>16,i>>16,a>>7,l>>7,s.A.pw,r,0),t+=f,i+=d,a+=u,l+=w,r+=s.A.gw}else for(n-=o,o-=r,r=h.Aw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Sv(e>>16,t>>16,c>>7,a>>7,s.A.pw,r,0),t+=f,e+=y,a+=u,c+=m,r+=s.A.gw}this.Sv(i>>16,t>>16,l>>7,a>>7,s.A.pw,r,0),t+=f,i+=d,a+=u,l+=w,r+=s.A.gw}else if(e=i<<=16,c=l<<=15,r<0&&(e-=f*r,i-=d*r,c-=u*r,l-=w*r,r=0),t<<=16,a<<=15,n<0&&(t-=y*n,a-=m*n,n=0),o-=n,n-=r,r=h.Aw[r],f>16,i>>16,a>>7,l>>7,s.A.pw,r,0),t+=y,i+=d,a+=m,l+=w,r+=s.A.gw}this.Sv(e>>16,i>>16,c>>7,l>>7,s.A.pw,r,0),e+=f,i+=d,c+=u,l+=w,r+=s.A.gw}else for(;;){if(--n<0)for(;;){if(--o<0)return;this.Sv(i>>16,t>>16,l>>7,a>>7,s.A.pw,r,0),t+=y,i+=d,a+=m,l+=w,r+=s.A.gw}this.Sv(i>>16,e>>16,l>>7,c>>7,s.A.pw,r,0),e+=f,i+=d,c+=u,l+=w,r+=s.A.gw}}else if(os.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,l>>7,a>>7,s.A.pw,o,0),i+=d,t+=f,l+=w,a+=u,o+=s.A.gw}this.Sv(i>>16,e>>16,l>>7,c>>7,s.A.pw,o,0),i+=d,e+=y,l+=w,c+=m,o+=s.A.gw}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Sv(t>>16,i>>16,a>>7,l>>7,s.A.pw,o,0),i+=d,t+=f,l+=w,a+=u,o+=s.A.gw}this.Sv(e>>16,i>>16,c>>7,l>>7,s.A.pw,o,0),i+=d,e+=y,l+=w,c+=m,o+=s.A.gw}else if(t=e<<=16,a=c<<=15,o<0&&(t-=d*o,e-=y*o,a-=w*o,c-=m*o,o=0),i<<=16,l<<=15,r<0&&(i-=f*r,l-=u*r,r=0),n-=r,r-=o,o=h.Aw[o],d>16,e>>16,l>>7,c>>7,s.A.pw,o,0),i+=f,e+=y,l+=u,c+=m,o+=s.A.gw}this.Sv(t>>16,e>>16,a>>7,c>>7,s.A.pw,o,0),t+=d,e+=y,a+=w,c+=m,o+=s.A.gw}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Sv(e>>16,i>>16,c>>7,l>>7,s.A.pw,o,0),i+=f,e+=y,l+=u,c+=m,o+=s.A.gw}this.Sv(e>>16,t>>16,c>>7,a>>7,s.A.pw,o,0),t+=d,e+=y,a+=w,c+=m,o+=s.A.gw}};static Sv=(t,i,e,n,r,o,a)=>{let l;if(h._w){let c;if(h.cI){if(c=i-t>3?(n-e)/(i-t)|0:0,i>s.A.fI&&(i=s.A.fI),t<0&&(e-=t*c,t=0),t>=i)return;o+=t,a=i-t>>2,c<<=2}else{if(!(t>2)>0?(n-e)*h.lv[a]>>15:0}if(0===h.alpha)for(;;){if(--a<0){if((a=i-t&3)>0){l=h.palette[e>>8];do{r[o++]=l,a--}while(a>0);return}break}l=h.palette[e>>8],e+=c,r[o++]=l,r[o++]=l,r[o++]=l,r[o++]=l}else{const s=h.alpha,n=256-h.alpha;for(;;){if(--a<0){if((a=i-t&3)>0){l=h.palette[e>>8],l=((16711935&l)*n>>8&16711935)+((65280&l)*n>>8&65280);do{r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),a--}while(a>0)}break}l=h.palette[e>>8],e+=c,l=((16711935&l)*n>>8&16711935)+((65280&l)*n>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280)}}}else if(ts.A.fI&&(i=s.A.fI),t<0&&(e-=t*c,t=0),t>=i))return;if(o+=t,a=i-t,0===h.alpha)do{r[o++]=h.palette[e>>8],e+=c,a--}while(a>0);else{const t=h.alpha,i=256-h.alpha;do{l=h.palette[e>>8],e+=c,l=((16711935&l)*i>>8&16711935)+((65280&l)*i>>8&65280),r[o++]=l+((16711935&r[o])*t>>8&16711935)+((65280&r[o])*t>>8&65280),a--}while(a>0)}}};static Lv=(t,i,e,n,r,h,o)=>{let a=0;r!==n&&(a=(i-t<<16)/(r-n)|0);let l=0;h!==r&&(l=(e-i<<16)/(h-r)|0);let c=0;if(h!==n&&(c=(t-e<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),rl)for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.xv(e>>16,i>>16,s.A.pw,n,o),e+=c,i+=l,n+=s.A.gw}this.xv(e>>16,t>>16,s.A.pw,n,o),e+=c,t+=a,n+=s.A.gw}else for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.xv(i>>16,e>>16,s.A.pw,n,o),e+=c,i+=l,n+=s.A.gw}this.xv(t>>16,e>>16,s.A.pw,n,o),e+=c,t+=a,n+=s.A.gw}else if(i=t<<=16,n<0&&(i-=c*n,t-=a*n,n=0),e<<=16,h<0&&(e-=l*h,h=0),n!==h&&ca)for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.xv(e>>16,t>>16,s.A.pw,n,o),e+=l,t+=a,n+=s.A.gw}this.xv(i>>16,t>>16,s.A.pw,n,o),i+=c,t+=a,n+=s.A.gw}else for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.xv(t>>16,e>>16,s.A.pw,n,o),e+=l,t+=a,n+=s.A.gw}this.xv(t>>16,i>>16,s.A.pw,n,o),i+=c,t+=a,n+=s.A.gw}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hc)for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.xv(t>>16,e>>16,s.A.pw,r,o),t+=a,e+=c,r+=s.A.gw}this.xv(t>>16,i>>16,s.A.pw,r,o),t+=a,i+=l,r+=s.A.gw}else for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.xv(e>>16,t>>16,s.A.pw,r,o),t+=a,e+=c,r+=s.A.gw}this.xv(i>>16,t>>16,s.A.pw,r,o),t+=a,i+=l,r+=s.A.gw}else if(e=i<<=16,r<0&&(e-=a*r,i-=l*r,r=0),t<<=16,n<0&&(t-=c*n,n=0),a>16,i>>16,s.A.pw,r,o),t+=c,i+=l,r+=s.A.gw}this.xv(e>>16,i>>16,s.A.pw,r,o),e+=a,i+=l,r+=s.A.gw}else for(h-=n,n-=r,r=this.Aw[r];;){if(--n<0)for(;;){if(--h<0)return;this.xv(i>>16,t>>16,s.A.pw,r,o),t+=c,i+=l,r+=s.A.gw}this.xv(i>>16,e>>16,s.A.pw,r,o),e+=a,i+=l,r+=s.A.gw}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.pw,h,o),i+=l,t+=a,h+=s.A.gw}this.xv(i>>16,e>>16,s.A.pw,h,o),i+=l,e+=c,h+=s.A.gw}else for(r-=n,n-=h,h=this.Aw[h];;){if(--n<0)for(;;){if(--r<0)return;this.xv(t>>16,i>>16,s.A.pw,h,o),i+=l,t+=a,h+=s.A.gw}this.xv(e>>16,i>>16,s.A.pw,h,o),i+=l,e+=c,h+=s.A.gw}else if(t=e<<=16,h<0&&(t-=l*h,e-=c*h,h=0),i<<=16,r<0&&(i-=a*r,r=0),l>16,e>>16,s.A.pw,h,o),i+=a,e+=c,h+=s.A.gw}this.xv(t>>16,e>>16,s.A.pw,h,o),t+=l,e+=c,h+=s.A.gw}else for(n-=r,r-=h,h=this.Aw[h];;){if(--r<0)for(;;){if(--n<0)return;this.xv(e>>16,i>>16,s.A.pw,h,o),i+=a,e+=c,h+=s.A.gw}this.xv(e>>16,t>>16,s.A.pw,h,o),t+=l,e+=c,h+=s.A.gw}};static gI=(t,i,e,n,r,h,o,a,l,c,f,u,d,w,y,m,A,p,g)=>{const I=this.kv(g);this.pv=!this.gv[g];const _=c-d,C=f-y,E=u-A,v=w-c,b=m-f,T=p-u;let O=v*f-b*c<<14;const R=b*u-T*f<<8,S=T*c-v*u<<5;let L=_*f-C*c<<14;const x=C*u-E*f<<8,k=E*c-_*u<<5;let M=C*v-_*b<<14;const D=E*b-C*T<<8,N=_*T-E*v<<5;let F=0,B=0;r!==n&&(F=(i-t<<16)/(r-n)|0,B=(a-o<<16)/(r-n)|0);let P=0,U=0;h!==r&&(P=(e-i<<16)/(h-r)|0,U=(l-a<<16)/(h-r)|0);let W=0,G=0;if(h!==n&&(W=(t-e<<16)/(n-h)|0,G=(o-l<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),rP)for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Mv(e>>16,i>>16,s.A.pw,n,I,0,0,O,L,M,R,x,D,l>>8,a>>8),e+=W,i+=P,l+=G,a+=U,n+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(e>>16,t>>16,s.A.pw,n,I,0,0,O,L,M,R,x,D,l>>8,o>>8),e+=W,t+=F,l+=G,o+=B,n+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Mv(i>>16,e>>16,s.A.pw,n,I,0,0,O,L,M,R,x,D,a>>8,l>>8),e+=W,i+=P,l+=G,a+=U,n+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(t>>16,e>>16,s.A.pw,n,I,0,0,O,L,M,R,x,D,o>>8,l>>8),e+=W,t+=F,l+=G,o+=B,n+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}else{i=t<<=16,a=o<<=16,n<0&&(i-=W*n,t-=F*n,a-=G*n,o-=B*n,n=0),e<<=16,l<<=16,h<0&&(e-=P*h,l-=U*h,h=0);const c=n-this.ml;if(O+=S*c,L+=k*c,M+=N*c,O|=0,L|=0,M|=0,(n===h||W>=F)&&(n!==h||P<=F))for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Mv(t>>16,e>>16,s.A.pw,n,I,0,0,O,L,M,R,x,D,o>>8,l>>8),e+=P,t+=F,l+=U,o+=B,n+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(t>>16,i>>16,s.A.pw,n,I,0,0,O,L,M,R,x,D,o>>8,a>>8),i+=W,t+=F,a+=G,o+=B,n+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Mv(e>>16,t>>16,s.A.pw,n,I,0,0,O,L,M,R,x,D,l>>8,o>>8),e+=P,t+=F,l+=U,o+=B,n+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(i>>16,t>>16,s.A.pw,n,I,0,0,O,L,M,R,x,D,a>>8,o>>8),i+=W,t+=F,a+=G,o+=B,n+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hW)for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Mv(t>>16,e>>16,s.A.pw,r,I,0,0,O,L,M,R,x,D,o>>8,l>>8),t+=F,e+=W,o+=B,l+=G,r+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(t>>16,i>>16,s.A.pw,r,I,0,0,O,L,M,R,x,D,o>>8,a>>8),t+=F,i+=P,o+=B,a+=U,r+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Mv(e>>16,t>>16,s.A.pw,r,I,0,0,O,L,M,R,x,D,l>>8,o>>8),t+=F,e+=W,o+=B,l+=G,r+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(i>>16,t>>16,s.A.pw,r,I,0,0,O,L,M,R,x,D,a>>8,o>>8),t+=F,i+=P,o+=B,a+=U,r+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}else{e=i<<=16,l=a<<=16,r<0&&(e-=F*r,i-=P*r,l-=B*r,a-=U*r,r=0),t<<=16,o<<=16,n<0&&(t-=W*n,o-=G*n,n=0);const c=r-this.ml;if(O+=S*c,L+=k*c,M+=N*c,O|=0,L|=0,M|=0,h-=n,n-=r,r=this.Aw[r],F>16,i>>16,s.A.pw,r,I,0,0,O,L,M,R,x,D,o>>8,a>>8),t+=W,i+=P,o+=G,a+=U,r+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(e>>16,i>>16,s.A.pw,r,I,0,0,O,L,M,R,x,D,l>>8,a>>8),e+=F,i+=P,l+=B,a+=U,r+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(;;){if(--n<0)for(;;){if(--h<0)return;this.Mv(i>>16,t>>16,s.A.pw,r,I,0,0,O,L,M,R,x,D,a>>8,o>>8),t+=W,i+=P,o+=G,a+=U,r+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(i>>16,e>>16,s.A.pw,r,I,0,0,O,L,M,R,x,D,a>>8,l>>8),e+=F,i+=P,l+=B,a+=U,r+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.pw,h,I,0,0,O,L,M,R,x,D,a>>8,o>>8),i+=P,t+=F,a+=U,o+=B,h+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(i>>16,e>>16,s.A.pw,h,I,0,0,O,L,M,R,x,D,a>>8,l>>8),i+=P,e+=W,a+=U,l+=G,h+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Mv(t>>16,i>>16,s.A.pw,h,I,0,0,O,L,M,R,x,D,o>>8,a>>8),i+=P,t+=F,a+=U,o+=B,h+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(e>>16,i>>16,s.A.pw,h,I,0,0,O,L,M,R,x,D,l>>8,a>>8),i+=P,e+=W,a+=U,l+=G,h+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}else{t=e<<=16,o=l<<=16,h<0&&(t-=P*h,e-=W*h,o-=U*h,l-=G*h,h=0),i<<=16,a<<=16,r<0&&(i-=F*r,a-=B*r,r=0);const c=h-this.ml;if(O+=S*c,L+=k*c,M+=N*c,O|=0,L|=0,M|=0,n-=r,r-=h,h=this.Aw[h],P>16,e>>16,s.A.pw,h,I,0,0,O,L,M,R,x,D,a>>8,l>>8),i+=F,e+=W,a+=B,l+=G,h+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(t>>16,e>>16,s.A.pw,h,I,0,0,O,L,M,R,x,D,o>>8,l>>8),t+=P,e+=W,o+=U,l+=G,h+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Mv(e>>16,i>>16,s.A.pw,h,I,0,0,O,L,M,R,x,D,l>>8,a>>8),i+=F,e+=W,a+=B,l+=G,h+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(e>>16,t>>16,s.A.pw,h,I,0,0,O,L,M,R,x,D,l>>8,o>>8),t+=P,e+=W,o+=U,l+=G,h+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}};static Mv=(t,i,e,n,r,h,o,a,l,c,f,u,d,w,y)=>{if(t>=i)return;let m,A,p,g,I,_,C,E,v;if(this.cI){if(m=(y-w)/(i-t)|0,i>s.A.fI&&(i=s.A.fI),t<0&&(w-=t*m,t=0),t>=i)return;A=i-t>>3,m<<=12}else i-t>7?(A=i-t>>3,m=(y-w)*this.lv[A]>>6):(A=0,m=0);if(w<<=9,n+=t,this.et&&r)if(p=0,g=0,_=t-this.yl,a+=(f>>3)*_,l+=(u>>3)*_,c+=(d>>3)*_,a|=0,l|=0,I=(c|=0)>>12,0!==I&&(o=l/I|0,(h=a/I|0)<0?h=0:h>4032&&(h=4032)),a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>12,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=g-o>>3,h+=w>>3&786432,v=w>>23,this.pv){for(;A-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h=p,o=g,a+=f,l+=u,I=(c+=d)>>12,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=g-o>>3,h+=(w+=m)>>3&786432,v=w>>23;for(A=i-t&7;A-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E}else{for(;A-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n+=1,h=p,o=g,a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>12,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=g-o>>3,h+=(w+=m)>>3&786432,v=w>>23}for(A=i-t&7;A-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}else if(p=0,g=0,_=t-this.yl,a+=(f>>3)*_,l+=(u>>3)*_,c+=(d>>3)*_,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(o=l/I|0,(h=a/I|0)<0?h=0:h>16256&&(h=16256)),a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=g-o>>3,h+=6291456&w,v=w>>23,this.pv&&r){for(;A-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h=p,o=g,a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=g-o>>3,h+=6291456&(w+=m),v=w>>23;for(A=i-t&7;A-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E}else{for(;A-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,h=p,o=g,a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=g-o>>3,h+=6291456&(w+=m),v=w>>23}for(A=i-t&7;A-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}};static xv=(t,i,e,n,r)=>{if(this.cI&&(i>s.A.fI&&(i=s.A.fI),t<0&&(t=0)),t>=i)return;n+=t;let h=i-t>>2;if(0===this.alpha)for(;;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;e[n++]=r}e[n++]=r,e[n++]=r,e[n++]=r,e[n++]=r}const o=this.alpha,a=256-this.alpha;for(r=((16711935&r)*a>>8&16711935)+((65280&r)*a>>8&65280);;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}};static Ov=t=>{this.wv[t]&&this.dv&&(this.dv[this.yv++]=this.wv[t],this.wv[t]=null)};static kv=t=>{if(this.mv[t]=this.MA++,this.wv[t])return this.wv[t];let i;if(this.yv>0&&this.dv)i=this.dv[--this.yv],this.dv[this.yv]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.pw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.pw[t]];this.gv[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.gv[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}},880:(t,i,e)=>{e.d(i,{r:()=>n});var s=e(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(s.UE.src),s.UE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>s.UE.onload=()=>t())),s.PE.clearRect(0,0,s.WE.width,s.WE.height);const i=s.UE.naturalWidth,e=s.UE.naturalHeight;return s.WE.width=i,s.WE.height=e,s.PE.drawImage(s.UE,0,0),s.PE.getImageData(0,0,i,e)}},8665:(t,i,e)=>{e.d(i,{A:()=>f});var s=e(1069),n=e(8950),r=e(4583),h=e(6730),o=e(4474),a=e(3867);class l{Fd=0;bg=0;Dv=0;Nv=-1;Fv=-1;Bv=-1;Pv=-1;Uv=-1;Wv=-1;Gv=-1;Yv=-1;Hv=-1;Vv=0;Kv=-1;Xv=-1;jv=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static zv=null;static Zv=null;static qv=null;static Jv=null;static $v=null;static Qv=null;static tb=null;static ib=null;static eb=null;static sb=null;static nb=null;static rb=null;static axis=null;static hb=new a.fe(4096,!1);static ob=new a.fe(4096,!1);static ab=new Int32Array(4096);static lb=new Int32Array(4096);static cb=new Int32Array(4096);static fb=new Int32Array(4096);static ub=new Int32Array(4096);static wb=new Int32Array(4096);static yb=new Int32Array(1500);static mb=new a.Xr(1500,512);static Ab=new Int32Array(12);static pb=new a.Xr(12,2e3);static gb=new Int32Array(2e3);static Ib=new Int32Array(2e3);static _b=new Int32Array(12);static Cb=new Int32Array(10);static Eb=new Int32Array(10);static vb=new Int32Array(10);static Ir=0;static bb=0;static _r=0;static Tb=!1;static Ha=0;static Va=0;static Ob=0;static Rb=new Int32Array(1e3);static Sb=!1;static yu(t){try{f.head=new s.A(t.read('ob_head.dat')),f.zv=new s.A(t.read('ob_face1.dat')),f.Zv=new s.A(t.read('ob_face2.dat')),f.qv=new s.A(t.read('ob_face3.dat')),f.Jv=new s.A(t.read('ob_face4.dat')),f.$v=new s.A(t.read('ob_face5.dat')),f.Qv=new s.A(t.read('ob_point1.dat')),f.tb=new s.A(t.read('ob_point2.dat')),f.ib=new s.A(t.read('ob_point3.dat')),f.eb=new s.A(t.read('ob_point4.dat')),f.sb=new s.A(t.read('ob_point5.dat')),f.nb=new s.A(t.read('ob_vertex1.dat')),f.rb=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.pf=0,f.Qv.pf=0,f.tb.pf=0,f.ib.pf=0,f.eb.pf=0,f.nb.pf=0,f.rb.pf=0;const i=f.head.mu;f.metadata=new a.fe(i+100,null);let e=0,n=0,r=0,h=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Nd=(t,i,e)=>{const s=t.Fd,n=t.bg,r=t.Dv;let h,o,l,u,d;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.Fd,r=t.bg,h=t.Dv;let o,a,l,c,u;if(s)o=t.Bd,a=t.Ud,l=t.Pd;else{o=new Int32Array(n),a=new Int32Array(n),l=new Int32Array(n);for(let i=0;i{const e=t.Fd,s=t.bg,n=t.Dv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,a=0,l=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,a=0,l=-1;for(let c=0;c{let o=-1;const a=t.Bd[i],l=t.Ud[i],c=t.Pd[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.zv&&f.Zv&&f.qv&&f.Jv&&f.$v&&f.Qv&&f.tb&&f.ib&&f.eb&&f.sb&&f.nb&&f.rb&&f.axis))throw new Error('cant loading model!!!!!');const e=i.Fd,s=i.bg,n=i.Dv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),a=new Int32Array(s),l=new Int32Array(s),c=new Int32Array(s),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;i.Uv>=0&&(y=new Int32Array(e));let m=null;i.Hv>=0&&(m=new Int32Array(s));let A=null,p=0;i.Vv>=0?A=new Int32Array(s):p=-i.Vv-1;let g=null;i.Kv>=0&&(g=new Int32Array(s));let I=null;i.Xv>=0&&(I=new Int32Array(s));const _=new Int32Array(s);f.Qv.pf=i.Nv,f.tb.pf=i.Fv,f.ib.pf=i.Bv,f.eb.pf=i.Pv,f.sb.pf=i.Uv;let C,E,v,b=0,T=0,O=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const e=f.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const n=e.Fd,r=e.bg,h=e.Dv,o=new Int32Array(n),a=new Int32Array(n),l=new Int32Array(n),c=new Int32Array(r),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(h),y=new Int32Array(h),m=new Int32Array(h);let A=null;e.Uv>=0&&(A=new Int32Array(n));let p=null;e.Hv>=0&&(p=new Int32Array(r));let g=null,I=0;e.Vv>=0?g=new Int32Array(r):I=-e.Vv-1;let _=null;e.Kv>=0&&(_=new Int32Array(r));let C=null;e.Xv>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(e.data);v.pf=e.Nv;const b=new s.A(e.data);b.pf=e.Fv;const T=new s.A(e.data);T.pf=e.Bv;const O=new s.A(e.data);O.pf=e.Pv;const R=new s.A(e.data);R.pf=e.Uv;let S,L,x,k=0,M=0,D=0;for(let t=0;tthis.jd&&(this.jd=-e),e>this.gg&&(this.gg=e);const n=i*i+s*s;n>this.EA&&(this.EA=n)}this.EA=Math.sqrt(this.EA)+.99|0,this.Gb=Math.sqrt(this.EA*this.EA+this.jd*this.jd)+.99|0,this.Wb=this.Gb+(Math.sqrt(this.EA*this.EA+this.gg*this.gg)+.99|0)}Wd(){this.jd=0,this.gg=0;for(let t=0;tthis.jd&&(this.jd=-i),i>this.gg&&(this.gg=i)}this.Gb=Math.sqrt(this.EA*this.EA+this.jd*this.jd)+.99|0,this.Wb=this.Gb+(Math.sqrt(this.EA*this.EA+this.gg*this.gg)+.99|0)}Gl(){if(this.Yb){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Vd=new a.fe(i+1,null);for(let e=0;e<=i;e++)this.Vd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Hd=new a.fe(i+1,null);for(let e=0;e<=i;e++)this.Hd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ea;)a=e[o++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==a||0===r.types[i])&&this.jb(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}f.Ir=0,f.bb=0,f._r=0,o=0,a=e[o++];for(let t=0;ta;)a=e[o++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===a||0===r.types[i])&&this.jb(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.Yl(t)}Yl(t){if(!this.Vd||-1===t||!h.A.Do[t])return;const i=h.A.Do[t],e=i.NE;f.Ir=0,f.bb=0,f._r=0;for(let t=0;t>16;this.Pd[t]=this.Ud[t]*i+this.Pd[t]*e>>16,this.Ud[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.kb&&this.Mb&&this.Db||(this.kb=new Int32Array(this.bg),this.Mb=new Int32Array(this.bg),this.Db=new Int32Array(this.bg)),!this.fg){this.fg=new a.fe(this.Fd,null);for(let t=0;t8192||A>8192||p>8192||m<-8192||A<-8192||p<-8192;)m>>=1,A>>=1,p>>=1;let g=0|Math.sqrt(m*m+A*A+p*p);if(g<=0&&(g=1),m=256*m/g|0,A=256*A/g|0,p=256*p/g|0,this.vg&&1&this.vg[i]){const r=t+((e*m+s*A+n*p)/(h+(h/2|0))|0);this.ku&&(this.kb[i]=f.xb(this.ku[i],r,this.vg[i]))}else{let t=this.fg[r];t&&(t.x+=m,t.y+=A,t.z+=p,t.w++),t=this.fg[o],t&&(t.x+=m,t.y+=A,t.z+=p,t.w++),t=this.fg[a],t&&(t.x+=m,t.y+=A,t.z+=p,t.w++)}}if(r)this.wg(t,h,e,s,n);else{this.pg=new a.fe(this.Fd,null);for(let t=0;t>16;for(let s=0;s>16,I=I*w-g*d>>16,g=p),0!==t&&(p=I*l-_*a>>16,_=I*a+_*l>>16,I=p),0!==i&&(p=_*c+g*u>>16,_=_*u-g*c>>16,g=p),g+=n,I+=h,_+=o,p=I*m-_*y>>16,_=I*y+_*m>>16,I=p,f.ab&&f.lb&&f.cb&&(f.cb[s]=_-A,f.ab[s]=r.A.yl+((g<<9)/_|0),f.lb[s]=r.A.ml+((I<<9)/_|0)),this.Dv>0&&f.fb&&f.ub&&f.wb&&(f.fb[s]=g,f.ub[s]=I,f.wb[s]=_)}try{this.qb(!1,!1,0)}catch(t){}}draw(t,i,e,s,h,o,a,l,c){const u=l*h-o*s>>16,d=a*i+u*e>>16,w=this.EA*e>>16,y=d+w;if(y<=50||d>=3500)return;const m=l*s+o*h>>16;let A=m-this.EA<<9;if((A/y|0)>=n.A.ev)return;let p=m+this.EA<<9;if((p/y|0)<=-n.A.ev)return;const g=a*e-u*i>>16,I=this.EA*i>>16;let _=g+I<<9;if((_/y|0)<=-n.A.sv)return;let C=g-(I+(this.jd*e>>16))<<9;if((C/y|0)>=n.A.sv)return;let E=d-(w+(this.jd*i>>16))<=50,v=!1;if(c>0&&f.Tb){let t=d-w;t<=50&&(t=50),m>0?(A=A/y|0,p=p/t|0):(p=p/y|0,A=A/t|0),g>0?(C=C/y|0,_=_/t|0):(_=_/y|0,C=C/t|0);const i=f.Ha-r.A.yl,e=f.Va-r.A.ml;i>A&&iC&&e<_&&(this.ow?f.Rb[f.Ob++]=c:v=!0)}const b=r.A.yl,T=r.A.ml;let O=0,R=0;0!==t&&(O=r.A.sin[t],R=r.A.cos[t]);for(let n=0;n>16,w=w*R-c*O>>16,c=r),c+=o,u+=a,w+=l,r=w*s+c*h>>16,w=w*h-c*s>>16,c=r,r=u*e-w*i>>16,w=u*i+w*e>>16,u=r,f.cb&&(f.cb[n]=w-d),w>=50&&f.ab&&f.lb?(f.ab[n]=b+((c<<9)/w|0),f.lb[n]=T+((u<<9)/w|0)):f.ab&&(f.ab[n]=-5e3,E=!0),(E||this.Dv>0)&&f.fb&&f.ub&&f.wb&&(f.fb[n]=c,f.ub[n]=u,f.wb[n]=w)}try{this.qb(E,v,c)}catch(t){}}qb(t,i,e,s=!1){f.Sb&&(this.Kb=-1,this.Xb=-1);for(let t=0;tn.A.fI||l>n.A.fI||c>n.A.fI),f.mb&&f.yb){const t=((y+m+A)/3|0)+this.Gb;f.mb[t][f.yb[t]++]=s,f.Sb&&this.Jb(f.Ha,f.Va,u,d,w,a,l,c)&&this.Xb=0;t--){const i=f.yb[t];if(!(i<=0)&&f.mb){const e=f.mb[t];for(let t=0;t=0;t--){const i=f.yb[t];if(i>0&&f.mb){const e=f.mb[t];for(let s=0;s0||f.Ab[2]>0)&&(r=(f._b[1]+f._b[2])/(f.Ab[1]+f.Ab[2])|0);let h=0;f.Ab&&f._b&&(f.Ab[3]>0||f.Ab[4]>0)&&(h=(f._b[3]+f._b[4])/(f.Ab[3]+f.Ab[4])|0);let o=0;if(f.Ab&&f._b&&(f.Ab[6]>0||f.Ab[8]>0)&&(o=(f._b[6]+f._b[8])/(f.Ab[6]+f.Ab[8])|0),f.Ab&&f.pb){let t,i=0,e=f.Ab[10],n=f.pb[10],a=f.gb;i===e&&(i=0,e=f.Ab[11],n=f.pb[11],a=f.Ib),t=ir;)try{this.$b(n[i++],s),i===e&&n!==f.pb[11]&&(i=0,e=f.Ab[11],n=f.pb[11],a=f.Ib),t=ih;)try{this.$b(n[i++],s),i===e&&n!==f.pb[11]&&(i=0,e=f.Ab[11],n=f.pb[11],a=f.Ib),t=io;)try{this.$b(n[i++],s),i===e&&n!==f.pb[11]&&(i=0,e=f.Ab[11],n=f.pb[11],a=f.Ib),t=i>2,h=this.Bb[i],o=this.Pb[i],a=this.Ub[i];r.A.gI(f.ab[e],f.ab[s],f.ab[n],f.lb[e],f.lb[s],f.lb[n],this.kb[t],this.Mb[t],this.Db[t],f.fb[h],f.ub[h],f.wb[h],f.fb[o],f.fb[a],f.ub[o],f.ub[a],f.wb[o],f.wb[a],this.ku[t])}else if(3===h&&this.vg&&this.ku&&this.kb&&f.ab&&f.lb&&f.fb&&f.ub&&f.wb){const i=this.vg[t]>>2,h=this.Bb[i],o=this.Pb[i],a=this.Ub[i];r.A.gI(f.ab[e],f.ab[s],f.ab[n],f.lb[e],f.lb[s],f.lb[n],this.kb[t],this.kb[t],this.kb[t],f.fb[h],f.ub[h],f.wb[h],f.fb[o],f.fb[a],f.ub[o],f.ub[a],f.wb[o],f.wb[a],this.ku[t])}}Qb(t,i=!1){let e=0;if(f.wb){const i=r.A.yl,s=r.A.ml,n=this.Tg[t],h=this.Og[t],o=this.Rg[t],a=f.wb[n],l=f.wb[h],c=f.wb[o];if(a>=50&&f.ab&&f.lb&&this.kb)f.Cb[e]=f.ab[n],f.Eb[e]=f.lb[n],f.vb[e++]=this.kb[t];else if(f.fb&&f.ub&&this.kb){const u=f.fb[n],d=f.ub[n],w=this.kb[t];if(c>=50&&this.Db){const n=(50-a)*r.A.cv[c-a];f.Cb[e]=i+((u+((f.fb[o]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[o]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.Db[t]-w)*n>>16)}if(l>=50&&this.Mb){const n=(50-a)*r.A.cv[l-a];f.Cb[e]=i+((u+((f.fb[h]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[h]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.Mb[t]-w)*n>>16)}}if(l>=50&&f.ab&&f.lb&&this.Mb)f.Cb[e]=f.ab[h],f.Eb[e]=f.lb[h],f.vb[e++]=this.Mb[t];else if(f.fb&&f.ub&&this.Mb){const u=f.fb[h],d=f.ub[h],w=this.Mb[t];if(a>=50&&this.kb){const h=(50-l)*r.A.cv[a-l];f.Cb[e]=i+((u+((f.fb[n]-u)*h>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[n]-d)*h>>16)<<9)/50|0),f.vb[e++]=w+((this.kb[t]-w)*h>>16)}if(c>=50&&this.Db){const n=(50-l)*r.A.cv[c-l];f.Cb[e]=i+((u+((f.fb[o]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[o]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.Db[t]-w)*n>>16)}}if(c>=50&&f.ab&&f.lb&&this.Db)f.Cb[e]=f.ab[o],f.Eb[e]=f.lb[o],f.vb[e++]=this.Db[t];else if(f.fb&&f.ub&&this.Db){const u=f.fb[o],d=f.ub[o],w=this.Db[t];if(l>=50&&this.Mb){const n=(50-c)*r.A.cv[l-c];f.Cb[e]=i+((u+((f.fb[h]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[h]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.Mb[t]-w)*n>>16)}if(a>=50&&this.kb){const h=(50-c)*r.A.cv[a-c];f.Cb[e]=i+((u+((f.fb[n]-u)*h>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[n]-d)*h>>16)<<9)/50|0),f.vb[e++]=w+((this.kb[t]-w)*h>>16)}}}const s=f.Cb[0],h=f.Cb[1],o=f.Cb[2],a=f.Eb[0],l=f.Eb[1],c=f.Eb[2];if(!((s-h)*(c-l)-(a-l)*(o-h)<=0))if(r.A.cI=!1,3===e){let e;if((s<0||h<0||o<0||s>n.A.fI||h>n.A.fI||o>n.A.fI)&&(r.A.cI=!0),e=this.vg?3&this.vg[t]:0,i)r.A.rv(s,h,a,l,f.vb[0]),r.A.rv(h,o,l,c,f.vb[1]),r.A.rv(o,s,c,a,f.vb[2]);else if(0===e)r.A.yI(s,h,o,a,l,c,f.vb[0],f.vb[1],f.vb[2]);else if(1===e&&this.kb)r.A.Lv(s,h,o,a,l,c,r.A.palette[this.kb[t]]);else if(2===e&&this.vg&&this.ku&&f.fb&&f.ub&&f.wb){const i=this.vg[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.gI(s,h,o,a,l,c,f.vb[0],f.vb[1],f.vb[2],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.ku[t])}else if(3===e&&this.vg&&this.ku&&this.kb&&f.fb&&f.ub&&f.wb){const i=this.vg[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.gI(s,h,o,a,l,c,this.kb[t],this.kb[t],this.kb[t],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.ku[t])}}else if(4===e){let e;if((s<0||h<0||o<0||s>n.A.fI||h>n.A.fI||o>n.A.fI||f.Cb[3]<0||f.Cb[3]>n.A.fI)&&(r.A.cI=!0),e=this.vg?3&this.vg[t]:0,i)r.A.rv(s,h,a,l,f.vb[0]),r.A.rv(h,o,l,c,f.vb[1]),r.A.rv(o,f.Cb[3],c,f.Eb[3],f.vb[2]),r.A.rv(f.Cb[3],s,f.Eb[3],a,f.vb[3]);else if(0===e)r.A.yI(s,h,o,a,l,c,f.vb[0],f.vb[1],f.vb[2]),r.A.yI(s,o,f.Cb[3],a,c,f.Eb[3],f.vb[0],f.vb[2],f.vb[3]);else if(1===e){if(this.kb){const i=r.A.palette[this.kb[t]];r.A.Lv(s,h,o,a,l,c,i),r.A.Lv(s,o,f.Cb[3],a,c,f.Eb[3],i)}}else if(2===e&&this.vg&&this.ku&&f.fb&&f.ub&&f.wb){const i=this.vg[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.gI(s,h,o,a,l,c,f.vb[0],f.vb[1],f.vb[2],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.ku[t]),r.A.gI(s,o,f.Cb[3],a,c,f.Eb[3],f.vb[0],f.vb[2],f.vb[3],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.ku[t])}else if(3===e&&this.vg&&this.ku&&this.kb&&f.fb&&f.ub&&f.wb){const i=this.vg[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.gI(s,h,o,a,l,c,this.kb[t],this.kb[t],this.kb[t],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.ku[t]),r.A.gI(s,o,f.Cb[3],a,c,f.Eb[3],this.kb[t],this.kb[t],this.kb[t],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.ku[t])}}}jb(t,i,e,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f.Ir=0,f.bb=0,f._r=0;for(let t=0;t0?(f.Ir=(f.Ir/n|0)+t,f.bb=(f.bb/n|0)+i,f._r=(f._r/n|0)+e):(f.Ir=t,f.bb=i,f._r=e)}else if(1===n)for(let n=0;n=this.Vd.length)continue;const h=this.Vd[r];if(h)for(let s=0;s=this.Vd.length)continue;const o=this.Vd[h];if(o)for(let s=0;s>16;this.Ud[n]=this.Ud[n]*u-this.Bd[n]*c>>16,this.Bd[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.Ud[n]*u-this.Pd[n]*c>>16;this.Pd[n]=this.Ud[n]*c+this.Pd[n]*u>>16,this.Ud[n]=t}if(0!==a){c=r.A.sin[a],u=r.A.cos[a];const t=this.Pd[n]*c+this.Bd[n]*u>>16;this.Pd[n]=this.Pd[n]*u-this.Bd[n]*c>>16,this.Bd[n]=t}this.Bd[n]+=f.Ir,this.Ud[n]+=f.bb,this.Pd[n]+=f._r}}else if(3===n)for(let n=0;n=this.Vd.length)continue;const h=this.Vd[r];if(h)for(let s=0;s=this.Hd.length)continue;const n=this.Hd[e];if(n)for(let i=0;i255&&(this.Fb[e]=255)}}}Zb(){this.jd=0,this.EA=0,this.gg=0,this.Ig=999999,this._g=-999999,this.Eg=-99999,this.Cg=99999;for(let t=0;tthis._g&&(this._g=i),sthis.Eg&&(this.Eg=s),-e>this.jd&&(this.jd=-e),e>this.gg&&(this.gg=e);const n=i*i+s*s;n>this.EA&&(this.EA=n)}this.EA=0|Math.sqrt(this.EA),this.Gb=0|Math.sqrt(this.EA*this.EA+this.jd*this.jd),this.Wb=this.Gb+(0|Math.sqrt(this.EA*this.EA+this.gg*this.gg))}Jb(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{e.d(i,{A:()=>o});var s=e(8950),n=e(1069),r=e(4474),h=e(880);class o extends r.A{pw;width;height;iT;eT;Xa;dw;constructor(t,i){super(),this.pw=new Int32Array(t*i),this.width=this.Xa=t,this.height=this.dw=i,this.iT=this.eT=0}static sT=async(t,i)=>{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(0,h.r)(e),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),a=n.pw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static xu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.pf=s.mu;const h=r.mu,a=r.mu,l=[],c=r.pu-1;for(let t=0;ts.length||r.pf>r.length)throw new Error;const f=r.pu,u=r.pu,d=r.mu,w=r.mu,y=new o(d,w);y.iT=f,y.eT=u,y.Xa=h,y.dw=a;const m=r.pu;if(0===m){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.nT(h,r,this.pw,n,a,s.A.pw,e,o)}Ka(t,i,e){i|=0,e|=0;let n=(i+=this.iT)+(e+=this.eT)*s.A.gw,r=0,h=this.height,o=this.width,a=s.A.gw-o,l=0;if(es.A.bottom&&(h-=e+h-s.A.bottom),is.A.right){const t=i+o-s.A.right;o-=t,l+=t,a+=t}o>0&&h>0&&this.rT(o,h,this.pw,r,l,s.A.pw,n,a,t)}hT(t,i){t|=0,i|=0;let e=(t+=this.iT)+(i+=this.eT)*s.A.gw,n=0,r=this.height,h=this.width,o=s.A.gw-h,a=0;if(is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.oT(h,r,this.pw,n,a,s.A.pw,e,o)}aT(){const t=this.pw,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.pw[s]=(r<<16)+(h<<8)+o}}}xw(t,i,e,n){t|=0,i|=0,e|=0,n|=0;try{const r=this.width;let h=0,o=0;const a=this.Xa,l=this.dw,c=(a<<16)/e|0,f=(l<<16)/n|0;t+=(this.iT*e+a-1)/a|0,i+=(this.eT*n+l-1)/l|0,this.iT*e%a!=0&&(h=(a-this.iT*e%a<<16)/e|0),this.eT*n%l!=0&&(o=(l-this.eT*n%l<<16)/n|0),e=e*(this.width-(h>>16))/a|0,n=n*(this.height-(o>>16))/l|0;let u=t+i*s.A.gw,d=s.A.gw-e;if(is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right){const i=t+e-s.A.right;e-=i,d+=i}this.scale(e,n,this.pw,h,o,s.A.pw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}cT(t,i,e,n,r,h,o,a,l,c){t|=0,i|=0,e|=0,n|=0;try{const f=-e/2|0,u=-n/2|0,d=65536*Math.sin(l/326.11)|0,w=65536*Math.cos(l/326.11)|0,y=d*c>>8,m=w*c>>8;let A=(o<<16)+u*y+f*m,p=u*m-f*y+(a<<16),g=t+i*s.A.gw;for(let t=0;t>16)+(o>>16)*this.width],n+=m,o-=y;A+=y,p+=m,g+=s.A.gw}}catch(t){}}fT(t,i,e){t|=0,i|=0;let n=(t+=this.iT)+(i+=this.eT)*s.A.gw,r=0,h=this.height,o=this.width,a=s.A.gw-o,l=0;if(is.A.bottom&&(h-=i+h-s.A.bottom),ts.A.right){const i=t+o-s.A.right;o-=i,l+=i,a+=i}o>0&&h>0&&this.uT(o,h,this.pw,l,r,s.A.pw,n,a,e.pw)}scale(t,i,e,s,n,r,h,o,a,l,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*a;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=l}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}oT(t,i,e,s,n,r,h,o){const a=-(t>>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}rT(t,i,e,s,n,r,h,o,a){const l=256-a;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*a+(16711935&i)*l&4278255360)+((65280&t)*a+(65280&i)*l&16711680)>>8}}h+=o,s+=n}}nT(t,i,e,s,n,r,h,o){const a=-(t>>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}uT(t,i,e,s,n,r,h,o,a){const l=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=l;t<0;t++){let t=e[n++];0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===a[h]?r[h++]=t:h++}h+=o,n+=s}}}},1673:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1069),r=e(4474);class h extends r.A{pw;width;height;iT;eT;Xa;dw;palette;constructor(t,i,e){super(),this.pw=new Int8Array(t*i),this.width=this.Xa=t,this.height=this.dw=i,this.iT=this.eT=0,this.palette=e}static xu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.pf=s.mu;const o=r.mu,a=r.mu,l=r.pu,c=new Int32Array(l);for(let t=1;ts.length||r.pf>r.length)throw new Error;const f=r.pu,u=r.pu,d=r.mu,w=r.mu,y=new h(d,w,c);y.iT=f,y.eT=u,y.Xa=o,y.dw=a;const m=y.pw,A=r.pu;if(0===A){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.dT(h,r,this.pw,n,a,s.A.pw,e,o)}aT(){const t=this.pw,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}vv(){this.Xa|=0,this.dw|=0,this.Xa/=2,this.dw/=2,this.Xa|=0,this.dw|=0;const t=new Int8Array(this.Xa*this.dw);let i=0;for(let e=0;e>1)+(e+this.eT>>1)*this.Xa]=this.pw[i++];this.pw=t,this.width=this.Xa,this.height=this.dw,this.iT=0,this.eT=0}xw(){if(this.width===this.Xa&&this.height===this.dw)return;const t=new Int8Array(this.Xa*this.dw);let i=0;for(let e=0;e>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,n){try{const r=this.width;this.height;let h=0,o=0;const a=this.Xa,l=this.dw,c=(a<<16)/e|0,f=(l<<16)/n|0;t=t+(this.iT*e+a-1)/a|0,i=i+(this.eT*n+l-1)/l|0,this.iT*e%a!=0&&(h=(a-this.iT*e%a<<16)/e|0),this.eT*n%l!=0&&(o=(l-this.eT*n%l<<16)/n|0),e=e*(this.width-(h>>16))/a|0,n=n*(this.height-(o>>16))/l|0;let u,d=t+i*s.A.gw,w=s.A.gw-e;is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right&&(u=t+e-s.A.right,e-=u,w+=u),this.wT(s.A.pw,this.pw,this.palette,h,o,d,w,e,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}wT(t,i,e,s,n,r,h,o,a,l,c,f){try{const u=s;for(let d=-a;d<0;d++){const a=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+a];0==n?r++:t[r++]=e[255&n],s+=l}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(8950),n=e(1069),r=e(4474);class h{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}yT(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}mT(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=e(9298);class a extends r.A{static AT='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static pT=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let e=a.AT.indexOf(String.fromCharCode(i));t&&e>=63&&e--,-1===e&&(e=74),a.pT[i]=e}}gT=[];IT=new Int32Array(94);_T=new Int32Array(94);CT=new Int32Array(94);ET=new Int32Array(94);vT=new Int32Array(95);bT=new Int32Array(256);random=new h(BigInt(Date.now()));height=0;static xu=(t,i)=>{const e=new n.A(t.read(i+'.dat')),s=new n.A(t.read('index.dat'));s.pf=e.mu+4;const r=s.pu;r>0&&(s.pf+=3*(r-1));const h=new a;for(let t=0;t<94;t++){h.CT[t]=s.pu,h.ET[t]=s.pu;const i=h.IT[t]=s.mu,n=h._T[t]=s.mu,r=s.pu,o=i*n;if(h.gT[t]=new Int8Array(o),0===r)for(let s=0;sh.height&&(h.height=n),h.CT[t]=1,h.vT[t]=i+2;{let e=0;for(let s=n/7|0;s=s.A.bottom&&(r-=e+r+1-s.A.bottom),i=s.A.right){const t=i+n+1-s.A.right;n-=t,l+=t,a+=t}n>0&&r>0&&this.DT(n,r,t,c,l,s.A.pw,o,a,h)}xT(t,i,e,n,r,h,o){e|=0,n|=0;let a=(t|=0)+(i|=0)*s.A.gw,l=s.A.gw-e,c=0,f=0;if(i=s.A.bottom&&(n-=i+n+1-s.A.bottom),t=s.A.right){const i=t+e+1-s.A.right;e-=i,c+=i,l+=i}e>0&&n>0&&this.NT(e,n,s.A.pw,a,l,o,f,c,r,h)}DT(t,i,e,s,n,r,h,o,a){const l=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=l;t<0;t++)0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a;for(let i=t;i<0;i++)0===e[s++]?h++:r[h++]=a;h+=o,s+=n}}NT(t,i,e,s,n,r,h,o,a,l){t|=0;const c=((16711935&a)*l&4278255360)+((65280&a)*l&16711680)>>8,f=256-l;for(let a=-(i|=0);a<0;a++){for(let i=-t;i<0;i++)if(0===r[h++])s++;else{const t=e[s];e[s++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}s+=n,h+=o}}OT(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.qa:'cya'===t?o.A.GE:'mag'===t?o.A.wA:'whi'===t?o.A.La:'bla'===t?o.A.Za:'lre'===t?o.A.YE:'dre'===t?o.A.HE:'dbl'===t?o.A.VE:'or1'===t?o.A.KE:'or2'===t?o.A.XE:'or3'===t?o.A.jE:'gr1'===t?o.A.zE:'gr2'===t?o.A.ZE:'gr3'===t?o.A.qE:o.A.Za}split(t,i){if(0===t.length)return[t];const e=[];for(;t.length>0;){if(this.RT(t)<=i&&-1===t.indexOf('|')){e.push(t);break}let s=t.length;for(let e=0;ei)break;s=e}else if('|'===t[e]){s=e;break}e.push(t.substring(0,s)),t=t.substring(s+1)}return e}}},1183:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(8950),n=e(7854);class r{FT;width;height;BT;PT;pw;constructor(t,i,e=n.na){this.BT=e,this.FT=this.BT.getImageData(0,0,t,i),this.PT=new Uint32Array(this.FT.data.buffer),this.pw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.pw.fill(0)}bind(){s.A.bind(this.pw,this.width,this.height)}draw(t,i){this.#t(),this.BT.putImageData(this.FT,t,i)}#t(){const t=this.pw.length,i=this.pw,e=this.PT;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,i,e)=>{e.d(i,{A:()=>s});class s{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));zo=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Qo=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};UT=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}},2901:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(1908);class r{static UT=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.GT)return null;if(this.XT[t])return this.XT[t];const i=this.KT[t],e=i+this.VT[t];if(this.WT){const s=Uint8Array.from(this.buffer.subarray(i,i+e));return this.XT[t]=s,s}{const i=Uint8Array.from(n.A.read(this.HT[t],this.buffer,this.VT[t],this.KT[t]));return this.XT[t]=i,i}}}},1069:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(9234),n=e(6666),r=e(4474);class h extends r.A{static zT=3988292384;static ZT=new Int32Array(256);static qT=new Uint32Array(33);static JT=new n.A;static $T=new n.A;static QT=new n.A;static tO=0;static iO=0;static eO=0;static{for(let t=0;t<32;t++)h.qT[t]=(1<>>=1:i=i>>>1^h.zT;h.ZT[t]=i}}static Zo=t=>{let i=4294967295;for(let e=0;e>>8^h.ZT[255&(i^t[e])];return~i};view;data;pf=0;sO=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.pf}static Pt=t=>{let i=null;return 0===t&&h.tO>0?(h.tO--,i=h.JT.Xg()):1===t&&h.iO>0?(h.iO--,i=h.$T.Xg()):2===t&&h.eO>0&&(h.eO--,i=h.QT.Xg()),i?(i.pf=0,i):new h(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.pf=0,100===this.view.byteLength&&h.tO<1e3?(h.JT.Vm(this),h.tO++):5e3===this.view.byteLength&&h.iO<250?(h.$T.Vm(this),h.iO++):3e4===this.view.byteLength&&h.eO<50&&(h.QT.Vm(this),h.eO++)}get pu(){return this.view.getUint8(this.pf++)}get Dd(){return this.view.getInt8(this.pf++)}get mu(){const t=this.view.getUint16(this.pf);return this.pf+=2,t}get Iu(){const t=this.view.getInt16(this.pf);return this.pf+=2,t}get qu(){const t=this.view.getUint8(this.pf++)<<16|this.view.getUint16(this.pf);return this.pf+=2,t}get ia(){const t=this.view.getInt32(this.pf);return this.pf+=4,t}get hE(){const t=this.view.getBigInt64(this.pf);return this.pf+=8,t}get FE(){return this.view.getUint8(this.pf)<128?this.pu-64:this.mu-49152}get CA(){return this.view.getUint8(this.pf)<128?this.pu:this.mu-32768}get Eu(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.pf++))&&this.pf>16),this.view.setUint16(this.pf,t),this.pf+=2}p4(t){this.view.setInt32(this.pf,t),this.pf+=4}oO(t){this.view.setInt32(this.pf,t,!0),this.pf+=4}aO(t){this.view.setBigInt64(this.pf,t),this.pf+=8}lO(t){const i=this.view,e=t.length;for(let s=0;s>>3}wO(t){let i=this.sO>>>3,e=8-(7&this.sO),s=0;for(this.sO+=t;t>e;e=8)s+=(this.view.getUint8(i++)&h.qT[e])<>>e-t&h.qT[t],s}yO(t,i){const e=this.pf;this.pf=0;const n=new Uint8Array(e);this.nO(e,0,n);const r=(0,s.mO)(n),h=(0,s.AO)(r,i,t),o=(0,s.pO)(h);this.pf=0,this.p1(o.length),this.cO(o,o.length,0)}}},5226:(t,i,e)=>{e.d(i,{Q:()=>n,x:()=>s});class s{gO=new Map;Eo;xo=self.isSecureContext?self.crypto.randomUUID():'0';constructor(t){this.Eo=t}async Ko(){const t=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),i=t.createDataChannel('channel'),e=crypto.randomUUID();this.gO.set(e,i),await t.setLocalDescription(await t.createOffer()),t.onicegatheringstatechange=async()=>{if('complete'===t.iceGatheringState){let i;self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(t.localDescription)):console.log(JSON.stringify(t.localDescription));try{for(;null===(i=prompt('Offer copied to clipboard, paste answer here')););t.setRemoteDescription(new RTCSessionDescription(JSON.parse(i)))}catch(t){console.error(t)}}},i.onopen=()=>{i.send(JSON.stringify({type:'id',id:e})),console.log('Connected to peer!')},i.onerror=t=>{console.error(t)},i.onmessage=t=>{const i=JSON.parse(t.data);i.data&&(i.data=Object.values(i.data)),this.Eo&&this.Eo.postMessage(i)}}postMessage(t){const i=this.gO.get(t.data.id),e=t.data;e.data&&(e.data=Array.from(t.data.data)),i&&'open'===i.readyState&&i.send(JSON.stringify(e))}}class n{pc;Lo=void 0;xo;constructor(t){this.pc=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),this.pc.ondatachannel=i=>{this.Lo=i.channel,this.Lo.onopen=()=>{console.log('Connected to host!')},this.Lo.onerror=t=>{console.error(t)},this.Lo.onmessage=i=>{if(!this.xo){const t=JSON.parse(i.data);if('id'===t.type)return void(this.xo=t.id)}t.onmessage&&t.onmessage(i)}},this.pc.onicegatheringstatechange=async()=>{'complete'===this.pc.iceGatheringState&&(self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(this.pc.localDescription)):console.log(JSON.stringify(this.pc.localDescription)))}}async Xo(t){await this.pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(t))),await this.pc.setLocalDescription(await this.pc.createAnswer())}}},3937:(t,i,e)=>{e.d(i,{A:()=>o});class s{start=0;end=0;form=0;length=0;IO=null;_O=null;threshold=0;position=0;delta=0;amplitude=0;CO=0;read(t){this.form=t.pu,this.start=t.ia,this.end=t.ia,this.length=t.pu,this.IO=new Int32Array(this.length),this._O=new Int32Array(this.length);for(let i=0;i=this.threshold&&this._O&&this.IO&&(this.amplitude=this._O[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this.IO[this.position]/65536*t|0,this.threshold>this.CO&&(this.delta=((this._O[this.position]<<15)-this.amplitude)/(this.threshold-this.CO)|0)),this.amplitude+=this.delta,this.CO++,this.amplitude-this.delta>>15}}class n{static buffer=null;static Ym=null;static sin=null;static EO=new Int32Array(5);static vO=new Int32Array(5);static bO=new Int32Array(5);static TO=new Int32Array(5);static OO=new Int32Array(5);RO=null;SO=null;LO=null;xO=null;kO=null;MO=null;release=null;attack=null;DO=new Int32Array(5);NO=new Int32Array(5);FO=new Int32Array(5);start=0;length=500;BO=100;PO=0;static init=()=>{this.Ym=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.Ym[t]=1:this.Ym[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};UO(t,i){for(let i=0;i>1,h+=(i*s>>16)+r}if(this.kO&&this.MO){const i=this.kO.evaluate(t),e=this.MO.evaluate(t);c=c*(32768+(this.WO(e,l,this.kO.form)>>1))>>15,l+=(i*o>>16)+a}for(let s=0;s<5;s++)if(0!==this.DO[s]){const r=i+n.vO[s];r>15,n.EO[s],this.RO.form),n.EO[s]+=(e*n.TO[s]>>16)+n.OO[s])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,e=!0;for(let s=0;s>8):this.release.start+((this.release.end-this.release.start)*h>>8),i+=256,i>=o&&(i=0,e=!e),e&&(n.buffer[s]=0)}}if(this.PO>0&&this.BO>0){const i=this.PO*e;for(let e=i;e32767&&(n.buffer[i]=32767);return n.buffer}WO(t,i,e){return 1===e?(32767&i)<16384?t:-t:2===e?n.sin[32767&i]*t>>14:3===e?((32767&i)*t>>14)-t:4===e?n.Ym[i/2607&32767]*t:0}read(t){this.RO=new s,this.RO.read(t),this.SO=new s,this.SO.read(t),0!==t.pu&&(t.pf--,this.LO=new s,this.LO.read(t),this.xO=new s,this.xO.read(t)),0!==t.pu&&(t.pf--,this.kO=new s,this.kO.read(t),this.MO=new s,this.MO.read(t)),0!==t.pu&&(t.pf--,this.release=new s,this.release.read(t),this.attack=new s,this.attack.read(t));for(let i=0;i<10;i++){const e=t.CA;if(0===e)break;this.DO[i]=e,this.NO[i]=t.FE,this.FO[i]=t.CA}this.PO=t.CA,this.BO=t.CA,this.length=t.mu,this.start=t.mu}}var r=e(1069),h=e(3867);class o{static GO=new Int32Array(1e3);static YO=null;static HO=null;static VO=new h.fe(1e3,null);KO=new h.fe(10,null);XO=0;loopEnd=0;static yu=t=>{const i=new r.A(t.read('sounds.dat'));for(this.YO=new Uint8Array(441e3),this.HO=new r.A(this.YO),n.init();;){const t=i.mu;if(65535===t)break;const e=new o;e.read(i),this.VO[t]=e,this.GO[t]=e.trim()}};static UO=(t,i)=>{if(!this.VO[t])return null;const e=this.VO[t];return e?.jO(i)??null};read(t){for(let i=0;i<10;i++)0!==t.pu&&(t.pf--,this.KO[i]=new n,this.KO[i]?.read(t));this.XO=t.mu,this.loopEnd=t.mu}trim(){let t=9999999;for(let i=0;i<10;i++)this.KO[i]&&(this.KO[i].start/20|0)i&&(i=this.KO[t].length+this.KO[t].start);if(0===i)return 0;let e=22050*i/1e3|0,s=22050*this.XO/1e3|0,n=22050*this.loopEnd/1e3|0;(s<0||n<0||n>e||s>=n)&&(t=0);let r=e+(n-s)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){s+=44,n+=44,e+=44,r+=44;const i=r-e;for(let t=e-1;t>=n;t--)o.YO&&(o.YO[t+i]=o.YO[t]);for(let i=1;i{e.d(i,{aA:()=>l,oA:()=>o,fe:()=>s,LA:()=>n,Eh:()=>r,TA:()=>h,Xr:()=>a});class s extends Array{constructor(t,i){super(t);for(let e=0;e{e.d(i,{pO:()=>o,Jo:()=>n,mO:()=>h,$o:()=>s,ec:()=>r,AO:()=>a});const s=async t=>new Promise((i=>setTimeout(i,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),r=async t=>(await fetch(t)).text();function h(t){let i=0n;for(let e=0;e0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function a(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}},7953:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static zO=new Uint16Array(['d','o','t'].join('').split('').map((t=>t.charCodeAt(0))));static ZO=new Uint16Array(['(','a',')'].join('').split('').map((t=>t.charCodeAt(0))));static qO=new Uint16Array(['s','l','a','s','h'].join('').split('').map((t=>t.charCodeAt(0))));static JO=['cook',"cook's",'cooks','seeks','sheet'];static $O=[];static QO=[];static tR=[];static iR=[];static eR=[];static sR=[];static yu=t=>{const i=new s.A(t.read('fragmentsenc.txt')),e=new s.A(t.read('badenc.txt')),n=new s.A(t.read('domainenc.txt')),r=new s.A(t.read('tldlist.txt'));this.read(e,n,i,r)};static filter=t=>{const i=[...t];this.format(i);const e=i.join('').trim(),s=e.toLowerCase(),n=[...s];this.nR(n),this.rR(n),this.hR(n),this.oR(n);for(let t=0;t{this.cR(t),this.fR(i),this.uR(e),this.dR(s)};static dR=t=>{const i=t.ia;for(let e=0;et.pu))};static cR=t=>{const i=t.ia;for(let e=0;et.pu));const i=new Array(t.pu).fill([]).map((()=>[t.Dd,t.Dd]));i.length>0&&(this.iR[e]=i)}};static fR=t=>{const i=t.ia;for(let e=0;et.pu))};static uR=t=>{const i=t.ia;for(let e=0;e{const i=[...t],e=[...t];this.wR(null,i,this.zO),this.wR(null,e,this.qO);for(let s=0;s{for(let i=0;i<2;i++)for(let i=this.tR.length-1;i>=0;i--)this.wR(this.iR[i],t,this.tR[i])};static hR=t=>{const i=[...t],e=[...t];this.wR(null,i,this.ZO),this.wR(null,e,this.zO);for(let s=this.eR.length-1;s>=0;s--)this.mR(e,i,this.eR[s],t)};static oR=t=>{for(let i=0;i=0&&n{if(this.ER(t))return!0;const i=this.vR(t),e=this.sR,s=e.length;if(i===e[0]||i===e[s-1])return!0;let n=0,r=s-1;for(;n<=r;){const t=(n+r)/2|0;if(i===e[t])return!0;i{if(t.length>6)return 0;let i=0;for(let e=0;e{for(let e=i;e=0;e++)if(this.TR(t[e]))return e;return-1};static _R=(t,i)=>{for(let e=t;e=0;e++)if(!this.TR(i[e]))return e;return i.length};static OR=(t,i,e)=>i===e||'o'===i&&'0'===e?1:'o'===i&&'('===e&&')'===t?2:'c'!==i||'('!==e&&'<'!==e&&'['!==e?'e'===i&&'€'===e||'s'===i&&'$'===e||'l'===i&&'i'===e?1:0:1;static mR=(t,i,e,s)=>{const n=e.length,r=s.length;for(let h=0;h<=r-n;h++){const{RR:n,SR:r}=this.LR(h,e,s);if(!n)continue;const o=this.xR(h,s,3,i,['@']),a=this.kR(r-1,s,3,t,['.',',']);(o>2||a>2)&&this.IR(h,r,s)}};static LR=(t,i,e)=>{const s=i.length;let n=t,r=0;for(;n0)n+=a,r++;else{if(0===r)break;const e=this.OR(o,String.fromCharCode(i[r-1]),h);if(e>0)n+=e,1===r&&t++;else{if(r>=s||!this.pR(h))break;n++}}}return{RR:r>=s,SR:n}};static wR=(t,i,e)=>{if(!(e.length>i.length))for(let s=0;s<=i.length-e.length;s++){let n=s;const{SR:r,MR:h,DR:o,NR:a,FR:l}=this.BR(i,e,n);n=r;let c=i[n],f=n+1=e.length)||a&&l)continue;let u,d=!0;if(o){let t=!1,e=!1;if((s-1<0||this.pR(i[s-1])&&"'"!==i[s-1])&&(t=!0),(n>=i.length||this.pR(i[n])&&"'"!==i[n])&&(e=!0),!t||!e){let e=!1;for(u=s-2,t&&(u=s);!e&&u=0&&(!this.pR(i[u])||"'"===i[u])){const t=[];let s;for(s=0;s<3&&u+s=0&&(!this.pR(i[u-1])||"'"===i[u-1])&&(n=!1),n&&!this.CR(t)&&(e=!0)}u++}e||(d=!1)}}else{c=' ',s-1>=0&&(c=i[s-1]),f=' ',n{let s=e,n=0,r=0,h=!1,o=!1,a=!1;for(;s=t.length||o&&a);){const l=t[s],c=s+10)1===f&&this.TR(l)&&(o=!0),2===f&&(this.TR(l)||this.TR(c))&&(o=!0),s+=f,n++;else{if(0===n)break;let t;if((t=this.GR(c,String.fromCharCode(i[n-1]),l))>0)s+=t;else{if(n>=i.length||!this.gR(l))break;if(this.pR(l)&&"'"!==l&&(h=!0),this.TR(l)&&(a=!0),s++,r++,(100*r/(s-e)|0)>90)break}}}return{SR:s,MR:n,DR:h,NR:o,FR:a}};static GR=(t,i,e)=>{if(i===e)return 1;if(i>='a'&&i<='m'){if('a'===i)return'4'!==e&&'@'!==e&&'^'!==e?'/'===e&&'\\'===t?2:0:1;if('b'===i)return'6'!==e&&'8'!==e?'1'===e&&'3'===t?2:0:1;if('c'===i)return'('!==e&&'<'!==e&&'{'!==e&&'['!==e?0:1;if('d'===i)return'['===e&&')'===t?2:0;if('e'===i)return'3'!==e&&'€'!==e?0:1;if('f'===i)return'p'===e&&'h'===t?2:'£'===e?1:0;if('g'===i)return'9'!==e&&'6'!==e?0:1;if('h'===i)return'#'===e?1:0;if('i'===i)return'y'!==e&&'l'!==e&&'j'!==e&&'1'!==e&&'!'!==e&&':'!==e&&';'!==e&&'|'!==e?0:1;if('j'===i)return 0;if('k'===i)return 0;if('l'===i)return'1'!==e&&'|'!==e&&'i'!==e?0:1;if('m'===i)return 0}if(i>='n'&&i<='z'){if('n'===i)return 0;if('o'===i)return'0'!==e&&'*'!==e?'('===e&&')'===t||'['===e&&']'===t||'{'===e&&'}'===t||'<'===e&&'>'===t?2:0:1;if('p'===i)return 0;if('q'===i)return 0;if('r'===i)return 0;if('s'===i)return'5'!==e&&'z'!==e&&'$'!==e&&'2'!==e?0:1;if('t'===i)return'7'!==e&&'+'!==e?0:1;if('u'===i)return'v'===e?1:'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('v'===i)return'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('w'===i)return'v'===e&&'v'===t?2:0;if('x'===i)return')'===e&&'('===t||'}'===e&&'{'===t||']'===e&&'['===t||'>'===e&&'<'===t?2:0;if('y'===i)return 0;if('z'===i)return 0}return i>='0'&&i<='9'?'0'===i?'o'===e||'O'===e?1:'('===e&&')'===t||'{'===e&&'}'===t||'['===e&&']'===t?2:0:'1'===i&&'l'===e?1:0:','===i?'.'===e?1:0:'.'===i?','===e?1:0:'!'===i&&'i'===e?1:0};static UR=(t,i,e)=>{let s=0,n=i.length-1;for(;s<=n;){const r=(s+n)/2|0;if(i[r][0]===t&&i[r][1]===e)return!0;tthis.bR(t)?t.charCodeAt(0)+1-'a'.charCodeAt(0):"'"===t?28:this.TR(t)?t.charCodeAt(0)+29-'0'.charCodeAt(0):27;static yR=(t,i,e,s,n)=>{if(!(s.length>e.length))for(let r=0;r<=e.length-s.length;r++){const{SR:h,YR:o}=this.HR(e,s,r);if(o0&&c>0&&(a=!0),2===i&&(l>2&&c>0||l>0&&c>2)&&(a=!0),3===i&&l>0&&c>2&&(a=!0),!a)continue;let f,u=r,d=h-1,w=!1;if(l>2){if(4===l)for(w=!1,f=r-1;f>=0;f--)if(w){if('*'!==n[f])break;u=f}else'*'===n[f]&&(u=f,w=!0);for(w=!1,f=u-1;f>=0;f--)if(w){if(this.pR(e[f]))break;u=f}else this.pR(e[f])||(w=!0,u=f)}if(c>2){if(4===c)for(w=!1,f=d+1;f{let s=0;for(;e0)e+=h,s++;else{if(0===s)break;let t;if((t=this.OR(r,String.fromCharCode(i[s-1]),n))>0)e+=t;else{if(!this.pR(n))break;e++}}}return{SR:e,YR:s}};static pR=t=>!this.WR(t)&&!this.TR(t);static gR=t=>!this.bR(t)||('v'===t||'x'===t||'j'===t||'q'===t||'z'===t);static WR=t=>this.bR(t)||this.VR(t);static TR=t=>t>='0'&&t<='9';static bR=t=>t>='a'&&t<='z';static VR=t=>t>='A'&&t<='Z';static ER=t=>{for(let i=0;i{for(let s=t;s{let e=0;for(let s=i-1;s>=0&&this.pR(t[s]);s--)'*'===t[s]&&e++;return e};static XR=(t,i)=>{let e=0;for(let s=i+1;s(n?this.KR(i,e):this.XR(i,e))>=s?4:this.pR(n?t[e-1]:t[e+1])?1:0;static xR=(t,i,e,s,n)=>{if(0===t)return 2;for(let e=t-1;e>=0&&this.pR(i[e]);e--)if(n.includes(i[e]))return 3;return this.jR(i,s,t,e,!0)};static kR=(t,i,e,s,n)=>{if(t+1===i.length)return 2;for(let e=t+1;e{let i=0;for(let e=0;et>=' '&&t<=''||' '===t||'\n'===t||'\t'===t||'£'===t||'€'===t;static aR=(t,i)=>{for(let e=0;e{let i=!0;for(let e=0;e{e.a(t,(async(t,i)=>{try{var s=e(7046),n=e(1312),r=e(5637),h=e(2164),o=e(1302),a=e(6948),l=e(8317),c=e(8738),f=e(3764),u=e(1120),d=e(4583),w=e(2682),y=e(8665),m=e(8534),A=e(6730),p=e(7953),g=e(9234),I=e(8950),_=e(1069),C=e(3937),E=e(4544),v=e(1908),b=e(9298),T=e(1651),O=e(7604);class t extends T.K{ZR=0;qR=!0;VA=0;KA=0;XA=0;JR=0;$R=0;QR=2;model={id:parseInt(s.A.getParameter('model'))||0,x:0,y:0,z:420,$g:0};constructor(){super(!0)}load=async()=>{await this.qo(10,'Connecting to fileserver'),await v.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new E.A(await E.A.openDatabase());const t=new _.A(new Uint8Array(await(0,g.Jo)(`${T.K.nt}/crc`))),i=[];for(let e=0;e<9;e++)i[e]=t.ia;const e=await this.jo('title','title screen',i[1],10);this.di=w.A.xu(e,'p11'),this.wi=w.A.xu(e,'p12'),this.yi=w.A.xu(e,'b12'),this.mi=w.A.xu(e,'q8');const s=await this.jo('config','config',i[2],15),I=await this.jo('interface','interface',i[3],20),b=await this.jo('media','2d graphics',i[4],30),O=await this.jo('models','3d graphics',i[5],40),R=await this.jo('textures','textures',i[6],60),S=await this.jo('wordenc','chat system',i[7],65),L=await this.jo('sounds','sound effects',i[8],70);await this.qo(75,'Unpacking media'),await this.qo(80,'Unpacking textures'),d.A.Ev(R),d.A.Tv(.8),d.A.Rv(20),await this.qo(83,'Unpacking models'),y.A.yu(O),m.A.yu(O),A.A.yu(O),await this.qo(86,'Unpacking config'),n.A.yu(s),r.A.yu(s),h.A.yu(s),o.A.yu(s,!0),a.A.yu(s),l.A.yu(s),c.A.yu(s),f.A.yu(s),await this.qo(90,'Unpacking sounds'),C.A.yu(L),await this.qo(92,'Unpacking interfaces'),u.A.yu(I,b,[this.di,this.wi,this.yi,this.mi]),await this.qo(97,'Preparing game engine'),p.A.yu(S),this.Fo?.bind(),d.A.Fc()};update=async()=>{this.tS(),this.iS(),this.ZR++,this.ZR>50&&(this.qR&&(s.A.setParameter('model',this.model.id.toString()),this.qR=!1),this.ZR=0)};draw=async()=>{I.A.clear(),I.A.fillRect(0,0,this.width,this.height,5592405);const t=y.A.model(this.model.id);if(t.Hl(64,850,-30,-50,-30,!0),t.draw(this.model.$g,d.A.sin[this.JR],d.A.cos[this.JR],d.A.sin[this.$R],d.A.cos[this.$R],this.model.x-this.VA,this.model.y-this.KA,this.model.z-this.XA,0),this.yi){this.yi.kT(this.width,this.yi.height,`FPS: ${this.lc}`,b.A.qa);let t=this.yi.height;this.yi.ja(0,t,`Model: ${this.model.id}`,b.A.qa),t+=this.yi.height,this.yi.ja(0,t,'Controls:',b.A.qa),t+=this.yi.height,this.yi.ja(0,t,'r - reset camera and model rotation + movement speed',b.A.qa),t+=this.yi.height,this.yi.ja(0,t,'1 and 2 - change model',b.A.qa),t+=this.yi.height,this.yi.ja(0,t,'[ and ] - adjust movement speed',b.A.qa),t+=this.yi.height,this.yi.ja(0,t,'left and right - adjust model yaw',b.A.qa),t+=this.yi.height,this.yi.ja(0,t,'up and down - adjust model pitch',b.A.qa),t+=this.yi.height,this.yi.ja(0,t,'. and / - adjust model roll',b.A.qa),t+=this.yi.height,this.yi.ja(0,t,'w and s - move camera along z axis',b.A.qa),t+=this.yi.height,this.yi.ja(0,t,'a and d - move camera along x axis',b.A.qa),t+=this.yi.height,this.yi.ja(0,t,'q and e - move camera along y axis',b.A.qa)}this.Fo?.draw(0,0)};tS(){for(;;){const t=this.Wc();if(-1===t)break;t==='r'.charCodeAt(0)?(this.QR=2,this.qR=!0):t==='1'.charCodeAt(0)?(this.model.id--,this.model.id<0&&y.A.metadata&&(this.model.id=y.A.metadata.length-100-1),this.qR=!0):t==='2'.charCodeAt(0)&&(this.model.id++,y.A.metadata&&this.model.id>=y.A.metadata.length-100&&(this.model.id=0),this.qR=!0)}}iS(){this.Cc['['.charCodeAt(0)]?this.QR--:this.Cc[']'.charCodeAt(0)]&&this.QR++,this.Cc[1]?(this.model.$g+=this.QR,this.qR=!0):this.Cc[2]&&(this.model.$g-=this.QR,this.qR=!0),this.Cc['w'.charCodeAt(0)]?(this.model.z-=this.QR,this.qR=!0):this.Cc['s'.charCodeAt(0)]&&(this.model.z+=this.QR,this.qR=!0),this.Cc['a'.charCodeAt(0)]?(this.model.x-=this.QR,this.qR=!0):this.Cc['d'.charCodeAt(0)]&&(this.model.x+=this.QR,this.qR=!0),this.Cc['q'.charCodeAt(0)]?(this.model.y+=this.QR,this.qR=!0):this.Cc['e'.charCodeAt(0)]&&(this.model.y-=this.QR,this.qR=!0),this.JR=2047&this.JR,this.$R=2047&this.$R,this.model.$g=2047&this.model.$g}}await(0,O.w)(),(new t).run().then((()=>{})),i()}catch(t){i(t)}}),1)},1908:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(9763);class n{static eS=null;static load=async t=>{this.eS=await(0,s.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,e,s)=>{if(!this.eS)throw new Error('bz2 not found!!');return Int8Array.from(this.eS.read(t,i,e,s))}}},123:(t,i,e)=>{function s(t,i,e){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256,e)}function n(t){window._tinyMidiStop&&window._tinyMidiStop(t)}e.d(i,{ea:()=>s,ko:()=>n})},2604:(t,i,e)=>{function s(t,i){var e;(e=document.createElement('a')).href=t,e.download=i,document.body.appendChild(e),e.style='display: none',e.click(),e.remove()}e.d(i,{A:()=>s})},9763:(t,i,e)=>{async function s(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,a=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,a,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(a),a}(a,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(l,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function a(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function l(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}e.d(i,{F:()=>s})},9896:(t,i,e)=>{var s=e(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{const t=2,i=44100;let e=new Float32Array,n=window.audioContext.createGain();n.gain.value=.1,n.connect(window.audioContext.destination);let r=window.audioContext.currentTime,h=[];const o=new s.A({sS:30,nS:t=>{let i=new Float32Array(t.buffer),s=new Float32Array(e.length+i.length);s.set(e,0),s.set(i,e.length),e=s},rS:t=>{},bufferSize:102400});await o.init();const a=await fetch('./SCC1_Florestan.sf2'),l=new Uint8Array(await a.arrayBuffer());function c(){if(!window.audioContext||!e.length)return;let s=window.audioContext.createBufferSource();const o=e.length/t,a=window.audioContext.createBuffer(t,o,i);for(let i=0;i{t.stop(window.audioContext.currentTime)})),h=[],n.gain.value=t}}function d(t,i){-1!==t&&window._tinyMidiVolume(t),r=window.audioContext.currentTime,f=setInterval(c,250),o.hS(i)}o.oS(l),window._tinyMidiStop=async t=>{t?function(t,i){const e=window.audioContext.currentTime;n.gain.cancelScheduledValues(e),n.gain.setValueAtTime(n.gain.value,e),n.gain.linearRampToValueAtTime(t,e+2),setTimeout(i,2e3)}(0,(()=>{u()})):u()},window._tinyMidiVolume=(t=1)=>{n.gain.value=t},window._tinyMidiPlay=async(t,i,e)=>{t&&(await window._tinyMidiStop(e),e?setTimeout((()=>{d(i,t)}),2e3):d(i,t))}})()},8151:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5473);const n=class{constructor(t={}){this.aS=void 0,this.lS=0,this.cS=0,this.fS=0,this.sS=t.sS||100,this.sampleRate=t.sampleRate||44100,this.uS=t.uS||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.dS(1),this.nS=t.nS||(()=>{}),this.rS=t.rS||(()=>{}),this.wS=void 0,this.test=0}async init(){if(!this.aS){if('undefined'!=typeof process){const{yS:t}=await import('path'),{mS:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.aS=await(0,s.A)(),this.AS=this.aS._malloc(this.bufferSize),this.pS=this.aS._malloc(8)}}dS(t){this.bufferSize=4*this.sampleRate*this.uS*t}gS(){if(!this.aS)throw new Error(`${this.constructor.name} not initalized. call .init()`)}oS(t){this.gS();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.aS;e(this.lS),this.lS=i(t.length),this.aS.HEAPU8.set(t,this.lS),this.cS=s(this.lS,t.length),n(this.cS,2===this.uS?0:2,this.sampleRate,this.gain)}IS(){this.gS();const t=new Uint8Array(this.bufferSize);return t.set(this.aS.HEAPU8.subarray(this.AS,this.AS+this.bufferSize)),t}_S(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.aS;return e(this.fS),this.fS=i(t.length),this.aS.HEAPU8.set(t,this.fS),s(this.fS,t.length)}CS(t){const{_midi_render:i}=this.aS;return i(this.cS,t,this.uS,this.sampleRate,this.AS,this.bufferSize,this.pS)}hS(t){if(this.gS(),!this.cS)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.wS);const{setValue:i,getValue:e}=this.aS;i(this.pS,0,'double'),this.aS._tsf_reset(this.cS),this.aS._tsf_channel_set_bank_preset(this.cS,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this._S(t);const n=()=>{s=this.CS(s);const t=this.IS();this.nS(t),s?this.wS=setTimeout(n,this.sS):this.rS(e(this.pS,'double'))};this.wS=setTimeout(n,16)}}},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,e)=>{var s;e.d(i,{A:()=>n});const n=(s="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,n,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,e){i=t,n=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(r.ready,t)||Object.defineProperty(r.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var h=Object.assign({},r),o=[],a='object'==typeof window,l='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!a&&!c&&!l;if(r.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var m,A;y=l?require('path').yS(y)+'/':__dirname+'/';var p=()=>{A||(m=require('fs'),A=require('path'))};u=(t,i)=>(p(),t=A.normalize(t),m.ES(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,e)=>{p(),t=A.normalize(t),m.vS(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),r.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,e){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!a&&!l)throw new Error('environment detection error');if(l?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),s&&(y=s),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},l&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}r.print||console.log.bind(console);var g,I,_=r.printErr||console.warn.bind(console);function C(t,i){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(r,h),h=null,g='fetchSettings',Object.getOwnPropertyDescriptor(r,g)&&j('`Module.'+g+'` was supplied but `'+g+'` not included in INCOMING_MODULE_JS_API'),r.arguments&&(o=r.arguments),C('arguments','arguments_'),r.thisProgram&&r.thisProgram,C('thisProgram','thisProgram'),r.quit&&r.quit,C('quit','quit_'),D(void 0===r.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===r.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===r.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===r.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===r.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),r.wasmBinary&&(I=r.wasmBinary),C('wasmBinary','wasmBinary');var v;r.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,O,R,S,L,x,k,M=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function N(t){b=t,r.HEAP8=T=new Int8Array(t),r.HEAP16=R=new Int16Array(t),r.HEAP32=S=new Int32Array(t),r.HEAPU8=O=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=L=new Uint32Array(t),r.HEAPF32=x=new Float32Array(t),r.HEAPF64=k=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var F=5242880;r.TOTAL_STACK&&D(F===r.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=r.INITIAL_MEMORY||16777216;function P(){if(!M){var t=ft(),i=L[t>>2],e=L[t+4>>2];34821223==i&&2310721022==e||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==L[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=F,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+F+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!r.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var U=[],W=[],G=[],Y=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var H=0,V=null,K=null,X={};function j(t){r.onAbort&&r.onAbort(t),_(t='Aborted('+t+')'),M=!0;var i=new WebAssembly.RuntimeError(t);throw n(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},bS:function(){z.error()},TS:function(){z.error()},OS:function(){z.error()},open:function(){z.error()},RS:function(){z.error()},SS:function(){z.error()},LS:function(){z.error()},xS:function(){z.error()},kS:function(){z.error()}};r.FS_createDataFile=z.bS,r.FS_createPreloadedFile=z.TS;var Z,q,J,$,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=r.asm),D(Y,'native function `'+e+'` called before runtime initialization'),s[t]||D(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==Z&&I)return new Uint8Array(I);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(r)}function ht(t){ht.MS||(ht.MS={}),ht.MS[t]||(ht.MS[t]=1,c&&(t='warning: '+t),_(t))}function ot(t){try{return v.grow(t-b.byteLength+65535>>>16),N(v.buffer),1}catch(i){_('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}r.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=r.locateFile?r.locateFile(q,y):y+q):Z=new URL(e(8227),e.b).toString();var at,lt={"emscripten_memcpy_big":function(t,i,e){O.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=O.length;D((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return _('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return _('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':lt,'wasi_snapshot_preview1':lt};function e(t,i){var e,s=t.exports;r.asm=s,D(v=r.asm.memory,"memory not found in wasm exports"),N(v.buffer),D(r.asm.__indirect_function_table,"table not found in wasm exports"),e=r.asm.__wasm_call_ctors,W.unshift(e),function(t){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(X[t]),delete X[t]):_('warning: run dependency removed without ID'),0==H&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',H++,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(M)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,_('still waiting on run dependencies:')),_('dependency: '+i);t&&_('(end of list)')}),1e4))):_('warning: run dependency added without ID');var s=r;function h(t){D(r===s,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),s=null,e(t.instance)}function o(t){return function(){if(!I&&(a||l)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return st(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){_('failed to asynchronously prepare wasm: '+t),it(Z)&&_('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(r.instantiateWasm)try{return r.instantiateWasm(i,e)}catch(t){_('Module.instantiateWasm callback failed with error: '+t),n(t)}(I||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(h):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return _('wasm streaming compile failed: '+t),_('falling back to ArrayBuffer instantiation'),o(h)}))}))).catch(n)}(),r.___wasm_call_ctors=et("__wasm_call_ctors"),r._malloc=et("malloc"),r._free=et("free"),r._tsf_load_memory=et("tsf_load_memory"),r._tsf_close=et("tsf_close"),r._tsf_reset=et("tsf_reset"),r._tsf_set_output=et("tsf_set_output"),r._tsf_set_max_voices=et("tsf_set_max_voices"),r._realloc=et("realloc"),r._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),r._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),r._tml_load_memory=et("tml_load_memory"),r._midi_render=et("midi_render"),r.___errno_location=et("__errno_location"),r._fflush=et("fflush"),r._emscripten_stack_init=function(){return(ct=r._emscripten_stack_init=r.asm.emscripten_stack_init).apply(null,arguments)}),ft=(r._emscripten_stack_get_free=function(){return(r._emscripten_stack_get_free=r.asm.emscripten_stack_get_free).apply(null,arguments)},r._emscripten_stack_get_base=function(){return(r._emscripten_stack_get_base=r.asm.emscripten_stack_get_base).apply(null,arguments)},r._emscripten_stack_get_end=function(){return(ft=r._emscripten_stack_get_end=r.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),L[t>>2]=34821223,L[t+4>>2]=2310721022,L[0]=1668509029}function dt(t){function e(){at||(at=!0,r.calledRun=!0,M||(D(!Y),Y=!0,P(),rt(W),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),D(!r._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(P(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),G.unshift(t);var t;rt(G)}()))}t=t||o,H>0||(ut(),function(){if(r.preRun)for('function'==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),U.unshift(t);var t;rt(U)}(),H>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),e()}),1)):e(),P()))}if(r.stackSave=et("stackSave"),r.stackRestore=et("stackRestore"),r.stackAlloc=et("stackAlloc"),r.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':T[0|t]=i;break;case'i16':R[t>>1]=i;break;case'i32':S[t>>2]=i;break;case'i64':$=[i>>>0,(J=i,+Math.abs(J)>=1?J>0?(0|Math.min(+Math.floor(J/4294967296),4294967295))>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],S[t>>2]=$[0],S[t+4>>2]=$[1];break;case'float':x[t>>2]=i;break;case'double':k[t>>3]=i;break;case'*':L[t>>2]=i;break;default:j('invalid type for setValue: '+e)}},r.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return T[0|t];case'i16':return R[t>>1];case'i32':case'i64':return S[t>>2];case'float':return x[t>>2];case'double':return k[t>>3];case'*':return L[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),K=function t(){at||dt(),at||(K=t)},r.preInit)for('function'==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return dt(),t.ready})}},r={};function h(t){var i=r[t];if(void 0!==i)return i.exports;var e=r[t]={exports:{}};return n[t](e,e.exports,h),e.exports}h.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",e="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",s=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},h.a=(n,r,h)=>{var o;h&&((o=[]).d=-1);var a,l,c,f=new Set,u=n.exports,d=new Promise(((t,i)=>{c=i,l=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,r((n=>{var r;a=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var r=[];r.d=0,n.then((t=>{h[i]=t,s(r)}),(t=>{h[e]=t,s(r)}));var h={};return h[t]=t=>t(r),h}}var o={};return o[t]=t=>{},o[i]=n,o})))(n);var h=()=>a.map((t=>{if(t[e])throw t[e];return t[i]})),l=new Promise((i=>{(r=()=>i(h)).r=0;var e=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(r.r++,t.push(r)));a.map((i=>i[t](e)))}));return r.r?l:h()}),(t=>(t?c(d[e]=t):l(u),s(o)))),o&&o.d<0&&(o.d=0)},h.d=(t,i)=>{for(var e in i)h.o(i,e)&&!h.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},h.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),h.p="/Client2/",h.b=document.baseURI||self.location.href;h(8073)})(); \ No newline at end of file +(()=>{"use strict";var t,i,e,s,n={1651:(t,i,e)=>{e.d(i,{K:()=>D});var s=e(1120),n=e(4583),r=e(2901),h=e(1069),o=e(7046),a=(e(9896),e(6666)),l=e(3045),c=e(818),f=e(670),u=e(8268),d=e(3867),w=e(7854),y=e(8950),m=e(1302),A=e(9298),p=e(8665),g=e(1312),I=e(3819),_=e(8317),C=e(9234),E=e(1908),v=e(123),b=e(5637),T=e(6948),O=e(2164),R=e(8738),S=e(3764),L=e(8534),x=e(6730),k=e(2604),M=e(5226);class D extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static et=!1;static st='';static nt='';static rt=!1;static ht=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static gt=0;static It=0;static _t=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Ot=0;static Rt=()=>{l.A.et=!1,n.A.et=!1,D.et=!1,c.A.et=!1};static St=()=>{l.A.et=!0,n.A.et=!0,D.et=!0,c.A.et=!0};Lt=2048;xt=2047;kt=!1;Mt=!1;Dt=!1;Nt=!1;db=null;Ft=0;Bt=[];stream=null;in=h.A.Pt(1);Ut=h.A.Pt(1);Wt=h.A.Pt(1);Gt=0n;Yt=0;Ht=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;Jt=!0;$t=0;Qt=0;ti=null;ii=null;ei=null;si=null;ni=null;ri=null;hi=null;oi=null;ai=null;li=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;mi=null;Ai=[];pi=!1;gi=null;Ii=null;_i=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Oi=null;Ri=null;Si=new Int32Array(256);Li=0;xi=0;ki=0;Mi=null;Di=null;Ni=null;Fi=null;Bi=null;Pi=null;Ui=null;Wi=null;Gi=null;Yi=null;Hi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;Ji=null;$i=null;Qi=null;te=new Int32Array(33);ie=new Int32Array(33);ee=new Int32Array(151);se=new Int32Array(151);ne=null;re=null;he=null;oe=null;ae=null;le=null;ce=new d.fe(13,null);ue=null;de=null;we=new d.fe(50,null);ye=new d.fe(50,null);me=new d.fe(20,null);Ae=new d.fe(20,null);pe=null;ge=new d.fe(8,null);Ie=null;_e=null;Ce=null;Ee=null;ve=null;be=null;Te=null;Oe=null;Re=null;Se=null;Le=null;xe=null;ke=null;Me=null;De=null;Ne=null;Fe=null;Be=null;Pe=new d.fe(1e3,null);Ue=!1;We=!1;Ge=!1;Ye=!1;He=-1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=!1;Je=0;$e=0;Qe=0;ts=0;es=0;ss=0;ns=[];rs=-1;hs=-1;os=new s.A;ls=78;cs=0;fs=0;us=[];ds=0;ws=0;ys=0;As=0;ps=0;gs=0;Is=0;_s=0;Cs=[];Es=[];vs=[];bs=[];Ts=null;Os=-1;Rs=3;Ss=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Ls=0;xs=0;ks=0;Ms=!1;Ds=0;Ns=!1;Fs='';Bs='';Ps=0;Us='';Ws=!1;Gs=-1;Ys=new d.fe(100,null);Hs=new d.fe(100,null);messageType=new Int32Array(100);Vs=new Int32Array(100);Ks=0;Xs=0;js=0;zs='';Zs=0;qs=0;Js=0;$s=0;Qs=0;tn=0;en=0;sn=0;nn=0;rn=!1;hn=0;an=0;ln=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;mn=!1;An=[];pn=[];gn=0;In=0;_n=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);On=new Int32Array(500);Rn=0;Sn=0;Ln=0;xn='';kn=!1;Mn=-1;Dn=0;Nn=0;Fn=0;Bn=0;Pn=0;Un=new Int32Array(1e3);Wn=new Int32Array(1e3);Gn=null;Yn=0;Hn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;Jn=0;$n=2;Qn=2;tr=1;ir=new Int32Array(5);er=new d.fe(5,!1);sr=new Int32Array(5);nr=new Int32Array(5);rr=new Int32Array(5);hr=0;ar=0;lr=0;cr=0;ur=0;dr=0;wr=0;yr=0;mr=0;Ar=1;pr=2;gr=-1;Ir=0;_r=0;Cr=0;Er=0;vr=0;br=0;Tr=null;Or=null;Rr=null;Sr=0;Lr=0;kr=new Int8Array(16384);Mr=new d.fe(f.A.Dr,null);Nr=0;Fr=0;Br=128;Pr=0;Ur=0;Wr=0;Gr=0;Yr=0;Hr=null;Vr=null;Kr=new d.Xr(f.A.jr,f.A.jr);zr=0;Zr=0;qr=0;Jr=0;$r=0;Qr=0;th=0;ih=0;eh=0;sh=0;nh=0;rh=0;hh=new d.fe(this.Lt,null);oh=0;ah=new Int32Array(this.Lt);lh=0;fh=0;uh=new Int32Array(this.Lt);dh=new Int32Array(1e3);wh=new d.fe(this.Lt,null);yh=new d.fe(8192,null);mh=0;Ah=new Int32Array(8192);ph=new a.A;gh=new a.A;Ih=new a.A;_h=new a.A;Ch=new d.Eh(f.A.Dr,f.A.jr,f.A.jr,null);bh=new a.A;Th=new Int32Array(4e3);Oh=new Int32Array(4e3);Rh=new Int32Array(f.A.jr*f.A.jr);Sh=new Int32Array(f.A.jr*f.A.jr);Lh=0;xh=null;kh=0;Mh=0;Dh=-1;Nh=0;Fh=0;Bh=0;Ph=0;Uh=!1;Wh=!0;Gh=!1;Yh=new Int32Array(7);Hh=new Int32Array(5);Vh=0;Kh=0;static Xh=50;jh=new Int32Array(D.Xh);zh=new Int32Array(D.Xh);Zh=new Int32Array(D.Xh);qh=new Int32Array(D.Xh);Jh=new Int32Array(D.Xh);$h=new Int32Array(D.Xh);Qh=new Int32Array(D.Xh);io=new d.fe(D.Xh,null);eo=new d.fe(100,null);so=new BigInt64Array(100);no=new Int32Array(100);ro=null;ho=0;oo=!0;ao=new Int32Array(50);lo=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;mo=0;Ao=!0;po=null;Io=0;_o=0;Co=192;Eo=void 0;vo=!1;host=null;bo=null;To=new d.fe(16,null);Oo=0;Ro=!1;So=()=>{try{this.stream&&this.stream.close()}catch(t){}this.bo&&'998'===D.getParameter('world')&&this.bo.Lo?.send(JSON.stringify({type:'close',id:this.bo.xo})),this.stream=null,(0,v.ko)(!1),this.Ut=null,this.Wt=null,this.in=null,this.Rr=null,this.Tr=null,this.Or=null,this.Hr=null,this.Vr=null,this.Gn=null,this.Mr=null,this.Rh=null,this.Sh=null,this.Th=null,this.Oh=null,this.kr=null,this.Di=null,this.Ni=null,this.Fi=null,this.Bi=null,this.Pi=null,this.Ui=null,this.Wi=null,this.Gi=null,this.Yi=null,this.Hi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.ne=null,this.he=null,this.re=null,this.oe=null,this.ae=null,this.le=null,this.ce=null,this.Te=null,this.Oe=null,this.Re=null,this.Se=null,this.Le=null,this.xe=null,this.ke=null,this.Me=null,this.De=null,this.Ne=null,this.de=null,this.me=null,this.Ae=null,this.ge=null,this.Ie=null,this._e=null,this.Ce=null,this.Ee=null,this.we=null,this.ye=null,this.Kr=null,this.hh=null,this.ah=null,this.uh=null,this.wh=null,this.dh=null,this.yh=null,this.Ah=null,this.Ch=null,this.bh=null,this._h=null,this.ph=null,this.gh=null,this.Ih=null,this.Tn=null,this.On=null,this.vn=null,this.bn=null,this.ns=null,this.An=null,this.Un=null,this.Wn=null,this.Pe=null,this.ue=null,this.eo=null,this.so=null,this.no=null,this.si=null,this.ni=null,this.ti=null,this.ii=null,this.ei=null,this.ri=null,this.hi=null,this.oi=null,this.ai=null,this.Mo(),b.A.So(),T.A.So(),m.A.So(),O.A.Do=null,_.A.Do=null,s.A.Do=null,g.A.Do=null,R.A.Do=null,R.A.No=null,S.A.Do=null,this.Fo=null,u.A.No=null,n.A.So(),l.A.So(),p.A.So(),L.A.Do=[],x.A.Do=[]};Bo(){return this.$t}Po(){return this.Ws}Uo(){return this.Ns}Wo(){return this.hs}Go(){return this.He}Mo=()=>{this.pi=!1,this.Mi&&(clearInterval(this.Mi),this.Mi=null),this.li=null,this.ci=null,this.Ai=[],this.bi=null,this.Ti=null,this.Oi=null,this.Ri=null,this.Ci=null,this._i=null,this.Ei=null,this.vi=null,this.gi=null,this.Ii=null};Yo=()=>{'999'===D.getParameter('world')?(this.Eo=new Worker('worker.js',{type:'module'}),this.Eo.onmessage=this.onmessage,this.host=new M.x(this.Eo)):'998'===D.getParameter('world')&&(this.Eo={onmessage:t=>{this.stream.Ho.onmessage(t)},postMessage:t=>{this.bo&&this.bo.Lo&&'open'===this.bo.Lo.readyState&&this.bo.Lo.send(JSON.stringify(t))},onerror:null,onmessageerror:null,terminate:()=>{throw new Error},addEventListener:()=>{throw new Error},removeEventListener:()=>{throw new Error},dispatchEvent:()=>{throw new Error}},this.bo=new M.Q(this.Eo))};onmessage=t=>{switch(t.data.type){case'ready':return void(this.vo=!0);case'save':return(0,k.A)(t.data.value,t.data.path.split('/').pop().split('\\').pop()),void URL.revokeObjectURL(t.data.value);case'close':return void this.Eo?.postMessage({type:'close',id:t.data.id})}this.host?.xo===t.data.id?this.stream.Ho.onmessage(t.data):this.host?.postMessage(t)};Vo=async()=>{if(999==+D.getParameter('world'))this.host&&await this.host.Ko();else if(998==+D.getParameter('world')&&this.bo){if(this.bo.Lo)return void console.log('You are already connected.');const t=prompt('Paste offer here, answer will be copied to clipboard');if(t)try{await this.bo.Xo(t)}catch(t){console.error(t)}}};jo=async(t,i,e,s)=>{let n=5,o=await(this.db?.zo(t));if(o&&h.A.Zo(o)!==e&&(o=void 0),o)return new r.A(o);for(;!o;){await this.qo(s,`Requesting ${i}`);try{o=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}${e}`):await(0,C.Jo)(`${D.nt}/${t}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.qo(s,`Error loading - Will retry in ${t} secs.`),await(0,C.$o)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Qo(t,o)),new r.A(o)};ta=async(t,i,e,s)=>{let n=await(this.db?.zo(t+'.mid'));if(n&&12345678!==i&&h.A.Zo(n)!==i&&(n=void 0),!n)try{n=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}_${i}.mid`):await(0,C.Jo)(`${D.nt}/songs/${t}.mid`),e!==n.length&&(n=n.slice(0,e))}catch(t){}if(!n)return;await(this.db?.Qo(t+'.mid',n));const r=new h.A(Uint8Array.from(n)).ia,o=E.A.read(r,n,e,4);(0,v.ea)(o,this.Co,s)};sa=()=>{if(w.na.fillStyle='black',w.na.fillRect(0,0,this.width,this.height),this.ra(1),this.Dt){this.pi=!1,w.na.font='bold 16px helvetica, sans-serif',w.na.textAlign='left',w.na.fillStyle='yellow';let t=35;w.na.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.na.fillStyle='white',w.na.fillText('To fix this try the following (in order):',30,t),t+=50,w.na.font='bold 12px helvetica, sans-serif',w.na.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.na.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.na.fillText('3: Try using a different game-world',30,t),t+=30,w.na.fillText('4: Try rebooting your computer',30,t),t+=30,w.na.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.pi=!1,w.na.font='bold 20px helvetica, sans-serif',w.na.textAlign='left',w.na.fillStyle='white',w.na.fillText('Error - unable to load game!',50,50),w.na.fillText('To play RuneScape make sure you play from',50,100),w.na.fillText('https://2004scape.org',50,150)),this.Mt){this.pi=!1,w.na.font='bold 13px helvetica, sans-serif',w.na.textAlign='left',w.na.fillStyle='yellow';let t=35;w.na.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.na.fillStyle='white',w.na.fillText('To fix this try the following (in order):',30,t),t+=50,w.na.font='bold 12px helvetica, sans-serif',w.na.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.na.fillText('2: Try rebooting your computer, and reloading',30,t)}};ha=t=>{if(!t.oa)return!1;for(let i=0;i=s)return!1}else if(3===t.oa[i]){if(e<=s)return!1}else if(4===t.oa[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};ca=(t,i,e,s,n)=>{this.ve?.draw(t,i),this.be?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,A.A.fa);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;y.A.fillRect(t,i+h+16,16,r,A.A.ua),y.A.da(t,i+h+16,A.A.wa,r),y.A.da(t+1,i+h+16,A.A.wa,r),y.A.ya(t,i+h+16,A.A.wa,16),y.A.ya(t,i+h+17,A.A.wa,16),y.A.da(t+15,i+h+16,A.A.ma,r),y.A.da(t+14,i+h+17,A.A.ma,r-1),y.A.ya(t,i+h+r+15,A.A.ma,16),y.A.ya(t+1,i+h+r+14,A.A.ma,15)};Aa=(t,i)=>{let e=!1;const n=s.A.Do[t];if(!n.pa)return!1;for(let t=0;ts.delay[r.Ca];)r._a-=s.delay[r.Ca]+1,r.Ca++,r.Ca>=s.Ea&&(r.Ca-=s.va,(r.Ca<0||r.Ca>=s.Ea)&&(r.Ca=0)),e=!0}}}return e};ba=(t,i,e,r,h=!1)=>{if(0!==t.type||!t.pa||t.hide&&this.Zs!==t.id&&this.qs!==t.id&&this.Js!==t.id)return;const o=y.A.left,a=y.A.top,l=y.A.right,c=y.A.bottom;y.A.Ta(i,e,i+t.width,e+t.height);const f=t.pa.length;for(let o=0;o0&&this.ka(c),c.type===s.A.Ma)c.Da>c.scroll-c.height&&(c.Da=c.scroll-c.height),c.Da<0&&(c.Da=0),this.ba(c,a,l,c.Da,h),c.scroll>c.height&&this.ca(a+c.width,l,c.Da,c.scroll,c.height);else if(c.type===s.A.Na){let t=0;for(let i=0;i0){let i=0,e=0;const r=c.Pa[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qs===t){const h=m.A.Ya(r,c.Ua[t]);if(0!==this.tn&&this.Qs===t&&this.$s===c.id?(i=this.Ha-this.en,e=this.Va-this.sn,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.nn<5&&(i=0,e=0),h.Ka(128,s+i,n+e)):0!==this.un&&this.dn===t&&this.wn===c.id?h.Ka(128,s,n):h.draw(s,n),33===h.Xa||1!==c.Ua[t]){const r=c.Ua[t];this.di?.ja(s+i+1,n+10+e,this.za(r),A.A.Za),this.di?.ja(s+i,n+9+e,this.za(r),A.A.qa)}}}else if(c.Ja&&t<20){const i=c.Ja[t];i?.draw(s,n)}t++}}else if(c.type===s.A.$a)c.fill?y.A.fillRect(a,l,c.width,c.height,c.Qa):y.A.Sa(a,l,c.width,c.height,c.Qa);else if(c.type===s.A.tl){const t=c.font;let i=c.Qa,e=c.text;if(this.Js!==c.id&&this.qs!==c.id&&this.Zs!==c.id||0===c.il||(i=c.il),this.ha(c)&&(i=c.el,c.sl&&c.sl.length>0&&(e=c.sl)),c.nl===s.A.rl&&this.mn&&(e='Please wait...',i=c.Qa),!t||!e)continue;for(let s=l+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.hl(this.aa(c,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),c.ol?t.al(a+(c.width/2|0),s,r,i,c.ll):t.cl(a,s,r,i,c.ll)}}else if(c.type===s.A.fl){let t;t=this.ha(c)?c.ul:c.dl,t?.draw(a,l)}else if(c.type===s.A.wl){const t=n.A.yl,i=n.A.ml;n.A.yl=a+(c.width/2|0),n.A.ml=l+(c.height/2|0);const e=n.A.sin[c.Al]*c.zoom>>16,s=n.A.cos[c.Al]*c.zoom>>16,r=this.ha(c);let h;h=r?c.Ia:c.ga;let o=null;if(-1===h)o=c.pl(-1,-1,r);else{const t=g.A.Do[h];t.frames&&t.gl&&(o=c.pl(t.frames[c.Ca],t.gl[c.Ca],r))}o&&o.Il(0,c._l,0,c.Al,0,e,s),n.A.yl=t,n.A.ml=i}else if(c.type===s.A.Cl){const t=c.font;if(!t||!c.Pa||!c.Ua)continue;let i=0;for(let e=0;e0){const n=m.A.get(c.Pa[i]-1);let r=n.name;if((n.El||1!==c.Ua[i])&&(r=r+' x'+this.vl(c.Ua[i])),!r)continue;const h=a+s*(c.Wa+115),o=l+e*(c.Ga+12);c.ol?t.al(h+(c.width/2|0),o,r,c.Qa,c.ll):t.cl(h,o,r,c.Qa,c.ll)}i++}}}y.A.Ta(o,a,l,c)};ka=t=>{let i=t.xa;if(i>=s.A.bl&&i<=s.A.Tl)i--,i>=this.Vh?(t.text='',t.nl=0):(t.text=this.eo[i],t.nl=1);else if(i>=s.A.Ol&&i<=s.A.Rl)i-=s.A.Ol,i>=this.Vh?(t.text='',t.nl=0):(0===this.no[i]?t.text='@red@Offline':this.no[i]===D.it?t.text='@gre@World-'+(this.no[i]-9):t.text='@yel@World-'+(this.no[i]-9),t.nl=1);else if(i===s.A.Sl)t.scroll=15*this.Vh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=s.A.Ll&&i<=s.A.xl)i-=s.A.Ll,i>=this.fs?(t.text='',t.nl=0):(t.text=I.A.kl(I.A.Ml(this.us[i])),t.nl=1);else if(i===s.A.Dl)t.scroll=15*this.fs+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===s.A.Nl){if(t.Al=150,t._l=256*Math.sin(this.Ft/40)&2047,this.Gh){this.Gh=!1;const i=new d.fe(7,null);let e=0;for(let t=0;t<7;t++){const s=this.Yh[t];s>=0&&(i[e++]=_.A.Do[s].pl())}const s=p.A.Fl(i,e);for(let t=0;t<5;t++)0!==this.Hh[t]&&(s.Bl(u.A.Pl[t][0],u.A.Pl[t][this.Hh[t]]),1===t&&s.Bl(u.A.Ul[0],u.A.Ul[this.Hh[t]]));if(this.xh){const i=g.A.Do[this.xh.Wl].frames;i&&(s.Gl(),s.Yl(i[0]),s.Hl(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===s.A.Vl)this.Fe||(this.Fe=t.dl,this.Be=t.ul),this.Wh?t.dl=this.Be:t.dl=this.Fe;else if(i===s.A.Kl)this.Fe||(this.Fe=t.dl,this.Be=t.ul),this.Wh?t.dl=this.Fe:t.dl=this.Be;else if(i===s.A.Xl)t.text=this.xn,this.Ft%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===s.A.jl)this.Uh?this.kn?(t.Qa=A.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Qa=A.A.La,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===s.A.zl||i===s.A.Zl)if(0===this.Dn)t.text='';else{let i;i=0===this.Nn?'earlier today':1===this.Nn?'yesterday':this.Nn+' days ago',t.text='You last logged in '+i+' from: '+I.A.ql(this.Dn)}else if(i===s.A.Jl)0===this.Bn&&(t.text='0 unread messages',t.Qa=A.A.qa),1===this.Bn&&(t.text='1 unread message',t.Qa=A.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Qa=A.A.GREEN);else if(i===s.A.$l)if(201===this.Fn)t.text='';else if(200===this.Fn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Fn?'Earlier today':1===this.Fn?'Yesterday':this.Fn+' days ago',t.text=i+' you changed your recovery questions'}else i===s.A.Ql?201===this.Fn?t.text='':200===this.Fn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===s.A.tc&&(201===this.Fn?t.text='':(this.Fn,t.text="Do this from the 'account management' area on our front webpage"))};aa=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let n=0,r=0;for(;;){const t=e[r++];if(0===t)return n;if(1===t)n+=this.Es[e[r++]];else if(2===t)n+=this.vs[e[r++]];else if(3===t)n+=this.Cs[e[r++]];else if(4===t){const t=s.A.Do[e[r++]],i=e[r++]+1;if(t.Pa&&t.Ua)for(let e=0;et<999999999?String(t):'*';vl=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};za=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,e)=>{e.d(i,{w:()=>h});var s=e(7046),n=e(1651),r=e(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');['0','998','999'].includes(s.A.getParameter('world'))?function(){if(+s.A.getParameter('world')>=998)return void(n.K.nt='data/pack/client');n.K.st='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0}():await async function(t){const i=await o(t,parseInt(s.A.getParameter('world'),10)),e=new URL(i.address);n.K.it=10+i.id-1,n.K.st=`${e.protocol}//${e.hostname}`,n.K.nt=`${e.protocol}//${e.hostname}:${e.port}`,t||(n.K.st=n.K.st.replace('https:','http:'));n.K.portOffset=i.portOffset,n.K.members=!0===i?.members,s.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===s.A.getParameter('detail').length&&s.A.setParameter('detail','high');'low'===s.A.getParameter('detail')?n.K.St():n.K.Rt()}(),0===s.A.getParameter('method').length&&s.A.setParameter('method','0')}async function o(t,i,e=0){if(e>=10)throw new Error('could not find world to connect!');const s=t?'https:':'http:';let n;try{n=JSON.parse(await(0,r.ec)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.$o)(1e3),o(t,i,++e)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hh:0});const h=n.find((t=>t.id===i));return h||o(t,i,10)}},7046:(t,i,e)=>{e.d(i,{A:()=>l});var s=e(1183),n=e(4583),r=e(9234),h=e(9091),o=e(2595),a=e(7854);class l{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}sc=0;nc=[];rc=0;Fo=null;state=0;hc=20;oc=1;ac=[];lc=0;cc=0;fc=[];uc=!0;dc=!1;wc=50;hasFocus=!0;yc=!1;mc=0;Ac=0;Ha=0;Va=0;gc=0;Ic=0;_c=0;Cc=[];Ec=[];vc=0;bc=0;input=null;Tc=!1;Oc=!1;Rc=!1;time=-1;Sc=0;Lc=0;xc=0;kc=0;Mc=0;Dc=0;constructor(t=!1){a.Nc.tabIndex=-1,a.na.fillStyle='black',a.na.fillRect(0,0,a.Nc.width,a.Nc.height),this.dc=t,this.dc?this.resize(window.innerWidth,window.innerHeight):this.resize(a.Nc.width,a.Nc.height)}get width(){return a.Nc.width}get height(){return a.Nc.height}resize=(t,i)=>{a.Nc.width=t,a.Nc.height=i,this.Fo=new s.A(t,i),n.A.Fc()};run=async()=>{a.Nc.addEventListener('resize',(()=>{this.dc&&this.resize(window.innerWidth,window.innerHeight)}),!1),a.Nc.onmousedown=this.onmousedown,a.Nc.onmouseup=this.onmouseup,a.Nc.onmouseenter=this.onmouseenter,a.Nc.onmouseleave=this.onmouseleave,a.Nc.onmousemove=this.onmousemove,window.onbeforeunload=this.So,a.Nc.onfocus=this.onfocus,a.Nc.onblur=this.onblur,this.Bc?(a.Nc.ontouchstart=this.ontouchstart,a.Nc.ontouchend=this.ontouchend,a.Nc.ontouchmove=this.ontouchmove):(a.Nc.onkeydown=this.onkeydown,a.Nc.onkeyup=this.onkeyup),a.Nc.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Bc&&'low'===l.getParameter('detail')&&(this.wc=30),await this.qo(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.ac[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.Pc();const h=e,o=s;e=300,s=1,t=performance.now();const a=this.ac[i];if(0===a?(e=h,s=o):t>a&&(e=2560*this.hc/(t-a)|0),e<25?e=25:e>256&&(e=256,s=this.hc-(t-a)/10|0),this.ac[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.ac[t]&&(this.ac[t]+=s);for(s0&&(this.lc=1e3*e/(256*this.hc)|0);const l=performance.now();if(this.uc&&this.refresh(),await this.draw(),this.fc[this.cc]=(performance.now()-l)/1e3,this.cc=(this.cc+1)%this.fc.length,this.wc<50){const i=1e3/this.wc-(performance.now()-t);i>0&&await(0,r.$o)(i)}}-1===this.state&&this.Pc()};Pc=()=>{this.state=-2,this.So()};ra=t=>{this.hc=1e3/t|0};Uc=t=>{this.wc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.hc|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};So=()=>{};draw=async()=>{};refresh=()=>{};async qo(t,i){const e=this.width,s=this.height;this.uc&&(a.na.fillStyle='black',a.na.fillRect(0,0,e,s),this.uc=!1);const n=s/2-18;a.na.fillStyle='rgb(140, 17, 17)',a.na.rect((e/2|0)-152,n,304,34),a.na.fillRect((e/2|0)-150,n+2,3*t,30),a.na.fillStyle='black',a.na.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),a.na.font='bold 13px helvetica, sans-serif',a.na.textAlign='center',a.na.fillStyle='white',a.na.fillText(i,e/2|0,n+22),await(0,r.$o)(5)}Wc=()=>{let t=-1;return this.bc!==this.vc&&(t=this.Ec[this.vc],this.vc=this.vc+1&127),t};get ms(){const t=this.fc.length;let i=0;for(let e=0;ethis.sc&&(this.sc=e),this.nc[this.rc]=e,this.rc=(this.rc+1)%250,e}get Gc(){return this.nc.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.mc=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Cc[n]=1),n>4&&(this.Ec[this.bc]=n,this.bc=this.bc+1&127),o.A.enabled&&o.A.Yc(n),h.g.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.mc=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Cc[n]=0),o.A.enabled&&o.A.Hc(n),h.g.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.Tc=!1,(t.clientX>0||t.clientY>0)&&this.Vc(t),this.mc=0,this.Ic=this.Ha,this._c=this.Va,this.Bc&&!this.Kc){if(this.Xc()||this.jc()||this.zc())return this.gc=1,void(this.Ac=1);t.timeStamp>=this.time+500?(this.gc=2,this.Ac=2):(this.gc=1,this.Ac=1)}else 2===t.button?(this.gc=2,this.Ac=2):(this.gc=1,this.Ac=1);o.A.enabled&&o.A.Zc(this.Ic,this._c,t.buttons)};onmouseup=t=>{this.Vc(t),this.mc=0,this.Ac=0,o.A.enabled&&o.A.qc(t.buttons)};onmouseenter=t=>{this.Vc(t),o.A.enabled&&o.A.Jc()};onmouseleave=t=>{this.Vc(t),this.mc=0,this.Ha=-1,this.Va=-1,this.Ac=0,this.Ic=-1,this._c=-1,o.A.enabled&&o.A.$c()};onmousemove=t=>{this.Vc(t),this.mc=0,o.A.enabled&&o.A.Qc(this.Ha,this.Va)};onfocus=t=>{this.hasFocus=!0,this.uc=!0,this.refresh(),o.A.enabled&&o.A.tf()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.if()};ontouchstart=t=>{if(!this.Bc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.Tc=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Sc=this.Mc=this.xc=0|i.screenX,this.Lc=this.Dc=this.kc=0|i.screenY,this.time=t.timeStamp,this.Oc=this.ef(),this.Rc=this.sf()};ontouchend=t=>{if(!this.Bc||!this.Tc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Mc=0|i.screenX,this.Dc=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Oc&&!this.ef())return void(this.Tc=!1);if(this.Rc&&!this.sf())return void(this.Tc=!1);if(this.Xc()||this.nf()||this.jc()||this.zc()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.jc()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.zc()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Xc()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.nf()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.rf?t.setAttribute('type','password'):t.setAttribute('type',this.zc()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.rf&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.rf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.rf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.Tc=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.Sc-this.Mc)>16||Math.abs(this.Lc-this.Dc)>16;n&&!r?(this.Tc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.Ac=0,this.Tc=!1)};ontouchmove=t=>{if(!this.Bc||!this.Tc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Mc=0|i.screenX,this.Dc=0|i.screenY,this.Oc&&-1===this.Go()?(this.xc-this.Mc>0?this.rotate(2):this.xc-this.Mc<0&&this.rotate(0),this.kc-this.Dc>0?this.rotate(3):this.kc-this.Dc<0&&this.rotate(1)):(this.Rc||-1!==this.Go())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.xc=this.Mc,this.kc=this.Dc};get Bc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get rf(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Kc(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}ef=()=>this.yc&&this.Ha>=8&&this.Ha<=520&&this.Va>=11&&this.Va<=345;Xc=()=>this.yc&&-1===this.Wo()&&!this.Po()&&!this.Uo()&&this.Ha>=11&&this.Ha<=506&&this.Va>=449&&this.Va<=482;nf=()=>this.yc&&(this.Po()||this.Uo())&&this.Ha>=11&&this.Ha<=506&&this.Va>=383&&this.Va<=482;sf=()=>this.yc&&this.Ha>=562&&this.Ha<=752&&this.Va>=231&&this.Va<=492;jc=()=>!this.yc&&2===this.Bo()&&this.Ha>=301&&this.Ha<=562&&this.Va>=262&&this.Va<=279;zc=()=>!this.yc&&2===this.Bo()&&this.Ha>=301&&this.Ha<=562&&this.Va>=279&&this.Va<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};hf=()=>null!==document.fullscreenElement;Vc=t=>{if(this.hf()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/a.Nc.height,s=(window.innerWidth-a.Nc.width*e)/2;this.Ha=0|this.af(t.clientX-i.left-s,0,a.Nc.width*e,0,789),this.Va=0|this.af(t.clientY-i.top,0,a.Nc.height*e,0,532)}else{const i=a.Nc.getBoundingClientRect(),e=a.Nc.width/i.width,s=a.Nc.height/i.height;this.Ha=(t.clientX-i.left)*e|0,this.Va=(t.clientY-i.top)*s|0}this.Ha<0&&(this.Ha=0),this.Va<0&&(this.Va=0),this.Ha>789&&(this.Ha=789),this.Va>532&&(this.Va=532)};af=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}},2595:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static enabled=!1;static lf=null;static cf=null;static ff=0;static uf=0;static df=0;static wf=0;static yf=0;static mf=()=>{this.lf=s.A.Pt(1),this.cf=null,this.ff=performance.now(),this.enabled=!0};static Af=()=>{this.enabled=!1,this.lf=null};static flush=()=>{let t=null;return this.cf&&this.enabled&&(t=this.cf),this.cf=null,t};static stop=()=>{let t=null;return this.lf&&this.lf.pf>0&&this.enabled&&(t=this.lf),this.Af(),t};static Zc=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.uf++;const s=performance.now();let n=(s-this.ff)/10|0;n>250&&(n=250),this.ff=s,this.gf(5),1===e?this.lf?.p1(1):this.lf?.p1(2),this.lf?.p1(n),this.lf?.p3(t+(i<<10))};static qc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,this.gf(2),1===t?this.lf?.p1(3):this.lf?.p1(4),this.lf?.p1(e)};static Qc=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.df>=50){this.df=e,this.uf++;let s=(e-this.ff)/10|0;s>250&&(s=250),this.ff=e,t-this.wf<8&&t-this.wf>=-8&&i-this.yf<8&&i-this.yf>=-8?(this.gf(3),this.lf?.p1(5),this.lf?.p1(s),this.lf?.p1(t+(i-this.yf+8<<4)+8-this.wf)):t-this.wf<128&&t-this.wf>=-128&&i-this.yf<128&&i-this.yf>=-128?(this.gf(4),this.lf?.p1(6),this.lf?.p1(s),this.lf?.p1(t+128-this.wf),this.lf?.p1(i+128-this.yf)):(this.gf(5),this.lf?.p1(7),this.lf?.p1(s),this.lf?.p3(t+(i<<10))),this.wf=t,this.yf=i}};static Yc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.gf(3),this.lf?.p1(8),this.lf?.p1(e),this.lf?.p1(t)};static Hc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this.gf(3),this.lf?.p1(9),this.lf?.p1(e),this.lf?.p1(t)};static tf=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.lf?.p1(10),this.lf?.p1(i)};static if=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.lf?.p1(11),this.lf?.p1(i)};static Jc=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.lf?.p1(12),this.lf?.p1(i)};static $c=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this.gf(2),this.lf?.p1(13),this.lf?.p1(i)};static gf=t=>{if(this.lf&&this.lf.pf+t>=500){const t=this.lf;this.lf=s.A.Pt(1),this.cf=t}}}},9091:(t,i,e)=>{e.d(i,{c:()=>n,g:()=>s});const s=['F11','F12'],n={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}}},1120:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1069),n=e(8665),r=e(2679),h=e(2511),o=e(3819),a=e(3867),l=e(8950);class c{static Do=[];static If=null;static No=null;static Ma=0;static _f=1;static Na=2;static $a=3;static tl=4;static fl=5;static wl=6;static Cl=7;static Cf=1;static Ef=2;static vf=3;static bf=4;static Tf=5;static rl=6;static bl=1;static Tl=100;static Ol=101;static Rl=200;static Of=201;static Rf=202;static Sl=203;static Sf=205;static Lf=300;static xf=301;static kf=302;static Mf=303;static Df=304;static Nf=305;static Ff=306;static Bf=307;static Pf=308;static Uf=309;static Wf=310;static Gf=311;static Yf=312;static Hf=313;static Vf=314;static Kf=315;static Xf=316;static jf=317;static zf=318;static Zf=319;static qf=320;static Jf=321;static $f=322;static Qf=323;static Vl=324;static Kl=325;static tu=326;static Nl=327;static Ll=401;static xl=500;static iu=501;static eu=502;static Dl=503;static Xl=600;static su=601;static nu=602;static ru=603;static hu=604;static ou=605;static au=606;static lu=607;static cu=608;static fu=609;static uu=610;static du=611;static wu=612;static jl=613;static zl=650;static Jl=651;static $l=652;static Ql=653;static tc=654;static Zl=655;static yu=(t,i,e)=>{this.If=new r.A(5e4),this.No=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.pf+=2;n.pf0){s.oa=new Uint8Array(r),s.la=new Uint16Array(r);for(let t=0;t0){s.scripts=new a.fe(o,null);for(let t=0;t0){const n=e.lastIndexOf(',');s.Ja[t]=this.vu(i,e.substring(0,n),parseInt(e.substring(n+1),10))}}s.bu=new a.fe(5,null);for(let t=0;t<5;t++){const i=n.Eu;s.bu[t]=i,0===i.length&&(s.bu[t]=null)}}if(s.type===c.$a&&(s.fill=1===n.pu),s.type===c.tl||s.type===c._f){s.ol=1===n.pu;const t=n.pu;e&&(s.font=e[t]),s.ll=1===n.pu}if(s.type===c.tl&&(s.text=n.Eu,s.sl=n.Eu),s.type!==c._f&&s.type!==c.$a&&s.type!==c.tl||(s.Qa=n.ia),s.type!==c.$a&&s.type!==c.tl||(s.el=n.ia,s.il=n.ia),s.type===c.fl){const t=n.Eu;if(t.length>0){const e=t.lastIndexOf(',');s.dl=this.vu(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=n.Eu;if(e.length>0){const t=e.lastIndexOf(',');s.ul=this.vu(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(s.type===c.wl){const t=n.pu;0!==t&&(s.model=this.pl((t-1<<8)+n.pu));const i=n.pu;0!==i&&(s.Tu=this.pl((i-1<<8)+n.pu)),s.ga=n.pu,0===s.ga?s.ga=-1:s.ga=(s.ga-1<<8)+n.pu,s.Ia=n.pu,0===s.Ia?s.Ia=-1:s.Ia=(s.Ia-1<<8)+n.pu,s.zoom=n.mu,s.Al=n.mu,s._l=n.mu}if(s.type===c.Cl){s.Pa=new Int32Array(s.width*s.height),s.Ua=new Int32Array(s.width*s.height),s.ol=1===n.pu;const t=n.pu;e&&(s.font=e[t]),s.ll=1===n.pu,s.Qa=n.ia,s.Wa=n.Iu,s.Ga=n.Iu,s._u=1===n.pu,s.bu=new a.fe(5,null);for(let t=0;t<5;t++){const i=n.Eu;s.bu[t]=i,0===i.length&&(s.bu[t]=null)}}s.nl!==c.Ef&&s.type!==c.Na||(s.Ou=n.Eu,s.action=n.Eu,s.Ru=n.mu),s.nl!==c.Cf&&s.nl!==c.bf&&s.nl!==c.Tf&&s.nl!==c.rl||(s.Su=n.Eu,0===s.Su.length&&(s.nl===c.Cf?s.Su='Ok':s.nl===c.bf||s.nl===c.Tf?s.Su='Select':s.nl===c.rl&&(s.Su='Continue')))}this.If=null,this.No=null};static vu=(t,i,e)=>{const s=o.A.Lu(i)<<8n|BigInt(e);if(this.If){const t=this.If.get(s);if(t)return t}let n;try{n=h.A.xu(t,i,e),this.If?.put(s,n)}catch(t){return null}return n};static pl=t=>{if(this.No){const i=this.No.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.No?.put(BigInt(t),i),i};id=-1;Au=-1;type=-1;nl=-1;xa=0;width=0;height=0;gu=-1;oa=null;la=null;scripts=null;scroll=0;hide=!1;draggable=!1;_u=!1;Cu=!1;Wa=0;Ga=0;Fa=null;Ba=null;Ja=null;bu=null;fill=!1;ol=!1;font=null;ll=!1;text=null;sl=null;Qa=0;el=0;il=0;dl=null;ul=null;model=null;Tu=null;ga=-1;Ia=-1;zoom=0;Al=0;_l=0;Ou=null;action=null;Ru=-1;Su=null;pa=null;Oa=null;Ra=null;x=0;y=0;Da=0;Pa=null;Ua=null;Ca=0;_a=0;pl(t,i,e){let s=this.model;if(e&&(s=this.Tu),!s)return null;if(-1===t&&-1===i&&!s.ku)return s;const r=n.A.Mu(s,!0,!0,!1);return-1===t&&-1===i||r.Gl(),-1!==t&&r.Yl(t),-1!==i&&r.Yl(i),r.Hl(64,768,-50,-10,-50,!0),r}Du(){if(this.Au===this.id)return this.x;let t=c.Do[this.Au];if(!t.pa||!t.Oa||!t.Ra)return this.x;let i=t.pa.indexOf(this.id);if(-1===i)return this.x;let e=t.Oa[i];for(;t.Au!==t.id;){const s=c.Do[t.Au];s.pa&&s.Oa&&s.Ra&&(i=s.pa.indexOf(t.id),-1!==i&&(e+=s.Oa[i])),t=s}return e}Nu(){if(this.Au===this.id)return this.y;let t=c.Do[this.Au];if(!t.pa||!t.Oa||!t.Ra)return this.y;let i=t.pa.indexOf(this.id);if(-1===i)return this.y;let e=t.Ra[i];for(;t.Au!==t.id;){const s=c.Do[t.Au];s.pa&&s.Oa&&s.Ra&&(i=s.pa.indexOf(t.id),-1!==i&&(e+=s.Ra[i])),t=s}return e}outline(t){const i=this.Du(),e=this.Nu();l.A.Sa(i,e,this.width,this.height,t)}move(t,i){if(this.Au===this.id)return;this.x=0,this.y=0;const e=c.Do[this.Au];if(e.pa&&e.Oa&&e.Ra){const s=e.pa.indexOf(this.id);-1!==s&&(e.Oa[s]=t,e.Ra[s]=i)}}delete(){if(this.Au===this.id)return;const t=c.Do[this.Au];if(t.pa&&t.Oa&&t.Ra){const i=t.pa.indexOf(this.id);-1!==i&&(t.pa.splice(i,1),t.Oa.splice(i,1),t.Ra.splice(i,1))}}}},6333:(t,i,e)=>{e.d(i,{$:()=>s});class s{id;Fu=null;constructor(t){this.id=t}Bu(t){for(;;){const i=t.pu;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(6333);class r extends n.${static count=0;static Do=[];static yu=t=>{const i=new s.A(t.read('flo.dat'));this.count=i.mu;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static Uu=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static Wu=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);Gu=0;texture=-1;Yu=!1;Hu=!0;Vu=0;Ku=0;Xu=0;ju=0;zu=0;Zu=0;decode(t,i){1===t?(this.Gu=i.qu,this.setColor(this.Gu)):2===t?this.texture=i.pu:3===t?this.Yu=!0:5===t?this.Hu=!1:6===t?this.Fu=i.Eu:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(h=e),s>h&&(h=s);let o=0,a=0;const l=(n+h)/2;n!==h&&(l<.5&&(a=(h-n)/(h+n)),l>=.5&&(a=(h-n)/(2-h-n)),i===h?o=(e-s)/(h-n):e===h?o=(s-i)/(h-n)+2:s===h&&(o=(i-e)/(h-n)+4)),o/=6,this.Vu=256*o|0,this.Ku=256*a|0,this.Xu=256*l|0,this.Ku<0?this.Ku=0:this.Ku>255&&(this.Ku=255),this.Xu<0?this.Xu=0:this.Xu>255&&(this.Xu=255),this.ju=l>.5?(1-l)*a*512|0:l*a*512|0,this.ju<1&&(this.ju=1),this.zu=o*this.ju|0;let c=this.Vu+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.Ku+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.Xu+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.Zu=r.Pu(c,f,u)}}},8317:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(1069),n=e(6333),r=e(8665),h=e(3867);class o extends n.${static count=0;static Do=[];static yu=t=>{const i=new s.A(t.read('idk.dat'));this.count=i.mu;for(let t=0;t=40&&t<50?this.Qu[t-40]=i.mu:t>=50&&t<60?this.td[t-50]=i.mu:t>=60&&t<70?this.$u[t-60]=i.mu:console.log('Error unrecognised config code: ',t)}pl(){if(!this.Ju)return null;const t=new h.fe(this.Ju.length,null);for(let i=0;i{e.d(i,{A:()=>c});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(1023),a=e(6169),l=e(3867);class c extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static hd=new r.A(500);static od=new r.A(30);static yu=t=>{this.sd=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.mu,this.nd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%10;const i=this.cache[this.rd];return this.sd.pf=this.nd[t],i.id=t,i.reset(),i.Bu(this.sd),i.ad||(i.ad=new Int32Array(1)),-1===i.ld&&i.ad&&(i.active=i.ad.length>0&&i.ad[0]===o.A.fd.id,i.ud&&(i.active=!0)),i};static So=()=>{this.hd=null,this.od=null,this.nd=null,this.cache=null,this.sd=null};Ju=null;ad=null;name=null;dd=null;Qu=null;td=null;width=1;length=1;wd=!0;yd=!0;active=!1;ld=-1;md=!1;Ad=!1;Hu=!1;ga=-1;pd=!1;gd=16;Id=0;_d=0;ud=null;Cd=-1;Ed=-1;vd=!1;bd=!0;Td=128;Od=128;Rd=128;Sd=0;Ld=0;xd=0;kd=0;Md=!1;decode(t,i){if(1===t){const t=i.pu;this.Ju=new Int32Array(t),this.ad=new Int32Array(t);for(let e=0;e=30&&t<39)this.ud||(this.ud=new l.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(40===t){const t=i.pu;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e=this.Ju.length)return null;let d=this.Ju[l];if(-1===d)return null;const w=this.vd!==i>3;w&&(d+=65536);let y=c.hd?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.Gd(),c.hd?.put(BigInt(d),y));const m=128!==this.Td||128!==this.Od||128!==this.Rd,A=0!==this.Ld||0!==this.xd||0!==this.kd;let p=h.A.Mu(y,!this.Qu,!this.pd,i===a.A.Yd&&-1===o&&!m&&!A);for(-1!==o&&(p.Gl(),p.Yl(o),p.Hd=null,p.Vd=null);i-- >0;)p.Kd();if(this.Qu&&this.td)for(let t=0;t{e.d(i,{A:()=>a});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(3867);class a extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static No=new r.A(30);static yu=t=>{this.sd=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.mu,this.nd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%20;const i=this.cache[this.rd]=new a(t);return this.sd.pf=this.nd[t],i.Bu(this.sd),i};static So=()=>{this.No=null,this.nd=null,this.cache=null,this.sd=null};name=null;dd=null;size=1;Ju=null;$u=null;pd=!1;zd=-1;Zd=-1;qd=-1;Jd=-1;$d=-1;Qu=null;td=null;ud=null;Td=-1;Od=-1;Rd=-1;Qd=!0;tw=-1;iw=128;ew=128;decode(t,i){if(1===t){const t=i.pu;this.Ju=new Uint16Array(t);for(let e=0;e=30&&t<40)this.ud||(this.ud=new o.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(40===t){const t=i.pu;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e{e.d(i,{A:()=>u});var s=e(6333),n=e(1069),r=e(2511),h=e(2679),o=e(8665),a=e(4583),l=e(8950),c=e(9298),f=e(3867);class u extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static aw=!0;static No=new h.A(50);static lw=new h.A(200);static yu=(t,i)=>{this.aw=i,this.sd=new n.A(t.read('obj.dat'));const e=new n.A(t.read('obj.idx'));this.count=e.mu,this.nd=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%10;const i=this.cache[this.rd];return this.sd.pf=this.nd[t],i.id=t,i.reset(),i.Bu(this.sd),-1!==i.cw&&i.fw(),!this.aw&&i.members&&(i.name='Members Object',i.dd="Login to a members' server to use this object.",i.ud=null,i.uw=null),i};static So=()=>{this.No=null,this.lw=null,this.nd=null,this.cache=null,this.sd=null};static Ya=(t,i)=>{if(u.lw){let e=u.lw.get(BigInt(t));if(e&&e.dw!==i&&-1!==e.dw&&(e.ww(),e=null),e)return e}let e=u.get(t);if(e.yw||(i=-1),e.yw&&e.mw&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.mw[s]&&0!==e.mw[s]&&(t=e.yw[s]);-1!==t&&(e=u.get(t))}const s=new r.A(32,32),n=a.A.yl,h=a.A.ml,o=a.A.Aw,f=l.A.pw,d=l.A.gw,w=l.A.Iw,y=l.A.left,m=l.A.right,A=l.A.top,p=l.A.bottom;a.A._w=!1,l.A.bind(s.pw,32,32),l.A.fillRect(0,0,32,32,c.A.Za),a.A.Fc();const g=e.Cw(1),I=a.A.sin[e.Ew]*e.bw>>16,_=a.A.cos[e.Ew]*e.bw>>16;g.Il(0,e.Tw,e.Ow,e.Ew,e.Rw,I+(g.jd/2|0)+e.Sw,_+e.Sw);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.pw[t+32*i]&&(t>0&&s.pw[t+32*i-1]>1||i>0&&s.pw[t+32*(i-1)]>1||t<31&&s.pw[t+32*i+1]>1||i<31&&s.pw[t+32*(i+1)]>1)&&(s.pw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.pw[t+32*i]&&t>0&&i>0&&s.pw[t+32*(i-1)-1]>0&&(s.pw[t+32*i]=3153952);if(-1!==e.cw){const t=this.Ya(e.Lw,10),i=t.Xa,s=t.dw;t.Xa=32,t.dw=32,t.xw(5,5,22,22),t.Xa=i,t.dw=s}return u.lw?.put(BigInt(t),s),l.A.bind(f,d,w),l.A.Ta(y,A,m,p),a.A.yl=n,a.A.ml=h,a.A.Aw=o,a.A._w=!0,e.El?s.Xa=33:s.Xa=32,s.dw=i,s};model=0;name=null;dd=null;Qu=null;td=null;bw=2e3;Ew=0;Tw=0;Ow=0;Rw=0;Sw=0;kw=!1;Mw=-1;El=!1;Dw=1;members=!1;ud=null;uw=null;Nw=-1;Fw=-1;Bw=0;Pw=-1;Uw=-1;Ww=0;Gw=-1;Yw=-1;Hw=-1;Vw=-1;Kw=-1;Xw=-1;yw=null;mw=null;Lw=-1;cw=-1;decode(t,i){if(1===t)this.model=i.mu;else if(2===t)this.name=i.Eu;else if(3===t)this.dd=i.Eu;else if(4===t)this.bw=i.mu;else if(5===t)this.Ew=i.mu;else if(6===t)this.Tw=i.mu;else if(7===t)this.Rw=i.Iu,this.Rw>32767&&(this.Rw-=65536);else if(8===t)this.Sw=i.Iu,this.Sw>32767&&(this.Sw-=65536);else if(9===t)this.kw=!0;else if(10===t)this.Mw=i.mu;else if(11===t)this.El=!0;else if(12===t)this.Dw=i.ia;else if(16===t)this.members=!0;else if(23===t)this.Nw=i.mu,this.Bw=i.Dd;else if(24===t)this.Fw=i.mu;else if(25===t)this.Pw=i.mu,this.Ww=i.Dd;else if(26===t)this.Uw=i.mu;else if(t>=30&&t<35)this.ud||(this.ud=new f.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(t>=35&&t<40)this.uw||(this.uw=new f.fe(5,null)),this.uw[t-35]=i.Eu;else if(40===t){const t=i.pu;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.yw&&this.mw||(this.yw=new Uint16Array(10),this.mw=new Uint16Array(10)),this.yw[t-100]=i.mu,this.mw[t-100]=i.mu)}jw(t){let i=this.Nw;if(1===t&&(i=this.Pw),-1===i)return null;let e=this.Fw,s=this.Gw;1===t&&(e=this.Uw,s=this.Yw);let n=o.A.model(i);if(-1!==e){const t=o.A.model(e);if(-1===s){const i=[n,t];n=o.A.Fl(i,2)}else{const i=[n,t,o.A.model(s)];n=o.A.Fl(i,3)}}if(0===t&&0!==this.Bw&&n.translate(this.Bw,0,0),1===t&&0!==this.Ww&&n.translate(this.Ww,0,0),this.Qu&&this.td)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.mw[e]&&0!==this.mw[e]&&(i=this.yw[e]);if(-1!==i)return u.get(i).Cw(1)}if(u.No){const t=u.No.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.Qu&&this.td)for(let t=0;t{e.d(i,{A:()=>h});var s=e(6333),n=e(1069),r=e(6730);class h extends s.${static count=0;static Do=[];static yu=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.mu;for(let t=0;t{e.d(i,{A:()=>a});var s=e(6333),n=e(1069),r=e(1312),h=e(8665),o=e(2679);class a extends s.${static count=0;static Do=[];static No=new o.A(30);static yu=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.mu;for(let t=0;t=40&&t<50?this.Qu[t-40]=i.mu:t>=50&&t<60?this.td[t-50]=i.mu:console.log('Error unrecognised spotanim config code: ',t)}pl(){let t=a.No?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let i=0;i<6;i++)0!==this.Qu[0]&&t.Bl(this.Qu[i],this.td[i]);return a.No?.put(BigInt(this.id),t),t}}},3764:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(6333),n=e(1069);class r extends s.${static count=0;static Do=[];static ty=[];static iy=0;static yu=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.mu;for(let t=0;t{e.d(i,{A:()=>s});class s{static OPEN=0;static ly=1;static uy=2;static wy=4;static yy=8;static my=s.ly<<4;static Ay=s.uy<<4;static py=s.wy<<4;static gy=s.yy<<4;static Iy=256;static _y=512;static Cy=1024;static Ey=2048;static vy=4096;static by=s._y<<4;static Ty=s.Cy<<4;static Oy=s.Ey<<4;static Ry=s.vy<<4;static Sy=s.Iy<<9;static Ly=524288;static xy=2097152;static ky=s.xy|s.Ly;static My=s.Iy|s.ky;static Dy=s.uy|s.My;static Ny=s.yy|s.My;static Fy=s.uy|s.wy|s.Ny;static By=s.Ay|s.My;static Py=s.yy|s.my|s.By;static Uy=s.gy|s.My;static Wy=s.ly|s.uy|s.Uy;static Gy=s.Ay|s.py|s.Uy;static Yy=16777215}},670:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(9456),n=e(6169),r=e(1023),h=e(4909);class o{static Dr=4;static jr=104;static index=(t,i)=>t*o.jr+i;offsetX;Hy;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Hy=0,this.sizeX=o.jr,this.sizeZ=o.jr,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.Hy)]|=s.A.xy};Ky=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.Hy)]&=~s.A.xy};Xy=(t,i,e,r,h,o)=>{let a=s.A.Iy;o&&(a|=s.A.Sy);const l=t-this.offsetX,c=i-this.Hy;if(h===n.A.jy||h===n.A.zy){const t=e;e=r,r=t}for(let t=l;t=0&&t=0&&i{let a=s.A.Iy;o&&(a|=s.A.Sy);const l=t-this.offsetX,c=i-this.Hy;if(h===n.A.jy||h===n.A.zy){const t=e;e=r,r=t}for(let t=l;t=0&&t=0&&i{const a=t-this.offsetX,l=i-this.Hy,c=o?s.A.Ry:s.A.gy,f=o?s.A.vy:s.A.yy,u=o?s.A.Cy:s.A.uy,d=o?s.A.Ty:s.A.Ay,w=o?s.A._y:s.A.ly,y=o?s.A.by:s.A.my,m=o?s.A.Ey:s.A.wy,A=o?s.A.Oy:s.A.py;e===r.A.Jy.id?h===n.A.Yd?(this.add(a,l,c),this.add(a-1,l,f)):h===n.A.jy?(this.add(a,l,u),this.add(a,l+1,d)):h===n.A.$y?(this.add(a,l,f),this.add(a+1,l,c)):h===n.A.zy&&(this.add(a,l,d),this.add(a,l-1,u)):e===r.A.Qy.id||e===r.A.tm.id?h===n.A.Yd?(this.add(a,l,w),this.add(a-1,l+1,y)):h===n.A.jy?(this.add(a,l,m),this.add(a+1,l+1,A)):h===n.A.$y?(this.add(a,l,y),this.add(a+1,l-1,w)):h===n.A.zy&&(this.add(a,l,A),this.add(a-1,l-1,m)):e===r.A.im.id&&(h===n.A.Yd?(this.add(a,l,u|c),this.add(a-1,l,f),this.add(a,l+1,d)):h===n.A.jy?(this.add(a,l,u|f),this.add(a,l+1,d),this.add(a+1,l,c)):h===n.A.$y?(this.add(a,l,d|f),this.add(a+1,l,c),this.add(a,l-1,u)):h===n.A.zy&&(this.add(a,l,d|c),this.add(a,l-1,u),this.add(a-1,l,f))),o&&this.qy(t,i,e,h,!1)};sm=(t,i,e,h,o)=>{const a=t-this.offsetX,l=i-this.Hy,c=o?s.A.Ry:s.A.gy,f=o?s.A.vy:s.A.yy,u=o?s.A.Cy:s.A.uy,d=o?s.A.Ty:s.A.Ay,w=o?s.A._y:s.A.ly,y=o?s.A.by:s.A.my,m=o?s.A.Ey:s.A.wy,A=o?s.A.Oy:s.A.py;e===r.A.Jy.id?h===n.A.Yd?(this.remove(a,l,c),this.remove(a-1,l,f)):h===n.A.jy?(this.remove(a,l,u),this.remove(a,l+1,d)):h===n.A.$y?(this.remove(a,l,f),this.remove(a+1,l,c)):h===n.A.zy&&(this.remove(a,l,d),this.remove(a,l-1,u)):e===r.A.Qy.id||e===r.A.tm.id?h===n.A.Yd?(this.remove(a,l,w),this.remove(a-1,l+1,y)):h===n.A.jy?(this.remove(a,l,m),this.remove(a+1,l+1,A)):h===n.A.$y?(this.remove(a,l,y),this.remove(a+1,l-1,w)):h===n.A.zy&&(this.remove(a,l,A),this.remove(a-1,l-1,m)):e===r.A.im.id&&(h===n.A.Yd?(this.remove(a,l,u|c),this.remove(a-1,l,f),this.remove(a,l+1,d)):h===n.A.jy?(this.remove(a,l,u|f),this.remove(a,l+1,d),this.remove(a+1,l,c)):h===n.A.$y?(this.remove(a,l,d|f),this.remove(a+1,l,c),this.remove(a,l-1,u)):h===n.A.zy&&(this.remove(a,l,d|c),this.remove(a,l-1,u),this.remove(a-1,l,f))),o&&this.sm(t,i,e,h,!1)};nm=(t,i,e,h,a,l)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Hy,u=e-this.offsetX,d=h-this.Hy,w=o.index(c,f);if(a===r.A.Jy.id){if(l===n.A.Yd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(l===n.A.jy){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0}else if(l===n.A.$y){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(l===n.A.zy){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0}}else if(a===r.A.im.id){if(l===n.A.Yd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(l===n.A.jy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(l===n.A.$y){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(l===n.A.zy){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(a===r.A.rm.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0}return!1};hm=(t,i,e,h,a,l)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Hy,u=e-this.offsetX,d=h-this.Hy,w=o.index(c,f);if(a===r.A.om.id||a===r.A.am.id){if(a===r.A.am.id&&(l=l+2&3),l===n.A.Yd){if(c===u+1&&f===d&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0}else if(l===n.A.jy){if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0}else if(l===n.A.$y){if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0}else if(l===n.A.zy){if(c===u+1&&f===d&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0}}else if(a===r.A.lm.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.Ay)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.gy)===s.A.OPEN)return!0}return!1};fm=(t,i,e,n,r,a,l)=>{const c=e+r-1,f=n+a-1,u=o.index(t-this.offsetX,i-this.Hy);return t>=e&&t<=c&&i>=n&&i<=f||(t===e-1&&i>=n&&i<=f&&(this.flags[u]&s.A.yy)===s.A.OPEN&&(l&h.A.Yd)===s.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&s.A.gy)===s.A.OPEN&&(l&h.A.$y)===s.A.OPEN||(i===n-1&&t>=e&&t<=c&&(this.flags[u]&s.A.uy)===s.A.OPEN&&(l&h.A.zy)===s.A.OPEN||i===f+1&&t>=e&&t<=c&&(this.flags[u]&s.A.Ay)===s.A.OPEN&&(l&h.A.jy)===s.A.OPEN)))};add=(t,i,e)=>{this.flags[o.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[o.index(t,i)]&=s.A.Yy-e}}},4909:(t,i,e)=>{e.d(i,{A:()=>s});class s{static jy=1;static $y=2;static zy=4;static Yd=8}},6169:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Yd=0;static jy=1;static $y=2;static zy=3}},5599:(t,i,e)=>{e.d(i,{A:()=>s});class s{static um=0;static dm=1;static wm=2;static ym=3}},1023:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5599);class n{static Jy=new n(0,s.A.um);static Qy=new n(1,s.A.um);static im=new n(2,s.A.um);static tm=new n(3,s.A.um);static Am=new n(4,s.A.dm);static pm=new n(5,s.A.dm);static om=new n(6,s.A.dm);static am=new n(7,s.A.dm);static lm=new n(8,s.A.dm);static rm=new n(9,s.A.wm);static fd=new n(10,s.A.wm);static gm=new n(11,s.A.wm);static Im=new n(12,s.A.wm);static _m=new n(13,s.A.wm);static Cm=new n(14,s.A.wm);static Em=new n(15,s.A.wm);static vm=new n(16,s.A.wm);static bm=new n(17,s.A.wm);static Tm=new n(18,s.A.wm);static Om=new n(19,s.A.wm);static Rm=new n(20,s.A.wm);static Sm=new n(21,s.A.wm);static ym=new n(22,s.A.ym);static values(){return[this.Jy,this.Qy,this.bm,this.Em,this.im,this.Cm,this.rm,this.tm,this.ym,this.Im,this.gm,this.om,this.Rm,this.fd,this.pm,this._m,this.am,this.Am,this.vm,this.lm,this.Om,this.Sm,this.Tm]}static of(t){const i=this.values();for(let e=0;e{e.d(i,{A:()=>m});var s=e(670),n=e(2164),r=e(1069),h=e(4583),o=e(3045),a=e(5637),l=e(4197),c=e(1312),f=e(1023),u=e(6169),d=e(9298),w=e(5518),y=e(3867);class m{static Lm=Int8Array.of(1,2,4,8);static xm=Uint8Array.of(16,32,64,128);static km=Int8Array.of(1,0,-1,0);static Mm=Int8Array.of(0,-1,0,1);static Dm=(17*Math.random()|0)-8;static Nm=(33*Math.random()|0)-16;static et=!0;static Fm=0;static Bm=!1;static Pm=(t,i)=>{let e=this.Um(t+45365,i+91923,4)+(this.Um(t+10294,i+37821,2)-128>>1)+(this.Um(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static Um=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.Wm(s,r),a=this.Wm(s+1,r),l=this.Wm(s,r+1),c=this.Wm(s+1,r+1),f=this.Gm(o,a,n,e),u=this.Gm(l,c,n,e);return this.Gm(f,u,h,e)};static Gm=(t,i,e,s)=>{const n=65536-h.A.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static Wm=(t,i)=>((this.Ym(t-1,i-1)+this.Ym(t+1,i-1)+this.Ym(t-1,i+1)+this.Ym(t+1,i+1))/16|0)+((this.Ym(t-1,i)+this.Ym(t+1,i)+this.Ym(t,i-1)+this.Ym(t,i+1))/8|0)+(this.Ym(t,i)/4|0);static Ym=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static Xy=(t,i,e,s,n,r,h,o,d,w,y)=>{const A=n[y][i][e],p=n[y][i+1][e],g=n[y][i+1][e+1],I=n[y][i][e+1],_=A+p+g+I>>2,C=a.A.get(o);let E=i+(e<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A.ym.id)s?.Hm(C.pl(f.A.ym.id,w,A,p,g,I,-1),t,i,e,_,E,v),C.wd&&C.active&&h?.Vy(i,e),-1!==C.ga&&r.Vm(new l.A(o,t,3,i,e,c.A.Do[C.ga],!0));else if(d===f.A.fd.id||d===f.A.gm.id){const n=C.pl(f.A.fd.id,w,A,p,g,I,-1);if(n){let r,h,o=0;d===f.A.gm.id&&(o+=256),w===u.A.jy||w===u.A.zy?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.Xy(t,i,e,_,n,null,E,v,r,h,o)}C.wd&&h?.Xy(i,e,C.width,C.length,w,C.yd),-1!==C.ga&&r.Vm(new l.A(o,t,2,i,e,c.A.Do[C.ga],!0))}else if(d>=f.A.Im.id)s?.Xy(t,i,e,_,C.pl(d,w,A,p,g,I,-1),null,E,v,1,1,0),C.wd&&h?.Xy(i,e,C.width,C.length,w,C.yd),-1!==C.ga&&r.Vm(new l.A(o,t,2,i,e,c.A.Do[C.ga],!0));else if(d===f.A.Jy.id)s?.qy(t,i,e,_,m.Lm[w],0,C.pl(f.A.Jy.id,w,A,p,g,I,-1),null,E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C.ga&&r.Vm(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0));else if(d===f.A.Qy.id)s?.qy(t,i,e,_,m.xm[w],0,C.pl(f.A.Qy.id,w,A,p,g,I,-1),null,E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C.ga&&r.Vm(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0));else if(d===f.A.im.id){const n=w+1&3;s?.qy(t,i,e,_,m.Lm[w],m.Lm[n],C.pl(f.A.im.id,w+4,A,p,g,I,-1),C.pl(f.A.im.id,n,A,p,g,I,-1),E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C.ga&&r.Vm(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0))}else if(d===f.A.tm.id)s?.qy(t,i,e,_,m.xm[w],0,C.pl(f.A.tm.id,w,A,p,g,I,-1),null,E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C.ga&&r.Vm(new l.A(o,t,0,i,e,c.A.Do[C.ga],!0));else if(d===f.A.rm.id)s?.Xy(t,i,e,_,C.pl(d,w,A,p,g,I,-1),null,E,v,1,1,0),C.wd&&h?.Xy(i,e,C.width,C.length,w,C.yd),-1!==C.ga&&r.Vm(new l.A(o,t,2,i,e,c.A.Do[C.ga],!0));else if(d===f.A.Am.id)s?.Km(t,i,e,_,0,0,E,C.pl(f.A.Am.id,u.A.Yd,A,p,g,I,-1),v,512*w,m.Lm[w]),-1!==C.ga&&r.Vm(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0));else if(d===f.A.pm.id){let n=16;if(s){const r=s.Xm(t,i,e);r>0&&(n=a.A.get(r>>14&32767).gd)}s?.Km(t,i,e,_,m.km[w]*n,m.Mm[w]*n,E,C.pl(f.A.Am.id,u.A.Yd,A,p,g,I,-1),v,512*w,m.Lm[w]),-1!==C.ga&&r.Vm(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0))}else d===f.A.om.id?(s?.Km(t,i,e,_,0,0,E,C.pl(f.A.Am.id,u.A.Yd,A,p,g,I,-1),v,w,256),-1!==C.ga&&r.Vm(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0))):d===f.A.am.id?(s?.Km(t,i,e,_,0,0,E,C.pl(f.A.Am.id,u.A.Yd,A,p,g,I,-1),v,w,512),-1!==C.ga&&r.Vm(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0))):d===f.A.lm.id&&(s?.Km(t,i,e,_,0,0,E,C.pl(f.A.Am.id,u.A.Yd,A,p,g,I,-1),v,w,768),-1!==C.ga&&r.Vm(new l.A(o,t,1,i,e,c.A.Do[C.ga],!0)))};jm;zm;Hr;Vr;Zm;qm;Jm;$m;Qm;tA;iA;eA;sA;nA;rA;hA;constructor(t,i,e,n){this.jm=t,this.zm=i,this.Hr=e,this.Vr=n,this.Zm=new y.oA(s.A.Dr,t,i),this.qm=new y.oA(s.A.Dr,t,i),this.Jm=new y.oA(s.A.Dr,t,i),this.$m=new y.oA(s.A.Dr,t,i),this.hA=new y.aA(s.A.Dr,t+1,i+1),this.Qm=new y.oA(s.A.Dr,t+1,i+1),this.tA=new y.Xr(t+1,i+1),this.iA=new Int32Array(i),this.eA=new Int32Array(i),this.sA=new Int32Array(i),this.nA=new Int32Array(i),this.rA=new Int32Array(i)}lA=(t,i)=>{for(let t=0;t=0&&i[s]?.Vy(e,n)}m.Dm+=(5*Math.random()|0)-2,m.Dm<-8?m.Dm=-8:m.Dm>8&&(m.Dm=8),m.Nm+=(5*Math.random()|0)-2,m.Nm<-16?m.Nm=-16:m.Nm>16&&(m.Nm=16);for(let i=0;i>8;for(let t=1;t>2)+(e[n+1][t]>>3)+(e[n][t-1]>>2)+(e[n][t+1]>>3)+(e[n][t]>>1);this.tA[n][t]=u-d}for(let t=0;t=0&&s0){const i=n.A.Do[e-1];this.iA[t]+=i.zu,this.eA[t]+=i.Ku,this.sA[t]+=i.Xu,this.nA[t]+=i.ju,r=this.rA[t]++}}const h=e-5;if(h>=0&&h0){const i=n.A.Do[e-1];this.iA[t]-=i.zu,this.eA[t]-=i.Ku,this.sA[t]-=i.Xu,this.nA[t]-=i.ju,r=this.rA[t]--}}}if(e>=1&&e=0&&f=0&&y=1&&c0||y>0){const A=this.Hr[i][e][c],p=this.Hr[i][e+1][c],g=this.Hr[i][e+1][c+1],I=this.Hr[i][e][c+1],_=this.tA[e][c],C=this.tA[e+1][c],E=this.tA[e+1][c+1],v=this.tA[e][c+1];let b=-1,T=-1;if(f>0){const t=256*s/a|0,i=r/l|0;let e=o/l|0;b=n.A.Pu(t,i,e);const h=t+m.Dm&255;e+=m.Nm,e<0?e=0:e>255&&(e=255),T=n.A.Pu(h,i,e)}if(i>0){let t=0!==f||this.Jm[i][e][c]===w.A.fA;y>0&&!n.A.Do[y-1].Hu&&(t=!1),t&&A===p&&A===g&&A===I&&(this.hA[i][e][c]|=2340)}let O=0;if(-1!==b&&(O=h.A.palette[n.A.Uu(T,96)]),0===y)t?.uA(i,e,c,w.A.fA,u.A.Yd,-1,A,p,g,I,n.A.Uu(b,_),n.A.Uu(b,C),n.A.Uu(b,E),n.A.Uu(b,v),d.A.Za,d.A.Za,d.A.Za,d.A.Za,O,d.A.Za);else{const s=this.Jm[i][e][c]+1,r=this.$m[i][e][c],o=n.A.Do[y-1];let a,l,f=o.texture;f>=0?(l=h.A.dA(f),a=-1):o.Gu===d.A.wA?(l=0,a=-2,f=-1):(a=n.A.Pu(o.Vu,o.Ku,o.Xu),l=h.A.palette[n.A.Wu(o.Zu,96)]),t?.uA(i,e,c,s,r,f,A,p,g,I,n.A.Uu(b,_),n.A.Uu(b,C),n.A.Uu(b,E),n.A.Uu(b,v),n.A.Wu(a,_),n.A.Wu(a,C),n.A.Wu(a,E),n.A.Wu(a,v),O,l)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let s=0;s<=n;s++)for(let r=0;r<=this.zm;r++)for(let h=0;h<=this.jm;h++){if(this.hA[s][h][r]&t){let i=r,e=r,a=s,l=s;for(;i>0&&this.hA[s][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.hA[a-1][h][s]&t))break t;a--}t:for(;l=8){const s=this.Hr[l][h][i]-240,r=this.Hr[a][h][i];o.A.pA(n,1,128*h,s,128*i,128*h,r,128*e+128);for(let s=a;s<=l;s++)for(let n=i;n<=e;n++)this.hA[s][h][n]&=~t}}if(this.hA[s][h][r]&i){let t=h,e=h,a=s,l=s;for(;t>0&&this.hA[s][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.hA[a-1][s][r]&i))break t;a--}t:for(;l=8){const s=this.Hr[l][t][r]-240,h=this.Hr[a][t][r];o.A.pA(n,2,128*t,s,128*r,128*e+128,h,128*r);for(let s=a;s<=l;s++)for(let n=t;n<=e;n++)this.hA[s][n][r]&=~i}}if(this.hA[s][h][r]&e){let t=h,i=h,a=r,l=r;for(;a>0&&this.hA[s][h][a-1]&e;)a--;for(;l0;){for(let i=a;i<=l;i++)if(!(this.hA[s][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.Hr[s][t][a];o.A.pA(n,4,128*t,r,128*a,128*i+128,r,128*l+128);for(let n=t;n<=i;n++)for(let t=a;t<=l;t++)this.hA[s][n][t]&=~e}}}}}};gA=(t,i,e,r)=>{let h=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new r.A(new Uint8Array(h));for(let r=0;r=0&&l=0&&c>24,this.$m[r][l][c]=(f-2&3)<<24>>24):f<=81?this.Vr[r][l][c]=f-49<<24>>24:this.Zm[r][l][c]=f-81<<24>>24}else for(;f=o.pu,0!==f;){if(1===f){o.pu;break}f<=49&&o.pu}}};_A=(t,i,e,n,h,o)=>{const a=new r.A(new Uint8Array(n));let l=-1;for(;;){const n=a.CA;if(0===n)return;l+=n;let r=0;for(;;){const n=a.CA;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=a.pu,w=d>>2,y=3&d,m=f+h,A=c+o;if(m>0&&A>0&&m=0&&(n=e[s]),this.Xy(u,m,A,t,i,n,l,w,y)}}}};Xy=(t,i,e,s,n,r,h,o,d)=>{if(m.et){if(16&this.Vr[t][i][e])return;if(this.cA(t,i,e)!==m.Fm)return}const w=this.Hr[t][i][e],y=this.Hr[t][i+1][e],A=this.Hr[t][i+1][e+1],p=this.Hr[t][i][e+1],g=w+y+A+p>>2,I=a.A.get(h);let _=i+(e<<7)+(h<<14)+1073741824|0;I.active||(_+=-2147483648),_|=0;const C=(d<<6)+o<<24>>24;if(o===f.A.ym.id)(!m.et||I.active||I.Md)&&(s?.Hm(I.pl(f.A.ym.id,d,w,y,A,p,-1),t,i,e,g,_,C),I.wd&&I.active&&r?.Vy(i,e),-1!==I.ga&&n.Vm(new l.A(h,t,3,i,e,c.A.Do[I.ga],!0)));else if(o===f.A.fd.id||o===f.A.gm.id){const a=I.pl(f.A.fd.id,d,w,y,A,p,-1);if(a){let n,r,h=0;if(o===f.A.gm.id&&(h+=256),d===u.A.jy||d===u.A.zy?(n=I.length,r=I.width):(n=I.width,r=I.length),s?.Xy(t,i,e,g,a,null,_,C,n,r,h)&&I.bd)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=a.EA/4|0;r>30&&(r=30),r>this.Qm[t][i+s][e+n]&&(this.Qm[t][i+s][e+n]=r<<24>>24)}}I.wd&&r?.Xy(i,e,I.width,I.length,d,I.yd),-1!==I.ga&&n.Vm(new l.A(h,t,2,i,e,c.A.Do[I.ga],!0))}else if(o>=f.A.Im.id)s?.Xy(t,i,e,g,I.pl(o,d,w,y,A,p,-1),null,_,C,1,1,0),o>=f.A.Im.id&&o<=f.A.bm.id&&o!==f.A._m.id&&t>0&&(this.hA[t][i][e]|=2340),I.wd&&r?.Xy(i,e,I.width,I.length,d,I.yd),-1!==I.ga&&n.Vm(new l.A(h,t,2,i,e,c.A.Do[I.ga],!0));else if(o===f.A.Jy.id)s?.qy(t,i,e,g,m.Lm[d],0,I.pl(f.A.Jy.id,d,w,y,A,p,-1),null,_,C),d===u.A.Yd?(I.bd&&(this.Qm[t][i][e]=50,this.Qm[t][i][e+1]=50),I.Hu&&(this.hA[t][i][e]|=585)):d===u.A.jy?(I.bd&&(this.Qm[t][i][e+1]=50,this.Qm[t][i+1][e+1]=50),I.Hu&&(this.hA[t][i][e+1]|=1170)):d===u.A.$y?(I.bd&&(this.Qm[t][i+1][e]=50,this.Qm[t][i+1][e+1]=50),I.Hu&&(this.hA[t][i+1][e]|=585)):d===u.A.zy&&(I.bd&&(this.Qm[t][i][e]=50,this.Qm[t][i+1][e]=50),I.Hu&&(this.hA[t][i][e]|=1170)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I.ga&&n.Vm(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0)),16!==I.gd&&s?.vA(t,i,e,I.gd);else if(o===f.A.Qy.id)s?.qy(t,i,e,g,m.xm[d],0,I.pl(f.A.Qy.id,d,w,y,A,p,-1),null,_,C),I.bd&&(d===u.A.Yd?this.Qm[t][i][e+1]=50:d===u.A.jy?this.Qm[t][i+1][e+1]=50:d===u.A.$y?this.Qm[t][i+1][e]=50:d===u.A.zy&&(this.Qm[t][i][e]=50)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I.ga&&n.Vm(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0));else if(o===f.A.im.id){const a=d+1&3;s?.qy(t,i,e,g,m.Lm[d],m.Lm[a],I.pl(f.A.im.id,d+4,w,y,A,p,-1),I.pl(f.A.im.id,a,w,y,A,p,-1),_,C),I.Hu&&(d===u.A.Yd?(this.hA[t][i][e]|=265,this.hA[t][i][e+1]|=1170):d===u.A.jy?(this.hA[t][i][e+1]|=1170,this.hA[t][i+1][e]|=585):d===u.A.$y?(this.hA[t][i+1][e]|=585,this.hA[t][i][e]|=1170):d===u.A.zy&&(this.hA[t][i][e]|=1170,this.hA[t][i][e]|=585)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I.ga&&n.Vm(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0)),16!==I.gd&&s?.vA(t,i,e,I.gd)}else if(o===f.A.tm.id)s?.qy(t,i,e,g,m.xm[d],0,I.pl(f.A.tm.id,d,w,y,A,p,-1),null,_,C),I.bd&&(d===u.A.Yd?this.Qm[t][i][e+1]=50:d===u.A.jy?this.Qm[t][i+1][e+1]=50:d===u.A.$y?this.Qm[t][i+1][e]=50:d===u.A.zy&&(this.Qm[t][i][e]=50)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I.ga&&n.Vm(new l.A(h,t,0,i,e,c.A.Do[I.ga],!0));else if(o===f.A.rm.id)s?.Xy(t,i,e,g,I.pl(o,d,w,y,A,p,-1),null,_,C,1,1,0),I.wd&&r?.Xy(i,e,I.width,I.length,d,I.yd),-1!==I.ga&&n.Vm(new l.A(h,t,2,i,e,c.A.Do[I.ga],!0));else if(o===f.A.Am.id)s?.Km(t,i,e,g,0,0,_,I.pl(f.A.Am.id,u.A.Yd,w,y,A,p,-1),C,512*d,m.Lm[d]),-1!==I.ga&&n.Vm(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0));else if(o===f.A.pm.id){let r=16;if(s){const n=s.Xm(t,i,e);n>0&&(r=a.A.get(n>>14&32767).gd)}s?.Km(t,i,e,g,m.km[d]*r,m.Mm[d]*r,_,I.pl(f.A.Am.id,u.A.Yd,w,y,A,p,-1),C,512*d,m.Lm[d]),-1!==I.ga&&n.Vm(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0))}else o===f.A.om.id?(s?.Km(t,i,e,g,0,0,_,I.pl(f.A.Am.id,u.A.Yd,w,y,A,p,-1),C,d,256),-1!==I.ga&&n.Vm(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0))):o===f.A.am.id?(s?.Km(t,i,e,g,0,0,_,I.pl(f.A.Am.id,u.A.Yd,w,y,A,p,-1),C,d,512),-1!==I.ga&&n.Vm(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0))):o===f.A.lm.id&&(s?.Km(t,i,e,g,0,0,_,I.pl(f.A.Am.id,u.A.Yd,w,y,A,p,-1),C,d,768),-1!==I.ga&&n.Vm(new l.A(h,t,1,i,e,c.A.Do[I.ga],!0)))};cA=(t,i,e)=>8&this.Vr[t][i][e]?0:t<=0||!(2&this.Vr[1][i][e])?t:t-1}},3045:(t,i,e)=>{e.d(i,{A:()=>g});var s=e(4583),n=e(1161),r=e(3795),h=e(8256),o=e(670),a=e(9222),l=e(6855),c=e(7441),f=e(6666),u=e(5748),d=e(3479),w=e(8950),y=e(2771),m=e(5518),A=e(6169),p=e(3867);class g{static bA=new p.TA(8,32,51,51,!1);static OA=new p.fe(100,null);static RA=new Int32Array(o.A.Dr);static SA=new p.LA(o.A.Dr,500,null);static xA=new p.fe(500,null);static kA=new f.A;static MA=0;static DA=0;static NA=0;static FA=0;static BA=0;static PA=0;static UA=0;static WA=0;static GA=0;static YA=0;static HA=0;static VA=0;static KA=0;static XA=0;static jA=0;static zA=0;static ZA=0;static qA=0;static JA=0;static $A=0;static QA=0;static tp=0;static ip=!1;static ep=null;static sp=Uint8Array.of(19,55,38,155,255,110,137,205,76);static np=Uint8Array.of(160,192,80,96,0,144,80,48,160);static rp=Uint8Array.of(76,8,137,4,0,1,38,2,19);static hp=Int8Array.of(0,0,2,0,0,2,1,1,0);static op=Int8Array.of(2,0,0,2,0,0,0,4,4);static ap=Int8Array.of(0,4,4,8,0,0,8,0,0);static lp=Int8Array.of(1,1,0,0,0,8,0,0,8);static cp=Int8Array.of(53,-53,-53,53);static fp=Int8Array.of(-53,-53,53,53);static up=Int8Array.of(-45,45,45,-45);static dp=Int8Array.of(45,45,-45,-45);static wp=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static yp=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static mp=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static Ap=0;static Ha=0;static Va=0;static pp=-1;static gp=-1;static et=!0;static init=(t,i,e,n,r)=>{this.DA=0,this.NA=0,this.FA=t,this.BA=i,this.PA=t/2|0,this.UA=i/2|0;const h=new p.TA(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.WA=s.A.sin[t],this.GA=s.A.cos[t],this.YA=s.A.sin[i],this.HA=s.A.cos[i];const o=(t-128)/32|0,a=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const s=128*t,l=128*i;let c=!1;for(let t=-e;t<=n;t+=128)if(this.Ip(s,l,r[o]+t)){c=!0;break}h[o][a][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let r=-1;r<=1;r++)for(let o=-1;o<=1;o++){if(h[t][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}}this.bA[t][i][e+25][s+25]=n}};static So=()=>{this.OA=null,this.RA=null,this.SA=null,this.kA=null,this.bA=null,this.xA=null,this.ep=null,console.log('World3D unloaded!')};static pA=(t,i,e,s,n,r,o,a)=>{g.SA[t][g.RA[t]++]=new h.A(e/128|0,r/128|0,n/128|0,a/128|0,i,e,r,n,a,s,o)};static Ip=(t,i,e)=>{const s=i*this.YA+t*this.HA>>16,n=i*this.HA-t*this.YA>>16,r=e*this.WA+n*this.GA>>16,h=e*this.GA-n*this.WA>>16;if(r<50||r>3500)return!1;const o=this.PA+((s<<9)/r|0),a=this.UA+((h<<9)/r|0);return o>=this.DA&&o<=this.FA&&a>=this.NA&&a<=this.BA};_p;jm;zm;Cp;Ep;_h;vp;bp;Tp;Op=0;Rp=0;Sp=0;constructor(t,i,e,s){this._p=e,this.jm=s,this.zm=i,this.Ep=new p.Eh(e,s,i,null),this.vp=new p.aA(e,s+1,i+1),this.Cp=t,this._h=new p.fe(5e3,null),this.bp=new Int32Array(1e4),this.Tp=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.Rp=t;for(let i=0;i{const e=this.Ep[0][t][i];for(let e=0;e<3;e++){this.Ep[e][t][i]=this.Ep[e+1][t][i];const s=this.Ep[e][t][i];s&&s.level--}this.Ep[0][t][i]||(this.Ep[0][t][i]=new r.A(0,t,i));const s=this.Ep[0][t][i];s&&(s.xp=e),this.Ep[3][t][i]=null};yA=(t,i,e,s)=>{const n=this.Ep[t][i][e];n&&(n.kp=s)};uA=(t,i,e,s,n,h,o,a,l,c,f,u,w,A,p,g,I,_,C,E)=>{if(s===m.A.fA){for(let s=t;s>=0;s--)this.Ep[s][i][e]||(this.Ep[s][i][e]=new r.A(s,i,e));const s=this.Ep[t][i][e];s&&(s.Mp=new d.A(f,u,w,A,-1,C,!1))}else if(s===m.A.Dp){for(let s=t;s>=0;s--)this.Ep[s][i][e]||(this.Ep[s][i][e]=new r.A(s,i,e));const s=this.Ep[t][i][e];s&&(s.Mp=new d.A(p,g,I,_,h,E,o===a&&o===l&&o===c))}else{for(let s=t;s>=0;s--)this.Ep[s][i][e]||(this.Ep[s][i][e]=new r.A(s,i,e));const d=this.Ep[t][i][e];d&&(d.Np=new y.A(i,s,g,a,w,n,f,c,E,p,h,_,C,l,I,A,o,e,u))}};Hm=(t,i,e,s,n,h,o)=>{this.Ep[i][e][s]||(this.Ep[i][e][s]=new r.A(i,e,s));const l=this.Ep[i][e][s];l&&(l.Fp=new a.A(n,128*e+64,128*s+64,t,h,o))};Bp=(t,i,e)=>{const s=this.Ep[t][i][e];s&&(s.Fp=null)};Pp=(t,i,e,s,n,h,o,a)=>{let l=0;const c=this.Ep[s][t][i];if(c)for(let t=0;tl&&(l=e)}else this.Ep[s][t][i]=new r.A(s,t,i);const f=this.Ep[s][t][i];f&&(f.Gp=new u.A(e,128*t+64,128*i+64,h,o,a,n,l))};Yp=(t,i,e)=>{const s=this.Ep[t][i][e];s&&(s.Gp=null)};qy=(t,i,e,s,n,h,o,a,c,f)=>{if(!o&&!a)return;for(let s=t;s>=0;s--)this.Ep[s][i][e]||(this.Ep[s][i][e]=new r.A(s,i,e));const u=this.Ep[t][i][e];u&&(u.Hp=new l.A(s,128*i+64,128*e+64,n,h,o,a,c,f))};sm=(t,i,e,s)=>{const n=this.Ep[t][i][e];1===s&&n&&(n.Hp=null)};Km=(t,i,e,s,n,h,o,a,l,f,u)=>{if(!a)return;for(let s=t;s>=0;s--)this.Ep[s][i][e]||(this.Ep[s][i][e]=new r.A(s,i,e));const d=this.Ep[t][i][e];d&&(d.Vp=new c.A(s,128*i+n+64,128*e+h+64,u,f,a,o,l))};Kp=(t,i,e)=>{const s=this.Ep[t][i][e];s&&(s.Vp=null)};vA=(t,i,e,s)=>{const n=this.Ep[t][i][e];if(!n)return;const r=n.Vp;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};Xp=(t,i,e,s)=>{if(!s)return;const n=this.Ep[t][i][e];if(!n)return;const r=n.Vp;r&&(r.model=s)};jp=(t,i,e,s)=>{if(!s)return;const n=this.Ep[t][i][e];if(!n)return;const r=n.Fp;r&&(r.model=s)};zp=(t,i,e,s)=>{if(!s)return;const n=this.Ep[t][i][e];if(!n)return;const r=n.Hp;r&&(r.Zp=s)};qp=(t,i,e,s,n)=>{if(!s)return;const r=this.Ep[e][t][i];if(!r)return;const h=r.Hp;h&&(h.Zp=s,h.Jp=n)};Xy=(t,i,e,s,n,r,h,o,a,l,c)=>{if(!n&&!r)return!0;const f=128*i+64*a,u=128*e+64*l;return this.$p(f,u,s,t,i,e,a,l,n,r,h,o,c,!1)};Qp=(t,i,e,s,n,r,h,o,a,l)=>{if(!n&&!r)return!0;let c=i-a,f=s-a,u=i+a,d=s+a;return l&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.$p(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};tg=(t,i,e,s,n,r,h,o,a,l,c,f)=>!a&&!l||this.$p(i,s,e,t,n,r,h+1-n,o-r+1,a,l,c,0,f,!0);Zy=(t,i,e)=>{const s=this.Ep[t][i][e];if(s)for(let t=0;t>29&3)&&n.eg===i&&n.sg===e)return void this.ng(n)}};rg=(t,i,e,s)=>{if(!s)return;const n=this.Ep[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};hg=()=>{for(let t=0;t{const s=this.Ep[t][i][e];return s&&s.Hp?s.Hp.ig:0};og=(t,i,e)=>{const s=this.Ep[t][e][i];return s&&s.Vp?s.Vp.ig:0};ag=(t,i,e)=>{const s=this.Ep[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.eg===i&&n.sg===e)return n.ig}return 0};lg=(t,i,e)=>{const s=this.Ep[t][i][e];return s&&s.Fp?s.Fp.ig:0};cg=(t,i,e,s)=>{const n=this.Ep[t][i][e];if(n){if(n.Hp&&n.Hp.ig===s)return 255&n.Hp.info;if(n.Vp&&n.Vp.ig===s)return 255&n.Vp.info;if(n.Fp&&n.Fp.ig===s)return 255&n.Fp.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.Ep[t][i+1][e-1];n&&n.Fp&&n.Fp.model&&n.Fp.model.fg&&this.dg(s,n.Fp.model,128,0,-128,!0)}};ug=(t,i,e,s,n,r)=>{let h=!0,o=i;const a=i+s,l=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this._p){for(let u=o;u<=a;u++)if(!(u<0||u>=this.jm))for(let o=l;o<=c;o++){if(o<0||o>=this.zm||h&&u=e||u===i))continue;const l=this.Ep[f][u][o];if(!l)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.Cp[f][u][o]+this.Cp[f][u+1][o]+this.Cp[f][u][o+1]+this.Cp[f][u+1][o+1])/4|0)-((this.Cp[t][i][e]+this.Cp[t][i+1][e]+this.Cp[t][i][e+1]+this.Cp[t][i+1][e+1])/4|0),m=l.Hp;m&&m.Zp&&m.Zp.fg&&this.dg(r,m.Zp,d,y,w,h),m&&m.Jp&&m.Jp.fg&&this.dg(r,m.Jp,d,y,w,h);for(let t=0;t{this.Sp++;let h=0;const o=i.Bd,a=i.Fd;if(t.fg&&t.pg)for(let r=0;ri.gg)continue;const u=t.Bd[r]-e;if(ui._g)continue;const d=t.Pd[r]-n;if(di.Eg)continue;if(i.fg&&i.pg)for(let t=0;t{const h=this.Ep[t][i][e];if(!h)return;const o=h.Mp;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const a=h.Np;if(!a)return;const l=a.shape,c=a.angle,f=a.Lg,u=a.xg,d=g.wp[l],w=g.yp[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{g.ip=!0,g.Ha=t,g.Va=i,g.pp=-1,g.gp=-1};draw=(t,i,e,n,r,h,o)=>{t<0?t=0:t>=128*this.jm&&(t=128*this.jm-1),e<0?e=0:e>=128*this.zm&&(e=128*this.zm-1),g.MA++,g.WA=s.A.sin[h],g.GA=s.A.cos[h],g.YA=s.A.sin[r],g.HA=s.A.cos[r],g.ep=g.bA[(h-128)/32|0][r/64|0],g.VA=t,g.KA=i,g.XA=e,g.jA=t/128|0,g.zA=e/128|0,g.QA=n,g.ZA=g.jA-25,g.ZA<0&&(g.ZA=0),g.JA=g.zA-25,g.JA<0&&(g.JA=0),g.qA=g.jA+25,g.qA>this.jm&&(g.qA=this.jm),g.$A=g.zA+25,g.$A>this.zm&&(g.$A=this.zm),this.kg(),g.tp=0;for(let t=this.Rp;t=2e3)?(h.visible=!0,h.update=!0,h.Mg=h.Up>0,g.tp++):(h.visible=!1,h.update=!1,h.Dg=0))}}for(let t=this.Rp;t=g.qA))for(let t=-25;t<=0;t++){const n=g.zA+t,r=g.zA-t;let h;if(e>=g.ZA&&(n>=g.JA&&(h=i[e][n],h&&h.visible&&this.Ng(h,!0,o)),r=g.JA&&(h=i[s][n],h&&h.visible&&this.Ng(h,!0,o)),r=g.qA))for(let t=-25;t<=0;t++){const n=g.zA+t,r=g.zA-t;let h;if(e>=g.ZA&&(n>=g.JA&&(h=i[e][n],h&&h.visible&&this.Ng(h,!1,o)),r=g.JA&&(h=i[s][n],h&&h.visible&&this.Ng(h,!1,o)),r{if(!c&&!f)return!1;for(let t=h;t=this.jm||i>=this.zm)return!1;const e=this.Ep[s][t][i];if(e&&e.Up>=5)return!1}const m=new n.A(s,e,t,i,c,f,w,h,h+a-1,o,o+l-1,u,d);for(let t=h;th&&(e|=1),to&&(e+=8),i=0;e--)this.Ep[e][t][i]||(this.Ep[e][t][i]=new r.A(e,t,i));const n=this.Ep[s][t][i];n&&(n.Wp[n.Up]=m,n.Fg[n.Up]=e,n.Bg|=e,n.Up++)}return y&&(this._h[this.Op++]=m),!0};ng=t=>{for(let i=t.eg;i<=t.yg;i++)for(let e=t.sg;e<=t.mg;e++){const s=this.Ep[t.level][i][e];if(s){for(let i=0;i{const t=g.RA[g.QA],i=g.SA[g.QA];g.Ap=0;for(let e=0;e=0&&s<=50){n=t.Ug+25-g.zA,n<0&&(n=0),r=t.zm+25-g.zA,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.ep&&g.ep[s][n++]){i=!0;break}if(i){if(h=g.VA-t.Ig,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.Wg=(t.Cg-g.XA<<8)/h|0,t.Gg=(t.Eg-g.XA<<8)/h|0,t.Yg=(t.gg-g.KA<<8)/h|0,t.Hg=(t.jd-g.KA<<8)/h|0,g.xA[g.Ap++]=t}}}else if(2===t.type){if(s=t.Ug+25-g.zA,s>=0&&s<=50){n=t.Pg+25-g.jA,n<0&&(n=0),r=t.jm+25-g.jA,r>50&&(r=50);let i=!1;for(;n<=r;)if(g.ep&&g.ep[n++][s]){i=!0;break}if(i){if(h=g.XA-t.Cg,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.Vg=(t.Ig-g.VA<<8)/h|0,t.Kg=(t._g-g.VA<<8)/h|0,t.Yg=(t.gg-g.KA<<8)/h|0,t.Hg=(t.jd-g.KA<<8)/h|0,g.xA[g.Ap++]=t}}}else if(4===t.type&&(s=t.gg-g.KA,s>128&&(n=t.Ug+25-g.zA,n<0&&(n=0),r=t.zm+25-g.zA,r>50&&(r=50),n<=r))){let i=t.Pg+25-g.jA;i<0&&(i=0),h=t.jm+25-g.jA,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(g.ep&&g.ep[t][i]){e=!0;break t}e&&(t.mode=5,t.Vg=(t.Ig-g.VA<<8)/s|0,t.Kg=(t._g-g.VA<<8)/s|0,t.Wg=(t.Cg-g.XA<<8)/s|0,t.Gg=(t.Eg-g.XA<<8)/s|0,g.xA[g.Ap++]=t)}}};Ng=(t,i,e)=>{for(g.kA.Vm(t);;){let t;do{if(t=g.kA.Xg(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.jg,o=this.Ep[r];if(t.visible){if(i){if(r>0){const t=this.Ep[r-1][s][n];if(t&&t.update)continue}if(s<=g.jA&&s>g.ZA){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.Bg)))continue}if(s>=g.jA&&sg.JA){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.Bg)))continue}if(n>=g.zA&&nn&&(l+=6),c=g.sp[l],t.Qg=g.rp[l]),f&&(f.tI&g.np[l]?16===f.tI?(t.Dg=3,t.iI=g.hp[l],t.eI=3-t.iI):32===f.tI?(t.Dg=6,t.iI=g.op[l],t.eI=6-t.iI):64===f.tI?(t.Dg=12,t.iI=g.ap[l],t.eI=12-t.iI):(t.Dg=9,t.iI=g.lp[l],t.eI=9-t.iI):t.Dg=0,f.tI&c&&!this.sI(h,s,n,f.tI)&&f.Zp?.draw(0,g.WA,g.GA,g.YA,g.HA,f.x-g.VA,f.y-g.KA,f.z-g.XA,f.ig),f.nI&c&&!this.sI(h,s,n,f.nI)&&f.Jp?.draw(0,g.WA,g.GA,g.YA,g.HA,f.x-g.VA,f.y-g.KA,f.z-g.XA,f.ig)),u&&!this.visible(h,s,n,u.model.jd))if(u.type&c)u.model.draw(u.angle,g.WA,g.GA,g.YA,g.HA,u.x-g.VA,u.y-g.KA,u.z-g.XA,u.ig);else if(768&u.type){const t=u.x-g.VA,i=u.y-g.KA,e=u.z-g.XA,s=u.angle;let n,r;if(n=s===A.A.jy||s===A.A.$y?-t:t,r=s===A.A.$y||s===A.A.zy?-e:e,256&u.type&&rn){const n=t+g.up[s],r=e+g.dp[s];u.model.draw(512*s+1280&2047,g.WA,g.GA,g.YA,g.HA,n,i,r,u.ig)}}if(a){const i=t.Fp;i&&i.model?.draw(0,g.WA,g.GA,g.YA,g.HA,i.x-g.VA,i.y-g.KA,i.z-g.XA,i.ig);const e=t.Gp;e&&0===e.offset&&(e.rI&&e.rI.draw(0,g.WA,g.GA,g.YA,g.HA,e.x-g.VA,e.y-g.KA,e.z-g.XA,e.ig),e.hI&&e.hI.draw(0,g.WA,g.GA,g.YA,g.HA,e.x-g.VA,e.y-g.KA,e.z-g.XA,e.ig),e.oI&&e.oI.draw(0,g.WA,g.GA,g.YA,g.HA,e.x-g.VA,e.y-g.KA,e.z-g.XA,e.ig))}const d=t.Bg;if(0!==d){if(sg.jA&&1&d){const t=o[s-1][n];t&&t.update&&g.kA.Vm(t)}if(n>g.zA&&8&d){const t=o[s][n-1];t&&t.update&&g.kA.Vm(t)}}}if(0!==t.Dg){let i=!0;for(let e=0;ei.eg&&(r+=1),ei.sg&&(r+=8),ss&&(s=n);const h=g.zA-i.sg,a=i.mg-g.zA;i.aI=a>h?s+a:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.aI,i=e))}if(-1===i)break;const a=g.OA[i];if(a){a.MA=g.MA;let t=a.model;t||(t=a.Jg?.draw(e)??null),t&&!this.lI(h,a.eg,a.yg,a.sg,a.mg,t.jd)&&t.draw(a.$g,g.WA,g.GA,g.YA,g.HA,a.x-g.VA,a.y-g.KA,a.z-g.XA,a.ig);for(let t=a.eg;t<=a.yg;t++)for(let i=a.sg;i<=a.mg;i++){const e=o[t][i];e&&(0!==e.Dg?g.kA.Vm(e):t===s&&i===n||!e.update||g.kA.Vm(e))}}}if(t.Mg)continue}if(!t.update||0!==t.Dg)continue;if(s<=g.jA&&s>g.ZA){const t=o[s-1][n];if(t&&t.update)continue}if(s>=g.jA&&sg.JA){const t=o[s][n-1];if(t&&t.update)continue}if(n>=g.zA&&n=r){const r=t+g.cp[n],h=s+g.fp[n];i.model.draw(512*n+256,g.WA,g.GA,g.YA,g.HA,r,e,h,i.ig)}if(512&i.type&&h<=r){const r=t+g.up[n],h=s+g.dp[n];i.model.draw(512*n+1280&2047,g.WA,g.GA,g.YA,g.HA,r,e,h,i.ig)}}const e=t.Hp;e&&(e.nI&t.Qg&&!this.sI(h,s,n,e.nI)&&e.Jp?.draw(0,g.WA,g.GA,g.YA,g.HA,e.x-g.VA,e.y-g.KA,e.z-g.XA,e.ig),e.tI&t.Qg&&!this.sI(h,s,n,e.tI)&&e.Zp?.draw(0,g.WA,g.GA,g.YA,g.HA,e.x-g.VA,e.y-g.KA,e.z-g.XA,e.ig))}if(rg.jA){const t=o[s-1][n];t&&t.update&&g.kA.Vm(t)}if(n>g.zA){const t=o[s][n-1];t&&t.update&&g.kA.Vm(t)}}};Zg=(t,i,e,n,r,h,o,a)=>{let l,c,f,u,d=l=(e<<7)-g.VA,y=c=(n<<7)-g.XA,m=f=d+128,A=u=y+128,p=this.Cp[i][e][n]-g.KA,I=this.Cp[i][e+1][n]-g.KA,_=this.Cp[i][e+1][n+1]-g.KA,C=this.Cp[i][e][n+1]-g.KA,E=y*o+d*a>>16;if(y=y*a-d*o>>16,d=E,E=p*h-y*r>>16,y=p*r+y*h>>16,p=E,y<50)return;if(E=c*o+m*a>>16,c=c*a-m*o>>16,m=E,E=I*h-c*r>>16,c=I*r+c*h>>16,I=E,c<50)return;if(E=A*o+f*a>>16,A=A*a-f*o>>16,f=E,E=_*h-A*r>>16,A=_*r+A*h>>16,_=E,A<50)return;if(E=u*o+l*a>>16,u=u*a-l*o>>16,l=E,E=C*h-u*r>>16,u=C*r+u*h>>16,C=E,u<50)return;const v=s.A.yl+((d<<9)/y|0),b=s.A.ml+((p<<9)/y|0),T=s.A.yl+((m<<9)/c|0),O=s.A.ml+((I<<9)/c|0),R=s.A.yl+((f<<9)/A|0),S=s.A.ml+((_<<9)/A|0),L=s.A.yl+((l<<9)/u|0),x=s.A.ml+((C<<9)/u|0);if(s.A.alpha=0,(R-L)*(O-x)-(S-x)*(T-L)>0)if(s.A.cI=R<0||L<0||T<0||R>w.A.fI||L>w.A.fI||T>w.A.fI,g.ip&&this.uI(g.Ha,g.Va,S,x,O,R,L,T)&&(g.pp=e,g.gp=n),-1===t.dI)12345678!==t.wI&&s.A.yI(R,L,T,S,x,O,t.wI,t.mI,t.AI);else if(g.et){const i=g.mp[t.dI];s.A.yI(R,L,T,S,x,O,this.pI(i,t.wI),this.pI(i,t.mI),this.pI(i,t.AI))}else t.flat?s.A.gI(R,L,T,S,x,O,t.wI,t.mI,t.AI,d,p,y,m,l,I,C,c,u,t.dI):s.A.gI(R,L,T,S,x,O,t.wI,t.mI,t.AI,f,_,A,l,m,C,I,u,c,t.dI);if(!((v-T)*(x-O)-(b-O)*(L-T)<=0))if(s.A.cI=v<0||T<0||L<0||v>w.A.fI||T>w.A.fI||L>w.A.fI,g.ip&&this.uI(g.Ha,g.Va,b,O,x,v,T,L)&&(g.pp=e,g.gp=n),-1!==t.dI){if(!g.et)return void s.A.gI(v,T,L,b,O,x,t.II,t.AI,t.mI,d,p,y,m,l,I,C,c,u,t.dI);const i=g.mp[t.dI];s.A.yI(v,T,L,b,O,x,this.pI(i,t.II),this.pI(i,t.AI),this.pI(i,t.mI))}else 12345678!==t.II&&s.A.yI(v,T,L,b,O,x,t.II,t.AI,t.mI)};qg=(t,i,e,n,r,h,o)=>{let a=e.Bd.length;for(let t=0;t>16;if(l=l*o-i*h>>16,i=c,c=a*r-l*n>>16,l=a*n+l*r>>16,a=c,l<50)return;e._I&&(y.A.CI[t]=i,y.A.EI[t]=a,y.A.vI[t]=l),y.A.bI[t]=s.A.yl+((i<<9)/l|0),y.A.TI[t]=s.A.ml+((a<<9)/l|0)}s.A.alpha=0,a=e.OI.length;for(let n=0;n0)if(s.A.cI=a<0||l<0||c<0||a>w.A.fI||l>w.A.fI||c>w.A.fI,g.ip&&this.uI(g.Ha,g.Va,f,u,d,a,l,c)&&(g.pp=t,g.gp=i),e._I&&-1!==e._I[n])if(g.et){const t=g.mp[e._I[n]];s.A.yI(a,l,c,f,u,d,this.pI(t,e.LI[n]),this.pI(t,e.xI[n]),this.pI(t,e.kI[n]))}else e.flat?s.A.gI(a,l,c,f,u,d,e.LI[n],e.xI[n],e.kI[n],y.A.CI[0],y.A.EI[0],y.A.vI[0],y.A.CI[1],y.A.CI[3],y.A.EI[1],y.A.EI[3],y.A.vI[1],y.A.vI[3],e._I[n]):s.A.gI(a,l,c,f,u,d,e.LI[n],e.xI[n],e.kI[n],y.A.CI[r],y.A.EI[r],y.A.vI[r],y.A.CI[h],y.A.CI[o],y.A.EI[h],y.A.EI[o],y.A.vI[h],y.A.vI[o],e._I[n]);else 12345678!==e.LI[n]&&s.A.yI(a,l,c,f,u,d,e.LI[n],e.xI[n],e.kI[n])}};zg=(t,i,e)=>{const s=this.vp[t][i][e];if(s===-g.MA)return!1;if(s===g.MA)return!0;{const s=i<<7,n=e<<7;return this.MI(s+1,this.Cp[t][i][e],n+1)&&this.MI(s+128-1,this.Cp[t][i+1][e],n+1)&&this.MI(s+128-1,this.Cp[t][i+1][e+1],n+128-1)&&this.MI(s+1,this.Cp[t][i][e+1],n+128-1)?(this.vp[t][i][e]=g.MA,!0):(this.vp[t][i][e]=-g.MA,!1)}};sI=(t,i,e,s)=>{if(!this.zg(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.Cp[t][i][e]-1,o=h-120,a=h-230,l=h-238;if(s<16){if(1===s){if(n>g.VA){if(!this.MI(n,h,r))return!1;if(!this.MI(n,h,r+128))return!1}if(t>0){if(!this.MI(n,o,r))return!1;if(!this.MI(n,o,r+128))return!1}return!!this.MI(n,a,r)&&this.MI(n,a,r+128)}if(2===s){if(r0){if(!this.MI(n,o,r+128))return!1;if(!this.MI(n+128,o,r+128))return!1}return!!this.MI(n,a,r+128)&&this.MI(n+128,a,r+128)}if(4===s){if(n0){if(!this.MI(n+128,o,r))return!1;if(!this.MI(n+128,o,r+128))return!1}return!!this.MI(n+128,a,r)&&this.MI(n+128,a,r+128)}if(8===s){if(r>g.XA){if(!this.MI(n,h,r))return!1;if(!this.MI(n+128,h,r))return!1}if(t>0){if(!this.MI(n,o,r))return!1;if(!this.MI(n+128,o,r))return!1}return!!this.MI(n,a,r)&&this.MI(n+128,a,r)}}return!!this.MI(n+64,l,r+64)&&(16===s?this.MI(n,a,r+128):32===s?this.MI(n+128,a,r+128):64===s?this.MI(n+128,a,r):128===s?this.MI(n,a,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.zg(t,i,e)){const n=i<<7,r=e<<7;return this.MI(n+1,this.Cp[t][i][e]-s,r+1)&&this.MI(n+128-1,this.Cp[t][i+1][e]-s,r+1)&&this.MI(n+128-1,this.Cp[t][i+1][e+1]-s,r+128-1)&&this.MI(n+1,this.Cp[t][i][e+1]-s,r+128-1)}return!1};lI=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.vp[t][h][o]===-g.MA)return!1;o=1+(i<<7);const a=2+(s<<7),l=this.Cp[t][i][s]-r;if(!this.MI(o,l,a))return!1;const c=(e<<7)-1;if(!this.MI(c,l,a))return!1;const f=(n<<7)-1;return!!this.MI(o,l,f)&&this.MI(c,l,f)}return!!this.zg(t,i,s)&&(h=i<<7,o=s<<7,this.MI(h+1,this.Cp[t][i][s]-r,o+1)&&this.MI(h+128-1,this.Cp[t][i+1][s]-r,o+1)&&this.MI(h+128-1,this.Cp[t][i+1][s+1]-r,o+128-1)&&this.MI(h+1,this.Cp[t][i][s+1]-r,o+128-1))};MI=(t,i,e)=>{for(let s=0;s0){const t=n.Cg+(n.Wg*s>>8),r=n.Eg+(n.Gg*s>>8),h=n.gg+(n.Yg*s>>8),o=n.jd+(n.Hg*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.Ig;if(s>0){const t=n.Cg+(n.Wg*s>>8),r=n.Eg+(n.Gg*s>>8),h=n.gg+(n.Yg*s>>8),o=n.jd+(n.Hg*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.Cg-e;if(s>0){const e=n.Ig+(n.Vg*s>>8),r=n._g+(n.Kg*s>>8),h=n.gg+(n.Yg*s>>8),o=n.jd+(n.Hg*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.Cg;if(s>0){const e=n.Ig+(n.Vg*s>>8),r=n._g+(n.Kg*s>>8),h=n.gg+(n.Yg*s>>8),o=n.jd+(n.Hg*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.gg;if(s>0){const i=n.Ig+(n.Vg*s>>8),r=n._g+(n.Kg*s>>8),h=n.Cg+(n.Wg*s>>8),o=n.Eg+(n.Gg*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};uI=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const a=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*a>0&&a*((i-n)*(r-o)-(t-o)*(e-n))>0};pI=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{}},4197:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{DI;NI;FI;BI;index;Qw;Ca;_a;constructor(t,i,e,s,n,r,h){super(),this.DI=i,this.NI=e,this.FI=s,this.BI=n,this.index=t,this.Qw=r,h&&-1!==r.va&&this.Qw.delay?(this.Ca=Math.random()*this.Qw.Ea|0,this._a=Math.random()*this.Qw.delay[this.Ca]|0):(this.Ca=-1,this._a=0)}}},9418:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(7121),n=e(1312),r=e(3867);class h extends s.A{x=0;z=0;$g=0;UI=!1;size=1;Wl=-1;WI=-1;GI=-1;YI=-1;HI=-1;VI=-1;KI=-1;XI=null;jI=100;zI=0;ZI=0;qI=0;JI=0;$I=-1e3;QI=0;t_=0;i_=-1;e_=0;s_=0;n_=-1;r_=0;h_=0;o_=-1;a_=0;l_=0;c_=0;f_=0;u_=-1;d_=0;w_=0;y_=0;m_=0;A_=0;p_=0;g_=0;I_=0;__=0;C_=0;E_=0;MA=0;height=0;v_=0;pathLength=0;b_=new Int32Array(10);T_=new Int32Array(10);O_=new r.fe(10,!1);R_=0;S_=-1;L_=-1;x_=-1;k_=-1;move(t,i,e){if(-1!==this.o_&&n.A.Do[this.o_].priority<=1&&(this.o_=-1),!t){const t=i-this.b_[0],s=e-this.T_[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.b_[t]=this.b_[t-1],this.T_[t]=this.T_[t-1],this.O_[t]=this.O_[t-1];return this.b_[0]=i,this.T_[0]=e,void(this.O_[0]=!1)}}this.pathLength=0,this.R_=0,this.b_[0]=i,this.T_[0]=e,this.x=128*this.b_[0]+64*this.size,this.z=128*this.T_[0]+64*this.size}step(t,i){let e=this.b_[0],s=this.T_[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.o_&&n.A.Do[this.o_].priority<=1&&(this.o_=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.b_[t]=this.b_[t-1],this.T_[t]=this.T_[t-1],this.O_[t]=this.O_[t-1];this.b_[0]=e,this.T_[0]=s,this.O_[0]=t}}},8268:(t,i,e)=>{e.d(i,{A:()=>d});var s=e(9418),n=e(8665),r=e(2679),h=e(8738),o=e(1312),a=e(8317),l=e(1302),c=e(3819),f=e(3867),u=e(9298);class d extends s.A{static M_=1;static D_=2;static N_=4;static F_=8;static B_=16;static P_=32;static U_=64;static W_=128;static G_=256;static Y_=512;static Ul=[u.A.H_,u.A.V_,u.A.K_,u.A.X_,u.A.j_,u.A.z_,u.A.Z_,u.A.q_,u.A.J_,u.A.Q_,u.A.tC,u.A.iC,u.A.eC,u.A.sC,u.A.nC,u.A.rC];static Pl=[[u.A.hC,u.A.oC,u.A.aC,u.A.lC,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.mC,u.A.AC],[u.A.pC,u.A.gC,u.A.IC,u.A._C,u.A.CC,u.A.EC,u.A.vC,u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.SC,u.A.LC,u.A.xC,u.A.kC,u.A.MC],[u.A.MC-1,u.A.pC+1,u.A.gC,u.A.IC,u.A._C,u.A.CC,u.A.EC,u.A.vC,u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.SC,u.A.LC,u.A.xC,u.A.kC],[u.A.DC,u.A.NC,u.A.FC,u.A.BC,u.A.PC,u.A.UC],[u.A.WC,u.A.GC,u.A.YC,u.A.HC,u.A.VC,u.A.KC,u.A.XC,u.A.jC]];static No=new r.A(200);name=null;visible=!1;zC=0;ZC=0;qC=new Uint16Array(12);JC=new Uint16Array(5);ic=0;$C=0n;y=0;QC=0;tE=0;iE=0;eE=0;sE=0;nE=null;Pg=0;Ug=0;jm=0;zm=0;et=!1;draw(t){if(!this.visible)return null;let i=this.sw();if(this.height=i.jd,i.ow=!0,this.et)return i;if(-1!==this.u_&&-1!==this.d_){const t=h.A.Do[this.u_],e=n.A.Mu(t.pl(),!0,!t.pd,!1);e.translate(-this.m_,0,0),e.Gl(),t.Qw&&t.Qw.frames&&e.Yl(t.Qw.frames[this.d_]),e.Hd=null,e.Vd=null,128===t.iw&&128===t.ew||e.scale(t.iw,t.ew,t.iw),e.Hl(t.Id+64,t._d+850,-30,-50,-30,!0);const s=[i,e];i=n.A.rE(s,2)}if(this.nE&&(t>=this.tE&&(this.nE=null),t>=this.QC&&t=d.Pl[i].length)&&(e=0),this.JC[i]=e}this.Wl=t.mu,65535===this.Wl&&(this.Wl=-1),this.WI=t.mu,65535===this.WI&&(this.WI=-1),this.GI=t.mu,65535===this.GI&&(this.GI=-1),this.YI=t.mu,65535===this.YI&&(this.YI=-1),this.HI=t.mu,65535===this.HI&&(this.HI=-1),this.VI=t.mu,65535===this.VI&&(this.VI=-1),this.KI=t.mu,65535===this.KI&&(this.KI=-1),this.name=c.A.kl(c.A.Ml(t.hE)),this.ic=t.pu,this.visible=!0,this.$C=0n;for(let t=0;t<12;t++)this.$C<<=0x4n,this.qC[t]>=256&&(this.$C+=BigInt(this.qC[t])-256n);this.qC[0]>=256&&(this.$C+=BigInt(this.qC[0])-256n>>4n),this.qC[1]>=256&&(this.$C+=BigInt(this.qC[1])-256n>>8n);for(let t=0;t<5;t++)this.$C<<=0x3n,this.$C+=BigInt(this.JC[t]);this.$C<<=0x1n,this.$C+=BigInt(this.zC)}ed(){if(!this.visible)return null;const t=new f.fe(12,null);let i=0;for(let e=0;e<12;e++){const s=this.qC[e];if(s>=256&&s<512&&(t[i++]=a.A.Do[s-256].ed()),s>=512){const e=l.A.get(s-512).ed(this.zC);e&&(t[i++]=e)}}const e=n.A.Fl(t,i);for(let t=0;t<5;t++)0!==this.JC[t]&&(e.Bl(d.Pl[t][0],d.Pl[t][this.JC[t]]),1===t&&e.Bl(d.Ul[0],d.Ul[this.JC[t]]));return e}sw(){let t=this.$C,i=-1,e=-1,s=-1,r=-1;if(this.o_>=0&&0===this.c_){const n=o.A.Do[this.o_];if(n.frames&&(i=n.frames[this.a_]),this.n_>=0&&this.n_!==this.Wl){const t=o.A.Do[this.n_].frames;t&&(e=t[this.r_])}n.qw>=0&&(s=n.qw,t+=BigInt(s-this.qC[5])<<8n),n.Jw>=0&&(r=n.Jw,t+=BigInt(r-this.qC[3])<<16n)}else if(this.n_>=0){const t=o.A.Do[this.n_].frames;t&&(i=t[this.r_])}let h=d.No?.get(t);if(!h){const i=new f.fe(12,null);let e=0;for(let t=0;t<12;t++){let n=this.qC[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=a.A.Do[n-256].pl();t&&(i[e++]=t)}if(n>=512){const t=l.A.get(n-512).jw(this.zC);t&&(i[e++]=t)}}h=n.A.Fl(i,e);for(let t=0;t<5;t++)0!==this.JC[t]&&(h.Bl(d.Pl[t][0],d.Pl[t][this.JC[t]]),1===t&&h.Bl(d.Ul[0],d.Ul[this.JC[t]]));h.Gl(),h.Hl(64,850,-30,-50,-30,!0),d.No?.put(t,h)}if(this.et)return h;const c=n.A.nw(h,!0);return-1!==i&&-1!==e?c.rw(i,e,o.A.Do[this.o_].zw):-1!==i&&c.Yl(i),c.hw(),c.Hd=null,c.Vd=null,c}}},9222:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;model;ig;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.ig=n,this.info=r}}},1161:(t,i,e)=>{e.d(i,{A:()=>s});class s{level;y;x;z;model;Jg;$g;eg;yg;sg;mg;ig;info;aI=0;MA=0;constructor(t,i,e,s,n,r,h,o,a,l,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.Jg=r,this.$g=h,this.eg=o,this.yg=a,this.sg=l,this.mg=c,this.ig=f,this.info=u}}},5748:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;oI;hI;rI;ig;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.oI=s,this.hI=n,this.rI=r,this.ig=h,this.offset=o}}},8256:(t,i,e)=>{e.d(i,{A:()=>s});class s{Pg;jm;Ug;zm;type;Ig;_g;Cg;Eg;gg;jd;mode=0;Vg=0;Kg=0;Wg=0;Gg=0;Yg=0;Hg=0;constructor(t,i,e,s,n,r,h,o,a,l,c){this.Pg=t,this.jm=i,this.Ug=e,this.zm=s,this.type=n,this.Ig=r,this._g=h,this.Cg=o,this.Eg=a,this.gg=l,this.jd=c}}},3795:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1982),n=e(3867);class r extends s.A{level;x;z;jg;Wp;Fg;Mp=null;Np=null;Hp=null;Vp=null;Fp=null;Gp=null;xp=null;Up=0;Bg=0;kp=0;visible=!1;update=!1;Mg=!1;Dg=0;iI=0;eI=0;Qg=0;constructor(t,i,e){super(),this.jg=this.level=t,this.x=i,this.z=e,this.Wp=new n.fe(5,null),this.Fg=new Int32Array(5)}}},2771:(t,i,e)=>{e.d(i,{A:()=>s});class s{static bI=new Int32Array(6);static TI=new Int32Array(6);static CI=new Int32Array(6);static EI=new Int32Array(6);static vI=new Int32Array(6);static oE=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static aE=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static lE=128;static cE=this.lE/2|0;static fE=this.lE/4|0;static uE=3*this.lE/4|0;Bd;Ud;Pd;LI;xI;kI;OI;RI;SI;_I;flat;shape;angle;Lg;xg;constructor(t,i,e,n,r,h,o,a,l,c,f,u,d,w,y,m,A,p,g){this.flat=!(A!==n||A!==w||A!==a),this.shape=i,this.angle=h,this.Lg=d,this.xg=l;const I=s.oE[i],_=I.length;this.Bd=new Int32Array(_),this.Ud=new Int32Array(_),this.Pd=new Int32Array(_);const C=new Int32Array(_),E=new Int32Array(_),v=t*s.lE,b=p*s.lE;for(let t=0;t<_;t++){let i,l,f,d,p,_=I[t];!(1&_)&&_<=8&&(_=1+(_-h-h-1&7)),_>8&&_<=12&&(_=9+(_-h-9&3)),_>12&&_<=16&&(_=13+(_-h-13&3)),1===_?(i=v,l=b,f=A,d=o,p=c):2===_?(i=v+s.cE,l=b,f=A+n>>1,d=o+g>>1,p=c+e>>1):3===_?(i=v+s.lE,l=b,f=n,d=g,p=e):4===_?(i=v+s.lE,l=b+s.cE,f=n+w>>1,d=g+r>>1,p=e+y>>1):5===_?(i=v+s.lE,l=b+s.lE,f=w,d=r,p=y):6===_?(i=v+s.cE,l=b+s.lE,f=w+a>>1,d=r+m>>1,p=y+u>>1):7===_?(i=v,l=b+s.lE,f=a,d=m,p=u):8===_?(i=v,l=b+s.cE,f=a+A>>1,d=m+o>>1,p=u+c>>1):9===_?(i=v+s.cE,l=b+s.fE,f=A+n>>1,d=o+g>>1,p=c+e>>1):10===_?(i=v+s.uE,l=b+s.cE,f=n+w>>1,d=g+r>>1,p=e+y>>1):11===_?(i=v+s.cE,l=b+s.uE,f=w+a>>1,d=r+m>>1,p=y+u>>1):12===_?(i=v+s.fE,l=b+s.cE,f=a+A>>1,d=m+o>>1,p=u+c>>1):13===_?(i=v+s.fE,l=b+s.fE,f=A,d=o,p=c):14===_?(i=v+s.uE,l=b+s.fE,f=n,d=g,p=e):15===_?(i=v+s.uE,l=b+s.uE,f=w,d=r,p=y):(i=v+s.fE,l=b+s.uE,f=a,d=m,p=u),this.Bd[t]=i,this.Ud[t]=f,this.Pd[t]=l,C[t]=d,E[t]=p}const T=s.aE[i],O=T.length/4|0;this.OI=new Int32Array(O),this.RI=new Int32Array(O),this.SI=new Int32Array(O),this.LI=new Int32Array(O),this.xI=new Int32Array(O),this.kI=new Int32Array(O),this._I=-1!==f?new Int32Array(O):null;let R=0;for(let t=0;t{e.d(i,{A:()=>s});class s{static fA=0;static Dp=1;static dE=2;static wE=3;static yE=4;static mE=5;static cE=6;static fE=7;static uE=8;static AE=9;static pE=10;static gE=11}},3479:(t,i,e)=>{e.d(i,{A:()=>s});class s{II;AI;wI;mI;dI;color;flat;constructor(t,i,e,s,n,r,h){this.II=t,this.AI=i,this.wI=e,this.mI=s,this.dI=n,this.color=r,this.flat=h}}},6855:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;tI;nI;Zp;Jp;ig;info;constructor(t,i,e,s,n,r,h,o,a){this.y=t,this.x=i,this.z=e,this.tI=s,this.nI=n,this.Zp=r,this.Jp=h,this.ig=o,this.info=a}}},7441:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;type;angle;model;ig;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.ig=h,this.info=o}}},7536:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{IE;_E;constructor(t){this._E=[],this.IE=t;for(let i=0;i{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{EE;vE;constructor(){super(),this.EE=this,this.vE=this}bE(){this.vE&&this.EE&&(this.vE.EE=this.EE,this.EE.vE=this.vE,this.EE=null,this.vE=null)}}},3819:(t,i,e)=>{e.d(i,{A:()=>s});class s{static TE=['_','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','0','1','2','3','4','5','6','7','8','9'];static OE=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static Ml=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.TE[Number(s-37n*t)]}return e.slice(12-i).join('')};static RE=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static SE=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static kl=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static Lu=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}},6666:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{LE;cursor=null;constructor(){const t=new s.A;t.next=t,t.CE=t,this.LE=t}Vm(t){t.CE&&t.ww(),t.CE=this.LE.CE,t.next=this.LE,t.CE&&(t.CE.next=t),t.next.CE=t}xE(t){t.CE&&t.ww(),t.CE=this.LE,t.next=this.LE.next,t.CE.next=t,t.next&&(t.next.CE=t)}Xg(){const t=this.LE.next;return t===this.LE?null:(t?.ww(),t)}head(){const t=this.LE.next;return t===this.LE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}kE(){const t=this.LE.CE;return t===this.LE?(this.cursor=null,null):(this.cursor=t?.CE||null,t)}next(){const t=this.cursor;return t===this.LE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}CE(){const t=this.cursor;return t===this.LE?(this.cursor=null,null):(this.cursor=t?.CE||null,t)}clear(){for(;;){const t=this.LE.next;if(t===this.LE)return;t?.ww()}}}},1982:(t,i,e)=>{e.d(i,{A:()=>s});class s{key;next;CE;constructor(){this.key=0n,this.next=this,this.CE=this}ww(){this.CE&&this.next&&(this.CE.next=this.next,this.next.CE=this.CE,this.next=null,this.CE=null)}}},2679:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(2512),n=e(7536);class r{ME;DE;history;available;constructor(t){this.ME=t,this.available=t,this.DE=new n.A(1024),this.history=new s.A}get(t){const i=this.DE.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.ww(),t?.bE()}else this.available--;this.DE.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.ww(),t.bE()):this.available=this.ME}}},2512:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n{head;constructor(){this.head=new s.A}push(t){t.vE&&t.bE(),t.vE=this.head.vE,t.EE=this.head,t.vE&&(t.vE.EE=t),t.EE.vE=t}pop(){const t=this.head.EE;return t===this.head?null:(t?.bE(),t)}}},8534:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(3867);class r{static Do=[];static yu=t=>{const i=new s.A(t.read('base_head.dat')),e=new s.A(t.read('base_type.dat')),h=new s.A(t.read('base_label.dat')),o=i.mu;i.pf+=2;for(let t=0;t{e.d(i,{A:()=>r});var s=e(8534),n=e(1069);class r{static Do=[];static yu=t=>{const i=new n.A(t.read('frame_head.dat')),e=new n.A(t.read('frame_tran1.dat')),h=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),a=i.mu;i.pf+=2;const l=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){l[m]=i,c[m]=0,f[m]=0,u[m]=0,m++;break}l[m]=t;let e=0;3===d.types[l[m]]&&(e=128),c[m]=1&i?h.FE:e,f[m]=2&i?h.FE:e,u[m]=4&i?h.FE:e,y=t,m++}}n.length=m,n.BE=new Int32Array(m),n.x=new Int32Array(m),n.y=new Int32Array(m),n.z=new Int32Array(m);for(let t=0;t{e.d(i,{Nc:()=>s,na:()=>n,PE:()=>o,UE:()=>h,WE:()=>r});const s=document.getElementById('canvas'),n=s.getContext('2d',{willReadFrequently:!0}),r=document.createElement('canvas'),h=document.createElement('img'),o=r.getContext('2d',{willReadFrequently:!0})},9298:(t,i,e)=>{e.d(i,{A:()=>s});class s{static RED=16711680;static GREEN=65280;static BLUE=255;static qa=16776960;static GE=65535;static wA=16711935;static La=16777215;static Za=0;static YE=16748608;static HE=8388608;static VE=128;static KE=16756736;static XE=16740352;static jE=16723968;static zE=12648192;static ZE=8453888;static qE=4259584;static JE=9179409;static $E=6116423;static fa=2301979;static ua=5063219;static wa=7759444;static ma=3353893;static QE=8388736;static tv=13350793;static iv=Int32Array.of(s.qa,s.RED,s.GREEN,s.GE,s.wA,s.La);static hC=6798;static oC=107;static aC=10283;static lC=16;static cC=4797;static fC=7744;static uC=5799;static dC=4634;static wC=33697;static yC=22433;static mC=2983;static AC=54193;static pC=8741;static gC=12;static IC=64030;static _C=43162;static CC=7735;static EC=8404;static vC=1701;static bC=38430;static TC=24094;static OC=10153;static RC=56621;static SC=4783;static LC=1341;static xC=16578;static kC=35003;static MC=25239;static H_=9104;static V_=10275;static K_=7595;static X_=3610;static j_=7975;static z_=8526;static Z_=918;static q_=38802;static J_=24466;static Q_=10145;static tC=58654;static iC=5027;static eC=1457;static sC=16565;static nC=34991;static rC=25486;static DC=4626;static NC=11146;static FC=6439;static BC=12;static PC=4758;static UC=10270;static jC=4574;static WC=4550;static GC=4537;static YC=5681;static HC=5673;static VC=5790;static KC=6806;static XC=8076}},8950:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n extends s.A{static pw=new Int32Array;static gw=0;static Iw=0;static top=0;static bottom=0;static left=0;static right=0;static fI=0;static ev=0;static sv=0;static bind=(t,i,e)=>{this.pw=t,this.gw=i,this.Iw=e,this.Ta(0,0,i,e)};static nv=()=>{this.left=0,this.top=0,this.right=this.gw,this.bottom=this.Iw,this.fI=this.right-1,this.ev=this.right/2|0};static Ta=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.gw&&(e=this.gw),s>this.Iw&&(s=this.Iw),this.top=i,this.bottom=s,this.left=t,this.right=e,this.fI=this.right-1,this.ev=this.right/2|0,this.sv=this.bottom/2|0};static clear=()=>{const t=this.gw*this.Iw;for(let i=0;i{this.ya(t,i,n,e),this.ya(t,i+s-1,n,e),this.da(t,i,n,s),this.da(t+e-1,i,n,s)};static ya=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.gw;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.gw;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(l-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.gw-e;let h=t+i*this.gw;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.pw[h++]=n;h+=r}};static hv(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,a=(n>>8&255)*r,l=(255&n)*r,c=this.gw-e;let f=t+i*this.gw;for(let t=0;t>16&255)*h>>8<<16)+(a+(this.pw[f]>>8&255)*h>>8<<8)+(l+(255&this.pw[f])*h>>8);this.pw[f++]=t}f+=c}}static ov(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,a=(255&s)*n;let l=i-e;l<0&&(l=0);let c=i+e;c>=this.Iw&&(c=this.Iw-1);for(let s=l;s<=c;s++){const n=s-i,l=0|Math.sqrt(e*e-n*n);let c=t-l;c<0&&(c=0);let f=t+l;f>=this.gw&&(f=this.gw-1);let u=c+s*this.gw;for(let t=c;t<=f;t++){const t=(h+(this.pw[u]>>16&255)*r>>8<<16)+(o+(this.pw[u]>>8&255)*r>>8<<8)+(a+(255&this.pw[u])*r>>8);this.pw[u++]=t}}}static av=(t,i,e)=>{t=this.right||i=this.bottom||(this.pw[t+i*this.gw]=e)}}},4583:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1673),r=e(3867);class h extends s.A{static et=!1;static lv=new Int32Array(512);static cv=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static fv=new r.fe(50,null);static uv=0;static Aw=new Int32Array;static yl=0;static ml=0;static _w=!0;static cI=!1;static alpha=0;static dv=null;static wv=new r.fe(50,null);static yv=0;static MA=0;static mv=new Int32Array(50);static Av=new r.fe(50,null);static pv=!1;static gv=new r.fe(50,!1);static Iv=new Int32Array(50);static{for(let t=1;t<512;t++)this.lv[t]=32768/t|0;for(let t=1;t<2048;t++)this.cv[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static So=()=>{this.lv=null,this.lv=null,this.sin=null,this.cos=null,this.Aw=null,this.fv=null,this.gv=null,this.Iv=null,this.dv=null,this.wv=null,this.mv=null,this.palette=null,this.Av=null,console.log('Draw3D unloaded!')};static Fc=()=>{this.Aw=new Int32Array(s.A.Iw);for(let t=0;t{this.Aw=new Int32Array(i);for(let e=0;e{this.dv=null,this.wv.fill(null)};static Ev=t=>{this.uv=0;for(let i=0;i<50;i++)try{this.fv[i]=n.A.xu(t,i.toString()),this.et&&128===this.fv[i]?.Xa?this.fv[i]?.vv():this.fv[i]?.xw(),this.uv++}catch(t){}};static dA=t=>{if(0!==this.Iv[t])return this.Iv[t];const i=this.Av[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.bv(h,1.4),0===h&&(h=1),this.Iv[t]=h,h};static Tv=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,a=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let l=s-.3333333333333333;l<0&&l++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,a=6*l<1?i+6*(t-i)*l:2*l<1?t:3*l<2?i+(t-i)*(.6666666666666666-l)*6:i}const l=((256*h|0)<<16)+((256*o|0)<<8)+(256*a|0);this.palette[e++]=this.bv(l,i)}}for(let t=0;t<50;t++){const e=this.fv[t];if(!e)continue;const s=e.palette;this.Av[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static Rv=t=>{this.dv||(this.yv=t,this.et?this.dv=new r.Xr(t,16384):this.dv=new r.Xr(t,65536),this.wv.fill(null))};static yI=(t,i,e,n,r,o,a,l,c)=>{let f=0,u=0;r!==n&&(f=(i-t<<16)/(r-n)|0,u=(l-a<<15)/(r-n)|0);let d=0,w=0;o!==r&&(d=(e-i<<16)/(o-r)|0,w=(c-l<<15)/(o-r)|0);let y=0,m=0;if(o!==n&&(y=(t-e<<16)/(n-o)|0,m=(a-c<<15)/(n-o)|0),n<=r&&n<=o){if(ns.A.bottom&&(r=s.A.bottom),o>s.A.bottom&&(o=s.A.bottom),rd)for(o-=r,r-=n,n=h.Aw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Sv(e>>16,i>>16,c>>7,l>>7,s.A.pw,n,0),e+=y,i+=d,c+=m,l+=w,n+=s.A.gw}this.Sv(e>>16,t>>16,c>>7,a>>7,s.A.pw,n,0),e+=y,t+=f,c+=m,a+=u,n+=s.A.gw}else for(o-=r,r-=n,n=h.Aw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Sv(i>>16,e>>16,l>>7,c>>7,s.A.pw,n,0),e+=y,i+=d,c+=m,l+=w,n+=s.A.gw}this.Sv(t>>16,e>>16,a>>7,c>>7,s.A.pw,n,0),e+=y,t+=f,c+=m,a+=u,n+=s.A.gw}else if(i=t<<=16,l=a<<=15,n<0&&(i-=y*n,t-=f*n,l-=m*n,a-=u*n,n=0),e<<=16,c<<=15,o<0&&(e-=d*o,c-=w*o,o=0),n!==o&&yf)for(r-=o,o-=n,n=h.Aw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Sv(e>>16,t>>16,c>>7,a>>7,s.A.pw,n,0),e+=d,t+=f,c+=w,a+=u,n+=s.A.gw}this.Sv(i>>16,t>>16,l>>7,a>>7,s.A.pw,n,0),i+=y,t+=f,l+=m,a+=u,n+=s.A.gw}else for(r-=o,o-=n,n=h.Aw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Sv(t>>16,e>>16,a>>7,c>>7,s.A.pw,n,0),e+=d,t+=f,c+=w,a+=u,n+=s.A.gw}this.Sv(t>>16,i>>16,a>>7,l>>7,s.A.pw,n,0),i+=y,t+=f,l+=m,a+=u,n+=s.A.gw}}else if(r<=o){if(rs.A.bottom&&(o=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),oy)for(n-=o,o-=r,r=h.Aw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Sv(t>>16,e>>16,a>>7,c>>7,s.A.pw,r,0),t+=f,e+=y,a+=u,c+=m,r+=s.A.gw}this.Sv(t>>16,i>>16,a>>7,l>>7,s.A.pw,r,0),t+=f,i+=d,a+=u,l+=w,r+=s.A.gw}else for(n-=o,o-=r,r=h.Aw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Sv(e>>16,t>>16,c>>7,a>>7,s.A.pw,r,0),t+=f,e+=y,a+=u,c+=m,r+=s.A.gw}this.Sv(i>>16,t>>16,l>>7,a>>7,s.A.pw,r,0),t+=f,i+=d,a+=u,l+=w,r+=s.A.gw}else if(e=i<<=16,c=l<<=15,r<0&&(e-=f*r,i-=d*r,c-=u*r,l-=w*r,r=0),t<<=16,a<<=15,n<0&&(t-=y*n,a-=m*n,n=0),o-=n,n-=r,r=h.Aw[r],f>16,i>>16,a>>7,l>>7,s.A.pw,r,0),t+=y,i+=d,a+=m,l+=w,r+=s.A.gw}this.Sv(e>>16,i>>16,c>>7,l>>7,s.A.pw,r,0),e+=f,i+=d,c+=u,l+=w,r+=s.A.gw}else for(;;){if(--n<0)for(;;){if(--o<0)return;this.Sv(i>>16,t>>16,l>>7,a>>7,s.A.pw,r,0),t+=y,i+=d,a+=m,l+=w,r+=s.A.gw}this.Sv(i>>16,e>>16,l>>7,c>>7,s.A.pw,r,0),e+=f,i+=d,c+=u,l+=w,r+=s.A.gw}}else if(os.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,l>>7,a>>7,s.A.pw,o,0),i+=d,t+=f,l+=w,a+=u,o+=s.A.gw}this.Sv(i>>16,e>>16,l>>7,c>>7,s.A.pw,o,0),i+=d,e+=y,l+=w,c+=m,o+=s.A.gw}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Sv(t>>16,i>>16,a>>7,l>>7,s.A.pw,o,0),i+=d,t+=f,l+=w,a+=u,o+=s.A.gw}this.Sv(e>>16,i>>16,c>>7,l>>7,s.A.pw,o,0),i+=d,e+=y,l+=w,c+=m,o+=s.A.gw}else if(t=e<<=16,a=c<<=15,o<0&&(t-=d*o,e-=y*o,a-=w*o,c-=m*o,o=0),i<<=16,l<<=15,r<0&&(i-=f*r,l-=u*r,r=0),n-=r,r-=o,o=h.Aw[o],d>16,e>>16,l>>7,c>>7,s.A.pw,o,0),i+=f,e+=y,l+=u,c+=m,o+=s.A.gw}this.Sv(t>>16,e>>16,a>>7,c>>7,s.A.pw,o,0),t+=d,e+=y,a+=w,c+=m,o+=s.A.gw}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Sv(e>>16,i>>16,c>>7,l>>7,s.A.pw,o,0),i+=f,e+=y,l+=u,c+=m,o+=s.A.gw}this.Sv(e>>16,t>>16,c>>7,a>>7,s.A.pw,o,0),t+=d,e+=y,a+=w,c+=m,o+=s.A.gw}};static Sv=(t,i,e,n,r,o,a)=>{let l;if(h._w){let c;if(h.cI){if(c=i-t>3?(n-e)/(i-t)|0:0,i>s.A.fI&&(i=s.A.fI),t<0&&(e-=t*c,t=0),t>=i)return;o+=t,a=i-t>>2,c<<=2}else{if(!(t>2)>0?(n-e)*h.lv[a]>>15:0}if(0===h.alpha)for(;;){if(--a<0){if((a=i-t&3)>0){l=h.palette[e>>8];do{r[o++]=l,a--}while(a>0);return}break}l=h.palette[e>>8],e+=c,r[o++]=l,r[o++]=l,r[o++]=l,r[o++]=l}else{const s=h.alpha,n=256-h.alpha;for(;;){if(--a<0){if((a=i-t&3)>0){l=h.palette[e>>8],l=((16711935&l)*n>>8&16711935)+((65280&l)*n>>8&65280);do{r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),a--}while(a>0)}break}l=h.palette[e>>8],e+=c,l=((16711935&l)*n>>8&16711935)+((65280&l)*n>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=l+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280)}}}else if(ts.A.fI&&(i=s.A.fI),t<0&&(e-=t*c,t=0),t>=i))return;if(o+=t,a=i-t,0===h.alpha)do{r[o++]=h.palette[e>>8],e+=c,a--}while(a>0);else{const t=h.alpha,i=256-h.alpha;do{l=h.palette[e>>8],e+=c,l=((16711935&l)*i>>8&16711935)+((65280&l)*i>>8&65280),r[o++]=l+((16711935&r[o])*t>>8&16711935)+((65280&r[o])*t>>8&65280),a--}while(a>0)}}};static Lv=(t,i,e,n,r,h,o)=>{let a=0;r!==n&&(a=(i-t<<16)/(r-n)|0);let l=0;h!==r&&(l=(e-i<<16)/(h-r)|0);let c=0;if(h!==n&&(c=(t-e<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),rl)for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.xv(e>>16,i>>16,s.A.pw,n,o),e+=c,i+=l,n+=s.A.gw}this.xv(e>>16,t>>16,s.A.pw,n,o),e+=c,t+=a,n+=s.A.gw}else for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.xv(i>>16,e>>16,s.A.pw,n,o),e+=c,i+=l,n+=s.A.gw}this.xv(t>>16,e>>16,s.A.pw,n,o),e+=c,t+=a,n+=s.A.gw}else if(i=t<<=16,n<0&&(i-=c*n,t-=a*n,n=0),e<<=16,h<0&&(e-=l*h,h=0),n!==h&&ca)for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.xv(e>>16,t>>16,s.A.pw,n,o),e+=l,t+=a,n+=s.A.gw}this.xv(i>>16,t>>16,s.A.pw,n,o),i+=c,t+=a,n+=s.A.gw}else for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.xv(t>>16,e>>16,s.A.pw,n,o),e+=l,t+=a,n+=s.A.gw}this.xv(t>>16,i>>16,s.A.pw,n,o),i+=c,t+=a,n+=s.A.gw}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hc)for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.xv(t>>16,e>>16,s.A.pw,r,o),t+=a,e+=c,r+=s.A.gw}this.xv(t>>16,i>>16,s.A.pw,r,o),t+=a,i+=l,r+=s.A.gw}else for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.xv(e>>16,t>>16,s.A.pw,r,o),t+=a,e+=c,r+=s.A.gw}this.xv(i>>16,t>>16,s.A.pw,r,o),t+=a,i+=l,r+=s.A.gw}else if(e=i<<=16,r<0&&(e-=a*r,i-=l*r,r=0),t<<=16,n<0&&(t-=c*n,n=0),a>16,i>>16,s.A.pw,r,o),t+=c,i+=l,r+=s.A.gw}this.xv(e>>16,i>>16,s.A.pw,r,o),e+=a,i+=l,r+=s.A.gw}else for(h-=n,n-=r,r=this.Aw[r];;){if(--n<0)for(;;){if(--h<0)return;this.xv(i>>16,t>>16,s.A.pw,r,o),t+=c,i+=l,r+=s.A.gw}this.xv(i>>16,e>>16,s.A.pw,r,o),e+=a,i+=l,r+=s.A.gw}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.pw,h,o),i+=l,t+=a,h+=s.A.gw}this.xv(i>>16,e>>16,s.A.pw,h,o),i+=l,e+=c,h+=s.A.gw}else for(r-=n,n-=h,h=this.Aw[h];;){if(--n<0)for(;;){if(--r<0)return;this.xv(t>>16,i>>16,s.A.pw,h,o),i+=l,t+=a,h+=s.A.gw}this.xv(e>>16,i>>16,s.A.pw,h,o),i+=l,e+=c,h+=s.A.gw}else if(t=e<<=16,h<0&&(t-=l*h,e-=c*h,h=0),i<<=16,r<0&&(i-=a*r,r=0),l>16,e>>16,s.A.pw,h,o),i+=a,e+=c,h+=s.A.gw}this.xv(t>>16,e>>16,s.A.pw,h,o),t+=l,e+=c,h+=s.A.gw}else for(n-=r,r-=h,h=this.Aw[h];;){if(--r<0)for(;;){if(--n<0)return;this.xv(e>>16,i>>16,s.A.pw,h,o),i+=a,e+=c,h+=s.A.gw}this.xv(e>>16,t>>16,s.A.pw,h,o),t+=l,e+=c,h+=s.A.gw}};static gI=(t,i,e,n,r,h,o,a,l,c,f,u,d,w,y,m,A,p,g)=>{const I=this.kv(g);this.pv=!this.gv[g];const _=c-d,C=f-y,E=u-A,v=w-c,b=m-f,T=p-u;let O=v*f-b*c<<14;const R=b*u-T*f<<8,S=T*c-v*u<<5;let L=_*f-C*c<<14;const x=C*u-E*f<<8,k=E*c-_*u<<5;let M=C*v-_*b<<14;const D=E*b-C*T<<8,N=_*T-E*v<<5;let F=0,B=0;r!==n&&(F=(i-t<<16)/(r-n)|0,B=(a-o<<16)/(r-n)|0);let P=0,U=0;h!==r&&(P=(e-i<<16)/(h-r)|0,U=(l-a<<16)/(h-r)|0);let W=0,G=0;if(h!==n&&(W=(t-e<<16)/(n-h)|0,G=(o-l<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),rP)for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Mv(e>>16,i>>16,s.A.pw,n,I,0,0,O,L,M,R,x,D,l>>8,a>>8),e+=W,i+=P,l+=G,a+=U,n+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(e>>16,t>>16,s.A.pw,n,I,0,0,O,L,M,R,x,D,l>>8,o>>8),e+=W,t+=F,l+=G,o+=B,n+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(h-=r,r-=n,n=this.Aw[n];;){if(--r<0)for(;;){if(--h<0)return;this.Mv(i>>16,e>>16,s.A.pw,n,I,0,0,O,L,M,R,x,D,a>>8,l>>8),e+=W,i+=P,l+=G,a+=U,n+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(t>>16,e>>16,s.A.pw,n,I,0,0,O,L,M,R,x,D,o>>8,l>>8),e+=W,t+=F,l+=G,o+=B,n+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}else{i=t<<=16,a=o<<=16,n<0&&(i-=W*n,t-=F*n,a-=G*n,o-=B*n,n=0),e<<=16,l<<=16,h<0&&(e-=P*h,l-=U*h,h=0);const c=n-this.ml;if(O+=S*c,L+=k*c,M+=N*c,O|=0,L|=0,M|=0,(n===h||W>=F)&&(n!==h||P<=F))for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Mv(t>>16,e>>16,s.A.pw,n,I,0,0,O,L,M,R,x,D,o>>8,l>>8),e+=P,t+=F,l+=U,o+=B,n+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(t>>16,i>>16,s.A.pw,n,I,0,0,O,L,M,R,x,D,o>>8,a>>8),i+=W,t+=F,a+=G,o+=B,n+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(r-=h,h-=n,n=this.Aw[n];;){if(--h<0)for(;;){if(--r<0)return;this.Mv(e>>16,t>>16,s.A.pw,n,I,0,0,O,L,M,R,x,D,l>>8,o>>8),e+=P,t+=F,l+=U,o+=B,n+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(i>>16,t>>16,s.A.pw,n,I,0,0,O,L,M,R,x,D,a>>8,o>>8),i+=W,t+=F,a+=G,o+=B,n+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hW)for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Mv(t>>16,e>>16,s.A.pw,r,I,0,0,O,L,M,R,x,D,o>>8,l>>8),t+=F,e+=W,o+=B,l+=G,r+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(t>>16,i>>16,s.A.pw,r,I,0,0,O,L,M,R,x,D,o>>8,a>>8),t+=F,i+=P,o+=B,a+=U,r+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(n-=h,h-=r,r=this.Aw[r];;){if(--h<0)for(;;){if(--n<0)return;this.Mv(e>>16,t>>16,s.A.pw,r,I,0,0,O,L,M,R,x,D,l>>8,o>>8),t+=F,e+=W,o+=B,l+=G,r+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(i>>16,t>>16,s.A.pw,r,I,0,0,O,L,M,R,x,D,a>>8,o>>8),t+=F,i+=P,o+=B,a+=U,r+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}else{e=i<<=16,l=a<<=16,r<0&&(e-=F*r,i-=P*r,l-=B*r,a-=U*r,r=0),t<<=16,o<<=16,n<0&&(t-=W*n,o-=G*n,n=0);const c=r-this.ml;if(O+=S*c,L+=k*c,M+=N*c,O|=0,L|=0,M|=0,h-=n,n-=r,r=this.Aw[r],F>16,i>>16,s.A.pw,r,I,0,0,O,L,M,R,x,D,o>>8,a>>8),t+=W,i+=P,o+=G,a+=U,r+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(e>>16,i>>16,s.A.pw,r,I,0,0,O,L,M,R,x,D,l>>8,a>>8),e+=F,i+=P,l+=B,a+=U,r+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(;;){if(--n<0)for(;;){if(--h<0)return;this.Mv(i>>16,t>>16,s.A.pw,r,I,0,0,O,L,M,R,x,D,a>>8,o>>8),t+=W,i+=P,o+=G,a+=U,r+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(i>>16,e>>16,s.A.pw,r,I,0,0,O,L,M,R,x,D,a>>8,l>>8),e+=F,i+=P,l+=B,a+=U,r+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.pw,h,I,0,0,O,L,M,R,x,D,a>>8,o>>8),i+=P,t+=F,a+=U,o+=B,h+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(i>>16,e>>16,s.A.pw,h,I,0,0,O,L,M,R,x,D,a>>8,l>>8),i+=P,e+=W,a+=U,l+=G,h+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Mv(t>>16,i>>16,s.A.pw,h,I,0,0,O,L,M,R,x,D,o>>8,a>>8),i+=P,t+=F,a+=U,o+=B,h+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(e>>16,i>>16,s.A.pw,h,I,0,0,O,L,M,R,x,D,l>>8,a>>8),i+=P,e+=W,a+=U,l+=G,h+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}else{t=e<<=16,o=l<<=16,h<0&&(t-=P*h,e-=W*h,o-=U*h,l-=G*h,h=0),i<<=16,a<<=16,r<0&&(i-=F*r,a-=B*r,r=0);const c=h-this.ml;if(O+=S*c,L+=k*c,M+=N*c,O|=0,L|=0,M|=0,n-=r,r-=h,h=this.Aw[h],P>16,e>>16,s.A.pw,h,I,0,0,O,L,M,R,x,D,a>>8,l>>8),i+=F,e+=W,a+=B,l+=G,h+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(t>>16,e>>16,s.A.pw,h,I,0,0,O,L,M,R,x,D,o>>8,l>>8),t+=P,e+=W,o+=U,l+=G,h+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Mv(e>>16,i>>16,s.A.pw,h,I,0,0,O,L,M,R,x,D,l>>8,a>>8),i+=F,e+=W,a+=B,l+=G,h+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}this.Mv(e>>16,t>>16,s.A.pw,h,I,0,0,O,L,M,R,x,D,l>>8,o>>8),t+=P,e+=W,o+=U,l+=G,h+=s.A.gw,O+=S,L+=k,M+=N,O|=0,L|=0,M|=0}}};static Mv=(t,i,e,n,r,h,o,a,l,c,f,u,d,w,y)=>{if(t>=i)return;let m,A,p,g,I,_,C,E,v;if(this.cI){if(m=(y-w)/(i-t)|0,i>s.A.fI&&(i=s.A.fI),t<0&&(w-=t*m,t=0),t>=i)return;A=i-t>>3,m<<=12}else i-t>7?(A=i-t>>3,m=(y-w)*this.lv[A]>>6):(A=0,m=0);if(w<<=9,n+=t,this.et&&r)if(p=0,g=0,_=t-this.yl,a+=(f>>3)*_,l+=(u>>3)*_,c+=(d>>3)*_,a|=0,l|=0,I=(c|=0)>>12,0!==I&&(o=l/I|0,(h=a/I|0)<0?h=0:h>4032&&(h=4032)),a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>12,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=g-o>>3,h+=w>>3&786432,v=w>>23,this.pv){for(;A-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h=p,o=g,a+=f,l+=u,I=(c+=d)>>12,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=g-o>>3,h+=(w+=m)>>3&786432,v=w>>23;for(A=i-t&7;A-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E}else{for(;A-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n+=1,h=p,o=g,a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>12,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=g-o>>3,h+=(w+=m)>>3&786432,v=w>>23}for(A=i-t&7;A-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}else if(p=0,g=0,_=t-this.yl,a+=(f>>3)*_,l+=(u>>3)*_,c+=(d>>3)*_,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(o=l/I|0,(h=a/I|0)<0?h=0:h>16256&&(h=16256)),a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=g-o>>3,h+=6291456&w,v=w>>23,this.pv&&r){for(;A-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h=p,o=g,a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=g-o>>3,h+=6291456&(w+=m),v=w>>23;for(A=i-t&7;A-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E}else{for(;A-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,h=p,o=g,a+=f,l+=u,c+=d,a|=0,l|=0,I=(c|=0)>>14,0!==I&&(p=a/I|0,g=l/I|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=g-o>>3,h+=6291456&(w+=m),v=w>>23}for(A=i-t&7;A-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}};static xv=(t,i,e,n,r)=>{if(this.cI&&(i>s.A.fI&&(i=s.A.fI),t<0&&(t=0)),t>=i)return;n+=t;let h=i-t>>2;if(0===this.alpha)for(;;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;e[n++]=r}e[n++]=r,e[n++]=r,e[n++]=r,e[n++]=r}const o=this.alpha,a=256-this.alpha;for(r=((16711935&r)*a>>8&16711935)+((65280&r)*a>>8&65280);;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}};static Ov=t=>{this.wv[t]&&this.dv&&(this.dv[this.yv++]=this.wv[t],this.wv[t]=null)};static kv=t=>{if(this.mv[t]=this.MA++,this.wv[t])return this.wv[t];let i;if(this.yv>0&&this.dv)i=this.dv[--this.yv],this.dv[this.yv]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.pw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.pw[t]];this.gv[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.gv[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}},880:(t,i,e)=>{e.d(i,{r:()=>n});var s=e(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(s.UE.src),s.UE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>s.UE.onload=()=>t())),s.PE.clearRect(0,0,s.WE.width,s.WE.height);const i=s.UE.naturalWidth,e=s.UE.naturalHeight;return s.WE.width=i,s.WE.height=e,s.PE.drawImage(s.UE,0,0),s.PE.getImageData(0,0,i,e)}},8665:(t,i,e)=>{e.d(i,{A:()=>f});var s=e(1069),n=e(8950),r=e(4583),h=e(6730),o=e(4474),a=e(3867);class l{Fd=0;bg=0;Dv=0;Nv=-1;Fv=-1;Bv=-1;Pv=-1;Uv=-1;Wv=-1;Gv=-1;Yv=-1;Hv=-1;Vv=0;Kv=-1;Xv=-1;jv=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static zv=null;static Zv=null;static qv=null;static Jv=null;static $v=null;static Qv=null;static tb=null;static ib=null;static eb=null;static sb=null;static nb=null;static rb=null;static axis=null;static hb=new a.fe(4096,!1);static ob=new a.fe(4096,!1);static ab=new Int32Array(4096);static lb=new Int32Array(4096);static cb=new Int32Array(4096);static fb=new Int32Array(4096);static ub=new Int32Array(4096);static wb=new Int32Array(4096);static yb=new Int32Array(1500);static mb=new a.Xr(1500,512);static Ab=new Int32Array(12);static pb=new a.Xr(12,2e3);static gb=new Int32Array(2e3);static Ib=new Int32Array(2e3);static _b=new Int32Array(12);static Cb=new Int32Array(10);static Eb=new Int32Array(10);static vb=new Int32Array(10);static Ir=0;static bb=0;static _r=0;static Tb=!1;static Ha=0;static Va=0;static Ob=0;static Rb=new Int32Array(1e3);static Sb=!1;static yu(t){try{f.head=new s.A(t.read('ob_head.dat')),f.zv=new s.A(t.read('ob_face1.dat')),f.Zv=new s.A(t.read('ob_face2.dat')),f.qv=new s.A(t.read('ob_face3.dat')),f.Jv=new s.A(t.read('ob_face4.dat')),f.$v=new s.A(t.read('ob_face5.dat')),f.Qv=new s.A(t.read('ob_point1.dat')),f.tb=new s.A(t.read('ob_point2.dat')),f.ib=new s.A(t.read('ob_point3.dat')),f.eb=new s.A(t.read('ob_point4.dat')),f.sb=new s.A(t.read('ob_point5.dat')),f.nb=new s.A(t.read('ob_vertex1.dat')),f.rb=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.pf=0,f.Qv.pf=0,f.tb.pf=0,f.ib.pf=0,f.eb.pf=0,f.nb.pf=0,f.rb.pf=0;const i=f.head.mu;f.metadata=new a.fe(i+100,null);let e=0,n=0,r=0,h=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Nd=(t,i,e)=>{const s=t.Fd,n=t.bg,r=t.Dv;let h,o,l,u,d;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.Fd,r=t.bg,h=t.Dv;let o,a,l,c,u;if(s)o=t.Bd,a=t.Ud,l=t.Pd;else{o=new Int32Array(n),a=new Int32Array(n),l=new Int32Array(n);for(let i=0;i{const e=t.Fd,s=t.bg,n=t.Dv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,a=0,l=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,a=0,l=-1;for(let c=0;c{let o=-1;const a=t.Bd[i],l=t.Ud[i],c=t.Pd[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.zv&&f.Zv&&f.qv&&f.Jv&&f.$v&&f.Qv&&f.tb&&f.ib&&f.eb&&f.sb&&f.nb&&f.rb&&f.axis))throw new Error('cant loading model!!!!!');const e=i.Fd,s=i.bg,n=i.Dv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),a=new Int32Array(s),l=new Int32Array(s),c=new Int32Array(s),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;i.Uv>=0&&(y=new Int32Array(e));let m=null;i.Hv>=0&&(m=new Int32Array(s));let A=null,p=0;i.Vv>=0?A=new Int32Array(s):p=-i.Vv-1;let g=null;i.Kv>=0&&(g=new Int32Array(s));let I=null;i.Xv>=0&&(I=new Int32Array(s));const _=new Int32Array(s);f.Qv.pf=i.Nv,f.tb.pf=i.Fv,f.ib.pf=i.Bv,f.eb.pf=i.Pv,f.sb.pf=i.Uv;let C,E,v,b=0,T=0,O=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const e=f.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const n=e.Fd,r=e.bg,h=e.Dv,o=new Int32Array(n),a=new Int32Array(n),l=new Int32Array(n),c=new Int32Array(r),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(h),y=new Int32Array(h),m=new Int32Array(h);let A=null;e.Uv>=0&&(A=new Int32Array(n));let p=null;e.Hv>=0&&(p=new Int32Array(r));let g=null,I=0;e.Vv>=0?g=new Int32Array(r):I=-e.Vv-1;let _=null;e.Kv>=0&&(_=new Int32Array(r));let C=null;e.Xv>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(e.data);v.pf=e.Nv;const b=new s.A(e.data);b.pf=e.Fv;const T=new s.A(e.data);T.pf=e.Bv;const O=new s.A(e.data);O.pf=e.Pv;const R=new s.A(e.data);R.pf=e.Uv;let S,L,x,k=0,M=0,D=0;for(let t=0;tthis.jd&&(this.jd=-e),e>this.gg&&(this.gg=e);const n=i*i+s*s;n>this.EA&&(this.EA=n)}this.EA=Math.sqrt(this.EA)+.99|0,this.Gb=Math.sqrt(this.EA*this.EA+this.jd*this.jd)+.99|0,this.Wb=this.Gb+(Math.sqrt(this.EA*this.EA+this.gg*this.gg)+.99|0)}Wd(){this.jd=0,this.gg=0;for(let t=0;tthis.jd&&(this.jd=-i),i>this.gg&&(this.gg=i)}this.Gb=Math.sqrt(this.EA*this.EA+this.jd*this.jd)+.99|0,this.Wb=this.Gb+(Math.sqrt(this.EA*this.EA+this.gg*this.gg)+.99|0)}Gl(){if(this.Yb){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Vd=new a.fe(i+1,null);for(let e=0;e<=i;e++)this.Vd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Hd=new a.fe(i+1,null);for(let e=0;e<=i;e++)this.Hd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ea;)a=e[o++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==a||0===r.types[i])&&this.jb(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}f.Ir=0,f.bb=0,f._r=0,o=0,a=e[o++];for(let t=0;ta;)a=e[o++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===a||0===r.types[i])&&this.jb(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.Yl(t)}Yl(t){if(!this.Vd||-1===t||!h.A.Do[t])return;const i=h.A.Do[t],e=i.NE;f.Ir=0,f.bb=0,f._r=0;for(let t=0;t>16;this.Pd[t]=this.Ud[t]*i+this.Pd[t]*e>>16,this.Ud[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.kb&&this.Mb&&this.Db||(this.kb=new Int32Array(this.bg),this.Mb=new Int32Array(this.bg),this.Db=new Int32Array(this.bg)),!this.fg){this.fg=new a.fe(this.Fd,null);for(let t=0;t8192||A>8192||p>8192||m<-8192||A<-8192||p<-8192;)m>>=1,A>>=1,p>>=1;let g=0|Math.sqrt(m*m+A*A+p*p);if(g<=0&&(g=1),m=256*m/g|0,A=256*A/g|0,p=256*p/g|0,this.vg&&1&this.vg[i]){const r=t+((e*m+s*A+n*p)/(h+(h/2|0))|0);this.ku&&(this.kb[i]=f.xb(this.ku[i],r,this.vg[i]))}else{let t=this.fg[r];t&&(t.x+=m,t.y+=A,t.z+=p,t.w++),t=this.fg[o],t&&(t.x+=m,t.y+=A,t.z+=p,t.w++),t=this.fg[a],t&&(t.x+=m,t.y+=A,t.z+=p,t.w++)}}if(r)this.wg(t,h,e,s,n);else{this.pg=new a.fe(this.Fd,null);for(let t=0;t>16;for(let s=0;s>16,I=I*w-g*d>>16,g=p),0!==t&&(p=I*l-_*a>>16,_=I*a+_*l>>16,I=p),0!==i&&(p=_*c+g*u>>16,_=_*u-g*c>>16,g=p),g+=n,I+=h,_+=o,p=I*m-_*y>>16,_=I*y+_*m>>16,I=p,f.ab&&f.lb&&f.cb&&(f.cb[s]=_-A,f.ab[s]=r.A.yl+((g<<9)/_|0),f.lb[s]=r.A.ml+((I<<9)/_|0)),this.Dv>0&&f.fb&&f.ub&&f.wb&&(f.fb[s]=g,f.ub[s]=I,f.wb[s]=_)}try{this.qb(!1,!1,0)}catch(t){}}draw(t,i,e,s,h,o,a,l,c){const u=l*h-o*s>>16,d=a*i+u*e>>16,w=this.EA*e>>16,y=d+w;if(y<=50||d>=3500)return;const m=l*s+o*h>>16;let A=m-this.EA<<9;if((A/y|0)>=n.A.ev)return;let p=m+this.EA<<9;if((p/y|0)<=-n.A.ev)return;const g=a*e-u*i>>16,I=this.EA*i>>16;let _=g+I<<9;if((_/y|0)<=-n.A.sv)return;let C=g-(I+(this.jd*e>>16))<<9;if((C/y|0)>=n.A.sv)return;let E=d-(w+(this.jd*i>>16))<=50,v=!1;if(c>0&&f.Tb){let t=d-w;t<=50&&(t=50),m>0?(A=A/y|0,p=p/t|0):(p=p/y|0,A=A/t|0),g>0?(C=C/y|0,_=_/t|0):(_=_/y|0,C=C/t|0);const i=f.Ha-r.A.yl,e=f.Va-r.A.ml;i>A&&iC&&e<_&&(this.ow?f.Rb[f.Ob++]=c:v=!0)}const b=r.A.yl,T=r.A.ml;let O=0,R=0;0!==t&&(O=r.A.sin[t],R=r.A.cos[t]);for(let n=0;n>16,w=w*R-c*O>>16,c=r),c+=o,u+=a,w+=l,r=w*s+c*h>>16,w=w*h-c*s>>16,c=r,r=u*e-w*i>>16,w=u*i+w*e>>16,u=r,f.cb&&(f.cb[n]=w-d),w>=50&&f.ab&&f.lb?(f.ab[n]=b+((c<<9)/w|0),f.lb[n]=T+((u<<9)/w|0)):f.ab&&(f.ab[n]=-5e3,E=!0),(E||this.Dv>0)&&f.fb&&f.ub&&f.wb&&(f.fb[n]=c,f.ub[n]=u,f.wb[n]=w)}try{this.qb(E,v,c)}catch(t){}}qb(t,i,e,s=!1){f.Sb&&(this.Kb=-1,this.Xb=-1);for(let t=0;tn.A.fI||l>n.A.fI||c>n.A.fI),f.mb&&f.yb){const t=((y+m+A)/3|0)+this.Gb;f.mb[t][f.yb[t]++]=s,f.Sb&&this.Jb(f.Ha,f.Va,u,d,w,a,l,c)&&this.Xb=0;t--){const i=f.yb[t];if(!(i<=0)&&f.mb){const e=f.mb[t];for(let t=0;t=0;t--){const i=f.yb[t];if(i>0&&f.mb){const e=f.mb[t];for(let s=0;s0||f.Ab[2]>0)&&(r=(f._b[1]+f._b[2])/(f.Ab[1]+f.Ab[2])|0);let h=0;f.Ab&&f._b&&(f.Ab[3]>0||f.Ab[4]>0)&&(h=(f._b[3]+f._b[4])/(f.Ab[3]+f.Ab[4])|0);let o=0;if(f.Ab&&f._b&&(f.Ab[6]>0||f.Ab[8]>0)&&(o=(f._b[6]+f._b[8])/(f.Ab[6]+f.Ab[8])|0),f.Ab&&f.pb){let t,i=0,e=f.Ab[10],n=f.pb[10],a=f.gb;i===e&&(i=0,e=f.Ab[11],n=f.pb[11],a=f.Ib),t=ir;)try{this.$b(n[i++],s),i===e&&n!==f.pb[11]&&(i=0,e=f.Ab[11],n=f.pb[11],a=f.Ib),t=ih;)try{this.$b(n[i++],s),i===e&&n!==f.pb[11]&&(i=0,e=f.Ab[11],n=f.pb[11],a=f.Ib),t=io;)try{this.$b(n[i++],s),i===e&&n!==f.pb[11]&&(i=0,e=f.Ab[11],n=f.pb[11],a=f.Ib),t=i>2,h=this.Bb[i],o=this.Pb[i],a=this.Ub[i];r.A.gI(f.ab[e],f.ab[s],f.ab[n],f.lb[e],f.lb[s],f.lb[n],this.kb[t],this.Mb[t],this.Db[t],f.fb[h],f.ub[h],f.wb[h],f.fb[o],f.fb[a],f.ub[o],f.ub[a],f.wb[o],f.wb[a],this.ku[t])}else if(3===h&&this.vg&&this.ku&&this.kb&&f.ab&&f.lb&&f.fb&&f.ub&&f.wb){const i=this.vg[t]>>2,h=this.Bb[i],o=this.Pb[i],a=this.Ub[i];r.A.gI(f.ab[e],f.ab[s],f.ab[n],f.lb[e],f.lb[s],f.lb[n],this.kb[t],this.kb[t],this.kb[t],f.fb[h],f.ub[h],f.wb[h],f.fb[o],f.fb[a],f.ub[o],f.ub[a],f.wb[o],f.wb[a],this.ku[t])}}Qb(t,i=!1){let e=0;if(f.wb){const i=r.A.yl,s=r.A.ml,n=this.Tg[t],h=this.Og[t],o=this.Rg[t],a=f.wb[n],l=f.wb[h],c=f.wb[o];if(a>=50&&f.ab&&f.lb&&this.kb)f.Cb[e]=f.ab[n],f.Eb[e]=f.lb[n],f.vb[e++]=this.kb[t];else if(f.fb&&f.ub&&this.kb){const u=f.fb[n],d=f.ub[n],w=this.kb[t];if(c>=50&&this.Db){const n=(50-a)*r.A.cv[c-a];f.Cb[e]=i+((u+((f.fb[o]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[o]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.Db[t]-w)*n>>16)}if(l>=50&&this.Mb){const n=(50-a)*r.A.cv[l-a];f.Cb[e]=i+((u+((f.fb[h]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[h]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.Mb[t]-w)*n>>16)}}if(l>=50&&f.ab&&f.lb&&this.Mb)f.Cb[e]=f.ab[h],f.Eb[e]=f.lb[h],f.vb[e++]=this.Mb[t];else if(f.fb&&f.ub&&this.Mb){const u=f.fb[h],d=f.ub[h],w=this.Mb[t];if(a>=50&&this.kb){const h=(50-l)*r.A.cv[a-l];f.Cb[e]=i+((u+((f.fb[n]-u)*h>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[n]-d)*h>>16)<<9)/50|0),f.vb[e++]=w+((this.kb[t]-w)*h>>16)}if(c>=50&&this.Db){const n=(50-l)*r.A.cv[c-l];f.Cb[e]=i+((u+((f.fb[o]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[o]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.Db[t]-w)*n>>16)}}if(c>=50&&f.ab&&f.lb&&this.Db)f.Cb[e]=f.ab[o],f.Eb[e]=f.lb[o],f.vb[e++]=this.Db[t];else if(f.fb&&f.ub&&this.Db){const u=f.fb[o],d=f.ub[o],w=this.Db[t];if(l>=50&&this.Mb){const n=(50-c)*r.A.cv[l-c];f.Cb[e]=i+((u+((f.fb[h]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[h]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.Mb[t]-w)*n>>16)}if(a>=50&&this.kb){const h=(50-c)*r.A.cv[a-c];f.Cb[e]=i+((u+((f.fb[n]-u)*h>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[n]-d)*h>>16)<<9)/50|0),f.vb[e++]=w+((this.kb[t]-w)*h>>16)}}}const s=f.Cb[0],h=f.Cb[1],o=f.Cb[2],a=f.Eb[0],l=f.Eb[1],c=f.Eb[2];if(!((s-h)*(c-l)-(a-l)*(o-h)<=0))if(r.A.cI=!1,3===e){let e;if((s<0||h<0||o<0||s>n.A.fI||h>n.A.fI||o>n.A.fI)&&(r.A.cI=!0),e=this.vg?3&this.vg[t]:0,i)r.A.rv(s,h,a,l,f.vb[0]),r.A.rv(h,o,l,c,f.vb[1]),r.A.rv(o,s,c,a,f.vb[2]);else if(0===e)r.A.yI(s,h,o,a,l,c,f.vb[0],f.vb[1],f.vb[2]);else if(1===e&&this.kb)r.A.Lv(s,h,o,a,l,c,r.A.palette[this.kb[t]]);else if(2===e&&this.vg&&this.ku&&f.fb&&f.ub&&f.wb){const i=this.vg[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.gI(s,h,o,a,l,c,f.vb[0],f.vb[1],f.vb[2],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.ku[t])}else if(3===e&&this.vg&&this.ku&&this.kb&&f.fb&&f.ub&&f.wb){const i=this.vg[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.gI(s,h,o,a,l,c,this.kb[t],this.kb[t],this.kb[t],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.ku[t])}}else if(4===e){let e;if((s<0||h<0||o<0||s>n.A.fI||h>n.A.fI||o>n.A.fI||f.Cb[3]<0||f.Cb[3]>n.A.fI)&&(r.A.cI=!0),e=this.vg?3&this.vg[t]:0,i)r.A.rv(s,h,a,l,f.vb[0]),r.A.rv(h,o,l,c,f.vb[1]),r.A.rv(o,f.Cb[3],c,f.Eb[3],f.vb[2]),r.A.rv(f.Cb[3],s,f.Eb[3],a,f.vb[3]);else if(0===e)r.A.yI(s,h,o,a,l,c,f.vb[0],f.vb[1],f.vb[2]),r.A.yI(s,o,f.Cb[3],a,c,f.Eb[3],f.vb[0],f.vb[2],f.vb[3]);else if(1===e){if(this.kb){const i=r.A.palette[this.kb[t]];r.A.Lv(s,h,o,a,l,c,i),r.A.Lv(s,o,f.Cb[3],a,c,f.Eb[3],i)}}else if(2===e&&this.vg&&this.ku&&f.fb&&f.ub&&f.wb){const i=this.vg[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.gI(s,h,o,a,l,c,f.vb[0],f.vb[1],f.vb[2],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.ku[t]),r.A.gI(s,o,f.Cb[3],a,c,f.Eb[3],f.vb[0],f.vb[2],f.vb[3],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.ku[t])}else if(3===e&&this.vg&&this.ku&&this.kb&&f.fb&&f.ub&&f.wb){const i=this.vg[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.gI(s,h,o,a,l,c,this.kb[t],this.kb[t],this.kb[t],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.ku[t]),r.A.gI(s,o,f.Cb[3],a,c,f.Eb[3],this.kb[t],this.kb[t],this.kb[t],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.ku[t])}}}jb(t,i,e,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f.Ir=0,f.bb=0,f._r=0;for(let t=0;t0?(f.Ir=(f.Ir/n|0)+t,f.bb=(f.bb/n|0)+i,f._r=(f._r/n|0)+e):(f.Ir=t,f.bb=i,f._r=e)}else if(1===n)for(let n=0;n=this.Vd.length)continue;const h=this.Vd[r];if(h)for(let s=0;s=this.Vd.length)continue;const o=this.Vd[h];if(o)for(let s=0;s>16;this.Ud[n]=this.Ud[n]*u-this.Bd[n]*c>>16,this.Bd[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.Ud[n]*u-this.Pd[n]*c>>16;this.Pd[n]=this.Ud[n]*c+this.Pd[n]*u>>16,this.Ud[n]=t}if(0!==a){c=r.A.sin[a],u=r.A.cos[a];const t=this.Pd[n]*c+this.Bd[n]*u>>16;this.Pd[n]=this.Pd[n]*u-this.Bd[n]*c>>16,this.Bd[n]=t}this.Bd[n]+=f.Ir,this.Ud[n]+=f.bb,this.Pd[n]+=f._r}}else if(3===n)for(let n=0;n=this.Vd.length)continue;const h=this.Vd[r];if(h)for(let s=0;s=this.Hd.length)continue;const n=this.Hd[e];if(n)for(let i=0;i255&&(this.Fb[e]=255)}}}Zb(){this.jd=0,this.EA=0,this.gg=0,this.Ig=999999,this._g=-999999,this.Eg=-99999,this.Cg=99999;for(let t=0;tthis._g&&(this._g=i),sthis.Eg&&(this.Eg=s),-e>this.jd&&(this.jd=-e),e>this.gg&&(this.gg=e);const n=i*i+s*s;n>this.EA&&(this.EA=n)}this.EA=0|Math.sqrt(this.EA),this.Gb=0|Math.sqrt(this.EA*this.EA+this.jd*this.jd),this.Wb=this.Gb+(0|Math.sqrt(this.EA*this.EA+this.gg*this.gg))}Jb(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{e.d(i,{A:()=>o});var s=e(8950),n=e(1069),r=e(4474),h=e(880);class o extends r.A{pw;width;height;iT;eT;Xa;dw;constructor(t,i){super(),this.pw=new Int32Array(t*i),this.width=this.Xa=t,this.height=this.dw=i,this.iT=this.eT=0}static sT=async(t,i)=>{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(0,h.r)(e),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),a=n.pw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static xu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.pf=s.mu;const h=r.mu,a=r.mu,l=[],c=r.pu-1;for(let t=0;ts.length||r.pf>r.length)throw new Error;const f=r.pu,u=r.pu,d=r.mu,w=r.mu,y=new o(d,w);y.iT=f,y.eT=u,y.Xa=h,y.dw=a;const m=r.pu;if(0===m){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.nT(h,r,this.pw,n,a,s.A.pw,e,o)}Ka(t,i,e){i|=0,e|=0;let n=(i+=this.iT)+(e+=this.eT)*s.A.gw,r=0,h=this.height,o=this.width,a=s.A.gw-o,l=0;if(es.A.bottom&&(h-=e+h-s.A.bottom),is.A.right){const t=i+o-s.A.right;o-=t,l+=t,a+=t}o>0&&h>0&&this.rT(o,h,this.pw,r,l,s.A.pw,n,a,t)}hT(t,i){t|=0,i|=0;let e=(t+=this.iT)+(i+=this.eT)*s.A.gw,n=0,r=this.height,h=this.width,o=s.A.gw-h,a=0;if(is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.oT(h,r,this.pw,n,a,s.A.pw,e,o)}aT(){const t=this.pw,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.pw[s]=(r<<16)+(h<<8)+o}}}xw(t,i,e,n){t|=0,i|=0,e|=0,n|=0;try{const r=this.width;let h=0,o=0;const a=this.Xa,l=this.dw,c=(a<<16)/e|0,f=(l<<16)/n|0;t+=(this.iT*e+a-1)/a|0,i+=(this.eT*n+l-1)/l|0,this.iT*e%a!=0&&(h=(a-this.iT*e%a<<16)/e|0),this.eT*n%l!=0&&(o=(l-this.eT*n%l<<16)/n|0),e=e*(this.width-(h>>16))/a|0,n=n*(this.height-(o>>16))/l|0;let u=t+i*s.A.gw,d=s.A.gw-e;if(is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right){const i=t+e-s.A.right;e-=i,d+=i}this.scale(e,n,this.pw,h,o,s.A.pw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}cT(t,i,e,n,r,h,o,a,l,c){t|=0,i|=0,e|=0,n|=0;try{const f=-e/2|0,u=-n/2|0,d=65536*Math.sin(l/326.11)|0,w=65536*Math.cos(l/326.11)|0,y=d*c>>8,m=w*c>>8;let A=(o<<16)+u*y+f*m,p=u*m-f*y+(a<<16),g=t+i*s.A.gw;for(let t=0;t>16)+(o>>16)*this.width],n+=m,o-=y;A+=y,p+=m,g+=s.A.gw}}catch(t){}}fT(t,i,e){t|=0,i|=0;let n=(t+=this.iT)+(i+=this.eT)*s.A.gw,r=0,h=this.height,o=this.width,a=s.A.gw-o,l=0;if(is.A.bottom&&(h-=i+h-s.A.bottom),ts.A.right){const i=t+o-s.A.right;o-=i,l+=i,a+=i}o>0&&h>0&&this.uT(o,h,this.pw,l,r,s.A.pw,n,a,e.pw)}scale(t,i,e,s,n,r,h,o,a,l,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*a;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=l}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}oT(t,i,e,s,n,r,h,o){const a=-(t>>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}rT(t,i,e,s,n,r,h,o,a){const l=256-a;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*a+(16711935&i)*l&4278255360)+((65280&t)*a+(65280&i)*l&16711680)>>8}}h+=o,s+=n}}nT(t,i,e,s,n,r,h,o){const a=-(t>>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}uT(t,i,e,s,n,r,h,o,a){const l=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=l;t<0;t++){let t=e[n++];0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===a[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===a[h]?r[h++]=t:h++}h+=o,n+=s}}}},1673:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1069),r=e(4474);class h extends r.A{pw;width;height;iT;eT;Xa;dw;palette;constructor(t,i,e){super(),this.pw=new Int8Array(t*i),this.width=this.Xa=t,this.height=this.dw=i,this.iT=this.eT=0,this.palette=e}static xu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.pf=s.mu;const o=r.mu,a=r.mu,l=r.pu,c=new Int32Array(l);for(let t=1;ts.length||r.pf>r.length)throw new Error;const f=r.pu,u=r.pu,d=r.mu,w=r.mu,y=new h(d,w,c);y.iT=f,y.eT=u,y.Xa=o,y.dw=a;const m=y.pw,A=r.pu;if(0===A){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,a+=i,o+=i}h>0&&r>0&&this.dT(h,r,this.pw,n,a,s.A.pw,e,o)}aT(){const t=this.pw,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}vv(){this.Xa|=0,this.dw|=0,this.Xa/=2,this.dw/=2,this.Xa|=0,this.dw|=0;const t=new Int8Array(this.Xa*this.dw);let i=0;for(let e=0;e>1)+(e+this.eT>>1)*this.Xa]=this.pw[i++];this.pw=t,this.width=this.Xa,this.height=this.dw,this.iT=0,this.eT=0}xw(){if(this.width===this.Xa&&this.height===this.dw)return;const t=new Int8Array(this.Xa*this.dw);let i=0;for(let e=0;e>2);t=-(3&t);for(let l=-i;l<0;l++){for(let t=a;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,n){try{const r=this.width;this.height;let h=0,o=0;const a=this.Xa,l=this.dw,c=(a<<16)/e|0,f=(l<<16)/n|0;t=t+(this.iT*e+a-1)/a|0,i=i+(this.eT*n+l-1)/l|0,this.iT*e%a!=0&&(h=(a-this.iT*e%a<<16)/e|0),this.eT*n%l!=0&&(o=(l-this.eT*n%l<<16)/n|0),e=e*(this.width-(h>>16))/a|0,n=n*(this.height-(o>>16))/l|0;let u,d=t+i*s.A.gw,w=s.A.gw-e;is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right&&(u=t+e-s.A.right,e-=u,w+=u),this.wT(s.A.pw,this.pw,this.palette,h,o,d,w,e,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}wT(t,i,e,s,n,r,h,o,a,l,c,f){try{const u=s;for(let d=-a;d<0;d++){const a=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+a];0==n?r++:t[r++]=e[255&n],s+=l}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}},2682:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(8950),n=e(1069),r=e(4474);class h{seed;constructor(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}yT(t){this.seed=(0x5deece66dn^t)&(1n<<48n)-1n}mT(){return this.next(32)}next(t){return this.seed=0x5deece66dn*this.seed+0xbn&(1n<<48n)-1n,Number(this.seed)>>>48-t}}var o=e(9298);class a extends r.A{static AT='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"£$%^&*()-_=+[{]};:\'@#~,<.>/?\\| ';static pT=[];static{const t=navigator.userAgent.includes('Capacitor');for(let i=0;i<256;i++){let e=a.AT.indexOf(String.fromCharCode(i));t&&e>=63&&e--,-1===e&&(e=74),a.pT[i]=e}}gT=[];IT=new Int32Array(94);_T=new Int32Array(94);CT=new Int32Array(94);ET=new Int32Array(94);vT=new Int32Array(95);bT=new Int32Array(256);random=new h(BigInt(Date.now()));height=0;static xu=(t,i)=>{const e=new n.A(t.read(i+'.dat')),s=new n.A(t.read('index.dat'));s.pf=e.mu+4;const r=s.pu;r>0&&(s.pf+=3*(r-1));const h=new a;for(let t=0;t<94;t++){h.CT[t]=s.pu,h.ET[t]=s.pu;const i=h.IT[t]=s.mu,n=h._T[t]=s.mu,r=s.pu,o=i*n;if(h.gT[t]=new Int8Array(o),0===r)for(let s=0;sh.height&&(h.height=n),h.CT[t]=1,h.vT[t]=i+2;{let e=0;for(let s=n/7|0;s=s.A.bottom&&(r-=e+r+1-s.A.bottom),i=s.A.right){const t=i+n+1-s.A.right;n-=t,l+=t,a+=t}n>0&&r>0&&this.DT(n,r,t,c,l,s.A.pw,o,a,h)}xT(t,i,e,n,r,h,o){e|=0,n|=0;let a=(t|=0)+(i|=0)*s.A.gw,l=s.A.gw-e,c=0,f=0;if(i=s.A.bottom&&(n-=i+n+1-s.A.bottom),t=s.A.right){const i=t+e+1-s.A.right;e-=i,c+=i,l+=i}e>0&&n>0&&this.NT(e,n,s.A.pw,a,l,o,f,c,r,h)}DT(t,i,e,s,n,r,h,o,a){const l=-((t|=0)>>2);t=-(3&t);for(let c=-(i|=0);c<0;c++){for(let t=l;t<0;t++)0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a,0===e[s++]?h++:r[h++]=a;for(let i=t;i<0;i++)0===e[s++]?h++:r[h++]=a;h+=o,s+=n}}NT(t,i,e,s,n,r,h,o,a,l){t|=0;const c=((16711935&a)*l&4278255360)+((65280&a)*l&16711680)>>8,f=256-l;for(let a=-(i|=0);a<0;a++){for(let i=-t;i<0;i++)if(0===r[h++])s++;else{const t=e[s];e[s++]=(((16711935&t)*f&4278255360)+((65280&t)*f&16711680)>>8)+c}s+=n,h+=o}}OT(t){return'red'===t?o.A.RED:'gre'===t?o.A.GREEN:'blu'===t?o.A.BLUE:'yel'===t?o.A.qa:'cya'===t?o.A.GE:'mag'===t?o.A.wA:'whi'===t?o.A.La:'bla'===t?o.A.Za:'lre'===t?o.A.YE:'dre'===t?o.A.HE:'dbl'===t?o.A.VE:'or1'===t?o.A.KE:'or2'===t?o.A.XE:'or3'===t?o.A.jE:'gr1'===t?o.A.zE:'gr2'===t?o.A.ZE:'gr3'===t?o.A.qE:o.A.Za}split(t,i){if(0===t.length)return[t];const e=[];for(;t.length>0;){if(this.RT(t)<=i&&-1===t.indexOf('|')){e.push(t);break}let s=t.length;for(let e=0;ei)break;s=e}else if('|'===t[e]){s=e;break}e.push(t.substring(0,s)),t=t.substring(s+1)}return e}}},1183:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(8950),n=e(7854);class r{FT;width;height;BT;PT;pw;constructor(t,i,e=n.na){this.BT=e,this.FT=this.BT.getImageData(0,0,t,i),this.PT=new Uint32Array(this.FT.data.buffer),this.pw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.pw.fill(0)}bind(){s.A.bind(this.pw,this.width,this.height)}draw(t,i){this.#t(),this.BT.putImageData(this.FT,t,i)}#t(){const t=this.pw.length,i=this.pw,e=this.PT;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,i,e)=>{e.d(i,{A:()=>s});class s{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));zo=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Qo=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};UT=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}},2901:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(1908);class r{static UT=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.GT)return null;if(this.XT[t])return this.XT[t];const i=this.KT[t],e=i+this.VT[t];if(this.WT){const s=Uint8Array.from(this.buffer.subarray(i,i+e));return this.XT[t]=s,s}{const i=Uint8Array.from(n.A.read(this.HT[t],this.buffer,this.VT[t],this.KT[t]));return this.XT[t]=i,i}}}},1069:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(9234),n=e(6666),r=e(4474);class h extends r.A{static zT=3988292384;static ZT=new Int32Array(256);static qT=new Uint32Array(33);static JT=new n.A;static $T=new n.A;static QT=new n.A;static tO=0;static iO=0;static eO=0;static{for(let t=0;t<32;t++)h.qT[t]=(1<>>=1:i=i>>>1^h.zT;h.ZT[t]=i}}static Zo=t=>{let i=4294967295;for(let e=0;e>>8^h.ZT[255&(i^t[e])];return~i};view;data;pf=0;sO=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.pf}static Pt=t=>{let i=null;return 0===t&&h.tO>0?(h.tO--,i=h.JT.Xg()):1===t&&h.iO>0?(h.iO--,i=h.$T.Xg()):2===t&&h.eO>0&&(h.eO--,i=h.QT.Xg()),i?(i.pf=0,i):new h(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.pf=0,100===this.view.byteLength&&h.tO<1e3?(h.JT.Vm(this),h.tO++):5e3===this.view.byteLength&&h.iO<250?(h.$T.Vm(this),h.iO++):3e4===this.view.byteLength&&h.eO<50&&(h.QT.Vm(this),h.eO++)}get pu(){return this.view.getUint8(this.pf++)}get Dd(){return this.view.getInt8(this.pf++)}get mu(){const t=this.view.getUint16(this.pf);return this.pf+=2,t}get Iu(){const t=this.view.getInt16(this.pf);return this.pf+=2,t}get qu(){const t=this.view.getUint8(this.pf++)<<16|this.view.getUint16(this.pf);return this.pf+=2,t}get ia(){const t=this.view.getInt32(this.pf);return this.pf+=4,t}get hE(){const t=this.view.getBigInt64(this.pf);return this.pf+=8,t}get FE(){return this.view.getUint8(this.pf)<128?this.pu-64:this.mu-49152}get CA(){return this.view.getUint8(this.pf)<128?this.pu:this.mu-32768}get Eu(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.pf++))&&this.pf>16),this.view.setUint16(this.pf,t),this.pf+=2}p4(t){this.view.setInt32(this.pf,t),this.pf+=4}oO(t){this.view.setInt32(this.pf,t,!0),this.pf+=4}aO(t){this.view.setBigInt64(this.pf,t),this.pf+=8}lO(t){const i=this.view,e=t.length;for(let s=0;s>>3}wO(t){let i=this.sO>>>3,e=8-(7&this.sO),s=0;for(this.sO+=t;t>e;e=8)s+=(this.view.getUint8(i++)&h.qT[e])<>>e-t&h.qT[t],s}yO(t,i){const e=this.pf;this.pf=0;const n=new Uint8Array(e);this.nO(e,0,n);const r=(0,s.mO)(n),h=(0,s.AO)(r,i,t),o=(0,s.pO)(h);this.pf=0,this.p1(o.length),this.cO(o,o.length,0)}}},5226:(t,i,e)=>{e.d(i,{Q:()=>n,x:()=>s});class s{gO=new Map;Eo;xo=self.isSecureContext?self.crypto.randomUUID():'0';constructor(t){this.Eo=t}async Ko(){const t=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),i=t.createDataChannel('channel'),e=crypto.randomUUID();this.gO.set(e,i),await t.setLocalDescription(await t.createOffer()),t.onicegatheringstatechange=async()=>{if('complete'===t.iceGatheringState){let i;self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(t.localDescription)):console.log(JSON.stringify(t.localDescription));try{for(;null===(i=prompt('Offer copied to clipboard, paste answer here')););t.setRemoteDescription(new RTCSessionDescription(JSON.parse(i)))}catch(t){console.error(t)}}},i.onopen=()=>{i.send(JSON.stringify({type:'id',id:e})),console.log('Connected to peer!')},i.onerror=t=>{console.error(t)},i.onmessage=t=>{const i=JSON.parse(t.data);i.data&&(i.data=Object.values(i.data)),this.Eo&&this.Eo.postMessage(i)}}postMessage(t){const i=this.gO.get(t.data.id),e=t.data;e.data&&(e.data=Array.from(t.data.data)),i&&'open'===i.readyState&&i.send(JSON.stringify(e))}}class n{pc;Lo=void 0;xo;constructor(t){this.pc=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),this.pc.ondatachannel=i=>{this.Lo=i.channel,this.Lo.onopen=()=>{console.log('Connected to host!')},this.Lo.onerror=t=>{console.error(t)},this.Lo.onmessage=i=>{if(!this.xo){const t=JSON.parse(i.data);if('id'===t.type)return void(this.xo=t.id)}t.onmessage&&t.onmessage(i)}},this.pc.onicegatheringstatechange=async()=>{'complete'===this.pc.iceGatheringState&&(self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(this.pc.localDescription)):console.log(JSON.stringify(this.pc.localDescription)))}}async Xo(t){await this.pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(t))),await this.pc.setLocalDescription(await this.pc.createAnswer())}}},3937:(t,i,e)=>{e.d(i,{A:()=>o});class s{start=0;end=0;form=0;length=0;IO=null;_O=null;threshold=0;position=0;delta=0;amplitude=0;CO=0;read(t){this.form=t.pu,this.start=t.ia,this.end=t.ia,this.length=t.pu,this.IO=new Int32Array(this.length),this._O=new Int32Array(this.length);for(let i=0;i=this.threshold&&this._O&&this.IO&&(this.amplitude=this._O[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this.IO[this.position]/65536*t|0,this.threshold>this.CO&&(this.delta=((this._O[this.position]<<15)-this.amplitude)/(this.threshold-this.CO)|0)),this.amplitude+=this.delta,this.CO++,this.amplitude-this.delta>>15}}class n{static buffer=null;static Ym=null;static sin=null;static EO=new Int32Array(5);static vO=new Int32Array(5);static bO=new Int32Array(5);static TO=new Int32Array(5);static OO=new Int32Array(5);RO=null;SO=null;LO=null;xO=null;kO=null;MO=null;release=null;attack=null;DO=new Int32Array(5);NO=new Int32Array(5);FO=new Int32Array(5);start=0;length=500;BO=100;PO=0;static init=()=>{this.Ym=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.Ym[t]=1:this.Ym[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};UO(t,i){for(let i=0;i>1,h+=(i*s>>16)+r}if(this.kO&&this.MO){const i=this.kO.evaluate(t),e=this.MO.evaluate(t);c=c*(32768+(this.WO(e,l,this.kO.form)>>1))>>15,l+=(i*o>>16)+a}for(let s=0;s<5;s++)if(0!==this.DO[s]){const r=i+n.vO[s];r>15,n.EO[s],this.RO.form),n.EO[s]+=(e*n.TO[s]>>16)+n.OO[s])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,e=!0;for(let s=0;s>8):this.release.start+((this.release.end-this.release.start)*h>>8),i+=256,i>=o&&(i=0,e=!e),e&&(n.buffer[s]=0)}}if(this.PO>0&&this.BO>0){const i=this.PO*e;for(let e=i;e32767&&(n.buffer[i]=32767);return n.buffer}WO(t,i,e){return 1===e?(32767&i)<16384?t:-t:2===e?n.sin[32767&i]*t>>14:3===e?((32767&i)*t>>14)-t:4===e?n.Ym[i/2607&32767]*t:0}read(t){this.RO=new s,this.RO.read(t),this.SO=new s,this.SO.read(t),0!==t.pu&&(t.pf--,this.LO=new s,this.LO.read(t),this.xO=new s,this.xO.read(t)),0!==t.pu&&(t.pf--,this.kO=new s,this.kO.read(t),this.MO=new s,this.MO.read(t)),0!==t.pu&&(t.pf--,this.release=new s,this.release.read(t),this.attack=new s,this.attack.read(t));for(let i=0;i<10;i++){const e=t.CA;if(0===e)break;this.DO[i]=e,this.NO[i]=t.FE,this.FO[i]=t.CA}this.PO=t.CA,this.BO=t.CA,this.length=t.mu,this.start=t.mu}}var r=e(1069),h=e(3867);class o{static GO=new Int32Array(1e3);static YO=null;static HO=null;static VO=new h.fe(1e3,null);KO=new h.fe(10,null);XO=0;loopEnd=0;static yu=t=>{const i=new r.A(t.read('sounds.dat'));for(this.YO=new Uint8Array(441e3),this.HO=new r.A(this.YO),n.init();;){const t=i.mu;if(65535===t)break;const e=new o;e.read(i),this.VO[t]=e,this.GO[t]=e.trim()}};static UO=(t,i)=>{if(!this.VO[t])return null;const e=this.VO[t];return e?.jO(i)??null};read(t){for(let i=0;i<10;i++)0!==t.pu&&(t.pf--,this.KO[i]=new n,this.KO[i]?.read(t));this.XO=t.mu,this.loopEnd=t.mu}trim(){let t=9999999;for(let i=0;i<10;i++)this.KO[i]&&(this.KO[i].start/20|0)i&&(i=this.KO[t].length+this.KO[t].start);if(0===i)return 0;let e=22050*i/1e3|0,s=22050*this.XO/1e3|0,n=22050*this.loopEnd/1e3|0;(s<0||n<0||n>e||s>=n)&&(t=0);let r=e+(n-s)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){s+=44,n+=44,e+=44,r+=44;const i=r-e;for(let t=e-1;t>=n;t--)o.YO&&(o.YO[t+i]=o.YO[t]);for(let i=1;i{e.d(i,{aA:()=>l,oA:()=>o,fe:()=>s,LA:()=>n,Eh:()=>r,TA:()=>h,Xr:()=>a});class s extends Array{constructor(t,i){super(t);for(let e=0;e{e.d(i,{pO:()=>o,Jo:()=>n,mO:()=>h,$o:()=>s,ec:()=>r,AO:()=>a});const s=async t=>new Promise((i=>setTimeout(i,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),r=async t=>(await fetch(t)).text();function h(t){let i=0n;for(let e=0;e0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function a(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}},7953:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static zO=new Uint16Array(['d','o','t'].join('').split('').map((t=>t.charCodeAt(0))));static ZO=new Uint16Array(['(','a',')'].join('').split('').map((t=>t.charCodeAt(0))));static qO=new Uint16Array(['s','l','a','s','h'].join('').split('').map((t=>t.charCodeAt(0))));static JO=['cook',"cook's",'cooks','seeks','sheet'];static $O=[];static QO=[];static tR=[];static iR=[];static eR=[];static sR=[];static yu=t=>{const i=new s.A(t.read('fragmentsenc.txt')),e=new s.A(t.read('badenc.txt')),n=new s.A(t.read('domainenc.txt')),r=new s.A(t.read('tldlist.txt'));this.read(e,n,i,r)};static filter=t=>{const i=[...t];this.format(i);const e=i.join('').trim(),s=e.toLowerCase(),n=[...s];this.nR(n),this.rR(n),this.hR(n),this.oR(n);for(let t=0;t{this.cR(t),this.fR(i),this.uR(e),this.dR(s)};static dR=t=>{const i=t.ia;for(let e=0;et.pu))};static cR=t=>{const i=t.ia;for(let e=0;et.pu));const i=new Array(t.pu).fill([]).map((()=>[t.Dd,t.Dd]));i.length>0&&(this.iR[e]=i)}};static fR=t=>{const i=t.ia;for(let e=0;et.pu))};static uR=t=>{const i=t.ia;for(let e=0;e{const i=[...t],e=[...t];this.wR(null,i,this.zO),this.wR(null,e,this.qO);for(let s=0;s{for(let i=0;i<2;i++)for(let i=this.tR.length-1;i>=0;i--)this.wR(this.iR[i],t,this.tR[i])};static hR=t=>{const i=[...t],e=[...t];this.wR(null,i,this.ZO),this.wR(null,e,this.zO);for(let s=this.eR.length-1;s>=0;s--)this.mR(e,i,this.eR[s],t)};static oR=t=>{for(let i=0;i=0&&n{if(this.ER(t))return!0;const i=this.vR(t),e=this.sR,s=e.length;if(i===e[0]||i===e[s-1])return!0;let n=0,r=s-1;for(;n<=r;){const t=(n+r)/2|0;if(i===e[t])return!0;i{if(t.length>6)return 0;let i=0;for(let e=0;e{for(let e=i;e=0;e++)if(this.TR(t[e]))return e;return-1};static _R=(t,i)=>{for(let e=t;e=0;e++)if(!this.TR(i[e]))return e;return i.length};static OR=(t,i,e)=>i===e||'o'===i&&'0'===e?1:'o'===i&&'('===e&&')'===t?2:'c'!==i||'('!==e&&'<'!==e&&'['!==e?'e'===i&&'€'===e||'s'===i&&'$'===e||'l'===i&&'i'===e?1:0:1;static mR=(t,i,e,s)=>{const n=e.length,r=s.length;for(let h=0;h<=r-n;h++){const{RR:n,SR:r}=this.LR(h,e,s);if(!n)continue;const o=this.xR(h,s,3,i,['@']),a=this.kR(r-1,s,3,t,['.',',']);(o>2||a>2)&&this.IR(h,r,s)}};static LR=(t,i,e)=>{const s=i.length;let n=t,r=0;for(;n0)n+=a,r++;else{if(0===r)break;const e=this.OR(o,String.fromCharCode(i[r-1]),h);if(e>0)n+=e,1===r&&t++;else{if(r>=s||!this.pR(h))break;n++}}}return{RR:r>=s,SR:n}};static wR=(t,i,e)=>{if(!(e.length>i.length))for(let s=0;s<=i.length-e.length;s++){let n=s;const{SR:r,MR:h,DR:o,NR:a,FR:l}=this.BR(i,e,n);n=r;let c=i[n],f=n+1=e.length)||a&&l)continue;let u,d=!0;if(o){let t=!1,e=!1;if((s-1<0||this.pR(i[s-1])&&"'"!==i[s-1])&&(t=!0),(n>=i.length||this.pR(i[n])&&"'"!==i[n])&&(e=!0),!t||!e){let e=!1;for(u=s-2,t&&(u=s);!e&&u=0&&(!this.pR(i[u])||"'"===i[u])){const t=[];let s;for(s=0;s<3&&u+s=0&&(!this.pR(i[u-1])||"'"===i[u-1])&&(n=!1),n&&!this.CR(t)&&(e=!0)}u++}e||(d=!1)}}else{c=' ',s-1>=0&&(c=i[s-1]),f=' ',n{let s=e,n=0,r=0,h=!1,o=!1,a=!1;for(;s=t.length||o&&a);){const l=t[s],c=s+10)1===f&&this.TR(l)&&(o=!0),2===f&&(this.TR(l)||this.TR(c))&&(o=!0),s+=f,n++;else{if(0===n)break;let t;if((t=this.GR(c,String.fromCharCode(i[n-1]),l))>0)s+=t;else{if(n>=i.length||!this.gR(l))break;if(this.pR(l)&&"'"!==l&&(h=!0),this.TR(l)&&(a=!0),s++,r++,(100*r/(s-e)|0)>90)break}}}return{SR:s,MR:n,DR:h,NR:o,FR:a}};static GR=(t,i,e)=>{if(i===e)return 1;if(i>='a'&&i<='m'){if('a'===i)return'4'!==e&&'@'!==e&&'^'!==e?'/'===e&&'\\'===t?2:0:1;if('b'===i)return'6'!==e&&'8'!==e?'1'===e&&'3'===t?2:0:1;if('c'===i)return'('!==e&&'<'!==e&&'{'!==e&&'['!==e?0:1;if('d'===i)return'['===e&&')'===t?2:0;if('e'===i)return'3'!==e&&'€'!==e?0:1;if('f'===i)return'p'===e&&'h'===t?2:'£'===e?1:0;if('g'===i)return'9'!==e&&'6'!==e?0:1;if('h'===i)return'#'===e?1:0;if('i'===i)return'y'!==e&&'l'!==e&&'j'!==e&&'1'!==e&&'!'!==e&&':'!==e&&';'!==e&&'|'!==e?0:1;if('j'===i)return 0;if('k'===i)return 0;if('l'===i)return'1'!==e&&'|'!==e&&'i'!==e?0:1;if('m'===i)return 0}if(i>='n'&&i<='z'){if('n'===i)return 0;if('o'===i)return'0'!==e&&'*'!==e?'('===e&&')'===t||'['===e&&']'===t||'{'===e&&'}'===t||'<'===e&&'>'===t?2:0:1;if('p'===i)return 0;if('q'===i)return 0;if('r'===i)return 0;if('s'===i)return'5'!==e&&'z'!==e&&'$'!==e&&'2'!==e?0:1;if('t'===i)return'7'!==e&&'+'!==e?0:1;if('u'===i)return'v'===e?1:'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('v'===i)return'\\'===e&&'/'===t||'\\'===e&&'|'===t||'|'===e&&'/'===t?2:0;if('w'===i)return'v'===e&&'v'===t?2:0;if('x'===i)return')'===e&&'('===t||'}'===e&&'{'===t||']'===e&&'['===t||'>'===e&&'<'===t?2:0;if('y'===i)return 0;if('z'===i)return 0}return i>='0'&&i<='9'?'0'===i?'o'===e||'O'===e?1:'('===e&&')'===t||'{'===e&&'}'===t||'['===e&&']'===t?2:0:'1'===i&&'l'===e?1:0:','===i?'.'===e?1:0:'.'===i?','===e?1:0:'!'===i&&'i'===e?1:0};static UR=(t,i,e)=>{let s=0,n=i.length-1;for(;s<=n;){const r=(s+n)/2|0;if(i[r][0]===t&&i[r][1]===e)return!0;tthis.bR(t)?t.charCodeAt(0)+1-'a'.charCodeAt(0):"'"===t?28:this.TR(t)?t.charCodeAt(0)+29-'0'.charCodeAt(0):27;static yR=(t,i,e,s,n)=>{if(!(s.length>e.length))for(let r=0;r<=e.length-s.length;r++){const{SR:h,YR:o}=this.HR(e,s,r);if(o0&&c>0&&(a=!0),2===i&&(l>2&&c>0||l>0&&c>2)&&(a=!0),3===i&&l>0&&c>2&&(a=!0),!a)continue;let f,u=r,d=h-1,w=!1;if(l>2){if(4===l)for(w=!1,f=r-1;f>=0;f--)if(w){if('*'!==n[f])break;u=f}else'*'===n[f]&&(u=f,w=!0);for(w=!1,f=u-1;f>=0;f--)if(w){if(this.pR(e[f]))break;u=f}else this.pR(e[f])||(w=!0,u=f)}if(c>2){if(4===c)for(w=!1,f=d+1;f{let s=0;for(;e0)e+=h,s++;else{if(0===s)break;let t;if((t=this.OR(r,String.fromCharCode(i[s-1]),n))>0)e+=t;else{if(!this.pR(n))break;e++}}}return{SR:e,YR:s}};static pR=t=>!this.WR(t)&&!this.TR(t);static gR=t=>!this.bR(t)||('v'===t||'x'===t||'j'===t||'q'===t||'z'===t);static WR=t=>this.bR(t)||this.VR(t);static TR=t=>t>='0'&&t<='9';static bR=t=>t>='a'&&t<='z';static VR=t=>t>='A'&&t<='Z';static ER=t=>{for(let i=0;i{for(let s=t;s{let e=0;for(let s=i-1;s>=0&&this.pR(t[s]);s--)'*'===t[s]&&e++;return e};static XR=(t,i)=>{let e=0;for(let s=i+1;s(n?this.KR(i,e):this.XR(i,e))>=s?4:this.pR(n?t[e-1]:t[e+1])?1:0;static xR=(t,i,e,s,n)=>{if(0===t)return 2;for(let e=t-1;e>=0&&this.pR(i[e]);e--)if(n.includes(i[e]))return 3;return this.jR(i,s,t,e,!0)};static kR=(t,i,e,s,n)=>{if(t+1===i.length)return 2;for(let e=t+1;e{let i=0;for(let e=0;et>=' '&&t<=''||' '===t||'\n'===t||'\t'===t||'£'===t||'€'===t;static aR=(t,i)=>{for(let e=0;e{let i=!0;for(let e=0;e{e.a(t,(async(t,i)=>{try{var s=e(7046),n=e(1312),r=e(5637),h=e(2164),o=e(1302),a=e(6948),l=e(8317),c=e(8738),f=e(3764),u=e(1120),d=e(4583),w=e(2682),y=e(8665),m=e(8534),A=e(6730),p=e(7953),g=e(9234),I=e(8950),_=e(1069),C=e(3937),E=e(4544),v=e(1908),b=e(9298),T=e(1651),O=e(7604);class t extends T.K{ZR=0;qR=!0;VA=0;KA=0;XA=0;JR=0;$R=0;QR=2;model={id:parseInt(s.A.getParameter('model'))||0,x:0,y:0,z:420,$g:0};constructor(){super(!0)}load=async()=>{await this.qo(10,'Connecting to fileserver'),await v.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new E.A(await E.A.openDatabase());const t=new _.A(new Uint8Array(await(0,g.Jo)(`${T.K.nt}/crc`))),i=[];for(let e=0;e<9;e++)i[e]=t.ia;const e=await this.jo('title','title screen',i[1],10);this.di=w.A.xu(e,'p11'),this.wi=w.A.xu(e,'p12'),this.yi=w.A.xu(e,'b12'),this.mi=w.A.xu(e,'q8');const s=await this.jo('config','config',i[2],15),I=await this.jo('interface','interface',i[3],20),b=await this.jo('media','2d graphics',i[4],30),O=await this.jo('models','3d graphics',i[5],40),R=await this.jo('textures','textures',i[6],60),S=await this.jo('wordenc','chat system',i[7],65),L=await this.jo('sounds','sound effects',i[8],70);await this.qo(75,'Unpacking media'),await this.qo(80,'Unpacking textures'),d.A.Ev(R),d.A.Tv(.8),d.A.Rv(20),await this.qo(83,'Unpacking models'),y.A.yu(O),m.A.yu(O),A.A.yu(O),await this.qo(86,'Unpacking config'),n.A.yu(s),r.A.yu(s),h.A.yu(s),o.A.yu(s,!0),a.A.yu(s),l.A.yu(s),c.A.yu(s),f.A.yu(s),await this.qo(90,'Unpacking sounds'),C.A.yu(L),await this.qo(92,'Unpacking interfaces'),u.A.yu(I,b,[this.di,this.wi,this.yi,this.mi]),await this.qo(97,'Preparing game engine'),p.A.yu(S),this.Fo?.bind(),d.A.Fc()};update=async()=>{this.tS(),this.iS(),this.ZR++,this.ZR>50&&(this.qR&&(s.A.setParameter('model',this.model.id.toString()),this.qR=!1),this.ZR=0)};draw=async()=>{I.A.clear(),I.A.fillRect(0,0,this.width,this.height,5592405);const t=y.A.model(this.model.id);if(t.Hl(64,850,-30,-50,-30,!0),t.draw(this.model.$g,d.A.sin[this.JR],d.A.cos[this.JR],d.A.sin[this.$R],d.A.cos[this.$R],this.model.x-this.VA,this.model.y-this.KA,this.model.z-this.XA,0),this.yi){this.yi.kT(this.width,this.yi.height,`FPS: ${this.lc}`,b.A.qa);let t=this.yi.height;this.yi.ja(0,t,`Model: ${this.model.id}`,b.A.qa),t+=this.yi.height,this.yi.ja(0,t,'Controls:',b.A.qa),t+=this.yi.height,this.yi.ja(0,t,'r - reset camera and model rotation + movement speed',b.A.qa),t+=this.yi.height,this.yi.ja(0,t,'1 and 2 - change model',b.A.qa),t+=this.yi.height,this.yi.ja(0,t,'[ and ] - adjust movement speed',b.A.qa),t+=this.yi.height,this.yi.ja(0,t,'left and right - adjust model yaw',b.A.qa),t+=this.yi.height,this.yi.ja(0,t,'up and down - adjust model pitch',b.A.qa),t+=this.yi.height,this.yi.ja(0,t,'. and / - adjust model roll',b.A.qa),t+=this.yi.height,this.yi.ja(0,t,'w and s - move camera along z axis',b.A.qa),t+=this.yi.height,this.yi.ja(0,t,'a and d - move camera along x axis',b.A.qa),t+=this.yi.height,this.yi.ja(0,t,'q and e - move camera along y axis',b.A.qa)}this.Fo?.draw(0,0)};tS(){for(;;){const t=this.Wc();if(-1===t)break;t==='r'.charCodeAt(0)?(this.QR=2,this.qR=!0):t==='1'.charCodeAt(0)?(this.model.id--,this.model.id<0&&y.A.metadata&&(this.model.id=y.A.metadata.length-100-1),this.qR=!0):t==='2'.charCodeAt(0)&&(this.model.id++,y.A.metadata&&this.model.id>=y.A.metadata.length-100&&(this.model.id=0),this.qR=!0)}}iS(){this.Cc['['.charCodeAt(0)]?this.QR--:this.Cc[']'.charCodeAt(0)]&&this.QR++,this.Cc[1]?(this.model.$g+=this.QR,this.qR=!0):this.Cc[2]&&(this.model.$g-=this.QR,this.qR=!0),this.Cc['w'.charCodeAt(0)]?(this.model.z-=this.QR,this.qR=!0):this.Cc['s'.charCodeAt(0)]&&(this.model.z+=this.QR,this.qR=!0),this.Cc['a'.charCodeAt(0)]?(this.model.x-=this.QR,this.qR=!0):this.Cc['d'.charCodeAt(0)]&&(this.model.x+=this.QR,this.qR=!0),this.Cc['q'.charCodeAt(0)]?(this.model.y+=this.QR,this.qR=!0):this.Cc['e'.charCodeAt(0)]&&(this.model.y-=this.QR,this.qR=!0),this.JR=2047&this.JR,this.$R=2047&this.$R,this.model.$g=2047&this.model.$g}}await(0,O.w)(),(new t).run().then((()=>{})),i()}catch(t){i(t)}}),1)},1908:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(9763);class n{static eS=null;static load=async t=>{this.eS=await(0,s.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,e,s)=>{if(!this.eS)throw new Error('bz2 not found!!');return Int8Array.from(this.eS.read(t,i,e,s))}}},123:(t,i,e)=>{function s(t,i,e){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256,e)}function n(t){window._tinyMidiStop&&window._tinyMidiStop(t)}e.d(i,{ea:()=>s,ko:()=>n})},2604:(t,i,e)=>{function s(t,i){var e;(e=document.createElement('a')).href=t,e.download=i,document.body.appendChild(e),e.style='display: none',e.click(),e.remove()}e.d(i,{A:()=>s})},9763:(t,i,e)=>{async function s(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,a=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,a,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(a),a}(a,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(l,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function a(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function l(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}e.d(i,{F:()=>s})},9896:(t,i,e)=>{var s=e(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{const t=2,i=44100;let e=new Float32Array,n=window.audioContext.createGain();n.gain.setValueAtTime(.1,window.audioContext.currentTime),n.connect(window.audioContext.destination);let r=window.audioContext.currentTime,h=[];const o=new s.A({sS:30,nS:t=>{let i=new Float32Array(t.buffer),s=new Float32Array(e.length+i.length);s.set(e,0),s.set(i,e.length),e=s},rS:t=>{},bufferSize:102400});await o.init();const a=await fetch('./SCC1_Florestan.sf2'),l=new Uint8Array(await a.arrayBuffer());function c(){if(!window.audioContext||!e.length)return;let s=window.audioContext.createBufferSource();const o=e.length/t,a=window.audioContext.createBuffer(t,o,i);for(let i=0;i{t.stop(window.audioContext.currentTime)})),h=[],n.gain.setValueAtTime(t,window.audioContext.currentTime)}}function d(t,i){-1!==t&&window._tinyMidiVolume(t),r=window.audioContext.currentTime,f=setInterval(c,250),o.hS(i)}o.oS(l),window._tinyMidiStop=async t=>{t?function(t){const i=window.audioContext.currentTime;n.gain.cancelScheduledValues(i),n.gain.setTargetAtTime(0,i,.5),setTimeout(t,2e3)}((()=>{u()})):u()},window._tinyMidiVolume=(t=1)=>{n.gain.setValueAtTime(t,window.audioContext.currentTime)},window._tinyMidiPlay=async(t,i,e)=>{t&&(await window._tinyMidiStop(e),e?setTimeout((()=>{d(i,t)}),2e3):d(i,t))}})()},8151:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5473);const n=class{constructor(t={}){this.aS=void 0,this.lS=0,this.cS=0,this.fS=0,this.sS=t.sS||100,this.sampleRate=t.sampleRate||44100,this.uS=t.uS||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.dS(1),this.nS=t.nS||(()=>{}),this.rS=t.rS||(()=>{}),this.wS=void 0,this.test=0}async init(){if(!this.aS){if('undefined'!=typeof process){const{yS:t}=await import('path'),{mS:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.aS=await(0,s.A)(),this.AS=this.aS._malloc(this.bufferSize),this.pS=this.aS._malloc(8)}}dS(t){this.bufferSize=4*this.sampleRate*this.uS*t}gS(){if(!this.aS)throw new Error(`${this.constructor.name} not initalized. call .init()`)}oS(t){this.gS();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.aS;e(this.lS),this.lS=i(t.length),this.aS.HEAPU8.set(t,this.lS),this.cS=s(this.lS,t.length),n(this.cS,2===this.uS?0:2,this.sampleRate,this.gain)}IS(){this.gS();const t=new Uint8Array(this.bufferSize);return t.set(this.aS.HEAPU8.subarray(this.AS,this.AS+this.bufferSize)),t}_S(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.aS;return e(this.fS),this.fS=i(t.length),this.aS.HEAPU8.set(t,this.fS),s(this.fS,t.length)}CS(t){const{_midi_render:i}=this.aS;return i(this.cS,t,this.uS,this.sampleRate,this.AS,this.bufferSize,this.pS)}hS(t){if(this.gS(),!this.cS)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.wS);const{setValue:i,getValue:e}=this.aS;i(this.pS,0,'double'),this.aS._tsf_reset(this.cS),this.aS._tsf_channel_set_bank_preset(this.cS,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this._S(t);const n=()=>{s=this.CS(s);const t=this.IS();this.nS(t),s?this.wS=setTimeout(n,this.sS):this.rS(e(this.pS,'double'))};this.wS=setTimeout(n,16)}}},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,e)=>{var s;e.d(i,{A:()=>n});const n=(s="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,n,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,e){i=t,n=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(r.ready,t)||Object.defineProperty(r.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var h=Object.assign({},r),o=[],a='object'==typeof window,l='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!a&&!c&&!l;if(r.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var m,A;y=l?require('path').yS(y)+'/':__dirname+'/';var p=()=>{A||(m=require('fs'),A=require('path'))};u=(t,i)=>(p(),t=A.normalize(t),m.ES(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,e)=>{p(),t=A.normalize(t),m.vS(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),r.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,e){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!a&&!l)throw new Error('environment detection error');if(l?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),s&&(y=s),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},l&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}r.print||console.log.bind(console);var g,I,_=r.printErr||console.warn.bind(console);function C(t,i){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(r,h),h=null,g='fetchSettings',Object.getOwnPropertyDescriptor(r,g)&&j('`Module.'+g+'` was supplied but `'+g+'` not included in INCOMING_MODULE_JS_API'),r.arguments&&(o=r.arguments),C('arguments','arguments_'),r.thisProgram&&r.thisProgram,C('thisProgram','thisProgram'),r.quit&&r.quit,C('quit','quit_'),D(void 0===r.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===r.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===r.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===r.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===r.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),r.wasmBinary&&(I=r.wasmBinary),C('wasmBinary','wasmBinary');var v;r.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,O,R,S,L,x,k,M=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function N(t){b=t,r.HEAP8=T=new Int8Array(t),r.HEAP16=R=new Int16Array(t),r.HEAP32=S=new Int32Array(t),r.HEAPU8=O=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=L=new Uint32Array(t),r.HEAPF32=x=new Float32Array(t),r.HEAPF64=k=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var F=5242880;r.TOTAL_STACK&&D(F===r.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=r.INITIAL_MEMORY||16777216;function P(){if(!M){var t=ft(),i=L[t>>2],e=L[t+4>>2];34821223==i&&2310721022==e||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==L[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=F,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+F+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!r.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var U=[],W=[],G=[],Y=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var H=0,V=null,K=null,X={};function j(t){r.onAbort&&r.onAbort(t),_(t='Aborted('+t+')'),M=!0;var i=new WebAssembly.RuntimeError(t);throw n(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},bS:function(){z.error()},TS:function(){z.error()},OS:function(){z.error()},open:function(){z.error()},RS:function(){z.error()},SS:function(){z.error()},LS:function(){z.error()},xS:function(){z.error()},kS:function(){z.error()}};r.FS_createDataFile=z.bS,r.FS_createPreloadedFile=z.TS;var Z,q,J,$,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=r.asm),D(Y,'native function `'+e+'` called before runtime initialization'),s[t]||D(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==Z&&I)return new Uint8Array(I);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(r)}function ht(t){ht.MS||(ht.MS={}),ht.MS[t]||(ht.MS[t]=1,c&&(t='warning: '+t),_(t))}function ot(t){try{return v.grow(t-b.byteLength+65535>>>16),N(v.buffer),1}catch(i){_('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}r.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=r.locateFile?r.locateFile(q,y):y+q):Z=new URL(e(8227),e.b).toString();var at,lt={"emscripten_memcpy_big":function(t,i,e){O.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=O.length;D((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return _('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return _('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':lt,'wasi_snapshot_preview1':lt};function e(t,i){var e,s=t.exports;r.asm=s,D(v=r.asm.memory,"memory not found in wasm exports"),N(v.buffer),D(r.asm.__indirect_function_table,"table not found in wasm exports"),e=r.asm.__wasm_call_ctors,W.unshift(e),function(t){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(X[t]),delete X[t]):_('warning: run dependency removed without ID'),0==H&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',H++,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(M)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,_('still waiting on run dependencies:')),_('dependency: '+i);t&&_('(end of list)')}),1e4))):_('warning: run dependency added without ID');var s=r;function h(t){D(r===s,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),s=null,e(t.instance)}function o(t){return function(){if(!I&&(a||l)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return st(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){_('failed to asynchronously prepare wasm: '+t),it(Z)&&_('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(r.instantiateWasm)try{return r.instantiateWasm(i,e)}catch(t){_('Module.instantiateWasm callback failed with error: '+t),n(t)}(I||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(h):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return _('wasm streaming compile failed: '+t),_('falling back to ArrayBuffer instantiation'),o(h)}))}))).catch(n)}(),r.___wasm_call_ctors=et("__wasm_call_ctors"),r._malloc=et("malloc"),r._free=et("free"),r._tsf_load_memory=et("tsf_load_memory"),r._tsf_close=et("tsf_close"),r._tsf_reset=et("tsf_reset"),r._tsf_set_output=et("tsf_set_output"),r._tsf_set_max_voices=et("tsf_set_max_voices"),r._realloc=et("realloc"),r._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),r._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),r._tml_load_memory=et("tml_load_memory"),r._midi_render=et("midi_render"),r.___errno_location=et("__errno_location"),r._fflush=et("fflush"),r._emscripten_stack_init=function(){return(ct=r._emscripten_stack_init=r.asm.emscripten_stack_init).apply(null,arguments)}),ft=(r._emscripten_stack_get_free=function(){return(r._emscripten_stack_get_free=r.asm.emscripten_stack_get_free).apply(null,arguments)},r._emscripten_stack_get_base=function(){return(r._emscripten_stack_get_base=r.asm.emscripten_stack_get_base).apply(null,arguments)},r._emscripten_stack_get_end=function(){return(ft=r._emscripten_stack_get_end=r.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),L[t>>2]=34821223,L[t+4>>2]=2310721022,L[0]=1668509029}function dt(t){function e(){at||(at=!0,r.calledRun=!0,M||(D(!Y),Y=!0,P(),rt(W),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),D(!r._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(P(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),G.unshift(t);var t;rt(G)}()))}t=t||o,H>0||(ut(),function(){if(r.preRun)for('function'==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),U.unshift(t);var t;rt(U)}(),H>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),e()}),1)):e(),P()))}if(r.stackSave=et("stackSave"),r.stackRestore=et("stackRestore"),r.stackAlloc=et("stackAlloc"),r.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':T[0|t]=i;break;case'i16':R[t>>1]=i;break;case'i32':S[t>>2]=i;break;case'i64':$=[i>>>0,(J=i,+Math.abs(J)>=1?J>0?(0|Math.min(+Math.floor(J/4294967296),4294967295))>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],S[t>>2]=$[0],S[t+4>>2]=$[1];break;case'float':x[t>>2]=i;break;case'double':k[t>>3]=i;break;case'*':L[t>>2]=i;break;default:j('invalid type for setValue: '+e)}},r.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return T[0|t];case'i16':return R[t>>1];case'i32':case'i64':return S[t>>2];case'float':return x[t>>2];case'double':return k[t>>3];case'*':return L[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),K=function t(){at||dt(),at||(K=t)},r.preInit)for('function'==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return dt(),t.ready})}},r={};function h(t){var i=r[t];if(void 0!==i)return i.exports;var e=r[t]={exports:{}};return n[t](e,e.exports,h),e.exports}h.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",e="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",s=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},h.a=(n,r,h)=>{var o;h&&((o=[]).d=-1);var a,l,c,f=new Set,u=n.exports,d=new Promise(((t,i)=>{c=i,l=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,r((n=>{var r;a=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var r=[];r.d=0,n.then((t=>{h[i]=t,s(r)}),(t=>{h[e]=t,s(r)}));var h={};return h[t]=t=>t(r),h}}var o={};return o[t]=t=>{},o[i]=n,o})))(n);var h=()=>a.map((t=>{if(t[e])throw t[e];return t[i]})),l=new Promise((i=>{(r=()=>i(h)).r=0;var e=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(r.r++,t.push(r)));a.map((i=>i[t](e)))}));return r.r?l:h()}),(t=>(t?c(d[e]=t):l(u),s(o)))),o&&o.d<0&&(o.d=0)},h.d=(t,i)=>{for(var e in i)h.o(i,e)&&!h.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},h.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),h.p="/Client2/",h.b=document.baseURI||self.location.href;h(8073)})(); \ No newline at end of file diff --git a/sounds.js b/sounds.js index 08f603e8..62ae4c7a 100644 --- a/sounds.js +++ b/sounds.js @@ -1 +1 @@ -(()=>{"use strict";var t,i,e,s,n={1651:(t,i,e)=>{e.d(i,{K:()=>D});var s=e(1120),n=e(4583),r=e(2901),h=e(1069),o=e(7046),l=(e(9896),e(6666)),a=e(3045),c=e(818),f=e(670),u=e(8268),d=e(3867),w=e(7854),y=e(8950),A=e(1302),m=e(9298),p=e(8665),_=e(1312),I=e(3819),g=e(8317),C=e(9234),E=e(1908),v=e(123),b=e(5637),T=e(6948),O=e(2164),R=e(8738),L=e(3764),S=e(8534),x=e(6730),M=e(2604),k=e(5226);class D extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static et=!1;static st='';static nt='';static rt=!1;static ht=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static _t=0;static It=0;static gt=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Ot=0;static Rt=()=>{a.A.et=!1,n.A.et=!1,D.et=!1,c.A.et=!1};static Lt=()=>{a.A.et=!0,n.A.et=!0,D.et=!0,c.A.et=!0};St=2048;xt=2047;Mt=!1;kt=!1;Dt=!1;Nt=!1;db=null;Ft=0;Bt=[];stream=null;in=h.A.Pt(1);Ut=h.A.Pt(1);Gt=h.A.Pt(1);Wt=0n;Yt=0;Ht=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;Jt=!0;$t=0;Qt=0;ti=null;ii=null;ei=null;si=null;ni=null;ri=null;hi=null;oi=null;li=null;ai=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;Ai=null;mi=[];pi=!1;_i=null;Ii=null;gi=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Oi=null;Ri=null;Li=new Int32Array(256);Si=0;xi=0;Mi=0;ki=null;Di=null;Ni=null;Fi=null;Bi=null;Pi=null;Ui=null;Gi=null;Wi=null;Yi=null;Hi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;Ji=null;$i=null;Qi=null;te=new Int32Array(33);ie=new Int32Array(33);ee=new Int32Array(151);se=new Int32Array(151);ne=null;re=null;he=null;oe=null;le=null;ae=null;ce=new d.fe(13,null);ue=null;de=null;we=new d.fe(50,null);ye=new d.fe(50,null);Ae=new d.fe(20,null);me=new d.fe(20,null);pe=null;_e=new d.fe(8,null);Ie=null;ge=null;Ce=null;Ee=null;ve=null;be=null;Te=null;Oe=null;Re=null;Le=null;Se=null;xe=null;Me=null;ke=null;De=null;Ne=null;Fe=null;Be=null;Pe=new d.fe(1e3,null);Ue=!1;Ge=!1;We=!1;Ye=!1;He=-1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=!1;Je=0;$e=0;Qe=0;ts=0;es=0;ss=0;ns=[];rs=-1;hs=-1;os=new s.A;ls=78;cs=0;fs=0;us=[];ds=0;ws=0;ys=0;As=0;ps=0;_s=0;Is=0;gs=0;Cs=[];Es=[];vs=[];bs=[];Ts=null;Os=-1;Rs=3;Ls=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Ss=0;xs=0;Ms=0;ks=!1;Ds=0;Ns=!1;Fs='';Bs='';Ps=0;Us='';Gs=!1;Ws=-1;Ys=new d.fe(100,null);Hs=new d.fe(100,null);messageType=new Int32Array(100);Vs=new Int32Array(100);Ks=0;Xs=0;js=0;zs='';Zs=0;qs=0;Js=0;$s=0;Qs=0;tn=0;en=0;sn=0;nn=0;rn=!1;hn=0;ln=0;an=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;An=!1;mn=[];pn=[];_n=0;In=0;gn=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);On=new Int32Array(500);Rn=0;Ln=0;Sn=0;xn='';Mn=!1;kn=-1;Dn=0;Nn=0;Fn=0;Bn=0;Pn=0;Un=new Int32Array(1e3);Gn=new Int32Array(1e3);Wn=null;Yn=0;Hn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;Jn=0;$n=2;Qn=2;tr=1;ir=new Int32Array(5);er=new d.fe(5,!1);sr=new Int32Array(5);nr=new Int32Array(5);rr=new Int32Array(5);hr=0;lr=0;ar=0;cr=0;ur=0;dr=0;wr=0;yr=0;Ar=0;mr=1;pr=2;_r=-1;Ir=0;gr=0;Cr=0;Er=0;vr=0;br=0;Tr=null;Or=null;Rr=null;Lr=0;Sr=0;Mr=new Int8Array(16384);kr=new d.fe(f.A.Dr,null);Nr=0;Fr=0;Br=128;Pr=0;Ur=0;Gr=0;Wr=0;Yr=0;Hr=null;Vr=null;Kr=new d.Xr(f.A.jr,f.A.jr);zr=0;Zr=0;qr=0;Jr=0;$r=0;Qr=0;th=0;ih=0;eh=0;sh=0;nh=0;rh=0;hh=new d.fe(this.St,null);oh=0;lh=new Int32Array(this.St);ah=0;fh=0;uh=new Int32Array(this.St);dh=new Int32Array(1e3);wh=new d.fe(this.St,null);yh=new d.fe(8192,null);Ah=0;mh=new Int32Array(8192);ph=new l.A;_h=new l.A;Ih=new l.A;gh=new l.A;Ch=new d.Eh(f.A.Dr,f.A.jr,f.A.jr,null);bh=new l.A;Th=new Int32Array(4e3);Oh=new Int32Array(4e3);Rh=new Int32Array(f.A.jr*f.A.jr);Lh=new Int32Array(f.A.jr*f.A.jr);Sh=0;xh=null;Mh=0;kh=0;Dh=-1;Nh=0;Fh=0;Bh=0;Ph=0;Uh=!1;Gh=!0;Wh=!1;Yh=new Int32Array(7);Hh=new Int32Array(5);Vh=0;Kh=0;static Xh=50;jh=new Int32Array(D.Xh);zh=new Int32Array(D.Xh);Zh=new Int32Array(D.Xh);qh=new Int32Array(D.Xh);Jh=new Int32Array(D.Xh);$h=new Int32Array(D.Xh);Qh=new Int32Array(D.Xh);io=new d.fe(D.Xh,null);eo=new d.fe(100,null);so=new BigInt64Array(100);no=new Int32Array(100);ro=null;ho=0;oo=!0;lo=new Int32Array(50);ao=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;Ao=0;mo=!0;po=null;_o=0;Io=0;Co=192;Eo=void 0;vo=!1;host=null;bo=null;To=new d.fe(16,null);Oo=0;Ro=!1;Lo=()=>{try{this.stream&&this.stream.close()}catch(t){}this.bo&&'998'===D.getParameter('world')&&this.bo.So?.send(JSON.stringify({type:'close',id:this.bo.xo})),this.stream=null,(0,v.Mo)(!1),this.Ut=null,this.Gt=null,this.in=null,this.Rr=null,this.Tr=null,this.Or=null,this.Hr=null,this.Vr=null,this.Wn=null,this.kr=null,this.Rh=null,this.Lh=null,this.Th=null,this.Oh=null,this.Mr=null,this.Di=null,this.Ni=null,this.Fi=null,this.Bi=null,this.Pi=null,this.Ui=null,this.Gi=null,this.Wi=null,this.Yi=null,this.Hi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.ne=null,this.he=null,this.re=null,this.oe=null,this.le=null,this.ae=null,this.ce=null,this.Te=null,this.Oe=null,this.Re=null,this.Le=null,this.Se=null,this.xe=null,this.Me=null,this.ke=null,this.De=null,this.Ne=null,this.de=null,this.Ae=null,this.me=null,this._e=null,this.Ie=null,this.ge=null,this.Ce=null,this.Ee=null,this.we=null,this.ye=null,this.Kr=null,this.hh=null,this.lh=null,this.uh=null,this.wh=null,this.dh=null,this.yh=null,this.mh=null,this.Ch=null,this.bh=null,this.gh=null,this.ph=null,this._h=null,this.Ih=null,this.Tn=null,this.On=null,this.vn=null,this.bn=null,this.ns=null,this.mn=null,this.Un=null,this.Gn=null,this.Pe=null,this.ue=null,this.eo=null,this.so=null,this.no=null,this.si=null,this.ni=null,this.ti=null,this.ii=null,this.ei=null,this.ri=null,this.hi=null,this.oi=null,this.li=null,this.ko(),b.A.Lo(),T.A.Lo(),A.A.Lo(),O.A.Do=null,g.A.Do=null,s.A.Do=null,_.A.Do=null,R.A.Do=null,R.A.No=null,L.A.Do=null,this.Fo=null,u.A.No=null,n.A.Lo(),a.A.Lo(),p.A.Lo(),S.A.Do=[],x.A.Do=[]};Bo(){return this.$t}Po(){return this.Gs}Uo(){return this.Ns}Go(){return this.hs}Wo(){return this.He}ko=()=>{this.pi=!1,this.ki&&(clearInterval(this.ki),this.ki=null),this.ai=null,this.ci=null,this.mi=[],this.bi=null,this.Ti=null,this.Oi=null,this.Ri=null,this.Ci=null,this.gi=null,this.Ei=null,this.vi=null,this._i=null,this.Ii=null};Yo=()=>{'999'===D.getParameter('world')?(this.Eo=new Worker('worker.js',{type:'module'}),this.Eo.onmessage=this.onmessage,this.host=new k.x(this.Eo)):'998'===D.getParameter('world')&&(this.Eo={onmessage:t=>{this.stream.Ho.onmessage(t)},postMessage:t=>{this.bo&&this.bo.So&&'open'===this.bo.So.readyState&&this.bo.So.send(JSON.stringify(t))},onerror:null,onmessageerror:null,terminate:()=>{throw new Error},addEventListener:()=>{throw new Error},removeEventListener:()=>{throw new Error},dispatchEvent:()=>{throw new Error}},this.bo=new k.Q(this.Eo))};onmessage=t=>{switch(t.data.type){case'ready':return void(this.vo=!0);case'save':return(0,M.A)(t.data.value,t.data.path.split('/').pop().split('\\').pop()),void URL.revokeObjectURL(t.data.value);case'close':return void this.Eo?.postMessage({type:'close',id:t.data.id})}this.host?.xo===t.data.id?this.stream.Ho.onmessage(t.data):this.host?.postMessage(t)};Vo=async()=>{if(999==+D.getParameter('world'))this.host&&await this.host.Ko();else if(998==+D.getParameter('world')&&this.bo){if(this.bo.So)return void console.log('You are already connected.');const t=prompt('Paste offer here, answer will be copied to clipboard');if(t)try{await this.bo.Xo(t)}catch(t){console.error(t)}}};jo=async(t,i,e,s)=>{let n=5,o=await(this.db?.zo(t));if(o&&h.A.Zo(o)!==e&&(o=void 0),o)return new r.A(o);for(;!o;){await this.qo(s,`Requesting ${i}`);try{o=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}${e}`):await(0,C.Jo)(`${D.nt}/${t}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.qo(s,`Error loading - Will retry in ${t} secs.`),await(0,C.$o)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Qo(t,o)),new r.A(o)};tl=async(t,i,e,s)=>{let n=await(this.db?.zo(t+'.mid'));if(n&&12345678!==i&&h.A.Zo(n)!==i&&(n=void 0),!n)try{n=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}_${i}.mid`):await(0,C.Jo)(`${D.nt}/songs/${t}.mid`),e!==n.length&&(n=n.slice(0,e))}catch(t){}if(!n)return;await(this.db?.Qo(t+'.mid',n));const r=new h.A(Uint8Array.from(n)).il,o=E.A.read(r,n,e,4);(0,v.el)(o,this.Co,s)};sl=()=>{if(w.nl.fillStyle='black',w.nl.fillRect(0,0,this.width,this.height),this.rl(1),this.Dt){this.pi=!1,w.nl.font='bold 16px helvetica, sans-serif',w.nl.textAlign='left',w.nl.fillStyle='yellow';let t=35;w.nl.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.nl.fillStyle='white',w.nl.fillText('To fix this try the following (in order):',30,t),t+=50,w.nl.font='bold 12px helvetica, sans-serif',w.nl.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.nl.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.nl.fillText('3: Try using a different game-world',30,t),t+=30,w.nl.fillText('4: Try rebooting your computer',30,t),t+=30,w.nl.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.pi=!1,w.nl.font='bold 20px helvetica, sans-serif',w.nl.textAlign='left',w.nl.fillStyle='white',w.nl.fillText('Error - unable to load game!',50,50),w.nl.fillText('To play RuneScape make sure you play from',50,100),w.nl.fillText('https://2004scape.org',50,150)),this.kt){this.pi=!1,w.nl.font='bold 13px helvetica, sans-serif',w.nl.textAlign='left',w.nl.fillStyle='yellow';let t=35;w.nl.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.nl.fillStyle='white',w.nl.fillText('To fix this try the following (in order):',30,t),t+=50,w.nl.font='bold 12px helvetica, sans-serif',w.nl.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.nl.fillText('2: Try rebooting your computer, and reloading',30,t)}};hl=t=>{if(!t.ol)return!1;for(let i=0;i=s)return!1}else if(3===t.ol[i]){if(e<=s)return!1}else if(4===t.ol[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};cl=(t,i,e,s,n)=>{this.ve?.draw(t,i),this.be?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,m.A.fl);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;y.A.fillRect(t,i+h+16,16,r,m.A.ul),y.A.dl(t,i+h+16,m.A.wl,r),y.A.dl(t+1,i+h+16,m.A.wl,r),y.A.yl(t,i+h+16,m.A.wl,16),y.A.yl(t,i+h+17,m.A.wl,16),y.A.dl(t+15,i+h+16,m.A.Al,r),y.A.dl(t+14,i+h+17,m.A.Al,r-1),y.A.yl(t,i+h+r+15,m.A.Al,16),y.A.yl(t+1,i+h+r+14,m.A.Al,15)};ml=(t,i)=>{let e=!1;const n=s.A.Do[t];if(!n.pl)return!1;for(let t=0;ts.delay[r.Cl];)r.gl-=s.delay[r.Cl]+1,r.Cl++,r.Cl>=s.El&&(r.Cl-=s.vl,(r.Cl<0||r.Cl>=s.El)&&(r.Cl=0)),e=!0}}}return e};bl=(t,i,e,r,h=!1)=>{if(0!==t.type||!t.pl||t.hide&&this.Zs!==t.id&&this.qs!==t.id&&this.Js!==t.id)return;const o=y.A.left,l=y.A.top,a=y.A.right,c=y.A.bottom;y.A.Tl(i,e,i+t.width,e+t.height);const f=t.pl.length;for(let o=0;o0&&this.Ml(c),c.type===s.A.kl)c.Dl>c.scroll-c.height&&(c.Dl=c.scroll-c.height),c.Dl<0&&(c.Dl=0),this.bl(c,l,a,c.Dl,h),c.scroll>c.height&&this.cl(l+c.width,a,c.Dl,c.scroll,c.height);else if(c.type===s.A.Nl){let t=0;for(let i=0;i0){let i=0,e=0;const r=c.Pl[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qs===t){const h=A.A.Yl(r,c.Ul[t]);if(0!==this.tn&&this.Qs===t&&this.$s===c.id?(i=this.Hl-this.en,e=this.Vl-this.sn,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.nn<5&&(i=0,e=0),h.Kl(128,s+i,n+e)):0!==this.un&&this.dn===t&&this.wn===c.id?h.Kl(128,s,n):h.draw(s,n),33===h.Xl||1!==c.Ul[t]){const r=c.Ul[t];this.di?.jl(s+i+1,n+10+e,this.zl(r),m.A.Zl),this.di?.jl(s+i,n+9+e,this.zl(r),m.A.ql)}}}else if(c.Jl&&t<20){const i=c.Jl[t];i?.draw(s,n)}t++}}else if(c.type===s.A.$l)c.fill?y.A.fillRect(l,a,c.width,c.height,c.Ql):y.A.Ll(l,a,c.width,c.height,c.Ql);else if(c.type===s.A.ta){const t=c.font;let i=c.Ql,e=c.text;if(this.Js!==c.id&&this.qs!==c.id&&this.Zs!==c.id||0===c.ia||(i=c.ia),this.hl(c)&&(i=c.ea,c.sa&&c.sa.length>0&&(e=c.sa)),c.na===s.A.ra&&this.An&&(e='Please wait...',i=c.Ql),!t||!e)continue;for(let s=a+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.ha(this.ll(c,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.ha(this.ll(c,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.ha(this.ll(c,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.ha(this.ll(c,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.ha(this.ll(c,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),c.oa?t.la(l+(c.width/2|0),s,r,i,c.aa):t.ca(l,s,r,i,c.aa)}}else if(c.type===s.A.fa){let t;t=this.hl(c)?c.ua:c.da,t?.draw(l,a)}else if(c.type===s.A.wa){const t=n.A.ya,i=n.A.Aa;n.A.ya=l+(c.width/2|0),n.A.Aa=a+(c.height/2|0);const e=n.A.sin[c.ma]*c.zoom>>16,s=n.A.cos[c.ma]*c.zoom>>16,r=this.hl(c);let h;h=r?c.Il:c._l;let o=null;if(-1===h)o=c.pa(-1,-1,r);else{const t=_.A.Do[h];t.frames&&t._a&&(o=c.pa(t.frames[c.Cl],t._a[c.Cl],r))}o&&o.Ia(0,c.ga,0,c.ma,0,e,s),n.A.ya=t,n.A.Aa=i}else if(c.type===s.A.Ca){const t=c.font;if(!t||!c.Pl||!c.Ul)continue;let i=0;for(let e=0;e0){const n=A.A.get(c.Pl[i]-1);let r=n.name;if((n.Ea||1!==c.Ul[i])&&(r=r+' x'+this.va(c.Ul[i])),!r)continue;const h=l+s*(c.Gl+115),o=a+e*(c.Wl+12);c.oa?t.la(h+(c.width/2|0),o,r,c.Ql,c.aa):t.ca(h,o,r,c.Ql,c.aa)}i++}}}y.A.Tl(o,l,a,c)};Ml=t=>{let i=t.xl;if(i>=s.A.ba&&i<=s.A.Ta)i--,i>=this.Vh?(t.text='',t.na=0):(t.text=this.eo[i],t.na=1);else if(i>=s.A.Oa&&i<=s.A.Ra)i-=s.A.Oa,i>=this.Vh?(t.text='',t.na=0):(0===this.no[i]?t.text='@red@Offline':this.no[i]===D.it?t.text='@gre@World-'+(this.no[i]-9):t.text='@yel@World-'+(this.no[i]-9),t.na=1);else if(i===s.A.La)t.scroll=15*this.Vh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=s.A.Sa&&i<=s.A.xa)i-=s.A.Sa,i>=this.fs?(t.text='',t.na=0):(t.text=I.A.Ma(I.A.ka(this.us[i])),t.na=1);else if(i===s.A.Da)t.scroll=15*this.fs+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===s.A.Na){if(t.ma=150,t.ga=256*Math.sin(this.Ft/40)&2047,this.Wh){this.Wh=!1;const i=new d.fe(7,null);let e=0;for(let t=0;t<7;t++){const s=this.Yh[t];s>=0&&(i[e++]=g.A.Do[s].pa())}const s=p.A.Fa(i,e);for(let t=0;t<5;t++)0!==this.Hh[t]&&(s.Ba(u.A.Pa[t][0],u.A.Pa[t][this.Hh[t]]),1===t&&s.Ba(u.A.Ua[0],u.A.Ua[this.Hh[t]]));if(this.xh){const i=_.A.Do[this.xh.Ga].frames;i&&(s.Wa(),s.Ya(i[0]),s.Ha(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===s.A.Va)this.Fe||(this.Fe=t.da,this.Be=t.ua),this.Gh?t.da=this.Be:t.da=this.Fe;else if(i===s.A.Ka)this.Fe||(this.Fe=t.da,this.Be=t.ua),this.Gh?t.da=this.Fe:t.da=this.Be;else if(i===s.A.Xa)t.text=this.xn,this.Ft%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===s.A.ja)this.Uh?this.Mn?(t.Ql=m.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Ql=m.A.Sl,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===s.A.za||i===s.A.Za)if(0===this.Dn)t.text='';else{let i;i=0===this.Nn?'earlier today':1===this.Nn?'yesterday':this.Nn+' days ago',t.text='You last logged in '+i+' from: '+I.A.qa(this.Dn)}else if(i===s.A.Ja)0===this.Bn&&(t.text='0 unread messages',t.Ql=m.A.ql),1===this.Bn&&(t.text='1 unread message',t.Ql=m.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Ql=m.A.GREEN);else if(i===s.A.$a)if(201===this.Fn)t.text='';else if(200===this.Fn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Fn?'Earlier today':1===this.Fn?'Yesterday':this.Fn+' days ago',t.text=i+' you changed your recovery questions'}else i===s.A.Qa?201===this.Fn?t.text='':200===this.Fn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===s.A.tc&&(201===this.Fn?t.text='':(this.Fn,t.text="Do this from the 'account management' area on our front webpage"))};ll=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let n=0,r=0;for(;;){const t=e[r++];if(0===t)return n;if(1===t)n+=this.Es[e[r++]];else if(2===t)n+=this.vs[e[r++]];else if(3===t)n+=this.Cs[e[r++]];else if(4===t){const t=s.A.Do[e[r++]],i=e[r++]+1;if(t.Pl&&t.Ul)for(let e=0;et<999999999?String(t):'*';va=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};zl=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,e)=>{e.d(i,{w:()=>h});var s=e(7046),n=e(1651),r=e(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');['0','998','999'].includes(s.A.getParameter('world'))?function(){if(+s.A.getParameter('world')>=998)return void(n.K.nt='data/pack/client');n.K.st='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0}():await async function(t){const i=await o(t,parseInt(s.A.getParameter('world'),10)),e=new URL(i.address);n.K.it=10+i.id-1,n.K.st=`${e.protocol}//${e.hostname}`,n.K.nt=`${e.protocol}//${e.hostname}:${e.port}`,t||(n.K.st=n.K.st.replace('https:','http:'));n.K.portOffset=i.portOffset,n.K.members=!0===i?.members,s.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===s.A.getParameter('detail').length&&s.A.setParameter('detail','high');'low'===s.A.getParameter('detail')?n.K.Lt():n.K.Rt()}(),0===s.A.getParameter('method').length&&s.A.setParameter('method','0')}async function o(t,i,e=0){if(e>=10)throw new Error('could not find world to connect!');const s=t?'https:':'http:';let n;try{n=JSON.parse(await(0,r.ec)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.$o)(1e3),o(t,i,++e)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hh:0});const h=n.find((t=>t.id===i));return h||o(t,i,10)}},7046:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(1183),n=e(4583),r=e(9234),h=e(9091),o=e(2595),l=e(7854);class a{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}sc=0;nc=[];rc=0;Fo=null;state=0;hc=20;oc=1;lc=[];ac=0;cc=0;fc=[];uc=!0;dc=!1;wc=50;hasFocus=!0;yc=!1;Ac=0;mc=0;Hl=0;Vl=0;_c=0;Ic=0;gc=0;Cc=[];Ec=[];vc=0;bc=0;input=null;Tc=!1;Oc=!1;Rc=!1;time=-1;Lc=0;Sc=0;xc=0;Mc=0;kc=0;Dc=0;constructor(t=!1){l.Nc.tabIndex=-1,l.nl.fillStyle='black',l.nl.fillRect(0,0,l.Nc.width,l.Nc.height),this.dc=t,this.dc?this.resize(window.innerWidth,window.innerHeight):this.resize(l.Nc.width,l.Nc.height)}get width(){return l.Nc.width}get height(){return l.Nc.height}resize=(t,i)=>{l.Nc.width=t,l.Nc.height=i,this.Fo=new s.A(t,i),n.A.Fc()};run=async()=>{l.Nc.addEventListener('resize',(()=>{this.dc&&this.resize(window.innerWidth,window.innerHeight)}),!1),l.Nc.onmousedown=this.onmousedown,l.Nc.onmouseup=this.onmouseup,l.Nc.onmouseenter=this.onmouseenter,l.Nc.onmouseleave=this.onmouseleave,l.Nc.onmousemove=this.onmousemove,window.onbeforeunload=this.Lo,l.Nc.onfocus=this.onfocus,l.Nc.onblur=this.onblur,this.Bc?(l.Nc.ontouchstart=this.ontouchstart,l.Nc.ontouchend=this.ontouchend,l.Nc.ontouchmove=this.ontouchmove):(l.Nc.onkeydown=this.onkeydown,l.Nc.onkeyup=this.onkeyup),l.Nc.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Bc&&'low'===a.getParameter('detail')&&(this.wc=30),await this.qo(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.lc[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.Pc();const h=e,o=s;e=300,s=1,t=performance.now();const l=this.lc[i];if(0===l?(e=h,s=o):t>l&&(e=2560*this.hc/(t-l)|0),e<25?e=25:e>256&&(e=256,s=this.hc-(t-l)/10|0),this.lc[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.lc[t]&&(this.lc[t]+=s);for(s0&&(this.ac=1e3*e/(256*this.hc)|0);const a=performance.now();if(this.uc&&this.refresh(),await this.draw(),this.fc[this.cc]=(performance.now()-a)/1e3,this.cc=(this.cc+1)%this.fc.length,this.wc<50){const i=1e3/this.wc-(performance.now()-t);i>0&&await(0,r.$o)(i)}}-1===this.state&&this.Pc()};Pc=()=>{this.state=-2,this.Lo()};rl=t=>{this.hc=1e3/t|0};Uc=t=>{this.wc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.hc|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};Lo=()=>{};draw=async()=>{};refresh=()=>{};async qo(t,i){const e=this.width,s=this.height;this.uc&&(l.nl.fillStyle='black',l.nl.fillRect(0,0,e,s),this.uc=!1);const n=s/2-18;l.nl.fillStyle='rgb(140, 17, 17)',l.nl.rect((e/2|0)-152,n,304,34),l.nl.fillRect((e/2|0)-150,n+2,3*t,30),l.nl.fillStyle='black',l.nl.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),l.nl.font='bold 13px helvetica, sans-serif',l.nl.textAlign='center',l.nl.fillStyle='white',l.nl.fillText(i,e/2|0,n+22),await(0,r.$o)(5)}Gc=()=>{let t=-1;return this.bc!==this.vc&&(t=this.Ec[this.vc],this.vc=this.vc+1&127),t};get ms(){const t=this.fc.length;let i=0;for(let e=0;ethis.sc&&(this.sc=e),this.nc[this.rc]=e,this.rc=(this.rc+1)%250,e}get Wc(){return this.nc.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.Ac=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Cc[n]=1),n>4&&(this.Ec[this.bc]=n,this.bc=this.bc+1&127),o.A.enabled&&o.A.Yc(n),h.g.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.Ac=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Cc[n]=0),o.A.enabled&&o.A.Hc(n),h.g.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.Tc=!1,(t.clientX>0||t.clientY>0)&&this.Vc(t),this.Ac=0,this.Ic=this.Hl,this.gc=this.Vl,this.Bc&&!this.Kc){if(this.Xc()||this.jc()||this.zc())return this._c=1,void(this.mc=1);t.timeStamp>=this.time+500?(this._c=2,this.mc=2):(this._c=1,this.mc=1)}else 2===t.button?(this._c=2,this.mc=2):(this._c=1,this.mc=1);o.A.enabled&&o.A.Zc(this.Ic,this.gc,t.buttons)};onmouseup=t=>{this.Vc(t),this.Ac=0,this.mc=0,o.A.enabled&&o.A.qc(t.buttons)};onmouseenter=t=>{this.Vc(t),o.A.enabled&&o.A.Jc()};onmouseleave=t=>{this.Vc(t),this.Ac=0,this.Hl=-1,this.Vl=-1,this.mc=0,this.Ic=-1,this.gc=-1,o.A.enabled&&o.A.$c()};onmousemove=t=>{this.Vc(t),this.Ac=0,o.A.enabled&&o.A.Qc(this.Hl,this.Vl)};onfocus=t=>{this.hasFocus=!0,this.uc=!0,this.refresh(),o.A.enabled&&o.A.tf()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.if()};ontouchstart=t=>{if(!this.Bc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.Tc=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Lc=this.kc=this.xc=0|i.screenX,this.Sc=this.Dc=this.Mc=0|i.screenY,this.time=t.timeStamp,this.Oc=this.ef(),this.Rc=this.sf()};ontouchend=t=>{if(!this.Bc||!this.Tc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.kc=0|i.screenX,this.Dc=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Oc&&!this.ef())return void(this.Tc=!1);if(this.Rc&&!this.sf())return void(this.Tc=!1);if(this.Xc()||this.nf()||this.jc()||this.zc()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.jc()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.zc()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Xc()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.nf()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.rf?t.setAttribute('type','password'):t.setAttribute('type',this.zc()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.rf&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.rf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.rf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.Tc=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.Lc-this.kc)>16||Math.abs(this.Sc-this.Dc)>16;n&&!r?(this.Tc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.mc=0,this.Tc=!1)};ontouchmove=t=>{if(!this.Bc||!this.Tc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.kc=0|i.screenX,this.Dc=0|i.screenY,this.Oc&&-1===this.Wo()?(this.xc-this.kc>0?this.rotate(2):this.xc-this.kc<0&&this.rotate(0),this.Mc-this.Dc>0?this.rotate(3):this.Mc-this.Dc<0&&this.rotate(1)):(this.Rc||-1!==this.Wo())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.xc=this.kc,this.Mc=this.Dc};get Bc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get rf(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Kc(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}ef=()=>this.yc&&this.Hl>=8&&this.Hl<=520&&this.Vl>=11&&this.Vl<=345;Xc=()=>this.yc&&-1===this.Go()&&!this.Po()&&!this.Uo()&&this.Hl>=11&&this.Hl<=506&&this.Vl>=449&&this.Vl<=482;nf=()=>this.yc&&(this.Po()||this.Uo())&&this.Hl>=11&&this.Hl<=506&&this.Vl>=383&&this.Vl<=482;sf=()=>this.yc&&this.Hl>=562&&this.Hl<=752&&this.Vl>=231&&this.Vl<=492;jc=()=>!this.yc&&2===this.Bo()&&this.Hl>=301&&this.Hl<=562&&this.Vl>=262&&this.Vl<=279;zc=()=>!this.yc&&2===this.Bo()&&this.Hl>=301&&this.Hl<=562&&this.Vl>=279&&this.Vl<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};hf=()=>null!==document.fullscreenElement;Vc=t=>{if(this.hf()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/l.Nc.height,s=(window.innerWidth-l.Nc.width*e)/2;this.Hl=0|this.lf(t.clientX-i.left-s,0,l.Nc.width*e,0,789),this.Vl=0|this.lf(t.clientY-i.top,0,l.Nc.height*e,0,532)}else{const i=l.Nc.getBoundingClientRect(),e=l.Nc.width/i.width,s=l.Nc.height/i.height;this.Hl=(t.clientX-i.left)*e|0,this.Vl=(t.clientY-i.top)*s|0}this.Hl<0&&(this.Hl=0),this.Vl<0&&(this.Vl=0),this.Hl>789&&(this.Hl=789),this.Vl>532&&(this.Vl=532)};lf=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}},2595:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static enabled=!1;static af=null;static cf=null;static ff=0;static uf=0;static df=0;static wf=0;static yf=0;static Af=()=>{this.af=s.A.Pt(1),this.cf=null,this.ff=performance.now(),this.enabled=!0};static mf=()=>{this.enabled=!1,this.af=null};static flush=()=>{let t=null;return this.cf&&this.enabled&&(t=this.cf),this.cf=null,t};static stop=()=>{let t=null;return this.af&&this.af.pf>0&&this.enabled&&(t=this.af),this.mf(),t};static Zc=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.uf++;const s=performance.now();let n=(s-this.ff)/10|0;n>250&&(n=250),this.ff=s,this._f(5),1===e?this.af?.p1(1):this.af?.p1(2),this.af?.p1(n),this.af?.p3(t+(i<<10))};static qc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,this._f(2),1===t?this.af?.p1(3):this.af?.p1(4),this.af?.p1(e)};static Qc=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.df>=50){this.df=e,this.uf++;let s=(e-this.ff)/10|0;s>250&&(s=250),this.ff=e,t-this.wf<8&&t-this.wf>=-8&&i-this.yf<8&&i-this.yf>=-8?(this._f(3),this.af?.p1(5),this.af?.p1(s),this.af?.p1(t+(i-this.yf+8<<4)+8-this.wf)):t-this.wf<128&&t-this.wf>=-128&&i-this.yf<128&&i-this.yf>=-128?(this._f(4),this.af?.p1(6),this.af?.p1(s),this.af?.p1(t+128-this.wf),this.af?.p1(i+128-this.yf)):(this._f(5),this.af?.p1(7),this.af?.p1(s),this.af?.p3(t+(i<<10))),this.wf=t,this.yf=i}};static Yc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this._f(3),this.af?.p1(8),this.af?.p1(e),this.af?.p1(t)};static Hc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this._f(3),this.af?.p1(9),this.af?.p1(e),this.af?.p1(t)};static tf=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this._f(2),this.af?.p1(10),this.af?.p1(i)};static if=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this._f(2),this.af?.p1(11),this.af?.p1(i)};static Jc=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this._f(2),this.af?.p1(12),this.af?.p1(i)};static $c=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this._f(2),this.af?.p1(13),this.af?.p1(i)};static _f=t=>{if(this.af&&this.af.pf+t>=500){const t=this.af;this.af=s.A.Pt(1),this.cf=t}}}},9091:(t,i,e)=>{e.d(i,{c:()=>n,g:()=>s});const s=['F11','F12'],n={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}}},1120:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1069),n=e(8665),r=e(2679),h=e(2511),o=e(3819),l=e(3867),a=e(8950);class c{static Do=[];static If=null;static No=null;static kl=0;static gf=1;static Nl=2;static $l=3;static ta=4;static fa=5;static wa=6;static Ca=7;static Cf=1;static Ef=2;static vf=3;static bf=4;static Tf=5;static ra=6;static ba=1;static Ta=100;static Oa=101;static Ra=200;static Of=201;static Rf=202;static La=203;static Lf=205;static Sf=300;static xf=301;static Mf=302;static kf=303;static Df=304;static Nf=305;static Ff=306;static Bf=307;static Pf=308;static Uf=309;static Gf=310;static Wf=311;static Yf=312;static Hf=313;static Vf=314;static Kf=315;static Xf=316;static jf=317;static zf=318;static Zf=319;static qf=320;static Jf=321;static $f=322;static Qf=323;static Va=324;static Ka=325;static tu=326;static Na=327;static Sa=401;static xa=500;static iu=501;static eu=502;static Da=503;static Xa=600;static su=601;static nu=602;static ru=603;static hu=604;static ou=605;static lu=606;static au=607;static cu=608;static fu=609;static uu=610;static du=611;static wu=612;static ja=613;static za=650;static Ja=651;static $a=652;static Qa=653;static tc=654;static Za=655;static yu=(t,i,e)=>{this.If=new r.A(5e4),this.No=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.pf+=2;n.pf0){s.ol=new Uint8Array(r),s.al=new Uint16Array(r);for(let t=0;t0){s.scripts=new l.fe(o,null);for(let t=0;t0){const n=e.lastIndexOf(',');s.Jl[t]=this.vu(i,e.substring(0,n),parseInt(e.substring(n+1),10))}}s.bu=new l.fe(5,null);for(let t=0;t<5;t++){const i=n.Eu;s.bu[t]=i,0===i.length&&(s.bu[t]=null)}}if(s.type===c.$l&&(s.fill=1===n.pu),s.type===c.ta||s.type===c.gf){s.oa=1===n.pu;const t=n.pu;e&&(s.font=e[t]),s.aa=1===n.pu}if(s.type===c.ta&&(s.text=n.Eu,s.sa=n.Eu),s.type!==c.gf&&s.type!==c.$l&&s.type!==c.ta||(s.Ql=n.il),s.type!==c.$l&&s.type!==c.ta||(s.ea=n.il,s.ia=n.il),s.type===c.fa){const t=n.Eu;if(t.length>0){const e=t.lastIndexOf(',');s.da=this.vu(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=n.Eu;if(e.length>0){const t=e.lastIndexOf(',');s.ua=this.vu(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(s.type===c.wa){const t=n.pu;0!==t&&(s.model=this.pa((t-1<<8)+n.pu));const i=n.pu;0!==i&&(s.Tu=this.pa((i-1<<8)+n.pu)),s._l=n.pu,0===s._l?s._l=-1:s._l=(s._l-1<<8)+n.pu,s.Il=n.pu,0===s.Il?s.Il=-1:s.Il=(s.Il-1<<8)+n.pu,s.zoom=n.Au,s.ma=n.Au,s.ga=n.Au}if(s.type===c.Ca){s.Pl=new Int32Array(s.width*s.height),s.Ul=new Int32Array(s.width*s.height),s.oa=1===n.pu;const t=n.pu;e&&(s.font=e[t]),s.aa=1===n.pu,s.Ql=n.il,s.Gl=n.Iu,s.Wl=n.Iu,s.gu=1===n.pu,s.bu=new l.fe(5,null);for(let t=0;t<5;t++){const i=n.Eu;s.bu[t]=i,0===i.length&&(s.bu[t]=null)}}s.na!==c.Ef&&s.type!==c.Nl||(s.Ou=n.Eu,s.action=n.Eu,s.Ru=n.Au),s.na!==c.Cf&&s.na!==c.bf&&s.na!==c.Tf&&s.na!==c.ra||(s.Lu=n.Eu,0===s.Lu.length&&(s.na===c.Cf?s.Lu='Ok':s.na===c.bf||s.na===c.Tf?s.Lu='Select':s.na===c.ra&&(s.Lu='Continue')))}this.If=null,this.No=null};static vu=(t,i,e)=>{const s=o.A.Su(i)<<8n|BigInt(e);if(this.If){const t=this.If.get(s);if(t)return t}let n;try{n=h.A.xu(t,i,e),this.If?.put(s,n)}catch(t){return null}return n};static pa=t=>{if(this.No){const i=this.No.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.No?.put(BigInt(t),i),i};id=-1;mu=-1;type=-1;na=-1;xl=0;width=0;height=0;_u=-1;ol=null;al=null;scripts=null;scroll=0;hide=!1;draggable=!1;gu=!1;Cu=!1;Gl=0;Wl=0;Fl=null;Bl=null;Jl=null;bu=null;fill=!1;oa=!1;font=null;aa=!1;text=null;sa=null;Ql=0;ea=0;ia=0;da=null;ua=null;model=null;Tu=null;_l=-1;Il=-1;zoom=0;ma=0;ga=0;Ou=null;action=null;Ru=-1;Lu=null;pl=null;Ol=null;Rl=null;x=0;y=0;Dl=0;Pl=null;Ul=null;Cl=0;gl=0;pa(t,i,e){let s=this.model;if(e&&(s=this.Tu),!s)return null;if(-1===t&&-1===i&&!s.Mu)return s;const r=n.A.ku(s,!0,!0,!1);return-1===t&&-1===i||r.Wa(),-1!==t&&r.Ya(t),-1!==i&&r.Ya(i),r.Ha(64,768,-50,-10,-50,!0),r}Du(){if(this.mu===this.id)return this.x;let t=c.Do[this.mu];if(!t.pl||!t.Ol||!t.Rl)return this.x;let i=t.pl.indexOf(this.id);if(-1===i)return this.x;let e=t.Ol[i];for(;t.mu!==t.id;){const s=c.Do[t.mu];s.pl&&s.Ol&&s.Rl&&(i=s.pl.indexOf(t.id),-1!==i&&(e+=s.Ol[i])),t=s}return e}Nu(){if(this.mu===this.id)return this.y;let t=c.Do[this.mu];if(!t.pl||!t.Ol||!t.Rl)return this.y;let i=t.pl.indexOf(this.id);if(-1===i)return this.y;let e=t.Rl[i];for(;t.mu!==t.id;){const s=c.Do[t.mu];s.pl&&s.Ol&&s.Rl&&(i=s.pl.indexOf(t.id),-1!==i&&(e+=s.Rl[i])),t=s}return e}outline(t){const i=this.Du(),e=this.Nu();a.A.Ll(i,e,this.width,this.height,t)}move(t,i){if(this.mu===this.id)return;this.x=0,this.y=0;const e=c.Do[this.mu];if(e.pl&&e.Ol&&e.Rl){const s=e.pl.indexOf(this.id);-1!==s&&(e.Ol[s]=t,e.Rl[s]=i)}}delete(){if(this.mu===this.id)return;const t=c.Do[this.mu];if(t.pl&&t.Ol&&t.Rl){const i=t.pl.indexOf(this.id);-1!==i&&(t.pl.splice(i,1),t.Ol.splice(i,1),t.Rl.splice(i,1))}}}},6333:(t,i,e)=>{e.d(i,{$:()=>s});class s{id;Fu=null;constructor(t){this.id=t}Bu(t){for(;;){const i=t.pu;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(6333);class r extends n.${static count=0;static Do=[];static yu=t=>{const i=new s.A(t.read('flo.dat'));this.count=i.Au;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static Uu=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static Gu=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);Wu=0;texture=-1;Yu=!1;Hu=!0;Vu=0;Ku=0;Xu=0;ju=0;zu=0;Zu=0;decode(t,i){1===t?(this.Wu=i.qu,this.setColor(this.Wu)):2===t?this.texture=i.pu:3===t?this.Yu=!0:5===t?this.Hu=!1:6===t?this.Fu=i.Eu:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(h=e),s>h&&(h=s);let o=0,l=0;const a=(n+h)/2;n!==h&&(a<.5&&(l=(h-n)/(h+n)),a>=.5&&(l=(h-n)/(2-h-n)),i===h?o=(e-s)/(h-n):e===h?o=(s-i)/(h-n)+2:s===h&&(o=(i-e)/(h-n)+4)),o/=6,this.Vu=256*o|0,this.Ku=256*l|0,this.Xu=256*a|0,this.Ku<0?this.Ku=0:this.Ku>255&&(this.Ku=255),this.Xu<0?this.Xu=0:this.Xu>255&&(this.Xu=255),this.ju=a>.5?(1-a)*l*512|0:a*l*512|0,this.ju<1&&(this.ju=1),this.zu=o*this.ju|0;let c=this.Vu+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.Ku+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.Xu+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.Zu=r.Pu(c,f,u)}}},8317:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(1069),n=e(6333),r=e(8665),h=e(3867);class o extends n.${static count=0;static Do=[];static yu=t=>{const i=new s.A(t.read('idk.dat'));this.count=i.Au;for(let t=0;t=40&&t<50?this.Qu[t-40]=i.Au:t>=50&&t<60?this.td[t-50]=i.Au:t>=60&&t<70?this.$u[t-60]=i.Au:console.log('Error unrecognised config code: ',t)}pa(){if(!this.Ju)return null;const t=new h.fe(this.Ju.length,null);for(let i=0;i{e.d(i,{A:()=>c});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(1023),l=e(6169),a=e(3867);class c extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static hd=new r.A(500);static od=new r.A(30);static yu=t=>{this.sd=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.Au,this.nd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%10;const i=this.cache[this.rd];return this.sd.pf=this.nd[t],i.id=t,i.reset(),i.Bu(this.sd),i.ld||(i.ld=new Int32Array(1)),-1===i.ad&&i.ld&&(i.active=i.ld.length>0&&i.ld[0]===o.A.fd.id,i.ud&&(i.active=!0)),i};static Lo=()=>{this.hd=null,this.od=null,this.nd=null,this.cache=null,this.sd=null};Ju=null;ld=null;name=null;dd=null;Qu=null;td=null;width=1;length=1;wd=!0;yd=!0;active=!1;ad=-1;Ad=!1;md=!1;Hu=!1;_l=-1;pd=!1;_d=16;Id=0;gd=0;ud=null;Cd=-1;Ed=-1;vd=!1;bd=!0;Td=128;Od=128;Rd=128;Ld=0;Sd=0;xd=0;Md=0;kd=!1;decode(t,i){if(1===t){const t=i.pu;this.Ju=new Int32Array(t),this.ld=new Int32Array(t);for(let e=0;e=30&&t<39)this.ud||(this.ud=new a.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(40===t){const t=i.pu;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e=this.Ju.length)return null;let d=this.Ju[a];if(-1===d)return null;const w=this.vd!==i>3;w&&(d+=65536);let y=c.hd?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.Wd(),c.hd?.put(BigInt(d),y));const A=128!==this.Td||128!==this.Od||128!==this.Rd,m=0!==this.Sd||0!==this.xd||0!==this.Md;let p=h.A.ku(y,!this.Qu,!this.pd,i===l.A.Yd&&-1===o&&!A&&!m);for(-1!==o&&(p.Wa(),p.Ya(o),p.Hd=null,p.Vd=null);i-- >0;)p.Kd();if(this.Qu&&this.td)for(let t=0;t{e.d(i,{A:()=>l});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(3867);class l extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static No=new r.A(30);static yu=t=>{this.sd=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.Au,this.nd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%20;const i=this.cache[this.rd]=new l(t);return this.sd.pf=this.nd[t],i.Bu(this.sd),i};static Lo=()=>{this.No=null,this.nd=null,this.cache=null,this.sd=null};name=null;dd=null;size=1;Ju=null;$u=null;pd=!1;zd=-1;Zd=-1;qd=-1;Jd=-1;$d=-1;Qu=null;td=null;ud=null;Td=-1;Od=-1;Rd=-1;Qd=!0;tw=-1;iw=128;ew=128;decode(t,i){if(1===t){const t=i.pu;this.Ju=new Uint16Array(t);for(let e=0;e=30&&t<40)this.ud||(this.ud=new o.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(40===t){const t=i.pu;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e{e.d(i,{A:()=>u});var s=e(6333),n=e(1069),r=e(2511),h=e(2679),o=e(8665),l=e(4583),a=e(8950),c=e(9298),f=e(3867);class u extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static lw=!0;static No=new h.A(50);static aw=new h.A(200);static yu=(t,i)=>{this.lw=i,this.sd=new n.A(t.read('obj.dat'));const e=new n.A(t.read('obj.idx'));this.count=e.Au,this.nd=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%10;const i=this.cache[this.rd];return this.sd.pf=this.nd[t],i.id=t,i.reset(),i.Bu(this.sd),-1!==i.cw&&i.fw(),!this.lw&&i.members&&(i.name='Members Object',i.dd="Login to a members' server to use this object.",i.ud=null,i.uw=null),i};static Lo=()=>{this.No=null,this.aw=null,this.nd=null,this.cache=null,this.sd=null};static Yl=(t,i)=>{if(u.aw){let e=u.aw.get(BigInt(t));if(e&&e.dw!==i&&-1!==e.dw&&(e.ww(),e=null),e)return e}let e=u.get(t);if(e.yw||(i=-1),e.yw&&e.Aw&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.Aw[s]&&0!==e.Aw[s]&&(t=e.yw[s]);-1!==t&&(e=u.get(t))}const s=new r.A(32,32),n=l.A.ya,h=l.A.Aa,o=l.A.mw,f=a.A.pw,d=a.A._w,w=a.A.Iw,y=a.A.left,A=a.A.right,m=a.A.top,p=a.A.bottom;l.A.gw=!1,a.A.bind(s.pw,32,32),a.A.fillRect(0,0,32,32,c.A.Zl),l.A.Fc();const _=e.Cw(1),I=l.A.sin[e.Ew]*e.bw>>16,g=l.A.cos[e.Ew]*e.bw>>16;_.Ia(0,e.Tw,e.Ow,e.Ew,e.Rw,I+(_.jd/2|0)+e.Lw,g+e.Lw);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.pw[t+32*i]&&(t>0&&s.pw[t+32*i-1]>1||i>0&&s.pw[t+32*(i-1)]>1||t<31&&s.pw[t+32*i+1]>1||i<31&&s.pw[t+32*(i+1)]>1)&&(s.pw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.pw[t+32*i]&&t>0&&i>0&&s.pw[t+32*(i-1)-1]>0&&(s.pw[t+32*i]=3153952);if(-1!==e.cw){const t=this.Yl(e.Sw,10),i=t.Xl,s=t.dw;t.Xl=32,t.dw=32,t.xw(5,5,22,22),t.Xl=i,t.dw=s}return u.aw?.put(BigInt(t),s),a.A.bind(f,d,w),a.A.Tl(y,m,A,p),l.A.ya=n,l.A.Aa=h,l.A.mw=o,l.A.gw=!0,e.Ea?s.Xl=33:s.Xl=32,s.dw=i,s};model=0;name=null;dd=null;Qu=null;td=null;bw=2e3;Ew=0;Tw=0;Ow=0;Rw=0;Lw=0;Mw=!1;kw=-1;Ea=!1;Dw=1;members=!1;ud=null;uw=null;Nw=-1;Fw=-1;Bw=0;Pw=-1;Uw=-1;Gw=0;Ww=-1;Yw=-1;Hw=-1;Vw=-1;Kw=-1;Xw=-1;yw=null;Aw=null;Sw=-1;cw=-1;decode(t,i){if(1===t)this.model=i.Au;else if(2===t)this.name=i.Eu;else if(3===t)this.dd=i.Eu;else if(4===t)this.bw=i.Au;else if(5===t)this.Ew=i.Au;else if(6===t)this.Tw=i.Au;else if(7===t)this.Rw=i.Iu,this.Rw>32767&&(this.Rw-=65536);else if(8===t)this.Lw=i.Iu,this.Lw>32767&&(this.Lw-=65536);else if(9===t)this.Mw=!0;else if(10===t)this.kw=i.Au;else if(11===t)this.Ea=!0;else if(12===t)this.Dw=i.il;else if(16===t)this.members=!0;else if(23===t)this.Nw=i.Au,this.Bw=i.Dd;else if(24===t)this.Fw=i.Au;else if(25===t)this.Pw=i.Au,this.Gw=i.Dd;else if(26===t)this.Uw=i.Au;else if(t>=30&&t<35)this.ud||(this.ud=new f.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(t>=35&&t<40)this.uw||(this.uw=new f.fe(5,null)),this.uw[t-35]=i.Eu;else if(40===t){const t=i.pu;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.yw&&this.Aw||(this.yw=new Uint16Array(10),this.Aw=new Uint16Array(10)),this.yw[t-100]=i.Au,this.Aw[t-100]=i.Au)}jw(t){let i=this.Nw;if(1===t&&(i=this.Pw),-1===i)return null;let e=this.Fw,s=this.Ww;1===t&&(e=this.Uw,s=this.Yw);let n=o.A.model(i);if(-1!==e){const t=o.A.model(e);if(-1===s){const i=[n,t];n=o.A.Fa(i,2)}else{const i=[n,t,o.A.model(s)];n=o.A.Fa(i,3)}}if(0===t&&0!==this.Bw&&n.translate(this.Bw,0,0),1===t&&0!==this.Gw&&n.translate(this.Gw,0,0),this.Qu&&this.td)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.Aw[e]&&0!==this.Aw[e]&&(i=this.yw[e]);if(-1!==i)return u.get(i).Cw(1)}if(u.No){const t=u.No.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.Qu&&this.td)for(let t=0;t{e.d(i,{A:()=>h});var s=e(6333),n=e(1069),r=e(6730);class h extends s.${static count=0;static Do=[];static yu=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.Au;for(let t=0;t{e.d(i,{A:()=>l});var s=e(6333),n=e(1069),r=e(1312),h=e(8665),o=e(2679);class l extends s.${static count=0;static Do=[];static No=new o.A(30);static yu=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.Au;for(let t=0;t=40&&t<50?this.Qu[t-40]=i.Au:t>=50&&t<60?this.td[t-50]=i.Au:console.log('Error unrecognised spotanim config code: ',t)}pa(){let t=l.No?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let i=0;i<6;i++)0!==this.Qu[0]&&t.Ba(this.Qu[i],this.td[i]);return l.No?.put(BigInt(this.id),t),t}}},3764:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(6333),n=e(1069);class r extends s.${static count=0;static Do=[];static ty=[];static iy=0;static yu=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.Au;for(let t=0;t{e.d(i,{A:()=>s});class s{static OPEN=0;static ly=1;static uy=2;static wy=4;static yy=8;static Ay=s.ly<<4;static my=s.uy<<4;static py=s.wy<<4;static _y=s.yy<<4;static Iy=256;static gy=512;static Cy=1024;static Ey=2048;static vy=4096;static by=s.gy<<4;static Ty=s.Cy<<4;static Oy=s.Ey<<4;static Ry=s.vy<<4;static Ly=s.Iy<<9;static Sy=524288;static xy=2097152;static My=s.xy|s.Sy;static ky=s.Iy|s.My;static Dy=s.uy|s.ky;static Ny=s.yy|s.ky;static Fy=s.uy|s.wy|s.Ny;static By=s.my|s.ky;static Py=s.yy|s.Ay|s.By;static Uy=s._y|s.ky;static Gy=s.ly|s.uy|s.Uy;static Wy=s.my|s.py|s.Uy;static Yy=16777215}},670:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(9456),n=e(6169),r=e(1023),h=e(4909);class o{static Dr=4;static jr=104;static index=(t,i)=>t*o.jr+i;offsetX;Hy;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Hy=0,this.sizeX=o.jr,this.sizeZ=o.jr,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.Hy)]|=s.A.xy};Ky=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.Hy)]&=~s.A.xy};Xy=(t,i,e,r,h,o)=>{let l=s.A.Iy;o&&(l|=s.A.Ly);const a=t-this.offsetX,c=i-this.Hy;if(h===n.A.jy||h===n.A.zy){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{let l=s.A.Iy;o&&(l|=s.A.Ly);const a=t-this.offsetX,c=i-this.Hy;if(h===n.A.jy||h===n.A.zy){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{const l=t-this.offsetX,a=i-this.Hy,c=o?s.A.Ry:s.A._y,f=o?s.A.vy:s.A.yy,u=o?s.A.Cy:s.A.uy,d=o?s.A.Ty:s.A.my,w=o?s.A.gy:s.A.ly,y=o?s.A.by:s.A.Ay,A=o?s.A.Ey:s.A.wy,m=o?s.A.Oy:s.A.py;e===r.A.Jy.id?h===n.A.Yd?(this.add(l,a,c),this.add(l-1,a,f)):h===n.A.jy?(this.add(l,a,u),this.add(l,a+1,d)):h===n.A.$y?(this.add(l,a,f),this.add(l+1,a,c)):h===n.A.zy&&(this.add(l,a,d),this.add(l,a-1,u)):e===r.A.Qy.id||e===r.A.tA.id?h===n.A.Yd?(this.add(l,a,w),this.add(l-1,a+1,y)):h===n.A.jy?(this.add(l,a,A),this.add(l+1,a+1,m)):h===n.A.$y?(this.add(l,a,y),this.add(l+1,a-1,w)):h===n.A.zy&&(this.add(l,a,m),this.add(l-1,a-1,A)):e===r.A.iA.id&&(h===n.A.Yd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):h===n.A.jy?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):h===n.A.$y?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):h===n.A.zy&&(this.add(l,a,d|c),this.add(l,a-1,u),this.add(l-1,a,f))),o&&this.qy(t,i,e,h,!1)};eA=(t,i,e,h,o)=>{const l=t-this.offsetX,a=i-this.Hy,c=o?s.A.Ry:s.A._y,f=o?s.A.vy:s.A.yy,u=o?s.A.Cy:s.A.uy,d=o?s.A.Ty:s.A.my,w=o?s.A.gy:s.A.ly,y=o?s.A.by:s.A.Ay,A=o?s.A.Ey:s.A.wy,m=o?s.A.Oy:s.A.py;e===r.A.Jy.id?h===n.A.Yd?(this.remove(l,a,c),this.remove(l-1,a,f)):h===n.A.jy?(this.remove(l,a,u),this.remove(l,a+1,d)):h===n.A.$y?(this.remove(l,a,f),this.remove(l+1,a,c)):h===n.A.zy&&(this.remove(l,a,d),this.remove(l,a-1,u)):e===r.A.Qy.id||e===r.A.tA.id?h===n.A.Yd?(this.remove(l,a,w),this.remove(l-1,a+1,y)):h===n.A.jy?(this.remove(l,a,A),this.remove(l+1,a+1,m)):h===n.A.$y?(this.remove(l,a,y),this.remove(l+1,a-1,w)):h===n.A.zy&&(this.remove(l,a,m),this.remove(l-1,a-1,A)):e===r.A.iA.id&&(h===n.A.Yd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):h===n.A.jy?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):h===n.A.$y?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):h===n.A.zy&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.eA(t,i,e,h,!1)};sA=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Hy,u=e-this.offsetX,d=h-this.Hy,w=o.index(c,f);if(l===r.A.Jy.id){if(a===n.A.Yd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(a===n.A.jy){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0}else if(a===n.A.$y){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(a===n.A.zy){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0}}else if(l===r.A.iA.id){if(a===n.A.Yd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(a===n.A.jy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(a===n.A.$y){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(a===n.A.zy){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===r.A.nA.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.my)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A._y)===s.A.OPEN)return!0}return!1};rA=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Hy,u=e-this.offsetX,d=h-this.Hy,w=o.index(c,f);if(l===r.A.hA.id||l===r.A.oA.id){if(l===r.A.oA.id&&(a=a+2&3),a===n.A.Yd){if(c===u+1&&f===d&&(this.flags[w]&s.A._y)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0}else if(a===n.A.jy){if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0}else if(a===n.A.$y){if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.my)===s.A.OPEN)return!0}else if(a===n.A.zy){if(c===u+1&&f===d&&(this.flags[w]&s.A._y)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.my)===s.A.OPEN)return!0}}else if(l===r.A.lA.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.my)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A._y)===s.A.OPEN)return!0}return!1};aA=(t,i,e,n,r,l,a)=>{const c=e+r-1,f=n+l-1,u=o.index(t-this.offsetX,i-this.Hy);return t>=e&&t<=c&&i>=n&&i<=f||(t===e-1&&i>=n&&i<=f&&(this.flags[u]&s.A.yy)===s.A.OPEN&&(a&h.A.Yd)===s.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&s.A._y)===s.A.OPEN&&(a&h.A.$y)===s.A.OPEN||(i===n-1&&t>=e&&t<=c&&(this.flags[u]&s.A.uy)===s.A.OPEN&&(a&h.A.zy)===s.A.OPEN||i===f+1&&t>=e&&t<=c&&(this.flags[u]&s.A.my)===s.A.OPEN&&(a&h.A.jy)===s.A.OPEN)))};add=(t,i,e)=>{this.flags[o.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[o.index(t,i)]&=s.A.Yy-e}}},4909:(t,i,e)=>{e.d(i,{A:()=>s});class s{static jy=1;static $y=2;static zy=4;static Yd=8}},6169:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Yd=0;static jy=1;static $y=2;static zy=3}},5599:(t,i,e)=>{e.d(i,{A:()=>s});class s{static cA=0;static fA=1;static uA=2;static dA=3}},1023:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5599);class n{static Jy=new n(0,s.A.cA);static Qy=new n(1,s.A.cA);static iA=new n(2,s.A.cA);static tA=new n(3,s.A.cA);static wA=new n(4,s.A.fA);static yA=new n(5,s.A.fA);static hA=new n(6,s.A.fA);static oA=new n(7,s.A.fA);static lA=new n(8,s.A.fA);static nA=new n(9,s.A.uA);static fd=new n(10,s.A.uA);static AA=new n(11,s.A.uA);static mA=new n(12,s.A.uA);static pA=new n(13,s.A.uA);static _A=new n(14,s.A.uA);static IA=new n(15,s.A.uA);static gA=new n(16,s.A.uA);static CA=new n(17,s.A.uA);static EA=new n(18,s.A.uA);static vA=new n(19,s.A.uA);static bA=new n(20,s.A.uA);static TA=new n(21,s.A.uA);static dA=new n(22,s.A.dA);static values(){return[this.Jy,this.Qy,this.CA,this.IA,this.iA,this._A,this.nA,this.tA,this.dA,this.mA,this.AA,this.hA,this.bA,this.fd,this.yA,this.pA,this.oA,this.wA,this.gA,this.lA,this.vA,this.TA,this.EA]}static of(t){const i=this.values();for(let e=0;e{e.d(i,{A:()=>A});var s=e(670),n=e(2164),r=e(1069),h=e(4583),o=e(3045),l=e(5637),a=e(4197),c=e(1312),f=e(1023),u=e(6169),d=e(9298),w=e(5518),y=e(3867);class A{static OA=Int8Array.of(1,2,4,8);static RA=Uint8Array.of(16,32,64,128);static LA=Int8Array.of(1,0,-1,0);static SA=Int8Array.of(0,-1,0,1);static xA=(17*Math.random()|0)-8;static MA=(33*Math.random()|0)-16;static et=!0;static kA=0;static DA=!1;static NA=(t,i)=>{let e=this.FA(t+45365,i+91923,4)+(this.FA(t+10294,i+37821,2)-128>>1)+(this.FA(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static FA=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.BA(s,r),l=this.BA(s+1,r),a=this.BA(s,r+1),c=this.BA(s+1,r+1),f=this.PA(o,l,n,e),u=this.PA(a,c,n,e);return this.PA(f,u,h,e)};static PA=(t,i,e,s)=>{const n=65536-h.A.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static BA=(t,i)=>((this.UA(t-1,i-1)+this.UA(t+1,i-1)+this.UA(t-1,i+1)+this.UA(t+1,i+1))/16|0)+((this.UA(t-1,i)+this.UA(t+1,i)+this.UA(t,i-1)+this.UA(t,i+1))/8|0)+(this.UA(t,i)/4|0);static UA=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static Xy=(t,i,e,s,n,r,h,o,d,w,y)=>{const m=n[y][i][e],p=n[y][i+1][e],_=n[y][i+1][e+1],I=n[y][i][e+1],g=m+p+_+I>>2,C=l.A.get(o);let E=i+(e<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A.dA.id)s?.GA(C.pa(f.A.dA.id,w,m,p,_,I,-1),t,i,e,g,E,v),C.wd&&C.active&&h?.Vy(i,e),-1!==C._l&&r.WA(new a.A(o,t,3,i,e,c.A.Do[C._l],!0));else if(d===f.A.fd.id||d===f.A.AA.id){const n=C.pa(f.A.fd.id,w,m,p,_,I,-1);if(n){let r,h,o=0;d===f.A.AA.id&&(o+=256),w===u.A.jy||w===u.A.zy?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.Xy(t,i,e,g,n,null,E,v,r,h,o)}C.wd&&h?.Xy(i,e,C.width,C.length,w,C.yd),-1!==C._l&&r.WA(new a.A(o,t,2,i,e,c.A.Do[C._l],!0))}else if(d>=f.A.mA.id)s?.Xy(t,i,e,g,C.pa(d,w,m,p,_,I,-1),null,E,v,1,1,0),C.wd&&h?.Xy(i,e,C.width,C.length,w,C.yd),-1!==C._l&&r.WA(new a.A(o,t,2,i,e,c.A.Do[C._l],!0));else if(d===f.A.Jy.id)s?.qy(t,i,e,g,A.OA[w],0,C.pa(f.A.Jy.id,w,m,p,_,I,-1),null,E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C._l&&r.WA(new a.A(o,t,0,i,e,c.A.Do[C._l],!0));else if(d===f.A.Qy.id)s?.qy(t,i,e,g,A.RA[w],0,C.pa(f.A.Qy.id,w,m,p,_,I,-1),null,E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C._l&&r.WA(new a.A(o,t,0,i,e,c.A.Do[C._l],!0));else if(d===f.A.iA.id){const n=w+1&3;s?.qy(t,i,e,g,A.OA[w],A.OA[n],C.pa(f.A.iA.id,w+4,m,p,_,I,-1),C.pa(f.A.iA.id,n,m,p,_,I,-1),E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C._l&&r.WA(new a.A(o,t,0,i,e,c.A.Do[C._l],!0))}else if(d===f.A.tA.id)s?.qy(t,i,e,g,A.RA[w],0,C.pa(f.A.tA.id,w,m,p,_,I,-1),null,E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C._l&&r.WA(new a.A(o,t,0,i,e,c.A.Do[C._l],!0));else if(d===f.A.nA.id)s?.Xy(t,i,e,g,C.pa(d,w,m,p,_,I,-1),null,E,v,1,1,0),C.wd&&h?.Xy(i,e,C.width,C.length,w,C.yd),-1!==C._l&&r.WA(new a.A(o,t,2,i,e,c.A.Do[C._l],!0));else if(d===f.A.wA.id)s?.YA(t,i,e,g,0,0,E,C.pa(f.A.wA.id,u.A.Yd,m,p,_,I,-1),v,512*w,A.OA[w]),-1!==C._l&&r.WA(new a.A(o,t,1,i,e,c.A.Do[C._l],!0));else if(d===f.A.yA.id){let n=16;if(s){const r=s.HA(t,i,e);r>0&&(n=l.A.get(r>>14&32767)._d)}s?.YA(t,i,e,g,A.LA[w]*n,A.SA[w]*n,E,C.pa(f.A.wA.id,u.A.Yd,m,p,_,I,-1),v,512*w,A.OA[w]),-1!==C._l&&r.WA(new a.A(o,t,1,i,e,c.A.Do[C._l],!0))}else d===f.A.hA.id?(s?.YA(t,i,e,g,0,0,E,C.pa(f.A.wA.id,u.A.Yd,m,p,_,I,-1),v,w,256),-1!==C._l&&r.WA(new a.A(o,t,1,i,e,c.A.Do[C._l],!0))):d===f.A.oA.id?(s?.YA(t,i,e,g,0,0,E,C.pa(f.A.wA.id,u.A.Yd,m,p,_,I,-1),v,w,512),-1!==C._l&&r.WA(new a.A(o,t,1,i,e,c.A.Do[C._l],!0))):d===f.A.lA.id&&(s?.YA(t,i,e,g,0,0,E,C.pa(f.A.wA.id,u.A.Yd,m,p,_,I,-1),v,w,768),-1!==C._l&&r.WA(new a.A(o,t,1,i,e,c.A.Do[C._l],!0)))};VA;KA;Hr;Vr;XA;jA;zA;ZA;qA;JA;$A;QA;tm;im;sm;nm;constructor(t,i,e,n){this.VA=t,this.KA=i,this.Hr=e,this.Vr=n,this.XA=new y.rm(s.A.Dr,t,i),this.jA=new y.rm(s.A.Dr,t,i),this.zA=new y.rm(s.A.Dr,t,i),this.ZA=new y.rm(s.A.Dr,t,i),this.nm=new y.hm(s.A.Dr,t+1,i+1),this.qA=new y.rm(s.A.Dr,t+1,i+1),this.JA=new y.Xr(t+1,i+1),this.$A=new Int32Array(i),this.QA=new Int32Array(i),this.tm=new Int32Array(i),this.im=new Int32Array(i),this.sm=new Int32Array(i)}om=(t,i)=>{for(let t=0;t=0&&i[s]?.Vy(e,n)}A.xA+=(5*Math.random()|0)-2,A.xA<-8?A.xA=-8:A.xA>8&&(A.xA=8),A.MA+=(5*Math.random()|0)-2,A.MA<-16?A.MA=-16:A.MA>16&&(A.MA=16);for(let i=0;i>8;for(let t=1;t>2)+(e[n+1][t]>>3)+(e[n][t-1]>>2)+(e[n][t+1]>>3)+(e[n][t]>>1);this.JA[n][t]=u-d}for(let t=0;t=0&&s0){const i=n.A.Do[e-1];this.$A[t]+=i.zu,this.QA[t]+=i.Ku,this.tm[t]+=i.Xu,this.im[t]+=i.ju,r=this.sm[t]++}}const h=e-5;if(h>=0&&h0){const i=n.A.Do[e-1];this.$A[t]-=i.zu,this.QA[t]-=i.Ku,this.tm[t]-=i.Xu,this.im[t]-=i.ju,r=this.sm[t]--}}}if(e>=1&&e=0&&f=0&&y=1&&c0||y>0){const m=this.Hr[i][e][c],p=this.Hr[i][e+1][c],_=this.Hr[i][e+1][c+1],I=this.Hr[i][e][c+1],g=this.JA[e][c],C=this.JA[e+1][c],E=this.JA[e+1][c+1],v=this.JA[e][c+1];let b=-1,T=-1;if(f>0){const t=256*s/l|0,i=r/a|0;let e=o/a|0;b=n.A.Pu(t,i,e);const h=t+A.xA&255;e+=A.MA,e<0?e=0:e>255&&(e=255),T=n.A.Pu(h,i,e)}if(i>0){let t=0!==f||this.zA[i][e][c]===w.A.am;y>0&&!n.A.Do[y-1].Hu&&(t=!1),t&&m===p&&m===_&&m===I&&(this.nm[i][e][c]|=2340)}let O=0;if(-1!==b&&(O=h.A.palette[n.A.Uu(T,96)]),0===y)t?.fm(i,e,c,w.A.am,u.A.Yd,-1,m,p,_,I,n.A.Uu(b,g),n.A.Uu(b,C),n.A.Uu(b,E),n.A.Uu(b,v),d.A.Zl,d.A.Zl,d.A.Zl,d.A.Zl,O,d.A.Zl);else{const s=this.zA[i][e][c]+1,r=this.ZA[i][e][c],o=n.A.Do[y-1];let l,a,f=o.texture;f>=0?(a=h.A.um(f),l=-1):o.Wu===d.A.dm?(a=0,l=-2,f=-1):(l=n.A.Pu(o.Vu,o.Ku,o.Xu),a=h.A.palette[n.A.Gu(o.Zu,96)]),t?.fm(i,e,c,s,r,f,m,p,_,I,n.A.Uu(b,g),n.A.Uu(b,C),n.A.Uu(b,E),n.A.Uu(b,v),n.A.Gu(l,g),n.A.Gu(l,C),n.A.Gu(l,E),n.A.Gu(l,v),O,a)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let s=0;s<=n;s++)for(let r=0;r<=this.KA;r++)for(let h=0;h<=this.VA;h++){if(this.nm[s][h][r]&t){let i=r,e=r,l=s,a=s;for(;i>0&&this.nm[s][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.nm[l-1][h][s]&t))break t;l--}t:for(;a=8){const s=this.Hr[a][h][i]-240,r=this.Hr[l][h][i];o.A.pm(n,1,128*h,s,128*i,128*h,r,128*e+128);for(let s=l;s<=a;s++)for(let n=i;n<=e;n++)this.nm[s][h][n]&=~t}}if(this.nm[s][h][r]&i){let t=h,e=h,l=s,a=s;for(;t>0&&this.nm[s][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.nm[l-1][s][r]&i))break t;l--}t:for(;a=8){const s=this.Hr[a][t][r]-240,h=this.Hr[l][t][r];o.A.pm(n,2,128*t,s,128*r,128*e+128,h,128*r);for(let s=l;s<=a;s++)for(let n=t;n<=e;n++)this.nm[s][n][r]&=~i}}if(this.nm[s][h][r]&e){let t=h,i=h,l=r,a=r;for(;l>0&&this.nm[s][h][l-1]&e;)l--;for(;a0;){for(let i=l;i<=a;i++)if(!(this.nm[s][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.Hr[s][t][l];o.A.pm(n,4,128*t,r,128*l,128*i+128,r,128*a+128);for(let n=t;n<=i;n++)for(let t=l;t<=a;t++)this.nm[s][n][t]&=~e}}}}}};_m=(t,i,e,r)=>{let h=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new r.A(new Uint8Array(h));for(let r=0;r=0&&a=0&&c>24,this.ZA[r][a][c]=(f-2&3)<<24>>24):f<=81?this.Vr[r][a][c]=f-49<<24>>24:this.XA[r][a][c]=f-81<<24>>24}else for(;f=o.pu,0!==f;){if(1===f){o.pu;break}f<=49&&o.pu}}};gm=(t,i,e,n,h,o)=>{const l=new r.A(new Uint8Array(n));let a=-1;for(;;){const n=l.Cm;if(0===n)return;a+=n;let r=0;for(;;){const n=l.Cm;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=l.pu,w=d>>2,y=3&d,A=f+h,m=c+o;if(A>0&&m>0&&A=0&&(n=e[s]),this.Xy(u,A,m,t,i,n,a,w,y)}}}};Xy=(t,i,e,s,n,r,h,o,d)=>{if(A.et){if(16&this.Vr[t][i][e])return;if(this.lm(t,i,e)!==A.kA)return}const w=this.Hr[t][i][e],y=this.Hr[t][i+1][e],m=this.Hr[t][i+1][e+1],p=this.Hr[t][i][e+1],_=w+y+m+p>>2,I=l.A.get(h);let g=i+(e<<7)+(h<<14)+1073741824|0;I.active||(g+=-2147483648),g|=0;const C=(d<<6)+o<<24>>24;if(o===f.A.dA.id)(!A.et||I.active||I.kd)&&(s?.GA(I.pa(f.A.dA.id,d,w,y,m,p,-1),t,i,e,_,g,C),I.wd&&I.active&&r?.Vy(i,e),-1!==I._l&&n.WA(new a.A(h,t,3,i,e,c.A.Do[I._l],!0)));else if(o===f.A.fd.id||o===f.A.AA.id){const l=I.pa(f.A.fd.id,d,w,y,m,p,-1);if(l){let n,r,h=0;if(o===f.A.AA.id&&(h+=256),d===u.A.jy||d===u.A.zy?(n=I.length,r=I.width):(n=I.width,r=I.length),s?.Xy(t,i,e,_,l,null,g,C,n,r,h)&&I.bd)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=l.Em/4|0;r>30&&(r=30),r>this.qA[t][i+s][e+n]&&(this.qA[t][i+s][e+n]=r<<24>>24)}}I.wd&&r?.Xy(i,e,I.width,I.length,d,I.yd),-1!==I._l&&n.WA(new a.A(h,t,2,i,e,c.A.Do[I._l],!0))}else if(o>=f.A.mA.id)s?.Xy(t,i,e,_,I.pa(o,d,w,y,m,p,-1),null,g,C,1,1,0),o>=f.A.mA.id&&o<=f.A.CA.id&&o!==f.A.pA.id&&t>0&&(this.nm[t][i][e]|=2340),I.wd&&r?.Xy(i,e,I.width,I.length,d,I.yd),-1!==I._l&&n.WA(new a.A(h,t,2,i,e,c.A.Do[I._l],!0));else if(o===f.A.Jy.id)s?.qy(t,i,e,_,A.OA[d],0,I.pa(f.A.Jy.id,d,w,y,m,p,-1),null,g,C),d===u.A.Yd?(I.bd&&(this.qA[t][i][e]=50,this.qA[t][i][e+1]=50),I.Hu&&(this.nm[t][i][e]|=585)):d===u.A.jy?(I.bd&&(this.qA[t][i][e+1]=50,this.qA[t][i+1][e+1]=50),I.Hu&&(this.nm[t][i][e+1]|=1170)):d===u.A.$y?(I.bd&&(this.qA[t][i+1][e]=50,this.qA[t][i+1][e+1]=50),I.Hu&&(this.nm[t][i+1][e]|=585)):d===u.A.zy&&(I.bd&&(this.qA[t][i][e]=50,this.qA[t][i+1][e]=50),I.Hu&&(this.nm[t][i][e]|=1170)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I._l&&n.WA(new a.A(h,t,0,i,e,c.A.Do[I._l],!0)),16!==I._d&&s?.vm(t,i,e,I._d);else if(o===f.A.Qy.id)s?.qy(t,i,e,_,A.RA[d],0,I.pa(f.A.Qy.id,d,w,y,m,p,-1),null,g,C),I.bd&&(d===u.A.Yd?this.qA[t][i][e+1]=50:d===u.A.jy?this.qA[t][i+1][e+1]=50:d===u.A.$y?this.qA[t][i+1][e]=50:d===u.A.zy&&(this.qA[t][i][e]=50)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I._l&&n.WA(new a.A(h,t,0,i,e,c.A.Do[I._l],!0));else if(o===f.A.iA.id){const l=d+1&3;s?.qy(t,i,e,_,A.OA[d],A.OA[l],I.pa(f.A.iA.id,d+4,w,y,m,p,-1),I.pa(f.A.iA.id,l,w,y,m,p,-1),g,C),I.Hu&&(d===u.A.Yd?(this.nm[t][i][e]|=265,this.nm[t][i][e+1]|=1170):d===u.A.jy?(this.nm[t][i][e+1]|=1170,this.nm[t][i+1][e]|=585):d===u.A.$y?(this.nm[t][i+1][e]|=585,this.nm[t][i][e]|=1170):d===u.A.zy&&(this.nm[t][i][e]|=1170,this.nm[t][i][e]|=585)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I._l&&n.WA(new a.A(h,t,0,i,e,c.A.Do[I._l],!0)),16!==I._d&&s?.vm(t,i,e,I._d)}else if(o===f.A.tA.id)s?.qy(t,i,e,_,A.RA[d],0,I.pa(f.A.tA.id,d,w,y,m,p,-1),null,g,C),I.bd&&(d===u.A.Yd?this.qA[t][i][e+1]=50:d===u.A.jy?this.qA[t][i+1][e+1]=50:d===u.A.$y?this.qA[t][i+1][e]=50:d===u.A.zy&&(this.qA[t][i][e]=50)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I._l&&n.WA(new a.A(h,t,0,i,e,c.A.Do[I._l],!0));else if(o===f.A.nA.id)s?.Xy(t,i,e,_,I.pa(o,d,w,y,m,p,-1),null,g,C,1,1,0),I.wd&&r?.Xy(i,e,I.width,I.length,d,I.yd),-1!==I._l&&n.WA(new a.A(h,t,2,i,e,c.A.Do[I._l],!0));else if(o===f.A.wA.id)s?.YA(t,i,e,_,0,0,g,I.pa(f.A.wA.id,u.A.Yd,w,y,m,p,-1),C,512*d,A.OA[d]),-1!==I._l&&n.WA(new a.A(h,t,1,i,e,c.A.Do[I._l],!0));else if(o===f.A.yA.id){let r=16;if(s){const n=s.HA(t,i,e);n>0&&(r=l.A.get(n>>14&32767)._d)}s?.YA(t,i,e,_,A.LA[d]*r,A.SA[d]*r,g,I.pa(f.A.wA.id,u.A.Yd,w,y,m,p,-1),C,512*d,A.OA[d]),-1!==I._l&&n.WA(new a.A(h,t,1,i,e,c.A.Do[I._l],!0))}else o===f.A.hA.id?(s?.YA(t,i,e,_,0,0,g,I.pa(f.A.wA.id,u.A.Yd,w,y,m,p,-1),C,d,256),-1!==I._l&&n.WA(new a.A(h,t,1,i,e,c.A.Do[I._l],!0))):o===f.A.oA.id?(s?.YA(t,i,e,_,0,0,g,I.pa(f.A.wA.id,u.A.Yd,w,y,m,p,-1),C,d,512),-1!==I._l&&n.WA(new a.A(h,t,1,i,e,c.A.Do[I._l],!0))):o===f.A.lA.id&&(s?.YA(t,i,e,_,0,0,g,I.pa(f.A.wA.id,u.A.Yd,w,y,m,p,-1),C,d,768),-1!==I._l&&n.WA(new a.A(h,t,1,i,e,c.A.Do[I._l],!0)))};lm=(t,i,e)=>8&this.Vr[t][i][e]?0:t<=0||!(2&this.Vr[1][i][e])?t:t-1}},3045:(t,i,e)=>{e.d(i,{A:()=>_});var s=e(4583),n=e(1161),r=e(3795),h=e(8256),o=e(670),l=e(9222),a=e(6855),c=e(7441),f=e(6666),u=e(5748),d=e(3479),w=e(8950),y=e(2771),A=e(5518),m=e(6169),p=e(3867);class _{static bm=new p.Tm(8,32,51,51,!1);static Om=new p.fe(100,null);static Rm=new Int32Array(o.A.Dr);static Lm=new p.Sm(o.A.Dr,500,null);static xm=new p.fe(500,null);static Mm=new f.A;static km=0;static Dm=0;static Nm=0;static Fm=0;static Bm=0;static Pm=0;static Um=0;static Gm=0;static Wm=0;static Ym=0;static Hm=0;static Vm=0;static Km=0;static Xm=0;static jm=0;static zm=0;static Zm=0;static qm=0;static Jm=0;static $m=0;static Qm=0;static tp=0;static ip=!1;static ep=null;static sp=Uint8Array.of(19,55,38,155,255,110,137,205,76);static np=Uint8Array.of(160,192,80,96,0,144,80,48,160);static rp=Uint8Array.of(76,8,137,4,0,1,38,2,19);static hp=Int8Array.of(0,0,2,0,0,2,1,1,0);static op=Int8Array.of(2,0,0,2,0,0,0,4,4);static lp=Int8Array.of(0,4,4,8,0,0,8,0,0);static ap=Int8Array.of(1,1,0,0,0,8,0,0,8);static cp=Int8Array.of(53,-53,-53,53);static fp=Int8Array.of(-53,-53,53,53);static up=Int8Array.of(-45,45,45,-45);static dp=Int8Array.of(45,45,-45,-45);static wp=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static yp=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static Ap=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static mp=0;static Hl=0;static Vl=0;static pp=-1;static _p=-1;static et=!0;static init=(t,i,e,n,r)=>{this.Dm=0,this.Nm=0,this.Fm=t,this.Bm=i,this.Pm=t/2|0,this.Um=i/2|0;const h=new p.Tm(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.Gm=s.A.sin[t],this.Wm=s.A.cos[t],this.Ym=s.A.sin[i],this.Hm=s.A.cos[i];const o=(t-128)/32|0,l=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const s=128*t,a=128*i;let c=!1;for(let t=-e;t<=n;t+=128)if(this.Ip(s,a,r[o]+t)){c=!0;break}h[o][l][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let r=-1;r<=1;r++)for(let o=-1;o<=1;o++){if(h[t][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}}this.bm[t][i][e+25][s+25]=n}};static Lo=()=>{this.Om=null,this.Rm=null,this.Lm=null,this.Mm=null,this.bm=null,this.xm=null,this.ep=null,console.log('World3D unloaded!')};static pm=(t,i,e,s,n,r,o,l)=>{_.Lm[t][_.Rm[t]++]=new h.A(e/128|0,r/128|0,n/128|0,l/128|0,i,e,r,n,l,s,o)};static Ip=(t,i,e)=>{const s=i*this.Ym+t*this.Hm>>16,n=i*this.Hm-t*this.Ym>>16,r=e*this.Gm+n*this.Wm>>16,h=e*this.Wm-n*this.Gm>>16;if(r<50||r>3500)return!1;const o=this.Pm+((s<<9)/r|0),l=this.Um+((h<<9)/r|0);return o>=this.Dm&&o<=this.Fm&&l>=this.Nm&&l<=this.Bm};gp;VA;KA;Cp;Ep;gh;vp;bp;Tp;Op=0;Rp=0;Lp=0;constructor(t,i,e,s){this.gp=e,this.VA=s,this.KA=i,this.Ep=new p.Eh(e,s,i,null),this.vp=new p.hm(e,s+1,i+1),this.Cp=t,this.gh=new p.fe(5e3,null),this.bp=new Int32Array(1e4),this.Tp=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.Rp=t;for(let i=0;i{const e=this.Ep[0][t][i];for(let e=0;e<3;e++){this.Ep[e][t][i]=this.Ep[e+1][t][i];const s=this.Ep[e][t][i];s&&s.level--}this.Ep[0][t][i]||(this.Ep[0][t][i]=new r.A(0,t,i));const s=this.Ep[0][t][i];s&&(s.xp=e),this.Ep[3][t][i]=null};wm=(t,i,e,s)=>{const n=this.Ep[t][i][e];n&&(n.Mp=s)};fm=(t,i,e,s,n,h,o,l,a,c,f,u,w,m,p,_,I,g,C,E)=>{if(s===A.A.am){for(let s=t;s>=0;s--)this.Ep[s][i][e]||(this.Ep[s][i][e]=new r.A(s,i,e));const s=this.Ep[t][i][e];s&&(s.kp=new d.A(f,u,w,m,-1,C,!1))}else if(s===A.A.Dp){for(let s=t;s>=0;s--)this.Ep[s][i][e]||(this.Ep[s][i][e]=new r.A(s,i,e));const s=this.Ep[t][i][e];s&&(s.kp=new d.A(p,_,I,g,h,E,o===l&&o===a&&o===c))}else{for(let s=t;s>=0;s--)this.Ep[s][i][e]||(this.Ep[s][i][e]=new r.A(s,i,e));const d=this.Ep[t][i][e];d&&(d.Np=new y.A(i,s,_,l,w,n,f,c,E,p,h,g,C,a,I,m,o,e,u))}};GA=(t,i,e,s,n,h,o)=>{this.Ep[i][e][s]||(this.Ep[i][e][s]=new r.A(i,e,s));const a=this.Ep[i][e][s];a&&(a.Fp=new l.A(n,128*e+64,128*s+64,t,h,o))};Bp=(t,i,e)=>{const s=this.Ep[t][i][e];s&&(s.Fp=null)};Pp=(t,i,e,s,n,h,o,l)=>{let a=0;const c=this.Ep[s][t][i];if(c)for(let t=0;ta&&(a=e)}else this.Ep[s][t][i]=new r.A(s,t,i);const f=this.Ep[s][t][i];f&&(f.Wp=new u.A(e,128*t+64,128*i+64,h,o,l,n,a))};Yp=(t,i,e)=>{const s=this.Ep[t][i][e];s&&(s.Wp=null)};qy=(t,i,e,s,n,h,o,l,c,f)=>{if(!o&&!l)return;for(let s=t;s>=0;s--)this.Ep[s][i][e]||(this.Ep[s][i][e]=new r.A(s,i,e));const u=this.Ep[t][i][e];u&&(u.Hp=new a.A(s,128*i+64,128*e+64,n,h,o,l,c,f))};eA=(t,i,e,s)=>{const n=this.Ep[t][i][e];1===s&&n&&(n.Hp=null)};YA=(t,i,e,s,n,h,o,l,a,f,u)=>{if(!l)return;for(let s=t;s>=0;s--)this.Ep[s][i][e]||(this.Ep[s][i][e]=new r.A(s,i,e));const d=this.Ep[t][i][e];d&&(d.Vp=new c.A(s,128*i+n+64,128*e+h+64,u,f,l,o,a))};Kp=(t,i,e)=>{const s=this.Ep[t][i][e];s&&(s.Vp=null)};vm=(t,i,e,s)=>{const n=this.Ep[t][i][e];if(!n)return;const r=n.Vp;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};Xp=(t,i,e,s)=>{if(!s)return;const n=this.Ep[t][i][e];if(!n)return;const r=n.Vp;r&&(r.model=s)};jp=(t,i,e,s)=>{if(!s)return;const n=this.Ep[t][i][e];if(!n)return;const r=n.Fp;r&&(r.model=s)};zp=(t,i,e,s)=>{if(!s)return;const n=this.Ep[t][i][e];if(!n)return;const r=n.Hp;r&&(r.Zp=s)};qp=(t,i,e,s,n)=>{if(!s)return;const r=this.Ep[e][t][i];if(!r)return;const h=r.Hp;h&&(h.Zp=s,h.Jp=n)};Xy=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!n&&!r)return!0;const f=128*i+64*l,u=128*e+64*a;return this.$p(f,u,s,t,i,e,l,a,n,r,h,o,c,!1)};Qp=(t,i,e,s,n,r,h,o,l,a)=>{if(!n&&!r)return!0;let c=i-l,f=s-l,u=i+l,d=s+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.$p(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};t_=(t,i,e,s,n,r,h,o,l,a,c,f)=>!l&&!a||this.$p(i,s,e,t,n,r,h+1-n,o-r+1,l,a,c,0,f,!0);Zy=(t,i,e)=>{const s=this.Ep[t][i][e];if(s)for(let t=0;t>29&3)&&n.e_===i&&n.s_===e)return void this.n_(n)}};r_=(t,i,e,s)=>{if(!s)return;const n=this.Ep[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};h_=()=>{for(let t=0;t{const s=this.Ep[t][i][e];return s&&s.Hp?s.Hp.i_:0};o_=(t,i,e)=>{const s=this.Ep[t][e][i];return s&&s.Vp?s.Vp.i_:0};l_=(t,i,e)=>{const s=this.Ep[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.e_===i&&n.s_===e)return n.i_}return 0};a_=(t,i,e)=>{const s=this.Ep[t][i][e];return s&&s.Fp?s.Fp.i_:0};c_=(t,i,e,s)=>{const n=this.Ep[t][i][e];if(n){if(n.Hp&&n.Hp.i_===s)return 255&n.Hp.info;if(n.Vp&&n.Vp.i_===s)return 255&n.Vp.info;if(n.Fp&&n.Fp.i_===s)return 255&n.Fp.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.Ep[t][i+1][e-1];n&&n.Fp&&n.Fp.model&&n.Fp.model.f_&&this.d_(s,n.Fp.model,128,0,-128,!0)}};u_=(t,i,e,s,n,r)=>{let h=!0,o=i;const l=i+s,a=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.gp){for(let u=o;u<=l;u++)if(!(u<0||u>=this.VA))for(let o=a;o<=c;o++){if(o<0||o>=this.KA||h&&u=e||u===i))continue;const a=this.Ep[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.Cp[f][u][o]+this.Cp[f][u+1][o]+this.Cp[f][u][o+1]+this.Cp[f][u+1][o+1])/4|0)-((this.Cp[t][i][e]+this.Cp[t][i+1][e]+this.Cp[t][i][e+1]+this.Cp[t][i+1][e+1])/4|0),A=a.Hp;A&&A.Zp&&A.Zp.f_&&this.d_(r,A.Zp,d,y,w,h),A&&A.Jp&&A.Jp.f_&&this.d_(r,A.Jp,d,y,w,h);for(let t=0;t{this.Lp++;let h=0;const o=i.Bd,l=i.Fd;if(t.f_&&t.p_)for(let r=0;ri.__)continue;const u=t.Bd[r]-e;if(ui.g_)continue;const d=t.Pd[r]-n;if(di.E_)continue;if(i.f_&&i.p_)for(let t=0;t{const h=this.Ep[t][i][e];if(!h)return;const o=h.kp;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const l=h.Np;if(!l)return;const a=l.shape,c=l.angle,f=l.S_,u=l.x_,d=_.wp[a],w=_.yp[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{_.ip=!0,_.Hl=t,_.Vl=i,_.pp=-1,_._p=-1};draw=(t,i,e,n,r,h,o)=>{t<0?t=0:t>=128*this.VA&&(t=128*this.VA-1),e<0?e=0:e>=128*this.KA&&(e=128*this.KA-1),_.km++,_.Gm=s.A.sin[h],_.Wm=s.A.cos[h],_.Ym=s.A.sin[r],_.Hm=s.A.cos[r],_.ep=_.bm[(h-128)/32|0][r/64|0],_.Vm=t,_.Km=i,_.Xm=e,_.jm=t/128|0,_.zm=e/128|0,_.Qm=n,_.Zm=_.jm-25,_.Zm<0&&(_.Zm=0),_.Jm=_.zm-25,_.Jm<0&&(_.Jm=0),_.qm=_.jm+25,_.qm>this.VA&&(_.qm=this.VA),_.$m=_.zm+25,_.$m>this.KA&&(_.$m=this.KA),this.M_(),_.tp=0;for(let t=this.Rp;t=2e3)?(h.visible=!0,h.update=!0,h.k_=h.Up>0,_.tp++):(h.visible=!1,h.update=!1,h.D_=0))}}for(let t=this.Rp;t=_.qm))for(let t=-25;t<=0;t++){const n=_.zm+t,r=_.zm-t;let h;if(e>=_.Zm&&(n>=_.Jm&&(h=i[e][n],h&&h.visible&&this.N_(h,!0,o)),r<_.$m&&(h=i[e][r],h&&h.visible&&this.N_(h,!0,o))),s<_.qm&&(n>=_.Jm&&(h=i[s][n],h&&h.visible&&this.N_(h,!0,o)),r<_.$m&&(h=i[s][r],h&&h.visible&&this.N_(h,!0,o))),0===_.tp)return void(_.ip=!1)}}}for(let t=this.Rp;t=_.qm))for(let t=-25;t<=0;t++){const n=_.zm+t,r=_.zm-t;let h;if(e>=_.Zm&&(n>=_.Jm&&(h=i[e][n],h&&h.visible&&this.N_(h,!1,o)),r<_.$m&&(h=i[e][r],h&&h.visible&&this.N_(h,!1,o))),s<_.qm&&(n>=_.Jm&&(h=i[s][n],h&&h.visible&&this.N_(h,!1,o)),r<_.$m&&(h=i[s][r],h&&h.visible&&this.N_(h,!1,o))),0===_.tp)return void(_.ip=!1)}}}};$p=(t,i,e,s,h,o,l,a,c,f,u,d,w,y)=>{if(!c&&!f)return!1;for(let t=h;t=this.VA||i>=this.KA)return!1;const e=this.Ep[s][t][i];if(e&&e.Up>=5)return!1}const A=new n.A(s,e,t,i,c,f,w,h,h+l-1,o,o+a-1,u,d);for(let t=h;th&&(e|=1),to&&(e+=8),i=0;e--)this.Ep[e][t][i]||(this.Ep[e][t][i]=new r.A(e,t,i));const n=this.Ep[s][t][i];n&&(n.Gp[n.Up]=A,n.F_[n.Up]=e,n.B_|=e,n.Up++)}return y&&(this.gh[this.Op++]=A),!0};n_=t=>{for(let i=t.e_;i<=t.y_;i++)for(let e=t.s_;e<=t.A_;e++){const s=this.Ep[t.level][i][e];if(s){for(let i=0;i{const t=_.Rm[_.Qm],i=_.Lm[_.Qm];_.mp=0;for(let e=0;e=0&&s<=50){n=t.U_+25-_.zm,n<0&&(n=0),r=t.KA+25-_.zm,r>50&&(r=50);let i=!1;for(;n<=r;)if(_.ep&&_.ep[s][n++]){i=!0;break}if(i){if(h=_.Vm-t.I_,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.G_=(t.C_-_.Xm<<8)/h|0,t.W_=(t.E_-_.Xm<<8)/h|0,t.Y_=(t.__-_.Km<<8)/h|0,t.H_=(t.jd-_.Km<<8)/h|0,_.xm[_.mp++]=t}}}else if(2===t.type){if(s=t.U_+25-_.zm,s>=0&&s<=50){n=t.P_+25-_.jm,n<0&&(n=0),r=t.VA+25-_.jm,r>50&&(r=50);let i=!1;for(;n<=r;)if(_.ep&&_.ep[n++][s]){i=!0;break}if(i){if(h=_.Xm-t.C_,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.V_=(t.I_-_.Vm<<8)/h|0,t.K_=(t.g_-_.Vm<<8)/h|0,t.Y_=(t.__-_.Km<<8)/h|0,t.H_=(t.jd-_.Km<<8)/h|0,_.xm[_.mp++]=t}}}else if(4===t.type&&(s=t.__-_.Km,s>128&&(n=t.U_+25-_.zm,n<0&&(n=0),r=t.KA+25-_.zm,r>50&&(r=50),n<=r))){let i=t.P_+25-_.jm;i<0&&(i=0),h=t.VA+25-_.jm,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(_.ep&&_.ep[t][i]){e=!0;break t}e&&(t.mode=5,t.V_=(t.I_-_.Vm<<8)/s|0,t.K_=(t.g_-_.Vm<<8)/s|0,t.G_=(t.C_-_.Xm<<8)/s|0,t.W_=(t.E_-_.Xm<<8)/s|0,_.xm[_.mp++]=t)}}};N_=(t,i,e)=>{for(_.Mm.WA(t);;){let t;do{if(t=_.Mm.X_(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.j_,o=this.Ep[r];if(t.visible){if(i){if(r>0){const t=this.Ep[r-1][s][n];if(t&&t.update)continue}if(s<=_.jm&&s>_.Zm){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.B_)))continue}if(s>=_.jm&&s<_.qm-1){const i=o[s+1][n];if(i&&i.update&&(i.visible||!(4&t.B_)))continue}if(n<=_.zm&&n>_.Jm){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.B_)))continue}if(n>=_.zm&&n<_.$m-1){const i=o[s][n+1];if(i&&i.update&&(i.visible||!(2&t.B_)))continue}}else i=!0;if(t.visible=!1,t.xp){const i=t.xp;i.kp?this.z_(0,s,n)||this.Z_(i.kp,0,s,n,_.Gm,_.Wm,_.Ym,_.Hm):i.Np&&!this.z_(0,s,n)&&this.q_(s,n,i.Np,_.Gm,_.Wm,_.Ym,_.Hm);const r=i.Hp;r&&r.Zp?.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,r.x-_.Vm,r.y-_.Km,r.z-_.Xm,r.i_);for(let t=0;tn&&(a+=6),c=_.sp[a],t.tI=_.rp[a]),f&&(f.iI&_.np[a]?16===f.iI?(t.D_=3,t.eI=_.hp[a],t.sI=3-t.eI):32===f.iI?(t.D_=6,t.eI=_.op[a],t.sI=6-t.eI):64===f.iI?(t.D_=12,t.eI=_.lp[a],t.sI=12-t.eI):(t.D_=9,t.eI=_.ap[a],t.sI=9-t.eI):t.D_=0,f.iI&c&&!this.nI(h,s,n,f.iI)&&f.Zp?.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,f.x-_.Vm,f.y-_.Km,f.z-_.Xm,f.i_),f.rI&c&&!this.nI(h,s,n,f.rI)&&f.Jp?.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,f.x-_.Vm,f.y-_.Km,f.z-_.Xm,f.i_)),u&&!this.visible(h,s,n,u.model.jd))if(u.type&c)u.model.draw(u.angle,_.Gm,_.Wm,_.Ym,_.Hm,u.x-_.Vm,u.y-_.Km,u.z-_.Xm,u.i_);else if(768&u.type){const t=u.x-_.Vm,i=u.y-_.Km,e=u.z-_.Xm,s=u.angle;let n,r;if(n=s===m.A.jy||s===m.A.$y?-t:t,r=s===m.A.$y||s===m.A.zy?-e:e,256&u.type&&rn){const n=t+_.up[s],r=e+_.dp[s];u.model.draw(512*s+1280&2047,_.Gm,_.Wm,_.Ym,_.Hm,n,i,r,u.i_)}}if(l){const i=t.Fp;i&&i.model?.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,i.x-_.Vm,i.y-_.Km,i.z-_.Xm,i.i_);const e=t.Wp;e&&0===e.offset&&(e.hI&&e.hI.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,e.x-_.Vm,e.y-_.Km,e.z-_.Xm,e.i_),e.oI&&e.oI.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,e.x-_.Vm,e.y-_.Km,e.z-_.Xm,e.i_),e.lI&&e.lI.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,e.x-_.Vm,e.y-_.Km,e.z-_.Xm,e.i_))}const d=t.B_;if(0!==d){if(s<_.jm&&4&d){const t=o[s+1][n];t&&t.update&&_.Mm.WA(t)}if(n<_.zm&&2&d){const t=o[s][n+1];t&&t.update&&_.Mm.WA(t)}if(s>_.jm&&1&d){const t=o[s-1][n];t&&t.update&&_.Mm.WA(t)}if(n>_.zm&&8&d){const t=o[s][n-1];t&&t.update&&_.Mm.WA(t)}}}if(0!==t.D_){let i=!0;for(let e=0;ei.e_&&(r+=1),ei.s_&&(r+=8),ss&&(s=n);const h=_.zm-i.s_,l=i.A_-_.zm;i.aI=l>h?s+l:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.aI,i=e))}if(-1===i)break;const l=_.Om[i];if(l){l.km=_.km;let t=l.model;t||(t=l.J_?.draw(e)??null),t&&!this.cI(h,l.e_,l.y_,l.s_,l.A_,t.jd)&&t.draw(l.Q_,_.Gm,_.Wm,_.Ym,_.Hm,l.x-_.Vm,l.y-_.Km,l.z-_.Xm,l.i_);for(let t=l.e_;t<=l.y_;t++)for(let i=l.s_;i<=l.A_;i++){const e=o[t][i];e&&(0!==e.D_?_.Mm.WA(e):t===s&&i===n||!e.update||_.Mm.WA(e))}}}if(t.k_)continue}if(!t.update||0!==t.D_)continue;if(s<=_.jm&&s>_.Zm){const t=o[s-1][n];if(t&&t.update)continue}if(s>=_.jm&&s<_.qm-1){const t=o[s+1][n];if(t&&t.update)continue}if(n<=_.zm&&n>_.Jm){const t=o[s][n-1];if(t&&t.update)continue}if(n>=_.zm&&n<_.$m-1){const t=o[s][n+1];if(t&&t.update)continue}t.update=!1,_.tp--;const l=t.Wp;if(l&&0!==l.offset&&(l.hI&&l.hI.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,l.x-_.Vm,l.y-_.Km-l.offset,l.z-_.Xm,l.i_),l.oI&&l.oI.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,l.x-_.Vm,l.y-_.Km-l.offset,l.z-_.Xm,l.i_),l.lI&&l.lI.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,l.x-_.Vm,l.y-_.Km-l.offset,l.z-_.Xm,l.i_)),0!==t.tI){const i=t.Vp;if(i&&!this.visible(h,s,n,i.model.jd))if(i.type&t.tI)i.model.draw(i.angle,_.Gm,_.Wm,_.Ym,_.Hm,i.x-_.Vm,i.y-_.Km,i.z-_.Xm,i.i_);else if(768&i.type){const t=i.x-_.Vm,e=i.y-_.Km,s=i.z-_.Xm,n=i.angle;let r,h;if(r=n===m.A.jy||n===m.A.$y?-t:t,h=n===m.A.$y||n===m.A.zy?-s:s,256&i.type&&h>=r){const r=t+_.cp[n],h=s+_.fp[n];i.model.draw(512*n+256,_.Gm,_.Wm,_.Ym,_.Hm,r,e,h,i.i_)}if(512&i.type&&h<=r){const r=t+_.up[n],h=s+_.dp[n];i.model.draw(512*n+1280&2047,_.Gm,_.Wm,_.Ym,_.Hm,r,e,h,i.i_)}}const e=t.Hp;e&&(e.rI&t.tI&&!this.nI(h,s,n,e.rI)&&e.Jp?.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,e.x-_.Vm,e.y-_.Km,e.z-_.Xm,e.i_),e.iI&t.tI&&!this.nI(h,s,n,e.iI)&&e.Zp?.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,e.x-_.Vm,e.y-_.Km,e.z-_.Xm,e.i_))}if(r_.jm){const t=o[s-1][n];t&&t.update&&_.Mm.WA(t)}if(n>_.zm){const t=o[s][n-1];t&&t.update&&_.Mm.WA(t)}}};Z_=(t,i,e,n,r,h,o,l)=>{let a,c,f,u,d=a=(e<<7)-_.Vm,y=c=(n<<7)-_.Xm,A=f=d+128,m=u=y+128,p=this.Cp[i][e][n]-_.Km,I=this.Cp[i][e+1][n]-_.Km,g=this.Cp[i][e+1][n+1]-_.Km,C=this.Cp[i][e][n+1]-_.Km,E=y*o+d*l>>16;if(y=y*l-d*o>>16,d=E,E=p*h-y*r>>16,y=p*r+y*h>>16,p=E,y<50)return;if(E=c*o+A*l>>16,c=c*l-A*o>>16,A=E,E=I*h-c*r>>16,c=I*r+c*h>>16,I=E,c<50)return;if(E=m*o+f*l>>16,m=m*l-f*o>>16,f=E,E=g*h-m*r>>16,m=g*r+m*h>>16,g=E,m<50)return;if(E=u*o+a*l>>16,u=u*l-a*o>>16,a=E,E=C*h-u*r>>16,u=C*r+u*h>>16,C=E,u<50)return;const v=s.A.ya+((d<<9)/y|0),b=s.A.Aa+((p<<9)/y|0),T=s.A.ya+((A<<9)/c|0),O=s.A.Aa+((I<<9)/c|0),R=s.A.ya+((f<<9)/m|0),L=s.A.Aa+((g<<9)/m|0),S=s.A.ya+((a<<9)/u|0),x=s.A.Aa+((C<<9)/u|0);if(s.A.alpha=0,(R-S)*(O-x)-(L-x)*(T-S)>0)if(s.A.fI=R<0||S<0||T<0||R>w.A.uI||S>w.A.uI||T>w.A.uI,_.ip&&this.dI(_.Hl,_.Vl,L,x,O,R,S,T)&&(_.pp=e,_._p=n),-1===t.wI)12345678!==t.yI&&s.A.AI(R,S,T,L,x,O,t.yI,t.mI,t.pI);else if(_.et){const i=_.Ap[t.wI];s.A.AI(R,S,T,L,x,O,this._I(i,t.yI),this._I(i,t.mI),this._I(i,t.pI))}else t.flat?s.A.II(R,S,T,L,x,O,t.yI,t.mI,t.pI,d,p,y,A,a,I,C,c,u,t.wI):s.A.II(R,S,T,L,x,O,t.yI,t.mI,t.pI,f,g,m,a,A,C,I,u,c,t.wI);if(!((v-T)*(x-O)-(b-O)*(S-T)<=0))if(s.A.fI=v<0||T<0||S<0||v>w.A.uI||T>w.A.uI||S>w.A.uI,_.ip&&this.dI(_.Hl,_.Vl,b,O,x,v,T,S)&&(_.pp=e,_._p=n),-1!==t.wI){if(!_.et)return void s.A.II(v,T,S,b,O,x,t.gI,t.pI,t.mI,d,p,y,A,a,I,C,c,u,t.wI);const i=_.Ap[t.wI];s.A.AI(v,T,S,b,O,x,this._I(i,t.gI),this._I(i,t.pI),this._I(i,t.mI))}else 12345678!==t.gI&&s.A.AI(v,T,S,b,O,x,t.gI,t.pI,t.mI)};q_=(t,i,e,n,r,h,o)=>{let l=e.Bd.length;for(let t=0;t>16;if(a=a*o-i*h>>16,i=c,c=l*r-a*n>>16,a=l*n+a*r>>16,l=c,a<50)return;e.CI&&(y.A.EI[t]=i,y.A.vI[t]=l,y.A.bI[t]=a),y.A.TI[t]=s.A.ya+((i<<9)/a|0),y.A.OI[t]=s.A.Aa+((l<<9)/a|0)}s.A.alpha=0,l=e.RI.length;for(let n=0;n0)if(s.A.fI=l<0||a<0||c<0||l>w.A.uI||a>w.A.uI||c>w.A.uI,_.ip&&this.dI(_.Hl,_.Vl,f,u,d,l,a,c)&&(_.pp=t,_._p=i),e.CI&&-1!==e.CI[n])if(_.et){const t=_.Ap[e.CI[n]];s.A.AI(l,a,c,f,u,d,this._I(t,e.xI[n]),this._I(t,e.MI[n]),this._I(t,e.kI[n]))}else e.flat?s.A.II(l,a,c,f,u,d,e.xI[n],e.MI[n],e.kI[n],y.A.EI[0],y.A.vI[0],y.A.bI[0],y.A.EI[1],y.A.EI[3],y.A.vI[1],y.A.vI[3],y.A.bI[1],y.A.bI[3],e.CI[n]):s.A.II(l,a,c,f,u,d,e.xI[n],e.MI[n],e.kI[n],y.A.EI[r],y.A.vI[r],y.A.bI[r],y.A.EI[h],y.A.EI[o],y.A.vI[h],y.A.vI[o],y.A.bI[h],y.A.bI[o],e.CI[n]);else 12345678!==e.xI[n]&&s.A.AI(l,a,c,f,u,d,e.xI[n],e.MI[n],e.kI[n])}};z_=(t,i,e)=>{const s=this.vp[t][i][e];if(s===-_.km)return!1;if(s===_.km)return!0;{const s=i<<7,n=e<<7;return this.DI(s+1,this.Cp[t][i][e],n+1)&&this.DI(s+128-1,this.Cp[t][i+1][e],n+1)&&this.DI(s+128-1,this.Cp[t][i+1][e+1],n+128-1)&&this.DI(s+1,this.Cp[t][i][e+1],n+128-1)?(this.vp[t][i][e]=_.km,!0):(this.vp[t][i][e]=-_.km,!1)}};nI=(t,i,e,s)=>{if(!this.z_(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.Cp[t][i][e]-1,o=h-120,l=h-230,a=h-238;if(s<16){if(1===s){if(n>_.Vm){if(!this.DI(n,h,r))return!1;if(!this.DI(n,h,r+128))return!1}if(t>0){if(!this.DI(n,o,r))return!1;if(!this.DI(n,o,r+128))return!1}return!!this.DI(n,l,r)&&this.DI(n,l,r+128)}if(2===s){if(r<_.Xm){if(!this.DI(n,h,r+128))return!1;if(!this.DI(n+128,h,r+128))return!1}if(t>0){if(!this.DI(n,o,r+128))return!1;if(!this.DI(n+128,o,r+128))return!1}return!!this.DI(n,l,r+128)&&this.DI(n+128,l,r+128)}if(4===s){if(n<_.Vm){if(!this.DI(n+128,h,r))return!1;if(!this.DI(n+128,h,r+128))return!1}if(t>0){if(!this.DI(n+128,o,r))return!1;if(!this.DI(n+128,o,r+128))return!1}return!!this.DI(n+128,l,r)&&this.DI(n+128,l,r+128)}if(8===s){if(r>_.Xm){if(!this.DI(n,h,r))return!1;if(!this.DI(n+128,h,r))return!1}if(t>0){if(!this.DI(n,o,r))return!1;if(!this.DI(n+128,o,r))return!1}return!!this.DI(n,l,r)&&this.DI(n+128,l,r)}}return!!this.DI(n+64,a,r+64)&&(16===s?this.DI(n,l,r+128):32===s?this.DI(n+128,l,r+128):64===s?this.DI(n+128,l,r):128===s?this.DI(n,l,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.z_(t,i,e)){const n=i<<7,r=e<<7;return this.DI(n+1,this.Cp[t][i][e]-s,r+1)&&this.DI(n+128-1,this.Cp[t][i+1][e]-s,r+1)&&this.DI(n+128-1,this.Cp[t][i+1][e+1]-s,r+128-1)&&this.DI(n+1,this.Cp[t][i][e+1]-s,r+128-1)}return!1};cI=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.vp[t][h][o]===-_.km)return!1;o=1+(i<<7);const l=2+(s<<7),a=this.Cp[t][i][s]-r;if(!this.DI(o,a,l))return!1;const c=(e<<7)-1;if(!this.DI(c,a,l))return!1;const f=(n<<7)-1;return!!this.DI(o,a,f)&&this.DI(c,a,f)}return!!this.z_(t,i,s)&&(h=i<<7,o=s<<7,this.DI(h+1,this.Cp[t][i][s]-r,o+1)&&this.DI(h+128-1,this.Cp[t][i+1][s]-r,o+1)&&this.DI(h+128-1,this.Cp[t][i+1][s+1]-r,o+128-1)&&this.DI(h+1,this.Cp[t][i][s+1]-r,o+128-1))};DI=(t,i,e)=>{for(let s=0;s<_.mp;s++){const n=_.xm[s];if(n)if(1===n.mode){const s=n.I_-t;if(s>0){const t=n.C_+(n.G_*s>>8),r=n.E_+(n.W_*s>>8),h=n.__+(n.Y_*s>>8),o=n.jd+(n.H_*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.I_;if(s>0){const t=n.C_+(n.G_*s>>8),r=n.E_+(n.W_*s>>8),h=n.__+(n.Y_*s>>8),o=n.jd+(n.H_*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.C_-e;if(s>0){const e=n.I_+(n.V_*s>>8),r=n.g_+(n.K_*s>>8),h=n.__+(n.Y_*s>>8),o=n.jd+(n.H_*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.C_;if(s>0){const e=n.I_+(n.V_*s>>8),r=n.g_+(n.K_*s>>8),h=n.__+(n.Y_*s>>8),o=n.jd+(n.H_*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.__;if(s>0){const i=n.I_+(n.V_*s>>8),r=n.g_+(n.K_*s>>8),h=n.C_+(n.G_*s>>8),o=n.E_+(n.W_*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};dI=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const l=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*l>0&&l*((i-n)*(r-o)-(t-o)*(e-n))>0};_I=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{}},4197:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{NI;FI;BI;UI;index;Qw;Cl;gl;constructor(t,i,e,s,n,r,h){super(),this.NI=i,this.FI=e,this.BI=s,this.UI=n,this.index=t,this.Qw=r,h&&-1!==r.vl&&this.Qw.delay?(this.Cl=Math.random()*this.Qw.El|0,this.gl=Math.random()*this.Qw.delay[this.Cl]|0):(this.Cl=-1,this.gl=0)}}},9418:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(7121),n=e(1312),r=e(3867);class h extends s.A{x=0;z=0;Q_=0;GI=!1;size=1;Ga=-1;WI=-1;YI=-1;HI=-1;VI=-1;KI=-1;XI=-1;jI=null;zI=100;ZI=0;qI=0;JI=0;$I=0;QI=-1e3;tg=0;ig=0;eg=-1;sg=0;ng=0;rg=-1;hg=0;og=0;lg=-1;ag=0;cg=0;fg=0;ug=0;dg=-1;wg=0;yg=0;Ag=0;mg=0;pg=0;_g=0;Ig=0;gg=0;Cg=0;Eg=0;vg=0;km=0;height=0;bg=0;pathLength=0;Tg=new Int32Array(10);Og=new Int32Array(10);Rg=new r.fe(10,!1);Lg=0;Sg=-1;xg=-1;Mg=-1;kg=-1;move(t,i,e){if(-1!==this.lg&&n.A.Do[this.lg].priority<=1&&(this.lg=-1),!t){const t=i-this.Tg[0],s=e-this.Og[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.Tg[t]=this.Tg[t-1],this.Og[t]=this.Og[t-1],this.Rg[t]=this.Rg[t-1];return this.Tg[0]=i,this.Og[0]=e,void(this.Rg[0]=!1)}}this.pathLength=0,this.Lg=0,this.Tg[0]=i,this.Og[0]=e,this.x=128*this.Tg[0]+64*this.size,this.z=128*this.Og[0]+64*this.size}step(t,i){let e=this.Tg[0],s=this.Og[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.lg&&n.A.Do[this.lg].priority<=1&&(this.lg=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.Tg[t]=this.Tg[t-1],this.Og[t]=this.Og[t-1],this.Rg[t]=this.Rg[t-1];this.Tg[0]=e,this.Og[0]=s,this.Rg[0]=t}}},8268:(t,i,e)=>{e.d(i,{A:()=>d});var s=e(9418),n=e(8665),r=e(2679),h=e(8738),o=e(1312),l=e(8317),a=e(1302),c=e(3819),f=e(3867),u=e(9298);class d extends s.A{static Dg=1;static Ng=2;static Fg=4;static Bg=8;static Pg=16;static Ug=32;static Gg=64;static Wg=128;static Yg=256;static Hg=512;static Ua=[u.A.Vg,u.A.Kg,u.A.Xg,u.A.jg,u.A.zg,u.A.Zg,u.A.qg,u.A.Jg,u.A.$g,u.A.Qg,u.A.tC,u.A.iC,u.A.eC,u.A.sC,u.A.nC,u.A.rC];static Pa=[[u.A.hC,u.A.oC,u.A.lC,u.A.aC,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.AC,u.A.mC],[u.A.pC,u.A._C,u.A.IC,u.A.gC,u.A.CC,u.A.EC,u.A.vC,u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.LC,u.A.SC,u.A.xC,u.A.MC,u.A.kC],[u.A.kC-1,u.A.pC+1,u.A._C,u.A.IC,u.A.gC,u.A.CC,u.A.EC,u.A.vC,u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.LC,u.A.SC,u.A.xC,u.A.MC],[u.A.DC,u.A.NC,u.A.FC,u.A.BC,u.A.PC,u.A.UC],[u.A.GC,u.A.WC,u.A.YC,u.A.HC,u.A.VC,u.A.KC,u.A.XC,u.A.jC]];static No=new r.A(200);name=null;visible=!1;zC=0;ZC=0;qC=new Uint16Array(12);JC=new Uint16Array(5);ic=0;$C=0n;y=0;QC=0;tE=0;iE=0;eE=0;sE=0;nE=null;P_=0;U_=0;VA=0;KA=0;et=!1;draw(t){if(!this.visible)return null;let i=this.sw();if(this.height=i.jd,i.ow=!0,this.et)return i;if(-1!==this.dg&&-1!==this.wg){const t=h.A.Do[this.dg],e=n.A.ku(t.pa(),!0,!t.pd,!1);e.translate(-this.mg,0,0),e.Wa(),t.Qw&&t.Qw.frames&&e.Ya(t.Qw.frames[this.wg]),e.Hd=null,e.Vd=null,128===t.iw&&128===t.ew||e.scale(t.iw,t.ew,t.iw),e.Ha(t.Id+64,t.gd+850,-30,-50,-30,!0);const s=[i,e];i=n.A.rE(s,2)}if(this.nE&&(t>=this.tE&&(this.nE=null),t>=this.QC&&t=d.Pa[i].length)&&(e=0),this.JC[i]=e}this.Ga=t.Au,65535===this.Ga&&(this.Ga=-1),this.WI=t.Au,65535===this.WI&&(this.WI=-1),this.YI=t.Au,65535===this.YI&&(this.YI=-1),this.HI=t.Au,65535===this.HI&&(this.HI=-1),this.VI=t.Au,65535===this.VI&&(this.VI=-1),this.KI=t.Au,65535===this.KI&&(this.KI=-1),this.XI=t.Au,65535===this.XI&&(this.XI=-1),this.name=c.A.Ma(c.A.ka(t.hE)),this.ic=t.pu,this.visible=!0,this.$C=0n;for(let t=0;t<12;t++)this.$C<<=0x4n,this.qC[t]>=256&&(this.$C+=BigInt(this.qC[t])-256n);this.qC[0]>=256&&(this.$C+=BigInt(this.qC[0])-256n>>4n),this.qC[1]>=256&&(this.$C+=BigInt(this.qC[1])-256n>>8n);for(let t=0;t<5;t++)this.$C<<=0x3n,this.$C+=BigInt(this.JC[t]);this.$C<<=0x1n,this.$C+=BigInt(this.zC)}ed(){if(!this.visible)return null;const t=new f.fe(12,null);let i=0;for(let e=0;e<12;e++){const s=this.qC[e];if(s>=256&&s<512&&(t[i++]=l.A.Do[s-256].ed()),s>=512){const e=a.A.get(s-512).ed(this.zC);e&&(t[i++]=e)}}const e=n.A.Fa(t,i);for(let t=0;t<5;t++)0!==this.JC[t]&&(e.Ba(d.Pa[t][0],d.Pa[t][this.JC[t]]),1===t&&e.Ba(d.Ua[0],d.Ua[this.JC[t]]));return e}sw(){let t=this.$C,i=-1,e=-1,s=-1,r=-1;if(this.lg>=0&&0===this.fg){const n=o.A.Do[this.lg];if(n.frames&&(i=n.frames[this.ag]),this.rg>=0&&this.rg!==this.Ga){const t=o.A.Do[this.rg].frames;t&&(e=t[this.hg])}n.qw>=0&&(s=n.qw,t+=BigInt(s-this.qC[5])<<8n),n.Jw>=0&&(r=n.Jw,t+=BigInt(r-this.qC[3])<<16n)}else if(this.rg>=0){const t=o.A.Do[this.rg].frames;t&&(i=t[this.hg])}let h=d.No?.get(t);if(!h){const i=new f.fe(12,null);let e=0;for(let t=0;t<12;t++){let n=this.qC[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=l.A.Do[n-256].pa();t&&(i[e++]=t)}if(n>=512){const t=a.A.get(n-512).jw(this.zC);t&&(i[e++]=t)}}h=n.A.Fa(i,e);for(let t=0;t<5;t++)0!==this.JC[t]&&(h.Ba(d.Pa[t][0],d.Pa[t][this.JC[t]]),1===t&&h.Ba(d.Ua[0],d.Ua[this.JC[t]]));h.Wa(),h.Ha(64,850,-30,-50,-30,!0),d.No?.put(t,h)}if(this.et)return h;const c=n.A.nw(h,!0);return-1!==i&&-1!==e?c.rw(i,e,o.A.Do[this.lg].zw):-1!==i&&c.Ya(i),c.hw(),c.Hd=null,c.Vd=null,c}}},9222:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;model;i_;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.i_=n,this.info=r}}},1161:(t,i,e)=>{e.d(i,{A:()=>s});class s{level;y;x;z;model;J_;Q_;e_;y_;s_;A_;i_;info;aI=0;km=0;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.J_=r,this.Q_=h,this.e_=o,this.y_=l,this.s_=a,this.A_=c,this.i_=f,this.info=u}}},5748:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;lI;oI;hI;i_;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.lI=s,this.oI=n,this.hI=r,this.i_=h,this.offset=o}}},8256:(t,i,e)=>{e.d(i,{A:()=>s});class s{P_;VA;U_;KA;type;I_;g_;C_;E_;__;jd;mode=0;V_=0;K_=0;G_=0;W_=0;Y_=0;H_=0;constructor(t,i,e,s,n,r,h,o,l,a,c){this.P_=t,this.VA=i,this.U_=e,this.KA=s,this.type=n,this.I_=r,this.g_=h,this.C_=o,this.E_=l,this.__=a,this.jd=c}}},3795:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1982),n=e(3867);class r extends s.A{level;x;z;j_;Gp;F_;kp=null;Np=null;Hp=null;Vp=null;Fp=null;Wp=null;xp=null;Up=0;B_=0;Mp=0;visible=!1;update=!1;k_=!1;D_=0;eI=0;sI=0;tI=0;constructor(t,i,e){super(),this.j_=this.level=t,this.x=i,this.z=e,this.Gp=new n.fe(5,null),this.F_=new Int32Array(5)}}},2771:(t,i,e)=>{e.d(i,{A:()=>s});class s{static TI=new Int32Array(6);static OI=new Int32Array(6);static EI=new Int32Array(6);static vI=new Int32Array(6);static bI=new Int32Array(6);static oE=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static lE=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static aE=128;static cE=this.aE/2|0;static fE=this.aE/4|0;static uE=3*this.aE/4|0;Bd;Ud;Pd;xI;MI;kI;RI;LI;SI;CI;flat;shape;angle;S_;x_;constructor(t,i,e,n,r,h,o,l,a,c,f,u,d,w,y,A,m,p,_){this.flat=!(m!==n||m!==w||m!==l),this.shape=i,this.angle=h,this.S_=d,this.x_=a;const I=s.oE[i],g=I.length;this.Bd=new Int32Array(g),this.Ud=new Int32Array(g),this.Pd=new Int32Array(g);const C=new Int32Array(g),E=new Int32Array(g),v=t*s.aE,b=p*s.aE;for(let t=0;t8&&g<=12&&(g=9+(g-h-9&3)),g>12&&g<=16&&(g=13+(g-h-13&3)),1===g?(i=v,a=b,f=m,d=o,p=c):2===g?(i=v+s.cE,a=b,f=m+n>>1,d=o+_>>1,p=c+e>>1):3===g?(i=v+s.aE,a=b,f=n,d=_,p=e):4===g?(i=v+s.aE,a=b+s.cE,f=n+w>>1,d=_+r>>1,p=e+y>>1):5===g?(i=v+s.aE,a=b+s.aE,f=w,d=r,p=y):6===g?(i=v+s.cE,a=b+s.aE,f=w+l>>1,d=r+A>>1,p=y+u>>1):7===g?(i=v,a=b+s.aE,f=l,d=A,p=u):8===g?(i=v,a=b+s.cE,f=l+m>>1,d=A+o>>1,p=u+c>>1):9===g?(i=v+s.cE,a=b+s.fE,f=m+n>>1,d=o+_>>1,p=c+e>>1):10===g?(i=v+s.uE,a=b+s.cE,f=n+w>>1,d=_+r>>1,p=e+y>>1):11===g?(i=v+s.cE,a=b+s.uE,f=w+l>>1,d=r+A>>1,p=y+u>>1):12===g?(i=v+s.fE,a=b+s.cE,f=l+m>>1,d=A+o>>1,p=u+c>>1):13===g?(i=v+s.fE,a=b+s.fE,f=m,d=o,p=c):14===g?(i=v+s.uE,a=b+s.fE,f=n,d=_,p=e):15===g?(i=v+s.uE,a=b+s.uE,f=w,d=r,p=y):(i=v+s.fE,a=b+s.uE,f=l,d=A,p=u),this.Bd[t]=i,this.Ud[t]=f,this.Pd[t]=a,C[t]=d,E[t]=p}const T=s.lE[i],O=T.length/4|0;this.RI=new Int32Array(O),this.LI=new Int32Array(O),this.SI=new Int32Array(O),this.xI=new Int32Array(O),this.MI=new Int32Array(O),this.kI=new Int32Array(O),this.CI=-1!==f?new Int32Array(O):null;let R=0;for(let t=0;t{e.d(i,{A:()=>s});class s{static am=0;static Dp=1;static dE=2;static wE=3;static yE=4;static AE=5;static cE=6;static fE=7;static uE=8;static mE=9;static pE=10;static _E=11}},3479:(t,i,e)=>{e.d(i,{A:()=>s});class s{gI;pI;yI;mI;wI;color;flat;constructor(t,i,e,s,n,r,h){this.gI=t,this.pI=i,this.yI=e,this.mI=s,this.wI=n,this.color=r,this.flat=h}}},6855:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;iI;rI;Zp;Jp;i_;info;constructor(t,i,e,s,n,r,h,o,l){this.y=t,this.x=i,this.z=e,this.iI=s,this.rI=n,this.Zp=r,this.Jp=h,this.i_=o,this.info=l}}},7441:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;type;angle;model;i_;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.i_=h,this.info=o}}},7536:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{IE;gE;constructor(t){this.gE=[],this.IE=t;for(let i=0;i{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{EE;vE;constructor(){super(),this.EE=this,this.vE=this}bE(){this.vE&&this.EE&&(this.vE.EE=this.EE,this.EE.vE=this.vE,this.EE=null,this.vE=null)}}},3819:(t,i,e)=>{e.d(i,{A:()=>s});class s{static TE=['_','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','0','1','2','3','4','5','6','7','8','9'];static OE=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static ka=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.TE[Number(s-37n*t)]}return e.slice(12-i).join('')};static RE=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static LE=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static Ma=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static Su=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}},6666:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{SE;cursor=null;constructor(){const t=new s.A;t.next=t,t.CE=t,this.SE=t}WA(t){t.CE&&t.ww(),t.CE=this.SE.CE,t.next=this.SE,t.CE&&(t.CE.next=t),t.next.CE=t}xE(t){t.CE&&t.ww(),t.CE=this.SE,t.next=this.SE.next,t.CE.next=t,t.next&&(t.next.CE=t)}X_(){const t=this.SE.next;return t===this.SE?null:(t?.ww(),t)}head(){const t=this.SE.next;return t===this.SE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}ME(){const t=this.SE.CE;return t===this.SE?(this.cursor=null,null):(this.cursor=t?.CE||null,t)}next(){const t=this.cursor;return t===this.SE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}CE(){const t=this.cursor;return t===this.SE?(this.cursor=null,null):(this.cursor=t?.CE||null,t)}clear(){for(;;){const t=this.SE.next;if(t===this.SE)return;t?.ww()}}}},1982:(t,i,e)=>{e.d(i,{A:()=>s});class s{key;next;CE;constructor(){this.key=0n,this.next=this,this.CE=this}ww(){this.CE&&this.next&&(this.CE.next=this.next,this.next.CE=this.CE,this.next=null,this.CE=null)}}},2679:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(2512),n=e(7536);class r{kE;DE;history;available;constructor(t){this.kE=t,this.available=t,this.DE=new n.A(1024),this.history=new s.A}get(t){const i=this.DE.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.ww(),t?.bE()}else this.available--;this.DE.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.ww(),t.bE()):this.available=this.kE}}},2512:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n{head;constructor(){this.head=new s.A}push(t){t.vE&&t.bE(),t.vE=this.head.vE,t.EE=this.head,t.vE&&(t.vE.EE=t),t.EE.vE=t}pop(){const t=this.head.EE;return t===this.head?null:(t?.bE(),t)}}},8534:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(3867);class r{static Do=[];static yu=t=>{const i=new s.A(t.read('base_head.dat')),e=new s.A(t.read('base_type.dat')),h=new s.A(t.read('base_label.dat')),o=i.Au;i.pf+=2;for(let t=0;t{e.d(i,{A:()=>r});var s=e(8534),n=e(1069);class r{static Do=[];static yu=t=>{const i=new n.A(t.read('frame_head.dat')),e=new n.A(t.read('frame_tran1.dat')),h=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),l=i.Au;i.pf+=2;const a=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){a[A]=i,c[A]=0,f[A]=0,u[A]=0,A++;break}a[A]=t;let e=0;3===d.types[a[A]]&&(e=128),c[A]=1&i?h.FE:e,f[A]=2&i?h.FE:e,u[A]=4&i?h.FE:e,y=t,A++}}n.length=A,n.BE=new Int32Array(A),n.x=new Int32Array(A),n.y=new Int32Array(A),n.z=new Int32Array(A);for(let t=0;t{e.d(i,{Nc:()=>s,nl:()=>n,PE:()=>o,UE:()=>h,GE:()=>r});const s=document.getElementById('canvas'),n=s.getContext('2d',{willReadFrequently:!0}),r=document.createElement('canvas'),h=document.createElement('img'),o=r.getContext('2d',{willReadFrequently:!0})},9298:(t,i,e)=>{e.d(i,{A:()=>s});class s{static RED=16711680;static GREEN=65280;static BLUE=255;static ql=16776960;static WE=65535;static dm=16711935;static Sl=16777215;static Zl=0;static YE=16748608;static HE=8388608;static VE=128;static KE=16756736;static XE=16740352;static jE=16723968;static zE=12648192;static ZE=8453888;static qE=4259584;static JE=9179409;static $E=6116423;static fl=2301979;static ul=5063219;static wl=7759444;static Al=3353893;static QE=8388736;static tv=13350793;static iv=Int32Array.of(s.ql,s.RED,s.GREEN,s.WE,s.dm,s.Sl);static hC=6798;static oC=107;static lC=10283;static aC=16;static cC=4797;static fC=7744;static uC=5799;static dC=4634;static wC=33697;static yC=22433;static AC=2983;static mC=54193;static pC=8741;static _C=12;static IC=64030;static gC=43162;static CC=7735;static EC=8404;static vC=1701;static bC=38430;static TC=24094;static OC=10153;static RC=56621;static LC=4783;static SC=1341;static xC=16578;static MC=35003;static kC=25239;static Vg=9104;static Kg=10275;static Xg=7595;static jg=3610;static zg=7975;static Zg=8526;static qg=918;static Jg=38802;static $g=24466;static Qg=10145;static tC=58654;static iC=5027;static eC=1457;static sC=16565;static nC=34991;static rC=25486;static DC=4626;static NC=11146;static FC=6439;static BC=12;static PC=4758;static UC=10270;static jC=4574;static GC=4550;static WC=4537;static YC=5681;static HC=5673;static VC=5790;static KC=6806;static XC=8076}},8950:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n extends s.A{static pw=new Int32Array;static _w=0;static Iw=0;static top=0;static bottom=0;static left=0;static right=0;static uI=0;static ev=0;static sv=0;static bind=(t,i,e)=>{this.pw=t,this._w=i,this.Iw=e,this.Tl(0,0,i,e)};static nv=()=>{this.left=0,this.top=0,this.right=this._w,this.bottom=this.Iw,this.uI=this.right-1,this.ev=this.right/2|0};static Tl=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this._w&&(e=this._w),s>this.Iw&&(s=this.Iw),this.top=i,this.bottom=s,this.left=t,this.right=e,this.uI=this.right-1,this.ev=this.right/2|0,this.sv=this.bottom/2|0};static clear=()=>{const t=this._w*this.Iw;for(let i=0;i{this.yl(t,i,n,e),this.yl(t,i+s-1,n,e),this.dl(t,i,n,s),this.dl(t+e-1,i,n,s)};static yl=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this._w;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this._w;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(a-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this._w-e;let h=t+i*this._w;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.pw[h++]=n;h+=r}};static hv(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,l=(n>>8&255)*r,a=(255&n)*r,c=this._w-e;let f=t+i*this._w;for(let t=0;t>16&255)*h>>8<<16)+(l+(this.pw[f]>>8&255)*h>>8<<8)+(a+(255&this.pw[f])*h>>8);this.pw[f++]=t}f+=c}}static ov(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,l=(255&s)*n;let a=i-e;a<0&&(a=0);let c=i+e;c>=this.Iw&&(c=this.Iw-1);for(let s=a;s<=c;s++){const n=s-i,a=0|Math.sqrt(e*e-n*n);let c=t-a;c<0&&(c=0);let f=t+a;f>=this._w&&(f=this._w-1);let u=c+s*this._w;for(let t=c;t<=f;t++){const t=(h+(this.pw[u]>>16&255)*r>>8<<16)+(o+(this.pw[u]>>8&255)*r>>8<<8)+(l+(255&this.pw[u])*r>>8);this.pw[u++]=t}}}static lv=(t,i,e)=>{t=this.right||i=this.bottom||(this.pw[t+i*this._w]=e)}}},4583:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1673),r=e(3867);class h extends s.A{static et=!1;static av=new Int32Array(512);static cv=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static fv=new r.fe(50,null);static uv=0;static mw=new Int32Array;static ya=0;static Aa=0;static gw=!0;static fI=!1;static alpha=0;static dv=null;static wv=new r.fe(50,null);static yv=0;static km=0;static Av=new Int32Array(50);static mv=new r.fe(50,null);static pv=!1;static _v=new r.fe(50,!1);static Iv=new Int32Array(50);static{for(let t=1;t<512;t++)this.av[t]=32768/t|0;for(let t=1;t<2048;t++)this.cv[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static Lo=()=>{this.av=null,this.av=null,this.sin=null,this.cos=null,this.mw=null,this.fv=null,this._v=null,this.Iv=null,this.dv=null,this.wv=null,this.Av=null,this.palette=null,this.mv=null,console.log('Draw3D unloaded!')};static Fc=()=>{this.mw=new Int32Array(s.A.Iw);for(let t=0;t{this.mw=new Int32Array(i);for(let e=0;e{this.dv=null,this.wv.fill(null)};static Ev=t=>{this.uv=0;for(let i=0;i<50;i++)try{this.fv[i]=n.A.xu(t,i.toString()),this.et&&128===this.fv[i]?.Xl?this.fv[i]?.vv():this.fv[i]?.xw(),this.uv++}catch(t){}};static um=t=>{if(0!==this.Iv[t])return this.Iv[t];const i=this.mv[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.bv(h,1.4),0===h&&(h=1),this.Iv[t]=h,h};static Tv=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,l=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let a=s-.3333333333333333;a<0&&a++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*h|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[e++]=this.bv(a,i)}}for(let t=0;t<50;t++){const e=this.fv[t];if(!e)continue;const s=e.palette;this.mv[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static Rv=t=>{this.dv||(this.yv=t,this.et?this.dv=new r.Xr(t,16384):this.dv=new r.Xr(t,65536),this.wv.fill(null))};static AI=(t,i,e,n,r,o,l,a,c)=>{let f=0,u=0;r!==n&&(f=(i-t<<16)/(r-n)|0,u=(a-l<<15)/(r-n)|0);let d=0,w=0;o!==r&&(d=(e-i<<16)/(o-r)|0,w=(c-a<<15)/(o-r)|0);let y=0,A=0;if(o!==n&&(y=(t-e<<16)/(n-o)|0,A=(l-c<<15)/(n-o)|0),n<=r&&n<=o){if(ns.A.bottom&&(r=s.A.bottom),o>s.A.bottom&&(o=s.A.bottom),rd)for(o-=r,r-=n,n=h.mw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Lv(e>>16,i>>16,c>>7,a>>7,s.A.pw,n,0),e+=y,i+=d,c+=A,a+=w,n+=s.A._w}this.Lv(e>>16,t>>16,c>>7,l>>7,s.A.pw,n,0),e+=y,t+=f,c+=A,l+=u,n+=s.A._w}else for(o-=r,r-=n,n=h.mw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Lv(i>>16,e>>16,a>>7,c>>7,s.A.pw,n,0),e+=y,i+=d,c+=A,a+=w,n+=s.A._w}this.Lv(t>>16,e>>16,l>>7,c>>7,s.A.pw,n,0),e+=y,t+=f,c+=A,l+=u,n+=s.A._w}else if(i=t<<=16,a=l<<=15,n<0&&(i-=y*n,t-=f*n,a-=A*n,l-=u*n,n=0),e<<=16,c<<=15,o<0&&(e-=d*o,c-=w*o,o=0),n!==o&&yf)for(r-=o,o-=n,n=h.mw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Lv(e>>16,t>>16,c>>7,l>>7,s.A.pw,n,0),e+=d,t+=f,c+=w,l+=u,n+=s.A._w}this.Lv(i>>16,t>>16,a>>7,l>>7,s.A.pw,n,0),i+=y,t+=f,a+=A,l+=u,n+=s.A._w}else for(r-=o,o-=n,n=h.mw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Lv(t>>16,e>>16,l>>7,c>>7,s.A.pw,n,0),e+=d,t+=f,c+=w,l+=u,n+=s.A._w}this.Lv(t>>16,i>>16,l>>7,a>>7,s.A.pw,n,0),i+=y,t+=f,a+=A,l+=u,n+=s.A._w}}else if(r<=o){if(rs.A.bottom&&(o=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),oy)for(n-=o,o-=r,r=h.mw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Lv(t>>16,e>>16,l>>7,c>>7,s.A.pw,r,0),t+=f,e+=y,l+=u,c+=A,r+=s.A._w}this.Lv(t>>16,i>>16,l>>7,a>>7,s.A.pw,r,0),t+=f,i+=d,l+=u,a+=w,r+=s.A._w}else for(n-=o,o-=r,r=h.mw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Lv(e>>16,t>>16,c>>7,l>>7,s.A.pw,r,0),t+=f,e+=y,l+=u,c+=A,r+=s.A._w}this.Lv(i>>16,t>>16,a>>7,l>>7,s.A.pw,r,0),t+=f,i+=d,l+=u,a+=w,r+=s.A._w}else if(e=i<<=16,c=a<<=15,r<0&&(e-=f*r,i-=d*r,c-=u*r,a-=w*r,r=0),t<<=16,l<<=15,n<0&&(t-=y*n,l-=A*n,n=0),o-=n,n-=r,r=h.mw[r],f>16,i>>16,l>>7,a>>7,s.A.pw,r,0),t+=y,i+=d,l+=A,a+=w,r+=s.A._w}this.Lv(e>>16,i>>16,c>>7,a>>7,s.A.pw,r,0),e+=f,i+=d,c+=u,a+=w,r+=s.A._w}else for(;;){if(--n<0)for(;;){if(--o<0)return;this.Lv(i>>16,t>>16,a>>7,l>>7,s.A.pw,r,0),t+=y,i+=d,l+=A,a+=w,r+=s.A._w}this.Lv(i>>16,e>>16,a>>7,c>>7,s.A.pw,r,0),e+=f,i+=d,c+=u,a+=w,r+=s.A._w}}else if(os.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,a>>7,l>>7,s.A.pw,o,0),i+=d,t+=f,a+=w,l+=u,o+=s.A._w}this.Lv(i>>16,e>>16,a>>7,c>>7,s.A.pw,o,0),i+=d,e+=y,a+=w,c+=A,o+=s.A._w}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Lv(t>>16,i>>16,l>>7,a>>7,s.A.pw,o,0),i+=d,t+=f,a+=w,l+=u,o+=s.A._w}this.Lv(e>>16,i>>16,c>>7,a>>7,s.A.pw,o,0),i+=d,e+=y,a+=w,c+=A,o+=s.A._w}else if(t=e<<=16,l=c<<=15,o<0&&(t-=d*o,e-=y*o,l-=w*o,c-=A*o,o=0),i<<=16,a<<=15,r<0&&(i-=f*r,a-=u*r,r=0),n-=r,r-=o,o=h.mw[o],d>16,e>>16,a>>7,c>>7,s.A.pw,o,0),i+=f,e+=y,a+=u,c+=A,o+=s.A._w}this.Lv(t>>16,e>>16,l>>7,c>>7,s.A.pw,o,0),t+=d,e+=y,l+=w,c+=A,o+=s.A._w}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Lv(e>>16,i>>16,c>>7,a>>7,s.A.pw,o,0),i+=f,e+=y,a+=u,c+=A,o+=s.A._w}this.Lv(e>>16,t>>16,c>>7,l>>7,s.A.pw,o,0),t+=d,e+=y,l+=w,c+=A,o+=s.A._w}};static Lv=(t,i,e,n,r,o,l)=>{let a;if(h.gw){let c;if(h.fI){if(c=i-t>3?(n-e)/(i-t)|0:0,i>s.A.uI&&(i=s.A.uI),t<0&&(e-=t*c,t=0),t>=i)return;o+=t,l=i-t>>2,c<<=2}else{if(!(t>2)>0?(n-e)*h.av[l]>>15:0}if(0===h.alpha)for(;;){if(--l<0){if((l=i-t&3)>0){a=h.palette[e>>8];do{r[o++]=a,l--}while(l>0);return}break}a=h.palette[e>>8],e+=c,r[o++]=a,r[o++]=a,r[o++]=a,r[o++]=a}else{const s=h.alpha,n=256-h.alpha;for(;;){if(--l<0){if((l=i-t&3)>0){a=h.palette[e>>8],a=((16711935&a)*n>>8&16711935)+((65280&a)*n>>8&65280);do{r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),l--}while(l>0)}break}a=h.palette[e>>8],e+=c,a=((16711935&a)*n>>8&16711935)+((65280&a)*n>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280)}}}else if(ts.A.uI&&(i=s.A.uI),t<0&&(e-=t*c,t=0),t>=i))return;if(o+=t,l=i-t,0===h.alpha)do{r[o++]=h.palette[e>>8],e+=c,l--}while(l>0);else{const t=h.alpha,i=256-h.alpha;do{a=h.palette[e>>8],e+=c,a=((16711935&a)*i>>8&16711935)+((65280&a)*i>>8&65280),r[o++]=a+((16711935&r[o])*t>>8&16711935)+((65280&r[o])*t>>8&65280),l--}while(l>0)}}};static Sv=(t,i,e,n,r,h,o)=>{let l=0;r!==n&&(l=(i-t<<16)/(r-n)|0);let a=0;h!==r&&(a=(e-i<<16)/(h-r)|0);let c=0;if(h!==n&&(c=(t-e<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),ra)for(h-=r,r-=n,n=this.mw[n];;){if(--r<0)for(;;){if(--h<0)return;this.xv(e>>16,i>>16,s.A.pw,n,o),e+=c,i+=a,n+=s.A._w}this.xv(e>>16,t>>16,s.A.pw,n,o),e+=c,t+=l,n+=s.A._w}else for(h-=r,r-=n,n=this.mw[n];;){if(--r<0)for(;;){if(--h<0)return;this.xv(i>>16,e>>16,s.A.pw,n,o),e+=c,i+=a,n+=s.A._w}this.xv(t>>16,e>>16,s.A.pw,n,o),e+=c,t+=l,n+=s.A._w}else if(i=t<<=16,n<0&&(i-=c*n,t-=l*n,n=0),e<<=16,h<0&&(e-=a*h,h=0),n!==h&&cl)for(r-=h,h-=n,n=this.mw[n];;){if(--h<0)for(;;){if(--r<0)return;this.xv(e>>16,t>>16,s.A.pw,n,o),e+=a,t+=l,n+=s.A._w}this.xv(i>>16,t>>16,s.A.pw,n,o),i+=c,t+=l,n+=s.A._w}else for(r-=h,h-=n,n=this.mw[n];;){if(--h<0)for(;;){if(--r<0)return;this.xv(t>>16,e>>16,s.A.pw,n,o),e+=a,t+=l,n+=s.A._w}this.xv(t>>16,i>>16,s.A.pw,n,o),i+=c,t+=l,n+=s.A._w}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hc)for(n-=h,h-=r,r=this.mw[r];;){if(--h<0)for(;;){if(--n<0)return;this.xv(t>>16,e>>16,s.A.pw,r,o),t+=l,e+=c,r+=s.A._w}this.xv(t>>16,i>>16,s.A.pw,r,o),t+=l,i+=a,r+=s.A._w}else for(n-=h,h-=r,r=this.mw[r];;){if(--h<0)for(;;){if(--n<0)return;this.xv(e>>16,t>>16,s.A.pw,r,o),t+=l,e+=c,r+=s.A._w}this.xv(i>>16,t>>16,s.A.pw,r,o),t+=l,i+=a,r+=s.A._w}else if(e=i<<=16,r<0&&(e-=l*r,i-=a*r,r=0),t<<=16,n<0&&(t-=c*n,n=0),l>16,i>>16,s.A.pw,r,o),t+=c,i+=a,r+=s.A._w}this.xv(e>>16,i>>16,s.A.pw,r,o),e+=l,i+=a,r+=s.A._w}else for(h-=n,n-=r,r=this.mw[r];;){if(--n<0)for(;;){if(--h<0)return;this.xv(i>>16,t>>16,s.A.pw,r,o),t+=c,i+=a,r+=s.A._w}this.xv(i>>16,e>>16,s.A.pw,r,o),e+=l,i+=a,r+=s.A._w}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.pw,h,o),i+=a,t+=l,h+=s.A._w}this.xv(i>>16,e>>16,s.A.pw,h,o),i+=a,e+=c,h+=s.A._w}else for(r-=n,n-=h,h=this.mw[h];;){if(--n<0)for(;;){if(--r<0)return;this.xv(t>>16,i>>16,s.A.pw,h,o),i+=a,t+=l,h+=s.A._w}this.xv(e>>16,i>>16,s.A.pw,h,o),i+=a,e+=c,h+=s.A._w}else if(t=e<<=16,h<0&&(t-=a*h,e-=c*h,h=0),i<<=16,r<0&&(i-=l*r,r=0),a>16,e>>16,s.A.pw,h,o),i+=l,e+=c,h+=s.A._w}this.xv(t>>16,e>>16,s.A.pw,h,o),t+=a,e+=c,h+=s.A._w}else for(n-=r,r-=h,h=this.mw[h];;){if(--r<0)for(;;){if(--n<0)return;this.xv(e>>16,i>>16,s.A.pw,h,o),i+=l,e+=c,h+=s.A._w}this.xv(e>>16,t>>16,s.A.pw,h,o),t+=a,e+=c,h+=s.A._w}};static II=(t,i,e,n,r,h,o,l,a,c,f,u,d,w,y,A,m,p,_)=>{const I=this.Mv(_);this.pv=!this._v[_];const g=c-d,C=f-y,E=u-m,v=w-c,b=A-f,T=p-u;let O=v*f-b*c<<14;const R=b*u-T*f<<8,L=T*c-v*u<<5;let S=g*f-C*c<<14;const x=C*u-E*f<<8,M=E*c-g*u<<5;let k=C*v-g*b<<14;const D=E*b-C*T<<8,N=g*T-E*v<<5;let F=0,B=0;r!==n&&(F=(i-t<<16)/(r-n)|0,B=(l-o<<16)/(r-n)|0);let P=0,U=0;h!==r&&(P=(e-i<<16)/(h-r)|0,U=(a-l<<16)/(h-r)|0);let G=0,W=0;if(h!==n&&(G=(t-e<<16)/(n-h)|0,W=(o-a<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),rP)for(h-=r,r-=n,n=this.mw[n];;){if(--r<0)for(;;){if(--h<0)return;this.kv(e>>16,i>>16,s.A.pw,n,I,0,0,O,S,k,R,x,D,a>>8,l>>8),e+=G,i+=P,a+=W,l+=U,n+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(e>>16,t>>16,s.A.pw,n,I,0,0,O,S,k,R,x,D,a>>8,o>>8),e+=G,t+=F,a+=W,o+=B,n+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(h-=r,r-=n,n=this.mw[n];;){if(--r<0)for(;;){if(--h<0)return;this.kv(i>>16,e>>16,s.A.pw,n,I,0,0,O,S,k,R,x,D,l>>8,a>>8),e+=G,i+=P,a+=W,l+=U,n+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(t>>16,e>>16,s.A.pw,n,I,0,0,O,S,k,R,x,D,o>>8,a>>8),e+=G,t+=F,a+=W,o+=B,n+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}else{i=t<<=16,l=o<<=16,n<0&&(i-=G*n,t-=F*n,l-=W*n,o-=B*n,n=0),e<<=16,a<<=16,h<0&&(e-=P*h,a-=U*h,h=0);const c=n-this.Aa;if(O+=L*c,S+=M*c,k+=N*c,O|=0,S|=0,k|=0,(n===h||G>=F)&&(n!==h||P<=F))for(r-=h,h-=n,n=this.mw[n];;){if(--h<0)for(;;){if(--r<0)return;this.kv(t>>16,e>>16,s.A.pw,n,I,0,0,O,S,k,R,x,D,o>>8,a>>8),e+=P,t+=F,a+=U,o+=B,n+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(t>>16,i>>16,s.A.pw,n,I,0,0,O,S,k,R,x,D,o>>8,l>>8),i+=G,t+=F,l+=W,o+=B,n+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(r-=h,h-=n,n=this.mw[n];;){if(--h<0)for(;;){if(--r<0)return;this.kv(e>>16,t>>16,s.A.pw,n,I,0,0,O,S,k,R,x,D,a>>8,o>>8),e+=P,t+=F,a+=U,o+=B,n+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(i>>16,t>>16,s.A.pw,n,I,0,0,O,S,k,R,x,D,l>>8,o>>8),i+=G,t+=F,l+=W,o+=B,n+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hG)for(n-=h,h-=r,r=this.mw[r];;){if(--h<0)for(;;){if(--n<0)return;this.kv(t>>16,e>>16,s.A.pw,r,I,0,0,O,S,k,R,x,D,o>>8,a>>8),t+=F,e+=G,o+=B,a+=W,r+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(t>>16,i>>16,s.A.pw,r,I,0,0,O,S,k,R,x,D,o>>8,l>>8),t+=F,i+=P,o+=B,l+=U,r+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(n-=h,h-=r,r=this.mw[r];;){if(--h<0)for(;;){if(--n<0)return;this.kv(e>>16,t>>16,s.A.pw,r,I,0,0,O,S,k,R,x,D,a>>8,o>>8),t+=F,e+=G,o+=B,a+=W,r+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(i>>16,t>>16,s.A.pw,r,I,0,0,O,S,k,R,x,D,l>>8,o>>8),t+=F,i+=P,o+=B,l+=U,r+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}else{e=i<<=16,a=l<<=16,r<0&&(e-=F*r,i-=P*r,a-=B*r,l-=U*r,r=0),t<<=16,o<<=16,n<0&&(t-=G*n,o-=W*n,n=0);const c=r-this.Aa;if(O+=L*c,S+=M*c,k+=N*c,O|=0,S|=0,k|=0,h-=n,n-=r,r=this.mw[r],F>16,i>>16,s.A.pw,r,I,0,0,O,S,k,R,x,D,o>>8,l>>8),t+=G,i+=P,o+=W,l+=U,r+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(e>>16,i>>16,s.A.pw,r,I,0,0,O,S,k,R,x,D,a>>8,l>>8),e+=F,i+=P,a+=B,l+=U,r+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--h<0)return;this.kv(i>>16,t>>16,s.A.pw,r,I,0,0,O,S,k,R,x,D,l>>8,o>>8),t+=G,i+=P,o+=W,l+=U,r+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(i>>16,e>>16,s.A.pw,r,I,0,0,O,S,k,R,x,D,l>>8,a>>8),e+=F,i+=P,a+=B,l+=U,r+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.pw,h,I,0,0,O,S,k,R,x,D,l>>8,o>>8),i+=P,t+=F,l+=U,o+=B,h+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(i>>16,e>>16,s.A.pw,h,I,0,0,O,S,k,R,x,D,l>>8,a>>8),i+=P,e+=G,l+=U,a+=W,h+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.kv(t>>16,i>>16,s.A.pw,h,I,0,0,O,S,k,R,x,D,o>>8,l>>8),i+=P,t+=F,l+=U,o+=B,h+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(e>>16,i>>16,s.A.pw,h,I,0,0,O,S,k,R,x,D,a>>8,l>>8),i+=P,e+=G,l+=U,a+=W,h+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}else{t=e<<=16,o=a<<=16,h<0&&(t-=P*h,e-=G*h,o-=U*h,a-=W*h,h=0),i<<=16,l<<=16,r<0&&(i-=F*r,l-=B*r,r=0);const c=h-this.Aa;if(O+=L*c,S+=M*c,k+=N*c,O|=0,S|=0,k|=0,n-=r,r-=h,h=this.mw[h],P>16,e>>16,s.A.pw,h,I,0,0,O,S,k,R,x,D,l>>8,a>>8),i+=F,e+=G,l+=B,a+=W,h+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(t>>16,e>>16,s.A.pw,h,I,0,0,O,S,k,R,x,D,o>>8,a>>8),t+=P,e+=G,o+=U,a+=W,h+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.kv(e>>16,i>>16,s.A.pw,h,I,0,0,O,S,k,R,x,D,a>>8,l>>8),i+=F,e+=G,l+=B,a+=W,h+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(e>>16,t>>16,s.A.pw,h,I,0,0,O,S,k,R,x,D,a>>8,o>>8),t+=P,e+=G,o+=U,a+=W,h+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}};static kv=(t,i,e,n,r,h,o,l,a,c,f,u,d,w,y)=>{if(t>=i)return;let A,m,p,_,I,g,C,E,v;if(this.fI){if(A=(y-w)/(i-t)|0,i>s.A.uI&&(i=s.A.uI),t<0&&(w-=t*A,t=0),t>=i)return;m=i-t>>3,A<<=12}else i-t>7?(m=i-t>>3,A=(y-w)*this.av[m]>>6):(m=0,A=0);if(w<<=9,n+=t,this.et&&r)if(p=0,_=0,g=t-this.ya,l+=(f>>3)*g,a+=(u>>3)*g,c+=(d>>3)*g,l|=0,a|=0,I=(c|=0)>>12,0!==I&&(o=a/I|0,(h=l/I|0)<0?h=0:h>4032&&(h=4032)),l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>12,0!==I&&(p=l/I|0,_=a/I|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=_-o>>3,h+=w>>3&786432,v=w>>23,this.pv){for(;m-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h=p,o=_,l+=f,a+=u,I=(c+=d)>>12,0!==I&&(p=l/I|0,_=a/I|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=_-o>>3,h+=(w+=A)>>3&786432,v=w>>23;for(m=i-t&7;m-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E}else{for(;m-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n+=1,h=p,o=_,l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>12,0!==I&&(p=l/I|0,_=a/I|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=_-o>>3,h+=(w+=A)>>3&786432,v=w>>23}for(m=i-t&7;m-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}else if(p=0,_=0,g=t-this.ya,l+=(f>>3)*g,a+=(u>>3)*g,c+=(d>>3)*g,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(o=a/I|0,(h=l/I|0)<0?h=0:h>16256&&(h=16256)),l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(p=l/I|0,_=a/I|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=_-o>>3,h+=6291456&w,v=w>>23,this.pv&&r){for(;m-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h=p,o=_,l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(p=l/I|0,_=a/I|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=_-o>>3,h+=6291456&(w+=A),v=w>>23;for(m=i-t&7;m-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E}else{for(;m-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,h=p,o=_,l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(p=l/I|0,_=a/I|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=_-o>>3,h+=6291456&(w+=A),v=w>>23}for(m=i-t&7;m-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}};static xv=(t,i,e,n,r)=>{if(this.fI&&(i>s.A.uI&&(i=s.A.uI),t<0&&(t=0)),t>=i)return;n+=t;let h=i-t>>2;if(0===this.alpha)for(;;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;e[n++]=r}e[n++]=r,e[n++]=r,e[n++]=r,e[n++]=r}const o=this.alpha,l=256-this.alpha;for(r=((16711935&r)*l>>8&16711935)+((65280&r)*l>>8&65280);;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}};static Ov=t=>{this.wv[t]&&this.dv&&(this.dv[this.yv++]=this.wv[t],this.wv[t]=null)};static Mv=t=>{if(this.Av[t]=this.km++,this.wv[t])return this.wv[t];let i;if(this.yv>0&&this.dv)i=this.dv[--this.yv],this.dv[this.yv]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.pw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.pw[t]];this._v[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this._v[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}},880:(t,i,e)=>{e.d(i,{r:()=>n});var s=e(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(s.UE.src),s.UE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>s.UE.onload=()=>t())),s.PE.clearRect(0,0,s.GE.width,s.GE.height);const i=s.UE.naturalWidth,e=s.UE.naturalHeight;return s.GE.width=i,s.GE.height=e,s.PE.drawImage(s.UE,0,0),s.PE.getImageData(0,0,i,e)}},8665:(t,i,e)=>{e.d(i,{A:()=>f});var s=e(1069),n=e(8950),r=e(4583),h=e(6730),o=e(4474),l=e(3867);class a{Fd=0;b_=0;Dv=0;Nv=-1;Fv=-1;Bv=-1;Pv=-1;Uv=-1;Gv=-1;Wv=-1;Yv=-1;Hv=-1;Vv=0;Kv=-1;Xv=-1;jv=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static zv=null;static Zv=null;static qv=null;static Jv=null;static $v=null;static Qv=null;static tb=null;static ib=null;static eb=null;static sb=null;static nb=null;static rb=null;static axis=null;static hb=new l.fe(4096,!1);static ob=new l.fe(4096,!1);static lb=new Int32Array(4096);static ab=new Int32Array(4096);static cb=new Int32Array(4096);static fb=new Int32Array(4096);static ub=new Int32Array(4096);static wb=new Int32Array(4096);static yb=new Int32Array(1500);static Ab=new l.Xr(1500,512);static mb=new Int32Array(12);static pb=new l.Xr(12,2e3);static _b=new Int32Array(2e3);static Ib=new Int32Array(2e3);static gb=new Int32Array(12);static Cb=new Int32Array(10);static Eb=new Int32Array(10);static vb=new Int32Array(10);static Ir=0;static bb=0;static gr=0;static Tb=!1;static Hl=0;static Vl=0;static Ob=0;static Rb=new Int32Array(1e3);static Lb=!1;static yu(t){try{f.head=new s.A(t.read('ob_head.dat')),f.zv=new s.A(t.read('ob_face1.dat')),f.Zv=new s.A(t.read('ob_face2.dat')),f.qv=new s.A(t.read('ob_face3.dat')),f.Jv=new s.A(t.read('ob_face4.dat')),f.$v=new s.A(t.read('ob_face5.dat')),f.Qv=new s.A(t.read('ob_point1.dat')),f.tb=new s.A(t.read('ob_point2.dat')),f.ib=new s.A(t.read('ob_point3.dat')),f.eb=new s.A(t.read('ob_point4.dat')),f.sb=new s.A(t.read('ob_point5.dat')),f.nb=new s.A(t.read('ob_vertex1.dat')),f.rb=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.pf=0,f.Qv.pf=0,f.tb.pf=0,f.ib.pf=0,f.eb.pf=0,f.nb.pf=0,f.rb.pf=0;const i=f.head.Au;f.metadata=new l.fe(i+100,null);let e=0,n=0,r=0,h=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Nd=(t,i,e)=>{const s=t.Fd,n=t.b_,r=t.Dv;let h,o,a,u,d;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.Fd,r=t.b_,h=t.Dv;let o,l,a,c,u;if(s)o=t.Bd,l=t.Ud,a=t.Pd;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let i=0;i{const e=t.Fd,s=t.b_,n=t.Dv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.Bd[i],a=t.Ud[i],c=t.Pd[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.zv&&f.Zv&&f.qv&&f.Jv&&f.$v&&f.Qv&&f.tb&&f.ib&&f.eb&&f.sb&&f.nb&&f.rb&&f.axis))throw new Error('cant loading model!!!!!');const e=i.Fd,s=i.b_,n=i.Dv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),l=new Int32Array(s),a=new Int32Array(s),c=new Int32Array(s),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;i.Uv>=0&&(y=new Int32Array(e));let A=null;i.Hv>=0&&(A=new Int32Array(s));let m=null,p=0;i.Vv>=0?m=new Int32Array(s):p=-i.Vv-1;let _=null;i.Kv>=0&&(_=new Int32Array(s));let I=null;i.Xv>=0&&(I=new Int32Array(s));const g=new Int32Array(s);f.Qv.pf=i.Nv,f.tb.pf=i.Fv,f.ib.pf=i.Bv,f.eb.pf=i.Pv,f.sb.pf=i.Uv;let C,E,v,b=0,T=0,O=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const e=f.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const n=e.Fd,r=e.b_,h=e.Dv,o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n),c=new Int32Array(r),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(h),y=new Int32Array(h),A=new Int32Array(h);let m=null;e.Uv>=0&&(m=new Int32Array(n));let p=null;e.Hv>=0&&(p=new Int32Array(r));let _=null,I=0;e.Vv>=0?_=new Int32Array(r):I=-e.Vv-1;let g=null;e.Kv>=0&&(g=new Int32Array(r));let C=null;e.Xv>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(e.data);v.pf=e.Nv;const b=new s.A(e.data);b.pf=e.Fv;const T=new s.A(e.data);T.pf=e.Bv;const O=new s.A(e.data);O.pf=e.Pv;const R=new s.A(e.data);R.pf=e.Uv;let L,S,x,M=0,k=0,D=0;for(let t=0;tthis.jd&&(this.jd=-e),e>this.__&&(this.__=e);const n=i*i+s*s;n>this.Em&&(this.Em=n)}this.Em=Math.sqrt(this.Em)+.99|0,this.Wb=Math.sqrt(this.Em*this.Em+this.jd*this.jd)+.99|0,this.Gb=this.Wb+(Math.sqrt(this.Em*this.Em+this.__*this.__)+.99|0)}Gd(){this.jd=0,this.__=0;for(let t=0;tthis.jd&&(this.jd=-i),i>this.__&&(this.__=i)}this.Wb=Math.sqrt(this.Em*this.Em+this.jd*this.jd)+.99|0,this.Gb=this.Wb+(Math.sqrt(this.Em*this.Em+this.__*this.__)+.99|0)}Wa(){if(this.Yb){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Vd=new l.fe(i+1,null);for(let e=0;e<=i;e++)this.Vd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Hd=new l.fe(i+1,null);for(let e=0;e<=i;e++)this.Hd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;el;)l=e[o++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==l||0===r.types[i])&&this.jb(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}f.Ir=0,f.bb=0,f.gr=0,o=0,l=e[o++];for(let t=0;tl;)l=e[o++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===l||0===r.types[i])&&this.jb(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.Ya(t)}Ya(t){if(!this.Vd||-1===t||!h.A.Do[t])return;const i=h.A.Do[t],e=i.NE;f.Ir=0,f.bb=0,f.gr=0;for(let t=0;t>16;this.Pd[t]=this.Ud[t]*i+this.Pd[t]*e>>16,this.Ud[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.Mb&&this.kb&&this.Db||(this.Mb=new Int32Array(this.b_),this.kb=new Int32Array(this.b_),this.Db=new Int32Array(this.b_)),!this.f_){this.f_=new l.fe(this.Fd,null);for(let t=0;t8192||m>8192||p>8192||A<-8192||m<-8192||p<-8192;)A>>=1,m>>=1,p>>=1;let _=0|Math.sqrt(A*A+m*m+p*p);if(_<=0&&(_=1),A=256*A/_|0,m=256*m/_|0,p=256*p/_|0,this.v_&&1&this.v_[i]){const r=t+((e*A+s*m+n*p)/(h+(h/2|0))|0);this.Mu&&(this.Mb[i]=f.xb(this.Mu[i],r,this.v_[i]))}else{let t=this.f_[r];t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.f_[o],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.f_[l],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++)}}if(r)this.w_(t,h,e,s,n);else{this.p_=new l.fe(this.Fd,null);for(let t=0;t>16;for(let s=0;s>16,I=I*w-_*d>>16,_=p),0!==t&&(p=I*a-g*l>>16,g=I*l+g*a>>16,I=p),0!==i&&(p=g*c+_*u>>16,g=g*u-_*c>>16,_=p),_+=n,I+=h,g+=o,p=I*A-g*y>>16,g=I*y+g*A>>16,I=p,f.lb&&f.ab&&f.cb&&(f.cb[s]=g-m,f.lb[s]=r.A.ya+((_<<9)/g|0),f.ab[s]=r.A.Aa+((I<<9)/g|0)),this.Dv>0&&f.fb&&f.ub&&f.wb&&(f.fb[s]=_,f.ub[s]=I,f.wb[s]=g)}try{this.qb(!1,!1,0)}catch(t){}}draw(t,i,e,s,h,o,l,a,c){const u=a*h-o*s>>16,d=l*i+u*e>>16,w=this.Em*e>>16,y=d+w;if(y<=50||d>=3500)return;const A=a*s+o*h>>16;let m=A-this.Em<<9;if((m/y|0)>=n.A.ev)return;let p=A+this.Em<<9;if((p/y|0)<=-n.A.ev)return;const _=l*e-u*i>>16,I=this.Em*i>>16;let g=_+I<<9;if((g/y|0)<=-n.A.sv)return;let C=_-(I+(this.jd*e>>16))<<9;if((C/y|0)>=n.A.sv)return;let E=d-(w+(this.jd*i>>16))<=50,v=!1;if(c>0&&f.Tb){let t=d-w;t<=50&&(t=50),A>0?(m=m/y|0,p=p/t|0):(p=p/y|0,m=m/t|0),_>0?(C=C/y|0,g=g/t|0):(g=g/y|0,C=C/t|0);const i=f.Hl-r.A.ya,e=f.Vl-r.A.Aa;i>m&&iC&&e>16,w=w*R-c*O>>16,c=r),c+=o,u+=l,w+=a,r=w*s+c*h>>16,w=w*h-c*s>>16,c=r,r=u*e-w*i>>16,w=u*i+w*e>>16,u=r,f.cb&&(f.cb[n]=w-d),w>=50&&f.lb&&f.ab?(f.lb[n]=b+((c<<9)/w|0),f.ab[n]=T+((u<<9)/w|0)):f.lb&&(f.lb[n]=-5e3,E=!0),(E||this.Dv>0)&&f.fb&&f.ub&&f.wb&&(f.fb[n]=c,f.ub[n]=u,f.wb[n]=w)}try{this.qb(E,v,c)}catch(t){}}qb(t,i,e,s=!1){f.Lb&&(this.Kb=-1,this.Xb=-1);for(let t=0;tn.A.uI||a>n.A.uI||c>n.A.uI),f.Ab&&f.yb){const t=((y+A+m)/3|0)+this.Wb;f.Ab[t][f.yb[t]++]=s,f.Lb&&this.Jb(f.Hl,f.Vl,u,d,w,l,a,c)&&this.Xb=0;t--){const i=f.yb[t];if(!(i<=0)&&f.Ab){const e=f.Ab[t];for(let t=0;t=0;t--){const i=f.yb[t];if(i>0&&f.Ab){const e=f.Ab[t];for(let s=0;s0||f.mb[2]>0)&&(r=(f.gb[1]+f.gb[2])/(f.mb[1]+f.mb[2])|0);let h=0;f.mb&&f.gb&&(f.mb[3]>0||f.mb[4]>0)&&(h=(f.gb[3]+f.gb[4])/(f.mb[3]+f.mb[4])|0);let o=0;if(f.mb&&f.gb&&(f.mb[6]>0||f.mb[8]>0)&&(o=(f.gb[6]+f.gb[8])/(f.mb[6]+f.mb[8])|0),f.mb&&f.pb){let t,i=0,e=f.mb[10],n=f.pb[10],l=f._b;i===e&&(i=0,e=f.mb[11],n=f.pb[11],l=f.Ib),t=ir;)try{this.$b(n[i++],s),i===e&&n!==f.pb[11]&&(i=0,e=f.mb[11],n=f.pb[11],l=f.Ib),t=ih;)try{this.$b(n[i++],s),i===e&&n!==f.pb[11]&&(i=0,e=f.mb[11],n=f.pb[11],l=f.Ib),t=io;)try{this.$b(n[i++],s),i===e&&n!==f.pb[11]&&(i=0,e=f.mb[11],n=f.pb[11],l=f.Ib),t=i>2,h=this.Bb[i],o=this.Pb[i],l=this.Ub[i];r.A.II(f.lb[e],f.lb[s],f.lb[n],f.ab[e],f.ab[s],f.ab[n],this.Mb[t],this.kb[t],this.Db[t],f.fb[h],f.ub[h],f.wb[h],f.fb[o],f.fb[l],f.ub[o],f.ub[l],f.wb[o],f.wb[l],this.Mu[t])}else if(3===h&&this.v_&&this.Mu&&this.Mb&&f.lb&&f.ab&&f.fb&&f.ub&&f.wb){const i=this.v_[t]>>2,h=this.Bb[i],o=this.Pb[i],l=this.Ub[i];r.A.II(f.lb[e],f.lb[s],f.lb[n],f.ab[e],f.ab[s],f.ab[n],this.Mb[t],this.Mb[t],this.Mb[t],f.fb[h],f.ub[h],f.wb[h],f.fb[o],f.fb[l],f.ub[o],f.ub[l],f.wb[o],f.wb[l],this.Mu[t])}}Qb(t,i=!1){let e=0;if(f.wb){const i=r.A.ya,s=r.A.Aa,n=this.T_[t],h=this.O_[t],o=this.R_[t],l=f.wb[n],a=f.wb[h],c=f.wb[o];if(l>=50&&f.lb&&f.ab&&this.Mb)f.Cb[e]=f.lb[n],f.Eb[e]=f.ab[n],f.vb[e++]=this.Mb[t];else if(f.fb&&f.ub&&this.Mb){const u=f.fb[n],d=f.ub[n],w=this.Mb[t];if(c>=50&&this.Db){const n=(50-l)*r.A.cv[c-l];f.Cb[e]=i+((u+((f.fb[o]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[o]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.Db[t]-w)*n>>16)}if(a>=50&&this.kb){const n=(50-l)*r.A.cv[a-l];f.Cb[e]=i+((u+((f.fb[h]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[h]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.kb[t]-w)*n>>16)}}if(a>=50&&f.lb&&f.ab&&this.kb)f.Cb[e]=f.lb[h],f.Eb[e]=f.ab[h],f.vb[e++]=this.kb[t];else if(f.fb&&f.ub&&this.kb){const u=f.fb[h],d=f.ub[h],w=this.kb[t];if(l>=50&&this.Mb){const h=(50-a)*r.A.cv[l-a];f.Cb[e]=i+((u+((f.fb[n]-u)*h>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[n]-d)*h>>16)<<9)/50|0),f.vb[e++]=w+((this.Mb[t]-w)*h>>16)}if(c>=50&&this.Db){const n=(50-a)*r.A.cv[c-a];f.Cb[e]=i+((u+((f.fb[o]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[o]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.Db[t]-w)*n>>16)}}if(c>=50&&f.lb&&f.ab&&this.Db)f.Cb[e]=f.lb[o],f.Eb[e]=f.ab[o],f.vb[e++]=this.Db[t];else if(f.fb&&f.ub&&this.Db){const u=f.fb[o],d=f.ub[o],w=this.Db[t];if(a>=50&&this.kb){const n=(50-c)*r.A.cv[a-c];f.Cb[e]=i+((u+((f.fb[h]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[h]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.kb[t]-w)*n>>16)}if(l>=50&&this.Mb){const h=(50-c)*r.A.cv[l-c];f.Cb[e]=i+((u+((f.fb[n]-u)*h>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[n]-d)*h>>16)<<9)/50|0),f.vb[e++]=w+((this.Mb[t]-w)*h>>16)}}}const s=f.Cb[0],h=f.Cb[1],o=f.Cb[2],l=f.Eb[0],a=f.Eb[1],c=f.Eb[2];if(!((s-h)*(c-a)-(l-a)*(o-h)<=0))if(r.A.fI=!1,3===e){let e;if((s<0||h<0||o<0||s>n.A.uI||h>n.A.uI||o>n.A.uI)&&(r.A.fI=!0),e=this.v_?3&this.v_[t]:0,i)r.A.rv(s,h,l,a,f.vb[0]),r.A.rv(h,o,a,c,f.vb[1]),r.A.rv(o,s,c,l,f.vb[2]);else if(0===e)r.A.AI(s,h,o,l,a,c,f.vb[0],f.vb[1],f.vb[2]);else if(1===e&&this.Mb)r.A.Sv(s,h,o,l,a,c,r.A.palette[this.Mb[t]]);else if(2===e&&this.v_&&this.Mu&&f.fb&&f.ub&&f.wb){const i=this.v_[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.II(s,h,o,l,a,c,f.vb[0],f.vb[1],f.vb[2],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t])}else if(3===e&&this.v_&&this.Mu&&this.Mb&&f.fb&&f.ub&&f.wb){const i=this.v_[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.II(s,h,o,l,a,c,this.Mb[t],this.Mb[t],this.Mb[t],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t])}}else if(4===e){let e;if((s<0||h<0||o<0||s>n.A.uI||h>n.A.uI||o>n.A.uI||f.Cb[3]<0||f.Cb[3]>n.A.uI)&&(r.A.fI=!0),e=this.v_?3&this.v_[t]:0,i)r.A.rv(s,h,l,a,f.vb[0]),r.A.rv(h,o,a,c,f.vb[1]),r.A.rv(o,f.Cb[3],c,f.Eb[3],f.vb[2]),r.A.rv(f.Cb[3],s,f.Eb[3],l,f.vb[3]);else if(0===e)r.A.AI(s,h,o,l,a,c,f.vb[0],f.vb[1],f.vb[2]),r.A.AI(s,o,f.Cb[3],l,c,f.Eb[3],f.vb[0],f.vb[2],f.vb[3]);else if(1===e){if(this.Mb){const i=r.A.palette[this.Mb[t]];r.A.Sv(s,h,o,l,a,c,i),r.A.Sv(s,o,f.Cb[3],l,c,f.Eb[3],i)}}else if(2===e&&this.v_&&this.Mu&&f.fb&&f.ub&&f.wb){const i=this.v_[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.II(s,h,o,l,a,c,f.vb[0],f.vb[1],f.vb[2],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t]),r.A.II(s,o,f.Cb[3],l,c,f.Eb[3],f.vb[0],f.vb[2],f.vb[3],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t])}else if(3===e&&this.v_&&this.Mu&&this.Mb&&f.fb&&f.ub&&f.wb){const i=this.v_[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.II(s,h,o,l,a,c,this.Mb[t],this.Mb[t],this.Mb[t],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t]),r.A.II(s,o,f.Cb[3],l,c,f.Eb[3],this.Mb[t],this.Mb[t],this.Mb[t],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t])}}}jb(t,i,e,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f.Ir=0,f.bb=0,f.gr=0;for(let t=0;t0?(f.Ir=(f.Ir/n|0)+t,f.bb=(f.bb/n|0)+i,f.gr=(f.gr/n|0)+e):(f.Ir=t,f.bb=i,f.gr=e)}else if(1===n)for(let n=0;n=this.Vd.length)continue;const h=this.Vd[r];if(h)for(let s=0;s=this.Vd.length)continue;const o=this.Vd[h];if(o)for(let s=0;s>16;this.Ud[n]=this.Ud[n]*u-this.Bd[n]*c>>16,this.Bd[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.Ud[n]*u-this.Pd[n]*c>>16;this.Pd[n]=this.Ud[n]*c+this.Pd[n]*u>>16,this.Ud[n]=t}if(0!==l){c=r.A.sin[l],u=r.A.cos[l];const t=this.Pd[n]*c+this.Bd[n]*u>>16;this.Pd[n]=this.Pd[n]*u-this.Bd[n]*c>>16,this.Bd[n]=t}this.Bd[n]+=f.Ir,this.Ud[n]+=f.bb,this.Pd[n]+=f.gr}}else if(3===n)for(let n=0;n=this.Vd.length)continue;const h=this.Vd[r];if(h)for(let s=0;s=this.Hd.length)continue;const n=this.Hd[e];if(n)for(let i=0;i255&&(this.Fb[e]=255)}}}Zb(){this.jd=0,this.Em=0,this.__=0,this.I_=999999,this.g_=-999999,this.E_=-99999,this.C_=99999;for(let t=0;tthis.g_&&(this.g_=i),sthis.E_&&(this.E_=s),-e>this.jd&&(this.jd=-e),e>this.__&&(this.__=e);const n=i*i+s*s;n>this.Em&&(this.Em=n)}this.Em=0|Math.sqrt(this.Em),this.Wb=0|Math.sqrt(this.Em*this.Em+this.jd*this.jd),this.Gb=this.Wb+(0|Math.sqrt(this.Em*this.Em+this.__*this.__))}Jb(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{e.d(i,{A:()=>o});var s=e(8950),n=e(1069),r=e(4474),h=e(880);class o extends r.A{pw;width;height;iT;eT;Xl;dw;constructor(t,i){super(),this.pw=new Int32Array(t*i),this.width=this.Xl=t,this.height=this.dw=i,this.iT=this.eT=0}static sT=async(t,i)=>{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(0,h.r)(e),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),l=n.pw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static xu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.pf=s.Au;const h=r.Au,l=r.Au,a=[],c=r.pu-1;for(let t=0;ts.length||r.pf>r.length)throw new Error;const f=r.pu,u=r.pu,d=r.Au,w=r.Au,y=new o(d,w);y.iT=f,y.eT=u,y.Xl=h,y.dw=l;const A=r.pu;if(0===A){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.nT(h,r,this.pw,n,l,s.A.pw,e,o)}Kl(t,i,e){i|=0,e|=0;let n=(i+=this.iT)+(e+=this.eT)*s.A._w,r=0,h=this.height,o=this.width,l=s.A._w-o,a=0;if(es.A.bottom&&(h-=e+h-s.A.bottom),is.A.right){const t=i+o-s.A.right;o-=t,a+=t,l+=t}o>0&&h>0&&this.rT(o,h,this.pw,r,a,s.A.pw,n,l,t)}hT(t,i){t|=0,i|=0;let e=(t+=this.iT)+(i+=this.eT)*s.A._w,n=0,r=this.height,h=this.width,o=s.A._w-h,l=0;if(is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.oT(h,r,this.pw,n,l,s.A.pw,e,o)}lT(){const t=this.pw,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.pw[s]=(r<<16)+(h<<8)+o}}}xw(t,i,e,n){t|=0,i|=0,e|=0,n|=0;try{const r=this.width;let h=0,o=0;const l=this.Xl,a=this.dw,c=(l<<16)/e|0,f=(a<<16)/n|0;t+=(this.iT*e+l-1)/l|0,i+=(this.eT*n+a-1)/a|0,this.iT*e%l!=0&&(h=(l-this.iT*e%l<<16)/e|0),this.eT*n%a!=0&&(o=(a-this.eT*n%a<<16)/n|0),e=e*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u=t+i*s.A._w,d=s.A._w-e;if(is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right){const i=t+e-s.A.right;e-=i,d+=i}this.scale(e,n,this.pw,h,o,s.A.pw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}cT(t,i,e,n,r,h,o,l,a,c){t|=0,i|=0,e|=0,n|=0;try{const f=-e/2|0,u=-n/2|0,d=65536*Math.sin(a/326.11)|0,w=65536*Math.cos(a/326.11)|0,y=d*c>>8,A=w*c>>8;let m=(o<<16)+u*y+f*A,p=u*A-f*y+(l<<16),_=t+i*s.A._w;for(let t=0;t>16)+(o>>16)*this.width],n+=A,o-=y;m+=y,p+=A,_+=s.A._w}}catch(t){}}fT(t,i,e){t|=0,i|=0;let n=(t+=this.iT)+(i+=this.eT)*s.A._w,r=0,h=this.height,o=this.width,l=s.A._w-o,a=0;if(is.A.bottom&&(h-=i+h-s.A.bottom),ts.A.right){const i=t+o-s.A.right;o-=i,a+=i,l+=i}o>0&&h>0&&this.uT(o,h,this.pw,a,r,s.A.pw,n,l,e.pw)}scale(t,i,e,s,n,r,h,o,l,a,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*l;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=a}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}oT(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}rT(t,i,e,s,n,r,h,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}h+=o,s+=n}}nT(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}uT(t,i,e,s,n,r,h,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++}h+=o,n+=s}}}},1673:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1069),r=e(4474);class h extends r.A{pw;width;height;iT;eT;Xl;dw;palette;constructor(t,i,e){super(),this.pw=new Int8Array(t*i),this.width=this.Xl=t,this.height=this.dw=i,this.iT=this.eT=0,this.palette=e}static xu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.pf=s.Au;const o=r.Au,l=r.Au,a=r.pu,c=new Int32Array(a);for(let t=1;ts.length||r.pf>r.length)throw new Error;const f=r.pu,u=r.pu,d=r.Au,w=r.Au,y=new h(d,w,c);y.iT=f,y.eT=u,y.Xl=o,y.dw=l;const A=y.pw,m=r.pu;if(0===m){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.dT(h,r,this.pw,n,l,s.A.pw,e,o)}lT(){const t=this.pw,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}vv(){this.Xl|=0,this.dw|=0,this.Xl/=2,this.dw/=2,this.Xl|=0,this.dw|=0;const t=new Int8Array(this.Xl*this.dw);let i=0;for(let e=0;e>1)+(e+this.eT>>1)*this.Xl]=this.pw[i++];this.pw=t,this.width=this.Xl,this.height=this.dw,this.iT=0,this.eT=0}xw(){if(this.width===this.Xl&&this.height===this.dw)return;const t=new Int8Array(this.Xl*this.dw);let i=0;for(let e=0;e>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,n){try{const r=this.width;this.height;let h=0,o=0;const l=this.Xl,a=this.dw,c=(l<<16)/e|0,f=(a<<16)/n|0;t=t+(this.iT*e+l-1)/l|0,i=i+(this.eT*n+a-1)/a|0,this.iT*e%l!=0&&(h=(l-this.iT*e%l<<16)/e|0),this.eT*n%a!=0&&(o=(a-this.eT*n%a<<16)/n|0),e=e*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u,d=t+i*s.A._w,w=s.A._w-e;is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right&&(u=t+e-s.A.right,e-=u,w+=u),this.wT(s.A.pw,this.pw,this.palette,h,o,d,w,e,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}wT(t,i,e,s,n,r,h,o,l,a,c,f){try{const u=s;for(let d=-l;d<0;d++){const l=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+l];0==n?r++:t[r++]=e[255&n],s+=a}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}},1183:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(8950),n=e(7854);class r{yT;width;height;AT;mT;pw;constructor(t,i,e=n.nl){this.AT=e,this.yT=this.AT.getImageData(0,0,t,i),this.mT=new Uint32Array(this.yT.data.buffer),this.pw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.pw.fill(0)}bind(){s.A.bind(this.pw,this.width,this.height)}draw(t,i){this.#t(),this.AT.putImageData(this.yT,t,i)}#t(){const t=this.pw.length,i=this.pw,e=this.mT;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,i,e)=>{e.d(i,{A:()=>s});class s{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));zo=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Qo=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};pT=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}},2901:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(1908);class r{static pT=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.IT)return null;if(this.bT[t])return this.bT[t];const i=this.vT[t],e=i+this.ET[t];if(this._T){const s=Uint8Array.from(this.buffer.subarray(i,i+e));return this.bT[t]=s,s}{const i=Uint8Array.from(n.A.read(this.CT[t],this.buffer,this.ET[t],this.vT[t]));return this.bT[t]=i,i}}}},1069:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(9234),n=e(6666),r=e(4474);class h extends r.A{static OT=3988292384;static RT=new Int32Array(256);static LT=new Uint32Array(33);static ST=new n.A;static xT=new n.A;static MT=new n.A;static kT=0;static DT=0;static NT=0;static{for(let t=0;t<32;t++)h.LT[t]=(1<>>=1:i=i>>>1^h.OT;h.RT[t]=i}}static Zo=t=>{let i=4294967295;for(let e=0;e>>8^h.RT[255&(i^t[e])];return~i};view;data;pf=0;FT=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.pf}static Pt=t=>{let i=null;return 0===t&&h.kT>0?(h.kT--,i=h.ST.X_()):1===t&&h.DT>0?(h.DT--,i=h.xT.X_()):2===t&&h.NT>0&&(h.NT--,i=h.MT.X_()),i?(i.pf=0,i):new h(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.pf=0,100===this.view.byteLength&&h.kT<1e3?(h.ST.WA(this),h.kT++):5e3===this.view.byteLength&&h.DT<250?(h.xT.WA(this),h.DT++):3e4===this.view.byteLength&&h.NT<50&&(h.MT.WA(this),h.NT++)}get pu(){return this.view.getUint8(this.pf++)}get Dd(){return this.view.getInt8(this.pf++)}get Au(){const t=this.view.getUint16(this.pf);return this.pf+=2,t}get Iu(){const t=this.view.getInt16(this.pf);return this.pf+=2,t}get qu(){const t=this.view.getUint8(this.pf++)<<16|this.view.getUint16(this.pf);return this.pf+=2,t}get il(){const t=this.view.getInt32(this.pf);return this.pf+=4,t}get hE(){const t=this.view.getBigInt64(this.pf);return this.pf+=8,t}get FE(){return this.view.getUint8(this.pf)<128?this.pu-64:this.Au-49152}get Cm(){return this.view.getUint8(this.pf)<128?this.pu:this.Au-32768}get Eu(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.pf++))&&this.pf>16),this.view.setUint16(this.pf,t),this.pf+=2}p4(t){this.view.setInt32(this.pf,t),this.pf+=4}WT(t){this.view.setInt32(this.pf,t,!0),this.pf+=4}YT(t){this.view.setBigInt64(this.pf,t),this.pf+=8}HT(t){const i=this.view,e=t.length;for(let s=0;s>>3}zT(t){let i=this.FT>>>3,e=8-(7&this.FT),s=0;for(this.FT+=t;t>e;e=8)s+=(this.view.getUint8(i++)&h.LT[e])<>>e-t&h.LT[t],s}ZT(t,i){const e=this.pf;this.pf=0;const n=new Uint8Array(e);this.BT(e,0,n);const r=(0,s.qT)(n),h=(0,s.JT)(r,i,t),o=(0,s.$T)(h);this.pf=0,this.p1(o.length),this.VT(o,o.length,0)}}},5226:(t,i,e)=>{e.d(i,{Q:()=>n,x:()=>s});class s{QT=new Map;Eo;xo=self.isSecureContext?self.crypto.randomUUID():'0';constructor(t){this.Eo=t}async Ko(){const t=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),i=t.createDataChannel('channel'),e=crypto.randomUUID();this.QT.set(e,i),await t.setLocalDescription(await t.createOffer()),t.onicegatheringstatechange=async()=>{if('complete'===t.iceGatheringState){let i;self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(t.localDescription)):console.log(JSON.stringify(t.localDescription));try{for(;null===(i=prompt('Offer copied to clipboard, paste answer here')););t.setRemoteDescription(new RTCSessionDescription(JSON.parse(i)))}catch(t){console.error(t)}}},i.onopen=()=>{i.send(JSON.stringify({type:'id',id:e})),console.log('Connected to peer!')},i.onerror=t=>{console.error(t)},i.onmessage=t=>{const i=JSON.parse(t.data);i.data&&(i.data=Object.values(i.data)),this.Eo&&this.Eo.postMessage(i)}}postMessage(t){const i=this.QT.get(t.data.id),e=t.data;e.data&&(e.data=Array.from(t.data.data)),i&&'open'===i.readyState&&i.send(JSON.stringify(e))}}class n{pc;So=void 0;xo;constructor(t){this.pc=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),this.pc.ondatachannel=i=>{this.So=i.channel,this.So.onopen=()=>{console.log('Connected to host!')},this.So.onerror=t=>{console.error(t)},this.So.onmessage=i=>{if(!this.xo){const t=JSON.parse(i.data);if('id'===t.type)return void(this.xo=t.id)}t.onmessage&&t.onmessage(i)}},this.pc.onicegatheringstatechange=async()=>{'complete'===this.pc.iceGatheringState&&(self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(this.pc.localDescription)):console.log(JSON.stringify(this.pc.localDescription)))}}async Xo(t){await this.pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(t))),await this.pc.setLocalDescription(await this.pc.createAnswer())}}},3937:(t,i,e)=>{e.d(i,{A:()=>o});class s{start=0;end=0;form=0;length=0;tO=null;iO=null;threshold=0;position=0;delta=0;amplitude=0;eO=0;read(t){this.form=t.pu,this.start=t.il,this.end=t.il,this.length=t.pu,this.tO=new Int32Array(this.length),this.iO=new Int32Array(this.length);for(let i=0;i=this.threshold&&this.iO&&this.tO&&(this.amplitude=this.iO[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this.tO[this.position]/65536*t|0,this.threshold>this.eO&&(this.delta=((this.iO[this.position]<<15)-this.amplitude)/(this.threshold-this.eO)|0)),this.amplitude+=this.delta,this.eO++,this.amplitude-this.delta>>15}}class n{static buffer=null;static UA=null;static sin=null;static sO=new Int32Array(5);static nO=new Int32Array(5);static rO=new Int32Array(5);static hO=new Int32Array(5);static oO=new Int32Array(5);lO=null;aO=null;cO=null;fO=null;uO=null;dO=null;release=null;attack=null;wO=new Int32Array(5);yO=new Int32Array(5);AO=new Int32Array(5);start=0;length=500;mO=100;pO=0;static init=()=>{this.UA=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.UA[t]=1:this.UA[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};_O(t,i){for(let i=0;i>1,h+=(i*s>>16)+r}if(this.uO&&this.dO){const i=this.uO.evaluate(t),e=this.dO.evaluate(t);c=c*(32768+(this.IO(e,a,this.uO.form)>>1))>>15,a+=(i*o>>16)+l}for(let s=0;s<5;s++)if(0!==this.wO[s]){const r=i+n.nO[s];r>15,n.sO[s],this.lO.form),n.sO[s]+=(e*n.hO[s]>>16)+n.oO[s])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,e=!0;for(let s=0;s>8):this.release.start+((this.release.end-this.release.start)*h>>8),i+=256,i>=o&&(i=0,e=!e),e&&(n.buffer[s]=0)}}if(this.pO>0&&this.mO>0){const i=this.pO*e;for(let e=i;e32767&&(n.buffer[i]=32767);return n.buffer}IO(t,i,e){return 1===e?(32767&i)<16384?t:-t:2===e?n.sin[32767&i]*t>>14:3===e?((32767&i)*t>>14)-t:4===e?n.UA[i/2607&32767]*t:0}read(t){this.lO=new s,this.lO.read(t),this.aO=new s,this.aO.read(t),0!==t.pu&&(t.pf--,this.cO=new s,this.cO.read(t),this.fO=new s,this.fO.read(t)),0!==t.pu&&(t.pf--,this.uO=new s,this.uO.read(t),this.dO=new s,this.dO.read(t)),0!==t.pu&&(t.pf--,this.release=new s,this.release.read(t),this.attack=new s,this.attack.read(t));for(let i=0;i<10;i++){const e=t.Cm;if(0===e)break;this.wO[i]=e,this.yO[i]=t.FE,this.AO[i]=t.Cm}this.pO=t.Cm,this.mO=t.Cm,this.length=t.Au,this.start=t.Au}}var r=e(1069),h=e(3867);class o{static gO=new Int32Array(1e3);static CO=null;static EO=null;static vO=new h.fe(1e3,null);bO=new h.fe(10,null);TO=0;loopEnd=0;static yu=t=>{const i=new r.A(t.read('sounds.dat'));for(this.CO=new Uint8Array(441e3),this.EO=new r.A(this.CO),n.init();;){const t=i.Au;if(65535===t)break;const e=new o;e.read(i),this.vO[t]=e,this.gO[t]=e.trim()}};static _O=(t,i)=>{if(!this.vO[t])return null;const e=this.vO[t];return e?.OO(i)??null};read(t){for(let i=0;i<10;i++)0!==t.pu&&(t.pf--,this.bO[i]=new n,this.bO[i]?.read(t));this.TO=t.Au,this.loopEnd=t.Au}trim(){let t=9999999;for(let i=0;i<10;i++)this.bO[i]&&(this.bO[i].start/20|0)i&&(i=this.bO[t].length+this.bO[t].start);if(0===i)return 0;let e=22050*i/1e3|0,s=22050*this.TO/1e3|0,n=22050*this.loopEnd/1e3|0;(s<0||n<0||n>e||s>=n)&&(t=0);let r=e+(n-s)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){s+=44,n+=44,e+=44,r+=44;const i=r-e;for(let t=e-1;t>=n;t--)o.CO&&(o.CO[t+i]=o.CO[t]);for(let i=1;i{e.d(i,{hm:()=>a,rm:()=>o,fe:()=>s,Sm:()=>n,Eh:()=>r,Tm:()=>h,Xr:()=>l});class s extends Array{constructor(t,i){super(t);for(let e=0;e{e.d(i,{$T:()=>o,Jo:()=>n,qT:()=>h,$o:()=>s,ec:()=>r,JT:()=>l});const s=async t=>new Promise((i=>setTimeout(i,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),r=async t=>(await fetch(t)).text();function h(t){let i=0n;for(let e=0;e0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function l(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}},7608:(t,i,e)=>{e.a(t,(async(t,i)=>{try{var s=e(9234),n=e(1069),r=e(3937),h=e(4544),o=e(1908),l=e(123),a=(e(9896),e(7604)),c=e(1651);class t extends c.K{RO=[];async LO(t){const i=new Map,e=(await(0,s.ec)(t)).split('\n');for(let t=0;t{if(this.Mt)this.kt=!0;else{this.Mt=!0;try{await this.qo(10,'Connecting to fileserver'),await o.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new h.A(await h.A.openDatabase());const t=new n.A(new Uint8Array(await(0,s.Jo)(`${c.K.nt}/crc`)));for(let i=0;i<9;i++)this.Bt[i]=t.il;const i=await this.jo('sounds','sound effects',this.Bt[8],70);await this.qo(50,'Unpacking sounds'),r.A.yu(i),await this.qo(100,'Getting ready to start...'),await this.SO()}catch(t){this.Dt=!0,console.error(t)}}};async SO(){const t=document.getElementById('sounds');if(!t)return;t.innerHTML='',this.RO[1]=await this.LO(`${c.K.lt}/data/src/pack/sound.pack`);const i=document.createElement('input');i.type='search',i.placeholder='Search',i.tabIndex=1,i.oninput=()=>{const t=document.querySelector('#soundList');if(!t)return;const e=i.value.toLowerCase().replaceAll(' ','_');for(let i=0;i-1||n.indexOf(e)>-1||r.indexOf(e)>-1?s.style.display='':s.style.display='none'}},t.appendChild(i);const e=document.createElement('ul');e.id='soundList',e.className='list-group',t.appendChild(e);for(const[t,i]of this.RO[1]){const s=document.createElement('li');s.id=i,s.setAttribute('rs-id',t.toString()),s.setAttribute('rs-debugname',i),s.className='list-group-item list-group-item-center',s.innerText=i+' - '+t,0===t&&(s.className+=' active'),s.onclick=async()=>{const i=e.querySelector('.active');i&&(i.className='list-group-item list-group-item-center'),s.className='list-group-item list-group-item-center active';const n=r.A._O(t,0);n&&await(0,l.xO)(n.data.slice(0,n.pf),128)},e.appendChild(s)}}}await(0,a.w)(),(new t).run().then((()=>{})),window.onkeydown=function(t){return!(' '===t.key&&t.target===document.body)},i()}catch(t){i(t)}}),1)},1908:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(9763);class n{static MO=null;static load=async t=>{this.MO=await(0,s.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,e,s)=>{if(!this.MO)throw new Error('bz2 not found!!');return Int8Array.from(this.MO.read(t,i,e,s))}}},123:(t,i,e)=>{let s;async function n(t,i){!function(t){s||(s=window.audioContext.createGain(),s.connect(window.audioContext.destination));s.gain.value=t/256}(i);try{const i=await window.audioContext.decodeAudioData(Uint8Array.from(t).buffer);let e=window.audioContext.createBufferSource();e.buffer=i,e.connect(s),e.start()}catch(t){console.log(t)}}function r(t,i,e){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256,e)}function h(t){window._tinyMidiStop&&window._tinyMidiStop(t)}e.d(i,{xO:()=>n,el:()=>r,Mo:()=>h})},2604:(t,i,e)=>{function s(t,i){var e;(e=document.createElement('a')).href=t,e.download=i,document.body.appendChild(e),e.style='display: none',e.click(),e.remove()}e.d(i,{A:()=>s})},9763:(t,i,e)=>{async function s(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,l=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,l,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(a,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}e.d(i,{F:()=>s})},9896:(t,i,e)=>{var s=e(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{const t=2,i=44100;let e=new Float32Array,n=window.audioContext.createGain();n.gain.value=.1,n.connect(window.audioContext.destination);let r=window.audioContext.currentTime,h=[];const o=new s.A({kO:30,DO:t=>{let i=new Float32Array(t.buffer),s=new Float32Array(e.length+i.length);s.set(e,0),s.set(i,e.length),e=s},NO:t=>{},bufferSize:102400});await o.init();const l=await fetch('./SCC1_Florestan.sf2'),a=new Uint8Array(await l.arrayBuffer());function c(){if(!window.audioContext||!e.length)return;let s=window.audioContext.createBufferSource();const o=e.length/t,l=window.audioContext.createBuffer(t,o,i);for(let i=0;i{t.stop(window.audioContext.currentTime)})),h=[],n.gain.value=t}}function d(t,i){-1!==t&&window._tinyMidiVolume(t),r=window.audioContext.currentTime,f=setInterval(c,250),o.FO(i)}o.BO(a),window._tinyMidiStop=async t=>{t?function(t,i){const e=window.audioContext.currentTime;n.gain.cancelScheduledValues(e),n.gain.setValueAtTime(n.gain.value,e),n.gain.linearRampToValueAtTime(t,e+2),setTimeout(i,2e3)}(0,(()=>{u()})):u()},window._tinyMidiVolume=(t=1)=>{n.gain.value=t},window._tinyMidiPlay=async(t,i,e)=>{t&&(await window._tinyMidiStop(e),e?setTimeout((()=>{d(i,t)}),2e3):d(i,t))}})()},8151:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5473);const n=class{constructor(t={}){this.PO=void 0,this.UO=0,this.GO=0,this.WO=0,this.kO=t.kO||100,this.sampleRate=t.sampleRate||44100,this.YO=t.YO||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.HO(1),this.DO=t.DO||(()=>{}),this.NO=t.NO||(()=>{}),this.VO=void 0,this.test=0}async init(){if(!this.PO){if('undefined'!=typeof process){const{KO:t}=await import('path'),{XO:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.PO=await(0,s.A)(),this.jO=this.PO._malloc(this.bufferSize),this.zO=this.PO._malloc(8)}}HO(t){this.bufferSize=4*this.sampleRate*this.YO*t}ZO(){if(!this.PO)throw new Error(`${this.constructor.name} not initalized. call .init()`)}BO(t){this.ZO();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.PO;e(this.UO),this.UO=i(t.length),this.PO.HEAPU8.set(t,this.UO),this.GO=s(this.UO,t.length),n(this.GO,2===this.YO?0:2,this.sampleRate,this.gain)}qO(){this.ZO();const t=new Uint8Array(this.bufferSize);return t.set(this.PO.HEAPU8.subarray(this.jO,this.jO+this.bufferSize)),t}JO(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.PO;return e(this.WO),this.WO=i(t.length),this.PO.HEAPU8.set(t,this.WO),s(this.WO,t.length)}$O(t){const{_midi_render:i}=this.PO;return i(this.GO,t,this.YO,this.sampleRate,this.jO,this.bufferSize,this.zO)}FO(t){if(this.ZO(),!this.GO)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.VO);const{setValue:i,getValue:e}=this.PO;i(this.zO,0,'double'),this.PO._tsf_reset(this.GO),this.PO._tsf_channel_set_bank_preset(this.GO,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.JO(t);const n=()=>{s=this.$O(s);const t=this.qO();this.DO(t),s?this.VO=setTimeout(n,this.kO):this.NO(e(this.zO,'double'))};this.VO=setTimeout(n,16)}}},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,e)=>{var s;e.d(i,{A:()=>n});const n=(s="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,n,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,e){i=t,n=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(r.ready,t)||Object.defineProperty(r.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var h=Object.assign({},r),o=[],l='object'==typeof window,a='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!l&&!c&&!a;if(r.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var A,m;y=a?require('path').KO(y)+'/':__dirname+'/';var p=()=>{m||(A=require('fs'),m=require('path'))};u=(t,i)=>(p(),t=m.normalize(t),A.QO(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,e)=>{p(),t=m.normalize(t),A.tR(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),r.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,e){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!l&&!a)throw new Error('environment detection error');if(a?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),s&&(y=s),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},a&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}r.print||console.log.bind(console);var _,I,g=r.printErr||console.warn.bind(console);function C(t,i){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(r,h),h=null,_='fetchSettings',Object.getOwnPropertyDescriptor(r,_)&&j('`Module.'+_+'` was supplied but `'+_+'` not included in INCOMING_MODULE_JS_API'),r.arguments&&(o=r.arguments),C('arguments','arguments_'),r.thisProgram&&r.thisProgram,C('thisProgram','thisProgram'),r.quit&&r.quit,C('quit','quit_'),D(void 0===r.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===r.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===r.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===r.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===r.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),r.wasmBinary&&(I=r.wasmBinary),C('wasmBinary','wasmBinary');var v;r.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,O,R,L,S,x,M,k=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function N(t){b=t,r.HEAP8=T=new Int8Array(t),r.HEAP16=R=new Int16Array(t),r.HEAP32=L=new Int32Array(t),r.HEAPU8=O=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=S=new Uint32Array(t),r.HEAPF32=x=new Float32Array(t),r.HEAPF64=M=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var F=5242880;r.TOTAL_STACK&&D(F===r.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=r.INITIAL_MEMORY||16777216;function P(){if(!k){var t=ft(),i=S[t>>2],e=S[t+4>>2];34821223==i&&2310721022==e||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==S[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=F,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+F+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!r.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var U=[],G=[],W=[],Y=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var H=0,V=null,K=null,X={};function j(t){r.onAbort&&r.onAbort(t),g(t='Aborted('+t+')'),k=!0;var i=new WebAssembly.RuntimeError(t);throw n(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},iR:function(){z.error()},eR:function(){z.error()},sR:function(){z.error()},open:function(){z.error()},nR:function(){z.error()},rR:function(){z.error()},hR:function(){z.error()},oR:function(){z.error()},lR:function(){z.error()}};r.FS_createDataFile=z.iR,r.FS_createPreloadedFile=z.eR;var Z,q,J,$,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=r.asm),D(Y,'native function `'+e+'` called before runtime initialization'),s[t]||D(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==Z&&I)return new Uint8Array(I);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(r)}function ht(t){ht.aR||(ht.aR={}),ht.aR[t]||(ht.aR[t]=1,c&&(t='warning: '+t),g(t))}function ot(t){try{return v.grow(t-b.byteLength+65535>>>16),N(v.buffer),1}catch(i){g('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}r.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=r.locateFile?r.locateFile(q,y):y+q):Z=new URL(e(8227),e.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,e){O.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=O.length;D((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return g('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return g('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function e(t,i){var e,s=t.exports;r.asm=s,D(v=r.asm.memory,"memory not found in wasm exports"),N(v.buffer),D(r.asm.__indirect_function_table,"table not found in wasm exports"),e=r.asm.__wasm_call_ctors,G.unshift(e),function(t){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(X[t]),delete X[t]):g('warning: run dependency removed without ID'),0==H&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',H++,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(k)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,g('still waiting on run dependencies:')),g('dependency: '+i);t&&g('(end of list)')}),1e4))):g('warning: run dependency added without ID');var s=r;function h(t){D(r===s,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),s=null,e(t.instance)}function o(t){return function(){if(!I&&(l||a)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return st(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){g('failed to asynchronously prepare wasm: '+t),it(Z)&&g('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(r.instantiateWasm)try{return r.instantiateWasm(i,e)}catch(t){g('Module.instantiateWasm callback failed with error: '+t),n(t)}(I||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(h):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return g('wasm streaming compile failed: '+t),g('falling back to ArrayBuffer instantiation'),o(h)}))}))).catch(n)}(),r.___wasm_call_ctors=et("__wasm_call_ctors"),r._malloc=et("malloc"),r._free=et("free"),r._tsf_load_memory=et("tsf_load_memory"),r._tsf_close=et("tsf_close"),r._tsf_reset=et("tsf_reset"),r._tsf_set_output=et("tsf_set_output"),r._tsf_set_max_voices=et("tsf_set_max_voices"),r._realloc=et("realloc"),r._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),r._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),r._tml_load_memory=et("tml_load_memory"),r._midi_render=et("midi_render"),r.___errno_location=et("__errno_location"),r._fflush=et("fflush"),r._emscripten_stack_init=function(){return(ct=r._emscripten_stack_init=r.asm.emscripten_stack_init).apply(null,arguments)}),ft=(r._emscripten_stack_get_free=function(){return(r._emscripten_stack_get_free=r.asm.emscripten_stack_get_free).apply(null,arguments)},r._emscripten_stack_get_base=function(){return(r._emscripten_stack_get_base=r.asm.emscripten_stack_get_base).apply(null,arguments)},r._emscripten_stack_get_end=function(){return(ft=r._emscripten_stack_get_end=r.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),S[t>>2]=34821223,S[t+4>>2]=2310721022,S[0]=1668509029}function dt(t){function e(){lt||(lt=!0,r.calledRun=!0,k||(D(!Y),Y=!0,P(),rt(G),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),D(!r._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(P(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),W.unshift(t);var t;rt(W)}()))}t=t||o,H>0||(ut(),function(){if(r.preRun)for('function'==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),U.unshift(t);var t;rt(U)}(),H>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),e()}),1)):e(),P()))}if(r.stackSave=et("stackSave"),r.stackRestore=et("stackRestore"),r.stackAlloc=et("stackAlloc"),r.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':T[0|t]=i;break;case'i16':R[t>>1]=i;break;case'i32':L[t>>2]=i;break;case'i64':$=[i>>>0,(J=i,+Math.abs(J)>=1?J>0?(0|Math.min(+Math.floor(J/4294967296),4294967295))>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],L[t>>2]=$[0],L[t+4>>2]=$[1];break;case'float':x[t>>2]=i;break;case'double':M[t>>3]=i;break;case'*':S[t>>2]=i;break;default:j('invalid type for setValue: '+e)}},r.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return T[0|t];case'i16':return R[t>>1];case'i32':case'i64':return L[t>>2];case'float':return x[t>>2];case'double':return M[t>>3];case'*':return S[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),K=function t(){lt||dt(),lt||(K=t)},r.preInit)for('function'==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return dt(),t.ready})}},r={};function h(t){var i=r[t];if(void 0!==i)return i.exports;var e=r[t]={exports:{}};return n[t](e,e.exports,h),e.exports}h.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",e="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",s=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},h.a=(n,r,h)=>{var o;h&&((o=[]).d=-1);var l,a,c,f=new Set,u=n.exports,d=new Promise(((t,i)=>{c=i,a=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,r((n=>{var r;l=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var r=[];r.d=0,n.then((t=>{h[i]=t,s(r)}),(t=>{h[e]=t,s(r)}));var h={};return h[t]=t=>t(r),h}}var o={};return o[t]=t=>{},o[i]=n,o})))(n);var h=()=>l.map((t=>{if(t[e])throw t[e];return t[i]})),a=new Promise((i=>{(r=()=>i(h)).r=0;var e=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(r.r++,t.push(r)));l.map((i=>i[t](e)))}));return r.r?a:h()}),(t=>(t?c(d[e]=t):a(u),s(o)))),o&&o.d<0&&(o.d=0)},h.d=(t,i)=>{for(var e in i)h.o(i,e)&&!h.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},h.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),h.p="/Client2/",h.b=document.baseURI||self.location.href;h(7608)})(); \ No newline at end of file +(()=>{"use strict";var t,i,e,s,n={1651:(t,i,e)=>{e.d(i,{K:()=>D});var s=e(1120),n=e(4583),r=e(2901),h=e(1069),o=e(7046),l=(e(9896),e(6666)),a=e(3045),c=e(818),f=e(670),u=e(8268),d=e(3867),w=e(7854),y=e(8950),A=e(1302),m=e(9298),p=e(8665),_=e(1312),I=e(3819),g=e(8317),C=e(9234),E=e(1908),v=e(123),b=e(5637),T=e(6948),O=e(2164),R=e(8738),L=e(3764),S=e(8534),x=e(6730),M=e(2604),k=e(5226);class D extends o.A{static tt=225;static it=10;static portOffset=0;static members=!0;static et=!1;static st='';static nt='';static rt=!1;static ht=2;static ot=!1;static lt='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static ct=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static ft=0;static ut=0;static dt=0;static wt=0;static yt=0;static At=0;static _t=0;static It=0;static gt=0;static Ct=0;static Et=0;static vt=0;static bt=0;static Tt=0;static Ot=0;static Rt=()=>{a.A.et=!1,n.A.et=!1,D.et=!1,c.A.et=!1};static Lt=()=>{a.A.et=!0,n.A.et=!0,D.et=!0,c.A.et=!0};St=2048;xt=2047;Mt=!1;kt=!1;Dt=!1;Nt=!1;db=null;Ft=0;Bt=[];stream=null;in=h.A.Pt(1);Ut=h.A.Pt(1);Gt=h.A.Pt(1);Wt=0n;Yt=0;Ht=0;Vt=0;Kt=null;Xt=0;packetSize=0;jt=0;zt=0;Zt=0;qt=null;Jt=!0;$t=0;Qt=0;ti=null;ii=null;ei=null;si=null;ni=null;ri=null;hi=null;oi=null;li=null;ai=null;ci=null;fi='';ui='';username='';password='';di=null;wi=null;yi=null;Ai=null;mi=[];pi=!1;_i=null;Ii=null;gi=null;Ci=null;Ei=null;vi=null;bi=null;Ti=null;Oi=null;Ri=null;Li=new Int32Array(256);Si=0;xi=0;Mi=0;ki=null;Di=null;Ni=null;Fi=null;Bi=null;Pi=null;Ui=null;Gi=null;Wi=null;Yi=null;Hi=null;Vi=null;Ki=null;Xi=null;ji=null;zi=null;Zi=null;qi=null;Ji=null;$i=null;Qi=null;te=new Int32Array(33);ie=new Int32Array(33);ee=new Int32Array(151);se=new Int32Array(151);ne=null;re=null;he=null;oe=null;le=null;ae=null;ce=new d.fe(13,null);ue=null;de=null;we=new d.fe(50,null);ye=new d.fe(50,null);Ae=new d.fe(20,null);me=new d.fe(20,null);pe=null;_e=new d.fe(8,null);Ie=null;ge=null;Ce=null;Ee=null;ve=null;be=null;Te=null;Oe=null;Re=null;Le=null;Se=null;xe=null;Me=null;ke=null;De=null;Ne=null;Fe=null;Be=null;Pe=new d.fe(1e3,null);Ue=!1;Ge=!1;We=!1;Ye=!1;He=-1;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=0;qe=!1;Je=0;$e=0;Qe=0;ts=0;es=0;ss=0;ns=[];rs=-1;hs=-1;os=new s.A;ls=78;cs=0;fs=0;us=[];ds=0;ws=0;ys=0;As=0;ps=0;_s=0;Is=0;gs=0;Cs=[];Es=[];vs=[];bs=[];Ts=null;Os=-1;Rs=3;Ls=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];Ss=0;xs=0;Ms=0;ks=!1;Ds=0;Ns=!1;Fs='';Bs='';Ps=0;Us='';Gs=!1;Ws=-1;Ys=new d.fe(100,null);Hs=new d.fe(100,null);messageType=new Int32Array(100);Vs=new Int32Array(100);Ks=0;Xs=0;js=0;zs='';Zs=0;qs=0;Js=0;$s=0;Qs=0;tn=0;en=0;sn=0;nn=0;rn=!1;hn=0;ln=0;an=0;cn=0;fn=null;un=0;dn=0;wn=0;yn=0;An=!1;mn=[];pn=[];_n=0;In=0;gn=0;Cn=null;En=0;vn=new Int32Array(500);bn=new Int32Array(500);Tn=new Int32Array(500);On=new Int32Array(500);Rn=0;Ln=0;Sn=0;xn='';Mn=!1;kn=-1;Dn=0;Nn=0;Fn=0;Bn=0;Pn=0;Un=new Int32Array(1e3);Gn=new Int32Array(1e3);Wn=null;Yn=0;Hn=0;Vn=0;Kn=0;Xn=0;jn=!1;zn=0;Zn=0;qn=0;Jn=0;$n=2;Qn=2;tr=1;ir=new Int32Array(5);er=new d.fe(5,!1);sr=new Int32Array(5);nr=new Int32Array(5);rr=new Int32Array(5);hr=0;lr=0;ar=0;cr=0;ur=0;dr=0;wr=0;yr=0;Ar=0;mr=1;pr=2;_r=-1;Ir=0;gr=0;Cr=0;Er=0;vr=0;br=0;Tr=null;Or=null;Rr=null;Lr=0;Sr=0;Mr=new Int8Array(16384);kr=new d.fe(f.A.Dr,null);Nr=0;Fr=0;Br=128;Pr=0;Ur=0;Gr=0;Wr=0;Yr=0;Hr=null;Vr=null;Kr=new d.Xr(f.A.jr,f.A.jr);zr=0;Zr=0;qr=0;Jr=0;$r=0;Qr=0;th=0;ih=0;eh=0;sh=0;nh=0;rh=0;hh=new d.fe(this.St,null);oh=0;lh=new Int32Array(this.St);ah=0;fh=0;uh=new Int32Array(this.St);dh=new Int32Array(1e3);wh=new d.fe(this.St,null);yh=new d.fe(8192,null);Ah=0;mh=new Int32Array(8192);ph=new l.A;_h=new l.A;Ih=new l.A;gh=new l.A;Ch=new d.Eh(f.A.Dr,f.A.jr,f.A.jr,null);bh=new l.A;Th=new Int32Array(4e3);Oh=new Int32Array(4e3);Rh=new Int32Array(f.A.jr*f.A.jr);Lh=new Int32Array(f.A.jr*f.A.jr);Sh=0;xh=null;Mh=0;kh=0;Dh=-1;Nh=0;Fh=0;Bh=0;Ph=0;Uh=!1;Gh=!0;Wh=!1;Yh=new Int32Array(7);Hh=new Int32Array(5);Vh=0;Kh=0;static Xh=50;jh=new Int32Array(D.Xh);zh=new Int32Array(D.Xh);Zh=new Int32Array(D.Xh);qh=new Int32Array(D.Xh);Jh=new Int32Array(D.Xh);$h=new Int32Array(D.Xh);Qh=new Int32Array(D.Xh);io=new d.fe(D.Xh,null);eo=new d.fe(100,null);so=new BigInt64Array(100);no=new Int32Array(100);ro=null;ho=0;oo=!0;lo=new Int32Array(50);ao=new Int32Array(50);co=new Int32Array(50);fo=192;uo=-1;do=-1;wo=0;yo=0;Ao=0;mo=!0;po=null;_o=0;Io=0;Co=192;Eo=void 0;vo=!1;host=null;bo=null;To=new d.fe(16,null);Oo=0;Ro=!1;Lo=()=>{try{this.stream&&this.stream.close()}catch(t){}this.bo&&'998'===D.getParameter('world')&&this.bo.So?.send(JSON.stringify({type:'close',id:this.bo.xo})),this.stream=null,(0,v.Mo)(!1),this.Ut=null,this.Gt=null,this.in=null,this.Rr=null,this.Tr=null,this.Or=null,this.Hr=null,this.Vr=null,this.Wn=null,this.kr=null,this.Rh=null,this.Lh=null,this.Th=null,this.Oh=null,this.Mr=null,this.Di=null,this.Ni=null,this.Fi=null,this.Bi=null,this.Pi=null,this.Ui=null,this.Gi=null,this.Wi=null,this.Yi=null,this.Hi=null,this.Vi=null,this.Ki=null,this.Xi=null,this.ji=null,this.zi=null,this.Zi=null,this.qi=null,this.ne=null,this.he=null,this.re=null,this.oe=null,this.le=null,this.ae=null,this.ce=null,this.Te=null,this.Oe=null,this.Re=null,this.Le=null,this.Se=null,this.xe=null,this.Me=null,this.ke=null,this.De=null,this.Ne=null,this.de=null,this.Ae=null,this.me=null,this._e=null,this.Ie=null,this.ge=null,this.Ce=null,this.Ee=null,this.we=null,this.ye=null,this.Kr=null,this.hh=null,this.lh=null,this.uh=null,this.wh=null,this.dh=null,this.yh=null,this.mh=null,this.Ch=null,this.bh=null,this.gh=null,this.ph=null,this._h=null,this.Ih=null,this.Tn=null,this.On=null,this.vn=null,this.bn=null,this.ns=null,this.mn=null,this.Un=null,this.Gn=null,this.Pe=null,this.ue=null,this.eo=null,this.so=null,this.no=null,this.si=null,this.ni=null,this.ti=null,this.ii=null,this.ei=null,this.ri=null,this.hi=null,this.oi=null,this.li=null,this.ko(),b.A.Lo(),T.A.Lo(),A.A.Lo(),O.A.Do=null,g.A.Do=null,s.A.Do=null,_.A.Do=null,R.A.Do=null,R.A.No=null,L.A.Do=null,this.Fo=null,u.A.No=null,n.A.Lo(),a.A.Lo(),p.A.Lo(),S.A.Do=[],x.A.Do=[]};Bo(){return this.$t}Po(){return this.Gs}Uo(){return this.Ns}Go(){return this.hs}Wo(){return this.He}ko=()=>{this.pi=!1,this.ki&&(clearInterval(this.ki),this.ki=null),this.ai=null,this.ci=null,this.mi=[],this.bi=null,this.Ti=null,this.Oi=null,this.Ri=null,this.Ci=null,this.gi=null,this.Ei=null,this.vi=null,this._i=null,this.Ii=null};Yo=()=>{'999'===D.getParameter('world')?(this.Eo=new Worker('worker.js',{type:'module'}),this.Eo.onmessage=this.onmessage,this.host=new k.x(this.Eo)):'998'===D.getParameter('world')&&(this.Eo={onmessage:t=>{this.stream.Ho.onmessage(t)},postMessage:t=>{this.bo&&this.bo.So&&'open'===this.bo.So.readyState&&this.bo.So.send(JSON.stringify(t))},onerror:null,onmessageerror:null,terminate:()=>{throw new Error},addEventListener:()=>{throw new Error},removeEventListener:()=>{throw new Error},dispatchEvent:()=>{throw new Error}},this.bo=new k.Q(this.Eo))};onmessage=t=>{switch(t.data.type){case'ready':return void(this.vo=!0);case'save':return(0,M.A)(t.data.value,t.data.path.split('/').pop().split('\\').pop()),void URL.revokeObjectURL(t.data.value);case'close':return void this.Eo?.postMessage({type:'close',id:t.data.id})}this.host?.xo===t.data.id?this.stream.Ho.onmessage(t.data):this.host?.postMessage(t)};Vo=async()=>{if(999==+D.getParameter('world'))this.host&&await this.host.Ko();else if(998==+D.getParameter('world')&&this.bo){if(this.bo.So)return void console.log('You are already connected.');const t=prompt('Paste offer here, answer will be copied to clipboard');if(t)try{await this.bo.Xo(t)}catch(t){console.error(t)}}};jo=async(t,i,e,s)=>{let n=5,o=await(this.db?.zo(t));if(o&&h.A.Zo(o)!==e&&(o=void 0),o)return new r.A(o);for(;!o;){await this.qo(s,`Requesting ${i}`);try{o=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}${e}`):await(0,C.Jo)(`${D.nt}/${t}`)}catch(t){o=void 0;for(let t=n;t>0;t--)await this.qo(s,`Error loading - Will retry in ${t} secs.`),await(0,C.$o)(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Qo(t,o)),new r.A(o)};tl=async(t,i,e,s)=>{let n=await(this.db?.zo(t+'.mid'));if(n&&12345678!==i&&h.A.Zo(n)!==i&&(n=void 0),!n)try{n=+D.getParameter('world')<998?await(0,C.Jo)(`${D.nt}/${t}_${i}.mid`):await(0,C.Jo)(`${D.nt}/songs/${t}.mid`),e!==n.length&&(n=n.slice(0,e))}catch(t){}if(!n)return;await(this.db?.Qo(t+'.mid',n));const r=new h.A(Uint8Array.from(n)).il,o=E.A.read(r,n,e,4);(0,v.el)(o,this.Co,s)};sl=()=>{if(w.nl.fillStyle='black',w.nl.fillRect(0,0,this.width,this.height),this.rl(1),this.Dt){this.pi=!1,w.nl.font='bold 16px helvetica, sans-serif',w.nl.textAlign='left',w.nl.fillStyle='yellow';let t=35;w.nl.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,w.nl.fillStyle='white',w.nl.fillText('To fix this try the following (in order):',30,t),t+=50,w.nl.font='bold 12px helvetica, sans-serif',w.nl.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.nl.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,w.nl.fillText('3: Try using a different game-world',30,t),t+=30,w.nl.fillText('4: Try rebooting your computer',30,t),t+=30,w.nl.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.Nt&&(this.pi=!1,w.nl.font='bold 20px helvetica, sans-serif',w.nl.textAlign='left',w.nl.fillStyle='white',w.nl.fillText('Error - unable to load game!',50,50),w.nl.fillText('To play RuneScape make sure you play from',50,100),w.nl.fillText('https://2004scape.org',50,150)),this.kt){this.pi=!1,w.nl.font='bold 13px helvetica, sans-serif',w.nl.textAlign='left',w.nl.fillStyle='yellow';let t=35;w.nl.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,w.nl.fillStyle='white',w.nl.fillText('To fix this try the following (in order):',30,t),t+=50,w.nl.font='bold 12px helvetica, sans-serif',w.nl.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,w.nl.fillText('2: Try rebooting your computer, and reloading',30,t)}};hl=t=>{if(!t.ol)return!1;for(let i=0;i=s)return!1}else if(3===t.ol[i]){if(e<=s)return!1}else if(4===t.ol[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};cl=(t,i,e,s,n)=>{this.ve?.draw(t,i),this.be?.draw(t,i+n-16),y.A.fillRect(t,i+16,16,n-32,m.A.fl);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;y.A.fillRect(t,i+h+16,16,r,m.A.ul),y.A.dl(t,i+h+16,m.A.wl,r),y.A.dl(t+1,i+h+16,m.A.wl,r),y.A.yl(t,i+h+16,m.A.wl,16),y.A.yl(t,i+h+17,m.A.wl,16),y.A.dl(t+15,i+h+16,m.A.Al,r),y.A.dl(t+14,i+h+17,m.A.Al,r-1),y.A.yl(t,i+h+r+15,m.A.Al,16),y.A.yl(t+1,i+h+r+14,m.A.Al,15)};ml=(t,i)=>{let e=!1;const n=s.A.Do[t];if(!n.pl)return!1;for(let t=0;ts.delay[r.Cl];)r.gl-=s.delay[r.Cl]+1,r.Cl++,r.Cl>=s.El&&(r.Cl-=s.vl,(r.Cl<0||r.Cl>=s.El)&&(r.Cl=0)),e=!0}}}return e};bl=(t,i,e,r,h=!1)=>{if(0!==t.type||!t.pl||t.hide&&this.Zs!==t.id&&this.qs!==t.id&&this.Js!==t.id)return;const o=y.A.left,l=y.A.top,a=y.A.right,c=y.A.bottom;y.A.Tl(i,e,i+t.width,e+t.height);const f=t.pl.length;for(let o=0;o0&&this.Ml(c),c.type===s.A.kl)c.Dl>c.scroll-c.height&&(c.Dl=c.scroll-c.height),c.Dl<0&&(c.Dl=0),this.bl(c,l,a,c.Dl,h),c.scroll>c.height&&this.cl(l+c.width,a,c.Dl,c.scroll,c.height);else if(c.type===s.A.Nl){let t=0;for(let i=0;i0){let i=0,e=0;const r=c.Pl[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.tn&&this.Qs===t){const h=A.A.Yl(r,c.Ul[t]);if(0!==this.tn&&this.Qs===t&&this.$s===c.id?(i=this.Hl-this.en,e=this.Vl-this.sn,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.nn<5&&(i=0,e=0),h.Kl(128,s+i,n+e)):0!==this.un&&this.dn===t&&this.wn===c.id?h.Kl(128,s,n):h.draw(s,n),33===h.Xl||1!==c.Ul[t]){const r=c.Ul[t];this.di?.jl(s+i+1,n+10+e,this.zl(r),m.A.Zl),this.di?.jl(s+i,n+9+e,this.zl(r),m.A.ql)}}}else if(c.Jl&&t<20){const i=c.Jl[t];i?.draw(s,n)}t++}}else if(c.type===s.A.$l)c.fill?y.A.fillRect(l,a,c.width,c.height,c.Ql):y.A.Ll(l,a,c.width,c.height,c.Ql);else if(c.type===s.A.ta){const t=c.font;let i=c.Ql,e=c.text;if(this.Js!==c.id&&this.qs!==c.id&&this.Zs!==c.id||0===c.ia||(i=c.ia),this.hl(c)&&(i=c.ea,c.sa&&c.sa.length>0&&(e=c.sa)),c.na===s.A.ra&&this.An&&(e='Please wait...',i=c.Ql),!t||!e)continue;for(let s=a+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.ha(this.ll(c,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.ha(this.ll(c,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.ha(this.ll(c,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.ha(this.ll(c,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.ha(this.ll(c,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),c.oa?t.la(l+(c.width/2|0),s,r,i,c.aa):t.ca(l,s,r,i,c.aa)}}else if(c.type===s.A.fa){let t;t=this.hl(c)?c.ua:c.da,t?.draw(l,a)}else if(c.type===s.A.wa){const t=n.A.ya,i=n.A.Aa;n.A.ya=l+(c.width/2|0),n.A.Aa=a+(c.height/2|0);const e=n.A.sin[c.ma]*c.zoom>>16,s=n.A.cos[c.ma]*c.zoom>>16,r=this.hl(c);let h;h=r?c.Il:c._l;let o=null;if(-1===h)o=c.pa(-1,-1,r);else{const t=_.A.Do[h];t.frames&&t._a&&(o=c.pa(t.frames[c.Cl],t._a[c.Cl],r))}o&&o.Ia(0,c.ga,0,c.ma,0,e,s),n.A.ya=t,n.A.Aa=i}else if(c.type===s.A.Ca){const t=c.font;if(!t||!c.Pl||!c.Ul)continue;let i=0;for(let e=0;e0){const n=A.A.get(c.Pl[i]-1);let r=n.name;if((n.Ea||1!==c.Ul[i])&&(r=r+' x'+this.va(c.Ul[i])),!r)continue;const h=l+s*(c.Gl+115),o=a+e*(c.Wl+12);c.oa?t.la(h+(c.width/2|0),o,r,c.Ql,c.aa):t.ca(h,o,r,c.Ql,c.aa)}i++}}}y.A.Tl(o,l,a,c)};Ml=t=>{let i=t.xl;if(i>=s.A.ba&&i<=s.A.Ta)i--,i>=this.Vh?(t.text='',t.na=0):(t.text=this.eo[i],t.na=1);else if(i>=s.A.Oa&&i<=s.A.Ra)i-=s.A.Oa,i>=this.Vh?(t.text='',t.na=0):(0===this.no[i]?t.text='@red@Offline':this.no[i]===D.it?t.text='@gre@World-'+(this.no[i]-9):t.text='@yel@World-'+(this.no[i]-9),t.na=1);else if(i===s.A.La)t.scroll=15*this.Vh+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=s.A.Sa&&i<=s.A.xa)i-=s.A.Sa,i>=this.fs?(t.text='',t.na=0):(t.text=I.A.Ma(I.A.ka(this.us[i])),t.na=1);else if(i===s.A.Da)t.scroll=15*this.fs+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===s.A.Na){if(t.ma=150,t.ga=256*Math.sin(this.Ft/40)&2047,this.Wh){this.Wh=!1;const i=new d.fe(7,null);let e=0;for(let t=0;t<7;t++){const s=this.Yh[t];s>=0&&(i[e++]=g.A.Do[s].pa())}const s=p.A.Fa(i,e);for(let t=0;t<5;t++)0!==this.Hh[t]&&(s.Ba(u.A.Pa[t][0],u.A.Pa[t][this.Hh[t]]),1===t&&s.Ba(u.A.Ua[0],u.A.Ua[this.Hh[t]]));if(this.xh){const i=_.A.Do[this.xh.Ga].frames;i&&(s.Wa(),s.Ya(i[0]),s.Ha(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===s.A.Va)this.Fe||(this.Fe=t.da,this.Be=t.ua),this.Gh?t.da=this.Be:t.da=this.Fe;else if(i===s.A.Ka)this.Fe||(this.Fe=t.da,this.Be=t.ua),this.Gh?t.da=this.Fe:t.da=this.Be;else if(i===s.A.Xa)t.text=this.xn,this.Ft%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===s.A.ja)this.Uh?this.Mn?(t.Ql=m.A.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Ql=m.A.Sl,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===s.A.za||i===s.A.Za)if(0===this.Dn)t.text='';else{let i;i=0===this.Nn?'earlier today':1===this.Nn?'yesterday':this.Nn+' days ago',t.text='You last logged in '+i+' from: '+I.A.qa(this.Dn)}else if(i===s.A.Ja)0===this.Bn&&(t.text='0 unread messages',t.Ql=m.A.ql),1===this.Bn&&(t.text='1 unread message',t.Ql=m.A.GREEN),this.Bn>1&&(t.text=this.Bn+' unread messages',t.Ql=m.A.GREEN);else if(i===s.A.$a)if(201===this.Fn)t.text='';else if(200===this.Fn)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.Fn?'Earlier today':1===this.Fn?'Yesterday':this.Fn+' days ago',t.text=i+' you changed your recovery questions'}else i===s.A.Qa?201===this.Fn?t.text='':200===this.Fn?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===s.A.tc&&(201===this.Fn?t.text='':(this.Fn,t.text="Do this from the 'account management' area on our front webpage"))};ll=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let n=0,r=0;for(;;){const t=e[r++];if(0===t)return n;if(1===t)n+=this.Es[e[r++]];else if(2===t)n+=this.vs[e[r++]];else if(3===t)n+=this.Cs[e[r++]];else if(4===t){const t=s.A.Do[e[r++]],i=e[r++]+1;if(t.Pl&&t.Ul)for(let e=0;et<999999999?String(t):'*';va=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};zl=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}},7604:(t,i,e)=>{e.d(i,{w:()=>h});var s=e(7046),n=e(1651),r=e(9234);async function h(){await async function(){0===s.A.getParameter('world').length&&s.A.setParameter('world','1');['0','998','999'].includes(s.A.getParameter('world'))?function(){if(+s.A.getParameter('world')>=998)return void(n.K.nt='data/pack/client');n.K.st='http://localhost',n.K.nt='http://localhost',n.K.portOffset=0}():await async function(t){const i=await o(t,parseInt(s.A.getParameter('world'),10)),e=new URL(i.address);n.K.it=10+i.id-1,n.K.st=`${e.protocol}//${e.hostname}`,n.K.nt=`${e.protocol}//${e.hostname}:${e.port}`,t||(n.K.st=n.K.st.replace('https:','http:'));n.K.portOffset=i.portOffset,n.K.members=!0===i?.members,s.A.setParameter('world',i.id.toString(10))}(window.location.protocol.startsWith('https'))}(),function(){0===s.A.getParameter('detail').length&&s.A.setParameter('detail','high');'low'===s.A.getParameter('detail')?n.K.Lt():n.K.Rt()}(),0===s.A.getParameter('method').length&&s.A.setParameter('method','0')}async function o(t,i,e=0){if(e>=10)throw new Error('could not find world to connect!');const s=t?'https:':'http:';let n;try{n=JSON.parse(await(0,r.ec)(`${s}//2004scape.org/api/v1/worldlist`))}catch(s){return await(0,r.$o)(1e3),o(t,i,++e)}n.push({id:0,region:'Local Development',address:'http://localhost',portOffset:0,members:!0,hh:0});const h=n.find((t=>t.id===i));return h||o(t,i,10)}},7046:(t,i,e)=>{e.d(i,{A:()=>a});var s=e(1183),n=e(4583),r=e(9234),h=e(9091),o=e(2595),l=e(7854);class a{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}sc=0;nc=[];rc=0;Fo=null;state=0;hc=20;oc=1;lc=[];ac=0;cc=0;fc=[];uc=!0;dc=!1;wc=50;hasFocus=!0;yc=!1;Ac=0;mc=0;Hl=0;Vl=0;_c=0;Ic=0;gc=0;Cc=[];Ec=[];vc=0;bc=0;input=null;Tc=!1;Oc=!1;Rc=!1;time=-1;Lc=0;Sc=0;xc=0;Mc=0;kc=0;Dc=0;constructor(t=!1){l.Nc.tabIndex=-1,l.nl.fillStyle='black',l.nl.fillRect(0,0,l.Nc.width,l.Nc.height),this.dc=t,this.dc?this.resize(window.innerWidth,window.innerHeight):this.resize(l.Nc.width,l.Nc.height)}get width(){return l.Nc.width}get height(){return l.Nc.height}resize=(t,i)=>{l.Nc.width=t,l.Nc.height=i,this.Fo=new s.A(t,i),n.A.Fc()};run=async()=>{l.Nc.addEventListener('resize',(()=>{this.dc&&this.resize(window.innerWidth,window.innerHeight)}),!1),l.Nc.onmousedown=this.onmousedown,l.Nc.onmouseup=this.onmouseup,l.Nc.onmouseenter=this.onmouseenter,l.Nc.onmouseleave=this.onmouseleave,l.Nc.onmousemove=this.onmousemove,window.onbeforeunload=this.Lo,l.Nc.onfocus=this.onfocus,l.Nc.onblur=this.onblur,this.Bc?(l.Nc.ontouchstart=this.ontouchstart,l.Nc.ontouchend=this.ontouchend,l.Nc.ontouchmove=this.ontouchmove):(l.Nc.onkeydown=this.onkeydown,l.Nc.onkeyup=this.onkeyup),l.Nc.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.Bc&&'low'===a.getParameter('detail')&&(this.wc=30),await this.qo(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.lc[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.Pc();const h=e,o=s;e=300,s=1,t=performance.now();const l=this.lc[i];if(0===l?(e=h,s=o):t>l&&(e=2560*this.hc/(t-l)|0),e<25?e=25:e>256&&(e=256,s=this.hc-(t-l)/10|0),this.lc[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.lc[t]&&(this.lc[t]+=s);for(s0&&(this.ac=1e3*e/(256*this.hc)|0);const a=performance.now();if(this.uc&&this.refresh(),await this.draw(),this.fc[this.cc]=(performance.now()-a)/1e3,this.cc=(this.cc+1)%this.fc.length,this.wc<50){const i=1e3/this.wc-(performance.now()-t);i>0&&await(0,r.$o)(i)}}-1===this.state&&this.Pc()};Pc=()=>{this.state=-2,this.Lo()};rl=t=>{this.hc=1e3/t|0};Uc=t=>{this.wc=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.hc|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};Lo=()=>{};draw=async()=>{};refresh=()=>{};async qo(t,i){const e=this.width,s=this.height;this.uc&&(l.nl.fillStyle='black',l.nl.fillRect(0,0,e,s),this.uc=!1);const n=s/2-18;l.nl.fillStyle='rgb(140, 17, 17)',l.nl.rect((e/2|0)-152,n,304,34),l.nl.fillRect((e/2|0)-150,n+2,3*t,30),l.nl.fillStyle='black',l.nl.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),l.nl.font='bold 13px helvetica, sans-serif',l.nl.textAlign='center',l.nl.fillStyle='white',l.nl.fillText(i,e/2|0,n+22),await(0,r.$o)(5)}Gc=()=>{let t=-1;return this.bc!==this.vc&&(t=this.Ec[this.vc],this.vc=this.vc+1&127),t};get ms(){const t=this.fc.length;let i=0;for(let e=0;ethis.sc&&(this.sc=e),this.nc[this.rc]=e,this.rc=(this.rc+1)%250,e}get Wc(){return this.nc.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.Ac=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Cc[n]=1),n>4&&(this.Ec[this.bc]=n,this.bc=this.bc+1&127),o.A.enabled&&o.A.Yc(n),h.g.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.Ac=0;const e=h.c[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===h.c.ArrowLeft.code?n=1:s===h.c.ArrowRight.code?n=2:s===h.c.ArrowUp.code?n=3:s===h.c.ArrowDown.code?n=4:s===h.c.Control.code?n=5:s===h.c.Shift.code?n=6:s===h.c.Alt.code?n=7:s===h.c.Backspace.code||s===h.c.Delete.code?n=8:s===h.c.Tab.code?n=9:s===h.c.Enter.code?n=10:s>=h.c.F1.code&&s<=h.c.F12.code?n=s+1008-h.c.F1.code:s===h.c.Home.code?n=1e3:s===h.c.End.code?n=1001:s===h.c.PageUp.code?n=1002:s===h.c.PageDown.code&&(n=1003),n>0&&n<128&&(this.Cc[n]=0),o.A.enabled&&o.A.Hc(n),h.g.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.Tc=!1,(t.clientX>0||t.clientY>0)&&this.Vc(t),this.Ac=0,this.Ic=this.Hl,this.gc=this.Vl,this.Bc&&!this.Kc){if(this.Xc()||this.jc()||this.zc())return this._c=1,void(this.mc=1);t.timeStamp>=this.time+500?(this._c=2,this.mc=2):(this._c=1,this.mc=1)}else 2===t.button?(this._c=2,this.mc=2):(this._c=1,this.mc=1);o.A.enabled&&o.A.Zc(this.Ic,this.gc,t.buttons)};onmouseup=t=>{this.Vc(t),this.Ac=0,this.mc=0,o.A.enabled&&o.A.qc(t.buttons)};onmouseenter=t=>{this.Vc(t),o.A.enabled&&o.A.Jc()};onmouseleave=t=>{this.Vc(t),this.Ac=0,this.Hl=-1,this.Vl=-1,this.mc=0,this.Ic=-1,this.gc=-1,o.A.enabled&&o.A.$c()};onmousemove=t=>{this.Vc(t),this.Ac=0,o.A.enabled&&o.A.Qc(this.Hl,this.Vl)};onfocus=t=>{this.hasFocus=!0,this.uc=!0,this.refresh(),o.A.enabled&&o.A.tf()};onblur=t=>{this.hasFocus=!1,o.A.enabled&&o.A.if()};ontouchstart=t=>{if(!this.Bc)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.Tc=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.Lc=this.kc=this.xc=0|i.screenX,this.Sc=this.Dc=this.Mc=0|i.screenY,this.time=t.timeStamp,this.Oc=this.ef(),this.Rc=this.sf()};ontouchend=t=>{if(!this.Bc||!this.Tc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.kc=0|i.screenX,this.Dc=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.Oc&&!this.ef())return void(this.Tc=!1);if(this.Rc&&!this.sf())return void(this.Tc=!1);if(this.Xc()||this.nf()||this.jc()||this.zc()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.jc()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.zc()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.Xc()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.nf()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.rf?t.setAttribute('type','password'):t.setAttribute('type',this.zc()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.rf&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.rf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.rf&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.Tc=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.Lc-this.kc)>16||Math.abs(this.Sc-this.Dc)>16;n&&!r?(this.Tc=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.mc=0,this.Tc=!1)};ontouchmove=t=>{if(!this.Bc||!this.Tc)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.kc=0|i.screenX,this.Dc=0|i.screenY,this.Oc&&-1===this.Wo()?(this.xc-this.kc>0?this.rotate(2):this.xc-this.kc<0&&this.rotate(0),this.Mc-this.Dc>0?this.rotate(3):this.Mc-this.Dc<0&&this.rotate(1)):(this.Rc||-1!==this.Wo())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.xc=this.kc,this.Mc=this.Dc};get Bc(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get rf(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get Kc(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}ef=()=>this.yc&&this.Hl>=8&&this.Hl<=520&&this.Vl>=11&&this.Vl<=345;Xc=()=>this.yc&&-1===this.Go()&&!this.Po()&&!this.Uo()&&this.Hl>=11&&this.Hl<=506&&this.Vl>=449&&this.Vl<=482;nf=()=>this.yc&&(this.Po()||this.Uo())&&this.Hl>=11&&this.Hl<=506&&this.Vl>=383&&this.Vl<=482;sf=()=>this.yc&&this.Hl>=562&&this.Hl<=752&&this.Vl>=231&&this.Vl<=492;jc=()=>!this.yc&&2===this.Bo()&&this.Hl>=301&&this.Hl<=562&&this.Vl>=262&&this.Vl<=279;zc=()=>!this.yc&&2===this.Bo()&&this.Hl>=301&&this.Hl<=562&&this.Vl>=279&&this.Vl<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};hf=()=>null!==document.fullscreenElement;Vc=t=>{if(this.hf()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/l.Nc.height,s=(window.innerWidth-l.Nc.width*e)/2;this.Hl=0|this.lf(t.clientX-i.left-s,0,l.Nc.width*e,0,789),this.Vl=0|this.lf(t.clientY-i.top,0,l.Nc.height*e,0,532)}else{const i=l.Nc.getBoundingClientRect(),e=l.Nc.width/i.width,s=l.Nc.height/i.height;this.Hl=(t.clientX-i.left)*e|0,this.Vl=(t.clientY-i.top)*s|0}this.Hl<0&&(this.Hl=0),this.Vl<0&&(this.Vl=0),this.Hl>789&&(this.Hl=789),this.Vl>532&&(this.Vl=532)};lf=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}},2595:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1069);class n{static enabled=!1;static af=null;static cf=null;static ff=0;static uf=0;static df=0;static wf=0;static yf=0;static Af=()=>{this.af=s.A.Pt(1),this.cf=null,this.ff=performance.now(),this.enabled=!0};static mf=()=>{this.enabled=!1,this.af=null};static flush=()=>{let t=null;return this.cf&&this.enabled&&(t=this.cf),this.cf=null,t};static stop=()=>{let t=null;return this.af&&this.af.pf>0&&this.enabled&&(t=this.af),this.mf(),t};static Zc=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.uf++;const s=performance.now();let n=(s-this.ff)/10|0;n>250&&(n=250),this.ff=s,this._f(5),1===e?this.af?.p1(1):this.af?.p1(2),this.af?.p1(n),this.af?.p3(t+(i<<10))};static qc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,this._f(2),1===t?this.af?.p1(3):this.af?.p1(4),this.af?.p1(e)};static Qc=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.df>=50){this.df=e,this.uf++;let s=(e-this.ff)/10|0;s>250&&(s=250),this.ff=e,t-this.wf<8&&t-this.wf>=-8&&i-this.yf<8&&i-this.yf>=-8?(this._f(3),this.af?.p1(5),this.af?.p1(s),this.af?.p1(t+(i-this.yf+8<<4)+8-this.wf)):t-this.wf<128&&t-this.wf>=-128&&i-this.yf<128&&i-this.yf>=-128?(this._f(4),this.af?.p1(6),this.af?.p1(s),this.af?.p1(t+128-this.wf),this.af?.p1(i+128-this.yf)):(this._f(5),this.af?.p1(7),this.af?.p1(s),this.af?.p3(t+(i<<10))),this.wf=t,this.yf=i}};static Yc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this._f(3),this.af?.p1(8),this.af?.p1(e),this.af?.p1(t)};static Hc=t=>{if(!this.enabled)return;this.uf++;const i=performance.now();let e=(i-this.ff)/10|0;e>250&&(e=250),this.ff=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this._f(3),this.af?.p1(9),this.af?.p1(e),this.af?.p1(t)};static tf=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this._f(2),this.af?.p1(10),this.af?.p1(i)};static if=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this._f(2),this.af?.p1(11),this.af?.p1(i)};static Jc=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this._f(2),this.af?.p1(12),this.af?.p1(i)};static $c=()=>{if(!this.enabled)return;this.uf++;const t=performance.now();let i=(t-this.ff)/10|0;i>250&&(i=250),this.ff=t,this._f(2),this.af?.p1(13),this.af?.p1(i)};static _f=t=>{if(this.af&&this.af.pf+t>=500){const t=this.af;this.af=s.A.Pt(1),this.cf=t}}}},9091:(t,i,e)=>{e.d(i,{c:()=>n,g:()=>s});const s=['F11','F12'],n={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}}},1120:(t,i,e)=>{e.d(i,{A:()=>c});var s=e(1069),n=e(8665),r=e(2679),h=e(2511),o=e(3819),l=e(3867),a=e(8950);class c{static Do=[];static If=null;static No=null;static kl=0;static gf=1;static Nl=2;static $l=3;static ta=4;static fa=5;static wa=6;static Ca=7;static Cf=1;static Ef=2;static vf=3;static bf=4;static Tf=5;static ra=6;static ba=1;static Ta=100;static Oa=101;static Ra=200;static Of=201;static Rf=202;static La=203;static Lf=205;static Sf=300;static xf=301;static Mf=302;static kf=303;static Df=304;static Nf=305;static Ff=306;static Bf=307;static Pf=308;static Uf=309;static Gf=310;static Wf=311;static Yf=312;static Hf=313;static Vf=314;static Kf=315;static Xf=316;static jf=317;static zf=318;static Zf=319;static qf=320;static Jf=321;static $f=322;static Qf=323;static Va=324;static Ka=325;static tu=326;static Na=327;static Sa=401;static xa=500;static iu=501;static eu=502;static Da=503;static Xa=600;static su=601;static nu=602;static ru=603;static hu=604;static ou=605;static lu=606;static au=607;static cu=608;static fu=609;static uu=610;static du=611;static wu=612;static ja=613;static za=650;static Ja=651;static $a=652;static Qa=653;static tc=654;static Za=655;static yu=(t,i,e)=>{this.If=new r.A(5e4),this.No=new r.A(5e4);const n=new s.A(t.read('data'));let h=-1;for(n.pf+=2;n.pf0){s.ol=new Uint8Array(r),s.al=new Uint16Array(r);for(let t=0;t0){s.scripts=new l.fe(o,null);for(let t=0;t0){const n=e.lastIndexOf(',');s.Jl[t]=this.vu(i,e.substring(0,n),parseInt(e.substring(n+1),10))}}s.bu=new l.fe(5,null);for(let t=0;t<5;t++){const i=n.Eu;s.bu[t]=i,0===i.length&&(s.bu[t]=null)}}if(s.type===c.$l&&(s.fill=1===n.pu),s.type===c.ta||s.type===c.gf){s.oa=1===n.pu;const t=n.pu;e&&(s.font=e[t]),s.aa=1===n.pu}if(s.type===c.ta&&(s.text=n.Eu,s.sa=n.Eu),s.type!==c.gf&&s.type!==c.$l&&s.type!==c.ta||(s.Ql=n.il),s.type!==c.$l&&s.type!==c.ta||(s.ea=n.il,s.ia=n.il),s.type===c.fa){const t=n.Eu;if(t.length>0){const e=t.lastIndexOf(',');s.da=this.vu(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=n.Eu;if(e.length>0){const t=e.lastIndexOf(',');s.ua=this.vu(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(s.type===c.wa){const t=n.pu;0!==t&&(s.model=this.pa((t-1<<8)+n.pu));const i=n.pu;0!==i&&(s.Tu=this.pa((i-1<<8)+n.pu)),s._l=n.pu,0===s._l?s._l=-1:s._l=(s._l-1<<8)+n.pu,s.Il=n.pu,0===s.Il?s.Il=-1:s.Il=(s.Il-1<<8)+n.pu,s.zoom=n.Au,s.ma=n.Au,s.ga=n.Au}if(s.type===c.Ca){s.Pl=new Int32Array(s.width*s.height),s.Ul=new Int32Array(s.width*s.height),s.oa=1===n.pu;const t=n.pu;e&&(s.font=e[t]),s.aa=1===n.pu,s.Ql=n.il,s.Gl=n.Iu,s.Wl=n.Iu,s.gu=1===n.pu,s.bu=new l.fe(5,null);for(let t=0;t<5;t++){const i=n.Eu;s.bu[t]=i,0===i.length&&(s.bu[t]=null)}}s.na!==c.Ef&&s.type!==c.Nl||(s.Ou=n.Eu,s.action=n.Eu,s.Ru=n.Au),s.na!==c.Cf&&s.na!==c.bf&&s.na!==c.Tf&&s.na!==c.ra||(s.Lu=n.Eu,0===s.Lu.length&&(s.na===c.Cf?s.Lu='Ok':s.na===c.bf||s.na===c.Tf?s.Lu='Select':s.na===c.ra&&(s.Lu='Continue')))}this.If=null,this.No=null};static vu=(t,i,e)=>{const s=o.A.Su(i)<<8n|BigInt(e);if(this.If){const t=this.If.get(s);if(t)return t}let n;try{n=h.A.xu(t,i,e),this.If?.put(s,n)}catch(t){return null}return n};static pa=t=>{if(this.No){const i=this.No.get(BigInt(t));if(i)return i}const i=n.A.model(t);return this.No?.put(BigInt(t),i),i};id=-1;mu=-1;type=-1;na=-1;xl=0;width=0;height=0;_u=-1;ol=null;al=null;scripts=null;scroll=0;hide=!1;draggable=!1;gu=!1;Cu=!1;Gl=0;Wl=0;Fl=null;Bl=null;Jl=null;bu=null;fill=!1;oa=!1;font=null;aa=!1;text=null;sa=null;Ql=0;ea=0;ia=0;da=null;ua=null;model=null;Tu=null;_l=-1;Il=-1;zoom=0;ma=0;ga=0;Ou=null;action=null;Ru=-1;Lu=null;pl=null;Ol=null;Rl=null;x=0;y=0;Dl=0;Pl=null;Ul=null;Cl=0;gl=0;pa(t,i,e){let s=this.model;if(e&&(s=this.Tu),!s)return null;if(-1===t&&-1===i&&!s.Mu)return s;const r=n.A.ku(s,!0,!0,!1);return-1===t&&-1===i||r.Wa(),-1!==t&&r.Ya(t),-1!==i&&r.Ya(i),r.Ha(64,768,-50,-10,-50,!0),r}Du(){if(this.mu===this.id)return this.x;let t=c.Do[this.mu];if(!t.pl||!t.Ol||!t.Rl)return this.x;let i=t.pl.indexOf(this.id);if(-1===i)return this.x;let e=t.Ol[i];for(;t.mu!==t.id;){const s=c.Do[t.mu];s.pl&&s.Ol&&s.Rl&&(i=s.pl.indexOf(t.id),-1!==i&&(e+=s.Ol[i])),t=s}return e}Nu(){if(this.mu===this.id)return this.y;let t=c.Do[this.mu];if(!t.pl||!t.Ol||!t.Rl)return this.y;let i=t.pl.indexOf(this.id);if(-1===i)return this.y;let e=t.Rl[i];for(;t.mu!==t.id;){const s=c.Do[t.mu];s.pl&&s.Ol&&s.Rl&&(i=s.pl.indexOf(t.id),-1!==i&&(e+=s.Rl[i])),t=s}return e}outline(t){const i=this.Du(),e=this.Nu();a.A.Ll(i,e,this.width,this.height,t)}move(t,i){if(this.mu===this.id)return;this.x=0,this.y=0;const e=c.Do[this.mu];if(e.pl&&e.Ol&&e.Rl){const s=e.pl.indexOf(this.id);-1!==s&&(e.Ol[s]=t,e.Rl[s]=i)}}delete(){if(this.mu===this.id)return;const t=c.Do[this.mu];if(t.pl&&t.Ol&&t.Rl){const i=t.pl.indexOf(this.id);-1!==i&&(t.pl.splice(i,1),t.Ol.splice(i,1),t.Rl.splice(i,1))}}}},6333:(t,i,e)=>{e.d(i,{$:()=>s});class s{id;Fu=null;constructor(t){this.id=t}Bu(t){for(;;){const i=t.pu;if(0===i)break;this.decode(i,t)}return this}}},2164:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(6333);class r extends n.${static count=0;static Do=[];static yu=t=>{const i=new s.A(t.read('flo.dat'));this.count=i.Au;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static Uu=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static Gu=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);Wu=0;texture=-1;Yu=!1;Hu=!0;Vu=0;Ku=0;Xu=0;ju=0;zu=0;Zu=0;decode(t,i){1===t?(this.Wu=i.qu,this.setColor(this.Wu)):2===t?this.texture=i.pu:3===t?this.Yu=!0:5===t?this.Hu=!1:6===t?this.Fu=i.Eu:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(h=e),s>h&&(h=s);let o=0,l=0;const a=(n+h)/2;n!==h&&(a<.5&&(l=(h-n)/(h+n)),a>=.5&&(l=(h-n)/(2-h-n)),i===h?o=(e-s)/(h-n):e===h?o=(s-i)/(h-n)+2:s===h&&(o=(i-e)/(h-n)+4)),o/=6,this.Vu=256*o|0,this.Ku=256*l|0,this.Xu=256*a|0,this.Ku<0?this.Ku=0:this.Ku>255&&(this.Ku=255),this.Xu<0?this.Xu=0:this.Xu>255&&(this.Xu=255),this.ju=a>.5?(1-a)*l*512|0:a*l*512|0,this.ju<1&&(this.ju=1),this.zu=o*this.ju|0;let c=this.Vu+(16*Math.random()|0)-8;c<0?c=0:c>255&&(c=255);let f=this.Ku+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255);let u=this.Xu+(48*Math.random()|0)-24;u<0?u=0:u>255&&(u=255),this.Zu=r.Pu(c,f,u)}}},8317:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(1069),n=e(6333),r=e(8665),h=e(3867);class o extends n.${static count=0;static Do=[];static yu=t=>{const i=new s.A(t.read('idk.dat'));this.count=i.Au;for(let t=0;t=40&&t<50?this.Qu[t-40]=i.Au:t>=50&&t<60?this.td[t-50]=i.Au:t>=60&&t<70?this.$u[t-60]=i.Au:console.log('Error unrecognised config code: ',t)}pa(){if(!this.Ju)return null;const t=new h.fe(this.Ju.length,null);for(let i=0;i{e.d(i,{A:()=>c});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(1023),l=e(6169),a=e(3867);class c extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static hd=new r.A(500);static od=new r.A(30);static yu=t=>{this.sd=new n.A(t.read('loc.dat'));const i=new n.A(t.read('loc.idx'));this.count=i.Au,this.nd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%10;const i=this.cache[this.rd];return this.sd.pf=this.nd[t],i.id=t,i.reset(),i.Bu(this.sd),i.ld||(i.ld=new Int32Array(1)),-1===i.ad&&i.ld&&(i.active=i.ld.length>0&&i.ld[0]===o.A.fd.id,i.ud&&(i.active=!0)),i};static Lo=()=>{this.hd=null,this.od=null,this.nd=null,this.cache=null,this.sd=null};Ju=null;ld=null;name=null;dd=null;Qu=null;td=null;width=1;length=1;wd=!0;yd=!0;active=!1;ad=-1;Ad=!1;md=!1;Hu=!1;_l=-1;pd=!1;_d=16;Id=0;gd=0;ud=null;Cd=-1;Ed=-1;vd=!1;bd=!0;Td=128;Od=128;Rd=128;Ld=0;Sd=0;xd=0;Md=0;kd=!1;decode(t,i){if(1===t){const t=i.pu;this.Ju=new Int32Array(t),this.ld=new Int32Array(t);for(let e=0;e=30&&t<39)this.ud||(this.ud=new a.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(40===t){const t=i.pu;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e=this.Ju.length)return null;let d=this.Ju[a];if(-1===d)return null;const w=this.vd!==i>3;w&&(d+=65536);let y=c.hd?.get(BigInt(d));y||(y=h.A.model(65535&d),w&&y.Wd(),c.hd?.put(BigInt(d),y));const A=128!==this.Td||128!==this.Od||128!==this.Rd,m=0!==this.Sd||0!==this.xd||0!==this.Md;let p=h.A.ku(y,!this.Qu,!this.pd,i===l.A.Yd&&-1===o&&!A&&!m);for(-1!==o&&(p.Wa(),p.Ya(o),p.Hd=null,p.Vd=null);i-- >0;)p.Kd();if(this.Qu&&this.td)for(let t=0;t{e.d(i,{A:()=>l});var s=e(6333),n=e(1069),r=e(2679),h=e(8665),o=e(3867);class l extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static No=new r.A(30);static yu=t=>{this.sd=new n.A(t.read('npc.dat'));const i=new n.A(t.read('npc.idx'));this.count=i.Au,this.nd=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%20;const i=this.cache[this.rd]=new l(t);return this.sd.pf=this.nd[t],i.Bu(this.sd),i};static Lo=()=>{this.No=null,this.nd=null,this.cache=null,this.sd=null};name=null;dd=null;size=1;Ju=null;$u=null;pd=!1;zd=-1;Zd=-1;qd=-1;Jd=-1;$d=-1;Qu=null;td=null;ud=null;Td=-1;Od=-1;Rd=-1;Qd=!0;tw=-1;iw=128;ew=128;decode(t,i){if(1===t){const t=i.pu;this.Ju=new Uint16Array(t);for(let e=0;e=30&&t<40)this.ud||(this.ud=new o.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(40===t){const t=i.pu;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e{e.d(i,{A:()=>u});var s=e(6333),n=e(1069),r=e(2511),h=e(2679),o=e(8665),l=e(4583),a=e(8950),c=e(9298),f=e(3867);class u extends s.${static count=0;static cache=null;static sd=null;static nd=null;static rd=0;static lw=!0;static No=new h.A(50);static aw=new h.A(200);static yu=(t,i)=>{this.lw=i,this.sd=new n.A(t.read('obj.dat'));const e=new n.A(t.read('obj.idx'));this.count=e.Au,this.nd=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.nd||!this.sd)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.rd=(this.rd+1)%10;const i=this.cache[this.rd];return this.sd.pf=this.nd[t],i.id=t,i.reset(),i.Bu(this.sd),-1!==i.cw&&i.fw(),!this.lw&&i.members&&(i.name='Members Object',i.dd="Login to a members' server to use this object.",i.ud=null,i.uw=null),i};static Lo=()=>{this.No=null,this.aw=null,this.nd=null,this.cache=null,this.sd=null};static Yl=(t,i)=>{if(u.aw){let e=u.aw.get(BigInt(t));if(e&&e.dw!==i&&-1!==e.dw&&(e.ww(),e=null),e)return e}let e=u.get(t);if(e.yw||(i=-1),e.yw&&e.Aw&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.Aw[s]&&0!==e.Aw[s]&&(t=e.yw[s]);-1!==t&&(e=u.get(t))}const s=new r.A(32,32),n=l.A.ya,h=l.A.Aa,o=l.A.mw,f=a.A.pw,d=a.A._w,w=a.A.Iw,y=a.A.left,A=a.A.right,m=a.A.top,p=a.A.bottom;l.A.gw=!1,a.A.bind(s.pw,32,32),a.A.fillRect(0,0,32,32,c.A.Zl),l.A.Fc();const _=e.Cw(1),I=l.A.sin[e.Ew]*e.bw>>16,g=l.A.cos[e.Ew]*e.bw>>16;_.Ia(0,e.Tw,e.Ow,e.Ew,e.Rw,I+(_.jd/2|0)+e.Lw,g+e.Lw);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.pw[t+32*i]&&(t>0&&s.pw[t+32*i-1]>1||i>0&&s.pw[t+32*(i-1)]>1||t<31&&s.pw[t+32*i+1]>1||i<31&&s.pw[t+32*(i+1)]>1)&&(s.pw[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.pw[t+32*i]&&t>0&&i>0&&s.pw[t+32*(i-1)-1]>0&&(s.pw[t+32*i]=3153952);if(-1!==e.cw){const t=this.Yl(e.Sw,10),i=t.Xl,s=t.dw;t.Xl=32,t.dw=32,t.xw(5,5,22,22),t.Xl=i,t.dw=s}return u.aw?.put(BigInt(t),s),a.A.bind(f,d,w),a.A.Tl(y,m,A,p),l.A.ya=n,l.A.Aa=h,l.A.mw=o,l.A.gw=!0,e.Ea?s.Xl=33:s.Xl=32,s.dw=i,s};model=0;name=null;dd=null;Qu=null;td=null;bw=2e3;Ew=0;Tw=0;Ow=0;Rw=0;Lw=0;Mw=!1;kw=-1;Ea=!1;Dw=1;members=!1;ud=null;uw=null;Nw=-1;Fw=-1;Bw=0;Pw=-1;Uw=-1;Gw=0;Ww=-1;Yw=-1;Hw=-1;Vw=-1;Kw=-1;Xw=-1;yw=null;Aw=null;Sw=-1;cw=-1;decode(t,i){if(1===t)this.model=i.Au;else if(2===t)this.name=i.Eu;else if(3===t)this.dd=i.Eu;else if(4===t)this.bw=i.Au;else if(5===t)this.Ew=i.Au;else if(6===t)this.Tw=i.Au;else if(7===t)this.Rw=i.Iu,this.Rw>32767&&(this.Rw-=65536);else if(8===t)this.Lw=i.Iu,this.Lw>32767&&(this.Lw-=65536);else if(9===t)this.Mw=!0;else if(10===t)this.kw=i.Au;else if(11===t)this.Ea=!0;else if(12===t)this.Dw=i.il;else if(16===t)this.members=!0;else if(23===t)this.Nw=i.Au,this.Bw=i.Dd;else if(24===t)this.Fw=i.Au;else if(25===t)this.Pw=i.Au,this.Gw=i.Dd;else if(26===t)this.Uw=i.Au;else if(t>=30&&t<35)this.ud||(this.ud=new f.fe(5,null)),this.ud[t-30]=i.Eu,'hidden'===this.ud[t-30]?.toLowerCase()&&(this.ud[t-30]=null);else if(t>=35&&t<40)this.uw||(this.uw=new f.fe(5,null)),this.uw[t-35]=i.Eu;else if(40===t){const t=i.pu;this.Qu=new Uint16Array(t),this.td=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.yw&&this.Aw||(this.yw=new Uint16Array(10),this.Aw=new Uint16Array(10)),this.yw[t-100]=i.Au,this.Aw[t-100]=i.Au)}jw(t){let i=this.Nw;if(1===t&&(i=this.Pw),-1===i)return null;let e=this.Fw,s=this.Ww;1===t&&(e=this.Uw,s=this.Yw);let n=o.A.model(i);if(-1!==e){const t=o.A.model(e);if(-1===s){const i=[n,t];n=o.A.Fa(i,2)}else{const i=[n,t,o.A.model(s)];n=o.A.Fa(i,3)}}if(0===t&&0!==this.Bw&&n.translate(this.Bw,0,0),1===t&&0!==this.Gw&&n.translate(this.Gw,0,0),this.Qu&&this.td)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.Aw[e]&&0!==this.Aw[e]&&(i=this.yw[e]);if(-1!==i)return u.get(i).Cw(1)}if(u.No){const t=u.No.get(BigInt(this.id));if(t)return t}const i=o.A.model(this.model);if(this.Qu&&this.td)for(let t=0;t{e.d(i,{A:()=>h});var s=e(6333),n=e(1069),r=e(6730);class h extends s.${static count=0;static Do=[];static yu=t=>{const i=new n.A(t.read('seq.dat'));this.count=i.Au;for(let t=0;t{e.d(i,{A:()=>l});var s=e(6333),n=e(1069),r=e(1312),h=e(8665),o=e(2679);class l extends s.${static count=0;static Do=[];static No=new o.A(30);static yu=t=>{const i=new n.A(t.read('spotanim.dat'));this.count=i.Au;for(let t=0;t=40&&t<50?this.Qu[t-40]=i.Au:t>=50&&t<60?this.td[t-50]=i.Au:console.log('Error unrecognised spotanim config code: ',t)}pa(){let t=l.No?.get(BigInt(this.id));if(t)return t;t=h.A.model(this.model);for(let i=0;i<6;i++)0!==this.Qu[0]&&t.Ba(this.Qu[i],this.td[i]);return l.No?.put(BigInt(this.id),t),t}}},3764:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(6333),n=e(1069);class r extends s.${static count=0;static Do=[];static ty=[];static iy=0;static yu=t=>{const i=new n.A(t.read('varp.dat'));this.count=i.Au;for(let t=0;t{e.d(i,{A:()=>s});class s{static OPEN=0;static ly=1;static uy=2;static wy=4;static yy=8;static Ay=s.ly<<4;static my=s.uy<<4;static py=s.wy<<4;static _y=s.yy<<4;static Iy=256;static gy=512;static Cy=1024;static Ey=2048;static vy=4096;static by=s.gy<<4;static Ty=s.Cy<<4;static Oy=s.Ey<<4;static Ry=s.vy<<4;static Ly=s.Iy<<9;static Sy=524288;static xy=2097152;static My=s.xy|s.Sy;static ky=s.Iy|s.My;static Dy=s.uy|s.ky;static Ny=s.yy|s.ky;static Fy=s.uy|s.wy|s.Ny;static By=s.my|s.ky;static Py=s.yy|s.Ay|s.By;static Uy=s._y|s.ky;static Gy=s.ly|s.uy|s.Uy;static Wy=s.my|s.py|s.Uy;static Yy=16777215}},670:(t,i,e)=>{e.d(i,{A:()=>o});var s=e(9456),n=e(6169),r=e(1023),h=e(4909);class o{static Dr=4;static jr=104;static index=(t,i)=>t*o.jr+i;offsetX;Hy;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.Hy=0,this.sizeX=o.jr,this.sizeZ=o.jr,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[o.index(t-this.offsetX,i-this.Hy)]|=s.A.xy};Ky=(t,i)=>{this.flags[o.index(t-this.offsetX,i-this.Hy)]&=~s.A.xy};Xy=(t,i,e,r,h,o)=>{let l=s.A.Iy;o&&(l|=s.A.Ly);const a=t-this.offsetX,c=i-this.Hy;if(h===n.A.jy||h===n.A.zy){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{let l=s.A.Iy;o&&(l|=s.A.Ly);const a=t-this.offsetX,c=i-this.Hy;if(h===n.A.jy||h===n.A.zy){const t=e;e=r,r=t}for(let t=a;t=0&&t=0&&i{const l=t-this.offsetX,a=i-this.Hy,c=o?s.A.Ry:s.A._y,f=o?s.A.vy:s.A.yy,u=o?s.A.Cy:s.A.uy,d=o?s.A.Ty:s.A.my,w=o?s.A.gy:s.A.ly,y=o?s.A.by:s.A.Ay,A=o?s.A.Ey:s.A.wy,m=o?s.A.Oy:s.A.py;e===r.A.Jy.id?h===n.A.Yd?(this.add(l,a,c),this.add(l-1,a,f)):h===n.A.jy?(this.add(l,a,u),this.add(l,a+1,d)):h===n.A.$y?(this.add(l,a,f),this.add(l+1,a,c)):h===n.A.zy&&(this.add(l,a,d),this.add(l,a-1,u)):e===r.A.Qy.id||e===r.A.tA.id?h===n.A.Yd?(this.add(l,a,w),this.add(l-1,a+1,y)):h===n.A.jy?(this.add(l,a,A),this.add(l+1,a+1,m)):h===n.A.$y?(this.add(l,a,y),this.add(l+1,a-1,w)):h===n.A.zy&&(this.add(l,a,m),this.add(l-1,a-1,A)):e===r.A.iA.id&&(h===n.A.Yd?(this.add(l,a,u|c),this.add(l-1,a,f),this.add(l,a+1,d)):h===n.A.jy?(this.add(l,a,u|f),this.add(l,a+1,d),this.add(l+1,a,c)):h===n.A.$y?(this.add(l,a,d|f),this.add(l+1,a,c),this.add(l,a-1,u)):h===n.A.zy&&(this.add(l,a,d|c),this.add(l,a-1,u),this.add(l-1,a,f))),o&&this.qy(t,i,e,h,!1)};eA=(t,i,e,h,o)=>{const l=t-this.offsetX,a=i-this.Hy,c=o?s.A.Ry:s.A._y,f=o?s.A.vy:s.A.yy,u=o?s.A.Cy:s.A.uy,d=o?s.A.Ty:s.A.my,w=o?s.A.gy:s.A.ly,y=o?s.A.by:s.A.Ay,A=o?s.A.Ey:s.A.wy,m=o?s.A.Oy:s.A.py;e===r.A.Jy.id?h===n.A.Yd?(this.remove(l,a,c),this.remove(l-1,a,f)):h===n.A.jy?(this.remove(l,a,u),this.remove(l,a+1,d)):h===n.A.$y?(this.remove(l,a,f),this.remove(l+1,a,c)):h===n.A.zy&&(this.remove(l,a,d),this.remove(l,a-1,u)):e===r.A.Qy.id||e===r.A.tA.id?h===n.A.Yd?(this.remove(l,a,w),this.remove(l-1,a+1,y)):h===n.A.jy?(this.remove(l,a,A),this.remove(l+1,a+1,m)):h===n.A.$y?(this.remove(l,a,y),this.remove(l+1,a-1,w)):h===n.A.zy&&(this.remove(l,a,m),this.remove(l-1,a-1,A)):e===r.A.iA.id&&(h===n.A.Yd?(this.remove(l,a,u|c),this.remove(l-1,a,f),this.remove(l,a+1,d)):h===n.A.jy?(this.remove(l,a,u|f),this.remove(l,a+1,d),this.remove(l+1,a,c)):h===n.A.$y?(this.remove(l,a,d|f),this.remove(l+1,a,c),this.remove(l,a-1,u)):h===n.A.zy&&(this.remove(l,a,d|c),this.remove(l,a-1,u),this.remove(l-1,a,f))),o&&this.eA(t,i,e,h,!1)};sA=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Hy,u=e-this.offsetX,d=h-this.Hy,w=o.index(c,f);if(l===r.A.Jy.id){if(a===n.A.Yd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(a===n.A.jy){if(c===u&&f===d+1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0}else if(a===n.A.$y){if(c===u+1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(a===n.A.zy){if(c===u&&f===d-1)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0}}else if(l===r.A.iA.id){if(a===n.A.Yd){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(a===n.A.jy){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u&&f===d+1)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.Dy)===s.A.OPEN)return!0}else if(a===n.A.$y){if(c===u-1&&f===d&&(this.flags[w]&s.A.Ny)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u+1&&f===d)return!0;if(c===u&&f===d-1)return!0}else if(a===n.A.zy){if(c===u-1&&f===d)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.By)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A.Uy)===s.A.OPEN)return!0;if(c===u&&f===d-1)return!0}}else if(l===r.A.nA.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.my)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A._y)===s.A.OPEN)return!0}return!1};rA=(t,i,e,h,l,a)=>{if(t===e&&i===h)return!0;const c=t-this.offsetX,f=i-this.Hy,u=e-this.offsetX,d=h-this.Hy,w=o.index(c,f);if(l===r.A.hA.id||l===r.A.oA.id){if(l===r.A.oA.id&&(a=a+2&3),a===n.A.Yd){if(c===u+1&&f===d&&(this.flags[w]&s.A._y)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0}else if(a===n.A.jy){if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0}else if(a===n.A.$y){if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.my)===s.A.OPEN)return!0}else if(a===n.A.zy){if(c===u+1&&f===d&&(this.flags[w]&s.A._y)===s.A.OPEN)return!0;if(c===u&&f===d+1&&(this.flags[w]&s.A.my)===s.A.OPEN)return!0}}else if(l===r.A.lA.id){if(c===u&&f===d+1&&(this.flags[w]&s.A.my)===s.A.OPEN)return!0;if(c===u&&f===d-1&&(this.flags[w]&s.A.uy)===s.A.OPEN)return!0;if(c===u-1&&f===d&&(this.flags[w]&s.A.yy)===s.A.OPEN)return!0;if(c===u+1&&f===d&&(this.flags[w]&s.A._y)===s.A.OPEN)return!0}return!1};aA=(t,i,e,n,r,l,a)=>{const c=e+r-1,f=n+l-1,u=o.index(t-this.offsetX,i-this.Hy);return t>=e&&t<=c&&i>=n&&i<=f||(t===e-1&&i>=n&&i<=f&&(this.flags[u]&s.A.yy)===s.A.OPEN&&(a&h.A.Yd)===s.A.OPEN||(t===c+1&&i>=n&&i<=f&&(this.flags[u]&s.A._y)===s.A.OPEN&&(a&h.A.$y)===s.A.OPEN||(i===n-1&&t>=e&&t<=c&&(this.flags[u]&s.A.uy)===s.A.OPEN&&(a&h.A.zy)===s.A.OPEN||i===f+1&&t>=e&&t<=c&&(this.flags[u]&s.A.my)===s.A.OPEN&&(a&h.A.jy)===s.A.OPEN)))};add=(t,i,e)=>{this.flags[o.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[o.index(t,i)]&=s.A.Yy-e}}},4909:(t,i,e)=>{e.d(i,{A:()=>s});class s{static jy=1;static $y=2;static zy=4;static Yd=8}},6169:(t,i,e)=>{e.d(i,{A:()=>s});class s{static Yd=0;static jy=1;static $y=2;static zy=3}},5599:(t,i,e)=>{e.d(i,{A:()=>s});class s{static cA=0;static fA=1;static uA=2;static dA=3}},1023:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5599);class n{static Jy=new n(0,s.A.cA);static Qy=new n(1,s.A.cA);static iA=new n(2,s.A.cA);static tA=new n(3,s.A.cA);static wA=new n(4,s.A.fA);static yA=new n(5,s.A.fA);static hA=new n(6,s.A.fA);static oA=new n(7,s.A.fA);static lA=new n(8,s.A.fA);static nA=new n(9,s.A.uA);static fd=new n(10,s.A.uA);static AA=new n(11,s.A.uA);static mA=new n(12,s.A.uA);static pA=new n(13,s.A.uA);static _A=new n(14,s.A.uA);static IA=new n(15,s.A.uA);static gA=new n(16,s.A.uA);static CA=new n(17,s.A.uA);static EA=new n(18,s.A.uA);static vA=new n(19,s.A.uA);static bA=new n(20,s.A.uA);static TA=new n(21,s.A.uA);static dA=new n(22,s.A.dA);static values(){return[this.Jy,this.Qy,this.CA,this.IA,this.iA,this._A,this.nA,this.tA,this.dA,this.mA,this.AA,this.hA,this.bA,this.fd,this.yA,this.pA,this.oA,this.wA,this.gA,this.lA,this.vA,this.TA,this.EA]}static of(t){const i=this.values();for(let e=0;e{e.d(i,{A:()=>A});var s=e(670),n=e(2164),r=e(1069),h=e(4583),o=e(3045),l=e(5637),a=e(4197),c=e(1312),f=e(1023),u=e(6169),d=e(9298),w=e(5518),y=e(3867);class A{static OA=Int8Array.of(1,2,4,8);static RA=Uint8Array.of(16,32,64,128);static LA=Int8Array.of(1,0,-1,0);static SA=Int8Array.of(0,-1,0,1);static xA=(17*Math.random()|0)-8;static MA=(33*Math.random()|0)-16;static et=!0;static kA=0;static DA=!1;static NA=(t,i)=>{let e=this.FA(t+45365,i+91923,4)+(this.FA(t+10294,i+37821,2)-128>>1)+(this.FA(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static FA=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.BA(s,r),l=this.BA(s+1,r),a=this.BA(s,r+1),c=this.BA(s+1,r+1),f=this.PA(o,l,n,e),u=this.PA(a,c,n,e);return this.PA(f,u,h,e)};static PA=(t,i,e,s)=>{const n=65536-h.A.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static BA=(t,i)=>((this.UA(t-1,i-1)+this.UA(t+1,i-1)+this.UA(t-1,i+1)+this.UA(t+1,i+1))/16|0)+((this.UA(t-1,i)+this.UA(t+1,i)+this.UA(t,i-1)+this.UA(t,i+1))/8|0)+(this.UA(t,i)/4|0);static UA=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static Xy=(t,i,e,s,n,r,h,o,d,w,y)=>{const m=n[y][i][e],p=n[y][i+1][e],_=n[y][i+1][e+1],I=n[y][i][e+1],g=m+p+_+I>>2,C=l.A.get(o);let E=i+(e<<7)+(o<<14)+1073741824|0;C.active||(E+=-2147483648),E|=0;const v=(w<<6)+d<<24>>24;if(d===f.A.dA.id)s?.GA(C.pa(f.A.dA.id,w,m,p,_,I,-1),t,i,e,g,E,v),C.wd&&C.active&&h?.Vy(i,e),-1!==C._l&&r.WA(new a.A(o,t,3,i,e,c.A.Do[C._l],!0));else if(d===f.A.fd.id||d===f.A.AA.id){const n=C.pa(f.A.fd.id,w,m,p,_,I,-1);if(n){let r,h,o=0;d===f.A.AA.id&&(o+=256),w===u.A.jy||w===u.A.zy?(r=C.length,h=C.width):(r=C.width,h=C.length),s?.Xy(t,i,e,g,n,null,E,v,r,h,o)}C.wd&&h?.Xy(i,e,C.width,C.length,w,C.yd),-1!==C._l&&r.WA(new a.A(o,t,2,i,e,c.A.Do[C._l],!0))}else if(d>=f.A.mA.id)s?.Xy(t,i,e,g,C.pa(d,w,m,p,_,I,-1),null,E,v,1,1,0),C.wd&&h?.Xy(i,e,C.width,C.length,w,C.yd),-1!==C._l&&r.WA(new a.A(o,t,2,i,e,c.A.Do[C._l],!0));else if(d===f.A.Jy.id)s?.qy(t,i,e,g,A.OA[w],0,C.pa(f.A.Jy.id,w,m,p,_,I,-1),null,E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C._l&&r.WA(new a.A(o,t,0,i,e,c.A.Do[C._l],!0));else if(d===f.A.Qy.id)s?.qy(t,i,e,g,A.RA[w],0,C.pa(f.A.Qy.id,w,m,p,_,I,-1),null,E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C._l&&r.WA(new a.A(o,t,0,i,e,c.A.Do[C._l],!0));else if(d===f.A.iA.id){const n=w+1&3;s?.qy(t,i,e,g,A.OA[w],A.OA[n],C.pa(f.A.iA.id,w+4,m,p,_,I,-1),C.pa(f.A.iA.id,n,m,p,_,I,-1),E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C._l&&r.WA(new a.A(o,t,0,i,e,c.A.Do[C._l],!0))}else if(d===f.A.tA.id)s?.qy(t,i,e,g,A.RA[w],0,C.pa(f.A.tA.id,w,m,p,_,I,-1),null,E,v),C.wd&&h?.qy(i,e,d,w,C.yd),-1!==C._l&&r.WA(new a.A(o,t,0,i,e,c.A.Do[C._l],!0));else if(d===f.A.nA.id)s?.Xy(t,i,e,g,C.pa(d,w,m,p,_,I,-1),null,E,v,1,1,0),C.wd&&h?.Xy(i,e,C.width,C.length,w,C.yd),-1!==C._l&&r.WA(new a.A(o,t,2,i,e,c.A.Do[C._l],!0));else if(d===f.A.wA.id)s?.YA(t,i,e,g,0,0,E,C.pa(f.A.wA.id,u.A.Yd,m,p,_,I,-1),v,512*w,A.OA[w]),-1!==C._l&&r.WA(new a.A(o,t,1,i,e,c.A.Do[C._l],!0));else if(d===f.A.yA.id){let n=16;if(s){const r=s.HA(t,i,e);r>0&&(n=l.A.get(r>>14&32767)._d)}s?.YA(t,i,e,g,A.LA[w]*n,A.SA[w]*n,E,C.pa(f.A.wA.id,u.A.Yd,m,p,_,I,-1),v,512*w,A.OA[w]),-1!==C._l&&r.WA(new a.A(o,t,1,i,e,c.A.Do[C._l],!0))}else d===f.A.hA.id?(s?.YA(t,i,e,g,0,0,E,C.pa(f.A.wA.id,u.A.Yd,m,p,_,I,-1),v,w,256),-1!==C._l&&r.WA(new a.A(o,t,1,i,e,c.A.Do[C._l],!0))):d===f.A.oA.id?(s?.YA(t,i,e,g,0,0,E,C.pa(f.A.wA.id,u.A.Yd,m,p,_,I,-1),v,w,512),-1!==C._l&&r.WA(new a.A(o,t,1,i,e,c.A.Do[C._l],!0))):d===f.A.lA.id&&(s?.YA(t,i,e,g,0,0,E,C.pa(f.A.wA.id,u.A.Yd,m,p,_,I,-1),v,w,768),-1!==C._l&&r.WA(new a.A(o,t,1,i,e,c.A.Do[C._l],!0)))};VA;KA;Hr;Vr;XA;jA;zA;ZA;qA;JA;$A;QA;tm;im;sm;nm;constructor(t,i,e,n){this.VA=t,this.KA=i,this.Hr=e,this.Vr=n,this.XA=new y.rm(s.A.Dr,t,i),this.jA=new y.rm(s.A.Dr,t,i),this.zA=new y.rm(s.A.Dr,t,i),this.ZA=new y.rm(s.A.Dr,t,i),this.nm=new y.hm(s.A.Dr,t+1,i+1),this.qA=new y.rm(s.A.Dr,t+1,i+1),this.JA=new y.Xr(t+1,i+1),this.$A=new Int32Array(i),this.QA=new Int32Array(i),this.tm=new Int32Array(i),this.im=new Int32Array(i),this.sm=new Int32Array(i)}om=(t,i)=>{for(let t=0;t=0&&i[s]?.Vy(e,n)}A.xA+=(5*Math.random()|0)-2,A.xA<-8?A.xA=-8:A.xA>8&&(A.xA=8),A.MA+=(5*Math.random()|0)-2,A.MA<-16?A.MA=-16:A.MA>16&&(A.MA=16);for(let i=0;i>8;for(let t=1;t>2)+(e[n+1][t]>>3)+(e[n][t-1]>>2)+(e[n][t+1]>>3)+(e[n][t]>>1);this.JA[n][t]=u-d}for(let t=0;t=0&&s0){const i=n.A.Do[e-1];this.$A[t]+=i.zu,this.QA[t]+=i.Ku,this.tm[t]+=i.Xu,this.im[t]+=i.ju,r=this.sm[t]++}}const h=e-5;if(h>=0&&h0){const i=n.A.Do[e-1];this.$A[t]-=i.zu,this.QA[t]-=i.Ku,this.tm[t]-=i.Xu,this.im[t]-=i.ju,r=this.sm[t]--}}}if(e>=1&&e=0&&f=0&&y=1&&c0||y>0){const m=this.Hr[i][e][c],p=this.Hr[i][e+1][c],_=this.Hr[i][e+1][c+1],I=this.Hr[i][e][c+1],g=this.JA[e][c],C=this.JA[e+1][c],E=this.JA[e+1][c+1],v=this.JA[e][c+1];let b=-1,T=-1;if(f>0){const t=256*s/l|0,i=r/a|0;let e=o/a|0;b=n.A.Pu(t,i,e);const h=t+A.xA&255;e+=A.MA,e<0?e=0:e>255&&(e=255),T=n.A.Pu(h,i,e)}if(i>0){let t=0!==f||this.zA[i][e][c]===w.A.am;y>0&&!n.A.Do[y-1].Hu&&(t=!1),t&&m===p&&m===_&&m===I&&(this.nm[i][e][c]|=2340)}let O=0;if(-1!==b&&(O=h.A.palette[n.A.Uu(T,96)]),0===y)t?.fm(i,e,c,w.A.am,u.A.Yd,-1,m,p,_,I,n.A.Uu(b,g),n.A.Uu(b,C),n.A.Uu(b,E),n.A.Uu(b,v),d.A.Zl,d.A.Zl,d.A.Zl,d.A.Zl,O,d.A.Zl);else{const s=this.zA[i][e][c]+1,r=this.ZA[i][e][c],o=n.A.Do[y-1];let l,a,f=o.texture;f>=0?(a=h.A.um(f),l=-1):o.Wu===d.A.dm?(a=0,l=-2,f=-1):(l=n.A.Pu(o.Vu,o.Ku,o.Xu),a=h.A.palette[n.A.Gu(o.Zu,96)]),t?.fm(i,e,c,s,r,f,m,p,_,I,n.A.Uu(b,g),n.A.Uu(b,C),n.A.Uu(b,E),n.A.Uu(b,v),n.A.Gu(l,g),n.A.Gu(l,C),n.A.Gu(l,E),n.A.Gu(l,v),O,a)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let s=0;s<=n;s++)for(let r=0;r<=this.KA;r++)for(let h=0;h<=this.VA;h++){if(this.nm[s][h][r]&t){let i=r,e=r,l=s,a=s;for(;i>0&&this.nm[s][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.nm[l-1][h][s]&t))break t;l--}t:for(;a=8){const s=this.Hr[a][h][i]-240,r=this.Hr[l][h][i];o.A.pm(n,1,128*h,s,128*i,128*h,r,128*e+128);for(let s=l;s<=a;s++)for(let n=i;n<=e;n++)this.nm[s][h][n]&=~t}}if(this.nm[s][h][r]&i){let t=h,e=h,l=s,a=s;for(;t>0&&this.nm[s][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.nm[l-1][s][r]&i))break t;l--}t:for(;a=8){const s=this.Hr[a][t][r]-240,h=this.Hr[l][t][r];o.A.pm(n,2,128*t,s,128*r,128*e+128,h,128*r);for(let s=l;s<=a;s++)for(let n=t;n<=e;n++)this.nm[s][n][r]&=~i}}if(this.nm[s][h][r]&e){let t=h,i=h,l=r,a=r;for(;l>0&&this.nm[s][h][l-1]&e;)l--;for(;a0;){for(let i=l;i<=a;i++)if(!(this.nm[s][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.Hr[s][t][l];o.A.pm(n,4,128*t,r,128*l,128*i+128,r,128*a+128);for(let n=t;n<=i;n++)for(let t=l;t<=a;t++)this.nm[s][n][t]&=~e}}}}}};_m=(t,i,e,r)=>{let h=0;for(let t=0;t>24;break}for(let n=t;n=0&&t=0&&n{const o=new r.A(new Uint8Array(h));for(let r=0;r=0&&a=0&&c>24,this.ZA[r][a][c]=(f-2&3)<<24>>24):f<=81?this.Vr[r][a][c]=f-49<<24>>24:this.XA[r][a][c]=f-81<<24>>24}else for(;f=o.pu,0!==f;){if(1===f){o.pu;break}f<=49&&o.pu}}};gm=(t,i,e,n,h,o)=>{const l=new r.A(new Uint8Array(n));let a=-1;for(;;){const n=l.Cm;if(0===n)return;a+=n;let r=0;for(;;){const n=l.Cm;if(0===n)break;r+=n-1;const c=63&r,f=r>>6&63,u=r>>12,d=l.pu,w=d>>2,y=3&d,A=f+h,m=c+o;if(A>0&&m>0&&A=0&&(n=e[s]),this.Xy(u,A,m,t,i,n,a,w,y)}}}};Xy=(t,i,e,s,n,r,h,o,d)=>{if(A.et){if(16&this.Vr[t][i][e])return;if(this.lm(t,i,e)!==A.kA)return}const w=this.Hr[t][i][e],y=this.Hr[t][i+1][e],m=this.Hr[t][i+1][e+1],p=this.Hr[t][i][e+1],_=w+y+m+p>>2,I=l.A.get(h);let g=i+(e<<7)+(h<<14)+1073741824|0;I.active||(g+=-2147483648),g|=0;const C=(d<<6)+o<<24>>24;if(o===f.A.dA.id)(!A.et||I.active||I.kd)&&(s?.GA(I.pa(f.A.dA.id,d,w,y,m,p,-1),t,i,e,_,g,C),I.wd&&I.active&&r?.Vy(i,e),-1!==I._l&&n.WA(new a.A(h,t,3,i,e,c.A.Do[I._l],!0)));else if(o===f.A.fd.id||o===f.A.AA.id){const l=I.pa(f.A.fd.id,d,w,y,m,p,-1);if(l){let n,r,h=0;if(o===f.A.AA.id&&(h+=256),d===u.A.jy||d===u.A.zy?(n=I.length,r=I.width):(n=I.width,r=I.length),s?.Xy(t,i,e,_,l,null,g,C,n,r,h)&&I.bd)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=l.Em/4|0;r>30&&(r=30),r>this.qA[t][i+s][e+n]&&(this.qA[t][i+s][e+n]=r<<24>>24)}}I.wd&&r?.Xy(i,e,I.width,I.length,d,I.yd),-1!==I._l&&n.WA(new a.A(h,t,2,i,e,c.A.Do[I._l],!0))}else if(o>=f.A.mA.id)s?.Xy(t,i,e,_,I.pa(o,d,w,y,m,p,-1),null,g,C,1,1,0),o>=f.A.mA.id&&o<=f.A.CA.id&&o!==f.A.pA.id&&t>0&&(this.nm[t][i][e]|=2340),I.wd&&r?.Xy(i,e,I.width,I.length,d,I.yd),-1!==I._l&&n.WA(new a.A(h,t,2,i,e,c.A.Do[I._l],!0));else if(o===f.A.Jy.id)s?.qy(t,i,e,_,A.OA[d],0,I.pa(f.A.Jy.id,d,w,y,m,p,-1),null,g,C),d===u.A.Yd?(I.bd&&(this.qA[t][i][e]=50,this.qA[t][i][e+1]=50),I.Hu&&(this.nm[t][i][e]|=585)):d===u.A.jy?(I.bd&&(this.qA[t][i][e+1]=50,this.qA[t][i+1][e+1]=50),I.Hu&&(this.nm[t][i][e+1]|=1170)):d===u.A.$y?(I.bd&&(this.qA[t][i+1][e]=50,this.qA[t][i+1][e+1]=50),I.Hu&&(this.nm[t][i+1][e]|=585)):d===u.A.zy&&(I.bd&&(this.qA[t][i][e]=50,this.qA[t][i+1][e]=50),I.Hu&&(this.nm[t][i][e]|=1170)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I._l&&n.WA(new a.A(h,t,0,i,e,c.A.Do[I._l],!0)),16!==I._d&&s?.vm(t,i,e,I._d);else if(o===f.A.Qy.id)s?.qy(t,i,e,_,A.RA[d],0,I.pa(f.A.Qy.id,d,w,y,m,p,-1),null,g,C),I.bd&&(d===u.A.Yd?this.qA[t][i][e+1]=50:d===u.A.jy?this.qA[t][i+1][e+1]=50:d===u.A.$y?this.qA[t][i+1][e]=50:d===u.A.zy&&(this.qA[t][i][e]=50)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I._l&&n.WA(new a.A(h,t,0,i,e,c.A.Do[I._l],!0));else if(o===f.A.iA.id){const l=d+1&3;s?.qy(t,i,e,_,A.OA[d],A.OA[l],I.pa(f.A.iA.id,d+4,w,y,m,p,-1),I.pa(f.A.iA.id,l,w,y,m,p,-1),g,C),I.Hu&&(d===u.A.Yd?(this.nm[t][i][e]|=265,this.nm[t][i][e+1]|=1170):d===u.A.jy?(this.nm[t][i][e+1]|=1170,this.nm[t][i+1][e]|=585):d===u.A.$y?(this.nm[t][i+1][e]|=585,this.nm[t][i][e]|=1170):d===u.A.zy&&(this.nm[t][i][e]|=1170,this.nm[t][i][e]|=585)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I._l&&n.WA(new a.A(h,t,0,i,e,c.A.Do[I._l],!0)),16!==I._d&&s?.vm(t,i,e,I._d)}else if(o===f.A.tA.id)s?.qy(t,i,e,_,A.RA[d],0,I.pa(f.A.tA.id,d,w,y,m,p,-1),null,g,C),I.bd&&(d===u.A.Yd?this.qA[t][i][e+1]=50:d===u.A.jy?this.qA[t][i+1][e+1]=50:d===u.A.$y?this.qA[t][i+1][e]=50:d===u.A.zy&&(this.qA[t][i][e]=50)),I.wd&&r?.qy(i,e,o,d,I.yd),-1!==I._l&&n.WA(new a.A(h,t,0,i,e,c.A.Do[I._l],!0));else if(o===f.A.nA.id)s?.Xy(t,i,e,_,I.pa(o,d,w,y,m,p,-1),null,g,C,1,1,0),I.wd&&r?.Xy(i,e,I.width,I.length,d,I.yd),-1!==I._l&&n.WA(new a.A(h,t,2,i,e,c.A.Do[I._l],!0));else if(o===f.A.wA.id)s?.YA(t,i,e,_,0,0,g,I.pa(f.A.wA.id,u.A.Yd,w,y,m,p,-1),C,512*d,A.OA[d]),-1!==I._l&&n.WA(new a.A(h,t,1,i,e,c.A.Do[I._l],!0));else if(o===f.A.yA.id){let r=16;if(s){const n=s.HA(t,i,e);n>0&&(r=l.A.get(n>>14&32767)._d)}s?.YA(t,i,e,_,A.LA[d]*r,A.SA[d]*r,g,I.pa(f.A.wA.id,u.A.Yd,w,y,m,p,-1),C,512*d,A.OA[d]),-1!==I._l&&n.WA(new a.A(h,t,1,i,e,c.A.Do[I._l],!0))}else o===f.A.hA.id?(s?.YA(t,i,e,_,0,0,g,I.pa(f.A.wA.id,u.A.Yd,w,y,m,p,-1),C,d,256),-1!==I._l&&n.WA(new a.A(h,t,1,i,e,c.A.Do[I._l],!0))):o===f.A.oA.id?(s?.YA(t,i,e,_,0,0,g,I.pa(f.A.wA.id,u.A.Yd,w,y,m,p,-1),C,d,512),-1!==I._l&&n.WA(new a.A(h,t,1,i,e,c.A.Do[I._l],!0))):o===f.A.lA.id&&(s?.YA(t,i,e,_,0,0,g,I.pa(f.A.wA.id,u.A.Yd,w,y,m,p,-1),C,d,768),-1!==I._l&&n.WA(new a.A(h,t,1,i,e,c.A.Do[I._l],!0)))};lm=(t,i,e)=>8&this.Vr[t][i][e]?0:t<=0||!(2&this.Vr[1][i][e])?t:t-1}},3045:(t,i,e)=>{e.d(i,{A:()=>_});var s=e(4583),n=e(1161),r=e(3795),h=e(8256),o=e(670),l=e(9222),a=e(6855),c=e(7441),f=e(6666),u=e(5748),d=e(3479),w=e(8950),y=e(2771),A=e(5518),m=e(6169),p=e(3867);class _{static bm=new p.Tm(8,32,51,51,!1);static Om=new p.fe(100,null);static Rm=new Int32Array(o.A.Dr);static Lm=new p.Sm(o.A.Dr,500,null);static xm=new p.fe(500,null);static Mm=new f.A;static km=0;static Dm=0;static Nm=0;static Fm=0;static Bm=0;static Pm=0;static Um=0;static Gm=0;static Wm=0;static Ym=0;static Hm=0;static Vm=0;static Km=0;static Xm=0;static jm=0;static zm=0;static Zm=0;static qm=0;static Jm=0;static $m=0;static Qm=0;static tp=0;static ip=!1;static ep=null;static sp=Uint8Array.of(19,55,38,155,255,110,137,205,76);static np=Uint8Array.of(160,192,80,96,0,144,80,48,160);static rp=Uint8Array.of(76,8,137,4,0,1,38,2,19);static hp=Int8Array.of(0,0,2,0,0,2,1,1,0);static op=Int8Array.of(2,0,0,2,0,0,0,4,4);static lp=Int8Array.of(0,4,4,8,0,0,8,0,0);static ap=Int8Array.of(1,1,0,0,0,8,0,0,8);static cp=Int8Array.of(53,-53,-53,53);static fp=Int8Array.of(-53,-53,53,53);static up=Int8Array.of(-45,45,45,-45);static dp=Int8Array.of(45,45,-45,-45);static wp=[new Int8Array(16),Int8Array.of(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,1),Int8Array.of(0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1),Int8Array.of(1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1),Int8Array.of(1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0),Int8Array.of(0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0),Int8Array.of(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1),Int8Array.of(1,1,1,1,1,1,0,0,1,0,0,0,1,0,0,0),Int8Array.of(0,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1),Int8Array.of(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1)];static yp=[Int8Array.of(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),Int8Array.of(12,8,4,0,13,9,5,1,14,10,6,2,15,11,7,3),Int8Array.of(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0),Int8Array.of(3,7,11,15,2,6,10,14,1,5,9,13,0,4,8,12)];static Ap=Int32Array.of(41,39248,41,4643,41,41,41,41,41,41,41,41,41,41,41,43086,41,41,41,41,41,41,41,8602,41,28992,41,41,41,41,41,5056,41,41,41,41,41,41,41,41,41,41,41,41,41,41,3131,41,41,41);static mp=0;static Hl=0;static Vl=0;static pp=-1;static _p=-1;static et=!0;static init=(t,i,e,n,r)=>{this.Dm=0,this.Nm=0,this.Fm=t,this.Bm=i,this.Pm=t/2|0,this.Um=i/2|0;const h=new p.Tm(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.Gm=s.A.sin[t],this.Wm=s.A.cos[t],this.Ym=s.A.sin[i],this.Hm=s.A.cos[i];const o=(t-128)/32|0,l=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const s=128*t,a=128*i;let c=!1;for(let t=-e;t<=n;t+=128)if(this.Ip(s,a,r[o]+t)){c=!0;break}h[o][l][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let r=-1;r<=1;r++)for(let o=-1;o<=1;o++){if(h[t][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][i][e+r+25+1][s+o+25+1]){n=!0;break t}if(h[t+1][(i+1)%31][e+r+25+1][s+o+25+1]){n=!0;break t}}this.bm[t][i][e+25][s+25]=n}};static Lo=()=>{this.Om=null,this.Rm=null,this.Lm=null,this.Mm=null,this.bm=null,this.xm=null,this.ep=null,console.log('World3D unloaded!')};static pm=(t,i,e,s,n,r,o,l)=>{_.Lm[t][_.Rm[t]++]=new h.A(e/128|0,r/128|0,n/128|0,l/128|0,i,e,r,n,l,s,o)};static Ip=(t,i,e)=>{const s=i*this.Ym+t*this.Hm>>16,n=i*this.Hm-t*this.Ym>>16,r=e*this.Gm+n*this.Wm>>16,h=e*this.Wm-n*this.Gm>>16;if(r<50||r>3500)return!1;const o=this.Pm+((s<<9)/r|0),l=this.Um+((h<<9)/r|0);return o>=this.Dm&&o<=this.Fm&&l>=this.Nm&&l<=this.Bm};gp;VA;KA;Cp;Ep;gh;vp;bp;Tp;Op=0;Rp=0;Lp=0;constructor(t,i,e,s){this.gp=e,this.VA=s,this.KA=i,this.Ep=new p.Eh(e,s,i,null),this.vp=new p.hm(e,s+1,i+1),this.Cp=t,this.gh=new p.fe(5e3,null),this.bp=new Int32Array(1e4),this.Tp=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.Rp=t;for(let i=0;i{const e=this.Ep[0][t][i];for(let e=0;e<3;e++){this.Ep[e][t][i]=this.Ep[e+1][t][i];const s=this.Ep[e][t][i];s&&s.level--}this.Ep[0][t][i]||(this.Ep[0][t][i]=new r.A(0,t,i));const s=this.Ep[0][t][i];s&&(s.xp=e),this.Ep[3][t][i]=null};wm=(t,i,e,s)=>{const n=this.Ep[t][i][e];n&&(n.Mp=s)};fm=(t,i,e,s,n,h,o,l,a,c,f,u,w,m,p,_,I,g,C,E)=>{if(s===A.A.am){for(let s=t;s>=0;s--)this.Ep[s][i][e]||(this.Ep[s][i][e]=new r.A(s,i,e));const s=this.Ep[t][i][e];s&&(s.kp=new d.A(f,u,w,m,-1,C,!1))}else if(s===A.A.Dp){for(let s=t;s>=0;s--)this.Ep[s][i][e]||(this.Ep[s][i][e]=new r.A(s,i,e));const s=this.Ep[t][i][e];s&&(s.kp=new d.A(p,_,I,g,h,E,o===l&&o===a&&o===c))}else{for(let s=t;s>=0;s--)this.Ep[s][i][e]||(this.Ep[s][i][e]=new r.A(s,i,e));const d=this.Ep[t][i][e];d&&(d.Np=new y.A(i,s,_,l,w,n,f,c,E,p,h,g,C,a,I,m,o,e,u))}};GA=(t,i,e,s,n,h,o)=>{this.Ep[i][e][s]||(this.Ep[i][e][s]=new r.A(i,e,s));const a=this.Ep[i][e][s];a&&(a.Fp=new l.A(n,128*e+64,128*s+64,t,h,o))};Bp=(t,i,e)=>{const s=this.Ep[t][i][e];s&&(s.Fp=null)};Pp=(t,i,e,s,n,h,o,l)=>{let a=0;const c=this.Ep[s][t][i];if(c)for(let t=0;ta&&(a=e)}else this.Ep[s][t][i]=new r.A(s,t,i);const f=this.Ep[s][t][i];f&&(f.Wp=new u.A(e,128*t+64,128*i+64,h,o,l,n,a))};Yp=(t,i,e)=>{const s=this.Ep[t][i][e];s&&(s.Wp=null)};qy=(t,i,e,s,n,h,o,l,c,f)=>{if(!o&&!l)return;for(let s=t;s>=0;s--)this.Ep[s][i][e]||(this.Ep[s][i][e]=new r.A(s,i,e));const u=this.Ep[t][i][e];u&&(u.Hp=new a.A(s,128*i+64,128*e+64,n,h,o,l,c,f))};eA=(t,i,e,s)=>{const n=this.Ep[t][i][e];1===s&&n&&(n.Hp=null)};YA=(t,i,e,s,n,h,o,l,a,f,u)=>{if(!l)return;for(let s=t;s>=0;s--)this.Ep[s][i][e]||(this.Ep[s][i][e]=new r.A(s,i,e));const d=this.Ep[t][i][e];d&&(d.Vp=new c.A(s,128*i+n+64,128*e+h+64,u,f,l,o,a))};Kp=(t,i,e)=>{const s=this.Ep[t][i][e];s&&(s.Vp=null)};vm=(t,i,e,s)=>{const n=this.Ep[t][i][e];if(!n)return;const r=n.Vp;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};Xp=(t,i,e,s)=>{if(!s)return;const n=this.Ep[t][i][e];if(!n)return;const r=n.Vp;r&&(r.model=s)};jp=(t,i,e,s)=>{if(!s)return;const n=this.Ep[t][i][e];if(!n)return;const r=n.Fp;r&&(r.model=s)};zp=(t,i,e,s)=>{if(!s)return;const n=this.Ep[t][i][e];if(!n)return;const r=n.Hp;r&&(r.Zp=s)};qp=(t,i,e,s,n)=>{if(!s)return;const r=this.Ep[e][t][i];if(!r)return;const h=r.Hp;h&&(h.Zp=s,h.Jp=n)};Xy=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!n&&!r)return!0;const f=128*i+64*l,u=128*e+64*a;return this.$p(f,u,s,t,i,e,l,a,n,r,h,o,c,!1)};Qp=(t,i,e,s,n,r,h,o,l,a)=>{if(!n&&!r)return!0;let c=i-l,f=s-l,u=i+l,d=s+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.$p(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};t_=(t,i,e,s,n,r,h,o,l,a,c,f)=>!l&&!a||this.$p(i,s,e,t,n,r,h+1-n,o-r+1,l,a,c,0,f,!0);Zy=(t,i,e)=>{const s=this.Ep[t][i][e];if(s)for(let t=0;t>29&3)&&n.e_===i&&n.s_===e)return void this.n_(n)}};r_=(t,i,e,s)=>{if(!s)return;const n=this.Ep[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};h_=()=>{for(let t=0;t{const s=this.Ep[t][i][e];return s&&s.Hp?s.Hp.i_:0};o_=(t,i,e)=>{const s=this.Ep[t][e][i];return s&&s.Vp?s.Vp.i_:0};l_=(t,i,e)=>{const s=this.Ep[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.e_===i&&n.s_===e)return n.i_}return 0};a_=(t,i,e)=>{const s=this.Ep[t][i][e];return s&&s.Fp?s.Fp.i_:0};c_=(t,i,e,s)=>{const n=this.Ep[t][i][e];if(n){if(n.Hp&&n.Hp.i_===s)return 255&n.Hp.info;if(n.Vp&&n.Vp.i_===s)return 255&n.Vp.info;if(n.Fp&&n.Fp.i_===s)return 255&n.Fp.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.Ep[t][i+1][e-1];n&&n.Fp&&n.Fp.model&&n.Fp.model.f_&&this.d_(s,n.Fp.model,128,0,-128,!0)}};u_=(t,i,e,s,n,r)=>{let h=!0,o=i;const l=i+s,a=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.gp){for(let u=o;u<=l;u++)if(!(u<0||u>=this.VA))for(let o=a;o<=c;o++){if(o<0||o>=this.KA||h&&u=e||u===i))continue;const a=this.Ep[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.Cp[f][u][o]+this.Cp[f][u+1][o]+this.Cp[f][u][o+1]+this.Cp[f][u+1][o+1])/4|0)-((this.Cp[t][i][e]+this.Cp[t][i+1][e]+this.Cp[t][i][e+1]+this.Cp[t][i+1][e+1])/4|0),A=a.Hp;A&&A.Zp&&A.Zp.f_&&this.d_(r,A.Zp,d,y,w,h),A&&A.Jp&&A.Jp.f_&&this.d_(r,A.Jp,d,y,w,h);for(let t=0;t{this.Lp++;let h=0;const o=i.Bd,l=i.Fd;if(t.f_&&t.p_)for(let r=0;ri.__)continue;const u=t.Bd[r]-e;if(ui.g_)continue;const d=t.Pd[r]-n;if(di.E_)continue;if(i.f_&&i.p_)for(let t=0;t{const h=this.Ep[t][i][e];if(!h)return;const o=h.kp;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const l=h.Np;if(!l)return;const a=l.shape,c=l.angle,f=l.S_,u=l.x_,d=_.wp[a],w=_.yp[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{_.ip=!0,_.Hl=t,_.Vl=i,_.pp=-1,_._p=-1};draw=(t,i,e,n,r,h,o)=>{t<0?t=0:t>=128*this.VA&&(t=128*this.VA-1),e<0?e=0:e>=128*this.KA&&(e=128*this.KA-1),_.km++,_.Gm=s.A.sin[h],_.Wm=s.A.cos[h],_.Ym=s.A.sin[r],_.Hm=s.A.cos[r],_.ep=_.bm[(h-128)/32|0][r/64|0],_.Vm=t,_.Km=i,_.Xm=e,_.jm=t/128|0,_.zm=e/128|0,_.Qm=n,_.Zm=_.jm-25,_.Zm<0&&(_.Zm=0),_.Jm=_.zm-25,_.Jm<0&&(_.Jm=0),_.qm=_.jm+25,_.qm>this.VA&&(_.qm=this.VA),_.$m=_.zm+25,_.$m>this.KA&&(_.$m=this.KA),this.M_(),_.tp=0;for(let t=this.Rp;t=2e3)?(h.visible=!0,h.update=!0,h.k_=h.Up>0,_.tp++):(h.visible=!1,h.update=!1,h.D_=0))}}for(let t=this.Rp;t=_.qm))for(let t=-25;t<=0;t++){const n=_.zm+t,r=_.zm-t;let h;if(e>=_.Zm&&(n>=_.Jm&&(h=i[e][n],h&&h.visible&&this.N_(h,!0,o)),r<_.$m&&(h=i[e][r],h&&h.visible&&this.N_(h,!0,o))),s<_.qm&&(n>=_.Jm&&(h=i[s][n],h&&h.visible&&this.N_(h,!0,o)),r<_.$m&&(h=i[s][r],h&&h.visible&&this.N_(h,!0,o))),0===_.tp)return void(_.ip=!1)}}}for(let t=this.Rp;t=_.qm))for(let t=-25;t<=0;t++){const n=_.zm+t,r=_.zm-t;let h;if(e>=_.Zm&&(n>=_.Jm&&(h=i[e][n],h&&h.visible&&this.N_(h,!1,o)),r<_.$m&&(h=i[e][r],h&&h.visible&&this.N_(h,!1,o))),s<_.qm&&(n>=_.Jm&&(h=i[s][n],h&&h.visible&&this.N_(h,!1,o)),r<_.$m&&(h=i[s][r],h&&h.visible&&this.N_(h,!1,o))),0===_.tp)return void(_.ip=!1)}}}};$p=(t,i,e,s,h,o,l,a,c,f,u,d,w,y)=>{if(!c&&!f)return!1;for(let t=h;t=this.VA||i>=this.KA)return!1;const e=this.Ep[s][t][i];if(e&&e.Up>=5)return!1}const A=new n.A(s,e,t,i,c,f,w,h,h+l-1,o,o+a-1,u,d);for(let t=h;th&&(e|=1),to&&(e+=8),i=0;e--)this.Ep[e][t][i]||(this.Ep[e][t][i]=new r.A(e,t,i));const n=this.Ep[s][t][i];n&&(n.Gp[n.Up]=A,n.F_[n.Up]=e,n.B_|=e,n.Up++)}return y&&(this.gh[this.Op++]=A),!0};n_=t=>{for(let i=t.e_;i<=t.y_;i++)for(let e=t.s_;e<=t.A_;e++){const s=this.Ep[t.level][i][e];if(s){for(let i=0;i{const t=_.Rm[_.Qm],i=_.Lm[_.Qm];_.mp=0;for(let e=0;e=0&&s<=50){n=t.U_+25-_.zm,n<0&&(n=0),r=t.KA+25-_.zm,r>50&&(r=50);let i=!1;for(;n<=r;)if(_.ep&&_.ep[s][n++]){i=!0;break}if(i){if(h=_.Vm-t.I_,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.G_=(t.C_-_.Xm<<8)/h|0,t.W_=(t.E_-_.Xm<<8)/h|0,t.Y_=(t.__-_.Km<<8)/h|0,t.H_=(t.jd-_.Km<<8)/h|0,_.xm[_.mp++]=t}}}else if(2===t.type){if(s=t.U_+25-_.zm,s>=0&&s<=50){n=t.P_+25-_.jm,n<0&&(n=0),r=t.VA+25-_.jm,r>50&&(r=50);let i=!1;for(;n<=r;)if(_.ep&&_.ep[n++][s]){i=!0;break}if(i){if(h=_.Xm-t.C_,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.V_=(t.I_-_.Vm<<8)/h|0,t.K_=(t.g_-_.Vm<<8)/h|0,t.Y_=(t.__-_.Km<<8)/h|0,t.H_=(t.jd-_.Km<<8)/h|0,_.xm[_.mp++]=t}}}else if(4===t.type&&(s=t.__-_.Km,s>128&&(n=t.U_+25-_.zm,n<0&&(n=0),r=t.KA+25-_.zm,r>50&&(r=50),n<=r))){let i=t.P_+25-_.jm;i<0&&(i=0),h=t.VA+25-_.jm,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(_.ep&&_.ep[t][i]){e=!0;break t}e&&(t.mode=5,t.V_=(t.I_-_.Vm<<8)/s|0,t.K_=(t.g_-_.Vm<<8)/s|0,t.G_=(t.C_-_.Xm<<8)/s|0,t.W_=(t.E_-_.Xm<<8)/s|0,_.xm[_.mp++]=t)}}};N_=(t,i,e)=>{for(_.Mm.WA(t);;){let t;do{if(t=_.Mm.X_(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.j_,o=this.Ep[r];if(t.visible){if(i){if(r>0){const t=this.Ep[r-1][s][n];if(t&&t.update)continue}if(s<=_.jm&&s>_.Zm){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.B_)))continue}if(s>=_.jm&&s<_.qm-1){const i=o[s+1][n];if(i&&i.update&&(i.visible||!(4&t.B_)))continue}if(n<=_.zm&&n>_.Jm){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.B_)))continue}if(n>=_.zm&&n<_.$m-1){const i=o[s][n+1];if(i&&i.update&&(i.visible||!(2&t.B_)))continue}}else i=!0;if(t.visible=!1,t.xp){const i=t.xp;i.kp?this.z_(0,s,n)||this.Z_(i.kp,0,s,n,_.Gm,_.Wm,_.Ym,_.Hm):i.Np&&!this.z_(0,s,n)&&this.q_(s,n,i.Np,_.Gm,_.Wm,_.Ym,_.Hm);const r=i.Hp;r&&r.Zp?.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,r.x-_.Vm,r.y-_.Km,r.z-_.Xm,r.i_);for(let t=0;tn&&(a+=6),c=_.sp[a],t.tI=_.rp[a]),f&&(f.iI&_.np[a]?16===f.iI?(t.D_=3,t.eI=_.hp[a],t.sI=3-t.eI):32===f.iI?(t.D_=6,t.eI=_.op[a],t.sI=6-t.eI):64===f.iI?(t.D_=12,t.eI=_.lp[a],t.sI=12-t.eI):(t.D_=9,t.eI=_.ap[a],t.sI=9-t.eI):t.D_=0,f.iI&c&&!this.nI(h,s,n,f.iI)&&f.Zp?.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,f.x-_.Vm,f.y-_.Km,f.z-_.Xm,f.i_),f.rI&c&&!this.nI(h,s,n,f.rI)&&f.Jp?.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,f.x-_.Vm,f.y-_.Km,f.z-_.Xm,f.i_)),u&&!this.visible(h,s,n,u.model.jd))if(u.type&c)u.model.draw(u.angle,_.Gm,_.Wm,_.Ym,_.Hm,u.x-_.Vm,u.y-_.Km,u.z-_.Xm,u.i_);else if(768&u.type){const t=u.x-_.Vm,i=u.y-_.Km,e=u.z-_.Xm,s=u.angle;let n,r;if(n=s===m.A.jy||s===m.A.$y?-t:t,r=s===m.A.$y||s===m.A.zy?-e:e,256&u.type&&rn){const n=t+_.up[s],r=e+_.dp[s];u.model.draw(512*s+1280&2047,_.Gm,_.Wm,_.Ym,_.Hm,n,i,r,u.i_)}}if(l){const i=t.Fp;i&&i.model?.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,i.x-_.Vm,i.y-_.Km,i.z-_.Xm,i.i_);const e=t.Wp;e&&0===e.offset&&(e.hI&&e.hI.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,e.x-_.Vm,e.y-_.Km,e.z-_.Xm,e.i_),e.oI&&e.oI.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,e.x-_.Vm,e.y-_.Km,e.z-_.Xm,e.i_),e.lI&&e.lI.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,e.x-_.Vm,e.y-_.Km,e.z-_.Xm,e.i_))}const d=t.B_;if(0!==d){if(s<_.jm&&4&d){const t=o[s+1][n];t&&t.update&&_.Mm.WA(t)}if(n<_.zm&&2&d){const t=o[s][n+1];t&&t.update&&_.Mm.WA(t)}if(s>_.jm&&1&d){const t=o[s-1][n];t&&t.update&&_.Mm.WA(t)}if(n>_.zm&&8&d){const t=o[s][n-1];t&&t.update&&_.Mm.WA(t)}}}if(0!==t.D_){let i=!0;for(let e=0;ei.e_&&(r+=1),ei.s_&&(r+=8),ss&&(s=n);const h=_.zm-i.s_,l=i.A_-_.zm;i.aI=l>h?s+l:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.aI,i=e))}if(-1===i)break;const l=_.Om[i];if(l){l.km=_.km;let t=l.model;t||(t=l.J_?.draw(e)??null),t&&!this.cI(h,l.e_,l.y_,l.s_,l.A_,t.jd)&&t.draw(l.Q_,_.Gm,_.Wm,_.Ym,_.Hm,l.x-_.Vm,l.y-_.Km,l.z-_.Xm,l.i_);for(let t=l.e_;t<=l.y_;t++)for(let i=l.s_;i<=l.A_;i++){const e=o[t][i];e&&(0!==e.D_?_.Mm.WA(e):t===s&&i===n||!e.update||_.Mm.WA(e))}}}if(t.k_)continue}if(!t.update||0!==t.D_)continue;if(s<=_.jm&&s>_.Zm){const t=o[s-1][n];if(t&&t.update)continue}if(s>=_.jm&&s<_.qm-1){const t=o[s+1][n];if(t&&t.update)continue}if(n<=_.zm&&n>_.Jm){const t=o[s][n-1];if(t&&t.update)continue}if(n>=_.zm&&n<_.$m-1){const t=o[s][n+1];if(t&&t.update)continue}t.update=!1,_.tp--;const l=t.Wp;if(l&&0!==l.offset&&(l.hI&&l.hI.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,l.x-_.Vm,l.y-_.Km-l.offset,l.z-_.Xm,l.i_),l.oI&&l.oI.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,l.x-_.Vm,l.y-_.Km-l.offset,l.z-_.Xm,l.i_),l.lI&&l.lI.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,l.x-_.Vm,l.y-_.Km-l.offset,l.z-_.Xm,l.i_)),0!==t.tI){const i=t.Vp;if(i&&!this.visible(h,s,n,i.model.jd))if(i.type&t.tI)i.model.draw(i.angle,_.Gm,_.Wm,_.Ym,_.Hm,i.x-_.Vm,i.y-_.Km,i.z-_.Xm,i.i_);else if(768&i.type){const t=i.x-_.Vm,e=i.y-_.Km,s=i.z-_.Xm,n=i.angle;let r,h;if(r=n===m.A.jy||n===m.A.$y?-t:t,h=n===m.A.$y||n===m.A.zy?-s:s,256&i.type&&h>=r){const r=t+_.cp[n],h=s+_.fp[n];i.model.draw(512*n+256,_.Gm,_.Wm,_.Ym,_.Hm,r,e,h,i.i_)}if(512&i.type&&h<=r){const r=t+_.up[n],h=s+_.dp[n];i.model.draw(512*n+1280&2047,_.Gm,_.Wm,_.Ym,_.Hm,r,e,h,i.i_)}}const e=t.Hp;e&&(e.rI&t.tI&&!this.nI(h,s,n,e.rI)&&e.Jp?.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,e.x-_.Vm,e.y-_.Km,e.z-_.Xm,e.i_),e.iI&t.tI&&!this.nI(h,s,n,e.iI)&&e.Zp?.draw(0,_.Gm,_.Wm,_.Ym,_.Hm,e.x-_.Vm,e.y-_.Km,e.z-_.Xm,e.i_))}if(r_.jm){const t=o[s-1][n];t&&t.update&&_.Mm.WA(t)}if(n>_.zm){const t=o[s][n-1];t&&t.update&&_.Mm.WA(t)}}};Z_=(t,i,e,n,r,h,o,l)=>{let a,c,f,u,d=a=(e<<7)-_.Vm,y=c=(n<<7)-_.Xm,A=f=d+128,m=u=y+128,p=this.Cp[i][e][n]-_.Km,I=this.Cp[i][e+1][n]-_.Km,g=this.Cp[i][e+1][n+1]-_.Km,C=this.Cp[i][e][n+1]-_.Km,E=y*o+d*l>>16;if(y=y*l-d*o>>16,d=E,E=p*h-y*r>>16,y=p*r+y*h>>16,p=E,y<50)return;if(E=c*o+A*l>>16,c=c*l-A*o>>16,A=E,E=I*h-c*r>>16,c=I*r+c*h>>16,I=E,c<50)return;if(E=m*o+f*l>>16,m=m*l-f*o>>16,f=E,E=g*h-m*r>>16,m=g*r+m*h>>16,g=E,m<50)return;if(E=u*o+a*l>>16,u=u*l-a*o>>16,a=E,E=C*h-u*r>>16,u=C*r+u*h>>16,C=E,u<50)return;const v=s.A.ya+((d<<9)/y|0),b=s.A.Aa+((p<<9)/y|0),T=s.A.ya+((A<<9)/c|0),O=s.A.Aa+((I<<9)/c|0),R=s.A.ya+((f<<9)/m|0),L=s.A.Aa+((g<<9)/m|0),S=s.A.ya+((a<<9)/u|0),x=s.A.Aa+((C<<9)/u|0);if(s.A.alpha=0,(R-S)*(O-x)-(L-x)*(T-S)>0)if(s.A.fI=R<0||S<0||T<0||R>w.A.uI||S>w.A.uI||T>w.A.uI,_.ip&&this.dI(_.Hl,_.Vl,L,x,O,R,S,T)&&(_.pp=e,_._p=n),-1===t.wI)12345678!==t.yI&&s.A.AI(R,S,T,L,x,O,t.yI,t.mI,t.pI);else if(_.et){const i=_.Ap[t.wI];s.A.AI(R,S,T,L,x,O,this._I(i,t.yI),this._I(i,t.mI),this._I(i,t.pI))}else t.flat?s.A.II(R,S,T,L,x,O,t.yI,t.mI,t.pI,d,p,y,A,a,I,C,c,u,t.wI):s.A.II(R,S,T,L,x,O,t.yI,t.mI,t.pI,f,g,m,a,A,C,I,u,c,t.wI);if(!((v-T)*(x-O)-(b-O)*(S-T)<=0))if(s.A.fI=v<0||T<0||S<0||v>w.A.uI||T>w.A.uI||S>w.A.uI,_.ip&&this.dI(_.Hl,_.Vl,b,O,x,v,T,S)&&(_.pp=e,_._p=n),-1!==t.wI){if(!_.et)return void s.A.II(v,T,S,b,O,x,t.gI,t.pI,t.mI,d,p,y,A,a,I,C,c,u,t.wI);const i=_.Ap[t.wI];s.A.AI(v,T,S,b,O,x,this._I(i,t.gI),this._I(i,t.pI),this._I(i,t.mI))}else 12345678!==t.gI&&s.A.AI(v,T,S,b,O,x,t.gI,t.pI,t.mI)};q_=(t,i,e,n,r,h,o)=>{let l=e.Bd.length;for(let t=0;t>16;if(a=a*o-i*h>>16,i=c,c=l*r-a*n>>16,a=l*n+a*r>>16,l=c,a<50)return;e.CI&&(y.A.EI[t]=i,y.A.vI[t]=l,y.A.bI[t]=a),y.A.TI[t]=s.A.ya+((i<<9)/a|0),y.A.OI[t]=s.A.Aa+((l<<9)/a|0)}s.A.alpha=0,l=e.RI.length;for(let n=0;n0)if(s.A.fI=l<0||a<0||c<0||l>w.A.uI||a>w.A.uI||c>w.A.uI,_.ip&&this.dI(_.Hl,_.Vl,f,u,d,l,a,c)&&(_.pp=t,_._p=i),e.CI&&-1!==e.CI[n])if(_.et){const t=_.Ap[e.CI[n]];s.A.AI(l,a,c,f,u,d,this._I(t,e.xI[n]),this._I(t,e.MI[n]),this._I(t,e.kI[n]))}else e.flat?s.A.II(l,a,c,f,u,d,e.xI[n],e.MI[n],e.kI[n],y.A.EI[0],y.A.vI[0],y.A.bI[0],y.A.EI[1],y.A.EI[3],y.A.vI[1],y.A.vI[3],y.A.bI[1],y.A.bI[3],e.CI[n]):s.A.II(l,a,c,f,u,d,e.xI[n],e.MI[n],e.kI[n],y.A.EI[r],y.A.vI[r],y.A.bI[r],y.A.EI[h],y.A.EI[o],y.A.vI[h],y.A.vI[o],y.A.bI[h],y.A.bI[o],e.CI[n]);else 12345678!==e.xI[n]&&s.A.AI(l,a,c,f,u,d,e.xI[n],e.MI[n],e.kI[n])}};z_=(t,i,e)=>{const s=this.vp[t][i][e];if(s===-_.km)return!1;if(s===_.km)return!0;{const s=i<<7,n=e<<7;return this.DI(s+1,this.Cp[t][i][e],n+1)&&this.DI(s+128-1,this.Cp[t][i+1][e],n+1)&&this.DI(s+128-1,this.Cp[t][i+1][e+1],n+128-1)&&this.DI(s+1,this.Cp[t][i][e+1],n+128-1)?(this.vp[t][i][e]=_.km,!0):(this.vp[t][i][e]=-_.km,!1)}};nI=(t,i,e,s)=>{if(!this.z_(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.Cp[t][i][e]-1,o=h-120,l=h-230,a=h-238;if(s<16){if(1===s){if(n>_.Vm){if(!this.DI(n,h,r))return!1;if(!this.DI(n,h,r+128))return!1}if(t>0){if(!this.DI(n,o,r))return!1;if(!this.DI(n,o,r+128))return!1}return!!this.DI(n,l,r)&&this.DI(n,l,r+128)}if(2===s){if(r<_.Xm){if(!this.DI(n,h,r+128))return!1;if(!this.DI(n+128,h,r+128))return!1}if(t>0){if(!this.DI(n,o,r+128))return!1;if(!this.DI(n+128,o,r+128))return!1}return!!this.DI(n,l,r+128)&&this.DI(n+128,l,r+128)}if(4===s){if(n<_.Vm){if(!this.DI(n+128,h,r))return!1;if(!this.DI(n+128,h,r+128))return!1}if(t>0){if(!this.DI(n+128,o,r))return!1;if(!this.DI(n+128,o,r+128))return!1}return!!this.DI(n+128,l,r)&&this.DI(n+128,l,r+128)}if(8===s){if(r>_.Xm){if(!this.DI(n,h,r))return!1;if(!this.DI(n+128,h,r))return!1}if(t>0){if(!this.DI(n,o,r))return!1;if(!this.DI(n+128,o,r))return!1}return!!this.DI(n,l,r)&&this.DI(n+128,l,r)}}return!!this.DI(n+64,a,r+64)&&(16===s?this.DI(n,l,r+128):32===s?this.DI(n+128,l,r+128):64===s?this.DI(n+128,l,r):128===s?this.DI(n,l,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.z_(t,i,e)){const n=i<<7,r=e<<7;return this.DI(n+1,this.Cp[t][i][e]-s,r+1)&&this.DI(n+128-1,this.Cp[t][i+1][e]-s,r+1)&&this.DI(n+128-1,this.Cp[t][i+1][e+1]-s,r+128-1)&&this.DI(n+1,this.Cp[t][i][e+1]-s,r+128-1)}return!1};cI=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.vp[t][h][o]===-_.km)return!1;o=1+(i<<7);const l=2+(s<<7),a=this.Cp[t][i][s]-r;if(!this.DI(o,a,l))return!1;const c=(e<<7)-1;if(!this.DI(c,a,l))return!1;const f=(n<<7)-1;return!!this.DI(o,a,f)&&this.DI(c,a,f)}return!!this.z_(t,i,s)&&(h=i<<7,o=s<<7,this.DI(h+1,this.Cp[t][i][s]-r,o+1)&&this.DI(h+128-1,this.Cp[t][i+1][s]-r,o+1)&&this.DI(h+128-1,this.Cp[t][i+1][s+1]-r,o+128-1)&&this.DI(h+1,this.Cp[t][i][s+1]-r,o+128-1))};DI=(t,i,e)=>{for(let s=0;s<_.mp;s++){const n=_.xm[s];if(n)if(1===n.mode){const s=n.I_-t;if(s>0){const t=n.C_+(n.G_*s>>8),r=n.E_+(n.W_*s>>8),h=n.__+(n.Y_*s>>8),o=n.jd+(n.H_*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.I_;if(s>0){const t=n.C_+(n.G_*s>>8),r=n.E_+(n.W_*s>>8),h=n.__+(n.Y_*s>>8),o=n.jd+(n.H_*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.C_-e;if(s>0){const e=n.I_+(n.V_*s>>8),r=n.g_+(n.K_*s>>8),h=n.__+(n.Y_*s>>8),o=n.jd+(n.H_*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.C_;if(s>0){const e=n.I_+(n.V_*s>>8),r=n.g_+(n.K_*s>>8),h=n.__+(n.Y_*s>>8),o=n.jd+(n.H_*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.__;if(s>0){const i=n.I_+(n.V_*s>>8),r=n.g_+(n.K_*s>>8),h=n.C_+(n.G_*s>>8),o=n.E_+(n.W_*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};dI=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const l=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*l>0&&l*((i-n)*(r-o)-(t-o)*(e-n))>0};_I=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}},7121:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{}},4197:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{NI;FI;BI;UI;index;Qw;Cl;gl;constructor(t,i,e,s,n,r,h){super(),this.NI=i,this.FI=e,this.BI=s,this.UI=n,this.index=t,this.Qw=r,h&&-1!==r.vl&&this.Qw.delay?(this.Cl=Math.random()*this.Qw.El|0,this.gl=Math.random()*this.Qw.delay[this.Cl]|0):(this.Cl=-1,this.gl=0)}}},9418:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(7121),n=e(1312),r=e(3867);class h extends s.A{x=0;z=0;Q_=0;GI=!1;size=1;Ga=-1;WI=-1;YI=-1;HI=-1;VI=-1;KI=-1;XI=-1;jI=null;zI=100;ZI=0;qI=0;JI=0;$I=0;QI=-1e3;tg=0;ig=0;eg=-1;sg=0;ng=0;rg=-1;hg=0;og=0;lg=-1;ag=0;cg=0;fg=0;ug=0;dg=-1;wg=0;yg=0;Ag=0;mg=0;pg=0;_g=0;Ig=0;gg=0;Cg=0;Eg=0;vg=0;km=0;height=0;bg=0;pathLength=0;Tg=new Int32Array(10);Og=new Int32Array(10);Rg=new r.fe(10,!1);Lg=0;Sg=-1;xg=-1;Mg=-1;kg=-1;move(t,i,e){if(-1!==this.lg&&n.A.Do[this.lg].priority<=1&&(this.lg=-1),!t){const t=i-this.Tg[0],s=e-this.Og[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.Tg[t]=this.Tg[t-1],this.Og[t]=this.Og[t-1],this.Rg[t]=this.Rg[t-1];return this.Tg[0]=i,this.Og[0]=e,void(this.Rg[0]=!1)}}this.pathLength=0,this.Lg=0,this.Tg[0]=i,this.Og[0]=e,this.x=128*this.Tg[0]+64*this.size,this.z=128*this.Og[0]+64*this.size}step(t,i){let e=this.Tg[0],s=this.Og[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.lg&&n.A.Do[this.lg].priority<=1&&(this.lg=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.Tg[t]=this.Tg[t-1],this.Og[t]=this.Og[t-1],this.Rg[t]=this.Rg[t-1];this.Tg[0]=e,this.Og[0]=s,this.Rg[0]=t}}},8268:(t,i,e)=>{e.d(i,{A:()=>d});var s=e(9418),n=e(8665),r=e(2679),h=e(8738),o=e(1312),l=e(8317),a=e(1302),c=e(3819),f=e(3867),u=e(9298);class d extends s.A{static Dg=1;static Ng=2;static Fg=4;static Bg=8;static Pg=16;static Ug=32;static Gg=64;static Wg=128;static Yg=256;static Hg=512;static Ua=[u.A.Vg,u.A.Kg,u.A.Xg,u.A.jg,u.A.zg,u.A.Zg,u.A.qg,u.A.Jg,u.A.$g,u.A.Qg,u.A.tC,u.A.iC,u.A.eC,u.A.sC,u.A.nC,u.A.rC];static Pa=[[u.A.hC,u.A.oC,u.A.lC,u.A.aC,u.A.cC,u.A.fC,u.A.uC,u.A.dC,u.A.wC,u.A.yC,u.A.AC,u.A.mC],[u.A.pC,u.A._C,u.A.IC,u.A.gC,u.A.CC,u.A.EC,u.A.vC,u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.LC,u.A.SC,u.A.xC,u.A.MC,u.A.kC],[u.A.kC-1,u.A.pC+1,u.A._C,u.A.IC,u.A.gC,u.A.CC,u.A.EC,u.A.vC,u.A.bC,u.A.TC,u.A.OC,u.A.RC,u.A.LC,u.A.SC,u.A.xC,u.A.MC],[u.A.DC,u.A.NC,u.A.FC,u.A.BC,u.A.PC,u.A.UC],[u.A.GC,u.A.WC,u.A.YC,u.A.HC,u.A.VC,u.A.KC,u.A.XC,u.A.jC]];static No=new r.A(200);name=null;visible=!1;zC=0;ZC=0;qC=new Uint16Array(12);JC=new Uint16Array(5);ic=0;$C=0n;y=0;QC=0;tE=0;iE=0;eE=0;sE=0;nE=null;P_=0;U_=0;VA=0;KA=0;et=!1;draw(t){if(!this.visible)return null;let i=this.sw();if(this.height=i.jd,i.ow=!0,this.et)return i;if(-1!==this.dg&&-1!==this.wg){const t=h.A.Do[this.dg],e=n.A.ku(t.pa(),!0,!t.pd,!1);e.translate(-this.mg,0,0),e.Wa(),t.Qw&&t.Qw.frames&&e.Ya(t.Qw.frames[this.wg]),e.Hd=null,e.Vd=null,128===t.iw&&128===t.ew||e.scale(t.iw,t.ew,t.iw),e.Ha(t.Id+64,t.gd+850,-30,-50,-30,!0);const s=[i,e];i=n.A.rE(s,2)}if(this.nE&&(t>=this.tE&&(this.nE=null),t>=this.QC&&t=d.Pa[i].length)&&(e=0),this.JC[i]=e}this.Ga=t.Au,65535===this.Ga&&(this.Ga=-1),this.WI=t.Au,65535===this.WI&&(this.WI=-1),this.YI=t.Au,65535===this.YI&&(this.YI=-1),this.HI=t.Au,65535===this.HI&&(this.HI=-1),this.VI=t.Au,65535===this.VI&&(this.VI=-1),this.KI=t.Au,65535===this.KI&&(this.KI=-1),this.XI=t.Au,65535===this.XI&&(this.XI=-1),this.name=c.A.Ma(c.A.ka(t.hE)),this.ic=t.pu,this.visible=!0,this.$C=0n;for(let t=0;t<12;t++)this.$C<<=0x4n,this.qC[t]>=256&&(this.$C+=BigInt(this.qC[t])-256n);this.qC[0]>=256&&(this.$C+=BigInt(this.qC[0])-256n>>4n),this.qC[1]>=256&&(this.$C+=BigInt(this.qC[1])-256n>>8n);for(let t=0;t<5;t++)this.$C<<=0x3n,this.$C+=BigInt(this.JC[t]);this.$C<<=0x1n,this.$C+=BigInt(this.zC)}ed(){if(!this.visible)return null;const t=new f.fe(12,null);let i=0;for(let e=0;e<12;e++){const s=this.qC[e];if(s>=256&&s<512&&(t[i++]=l.A.Do[s-256].ed()),s>=512){const e=a.A.get(s-512).ed(this.zC);e&&(t[i++]=e)}}const e=n.A.Fa(t,i);for(let t=0;t<5;t++)0!==this.JC[t]&&(e.Ba(d.Pa[t][0],d.Pa[t][this.JC[t]]),1===t&&e.Ba(d.Ua[0],d.Ua[this.JC[t]]));return e}sw(){let t=this.$C,i=-1,e=-1,s=-1,r=-1;if(this.lg>=0&&0===this.fg){const n=o.A.Do[this.lg];if(n.frames&&(i=n.frames[this.ag]),this.rg>=0&&this.rg!==this.Ga){const t=o.A.Do[this.rg].frames;t&&(e=t[this.hg])}n.qw>=0&&(s=n.qw,t+=BigInt(s-this.qC[5])<<8n),n.Jw>=0&&(r=n.Jw,t+=BigInt(r-this.qC[3])<<16n)}else if(this.rg>=0){const t=o.A.Do[this.rg].frames;t&&(i=t[this.hg])}let h=d.No?.get(t);if(!h){const i=new f.fe(12,null);let e=0;for(let t=0;t<12;t++){let n=this.qC[t];if(r>=0&&3===t&&(n=r),s>=0&&5===t&&(n=s),n>=256&&n<512){const t=l.A.Do[n-256].pa();t&&(i[e++]=t)}if(n>=512){const t=a.A.get(n-512).jw(this.zC);t&&(i[e++]=t)}}h=n.A.Fa(i,e);for(let t=0;t<5;t++)0!==this.JC[t]&&(h.Ba(d.Pa[t][0],d.Pa[t][this.JC[t]]),1===t&&h.Ba(d.Ua[0],d.Ua[this.JC[t]]));h.Wa(),h.Ha(64,850,-30,-50,-30,!0),d.No?.put(t,h)}if(this.et)return h;const c=n.A.nw(h,!0);return-1!==i&&-1!==e?c.rw(i,e,o.A.Do[this.lg].zw):-1!==i&&c.Ya(i),c.hw(),c.Hd=null,c.Vd=null,c}}},9222:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;model;i_;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.i_=n,this.info=r}}},1161:(t,i,e)=>{e.d(i,{A:()=>s});class s{level;y;x;z;model;J_;Q_;e_;y_;s_;A_;i_;info;aI=0;km=0;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.J_=r,this.Q_=h,this.e_=o,this.y_=l,this.s_=a,this.A_=c,this.i_=f,this.info=u}}},5748:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;lI;oI;hI;i_;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.lI=s,this.oI=n,this.hI=r,this.i_=h,this.offset=o}}},8256:(t,i,e)=>{e.d(i,{A:()=>s});class s{P_;VA;U_;KA;type;I_;g_;C_;E_;__;jd;mode=0;V_=0;K_=0;G_=0;W_=0;Y_=0;H_=0;constructor(t,i,e,s,n,r,h,o,l,a,c){this.P_=t,this.VA=i,this.U_=e,this.KA=s,this.type=n,this.I_=r,this.g_=h,this.C_=o,this.E_=l,this.__=a,this.jd=c}}},3795:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1982),n=e(3867);class r extends s.A{level;x;z;j_;Gp;F_;kp=null;Np=null;Hp=null;Vp=null;Fp=null;Wp=null;xp=null;Up=0;B_=0;Mp=0;visible=!1;update=!1;k_=!1;D_=0;eI=0;sI=0;tI=0;constructor(t,i,e){super(),this.j_=this.level=t,this.x=i,this.z=e,this.Gp=new n.fe(5,null),this.F_=new Int32Array(5)}}},2771:(t,i,e)=>{e.d(i,{A:()=>s});class s{static TI=new Int32Array(6);static OI=new Int32Array(6);static EI=new Int32Array(6);static vI=new Int32Array(6);static bI=new Int32Array(6);static oE=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static lE=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static aE=128;static cE=this.aE/2|0;static fE=this.aE/4|0;static uE=3*this.aE/4|0;Bd;Ud;Pd;xI;MI;kI;RI;LI;SI;CI;flat;shape;angle;S_;x_;constructor(t,i,e,n,r,h,o,l,a,c,f,u,d,w,y,A,m,p,_){this.flat=!(m!==n||m!==w||m!==l),this.shape=i,this.angle=h,this.S_=d,this.x_=a;const I=s.oE[i],g=I.length;this.Bd=new Int32Array(g),this.Ud=new Int32Array(g),this.Pd=new Int32Array(g);const C=new Int32Array(g),E=new Int32Array(g),v=t*s.aE,b=p*s.aE;for(let t=0;t8&&g<=12&&(g=9+(g-h-9&3)),g>12&&g<=16&&(g=13+(g-h-13&3)),1===g?(i=v,a=b,f=m,d=o,p=c):2===g?(i=v+s.cE,a=b,f=m+n>>1,d=o+_>>1,p=c+e>>1):3===g?(i=v+s.aE,a=b,f=n,d=_,p=e):4===g?(i=v+s.aE,a=b+s.cE,f=n+w>>1,d=_+r>>1,p=e+y>>1):5===g?(i=v+s.aE,a=b+s.aE,f=w,d=r,p=y):6===g?(i=v+s.cE,a=b+s.aE,f=w+l>>1,d=r+A>>1,p=y+u>>1):7===g?(i=v,a=b+s.aE,f=l,d=A,p=u):8===g?(i=v,a=b+s.cE,f=l+m>>1,d=A+o>>1,p=u+c>>1):9===g?(i=v+s.cE,a=b+s.fE,f=m+n>>1,d=o+_>>1,p=c+e>>1):10===g?(i=v+s.uE,a=b+s.cE,f=n+w>>1,d=_+r>>1,p=e+y>>1):11===g?(i=v+s.cE,a=b+s.uE,f=w+l>>1,d=r+A>>1,p=y+u>>1):12===g?(i=v+s.fE,a=b+s.cE,f=l+m>>1,d=A+o>>1,p=u+c>>1):13===g?(i=v+s.fE,a=b+s.fE,f=m,d=o,p=c):14===g?(i=v+s.uE,a=b+s.fE,f=n,d=_,p=e):15===g?(i=v+s.uE,a=b+s.uE,f=w,d=r,p=y):(i=v+s.fE,a=b+s.uE,f=l,d=A,p=u),this.Bd[t]=i,this.Ud[t]=f,this.Pd[t]=a,C[t]=d,E[t]=p}const T=s.lE[i],O=T.length/4|0;this.RI=new Int32Array(O),this.LI=new Int32Array(O),this.SI=new Int32Array(O),this.xI=new Int32Array(O),this.MI=new Int32Array(O),this.kI=new Int32Array(O),this.CI=-1!==f?new Int32Array(O):null;let R=0;for(let t=0;t{e.d(i,{A:()=>s});class s{static am=0;static Dp=1;static dE=2;static wE=3;static yE=4;static AE=5;static cE=6;static fE=7;static uE=8;static mE=9;static pE=10;static _E=11}},3479:(t,i,e)=>{e.d(i,{A:()=>s});class s{gI;pI;yI;mI;wI;color;flat;constructor(t,i,e,s,n,r,h){this.gI=t,this.pI=i,this.yI=e,this.mI=s,this.wI=n,this.color=r,this.flat=h}}},6855:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;iI;rI;Zp;Jp;i_;info;constructor(t,i,e,s,n,r,h,o,l){this.y=t,this.x=i,this.z=e,this.iI=s,this.rI=n,this.Zp=r,this.Jp=h,this.i_=o,this.info=l}}},7441:(t,i,e)=>{e.d(i,{A:()=>s});class s{y;x;z;type;angle;model;i_;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.i_=h,this.info=o}}},7536:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{IE;gE;constructor(t){this.gE=[],this.IE=t;for(let i=0;i{e.d(i,{A:()=>n});var s=e(1982);class n extends s.A{EE;vE;constructor(){super(),this.EE=this,this.vE=this}bE(){this.vE&&this.EE&&(this.vE.EE=this.EE,this.EE.vE=this.vE,this.EE=null,this.vE=null)}}},3819:(t,i,e)=>{e.d(i,{A:()=>s});class s{static TE=['_','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','0','1','2','3','4','5','6','7','8','9'];static OE=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static ka=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.TE[Number(s-37n*t)]}return e.slice(12-i).join('')};static RE=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static LE=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static Ma=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static Su=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}},6666:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(1982);class n{SE;cursor=null;constructor(){const t=new s.A;t.next=t,t.CE=t,this.SE=t}WA(t){t.CE&&t.ww(),t.CE=this.SE.CE,t.next=this.SE,t.CE&&(t.CE.next=t),t.next.CE=t}xE(t){t.CE&&t.ww(),t.CE=this.SE,t.next=this.SE.next,t.CE.next=t,t.next&&(t.next.CE=t)}X_(){const t=this.SE.next;return t===this.SE?null:(t?.ww(),t)}head(){const t=this.SE.next;return t===this.SE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}ME(){const t=this.SE.CE;return t===this.SE?(this.cursor=null,null):(this.cursor=t?.CE||null,t)}next(){const t=this.cursor;return t===this.SE?(this.cursor=null,null):(this.cursor=t?.next||null,t)}CE(){const t=this.cursor;return t===this.SE?(this.cursor=null,null):(this.cursor=t?.CE||null,t)}clear(){for(;;){const t=this.SE.next;if(t===this.SE)return;t?.ww()}}}},1982:(t,i,e)=>{e.d(i,{A:()=>s});class s{key;next;CE;constructor(){this.key=0n,this.next=this,this.CE=this}ww(){this.CE&&this.next&&(this.CE.next=this.next,this.next.CE=this.CE,this.next=null,this.CE=null)}}},2679:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(2512),n=e(7536);class r{kE;DE;history;available;constructor(t){this.kE=t,this.available=t,this.DE=new n.A(1024),this.history=new s.A}get(t){const i=this.DE.get(t);return i&&this.history.push(i),i}put(t,i){if(0===this.available){const t=this.history.pop();t?.ww(),t?.bE()}else this.available--;this.DE.put(t,i),this.history.push(i)}clear(){const t=this.history.pop();t?(t.ww(),t.bE()):this.available=this.kE}}},2512:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n{head;constructor(){this.head=new s.A}push(t){t.vE&&t.bE(),t.vE=this.head.vE,t.EE=this.head,t.vE&&(t.vE.EE=t),t.EE.vE=t}pop(){const t=this.head.EE;return t===this.head?null:(t?.bE(),t)}}},8534:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(3867);class r{static Do=[];static yu=t=>{const i=new s.A(t.read('base_head.dat')),e=new s.A(t.read('base_type.dat')),h=new s.A(t.read('base_label.dat')),o=i.Au;i.pf+=2;for(let t=0;t{e.d(i,{A:()=>r});var s=e(8534),n=e(1069);class r{static Do=[];static yu=t=>{const i=new n.A(t.read('frame_head.dat')),e=new n.A(t.read('frame_tran1.dat')),h=new n.A(t.read('frame_tran2.dat')),o=new n.A(t.read('frame_del.dat')),l=i.Au;i.pf+=2;const a=new Int32Array(500),c=new Int32Array(500),f=new Int32Array(500),u=new Int32Array(500);for(let t=0;t0){if(0!==d.types[t])for(let i=t-1;i>y;i--)if(0===d.types[i]){a[A]=i,c[A]=0,f[A]=0,u[A]=0,A++;break}a[A]=t;let e=0;3===d.types[a[A]]&&(e=128),c[A]=1&i?h.FE:e,f[A]=2&i?h.FE:e,u[A]=4&i?h.FE:e,y=t,A++}}n.length=A,n.BE=new Int32Array(A),n.x=new Int32Array(A),n.y=new Int32Array(A),n.z=new Int32Array(A);for(let t=0;t{e.d(i,{Nc:()=>s,nl:()=>n,PE:()=>o,UE:()=>h,GE:()=>r});const s=document.getElementById('canvas'),n=s.getContext('2d',{willReadFrequently:!0}),r=document.createElement('canvas'),h=document.createElement('img'),o=r.getContext('2d',{willReadFrequently:!0})},9298:(t,i,e)=>{e.d(i,{A:()=>s});class s{static RED=16711680;static GREEN=65280;static BLUE=255;static ql=16776960;static WE=65535;static dm=16711935;static Sl=16777215;static Zl=0;static YE=16748608;static HE=8388608;static VE=128;static KE=16756736;static XE=16740352;static jE=16723968;static zE=12648192;static ZE=8453888;static qE=4259584;static JE=9179409;static $E=6116423;static fl=2301979;static ul=5063219;static wl=7759444;static Al=3353893;static QE=8388736;static tv=13350793;static iv=Int32Array.of(s.ql,s.RED,s.GREEN,s.WE,s.dm,s.Sl);static hC=6798;static oC=107;static lC=10283;static aC=16;static cC=4797;static fC=7744;static uC=5799;static dC=4634;static wC=33697;static yC=22433;static AC=2983;static mC=54193;static pC=8741;static _C=12;static IC=64030;static gC=43162;static CC=7735;static EC=8404;static vC=1701;static bC=38430;static TC=24094;static OC=10153;static RC=56621;static LC=4783;static SC=1341;static xC=16578;static MC=35003;static kC=25239;static Vg=9104;static Kg=10275;static Xg=7595;static jg=3610;static zg=7975;static Zg=8526;static qg=918;static Jg=38802;static $g=24466;static Qg=10145;static tC=58654;static iC=5027;static eC=1457;static sC=16565;static nC=34991;static rC=25486;static DC=4626;static NC=11146;static FC=6439;static BC=12;static PC=4758;static UC=10270;static jC=4574;static GC=4550;static WC=4537;static YC=5681;static HC=5673;static VC=5790;static KC=6806;static XC=8076}},8950:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(4474);class n extends s.A{static pw=new Int32Array;static _w=0;static Iw=0;static top=0;static bottom=0;static left=0;static right=0;static uI=0;static ev=0;static sv=0;static bind=(t,i,e)=>{this.pw=t,this._w=i,this.Iw=e,this.Tl(0,0,i,e)};static nv=()=>{this.left=0,this.top=0,this.right=this._w,this.bottom=this.Iw,this.uI=this.right-1,this.ev=this.right/2|0};static Tl=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this._w&&(e=this._w),s>this.Iw&&(s=this.Iw),this.top=i,this.bottom=s,this.left=t,this.right=e,this.uI=this.right-1,this.ev=this.right/2|0,this.sv=this.bottom/2|0};static clear=()=>{const t=this._w*this.Iw;for(let i=0;i{this.yl(t,i,n,e),this.yl(t,i+s-1,n,e),this.dl(t,i,n,s),this.dl(t+e-1,i,n,s)};static yl=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this._w;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this._w;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(a-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this._w-e;let h=t+i*this._w;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.pw[h++]=n;h+=r}};static hv(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,l=(n>>8&255)*r,a=(255&n)*r,c=this._w-e;let f=t+i*this._w;for(let t=0;t>16&255)*h>>8<<16)+(l+(this.pw[f]>>8&255)*h>>8<<8)+(a+(255&this.pw[f])*h>>8);this.pw[f++]=t}f+=c}}static ov(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,l=(255&s)*n;let a=i-e;a<0&&(a=0);let c=i+e;c>=this.Iw&&(c=this.Iw-1);for(let s=a;s<=c;s++){const n=s-i,a=0|Math.sqrt(e*e-n*n);let c=t-a;c<0&&(c=0);let f=t+a;f>=this._w&&(f=this._w-1);let u=c+s*this._w;for(let t=c;t<=f;t++){const t=(h+(this.pw[u]>>16&255)*r>>8<<16)+(o+(this.pw[u]>>8&255)*r>>8<<8)+(l+(255&this.pw[u])*r>>8);this.pw[u++]=t}}}static lv=(t,i,e)=>{t=this.right||i=this.bottom||(this.pw[t+i*this._w]=e)}}},4583:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1673),r=e(3867);class h extends s.A{static et=!1;static av=new Int32Array(512);static cv=new Int32Array(2048);static sin=new Int32Array(2048);static cos=new Int32Array(2048);static palette=new Int32Array(65536);static fv=new r.fe(50,null);static uv=0;static mw=new Int32Array;static ya=0;static Aa=0;static gw=!0;static fI=!1;static alpha=0;static dv=null;static wv=new r.fe(50,null);static yv=0;static km=0;static Av=new Int32Array(50);static mv=new r.fe(50,null);static pv=!1;static _v=new r.fe(50,!1);static Iv=new Int32Array(50);static{for(let t=1;t<512;t++)this.av[t]=32768/t|0;for(let t=1;t<2048;t++)this.cv[t]=65536/t|0;for(let t=0;t<2048;t++)this.sin[t]=65536*Math.sin(.0030679615757712823*t)|0,this.cos[t]=65536*Math.cos(.0030679615757712823*t)|0}static Lo=()=>{this.av=null,this.av=null,this.sin=null,this.cos=null,this.mw=null,this.fv=null,this._v=null,this.Iv=null,this.dv=null,this.wv=null,this.Av=null,this.palette=null,this.mv=null,console.log('Draw3D unloaded!')};static Fc=()=>{this.mw=new Int32Array(s.A.Iw);for(let t=0;t{this.mw=new Int32Array(i);for(let e=0;e{this.dv=null,this.wv.fill(null)};static Ev=t=>{this.uv=0;for(let i=0;i<50;i++)try{this.fv[i]=n.A.xu(t,i.toString()),this.et&&128===this.fv[i]?.Xl?this.fv[i]?.vv():this.fv[i]?.xw(),this.uv++}catch(t){}};static um=t=>{if(0!==this.Iv[t])return this.Iv[t];const i=this.mv[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.bv(h,1.4),0===h&&(h=1),this.Iv[t]=h,h};static Tv=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,l=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let a=s-.3333333333333333;a<0&&a++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*h|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[e++]=this.bv(a,i)}}for(let t=0;t<50;t++){const e=this.fv[t];if(!e)continue;const s=e.palette;this.mv[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static Rv=t=>{this.dv||(this.yv=t,this.et?this.dv=new r.Xr(t,16384):this.dv=new r.Xr(t,65536),this.wv.fill(null))};static AI=(t,i,e,n,r,o,l,a,c)=>{let f=0,u=0;r!==n&&(f=(i-t<<16)/(r-n)|0,u=(a-l<<15)/(r-n)|0);let d=0,w=0;o!==r&&(d=(e-i<<16)/(o-r)|0,w=(c-a<<15)/(o-r)|0);let y=0,A=0;if(o!==n&&(y=(t-e<<16)/(n-o)|0,A=(l-c<<15)/(n-o)|0),n<=r&&n<=o){if(ns.A.bottom&&(r=s.A.bottom),o>s.A.bottom&&(o=s.A.bottom),rd)for(o-=r,r-=n,n=h.mw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Lv(e>>16,i>>16,c>>7,a>>7,s.A.pw,n,0),e+=y,i+=d,c+=A,a+=w,n+=s.A._w}this.Lv(e>>16,t>>16,c>>7,l>>7,s.A.pw,n,0),e+=y,t+=f,c+=A,l+=u,n+=s.A._w}else for(o-=r,r-=n,n=h.mw[n];;){if(--r<0)for(;;){if(--o<0)return;this.Lv(i>>16,e>>16,a>>7,c>>7,s.A.pw,n,0),e+=y,i+=d,c+=A,a+=w,n+=s.A._w}this.Lv(t>>16,e>>16,l>>7,c>>7,s.A.pw,n,0),e+=y,t+=f,c+=A,l+=u,n+=s.A._w}else if(i=t<<=16,a=l<<=15,n<0&&(i-=y*n,t-=f*n,a-=A*n,l-=u*n,n=0),e<<=16,c<<=15,o<0&&(e-=d*o,c-=w*o,o=0),n!==o&&yf)for(r-=o,o-=n,n=h.mw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Lv(e>>16,t>>16,c>>7,l>>7,s.A.pw,n,0),e+=d,t+=f,c+=w,l+=u,n+=s.A._w}this.Lv(i>>16,t>>16,a>>7,l>>7,s.A.pw,n,0),i+=y,t+=f,a+=A,l+=u,n+=s.A._w}else for(r-=o,o-=n,n=h.mw[n];;){if(--o<0)for(;;){if(--r<0)return;this.Lv(t>>16,e>>16,l>>7,c>>7,s.A.pw,n,0),e+=d,t+=f,c+=w,l+=u,n+=s.A._w}this.Lv(t>>16,i>>16,l>>7,a>>7,s.A.pw,n,0),i+=y,t+=f,a+=A,l+=u,n+=s.A._w}}else if(r<=o){if(rs.A.bottom&&(o=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),oy)for(n-=o,o-=r,r=h.mw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Lv(t>>16,e>>16,l>>7,c>>7,s.A.pw,r,0),t+=f,e+=y,l+=u,c+=A,r+=s.A._w}this.Lv(t>>16,i>>16,l>>7,a>>7,s.A.pw,r,0),t+=f,i+=d,l+=u,a+=w,r+=s.A._w}else for(n-=o,o-=r,r=h.mw[r];;){if(--o<0)for(;;){if(--n<0)return;this.Lv(e>>16,t>>16,c>>7,l>>7,s.A.pw,r,0),t+=f,e+=y,l+=u,c+=A,r+=s.A._w}this.Lv(i>>16,t>>16,a>>7,l>>7,s.A.pw,r,0),t+=f,i+=d,l+=u,a+=w,r+=s.A._w}else if(e=i<<=16,c=a<<=15,r<0&&(e-=f*r,i-=d*r,c-=u*r,a-=w*r,r=0),t<<=16,l<<=15,n<0&&(t-=y*n,l-=A*n,n=0),o-=n,n-=r,r=h.mw[r],f>16,i>>16,l>>7,a>>7,s.A.pw,r,0),t+=y,i+=d,l+=A,a+=w,r+=s.A._w}this.Lv(e>>16,i>>16,c>>7,a>>7,s.A.pw,r,0),e+=f,i+=d,c+=u,a+=w,r+=s.A._w}else for(;;){if(--n<0)for(;;){if(--o<0)return;this.Lv(i>>16,t>>16,a>>7,l>>7,s.A.pw,r,0),t+=y,i+=d,l+=A,a+=w,r+=s.A._w}this.Lv(i>>16,e>>16,a>>7,c>>7,s.A.pw,r,0),e+=f,i+=d,c+=u,a+=w,r+=s.A._w}}else if(os.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,a>>7,l>>7,s.A.pw,o,0),i+=d,t+=f,a+=w,l+=u,o+=s.A._w}this.Lv(i>>16,e>>16,a>>7,c>>7,s.A.pw,o,0),i+=d,e+=y,a+=w,c+=A,o+=s.A._w}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.Lv(t>>16,i>>16,l>>7,a>>7,s.A.pw,o,0),i+=d,t+=f,a+=w,l+=u,o+=s.A._w}this.Lv(e>>16,i>>16,c>>7,a>>7,s.A.pw,o,0),i+=d,e+=y,a+=w,c+=A,o+=s.A._w}else if(t=e<<=16,l=c<<=15,o<0&&(t-=d*o,e-=y*o,l-=w*o,c-=A*o,o=0),i<<=16,a<<=15,r<0&&(i-=f*r,a-=u*r,r=0),n-=r,r-=o,o=h.mw[o],d>16,e>>16,a>>7,c>>7,s.A.pw,o,0),i+=f,e+=y,a+=u,c+=A,o+=s.A._w}this.Lv(t>>16,e>>16,l>>7,c>>7,s.A.pw,o,0),t+=d,e+=y,l+=w,c+=A,o+=s.A._w}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.Lv(e>>16,i>>16,c>>7,a>>7,s.A.pw,o,0),i+=f,e+=y,a+=u,c+=A,o+=s.A._w}this.Lv(e>>16,t>>16,c>>7,l>>7,s.A.pw,o,0),t+=d,e+=y,l+=w,c+=A,o+=s.A._w}};static Lv=(t,i,e,n,r,o,l)=>{let a;if(h.gw){let c;if(h.fI){if(c=i-t>3?(n-e)/(i-t)|0:0,i>s.A.uI&&(i=s.A.uI),t<0&&(e-=t*c,t=0),t>=i)return;o+=t,l=i-t>>2,c<<=2}else{if(!(t>2)>0?(n-e)*h.av[l]>>15:0}if(0===h.alpha)for(;;){if(--l<0){if((l=i-t&3)>0){a=h.palette[e>>8];do{r[o++]=a,l--}while(l>0);return}break}a=h.palette[e>>8],e+=c,r[o++]=a,r[o++]=a,r[o++]=a,r[o++]=a}else{const s=h.alpha,n=256-h.alpha;for(;;){if(--l<0){if((l=i-t&3)>0){a=h.palette[e>>8],a=((16711935&a)*n>>8&16711935)+((65280&a)*n>>8&65280);do{r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),l--}while(l>0)}break}a=h.palette[e>>8],e+=c,a=((16711935&a)*n>>8&16711935)+((65280&a)*n>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280),r[o++]=a+((16711935&r[o])*s>>8&16711935)+((65280&r[o])*s>>8&65280)}}}else if(ts.A.uI&&(i=s.A.uI),t<0&&(e-=t*c,t=0),t>=i))return;if(o+=t,l=i-t,0===h.alpha)do{r[o++]=h.palette[e>>8],e+=c,l--}while(l>0);else{const t=h.alpha,i=256-h.alpha;do{a=h.palette[e>>8],e+=c,a=((16711935&a)*i>>8&16711935)+((65280&a)*i>>8&65280),r[o++]=a+((16711935&r[o])*t>>8&16711935)+((65280&r[o])*t>>8&65280),l--}while(l>0)}}};static Sv=(t,i,e,n,r,h,o)=>{let l=0;r!==n&&(l=(i-t<<16)/(r-n)|0);let a=0;h!==r&&(a=(e-i<<16)/(h-r)|0);let c=0;if(h!==n&&(c=(t-e<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),ra)for(h-=r,r-=n,n=this.mw[n];;){if(--r<0)for(;;){if(--h<0)return;this.xv(e>>16,i>>16,s.A.pw,n,o),e+=c,i+=a,n+=s.A._w}this.xv(e>>16,t>>16,s.A.pw,n,o),e+=c,t+=l,n+=s.A._w}else for(h-=r,r-=n,n=this.mw[n];;){if(--r<0)for(;;){if(--h<0)return;this.xv(i>>16,e>>16,s.A.pw,n,o),e+=c,i+=a,n+=s.A._w}this.xv(t>>16,e>>16,s.A.pw,n,o),e+=c,t+=l,n+=s.A._w}else if(i=t<<=16,n<0&&(i-=c*n,t-=l*n,n=0),e<<=16,h<0&&(e-=a*h,h=0),n!==h&&cl)for(r-=h,h-=n,n=this.mw[n];;){if(--h<0)for(;;){if(--r<0)return;this.xv(e>>16,t>>16,s.A.pw,n,o),e+=a,t+=l,n+=s.A._w}this.xv(i>>16,t>>16,s.A.pw,n,o),i+=c,t+=l,n+=s.A._w}else for(r-=h,h-=n,n=this.mw[n];;){if(--h<0)for(;;){if(--r<0)return;this.xv(t>>16,e>>16,s.A.pw,n,o),e+=a,t+=l,n+=s.A._w}this.xv(t>>16,i>>16,s.A.pw,n,o),i+=c,t+=l,n+=s.A._w}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hc)for(n-=h,h-=r,r=this.mw[r];;){if(--h<0)for(;;){if(--n<0)return;this.xv(t>>16,e>>16,s.A.pw,r,o),t+=l,e+=c,r+=s.A._w}this.xv(t>>16,i>>16,s.A.pw,r,o),t+=l,i+=a,r+=s.A._w}else for(n-=h,h-=r,r=this.mw[r];;){if(--h<0)for(;;){if(--n<0)return;this.xv(e>>16,t>>16,s.A.pw,r,o),t+=l,e+=c,r+=s.A._w}this.xv(i>>16,t>>16,s.A.pw,r,o),t+=l,i+=a,r+=s.A._w}else if(e=i<<=16,r<0&&(e-=l*r,i-=a*r,r=0),t<<=16,n<0&&(t-=c*n,n=0),l>16,i>>16,s.A.pw,r,o),t+=c,i+=a,r+=s.A._w}this.xv(e>>16,i>>16,s.A.pw,r,o),e+=l,i+=a,r+=s.A._w}else for(h-=n,n-=r,r=this.mw[r];;){if(--n<0)for(;;){if(--h<0)return;this.xv(i>>16,t>>16,s.A.pw,r,o),t+=c,i+=a,r+=s.A._w}this.xv(i>>16,e>>16,s.A.pw,r,o),e+=l,i+=a,r+=s.A._w}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.pw,h,o),i+=a,t+=l,h+=s.A._w}this.xv(i>>16,e>>16,s.A.pw,h,o),i+=a,e+=c,h+=s.A._w}else for(r-=n,n-=h,h=this.mw[h];;){if(--n<0)for(;;){if(--r<0)return;this.xv(t>>16,i>>16,s.A.pw,h,o),i+=a,t+=l,h+=s.A._w}this.xv(e>>16,i>>16,s.A.pw,h,o),i+=a,e+=c,h+=s.A._w}else if(t=e<<=16,h<0&&(t-=a*h,e-=c*h,h=0),i<<=16,r<0&&(i-=l*r,r=0),a>16,e>>16,s.A.pw,h,o),i+=l,e+=c,h+=s.A._w}this.xv(t>>16,e>>16,s.A.pw,h,o),t+=a,e+=c,h+=s.A._w}else for(n-=r,r-=h,h=this.mw[h];;){if(--r<0)for(;;){if(--n<0)return;this.xv(e>>16,i>>16,s.A.pw,h,o),i+=l,e+=c,h+=s.A._w}this.xv(e>>16,t>>16,s.A.pw,h,o),t+=a,e+=c,h+=s.A._w}};static II=(t,i,e,n,r,h,o,l,a,c,f,u,d,w,y,A,m,p,_)=>{const I=this.Mv(_);this.pv=!this._v[_];const g=c-d,C=f-y,E=u-m,v=w-c,b=A-f,T=p-u;let O=v*f-b*c<<14;const R=b*u-T*f<<8,L=T*c-v*u<<5;let S=g*f-C*c<<14;const x=C*u-E*f<<8,M=E*c-g*u<<5;let k=C*v-g*b<<14;const D=E*b-C*T<<8,N=g*T-E*v<<5;let F=0,B=0;r!==n&&(F=(i-t<<16)/(r-n)|0,B=(l-o<<16)/(r-n)|0);let P=0,U=0;h!==r&&(P=(e-i<<16)/(h-r)|0,U=(a-l<<16)/(h-r)|0);let G=0,W=0;if(h!==n&&(G=(t-e<<16)/(n-h)|0,W=(o-a<<16)/(n-h)|0),n<=r&&n<=h){if(ns.A.bottom&&(r=s.A.bottom),h>s.A.bottom&&(h=s.A.bottom),rP)for(h-=r,r-=n,n=this.mw[n];;){if(--r<0)for(;;){if(--h<0)return;this.kv(e>>16,i>>16,s.A.pw,n,I,0,0,O,S,k,R,x,D,a>>8,l>>8),e+=G,i+=P,a+=W,l+=U,n+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(e>>16,t>>16,s.A.pw,n,I,0,0,O,S,k,R,x,D,a>>8,o>>8),e+=G,t+=F,a+=W,o+=B,n+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(h-=r,r-=n,n=this.mw[n];;){if(--r<0)for(;;){if(--h<0)return;this.kv(i>>16,e>>16,s.A.pw,n,I,0,0,O,S,k,R,x,D,l>>8,a>>8),e+=G,i+=P,a+=W,l+=U,n+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(t>>16,e>>16,s.A.pw,n,I,0,0,O,S,k,R,x,D,o>>8,a>>8),e+=G,t+=F,a+=W,o+=B,n+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}else{i=t<<=16,l=o<<=16,n<0&&(i-=G*n,t-=F*n,l-=W*n,o-=B*n,n=0),e<<=16,a<<=16,h<0&&(e-=P*h,a-=U*h,h=0);const c=n-this.Aa;if(O+=L*c,S+=M*c,k+=N*c,O|=0,S|=0,k|=0,(n===h||G>=F)&&(n!==h||P<=F))for(r-=h,h-=n,n=this.mw[n];;){if(--h<0)for(;;){if(--r<0)return;this.kv(t>>16,e>>16,s.A.pw,n,I,0,0,O,S,k,R,x,D,o>>8,a>>8),e+=P,t+=F,a+=U,o+=B,n+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(t>>16,i>>16,s.A.pw,n,I,0,0,O,S,k,R,x,D,o>>8,l>>8),i+=G,t+=F,l+=W,o+=B,n+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(r-=h,h-=n,n=this.mw[n];;){if(--h<0)for(;;){if(--r<0)return;this.kv(e>>16,t>>16,s.A.pw,n,I,0,0,O,S,k,R,x,D,a>>8,o>>8),e+=P,t+=F,a+=U,o+=B,n+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(i>>16,t>>16,s.A.pw,n,I,0,0,O,S,k,R,x,D,l>>8,o>>8),i+=G,t+=F,l+=W,o+=B,n+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}}else if(r<=h){if(rs.A.bottom&&(h=s.A.bottom),n>s.A.bottom&&(n=s.A.bottom),hG)for(n-=h,h-=r,r=this.mw[r];;){if(--h<0)for(;;){if(--n<0)return;this.kv(t>>16,e>>16,s.A.pw,r,I,0,0,O,S,k,R,x,D,o>>8,a>>8),t+=F,e+=G,o+=B,a+=W,r+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(t>>16,i>>16,s.A.pw,r,I,0,0,O,S,k,R,x,D,o>>8,l>>8),t+=F,i+=P,o+=B,l+=U,r+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(n-=h,h-=r,r=this.mw[r];;){if(--h<0)for(;;){if(--n<0)return;this.kv(e>>16,t>>16,s.A.pw,r,I,0,0,O,S,k,R,x,D,a>>8,o>>8),t+=F,e+=G,o+=B,a+=W,r+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(i>>16,t>>16,s.A.pw,r,I,0,0,O,S,k,R,x,D,l>>8,o>>8),t+=F,i+=P,o+=B,l+=U,r+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}else{e=i<<=16,a=l<<=16,r<0&&(e-=F*r,i-=P*r,a-=B*r,l-=U*r,r=0),t<<=16,o<<=16,n<0&&(t-=G*n,o-=W*n,n=0);const c=r-this.Aa;if(O+=L*c,S+=M*c,k+=N*c,O|=0,S|=0,k|=0,h-=n,n-=r,r=this.mw[r],F>16,i>>16,s.A.pw,r,I,0,0,O,S,k,R,x,D,o>>8,l>>8),t+=G,i+=P,o+=W,l+=U,r+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(e>>16,i>>16,s.A.pw,r,I,0,0,O,S,k,R,x,D,a>>8,l>>8),e+=F,i+=P,a+=B,l+=U,r+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--h<0)return;this.kv(i>>16,t>>16,s.A.pw,r,I,0,0,O,S,k,R,x,D,l>>8,o>>8),t+=G,i+=P,o+=W,l+=U,r+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(i>>16,e>>16,s.A.pw,r,I,0,0,O,S,k,R,x,D,l>>8,a>>8),e+=F,i+=P,a+=B,l+=U,r+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}}else if(hs.A.bottom&&(n=s.A.bottom),r>s.A.bottom&&(r=s.A.bottom),n>16,t>>16,s.A.pw,h,I,0,0,O,S,k,R,x,D,l>>8,o>>8),i+=P,t+=F,l+=U,o+=B,h+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(i>>16,e>>16,s.A.pw,h,I,0,0,O,S,k,R,x,D,l>>8,a>>8),i+=P,e+=G,l+=U,a+=W,h+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--r<0)return;this.kv(t>>16,i>>16,s.A.pw,h,I,0,0,O,S,k,R,x,D,o>>8,l>>8),i+=P,t+=F,l+=U,o+=B,h+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(e>>16,i>>16,s.A.pw,h,I,0,0,O,S,k,R,x,D,a>>8,l>>8),i+=P,e+=G,l+=U,a+=W,h+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}else{t=e<<=16,o=a<<=16,h<0&&(t-=P*h,e-=G*h,o-=U*h,a-=W*h,h=0),i<<=16,l<<=16,r<0&&(i-=F*r,l-=B*r,r=0);const c=h-this.Aa;if(O+=L*c,S+=M*c,k+=N*c,O|=0,S|=0,k|=0,n-=r,r-=h,h=this.mw[h],P>16,e>>16,s.A.pw,h,I,0,0,O,S,k,R,x,D,l>>8,a>>8),i+=F,e+=G,l+=B,a+=W,h+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(t>>16,e>>16,s.A.pw,h,I,0,0,O,S,k,R,x,D,o>>8,a>>8),t+=P,e+=G,o+=U,a+=W,h+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}else for(;;){if(--r<0)for(;;){if(--n<0)return;this.kv(e>>16,i>>16,s.A.pw,h,I,0,0,O,S,k,R,x,D,a>>8,l>>8),i+=F,e+=G,l+=B,a+=W,h+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}this.kv(e>>16,t>>16,s.A.pw,h,I,0,0,O,S,k,R,x,D,a>>8,o>>8),t+=P,e+=G,o+=U,a+=W,h+=s.A._w,O+=L,S+=M,k+=N,O|=0,S|=0,k|=0}}};static kv=(t,i,e,n,r,h,o,l,a,c,f,u,d,w,y)=>{if(t>=i)return;let A,m,p,_,I,g,C,E,v;if(this.fI){if(A=(y-w)/(i-t)|0,i>s.A.uI&&(i=s.A.uI),t<0&&(w-=t*A,t=0),t>=i)return;m=i-t>>3,A<<=12}else i-t>7?(m=i-t>>3,A=(y-w)*this.av[m]>>6):(m=0,A=0);if(w<<=9,n+=t,this.et&&r)if(p=0,_=0,g=t-this.ya,l+=(f>>3)*g,a+=(u>>3)*g,c+=(d>>3)*g,l|=0,a|=0,I=(c|=0)>>12,0!==I&&(o=a/I|0,(h=l/I|0)<0?h=0:h>4032&&(h=4032)),l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>12,0!==I&&(p=l/I|0,_=a/I|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=_-o>>3,h+=w>>3&786432,v=w>>23,this.pv){for(;m-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E,e[n++]=r[(4032&o)+(h>>6)]>>>v,h=p,o=_,l+=f,a+=u,I=(c+=d)>>12,0!==I&&(p=l/I|0,_=a/I|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=_-o>>3,h+=(w+=A)>>3&786432,v=w>>23;for(m=i-t&7;m-- >0;)e[n++]=r[(4032&o)+(h>>6)]>>>v,h+=C,o+=E}else{for(;m-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n++,0!=(t=r[(4032&(o+=E))+((h+=C)>>6)]>>>v)&&(e[n]=t),n+=1,h=p,o=_,l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>12,0!==I&&(p=l/I|0,_=a/I|0,p<7?p=7:p>4032&&(p=4032)),C=p-h>>3,E=_-o>>3,h+=(w+=A)>>3&786432,v=w>>23}for(m=i-t&7;m-- >0;){let t;0!=(t=r[(4032&o)+(h>>6)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}else if(p=0,_=0,g=t-this.ya,l+=(f>>3)*g,a+=(u>>3)*g,c+=(d>>3)*g,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(o=a/I|0,(h=l/I|0)<0?h=0:h>16256&&(h=16256)),l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(p=l/I|0,_=a/I|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=_-o>>3,h+=6291456&w,v=w>>23,this.pv&&r){for(;m-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E,e[n++]=r[(16256&o)+(h>>7)]>>>v,h=p,o=_,l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(p=l/I|0,_=a/I|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=_-o>>3,h+=6291456&(w+=A),v=w>>23;for(m=i-t&7;m-- >0;)e[n++]=r[(16256&o)+(h>>7)]>>>v,h+=C,o+=E}else{for(;m-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n+=1,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,0!=(t=r[(16256&(o+=E))+((h+=C)>>7)]>>>v)&&(e[n]=t),n++,h=p,o=_,l+=f,a+=u,c+=d,l|=0,a|=0,I=(c|=0)>>14,0!==I&&(p=l/I|0,_=a/I|0,p<7?p=7:p>16256&&(p=16256)),C=p-h>>3,E=_-o>>3,h+=6291456&(w+=A),v=w>>23}for(m=i-t&7;m-- >0&&r;){let t;0!=(t=r[(16256&o)+(h>>7)]>>>v)&&(e[n]=t),n++,h+=C,o+=E}}};static xv=(t,i,e,n,r)=>{if(this.fI&&(i>s.A.uI&&(i=s.A.uI),t<0&&(t=0)),t>=i)return;n+=t;let h=i-t>>2;if(0===this.alpha)for(;;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;e[n++]=r}e[n++]=r,e[n++]=r,e[n++]=r,e[n++]=r}const o=this.alpha,l=256-this.alpha;for(r=((16711935&r)*l>>8&16711935)+((65280&r)*l>>8&65280);;){if(h--,h<0)for(h=i-t&3;;){if(h--,h<0)return;e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280),e[n++]=r+((16711935&e[n])*o>>8&16711935)+((65280&e[n])*o>>8&65280)}};static Ov=t=>{this.wv[t]&&this.dv&&(this.dv[this.yv++]=this.wv[t],this.wv[t]=null)};static Mv=t=>{if(this.Av[t]=this.km++,this.wv[t])return this.wv[t];let i;if(this.yv>0&&this.dv)i=this.dv[--this.yv],this.dv[this.yv]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.pw[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.pw[t]];this._v[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this._v[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}},880:(t,i,e)=>{e.d(i,{r:()=>n});var s=e(7854);const n=async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(s.UE.src),s.UE.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>s.UE.onload=()=>t())),s.PE.clearRect(0,0,s.GE.width,s.GE.height);const i=s.UE.naturalWidth,e=s.UE.naturalHeight;return s.GE.width=i,s.GE.height=e,s.PE.drawImage(s.UE,0,0),s.PE.getImageData(0,0,i,e)}},8665:(t,i,e)=>{e.d(i,{A:()=>f});var s=e(1069),n=e(8950),r=e(4583),h=e(6730),o=e(4474),l=e(3867);class a{Fd=0;b_=0;Dv=0;Nv=-1;Fv=-1;Bv=-1;Pv=-1;Uv=-1;Gv=-1;Wv=-1;Yv=-1;Hv=-1;Vv=0;Kv=-1;Xv=-1;jv=-1;data=null}class c{x=0;y=0;z=0;w=0}class f extends o.A{static metadata=null;static head=null;static zv=null;static Zv=null;static qv=null;static Jv=null;static $v=null;static Qv=null;static tb=null;static ib=null;static eb=null;static sb=null;static nb=null;static rb=null;static axis=null;static hb=new l.fe(4096,!1);static ob=new l.fe(4096,!1);static lb=new Int32Array(4096);static ab=new Int32Array(4096);static cb=new Int32Array(4096);static fb=new Int32Array(4096);static ub=new Int32Array(4096);static wb=new Int32Array(4096);static yb=new Int32Array(1500);static Ab=new l.Xr(1500,512);static mb=new Int32Array(12);static pb=new l.Xr(12,2e3);static _b=new Int32Array(2e3);static Ib=new Int32Array(2e3);static gb=new Int32Array(12);static Cb=new Int32Array(10);static Eb=new Int32Array(10);static vb=new Int32Array(10);static Ir=0;static bb=0;static gr=0;static Tb=!1;static Hl=0;static Vl=0;static Ob=0;static Rb=new Int32Array(1e3);static Lb=!1;static yu(t){try{f.head=new s.A(t.read('ob_head.dat')),f.zv=new s.A(t.read('ob_face1.dat')),f.Zv=new s.A(t.read('ob_face2.dat')),f.qv=new s.A(t.read('ob_face3.dat')),f.Jv=new s.A(t.read('ob_face4.dat')),f.$v=new s.A(t.read('ob_face5.dat')),f.Qv=new s.A(t.read('ob_point1.dat')),f.tb=new s.A(t.read('ob_point2.dat')),f.ib=new s.A(t.read('ob_point3.dat')),f.eb=new s.A(t.read('ob_point4.dat')),f.sb=new s.A(t.read('ob_point5.dat')),f.nb=new s.A(t.read('ob_vertex1.dat')),f.rb=new s.A(t.read('ob_vertex2.dat')),f.axis=new s.A(t.read('ob_axis.dat')),f.head.pf=0,f.Qv.pf=0,f.tb.pf=0,f.ib.pf=0,f.eb.pf=0,f.nb.pf=0,f.rb.pf=0;const i=f.head.Au;f.metadata=new l.fe(i+100,null);let e=0,n=0,r=0,h=0,o=0,c=0,u=0;for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static Nd=(t,i,e)=>{const s=t.Fd,n=t.b_,r=t.Dv;let h,o,a,u,d;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.Fd,r=t.b_,h=t.Dv;let o,l,a,c,u;if(s)o=t.Bd,l=t.Ud,a=t.Pd;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let i=0;i{const e=t.Fd,s=t.b_,n=t.Dv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.Bd[i],a=t.Ud[i],c=t.Pd[i];for(let t=0;t{if(!f.metadata)throw new Error('cant loading model metadata!!!!!');const i=f.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(f.head&&f.zv&&f.Zv&&f.qv&&f.Jv&&f.$v&&f.Qv&&f.tb&&f.ib&&f.eb&&f.sb&&f.nb&&f.rb&&f.axis))throw new Error('cant loading model!!!!!');const e=i.Fd,s=i.b_,n=i.Dv,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),l=new Int32Array(s),a=new Int32Array(s),c=new Int32Array(s),u=new Int32Array(n),d=new Int32Array(n),w=new Int32Array(n);let y=null;i.Uv>=0&&(y=new Int32Array(e));let A=null;i.Hv>=0&&(A=new Int32Array(s));let m=null,p=0;i.Vv>=0?m=new Int32Array(s):p=-i.Vv-1;let _=null;i.Kv>=0&&(_=new Int32Array(s));let I=null;i.Xv>=0&&(I=new Int32Array(s));const g=new Int32Array(s);f.Qv.pf=i.Nv,f.tb.pf=i.Fv,f.ib.pf=i.Bv,f.eb.pf=i.Pv,f.sb.pf=i.Uv;let C,E,v,b=0,T=0,O=0;for(let t=0;t{if(!f.metadata||!f.metadata[i])throw new Error('No model metadata');const e=f.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const n=e.Fd,r=e.b_,h=e.Dv,o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n),c=new Int32Array(r),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(h),y=new Int32Array(h),A=new Int32Array(h);let m=null;e.Uv>=0&&(m=new Int32Array(n));let p=null;e.Hv>=0&&(p=new Int32Array(r));let _=null,I=0;e.Vv>=0?_=new Int32Array(r):I=-e.Vv-1;let g=null;e.Kv>=0&&(g=new Int32Array(r));let C=null;e.Xv>=0&&(C=new Int32Array(r));const E=new Int32Array(r),v=new s.A(e.data);v.pf=e.Nv;const b=new s.A(e.data);b.pf=e.Fv;const T=new s.A(e.data);T.pf=e.Bv;const O=new s.A(e.data);O.pf=e.Pv;const R=new s.A(e.data);R.pf=e.Uv;let L,S,x,M=0,k=0,D=0;for(let t=0;tthis.jd&&(this.jd=-e),e>this.__&&(this.__=e);const n=i*i+s*s;n>this.Em&&(this.Em=n)}this.Em=Math.sqrt(this.Em)+.99|0,this.Wb=Math.sqrt(this.Em*this.Em+this.jd*this.jd)+.99|0,this.Gb=this.Wb+(Math.sqrt(this.Em*this.Em+this.__*this.__)+.99|0)}Gd(){this.jd=0,this.__=0;for(let t=0;tthis.jd&&(this.jd=-i),i>this.__&&(this.__=i)}this.Wb=Math.sqrt(this.Em*this.Em+this.jd*this.jd)+.99|0,this.Gb=this.Wb+(Math.sqrt(this.Em*this.Em+this.__*this.__)+.99|0)}Wa(){if(this.Yb){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Vd=new l.fe(i+1,null);for(let e=0;e<=i;e++)this.Vd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Hd=new l.fe(i+1,null);for(let e=0;e<=i;e++)this.Hd[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;el;)l=e[o++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==l||0===r.types[i])&&this.jb(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}f.Ir=0,f.bb=0,f.gr=0,o=0,l=e[o++];for(let t=0;tl;)l=e[o++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===l||0===r.types[i])&&this.jb(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.Ya(t)}Ya(t){if(!this.Vd||-1===t||!h.A.Do[t])return;const i=h.A.Do[t],e=i.NE;f.Ir=0,f.bb=0,f.gr=0;for(let t=0;t>16;this.Pd[t]=this.Ud[t]*i+this.Pd[t]*e>>16,this.Ud[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.Mb&&this.kb&&this.Db||(this.Mb=new Int32Array(this.b_),this.kb=new Int32Array(this.b_),this.Db=new Int32Array(this.b_)),!this.f_){this.f_=new l.fe(this.Fd,null);for(let t=0;t8192||m>8192||p>8192||A<-8192||m<-8192||p<-8192;)A>>=1,m>>=1,p>>=1;let _=0|Math.sqrt(A*A+m*m+p*p);if(_<=0&&(_=1),A=256*A/_|0,m=256*m/_|0,p=256*p/_|0,this.v_&&1&this.v_[i]){const r=t+((e*A+s*m+n*p)/(h+(h/2|0))|0);this.Mu&&(this.Mb[i]=f.xb(this.Mu[i],r,this.v_[i]))}else{let t=this.f_[r];t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.f_[o],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++),t=this.f_[l],t&&(t.x+=A,t.y+=m,t.z+=p,t.w++)}}if(r)this.w_(t,h,e,s,n);else{this.p_=new l.fe(this.Fd,null);for(let t=0;t>16;for(let s=0;s>16,I=I*w-_*d>>16,_=p),0!==t&&(p=I*a-g*l>>16,g=I*l+g*a>>16,I=p),0!==i&&(p=g*c+_*u>>16,g=g*u-_*c>>16,_=p),_+=n,I+=h,g+=o,p=I*A-g*y>>16,g=I*y+g*A>>16,I=p,f.lb&&f.ab&&f.cb&&(f.cb[s]=g-m,f.lb[s]=r.A.ya+((_<<9)/g|0),f.ab[s]=r.A.Aa+((I<<9)/g|0)),this.Dv>0&&f.fb&&f.ub&&f.wb&&(f.fb[s]=_,f.ub[s]=I,f.wb[s]=g)}try{this.qb(!1,!1,0)}catch(t){}}draw(t,i,e,s,h,o,l,a,c){const u=a*h-o*s>>16,d=l*i+u*e>>16,w=this.Em*e>>16,y=d+w;if(y<=50||d>=3500)return;const A=a*s+o*h>>16;let m=A-this.Em<<9;if((m/y|0)>=n.A.ev)return;let p=A+this.Em<<9;if((p/y|0)<=-n.A.ev)return;const _=l*e-u*i>>16,I=this.Em*i>>16;let g=_+I<<9;if((g/y|0)<=-n.A.sv)return;let C=_-(I+(this.jd*e>>16))<<9;if((C/y|0)>=n.A.sv)return;let E=d-(w+(this.jd*i>>16))<=50,v=!1;if(c>0&&f.Tb){let t=d-w;t<=50&&(t=50),A>0?(m=m/y|0,p=p/t|0):(p=p/y|0,m=m/t|0),_>0?(C=C/y|0,g=g/t|0):(g=g/y|0,C=C/t|0);const i=f.Hl-r.A.ya,e=f.Vl-r.A.Aa;i>m&&iC&&e>16,w=w*R-c*O>>16,c=r),c+=o,u+=l,w+=a,r=w*s+c*h>>16,w=w*h-c*s>>16,c=r,r=u*e-w*i>>16,w=u*i+w*e>>16,u=r,f.cb&&(f.cb[n]=w-d),w>=50&&f.lb&&f.ab?(f.lb[n]=b+((c<<9)/w|0),f.ab[n]=T+((u<<9)/w|0)):f.lb&&(f.lb[n]=-5e3,E=!0),(E||this.Dv>0)&&f.fb&&f.ub&&f.wb&&(f.fb[n]=c,f.ub[n]=u,f.wb[n]=w)}try{this.qb(E,v,c)}catch(t){}}qb(t,i,e,s=!1){f.Lb&&(this.Kb=-1,this.Xb=-1);for(let t=0;tn.A.uI||a>n.A.uI||c>n.A.uI),f.Ab&&f.yb){const t=((y+A+m)/3|0)+this.Wb;f.Ab[t][f.yb[t]++]=s,f.Lb&&this.Jb(f.Hl,f.Vl,u,d,w,l,a,c)&&this.Xb=0;t--){const i=f.yb[t];if(!(i<=0)&&f.Ab){const e=f.Ab[t];for(let t=0;t=0;t--){const i=f.yb[t];if(i>0&&f.Ab){const e=f.Ab[t];for(let s=0;s0||f.mb[2]>0)&&(r=(f.gb[1]+f.gb[2])/(f.mb[1]+f.mb[2])|0);let h=0;f.mb&&f.gb&&(f.mb[3]>0||f.mb[4]>0)&&(h=(f.gb[3]+f.gb[4])/(f.mb[3]+f.mb[4])|0);let o=0;if(f.mb&&f.gb&&(f.mb[6]>0||f.mb[8]>0)&&(o=(f.gb[6]+f.gb[8])/(f.mb[6]+f.mb[8])|0),f.mb&&f.pb){let t,i=0,e=f.mb[10],n=f.pb[10],l=f._b;i===e&&(i=0,e=f.mb[11],n=f.pb[11],l=f.Ib),t=ir;)try{this.$b(n[i++],s),i===e&&n!==f.pb[11]&&(i=0,e=f.mb[11],n=f.pb[11],l=f.Ib),t=ih;)try{this.$b(n[i++],s),i===e&&n!==f.pb[11]&&(i=0,e=f.mb[11],n=f.pb[11],l=f.Ib),t=io;)try{this.$b(n[i++],s),i===e&&n!==f.pb[11]&&(i=0,e=f.mb[11],n=f.pb[11],l=f.Ib),t=i>2,h=this.Bb[i],o=this.Pb[i],l=this.Ub[i];r.A.II(f.lb[e],f.lb[s],f.lb[n],f.ab[e],f.ab[s],f.ab[n],this.Mb[t],this.kb[t],this.Db[t],f.fb[h],f.ub[h],f.wb[h],f.fb[o],f.fb[l],f.ub[o],f.ub[l],f.wb[o],f.wb[l],this.Mu[t])}else if(3===h&&this.v_&&this.Mu&&this.Mb&&f.lb&&f.ab&&f.fb&&f.ub&&f.wb){const i=this.v_[t]>>2,h=this.Bb[i],o=this.Pb[i],l=this.Ub[i];r.A.II(f.lb[e],f.lb[s],f.lb[n],f.ab[e],f.ab[s],f.ab[n],this.Mb[t],this.Mb[t],this.Mb[t],f.fb[h],f.ub[h],f.wb[h],f.fb[o],f.fb[l],f.ub[o],f.ub[l],f.wb[o],f.wb[l],this.Mu[t])}}Qb(t,i=!1){let e=0;if(f.wb){const i=r.A.ya,s=r.A.Aa,n=this.T_[t],h=this.O_[t],o=this.R_[t],l=f.wb[n],a=f.wb[h],c=f.wb[o];if(l>=50&&f.lb&&f.ab&&this.Mb)f.Cb[e]=f.lb[n],f.Eb[e]=f.ab[n],f.vb[e++]=this.Mb[t];else if(f.fb&&f.ub&&this.Mb){const u=f.fb[n],d=f.ub[n],w=this.Mb[t];if(c>=50&&this.Db){const n=(50-l)*r.A.cv[c-l];f.Cb[e]=i+((u+((f.fb[o]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[o]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.Db[t]-w)*n>>16)}if(a>=50&&this.kb){const n=(50-l)*r.A.cv[a-l];f.Cb[e]=i+((u+((f.fb[h]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[h]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.kb[t]-w)*n>>16)}}if(a>=50&&f.lb&&f.ab&&this.kb)f.Cb[e]=f.lb[h],f.Eb[e]=f.ab[h],f.vb[e++]=this.kb[t];else if(f.fb&&f.ub&&this.kb){const u=f.fb[h],d=f.ub[h],w=this.kb[t];if(l>=50&&this.Mb){const h=(50-a)*r.A.cv[l-a];f.Cb[e]=i+((u+((f.fb[n]-u)*h>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[n]-d)*h>>16)<<9)/50|0),f.vb[e++]=w+((this.Mb[t]-w)*h>>16)}if(c>=50&&this.Db){const n=(50-a)*r.A.cv[c-a];f.Cb[e]=i+((u+((f.fb[o]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[o]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.Db[t]-w)*n>>16)}}if(c>=50&&f.lb&&f.ab&&this.Db)f.Cb[e]=f.lb[o],f.Eb[e]=f.ab[o],f.vb[e++]=this.Db[t];else if(f.fb&&f.ub&&this.Db){const u=f.fb[o],d=f.ub[o],w=this.Db[t];if(a>=50&&this.kb){const n=(50-c)*r.A.cv[a-c];f.Cb[e]=i+((u+((f.fb[h]-u)*n>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[h]-d)*n>>16)<<9)/50|0),f.vb[e++]=w+((this.kb[t]-w)*n>>16)}if(l>=50&&this.Mb){const h=(50-c)*r.A.cv[l-c];f.Cb[e]=i+((u+((f.fb[n]-u)*h>>16)<<9)/50|0),f.Eb[e]=s+((d+((f.ub[n]-d)*h>>16)<<9)/50|0),f.vb[e++]=w+((this.Mb[t]-w)*h>>16)}}}const s=f.Cb[0],h=f.Cb[1],o=f.Cb[2],l=f.Eb[0],a=f.Eb[1],c=f.Eb[2];if(!((s-h)*(c-a)-(l-a)*(o-h)<=0))if(r.A.fI=!1,3===e){let e;if((s<0||h<0||o<0||s>n.A.uI||h>n.A.uI||o>n.A.uI)&&(r.A.fI=!0),e=this.v_?3&this.v_[t]:0,i)r.A.rv(s,h,l,a,f.vb[0]),r.A.rv(h,o,a,c,f.vb[1]),r.A.rv(o,s,c,l,f.vb[2]);else if(0===e)r.A.AI(s,h,o,l,a,c,f.vb[0],f.vb[1],f.vb[2]);else if(1===e&&this.Mb)r.A.Sv(s,h,o,l,a,c,r.A.palette[this.Mb[t]]);else if(2===e&&this.v_&&this.Mu&&f.fb&&f.ub&&f.wb){const i=this.v_[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.II(s,h,o,l,a,c,f.vb[0],f.vb[1],f.vb[2],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t])}else if(3===e&&this.v_&&this.Mu&&this.Mb&&f.fb&&f.ub&&f.wb){const i=this.v_[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.II(s,h,o,l,a,c,this.Mb[t],this.Mb[t],this.Mb[t],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t])}}else if(4===e){let e;if((s<0||h<0||o<0||s>n.A.uI||h>n.A.uI||o>n.A.uI||f.Cb[3]<0||f.Cb[3]>n.A.uI)&&(r.A.fI=!0),e=this.v_?3&this.v_[t]:0,i)r.A.rv(s,h,l,a,f.vb[0]),r.A.rv(h,o,a,c,f.vb[1]),r.A.rv(o,f.Cb[3],c,f.Eb[3],f.vb[2]),r.A.rv(f.Cb[3],s,f.Eb[3],l,f.vb[3]);else if(0===e)r.A.AI(s,h,o,l,a,c,f.vb[0],f.vb[1],f.vb[2]),r.A.AI(s,o,f.Cb[3],l,c,f.Eb[3],f.vb[0],f.vb[2],f.vb[3]);else if(1===e){if(this.Mb){const i=r.A.palette[this.Mb[t]];r.A.Sv(s,h,o,l,a,c,i),r.A.Sv(s,o,f.Cb[3],l,c,f.Eb[3],i)}}else if(2===e&&this.v_&&this.Mu&&f.fb&&f.ub&&f.wb){const i=this.v_[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.II(s,h,o,l,a,c,f.vb[0],f.vb[1],f.vb[2],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t]),r.A.II(s,o,f.Cb[3],l,c,f.Eb[3],f.vb[0],f.vb[2],f.vb[3],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t])}else if(3===e&&this.v_&&this.Mu&&this.Mb&&f.fb&&f.ub&&f.wb){const i=this.v_[t]>>2,e=this.Bb[i],n=this.Pb[i],u=this.Ub[i];r.A.II(s,h,o,l,a,c,this.Mb[t],this.Mb[t],this.Mb[t],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t]),r.A.II(s,o,f.Cb[3],l,c,f.Eb[3],this.Mb[t],this.Mb[t],this.Mb[t],f.fb[e],f.ub[e],f.wb[e],f.fb[n],f.fb[u],f.ub[n],f.ub[u],f.wb[n],f.wb[u],this.Mu[t])}}}jb(t,i,e,s,n){if(!s)return;const h=s.length;if(0===n){let n=0;f.Ir=0,f.bb=0,f.gr=0;for(let t=0;t0?(f.Ir=(f.Ir/n|0)+t,f.bb=(f.bb/n|0)+i,f.gr=(f.gr/n|0)+e):(f.Ir=t,f.bb=i,f.gr=e)}else if(1===n)for(let n=0;n=this.Vd.length)continue;const h=this.Vd[r];if(h)for(let s=0;s=this.Vd.length)continue;const o=this.Vd[h];if(o)for(let s=0;s>16;this.Ud[n]=this.Ud[n]*u-this.Bd[n]*c>>16,this.Bd[n]=t}if(0!==h){c=r.A.sin[h],u=r.A.cos[h];const t=this.Ud[n]*u-this.Pd[n]*c>>16;this.Pd[n]=this.Ud[n]*c+this.Pd[n]*u>>16,this.Ud[n]=t}if(0!==l){c=r.A.sin[l],u=r.A.cos[l];const t=this.Pd[n]*c+this.Bd[n]*u>>16;this.Pd[n]=this.Pd[n]*u-this.Bd[n]*c>>16,this.Bd[n]=t}this.Bd[n]+=f.Ir,this.Ud[n]+=f.bb,this.Pd[n]+=f.gr}}else if(3===n)for(let n=0;n=this.Vd.length)continue;const h=this.Vd[r];if(h)for(let s=0;s=this.Hd.length)continue;const n=this.Hd[e];if(n)for(let i=0;i255&&(this.Fb[e]=255)}}}Zb(){this.jd=0,this.Em=0,this.__=0,this.I_=999999,this.g_=-999999,this.E_=-99999,this.C_=99999;for(let t=0;tthis.g_&&(this.g_=i),sthis.E_&&(this.E_=s),-e>this.jd&&(this.jd=-e),e>this.__&&(this.__=e);const n=i*i+s*s;n>this.Em&&(this.Em=n)}this.Em=0|Math.sqrt(this.Em),this.Wb=0|Math.sqrt(this.Em*this.Em+this.jd*this.jd),this.Gb=this.Wb+(0|Math.sqrt(this.Em*this.Em+this.__*this.__))}Jb(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{e.d(i,{A:()=>o});var s=e(8950),n=e(1069),r=e(4474),h=e(880);class o extends r.A{pw;width;height;iT;eT;Xl;dw;constructor(t,i){super(),this.pw=new Int32Array(t*i),this.width=this.Xl=t,this.height=this.dw=i,this.iT=this.eT=0}static sT=async(t,i)=>{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(0,h.r)(e),n=new o(s.width,s.height),r=new Uint32Array(s.data.buffer),l=n.pw;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static xu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.pf=s.Au;const h=r.Au,l=r.Au,a=[],c=r.pu-1;for(let t=0;ts.length||r.pf>r.length)throw new Error;const f=r.pu,u=r.pu,d=r.Au,w=r.Au,y=new o(d,w);y.iT=f,y.eT=u,y.Xl=h,y.dw=l;const A=r.pu;if(0===A){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.nT(h,r,this.pw,n,l,s.A.pw,e,o)}Kl(t,i,e){i|=0,e|=0;let n=(i+=this.iT)+(e+=this.eT)*s.A._w,r=0,h=this.height,o=this.width,l=s.A._w-o,a=0;if(es.A.bottom&&(h-=e+h-s.A.bottom),is.A.right){const t=i+o-s.A.right;o-=t,a+=t,l+=t}o>0&&h>0&&this.rT(o,h,this.pw,r,a,s.A.pw,n,l,t)}hT(t,i){t|=0,i|=0;let e=(t+=this.iT)+(i+=this.eT)*s.A._w,n=0,r=this.height,h=this.width,o=s.A._w-h,l=0;if(is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.oT(h,r,this.pw,n,l,s.A.pw,e,o)}lT(){const t=this.pw,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.pw[s]=(r<<16)+(h<<8)+o}}}xw(t,i,e,n){t|=0,i|=0,e|=0,n|=0;try{const r=this.width;let h=0,o=0;const l=this.Xl,a=this.dw,c=(l<<16)/e|0,f=(a<<16)/n|0;t+=(this.iT*e+l-1)/l|0,i+=(this.eT*n+a-1)/a|0,this.iT*e%l!=0&&(h=(l-this.iT*e%l<<16)/e|0),this.eT*n%a!=0&&(o=(a-this.eT*n%a<<16)/n|0),e=e*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u=t+i*s.A._w,d=s.A._w-e;if(is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right){const i=t+e-s.A.right;e-=i,d+=i}this.scale(e,n,this.pw,h,o,s.A.pw,d,u,r,c,f)}catch(t){console.error('error in sprite clipping routine')}}cT(t,i,e,n,r,h,o,l,a,c){t|=0,i|=0,e|=0,n|=0;try{const f=-e/2|0,u=-n/2|0,d=65536*Math.sin(a/326.11)|0,w=65536*Math.cos(a/326.11)|0,y=d*c>>8,A=w*c>>8;let m=(o<<16)+u*y+f*A,p=u*A-f*y+(l<<16),_=t+i*s.A._w;for(let t=0;t>16)+(o>>16)*this.width],n+=A,o-=y;m+=y,p+=A,_+=s.A._w}}catch(t){}}fT(t,i,e){t|=0,i|=0;let n=(t+=this.iT)+(i+=this.eT)*s.A._w,r=0,h=this.height,o=this.width,l=s.A._w-o,a=0;if(is.A.bottom&&(h-=i+h-s.A.bottom),ts.A.right){const i=t+o-s.A.right;o-=i,a+=i,l+=i}o>0&&h>0&&this.uT(o,h,this.pw,a,r,s.A.pw,n,l,e.pw)}scale(t,i,e,s,n,r,h,o,l,a,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*l;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=a}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}oT(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}rT(t,i,e,s,n,r,h,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}h+=o,s+=n}}nT(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}uT(t,i,e,s,n,r,h,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++}h+=o,n+=s}}}},1673:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(8950),n=e(1069),r=e(4474);class h extends r.A{pw;width;height;iT;eT;Xl;dw;palette;constructor(t,i,e){super(),this.pw=new Int8Array(t*i),this.width=this.Xl=t,this.height=this.dw=i,this.iT=this.eT=0,this.palette=e}static xu=(t,i,e=0)=>{const s=new n.A(t.read(i+'.dat')),r=new n.A(t.read('index.dat'));r.pf=s.Au;const o=r.Au,l=r.Au,a=r.pu,c=new Int32Array(a);for(let t=1;ts.length||r.pf>r.length)throw new Error;const f=r.pu,u=r.pu,d=r.Au,w=r.Au,y=new h(d,w,c);y.iT=f,y.eT=u,y.Xl=o,y.dw=l;const A=y.pw,m=r.pu;if(0===m){const t=y.width*y.height;for(let i=0;is.A.bottom&&(r-=i+r-s.A.bottom),ts.A.right){const i=t+h-s.A.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.dT(h,r,this.pw,n,l,s.A.pw,e,o)}lT(){const t=this.pw,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}vv(){this.Xl|=0,this.dw|=0,this.Xl/=2,this.dw/=2,this.Xl|=0,this.dw|=0;const t=new Int8Array(this.Xl*this.dw);let i=0;for(let e=0;e>1)+(e+this.eT>>1)*this.Xl]=this.pw[i++];this.pw=t,this.width=this.Xl,this.height=this.dw,this.iT=0,this.eT=0}xw(){if(this.width===this.Xl&&this.height===this.dw)return;const t=new Int8Array(this.Xl*this.dw);let i=0;for(let e=0;e>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,n){try{const r=this.width;this.height;let h=0,o=0;const l=this.Xl,a=this.dw,c=(l<<16)/e|0,f=(a<<16)/n|0;t=t+(this.iT*e+l-1)/l|0,i=i+(this.eT*n+a-1)/a|0,this.iT*e%l!=0&&(h=(l-this.iT*e%l<<16)/e|0),this.eT*n%a!=0&&(o=(a-this.eT*n%a<<16)/n|0),e=e*(this.width-(h>>16))/l|0,n=n*(this.height-(o>>16))/a|0;let u,d=t+i*s.A._w,w=s.A._w-e;is.A.bottom&&(n-=i+n-s.A.bottom),ts.A.right&&(u=t+e-s.A.right,e-=u,w+=u),this.wT(s.A.pw,this.pw,this.palette,h,o,d,w,e,n,c,f,r)}catch(t){console.log('error in sprite clipping routine')}}wT(t,i,e,s,n,r,h,o,l,a,c,f){try{const u=s;for(let d=-l;d<0;d++){const l=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+l];0==n?r++:t[r++]=e[255&n],s+=a}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}},1183:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(8950),n=e(7854);class r{yT;width;height;AT;mT;pw;constructor(t,i,e=n.nl){this.AT=e,this.yT=this.AT.getImageData(0,0,t,i),this.mT=new Uint32Array(this.yT.data.buffer),this.pw=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.pw.fill(0)}bind(){s.A.bind(this.pw,this.width,this.height)}draw(t,i){this.#t(),this.AT.putImageData(this.yT,t,i)}#t(){const t=this.pw.length,i=this.pw,e=this.mT;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}},4544:(t,i,e)=>{e.d(i,{A:()=>s});class s{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));zo=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Qo=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};pT=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}},2901:(t,i,e)=>{e.d(i,{A:()=>r});var s=e(1069),n=e(1908);class r{static pT=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.IT)return null;if(this.bT[t])return this.bT[t];const i=this.vT[t],e=i+this.ET[t];if(this._T){const s=Uint8Array.from(this.buffer.subarray(i,i+e));return this.bT[t]=s,s}{const i=Uint8Array.from(n.A.read(this.CT[t],this.buffer,this.ET[t],this.vT[t]));return this.bT[t]=i,i}}}},1069:(t,i,e)=>{e.d(i,{A:()=>h});var s=e(9234),n=e(6666),r=e(4474);class h extends r.A{static OT=3988292384;static RT=new Int32Array(256);static LT=new Uint32Array(33);static ST=new n.A;static xT=new n.A;static MT=new n.A;static kT=0;static DT=0;static NT=0;static{for(let t=0;t<32;t++)h.LT[t]=(1<>>=1:i=i>>>1^h.OT;h.RT[t]=i}}static Zo=t=>{let i=4294967295;for(let e=0;e>>8^h.RT[255&(i^t[e])];return~i};view;data;pf=0;FT=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.pf}static Pt=t=>{let i=null;return 0===t&&h.kT>0?(h.kT--,i=h.ST.X_()):1===t&&h.DT>0?(h.DT--,i=h.xT.X_()):2===t&&h.NT>0&&(h.NT--,i=h.MT.X_()),i?(i.pf=0,i):new h(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.pf=0,100===this.view.byteLength&&h.kT<1e3?(h.ST.WA(this),h.kT++):5e3===this.view.byteLength&&h.DT<250?(h.xT.WA(this),h.DT++):3e4===this.view.byteLength&&h.NT<50&&(h.MT.WA(this),h.NT++)}get pu(){return this.view.getUint8(this.pf++)}get Dd(){return this.view.getInt8(this.pf++)}get Au(){const t=this.view.getUint16(this.pf);return this.pf+=2,t}get Iu(){const t=this.view.getInt16(this.pf);return this.pf+=2,t}get qu(){const t=this.view.getUint8(this.pf++)<<16|this.view.getUint16(this.pf);return this.pf+=2,t}get il(){const t=this.view.getInt32(this.pf);return this.pf+=4,t}get hE(){const t=this.view.getBigInt64(this.pf);return this.pf+=8,t}get FE(){return this.view.getUint8(this.pf)<128?this.pu-64:this.Au-49152}get Cm(){return this.view.getUint8(this.pf)<128?this.pu:this.Au-32768}get Eu(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.pf++))&&this.pf>16),this.view.setUint16(this.pf,t),this.pf+=2}p4(t){this.view.setInt32(this.pf,t),this.pf+=4}WT(t){this.view.setInt32(this.pf,t,!0),this.pf+=4}YT(t){this.view.setBigInt64(this.pf,t),this.pf+=8}HT(t){const i=this.view,e=t.length;for(let s=0;s>>3}zT(t){let i=this.FT>>>3,e=8-(7&this.FT),s=0;for(this.FT+=t;t>e;e=8)s+=(this.view.getUint8(i++)&h.LT[e])<>>e-t&h.LT[t],s}ZT(t,i){const e=this.pf;this.pf=0;const n=new Uint8Array(e);this.BT(e,0,n);const r=(0,s.qT)(n),h=(0,s.JT)(r,i,t),o=(0,s.$T)(h);this.pf=0,this.p1(o.length),this.VT(o,o.length,0)}}},5226:(t,i,e)=>{e.d(i,{Q:()=>n,x:()=>s});class s{QT=new Map;Eo;xo=self.isSecureContext?self.crypto.randomUUID():'0';constructor(t){this.Eo=t}async Ko(){const t=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),i=t.createDataChannel('channel'),e=crypto.randomUUID();this.QT.set(e,i),await t.setLocalDescription(await t.createOffer()),t.onicegatheringstatechange=async()=>{if('complete'===t.iceGatheringState){let i;self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(t.localDescription)):console.log(JSON.stringify(t.localDescription));try{for(;null===(i=prompt('Offer copied to clipboard, paste answer here')););t.setRemoteDescription(new RTCSessionDescription(JSON.parse(i)))}catch(t){console.error(t)}}},i.onopen=()=>{i.send(JSON.stringify({type:'id',id:e})),console.log('Connected to peer!')},i.onerror=t=>{console.error(t)},i.onmessage=t=>{const i=JSON.parse(t.data);i.data&&(i.data=Object.values(i.data)),this.Eo&&this.Eo.postMessage(i)}}postMessage(t){const i=this.QT.get(t.data.id),e=t.data;e.data&&(e.data=Array.from(t.data.data)),i&&'open'===i.readyState&&i.send(JSON.stringify(e))}}class n{pc;So=void 0;xo;constructor(t){this.pc=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),this.pc.ondatachannel=i=>{this.So=i.channel,this.So.onopen=()=>{console.log('Connected to host!')},this.So.onerror=t=>{console.error(t)},this.So.onmessage=i=>{if(!this.xo){const t=JSON.parse(i.data);if('id'===t.type)return void(this.xo=t.id)}t.onmessage&&t.onmessage(i)}},this.pc.onicegatheringstatechange=async()=>{'complete'===this.pc.iceGatheringState&&(self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(this.pc.localDescription)):console.log(JSON.stringify(this.pc.localDescription)))}}async Xo(t){await this.pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(t))),await this.pc.setLocalDescription(await this.pc.createAnswer())}}},3937:(t,i,e)=>{e.d(i,{A:()=>o});class s{start=0;end=0;form=0;length=0;tO=null;iO=null;threshold=0;position=0;delta=0;amplitude=0;eO=0;read(t){this.form=t.pu,this.start=t.il,this.end=t.il,this.length=t.pu,this.tO=new Int32Array(this.length),this.iO=new Int32Array(this.length);for(let i=0;i=this.threshold&&this.iO&&this.tO&&(this.amplitude=this.iO[this.position++]<<15,this.position>=this.length&&(this.position=this.length-1),this.threshold=this.tO[this.position]/65536*t|0,this.threshold>this.eO&&(this.delta=((this.iO[this.position]<<15)-this.amplitude)/(this.threshold-this.eO)|0)),this.amplitude+=this.delta,this.eO++,this.amplitude-this.delta>>15}}class n{static buffer=null;static UA=null;static sin=null;static sO=new Int32Array(5);static nO=new Int32Array(5);static rO=new Int32Array(5);static hO=new Int32Array(5);static oO=new Int32Array(5);lO=null;aO=null;cO=null;fO=null;uO=null;dO=null;release=null;attack=null;wO=new Int32Array(5);yO=new Int32Array(5);AO=new Int32Array(5);start=0;length=500;mO=100;pO=0;static init=()=>{this.UA=new Int32Array(32768);for(let t=0;t<32768;t++)Math.random()>.5?this.UA[t]=1:this.UA[t]=-1;this.sin=new Int32Array(32768);for(let t=0;t<32768;t++)this.sin[t]=16384*Math.sin(t/5215.1903)|0;this.buffer=new Int32Array(220500)};_O(t,i){for(let i=0;i>1,h+=(i*s>>16)+r}if(this.uO&&this.dO){const i=this.uO.evaluate(t),e=this.dO.evaluate(t);c=c*(32768+(this.IO(e,a,this.uO.form)>>1))>>15,a+=(i*o>>16)+l}for(let s=0;s<5;s++)if(0!==this.wO[s]){const r=i+n.nO[s];r>15,n.sO[s],this.lO.form),n.sO[s]+=(e*n.hO[s]>>16)+n.oO[s])}}if(this.release&&this.attack){this.release.reset(),this.attack.reset();let i=0,e=!0;for(let s=0;s>8):this.release.start+((this.release.end-this.release.start)*h>>8),i+=256,i>=o&&(i=0,e=!e),e&&(n.buffer[s]=0)}}if(this.pO>0&&this.mO>0){const i=this.pO*e;for(let e=i;e32767&&(n.buffer[i]=32767);return n.buffer}IO(t,i,e){return 1===e?(32767&i)<16384?t:-t:2===e?n.sin[32767&i]*t>>14:3===e?((32767&i)*t>>14)-t:4===e?n.UA[i/2607&32767]*t:0}read(t){this.lO=new s,this.lO.read(t),this.aO=new s,this.aO.read(t),0!==t.pu&&(t.pf--,this.cO=new s,this.cO.read(t),this.fO=new s,this.fO.read(t)),0!==t.pu&&(t.pf--,this.uO=new s,this.uO.read(t),this.dO=new s,this.dO.read(t)),0!==t.pu&&(t.pf--,this.release=new s,this.release.read(t),this.attack=new s,this.attack.read(t));for(let i=0;i<10;i++){const e=t.Cm;if(0===e)break;this.wO[i]=e,this.yO[i]=t.FE,this.AO[i]=t.Cm}this.pO=t.Cm,this.mO=t.Cm,this.length=t.Au,this.start=t.Au}}var r=e(1069),h=e(3867);class o{static gO=new Int32Array(1e3);static CO=null;static EO=null;static vO=new h.fe(1e3,null);bO=new h.fe(10,null);TO=0;loopEnd=0;static yu=t=>{const i=new r.A(t.read('sounds.dat'));for(this.CO=new Uint8Array(441e3),this.EO=new r.A(this.CO),n.init();;){const t=i.Au;if(65535===t)break;const e=new o;e.read(i),this.vO[t]=e,this.gO[t]=e.trim()}};static _O=(t,i)=>{if(!this.vO[t])return null;const e=this.vO[t];return e?.OO(i)??null};read(t){for(let i=0;i<10;i++)0!==t.pu&&(t.pf--,this.bO[i]=new n,this.bO[i]?.read(t));this.TO=t.Au,this.loopEnd=t.Au}trim(){let t=9999999;for(let i=0;i<10;i++)this.bO[i]&&(this.bO[i].start/20|0)i&&(i=this.bO[t].length+this.bO[t].start);if(0===i)return 0;let e=22050*i/1e3|0,s=22050*this.TO/1e3|0,n=22050*this.loopEnd/1e3|0;(s<0||n<0||n>e||s>=n)&&(t=0);let r=e+(n-s)*(t-1);for(let t=44;t>8<<24>>24)}if(t>1){s+=44,n+=44,e+=44,r+=44;const i=r-e;for(let t=e-1;t>=n;t--)o.CO&&(o.CO[t+i]=o.CO[t]);for(let i=1;i{e.d(i,{hm:()=>a,rm:()=>o,fe:()=>s,Sm:()=>n,Eh:()=>r,Tm:()=>h,Xr:()=>l});class s extends Array{constructor(t,i){super(t);for(let e=0;e{e.d(i,{$T:()=>o,Jo:()=>n,qT:()=>h,$o:()=>s,ec:()=>r,JT:()=>l});const s=async t=>new Promise((i=>setTimeout(i,t))),n=async t=>new Int8Array(await(await fetch(t)).arrayBuffer()),r=async t=>(await fetch(t)).text();function h(t){let i=0n;for(let e=0;e0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}function l(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}},7608:(t,i,e)=>{e.a(t,(async(t,i)=>{try{var s=e(9234),n=e(1069),r=e(3937),h=e(4544),o=e(1908),l=e(123),a=(e(9896),e(7604)),c=e(1651);class t extends c.K{RO=[];async LO(t){const i=new Map,e=(await(0,s.ec)(t)).split('\n');for(let t=0;t{if(this.Mt)this.kt=!0;else{this.Mt=!0;try{await this.qo(10,'Connecting to fileserver'),await o.A.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new h.A(await h.A.openDatabase());const t=new n.A(new Uint8Array(await(0,s.Jo)(`${c.K.nt}/crc`)));for(let i=0;i<9;i++)this.Bt[i]=t.il;const i=await this.jo('sounds','sound effects',this.Bt[8],70);await this.qo(50,'Unpacking sounds'),r.A.yu(i),await this.qo(100,'Getting ready to start...'),await this.SO()}catch(t){this.Dt=!0,console.error(t)}}};async SO(){const t=document.getElementById('sounds');if(!t)return;t.innerHTML='',this.RO[1]=await this.LO(`${c.K.lt}/data/src/pack/sound.pack`);const i=document.createElement('input');i.type='search',i.placeholder='Search',i.tabIndex=1,i.oninput=()=>{const t=document.querySelector('#soundList');if(!t)return;const e=i.value.toLowerCase().replaceAll(' ','_');for(let i=0;i-1||n.indexOf(e)>-1||r.indexOf(e)>-1?s.style.display='':s.style.display='none'}},t.appendChild(i);const e=document.createElement('ul');e.id='soundList',e.className='list-group',t.appendChild(e);for(const[t,i]of this.RO[1]){const s=document.createElement('li');s.id=i,s.setAttribute('rs-id',t.toString()),s.setAttribute('rs-debugname',i),s.className='list-group-item list-group-item-center',s.innerText=i+' - '+t,0===t&&(s.className+=' active'),s.onclick=async()=>{const i=e.querySelector('.active');i&&(i.className='list-group-item list-group-item-center'),s.className='list-group-item list-group-item-center active';const n=r.A._O(t,0);n&&await(0,l.xO)(n.data.slice(0,n.pf),128)},e.appendChild(s)}}}await(0,a.w)(),(new t).run().then((()=>{})),window.onkeydown=function(t){return!(' '===t.key&&t.target===document.body)},i()}catch(t){i(t)}}),1)},1908:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(9763);class n{static MO=null;static load=async t=>{this.MO=await(0,s.F)(new WebAssembly.Module(t),{env:void 0})};static read=(t,i,e,s)=>{if(!this.MO)throw new Error('bz2 not found!!');return Int8Array.from(this.MO.read(t,i,e,s))}}},123:(t,i,e)=>{let s;async function n(t,i){!function(t){s||(s=window.audioContext.createGain(),s.connect(window.audioContext.destination));s.gain.value=t/256}(i);try{const i=await window.audioContext.decodeAudioData(Uint8Array.from(t).buffer);let e=window.audioContext.createBufferSource();e.buffer=i,e.connect(s),e.start()}catch(t){console.log(t)}}function r(t,i,e){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256,e)}function h(t){window._tinyMidiStop&&window._tinyMidiStop(t)}e.d(i,{xO:()=>n,el:()=>r,Mo:()=>h})},2604:(t,i,e)=>{function s(t,i){var e;(e=document.createElement('a')).href=t,e.download=i,document.body.appendChild(e),e.style='display: none',e.click(),e.remove()}e.d(i,{A:()=>s})},9763:(t,i,e)=>{async function s(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,l=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,l,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(a,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}e.d(i,{F:()=>s})},9896:(t,i,e)=>{var s=e(8151);!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{const t=2,i=44100;let e=new Float32Array,n=window.audioContext.createGain();n.gain.setValueAtTime(.1,window.audioContext.currentTime),n.connect(window.audioContext.destination);let r=window.audioContext.currentTime,h=[];const o=new s.A({kO:30,DO:t=>{let i=new Float32Array(t.buffer),s=new Float32Array(e.length+i.length);s.set(e,0),s.set(i,e.length),e=s},NO:t=>{},bufferSize:102400});await o.init();const l=await fetch('./SCC1_Florestan.sf2'),a=new Uint8Array(await l.arrayBuffer());function c(){if(!window.audioContext||!e.length)return;let s=window.audioContext.createBufferSource();const o=e.length/t,l=window.audioContext.createBuffer(t,o,i);for(let i=0;i{t.stop(window.audioContext.currentTime)})),h=[],n.gain.setValueAtTime(t,window.audioContext.currentTime)}}function d(t,i){-1!==t&&window._tinyMidiVolume(t),r=window.audioContext.currentTime,f=setInterval(c,250),o.FO(i)}o.BO(a),window._tinyMidiStop=async t=>{t?function(t){const i=window.audioContext.currentTime;n.gain.cancelScheduledValues(i),n.gain.setTargetAtTime(0,i,.5),setTimeout(t,2e3)}((()=>{u()})):u()},window._tinyMidiVolume=(t=1)=>{n.gain.setValueAtTime(t,window.audioContext.currentTime)},window._tinyMidiPlay=async(t,i,e)=>{t&&(await window._tinyMidiStop(e),e?setTimeout((()=>{d(i,t)}),2e3):d(i,t))}})()},8151:(t,i,e)=>{e.d(i,{A:()=>n});var s=e(5473);const n=class{constructor(t={}){this.PO=void 0,this.UO=0,this.GO=0,this.WO=0,this.kO=t.kO||100,this.sampleRate=t.sampleRate||44100,this.YO=t.YO||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.HO(1),this.DO=t.DO||(()=>{}),this.NO=t.NO||(()=>{}),this.VO=void 0,this.test=0}async init(){if(!this.PO){if('undefined'!=typeof process){const{KO:t}=await import('path'),{XO:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.PO=await(0,s.A)(),this.jO=this.PO._malloc(this.bufferSize),this.zO=this.PO._malloc(8)}}HO(t){this.bufferSize=4*this.sampleRate*this.YO*t}ZO(){if(!this.PO)throw new Error(`${this.constructor.name} not initalized. call .init()`)}BO(t){this.ZO();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.PO;e(this.UO),this.UO=i(t.length),this.PO.HEAPU8.set(t,this.UO),this.GO=s(this.UO,t.length),n(this.GO,2===this.YO?0:2,this.sampleRate,this.gain)}qO(){this.ZO();const t=new Uint8Array(this.bufferSize);return t.set(this.PO.HEAPU8.subarray(this.jO,this.jO+this.bufferSize)),t}JO(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.PO;return e(this.WO),this.WO=i(t.length),this.PO.HEAPU8.set(t,this.WO),s(this.WO,t.length)}$O(t){const{_midi_render:i}=this.PO;return i(this.GO,t,this.YO,this.sampleRate,this.jO,this.bufferSize,this.zO)}FO(t){if(this.ZO(),!this.GO)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.VO);const{setValue:i,getValue:e}=this.PO;i(this.zO,0,'double'),this.PO._tsf_reset(this.GO),this.PO._tsf_channel_set_bank_preset(this.GO,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.JO(t);const n=()=>{s=this.$O(s);const t=this.qO();this.DO(t),s?this.VO=setTimeout(n,this.kO):this.NO(e(this.zO,'double'))};this.VO=setTimeout(n,16)}}},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"},5473:(t,i,e)=>{var s;e.d(i,{A:()=>n});const n=(s="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,n,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,e){i=t,n=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(r.ready,t)||Object.defineProperty(r.ready,t,{get:()=>j('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>j('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var h=Object.assign({},r),o=[],l='object'==typeof window,a='function'==typeof importScripts,c='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,f=!l&&!c&&!a;if(r.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var u,d,w,y='';if(c){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var A,m;y=a?require('path').KO(y)+'/':__dirname+'/';var p=()=>{m||(A=require('fs'),m=require('path'))};u=(t,i)=>(p(),t=m.normalize(t),A.QO(t,i?void 0:'utf8')),w=t=>{var i=u(t,!0);return i.buffer||(i=new Uint8Array(i)),D(i.buffer),i},d=(t,i,e)=>{p(),t=m.normalize(t),A.tR(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),o=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),r.inspect=function(){return'[Emscripten Module object]'}}else if(f){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(u=function(t){return read(t)}),w=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),D('object'==typeof i),i)},d=function(t,i,e){setTimeout((()=>i(w(t))),0)},'undefined'!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!l&&!a)throw new Error('environment detection error');if(a?y=self.location.href:'undefined'!=typeof document&&document.currentScript&&(y=document.currentScript.src),s&&(y=s),y=0!==y.indexOf('blob:')?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');u=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},a&&(w=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),d=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}r.print||console.log.bind(console);var _,I,g=r.printErr||console.warn.bind(console);function C(t,i){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){j('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function E(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(r,h),h=null,_='fetchSettings',Object.getOwnPropertyDescriptor(r,_)&&j('`Module.'+_+'` was supplied but `'+_+'` not included in INCOMING_MODULE_JS_API'),r.arguments&&(o=r.arguments),C('arguments','arguments_'),r.thisProgram&&r.thisProgram,C('thisProgram','thisProgram'),r.quit&&r.quit,C('quit','quit_'),D(void 0===r.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),D(void 0===r.read,'Module.read option was removed (modify read_ in JS)'),D(void 0===r.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),D(void 0===r.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),D(void 0===r.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),D(void 0===r.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),C('read','read_'),C('readAsync','readAsync'),C('readBinary','readBinary'),C('setWindowTitle','setWindowTitle'),D(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),r.wasmBinary&&(I=r.wasmBinary),C('wasmBinary','wasmBinary');var v;r.noExitRuntime;C('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&j('no native wasm support detected');var b,T,O,R,L,S,x,M,k=!1;function D(t,i){t||j('Assertion failed'+(i?': '+i:''))}function N(t){b=t,r.HEAP8=T=new Int8Array(t),r.HEAP16=R=new Int16Array(t),r.HEAP32=L=new Int32Array(t),r.HEAPU8=O=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=S=new Uint32Array(t),r.HEAPF32=x=new Float32Array(t),r.HEAPF64=M=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var F=5242880;r.TOTAL_STACK&&D(F===r.TOTAL_STACK,'the stack size can no longer be determined at runtime');var B=r.INITIAL_MEMORY||16777216;function P(){if(!k){var t=ft(),i=S[t>>2],e=S[t+4>>2];34821223==i&&2310721022==e||j('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==S[0]&&j('Runtime error: The application has corrupted its heap memory area (address zero)!')}}C('INITIAL_MEMORY','INITIAL_MEMORY'),D(B>=F,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+B+'! (TOTAL_STACK='+F+')'),D('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),D(!r.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),D(16777216==B,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var U=[],G=[],W=[],Y=!1;D(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),D(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var H=0,V=null,K=null,X={};function j(t){r.onAbort&&r.onAbort(t),g(t='Aborted('+t+')'),k=!0;var i=new WebAssembly.RuntimeError(t);throw n(i),i}var z={error:function(){j('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){z.error()},iR:function(){z.error()},eR:function(){z.error()},sR:function(){z.error()},open:function(){z.error()},nR:function(){z.error()},rR:function(){z.error()},hR:function(){z.error()},oR:function(){z.error()},lR:function(){z.error()}};r.FS_createDataFile=z.iR,r.FS_createPreloadedFile=z.eR;var Z,q,J,$,Q='data:application/octet-stream;base64,';function tt(t){return t.startsWith(Q)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=r.asm),D(Y,'native function `'+e+'` called before runtime initialization'),s[t]||D(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==Z&&I)return new Uint8Array(I);if(w)return w(t);throw"both async and sync fetching of the wasm failed"}catch(t){j(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(r)}function ht(t){ht.aR||(ht.aR={}),ht.aR[t]||(ht.aR[t]=1,c&&(t='warning: '+t),g(t))}function ot(t){try{return v.grow(t-b.byteLength+65535>>>16),N(v.buffer),1}catch(i){g('emscripten_realloc_buffer: Attempted to grow heap from '+b.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}r.locateFile?tt(Z='tinymidipcm.wasm')||(q=Z,Z=r.locateFile?r.locateFile(q,y):y+q):Z=new URL(e(8227),e.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,e){O.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=O.length;D((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return g('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return g('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function e(t,i){var e,s=t.exports;r.asm=s,D(v=r.asm.memory,"memory not found in wasm exports"),N(v.buffer),D(r.asm.__indirect_function_table,"table not found in wasm exports"),e=r.asm.__wasm_call_ctors,G.unshift(e),function(t){if(H--,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(X[t]),delete X[t]):g('warning: run dependency removed without ID'),0==H&&(null!==V&&(clearInterval(V),V=null),K)){var i=K;K=null,i()}}('wasm-instantiate')}t='wasm-instantiate',H++,r.monitorRunDependencies&&r.monitorRunDependencies(H),t?(D(!X[t]),X[t]=1,null===V&&'undefined'!=typeof setInterval&&(V=setInterval((function(){if(k)return clearInterval(V),void(V=null);var t=!1;for(var i in X)t||(t=!0,g('still waiting on run dependencies:')),g('dependency: '+i);t&&g('(end of list)')}),1e4))):g('warning: run dependency added without ID');var s=r;function h(t){D(r===s,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),s=null,e(t.instance)}function o(t){return function(){if(!I&&(l||a)){if('function'==typeof fetch&&!it(Z))return fetch(Z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return st(Z)}));if(d)return new Promise((function(t,i){d(Z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(Z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){g('failed to asynchronously prepare wasm: '+t),it(Z)&&g('warning: Loading from a file URI ('+Z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),j(t)}))}if(r.instantiateWasm)try{return r.instantiateWasm(i,e)}catch(t){g('Module.instantiateWasm callback failed with error: '+t),n(t)}(I||'function'!=typeof WebAssembly.instantiateStreaming||tt(Z)||it(Z)||c||'function'!=typeof fetch?o(h):fetch(Z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return g('wasm streaming compile failed: '+t),g('falling back to ArrayBuffer instantiation'),o(h)}))}))).catch(n)}(),r.___wasm_call_ctors=et("__wasm_call_ctors"),r._malloc=et("malloc"),r._free=et("free"),r._tsf_load_memory=et("tsf_load_memory"),r._tsf_close=et("tsf_close"),r._tsf_reset=et("tsf_reset"),r._tsf_set_output=et("tsf_set_output"),r._tsf_set_max_voices=et("tsf_set_max_voices"),r._realloc=et("realloc"),r._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),r._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),r._tml_load_memory=et("tml_load_memory"),r._midi_render=et("midi_render"),r.___errno_location=et("__errno_location"),r._fflush=et("fflush"),r._emscripten_stack_init=function(){return(ct=r._emscripten_stack_init=r.asm.emscripten_stack_init).apply(null,arguments)}),ft=(r._emscripten_stack_get_free=function(){return(r._emscripten_stack_get_free=r.asm.emscripten_stack_get_free).apply(null,arguments)},r._emscripten_stack_get_base=function(){return(r._emscripten_stack_get_base=r.asm.emscripten_stack_get_base).apply(null,arguments)},r._emscripten_stack_get_end=function(){return(ft=r._emscripten_stack_get_end=r.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),D(!(3&(t=ft()))),S[t>>2]=34821223,S[t+4>>2]=2310721022,S[0]=1668509029}function dt(t){function e(){lt||(lt=!0,r.calledRun=!0,k||(D(!Y),Y=!0,P(),rt(G),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),D(!r._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(P(),r.postRun)for('function'==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),W.unshift(t);var t;rt(W)}()))}t=t||o,H>0||(ut(),function(){if(r.preRun)for('function'==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),U.unshift(t);var t;rt(U)}(),H>0||(r.setStatus?(r.setStatus('Running...'),setTimeout((function(){setTimeout((function(){r.setStatus('')}),1),e()}),1)):e(),P()))}if(r.stackSave=et("stackSave"),r.stackRestore=et("stackRestore"),r.stackAlloc=et("stackAlloc"),r.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':T[0|t]=i;break;case'i16':R[t>>1]=i;break;case'i32':L[t>>2]=i;break;case'i64':$=[i>>>0,(J=i,+Math.abs(J)>=1?J>0?(0|Math.min(+Math.floor(J/4294967296),4294967295))>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],L[t>>2]=$[0],L[t+4>>2]=$[1];break;case'float':x[t>>2]=i;break;case'double':M[t>>3]=i;break;case'*':S[t>>2]=i;break;default:j('invalid type for setValue: '+e)}},r.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return T[0|t];case'i16':return R[t>>1];case'i32':case'i64':return L[t>>2];case'float':return x[t>>2];case'double':return M[t>>3];case'*':return S[t>>2];default:j('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)||Object.defineProperty(r,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),j(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';E(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),K=function t(){lt||dt(),lt||(K=t)},r.preInit)for('function'==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return dt(),t.ready})}},r={};function h(t){var i=r[t];if(void 0!==i)return i.exports;var e=r[t]={exports:{}};return n[t](e,e.exports,h),e.exports}h.m=n,t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",i="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",e="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",s=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},h.a=(n,r,h)=>{var o;h&&((o=[]).d=-1);var l,a,c,f=new Set,u=n.exports,d=new Promise(((t,i)=>{c=i,a=t}));d[i]=u,d[t]=t=>(o&&t(o),f.forEach(t),d.catch((t=>{}))),n.exports=d,r((n=>{var r;l=(n=>n.map((n=>{if(null!==n&&"object"==typeof n){if(n[t])return n;if(n.then){var r=[];r.d=0,n.then((t=>{h[i]=t,s(r)}),(t=>{h[e]=t,s(r)}));var h={};return h[t]=t=>t(r),h}}var o={};return o[t]=t=>{},o[i]=n,o})))(n);var h=()=>l.map((t=>{if(t[e])throw t[e];return t[i]})),a=new Promise((i=>{(r=()=>i(h)).r=0;var e=t=>t!==o&&!f.has(t)&&(f.add(t),t&&!t.d&&(r.r++,t.push(r)));l.map((i=>i[t](e)))}));return r.r?a:h()}),(t=>(t?c(d[e]=t):a(u),s(o)))),o&&o.d<0&&(o.d=0)},h.d=(t,i)=>{for(var e in i)h.o(i,e)&&!h.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},h.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),h.p="/Client2/",h.b=document.baseURI||self.location.href;h(7608)})(); \ No newline at end of file diff --git a/viewer.js b/viewer.js index a4b33f4b..9b24640f 100644 --- a/viewer.js +++ b/viewer.js @@ -1 +1 @@ -(()=>{"use strict";var t={7444:(t,i,e)=>{t.exports=e.p+"0c791968973e1f25c170.wasm"},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"}},i={};function e(s){var n=i[s];if(void 0!==n)return n.exports;var r=i[s]={exports:{}};return t[s](r,r.exports,e),r.exports}e.m=t,e.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),e.p="/Client2/",e.b=document.baseURI||self.location.href,(()=>{async function t(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,l=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,l,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(a,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}class i{static tt=null;static load=async i=>{this.tt=await t(new WebAssembly.Module(i),{env:void 0})};static read=(t,i,e,s)=>{if(!this.tt)throw new Error('bz2 not found!!');return Int8Array.from(this.tt.read(t,i,e,s))}}let s;function n(t,i){return s=t.exports,r.it=i,s}async function r(t){void 0===t&&(t=new URL(e(7444),e.b));const i={et:{}};('string'==typeof t||'function'==typeof Request&&t instanceof Request||'function'==typeof URL&&t instanceof URL)&&(t=fetch(t));const{instance:s,module:r}=await async function(t,i){if('function'==typeof Response&&t instanceof Response){if('function'==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,i)}catch(i){if('application/wasm'==t.headers.get('Content-Type'))throw i;console.warn('`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n',i)}const e=await t.arrayBuffer();return await WebAssembly.instantiate(e,i)}{const e=await WebAssembly.instantiate(t,i);return e instanceof WebAssembly.Instance?{instance:e,module:t}:e}}(await t,i);return n(s,r)}let h=null,o=!1;class l extends Error{constructor(t){super(t),this.name='DecompressionError'}}let a=0,c=null,f=null;function u(t,i,e){let s;if(e){const n=i;s=t.malloc_u8(n);const r=new Uint8Array(t.memory.buffer,s,n);try{e(r)}catch(i){throw t.free_u8(s,n),i}return a=n,s}if('string'==typeof i){const e=a=function(t){let i=0,e=0,s=0;const n=t.length;for(;i{this.lt=t,this.ct=i,this.ft=e,this.yt(0,0,i,e)};static At=()=>{this.left=0,this.top=0,this.right=this.ct,this.bottom=this.ft,this.ut=this.right-1,this.dt=this.right/2|0};static yt=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.ct&&(e=this.ct),s>this.ft&&(s=this.ft),this.top=i,this.bottom=s,this.left=t,this.right=e,this.ut=this.right-1,this.dt=this.right/2|0,this.wt=this.bottom/2|0};static clear=()=>{const t=this.ct*this.ft;for(let i=0;i{this.gt(t,i,n,e),this.gt(t,i+s-1,n,e),this.It(t,i,n,s),this.It(t+e-1,i,n,s)};static gt=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.ct;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.ct;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(a-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.ct-e;let h=t+i*this.ct;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.lt[h++]=n;h+=r}};static Et(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,l=(n>>8&255)*r,a=(255&n)*r,c=this.ct-e;let f=t+i*this.ct;for(let t=0;t>16&255)*h>>8<<16)+(l+(this.lt[f]>>8&255)*h>>8<<8)+(a+(255&this.lt[f])*h>>8);this.lt[f++]=t}f+=c}}static Tt(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,l=(255&s)*n;let a=i-e;a<0&&(a=0);let c=i+e;c>=this.ft&&(c=this.ft-1);for(let s=a;s<=c;s++){const n=s-i,a=0|Math.sqrt(e*e-n*n);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.ct&&(f=this.ct-1);let u=c+s*this.ct;for(let t=c;t<=f;t++){const t=(h+(this.lt[u]>>16&255)*r>>8<<16)+(o+(this.lt[u]>>8&255)*r>>8<<8)+(l+(255&this.lt[u])*r>>8);this.lt[u++]=t}}}static bt=(t,i,e)=>{t=this.right||i=this.bottom||(this.lt[t+i*this.ct]=e)}}const p=document.getElementById('canvas'),A=p.getContext('2d',{willReadFrequently:!0}),_=document.createElement('canvas'),g=document.createElement('img'),I=_.getContext('2d',{willReadFrequently:!0});class C{Ot;width;height;Rt;vt;lt;constructor(t,i,e=A){this.Rt=e,this.Ot=this.Rt.getImageData(0,0,t,i),this.vt=new Uint32Array(this.Ot.data.buffer),this.lt=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.lt.fill(0)}bind(){m.bind(this.lt,this.width,this.height)}draw(t,i){this.#t(),this.Rt.putImageData(this.Ot,t,i)}#t(){const t=this.lt.length,i=this.lt,e=this.vt;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}const E=async t=>new Promise((i=>setTimeout(i,t))),T=async t=>new Int8Array(await(await fetch(t)).arrayBuffer());class b{Lt;cursor=null;constructor(){const t=new w;t.next=t,t.st=t,this.Lt=t}St(t){t.st&&t.nt(),t.st=this.Lt.st,t.next=this.Lt,t.st&&(t.st.next=t),t.next.st=t}xt(t){t.st&&t.nt(),t.st=this.Lt,t.next=this.Lt.next,t.st.next=t,t.next&&(t.next.st=t)}Mt(){const t=this.Lt.next;return t===this.Lt?null:(t?.nt(),t)}head(){const t=this.Lt.next;return t===this.Lt?(this.cursor=null,null):(this.cursor=t?.next||null,t)}kt(){const t=this.Lt.st;return t===this.Lt?(this.cursor=null,null):(this.cursor=t?.st||null,t)}next(){const t=this.cursor;return t===this.Lt?(this.cursor=null,null):(this.cursor=t?.next||null,t)}st(){const t=this.cursor;return t===this.Lt?(this.cursor=null,null):(this.cursor=t?.st||null,t)}clear(){for(;;){const t=this.Lt.next;if(t===this.Lt)return;t?.nt()}}}class O extends y{static Dt=3988292384;static Nt=new Int32Array(256);static Ft=new Uint32Array(33);static Bt=new b;static Pt=new b;static Ut=new b;static Wt=0;static Gt=0;static Yt=0;static{for(let t=0;t<32;t++)O.Ft[t]=(1<>>=1:i=i>>>1^O.Dt;O.Nt[t]=i}}static Ht=t=>{let i=4294967295;for(let e=0;e>>8^O.Nt[255&(i^t[e])];return~i};view;data;Vt=0;Kt=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.Vt}static Xt=t=>{let i=null;return 0===t&&O.Wt>0?(O.Wt--,i=O.Bt.Mt()):1===t&&O.Gt>0?(O.Gt--,i=O.Pt.Mt()):2===t&&O.Yt>0&&(O.Yt--,i=O.Ut.Mt()),i?(i.Vt=0,i):new O(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.Vt=0,100===this.view.byteLength&&O.Wt<1e3?(O.Bt.St(this),O.Wt++):5e3===this.view.byteLength&&O.Gt<250?(O.Pt.St(this),O.Gt++):3e4===this.view.byteLength&&O.Yt<50&&(O.Ut.St(this),O.Yt++)}get jt(){return this.view.getUint8(this.Vt++)}get zt(){return this.view.getInt8(this.Vt++)}get Zt(){const t=this.view.getUint16(this.Vt);return this.Vt+=2,t}get qt(){const t=this.view.getInt16(this.Vt);return this.Vt+=2,t}get Jt(){const t=this.view.getUint8(this.Vt++)<<16|this.view.getUint16(this.Vt);return this.Vt+=2,t}get $t(){const t=this.view.getInt32(this.Vt);return this.Vt+=4,t}get Qt(){const t=this.view.getBigInt64(this.Vt);return this.Vt+=8,t}get ti(){return this.view.getUint8(this.Vt)<128?this.jt-64:this.Zt-49152}get ii(){return this.view.getUint8(this.Vt)<128?this.jt:this.Zt-32768}get ei(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.Vt++))&&this.Vt>16),this.view.setUint16(this.Vt,t),this.Vt+=2}p4(t){this.view.setInt32(this.Vt,t),this.Vt+=4}oi(t){this.view.setInt32(this.Vt,t,!0),this.Vt+=4}li(t){this.view.setBigInt64(this.Vt,t),this.Vt+=8}ai(t){const i=this.view,e=t.length;for(let s=0;s>>3}wi(t){let i=this.Kt>>>3,e=8-(7&this.Kt),s=0;for(this.Kt+=t;t>e;e=8)s+=(this.view.getUint8(i++)&O.Ft[e])<>>e-t&O.Ft[t],s}yi(t,i){const e=this.Vt;this.Vt=0;const s=new Uint8Array(e);this.si(e,0,s);const n=function(t){const i=[];for(;t>0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}(function(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}(function(t){let i=0n;for(let e=0;e{const s=new O(t.read(i+'.dat')),n=new O(t.read('index.dat'));n.Vt=s.Zt;const r=n.Zt,h=n.Zt,o=n.jt,l=new Int32Array(o);for(let t=1;ts.length||n.Vt>n.length)throw new Error;const a=n.jt,c=n.jt,f=n.Zt,u=n.Zt,d=new R(f,u,l);d.mi=a,d.pi=c,d.Ai=r,d._i=h;const w=d.lt,y=n.jt;if(0===y){const t=d.width*d.height;for(let i=0;im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.Ii(r,n,this.lt,s,o,m.lt,e,h)}Ci(){const t=this.lt,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}Ti(){this.Ai|=0,this._i|=0,this.Ai/=2,this._i/=2,this.Ai|=0,this._i|=0;const t=new Int8Array(this.Ai*this._i);let i=0;for(let e=0;e>1)+(e+this.pi>>1)*this.Ai]=this.lt[i++];this.lt=t,this.width=this.Ai,this.height=this._i,this.mi=0,this.pi=0}bi(){if(this.width===this.Ai&&this.height===this._i)return;const t=new Int8Array(this.Ai*this._i);let i=0;for(let e=0;e>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,s){try{const n=this.width;this.height;let r=0,h=0;const o=this.Ai,l=this._i,a=(o<<16)/e|0,c=(l<<16)/s|0;t=t+(this.mi*e+o-1)/o|0,i=i+(this.pi*s+l-1)/l|0,this.mi*e%o!=0&&(r=(o-this.mi*e%o<<16)/e|0),this.pi*s%l!=0&&(h=(l-this.pi*s%l<<16)/s|0),e=e*(this.width-(r>>16))/o|0,s=s*(this.height-(h>>16))/l|0;let f,u=t+i*m.ct,d=m.ct-e;im.bottom&&(s-=i+s-m.bottom),tm.right&&(f=t+e-m.right,e-=f,d+=f),this.Oi(m.lt,this.lt,this.palette,r,h,u,d,e,s,a,c,n)}catch(t){console.log('error in sprite clipping routine')}}Oi(t,i,e,s,n,r,h,o,l,a,c,f){try{const u=s;for(let d=-l;d<0;d++){const l=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+l];0==n?r++:t[r++]=e[255&n],s+=a}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}class v extends Array{constructor(t,i){super(t);for(let e=0;e{this.vi=null,this.vi=null,this.sin=null,this.cos=null,this.Mi=null,this.Si=null,this.Vi=null,this.Ki=null,this.Bi=null,this.Pi=null,this.Gi=null,this.palette=null,this.Yi=null,console.log('Draw3D unloaded!')};static ji=()=>{this.Mi=new Int32Array(m.ft);for(let t=0;t{this.Mi=new Int32Array(i);for(let e=0;e{this.Bi=null,this.Pi.fill(null)};static qi=t=>{this.xi=0;for(let i=0;i<50;i++)try{this.Si[i]=R.gi(t,i.toString()),this.Ri&&128===this.Si[i]?.Ai?this.Si[i]?.Ti():this.Si[i]?.bi(),this.xi++}catch(t){}};static Ji=t=>{if(0!==this.Ki[t])return this.Ki[t];const i=this.Yi[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.$i(h,1.4),0===h&&(h=1),this.Ki[t]=h,h};static Qi=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,l=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let a=s-.3333333333333333;a<0&&a++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*h|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[e++]=this.$i(a,i)}}for(let t=0;t<50;t++){const e=this.Si[t];if(!e)continue;const s=e.palette;this.Yi[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static ie=t=>{this.Bi||(this.Ui=t,this.Ri?this.Bi=new k(t,16384):this.Bi=new k(t,65536),this.Pi.fill(null))};static ee=(t,i,e,s,n,r,h,o,l)=>{let a=0,c=0;n!==s&&(a=(i-t<<16)/(n-s)|0,c=(o-h<<15)/(n-s)|0);let f=0,u=0;r!==n&&(f=(e-i<<16)/(r-n)|0,u=(l-o<<15)/(r-n)|0);let d=0,w=0;if(r!==s&&(d=(t-e<<16)/(s-r)|0,w=(h-l<<15)/(s-r)|0),s<=n&&s<=r){if(sm.bottom&&(n=m.bottom),r>m.bottom&&(r=m.bottom),nf)for(r-=n,n-=s,s=N.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.se(e>>16,i>>16,l>>7,o>>7,m.lt,s,0),e+=d,i+=f,l+=w,o+=u,s+=m.ct}this.se(e>>16,t>>16,l>>7,h>>7,m.lt,s,0),e+=d,t+=a,l+=w,h+=c,s+=m.ct}else for(r-=n,n-=s,s=N.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.se(i>>16,e>>16,o>>7,l>>7,m.lt,s,0),e+=d,i+=f,l+=w,o+=u,s+=m.ct}this.se(t>>16,e>>16,h>>7,l>>7,m.lt,s,0),e+=d,t+=a,l+=w,h+=c,s+=m.ct}else if(i=t<<=16,o=h<<=15,s<0&&(i-=d*s,t-=a*s,o-=w*s,h-=c*s,s=0),e<<=16,l<<=15,r<0&&(e-=f*r,l-=u*r,r=0),s!==r&&da)for(n-=r,r-=s,s=N.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.se(e>>16,t>>16,l>>7,h>>7,m.lt,s,0),e+=f,t+=a,l+=u,h+=c,s+=m.ct}this.se(i>>16,t>>16,o>>7,h>>7,m.lt,s,0),i+=d,t+=a,o+=w,h+=c,s+=m.ct}else for(n-=r,r-=s,s=N.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.se(t>>16,e>>16,h>>7,l>>7,m.lt,s,0),e+=f,t+=a,l+=u,h+=c,s+=m.ct}this.se(t>>16,i>>16,h>>7,o>>7,m.lt,s,0),i+=d,t+=a,o+=w,h+=c,s+=m.ct}}else if(n<=r){if(nm.bottom&&(r=m.bottom),s>m.bottom&&(s=m.bottom),rd)for(s-=r,r-=n,n=N.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.se(t>>16,e>>16,h>>7,l>>7,m.lt,n,0),t+=a,e+=d,h+=c,l+=w,n+=m.ct}this.se(t>>16,i>>16,h>>7,o>>7,m.lt,n,0),t+=a,i+=f,h+=c,o+=u,n+=m.ct}else for(s-=r,r-=n,n=N.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.se(e>>16,t>>16,l>>7,h>>7,m.lt,n,0),t+=a,e+=d,h+=c,l+=w,n+=m.ct}this.se(i>>16,t>>16,o>>7,h>>7,m.lt,n,0),t+=a,i+=f,h+=c,o+=u,n+=m.ct}else if(e=i<<=16,l=o<<=15,n<0&&(e-=a*n,i-=f*n,l-=c*n,o-=u*n,n=0),t<<=16,h<<=15,s<0&&(t-=d*s,h-=w*s,s=0),r-=s,s-=n,n=N.Mi[n],a>16,i>>16,h>>7,o>>7,m.lt,n,0),t+=d,i+=f,h+=w,o+=u,n+=m.ct}this.se(e>>16,i>>16,l>>7,o>>7,m.lt,n,0),e+=a,i+=f,l+=c,o+=u,n+=m.ct}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.se(i>>16,t>>16,o>>7,h>>7,m.lt,n,0),t+=d,i+=f,h+=w,o+=u,n+=m.ct}this.se(i>>16,e>>16,o>>7,l>>7,m.lt,n,0),e+=a,i+=f,l+=c,o+=u,n+=m.ct}}else if(rm.bottom&&(s=m.bottom),n>m.bottom&&(n=m.bottom),s>16,t>>16,o>>7,h>>7,m.lt,r,0),i+=f,t+=a,o+=u,h+=c,r+=m.ct}this.se(i>>16,e>>16,o>>7,l>>7,m.lt,r,0),i+=f,e+=d,o+=u,l+=w,r+=m.ct}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.se(t>>16,i>>16,h>>7,o>>7,m.lt,r,0),i+=f,t+=a,o+=u,h+=c,r+=m.ct}this.se(e>>16,i>>16,l>>7,o>>7,m.lt,r,0),i+=f,e+=d,o+=u,l+=w,r+=m.ct}else if(t=e<<=16,h=l<<=15,r<0&&(t-=f*r,e-=d*r,h-=u*r,l-=w*r,r=0),i<<=16,o<<=15,n<0&&(i-=a*n,o-=c*n,n=0),s-=n,n-=r,r=N.Mi[r],f>16,e>>16,o>>7,l>>7,m.lt,r,0),i+=a,e+=d,o+=c,l+=w,r+=m.ct}this.se(t>>16,e>>16,h>>7,l>>7,m.lt,r,0),t+=f,e+=d,h+=u,l+=w,r+=m.ct}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.se(e>>16,i>>16,l>>7,o>>7,m.lt,r,0),i+=a,e+=d,o+=c,l+=w,r+=m.ct}this.se(e>>16,t>>16,l>>7,h>>7,m.lt,r,0),t+=f,e+=d,h+=u,l+=w,r+=m.ct}};static se=(t,i,e,s,n,r,h)=>{let o;if(N.Ni){let l;if(N.Fi){if(l=i-t>3?(s-e)/(i-t)|0:0,i>m.ut&&(i=m.ut),t<0&&(e-=t*l,t=0),t>=i)return;r+=t,h=i-t>>2,l<<=2}else{if(!(t>2)>0?(s-e)*N.vi[h]>>15:0}if(0===N.alpha)for(;;){if(--h<0){if((h=i-t&3)>0){o=N.palette[e>>8];do{n[r++]=o,h--}while(h>0);return}break}o=N.palette[e>>8],e+=l,n[r++]=o,n[r++]=o,n[r++]=o,n[r++]=o}else{const s=N.alpha,a=256-N.alpha;for(;;){if(--h<0){if((h=i-t&3)>0){o=N.palette[e>>8],o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280);do{n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),h--}while(h>0)}break}o=N.palette[e>>8],e+=l,o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280)}}}else if(tm.ut&&(i=m.ut),t<0&&(e-=t*l,t=0),t>=i))return;if(r+=t,h=i-t,0===N.alpha)do{n[r++]=N.palette[e>>8],e+=l,h--}while(h>0);else{const t=N.alpha,i=256-N.alpha;do{o=N.palette[e>>8],e+=l,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),n[r++]=o+((16711935&n[r])*t>>8&16711935)+((65280&n[r])*t>>8&65280),h--}while(h>0)}}};static ne=(t,i,e,s,n,r,h)=>{let o=0;n!==s&&(o=(i-t<<16)/(n-s)|0);let l=0;r!==n&&(l=(e-i<<16)/(r-n)|0);let a=0;if(r!==s&&(a=(t-e<<16)/(s-r)|0),s<=n&&s<=r){if(sm.bottom&&(n=m.bottom),r>m.bottom&&(r=m.bottom),nl)for(r-=n,n-=s,s=this.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.re(e>>16,i>>16,m.lt,s,h),e+=a,i+=l,s+=m.ct}this.re(e>>16,t>>16,m.lt,s,h),e+=a,t+=o,s+=m.ct}else for(r-=n,n-=s,s=this.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.re(i>>16,e>>16,m.lt,s,h),e+=a,i+=l,s+=m.ct}this.re(t>>16,e>>16,m.lt,s,h),e+=a,t+=o,s+=m.ct}else if(i=t<<=16,s<0&&(i-=a*s,t-=o*s,s=0),e<<=16,r<0&&(e-=l*r,r=0),s!==r&&ao)for(n-=r,r-=s,s=this.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.re(e>>16,t>>16,m.lt,s,h),e+=l,t+=o,s+=m.ct}this.re(i>>16,t>>16,m.lt,s,h),i+=a,t+=o,s+=m.ct}else for(n-=r,r-=s,s=this.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.re(t>>16,e>>16,m.lt,s,h),e+=l,t+=o,s+=m.ct}this.re(t>>16,i>>16,m.lt,s,h),i+=a,t+=o,s+=m.ct}}else if(n<=r){if(nm.bottom&&(r=m.bottom),s>m.bottom&&(s=m.bottom),ra)for(s-=r,r-=n,n=this.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.re(t>>16,e>>16,m.lt,n,h),t+=o,e+=a,n+=m.ct}this.re(t>>16,i>>16,m.lt,n,h),t+=o,i+=l,n+=m.ct}else for(s-=r,r-=n,n=this.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.re(e>>16,t>>16,m.lt,n,h),t+=o,e+=a,n+=m.ct}this.re(i>>16,t>>16,m.lt,n,h),t+=o,i+=l,n+=m.ct}else if(e=i<<=16,n<0&&(e-=o*n,i-=l*n,n=0),t<<=16,s<0&&(t-=a*s,s=0),o>16,i>>16,m.lt,n,h),t+=a,i+=l,n+=m.ct}this.re(e>>16,i>>16,m.lt,n,h),e+=o,i+=l,n+=m.ct}else for(r-=s,s-=n,n=this.Mi[n];;){if(--s<0)for(;;){if(--r<0)return;this.re(i>>16,t>>16,m.lt,n,h),t+=a,i+=l,n+=m.ct}this.re(i>>16,e>>16,m.lt,n,h),e+=o,i+=l,n+=m.ct}}else if(rm.bottom&&(s=m.bottom),n>m.bottom&&(n=m.bottom),s>16,t>>16,m.lt,r,h),i+=l,t+=o,r+=m.ct}this.re(i>>16,e>>16,m.lt,r,h),i+=l,e+=a,r+=m.ct}else for(n-=s,s-=r,r=this.Mi[r];;){if(--s<0)for(;;){if(--n<0)return;this.re(t>>16,i>>16,m.lt,r,h),i+=l,t+=o,r+=m.ct}this.re(e>>16,i>>16,m.lt,r,h),i+=l,e+=a,r+=m.ct}else if(t=e<<=16,r<0&&(t-=l*r,e-=a*r,r=0),i<<=16,n<0&&(i-=o*n,n=0),l>16,e>>16,m.lt,r,h),i+=o,e+=a,r+=m.ct}this.re(t>>16,e>>16,m.lt,r,h),t+=l,e+=a,r+=m.ct}else for(s-=n,n-=r,r=this.Mi[r];;){if(--n<0)for(;;){if(--s<0)return;this.re(e>>16,i>>16,m.lt,r,h),i+=o,e+=a,r+=m.ct}this.re(e>>16,t>>16,m.lt,r,h),t+=l,e+=a,r+=m.ct}};static he=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,p,A,_)=>{const g=this.oe(_);this.Hi=!this.Vi[_];const I=a-u,C=c-w,E=f-p,T=d-a,b=y-c,O=A-f;let R=T*c-b*a<<14;const v=b*f-O*c<<8,L=O*a-T*f<<5;let S=I*c-C*a<<14;const x=C*f-E*c<<8,M=E*a-I*f<<5;let k=C*T-I*b<<14;const D=E*b-C*O<<8,N=I*O-E*T<<5;let F=0,B=0;n!==s&&(F=(i-t<<16)/(n-s)|0,B=(o-h<<16)/(n-s)|0);let P=0,U=0;r!==n&&(P=(e-i<<16)/(r-n)|0,U=(l-o<<16)/(r-n)|0);let W=0,G=0;if(r!==s&&(W=(t-e<<16)/(s-r)|0,G=(h-l<<16)/(s-r)|0),s<=n&&s<=r){if(sm.bottom&&(n=m.bottom),r>m.bottom&&(r=m.bottom),nP)for(r-=n,n-=s,s=this.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.le(e>>16,i>>16,m.lt,s,g,0,0,R,S,k,v,x,D,l>>8,o>>8),e+=W,i+=P,l+=G,o+=U,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(e>>16,t>>16,m.lt,s,g,0,0,R,S,k,v,x,D,l>>8,h>>8),e+=W,t+=F,l+=G,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(r-=n,n-=s,s=this.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.le(i>>16,e>>16,m.lt,s,g,0,0,R,S,k,v,x,D,o>>8,l>>8),e+=W,i+=P,l+=G,o+=U,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(t>>16,e>>16,m.lt,s,g,0,0,R,S,k,v,x,D,h>>8,l>>8),e+=W,t+=F,l+=G,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}else{i=t<<=16,o=h<<=16,s<0&&(i-=W*s,t-=F*s,o-=G*s,h-=B*s,s=0),e<<=16,l<<=16,r<0&&(e-=P*r,l-=U*r,r=0);const a=s-this.Di;if(R+=L*a,S+=M*a,k+=N*a,R|=0,S|=0,k|=0,(s===r||W>=F)&&(s!==r||P<=F))for(n-=r,r-=s,s=this.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.le(t>>16,e>>16,m.lt,s,g,0,0,R,S,k,v,x,D,h>>8,l>>8),e+=P,t+=F,l+=U,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(t>>16,i>>16,m.lt,s,g,0,0,R,S,k,v,x,D,h>>8,o>>8),i+=W,t+=F,o+=G,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(n-=r,r-=s,s=this.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.le(e>>16,t>>16,m.lt,s,g,0,0,R,S,k,v,x,D,l>>8,h>>8),e+=P,t+=F,l+=U,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(i>>16,t>>16,m.lt,s,g,0,0,R,S,k,v,x,D,o>>8,h>>8),i+=W,t+=F,o+=G,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}}else if(n<=r){if(nm.bottom&&(r=m.bottom),s>m.bottom&&(s=m.bottom),rW)for(s-=r,r-=n,n=this.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.le(t>>16,e>>16,m.lt,n,g,0,0,R,S,k,v,x,D,h>>8,l>>8),t+=F,e+=W,h+=B,l+=G,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(t>>16,i>>16,m.lt,n,g,0,0,R,S,k,v,x,D,h>>8,o>>8),t+=F,i+=P,h+=B,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(s-=r,r-=n,n=this.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.le(e>>16,t>>16,m.lt,n,g,0,0,R,S,k,v,x,D,l>>8,h>>8),t+=F,e+=W,h+=B,l+=G,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(i>>16,t>>16,m.lt,n,g,0,0,R,S,k,v,x,D,o>>8,h>>8),t+=F,i+=P,h+=B,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}else{e=i<<=16,l=o<<=16,n<0&&(e-=F*n,i-=P*n,l-=B*n,o-=U*n,n=0),t<<=16,h<<=16,s<0&&(t-=W*s,h-=G*s,s=0);const a=n-this.Di;if(R+=L*a,S+=M*a,k+=N*a,R|=0,S|=0,k|=0,r-=s,s-=n,n=this.Mi[n],F>16,i>>16,m.lt,n,g,0,0,R,S,k,v,x,D,h>>8,o>>8),t+=W,i+=P,h+=G,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(e>>16,i>>16,m.lt,n,g,0,0,R,S,k,v,x,D,l>>8,o>>8),e+=F,i+=P,l+=B,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.le(i>>16,t>>16,m.lt,n,g,0,0,R,S,k,v,x,D,o>>8,h>>8),t+=W,i+=P,h+=G,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(i>>16,e>>16,m.lt,n,g,0,0,R,S,k,v,x,D,o>>8,l>>8),e+=F,i+=P,l+=B,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}}else if(rm.bottom&&(s=m.bottom),n>m.bottom&&(n=m.bottom),s>16,t>>16,m.lt,r,g,0,0,R,S,k,v,x,D,o>>8,h>>8),i+=P,t+=F,o+=U,h+=B,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(i>>16,e>>16,m.lt,r,g,0,0,R,S,k,v,x,D,o>>8,l>>8),i+=P,e+=W,o+=U,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.le(t>>16,i>>16,m.lt,r,g,0,0,R,S,k,v,x,D,h>>8,o>>8),i+=P,t+=F,o+=U,h+=B,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(e>>16,i>>16,m.lt,r,g,0,0,R,S,k,v,x,D,l>>8,o>>8),i+=P,e+=W,o+=U,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}else{t=e<<=16,h=l<<=16,r<0&&(t-=P*r,e-=W*r,h-=U*r,l-=G*r,r=0),i<<=16,o<<=16,n<0&&(i-=F*n,o-=B*n,n=0);const a=r-this.Di;if(R+=L*a,S+=M*a,k+=N*a,R|=0,S|=0,k|=0,s-=n,n-=r,r=this.Mi[r],P>16,e>>16,m.lt,r,g,0,0,R,S,k,v,x,D,o>>8,l>>8),i+=F,e+=W,o+=B,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(t>>16,e>>16,m.lt,r,g,0,0,R,S,k,v,x,D,h>>8,l>>8),t+=P,e+=W,h+=U,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.le(e>>16,i>>16,m.lt,r,g,0,0,R,S,k,v,x,D,l>>8,o>>8),i+=F,e+=W,o+=B,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(e>>16,t>>16,m.lt,r,g,0,0,R,S,k,v,x,D,l>>8,h>>8),t+=P,e+=W,h+=U,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}};static le=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w)=>{if(t>=i)return;let y,p,A,_,g,I,C,E,T;if(this.Fi){if(y=(w-d)/(i-t)|0,i>m.ut&&(i=m.ut),t<0&&(d-=t*y,t=0),t>=i)return;p=i-t>>3,y<<=12}else i-t>7?(p=i-t>>3,y=(w-d)*this.vi[p]>>6):(p=0,y=0);if(d<<=9,s+=t,this.Ri&&n)if(A=0,_=0,I=t-this.ki,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(h=l/g|0,(r=o/g|0)<0?r=0:r>4032&&(r=4032)),o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>4032&&(A=4032)),C=A-r>>3,E=_-h>>3,r+=d>>3&786432,T=d>>23,this.Hi){for(;p-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r=A,h=_,o+=c,l+=f,g=(a+=u)>>12,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>4032&&(A=4032)),C=A-r>>3,E=_-h>>3,r+=(d+=y)>>3&786432,T=d>>23;for(p=i-t&7;p-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E}else{for(;p-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>T)&&(e[s]=t),s+=1,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s+=1,r=A,h=_,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>4032&&(A=4032)),C=A-r>>3,E=_-h>>3,r+=(d+=y)>>3&786432,T=d>>23}for(p=i-t&7;p-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>T)&&(e[s]=t),s++,r+=C,h+=E}}else if(A=0,_=0,I=t-this.ki,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(h=l/g|0,(r=o/g|0)<0?r=0:r>16256&&(r=16256)),o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>16256&&(A=16256)),C=A-r>>3,E=_-h>>3,r+=6291456&d,T=d>>23,this.Hi&&n){for(;p-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r=A,h=_,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>16256&&(A=16256)),C=A-r>>3,E=_-h>>3,r+=6291456&(d+=y),T=d>>23;for(p=i-t&7;p-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E}else{for(;p-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>T)&&(e[s]=t),s+=1,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,r=A,h=_,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>16256&&(A=16256)),C=A-r>>3,E=_-h>>3,r+=6291456&(d+=y),T=d>>23}for(p=i-t&7;p-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>T)&&(e[s]=t),s++,r+=C,h+=E}}};static re=(t,i,e,s,n)=>{if(this.Fi&&(i>m.ut&&(i=m.ut),t<0&&(t=0)),t>=i)return;s+=t;let r=i-t>>2;if(0===this.alpha)for(;;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n}e[s++]=n,e[s++]=n,e[s++]=n,e[s++]=n}const h=this.alpha,o=256-this.alpha;for(n=((16711935&n)*o>>8&16711935)+((65280&n)*o>>8&65280);;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}};static te=t=>{this.Pi[t]&&this.Bi&&(this.Bi[this.Ui++]=this.Pi[t],this.Pi[t]=null)};static oe=t=>{if(this.Gi[t]=this.Wi++,this.Pi[t])return this.Pi[t];let i;if(this.Ui>0&&this.Bi)i=this.Bi[--this.Ui],this.Bi[this.Ui]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.lt[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.lt[t]];this.Vi[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.Vi[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}const F=['F11','F12'],B={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}};class P{static enabled=!1;static ae=null;static ce=null;static fe=0;static ue=0;static de=0;static we=0;static ye=0;static me=()=>{this.ae=O.Xt(1),this.ce=null,this.fe=performance.now(),this.enabled=!0};static pe=()=>{this.enabled=!1,this.ae=null};static flush=()=>{let t=null;return this.ce&&this.enabled&&(t=this.ce),this.ce=null,t};static stop=()=>{let t=null;return this.ae&&this.ae.Vt>0&&this.enabled&&(t=this.ae),this.pe(),t};static Ae=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.ue++;const s=performance.now();let n=(s-this.fe)/10|0;n>250&&(n=250),this.fe=s,this._e(5),1===e?this.ae?.p1(1):this.ae?.p1(2),this.ae?.p1(n),this.ae?.p3(t+(i<<10))};static ge=t=>{if(!this.enabled)return;this.ue++;const i=performance.now();let e=(i-this.fe)/10|0;e>250&&(e=250),this.fe=i,this._e(2),1===t?this.ae?.p1(3):this.ae?.p1(4),this.ae?.p1(e)};static Ie=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.de>=50){this.de=e,this.ue++;let s=(e-this.fe)/10|0;s>250&&(s=250),this.fe=e,t-this.we<8&&t-this.we>=-8&&i-this.ye<8&&i-this.ye>=-8?(this._e(3),this.ae?.p1(5),this.ae?.p1(s),this.ae?.p1(t+(i-this.ye+8<<4)+8-this.we)):t-this.we<128&&t-this.we>=-128&&i-this.ye<128&&i-this.ye>=-128?(this._e(4),this.ae?.p1(6),this.ae?.p1(s),this.ae?.p1(t+128-this.we),this.ae?.p1(i+128-this.ye)):(this._e(5),this.ae?.p1(7),this.ae?.p1(s),this.ae?.p3(t+(i<<10))),this.we=t,this.ye=i}};static Ce=t=>{if(!this.enabled)return;this.ue++;const i=performance.now();let e=(i-this.fe)/10|0;e>250&&(e=250),this.fe=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this._e(3),this.ae?.p1(8),this.ae?.p1(e),this.ae?.p1(t)};static Ee=t=>{if(!this.enabled)return;this.ue++;const i=performance.now();let e=(i-this.fe)/10|0;e>250&&(e=250),this.fe=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this._e(3),this.ae?.p1(9),this.ae?.p1(e),this.ae?.p1(t)};static Te=()=>{if(!this.enabled)return;this.ue++;const t=performance.now();let i=(t-this.fe)/10|0;i>250&&(i=250),this.fe=t,this._e(2),this.ae?.p1(10),this.ae?.p1(i)};static be=()=>{if(!this.enabled)return;this.ue++;const t=performance.now();let i=(t-this.fe)/10|0;i>250&&(i=250),this.fe=t,this._e(2),this.ae?.p1(11),this.ae?.p1(i)};static Oe=()=>{if(!this.enabled)return;this.ue++;const t=performance.now();let i=(t-this.fe)/10|0;i>250&&(i=250),this.fe=t,this._e(2),this.ae?.p1(12),this.ae?.p1(i)};static Re=()=>{if(!this.enabled)return;this.ue++;const t=performance.now();let i=(t-this.fe)/10|0;i>250&&(i=250),this.fe=t,this._e(2),this.ae?.p1(13),this.ae?.p1(i)};static _e=t=>{if(this.ae&&this.ae.Vt+t>=500){const t=this.ae;this.ae=O.Xt(1),this.ce=t}}}class U{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}ve=0;Le=[];Se=0;xe=null;state=0;Me=20;ke=1;De=[];Ne=0;Fe=0;Be=[];Pe=!0;Ue=!1;We=50;hasFocus=!0;Ge=!1;Ye=0;He=0;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=[];qe=[];Je=0;$e=0;input=null;Qe=!1;ts=!1;es=!1;time=-1;ss=0;ns=0;rs=0;hs=0;os=0;ls=0;constructor(t=!1){p.tabIndex=-1,A.fillStyle='black',A.fillRect(0,0,p.width,p.height),this.Ue=t,this.Ue?this.resize(window.innerWidth,window.innerHeight):this.resize(p.width,p.height)}get width(){return p.width}get height(){return p.height}resize=(t,i)=>{p.width=t,p.height=i,this.xe=new C(t,i),N.ji()};run=async()=>{p.addEventListener('resize',(()=>{this.Ue&&this.resize(window.innerWidth,window.innerHeight)}),!1),p.onmousedown=this.onmousedown,p.onmouseup=this.onmouseup,p.onmouseenter=this.onmouseenter,p.onmouseleave=this.onmouseleave,p.onmousemove=this.onmousemove,window.onbeforeunload=this.Xi,p.onfocus=this.onfocus,p.onblur=this.onblur,this.cs?(p.ontouchstart=this.ontouchstart,p.ontouchend=this.ontouchend,p.ontouchmove=this.ontouchmove):(p.onkeydown=this.onkeydown,p.onkeyup=this.onkeyup),p.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.cs&&'low'===U.getParameter('detail')&&(this.We=30),await this.fs(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.De[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.us();const r=e,h=s;e=300,s=1,t=performance.now();const o=this.De[i];if(0===o?(e=r,s=h):t>o&&(e=2560*this.Me/(t-o)|0),e<25?e=25:e>256&&(e=256,s=this.Me-(t-o)/10|0),this.De[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.De[t]&&(this.De[t]+=s);for(s0&&(this.Ne=1e3*e/(256*this.Me)|0);const l=performance.now();if(this.Pe&&this.refresh(),await this.draw(),this.Be[this.Fe]=(performance.now()-l)/1e3,this.Fe=(this.Fe+1)%this.Be.length,this.We<50){const i=1e3/this.We-(performance.now()-t);i>0&&await E(i)}}-1===this.state&&this.us()};us=()=>{this.state=-2,this.Xi()};ds=t=>{this.Me=1e3/t|0};ws=t=>{this.We=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.Me|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};Xi=()=>{};draw=async()=>{};refresh=()=>{};async fs(t,i){const e=this.width,s=this.height;this.Pe&&(A.fillStyle='black',A.fillRect(0,0,e,s),this.Pe=!1);const n=s/2-18;A.fillStyle='rgb(140, 17, 17)',A.rect((e/2|0)-152,n,304,34),A.fillRect((e/2|0)-150,n+2,3*t,30),A.fillStyle='black',A.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),A.font='bold 13px helvetica, sans-serif',A.textAlign='center',A.fillStyle='white',A.fillText(i,e/2|0,n+22),await E(5)}ys=()=>{let t=-1;return this.$e!==this.Je&&(t=this.qe[this.Je],this.Je=this.Je+1&127),t};get ms(){const t=this.Be.length;let i=0;for(let e=0;ethis.ve&&(this.ve=e),this.Le[this.Se]=e,this.Se=(this.Se+1)%250,e}get ps(){return this.Le.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.Ye=0;const e=B[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===B.ArrowLeft.code?n=1:s===B.ArrowRight.code?n=2:s===B.ArrowUp.code?n=3:s===B.ArrowDown.code?n=4:s===B.Control.code?n=5:s===B.Shift.code?n=6:s===B.Alt.code?n=7:s===B.Backspace.code||s===B.Delete.code?n=8:s===B.Tab.code?n=9:s===B.Enter.code?n=10:s>=B.F1.code&&s<=B.F12.code?n=s+1008-B.F1.code:s===B.Home.code?n=1e3:s===B.End.code?n=1001:s===B.PageUp.code?n=1002:s===B.PageDown.code&&(n=1003),n>0&&n<128&&(this.Ze[n]=1),n>4&&(this.qe[this.$e]=n,this.$e=this.$e+1&127),P.enabled&&P.Ce(n),F.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.Ye=0;const e=B[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===B.ArrowLeft.code?n=1:s===B.ArrowRight.code?n=2:s===B.ArrowUp.code?n=3:s===B.ArrowDown.code?n=4:s===B.Control.code?n=5:s===B.Shift.code?n=6:s===B.Alt.code?n=7:s===B.Backspace.code||s===B.Delete.code?n=8:s===B.Tab.code?n=9:s===B.Enter.code?n=10:s>=B.F1.code&&s<=B.F12.code?n=s+1008-B.F1.code:s===B.Home.code?n=1e3:s===B.End.code?n=1001:s===B.PageUp.code?n=1002:s===B.PageDown.code&&(n=1003),n>0&&n<128&&(this.Ze[n]=0),P.enabled&&P.Ee(n),F.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.Qe=!1,(t.clientX>0||t.clientY>0)&&this.As(t),this.Ye=0,this.je=this.Ve,this.ze=this.Ke,this.cs&&!this._s){if(this.gs()||this.Is()||this.Cs())return this.Xe=1,void(this.He=1);t.timeStamp>=this.time+500?(this.Xe=2,this.He=2):(this.Xe=1,this.He=1)}else 2===t.button?(this.Xe=2,this.He=2):(this.Xe=1,this.He=1);P.enabled&&P.Ae(this.je,this.ze,t.buttons)};onmouseup=t=>{this.As(t),this.Ye=0,this.He=0,P.enabled&&P.ge(t.buttons)};onmouseenter=t=>{this.As(t),P.enabled&&P.Oe()};onmouseleave=t=>{this.As(t),this.Ye=0,this.Ve=-1,this.Ke=-1,this.He=0,this.je=-1,this.ze=-1,P.enabled&&P.Re()};onmousemove=t=>{this.As(t),this.Ye=0,P.enabled&&P.Ie(this.Ve,this.Ke)};onfocus=t=>{this.hasFocus=!0,this.Pe=!0,this.refresh(),P.enabled&&P.Te()};onblur=t=>{this.hasFocus=!1,P.enabled&&P.be()};ontouchstart=t=>{if(!this.cs)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.Qe=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.ss=this.os=this.rs=0|i.screenX,this.ns=this.ls=this.hs=0|i.screenY,this.time=t.timeStamp,this.ts=this.Es(),this.es=this.Ts()};ontouchend=t=>{if(!this.cs||!this.Qe)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.os=0|i.screenX,this.ls=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.ts&&!this.Es())return void(this.Qe=!1);if(this.es&&!this.Ts())return void(this.Qe=!1);if(this.gs()||this.bs()||this.Is()||this.Cs()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.Is()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.Cs()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.gs()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.bs()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.Os?t.setAttribute('type','password'):t.setAttribute('type',this.Cs()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.Os&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.Os&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.Os&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.Qe=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.ss-this.os)>16||Math.abs(this.ns-this.ls)>16;n&&!r?(this.Qe=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.He=0,this.Qe=!1)};ontouchmove=t=>{if(!this.cs||!this.Qe)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.os=0|i.screenX,this.ls=0|i.screenY,this.ts&&-1===this.Rs()?(this.rs-this.os>0?this.rotate(2):this.rs-this.os<0&&this.rotate(0),this.hs-this.ls>0?this.rotate(3):this.hs-this.ls<0&&this.rotate(1)):(this.es||-1!==this.Rs())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.rs=this.os,this.hs=this.ls};get cs(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get Os(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get _s(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}Es=()=>this.Ge&&this.Ve>=8&&this.Ve<=520&&this.Ke>=11&&this.Ke<=345;gs=()=>this.Ge&&-1===this.vs()&&!this.Ls()&&!this.Ss()&&this.Ve>=11&&this.Ve<=506&&this.Ke>=449&&this.Ke<=482;bs=()=>this.Ge&&(this.Ls()||this.Ss())&&this.Ve>=11&&this.Ve<=506&&this.Ke>=383&&this.Ke<=482;Ts=()=>this.Ge&&this.Ve>=562&&this.Ve<=752&&this.Ke>=231&&this.Ke<=492;Is=()=>!this.Ge&&2===this.xs()&&this.Ve>=301&&this.Ve<=562&&this.Ke>=262&&this.Ke<=279;Cs=()=>!this.Ge&&2===this.xs()&&this.Ve>=301&&this.Ve<=562&&this.Ke>=279&&this.Ke<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};Ms=()=>null!==document.fullscreenElement;As=t=>{if(this.Ms()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/p.height,s=(window.innerWidth-p.width*e)/2;this.Ve=0|this.ks(t.clientX-i.left-s,0,p.width*e,0,789),this.Ke=0|this.ks(t.clientY-i.top,0,p.height*e,0,532)}else{const i=p.getBoundingClientRect(),e=p.width/i.width,s=p.height/i.height;this.Ve=(t.clientX-i.left)*e|0,this.Ke=(t.clientY-i.top)*s|0}this.Ve<0&&(this.Ve=0),this.Ke<0&&(this.Ke=0),this.Ve>789&&(this.Ve=789),this.Ke>532&&(this.Ke=532)};ks=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}class W{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));Ds=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Ns=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};Fs=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}class G{static Fs=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.Ps)return null;if(this.Hs[t])return this.Hs[t];const e=this.Ys[t],s=e+this.Gs[t];if(this.Bs){const i=Uint8Array.from(this.buffer.subarray(e,e+s));return this.Hs[t]=i,i}{const e=Uint8Array.from(i.read(this.Ws[t],this.buffer,this.Gs[t],this.Ys[t]));return this.Hs[t]=e,e}}}class Y{static Ks=new Uint8Array(520);Xs;js;store;constructor(t,i,e){this.Xs=new O(t),this.js=new O(i),this.store=e+1}get Ps(){return this.js.length/6}read(t,i=!1){this.js.Vt=6*t;const e=this.js.Jt;let s=this.js.Jt;if(s<=0||s>this.Xs.length/520)return null;const n=new Uint8Array(e);let r=0;for(let i=0;r512&&(h=512),this.Xs.si(h+8,0,Y.Ks);const o=(255&Y.Ks[0])<<8|255&Y.Ks[1],l=(255&Y.Ks[2])<<8|255&Y.Ks[3],a=(255&Y.Ks[4])<<16|(255&Y.Ks[5])<<8|255&Y.Ks[6],c=255&Y.Ks[7];if(o!==t||l!==i||c!==this.store)return null;if(a<0||a>this.Xs.length/520)return null;for(let t=0;t>>0;if(h.free_u8(e,a),4294967295===s){const t=h.error_message(),i=h.error_message_len(),e=new Uint8Array(h.memory.buffer,t,i),s=(new TextDecoder).decode(e);throw new l(s)}const n=h.buffer()>>>0;return new Uint8Array(h.memory.buffer,n,s)}(n)}}class H{static zs=[];static Zs=t=>{const i=new O(t.read('base_head.dat')),e=new O(t.read('base_type.dat')),s=new O(t.read('base_label.dat')),n=i.Zt;i.Vt+=2;for(let t=0;t{const i=new O(t.read('frame_head.dat')),e=new O(t.read('frame_tran1.dat')),s=new O(t.read('frame_tran2.dat')),n=new O(t.read('frame_del.dat')),r=i.Zt;i.Vt+=2;const h=new Int32Array(500),o=new Int32Array(500),l=new Int32Array(500),a=new Int32Array(500);for(let t=0;t0){if(0!==f.types[t])for(let i=t-1;i>d;i--)if(0===f.types[i]){h[w]=i,o[w]=0,l[w]=0,a[w]=0,w++;break}h[w]=t;let e=0;3===f.types[h[w]]&&(e=128),o[w]=1&i?s.ti:e,l[w]=2&i?s.ti:e,a[w]=4&i?s.ti:e,d=t,w++}}r.length=w,r.Js=new Int32Array(w),r.x=new Int32Array(w),r.y=new Int32Array(w),r.z=new Int32Array(w);for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static ir=(t,i,e)=>{const s=t.$s,n=t.Qs,r=t.tn;let h,o,l,a,c;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.$s,r=t.Qs,h=t.tn;let o,l,a,c,f;if(s)o=t.cr,l=t.er,a=t.ur;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let i=0;i{const e=t.$s,s=t.Qs,n=t.tn,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.cr[i],a=t.er[i],c=t.ur[i];for(let t=0;t{if(!j.metadata)throw new Error('cant loading model metadata!!!!!');const i=j.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(j.head&&j.mn&&j.pn&&j.An&&j._n&&j.gn&&j.In&&j.Cn&&j.En&&j.Tn&&j.bn&&j.On&&j.Rn&&j.axis))throw new Error('cant loading model!!!!!');const e=i.$s,s=i.Qs,n=i.tn,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),l=new Int32Array(s),a=new Int32Array(s),c=new Int32Array(s),f=new Int32Array(n),u=new Int32Array(n),d=new Int32Array(n);let w=null;i.hn>=0&&(w=new Int32Array(e));let y=null;i.fn>=0&&(y=new Int32Array(s));let m=null,p=0;i.un>=0?m=new Int32Array(s):p=-i.un-1;let A=null;i.dn>=0&&(A=new Int32Array(s));let _=null;i.wn>=0&&(_=new Int32Array(s));const g=new Int32Array(s);j.In.Vt=i.en,j.Cn.Vt=i.sn,j.En.Vt=i.nn,j.Tn.Vt=i.rn,j.bn.Vt=i.hn;let I,C,E,T=0,b=0,O=0;for(let t=0;t{if(!j.metadata||!j.metadata[i])throw new Error('No model metadata');const e=j.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const s=e.$s,n=e.Qs,r=e.tn,h=new Int32Array(s),o=new Int32Array(s),l=new Int32Array(s),a=new Int32Array(n),c=new Int32Array(n),f=new Int32Array(n),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(r);let y=null;e.hn>=0&&(y=new Int32Array(s));let m=null;e.fn>=0&&(m=new Int32Array(n));let p=null,A=0;e.un>=0?p=new Int32Array(n):A=-e.un-1;let _=null;e.dn>=0&&(_=new Int32Array(n));let g=null;e.wn>=0&&(g=new Int32Array(n));const I=new Int32Array(n),C=new O(e.data);C.Vt=e.en;const E=new O(e.data);E.Vt=e.sn;const T=new O(e.data);T.Vt=e.nn;const b=new O(e.data);b.Vt=e.rn;const R=new O(e.data);R.Vt=e.hn;let v,L,S,x=0,M=0,k=0;for(let t=0;tthis.vr&&(this.vr=-e),e>this.Rr&&(this.Rr=e);const n=i*i+s*s;n>this.Or&&(this.Or=n)}this.Or=Math.sqrt(this.Or)+.99|0,this.Sr=Math.sqrt(this.Or*this.Or+this.vr*this.vr)+.99|0,this.Lr=this.Sr+(Math.sqrt(this.Or*this.Or+this.Rr*this.Rr)+.99|0)}Xr(){this.vr=0,this.Rr=0;for(let t=0;tthis.vr&&(this.vr=-i),i>this.Rr&&(this.Rr=i)}this.Sr=Math.sqrt(this.Or*this.Or+this.vr*this.vr)+.99|0,this.Lr=this.Sr+(Math.sqrt(this.Or*this.Or+this.Rr*this.Rr)+.99|0)}jr(){if(this.kr){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Fr=new v(i+1,null);for(let e=0;e<=i;e++)this.Fr[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Br=new v(i+1,null);for(let e=0;e<=i;e++)this.Br[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;eo;)o=e[h++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==o||0===r.types[i])&&this.Zr(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}j.Xn=0,j.jn=0,j.zn=0,h=0,o=e[h++];for(let t=0;to;)o=e[h++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===o||0===r.types[i])&&this.Zr(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.qr(t)}qr(t){if(!this.Fr||-1===t||!V.zs[t])return;const i=V.zs[t],e=i.qs;j.Xn=0,j.jn=0,j.zn=0;for(let t=0;t>16;this.ur[t]=this.er[t]*i+this.ur[t]*e>>16,this.er[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.sr&&this.nr&&this.rr||(this.sr=new Int32Array(this.Qs),this.nr=new Int32Array(this.Qs),this.rr=new Int32Array(this.Qs)),!this.lr){this.lr=new v(this.$s,null);for(let t=0;t8192||m>8192||p>8192||y<-8192||m<-8192||p<-8192;)y>>=1,m>>=1,p>>=1;let A=0|Math.sqrt(y*y+m*m+p*p);if(A<=0&&(A=1),y=256*y/A|0,m=256*m/A|0,p=256*p/A|0,this.hr&&1&this.hr[i]){const r=t+((e*y+s*m+n*p)/(h+(h/2|0))|0);this.Ar&&(this.sr[i]=j.tr(this.Ar[i],r,this.hr[i]))}else{let t=this.lr[r];t&&(t.x+=y,t.y+=m,t.z+=p,t.w++),t=this.lr[o],t&&(t.x+=y,t.y+=m,t.z+=p,t.w++),t=this.lr[l],t&&(t.x+=y,t.y+=m,t.z+=p,t.w++)}}if(r)this.eh(t,h,e,s,n);else{this.ar=new v(this.$s,null);for(let t=0;t>16;for(let s=0;s>16,A=A*u-p*f>>16,p=m),0!==t&&(m=A*l-_*o>>16,_=A*o+_*l>>16,A=m),0!==i&&(m=_*a+p*c>>16,_=_*c-p*a>>16,p=m),p+=n,A+=r,_+=h,m=A*w-_*d>>16,_=A*d+_*w>>16,A=m,j.Sn&&j.xn&&j.Mn&&(j.Mn[s]=_-y,j.Sn[s]=N.ki+((p<<9)/_|0),j.xn[s]=N.Di+((A<<9)/_|0)),this.tn>0&&j.kn&&j.Dn&&j.Nn&&(j.kn[s]=p,j.Dn[s]=A,j.Nn[s]=_)}try{this.rh(!1,!1,0)}catch(t){}}draw(t,i,e,s,n,r,h,o,l){const a=o*n-r*s>>16,c=h*i+a*e>>16,f=this.Or*e>>16,u=c+f;if(u<=50||c>=3500)return;const d=o*s+r*n>>16;let w=d-this.Or<<9;if((w/u|0)>=m.dt)return;let y=d+this.Or<<9;if((y/u|0)<=-m.dt)return;const p=h*e-a*i>>16,A=this.Or*i>>16;let _=p+A<<9;if((_/u|0)<=-m.wt)return;let g=p-(A+(this.vr*e>>16))<<9;if((g/u|0)>=m.wt)return;let I=c-(f+(this.vr*i>>16))<=50,C=!1;if(l>0&&j.Zn){let t=c-f;t<=50&&(t=50),d>0?(w=w/u|0,y=y/t|0):(y=y/u|0,w=w/t|0),p>0?(g=g/u|0,_=_/t|0):(_=_/u|0,g=g/t|0);const i=j.Ve-N.ki,e=j.Ke-N.Di;i>w&&ig&&e<_&&(this.Hr?j.Jn[j.qn++]=l:C=!0)}const E=N.ki,T=N.Di;let b=0,O=0;0!==t&&(b=N.sin[t],O=N.cos[t]);for(let l=0;l>16,d=d*O-f*b>>16,f=a),f+=r,u+=h,d+=o,a=d*s+f*n>>16,d=d*n-f*s>>16,f=a,a=u*e-d*i>>16,d=u*i+d*e>>16,u=a,j.Mn&&(j.Mn[l]=d-c),d>=50&&j.Sn&&j.xn?(j.Sn[l]=E+((f<<9)/d|0),j.xn[l]=T+((u<<9)/d|0)):j.Sn&&(j.Sn[l]=-5e3,I=!0),(I||this.tn>0)&&j.kn&&j.Dn&&j.Nn&&(j.kn[l]=f,j.Dn[l]=u,j.Nn[l]=d)}try{this.rh(I,C,l)}catch(t){}}rh(t,i,e,s=!1){j.$n&&(this.Vr=-1,this.Kr=-1);for(let t=0;tm.ut||l>m.ut||a>m.ut),j.Bn&&j.Fn){const t=((d+w+y)/3|0)+this.Sr;j.Bn[t][j.Fn[t]++]=s,j.$n&&this.hh(j.Ve,j.Ke,c,f,u,o,l,a)&&this.Kr=0;t--){const i=j.Fn[t];if(!(i<=0)&&j.Bn){const e=j.Bn[t];for(let t=0;t=0;t--){const i=j.Fn[t];if(i>0&&j.Bn){const e=j.Bn[t];for(let s=0;s0||j.Pn[2]>0)&&(n=(j.Yn[1]+j.Yn[2])/(j.Pn[1]+j.Pn[2])|0);let r=0;j.Pn&&j.Yn&&(j.Pn[3]>0||j.Pn[4]>0)&&(r=(j.Yn[3]+j.Yn[4])/(j.Pn[3]+j.Pn[4])|0);let h=0;if(j.Pn&&j.Yn&&(j.Pn[6]>0||j.Pn[8]>0)&&(h=(j.Yn[6]+j.Yn[8])/(j.Pn[6]+j.Pn[8])|0),j.Pn&&j.Un){let t,i=0,e=j.Pn[10],o=j.Un[10],l=j.Wn;i===e&&(i=0,e=j.Pn[11],o=j.Un[11],l=j.Gn),t=in;)try{this.oh(o[i++],s),i===e&&o!==j.Un[11]&&(i=0,e=j.Pn[11],o=j.Un[11],l=j.Gn),t=ir;)try{this.oh(o[i++],s),i===e&&o!==j.Un[11]&&(i=0,e=j.Pn[11],o=j.Un[11],l=j.Gn),t=ih;)try{this.oh(o[i++],s),i===e&&o!==j.Un[11]&&(i=0,e=j.Pn[11],o=j.Un[11],l=j.Gn),t=i>2,r=this._r[i],h=this.gr[i],o=this.Ir[i];N.he(j.Sn[e],j.Sn[s],j.Sn[n],j.xn[e],j.xn[s],j.xn[n],this.sr[t],this.nr[t],this.rr[t],j.kn[r],j.Dn[r],j.Nn[r],j.kn[h],j.kn[o],j.Dn[h],j.Dn[o],j.Nn[h],j.Nn[o],this.Ar[t])}else if(3===r&&this.hr&&this.Ar&&this.sr&&j.Sn&&j.xn&&j.kn&&j.Dn&&j.Nn){const i=this.hr[t]>>2,r=this._r[i],h=this.gr[i],o=this.Ir[i];N.he(j.Sn[e],j.Sn[s],j.Sn[n],j.xn[e],j.xn[s],j.xn[n],this.sr[t],this.sr[t],this.sr[t],j.kn[r],j.Dn[r],j.Nn[r],j.kn[h],j.kn[o],j.Dn[h],j.Dn[o],j.Nn[h],j.Nn[o],this.Ar[t])}}lh(t,i=!1){let e=0;if(j.Nn){const i=N.ki,s=N.Di,n=this.dr[t],r=this.wr[t],h=this.yr[t],o=j.Nn[n],l=j.Nn[r],a=j.Nn[h];if(o>=50&&j.Sn&&j.xn&&this.sr)j.Hn[e]=j.Sn[n],j.Vn[e]=j.xn[n],j.Kn[e++]=this.sr[t];else if(j.kn&&j.Dn&&this.sr){const c=j.kn[n],f=j.Dn[n],u=this.sr[t];if(a>=50&&this.rr){const n=(50-o)*N.Li[a-o];j.Hn[e]=i+((c+((j.kn[h]-c)*n>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[h]-f)*n>>16)<<9)/50|0),j.Kn[e++]=u+((this.rr[t]-u)*n>>16)}if(l>=50&&this.nr){const n=(50-o)*N.Li[l-o];j.Hn[e]=i+((c+((j.kn[r]-c)*n>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[r]-f)*n>>16)<<9)/50|0),j.Kn[e++]=u+((this.nr[t]-u)*n>>16)}}if(l>=50&&j.Sn&&j.xn&&this.nr)j.Hn[e]=j.Sn[r],j.Vn[e]=j.xn[r],j.Kn[e++]=this.nr[t];else if(j.kn&&j.Dn&&this.nr){const c=j.kn[r],f=j.Dn[r],u=this.nr[t];if(o>=50&&this.sr){const r=(50-l)*N.Li[o-l];j.Hn[e]=i+((c+((j.kn[n]-c)*r>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[n]-f)*r>>16)<<9)/50|0),j.Kn[e++]=u+((this.sr[t]-u)*r>>16)}if(a>=50&&this.rr){const n=(50-l)*N.Li[a-l];j.Hn[e]=i+((c+((j.kn[h]-c)*n>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[h]-f)*n>>16)<<9)/50|0),j.Kn[e++]=u+((this.rr[t]-u)*n>>16)}}if(a>=50&&j.Sn&&j.xn&&this.rr)j.Hn[e]=j.Sn[h],j.Vn[e]=j.xn[h],j.Kn[e++]=this.rr[t];else if(j.kn&&j.Dn&&this.rr){const c=j.kn[h],f=j.Dn[h],u=this.rr[t];if(l>=50&&this.nr){const n=(50-a)*N.Li[l-a];j.Hn[e]=i+((c+((j.kn[r]-c)*n>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[r]-f)*n>>16)<<9)/50|0),j.Kn[e++]=u+((this.nr[t]-u)*n>>16)}if(o>=50&&this.sr){const r=(50-a)*N.Li[o-a];j.Hn[e]=i+((c+((j.kn[n]-c)*r>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[n]-f)*r>>16)<<9)/50|0),j.Kn[e++]=u+((this.sr[t]-u)*r>>16)}}}const s=j.Hn[0],n=j.Hn[1],r=j.Hn[2],h=j.Vn[0],o=j.Vn[1],l=j.Vn[2];if(!((s-n)*(l-o)-(h-o)*(r-n)<=0))if(N.Fi=!1,3===e){let e;if((s<0||n<0||r<0||s>m.ut||n>m.ut||r>m.ut)&&(N.Fi=!0),e=this.hr?3&this.hr[t]:0,i)N.Ct(s,n,h,o,j.Kn[0]),N.Ct(n,r,o,l,j.Kn[1]),N.Ct(r,s,l,h,j.Kn[2]);else if(0===e)N.ee(s,n,r,h,o,l,j.Kn[0],j.Kn[1],j.Kn[2]);else if(1===e&&this.sr)N.ne(s,n,r,h,o,l,N.palette[this.sr[t]]);else if(2===e&&this.hr&&this.Ar&&j.kn&&j.Dn&&j.Nn){const i=this.hr[t]>>2,e=this._r[i],a=this.gr[i],c=this.Ir[i];N.he(s,n,r,h,o,l,j.Kn[0],j.Kn[1],j.Kn[2],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t])}else if(3===e&&this.hr&&this.Ar&&this.sr&&j.kn&&j.Dn&&j.Nn){const i=this.hr[t]>>2,e=this._r[i],a=this.gr[i],c=this.Ir[i];N.he(s,n,r,h,o,l,this.sr[t],this.sr[t],this.sr[t],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t])}}else if(4===e){let e;if((s<0||n<0||r<0||s>m.ut||n>m.ut||r>m.ut||j.Hn[3]<0||j.Hn[3]>m.ut)&&(N.Fi=!0),e=this.hr?3&this.hr[t]:0,i)N.Ct(s,n,h,o,j.Kn[0]),N.Ct(n,r,o,l,j.Kn[1]),N.Ct(r,j.Hn[3],l,j.Vn[3],j.Kn[2]),N.Ct(j.Hn[3],s,j.Vn[3],h,j.Kn[3]);else if(0===e)N.ee(s,n,r,h,o,l,j.Kn[0],j.Kn[1],j.Kn[2]),N.ee(s,r,j.Hn[3],h,l,j.Vn[3],j.Kn[0],j.Kn[2],j.Kn[3]);else if(1===e){if(this.sr){const i=N.palette[this.sr[t]];N.ne(s,n,r,h,o,l,i),N.ne(s,r,j.Hn[3],h,l,j.Vn[3],i)}}else if(2===e&&this.hr&&this.Ar&&j.kn&&j.Dn&&j.Nn){const i=this.hr[t]>>2,e=this._r[i],a=this.gr[i],c=this.Ir[i];N.he(s,n,r,h,o,l,j.Kn[0],j.Kn[1],j.Kn[2],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t]),N.he(s,r,j.Hn[3],h,l,j.Vn[3],j.Kn[0],j.Kn[2],j.Kn[3],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t])}else if(3===e&&this.hr&&this.Ar&&this.sr&&j.kn&&j.Dn&&j.Nn){const i=this.hr[t]>>2,e=this._r[i],a=this.gr[i],c=this.Ir[i];N.he(s,n,r,h,o,l,this.sr[t],this.sr[t],this.sr[t],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t]),N.he(s,r,j.Hn[3],h,l,j.Vn[3],this.sr[t],this.sr[t],this.sr[t],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t])}}}Zr(t,i,e,s,n){if(!s)return;const r=s.length;if(0===n){let n=0;j.Xn=0,j.jn=0,j.zn=0;for(let t=0;t0?(j.Xn=(j.Xn/n|0)+t,j.jn=(j.jn/n|0)+i,j.zn=(j.zn/n|0)+e):(j.Xn=t,j.jn=i,j.zn=e)}else if(1===n)for(let n=0;n=this.Fr.length)continue;const h=this.Fr[r];if(h)for(let s=0;s=this.Fr.length)continue;const h=this.Fr[r];if(h)for(let s=0;s>16;this.er[n]=this.er[n]*c-this.cr[n]*a>>16,this.cr[n]=t}if(0!==r){a=N.sin[r],c=N.cos[r];const t=this.er[n]*c-this.ur[n]*a>>16;this.ur[n]=this.er[n]*a+this.ur[n]*c>>16,this.er[n]=t}if(0!==o){a=N.sin[o],c=N.cos[o];const t=this.ur[n]*a+this.cr[n]*c>>16;this.ur[n]=this.ur[n]*c-this.cr[n]*a>>16,this.cr[n]=t}this.cr[n]+=j.Xn,this.er[n]+=j.jn,this.ur[n]+=j.zn}}else if(3===n)for(let n=0;n=this.Fr.length)continue;const h=this.Fr[r];if(h)for(let s=0;s=this.Br.length)continue;const n=this.Br[e];if(n)for(let i=0;i255&&(this.pr[e]=255)}}}sh(){this.vr=0,this.Or=0,this.Rr=0,this.Cr=999999,this.Er=-999999,this.br=-99999,this.Tr=99999;for(let t=0;tthis.Er&&(this.Er=i),sthis.br&&(this.br=s),-e>this.vr&&(this.vr=-e),e>this.Rr&&(this.Rr=e);const n=i*i+s*s;n>this.Or&&(this.Or=n)}this.Or=0|Math.sqrt(this.Or),this.Sr=0|Math.sqrt(this.Or*this.Or+this.vr*this.vr),this.Lr=this.Sr+(0|Math.sqrt(this.Or*this.Or+this.Rr*this.Rr))}hh(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(g.src),g.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>g.onload=()=>t())),I.clearRect(0,0,_.width,_.height);const i=g.naturalWidth,e=g.naturalHeight;return _.width=i,_.height=e,I.drawImage(g,0,0),I.getImageData(0,0,i,e)})(e),n=new J(s.width,s.height),r=new Uint32Array(s.data.buffer),h=n.lt;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static gi=(t,i,e=0)=>{const s=new O(t.read(i+'.dat')),n=new O(t.read('index.dat'));n.Vt=s.Zt;const r=n.Zt,h=n.Zt,o=[],l=n.jt-1;for(let t=0;ts.length||n.Vt>n.length)throw new Error;const a=n.jt,c=n.jt,f=n.Zt,u=n.Zt,d=new J(f,u);d.mi=a,d.pi=c,d.Ai=r,d._i=h;const w=n.jt;if(0===w){const t=d.width*d.height;for(let i=0;im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.mh(r,n,this.lt,s,o,m.lt,e,h)}ph(t,i,e){i|=0,e|=0;let s=(i+=this.mi)+(e+=this.pi)*m.ct,n=0,r=this.height,h=this.width,o=m.ct-h,l=0;if(em.bottom&&(r-=e+r-m.bottom),im.right){const t=i+h-m.right;h-=t,l+=t,o+=t}h>0&&r>0&&this.Ah(h,r,this.lt,n,l,m.lt,s,o,t)}_h(t,i){t|=0,i|=0;let e=(t+=this.mi)+(i+=this.pi)*m.ct,s=0,n=this.height,r=this.width,h=m.ct-r,o=0;if(im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.gh(r,n,this.lt,s,o,m.lt,e,h)}Ci(){const t=this.lt,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.lt[s]=(r<<16)+(h<<8)+o}}}bi(t,i,e,s){t|=0,i|=0,e|=0,s|=0;try{const n=this.width;let r=0,h=0;const o=this.Ai,l=this._i,a=(o<<16)/e|0,c=(l<<16)/s|0;t+=(this.mi*e+o-1)/o|0,i+=(this.pi*s+l-1)/l|0,this.mi*e%o!=0&&(r=(o-this.mi*e%o<<16)/e|0),this.pi*s%l!=0&&(h=(l-this.pi*s%l<<16)/s|0),e=e*(this.width-(r>>16))/o|0,s=s*(this.height-(h>>16))/l|0;let f=t+i*m.ct,u=m.ct-e;if(im.bottom&&(s-=i+s-m.bottom),tm.right){const i=t+e-m.right;e-=i,u+=i}this.scale(e,s,this.lt,r,h,m.lt,u,f,n,a,c)}catch(t){console.error('error in sprite clipping routine')}}Ih(t,i,e,s,n,r,h,o,l,a){t|=0,i|=0,e|=0,s|=0;try{const c=-e/2|0,f=-s/2|0,u=65536*Math.sin(l/326.11)|0,d=65536*Math.cos(l/326.11)|0,w=u*a>>8,y=d*a>>8;let p=(h<<16)+f*w+c*y,A=f*y-c*w+(o<<16),_=t+i*m.ct;for(let t=0;t>16)+(h>>16)*this.width],s+=y,h-=w;p+=w,A+=y,_+=m.ct}}catch(t){}}Ch(t,i,e){t|=0,i|=0;let s=(t+=this.mi)+(i+=this.pi)*m.ct,n=0,r=this.height,h=this.width,o=m.ct-h,l=0;if(im.bottom&&(r-=i+r-m.bottom),tm.right){const i=t+h-m.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.Eh(h,r,this.lt,l,n,m.lt,s,o,e.lt)}scale(t,i,e,s,n,r,h,o,l,a,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*l;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=a}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}gh(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}Ah(t,i,e,s,n,r,h,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}h+=o,s+=n}}mh(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}Eh(t,i,e,s,n,r,h,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++}h+=o,n+=s}}}class ${static Th=['_','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','0','1','2','3','4','5','6','7','8','9'];static bh=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static Oh=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.Th[Number(s-37n*t)]}return e.slice(12-i).join('')};static Rh=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static Lh=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static xh=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static Mh=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}class Q{static zs=[];static kh=null;static Dh=null;static Nh=0;static Fh=1;static Bh=2;static Ph=3;static Uh=4;static Wh=5;static Gh=6;static Yh=7;static Hh=1;static Vh=2;static Kh=3;static Xh=4;static jh=5;static zh=6;static Zh=1;static qh=100;static Jh=101;static $h=200;static Qh=201;static io=202;static eo=203;static so=205;static no=300;static ro=301;static ho=302;static oo=303;static lo=304;static ao=305;static co=306;static fo=307;static uo=308;static do=309;static wo=310;static yo=311;static mo=312;static po=313;static Ao=314;static _o=315;static Io=316;static Co=317;static Eo=318;static To=319;static bo=320;static Oo=321;static Ro=322;static vo=323;static Lo=324;static So=325;static xo=326;static Mo=327;static ko=401;static Do=500;static No=501;static Fo=502;static Bo=503;static Po=600;static Uo=601;static Wo=602;static Go=603;static Yo=604;static Ho=605;static Vo=606;static Ko=607;static Xo=608;static jo=609;static zo=610;static Zo=611;static qo=612;static Jo=613;static $o=650;static Qo=651;static tl=652;static il=653;static el=654;static sl=655;static Zs=(t,i,e)=>{this.kh=new q(5e4),this.Dh=new q(5e4);const s=new O(t.read('data'));let n=-1;for(s.Vt+=2;s.Vt0){r.ll=new Uint8Array(h),r.al=new Uint16Array(h);for(let t=0;t0){r.scripts=new v(o,null);for(let t=0;t0){const s=e.lastIndexOf(',');r.Il[t]=this.Cl(i,e.substring(0,s),parseInt(e.substring(s+1),10))}}r.El=new v(5,null);for(let t=0;t<5;t++){const i=s.ei;r.El[t]=i,0===i.length&&(r.El[t]=null)}}if(r.type===Q.Ph&&(r.fill=1===s.jt),r.type===Q.Uh||r.type===Q.Fh){r.Tl=1===s.jt;const t=s.jt;e&&(r.font=e[t]),r.bl=1===s.jt}if(r.type===Q.Uh&&(r.text=s.ei,r.Ol=s.ei),r.type!==Q.Fh&&r.type!==Q.Ph&&r.type!==Q.Uh||(r.Rl=s.$t),r.type!==Q.Ph&&r.type!==Q.Uh||(r.vl=s.$t,r.Ll=s.$t),r.type===Q.Wh){const t=s.ei;if(t.length>0){const e=t.lastIndexOf(',');r.Sl=this.Cl(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=s.ei;if(e.length>0){const t=e.lastIndexOf(',');r.xl=this.Cl(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(r.type===Q.Gh){const t=s.jt;0!==t&&(r.model=this.Ml((t-1<<8)+s.jt));const i=s.jt;0!==i&&(r.kl=this.Ml((i-1<<8)+s.jt)),r.Dl=s.jt,0===r.Dl?r.Dl=-1:r.Dl=(r.Dl-1<<8)+s.jt,r.Nl=s.jt,0===r.Nl?r.Nl=-1:r.Nl=(r.Nl-1<<8)+s.jt,r.zoom=s.Zt,r.Fl=s.Zt,r.Bl=s.Zt}if(r.type===Q.Yh){r.dl=new Int32Array(r.width*r.height),r.wl=new Int32Array(r.width*r.height),r.Tl=1===s.jt;const t=s.jt;e&&(r.font=e[t]),r.bl=1===s.jt,r.Rl=s.$t,r.pl=s.qt,r.Al=s.qt,r.yl=1===s.jt,r.El=new v(5,null);for(let t=0;t<5;t++){const i=s.ei;r.El[t]=i,0===i.length&&(r.El[t]=null)}}r.rl!==Q.Vh&&r.type!==Q.Bh||(r.Pl=s.ei,r.action=s.ei,r.Ul=s.Zt),r.rl!==Q.Hh&&r.rl!==Q.Xh&&r.rl!==Q.jh&&r.rl!==Q.zh||(r.Wl=s.ei,0===r.Wl.length&&(r.rl===Q.Hh?r.Wl='Ok':r.rl===Q.Xh||r.rl===Q.jh?r.Wl='Select':r.rl===Q.zh&&(r.Wl='Continue')))}this.kh=null,this.Dh=null};static Cl=(t,i,e)=>{const s=$.Mh(i)<<8n|BigInt(e);if(this.kh){const t=this.kh.get(s);if(t)return t}let n;try{n=J.gi(t,i,e),this.kh?.put(s,n)}catch(t){return null}return n};static Ml=t=>{if(this.Dh){const i=this.Dh.get(BigInt(t));if(i)return i}const i=j.model(t);return this.Dh?.put(BigInt(t),i),i};id=-1;nl=-1;type=-1;rl=-1;hl=0;width=0;height=0;ol=-1;ll=null;al=null;scripts=null;scroll=0;hide=!1;draggable=!1;yl=!1;ml=!1;pl=0;Al=0;_l=null;gl=null;Il=null;El=null;fill=!1;Tl=!1;font=null;bl=!1;text=null;Ol=null;Rl=0;vl=0;Ll=0;Sl=null;xl=null;model=null;kl=null;Dl=-1;Nl=-1;zoom=0;Fl=0;Bl=0;Pl=null;action=null;Ul=-1;Wl=null;cl=null;fl=null;ul=null;x=0;y=0;Gl=0;dl=null;wl=null;Yl=0;Hl=0;Ml(t,i,e){let s=this.model;if(e&&(s=this.kl),!s)return null;if(-1===t&&-1===i&&!s.Ar)return s;const n=j.Mr(s,!0,!0,!1);return-1===t&&-1===i||n.jr(),-1!==t&&n.qr(t),-1!==i&&n.qr(i),n.ih(64,768,-50,-10,-50,!0),n}Vl(){if(this.nl===this.id)return this.x;let t=Q.zs[this.nl];if(!t.cl||!t.fl||!t.ul)return this.x;let i=t.cl.indexOf(this.id);if(-1===i)return this.x;let e=t.fl[i];for(;t.nl!==t.id;){const s=Q.zs[t.nl];s.cl&&s.fl&&s.ul&&(i=s.cl.indexOf(t.id),-1!==i&&(e+=s.fl[i])),t=s}return e}Kl(){if(this.nl===this.id)return this.y;let t=Q.zs[this.nl];if(!t.cl||!t.fl||!t.ul)return this.y;let i=t.cl.indexOf(this.id);if(-1===i)return this.y;let e=t.ul[i];for(;t.nl!==t.id;){const s=Q.zs[t.nl];s.cl&&s.fl&&s.ul&&(i=s.cl.indexOf(t.id),-1!==i&&(e+=s.ul[i])),t=s}return e}outline(t){const i=this.Vl(),e=this.Kl();m._t(i,e,this.width,this.height,t)}move(t,i){if(this.nl===this.id)return;this.x=0,this.y=0;const e=Q.zs[this.nl];if(e.cl&&e.fl&&e.ul){const s=e.cl.indexOf(this.id);-1!==s&&(e.fl[s]=t,e.ul[s]=i)}}delete(){if(this.nl===this.id)return;const t=Q.zs[this.nl];if(t.cl&&t.fl&&t.ul){const i=t.cl.indexOf(this.id);-1!==i&&(t.cl.splice(i,1),t.fl.splice(i,1),t.ul.splice(i,1))}}}var tt,it=(tt="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,s,n=void 0!==(t=t||{})?t:{};n.ready=new Promise((function(t,e){i=t,s=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(n.ready,t)||Object.defineProperty(n.ready,t,{get:()=>X('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>X('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var r=Object.assign({},n),h=[],o='object'==typeof window,l='function'==typeof importScripts,a='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,c=!o&&!a&&!l;if(n.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var f,u,d,w='';if(a){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var y,m;w=l?require('path').Xl(w)+'/':__dirname+'/';var p=()=>{m||(y=require('fs'),m=require('path'))};f=(t,i)=>(p(),t=m.normalize(t),y.jl(t,i?void 0:'utf8')),d=t=>{var i=f(t,!0);return i.buffer||(i=new Uint8Array(i)),k(i.buffer),i},u=(t,i,e)=>{p(),t=m.normalize(t),y.zl(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),h=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),n.inspect=function(){return'[Emscripten Module object]'}}else if(c){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(f=function(t){return read(t)}),d=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),k('object'==typeof i),i)},u=function(t,i,e){setTimeout((()=>i(d(t))),0)},'undefined'!=typeof scriptArgs?h=scriptArgs:void 0!==arguments&&(h=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!o&&!l)throw new Error('environment detection error');if(l?w=self.location.href:'undefined'!=typeof document&&document.currentScript&&(w=document.currentScript.src),tt&&(w=tt),w=0!==w.indexOf('blob:')?w.substr(0,w.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');f=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},l&&(d=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),u=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}n.print||console.log.bind(console);var A,_,g=n.printErr||console.warn.bind(console);function I(t,i){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){X('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function C(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(n,r),r=null,A='fetchSettings',Object.getOwnPropertyDescriptor(n,A)&&X('`Module.'+A+'` was supplied but `'+A+'` not included in INCOMING_MODULE_JS_API'),n.arguments&&(h=n.arguments),I('arguments','arguments_'),n.thisProgram&&n.thisProgram,I('thisProgram','thisProgram'),n.quit&&n.quit,I('quit','quit_'),k(void 0===n.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.read,'Module.read option was removed (modify read_ in JS)'),k(void 0===n.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),k(void 0===n.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),k(void 0===n.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),k(void 0===n.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),I('read','read_'),I('readAsync','readAsync'),I('readBinary','readBinary'),I('setWindowTitle','setWindowTitle'),k(!c,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),n.wasmBinary&&(_=n.wasmBinary),I('wasmBinary','wasmBinary');var E;n.noExitRuntime;I('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&X('no native wasm support detected');var T,b,O,R,v,L,S,x,M=!1;function k(t,i){t||X('Assertion failed'+(i?': '+i:''))}function D(t){T=t,n.HEAP8=b=new Int8Array(t),n.HEAP16=R=new Int16Array(t),n.HEAP32=v=new Int32Array(t),n.HEAPU8=O=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=L=new Uint32Array(t),n.HEAPF32=S=new Float32Array(t),n.HEAPF64=x=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var N=5242880;n.TOTAL_STACK&&k(N===n.TOTAL_STACK,'the stack size can no longer be determined at runtime');var F=n.INITIAL_MEMORY||16777216;function B(){if(!M){var t=ft(),i=L[t>>2],e=L[t+4>>2];34821223==i&&2310721022==e||X('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==L[0]&&X('Runtime error: The application has corrupted its heap memory area (address zero)!')}}I('INITIAL_MEMORY','INITIAL_MEMORY'),k(F>=N,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+F+'! (TOTAL_STACK='+N+')'),k('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),k(!n.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),k(16777216==F,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var P=[],U=[],W=[],G=!1;k(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var Y=0,H=null,V=null,K={};function X(t){n.onAbort&&n.onAbort(t),g(t='Aborted('+t+')'),M=!0;var i=new WebAssembly.RuntimeError(t);throw s(i),i}var j={error:function(){X('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){j.error()},Zl:function(){j.error()},ql:function(){j.error()},Jl:function(){j.error()},open:function(){j.error()},$l:function(){j.error()},Ql:function(){j.error()},ta:function(){j.error()},ia:function(){j.error()},ea:function(){j.error()}};n.FS_createDataFile=j.Zl,n.FS_createPreloadedFile=j.ql;var z,Z,q,J,$='data:application/octet-stream;base64,';function Q(t){return t.startsWith($)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=n.asm),k(G,'native function `'+e+'` called before runtime initialization'),s[t]||k(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==z&&_)return new Uint8Array(_);if(d)return d(t);throw"both async and sync fetching of the wasm failed"}catch(t){X(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(n)}function ht(t){ht.sa||(ht.sa={}),ht.sa[t]||(ht.sa[t]=1,a&&(t='warning: '+t),g(t))}function ot(t){try{return E.grow(t-T.byteLength+65535>>>16),D(E.buffer),1}catch(i){g('emscripten_realloc_buffer: Attempted to grow heap from '+T.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}n.locateFile?Q(z='tinymidipcm.wasm')||(Z=z,z=n.locateFile?n.locateFile(Z,w):w+Z):z=new URL(e(8227),e.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,e){O.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=O.length;k((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return g('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return g('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function e(t,i){var e,s=t.exports;n.asm=s,k(E=n.asm.memory,"memory not found in wasm exports"),D(E.buffer),k(n.asm.__indirect_function_table,"table not found in wasm exports"),e=n.asm.__wasm_call_ctors,U.unshift(e),function(t){if(Y--,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(k(K[t]),delete K[t]):g('warning: run dependency removed without ID'),0==Y&&(null!==H&&(clearInterval(H),H=null),V)){var i=V;V=null,i()}}('wasm-instantiate')}t='wasm-instantiate',Y++,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(k(!K[t]),K[t]=1,null===H&&'undefined'!=typeof setInterval&&(H=setInterval((function(){if(M)return clearInterval(H),void(H=null);var t=!1;for(var i in K)t||(t=!0,g('still waiting on run dependencies:')),g('dependency: '+i);t&&g('(end of list)')}),1e4))):g('warning: run dependency added without ID');var r=n;function h(t){k(n===r,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),r=null,e(t.instance)}function c(t){return function(){if(!_&&(o||l)){if('function'==typeof fetch&&!it(z))return fetch(z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+z+"'";return t.arrayBuffer()})).catch((function(){return st(z)}));if(u)return new Promise((function(t,i){u(z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){g('failed to asynchronously prepare wasm: '+t),it(z)&&g('warning: Loading from a file URI ('+z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),X(t)}))}if(n.instantiateWasm)try{return n.instantiateWasm(i,e)}catch(t){g('Module.instantiateWasm callback failed with error: '+t),s(t)}(_||'function'!=typeof WebAssembly.instantiateStreaming||Q(z)||it(z)||a||'function'!=typeof fetch?c(h):fetch(z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return g('wasm streaming compile failed: '+t),g('falling back to ArrayBuffer instantiation'),c(h)}))}))).catch(s)}(),n.___wasm_call_ctors=et("__wasm_call_ctors"),n._malloc=et("malloc"),n._free=et("free"),n._tsf_load_memory=et("tsf_load_memory"),n._tsf_close=et("tsf_close"),n._tsf_reset=et("tsf_reset"),n._tsf_set_output=et("tsf_set_output"),n._tsf_set_max_voices=et("tsf_set_max_voices"),n._realloc=et("realloc"),n._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),n._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),n._tml_load_memory=et("tml_load_memory"),n._midi_render=et("midi_render"),n.___errno_location=et("__errno_location"),n._fflush=et("fflush"),n._emscripten_stack_init=function(){return(ct=n._emscripten_stack_init=n.asm.emscripten_stack_init).apply(null,arguments)}),ft=(n._emscripten_stack_get_free=function(){return(n._emscripten_stack_get_free=n.asm.emscripten_stack_get_free).apply(null,arguments)},n._emscripten_stack_get_base=function(){return(n._emscripten_stack_get_base=n.asm.emscripten_stack_get_base).apply(null,arguments)},n._emscripten_stack_get_end=function(){return(ft=n._emscripten_stack_get_end=n.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),k(!(3&(t=ft()))),L[t>>2]=34821223,L[t+4>>2]=2310721022,L[0]=1668509029}function dt(t){function e(){lt||(lt=!0,n.calledRun=!0,M||(k(!G),G=!0,B(),rt(U),i(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),k(!n._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(B(),n.postRun)for('function'==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),W.unshift(t);var t;rt(W)}()))}t=t||h,Y>0||(ut(),function(){if(n.preRun)for('function'==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),P.unshift(t);var t;rt(P)}(),Y>0||(n.setStatus?(n.setStatus('Running...'),setTimeout((function(){setTimeout((function(){n.setStatus('')}),1),e()}),1)):e(),B()))}if(n.stackSave=et("stackSave"),n.stackRestore=et("stackRestore"),n.stackAlloc=et("stackAlloc"),n.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':b[0|t]=i;break;case'i16':R[t>>1]=i;break;case'i32':v[t>>2]=i;break;case'i64':J=[i>>>0,(q=i,+Math.abs(q)>=1?q>0?(0|Math.min(+Math.floor(q/4294967296),4294967295))>>>0:~~+Math.ceil((q-+(~~q>>>0))/4294967296)>>>0:0)],v[t>>2]=J[0],v[t+4>>2]=J[1];break;case'float':S[t>>2]=i;break;case'double':x[t>>3]=i;break;case'*':L[t>>2]=i;break;default:X('invalid type for setValue: '+e)}},n.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return b[0|t];case'i16':return R[t>>1];case'i32':case'i64':return v[t>>2];case'float':return S[t>>2];case'double':return x[t>>3];case'*':return L[t>>2];default:X('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),X(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),V=function t(){lt||dt(),lt||(V=t)},n.preInit)for('function'==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return dt(),t.ready});const et=it;const st=class{constructor(t={}){this.na=void 0,this.ra=0,this.ha=0,this.oa=0,this.la=t.la||100,this.sampleRate=t.sampleRate||44100,this.aa=t.aa||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.ca(1),this.fa=t.fa||(()=>{}),this.ua=t.ua||(()=>{}),this.da=void 0,this.test=0}async init(){if(!this.na){if('undefined'!=typeof process){const{Xl:t}=await import('path'),{wa:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.na=await et(),this.ya=this.na._malloc(this.bufferSize),this.ma=this.na._malloc(8)}}ca(t){this.bufferSize=4*this.sampleRate*this.aa*t}pa(){if(!this.na)throw new Error(`${this.constructor.name} not initalized. call .init()`)}Aa(t){this.pa();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.na;e(this.ra),this.ra=i(t.length),this.na.HEAPU8.set(t,this.ra),this.ha=s(this.ra,t.length),n(this.ha,2===this.aa?0:2,this.sampleRate,this.gain)}_a(){this.pa();const t=new Uint8Array(this.bufferSize);return t.set(this.na.HEAPU8.subarray(this.ya,this.ya+this.bufferSize)),t}ga(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.na;return e(this.oa),this.oa=i(t.length),this.na.HEAPU8.set(t,this.oa),s(this.oa,t.length)}Ia(t){const{_midi_render:i}=this.na;return i(this.ha,t,this.aa,this.sampleRate,this.ya,this.bufferSize,this.ma)}Ca(t){if(this.pa(),!this.ha)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.da);const{setValue:i,getValue:e}=this.na;i(this.ma,0,'double'),this.na._tsf_reset(this.ha),this.na._tsf_channel_set_bank_preset(this.ha,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.ga(t);const n=()=>{s=this.Ia(s);const t=this._a();this.fa(t),s?this.da=setTimeout(n,this.la):this.ua(e(this.ma,'double'))};this.da=setTimeout(n,16)}};!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{const t=2,i=44100;let e=new Float32Array,s=window.audioContext.createGain();s.gain.value=.1,s.connect(window.audioContext.destination);let n=window.audioContext.currentTime,r=[];const h=new st({la:30,fa:t=>{let i=new Float32Array(t.buffer),s=new Float32Array(e.length+i.length);s.set(e,0),s.set(i,e.length),e=s},ua:t=>{},bufferSize:102400});await h.init();const o=await fetch('./SCC1_Florestan.sf2'),l=new Uint8Array(await o.arrayBuffer());function a(){if(!window.audioContext||!e.length)return;let h=window.audioContext.createBufferSource();const o=e.length/t,l=window.audioContext.createBuffer(t,o,i);for(let i=0;i{t.stop(window.audioContext.currentTime)})),r=[],s.gain.value=t}}function u(t,i){-1!==t&&window._tinyMidiVolume(t),n=window.audioContext.currentTime,c=setInterval(a,250),h.Ca(i)}h.Aa(l),window._tinyMidiStop=async t=>{t?function(t,i){const e=window.audioContext.currentTime;s.gain.cancelScheduledValues(e),s.gain.setValueAtTime(s.gain.value,e),s.gain.linearRampToValueAtTime(t,e+2),setTimeout(i,2e3)}(0,(()=>{f()})):f()},window._tinyMidiVolume=(t=1)=>{s.gain.value=t},window._tinyMidiPlay=async(t,i,e)=>{t&&(await window._tinyMidiStop(e),e?setTimeout((()=>{u(i,t)}),2e3):u(i,t))}})();class nt{level;y;x;z;model;Ea;Ta;ba;Oa;Ra;va;La;info;Sa=0;Wi=0;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.Ea=r,this.Ta=h,this.ba=o,this.Oa=l,this.Ra=a,this.va=c,this.La=f,this.info=u}}class rt extends w{level;x;z;xa;Ma;ka;Da=null;Na=null;Fa=null;Ba=null;Pa=null;Ua=null;Wa=null;Ga=0;Ya=0;Ha=0;visible=!1;update=!1;Va=!1;Ka=0;Xa=0;ja=0;za=0;constructor(t,i,e){super(),this.xa=this.level=t,this.x=i,this.z=e,this.Ma=new v(5,null),this.ka=new Int32Array(5)}}class ht{Za;qa;Ja;$a;type;Cr;Er;Tr;br;Rr;vr;mode=0;Qa=0;tc=0;ic=0;ec=0;sc=0;nc=0;constructor(t,i,e,s,n,r,h,o,l,a,c){this.Za=t,this.qa=i,this.Ja=e,this.$a=s,this.type=n,this.Cr=r,this.Er=h,this.Tr=o,this.br=l,this.Rr=a,this.vr=c}}class ot{static OPEN=0;static rc=1;static hc=2;static oc=4;static lc=8;static ac=ot.rc<<4;static cc=ot.hc<<4;static fc=ot.oc<<4;static uc=ot.lc<<4;static dc=256;static wc=512;static yc=1024;static mc=2048;static Ac=4096;static _c=ot.wc<<4;static gc=ot.yc<<4;static Ic=ot.mc<<4;static Cc=ot.Ac<<4;static Ec=ot.dc<<9;static Tc=524288;static bc=2097152;static Oc=ot.bc|ot.Tc;static Rc=ot.dc|ot.Oc;static vc=ot.hc|ot.Rc;static Lc=ot.lc|ot.Rc;static Sc=ot.hc|ot.oc|ot.Lc;static xc=ot.cc|ot.Rc;static Mc=ot.lc|ot.ac|ot.xc;static kc=ot.uc|ot.Rc;static Dc=ot.rc|ot.hc|ot.kc;static Nc=ot.cc|ot.fc|ot.kc;static Fc=16777215}class lt{static Bc=0;static Pc=1;static Uc=2;static Wc=3}class at{static Gc=0;static Yc=1;static Hc=2;static Vc=3}class ct{static Kc=new ct(0,at.Gc);static Xc=new ct(1,at.Gc);static jc=new ct(2,at.Gc);static zc=new ct(3,at.Gc);static Zc=new ct(4,at.Yc);static qc=new ct(5,at.Yc);static Jc=new ct(6,at.Yc);static $c=new ct(7,at.Yc);static Qc=new ct(8,at.Yc);static tf=new ct(9,at.Hc);static if=new ct(10,at.Hc);static ef=new ct(11,at.Hc);static sf=new ct(12,at.Hc);static nf=new ct(13,at.Hc);static rf=new ct(14,at.Hc);static hf=new ct(15,at.Hc);static lf=new ct(16,at.Hc);static af=new ct(17,at.Hc);static cf=new ct(18,at.Hc);static ff=new ct(19,at.Hc);static uf=new ct(20,at.Hc);static df=new ct(21,at.Hc);static Vc=new ct(22,at.Vc);static values(){return[this.Kc,this.Xc,this.af,this.hf,this.jc,this.rf,this.tf,this.zc,this.Vc,this.sf,this.ef,this.Jc,this.uf,this.if,this.qc,this.nf,this.$c,this.Zc,this.lf,this.Qc,this.ff,this.df,this.cf]}static of(t){const i=this.values();for(let e=0;et*ut.yf+i;offsetX;mf;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.mf=0,this.sizeX=ut.yf,this.sizeZ=ut.yf,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[ut.index(t-this.offsetX,i-this.mf)]|=ot.bc};Af=(t,i)=>{this.flags[ut.index(t-this.offsetX,i-this.mf)]&=~ot.bc};_f=(t,i,e,s,n,r)=>{let h=ot.dc;r&&(h|=ot.Ec);const o=t-this.offsetX,l=i-this.mf;if(n===lt.Pc||n===lt.Wc){const t=e;e=s,s=t}for(let t=o;t=0&&t=0&&i{let h=ot.dc;r&&(h|=ot.Ec);const o=t-this.offsetX,l=i-this.mf;if(n===lt.Pc||n===lt.Wc){const t=e;e=s,s=t}for(let t=o;t=0&&t=0&&i{const r=t-this.offsetX,h=i-this.mf,o=n?ot.Cc:ot.uc,l=n?ot.Ac:ot.lc,a=n?ot.yc:ot.hc,c=n?ot.gc:ot.cc,f=n?ot.wc:ot.rc,u=n?ot._c:ot.ac,d=n?ot.mc:ot.oc,w=n?ot.Ic:ot.fc;e===ct.Kc.id?s===lt.Bc?(this.add(r,h,o),this.add(r-1,h,l)):s===lt.Pc?(this.add(r,h,a),this.add(r,h+1,c)):s===lt.Uc?(this.add(r,h,l),this.add(r+1,h,o)):s===lt.Wc&&(this.add(r,h,c),this.add(r,h-1,a)):e===ct.Xc.id||e===ct.zc.id?s===lt.Bc?(this.add(r,h,f),this.add(r-1,h+1,u)):s===lt.Pc?(this.add(r,h,d),this.add(r+1,h+1,w)):s===lt.Uc?(this.add(r,h,u),this.add(r+1,h-1,f)):s===lt.Wc&&(this.add(r,h,w),this.add(r-1,h-1,d)):e===ct.jc.id&&(s===lt.Bc?(this.add(r,h,a|o),this.add(r-1,h,l),this.add(r,h+1,c)):s===lt.Pc?(this.add(r,h,a|l),this.add(r,h+1,c),this.add(r+1,h,o)):s===lt.Uc?(this.add(r,h,c|l),this.add(r+1,h,o),this.add(r,h-1,a)):s===lt.Wc&&(this.add(r,h,c|o),this.add(r,h-1,a),this.add(r-1,h,l))),n&&this.If(t,i,e,s,!1)};Cf=(t,i,e,s,n)=>{const r=t-this.offsetX,h=i-this.mf,o=n?ot.Cc:ot.uc,l=n?ot.Ac:ot.lc,a=n?ot.yc:ot.hc,c=n?ot.gc:ot.cc,f=n?ot.wc:ot.rc,u=n?ot._c:ot.ac,d=n?ot.mc:ot.oc,w=n?ot.Ic:ot.fc;e===ct.Kc.id?s===lt.Bc?(this.remove(r,h,o),this.remove(r-1,h,l)):s===lt.Pc?(this.remove(r,h,a),this.remove(r,h+1,c)):s===lt.Uc?(this.remove(r,h,l),this.remove(r+1,h,o)):s===lt.Wc&&(this.remove(r,h,c),this.remove(r,h-1,a)):e===ct.Xc.id||e===ct.zc.id?s===lt.Bc?(this.remove(r,h,f),this.remove(r-1,h+1,u)):s===lt.Pc?(this.remove(r,h,d),this.remove(r+1,h+1,w)):s===lt.Uc?(this.remove(r,h,u),this.remove(r+1,h-1,f)):s===lt.Wc&&(this.remove(r,h,w),this.remove(r-1,h-1,d)):e===ct.jc.id&&(s===lt.Bc?(this.remove(r,h,a|o),this.remove(r-1,h,l),this.remove(r,h+1,c)):s===lt.Pc?(this.remove(r,h,a|l),this.remove(r,h+1,c),this.remove(r+1,h,o)):s===lt.Uc?(this.remove(r,h,c|l),this.remove(r+1,h,o),this.remove(r,h-1,a)):s===lt.Wc&&(this.remove(r,h,c|o),this.remove(r,h-1,a),this.remove(r-1,h,l))),n&&this.Cf(t,i,e,s,!1)};Ef=(t,i,e,s,n,r)=>{if(t===e&&i===s)return!0;const h=t-this.offsetX,o=i-this.mf,l=e-this.offsetX,a=s-this.mf,c=ut.index(h,o);if(n===ct.Kc.id){if(r===lt.Bc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.xc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.vc)===ot.OPEN)return!0}else if(r===lt.Pc){if(h===l&&o===a+1)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.Lc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.kc)===ot.OPEN)return!0}else if(r===lt.Uc){if(h===l+1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.xc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.vc)===ot.OPEN)return!0}else if(r===lt.Wc){if(h===l&&o===a-1)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.Lc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.kc)===ot.OPEN)return!0}}else if(n===ct.jc.id){if(r===lt.Bc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.kc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.vc)===ot.OPEN)return!0}else if(r===lt.Pc){if(h===l-1&&o===a&&(this.flags[c]&ot.Lc)===ot.OPEN)return!0;if(h===l&&o===a+1)return!0;if(h===l+1&&o===a)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.vc)===ot.OPEN)return!0}else if(r===lt.Uc){if(h===l-1&&o===a&&(this.flags[c]&ot.Lc)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.xc)===ot.OPEN)return!0;if(h===l+1&&o===a)return!0;if(h===l&&o===a-1)return!0}else if(r===lt.Wc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.xc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.kc)===ot.OPEN)return!0;if(h===l&&o===a-1)return!0}}else if(n===ct.tf.id){if(h===l&&o===a+1&&(this.flags[c]&ot.cc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.hc)===ot.OPEN)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.lc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.uc)===ot.OPEN)return!0}return!1};Tf=(t,i,e,s,n,r)=>{if(t===e&&i===s)return!0;const h=t-this.offsetX,o=i-this.mf,l=e-this.offsetX,a=s-this.mf,c=ut.index(h,o);if(n===ct.Jc.id||n===ct.$c.id){if(n===ct.$c.id&&(r=r+2&3),r===lt.Bc){if(h===l+1&&o===a&&(this.flags[c]&ot.uc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.hc)===ot.OPEN)return!0}else if(r===lt.Pc){if(h===l-1&&o===a&&(this.flags[c]&ot.lc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.hc)===ot.OPEN)return!0}else if(r===lt.Uc){if(h===l-1&&o===a&&(this.flags[c]&ot.lc)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.cc)===ot.OPEN)return!0}else if(r===lt.Wc){if(h===l+1&&o===a&&(this.flags[c]&ot.uc)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.cc)===ot.OPEN)return!0}}else if(n===ct.Qc.id){if(h===l&&o===a+1&&(this.flags[c]&ot.cc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.hc)===ot.OPEN)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.lc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.uc)===ot.OPEN)return!0}return!1};bf=(t,i,e,s,n,r,h)=>{const o=e+n-1,l=s+r-1,a=ut.index(t-this.offsetX,i-this.mf);return t>=e&&t<=o&&i>=s&&i<=l||(t===e-1&&i>=s&&i<=l&&(this.flags[a]&ot.lc)===ot.OPEN&&(h&ft.Bc)===ot.OPEN||(t===o+1&&i>=s&&i<=l&&(this.flags[a]&ot.uc)===ot.OPEN&&(h&ft.Uc)===ot.OPEN||(i===s-1&&t>=e&&t<=o&&(this.flags[a]&ot.hc)===ot.OPEN&&(h&ft.Wc)===ot.OPEN||i===l+1&&t>=e&&t<=o&&(this.flags[a]&ot.cc)===ot.OPEN&&(h&ft.Pc)===ot.OPEN)))};add=(t,i,e)=>{this.flags[ut.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[ut.index(t,i)]&=ot.Fc-e}}class dt{y;x;z;model;La;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.La=n,this.info=r}}class wt{y;x;z;Of;Rf;vf;Lf;La;info;constructor(t,i,e,s,n,r,h,o,l){this.y=t,this.x=i,this.z=e,this.Of=s,this.Rf=n,this.vf=r,this.Lf=h,this.La=o,this.info=l}}class yt{y;x;z;type;angle;model;La;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.La=h,this.info=o}}class mt{y;x;z;Sf;xf;Mf;La;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.Sf=s,this.xf=n,this.Mf=r,this.La=h,this.offset=o}}class pt{kf;Df;Nf;Ff;Bf;color;flat;constructor(t,i,e,s,n,r,h){this.kf=t,this.Df=i,this.Nf=e,this.Ff=s,this.Bf=n,this.color=r,this.flat=h}}class At{static Pf=new Int32Array(6);static Uf=new Int32Array(6);static Wf=new Int32Array(6);static Gf=new Int32Array(6);static Yf=new Int32Array(6);static Hf=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static Vf=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static Kf=128;static Xf=this.Kf/2|0;static jf=this.Kf/4|0;static zf=3*this.Kf/4|0;cr;er;ur;Zf;qf;Jf;$f;Qf;tu;iu;flat;shape;angle;eu;su;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,m,p,A){this.flat=!(m!==s||m!==d||m!==o),this.shape=i,this.angle=r,this.eu=u,this.su=l;const _=At.Hf[i],g=_.length;this.cr=new Int32Array(g),this.er=new Int32Array(g),this.ur=new Int32Array(g);const I=new Int32Array(g),C=new Int32Array(g),E=t*At.Kf,T=p*At.Kf;for(let t=0;t8&&g<=12&&(g=9+(g-r-9&3)),g>12&&g<=16&&(g=13+(g-r-13&3)),1===g?(i=E,l=T,c=m,u=h,p=a):2===g?(i=E+At.Xf,l=T,c=m+s>>1,u=h+A>>1,p=a+e>>1):3===g?(i=E+At.Kf,l=T,c=s,u=A,p=e):4===g?(i=E+At.Kf,l=T+At.Xf,c=s+d>>1,u=A+n>>1,p=e+w>>1):5===g?(i=E+At.Kf,l=T+At.Kf,c=d,u=n,p=w):6===g?(i=E+At.Xf,l=T+At.Kf,c=d+o>>1,u=n+y>>1,p=w+f>>1):7===g?(i=E,l=T+At.Kf,c=o,u=y,p=f):8===g?(i=E,l=T+At.Xf,c=o+m>>1,u=y+h>>1,p=f+a>>1):9===g?(i=E+At.Xf,l=T+At.jf,c=m+s>>1,u=h+A>>1,p=a+e>>1):10===g?(i=E+At.zf,l=T+At.Xf,c=s+d>>1,u=A+n>>1,p=e+w>>1):11===g?(i=E+At.Xf,l=T+At.zf,c=d+o>>1,u=n+y>>1,p=w+f>>1):12===g?(i=E+At.jf,l=T+At.Xf,c=o+m>>1,u=y+h>>1,p=f+a>>1):13===g?(i=E+At.jf,l=T+At.jf,c=m,u=h,p=a):14===g?(i=E+At.zf,l=T+At.jf,c=s,u=A,p=e):15===g?(i=E+At.zf,l=T+At.zf,c=d,u=n,p=w):(i=E+At.jf,l=T+At.zf,c=o,u=y,p=f),this.cr[t]=i,this.er[t]=c,this.ur[t]=l,I[t]=u,C[t]=p}const b=At.Vf[i],O=b.length/4|0;this.$f=new Int32Array(O),this.Qf=new Int32Array(O),this.tu=new Int32Array(O),this.Zf=new Int32Array(O),this.qf=new Int32Array(O),this.Jf=new Int32Array(O),this.iu=-1!==c?new Int32Array(O):null;let R=0;for(let t=0;t{this._u=0,this.gu=0,this.Iu=t,this.Cu=i,this.Eu=t/2|0,this.Tu=i/2|0;const r=new x(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.bu=N.sin[t],this.Ou=N.cos[t],this.Ru=N.sin[i],this.vu=N.cos[i];const h=(t-128)/32|0,o=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const l=128*t,a=128*i;let c=!1;for(let t=-e;t<=s;t+=128)if(this.hd(l,a,n[h]+t)){c=!0;break}r[h][o][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let h=-1;h<=1;h++)for(let o=-1;o<=1;o++){if(r[t][i][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t][(i+1)%31][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t+1][i][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t+1][(i+1)%31][e+h+25+1][s+o+25+1]){n=!0;break t}}this.du[t][i][e+25][s+25]=n}};static Xi=()=>{this.wu=null,this.yu=null,this.mu=null,this.Au=null,this.du=null,this.pu=null,this.Gu=null,console.log('World3D unloaded!')};static od=(t,i,e,s,n,r,h,o)=>{gt.mu[t][gt.yu[t]++]=new ht(e/128|0,r/128|0,n/128|0,o/128|0,i,e,r,n,o,s,h)};static hd=(t,i,e)=>{const s=i*this.Ru+t*this.vu>>16,n=i*this.vu-t*this.Ru>>16,r=e*this.bu+n*this.Ou>>16,h=e*this.Ou-n*this.bu>>16;if(r<50||r>3500)return!1;const o=this.Eu+((s<<9)/r|0),l=this.Tu+((h<<9)/r|0);return o>=this._u&&o<=this.Iu&&l>=this.gu&&l<=this.Cu};ld;qa;$a;ad;fd;ud;dd;wd;yd;md=0;pd=0;Ad=0;constructor(t,i,e,s){this.ld=e,this.qa=s,this.$a=i,this.fd=new S(e,s,i,null),this.dd=new D(e,s+1,i+1),this.ad=t,this.ud=new v(5e3,null),this.wd=new Int32Array(1e4),this.yd=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.pd=t;for(let i=0;i{const e=this.fd[0][t][i];for(let e=0;e<3;e++){this.fd[e][t][i]=this.fd[e+1][t][i];const s=this.fd[e][t][i];s&&s.level--}this.fd[0][t][i]||(this.fd[0][t][i]=new rt(0,t,i));const s=this.fd[0][t][i];s&&(s.Wa=e),this.fd[3][t][i]=null};Id=(t,i,e,s)=>{const n=this.fd[t][i][e];n&&(n.Ha=s)};Cd=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,m,p,A,_)=>{if(s===_t.nu){for(let s=t;s>=0;s--)this.fd[s][i][e]||(this.fd[s][i][e]=new rt(s,i,e));const s=this.fd[t][i][e];s&&(s.Da=new pt(c,f,u,d,-1,A,!1))}else if(s===_t.ru){for(let s=t;s>=0;s--)this.fd[s][i][e]||(this.fd[s][i][e]=new rt(s,i,e));const s=this.fd[t][i][e];s&&(s.Da=new pt(w,y,m,p,r,_,h===o&&h===l&&h===a))}else{for(let s=t;s>=0;s--)this.fd[s][i][e]||(this.fd[s][i][e]=new rt(s,i,e));const g=this.fd[t][i][e];g&&(g.Na=new At(i,s,y,o,u,n,c,a,_,w,r,p,A,l,m,d,h,e,f))}};Ed=(t,i,e,s,n,r,h)=>{this.fd[i][e][s]||(this.fd[i][e][s]=new rt(i,e,s));const o=this.fd[i][e][s];o&&(o.Pa=new dt(n,128*e+64,128*s+64,t,r,h))};Td=(t,i,e)=>{const s=this.fd[t][i][e];s&&(s.Pa=null)};bd=(t,i,e,s,n,r,h,o)=>{let l=0;const a=this.fd[s][t][i];if(a)for(let t=0;tl&&(l=e)}else this.fd[s][t][i]=new rt(s,t,i);const c=this.fd[s][t][i];c&&(c.Ua=new mt(e,128*t+64,128*i+64,r,h,o,n,l))};Od=(t,i,e)=>{const s=this.fd[t][i][e];s&&(s.Ua=null)};If=(t,i,e,s,n,r,h,o,l,a)=>{if(!h&&!o)return;for(let s=t;s>=0;s--)this.fd[s][i][e]||(this.fd[s][i][e]=new rt(s,i,e));const c=this.fd[t][i][e];c&&(c.Fa=new wt(s,128*i+64,128*e+64,n,r,h,o,l,a))};Cf=(t,i,e,s)=>{const n=this.fd[t][i][e];1===s&&n&&(n.Fa=null)};Rd=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!o)return;for(let s=t;s>=0;s--)this.fd[s][i][e]||(this.fd[s][i][e]=new rt(s,i,e));const f=this.fd[t][i][e];f&&(f.Ba=new yt(s,128*i+n+64,128*e+r+64,c,a,o,h,l))};vd=(t,i,e)=>{const s=this.fd[t][i][e];s&&(s.Ba=null)};Ld=(t,i,e,s)=>{const n=this.fd[t][i][e];if(!n)return;const r=n.Ba;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};Sd=(t,i,e,s)=>{if(!s)return;const n=this.fd[t][i][e];if(!n)return;const r=n.Ba;r&&(r.model=s)};xd=(t,i,e,s)=>{if(!s)return;const n=this.fd[t][i][e];if(!n)return;const r=n.Pa;r&&(r.model=s)};Md=(t,i,e,s)=>{if(!s)return;const n=this.fd[t][i][e];if(!n)return;const r=n.Fa;r&&(r.vf=s)};kd=(t,i,e,s,n)=>{if(!s)return;const r=this.fd[e][t][i];if(!r)return;const h=r.Fa;h&&(h.vf=s,h.Lf=n)};_f=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!n&&!r)return!0;const f=128*i+64*l,u=128*e+64*a;return this.Dd(f,u,s,t,i,e,l,a,n,r,h,o,c,!1)};Nd=(t,i,e,s,n,r,h,o,l,a)=>{if(!n&&!r)return!0;let c=i-l,f=s-l,u=i+l,d=s+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Dd(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};Fd=(t,i,e,s,n,r,h,o,l,a,c,f)=>!l&&!a||this.Dd(i,s,e,t,n,r,h+1-n,o-r+1,l,a,c,0,f,!0);gf=(t,i,e)=>{const s=this.fd[t][i][e];if(s)for(let t=0;t>29&3)&&n.ba===i&&n.Ra===e)return void this.Bd(n)}};Pd=(t,i,e,s)=>{if(!s)return;const n=this.fd[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};Ud=()=>{for(let t=0;t{const s=this.fd[t][i][e];return s&&s.Fa?s.Fa.La:0};Gd=(t,i,e)=>{const s=this.fd[t][e][i];return s&&s.Ba?s.Ba.La:0};Yd=(t,i,e)=>{const s=this.fd[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.ba===i&&n.Ra===e)return n.La}return 0};Hd=(t,i,e)=>{const s=this.fd[t][i][e];return s&&s.Pa?s.Pa.La:0};Vd=(t,i,e,s)=>{const n=this.fd[t][i][e];if(n){if(n.Fa&&n.Fa.La===s)return 255&n.Fa.info;if(n.Ba&&n.Ba.La===s)return 255&n.Ba.info;if(n.Pa&&n.Pa.La===s)return 255&n.Pa.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.fd[t][i+1][e-1];n&&n.Pa&&n.Pa.model&&n.Pa.model.lr&&this.jd(s,n.Pa.model,128,0,-128,!0)}};Xd=(t,i,e,s,n,r)=>{let h=!0,o=i;const l=i+s,a=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.ld){for(let u=o;u<=l;u++)if(!(u<0||u>=this.qa))for(let o=a;o<=c;o++){if(o<0||o>=this.$a||h&&u=e||u===i))continue;const a=this.fd[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.ad[f][u][o]+this.ad[f][u+1][o]+this.ad[f][u][o+1]+this.ad[f][u+1][o+1])/4|0)-((this.ad[t][i][e]+this.ad[t][i+1][e]+this.ad[t][i][e+1]+this.ad[t][i+1][e+1])/4|0),m=a.Fa;m&&m.vf&&m.vf.lr&&this.jd(r,m.vf,d,y,w,h),m&&m.Lf&&m.Lf.lr&&this.jd(r,m.Lf,d,y,w,h);for(let t=0;t{this.Ad++;let h=0;const o=i.cr,l=i.$s;if(t.lr&&t.ar)for(let r=0;ri.Rr)continue;const u=t.cr[r]-e;if(ui.Er)continue;const d=t.ur[r]-n;if(di.br)continue;if(i.lr&&i.ar)for(let t=0;t{const h=this.fd[t][i][e];if(!h)return;const o=h.Da;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const l=h.Na;if(!l)return;const a=l.shape,c=l.angle,f=l.eu,u=l.su,d=gt.Qu[a],w=gt.td[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{gt.Wu=!0,gt.Ve=t,gt.Ke=i,gt.nd=-1,gt.rd=-1};draw=(t,i,e,s,n,r,h)=>{t<0?t=0:t>=128*this.qa&&(t=128*this.qa-1),e<0?e=0:e>=128*this.$a&&(e=128*this.$a-1),gt.Wi++,gt.bu=N.sin[r],gt.Ou=N.cos[r],gt.Ru=N.sin[n],gt.vu=N.cos[n],gt.Gu=gt.du[(r-128)/32|0][n/64|0],gt.Lu=t,gt.Su=i,gt.xu=e,gt.Mu=t/128|0,gt.ku=e/128|0,gt.Pu=s,gt.Du=gt.Mu-25,gt.Du<0&&(gt.Du=0),gt.Fu=gt.ku-25,gt.Fu<0&&(gt.Fu=0),gt.Nu=gt.Mu+25,gt.Nu>this.qa&&(gt.Nu=this.qa),gt.Bu=gt.ku+25,gt.Bu>this.$a&&(gt.Bu=this.$a),this.qd(),gt.Uu=0;for(let t=this.pd;t=2e3)?(h.visible=!0,h.update=!0,h.Va=h.Ga>0,gt.Uu++):(h.visible=!1,h.update=!1,h.Ka=0))}}for(let t=this.pd;t=gt.Nu))for(let t=-25;t<=0;t++){const n=gt.ku+t,r=gt.ku-t;let o;if(e>=gt.Du&&(n>=gt.Fu&&(o=i[e][n],o&&o.visible&&this.Jd(o,!0,h)),r=gt.Fu&&(o=i[s][n],o&&o.visible&&this.Jd(o,!0,h)),r=gt.Nu))for(let t=-25;t<=0;t++){const n=gt.ku+t,r=gt.ku-t;let o;if(e>=gt.Du&&(n>=gt.Fu&&(o=i[e][n],o&&o.visible&&this.Jd(o,!1,h)),r=gt.Fu&&(o=i[s][n],o&&o.visible&&this.Jd(o,!1,h)),r{if(!l&&!a)return!1;for(let t=n;t=this.qa||i>=this.$a)return!1;const e=this.fd[s][t][i];if(e&&e.Ga>=5)return!1}const w=new nt(s,e,t,i,l,a,u,n,n+h-1,r,r+o-1,c,f);for(let t=n;tn&&(e|=1),tr&&(e+=8),i=0;e--)this.fd[e][t][i]||(this.fd[e][t][i]=new rt(e,t,i));const l=this.fd[s][t][i];l&&(l.Ma[l.Ga]=w,l.ka[l.Ga]=e,l.Ya|=e,l.Ga++)}return d&&(this.ud[this.md++]=w),!0};Bd=t=>{for(let i=t.ba;i<=t.Oa;i++)for(let e=t.Ra;e<=t.va;e++){const s=this.fd[t.level][i][e];if(s){for(let i=0;i{const t=gt.yu[gt.Pu],i=gt.mu[gt.Pu];gt.sd=0;for(let e=0;e=0&&s<=50){n=t.Ja+25-gt.ku,n<0&&(n=0),r=t.$a+25-gt.ku,r>50&&(r=50);let i=!1;for(;n<=r;)if(gt.Gu&>.Gu[s][n++]){i=!0;break}if(i){if(h=gt.Lu-t.Cr,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.ic=(t.Tr-gt.xu<<8)/h|0,t.ec=(t.br-gt.xu<<8)/h|0,t.sc=(t.Rr-gt.Su<<8)/h|0,t.nc=(t.vr-gt.Su<<8)/h|0,gt.pu[gt.sd++]=t}}}else if(2===t.type){if(s=t.Ja+25-gt.ku,s>=0&&s<=50){n=t.Za+25-gt.Mu,n<0&&(n=0),r=t.qa+25-gt.Mu,r>50&&(r=50);let i=!1;for(;n<=r;)if(gt.Gu&>.Gu[n++][s]){i=!0;break}if(i){if(h=gt.xu-t.Tr,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.Qa=(t.Cr-gt.Lu<<8)/h|0,t.tc=(t.Er-gt.Lu<<8)/h|0,t.sc=(t.Rr-gt.Su<<8)/h|0,t.nc=(t.vr-gt.Su<<8)/h|0,gt.pu[gt.sd++]=t}}}else if(4===t.type&&(s=t.Rr-gt.Su,s>128&&(n=t.Ja+25-gt.ku,n<0&&(n=0),r=t.$a+25-gt.ku,r>50&&(r=50),n<=r))){let i=t.Za+25-gt.Mu;i<0&&(i=0),h=t.qa+25-gt.Mu,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(gt.Gu&>.Gu[t][i]){e=!0;break t}e&&(t.mode=5,t.Qa=(t.Cr-gt.Lu<<8)/s|0,t.tc=(t.Er-gt.Lu<<8)/s|0,t.ic=(t.Tr-gt.xu<<8)/s|0,t.ec=(t.br-gt.xu<<8)/s|0,gt.pu[gt.sd++]=t)}}};Jd=(t,i,e)=>{for(gt.Au.St(t);;){let t;do{if(t=gt.Au.Mt(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.xa,o=this.fd[r];if(t.visible){if(i){if(r>0){const t=this.fd[r-1][s][n];if(t&&t.update)continue}if(s<=gt.Mu&&s>gt.Du){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.Ya)))continue}if(s>=gt.Mu&&sgt.Fu){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.Ya)))continue}if(n>=gt.ku&&nn&&(a+=6),c=gt.Yu[a],t.za=gt.Vu[a]),f&&(f.Of>.Hu[a]?16===f.Of?(t.Ka=3,t.Xa=gt.Ku[a],t.ja=3-t.Xa):32===f.Of?(t.Ka=6,t.Xa=gt.Xu[a],t.ja=6-t.Xa):64===f.Of?(t.Ka=12,t.Xa=gt.ju[a],t.ja=12-t.Xa):(t.Ka=9,t.Xa=gt.zu[a],t.ja=9-t.Xa):t.Ka=0,f.Of&c&&!this.iw(h,s,n,f.Of)&&f.vf?.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,f.x-gt.Lu,f.y-gt.Su,f.z-gt.xu,f.La),f.Rf&c&&!this.iw(h,s,n,f.Rf)&&f.Lf?.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,f.x-gt.Lu,f.y-gt.Su,f.z-gt.xu,f.La)),u&&!this.visible(h,s,n,u.model.vr))if(u.type&c)u.model.draw(u.angle,gt.bu,gt.Ou,gt.Ru,gt.vu,u.x-gt.Lu,u.y-gt.Su,u.z-gt.xu,u.La);else if(768&u.type){const t=u.x-gt.Lu,i=u.y-gt.Su,e=u.z-gt.xu,s=u.angle;let n,r;if(n=s===lt.Pc||s===lt.Uc?-t:t,r=s===lt.Uc||s===lt.Wc?-e:e,256&u.type&&rn){const n=t+gt.Ju[s],r=e+gt.$u[s];u.model.draw(512*s+1280&2047,gt.bu,gt.Ou,gt.Ru,gt.vu,n,i,r,u.La)}}if(l){const i=t.Pa;i&&i.model?.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,i.x-gt.Lu,i.y-gt.Su,i.z-gt.xu,i.La);const e=t.Ua;e&&0===e.offset&&(e.Mf&&e.Mf.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,e.x-gt.Lu,e.y-gt.Su,e.z-gt.xu,e.La),e.xf&&e.xf.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,e.x-gt.Lu,e.y-gt.Su,e.z-gt.xu,e.La),e.Sf&&e.Sf.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,e.x-gt.Lu,e.y-gt.Su,e.z-gt.xu,e.La))}const d=t.Ya;if(0!==d){if(sgt.Mu&&1&d){const t=o[s-1][n];t&&t.update&>.Au.St(t)}if(n>gt.ku&&8&d){const t=o[s][n-1];t&&t.update&>.Au.St(t)}}}if(0!==t.Ka){let i=!0;for(let e=0;ei.ba&&(r+=1),ei.Ra&&(r+=8),ss&&(s=n);const h=gt.ku-i.Ra,l=i.va-gt.ku;i.Sa=l>h?s+l:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.Sa,i=e))}if(-1===i)break;const l=gt.wu[i];if(l){l.Wi=gt.Wi;let t=l.model;t||(t=l.Ea?.draw(e)??null),t&&!this.ew(h,l.ba,l.Oa,l.Ra,l.va,t.vr)&&t.draw(l.Ta,gt.bu,gt.Ou,gt.Ru,gt.vu,l.x-gt.Lu,l.y-gt.Su,l.z-gt.xu,l.La);for(let t=l.ba;t<=l.Oa;t++)for(let i=l.Ra;i<=l.va;i++){const e=o[t][i];e&&(0!==e.Ka?gt.Au.St(e):t===s&&i===n||!e.update||gt.Au.St(e))}}}if(t.Va)continue}if(!t.update||0!==t.Ka)continue;if(s<=gt.Mu&&s>gt.Du){const t=o[s-1][n];if(t&&t.update)continue}if(s>=gt.Mu&&sgt.Fu){const t=o[s][n-1];if(t&&t.update)continue}if(n>=gt.ku&&n=r){const r=t+gt.Zu[n],h=s+gt.qu[n];i.model.draw(512*n+256,gt.bu,gt.Ou,gt.Ru,gt.vu,r,e,h,i.La)}if(512&i.type&&h<=r){const r=t+gt.Ju[n],h=s+gt.$u[n];i.model.draw(512*n+1280&2047,gt.bu,gt.Ou,gt.Ru,gt.vu,r,e,h,i.La)}}const e=t.Fa;e&&(e.Rf&t.za&&!this.iw(h,s,n,e.Rf)&&e.Lf?.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,e.x-gt.Lu,e.y-gt.Su,e.z-gt.xu,e.La),e.Of&t.za&&!this.iw(h,s,n,e.Of)&&e.vf?.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,e.x-gt.Lu,e.y-gt.Su,e.z-gt.xu,e.La))}if(rgt.Mu){const t=o[s-1][n];t&&t.update&>.Au.St(t)}if(n>gt.ku){const t=o[s][n-1];t&&t.update&>.Au.St(t)}}};Qd=(t,i,e,s,n,r,h,o)=>{let l,a,c,f,u=l=(e<<7)-gt.Lu,d=a=(s<<7)-gt.xu,w=c=u+128,y=f=d+128,p=this.ad[i][e][s]-gt.Su,A=this.ad[i][e+1][s]-gt.Su,_=this.ad[i][e+1][s+1]-gt.Su,g=this.ad[i][e][s+1]-gt.Su,I=d*h+u*o>>16;if(d=d*o-u*h>>16,u=I,I=p*r-d*n>>16,d=p*n+d*r>>16,p=I,d<50)return;if(I=a*h+w*o>>16,a=a*o-w*h>>16,w=I,I=A*r-a*n>>16,a=A*n+a*r>>16,A=I,a<50)return;if(I=y*h+c*o>>16,y=y*o-c*h>>16,c=I,I=_*r-y*n>>16,y=_*n+y*r>>16,_=I,y<50)return;if(I=f*h+l*o>>16,f=f*o-l*h>>16,l=I,I=g*r-f*n>>16,f=g*n+f*r>>16,g=I,f<50)return;const C=N.ki+((u<<9)/d|0),E=N.Di+((p<<9)/d|0),T=N.ki+((w<<9)/a|0),b=N.Di+((A<<9)/a|0),O=N.ki+((c<<9)/y|0),R=N.Di+((_<<9)/y|0),v=N.ki+((l<<9)/f|0),L=N.Di+((g<<9)/f|0);if(N.alpha=0,(O-v)*(b-L)-(R-L)*(T-v)>0)if(N.Fi=O<0||v<0||T<0||O>m.ut||v>m.ut||T>m.ut,gt.Wu&&this.sw(gt.Ve,gt.Ke,R,L,b,O,v,T)&&(gt.nd=e,gt.rd=s),-1===t.Bf)12345678!==t.Nf&&N.ee(O,v,T,R,L,b,t.Nf,t.Ff,t.Df);else if(gt.Ri){const i=gt.ed[t.Bf];N.ee(O,v,T,R,L,b,this.nw(i,t.Nf),this.nw(i,t.Ff),this.nw(i,t.Df))}else t.flat?N.he(O,v,T,R,L,b,t.Nf,t.Ff,t.Df,u,p,d,w,l,A,g,a,f,t.Bf):N.he(O,v,T,R,L,b,t.Nf,t.Ff,t.Df,c,_,y,l,w,g,A,f,a,t.Bf);if(!((C-T)*(L-b)-(E-b)*(v-T)<=0))if(N.Fi=C<0||T<0||v<0||C>m.ut||T>m.ut||v>m.ut,gt.Wu&&this.sw(gt.Ve,gt.Ke,E,b,L,C,T,v)&&(gt.nd=e,gt.rd=s),-1!==t.Bf){if(!gt.Ri)return void N.he(C,T,v,E,b,L,t.kf,t.Df,t.Ff,u,p,d,w,l,A,g,a,f,t.Bf);const i=gt.ed[t.Bf];N.ee(C,T,v,E,b,L,this.nw(i,t.kf),this.nw(i,t.Df),this.nw(i,t.Ff))}else 12345678!==t.kf&&N.ee(C,T,v,E,b,L,t.kf,t.Df,t.Ff)};tw=(t,i,e,s,n,r,h)=>{let o=e.cr.length;for(let t=0;t>16;if(l=l*h-i*r>>16,i=a,a=o*n-l*s>>16,l=o*s+l*n>>16,o=a,l<50)return;e.iu&&(At.Wf[t]=i,At.Gf[t]=o,At.Yf[t]=l),At.Pf[t]=N.ki+((i<<9)/l|0),At.Uf[t]=N.Di+((o<<9)/l|0)}N.alpha=0,o=e.$f.length;for(let s=0;s0)if(N.Fi=o<0||l<0||a<0||o>m.ut||l>m.ut||a>m.ut,gt.Wu&&this.sw(gt.Ve,gt.Ke,c,f,u,o,l,a)&&(gt.nd=t,gt.rd=i),e.iu&&-1!==e.iu[s])if(gt.Ri){const t=gt.ed[e.iu[s]];N.ee(o,l,a,c,f,u,this.nw(t,e.Zf[s]),this.nw(t,e.qf[s]),this.nw(t,e.Jf[s]))}else e.flat?N.he(o,l,a,c,f,u,e.Zf[s],e.qf[s],e.Jf[s],At.Wf[0],At.Gf[0],At.Yf[0],At.Wf[1],At.Wf[3],At.Gf[1],At.Gf[3],At.Yf[1],At.Yf[3],e.iu[s]):N.he(o,l,a,c,f,u,e.Zf[s],e.qf[s],e.Jf[s],At.Wf[n],At.Gf[n],At.Yf[n],At.Wf[r],At.Wf[h],At.Gf[r],At.Gf[h],At.Yf[r],At.Yf[h],e.iu[s]);else 12345678!==e.Zf[s]&&N.ee(o,l,a,c,f,u,e.Zf[s],e.qf[s],e.Jf[s])}};$d=(t,i,e)=>{const s=this.dd[t][i][e];if(s===-gt.Wi)return!1;if(s===gt.Wi)return!0;{const s=i<<7,n=e<<7;return this.rw(s+1,this.ad[t][i][e],n+1)&&this.rw(s+128-1,this.ad[t][i+1][e],n+1)&&this.rw(s+128-1,this.ad[t][i+1][e+1],n+128-1)&&this.rw(s+1,this.ad[t][i][e+1],n+128-1)?(this.dd[t][i][e]=gt.Wi,!0):(this.dd[t][i][e]=-gt.Wi,!1)}};iw=(t,i,e,s)=>{if(!this.$d(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.ad[t][i][e]-1,o=h-120,l=h-230,a=h-238;if(s<16){if(1===s){if(n>gt.Lu){if(!this.rw(n,h,r))return!1;if(!this.rw(n,h,r+128))return!1}if(t>0){if(!this.rw(n,o,r))return!1;if(!this.rw(n,o,r+128))return!1}return!!this.rw(n,l,r)&&this.rw(n,l,r+128)}if(2===s){if(r0){if(!this.rw(n,o,r+128))return!1;if(!this.rw(n+128,o,r+128))return!1}return!!this.rw(n,l,r+128)&&this.rw(n+128,l,r+128)}if(4===s){if(n0){if(!this.rw(n+128,o,r))return!1;if(!this.rw(n+128,o,r+128))return!1}return!!this.rw(n+128,l,r)&&this.rw(n+128,l,r+128)}if(8===s){if(r>gt.xu){if(!this.rw(n,h,r))return!1;if(!this.rw(n+128,h,r))return!1}if(t>0){if(!this.rw(n,o,r))return!1;if(!this.rw(n+128,o,r))return!1}return!!this.rw(n,l,r)&&this.rw(n+128,l,r)}}return!!this.rw(n+64,a,r+64)&&(16===s?this.rw(n,l,r+128):32===s?this.rw(n+128,l,r+128):64===s?this.rw(n+128,l,r):128===s?this.rw(n,l,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.$d(t,i,e)){const n=i<<7,r=e<<7;return this.rw(n+1,this.ad[t][i][e]-s,r+1)&&this.rw(n+128-1,this.ad[t][i+1][e]-s,r+1)&&this.rw(n+128-1,this.ad[t][i+1][e+1]-s,r+128-1)&&this.rw(n+1,this.ad[t][i][e+1]-s,r+128-1)}return!1};ew=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.dd[t][h][o]===-gt.Wi)return!1;o=1+(i<<7);const l=2+(s<<7),a=this.ad[t][i][s]-r;if(!this.rw(o,a,l))return!1;const c=(e<<7)-1;if(!this.rw(c,a,l))return!1;const f=(n<<7)-1;return!!this.rw(o,a,f)&&this.rw(c,a,f)}return!!this.$d(t,i,s)&&(h=i<<7,o=s<<7,this.rw(h+1,this.ad[t][i][s]-r,o+1)&&this.rw(h+128-1,this.ad[t][i+1][s]-r,o+1)&&this.rw(h+128-1,this.ad[t][i+1][s+1]-r,o+128-1)&&this.rw(h+1,this.ad[t][i][s+1]-r,o+128-1))};rw=(t,i,e)=>{for(let s=0;s0){const t=n.Tr+(n.ic*s>>8),r=n.br+(n.ec*s>>8),h=n.Rr+(n.sc*s>>8),o=n.vr+(n.nc*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.Cr;if(s>0){const t=n.Tr+(n.ic*s>>8),r=n.br+(n.ec*s>>8),h=n.Rr+(n.sc*s>>8),o=n.vr+(n.nc*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.Tr-e;if(s>0){const e=n.Cr+(n.Qa*s>>8),r=n.Er+(n.tc*s>>8),h=n.Rr+(n.sc*s>>8),o=n.vr+(n.nc*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.Tr;if(s>0){const e=n.Cr+(n.Qa*s>>8),r=n.Er+(n.tc*s>>8),h=n.Rr+(n.sc*s>>8),o=n.vr+(n.nc*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.Rr;if(s>0){const i=n.Cr+(n.Qa*s>>8),r=n.Er+(n.tc*s>>8),h=n.Tr+(n.ic*s>>8),o=n.br+(n.ec*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};sw=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const l=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*l>0&&l*((i-n)*(r-o)-(t-o)*(e-n))>0};nw=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}class It{id;hw=null;constructor(t){this.id=t}ow(t){for(;;){const i=t.jt;if(0===i)break;this.decode(i,t)}return this}}class Ct extends It{static count=0;static zs=[];static Zs=t=>{const i=new O(t.read('flo.dat'));this.count=i.Zt;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static aw=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static cw=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);fw=0;texture=-1;uw=!1;dw=!0;ww=0;yw=0;mw=0;pw=0;Aw=0;_w=0;decode(t,i){1===t?(this.fw=i.Jt,this.setColor(this.fw)):2===t?this.texture=i.jt:3===t?this.uw=!0:5===t?this.dw=!1:6===t?this.hw=i.ei:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(r=e),s>r&&(r=s);let h=0,o=0;const l=(n+r)/2;n!==r&&(l<.5&&(o=(r-n)/(r+n)),l>=.5&&(o=(r-n)/(2-r-n)),i===r?h=(e-s)/(r-n):e===r?h=(s-i)/(r-n)+2:s===r&&(h=(i-e)/(r-n)+4)),h/=6,this.ww=256*h|0,this.yw=256*o|0,this.mw=256*l|0,this.yw<0?this.yw=0:this.yw>255&&(this.yw=255),this.mw<0?this.mw=0:this.mw>255&&(this.mw=255),this.pw=l>.5?(1-l)*o*512|0:l*o*512|0,this.pw<1&&(this.pw=1),this.Aw=h*this.pw|0;let a=this.ww+(16*Math.random()|0)-8;a<0?a=0:a>255&&(a=255);let c=this.yw+(48*Math.random()|0)-24;c<0?c=0:c>255&&(c=255);let f=this.mw+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255),this._w=Ct.lw(a,c,f)}}class Et extends It{static count=0;static cache=null;static Xs=null;static gw=null;static Iw=0;static Cw=new q(500);static Ew=new q(30);static Zs=t=>{this.Xs=new O(t.read('loc.dat'));const i=new O(t.read('loc.idx'));this.count=i.Zt,this.gw=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.gw||!this.Xs)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Iw=(this.Iw+1)%10;const i=this.cache[this.Iw];return this.Xs.Vt=this.gw[t],i.id=t,i.reset(),i.ow(this.Xs),i.Tw||(i.Tw=new Int32Array(1)),-1===i.bw&&i.Tw&&(i.active=i.Tw.length>0&&i.Tw[0]===ct.if.id,i.Ow&&(i.active=!0)),i};static Xi=()=>{this.Cw=null,this.Ew=null,this.gw=null,this.cache=null,this.Xs=null};Rw=null;Tw=null;name=null;Lw=null;Sw=null;xw=null;width=1;length=1;Mw=!0;kw=!0;active=!1;bw=-1;Dw=!1;Nw=!1;dw=!1;Dl=-1;Fw=!1;Bw=16;Pw=0;Uw=0;Ow=null;Ww=-1;Gw=-1;Yw=!1;Hw=!0;Vw=128;Kw=128;Xw=128;jw=0;zw=0;Zw=0;qw=0;Jw=!1;decode(t,i){if(1===t){const t=i.jt;this.Rw=new Int32Array(t),this.Tw=new Int32Array(t);for(let e=0;e=30&&t<39)this.Ow||(this.Ow=new v(5,null)),this.Ow[t-30]=i.ei,'hidden'===this.Ow[t-30]?.toLowerCase()&&(this.Ow[t-30]=null);else if(40===t){const t=i.jt;this.Sw=new Uint16Array(t),this.xw=new Uint16Array(t);for(let e=0;e=this.Rw.length)return null;let c=this.Rw[o];if(-1===c)return null;const f=this.Yw!==i>3;f&&(c+=65536);let u=Et.Cw?.get(BigInt(c));u||(u=j.model(65535&c),f&&u.th(),Et.Cw?.put(BigInt(c),u));const d=128!==this.Vw||128!==this.Kw||128!==this.Xw,w=0!==this.zw||0!==this.Zw||0!==this.qw;let y=j.Mr(u,!this.Sw,!this.Fw,i===lt.Bc&&-1===h&&!d&&!w);for(-1!==h&&(y.jr(),y.qr(h),y.Br=null,y.Fr=null);i-- >0;)y.Jr();if(this.Sw&&this.xw)for(let t=0;t{const i=new O(t.read('seq.dat'));this.count=i.Zt;for(let t=0;t{let e=this.ip(t+45365,i+91923,4)+(this.ip(t+10294,i+37821,2)-128>>1)+(this.ip(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static ip=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.ep(s,r),l=this.ep(s+1,r),a=this.ep(s,r+1),c=this.ep(s+1,r+1),f=this.sp(o,l,n,e),u=this.sp(a,c,n,e);return this.sp(f,u,h,e)};static sp=(t,i,e,s)=>{const n=65536-N.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static ep=(t,i)=>((this.np(t-1,i-1)+this.np(t+1,i-1)+this.np(t-1,i+1)+this.np(t+1,i+1))/16|0)+((this.np(t-1,i)+this.np(t+1,i)+this.np(t,i-1)+this.np(t,i+1))/8|0)+(this.np(t,i)/4|0);static np=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static _f=(t,i,e,s,n,r,h,o,l,a,c)=>{const f=n[c][i][e],u=n[c][i+1][e],d=n[c][i+1][e+1],w=n[c][i][e+1],y=f+u+d+w>>2,m=Et.get(o);let p=i+(e<<7)+(o<<14)+1073741824|0;m.active||(p+=-2147483648),p|=0;const A=(a<<6)+l<<24>>24;if(l===ct.Vc.id)s?.Ed(m.Ml(ct.Vc.id,a,f,u,d,w,-1),t,i,e,y,p,A),m.Mw&&m.active&&h?.pf(i,e),-1!==m.Dl&&r.St(new Tt(o,t,3,i,e,bt.zs[m.Dl],!0));else if(l===ct.if.id||l===ct.ef.id){const n=m.Ml(ct.if.id,a,f,u,d,w,-1);if(n){let r,h,o=0;l===ct.ef.id&&(o+=256),a===lt.Pc||a===lt.Wc?(r=m.length,h=m.width):(r=m.width,h=m.length),s?._f(t,i,e,y,n,null,p,A,r,h,o)}m.Mw&&h?._f(i,e,m.width,m.length,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,2,i,e,bt.zs[m.Dl],!0))}else if(l>=ct.sf.id)s?._f(t,i,e,y,m.Ml(l,a,f,u,d,w,-1),null,p,A,1,1,0),m.Mw&&h?._f(i,e,m.width,m.length,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,2,i,e,bt.zs[m.Dl],!0));else if(l===ct.Kc.id)s?.If(t,i,e,y,Rt.Xm[a],0,m.Ml(ct.Kc.id,a,f,u,d,w,-1),null,p,A),m.Mw&&h?.If(i,e,l,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,0,i,e,bt.zs[m.Dl],!0));else if(l===ct.Xc.id)s?.If(t,i,e,y,Rt.jm[a],0,m.Ml(ct.Xc.id,a,f,u,d,w,-1),null,p,A),m.Mw&&h?.If(i,e,l,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,0,i,e,bt.zs[m.Dl],!0));else if(l===ct.jc.id){const n=a+1&3;s?.If(t,i,e,y,Rt.Xm[a],Rt.Xm[n],m.Ml(ct.jc.id,a+4,f,u,d,w,-1),m.Ml(ct.jc.id,n,f,u,d,w,-1),p,A),m.Mw&&h?.If(i,e,l,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,0,i,e,bt.zs[m.Dl],!0))}else if(l===ct.zc.id)s?.If(t,i,e,y,Rt.jm[a],0,m.Ml(ct.zc.id,a,f,u,d,w,-1),null,p,A),m.Mw&&h?.If(i,e,l,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,0,i,e,bt.zs[m.Dl],!0));else if(l===ct.tf.id)s?._f(t,i,e,y,m.Ml(l,a,f,u,d,w,-1),null,p,A,1,1,0),m.Mw&&h?._f(i,e,m.width,m.length,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,2,i,e,bt.zs[m.Dl],!0));else if(l===ct.Zc.id)s?.Rd(t,i,e,y,0,0,p,m.Ml(ct.Zc.id,lt.Bc,f,u,d,w,-1),A,512*a,Rt.Xm[a]),-1!==m.Dl&&r.St(new Tt(o,t,1,i,e,bt.zs[m.Dl],!0));else if(l===ct.qc.id){let n=16;if(s){const r=s.Wd(t,i,e);r>0&&(n=Et.get(r>>14&32767).Bw)}s?.Rd(t,i,e,y,Rt.zm[a]*n,Rt.Zm[a]*n,p,m.Ml(ct.Zc.id,lt.Bc,f,u,d,w,-1),A,512*a,Rt.Xm[a]),-1!==m.Dl&&r.St(new Tt(o,t,1,i,e,bt.zs[m.Dl],!0))}else l===ct.Jc.id?(s?.Rd(t,i,e,y,0,0,p,m.Ml(ct.Zc.id,lt.Bc,f,u,d,w,-1),A,a,256),-1!==m.Dl&&r.St(new Tt(o,t,1,i,e,bt.zs[m.Dl],!0))):l===ct.$c.id?(s?.Rd(t,i,e,y,0,0,p,m.Ml(ct.Zc.id,lt.Bc,f,u,d,w,-1),A,a,512),-1!==m.Dl&&r.St(new Tt(o,t,1,i,e,bt.zs[m.Dl],!0))):l===ct.Qc.id&&(s?.Rd(t,i,e,y,0,0,p,m.Ml(ct.Zc.id,lt.Bc,f,u,d,w,-1),A,a,768),-1!==m.Dl&&r.St(new Tt(o,t,1,i,e,bt.zs[m.Dl],!0)))};qa;$a;rp;hp;op;lp;ap;cp;fp;up;dp;wp;yp;mp;pp;Ap;constructor(t,i,e,s){this.qa=t,this.$a=i,this.rp=e,this.hp=s,this.op=new M(ut.wf,t,i),this.lp=new M(ut.wf,t,i),this.ap=new M(ut.wf,t,i),this.cp=new M(ut.wf,t,i),this.Ap=new D(ut.wf,t+1,i+1),this.fp=new M(ut.wf,t+1,i+1),this.up=new k(t+1,i+1),this.dp=new Int32Array(i),this.wp=new Int32Array(i),this.yp=new Int32Array(i),this.mp=new Int32Array(i),this.pp=new Int32Array(i)}_p=(t,i)=>{for(let t=0;t=0&&i[n]?.pf(e,s)}Rt.qm+=(5*Math.random()|0)-2,Rt.qm<-8?Rt.qm=-8:Rt.qm>8&&(Rt.qm=8),Rt.Jm+=(5*Math.random()|0)-2,Rt.Jm<-16?Rt.Jm=-16:Rt.Jm>16&&(Rt.Jm=16);for(let i=0;i>8;for(let t=1;t>2)+(e[l+1][t]>>3)+(e[l][t-1]>>2)+(e[l][t+1]>>3)+(e[l][t]>>1);this.up[l][t]=u-d}for(let t=0;t=0&&s0){const i=Ct.zs[e-1];this.dp[t]+=i.Aw,this.wp[t]+=i.yw,this.yp[t]+=i.mw,this.mp[t]+=i.pw,n=this.pp[t]++}}const r=e-5;if(r>=0&&r0){const i=Ct.zs[e-1];this.dp[t]-=i.Aw,this.wp[t]-=i.yw,this.yp[t]-=i.mw,this.mp[t]-=i.pw,n=this.pp[t]--}}}if(e>=1&&e=0&&a=0&&c=1&&l0||c>0){const f=this.rp[i][e][l],u=this.rp[i][e+1][l],d=this.rp[i][e+1][l+1],w=this.rp[i][e][l+1],y=this.up[e][l],m=this.up[e+1][l],p=this.up[e+1][l+1],A=this.up[e][l+1];let _=-1,g=-1;if(a>0){const t=256*s/h|0,i=n/o|0;let e=r/o|0;_=Ct.lw(t,i,e);const l=t+Rt.qm&255;e+=Rt.Jm,e<0?e=0:e>255&&(e=255),g=Ct.lw(l,i,e)}if(i>0){let t=0!==a||this.ap[i][e][l]===_t.nu;c>0&&!Ct.zs[c-1].dw&&(t=!1),t&&f===u&&f===d&&f===w&&(this.Ap[i][e][l]|=2340)}let I=0;if(-1!==_&&(I=N.palette[Ct.aw(g,96)]),0===c)t?.Cd(i,e,l,_t.nu,lt.Bc,-1,f,u,d,w,Ct.aw(_,y),Ct.aw(_,m),Ct.aw(_,p),Ct.aw(_,A),Ot.gy,Ot.gy,Ot.gy,Ot.gy,I,Ot.gy);else{const s=this.ap[i][e][l]+1,n=this.cp[i][e][l],r=Ct.zs[c-1];let h,o,a=r.texture;a>=0?(o=N.Ji(a),h=-1):r.fw===Ot.Ay?(o=0,h=-2,a=-1):(h=Ct.lw(r.ww,r.yw,r.mw),o=N.palette[Ct.cw(r._w,96)]),t?.Cd(i,e,l,s,n,a,f,u,d,w,Ct.aw(_,y),Ct.aw(_,m),Ct.aw(_,p),Ct.aw(_,A),Ct.cw(h,y),Ct.cw(h,m),Ct.cw(h,p),Ct.cw(h,A),I,o)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let n=0;n<=s;n++)for(let r=0;r<=this.$a;r++)for(let h=0;h<=this.qa;h++){if(this.Ap[n][h][r]&t){let i=r,e=r,o=n,l=n;for(;i>0&&this.Ap[n][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.Ap[o-1][h][s]&t))break t;o--}t:for(;l=8){const n=this.rp[l][h][i]-240,r=this.rp[o][h][i];gt.od(s,1,128*h,n,128*i,128*h,r,128*e+128);for(let s=o;s<=l;s++)for(let n=i;n<=e;n++)this.Ap[s][h][n]&=~t}}if(this.Ap[n][h][r]&i){let t=h,e=h,o=n,l=n;for(;t>0&&this.Ap[n][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.Ap[o-1][s][r]&i))break t;o--}t:for(;l=8){const n=this.rp[l][t][r]-240,h=this.rp[o][t][r];gt.od(s,2,128*t,n,128*r,128*e+128,h,128*r);for(let s=o;s<=l;s++)for(let n=t;n<=e;n++)this.Ap[s][n][r]&=~i}}if(this.Ap[n][h][r]&e){let t=h,i=h,o=r,l=r;for(;o>0&&this.Ap[n][h][o-1]&e;)o--;for(;l0;){for(let i=o;i<=l;i++)if(!(this.Ap[n][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.rp[n][t][o];gt.od(s,4,128*t,r,128*o,128*i+128,r,128*l+128);for(let s=t;s<=i;s++)for(let t=o;t<=l;t++)this.Ap[n][s][t]&=~e}}}}}};Ip=(t,i,e,s)=>{let n=0;for(let t=0;t>24;break}for(let r=t;r=0&&t=0&&r{const r=new O(new Uint8Array(n));for(let n=0;n=0&&l=0&&a>24,this.cp[n][l][a]=(c-2&3)<<24>>24):c<=81?this.hp[n][l][a]=c-49<<24>>24:this.op[n][l][a]=c-81<<24>>24}else for(;c=r.jt,0!==c;){if(1===c){r.jt;break}c<=49&&r.jt}}};Ep=(t,i,e,s,n,r)=>{const h=new O(new Uint8Array(s));let o=-1;for(;;){const s=h.ii;if(0===s)return;o+=s;let l=0;for(;;){const s=h.ii;if(0===s)break;l+=s-1;const a=63&l,c=l>>6&63,f=l>>12,u=h.jt,d=u>>2,w=3&u,y=c+n,m=a+r;if(y>0&&m>0&&y=0&&(n=e[s]),this._f(f,y,m,t,i,n,o,d,w)}}}};_f=(t,i,e,s,n,r,h,o,l)=>{if(Rt.Ri){if(16&this.hp[t][i][e])return;if(this.gp(t,i,e)!==Rt.$m)return}const a=this.rp[t][i][e],c=this.rp[t][i+1][e],f=this.rp[t][i+1][e+1],u=this.rp[t][i][e+1],d=a+c+f+u>>2,w=Et.get(h);let y=i+(e<<7)+(h<<14)+1073741824|0;w.active||(y+=-2147483648),y|=0;const m=(l<<6)+o<<24>>24;if(o===ct.Vc.id)(!Rt.Ri||w.active||w.Jw)&&(s?.Ed(w.Ml(ct.Vc.id,l,a,c,f,u,-1),t,i,e,d,y,m),w.Mw&&w.active&&r?.pf(i,e),-1!==w.Dl&&n.St(new Tt(h,t,3,i,e,bt.zs[w.Dl],!0)));else if(o===ct.if.id||o===ct.ef.id){const p=w.Ml(ct.if.id,l,a,c,f,u,-1);if(p){let n,r,h=0;if(o===ct.ef.id&&(h+=256),l===lt.Pc||l===lt.Wc?(n=w.length,r=w.width):(n=w.width,r=w.length),s?._f(t,i,e,d,p,null,y,m,n,r,h)&&w.Hw)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=p.Or/4|0;r>30&&(r=30),r>this.fp[t][i+s][e+n]&&(this.fp[t][i+s][e+n]=r<<24>>24)}}w.Mw&&r?._f(i,e,w.width,w.length,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,2,i,e,bt.zs[w.Dl],!0))}else if(o>=ct.sf.id)s?._f(t,i,e,d,w.Ml(o,l,a,c,f,u,-1),null,y,m,1,1,0),o>=ct.sf.id&&o<=ct.af.id&&o!==ct.nf.id&&t>0&&(this.Ap[t][i][e]|=2340),w.Mw&&r?._f(i,e,w.width,w.length,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,2,i,e,bt.zs[w.Dl],!0));else if(o===ct.Kc.id)s?.If(t,i,e,d,Rt.Xm[l],0,w.Ml(ct.Kc.id,l,a,c,f,u,-1),null,y,m),l===lt.Bc?(w.Hw&&(this.fp[t][i][e]=50,this.fp[t][i][e+1]=50),w.dw&&(this.Ap[t][i][e]|=585)):l===lt.Pc?(w.Hw&&(this.fp[t][i][e+1]=50,this.fp[t][i+1][e+1]=50),w.dw&&(this.Ap[t][i][e+1]|=1170)):l===lt.Uc?(w.Hw&&(this.fp[t][i+1][e]=50,this.fp[t][i+1][e+1]=50),w.dw&&(this.Ap[t][i+1][e]|=585)):l===lt.Wc&&(w.Hw&&(this.fp[t][i][e]=50,this.fp[t][i+1][e]=50),w.dw&&(this.Ap[t][i][e]|=1170)),w.Mw&&r?.If(i,e,o,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,0,i,e,bt.zs[w.Dl],!0)),16!==w.Bw&&s?.Ld(t,i,e,w.Bw);else if(o===ct.Xc.id)s?.If(t,i,e,d,Rt.jm[l],0,w.Ml(ct.Xc.id,l,a,c,f,u,-1),null,y,m),w.Hw&&(l===lt.Bc?this.fp[t][i][e+1]=50:l===lt.Pc?this.fp[t][i+1][e+1]=50:l===lt.Uc?this.fp[t][i+1][e]=50:l===lt.Wc&&(this.fp[t][i][e]=50)),w.Mw&&r?.If(i,e,o,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,0,i,e,bt.zs[w.Dl],!0));else if(o===ct.jc.id){const p=l+1&3;s?.If(t,i,e,d,Rt.Xm[l],Rt.Xm[p],w.Ml(ct.jc.id,l+4,a,c,f,u,-1),w.Ml(ct.jc.id,p,a,c,f,u,-1),y,m),w.dw&&(l===lt.Bc?(this.Ap[t][i][e]|=265,this.Ap[t][i][e+1]|=1170):l===lt.Pc?(this.Ap[t][i][e+1]|=1170,this.Ap[t][i+1][e]|=585):l===lt.Uc?(this.Ap[t][i+1][e]|=585,this.Ap[t][i][e]|=1170):l===lt.Wc&&(this.Ap[t][i][e]|=1170,this.Ap[t][i][e]|=585)),w.Mw&&r?.If(i,e,o,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,0,i,e,bt.zs[w.Dl],!0)),16!==w.Bw&&s?.Ld(t,i,e,w.Bw)}else if(o===ct.zc.id)s?.If(t,i,e,d,Rt.jm[l],0,w.Ml(ct.zc.id,l,a,c,f,u,-1),null,y,m),w.Hw&&(l===lt.Bc?this.fp[t][i][e+1]=50:l===lt.Pc?this.fp[t][i+1][e+1]=50:l===lt.Uc?this.fp[t][i+1][e]=50:l===lt.Wc&&(this.fp[t][i][e]=50)),w.Mw&&r?.If(i,e,o,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,0,i,e,bt.zs[w.Dl],!0));else if(o===ct.tf.id)s?._f(t,i,e,d,w.Ml(o,l,a,c,f,u,-1),null,y,m,1,1,0),w.Mw&&r?._f(i,e,w.width,w.length,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,2,i,e,bt.zs[w.Dl],!0));else if(o===ct.Zc.id)s?.Rd(t,i,e,d,0,0,y,w.Ml(ct.Zc.id,lt.Bc,a,c,f,u,-1),m,512*l,Rt.Xm[l]),-1!==w.Dl&&n.St(new Tt(h,t,1,i,e,bt.zs[w.Dl],!0));else if(o===ct.qc.id){let r=16;if(s){const n=s.Wd(t,i,e);n>0&&(r=Et.get(n>>14&32767).Bw)}s?.Rd(t,i,e,d,Rt.zm[l]*r,Rt.Zm[l]*r,y,w.Ml(ct.Zc.id,lt.Bc,a,c,f,u,-1),m,512*l,Rt.Xm[l]),-1!==w.Dl&&n.St(new Tt(h,t,1,i,e,bt.zs[w.Dl],!0))}else o===ct.Jc.id?(s?.Rd(t,i,e,d,0,0,y,w.Ml(ct.Zc.id,lt.Bc,a,c,f,u,-1),m,l,256),-1!==w.Dl&&n.St(new Tt(h,t,1,i,e,bt.zs[w.Dl],!0))):o===ct.$c.id?(s?.Rd(t,i,e,d,0,0,y,w.Ml(ct.Zc.id,lt.Bc,a,c,f,u,-1),m,l,512),-1!==w.Dl&&n.St(new Tt(h,t,1,i,e,bt.zs[w.Dl],!0))):o===ct.Qc.id&&(s?.Rd(t,i,e,d,0,0,y,w.Ml(ct.Zc.id,lt.Bc,a,c,f,u,-1),m,l,768),-1!==w.Dl&&n.St(new Tt(h,t,1,i,e,bt.zs[w.Dl],!0)))};gp=(t,i,e)=>8&this.hp[t][i][e]?0:t<=0||!(2&this.hp[1][i][e])?t:t-1}class vt extends w{}class Lt extends vt{x=0;z=0;Ta=0;Tp=!1;size=1;bp=-1;Op=-1;Rp=-1;vp=-1;Lp=-1;Sp=-1;xp=-1;Mp=null;kp=100;Dp=0;Np=0;Fp=0;Bp=0;Pp=-1e3;Up=0;Wp=0;Gp=-1;Yp=0;Hp=0;Vp=-1;Kp=0;Xp=0;jp=-1;zp=0;Zp=0;qp=0;Jp=0;$p=-1;Qp=0;tA=0;iA=0;eA=0;sA=0;nA=0;rA=0;hA=0;oA=0;lA=0;aA=0;Wi=0;height=0;cA=0;pathLength=0;fA=new Int32Array(10);uA=new Int32Array(10);dA=new v(10,!1);wA=0;yA=-1;mA=-1;pA=-1;AA=-1;move(t,i,e){if(-1!==this.jp&&bt.zs[this.jp].priority<=1&&(this.jp=-1),!t){const t=i-this.fA[0],s=e-this.uA[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.fA[t]=this.fA[t-1],this.uA[t]=this.uA[t-1],this.dA[t]=this.dA[t-1];return this.fA[0]=i,this.uA[0]=e,void(this.dA[0]=!1)}}this.pathLength=0,this.wA=0,this.fA[0]=i,this.uA[0]=e,this.x=128*this.fA[0]+64*this.size,this.z=128*this.uA[0]+64*this.size}step(t,i){let e=this.fA[0],s=this.uA[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.jp&&bt.zs[this.jp].priority<=1&&(this.jp=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.fA[t]=this.fA[t-1],this.uA[t]=this.uA[t-1],this.dA[t]=this.dA[t-1];this.fA[0]=e,this.uA[0]=s,this.dA[0]=t}}class St extends It{static count=0;static zs=[];static Dh=new q(30);static Zs=t=>{const i=new O(t.read('spotanim.dat'));this.count=i.Zt;for(let t=0;t=40&&t<50?this.Sw[t-40]=i.Zt:t>=50&&t<60?this.xw[t-50]=i.Zt:console.log('Error unrecognised spotanim config code: ',t)}Ml(){let t=St.Dh?.get(BigInt(this.id));if(t)return t;t=j.model(this.model);for(let i=0;i<6;i++)0!==this.Sw[0]&&t.Qr(this.Sw[i],this.xw[i]);return St.Dh?.put(BigInt(this.id),t),t}}class xt extends It{static count=0;static zs=[];static Zs=t=>{const i=new O(t.read('idk.dat'));this.count=i.Zt;for(let t=0;t=40&&t<50?this.Sw[t-40]=i.Zt:t>=50&&t<60?this.xw[t-50]=i.Zt:t>=60&&t<70?this.IA[t-60]=i.Zt:console.log('Error unrecognised config code: ',t)}Ml(){if(!this.Rw)return null;const t=new v(this.Rw.length,null);for(let i=0;i{this.EA=i,this.Xs=new O(t.read('obj.dat'));const e=new O(t.read('obj.idx'));this.count=e.Zt,this.gw=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.gw||!this.Xs)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Iw=(this.Iw+1)%10;const i=this.cache[this.Iw];return this.Xs.Vt=this.gw[t],i.id=t,i.reset(),i.ow(this.Xs),-1!==i.bA&&i.OA(),!this.EA&&i.members&&(i.name='Members Object',i.Lw="Login to a members' server to use this object.",i.Ow=null,i.RA=null),i};static Xi=()=>{this.Dh=null,this.TA=null,this.gw=null,this.cache=null,this.Xs=null};static vA=(t,i)=>{if(Mt.TA){let e=Mt.TA.get(BigInt(t));if(e&&e._i!==i&&-1!==e._i&&(e.nt(),e=null),e)return e}let e=Mt.get(t);if(e.LA||(i=-1),e.LA&&e.SA&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.SA[s]&&0!==e.SA[s]&&(t=e.LA[s]);-1!==t&&(e=Mt.get(t))}const s=new J(32,32),n=N.ki,r=N.Di,h=N.Mi,o=m.lt,l=m.ct,a=m.ft,c=m.left,f=m.right,u=m.top,d=m.bottom;N.Ni=!1,m.bind(s.lt,32,32),m.fillRect(0,0,32,32,Ot.gy),N.ji();const w=e.xA(1),y=N.sin[e.MA]*e.kA>>16,p=N.cos[e.MA]*e.kA>>16;w.nh(0,e.DA,e.NA,e.MA,e.FA,y+(w.vr/2|0)+e.BA,p+e.BA);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.lt[t+32*i]&&(t>0&&s.lt[t+32*i-1]>1||i>0&&s.lt[t+32*(i-1)]>1||t<31&&s.lt[t+32*i+1]>1||i<31&&s.lt[t+32*(i+1)]>1)&&(s.lt[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.lt[t+32*i]&&t>0&&i>0&&s.lt[t+32*(i-1)-1]>0&&(s.lt[t+32*i]=3153952);if(-1!==e.bA){const t=this.vA(e.PA,10),i=t.Ai,s=t._i;t.Ai=32,t._i=32,t.bi(5,5,22,22),t.Ai=i,t._i=s}return Mt.TA?.put(BigInt(t),s),m.bind(o,l,a),m.yt(c,u,f,d),N.ki=n,N.Di=r,N.Mi=h,N.Ni=!0,e.UA?s.Ai=33:s.Ai=32,s._i=i,s};model=0;name=null;Lw=null;Sw=null;xw=null;kA=2e3;MA=0;DA=0;NA=0;FA=0;BA=0;WA=!1;GA=-1;UA=!1;YA=1;members=!1;Ow=null;RA=null;HA=-1;VA=-1;KA=0;XA=-1;jA=-1;zA=0;ZA=-1;qA=-1;JA=-1;$A=-1;QA=-1;t_=-1;LA=null;SA=null;PA=-1;bA=-1;decode(t,i){if(1===t)this.model=i.Zt;else if(2===t)this.name=i.ei;else if(3===t)this.Lw=i.ei;else if(4===t)this.kA=i.Zt;else if(5===t)this.MA=i.Zt;else if(6===t)this.DA=i.Zt;else if(7===t)this.FA=i.qt,this.FA>32767&&(this.FA-=65536);else if(8===t)this.BA=i.qt,this.BA>32767&&(this.BA-=65536);else if(9===t)this.WA=!0;else if(10===t)this.GA=i.Zt;else if(11===t)this.UA=!0;else if(12===t)this.YA=i.$t;else if(16===t)this.members=!0;else if(23===t)this.HA=i.Zt,this.KA=i.zt;else if(24===t)this.VA=i.Zt;else if(25===t)this.XA=i.Zt,this.zA=i.zt;else if(26===t)this.jA=i.Zt;else if(t>=30&&t<35)this.Ow||(this.Ow=new v(5,null)),this.Ow[t-30]=i.ei,'hidden'===this.Ow[t-30]?.toLowerCase()&&(this.Ow[t-30]=null);else if(t>=35&&t<40)this.RA||(this.RA=new v(5,null)),this.RA[t-35]=i.ei;else if(40===t){const t=i.jt;this.Sw=new Uint16Array(t),this.xw=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.LA&&this.SA||(this.LA=new Uint16Array(10),this.SA=new Uint16Array(10)),this.LA[t-100]=i.Zt,this.SA[t-100]=i.Zt)}i_(t){let i=this.HA;if(1===t&&(i=this.XA),-1===i)return null;let e=this.VA,s=this.ZA;1===t&&(e=this.jA,s=this.qA);let n=j.model(i);if(-1!==e){const t=j.model(e);if(-1===s){const i=[n,t];n=j.Wr(i,2)}else{const i=[n,t,j.model(s)];n=j.Wr(i,3)}}if(0===t&&0!==this.KA&&n.translate(this.KA,0,0),1===t&&0!==this.zA&&n.translate(this.zA,0,0),this.Sw&&this.xw)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.SA[e]&&0!==this.SA[e]&&(i=this.LA[e]);if(-1!==i)return Mt.get(i).xA(1)}if(Mt.Dh){const t=Mt.Dh.get(BigInt(this.id));if(t)return t}const i=j.model(this.model);if(this.Sw&&this.xw)for(let t=0;t=this.I_&&(this.b_=null),t>=this.g_&&t=kt.d_[i].length)&&(e=0),this.p_[i]=e}this.bp=t.Zt,65535===this.bp&&(this.bp=-1),this.Op=t.Zt,65535===this.Op&&(this.Op=-1),this.Rp=t.Zt,65535===this.Rp&&(this.Rp=-1),this.vp=t.Zt,65535===this.vp&&(this.vp=-1),this.Lp=t.Zt,65535===this.Lp&&(this.Lp=-1),this.Sp=t.Zt,65535===this.Sp&&(this.Sp=-1),this.xp=t.Zt,65535===this.xp&&(this.xp=-1),this.name=$.xh($.Oh(t.Qt)),this.A_=t.jt,this.visible=!0,this.__=0n;for(let t=0;t<12;t++)this.__<<=0x4n,this.m_[t]>=256&&(this.__+=BigInt(this.m_[t])-256n);this.m_[0]>=256&&(this.__+=BigInt(this.m_[0])-256n>>4n),this.m_[1]>=256&&(this.__+=BigInt(this.m_[1])-256n>>8n);for(let t=0;t<5;t++)this.__<<=0x3n,this.__+=BigInt(this.p_[t]);this.__<<=0x1n,this.__+=BigInt(this.w_)}CA(){if(!this.visible)return null;const t=new v(12,null);let i=0;for(let e=0;e<12;e++){const s=this.m_[e];if(s>=256&&s<512&&(t[i++]=xt.zs[s-256].CA()),s>=512){const e=Mt.get(s-512).CA(this.w_);e&&(t[i++]=e)}}const e=j.Wr(t,i);for(let t=0;t<5;t++)0!==this.p_[t]&&(e.Qr(kt.d_[t][0],kt.d_[t][this.p_[t]]),1===t&&e.Qr(kt.u_[0],kt.u_[this.p_[t]]));return e}O_(){let t=this.__,i=-1,e=-1,s=-1,n=-1;if(this.jp>=0&&0===this.qp){const r=bt.zs[this.jp];if(r.frames&&(i=r.frames[this.zp]),this.Vp>=0&&this.Vp!==this.bp){const t=bt.zs[this.Vp].frames;t&&(e=t[this.Kp])}r.uy>=0&&(s=r.uy,t+=BigInt(s-this.m_[5])<<8n),r.wy>=0&&(n=r.wy,t+=BigInt(n-this.m_[3])<<16n)}else if(this.Vp>=0){const t=bt.zs[this.Vp].frames;t&&(i=t[this.Kp])}let r=kt.Dh?.get(t);if(!r){const i=new v(12,null);let e=0;for(let t=0;t<12;t++){let r=this.m_[t];if(n>=0&&3===t&&(r=n),s>=0&&5===t&&(r=s),r>=256&&r<512){const t=xt.zs[r-256].Ml();t&&(i[e++]=t)}if(r>=512){const t=Mt.get(r-512).i_(this.w_);t&&(i[e++]=t)}}r=j.Wr(i,e);for(let t=0;t<5;t++)0!==this.p_[t]&&(r.Qr(kt.d_[t][0],kt.d_[t][this.p_[t]]),1===t&&r.Qr(kt.u_[0],kt.u_[this.p_[t]]));r.jr(),r.ih(64,850,-30,-50,-30,!0),kt.Dh?.put(t,r)}if(this.Ri)return r;const h=j.Nr(r,!0);return-1!==i&&-1!==e?h.zr(i,e,bt.zs[this.jp].oy):-1!==i&&h.qr(i),h.Ur(),h.Br=null,h.Fr=null,h}}class Dt extends It{static count=0;static cache=null;static Xs=null;static gw=null;static Iw=0;static Dh=new q(30);static Zs=t=>{this.Xs=new O(t.read('npc.dat'));const i=new O(t.read('npc.idx'));this.count=i.Zt,this.gw=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.gw||!this.Xs)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Iw=(this.Iw+1)%20;const i=this.cache[this.Iw]=new Dt(t);return this.Xs.Vt=this.gw[t],i.ow(this.Xs),i};static Xi=()=>{this.Dh=null,this.gw=null,this.cache=null,this.Xs=null};name=null;Lw=null;size=1;Rw=null;IA=null;Fw=!1;R_=-1;v_=-1;L_=-1;S_=-1;x_=-1;Sw=null;xw=null;Ow=null;Vw=-1;Kw=-1;Xw=-1;M_=!0;k_=-1;_A=128;gA=128;decode(t,i){if(1===t){const t=i.jt;this.Rw=new Uint16Array(t);for(let e=0;e=30&&t<40)this.Ow||(this.Ow=new v(5,null)),this.Ow[t-30]=i.ei,'hidden'===this.Ow[t-30]?.toLowerCase()&&(this.Ow[t-30]=null);else if(40===t){const t=i.jt;this.Sw=new Uint16Array(t),this.xw=new Uint16Array(t);for(let e=0;e{const i=new O(t.read('varp.dat'));this.count=i.Zt;for(let t=0;t{if('complete'===t.iceGatheringState){let i;self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(t.localDescription)):console.log(JSON.stringify(t.localDescription));try{for(;null===(i=prompt('Offer copied to clipboard, paste answer here')););t.setRemoteDescription(new RTCSessionDescription(JSON.parse(i)))}catch(t){console.error(t)}}},i.onopen=()=>{i.send(JSON.stringify({type:'id',id:e})),console.log('Connected to peer!')},i.onerror=t=>{console.error(t)},i.onmessage=t=>{const i=JSON.parse(t.data);i.data&&(i.data=Object.values(i.data)),this.Y_&&this.Y_.postMessage(i)}}postMessage(t){const i=this.G_.get(t.data.id),e=t.data;e.data&&(e.data=Array.from(t.data.data)),i&&'open'===i.readyState&&i.send(JSON.stringify(e))}}class Pt{pc;K_=void 0;H_;constructor(t){this.pc=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),this.pc.ondatachannel=i=>{this.K_=i.channel,this.K_.onopen=()=>{console.log('Connected to host!')},this.K_.onerror=t=>{console.error(t)},this.K_.onmessage=i=>{if(!this.H_){const t=JSON.parse(i.data);if('id'===t.type)return void(this.H_=t.id)}t.onmessage&&t.onmessage(i)}},this.pc.onicegatheringstatechange=async()=>{'complete'===this.pc.iceGatheringState&&(self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(this.pc.localDescription)):console.log(JSON.stringify(this.pc.localDescription)))}}async X_(t){await this.pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(t))),await this.pc.setLocalDescription(await this.pc.createAnswer())}}class Ut extends U{static j_=225;static z_=10;static portOffset=0;static members=!0;static Ri=!1;static Z_='';static q_='';static J_=!1;static Q_=2;static tg=!1;static ig='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static eg=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static sg=0;static ng=0;static rg=0;static hg=0;static og=0;static lg=0;static ag=0;static cg=0;static fg=0;static ug=0;static dg=0;static wg=0;static yg=0;static mg=0;static pg=0;static Ag=()=>{gt.Ri=!1,N.Ri=!1,Ut.Ri=!1,Rt.Ri=!1};static _g=()=>{gt.Ri=!0,N.Ri=!0,Ut.Ri=!0,Rt.Ri=!0};gg=2048;Ig=2047;Cg=!1;Eg=!1;Tg=!1;bg=!1;db=null;Og=0;Rg=[];stream=null;in=O.Xt(1);vg=O.Xt(1);Lg=O.Xt(1);Sg=0n;xg=0;Mg=0;kg=0;Dg=null;Ng=0;packetSize=0;Fg=0;Bg=0;Pg=0;Ug=null;Wg=!0;Gg=0;Yg=0;Hg=null;Vg=null;Kg=null;Xg=null;jg=null;zg=null;Zg=null;qg=null;Jg=null;$g=null;Qg=null;tI='';iI='';username='';password='';eI=null;sI=null;nI=null;rI=null;hI=[];oI=!1;lI=null;aI=null;cI=null;fI=null;uI=null;dI=null;wI=null;yI=null;mI=null;pI=null;AI=new Int32Array(256);_I=0;gI=0;II=0;CI=null;EI=null;TI=null;bI=null;OI=null;RI=null;vI=null;LI=null;SI=null;xI=null;MI=null;kI=null;DI=null;NI=null;FI=null;BI=null;UI=null;WI=null;GI=null;YI=null;HI=null;VI=new Int32Array(33);KI=new Int32Array(33);XI=new Int32Array(151);jI=new Int32Array(151);zI=null;ZI=null;qI=null;JI=null;$I=null;QI=null;tC=new v(13,null);iC=null;eC=null;sC=new v(50,null);nC=new v(50,null);rC=new v(20,null);hC=new v(20,null);oC=null;lC=new v(8,null);aC=null;cC=null;fC=null;uC=null;dC=null;wC=null;yC=null;mC=null;pC=null;AC=null;_C=null;gC=null;IC=null;CC=null;EC=null;TC=null;bC=null;OC=null;RC=new v(1e3,null);vC=!1;LC=!1;SC=!1;xC=!1;MC=-1;kC=0;DC=0;NC=0;FC=0;BC=0;PC=0;UC=!1;WC=0;GC=0;YC=0;HC=0;VC=0;KC=0;XC=[];jC=-1;zC=-1;ZC=new Q;qC=78;JC=0;$C=0;QC=[];tE=0;iE=0;eE=0;sE=0;nE=0;rE=0;hE=0;oE=0;lE=[];aE=[];cE=[];fE=[];uE=null;dE=-1;wE=3;yE=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];mE=0;pE=0;AE=0;_E=!1;gE=0;IE=!1;CE='';EE='';TE=0;bE='';OE=!1;RE=-1;vE=new v(100,null);LE=new v(100,null);messageType=new Int32Array(100);SE=new Int32Array(100);xE=0;ME=0;kE=0;DE='';NE=0;FE=0;BE=0;PE=0;UE=0;WE=0;GE=0;YE=0;HE=0;VE=!1;KE=0;XE=0;jE=0;zE=0;ZE=null;qE=0;JE=0;$E=0;QE=0;tT=!1;iT=[];eT=[];sT=0;nT=0;rT=0;hT=null;oT=0;lT=new Int32Array(500);aT=new Int32Array(500);cT=new Int32Array(500);fT=new Int32Array(500);uT=0;dT=0;wT=0;yT='';mT=!1;pT=-1;AT=0;_T=0;gT=0;IT=0;CT=0;ET=new Int32Array(1e3);TT=new Int32Array(1e3);bT=null;OT=0;RT=0;vT=0;LT=0;ST=0;xT=!1;MT=0;kT=0;DT=0;NT=0;FT=2;BT=2;PT=1;UT=new Int32Array(5);WT=new v(5,!1);GT=new Int32Array(5);YT=new Int32Array(5);HT=new Int32Array(5);VT=0;KT=0;XT=0;jT=0;zT=0;ZT=0;qT=0;JT=0;$T=0;QT=1;tb=2;ib=-1;Xn=0;zn=0;eb=0;sb=0;nb=0;rb=0;hb=null;ob=null;lb=null;ab=0;cb=0;fb=new Int8Array(16384);ub=new v(ut.wf,null);wb=0;yb=0;mb=128;pb=0;Ab=0;_b=0;gb=0;Ib=0;rp=null;hp=null;Cb=new k(ut.yf,ut.yf);Eb=0;Tb=0;bb=0;Ob=0;Rb=0;vb=0;Lb=0;Sb=0;xb=0;Mb=0;kb=0;Db=0;Nb=new v(this.gg,null);Fb=0;Bb=new Int32Array(this.gg);Pb=0;Ub=0;Wb=new Int32Array(this.gg);Gb=new Int32Array(1e3);Yb=new v(this.gg,null);Hb=new v(8192,null);Vb=0;Kb=new Int32Array(8192);Xb=new b;jb=new b;zb=new b;ud=new b;Zb=new S(ut.wf,ut.yf,ut.yf,null);qb=new b;Jb=new Int32Array(4e3);$b=new Int32Array(4e3);Qb=new Int32Array(ut.yf*ut.yf);tO=new Int32Array(ut.yf*ut.yf);iO=0;eO=null;sO=0;nO=0;rO=-1;hO=0;oO=0;lO=0;aO=0;cO=!1;fO=!0;uO=!1;dO=new Int32Array(7);wO=new Int32Array(5);yO=0;mO=0;static pO=50;AO=new Int32Array(Ut.pO);_O=new Int32Array(Ut.pO);gO=new Int32Array(Ut.pO);IO=new Int32Array(Ut.pO);CO=new Int32Array(Ut.pO);EO=new Int32Array(Ut.pO);TO=new Int32Array(Ut.pO);bO=new v(Ut.pO,null);OO=new v(100,null);RO=new BigInt64Array(100);vO=new Int32Array(100);LO=null;SO=0;xO=!0;MO=new Int32Array(50);kO=new Int32Array(50);DO=new Int32Array(50);NO=192;FO=-1;BO=-1;PO=0;UO=0;WO=0;GO=!0;YO=null;HO=0;VO=0;KO=192;Y_=void 0;XO=!1;host=null;jO=null;zO=new v(16,null);ZO=0;qO=!1;Xi=()=>{try{this.stream&&this.stream.close()}catch(t){}var t;this.jO&&'998'===Ut.getParameter('world')&&this.jO.K_?.send(JSON.stringify({type:'close',id:this.jO.H_})),this.stream=null,t=!1,window._tinyMidiStop&&window._tinyMidiStop(t),this.vg=null,this.Lg=null,this.in=null,this.lb=null,this.hb=null,this.ob=null,this.rp=null,this.hp=null,this.bT=null,this.ub=null,this.Qb=null,this.tO=null,this.Jb=null,this.$b=null,this.fb=null,this.EI=null,this.TI=null,this.bI=null,this.OI=null,this.RI=null,this.vI=null,this.LI=null,this.SI=null,this.xI=null,this.MI=null,this.kI=null,this.DI=null,this.NI=null,this.FI=null,this.BI=null,this.UI=null,this.WI=null,this.zI=null,this.qI=null,this.ZI=null,this.JI=null,this.$I=null,this.QI=null,this.tC=null,this.yC=null,this.mC=null,this.pC=null,this.AC=null,this._C=null,this.gC=null,this.IC=null,this.CC=null,this.EC=null,this.TC=null,this.eC=null,this.rC=null,this.hC=null,this.lC=null,this.aC=null,this.cC=null,this.fC=null,this.uC=null,this.sC=null,this.nC=null,this.Cb=null,this.Nb=null,this.Bb=null,this.Wb=null,this.Yb=null,this.Gb=null,this.Hb=null,this.Kb=null,this.Zb=null,this.qb=null,this.ud=null,this.Xb=null,this.jb=null,this.zb=null,this.cT=null,this.fT=null,this.lT=null,this.aT=null,this.XC=null,this.iT=null,this.ET=null,this.TT=null,this.RC=null,this.iC=null,this.OO=null,this.RO=null,this.vO=null,this.Xg=null,this.jg=null,this.Hg=null,this.Vg=null,this.Kg=null,this.zg=null,this.Zg=null,this.qg=null,this.Jg=null,this.JO(),Et.Xi(),Dt.Xi(),Mt.Xi(),Ct.zs=null,xt.zs=null,Q.zs=null,bt.zs=null,St.zs=null,St.Dh=null,Nt.zs=null,this.xe=null,kt.Dh=null,N.Xi(),gt.Xi(),j.Xi(),H.zs=[],V.zs=[]};xs(){return this.Gg}Ls(){return this.OE}Ss(){return this.IE}vs(){return this.zC}Rs(){return this.MC}JO=()=>{this.oI=!1,this.CI&&(clearInterval(this.CI),this.CI=null),this.$g=null,this.Qg=null,this.hI=[],this.wI=null,this.yI=null,this.mI=null,this.pI=null,this.fI=null,this.cI=null,this.uI=null,this.dI=null,this.lI=null,this.aI=null};$O=()=>{'999'===Ut.getParameter('world')?(this.Y_=new Worker('worker.js',{type:'module'}),this.Y_.onmessage=this.onmessage,this.host=new Bt(this.Y_)):'998'===Ut.getParameter('world')&&(this.Y_={onmessage:t=>{this.stream.QO.onmessage(t)},postMessage:t=>{this.jO&&this.jO.K_&&'open'===this.jO.K_.readyState&&this.jO.K_.send(JSON.stringify(t))},onerror:null,onmessageerror:null,terminate:()=>{throw new Error},addEventListener:()=>{throw new Error},removeEventListener:()=>{throw new Error},dispatchEvent:()=>{throw new Error}},this.jO=new Pt(this.Y_))};onmessage=t=>{switch(t.data.type){case'ready':return void(this.XO=!0);case'save':return Ft(t.data.value,t.data.path.split('/').pop().split('\\').pop()),void URL.revokeObjectURL(t.data.value);case'close':return void this.Y_?.postMessage({type:'close',id:t.data.id})}this.host?.H_===t.data.id?this.stream.QO.onmessage(t.data):this.host?.postMessage(t)};tR=async()=>{if(999==+Ut.getParameter('world'))this.host&&await this.host.V_();else if(998==+Ut.getParameter('world')&&this.jO){if(this.jO.K_)return void console.log('You are already connected.');const t=prompt('Paste offer here, answer will be copied to clipboard');if(t)try{await this.jO.X_(t)}catch(t){console.error(t)}}};iR=async(t,i,e,s)=>{let n=5,r=await(this.db?.Ds(t));if(r&&O.Ht(r)!==e&&(r=void 0),r)return new G(r);for(;!r;){await this.fs(s,`Requesting ${i}`);try{r=+Ut.getParameter('world')<998?await T(`${Ut.q_}/${t}${e}`):await T(`${Ut.q_}/${t}`)}catch(t){r=void 0;for(let t=n;t>0;t--)await this.fs(s,`Error loading - Will retry in ${t} secs.`),await E(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Ns(t,r)),new G(r)};eR=async(t,e,s,n)=>{let r=await(this.db?.Ds(t+'.mid'));if(r&&12345678!==e&&O.Ht(r)!==e&&(r=void 0),!r)try{r=+Ut.getParameter('world')<998?await T(`${Ut.q_}/${t}_${e}.mid`):await T(`${Ut.q_}/songs/${t}.mid`),s!==r.length&&(r=r.slice(0,s))}catch(t){}if(!r)return;await(this.db?.Ns(t+'.mid',r));const h=new O(Uint8Array.from(r)).$t;!function(t,i,e){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256,e)}(i.read(h,r,s,4),this.KO,n)};sR=()=>{if(A.fillStyle='black',A.fillRect(0,0,this.width,this.height),this.ds(1),this.Tg){this.oI=!1,A.font='bold 16px helvetica, sans-serif',A.textAlign='left',A.fillStyle='yellow';let t=35;A.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,A.fillStyle='white',A.fillText('To fix this try the following (in order):',30,t),t+=50,A.font='bold 12px helvetica, sans-serif',A.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,A.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,A.fillText('3: Try using a different game-world',30,t),t+=30,A.fillText('4: Try rebooting your computer',30,t),t+=30,A.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.bg&&(this.oI=!1,A.font='bold 20px helvetica, sans-serif',A.textAlign='left',A.fillStyle='white',A.fillText('Error - unable to load game!',50,50),A.fillText('To play RuneScape make sure you play from',50,100),A.fillText('https://2004scape.org',50,150)),this.Eg){this.oI=!1,A.font='bold 13px helvetica, sans-serif',A.textAlign='left',A.fillStyle='yellow';let t=35;A.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,A.fillStyle='white',A.fillText('To fix this try the following (in order):',30,t),t+=50,A.font='bold 12px helvetica, sans-serif',A.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,A.fillText('2: Try rebooting your computer, and reloading',30,t)}};nR=t=>{if(!t.ll)return!1;for(let i=0;i=s)return!1}else if(3===t.ll[i]){if(e<=s)return!1}else if(4===t.ll[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};hR=(t,i,e,s,n)=>{this.dC?.draw(t,i),this.wC?.draw(t,i+n-16),m.fillRect(t,i+16,16,n-32,Ot.My);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;m.fillRect(t,i+h+16,16,r,Ot.ky),m.It(t,i+h+16,Ot.Dy,r),m.It(t+1,i+h+16,Ot.Dy,r),m.gt(t,i+h+16,Ot.Dy,16),m.gt(t,i+h+17,Ot.Dy,16),m.It(t+15,i+h+16,Ot.Ny,r),m.It(t+14,i+h+17,Ot.Ny,r-1),m.gt(t,i+h+r+15,Ot.Ny,16),m.gt(t+1,i+h+r+14,Ot.Ny,15)};oR=(t,i)=>{let e=!1;const s=Q.zs[t];if(!s.cl)return!1;for(let t=0;ts.delay[n.Yl];)n.Hl-=s.delay[n.Yl]+1,n.Yl++,n.Yl>=s.ny&&(n.Yl-=s.sy,(n.Yl<0||n.Yl>=s.ny)&&(n.Yl=0)),e=!0}}}return e};lR=(t,i,e,s,n=!1)=>{if(0!==t.type||!t.cl||t.hide&&this.NE!==t.id&&this.FE!==t.id&&this.BE!==t.id)return;const r=m.left,h=m.top,o=m.right,l=m.bottom;m.yt(i,e,i+t.width,e+t.height);const a=t.cl.length;for(let r=0;r0&&this.aR(l),l.type===Q.Nh)l.Gl>l.scroll-l.height&&(l.Gl=l.scroll-l.height),l.Gl<0&&(l.Gl=0),this.lR(l,h,o,l.Gl,n),l.scroll>l.height&&this.hR(h+l.width,o,l.Gl,l.scroll,l.height);else if(l.type===Q.Bh){let t=0;for(let i=0;i0){let i=0,e=0;const r=l.dl[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.WE&&this.UE===t){const h=Mt.vA(r,l.wl[t]);if(0!==this.WE&&this.UE===t&&this.PE===l.id?(i=this.Ve-this.GE,e=this.Ke-this.YE,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.HE<5&&(i=0,e=0),h.ph(128,s+i,n+e)):0!==this.qE&&this.JE===t&&this.$E===l.id?h.ph(128,s,n):h.draw(s,n),33===h.Ai||1!==l.wl[t]){const r=l.wl[t];this.eI?.cR(s+i+1,n+10+e,this.fR(r),Ot.gy),this.eI?.cR(s+i,n+9+e,this.fR(r),Ot.my)}}}else if(l.Il&&t<20){const i=l.Il[t];i?.draw(s,n)}t++}}else if(l.type===Q.Ph)l.fill?m.fillRect(h,o,l.width,l.height,l.Rl):m._t(h,o,l.width,l.height,l.Rl);else if(l.type===Q.Uh){const t=l.font;let i=l.Rl,e=l.text;if(this.BE!==l.id&&this.FE!==l.id&&this.NE!==l.id||0===l.Ll||(i=l.Ll),this.nR(l)&&(i=l.vl,l.Ol&&l.Ol.length>0&&(e=l.Ol)),l.rl===Q.zh&&this.tT&&(e='Please wait...',i=l.Rl),!t||!e)continue;for(let s=o+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.uR(this.rR(l,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.uR(this.rR(l,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.uR(this.rR(l,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.uR(this.rR(l,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.uR(this.rR(l,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),l.Tl?t.dR(h+(l.width/2|0),s,r,i,l.bl):t.wR(h,s,r,i,l.bl)}}else if(l.type===Q.Wh){let t;t=this.nR(l)?l.xl:l.Sl,t?.draw(h,o)}else if(l.type===Q.Gh){const t=N.ki,i=N.Di;N.ki=h+(l.width/2|0),N.Di=o+(l.height/2|0);const e=N.sin[l.Fl]*l.zoom>>16,s=N.cos[l.Fl]*l.zoom>>16,n=this.nR(l);let r;r=n?l.Nl:l.Dl;let a=null;if(-1===r)a=l.Ml(-1,-1,n);else{const t=bt.zs[r];t.frames&&t.hy&&(a=l.Ml(t.frames[l.Yl],t.hy[l.Yl],n))}a&&a.nh(0,l.Bl,0,l.Fl,0,e,s),N.ki=t,N.Di=i}else if(l.type===Q.Yh){const t=l.font;if(!t||!l.dl||!l.wl)continue;let i=0;for(let e=0;e0){const n=Mt.get(l.dl[i]-1);let r=n.name;if((n.UA||1!==l.wl[i])&&(r=r+' x'+this.yR(l.wl[i])),!r)continue;const a=h+s*(l.pl+115),c=o+e*(l.Al+12);l.Tl?t.dR(a+(l.width/2|0),c,r,l.Rl,l.bl):t.wR(a,c,r,l.Rl,l.bl)}i++}}}m.yt(r,h,o,l)};aR=t=>{let i=t.hl;if(i>=Q.Zh&&i<=Q.qh)i--,i>=this.yO?(t.text='',t.rl=0):(t.text=this.OO[i],t.rl=1);else if(i>=Q.Jh&&i<=Q.$h)i-=Q.Jh,i>=this.yO?(t.text='',t.rl=0):(0===this.vO[i]?t.text='@red@Offline':this.vO[i]===Ut.z_?t.text='@gre@World-'+(this.vO[i]-9):t.text='@yel@World-'+(this.vO[i]-9),t.rl=1);else if(i===Q.eo)t.scroll=15*this.yO+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=Q.ko&&i<=Q.Do)i-=Q.ko,i>=this.$C?(t.text='',t.rl=0):(t.text=$.xh($.Oh(this.QC[i])),t.rl=1);else if(i===Q.Bo)t.scroll=15*this.$C+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===Q.Mo){if(t.Fl=150,t.Bl=256*Math.sin(this.Og/40)&2047,this.uO){this.uO=!1;const i=new v(7,null);let e=0;for(let t=0;t<7;t++){const s=this.dO[t];s>=0&&(i[e++]=xt.zs[s].Ml())}const s=j.Wr(i,e);for(let t=0;t<5;t++)0!==this.wO[t]&&(s.Qr(kt.d_[t][0],kt.d_[t][this.wO[t]]),1===t&&s.Qr(kt.u_[0],kt.u_[this.wO[t]]));if(this.eO){const i=bt.zs[this.eO.bp].frames;i&&(s.jr(),s.qr(i[0]),s.ih(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===Q.Lo)this.bC||(this.bC=t.Sl,this.OC=t.xl),this.fO?t.Sl=this.OC:t.Sl=this.bC;else if(i===Q.So)this.bC||(this.bC=t.Sl,this.OC=t.xl),this.fO?t.Sl=this.bC:t.Sl=this.OC;else if(i===Q.Po)t.text=this.yT,this.Og%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===Q.Jo)this.cO?this.mT?(t.Rl=Ot.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Rl=Ot._y,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===Q.$o||i===Q.sl)if(0===this.AT)t.text='';else{let i;i=0===this._T?'earlier today':1===this._T?'yesterday':this._T+' days ago',t.text='You last logged in '+i+' from: '+$.Sh(this.AT)}else if(i===Q.Qo)0===this.IT&&(t.text='0 unread messages',t.Rl=Ot.my),1===this.IT&&(t.text='1 unread message',t.Rl=Ot.GREEN),this.IT>1&&(t.text=this.IT+' unread messages',t.Rl=Ot.GREEN);else if(i===Q.tl)if(201===this.gT)t.text='';else if(200===this.gT)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.gT?'Earlier today':1===this.gT?'Yesterday':this.gT+' days ago',t.text=i+' you changed your recovery questions'}else i===Q.il?201===this.gT?t.text='':200===this.gT?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===Q.el&&(201===this.gT?t.text='':(this.gT,t.text="Do this from the 'account management' area on our front webpage"))};rR=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let s=0,n=0;for(;;){const t=e[n++];if(0===t)return s;if(1===t)s+=this.aE[e[n++]];else if(2===t)s+=this.cE[e[n++]];else if(3===t)s+=this.lE[e[n++]];else if(4===t){const t=Q.zs[e[n++]],i=e[n++]+1;if(t.dl&&t.wl)for(let e=0;et<999999999?String(t):'*';yR=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};fR=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}(new class extends Ut{Cg=!1;Eg=!1;Tg=!1;bg=!1;mR=null;pR=null;AR=null;_R=null;gR=null;IR=null;Lu=0;Su=0;xu=0;CR=0;ER=0;TR=2;model={id:parseInt(U.getParameter('model'))||0,bR:null,x:0,y:0,z:420,Ta:0};constructor(){super(!0)}load=async()=>{if(this.Cg)this.Eg=!0;else{this.Cg=!0;try{await async function(t){if(o||h)return;o=!0;const i=await r(t);h||(h=i)}(),await i.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new W(await W.openDatabase()),this.xe?.bind(),N.ji(),this.mR=document.getElementById('rightPanel');const t=document.getElementById('mainPanel');t&&(t.ondragover=t=>{t.preventDefault(),t.stopPropagation()},t.ondrop=async t=>{if(t.preventDefault(),t.stopPropagation(),!t.dataTransfer||!t.dataTransfer.files.length)return;const i=['main_file_cache.dat','main_file_cache.idx0','main_file_cache.idx1','main_file_cache.idx2','main_file_cache.idx3','main_file_cache.idx4'],e=[];for(let s=0;s{this.Eg||this.Tg||this.bg||(this.OR(),this.RR())};draw=async()=>{this.Eg||this.Tg||this.bg?this.sR():(m.clear(),m.fillRect(0,0,this.width,this.height,Ot.gy),null!==this.model.bR&&this.model.bR.draw(this.model.Ta,N.sin[this.CR],N.cos[this.CR],N.sin[this.ER],N.cos[this.ER],this.model.x-this.Lu,this.model.y-this.Su,this.model.z-this.xu,0),this.xe?.draw(0,0))};init=async()=>{const t=await(this.db?.Ds('main_file_cache.dat'));if(!t){return document.getElementById('helpme').style.display='block',void(p.style.display='none')}const i=await(this.db?.Ds('main_file_cache.idx0')),e=await(this.db?.Ds('main_file_cache.idx1')),s=await(this.db?.Ds('main_file_cache.idx2')),n=await(this.db?.Ds('main_file_cache.idx3')),r=await(this.db?.Ds('main_file_cache.idx4'));if(!(i&&e&&s&&n&&r)){return document.getElementById('helpme').style.display='block',void(p.style.display='none')}document.getElementById('helpme').style.display='none',p.style.display='block',this.pR=new Y(t,i,0),this.AR=new Y(t,e,1),this._R=new Y(t,s,2),this.gR=new Y(t,n,3),this.IR=new Y(t,r,4),await this.fs(10,'Unpacking textures');const h=this.pR.read(6);N.qi(h),N.Qi(.8),N.ie(20),await this.fs(20,'Loading models...');for(let t=0;t{this.model.id=i,this.vR(i)},t.appendChild(e)}}};vR(t){if(null===this.AR)return;const i=this.AR.read(t);null!==i?(this.model.bR=j.Gr(i,t),this.model.bR.ih(64,850,-30,-50,-30,!0),document.title=`Model ${t} | 2004Scape Tools`):document.title=`Missing model ${t} | 2004Scape Tools`}OR(){for(;;){const t=this.ys();if(-1===t)break;t==='r'.charCodeAt(0)?(this.TR=2,this.Lu=0,this.Su=0,this.xu=0,this.CR=0,this.ER=0,this.model.x=0,this.model.y=0,this.model.z=420,this.model.Ta=0):t==='1'.charCodeAt(0)?(this.model.id--,j.metadata&&this.model.id<0&&(this.model.id=j.metadata.length-1),this.vR(this.model.id)):t==='2'.charCodeAt(0)&&(this.model.id++,j.metadata&&this.model.id>=j.metadata.length&&(this.model.id=0),this.vR(this.model.id))}}RR(){this.Ze['['.charCodeAt(0)]?this.TR--:this.Ze[']'.charCodeAt(0)]&&this.TR++,this.Ze[1]?this.model.Ta+=this.TR:this.Ze[2]&&(this.model.Ta-=this.TR),this.Ze['w'.charCodeAt(0)]?this.model.z-=this.TR:this.Ze['s'.charCodeAt(0)]&&(this.model.z+=this.TR),this.Ze['a'.charCodeAt(0)]?this.model.x-=this.TR:this.Ze['d'.charCodeAt(0)]&&(this.model.x+=this.TR),this.Ze['q'.charCodeAt(0)]?this.model.y-=this.TR:this.Ze['e'.charCodeAt(0)]&&(this.model.y+=this.TR),this.CR=2047&this.CR,this.ER=2047&this.ER,this.model.Ta=2047&this.model.Ta}}).run().then((()=>{}))})()})(); \ No newline at end of file +(()=>{"use strict";var t={7444:(t,i,e)=>{t.exports=e.p+"0c791968973e1f25c170.wasm"},8227:(t,i,e)=>{t.exports=e.p+"9f86b5397894e28b5ae2.wasm"}},i={};function e(s){var n=i[s];if(void 0!==n)return n.exports;var r=i[s]={exports:{}};return t[s](r,r.exports,e),r.exports}e.m=t,e.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),e.p="/Client2/",e.b=document.baseURI||self.location.href,(()=>{async function t(t,i={}){const e={env:Object.assign(Object.create(globalThis),i.env||{},{abort(t,i,e,s){t=h(t>>>0),i=h(i>>>0),e>>>=0,s>>>=0,(()=>{throw Error(`${t} in ${i}:${e}:${s}`)})()}})},{exports:s}=await WebAssembly.instantiate(t,e),n=s.memory||i.env.memory,r=Object.setPrototypeOf({read:(t,i,e,r)=>(i=function(t,i,e,r,h){if(null==r)return 0;const o=r.length,l=s.__pin(s.__new(o<>>0;if(h)new h(n.buffer,l,o).set(r);else for(let i=0;i>>0),r[i]);return s.__unpin(l),l}(l,6,0,i,Int8Array)||function(){throw TypeError("value must not be null")}(),function(t,i,e){if(!e)return null;const s=function(t){try{return o.getUint32(t,!0)}catch{return o=new DataView(n.buffer),o.getUint32(t,!0)}}(e-4)>>>i,r=new Array(s);for(let n=0;n>>0));return r}(a,0,s.read(t,i,e,r)>>>0))},s);function h(t){if(!t)return null;const i=t+new Uint32Array(n.buffer)[t-4>>>2]>>>1,e=new Uint16Array(n.buffer);let s=t>>>1,r="";for(;i-s>1024;)r+=String.fromCharCode(...e.subarray(s,s+=1024));return r+String.fromCharCode(...e.subarray(s,i))}let o=new DataView(n.buffer);function l(t,i){try{o.setUint8(t,i,!0)}catch{o=new DataView(n.buffer),o.setUint8(t,i,!0)}}function a(t){try{return o.getInt8(t,!0)}catch{return o=new DataView(n.buffer),o.getInt8(t,!0)}}return r}class i{static tt=null;static load=async i=>{this.tt=await t(new WebAssembly.Module(i),{env:void 0})};static read=(t,i,e,s)=>{if(!this.tt)throw new Error('bz2 not found!!');return Int8Array.from(this.tt.read(t,i,e,s))}}let s;function n(t,i){return s=t.exports,r.it=i,s}async function r(t){void 0===t&&(t=new URL(e(7444),e.b));const i={et:{}};('string'==typeof t||'function'==typeof Request&&t instanceof Request||'function'==typeof URL&&t instanceof URL)&&(t=fetch(t));const{instance:s,module:r}=await async function(t,i){if('function'==typeof Response&&t instanceof Response){if('function'==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,i)}catch(i){if('application/wasm'==t.headers.get('Content-Type'))throw i;console.warn('`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n',i)}const e=await t.arrayBuffer();return await WebAssembly.instantiate(e,i)}{const e=await WebAssembly.instantiate(t,i);return e instanceof WebAssembly.Instance?{instance:e,module:t}:e}}(await t,i);return n(s,r)}let h=null,o=!1;class l extends Error{constructor(t){super(t),this.name='DecompressionError'}}let a=0,c=null,f=null;function u(t,i,e){let s;if(e){const n=i;s=t.malloc_u8(n);const r=new Uint8Array(t.memory.buffer,s,n);try{e(r)}catch(i){throw t.free_u8(s,n),i}return a=n,s}if('string'==typeof i){const e=a=function(t){let i=0,e=0,s=0;const n=t.length;for(;i{this.lt=t,this.ct=i,this.ft=e,this.yt(0,0,i,e)};static At=()=>{this.left=0,this.top=0,this.right=this.ct,this.bottom=this.ft,this.ut=this.right-1,this.dt=this.right/2|0};static yt=(t,i,e,s)=>{t<0&&(t=0),i<0&&(i=0),e>this.ct&&(e=this.ct),s>this.ft&&(s=this.ft),this.top=i,this.bottom=s,this.left=t,this.right=e,this.ut=this.right-1,this.dt=this.right/2|0,this.wt=this.bottom/2|0};static clear=()=>{const t=this.ct*this.ft;for(let i=0;i{this.gt(t,i,n,e),this.gt(t,i+s-1,n,e),this.It(t,i,n,s),this.It(t+e-1,i,n,s)};static gt=(t,i,e,s)=>{if(i=this.bottom)return;tthis.right&&(s=this.right-t);const n=t+i*this.ct;for(let t=0;t{if(t=this.right)return;ithis.bottom&&(s=this.bottom-i);const n=t+i*this.ct;for(let t=0;t{const r=Math.abs(e-t),h=Math.abs(s-i),o=t=this.left&&t=this.top&&i-h&&(a-=h,t+=o),e{tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const r=this.ct-e;let h=t+i*this.ct;for(let t=-s;t<0;t++){for(let t=-e;t<0;t++)this.lt[h++]=n;h+=r}};static Et(t,i,e,s,n,r){tthis.right&&(e=this.right-t),i+s>this.bottom&&(s=this.bottom-i);const h=256-r,o=(n>>16&255)*r,l=(n>>8&255)*r,a=(255&n)*r,c=this.ct-e;let f=t+i*this.ct;for(let t=0;t>16&255)*h>>8<<16)+(l+(this.lt[f]>>8&255)*h>>8<<8)+(a+(255&this.lt[f])*h>>8);this.lt[f++]=t}f+=c}}static Tt(t,i,e,s,n){const r=256-n,h=(s>>16&255)*n,o=(s>>8&255)*n,l=(255&s)*n;let a=i-e;a<0&&(a=0);let c=i+e;c>=this.ft&&(c=this.ft-1);for(let s=a;s<=c;s++){const n=s-i,a=0|Math.sqrt(e*e-n*n);let c=t-a;c<0&&(c=0);let f=t+a;f>=this.ct&&(f=this.ct-1);let u=c+s*this.ct;for(let t=c;t<=f;t++){const t=(h+(this.lt[u]>>16&255)*r>>8<<16)+(o+(this.lt[u]>>8&255)*r>>8<<8)+(l+(255&this.lt[u])*r>>8);this.lt[u++]=t}}}static bt=(t,i,e)=>{t=this.right||i=this.bottom||(this.lt[t+i*this.ct]=e)}}const p=document.getElementById('canvas'),A=p.getContext('2d',{willReadFrequently:!0}),_=document.createElement('canvas'),g=document.createElement('img'),I=_.getContext('2d',{willReadFrequently:!0});class C{Ot;width;height;Rt;vt;lt;constructor(t,i,e=A){this.Rt=e,this.Ot=this.Rt.getImageData(0,0,t,i),this.vt=new Uint32Array(this.Ot.data.buffer),this.lt=new Int32Array(t*i),this.width=t,this.height=i,this.bind()}clear(){this.lt.fill(0)}bind(){m.bind(this.lt,this.width,this.height)}draw(t,i){this.#t(),this.Rt.putImageData(this.Ot,t,i)}#t(){const t=this.lt.length,i=this.lt,e=this.vt;for(let s=0;s>16&255|(t>>8&255)<<8|(255&t)<<16|4278190080}}}const E=async t=>new Promise((i=>setTimeout(i,t))),T=async t=>new Int8Array(await(await fetch(t)).arrayBuffer());class b{Lt;cursor=null;constructor(){const t=new w;t.next=t,t.st=t,this.Lt=t}St(t){t.st&&t.nt(),t.st=this.Lt.st,t.next=this.Lt,t.st&&(t.st.next=t),t.next.st=t}xt(t){t.st&&t.nt(),t.st=this.Lt,t.next=this.Lt.next,t.st.next=t,t.next&&(t.next.st=t)}Mt(){const t=this.Lt.next;return t===this.Lt?null:(t?.nt(),t)}head(){const t=this.Lt.next;return t===this.Lt?(this.cursor=null,null):(this.cursor=t?.next||null,t)}kt(){const t=this.Lt.st;return t===this.Lt?(this.cursor=null,null):(this.cursor=t?.st||null,t)}next(){const t=this.cursor;return t===this.Lt?(this.cursor=null,null):(this.cursor=t?.next||null,t)}st(){const t=this.cursor;return t===this.Lt?(this.cursor=null,null):(this.cursor=t?.st||null,t)}clear(){for(;;){const t=this.Lt.next;if(t===this.Lt)return;t?.nt()}}}class O extends y{static Dt=3988292384;static Nt=new Int32Array(256);static Ft=new Uint32Array(33);static Bt=new b;static Pt=new b;static Ut=new b;static Wt=0;static Gt=0;static Yt=0;static{for(let t=0;t<32;t++)O.Ft[t]=(1<>>=1:i=i>>>1^O.Dt;O.Nt[t]=i}}static Ht=t=>{let i=4294967295;for(let e=0;e>>8^O.Nt[255&(i^t[e])];return~i};view;data;Vt=0;Kt=0;random=null;constructor(t){if(!t)throw new Error('Input src packet array was null!');super(),t instanceof Int8Array?this.data=new Uint8Array(t):this.data=t,this.view=new DataView(this.data.buffer,this.data.byteOffset,this.data.byteLength)}get length(){return this.view.byteLength}get available(){return this.length-this.Vt}static Xt=t=>{let i=null;return 0===t&&O.Wt>0?(O.Wt--,i=O.Bt.Mt()):1===t&&O.Gt>0?(O.Gt--,i=O.Pt.Mt()):2===t&&O.Yt>0&&(O.Yt--,i=O.Ut.Mt()),i?(i.Vt=0,i):new O(0===t?new Uint8Array(100):1===t?new Uint8Array(5e3):new Uint8Array(3e4))};release(){this.Vt=0,100===this.view.byteLength&&O.Wt<1e3?(O.Bt.St(this),O.Wt++):5e3===this.view.byteLength&&O.Gt<250?(O.Pt.St(this),O.Gt++):3e4===this.view.byteLength&&O.Yt<50&&(O.Ut.St(this),O.Yt++)}get jt(){return this.view.getUint8(this.Vt++)}get zt(){return this.view.getInt8(this.Vt++)}get Zt(){const t=this.view.getUint16(this.Vt);return this.Vt+=2,t}get qt(){const t=this.view.getInt16(this.Vt);return this.Vt+=2,t}get Jt(){const t=this.view.getUint8(this.Vt++)<<16|this.view.getUint16(this.Vt);return this.Vt+=2,t}get $t(){const t=this.view.getInt32(this.Vt);return this.Vt+=4,t}get Qt(){const t=this.view.getBigInt64(this.Vt);return this.Vt+=8,t}get ti(){return this.view.getUint8(this.Vt)<128?this.jt-64:this.Zt-49152}get ii(){return this.view.getUint8(this.Vt)<128?this.jt:this.Zt-32768}get ei(){const t=this.view,i=t.byteLength;let e,s='';for(;10!==(e=t.getUint8(this.Vt++))&&this.Vt>16),this.view.setUint16(this.Vt,t),this.Vt+=2}p4(t){this.view.setInt32(this.Vt,t),this.Vt+=4}oi(t){this.view.setInt32(this.Vt,t,!0),this.Vt+=4}li(t){this.view.setBigInt64(this.Vt,t),this.Vt+=8}ai(t){const i=this.view,e=t.length;for(let s=0;s>>3}wi(t){let i=this.Kt>>>3,e=8-(7&this.Kt),s=0;for(this.Kt+=t;t>e;e=8)s+=(this.view.getUint8(i++)&O.Ft[e])<>>e-t&O.Ft[t],s}yi(t,i){const e=this.Vt;this.Vt=0;const s=new Uint8Array(e);this.si(e,0,s);const n=function(t){const i=[];for(;t>0n;)i.unshift(Number(0xffn&t)),t>>=8n;return 128&i[0]&&i.unshift(0),new Uint8Array(i)}(function(t,i,e){let s=1n;for(;i>0n;)i%2n===1n&&(s=s*t%e),t=t*t%e,i>>=1n;return s}(function(t){let i=0n;for(let e=0;e{const s=new O(t.read(i+'.dat')),n=new O(t.read('index.dat'));n.Vt=s.Zt;const r=n.Zt,h=n.Zt,o=n.jt,l=new Int32Array(o);for(let t=1;ts.length||n.Vt>n.length)throw new Error;const a=n.jt,c=n.jt,f=n.Zt,u=n.Zt,d=new R(f,u,l);d.mi=a,d.pi=c,d.Ai=r,d._i=h;const w=d.lt,y=n.jt;if(0===y){const t=d.width*d.height;for(let i=0;im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.Ii(r,n,this.lt,s,o,m.lt,e,h)}Ci(){const t=this.lt,i=this.width,e=this.height;for(let s=0;s>16&255;n+=t,n<0?n=0:n>255&&(n=255);let r=this.palette[s]>>8&255;r+=i,r<0?r=0:r>255&&(r=255);let h=255&this.palette[s];h+=e,h<0?h=0:h>255&&(h=255),this.palette[s]=(n<<16)+(r<<8)+h}}Ti(){this.Ai|=0,this._i|=0,this.Ai/=2,this._i/=2,this.Ai|=0,this._i|=0;const t=new Int8Array(this.Ai*this._i);let i=0;for(let e=0;e>1)+(e+this.pi>>1)*this.Ai]=this.lt[i++];this.lt=t,this.width=this.Ai,this.height=this._i,this.mi=0,this.pi=0}bi(){if(this.width===this.Ai&&this.height===this._i)return;const t=new Int8Array(this.Ai*this._i);let i=0;for(let e=0;e>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t],t=e[s++],0===t?h++:r[h++]=this.palette[255&t]}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=this.palette[255&t]}h+=o,s+=n}}clip(t,i,e,s){try{const n=this.width;this.height;let r=0,h=0;const o=this.Ai,l=this._i,a=(o<<16)/e|0,c=(l<<16)/s|0;t=t+(this.mi*e+o-1)/o|0,i=i+(this.pi*s+l-1)/l|0,this.mi*e%o!=0&&(r=(o-this.mi*e%o<<16)/e|0),this.pi*s%l!=0&&(h=(l-this.pi*s%l<<16)/s|0),e=e*(this.width-(r>>16))/o|0,s=s*(this.height-(h>>16))/l|0;let f,u=t+i*m.ct,d=m.ct-e;im.bottom&&(s-=i+s-m.bottom),tm.right&&(f=t+e-m.right,e-=f,d+=f),this.Oi(m.lt,this.lt,this.palette,r,h,u,d,e,s,a,c,n)}catch(t){console.log('error in sprite clipping routine')}}Oi(t,i,e,s,n,r,h,o,l,a,c,f){try{const u=s;for(let d=-l;d<0;d++){const l=(n>>16)*f;for(let n=-o;n<0;n++){const n=i[(s>>16)+l];0==n?r++:t[r++]=e[255&n],s+=a}n+=c,s=u,r+=h}}catch(t){console.log('error in plot_scale')}}}class v extends Array{constructor(t,i){super(t);for(let e=0;e{this.vi=null,this.vi=null,this.sin=null,this.cos=null,this.Mi=null,this.Si=null,this.Vi=null,this.Ki=null,this.Bi=null,this.Pi=null,this.Gi=null,this.palette=null,this.Yi=null,console.log('Draw3D unloaded!')};static ji=()=>{this.Mi=new Int32Array(m.ft);for(let t=0;t{this.Mi=new Int32Array(i);for(let e=0;e{this.Bi=null,this.Pi.fill(null)};static qi=t=>{this.xi=0;for(let i=0;i<50;i++)try{this.Si[i]=R.gi(t,i.toString()),this.Ri&&128===this.Si[i]?.Ai?this.Si[i]?.Ti():this.Si[i]?.bi(),this.xi++}catch(t){}};static Ji=t=>{if(0!==this.Ki[t])return this.Ki[t];const i=this.Yi[t];if(!i)return 0;let e=0,s=0,n=0;const r=i.length;for(let t=0;t>16&255,s+=i[t]>>8&255,n+=255&i[t];let h=(e/r<<16)+(s/r<<8)+(n/r|0);return h=this.$i(h,1.4),0===h&&(h=1),this.Ki[t]=h,h};static Qi=t=>{const i=t+.03*Math.random()-.015;let e=0;for(let t=0;t<512;t++){const s=(t/8|0)/64+.0078125,n=(7&t)/8+.0625;for(let t=0;t<128;t++){const r=t/128;let h=r,o=r,l=r;if(0!==n){let t;t=r<.5?r*(n+1):r+n-r*n;const i=2*r-t;let e=s+.3333333333333333;e>1&&e--;let a=s-.3333333333333333;a<0&&a++,h=6*e<1?i+6*(t-i)*e:2*e<1?t:3*e<2?i+(t-i)*(.6666666666666666-e)*6:i,o=6*s<1?i+6*(t-i)*s:2*s<1?t:3*s<2?i+(t-i)*(.6666666666666666-s)*6:i,l=6*a<1?i+6*(t-i)*a:2*a<1?t:3*a<2?i+(t-i)*(.6666666666666666-a)*6:i}const a=((256*h|0)<<16)+((256*o|0)<<8)+(256*l|0);this.palette[e++]=this.$i(a,i)}}for(let t=0;t<50;t++){const e=this.Si[t];if(!e)continue;const s=e.palette;this.Yi[t]=new Int32Array(s.length);for(let e=0;e{const e=(t>>16)/256,s=(t>>8&255)/256,n=(255&t)/256;return((256*Math.pow(e,i)|0)<<16)+((256*Math.pow(s,i)|0)<<8)+(256*Math.pow(n,i)|0)};static ie=t=>{this.Bi||(this.Ui=t,this.Ri?this.Bi=new k(t,16384):this.Bi=new k(t,65536),this.Pi.fill(null))};static ee=(t,i,e,s,n,r,h,o,l)=>{let a=0,c=0;n!==s&&(a=(i-t<<16)/(n-s)|0,c=(o-h<<15)/(n-s)|0);let f=0,u=0;r!==n&&(f=(e-i<<16)/(r-n)|0,u=(l-o<<15)/(r-n)|0);let d=0,w=0;if(r!==s&&(d=(t-e<<16)/(s-r)|0,w=(h-l<<15)/(s-r)|0),s<=n&&s<=r){if(sm.bottom&&(n=m.bottom),r>m.bottom&&(r=m.bottom),nf)for(r-=n,n-=s,s=N.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.se(e>>16,i>>16,l>>7,o>>7,m.lt,s,0),e+=d,i+=f,l+=w,o+=u,s+=m.ct}this.se(e>>16,t>>16,l>>7,h>>7,m.lt,s,0),e+=d,t+=a,l+=w,h+=c,s+=m.ct}else for(r-=n,n-=s,s=N.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.se(i>>16,e>>16,o>>7,l>>7,m.lt,s,0),e+=d,i+=f,l+=w,o+=u,s+=m.ct}this.se(t>>16,e>>16,h>>7,l>>7,m.lt,s,0),e+=d,t+=a,l+=w,h+=c,s+=m.ct}else if(i=t<<=16,o=h<<=15,s<0&&(i-=d*s,t-=a*s,o-=w*s,h-=c*s,s=0),e<<=16,l<<=15,r<0&&(e-=f*r,l-=u*r,r=0),s!==r&&da)for(n-=r,r-=s,s=N.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.se(e>>16,t>>16,l>>7,h>>7,m.lt,s,0),e+=f,t+=a,l+=u,h+=c,s+=m.ct}this.se(i>>16,t>>16,o>>7,h>>7,m.lt,s,0),i+=d,t+=a,o+=w,h+=c,s+=m.ct}else for(n-=r,r-=s,s=N.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.se(t>>16,e>>16,h>>7,l>>7,m.lt,s,0),e+=f,t+=a,l+=u,h+=c,s+=m.ct}this.se(t>>16,i>>16,h>>7,o>>7,m.lt,s,0),i+=d,t+=a,o+=w,h+=c,s+=m.ct}}else if(n<=r){if(nm.bottom&&(r=m.bottom),s>m.bottom&&(s=m.bottom),rd)for(s-=r,r-=n,n=N.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.se(t>>16,e>>16,h>>7,l>>7,m.lt,n,0),t+=a,e+=d,h+=c,l+=w,n+=m.ct}this.se(t>>16,i>>16,h>>7,o>>7,m.lt,n,0),t+=a,i+=f,h+=c,o+=u,n+=m.ct}else for(s-=r,r-=n,n=N.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.se(e>>16,t>>16,l>>7,h>>7,m.lt,n,0),t+=a,e+=d,h+=c,l+=w,n+=m.ct}this.se(i>>16,t>>16,o>>7,h>>7,m.lt,n,0),t+=a,i+=f,h+=c,o+=u,n+=m.ct}else if(e=i<<=16,l=o<<=15,n<0&&(e-=a*n,i-=f*n,l-=c*n,o-=u*n,n=0),t<<=16,h<<=15,s<0&&(t-=d*s,h-=w*s,s=0),r-=s,s-=n,n=N.Mi[n],a>16,i>>16,h>>7,o>>7,m.lt,n,0),t+=d,i+=f,h+=w,o+=u,n+=m.ct}this.se(e>>16,i>>16,l>>7,o>>7,m.lt,n,0),e+=a,i+=f,l+=c,o+=u,n+=m.ct}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.se(i>>16,t>>16,o>>7,h>>7,m.lt,n,0),t+=d,i+=f,h+=w,o+=u,n+=m.ct}this.se(i>>16,e>>16,o>>7,l>>7,m.lt,n,0),e+=a,i+=f,l+=c,o+=u,n+=m.ct}}else if(rm.bottom&&(s=m.bottom),n>m.bottom&&(n=m.bottom),s>16,t>>16,o>>7,h>>7,m.lt,r,0),i+=f,t+=a,o+=u,h+=c,r+=m.ct}this.se(i>>16,e>>16,o>>7,l>>7,m.lt,r,0),i+=f,e+=d,o+=u,l+=w,r+=m.ct}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.se(t>>16,i>>16,h>>7,o>>7,m.lt,r,0),i+=f,t+=a,o+=u,h+=c,r+=m.ct}this.se(e>>16,i>>16,l>>7,o>>7,m.lt,r,0),i+=f,e+=d,o+=u,l+=w,r+=m.ct}else if(t=e<<=16,h=l<<=15,r<0&&(t-=f*r,e-=d*r,h-=u*r,l-=w*r,r=0),i<<=16,o<<=15,n<0&&(i-=a*n,o-=c*n,n=0),s-=n,n-=r,r=N.Mi[r],f>16,e>>16,o>>7,l>>7,m.lt,r,0),i+=a,e+=d,o+=c,l+=w,r+=m.ct}this.se(t>>16,e>>16,h>>7,l>>7,m.lt,r,0),t+=f,e+=d,h+=u,l+=w,r+=m.ct}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.se(e>>16,i>>16,l>>7,o>>7,m.lt,r,0),i+=a,e+=d,o+=c,l+=w,r+=m.ct}this.se(e>>16,t>>16,l>>7,h>>7,m.lt,r,0),t+=f,e+=d,h+=u,l+=w,r+=m.ct}};static se=(t,i,e,s,n,r,h)=>{let o;if(N.Ni){let l;if(N.Fi){if(l=i-t>3?(s-e)/(i-t)|0:0,i>m.ut&&(i=m.ut),t<0&&(e-=t*l,t=0),t>=i)return;r+=t,h=i-t>>2,l<<=2}else{if(!(t>2)>0?(s-e)*N.vi[h]>>15:0}if(0===N.alpha)for(;;){if(--h<0){if((h=i-t&3)>0){o=N.palette[e>>8];do{n[r++]=o,h--}while(h>0);return}break}o=N.palette[e>>8],e+=l,n[r++]=o,n[r++]=o,n[r++]=o,n[r++]=o}else{const s=N.alpha,a=256-N.alpha;for(;;){if(--h<0){if((h=i-t&3)>0){o=N.palette[e>>8],o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280);do{n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),h--}while(h>0)}break}o=N.palette[e>>8],e+=l,o=((16711935&o)*a>>8&16711935)+((65280&o)*a>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280),n[r++]=o+((16711935&n[r])*s>>8&16711935)+((65280&n[r])*s>>8&65280)}}}else if(tm.ut&&(i=m.ut),t<0&&(e-=t*l,t=0),t>=i))return;if(r+=t,h=i-t,0===N.alpha)do{n[r++]=N.palette[e>>8],e+=l,h--}while(h>0);else{const t=N.alpha,i=256-N.alpha;do{o=N.palette[e>>8],e+=l,o=((16711935&o)*i>>8&16711935)+((65280&o)*i>>8&65280),n[r++]=o+((16711935&n[r])*t>>8&16711935)+((65280&n[r])*t>>8&65280),h--}while(h>0)}}};static ne=(t,i,e,s,n,r,h)=>{let o=0;n!==s&&(o=(i-t<<16)/(n-s)|0);let l=0;r!==n&&(l=(e-i<<16)/(r-n)|0);let a=0;if(r!==s&&(a=(t-e<<16)/(s-r)|0),s<=n&&s<=r){if(sm.bottom&&(n=m.bottom),r>m.bottom&&(r=m.bottom),nl)for(r-=n,n-=s,s=this.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.re(e>>16,i>>16,m.lt,s,h),e+=a,i+=l,s+=m.ct}this.re(e>>16,t>>16,m.lt,s,h),e+=a,t+=o,s+=m.ct}else for(r-=n,n-=s,s=this.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.re(i>>16,e>>16,m.lt,s,h),e+=a,i+=l,s+=m.ct}this.re(t>>16,e>>16,m.lt,s,h),e+=a,t+=o,s+=m.ct}else if(i=t<<=16,s<0&&(i-=a*s,t-=o*s,s=0),e<<=16,r<0&&(e-=l*r,r=0),s!==r&&ao)for(n-=r,r-=s,s=this.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.re(e>>16,t>>16,m.lt,s,h),e+=l,t+=o,s+=m.ct}this.re(i>>16,t>>16,m.lt,s,h),i+=a,t+=o,s+=m.ct}else for(n-=r,r-=s,s=this.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.re(t>>16,e>>16,m.lt,s,h),e+=l,t+=o,s+=m.ct}this.re(t>>16,i>>16,m.lt,s,h),i+=a,t+=o,s+=m.ct}}else if(n<=r){if(nm.bottom&&(r=m.bottom),s>m.bottom&&(s=m.bottom),ra)for(s-=r,r-=n,n=this.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.re(t>>16,e>>16,m.lt,n,h),t+=o,e+=a,n+=m.ct}this.re(t>>16,i>>16,m.lt,n,h),t+=o,i+=l,n+=m.ct}else for(s-=r,r-=n,n=this.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.re(e>>16,t>>16,m.lt,n,h),t+=o,e+=a,n+=m.ct}this.re(i>>16,t>>16,m.lt,n,h),t+=o,i+=l,n+=m.ct}else if(e=i<<=16,n<0&&(e-=o*n,i-=l*n,n=0),t<<=16,s<0&&(t-=a*s,s=0),o>16,i>>16,m.lt,n,h),t+=a,i+=l,n+=m.ct}this.re(e>>16,i>>16,m.lt,n,h),e+=o,i+=l,n+=m.ct}else for(r-=s,s-=n,n=this.Mi[n];;){if(--s<0)for(;;){if(--r<0)return;this.re(i>>16,t>>16,m.lt,n,h),t+=a,i+=l,n+=m.ct}this.re(i>>16,e>>16,m.lt,n,h),e+=o,i+=l,n+=m.ct}}else if(rm.bottom&&(s=m.bottom),n>m.bottom&&(n=m.bottom),s>16,t>>16,m.lt,r,h),i+=l,t+=o,r+=m.ct}this.re(i>>16,e>>16,m.lt,r,h),i+=l,e+=a,r+=m.ct}else for(n-=s,s-=r,r=this.Mi[r];;){if(--s<0)for(;;){if(--n<0)return;this.re(t>>16,i>>16,m.lt,r,h),i+=l,t+=o,r+=m.ct}this.re(e>>16,i>>16,m.lt,r,h),i+=l,e+=a,r+=m.ct}else if(t=e<<=16,r<0&&(t-=l*r,e-=a*r,r=0),i<<=16,n<0&&(i-=o*n,n=0),l>16,e>>16,m.lt,r,h),i+=o,e+=a,r+=m.ct}this.re(t>>16,e>>16,m.lt,r,h),t+=l,e+=a,r+=m.ct}else for(s-=n,n-=r,r=this.Mi[r];;){if(--n<0)for(;;){if(--s<0)return;this.re(e>>16,i>>16,m.lt,r,h),i+=o,e+=a,r+=m.ct}this.re(e>>16,t>>16,m.lt,r,h),t+=l,e+=a,r+=m.ct}};static he=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,p,A,_)=>{const g=this.oe(_);this.Hi=!this.Vi[_];const I=a-u,C=c-w,E=f-p,T=d-a,b=y-c,O=A-f;let R=T*c-b*a<<14;const v=b*f-O*c<<8,L=O*a-T*f<<5;let S=I*c-C*a<<14;const x=C*f-E*c<<8,M=E*a-I*f<<5;let k=C*T-I*b<<14;const D=E*b-C*O<<8,N=I*O-E*T<<5;let F=0,B=0;n!==s&&(F=(i-t<<16)/(n-s)|0,B=(o-h<<16)/(n-s)|0);let P=0,U=0;r!==n&&(P=(e-i<<16)/(r-n)|0,U=(l-o<<16)/(r-n)|0);let W=0,G=0;if(r!==s&&(W=(t-e<<16)/(s-r)|0,G=(h-l<<16)/(s-r)|0),s<=n&&s<=r){if(sm.bottom&&(n=m.bottom),r>m.bottom&&(r=m.bottom),nP)for(r-=n,n-=s,s=this.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.le(e>>16,i>>16,m.lt,s,g,0,0,R,S,k,v,x,D,l>>8,o>>8),e+=W,i+=P,l+=G,o+=U,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(e>>16,t>>16,m.lt,s,g,0,0,R,S,k,v,x,D,l>>8,h>>8),e+=W,t+=F,l+=G,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(r-=n,n-=s,s=this.Mi[s];;){if(--n<0)for(;;){if(--r<0)return;this.le(i>>16,e>>16,m.lt,s,g,0,0,R,S,k,v,x,D,o>>8,l>>8),e+=W,i+=P,l+=G,o+=U,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(t>>16,e>>16,m.lt,s,g,0,0,R,S,k,v,x,D,h>>8,l>>8),e+=W,t+=F,l+=G,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}else{i=t<<=16,o=h<<=16,s<0&&(i-=W*s,t-=F*s,o-=G*s,h-=B*s,s=0),e<<=16,l<<=16,r<0&&(e-=P*r,l-=U*r,r=0);const a=s-this.Di;if(R+=L*a,S+=M*a,k+=N*a,R|=0,S|=0,k|=0,(s===r||W>=F)&&(s!==r||P<=F))for(n-=r,r-=s,s=this.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.le(t>>16,e>>16,m.lt,s,g,0,0,R,S,k,v,x,D,h>>8,l>>8),e+=P,t+=F,l+=U,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(t>>16,i>>16,m.lt,s,g,0,0,R,S,k,v,x,D,h>>8,o>>8),i+=W,t+=F,o+=G,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(n-=r,r-=s,s=this.Mi[s];;){if(--r<0)for(;;){if(--n<0)return;this.le(e>>16,t>>16,m.lt,s,g,0,0,R,S,k,v,x,D,l>>8,h>>8),e+=P,t+=F,l+=U,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(i>>16,t>>16,m.lt,s,g,0,0,R,S,k,v,x,D,o>>8,h>>8),i+=W,t+=F,o+=G,h+=B,s+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}}else if(n<=r){if(nm.bottom&&(r=m.bottom),s>m.bottom&&(s=m.bottom),rW)for(s-=r,r-=n,n=this.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.le(t>>16,e>>16,m.lt,n,g,0,0,R,S,k,v,x,D,h>>8,l>>8),t+=F,e+=W,h+=B,l+=G,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(t>>16,i>>16,m.lt,n,g,0,0,R,S,k,v,x,D,h>>8,o>>8),t+=F,i+=P,h+=B,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(s-=r,r-=n,n=this.Mi[n];;){if(--r<0)for(;;){if(--s<0)return;this.le(e>>16,t>>16,m.lt,n,g,0,0,R,S,k,v,x,D,l>>8,h>>8),t+=F,e+=W,h+=B,l+=G,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(i>>16,t>>16,m.lt,n,g,0,0,R,S,k,v,x,D,o>>8,h>>8),t+=F,i+=P,h+=B,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}else{e=i<<=16,l=o<<=16,n<0&&(e-=F*n,i-=P*n,l-=B*n,o-=U*n,n=0),t<<=16,h<<=16,s<0&&(t-=W*s,h-=G*s,s=0);const a=n-this.Di;if(R+=L*a,S+=M*a,k+=N*a,R|=0,S|=0,k|=0,r-=s,s-=n,n=this.Mi[n],F>16,i>>16,m.lt,n,g,0,0,R,S,k,v,x,D,h>>8,o>>8),t+=W,i+=P,h+=G,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(e>>16,i>>16,m.lt,n,g,0,0,R,S,k,v,x,D,l>>8,o>>8),e+=F,i+=P,l+=B,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(;;){if(--s<0)for(;;){if(--r<0)return;this.le(i>>16,t>>16,m.lt,n,g,0,0,R,S,k,v,x,D,o>>8,h>>8),t+=W,i+=P,h+=G,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(i>>16,e>>16,m.lt,n,g,0,0,R,S,k,v,x,D,o>>8,l>>8),e+=F,i+=P,l+=B,o+=U,n+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}}else if(rm.bottom&&(s=m.bottom),n>m.bottom&&(n=m.bottom),s>16,t>>16,m.lt,r,g,0,0,R,S,k,v,x,D,o>>8,h>>8),i+=P,t+=F,o+=U,h+=B,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(i>>16,e>>16,m.lt,r,g,0,0,R,S,k,v,x,D,o>>8,l>>8),i+=P,e+=W,o+=U,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(;;){if(--s<0)for(;;){if(--n<0)return;this.le(t>>16,i>>16,m.lt,r,g,0,0,R,S,k,v,x,D,h>>8,o>>8),i+=P,t+=F,o+=U,h+=B,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(e>>16,i>>16,m.lt,r,g,0,0,R,S,k,v,x,D,l>>8,o>>8),i+=P,e+=W,o+=U,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}else{t=e<<=16,h=l<<=16,r<0&&(t-=P*r,e-=W*r,h-=U*r,l-=G*r,r=0),i<<=16,o<<=16,n<0&&(i-=F*n,o-=B*n,n=0);const a=r-this.Di;if(R+=L*a,S+=M*a,k+=N*a,R|=0,S|=0,k|=0,s-=n,n-=r,r=this.Mi[r],P>16,e>>16,m.lt,r,g,0,0,R,S,k,v,x,D,o>>8,l>>8),i+=F,e+=W,o+=B,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(t>>16,e>>16,m.lt,r,g,0,0,R,S,k,v,x,D,h>>8,l>>8),t+=P,e+=W,h+=U,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}else for(;;){if(--n<0)for(;;){if(--s<0)return;this.le(e>>16,i>>16,m.lt,r,g,0,0,R,S,k,v,x,D,l>>8,o>>8),i+=F,e+=W,o+=B,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}this.le(e>>16,t>>16,m.lt,r,g,0,0,R,S,k,v,x,D,l>>8,h>>8),t+=P,e+=W,h+=U,l+=G,r+=m.ct,R+=L,S+=M,k+=N,R|=0,S|=0,k|=0}}};static le=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w)=>{if(t>=i)return;let y,p,A,_,g,I,C,E,T;if(this.Fi){if(y=(w-d)/(i-t)|0,i>m.ut&&(i=m.ut),t<0&&(d-=t*y,t=0),t>=i)return;p=i-t>>3,y<<=12}else i-t>7?(p=i-t>>3,y=(w-d)*this.vi[p]>>6):(p=0,y=0);if(d<<=9,s+=t,this.Ri&&n)if(A=0,_=0,I=t-this.ki,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(h=l/g|0,(r=o/g|0)<0?r=0:r>4032&&(r=4032)),o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>4032&&(A=4032)),C=A-r>>3,E=_-h>>3,r+=d>>3&786432,T=d>>23,this.Hi){for(;p-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E,e[s++]=n[(4032&h)+(r>>6)]>>>T,r=A,h=_,o+=c,l+=f,g=(a+=u)>>12,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>4032&&(A=4032)),C=A-r>>3,E=_-h>>3,r+=(d+=y)>>3&786432,T=d>>23;for(p=i-t&7;p-- >0;)e[s++]=n[(4032&h)+(r>>6)]>>>T,r+=C,h+=E}else{for(;p-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>T)&&(e[s]=t),s+=1,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s++,0!=(t=n[(4032&(h+=E))+((r+=C)>>6)]>>>T)&&(e[s]=t),s+=1,r=A,h=_,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>12,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>4032&&(A=4032)),C=A-r>>3,E=_-h>>3,r+=(d+=y)>>3&786432,T=d>>23}for(p=i-t&7;p-- >0;){let t;0!=(t=n[(4032&h)+(r>>6)]>>>T)&&(e[s]=t),s++,r+=C,h+=E}}else if(A=0,_=0,I=t-this.ki,o+=(c>>3)*I,l+=(f>>3)*I,a+=(u>>3)*I,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(h=l/g|0,(r=o/g|0)<0?r=0:r>16256&&(r=16256)),o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>16256&&(A=16256)),C=A-r>>3,E=_-h>>3,r+=6291456&d,T=d>>23,this.Hi&&n){for(;p-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E,e[s++]=n[(16256&h)+(r>>7)]>>>T,r=A,h=_,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>16256&&(A=16256)),C=A-r>>3,E=_-h>>3,r+=6291456&(d+=y),T=d>>23;for(p=i-t&7;p-- >0;)e[s++]=n[(16256&h)+(r>>7)]>>>T,r+=C,h+=E}else{for(;p-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>T)&&(e[s]=t),s+=1,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,0!=(t=n[(16256&(h+=E))+((r+=C)>>7)]>>>T)&&(e[s]=t),s++,r=A,h=_,o+=c,l+=f,a+=u,o|=0,l|=0,g=(a|=0)>>14,0!==g&&(A=o/g|0,_=l/g|0,A<7?A=7:A>16256&&(A=16256)),C=A-r>>3,E=_-h>>3,r+=6291456&(d+=y),T=d>>23}for(p=i-t&7;p-- >0&&n;){let t;0!=(t=n[(16256&h)+(r>>7)]>>>T)&&(e[s]=t),s++,r+=C,h+=E}}};static re=(t,i,e,s,n)=>{if(this.Fi&&(i>m.ut&&(i=m.ut),t<0&&(t=0)),t>=i)return;s+=t;let r=i-t>>2;if(0===this.alpha)for(;;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n}e[s++]=n,e[s++]=n,e[s++]=n,e[s++]=n}const h=this.alpha,o=256-this.alpha;for(n=((16711935&n)*o>>8&16711935)+((65280&n)*o>>8&65280);;){if(r--,r<0)for(r=i-t&3;;){if(r--,r<0)return;e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280),e[s++]=n+((16711935&e[s])*h>>8&16711935)+((65280&e[s])*h>>8&65280)}};static te=t=>{this.Pi[t]&&this.Bi&&(this.Bi[this.Ui++]=this.Pi[t],this.Pi[t]=null)};static oe=t=>{if(this.Gi[t]=this.Wi++,this.Pi[t])return this.Pi[t];let i;if(this.Ui>0&&this.Bi)i=this.Bi[--this.Ui],this.Bi[this.Ui]=null;else{let t=0,e=-1;for(let i=0;i>>3)&16316671,i[n+8192]=r-(r>>>2)&16316671,i[n+12288]=r-(r>>>2)-(r>>>3)&16316671}}else{if(64===e.width)for(let t=0;t<128;t++)for(let n=0;n<128;n++)i[n+(t<<7)]=s[e.lt[(n>>1)+(t>>1<<6)]];else for(let t=0;t<16384;t++)i[t]=s[e.lt[t]];this.Vi[t]=!1;for(let e=0;e<16384;e++){i[e]&=16316671;const s=i[e];0===s&&(this.Vi[t]=!0),i[e+16384]=s-(s>>>3)&16316671,i[e+32768]=s-(s>>>2)&16316671,i[e+49152]=s-(s>>>2)-(s>>>3)&16316671}}return i}}const F=['F11','F12'],B={'Backspace':{code:8,ch:8},'Enter':{code:10,ch:10},'Shift':{code:16,ch:65535},'Escape':{code:27,ch:27},'Tab':{code:9,ch:9},'CapsLock':{code:20,ch:65535},' ':{code:32,ch:32},'Control':{code:17,ch:65535},'Alt':{code:18,ch:65535},'Meta':{code:524,ch:65535},'ArrowLeft':{code:37,ch:65535},'ArrowRight':{code:39,ch:65535},'ArrowUp':{code:38,ch:65535},'ArrowDown':{code:40,ch:65535},'Insert':{code:155,ch:65535},'Home':{code:36,ch:65535},'PageUp':{code:33,ch:65535},'Delete':{code:127,ch:127},'End':{code:35,ch:65535},'PageDown':{code:34,ch:65535},'`':{code:192,ch:96},'~':{code:192,ch:126},'!':{code:49,ch:33},'@':{code:50,ch:64},'#':{code:51,ch:35},'$':{code:52,ch:36},'%':{code:53,ch:37},'^':{code:54,ch:94},'&':{code:55,ch:38},'*':{code:56,ch:42},'(':{code:57,ch:40},')':{code:48,ch:41},'-':{code:45,ch:45},'_':{code:45,ch:95},'=':{code:61,ch:61},'+':{code:61,ch:43},'[':{code:91,ch:91},'{':{code:91,ch:123},']':{code:93,ch:93},'}':{code:93,ch:125},'\\':{code:92,ch:92},'|':{code:92,ch:124},';':{code:59,ch:59},':':{code:59,ch:58},"'":{code:222,ch:39},'"':{code:222,ch:34},',':{code:44,ch:44},'<':{code:44,ch:60},'.':{code:46,ch:46},'>':{code:46,ch:62},'/':{code:47,ch:47},'?':{code:47,ch:63},'F1':{code:112,ch:65535},'F2':{code:113,ch:65535},'F3':{code:114,ch:65535},'F4':{code:115,ch:65535},'F5':{code:116,ch:65535},'F6':{code:117,ch:65535},'F7':{code:118,ch:65535},'F8':{code:119,ch:65535},'F9':{code:120,ch:65535},'F10':{code:121,ch:65535},'F11':{code:122,ch:65535},'F12':{code:123,ch:65535},0:{code:48,ch:48},1:{code:49,ch:49},2:{code:50,ch:50},3:{code:51,ch:51},4:{code:52,ch:52},5:{code:53,ch:53},6:{code:54,ch:54},7:{code:55,ch:55},8:{code:56,ch:56},9:{code:57,ch:57},'a':{code:65,ch:97},'b':{code:66,ch:98},'c':{code:67,ch:99},'d':{code:68,ch:100},'e':{code:69,ch:101},'f':{code:70,ch:102},'g':{code:71,ch:103},'h':{code:72,ch:104},'i':{code:73,ch:105},'j':{code:74,ch:106},'k':{code:75,ch:107},'l':{code:76,ch:108},'m':{code:77,ch:109},'n':{code:78,ch:110},'o':{code:79,ch:111},'p':{code:80,ch:112},'q':{code:81,ch:113},'r':{code:82,ch:114},'s':{code:83,ch:115},'t':{code:84,ch:116},'u':{code:85,ch:117},'v':{code:86,ch:118},'w':{code:87,ch:119},'x':{code:88,ch:120},'y':{code:89,ch:121},'z':{code:90,ch:122},'A':{code:65,ch:65},'B':{code:66,ch:66},'C':{code:67,ch:67},'D':{code:68,ch:68},'E':{code:69,ch:69},'F':{code:70,ch:70},'G':{code:71,ch:71},'H':{code:72,ch:72},'I':{code:73,ch:73},'J':{code:74,ch:74},'K':{code:75,ch:75},'L':{code:76,ch:76},'M':{code:77,ch:77},'N':{code:78,ch:78},'O':{code:79,ch:79},'P':{code:80,ch:80},'Q':{code:81,ch:81},'R':{code:82,ch:82},'S':{code:83,ch:83},'T':{code:84,ch:84},'U':{code:85,ch:85},'V':{code:86,ch:86},'W':{code:87,ch:87},'X':{code:88,ch:88},'Y':{code:89,ch:89},'Z':{code:90,ch:90}};class P{static enabled=!1;static ae=null;static ce=null;static fe=0;static ue=0;static de=0;static we=0;static ye=0;static me=()=>{this.ae=O.Xt(1),this.ce=null,this.fe=performance.now(),this.enabled=!0};static pe=()=>{this.enabled=!1,this.ae=null};static flush=()=>{let t=null;return this.ce&&this.enabled&&(t=this.ce),this.ce=null,t};static stop=()=>{let t=null;return this.ae&&this.ae.Vt>0&&this.enabled&&(t=this.ae),this.pe(),t};static Ae=(t,i,e)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;this.ue++;const s=performance.now();let n=(s-this.fe)/10|0;n>250&&(n=250),this.fe=s,this._e(5),1===e?this.ae?.p1(1):this.ae?.p1(2),this.ae?.p1(n),this.ae?.p3(t+(i<<10))};static ge=t=>{if(!this.enabled)return;this.ue++;const i=performance.now();let e=(i-this.fe)/10|0;e>250&&(e=250),this.fe=i,this._e(2),1===t?this.ae?.p1(3):this.ae?.p1(4),this.ae?.p1(e)};static Ie=(t,i)=>{if(!(this.enabled&&t>=0&&t<789&&i>=0&&i<532))return;const e=performance.now();if(e-this.de>=50){this.de=e,this.ue++;let s=(e-this.fe)/10|0;s>250&&(s=250),this.fe=e,t-this.we<8&&t-this.we>=-8&&i-this.ye<8&&i-this.ye>=-8?(this._e(3),this.ae?.p1(5),this.ae?.p1(s),this.ae?.p1(t+(i-this.ye+8<<4)+8-this.we)):t-this.we<128&&t-this.we>=-128&&i-this.ye<128&&i-this.ye>=-128?(this._e(4),this.ae?.p1(6),this.ae?.p1(s),this.ae?.p1(t+128-this.we),this.ae?.p1(i+128-this.ye)):(this._e(5),this.ae?.p1(7),this.ae?.p1(s),this.ae?.p3(t+(i<<10))),this.we=t,this.ye=i}};static Ce=t=>{if(!this.enabled)return;this.ue++;const i=performance.now();let e=(i-this.fe)/10|0;e>250&&(e=250),this.fe=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this._e(3),this.ae?.p1(8),this.ae?.p1(e),this.ae?.p1(t)};static Ee=t=>{if(!this.enabled)return;this.ue++;const i=performance.now();let e=(i-this.fe)/10|0;e>250&&(e=250),this.fe=i,1e3===t?t=11:1001===t?t=12:1002===t?t=14:1003===t?t=15:t>=1008&&(t-=992),this._e(3),this.ae?.p1(9),this.ae?.p1(e),this.ae?.p1(t)};static Te=()=>{if(!this.enabled)return;this.ue++;const t=performance.now();let i=(t-this.fe)/10|0;i>250&&(i=250),this.fe=t,this._e(2),this.ae?.p1(10),this.ae?.p1(i)};static be=()=>{if(!this.enabled)return;this.ue++;const t=performance.now();let i=(t-this.fe)/10|0;i>250&&(i=250),this.fe=t,this._e(2),this.ae?.p1(11),this.ae?.p1(i)};static Oe=()=>{if(!this.enabled)return;this.ue++;const t=performance.now();let i=(t-this.fe)/10|0;i>250&&(i=250),this.fe=t,this._e(2),this.ae?.p1(12),this.ae?.p1(i)};static Re=()=>{if(!this.enabled)return;this.ue++;const t=performance.now();let i=(t-this.fe)/10|0;i>250&&(i=250),this.fe=t,this._e(2),this.ae?.p1(13),this.ae?.p1(i)};static _e=t=>{if(this.ae&&this.ae.Vt+t>=500){const t=this.ae;this.ae=O.Xt(1),this.ce=t}}}class U{static getParameter(t){return new URLSearchParams(window.location.search).get(t)??''}static setParameter(t,i){const e=new URL(window.location.toString());e.searchParams.set(t,i),window.history.pushState(null,'',e.toString())}ve=0;Le=[];Se=0;xe=null;state=0;Me=20;ke=1;De=[];Ne=0;Fe=0;Be=[];Pe=!0;Ue=!1;We=50;hasFocus=!0;Ge=!1;Ye=0;He=0;Ve=0;Ke=0;Xe=0;je=0;ze=0;Ze=[];qe=[];Je=0;$e=0;input=null;Qe=!1;ts=!1;es=!1;time=-1;ss=0;ns=0;rs=0;hs=0;os=0;ls=0;constructor(t=!1){p.tabIndex=-1,A.fillStyle='black',A.fillRect(0,0,p.width,p.height),this.Ue=t,this.Ue?this.resize(window.innerWidth,window.innerHeight):this.resize(p.width,p.height)}get width(){return p.width}get height(){return p.height}resize=(t,i)=>{p.width=t,p.height=i,this.xe=new C(t,i),N.ji()};run=async()=>{p.addEventListener('resize',(()=>{this.Ue&&this.resize(window.innerWidth,window.innerHeight)}),!1),p.onmousedown=this.onmousedown,p.onmouseup=this.onmouseup,p.onmouseenter=this.onmouseenter,p.onmouseleave=this.onmouseleave,p.onmousemove=this.onmousemove,window.onbeforeunload=this.Xi,p.onfocus=this.onfocus,p.onblur=this.onblur,this.cs?(p.ontouchstart=this.ontouchstart,p.ontouchend=this.ontouchend,p.ontouchmove=this.ontouchmove):(p.onkeydown=this.onkeydown,p.onkeyup=this.onkeyup),p.oncontextmenu=t=>{t.preventDefault()},window.oncontextmenu=t=>{t.preventDefault()},this.cs&&'low'===U.getParameter('detail')&&(this.We=30),await this.fs(0,'Loading...'),await this.load();for(let t=0;t<10;t++)this.De[t]=performance.now();let t,i=0,e=256,s=1,n=0;for(;this.state>=0;){if(this.state>0&&(this.state--,0===this.state))return void this.us();const r=e,h=s;e=300,s=1,t=performance.now();const o=this.De[i];if(0===o?(e=r,s=h):t>o&&(e=2560*this.Me/(t-o)|0),e<25?e=25:e>256&&(e=256,s=this.Me-(t-o)/10|0),this.De[i]=t,i=(i+1)%10,s>1)for(let t=0;t<10;t++)0!==this.De[t]&&(this.De[t]+=s);for(s0&&(this.Ne=1e3*e/(256*this.Me)|0);const l=performance.now();if(this.Pe&&this.refresh(),await this.draw(),this.Be[this.Fe]=(performance.now()-l)/1e3,this.Fe=(this.Fe+1)%this.Be.length,this.We<50){const i=1e3/this.We-(performance.now()-t);i>0&&await E(i)}}-1===this.state&&this.us()};us=()=>{this.state=-2,this.Xi()};ds=t=>{this.Me=1e3/t|0};ws=t=>{this.We=Math.max(Math.min(50,0|t),0)};start=()=>{this.state>=0&&(this.state=0)};stop=()=>{this.state>=0&&(this.state=4e3/this.Me|0)};destroy=()=>{this.state=-1};load=async()=>{};update=async()=>{};Xi=()=>{};draw=async()=>{};refresh=()=>{};async fs(t,i){const e=this.width,s=this.height;this.Pe&&(A.fillStyle='black',A.fillRect(0,0,e,s),this.Pe=!1);const n=s/2-18;A.fillStyle='rgb(140, 17, 17)',A.rect((e/2|0)-152,n,304,34),A.fillRect((e/2|0)-150,n+2,3*t,30),A.fillStyle='black',A.fillRect((e/2|0)-150+3*t,n+2,300-3*t,30),A.font='bold 13px helvetica, sans-serif',A.textAlign='center',A.fillStyle='white',A.fillText(i,e/2|0,n+22),await E(5)}ys=()=>{let t=-1;return this.$e!==this.Je&&(t=this.qe[this.Je],this.Je=this.Je+1&127),t};get ms(){const t=this.Be.length;let i=0;for(let e=0;ethis.ve&&(this.ve=e),this.Le[this.Se]=e,this.Se=(this.Se+1)%250,e}get ps(){return this.Le.reduce(((t,i)=>t+i),0)/250}onkeydown=t=>{const i=t.key;this.Ye=0;const e=B[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;t.ctrlKey&&(n>='A'.charCodeAt(0)&&n<=']'.charCodeAt(0)||n=='_'.charCodeAt(0)?n-='A'.charCodeAt(0)-1:n>='a'.charCodeAt(0)&&n<='z'.charCodeAt(0)&&(n-='a'.charCodeAt(0)-1)),n<30&&(n=0),s===B.ArrowLeft.code?n=1:s===B.ArrowRight.code?n=2:s===B.ArrowUp.code?n=3:s===B.ArrowDown.code?n=4:s===B.Control.code?n=5:s===B.Shift.code?n=6:s===B.Alt.code?n=7:s===B.Backspace.code||s===B.Delete.code?n=8:s===B.Tab.code?n=9:s===B.Enter.code?n=10:s>=B.F1.code&&s<=B.F12.code?n=s+1008-B.F1.code:s===B.Home.code?n=1e3:s===B.End.code?n=1001:s===B.PageUp.code?n=1002:s===B.PageDown.code&&(n=1003),n>0&&n<128&&(this.Ze[n]=1),n>4&&(this.qe[this.$e]=n,this.$e=this.$e+1&127),P.enabled&&P.Ce(n),F.includes(i)||t.preventDefault()};onkeyup=t=>{const i=t.key;this.Ye=0;const e=B[i];if(!e||0===t.code.length&&!t.isTrusted)return void console.warn(`Unhandled key: ${i}`);const s=e.code;let n=e.ch;n<30&&(n=0),s===B.ArrowLeft.code?n=1:s===B.ArrowRight.code?n=2:s===B.ArrowUp.code?n=3:s===B.ArrowDown.code?n=4:s===B.Control.code?n=5:s===B.Shift.code?n=6:s===B.Alt.code?n=7:s===B.Backspace.code||s===B.Delete.code?n=8:s===B.Tab.code?n=9:s===B.Enter.code?n=10:s>=B.F1.code&&s<=B.F12.code?n=s+1008-B.F1.code:s===B.Home.code?n=1e3:s===B.End.code?n=1001:s===B.PageUp.code?n=1002:s===B.PageDown.code&&(n=1003),n>0&&n<128&&(this.Ze[n]=0),P.enabled&&P.Ee(n),F.includes(i)||t.preventDefault()};onmousedown=t=>{if(this.Qe=!1,(t.clientX>0||t.clientY>0)&&this.As(t),this.Ye=0,this.je=this.Ve,this.ze=this.Ke,this.cs&&!this._s){if(this.gs()||this.Is()||this.Cs())return this.Xe=1,void(this.He=1);t.timeStamp>=this.time+500?(this.Xe=2,this.He=2):(this.Xe=1,this.He=1)}else 2===t.button?(this.Xe=2,this.He=2):(this.Xe=1,this.He=1);P.enabled&&P.Ae(this.je,this.ze,t.buttons)};onmouseup=t=>{this.As(t),this.Ye=0,this.He=0,P.enabled&&P.ge(t.buttons)};onmouseenter=t=>{this.As(t),P.enabled&&P.Oe()};onmouseleave=t=>{this.As(t),this.Ye=0,this.Ve=-1,this.Ke=-1,this.He=0,this.je=-1,this.ze=-1,P.enabled&&P.Re()};onmousemove=t=>{this.As(t),this.Ye=0,P.enabled&&P.Ie(this.Ve,this.Ke)};onfocus=t=>{this.hasFocus=!0,this.Pe=!0,this.refresh(),P.enabled&&P.Te()};onblur=t=>{this.hasFocus=!1,P.enabled&&P.be()};ontouchstart=t=>{if(!this.cs)return;null!==this.input&&(this.input.parentNode?.removeChild(this.input),this.input=null),this.Qe=!0;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.ss=this.os=this.rs=0|i.screenX,this.ns=this.ls=this.hs=0|i.screenY,this.time=t.timeStamp,this.ts=this.Es(),this.es=this.Ts()};ontouchend=t=>{if(!this.cs||!this.Qe)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;if(this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.os=0|i.screenX,this.ls=0|i.screenY,this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.ts&&!this.Es())return void(this.Qe=!1);if(this.es&&!this.Ts())return void(this.Qe=!1);if(this.gs()||this.bs()||this.Is()||this.Cs()){null!==this.input&&(this.input.parentNode?.contains(this.input)&&this.input.parentNode?.removeChild(this.input),this.input=null);const t=document.createElement('input');return this.Is()?(t.setAttribute('id','username'),t.setAttribute('placeholder','Username')):this.Cs()?(t.setAttribute('id','password'),t.setAttribute('placeholder','Password')):this.gs()?(t.setAttribute('id','chatinput'),t.setAttribute('placeholder','Chatinput')):this.bs()&&(t.setAttribute('id','chatpopup'),t.setAttribute('placeholder','Chatpopup')),this.Os?t.setAttribute('type','password'):t.setAttribute('type',this.Cs()?'password':'text'),t.setAttribute('autofocus','autofocus'),t.setAttribute('spellcheck','false'),t.setAttribute('autocomplete','off'),t.setAttribute('style',`position: fixed; left: ${e}px; top: ${s}px; width: 1px; height: 1px; opacity: 0;`),document.body.appendChild(t),t.focus(),t.click(),this.Os&&(t.oninput=t=>{if(!(t instanceof InputEvent))return;const i=t,e=i.data;null!==e&&'insertText'===i.inputType&&this.onkeydown(new KeyboardEvent('keydown',{key:e,code:e}))}),t.onkeydown=t=>{this.Os&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeydown(new KeyboardEvent('keydown',{key:t.key,code:t.key}))},t.onkeyup=t=>{this.Os&&'Enter'!==t.key&&'Backspace'!==t.key||this.onkeyup(new KeyboardEvent('keyup',{key:t.key,code:t.key}))},t.onfocus=t=>{this.input?.parentNode?.removeChild(this.input),this.input=null,this.onfocus(t)},this.input=t,void(this.Qe=!1)}const n=t.timeStamp>=this.time+500,r=Math.abs(this.ss-this.os)>16||Math.abs(this.ns-this.ls)>16;n&&!r?(this.Qe=!0,this.onmousedown(new MouseEvent('mousedown',{buttons:2}))):(this.He=0,this.Qe=!1)};ontouchmove=t=>{if(!this.cs||!this.Qe)return;const i=t.changedTouches[0],e=0|i.clientX,s=0|i.clientY;this.onmousemove(new MouseEvent('mousemove',{clientX:e,clientY:s})),this.os=0|i.screenX,this.ls=0|i.screenY,this.ts&&-1===this.Rs()?(this.rs-this.os>0?this.rotate(2):this.rs-this.os<0&&this.rotate(0),this.hs-this.ls>0?this.rotate(3):this.hs-this.ls<0&&this.rotate(1)):(this.es||-1!==this.Rs())&&this.onmousedown(new MouseEvent('mousedown',{buttons:1})),this.rs=this.os,this.hs=this.ls};get cs(){return['Android','webOS','iPhone','iPad','iPod','BlackBerry','Windows Phone'].some((t=>navigator.userAgent.includes(t)))}get Os(){return['Android'].some((t=>navigator.userAgent.includes(t)))}get _s(){return['Capacitor'].some((t=>navigator.userAgent.includes(t)))}Es=()=>this.Ge&&this.Ve>=8&&this.Ve<=520&&this.Ke>=11&&this.Ke<=345;gs=()=>this.Ge&&-1===this.vs()&&!this.Ls()&&!this.Ss()&&this.Ve>=11&&this.Ve<=506&&this.Ke>=449&&this.Ke<=482;bs=()=>this.Ge&&(this.Ls()||this.Ss())&&this.Ve>=11&&this.Ve<=506&&this.Ke>=383&&this.Ke<=482;Ts=()=>this.Ge&&this.Ve>=562&&this.Ve<=752&&this.Ke>=231&&this.Ke<=492;Is=()=>!this.Ge&&2===this.xs()&&this.Ve>=301&&this.Ve<=562&&this.Ke>=262&&this.Ke<=279;Cs=()=>!this.Ge&&2===this.xs()&&this.Ve>=301&&this.Ve<=562&&this.Ke>=279&&this.Ke<=296;rotate=t=>{0===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowRight',code:'ArrowRight'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowLeft',code:'ArrowLeft'}))):1===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowDown',code:'ArrowDown'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowUp',code:'ArrowUp'}))):2===t?(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowLeft',code:'ArrowLeft'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowRight',code:'ArrowRight'}))):3===t&&(this.onkeyup(new KeyboardEvent('keyup',{key:'ArrowUp',code:'ArrowUp'})),this.onkeydown(new KeyboardEvent('keydown',{key:'ArrowDown',code:'ArrowDown'})))};Ms=()=>null!==document.fullscreenElement;As=t=>{if(this.Ms()){const i=t.target.getBoundingClientRect(),e=window.innerHeight/p.height,s=(window.innerWidth-p.width*e)/2;this.Ve=0|this.ks(t.clientX-i.left-s,0,p.width*e,0,789),this.Ke=0|this.ks(t.clientY-i.top,0,p.height*e,0,532)}else{const i=p.getBoundingClientRect(),e=p.width/i.width,s=p.height/i.height;this.Ve=(t.clientX-i.left)*e|0,this.Ke=(t.clientY-i.top)*s|0}this.Ve<0&&(this.Ve=0),this.Ke<0&&(this.Ke=0),this.Ve>789&&(this.Ve=789),this.Ke>532&&(this.Ke=532)};ks=(t,i,e,s,n)=>(t-i)*(n-s)/(e-i)+s}class W{db;constructor(t){t.onerror=this.onerror,t.onclose=this.onclose,this.db=t}static openDatabase=async()=>await new Promise(((t,i)=>{const e=indexedDB.open('lostcity',1);e.onsuccess=i=>{const e=i.target;console.log('database success!'),t(e.result)},e.onupgradeneeded=t=>{t.target.result.createObjectStore('cache')},e.onerror=t=>{const e=t.target;console.error('database error!: ',e.error),i(e.result)}}));Ds=async t=>await new Promise((i=>{const e=this.db.transaction('cache','readonly').objectStore('cache').get(t);e.onsuccess=()=>{i(e.result)},e.onerror=t=>{i(void 0)}}));Ns=async(t,i)=>await new Promise(((e,s)=>{const n=this.db.transaction('cache','readwrite').objectStore('cache').put(i,t);n.onsuccess=()=>{e()},n.onerror=t=>{s()}}));onclose=t=>{console.log('database close!')};onerror=t=>{console.log('database error!')};Fs=t=>{const i=t.trim();let e=0;for(let t=0;t='A'&&s<='Z'?e+=s.charCodeAt(0)+1-65:s>='a'&&s<='z'?e+=s.charCodeAt(0)+1-97:s>='0'&&s<='9'&&(e+=s.charCodeAt(0)+27-48)}return e}}class G{static Fs=t=>{let i=0;t=t.toUpperCase();for(let e=0;e=this.Ps)return null;if(this.Hs[t])return this.Hs[t];const e=this.Ys[t],s=e+this.Gs[t];if(this.Bs){const i=Uint8Array.from(this.buffer.subarray(e,e+s));return this.Hs[t]=i,i}{const e=Uint8Array.from(i.read(this.Ws[t],this.buffer,this.Gs[t],this.Ys[t]));return this.Hs[t]=e,e}}}class Y{static Ks=new Uint8Array(520);Xs;js;store;constructor(t,i,e){this.Xs=new O(t),this.js=new O(i),this.store=e+1}get Ps(){return this.js.length/6}read(t,i=!1){this.js.Vt=6*t;const e=this.js.Jt;let s=this.js.Jt;if(s<=0||s>this.Xs.length/520)return null;const n=new Uint8Array(e);let r=0;for(let i=0;r512&&(h=512),this.Xs.si(h+8,0,Y.Ks);const o=(255&Y.Ks[0])<<8|255&Y.Ks[1],l=(255&Y.Ks[2])<<8|255&Y.Ks[3],a=(255&Y.Ks[4])<<16|(255&Y.Ks[5])<<8|255&Y.Ks[6],c=255&Y.Ks[7];if(o!==t||l!==i||c!==this.store)return null;if(a<0||a>this.Xs.length/520)return null;for(let t=0;t>>0;if(h.free_u8(e,a),4294967295===s){const t=h.error_message(),i=h.error_message_len(),e=new Uint8Array(h.memory.buffer,t,i),s=(new TextDecoder).decode(e);throw new l(s)}const n=h.buffer()>>>0;return new Uint8Array(h.memory.buffer,n,s)}(n)}}class H{static zs=[];static Zs=t=>{const i=new O(t.read('base_head.dat')),e=new O(t.read('base_type.dat')),s=new O(t.read('base_label.dat')),n=i.Zt;i.Vt+=2;for(let t=0;t{const i=new O(t.read('frame_head.dat')),e=new O(t.read('frame_tran1.dat')),s=new O(t.read('frame_tran2.dat')),n=new O(t.read('frame_del.dat')),r=i.Zt;i.Vt+=2;const h=new Int32Array(500),o=new Int32Array(500),l=new Int32Array(500),a=new Int32Array(500);for(let t=0;t0){if(0!==f.types[t])for(let i=t-1;i>d;i--)if(0===f.types[i]){h[w]=i,o[w]=0,l[w]=0,a[w]=0,w++;break}h[w]=t;let e=0;3===f.types[h[w]]&&(e=128),o[w]=1&i?s.ti:e,l[w]=2&i?s.ti:e,a[w]=4&i?s.ti:e,d=t,w++}}r.length=w,r.Js=new Int32Array(w),r.x=new Int32Array(w),r.y=new Int32Array(w),r.z=new Int32Array(w);for(let t=0;t>7)<2?i=2:i>126&&(i=126),(65408&t)+i):(i<0?i=0:i>127&&(i=127),127-i)}static ir=(t,i,e)=>{const s=t.$s,n=t.Qs,r=t.tn;let h,o,l,a,c;if(i){h=new Int32Array(s);for(let i=0;i{const n=t.$s,r=t.Qs,h=t.tn;let o,l,a,c,f;if(s)o=t.cr,l=t.er,a=t.ur;else{o=new Int32Array(n),l=new Int32Array(n),a=new Int32Array(n);for(let i=0;i{const e=t.$s,s=t.Qs,n=t.tn,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e);for(let i=0;i{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let e=!1,s=!1,n=!1,r=!1,h=0,o=0,l=0,a=-1;for(let c=0;c{let o=-1;const l=t.cr[i],a=t.er[i],c=t.ur[i];for(let t=0;t{if(!j.metadata)throw new Error('cant loading model metadata!!!!!');const i=j.metadata[t];if(!i)throw console.log(`Error model:${t} not found!`),new Error('cant loading model metadata!!!!!');if(!(j.head&&j.mn&&j.pn&&j.An&&j._n&&j.gn&&j.In&&j.Cn&&j.En&&j.Tn&&j.bn&&j.On&&j.Rn&&j.axis))throw new Error('cant loading model!!!!!');const e=i.$s,s=i.Qs,n=i.tn,r=new Int32Array(e),h=new Int32Array(e),o=new Int32Array(e),l=new Int32Array(s),a=new Int32Array(s),c=new Int32Array(s),f=new Int32Array(n),u=new Int32Array(n),d=new Int32Array(n);let w=null;i.hn>=0&&(w=new Int32Array(e));let y=null;i.fn>=0&&(y=new Int32Array(s));let m=null,p=0;i.un>=0?m=new Int32Array(s):p=-i.un-1;let A=null;i.dn>=0&&(A=new Int32Array(s));let _=null;i.wn>=0&&(_=new Int32Array(s));const g=new Int32Array(s);j.In.Vt=i.en,j.Cn.Vt=i.sn,j.En.Vt=i.nn,j.Tn.Vt=i.rn,j.bn.Vt=i.hn;let I,C,E,T=0,b=0,O=0;for(let t=0;t{if(!j.metadata||!j.metadata[i])throw new Error('No model metadata');const e=j.metadata[i];if(e.data=t,!e.data.length)throw new Error('No model data');const s=e.$s,n=e.Qs,r=e.tn,h=new Int32Array(s),o=new Int32Array(s),l=new Int32Array(s),a=new Int32Array(n),c=new Int32Array(n),f=new Int32Array(n),u=new Int32Array(r),d=new Int32Array(r),w=new Int32Array(r);let y=null;e.hn>=0&&(y=new Int32Array(s));let m=null;e.fn>=0&&(m=new Int32Array(n));let p=null,A=0;e.un>=0?p=new Int32Array(n):A=-e.un-1;let _=null;e.dn>=0&&(_=new Int32Array(n));let g=null;e.wn>=0&&(g=new Int32Array(n));const I=new Int32Array(n),C=new O(e.data);C.Vt=e.en;const E=new O(e.data);E.Vt=e.sn;const T=new O(e.data);T.Vt=e.nn;const b=new O(e.data);b.Vt=e.rn;const R=new O(e.data);R.Vt=e.hn;let v,L,S,x=0,M=0,k=0;for(let t=0;tthis.vr&&(this.vr=-e),e>this.Rr&&(this.Rr=e);const n=i*i+s*s;n>this.Or&&(this.Or=n)}this.Or=Math.sqrt(this.Or)+.99|0,this.Sr=Math.sqrt(this.Or*this.Or+this.vr*this.vr)+.99|0,this.Lr=this.Sr+(Math.sqrt(this.Or*this.Or+this.Rr*this.Rr)+.99|0)}Xr(){this.vr=0,this.Rr=0;for(let t=0;tthis.vr&&(this.vr=-i),i>this.Rr&&(this.Rr=i)}this.Sr=Math.sqrt(this.Or*this.Or+this.vr*this.vr)+.99|0,this.Lr=this.Sr+(Math.sqrt(this.Or*this.Or+this.Rr*this.Rr)+.99|0)}jr(){if(this.kr){const t=new Int32Array(256);let i=0;for(let e=0;ei&&(i=s)}this.Fr=new v(i+1,null);for(let e=0;e<=i;e++)this.Fr[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;ei&&(i=s)}this.Br=new v(i+1,null);for(let e=0;e<=i;e++)this.Br[e]=new Int32Array(t[e]),t[e]=0;let e=0;for(;eo;)o=e[h++];r&&r.types&&s.x&&s.y&&s.z&&r.labels&&(i!==o||0===r.types[i])&&this.Zr(s.x[t],s.y[t],s.z[t],r.labels[i],r.types[i])}j.Xn=0,j.jn=0,j.zn=0,h=0,o=e[h++];for(let t=0;to;)o=e[h++];r&&r.types&&n.x&&n.y&&n.z&&r.labels&&(i===o||0===r.types[i])&&this.Zr(n.x[t],n.y[t],n.z[t],r.labels[i],r.types[i])}}else this.qr(t)}qr(t){if(!this.Fr||-1===t||!V.zs[t])return;const i=V.zs[t],e=i.qs;j.Xn=0,j.jn=0,j.zn=0;for(let t=0;t>16;this.ur[t]=this.er[t]*i+this.ur[t]*e>>16,this.er[t]=s}}translate(t,i,e){for(let s=0;s>8;if(this.sr&&this.nr&&this.rr||(this.sr=new Int32Array(this.Qs),this.nr=new Int32Array(this.Qs),this.rr=new Int32Array(this.Qs)),!this.lr){this.lr=new v(this.$s,null);for(let t=0;t8192||m>8192||p>8192||y<-8192||m<-8192||p<-8192;)y>>=1,m>>=1,p>>=1;let A=0|Math.sqrt(y*y+m*m+p*p);if(A<=0&&(A=1),y=256*y/A|0,m=256*m/A|0,p=256*p/A|0,this.hr&&1&this.hr[i]){const r=t+((e*y+s*m+n*p)/(h+(h/2|0))|0);this.Ar&&(this.sr[i]=j.tr(this.Ar[i],r,this.hr[i]))}else{let t=this.lr[r];t&&(t.x+=y,t.y+=m,t.z+=p,t.w++),t=this.lr[o],t&&(t.x+=y,t.y+=m,t.z+=p,t.w++),t=this.lr[l],t&&(t.x+=y,t.y+=m,t.z+=p,t.w++)}}if(r)this.eh(t,h,e,s,n);else{this.ar=new v(this.$s,null);for(let t=0;t>16;for(let s=0;s>16,A=A*u-p*f>>16,p=m),0!==t&&(m=A*l-_*o>>16,_=A*o+_*l>>16,A=m),0!==i&&(m=_*a+p*c>>16,_=_*c-p*a>>16,p=m),p+=n,A+=r,_+=h,m=A*w-_*d>>16,_=A*d+_*w>>16,A=m,j.Sn&&j.xn&&j.Mn&&(j.Mn[s]=_-y,j.Sn[s]=N.ki+((p<<9)/_|0),j.xn[s]=N.Di+((A<<9)/_|0)),this.tn>0&&j.kn&&j.Dn&&j.Nn&&(j.kn[s]=p,j.Dn[s]=A,j.Nn[s]=_)}try{this.rh(!1,!1,0)}catch(t){}}draw(t,i,e,s,n,r,h,o,l){const a=o*n-r*s>>16,c=h*i+a*e>>16,f=this.Or*e>>16,u=c+f;if(u<=50||c>=3500)return;const d=o*s+r*n>>16;let w=d-this.Or<<9;if((w/u|0)>=m.dt)return;let y=d+this.Or<<9;if((y/u|0)<=-m.dt)return;const p=h*e-a*i>>16,A=this.Or*i>>16;let _=p+A<<9;if((_/u|0)<=-m.wt)return;let g=p-(A+(this.vr*e>>16))<<9;if((g/u|0)>=m.wt)return;let I=c-(f+(this.vr*i>>16))<=50,C=!1;if(l>0&&j.Zn){let t=c-f;t<=50&&(t=50),d>0?(w=w/u|0,y=y/t|0):(y=y/u|0,w=w/t|0),p>0?(g=g/u|0,_=_/t|0):(_=_/u|0,g=g/t|0);const i=j.Ve-N.ki,e=j.Ke-N.Di;i>w&&ig&&e<_&&(this.Hr?j.Jn[j.qn++]=l:C=!0)}const E=N.ki,T=N.Di;let b=0,O=0;0!==t&&(b=N.sin[t],O=N.cos[t]);for(let l=0;l>16,d=d*O-f*b>>16,f=a),f+=r,u+=h,d+=o,a=d*s+f*n>>16,d=d*n-f*s>>16,f=a,a=u*e-d*i>>16,d=u*i+d*e>>16,u=a,j.Mn&&(j.Mn[l]=d-c),d>=50&&j.Sn&&j.xn?(j.Sn[l]=E+((f<<9)/d|0),j.xn[l]=T+((u<<9)/d|0)):j.Sn&&(j.Sn[l]=-5e3,I=!0),(I||this.tn>0)&&j.kn&&j.Dn&&j.Nn&&(j.kn[l]=f,j.Dn[l]=u,j.Nn[l]=d)}try{this.rh(I,C,l)}catch(t){}}rh(t,i,e,s=!1){j.$n&&(this.Vr=-1,this.Kr=-1);for(let t=0;tm.ut||l>m.ut||a>m.ut),j.Bn&&j.Fn){const t=((d+w+y)/3|0)+this.Sr;j.Bn[t][j.Fn[t]++]=s,j.$n&&this.hh(j.Ve,j.Ke,c,f,u,o,l,a)&&this.Kr=0;t--){const i=j.Fn[t];if(!(i<=0)&&j.Bn){const e=j.Bn[t];for(let t=0;t=0;t--){const i=j.Fn[t];if(i>0&&j.Bn){const e=j.Bn[t];for(let s=0;s0||j.Pn[2]>0)&&(n=(j.Yn[1]+j.Yn[2])/(j.Pn[1]+j.Pn[2])|0);let r=0;j.Pn&&j.Yn&&(j.Pn[3]>0||j.Pn[4]>0)&&(r=(j.Yn[3]+j.Yn[4])/(j.Pn[3]+j.Pn[4])|0);let h=0;if(j.Pn&&j.Yn&&(j.Pn[6]>0||j.Pn[8]>0)&&(h=(j.Yn[6]+j.Yn[8])/(j.Pn[6]+j.Pn[8])|0),j.Pn&&j.Un){let t,i=0,e=j.Pn[10],o=j.Un[10],l=j.Wn;i===e&&(i=0,e=j.Pn[11],o=j.Un[11],l=j.Gn),t=in;)try{this.oh(o[i++],s),i===e&&o!==j.Un[11]&&(i=0,e=j.Pn[11],o=j.Un[11],l=j.Gn),t=ir;)try{this.oh(o[i++],s),i===e&&o!==j.Un[11]&&(i=0,e=j.Pn[11],o=j.Un[11],l=j.Gn),t=ih;)try{this.oh(o[i++],s),i===e&&o!==j.Un[11]&&(i=0,e=j.Pn[11],o=j.Un[11],l=j.Gn),t=i>2,r=this._r[i],h=this.gr[i],o=this.Ir[i];N.he(j.Sn[e],j.Sn[s],j.Sn[n],j.xn[e],j.xn[s],j.xn[n],this.sr[t],this.nr[t],this.rr[t],j.kn[r],j.Dn[r],j.Nn[r],j.kn[h],j.kn[o],j.Dn[h],j.Dn[o],j.Nn[h],j.Nn[o],this.Ar[t])}else if(3===r&&this.hr&&this.Ar&&this.sr&&j.Sn&&j.xn&&j.kn&&j.Dn&&j.Nn){const i=this.hr[t]>>2,r=this._r[i],h=this.gr[i],o=this.Ir[i];N.he(j.Sn[e],j.Sn[s],j.Sn[n],j.xn[e],j.xn[s],j.xn[n],this.sr[t],this.sr[t],this.sr[t],j.kn[r],j.Dn[r],j.Nn[r],j.kn[h],j.kn[o],j.Dn[h],j.Dn[o],j.Nn[h],j.Nn[o],this.Ar[t])}}lh(t,i=!1){let e=0;if(j.Nn){const i=N.ki,s=N.Di,n=this.dr[t],r=this.wr[t],h=this.yr[t],o=j.Nn[n],l=j.Nn[r],a=j.Nn[h];if(o>=50&&j.Sn&&j.xn&&this.sr)j.Hn[e]=j.Sn[n],j.Vn[e]=j.xn[n],j.Kn[e++]=this.sr[t];else if(j.kn&&j.Dn&&this.sr){const c=j.kn[n],f=j.Dn[n],u=this.sr[t];if(a>=50&&this.rr){const n=(50-o)*N.Li[a-o];j.Hn[e]=i+((c+((j.kn[h]-c)*n>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[h]-f)*n>>16)<<9)/50|0),j.Kn[e++]=u+((this.rr[t]-u)*n>>16)}if(l>=50&&this.nr){const n=(50-o)*N.Li[l-o];j.Hn[e]=i+((c+((j.kn[r]-c)*n>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[r]-f)*n>>16)<<9)/50|0),j.Kn[e++]=u+((this.nr[t]-u)*n>>16)}}if(l>=50&&j.Sn&&j.xn&&this.nr)j.Hn[e]=j.Sn[r],j.Vn[e]=j.xn[r],j.Kn[e++]=this.nr[t];else if(j.kn&&j.Dn&&this.nr){const c=j.kn[r],f=j.Dn[r],u=this.nr[t];if(o>=50&&this.sr){const r=(50-l)*N.Li[o-l];j.Hn[e]=i+((c+((j.kn[n]-c)*r>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[n]-f)*r>>16)<<9)/50|0),j.Kn[e++]=u+((this.sr[t]-u)*r>>16)}if(a>=50&&this.rr){const n=(50-l)*N.Li[a-l];j.Hn[e]=i+((c+((j.kn[h]-c)*n>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[h]-f)*n>>16)<<9)/50|0),j.Kn[e++]=u+((this.rr[t]-u)*n>>16)}}if(a>=50&&j.Sn&&j.xn&&this.rr)j.Hn[e]=j.Sn[h],j.Vn[e]=j.xn[h],j.Kn[e++]=this.rr[t];else if(j.kn&&j.Dn&&this.rr){const c=j.kn[h],f=j.Dn[h],u=this.rr[t];if(l>=50&&this.nr){const n=(50-a)*N.Li[l-a];j.Hn[e]=i+((c+((j.kn[r]-c)*n>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[r]-f)*n>>16)<<9)/50|0),j.Kn[e++]=u+((this.nr[t]-u)*n>>16)}if(o>=50&&this.sr){const r=(50-a)*N.Li[o-a];j.Hn[e]=i+((c+((j.kn[n]-c)*r>>16)<<9)/50|0),j.Vn[e]=s+((f+((j.Dn[n]-f)*r>>16)<<9)/50|0),j.Kn[e++]=u+((this.sr[t]-u)*r>>16)}}}const s=j.Hn[0],n=j.Hn[1],r=j.Hn[2],h=j.Vn[0],o=j.Vn[1],l=j.Vn[2];if(!((s-n)*(l-o)-(h-o)*(r-n)<=0))if(N.Fi=!1,3===e){let e;if((s<0||n<0||r<0||s>m.ut||n>m.ut||r>m.ut)&&(N.Fi=!0),e=this.hr?3&this.hr[t]:0,i)N.Ct(s,n,h,o,j.Kn[0]),N.Ct(n,r,o,l,j.Kn[1]),N.Ct(r,s,l,h,j.Kn[2]);else if(0===e)N.ee(s,n,r,h,o,l,j.Kn[0],j.Kn[1],j.Kn[2]);else if(1===e&&this.sr)N.ne(s,n,r,h,o,l,N.palette[this.sr[t]]);else if(2===e&&this.hr&&this.Ar&&j.kn&&j.Dn&&j.Nn){const i=this.hr[t]>>2,e=this._r[i],a=this.gr[i],c=this.Ir[i];N.he(s,n,r,h,o,l,j.Kn[0],j.Kn[1],j.Kn[2],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t])}else if(3===e&&this.hr&&this.Ar&&this.sr&&j.kn&&j.Dn&&j.Nn){const i=this.hr[t]>>2,e=this._r[i],a=this.gr[i],c=this.Ir[i];N.he(s,n,r,h,o,l,this.sr[t],this.sr[t],this.sr[t],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t])}}else if(4===e){let e;if((s<0||n<0||r<0||s>m.ut||n>m.ut||r>m.ut||j.Hn[3]<0||j.Hn[3]>m.ut)&&(N.Fi=!0),e=this.hr?3&this.hr[t]:0,i)N.Ct(s,n,h,o,j.Kn[0]),N.Ct(n,r,o,l,j.Kn[1]),N.Ct(r,j.Hn[3],l,j.Vn[3],j.Kn[2]),N.Ct(j.Hn[3],s,j.Vn[3],h,j.Kn[3]);else if(0===e)N.ee(s,n,r,h,o,l,j.Kn[0],j.Kn[1],j.Kn[2]),N.ee(s,r,j.Hn[3],h,l,j.Vn[3],j.Kn[0],j.Kn[2],j.Kn[3]);else if(1===e){if(this.sr){const i=N.palette[this.sr[t]];N.ne(s,n,r,h,o,l,i),N.ne(s,r,j.Hn[3],h,l,j.Vn[3],i)}}else if(2===e&&this.hr&&this.Ar&&j.kn&&j.Dn&&j.Nn){const i=this.hr[t]>>2,e=this._r[i],a=this.gr[i],c=this.Ir[i];N.he(s,n,r,h,o,l,j.Kn[0],j.Kn[1],j.Kn[2],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t]),N.he(s,r,j.Hn[3],h,l,j.Vn[3],j.Kn[0],j.Kn[2],j.Kn[3],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t])}else if(3===e&&this.hr&&this.Ar&&this.sr&&j.kn&&j.Dn&&j.Nn){const i=this.hr[t]>>2,e=this._r[i],a=this.gr[i],c=this.Ir[i];N.he(s,n,r,h,o,l,this.sr[t],this.sr[t],this.sr[t],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t]),N.he(s,r,j.Hn[3],h,l,j.Vn[3],this.sr[t],this.sr[t],this.sr[t],j.kn[e],j.Dn[e],j.Nn[e],j.kn[a],j.kn[c],j.Dn[a],j.Dn[c],j.Nn[a],j.Nn[c],this.Ar[t])}}}Zr(t,i,e,s,n){if(!s)return;const r=s.length;if(0===n){let n=0;j.Xn=0,j.jn=0,j.zn=0;for(let t=0;t0?(j.Xn=(j.Xn/n|0)+t,j.jn=(j.jn/n|0)+i,j.zn=(j.zn/n|0)+e):(j.Xn=t,j.jn=i,j.zn=e)}else if(1===n)for(let n=0;n=this.Fr.length)continue;const h=this.Fr[r];if(h)for(let s=0;s=this.Fr.length)continue;const h=this.Fr[r];if(h)for(let s=0;s>16;this.er[n]=this.er[n]*c-this.cr[n]*a>>16,this.cr[n]=t}if(0!==r){a=N.sin[r],c=N.cos[r];const t=this.er[n]*c-this.ur[n]*a>>16;this.ur[n]=this.er[n]*a+this.ur[n]*c>>16,this.er[n]=t}if(0!==o){a=N.sin[o],c=N.cos[o];const t=this.ur[n]*a+this.cr[n]*c>>16;this.ur[n]=this.ur[n]*c-this.cr[n]*a>>16,this.cr[n]=t}this.cr[n]+=j.Xn,this.er[n]+=j.jn,this.ur[n]+=j.zn}}else if(3===n)for(let n=0;n=this.Fr.length)continue;const h=this.Fr[r];if(h)for(let s=0;s=this.Br.length)continue;const n=this.Br[e];if(n)for(let i=0;i255&&(this.pr[e]=255)}}}sh(){this.vr=0,this.Or=0,this.Rr=0,this.Cr=999999,this.Er=-999999,this.br=-99999,this.Tr=99999;for(let t=0;tthis.Er&&(this.Er=i),sthis.br&&(this.br=s),-e>this.vr&&(this.vr=-e),e>this.Rr&&(this.Rr=e);const n=i*i+s*s;n>this.Or&&(this.Or=n)}this.Or=0|Math.sqrt(this.Or),this.Sr=0|Math.sqrt(this.Or*this.Or+this.vr*this.vr),this.Lr=this.Sr+(0|Math.sqrt(this.Or*this.Or+this.Rr*this.Rr))}hh(t,i,e,s,n,r,h,o){return!(ie&&i>s&&i>n)&&(!(t{const e=t.read(i+'.dat');if(!e)throw new Error(`${i} jpeg not found!`);const s=await(async t=>{255!==t[0]&&(t[0]=255),URL.revokeObjectURL(g.src),g.src=URL.createObjectURL(new Blob([t],{type:'image/jpeg'})),await new Promise((t=>g.onload=()=>t())),I.clearRect(0,0,_.width,_.height);const i=g.naturalWidth,e=g.naturalHeight;return _.width=i,_.height=e,I.drawImage(g,0,0),I.getImageData(0,0,i,e)})(e),n=new J(s.width,s.height),r=new Uint32Array(s.data.buffer),h=n.lt;for(let t=0;t>24&255)<<24|(255&i)<<16|(i>>8&255)<<8|i>>16&255}return n};static gi=(t,i,e=0)=>{const s=new O(t.read(i+'.dat')),n=new O(t.read('index.dat'));n.Vt=s.Zt;const r=n.Zt,h=n.Zt,o=[],l=n.jt-1;for(let t=0;ts.length||n.Vt>n.length)throw new Error;const a=n.jt,c=n.jt,f=n.Zt,u=n.Zt,d=new J(f,u);d.mi=a,d.pi=c,d.Ai=r,d._i=h;const w=n.jt;if(0===w){const t=d.width*d.height;for(let i=0;im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.mh(r,n,this.lt,s,o,m.lt,e,h)}ph(t,i,e){i|=0,e|=0;let s=(i+=this.mi)+(e+=this.pi)*m.ct,n=0,r=this.height,h=this.width,o=m.ct-h,l=0;if(em.bottom&&(r-=e+r-m.bottom),im.right){const t=i+h-m.right;h-=t,l+=t,o+=t}h>0&&r>0&&this.Ah(h,r,this.lt,n,l,m.lt,s,o,t)}_h(t,i){t|=0,i|=0;let e=(t+=this.mi)+(i+=this.pi)*m.ct,s=0,n=this.height,r=this.width,h=m.ct-r,o=0;if(im.bottom&&(n-=i+n-m.bottom),tm.right){const i=t+r-m.right;r-=i,o+=i,h+=i}r>0&&n>0&&this.gh(r,n,this.lt,s,o,m.lt,e,h)}Ci(){const t=this.lt,i=this.width,e=this.height;for(let s=0;s>16&255;r+=t,r<1?r=1:r>255&&(r=255);let h=n>>8&255;h+=i,h<1?h=1:h>255&&(h=255);let o=255&n;o+=e,o<1?o=1:o>255&&(o=255),this.lt[s]=(r<<16)+(h<<8)+o}}}bi(t,i,e,s){t|=0,i|=0,e|=0,s|=0;try{const n=this.width;let r=0,h=0;const o=this.Ai,l=this._i,a=(o<<16)/e|0,c=(l<<16)/s|0;t+=(this.mi*e+o-1)/o|0,i+=(this.pi*s+l-1)/l|0,this.mi*e%o!=0&&(r=(o-this.mi*e%o<<16)/e|0),this.pi*s%l!=0&&(h=(l-this.pi*s%l<<16)/s|0),e=e*(this.width-(r>>16))/o|0,s=s*(this.height-(h>>16))/l|0;let f=t+i*m.ct,u=m.ct-e;if(im.bottom&&(s-=i+s-m.bottom),tm.right){const i=t+e-m.right;e-=i,u+=i}this.scale(e,s,this.lt,r,h,m.lt,u,f,n,a,c)}catch(t){console.error('error in sprite clipping routine')}}Ih(t,i,e,s,n,r,h,o,l,a){t|=0,i|=0,e|=0,s|=0;try{const c=-e/2|0,f=-s/2|0,u=65536*Math.sin(l/326.11)|0,d=65536*Math.cos(l/326.11)|0,w=u*a>>8,y=d*a>>8;let p=(h<<16)+f*w+c*y,A=f*y-c*w+(o<<16),_=t+i*m.ct;for(let t=0;t>16)+(h>>16)*this.width],s+=y,h-=w;p+=w,A+=y,_+=m.ct}}catch(t){}}Ch(t,i,e){t|=0,i|=0;let s=(t+=this.mi)+(i+=this.pi)*m.ct,n=0,r=this.height,h=this.width,o=m.ct-h,l=0;if(im.bottom&&(r-=i+r-m.bottom),tm.right){const i=t+h-m.right;h-=i,l+=i,o+=i}h>0&&r>0&&this.Eh(h,r,this.lt,l,n,m.lt,s,o,e.lt)}scale(t,i,e,s,n,r,h,o,l,a,c){try{const f=s;for(let u=-i;u<0;u++){const i=(n>>16)*l;for(let n=-t;n<0;n++){const t=e[(s>>16)+i];0===t?o++:r[o++]=t,s+=a}n+=c,s=f,o+=h}}catch(t){console.error('error in plot_scale')}}gh(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++)r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++],r[h++]=e[s++];for(let i=t;i<0;i++)r[h++]=e[s++];h+=o,s+=n}}Ah(t,i,e,s,n,r,h,o,l){const a=256-l;for(let c=-i;c<0;c++){for(let i=-t;i<0;i++){const t=e[s++];if(0===t)h++;else{const i=r[h];r[h++]=((16711935&t)*l+(16711935&i)*a&4278255360)+((65280&t)*l+(65280&i)*a&16711680)>>8}}h+=o,s+=n}}mh(t,i,e,s,n,r,h,o){const l=-(t>>2);t=-(3&t);for(let a=-i;a<0;a++){for(let t=l;t<0;t++){let t=e[s++];0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t,t=e[s++],0===t?h++:r[h++]=t}for(let i=t;i<0;i++){const t=e[s++];0===t?h++:r[h++]=t}h+=o,s+=n}}Eh(t,i,e,s,n,r,h,o,l){const a=-(t>>2);t=-(3&t);for(let c=-i;c<0;c++){for(let t=a;t<0;t++){let t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++,t=e[n++],0!==t&&0===l[h]?r[h++]=t:h++}for(let i=t;i<0;i++){const t=e[n++];0!==t&&0===l[h]?r[h++]=t:h++}h+=o,n+=s}}}class ${static Th=['_','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','0','1','2','3','4','5','6','7','8','9'];static bh=t=>{t=t.trim();let i=0n;for(let e=0;e=65&&s<=90?i+=BigInt(s+1-65):s>=97&&s<=122?i+=BigInt(s+1-97):s>=48&&s<=57&&(i+=BigInt(s+27-48))}return i};static Oh=t=>{if(t<0n||t>=6582952005840035281n)return'invalid_name';if(t%37n===0n)return'invalid_name';let i=0;const e=Array(12);for(;0n!==t;){const s=t;t/=37n,e[11-i++]=this.Th[Number(s-37n*t)]}return e.slice(12-i).join('')};static Rh=t=>{const i=[...t.toLowerCase()];let e=!0;for(let t=0;t='a'&&s<='z'&&(i[t]=s.toUpperCase(),e=!1),'.'!==s&&'!'!==s||(e=!0)}return i.join('')};static Lh=t=>{let i='';for(let e=0;e(t>>24&255)+'.'+(t>>16&255)+'.'+(t>>8&255)+'.'+(255&t);static xh=t=>{if(0===t.length)return t;const i=[...t];for(let t=0;t='a'&&i[t+1]<='z'&&(i[t+1]=String.fromCharCode(i[t+1].charCodeAt(0)+'A'.charCodeAt(0)-97)));return i[0]>='a'&&i[0]<='z'&&(i[0]=String.fromCharCode(i[0].charCodeAt(0)+'A'.charCodeAt(0)-97)),i.join('')};static Mh=t=>{const i=t.toUpperCase();let e=0n;for(let t=0;t>56n)&0xffffffffffffffn;return e}}class Q{static zs=[];static kh=null;static Dh=null;static Nh=0;static Fh=1;static Bh=2;static Ph=3;static Uh=4;static Wh=5;static Gh=6;static Yh=7;static Hh=1;static Vh=2;static Kh=3;static Xh=4;static jh=5;static zh=6;static Zh=1;static qh=100;static Jh=101;static $h=200;static Qh=201;static io=202;static eo=203;static so=205;static no=300;static ro=301;static ho=302;static oo=303;static lo=304;static ao=305;static co=306;static fo=307;static uo=308;static do=309;static wo=310;static yo=311;static mo=312;static po=313;static Ao=314;static _o=315;static Io=316;static Co=317;static Eo=318;static To=319;static bo=320;static Oo=321;static Ro=322;static vo=323;static Lo=324;static So=325;static xo=326;static Mo=327;static ko=401;static Do=500;static No=501;static Fo=502;static Bo=503;static Po=600;static Uo=601;static Wo=602;static Go=603;static Yo=604;static Ho=605;static Vo=606;static Ko=607;static Xo=608;static jo=609;static zo=610;static Zo=611;static qo=612;static Jo=613;static $o=650;static Qo=651;static tl=652;static il=653;static el=654;static sl=655;static Zs=(t,i,e)=>{this.kh=new q(5e4),this.Dh=new q(5e4);const s=new O(t.read('data'));let n=-1;for(s.Vt+=2;s.Vt0){r.ll=new Uint8Array(h),r.al=new Uint16Array(h);for(let t=0;t0){r.scripts=new v(o,null);for(let t=0;t0){const s=e.lastIndexOf(',');r.Il[t]=this.Cl(i,e.substring(0,s),parseInt(e.substring(s+1),10))}}r.El=new v(5,null);for(let t=0;t<5;t++){const i=s.ei;r.El[t]=i,0===i.length&&(r.El[t]=null)}}if(r.type===Q.Ph&&(r.fill=1===s.jt),r.type===Q.Uh||r.type===Q.Fh){r.Tl=1===s.jt;const t=s.jt;e&&(r.font=e[t]),r.bl=1===s.jt}if(r.type===Q.Uh&&(r.text=s.ei,r.Ol=s.ei),r.type!==Q.Fh&&r.type!==Q.Ph&&r.type!==Q.Uh||(r.Rl=s.$t),r.type!==Q.Ph&&r.type!==Q.Uh||(r.vl=s.$t,r.Ll=s.$t),r.type===Q.Wh){const t=s.ei;if(t.length>0){const e=t.lastIndexOf(',');r.Sl=this.Cl(i,t.substring(0,e),parseInt(t.substring(e+1),10))}const e=s.ei;if(e.length>0){const t=e.lastIndexOf(',');r.xl=this.Cl(i,e.substring(0,t),parseInt(e.substring(t+1),10))}}if(r.type===Q.Gh){const t=s.jt;0!==t&&(r.model=this.Ml((t-1<<8)+s.jt));const i=s.jt;0!==i&&(r.kl=this.Ml((i-1<<8)+s.jt)),r.Dl=s.jt,0===r.Dl?r.Dl=-1:r.Dl=(r.Dl-1<<8)+s.jt,r.Nl=s.jt,0===r.Nl?r.Nl=-1:r.Nl=(r.Nl-1<<8)+s.jt,r.zoom=s.Zt,r.Fl=s.Zt,r.Bl=s.Zt}if(r.type===Q.Yh){r.dl=new Int32Array(r.width*r.height),r.wl=new Int32Array(r.width*r.height),r.Tl=1===s.jt;const t=s.jt;e&&(r.font=e[t]),r.bl=1===s.jt,r.Rl=s.$t,r.pl=s.qt,r.Al=s.qt,r.yl=1===s.jt,r.El=new v(5,null);for(let t=0;t<5;t++){const i=s.ei;r.El[t]=i,0===i.length&&(r.El[t]=null)}}r.rl!==Q.Vh&&r.type!==Q.Bh||(r.Pl=s.ei,r.action=s.ei,r.Ul=s.Zt),r.rl!==Q.Hh&&r.rl!==Q.Xh&&r.rl!==Q.jh&&r.rl!==Q.zh||(r.Wl=s.ei,0===r.Wl.length&&(r.rl===Q.Hh?r.Wl='Ok':r.rl===Q.Xh||r.rl===Q.jh?r.Wl='Select':r.rl===Q.zh&&(r.Wl='Continue')))}this.kh=null,this.Dh=null};static Cl=(t,i,e)=>{const s=$.Mh(i)<<8n|BigInt(e);if(this.kh){const t=this.kh.get(s);if(t)return t}let n;try{n=J.gi(t,i,e),this.kh?.put(s,n)}catch(t){return null}return n};static Ml=t=>{if(this.Dh){const i=this.Dh.get(BigInt(t));if(i)return i}const i=j.model(t);return this.Dh?.put(BigInt(t),i),i};id=-1;nl=-1;type=-1;rl=-1;hl=0;width=0;height=0;ol=-1;ll=null;al=null;scripts=null;scroll=0;hide=!1;draggable=!1;yl=!1;ml=!1;pl=0;Al=0;_l=null;gl=null;Il=null;El=null;fill=!1;Tl=!1;font=null;bl=!1;text=null;Ol=null;Rl=0;vl=0;Ll=0;Sl=null;xl=null;model=null;kl=null;Dl=-1;Nl=-1;zoom=0;Fl=0;Bl=0;Pl=null;action=null;Ul=-1;Wl=null;cl=null;fl=null;ul=null;x=0;y=0;Gl=0;dl=null;wl=null;Yl=0;Hl=0;Ml(t,i,e){let s=this.model;if(e&&(s=this.kl),!s)return null;if(-1===t&&-1===i&&!s.Ar)return s;const n=j.Mr(s,!0,!0,!1);return-1===t&&-1===i||n.jr(),-1!==t&&n.qr(t),-1!==i&&n.qr(i),n.ih(64,768,-50,-10,-50,!0),n}Vl(){if(this.nl===this.id)return this.x;let t=Q.zs[this.nl];if(!t.cl||!t.fl||!t.ul)return this.x;let i=t.cl.indexOf(this.id);if(-1===i)return this.x;let e=t.fl[i];for(;t.nl!==t.id;){const s=Q.zs[t.nl];s.cl&&s.fl&&s.ul&&(i=s.cl.indexOf(t.id),-1!==i&&(e+=s.fl[i])),t=s}return e}Kl(){if(this.nl===this.id)return this.y;let t=Q.zs[this.nl];if(!t.cl||!t.fl||!t.ul)return this.y;let i=t.cl.indexOf(this.id);if(-1===i)return this.y;let e=t.ul[i];for(;t.nl!==t.id;){const s=Q.zs[t.nl];s.cl&&s.fl&&s.ul&&(i=s.cl.indexOf(t.id),-1!==i&&(e+=s.ul[i])),t=s}return e}outline(t){const i=this.Vl(),e=this.Kl();m._t(i,e,this.width,this.height,t)}move(t,i){if(this.nl===this.id)return;this.x=0,this.y=0;const e=Q.zs[this.nl];if(e.cl&&e.fl&&e.ul){const s=e.cl.indexOf(this.id);-1!==s&&(e.fl[s]=t,e.ul[s]=i)}}delete(){if(this.nl===this.id)return;const t=Q.zs[this.nl];if(t.cl&&t.fl&&t.ul){const i=t.cl.indexOf(this.id);-1!==i&&(t.cl.splice(i,1),t.fl.splice(i,1),t.ul.splice(i,1))}}}var tt,it=(tt="file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/tinymidipcm.mjs",function(t){var i,s,n=void 0!==(t=t||{})?t:{};n.ready=new Promise((function(t,e){i=t,s=e})),["_tsf_load_memory","_tsf_set_output","_tsf_channel_set_bank_preset","_tsf_set_max_voices","_tsf_channel_set_presetnumber","_tsf_reset","_tsf_close","_tml_load_memory","_midi_render","_malloc","_realloc","_free","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(n.ready,t)||Object.defineProperty(n.ready,t,{get:()=>X('You are getting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js'),set:()=>X('You are setting '+t+' on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js')})}));var r=Object.assign({},n),h=[],o='object'==typeof window,l='function'==typeof importScripts,a='object'==typeof process&&'object'==typeof process.versions&&'string'==typeof process.versions.node,c=!o&&!a&&!l;if(n.ENVIRONMENT)throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');var f,u,d,w='';if(a){if('undefined'==typeof process||!process.release||'node'!==process.release.name)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');var y,m;w=l?require('path').Xl(w)+'/':__dirname+'/';var p=()=>{m||(y=require('fs'),m=require('path'))};f=(t,i)=>(p(),t=m.normalize(t),y.jl(t,i?void 0:'utf8')),d=t=>{var i=f(t,!0);return i.buffer||(i=new Uint8Array(i)),k(i.buffer),i},u=(t,i,e)=>{p(),t=m.normalize(t),y.zl(t,(function(t,s){t?e(t):i(s.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,'/'),h=process.argv.slice(2),process.on('uncaughtException',(function(t){if(!(t instanceof nt))throw t})),process.on('unhandledRejection',(function(t){throw t})),n.inspect=function(){return'[Emscripten Module object]'}}else if(c){if('object'==typeof process&&'function'==typeof require||'object'==typeof window||'function'==typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');'undefined'!=typeof read&&(f=function(t){return read(t)}),d=function(t){let i;return'function'==typeof readbuffer?new Uint8Array(readbuffer(t)):(i=read(t,'binary'),k('object'==typeof i),i)},u=function(t,i,e){setTimeout((()=>i(d(t))),0)},'undefined'!=typeof scriptArgs?h=scriptArgs:void 0!==arguments&&(h=arguments),'undefined'!=typeof print&&('undefined'==typeof console&&(console={}),console.log=print,console.warn=console.error='undefined'!=typeof printErr?printErr:print)}else{if(!o&&!l)throw new Error('environment detection error');if(l?w=self.location.href:'undefined'!=typeof document&&document.currentScript&&(w=document.currentScript.src),tt&&(w=tt),w=0!==w.indexOf('blob:')?w.substr(0,w.replace(/[?#].*/,"").lastIndexOf('/')+1):'','object'!=typeof window&&'function'!=typeof importScripts)throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');f=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.send(null),i.responseText},l&&(d=t=>{var i=new XMLHttpRequest;return i.open('GET',t,!1),i.responseType='arraybuffer',i.send(null),new Uint8Array(i.response)}),u=(t,i,e)=>{var s=new XMLHttpRequest;s.open('GET',t,!0),s.responseType='arraybuffer',s.onload=()=>{200==s.status||0==s.status&&s.response?i(s.response):e()},s.onerror=e,s.send(null)}}n.print||console.log.bind(console);var A,_,g=n.printErr||console.warn.bind(console);function I(t,i){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){X('Module.'+t+' has been replaced with plain '+i+' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)')}})}function C(t){return'FS_createPath'===t||'FS_createDataFile'===t||'FS_createPreloadedFile'===t||'FS_unlink'===t||'addRunDependency'===t||'FS_createLazyFile'===t||'FS_createDevice'===t||'removeRunDependency'===t}Object.assign(n,r),r=null,A='fetchSettings',Object.getOwnPropertyDescriptor(n,A)&&X('`Module.'+A+'` was supplied but `'+A+'` not included in INCOMING_MODULE_JS_API'),n.arguments&&(h=n.arguments),I('arguments','arguments_'),n.thisProgram&&n.thisProgram,I('thisProgram','thisProgram'),n.quit&&n.quit,I('quit','quit_'),k(void 0===n.memoryInitializerPrefixURL,'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.pthreadMainPrefixURL,'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.cdInitializerPrefixURL,'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.filePackagePrefixURL,'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'),k(void 0===n.read,'Module.read option was removed (modify read_ in JS)'),k(void 0===n.readAsync,'Module.readAsync option was removed (modify readAsync in JS)'),k(void 0===n.readBinary,'Module.readBinary option was removed (modify readBinary in JS)'),k(void 0===n.setWindowTitle,'Module.setWindowTitle option was removed (modify setWindowTitle in JS)'),k(void 0===n.TOTAL_MEMORY,'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'),I('read','read_'),I('readAsync','readAsync'),I('readBinary','readBinary'),I('setWindowTitle','setWindowTitle'),k(!c,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),n.wasmBinary&&(_=n.wasmBinary),I('wasmBinary','wasmBinary');var E;n.noExitRuntime;I('noExitRuntime','noExitRuntime'),'object'!=typeof WebAssembly&&X('no native wasm support detected');var T,b,O,R,v,L,S,x,M=!1;function k(t,i){t||X('Assertion failed'+(i?': '+i:''))}function D(t){T=t,n.HEAP8=b=new Int8Array(t),n.HEAP16=R=new Int16Array(t),n.HEAP32=v=new Int32Array(t),n.HEAPU8=O=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=L=new Uint32Array(t),n.HEAPF32=S=new Float32Array(t),n.HEAPF64=x=new Float64Array(t)}'undefined'!=typeof TextDecoder&&new TextDecoder('utf8');var N=5242880;n.TOTAL_STACK&&k(N===n.TOTAL_STACK,'the stack size can no longer be determined at runtime');var F=n.INITIAL_MEMORY||16777216;function B(){if(!M){var t=ft(),i=L[t>>2],e=L[t+4>>2];34821223==i&&2310721022==e||X('Stack overflow! Stack cookie has been overwritten at 0x'+t.toString(16)+', expected hex dwords 0x89BACDFE and 0x2135467, but received 0x'+e.toString(16)+' 0x'+i.toString(16)),1668509029!==L[0]&&X('Runtime error: The application has corrupted its heap memory area (address zero)!')}}I('INITIAL_MEMORY','INITIAL_MEMORY'),k(F>=N,'INITIAL_MEMORY should be larger than TOTAL_STACK, was '+F+'! (TOTAL_STACK='+N+')'),k('undefined'!=typeof Int32Array&&'undefined'!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,'JS engine does not provide full typed array support'),k(!n.wasmMemory,'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'),k(16777216==F,'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'),function(){var t=new Int16Array(1),i=new Int8Array(t.buffer);if(t[0]=25459,115!==i[0]||99!==i[1])throw'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)'}();var P=[],U=[],W=[],G=!1;k(Math.imul,'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.fround,'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.clz32,'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill'),k(Math.trunc,'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');var Y=0,H=null,V=null,K={};function X(t){n.onAbort&&n.onAbort(t),g(t='Aborted('+t+')'),M=!0;var i=new WebAssembly.RuntimeError(t);throw s(i),i}var j={error:function(){X('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM')},init:function(){j.error()},Zl:function(){j.error()},ql:function(){j.error()},Jl:function(){j.error()},open:function(){j.error()},$l:function(){j.error()},Ql:function(){j.error()},ta:function(){j.error()},ia:function(){j.error()},ea:function(){j.error()}};n.FS_createDataFile=j.Zl,n.FS_createPreloadedFile=j.ql;var z,Z,q,J,$='data:application/octet-stream;base64,';function Q(t){return t.startsWith($)}function it(t){return t.startsWith('file://')}function et(t,i){return function(){var e=t,s=i;return i||(s=n.asm),k(G,'native function `'+e+'` called before runtime initialization'),s[t]||k(s[t],'exported native function `'+e+'` not found'),s[t].apply(null,arguments)}}function st(t){try{if(t==z&&_)return new Uint8Array(_);if(d)return d(t);throw"both async and sync fetching of the wasm failed"}catch(t){X(t)}}function nt(t){this.name='ExitStatus',this.message='Program terminated with exit('+t+')',this.status=t}function rt(t){for(;t.length>0;)t.shift()(n)}function ht(t){ht.sa||(ht.sa={}),ht.sa[t]||(ht.sa[t]=1,a&&(t='warning: '+t),g(t))}function ot(t){try{return E.grow(t-T.byteLength+65535>>>16),D(E.buffer),1}catch(i){g('emscripten_realloc_buffer: Attempted to grow heap from '+T.byteLength+' bytes to '+t+' bytes, but got error: '+i)}}n.locateFile?Q(z='tinymidipcm.wasm')||(Z=z,z=n.locateFile?n.locateFile(Z,w):w+Z):z=new URL(e(8227),e.b).toString();var lt,at={"emscripten_memcpy_big":function(t,i,e){O.copyWithin(t,i,i+e)},"emscripten_resize_heap":function(t){var i=O.length;k((t>>>=0)>i);var e,s,n=2147483648;if(t>n)return g('Cannot enlarge memory, asked to go up to '+t+' bytes, but the limit is '+n+' bytes!'),!1;for(var r=1;r<=4;r*=2){var h=i*(1+.2/r);h=Math.min(h,t+100663296);var o=Math.min(n,(e=Math.max(t,h))+((s=65536)-e%s)%s);if(ot(o))return!0}return g('Failed to grow the heap from '+i+' bytes to '+o+' bytes, not enough memory!'),!1}},ct=(function(){var t,i={'env':at,'wasi_snapshot_preview1':at};function e(t,i){var e,s=t.exports;n.asm=s,k(E=n.asm.memory,"memory not found in wasm exports"),D(E.buffer),k(n.asm.__indirect_function_table,"table not found in wasm exports"),e=n.asm.__wasm_call_ctors,U.unshift(e),function(t){if(Y--,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(k(K[t]),delete K[t]):g('warning: run dependency removed without ID'),0==Y&&(null!==H&&(clearInterval(H),H=null),V)){var i=V;V=null,i()}}('wasm-instantiate')}t='wasm-instantiate',Y++,n.monitorRunDependencies&&n.monitorRunDependencies(Y),t?(k(!K[t]),K[t]=1,null===H&&'undefined'!=typeof setInterval&&(H=setInterval((function(){if(M)return clearInterval(H),void(H=null);var t=!1;for(var i in K)t||(t=!0,g('still waiting on run dependencies:')),g('dependency: '+i);t&&g('(end of list)')}),1e4))):g('warning: run dependency added without ID');var r=n;function h(t){k(n===r,'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?'),r=null,e(t.instance)}function c(t){return function(){if(!_&&(o||l)){if('function'==typeof fetch&&!it(z))return fetch(z,{credentials:'same-origin'}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+z+"'";return t.arrayBuffer()})).catch((function(){return st(z)}));if(u)return new Promise((function(t,i){u(z,(function(i){t(new Uint8Array(i))}),i)}))}return Promise.resolve().then((function(){return st(z)}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){g('failed to asynchronously prepare wasm: '+t),it(z)&&g('warning: Loading from a file URI ('+z+') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing'),X(t)}))}if(n.instantiateWasm)try{return n.instantiateWasm(i,e)}catch(t){g('Module.instantiateWasm callback failed with error: '+t),s(t)}(_||'function'!=typeof WebAssembly.instantiateStreaming||Q(z)||it(z)||a||'function'!=typeof fetch?c(h):fetch(z,{credentials:'same-origin'}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(h,(function(t){return g('wasm streaming compile failed: '+t),g('falling back to ArrayBuffer instantiation'),c(h)}))}))).catch(s)}(),n.___wasm_call_ctors=et("__wasm_call_ctors"),n._malloc=et("malloc"),n._free=et("free"),n._tsf_load_memory=et("tsf_load_memory"),n._tsf_close=et("tsf_close"),n._tsf_reset=et("tsf_reset"),n._tsf_set_output=et("tsf_set_output"),n._tsf_set_max_voices=et("tsf_set_max_voices"),n._realloc=et("realloc"),n._tsf_channel_set_presetnumber=et("tsf_channel_set_presetnumber"),n._tsf_channel_set_bank_preset=et("tsf_channel_set_bank_preset"),n._tml_load_memory=et("tml_load_memory"),n._midi_render=et("midi_render"),n.___errno_location=et("__errno_location"),n._fflush=et("fflush"),n._emscripten_stack_init=function(){return(ct=n._emscripten_stack_init=n.asm.emscripten_stack_init).apply(null,arguments)}),ft=(n._emscripten_stack_get_free=function(){return(n._emscripten_stack_get_free=n.asm.emscripten_stack_get_free).apply(null,arguments)},n._emscripten_stack_get_base=function(){return(n._emscripten_stack_get_base=n.asm.emscripten_stack_get_base).apply(null,arguments)},n._emscripten_stack_get_end=function(){return(ft=n._emscripten_stack_get_end=n.asm.emscripten_stack_get_end).apply(null,arguments)});function ut(){var t;ct(),k(!(3&(t=ft()))),L[t>>2]=34821223,L[t+4>>2]=2310721022,L[0]=1668509029}function dt(t){function e(){lt||(lt=!0,n.calledRun=!0,M||(k(!G),G=!0,B(),rt(U),i(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),k(!n._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(B(),n.postRun)for('function'==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),W.unshift(t);var t;rt(W)}()))}t=t||h,Y>0||(ut(),function(){if(n.preRun)for('function'==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),P.unshift(t);var t;rt(P)}(),Y>0||(n.setStatus?(n.setStatus('Running...'),setTimeout((function(){setTimeout((function(){n.setStatus('')}),1),e()}),1)):e(),B()))}if(n.stackSave=et("stackSave"),n.stackRestore=et("stackRestore"),n.stackAlloc=et("stackAlloc"),n.setValue=function(t,i,e="i8"){switch(e.endsWith('*')&&(e='*'),e){case'i1':case'i8':b[0|t]=i;break;case'i16':R[t>>1]=i;break;case'i32':v[t>>2]=i;break;case'i64':J=[i>>>0,(q=i,+Math.abs(q)>=1?q>0?(0|Math.min(+Math.floor(q/4294967296),4294967295))>>>0:~~+Math.ceil((q-+(~~q>>>0))/4294967296)>>>0:0)],v[t>>2]=J[0],v[t+4>>2]=J[1];break;case'float':S[t>>2]=i;break;case'double':x[t>>3]=i;break;case'*':L[t>>2]=i;break;default:X('invalid type for setValue: '+e)}},n.getValue=function(t,i="i8"){switch(i.endsWith('*')&&(i='*'),i){case'i1':case'i8':return b[0|t];case'i16':return R[t>>1];case'i32':case'i64':return v[t>>2];case'float':return S[t>>2];case'double':return x[t>>3];case'*':return L[t>>2];default:X('invalid type for getValue: '+i)}return null},['run','UTF8ArrayToString','UTF8ToString','stringToUTF8Array','stringToUTF8','lengthBytesUTF8','addOnPreRun','addOnInit','addOnPreMain','addOnExit','addOnPostRun','addRunDependency','removeRunDependency','FS_createFolder','FS_createPath','FS_createDataFile','FS_createPreloadedFile','FS_createLazyFile','FS_createLink','FS_createDevice','FS_unlink','getLEB','getFunctionTables','alignFunctionTables','registerFunctions','prettyPrint','getCompilerSetting','print','printErr','callMain','abort','keepRuntimeAlive','wasmMemory','stackAlloc','stackSave','stackRestore','getTempRet0','setTempRet0','writeStackCookie','checkStackCookie','ptrToString','zeroMemory','stringToNewUTF8','exitJS','getHeapMax','emscripten_realloc_buffer','ENV','ERRNO_CODES','ERRNO_MESSAGES','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','DNS','getHostByName','Protocols','Sockets','getRandomDevice','warnOnce','traverseStack','UNWIND_CACHE','convertPCtoSourceLocation','readAsmConstArgsArray','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','handleException','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','freeTableIndexes','functionsInTableMap','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','PATH','PATH_FS','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16Decoder','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeArrayToMemory','writeAsciiToMemory','SYSCALLS','getSocketFromFD','getSocketAddress','JSEvents','registerKeyEventCallback','specialHTMLTargets','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','currentFullscreenStrategy','restoreOldWindowedStyle','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','demangle','demangleAll','jsStackTrace','stackTrace','ExitStatus','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','dlopenMissingError','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','uncaughtExceptionCount','exceptionLast','exceptionCaught','ExceptionInfo','exception_addRef','exception_decRef','Browser','setMainLoop','wget','FS','MEMFS','TTY','PIPEFS','SOCKFS','_setNetworkCallback','tempFixedLengthArray','miniTempWebGLFloatBuffers','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','GL','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','AL','SDL_unicode','SDL_ttfContext','SDL_audio','SDL','SDL_gfx','GLUT','EGL','GLFW_Window','GLFW','GLEW','IDBStore','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){var i="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),X(i)}})})),['ptrToString','zeroMemory','stringToNewUTF8','exitJS','setErrNo','inetPton4','inetNtop4','inetPton6','inetNtop6','readSockaddr','writeSockaddr','getHostByName','getRandomDevice','traverseStack','convertPCtoSourceLocation','readAsmConstArgs','mainThreadEM_ASM','jstoi_q','jstoi_s','getExecutableName','listenOnce','autoResumeAudioContext','dynCallLegacy','getDynCaller','dynCall','runtimeKeepalivePush','runtimeKeepalivePop','callUserCallback','maybeExit','safeSetTimeout','asmjsMangle','asyncLoad','alignMemory','mmapAlloc','writeI53ToI64','writeI53ToI64Clamped','writeI53ToI64Signaling','writeI53ToU64Clamped','writeI53ToU64Signaling','readI53FromI64','readI53FromU64','convertI32PairToI53','convertI32PairToI53Checked','convertU32PairToI53','getCFunc','ccall','cwrap','uleb128Encode','sigToWasmTypes','generateFuncType','convertJsFunctionToWasm','getEmptyTableSlot','updateTableMap','addFunction','removeFunction','reallyNegative','unSign','strLen','reSign','formatString','intArrayFromString','intArrayToString','AsciiToString','stringToAscii','UTF16ToString','stringToUTF16','lengthBytesUTF16','UTF32ToString','stringToUTF32','lengthBytesUTF32','allocateUTF8','allocateUTF8OnStack','writeStringToMemory','writeAsciiToMemory','getSocketFromFD','getSocketAddress','registerKeyEventCallback','maybeCStringToJsString','findEventTarget','findCanvasEventTarget','getBoundingClientRect','fillMouseEventData','registerMouseEventCallback','registerWheelEventCallback','registerUiEventCallback','registerFocusEventCallback','fillDeviceOrientationEventData','registerDeviceOrientationEventCallback','fillDeviceMotionEventData','registerDeviceMotionEventCallback','screenOrientation','fillOrientationChangeEventData','registerOrientationChangeEventCallback','fillFullscreenChangeEventData','registerFullscreenChangeEventCallback','JSEvents_requestFullscreen','JSEvents_resizeCanvasForFullscreen','registerRestoreOldStyle','hideEverythingExceptGivenElement','restoreHiddenElements','setLetterbox','softFullscreenResizeWebGLRenderTarget','doRequestFullscreen','fillPointerlockChangeEventData','registerPointerlockChangeEventCallback','registerPointerlockErrorEventCallback','requestPointerLock','fillVisibilityChangeEventData','registerVisibilityChangeEventCallback','registerTouchEventCallback','fillGamepadEventData','registerGamepadEventCallback','registerBeforeUnloadEventCallback','fillBatteryEventData','battery','registerBatteryEventCallback','setCanvasElementSize','getCanvasElementSize','getEnvStrings','checkWasiClock','flush_NO_FILESYSTEM','createDyncallWrapper','setImmediateWrapped','clearImmediateWrapped','polyfillSetImmediate','ExceptionInfo','exception_addRef','exception_decRef','setMainLoop','_setNetworkCallback','heapObjectForWebGLType','heapAccessShiftForWebGLHeap','emscriptenWebGLGet','computeUnpackAlignedImageSize','emscriptenWebGLGetTexPixelData','emscriptenWebGLGetUniform','webglGetUniformLocation','webglPrepareUniformLocationsBeforeFirstUse','webglGetLeftBracePos','emscriptenWebGLGetVertexAttrib','writeGLArray','SDL_unicode','SDL_ttfContext','SDL_audio','GLFW_Window','runAndAbortIfError','ALLOC_NORMAL','ALLOC_STACK','allocate'].forEach((function(t){'undefined'==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var i='`'+t+'` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line';C(t)&&(i+='. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you'),ht(i)}})})),V=function t(){lt||dt(),lt||(V=t)},n.preInit)for('function'==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return dt(),t.ready});const et=it;const st=class{constructor(t={}){this.na=void 0,this.ra=0,this.ha=0,this.oa=0,this.la=t.la||100,this.sampleRate=t.sampleRate||44100,this.aa=t.aa||2,this.gain=t.gain||0,t.bufferSize?this.bufferSize=t.bufferSize:this.ca(1),this.fa=t.fa||(()=>{}),this.ua=t.ua||(()=>{}),this.da=void 0,this.test=0}async init(){if(!this.na){if('undefined'!=typeof process){const{Xl:t}=await import('path'),{wa:i}=await import('module');globalThis.__dirname=t("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js"),globalThis.require=i("file:///home/runner/work/Client2/Client2/src/js/vendor/tinymidipcm/index.js")}this.na=await et(),this.ya=this.na._malloc(this.bufferSize),this.ma=this.na._malloc(8)}}ca(t){this.bufferSize=4*this.sampleRate*this.aa*t}pa(){if(!this.na)throw new Error(`${this.constructor.name} not initalized. call .init()`)}Aa(t){this.pa();const{_malloc:i,_free:e,_tsf_load_memory:s,_tsf_set_output:n,_tsf_channel_set_bank_preset:r,_tsf_set_max_voices:h,_tsf_channel_set_presetnumber:o}=this.na;e(this.ra),this.ra=i(t.length),this.na.HEAPU8.set(t,this.ra),this.ha=s(this.ra,t.length),n(this.ha,2===this.aa?0:2,this.sampleRate,this.gain)}_a(){this.pa();const t=new Uint8Array(this.bufferSize);return t.set(this.na.HEAPU8.subarray(this.ya,this.ya+this.bufferSize)),t}ga(t){const{_malloc:i,_free:e,_tml_load_memory:s}=this.na;return e(this.oa),this.oa=i(t.length),this.na.HEAPU8.set(t,this.oa),s(this.oa,t.length)}Ia(t){const{_midi_render:i}=this.na;return i(this.ha,t,this.aa,this.sampleRate,this.ya,this.bufferSize,this.ma)}Ca(t){if(this.pa(),!this.ha)throw new Error('no soundfont buffer set. call .setSoundfont');window.clearTimeout(this.da);const{setValue:i,getValue:e}=this.na;i(this.ma,0,'double'),this.na._tsf_reset(this.ha),this.na._tsf_channel_set_bank_preset(this.ha,9,128,0),t[0]==='R'.charCodeAt(0)&&(t=t.slice(20));let s=this.ga(t);const n=()=>{s=this.Ia(s);const t=this._a();this.fa(t),s?this.da=setTimeout(n,this.la):this.ua(e(this.ma,'double'))};this.da=setTimeout(n,16)}};!function(){window.AudioContext=window.AudioContext||window.webkitAudioContext,window.AudioContext&&(window.audioContext=new window.AudioContext);var t=function(i){if(window.audioContext){var e=window.audioContext.createBuffer(1,1,22050),s=window.audioContext.createBufferSource();s.buffer=e,s.connect(window.audioContext.destination),s.start?s.start(0):s.play?s.play(0):s.noteOn&&s.noteOn(0)}document.removeEventListener('touchstart',t),document.removeEventListener('touchend',t),document.removeEventListener('click',t)};document.addEventListener('touchstart',t),document.addEventListener('touchend',t),document.addEventListener('click',t)}(),(async()=>{const t=2,i=44100;let e=new Float32Array,s=window.audioContext.createGain();s.gain.setValueAtTime(.1,window.audioContext.currentTime),s.connect(window.audioContext.destination);let n=window.audioContext.currentTime,r=[];const h=new st({la:30,fa:t=>{let i=new Float32Array(t.buffer),s=new Float32Array(e.length+i.length);s.set(e,0),s.set(i,e.length),e=s},ua:t=>{},bufferSize:102400});await h.init();const o=await fetch('./SCC1_Florestan.sf2'),l=new Uint8Array(await o.arrayBuffer());function a(){if(!window.audioContext||!e.length)return;let h=window.audioContext.createBufferSource();const o=e.length/t,l=window.audioContext.createBuffer(t,o,i);for(let i=0;i{t.stop(window.audioContext.currentTime)})),r=[],s.gain.setValueAtTime(t,window.audioContext.currentTime)}}function u(t,i){-1!==t&&window._tinyMidiVolume(t),n=window.audioContext.currentTime,c=setInterval(a,250),h.Ca(i)}h.Aa(l),window._tinyMidiStop=async t=>{t?function(t){const i=window.audioContext.currentTime;s.gain.cancelScheduledValues(i),s.gain.setTargetAtTime(0,i,.5),setTimeout(t,2e3)}((()=>{f()})):f()},window._tinyMidiVolume=(t=1)=>{s.gain.setValueAtTime(t,window.audioContext.currentTime)},window._tinyMidiPlay=async(t,i,e)=>{t&&(await window._tinyMidiStop(e),e?setTimeout((()=>{u(i,t)}),2e3):u(i,t))}})();class nt{level;y;x;z;model;Ea;Ta;ba;Oa;Ra;va;La;info;Sa=0;Wi=0;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u){this.level=t,this.y=i,this.x=e,this.z=s,this.model=n,this.Ea=r,this.Ta=h,this.ba=o,this.Oa=l,this.Ra=a,this.va=c,this.La=f,this.info=u}}class rt extends w{level;x;z;xa;Ma;ka;Da=null;Na=null;Fa=null;Ba=null;Pa=null;Ua=null;Wa=null;Ga=0;Ya=0;Ha=0;visible=!1;update=!1;Va=!1;Ka=0;Xa=0;ja=0;za=0;constructor(t,i,e){super(),this.xa=this.level=t,this.x=i,this.z=e,this.Ma=new v(5,null),this.ka=new Int32Array(5)}}class ht{Za;qa;Ja;$a;type;Cr;Er;Tr;br;Rr;vr;mode=0;Qa=0;tc=0;ic=0;ec=0;sc=0;nc=0;constructor(t,i,e,s,n,r,h,o,l,a,c){this.Za=t,this.qa=i,this.Ja=e,this.$a=s,this.type=n,this.Cr=r,this.Er=h,this.Tr=o,this.br=l,this.Rr=a,this.vr=c}}class ot{static OPEN=0;static rc=1;static hc=2;static oc=4;static lc=8;static ac=ot.rc<<4;static cc=ot.hc<<4;static fc=ot.oc<<4;static uc=ot.lc<<4;static dc=256;static wc=512;static yc=1024;static mc=2048;static Ac=4096;static _c=ot.wc<<4;static gc=ot.yc<<4;static Ic=ot.mc<<4;static Cc=ot.Ac<<4;static Ec=ot.dc<<9;static Tc=524288;static bc=2097152;static Oc=ot.bc|ot.Tc;static Rc=ot.dc|ot.Oc;static vc=ot.hc|ot.Rc;static Lc=ot.lc|ot.Rc;static Sc=ot.hc|ot.oc|ot.Lc;static xc=ot.cc|ot.Rc;static Mc=ot.lc|ot.ac|ot.xc;static kc=ot.uc|ot.Rc;static Dc=ot.rc|ot.hc|ot.kc;static Nc=ot.cc|ot.fc|ot.kc;static Fc=16777215}class lt{static Bc=0;static Pc=1;static Uc=2;static Wc=3}class at{static Gc=0;static Yc=1;static Hc=2;static Vc=3}class ct{static Kc=new ct(0,at.Gc);static Xc=new ct(1,at.Gc);static jc=new ct(2,at.Gc);static zc=new ct(3,at.Gc);static Zc=new ct(4,at.Yc);static qc=new ct(5,at.Yc);static Jc=new ct(6,at.Yc);static $c=new ct(7,at.Yc);static Qc=new ct(8,at.Yc);static tf=new ct(9,at.Hc);static if=new ct(10,at.Hc);static ef=new ct(11,at.Hc);static sf=new ct(12,at.Hc);static nf=new ct(13,at.Hc);static rf=new ct(14,at.Hc);static hf=new ct(15,at.Hc);static lf=new ct(16,at.Hc);static af=new ct(17,at.Hc);static cf=new ct(18,at.Hc);static ff=new ct(19,at.Hc);static uf=new ct(20,at.Hc);static df=new ct(21,at.Hc);static Vc=new ct(22,at.Vc);static values(){return[this.Kc,this.Xc,this.af,this.hf,this.jc,this.rf,this.tf,this.zc,this.Vc,this.sf,this.ef,this.Jc,this.uf,this.if,this.qc,this.nf,this.$c,this.Zc,this.lf,this.Qc,this.ff,this.df,this.cf]}static of(t){const i=this.values();for(let e=0;et*ut.yf+i;offsetX;mf;sizeX;sizeZ;flags;constructor(){this.offsetX=0,this.mf=0,this.sizeX=ut.yf,this.sizeZ=ut.yf,this.flags=new Int32Array(this.sizeX*this.sizeZ),this.reset()}reset=()=>{for(let t=0;t{this.flags[ut.index(t-this.offsetX,i-this.mf)]|=ot.bc};Af=(t,i)=>{this.flags[ut.index(t-this.offsetX,i-this.mf)]&=~ot.bc};_f=(t,i,e,s,n,r)=>{let h=ot.dc;r&&(h|=ot.Ec);const o=t-this.offsetX,l=i-this.mf;if(n===lt.Pc||n===lt.Wc){const t=e;e=s,s=t}for(let t=o;t=0&&t=0&&i{let h=ot.dc;r&&(h|=ot.Ec);const o=t-this.offsetX,l=i-this.mf;if(n===lt.Pc||n===lt.Wc){const t=e;e=s,s=t}for(let t=o;t=0&&t=0&&i{const r=t-this.offsetX,h=i-this.mf,o=n?ot.Cc:ot.uc,l=n?ot.Ac:ot.lc,a=n?ot.yc:ot.hc,c=n?ot.gc:ot.cc,f=n?ot.wc:ot.rc,u=n?ot._c:ot.ac,d=n?ot.mc:ot.oc,w=n?ot.Ic:ot.fc;e===ct.Kc.id?s===lt.Bc?(this.add(r,h,o),this.add(r-1,h,l)):s===lt.Pc?(this.add(r,h,a),this.add(r,h+1,c)):s===lt.Uc?(this.add(r,h,l),this.add(r+1,h,o)):s===lt.Wc&&(this.add(r,h,c),this.add(r,h-1,a)):e===ct.Xc.id||e===ct.zc.id?s===lt.Bc?(this.add(r,h,f),this.add(r-1,h+1,u)):s===lt.Pc?(this.add(r,h,d),this.add(r+1,h+1,w)):s===lt.Uc?(this.add(r,h,u),this.add(r+1,h-1,f)):s===lt.Wc&&(this.add(r,h,w),this.add(r-1,h-1,d)):e===ct.jc.id&&(s===lt.Bc?(this.add(r,h,a|o),this.add(r-1,h,l),this.add(r,h+1,c)):s===lt.Pc?(this.add(r,h,a|l),this.add(r,h+1,c),this.add(r+1,h,o)):s===lt.Uc?(this.add(r,h,c|l),this.add(r+1,h,o),this.add(r,h-1,a)):s===lt.Wc&&(this.add(r,h,c|o),this.add(r,h-1,a),this.add(r-1,h,l))),n&&this.If(t,i,e,s,!1)};Cf=(t,i,e,s,n)=>{const r=t-this.offsetX,h=i-this.mf,o=n?ot.Cc:ot.uc,l=n?ot.Ac:ot.lc,a=n?ot.yc:ot.hc,c=n?ot.gc:ot.cc,f=n?ot.wc:ot.rc,u=n?ot._c:ot.ac,d=n?ot.mc:ot.oc,w=n?ot.Ic:ot.fc;e===ct.Kc.id?s===lt.Bc?(this.remove(r,h,o),this.remove(r-1,h,l)):s===lt.Pc?(this.remove(r,h,a),this.remove(r,h+1,c)):s===lt.Uc?(this.remove(r,h,l),this.remove(r+1,h,o)):s===lt.Wc&&(this.remove(r,h,c),this.remove(r,h-1,a)):e===ct.Xc.id||e===ct.zc.id?s===lt.Bc?(this.remove(r,h,f),this.remove(r-1,h+1,u)):s===lt.Pc?(this.remove(r,h,d),this.remove(r+1,h+1,w)):s===lt.Uc?(this.remove(r,h,u),this.remove(r+1,h-1,f)):s===lt.Wc&&(this.remove(r,h,w),this.remove(r-1,h-1,d)):e===ct.jc.id&&(s===lt.Bc?(this.remove(r,h,a|o),this.remove(r-1,h,l),this.remove(r,h+1,c)):s===lt.Pc?(this.remove(r,h,a|l),this.remove(r,h+1,c),this.remove(r+1,h,o)):s===lt.Uc?(this.remove(r,h,c|l),this.remove(r+1,h,o),this.remove(r,h-1,a)):s===lt.Wc&&(this.remove(r,h,c|o),this.remove(r,h-1,a),this.remove(r-1,h,l))),n&&this.Cf(t,i,e,s,!1)};Ef=(t,i,e,s,n,r)=>{if(t===e&&i===s)return!0;const h=t-this.offsetX,o=i-this.mf,l=e-this.offsetX,a=s-this.mf,c=ut.index(h,o);if(n===ct.Kc.id){if(r===lt.Bc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.xc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.vc)===ot.OPEN)return!0}else if(r===lt.Pc){if(h===l&&o===a+1)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.Lc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.kc)===ot.OPEN)return!0}else if(r===lt.Uc){if(h===l+1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.xc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.vc)===ot.OPEN)return!0}else if(r===lt.Wc){if(h===l&&o===a-1)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.Lc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.kc)===ot.OPEN)return!0}}else if(n===ct.jc.id){if(r===lt.Bc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.kc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.vc)===ot.OPEN)return!0}else if(r===lt.Pc){if(h===l-1&&o===a&&(this.flags[c]&ot.Lc)===ot.OPEN)return!0;if(h===l&&o===a+1)return!0;if(h===l+1&&o===a)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.vc)===ot.OPEN)return!0}else if(r===lt.Uc){if(h===l-1&&o===a&&(this.flags[c]&ot.Lc)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.xc)===ot.OPEN)return!0;if(h===l+1&&o===a)return!0;if(h===l&&o===a-1)return!0}else if(r===lt.Wc){if(h===l-1&&o===a)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.xc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.kc)===ot.OPEN)return!0;if(h===l&&o===a-1)return!0}}else if(n===ct.tf.id){if(h===l&&o===a+1&&(this.flags[c]&ot.cc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.hc)===ot.OPEN)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.lc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.uc)===ot.OPEN)return!0}return!1};Tf=(t,i,e,s,n,r)=>{if(t===e&&i===s)return!0;const h=t-this.offsetX,o=i-this.mf,l=e-this.offsetX,a=s-this.mf,c=ut.index(h,o);if(n===ct.Jc.id||n===ct.$c.id){if(n===ct.$c.id&&(r=r+2&3),r===lt.Bc){if(h===l+1&&o===a&&(this.flags[c]&ot.uc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.hc)===ot.OPEN)return!0}else if(r===lt.Pc){if(h===l-1&&o===a&&(this.flags[c]&ot.lc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.hc)===ot.OPEN)return!0}else if(r===lt.Uc){if(h===l-1&&o===a&&(this.flags[c]&ot.lc)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.cc)===ot.OPEN)return!0}else if(r===lt.Wc){if(h===l+1&&o===a&&(this.flags[c]&ot.uc)===ot.OPEN)return!0;if(h===l&&o===a+1&&(this.flags[c]&ot.cc)===ot.OPEN)return!0}}else if(n===ct.Qc.id){if(h===l&&o===a+1&&(this.flags[c]&ot.cc)===ot.OPEN)return!0;if(h===l&&o===a-1&&(this.flags[c]&ot.hc)===ot.OPEN)return!0;if(h===l-1&&o===a&&(this.flags[c]&ot.lc)===ot.OPEN)return!0;if(h===l+1&&o===a&&(this.flags[c]&ot.uc)===ot.OPEN)return!0}return!1};bf=(t,i,e,s,n,r,h)=>{const o=e+n-1,l=s+r-1,a=ut.index(t-this.offsetX,i-this.mf);return t>=e&&t<=o&&i>=s&&i<=l||(t===e-1&&i>=s&&i<=l&&(this.flags[a]&ot.lc)===ot.OPEN&&(h&ft.Bc)===ot.OPEN||(t===o+1&&i>=s&&i<=l&&(this.flags[a]&ot.uc)===ot.OPEN&&(h&ft.Uc)===ot.OPEN||(i===s-1&&t>=e&&t<=o&&(this.flags[a]&ot.hc)===ot.OPEN&&(h&ft.Wc)===ot.OPEN||i===l+1&&t>=e&&t<=o&&(this.flags[a]&ot.cc)===ot.OPEN&&(h&ft.Pc)===ot.OPEN)))};add=(t,i,e)=>{this.flags[ut.index(t,i)]|=e};remove=(t,i,e)=>{this.flags[ut.index(t,i)]&=ot.Fc-e}}class dt{y;x;z;model;La;info;constructor(t,i,e,s,n,r){this.y=t,this.x=i,this.z=e,this.model=s,this.La=n,this.info=r}}class wt{y;x;z;Of;Rf;vf;Lf;La;info;constructor(t,i,e,s,n,r,h,o,l){this.y=t,this.x=i,this.z=e,this.Of=s,this.Rf=n,this.vf=r,this.Lf=h,this.La=o,this.info=l}}class yt{y;x;z;type;angle;model;La;info;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.type=s,this.angle=n,this.model=r,this.La=h,this.info=o}}class mt{y;x;z;Sf;xf;Mf;La;offset;constructor(t,i,e,s,n,r,h,o){this.y=t,this.x=i,this.z=e,this.Sf=s,this.xf=n,this.Mf=r,this.La=h,this.offset=o}}class pt{kf;Df;Nf;Ff;Bf;color;flat;constructor(t,i,e,s,n,r,h){this.kf=t,this.Df=i,this.Nf=e,this.Ff=s,this.Bf=n,this.color=r,this.flat=h}}class At{static Pf=new Int32Array(6);static Uf=new Int32Array(6);static Wf=new Int32Array(6);static Gf=new Int32Array(6);static Yf=new Int32Array(6);static Hf=[Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,6),Int8Array.of(1,3,5,7,2,6),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,2,8),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,11,12),Int8Array.of(1,3,5,7,13,14)];static Vf=[Int8Array.of(0,1,2,3,0,0,1,3),Int8Array.of(1,1,2,3,1,0,1,3),Int8Array.of(0,1,2,3,1,0,1,3),Int8Array.of(0,0,1,2,0,0,2,4,1,0,4,3),Int8Array.of(0,0,1,4,0,0,4,3,1,1,2,4),Int8Array.of(0,0,4,3,1,0,1,2,1,0,2,4),Int8Array.of(0,1,2,4,1,0,1,4,1,0,4,3),Int8Array.of(0,4,1,2,0,4,2,5,1,0,4,5,1,0,5,3),Int8Array.of(0,4,1,2,0,4,2,3,0,4,3,5,1,0,4,5),Int8Array.of(0,0,4,5,1,4,1,2,1,4,2,3,1,4,3,5),Int8Array.of(0,0,1,5,0,1,4,5,0,1,2,4,1,0,5,3,1,5,4,3,1,4,2,3),Int8Array.of(1,0,1,5,1,1,4,5,1,1,2,4,0,0,5,3,0,5,4,3,0,4,2,3),Int8Array.of(1,0,5,4,1,0,1,5,0,0,4,3,0,4,5,3,0,5,2,3,0,1,2,5)];static Kf=128;static Xf=this.Kf/2|0;static jf=this.Kf/4|0;static zf=3*this.Kf/4|0;cr;er;ur;Zf;qf;Jf;$f;Qf;tu;iu;flat;shape;angle;eu;su;constructor(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,m,p,A){this.flat=!(m!==s||m!==d||m!==o),this.shape=i,this.angle=r,this.eu=u,this.su=l;const _=At.Hf[i],g=_.length;this.cr=new Int32Array(g),this.er=new Int32Array(g),this.ur=new Int32Array(g);const I=new Int32Array(g),C=new Int32Array(g),E=t*At.Kf,T=p*At.Kf;for(let t=0;t8&&g<=12&&(g=9+(g-r-9&3)),g>12&&g<=16&&(g=13+(g-r-13&3)),1===g?(i=E,l=T,c=m,u=h,p=a):2===g?(i=E+At.Xf,l=T,c=m+s>>1,u=h+A>>1,p=a+e>>1):3===g?(i=E+At.Kf,l=T,c=s,u=A,p=e):4===g?(i=E+At.Kf,l=T+At.Xf,c=s+d>>1,u=A+n>>1,p=e+w>>1):5===g?(i=E+At.Kf,l=T+At.Kf,c=d,u=n,p=w):6===g?(i=E+At.Xf,l=T+At.Kf,c=d+o>>1,u=n+y>>1,p=w+f>>1):7===g?(i=E,l=T+At.Kf,c=o,u=y,p=f):8===g?(i=E,l=T+At.Xf,c=o+m>>1,u=y+h>>1,p=f+a>>1):9===g?(i=E+At.Xf,l=T+At.jf,c=m+s>>1,u=h+A>>1,p=a+e>>1):10===g?(i=E+At.zf,l=T+At.Xf,c=s+d>>1,u=A+n>>1,p=e+w>>1):11===g?(i=E+At.Xf,l=T+At.zf,c=d+o>>1,u=n+y>>1,p=w+f>>1):12===g?(i=E+At.jf,l=T+At.Xf,c=o+m>>1,u=y+h>>1,p=f+a>>1):13===g?(i=E+At.jf,l=T+At.jf,c=m,u=h,p=a):14===g?(i=E+At.zf,l=T+At.jf,c=s,u=A,p=e):15===g?(i=E+At.zf,l=T+At.zf,c=d,u=n,p=w):(i=E+At.jf,l=T+At.zf,c=o,u=y,p=f),this.cr[t]=i,this.er[t]=c,this.ur[t]=l,I[t]=u,C[t]=p}const b=At.Vf[i],O=b.length/4|0;this.$f=new Int32Array(O),this.Qf=new Int32Array(O),this.tu=new Int32Array(O),this.Zf=new Int32Array(O),this.qf=new Int32Array(O),this.Jf=new Int32Array(O),this.iu=-1!==c?new Int32Array(O):null;let R=0;for(let t=0;t{this._u=0,this.gu=0,this.Iu=t,this.Cu=i,this.Eu=t/2|0,this.Tu=i/2|0;const r=new x(9,32,53,53,!1);for(let t=128;t<=384;t+=32)for(let i=0;i<2048;i+=64){this.bu=N.sin[t],this.Ou=N.cos[t],this.Ru=N.sin[i],this.vu=N.cos[i];const h=(t-128)/32|0,o=i/64|0;for(let t=-26;t<=26;t++)for(let i=-26;i<=26;i++){const l=128*t,a=128*i;let c=!1;for(let t=-e;t<=s;t+=128)if(this.hd(l,a,n[h]+t)){c=!0;break}r[h][o][t+25+1][i+25+1]=c}}for(let t=0;t<8;t++)for(let i=0;i<32;i++)for(let e=-25;e<25;e++)for(let s=-25;s<25;s++){let n=!1;t:for(let h=-1;h<=1;h++)for(let o=-1;o<=1;o++){if(r[t][i][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t][(i+1)%31][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t+1][i][e+h+25+1][s+o+25+1]){n=!0;break t}if(r[t+1][(i+1)%31][e+h+25+1][s+o+25+1]){n=!0;break t}}this.du[t][i][e+25][s+25]=n}};static Xi=()=>{this.wu=null,this.yu=null,this.mu=null,this.Au=null,this.du=null,this.pu=null,this.Gu=null,console.log('World3D unloaded!')};static od=(t,i,e,s,n,r,h,o)=>{gt.mu[t][gt.yu[t]++]=new ht(e/128|0,r/128|0,n/128|0,o/128|0,i,e,r,n,o,s,h)};static hd=(t,i,e)=>{const s=i*this.Ru+t*this.vu>>16,n=i*this.vu-t*this.Ru>>16,r=e*this.bu+n*this.Ou>>16,h=e*this.Ou-n*this.bu>>16;if(r<50||r>3500)return!1;const o=this.Eu+((s<<9)/r|0),l=this.Tu+((h<<9)/r|0);return o>=this._u&&o<=this.Iu&&l>=this.gu&&l<=this.Cu};ld;qa;$a;ad;fd;ud;dd;wd;yd;md=0;pd=0;Ad=0;constructor(t,i,e,s){this.ld=e,this.qa=s,this.$a=i,this.fd=new S(e,s,i,null),this.dd=new D(e,s+1,i+1),this.ad=t,this.ud=new v(5e3,null),this.wd=new Int32Array(1e4),this.yd=new Int32Array(1e4),this.reset()}reset=()=>{for(let t=0;t{this.pd=t;for(let i=0;i{const e=this.fd[0][t][i];for(let e=0;e<3;e++){this.fd[e][t][i]=this.fd[e+1][t][i];const s=this.fd[e][t][i];s&&s.level--}this.fd[0][t][i]||(this.fd[0][t][i]=new rt(0,t,i));const s=this.fd[0][t][i];s&&(s.Wa=e),this.fd[3][t][i]=null};Id=(t,i,e,s)=>{const n=this.fd[t][i][e];n&&(n.Ha=s)};Cd=(t,i,e,s,n,r,h,o,l,a,c,f,u,d,w,y,m,p,A,_)=>{if(s===_t.nu){for(let s=t;s>=0;s--)this.fd[s][i][e]||(this.fd[s][i][e]=new rt(s,i,e));const s=this.fd[t][i][e];s&&(s.Da=new pt(c,f,u,d,-1,A,!1))}else if(s===_t.ru){for(let s=t;s>=0;s--)this.fd[s][i][e]||(this.fd[s][i][e]=new rt(s,i,e));const s=this.fd[t][i][e];s&&(s.Da=new pt(w,y,m,p,r,_,h===o&&h===l&&h===a))}else{for(let s=t;s>=0;s--)this.fd[s][i][e]||(this.fd[s][i][e]=new rt(s,i,e));const g=this.fd[t][i][e];g&&(g.Na=new At(i,s,y,o,u,n,c,a,_,w,r,p,A,l,m,d,h,e,f))}};Ed=(t,i,e,s,n,r,h)=>{this.fd[i][e][s]||(this.fd[i][e][s]=new rt(i,e,s));const o=this.fd[i][e][s];o&&(o.Pa=new dt(n,128*e+64,128*s+64,t,r,h))};Td=(t,i,e)=>{const s=this.fd[t][i][e];s&&(s.Pa=null)};bd=(t,i,e,s,n,r,h,o)=>{let l=0;const a=this.fd[s][t][i];if(a)for(let t=0;tl&&(l=e)}else this.fd[s][t][i]=new rt(s,t,i);const c=this.fd[s][t][i];c&&(c.Ua=new mt(e,128*t+64,128*i+64,r,h,o,n,l))};Od=(t,i,e)=>{const s=this.fd[t][i][e];s&&(s.Ua=null)};If=(t,i,e,s,n,r,h,o,l,a)=>{if(!h&&!o)return;for(let s=t;s>=0;s--)this.fd[s][i][e]||(this.fd[s][i][e]=new rt(s,i,e));const c=this.fd[t][i][e];c&&(c.Fa=new wt(s,128*i+64,128*e+64,n,r,h,o,l,a))};Cf=(t,i,e,s)=>{const n=this.fd[t][i][e];1===s&&n&&(n.Fa=null)};Rd=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!o)return;for(let s=t;s>=0;s--)this.fd[s][i][e]||(this.fd[s][i][e]=new rt(s,i,e));const f=this.fd[t][i][e];f&&(f.Ba=new yt(s,128*i+n+64,128*e+r+64,c,a,o,h,l))};vd=(t,i,e)=>{const s=this.fd[t][i][e];s&&(s.Ba=null)};Ld=(t,i,e,s)=>{const n=this.fd[t][i][e];if(!n)return;const r=n.Ba;if(!r)return;const h=128*i+64,o=128*e+64;r.x=h+((r.x-h)*s/16|0),r.z=o+((r.z-o)*s/16|0)};Sd=(t,i,e,s)=>{if(!s)return;const n=this.fd[t][i][e];if(!n)return;const r=n.Ba;r&&(r.model=s)};xd=(t,i,e,s)=>{if(!s)return;const n=this.fd[t][i][e];if(!n)return;const r=n.Pa;r&&(r.model=s)};Md=(t,i,e,s)=>{if(!s)return;const n=this.fd[t][i][e];if(!n)return;const r=n.Fa;r&&(r.vf=s)};kd=(t,i,e,s,n)=>{if(!s)return;const r=this.fd[e][t][i];if(!r)return;const h=r.Fa;h&&(h.vf=s,h.Lf=n)};_f=(t,i,e,s,n,r,h,o,l,a,c)=>{if(!n&&!r)return!0;const f=128*i+64*l,u=128*e+64*a;return this.Dd(f,u,s,t,i,e,l,a,n,r,h,o,c,!1)};Nd=(t,i,e,s,n,r,h,o,l,a)=>{if(!n&&!r)return!0;let c=i-l,f=s-l,u=i+l,d=s+l;return a&&(o>640&&o<1408&&(d+=128),o>1152&&o<1920&&(u+=128),(o>1664||o<384)&&(f-=128),o>128&&o<896&&(c-=128)),c=c/128|0,f=f/128|0,u=u/128|0,d=d/128|0,this.Dd(i,s,e,t,c,f,u+1-c,d-f+1,n,r,h,0,o,!0)};Fd=(t,i,e,s,n,r,h,o,l,a,c,f)=>!l&&!a||this.Dd(i,s,e,t,n,r,h+1-n,o-r+1,l,a,c,0,f,!0);gf=(t,i,e)=>{const s=this.fd[t][i][e];if(s)for(let t=0;t>29&3)&&n.ba===i&&n.Ra===e)return void this.Bd(n)}};Pd=(t,i,e,s)=>{if(!s)return;const n=this.fd[t][i][e];if(n)for(let t=0;t>29&3))return void(i.model=s)}};Ud=()=>{for(let t=0;t{const s=this.fd[t][i][e];return s&&s.Fa?s.Fa.La:0};Gd=(t,i,e)=>{const s=this.fd[t][e][i];return s&&s.Ba?s.Ba.La:0};Yd=(t,i,e)=>{const s=this.fd[t][i][e];if(!s)return 0;for(let t=0;t>29&3)&&n.ba===i&&n.Ra===e)return n.La}return 0};Hd=(t,i,e)=>{const s=this.fd[t][i][e];return s&&s.Pa?s.Pa.La:0};Vd=(t,i,e,s)=>{const n=this.fd[t][i][e];if(n){if(n.Fa&&n.Fa.La===s)return 255&n.Fa.info;if(n.Ba&&n.Ba.La===s)return 255&n.Ba.info;if(n.Pa&&n.Pa.La===s)return 255&n.Pa.info;for(let t=0;t{const r=i*(0|Math.sqrt(e*e+s*s+n*n))>>8;for(let i=0;i{if(i0){const n=this.fd[t][i+1][e-1];n&&n.Pa&&n.Pa.model&&n.Pa.model.lr&&this.jd(s,n.Pa.model,128,0,-128,!0)}};Xd=(t,i,e,s,n,r)=>{let h=!0,o=i;const l=i+s,a=e-1,c=e+n;for(let f=t;f<=t+1;f++)if(f!==this.ld){for(let u=o;u<=l;u++)if(!(u<0||u>=this.qa))for(let o=a;o<=c;o++){if(o<0||o>=this.$a||h&&u=e||u===i))continue;const a=this.fd[f][u][o];if(!a)continue;const d=128*(u-i)+64*(1-s),w=128*(o-e)+64*(1-n),y=((this.ad[f][u][o]+this.ad[f][u+1][o]+this.ad[f][u][o+1]+this.ad[f][u+1][o+1])/4|0)-((this.ad[t][i][e]+this.ad[t][i+1][e]+this.ad[t][i][e+1]+this.ad[t][i+1][e+1])/4|0),m=a.Fa;m&&m.vf&&m.vf.lr&&this.jd(r,m.vf,d,y,w,h),m&&m.Lf&&m.Lf.lr&&this.jd(r,m.Lf,d,y,w,h);for(let t=0;t{this.Ad++;let h=0;const o=i.cr,l=i.$s;if(t.lr&&t.ar)for(let r=0;ri.Rr)continue;const u=t.cr[r]-e;if(ui.Er)continue;const d=t.ur[r]-n;if(di.br)continue;if(i.lr&&i.ar)for(let t=0;t{const h=this.fd[t][i][e];if(!h)return;const o=h.Da;if(o){const t=o.color;if(0!==t)for(let i=0;i<4;i++)s[n]=t,s[n+1]=t,s[n+2]=t,s[n+3]=t,n+=r;return}const l=h.Na;if(!l)return;const a=l.shape,c=l.angle,f=l.eu,u=l.su,d=gt.Qu[a],w=gt.td[c];let y=0;if(0===f)for(let t=0;t<4;t++)0!==d[w[y++]]&&(s[n]=u),0!==d[w[y++]]&&(s[n+1]=u),0!==d[w[y++]]&&(s[n+2]=u),0!==d[w[y++]]&&(s[n+3]=u),n+=r;else for(let t=0;t<4;t++)s[n]=0===d[w[y++]]?f:u,s[n+1]=0===d[w[y++]]?f:u,s[n+2]=0===d[w[y++]]?f:u,s[n+3]=0===d[w[y++]]?f:u,n+=r};click=(t,i)=>{gt.Wu=!0,gt.Ve=t,gt.Ke=i,gt.nd=-1,gt.rd=-1};draw=(t,i,e,s,n,r,h)=>{t<0?t=0:t>=128*this.qa&&(t=128*this.qa-1),e<0?e=0:e>=128*this.$a&&(e=128*this.$a-1),gt.Wi++,gt.bu=N.sin[r],gt.Ou=N.cos[r],gt.Ru=N.sin[n],gt.vu=N.cos[n],gt.Gu=gt.du[(r-128)/32|0][n/64|0],gt.Lu=t,gt.Su=i,gt.xu=e,gt.Mu=t/128|0,gt.ku=e/128|0,gt.Pu=s,gt.Du=gt.Mu-25,gt.Du<0&&(gt.Du=0),gt.Fu=gt.ku-25,gt.Fu<0&&(gt.Fu=0),gt.Nu=gt.Mu+25,gt.Nu>this.qa&&(gt.Nu=this.qa),gt.Bu=gt.ku+25,gt.Bu>this.$a&&(gt.Bu=this.$a),this.qd(),gt.Uu=0;for(let t=this.pd;t=2e3)?(h.visible=!0,h.update=!0,h.Va=h.Ga>0,gt.Uu++):(h.visible=!1,h.update=!1,h.Ka=0))}}for(let t=this.pd;t=gt.Nu))for(let t=-25;t<=0;t++){const n=gt.ku+t,r=gt.ku-t;let o;if(e>=gt.Du&&(n>=gt.Fu&&(o=i[e][n],o&&o.visible&&this.Jd(o,!0,h)),r=gt.Fu&&(o=i[s][n],o&&o.visible&&this.Jd(o,!0,h)),r=gt.Nu))for(let t=-25;t<=0;t++){const n=gt.ku+t,r=gt.ku-t;let o;if(e>=gt.Du&&(n>=gt.Fu&&(o=i[e][n],o&&o.visible&&this.Jd(o,!1,h)),r=gt.Fu&&(o=i[s][n],o&&o.visible&&this.Jd(o,!1,h)),r{if(!l&&!a)return!1;for(let t=n;t=this.qa||i>=this.$a)return!1;const e=this.fd[s][t][i];if(e&&e.Ga>=5)return!1}const w=new nt(s,e,t,i,l,a,u,n,n+h-1,r,r+o-1,c,f);for(let t=n;tn&&(e|=1),tr&&(e+=8),i=0;e--)this.fd[e][t][i]||(this.fd[e][t][i]=new rt(e,t,i));const l=this.fd[s][t][i];l&&(l.Ma[l.Ga]=w,l.ka[l.Ga]=e,l.Ya|=e,l.Ga++)}return d&&(this.ud[this.md++]=w),!0};Bd=t=>{for(let i=t.ba;i<=t.Oa;i++)for(let e=t.Ra;e<=t.va;e++){const s=this.fd[t.level][i][e];if(s){for(let i=0;i{const t=gt.yu[gt.Pu],i=gt.mu[gt.Pu];gt.sd=0;for(let e=0;e=0&&s<=50){n=t.Ja+25-gt.ku,n<0&&(n=0),r=t.$a+25-gt.ku,r>50&&(r=50);let i=!1;for(;n<=r;)if(gt.Gu&>.Gu[s][n++]){i=!0;break}if(i){if(h=gt.Lu-t.Cr,h>32)t.mode=1;else{if(h>=-32)continue;t.mode=2,h=-h}t.ic=(t.Tr-gt.xu<<8)/h|0,t.ec=(t.br-gt.xu<<8)/h|0,t.sc=(t.Rr-gt.Su<<8)/h|0,t.nc=(t.vr-gt.Su<<8)/h|0,gt.pu[gt.sd++]=t}}}else if(2===t.type){if(s=t.Ja+25-gt.ku,s>=0&&s<=50){n=t.Za+25-gt.Mu,n<0&&(n=0),r=t.qa+25-gt.Mu,r>50&&(r=50);let i=!1;for(;n<=r;)if(gt.Gu&>.Gu[n++][s]){i=!0;break}if(i){if(h=gt.xu-t.Tr,h>32)t.mode=3;else{if(h>=-32)continue;t.mode=4,h=-h}t.Qa=(t.Cr-gt.Lu<<8)/h|0,t.tc=(t.Er-gt.Lu<<8)/h|0,t.sc=(t.Rr-gt.Su<<8)/h|0,t.nc=(t.vr-gt.Su<<8)/h|0,gt.pu[gt.sd++]=t}}}else if(4===t.type&&(s=t.Rr-gt.Su,s>128&&(n=t.Ja+25-gt.ku,n<0&&(n=0),r=t.$a+25-gt.ku,r>50&&(r=50),n<=r))){let i=t.Za+25-gt.Mu;i<0&&(i=0),h=t.qa+25-gt.Mu,h>50&&(h=50);let e=!1;t:for(let t=i;t<=h;t++)for(let i=n;i<=r;i++)if(gt.Gu&>.Gu[t][i]){e=!0;break t}e&&(t.mode=5,t.Qa=(t.Cr-gt.Lu<<8)/s|0,t.tc=(t.Er-gt.Lu<<8)/s|0,t.ic=(t.Tr-gt.xu<<8)/s|0,t.ec=(t.br-gt.xu<<8)/s|0,gt.pu[gt.sd++]=t)}}};Jd=(t,i,e)=>{for(gt.Au.St(t);;){let t;do{if(t=gt.Au.Mt(),!t)return}while(!t.update);const s=t.x,n=t.z,r=t.level,h=t.xa,o=this.fd[r];if(t.visible){if(i){if(r>0){const t=this.fd[r-1][s][n];if(t&&t.update)continue}if(s<=gt.Mu&&s>gt.Du){const i=o[s-1][n];if(i&&i.update&&(i.visible||!(1&t.Ya)))continue}if(s>=gt.Mu&&sgt.Fu){const i=o[s][n-1];if(i&&i.update&&(i.visible||!(8&t.Ya)))continue}if(n>=gt.ku&&nn&&(a+=6),c=gt.Yu[a],t.za=gt.Vu[a]),f&&(f.Of>.Hu[a]?16===f.Of?(t.Ka=3,t.Xa=gt.Ku[a],t.ja=3-t.Xa):32===f.Of?(t.Ka=6,t.Xa=gt.Xu[a],t.ja=6-t.Xa):64===f.Of?(t.Ka=12,t.Xa=gt.ju[a],t.ja=12-t.Xa):(t.Ka=9,t.Xa=gt.zu[a],t.ja=9-t.Xa):t.Ka=0,f.Of&c&&!this.iw(h,s,n,f.Of)&&f.vf?.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,f.x-gt.Lu,f.y-gt.Su,f.z-gt.xu,f.La),f.Rf&c&&!this.iw(h,s,n,f.Rf)&&f.Lf?.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,f.x-gt.Lu,f.y-gt.Su,f.z-gt.xu,f.La)),u&&!this.visible(h,s,n,u.model.vr))if(u.type&c)u.model.draw(u.angle,gt.bu,gt.Ou,gt.Ru,gt.vu,u.x-gt.Lu,u.y-gt.Su,u.z-gt.xu,u.La);else if(768&u.type){const t=u.x-gt.Lu,i=u.y-gt.Su,e=u.z-gt.xu,s=u.angle;let n,r;if(n=s===lt.Pc||s===lt.Uc?-t:t,r=s===lt.Uc||s===lt.Wc?-e:e,256&u.type&&rn){const n=t+gt.Ju[s],r=e+gt.$u[s];u.model.draw(512*s+1280&2047,gt.bu,gt.Ou,gt.Ru,gt.vu,n,i,r,u.La)}}if(l){const i=t.Pa;i&&i.model?.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,i.x-gt.Lu,i.y-gt.Su,i.z-gt.xu,i.La);const e=t.Ua;e&&0===e.offset&&(e.Mf&&e.Mf.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,e.x-gt.Lu,e.y-gt.Su,e.z-gt.xu,e.La),e.xf&&e.xf.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,e.x-gt.Lu,e.y-gt.Su,e.z-gt.xu,e.La),e.Sf&&e.Sf.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,e.x-gt.Lu,e.y-gt.Su,e.z-gt.xu,e.La))}const d=t.Ya;if(0!==d){if(sgt.Mu&&1&d){const t=o[s-1][n];t&&t.update&>.Au.St(t)}if(n>gt.ku&&8&d){const t=o[s][n-1];t&&t.update&>.Au.St(t)}}}if(0!==t.Ka){let i=!0;for(let e=0;ei.ba&&(r+=1),ei.Ra&&(r+=8),ss&&(s=n);const h=gt.ku-i.Ra,l=i.va-gt.ku;i.Sa=l>h?s+l:s+h}for(;;){let t=-50,i=-1;for(let e=0;et&&(t=s.Sa,i=e))}if(-1===i)break;const l=gt.wu[i];if(l){l.Wi=gt.Wi;let t=l.model;t||(t=l.Ea?.draw(e)??null),t&&!this.ew(h,l.ba,l.Oa,l.Ra,l.va,t.vr)&&t.draw(l.Ta,gt.bu,gt.Ou,gt.Ru,gt.vu,l.x-gt.Lu,l.y-gt.Su,l.z-gt.xu,l.La);for(let t=l.ba;t<=l.Oa;t++)for(let i=l.Ra;i<=l.va;i++){const e=o[t][i];e&&(0!==e.Ka?gt.Au.St(e):t===s&&i===n||!e.update||gt.Au.St(e))}}}if(t.Va)continue}if(!t.update||0!==t.Ka)continue;if(s<=gt.Mu&&s>gt.Du){const t=o[s-1][n];if(t&&t.update)continue}if(s>=gt.Mu&&sgt.Fu){const t=o[s][n-1];if(t&&t.update)continue}if(n>=gt.ku&&n=r){const r=t+gt.Zu[n],h=s+gt.qu[n];i.model.draw(512*n+256,gt.bu,gt.Ou,gt.Ru,gt.vu,r,e,h,i.La)}if(512&i.type&&h<=r){const r=t+gt.Ju[n],h=s+gt.$u[n];i.model.draw(512*n+1280&2047,gt.bu,gt.Ou,gt.Ru,gt.vu,r,e,h,i.La)}}const e=t.Fa;e&&(e.Rf&t.za&&!this.iw(h,s,n,e.Rf)&&e.Lf?.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,e.x-gt.Lu,e.y-gt.Su,e.z-gt.xu,e.La),e.Of&t.za&&!this.iw(h,s,n,e.Of)&&e.vf?.draw(0,gt.bu,gt.Ou,gt.Ru,gt.vu,e.x-gt.Lu,e.y-gt.Su,e.z-gt.xu,e.La))}if(rgt.Mu){const t=o[s-1][n];t&&t.update&>.Au.St(t)}if(n>gt.ku){const t=o[s][n-1];t&&t.update&>.Au.St(t)}}};Qd=(t,i,e,s,n,r,h,o)=>{let l,a,c,f,u=l=(e<<7)-gt.Lu,d=a=(s<<7)-gt.xu,w=c=u+128,y=f=d+128,p=this.ad[i][e][s]-gt.Su,A=this.ad[i][e+1][s]-gt.Su,_=this.ad[i][e+1][s+1]-gt.Su,g=this.ad[i][e][s+1]-gt.Su,I=d*h+u*o>>16;if(d=d*o-u*h>>16,u=I,I=p*r-d*n>>16,d=p*n+d*r>>16,p=I,d<50)return;if(I=a*h+w*o>>16,a=a*o-w*h>>16,w=I,I=A*r-a*n>>16,a=A*n+a*r>>16,A=I,a<50)return;if(I=y*h+c*o>>16,y=y*o-c*h>>16,c=I,I=_*r-y*n>>16,y=_*n+y*r>>16,_=I,y<50)return;if(I=f*h+l*o>>16,f=f*o-l*h>>16,l=I,I=g*r-f*n>>16,f=g*n+f*r>>16,g=I,f<50)return;const C=N.ki+((u<<9)/d|0),E=N.Di+((p<<9)/d|0),T=N.ki+((w<<9)/a|0),b=N.Di+((A<<9)/a|0),O=N.ki+((c<<9)/y|0),R=N.Di+((_<<9)/y|0),v=N.ki+((l<<9)/f|0),L=N.Di+((g<<9)/f|0);if(N.alpha=0,(O-v)*(b-L)-(R-L)*(T-v)>0)if(N.Fi=O<0||v<0||T<0||O>m.ut||v>m.ut||T>m.ut,gt.Wu&&this.sw(gt.Ve,gt.Ke,R,L,b,O,v,T)&&(gt.nd=e,gt.rd=s),-1===t.Bf)12345678!==t.Nf&&N.ee(O,v,T,R,L,b,t.Nf,t.Ff,t.Df);else if(gt.Ri){const i=gt.ed[t.Bf];N.ee(O,v,T,R,L,b,this.nw(i,t.Nf),this.nw(i,t.Ff),this.nw(i,t.Df))}else t.flat?N.he(O,v,T,R,L,b,t.Nf,t.Ff,t.Df,u,p,d,w,l,A,g,a,f,t.Bf):N.he(O,v,T,R,L,b,t.Nf,t.Ff,t.Df,c,_,y,l,w,g,A,f,a,t.Bf);if(!((C-T)*(L-b)-(E-b)*(v-T)<=0))if(N.Fi=C<0||T<0||v<0||C>m.ut||T>m.ut||v>m.ut,gt.Wu&&this.sw(gt.Ve,gt.Ke,E,b,L,C,T,v)&&(gt.nd=e,gt.rd=s),-1!==t.Bf){if(!gt.Ri)return void N.he(C,T,v,E,b,L,t.kf,t.Df,t.Ff,u,p,d,w,l,A,g,a,f,t.Bf);const i=gt.ed[t.Bf];N.ee(C,T,v,E,b,L,this.nw(i,t.kf),this.nw(i,t.Df),this.nw(i,t.Ff))}else 12345678!==t.kf&&N.ee(C,T,v,E,b,L,t.kf,t.Df,t.Ff)};tw=(t,i,e,s,n,r,h)=>{let o=e.cr.length;for(let t=0;t>16;if(l=l*h-i*r>>16,i=a,a=o*n-l*s>>16,l=o*s+l*n>>16,o=a,l<50)return;e.iu&&(At.Wf[t]=i,At.Gf[t]=o,At.Yf[t]=l),At.Pf[t]=N.ki+((i<<9)/l|0),At.Uf[t]=N.Di+((o<<9)/l|0)}N.alpha=0,o=e.$f.length;for(let s=0;s0)if(N.Fi=o<0||l<0||a<0||o>m.ut||l>m.ut||a>m.ut,gt.Wu&&this.sw(gt.Ve,gt.Ke,c,f,u,o,l,a)&&(gt.nd=t,gt.rd=i),e.iu&&-1!==e.iu[s])if(gt.Ri){const t=gt.ed[e.iu[s]];N.ee(o,l,a,c,f,u,this.nw(t,e.Zf[s]),this.nw(t,e.qf[s]),this.nw(t,e.Jf[s]))}else e.flat?N.he(o,l,a,c,f,u,e.Zf[s],e.qf[s],e.Jf[s],At.Wf[0],At.Gf[0],At.Yf[0],At.Wf[1],At.Wf[3],At.Gf[1],At.Gf[3],At.Yf[1],At.Yf[3],e.iu[s]):N.he(o,l,a,c,f,u,e.Zf[s],e.qf[s],e.Jf[s],At.Wf[n],At.Gf[n],At.Yf[n],At.Wf[r],At.Wf[h],At.Gf[r],At.Gf[h],At.Yf[r],At.Yf[h],e.iu[s]);else 12345678!==e.Zf[s]&&N.ee(o,l,a,c,f,u,e.Zf[s],e.qf[s],e.Jf[s])}};$d=(t,i,e)=>{const s=this.dd[t][i][e];if(s===-gt.Wi)return!1;if(s===gt.Wi)return!0;{const s=i<<7,n=e<<7;return this.rw(s+1,this.ad[t][i][e],n+1)&&this.rw(s+128-1,this.ad[t][i+1][e],n+1)&&this.rw(s+128-1,this.ad[t][i+1][e+1],n+128-1)&&this.rw(s+1,this.ad[t][i][e+1],n+128-1)?(this.dd[t][i][e]=gt.Wi,!0):(this.dd[t][i][e]=-gt.Wi,!1)}};iw=(t,i,e,s)=>{if(!this.$d(t,i,e))return!1;const n=i<<7,r=e<<7,h=this.ad[t][i][e]-1,o=h-120,l=h-230,a=h-238;if(s<16){if(1===s){if(n>gt.Lu){if(!this.rw(n,h,r))return!1;if(!this.rw(n,h,r+128))return!1}if(t>0){if(!this.rw(n,o,r))return!1;if(!this.rw(n,o,r+128))return!1}return!!this.rw(n,l,r)&&this.rw(n,l,r+128)}if(2===s){if(r0){if(!this.rw(n,o,r+128))return!1;if(!this.rw(n+128,o,r+128))return!1}return!!this.rw(n,l,r+128)&&this.rw(n+128,l,r+128)}if(4===s){if(n0){if(!this.rw(n+128,o,r))return!1;if(!this.rw(n+128,o,r+128))return!1}return!!this.rw(n+128,l,r)&&this.rw(n+128,l,r+128)}if(8===s){if(r>gt.xu){if(!this.rw(n,h,r))return!1;if(!this.rw(n+128,h,r))return!1}if(t>0){if(!this.rw(n,o,r))return!1;if(!this.rw(n+128,o,r))return!1}return!!this.rw(n,l,r)&&this.rw(n+128,l,r)}}return!!this.rw(n+64,a,r+64)&&(16===s?this.rw(n,l,r+128):32===s?this.rw(n+128,l,r+128):64===s?this.rw(n+128,l,r):128===s?this.rw(n,l,r):(console.warn('Warning unsupported wall type!'),!0))};visible=(t,i,e,s)=>{if(this.$d(t,i,e)){const n=i<<7,r=e<<7;return this.rw(n+1,this.ad[t][i][e]-s,r+1)&&this.rw(n+128-1,this.ad[t][i+1][e]-s,r+1)&&this.rw(n+128-1,this.ad[t][i+1][e+1]-s,r+128-1)&&this.rw(n+1,this.ad[t][i][e+1]-s,r+128-1)}return!1};ew=(t,i,e,s,n,r)=>{let h,o;if(i!==e||s!==n){for(h=i;h<=e;h++)for(o=s;o<=n;o++)if(this.dd[t][h][o]===-gt.Wi)return!1;o=1+(i<<7);const l=2+(s<<7),a=this.ad[t][i][s]-r;if(!this.rw(o,a,l))return!1;const c=(e<<7)-1;if(!this.rw(c,a,l))return!1;const f=(n<<7)-1;return!!this.rw(o,a,f)&&this.rw(c,a,f)}return!!this.$d(t,i,s)&&(h=i<<7,o=s<<7,this.rw(h+1,this.ad[t][i][s]-r,o+1)&&this.rw(h+128-1,this.ad[t][i+1][s]-r,o+1)&&this.rw(h+128-1,this.ad[t][i+1][s+1]-r,o+128-1)&&this.rw(h+1,this.ad[t][i][s+1]-r,o+128-1))};rw=(t,i,e)=>{for(let s=0;s0){const t=n.Tr+(n.ic*s>>8),r=n.br+(n.ec*s>>8),h=n.Rr+(n.sc*s>>8),o=n.vr+(n.nc*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(2===n.mode){const s=t-n.Cr;if(s>0){const t=n.Tr+(n.ic*s>>8),r=n.br+(n.ec*s>>8),h=n.Rr+(n.sc*s>>8),o=n.vr+(n.nc*s>>8);if(e>=t&&e<=r&&i>=h&&i<=o)return!0}}else if(3===n.mode){const s=n.Tr-e;if(s>0){const e=n.Cr+(n.Qa*s>>8),r=n.Er+(n.tc*s>>8),h=n.Rr+(n.sc*s>>8),o=n.vr+(n.nc*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(4===n.mode){const s=e-n.Tr;if(s>0){const e=n.Cr+(n.Qa*s>>8),r=n.Er+(n.tc*s>>8),h=n.Rr+(n.sc*s>>8),o=n.vr+(n.nc*s>>8);if(t>=e&&t<=r&&i>=h&&i<=o)return!0}}else if(5===n.mode){const s=i-n.Rr;if(s>0){const i=n.Cr+(n.Qa*s>>8),r=n.Er+(n.tc*s>>8),h=n.Tr+(n.ic*s>>8),o=n.br+(n.ec*s>>8);if(t>=i&&t<=r&&e>=h&&e<=o)return!0}}}return!1};sw=(t,i,e,s,n,r,h,o)=>{if(ie&&i>s&&i>n)return!1;if(tr&&t>h&&t>o)return!1;const l=(i-s)*(o-h)-(t-h)*(n-s);return((i-e)*(h-r)-(t-r)*(s-e))*l>0&&l*((i-n)*(r-o)-(t-o)*(e-n))>0};nw=(t,i)=>((i=(127-i)*(127&t)/160|0)<2?i=2:i>126&&(i=126),(65408&t)+i)}class It{id;hw=null;constructor(t){this.id=t}ow(t){for(;;){const i=t.jt;if(0===i)break;this.decode(i,t)}return this}}class Ct extends It{static count=0;static zs=[];static Zs=t=>{const i=new O(t.read('flo.dat'));this.count=i.Zt;for(let t=0;t(e>179&&(i=i/2|0),e>192&&(i=i/2|0),e>217&&(i=i/2|0),e>243&&(i=i/2|0),(t/4<<10)+(i/32<<7)+(e/2|0));static aw=(t,i)=>-1===t?12345678:((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);static cw=(t,i)=>-2===t?12345678:-1===t?(i<0?i=0:i>127&&(i=127),127-i):((i=i*(127&t)/128|0)<2?i=2:i>126&&(i=126),(65408&t)+i);fw=0;texture=-1;uw=!1;dw=!0;ww=0;yw=0;mw=0;pw=0;Aw=0;_w=0;decode(t,i){1===t?(this.fw=i.Jt,this.setColor(this.fw)):2===t?this.texture=i.jt:3===t?this.uw=!0:5===t?this.dw=!1:6===t?this.hw=i.ei:console.log('Error unrecognised config code: ',t)}setColor(t){const i=(t>>16&255)/256,e=(t>>8&255)/256,s=(255&t)/256;let n=i;ei&&(r=e),s>r&&(r=s);let h=0,o=0;const l=(n+r)/2;n!==r&&(l<.5&&(o=(r-n)/(r+n)),l>=.5&&(o=(r-n)/(2-r-n)),i===r?h=(e-s)/(r-n):e===r?h=(s-i)/(r-n)+2:s===r&&(h=(i-e)/(r-n)+4)),h/=6,this.ww=256*h|0,this.yw=256*o|0,this.mw=256*l|0,this.yw<0?this.yw=0:this.yw>255&&(this.yw=255),this.mw<0?this.mw=0:this.mw>255&&(this.mw=255),this.pw=l>.5?(1-l)*o*512|0:l*o*512|0,this.pw<1&&(this.pw=1),this.Aw=h*this.pw|0;let a=this.ww+(16*Math.random()|0)-8;a<0?a=0:a>255&&(a=255);let c=this.yw+(48*Math.random()|0)-24;c<0?c=0:c>255&&(c=255);let f=this.mw+(48*Math.random()|0)-24;f<0?f=0:f>255&&(f=255),this._w=Ct.lw(a,c,f)}}class Et extends It{static count=0;static cache=null;static Xs=null;static gw=null;static Iw=0;static Cw=new q(500);static Ew=new q(30);static Zs=t=>{this.Xs=new O(t.read('loc.dat'));const i=new O(t.read('loc.idx'));this.count=i.Zt,this.gw=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.gw||!this.Xs)throw new Error('LocType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Iw=(this.Iw+1)%10;const i=this.cache[this.Iw];return this.Xs.Vt=this.gw[t],i.id=t,i.reset(),i.ow(this.Xs),i.Tw||(i.Tw=new Int32Array(1)),-1===i.bw&&i.Tw&&(i.active=i.Tw.length>0&&i.Tw[0]===ct.if.id,i.Ow&&(i.active=!0)),i};static Xi=()=>{this.Cw=null,this.Ew=null,this.gw=null,this.cache=null,this.Xs=null};Rw=null;Tw=null;name=null;Lw=null;Sw=null;xw=null;width=1;length=1;Mw=!0;kw=!0;active=!1;bw=-1;Dw=!1;Nw=!1;dw=!1;Dl=-1;Fw=!1;Bw=16;Pw=0;Uw=0;Ow=null;Ww=-1;Gw=-1;Yw=!1;Hw=!0;Vw=128;Kw=128;Xw=128;jw=0;zw=0;Zw=0;qw=0;Jw=!1;decode(t,i){if(1===t){const t=i.jt;this.Rw=new Int32Array(t),this.Tw=new Int32Array(t);for(let e=0;e=30&&t<39)this.Ow||(this.Ow=new v(5,null)),this.Ow[t-30]=i.ei,'hidden'===this.Ow[t-30]?.toLowerCase()&&(this.Ow[t-30]=null);else if(40===t){const t=i.jt;this.Sw=new Uint16Array(t),this.xw=new Uint16Array(t);for(let e=0;e=this.Rw.length)return null;let c=this.Rw[o];if(-1===c)return null;const f=this.Yw!==i>3;f&&(c+=65536);let u=Et.Cw?.get(BigInt(c));u||(u=j.model(65535&c),f&&u.th(),Et.Cw?.put(BigInt(c),u));const d=128!==this.Vw||128!==this.Kw||128!==this.Xw,w=0!==this.zw||0!==this.Zw||0!==this.qw;let y=j.Mr(u,!this.Sw,!this.Fw,i===lt.Bc&&-1===h&&!d&&!w);for(-1!==h&&(y.jr(),y.qr(h),y.Br=null,y.Fr=null);i-- >0;)y.Jr();if(this.Sw&&this.xw)for(let t=0;t{const i=new O(t.read('seq.dat'));this.count=i.Zt;for(let t=0;t{let e=this.ip(t+45365,i+91923,4)+(this.ip(t+10294,i+37821,2)-128>>1)+(this.ip(t,i,1)-128>>2)-128;return e=35+(.3*e|0),e<10?e=10:e>60&&(e=60),e};static ip=(t,i,e)=>{const s=t/e|0,n=t&e-1,r=i/e|0,h=i&e-1,o=this.ep(s,r),l=this.ep(s+1,r),a=this.ep(s,r+1),c=this.ep(s+1,r+1),f=this.sp(o,l,n,e),u=this.sp(a,c,n,e);return this.sp(f,u,h,e)};static sp=(t,i,e,s)=>{const n=65536-N.cos[1024*e/s|0]>>1;return(t*(65536-n)>>16)+(i*n>>16)};static ep=(t,i)=>((this.np(t-1,i-1)+this.np(t+1,i-1)+this.np(t-1,i+1)+this.np(t+1,i+1))/16|0)+((this.np(t-1,i)+this.np(t+1,i)+this.np(t,i-1)+this.np(t,i+1))/8|0)+(this.np(t,i)/4|0);static np=(t,i)=>{const e=t+57*i,s=BigInt(e<<13^e);return 255&Number((s*(s*s*15731n+789221n)+1376312589n&0x7fffffffn)>>19n)};static _f=(t,i,e,s,n,r,h,o,l,a,c)=>{const f=n[c][i][e],u=n[c][i+1][e],d=n[c][i+1][e+1],w=n[c][i][e+1],y=f+u+d+w>>2,m=Et.get(o);let p=i+(e<<7)+(o<<14)+1073741824|0;m.active||(p+=-2147483648),p|=0;const A=(a<<6)+l<<24>>24;if(l===ct.Vc.id)s?.Ed(m.Ml(ct.Vc.id,a,f,u,d,w,-1),t,i,e,y,p,A),m.Mw&&m.active&&h?.pf(i,e),-1!==m.Dl&&r.St(new Tt(o,t,3,i,e,bt.zs[m.Dl],!0));else if(l===ct.if.id||l===ct.ef.id){const n=m.Ml(ct.if.id,a,f,u,d,w,-1);if(n){let r,h,o=0;l===ct.ef.id&&(o+=256),a===lt.Pc||a===lt.Wc?(r=m.length,h=m.width):(r=m.width,h=m.length),s?._f(t,i,e,y,n,null,p,A,r,h,o)}m.Mw&&h?._f(i,e,m.width,m.length,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,2,i,e,bt.zs[m.Dl],!0))}else if(l>=ct.sf.id)s?._f(t,i,e,y,m.Ml(l,a,f,u,d,w,-1),null,p,A,1,1,0),m.Mw&&h?._f(i,e,m.width,m.length,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,2,i,e,bt.zs[m.Dl],!0));else if(l===ct.Kc.id)s?.If(t,i,e,y,Rt.Xm[a],0,m.Ml(ct.Kc.id,a,f,u,d,w,-1),null,p,A),m.Mw&&h?.If(i,e,l,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,0,i,e,bt.zs[m.Dl],!0));else if(l===ct.Xc.id)s?.If(t,i,e,y,Rt.jm[a],0,m.Ml(ct.Xc.id,a,f,u,d,w,-1),null,p,A),m.Mw&&h?.If(i,e,l,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,0,i,e,bt.zs[m.Dl],!0));else if(l===ct.jc.id){const n=a+1&3;s?.If(t,i,e,y,Rt.Xm[a],Rt.Xm[n],m.Ml(ct.jc.id,a+4,f,u,d,w,-1),m.Ml(ct.jc.id,n,f,u,d,w,-1),p,A),m.Mw&&h?.If(i,e,l,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,0,i,e,bt.zs[m.Dl],!0))}else if(l===ct.zc.id)s?.If(t,i,e,y,Rt.jm[a],0,m.Ml(ct.zc.id,a,f,u,d,w,-1),null,p,A),m.Mw&&h?.If(i,e,l,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,0,i,e,bt.zs[m.Dl],!0));else if(l===ct.tf.id)s?._f(t,i,e,y,m.Ml(l,a,f,u,d,w,-1),null,p,A,1,1,0),m.Mw&&h?._f(i,e,m.width,m.length,a,m.kw),-1!==m.Dl&&r.St(new Tt(o,t,2,i,e,bt.zs[m.Dl],!0));else if(l===ct.Zc.id)s?.Rd(t,i,e,y,0,0,p,m.Ml(ct.Zc.id,lt.Bc,f,u,d,w,-1),A,512*a,Rt.Xm[a]),-1!==m.Dl&&r.St(new Tt(o,t,1,i,e,bt.zs[m.Dl],!0));else if(l===ct.qc.id){let n=16;if(s){const r=s.Wd(t,i,e);r>0&&(n=Et.get(r>>14&32767).Bw)}s?.Rd(t,i,e,y,Rt.zm[a]*n,Rt.Zm[a]*n,p,m.Ml(ct.Zc.id,lt.Bc,f,u,d,w,-1),A,512*a,Rt.Xm[a]),-1!==m.Dl&&r.St(new Tt(o,t,1,i,e,bt.zs[m.Dl],!0))}else l===ct.Jc.id?(s?.Rd(t,i,e,y,0,0,p,m.Ml(ct.Zc.id,lt.Bc,f,u,d,w,-1),A,a,256),-1!==m.Dl&&r.St(new Tt(o,t,1,i,e,bt.zs[m.Dl],!0))):l===ct.$c.id?(s?.Rd(t,i,e,y,0,0,p,m.Ml(ct.Zc.id,lt.Bc,f,u,d,w,-1),A,a,512),-1!==m.Dl&&r.St(new Tt(o,t,1,i,e,bt.zs[m.Dl],!0))):l===ct.Qc.id&&(s?.Rd(t,i,e,y,0,0,p,m.Ml(ct.Zc.id,lt.Bc,f,u,d,w,-1),A,a,768),-1!==m.Dl&&r.St(new Tt(o,t,1,i,e,bt.zs[m.Dl],!0)))};qa;$a;rp;hp;op;lp;ap;cp;fp;up;dp;wp;yp;mp;pp;Ap;constructor(t,i,e,s){this.qa=t,this.$a=i,this.rp=e,this.hp=s,this.op=new M(ut.wf,t,i),this.lp=new M(ut.wf,t,i),this.ap=new M(ut.wf,t,i),this.cp=new M(ut.wf,t,i),this.Ap=new D(ut.wf,t+1,i+1),this.fp=new M(ut.wf,t+1,i+1),this.up=new k(t+1,i+1),this.dp=new Int32Array(i),this.wp=new Int32Array(i),this.yp=new Int32Array(i),this.mp=new Int32Array(i),this.pp=new Int32Array(i)}_p=(t,i)=>{for(let t=0;t=0&&i[n]?.pf(e,s)}Rt.qm+=(5*Math.random()|0)-2,Rt.qm<-8?Rt.qm=-8:Rt.qm>8&&(Rt.qm=8),Rt.Jm+=(5*Math.random()|0)-2,Rt.Jm<-16?Rt.Jm=-16:Rt.Jm>16&&(Rt.Jm=16);for(let i=0;i>8;for(let t=1;t>2)+(e[l+1][t]>>3)+(e[l][t-1]>>2)+(e[l][t+1]>>3)+(e[l][t]>>1);this.up[l][t]=u-d}for(let t=0;t=0&&s0){const i=Ct.zs[e-1];this.dp[t]+=i.Aw,this.wp[t]+=i.yw,this.yp[t]+=i.mw,this.mp[t]+=i.pw,n=this.pp[t]++}}const r=e-5;if(r>=0&&r0){const i=Ct.zs[e-1];this.dp[t]-=i.Aw,this.wp[t]-=i.yw,this.yp[t]-=i.mw,this.mp[t]-=i.pw,n=this.pp[t]--}}}if(e>=1&&e=0&&a=0&&c=1&&l0||c>0){const f=this.rp[i][e][l],u=this.rp[i][e+1][l],d=this.rp[i][e+1][l+1],w=this.rp[i][e][l+1],y=this.up[e][l],m=this.up[e+1][l],p=this.up[e+1][l+1],A=this.up[e][l+1];let _=-1,g=-1;if(a>0){const t=256*s/h|0,i=n/o|0;let e=r/o|0;_=Ct.lw(t,i,e);const l=t+Rt.qm&255;e+=Rt.Jm,e<0?e=0:e>255&&(e=255),g=Ct.lw(l,i,e)}if(i>0){let t=0!==a||this.ap[i][e][l]===_t.nu;c>0&&!Ct.zs[c-1].dw&&(t=!1),t&&f===u&&f===d&&f===w&&(this.Ap[i][e][l]|=2340)}let I=0;if(-1!==_&&(I=N.palette[Ct.aw(g,96)]),0===c)t?.Cd(i,e,l,_t.nu,lt.Bc,-1,f,u,d,w,Ct.aw(_,y),Ct.aw(_,m),Ct.aw(_,p),Ct.aw(_,A),Ot.gy,Ot.gy,Ot.gy,Ot.gy,I,Ot.gy);else{const s=this.ap[i][e][l]+1,n=this.cp[i][e][l],r=Ct.zs[c-1];let h,o,a=r.texture;a>=0?(o=N.Ji(a),h=-1):r.fw===Ot.Ay?(o=0,h=-2,a=-1):(h=Ct.lw(r.ww,r.yw,r.mw),o=N.palette[Ct.cw(r._w,96)]),t?.Cd(i,e,l,s,n,a,f,u,d,w,Ct.aw(_,y),Ct.aw(_,m),Ct.aw(_,p),Ct.aw(_,A),Ct.cw(h,y),Ct.cw(h,m),Ct.cw(h,p),Ct.cw(h,A),I,o)}}}}}}for(let e=1;e0&&(t<<=3,i<<=3,e<<=3);for(let n=0;n<=s;n++)for(let r=0;r<=this.$a;r++)for(let h=0;h<=this.qa;h++){if(this.Ap[n][h][r]&t){let i=r,e=r,o=n,l=n;for(;i>0&&this.Ap[n][h][i-1]&t;)i--;for(;e0;){for(let s=i;s<=e;s++)if(!(this.Ap[o-1][h][s]&t))break t;o--}t:for(;l=8){const n=this.rp[l][h][i]-240,r=this.rp[o][h][i];gt.od(s,1,128*h,n,128*i,128*h,r,128*e+128);for(let s=o;s<=l;s++)for(let n=i;n<=e;n++)this.Ap[s][h][n]&=~t}}if(this.Ap[n][h][r]&i){let t=h,e=h,o=n,l=n;for(;t>0&&this.Ap[n][t-1][r]&i;)t--;for(;e0;){for(let s=t;s<=e;s++)if(!(this.Ap[o-1][s][r]&i))break t;o--}t:for(;l=8){const n=this.rp[l][t][r]-240,h=this.rp[o][t][r];gt.od(s,2,128*t,n,128*r,128*e+128,h,128*r);for(let s=o;s<=l;s++)for(let n=t;n<=e;n++)this.Ap[s][n][r]&=~i}}if(this.Ap[n][h][r]&e){let t=h,i=h,o=r,l=r;for(;o>0&&this.Ap[n][h][o-1]&e;)o--;for(;l0;){for(let i=o;i<=l;i++)if(!(this.Ap[n][t-1][i]&e))break t;t--}t:for(;i=4){const r=this.rp[n][t][o];gt.od(s,4,128*t,r,128*o,128*i+128,r,128*l+128);for(let s=t;s<=i;s++)for(let t=o;t<=l;t++)this.Ap[n][s][t]&=~e}}}}}};Ip=(t,i,e,s)=>{let n=0;for(let t=0;t>24;break}for(let r=t;r=0&&t=0&&r{const r=new O(new Uint8Array(n));for(let n=0;n=0&&l=0&&a>24,this.cp[n][l][a]=(c-2&3)<<24>>24):c<=81?this.hp[n][l][a]=c-49<<24>>24:this.op[n][l][a]=c-81<<24>>24}else for(;c=r.jt,0!==c;){if(1===c){r.jt;break}c<=49&&r.jt}}};Ep=(t,i,e,s,n,r)=>{const h=new O(new Uint8Array(s));let o=-1;for(;;){const s=h.ii;if(0===s)return;o+=s;let l=0;for(;;){const s=h.ii;if(0===s)break;l+=s-1;const a=63&l,c=l>>6&63,f=l>>12,u=h.jt,d=u>>2,w=3&u,y=c+n,m=a+r;if(y>0&&m>0&&y=0&&(n=e[s]),this._f(f,y,m,t,i,n,o,d,w)}}}};_f=(t,i,e,s,n,r,h,o,l)=>{if(Rt.Ri){if(16&this.hp[t][i][e])return;if(this.gp(t,i,e)!==Rt.$m)return}const a=this.rp[t][i][e],c=this.rp[t][i+1][e],f=this.rp[t][i+1][e+1],u=this.rp[t][i][e+1],d=a+c+f+u>>2,w=Et.get(h);let y=i+(e<<7)+(h<<14)+1073741824|0;w.active||(y+=-2147483648),y|=0;const m=(l<<6)+o<<24>>24;if(o===ct.Vc.id)(!Rt.Ri||w.active||w.Jw)&&(s?.Ed(w.Ml(ct.Vc.id,l,a,c,f,u,-1),t,i,e,d,y,m),w.Mw&&w.active&&r?.pf(i,e),-1!==w.Dl&&n.St(new Tt(h,t,3,i,e,bt.zs[w.Dl],!0)));else if(o===ct.if.id||o===ct.ef.id){const p=w.Ml(ct.if.id,l,a,c,f,u,-1);if(p){let n,r,h=0;if(o===ct.ef.id&&(h+=256),l===lt.Pc||l===lt.Wc?(n=w.length,r=w.width):(n=w.width,r=w.length),s?._f(t,i,e,d,p,null,y,m,n,r,h)&&w.Hw)for(let s=0;s<=n;s++)for(let n=0;n<=r;n++){let r=p.Or/4|0;r>30&&(r=30),r>this.fp[t][i+s][e+n]&&(this.fp[t][i+s][e+n]=r<<24>>24)}}w.Mw&&r?._f(i,e,w.width,w.length,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,2,i,e,bt.zs[w.Dl],!0))}else if(o>=ct.sf.id)s?._f(t,i,e,d,w.Ml(o,l,a,c,f,u,-1),null,y,m,1,1,0),o>=ct.sf.id&&o<=ct.af.id&&o!==ct.nf.id&&t>0&&(this.Ap[t][i][e]|=2340),w.Mw&&r?._f(i,e,w.width,w.length,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,2,i,e,bt.zs[w.Dl],!0));else if(o===ct.Kc.id)s?.If(t,i,e,d,Rt.Xm[l],0,w.Ml(ct.Kc.id,l,a,c,f,u,-1),null,y,m),l===lt.Bc?(w.Hw&&(this.fp[t][i][e]=50,this.fp[t][i][e+1]=50),w.dw&&(this.Ap[t][i][e]|=585)):l===lt.Pc?(w.Hw&&(this.fp[t][i][e+1]=50,this.fp[t][i+1][e+1]=50),w.dw&&(this.Ap[t][i][e+1]|=1170)):l===lt.Uc?(w.Hw&&(this.fp[t][i+1][e]=50,this.fp[t][i+1][e+1]=50),w.dw&&(this.Ap[t][i+1][e]|=585)):l===lt.Wc&&(w.Hw&&(this.fp[t][i][e]=50,this.fp[t][i+1][e]=50),w.dw&&(this.Ap[t][i][e]|=1170)),w.Mw&&r?.If(i,e,o,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,0,i,e,bt.zs[w.Dl],!0)),16!==w.Bw&&s?.Ld(t,i,e,w.Bw);else if(o===ct.Xc.id)s?.If(t,i,e,d,Rt.jm[l],0,w.Ml(ct.Xc.id,l,a,c,f,u,-1),null,y,m),w.Hw&&(l===lt.Bc?this.fp[t][i][e+1]=50:l===lt.Pc?this.fp[t][i+1][e+1]=50:l===lt.Uc?this.fp[t][i+1][e]=50:l===lt.Wc&&(this.fp[t][i][e]=50)),w.Mw&&r?.If(i,e,o,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,0,i,e,bt.zs[w.Dl],!0));else if(o===ct.jc.id){const p=l+1&3;s?.If(t,i,e,d,Rt.Xm[l],Rt.Xm[p],w.Ml(ct.jc.id,l+4,a,c,f,u,-1),w.Ml(ct.jc.id,p,a,c,f,u,-1),y,m),w.dw&&(l===lt.Bc?(this.Ap[t][i][e]|=265,this.Ap[t][i][e+1]|=1170):l===lt.Pc?(this.Ap[t][i][e+1]|=1170,this.Ap[t][i+1][e]|=585):l===lt.Uc?(this.Ap[t][i+1][e]|=585,this.Ap[t][i][e]|=1170):l===lt.Wc&&(this.Ap[t][i][e]|=1170,this.Ap[t][i][e]|=585)),w.Mw&&r?.If(i,e,o,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,0,i,e,bt.zs[w.Dl],!0)),16!==w.Bw&&s?.Ld(t,i,e,w.Bw)}else if(o===ct.zc.id)s?.If(t,i,e,d,Rt.jm[l],0,w.Ml(ct.zc.id,l,a,c,f,u,-1),null,y,m),w.Hw&&(l===lt.Bc?this.fp[t][i][e+1]=50:l===lt.Pc?this.fp[t][i+1][e+1]=50:l===lt.Uc?this.fp[t][i+1][e]=50:l===lt.Wc&&(this.fp[t][i][e]=50)),w.Mw&&r?.If(i,e,o,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,0,i,e,bt.zs[w.Dl],!0));else if(o===ct.tf.id)s?._f(t,i,e,d,w.Ml(o,l,a,c,f,u,-1),null,y,m,1,1,0),w.Mw&&r?._f(i,e,w.width,w.length,l,w.kw),-1!==w.Dl&&n.St(new Tt(h,t,2,i,e,bt.zs[w.Dl],!0));else if(o===ct.Zc.id)s?.Rd(t,i,e,d,0,0,y,w.Ml(ct.Zc.id,lt.Bc,a,c,f,u,-1),m,512*l,Rt.Xm[l]),-1!==w.Dl&&n.St(new Tt(h,t,1,i,e,bt.zs[w.Dl],!0));else if(o===ct.qc.id){let r=16;if(s){const n=s.Wd(t,i,e);n>0&&(r=Et.get(n>>14&32767).Bw)}s?.Rd(t,i,e,d,Rt.zm[l]*r,Rt.Zm[l]*r,y,w.Ml(ct.Zc.id,lt.Bc,a,c,f,u,-1),m,512*l,Rt.Xm[l]),-1!==w.Dl&&n.St(new Tt(h,t,1,i,e,bt.zs[w.Dl],!0))}else o===ct.Jc.id?(s?.Rd(t,i,e,d,0,0,y,w.Ml(ct.Zc.id,lt.Bc,a,c,f,u,-1),m,l,256),-1!==w.Dl&&n.St(new Tt(h,t,1,i,e,bt.zs[w.Dl],!0))):o===ct.$c.id?(s?.Rd(t,i,e,d,0,0,y,w.Ml(ct.Zc.id,lt.Bc,a,c,f,u,-1),m,l,512),-1!==w.Dl&&n.St(new Tt(h,t,1,i,e,bt.zs[w.Dl],!0))):o===ct.Qc.id&&(s?.Rd(t,i,e,d,0,0,y,w.Ml(ct.Zc.id,lt.Bc,a,c,f,u,-1),m,l,768),-1!==w.Dl&&n.St(new Tt(h,t,1,i,e,bt.zs[w.Dl],!0)))};gp=(t,i,e)=>8&this.hp[t][i][e]?0:t<=0||!(2&this.hp[1][i][e])?t:t-1}class vt extends w{}class Lt extends vt{x=0;z=0;Ta=0;Tp=!1;size=1;bp=-1;Op=-1;Rp=-1;vp=-1;Lp=-1;Sp=-1;xp=-1;Mp=null;kp=100;Dp=0;Np=0;Fp=0;Bp=0;Pp=-1e3;Up=0;Wp=0;Gp=-1;Yp=0;Hp=0;Vp=-1;Kp=0;Xp=0;jp=-1;zp=0;Zp=0;qp=0;Jp=0;$p=-1;Qp=0;tA=0;iA=0;eA=0;sA=0;nA=0;rA=0;hA=0;oA=0;lA=0;aA=0;Wi=0;height=0;cA=0;pathLength=0;fA=new Int32Array(10);uA=new Int32Array(10);dA=new v(10,!1);wA=0;yA=-1;mA=-1;pA=-1;AA=-1;move(t,i,e){if(-1!==this.jp&&bt.zs[this.jp].priority<=1&&(this.jp=-1),!t){const t=i-this.fA[0],s=e-this.uA[0];if(t>=-8&&t<=8&&s>=-8&&s<=8){this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.fA[t]=this.fA[t-1],this.uA[t]=this.uA[t-1],this.dA[t]=this.dA[t-1];return this.fA[0]=i,this.uA[0]=e,void(this.dA[0]=!1)}}this.pathLength=0,this.wA=0,this.fA[0]=i,this.uA[0]=e,this.x=128*this.fA[0]+64*this.size,this.z=128*this.uA[0]+64*this.size}step(t,i){let e=this.fA[0],s=this.uA[0];0===i?(e--,s++):1===i?s++:2===i?(e++,s++):3===i?e--:4===i?e++:5===i?(e--,s--):6===i?s--:7===i&&(e++,s--),-1!==this.jp&&bt.zs[this.jp].priority<=1&&(this.jp=-1),this.pathLength<9&&this.pathLength++;for(let t=this.pathLength;t>0;t--)this.fA[t]=this.fA[t-1],this.uA[t]=this.uA[t-1],this.dA[t]=this.dA[t-1];this.fA[0]=e,this.uA[0]=s,this.dA[0]=t}}class St extends It{static count=0;static zs=[];static Dh=new q(30);static Zs=t=>{const i=new O(t.read('spotanim.dat'));this.count=i.Zt;for(let t=0;t=40&&t<50?this.Sw[t-40]=i.Zt:t>=50&&t<60?this.xw[t-50]=i.Zt:console.log('Error unrecognised spotanim config code: ',t)}Ml(){let t=St.Dh?.get(BigInt(this.id));if(t)return t;t=j.model(this.model);for(let i=0;i<6;i++)0!==this.Sw[0]&&t.Qr(this.Sw[i],this.xw[i]);return St.Dh?.put(BigInt(this.id),t),t}}class xt extends It{static count=0;static zs=[];static Zs=t=>{const i=new O(t.read('idk.dat'));this.count=i.Zt;for(let t=0;t=40&&t<50?this.Sw[t-40]=i.Zt:t>=50&&t<60?this.xw[t-50]=i.Zt:t>=60&&t<70?this.IA[t-60]=i.Zt:console.log('Error unrecognised config code: ',t)}Ml(){if(!this.Rw)return null;const t=new v(this.Rw.length,null);for(let i=0;i{this.EA=i,this.Xs=new O(t.read('obj.dat'));const e=new O(t.read('obj.idx'));this.count=e.Zt,this.gw=new Int32Array(this.count);let s=2;for(let t=0;t{if(!this.cache||!this.gw||!this.Xs)throw new Error('ObjType not loaded!!!');for(let i=0;i<10;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Iw=(this.Iw+1)%10;const i=this.cache[this.Iw];return this.Xs.Vt=this.gw[t],i.id=t,i.reset(),i.ow(this.Xs),-1!==i.bA&&i.OA(),!this.EA&&i.members&&(i.name='Members Object',i.Lw="Login to a members' server to use this object.",i.Ow=null,i.RA=null),i};static Xi=()=>{this.Dh=null,this.TA=null,this.gw=null,this.cache=null,this.Xs=null};static vA=(t,i)=>{if(Mt.TA){let e=Mt.TA.get(BigInt(t));if(e&&e._i!==i&&-1!==e._i&&(e.nt(),e=null),e)return e}let e=Mt.get(t);if(e.LA||(i=-1),e.LA&&e.SA&&i>1){let t=-1;for(let s=0;s<10;s++)i>=e.SA[s]&&0!==e.SA[s]&&(t=e.LA[s]);-1!==t&&(e=Mt.get(t))}const s=new J(32,32),n=N.ki,r=N.Di,h=N.Mi,o=m.lt,l=m.ct,a=m.ft,c=m.left,f=m.right,u=m.top,d=m.bottom;N.Ni=!1,m.bind(s.lt,32,32),m.fillRect(0,0,32,32,Ot.gy),N.ji();const w=e.xA(1),y=N.sin[e.MA]*e.kA>>16,p=N.cos[e.MA]*e.kA>>16;w.nh(0,e.DA,e.NA,e.MA,e.FA,y+(w.vr/2|0)+e.BA,p+e.BA);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.lt[t+32*i]&&(t>0&&s.lt[t+32*i-1]>1||i>0&&s.lt[t+32*(i-1)]>1||t<31&&s.lt[t+32*i+1]>1||i<31&&s.lt[t+32*(i+1)]>1)&&(s.lt[t+32*i]=1);for(let t=31;t>=0;t--)for(let i=31;i>=0;i--)0===s.lt[t+32*i]&&t>0&&i>0&&s.lt[t+32*(i-1)-1]>0&&(s.lt[t+32*i]=3153952);if(-1!==e.bA){const t=this.vA(e.PA,10),i=t.Ai,s=t._i;t.Ai=32,t._i=32,t.bi(5,5,22,22),t.Ai=i,t._i=s}return Mt.TA?.put(BigInt(t),s),m.bind(o,l,a),m.yt(c,u,f,d),N.ki=n,N.Di=r,N.Mi=h,N.Ni=!0,e.UA?s.Ai=33:s.Ai=32,s._i=i,s};model=0;name=null;Lw=null;Sw=null;xw=null;kA=2e3;MA=0;DA=0;NA=0;FA=0;BA=0;WA=!1;GA=-1;UA=!1;YA=1;members=!1;Ow=null;RA=null;HA=-1;VA=-1;KA=0;XA=-1;jA=-1;zA=0;ZA=-1;qA=-1;JA=-1;$A=-1;QA=-1;t_=-1;LA=null;SA=null;PA=-1;bA=-1;decode(t,i){if(1===t)this.model=i.Zt;else if(2===t)this.name=i.ei;else if(3===t)this.Lw=i.ei;else if(4===t)this.kA=i.Zt;else if(5===t)this.MA=i.Zt;else if(6===t)this.DA=i.Zt;else if(7===t)this.FA=i.qt,this.FA>32767&&(this.FA-=65536);else if(8===t)this.BA=i.qt,this.BA>32767&&(this.BA-=65536);else if(9===t)this.WA=!0;else if(10===t)this.GA=i.Zt;else if(11===t)this.UA=!0;else if(12===t)this.YA=i.$t;else if(16===t)this.members=!0;else if(23===t)this.HA=i.Zt,this.KA=i.zt;else if(24===t)this.VA=i.Zt;else if(25===t)this.XA=i.Zt,this.zA=i.zt;else if(26===t)this.jA=i.Zt;else if(t>=30&&t<35)this.Ow||(this.Ow=new v(5,null)),this.Ow[t-30]=i.ei,'hidden'===this.Ow[t-30]?.toLowerCase()&&(this.Ow[t-30]=null);else if(t>=35&&t<40)this.RA||(this.RA=new v(5,null)),this.RA[t-35]=i.ei;else if(40===t){const t=i.jt;this.Sw=new Uint16Array(t),this.xw=new Uint16Array(t);for(let e=0;e=100&&t<110&&(this.LA&&this.SA||(this.LA=new Uint16Array(10),this.SA=new Uint16Array(10)),this.LA[t-100]=i.Zt,this.SA[t-100]=i.Zt)}i_(t){let i=this.HA;if(1===t&&(i=this.XA),-1===i)return null;let e=this.VA,s=this.ZA;1===t&&(e=this.jA,s=this.qA);let n=j.model(i);if(-1!==e){const t=j.model(e);if(-1===s){const i=[n,t];n=j.Wr(i,2)}else{const i=[n,t,j.model(s)];n=j.Wr(i,3)}}if(0===t&&0!==this.KA&&n.translate(this.KA,0,0),1===t&&0!==this.zA&&n.translate(this.zA,0,0),this.Sw&&this.xw)for(let t=0;t1){let i=-1;for(let e=0;e<10;e++)t>=this.SA[e]&&0!==this.SA[e]&&(i=this.LA[e]);if(-1!==i)return Mt.get(i).xA(1)}if(Mt.Dh){const t=Mt.Dh.get(BigInt(this.id));if(t)return t}const i=j.model(this.model);if(this.Sw&&this.xw)for(let t=0;t=this.I_&&(this.b_=null),t>=this.g_&&t=kt.d_[i].length)&&(e=0),this.p_[i]=e}this.bp=t.Zt,65535===this.bp&&(this.bp=-1),this.Op=t.Zt,65535===this.Op&&(this.Op=-1),this.Rp=t.Zt,65535===this.Rp&&(this.Rp=-1),this.vp=t.Zt,65535===this.vp&&(this.vp=-1),this.Lp=t.Zt,65535===this.Lp&&(this.Lp=-1),this.Sp=t.Zt,65535===this.Sp&&(this.Sp=-1),this.xp=t.Zt,65535===this.xp&&(this.xp=-1),this.name=$.xh($.Oh(t.Qt)),this.A_=t.jt,this.visible=!0,this.__=0n;for(let t=0;t<12;t++)this.__<<=0x4n,this.m_[t]>=256&&(this.__+=BigInt(this.m_[t])-256n);this.m_[0]>=256&&(this.__+=BigInt(this.m_[0])-256n>>4n),this.m_[1]>=256&&(this.__+=BigInt(this.m_[1])-256n>>8n);for(let t=0;t<5;t++)this.__<<=0x3n,this.__+=BigInt(this.p_[t]);this.__<<=0x1n,this.__+=BigInt(this.w_)}CA(){if(!this.visible)return null;const t=new v(12,null);let i=0;for(let e=0;e<12;e++){const s=this.m_[e];if(s>=256&&s<512&&(t[i++]=xt.zs[s-256].CA()),s>=512){const e=Mt.get(s-512).CA(this.w_);e&&(t[i++]=e)}}const e=j.Wr(t,i);for(let t=0;t<5;t++)0!==this.p_[t]&&(e.Qr(kt.d_[t][0],kt.d_[t][this.p_[t]]),1===t&&e.Qr(kt.u_[0],kt.u_[this.p_[t]]));return e}O_(){let t=this.__,i=-1,e=-1,s=-1,n=-1;if(this.jp>=0&&0===this.qp){const r=bt.zs[this.jp];if(r.frames&&(i=r.frames[this.zp]),this.Vp>=0&&this.Vp!==this.bp){const t=bt.zs[this.Vp].frames;t&&(e=t[this.Kp])}r.uy>=0&&(s=r.uy,t+=BigInt(s-this.m_[5])<<8n),r.wy>=0&&(n=r.wy,t+=BigInt(n-this.m_[3])<<16n)}else if(this.Vp>=0){const t=bt.zs[this.Vp].frames;t&&(i=t[this.Kp])}let r=kt.Dh?.get(t);if(!r){const i=new v(12,null);let e=0;for(let t=0;t<12;t++){let r=this.m_[t];if(n>=0&&3===t&&(r=n),s>=0&&5===t&&(r=s),r>=256&&r<512){const t=xt.zs[r-256].Ml();t&&(i[e++]=t)}if(r>=512){const t=Mt.get(r-512).i_(this.w_);t&&(i[e++]=t)}}r=j.Wr(i,e);for(let t=0;t<5;t++)0!==this.p_[t]&&(r.Qr(kt.d_[t][0],kt.d_[t][this.p_[t]]),1===t&&r.Qr(kt.u_[0],kt.u_[this.p_[t]]));r.jr(),r.ih(64,850,-30,-50,-30,!0),kt.Dh?.put(t,r)}if(this.Ri)return r;const h=j.Nr(r,!0);return-1!==i&&-1!==e?h.zr(i,e,bt.zs[this.jp].oy):-1!==i&&h.qr(i),h.Ur(),h.Br=null,h.Fr=null,h}}class Dt extends It{static count=0;static cache=null;static Xs=null;static gw=null;static Iw=0;static Dh=new q(30);static Zs=t=>{this.Xs=new O(t.read('npc.dat'));const i=new O(t.read('npc.idx'));this.count=i.Zt,this.gw=new Int32Array(this.count);let e=2;for(let t=0;t{if(!this.cache||!this.gw||!this.Xs)throw new Error('NpcType not loaded!!!');for(let i=0;i<20;i++){const e=this.cache[i];if(e&&e.id===t)return e}this.Iw=(this.Iw+1)%20;const i=this.cache[this.Iw]=new Dt(t);return this.Xs.Vt=this.gw[t],i.ow(this.Xs),i};static Xi=()=>{this.Dh=null,this.gw=null,this.cache=null,this.Xs=null};name=null;Lw=null;size=1;Rw=null;IA=null;Fw=!1;R_=-1;v_=-1;L_=-1;S_=-1;x_=-1;Sw=null;xw=null;Ow=null;Vw=-1;Kw=-1;Xw=-1;M_=!0;k_=-1;_A=128;gA=128;decode(t,i){if(1===t){const t=i.jt;this.Rw=new Uint16Array(t);for(let e=0;e=30&&t<40)this.Ow||(this.Ow=new v(5,null)),this.Ow[t-30]=i.ei,'hidden'===this.Ow[t-30]?.toLowerCase()&&(this.Ow[t-30]=null);else if(40===t){const t=i.jt;this.Sw=new Uint16Array(t),this.xw=new Uint16Array(t);for(let e=0;e{const i=new O(t.read('varp.dat'));this.count=i.Zt;for(let t=0;t{if('complete'===t.iceGatheringState){let i;self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(t.localDescription)):console.log(JSON.stringify(t.localDescription));try{for(;null===(i=prompt('Offer copied to clipboard, paste answer here')););t.setRemoteDescription(new RTCSessionDescription(JSON.parse(i)))}catch(t){console.error(t)}}},i.onopen=()=>{i.send(JSON.stringify({type:'id',id:e})),console.log('Connected to peer!')},i.onerror=t=>{console.error(t)},i.onmessage=t=>{const i=JSON.parse(t.data);i.data&&(i.data=Object.values(i.data)),this.Y_&&this.Y_.postMessage(i)}}postMessage(t){const i=this.G_.get(t.data.id),e=t.data;e.data&&(e.data=Array.from(t.data.data)),i&&'open'===i.readyState&&i.send(JSON.stringify(e))}}class Pt{pc;K_=void 0;H_;constructor(t){this.pc=new RTCPeerConnection({iceServers:[{urls:'stun:stun.l.google.com:19302'}]}),this.pc.ondatachannel=i=>{this.K_=i.channel,this.K_.onopen=()=>{console.log('Connected to host!')},this.K_.onerror=t=>{console.error(t)},this.K_.onmessage=i=>{if(!this.H_){const t=JSON.parse(i.data);if('id'===t.type)return void(this.H_=t.id)}t.onmessage&&t.onmessage(i)}},this.pc.onicegatheringstatechange=async()=>{'complete'===this.pc.iceGatheringState&&(self.isSecureContext?await navigator.clipboard.writeText(JSON.stringify(this.pc.localDescription)):console.log(JSON.stringify(this.pc.localDescription)))}}async X_(t){await this.pc.setRemoteDescription(new RTCSessionDescription(JSON.parse(t))),await this.pc.setLocalDescription(await this.pc.createAnswer())}}class Ut extends U{static j_=225;static z_=10;static portOffset=0;static members=!0;static Ri=!1;static Z_='';static q_='';static J_=!1;static Q_=2;static tg=!1;static ig='https://raw.githubusercontent.com/2004scape/Server/main';static exponent=58778699976184461502525193738213253649000149147835990136706041084440742975821n;static eg=7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789n;static sg=0;static ng=0;static rg=0;static hg=0;static og=0;static lg=0;static ag=0;static cg=0;static fg=0;static ug=0;static dg=0;static wg=0;static yg=0;static mg=0;static pg=0;static Ag=()=>{gt.Ri=!1,N.Ri=!1,Ut.Ri=!1,Rt.Ri=!1};static _g=()=>{gt.Ri=!0,N.Ri=!0,Ut.Ri=!0,Rt.Ri=!0};gg=2048;Ig=2047;Cg=!1;Eg=!1;Tg=!1;bg=!1;db=null;Og=0;Rg=[];stream=null;in=O.Xt(1);vg=O.Xt(1);Lg=O.Xt(1);Sg=0n;xg=0;Mg=0;kg=0;Dg=null;Ng=0;packetSize=0;Fg=0;Bg=0;Pg=0;Ug=null;Wg=!0;Gg=0;Yg=0;Hg=null;Vg=null;Kg=null;Xg=null;jg=null;zg=null;Zg=null;qg=null;Jg=null;$g=null;Qg=null;tI='';iI='';username='';password='';eI=null;sI=null;nI=null;rI=null;hI=[];oI=!1;lI=null;aI=null;cI=null;fI=null;uI=null;dI=null;wI=null;yI=null;mI=null;pI=null;AI=new Int32Array(256);_I=0;gI=0;II=0;CI=null;EI=null;TI=null;bI=null;OI=null;RI=null;vI=null;LI=null;SI=null;xI=null;MI=null;kI=null;DI=null;NI=null;FI=null;BI=null;UI=null;WI=null;GI=null;YI=null;HI=null;VI=new Int32Array(33);KI=new Int32Array(33);XI=new Int32Array(151);jI=new Int32Array(151);zI=null;ZI=null;qI=null;JI=null;$I=null;QI=null;tC=new v(13,null);iC=null;eC=null;sC=new v(50,null);nC=new v(50,null);rC=new v(20,null);hC=new v(20,null);oC=null;lC=new v(8,null);aC=null;cC=null;fC=null;uC=null;dC=null;wC=null;yC=null;mC=null;pC=null;AC=null;_C=null;gC=null;IC=null;CC=null;EC=null;TC=null;bC=null;OC=null;RC=new v(1e3,null);vC=!1;LC=!1;SC=!1;xC=!1;MC=-1;kC=0;DC=0;NC=0;FC=0;BC=0;PC=0;UC=!1;WC=0;GC=0;YC=0;HC=0;VC=0;KC=0;XC=[];jC=-1;zC=-1;ZC=new Q;qC=78;JC=0;$C=0;QC=[];tE=0;iE=0;eE=0;sE=0;nE=0;rE=0;hE=0;oE=0;lE=[];aE=[];cE=[];fE=[];uE=null;dE=-1;wE=3;yE=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];mE=0;pE=0;AE=0;_E=!1;gE=0;IE=!1;CE='';EE='';TE=0;bE='';OE=!1;RE=-1;vE=new v(100,null);LE=new v(100,null);messageType=new Int32Array(100);SE=new Int32Array(100);xE=0;ME=0;kE=0;DE='';NE=0;FE=0;BE=0;PE=0;UE=0;WE=0;GE=0;YE=0;HE=0;VE=!1;KE=0;XE=0;jE=0;zE=0;ZE=null;qE=0;JE=0;$E=0;QE=0;tT=!1;iT=[];eT=[];sT=0;nT=0;rT=0;hT=null;oT=0;lT=new Int32Array(500);aT=new Int32Array(500);cT=new Int32Array(500);fT=new Int32Array(500);uT=0;dT=0;wT=0;yT='';mT=!1;pT=-1;AT=0;_T=0;gT=0;IT=0;CT=0;ET=new Int32Array(1e3);TT=new Int32Array(1e3);bT=null;OT=0;RT=0;vT=0;LT=0;ST=0;xT=!1;MT=0;kT=0;DT=0;NT=0;FT=2;BT=2;PT=1;UT=new Int32Array(5);WT=new v(5,!1);GT=new Int32Array(5);YT=new Int32Array(5);HT=new Int32Array(5);VT=0;KT=0;XT=0;jT=0;zT=0;ZT=0;qT=0;JT=0;$T=0;QT=1;tb=2;ib=-1;Xn=0;zn=0;eb=0;sb=0;nb=0;rb=0;hb=null;ob=null;lb=null;ab=0;cb=0;fb=new Int8Array(16384);ub=new v(ut.wf,null);wb=0;yb=0;mb=128;pb=0;Ab=0;_b=0;gb=0;Ib=0;rp=null;hp=null;Cb=new k(ut.yf,ut.yf);Eb=0;Tb=0;bb=0;Ob=0;Rb=0;vb=0;Lb=0;Sb=0;xb=0;Mb=0;kb=0;Db=0;Nb=new v(this.gg,null);Fb=0;Bb=new Int32Array(this.gg);Pb=0;Ub=0;Wb=new Int32Array(this.gg);Gb=new Int32Array(1e3);Yb=new v(this.gg,null);Hb=new v(8192,null);Vb=0;Kb=new Int32Array(8192);Xb=new b;jb=new b;zb=new b;ud=new b;Zb=new S(ut.wf,ut.yf,ut.yf,null);qb=new b;Jb=new Int32Array(4e3);$b=new Int32Array(4e3);Qb=new Int32Array(ut.yf*ut.yf);tO=new Int32Array(ut.yf*ut.yf);iO=0;eO=null;sO=0;nO=0;rO=-1;hO=0;oO=0;lO=0;aO=0;cO=!1;fO=!0;uO=!1;dO=new Int32Array(7);wO=new Int32Array(5);yO=0;mO=0;static pO=50;AO=new Int32Array(Ut.pO);_O=new Int32Array(Ut.pO);gO=new Int32Array(Ut.pO);IO=new Int32Array(Ut.pO);CO=new Int32Array(Ut.pO);EO=new Int32Array(Ut.pO);TO=new Int32Array(Ut.pO);bO=new v(Ut.pO,null);OO=new v(100,null);RO=new BigInt64Array(100);vO=new Int32Array(100);LO=null;SO=0;xO=!0;MO=new Int32Array(50);kO=new Int32Array(50);DO=new Int32Array(50);NO=192;FO=-1;BO=-1;PO=0;UO=0;WO=0;GO=!0;YO=null;HO=0;VO=0;KO=192;Y_=void 0;XO=!1;host=null;jO=null;zO=new v(16,null);ZO=0;qO=!1;Xi=()=>{try{this.stream&&this.stream.close()}catch(t){}var t;this.jO&&'998'===Ut.getParameter('world')&&this.jO.K_?.send(JSON.stringify({type:'close',id:this.jO.H_})),this.stream=null,t=!1,window._tinyMidiStop&&window._tinyMidiStop(t),this.vg=null,this.Lg=null,this.in=null,this.lb=null,this.hb=null,this.ob=null,this.rp=null,this.hp=null,this.bT=null,this.ub=null,this.Qb=null,this.tO=null,this.Jb=null,this.$b=null,this.fb=null,this.EI=null,this.TI=null,this.bI=null,this.OI=null,this.RI=null,this.vI=null,this.LI=null,this.SI=null,this.xI=null,this.MI=null,this.kI=null,this.DI=null,this.NI=null,this.FI=null,this.BI=null,this.UI=null,this.WI=null,this.zI=null,this.qI=null,this.ZI=null,this.JI=null,this.$I=null,this.QI=null,this.tC=null,this.yC=null,this.mC=null,this.pC=null,this.AC=null,this._C=null,this.gC=null,this.IC=null,this.CC=null,this.EC=null,this.TC=null,this.eC=null,this.rC=null,this.hC=null,this.lC=null,this.aC=null,this.cC=null,this.fC=null,this.uC=null,this.sC=null,this.nC=null,this.Cb=null,this.Nb=null,this.Bb=null,this.Wb=null,this.Yb=null,this.Gb=null,this.Hb=null,this.Kb=null,this.Zb=null,this.qb=null,this.ud=null,this.Xb=null,this.jb=null,this.zb=null,this.cT=null,this.fT=null,this.lT=null,this.aT=null,this.XC=null,this.iT=null,this.ET=null,this.TT=null,this.RC=null,this.iC=null,this.OO=null,this.RO=null,this.vO=null,this.Xg=null,this.jg=null,this.Hg=null,this.Vg=null,this.Kg=null,this.zg=null,this.Zg=null,this.qg=null,this.Jg=null,this.JO(),Et.Xi(),Dt.Xi(),Mt.Xi(),Ct.zs=null,xt.zs=null,Q.zs=null,bt.zs=null,St.zs=null,St.Dh=null,Nt.zs=null,this.xe=null,kt.Dh=null,N.Xi(),gt.Xi(),j.Xi(),H.zs=[],V.zs=[]};xs(){return this.Gg}Ls(){return this.OE}Ss(){return this.IE}vs(){return this.zC}Rs(){return this.MC}JO=()=>{this.oI=!1,this.CI&&(clearInterval(this.CI),this.CI=null),this.$g=null,this.Qg=null,this.hI=[],this.wI=null,this.yI=null,this.mI=null,this.pI=null,this.fI=null,this.cI=null,this.uI=null,this.dI=null,this.lI=null,this.aI=null};$O=()=>{'999'===Ut.getParameter('world')?(this.Y_=new Worker('worker.js',{type:'module'}),this.Y_.onmessage=this.onmessage,this.host=new Bt(this.Y_)):'998'===Ut.getParameter('world')&&(this.Y_={onmessage:t=>{this.stream.QO.onmessage(t)},postMessage:t=>{this.jO&&this.jO.K_&&'open'===this.jO.K_.readyState&&this.jO.K_.send(JSON.stringify(t))},onerror:null,onmessageerror:null,terminate:()=>{throw new Error},addEventListener:()=>{throw new Error},removeEventListener:()=>{throw new Error},dispatchEvent:()=>{throw new Error}},this.jO=new Pt(this.Y_))};onmessage=t=>{switch(t.data.type){case'ready':return void(this.XO=!0);case'save':return Ft(t.data.value,t.data.path.split('/').pop().split('\\').pop()),void URL.revokeObjectURL(t.data.value);case'close':return void this.Y_?.postMessage({type:'close',id:t.data.id})}this.host?.H_===t.data.id?this.stream.QO.onmessage(t.data):this.host?.postMessage(t)};tR=async()=>{if(999==+Ut.getParameter('world'))this.host&&await this.host.V_();else if(998==+Ut.getParameter('world')&&this.jO){if(this.jO.K_)return void console.log('You are already connected.');const t=prompt('Paste offer here, answer will be copied to clipboard');if(t)try{await this.jO.X_(t)}catch(t){console.error(t)}}};iR=async(t,i,e,s)=>{let n=5,r=await(this.db?.Ds(t));if(r&&O.Ht(r)!==e&&(r=void 0),r)return new G(r);for(;!r;){await this.fs(s,`Requesting ${i}`);try{r=+Ut.getParameter('world')<998?await T(`${Ut.q_}/${t}${e}`):await T(`${Ut.q_}/${t}`)}catch(t){r=void 0;for(let t=n;t>0;t--)await this.fs(s,`Error loading - Will retry in ${t} secs.`),await E(1e3);n*=2,n>60&&(n=60)}}return await(this.db?.Ns(t,r)),new G(r)};eR=async(t,e,s,n)=>{let r=await(this.db?.Ds(t+'.mid'));if(r&&12345678!==e&&O.Ht(r)!==e&&(r=void 0),!r)try{r=+Ut.getParameter('world')<998?await T(`${Ut.q_}/${t}_${e}.mid`):await T(`${Ut.q_}/songs/${t}.mid`),s!==r.length&&(r=r.slice(0,s))}catch(t){}if(!r)return;await(this.db?.Ns(t+'.mid',r));const h=new O(Uint8Array.from(r)).$t;!function(t,i,e){window._tinyMidiPlay&&window._tinyMidiPlay(t,i/256,e)}(i.read(h,r,s,4),this.KO,n)};sR=()=>{if(A.fillStyle='black',A.fillRect(0,0,this.width,this.height),this.ds(1),this.Tg){this.oI=!1,A.font='bold 16px helvetica, sans-serif',A.textAlign='left',A.fillStyle='yellow';let t=35;A.fillText('Sorry, an error has occured whilst loading RuneScape',30,t),t+=50,A.fillStyle='white',A.fillText('To fix this try the following (in order):',30,t),t+=50,A.font='bold 12px helvetica, sans-serif',A.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,A.fillText('2: Try clearing your web-browsers cache from tools->internet options',30,t),t+=30,A.fillText('3: Try using a different game-world',30,t),t+=30,A.fillText('4: Try rebooting your computer',30,t),t+=30,A.fillText('5: Try selecting a different version of Java from the play-game menu',30,t)}if(this.bg&&(this.oI=!1,A.font='bold 20px helvetica, sans-serif',A.textAlign='left',A.fillStyle='white',A.fillText('Error - unable to load game!',50,50),A.fillText('To play RuneScape make sure you play from',50,100),A.fillText('https://2004scape.org',50,150)),this.Eg){this.oI=!1,A.font='bold 13px helvetica, sans-serif',A.textAlign='left',A.fillStyle='yellow';let t=35;A.fillText('Error a copy of RuneScape already appears to be loaded',30,t),t+=50,A.fillStyle='white',A.fillText('To fix this try the following (in order):',30,t),t+=50,A.font='bold 12px helvetica, sans-serif',A.fillText('1: Try closing ALL open web-browser windows, and reloading',30,t),t+=30,A.fillText('2: Try rebooting your computer, and reloading',30,t)}};nR=t=>{if(!t.ll)return!1;for(let i=0;i=s)return!1}else if(3===t.ll[i]){if(e<=s)return!1}else if(4===t.ll[i]){if(e===s)return!1}else if(e!==s)return!1}return!0};hR=(t,i,e,s,n)=>{this.dC?.draw(t,i),this.wC?.draw(t,i+n-16),m.fillRect(t,i+16,16,n-32,Ot.My);let r=(n-32)*n/s|0;r<8&&(r=8);const h=(n-r-32)*e/(s-n)|0;m.fillRect(t,i+h+16,16,r,Ot.ky),m.It(t,i+h+16,Ot.Dy,r),m.It(t+1,i+h+16,Ot.Dy,r),m.gt(t,i+h+16,Ot.Dy,16),m.gt(t,i+h+17,Ot.Dy,16),m.It(t+15,i+h+16,Ot.Ny,r),m.It(t+14,i+h+17,Ot.Ny,r-1),m.gt(t,i+h+r+15,Ot.Ny,16),m.gt(t+1,i+h+r+14,Ot.Ny,15)};oR=(t,i)=>{let e=!1;const s=Q.zs[t];if(!s.cl)return!1;for(let t=0;ts.delay[n.Yl];)n.Hl-=s.delay[n.Yl]+1,n.Yl++,n.Yl>=s.ny&&(n.Yl-=s.sy,(n.Yl<0||n.Yl>=s.ny)&&(n.Yl=0)),e=!0}}}return e};lR=(t,i,e,s,n=!1)=>{if(0!==t.type||!t.cl||t.hide&&this.NE!==t.id&&this.FE!==t.id&&this.BE!==t.id)return;const r=m.left,h=m.top,o=m.right,l=m.bottom;m.yt(i,e,i+t.width,e+t.height);const a=t.cl.length;for(let r=0;r0&&this.aR(l),l.type===Q.Nh)l.Gl>l.scroll-l.height&&(l.Gl=l.scroll-l.height),l.Gl<0&&(l.Gl=0),this.lR(l,h,o,l.Gl,n),l.scroll>l.height&&this.hR(h+l.width,o,l.Gl,l.scroll,l.height);else if(l.type===Q.Bh){let t=0;for(let i=0;i0){let i=0,e=0;const r=l.dl[t]-1;if(s>=-32&&s<=512&&n>=-32&&n<=334||0!==this.WE&&this.UE===t){const h=Mt.vA(r,l.wl[t]);if(0!==this.WE&&this.UE===t&&this.PE===l.id?(i=this.Ve-this.GE,e=this.Ke-this.YE,i<5&&i>-5&&(i=0),e<5&&e>-5&&(e=0),this.HE<5&&(i=0,e=0),h.ph(128,s+i,n+e)):0!==this.qE&&this.JE===t&&this.$E===l.id?h.ph(128,s,n):h.draw(s,n),33===h.Ai||1!==l.wl[t]){const r=l.wl[t];this.eI?.cR(s+i+1,n+10+e,this.fR(r),Ot.gy),this.eI?.cR(s+i,n+9+e,this.fR(r),Ot.my)}}}else if(l.Il&&t<20){const i=l.Il[t];i?.draw(s,n)}t++}}else if(l.type===Q.Ph)l.fill?m.fillRect(h,o,l.width,l.height,l.Rl):m._t(h,o,l.width,l.height,l.Rl);else if(l.type===Q.Uh){const t=l.font;let i=l.Rl,e=l.text;if(this.BE!==l.id&&this.FE!==l.id&&this.NE!==l.id||0===l.Ll||(i=l.Ll),this.nR(l)&&(i=l.vl,l.Ol&&l.Ol.length>0&&(e=l.Ol)),l.rl===Q.zh&&this.tT&&(e='Please wait...',i=l.Rl),!t||!e)continue;for(let s=o+t.height;e.length>0;s+=t.height){if(-1!==e.indexOf('%')){for(;;){const t=e.indexOf('%1');if(-1===t)break;e=e.substring(0,t)+this.uR(this.rR(l,0))+e.substring(t+2)}for(;;){const t=e.indexOf('%2');if(-1===t)break;e=e.substring(0,t)+this.uR(this.rR(l,1))+e.substring(t+2)}for(;;){const t=e.indexOf('%3');if(-1===t)break;e=e.substring(0,t)+this.uR(this.rR(l,2))+e.substring(t+2)}for(;;){const t=e.indexOf('%4');if(-1===t)break;e=e.substring(0,t)+this.uR(this.rR(l,3))+e.substring(t+2)}for(;;){const t=e.indexOf('%5');if(-1===t)break;e=e.substring(0,t)+this.uR(this.rR(l,4))+e.substring(t+2)}}const n=e.indexOf('\\n');let r;-1!==n?(r=e.substring(0,n),e=e.substring(n+2)):(r=e,e=''),l.Tl?t.dR(h+(l.width/2|0),s,r,i,l.bl):t.wR(h,s,r,i,l.bl)}}else if(l.type===Q.Wh){let t;t=this.nR(l)?l.xl:l.Sl,t?.draw(h,o)}else if(l.type===Q.Gh){const t=N.ki,i=N.Di;N.ki=h+(l.width/2|0),N.Di=o+(l.height/2|0);const e=N.sin[l.Fl]*l.zoom>>16,s=N.cos[l.Fl]*l.zoom>>16,n=this.nR(l);let r;r=n?l.Nl:l.Dl;let a=null;if(-1===r)a=l.Ml(-1,-1,n);else{const t=bt.zs[r];t.frames&&t.hy&&(a=l.Ml(t.frames[l.Yl],t.hy[l.Yl],n))}a&&a.nh(0,l.Bl,0,l.Fl,0,e,s),N.ki=t,N.Di=i}else if(l.type===Q.Yh){const t=l.font;if(!t||!l.dl||!l.wl)continue;let i=0;for(let e=0;e0){const n=Mt.get(l.dl[i]-1);let r=n.name;if((n.UA||1!==l.wl[i])&&(r=r+' x'+this.yR(l.wl[i])),!r)continue;const a=h+s*(l.pl+115),c=o+e*(l.Al+12);l.Tl?t.dR(a+(l.width/2|0),c,r,l.Rl,l.bl):t.wR(a,c,r,l.Rl,l.bl)}i++}}}m.yt(r,h,o,l)};aR=t=>{let i=t.hl;if(i>=Q.Zh&&i<=Q.qh)i--,i>=this.yO?(t.text='',t.rl=0):(t.text=this.OO[i],t.rl=1);else if(i>=Q.Jh&&i<=Q.$h)i-=Q.Jh,i>=this.yO?(t.text='',t.rl=0):(0===this.vO[i]?t.text='@red@Offline':this.vO[i]===Ut.z_?t.text='@gre@World-'+(this.vO[i]-9):t.text='@yel@World-'+(this.vO[i]-9),t.rl=1);else if(i===Q.eo)t.scroll=15*this.yO+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i>=Q.ko&&i<=Q.Do)i-=Q.ko,i>=this.$C?(t.text='',t.rl=0):(t.text=$.xh($.Oh(this.QC[i])),t.rl=1);else if(i===Q.Bo)t.scroll=15*this.$C+20,t.scroll<=t.height&&(t.scroll=t.height+1);else if(i===Q.Mo){if(t.Fl=150,t.Bl=256*Math.sin(this.Og/40)&2047,this.uO){this.uO=!1;const i=new v(7,null);let e=0;for(let t=0;t<7;t++){const s=this.dO[t];s>=0&&(i[e++]=xt.zs[s].Ml())}const s=j.Wr(i,e);for(let t=0;t<5;t++)0!==this.wO[t]&&(s.Qr(kt.d_[t][0],kt.d_[t][this.wO[t]]),1===t&&s.Qr(kt.u_[0],kt.u_[this.wO[t]]));if(this.eO){const i=bt.zs[this.eO.bp].frames;i&&(s.jr(),s.qr(i[0]),s.ih(64,850,-30,-50,-30,!0),t.model=s)}}}else if(i===Q.Lo)this.bC||(this.bC=t.Sl,this.OC=t.xl),this.fO?t.Sl=this.OC:t.Sl=this.bC;else if(i===Q.So)this.bC||(this.bC=t.Sl,this.OC=t.xl),this.fO?t.Sl=this.bC:t.Sl=this.OC;else if(i===Q.Po)t.text=this.yT,this.Og%20<10?t.text=t.text+'|':t.text=t.text+' ';else if(i===Q.Jo)this.cO?this.mT?(t.Rl=Ot.RED,t.text='Moderator option: Mute player for 48 hours: '):(t.Rl=Ot._y,t.text='Moderator option: Mute player for 48 hours: '):t.text='';else if(i===Q.$o||i===Q.sl)if(0===this.AT)t.text='';else{let i;i=0===this._T?'earlier today':1===this._T?'yesterday':this._T+' days ago',t.text='You last logged in '+i+' from: '+$.Sh(this.AT)}else if(i===Q.Qo)0===this.IT&&(t.text='0 unread messages',t.Rl=Ot.my),1===this.IT&&(t.text='1 unread message',t.Rl=Ot.GREEN),this.IT>1&&(t.text=this.IT+' unread messages',t.Rl=Ot.GREEN);else if(i===Q.tl)if(201===this.gT)t.text='';else if(200===this.gT)t.text='You have not yet set any password recovery questions.';else{let i;i=0===this.gT?'Earlier today':1===this.gT?'Yesterday':this.gT+' days ago',t.text=i+' you changed your recovery questions'}else i===Q.il?201===this.gT?t.text='':200===this.gT?t.text='We strongly recommend you do so now to secure your account.':t.text='If you do not remember making this change then cancel it immediately':i===Q.el&&(201===this.gT?t.text='':(this.gT,t.text="Do this from the 'account management' area on our front webpage"))};rR=(t,i)=>{if(!t.scripts||i>=t.scripts.length)return-2;try{const e=t.scripts[i];if(!e)return-1;let s=0,n=0;for(;;){const t=e[n++];if(0===t)return s;if(1===t)s+=this.aE[e[n++]];else if(2===t)s+=this.cE[e[n++]];else if(3===t)s+=this.lE[e[n++]];else if(4===t){const t=Q.zs[e[n++]],i=e[n++]+1;if(t.dl&&t.wl)for(let e=0;et<999999999?String(t):'*';yR=t=>{let i=String(t);for(let t=i.length-3;t>0;t-=3)i=i.substring(0,t)+','+i.substring(t);return i.length>8?i='@gre@'+i.substring(0,i.length-8)+' million @whi@('+i+')':i.length>4&&(i='@cya@'+i.substring(0,i.length-4)+'K @whi@('+i+')'),' '+i};fR=t=>t<1e5?String(t):t<1e7?(t/1e3|0)+'K':(t/1e6|0)+'M'}(new class extends Ut{Cg=!1;Eg=!1;Tg=!1;bg=!1;mR=null;pR=null;AR=null;_R=null;gR=null;IR=null;Lu=0;Su=0;xu=0;CR=0;ER=0;TR=2;model={id:parseInt(U.getParameter('model'))||0,bR:null,x:0,y:0,z:420,Ta:0};constructor(){super(!0)}load=async()=>{if(this.Cg)this.Eg=!0;else{this.Cg=!0;try{await async function(t){if(o||h)return;o=!0;const i=await r(t);h||(h=i)}(),await i.load(await(await fetch('bz2.wasm')).arrayBuffer()),this.db=new W(await W.openDatabase()),this.xe?.bind(),N.ji(),this.mR=document.getElementById('rightPanel');const t=document.getElementById('mainPanel');t&&(t.ondragover=t=>{t.preventDefault(),t.stopPropagation()},t.ondrop=async t=>{if(t.preventDefault(),t.stopPropagation(),!t.dataTransfer||!t.dataTransfer.files.length)return;const i=['main_file_cache.dat','main_file_cache.idx0','main_file_cache.idx1','main_file_cache.idx2','main_file_cache.idx3','main_file_cache.idx4'],e=[];for(let s=0;s{this.Eg||this.Tg||this.bg||(this.OR(),this.RR())};draw=async()=>{this.Eg||this.Tg||this.bg?this.sR():(m.clear(),m.fillRect(0,0,this.width,this.height,Ot.gy),null!==this.model.bR&&this.model.bR.draw(this.model.Ta,N.sin[this.CR],N.cos[this.CR],N.sin[this.ER],N.cos[this.ER],this.model.x-this.Lu,this.model.y-this.Su,this.model.z-this.xu,0),this.xe?.draw(0,0))};init=async()=>{const t=await(this.db?.Ds('main_file_cache.dat'));if(!t){return document.getElementById('helpme').style.display='block',void(p.style.display='none')}const i=await(this.db?.Ds('main_file_cache.idx0')),e=await(this.db?.Ds('main_file_cache.idx1')),s=await(this.db?.Ds('main_file_cache.idx2')),n=await(this.db?.Ds('main_file_cache.idx3')),r=await(this.db?.Ds('main_file_cache.idx4'));if(!(i&&e&&s&&n&&r)){return document.getElementById('helpme').style.display='block',void(p.style.display='none')}document.getElementById('helpme').style.display='none',p.style.display='block',this.pR=new Y(t,i,0),this.AR=new Y(t,e,1),this._R=new Y(t,s,2),this.gR=new Y(t,n,3),this.IR=new Y(t,r,4),await this.fs(10,'Unpacking textures');const h=this.pR.read(6);N.qi(h),N.Qi(.8),N.ie(20),await this.fs(20,'Loading models...');for(let t=0;t{this.model.id=i,this.vR(i)},t.appendChild(e)}}};vR(t){if(null===this.AR)return;const i=this.AR.read(t);null!==i?(this.model.bR=j.Gr(i,t),this.model.bR.ih(64,850,-30,-50,-30,!0),document.title=`Model ${t} | 2004Scape Tools`):document.title=`Missing model ${t} | 2004Scape Tools`}OR(){for(;;){const t=this.ys();if(-1===t)break;t==='r'.charCodeAt(0)?(this.TR=2,this.Lu=0,this.Su=0,this.xu=0,this.CR=0,this.ER=0,this.model.x=0,this.model.y=0,this.model.z=420,this.model.Ta=0):t==='1'.charCodeAt(0)?(this.model.id--,j.metadata&&this.model.id<0&&(this.model.id=j.metadata.length-1),this.vR(this.model.id)):t==='2'.charCodeAt(0)&&(this.model.id++,j.metadata&&this.model.id>=j.metadata.length&&(this.model.id=0),this.vR(this.model.id))}}RR(){this.Ze['['.charCodeAt(0)]?this.TR--:this.Ze[']'.charCodeAt(0)]&&this.TR++,this.Ze[1]?this.model.Ta+=this.TR:this.Ze[2]&&(this.model.Ta-=this.TR),this.Ze['w'.charCodeAt(0)]?this.model.z-=this.TR:this.Ze['s'.charCodeAt(0)]&&(this.model.z+=this.TR),this.Ze['a'.charCodeAt(0)]?this.model.x-=this.TR:this.Ze['d'.charCodeAt(0)]&&(this.model.x+=this.TR),this.Ze['q'.charCodeAt(0)]?this.model.y-=this.TR:this.Ze['e'.charCodeAt(0)]&&(this.model.y+=this.TR),this.CR=2047&this.CR,this.ER=2047&this.ER,this.model.Ta=2047&this.model.Ta}}).run().then((()=>{}))})()})(); \ No newline at end of file