diff --git a/docs/404.html b/docs/404.html index be6e873b..2b94f253 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1 +1 @@ -
W){if(W=K,$=X,K>J)break;for(var ee=Math.min(X,K-2),et=0,H=0;Het&&(et=ei,q=ea)}}}q=b[V=q],X+=V-q&32767}if($){C[R++]=0x10000000|u[W]<<18|f[$];var en=31&u[W],eo=31&f[$];N+=o[en]+s[eo],++w[257+en],++M[eo],U=G+W,++T}else C[R++]=e[G],++w[e[G]]}}for(G=Math.max(G,U);G =h&&(p[F/8|0]=m,es=h),F=O(p,F+1,e.subarray(G,es))}c.i=h}return B(g,0,l+E(F)+d)},H=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var a=t,r=9;--r;)a=(1&a&&-0x12477ce0)^a>>>1;e[t]=a}return e}(),W=function(){var e=-1;return{p:function(t){for(var a=e,r=0;r >>8;e=a},d:function(){return~e}}},$=function(){var e=1,t=0;return{p:function(a){for(var r=e,i=t,n=0|a.length,o=0;o!=n;){for(var s=Math.min(o+2655,n);o >16),i=(65535&i)+15*(i>>16)}e=r,t=i},d:function(){return e%=65521,t%=65521,(255&e)<<24|(65280&e)<<8|(255&t)<<8|t>>8}}},Z=function(e,t,a,i,n){if(!n&&(n={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),s=new r(o.length+e.length);s.set(o),s.set(e,o.length),e=s,n.w=o.length}return _(e,null==t.level?6:t.level,null==t.mem?n.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,a,i,n)},X=function(e,t){var a={};for(var r in e)a[r]=e[r];for(var r in t)a[r]=t[r];return a},J=function(e,t,a){for(var r=e(),i=e.toString(),n=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o>>0},eh=function(e,t){return ec(e,t)+0x100000000*ec(e,t+4)},eu=function(e,t,a){for(;a;++t)e[t]=a,a>>>=8},eg=function(e,t){var a=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:2*(9==t.level),e[9]=3,0!=t.mtime&&eu(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),a){e[3]=8;for(var r=0;r<=a.length;++r)e[r+10]=a.charCodeAt(r)}},ep=function(e){(31!=e[0]||139!=e[1]||8!=e[2])&&T(6,"invalid gzip data");var t=e[3],a=10;4&t&&(a+=(e[10]|e[11]<<8)+2);for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[a++]);return a+(2&t)},ef=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},em=function(e){return 10+(e.filename?e.filename.length+1:0)},eF=function(e,t){var a=t.level;if(e[0]=120,e[1]=(0==a?0:a<6?1:9==a?3:2)<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var r=$();r.p(t.dictionary),eu(e,2,r.d())}},ev=function(e,t){return((15&e[0])!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&T(6,"invalid zlib data"),(e[1]>>5&1)==+!t&&T(6,"invalid zlib data: "+(32&e[1]?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2};function ey(e,t){return"function"==typeof e&&(t=e,e={}),this.ondata=t,e}var eS=function(){function e(e,t){if("function"==typeof e&&(t=e,e={}),this.ondata=t,this.o=e||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new r(98304),this.o.dictionary){var a=this.o.dictionary.subarray(-32768);this.b.set(a,32768-a.length),this.s.i=32768-a.length}}return e.prototype.p=function(e,t){this.ondata(Z(e,this.o,0,0,this.s),t)},e.prototype.push=function(e,t){this.ondata||T(5),this.s.l&&T(4);var a=e.length+this.s.z;if(a>this.b.length){if(a>2*this.b.length-32768){var i=new r(-32768&a);i.set(this.b.subarray(0,this.s.z)),this.b=i}var n=this.b.length-this.s.z;this.b.set(e.subarray(0,n),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(e.subarray(n),32768),this.s.z=e.length-n+32768,this.s.i=32766,this.s.w=32768}else this.b.set(e,this.s.z),this.s.z+=e.length;this.s.l=1&t,(this.s.z>this.s.w+8191||t)&&(this.p(this.b,t||!1),this.s.w=this.s.i,this.s.i-=2)},e.prototype.flush=function(){this.ondata||T(5),this.s.l&&T(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},e}(),ek=function(e,t){el([et,function(){return[es,eS]}],this,ey.call(this,e,t),function(e){onmessage=es(new eS(e.data))},6,1)};function eb(e,t){return Z(e,t||{},0,0)}var eI=function(){function e(e,t){"function"==typeof e&&(t=e,e={}),this.ondata=t;var a=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:a?a.length:0},this.o=new r(32768),this.p=new r(0),a&&this.o.set(a)}return e.prototype.e=function(e){if(this.ondata||T(5),this.d&&T(4),this.p.length){if(e.length){var t=new r(this.p.length+e.length);t.set(this.p),t.set(e,this.p.length),this.p=t}}else this.p=e},e.prototype.c=function(e){this.s.i=+(this.d=e||!1);var t=this.s.b,a=N(this.p,this.s,this.o);this.ondata(B(a,t,this.s.b),this.d),this.o=B(a,this.s.b-32768),this.s.b=this.o.length,this.p=B(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}(),ex=function(e,t){el([ee,function(){return[es,eI]}],this,ey.call(this,e,t),function(e){onmessage=es(new eI(e.data))},7,0)};function eP(e,t){return N(e,{i:2},t&&t.out,t&&t.dictionary)}(function(){function e(e,t){this.c=W(),this.l=0,this.v=1,eS.call(this,e,t)}e.prototype.push=function(e,t){this.c.p(e),this.l+=e.length,eS.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){var a=Z(e,this.o,this.v&&em(this.o),t&&8,this.s);this.v&&(eg(a,this.o),this.v=0),t&&(eu(a,a.length-8,this.c.d()),eu(a,a.length-4,this.l)),this.ondata(a,t)},e.prototype.flush=function(){eS.prototype.flush.call(this)}})();var eD=function(){function e(e,t){this.v=1,this.r=0,eI.call(this,e,t)}return e.prototype.push=function(e,t){if(eI.prototype.e.call(this,e),this.r+=e.length,this.v){var a=this.p.subarray(this.v-1),i=a.length>3?ep(a):4;if(i>a.length){if(!t)return}else this.v>1&&this.onmember&&this.onmember(this.r-a.length);this.p=a.subarray(i),this.v=0}eI.prototype.c.call(this,t),!this.s.f||this.s.l||t||(this.v=E(this.s.p)+9,this.s={i:0},this.o=new r(0),this.push(new r(0),t))},e}(),eC=function(e,t){var a=this;el([ee,ea,function(){return[es,eI,eD]}],this,ey.call(this,e,t),function(e){var t=new eD(e.data);t.onmember=function(e){return postMessage(e)},onmessage=es(t)},9,0,function(e){return a.onmember&&a.onmember(e)})},ew=(function(){function e(e,t){this.c=$(),this.v=1,eS.call(this,e,t)}e.prototype.push=function(e,t){this.c.p(e),eS.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){var a=Z(e,this.o,this.v&&(this.o.dictionary?6:2),t&&4,this.s);this.v&&(eF(a,this.o),this.v=0),t&&eu(a,a.length-4,this.c.d()),this.ondata(a,t)},e.prototype.flush=function(){eS.prototype.flush.call(this)}}(),function(){function e(e,t){eI.call(this,e,t),this.v=e&&e.dictionary?2:1}return e.prototype.push=function(e,t){if(eI.prototype.e.call(this,e),this.v){if(this.p.length<6&&!t)return;this.p=this.p.subarray(ev(this.p,this.v-1)),this.v=0}t&&(this.p.length<4&&T(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),eI.prototype.c.call(this,t)},e}()),eE=function(e,t){el([ee,er,function(){return[es,eI,ew]}],this,ey.call(this,e,t),function(e){onmessage=es(new ew(e.data))},11,0)},eB=function(){function e(e,t){this.o=ey.call(this,e,t)||{},this.G=eD,this.I=eI,this.Z=ew}return e.prototype.i=function(){var e=this;this.s.ondata=function(t,a){e.ondata(t,a)}},e.prototype.push=function(e,t){if(this.ondata||T(5),this.s)this.s.push(e,t);else{if(this.p&&this.p.length){var a=new r(this.p.length+e.length);a.set(this.p),a.set(e,this.p.length)}else this.p=e;this.p.length>2&&(this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(this.o):(15&this.p[0])!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(this.o):new this.Z(this.o),this.i(),this.s.push(this.p,t),this.p=null)}},e}();function eM(e,t){eB.call(this,e,t),this.queuedSize=0,this.G=eC,this.I=ex,this.Z=eE}eM.prototype.i=function(){var e=this;this.s.ondata=function(t,a,r){e.ondata(t,a,r)},this.s.ondrain=function(t){e.queuedSize-=t,e.ondrain&&e.ondrain(t)}},eM.prototype.push=function(e,t){this.queuedSize+=e.length,eB.prototype.push.call(this,e,t)};var eT="u">typeof TextEncoder&&new TextEncoder,eN="u">typeof TextDecoder&&new TextDecoder,eG=0;try{eN.decode(q,{stream:!0}),eG=1}catch(e){}var eR=function(e){for(var t="",a=0;;){var r=e[a++],i=(r>127)+(r>223)+(r>239);if(a+i>e.length)return{s:t,r:B(e,a-1)};i?3==i?t+=String.fromCharCode(55296|(r=((15&r)<<18|(63&e[a++])<<12|(63&e[a++])<<6|63&e[a++])-65536)>>10,56320|1023&r):1&i?t+=String.fromCharCode((31&r)<<6|63&e[a++]):t+=String.fromCharCode((15&r)<<12|(63&e[a++])<<6|63&e[a++]):t+=String.fromCharCode(r)}};function eU(e,t){if(t){for(var a=new r(e.length),i=0;i >1)),s=0,l=function(e){o[s++]=e},i=0;i o.length){var d=new r(s+8+(n-i<<1));d.set(o),o=d}var c=e.charCodeAt(i);c<128||t?l(c):(c<2048?l(192|c>>6):(c>55295&&c<57344?(l(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++i))>>18),l(128|c>>12&63)):l(224|c>>12),l(128|c>>6&63)),l(128|63&c))}return B(o,0,s)}(function(e){this.ondata=e,eG?this.t=new TextDecoder:this.p=q}).prototype.push=function(e,t){if(this.ondata||T(5),t=!!t,this.t){this.ondata(this.t.decode(e,{stream:!0}),t),t&&(this.t.decode().length&&T(8),this.t=null);return}this.p||T(4);var a=new r(this.p.length+e.length);a.set(this.p),a.set(e,this.p.length);var i=eR(a),n=i.s,o=i.r;t?(o.length&&T(8),this.p=null):this.p=o,this.ondata(n,t)},(function(e){this.ondata=e}).prototype.push=function(e,t){this.ondata||T(5),this.d&&T(4),this.ondata(eU(e),this.d=t||!1)};var ej=function(e){return 1==e?3:e<6?2:+(9==e)},eA=function(e,t){for(;1!=ed(e,t);t+=4+ed(e,t+2));return[eh(e,t+12),eh(e,t+4),eh(e,t+20)]},eV=function(e){var t=0;if(e)for(var a in e){var r=e[a].length;r>65535&&T(9),t+=r+4}return t},eO=function(e,t,a,r,i,n,o,s){var l=r.length,d=a.extra,c=s&&s.length,h=eV(d);eu(e,t,null!=o?0x2014b50:0x4034b50),t+=4,null!=o&&(e[t++]=20,e[t++]=a.os),e[t]=20,t+=2,e[t++]=a.flag<<1|(n<0&&8),e[t++]=i&&8,e[t++]=255&a.compression,e[t++]=a.compression>>8;var u=new Date(null==a.mtime?Date.now():a.mtime),g=u.getFullYear()-1980;if((g<0||g>119)&&T(10),eu(e,t,g<<25|u.getMonth()+1<<21|u.getDate()<<16|u.getHours()<<11|u.getMinutes()<<5|u.getSeconds()>>1),t+=4,-1!=n&&(eu(e,t,a.crc),eu(e,t+4,n<0?-n-2:n),eu(e,t+8,a.size)),eu(e,t+12,l),eu(e,t+14,h),t+=16,null!=o&&(eu(e,t,c),eu(e,t+6,a.attrs),eu(e,t+10,o),t+=14),e.set(r,t),t+=l,h)for(var p in d){var f=d[p],m=f.length;eu(e,t,+p),eu(e,t+2,m),e.set(f,t+4),t+=4+m}return c&&(e.set(s,t),t+=c),t},ez=function(e,t,a,r,i){eu(e,t,0x6054b50),eu(e,t+8,a),eu(e,t+10,a),eu(e,t+12,r),eu(e,t+16,i)},eL=function(){function e(e){this.filename=e,this.c=W(),this.size=0,this.compression=0}return e.prototype.process=function(e,t){this.ondata(null,e,t)},e.prototype.push=function(e,t){this.ondata||T(5),this.c.p(e),this.size+=e.length,t&&(this.crc=this.c.d()),this.process(e,t||!1)},e}();function eq(e,t){var a=this;t||(t={}),eL.call(this,e),this.d=new eS(t,function(e,t){a.ondata(null,e,t)}),this.compression=8,this.flag=ej(t.level)}function e_(e,t){var a=this;t||(t={}),eL.call(this,e),this.d=new ek(t,function(e,t,r){a.ondata(e,t,r)}),this.compression=8,this.flag=ej(t.level),this.terminate=this.d.terminate}function eH(e){this.ondata=e,this.u=[],this.d=1}eq.prototype.process=function(e,t){try{this.d.push(e,t)}catch(e){this.ondata(e,null,t)}},eq.prototype.push=function(e,t){eL.prototype.push.call(this,e,t)},e_.prototype.process=function(e,t){this.d.push(e,t)},e_.prototype.push=function(e,t){eL.prototype.push.call(this,e,t)},eH.prototype.add=function(e){var t=this;if(this.ondata||T(5),2&this.d)this.ondata(T(4+(1&this.d)*8,0,1),null,!1);else{var a=eU(e.filename),i=a.length,n=e.comment,o=n&&eU(n),s=i!=e.filename.length||o&&n.length!=o.length,l=i+eV(e.extra)+30;i>65535&&this.ondata(T(11,0,1),null,!1);var d=new r(l);eO(d,0,e,a,s,-1);var c=[d],h=function(){for(var e=0,a=c;e 0){var i=Math.min(this.c,e.length),n=e.subarray(0,i);if(this.c-=i,this.d?this.d.push(n,!this.c):this.k[0].push(n),(e=e.subarray(i)).length)return this.push(e,t)}else{var o=0,s=0,l=void 0,d=void 0;this.p.length?e.length?((d=new r(this.p.length+e.length)).set(this.p),d.set(e,this.p.length)):d=this.p:d=e;for(var c=d.length,h=this.c,u=h&&this.d,g=this;s s+30+n+u){var p,f,m=[];g.k.unshift(m),o=2;var F=ec(d,s+18),v=ec(d,s+22),y=function(e,t){if(t){for(var a="",r=0;r =0&&(S.size=F,S.originalSize=v),g.onfile(S)}return"break"}if(h){if(0x8074b50==e)return l=s+=12+(-2==h&&8),o=3,g.c=0,"break";else if(0x2014b50==e)return l=s-=4,o=3,g.c=0,"break"}}();++s);if(this.p=q,h<0){var p=o?d.subarray(0,l-12-(-2==h&&8)-(0x8074b50==ec(d,l-16)&&4)):d.subarray(0,s);u?u.push(p,!!o):this.k[+(2==o)].push(p)}if(2&o)return this.push(d.subarray(s),t);this.p=d.subarray(s)}t&&(this.c&&T(13),this.p=null)},eX.prototype.register=function(e){this.o[e.compression]=e},"function"==typeof queueMicrotask&&queueMicrotask;var eJ=e.i(48450);let eY=[0,0,0,0,0,0,0,0,0,329,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2809,68,0,27,0,58,3,62,4,7,0,0,15,65,554,3,394,404,189,117,30,51,27,15,34,32,80,1,142,3,142,39,0,144,125,44,122,275,70,135,61,127,8,12,113,246,122,36,185,1,149,309,335,12,11,14,54,151,0,0,2,0,0,211,0,2090,344,736,993,2872,701,605,646,1552,328,305,1240,735,1533,1713,562,3,1775,1149,1469,979,407,553,59,279,31,0,0,0,68,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function eQ(e){return e.node?e.node.pop:e.leaf.pop}let eK=new class{nodes=[];leaves=[];tablesBuilt=!1;buildTables(){if(this.tablesBuilt)return;this.tablesBuilt=!0,this.leaves=[];for(let t=0;t<256;t++){var e;this.leaves.push({pop:eY[t]+ +((e=t)>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122)+1,symbol:t,numBits:0,code:0})}this.nodes=[{pop:0,index0:0,index1:0}];let t=256,a=[];for(let e=0;e<256;e++)a.push({node:null,leaf:this.leaves[e]});for(;1!==t;){let e=0xfffffffe,r=0xffffffff,i=-1,n=-1;for(let o=0;o n?i:n;a[s]={node:o,leaf:null},l!==t-1&&(a[l]=a[t-1]),t--}this.nodes[0]=a[0].node,this.generateCodes(0,0,0)}determineIndex(e){return null!==e.leaf?-(this.leaves.indexOf(e.leaf)+1):this.nodes.indexOf(e.node)}generateCodes(e,t,a){if(t<0){let r=this.leaves[-(t+1)];r.code=e,r.numBits=a}else{let r=this.nodes[t];this.generateCodes(e,r.index0,a+1),this.generateCodes(e|1<=0)t=e.readFlag()?this.nodes[t].index1:this.nodes[t].index0;else{a.push(this.leaves[-(t+1)].symbol);break}}return String.fromCharCode(...a)}{let t=e.readInt(8);return String.fromCharCode(...e.readBytes(t))}}};class e0{data;bitNum;maxReadBitNum;error;stringBuffer=null;constructor(e,t=0){this.data=e,this.bitNum=t,this.maxReadBitNum=e.length<<3,this.error=!1}getCurPos(){return this.bitNum}setCurPos(e){this.bitNum=e}getBytePosition(){return this.bitNum+7>>3}isError(){return this.error}isFull(){return this.bitNum>this.maxReadBitNum}getRemainingBits(){return this.maxReadBitNum-this.bitNum}getMaxPos(){return this.maxReadBitNum}readFlag(){if(this.bitNum>=this.maxReadBitNum)return this.error=!0,!1;let e=1<<(7&this.bitNum),t=(this.data[this.bitNum>>3]&e)!=0;return this.bitNum++,t}readInt(e){if(0===e)return 0;if(this.bitNum+e>this.maxReadBitNum)return this.error=!0,0;let t=this.bitNum>>3,a=7&this.bitNum;if(this.bitNum+=e,e+a<=32){let r=0,i=e+a+7>>3;for(let e=0;e>>=a,32===e)?r>>>0:r&(1< >3;for(let e=0;e>>0:r&(1< >3,a=new Uint8Array(t),r=this.bitNum>>3,i=7&this.bitNum,n=8-i;if(0===i)a.set(this.data.subarray(r,r+t));else{let e=this.data[r];for(let o=0;o >i|t< this.maxReadBitNum)return this.error=!0,0;let e=this.bitNum>>3,t=7&this.bitNum,a=e0.f32U8;if(0===t)a[0]=this.data[e],a[1]=this.data[e+1],a[2]=this.data[e+2],a[3]=this.data[e+3];else{let r=8-t;for(let i=0;i<4;i++){let n=this.data[e+i],o=e+i+1 >t|o< >>0)}getCompressionPoint(){return this.compressionPoint}getDataBlockDataMap(){return this.dataBlockDataMap}getConnectionContext(){let e=this.dataBlockDataMap;return{compressionPoint:this.compressionPoint,ghostTracker:this.ghostTracker,getDataBlockParser:e=>this.registry.getDataBlockParser(e),getDataBlockData:e?t=>e.get(t):void 0,getGhostParser:e=>this.registry.getGhostParser(e)}}_setNextRecvEventSeq(e){this.nextRecvEventSeq=e>>>0}setConnectionProtocolState(e){for(this.lastSeqRecvdAtSend=e.lastSeqRecvdAtSend.slice(0,32);this.lastSeqRecvdAtSend.length<32;)this.lastSeqRecvdAtSend.push(0);this.lastSeqRecvd=e.lastSeqRecvd>>>0,this.highestAckedSeq=e.highestAckedSeq>>>0,this.lastSendSeq=e.lastSendSeq>>>0,this.recvAckMask=e.ackMask>>>0,this.connectSequence=e.connectSequence>>>0,this.lastRecvAckAck=e.lastRecvAckAck>>>0,this._connectionEstablished=e.connectionEstablished}onSendPacketTrigger(){this.lastSendSeq=this.lastSendSeq+1>>>0,this.lastSeqRecvdAtSend[31&this.lastSendSeq]=this.lastSeqRecvd>>>0}applyProtocolHeader(e){if(e.connectSeqBit!==(1&this.connectSequence)||e.ackByteCount>4||e.packetType>2)return{accepted:!1,dispatchData:!1};let t=(e.seqNumber|0xfffffe00&this.lastSeqRecvd)>>>0;if(t >>0),this.lastSeqRecvd+31 >>0;if(a >>0),this.lastSendSeq>>0,0===e.packetType&&(this.recvAckMask=(1|this.recvAckMask)>>>0);for(let t=this.highestAckedSeq+1;t<=a;t++)(e.ackMask&1<<(a-t&31))!=0&&(this.lastRecvAckAck=this.lastSeqRecvdAtSend[31&t]>>>0);t-this.lastRecvAckAck>32&&(this.lastRecvAckAck=t-32),this.highestAckedSeq=a;let i=this.lastSeqRecvd!==t&&0===e.packetType;return this.lastSeqRecvd=t,{accepted:!0,dispatchData:i}}parsePacket(e){let t=new e0(e),a=this.readDnetHeader(t),r=this.applyProtocolHeader(a);if(this.packetsParsed++,!r.accepted)return this.protocolRejected++,{dnetHeader:a,rateInfo:{},gameState:this.emptyGameState(),events:[],ghosts:[]};if(!r.dispatchData)return this.protocolNoDispatch++,{dnetHeader:a,rateInfo:{},gameState:this.emptyGameState(),events:[],ghosts:[]};let i=this.readRateInfo(t);t.setStringBuffer(!0);let n=this.readGameState(t),o=void 0===n.controlObjectDataStart||void 0!==n.controlObjectData,s=o?this.readEvents(t):[],l=s[s.length-1],d=!l||l.dataBitsEnd!==l.dataBitsStart,c=o&&d?t.getCurPos():void 0,h=o&&d?this.readGhosts(t,a.seqNumber):[];return t.setStringBuffer(!1),{dnetHeader:a,rateInfo:i,gameState:n,events:s,ghosts:h,ghostSectionStart:c}}readDnetHeader(e){let t=e.readFlag(),a=e.readInt(1),r=e.readInt(9),i=e.readInt(9),n=e.readInt(2),o=e.readInt(3),s=o>0?e.readInt(8*o):0;return{gameFlag:t,connectSeqBit:a,seqNumber:r,highestAck:i,packetType:n,ackByteCount:o,ackMask:s}}readRateInfo(e){let t={};return e.readFlag()&&(t.updateDelay=e.readInt(10),t.packetSize=e.readInt(10)),e.readFlag()&&(t.maxUpdateDelay=e.readInt(10),t.maxPacketSize=e.readInt(10)),t}readGameState(e){let t,a,r,i,n,o,s,l,d,c,h,u,g,p,f,m=e.readInt(32);e.readFlag()&&(e.readFlag()&&(t=e.readFloat(7)),e.readFlag()&&(a=1.5*e.readFloat(7))),e.readFlag()&&(r=e.readFlag(),i=e.readFlag()),e.readFlag()&&((n=e.readFlag())&&(o={x:e.readF32(),y:e.readF32(),z:e.readF32()}),1===(s=e.readRangedU32(0,2))?e.readFlag()&&(l=e.readRangedU32(0,1023)):2===s&&(d={x:e.readF32(),y:e.readF32(),z:e.readF32()}));let F=e.readFlag(),v=e.readFlag();if(e.readFlag())if(e.readFlag()){let f=e.readInt(10);c=f,h=e.getCurPos();let y=e.savePos(),S=this.ghostTracker.getGhost(f),k=S?this.registry.getGhostParser(S.classId):void 0,b=this.controlParserByGhostIndex.get(f),I=this.registry.getGhostParser(25),x=this.registry.getGhostParser(4),P=[],D=new Set,C=e=>{!e?.readPacketData||D.has(e.name)||(D.add(e.name),P.push(e))};C(k),C(b),C(I),C(x);let w=!1;for(let t of P){e.restorePos(y);try{let a=this.getConnectionContext(),r=t.readPacketData(e,a);if(e.getCurPos()-h<=0||e.isError())continue;g=r,u=e.getCurPos(),this.controlParserByGhostIndex.set(f,t),a.compressionPoint!==this.compressionPoint&&(this.compressionPoint=a.compressionPoint,p=this.compressionPoint),this.controlObjectParsed++,w=!0;break}catch{}}if(!w)return e.restorePos(y),u=h,this.controlObjectFailed++,{lastMoveAck:m,damageFlash:t,whiteOut:a,selfLocked:r,selfHomed:i,seekerTracking:n,seekerTrackingPos:o,seekerMode:s,seekerObjectGhostIndex:l,targetPos:d,pinged:F,jammed:v,controlObjectGhostIndex:c,controlObjectDataStart:h,controlObjectDataEnd:u,controlObjectData:g,targetVisibility:[]}}else p={x:e.readF32(),y:e.readF32(),z:e.readF32()},this.compressionPoint=p;let y=[];for(;e.readFlag();)y.push({index:e.readInt(4),mask:e.readInt(32)});return e.readFlag()&&(f=e.readInt(8)),{lastMoveAck:m,damageFlash:t,whiteOut:a,selfLocked:r,selfHomed:i,seekerTracking:n,seekerTrackingPos:o,seekerMode:s,seekerObjectGhostIndex:l,targetPos:d,pinged:F,jammed:v,controlObjectGhostIndex:c,controlObjectDataStart:h,controlObjectDataEnd:u,controlObjectData:g,compressionPoint:p,targetVisibility:y.length>0?y:void 0,cameraFov:f}}readEvents(e){let t=[],a=!0,r=-2;for(;;){let i,n,o,s=e.readFlag();if(a&&!s){if(a=!1,!e.readFlag()){this.dispatchGuaranteedEvents(t);break}}else if(a||s){if(!s)break}else{this.dispatchGuaranteedEvents(t);break}!a&&(r=i=e.readFlag()?r+1&127:e.readInt(7),(n=i|0xffffff80&this.nextRecvEventSeq) 0&&this.pendingGuaranteedEvents[0].absoluteSequenceNumber===this.nextRecvEventSeq;){let t=this.pendingGuaranteedEvents.shift();if(!t)break;this.nextRecvEventSeq=this.nextRecvEventSeq+1>>>0,e.push(t.event),t.event.parsedData&&this.applyEventSideEffects(t.event.parsedData)}}applyEventSideEffects(e){let t=e.type;if("GhostingMessageEvent"===t){let t=e.message;"number"==typeof t&&2===t&&this.ghostTracker.clear();return}if("GhostAlwaysObjectEvent"===t){let t=e.ghostIndex,a=e.classId;if("number"==typeof t&&"number"==typeof a){let e=this.registry.getGhostParser(a);this.ghostTracker.createGhost(t,a,e?.name??`unknown_${a}`)}}"SimDataBlockEvent"===t&&this.dataBlockDataMap&&e.dataBlockData&&"number"==typeof e.objectId&&this.dataBlockDataMap.set(e.objectId,e.dataBlockData)}readGhosts(e,t){let a=[];if(!e.readFlag())return a;let r=e.readInt(3)+3;for(;e.readFlag();){let i;if(e.isError())break;let n=e.readInt(r);if(e.isError())break;if(e.readFlag()){this.ghostTracker.deleteGhost(n),this.ghostDeletes++,a.push({index:n,type:"delete",updateBitsStart:e.getCurPos(),updateBitsEnd:e.getCurPos()});continue}let o=!this.ghostTracker.hasGhost(n);i=o?e.readInt(7)+0:this.ghostTracker.getGhost(n)?.classId;let s=e.getCurPos(),l=void 0!==i?this.registry.getGhostParser(i):void 0;if(o&&!l){this.ghostsTrackerDiverged++,e5("DIVERGED pkt=%d seq=%d idx=%d classId=%d bit=%d/%d trackerSize=%d (server sent UPDATE for ghost not in our tracker; 7-bit classId is actually update data)",this.packetsParsed,t,n,i,s,e.getMaxPos(),this.ghostTracker.size()),a.push({index:n,type:"create",classId:i,updateBitsStart:s,updateBitsEnd:s});break}let d=!1;if(l)try{let t=this.getConnectionContext();t.currentGhostIndex=n;let r=l.unpackUpdate(e,o,t),c=e.getCurPos();o&&void 0!==i?(this.ghostTracker.createGhost(n,i,l.name),this.ghostCreatesParsed++):this.ghostUpdatesParsed++,a.push({index:n,type:o?"create":"update",classId:i,updateBitsStart:s,updateBitsEnd:c,parsedData:r}),d=!0}catch(c){this.ghostsFailed++;let r=o?"create":"update",d=c instanceof Error?c.message:String(c);e5("FAIL pkt=%d seq=%d #%d idx=%d op=%s classId=%d parser=%s bit=%d/%d trackerSize=%d err=%s",this.packetsParsed,t,a.length,n,r,i,l.name,s,e.getMaxPos(),this.ghostTracker.size(),d)}if(!d){e5("STOP pkt=%d seq=%d idx=%d op=%s classId=%d parser=%s bit=%d/%d",this.packetsParsed,t,n,o?"create":"update",i,l?.name??"NONE",s,e.getMaxPos()),a.push({index:n,type:o?"create":"update",classId:i,updateBitsStart:s,updateBitsEnd:s});break}}return a}emptyGameState(){return{lastMoveAck:0,pinged:!1,jammed:!1}}}class e6{eventParsers=new Map;ghostParsers=new Map;dataBlockParsers=new Map;eventCatalog=new Map;ghostCatalog=new Map;dataBlockCatalog=new Map;catalogEvent(e){this.eventCatalog.set(e.name,e)}catalogGhost(e){this.ghostCatalog.set(e.name,e)}catalogDataBlock(e){this.dataBlockCatalog.set(e.name,e)}bindDeterministicDataBlocks(e,t){let a=0,r=[];for(let i=0;i 0&&(r.sounds=t)}if(e.readFlag()){let t=[];for(let a=0;a<4;a++)e.readFlag()&&t.push({index:a,sequence:e.readInt(5),state:e.readInt(2),forward:e.readFlag(),atEnd:e.readFlag()});t.length>0&&(r.threads=t)}let i=!1;if(e.readFlag()){let a=[];for(let r=0;r<8;r++)if(e.readFlag()){let n={index:r};e.readFlag()?n.dataBlockId=e9(e):n.dataBlockId=0,e.readFlag()&&(e.readFlag()?n.skinTagIndex=e.readInt(10):n.skinName=e.readString(),i=!0),n.triggerDown=e.readFlag(),n.loaded=e.readFlag(),n.ammo=e.readFlag(),n.wet=e.readFlag(),n.target=e.readFlag(),n.fireCount=e.readInt(3),t&&(n.imageExtraFlag=e.readFlag()),a.push(n)}a.length>0&&(r.images=a)}if(e.readFlag()){if(e.readFlag()){r.stateAEnabled=e.readFlag(),r.stateB=e.readFlag();let t=e.readFlag();r.hasInvulnerability=t,t?(r.invulnerabilityVisual=e.readFlag(),r.invulnerabilityTicks=e.readU32()):r.binaryCloak=e.readFlag()}if(e.readFlag())if(e.readFlag()){let t=e.readFlag();r.stateBMode=t,t?r.energyPackOn=!0:r.energyPackOn=!1}else r.shieldNormal=e.readNormalVector(8),r.energyPercent=e.readFloat(5);e.readFlag()&&(r.stateValue1=e.readU32(),r.stateValue2=e.readU32())}return i&&(r.imageSkinDirty=!0),e.readFlag()&&(e.readFlag()?(r.mountObject=e.readInt(10),r.mountNode=e.readInt(5)):r.mountObject=-1),r}function ta(e,t,a){let r=tt(e,t,a);if(e.readFlag()&&(r.impactSound=e.readInt(3)),e.readFlag()&&(r.action=e.readInt(8),r.actionHoldAtEnd=e.readFlag(),r.actionAtEnd=e.readFlag(),r.actionFirstPerson=e.readFlag(),!r.actionAtEnd&&e.readFlag()&&(r.actionAnimPos=e.readSignedFloat(6))),e.readFlag()&&(r.armAction=e.readInt(8)),e.readFlag())return r;if(e.readFlag()){if(r.actionState=e.readInt(3),e.readFlag()&&(r.recoverTicks=e.readInt(7)),r.moveFlag0=e.readFlag(),r.moveFlag1=e.readFlag(),r.position=e.readCompressedPoint(a.compressionPoint),e.readFlag()){let t=e.readInt(13)/32,a=e.readNormalVector(10);r.velocity={x:a.x*t,y:a.y*t,z:a.z*t}}else r.velocity={x:0,y:0,z:0};r.headX=e.readSignedFloat(6),r.headZ=e.readSignedFloat(6),r.rotationZ=2*e.readFloat(7)*Math.PI,r.move=e7(e),r.allowWarp=e.readFlag()}return r.energy=e.readFloat(5),r}function tr(e,t){let a={};if(a.energyLevel=e.readF32(),a.rechargeRate=e.readF32(),a.actionState=e.readInt(3),e.readFlag()&&(a.recoverTicks=e.readInt(7)),e.readFlag()&&(a.jumpDelay=e.readInt(7)),e.readFlag()){let r={x:e.readF32(),y:e.readF32(),z:e.readF32()};a.position=r,t.compressionPoint=r,a.velocity={x:e.readF32(),y:e.readF32(),z:e.readF32()},a.jumpSurfaceLastContact=e.readInt(4)}if(a.headX=e.readF32(),a.headZ=e.readF32(),a.rotationZ=e.readF32(),e.readFlag()){let r=e.readInt(10);a.controlObjectGhost=r;let i=t.ghostTracker.getGhost(r),n=i?t.getGhostParser?.(i.classId):void 0;if(n?.readPacketData){let i=t.currentGhostIndex;t.currentGhostIndex=r,a.controlObjectData=n.readPacketData(e,t),t.currentGhostIndex=i}}return a.disableMove=e.readFlag(),a.pilot=e.readFlag(),a}function ti(e,t,a){let r=tt(e,t,a);return(r.jetting=e.readFlag(),e.readFlag())?r._controlledEarlyReturn=!0:(r.steeringYaw=e.readFloat(9),r.steeringPitch=e.readFloat(9),r.move=e7(e),r.frozen=e.readFlag(),e.readFlag()&&(r.position=e.readCompressedPoint(a.compressionPoint),r.angPosition={x:e.readF32(),y:e.readF32(),z:e.readF32(),w:e.readF32()},r.linMomentum=e.readPoint3F(),r.angMomentum=e.readPoint3F()),e.readFlag()&&(r.energy=e.readFloat(8))),r}function tn(e,t){let a={};a.energyLevel=e.readF32(),a.rechargeRate=e.readF32(),a.steering={x:e.readF32(),y:e.readF32()};let r={x:e.readF32(),y:e.readF32(),z:e.readF32()};return a.linPosition=r,a.angPosition={x:e.readF32(),y:e.readF32(),z:e.readF32(),w:e.readF32()},a.linMomentum=e.readPoint3F(),a.angMomentum=e.readPoint3F(),a.disableMove=e.readFlag(),a.frozen=e.readFlag(),t.compressionPoint=r,a}function to(e,t){let a=tn(e,t);a.braking=e.readFlag();let r=4,i=t.currentGhostIndex;if(void 0!==i){let e=tZ.get(i);void 0!==e&&(r=e)}let n=[];for(let t=0;t 64)throw Error(`Invalid Sky fogVolumeCount: ${t}`);r.fogVolumeCount=t,r.useSkyTextures=e.readBool(),r.renderBottomTexture=e.readBool(),r.skySolidColor={r:e.readF32(),g:e.readF32(),b:e.readF32()},r.windEffectPrecipitation=e.readBool();let a=[];for(let r=0;r 3)throw Error(`Invalid precipitation colorCount: ${t}`);let a=[];for(let r=0;r Math.floor(e.getRemainingBits()/96))throw Error(`Invalid physicalZone point count: ${t}`);let a=[];for(let r=0;r Math.floor(e.getRemainingBits()/128))throw Error(`Invalid physicalZone plane count: ${i}`);let n=[];for(let t=0;tMath.floor(e.getRemainingBits()/128))throw Error(`Invalid physicalZone edge count: ${o}`);let s=[];for(let t=0;t 0&&(a.audioData=e.readBitsBuffer(8*r)),a}function ad(e,t){return{type:"GhostingMessageEvent",sequence:e.readU32(),message:e.readInt(3),ghostCount:e.readInt(11)}}function ac(e,t){let a={type:"GhostAlwaysObjectEvent"};a.ghostIndex=e.readInt(10);let r=e.readFlag();if(a._hasObjectData=r,r){let r=e.readInt(7);a.classId=r;let i=t.getGhostParser?.(r);if(!i)throw Error(`No ghost parser for GhostAlwaysObjectEvent classId=${r}`);a.objectData=i.unpackUpdate(e,!0,t)}return a}function ah(e,t){let a={type:"PathManagerEvent"};if(e.readFlag()){a.messageType="NewPaths";let t=e.readU32(),r=[];for(let a=0;a 0&&(t.hudImages=a),t}function aw(e){let t={};e.readFlag()&&(t.crc=e.readU32()),t.shapeName=e.readString(),t.mountPoint=e.readU32(),e.readFlag()||(t.offset=e.readAffineTransform()),t.firstPerson=e.readFlag(),t.mass=e.readF32(),t.usesEnergy=e.readFlag(),t.minEnergy=e.readF32(),t.hasFlash=e.readFlag(),t.projectile=ab(e),t.muzzleFlash=ab(e),t.isSeeker=e.readFlag(),t.isSeeker&&(t.seekerRadius=e.readF32(),t.maxSeekAngle=e.readF32(),t.seekerLockTime=e.readF32(),t.seekerFreeTime=e.readF32(),t.isTargetLockRequired=e.readFlag(),t.maxLockRange=e.readF32()),t.cloakable=e.readFlag(),t.lightType=e.readRangedU32(0,3),0!==t.lightType&&(t.lightRadius=e.readF32(),t.lightTime=e.readS32(),t.lightColor={r:e.readFloat(7),g:e.readFloat(7),b:e.readFloat(7),a:e.readFloat(7)}),t.shellExitDir={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.shellExitVariance=e.readF32(),t.shellVelocity=e.readF32(),t.casing=ab(e),t.accuFire=e.readFlag();let a=[];for(let t=0;t<31;t++){if(!e.readFlag())continue;let t={};t.name=e.readString(),t.transitionOnAmmo=e.readInt(5),t.transitionOnNoAmmo=e.readInt(5),t.transitionOnTarget=e.readInt(5),t.transitionOnNoTarget=e.readInt(5),t.transitionOnWet=e.readInt(5),t.transitionOnNotWet=e.readInt(5),t.transitionOnTriggerUp=e.readInt(5),t.transitionOnTriggerDown=e.readInt(5),t.transitionOnTimeout=e.readInt(5),t.transitionGeneric0In=e.readInt(5),t.transitionGeneric0Out=e.readInt(5),e.readFlag()&&(t.timeoutValue=e.readF32()),t.waitForTimeout=e.readFlag(),t.fire=e.readFlag(),t.ejectShell=e.readFlag(),t.scaleAnimation=e.readFlag(),t.direction=e.readFlag(),t.reload=e.readFlag(),e.readFlag()&&(t.energyDrain=e.readF32()),t.loaded=e.readInt(3),t.spin=e.readInt(3),t.recoil=e.readInt(3),e.readFlag()&&(t.sequence=e.readSignedInt(16)),e.readFlag()&&(t.sequenceVis=e.readSignedInt(16)),t.flashSequence=e.readFlag(),t.ignoreLoadedForReady=e.readFlag(),t.emitter=ab(e),null!==t.emitter&&(t.emitterTime=e.readF32(),t.emitterNode=e.readS32()),t.sound=ab(e),a.push(t)}return t.states=a,t}function aE(e){let t=aC(e);t.renderFirstPerson=e.readFlag(),t.minLookAngle=e.readF32(),t.maxLookAngle=e.readF32(),t.maxFreelookAngle=e.readF32(),t.maxTimeScale=e.readF32(),t.maxStepHeight=e.readF32(),t.runForce=e.readF32(),t.runEnergyDrain=e.readF32(),t.minRunEnergy=e.readF32(),t.maxForwardSpeed=e.readF32(),t.maxBackwardSpeed=e.readF32(),t.maxSideSpeed=e.readF32(),t.maxUnderwaterForwardSpeed=e.readF32(),t.maxUnderwaterBackwardSpeed=e.readF32(),t.maxUnderwaterSideSpeedRef=ab(e),e.readFlag()&&(t.runSurfaceAngleRef=e.readInt(11)),t.runSurfaceAngle=e.readF32(),t.recoverDelay=e.readF32(),t.recoverRunForceScale=e.readF32(),t.jumpForce=e.readF32(),t.jumpEnergyDrain=e.readF32(),t.minJumpEnergy=e.readF32(),t.minJumpSpeed=e.readF32(),t.maxJumpSpeed=e.readF32(),t.jumpSurfaceAngle=e.readF32(),t.minJetEnergy=e.readF32(),t.splashVelocity=e.readF32(),t.splashAngle=e.readF32(),t.splashFreqMod=e.readF32(),t.splashVelEpsilon=e.readF32(),t.bubbleEmitTime=e.readF32(),t.medSplashSoundVel=e.readF32(),t.hardSplashSoundVel=e.readF32(),t.exitSplashSoundVel=e.readF32(),t.jumpDelay=e.readInt(7),t.horizMaxSpeed=e.readF32(),t.horizResistSpeed=e.readF32(),t.horizResistFactor=e.readF32(),t.upMaxSpeed=e.readF32(),t.upResistSpeed=e.readF32(),t.upResistFactor=e.readF32(),t.jetEnergyDrain=e.readF32(),t.canJet=e.readF32(),t.maxJetHorizontalPercentage=e.readF32(),t.maxJetForwardSpeed=e.readF32(),t.jetForce=e.readF32(),t.minJetSpeed=e.readF32(),t.maxDamage=e.readF32(),t.minImpactDamageSpeed=e.readF32(),t.impactDamageScale=e.readF32(),t.footSplashHeight=e.readF32();let a=[];for(let t=0;t<32;t++)e.readFlag()?a.push(e.readInt(11)):a.push(null);t.sounds=a,t.boxSize={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.footPuffEmitter=ab(e),t.footPuffNumParts=e.readF32(),t.footPuffRadius=e.readF32(),t.decalData=ab(e),t.decalOffset=e.readF32(),t.dustEmitter=ab(e),t.splash=ab(e);let r=[];for(let t=0;t<3;t++)r.push(ab(e));return t.splashEmitters=r,t.groundImpactMinSpeed=e.readF32(),t.groundImpactShakeFreq={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.groundImpactShakeAmp={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.groundImpactShakeDuration=e.readF32(),t.groundImpactShakeFalloff=e.readF32(),t.boundingRadius=e.readF32(),t.moveBubbleSize=e.readF32(),t}function aB(e){let t=aC(e);t.bodyRestitution=e.readF32(),t.bodyFriction=e.readF32();let a=[];for(let t=0;t<2;t++)a.push(ab(e));t.impactSounds=a,t.minImpactSpeed=e.readF32(),t.softImpactSpeed=e.readF32(),t.hardImpactSpeed=e.readF32(),t.minRollSpeed=e.readF32(),t.maxSteeringAngle=e.readF32(),t.maxDrag=e.readF32(),t.minDrag=e.readF32(),t.cameraOffset=e.readF32(),t.cameraLag=e.readF32(),t.jetForce=e.readF32(),t.jetEnergyDrain=e.readF32(),t.minJetEnergy=e.readF32(),t.integration=e.readF32(),t.collisionTol=e.readF32(),t.massCenter=e.readF32(),t.exitSplashSoundVelocity=e.readF32(),t.softSplashSoundVelocity=e.readF32(),t.mediumSplashSoundVelocity=e.readF32(),t.hardSplashSoundVelocity=e.readF32();let r=[];for(let t=0;t<5;t++)r.push(ab(e));t.waterSounds=r,t.dustEmitter=ab(e);let i=[];for(let t=0;t<3;t++)i.push(ab(e));t.damageEmitters=i;let n=[];for(let t=0;t<2;t++)n.push(ab(e));return t.splashEmitters=n,t.damageEmitterOffset0={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.damageEmitterOffset1={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.damageLevelTolerance0=e.readF32(),t.damageLevelTolerance1=e.readF32(),t.splashFreqMod=e.readF32(),t.splashVelEpsilon=e.readF32(),t.collDamageThresholdVel=e.readF32(),t.collDamageMultiplier=e.readF32(),t}function aM(e){let t=aB(e);t.jetActivateSound=ab(e),t.jetDeactivateSound=ab(e);let a=[];for(let t=0;t<4;t++)a.push(ab(e));return t.jetEmitters=a,t.maneuveringForce=e.readF32(),t.horizontalSurfaceForce=e.readF32(),t.verticalSurfaceForce=e.readF32(),t.autoInputDamping=e.readF32(),t.steeringForce=e.readF32(),t.steeringRollForce=e.readF32(),t.rollForce=e.readF32(),t.autoAngularForce=e.readF32(),t.rotationalDrag=e.readF32(),t.maxAutoSpeed=e.readF32(),t.autoLinearForce=e.readF32(),t.hoverHeight=e.readF32(),t.createHoverHeight=e.readF32(),t.minTrailSpeed=e.readF32(),t.vertThrustMultiple=e.readF32(),t.maxForwardSpeed=e.readF32(),t}function aT(e){let t=aB(e);t.dragForce=e.readF32(),t.mainThrustForce=e.readF32(),t.reverseThrustForce=e.readF32(),t.strafeThrustForce=e.readF32(),t.turboFactor=e.readF32(),t.stabLenMin=e.readF32(),t.stabLenMax=e.readF32(),t.stabSpringConstant=e.readF32(),t.stabDampingConstant=e.readF32(),t.gyroDrag=e.readF32(),t.normalForce=e.readF32(),t.restorativeForce=e.readF32(),t.steeringForce=e.readF32(),t.rollForce=e.readF32(),t.pitchForce=e.readF32(),t.floatingThrustFactor=e.readF32(),t.brakingForce=e.readF32(),t.dustTrailOffset={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.dustTrailFreqMod=e.readF32(),t.triggerTrailHeight=e.readF32(),t.floatSound=ab(e),t.thrustSound=ab(e),t.turboSound=ab(e);let a=[];for(let t=0;t<3;t++)a.push(ab(e));return t.jetEmitters=a,t.dustTrailEmitter=ab(e),t.mainThrustEmitterFactor=e.readF32(),t.strafeThrustEmitterFactor=e.readF32(),t.reverseThrustEmitterFactor=e.readF32(),t}function aN(e){let t=aB(e);return t.tireRadius=e.readF32(),t.tireStaticFriction=e.readF32(),t.tireKineticFriction=e.readF32(),t.tireRestitution=e.readF32(),t.tireLateralForce=e.readF32(),t.tireLateralDamping=e.readF32(),t.tireLateralRelaxation=e.readF32(),t.tireLongitudinalForce=e.readF32(),t.tireLongitudinalDamping=e.readF32(),t.tireEmitter=ab(e),t.jetSound=ab(e),t.engineSound=ab(e),t.squealSound=ab(e),t.wadeSound=ab(e),t.spring=e.readF32(),t.springDamping=e.readF32(),t.springLength=e.readF32(),t.brakeTorque=e.readF32(),t.engineTorque=e.readF32(),t.engineBrake=e.readF32(),t.maxWheelSpeed=e.readF32(),t.steeringAngle=e.readF32(),t.steeringReturn=e.readF32(),t.steeringDamping=e.readF32(),t.powerSteeringFactor=e.readF32(),t}function aG(e){let t=aC(e);return t.noIndividualDamage=e.readFlag(),t.dynamicTypeField=e.readS32(),t}function aR(e){let t=aG(e);return t.thetaMin=e.readF32(),t.thetaMax=e.readF32(),t.thetaNull=e.readF32(),t.neverUpdateControl=e.readFlag(),t.primaryAxis=e.readRangedU32(0,3),t.maxCapacitorEnergy=e.readF32(),t.capacitorRechargeRate=e.readF32(),t}function aU(e){let t=aw(e);return t.activationMS=e.readInt(8),t.deactivateDelayMS=e.readInt(8),t.degPerSecTheta=e.readRangedU32(0,1080),t.degPerSecPhi=e.readRangedU32(0,1080),t.dontFireInsideDamageRadius=e.readFlag(),t.damageRadius=e.readF32(),t.useCapacitor=e.readFlag(),t}function aj(e){let t=aC(e);return t.friction=e.readFloat(10),t.elasticity=e.readFloat(10),t.sticky=e.readFlag(),e.readFlag()&&(t.gravityMod=e.readFloat(10)),e.readFlag()&&(t.maxVelocity=e.readF32()),e.readFlag()&&(t.lightType=e.readInt(2),t.lightColor={r:e.readFloat(7),g:e.readFloat(7),b:e.readFloat(7),a:e.readFloat(7)},t.lightTime=e.readS32(),t.lightRadius=e.readF32(),t.lightOnlyStatic=e.readFlag()),t}function aA(e){let t={};t.projectileShapeName=e.readString(),t.faceViewerLinkTime=e.readS32(),t.lifetime=e.readS32(),t.faceViewer=e.readFlag(),e.readFlag()&&(t.scale={x:e.readF32(),y:e.readF32(),z:e.readF32()}),t.baseEmitter=ab(e),t.delayEmitter=ab(e),t.bubbleEmitter=ab(e),t.explosion=ab(e),t.underwaterExplosion=ab(e),t.splash=ab(e),t.sound=ab(e),t.wetFireSound=ab(e),t.fireSound=ab(e);let a=[];for(let t=0;t<6;t++)a.push(ab(e));return t.decals=a,e.readFlag()&&(t.lightRadius=e.readFloat(8),t.lightColor={r:e.readFloat(7),g:e.readFloat(7),b:e.readFloat(7)}),e.readFlag()&&(t.underwaterLightColor={r:e.readFloat(7),g:e.readFloat(7),b:e.readFloat(7)}),t.explodeOnWaterImpact=aP(e),t.depthTolerance=e.readF32(),t}function aV(e){let t=aA(e);return t.dryVelocity=e.readF32(),t.wetVelocity=e.readF32(),t.fizzleTime=e.readU32(),t.fizzleType=e.readU32(),t.hardRetarget=e.readFlag(),t.inheritedVelocityScale=e.readRangedU32(0,90),t.lifetimeMS=e.readRangedU32(0,90),t.collideWithOwnerTimeMS=e.readU32(),t.proximityRadius=e.readU32(),t.tracerProjectile=e.readFlag(),t}function aO(e){let t=aA(e);return t.armingDelayMS=e.readS32(),t.muzzleVelocity=e.readF32(),t.grenadeElasticity=e.readF32(),t.grenadeFriction=e.readF32(),t.drag=e.readF32(),t.density=e.readF32(),t.gravityMod=e.readF32(),t.lifetimeMS=e.readS32(),t}function az(e){let t=aA(e);return t.lifetimeMS=e.readS32(),t.muzzleVelocity=e.readF32(),t.turningSpeed=e.readF32(),t.proximityRadius=e.readF32(),t.terrainAvoidanceSpeed=e.readF32(),t.terrainScanAhead=e.readF32(),t.terrainHeightFail=e.readF32(),t.terrainAvoidanceRadius=e.readF32(),t.flareDistance=e.readF32(),t.flareAngle=e.readF32(),t.useFlechette=aP(e),t.maxVelocity=e.readF32(),t.acceleration=e.readF32(),t.flechetteDelayMs=e.readS32(),t.exhaustTimeMs=e.readS32(),t.exhaustNodeName=e.readString(),t.casingShapeName=e.readString(),t.casingDebris=ab(e),t.puffEmitter=ab(e),t.exhaustEmitter=ab(e),t}function aL(e){let t=aA(e);t.maxRifleRange=e.readF32(),t.rifleHeadMultiplier=e.readF32(),t.beamColor=ax(e),t.fadeTime=e.readF32(),t.startBeamWidth=e.readF32(),t.endBeamWidth=e.readF32(),t.pulseBeamWidth=e.readF32(),t.beamFlareAngle=e.readF32(),t.minFlareSize=e.readF32(),t.maxFlareSize=e.readF32(),t.pulseSpeed=e.readF32(),t.pulseLength=e.readF32(),t.lightColor=ax(e),t.lightRadius=e.readF32();let a=[];for(let t=0;t<12;t++)a.push(e.readString());return t.textures=a,t}function aq(e){let t=aA(e);t.zapDuration=e.readF32(),t.boltLength=e.readF32(),t.numParts=e.readF32(),t.lightningFreq=e.readF32(),t.lightningDensity=e.readF32(),t.lightningAmp=e.readF32(),t.lightningWidth=e.readF32(),t.shockwave=ab(e);let a=[],r=[],i=[],n=[];for(let t=0;t<2;t++)a.push(e.readF32()),r.push(e.readF32()),i.push(e.readF32()),n.push(e.readF32());t.startWidth=a,t.endWidth=r,t.boltSpeed=i,t.texWrap=n;let o=[];for(let t=0;t<4;t++)o.push(e.readString());return t.textures=o,t.emitter=ab(e),t}function a_(e){let t=aA(e);return t.beamRange=e.readF32(),t.beamDrainRate=e.readF32(),t.muzzleVelocity=e.readF32(),t.proximityRadius=e.readF32(),t.startWidth=e.readF32(),t.endWidth=e.readF32(),t.mainBeamTexture=e.readString(),t.innerBeamTexture=e.readString(),t.flareTexture=e.readString(),t.hitEmitter=ab(e),t}function aH(e){let t=aA(e);return t.beamRange=e.readF32(),t.beamRepairRate=e.readF32(),t.muzzleVelocity=e.readF32(),t.proximityRadius=e.readF32(),t.startWidth=e.readF32(),t.endWidth=e.readF32(),t.startBeamWidth=e.readF32(),t.endBeamWidth=e.readF32(),t.mainBeamTexture=e.readString(),t.innerBeamTexture=e.readString(),t}function aW(e){let t=aA(e);t.maxRifleRange=e.readF32(),t.beamColor=ax(e),t.startBeamWidth=e.readF32(),t.pulseBeamWidth=e.readF32(),t.beamFlareAngle=e.readF32(),t.minFlareSize=e.readF32(),t.maxFlareSize=e.readF32(),t.pulseSpeed=e.readF32(),t.pulseLength=e.readF32();let a=[];for(let t=0;t<4;t++)a.push(e.readString());return t.textures=a,t}function a$(e){let t=aV(e);return t.tracerLength=e.readF32(),t.tracerAlpha=e.readF32(),t.tracerMinPixels=e.readF32(),t.crossViewFraction=aP(e),t.tracerColor=ax(e),t.tracerWidth=e.readF32(),t.muzzleVelocity=e.readF32(),t.proximityRadius=aP(e),t.textureName0=e.readString(),t.textureName1=e.readString(),t}function aZ(e){let t=aO(e);return t.energyDrainPerSecond=e.readF32(),t.energyMinDrain=e.readF32(),t.beamWidth=e.readF32(),t.beamRange=e.readF32(),t.numSegments=e.readF32(),t.texRepeat=e.readF32(),t.beamFlareAngle=e.readF32(),t.beamTexture=e.readString(),t.flareTexture=e.readString(),t}function aX(e){let t=aV(e);return t.numFlares=e.readF32(),t.flareColor=ax(e),t.flareTexture=e.readString(),t.smokeTexture=e.readString(),t.size=e.readF32(),t.flareModTexture=e.readF32(),t.smokeSize=e.readF32(),t}function aJ(e){let t=aO(e);return t.smokeDist=e.readF32(),t.noSmoke=e.readF32(),t.boomTime=e.readF32(),t.casingDist=e.readF32(),t.smokeCushion=e.readF32(),t.noSmokeCounter=e.readF32(),t.smokeTexture=e.readString(),t.bombTexture=e.readString(),t}function aY(e){let t=aO(e);return t.size=e.readF32(),t.useLensFlare=aP(e),t.flareTexture=e.readString(),t.lensFlareTexture=e.readString(),t}function aQ(e){let t={};t.dtsFileName=e.readString(),t.soundProfile=ab(e),t.particleEmitter=ab(e),t.particleDensity=e.readInt(14),t.particleRadius=e.readF32(),t.faceViewer=e.readFlag(),e.readFlag()&&(t.explosionScale={x:e.readInt(16),y:e.readInt(16),z:e.readInt(16)}),t.playSpeed=e.readInt(14),t.debrisThetaMin=e.readRangedU32(0,180),t.debrisThetaMax=e.readRangedU32(0,180),t.debrisPhiMin=e.readRangedU32(0,360),t.debrisPhiMax=e.readRangedU32(0,360),t.debrisMinVelocity=e.readRangedU32(0,1e3),t.debrisMaxVelocity=e.readRangedU32(0,1e3),t.debrisNum=e.readInt(14),t.debrisVariance=e.readRangedU32(0,1e4),t.delayMS=e.readInt(16),t.delayVariance=e.readInt(16),t.lifetimeMS=e.readInt(16),t.lifetimeVariance=e.readInt(16),t.offset=e.readF32(),t.shakeCamera=e.readFlag(),t.hasLight=e.readFlag(),t.camShakeFreq={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.camShakeAmp={x:e.readF32(),y:e.readF32(),z:e.readF32()},t.camShakeDuration=e.readF32(),t.camShakeRadius=e.readF32(),t.camShakeFalloff=e.readF32(),t.shockwave=ab(e),t.debris=ab(e);let a=[];for(let t=0;t<4;t++)a.push(ab(e));t.emitters=a;let r=[];for(let t=0;t<5;t++)r.push(ab(e));t.subExplosions=r;let i=e.readRangedU32(0,4),n=[];for(let t=0;t0&&ry("DataBlock binding: %d/%d bound, missing parsers: %s",t,e3.length,a.join(", "));const{bound:r,missing:i}=this.registry.bindDeterministicGhosts(e2,0);i.length>0&&ry("Ghost binding: %d/%d bound, missing parsers: %s",r,e2.length,i.join(", "));const{bound:n,missing:o}=this.registry.bindDeterministicEvents(e1,255);o.length>0&&ry("Event binding: %d/%d bound, missing parsers: %s",n,e1.length,o.join(", ")),this.packetParser=new e8(this.registry,this.ghostTracker)}getRegistry(){return this.registry}getGhostTracker(){return this.ghostTracker}getPacketParser(){return this.packetParser}get loaded(){return this._loaded}get header(){if(!this._loaded)throw Error("must call load() first");return this._header}get initialBlock(){if(!this._loaded)throw Error("must call load() first");return this._initialBlock}get blockCount(){if(!this._loaded)throw Error("must call load() first");if(void 0===this._blockCount){let e=this._decompressedData,t=this._decompressedView,a=0,r=0;for(;r+2<=e.length;){let i=4095&t.getUint16(r,!0);if((r+=2+i)>e.length)break;a++}this._blockCount=a}return this._blockCount}get blockCursor(){if(!this._loaded)throw Error("must call load() first");return this._blockCursor}async load(){if(this._loaded)return{header:this._header,initialBlock:this._initialBlock};let e=this.readHeader();ry('header: "%s" version=0x%s length=%dms (%smin) initialBlockSize=%d',e.identString,e.protocolVersion.toString(16),e.demoLengthMs,(e.demoLengthMs/1e3/60).toFixed(1),e.initialBlockSize);let t=this.buffer.subarray(this.offset,this.offset+e.initialBlockSize),a=this.readInitialBlock(t);this.offset+=e.initialBlockSize;let r=this.buffer.subarray(this.offset);ry("compressed block stream: %d bytes",r.length);let i=await new Promise((e,t)=>{var a,i;a=(a,r)=>{a?t(a):e(r)},i||(i=a,a={}),"function"!=typeof i&&T(7),eo(r,a,[ee],function(e){return ei(eP(e.data[0],en(e.data[1])))},1,i)});return ry("decompressed block stream: %d bytes",i.length),this._decompressedData=i,this._decompressedView=new DataView(i.buffer,i.byteOffset,i.byteLength),this.setupPacketParser(a),this._header=e,this._initialBlock=a,this._blockStreamOffset=0,this._blockCursor=0,this._loaded=!0,{header:e,initialBlock:a}}nextBlock(){if(!this._loaded)throw Error("must call load() first");let e=this._decompressedData,t=this._decompressedView,a=this._blockStreamOffset;if(a+2>e.length)return;let r=t.getUint16(a,!0),i=r>>12,n=4095&r;if(a+2+n>e.length)return void rk("block %d: size %d would exceed decompressed data (offset=%d remaining=%d), stopping",this._blockCursor,n,a+2,e.length-a-2);let o=e.subarray(a+2,a+2+n);this._blockStreamOffset=a+2+n;let s={index:this._blockCursor,type:i,size:n,data:o};if(this._blockCursor++,0===i)try{s.parsed=this.packetParser.parsePacket(o)}catch{}else if(1===i)this.packetParser.onSendPacketTrigger();else if(2===i&&64===n)try{s.parsed=this.readRawMove(o)}catch{}else if(3===i&&8===n)try{s.parsed=this.readInfoBlock(o)}catch{}return s}reset(){if(!this._loaded)throw Error("must call load() first");this._blockStreamOffset=0,this._blockCursor=0,this._blockCount=void 0,this.setupPacketParser(this._initialBlock)}processBlocks(e){if(!this._loaded)throw Error("must call load() first");let t=0;for(let a=0;a =128&&t<128+e3.length?e3[t-128]:`unknown(${t})`;throw Error(`No parser for DataBlock classId ${t} (${e}) at bit ${n}`)}}ry("all %d/%d DataBlocks parsed (%d payloads), bit position after DataBlocks: %d",l,n,s.size,r.getCurPos());let d=0!==r.readU8(),c=[];for(let e=0;e<6;e++)c.push(r.readU32());let h=[];for(let e=0;e<16;e++)h.push(r.readU32());let u=r.readU32(),g=[];for(let e=0;e>3<<3),this.readSimpleTargetManager(r),this.readSimpleTargetManager(r),rS('after sequential tail bit=%d mission="%s" CRC=0x%s',r.getCurPos(),B,M.toString(16))}catch(e){a=e instanceof Error?e.message:String(e)}finally{this.ghostTracker=x}let T=b-r.getCurPos(),N=B.length>0?B.split("").filter(e=>{let t=e.charCodeAt(0);return t>=32&&t<=126}).length/B.length:1,G=B.length>0&&N>=.8&&void 0===a;return ry('initial block: events=%d ghosts=%d ghostingSeq=%d controlObj=%d mission="%s" CRC=0x%s valid=%s%s',P.length,w.length,C,E,B,M.toString(16),G,a?` error=${a}`:""),{taggedStrings:i,dataBlockHeaders:o,dataBlockCount:l,dataBlocks:s,firstPerson:d,connectionFields:c,stateArray:h,scoreEntries:g,demoValues:p,sensorGroupColors:f,targetEntries:m,connectionState:F,roundTripTime:v,packetLoss:y,pathManager:S,notifyCount:k,nextRecvEventSeq:D,ghostingSequence:C,initialGhosts:w,initialEvents:P,controlObjectGhostIndex:E,controlObjectData:t,missionName:B,missionCRC:M,phase2TrailingBits:T,phase2Valid:G,phase2Error:a}}readScoreEntry(e){let t=e.readFlag()?e.readInt(16):0,a=e.readFlag()?e.readInt(16):0,r=e.readFlag()?e.readInt(16):0,i=e.readInt(6),n=e.readInt(6),o=e.readInt(6),s=e.readFlag(),l=[];for(let t=0;t<6;t++)l.push(e.readFlag());return{clientId:t,teamId:a,score:r,field0:i,field1:n,field2:o,isBot:s,triggerFlags:l}}readDemoValues(e){let t=[];for(;e.readFlag();)t.push(e.readString());return t}readComplexTargetManager(e){e.readU8(),e.readU8(),e.readU8(),e.readU8();let t=[];for(let a=0;a<32;a++)for(let r=0;r<32;r++)e.readFlag()&&t.push({group:a,targetGroup:r,r:e.readU8(),g:e.readU8(),b:e.readU8(),a:e.readU8()});let a=[];for(let t=0;t<512;t++){if(!e.readFlag())continue;let r={targetId:t,sensorGroup:0,targetData:0,damageLevel:0};e.readFlag()&&(r.sensorData=e.readU32()),e.readFlag()&&(r.voiceMapData=e.readU32()),e.readFlag()&&(r.name=e.readString()),e.readFlag()&&(r.skin=e.readString()),e.readFlag()&&(r.skinPref=e.readString()),e.readFlag()&&(r.voice=e.readString()),e.readFlag()&&(r.typeDescription=e.readString()),r.sensorGroup=e.readInt(5),r.targetData=e.readInt(9),t>=32&&e.readFlag()&&(r.dataBlockRef=e.readInt(11)),r.damageLevel=e.readFloat(7),a.push(r)}return{sensorGroupColors:t,targets:a}}readPathManager(e){let t=[],a=e.readU32();for(let r=0;rthis.registry.getDataBlockParser(e)};t=n.unpack(e,a)}catch{a.push({classId:r,guaranteed:!0,dataBitsStart:i,dataBitsEnd:i});break}else{a.push({classId:r,guaranteed:!0,dataBitsStart:i,dataBitsEnd:i});break}a.push({classId:r,guaranteed:!0,dataBitsStart:i,dataBitsEnd:e.getCurPos(),parsedData:t}),rS(" event classId=%d bits=%d",r,e.getCurPos()-i)}return{nextRecvEventSeq:t,events:a}}readGhostStartBlock(e,t){let a=e.readU32(),r=[];rS("ghost block: seq=%d bit=%d",a,e.getCurPos());let i=this.registry.getGhostCatalog(),n=8*e.getBuffer().length,o=new Map;for(let[e,a]of t)o.set(e,a.data);for(;e.readFlag()&&!e.isError();){let a=e.readInt(10),s=e.readInt(7)+0,l=e.getCurPos(),d=[],c=new Set,{entry:h}=this.identifyGhostViaDataBlock(e,t,i),u=this.registry.getGhostParser(s);u&&(d.push({entry:u,method:"registry"}),c.add(u)),h&&!c.has(h)&&(d.push({entry:h,method:"datablock"}),c.add(h));let g={getDataBlockData:e=>o.get(e),getDataBlockParser:e=>this.registry.getDataBlockParser(e)},p=!1;for(let{entry:t,method:i}of d){let o="registry"===i,d=this.tryGhostParser(e,t,l,n,!1,g,o);if(!1!==d){this.ghostTracker.createGhost(a,s,t.name),rS(" ghost idx=%d classId=%d parser=%s bits=%d via=%s",a,s,t.name,e.getCurPos()-l,i),r.push({index:a,type:"create",classId:s,updateBitsStart:l,updateBitsEnd:e.getCurPos(),parsedData:d}),p=!0;break}}if(!p){rS(" ghost idx=%d classId=%d NO PARSER (stopping at bit=%d, remaining=%d)",a,s,l,n-l);break}}return rS("ghost loop ended at bit=%d remaining=%d count=%d",e.getCurPos(),n-e.getCurPos(),r.length),{ghostingSequence:a,ghosts:r}}tryGhostParser(e,t,a,r,i=!1,n,o=!1){let s=e.savePos();i||rS(" try %s: startBit=%d",t.name,a);try{let l=t.unpackUpdate(e,!0,{compressionPoint:{x:0,y:0,z:0},ghostTracker:this.ghostTracker,...n}),d=e.getCurPos()-a,c=r-e.getCurPos();if(e.isError()||!o&&d<3)return i||rS(" reject %s: bits=%d isError=%s",t.name,d,e.isError()),e.restorePos(s),!1;if(c>1e3){let a=e.getCurPos(),r=e.readFlag();if(e.setCurPos(a),!r)return i||rS(" reject %s: bits=%d misaligned (remaining=%d)",t.name,d,c),e.restorePos(s),!1}return l??{}}catch(a){return i||rS(" reject %s: error at bit=%d: %s",t.name,e.getCurPos(),a instanceof Error?a.message:String(a)),e.restorePos(s),!1}}identifyGhostViaDataBlock(e,t,a){let r;if(!t)return{entry:void 0,dbFlag:!1};let i=e.savePos(),n=!1;try{if(n=e.readFlag()){let i=e.readInt(11),n=t.get(i);if(n){let e=n.className.replace(/Data$/,"");(r=a.get(e))||rS(" identifyGhostViaDataBlock: dbId=%d className=%s ghostName=%s (no ghost parser)",i,n.className,e)}else rS(" identifyGhostViaDataBlock: dbId=%d (no DataBlock found)",i)}else rS(" identifyGhostViaDataBlock: DataBlock flag=0")}catch{}return e.restorePos(i),{entry:r,dbFlag:n}}readRawMove(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),a=t.getInt32(0,!0),r=t.getInt32(4,!0),i=t.getInt32(8,!0),n=t.getUint32(12,!0),o=t.getUint32(16,!0),s=t.getUint32(20,!0),l=t.getFloat32(24,!0),d=t.getFloat32(28,!0),c=t.getFloat32(32,!0),h=t.getFloat32(36,!0),u=t.getFloat32(40,!0),g=t.getFloat32(44,!0),p=t.getUint32(48,!0),f=t.getUint32(52,!0),m=0!==e[56],F=[];for(let t=0;t<6;t++)F.push(0!==e[57+t]);return{px:a,py:r,pz:i,pyaw:n,ppitch:o,proll:s,x:l,y:d,z:c,yaw:h,pitch:u,roll:g,id:p,sendCount:f,freeLook:m,trigger:F}}readInfoBlock(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{value1:t.getUint32(0,!0),value2:t.getFloat32(4,!0)}}}function rI(){let e=new e6,t=new e4;ak(e),t3(e),rv(e),e.bindDeterministicDataBlocks(e3,128),e.bindDeterministicGhosts(e2,0),e.bindDeterministicEvents(e1,255);let a=new e8(e,t,{dataBlockDataMap:new Map});return{registry:e,ghostTracker:t,packetParser:a}}e.s(["DemoParser",()=>rb],58281),e.s(["createLiveParser",()=>rI],45853),e.s([],50593);var rx=e.i(90072);let rP=new Set(["FlyingVehicle","HoverVehicle","WheeledVehicle"]),rD=new Set(["BombProjectile","EnergyProjectile","FlareProjectile","GrenadeProjectile","LinearFlareProjectile","LinearProjectile","Projectile","SeekerProjectile","TracerProjectile"]),rC=new Set(["LinearProjectile","TracerProjectile","LinearFlareProjectile","Projectile"]),rw=new Set(["GrenadeProjectile","EnergyProjectile","FlareProjectile","BombProjectile"]),rE=new Set(["SeekerProjectile"]),rB=new Set(["StaticShape","ScopeAlwaysShape","Turret","BeaconObject","ForceFieldBare"]);function rM(e){return"Player"===e?"Player":rP.has(e)?"Vehicle":"Item"===e?"Item":rD.has(e)?"Projectile":rB.has(e)?"Deployable":"Ghost"}function rT(e,t){return`${e}_${t}`}let rN=Object.freeze({r:0,g:255,b:0}),rG=Object.freeze({r:255,g:0,b:0});e.s(["IFF_GREEN",0,rN,"IFF_RED",0,rG,"TICK_DURATION_MS",0,32,"ballisticProjectileClassNames",0,rw,"linearProjectileClassNames",0,rC,"projectileClassNames",0,rD,"seekerProjectileClassNames",0,rE,"toEntityId",()=>rT,"toEntityType",()=>rM],25311);let rR=new rx.Matrix4,rU=new rx.Quaternion;function rj(e,t,a){return e a?a:e}let rA=.494*Math.PI;function rV(e,t){let a=Math.sin(t),r=Math.cos(t),i=Math.sin(e),n=Math.cos(e);return rR.set(-i,n*a,-n*r,0,0,r,a,0,n,i*a,-i*r,0,0,0,0,1),rU.setFromRotationMatrix(rR),[rU.x,rU.y,rU.z,rU.w]}function rO(e){let t=-e/2;return[0,Math.sin(t),0,Math.cos(t)]}function rz(e){if(!Number.isFinite(e.x)||!Number.isFinite(e.y)||!Number.isFinite(e.z)||!Number.isFinite(e.w))return null;let t=-e.y,a=-e.z,r=-e.x,i=e.w,n=t*t+a*a+r*r+i*i;if(n<=1e-12)return null;let o=1/Math.sqrt(n);return[t*o,a*o,r*o,i*o]}function rL(e){return Math.atan2(2*(e.w*e.z+e.x*e.y),e.w*e.w+e.x*e.x-e.y*e.y-e.z*e.z)}function rq(e){return Math.asin(Math.max(-1,Math.min(1,2*(e.w*e.x-e.y*e.z))))}function r_(e){return null!=e&&Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)}function rH(e){return!!e&&"object"==typeof e&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z}function rW(e){return!!e&&"object"==typeof e&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z&&"number"==typeof e.w}function r$(e,t){let a;if(t)return"string"==typeof(a=rD.has(e)||e.endsWith("ProjectileData")?t.projectileShapeName:"DebrisData"===e?t.shapeFileName:t.shapeName)&&a.length>0?a:void 0}function rZ(e,t){if(e)for(let a of t){let t=e[a];if("number"==typeof t&&Number.isFinite(t))return t}}function rX(e,t){if(e)for(let a of t){let t=e[a];if("string"==typeof t&&t.length>0)return t}}function rJ(e,t){if(!t)return;let a=rX(t,["tracerTex0","textureName0","texture0"])??"";if(!("TracerProjectile"===e||a.length>0&&null!=rZ(t,["tracerLength"]))||!a)return;let r=rX(t,["tracerTex1","textureName1","texture1"]),i=rZ(t,["tracerLength"])??10,n=rZ(t,["tracerWidth"]),o=rZ(t,["tracerAlpha"]),s=null!=n&&(null!=rZ(t,["crossViewAng"])||n<=.7)?n:o??n??.5,l=rZ(t,["crossViewAng","crossViewFraction"])??("number"==typeof t.tracerWidth&&t.tracerWidth>.7?t.tracerWidth:.98);return{kind:"tracer",texture:a,crossTexture:r,tracerLength:i,tracerWidth:s,crossViewAng:l,crossSize:rZ(t,["crossSize","muzzleVelocity"])??.45,renderCross:function(e,t){if(e)for(let a of t){let t=e[a];if("boolean"==typeof t)return t}}(t,["renderCross","proximityRadius"])??!0}}function rY(e,t){if(t){if("LinearFlareProjectile"===e){let e=rX(t,["smokeTexture","flareTexture"]);if(!e)return;let a=t.flareColor,r=rZ(t,["size"])??.5;return{kind:"sprite",texture:e,color:a?{r:a.r,g:a.g,b:a.b}:{r:1,g:1,b:1},size:r}}if("FlareProjectile"===e){let e=rX(t,["flareTexture"]);if(!e)return;return{kind:"sprite",texture:e,color:{r:1,g:.9,b:.5},size:rZ(t,["size"])??4}}}}function rQ(e){let t=e.states;if(Array.isArray(t)&&0!==t.length)return t.map(e=>{let t=e=>null==e?-1:e-1;return{name:e.name??"",transitionOnNotLoaded:t(e.transitionOnAmmo),transitionOnLoaded:t(e.transitionOnNoAmmo),transitionOnNoAmmo:t(e.transitionOnTarget),transitionOnAmmo:t(e.transitionOnNoTarget),transitionOnNoTarget:t(e.transitionOnWet),transitionOnTarget:t(e.transitionOnNotWet),transitionOnNotWet:t(e.transitionOnTriggerUp),transitionOnWet:t(e.transitionOnTriggerDown),transitionOnTriggerUp:t(e.transitionOnTimeout),transitionOnTriggerDown:t(e.transitionGeneric0In),transitionOnTimeout:t(e.transitionGeneric0Out),timeoutValue:e.timeoutValue,waitForTimeout:e.waitForTimeout??!1,fire:e.fire??!1,sequence:e.sequence,spin:e.spin??0,direction:e.direction??!0,scaleAnimation:e.scaleAnimation??!1,loaded:e.loaded??0,soundDataBlockId:e.sound??-1}})}function rK(e){let t="";for(let a=0;a =32&&(t+=e[a]);return t}let r0={2:0,3:1,4:2,5:3,6:4,7:5,8:6,11:7,12:8,14:9};function r3(e){for(let t=0;t =32)break}}function r2(e){let t=[],a=0,r="",i=!1;for(let n=0;n =32&&(r+=e[n]);continue}let s=r0[o];void 0!==s?(r&&(t.push({text:r,colorCode:a}),r=""),a=s):15===o?(r&&(t.push({text:r,colorCode:a}),r=""),a=0):o>=32&&(r+=e[n])}return r&&t.push({text:r,colorCode:a}),t}function r1(e){let t=e.indexOf("~w");return -1===t?{text:e,wavPath:null}:{text:e.substring(0,t),wavPath:e.substring(t+2)}}function r5(e){return e?"number"==typeof e.cameraMode?"camera":"number"==typeof e.rotationZ?"player":null:null}let r8=new Map([["gui/hud_new_packammo",0],["gui/hud_new_packcloak",1],["gui/hud_new_packenergy",2],["gui/hud_new_packrepair",3],["gui/hud_new_packsatchel",4],["gui/hud_new_packshield",5],["gui/hud_new_packinventory",6],["gui/hud_new_packmotionsens",7],["gui/hud_new_packradar",8],["gui/hud_new_packturretout",9],["gui/hud_new_packturretin",10],["gui/hud_new_packsensjam",11],["gui/hud_new_packturret",12],["gui/hud_satchel_unarmed",18]]);function r6(e){let t=e.toLowerCase();for(let[e,a]of r8)if(e===t)return a;return -1}e.s(["CameraMode_OrbitObject",0,3,"MAX_PITCH",0,rA,"backpackBitmapToIndex",()=>r6,"clamp",()=>rj,"detectColorCode",()=>r3,"detectControlObjectType",()=>r5,"extractWavTag",()=>r1,"getNumberField",()=>rZ,"isQuatLike",()=>rW,"isValidPosition",()=>r_,"isVec3Like",()=>rH,"parseColorSegments",()=>r2,"parseWeaponImageStates",()=>rQ,"playerYawToQuaternion",()=>rO,"resolveShapeName",()=>r$,"resolveSpriteVisual",()=>rY,"resolveTracerVisual",()=>rJ,"stripTaggedStringMarkup",()=>rK,"torqueQuatHeading",()=>rL,"torqueQuatPitch",()=>rq,"torqueQuatToThreeJS",()=>rz,"yawPitchToQuaternion",()=>rV],89119),e.i(70847);var r4=e.i(47566);let r7=(0,e.i(25645).createLogger)("StreamEngine");class r9{registry;ghostTracker;entities=new Map;entityIdByGhostIndex=new Map;tickCount=0;camera=null;chatMessages=[];chatMessageIdCounter=0;_chatGen=0;_chatSnapshotGen=-1;_chatSnapshot=[];audioEvents=[];netStrings=new Map;targetNames=new Map;targetTeams=new Map;targetRenderFlags=new Map;pendingNameTags=new Map;sensorGroupColors=new Map;playerSensorGroup=0;lastStatus={health:1,energy:1};latestControl={ghostIndex:-1};controlPlayerGhostId;lastControlType="camera";isPiloting=!1;lastPilotGhostIndex;lastVehicleHeading=0;lastVehiclePitch=0;lastVehicleOrbitDir;lastVehicleVelocity;lastVehiclePosTime=0;lastVehiclePos;firstPerson=!0;lastCameraMode;lastOrbitGhostIndex;lastOrbitDistance;latestFov=90;weaponsHud={slots:new Map,activeIndex:-1};backpackHud={packIndex:-1,active:!1,text:""};inventoryHud={slots:new Map,activeSlot:-1};teamScores=[];playerRoster=new Map;missionDisplayName=null;missionTypeDisplayName=null;gameClassName=null;serverDisplayName=null;connectedPlayerName=null;onMissionInfoChange;nextExplosionId=0;resolveGhostClassName(e,t){if("number"==typeof t){let e=this.registry.getGhostParser(t)?.name;if(e)return e}let a=this.entityIdByGhostIndex.get(e);if(a){let e=this.entities.get(a);if(e?.className)return e.className}let r=this.ghostTracker.getGhost(e);if(r?.className)return r.className}resolveEntityIdForGhostIndex(e){let t=this.entityIdByGhostIndex.get(e);if(t)return t;let a=this.ghostTracker.getGhost(e);if(a)return rT(a.className,e)}resetSharedState(){this.entities.clear(),this.entityIdByGhostIndex.clear(),this.tickCount=0,this.camera=null,this.chatMessages=[],this.chatMessageIdCounter=0,this._chatGen=0,this._chatSnapshotGen=-1,this._chatSnapshot=[],this.audioEvents=[],this.netStrings.clear(),this.targetNames.clear(),this.targetTeams.clear(),this.targetRenderFlags.clear(),this.sensorGroupColors.clear(),this.playerSensorGroup=0,this.lastStatus={health:1,energy:1},this.latestControl={ghostIndex:-1},this.controlPlayerGhostId=void 0,this.lastControlType="camera",this.isPiloting=!1,this.lastPilotGhostIndex=void 0,this.lastVehicleHeading=0,this.lastVehiclePitch=0,this.lastVehicleOrbitDir=void 0,this.lastVehicleVelocity=void 0,this.lastVehiclePosTime=0,this.lastVehiclePos=void 0,this.firstPerson=!0,this.lastCameraMode=void 0,this.lastOrbitGhostIndex=void 0,this.lastOrbitDistance=void 0,this.latestFov=90,this.weaponsHud={slots:new Map,activeIndex:-1},this.backpackHud={packIndex:-1,active:!1,text:""},this.inventoryHud={slots:new Map,activeSlot:-1},this.teamScores=[],this.playerRoster.clear(),this.nextExplosionId=0,this.missionDisplayName=null,this.missionTypeDisplayName=null,this.gameClassName=null,this.serverDisplayName=null,this.connectedPlayerName=null}resolveNetString(e){if(e.length>=2&&1===e.charCodeAt(0)){let t=parseInt(e.slice(1),10);if(Number.isFinite(t))return this.netStrings.get(t)??e}return e}formatRemoteArgs(e,t){let a=this.resolveNetString(e);for(let e=0;e 0&&(this.playerSensorGroup=t.sensorGroup)}if(t){let e=r5(t);if(e&&(this.lastControlType=e),"player"===this.lastControlType)this.isPiloting=!!(t.pilot||null!=t.controlObjectGhost),this.isPiloting&&"number"==typeof t.controlObjectGhost?this.lastPilotGhostIndex=t.controlObjectGhost:this.isPiloting||(this.lastPilotGhostIndex=void 0,this.lastVehicleHeading=0,this.lastVehiclePitch=0,this.lastVehicleOrbitDir=void 0,this.lastVehicleVelocity=void 0,this.lastVehiclePosTime=0,this.lastVehiclePos=void 0);else if(this.isPiloting=!1,"number"==typeof t.cameraMode)if(this.lastCameraMode=t.cameraMode,3===t.cameraMode){"number"==typeof t.orbitObjectGhostIndex&&(this.lastOrbitGhostIndex=t.orbitObjectGhostIndex);let e=t.minOrbitDist,a=t.maxOrbitDist,r=t.curOrbitDist;"number"==typeof e&&"number"==typeof a&&Number.isFinite(e)&&Number.isFinite(a)?this.lastOrbitDistance=Math.max(0,a-e):"number"==typeof r&&Number.isFinite(r)&&(this.lastOrbitDistance=Math.max(0,r))}else this.lastOrbitGhostIndex=void 0,this.lastOrbitDistance=void 0}void 0!==e.cameraFov&&(this.latestFov=e.cameraFov)}processEvent(e,t){let a=e.parsedData;if(!a)return;let r=a.type;if("GhostAlwaysObjectEvent"===r){let e=a.ghostIndex,t=a.classId,r=a.objectData,i=a._hasObjectData,n="number"==typeof t?this.registry.getGhostParser(t)?.name??`classId=${t}`:"?";r7.debug("GhostAlwaysObjectEvent: ghost=%d class=%s hasData=%s %s",e,n,i,r?`keys=[${Object.keys(r).join(",")}]`:"(no data)"),null!=e&&null!=t&&this.processGhostUpdate({index:e,type:"create",classId:t,parsedData:r});return}if("NetStringEvent"===r||"NetStringEvent"===t){let e=a.id,t=a.value;if(null!=e&&"string"==typeof t){this.netStrings.set(e,t);let a=this.pendingNameTags.get(e);if(null!=a){this.pendingNameTags.delete(e);let r=rK(t);for(let e of(this.targetNames.set(a,r),this.entities.values()))e.targetId===a&&(e.playerName=r)}}return}if("TargetInfoEvent"===r||"TargetInfoEvent"===t){let e=a.targetId,t=a.nameTag;if(null!=e&&null!=t){let a=this.netStrings.get(t);a?this.targetNames.set(e,rK(a)):this.pendingNameTags.set(t,e)}let r=a.sensorGroup;null!=e&&null!=r&&this.targetTeams.set(e,r);let i=a.renderFlags;if(null!=e&&null!=i&&this.targetRenderFlags.set(e,i),null!=e){let t=this.targetNames.get(e),a=this.targetTeams.get(e),r=this.targetRenderFlags.get(e);for(let i of this.entities.values())i.targetId===e&&(t&&(i.playerName=t),null!=a&&(i.sensorGroup=a),null!=r&&(i.targetRenderFlags=r))}return}if("SetSensorGroupEvent"===r||"SetSensorGroupEvent"===t){let e=a.sensorGroup;null!=e&&(this.playerSensorGroup=e);return}if("SensorGroupColorEvent"===r||"SensorGroupColorEvent"===t){let e=a.sensorGroup,t=a.colors;if(t){let a=this.sensorGroupColors.get(e);for(let r of(a||(a=new Map,this.sensorGroupColors.set(e,a)),t))r.default?a.delete(r.index):a.set(r.index,{r:r.r??0,g:r.g??0,b:r.b??0})}return}if("RemoteCommandEvent"===r||"RemoteCommandEvent"===t){let e=this.resolveNetString(a.funcName),t=a.args,r=this.getTimeSec();if("ChatMessage"===e&&t.length>=4){let e=r3(this.resolveNetString(t[3])),a=t[4]?rK(this.resolveNetString(t[4])):"",i=this.formatRemoteArgs(t[3],t.slice(4));if(i){let n,o,s=i.indexOf(": "),{text:l,wavPath:d}=r1(s>=0?i.slice(s+2):i);if(d){let e=this.resolveNetString(t[1]);n=e?`voice/${e}/${d}.wav`:d;let a=this.resolveNetString(t[2]);if(a){let e=parseFloat(a);Number.isFinite(e)&&(o=Math.max(.5,Math.min(2,e)))}}let c=e??0;this.pushChatMessage({timeSec:r,sender:a,text:l,kind:"chat",colorCode:c,segments:[{text:a?`${a}: ${l}`:l,colorCode:c}],soundPath:n,soundPitch:o})}}else if("CannedChatMessage"===e&&t.length>=6){let e=r3(this.resolveNetString(t[1])),a=rK(this.resolveNetString(t[2])),i=rK(this.resolveNetString(t[4])),n=this.formatRemoteArgs(t[1],t.slice(2));if(n){let o,s,{wavPath:l}=r1(n),d=r1(rK(this.resolveNetString(t[3]))).text;if(l){let e=this.resolveNetString(t[5]);if(o=e?`voice/${e}/${l}.wav`:l,t[6]){let e=parseFloat(this.resolveNetString(t[6]));Number.isFinite(e)&&(s=Math.max(.5,Math.min(2,e)))}}let c=e??0,h=[];i&&h.push({text:`[${i}] `,colorCode:0}),h.push({text:a?`${a}: ${d}`:d,colorCode:c}),this.pushChatMessage({timeSec:r,sender:a,text:d,kind:"chat",colorCode:c,segments:h,soundPath:o,soundPitch:s})}}else if("ServerMessage"===e&&t.length>=2){this.handleServerMessage(t);let e=r3(this.resolveNetString(t[1])),a=this.formatRemoteArgs(t[1],t.slice(2));if(a){let{text:t,wavPath:i}=r1(a),n=e??0;this.pushChatMessage({timeSec:r,sender:"",text:t,kind:"server",colorCode:n,segments:[{text:t,colorCode:n}],soundPath:i??void 0})}}else this.handleHudRemoteCommand(e,t);return}if("Sim3DAudioEvent"===r||"Sim2DAudioEvent"===r||"Sim3DAudioEvent"===t||"Sim2DAudioEvent"===t){let e=a.profileId;if("number"==typeof e){let i=this.getTimeSec(),n="Sim3DAudioEvent"===r||"Sim3DAudioEvent"===t?a.position:void 0;this.audioEvents.push({profileId:e,position:n,timeSec:i}),this.audioEvents.length>100&&this.audioEvents.splice(0,this.audioEvents.length-100)}}}processGhostUpdate(e){let t,a=e.index,r=this.entityIdByGhostIndex.get(a);if(r){let t=this.entities.get(r);t&&"Projectile"===t.type&&!t.hasExploded&&null!=t.explosionDataBlockId&&t.position&&("delete"===e.type||"create"===e.type)&&this.spawnExplosion(t,[...t.position])}if("delete"===e.type){r&&(this.removeSoundSlotEntities(r),this.entities.delete(r),this.entityIdByGhostIndex.delete(a));return}let i=this.resolveGhostClassName(a,e.classId);if(!i){if("create"===e.type)throw Error(`No ghost parser for classId ${e.classId} (ghost index ${a})`);return}let n=rT(i,a);r&&r!==n&&(this.removeSoundSlotEntities(r),this.entities.delete(r));let o=this.entities.get(n);if(o&&"create"===e.type?(this.removeSoundSlotEntities(n),o.spawnTick=this.tickCount,this.resetEntity(o),t=o):o?t=o:(t={id:n,ghostIndex:a,className:i,spawnTick:this.tickCount,type:rM(i),rotation:[0,0,0,1]},this.entities.set(n,t)),t.ghostIndex=a,t.className=i,t.type=rM(i),this.entityIdByGhostIndex.set(a,n),this.applyGhostData(t,e.parsedData),"create"===e.type&&e.parsedData){let r=(0,r4.ghostToSceneObject)(i,a,e.parsedData);r&&(t.sceneData=r)}}resetEntity(e){e.rotation=[0,0,0,1],e.hasExploded=void 0,e.explosionShape=void 0,e.explosionLifetimeTicks=void 0,e.faceViewer=void 0,e.simulatedVelocity=void 0,e.projectilePhysics=void 0,e.gravityMod=void 0,e.direction=void 0,e.velocity=void 0,e.position=void 0,e.dataBlock=void 0,e.dataBlockId=void 0,e.shapeHint=void 0,e.visual=void 0,e.targetId=void 0,e.targetRenderFlags=void 0,e.carryingFlag=void 0,e.sensorGroup=void 0,e.playerName=void 0,e.weaponShape=void 0,e.packShape=void 0,e.falling=void 0,e.jetting=void 0,e.weaponImageState=void 0,e.weaponImageStates=void 0,e.weaponImageStatesDbId=void 0,e.itemPhysics=void 0,e.threads=void 0,e.headPitch=void 0,e.headYaw=void 0,e.health=void 0,e.energy=void 0,e.maxEnergy=void 0,e.damageState=void 0,e.actionAnim=void 0,e.actionAtEnd=void 0,e.explosionDataBlockId=void 0,e.maintainEmitterId=void 0}applyGhostData(e,t){if(!t)return;let a=t.dataBlockId;if(null!=a){e.dataBlockId=a;let t=this.getDataBlockData(a),r=r$(e.className,t);if(e.visual=rJ(e.className,t)??rY(e.className,t),"string"==typeof r&&(e.shapeHint=r,e.dataBlock=r),"Player"===e.type&&"number"==typeof t?.maxEnergy&&(e.maxEnergy=t.maxEnergy),"Projectile"===e.type&&(rC.has(e.className)?e.projectilePhysics="linear":rw.has(e.className)?(e.projectilePhysics="ballistic",e.gravityMod=rZ(t,["gravityMod"])??1):rE.has(e.className)&&(e.projectilePhysics="seeker")),"Projectile"===e.type&&null==e.explosionDataBlockId){let t=this.resolveExplosionInfo(a);t&&(e.explosionShape=t.shape,e.faceViewer=t.faceViewer,e.explosionLifetimeTicks=t.lifetimeTicks,e.explosionDataBlockId=t.explosionDataBlockId)}if("Projectile"===e.type&&null==e.maintainEmitterId){let a=t?.baseEmitter;"number"==typeof a&&a>0&&(e.maintainEmitterId=a)}}if("Player"===e.type){let a=t.images;if(Array.isArray(a)&&a.length>0){let t=a.find(e=>0===e.index);if(t?.dataBlockId&&t.dataBlockId>0){let a=this.getDataBlockData(t.dataBlockId),r=r$("ShapeBaseImageData",a);if(r){let t=a?.mountPoint;(null==t||t<=0)&&!/pack_/i.test(r)&&(e.weaponShape=r)}let i=e.weaponImageState;e.weaponImageState={dataBlockId:t.dataBlockId,triggerDown:t.triggerDown??i?.triggerDown??!1,ammo:t.ammo??i?.ammo??!0,loaded:t.loaded??i?.loaded??!0,target:t.target??i?.target??!1,wet:t.wet??i?.wet??!1,fireCount:t.fireCount??i?.fireCount??0},a&&e.weaponImageStatesDbId!==t.dataBlockId&&(e.weaponImageStates=rQ(a),e.weaponImageStatesDbId=t.dataBlockId)}else t&&!t.dataBlockId&&(e.weaponShape=void 0,e.weaponImageState=void 0,e.weaponImageStates=void 0);let r=a.find(e=>2===e.index);if(r?.dataBlockId&&r.dataBlockId>0){let t=r$("ShapeBaseImageData",this.getDataBlockData(r.dataBlockId));t&&(e.packShape=t)}else r&&!r.dataBlockId&&(e.packShape=void 0);let i=a.find(e=>3===e.index);if(i?.dataBlockId&&i.dataBlockId>0){e.carryingFlag=!0;let t=r$("ShapeBaseImageData",this.getDataBlockData(i.dataBlockId));if(t&&(e.flagShape=t),null!=e.targetId&&e.targetId>=0){let t=this.targetRenderFlags.get(e.targetId)??0,a=2|t;a!==t&&(this.targetRenderFlags.set(e.targetId,a),e.targetRenderFlags=a)}}else if(i&&!i.dataBlockId&&(e.carryingFlag=!1,e.flagShape=void 0,null!=e.targetId&&e.targetId>=0)){let t=this.targetRenderFlags.get(e.targetId)??0,a=-3&t;a!==t&&(this.targetRenderFlags.set(e.targetId,a),e.targetRenderFlags=a)}}}let r=r_(t.position)?t.position:r_(t.initialPosition)?t.initialPosition:r_(t.explodePosition)?t.explodePosition:r_(t.endPoint)?t.endPoint:r_(t.transform?.position)?t.transform.position:void 0;r&&(e.position=[r.x,r.y,r.z],this.updateSoundSlotPositions(e));let i=rH(t.direction)?t.direction:void 0;if(i&&(e.direction=[i.x,i.y,i.z]),"Player"===e.type&&"number"==typeof t.rotationZ&&(e.rotation=rO(t.rotationZ)),"Player"===e.type&&("number"==typeof t.headX&&(e.headPitch=t.headX),"number"==typeof t.headZ&&(e.headYaw=t.headZ)),rW(t.angPosition)){let a=rz(t.angPosition);a&&(e.rotation=a)}else if(rW(t.transform?.rotation)){let a=rz(t.transform.rotation);a&&(e.rotation=a)}else if("Item"===e.type&&"number"==typeof t.rotation?.angle){let a=t.rotation;e.rotation=rO((a.zSign??1)*a.angle)}else if("Projectile"===e.type){let a=t.velocity??t.direction??(r_(t.initialPosition)&&r_(t.endPos)?{x:t.endPos.x-t.initialPosition.x,y:t.endPos.y-t.initialPosition.y,z:t.endPos.z-t.initialPosition.z}:void 0);rH(a)&&(0!==a.x||0!==a.y)&&(e.rotation=rO(Math.atan2(a.x,a.y)))}if(rH(t.velocity)&&(e.velocity=[t.velocity.x,t.velocity.y,t.velocity.z],e.direction||(e.direction=[t.velocity.x,t.velocity.y,t.velocity.z])),"boolean"==typeof t.moveFlag0&&(e.falling=t.moveFlag0),"boolean"==typeof t.moveFlag1&&(e.jetting=t.moveFlag1),"Item"===e.type){let a=t.atRest;!1===a&&rH(t.velocity)?e.itemPhysics={velocity:[t.velocity.x,t.velocity.y,t.velocity.z],atRest:!1}:!0===a&&(e.itemPhysics=void 0)}if(e.projectilePhysics){if("linear"===e.projectilePhysics){let a=rZ(null!=e.dataBlockId?this.getDataBlockData(e.dataBlockId):void 0,["dryVelocity","muzzleVelocity","bulletVelocity"])??80,r=e.direction??[0,1,0],i=r[0]*a,n=r[1]*a,o=r[2]*a,s=t.excessVel,l=t.excessDir;"number"==typeof s&&s>0&&rH(l)&&(i+=l.x*s,n+=l.y*s,o+=l.z*s),e.simulatedVelocity=[i,n,o]}else rH(t.velocity)&&(e.simulatedVelocity=[t.velocity.x,t.velocity.y,t.velocity.z]);let a=t.currTick;if("number"==typeof a&&a>0&&e.simulatedVelocity&&e.position){let t=.032*a,r=e.simulatedVelocity;if(e.position[0]+=r[0]*t,e.position[1]+=r[1]*t,e.position[2]+=r[2]*t,"ballistic"===e.projectilePhysics){let a=-9.81*(e.gravityMod??1);e.position[2]+=.5*a*t*t,r[2]+=a*t}}}let n=r_(t.explodePosition)?t.explodePosition:r_(t.explodePoint)?t.explodePoint:void 0;if("Projectile"===e.type&&!e.hasExploded&&n&&null!=e.explosionDataBlockId&&this.spawnExplosion(e,[n.x,n.y,n.z]),"number"==typeof t.damageLevel&&(e.health=rj(1-t.damageLevel,0,1)),"number"==typeof t.damageState&&(e.damageState=t.damageState),"number"==typeof t.action&&(e.actionAnim=t.action,e.actionAtEnd=!!t.actionAtEnd),Array.isArray(t.threads)){let a=t.threads;if(e.threads){let t=[...e.threads];for(let e of a){let a=t.findIndex(t=>t.index===e.index);a>=0?t[a]=e:t.push(e)}e.threads=t}else e.threads=a}if("number"==typeof t.energy&&(e.energy=rj(t.energy,0,1)),"number"==typeof t.targetId){e.targetId=t.targetId;let a=this.targetNames.get(t.targetId);a&&(e.playerName=a);let r=this.targetTeams.get(t.targetId);null!=r&&(e.sensorGroup=r,e.ghostIndex===this.latestControl.ghostIndex&&"player"===this.lastControlType&&(this.playerSensorGroup=r));let i=this.targetRenderFlags.get(t.targetId);null!=i&&(e.targetRenderFlags=i)}let o=t.sounds;Array.isArray(o)&&this.syncSoundSlotEntities(e,o),"WayPoint"===e.className&&"string"==typeof t.name&&(e.label=t.name),"AudioEmitter"===e.className&&("string"==typeof t.filename&&(e.audioFileName=t.filename),"number"==typeof t.volume&&(e.audioVolume=t.volume),"boolean"==typeof t.is3D&&(e.audioIs3D=t.is3D),"boolean"==typeof t.isLooping&&(e.audioIsLooping=t.isLooping),"number"==typeof t.minDistance&&(e.audioMinDistance=t.minDistance),"number"==typeof t.maxDistance&&(e.audioMaxDistance=t.maxDistance),"number"==typeof t.minLoopGap&&(e.audioMinLoopGap=t.minLoopGap),"number"==typeof t.maxLoopGap&&(e.audioMaxLoopGap=t.maxLoopGap))}syncSoundSlotEntities(e,t){for(let a of t){let t=`${e.id}:sound:${a.index}`;if(a.playing&&"number"==typeof a.profileId){let r=this.getDataBlockData(a.profileId),i=r?.filename;if(!i)continue;let n=i.endsWith(".wav")?i:`${i}.wav`,o=r.description,s=null!=o?this.getDataBlockData(o):void 0,l=this.entities.get(t);l?l.position=e.position:this.entities.set(t,{id:t,ghostIndex:e.ghostIndex,className:"AudioEmitter",type:"AudioEmitter",spawnTick:this.tickCount,position:e.position,rotation:[0,0,0,1],audioFileName:n,audioVolume:s?.volume??1,audioIs3D:s?.is3D??!0,audioIsLooping:s?.isLooping??!1,audioMinDistance:s?.referenceDistance??20,audioMaxDistance:s?.maxDistance??100,audioMinLoopGap:s?.minLoopGap??0,audioMaxLoopGap:s?.maxLoopGap??0})}else this.entities.delete(t)}}updateSoundSlotPositions(e){for(let t=0;t<4;t++){let a=this.entities.get(`${e.id}:sound:${t}`);a&&(a.position=e.position)}}removeSoundSlotEntities(e){for(let t=0;t<4;t++)this.entities.delete(`${e}:sound:${t}`)}resolveExplosionInfo(e){let t=this.getDataBlockData(e);if(!t)return;let a=t.explosion;if(null==a)return;let r=this.getDataBlockData(a);if(!r)return;let i=r.dtsFileName||void 0,n=r.lifetimeMS??31;return{shape:i,faceViewer:!1!==r.faceViewer&&0!==r.faceViewer,lifetimeTicks:n,explosionDataBlockId:a}}spawnExplosion(e,t){e.hasExploded=!0;let a=e.explosionLifetimeTicks??31,r=`fx_${this.nextExplosionId++}`,i={id:r,ghostIndex:-1,className:"Explosion",spawnTick:this.tickCount,type:"Explosion",dataBlock:e.explosionShape,explosionDataBlockId:e.explosionDataBlockId,position:t,rotation:[0,0,0,1],isExplosion:!0,faceViewer:!1!==e.faceViewer,expiryTick:this.tickCount+a};if(this.entities.set(r,i),null!=e.explosionDataBlockId){let a=this.getDataBlockData(e.explosionDataBlockId),r=a?.subExplosions;if(Array.isArray(r))for(let e of r){if(null==e)continue;let a=this.getDataBlockData(e);if(!a)continue;let r=a.dtsFileName||void 0;if(!r)continue;let i=a.lifetimeMS??31,n=a.offset??0,o=Math.random()*Math.PI*2,s=[t[0]+Math.cos(o)*n,t[1]+Math.sin(o)*n,t[2]],l=`fx_${this.nextExplosionId++}`,d={id:l,ghostIndex:-1,className:"Explosion",spawnTick:this.tickCount,type:"Explosion",dataBlock:r,explosionDataBlockId:e,position:s,rotation:[0,0,0,1],isExplosion:!0,faceViewer:!1!==a.faceViewer&&0!==a.faceViewer,expiryTick:this.tickCount+i};this.entities.set(l,d)}}e.position=void 0,e.simulatedVelocity=void 0}advanceProjectiles(){for(let e of this.entities.values()){if(!e.simulatedVelocity||!e.position)continue;let t=e.simulatedVelocity,a=e.position;"ballistic"===e.projectilePhysics&&(t[2]+=-9.81*(e.gravityMod??1)*.032),a[0]+=.032*t[0],a[1]+=.032*t[1],a[2]+=.032*t[2],(0!==t[0]||0!==t[1])&&(e.rotation=rO(Math.atan2(t[0],t[1])))}}advanceItems(){for(let e of this.entities.values()){let t=e.itemPhysics;if(!t||t.atRest||!e.position)continue;let a=t.velocity,r=e.position;r[0]+=.032*a[0],r[1]+=.032*a[1],r[2]+=.032*a[2]}}removeExpiredExplosions(){for(let[e,t]of this.entities)t.isExplosion&&null!=t.expiryTick&&this.tickCount>=t.expiryTick&&this.entities.delete(e)}updateCameraAndHud(){let e=this.latestControl,t=this.getTimeSec(),a=e.data,r=this.lastControlType;if(this.removeExpiredExplosions(),e.position){let{yaw:i,pitch:n}=this.getCameraYawPitch(a);if(this.isPiloting){if(a){let e=a.controlObjectData,t=e?.angPosition;if(t&&"number"==typeof t.w){this.lastVehicleHeading=rL(t),this.lastVehiclePitch=rq(t);let e=rz(t);if(e){let[t,a,r,i]=e;this.lastVehicleOrbitDir=[-(1-2*(a*a+r*r)),-(2*(t*a+r*i)),-(2*(t*r-a*i))]}}}i=this.lastVehicleHeading,n=this.lastVehiclePitch}if(this.camera={time:t,position:[e.position.x,e.position.y,e.position.z],rotation:rV(i,rj(n,-rA,rA)),fov:this.latestFov,mode:"observer",yaw:i,pitch:n},"camera"===r)if(("number"==typeof a?.cameraMode?a.cameraMode:this.lastCameraMode)===3){this.camera.mode="third-person","number"==typeof this.lastOrbitDistance&&(this.camera.orbitDistance=this.lastOrbitDistance);let e="number"==typeof a?.orbitObjectGhostIndex?a.orbitObjectGhostIndex:this.lastOrbitGhostIndex;"number"==typeof e&&e>=0&&(this.camera.orbitTargetId=this.resolveEntityIdForGhostIndex(e))}else this.camera.mode="observer";else e.ghostIndex>=0&&(this.controlPlayerGhostId=this.resolveEntityIdForGhostIndex(e.ghostIndex)),this.firstPerson?this.camera.mode="first-person":(this.camera.mode="third-person",this.isPiloting&&null!=this.lastPilotGhostIndex?(this.camera.orbitTargetId=this.resolveEntityIdForGhostIndex(this.lastPilotGhostIndex),this.camera.orbitDistance=15,this.lastVehicleOrbitDir&&(this.camera.orbitDirection=this.lastVehicleOrbitDir)):(this.camera.orbitTargetId=this.controlPlayerGhostId,this.camera.orbitDistance=3)),this.controlPlayerGhostId&&(this.camera.controlEntityId=this.controlPlayerGhostId);if("player"===r&&e.position){if(this.isPiloting&&null!=this.lastPilotGhostIndex){let r=this.resolveEntityIdForGhostIndex(this.lastPilotGhostIndex),i=r?this.entities.get(r):void 0;if(i){let r=a?.controlObjectData;if(r){i.position=[e.position.x,e.position.y,e.position.z],this.lastVehiclePos=i.position.slice(),this.lastVehiclePosTime=t;let a=r.linMomentum;if(a&&r_(a)){let e=i.dataBlockId,t=null!=e?this.getDataBlockData(e):void 0,r=t?.mass??200,n=r>0?1/r:.005;this.lastVehicleVelocity=[a.x*n,a.y*n,a.z*n],i.velocity=this.lastVehicleVelocity}let n=r.angPosition;if(n&&"number"==typeof n.w){let e=rz(n);e&&(i.rotation=e)}}else if(this.lastVehiclePos&&this.lastVehicleVelocity&&this.lastVehiclePosTime>0){let e=t-this.lastVehiclePosTime;if(e>0&&e<1){let[t,a,r]=this.lastVehicleVelocity;i.position=[this.lastVehiclePos[0]+t*e,this.lastVehiclePos[1]+a*e,this.lastVehiclePos[2]+r*e]}}}}else if(this.controlPlayerGhostId){let t=this.entities.get(this.controlPlayerGhostId);if(t){t.position=[e.position.x,e.position.y,e.position.z],t.rotation=rO(i),t.headPitch=this.getControlPlayerHeadPitch(n);let r=a?.velocity;rH(r)&&(t.velocity=[r.x,r.y,r.z],t.falling=r.z<-10)}}}}else this.camera&&(this.camera={...this.camera,time:t,fov:this.latestFov});let i={health:1,energy:1};if(this.camera?.mode==="first-person"){let e=this.controlPlayerGhostId,t=e?this.entities.get(e):void 0;i.health=t?.health??1;let r=a?.energyLevel;if("number"==typeof r){let e=t?.maxEnergy??60;e>0&&(i.energy=rj(r/e,0,1))}else i.energy=t?.energy??1}else if(this.camera?.mode==="third-person"&&this.camera.orbitTargetId){let e=this.entities.get(this.camera.orbitTargetId);i.health=e?.health??1,i.energy=e?.energy??1}this.lastStatus=i}getControlPlayerHeadPitch(e){return rj(e/rA,-1,1)}getAbsoluteRotation(e){return e?"number"==typeof e.rotationZ&&"number"==typeof e.headX?{yaw:e.rotationZ,pitch:e.headX}:"number"==typeof e.rotZ&&"number"==typeof e.rotX?{yaw:e.rotZ,pitch:e.rotX}:null:null}resolveIffColor(e){if(0===this.playerSensorGroup)return;let t=this.sensorGroupColors.get(this.playerSensorGroup);if(t){let a=t.get(e);if(a)return a}return e===this.playerSensorGroup?rN:0!==e?rG:void 0}pushChatMessage(e){this.chatMessages.push({...e,id:++this.chatMessageIdCounter}),this.chatMessages.length>200&&this.chatMessages.splice(0,this.chatMessages.length-200),this._chatGen++}handleServerMessage(e){if(e.length<2)return;let t=this.resolveNetString(e[0]);if("MsgTeamScoreIs"===t&&e.length>=4){let t=parseInt(this.resolveNetString(e[2]),10),a=parseInt(this.resolveNetString(e[3]),10);if(!isNaN(t)&&!isNaN(a)){let e=this.teamScores.find(e=>e.teamId===t);e&&(e.score=a,this.onTeamScoresChanged())}}else if("MsgCTFAddTeam"===t&&e.length>=6){let t=parseInt(this.resolveNetString(e[2]),10),a=rK(this.resolveNetString(e[3])),r=parseInt(this.resolveNetString(e[5]),10);if(!isNaN(t)){let e=t+1,i=this.teamScores.find(t=>t.teamId===e);i?(i.name=a,i.score=isNaN(r)?i.score:r):this.teamScores.push({teamId:e,name:a,score:isNaN(r)?0:r,playerCount:0}),this.onTeamScoresChanged()}}else if("MsgClientJoin"===t&&e.length>=4){let t=rK(this.resolveNetString(e[2])).trim(),a=parseInt(this.resolveNetString(e[3]),10);if(!isNaN(a)){let e=this.playerRoster.get(a);this.playerRoster.set(a,{name:t,teamId:e?.teamId??0}),this.onRosterChanged()}!this.connectedPlayerName&&t&&(this.connectedPlayerName=t,this.onMissionInfoChange?.())}else if("MsgClientDrop"===t&&e.length>=3){let t=parseInt(this.resolveNetString(e[2]),10);isNaN(t)||(this.playerRoster.delete(t),this.onRosterChanged())}else if("MsgClientJoinTeam"===t&&e.length>=4){let t=parseInt(this.resolveNetString(e[2]),10),a=parseInt(this.resolveNetString(e[3]),10);if(!isNaN(t)&&!isNaN(a)){let e=this.playerRoster.get(t);e?e.teamId=a:this.playerRoster.set(t,{name:"",teamId:a}),this.onRosterChanged()}}else if("MsgMissionDropInfo"===t&&e.length>=5){let t=rK(this.resolveNetString(e[2])),a=rK(this.resolveNetString(e[3])),r=rK(this.resolveNetString(e[4]));r7.info("mission drop info: mission=%s gameType=%s server=%s",t,a,r),this.missionDisplayName=t||this.missionDisplayName,this.missionTypeDisplayName=a||this.missionTypeDisplayName,this.serverDisplayName=r||this.serverDisplayName,this.onMissionInfoChange?.()}else if("MsgLoadInfo"===t&&e.length>=5){let t=rK(this.resolveNetString(e[3])),a=rK(this.resolveNetString(e[4]));r7.info("load info: mission=%s gameType=%s",t,a),this.missionDisplayName=t||this.missionDisplayName,this.missionTypeDisplayName=a||this.missionTypeDisplayName,this.onMissionInfoChange?.()}else if("MsgClientReady"===t&&e.length>=3){let t=this.resolveNetString(e[2]);r7.info("client ready: gameClass=%s",t),this.gameClassName=t||this.gameClassName,this.onMissionInfoChange?.()}}onTeamScoresChanged(){}onRosterChanged(){}handleHudRemoteCommand(e,t){if("setWeaponsHudItem"===e&&t.length>=3){let e=parseInt(t[0],10),a=parseInt(t[1],10),r="1"===t[2]||"true"===t[2];isNaN(e)||(r?this.weaponsHud.slots.set(e,isNaN(a)?-1:a):this.weaponsHud.slots.delete(e),this.onWeaponsHudChanged())}else if("setWeaponsHudAmmo"===e&&t.length>=2){let e=parseInt(t[0],10),a=parseInt(t[1],10);isNaN(e)||(this.weaponsHud.slots.set(e,isNaN(a)?-1:a),this.onWeaponsHudChanged())}else if("setWeaponsHudActive"===e&&t.length>=1){let e=parseInt(t[0],10);this.weaponsHud.activeIndex=isNaN(e)?-1:e,isNaN(e)||!(e>=0)||this.weaponsHud.slots.has(e)||this.weaponsHud.slots.set(e,-1),this.onWeaponsHudChanged()}else if("setWeaponsHudClearAll"===e)this.weaponsHud.slots.clear(),this.weaponsHud.activeIndex=-1,this.onWeaponsHudChanged();else if("setBackpackHudItem"===e&&t.length>=2){let e=parseInt(t[0],10);"1"!==t[1]&&"true"!==t[1]||isNaN(e)?this.backpackHud.packIndex=-1:this.backpackHud.packIndex=e,this.backpackHud.active=!1,this.backpackHud.text=""}else if("setSatchelArmed"===e)this.backpackHud.active=!0;else if("setCloakIconOn"===e||"setRepairPackIconOn"===e||"setShieldIconOn"===e||"setSenJamIconOn"===e)this.backpackHud.active=!0;else if("setCloakIconOff"===e||"setRepairPackIconOff"===e||"setShieldIconOff"===e||"setSenJamIconOff"===e)this.backpackHud.active=!1;else if("updatePackText"===e&&t.length>=1)this.backpackHud.text=t[0]??"";else if("setInventoryHudItem"===e&&t.length>=3){let e=parseInt(t[0],10),a=parseInt(t[1],10),r="1"===t[2]||"true"===t[2];isNaN(e)||(r&&!isNaN(a)?this.inventoryHud.slots.set(e,a):this.inventoryHud.slots.delete(e),this.onInventoryHudChanged())}else if("setInventoryHudAmount"===e&&t.length>=2){let e=parseInt(t[0],10),a=parseInt(t[1],10);isNaN(e)||isNaN(a)||(this.inventoryHud.slots.set(e,a),this.onInventoryHudChanged())}else"setInventoryHudClearAll"===e&&(this.inventoryHud.slots.clear(),this.inventoryHud.activeSlot=-1,this.onInventoryHudChanged())}onWeaponsHudChanged(){}onInventoryHudChanged(){}buildEntityList(e){let t=[];for(let a of this.entities.values()){if(e&&!e(a))continue;let r=null!=a.targetId&&a.targetId>=0?this.targetRenderFlags.get(a.targetId)??a.targetRenderFlags:a.targetRenderFlags;"Player"!==a.type||a.carryingFlag||(r=null!=r?-3&r:r),t.push({id:a.id,type:a.type,visual:a.visual,direction:a.direction,ghostIndex:a.ghostIndex,className:a.className,dataBlockId:a.dataBlockId,shapeHint:a.shapeHint,dataBlock:a.dataBlock,weaponShape:a.weaponShape,packShape:a.packShape,flagShape:a.flagShape,falling:a.falling,jetting:a.jetting,playerName:a.playerName,targetRenderFlags:r,iffColor:("Player"===a.type||((r??0)&2)!=0)&&null!=a.sensorGroup?this.resolveIffColor(a.sensorGroup):void 0,position:a.position&&(a.simulatedVelocity||a.itemPhysics&&!a.itemPhysics.atRest)?[...a.position]:a.position,rotation:a.rotation,velocity:a.velocity,health:a.health,energy:a.energy,actionAnim:a.actionAnim,actionAtEnd:a.actionAtEnd,damageState:a.damageState,faceViewer:a.faceViewer,threads:a.threads,explosionDataBlockId:a.explosionDataBlockId,maintainEmitterId:a.maintainEmitterId,weaponImageState:a.weaponImageState,weaponImageStates:a.weaponImageStates,headPitch:a.headPitch,headYaw:a.headYaw,label:a.label,audioFileName:a.audioFileName,audioVolume:a.audioVolume,audioIs3D:a.audioIs3D,audioIsLooping:a.audioIsLooping,audioMinDistance:a.audioMinDistance,audioMaxDistance:a.audioMaxDistance,audioMinLoopGap:a.audioMinLoopGap,audioMaxLoopGap:a.audioMaxLoopGap,sceneData:a.sceneData})}return t}buildHudState(){let e={slots:Array.from(this.weaponsHud.slots.entries()).map(([e,t])=>({index:e,ammo:t})),activeIndex:this.weaponsHud.activeIndex},t={slots:Array.from(this.inventoryHud.slots.entries()).map(([e,t])=>({slot:e,count:t})),activeSlot:this.inventoryHud.activeSlot},a=this.backpackHud.packIndex>=0?{...this.backpackHud}:null,r=this.teamScores.map(e=>({...e})),i=new Map;for(let{teamId:e}of this.playerRoster.values())e>0&&i.set(e,(i.get(e)??0)+1);for(let e of r)e.playerCount=i.get(e.teamId)??0;return{weaponsHud:e,inventoryHud:t,backpackHud:a,teamScores:r}}buildTimeFilteredEvents(e){return this._chatSnapshotGen!==this._chatGen&&(this._chatSnapshot=this.chatMessages.slice(),this._chatSnapshotGen=this._chatGen),{chatMessages:this._chatSnapshot,audioEvents:this.audioEvents.filter(t=>t.timeSec>e-.5&&t.timeSec<=e)}}}e.s(["StreamEngine",()=>r9],10244)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/1cf57947857f8eec.js b/docs/_next/static/chunks/1cf57947857f8eec.js new file mode 100644 index 00000000..6bf75da4 --- /dev/null +++ b/docs/_next/static/chunks/1cf57947857f8eec.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,60505,e=>{"use strict";var t=e.i(932),r=e.i(71645),n=e.i(71753),c=e.i(15080),i=e.i(90072),o=e.i(12631),a=e.i(25645),u=e.i(98755),l=e.i(58647),m=e.i(93784),s=e.i(205),d=e.i(79123),v=e.i(51475),p=e.i(89119);let y=(0,a.createLogger)("LiveObserver"),f=1/v.TICK_RATE,g=new i.Vector3,E=new i.Vector3;function h(){let e,i,a,h,M,P,L,_,O,R,I,A,C,k,K=(0,t.c)(27),N=(0,u.useLiveSelector)(T),z=(0,u.useLiveSelector)(b),X=(0,u.useLiveSelector)(w),Y=(0,l.useEngineStoreApi)(),{speedMultiplier:D}=(0,d.useControls)(),x=(0,r.useRef)(null),H=(0,c.useThree)(S),[,U]=(0,o.useKeyboardControls)(),V=(0,r.useRef)(0),W=(0,r.useRef)(0);K[0]===Symbol.for("react.memo_cache_sentinel")?(e={yaw:0,pitch:0,prevYaw:0,prevPitch:0,initialized:!1,lastSyncedCamera:null},K[0]=e):e=K[0];let q=(0,r.useRef)(e),B=(0,r.useRef)(0);return K[1]!==N||K[2]!==z||K[3]!==Y?(i=()=>{if(N&&("connected"===z||"authenticating"===z)){if(x.current===N)return;y.info("wiring adapter to engine store");let e=u.liveConnectionStore.getState(),t={source:"live",duration:1/0,missionName:e.mapName??null,gameType:null,serverDisplayName:e.serverName??null,recorderName:e.warriorName??null,recordingDate:null,streamingPlayback:N};Y.getState().setRecording(t),Y.getState().setPlaybackStatus("playing"),x.current=N,q.current.initialized=!1,q.current.lastSyncedCamera=null}else if(!N&&x.current){let e=Y.getState().playback.recording;e?.source==="live"&&Y.getState().setRecording(null),x.current=null,q.current.initialized=!1}},a=[N,z,Y],K[1]=N,K[2]=z,K[3]=Y,K[4]=i,K[5]=a):(i=K[4],a=K[5]),(0,r.useEffect)(i,a),K[6]!==H.domElement?(h=()=>{let e=!1,t=t=>{document.pointerLockElement?(V.current=V.current+.002*t.movementX,W.current=W.current+.002*t.movementY):e&&(V.current=V.current+t.movementX*s.MOUSE_SENSITIVITY,W.current=W.current+t.movementY*s.MOUSE_SENSITIVITY)},r=t=>{document.pointerLockElement||t.target!==H.domElement||(e=!0)},n=()=>{e=!1};return document.addEventListener("mousemove",t),document.addEventListener("mousedown",r),document.addEventListener("mouseup",n),()=>{document.removeEventListener("mousemove",t),document.removeEventListener("mousedown",r),document.removeEventListener("mouseup",n)}},M=[H.domElement],K[6]=H.domElement,K[7]=h,K[8]=M):(h=K[7],M=K[8]),(0,r.useEffect)(h,M),K[9]===Symbol.for("react.memo_cache_sentinel")?(P=()=>{let e=e=>{document.pointerLockElement&&x.current&&"follow"===x.current.observerMode&&(e.stopImmediatePropagation(),x.current.cycleObserveNext())};return document.addEventListener("click",e,{capture:!0}),()=>{document.removeEventListener("click",e,{capture:!0})}},K[9]=P):P=K[9],K[10]!==H.domElement?(L=[H.domElement],K[10]=H.domElement,K[11]=L):L=K[11],(0,r.useEffect)(P,L),K[12]===Symbol.for("react.memo_cache_sentinel")?(_=()=>{let e=e=>{if("KeyO"!==e.code||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target;"INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||x.current&&(x.current.toggleObserverMode(),y.info("observer mode: %s",x.current.observerMode))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},O=[],K[12]=_,K[13]=O):(_=K[12],O=K[13]),(0,r.useEffect)(_,O),K[14]!==z||K[15]!==U?(R=(e,t)=>{if(!x.current||"connected"!==z)return;let{lookUp:r,lookDown:n,lookLeft:c,lookRight:i}=U();i&&(V.current=V.current+s.ARROW_LOOK_SPEED*t),c&&(V.current=V.current-s.ARROW_LOOK_SPEED*t),n&&(W.current=W.current+s.ARROW_LOOK_SPEED*t),r&&(W.current=W.current-s.ARROW_LOOK_SPEED*t)},K[14]=z,K[15]=U,K[16]=R):R=K[16],(0,n.useFrame)(R),K[17]!==z||K[18]!==U||K[19]!==X||K[20]!==D?(I=()=>{if(!x.current||"connected"!==z)return;let{forward:e,backward:t,left:r,right:n,up:c,down:i}=U(),o=0,a=0,u=0;e&&(a=1),t&&(a-=1),r&&(o=-1),n&&(o+=1),c&&(u=1),i&&(u-=1);let l=V.current,m=W.current;V.current=0,W.current=0;let s=q.current;s.prevYaw=s.yaw,s.prevPitch=s.pitch,s.yaw=s.yaw+l,s.pitch=Math.max(-p.MAX_PITCH,Math.min(p.MAX_PITCH,s.pitch+m)),B.current=0;let d=Math.min(1,D);X({x:o*d,y:a*d,z:u*d,yaw:l,pitch:m,roll:0,trigger:[!1,!0,!1,!1,!1,!1],freeLook:!1})},K[17]=z,K[18]=U,K[19]=X,K[20]=D,K[21]=I):I=K[21],(0,v.useTick)(I),K[22]!==z?(A=(e,t)=>{if(!x.current||"connected"!==z)return;let r=q.current,n=x.current.getSnapshot(),c=n?.camera;if(c&&c!==r.lastSyncedCamera&&"number"==typeof c.yaw&&"number"==typeof c.pitch){let e=V.current,t=W.current;r.prevYaw=r.initialized?r.yaw:c.yaw,r.prevPitch=r.initialized?r.pitch:c.pitch,r.yaw=c.yaw+e,r.pitch=Math.max(-p.MAX_PITCH,Math.min(p.MAX_PITCH,c.pitch+t)),r.lastSyncedCamera=c,r.initialized=!0}if(!r.initialized)return;B.current=B.current+t;let i=Math.min(1,B.current/f),o=r.prevYaw+(r.yaw-r.prevYaw)*i+V.current,a=Math.max(-p.MAX_PITCH,Math.min(p.MAX_PITCH,r.prevPitch+(r.pitch-r.prevPitch)*i+W.current)),[u,l,s,d]=(0,p.yawPitchToQuaternion)(o,a);if(c?.mode==="third-person"&&c.orbitTargetId){let t=m.streamPlaybackStore.getState().root,r=t?.children.find(e=>e.name===c.orbitTargetId);if(r){E.copy(r.position);let t=m.streamPlaybackStore.getState().entities.get(c.orbitTargetId);t?.renderType==="Player"&&(E.y=E.y+1);let n=Math.sin(a),i=Math.cos(a),u=Math.sin(o),l=Math.cos(o);if(g.set(-l*i,-n,u*i),g.lengthSq()>1e-8){g.normalize();let t=Math.max(.1,c.orbitDistance??4);e.camera.position.copy(E).addScaledVector(g,t),e.camera.lookAt(E)}}}else e.camera.quaternion.set(u,l,s,d)},K[22]=z,K[23]=A):A=K[23],(0,n.useFrame)(A),K[24]!==Y?(C=()=>()=>{if(x.current){let e=Y.getState().playback.recording;e?.source==="live"&&Y.getState().setRecording(null),x.current=null}},k=[Y],K[24]=Y,K[25]=C,K[26]=k):(C=K[25],k=K[26]),(0,r.useEffect)(C,k),null}function S(e){return e.gl}function w(e){return e.sendMove}function b(e){return e.gameStatus}function T(e){return e.adapter}e.s(["LiveObserver",()=>h])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/1db3a9d62713e989.css b/docs/_next/static/chunks/1db3a9d62713e989.css new file mode 100644 index 00000000..a82116fb --- /dev/null +++ b/docs/_next/static/chunks/1db3a9d62713e989.css @@ -0,0 +1 @@ +.DemoPlaybackControls-module__A_AHSq__Root{z-index:2;align-items:center;gap:10px;padding:8px 12px;font-size:13px;display:flex}.DemoPlaybackControls-module__A_AHSq__PlayPause{color:#fff;cursor:pointer;background:#03529399;border:1px solid #ffffff4d;border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;width:32px;height:32px;padding:0;font-size:14px;display:flex}@media (hover:hover){.DemoPlaybackControls-module__A_AHSq__PlayPause:hover{background:#0062b3cc}}.DemoPlaybackControls-module__A_AHSq__Time{font-variant-numeric:tabular-nums;white-space:nowrap;flex-shrink:0}.DemoPlaybackControls-module__A_AHSq__Seek[type=range]{flex:1 1 0;min-width:0;max-width:none}.DemoPlaybackControls-module__A_AHSq__Speed{color:#fff;background:#0009;border:1px solid #ffffff4d;border-radius:3px;flex-shrink:0;padding:2px 4px;font-size:12px} diff --git a/docs/_next/static/chunks/21659079be7af0ab.js b/docs/_next/static/chunks/21659079be7af0ab.js new file mode 100644 index 00000000..e691e539 --- /dev/null +++ b/docs/_next/static/chunks/21659079be7af0ab.js @@ -0,0 +1,17 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,92552,(e,t,r)=>{"use strict";let n,s;function i(e,t){return t.reduce((e,[t,r])=>({type:"BinaryExpression",operator:t,left:e,right:r}),e)}function o(e,t){return{type:"UnaryExpression",operator:e,argument:t}}class a extends SyntaxError{constructor(e,t,r,n){super(e),this.expected=t,this.found=r,this.location=n,this.name="SyntaxError"}format(e){let t="Error: "+this.message;if(this.location){let r=null,n=e.find(e=>e.source===this.location.source);n&&(r=n.text.split(/\r\n|\n|\r/g));let s=this.location.start,i=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(s):s,o=this.location.source+":"+i.line+":"+i.column;if(r){let e=this.location.end,n="".padEnd(i.line.toString().length," "),a=r[s.line-1],l=(s.line===e.line?e.column:a.length+1)-s.column||1;t+="\n --> "+o+"\n"+n+" |\n"+i.line+" | "+a+"\n"+n+" | "+"".padEnd(s.column-1," ")+"".padEnd(l,"^")}else t+="\n at "+o}return t}static buildMessage(e,t){function r(e){return e.codePointAt(0).toString(16).toUpperCase()}let n=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function s(e){return n?e.replace(n,e=>"\\u{"+r(e)+"}"):e}function i(e){return s(e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+r(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+r(e)))}function o(e){return s(e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+r(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+r(e)))}let a={literal:e=>'"'+i(e.text)+'"',class(e){let t=e.parts.map(e=>Array.isArray(e)?o(e[0])+"-"+o(e[1]):o(e));return"["+(e.inverted?"^":"")+t.join("")+"]"+(e.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:e=>e.description};function l(e){return a[e.type](e)}return"Expected "+function(e){let t=e.map(l);if(t.sort(),t.length>0){let e=1;for(let r=1;r ]/,k=/^[+\-]/,R=/^[%*\/]/,N=/^[!\-~]/,L=/^[a-zA-Z_]/,O=/^[a-zA-Z0-9_]/,I=/^[ \t]/,j=/^[^"\\\n\r]/,M=/^[^'\\\n\r]/,B=/^[0-9a-fA-F]/,T=/^[0-9]/,P=/^[xX]/,H=/^[^\n\r]/,D=/^[\n\r]/,F=/^[ \t\n\r]/,G=tE(";",!1),q=tE("package",!1),J=tE("{",!1),U=tE("}",!1),W=tE("function",!1),K=tE("(",!1),z=tE(")",!1),Z=tE("::",!1),V=tE(",",!1),Q=tE("datablock",!1),X=tE(":",!1),Y=tE("new",!1),ee=tE("[",!1),et=tE("]",!1),er=tE("=",!1),en=tE(".",!1),es=tE("if",!1),ei=tE("else",!1),eo=tE("for",!1),ea=tE("while",!1),el=tE("do",!1),eu=tE("switch$",!1),ec=tE("switch",!1),ep=tE("case",!1),ef=tE("default",!1),eh=tE("or",!1),ed=tE("return",!1),em=tE("break",!1),eg=tE("continue",!1),eb=tE("+=",!1),ey=tE("-=",!1),e$=tE("*=",!1),eA=tE("/=",!1),ex=tE("%=",!1),eC=tE("<<=",!1),eS=tE(">>=",!1),ev=tE("&=",!1),ew=tE("|=",!1),eE=tE("^=",!1),e_=tE("?",!1),ek=tE("||",!1),eR=tE("&&",!1),eN=tE("|",!1),eL=tE("^",!1),eO=tE("&",!1),eI=tE("==",!1),ej=tE("!=",!1),eM=tE("<=",!1),eB=tE(">=",!1),eT=t_(["<",">"],!1,!1,!1),eP=tE("$=",!1),eH=tE("!$=",!1),eD=tE("@",!1),eF=tE("NL",!1),eG=tE("TAB",!1),eq=tE("SPC",!1),eJ=tE("<<",!1),eU=tE(">>",!1),eW=t_(["+","-"],!1,!1,!1),eK=t_(["%","*","/"],!1,!1,!1),ez=t_(["!","-","~"],!1,!1,!1),eZ=tE("++",!1),eV=tE("--",!1),eQ=tE("*",!1),eX=tE("%",!1),eY=t_([["a","z"],["A","Z"],"_"],!1,!1,!1),e0=t_([["a","z"],["A","Z"],["0","9"],"_"],!1,!1,!1),e1=tE("$",!1),e2=tE("parent",!1),e4=t_([" "," "],!1,!1,!1),e3=tE('"',!1),e9=tE("'",!1),e5=tE("\\",!1),e6=t_(['"',"\\","\n","\r"],!0,!1,!1),e8=t_(["'","\\","\n","\r"],!0,!1,!1),e7=tE("n",!1),te=tE("r",!1),tt=tE("t",!1),tr=tE("x",!1),tn=t_([["0","9"],["a","f"],["A","F"]],!1,!1,!1),ts=tE("cr",!1),ti=tE("cp",!1),to=tE("co",!1),ta=tE("c",!1),tl=t_([["0","9"]],!1,!1,!1),tu={type:"any"},tc=tE("0",!1),tp=t_(["x","X"],!1,!1,!1),tf=tE("-",!1),th=tE("true",!1),td=tE("false",!1),tm=tE("//",!1),tg=t_(["\n","\r"],!0,!1,!1),tb=t_(["\n","\r"],!1,!1,!1),ty=tE("/*",!1),t$=tE("*/",!1),tA=t_([" "," ","\n","\r"],!1,!1,!1),tx=0|t.peg$currPos,tC=[{line:1,column:1}],tS=tx,tv=t.peg$maxFailExpected||[],tw=0|t.peg$silentFails;if(t.startRule){if(!(t.startRule in c))throw Error("Can't start parsing from rule \""+t.startRule+'".');p=c[t.startRule]}function tE(e,t){return{type:"literal",text:e,ignoreCase:t}}function t_(e,t,r,n){return{type:"class",parts:e,inverted:t,ignoreCase:r,unicode:n}}function tk(t){let r,n=tC[t];if(n)return n;if(t>=tC.length)r=tC.length-1;else for(r=t;!tC[--r];);for(n={line:(n=tC[r]).line,column:n.column};r tS&&(tS=tx,tv=[]),tv.push(e))}function tL(){let e,t,r;for(rp(),e=[],t=tx,(r=rl())===l&&(r=tO()),r!==l?t=r=[r,rp()]:(tx=t,t=l);t!==l;)e.push(t),t=tx,(r=rl())===l&&(r=tO()),r!==l?t=r=[r,rp()]:(tx=t,t=l);return{type:"Program",body:e.map(([e])=>e).filter(Boolean),execScriptPaths:Array.from(n),hasDynamicExec:s}}function tO(){let t,r,n,s,i,o,a,u,c,p,d,$,A,v,w,E,_;return(t=function(){let t,r,n,s,i,o,a,u;if(t=tx,e.substr(tx,7)===f?(r=f,tx+=7):(r=l,0===tw&&tN(q)),r!==l)if(rc()!==l)if((n=rn())!==l)if(ru(),123===e.charCodeAt(tx)?(s="{",tx++):(s=l,0===tw&&tN(J)),s!==l){for(rp(),i=[],o=tx,(a=rl())===l&&(a=tO()),a!==l?o=a=[a,u=rp()]:(tx=o,o=l);o!==l;)i.push(o),o=tx,(a=rl())===l&&(a=tO()),a!==l?o=a=[a,u=rp()]:(tx=o,o=l);(125===e.charCodeAt(tx)?(o="}",tx++):(o=l,0===tw&&tN(U)),o!==l)?(a=ru(),59===e.charCodeAt(tx)?(u=";",tx++):(u=l,0===tw&&tN(G)),u===l&&(u=null),t={type:"PackageDeclaration",name:n,body:i.map(([e])=>e).filter(Boolean)}):(tx=t,t=l)}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a;if(t=tx,e.substr(tx,8)===h?(r=h,tx+=8):(r=l,0===tw&&tN(W)),r!==l)if(rc()!==l)if((n=function(){let t,r,n,s;if(t=tx,(r=rn())!==l)if("::"===e.substr(tx,2)?(n="::",tx+=2):(n=l,0===tw&&tN(Z)),n!==l)if((s=rn())!==l)t={type:"MethodName",namespace:r,method:s};else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t===l&&(t=rn()),t}())!==l)if(ru(),40===e.charCodeAt(tx)?(s="(",tx++):(s=l,0===tw&&tN(K)),s!==l)if(ru(),(i=function(){let t,r,n,s,i,o,a,u;if(t=tx,(r=rn())!==l){for(n=[],s=tx,i=ru(),44===e.charCodeAt(tx)?(o=",",tx++):(o=l,0===tw&&tN(V)),o!==l?(a=ru(),(u=rn())!==l?s=i=[i,o,a,u]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,i=ru(),44===e.charCodeAt(tx)?(o=",",tx++):(o=l,0===tw&&tN(V)),o!==l?(a=ru(),(u=rn())!==l?s=i=[i,o,a,u]:(tx=s,s=l)):(tx=s,s=l);t=[r,...n.map(([,,,e])=>e)]}else tx=t,t=l;return t}())===l&&(i=null),ru(),41===e.charCodeAt(tx)?(o=")",tx++):(o=l,0===tw&&tN(z)),o!==l)if(ru(),(a=tF())!==l)t={type:"FunctionDeclaration",name:n,params:i||[],body:a};else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&((n=tx,(s=tI())!==l)?(ru(),59===e.charCodeAt(tx)?(i=";",tx++):(i=l,0===tw&&tN(G)),i===l&&(i=null),ru(),n=s):(tx=n,n=l),(t=n)===l&&((o=tx,(a=tj())!==l)?(ru(),59===e.charCodeAt(tx)?(u=";",tx++):(u=l,0===tw&&tN(G)),u===l&&(u=null),ru(),o=a):(tx=o,o=l),(t=o)===l&&(t=function(){let t,r,n,s,i,o,a,u,c,p,f;if(t=tx,"if"===e.substr(tx,2)?(r="if",tx+=2):(r=l,0===tw&&tN(es)),r!==l)if(ru(),40===e.charCodeAt(tx)?(n="(",tx++):(n=l,0===tw&&tN(K)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tx)?(i=")",tx++):(i=l,0===tw&&tN(z)),i!==l)if(ru(),(o=tO())!==l){var h;a=tx,u=ru(),e.substr(tx,4)===m?(c=m,tx+=4):(c=l,0===tw&&tN(ei)),c!==l?(p=ru(),(f=tO())!==l?a=u=[u,c,p,f]:(tx=a,a=l)):(tx=a,a=l),a===l&&(a=null),t={type:"IfStatement",test:s,consequent:o,alternate:(h=a)?h[3]:null}}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a,u,c,p;if(t=tx,"for"===e.substr(tx,3)?(r="for",tx+=3):(r=l,0===tw&&tN(eo)),r!==l)if(ru(),40===e.charCodeAt(tx)?(n="(",tx++):(n=l,0===tw&&tN(K)),n!==l)if(ru(),(s=tG())===l&&(s=null),ru(),59===e.charCodeAt(tx)?(i=";",tx++):(i=l,0===tw&&tN(G)),i!==l)if(ru(),(o=tG())===l&&(o=null),ru(),59===e.charCodeAt(tx)?(a=";",tx++):(a=l,0===tw&&tN(G)),a!==l)if(ru(),(u=tG())===l&&(u=null),ru(),41===e.charCodeAt(tx)?(c=")",tx++):(c=l,0===tw&&tN(z)),c!==l)if(ru(),(p=tO())!==l){var f,h;f=s,h=o,t={type:"ForStatement",init:f,test:h,update:u,body:p}}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a,u;if(t=tx,"do"===e.substr(tx,2)?(r="do",tx+=2):(r=l,0===tw&&tN(el)),r!==l)if(ru(),(n=tO())!==l)if(ru(),e.substr(tx,5)===g?(s=g,tx+=5):(s=l,0===tw&&tN(ea)),s!==l)if(ru(),40===e.charCodeAt(tx)?(i="(",tx++):(i=l,0===tw&&tN(K)),i!==l)if(ru(),(o=tG())!==l)if(ru(),41===e.charCodeAt(tx)?(a=")",tx++):(a=l,0===tw&&tN(z)),a!==l)ru(),59===e.charCodeAt(tx)?(u=";",tx++):(u=l,0===tw&&tN(G)),u===l&&(u=null),t={type:"DoWhileStatement",test:o,body:n};else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o;if(t=tx,e.substr(tx,5)===g?(r=g,tx+=5):(r=l,0===tw&&tN(ea)),r!==l)if(ru(),40===e.charCodeAt(tx)?(n="(",tx++):(n=l,0===tw&&tN(K)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tx)?(i=")",tx++):(i=l,0===tw&&tN(z)),i!==l)if(ru(),(o=tO())!==l)t={type:"WhileStatement",test:s,body:o};else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a,u,c,p;if(t=tx,e.substr(tx,7)===b?(r=b,tx+=7):(r=l,0===tw&&tN(eu)),r!==l)if(ru(),40===e.charCodeAt(tx)?(n="(",tx++):(n=l,0===tw&&tN(K)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tx)?(i=")",tx++):(i=l,0===tw&&tN(z)),i!==l)if(ru(),123===e.charCodeAt(tx)?(o="{",tx++):(o=l,0===tw&&tN(J)),o!==l){for(rp(),a=[],u=tx,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tx=u,u=l);u!==l;)a.push(u),u=tx,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tx=u,u=l);(125===e.charCodeAt(tx)?(u="}",tx++):(u=l,0===tw&&tN(U)),u!==l)?t={type:"SwitchStatement",stringMode:!0,discriminant:s,cases:a.map(([e])=>e).filter(e=>e&&"SwitchCase"===e.type)}:(tx=t,t=l)}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;if(t===l)if(t=tx,e.substr(tx,6)===y?(r=y,tx+=6):(r=l,0===tw&&tN(ec)),r!==l)if(ru(),40===e.charCodeAt(tx)?(n="(",tx++):(n=l,0===tw&&tN(K)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tx)?(i=")",tx++):(i=l,0===tw&&tN(z)),i!==l)if(ru(),123===e.charCodeAt(tx)?(o="{",tx++):(o=l,0===tw&&tN(J)),o!==l){for(rp(),a=[],u=tx,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tx=u,u=l);u!==l;)a.push(u),u=tx,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tx=u,u=l);(125===e.charCodeAt(tx)?(u="}",tx++):(u=l,0===tw&&tN(U)),u!==l)?t={type:"SwitchStatement",stringMode:!1,discriminant:s,cases:a.map(([e])=>e).filter(e=>e&&"SwitchCase"===e.type)}:(tx=t,t=l)}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i;if(t=tx,e.substr(tx,6)===x?(r=x,tx+=6):(r=l,0===tw&&tN(ed)),r!==l)if(n=tx,(s=rc())!==l&&(i=tG())!==l?n=s=[s,i]:(tx=n,n=l),n===l&&(n=null),s=ru(),59===e.charCodeAt(tx)?(i=";",tx++):(i=l,0===tw&&tN(G)),i!==l){var o;t={type:"ReturnStatement",value:(o=n)?o[1]:null}}else tx=t,t=l;else tx=t,t=l;return t}())===l&&(c=tx,e.substr(tx,5)===C?(p=C,tx+=5):(p=l,0===tw&&tN(em)),p!==l?(ru(),59===e.charCodeAt(tx)?(d=";",tx++):(d=l,0===tw&&tN(G)),d!==l?c={type:"BreakStatement"}:(tx=c,c=l)):(tx=c,c=l),(t=c)===l&&($=tx,e.substr(tx,8)===S?(A=S,tx+=8):(A=l,0===tw&&tN(eg)),A!==l?(ru(),59===e.charCodeAt(tx)?(v=";",tx++):(v=l,0===tw&&tN(G)),v!==l?$={type:"ContinueStatement"}:(tx=$,$=l)):(tx=$,$=l),(t=$)===l&&((w=tx,(E=tG())!==l&&(ru(),59===e.charCodeAt(tx)?(_=";",tx++):(_=l,0===tw&&tN(G)),_!==l))?w={type:"ExpressionStatement",expression:E}:(tx=w,w=l),(t=w)===l&&(t=tF())===l&&(t=rl())===l)))))&&(t=tx,ru(),59===e.charCodeAt(tx)?(r=";",tx++):(r=l,0===tw&&tN(G)),r!==l?(ru(),t=null):(tx=t,t=l)),t}function tI(){let t,r,n,s,i,o,a,u,c,p,f,h,m,g;if(t=tx,e.substr(tx,9)===d?(r=d,tx+=9):(r=l,0===tw&&tN(Q)),r!==l)if(rc()!==l)if((n=rn())!==l)if(ru(),40===e.charCodeAt(tx)?(s="(",tx++):(s=l,0===tw&&tN(K)),s!==l)if(ru(),(i=tB())===l&&(i=null),ru(),41===e.charCodeAt(tx)?(o=")",tx++):(o=l,0===tw&&tN(z)),o!==l){var b,y,$;if(ru(),a=tx,58===e.charCodeAt(tx)?(u=":",tx++):(u=l,0===tw&&tN(X)),u!==l?(c=ru(),(p=rn())!==l?a=u=[u,c,p]:(tx=a,a=l)):(tx=a,a=l),a===l&&(a=null),u=ru(),c=tx,123===e.charCodeAt(tx)?(p="{",tx++):(p=l,0===tw&&tN(J)),p!==l){for(f=ru(),h=[],m=tM();m!==l;)h.push(m),m=tM();m=ru(),125===e.charCodeAt(tx)?(g="}",tx++):(g=l,0===tw&&tN(U)),g!==l?c=p=[p,f,h,m,g,ru()]:(tx=c,c=l)}else tx=c,c=l;c===l&&(c=null),b=i,y=a,$=c,t={type:"DatablockDeclaration",className:n,instanceName:b,parent:y?y[2]:null,body:$?$[2].filter(Boolean):[]}}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}function tj(){let t,r,n,s,i,o,a,u,c,p,f,h;if(t=tx,"new"===e.substr(tx,3)?(r="new",tx+=3):(r=l,0===tw&&tN(Y)),r!==l)if(rc()!==l)if((n=function(){let t,r,n,s,i,o,a,u,c,p;if((t=tx,40===e.charCodeAt(tx)?(r="(",tx++):(r=l,0===tw&&tN(K)),r!==l&&(n=ru(),(s=tG())!==l&&(i=ru(),41===e.charCodeAt(tx)?(o=")",tx++):(o=l,0===tw&&tN(z)),o!==l)))?t=s:(tx=t,t=l),t===l)if(t=tx,(r=rn())!==l){var f;for(n=[],s=tx,i=ru(),91===e.charCodeAt(tx)?(o="[",tx++):(o=l,0===tw&&tN(ee)),o!==l?(a=ru(),(u=tH())!==l?(c=ru(),93===e.charCodeAt(tx)?(p="]",tx++):(p=l,0===tw&&tN(et)),p!==l?s=i=[i,o,a,u,c,p]:(tx=s,s=l)):(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,i=ru(),91===e.charCodeAt(tx)?(o="[",tx++):(o=l,0===tw&&tN(ee)),o!==l?(a=ru(),(u=tH())!==l?(c=ru(),93===e.charCodeAt(tx)?(p="]",tx++):(p=l,0===tw&&tN(et)),p!==l?s=i=[i,o,a,u,c,p]:(tx=s,s=l)):(tx=s,s=l)):(tx=s,s=l);f=r,t=n.reduce((e,[,,,t])=>({type:"IndexExpression",object:e,index:t}),f)}else tx=t,t=l;return t}())!==l)if(ru(),40===e.charCodeAt(tx)?(s="(",tx++):(s=l,0===tw&&tN(K)),s!==l)if(ru(),(i=tB())===l&&(i=null),ru(),41===e.charCodeAt(tx)?(o=")",tx++):(o=l,0===tw&&tN(z)),o!==l){var d;if(ru(),a=tx,123===e.charCodeAt(tx)?(u="{",tx++):(u=l,0===tw&&tN(J)),u!==l){for(c=ru(),p=[],f=tM();f!==l;)p.push(f),f=tM();f=ru(),125===e.charCodeAt(tx)?(h="}",tx++):(h=l,0===tw&&tN(U)),h!==l?a=u=[u,c,p,f,h,ru()]:(tx=a,a=l)}else tx=a,a=l;a===l&&(a=null),t={type:"ObjectDeclaration",className:n,instanceName:i,body:(d=a)?d[2].filter(Boolean):[]}}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}function tM(){let t,r,n;return(t=tx,(r=tj())!==l)?(ru(),59===e.charCodeAt(tx)?(n=";",tx++):(n=l,0===tw&&tN(G)),n===l&&(n=null),ru(),t=r):(tx=t,t=l),t===l&&((t=tx,(r=tI())!==l)?(ru(),59===e.charCodeAt(tx)?(n=";",tx++):(n=l,0===tw&&tN(G)),n===l&&(n=null),ru(),t=r):(tx=t,t=l),t===l&&(t=function(){let t,r,n,s,i;if(t=tx,ru(),(r=tT())!==l)if(ru(),61===e.charCodeAt(tx)?(n="=",tx++):(n=l,0===tw&&tN(er)),n!==l)if(ru(),(s=tG())!==l)ru(),59===e.charCodeAt(tx)?(i=";",tx++):(i=l,0===tw&&tN(G)),i===l&&(i=null),ru(),t={type:"Assignment",target:r,value:s};else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t}())===l&&(t=rl())===l&&(t=function(){let t,r;if(t=[],r=e.charAt(tx),F.test(r)?tx++:(r=l,0===tw&&tN(tA)),r!==l)for(;r!==l;)t.push(r),r=e.charAt(tx),F.test(r)?tx++:(r=l,0===tw&&tN(tA));else t=l;return t!==l&&(t=null),t}())),t}function tB(){let e;return(e=tY())===l&&(e=rn())===l&&(e=ra()),e}function tT(){let e,t,r,n;if(e=tx,(t=t8())!==l){for(r=[],n=tP();n!==l;)r.push(n),n=tP();e=r.reduce((e,t)=>"property"===t.type?{type:"MemberExpression",object:e,property:t.value}:{type:"IndexExpression",object:e,index:t.value},t)}else tx=e,e=l;return e}function tP(){let t,r,n,s;return(t=tx,46===e.charCodeAt(tx)?(r=".",tx++):(r=l,0===tw&&tN(en)),r!==l&&(ru(),(n=rn())!==l))?t={type:"property",value:n}:(tx=t,t=l),t===l&&((t=tx,91===e.charCodeAt(tx)?(r="[",tx++):(r=l,0===tw&&tN(ee)),r!==l&&(ru(),(n=tH())!==l&&(ru(),93===e.charCodeAt(tx)?(s="]",tx++):(s=l,0===tw&&tN(et)),s!==l)))?t={type:"index",value:n}:(tx=t,t=l)),t}function tH(){let t,r,n,s,i,o,a,u;if(t=tx,(r=tG())!==l){for(n=[],s=tx,i=ru(),44===e.charCodeAt(tx)?(o=",",tx++):(o=l,0===tw&&tN(V)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,i=ru(),44===e.charCodeAt(tx)?(o=",",tx++):(o=l,0===tw&&tN(V)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tx=s,s=l)):(tx=s,s=l);t=n.length>0?[r,...n.map(([,,,e])=>e)]:r}else tx=t,t=l;return t}function tD(){let t,r,n,s,i,o,a,u,c;if(t=tx,e.substr(tx,4)===$?(r=$,tx+=4):(r=l,0===tw&&tN(ep)),r!==l)if(rc()!==l)if((n=function(){let t,r,n,s,i,o,a,u;if(t=tx,(r=t3())!==l){for(n=[],s=tx,i=ru(),"or"===e.substr(tx,2)?(o="or",tx+=2):(o=l,0===tw&&tN(eh)),o!==l&&(a=rc())!==l&&(u=t3())!==l?s=i=[i,o,a,u]:(tx=s,s=l);s!==l;)n.push(s),s=tx,i=ru(),"or"===e.substr(tx,2)?(o="or",tx+=2):(o=l,0===tw&&tN(eh)),o!==l&&(a=rc())!==l&&(u=t3())!==l?s=i=[i,o,a,u]:(tx=s,s=l);t=n.length>0?[r,...n.map(([,,,e])=>e)]:r}else tx=t,t=l;return t}())!==l)if(ru(),58===e.charCodeAt(tx)?(s=":",tx++):(s=l,0===tw&&tN(X)),s!==l){for(i=rp(),o=[],a=tx,(u=rl())===l&&(u=tO()),u!==l?a=u=[u,c=rp()]:(tx=a,a=l);a!==l;)o.push(a),a=tx,(u=rl())===l&&(u=tO()),u!==l?a=u=[u,c=rp()]:(tx=a,a=l);t={type:"SwitchCase",test:n,consequent:o.map(([e])=>e).filter(Boolean)}}else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;if(t===l)if(t=tx,e.substr(tx,7)===A?(r=A,tx+=7):(r=l,0===tw&&tN(ef)),r!==l)if(ru(),58===e.charCodeAt(tx)?(n=":",tx++):(n=l,0===tw&&tN(X)),n!==l){for(rp(),s=[],i=tx,(o=rl())===l&&(o=tO()),o!==l?i=o=[o,a=rp()]:(tx=i,i=l);i!==l;)s.push(i),i=tx,(o=rl())===l&&(o=tO()),o!==l?i=o=[o,a=rp()]:(tx=i,i=l);t={type:"SwitchCase",test:null,consequent:s.map(([e])=>e).filter(Boolean)}}else tx=t,t=l;else tx=t,t=l;return t}function tF(){let t,r,n,s,i,o;if(t=tx,123===e.charCodeAt(tx)?(r="{",tx++):(r=l,0===tw&&tN(J)),r!==l){for(rp(),n=[],s=tx,(i=rl())===l&&(i=tO()),i!==l?s=i=[i,o=rp()]:(tx=s,s=l);s!==l;)n.push(s),s=tx,(i=rl())===l&&(i=tO()),i!==l?s=i=[i,o=rp()]:(tx=s,s=l);(125===e.charCodeAt(tx)?(s="}",tx++):(s=l,0===tw&&tN(U)),s!==l)?t={type:"BlockStatement",body:n.map(([e])=>e).filter(Boolean)}:(tx=t,t=l)}else tx=t,t=l;return t}function tG(){let t,r,n,s;if(t=tx,(r=tT())!==l)if(ru(),(n=tq())!==l)if(ru(),(s=tG())!==l)t={type:"AssignmentExpression",operator:n,target:r,value:s};else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t===l&&(t=function(){let t,r,n,s,i,o;if(t=tx,(r=tJ())!==l)if(ru(),63===e.charCodeAt(tx)?(n="?",tx++):(n=l,0===tw&&tN(e_)),n!==l)if(ru(),(s=tG())!==l)if(ru(),58===e.charCodeAt(tx)?(i=":",tx++):(i=l,0===tw&&tN(X)),i!==l)if(ru(),(o=tG())!==l)t={type:"ConditionalExpression",test:r,consequent:s,alternate:o};else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;else tx=t,t=l;return t===l&&(t=tJ()),t}()),t}function tq(){let t;return 61===e.charCodeAt(tx)?(t="=",tx++):(t=l,0===tw&&tN(er)),t===l&&("+="===e.substr(tx,2)?(t="+=",tx+=2):(t=l,0===tw&&tN(eb)),t===l&&("-="===e.substr(tx,2)?(t="-=",tx+=2):(t=l,0===tw&&tN(ey)),t===l&&("*="===e.substr(tx,2)?(t="*=",tx+=2):(t=l,0===tw&&tN(e$)),t===l&&("/="===e.substr(tx,2)?(t="/=",tx+=2):(t=l,0===tw&&tN(eA)),t===l&&("%="===e.substr(tx,2)?(t="%=",tx+=2):(t=l,0===tw&&tN(ex)),t===l&&("<<="===e.substr(tx,3)?(t="<<=",tx+=3):(t=l,0===tw&&tN(eC)),t===l&&(">>="===e.substr(tx,3)?(t=">>=",tx+=3):(t=l,0===tw&&tN(eS)),t===l&&("&="===e.substr(tx,2)?(t="&=",tx+=2):(t=l,0===tw&&tN(ev)),t===l&&("|="===e.substr(tx,2)?(t="|=",tx+=2):(t=l,0===tw&&tN(ew)),t===l&&("^="===e.substr(tx,2)?(t="^=",tx+=2):(t=l,0===tw&&tN(eE)))))))))))),t}function tJ(){let t,r,n,s,o,a,u,c;if(t=tx,(r=tU())!==l){for(n=[],s=tx,o=ru(),"||"===e.substr(tx,2)?(a="||",tx+=2):(a=l,0===tw&&tN(ek)),a!==l?(u=ru(),(c=tU())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,o=ru(),"||"===e.substr(tx,2)?(a="||",tx+=2):(a=l,0===tw&&tN(ek)),a!==l?(u=ru(),(c=tU())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tx=t,t=l;return t}function tU(){let t,r,n,s,o,a,u,c;if(t=tx,(r=tW())!==l){for(n=[],s=tx,o=ru(),"&&"===e.substr(tx,2)?(a="&&",tx+=2):(a=l,0===tw&&tN(eR)),a!==l?(u=ru(),(c=tW())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,o=ru(),"&&"===e.substr(tx,2)?(a="&&",tx+=2):(a=l,0===tw&&tN(eR)),a!==l?(u=ru(),(c=tW())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tx=t,t=l;return t}function tW(){let t,r,n,s,o,a,u,c,p;if(t=tx,(r=tK())!==l){for(n=[],s=tx,o=ru(),124===e.charCodeAt(tx)?(a="|",tx++):(a=l,0===tw&&tN(eN)),a!==l?(u=tx,tw++,124===e.charCodeAt(tx)?(c="|",tx++):(c=l,0===tw&&tN(eN)),tw--,c===l?u=void 0:(tx=u,u=l),u!==l?(c=ru(),(p=tK())!==l?s=o=[o,a,u,c,p]:(tx=s,s=l)):(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,o=ru(),124===e.charCodeAt(tx)?(a="|",tx++):(a=l,0===tw&&tN(eN)),a!==l?(u=tx,tw++,124===e.charCodeAt(tx)?(c="|",tx++):(c=l,0===tw&&tN(eN)),tw--,c===l?u=void 0:(tx=u,u=l),u!==l?(c=ru(),(p=tK())!==l?s=o=[o,a,u,c,p]:(tx=s,s=l)):(tx=s,s=l)):(tx=s,s=l);t=i(r,n.map(([,e,,,t])=>[e,t]))}else tx=t,t=l;return t}function tK(){let t,r,n,s,o,a,u,c;if(t=tx,(r=tz())!==l){for(n=[],s=tx,o=ru(),94===e.charCodeAt(tx)?(a="^",tx++):(a=l,0===tw&&tN(eL)),a!==l?(u=ru(),(c=tz())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,o=ru(),94===e.charCodeAt(tx)?(a="^",tx++):(a=l,0===tw&&tN(eL)),a!==l?(u=ru(),(c=tz())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tx=t,t=l;return t}function tz(){let t,r,n,s,o,a,u,c,p;if(t=tx,(r=tZ())!==l){for(n=[],s=tx,o=ru(),38===e.charCodeAt(tx)?(a="&",tx++):(a=l,0===tw&&tN(eO)),a!==l?(u=tx,tw++,38===e.charCodeAt(tx)?(c="&",tx++):(c=l,0===tw&&tN(eO)),tw--,c===l?u=void 0:(tx=u,u=l),u!==l?(c=ru(),(p=tZ())!==l?s=o=[o,a,u,c,p]:(tx=s,s=l)):(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,o=ru(),38===e.charCodeAt(tx)?(a="&",tx++):(a=l,0===tw&&tN(eO)),a!==l?(u=tx,tw++,38===e.charCodeAt(tx)?(c="&",tx++):(c=l,0===tw&&tN(eO)),tw--,c===l?u=void 0:(tx=u,u=l),u!==l?(c=ru(),(p=tZ())!==l?s=o=[o,a,u,c,p]:(tx=s,s=l)):(tx=s,s=l)):(tx=s,s=l);t=i(r,n.map(([,e,,,t])=>[e,t]))}else tx=t,t=l;return t}function tZ(){let e,t,r,n,s,o,a,u;if(e=tx,(t=tQ())!==l){for(r=[],n=tx,s=ru(),(o=tV())!==l?(a=ru(),(u=tQ())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);n!==l;)r.push(n),n=tx,s=ru(),(o=tV())!==l?(a=ru(),(u=tQ())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tx=e,e=l;return e}function tV(){let t;return"=="===e.substr(tx,2)?(t="==",tx+=2):(t=l,0===tw&&tN(eI)),t===l&&("!="===e.substr(tx,2)?(t="!=",tx+=2):(t=l,0===tw&&tN(ej))),t}function tQ(){let e,t,r,n,s,o,a,u;if(e=tx,(t=tY())!==l){for(r=[],n=tx,s=ru(),(o=tX())!==l?(a=ru(),(u=tY())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);n!==l;)r.push(n),n=tx,s=ru(),(o=tX())!==l?(a=ru(),(u=tY())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tx=e,e=l;return e}function tX(){let t;return"<="===e.substr(tx,2)?(t="<=",tx+=2):(t=l,0===tw&&tN(eM)),t===l&&(">="===e.substr(tx,2)?(t=">=",tx+=2):(t=l,0===tw&&tN(eB)),t===l&&(t=e.charAt(tx),_.test(t)?tx++:(t=l,0===tw&&tN(eT)))),t}function tY(){let e,t,r,n,s,o,a,u;if(e=tx,(t=t2())!==l){for(r=[],n=tx,s=ru(),(o=t1())!==l?(a=ru(),(u=t0())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);n!==l;)r.push(n),n=tx,s=ru(),(o=t1())!==l?(a=ru(),(u=t0())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tx=e,e=l;return e}function t0(){let e,t,r,n;if(e=tx,(t=tT())!==l)if(ru(),(r=tq())!==l)if(ru(),(n=tG())!==l)e={type:"AssignmentExpression",operator:r,target:t,value:n};else tx=e,e=l;else tx=e,e=l;else tx=e,e=l;return e===l&&(e=t2()),e}function t1(){let t;return"$="===e.substr(tx,2)?(t="$=",tx+=2):(t=l,0===tw&&tN(eP)),t===l&&("!$="===e.substr(tx,3)?(t="!$=",tx+=3):(t=l,0===tw&&tN(eH)),t===l&&(64===e.charCodeAt(tx)?(t="@",tx++):(t=l,0===tw&&tN(eD)),t===l&&("NL"===e.substr(tx,2)?(t="NL",tx+=2):(t=l,0===tw&&tN(eF)),t===l&&("TAB"===e.substr(tx,3)?(t="TAB",tx+=3):(t=l,0===tw&&tN(eG)),t===l&&("SPC"===e.substr(tx,3)?(t="SPC",tx+=3):(t=l,0===tw&&tN(eq))))))),t}function t2(){let e,t,r,n,s,o,a,u;if(e=tx,(t=t3())!==l){for(r=[],n=tx,s=ru(),(o=t4())!==l?(a=ru(),(u=t3())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);n!==l;)r.push(n),n=tx,s=ru(),(o=t4())!==l?(a=ru(),(u=t3())!==l?n=s=[s,o,a,u]:(tx=n,n=l)):(tx=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tx=e,e=l;return e}function t4(){let t;return"<<"===e.substr(tx,2)?(t="<<",tx+=2):(t=l,0===tw&&tN(eJ)),t===l&&(">>"===e.substr(tx,2)?(t=">>",tx+=2):(t=l,0===tw&&tN(eU))),t}function t3(){let t,r,n,s,o,a,u,c;if(t=tx,(r=t9())!==l){for(n=[],s=tx,o=ru(),a=e.charAt(tx),k.test(a)?tx++:(a=l,0===tw&&tN(eW)),a!==l?(u=ru(),(c=t9())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,o=ru(),a=e.charAt(tx),k.test(a)?tx++:(a=l,0===tw&&tN(eW)),a!==l?(u=ru(),(c=t9())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tx=t,t=l;return t}function t9(){let t,r,n,s,o,a,u,c;if(t=tx,(r=t5())!==l){for(n=[],s=tx,o=ru(),a=e.charAt(tx),R.test(a)?tx++:(a=l,0===tw&&tN(eK)),a!==l?(u=ru(),(c=t5())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,o=ru(),a=e.charAt(tx),R.test(a)?tx++:(a=l,0===tw&&tN(eK)),a!==l?(u=ru(),(c=t5())!==l?s=o=[o,a,u,c]:(tx=s,s=l)):(tx=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tx=t,t=l;return t}function t5(){let t,r,n;return(t=tx,r=e.charAt(tx),N.test(r)?tx++:(r=l,0===tw&&tN(ez)),r!==l&&(ru(),(n=t6())!==l))?t=o(r,n):(tx=t,t=l),t===l&&((t=tx,"++"===e.substr(tx,2)?(r="++",tx+=2):(r=l,0===tw&&tN(eZ)),r===l&&("--"===e.substr(tx,2)?(r="--",tx+=2):(r=l,0===tw&&tN(eV))),r!==l&&(ru(),(n=t6())!==l))?t=o(r,n):(tx=t,t=l),t===l&&((t=tx,42===e.charCodeAt(tx)?(r="*",tx++):(r=l,0===tw&&tN(eQ)),r!==l&&(ru(),(n=t6())!==l))?t={type:"TagDereferenceExpression",argument:n}:(tx=t,t=l),t===l&&(t=function(){let t,r,n;if(t=tx,(r=t8())!==l)if(ru(),"++"===e.substr(tx,2)?(n="++",tx+=2):(n=l,0===tw&&tN(eZ)),n===l&&("--"===e.substr(tx,2)?(n="--",tx+=2):(n=l,0===tw&&tN(eV))),n!==l)t={type:"PostfixExpression",operator:n,argument:r};else tx=t,t=l;else tx=t,t=l;return t===l&&(t=t8()),t}()))),t}function t6(){let e,t,r,n;if(e=tx,(t=tT())!==l)if(ru(),(r=tq())!==l)if(ru(),(n=tG())!==l)e={type:"AssignmentExpression",operator:r,target:t,value:n};else tx=e,e=l;else tx=e,e=l;else tx=e,e=l;return e===l&&(e=t5()),e}function t8(){let t,r,i,o,a,u,c,p,f,h;if(t=tx,(r=function(){let t,r,n,s,i,o,a,u,c,p,f,h,d,m,g,b;if(t=tx,(a=tj())===l&&(a=tI())===l&&(a=function(){let t,r,n,s;if(t=tx,34===e.charCodeAt(tx)?(r='"',tx++):(r=l,0===tw&&tN(e3)),r!==l){for(n=[],s=rs();s!==l;)n.push(s),s=rs();(34===e.charCodeAt(tx)?(s='"',tx++):(s=l,0===tw&&tN(e3)),s!==l)?t={type:"StringLiteral",value:n.join("")}:(tx=t,t=l)}else tx=t,t=l;if(t===l)if(t=tx,39===e.charCodeAt(tx)?(r="'",tx++):(r=l,0===tw&&tN(e9)),r!==l){for(n=[],s=ri();s!==l;)n.push(s),s=ri();(39===e.charCodeAt(tx)?(s="'",tx++):(s=l,0===tw&&tN(e9)),s!==l)?t={type:"StringLiteral",value:n.join(""),tagged:!0}:(tx=t,t=l)}else tx=t,t=l;return t}())===l&&(a=ra())===l&&((u=tx,e.substr(tx,4)===w?(c=w,tx+=4):(c=l,0===tw&&tN(th)),c===l&&(e.substr(tx,5)===E?(c=E,tx+=5):(c=l,0===tw&&tN(td))),c!==l&&(p=tx,tw++,f=rh(),tw--,f===l?p=void 0:(tx=p,p=l),p!==l))?u={type:"BooleanLiteral",value:"true"===c}:(tx=u,u=l),(a=u)===l&&((h=re())===l&&(h=rt())===l&&(h=rr()),(a=h)===l))&&((d=tx,40===e.charCodeAt(tx)?(m="(",tx++):(m=l,0===tw&&tN(K)),m!==l&&(ru(),(g=tG())!==l&&(ru(),41===e.charCodeAt(tx)?(b=")",tx++):(b=l,0===tw&&tN(z)),b!==l)))?d=g:(tx=d,d=l),a=d),(r=a)!==l){for(n=[],s=tx,i=ru(),(o=tP())!==l?s=i=[i,o]:(tx=s,s=l);s!==l;)n.push(s),s=tx,i=ru(),(o=tP())!==l?s=i=[i,o]:(tx=s,s=l);t=n.reduce((e,[,t])=>"property"===t.type?{type:"MemberExpression",object:e,property:t.value}:{type:"IndexExpression",object:e,index:t.value},r)}else tx=t,t=l;return t}())!==l){for(i=[],o=tx,a=ru(),40===e.charCodeAt(tx)?(u="(",tx++):(u=l,0===tw&&tN(K)),u!==l?(c=ru(),(p=t7())===l&&(p=null),f=ru(),41===e.charCodeAt(tx)?(h=")",tx++):(h=l,0===tw&&tN(z)),h!==l?o=a=[a,u,c,p,f,h]:(tx=o,o=l)):(tx=o,o=l),o===l&&(o=tx,a=ru(),(u=tP())!==l?o=a=[a,u]:(tx=o,o=l));o!==l;)i.push(o),o=tx,a=ru(),40===e.charCodeAt(tx)?(u="(",tx++):(u=l,0===tw&&tN(K)),u!==l?(c=ru(),(p=t7())===l&&(p=null),f=ru(),41===e.charCodeAt(tx)?(h=")",tx++):(h=l,0===tw&&tN(z)),h!==l?o=a=[a,u,c,p,f,h]:(tx=o,o=l)):(tx=o,o=l),o===l&&(o=tx,a=ru(),(u=tP())!==l?o=a=[a,u]:(tx=o,o=l));t=i.reduce((e,t)=>{if("("===t[1]){var r;let[,,,i]=t;return r=i||[],"Identifier"===e.type&&"exec"===e.name.toLowerCase()&&(r.length>0&&"StringLiteral"===r[0].type?n.add(r[0].value):s=!0),{type:"CallExpression",callee:e,arguments:r}}let i=t[1];return"property"===i.type?{type:"MemberExpression",object:e,property:i.value}:{type:"IndexExpression",object:e,index:i.value}},r)}else tx=t,t=l;return t}function t7(){let t,r,n,s,i,o,a,u;if(t=tx,(r=tG())!==l){for(n=[],s=tx,i=ru(),44===e.charCodeAt(tx)?(o=",",tx++):(o=l,0===tw&&tN(V)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,i=ru(),44===e.charCodeAt(tx)?(o=",",tx++):(o=l,0===tw&&tN(V)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tx=s,s=l)):(tx=s,s=l);t=[r,...n.map(([,,,e])=>e)]}else tx=t,t=l;return t}function re(){let t,r,n,s,i,o,a;if(t=tx,37===e.charCodeAt(tx)?(r="%",tx++):(r=l,0===tw&&tN(eX)),r!==l){if(n=tx,s=tx,i=e.charAt(tx),L.test(i)?tx++:(i=l,0===tw&&tN(eY)),i!==l){for(o=[],a=e.charAt(tx),O.test(a)?tx++:(a=l,0===tw&&tN(e0));a!==l;)o.push(a),a=e.charAt(tx),O.test(a)?tx++:(a=l,0===tw&&tN(e0));s=i=[i,o]}else tx=s,s=l;(n=s!==l?e.substring(n,tx):s)!==l?t={type:"Variable",scope:"local",name:n}:(tx=t,t=l)}else tx=t,t=l;return t}function rt(){let t,r,n,s,i,o,a,u,c,p,f,h,d;if(t=tx,36===e.charCodeAt(tx)?(r="$",tx++):(r=l,0===tw&&tN(e1)),r!==l){if(n=tx,s=tx,"::"===e.substr(tx,2)?(i="::",tx+=2):(i=l,0===tw&&tN(Z)),i===l&&(i=null),o=e.charAt(tx),L.test(o)?tx++:(o=l,0===tw&&tN(eY)),o!==l){for(a=[],u=e.charAt(tx),O.test(u)?tx++:(u=l,0===tw&&tN(e0));u!==l;)a.push(u),u=e.charAt(tx),O.test(u)?tx++:(u=l,0===tw&&tN(e0));if(u=[],c=tx,"::"===e.substr(tx,2)?(p="::",tx+=2):(p=l,0===tw&&tN(Z)),p!==l)if(f=e.charAt(tx),L.test(f)?tx++:(f=l,0===tw&&tN(eY)),f!==l){for(h=[],d=e.charAt(tx),O.test(d)?tx++:(d=l,0===tw&&tN(e0));d!==l;)h.push(d),d=e.charAt(tx),O.test(d)?tx++:(d=l,0===tw&&tN(e0));c=p=[p,f,h]}else tx=c,c=l;else tx=c,c=l;for(;c!==l;)if(u.push(c),c=tx,"::"===e.substr(tx,2)?(p="::",tx+=2):(p=l,0===tw&&tN(Z)),p!==l)if(f=e.charAt(tx),L.test(f)?tx++:(f=l,0===tw&&tN(eY)),f!==l){for(h=[],d=e.charAt(tx),O.test(d)?tx++:(d=l,0===tw&&tN(e0));d!==l;)h.push(d),d=e.charAt(tx),O.test(d)?tx++:(d=l,0===tw&&tN(e0));c=p=[p,f,h]}else tx=c,c=l;else tx=c,c=l;s=i=[i,o,a,u]}else tx=s,s=l;(n=s!==l?e.substring(n,tx):s)!==l?t={type:"Variable",scope:"global",name:n}:(tx=t,t=l)}else tx=t,t=l;return t}function rr(){let t,r,n,s,i,o,a,u,c,p,f;if(t=tx,r=tx,n=tx,e.substr(tx,6)===v?(s=v,tx+=6):(s=l,0===tw&&tN(e2)),s!==l){for(i=[],o=e.charAt(tx),I.test(o)?tx++:(o=l,0===tw&&tN(e4));o!==l;)i.push(o),o=e.charAt(tx),I.test(o)?tx++:(o=l,0===tw&&tN(e4));if("::"===e.substr(tx,2)?(o="::",tx+=2):(o=l,0===tw&&tN(Z)),o!==l){for(a=[],u=e.charAt(tx),I.test(u)?tx++:(u=l,0===tw&&tN(e4));u!==l;)a.push(u),u=e.charAt(tx),I.test(u)?tx++:(u=l,0===tw&&tN(e4));if(u=e.charAt(tx),L.test(u)?tx++:(u=l,0===tw&&tN(eY)),u!==l){for(c=[],p=e.charAt(tx),O.test(p)?tx++:(p=l,0===tw&&tN(e0));p!==l;)c.push(p),p=e.charAt(tx),O.test(p)?tx++:(p=l,0===tw&&tN(e0));n=s=[s,i,o,a,u,c]}else tx=n,n=l}else tx=n,n=l}else tx=n,n=l;if((r=n!==l?e.substring(r,tx):n)!==l&&(r={type:"Identifier",name:r.replace(/\s+/g,"")}),(t=r)===l){if(t=tx,r=tx,n=tx,e.substr(tx,6)===v?(s=v,tx+=6):(s=l,0===tw&&tN(e2)),s!==l){if(i=[],o=tx,"::"===e.substr(tx,2)?(a="::",tx+=2):(a=l,0===tw&&tN(Z)),a!==l)if(u=e.charAt(tx),L.test(u)?tx++:(u=l,0===tw&&tN(eY)),u!==l){for(c=[],p=e.charAt(tx),O.test(p)?tx++:(p=l,0===tw&&tN(e0));p!==l;)c.push(p),p=e.charAt(tx),O.test(p)?tx++:(p=l,0===tw&&tN(e0));o=a=[a,u,c]}else tx=o,o=l;else tx=o,o=l;if(o!==l)for(;o!==l;)if(i.push(o),o=tx,"::"===e.substr(tx,2)?(a="::",tx+=2):(a=l,0===tw&&tN(Z)),a!==l)if(u=e.charAt(tx),L.test(u)?tx++:(u=l,0===tw&&tN(eY)),u!==l){for(c=[],p=e.charAt(tx),O.test(p)?tx++:(p=l,0===tw&&tN(e0));p!==l;)c.push(p),p=e.charAt(tx),O.test(p)?tx++:(p=l,0===tw&&tN(e0));o=a=[a,u,c]}else tx=o,o=l;else tx=o,o=l;else i=l;i!==l?n=s=[s,i]:(tx=n,n=l)}else tx=n,n=l;if((r=n!==l?e.substring(r,tx):n)!==l&&(r={type:"Identifier",name:r}),(t=r)===l){if(t=tx,r=tx,n=tx,s=e.charAt(tx),L.test(s)?tx++:(s=l,0===tw&&tN(eY)),s!==l){for(i=[],o=e.charAt(tx),O.test(o)?tx++:(o=l,0===tw&&tN(e0));o!==l;)i.push(o),o=e.charAt(tx),O.test(o)?tx++:(o=l,0===tw&&tN(e0));if(o=[],a=tx,"::"===e.substr(tx,2)?(u="::",tx+=2):(u=l,0===tw&&tN(Z)),u!==l)if(c=e.charAt(tx),L.test(c)?tx++:(c=l,0===tw&&tN(eY)),c!==l){for(p=[],f=e.charAt(tx),O.test(f)?tx++:(f=l,0===tw&&tN(e0));f!==l;)p.push(f),f=e.charAt(tx),O.test(f)?tx++:(f=l,0===tw&&tN(e0));a=u=[u,c,p]}else tx=a,a=l;else tx=a,a=l;for(;a!==l;)if(o.push(a),a=tx,"::"===e.substr(tx,2)?(u="::",tx+=2):(u=l,0===tw&&tN(Z)),u!==l)if(c=e.charAt(tx),L.test(c)?tx++:(c=l,0===tw&&tN(eY)),c!==l){for(p=[],f=e.charAt(tx),O.test(f)?tx++:(f=l,0===tw&&tN(e0));f!==l;)p.push(f),f=e.charAt(tx),O.test(f)?tx++:(f=l,0===tw&&tN(e0));a=u=[u,c,p]}else tx=a,a=l;else tx=a,a=l;n=s=[s,i,o]}else tx=n,n=l;(r=n!==l?e.substring(r,tx):n)!==l&&(r={type:"Identifier",name:r}),t=r}}return t}function rn(){let e;return(e=re())===l&&(e=rt())===l&&(e=rr()),e}function rs(){let t,r,n;return(t=tx,92===e.charCodeAt(tx)?(r="\\",tx++):(r=l,0===tw&&tN(e5)),r!==l&&(n=ro())!==l)?t=n:(tx=t,t=l),t===l&&(t=e.charAt(tx),j.test(t)?tx++:(t=l,0===tw&&tN(e6))),t}function ri(){let t,r,n;return(t=tx,92===e.charCodeAt(tx)?(r="\\",tx++):(r=l,0===tw&&tN(e5)),r!==l&&(n=ro())!==l)?t=n:(tx=t,t=l),t===l&&(t=e.charAt(tx),M.test(t)?tx++:(t=l,0===tw&&tN(e8))),t}function ro(){let t,r,n,s,i,o;return t=tx,110===e.charCodeAt(tx)?(r="n",tx++):(r=l,0===tw&&tN(e7)),r!==l&&(r="\n"),(t=r)===l&&(t=tx,114===e.charCodeAt(tx)?(r="r",tx++):(r=l,0===tw&&tN(te)),r!==l&&(r="\r"),(t=r)===l)&&(t=tx,116===e.charCodeAt(tx)?(r="t",tx++):(r=l,0===tw&&tN(tt)),r!==l&&(r=" "),(t=r)===l)&&((t=tx,120===e.charCodeAt(tx)?(r="x",tx++):(r=l,0===tw&&tN(tr)),r!==l&&(n=tx,s=tx,i=e.charAt(tx),B.test(i)?tx++:(i=l,0===tw&&tN(tn)),i!==l?(o=e.charAt(tx),B.test(o)?tx++:(o=l,0===tw&&tN(tn)),o!==l?s=i=[i,o]:(tx=s,s=l)):(tx=s,s=l),(n=s!==l?e.substring(n,tx):s)!==l))?t=String.fromCharCode(parseInt(n,16)):(tx=t,t=l),t===l&&(t=tx,"cr"===e.substr(tx,2)?(r="cr",tx+=2):(r=l,0===tw&&tN(ts)),r!==l&&(r="\x0f"),(t=r)===l&&(t=tx,"cp"===e.substr(tx,2)?(r="cp",tx+=2):(r=l,0===tw&&tN(ti)),r!==l&&(r="\x10"),(t=r)===l))&&(t=tx,"co"===e.substr(tx,2)?(r="co",tx+=2):(r=l,0===tw&&tN(to)),r!==l&&(r="\x11"),(t=r)===l)&&((t=tx,99===e.charCodeAt(tx)?(r="c",tx++):(r=l,0===tw&&tN(ta)),r!==l&&(n=e.charAt(tx),T.test(n)?tx++:(n=l,0===tw&&tN(tl)),n!==l))?t=String.fromCharCode([2,3,4,5,6,7,8,11,12,14][parseInt(n,10)]):(tx=t,t=l),t===l&&(t=tx,e.length>tx?(r=e.charAt(tx),tx++):(r=l,0===tw&&tN(tu)),t=r))),t}function ra(){let t,r,n,s,i,o,a,u,c;if(t=tx,r=tx,n=tx,48===e.charCodeAt(tx)?(s="0",tx++):(s=l,0===tw&&tN(tc)),s!==l)if(i=e.charAt(tx),P.test(i)?tx++:(i=l,0===tw&&tN(tp)),i!==l){if(o=[],a=e.charAt(tx),B.test(a)?tx++:(a=l,0===tw&&tN(tn)),a!==l)for(;a!==l;)o.push(a),a=e.charAt(tx),B.test(a)?tx++:(a=l,0===tw&&tN(tn));else o=l;o!==l?n=s=[s,i,o]:(tx=n,n=l)}else tx=n,n=l;else tx=n,n=l;if((r=n!==l?e.substring(r,tx):n)!==l&&(n=tx,tw++,s=rh(),tw--,s===l?n=void 0:(tx=n,n=l),n!==l)?t={type:"NumberLiteral",value:parseInt(r,16)}:(tx=t,t=l),t===l){if(t=tx,r=tx,n=tx,45===e.charCodeAt(tx)?(s="-",tx++):(s=l,0===tw&&tN(tf)),s===l&&(s=null),i=[],o=e.charAt(tx),T.test(o)?tx++:(o=l,0===tw&&tN(tl)),o!==l)for(;o!==l;)i.push(o),o=e.charAt(tx),T.test(o)?tx++:(o=l,0===tw&&tN(tl));else i=l;if(i!==l){if(o=tx,46===e.charCodeAt(tx)?(a=".",tx++):(a=l,0===tw&&tN(en)),a!==l){if(u=[],c=e.charAt(tx),T.test(c)?tx++:(c=l,0===tw&&tN(tl)),c!==l)for(;c!==l;)u.push(c),c=e.charAt(tx),T.test(c)?tx++:(c=l,0===tw&&tN(tl));else u=l;u!==l?o=a=[a,u]:(tx=o,o=l)}else tx=o,o=l;o===l&&(o=null),n=s=[s,i,o]}else tx=n,n=l;if(n===l)if(n=tx,45===e.charCodeAt(tx)?(s="-",tx++):(s=l,0===tw&&tN(tf)),s===l&&(s=null),46===e.charCodeAt(tx)?(i=".",tx++):(i=l,0===tw&&tN(en)),i!==l){if(o=[],a=e.charAt(tx),T.test(a)?tx++:(a=l,0===tw&&tN(tl)),a!==l)for(;a!==l;)o.push(a),a=e.charAt(tx),T.test(a)?tx++:(a=l,0===tw&&tN(tl));else o=l;o!==l?n=s=[s,i,o]:(tx=n,n=l)}else tx=n,n=l;(r=n!==l?e.substring(r,tx):n)!==l&&(n=tx,tw++,s=rh(),tw--,s===l?n=void 0:(tx=n,n=l),n!==l)?t={type:"NumberLiteral",value:parseFloat(r)}:(tx=t,t=l)}return t}function rl(){let t;return(t=function(){let t,r,n,s,i;if(t=tx,"//"===e.substr(tx,2)?(r="//",tx+=2):(r=l,0===tw&&tN(tm)),r!==l){for(n=tx,s=[],i=e.charAt(tx),H.test(i)?tx++:(i=l,0===tw&&tN(tg));i!==l;)s.push(i),i=e.charAt(tx),H.test(i)?tx++:(i=l,0===tw&&tN(tg));n=e.substring(n,tx),s=e.charAt(tx),D.test(s)?tx++:(s=l,0===tw&&tN(tb)),s===l&&(s=null),t={type:"Comment",value:n}}else tx=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a;if(t=tx,"/*"===e.substr(tx,2)?(r="/*",tx+=2):(r=l,0===tw&&tN(ty)),r!==l){for(n=tx,s=[],i=tx,o=tx,tw++,"*/"===e.substr(tx,2)?(a="*/",tx+=2):(a=l,0===tw&&tN(t$)),tw--,a===l?o=void 0:(tx=o,o=l),o!==l?(e.length>tx?(a=e.charAt(tx),tx++):(a=l,0===tw&&tN(tu)),a!==l?i=o=[o,a]:(tx=i,i=l)):(tx=i,i=l);i!==l;)s.push(i),i=tx,o=tx,tw++,"*/"===e.substr(tx,2)?(a="*/",tx+=2):(a=l,0===tw&&tN(t$)),tw--,a===l?o=void 0:(tx=o,o=l),o!==l?(e.length>tx?(a=e.charAt(tx),tx++):(a=l,0===tw&&tN(tu)),a!==l?i=o=[o,a]:(tx=i,i=l)):(tx=i,i=l);(n=e.substring(n,tx),"*/"===e.substr(tx,2)?(s="*/",tx+=2):(s=l,0===tw&&tN(t$)),s!==l)?t={type:"Comment",value:n}:(tx=t,t=l)}else tx=t,t=l;return t}()),t}function ru(){let t,r;for(t=[],r=e.charAt(tx),F.test(r)?tx++:(r=l,0===tw&&tN(tA)),r===l&&(r=rf());r!==l;)t.push(r),r=e.charAt(tx),F.test(r)?tx++:(r=l,0===tw&&tN(tA)),r===l&&(r=rf());return t}function rc(){let t,r,n,s;if(t=tx,r=[],n=e.charAt(tx),F.test(n)?tx++:(n=l,0===tw&&tN(tA)),n!==l)for(;n!==l;)r.push(n),n=e.charAt(tx),F.test(n)?tx++:(n=l,0===tw&&tN(tA));else r=l;if(r!==l){for(n=[],s=e.charAt(tx),F.test(s)?tx++:(s=l,0===tw&&tN(tA)),s===l&&(s=rf());s!==l;)n.push(s),s=e.charAt(tx),F.test(s)?tx++:(s=l,0===tw&&tN(tA)),s===l&&(s=rf());t=r=[r,n]}else tx=t,t=l;return t}function rp(){let t,r;for(t=[],r=e.charAt(tx),F.test(r)?tx++:(r=l,0===tw&&tN(tA));r!==l;)t.push(r),r=e.charAt(tx),F.test(r)?tx++:(r=l,0===tw&&tN(tA));return t}function rf(){let t,r,n,s,i,o;if(t=tx,"//"===e.substr(tx,2)?(r="//",tx+=2):(r=l,0===tw&&tN(tm)),r!==l){for(n=[],s=e.charAt(tx),H.test(s)?tx++:(s=l,0===tw&&tN(tg));s!==l;)n.push(s),s=e.charAt(tx),H.test(s)?tx++:(s=l,0===tw&&tN(tg));s=e.charAt(tx),D.test(s)?tx++:(s=l,0===tw&&tN(tb)),s===l&&(s=null),t=r=[r,n,s]}else tx=t,t=l;if(t===l)if(t=tx,"/*"===e.substr(tx,2)?(r="/*",tx+=2):(r=l,0===tw&&tN(ty)),r!==l){for(n=[],s=tx,i=tx,tw++,"*/"===e.substr(tx,2)?(o="*/",tx+=2):(o=l,0===tw&&tN(t$)),tw--,o===l?i=void 0:(tx=i,i=l),i!==l?(e.length>tx?(o=e.charAt(tx),tx++):(o=l,0===tw&&tN(tu)),o!==l?s=i=[i,o]:(tx=s,s=l)):(tx=s,s=l);s!==l;)n.push(s),s=tx,i=tx,tw++,"*/"===e.substr(tx,2)?(o="*/",tx+=2):(o=l,0===tw&&tN(t$)),tw--,o===l?i=void 0:(tx=i,i=l),i!==l?(e.length>tx?(o=e.charAt(tx),tx++):(o=l,0===tw&&tN(tu)),o!==l?s=i=[i,o]:(tx=s,s=l)):(tx=s,s=l);"*/"===e.substr(tx,2)?(s="*/",tx+=2):(s=l,0===tw&&tN(t$)),s!==l?t=r=[r,n,s]:(tx=t,t=l)}else tx=t,t=l;return t}function rh(){let t;return t=e.charAt(tx),O.test(t)?tx++:(t=l,0===tw&&tN(e0)),t}n=new Set,s=!1;let rd=(r=p())!==l&&tx===e.length;function rm(){var t,n,s;throw r!==l&&tx {"use strict";let n="[^\\\\/]",s="[^/]",i="(?:\\/|$)",o="(?:^|\\/)",a=`\\.{1,2}${i}`,l=`(?!${o}${a})`,u=`(?!\\.{0,1}${i})`,c=`(?!${a})`,p=`${s}*?`,f={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:s,END_ANCHOR:i,DOTS_SLASH:a,NO_DOT:"(?!\\.)",NO_DOTS:l,NO_DOT_SLASH:u,NO_DOTS_SLASH:c,QMARK_NO_DOT:"[^.\\/]",STAR:p,START_ANCHOR:o,SEP:"/"},h={...f,SLASH_LITERAL:"[\\\\/]",QMARK:n,STAR:`${n}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"};t.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?h:f}},19241,(e,t,r)=>{"use strict";var n=e.i(47167);let{REGEX_BACKSLASH:s,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_GLOBAL:a}=e.r(53487);r.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r.hasRegexChars=e=>o.test(e),r.isRegexChar=e=>1===e.length&&r.hasRegexChars(e),r.escapeRegex=e=>e.replace(a,"\\$1"),r.toPosixSlashes=e=>e.replace(s,"/"),r.isWindows=()=>{if("u">typeof navigator&&navigator.platform){let e=navigator.platform.toLowerCase();return"win32"===e||"windows"===e}return void 0!==n.default&&!!n.default.platform&&"win32"===n.default.platform},r.removeBackslashes=e=>e.replace(i,e=>"\\"===e?"":e),r.escapeLast=(e,t,n)=>{let s=e.lastIndexOf(t,n);return -1===s?e:"\\"===e[s-1]?r.escapeLast(e,t,s-1):`${e.slice(0,s)}\\${e.slice(s)}`},r.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r},r.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",i=`${n}(?:${e})${s}`;return!0===t.negated&&(i=`(?:^(?!${i}).*$)`),i},r.basename=(e,{windows:t}={})=>{let r=e.split(t?/[\\/]/:"/"),n=r[r.length-1];return""===n?r[r.length-2]:n}},26094,(e,t,r)=>{"use strict";let n=e.r(19241),{CHAR_ASTERISK:s,CHAR_AT:i,CHAR_BACKWARD_SLASH:o,CHAR_COMMA:a,CHAR_DOT:l,CHAR_EXCLAMATION_MARK:u,CHAR_FORWARD_SLASH:c,CHAR_LEFT_CURLY_BRACE:p,CHAR_LEFT_PARENTHESES:f,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_PLUS:d,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:g,CHAR_RIGHT_PARENTHESES:b,CHAR_RIGHT_SQUARE_BRACKET:y}=e.r(53487),$=e=>e===c||e===o,A=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let r,x,C=t||{},S=e.length-1,v=!0===C.parts||!0===C.scanToEnd,w=[],E=[],_=[],k=e,R=-1,N=0,L=0,O=!1,I=!1,j=!1,M=!1,B=!1,T=!1,P=!1,H=!1,D=!1,F=!1,G=0,q={value:"",depth:0,isGlob:!1},J=()=>R>=S,U=()=>k.charCodeAt(R+1),W=()=>(r=x,k.charCodeAt(++R));for(;R 0&&(z=k.slice(0,N),k=k.slice(N),L-=N),K&&!0===j&&L>0?(K=k.slice(0,L),Z=k.slice(L)):!0===j?(K="",Z=k):K=k,K&&""!==K&&"/"!==K&&K!==k&&$(K.charCodeAt(K.length-1))&&(K=K.slice(0,-1)),!0===C.unescape&&(Z&&(Z=n.removeBackslashes(Z)),K&&!0===P&&(K=n.removeBackslashes(K)));let V={prefix:z,input:e,start:N,base:K,glob:Z,isBrace:O,isBracket:I,isGlob:j,isExtglob:M,isGlobstar:B,negated:H,negatedExtglob:D};if(!0===C.tokens&&(V.maxDepth=0,$(x)||E.push(q),V.tokens=E),!0===C.parts||!0===C.tokens){let t;for(let r=0;r{"use strict";let n=e.r(53487),s=e.r(19241),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_BACKREF:l,REPLACEMENTS:u}=n,c=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;try{new RegExp(r)}catch(t){return e.map(e=>s.escapeRegex(e)).join("..")}return r},p=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,f=(e,t)=>{let r;if("string"!=typeof e)throw TypeError("Expected a string");e=u[e]||e;let h={...t},d="number"==typeof h.maxLength?Math.min(i,h.maxLength):i,m=e.length;if(m>d)throw SyntaxError(`Input length: ${m}, exceeds maximum allowed length: ${d}`);let g={type:"bos",value:"",output:h.prepend||""},b=[g],y=h.capture?"":"?:",$=n.globChars(h.windows),A=n.extglobChars($),{DOT_LITERAL:x,PLUS_LITERAL:C,SLASH_LITERAL:S,ONE_CHAR:v,DOTS_SLASH:w,NO_DOT:E,NO_DOT_SLASH:_,NO_DOTS_SLASH:k,QMARK:R,QMARK_NO_DOT:N,STAR:L,START_ANCHOR:O}=$,I=e=>`(${y}(?:(?!${O}${e.dot?w:x}).)*?)`,j=h.dot?"":E,M=h.dot?R:N,B=!0===h.bash?I(h):L;h.capture&&(B=`(${B})`),"boolean"==typeof h.noext&&(h.noextglob=h.noext);let T={input:e,index:-1,start:0,dot:!0===h.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:b};m=(e=s.removePrefix(e,T)).length;let P=[],H=[],D=[],F=g,G=()=>T.index===m-1,q=T.peek=(t=1)=>e[T.index+t],J=T.advance=()=>e[++T.index]||"",U=()=>e.slice(T.index+1),W=(e="",t=0)=>{T.consumed+=e,T.index+=t},K=e=>{T.output+=null!=e.output?e.output:e.value,W(e.value)},z=()=>{let e=1;for(;"!"===q()&&("("!==q(2)||"?"===q(3));)J(),T.start++,e++;return e%2!=0&&(T.negated=!0,T.start++,!0)},Z=e=>{T[e]++,D.push(e)},V=e=>{T[e]--,D.pop()},Q=e=>{if("globstar"===F.type){let t=T.braces>0&&("comma"===e.type||"brace"===e.type),r=!0===e.extglob||P.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||r||(T.output=T.output.slice(0,-F.output.length),F.type="star",F.value="*",F.output=B,T.output+=F.output)}if(P.length&&"paren"!==e.type&&(P[P.length-1].inner+=e.value),(e.value||e.output)&&K(e),F&&"text"===F.type&&"text"===e.type){F.output=(F.output||F.value)+e.value,F.value+=e.value;return}e.prev=F,b.push(e),F=e},X=(e,t)=>{let r={...A[t],conditions:1,inner:""};r.prev=F,r.parens=T.parens,r.output=T.output;let n=(h.capture?"(":"")+r.open;Z("parens"),Q({type:e,value:t,output:T.output?"":v}),Q({type:"paren",extglob:!0,value:J(),output:n}),P.push(r)},Y=e=>{let n,s=e.close+(h.capture?")":"");if("negate"===e.type){let r=B;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=I(h)),(r!==B||G()||/^\)+$/.test(U()))&&(s=e.close=`)$))${r}`),e.inner.includes("*")&&(n=U())&&/^\.[^\\/.]+$/.test(n)){let i=f(n,{...t,fastpaths:!1}).output;s=e.close=`)${i})${r})`}"bos"===e.prev.type&&(T.negatedExtglob=!0)}Q({type:"paren",extglob:!0,value:r,output:s}),V("parens")};if(!1!==h.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let r=!1,n=e.replace(l,(e,t,n,s,i,o)=>"\\"===s?(r=!0,e):"?"===s?t?t+s+(i?R.repeat(i.length):""):0===o?M+(i?R.repeat(i.length):""):R.repeat(n.length):"."===s?x.repeat(n.length):"*"===s?t?t+s+(i?B:""):B:t?e:`\\${e}`);return(!0===r&&(n=!0===h.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===e&&!0===h.contains)?T.output=e:T.output=s.wrapOutput(n,T,t),T}for(;!G();){if("\0"===(r=J()))continue;if("\\"===r){let e=q();if("/"===e&&!0!==h.bash||"."===e||";"===e)continue;if(!e){Q({type:"text",value:r+="\\"});continue}let t=/^\\+/.exec(U()),n=0;if(t&&t[0].length>2&&(n=t[0].length,T.index+=n,n%2!=0&&(r+="\\")),!0===h.unescape?r=J():r+=J(),0===T.brackets){Q({type:"text",value:r});continue}}if(T.brackets>0&&("]"!==r||"["===F.value||"[^"===F.value)){if(!1!==h.posix&&":"===r){let e=F.value.slice(1);if(e.includes("[")&&(F.posix=!0,e.includes(":"))){let e=F.value.lastIndexOf("["),t=F.value.slice(0,e),r=o[F.value.slice(e+2)];if(r){F.value=t+r,T.backtrack=!0,J(),g.output||1!==b.indexOf(F)||(g.output=v);continue}}}("["===r&&":"!==q()||"-"===r&&"]"===q())&&(r=`\\${r}`),"]"===r&&("["===F.value||"[^"===F.value)&&(r=`\\${r}`),!0===h.posix&&"!"===r&&"["===F.value&&(r="^"),F.value+=r,K({value:r});continue}if(1===T.quotes&&'"'!==r){r=s.escapeRegex(r),F.value+=r,K({value:r});continue}if('"'===r){T.quotes=+(1!==T.quotes),!0===h.keepQuotes&&Q({type:"text",value:r});continue}if("("===r){Z("parens"),Q({type:"paren",value:r});continue}if(")"===r){if(0===T.parens&&!0===h.strictBrackets)throw SyntaxError(p("opening","("));let e=P[P.length-1];if(e&&T.parens===e.parens+1){Y(P.pop());continue}Q({type:"paren",value:r,output:T.parens?")":"\\)"}),V("parens");continue}if("["===r){if(!0!==h.nobracket&&U().includes("]"))Z("brackets");else{if(!0!==h.nobracket&&!0===h.strictBrackets)throw SyntaxError(p("closing","]"));r=`\\${r}`}Q({type:"bracket",value:r});continue}if("]"===r){if(!0===h.nobracket||F&&"bracket"===F.type&&1===F.value.length){Q({type:"text",value:r,output:`\\${r}`});continue}if(0===T.brackets){if(!0===h.strictBrackets)throw SyntaxError(p("opening","["));Q({type:"text",value:r,output:`\\${r}`});continue}V("brackets");let e=F.value.slice(1);if(!0===F.posix||"^"!==e[0]||e.includes("/")||(r=`/${r}`),F.value+=r,K({value:r}),!1===h.literalBrackets||s.hasRegexChars(e))continue;let t=s.escapeRegex(F.value);if(T.output=T.output.slice(0,-F.value.length),!0===h.literalBrackets){T.output+=t,F.value=t;continue}F.value=`(${y}${t}|${F.value})`,T.output+=F.value;continue}if("{"===r&&!0!==h.nobrace){Z("braces");let e={type:"brace",value:r,output:"(",outputIndex:T.output.length,tokensIndex:T.tokens.length};H.push(e),Q(e);continue}if("}"===r){let e=H[H.length-1];if(!0===h.nobrace||!e){Q({type:"text",value:r,output:r});continue}let t=")";if(!0===e.dots){let e=b.slice(),r=[];for(let t=e.length-1;t>=0&&(b.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&r.unshift(e[t].value);t=c(r,h),T.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){let n=T.output.slice(0,e.outputIndex),s=T.tokens.slice(e.tokensIndex);for(let i of(e.value=e.output="\\{",r=t="\\}",T.output=n,s))T.output+=i.output||i.value}Q({type:"brace",value:r,output:t}),V("braces"),H.pop();continue}if("|"===r){P.length>0&&P[P.length-1].conditions++,Q({type:"text",value:r});continue}if(","===r){let e=r,t=H[H.length-1];t&&"braces"===D[D.length-1]&&(t.comma=!0,e="|"),Q({type:"comma",value:r,output:e});continue}if("/"===r){if("dot"===F.type&&T.index===T.start+1){T.start=T.index+1,T.consumed="",T.output="",b.pop(),F=g;continue}Q({type:"slash",value:r,output:S});continue}if("."===r){if(T.braces>0&&"dot"===F.type){"."===F.value&&(F.output=x);let e=H[H.length-1];F.type="dots",F.output+=r,F.value+=r,e.dots=!0;continue}if(T.braces+T.parens===0&&"bos"!==F.type&&"slash"!==F.type){Q({type:"text",value:r,output:x});continue}Q({type:"dot",value:r,output:x});continue}if("?"===r){if(!(F&&"("===F.value)&&!0!==h.noextglob&&"("===q()&&"?"!==q(2)){X("qmark",r);continue}if(F&&"paren"===F.type){let e=q(),t=r;("("!==F.value||/[!=<:]/.test(e))&&("<"!==e||/<([!=]|\w+>)/.test(U()))||(t=`\\${r}`),Q({type:"text",value:r,output:t});continue}if(!0!==h.dot&&("slash"===F.type||"bos"===F.type)){Q({type:"qmark",value:r,output:N});continue}Q({type:"qmark",value:r,output:R});continue}if("!"===r){if(!0!==h.noextglob&&"("===q()&&("?"!==q(2)||!/[!=<:]/.test(q(3)))){X("negate",r);continue}if(!0!==h.nonegate&&0===T.index){z();continue}}if("+"===r){if(!0!==h.noextglob&&"("===q()&&"?"!==q(2)){X("plus",r);continue}if(F&&"("===F.value||!1===h.regex){Q({type:"plus",value:r,output:C});continue}if(F&&("bracket"===F.type||"paren"===F.type||"brace"===F.type)||T.parens>0){Q({type:"plus",value:r});continue}Q({type:"plus",value:C});continue}if("@"===r){if(!0!==h.noextglob&&"("===q()&&"?"!==q(2)){Q({type:"at",extglob:!0,value:r,output:""});continue}Q({type:"text",value:r});continue}if("*"!==r){("$"===r||"^"===r)&&(r=`\\${r}`);let e=a.exec(U());e&&(r+=e[0],T.index+=e[0].length),Q({type:"text",value:r});continue}if(F&&("globstar"===F.type||!0===F.star)){F.type="star",F.star=!0,F.value+=r,F.output=B,T.backtrack=!0,T.globstar=!0,W(r);continue}let t=U();if(!0!==h.noextglob&&/^\([^?]/.test(t)){X("star",r);continue}if("star"===F.type){if(!0===h.noglobstar){W(r);continue}let n=F.prev,s=n.prev,i="slash"===n.type||"bos"===n.type,o=s&&("star"===s.type||"globstar"===s.type);if(!0===h.bash&&(!i||t[0]&&"/"!==t[0])){Q({type:"star",value:r,output:""});continue}let a=T.braces>0&&("comma"===n.type||"brace"===n.type),l=P.length&&("pipe"===n.type||"paren"===n.type);if(!i&&"paren"!==n.type&&!a&&!l){Q({type:"star",value:r,output:""});continue}for(;"/**"===t.slice(0,3);){let r=e[T.index+4];if(r&&"/"!==r)break;t=t.slice(3),W("/**",3)}if("bos"===n.type&&G()){F.type="globstar",F.value+=r,F.output=I(h),T.output=F.output,T.globstar=!0,W(r);continue}if("slash"===n.type&&"bos"!==n.prev.type&&!o&&G()){T.output=T.output.slice(0,-(n.output+F.output).length),n.output=`(?:${n.output}`,F.type="globstar",F.output=I(h)+(h.strictSlashes?")":"|$)"),F.value+=r,T.globstar=!0,T.output+=n.output+F.output,W(r);continue}if("slash"===n.type&&"bos"!==n.prev.type&&"/"===t[0]){let e=void 0!==t[1]?"|$":"";T.output=T.output.slice(0,-(n.output+F.output).length),n.output=`(?:${n.output}`,F.type="globstar",F.output=`${I(h)}${S}|${S}${e})`,F.value+=r,T.output+=n.output+F.output,T.globstar=!0,W(r+J()),Q({type:"slash",value:"/",output:""});continue}if("bos"===n.type&&"/"===t[0]){F.type="globstar",F.value+=r,F.output=`(?:^|${S}|${I(h)}${S})`,T.output=F.output,T.globstar=!0,W(r+J()),Q({type:"slash",value:"/",output:""});continue}T.output=T.output.slice(0,-F.output.length),F.type="globstar",F.output=I(h),F.value+=r,T.output+=F.output,T.globstar=!0,W(r);continue}let n={type:"star",value:r,output:B};if(!0===h.bash){n.output=".*?",("bos"===F.type||"slash"===F.type)&&(n.output=j+n.output),Q(n);continue}if(F&&("bracket"===F.type||"paren"===F.type)&&!0===h.regex){n.output=r,Q(n);continue}(T.index===T.start||"slash"===F.type||"dot"===F.type)&&("dot"===F.type?(T.output+=_,F.output+=_):!0===h.dot?(T.output+=k,F.output+=k):(T.output+=j,F.output+=j),"*"!==q()&&(T.output+=v,F.output+=v)),Q(n)}for(;T.brackets>0;){if(!0===h.strictBrackets)throw SyntaxError(p("closing","]"));T.output=s.escapeLast(T.output,"["),V("brackets")}for(;T.parens>0;){if(!0===h.strictBrackets)throw SyntaxError(p("closing",")"));T.output=s.escapeLast(T.output,"("),V("parens")}for(;T.braces>0;){if(!0===h.strictBrackets)throw SyntaxError(p("closing","}"));T.output=s.escapeLast(T.output,"{"),V("braces")}if(!0!==h.strictSlashes&&("star"===F.type||"bracket"===F.type)&&Q({type:"maybe_slash",value:"",output:`${S}?`}),!0===T.backtrack)for(let e of(T.output="",T.tokens))T.output+=null!=e.output?e.output:e.value,e.suffix&&(T.output+=e.suffix);return T};f.fastpaths=(e,t)=>{let r={...t},o="number"==typeof r.maxLength?Math.min(i,r.maxLength):i,a=e.length;if(a>o)throw SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${o}`);e=u[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:c,ONE_CHAR:p,DOTS_SLASH:f,NO_DOT:h,NO_DOTS:d,NO_DOTS_SLASH:m,STAR:g,START_ANCHOR:b}=n.globChars(r.windows),y=r.dot?d:h,$=r.dot?m:h,A=r.capture?"":"?:",x=!0===r.bash?".*?":g;r.capture&&(x=`(${x})`);let C=e=>!0===e.noglobstar?x:`(${A}(?:(?!${b}${e.dot?f:l}).)*?)`,S=e=>{switch(e){case"*":return`${y}${p}${x}`;case".*":return`${l}${p}${x}`;case"*.*":return`${y}${x}${l}${p}${x}`;case"*/*":return`${y}${x}${c}${p}${$}${x}`;case"**":return y+C(r);case"**/*":return`(?:${y}${C(r)}${c})?${$}${p}${x}`;case"**/*.*":return`(?:${y}${C(r)}${c})?${$}${x}${l}${p}${x}`;case"**/.*":return`(?:${y}${C(r)}${c})?${l}${p}${x}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let r=S(t[1]);if(!r)return;return r+l+t[2]}}},v=S(s.removePrefix(e,{negated:!1,prefix:""}));return v&&!0!==r.strictSlashes&&(v+=`${c}?`),v},t.exports=f},53174,(e,t,r)=>{"use strict";let n=e.r(26094),s=e.r(17932),i=e.r(19241),o=e.r(53487),a=(e,t,r=!1)=>{if(Array.isArray(e)){let n=e.map(e=>a(e,t,r));return e=>{for(let t of n){let r=t(e);if(r)return r}return!1}}let n=e&&"object"==typeof e&&!Array.isArray(e)&&e.tokens&&e.input;if(""===e||"string"!=typeof e&&!n)throw TypeError("Expected pattern to be a non-empty string");let s=t||{},i=s.windows,o=n?a.compileRe(e,t):a.makeRe(e,t,!1,!0),l=o.state;delete o.state;let u=()=>!1;if(s.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=a(s.ignore,e,r)}let c=(r,n=!1)=>{let{isMatch:c,match:p,output:f}=a.test(r,o,t,{glob:e,posix:i}),h={glob:e,state:l,regex:o,posix:i,input:r,output:f,match:p,isMatch:c};return("function"==typeof s.onResult&&s.onResult(h),!1===c)?(h.isMatch=!1,!!n&&h):u(r)?("function"==typeof s.onIgnore&&s.onIgnore(h),h.isMatch=!1,!!n&&h):("function"==typeof s.onMatch&&s.onMatch(h),!n||h)};return r&&(c.state=l),c};a.test=(e,t,r,{glob:n,posix:s}={})=>{if("string"!=typeof e)throw TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};let o=r||{},l=o.format||(s?i.toPosixSlashes:null),u=e===n,c=u&&l?l(e):e;return!1===u&&(u=(c=l?l(e):e)===n),(!1===u||!0===o.capture)&&(u=!0===o.matchBase||!0===o.basename?a.matchBase(e,t,r,s):t.exec(c)),{isMatch:!!u,match:u,output:c}},a.matchBase=(e,t,r)=>(t instanceof RegExp?t:a.makeRe(t,r)).test(i.basename(e)),a.isMatch=(e,t,r)=>a(t,r)(e),a.parse=(e,t)=>Array.isArray(e)?e.map(e=>a.parse(e,t)):s(e,{...t,fastpaths:!1}),a.scan=(e,t)=>n(e,t),a.compileRe=(e,t,r=!1,n=!1)=>{if(!0===r)return e.output;let s=t||{},i=s.contains?"":"^",o=s.contains?"":"$",l=`${i}(?:${e.output})${o}`;e&&!0===e.negated&&(l=`^(?!${l}).*$`);let u=a.toRegex(l,t);return!0===n&&(u.state=e),u},a.makeRe=(e,t={},r=!1,n=!1)=>{if(!e||"string"!=typeof e)throw TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return!1!==t.fastpaths&&("."===e[0]||"*"===e[0])&&(i.output=s.fastpaths(e,t)),i.output||(i=s(e,t)),a.compileRe(i,t,r,n)},a.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},a.constants=o,t.exports=a},54970,(e,t,r)=>{"use strict";let n=e.r(53174),s=e.r(19241);function i(e,t,r=!1){return t&&(null===t.windows||void 0===t.windows)&&(t={...t,windows:s.isWindows()}),n(e,t,r)}Object.assign(i,n),t.exports=i},62395,33870,38433,86608,e=>{"use strict";e.s(["parse",()=>B,"runServer",()=>H],86608);var t=e.i(92552);function r(e){let t=e.indexOf("::");return -1===t?null:{namespace:e.slice(0,t),method:e.slice(t+2)}}let n={"+":"$.add","-":"$.sub","*":"$.mul","/":"$.div","<":"$.lt","<=":"$.le",">":"$.gt",">=":"$.ge","==":"$.eq","!=":"$.ne","%":"$.mod","&":"$.bitand","|":"$.bitor","^":"$.bitxor","<<":"$.shl",">>":"$.shr"};class s{indent;runtime;functions;globals;locals;indentLevel=0;currentClass=null;currentFunction=null;constructor(e={}){this.indent=e.indent??" ",this.runtime=e.runtime??"$",this.functions=e.functions??"$f",this.globals=e.globals??"$g",this.locals=e.locals??"$l"}getAccessInfo(e){if("Variable"===e.type){let t=JSON.stringify(e.name),r="global"===e.scope?this.globals:this.locals;return{getter:`${r}.get(${t})`,setter:e=>`${r}.set(${t}, ${e})`,postIncHelper:`${r}.postInc(${t})`,postDecHelper:`${r}.postDec(${t})`}}if("MemberExpression"===e.type){let t=this.expression(e.object),r="Identifier"===e.property.type?JSON.stringify(e.property.name):this.expression(e.property);return{getter:`${this.runtime}.prop(${t}, ${r})`,setter:e=>`${this.runtime}.setProp(${t}, ${r}, ${e})`,postIncHelper:`${this.runtime}.propPostInc(${t}, ${r})`,postDecHelper:`${this.runtime}.propPostDec(${t}, ${r})`}}if("IndexExpression"===e.type){let t=Array.isArray(e.index)?e.index.map(e=>this.expression(e)):[this.expression(e.index)];if("Variable"===e.object.type){let r=JSON.stringify(e.object.name),n="global"===e.object.scope?this.globals:this.locals,s=t.join(", ");return{getter:`${n}.get(${r}, ${s})`,setter:e=>`${n}.set(${r}, ${s}, ${e})`,postIncHelper:`${n}.postInc(${r}, ${s})`,postDecHelper:`${n}.postDec(${r}, ${s})`}}if("MemberExpression"===e.object.type){let r=e.object,n=this.expression(r.object),s="Identifier"===r.property.type?JSON.stringify(r.property.name):this.expression(r.property),i=`${this.runtime}.key(${s}, ${t.join(", ")})`;return{getter:`${this.runtime}.prop(${n}, ${i})`,setter:e=>`${this.runtime}.setProp(${n}, ${i}, ${e})`,postIncHelper:`${this.runtime}.propPostInc(${n}, ${i})`,postDecHelper:`${this.runtime}.propPostDec(${n}, ${i})`}}let r=this.expression(e.object),n=1===t.length?t[0]:`${this.runtime}.key(${t.join(", ")})`;return{getter:`${this.runtime}.getIndex(${r}, ${n})`,setter:e=>`${this.runtime}.setIndex(${r}, ${n}, ${e})`,postIncHelper:`${this.runtime}.indexPostInc(${r}, ${n})`,postDecHelper:`${this.runtime}.indexPostDec(${r}, ${n})`}}return null}generate(e){let t=[];for(let r of e.body){let e=this.statement(r);e&&t.push(e)}return t.join("\n\n")}statement(e){switch(e.type){case"Comment":return"";case"ExpressionStatement":return this.line(`${this.expression(e.expression)};`);case"FunctionDeclaration":return this.functionDeclaration(e);case"PackageDeclaration":return this.packageDeclaration(e);case"DatablockDeclaration":return this.datablockDeclaration(e);case"ObjectDeclaration":return this.line(`${this.objectDeclaration(e)};`);case"IfStatement":return this.ifStatement(e);case"ForStatement":return this.forStatement(e);case"WhileStatement":return this.whileStatement(e);case"DoWhileStatement":return this.doWhileStatement(e);case"SwitchStatement":return this.switchStatement(e);case"ReturnStatement":return this.returnStatement(e);case"BreakStatement":return this.line("break;");case"ContinueStatement":return this.line("continue;");case"BlockStatement":return this.blockStatement(e);default:throw Error(`Unknown statement type: ${e.type}`)}}functionDeclaration(e){let t=r(e.name.name);if(t){let r=t.namespace,n=t.method;this.currentClass=r.toLowerCase(),this.currentFunction=n.toLowerCase();let s=this.functionBody(e.body,e.params);return this.currentClass=null,this.currentFunction=null,`${this.line(`${this.runtime}.registerMethod(${JSON.stringify(r)}, ${JSON.stringify(n)}, function() {`)} +${s} +${this.line("});")}`}{let t=e.name.name;this.currentFunction=t.toLowerCase();let r=this.functionBody(e.body,e.params);return this.currentFunction=null,`${this.line(`${this.runtime}.registerFunction(${JSON.stringify(t)}, function() {`)} +${r} +${this.line("});")}`}}functionBody(e,t){this.indentLevel++;let r=[];r.push(this.line(`const ${this.locals} = ${this.runtime}.locals();`));for(let e=0;e this.statement(e)).join("\n\n");return this.indentLevel--,`${this.line(`${this.runtime}.package(${t}, function() {`)} +${r} +${this.line("});")}`}datablockDeclaration(e){let t=JSON.stringify(e.className.name),r=e.instanceName?JSON.stringify(e.instanceName.name):"null",n=e.parent?JSON.stringify(e.parent.name):"null",s=this.objectBody(e.body);return this.line(`${this.runtime}.datablock(${t}, ${r}, ${n}, ${s});`)}objectDeclaration(e){let t="Identifier"===e.className.type?JSON.stringify(e.className.name):this.expression(e.className),r=null===e.instanceName?"null":"Identifier"===e.instanceName.type?JSON.stringify(e.instanceName.name):this.expression(e.instanceName),n=[],s=[];for(let t of e.body)"Assignment"===t.type?n.push(t):s.push(t);let i=this.objectBody(n);if(s.length>0){let e=s.map(e=>this.objectDeclaration(e)).join(",\n");return`${this.runtime}.create(${t}, ${r}, ${i}, [ +${e} +])`}return`${this.runtime}.create(${t}, ${r}, ${i})`}objectBody(e){if(0===e.length)return"{}";let t=[];for(let r of e)if("Assignment"===r.type){let e=this.expression(r.value);if("Identifier"===r.target.type){let n=r.target.name;/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)?t.push(`${n}: ${e}`):t.push(`[${JSON.stringify(n)}]: ${e}`)}else if("IndexExpression"===r.target.type){let n=this.objectPropertyKey(r.target);t.push(`[${n}]: ${e}`)}else{let n=this.expression(r.target);t.push(`[${n}]: ${e}`)}}if(t.length<=1)return`{ ${t.join(", ")} }`;let r=this.indent.repeat(this.indentLevel+1),n=this.indent.repeat(this.indentLevel);return`{ +${r}${t.join(",\n"+r)} +${n}}`}objectPropertyKey(e){let t="Identifier"===e.object.type?JSON.stringify(e.object.name):this.expression(e.object),r=Array.isArray(e.index)?e.index.map(e=>this.expression(e)).join(", "):this.expression(e.index);return`${this.runtime}.key(${t}, ${r})`}ifStatement(e){let t=this.expression(e.test),r=this.statementAsBlock(e.consequent);if(e.alternate)if("IfStatement"===e.alternate.type){let n=this.ifStatement(e.alternate).replace(/^\s*/,"");return this.line(`if (${t}) ${r} else ${n}`)}else{let n=this.statementAsBlock(e.alternate);return this.line(`if (${t}) ${r} else ${n}`)}return this.line(`if (${t}) ${r}`)}forStatement(e){let t=e.init?this.expression(e.init):"",r=e.test?this.expression(e.test):"",n=e.update?this.expression(e.update):"",s=this.statementAsBlock(e.body);return this.line(`for (${t}; ${r}; ${n}) ${s}`)}whileStatement(e){let t=this.expression(e.test),r=this.statementAsBlock(e.body);return this.line(`while (${t}) ${r}`)}doWhileStatement(e){let t=this.statementAsBlock(e.body),r=this.expression(e.test);return this.line(`do ${t} while (${r});`)}switchStatement(e){if(e.stringMode)return this.switchStringStatement(e);let t=this.expression(e.discriminant);this.indentLevel++;let r=[];for(let t of e.cases)r.push(this.switchCase(t));return this.indentLevel--,`${this.line(`switch (${t}) {`)} +${r.join("\n")} +${this.line("}")}`}switchCase(e){let t=[];if(null===e.test)t.push(this.line("default:"));else if(Array.isArray(e.test))for(let r of e.test)t.push(this.line(`case ${this.expression(r)}:`));else t.push(this.line(`case ${this.expression(e.test)}:`));for(let r of(this.indentLevel++,e.consequent))t.push(this.statement(r));return t.push(this.line("break;")),this.indentLevel--,t.join("\n")}switchStringStatement(e){let t=this.expression(e.discriminant),r=[];for(let t of e.cases)if(null===t.test)r.push(`default: () => { ${this.blockContent(t.consequent)} }`);else if(Array.isArray(t.test))for(let e of t.test)r.push(`${this.expression(e)}: () => { ${this.blockContent(t.consequent)} }`);else r.push(`${this.expression(t.test)}: () => { ${this.blockContent(t.consequent)} }`);return this.line(`${this.runtime}.switchStr(${t}, { ${r.join(", ")} });`)}returnStatement(e){return e.value?this.line(`return ${this.expression(e.value)};`):this.line("return;")}blockStatement(e){this.indentLevel++;let t=e.body.map(e=>this.statement(e)).join("\n");return this.indentLevel--,`{ +${t} +${this.line("}")}`}statementAsBlock(e){if("BlockStatement"===e.type)return this.blockStatement(e);this.indentLevel++;let t=this.statement(e);return this.indentLevel--,`{ +${t} +${this.line("}")}`}blockContent(e){return e.map(e=>this.statement(e).trim()).join(" ")}expression(e){switch(e.type){case"Identifier":return this.identifier(e);case"Variable":return this.variable(e);case"NumberLiteral":case"BooleanLiteral":return String(e.value);case"StringLiteral":return JSON.stringify(e.value);case"BinaryExpression":return this.binaryExpression(e);case"UnaryExpression":return this.unaryExpression(e);case"PostfixExpression":return this.postfixExpression(e);case"AssignmentExpression":return this.assignmentExpression(e);case"ConditionalExpression":return`(${this.expression(e.test)} ? ${this.expression(e.consequent)} : ${this.expression(e.alternate)})`;case"CallExpression":return this.callExpression(e);case"MemberExpression":return this.memberExpression(e);case"IndexExpression":return this.indexExpression(e);case"TagDereferenceExpression":return`${this.runtime}.deref(${this.expression(e.argument)})`;case"ObjectDeclaration":return this.objectDeclaration(e);case"DatablockDeclaration":return`${this.runtime}.datablock(${JSON.stringify(e.className.name)}, ${e.instanceName?JSON.stringify(e.instanceName.name):"null"}, ${e.parent?JSON.stringify(e.parent.name):"null"}, ${this.objectBody(e.body)})`;default:throw Error(`Unknown expression type: ${e.type}`)}}identifier(e){let t=r(e.name);return t&&"parent"===t.namespace.toLowerCase()?e.name:t?`${this.runtime}.nsRef(${JSON.stringify(t.namespace)}, ${JSON.stringify(t.method)})`:JSON.stringify(e.name)}variable(e){return"global"===e.scope?`${this.globals}.get(${JSON.stringify(e.name)})`:`${this.locals}.get(${JSON.stringify(e.name)})`}binaryExpression(e){let t=this.expression(e.left),r=this.expression(e.right),s=e.operator,i=this.concatExpression(t,s,r);if(i)return i;if("$="===s)return`${this.runtime}.streq(${t}, ${r})`;if("!$="===s)return`!${this.runtime}.streq(${t}, ${r})`;if("&&"===s||"||"===s)return`(${t} ${s} ${r})`;let o=n[s];return o?`${o}(${t}, ${r})`:`(${t} ${s} ${r})`}unaryExpression(e){if("++"===e.operator||"--"===e.operator){let t=this.getAccessInfo(e.argument);if(t){let r="++"===e.operator?1:-1;return t.setter(`${this.runtime}.add(${t.getter}, ${r})`)}}let t=this.expression(e.argument);return"~"===e.operator?`${this.runtime}.bitnot(${t})`:"-"===e.operator?`${this.runtime}.neg(${t})`:`${e.operator}${t}`}postfixExpression(e){let t=this.getAccessInfo(e.argument);if(t){let r="++"===e.operator?t.postIncHelper:t.postDecHelper;if(r)return r}return`${this.expression(e.argument)}${e.operator}`}assignmentExpression(e){let t=this.expression(e.value),r=e.operator,n=this.getAccessInfo(e.target);if(!n)throw Error(`Unhandled assignment target type: ${e.target.type}`);if("="===r)return n.setter(t);{let e=r.slice(0,-1),s=this.compoundAssignmentValue(n.getter,e,t);return n.setter(s)}}callExpression(e){let t=e.arguments.map(e=>this.expression(e)).join(", ");if("Identifier"===e.callee.type){let n=e.callee.name,s=r(n);if(s&&"parent"===s.namespace.toLowerCase())if(this.currentClass)return`${this.runtime}.parent(${JSON.stringify(this.currentClass)}, ${JSON.stringify(s.method)}, arguments[0]${t?", "+t:""})`;else if(this.currentFunction)return`${this.runtime}.parentFunc(${JSON.stringify(this.currentFunction)}${t?", "+t:""})`;else throw Error("Parent:: call outside of function context");return s?`${this.runtime}.nsCall(${JSON.stringify(s.namespace)}, ${JSON.stringify(s.method)}${t?", "+t:""})`:`${this.functions}.call(${JSON.stringify(n)}${t?", "+t:""})`}if("MemberExpression"===e.callee.type){let r=this.expression(e.callee.object),n="Identifier"===e.callee.property.type?JSON.stringify(e.callee.property.name):this.expression(e.callee.property);return`${this.runtime}.call(${r}, ${n}${t?", "+t:""})`}let n=this.expression(e.callee);return`${n}(${t})`}memberExpression(e){let t=this.expression(e.object);return e.computed||"Identifier"!==e.property.type?`${this.runtime}.prop(${t}, ${this.expression(e.property)})`:`${this.runtime}.prop(${t}, ${JSON.stringify(e.property.name)})`}indexExpression(e){let t=Array.isArray(e.index)?e.index.map(e=>this.expression(e)):[this.expression(e.index)];if("Variable"===e.object.type){let r=JSON.stringify(e.object.name),n="global"===e.object.scope?this.globals:this.locals;return`${n}.get(${r}, ${t.join(", ")})`}if("MemberExpression"===e.object.type){let r=e.object,n=this.expression(r.object),s="Identifier"===r.property.type?JSON.stringify(r.property.name):this.expression(r.property),i=`${this.runtime}.key(${s}, ${t.join(", ")})`;return`${this.runtime}.prop(${n}, ${i})`}let r=this.expression(e.object);return 1===t.length?`${this.runtime}.getIndex(${r}, ${t[0]})`:`${this.runtime}.getIndex(${r}, ${this.runtime}.key(${t.join(", ")}))`}line(e){return this.indent.repeat(this.indentLevel)+e}concatExpression(e,t,r){switch(t){case"@":return`${this.runtime}.concat(${e}, ${r})`;case"SPC":return`${this.runtime}.concat(${e}, " ", ${r})`;case"TAB":return`${this.runtime}.concat(${e}, "\\t", ${r})`;case"NL":return`${this.runtime}.concat(${e}, "\\n", ${r})`;default:return null}}compoundAssignmentValue(e,t,r){let s=this.concatExpression(e,t,r);if(s)return s;let i=n[t];return i?`${i}(${e}, ${r})`:`(${e} ${t} ${r})`}}e.s(["createRuntime",()=>I,"createScriptCache",()=>R],33870);var i=e.i(54970),o=e.i(25645);class a{map=new Map;keyLookup=new Map;constructor(e){if(e)for(const[t,r]of e)this.set(t,r)}get size(){return this.map.size}get(e){let t=this.keyLookup.get(e.toLowerCase());return void 0!==t?this.map.get(t):void 0}set(e,t){let r=e.toLowerCase(),n=this.keyLookup.get(r);return void 0!==n?this.map.set(n,t):(this.keyLookup.set(r,e),this.map.set(e,t)),this}has(e){return this.keyLookup.has(e.toLowerCase())}delete(e){let t=e.toLowerCase(),r=this.keyLookup.get(t);return void 0!==r&&(this.keyLookup.delete(t),this.map.delete(r))}clear(){this.map.clear(),this.keyLookup.clear()}keys(){return this.map.keys()}values(){return this.map.values()}entries(){return this.map.entries()}[Symbol.iterator](){return this.map[Symbol.iterator]()}forEach(e){for(let[t,r]of this.map)e(r,t,this)}get[Symbol.toStringTag](){return"CaseInsensitiveMap"}getOriginalKey(e){return this.keyLookup.get(e.toLowerCase())}}class l{set=new Set;constructor(e){if(e)for(const t of e)this.add(t)}get size(){return this.set.size}add(e){return this.set.add(e.toLowerCase()),this}has(e){return this.set.has(e.toLowerCase())}delete(e){return this.set.delete(e.toLowerCase())}clear(){this.set.clear()}[Symbol.iterator](){return this.set[Symbol.iterator]()}get[Symbol.toStringTag](){return"CaseInsensitiveSet"}}function u(e){return e.replace(/\\/g,"/").toLowerCase()}function c(e){return String(e??"")}function p(e){return Number(e)||0}function f(e){let t=c(e||"0 0 0").split(" ").map(Number);return[t[0]||0,t[1]||0,t[2]||0]}function h(e,t,r){let n=0;for(;t+n 0;){if(n>=e.length)return"";let s=h(e,n,r);if(n+s>=e.length)return"";n+=s+1,t--}let s=h(e,n,r);return 0===s?"":e.substring(n,n+s)}function m(e,t,r,n){let s=0,i=t;for(;i>0;){if(s>=e.length)return"";let t=h(e,s,n);if(s+t>=e.length)return"";s+=t+1,i--}let o=s,a=r-t+1;for(;a>0;){let t=h(e,s,n);if((s+=t)>=e.length)break;s++,a--}let l=s;return l>o&&n.includes(e[l-1])&&l--,e.substring(o,l)}function g(e,t){if(""===e)return 0;let r=0;for(let n=0;n t&&o>=e.length)break}return i.join(s)}function y(e,t,r,n){let s=[],i=0,o=0;for(;i t().$f.call(c(e),...r),eval(e){throw Error("eval() not implemented: requires runtime parsing and execution")},collapseescape:e=>c(e).replace(/\\([ntr\\])/g,(e,t)=>"n"===t?"\n":"t"===t?" ":"r"===t?"\r":"\\"),expandescape:e=>c(e).replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r"),export(e,t,r){console.warn(`export(${e}): not implemented`)},quit(){console.warn("quit(): not implemented in browser")},trace(e){},isobject:e=>t().$.isObject(e),nametoid:e=>t().$.nameToId(e),strlen:e=>c(e).length,strchr(e,t){let r=c(e),n=c(t)[0]??"",s=r.indexOf(n);return s>=0?r.substring(s):""},strpos:(e,t,r)=>c(e).indexOf(c(t),p(r)),strcmp(e,t){let r=c(e),n=c(t);return r n)},stricmp(e,t){let r=c(e).toLowerCase(),n=c(t).toLowerCase();return r n)},strstr:(e,t)=>c(e).indexOf(c(t)),getsubstr(e,t,r){let n=c(e),s=p(t);return void 0===r?n.substring(s):n.substring(s,s+p(r))},getword:(e,t)=>d(c(e),p(t)," \n"),getwordcount:e=>g(c(e)," \n"),getfield:(e,t)=>d(c(e),p(t)," \n"),getfieldcount:e=>g(c(e)," \n"),setword:(e,t,r)=>b(c(e),p(t),c(r)," \n"," "),setfield:(e,t,r)=>b(c(e),p(t),c(r)," \n"," "),firstword:e=>d(c(e),0," \n"),restwords:e=>m(c(e),1,1e6," \n"),trim:e=>c(e).trim(),ltrim:e=>c(e).replace(/^\s+/,""),rtrim:e=>c(e).replace(/\s+$/,""),strupr:e=>c(e).toUpperCase(),strlwr:e=>c(e).toLowerCase(),strreplace:(e,t,r)=>c(e).split(c(t)).join(c(r)),filterstring:(e,t)=>c(e),stripchars(e,t){let r=c(e),n=new Set(c(t).split(""));return r.split("").filter(e=>!n.has(e)).join("")},getfields(e,t,r){let n=void 0!==r?Number(r):1e6;return m(c(e),p(t),n," \n")},getwords(e,t,r){let n=void 0!==r?Number(r):1e6;return m(c(e),p(t),n," \n")},removeword:(e,t)=>y(c(e),p(t)," \n"," "),removefield:(e,t)=>y(c(e),p(t)," \n"," "),getrecord:(e,t)=>d(c(e),p(t),"\n"),getrecordcount:e=>g(c(e),"\n"),setrecord:(e,t,r)=>b(c(e),p(t),c(r),"\n","\n"),removerecord:(e,t)=>y(c(e),p(t),"\n","\n"),nexttoken(e,t,r){throw Error("nextToken() is not implemented: it requires variable mutation")},strtoplayername:e=>c(e).replace(/[^\w\s-]/g,"").trim(),mabs:e=>Math.abs(p(e)),mfloor:e=>Math.floor(p(e)),mceil:e=>Math.ceil(p(e)),msqrt:e=>Math.sqrt(p(e)),mpow:(e,t)=>Math.pow(p(e),p(t)),msin:e=>Math.sin(p(e)),mcos:e=>Math.cos(p(e)),mtan:e=>Math.tan(p(e)),masin:e=>Math.asin(p(e)),macos:e=>Math.acos(p(e)),matan:(e,t)=>Math.atan2(p(e),p(t)),mlog:e=>Math.log(p(e)),getrandom(e,t){if(void 0===e)return Math.random();if(void 0===t)return Math.floor(Math.random()*(p(e)+1));let r=p(e);return Math.floor(Math.random()*(p(t)-r+1))+r},mdegtorad:e=>p(e)*(Math.PI/180),mradtodeg:e=>p(e)*(180/Math.PI),mfloatlength:(e,t)=>p(e).toFixed(p(t)),getboxcenter(e){let t=c(e).split(" ").map(Number),r=t[0]||0,n=t[1]||0,s=t[2]||0,i=t[3]||0,o=t[4]||0,a=t[5]||0;return`${(r+i)/2} ${(n+o)/2} ${(s+a)/2}`},vectoradd(e,t){let[r,n,s]=f(e),[i,o,a]=f(t);return`${r+i} ${n+o} ${s+a}`},vectorsub(e,t){let[r,n,s]=f(e),[i,o,a]=f(t);return`${r-i} ${n-o} ${s-a}`},vectorscale(e,t){let[r,n,s]=f(e),i=p(t);return`${r*i} ${n*i} ${s*i}`},vectordot(e,t){let[r,n,s]=f(e),[i,o,a]=f(t);return r*i+n*o+s*a},vectorcross(e,t){let[r,n,s]=f(e),[i,o,a]=f(t);return`${n*a-s*o} ${s*i-r*a} ${r*o-n*i}`},vectorlen(e){let[t,r,n]=f(e);return Math.sqrt(t*t+r*r+n*n)},vectornormalize(e){let[t,r,n]=f(e),s=Math.sqrt(t*t+r*r+n*n);return 0===s?"0 0 0":`${t/s} ${r/s} ${n/s}`},vectordist(e,t){let[r,n,s]=f(e),[i,o,a]=f(t),l=r-i,u=n-o,c=s-a;return Math.sqrt(l*l+u*u+c*c)},matrixcreate(e,t){throw Error("MatrixCreate() not implemented: requires axis-angle rotation math")},matrixcreatefromeuler(e){throw Error("MatrixCreateFromEuler() not implemented: requires Euler→Quaternion→AxisAngle conversion")},matrixmultiply(e,t){throw Error("MatrixMultiply() not implemented: requires full 4x4 matrix multiplication")},matrixmulpoint(e,t){throw Error("MatrixMulPoint() not implemented: requires full transform application")},matrixmulvector(e,t){throw Error("MatrixMulVector() not implemented: requires rotation matrix application")},getsimtime:()=>Date.now()-t().state.startTime,getrealtime:()=>Date.now(),schedule(e,r,n,...s){let i=Number(e)||0,o=t(),a=setTimeout(()=>{o.state.pendingTimeouts.delete(a);try{o.$f.call(String(n),...s)}catch(e){throw console.error(`schedule: error calling ${n}:`,e),e}},i);return o.state.pendingTimeouts.add(a),a},cancel(e){clearTimeout(e),t().state.pendingTimeouts.delete(e)},iseventpending:e=>t().state.pendingTimeouts.has(e),exec(e){let r=String(e??"");if(console.debug(`exec(${JSON.stringify(r)}): preparing to execute…`),!r.includes("."))return console.error(`exec: invalid script file name ${JSON.stringify(r)}.`),!1;let n=u(r),s=t(),{executedScripts:i,scripts:o}=s.state;if(i.has(n))return console.debug(`exec(${JSON.stringify(r)}): skipping (already executed)`),!0;let a=o.get(n);return null==a?(console.warn(`exec(${JSON.stringify(r)}): script not found`),!1):(i.add(n),console.debug(`exec(${JSON.stringify(r)}): executing!`),s.executeAST(a),!0)},compile(e){throw Error("compile() not implemented: requires DSO bytecode compiler")},isdemo:()=>!1,isfile:e=>r?r.isFile(c(e)):(console.warn("isFile(): no fileSystem handler configured"),!1),fileext(e){let t=c(e),r=t.lastIndexOf(".");return r>=0?t.substring(r):""},filebase(e){let t=c(e),r=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\")),n=t.lastIndexOf("."),s=r>=0?r+1:0,i=n>s?n:t.length;return t.substring(s,i)},filepath(e){let t=c(e),r=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return r>=0?t.substring(0,r):""},expandfilename(e){throw Error("expandFilename() not implemented: requires filesystem path expansion")},findfirstfile:e=>r?(i=c(e),n=r.findFiles(i),s=0,n[s++]??""):(console.warn("findFirstFile(): no fileSystem handler configured"),""),findnextfile(e){let t=c(e);if(t!==i){if(!r)return"";i=t,n=r.findFiles(t)}return n[s++]??""},getfilecrc:e=>c(e),iswriteablefilename:e=>!1,activatepackage(e){t().$.activatePackage(c(e))},deactivatepackage(e){t().$.deactivatePackage(c(e))},ispackage:e=>t().$.isPackage(c(e)),isactivepackage:e=>t().$.isActivePackage(c(e)),getpackagelist:()=>t().$.getPackageList(),addmessagecallback(e,t){},alxcreatesource:(...e)=>0,alxgetwavelen:e=>0,alxlistenerf(e,t){},alxplay:(...e)=>0,alxsetchannelvolume(e,t){},alxsourcef(e,t,r){},alxstop(e){},alxstopall(){},activatedirectinput(){},activatekeyboard(){},deactivatedirectinput(){},deactivatekeyboard(){},disablejoystick(){},enablejoystick(){},enablewinconsole(e){},isjoystickdetected:()=>!1,lockmouse(e){},addmaterialmapping(e,t){},flushtexturecache(){},getdesktopresolution:()=>"1920 1080 32",getdisplaydevicelist:()=>"OpenGL",getresolutionlist:e=>"640 480 800 600 1024 768 1280 720 1920 1080",getvideodriverinfo:()=>"WebGL",isdevicefullscreenonly:e=>!1,isfullscreen:()=>!1,screenshot(e){},setdisplaydevice:e=>!0,setfov(e){},setinteriorrendermode(e){},setopenglanisotropy(e){},setopenglmipreduction(e){},setopenglskymipreduction(e){},setopengltexturecompressionhint(e){},setscreenmode(e,t,r,n){},setverticalsync(e){},setzoomspeed(e){},togglefullscreen(){},videosetgammacorrection(e){},snaptoggle(){},addtaggedstring:e=>0,buildtaggedstring:(e,...t)=>"",detag:e=>c(e),gettag:e=>0,gettaggedstring:e=>"",removetaggedstring(e){},commandtoclient(e,t){},commandtoserver(e){},cancelserverquery(){},querymasterserver(){},querysingleserver(){},setnetport:e=>!0,allowconnections(e){},startheartbeat(){},stopheartbeat(){},gotowebpage(e){},deletedatablocks(){},preloaddatablock:e=>!0,containerboxempty:(...e)=>!0,containerraycast:(...e)=>"",containersearchcurrdist:()=>0,containersearchnext:()=>0,initcontainerradiussearch(){},calcexplosioncoverage:(...e)=>1,getcontrolobjectaltitude:()=>0,getcontrolobjectspeed:()=>0,getterrainheight:e=>0,lightscene(){},pathonmissionloaddone(){}}}function A(e){return e.toLowerCase()}function x(e){let t=e.trim();return A(t.startsWith("$")?t.slice(1):t)}function C(e,t){let r=e.get(t);return r||(r=new Set,e.set(t,r)),r}function S(e,t){for(let r of t)e.add(A(r))}function v(e,t,r){if(e.anyClassValues.has("*")||e.anyClassValues.has(r))return!0;for(let n of t){let t=e.valuesByClass.get(A(n));if(t&&(t.has("*")||t.has(r)))return!0}return!1}let w=[{classNames:["SceneObject","GameBase","ShapeBase","Item","Player"],fields:["position","rotation","scale","transform","hidden","renderingdistance","datablock","shapename","shapefile","initialbarrel","skin","team","health","energy","energylevel","damagelevel","damageflash","damagepercent","damagestate","mountobject","mountedimage","targetposition","targetrotation","targetscale","missiontypeslist","renderenabled","vis","velocity","name"]},{classNames:["*"],fields:["position","rotation","scale","hidden","shapefile","datablock"]}],E=[{classNames:["SceneObject","GameBase","ShapeBase","SimObject"],methods:["settransform","setposition","setrotation","setscale","sethidden","setdatablock","setshapename","mountimage","unmountimage","mountobject","unmountobject","setdamagelevel","setenergylevel","schedule","delete","deleteallobjects","add","remove","playthread","stopthread","setthreaddir","pausethread"]},{classNames:["*"],methods:["settransform","setscale","delete","add","remove"]}],_=["missionrunning","loadingmission"],k=(0,o.createLogger)("runtime");function R(){return{scripts:new Map,generatedCode:new WeakMap}}function N(e){return e.toLowerCase()}function L(e){return Number(e)>>>0}function O(e){if(null==e)return null;if("string"==typeof e)return e||null;if("number"==typeof e)return String(e);throw Error(`Invalid instance name type: ${typeof e}`)}function I(e={}){let t,r,n,o=e.reactiveFieldRules??w,c=e.reactiveMethodRules??E,p=e.reactiveGlobalNames??_,f=(t=function(e){let t=new Set,r=new Map;for(let n of e)for(let e of n.classNames){let s=A(e);if("*"===s){S(t,n.fields);continue}S(C(r,s),n.fields)}return{anyClassValues:t,valuesByClass:r}}(o),(e,r)=>v(t,e,A(r))),h=(r=function(e){let t=new Set,r=new Map;for(let n of e)for(let e of n.classNames){let s=A(e);if("*"===s){S(t,n.methods);continue}S(C(r,s),n.methods)}return{anyClassValues:t,valuesByClass:r}}(c),(e,t)=>v(r,e,A(t))),d=(n=function(e){let t=new Set;for(let r of e)t.add(x(r));return t}(p),e=>{let t=x(e);return n.has("*")||n.has(t)}),m=new a,g=new a,b=new a,y=[],j=new l,M=3,T=1027,P=new Map,H=new a,D=new a,F=new a,G=new a,q=new a,J=new Set,U=[],W=!1,K=0;if(e.globals)for(let[t,r]of Object.entries(e.globals)){if(!t.startsWith("$"))throw Error(`Global variable "${t}" must start with $, e.g. "$${t}"`);F.set(t.slice(1),r)}let z=new Set,Z=new Set,V=e.ignoreScripts&&e.ignoreScripts.length>0?(0,i.default)(e.ignoreScripts,{nocase:!0}):null,Q=e.cache??R(),X=Q.scripts,Y=Q.generatedCode,ee=new Map;function et(e){let t=ee.get(e);return t&&t.length>0?t[t.length-1]:void 0}function er(e,t,r){let n;(n=ee.get(e))||(n=[],ee.set(e,n)),n.push(t);try{return r()}finally{let t;(t=ee.get(e))&&t.pop()}}function en(e,t){return`${e.toLowerCase()}::${t.toLowerCase()}`}function es(e,t){return m.get(e)?.get(t)??null}function ei(e){if(!e)return[];let t=[],r=new Set,n=e.class||e._className||e._class,s=n?N(String(n)):"";for(;s&&!r.has(s);)t.push(s),r.add(s),s=q.get(s)??"";return e._superClass&&!r.has(e._superClass)&&t.push(e._superClass),t}function eo(){if(W=!1,0===U.length)return;let e=U.splice(0,U.length);for(let t of(K+=1,J))t({type:"batch.flushed",tick:K,events:e})}function ea(e){for(let t of(U.push(e),J))t(e);W||(W=!0,queueMicrotask(eo))}function el(e){ea({type:"object.created",objectId:e._id,object:e})}function eu(e,t,r,n){let s=N(t);Object.is(r,n)||f(ei(e),s)&&ea({type:"field.changed",objectId:e._id,field:s,value:r,previousValue:n,object:e})}let ec=new Set,ep=null,ef=null,eh=(e.builtins??$)({runtime:()=>ef,fileSystem:e.fileSystem??null});function ed(e){let t=b.get(e);if(!t)return void j.add(e);if(!t.active){for(let[e,r]of(t.active=!0,y.push(t.name),t.methods)){m.has(e)||m.set(e,new a);let t=m.get(e);for(let[e,n]of r)t.has(e)||t.set(e,[]),t.get(e).push(n)}for(let[e,r]of t.functions)g.has(e)||g.set(e,[]),g.get(e).push(r)}}function em(e){return null==e||""===e?null:"object"==typeof e&&null!=e._id?e:"string"==typeof e?H.get(e)??null:"number"==typeof e?P.get(e)??null:null}function eg(e,t,r){let n=em(e);if(null==n)return 0;let s=eA(n[t]);return n[t]=s+r,eu(n,t,n[t],s),s}function eb(e,t){let r=es(e,t);return r&&r.length>0?r[r.length-1]:null}function ey(e,t,r,n){let s=es(e,t);return s&&0!==s.length?{found:!0,result:er(en(e,t),s.length-1,()=>s[s.length-1](r,...n))}:{found:!1}}function e$(e,t,r,n){let s;h((s=ei(r)).length?s:[e],t)&&ea({type:"method.called",className:N(e),methodName:N(t),objectId:r._id,args:[...n]});let i=G.get(e);if(i){let e=i.get(t);if(e)for(let t of e)t(r,...n)}}function eA(e){if(null==e||""===e)return 0;let t=Number(e);return isNaN(t)?0:t}function ex(e){if(!e||""===e)return null;e.startsWith("/")&&(e=e.slice(1));let t=e.split("/"),r=null;for(let e=0;e t._name?.toLowerCase()===e)??null}if(!r)return null}}return r}function eC(e){return null==e||""===e?null:ex(String(e))}function eS(e,t){function r(e,t){return e+t.join("_")}return{get:(t,...n)=>e.get(r(t,n))??"",set(n,...s){if(0===s.length)throw Error("set() requires at least a value argument");if(1===s.length){let r=e.get(n);return e.set(n,s[0]),t?.onSet?.(n,s[0],r),s[0]}let i=s[s.length-1],o=r(n,s.slice(0,-1)),a=e.get(o);return e.set(o,i),t?.onSet?.(o,i,a),i},postInc(n,...s){let i=r(n,s),o=eA(e.get(i)),a=o+1;return e.set(i,a),t?.onSet?.(i,a,o),o},postDec(n,...s){let i=r(n,s),o=eA(e.get(i)),a=o-1;return e.set(i,a),t?.onSet?.(i,a,o),o}}}function ev(){return eS(new a)}let ew={registerMethod:function(e,t,r){if(ep)ep.methods.has(e)||ep.methods.set(e,new a),ep.methods.get(e).set(t,r);else{m.has(e)||m.set(e,new a);let n=m.get(e);n.has(t)||n.set(t,[]),n.get(t).push(r)}},registerFunction:function(e,t){ep?ep.functions.set(e,t):(g.has(e)||g.set(e,[]),g.get(e).push(t))},package:function(e,t){let r=b.get(e);r||(r={name:e,active:!1,methods:new a,functions:new a},b.set(e,r));let n=ep;ep=r,t(),ep=n,j.has(e)&&(j.delete(e),ed(e))},activatePackage:ed,deactivatePackage:function(e){let t=b.get(e);if(!t||!t.active)return;t.active=!1;let r=y.findIndex(t=>t.toLowerCase()===e.toLowerCase());for(let[e,n]of(-1!==r&&y.splice(r,1),t.methods)){let t=m.get(e);if(t)for(let[e,r]of n){let n=t.get(e);if(n){let e=n.indexOf(r);-1!==e&&n.splice(e,1)}}}for(let[e,r]of t.functions){let t=g.get(e);if(t){let e=t.indexOf(r);-1!==e&&t.splice(e,1)}}},create:function(e,t,r,n){let s=N(e),i=function(){for(;P.has(T);)T+=1;let e=T;return T+=1,e}(),o={_class:s,_className:e,_id:i};for(let[e,t]of Object.entries(r))o[N(e)]=t;o.superclass&&(o._superClass=N(String(o.superclass)),o.class&&q.set(N(String(o.class)),o._superClass)),P.set(i,o);let a=O(t);if(a&&(o._name=a,H.set(a,o)),n){for(let e of n)e._parent=o;o._children=n}let l=eb(e,"onAdd");return l&&l(o),el(o),o},datablock:function(e,t,r,n){let s=N(e),i=function(){for(;P.has(M);)M+=1;let e=M;return M+=1,e}(),o={_class:s,_className:e,_id:i,_isDatablock:!0},a=O(r);if(a){let e=D.get(a);if(e){for(let[t,r]of Object.entries(e))t.startsWith("_")||(o[t]=r);o._parent=e}}for(let[e,t]of Object.entries(n))o[N(e)]=t;P.set(i,o);let l=O(t);return l&&(o._name=l,H.set(l,o),D.set(l,o)),el(o),o},deleteObject:function e(t){var r;let n;if(null==t||("number"==typeof t?n=P.get(t):"string"==typeof t?n=H.get(t):"object"==typeof t&&t._id&&(n=t),!n))return!1;let s=eb(n._className,"onRemove");if(s&&s(n),P.delete(n._id),n._name&&H.delete(n._name),n._isDatablock&&n._name&&D.delete(n._name),n._parent&&n._parent._children){let e=n._parent._children.indexOf(n);-1!==e&&n._parent._children.splice(e,1)}if(n._children)for(let t of[...n._children])e(t);return ea({type:"object.deleted",objectId:(r=n)._id,object:r}),!0},prop:function(e,t){let r=em(e);return null==r?"":r[N(t)]??""},setProp:function(e,t,r){let n=em(e);if(null==n)return r;let s=N(t),i=n[s];return n[s]=r,eu(n,s,r,i),r},getIndex:function(e,t){let r=em(e);return null==r?"":r[String(t)]??""},setIndex:function(e,t,r){let n=em(e);if(null==n)return r;let s=String(t),i=n[s];return n[s]=r,eu(n,s,r,i),r},propPostInc:function(e,t){return eg(e,N(t),1)},propPostDec:function(e,t){return eg(e,N(t),-1)},indexPostInc:function(e,t){return eg(e,String(t),1)},indexPostDec:function(e,t){return eg(e,String(t),-1)},key:function(e,...t){return e+t.join("_")},call:function(e,t,...r){if(null==e||("string"==typeof e||"number"==typeof e)&&null==(e=eC(e)))return"";let n=e.class||e._className||e._class;if(n){let s=ey(n,t,e,r);if(s.found)return e$(n,t,e,r),s.result}let s=e._superClass||q.get(n);for(;s;){let n=ey(s,t,e,r);if(n.found)return e$(s,t,e,r),n.result;s=q.get(s)}return""},nsCall:function(e,t,...r){let n=es(e,t);if(!n||0===n.length)return"";let s=en(e,t),i=n[n.length-1],o=er(s,n.length-1,()=>i(...r)),a=r[0];return a&&"object"==typeof a&&e$(e,t,a,r.slice(1)),o},nsRef:function(e,t){let r=es(e,t);if(!r||0===r.length)return null;let n=en(e,t),s=r[r.length-1];return(...e)=>er(n,r.length-1,()=>s(...e))},parent:function(e,t,r,...n){let s=es(e,t),i=en(e,t),o=et(i);if(s&&void 0!==o&&o>=1){let a=o-1,l=er(i,a,()=>s[a](r,...n));return r&&"object"==typeof r&&e$(e,t,r,n),l}let a=q.get(e);for(;a;){let e=es(a,t);if(e&&e.length>0){let s=er(en(a,t),e.length-1,()=>e[e.length-1](r,...n));return r&&"object"==typeof r&&e$(a,t,r,n),s}a=q.get(a)}return""},parentFunc:function(e,...t){let r=g.get(e);if(!r)return"";let n=e.toLowerCase(),s=et(n);if(void 0===s||s<1)return"";let i=s-1;return er(n,i,()=>r[i](...t))},add:function(e,t){return eA(e)+eA(t)},sub:function(e,t){return eA(e)-eA(t)},mul:function(e,t){return eA(e)*eA(t)},div:function(e,t){return eA(e)/eA(t)},neg:function(e){return-eA(e)},lt:function(e,t){return eA(e) eA(t)},ge:function(e,t){return eA(e)>=eA(t)},eq:function(e,t){return eA(e)===eA(t)},ne:function(e,t){return eA(e)!==eA(t)},mod:function(e,t){let r=0|Number(t);return 0===r?0:(0|Number(e))%r},bitand:function(e,t){return L(e)&L(t)},bitor:function(e,t){return L(e)|L(t)},bitxor:function(e,t){return L(e)^L(t)},shl:function(e,t){return L(L(e)<<(31&L(t)))},shr:function(e,t){return L(e)>>>(31&L(t))},bitnot:function(e){return~L(e)>>>0},concat:function(...e){return e.map(e=>String(e??"")).join("")},streq:function(e,t){return String(e??"").toLowerCase()===String(t??"").toLowerCase()},switchStr:function(e,t){let r=String(e??"").toLowerCase();for(let[e,n]of Object.entries(t))if("default"!==e&&N(e)===r)return void n();t.default&&t.default()},deref:eC,nameToId:function(e){let t=ex(e);return t?t._id:-1},isObject:function(e){return null!=e&&("object"==typeof e&&!!e._id||("number"==typeof e?P.has(e):"string"==typeof e&&H.has(e)))},isFunction:function(e){return g.has(e)||e.toLowerCase()in eh},isPackage:function(e){return b.has(e)},isActivePackage:function(e){let t=b.get(e);return t?.active??!1},getPackageList:function(){return y.join(" ")},locals:ev,onMethodCalled(e,t,r){let n=G.get(e);n||(n=new a,G.set(e,n));let s=n.get(t);return s||(s=[],n.set(t,s)),s.push(r),()=>{let e=s.indexOf(r);-1!==e&&s.splice(e,1)}}},eE={call(e,...t){let r=g.get(e);if(r&&r.length>0)return er(e.toLowerCase(),r.length-1,()=>r[r.length-1](...t));let n=eh[e.toLowerCase()];return n?n(...t):(k.warn(`Unknown function: ${e}(${t.map(e=>JSON.stringify(e)).join(", ")})`),"")}},e_=eS(F,{onSet:function(e,t,r){let n=N(e.startsWith("$")?e.slice(1):e);Object.is(t,r)||d(n)&&ea({type:"global.changed",name:n,value:t,previousValue:r})}}),ek={methods:m,functions:g,packages:b,activePackages:y,objectsById:P,objectsByName:H,datablocks:D,globals:F,executedScripts:z,failedScripts:Z,scripts:X,generatedCode:Y,pendingTimeouts:ec,startTime:Date.now()};function eR(e){let t=function(e){let t=Y.get(e);null==t&&(t=new s(void 0).generate(e),Y.set(e,t));return t}(e),r=ev();Function("$","$f","$g","$l",t)(ew,eE,e_,r)}function eN(e,t){return{execute(){if(t){let e=u(t);ek.executedScripts.add(e)}eR(e)}}}async function eL(t,r,n){let s=e.loadScript;if(!s){t.length>0&&k.warn("Script has exec() calls but no loadScript provided: %o",t);return}async function i(t){e.signal?.throwIfAborted();let i=u(t);if(ek.scripts.has(i)||ek.failedScripts.has(i))return;if(V&&V(i)){k.warn("Ignoring script: %s",t),ek.failedScripts.add(i);return}if(n.has(i))return;let o=r.get(i);if(o)return void await o;e.progress?.addItem(t);let a=(async()=>{let o,a=await s(t);if(null==a){k.warn("Script not found: %s",t),ek.failedScripts.add(i),e.progress?.completeItem();return}try{o=B(a,{filename:t})}catch(r){k.warn("Failed to parse script: %s %o",t,r),ek.failedScripts.add(i),e.progress?.completeItem();return}let l=new Set(n);l.add(i),await eL(o.execScriptPaths,r,l),ek.scripts.set(i,o),e.progress?.completeItem()})();r.set(i,a),await a}await Promise.all(t.map(i))}async function eO(t){let r=e.loadScript;if(!r)throw Error("loadFromPath requires loadScript option to be set");let n=u(t);if(ek.scripts.has(n))return eN(ek.scripts.get(n),t);e.progress?.addItem(t);let s=await r(t);if(null==s)throw e.progress?.completeItem(),Error(`Script not found: ${t}`);let i=await eI(s,{path:t});return e.progress?.completeItem(),i}async function eI(e,t){if(t?.path){let e=u(t.path);if(ek.scripts.has(e))return eN(ek.scripts.get(e),t.path)}return ej(B(e,{filename:t?.path}),t)}async function ej(t,r){let n=new Map,s=new Set;if(r?.path){let e=u(r.path);ek.scripts.set(e,t),s.add(e)}let i=[...t.execScriptPaths,...e.preloadScripts??[]];return await eL(i,n,s),eN(t,r?.path)}return ef={$:ew,$f:eE,$g:e_,state:ek,destroy:function(){for(let e of(U.length>0&&eo(),ek.pendingTimeouts))clearTimeout(e);ek.pendingTimeouts.clear(),J.clear()},executeAST:eR,loadFromPath:eO,loadFromSource:eI,loadFromAST:ej,call:(e,...t)=>eE.call(e,...t),getObjectByName:e=>H.get(e),subscribeRuntimeEvents:e=>(J.add(e),()=>{J.delete(e)})}}let j=(0,o.createLogger)("engineMethods");function M(){let e=new Set,t=0,r=0,n=null;function s(){for(let t of e)t()}return{get total(){return t},get loaded(){return r},get current(){return n},get progress(){return 0===t?0:r/t},on(t,r){e.add(r)},off(t,r){e.delete(r)},addItem(e){t++,n=e,s()},completeItem(){r++,n=null,s()},setCurrent(e){n=e,s()}}}function B(e,r){try{return t.default.parse(e)}catch(e){if(r?.filename&&e.location)throw Error(`${r.filename}:${e.location.start.line}:${e.location.start.column}: ${e.message}`,{cause:e});throw e}}function T(e){if("boolean"==typeof e)return e;if("number"==typeof e)return 0!==e;if("string"==typeof e){let t=e.trim().toLowerCase();return""!==t&&"0"!==t&&"false"!==t}return!!e}function P(){let e=Error("Operation aborted");return e.name="AbortError",e}function H(e){let t,{missionName:r,missionType:n,runtimeOptions:s,onMissionLoadDone:i}=e,{signal:o,fileSystem:a,globals:l={},preloadScripts:u=[],reactiveGlobalNames:c}=s??{},p=a?.findFiles("scripts/*Game.cs")??[],f=c?Array.from(new Set([...c,"missionRunning"])):void 0,h=I({...s,reactiveGlobalNames:f,globals:{...l,"$Host::Map":r,"$Host::MissionType":n},preloadScripts:[...u,...p]});(t=h.$.registerMethod.bind(h.$))("ShapeBase","playThread",(e,t,r)=>{e._threads||(e._threads={}),e._threads[Number(t)]={sequence:String(r),playing:!0,direction:!0}}),t("ShapeBase","stopThread",(e,t)=>{e._threads&&delete e._threads[Number(t)]}),t("ShapeBase","setThreadDir",(e,t,r)=>{e._threads||(e._threads={});let n=Number(t);e._threads[n]?e._threads[n].direction=!!Number(r):e._threads[n]={sequence:"",playing:!1,direction:!!Number(r)}}),t("ShapeBase","pauseThread",(e,t)=>{e._threads?.[Number(t)]&&(e._threads[Number(t)].playing=!1)}),t("ShapeBase","playAudio",()=>{}),t("ShapeBase","stopAudio",()=>{}),t("SimObject","getDatablock",e=>{let t=e.datablock;return t?h.getObjectByName(String(t))??"":""}),t("SimObject","getGroup",e=>e._parent??""),t("SimObject","getName",e=>e._name??""),t("SimObject","getType",()=>16384),t("SimGroup","getCount",e=>e._children?e._children.length:0),t("SimGroup","getObject",(e,t)=>{let r=e._children;return r?r[Number(t)]??"":""}),t("GameBase","isEnabled",()=>!0),t("GameBase","isDisabled",()=>!1),t("GameBase","setPoweredState",()=>{}),t("GameBase","setRechargeRate",()=>{}),t("GameBase","getRechargeRate",()=>0),t("GameBase","setEnergyLevel",()=>{}),t("GameBase","getEnergyLevel",()=>0),t("ShapeBase","getDamageLevel",()=>0),t("ShapeBase","setDamageLevel",()=>{}),t("ShapeBase","getRepairRate",()=>0),t("ShapeBase","setRepairRate",()=>{}),t("ShapeBase","getDamagePercent",()=>0),t("GameBase","getControllingClient",()=>0),t("SimObject","schedule",(e,t,r,...n)=>{let s=setTimeout(()=>{h.state.pendingTimeouts.delete(s);try{h.$.call(e,String(r),...n)}catch(t){j.error("schedule: error calling %s on %s: %o",r,e._id,t)}},Number(t)||0);return h.state.pendingTimeouts.add(s),s});let d=async function(){try{let e=await h.loadFromPath("scripts/server.cs");o?.throwIfAborted(),await h.loadFromPath(`missions/${r}.mis`),o?.throwIfAborted(),e.execute();let t=function(e,t){let{signal:r,onMissionLoadDone:n}=t;return new Promise((t,s)=>{let i=!1,o=!1,a=()=>T(e.$g.get("missionRunning")),l=()=>{i||(i=!0,h(),t())},u=e=>{i||(i=!0,h(),s(e))},c=t=>{if(!n||o)return;let r=t??e.getObjectByName("Game");r&&(o=!0,n(r))},p=()=>u(P()),f=e.subscribeRuntimeEvents(e=>{if("global.changed"===e.type&&"missionrunning"===e.name){T(e.value)&&(c(),l());return}"batch.flushed"===e.type&&a()&&(c(),l())});function h(){f(),r?.removeEventListener("abort",p)}if(r){if(r.aborted)return void u(P());r.addEventListener("abort",p,{once:!0})}a()&&(c(),l())})}(h,{signal:o,onMissionLoadDone:i}),n=await h.loadFromSource("CreateServer($Host::Map, $Host::MissionType);");o?.throwIfAborted(),n.execute(),await t}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}}();return{runtime:h,ready:d}}e.s(["createProgressTracker",()=>M],38433);let D=/^[ \t]*(DisplayName|MissionTypes|BriefingWAV|Bitmap|PlanetName)[ \t]*=[ \t]*(.+)$/i,F=/^[ \t]*-+[ \t]*([A-Z ]+)[ \t]+BEGIN[ \t]*-+$/i,G=/^[ \t]*-+[ \t]*([A-Z ]+)[ \t]+END[ \t]*-+$/i,q={arena:"Arena",bounty:"Bounty",cnh:"CnH",ctf:"CTF",dm:"DM",dnd:"DnD",hunters:"Hunters",lakrabbit:"LakRabbit",lakzm:"LakZM",lctf:"LCTF",none:"None",rabbit:"Rabbit",sctf:"SCtF",siege:"Siege",singleplayer:"SinglePlayer",tdm:"TDM",teamhunters:"TeamHunters",teamlak:"TeamLak",tr2:"TR2"};function J(e){let t=B(e),{pragma:r,sections:n}=function(e){let t={},r=[],n={name:null,comments:[]};for(let s of e.body)if("Comment"===s.type){let e=function(e){let t;return(t=e.match(F))?{type:"sectionBegin",name:t[1]}:(t=e.match(G))?{type:"sectionEnd",name:t[1]}:(t=e.match(D))?{type:"definition",identifier:t[1],value:t[2]}:null}(s.value);if(e)switch(e.type){case"definition":null===n.name?t[e.identifier.toLowerCase()]=e.value:n.comments.push(s.value);break;case"sectionBegin":(null!==n.name||n.comments.length>0)&&r.push(n),n={name:e.name.toUpperCase(),comments:[]};break;case"sectionEnd":null!==n.name&&r.push(n),n={name:null,comments:[]}}else n.comments.push(s.value)}return(null!==n.name||n.comments.length>0)&&r.push(n),{pragma:t,sections:r}}(t);function s(e){return n.find(t=>t.name===e)?.comments.map(e=>e.trimStart()).join("\n")??null}return{displayName:r.displayname??null,missionTypes:r.missiontypes?.split(/\s+/).filter(Boolean).map(e=>q[e.toLowerCase()]??e)??[],missionBriefing:s("MISSION BRIEFING"),briefingWav:r.briefingwav??null,bitmap:r.bitmap??null,planetName:r.planetname??null,missionBlurb:s("MISSION BLURB"),missionQuote:s("MISSION QUOTE"),missionString:s("MISSION STRING"),execScriptPaths:t.execScriptPaths,hasDynamicExec:t.hasDynamicExec,ast:t}}function U(e,t){if(e)return e[t.toLowerCase()]}function W(e){let[t,r,n]=(e.position??"0 0 0").split(" ").map(e=>parseFloat(e));return[r||0,n||0,t||0]}function K(e){let[t,r,n]=(e.scale??"1 1 1").split(" ").map(e=>parseFloat(e));return[r||0,n||0,t||0]}e.s(["getPosition",()=>W,"getProperty",()=>U,"getScale",()=>K,"normalizedMissionTypes",0,q,"parseMissionScript",()=>J],62395)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/22c22371d5c1dcba.js b/docs/_next/static/chunks/22c22371d5c1dcba.js new file mode 100644 index 00000000..bb629ada --- /dev/null +++ b/docs/_next/static/chunks/22c22371d5c1dcba.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,75840,e=>{e.v({BarFillEnergy:"PlayerHUD-module__-E1Scq__BarFillEnergy",BarFillHealth:"PlayerHUD-module__-E1Scq__BarFillHealth",BarTrack:"PlayerHUD-module__-E1Scq__BarTrack",Bars:"PlayerHUD-module__-E1Scq__Bars",Compass:"PlayerHUD-module__-E1Scq__Compass",CompassNSEW:"PlayerHUD-module__-E1Scq__CompassNSEW",CompassRing:"PlayerHUD-module__-E1Scq__CompassRing",PackInvCount:"PlayerHUD-module__-E1Scq__PackInvCount",PackInvIcon:"PlayerHUD-module__-E1Scq__PackInvIcon",PackInvInfinity:"PlayerHUD-module__-E1Scq__PackInvInfinity",PackInvItem:"PlayerHUD-module__-E1Scq__PackInvItem",PackInvItemActive:"PlayerHUD-module__-E1Scq__PackInvItemActive",PackInvItemDim:"PlayerHUD-module__-E1Scq__PackInvItemDim",PackInventoryHUD:"PlayerHUD-module__-E1Scq__PackInventoryHUD",PlayerHUD:"PlayerHUD-module__-E1Scq__PlayerHUD",Reticle:"PlayerHUD-module__-E1Scq__Reticle",ReticleDot:"PlayerHUD-module__-E1Scq__ReticleDot",ReticleImage:"PlayerHUD-module__-E1Scq__ReticleImage",TeamCount:"PlayerHUD-module__-E1Scq__TeamCount",TeamNameEnemy:"PlayerHUD-module__-E1Scq__TeamNameEnemy",TeamNameFriendly:"PlayerHUD-module__-E1Scq__TeamNameFriendly",TeamRow:"PlayerHUD-module__-E1Scq__TeamRow",TeamScore:"PlayerHUD-module__-E1Scq__TeamScore",TeamScores:"PlayerHUD-module__-E1Scq__TeamScores",TopRight:"PlayerHUD-module__-E1Scq__TopRight",WeaponHUD:"PlayerHUD-module__-E1Scq__WeaponHUD",WeaponSeparator:"PlayerHUD-module__-E1Scq__WeaponSeparator"})},75782,e=>{e.v({ChatColor0:"ChatWindow-module__mz35vq__ChatColor0",ChatColor1:"ChatWindow-module__mz35vq__ChatColor1",ChatColor2:"ChatWindow-module__mz35vq__ChatColor2",ChatColor3:"ChatWindow-module__mz35vq__ChatColor3",ChatColor4:"ChatWindow-module__mz35vq__ChatColor4",ChatColor5:"ChatWindow-module__mz35vq__ChatColor5",ChatColor6:"ChatWindow-module__mz35vq__ChatColor6",ChatColor7:"ChatWindow-module__mz35vq__ChatColor7",ChatColor8:"ChatWindow-module__mz35vq__ChatColor8",ChatColor9:"ChatWindow-module__mz35vq__ChatColor9",ChatContainer:"ChatWindow-module__mz35vq__ChatContainer",ChatMessage:"ChatWindow-module__mz35vq__ChatMessage",ChatWindow:"ChatWindow-module__mz35vq__ChatWindow"})},49776,e=>{"use strict";var a=e.i(43476),l=e.i(932),t=e.i(58647),n=e.i(12979),r=e.i(75840),o=e.i(71645),c=e.i(75782);let u=(0,o.lazy)(()=>e.A(60458).then(e=>({default:e.ChatInput}))),i=[],s={0:c.default.ChatColor0,1:c.default.ChatColor1,2:c.default.ChatColor2,3:c.default.ChatColor3,4:c.default.ChatColor4,5:c.default.ChatColor5,6:c.default.ChatColor6,7:c.default.ChatColor7,8:c.default.ChatColor8,9:c.default.ChatColor9},d=(0,o.memo)(function(){let e,n,r,i,s,d,h=(0,l.c)(12),p=(0,t.useEngineSelector)(_),f=(0,t.useEngineSelector)(m),C=(0,o.useRef)(null),k=f[f.length-1]?.id;return h[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{C.current&&(C.current.scrollTop=C.current.scrollHeight)},h[0]=e):e=h[0],h[1]!==k?(n=[k],h[1]=k,h[2]=n):n=h[2],(0,o.useEffect)(e,n),h[3]!==f?(r=f.map(g),h[3]=f,h[4]=r):r=h[4],h[5]!==r?(i=(0,a.jsx)("div",{ref:C,className:c.default.ChatWindow,children:r}),h[5]=r,h[6]=i):i=h[6],h[7]!==p?(s=p&&(0,a.jsx)(o.Suspense,{children:(0,a.jsx)(u,{})}),h[7]=p,h[8]=s):s=h[8],h[9]!==i||h[10]!==s?(d=(0,a.jsxs)("div",{className:c.default.ChatContainer,children:[i,s]}),h[9]=i,h[10]=s,h[11]=d):d=h[11],d});function _(e){return e.playback.recording?.source==="live"}function m(e){return e.playback.streamSnapshot?.chatMessages??i}function h(e,l){return(0,a.jsx)("span",{className:s[e.colorCode]??s[0],children:e.text},l)}function g(e){return(0,a.jsx)("div",{className:c.default.ChatMessage,hidden:!e.text,children:e.segments?e.segments.map(h):(0,a.jsxs)("span",{className:null!=e.colorCode&&s[e.colorCode]?s[e.colorCode]:s[0],children:[e.sender?`${e.sender}: `:"",e.text]})},e.id)}let p=(0,n.textureToUrl)("gui/hud_new_compass"),f=(0,n.textureToUrl)("gui/hud_new_NSEW");function C(){let e,n,o=(0,l.c)(3),c=(0,t.useEngineSelector)(k);if(null==c)return null;let u=180*c/Math.PI;o[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)("img",{src:p,alt:"",className:r.default.CompassRing}),o[0]=e):e=o[0];let i=`rotate(${-u}deg)`;return o[1]!==i?(n=(0,a.jsxs)("div",{className:r.default.Compass,children:[e,(0,a.jsx)("img",{src:f,alt:"",className:r.default.CompassNSEW,style:{transform:i}})]}),o[1]=i,o[2]=n):n=o[2],n}function k(e){return e.playback.streamSnapshot?.camera?.yaw}function S(){let e,n=(0,l.c)(2),o=(0,t.useEngineSelector)(y);if(null==o)return null;let c=Math.max(0,Math.min(100,100*o)),u=`${c}%`;return n[0]!==u?(e=(0,a.jsx)("div",{className:r.default.BarTrack,children:(0,a.jsx)("div",{className:r.default.BarFillHealth,style:{width:u}})}),n[0]=u,n[1]=e):e=n[1],e}function y(e){return e.playback.streamSnapshot?.status?.health}function v(){let e,n=(0,l.c)(2),o=(0,t.useEngineSelector)(x);if(null==o)return null;let c=Math.max(0,Math.min(100,100*o)),u=`${c}%`;return n[0]!==u?(e=(0,a.jsx)("div",{className:r.default.BarTrack,children:(0,a.jsx)("div",{className:r.default.BarFillEnergy,style:{width:u}})}),n[0]=u,n[1]=e):e=n[1],e}function x(e){return e.playback.streamSnapshot?.status?.energy}let I={weapon_sniper:"gui/hud_ret_sniper",weapon_shocklance:"gui/hud_ret_shocklance",weapon_targeting:"gui/hud_ret_targlaser"};function P(){let e,o=(0,l.c)(5),c=(0,t.useEngineSelector)(b);if(void 0===c)return null;let u=I[!c?"":c.replace(/\.dts$/i,"").toLowerCase()];if(u){let e,l;return o[0]!==u?(e=(0,n.textureToUrl)(u),o[0]=u,o[1]=e):e=o[1],o[2]!==e?(l=(0,a.jsx)("div",{className:r.default.Reticle,children:(0,a.jsx)("img",{src:e,alt:"",className:r.default.ReticleImage})}),o[2]=e,o[3]=l):l=o[3],l}return o[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)("div",{className:r.default.Reticle,children:(0,a.jsx)("div",{className:r.default.ReticleDot})}),o[4]=e):e=o[4],e}function b(e){let a=e.playback.streamSnapshot;if(!a||a.camera?.mode!=="first-person")return;let l=a.controlPlayerGhostId;if(l)return a.entities.find(e=>e.id===l)?.weaponShape}let w={0:{icon:"gui/hud_blaster",label:"Blaster"},1:{icon:"gui/hud_plasma",label:"Plasma"},2:{icon:"gui/hud_chaingun",label:"Chaingun"},3:{icon:"gui/hud_disc",label:"Spinfusor"},4:{icon:"gui/hud_grenlaunch",label:"GL"},5:{icon:"gui/hud_sniper",label:"Laser Rifle"},6:{icon:"gui/hud_elfgun",label:"ELF Gun"},7:{icon:"gui/hud_new_mortar",label:"Mortar"},8:{icon:"gui/hud_missiles",label:"Missile"},9:{icon:"gui/hud_targetlaser",label:"Targeting"},10:{icon:"gui/hud_shocklance",label:"Shocklance"},11:{icon:"gui/hud_disc",label:"Spinfusor"},12:{icon:"gui/hud_grenlaunch",label:"GL"},13:{icon:"gui/hud_chaingun",label:"Chaingun"},14:{icon:"gui/hud_targetlaser",label:"Targeting"},15:{icon:"gui/hud_targetlaser",label:"Targeting"},16:{icon:"gui/hud_shocklance",label:"Shocklance"},17:{icon:"gui/hud_new_mortar",label:"Mortar"}},j=new Map(Object.entries(w).map(([e,a])=>[Number(e),(0,n.textureToUrl)(a.icon)])),E=new Set([9,14,15]),N=(0,n.textureToUrl)("gui/hud_infinity");function U(e){let t,n,o,c,u=(0,l.c)(12),{slot:i,isSelected:s}=e,d=w[i.index];if(!d)return null;let _=i.ammo<0,m=`${r.default.PackInvItem} ${s?r.default.PackInvItemActive:r.default.PackInvItemDim}`;return u[0]!==i.index?(t=j.get(i.index),u[0]=i.index,u[1]=t):t=u[1],u[2]!==d.label||u[3]!==t?(n=(0,a.jsx)("img",{src:t,alt:d.label,className:r.default.PackInvIcon}),u[2]=d.label,u[3]=t,u[4]=n):n=u[4],u[5]!==_||u[6]!==i.ammo?(o=_?(0,a.jsx)("img",{src:N,alt:"\\u221E",className:r.default.PackInvInfinity}):(0,a.jsx)("span",{className:r.default.PackInvCount,children:i.ammo}),u[5]=_,u[6]=i.ammo,u[7]=o):o=u[7],u[8]!==m||u[9]!==n||u[10]!==o?(c=(0,a.jsxs)("div",{className:m,children:[n,o]}),u[8]=m,u[9]=n,u[10]=o,u[11]=c):c=u[11],c}function D(){let e,n,o,c,u,i,s=(0,l.c)(15),d=(0,t.useEngineSelector)(H);if(!d||!d.slots.length)return null;if(s[0]!==d.slots){for(let a of(n=[],e=[],d.slots))E.has(a.index)?e.push(a):n.push(a);s[0]=d.slots,s[1]=e,s[2]=n}else e=s[1],n=s[2];return s[3]!==n||s[4]!==d?(o=n.map(e=>(0,a.jsx)(U,{slot:e,isSelected:e.index===d.activeIndex},e.index)),s[3]=n,s[4]=d,s[5]=o):o=s[5],s[6]!==e.length?(c=e.length>0&&(0,a.jsx)("div",{className:r.default.WeaponSeparator}),s[6]=e.length,s[7]=c):c=s[7],s[8]!==e||s[9]!==d?(u=e.map(e=>(0,a.jsx)(U,{slot:e,isSelected:e.index===d.activeIndex},e.index)),s[8]=e,s[9]=d,s[10]=u):u=s[10],s[11]!==o||s[12]!==c||s[13]!==u?(i=(0,a.jsxs)("div",{className:r.default.WeaponHUD,children:[o,c,u]}),s[11]=o,s[12]=c,s[13]=u,s[14]=i):i=s[14],i}function H(e){return e.playback.streamSnapshot?.weaponsHud}let T={1:"Storm",2:"Inferno",3:"Starwolf",4:"Diamond Sword",5:"Blood Eagle",6:"Phoenix"};function q(){let e,n,o,c=(0,l.c)(11),u=(0,t.useEngineSelector)(R),i=(0,t.useEngineSelector)(W);if(!u?.length)return null;if(c[0]!==i||c[1]!==u){let l,t;c[4]!==i?(l=(e,a)=>{if(i){if(e.teamId===i)return -1;if(a.teamId===i)return 1}return e.teamId-a.teamId},c[4]=i,c[5]=l):l=c[5];let o=[...u].sort(l);e=r.default.TeamScores,c[6]!==i?(t=e=>{let l=i>0&&e.teamId===i,t=e.name||(T[e.teamId]??`Team ${e.teamId}`);return(0,a.jsxs)("div",{className:r.default.TeamRow,children:[(0,a.jsx)("span",{className:l?r.default.TeamNameFriendly:r.default.TeamNameEnemy,children:t}),(0,a.jsx)("span",{className:r.default.TeamScore,children:e.score}),(0,a.jsxs)("span",{className:r.default.TeamCount,children:["(",e.playerCount,")"]})]},e.teamId)},c[6]=i,c[7]=t):t=c[7],n=o.map(t),c[0]=i,c[1]=u,c[2]=e,c[3]=n}else e=c[2],n=c[3];return c[8]!==e||c[9]!==n?(o=(0,a.jsx)("div",{className:e,children:n}),c[8]=e,c[9]=n,c[10]=o):o=c[10],o}function W(e){return e.playback.streamSnapshot?.playerSensorGroup}function R(e){return e.playback.streamSnapshot?.teamScores}let B=new Map(Object.entries({0:"gui/hud_new_packammo",1:"gui/hud_new_packcloak",2:"gui/hud_new_packenergy",3:"gui/hud_new_packrepair",4:"gui/hud_new_packsatchel",5:"gui/hud_new_packshield",6:"gui/hud_new_packinventory",7:"gui/hud_new_packmotionsens",8:"gui/hud_new_packradar",9:"gui/hud_new_packturretout",10:"gui/hud_new_packturretin",11:"gui/hud_new_packsensjam",12:"gui/hud_new_packturret",13:"gui/hud_new_packturret",14:"gui/hud_new_packturret",15:"gui/hud_new_packturret",16:"gui/hud_new_packturret",17:"gui/hud_new_packturret",18:"gui/hud_satchel_unarmed",19:"gui/hud_new_packenergy"}).map(([e,a])=>[Number(e),(0,n.textureToUrl)(a)])),M=new Map(Object.entries({1:"gui/hud_new_packcloak_armed",3:"gui/hud_new_packrepair_armed",4:"gui/hud_satchel_armed",5:"gui/hud_new_packshield_armed",11:"gui/hud_new_packsensjam_armed"}).map(([e,a])=>[Number(e),(0,n.textureToUrl)(a)])),z={0:{icon:"gui/hud_handgren",label:"Grenade"},1:{icon:"gui/hud_mine",label:"Mine"},2:{icon:"gui/hud_beacon",label:"Beacon"},3:{icon:"gui/hud_medpack",label:"Repair Kit"}},F=new Map(Object.entries(z).map(([e,a])=>[Number(e),(0,n.textureToUrl)(a.icon)]));function $(){let e,n,o,c,u,i,s,d=(0,l.c)(25),_=(0,t.useEngineSelector)(O),m=(0,t.useEngineSelector)(G),h=_&&_.packIndex>=0;if(h){let a,l;d[0]!==_.active||d[1]!==_.packIndex?(a=_.active?M.get(_.packIndex):void 0,d[0]=_.active,d[1]=_.packIndex,d[2]=a):a=d[2];let t=a;d[3]!==t||d[4]!==_.packIndex?(l=t??B.get(_.packIndex),d[3]=t,d[4]=_.packIndex,d[5]=l):l=d[5],e=l}if(d[6]!==m){if(n=new Map,m)for(let e of m.slots)n.set(e.slot,e.count);d[6]=m,d[7]=n}else n=d[7];if(d[8]!==_||d[9]!==n||d[10]!==h||d[11]!==e){i=Symbol.for("react.early_return_sentinel");e:{let l,t=Object.keys(z).map(Number).sort(A);if(!h&&!n.size){i=null;break e}o=r.default.PackInventoryHUD,d[16]!==_||d[17]!==e?(c=e&&(0,a.jsxs)("div",{className:`${r.default.PackInvItem} ${_.active?r.default.PackInvItemActive:""}`,children:[(0,a.jsx)("img",{src:e,alt:"",className:r.default.PackInvIcon}),(0,a.jsx)("span",{className:r.default.PackInvCount,children:_.text||" "})]}),d[16]=_,d[17]=e,d[18]=c):c=d[18],d[19]!==n?(l=e=>{let l=z[e],t=F.get(e);return l&&t?(0,a.jsxs)("div",{className:r.default.PackInvItem,children:[(0,a.jsx)("img",{src:t,alt:l.label,className:r.default.PackInvIcon}),(0,a.jsx)("span",{className:r.default.PackInvCount,children:n.get(e)??0})]},e):null},d[19]=n,d[20]=l):l=d[20],u=t.map(l)}d[8]=_,d[9]=n,d[10]=h,d[11]=e,d[12]=o,d[13]=c,d[14]=u,d[15]=i}else o=d[12],c=d[13],u=d[14],i=d[15];return i!==Symbol.for("react.early_return_sentinel")?i:(d[21]!==o||d[22]!==c||d[23]!==u?(s=(0,a.jsxs)("div",{className:o,children:[c,u]}),d[21]=o,d[22]=c,d[23]=u,d[24]=s):s=d[24],s)}function A(e,a){return e-a}function G(e){return e.playback.streamSnapshot?.inventoryHud}function O(e){return e.playback.streamSnapshot?.backpackHud}function L(){let e,n,o,c,u,i,s,_=(0,l.c)(12),m=(0,t.useEngineSelector)(K);return _[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(d,{}),_[0]=e):e=_[0],_[1]!==m?(n=m&&(0,a.jsxs)("div",{className:r.default.Bars,children:[(0,a.jsx)(S,{}),(0,a.jsx)(v,{})]}),_[1]=m,_[2]=n):n=_[2],_[3]===Symbol.for("react.memo_cache_sentinel")?(o=(0,a.jsx)(C,{}),_[3]=o):o=_[3],_[4]!==n?(c=(0,a.jsxs)("div",{className:r.default.TopRight,children:[n,o]}),_[4]=n,_[5]=c):c=_[5],_[6]!==m?(u=m&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(D,{}),(0,a.jsx)($,{}),(0,a.jsx)(P,{})]}),_[6]=m,_[7]=u):u=_[7],_[8]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)(q,{}),_[8]=i):i=_[8],_[9]!==c||_[10]!==u?(s=(0,a.jsxs)("div",{className:r.default.PlayerHUD,children:[e,c,u,i]}),_[9]=c,_[10]=u,_[11]=s):s=_[11],s}function K(e){return!!e.playback.streamSnapshot?.controlPlayerGhostId}e.s(["PlayerHUD",()=>L],49776)},60458,e=>{e.v(a=>Promise.all(["static/chunks/543f866d9a9c134b.css","static/chunks/450cc5a89761fca0.js"].map(a=>e.l(a))).then(()=>a(52728)))}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/273b16b21a9dcb92.js b/docs/_next/static/chunks/273b16b21a9dcb92.js new file mode 100644 index 00000000..1d55c706 --- /dev/null +++ b/docs/_next/static/chunks/273b16b21a9dcb92.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81847,e=>{e.v({Dialog:"GameDialog-module__C6hZDW__Dialog",DialogButton:"GameDialog-module__C6hZDW__DialogButton",Overlay:"GameDialog-module__C6hZDW__Overlay",Secondary:"GameDialog-module__C6hZDW__Secondary GameDialog-module__C6hZDW__DialogButton"})},66438,e=>{e.v({Bullet:"GuiMarkup-module__CLgNnq__Bullet",GuiMarkup:"GuiMarkup-module__CLgNnq__GuiMarkup"})},41973,e=>{e.v({Body:"MapInfoDialog-module__m0lXla__Body",CloseButton:"MapInfoDialog-module__m0lXla__CloseButton "+e.i(81847).DialogButton,Dialog:"MapInfoDialog-module__m0lXla__Dialog "+e.i(81847).Dialog,Footer:"MapInfoDialog-module__m0lXla__Footer",Hint:"MapInfoDialog-module__m0lXla__Hint",Left:"MapInfoDialog-module__m0lXla__Left",MapBlurb:"MapInfoDialog-module__m0lXla__MapBlurb",MapMeta:"MapInfoDialog-module__m0lXla__MapMeta",MapPlanet:"MapInfoDialog-module__m0lXla__MapPlanet",MapQuote:"MapInfoDialog-module__m0lXla__MapQuote",MusicButton:"MapInfoDialog-module__m0lXla__MusicButton",MusicTrack:"MapInfoDialog-module__m0lXla__MusicTrack",MusicTrackName:"MapInfoDialog-module__m0lXla__MusicTrackName",Overlay:"MapInfoDialog-module__m0lXla__Overlay "+e.i(81847).Overlay,PreviewImage:"MapInfoDialog-module__m0lXla__PreviewImage",PreviewImageFloating:"MapInfoDialog-module__m0lXla__PreviewImageFloating",Section:"MapInfoDialog-module__m0lXla__Section",SectionTitle:"MapInfoDialog-module__m0lXla__SectionTitle",Title:"MapInfoDialog-module__m0lXla__Title"})},94247,e=>{"use strict";var t=e.i(43476),a=e.i(932),l=e.i(71645),o=e.i(11152),i=e.i(66027),n=e.i(12979),r=e.i(91996),s=e.i(66438);let u=new Set(["spop","spush","lmargin","font","color","bitmap","a","/a"]),c=new Map;function m(e){let l,o=(0,a.c)(5),{name:i}=e;o[0]!==i?(l=function(e){let t;if(c.has(e))return c.get(e);try{t=(0,n.getUrlForPath)((0,r.getStandardTextureResourceKey)(`textures/gui/${e}`))}catch{t=null}return c.set(e,t),t}(i),o[0]=i,o[1]=l):l=o[1];let u=l;if(u){let e;return o[2]!==u?(e=(0,t.jsx)("img",{src:u,alt:"",className:s.default.Bitmap}),o[2]=u,o[3]=e):e=o[3],e}if(/bullet/i.test(i)){let e;return o[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("span",{className:s.default.Bullet,children:"•"}),o[4]=e):e=o[4],e}return null}let p=/<(?:font|color|bitmap|just|lmargin|a):/i;function d(e){let o,i,n=(0,a.c)(4),{markup:r}=e;n[0]!==r?(o=function(e){let a=e.split(/<([^><]+)>/g).map((e,t)=>{if(t%2==0)return e?{type:"text",value:e}:null;{let[t,...a]=e.split(":");return u.has(t.toLowerCase())?{type:"tag",name:t,args:a}:{type:"text",value:`<${e}>`}}}).filter(e=>null!=e),o={type:"span",source:"root",style:{},children:[]},i=o,n=[i],r=e=>null!=e.children&&e.children.some(e=>"string"==typeof e||r(e));for(let e of a)switch(e.type){case"text":i.children.push(e.value);break;case"tag":switch(e.name){case"spush":{let e={type:"span",source:"spush",style:{},children:[]};i.children.push(e),i=e,n.push(i);break}case"spop":if("root"!==i.source){let e=n.pop();for(;"spush"!==e.source;)e=n.pop();i=n[n.length-1]}break;case"lmargin":break;case"font":{let t=function(e){let[t,a]=e;return{fontDescription:t,fontSize:a?Math.max(11,Math.min(parseInt(a.trim(),10),16)):void 0}}(e.args).fontSize;if(r(i)){let e={type:"span",source:"spush",style:{fontSize:t},children:[]};i.children.push(e),i=e,n.push(i)}else i.style.fontSize=t;break}case"color":if(r(i)){let t={type:"span",source:"spush",style:{color:`#${e.args[0].trim()}`},children:[]};i.children.push(t),i=t,n.push(i)}else i.style.color=`#${e.args[0].trim()}`;break;case"bitmap":{let t={type:"bitmap",value:e.args[0]};i.children.push(t);break}case"a":{let t=e.args[0].trim().split(" "),a=2===t.length&&"wwwlink"===t[0]?t[1]:t[0],l={type:"a",source:"a",value:`http://${a}`,style:{},children:[]};i.children.push(l),i=l,n.push(i);break}case"/a":{let e=n.pop();for(;"a"!==e.source;)e=n.pop();i=n[n.length-1]}}}return function e(a){switch(a.type){case"span":return l.default.createElement("span",{style:0===Object.keys(a.style).length?void 0:a.style},...a.children.map(t=>"string"==typeof t?t:e(t)));case"a":return l.default.createElement("a",{href:a.value,style:0===Object.keys(a.style).length?void 0:a.style,rel:"noopener noreferrer",target:"_blank"},...a.children.map(t=>"string"==typeof t?t:e(t)));case"bitmap":return(0,t.jsx)(m,{name:a.value})}}(o)}(r),n[0]=r,n[1]=o):o=n[1];let c=o;return n[2]!==c?(i=(0,t.jsx)("div",{className:s.default.GuiMarkup,children:c}),n[2]=c,n[3]=i):i=n[3],i}var f=e.i(41973);function _(e){let o,i,n,r=(0,a.c)(7),{src:s,alt:u,className:c}=e,m=void 0===c?f.default.PreviewImage:c,[p,d]=(0,l.useState)(null);return(r[0]!==s?(o=()=>{let e,t=!1;return fetch(s).then(M).then(y).then(g).then(a=>{!t&&a&&d(e=URL.createObjectURL(a))}).catch(h),()=>{t=!0,e&&URL.revokeObjectURL(e)}},i=[s],r[0]=s,r[1]=o,r[2]=i):(o=r[1],i=r[2]),(0,l.useEffect)(o,i),p)?(r[3]!==u||r[4]!==m||r[5]!==p?(n=(0,t.jsx)("img",{src:p,alt:u,className:m}),r[3]=u,r[4]=m,r[5]=p,r[6]=n):n=r[6],n):null}function h(){}function g(e){return new Promise(t=>{let a=document.createElement("canvas");a.width=e.width,a.height=e.height,a.getContext("2d")?.drawImage(e,0,0),e.close(),a.toBlob(t)})}function y(e){return createImageBitmap(e,{colorSpaceConversion:"none"})}function M(e){return e.blob()}function v(e){let i,r,s,u,c,m,p,d,_,h,g,y=(0,a.c)(22),{track:M}=e,[v,x]=(0,l.useState)(!1),[b,j]=(0,l.useState)(!0),k=(0,l.useRef)(null);y[0]!==M?(i=M.toLowerCase(),y[0]=M,y[1]=i):i=y[1];let D=`${n.RESOURCE_ROOT_URL}music/${i}.mp3`;y[2]===Symbol.for("react.memo_cache_sentinel")?(r=()=>()=>{k.current?.pause()},s=[],y[2]=r,y[3]=s):(r=y[2],s=y[3]),(0,l.useEffect)(r,s),y[4]!==v?(u=()=>{let e=k.current;e&&(v?e.pause():e.play().catch(()=>j(!1)))},y[4]=v,y[5]=u):u=y[5];let w=u;return y[6]===Symbol.for("react.memo_cache_sentinel")?(c=()=>x(!0),m=()=>x(!1),p=()=>j(!1),y[6]=c,y[7]=m,y[8]=p):(c=y[6],m=y[7],p=y[8]),y[9]!==D?(d=(0,t.jsx)("audio",{ref:k,src:D,loop:!0,onPlay:c,onPause:m,onError:p}),y[9]=D,y[10]=d):d=y[10],y[11]!==M?(_=(0,t.jsx)("span",{className:f.default.MusicTrackName,children:M}),y[11]=M,y[12]=_):_=y[12],y[13]!==b||y[14]!==v||y[15]!==w?(h=b&&(0,t.jsx)("button",{className:f.default.MusicButton,onClick:w,"aria-label":v?"Pause music":"Play music",children:v?(0,t.jsx)(o.FaVolumeUp,{}):(0,t.jsx)(o.FaVolumeMute,{})}),y[13]=b,y[14]=v,y[15]=w,y[16]=h):h=y[16],y[17]!==v||y[18]!==h||y[19]!==d||y[20]!==_?(g=(0,t.jsxs)("div",{className:f.default.MusicTrack,"data-playing":v,children:[d,_,h]}),y[17]=v,y[18]=h,y[19]=d,y[20]=_,y[21]=g):g=y[21],g}function x(e){var o,s,u;let c,m,h,g,y,M,x,D,w,I,N,B,S,C,P,L,T,X,E,O,R,U,F,$,G,K,Q,q,W,Z,z,A,H,V,J,Y,ee,et=(0,a.c)(100),{onClose:ea,missionName:el,missionType:eo}=e,{data:ei}=((ee=(0,a.c)(2))[0]!==el?(Y={queryKey:["parsedMission",el],queryFn:()=>(0,n.loadMission)(el)},ee[0]=el,ee[1]=Y):Y=ee[1],(0,i.useQuery)(Y)),en=(0,l.useRef)(null);et[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{en.current?.focus();try{document.exitPointerLock()}catch{}},m=[],et[0]=c,et[1]=m):(c=et[0],m=et[1]),(0,l.useEffect)(c,m),et[2]!==ea?(h=()=>{let e=e=>{if("Escape"===e.key)ea();else if("k"===e.key&&(e.metaKey||e.ctrlKey))return void ea();e.stopImmediatePropagation()};return window.addEventListener("keydown",e,{capture:!0}),window.addEventListener("keyup",k,{capture:!0}),()=>{window.removeEventListener("keydown",e,{capture:!0}),window.removeEventListener("keyup",k,{capture:!0})}},g=[ea],et[2]=ea,et[3]=h,et[4]=g):(h=et[3],g=et[4]),(0,l.useEffect)(h,g),et[5]!==ei?(y=ei?function(e){for(let t of e.body){if("ObjectDeclaration"!==t.type)continue;let{instanceName:e,body:a}=t;if(e&&"Identifier"===e.type&&"missiongroup"===e.name.toLowerCase()){let e={};for(let t of a){if("Assignment"!==t.type)continue;let{target:a,value:l}=t;"Identifier"===a.type&&"StringLiteral"===l.type&&(e[a.name.toLowerCase()]=l.value)}return e}}return{}}(ei.ast):{},et[5]=ei,et[6]=y):y=et[6];let er=y;et[7]!==el||et[8]!==ei?(M=ei?function(e,t){if(e)try{let t=(0,r.getStandardTextureResourceKey)(`textures/gui/${e}`);return(0,n.getUrlForPath)(t)}catch{}try{let e=(0,r.getStandardTextureResourceKey)(`textures/gui/Load_${t}`);return(0,n.getUrlForPath)(e)}catch{}return null}(ei.bitmap,el):null,et[7]=el,et[8]=ei,et[9]=M):M=et[9];let es=M,eu=ei?.displayName??el;et[10]!==eo?(x=eo.toLowerCase(),et[10]=eo,et[11]=x):x=et[11];let ec="singleplayer"===x,em=er.musictrack;if(et[12]!==es||et[13]!==eu||et[14]!==ec||et[15]!==eo||et[16]!==ea||et[17]!==ei){let e,a,l,i,n,r,c=ei?.missionString?(o=ei.missionString,r=eo.toUpperCase(),o.split("\n").flatMap(e=>{let t=e.match(/^\[([^\]]+)\]/);return t&&!t[1].toUpperCase().split(/\s+/).includes(r)?[]:[e.replace(/^\[[^\]]+\]/,"")]}).join("\n")):null;if(et[36]!==ei?.missionQuote){if(s=i=ei?.missionQuote?.trim()??"",l="",e="",!(a=p.test(s)))for(let t of i.split("\n")){let a=t.trim();a.match(/^--[^-]/)?e=a.replace(/^-+\s*/,"").trim():a&&(l+=(l?"\n":"")+a)}et[36]=ei?.missionQuote,et[37]=e,et[38]=a,et[39]=l,et[40]=i}else e=et[37],a=et[38],l=et[39],i=et[40];(U=f.default.Overlay,F=ea,C=en,P=f.default.Dialog,L=j,T=b,X="dialog",E="true",O="Map Information",R=-1,S=f.default.Body,$=f.default.Left,et[41]!==es||et[42]!==eu||et[43]!==ec?(G=es&&ec&&(0,t.jsx)(_,{className:f.default.PreviewImageFloating,src:es,alt:`${eu} preview`},es),et[41]=es,et[42]=eu,et[43]=ec,et[44]=G):G=et[44],et[45]!==eu?(D=(0,t.jsx)("h1",{className:f.default.Title,children:eu}),et[45]=eu,et[46]=D):D=et[46],et[47]!==ei?(n=ei?.planetName&&(0,t.jsx)("span",{className:f.default.MapPlanet,children:ei.planetName}),et[47]=ei,et[48]=n):n=et[48],et[49]!==n?(w=(0,t.jsx)("div",{className:f.default.MapMeta,children:n}),et[49]=n,et[50]=w):w=et[50],et[51]!==e||et[52]!==a||et[53]!==l||et[54]!==i?(I=a?(0,t.jsx)("blockquote",{className:f.default.MapQuote,children:(0,t.jsx)(d,{markup:i})}):l?(0,t.jsxs)("blockquote",{className:f.default.MapQuote,children:[(0,t.jsx)("p",{children:l}),e&&(0,t.jsxs)("cite",{children:["— ",e]})]}):null,et[51]=e,et[52]=a,et[53]=l,et[54]=i,et[55]=I):I=et[55],et[56]!==ei)?(N=ei?.missionBlurb&&(0,t.jsx)("div",{className:f.default.MapBlurb,children:(u=ei.missionBlurb,p.test(u))?(0,t.jsx)(d,{markup:ei.missionBlurb.trim()}):ei.missionBlurb.trim()}),et[56]=ei,et[57]=N):N=et[57],B=c&&c.trim()&&(0,t.jsx)("div",{className:f.default.Section,children:(0,t.jsx)(d,{markup:c})}),et[12]=es,et[13]=eu,et[14]=ec,et[15]=eo,et[16]=ea,et[17]=ei,et[18]=D,et[19]=w,et[20]=I,et[21]=N,et[22]=B,et[23]=S,et[24]=C,et[25]=P,et[26]=L,et[27]=T,et[28]=X,et[29]=E,et[30]=O,et[31]=R,et[32]=U,et[33]=F,et[34]=$,et[35]=G}else D=et[18],w=et[19],I=et[20],N=et[21],B=et[22],S=et[23],C=et[24],P=et[25],L=et[26],T=et[27],X=et[28],E=et[29],O=et[30],R=et[31],U=et[32],F=et[33],$=et[34],G=et[35];return et[58]!==ei?(K=ei?.missionBriefing&&(0,t.jsxs)("div",{className:f.default.Section,children:[(0,t.jsx)("h2",{className:f.default.SectionTitle,children:"Mission Briefing"}),(0,t.jsx)(d,{markup:ei.missionBriefing})]}),et[58]=ei,et[59]=K):K=et[59],et[60]!==em?(Q=em&&(0,t.jsx)(v,{track:em}),et[60]=em,et[61]=Q):Q=et[61],et[62]!==D||et[63]!==w||et[64]!==I||et[65]!==N||et[66]!==B||et[67]!==K||et[68]!==Q||et[69]!==$||et[70]!==G?(q=(0,t.jsxs)("div",{className:$,children:[G,D,w,I,N,B,K,Q]}),et[62]=D,et[63]=w,et[64]=I,et[65]=N,et[66]=B,et[67]=K,et[68]=Q,et[69]=$,et[70]=G,et[71]=q):q=et[71],et[72]!==es||et[73]!==eu||et[74]!==ec?(W=es&&!ec&&(0,t.jsx)(_,{src:es,alt:`${eu} preview`},es),et[72]=es,et[73]=eu,et[74]=ec,et[75]=W):W=et[75],et[76]!==S||et[77]!==q||et[78]!==W?(Z=(0,t.jsxs)("div",{className:S,children:[q,W]}),et[76]=S,et[77]=q,et[78]=W,et[79]=Z):Z=et[79],et[80]!==ea?(z=(0,t.jsx)("button",{className:f.default.CloseButton,onClick:ea,children:"Close"}),et[80]=ea,et[81]=z):z=et[81],et[82]===Symbol.for("react.memo_cache_sentinel")?(A=(0,t.jsx)("span",{className:f.default.Hint,children:"Esc to close"}),et[82]=A):A=et[82],et[83]!==z?(H=(0,t.jsxs)("div",{className:f.default.Footer,children:[z,A]}),et[83]=z,et[84]=H):H=et[84],et[85]!==C||et[86]!==P||et[87]!==L||et[88]!==T||et[89]!==X||et[90]!==E||et[91]!==O||et[92]!==R||et[93]!==Z||et[94]!==H?(V=(0,t.jsxs)("div",{ref:C,className:P,onClick:L,onKeyDown:T,role:X,"aria-modal":E,"aria-label":O,tabIndex:R,children:[Z,H]}),et[85]=C,et[86]=P,et[87]=L,et[88]=T,et[89]=X,et[90]=E,et[91]=O,et[92]=R,et[93]=Z,et[94]=H,et[95]=V):V=et[95],et[96]!==U||et[97]!==F||et[98]!==V?(J=(0,t.jsx)("div",{className:U,onClick:F,children:V}),et[96]=U,et[97]=F,et[98]=V,et[99]=J):J=et[99],J}function b(e){return e.stopPropagation()}function j(e){return e.stopPropagation()}function k(e){e.stopImmediatePropagation()}e.s(["MapInfoDialog",()=>x],94247)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/28c98fb093e4695f.css b/docs/_next/static/chunks/28c98fb093e4695f.css new file mode 100644 index 00000000..696d899c --- /dev/null +++ b/docs/_next/static/chunks/28c98fb093e4695f.css @@ -0,0 +1,2 @@ +.PlayerHUD-module__-E1Scq__PlayerHUD{z-index:1;pointer-events:none;position:absolute;inset:0}.PlayerHUD-module__-E1Scq__TopRight{align-items:flex-start;gap:6px;display:flex;position:absolute;top:10px;right:10px}.PlayerHUD-module__-E1Scq__Compass{flex-shrink:0;width:64px;height:64px;position:relative}.PlayerHUD-module__-E1Scq__CompassRing{image-rendering:auto;width:100%;height:100%;position:absolute;top:0;left:0}.PlayerHUD-module__-E1Scq__CompassNSEW{width:100%;height:100%;image-rendering:pixelated;position:absolute;top:0;left:0}.PlayerHUD-module__-E1Scq__Bars{flex-direction:column;gap:3px;padding-top:10px;display:flex}.PlayerHUD-module__-E1Scq__BarTrack{background:#00000080;border:1px solid #ffffff26;width:120px;height:10px;overflow:hidden}.PlayerHUD-module__-E1Scq__BarFillHealth{background:#2ecc40;height:100%;transition:width .15s ease-out}.PlayerHUD-module__-E1Scq__BarFillEnergy{background:#0af;height:100%;transition:width .15s ease-out}.PlayerHUD-module__-E1Scq__WeaponHUD{flex-direction:column;gap:2px;display:flex;position:absolute;top:50%;right:8px;transform:translateY(-50%)}.PlayerHUD-module__-E1Scq__WeaponSeparator{height:6px}.PlayerHUD-module__-E1Scq__TeamScores{font-family:monospace;font-size:12px;position:absolute;bottom:8px;left:8px}.PlayerHUD-module__-E1Scq__TeamRow{background:#00323ca6;gap:6px;padding:2px 8px;display:flex}.PlayerHUD-module__-E1Scq__TeamRow+.PlayerHUD-module__-E1Scq__TeamRow{border-top:1px solid #80ffc826}.PlayerHUD-module__-E1Scq__TeamNameFriendly{color:#2ecc40;min-width:60px}.PlayerHUD-module__-E1Scq__TeamNameEnemy{color:#e44;min-width:60px}.PlayerHUD-module__-E1Scq__TeamScore{color:#fff;text-align:right;min-width:24px;font-weight:700}.PlayerHUD-module__-E1Scq__TeamCount{color:#9ba;text-align:right;min-width:24px}.PlayerHUD-module__-E1Scq__PackInventoryHUD{align-items:center;gap:4px;display:flex;position:absolute;bottom:8px;right:8px}.PlayerHUD-module__-E1Scq__PackInvItem{background:#00323ca6;border:1px solid #80ffc826;flex-direction:column;justify-content:center;align-items:center;gap:1px;padding:4px;display:flex}.PlayerHUD-module__-E1Scq__PackInvItemActive{border-color:#80ffc880;box-shadow:0 0 6px #80ffc84d}.PlayerHUD-module__-E1Scq__PackInvItemDim{opacity:.5}.PlayerHUD-module__-E1Scq__PackInvIcon{image-rendering:pixelated;display:block}.PlayerHUD-module__-E1Scq__PackInvCount{color:#bfe;text-align:center;min-width:12px;font-family:monospace;font-size:11px}.PlayerHUD-module__-E1Scq__PackInvInfinity{image-rendering:pixelated;opacity:.8;display:block}.PlayerHUD-module__-E1Scq__Reticle{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.PlayerHUD-module__-E1Scq__ReticleImage{opacity:.85;width:64px;height:64px;image-rendering:pixelated}.PlayerHUD-module__-E1Scq__ReticleDot{background:#2ecc40b3;border-radius:50%;width:4px;height:4px;box-shadow:0 0 4px #2ecc4080} +.ChatWindow-module__mz35vq__ChatContainer{pointer-events:auto;border:1px solid #2cacb566;flex-direction:column;width:400px;max-width:50%;display:flex;position:absolute;top:8px;left:8px}.ChatWindow-module__mz35vq__ChatWindow{-webkit-user-select:text;user-select:text;scrollbar-width:thin;scrollbar-color:#2cacb566 transparent;background:#00323ca6;min-height:4em;max-height:12.5em;padding:6px;font-size:12px;line-height:1.25;overflow-y:auto}.ChatWindow-module__mz35vq__ChatMessage{color:#2cacb5;padding:2px 0}.ChatWindow-module__mz35vq__ChatColor0{color:#2cacb5}.ChatWindow-module__mz35vq__ChatColor1{color:#04eb69}.ChatWindow-module__mz35vq__ChatColor2{color:#dbc880}.ChatWindow-module__mz35vq__ChatColor3{color:#4dfd5f}.ChatWindow-module__mz35vq__ChatColor4{color:#28e7f0}.ChatWindow-module__mz35vq__ChatColor5{color:#c8c832}.ChatWindow-module__mz35vq__ChatColor6{color:#c8c8c8}.ChatWindow-module__mz35vq__ChatColor7{color:#dcdc14}.ChatWindow-module__mz35vq__ChatColor8{color:#9696fa}.ChatWindow-module__mz35vq__ChatColor9{color:#3cdc96} diff --git a/docs/_next/static/chunks/2afaf0aea010c2be.js b/docs/_next/static/chunks/2afaf0aea010c2be.js new file mode 100644 index 00000000..6a5ffb7a --- /dev/null +++ b/docs/_next/static/chunks/2afaf0aea010c2be.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,9672,e=>{"use strict";function t(e,t){return e[t.toLowerCase()]}function s(e,s){let n=t(e,s);if(null==n)return;let i=parseFloat(n);return Number.isFinite(i)?i:void 0}function n(e,s){let n=t(e,s);if(null==n)return;let i=parseInt(n,10);return Number.isFinite(i)?i:void 0}function i(e,t={x:0,y:0,z:0}){if(!e)return t;let s=e.split(" ").map(Number);return{x:s[0]??t.x,y:s[1]??t.y,z:s[2]??t.z}}function r(e,t={r:0,g:0,b:0}){if(!e)return t;let s=e.split(" ").map(Number);return{r:s[0]??t.r,g:s[1]??t.g,b:s[2]??t.b}}function a(e,t={r:.5,g:.5,b:.5,a:1}){if(!e)return t;let s=e.split(" ").map(Number);return{r:s[0]??t.r,g:s[1]??t.g,b:s[2]??t.b,a:s[3]??t.a}}function o(e,t){let s=i(e),n=(t??"1 0 0 0").split(" ").map(Number),r=n[0]??1,a=n[1]??0,o=n[2]??0,l=Math.PI/180*(n[3]??0),c=Math.sqrt(r*r+a*a+o*o),u=0,m=0,d=1;c>1e-8&&(u=r/c,m=a/c,d=o/c);let h=Math.cos(l),p=Math.sin(l),g=1-h,f=Array(16).fill(0);return f[0]=g*u*u+h,f[1]=g*u*m+p*d,f[2]=g*u*d-p*m,f[4]=g*u*m-p*d,f[5]=g*m*m+h,f[6]=g*m*d+p*u,f[8]=g*u*d+p*m,f[9]=g*m*d-p*u,f[10]=g*d*d+h,f[12]=s.x,f[13]=s.y,f[14]=s.z,f[15]=1,{elements:f,position:s}}function l(e){return{className:"TerrainBlock",ghostIndex:e._id,terrFileName:t(e,"terrainFile")??"",detailTextureName:t(e,"detailTexture")??"",squareSize:n(e,"squareSize")??8,emptySquareRuns:function(e){if(!e)return;let t=e.split(/\s+/).map(Number).filter(Number.isFinite);return t.length>0?t:void 0}(t(e,"emptySquares"))}}function c(e){return{className:"InteriorInstance",ghostIndex:e._id,interiorFile:t(e,"interiorFile")??"",transform:o(t(e,"position"),t(e,"rotation")),scale:i(t(e,"scale"),{x:1,y:1,z:1}),showTerrainInside:"1"===t(e,"showTerrainInside"),skinBase:t(e,"skinBase")??"",alarmState:!1}}function u(e){let a=[];for(let s=1;s<=3;s++){let n=function(e){if(!e)return null;let t=e.split(/\s+/).map(Number),s=t[0]??0,n=t[1]??0,i=t[2]??0;return 0===s&&0===n&&0===i?null:{visibleDistance:s,minHeight:n,maxHeight:i,color:{r:.5,g:.5,b:.5}}}(t(e,`fogVolume${s}`));n&&a.push(n)}let o=[];for(let n=0;n<3;n++){let i=t(e,`cloudText${n+1}`)??"",r=s(e,`cloudHeightPer[${n}]`)??s(e,`cloudheightper${n}`)??[.35,.25,.2][n],a=s(e,`cloudSpeed${n+1}`)??[1e-4,2e-4,3e-4][n];o.push({texture:i,heightPercent:r,speed:a})}return{className:"Sky",ghostIndex:e._id,materialList:t(e,"materialList")??"",fogColor:r(t(e,"fogColor")),visibleDistance:s(e,"visibleDistance")??1e3,fogDistance:s(e,"fogDistance")??0,skySolidColor:r(t(e,"SkySolidColor")),useSkyTextures:(n(e,"useSkyTextures")??1)!==0,fogVolumes:a,cloudLayers:o,windVelocity:i(t(e,"windVelocity"))}}function m(e){return{className:"Sun",ghostIndex:e._id,direction:i(t(e,"direction"),{x:.57735,y:.57735,z:-.57735}),color:a(t(e,"color"),{r:.7,g:.7,b:.7,a:1}),ambient:a(t(e,"ambient"),{r:.5,g:.5,b:.5,a:1})}}function d(e){let n=t(e,"area"),i={x:-512,y:-512,w:1024,h:1024};if(n){let e=n.split(/\s+/).map(Number);i={x:e[0]??i.x,y:e[1]??i.y,w:e[2]??i.w,h:e[3]??i.h}}return{className:"MissionArea",ghostIndex:e._id,area:i,flightCeiling:s(e,"flightCeiling")??2e3,flightCeilingRange:s(e,"flightCeilingRange")??50}}function h(e){return{className:"WaterBlock",ghostIndex:e._id,transform:o(t(e,"position"),t(e,"rotation")),scale:i(t(e,"scale"),{x:1,y:1,z:1}),surfaceName:t(e,"surfaceTexture")??"",envMapName:t(e,"envMapTexture")??"",surfaceOpacity:s(e,"surfaceOpacity")??.75,waveMagnitude:s(e,"waveMagnitude")??1,envMapIntensity:s(e,"envMapIntensity")??1}}e.s(["interiorFromMis",()=>c,"missionAreaFromMis",()=>d,"skyFromMis",()=>u,"sunFromMis",()=>m,"terrainFromMis",()=>l,"waterBlockFromMis",()=>h])},70847,47566,63318,e=>{"use strict";let t=(0,e.i(25645).createLogger)("ghostToScene");function s(e,t={x:0,y:0,z:0}){return e&&"object"==typeof e&&"x"in e?e:t}function n(e,t={r:0,g:0,b:0}){return e&&"object"==typeof e&&"r"in e?e:t}function i(e,t={r:.5,g:.5,b:.5,a:1}){return e&&"object"==typeof e&&"r"in e?e:t}function r(e){if(e&&"object"==typeof e&&"elements"in e&&Array.isArray(e.elements))return e;if(e&&"object"==typeof e&&"position"in e&&"rotation"in e){let{position:t,rotation:s}=e,n=s.x*s.x,i=s.y*s.y,r=s.z*s.z,a=s.x*s.y,o=s.x*s.z,l=s.y*s.z,c=s.w*s.x,u=s.w*s.y,m=s.w*s.z;return{elements:[1-2*(i+r),2*(a+m),2*(o-u),0,2*(a-m),1-2*(n+r),2*(l+c),0,2*(o+u),2*(l-c),1-2*(n+i),0,t.x,t.y,t.z,1],position:{x:t.x,y:t.y,z:t.z}}}return{elements:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],position:{x:0,y:0,z:0}}}function a(e,a,o){let l;switch(e){case"TerrainBlock":return l={className:"TerrainBlock",ghostIndex:a,terrFileName:o.terrFileName??"",detailTextureName:o.detailTextureName??"",squareSize:o.squareSize??8,emptySquareRuns:o.emptySquareRuns},t.debug("TerrainBlock #%d: terrFileName=%s",a,l.terrFileName),l;case"InteriorInstance":return l={className:"InteriorInstance",ghostIndex:a,interiorFile:o.interiorFile??"",transform:r(o.transform),scale:s(o.scale,{x:1,y:1,z:1}),showTerrainInside:o.showTerrainInside??!1,skinBase:o.skinBase??"",alarmState:o.alarmState??!1},t.debug("InteriorInstance #%d: interiorFile=%s",a,l.interiorFile),l;case"TSStatic":return{className:"TSStatic",ghostIndex:a,shapeName:o.shapeName??"",transform:r(o.transform),scale:s(o.scale,{x:1,y:1,z:1})};case"Sky":{let e,i;e=Array.isArray(o.fogVolumes)?o.fogVolumes.map(e=>({visibleDistance:e.visibleDistance??0,minHeight:e.minHeight??0,maxHeight:e.maxHeight??0,color:n(e.color)})):[],i=Array.isArray(o.cloudLayers)?o.cloudLayers.map(e=>({texture:e.texture??"",heightPercent:e.heightPercent??0,speed:e.speed??0})):[];let r=l={className:"Sky",ghostIndex:a,materialList:o.materialList??"",fogColor:n(o.fogColor),visibleDistance:o.visibleDistance??1e3,fogDistance:o.fogDistance??0,skySolidColor:n(o.skySolidColor),useSkyTextures:o.useSkyTextures??!0,fogVolumes:e,cloudLayers:i,windVelocity:s(o.windVelocity)};return t.debug("Sky #%d: materialList=%s fogColor=(%s, %s, %s) visibleDist=%d fogDist=%d useSkyTextures=%s",a,r.materialList,r.fogColor.r.toFixed(3),r.fogColor.g.toFixed(3),r.fogColor.b.toFixed(3),r.visibleDistance,r.fogDistance,r.useSkyTextures),l}case"Sun":{let e=l={className:"Sun",ghostIndex:a,direction:s(o.direction,{x:.57735,y:.57735,z:-.57735}),color:i(o.color,{r:.7,g:.7,b:.7,a:1}),ambient:i(o.ambient,{r:.5,g:.5,b:.5,a:1}),textures:Array.isArray(o.textures)?o.textures:void 0};return t.debug("Sun #%d: dir=(%s, %s, %s) color=(%s, %s, %s) ambient=(%s, %s, %s)",a,e.direction.x.toFixed(3),e.direction.y.toFixed(3),e.direction.z.toFixed(3),e.color.r.toFixed(3),e.color.g.toFixed(3),e.color.b.toFixed(3),e.ambient.r.toFixed(3),e.ambient.g.toFixed(3),e.ambient.b.toFixed(3)),l}case"MissionArea":return{className:"MissionArea",ghostIndex:a,area:o.area??{x:-512,y:-512,w:1024,h:1024},flightCeiling:o.flightCeiling??2e3,flightCeilingRange:o.flightCeilingRange??50};case"WaterBlock":return{className:"WaterBlock",ghostIndex:a,transform:r(o.transform),scale:s(o.scale,{x:1,y:1,z:1}),surfaceName:o.surfaceName??"",envMapName:o.envMapName??"",surfaceOpacity:o.surfaceOpacity??.75,waveMagnitude:o.waveMagnitude??1,envMapIntensity:o.envMapIntensity??1};default:return null}}e.s(["ghostToSceneObject",()=>a],47566),e.i(9672);var o=e.i(90072);function l(e){return[e.y,e.z,e.x]}function c(e){return[e.y,e.z,e.x]}function u(e){let t=e.elements,s=new o.Matrix4,n=s.elements;n[0]=t[5],n[1]=t[6],n[2]=t[4],n[3]=0,n[4]=t[9],n[5]=t[10],n[6]=t[8],n[7]=0,n[8]=t[1],n[9]=t[2],n[10]=t[0],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1;let i=new o.Quaternion;return i.setFromRotationMatrix(s),i.conjugate(),i}e.s(["matrixFToQuaternion",()=>u,"torqueScaleToThree",()=>c,"torqueToThree",()=>l],63318),e.s([],70847)},92224,e=>{"use strict";e.i(932);var t=e.i(8155),s=e.i(66748),n=e.i(62395);let i=(0,t.createStore)()(e=>({missionEntities:new Map,streamEntities:new Map,isStreaming:!1,dataSource:null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:0,setEntity(t){e(e=>{let s=new Map(e.missionEntities);return s.set(t.id,t),{missionEntities:s,version:e.version+1}})},deleteEntity(t){e(e=>{if(!e.missionEntities.has(t))return e;let s=new Map(e.missionEntities);return s.delete(t),{missionEntities:s,version:e.version+1}})},setEntities(t){e(e=>{let s=new Map(e.missionEntities);for(let e of t)s.set(e.id,e);return{missionEntities:s,version:e.version+1}})},setAllEntities(t){e(e=>{let s=new Map;for(let e of t)s.set(e.id,e);return{missionEntities:s,dataSource:e.isStreaming?e.dataSource:"map"}})},clearEntities(){e(e=>0===e.missionEntities.size?e:e.isStreaming?{missionEntities:new Map,version:e.version+1}:{missionEntities:new Map,dataSource:null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:e.version+1})},setMissionInfo(t){let s={};if(void 0!==t.missionName&&(s.missionName=t.missionName),void 0!==t.missionType&&(s.missionType=t.missionType),void 0!==t.missionTypeDisplayName&&(s.missionTypeDisplayName=t.missionTypeDisplayName),void 0!==t.missionDisplayName&&(s.missionDisplayName=t.missionDisplayName),void 0!==t.gameClassName&&(s.gameClassName=t.gameClassName,void 0===t.missionType))if(t.gameClassName){let e=t.gameClassName.replace(/Game$/i,"");s.missionType=n.normalizedMissionTypes[e.toLowerCase()]??e}else s.missionType=null;void 0!==t.serverDisplayName&&(s.serverDisplayName=t.serverDisplayName),void 0!==t.recorderName&&(s.recorderName=t.recorderName),void 0!==t.recordingDate&&(s.recordingDate=t.recordingDate),e(e=>({...s,version:e.version+1}))},beginStreaming(t){e(e=>({isStreaming:!0,dataSource:t,streamEntities:new Map,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:e.version+1}))},endStreaming(){e(e=>e.isStreaming?{isStreaming:!1,dataSource:e.missionEntities.size>0?"map":null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,streamEntities:new Map,version:e.version+1}:e)},setStreamEntity(t){e(e=>{let s=new Map(e.streamEntities);return s.set(t.id,t),{streamEntities:s,version:e.version+1}})},deleteStreamEntity(t){e(e=>{if(!e.streamEntities.has(t))return e;let s=new Map(e.streamEntities);return s.delete(t),{streamEntities:s,version:e.version+1}})},setStreamEntities(t){e(e=>{let s=new Map(e.streamEntities);for(let e of t)s.set(e.id,e);return{streamEntities:s,version:e.version+1}})},setAllStreamEntities(t){e(e=>{let s=new Map;for(let e of t)s.set(e.id,e);let n=e.streamEntities;return s.size===n.size&&[...s.keys()].every(e=>n.has(e))?e:{streamEntities:s,version:e.version+1}})},clearStreamEntities(){e(e=>0===e.streamEntities.size?e:{streamEntities:new Map,version:e.version+1})}}));function r(e){let t=e.isStreaming?e.streamEntities:e.missionEntities,s=[];for(let e of t.values())"None"!==e.renderType&&s.push(e);return s}function a(e,t){if(e.length!==t.length)return!1;for(let s=0;s o,"useDataSource",()=>d,"useMissionDisplayName",()=>k,"useMissionName",()=>p,"useMissionType",()=>f,"useMissionTypeDisplayName",()=>v,"useRecorderName",()=>N,"useRecordingDate",()=>x,"useSceneSky",()=>u,"useSceneSun",()=>m,"useServerDisplayName",()=>E])},98755,e=>{"use strict";var t=e.i(47167),s=e.i(8155),n=e.i(66748),i=e.i(25645);let r=(0,i.createLogger)("relayClient");class a{ws=null;handlers;url;_connected=!1;wsPingInterval=null;smoothedWsPing=0;constructor(e,t){this.url=e,this.handlers=t}get connected(){return this._connected}connect(){this.ws=new WebSocket(this.url),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{r.info("WebSocket connected to %s",this.url),this._connected=!0,this.startWsPing(),this.handlers.onOpen?.()},this.ws.onmessage=e=>{if(e.data instanceof ArrayBuffer)this.handlers.onGamePacket?.(new Uint8Array(e.data));else try{let t=JSON.parse(e.data);this.handleMessage(t)}catch(e){r.error("Failed to parse relay message: %o",e)}},this.ws.onclose=()=>{r.info("WebSocket disconnected"),this._connected=!1,this.stopWsPing(),this.handlers.onClose?.()},this.ws.onerror=()=>{r.error("WebSocket error"),this.handlers.onError?.("WebSocket connection error")}}handleMessage(e){switch(e.type){case"serverList":this.handlers.onServerList?.(e.servers);break;case"status":this.handlers.onStatus?.(e.status,e.message,e.connectSequence,e.mapName);break;case"ping":this.handlers.onPing?.(e.ms);break;case"wsPong":{let t=Date.now()-e.ts;this.smoothedWsPing=0===this.smoothedWsPing?t:.5*this.smoothedWsPing+.5*t,this.handlers.onWsPing?.(Math.round(this.smoothedWsPing));break}case"error":this.handlers.onError?.(e.message)}}listServers(){this.send({type:"listServers"})}sendWsPing(){this.send({type:"wsPing",ts:Date.now()})}joinServer(e,t){r.info("Joining server: %s",e),this.send({type:"joinServer",address:e,warriorName:t})}disconnectServer(){this.send({type:"disconnect"})}sendAuthEvent(e,t){this.send({type:"sendCommand",command:e,args:t})}sendCommand(e,t){this.send({type:"sendCommand",command:e,args:t})}sendCRCResponse(e,t,s){this.send({type:"sendCRCResponse",crcValue:e,field1:t,field2:s})}sendCRCCompute(e,t,s,n){this.send({type:"sendCRCCompute",seed:e,field2:t,includeTextures:n,datablocks:s})}sendGhostAck(e,t){this.send({type:"sendGhostAck",sequence:e,ghostCount:t})}sendMove(e){this.send({type:"sendMove",move:e})}close(){this.stopWsPing(),this.ws&&(this.ws.close(),this.ws=null),this._connected=!1}startWsPing(){this.smoothedWsPing=0,this.send({type:"wsPing",ts:Date.now()}),this.wsPingInterval=setInterval(()=>{this.send({type:"wsPing",ts:Date.now()})},7e3)}stopWsPing(){null!=this.wsPingInterval&&(clearInterval(this.wsPingInterval),this.wsPingInterval=null)}send(e){this.ws?.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify(e)):r.warn("send dropped (ws not open): %s",e.type)}}e.i(50593);var o=e.i(45853),l=e.i(89119),c=e.i(10244);let u=(0,i.createLogger)("liveStreaming");class m extends c.StreamEngine{packetParser;relay;currentTimeSec=0;connectSynced=!1;_snapshot=null;_snapshotTick=-1;_ready=!1;dataBlockClassNames=new Map;onReady;onMissionChange;missionName=null;constructor(e){super(),this.relay=e;const{registry:t,ghostTracker:s,packetParser:n}=(0,o.createLiveParser)();this.packetParser=n,this.ghostTracker=s,this.registry=t}getDataBlockData(e){return this.packetParser.getDataBlockDataMap()?.get(e)}_shapeConstructorCache=null;getShapeConstructorSequences(e){this._shapeConstructorCache=new Map;let t=this.packetParser.getDataBlockDataMap();if(t){for(let[,e]of t){let t=e.shape,s=e.sequences;t&&s&&this._shapeConstructorCache.set(t.toLowerCase(),s)}return this._shapeConstructorCache.get(e.toLowerCase())}}getTimeSec(){return this.currentTimeSec}getCameraYawPitch(e){return this.getAbsoluteRotation(e)??{yaw:0,pitch:0}}getEffectShapes(){let e=new Set,t=this.packetParser.getDataBlockDataMap();if(!t)return[];for(let[,s]of t){let n=s.explosion;if(null==n)continue;let i=t.get(n);i?.dtsFileName&&e.add(i.dtsFileName)}return[...e]}reset(){this.resetSharedState(),this.ghostTracker.clear?.(),this.currentTimeSec=0,this._snapshot=null,this._snapshotTick=-1,this.dataBlockClassNames.clear(),this.observerMode="fly",this.missionName=null}getSnapshot(){return this._snapshot&&this._snapshotTick===this.tickCount?this._snapshot:this.buildSnapshot()}stepToTime(e,t){return this.currentTimeSec=e,this.getSnapshot()}syncConnectSequence(e){if(this.connectSynced||e.length<1)return;this.connectSynced=!0;let t=e[0]>>1&1;this.packetParser.setConnectionProtocolState({lastSeqRecvdAtSend:Array(32).fill(0),lastSeqRecvd:0,highestAckedSeq:0,lastSendSeq:0x1fffffff,ackMask:0,connectSequence:t,lastRecvAckAck:0,connectionEstablished:!0})}feedPacket(e){this.syncConnectSequence(e),this.processPacket(e)}handleRelayCommands(e){if("RemoteCommandEvent"!==e.type)return;let t=e.funcName;if(!t)return;let s=this.resolveNetString(t);if(["t2csri_pokeClient","t2csri_getChallengeChunk","t2csri_decryptChallenge"].includes(s)){let t=(e.args??[]).map(e=>this.resolveNetString(e)).filter(e=>""!==e);u.info("auth event: %s %o",s,t),this.relay.sendAuthEvent(s,t);return}let n=(e.args??[]).map(e=>this.resolveNetString(e));if("MissionStartPhase1"===s){let e=n[0]??"",t=n[1]??null;u.info("mission phase 1, seq=%s mission=%s resolvedArgs=%o",e,t,n),t&&t!==this.missionName&&(this.missionName=t,this.entities.clear(),this.entityIdByGhostIndex.clear(),this._ready=!1,this._snapshot=null,this._snapshotTick=-1,this.missionDisplayName=null,this.missionTypeDisplayName=null,this.gameClassName=null,this.serverDisplayName=null,this.onMissionChange?.(t)),this.relay.sendCommand("MissionStartPhase1Done",[e])}else if("MissionStartPhase2"===s){let e=n[0]??"";u.info("mission phase 2 (datablocks), seq=%s",e),this.relay.sendCommand("MissionStartPhase2Done",[e])}else if("MissionStartPhase3"===s){let e=n[0]??"",t=n[1]??null;u.info("mission phase 3 (ghosting), seq=%s mission=%s",e,t),t&&(this.missionName=t),this.relay.sendCommand("setClientFav",[""]),this.relay.sendCommand("MissionStartPhase3Done",[e])}}handleCRCChallenge(e){if("CRCChallengeEvent"!==e.type)return;let t=e.crcValue,s=e.field1,n=e.field2,i=(1&s)!=0;u.info("CRC challenge: seed=0x%s f1=0x%s f2=0x%s includeTextures=%s",(t>>>0).toString(16),(s>>>0).toString(16),(n>>>0).toString(16),i);let r=this.packetParser.getDataBlockDataMap(),a=[];if(r)for(let[e,t]of r){let s=this.dataBlockClassNames.get(e);if(!s)continue;let n=(0,l.resolveShapeName)(s,t);a.push({objectId:e,className:s,shapeName:n??""})}u.info("CRC: sending %d datablocks for computation",a.length),this.relay.sendCRCCompute(t,n,a,i)}handleGhostingMessage(e){if("GhostingMessageEvent"!==e.type)return;let t=e.message,s=e.sequence,n=e.ghostCount;u.info("GhostingMessageEvent: message=%d sequence=%d ghostCount=%d",t,s,n),0===t&&(u.info("Sending ghost ack (type 1) for sequence %d",s),this.relay.sendGhostAck(s,n))}observerMode="fly";cycleObserveNext(){"fly"===this.observerMode?(u.info("observer: fly → follow (jump trigger)"),this.sendTrigger(2),this.observerMode="follow"):(u.info("observer: cycle next (fire trigger)"),this.sendTrigger(0))}toggleObserverMode(){"fly"===this.observerMode?(u.info("observer: fly → follow (jump trigger)"),this.sendTrigger(2),this.observerMode="follow"):(u.info("observer: follow → fly (jump trigger)"),this.sendTrigger(2),this.observerMode="fly")}sendTrigger(e){let t=[!1,!1,!1,!1,!1,!1];t[e]=!0,this.relay.sendMove({x:0,y:0,z:0,yaw:0,pitch:0,roll:0,trigger:t,freeLook:!1})}getPlayerList(){let e=[];for(let[t,s]of this.targetNames){let n=this.targetTeams.get(t)??0;e.push({targetId:t,name:s,sensorGroup:n})}return e}processPacket(e){try{let t=this.packetParser.protocolRejected,s=this.packetParser.protocolNoDispatch,n=this.packetParser.parsePacket(e),i=this.packetParser.protocolRejected>t,r=this.packetParser.protocolNoDispatch>s;(i||r)&&u.warn("packet #%d %s: %d bytes (total rejected=%d, noDispatch=%d)",this.tickCount,i?"REJECTED":"no-dispatch",e.length,this.packetParser.protocolRejected,this.packetParser.protocolNoDispatch);let a=this.tickCount<20,o=this.tickCount%100==0,c=a||o;for(let t of(c&&u.debug("packet #%d: %d events, %d ghosts, %d bytes%s%s",this.tickCount,n.events.length,n.ghosts.length,e.length,void 0!==n.gameState.controlObjectGhostIndex?`, control=${n.gameState.controlObjectGhostIndex}`:"",void 0!==n.gameState.cameraFov?`, fov=${n.gameState.cameraFov}`:""),this.processControlObject(n.gameState),n.events))if(t.parsedData){this.handleRelayCommands(t.parsedData),this.handleCRCChallenge(t.parsedData),this.handleGhostingMessage(t.parsedData);let e=t.parsedData.type;if("RemoteCommandEvent"===e){let e=this.resolveNetString(t.parsedData.funcName??"");u.debug("remote: %s",e)}if(a&&"NetStringEvent"!==e&&"RemoteCommandEvent"!==e&&u.debug("event: %s%s",e,"SimDataBlockEvent"===e?` id=${t.parsedData.objectId} class=${t.parsedData.dataBlockClassName}`:""),"SimDataBlockEvent"===e){let e=t.parsedData.objectId,s=t.parsedData.dataBlockClassName;if(null!=e&&s&&this.dataBlockClassNames.set(e,s),c){let n=t.parsedData.dataBlockData,i=(0,l.resolveShapeName)(s??"",n);u.debug("datablock: id=%d class=%s%s",e,s??"?",i?` shape=${i}`:"")}}let s=this.registry.getEventParser(t.classId)?.name;if(this.processEvent(t,s),a&&"NetStringEvent"===e){let e=t.parsedData.id,s=t.parsedData.value;null!=e&&"string"==typeof s&&u.trace('netString #%d = "%s"',e,s.length>60?s.slice(0,60)+"…":s)}if("TargetInfoEvent"===e){let e=t.parsedData.targetId,s=t.parsedData.nameTag;if(null!=e&&null!=s){let n=this.netStrings.get(s);if(n){let s=(0,l.stripTaggedStringMarkup)(n);u.info('target #%d: "%s" team=%s',e,s,t.parsedData.sensorGroup??"?")}}}if("SetSensorGroupEvent"===e){let e=t.parsedData.sensorGroup;null!=e&&u.info("sensor group changed: → %d",e)}if("SensorGroupColorEvent"===e){let e=t.parsedData.sensorGroup,s=t.parsedData.colors;s&&u.debug("sensor group colors: group=%d, %d entries",e,s.length)}}for(let e of n.ghosts){if("create"===e.type){let t=e.parsedData?.position,s=t&&"number"==typeof t.x&&"number"==typeof t.y&&"number"==typeof t.z,n=this.resolveGhostClassName(e.index,e.classId);u.debug("ghost create: #%d %s%s (%d entities total)",e.index,n??"?",s?` at (${t.x.toFixed(1)}, ${t.y.toFixed(1)}, ${t.z.toFixed(1)})`:"",this.entities.size+1),this._ready||(this._ready=!0,this.onReady?.())}else if("delete"===e.type){let t=this.entityIdByGhostIndex.get(e.index),s=t?this.entities.get(t):void 0;(this.tickCount<50||this.tickCount%200==0)&&u.debug("ghost delete: #%d %s (%d entities remaining)",e.index,s?.className??"?",this.entities.size-1)}this.processGhostUpdate(e)}if(this.tickCount++,this.advanceProjectiles(),this.advanceItems(),o&&this.tickCount>1){let e=this.packetParser.getDataBlockDataMap();u.info("status @ tick %d: %d entities, %d datablocks, rejected=%d, noDispatch=%d",this.tickCount,this.entities.size,e?.size??0,this.packetParser.protocolRejected,this.packetParser.protocolNoDispatch)}let m=this.entities.size;if(1===this.tickCount||m>0&&m%25==0&&this.tickCount<100){let e=new Map;for(let t of this.entities.values())e.set(t.type,(e.get(t.type)??0)+1);let t=[...e.entries()].map(([e,t])=>`${e}=${t}`).join(" ");u.info("entity count: %d (%s)",m,t)}let d=this.camera?.mode;if(this.updateCameraAndHud(),this.camera&&this.camera.mode!==d&&u.info("camera mode: %s → %s%s",d??"none",this.camera.mode,"third-person"===this.camera.mode?` orbit=${this.camera.orbitTargetId??"?"} dist=${this.camera.orbitDistance??"?"}`:""),this.tickCount<=5&&this.camera){let[e,t,s]=this.camera.position;u.debug("camera: mode=%s pos=(%s, %s, %s) fov=%s",this.camera.mode,e.toFixed(1),t.toFixed(1),s.toFixed(1),this.camera.fov)}}catch(s){let t={tickCount:this.tickCount,entityCount:this.entities.size,dataLength:e.length,controlGhost:this.latestControl.ghostIndex,connectSynced:this.connectSynced};u.error("Failed to process live packet: %o %o",s,t)}}buildSnapshot(){let e=this.buildEntityList(),t=this.currentTimeSec,{chatMessages:s,audioEvents:n}=this.buildTimeFilteredEvents(t),{weaponsHud:i,inventoryHud:r,backpackHud:a,teamScores:o}=this.buildHudState();this.camera||(this.camera={time:t,position:[0,0,200],rotation:[0,0,0,1],fov:90,mode:"observer"});let l={timeSec:t,exhausted:!1,camera:this.camera,entities:e,controlPlayerGhostId:this.controlPlayerGhostId,playerSensorGroup:this.playerSensorGroup,status:this.lastStatus,chatMessages:s,audioEvents:n,weaponsHud:i,backpackHud:a,inventoryHud:r,teamScores:o};return this._snapshot=l,this._snapshotTick=this.tickCount,l}}var d=e.i(92224);let h=(0,i.createLogger)("liveConnectionStore"),p=t.default.env.NEXT_PUBLIC_RELAY_URL||"ws://localhost:8765",g=(0,s.createStore)((e,t)=>({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,servers:[],serversLoading:!1,adapter:null,liveReady:!1,_relay:null,_adapter:null,_pending:[],_listInFlight:!1,connectRelay(s=p){let n=t();n._relay&&n._relay.close();let i=new a(s,{onOpen(){e({relayConnected:!0});let s=t();for(let e of s._pending)e();s._pending=[]},onStatus(t,s,n,i){h.info("game status: %s%s%s",t,s?` — ${s}`:"",i?` map=${i}`:""),e({gameStatus:t,gameStatusMessage:s,...i?{mapName:i}:{}})},onServerList(s){t()._listInFlight=!1,e({servers:s,serversLoading:!1})},onGamePacket(e){let s=t()._adapter;s||h.warn("received game packet but no adapter is active"),s?.feedPacket(e)},onPing(t){e({relayToGameServerPing:t})},onWsPing(t){e({browserToRelayPing:t})},onError(s){h.error("error: %s",s),t()._listInFlight=!1,e({serversLoading:!1})},onClose(){let s=t();s._relay===i&&(s._relay=null,s._adapter=null,s._pending=[],s._listInFlight=!1,e({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,adapter:null,liveReady:!1}))}});i.connect(),t()._relay=i},disconnectRelay(){let s=t();s._relay?.close(),s._relay=null,s._adapter=null,s._pending=[],s._listInFlight=!1,e({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,adapter:null,liveReady:!1})},listServers(){let s=t();if(s._listInFlight)return;s._listInFlight=!0;let n=()=>{let e=t();e._relay?.sendWsPing(),e._relay?.listServers()};e({serversLoading:!0}),s._relay?.connected?n():(s._pending.push(n),s._relay||t().connectRelay())},joinServer(s,n){let i=t();if(!i._relay)return;let r=i.servers.find(e=>e.address===s),a=new m(i._relay);a.onReady=()=>e({liveReady:!0}),a.onMissionChange=t=>{h.info("mission changed: %s",t),e({mapName:t,liveReady:!1}),d.gameEntityStore.getState().setMissionInfo({missionName:t,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null})},a.onMissionInfoChange=()=>{d.gameEntityStore.getState().setMissionInfo({missionDisplayName:a.missionDisplayName??void 0,missionTypeDisplayName:a.missionTypeDisplayName??void 0,gameClassName:a.gameClassName??void 0,serverDisplayName:a.serverDisplayName??void 0,recorderName:a.connectedPlayerName??void 0})},i._adapter=a,e({mapName:r?.mapName??i.mapName,serverName:r?.name,warriorName:n,liveReady:!1,gameStatus:null,adapter:a}),d.gameEntityStore.getState().setMissionInfo({missionName:r?.mapName??void 0,missionTypeDisplayName:r?.gameType??void 0,serverDisplayName:r?.name??void 0,recorderName:n??void 0}),i._relay.joinServer(s,n)},disconnectServer(){let s=t();s._relay?.disconnectServer(),s._adapter=null,e({adapter:null,liveReady:!1,gameStatus:null,mapName:void 0,serverName:void 0,relayToGameServerPing:null})},sendMove(e){t()._relay?.sendMove(e)},sendCommand(e,...s){t()._relay?.sendCommand(e,s)}}));function f(e,t){return(0,n.useStoreWithEqualityFn)(g,e,t)}function y(e){return null!=e.relayToGameServerPing&&null!=e.browserToRelayPing?e.relayToGameServerPing+e.browserToRelayPing:e.relayToGameServerPing??null}e.s(["liveConnectionStore",0,g,"selectPing",()=>y,"useLiveSelector",()=>f],98755)},66027,e=>{"use strict";var t=e.i(69230),s=e.i(69637);function n(e,n){return(0,s.useBaseQuery)(e,t.QueryObserver,n)}e.s(["useQuery",()=>n])},66093,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(71645);let i=(0,n.createContext)(null);function r(){let e=(0,n.useContext)(i);if(!e)throw Error("No JoystickContext found. Did you forget to add a ?");return e}function a(e){let r,a,o,l,c,u,m=(0,s.c)(7),{children:d}=e;m[0]===Symbol.for("react.memo_cache_sentinel")?(r={angle:0,force:0},m[0]=r):r=m[0];let h=(0,n.useRef)(r);m[1]===Symbol.for("react.memo_cache_sentinel")?(a={angle:0,force:0},m[1]=a):a=m[1];let p=(0,n.useRef)(a);m[2]===Symbol.for("react.memo_cache_sentinel")?(o=e=>{let{angle:t,force:s}=e;null!=t&&(h.current.angle=t),null!=s&&(h.current.force=s)},m[2]=o):o=m[2];let g=o;m[3]===Symbol.for("react.memo_cache_sentinel")?(l=e=>{let{angle:t,force:s}=e;null!=t&&(p.current.angle=t),null!=s&&(p.current.force=s)},m[3]=l):l=m[3];let f=l;m[4]===Symbol.for("react.memo_cache_sentinel")?(c={moveState:h,lookState:p,setMoveState:g,setLookState:f},m[4]=c):c=m[4];let y=c;return m[5]!==d?(u=(0,t.jsx)(i,{value:y,children:d}),m[5]=d,m[6]=u):u=m[6],u}e.s(["JoystickProvider",()=>a,"useJoystick",()=>r])},32865,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(58647);function i(e){let n,i=(0,s.c)(2),{children:r}=e;return i[0]!==r?(n=(0,t.jsx)(t.Fragment,{children:r}),i[0]=r,i[1]=n):n=i[1],n}function r(){return(0,n.useEngineSelector)(a)}function a(e){return e.playback.recording}function o(){return(0,n.useEngineSelector)(l)}function l(e){return"playing"===e.playback.status}function c(){return(0,n.useEngineSelector)(u)}function u(e){return e.playback.timeMs/1e3}function m(){return(0,n.useEngineSelector)(d)}function d(e){return e.playback.durationMs/1e3}function h(){return(0,n.useEngineSelector)(p)}function p(e){return e.playback.rate}function g(){let e,t,i,a,o,l,c=(0,s.c)(17),u=r(),m=(0,n.useEngineSelector)(S),d=(0,n.useEngineSelector)(v),h=(0,n.useEngineSelector)(y),p=(0,n.useEngineSelector)(f);c[0]!==m?(e=e=>{m(e)},c[0]=m,c[1]=e):e=c[1];let g=e;c[2]!==u||c[3]!==d?(t=()=>{u&&d("playing")},c[2]=u,c[3]=d,c[4]=t):t=c[4];let k=t;c[5]!==d?(i=()=>{d("paused")},c[5]=d,c[6]=i):i=c[6];let b=i;c[7]!==h?(a=e=>{h(1e3*e)},c[7]=h,c[8]=a):a=c[8];let E=a;c[9]!==p?(o=e=>{p(e)},c[9]=p,c[10]=o):o=c[10];let C=o;return c[11]!==b||c[12]!==k||c[13]!==E||c[14]!==g||c[15]!==C?(l={setRecording:g,play:k,pause:b,seek:E,setSpeed:C},c[11]=b,c[12]=k,c[13]=E,c[14]=g,c[15]=C,c[16]=l):l=c[16],l}function f(e){return e.setPlaybackRate}function y(e){return e.setPlaybackTime}function v(e){return e.setPlaybackStatus}function S(e){return e.setRecording}e.s(["RecordingProvider",()=>i,"useCurrentTime",()=>c,"useDuration",()=>m,"useIsPlaying",()=>o,"usePlaybackActions",()=>g,"useRecording",()=>r,"useSpeed",()=>h])},51434,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(71645),i=e.i(15080),r=e.i(90072),a=e.i(58647),o=e.i(79123);let l=(0,n.createContext)(void 0);function c(e){let c,h,p,g,f,y,v=(0,s.c)(11),{children:S}=e,k=(0,i.useThree)(d),{audioVolume:b}=(0,o.useSettings)();v[0]===Symbol.for("react.memo_cache_sentinel")?(c={audioLoader:null,audioListener:null},v[0]=c):c=v[0];let[E,C]=(0,n.useState)(c);return v[1]!==k?(h=()=>{let e=new r.AudioLoader,t=k.children.find(m);t||(t=new r.AudioListener,k.add(t)),C({audioLoader:e,audioListener:t});let s=()=>{let e=t.context;e&&"suspended"===e.state&&e.resume().finally(()=>{document.removeEventListener("click",s),document.removeEventListener("keydown",s)})};document.addEventListener("click",s),document.addEventListener("keydown",s);let n=a.engineStore.subscribe(u,e=>{let s=t.context;s&&("paused"===e?s.suspend():"suspended"===s.state&&s.resume())});return()=>{document.removeEventListener("click",s),document.removeEventListener("keydown",s),n(),t&&k.remove(t)}},p=[k],v[1]=k,v[2]=h,v[3]=p):(h=v[2],p=v[3]),(0,n.useEffect)(h,p),v[4]!==E.audioListener||v[5]!==b?(g=()=>{E.audioListener?.setMasterVolume(b)},f=[b,E.audioListener],v[4]=E.audioListener,v[5]=b,v[6]=g,v[7]=f):(g=v[6],f=v[7]),(0,n.useEffect)(g,f),v[8]!==E||v[9]!==S?(y=(0,t.jsx)(l.Provider,{value:E,children:S}),v[8]=E,v[9]=S,v[10]=y):y=v[10],y}function u(e){return e.playback.status}function m(e){return e instanceof r.AudioListener}function d(e){return e.camera}function h(){let e=(0,n.useContext)(l);if(void 0===e)throw Error("useAudio must be used within AudioProvider");return e}e.s(["AudioProvider",()=>c,"useAudio",()=>h])},93784,e=>{"use strict";let t=(0,e.i(8155).createStore)()(()=>({time:0,playback:null,root:null,freeFlyCamera:!1,entities:new Map}));function s(){t.setState({time:0,playback:null,freeFlyCamera:!1})}e.s(["resetStreamPlayback",()=>s,"streamPlaybackStore",0,t])},46325,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(71645);let i=(0,e.i(25645).createLogger)("DebugSuspense");function r(e){let i,r,l,c=(0,s.c)(10),{name:u,fallback:m,children:d}=e,h=void 0===m?null:m;return c[0]!==h||c[1]!==u?(i=(0,t.jsx)(a,{name:u,children:h}),c[0]=h,c[1]=u,c[2]=i):i=c[2],c[3]!==u?(r=(0,t.jsx)(o,{name:u}),c[3]=u,c[4]=r):r=c[4],c[5]!==d||c[6]!==u||c[7]!==i||c[8]!==r?(l=(0,t.jsxs)(n.Suspense,{name:u,fallback:i,children:[r,d]}),c[5]=d,c[6]=u,c[7]=i,c[8]=r,c[9]=l):l=c[9],l}function a(e){let t,r,a=(0,s.c)(3),{name:o,children:l}=e;return a[0]!==o?(t=()=>{i.debug("🛑 SUSPENDED: %s",o)},r=[o],a[0]=o,a[1]=t,a[2]=r):(t=a[1],r=a[2]),(0,n.useEffect)(t,r),l}function o(e){let t,r,a=(0,s.c)(3),{name:o}=e;return a[0]!==o?(t=()=>{i.debug("✅ RESOLVED: %s",o)},r=[o],a[0]=o,a[1]=t,a[2]=r):(t=a[1],r=a[2]),(0,n.useEffect)(t,r),null}e.s(["DebugSuspense",()=>r])},31999,e=>{"use strict";var t=e.i(71645);let s=(0,e.i(25645).createLogger)("ShapeErrorBoundary");class n extends t.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){s.error("Shape load failed: %s %s",e.message,t.componentStack)}render(){return this.state.hasError?this.props.fallback:this.props.children}}e.s(["ShapeErrorBoundary",()=>n])},77964,e=>{"use strict";function t(e){switch(e.renderType){case"TerrainBlock":case"InteriorInstance":case"Sky":case"Sun":case"WaterBlock":case"MissionArea":return!0;default:return!1}}e.s(["isSceneEntity",()=>t])},12631,e=>{"use strict";var t=e.i(71645),s=e.i(8155);let n=e=>{let n=(0,s.createStore)(e),i=e=>(function(e,s=e=>e){let n=t.default.useSyncExternalStore(e.subscribe,t.default.useCallback(()=>s(e.getState()),[e,s]),t.default.useCallback(()=>s(e.getInitialState()),[e,s]));return t.default.useDebugValue(n),n})(n,e);return Object.assign(i,n),i};var i=e.i(79473);let r=t.createContext(null);function a({map:e,children:s,onChange:a,domElement:o}){let l=e.map(e=>e.name+e.keys).join("-"),c=t.useMemo(()=>{let t;return(t=(0,i.subscribeWithSelector)(()=>e.reduce((e,t)=>({...e,[t.name]:!1}),{})))?n(t):n},[l]),u=t.useMemo(()=>[c.subscribe,c.getState,c],[l]),m=c.setState;return t.useEffect(()=>{let t=e.map(({name:e,keys:t,up:s})=>({keys:t,up:s,fn:t=>{m({[e]:t}),a&&a(e,t,u[1]())}})).reduce((e,{keys:t,fn:s,up:n=!0})=>(t.forEach(t=>e[t]={fn:s,pressed:!1,up:n}),e),{}),s=({key:e,code:s})=>{let n=t[e]||t[s];if(!n)return;let{fn:i,pressed:r,up:a}=n;n.pressed=!0,(a||!r)&&i(!0)},n=({key:e,code:s})=>{let n=t[e]||t[s];if(!n)return;let{fn:i,up:r}=n;n.pressed=!1,r&&i(!1)},i=o||window;return i.addEventListener("keydown",s,{passive:!0}),i.addEventListener("keyup",n,{passive:!0}),()=>{i.removeEventListener("keydown",s),i.removeEventListener("keyup",n)}},[o,l]),t.createElement(r.Provider,{value:u,children:s})}function o(e){let[s,n,i]=t.useContext(r);return e?i(e):[s,n]}e.s(["KeyboardControls",()=>a,"useKeyboardControls",()=>o],12631)},85413,e=>{"use strict";var t=Object.defineProperty;class s{constructor(){((e,s,n)=>{let i,r;r=void 0,(i="symbol"!=typeof s?s+"":s)in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[i]=r})(this,"_listeners")}addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let s=this._listeners;void 0===s[e]&&(s[e]=[]),-1===s[e].indexOf(t)&&s[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let s=this._listeners;return void 0!==s[e]&&-1!==s[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let s=this._listeners[e];if(void 0!==s){let e=s.indexOf(t);-1!==e&&s.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let t=this._listeners[e.type];if(void 0!==t){e.target=this;let s=t.slice(0);for(let t=0,n=s.length;t s])},68294,e=>{"use strict";var t=e.i(43476),s=e.i(90072),n=e.i(15080),i=e.i(71645);let r=(0,i.createContext)(null);function a(){let e=(0,i.useContext)(r);if(!e)throw Error("useCameras must be used within CamerasProvider");return e}function o({children:e}){let a=(0,n.useThree)(e=>e.camera),[o,l]=(0,i.useState)(-1),[c,u]=(0,i.useState)({}),[m,d]=(0,i.useState)(()=>({initialized:!1,position:null,quarternion:null})),h=(0,i.useCallback)(e=>{u(t=>({...t,[e.id]:e}))},[]),p=(0,i.useCallback)(e=>{u(t=>{let{[e.id]:s,...n}=t;return n})},[]),g=Object.keys(c).length,f=(0,i.useCallback)(e=>{if(e>=0&&e {f(g?(o+1)%g:-1)},[g,o,f]);(0,i.useEffect)(()=>{let e=()=>{let e=window.location.hash;if(e.startsWith("#c")){let[t,n]=e.slice(2).split("~"),i=t.split(",").map(e=>parseFloat(e)),r=n.split(",").map(e=>parseFloat(e));d({initialized:!0,position:new s.Vector3(...i),quarternion:new s.Quaternion(...r)})}else d({initialized:!0,position:null,quarternion:null})};return window.addEventListener("hashchange",e),e(),()=>{window.removeEventListener("hashchange",e)}},[]),(0,i.useEffect)(()=>{m.initialized&&m.position&&(a.position.copy(m.position),m.quarternion&&a.quaternion.copy(m.quarternion))},[a,m]),(0,i.useEffect)(()=>{m.initialized&&!m.position&&g>0&&-1===o&&f(0)},[g,f,o,m]);let v=(0,i.useMemo)(()=>({registerCamera:h,unregisterCamera:p,nextCamera:y,setCameraIndex:f,cameraCount:g}),[h,p,y,f,g]);return 0===g&&-1!==o&&l(-1),(0,t.jsx)(r.Provider,{value:v,children:e})}e.s(["CamerasProvider",()=>o,"useCameras",()=>a])},26747,e=>{"use strict";var t=e.i(90072),s=e.i(85413),n=Object.defineProperty,i=(e,t,s)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?n(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,s};let r=new t.Euler(0,0,0,"YXZ"),a=new t.Vector3,o={type:"change"},l={type:"lock"},c={type:"unlock"},u=Math.PI/2;class m extends s.EventDispatcher{constructor(e,s){super(),i(this,"camera"),i(this,"domElement"),i(this,"isLocked"),i(this,"minPolarAngle"),i(this,"maxPolarAngle"),i(this,"pointerSpeed"),i(this,"onMouseMove",e=>{this.domElement&&!1!==this.isLocked&&(r.setFromQuaternion(this.camera.quaternion),r.y-=.002*e.movementX*this.pointerSpeed,r.x-=.002*e.movementY*this.pointerSpeed,r.x=Math.max(u-this.maxPolarAngle,Math.min(u-this.minPolarAngle,r.x)),this.camera.quaternion.setFromEuler(r),this.dispatchEvent(o))}),i(this,"onPointerlockChange",()=>{this.domElement&&(this.domElement.ownerDocument.pointerLockElement===this.domElement?(this.dispatchEvent(l),this.isLocked=!0):(this.dispatchEvent(c),this.isLocked=!1))}),i(this,"onPointerlockError",()=>{console.error("THREE.PointerLockControls: Unable to use Pointer Lock API")}),i(this,"connect",e=>{this.domElement=e||this.domElement,this.domElement&&(this.domElement.ownerDocument.addEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.addEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.addEventListener("pointerlockerror",this.onPointerlockError))}),i(this,"disconnect",()=>{this.domElement&&(this.domElement.ownerDocument.removeEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.removeEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.removeEventListener("pointerlockerror",this.onPointerlockError))}),i(this,"dispose",()=>{this.disconnect()}),i(this,"getObject",()=>this.camera),i(this,"direction",new t.Vector3(0,0,-1)),i(this,"getDirection",e=>e.copy(this.direction).applyQuaternion(this.camera.quaternion)),i(this,"moveForward",e=>{a.setFromMatrixColumn(this.camera.matrix,0),a.crossVectors(this.camera.up,a),this.camera.position.addScaledVector(a,e)}),i(this,"moveRight",e=>{a.setFromMatrixColumn(this.camera.matrix,0),this.camera.position.addScaledVector(a,e)}),i(this,"lock",()=>{this.domElement&&this.domElement.requestPointerLock()}),i(this,"unlock",()=>{this.domElement&&this.domElement.ownerDocument.exitPointerLock()}),this.camera=e,this.domElement=s,this.isLocked=!1,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.pointerSpeed=1,s&&this.connect(s)}}e.s(["PointerLockControls",()=>m])},205,e=>{"use strict";var t=e.i(932),s=e.i(71645),n=e.i(90072),i=e.i(71753),r=e.i(15080),a=e.i(12631),o=e.i(26747),l=e.i(79123),c=e.i(68294),u=e.i(93784);let m=Math.PI/2-.01;function d(){let e,d,f,y,v,S,k,b,E,C,N,w,x,D,P,M,T=(0,t.c)(38);T[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],T[0]=e):e=T[0],(0,s.useEffect)(g,e);let{speedMultiplier:_,setSpeedMultiplier:L,invertScroll:F,invertDrag:I}=(0,l.useControls)(),[R,j]=(0,a.useKeyboardControls)(),A=(0,r.useThree)(p),q=(0,r.useThree)(h),{nextCamera:z,setCameraIndex:W,cameraCount:B}=(0,c.useCameras)(),G=(0,s.useRef)(null);T[1]!==F?(d=()=>F,T[1]=F,T[2]=d):d=T[2];let O=(0,s.useEffectEvent)(d);T[3]!==I?(f=()=>I,T[3]=I,T[4]=f):f=T[4];let V=(0,s.useEffectEvent)(f);T[5]===Symbol.for("react.memo_cache_sentinel")?(y=new n.Vector3,T[5]=y):y=T[5];let $=(0,s.useRef)(y);T[6]===Symbol.for("react.memo_cache_sentinel")?(v=new n.Vector3,T[6]=v):v=T[6];let K=(0,s.useRef)(v);T[7]===Symbol.for("react.memo_cache_sentinel")?(S=new n.Vector3,T[7]=S):S=T[7];let Y=(0,s.useRef)(S);T[8]===Symbol.for("react.memo_cache_sentinel")?(k=new n.Euler(0,0,0,"YXZ"),T[8]=k):k=T[8];let H=(0,s.useRef)(k);return T[9]!==A||T[10]!==q.domElement?(b=()=>{let e=new o.PointerLockControls(A,q.domElement);return G.current=e,()=>{e.dispose()}},E=[A,q.domElement],T[9]=A,T[10]=q.domElement,T[11]=b,T[12]=E):(b=T[11],E=T[12]),(0,s.useEffect)(b,E),T[13]!==A||T[14]!==V||T[15]!==q.domElement||T[16]!==z?(C=()=>{let e=q.domElement,t=new n.Euler(0,0,0,"YXZ"),s=!1,i=!1,r=0,a=0,o=t=>{G.current?.isLocked||t.target===e&&(s=!0,i=!1,r=t.clientX,a=t.clientY)},l=e=>{if(!s||!i&&3>Math.abs(e.clientX-r)&&3>Math.abs(e.clientY-a))return;i=!0;let n=V()?-1:1;t.setFromQuaternion(A.quaternion,"YXZ"),t.y=t.y+n*e.movementX*.003,t.x=t.x+n*e.movementY*.003,t.x=Math.max(-m,Math.min(m,t.x)),A.quaternion.setFromEuler(t)},c=()=>{s=!1},u=t=>{let s=G.current;!s||s.isLocked?z():t.target!==e||i||s.lock()};return e.addEventListener("mousedown",o),document.addEventListener("mousemove",l),document.addEventListener("mouseup",c),document.addEventListener("click",u),()=>{e.removeEventListener("mousedown",o),document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",c),document.removeEventListener("click",u)}},T[13]=A,T[14]=V,T[15]=q.domElement,T[16]=z,T[17]=C):C=T[17],T[18]!==A||T[19]!==q.domElement||T[20]!==z?(N=[A,q.domElement,z],T[18]=A,T[19]=q.domElement,T[20]=z,T[21]=N):N=T[21],(0,s.useEffect)(C,N),T[22]!==B||T[23]!==W||T[24]!==R?(w=()=>{let e=["camera1","camera2","camera3","camera4","camera5","camera6","camera7","camera8","camera9"];return R(t=>{for(let s=0;s {let e=e=>{e.preventDefault();let t=O()?-1:1,s=(e.deltaY>0?-1:1)*t,n=Math.max(.05,Math.min(.5,Math.abs(.01*e.deltaY)))*s;L(e=>Math.max(.1,Math.min(5,Math.round((e+n)*20)/20)))},t=q.domElement;return t.addEventListener("wheel",e,{passive:!1}),()=>{t.removeEventListener("wheel",e)}},T[27]=O,T[28]=q.domElement,T[29]=L,T[30]=D):D=T[30],T[31]!==q.domElement||T[32]!==L?(P=[q.domElement,L],T[31]=q.domElement,T[32]=L,T[33]=P):P=T[33],(0,s.useEffect)(D,P),T[34]!==A||T[35]!==j||T[36]!==_?(M=(e,t)=>{let s=u.streamPlaybackStore.getState();if(s.playback&&!s.freeFlyCamera)return;let{forward:n,backward:i,left:r,right:a,up:o,down:l,lookUp:c,lookDown:d,lookLeft:h,lookRight:p}=j();if((c||d||h||p)&&(H.current.setFromQuaternion(A.quaternion,"YXZ"),h&&(H.current.y=H.current.y+ +t),p&&(H.current.y=H.current.y-t),c&&(H.current.x=H.current.x+ +t),d&&(H.current.x=H.current.x-t),H.current.x=Math.max(-m,Math.min(m,H.current.x)),A.quaternion.setFromEuler(H.current)),!n&&!i&&!r&&!a&&!o&&!l)return;let g=80*_;A.getWorldDirection($.current),$.current.normalize(),K.current.crossVectors(A.up,$.current).normalize(),Y.current.set(0,0,0),n&&Y.current.add($.current),i&&Y.current.sub($.current),r&&Y.current.add(K.current),a&&Y.current.sub(K.current),o&&(Y.current.y=Y.current.y+1),l&&(Y.current.y=Y.current.y-1),Y.current.lengthSq()>0&&(Y.current.normalize().multiplyScalar(g*t),A.position.add(Y.current))},T[34]=A,T[35]=j,T[36]=_,T[37]=M):M=T[37],(0,i.useFrame)(M),null}function h(e){return e.gl}function p(e){return e.camera}function g(){return window.addEventListener("keydown",f,{capture:!0}),window.addEventListener("keyup",f,{capture:!0}),()=>{window.removeEventListener("keydown",f,{capture:!0}),window.removeEventListener("keyup",f,{capture:!0})}}function f(e){(e.metaKey||e.ctrlKey)&&"k"===e.key||e.metaKey&&e.stopImmediatePropagation()}e.s(["ARROW_LOOK_SPEED",0,1,"KEYBOARD_CONTROLS",0,[{name:"forward",keys:["KeyW"]},{name:"backward",keys:["KeyS"]},{name:"left",keys:["KeyA"]},{name:"right",keys:["KeyD"]},{name:"up",keys:["Space"]},{name:"down",keys:["ShiftLeft","ShiftRight"]},{name:"lookUp",keys:["ArrowUp"]},{name:"lookDown",keys:["ArrowDown"]},{name:"lookLeft",keys:["ArrowLeft"]},{name:"lookRight",keys:["ArrowRight"]},{name:"camera1",keys:["Digit1"]},{name:"camera2",keys:["Digit2"]},{name:"camera3",keys:["Digit3"]},{name:"camera4",keys:["Digit4"]},{name:"camera5",keys:["Digit5"]},{name:"camera6",keys:["Digit6"]},{name:"camera7",keys:["Digit7"]},{name:"camera8",keys:["Digit8"]},{name:"camera9",keys:["Digit9"]}],"KeyboardAndMouseHandler",()=>d,"MOUSE_SENSITIVITY",0,.003])},60946,e=>{e.v(t=>Promise.all(["static/chunks/4fb9edf01fb5e4f5.js"].map(t=>e.l(t))).then(()=>t(0)))},30814,e=>{e.v(t=>Promise.all(["static/chunks/b89dc6fc9051e9fe.js"].map(t=>e.l(t))).then(()=>t(9721)))},44325,e=>{e.v(t=>Promise.all(["static/chunks/96ae05ebba99dcff.js"].map(t=>e.l(t))).then(()=>t(66789)))},62125,e=>{e.v(t=>Promise.all(["static/chunks/6c0bdfaab43cc40b.js"].map(t=>e.l(t))).then(()=>t(64972)))},25147,e=>{e.v(t=>Promise.all(["static/chunks/2c772d15a5a10e4d.js"].map(t=>e.l(t))).then(()=>t(63724)))},61921,e=>{e.v(t=>Promise.all(["static/chunks/0e2ec5f4026ef564.js"].map(t=>e.l(t))).then(()=>t(29055)))},18599,e=>{e.v(t=>Promise.all(["static/chunks/ebf99400aa3d97c0.js"].map(t=>e.l(t))).then(()=>t(42585)))},34019,e=>{e.v(t=>Promise.all(["static/chunks/341165a5ae0d70ac.js"].map(t=>e.l(t))).then(()=>t(66069)))},553,e=>{e.v(t=>Promise.all(["static/chunks/66f953934e42712b.css","static/chunks/e27b13e203064a85.js"].map(t=>e.l(t))).then(()=>t(18339)))},33487,e=>{e.v(t=>Promise.all(["static/chunks/9ffe862a9787606f.css","static/chunks/302e494fb721f5e6.js"].map(t=>e.l(t))).then(()=>t(40378)))},25483,e=>{e.v(t=>Promise.all(["static/chunks/b89dc6fc9051e9fe.js","static/chunks/bc2b324cb2101ffe.js"].map(t=>e.l(t))).then(()=>t(51295)))},93884,e=>{e.v(t=>Promise.all(["static/chunks/1db3a9d62713e989.css","static/chunks/3770acf7d1a6ba0a.js"].map(t=>e.l(t))).then(()=>t(94737)))},88487,e=>{e.v(t=>Promise.all(["static/chunks/005e475439c5cb3e.js","static/chunks/92a585fca24d52ed.css"].map(t=>e.l(t))).then(()=>t(86855)))},21683,e=>{e.v(t=>Promise.all(["static/chunks/4c292ca57f1d49be.js"].map(t=>e.l(t))).then(()=>t(91285)))},96145,e=>{e.v(t=>Promise.all(["static/chunks/1cf57947857f8eec.js"].map(t=>e.l(t))).then(()=>t(60505)))},38496,e=>{e.v(t=>Promise.all(["static/chunks/97346c3751717c47.js"].map(t=>e.l(t))).then(()=>t(9962)))},57567,e=>{e.v(t=>Promise.all(["static/chunks/28c98fb093e4695f.css","static/chunks/22c22371d5c1dcba.js"].map(t=>e.l(t))).then(()=>t(49776)))},59197,e=>{e.v(t=>Promise.all(["static/chunks/a05c1cf573184d15.css","static/chunks/273b16b21a9dcb92.js"].map(t=>e.l(t))).then(()=>t(94247)))},70012,e=>{e.v(t=>Promise.all(["static/chunks/a05c1cf573184d15.css","static/chunks/68bae3cf9f451a9b.js"].map(t=>e.l(t))).then(()=>t(45554)))}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/2c772d15a5a10e4d.js b/docs/_next/static/chunks/2c772d15a5a10e4d.js new file mode 100644 index 00000000..abc71ceb --- /dev/null +++ b/docs/_next/static/chunks/2c772d15a5a10e4d.js @@ -0,0 +1,75 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,63724,e=>{"use strict";var r=e.i(43476),o=e.i(932),a=e.i(71645),t=e.i(46325),l=e.i(47071),c=e.i(71753),n=e.i(90072),i=e.i(12979),u=e.i(79123);let s=` +#include + +varying vec2 vUv; + +void main() { + vUv = uv; + vec4 mvPosition = modelViewMatrix * vec4(position, 1.0); + gl_Position = projectionMatrix * mvPosition; + #include +} +`,f=` +#include + +uniform sampler2D frame0; +uniform sampler2D frame1; +uniform sampler2D frame2; +uniform sampler2D frame3; +uniform sampler2D frame4; +uniform int currentFrame; +uniform float vScroll; +uniform vec2 uvScale; +uniform vec3 tintColor; +uniform float opacity; +uniform float opacityFactor; + +varying vec2 vUv; + +void main() { + // Scale and scroll UVs + vec2 scrolledUv = vec2(vUv.x * uvScale.x, vUv.y * uvScale.y + vScroll); + + // Sample the current frame + vec4 texColor; + if (currentFrame == 0) { + texColor = texture2D(frame0, scrolledUv); + } else if (currentFrame == 1) { + texColor = texture2D(frame1, scrolledUv); + } else if (currentFrame == 2) { + texColor = texture2D(frame2, scrolledUv); + } else if (currentFrame == 3) { + texColor = texture2D(frame3, scrolledUv); + } else { + texColor = texture2D(frame4, scrolledUv); + } + + // Tribes 2 GL_MODULATE: output = texture * vertexColor + // No gamma correction - textures use NoColorSpace and values pass through + // directly to display, matching how WaterBlock handles sRGB textures. + vec3 modulatedColor = texColor.rgb * tintColor; + + float adjustedOpacity = opacity * opacityFactor; + + gl_FragColor = vec4(modulatedColor, adjustedOpacity); + + // Custom fog for additive blending: fade out rather than blend to fog color. + // Standard fog (mix toward fogColor) doesn't work with additive blending + // because we'd still be adding fogColor to the framebuffer. + // Uses Torque's quadratic haze formula for consistency. + #ifdef USE_FOG + float dist = vFogDepth; + float fogFactor = 0.0; + if (dist > fogNear) { + if (dist >= fogFar) { + fogFactor = 1.0; + } else { + float fogScale = 1.0 / (fogFar - fogNear); + float distFactor = (dist - fogNear) * fogScale - 1.0; + fogFactor = 1.0 - distFactor * distFactor; + } + } + gl_FragColor.a *= 1.0 - fogFactor; + #endif +} +`;function d(e){let r,t,l,c=(0,o.c)(7),[i,u,s]=e;c[0]!==i||c[1]!==u||c[2]!==s?((r=new n.BoxGeometry(i,u,s)).translate(i/2,u/2,s/2),c[0]=i,c[1]=u,c[2]=s,c[3]=r):r=c[3];let f=r;return c[4]!==f?(t=()=>()=>f.dispose(),l=[f],c[4]=f,c[5]=t,c[6]=l):(t=c[5],l=c[6]),(0,a.useEffect)(t,l),f}function m(e){let a,t,l,c=(0,o.c)(10),{scale:i,color:u,baseTranslucency:s}=e,f=d(i);c[0]!==u[0]||c[1]!==u[1]||c[2]!==u[2]?(a=new n.Color(u[0],u[1],u[2]),c[0]=u[0],c[1]=u[1],c[2]=u[2],c[3]=a):a=c[3];let m=a,v=+s;return c[4]!==m||c[5]!==v?(t=(0,r.jsx)("meshBasicMaterial",{color:m,transparent:!0,opacity:v,blending:n.AdditiveBlending,side:n.DoubleSide,depthWrite:!1,fog:!1}),c[4]=m,c[5]=v,c[6]=t):t=c[6],c[7]!==f||c[8]!==t?(l=(0,r.jsx)("mesh",{geometry:f,renderOrder:1,children:t}),c[7]=f,c[8]=t,c[9]=l):l=c[9],l}function v({scale:e,data:o}){let{animationEnabled:t}=(0,u.useSettings)(),m=d(e),v=(0,a.useMemo)(()=>o.textures.map(e=>(0,i.textureToUrl)(e)),[o.textures]),g=(0,l.useTexture)(v,e=>{e.forEach(e=>{e.wrapS=e.wrapT=n.RepeatWrapping,e.colorSpace=n.NoColorSpace,e.flipY=!1,e.needsUpdate=!0})}),p=(0,a.useMemo)(()=>(function({textures:e,scale:r,umapping:o,vmapping:a,color:t,baseTranslucency:l}){let c=[...r].sort((e,r)=>r-e),i=new n.Vector2(c[0]*o,c[1]*a),u=e[0];return new n.ShaderMaterial({uniforms:{frame0:{value:u},frame1:{value:e[1]??u},frame2:{value:e[2]??u},frame3:{value:e[3]??u},frame4:{value:e[4]??u},currentFrame:{value:0},vScroll:{value:0},uvScale:{value:i},tintColor:{value:new n.Color(...t)},opacity:{value:l},opacityFactor:{value:1},fogColor:{value:new n.Color},fogNear:{value:1},fogFar:{value:2e3}},vertexShader:s,fragmentShader:f,transparent:!0,blending:n.AdditiveBlending,side:n.DoubleSide,depthWrite:!1,fog:!0})})({textures:g,scale:e,umapping:o.umapping,vmapping:o.vmapping,color:o.color,baseTranslucency:o.baseTranslucency}),[g,e,o]);(0,a.useEffect)(()=>()=>p.dispose(),[p]);let x=(0,a.useRef)(0);return(0,c.useFrame)((e,r)=>{if(!t){x.current=0,p.uniforms.currentFrame.value=0,p.uniforms.vScroll.value=0;return}x.current+=r,p.uniforms.currentFrame.value=Math.floor(x.current*o.framesPerSec)%o.numFrames,p.uniforms.vScroll.value=x.current*o.scrollSpeed}),(0,r.jsx)("mesh",{geometry:m,material:p,renderOrder:1})}function g(e){let a,l,c,n=(0,o.c)(14),{entity:i}=e,u=i.forceFieldData,s=u.dimensions;if(0===u.textures.map(p).length){let e;return n[0]!==u.baseTranslucency||n[1]!==u.color||n[2]!==s?(e=(0,r.jsx)(m,{scale:s,color:u.color,baseTranslucency:u.baseTranslucency}),n[0]=u.baseTranslucency,n[1]=u.color,n[2]=s,n[3]=e):e=n[3],e}return n[4]!==u.baseTranslucency||n[5]!==u.color||n[6]!==s?(a=(0,r.jsx)(m,{scale:s,color:u.color,baseTranslucency:u.baseTranslucency}),n[4]=u.baseTranslucency,n[5]=u.color,n[6]=s,n[7]=a):a=n[7],n[8]!==u||n[9]!==s?(l=(0,r.jsx)(v,{scale:s,data:u}),n[8]=u,n[9]=s,n[10]=l):l=n[10],n[11]!==a||n[12]!==l?(c=(0,r.jsx)(t.DebugSuspense,{name:"ForceField",fallback:a,children:l}),n[11]=a,n[12]=l,n[13]=c):c=n[13],c}function p(e){return(0,i.textureToUrl)(e)}e.s(["ForceFieldBare",()=>g],63724)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/2edeeda5ca6dc680.js b/docs/_next/static/chunks/2edeeda5ca6dc680.js deleted file mode 100644 index 37c36bfd..00000000 --- a/docs/_next/static/chunks/2edeeda5ca6dc680.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,75056,e=>{"use strict";var t=e.i(40859),r=e.i(71645),n=e.i(8560),i=e.i(90072);e.s(["ACESFilmicToneMapping",()=>i.ACESFilmicToneMapping,"AddEquation",()=>i.AddEquation,"AddOperation",()=>i.AddOperation,"AdditiveAnimationBlendMode",()=>i.AdditiveAnimationBlendMode,"AdditiveBlending",()=>i.AdditiveBlending,"AgXToneMapping",()=>i.AgXToneMapping,"AlphaFormat",()=>i.AlphaFormat,"AlwaysCompare",()=>i.AlwaysCompare,"AlwaysDepth",()=>i.AlwaysDepth,"AlwaysStencilFunc",()=>i.AlwaysStencilFunc,"AmbientLight",()=>i.AmbientLight,"AnimationAction",()=>i.AnimationAction,"AnimationClip",()=>i.AnimationClip,"AnimationLoader",()=>i.AnimationLoader,"AnimationMixer",()=>i.AnimationMixer,"AnimationObjectGroup",()=>i.AnimationObjectGroup,"AnimationUtils",()=>i.AnimationUtils,"ArcCurve",()=>i.ArcCurve,"ArrayCamera",()=>i.ArrayCamera,"ArrowHelper",()=>i.ArrowHelper,"AttachedBindMode",()=>i.AttachedBindMode,"Audio",()=>i.Audio,"AudioAnalyser",()=>i.AudioAnalyser,"AudioContext",()=>i.AudioContext,"AudioListener",()=>i.AudioListener,"AudioLoader",()=>i.AudioLoader,"AxesHelper",()=>i.AxesHelper,"BackSide",()=>i.BackSide,"BasicDepthPacking",()=>i.BasicDepthPacking,"BasicShadowMap",()=>i.BasicShadowMap,"BatchedMesh",()=>i.BatchedMesh,"Bone",()=>i.Bone,"BooleanKeyframeTrack",()=>i.BooleanKeyframeTrack,"Box2",()=>i.Box2,"Box3",()=>i.Box3,"Box3Helper",()=>i.Box3Helper,"BoxGeometry",()=>i.BoxGeometry,"BoxHelper",()=>i.BoxHelper,"BufferAttribute",()=>i.BufferAttribute,"BufferGeometry",()=>i.BufferGeometry,"BufferGeometryLoader",()=>i.BufferGeometryLoader,"ByteType",()=>i.ByteType,"Cache",()=>i.Cache,"Camera",()=>i.Camera,"CameraHelper",()=>i.CameraHelper,"CanvasTexture",()=>i.CanvasTexture,"CapsuleGeometry",()=>i.CapsuleGeometry,"CatmullRomCurve3",()=>i.CatmullRomCurve3,"CineonToneMapping",()=>i.CineonToneMapping,"CircleGeometry",()=>i.CircleGeometry,"ClampToEdgeWrapping",()=>i.ClampToEdgeWrapping,"Clock",()=>i.Clock,"Color",()=>i.Color,"ColorKeyframeTrack",()=>i.ColorKeyframeTrack,"ColorManagement",()=>i.ColorManagement,"CompressedArrayTexture",()=>i.CompressedArrayTexture,"CompressedCubeTexture",()=>i.CompressedCubeTexture,"CompressedTexture",()=>i.CompressedTexture,"CompressedTextureLoader",()=>i.CompressedTextureLoader,"ConeGeometry",()=>i.ConeGeometry,"ConstantAlphaFactor",()=>i.ConstantAlphaFactor,"ConstantColorFactor",()=>i.ConstantColorFactor,"Controls",()=>i.Controls,"CubeCamera",()=>i.CubeCamera,"CubeDepthTexture",()=>i.CubeDepthTexture,"CubeReflectionMapping",()=>i.CubeReflectionMapping,"CubeRefractionMapping",()=>i.CubeRefractionMapping,"CubeTexture",()=>i.CubeTexture,"CubeTextureLoader",()=>i.CubeTextureLoader,"CubeUVReflectionMapping",()=>i.CubeUVReflectionMapping,"CubicBezierCurve",()=>i.CubicBezierCurve,"CubicBezierCurve3",()=>i.CubicBezierCurve3,"CubicInterpolant",()=>i.CubicInterpolant,"CullFaceBack",()=>i.CullFaceBack,"CullFaceFront",()=>i.CullFaceFront,"CullFaceFrontBack",()=>i.CullFaceFrontBack,"CullFaceNone",()=>i.CullFaceNone,"Curve",()=>i.Curve,"CurvePath",()=>i.CurvePath,"CustomBlending",()=>i.CustomBlending,"CustomToneMapping",()=>i.CustomToneMapping,"CylinderGeometry",()=>i.CylinderGeometry,"Cylindrical",()=>i.Cylindrical,"Data3DTexture",()=>i.Data3DTexture,"DataArrayTexture",()=>i.DataArrayTexture,"DataTexture",()=>i.DataTexture,"DataTextureLoader",()=>i.DataTextureLoader,"DataUtils",()=>i.DataUtils,"DecrementStencilOp",()=>i.DecrementStencilOp,"DecrementWrapStencilOp",()=>i.DecrementWrapStencilOp,"DefaultLoadingManager",()=>i.DefaultLoadingManager,"DepthFormat",()=>i.DepthFormat,"DepthStencilFormat",()=>i.DepthStencilFormat,"DepthTexture",()=>i.DepthTexture,"DetachedBindMode",()=>i.DetachedBindMode,"DirectionalLight",()=>i.DirectionalLight,"DirectionalLightHelper",()=>i.DirectionalLightHelper,"DiscreteInterpolant",()=>i.DiscreteInterpolant,"DodecahedronGeometry",()=>i.DodecahedronGeometry,"DoubleSide",()=>i.DoubleSide,"DstAlphaFactor",()=>i.DstAlphaFactor,"DstColorFactor",()=>i.DstColorFactor,"DynamicCopyUsage",()=>i.DynamicCopyUsage,"DynamicDrawUsage",()=>i.DynamicDrawUsage,"DynamicReadUsage",()=>i.DynamicReadUsage,"EdgesGeometry",()=>i.EdgesGeometry,"EllipseCurve",()=>i.EllipseCurve,"EqualCompare",()=>i.EqualCompare,"EqualDepth",()=>i.EqualDepth,"EqualStencilFunc",()=>i.EqualStencilFunc,"EquirectangularReflectionMapping",()=>i.EquirectangularReflectionMapping,"EquirectangularRefractionMapping",()=>i.EquirectangularRefractionMapping,"Euler",()=>i.Euler,"EventDispatcher",()=>i.EventDispatcher,"ExternalTexture",()=>i.ExternalTexture,"ExtrudeGeometry",()=>i.ExtrudeGeometry,"FileLoader",()=>i.FileLoader,"Float16BufferAttribute",()=>i.Float16BufferAttribute,"Float32BufferAttribute",()=>i.Float32BufferAttribute,"FloatType",()=>i.FloatType,"Fog",()=>i.Fog,"FogExp2",()=>i.FogExp2,"FramebufferTexture",()=>i.FramebufferTexture,"FrontSide",()=>i.FrontSide,"Frustum",()=>i.Frustum,"FrustumArray",()=>i.FrustumArray,"GLBufferAttribute",()=>i.GLBufferAttribute,"GLSL1",()=>i.GLSL1,"GLSL3",()=>i.GLSL3,"GreaterCompare",()=>i.GreaterCompare,"GreaterDepth",()=>i.GreaterDepth,"GreaterEqualCompare",()=>i.GreaterEqualCompare,"GreaterEqualDepth",()=>i.GreaterEqualDepth,"GreaterEqualStencilFunc",()=>i.GreaterEqualStencilFunc,"GreaterStencilFunc",()=>i.GreaterStencilFunc,"GridHelper",()=>i.GridHelper,"Group",()=>i.Group,"HalfFloatType",()=>i.HalfFloatType,"HemisphereLight",()=>i.HemisphereLight,"HemisphereLightHelper",()=>i.HemisphereLightHelper,"IcosahedronGeometry",()=>i.IcosahedronGeometry,"ImageBitmapLoader",()=>i.ImageBitmapLoader,"ImageLoader",()=>i.ImageLoader,"ImageUtils",()=>i.ImageUtils,"IncrementStencilOp",()=>i.IncrementStencilOp,"IncrementWrapStencilOp",()=>i.IncrementWrapStencilOp,"InstancedBufferAttribute",()=>i.InstancedBufferAttribute,"InstancedBufferGeometry",()=>i.InstancedBufferGeometry,"InstancedInterleavedBuffer",()=>i.InstancedInterleavedBuffer,"InstancedMesh",()=>i.InstancedMesh,"Int16BufferAttribute",()=>i.Int16BufferAttribute,"Int32BufferAttribute",()=>i.Int32BufferAttribute,"Int8BufferAttribute",()=>i.Int8BufferAttribute,"IntType",()=>i.IntType,"InterleavedBuffer",()=>i.InterleavedBuffer,"InterleavedBufferAttribute",()=>i.InterleavedBufferAttribute,"Interpolant",()=>i.Interpolant,"InterpolateDiscrete",()=>i.InterpolateDiscrete,"InterpolateLinear",()=>i.InterpolateLinear,"InterpolateSmooth",()=>i.InterpolateSmooth,"InterpolationSamplingMode",()=>i.InterpolationSamplingMode,"InterpolationSamplingType",()=>i.InterpolationSamplingType,"InvertStencilOp",()=>i.InvertStencilOp,"KeepStencilOp",()=>i.KeepStencilOp,"KeyframeTrack",()=>i.KeyframeTrack,"LOD",()=>i.LOD,"LatheGeometry",()=>i.LatheGeometry,"Layers",()=>i.Layers,"LessCompare",()=>i.LessCompare,"LessDepth",()=>i.LessDepth,"LessEqualCompare",()=>i.LessEqualCompare,"LessEqualDepth",()=>i.LessEqualDepth,"LessEqualStencilFunc",()=>i.LessEqualStencilFunc,"LessStencilFunc",()=>i.LessStencilFunc,"Light",()=>i.Light,"LightProbe",()=>i.LightProbe,"Line",()=>i.Line,"Line3",()=>i.Line3,"LineBasicMaterial",()=>i.LineBasicMaterial,"LineCurve",()=>i.LineCurve,"LineCurve3",()=>i.LineCurve3,"LineDashedMaterial",()=>i.LineDashedMaterial,"LineLoop",()=>i.LineLoop,"LineSegments",()=>i.LineSegments,"LinearFilter",()=>i.LinearFilter,"LinearInterpolant",()=>i.LinearInterpolant,"LinearMipMapLinearFilter",()=>i.LinearMipMapLinearFilter,"LinearMipMapNearestFilter",()=>i.LinearMipMapNearestFilter,"LinearMipmapLinearFilter",()=>i.LinearMipmapLinearFilter,"LinearMipmapNearestFilter",()=>i.LinearMipmapNearestFilter,"LinearSRGBColorSpace",()=>i.LinearSRGBColorSpace,"LinearToneMapping",()=>i.LinearToneMapping,"LinearTransfer",()=>i.LinearTransfer,"Loader",()=>i.Loader,"LoaderUtils",()=>i.LoaderUtils,"LoadingManager",()=>i.LoadingManager,"LoopOnce",()=>i.LoopOnce,"LoopPingPong",()=>i.LoopPingPong,"LoopRepeat",()=>i.LoopRepeat,"MOUSE",()=>i.MOUSE,"Material",()=>i.Material,"MaterialLoader",()=>i.MaterialLoader,"MathUtils",()=>i.MathUtils,"Matrix2",()=>i.Matrix2,"Matrix3",()=>i.Matrix3,"Matrix4",()=>i.Matrix4,"MaxEquation",()=>i.MaxEquation,"Mesh",()=>i.Mesh,"MeshBasicMaterial",()=>i.MeshBasicMaterial,"MeshDepthMaterial",()=>i.MeshDepthMaterial,"MeshDistanceMaterial",()=>i.MeshDistanceMaterial,"MeshLambertMaterial",()=>i.MeshLambertMaterial,"MeshMatcapMaterial",()=>i.MeshMatcapMaterial,"MeshNormalMaterial",()=>i.MeshNormalMaterial,"MeshPhongMaterial",()=>i.MeshPhongMaterial,"MeshPhysicalMaterial",()=>i.MeshPhysicalMaterial,"MeshStandardMaterial",()=>i.MeshStandardMaterial,"MeshToonMaterial",()=>i.MeshToonMaterial,"MinEquation",()=>i.MinEquation,"MirroredRepeatWrapping",()=>i.MirroredRepeatWrapping,"MixOperation",()=>i.MixOperation,"MultiplyBlending",()=>i.MultiplyBlending,"MultiplyOperation",()=>i.MultiplyOperation,"NearestFilter",()=>i.NearestFilter,"NearestMipMapLinearFilter",()=>i.NearestMipMapLinearFilter,"NearestMipMapNearestFilter",()=>i.NearestMipMapNearestFilter,"NearestMipmapLinearFilter",()=>i.NearestMipmapLinearFilter,"NearestMipmapNearestFilter",()=>i.NearestMipmapNearestFilter,"NeutralToneMapping",()=>i.NeutralToneMapping,"NeverCompare",()=>i.NeverCompare,"NeverDepth",()=>i.NeverDepth,"NeverStencilFunc",()=>i.NeverStencilFunc,"NoBlending",()=>i.NoBlending,"NoColorSpace",()=>i.NoColorSpace,"NoNormalPacking",()=>i.NoNormalPacking,"NoToneMapping",()=>i.NoToneMapping,"NormalAnimationBlendMode",()=>i.NormalAnimationBlendMode,"NormalBlending",()=>i.NormalBlending,"NormalGAPacking",()=>i.NormalGAPacking,"NormalRGPacking",()=>i.NormalRGPacking,"NotEqualCompare",()=>i.NotEqualCompare,"NotEqualDepth",()=>i.NotEqualDepth,"NotEqualStencilFunc",()=>i.NotEqualStencilFunc,"NumberKeyframeTrack",()=>i.NumberKeyframeTrack,"Object3D",()=>i.Object3D,"ObjectLoader",()=>i.ObjectLoader,"ObjectSpaceNormalMap",()=>i.ObjectSpaceNormalMap,"OctahedronGeometry",()=>i.OctahedronGeometry,"OneFactor",()=>i.OneFactor,"OneMinusConstantAlphaFactor",()=>i.OneMinusConstantAlphaFactor,"OneMinusConstantColorFactor",()=>i.OneMinusConstantColorFactor,"OneMinusDstAlphaFactor",()=>i.OneMinusDstAlphaFactor,"OneMinusDstColorFactor",()=>i.OneMinusDstColorFactor,"OneMinusSrcAlphaFactor",()=>i.OneMinusSrcAlphaFactor,"OneMinusSrcColorFactor",()=>i.OneMinusSrcColorFactor,"OrthographicCamera",()=>i.OrthographicCamera,"PCFShadowMap",()=>i.PCFShadowMap,"PCFSoftShadowMap",()=>i.PCFSoftShadowMap,"PMREMGenerator",()=>n.PMREMGenerator,"Path",()=>i.Path,"PerspectiveCamera",()=>i.PerspectiveCamera,"Plane",()=>i.Plane,"PlaneGeometry",()=>i.PlaneGeometry,"PlaneHelper",()=>i.PlaneHelper,"PointLight",()=>i.PointLight,"PointLightHelper",()=>i.PointLightHelper,"Points",()=>i.Points,"PointsMaterial",()=>i.PointsMaterial,"PolarGridHelper",()=>i.PolarGridHelper,"PolyhedronGeometry",()=>i.PolyhedronGeometry,"PositionalAudio",()=>i.PositionalAudio,"PropertyBinding",()=>i.PropertyBinding,"PropertyMixer",()=>i.PropertyMixer,"QuadraticBezierCurve",()=>i.QuadraticBezierCurve,"QuadraticBezierCurve3",()=>i.QuadraticBezierCurve3,"Quaternion",()=>i.Quaternion,"QuaternionKeyframeTrack",()=>i.QuaternionKeyframeTrack,"QuaternionLinearInterpolant",()=>i.QuaternionLinearInterpolant,"R11_EAC_Format",()=>i.R11_EAC_Format,"RED_GREEN_RGTC2_Format",()=>i.RED_GREEN_RGTC2_Format,"RED_RGTC1_Format",()=>i.RED_RGTC1_Format,"REVISION",()=>i.REVISION,"RG11_EAC_Format",()=>i.RG11_EAC_Format,"RGBADepthPacking",()=>i.RGBADepthPacking,"RGBAFormat",()=>i.RGBAFormat,"RGBAIntegerFormat",()=>i.RGBAIntegerFormat,"RGBA_ASTC_10x10_Format",()=>i.RGBA_ASTC_10x10_Format,"RGBA_ASTC_10x5_Format",()=>i.RGBA_ASTC_10x5_Format,"RGBA_ASTC_10x6_Format",()=>i.RGBA_ASTC_10x6_Format,"RGBA_ASTC_10x8_Format",()=>i.RGBA_ASTC_10x8_Format,"RGBA_ASTC_12x10_Format",()=>i.RGBA_ASTC_12x10_Format,"RGBA_ASTC_12x12_Format",()=>i.RGBA_ASTC_12x12_Format,"RGBA_ASTC_4x4_Format",()=>i.RGBA_ASTC_4x4_Format,"RGBA_ASTC_5x4_Format",()=>i.RGBA_ASTC_5x4_Format,"RGBA_ASTC_5x5_Format",()=>i.RGBA_ASTC_5x5_Format,"RGBA_ASTC_6x5_Format",()=>i.RGBA_ASTC_6x5_Format,"RGBA_ASTC_6x6_Format",()=>i.RGBA_ASTC_6x6_Format,"RGBA_ASTC_8x5_Format",()=>i.RGBA_ASTC_8x5_Format,"RGBA_ASTC_8x6_Format",()=>i.RGBA_ASTC_8x6_Format,"RGBA_ASTC_8x8_Format",()=>i.RGBA_ASTC_8x8_Format,"RGBA_BPTC_Format",()=>i.RGBA_BPTC_Format,"RGBA_ETC2_EAC_Format",()=>i.RGBA_ETC2_EAC_Format,"RGBA_PVRTC_2BPPV1_Format",()=>i.RGBA_PVRTC_2BPPV1_Format,"RGBA_PVRTC_4BPPV1_Format",()=>i.RGBA_PVRTC_4BPPV1_Format,"RGBA_S3TC_DXT1_Format",()=>i.RGBA_S3TC_DXT1_Format,"RGBA_S3TC_DXT3_Format",()=>i.RGBA_S3TC_DXT3_Format,"RGBA_S3TC_DXT5_Format",()=>i.RGBA_S3TC_DXT5_Format,"RGBDepthPacking",()=>i.RGBDepthPacking,"RGBFormat",()=>i.RGBFormat,"RGBIntegerFormat",()=>i.RGBIntegerFormat,"RGB_BPTC_SIGNED_Format",()=>i.RGB_BPTC_SIGNED_Format,"RGB_BPTC_UNSIGNED_Format",()=>i.RGB_BPTC_UNSIGNED_Format,"RGB_ETC1_Format",()=>i.RGB_ETC1_Format,"RGB_ETC2_Format",()=>i.RGB_ETC2_Format,"RGB_PVRTC_2BPPV1_Format",()=>i.RGB_PVRTC_2BPPV1_Format,"RGB_PVRTC_4BPPV1_Format",()=>i.RGB_PVRTC_4BPPV1_Format,"RGB_S3TC_DXT1_Format",()=>i.RGB_S3TC_DXT1_Format,"RGDepthPacking",()=>i.RGDepthPacking,"RGFormat",()=>i.RGFormat,"RGIntegerFormat",()=>i.RGIntegerFormat,"RawShaderMaterial",()=>i.RawShaderMaterial,"Ray",()=>i.Ray,"Raycaster",()=>i.Raycaster,"RectAreaLight",()=>i.RectAreaLight,"RedFormat",()=>i.RedFormat,"RedIntegerFormat",()=>i.RedIntegerFormat,"ReinhardToneMapping",()=>i.ReinhardToneMapping,"RenderTarget",()=>i.RenderTarget,"RenderTarget3D",()=>i.RenderTarget3D,"RepeatWrapping",()=>i.RepeatWrapping,"ReplaceStencilOp",()=>i.ReplaceStencilOp,"ReverseSubtractEquation",()=>i.ReverseSubtractEquation,"RingGeometry",()=>i.RingGeometry,"SIGNED_R11_EAC_Format",()=>i.SIGNED_R11_EAC_Format,"SIGNED_RED_GREEN_RGTC2_Format",()=>i.SIGNED_RED_GREEN_RGTC2_Format,"SIGNED_RED_RGTC1_Format",()=>i.SIGNED_RED_RGTC1_Format,"SIGNED_RG11_EAC_Format",()=>i.SIGNED_RG11_EAC_Format,"SRGBColorSpace",()=>i.SRGBColorSpace,"SRGBTransfer",()=>i.SRGBTransfer,"Scene",()=>i.Scene,"ShaderChunk",()=>n.ShaderChunk,"ShaderLib",()=>n.ShaderLib,"ShaderMaterial",()=>i.ShaderMaterial,"ShadowMaterial",()=>i.ShadowMaterial,"Shape",()=>i.Shape,"ShapeGeometry",()=>i.ShapeGeometry,"ShapePath",()=>i.ShapePath,"ShapeUtils",()=>i.ShapeUtils,"ShortType",()=>i.ShortType,"Skeleton",()=>i.Skeleton,"SkeletonHelper",()=>i.SkeletonHelper,"SkinnedMesh",()=>i.SkinnedMesh,"Source",()=>i.Source,"Sphere",()=>i.Sphere,"SphereGeometry",()=>i.SphereGeometry,"Spherical",()=>i.Spherical,"SphericalHarmonics3",()=>i.SphericalHarmonics3,"SplineCurve",()=>i.SplineCurve,"SpotLight",()=>i.SpotLight,"SpotLightHelper",()=>i.SpotLightHelper,"Sprite",()=>i.Sprite,"SpriteMaterial",()=>i.SpriteMaterial,"SrcAlphaFactor",()=>i.SrcAlphaFactor,"SrcAlphaSaturateFactor",()=>i.SrcAlphaSaturateFactor,"SrcColorFactor",()=>i.SrcColorFactor,"StaticCopyUsage",()=>i.StaticCopyUsage,"StaticDrawUsage",()=>i.StaticDrawUsage,"StaticReadUsage",()=>i.StaticReadUsage,"StereoCamera",()=>i.StereoCamera,"StreamCopyUsage",()=>i.StreamCopyUsage,"StreamDrawUsage",()=>i.StreamDrawUsage,"StreamReadUsage",()=>i.StreamReadUsage,"StringKeyframeTrack",()=>i.StringKeyframeTrack,"SubtractEquation",()=>i.SubtractEquation,"SubtractiveBlending",()=>i.SubtractiveBlending,"TOUCH",()=>i.TOUCH,"TangentSpaceNormalMap",()=>i.TangentSpaceNormalMap,"TetrahedronGeometry",()=>i.TetrahedronGeometry,"Texture",()=>i.Texture,"TextureLoader",()=>i.TextureLoader,"TextureUtils",()=>i.TextureUtils,"Timer",()=>i.Timer,"TimestampQuery",()=>i.TimestampQuery,"TorusGeometry",()=>i.TorusGeometry,"TorusKnotGeometry",()=>i.TorusKnotGeometry,"Triangle",()=>i.Triangle,"TriangleFanDrawMode",()=>i.TriangleFanDrawMode,"TriangleStripDrawMode",()=>i.TriangleStripDrawMode,"TrianglesDrawMode",()=>i.TrianglesDrawMode,"TubeGeometry",()=>i.TubeGeometry,"UVMapping",()=>i.UVMapping,"Uint16BufferAttribute",()=>i.Uint16BufferAttribute,"Uint32BufferAttribute",()=>i.Uint32BufferAttribute,"Uint8BufferAttribute",()=>i.Uint8BufferAttribute,"Uint8ClampedBufferAttribute",()=>i.Uint8ClampedBufferAttribute,"Uniform",()=>i.Uniform,"UniformsGroup",()=>i.UniformsGroup,"UniformsLib",()=>n.UniformsLib,"UniformsUtils",()=>i.UniformsUtils,"UnsignedByteType",()=>i.UnsignedByteType,"UnsignedInt101111Type",()=>i.UnsignedInt101111Type,"UnsignedInt248Type",()=>i.UnsignedInt248Type,"UnsignedInt5999Type",()=>i.UnsignedInt5999Type,"UnsignedIntType",()=>i.UnsignedIntType,"UnsignedShort4444Type",()=>i.UnsignedShort4444Type,"UnsignedShort5551Type",()=>i.UnsignedShort5551Type,"UnsignedShortType",()=>i.UnsignedShortType,"VSMShadowMap",()=>i.VSMShadowMap,"Vector2",()=>i.Vector2,"Vector3",()=>i.Vector3,"Vector4",()=>i.Vector4,"VectorKeyframeTrack",()=>i.VectorKeyframeTrack,"VideoFrameTexture",()=>i.VideoFrameTexture,"VideoTexture",()=>i.VideoTexture,"WebGL3DRenderTarget",()=>i.WebGL3DRenderTarget,"WebGLArrayRenderTarget",()=>i.WebGLArrayRenderTarget,"WebGLCoordinateSystem",()=>i.WebGLCoordinateSystem,"WebGLCubeRenderTarget",()=>i.WebGLCubeRenderTarget,"WebGLRenderTarget",()=>i.WebGLRenderTarget,"WebGLRenderer",()=>n.WebGLRenderer,"WebGLUtils",()=>n.WebGLUtils,"WebGPUCoordinateSystem",()=>i.WebGPUCoordinateSystem,"WebXRController",()=>i.WebXRController,"WireframeGeometry",()=>i.WireframeGeometry,"WrapAroundEnding",()=>i.WrapAroundEnding,"ZeroCurvatureEnding",()=>i.ZeroCurvatureEnding,"ZeroFactor",()=>i.ZeroFactor,"ZeroSlopeEnding",()=>i.ZeroSlopeEnding,"ZeroStencilOp",()=>i.ZeroStencilOp,"createCanvasElement",()=>i.createCanvasElement,"error",()=>i.error,"getConsoleFunction",()=>i.getConsoleFunction,"log",()=>i.log,"setConsoleFunction",()=>i.setConsoleFunction,"warn",()=>i.warn,"warnOnce",()=>i.warnOnce],32009);var o=e.i(32009);function a(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}let l=["x","y","top","bottom","left","right","width","height"];var u=e.i(46791),s=e.i(43476);function c({ref:e,children:n,fallback:i,resize:u,style:c,gl:f,events:d=t.f,eventSource:p,eventPrefix:m,shadows:h,linear:v,flat:g,legacy:y,orthographic:b,frameloop:S,dpr:C,performance:x,raycaster:E,camera:A,scene:w,onPointerMissed:_,onCreated:T,...M}){r.useMemo(()=>(0,t.e)(o),[]);let R=(0,t.u)(),[O,I]=function({debounce:e,scroll:t,polyfill:n,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){var o,u,s;let c=n||("u" (v.current=!0,()=>void(v.current=!1)));let[g,y,b]=(0,r.useMemo)(()=>{let e=()=>{let e,t;if(!p.current.element)return;let{left:r,top:n,width:o,height:a,bottom:u,right:s,x:c,y:f}=p.current.element.getBoundingClientRect(),m={left:r,top:n,width:o,height:a,bottom:u,right:s,x:c,y:f};p.current.element instanceof HTMLElement&&i&&(m.height=p.current.element.offsetHeight,m.width=p.current.element.offsetWidth),Object.freeze(m),v.current&&(e=p.current.lastBounds,t=m,!l.every(r=>e[r]===t[r]))&&d(p.current.lastBounds=m)};return[e,h?a(e,h):e,m?a(e,m):e]},[d,i,m,h]);function S(){p.current.scrollContainers&&(p.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",b,!0)),p.current.scrollContainers=null),p.current.resizeObserver&&(p.current.resizeObserver.disconnect(),p.current.resizeObserver=null),p.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",p.current.orientationHandler))}function C(){p.current.element&&(p.current.resizeObserver=new c(b),p.current.resizeObserver.observe(p.current.element),t&&p.current.scrollContainers&&p.current.scrollContainers.forEach(e=>e.addEventListener("scroll",b,{capture:!0,passive:!0})),p.current.orientationHandler=()=>{b()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",p.current.orientationHandler))}return o=b,u=!!t,(0,r.useEffect)(()=>{if(u)return window.addEventListener("scroll",o,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",o,!0)},[o,u]),s=y,(0,r.useEffect)(()=>(window.addEventListener("resize",s),()=>void window.removeEventListener("resize",s)),[s]),(0,r.useEffect)(()=>{S(),C()},[t,b,y]),(0,r.useEffect)(()=>S,[]),[e=>{e&&e!==p.current.element&&(S(),p.current.element=e,p.current.scrollContainers=function e(t){let r=[];if(!t||t===document.body)return r;let{overflow:n,overflowX:i,overflowY:o}=window.getComputedStyle(t);return[n,i,o].some(e=>"auto"===e||"scroll"===e)&&r.push(t),[...r,...e(t.parentElement)]}(e),C())},f,g]}({scroll:!0,debounce:{scroll:50,resize:0},...u}),F=r.useRef(null),L=r.useRef(null);r.useImperativeHandle(e,()=>F.current);let P=(0,t.a)(_),[D,B]=r.useState(!1),[G,k]=r.useState(!1);if(D)throw D;if(G)throw G;let j=r.useRef(null);(0,t.b)(()=>{let e=F.current;I.width>0&&I.height>0&&e&&(j.current||(j.current=(0,t.c)(e)),async function(){await j.current.configure({gl:f,scene:w,events:d,shadows:h,linear:v,flat:g,legacy:y,orthographic:b,frameloop:S,dpr:C,performance:x,raycaster:E,camera:A,size:I,onPointerMissed:(...e)=>null==P.current?void 0:P.current(...e),onCreated:e=>{null==e.events.connect||e.events.connect(p?(0,t.i)(p)?p.current:p:L.current),m&&e.setEvents({compute:(e,t)=>{let r=e[m+"X"],n=e[m+"Y"];t.pointer.set(r/t.size.width*2-1,-(2*(n/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==T||T(e)}}),j.current.render((0,s.jsx)(R,{children:(0,s.jsx)(t.E,{set:k,children:(0,s.jsx)(r.Suspense,{fallback:(0,s.jsx)(t.B,{set:B}),children:null!=n?n:null})})}))}())}),r.useEffect(()=>{let e=F.current;if(e)return()=>(0,t.d)(e)},[]);let N=p?"none":"auto";return(0,s.jsx)("div",{ref:L,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:N,...c},...M,children:(0,s.jsx)("div",{ref:O,style:{width:"100%",height:"100%"},children:(0,s.jsx)("canvas",{ref:F,style:{display:"block"},children:i})})})}function f(e){return(0,s.jsx)(u.FiberProvider,{children:(0,s.jsx)(c,{...e})})}e.i(89499),e.s(["Canvas",()=>f],75056)},17751,e=>{"use strict";var t=e.i(19273),r=e.i(86491),n=e.i(40143),i=e.i(15823),o=class extends i.Subscribable{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,i){let o=n.queryKey,a=n.queryHash??(0,t.hashQueryKeyByOptions)(o,n),l=this.get(a);return l||(l=new r.Query({client:e,queryKey:o,queryHash:a,options:e.defaultQueryOptions(n),state:i,defaultOptions:e.getQueryDefaults(o)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let r={exact:!0,...e};return this.getAll().find(e=>(0,t.matchQuery)(r,e))}findAll(e={}){let r=this.getAll();return Object.keys(e).length>0?r.filter(r=>(0,t.matchQuery)(e,r)):r}notify(e){n.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},a=e.i(88587),l=e.i(36553),u=class extends a.Removable{#t;#r;#n;#i;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#r=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#r.includes(e)||(this.#r.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#r=this.#r.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#r.length||("pending"===this.state.status?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#o({type:"continue"})},r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=(0,l.createRetryer)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#o({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#o({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let n="pending"===this.state.status,i=!this.#i.canStart();try{if(n)t();else{this.#o({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#o({type:"pending",context:t,variables:e,isPaused:i})}let o=await this.#i.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,r),await this.options.onSuccess?.(o,e,this.state.context,r),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(o,null,e,this.state.context,r),this.#o({type:"success",data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#o({type:"error",error:t}),t}finally{this.#n.runNext(this)}}#o(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.notifyManager.batch(()=>{this.#r.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}},s=i,c=class extends s.Subscribable{constructor(e={}){super(),this.config=e,this.#a=new Set,this.#l=new Map,this.#u=0}#a;#l;#u;build(e,t,r){let n=new u({client:e,mutationCache:this,mutationId:++this.#u,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#a.add(e);let t=f(e);if("string"==typeof t){let r=this.#l.get(t);r?r.push(e):this.#l.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#a.delete(e)){let t=f(e);if("string"==typeof t){let r=this.#l.get(t);if(r)if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#l.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=f(e);if("string"!=typeof t)return!0;{let r=this.#l.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=f(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#l.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){n.notifyManager.batch(()=>{this.#a.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#a.clear(),this.#l.clear()})}getAll(){return Array.from(this.#a)}find(e){let r={exact:!0,...e};return this.getAll().find(e=>(0,t.matchMutation)(r,e))}findAll(e={}){return this.getAll().filter(r=>(0,t.matchMutation)(e,r))}notify(e){n.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return n.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(t.noop))))}};function f(e){return e.options.scope?.id}var d=e.i(75555),p=e.i(14448);function m(e){return{onFetch:(r,n)=>{let i=r.options,o=r.fetchOptions?.meta?.fetchMore?.direction,a=r.state.data?.pages||[],l=r.state.data?.pageParams||[],u={pages:[],pageParams:[]},s=0,c=async()=>{let n=!1,c=(0,t.ensureQueryFn)(r.options,r.fetchOptions),f=async(e,i,o)=>{let a;if(n)return Promise.reject();if(null==i&&e.pages.length)return Promise.resolve(e);let l=(a={client:r.client,queryKey:r.queryKey,pageParam:i,direction:o?"backward":"forward",meta:r.options.meta},(0,t.addConsumeAwareSignal)(a,()=>r.signal,()=>n=!0),a),u=await c(l),{maxPages:s}=r.options,f=o?t.addToStart:t.addToEnd;return{pages:f(e.pages,u,s),pageParams:f(e.pageParams,i,s)}};if(o&&a.length){let e="backward"===o,t={pages:a,pageParams:l},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:h)(i,t);u=await f(t,r,e)}else{let t=e??a.length;do{let e=0===s?l[0]??i.initialPageParam:h(i,u);if(s>0&&null==e)break;u=await f(u,e),s++}while(s r.options.persister?.(c,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},n):r.fetchFn=c}}}function h(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}var v=class{#s;#n;#c;#f;#d;#p;#m;#h;constructor(e={}){this.#s=e.queryCache||new o,this.#n=e.mutationCache||new c,this.#c=e.defaultOptions||{},this.#f=new Map,this.#d=new Map,this.#p=0}mount(){this.#p++,1===this.#p&&(this.#m=d.focusManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#s.onFocus())}),this.#h=p.onlineManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#s.onOnline())}))}unmount(){this.#p--,0===this.#p&&(this.#m?.(),this.#m=void 0,this.#h?.(),this.#h=void 0)}isFetching(e){return this.#s.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#s.get(t.queryHash)?.state.data}ensureQueryData(e){let r=this.defaultQueryOptions(e),n=this.#s.build(this,r),i=n.state.data;return void 0===i?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime((0,t.resolveStaleTime)(r.staleTime,n))&&this.prefetchQuery(r),Promise.resolve(i))}getQueriesData(e){return this.#s.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,r,n){let i=this.defaultQueryOptions({queryKey:e}),o=this.#s.get(i.queryHash),a=o?.state.data,l=(0,t.functionalUpdate)(r,a);if(void 0!==l)return this.#s.build(this,i).setData(l,{...n,manual:!0})}setQueriesData(e,t,r){return n.notifyManager.batch(()=>this.#s.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#s.get(t.queryHash)?.state}removeQueries(e){let t=this.#s;n.notifyManager.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#s;return n.notifyManager.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,r={}){let i={revert:!0,...r};return Promise.all(n.notifyManager.batch(()=>this.#s.findAll(e).map(e=>e.cancel(i)))).then(t.noop).catch(t.noop)}invalidateQueries(e,t={}){return n.notifyManager.batch(()=>(this.#s.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,r={}){let i={...r,cancelRefetch:r.cancelRefetch??!0};return Promise.all(n.notifyManager.batch(()=>this.#s.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let r=e.fetch(void 0,i);return i.throwOnError||(r=r.catch(t.noop)),"paused"===e.state.fetchStatus?Promise.resolve():r}))).then(t.noop)}fetchQuery(e){let r=this.defaultQueryOptions(e);void 0===r.retry&&(r.retry=!1);let n=this.#s.build(this,r);return n.isStaleByTime((0,t.resolveStaleTime)(r.staleTime,n))?n.fetch(r):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(t.noop).catch(t.noop)}fetchInfiniteQuery(e){return e.behavior=m(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(t.noop).catch(t.noop)}ensureInfiniteQueryData(e){return e.behavior=m(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return p.onlineManager.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#s}getMutationCache(){return this.#n}getDefaultOptions(){return this.#c}setDefaultOptions(e){this.#c=e}setQueryDefaults(e,r){this.#f.set((0,t.hashKey)(e),{queryKey:e,defaultOptions:r})}getQueryDefaults(e){let r=[...this.#f.values()],n={};return r.forEach(r=>{(0,t.partialMatchKey)(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,r){this.#d.set((0,t.hashKey)(e),{mutationKey:e,defaultOptions:r})}getMutationDefaults(e){let r=[...this.#d.values()],n={};return r.forEach(r=>{(0,t.partialMatchKey)(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let r={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return r.queryHash||(r.queryHash=(0,t.hashQueryKeyByOptions)(r.queryKey,r)),void 0===r.refetchOnReconnect&&(r.refetchOnReconnect="always"!==r.networkMode),void 0===r.throwOnError&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.queryFn===t.skipToken&&(r.enabled=!1),r}defaultMutationOptions(e){return e?._defaulted?e:{...this.#c.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#s.clear(),this.#n.clear()}};e.s(["QueryClient",()=>v],17751)},81405,(e,t,r)=>{var n;e.e,(n=function(){function e(e){return i.appendChild(e.dom),e}function t(e){for(var t=0;t a+1e3&&(u.update(1e3*l/(e-a),100),a=e,l=0,c)){var t=performance.memory;c.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){o=this.end()},domElement:i,setMode:t}}).Panel=function(e,t,r){var n=1/0,i=0,o=Math.round,a=o(window.devicePixelRatio||1),l=80*a,u=48*a,s=3*a,c=2*a,f=3*a,d=15*a,p=74*a,m=30*a,h=document.createElement("canvas");h.width=l,h.height=u,h.style.cssText="width:80px;height:48px";var v=h.getContext("2d");return v.font="bold "+9*a+"px Helvetica,Arial,sans-serif",v.textBaseline="top",v.fillStyle=r,v.fillRect(0,0,l,u),v.fillStyle=t,v.fillText(e,s,c),v.fillRect(f,d,p,m),v.fillStyle=r,v.globalAlpha=.9,v.fillRect(f,d,p,m),{dom:h,update:function(u,g){n=Math.min(n,u),i=Math.max(i,u),v.fillStyle=r,v.globalAlpha=1,v.fillRect(0,0,l,d),v.fillStyle=t,v.fillText(o(u)+" "+e+" ("+o(n)+"-"+o(i)+")",s,c),v.drawImage(h,f+a,d,p-a,m,f,d,p-a,m),v.fillRect(f+p-a,d,a,m),v.fillStyle=r,v.globalAlpha=.9,v.fillRect(f+p-a,d,a,o((1-u/g)*m))}}},t.exports=n},55141,e=>{e.v({AxisLabel:"DebugElements-module__Cmeo9W__AxisLabel",StatsPanel:"DebugElements-module__Cmeo9W__StatsPanel"})},86855,e=>{"use strict";var t=e.i(43476),r=e.i(932),n=e.i(71645),i=e.i(40859),i=i,o=i,a=e.i(81405);function l(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function u({showPanel:e=0,className:t,parent:r}){let u=function(e,t=[],r){let[i,o]=n.useState();return n.useLayoutEffect(()=>{let t=e();return o(t),l(void 0,t),()=>l(void 0,null)},t),i}(()=>new a.default,[]);return n.useEffect(()=>{if(u){let n=r&&r.current||document.body;u.showPanel(e),null==n||n.appendChild(u.dom);let a=(null!=t?t:"").split(" ").filter(e=>e);a.length&&u.dom.classList.add(...a);let l=(0,i.j)(()=>u.begin()),s=(0,o.k)(()=>u.end());return()=>{a.length&&u.dom.classList.remove(...a),null==n||n.removeChild(u.dom),l(),s()}}},[r,u,t,e]),null}var s=e.i(60099),c=e.i(79123),f=e.i(55141);function d(){let e,i,o=(0,r.c)(3),{debugMode:a}=(0,c.useDebug)(),l=(0,n.useRef)(null);return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{let e=l.current;e&&e.setColors("rgb(153, 255, 0)","rgb(0, 153, 255)","rgb(255, 153, 0)")},o[0]=e):e=o[0],(0,n.useEffect)(e),o[1]!==a?(i=a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u,{className:f.default.StatsPanel}),(0,t.jsx)("axesHelper",{ref:l,args:[70],renderOrder:999,children:(0,t.jsx)("lineBasicMaterial",{depthTest:!1,depthWrite:!1,fog:!1,vertexColors:!0})}),(0,t.jsx)(s.Html,{position:[80,0,0],center:!0,children:(0,t.jsx)("span",{className:f.default.AxisLabel,"data-axis":"y",children:"Y"})}),(0,t.jsx)(s.Html,{position:[0,80,0],center:!0,children:(0,t.jsx)("span",{className:f.default.AxisLabel,"data-axis":"z",children:"Z"})}),(0,t.jsx)(s.Html,{position:[0,0,80],center:!0,children:(0,t.jsx)("span",{className:f.default.AxisLabel,"data-axis":"x",children:"X"})})]}):null,o[1]=a,o[2]=i):i=o[2],i}e.s(["DebugElements",()=>d],86855)},38360,(e,t,r)=>{var n={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},i=Object.keys(n).join("|"),o=RegExp(i,"g"),a=RegExp(i,"");function l(e){return n[e]}var u=function(e){return e.replace(o,l)};t.exports=u,t.exports.has=function(e){return!!e.match(a)},t.exports.remove=u},11889,56373,86447,1559,18364,78440,59129,25998,70238,e=>{"use strict";e.i(47167);var t,r="u">typeof window&&!!(null==(t=window.document)?void 0:t.createElement);function n(e){return e?"self"in e?e.document:e.ownerDocument||document:document}function i(e){return e?"self"in e?e.self:n(e).defaultView||window:self}function o(e,t=!1){var r;let{activeElement:i}=n(e);if(!(null==i?void 0:i.nodeName))return null;if(l(i)&&(null==(r=i.contentDocument)?void 0:r.body))return o(i.contentDocument.body,t);if(t){let e=i.getAttribute("aria-activedescendant");if(e){let t=n(i).getElementById(e);if(t)return t}}return i}function a(e,t){return e===t||e.contains(t)}function l(e){return"IFRAME"===e.tagName}function u(e){let t=e.tagName.toLowerCase();return"button"===t||"input"===t&&!!e.type&&-1!==s.indexOf(e.type)}var s=["button","color","file","image","reset","submit"];function c(e){return"function"==typeof e.checkVisibility?e.checkVisibility():e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function f(e){try{let t=e instanceof HTMLInputElement&&null!==e.selectionStart,r="TEXTAREA"===e.tagName;return t||r||!1}catch(e){return!1}}function d(e){return e.isContentEditable||f(e)}function p(e){let t=0,r=0;if(f(e))t=e.selectionStart||0,r=e.selectionEnd||0;else if(e.isContentEditable){let i=n(e).getSelection();if((null==i?void 0:i.rangeCount)&&i.anchorNode&&a(e,i.anchorNode)&&i.focusNode&&a(e,i.focusNode)){let n=i.getRangeAt(0),o=n.cloneRange();o.selectNodeContents(e),o.setEnd(n.startContainer,n.startOffset),t=o.toString().length,o.setEnd(n.endContainer,n.endOffset),r=o.toString().length}}return{start:t,end:r}}function m(e,t){let r=null==e?void 0:e.getAttribute("role");return r&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(r)?r:t}function h(e){if(!e)return null;let t=e=>"auto"===e||"scroll"===e;if(e.clientHeight&&e.scrollHeight>e.clientHeight){let{overflowY:r}=getComputedStyle(e);if(t(r))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){let{overflowX:r}=getComputedStyle(e);if(t(r))return e}return h(e.parentElement)||document.scrollingElement||document.body}function v(e,...t){/text|search|password|tel|url/i.test(e.type)&&e.setSelectionRange(...t)}function g(e,t){return t&&e.item(t)||null}var y=Symbol("FOCUS_SILENTLY");function b(e,t,r){if(!t||t===r)return!1;let n=e.item(t.id);return!!n&&(!r||n.element!==r)}function S(){}function C(e,t){return"function"==typeof Object.hasOwn?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function x(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}function E(e){return e}function A(e,t){if(!e){if("string"!=typeof t)throw Error("Invariant failed");throw Error(t)}}function w(e,...t){let r="function"==typeof e?e(...t):e;return null!=r&&!r}function _(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function T(e){let t={};for(let r in e)void 0!==e[r]&&(t[r]=e[r]);return t}function M(...e){for(let t of e)if(void 0!==t)return t}var R=e.i(71645);function O(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function I(){return r&&!!navigator.maxTouchPoints}function F(){return!!r&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function L(){return r&&F()&&/apple/i.test(navigator.vendor)}function P(e){return!!(e.currentTarget&&!a(e.currentTarget,e.target))}function D(e){return e.target===e.currentTarget}function B(e,t){let r=new FocusEvent("blur",t),n=e.dispatchEvent(r),i={...t,bubbles:!0};return e.dispatchEvent(new FocusEvent("focusout",i)),n}function G(e,t){let r=new MouseEvent("click",t);return e.dispatchEvent(r)}function k(e,t){let r=t||e.currentTarget,n=e.relatedTarget;return!n||!a(r,n)}function j(e,t,r,n){let i=(e=>{if(n){let t=setTimeout(e,n);return()=>clearTimeout(t)}let t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})(()=>{e.removeEventListener(t,o,!0),r()}),o=()=>{i(),r()};return e.addEventListener(t,o,{once:!0,capture:!0}),i}function N(e,t,r,n=window){let i=[];try{for(let o of(n.document.addEventListener(e,t,r),Array.from(n.frames)))i.push(N(e,t,r,o))}catch(e){}return()=>{try{n.document.removeEventListener(e,t,r)}catch(e){}for(let e of i)e()}}var U={...R},q=U.useId;U.useDeferredValue;var V=U.useInsertionEffect,H=r?R.useLayoutEffect:R.useEffect;function W(e){let t=(0,R.useRef)(()=>{throw Error("Cannot call an event handler while rendering.")});return V?V(()=>{t.current=e}):t.current=e,(0,R.useCallback)((...e)=>{var r;return null==(r=t.current)?void 0:r.call(t,...e)},[])}function K(...e){return(0,R.useMemo)(()=>{if(e.some(Boolean))return t=>{for(let r of e)O(r,t)}},e)}function z(e){if(q){let t=q();return e||t}let[t,r]=(0,R.useState)(e);return H(()=>{if(e||t)return;let n=Math.random().toString(36).slice(2,8);r(`id-${n}`)},[e,t]),e||t}function Q(e,t){let r=(0,R.useRef)(!1);(0,R.useEffect)(()=>{if(r.current)return e();r.current=!0},t),(0,R.useEffect)(()=>()=>{r.current=!1},[])}function $(){return(0,R.useReducer)(()=>[],[])}function X(e){return W("function"==typeof e?e:()=>e)}function Y(e,t,r=[]){let n=(0,R.useCallback)(r=>(e.wrapElement&&(r=e.wrapElement(r)),t(r)),[...r,e.wrapElement]);return{...e,wrapElement:n}}function Z(e=!1,t){let[r,n]=(0,R.useState)(null);return{portalRef:K(n,t),portalNode:r,domReady:!e||r}}var J=!1,ee=!1,et=0,er=0;function en(e){let t,r;t=e.movementX||e.screenX-et,r=e.movementY||e.screenY-er,et=e.screenX,er=e.screenY,(t||r||0)&&(ee=!0)}function ei(){ee=!1}var eo=e.i(43476);function ea(e){let t=R.forwardRef((t,r)=>e({...t,ref:r}));return t.displayName=e.displayName||e.name,t}function el(e,t){return R.memo(e,t)}function eu(e,t){let r,{wrapElement:n,render:i,...o}=t,a=K(t.ref,i&&(0,R.isValidElement)(i)&&("ref"in i.props||"ref"in i)?({...i.props}).ref||i.ref:null);if(R.isValidElement(i)){let e={...i.props,ref:a};r=R.cloneElement(i,function(e,t){let r={...e};for(let n in t){if(!C(t,n))continue;if("className"===n){let n="className";r[n]=e[n]?`${e[n]} ${t[n]}`:t[n];continue}if("style"===n){let n="style";r[n]=e[n]?{...e[n],...t[n]}:t[n];continue}let i=t[n];if("function"==typeof i&&n.startsWith("on")){let t=e[n];if("function"==typeof t){r[n]=(...e)=>{i(...e),t(...e)};continue}}r[n]=i}return r}(o,e))}else r=i?i(o):(0,eo.jsx)(e,{...o});return n?n(r):r}function es(e){let t=(t={})=>e(t);return t.displayName=e.name,t}function ec(e=[],t=[]){let r=R.createContext(void 0),n=R.createContext(void 0),i=()=>R.useContext(r),o=t=>e.reduceRight((e,r)=>(0,eo.jsx)(r,{...t,children:e}),(0,eo.jsx)(r.Provider,{...t}));return{context:r,scopedContext:n,useContext:i,useScopedContext:(e=!1)=>{let t=R.useContext(n),r=i();return e?t:t||r},useProviderContext:()=>{let e=R.useContext(n),t=i();if(!e||e!==t)return t},ContextProvider:o,ScopedContextProvider:e=>(0,eo.jsx)(o,{...e,children:t.reduceRight((t,r)=>(0,eo.jsx)(r,{...e,children:t}),(0,eo.jsx)(n.Provider,{...e}))})}}var ef=ec(),ed=ef.useContext;ef.useScopedContext,ef.useProviderContext;var ep=ec([ef.ContextProvider],[ef.ScopedContextProvider]),em=ep.useContext;ep.useScopedContext;var eh=ep.useProviderContext,ev=ep.ContextProvider,eg=ep.ScopedContextProvider,ey=(0,R.createContext)(void 0),eb=(0,R.createContext)(void 0),eS=(0,R.createContext)(!0),eC="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function ex(e){return!(!e.matches(eC)||!c(e)||e.closest("[inert]"))}function eE(e){if(!ex(e)||0>Number.parseInt(e.getAttribute("tabindex")||"0",10))return!1;if(!("form"in e)||!e.form||e.checked||"radio"!==e.type)return!0;let t=e.form.elements.namedItem(e.name);if(!t||!("length"in t))return!0;let r=o(e);return!r||r===e||!("form"in r)||r.form!==e.form||r.name!==e.name}function eA(e,t){let r=Array.from(e.querySelectorAll(eC));t&&r.unshift(e);let n=r.filter(ex);return n.forEach((e,t)=>{var r;if(!l(e))return;let i=null==(r=e.contentDocument)?void 0:r.body;i&&n.splice(t,1,...eA(i))}),n}function ew(e,t,r){let n=Array.from(e.querySelectorAll(eC)),i=n.filter(eE);return(t&&eE(e)&&i.unshift(e),i.forEach((e,t)=>{var n;if(!l(e))return;let o=null==(n=e.contentDocument)?void 0:n.body;if(!o)return;let a=ew(o,!1,r);i.splice(t,1,...a)}),!i.length&&r)?n:i}function e_(e,t){var r;let n,i,a,l;return r=document.body,n=o(r),a=(i=eA(r,!1)).indexOf(n),(l=i.slice(a+1)).find(eE)||(e?i.find(eE):null)||(t?l[0]:null)||null}function eT(e,t){var r;let n,i,a,l;return r=document.body,n=o(r),a=(i=eA(r,!1).reverse()).indexOf(n),(l=i.slice(a+1)).find(eE)||(e?i.find(eE):null)||(t?l[0]:null)||null}function eM(e){let t=o(e);if(!t)return!1;if(t===e)return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&r===e.id}function eR(e){let t=o(e);if(!t)return!1;if(a(e,t))return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&"id"in e&&(r===e.id||!!e.querySelector(`#${CSS.escape(r)}`))}function eO(e){!eR(e)&&ex(e)&&e.focus()}var eI=L(),eF=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],eL=Symbol("safariFocusAncestor");function eP(e){return"input"===e.tagName.toLowerCase()&&!!e.type&&("radio"===e.type||"checkbox"===e.type)}function eD(e,t){return W(r=>{null==e||e(r),!r.defaultPrevented&&t&&(r.stopPropagation(),r.preventDefault())})}var eB=!1,eG=!0;function ek(e){let t=e.target;t&&"hasAttribute"in t&&!t.hasAttribute("data-focus-visible")&&(eG=!1)}function ej(e){e.metaKey||e.ctrlKey||e.altKey||(eG=!0)}var eN=es(function({focusable:e=!0,accessibleWhenDisabled:t,autoFocus:r,onFocusVisible:n,...i}){var o,a,l,s,c;let f=(0,R.useRef)(null);(0,R.useEffect)(()=>{!e||eB||(N("mousedown",ek,!0),N("keydown",ej,!0),eB=!0)},[e]),eI&&(0,R.useEffect)(()=>{if(!e)return;let t=f.current;if(!t||!eP(t))return;let r="labels"in t?t.labels:null;if(!r)return;let n=()=>queueMicrotask(()=>t.focus());for(let e of r)e.addEventListener("mouseup",n);return()=>{for(let e of r)e.removeEventListener("mouseup",n)}},[e]);let d=e&&_(i),p=!!d&&!t,[m,h]=(0,R.useState)(!1);(0,R.useEffect)(()=>{e&&p&&m&&h(!1)},[e,p,m]),(0,R.useEffect)(()=>{if(!e||!m)return;let t=f.current;if(!t||"u" {ex(t)||h(!1)});return r.observe(t),()=>r.disconnect()},[e,m]);let v=eD(i.onKeyPressCapture,d),g=eD(i.onMouseDownCapture,d),y=eD(i.onClickCapture,d),b=i.onMouseDown,S=W(t=>{if(null==b||b(t),t.defaultPrevented||!e)return;let r=t.currentTarget;if(!eI||P(t)||!u(r)&&!eP(r))return;let n=!1,i=()=>{n=!0};r.addEventListener("focusin",i,{capture:!0,once:!0});let o=function(e){for(;e&&!ex(e);)e=e.closest(eC);return e||null}(r.parentElement);o&&(o[eL]=!0),j(r,"mouseup",()=>{r.removeEventListener("focusin",i,!0),o&&(o[eL]=!1),n||eO(r)})}),C=(t,r)=>{if(r&&(t.currentTarget=r),!e)return;let i=t.currentTarget;i&&eM(i)&&(null==n||n(t),t.defaultPrevented||(i.dataset.focusVisible="true",h(!0)))},x=i.onKeyDownCapture,E=W(t=>{if(null==x||x(t),t.defaultPrevented||!e||m||t.metaKey||t.altKey||t.ctrlKey||!D(t))return;let r=t.currentTarget;j(r,"focusout",()=>C(t,r))}),A=i.onFocusCapture,w=W(t=>{if(null==A||A(t),t.defaultPrevented||!e)return;if(!D(t))return void h(!1);let r=t.currentTarget;eG||function(e){let{tagName:t,readOnly:r,type:n}=e;return"TEXTAREA"===t&&!r||"SELECT"===t&&!r||("INPUT"!==t||r?!!e.isContentEditable||"combobox"===e.getAttribute("role")&&!!e.dataset.name:eF.includes(n))}(t.target)?j(t.target,"focusout",()=>C(t,r)):h(!1)}),M=i.onBlur,O=W(t=>{null==M||M(t),!e||k(t)&&(t.currentTarget.removeAttribute("data-focus-visible"),h(!1))}),I=(0,R.useContext)(eS),F=W(t=>{e&&r&&t&&I&&queueMicrotask(()=>{eM(t)||ex(t)&&t.focus()})}),L=function(e,t){let r=e=>{if("string"==typeof e)return e},[n,i]=(0,R.useState)(()=>r(void 0));return H(()=>{let t=e&&"current"in e?e.current:e;i((null==t?void 0:t.tagName.toLowerCase())||r(void 0))},[e,void 0]),n}(f),B=e&&(!L||"button"===L||"summary"===L||"input"===L||"select"===L||"textarea"===L||"a"===L),G=e&&(!L||"button"===L||"input"===L||"select"===L||"textarea"===L),U=i.style,q=(0,R.useMemo)(()=>p?{pointerEvents:"none",...U}:U,[p,U]);return i={"data-focus-visible":e&&m||void 0,"data-autofocus":r||void 0,"aria-disabled":d||void 0,...i,ref:K(f,F,i.ref),style:q,tabIndex:(o=e,a=p,l=B,s=G,c=i.tabIndex,o?a?l&&!s?-1:void 0:l?c:c||0:c),disabled:!!G&&!!p||void 0,contentEditable:d?void 0:i.contentEditable,onKeyPressCapture:v,onClickCapture:y,onMouseDownCapture:g,onMouseDown:S,onKeyDownCapture:E,onFocusCapture:w,onBlur:O},T(i)});function eU(e){let t=[];for(let r of e)t.push(...r);return t}function eq(e){return e.slice().reverse()}function eV(e,t,r){return W(n=>{var i;let o,a;if(null==t||t(n),n.defaultPrevented||n.isPropagationStopped()||!D(n)||"Shift"===n.key||"Control"===n.key||"Alt"===n.key||"Meta"===n.key||(!(o=n.target)||f(o))&&1===n.key.length&&!n.ctrlKey&&!n.metaKey)return;let l=e.getState(),u=null==(i=g(e,l.activeId))?void 0:i.element;if(!u)return;let{view:s,...c}=n;u!==(null==r?void 0:r.current)&&u.focus(),a=new KeyboardEvent(n.type,c),u.dispatchEvent(a)||n.preventDefault(),n.currentTarget.contains(u)&&n.stopPropagation()})}ea(function(e){return eu("div",eN(e))});var eH=es(function({store:e,composite:t=!0,focusOnMove:r=t,moveOnKeyPress:n=!0,...i}){let a=eh();A(e=e||a,!1);let l=(0,R.useRef)(null),u=(0,R.useRef)(null),s=function(e){let[t,r]=(0,R.useState)(!1),n=(0,R.useCallback)(()=>r(!0),[]),i=e.useState(t=>g(e,t.activeId));return(0,R.useEffect)(()=>{let e=null==i?void 0:i.element;!t||e&&(r(!1),e.focus({preventScroll:!0}))},[i,t]),n}(e),c=e.useState("moves"),[,d]=function(e){let[t,r]=(0,R.useState)(null);return H(()=>{if(null==t||!e)return;let r=null;return e(e=>(r=e,t)),()=>{e(r)}},[t,e]),[t,r]}(t?e.setBaseElement:null);(0,R.useEffect)(()=>{var n;if(!e||!c||!t||!r)return;let{activeId:i}=e.getState(),o=null==(n=g(e,i))?void 0:n.element;o&&("scrollIntoView"in o?(o.focus({preventScroll:!0}),o.scrollIntoView({block:"nearest",inline:"nearest",...void 0})):o.focus())},[e,c,t,r]),H(()=>{if(!e||!c||!t)return;let{baseElement:r,activeId:n}=e.getState();if(null!==n||!r)return;let i=u.current;u.current=null,i&&B(i,{relatedTarget:r}),eM(r)||r.focus()},[e,c,t]);let p=e.useState("activeId"),m=e.useState("virtualFocus");H(()=>{var r;if(!e||!t||!m)return;let n=u.current;if(u.current=null,!n)return;let i=(null==(r=g(e,p))?void 0:r.element)||o(n);i!==n&&B(n,{relatedTarget:i})},[e,p,m,t]);let h=eV(e,i.onKeyDownCapture,u),v=eV(e,i.onKeyUpCapture,u),S=i.onFocusCapture,C=W(t=>{var r;let n;if(null==S||S(t),t.defaultPrevented||!e)return;let{virtualFocus:i}=e.getState();if(!i)return;let o=t.relatedTarget,a=(n=(r=t.currentTarget)[y],delete r[y],n);D(t)&&a&&(t.stopPropagation(),u.current=o)}),x=i.onFocus,E=W(r=>{if(null==x||x(r),r.defaultPrevented||!t||!e)return;let{relatedTarget:n}=r,{virtualFocus:i}=e.getState();i?D(r)&&!b(e,n)&&queueMicrotask(s):D(r)&&e.setActiveId(null)}),w=i.onBlurCapture,_=W(t=>{var r;if(null==w||w(t),t.defaultPrevented||!e)return;let{virtualFocus:n,activeId:i}=e.getState();if(!n)return;let o=null==(r=g(e,i))?void 0:r.element,a=t.relatedTarget,l=b(e,a),s=u.current;u.current=null,D(t)&&l?(a===o?s&&s!==a&&B(s,t):o?B(o,t):s&&B(s,t),t.stopPropagation()):!b(e,t.target)&&o&&B(o,t)}),T=i.onKeyDown,M=X(n),O=W(t=>{var r;if(null==T||T(t),t.nativeEvent.isComposing||t.defaultPrevented||!e||!D(t))return;let{orientation:n,renderedItems:i,activeId:o}=e.getState(),a=g(e,o);if(null==(r=null==a?void 0:a.element)?void 0:r.isConnected)return;let l="horizontal"!==n,u="vertical"!==n,s=i.some(e=>!!e.rowId);if(("ArrowLeft"===t.key||"ArrowRight"===t.key||"Home"===t.key||"End"===t.key)&&f(t.currentTarget))return;let c={ArrowUp:(s||l)&&(()=>{if(s){let e=eU(eq(function(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}(i))).find(e=>!e.disabled);return null==e?void 0:e.id}return null==e?void 0:e.last()}),ArrowRight:(s||u)&&e.first,ArrowDown:(s||l)&&e.first,ArrowLeft:(s||u)&&e.last,Home:e.first,End:e.last,PageUp:e.first,PageDown:e.last}[t.key];if(c){let r=c();if(void 0!==r){if(!M(t))return;t.preventDefault(),e.move(r)}}});return i=Y(i,t=>(0,eo.jsx)(ev,{value:e,children:t}),[e]),i={"aria-activedescendant":e.useState(r=>{var n;if(e&&t&&r.virtualFocus)return null==(n=g(e,r.activeId))?void 0:n.id}),...i,ref:K(l,d,i.ref),onKeyDownCapture:h,onKeyUpCapture:v,onFocusCapture:C,onFocus:E,onBlurCapture:_,onKeyDown:O},i=eN({focusable:e.useState(e=>t&&(e.virtualFocus||null===e.activeId)),...i})});ea(function(e){return eu("div",eH(e))});var eW=ec();eW.useContext,eW.useScopedContext;var eK=eW.useProviderContext,ez=ec([eW.ContextProvider],[eW.ScopedContextProvider]);ez.useContext,ez.useScopedContext;var eQ=ez.useProviderContext,e$=ez.ContextProvider,eX=ez.ScopedContextProvider,eY=(0,R.createContext)(void 0),eZ=(0,R.createContext)(void 0),eJ=ec([e$],[eX]);eJ.useContext,eJ.useScopedContext;var e0=eJ.useProviderContext,e1=eJ.ContextProvider,e2=eJ.ScopedContextProvider,e3=es(function({store:e,...t}){let r=e0();return e=e||r,t={...t,ref:K(null==e?void 0:e.setAnchorElement,t.ref)}});ea(function(e){return eu("div",e3(e))});var e5=(0,R.createContext)(void 0),e4=ec([e1,ev],[e2,eg]),e8=e4.useContext,e6=e4.useScopedContext,e9=e4.useProviderContext,e7=e4.ContextProvider,te=e4.ScopedContextProvider,tt=(0,R.createContext)(void 0),tr=(0,R.createContext)(!1);function tn(e,t){let r=e.__unstableInternals;return A(r,"Invalid store"),r[t]}function ti(e,...t){let r=e,n=r,i=Symbol(),o=S,a=new Set,l=new Set,u=new Set,s=new Set,c=new Set,f=new WeakMap,d=new WeakMap,p=(e,t,r=s)=>(r.add(t),d.set(t,e),()=>{var e;null==(e=f.get(t))||e(),f.delete(t),d.delete(t),r.delete(t)}),m=(e,o,a=!1)=>{var u,p;if(!C(r,e))return;let m=(p=r[e],"function"==typeof o?o("function"==typeof p?p():p):o);if(m===r[e])return;if(!a)for(let r of t)null==(u=null==r?void 0:r.setState)||u.call(r,e,m);let h=r;r={...r,[e]:m};let v=Symbol();i=v,l.add(e);let g=(t,n,i)=>{var o;let a=d.get(t);(!a||a.some(t=>i?i.has(t):t===e))&&(null==(o=f.get(t))||o(),f.set(t,t(r,n)))};for(let e of s)g(e,h);queueMicrotask(()=>{if(i!==v)return;let e=r;for(let e of c)g(e,n,l);n=e,l.clear()})},h={getState:()=>r,setState:m,__unstableInternals:{setup:e=>(u.add(e),()=>u.delete(e)),init:()=>{let e=a.size,n=Symbol();a.add(n);let i=()=>{a.delete(n),a.size||o()};if(e)return i;let l=Object.keys(r).map(e=>x(...t.map(t=>{var r;let n=null==(r=null==t?void 0:t.getState)?void 0:r.call(t);if(n&&C(n,e))return tu(t,[e],t=>{m(e,t[e],!0)})}))),s=[];for(let e of u)s.push(e());return o=x(...l,...s,...t.map(ta)),i},subscribe:(e,t)=>p(e,t),sync:(e,t)=>(f.set(t,t(r,r)),p(e,t)),batch:(e,t)=>(f.set(t,t(r,n)),p(e,t,c)),pick:e=>ti(function(e,t){let r={};for(let n of t)C(e,n)&&(r[n]=e[n]);return r}(r,e),h),omit:e=>ti(function(e,t){let r={...e};for(let e of t)C(r,e)&&delete r[e];return r}(r,e),h)}};return h}function to(e,...t){if(e)return tn(e,"setup")(...t)}function ta(e,...t){if(e)return tn(e,"init")(...t)}function tl(e,...t){if(e)return tn(e,"subscribe")(...t)}function tu(e,...t){if(e)return tn(e,"sync")(...t)}function ts(e,...t){if(e)return tn(e,"batch")(...t)}function tc(e,...t){if(e)return tn(e,"omit")(...t)}function tf(...e){var t;let r={};for(let n of e){let e=null==(t=null==n?void 0:n.getState)?void 0:t.call(n);e&&Object.assign(r,e)}let n=ti(r,...e);return Object.assign({},...e,n)}function td(e,t){}function tp(e,t,r){if(!r)return!1;let n=e.find(e=>!e.disabled&&e.value);return(null==n?void 0:n.value)===t}function tm(e,t){return!!t&&null!=e&&(e=e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),t.length>e.length&&0===t.toLowerCase().indexOf(e.toLowerCase()))}var th=es(function({store:e,focusable:t=!0,autoSelect:r=!1,getAutoSelectId:n,setValueOnChange:i,showMinLength:o=0,showOnChange:a,showOnMouseDown:l,showOnClick:u=l,showOnKeyDown:s,showOnKeyPress:c=s,blurActiveItemOnClick:f,setValueOnClick:d=!0,moveOnKeyPress:g=!0,autoComplete:y="list",...b}){var C;let x,E=e9();A(e=e||E,!1);let _=(0,R.useRef)(null),[T,M]=$(),O=(0,R.useRef)(!1),I=(0,R.useRef)(!1),F=e.useState(e=>e.virtualFocus&&r),L="inline"===y||"both"===y,[P,D]=(0,R.useState)(L);C=[L],x=(0,R.useRef)(!1),H(()=>{if(x.current)return(()=>{L&&D(!0)})();x.current=!0},C),H(()=>()=>{x.current=!1},[]);let B=e.useState("value"),G=(0,R.useRef)(void 0);(0,R.useEffect)(()=>tu(e,["selectedValue","activeId"],(e,t)=>{G.current=t.selectedValue}),[]);let N=e.useState(e=>{var t;if(L&&P){if(e.activeValue&&Array.isArray(e.selectedValue)&&(e.selectedValue.includes(e.activeValue)||(null==(t=G.current)?void 0:t.includes(e.activeValue))))return;return e.activeValue}}),U=e.useState("renderedItems"),q=e.useState("open"),V=e.useState("contentElement"),Y=(0,R.useMemo)(()=>{if(!L||!P)return B;if(tp(U,N,F)){if(tm(B,N)){let e=(null==N?void 0:N.slice(B.length))||"";return B+e}return B}return N||B},[L,P,U,N,F,B]);(0,R.useEffect)(()=>{let e=_.current;if(!e)return;let t=()=>D(!0);return e.addEventListener("combobox-item-move",t),()=>{e.removeEventListener("combobox-item-move",t)}},[]),(0,R.useEffect)(()=>{if(!L||!P||!N||!tp(U,N,F)||!tm(B,N))return;let e=S;return queueMicrotask(()=>{let t=_.current;if(!t)return;let{start:r,end:n}=p(t),i=B.length,o=N.length;v(t,i,o),e=()=>{if(!eM(t))return;let{start:e,end:a}=p(t);e!==i||a===o&&v(t,r,n)}}),()=>e()},[T,L,P,N,U,F,B]);let Z=(0,R.useRef)(null),J=W(n),ee=(0,R.useRef)(null);(0,R.useEffect)(()=>{if(!q||!V)return;let t=h(V);if(!t)return;Z.current=t;let r=()=>{O.current=!1},n=()=>{if(!e||!O.current)return;let{activeId:t}=e.getState();null===t||t!==ee.current&&(O.current=!1)},i={passive:!0,capture:!0};return t.addEventListener("wheel",r,i),t.addEventListener("touchmove",r,i),t.addEventListener("scroll",n,i),()=>{t.removeEventListener("wheel",r,!0),t.removeEventListener("touchmove",r,!0),t.removeEventListener("scroll",n,!0)}},[q,V,e]),H(()=>{!B||I.current||(O.current=!0)},[B]),H(()=>{"always"!==F&&q||(O.current=q)},[F,q]);let et=e.useState("resetValueOnSelect");Q(()=>{var t,r;let n=O.current;if(!e||!q||!n&&!et)return;let{baseElement:i,contentElement:o,activeId:a}=e.getState();if(!i||eM(i)){if(null==o?void 0:o.hasAttribute("data-placing")){let e=new MutationObserver(M);return e.observe(o,{attributeFilter:["data-placing"]}),()=>e.disconnect()}if(F&&n){let r,n=J(U),i=void 0!==n?n:null!=(t=null==(r=U.find(e=>{var t;return!e.disabled&&(null==(t=e.element)?void 0:t.getAttribute("role"))!=="tab"}))?void 0:r.id)?t:e.first();ee.current=i,e.move(null!=i?i:null)}else{let t=null==(r=e.item(a||e.first()))?void 0:r.element;t&&"scrollIntoView"in t&&t.scrollIntoView({block:"nearest",inline:"nearest"})}}},[e,q,T,B,F,et,J,U]),(0,R.useEffect)(()=>{if(!L)return;let t=_.current;if(!t)return;let r=[t,V].filter(e=>!!e),n=t=>{r.every(e=>k(t,e))&&(null==e||e.setValue(Y))};for(let e of r)e.addEventListener("focusout",n);return()=>{for(let e of r)e.removeEventListener("focusout",n)}},[L,V,e,Y]);let er=e=>e.currentTarget.value.length>=o,en=b.onChange,ei=X(null!=a?a:er),eo=X(null!=i?i:!e.tag),ea=W(t=>{if(null==en||en(t),t.defaultPrevented||!e)return;let r=t.currentTarget,{value:n,selectionStart:i,selectionEnd:o}=r,a=t.nativeEvent;if(O.current=!0,"input"===a.type&&(a.isComposing&&(O.current=!1,I.current=!0),L)){let e="insertText"===a.inputType||"insertCompositionText"===a.inputType,t=i===n.length;D(e&&t)}if(eo(t)){let t=n===e.getState().value;e.setValue(n),queueMicrotask(()=>{v(r,i,o)}),L&&F&&t&&M()}ei(t)&&e.show(),F&&O.current||e.setActiveId(null)}),el=b.onCompositionEnd,eu=W(e=>{O.current=!0,I.current=!1,null==el||el(e),e.defaultPrevented||F&&M()}),es=b.onMouseDown,ec=X(null!=f?f:()=>!!(null==e?void 0:e.getState().includesBaseElement)),ef=X(d),ed=X(null!=u?u:er),ep=W(t=>{null==es||es(t),t.defaultPrevented||t.button||t.ctrlKey||e&&(ec(t)&&e.setActiveId(null),ef(t)&&e.setValue(Y),ed(t)&&j(t.currentTarget,"mouseup",e.show))}),em=b.onKeyDown,eh=X(null!=c?c:er),ev=W(t=>{if(null==em||em(t),t.repeat||(O.current=!1),t.defaultPrevented||t.ctrlKey||t.altKey||t.shiftKey||t.metaKey||!e)return;let{open:r}=e.getState();!r&&("ArrowUp"===t.key||"ArrowDown"===t.key)&&eh(t)&&(t.preventDefault(),e.show())}),eg=b.onBlur,ey=W(e=>{if(O.current=!1,null==eg||eg(e),e.defaultPrevented)return}),eb=z(b.id),eS=e.useState(e=>null===e.activeId);return b={id:eb,role:"combobox","aria-autocomplete":"inline"===y||"list"===y||"both"===y||"none"===y?y:void 0,"aria-haspopup":m(V,"listbox"),"aria-expanded":q,"aria-controls":null==V?void 0:V.id,"data-active-item":eS||void 0,value:Y,...b,ref:K(_,b.ref),onChange:ea,onCompositionEnd:eu,onMouseDown:ep,onKeyDown:ev,onBlur:ey},b=eH({store:e,focusable:t,...b,moveOnKeyPress:e=>!w(g,e)&&(L&&D(!0),!0)}),{autoComplete:"off",...b=e3({store:e,...b})}}),tv=ea(function(e){return eu("input",th(e))});function tg(e){let t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}e.s(["Combobox",()=>tv],11889);var ty=Symbol("composite-hover"),tb=es(function({store:e,focusOnHover:t=!0,blurOnHoverEnd:r=!!t,...n}){let i=em();A(e=e||i,!1);let o=((0,R.useEffect)(()=>{J||(N("mousemove",en,!0),N("mousedown",ei,!0),N("mouseup",ei,!0),N("keydown",ei,!0),N("scroll",ei,!0),J=!0)},[]),W(()=>ee)),l=n.onMouseMove,u=X(t),s=W(t=>{if((null==l||l(t),!t.defaultPrevented&&o())&&u(t)){if(!eR(t.currentTarget)){let t=null==e?void 0:e.getState().baseElement;t&&!eM(t)&&t.focus()}null==e||e.setActiveId(t.currentTarget.id)}}),c=n.onMouseLeave,f=X(r),d=W(t=>{var r;let n;null==c||c(t),!t.defaultPrevented&&o()&&((n=tg(t))&&a(t.currentTarget,n)||function(e){let t=tg(e);if(!t)return!1;do{if(C(t,ty)&&t[ty])return!0;t=t.parentElement}while(t)return!1}(t)||!u(t)||f(t)&&(null==e||e.setActiveId(null),null==(r=null==e?void 0:e.getState().baseElement)||r.focus()))}),p=(0,R.useCallback)(e=>{e&&(e[ty]=!0)},[]);return T(n={...n,ref:K(p,n.ref),onMouseMove:s,onMouseLeave:d})});el(ea(function(e){return eu("div",tb(e))}));var tS=es(function({store:e,shouldRegisterItem:t=!0,getItem:r=E,element:n,...i}){let o=ed();e=e||o;let a=z(i.id),l=(0,R.useRef)(n);return(0,R.useEffect)(()=>{let n=l.current;if(!a||!n||!t)return;let i=r({id:a,element:n});return null==e?void 0:e.renderItem(i)},[a,t,r,e]),T(i={...i,ref:K(l,i.ref)})});function tC(e){if(!e.isTrusted)return!1;let t=e.currentTarget;return"Enter"===e.key?u(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&(u(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}ea(function(e){return eu("div",tS(e))});var tx=Symbol("command"),tE=es(function({clickOnEnter:e=!0,clickOnSpace:t=!0,...n}){let i,o,a=(0,R.useRef)(null),[l,s]=(0,R.useState)(!1);(0,R.useEffect)(()=>{a.current&&s(u(a.current))},[]);let[c,d]=(0,R.useState)(!1),p=(0,R.useRef)(!1),m=_(n),[h,v]=(i=n.onLoadedMetadataCapture,o=(0,R.useMemo)(()=>Object.assign(()=>{},{...i,[tx]:!0}),[i,tx,!0]),[null==i?void 0:i[tx],{onLoadedMetadataCapture:o}]),g=n.onKeyDown,y=W(n=>{null==g||g(n);let i=n.currentTarget;if(n.defaultPrevented||h||m||!D(n)||f(i)||i.isContentEditable)return;let o=e&&"Enter"===n.key,a=t&&" "===n.key,l="Enter"===n.key&&!e,u=" "===n.key&&!t;if(l||u)return void n.preventDefault();if(o||a){let e=tC(n);if(o){if(!e){n.preventDefault();let{view:e,...t}=n,o=()=>G(i,t);r&&/firefox\//i.test(navigator.userAgent)?j(i,"keyup",o):queueMicrotask(o)}}else a&&(p.current=!0,e||(n.preventDefault(),d(!0)))}}),b=n.onKeyUp,S=W(e=>{if(null==b||b(e),e.defaultPrevented||h||m||e.metaKey)return;let r=t&&" "===e.key;if(p.current&&r&&(p.current=!1,!tC(e))){e.preventDefault(),d(!1);let t=e.currentTarget,{view:r,...n}=e;queueMicrotask(()=>G(t,n))}});return eN(n={"data-active":c||void 0,type:l?"button":void 0,...v,...n,ref:K(a,n.ref),onKeyDown:y,onKeyUp:S})});ea(function(e){return eu("button",tE(e))});var{useSyncExternalStore:tA}=e.i(2239).default,tw=()=>()=>{};function t_(e,t=E){let r=R.useCallback(t=>e?tl(e,null,t):tw(),[e]),n=()=>{let r="string"==typeof t?t:null,n="function"==typeof t?t:null,i=null==e?void 0:e.getState();return n?n(i):i&&r&&C(i,r)?i[r]:void 0};return tA(r,n,n)}function tT(e,t){let r=R.useRef({}),n=R.useCallback(t=>e?tl(e,null,t):tw(),[e]),i=()=>{let n=null==e?void 0:e.getState(),i=!1,o=r.current;for(let e in t){let r=t[e];if("function"==typeof r){let t=r(n);t!==o[e]&&(o[e]=t,i=!0)}if("string"==typeof r){if(!n||!C(n,r))continue;let t=n[r];t!==o[e]&&(o[e]=t,i=!0)}}return i&&(r.current={...o}),r.current};return tA(n,i,i)}function tM(e,t,r,n){var i;let o,a=C(t,r)?t[r]:void 0,l=(i={value:a,setValue:n?t[n]:void 0},o=(0,R.useRef)(i),H(()=>{o.current=i}),o);H(()=>tu(e,[r],(e,t)=>{let{value:n,setValue:i}=l.current;i&&e[r]!==t[r]&&e[r]!==n&&i(e[r])}),[e,r]),H(()=>{if(void 0!==a)return e.setState(r,a),ts(e,[r],()=>{void 0!==a&&e.setState(r,a)})})}function tR(e,t){let[r,n]=R.useState(()=>e(t));H(()=>ta(r),[r]);let i=R.useCallback(e=>t_(r,e),[r]);return[R.useMemo(()=>({...r,useState:i}),[r,i]),W(()=>{n(r=>e({...t,...r.getState()}))})]}function tO(e,t,r,n=!1){var i;let o,a;if(!t||!r)return;let{renderedItems:l}=t.getState(),u=h(e);if(!u)return;let s=function(e,t=!1){let r=e.clientHeight,{top:n}=e.getBoundingClientRect(),i=1.5*Math.max(.875*r,r-40),o=t?r-i+n:i+n;return"HTML"===e.tagName?o+e.scrollTop:o}(u,n);for(let e=0;e =0){void 0!==a&&a t||(e&&(null==g?void 0:g.baseElement)&&g.baseElement===e.baseElement?g.id:void 0),baseElement:e=>(null==e?void 0:e.baseElement)||void 0,isActiveItem:e=>!!e&&e.activeId===h,ariaSetSize:e=>null!=l?l:e&&(null==g?void 0:g.ariaSetSize)&&g.baseElement===e.baseElement?g.ariaSetSize:void 0,ariaPosInSet(e){if(null!=s)return s;if(!e||!(null==g?void 0:g.ariaPosInSet)||g.baseElement!==e.baseElement)return;let t=e.renderedItems.filter(e=>e.rowId===C);return g.ariaPosInSet+t.findIndex(e=>e.id===h)},isTabbable(t){if(!(null==t?void 0:t.renderedItems.length))return!0;if(t.virtualFocus)return!1;if(o)return!0;if(null===t.activeId)return!1;let r=null==e?void 0:e.item(t.activeId);return null!=r&&!!r.disabled||null==r||!r.element||t.activeId===h}}),O=(0,R.useCallback)(e=>{var t;let r={...e,id:h||e.id,rowId:C,disabled:!!S,children:null==(t=e.element)?void 0:t.textContent};return a?a(r):r},[h,C,S,a]),I=c.onFocus,F=(0,R.useRef)(!1),B=W(t=>{var r,i;if(null==I||I(t),t.defaultPrevented||P(t)||!h||!e||(r=e,!D(t)&&b(r,t.target)))return;let{virtualFocus:o,baseElement:a}=e.getState();e.setActiveId(h),d(t.currentTarget)&&function(e,t=!1){if(f(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){let r=n(e).getSelection();null==r||r.selectAllChildren(e),t&&(null==r||r.collapseToEnd())}}(t.currentTarget),!o||!D(t)||!d(i=t.currentTarget)&&("INPUT"!==i.tagName||u(i))&&(null==a?void 0:a.isConnected)&&((L()&&t.currentTarget.hasAttribute("data-autofocus")&&t.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),F.current=!0,t.relatedTarget===a||b(e,t.relatedTarget))?(a[y]=!0,a.focus({preventScroll:!0})):a.focus())}),G=c.onBlurCapture,k=W(t=>{if(null==G||G(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState();(null==r?void 0:r.virtualFocus)&&F.current&&(F.current=!1,t.preventDefault(),t.stopPropagation())}),j=c.onKeyDown,N=X(r),U=X(i),q=W(t=>{if(null==j||j(t),t.defaultPrevented||!D(t)||!e)return;let{currentTarget:r}=t,i=e.getState(),o=e.item(h),a=!!(null==o?void 0:o.rowId),l="horizontal"!==i.orientation,u="vertical"!==i.orientation,s=()=>!(!a&&!u&&i.baseElement&&f(i.baseElement)),c={ArrowUp:(a||l)&&e.up,ArrowRight:(a||u)&&e.next,ArrowDown:(a||l)&&e.down,ArrowLeft:(a||u)&&e.previous,Home:()=>{if(s())return!a||t.ctrlKey?null==e?void 0:e.first():null==e?void 0:e.previous(-1)},End:()=>{if(s())return!a||t.ctrlKey?null==e?void 0:e.last():null==e?void 0:e.next(-1)},PageUp:()=>tO(r,e,null==e?void 0:e.up,!0),PageDown:()=>tO(r,e,null==e?void 0:e.down)}[t.key];if(c){if(d(r)){let e=p(r),i=u&&"ArrowLeft"===t.key,o=u&&"ArrowRight"===t.key,a=l&&"ArrowUp"===t.key,s=l&&"ArrowDown"===t.key;if(o||s){let{length:t}=function(e){if(f(e))return e.value;if(e.isContentEditable){let t=n(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(r);if(e.end!==t)return}else if((i||a)&&0!==e.start)return}let i=c();if(N(t)||void 0!==i){if(!U(t))return;t.preventDefault(),e.move(i)}}}),V=(0,R.useMemo)(()=>({id:h,baseElement:x}),[h,x]);return c={id:h,"data-active-item":E||void 0,...c=Y(c,e=>(0,eo.jsx)(ey.Provider,{value:V,children:e}),[V]),ref:K(v,c.ref),tabIndex:M?c.tabIndex:-1,onFocus:B,onBlurCapture:k,onKeyDown:q},c=tE(c),T({...c=tS({store:e,...c,getItem:O,shouldRegisterItem:!!h&&c.shouldRegisterItem}),"aria-setsize":A,"aria-posinset":w})});el(ea(function(e){return eu("button",tI(e))}));var tF=es(function({store:e,value:t,hideOnClick:r,setValueOnClick:n,selectValueOnClick:i=!0,resetValueOnSelect:o,focusOnHover:a=!1,moveOnKeyPress:l=!0,getItem:u,...s}){var c,d;let p=e6();A(e=e||p,!1);let{resetValueOnSelectState:m,multiSelectable:h,selected:v}=tT(e,{resetValueOnSelectState:"resetValueOnSelect",multiSelectable:e=>Array.isArray(e.selectedValue),selected:e=>(function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)})(e.selectedValue,t)}),g=(0,R.useCallback)(e=>{let r={...e,value:t};return u?u(r):r},[t,u]);n=null!=n?n:!h,r=null!=r?r:null!=t&&!h;let y=s.onClick,b=X(n),S=X(i),C=X(null!=(c=null!=o?o:m)?c:h),x=X(r),E=W(r=>{null==y||y(r),r.defaultPrevented||function(e){let t=e.currentTarget;if(!t)return!1;let r=t.tagName.toLowerCase();return!!e.altKey&&("a"===r||"button"===r&&"submit"===t.type||"input"===r&&"submit"===t.type)}(r)||!function(e){let t=e.currentTarget;if(!t)return!1;let r=F();if(r&&!e.metaKey||!r&&!e.ctrlKey)return!1;let n=t.tagName.toLowerCase();return"a"===n||"button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type}(r)&&(null!=t&&(S(r)&&(C(r)&&(null==e||e.resetValue()),null==e||e.setSelectedValue(e=>Array.isArray(e)?e.includes(t)?e.filter(e=>e!==t):[...e,t]:t)),b(r)&&(null==e||e.setValue(t))),x(r)&&(null==e||e.hide()))}),w=s.onKeyDown,_=W(t=>{if(null==w||w(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState().baseElement;!r||eM(r)||(1===t.key.length||"Backspace"===t.key||"Delete"===t.key)&&(queueMicrotask(()=>r.focus()),f(r)&&(null==e||e.setValue(r.value)))});h&&null!=v&&(s={"aria-selected":v,...s}),s=Y(s,e=>(0,eo.jsx)(tt.Provider,{value:t,children:(0,eo.jsx)(tr.Provider,{value:null!=v&&v,children:e})}),[t,v]),s={role:null!=(d=({menu:"menuitem",listbox:"option",tree:"treeitem"})[(0,R.useContext)(e5)])?d:"option",children:t,...s,onClick:E,onKeyDown:_};let T=X(l);return s=tI({store:e,...s,getItem:g,moveOnKeyPress:t=>{if(!T(t))return!1;let r=new Event("combobox-item-move"),n=null==e?void 0:e.getState().baseElement;return null==n||n.dispatchEvent(r),!0}}),s=tb({store:e,focusOnHover:a,...s})}),tL=el(ea(function(e){return eu("div",tF(e))}));e.s(["ComboboxItem",()=>tL],56373);var tP=e.i(74080);function tD(e,t){let r=setTimeout(t,e);return()=>clearTimeout(r)}function tB(...e){return e.join(", ").split(", ").reduce((e,t)=>{let r=t.endsWith("ms")?1:1e3,n=Number.parseFloat(t||"0s")*r;return n>e?n:e},0)}function tG(e,t,r){return!r&&!1!==t&&(!e||!!t)}var tk=es(function({store:e,alwaysVisible:t,...r}){let n=eK();A(e=e||n,!1);let i=(0,R.useRef)(null),o=z(r.id),[a,l]=(0,R.useState)(null),u=e.useState("open"),s=e.useState("mounted"),c=e.useState("animated"),f=e.useState("contentElement"),d=t_(e.disclosure,"contentElement");H(()=>{i.current&&(null==e||e.setContentElement(i.current))},[e]),H(()=>{let t;return null==e||e.setState("animated",e=>(t=e,!0)),()=>{void 0!==t&&(null==e||e.setState("animated",t))}},[e]),H(()=>{if(c){var e;let t;return(null==f?void 0:f.isConnected)?(e=()=>{l(u?"enter":s?"leave":null)},t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)}),()=>cancelAnimationFrame(t)):void l(null)}},[c,f,u,s]),H(()=>{if(!e||!c||!a||!f)return;let t=()=>null==e?void 0:e.setState("animating",!1),r=()=>(0,tP.flushSync)(t);if("leave"===a&&u||"enter"===a&&!u)return;if("number"==typeof c)return tD(c,r);let{transitionDuration:n,animationDuration:i,transitionDelay:o,animationDelay:l}=getComputedStyle(f),{transitionDuration:s="0",animationDuration:p="0",transitionDelay:m="0",animationDelay:h="0"}=d?getComputedStyle(d):{},v=tB(o,l,m,h)+tB(n,i,s,p);if(!v){"enter"===a&&e.setState("animated",!1),t();return}return tD(Math.max(v-1e3/60,0),r)},[e,c,f,d,u,a]);let p=tG(s,(r=Y(r,t=>(0,eo.jsx)(eX,{value:e,children:t}),[e])).hidden,t),m=r.style,h=(0,R.useMemo)(()=>p?{...m,display:"none"}:m,[p,m]);return T(r={id:o,"data-open":u||void 0,"data-enter":"enter"===a||void 0,"data-leave":"leave"===a||void 0,hidden:p,...r,ref:K(o?e.setContentElement:null,i,r.ref),style:h})}),tj=ea(function(e){return eu("div",tk(e))});ea(function({unmountOnHide:e,...t}){let r=eK();return!1===t_(t.store||r,t=>!e||(null==t?void 0:t.mounted))?null:(0,eo.jsx)(tj,{...t})});var tN=es(function({store:e,alwaysVisible:t,...r}){let n=e6(!0),i=e8(),o=!!(e=e||i)&&e===n;A(e,!1);let a=(0,R.useRef)(null),l=z(r.id),u=e.useState("mounted"),s=tG(u,r.hidden,t),c=s?{...r.style,display:"none"}:r.style,f=e.useState(e=>Array.isArray(e.selectedValue)),d=function(e,t,r){let n=function(e){let[t]=(0,R.useState)(e);return t}(r),[i,o]=(0,R.useState)(n);return(0,R.useEffect)(()=>{let r=e&&"current"in e?e.current:e;if(!r)return;let i=()=>{let e=r.getAttribute(t);o(null==e?n:e)},a=new MutationObserver(i);return a.observe(r,{attributeFilter:[t]}),i(),()=>a.disconnect()},[e,t,n]),i}(a,"role",r.role),p="listbox"===d||"tree"===d||"grid"===d,[m,h]=(0,R.useState)(!1),v=e.useState("contentElement");H(()=>{if(!u)return;let e=a.current;if(!e||v!==e)return;let t=()=>{h(!!e.querySelector("[role='listbox']"))},r=new MutationObserver(t);return r.observe(e,{subtree:!0,childList:!0,attributeFilter:["role"]}),t(),()=>r.disconnect()},[u,v]),m||(r={role:"listbox","aria-multiselectable":p&&f||void 0,...r}),r=Y(r,t=>(0,eo.jsx)(te,{value:e,children:(0,eo.jsx)(e5.Provider,{value:d,children:t})}),[e,d]);let g=!l||n&&o?null:e.setContentElement;return T(r={id:l,hidden:s,...r,ref:K(g,a,r.ref),style:c})}),tU=ea(function(e){return eu("div",tN(e))});e.s(["ComboboxList",()=>tU,"useComboboxList",()=>tN],86447);var tq=(0,R.createContext)(null),tV=es(function(e){return{...e,style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px",...e.style}}});ea(function(e){return eu("span",tV(e))});var tH=es(function(e){return tV(e={"data-focus-trap":"",tabIndex:0,"aria-hidden":!0,...e,style:{position:"fixed",top:0,left:0,...e.style}})}),tW=ea(function(e){return eu("span",tH(e))});function tK(e){queueMicrotask(()=>{null==e||e.focus()})}var tz=es(function({preserveTabOrder:e,preserveTabOrderAnchor:t,portalElement:r,portalRef:i,portal:o=!0,...a}){let l=(0,R.useRef)(null),u=K(l,a.ref),s=(0,R.useContext)(tq),[c,f]=(0,R.useState)(null),[d,p]=(0,R.useState)(null),m=(0,R.useRef)(null),h=(0,R.useRef)(null),v=(0,R.useRef)(null),g=(0,R.useRef)(null);return H(()=>{let e=l.current;if(!e||!o)return void f(null);let t=r?"function"==typeof r?r(e):r:n(e).createElement("div");if(!t)return void f(null);let a=t.isConnected;if(a||(s||n(e).body).appendChild(t),t.id||(t.id=e.id?`portal/${e.id}`:function(e="id"){return`${e?`${e}-`:""}${Math.random().toString(36).slice(2,8)}`}()),f(t),O(i,t),!a)return()=>{t.remove(),O(i,null)}},[o,r,s,i]),H(()=>{if(!o||!e||!t)return;let r=n(t).createElement("span");return r.style.position="fixed",t.insertAdjacentElement("afterend",r),p(r),()=>{r.remove(),p(null)}},[o,e,t]),(0,R.useEffect)(()=>{if(!c||!e)return;let t=0,r=e=>{if(!k(e))return;let r="focusin"===e.type;if(cancelAnimationFrame(t),r){let e=c.querySelectorAll("[data-tabindex]"),t=e=>{let t=e.getAttribute("data-tabindex");e.removeAttribute("data-tabindex"),t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")};for(let r of(c.hasAttribute("data-tabindex")&&t(c),e))t(r);return}t=requestAnimationFrame(()=>{for(let e of ew(c,!0))!function(e){var t;let r=null!=(t=e.getAttribute("tabindex"))?t:"";e.setAttribute("data-tabindex",r),e.setAttribute("tabindex","-1")}(e)})};return c.addEventListener("focusin",r,!0),c.addEventListener("focusout",r,!0),()=>{cancelAnimationFrame(t),c.removeEventListener("focusin",r,!0),c.removeEventListener("focusout",r,!0)}},[c,e]),a={...a=Y(a,t=>{if(t=(0,eo.jsx)(tq.Provider,{value:c||s,children:t}),!o)return t;if(!c)return(0,eo.jsx)("span",{ref:u,id:a.id,style:{position:"fixed"},hidden:!0});t=(0,eo.jsxs)(eo.Fragment,{children:[e&&c&&(0,eo.jsx)(tW,{ref:h,"data-focus-trap":a.id,className:"__focus-trap-inner-before",onFocus:e=>{k(e,c)?tK(e_()):tK(m.current)}}),t,e&&c&&(0,eo.jsx)(tW,{ref:v,"data-focus-trap":a.id,className:"__focus-trap-inner-after",onFocus:e=>{k(e,c)?tK(eT()):tK(g.current)}})]}),c&&(t=(0,tP.createPortal)(t,c));let r=(0,eo.jsxs)(eo.Fragment,{children:[e&&c&&(0,eo.jsx)(tW,{ref:m,"data-focus-trap":a.id,className:"__focus-trap-outer-before",onFocus:e=>{e.relatedTarget!==g.current&&k(e,c)?tK(h.current):tK(eT())}}),e&&(0,eo.jsx)("span",{"aria-owns":null==c?void 0:c.id,style:{position:"fixed"}}),e&&c&&(0,eo.jsx)(tW,{ref:g,"data-focus-trap":a.id,className:"__focus-trap-outer-after",onFocus:e=>{if(k(e,c))tK(v.current);else{let e=e_();if(e===h.current)return void requestAnimationFrame(()=>{var e;return null==(e=e_())?void 0:e.focus()});tK(e)}}})]});return d&&e&&(r=(0,tP.createPortal)(r,d)),(0,eo.jsxs)(eo.Fragment,{children:[r,t]})},[c,s,o,a.id,e,d]),ref:u}});ea(function(e){return eu("div",tz(e))});var tQ=(0,R.createContext)(0);function t$({level:e,children:t}){let r=(0,R.useContext)(tQ),n=Math.max(Math.min(e||r+1,6),1);return(0,eo.jsx)(tQ.Provider,{value:n,children:t})}var tX=es(function({autoFocusOnShow:e=!0,...t}){return Y(t,t=>(0,eo.jsx)(eS.Provider,{value:e,children:t}),[e])});ea(function(e){return eu("div",tX(e))});var tY=new WeakMap;function tZ(e,t,r){tY.has(e)||tY.set(e,new Map);let n=tY.get(e),i=n.get(t);if(!i)return n.set(t,r()),()=>{var e;null==(e=n.get(t))||e(),n.delete(t)};let o=r(),a=()=>{o(),i(),n.delete(t)};return n.set(t,a),()=>{n.get(t)===a&&(o(),n.set(t,i))}}function tJ(e,t,r){return tZ(e,t,()=>{let n=e.getAttribute(t);return e.setAttribute(t,r),()=>{null==n?e.removeAttribute(t):e.setAttribute(t,n)}})}function t0(e,t,r){return tZ(e,t,()=>{let n=t in e,i=e[t];return e[t]=r,()=>{n?e[t]=i:delete e[t]}})}function t1(e,t){return e?tZ(e,"style",()=>{let r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}):()=>{}}var t2=["SCRIPT","STYLE"];function t3(e){return`__ariakit-dialog-snapshot-${e}`}function t5(e,t,r,i){for(let o of t){if(!(null==o?void 0:o.isConnected))continue;let l=t.some(e=>!!e&&e!==o&&e.contains(o)),u=n(o),s=o;for(;o.parentElement&&o!==u.body;){if(null==i||i(o.parentElement,s),!l)for(let i of o.parentElement.children)(function(e,t,r){return!t2.includes(t.tagName)&&!!function(e,t){let r=n(t),i=t3(e);if(!r.body[i])return!0;for(;;){if(t===r.body)return!1;if(t[i])return!0;if(!t.parentElement)return!1;t=t.parentElement}}(e,t)&&!r.some(e=>e&&a(t,e))})(e,i,t)&&r(i,s);o=o.parentElement}}}function t4(e,...t){if(!e)return!1;let r=e.getAttribute("data-backdrop");return null!=r&&(""===r||"true"===r||!t.length||t.some(e=>r===e))}function t8(e="",t=!1){return`__ariakit-dialog-${t?"ancestor":"outside"}${e?`-${e}`:""}`}function t6(e,t=""){return x(t0(e,t8("",!0),!0),t0(e,t8(t,!0),!0))}function t9(e,t){if(e[t8(t,!0)])return!0;let r=t8(t);for(;;){if(e[r])return!0;if(!e.parentElement)return!1;e=e.parentElement}}function t7(e,t){let r=[],n=t.map(e=>null==e?void 0:e.id);return t5(e,t,t=>{t4(t,...n)||r.unshift(function(e,t=""){return x(t0(e,t8(),!0),t0(e,t8(t),!0))}(t,e))},(t,n)=>{n.hasAttribute("data-dialog")&&n.id!==e||r.unshift(t6(t,e))}),()=>{for(let e of r)e()}}function re({store:e,type:t,listener:r,capture:i,domReady:o}){let l=W(r),u=t_(e,"open"),s=(0,R.useRef)(!1);H(()=>{if(!u||!o)return;let{contentElement:t}=e.getState();if(!t)return;let r=()=>{s.current=!0};return t.addEventListener("focusin",r,!0),()=>t.removeEventListener("focusin",r,!0)},[e,u,o]),(0,R.useEffect)(()=>{if(u)return N(t,t=>{let{contentElement:r,disclosureElement:i}=e.getState(),o=t.target;!r||!o||!(!("HTML"===o.tagName||a(n(o).body,o))||a(r,o)||function(e,t){if(!e)return!1;if(a(e,t))return!0;let r=t.getAttribute("aria-activedescendant");if(r){let t=n(e).getElementById(r);if(t)return a(e,t)}return!1}(i,o)||o.hasAttribute("data-focus-trap")||function(e,t){if(!("clientY"in e))return!1;let r=t.getBoundingClientRect();return 0!==r.width&&0!==r.height&&r.top<=e.clientY&&e.clientY<=r.top+r.height&&r.left<=e.clientX&&e.clientX<=r.left+r.width}(t,r))&&(!s.current||t9(o,r.id))&&(o&&o[eL]||l(t))},i)},[u,i])}function rt(e,t){return"function"==typeof e?e(t):!!e}var rr=(0,R.createContext)({});function rn(){return"inert"in HTMLElement.prototype}function ri(e,t){if(!("style"in e))return S;if(rn())return t0(e,"inert",!0);let r=ew(e,!0).map(e=>{if(null==t?void 0:t.some(t=>t&&a(t,e)))return S;let r=tZ(e,"focus",()=>(e.focus=S,()=>{delete e.focus}));return x(tJ(e,"tabindex","-1"),r)});return x(...r,tJ(e,"aria-hidden","true"),t1(e,{pointerEvents:"none",userSelect:"none",cursor:"default"}))}function ro(e={}){let t=tf(e.store,tc(e.disclosure,["contentElement","disclosureElement"]));td(e,t);let r=null==t?void 0:t.getState(),n=M(e.open,null==r?void 0:r.open,e.defaultOpen,!1),i=M(e.animated,null==r?void 0:r.animated,!1),o=ti({open:n,animated:i,animating:!!i&&n,mounted:n,contentElement:M(null==r?void 0:r.contentElement,null),disclosureElement:M(null==r?void 0:r.disclosureElement,null)},t);return to(o,()=>tu(o,["animated","animating"],e=>{e.animated||o.setState("animating",!1)})),to(o,()=>tl(o,["open"],()=>{o.getState().animated&&o.setState("animating",!0)})),to(o,()=>tu(o,["open","animating"],e=>{o.setState("mounted",e.open||e.animating)})),{...o,disclosure:e.disclosure,setOpen:e=>o.setState("open",e),show:()=>o.setState("open",!0),hide:()=>o.setState("open",!1),toggle:()=>o.setState("open",e=>!e),stopAnimation:()=>o.setState("animating",!1),setContentElement:e=>o.setState("contentElement",e),setDisclosureElement:e=>o.setState("disclosureElement",e)}}function ra(e,t,r){return Q(t,[r.store,r.disclosure]),tM(e,r,"open","setOpen"),tM(e,r,"mounted","setMounted"),tM(e,r,"animated"),Object.assign(e,{disclosure:r.disclosure})}es(function(e){return e});var rl=ea(function(e){return eu("div",e)});function ru({store:e,backdrop:t,alwaysVisible:r,hidden:n}){let i=(0,R.useRef)(null),o=function(e={}){let[t,r]=tR(ro,e);return ra(t,r,e)}({disclosure:e}),a=t_(e,"contentElement");(0,R.useEffect)(()=>{let e=i.current;!e||a&&(e.style.zIndex=getComputedStyle(a).zIndex)},[a]),H(()=>{let e=null==a?void 0:a.id;if(!e)return;let t=i.current;if(t)return t6(t,e)},[a]);let l=tk({ref:i,store:o,role:"presentation","data-backdrop":(null==a?void 0:a.id)||"",alwaysVisible:r,hidden:null!=n?n:void 0,style:{position:"fixed",top:0,right:0,bottom:0,left:0}});if(!t)return null;if((0,R.isValidElement)(t))return(0,eo.jsx)(rl,{...l,render:t});let u="boolean"!=typeof t?t:"div";return(0,eo.jsx)(rl,{...l,render:(0,eo.jsx)(u,{})})}function rs(e={}){return ro(e)}Object.assign(rl,["a","button","details","dialog","div","form","h1","h2","h3","h4","h5","h6","header","img","input","label","li","nav","ol","p","section","select","span","summary","textarea","ul","svg"].reduce((e,t)=>(e[t]=ea(function(e){return eu(t,e)}),e),{}));var rc=L();function rf(e,t=!1){if(!e)return null;let r="current"in e?e.current:e;return r?t?ex(r)?r:null:r:null}var rd=es(function({store:e,open:t,onClose:l,focusable:s=!0,modal:f=!0,portal:d=!!f,backdrop:p=!!f,hideOnEscape:m=!0,hideOnInteractOutside:h=!0,getPersistentElements:v,preventBodyScroll:g=!!f,autoFocusOnShow:y=!0,autoFocusOnHide:b=!0,initialFocus:S,finalFocus:C,unmountOnHide:E,unstable_treeSnapshotKey:A,...w}){var _;let T,M,O,L=eQ(),P=(0,R.useRef)(null),D=function(e={}){let[t,r]=tR(rs,e);return ra(t,r,e)}({store:e||L,open:t,setOpen(e){if(e)return;let t=P.current;if(!t)return;let r=new Event("close",{bubbles:!1,cancelable:!0});l&&t.addEventListener("close",l,{once:!0}),t.dispatchEvent(r),r.defaultPrevented&&D.setOpen(!0)}}),{portalRef:B,domReady:G}=Z(d,w.portalRef),k=w.preserveTabOrder,U=t_(D,e=>k&&!f&&e.mounted),q=z(w.id),V=t_(D,"open"),Q=t_(D,"mounted"),J=t_(D,"contentElement"),ee=tG(Q,w.hidden,w.alwaysVisible);T=function({attribute:e,contentId:t,contentElement:r,enabled:i}){let[o,a]=$(),l=(0,R.useCallback)(()=>{if(!i||!r)return!1;let{body:o}=n(r),a=o.getAttribute(e);return!a||a===t},[o,i,r,e,t]);return(0,R.useEffect)(()=>{if(!i||!t||!r)return;let{body:o}=n(r);if(l())return o.setAttribute(e,t),()=>o.removeAttribute(e);let u=new MutationObserver(()=>(0,tP.flushSync)(a));return u.observe(o,{attributeFilter:[e]}),()=>u.disconnect()},[o,i,t,r,l,e]),l}({attribute:"data-dialog-prevent-body-scroll",contentElement:J,contentId:q,enabled:g&&!ee}),(0,R.useEffect)(()=>{var e,t;if(!T()||!J)return;let o=n(J),a=i(J),{documentElement:l,body:u}=o,s=l.style.getPropertyValue("--scrollbar-width"),c=s?Number.parseInt(s,10):a.innerWidth-l.clientWidth,f=Math.round(l.getBoundingClientRect().left)+l.scrollLeft?"paddingLeft":"paddingRight",d=F()&&!(r&&navigator.platform.startsWith("Mac")&&!I());return x((e="--scrollbar-width",t=`${c}px`,l?tZ(l,e,()=>{let r=l.style.getPropertyValue(e);return l.style.setProperty(e,t),()=>{r?l.style.setProperty(e,r):l.style.removeProperty(e)}}):()=>{}),d?(()=>{var e,t;let{scrollX:r,scrollY:n,visualViewport:i}=a,o=null!=(e=null==i?void 0:i.offsetLeft)?e:0,l=null!=(t=null==i?void 0:i.offsetTop)?t:0,s=t1(u,{position:"fixed",overflow:"hidden",top:`${-(n-Math.floor(l))}px`,left:`${-(r-Math.floor(o))}px`,right:"0",[f]:`${c}px`});return()=>{s(),a.scrollTo({left:r,top:n,behavior:"instant"})}})():t1(u,{overflow:"hidden",[f]:`${c}px`}))},[T,J]),_=t_(D,"open"),M=(0,R.useRef)(null),(0,R.useEffect)(()=>{if(!_){M.current=null;return}return N("mousedown",e=>{M.current=e.target},!0)},[_]),re({...O={store:D,domReady:G,capture:!0},type:"click",listener:e=>{let{contentElement:t}=D.getState(),r=M.current;r&&c(r)&&t9(r,null==t?void 0:t.id)&&rt(h,e)&&D.hide()}}),re({...O,type:"focusin",listener:e=>{let{contentElement:t}=D.getState();!t||e.target===n(t)||rt(h,e)&&D.hide()}}),re({...O,type:"contextmenu",listener:e=>{rt(h,e)&&D.hide()}});let{wrapElement:et,nestedDialogs:er}=function(e){let t=(0,R.useContext)(rr),[r,n]=(0,R.useState)([]),i=(0,R.useCallback)(e=>{var r;return n(t=>[...t,e]),x(null==(r=t.add)?void 0:r.call(t,e),()=>{n(t=>t.filter(t=>t!==e))})},[t]);H(()=>tu(e,["open","contentElement"],r=>{var n;if(r.open&&r.contentElement)return null==(n=t.add)?void 0:n.call(t,e)}),[e,t]);let o=(0,R.useMemo)(()=>({store:e,add:i}),[e,i]);return{wrapElement:(0,R.useCallback)(e=>(0,eo.jsx)(rr.Provider,{value:o,children:e}),[o]),nestedDialogs:r}}(D);w=Y(w,et,[et]),H(()=>{if(!V)return;let e=P.current,t=o(e,!0);!t||"BODY"===t.tagName||e&&a(e,t)||D.setDisclosureElement(t)},[D,V]),rc&&(0,R.useEffect)(()=>{if(!Q)return;let{disclosureElement:e}=D.getState();if(!e||!u(e))return;let t=()=>{let t=!1,r=()=>{t=!0};e.addEventListener("focusin",r,{capture:!0,once:!0}),j(e,"mouseup",()=>{e.removeEventListener("focusin",r,!0),t||eO(e)})};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}},[D,Q]),(0,R.useEffect)(()=>{if(!Q||!G)return;let e=P.current;if(!e)return;let t=i(e),r=t.visualViewport||t,n=()=>{var r,n;let i=null!=(n=null==(r=t.visualViewport)?void 0:r.height)?n:t.innerHeight;e.style.setProperty("--dialog-viewport-height",`${i}px`)};return n(),r.addEventListener("resize",n),()=>{r.removeEventListener("resize",n)}},[Q,G]),(0,R.useEffect)(()=>{if(!f||!Q||!G)return;let e=P.current;if(e&&!e.querySelector("[data-dialog-dismiss]")){var t;let r;return t=D.hide,(r=n(e).createElement("button")).type="button",r.tabIndex=-1,r.textContent="Dismiss popup",Object.assign(r.style,{border:"0px",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"}),r.addEventListener("click",t),e.prepend(r),()=>{r.removeEventListener("click",t),r.remove()}}},[D,f,Q,G]),H(()=>{if(!rn()||V||!Q||!G)return;let e=P.current;if(e)return ri(e)},[V,Q,G]);let en=V&&G;H(()=>{if(q&&en)return function(e,t){let{body:r}=n(t[0]),i=[];return t5(e,t,t=>{i.push(t0(t,t3(e),!0))}),x(t0(r,t3(e),!0),()=>{for(let e of i)e()})}(q,[P.current])},[q,en,A]);let ei=W(v);H(()=>{if(!q||!en)return;let{disclosureElement:e}=D.getState(),t=[P.current,...ei()||[],...er.map(e=>e.getState().contentElement)];if(f){let e,r;return x(t7(q,t),(e=[],r=t.map(e=>null==e?void 0:e.id),t5(q,t,n=>{t4(n,...r)||!function(e,...t){if(!e)return!1;let r=e.getAttribute("data-focus-trap");return null!=r&&(!t.length||""!==r&&t.some(e=>r===e))}(n,...r)&&e.unshift(ri(n,t))},r=>{!r.hasAttribute("role")||t.some(e=>e&&a(e,r))||e.unshift(tJ(r,"role","none"))}),()=>{for(let t of e)t()}))}return t7(q,[e,...t])},[q,D,en,ei,er,f,A]);let ea=!!y,el=X(y),[eu,es]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(!V||!ea||!G||!(null==J?void 0:J.isConnected))return;let e=rf(S,!0)||J.querySelector("[data-autofocus=true],[autofocus]")||function(e,t,r){let[n]=ew(e,t,r);return n||null}(J,!0,d&&U)||J,t=ex(e);el(t?e:null)&&(es(!0),queueMicrotask(()=>{e.focus(),!rc||t&&e.scrollIntoView({block:"nearest",inline:"nearest"})}))},[V,ea,G,J,S,d,U,el]);let ec=!!b,ef=X(b),[ed,ep]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(V)return ep(!0),()=>ep(!1)},[V]);let em=(0,R.useCallback)((e,t=!0)=>{let r,{disclosureElement:i}=D.getState();if(!(!(r=o())||e&&a(e,r))&&ex(r))return;let l=rf(C)||i;if(null==l?void 0:l.id){let e=n(l),t=`[aria-activedescendant="${l.id}"]`,r=e.querySelector(t);r&&(l=r)}if(l&&!ex(l)){let e=l.closest("[data-dialog]");if(null==e?void 0:e.id){let t=n(e),r=`[aria-controls~="${e.id}"]`,i=t.querySelector(r);i&&(l=i)}}let u=l&&ex(l);!u&&t?requestAnimationFrame(()=>em(e,!1)):!ef(u?l:null)||u&&(null==l||l.focus({preventScroll:!0}))},[D,C,ef]),eh=(0,R.useRef)(!1);H(()=>{if(V||!ed||!ec)return;let e=P.current;eh.current=!0,em(e)},[V,ed,G,ec,em]),(0,R.useEffect)(()=>{if(!ed||!ec)return;let e=P.current;return()=>{if(eh.current){eh.current=!1;return}em(e)}},[ed,ec,em]);let ev=X(m);(0,R.useEffect)(()=>{if(G&&Q)return N("keydown",e=>{if("Escape"!==e.key||e.defaultPrevented)return;let t=P.current;if(!t||t9(t))return;let r=e.target;if(!r)return;let{disclosureElement:n}=D.getState();!("BODY"===r.tagName||a(t,r)||!n||a(n,r))||ev(e)&&D.hide()},!0)},[D,G,Q,ev]);let eg=(w=Y(w,e=>(0,eo.jsx)(t$,{level:f?1:void 0,children:e}),[f])).hidden,ey=w.alwaysVisible;w=Y(w,e=>p?(0,eo.jsxs)(eo.Fragment,{children:[(0,eo.jsx)(ru,{store:D,backdrop:p,hidden:eg,alwaysVisible:ey}),e]}):e,[D,p,eg,ey]);let[eb,eS]=(0,R.useState)(),[eC,eE]=(0,R.useState)();return w=tX({...w={id:q,"data-dialog":"",role:"dialog",tabIndex:s?-1:void 0,"aria-labelledby":eb,"aria-describedby":eC,...w=Y(w,e=>(0,eo.jsx)(eX,{value:D,children:(0,eo.jsx)(eY.Provider,{value:eS,children:(0,eo.jsx)(eZ.Provider,{value:eE,children:e})})}),[D]),ref:K(P,w.ref)},autoFocusOnShow:eu}),w=tz({portal:d,...w=eN({...w=tk({store:D,...w}),focusable:s}),portalRef:B,preserveTabOrder:U})});function rp(e,t=eQ){return ea(function(r){let n=t();return t_(r.store||n,e=>!r.unmountOnHide||(null==e?void 0:e.mounted)||!!r.open)?(0,eo.jsx)(e,{...r}):null})}rp(ea(function(e){return eu("div",rd(e))}),eQ);let rm=Math.min,rh=Math.max,rv=Math.round,rg=Math.floor,ry=e=>({x:e,y:e}),rb={left:"right",right:"left",bottom:"top",top:"bottom"},rS={start:"end",end:"start"};function rC(e,t){return"function"==typeof e?e(t):e}function rx(e){return e.split("-")[0]}function rE(e){return e.split("-")[1]}function rA(e){return"x"===e?"y":"x"}function rw(e){return"y"===e?"height":"width"}let r_=new Set(["top","bottom"]);function rT(e){return r_.has(rx(e))?"y":"x"}function rM(e){return e.replace(/start|end/g,e=>rS[e])}let rR=["left","right"],rO=["right","left"],rI=["top","bottom"],rF=["bottom","top"];function rL(e){return e.replace(/left|right|bottom|top/g,e=>rb[e])}function rP(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function rD(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function rB(e,t,r){let n,{reference:i,floating:o}=e,a=rT(t),l=rA(rT(t)),u=rw(l),s=rx(t),c="y"===a,f=i.x+i.width/2-o.width/2,d=i.y+i.height/2-o.height/2,p=i[u]/2-o[u]/2;switch(s){case"top":n={x:f,y:i.y-o.height};break;case"bottom":n={x:f,y:i.y+i.height};break;case"right":n={x:i.x+i.width,y:d};break;case"left":n={x:i.x-o.width,y:d};break;default:n={x:i.x,y:i.y}}switch(rE(t)){case"start":n[l]-=p*(r&&c?-1:1);break;case"end":n[l]+=p*(r&&c?-1:1)}return n}async function rG(e,t){var r;void 0===t&&(t={});let{x:n,y:i,platform:o,rects:a,elements:l,strategy:u}=e,{boundary:s="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=rC(t,e),m=rP(p),h=l[d?"floating"===f?"reference":"floating":f],v=rD(await o.getClippingRect({element:null==(r=await (null==o.isElement?void 0:o.isElement(h)))||r?h:h.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(l.floating)),boundary:s,rootBoundary:c,strategy:u})),g="floating"===f?{x:n,y:i,width:a.floating.width,height:a.floating.height}:a.reference,y=await (null==o.getOffsetParent?void 0:o.getOffsetParent(l.floating)),b=await (null==o.isElement?void 0:o.isElement(y))&&await (null==o.getScale?void 0:o.getScale(y))||{x:1,y:1},S=rD(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:y,strategy:u}):g);return{top:(v.top-S.top+m.top)/b.y,bottom:(S.bottom-v.bottom+m.bottom)/b.y,left:(v.left-S.left+m.left)/b.x,right:(S.right-v.right+m.right)/b.x}}let rk=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,l=o.filter(Boolean),u=await (null==a.isRTL?void 0:a.isRTL(t)),s=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=rB(s,n,u),d=n,p={},m=0;for(let r=0;r typeof window}function rq(e){return rW(e)?(e.nodeName||"").toLowerCase():"#document"}function rV(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function rH(e){var t;return null==(t=(rW(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function rW(e){return!!rU()&&(e instanceof Node||e instanceof rV(e).Node)}function rK(e){return!!rU()&&(e instanceof Element||e instanceof rV(e).Element)}function rz(e){return!!rU()&&(e instanceof HTMLElement||e instanceof rV(e).HTMLElement)}function rQ(e){return!(!rU()||"u" {try{return e.matches(t)}catch(e){return!1}})}let r0=["transform","translate","scale","rotate","perspective"],r1=["transform","translate","scale","rotate","perspective","filter"],r2=["paint","layout","strict","content"];function r3(e){let t=r5(),r=rK(e)?r6(e):e;return r0.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||r1.some(e=>(r.willChange||"").includes(e))||r2.some(e=>(r.contain||"").includes(e))}function r5(){return!("u" rK(e)&&"body"!==rq(e)),i=null,o="fixed"===r6(e).position,a=o?r7(e):e;for(;rK(a)&&!r8(a);){let t=r6(a),r=r3(a);r||"fixed"!==t.position||(i=null),(o?!r&&!i:!r&&"static"===t.position&&!!i&&nc.has(i.position)||rX(a)&&!r&&function e(t,r){let n=r7(t);return!(n===r||!rK(n)||r8(n))&&("fixed"===r6(n).position||e(n,r))}(e,a))?n=n.filter(e=>e!==a):i=t,a=r7(a)}return t.set(e,n),n}(t,this._c):[].concat(r),n],a=o[0],l=o.reduce((e,r)=>{let n=nf(t,r,i);return e.top=rh(n.top,e.top),e.right=rm(n.right,e.right),e.bottom=rm(n.bottom,e.bottom),e.left=rh(n.left,e.left),e},nf(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:nm,getElementRects:nh,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=nr(e);return{width:t,height:r}},getScale:ni,isElement:rK,isRTL:function(e){return"rtl"===r6(e).direction}};function ng(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ny(e=0,t=0,r=0,n=0){if("function"==typeof DOMRect)return new DOMRect(e,t,r,n);let i={x:e,y:t,width:r,height:n,top:t,right:e+r,bottom:t+n,left:e};return{...i,toJSON:()=>i}}function nb(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function nS(e){let t=window.devicePixelRatio||1;return Math.round(e*t)/t}var nC=es(function({store:e,modal:t=!1,portal:r=!!t,preserveTabOrder:n=!0,autoFocusOnShow:i=!0,wrapperProps:o,fixed:a=!1,flip:l=!0,shift:u=0,slide:s=!0,overlap:c=!1,sameWidth:f=!1,fitViewport:d=!1,gutter:p,arrowPadding:m=4,overflowPadding:h=8,getAnchorRect:v,updatePosition:g,...y}){let b=e0();A(e=e||b,!1);let S=e.useState("arrowElement"),C=e.useState("anchorElement"),x=e.useState("disclosureElement"),E=e.useState("popoverElement"),w=e.useState("contentElement"),_=e.useState("placement"),T=e.useState("mounted"),M=e.useState("rendered"),O=(0,R.useRef)(null),[I,F]=(0,R.useState)(!1),{portalRef:L,domReady:P}=Z(r,y.portalRef),D=W(v),B=W(g),G=!!g;H(()=>{if(!(null==E?void 0:E.isConnected))return;E.style.setProperty("--popover-overflow-padding",`${h}px`);let t={contextElement:C||void 0,getBoundingClientRect:()=>{let e=null==D?void 0:D(C);return e||!C?function(e){if(!e)return ny();let{x:t,y:r,width:n,height:i}=e;return ny(t,r,n,i)}(e):C.getBoundingClientRect()}},r=async()=>{var r,n,i,o,v;let g,y,b;if(!T)return;S||(O.current=O.current||document.createElement("div"));let C=S||O.current,x=[(r={gutter:p,shift:u},void 0===(n=({placement:e})=>{var t;let n=((null==C?void 0:C.clientHeight)||0)/2,i="number"==typeof r.gutter?r.gutter+n:null!=(t=r.gutter)?t:n;return{crossAxis:e.split("-")[1]?void 0:r.shift,mainAxis:i,alignmentAxis:r.shift}})&&(n=0),{name:"offset",options:n,async fn(e){var t,r;let{x:i,y:o,placement:a,middlewareData:l}=e,u=await rN(e,n);return a===(null==(t=l.offset)?void 0:t.placement)&&null!=(r=l.arrow)&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:a}}}}),function(e){var t;if(!1===e.flip)return;let r="string"==typeof e.flip?e.flip.split(" "):void 0;return A(!r||r.every(nb),!1),{name:"flip",options:t={padding:e.overflowPadding,fallbackPlacements:r},async fn(e){var r,n,i,o,a,l,u,s;let c,f,d,{placement:p,middlewareData:m,rects:h,initialPlacement:v,platform:g,elements:y}=e,{mainAxis:b=!0,crossAxis:S=!0,fallbackPlacements:C,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:A=!0,...w}=rC(t,e);if(null!=(r=m.arrow)&&r.alignmentOffset)return{};let _=rx(p),T=rT(v),M=rx(v)===v,R=await (null==g.isRTL?void 0:g.isRTL(y.floating)),O=C||(M||!A?[rL(v)]:(c=rL(v),[rM(v),c,rM(c)])),I="none"!==E;!C&&I&&O.push(...(f=rE(v),d=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?rO:rR;return t?rR:rO;case"left":case"right":return t?rI:rF;default:return[]}}(rx(v),"start"===E,R),f&&(d=d.map(e=>e+"-"+f),A&&(d=d.concat(d.map(rM)))),d));let F=[v,...O],L=await g.detectOverflow(e,w),P=[],D=(null==(n=m.flip)?void 0:n.overflows)||[];if(b&&P.push(L[_]),S){let e,t,r,n,i=(l=p,u=h,void 0===(s=R)&&(s=!1),e=rE(l),r=rw(t=rA(rT(l))),n="x"===t?e===(s?"end":"start")?"right":"left":"start"===e?"bottom":"top",u.reference[r]>u.floating[r]&&(n=rL(n)),[n,rL(n)]);P.push(L[i[0]],L[i[1]])}if(D=[...D,{placement:p,overflows:P}],!P.every(e=>e<=0)){let e=((null==(i=m.flip)?void 0:i.index)||0)+1,t=F[e];if(t&&("alignment"!==S||T===rT(t)||D.every(e=>rT(e.placement)!==T||e.overflows[0]>0)))return{data:{index:e,overflows:D},reset:{placement:t}};let r=null==(o=D.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:o.placement;if(!r)switch(x){case"bestFit":{let e=null==(a=D.filter(e=>{if(I){let t=rT(e.placement);return t===T||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:a[0];e&&(r=e);break}case"initialPlacement":r=v}if(p!==r)return{reset:{placement:r}}}return{}}}}({flip:l,overflowPadding:h}),function(e){if(e.slide||e.overlap){var t,r;return{name:"shift",options:r={mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:(void 0===t&&(t={}),{options:t,fn(e){let{x:r,y:n,placement:i,rects:o,middlewareData:a}=e,{offset:l=0,mainAxis:u=!0,crossAxis:s=!0}=rC(t,e),c={x:r,y:n},f=rT(i),d=rA(f),p=c[d],m=c[f],h=rC(l,e),v="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){let e="y"===d?"height":"width",t=o.reference[d]-o.floating[e]+v.mainAxis,r=o.reference[d]+o.reference[e]-v.mainAxis;p r&&(p=r)}if(s){var g,y;let e="y"===d?"width":"height",t=rj.has(rx(i)),r=o.reference[f]-o.floating[e]+(t&&(null==(g=a.offset)?void 0:g[f])||0)+(t?0:v.crossAxis),n=o.reference[f]+o.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[f])||0)-(t?v.crossAxis:0);m n&&(m=n)}return{[d]:p,[f]:m}}})},async fn(e){let{x:t,y:n,placement:i,platform:o}=e,{mainAxis:a=!0,crossAxis:l=!1,limiter:u={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...s}=rC(r,e),c={x:t,y:n},f=await o.detectOverflow(e,s),d=rT(rx(i)),p=rA(d),m=c[p],h=c[d];if(a){let e="y"===p?"top":"left",t="y"===p?"bottom":"right",r=m+f[e],n=m-f[t];m=rh(r,rm(m,n))}if(l){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",r=h+f[e],n=h-f[t];h=rh(r,rm(h,n))}let v=u.fn({...e,[p]:m,[d]:h});return{...v,data:{x:v.x-t,y:v.y-n,enabled:{[p]:a,[d]:l}}}}}}}({slide:s,shift:u,overlap:c,overflowPadding:h}),function(e,t){if(e){let r;return{name:"arrow",options:r={element:e,padding:t.arrowPadding},async fn(e){let{x:t,y:n,placement:i,rects:o,platform:a,elements:l,middlewareData:u}=e,{element:s,padding:c=0}=rC(r,e)||{};if(null==s)return{};let f=rP(c),d={x:t,y:n},p=rA(rT(i)),m=rw(p),h=await a.getDimensions(s),v="y"===p,g=v?"clientHeight":"clientWidth",y=o.reference[m]+o.reference[p]-d[p]-o.floating[m],b=d[p]-o.reference[p],S=await (null==a.getOffsetParent?void 0:a.getOffsetParent(s)),C=S?S[g]:0;C&&await (null==a.isElement?void 0:a.isElement(S))||(C=l.floating[g]||o.floating[m]);let x=C/2-h[m]/2-1,E=rm(f[v?"top":"left"],x),A=rm(f[v?"bottom":"right"],x),w=C-h[m]-A,_=C/2-h[m]/2+(y/2-b/2),T=rh(E,rm(_,w)),M=!u.arrow&&null!=rE(i)&&_!==T&&o.reference[m]/2-(_ {},...f}=rC(o,e),d=await u.detectOverflow(e,f),p=rx(a),m=rE(a),h="y"===rT(a),{width:v,height:g}=l.floating;"top"===p||"bottom"===p?(n=p,i=m===(await (null==u.isRTL?void 0:u.isRTL(s.floating))?"start":"end")?"left":"right"):(i=p,n="end"===m?"top":"bottom");let y=g-d.top-d.bottom,b=v-d.left-d.right,S=rm(g-d[n],y),C=rm(v-d[i],b),x=!e.middlewareData.shift,E=S,A=C;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(A=b),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(E=y),x&&!m){let e=rh(d.left,0),t=rh(d.right,0),r=rh(d.top,0),n=rh(d.bottom,0);h?A=v-2*(0!==e||0!==t?e+t:rh(d.left,d.right)):E=g-2*(0!==r||0!==n?r+n:rh(d.top,d.bottom))}await c({...e,availableWidth:A,availableHeight:E});let w=await u.getDimensions(s.floating);return v!==w.width||g!==w.height?{reset:{rects:!0}}:{}}}],w=await (v={placement:_,strategy:a?"fixed":"absolute",middleware:x},g=new Map,b={...(y={platform:nv,...v}).platform,_c:g},rk(t,E,{...y,platform:b}));null==e||e.setState("currentPlacement",w.placement),F(!0);let M=nS(w.x),R=nS(w.y);if(Object.assign(E.style,{top:"0",left:"0",transform:`translate3d(${M}px,${R}px,0)`}),C&&w.middlewareData.arrow){let{x:e,y:t}=w.middlewareData.arrow,r=w.placement.split("-")[0],n=C.clientWidth/2,i=C.clientHeight/2,o=null!=e?e+n:-n,a=null!=t?t+i:-i;E.style.setProperty("--popover-transform-origin",{top:`${o}px calc(100% + ${i}px)`,bottom:`${o}px ${-i}px`,left:`calc(100% + ${n}px) ${a}px`,right:`${-n}px ${a}px`}[r]),Object.assign(C.style,{left:null!=e?`${e}px`:"",top:null!=t?`${t}px`:"",[r]:"100%"})}},n=function(e,t,r,n){let i;void 0===n&&(n={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:s=!1}=n,c=nn(e),f=o||a?[...c?ne(c):[],...ne(t)]:[];f.forEach(e=>{o&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});let d=c&&u?function(e,t){let r,n=null,i=rH(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function a(l,u){void 0===l&&(l=!1),void 0===u&&(u=1),o();let s=e.getBoundingClientRect(),{left:c,top:f,width:d,height:p}=s;if(l||t(),!d||!p)return;let m={rootMargin:-rg(f)+"px "+-rg(i.clientWidth-(c+d))+"px "+-rg(i.clientHeight-(f+p))+"px "+-rg(c)+"px",threshold:rh(0,rm(1,u))||1},h=!0;function v(t){let n=t[0].intersectionRatio;if(n!==u){if(!h)return a();n?a(!1,n):r=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==n||ng(s,e.getBoundingClientRect())||a(),h=!1}try{n=new IntersectionObserver(v,{...m,root:i.ownerDocument})}catch(e){n=new IntersectionObserver(v,m)}n.observe(e)}(!0),o}(c,r):null,p=-1,m=null;l&&(m=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),r()}),c&&!s&&m.observe(c),m.observe(t));let h=s?nl(e):null;return s&&function t(){let n=nl(e);h&&!ng(h,n)&&r(),h=n,i=requestAnimationFrame(t)}(),r(),()=>{var e;f.forEach(e=>{o&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=m)||e.disconnect(),m=null,s&&cancelAnimationFrame(i)}}(t,E,async()=>{G?(await B({updatePosition:r}),F(!0)):await r()},{elementResize:"function"==typeof ResizeObserver});return()=>{F(!1),n()}},[e,M,E,S,C,E,_,T,P,a,l,u,s,c,f,d,p,m,h,D,G,B]),H(()=>{if(!T||!P||!(null==E?void 0:E.isConnected)||!(null==w?void 0:w.isConnected))return;let e=()=>{E.style.zIndex=getComputedStyle(w).zIndex};e();let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)},[T,P,E,w]);let k=a?"fixed":"absolute";return y=Y(y,t=>(0,eo.jsx)("div",{...o,style:{position:k,top:0,left:0,width:"max-content",...null==o?void 0:o.style},ref:null==e?void 0:e.setPopoverElement,children:t}),[e,k,o]),y={"data-placing":!I||void 0,...y=Y(y,t=>(0,eo.jsx)(e2,{value:e,children:t}),[e]),style:{position:"relative",...y.style}},y=rd({store:e,modal:t,portal:r,preserveTabOrder:n,preserveTabOrderAnchor:x||C,autoFocusOnShow:I&&i,...y,portalRef:L})});rp(ea(function(e){return eu("div",nC(e))}),e0);var nx=es(function({store:e,modal:t,tabIndex:r,alwaysVisible:i,autoFocusOnHide:o=!0,hideOnInteractOutside:a=!0,...l}){let u=e9();A(e=e||u,!1);let s=e.useState("baseElement"),c=(0,R.useRef)(!1),f=t_(e.tag,e=>null==e?void 0:e.renderedItems.length);return l=tN({store:e,alwaysVisible:i,...l}),l=nC({store:e,modal:t,alwaysVisible:i,backdrop:!1,autoFocusOnShow:!1,finalFocus:s,preserveTabOrderAnchor:null,unstable_treeSnapshotKey:f,...l,getPersistentElements(){var r;let i=(null==(r=l.getPersistentElements)?void 0:r.call(l))||[];if(!t||!e)return i;let{contentElement:o,baseElement:a}=e.getState();if(!a)return i;let u=n(a),s=[];if((null==o?void 0:o.id)&&s.push(`[aria-controls~="${o.id}"]`),(null==a?void 0:a.id)&&s.push(`[aria-controls~="${a.id}"]`),!s.length)return[...i,a];let c=s.join(",");return[...i,...u.querySelectorAll(c)]},autoFocusOnHide:e=>!w(o,e)&&(!c.current||(c.current=!1,!1)),hideOnInteractOutside(t){var r,n;let i=null==e?void 0:e.getState(),o=null==(r=null==i?void 0:i.contentElement)?void 0:r.id,l=null==(n=null==i?void 0:i.baseElement)?void 0:n.id;if(function(e,...t){if(!e)return!1;if("id"in e){let r=t.filter(Boolean).map(e=>`[aria-controls~="${e}"]`).join(", ");return!!r&&e.matches(r)}return!1}(t.target,o,l))return!1;let u="function"==typeof a?a(t):a;return u&&(c.current="click"===t.type),u}})}),nE=rp(ea(function(e){return eu("div",nx(e))}),e9);e.s(["ComboboxPopover",()=>nE],1559),(0,R.createContext)(null),(0,R.createContext)(null);var nA=ec([ev],[eg]),nw=nA.useContext;nA.useScopedContext,nA.useProviderContext,nA.ContextProvider,nA.ScopedContextProvider;var n_={id:null};function nT(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function nM(e,t){return e.filter(e=>e.rowId===t)}function nR(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}function nO(e){let t=0;for(let{length:r}of e)r>t&&(t=r);return t}var nI=L()&&I();function nF({tag:e,...t}={}){let r=tf(t.store,function(e,...t){if(e)return tn(e,"pick")(...t)}(e,["value","rtl"]));td(t,r);let i=null==e?void 0:e.getState(),o=null==r?void 0:r.getState(),a=M(t.activeId,null==o?void 0:o.activeId,t.defaultActiveId,null),l=function(e={}){var t;let r=null==(t=e.store)?void 0:t.getState(),i=function(e={}){var t,r;td(e,e.store);let i=null==(t=e.store)?void 0:t.getState(),o=M(e.items,null==i?void 0:i.items,e.defaultItems,[]),a=new Map(o.map(e=>[e.id,e])),l={items:o,renderedItems:M(null==i?void 0:i.renderedItems,[])},u=null==(r=e.store)?void 0:r.__unstablePrivateStore,s=ti({items:o,renderedItems:l.renderedItems},u),c=ti(l,e.store),f=e=>{var t;let r,n,i=(t=e=>e.element,r=e.map((e,t)=>[t,e]),n=!1,(r.sort(([e,r],[i,o])=>{var a;let l=t(r),u=t(o);return l!==u&&l&&u?(a=l,u.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_PRECEDING)?(e>i&&(n=!0),-1):(et):e);s.setState("renderedItems",i),c.setState("renderedItems",i)};to(c,()=>ta(s)),to(s,()=>ts(s,["items"],e=>{c.setState("items",e.items)})),to(s,()=>ts(s,["renderedItems"],e=>{let t=!0,r=requestAnimationFrame(()=>{let{renderedItems:t}=c.getState();e.renderedItems!==t&&f(e.renderedItems)});if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(r);let i=new IntersectionObserver(()=>{if(t){t=!1;return}cancelAnimationFrame(r),r=requestAnimationFrame(()=>f(e.renderedItems))},{root:function(e){var t;let r=e.find(e=>!!e.element),i=[...e].reverse().find(e=>!!e.element),o=null==(t=null==r?void 0:r.element)?void 0:t.parentElement;for(;o&&(null==i?void 0:i.element);){let e=o;if(i&&e.contains(i.element))return o;o=o.parentElement}return n(o).body}(e.renderedItems)});for(let t of e.renderedItems)t.element&&i.observe(t.element);return()=>{cancelAnimationFrame(r),i.disconnect()}}));let d=(e,t,r=!1)=>{let n;return t(t=>{let r=t.findIndex(({id:t})=>t===e.id),i=t.slice();if(-1!==r){let o={...n=t[r],...e};i[r]=o,a.set(e.id,o)}else i.push(e),a.set(e.id,e);return i}),()=>{t(t=>{if(!n)return r&&a.delete(e.id),t.filter(({id:t})=>t!==e.id);let i=t.findIndex(({id:t})=>t===e.id);if(-1===i)return t;let o=t.slice();return o[i]=n,a.set(e.id,n),o})}},p=e=>d(e,e=>s.setState("items",e),!0);return{...c,registerItem:p,renderItem:e=>x(p(e),d(e,e=>s.setState("renderedItems",e))),item:e=>{if(!e)return null;let t=a.get(e);if(!t){let{items:r}=s.getState();(t=r.find(t=>t.id===e))&&a.set(e,t)}return t||null},__unstablePrivateStore:s}}(e),o=M(e.activeId,null==r?void 0:r.activeId,e.defaultActiveId),a=ti({...i.getState(),id:M(e.id,null==r?void 0:r.id,`id-${Math.random().toString(36).slice(2,8)}`),activeId:o,baseElement:M(null==r?void 0:r.baseElement,null),includesBaseElement:M(e.includesBaseElement,null==r?void 0:r.includesBaseElement,null===o),moves:M(null==r?void 0:r.moves,0),orientation:M(e.orientation,null==r?void 0:r.orientation,"both"),rtl:M(e.rtl,null==r?void 0:r.rtl,!1),virtualFocus:M(e.virtualFocus,null==r?void 0:r.virtualFocus,!1),focusLoop:M(e.focusLoop,null==r?void 0:r.focusLoop,!1),focusWrap:M(e.focusWrap,null==r?void 0:r.focusWrap,!1),focusShift:M(e.focusShift,null==r?void 0:r.focusShift,!1)},i,e.store);to(a,()=>tu(a,["renderedItems","activeId"],e=>{a.setState("activeId",t=>{var r;return void 0!==t?t:null==(r=nT(e.renderedItems))?void 0:r.id})}));let l=(e="next",t={})=>{var r,n;let i=a.getState(),{skip:o=0,activeId:l=i.activeId,focusShift:u=i.focusShift,focusLoop:s=i.focusLoop,focusWrap:c=i.focusWrap,includesBaseElement:f=i.includesBaseElement,renderedItems:d=i.renderedItems,rtl:p=i.rtl}=t,m="up"===e||"down"===e,h="next"===e||"down"===e,v=m?eU(function(e,t,r){let n=nO(e);for(let i of e)for(let e=0;e e.id===l);if(!g)return null==(n=nT(v))?void 0:n.id;let y=v.some(e=>e.rowId),b=v.indexOf(g),S=v.slice(b+1),C=nM(S,g.rowId);if(o){let e=C.filter(e=>l?!e.disabled&&e.id!==l:!e.disabled),t=e.slice(o)[0]||e[e.length-1];return null==t?void 0:t.id}let x=s&&(m?"horizontal"!==s:"vertical"!==s),E=y&&c&&(m?"horizontal"!==c:"vertical"!==c),A=h?(!y||m)&&x&&f:!!m&&f;if(x){let e=nT(function(e,t,r=!1){let n=e.findIndex(e=>e.id===t);return[...e.slice(n+1),...r?[n_]:[],...e.slice(0,n)]}(E&&!A?v:nM(v,g.rowId),l,A),l);return null==e?void 0:e.id}if(E){let e=nT(A?C:S,l);return A?(null==e?void 0:e.id)||null:null==e?void 0:e.id}let w=nT(C,l);return!w&&A?null:null==w?void 0:w.id};return{...i,...a,setBaseElement:e=>a.setState("baseElement",e),setActiveId:e=>a.setState("activeId",e),move:e=>{void 0!==e&&(a.setState("activeId",e),a.setState("moves",e=>e+1))},first:()=>{var e;return null==(e=nT(a.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=nT(eq(a.getState().renderedItems)))?void 0:e.id},next:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("next",e)),previous:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("previous",e)),down:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("down",e)),up:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("up",e))}}({...t,activeId:a,includesBaseElement:M(t.includesBaseElement,null==o?void 0:o.includesBaseElement,!0),orientation:M(t.orientation,null==o?void 0:o.orientation,"vertical"),focusLoop:M(t.focusLoop,null==o?void 0:o.focusLoop,!0),focusWrap:M(t.focusWrap,null==o?void 0:o.focusWrap,!0),virtualFocus:M(t.virtualFocus,null==o?void 0:o.virtualFocus,!0)}),u=function({popover:e,...t}={}){let r=tf(t.store,tc(e,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));td(t,r);let n=null==r?void 0:r.getState(),i=rs({...t,store:r}),o=M(t.placement,null==n?void 0:n.placement,"bottom"),a=ti({...i.getState(),placement:o,currentPlacement:o,anchorElement:M(null==n?void 0:n.anchorElement,null),popoverElement:M(null==n?void 0:n.popoverElement,null),arrowElement:M(null==n?void 0:n.arrowElement,null),rendered:Symbol("rendered")},i,r);return{...i,...a,setAnchorElement:e=>a.setState("anchorElement",e),setPopoverElement:e=>a.setState("popoverElement",e),setArrowElement:e=>a.setState("arrowElement",e),render:()=>a.setState("rendered",Symbol("rendered"))}}({...t,placement:M(t.placement,null==o?void 0:o.placement,"bottom-start")}),s=M(t.value,null==o?void 0:o.value,t.defaultValue,""),c=M(t.selectedValue,null==o?void 0:o.selectedValue,null==i?void 0:i.values,t.defaultSelectedValue,""),f=Array.isArray(c),d={...l.getState(),...u.getState(),value:s,selectedValue:c,resetValueOnSelect:M(t.resetValueOnSelect,null==o?void 0:o.resetValueOnSelect,f),resetValueOnHide:M(t.resetValueOnHide,null==o?void 0:o.resetValueOnHide,f&&!e),activeValue:null==o?void 0:o.activeValue},p=ti(d,l,u,r);return nI&&to(p,()=>tu(p,["virtualFocus"],()=>{p.setState("virtualFocus",!1)})),to(p,()=>{if(e)return x(tu(p,["selectedValue"],t=>{Array.isArray(t.selectedValue)&&e.setValues(t.selectedValue)}),tu(e,["values"],e=>{p.setState("selectedValue",e.values)}))}),to(p,()=>tu(p,["resetValueOnHide","mounted"],e=>{!e.resetValueOnHide||e.mounted||p.setState("value",s)})),to(p,()=>tu(p,["open"],e=>{e.open||(p.setState("activeId",a),p.setState("moves",0))})),to(p,()=>tu(p,["moves","activeId"],(e,t)=>{e.moves===t.moves&&p.setState("activeValue",void 0)})),to(p,()=>ts(p,["moves","renderedItems"],(e,t)=>{if(e.moves===t.moves)return;let{activeId:r}=p.getState(),n=l.item(r);p.setState("activeValue",null==n?void 0:n.value)})),{...u,...l,...p,tag:e,setValue:e=>p.setState("value",e),resetValue:()=>p.setState("value",d.value),setSelectedValue:e=>p.setState("selectedValue",e)}}function nL(e={}){var t,r,n,i,o,a,l,u;let s;t=e,s=nw();let[c,f]=tR(nF,e={id:z((r=t={...t,tag:void 0!==t.tag?t.tag:s}).id),...r});return Q(f,[(n=e).tag]),tM(c,n,"value","setValue"),tM(c,n,"selectedValue","setSelectedValue"),tM(c,n,"resetValueOnHide"),tM(c,n,"resetValueOnSelect"),Object.assign((a=c,Q(l=f,[(u=n).popover]),tM(a,u,"placement"),i=ra(a,l,u),o=i,Q(f,[n.store]),tM(o,n,"items","setItems"),tM(i=o,n,"activeId","setActiveId"),tM(i,n,"includesBaseElement"),tM(i,n,"virtualFocus"),tM(i,n,"orientation"),tM(i,n,"rtl"),tM(i,n,"focusLoop"),tM(i,n,"focusWrap"),tM(i,n,"focusShift"),i),{tag:n.tag})}function nP(e={}){let t=nL(e);return(0,eo.jsx)(e7,{value:t,children:e.children})}e.s(["useComboboxStore",()=>nL],18364),e.s(["ComboboxProvider",()=>nP],78440);var nD=(0,R.createContext)(void 0),nB=es(function(e){let[t,r]=(0,R.useState)();return T(e={role:"group","aria-labelledby":t,...e=Y(e,e=>(0,eo.jsx)(nD.Provider,{value:r,children:e}),[])})});ea(function(e){return eu("div",nB(e))});var nG=es(function({store:e,...t}){return nB(t)});ea(function(e){return eu("div",nG(e))});var nk=es(function({store:e,...t}){let r=e6();return A(e=e||r,!1),"grid"===m(e.useState("contentElement"))&&(t={role:"rowgroup",...t}),t=nG({store:e,...t})}),nj=ea(function(e){return eu("div",nk(e))});e.s(["ComboboxGroup",()=>nj],59129);var nN=es(function(e){let t=(0,R.useContext)(nD),r=z(e.id);return H(()=>(null==t||t(r),()=>null==t?void 0:t(void 0)),[t,r]),T(e={id:r,"aria-hidden":!0,...e})});ea(function(e){return eu("div",nN(e))});var nU=es(function({store:e,...t}){return nN(t)});ea(function(e){return eu("div",nU(e))});var nq=es(function(e){return nU(e)}),nV=ea(function(e){return eu("div",nq(e))});e.s(["ComboboxGroupLabel",()=>nV],25998);var nH=e.i(38360);let nW={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},nK=(e,t)=>String(e.rankedValue).localeCompare(String(t.rankedValue));function nz(e,t,r={}){let{keys:n,threshold:i=nW.MATCHES,baseSort:o=nK,sorter:a=e=>e.sort((e,t)=>(function(e,t,r){let{rank:n,keyIndex:i}=e,{rank:o,keyIndex:a}=t;return n!==o?n>o?-1:1:i===a?r(e,t):i{let l=nQ(i,s,c),u=t,{minRanking:f,maxRanking:d,threshold:p}=o;return l =nW.MATCHES?l=f:l>d&&(l=d),l>e&&(e=l,r=a,n=p,u=i),{rankedValue:u,rank:e,keyIndex:r,keyThreshold:n}},{rankedValue:l,rank:nW.NO_MATCH,keyIndex:-1,keyThreshold:c.threshold}):{rankedValue:l,rank:nQ(l,s,c),keyIndex:-1,keyThreshold:c.threshold}),{rank:d,keyThreshold:p=i}=f;return d>=p&&e.push({...f,item:o,index:a}),e},[])).map(({item:e})=>e)}function nQ(e,t,r){if(e=n$(e,r),(t=n$(t,r)).length>e.length)return nW.NO_MATCH;if(e===t)return nW.CASE_SENSITIVE_EQUAL;let n=function*(e,t){let r=-1;for(;(r=e.indexOf(t,r+1))>-1;)yield r;return -1}(e=e.toLowerCase(),t=t.toLowerCase()),i=n.next(),o=i.value;if(e.length===t.length&&0===o)return nW.EQUAL;if(0===o)return nW.STARTS_WITH;let a=i;for(;!a.done;){if(a.value>0&&" "===e[a.value-1])return nW.WORD_STARTS_WITH;a=n.next()}return o>0?nW.CONTAINS:1===t.length?nW.NO_MATCH:(function(e){let t="",r=" ";for(let n=0;n -1))return nW.NO_MATCH;return r=o-l,n=i/t.length,nW.MATCHES+1/r*n}(e,t)}function n$(e,{keepDiacritics:t}){return e=`${e}`,t||(e=(0,nH.default)(e)),e}nz.rankings=nW;let nX={maxRanking:1/0,minRanking:-1/0};e.s(["matchSorter",()=>nz],70238)},29402,(e,t,r)=>{var n,i,o,a,l="__lodash_hash_undefined__",u=1/0,s="[object Arguments]",c="[object Array]",f="[object Boolean]",d="[object Date]",p="[object Error]",m="[object Function]",h="[object Map]",v="[object Number]",g="[object Object]",y="[object Promise]",b="[object RegExp]",S="[object Set]",C="[object String]",x="[object Symbol]",E="[object WeakMap]",A="[object ArrayBuffer]",w="[object DataView]",_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,M=/^\./,R=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O=/\\(\\)?/g,I=/^\[object .+?Constructor\]$/,F=/^(?:0|[1-9]\d*)$/,L={};L["[object Float32Array]"]=L["[object Float64Array]"]=L["[object Int8Array]"]=L["[object Int16Array]"]=L["[object Int32Array]"]=L["[object Uint8Array]"]=L["[object Uint8ClampedArray]"]=L["[object Uint16Array]"]=L["[object Uint32Array]"]=!0,L[s]=L[c]=L[A]=L[f]=L[w]=L[d]=L[p]=L[m]=L[h]=L[v]=L[g]=L[b]=L[S]=L[C]=L[E]=!1;var P=e.g&&e.g.Object===Object&&e.g,D="object"==typeof self&&self&&self.Object===Object&&self,B=P||D||Function("return this")(),G=r&&!r.nodeType&&r,k=G&&t&&!t.nodeType&&t,j=k&&k.exports===G&&P.process,N=function(){try{return j&&j.binding("util")}catch(e){}}(),U=N&&N.isTypedArray;function q(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r -1},ex.prototype.set=function(e,t){var r=this.__data__,n=e_(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},eE.prototype.clear=function(){this.__data__={hash:new eC,map:new(eu||ex),string:new eC}},eE.prototype.delete=function(e){return eP(this,e).delete(e)},eE.prototype.get=function(e){return eP(this,e).get(e)},eE.prototype.has=function(e){return eP(this,e).has(e)},eE.prototype.set=function(e,t){return eP(this,e).set(e,t),this},eA.prototype.add=eA.prototype.push=function(e){return this.__data__.set(e,l),this},eA.prototype.has=function(e){return this.__data__.has(e)},ew.prototype.clear=function(){this.__data__=new ex},ew.prototype.delete=function(e){return this.__data__.delete(e)},ew.prototype.get=function(e){return this.__data__.get(e)},ew.prototype.has=function(e){return this.__data__.has(e)},ew.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ex){var n=r.__data__;if(!eu||n.length<199)return n.push([e,t]),this;r=this.__data__=new eE(n)}return r.set(e,t),this};var eT=(n=function(e,t){return e&&eM(e,t,e0)},function(e,t){if(null==e)return e;if(!ez(e))return n(e,t);for(var r=e.length,i=-1,o=Object(e);++i l))return!1;var s=o.get(e);if(s&&o.get(t))return s==t;var c=-1,f=!0,d=1&i?new eA:void 0;for(o.set(e,t),o.set(t,e);++c -1&&e%1==0&&e -1&&e%1==0&&e<=0x1fffffffffffff}function eX(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function eY(e){return!!e&&"object"==typeof e}function eZ(e){return"symbol"==typeof e||eY(e)&&ee.call(e)==x}var eJ=U?V(U):function(e){return eY(e)&&e$(e.length)&&!!L[ee.call(e)]};function e0(e){return ez(e)?function(e,t){var r=eK(e)||eW(e)?function(e,t){for(var r=-1,n=Array(e);++r t||o&&a&&u&&!l&&!s||n&&a&&u||!r&&u||!i)return 1;if(!n&&!o&&!s&&e =l)return u;return u*("desc"==r[n]?-1:1)}}return e.index-t.index}(e,t,r)});u--;)l[u]=l[u].value;return l}(e,t,r))}},97442,e=>{e.v({Group:"MissionSelect-module__N_AIjG__Group",GroupLabel:"MissionSelect-module__N_AIjG__GroupLabel",Input:"MissionSelect-module__N_AIjG__Input",InputWrapper:"MissionSelect-module__N_AIjG__InputWrapper",Item:"MissionSelect-module__N_AIjG__Item",ItemHeader:"MissionSelect-module__N_AIjG__ItemHeader",ItemMissionName:"MissionSelect-module__N_AIjG__ItemMissionName",ItemName:"MissionSelect-module__N_AIjG__ItemName",ItemType:"MissionSelect-module__N_AIjG__ItemType",ItemTypes:"MissionSelect-module__N_AIjG__ItemTypes",List:"MissionSelect-module__N_AIjG__List",NoResults:"MissionSelect-module__N_AIjG__NoResults",Popover:"MissionSelect-module__N_AIjG__Popover",SelectedName:"MissionSelect-module__N_AIjG__SelectedName",SelectedValue:"MissionSelect-module__N_AIjG__SelectedValue",Shortcut:"MissionSelect-module__N_AIjG__Shortcut"})},38847,e=>{"use strict";var t=e.i(80902),r=e.i(22289),n=e.i(71645);function i(e,t,n){try{return e(t)}catch(e){return(0,r.l)("[nuqs] Error while parsing value `%s`: %O"+(n?" (for key `%s`)":""),t,e,n),null}}function o(e){function t(t){if(void 0===t)return null;let r="";if(Array.isArray(t)){if(void 0===t[0])return null;r=t[0]}return"string"==typeof t&&(r=t),i(e.parse,r)}return{type:"single",eq:(e,t)=>e===t,...e,parseServerSide:t,withDefault(e){return{...this,defaultValue:e,parseServerSide:r=>t(r)??e}},withOptions(e){return{...this,...e}}}}let a=o({parse:e=>e,serialize:String});o({parse:e=>{let t=parseInt(e);return t==t?t:null},serialize:e=>""+Math.round(e)}),o({parse:e=>{let t=parseInt(e);return t==t?t-1:null},serialize:e=>""+Math.round(e+1)}),o({parse:e=>{let t=parseInt(e,16);return t==t?t:null},serialize:e=>{let t=Math.round(e).toString(16);return(1&t.length?"0":"")+t}}),o({parse:e=>{let t=parseFloat(e);return t==t?t:null},serialize:String});let l=o({parse:e=>"true"===e.toLowerCase(),serialize:String});function u(e,t){return e.valueOf()===t.valueOf()}o({parse:e=>{let t=parseInt(e);return t==t?new Date(t):null},serialize:e=>""+e.valueOf(),eq:u}),o({parse:e=>{let t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:u}),o({parse:e=>{let t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:u});let s=(0,t.r)(),c={};function f(e,r,n,o,a,l){let u=!1,s=Object.entries(e).reduce((e,[s,c])=>{var f;let d=r?.[s]??s,p=o[d],m="multi"===c.type?[]:null,h=void 0===p?("multi"===c.type?n?.getAll(d):n?.get(d))??m:p;return a&&l&&((f=a[d]??m)===h||null!==f&&null!==h&&"string"!=typeof f&&"string"!=typeof h&&f.length===h.length&&f.every((e,t)=>e===h[t]))?e[s]=l[s]??null:(u=!0,e[s]=((0,t.i)(h)?null:i(c.parse,h,d))??null,a&&(a[d]=h)),e},{});if(!u){let t=Object.keys(e),r=Object.keys(l??{});u=t.length!==r.length||t.some(e=>!r.includes(e))}return{state:s,hasChanged:u}}function d(e,t){return Object.fromEntries(Object.keys(e).map(r=>[r,e[r]??t[r]??null]))}function p(e,i={}){let{parse:o,type:a,serialize:l,eq:u,defaultValue:m,...h}=i,[{[e]:v},g]=function(e,i={}){let o=(0,n.useId)(),a=(0,r.i)(),l=(0,r.a)(),{history:u="replace",scroll:p=a?.scroll??!1,shallow:m=a?.shallow??!0,throttleMs:h=t.s.timeMs,limitUrlUpdates:v=a?.limitUrlUpdates,clearOnDefault:g=a?.clearOnDefault??!0,startTransition:y,urlKeys:b=c}=i,S=Object.keys(e).join(","),C=(0,n.useMemo)(()=>Object.fromEntries(Object.keys(e).map(e=>[e,b[e]??e])),[S,JSON.stringify(b)]),x=(0,r.r)(Object.values(C)),E=x.searchParams,A=(0,n.useRef)({}),w=(0,n.useMemo)(()=>Object.fromEntries(Object.keys(e).map(t=>[t,e[t].defaultValue??null])),[Object.values(e).map(({defaultValue:e})=>e).join(",")]),_=t.t.useQueuedQueries(Object.values(C)),[T,M]=(0,n.useState)(()=>f(e,b,E??new URLSearchParams,_).state),R=(0,n.useRef)(T);if((0,r.c)("[nuq+ %s `%s`] render - state: %O, iSP: %s",o,S,T,E),Object.keys(A.current).join("&")!==Object.values(C).join("&")){let{state:t,hasChanged:n}=f(e,b,E,_,A.current,R.current);n&&((0,r.c)("[nuq+ %s `%s`] State changed: %O",o,S,{state:t,initialSearchParams:E,queuedQueries:_,queryRef:A.current,stateRef:R.current}),R.current=t,M(t)),A.current=Object.fromEntries(Object.entries(C).map(([t,r])=>[r,e[t]?.type==="multi"?E?.getAll(r):E?.get(r)??null]))}(0,n.useEffect)(()=>{let{state:t,hasChanged:n}=f(e,b,E,_,A.current,R.current);n&&((0,r.c)("[nuq+ %s `%s`] State changed: %O",o,S,{state:t,initialSearchParams:E,queuedQueries:_,queryRef:A.current,stateRef:R.current}),R.current=t,M(t))},[Object.values(C).map(e=>`${e}=${E?.getAll(e)}`).join("&"),JSON.stringify(_)]),(0,n.useEffect)(()=>{let t=Object.keys(e).reduce((t,n)=>(t[n]=({state:t,query:i})=>{M(a=>{let{defaultValue:l}=e[n],u=C[n],s=t??l??null;return Object.is(a[n]??l??null,s)?((0,r.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). no change, skipping, resolved: %O",o,S,u,t,l,R.current),a):(R.current={...R.current,[n]:s},A.current[u]=i,(0,r.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). updateInternalState, resolved: %O",o,S,u,t,l,R.current),R.current)})},t),{});for(let n of Object.keys(e)){let e=C[n];(0,r.c)("[nuq+ %s `%s`] Subscribing to sync for `%s`",o,e,S),s.on(e,t[n])}return()=>{for(let n of Object.keys(e)){let e=C[n];(0,r.c)("[nuq+ %s `%s`] Unsubscribing to sync for `%s`",o,e,S),s.off(e,t[n])}}},[S,C]);let O=(0,n.useCallback)((n,i={})=>{let a,c=Object.fromEntries(Object.keys(e).map(e=>[e,null])),f="function"==typeof n?n(d(R.current,w))??c:n??c;(0,r.c)("[nuq+ %s `%s`] setState: %O",o,S,f);let b=0,E=!1,A=[];for(let[n,o]of Object.entries(f)){let c=e[n],f=C[n];if(!c||void 0===o)continue;(i.clearOnDefault??c.clearOnDefault??g)&&null!==o&&void 0!==c.defaultValue&&(c.eq??((e,t)=>e===t))(o,c.defaultValue)&&(o=null);let d=null===o?null:(c.serialize??String)(o);s.emit(f,{state:o,query:d});let S={key:f,query:d,options:{history:i.history??c.history??u,shallow:i.shallow??c.shallow??m,scroll:i.scroll??c.scroll??p,startTransition:i.startTransition??c.startTransition??y}};if(i?.limitUrlUpdates?.method==="debounce"||v?.method==="debounce"||c.limitUrlUpdates?.method==="debounce"){!0===S.options.shallow&&console.warn((0,r.s)(422));let e=i?.limitUrlUpdates?.timeMs??v?.timeMs??c.limitUrlUpdates?.timeMs??t.s.timeMs,n=t.t.push(S,e,x,l);b t(e),E?t.n.flush(x,l):t.n.getPendingPromise(x));return a??_},[S,u,m,p,h,v?.method,v?.timeMs,y,C,x.updateUrl,x.getSearchParamsSnapshot,x.rateLimitFactor,l,w]);return[(0,n.useMemo)(()=>d(T,w),[T,w]),O]}({[e]:{parse:o??(e=>e),type:a,serialize:l,eq:u,defaultValue:m}},h);return[v,(0,n.useCallback)((t,r={})=>g(r=>({[e]:"function"==typeof t?t(r[e]):t}),r),[e,g])]}e.s(["createParser",()=>o,"parseAsBoolean",()=>l,"parseAsString",()=>a,"useQueryState",()=>p],38847)},32424,7368,e=>{"use strict";var t=e.i(12979);function r(){return async e=>{let r;try{r=(0,t.getUrlForPath)(e)}catch(t){return console.warn(`Script not in manifest: ${e} (${t})`),null}try{let t=await fetch(r);if(!t.ok)return console.error(`Script fetch failed: ${e} (${t.status})`),null;return await t.text()}catch(t){return console.error(`Script fetch error: ${e}`),console.error(t),null}}}e.s(["createScriptLoader",()=>r],32424),e.s(["ignoreScripts",0,["scripts/admin.cs","scripts/ai.cs","scripts/aiBotProfiles.cs","scripts/aiBountyGame.cs","scripts/aiChat.cs","scripts/aiCnH.cs","scripts/aiCTF.cs","scripts/aiDeathMatch.cs","scripts/aiDebug.cs","scripts/aiDefaultTasks.cs","scripts/aiDnD.cs","scripts/aiHumanTasks.cs","scripts/aiHunters.cs","scripts/aiInventory.cs","scripts/aiObjectiveBuilder.cs","scripts/aiObjectives.cs","scripts/aiRabbit.cs","scripts/aiSiege.cs","scripts/aiTDM.cs","scripts/aiTeamHunters.cs","scripts/deathMessages.cs","scripts/graphBuild.cs","scripts/navGraph.cs","scripts/serverTasks.cs","scripts/spdialog.cs"]],7368)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/302e494fb721f5e6.js b/docs/_next/static/chunks/302e494fb721f5e6.js new file mode 100644 index 00000000..54a8f2ff --- /dev/null +++ b/docs/_next/static/chunks/302e494fb721f5e6.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,13070,e=>{e.v({Arrow:"KeyboardOverlay-module__HsRBsa__Arrow",Column:"KeyboardOverlay-module__HsRBsa__Column",Key:"KeyboardOverlay-module__HsRBsa__Key",Root:"KeyboardOverlay-module__HsRBsa__Root",Row:"KeyboardOverlay-module__HsRBsa__Row",Spacer:"KeyboardOverlay-module__HsRBsa__Spacer"})},40378,e=>{"use strict";var s=e.i(43476),a=e.i(932),l=e.i(12631),r=e.i(32865),d=e.i(13070);function o(){let e,o,h,K,b,j,x,N,p,R,C,w,S,O,B,A,H,g,k,T,U,D,P,L,W=(0,a.c)(51),q=(0,r.useRecording)(),z=(0,l.useKeyboardControls)(v),E=(0,l.useKeyboardControls)(_),F=(0,l.useKeyboardControls)(y),G=(0,l.useKeyboardControls)(f),I=(0,l.useKeyboardControls)(m),J=(0,l.useKeyboardControls)(u),M=(0,l.useKeyboardControls)(i),Q=(0,l.useKeyboardControls)(n),V=(0,l.useKeyboardControls)(c),X=(0,l.useKeyboardControls)(t);return q&&"live"!==q.source?null:(W[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)("div",{className:d.default.Spacer}),W[0]=e):e=W[0],W[1]!==z?(o=(0,s.jsx)("div",{className:d.default.Key,"data-pressed":z,children:"W"}),W[1]=z,W[2]=o):o=W[2],W[3]===Symbol.for("react.memo_cache_sentinel")?(h=(0,s.jsx)("div",{className:d.default.Spacer}),W[3]=h):h=W[3],W[4]!==o?(K=(0,s.jsxs)("div",{className:d.default.Row,children:[e,o,h]}),W[4]=o,W[5]=K):K=W[5],W[6]!==F?(b=(0,s.jsx)("div",{className:d.default.Key,"data-pressed":F,children:"A"}),W[6]=F,W[7]=b):b=W[7],W[8]!==E?(j=(0,s.jsx)("div",{className:d.default.Key,"data-pressed":E,children:"S"}),W[8]=E,W[9]=j):j=W[9],W[10]!==G?(x=(0,s.jsx)("div",{className:d.default.Key,"data-pressed":G,children:"D"}),W[10]=G,W[11]=x):x=W[11],W[12]!==b||W[13]!==j||W[14]!==x?(N=(0,s.jsxs)("div",{className:d.default.Row,children:[b,j,x]}),W[12]=b,W[13]=j,W[14]=x,W[15]=N):N=W[15],W[16]!==K||W[17]!==N?(p=(0,s.jsxs)("div",{className:d.default.Column,children:[K,N]}),W[16]=K,W[17]=N,W[18]=p):p=W[18],W[19]===Symbol.for("react.memo_cache_sentinel")?(R=(0,s.jsx)("span",{className:d.default.Arrow,children:"↑"}),W[19]=R):R=W[19],W[20]!==I?(C=(0,s.jsx)("div",{className:d.default.Row,children:(0,s.jsxs)("div",{className:d.default.Key,"data-pressed":I,children:[R," Space"]})}),W[20]=I,W[21]=C):C=W[21],W[22]===Symbol.for("react.memo_cache_sentinel")?(w=(0,s.jsx)("span",{className:d.default.Arrow,children:"↓"}),W[22]=w):w=W[22],W[23]!==J?(S=(0,s.jsx)("div",{className:d.default.Row,children:(0,s.jsxs)("div",{className:d.default.Key,"data-pressed":J,children:[w," Shift"]})}),W[23]=J,W[24]=S):S=W[24],W[25]!==C||W[26]!==S?(O=(0,s.jsxs)("div",{className:d.default.Column,children:[C,S]}),W[25]=C,W[26]=S,W[27]=O):O=W[27],W[28]===Symbol.for("react.memo_cache_sentinel")?(B=(0,s.jsx)("div",{className:d.default.Spacer}),W[28]=B):B=W[28],W[29]!==M?(A=(0,s.jsx)("div",{className:d.default.Key,"data-pressed":M,children:"↑"}),W[29]=M,W[30]=A):A=W[30],W[31]===Symbol.for("react.memo_cache_sentinel")?(H=(0,s.jsx)("div",{className:d.default.Spacer}),W[31]=H):H=W[31],W[32]!==A?(g=(0,s.jsxs)("div",{className:d.default.Row,children:[B,A,H]}),W[32]=A,W[33]=g):g=W[33],W[34]!==V?(k=(0,s.jsx)("div",{className:d.default.Key,"data-pressed":V,children:"←"}),W[34]=V,W[35]=k):k=W[35],W[36]!==Q?(T=(0,s.jsx)("div",{className:d.default.Key,"data-pressed":Q,children:"↓"}),W[36]=Q,W[37]=T):T=W[37],W[38]!==X?(U=(0,s.jsx)("div",{className:d.default.Key,"data-pressed":X,children:"→"}),W[38]=X,W[39]=U):U=W[39],W[40]!==k||W[41]!==T||W[42]!==U?(D=(0,s.jsxs)("div",{className:d.default.Row,children:[k,T,U]}),W[40]=k,W[41]=T,W[42]=U,W[43]=D):D=W[43],W[44]!==g||W[45]!==D?(P=(0,s.jsxs)("div",{className:d.default.Column,children:[g,D]}),W[44]=g,W[45]=D,W[46]=P):P=W[46],W[47]!==O||W[48]!==P||W[49]!==p?(L=(0,s.jsxs)("div",{className:d.default.Root,children:[p,O,P]}),W[47]=O,W[48]=P,W[49]=p,W[50]=L):L=W[50],L)}function t(e){return e.lookRight}function c(e){return e.lookLeft}function n(e){return e.lookDown}function i(e){return e.lookUp}function u(e){return e.down}function m(e){return e.up}function f(e){return e.right}function y(e){return e.left}function _(e){return e.backward}function v(e){return e.forward}e.s(["KeyboardOverlay",()=>o])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/341165a5ae0d70ac.js b/docs/_next/static/chunks/341165a5ae0d70ac.js new file mode 100644 index 00000000..2dda5457 --- /dev/null +++ b/docs/_next/static/chunks/341165a5ae0d70ac.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66069,e=>{"use strict";var r=e.i(932),t=e.i(71645),n=e.i(90072),c=e.i(71753),u=e.i(15080),o=e.i(79123),i=e.i(66093);let l=Math.PI/2-.01;function a(){let e,a,h,d,f,v,E,y,x,g,S,p=(0,r.c)(27),{speedMultiplier:M,touchMode:T,invertDrag:q,invertJoystick:b}=(0,o.useControls)(),L=(0,u.useThree)(m),_=(0,u.useThree)(s),{moveState:k,lookState:F}=(0,i.useJoystick)();p[0]===Symbol.for("react.memo_cache_sentinel")?(e=new n.Euler(0,0,0,"YXZ"),p[0]=e):e=p[0];let R=(0,t.useRef)(e),X=(0,t.useRef)(null);p[1]===Symbol.for("react.memo_cache_sentinel")?(a={x:0,y:0},p[1]=a):a=p[1];let Y=(0,t.useRef)(a);p[2]!==q?(h=()=>q,p[2]=q,p[3]=h):h=p[3];let V=(0,t.useEffectEvent)(h);p[4]===Symbol.for("react.memo_cache_sentinel")?(d=new n.Vector3,p[4]=d):d=p[4];let Z=(0,t.useRef)(d);p[5]===Symbol.for("react.memo_cache_sentinel")?(f=new n.Vector3,p[5]=f):f=p[5];let w=(0,t.useRef)(f);p[6]===Symbol.for("react.memo_cache_sentinel")?(v=new n.Vector3,p[6]=v):v=p[6];let z=(0,t.useRef)(v);return p[7]!==L.quaternion?(E=()=>{R.current.setFromQuaternion(L.quaternion,"YXZ")},p[7]=L.quaternion,p[8]=E):E=p[8],p[9]!==L?(y=[L],p[9]=L,p[10]=y):y=p[10],(0,t.useEffect)(E,y),p[11]!==L.quaternion||p[12]!==V||p[13]!==_.domElement||p[14]!==T?(x=()=>{if("moveLookStick"!==T)return;let e=_.domElement,r=e=>{if(null===X.current)for(;0 {if(null!==X.current)for(let r=0;r {for(let r=0;r {e.removeEventListener("touchstart",r),e.removeEventListener("touchmove",t),e.removeEventListener("touchend",n),e.removeEventListener("touchcancel",n),X.current=null}},p[11]=L.quaternion,p[12]=V,p[13]=_.domElement,p[14]=T,p[15]=x):x=p[15],p[16]!==L||p[17]!==_.domElement||p[18]!==T?(g=[L,_.domElement,T],p[16]=L,p[17]=_.domElement,p[18]=T,p[19]=g):g=p[19],(0,t.useEffect)(x,g),p[20]!==L||p[21]!==b||p[22]!==F.current||p[23]!==k.current||p[24]!==M||p[25]!==T?(S=(e,r)=>{let{force:t,angle:n}=k.current,{force:c,angle:u}=F.current;if("dualStick"===T){if(c>.15){let e=(c-.15)/.85,t=Math.cos(u),n=Math.sin(u),o=b?-1:1;R.current.setFromQuaternion(L.quaternion,"YXZ"),R.current.y=R.current.y-o*t*e*2.5*r,R.current.x=R.current.x+o*n*e*2.5*r,R.current.x=Math.max(-l,Math.min(l,R.current.x)),L.quaternion.setFromEuler(R.current)}if(t>.08){let e=80*M*((t-.08)/.92),c=Math.cos(n),u=Math.sin(n);L.getWorldDirection(Z.current),Z.current.normalize(),w.current.crossVectors(L.up,Z.current).normalize(),z.current.set(0,0,0).addScaledVector(Z.current,u).addScaledVector(w.current,-c),z.current.lengthSq()>0&&(z.current.normalize().multiplyScalar(e*r),L.position.add(z.current))}}else if("moveLookStick"===T&&t>0){let e=80*M*.5;if(L.getWorldDirection(Z.current),Z.current.normalize(),z.current.copy(Z.current).multiplyScalar(e*r),L.position.add(z.current),t>=.15){let e=Math.cos(n),c=Math.sin(n),u=(t-.15)/.85,o=b?-1:1;R.current.setFromQuaternion(L.quaternion,"YXZ"),R.current.y=R.current.y-o*e*u*1.25*r,R.current.x=R.current.x+o*c*u*1.25*r,R.current.x=Math.max(-l,Math.min(l,R.current.x)),L.quaternion.setFromEuler(R.current)}}},p[20]=L,p[21]=b,p[22]=F.current,p[23]=k.current,p[24]=M,p[25]=T,p[26]=S):S=p[26],(0,c.useFrame)(S),null}function s(e){return e.gl}function m(e){return e.camera}e.s(["TouchHandler",()=>a])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/3770acf7d1a6ba0a.js b/docs/_next/static/chunks/3770acf7d1a6ba0a.js new file mode 100644 index 00000000..de444557 --- /dev/null +++ b/docs/_next/static/chunks/3770acf7d1a6ba0a.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,78462,e=>{e.v({PlayPause:"DemoPlaybackControls-module__A_AHSq__PlayPause",Root:"DemoPlaybackControls-module__A_AHSq__Root",Seek:"DemoPlaybackControls-module__A_AHSq__Seek",Speed:"DemoPlaybackControls-module__A_AHSq__Speed",Time:"DemoPlaybackControls-module__A_AHSq__Time"})},94737,e=>{"use strict";var t=e.i(43476),a=e.i(932),o=e.i(71645),n=e.i(32865),l=e.i(78462);let r=[.25,.5,1,2,4];function s(e){let t=Math.floor(e/60),a=Math.floor(e%60);return`${t}:${a.toString().padStart(2,"0")}`}function u(){let e,u,_,p,P,f,g,y,S,b,A,C,k=(0,a.c)(33),T=(0,n.useRecording)(),h=(0,n.useIsPlaying)(),v=(0,n.useCurrentTime)(),N=(0,n.useDuration)(),D=(0,n.useSpeed)(),{play:w,pause:x,seek:E,setSpeed:j}=(0,n.usePlaybackActions)();k[0]!==h||k[1]!==x||k[2]!==w||k[3]!==T?(e=()=>{if(!T)return;let e=e=>{if("Space"!==e.code)return;let t=e.target;"INPUT"===t.tagName||"TEXTAREA"===t.tagName||"SELECT"===t.tagName||"BUTTON"===t.tagName||t.isContentEditable||(e.preventDefault(),h?x():w())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},u=[T,h,w,x],k[0]=h,k[1]=x,k[2]=w,k[3]=T,k[4]=e,k[5]=u):(e=k[4],u=k[5]),(0,o.useEffect)(e,u),k[6]!==E?(_=e=>{E(parseFloat(e.target.value))},k[6]=E,k[7]=_):_=k[7];let R=_;k[8]!==j?(p=e=>{j(parseFloat(e.target.value))},k[8]=j,k[9]=p):p=k[9];let q=p;if(!T||!Number.isFinite(T.duration))return null;let H=h?x:w,F=h?"Pause":"Play",U=h?"❚❚":"▶";k[10]!==H||k[11]!==F||k[12]!==U?(P=(0,t.jsx)("button",{className:l.default.PlayPause,onClick:H,"aria-label":F,autoFocus:!0,children:U}),k[10]=H,k[11]=F,k[12]=U,k[13]=P):P=k[13],k[14]!==v?(f=s(v),k[14]=v,k[15]=f):f=k[15],k[16]!==N?(g=s(N),k[16]=N,k[17]=g):g=k[17];let $=`${f} / ${g}`;return k[18]!==$?(y=(0,t.jsx)("span",{className:l.default.Time,children:$}),k[18]=$,k[19]=y):y=k[19],k[20]!==v||k[21]!==N||k[22]!==R?(S=(0,t.jsx)("input",{className:l.default.Seek,type:"range",min:0,max:N,step:.01,value:v,onChange:R}),k[20]=v,k[21]=N,k[22]=R,k[23]=S):S=k[23],k[24]===Symbol.for("react.memo_cache_sentinel")?(b=r.map(i),k[24]=b):b=k[24],k[25]!==q||k[26]!==D?(A=(0,t.jsx)("select",{className:l.default.Speed,value:D,onChange:q,children:b}),k[25]=q,k[26]=D,k[27]=A):A=k[27],k[28]!==y||k[29]!==S||k[30]!==A||k[31]!==P?(C=(0,t.jsxs)("div",{className:l.default.Root,onKeyDown:m,onPointerDown:d,onClick:c,children:[P,y,S,A]}),k[28]=y,k[29]=S,k[30]=A,k[31]=P,k[32]=C):C=k[32],C}function i(e){return(0,t.jsxs)("option",{value:e,children:[e,"x"]},e)}function c(e){return e.stopPropagation()}function d(e){return e.stopPropagation()}function m(e){return e.stopPropagation()}e.s(["DemoPlaybackControls",()=>u])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/39402d7e86cbc15f.js b/docs/_next/static/chunks/39402d7e86cbc15f.js new file mode 100644 index 00000000..067a95f4 --- /dev/null +++ b/docs/_next/static/chunks/39402d7e86cbc15f.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,85413,e=>{"use strict";var t=Object.defineProperty;class s{constructor(){((e,s,i)=>{let r,l;l=void 0,(r="symbol"!=typeof s?s+"":s)in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[r]=l})(this,"_listeners")}addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let s=this._listeners;void 0===s[e]&&(s[e]=[]),-1===s[e].indexOf(t)&&s[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let s=this._listeners;return void 0!==s[e]&&-1!==s[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let s=this._listeners[e];if(void 0!==s){let e=s.indexOf(t);-1!==e&&s.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let t=this._listeners[e.type];if(void 0!==t){e.target=this;let s=t.slice(0);for(let t=0,i=s.length;ts])},32424,7368,e=>{"use strict";var t=e.i(25645),s=e.i(12979);let i=(0,t.createLogger)("scriptLoader");function r(){return async e=>{let t;try{t=(0,s.getUrlForPath)(e)}catch(t){return i.warn("Script not in manifest: %s (%s)",e,t),null}try{let s=await fetch(t);if(!s.ok)return i.error("Script fetch failed: %s (%d)",e,s.status),null;return await s.text()}catch(t){return i.error("Script fetch error: %s %o",e,t),null}}}e.s(["createScriptLoader",()=>r],32424),e.s(["ignoreScripts",0,["scripts/admin.cs","scripts/ai.cs","scripts/aiBotProfiles.cs","scripts/aiBountyGame.cs","scripts/aiChat.cs","scripts/aiCnH.cs","scripts/aiCTF.cs","scripts/aiDeathMatch.cs","scripts/aiDebug.cs","scripts/aiDefaultTasks.cs","scripts/aiDnD.cs","scripts/aiHumanTasks.cs","scripts/aiHunters.cs","scripts/aiInventory.cs","scripts/aiObjectiveBuilder.cs","scripts/aiObjectives.cs","scripts/aiRabbit.cs","scripts/aiSiege.cs","scripts/aiTDM.cs","scripts/aiTeamHunters.cs","scripts/deathMessages.cs","scripts/graphBuild.cs","scripts/navGraph.cs","scripts/serverTasks.cs","scripts/spdialog.cs"]],7368)},81405,(e,t,s)=>{var i;e.e,(i=function(){function e(e){return r.appendChild(e.dom),e}function t(e){for(var t=0;t n+1e3&&(c.update(1e3*a/(e-n),100),n=e,a=0,d)){var t=performance.memory;d.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){l=this.end()},domElement:r,setMode:t}}).Panel=function(e,t,s){var i=1/0,r=0,l=Math.round,n=l(window.devicePixelRatio||1),a=80*n,c=48*n,o=3*n,d=2*n,f=3*n,u=15*n,p=74*n,m=30*n,h=document.createElement("canvas");h.width=a,h.height=c,h.style.cssText="width:80px;height:48px";var v=h.getContext("2d");return v.font="bold "+9*n+"px Helvetica,Arial,sans-serif",v.textBaseline="top",v.fillStyle=s,v.fillRect(0,0,a,c),v.fillStyle=t,v.fillText(e,o,d),v.fillRect(f,u,p,m),v.fillStyle=s,v.globalAlpha=.9,v.fillRect(f,u,p,m),{dom:h,update:function(c,b){i=Math.min(i,c),r=Math.max(r,c),v.fillStyle=s,v.globalAlpha=1,v.fillRect(0,0,a,u),v.fillStyle=t,v.fillText(l(c)+" "+e+" ("+l(i)+"-"+l(r)+")",o,d),v.drawImage(h,f+n,u,p-n,m,f,u,p-n,m),v.fillRect(f+p-n,u,n,m),v.fillStyle=s,v.globalAlpha=.9,v.fillRect(f+p-n,u,n,l((1-c/b)*m))}}},t.exports=i},55141,e=>{e.v({AxisLabel:"DebugElements-module__Cmeo9W__AxisLabel",StatsPanel:"DebugElements-module__Cmeo9W__StatsPanel"})},86855,e=>{"use strict";var t=e.i(43476),s=e.i(932),i=e.i(71645),r=e.i(40859),r=r,l=r,n=e.i(81405);function a(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function c({showPanel:e=0,className:t,parent:s}){let c=function(e,t=[],s){let[r,l]=i.useState();return i.useLayoutEffect(()=>{let t=e();return l(t),a(void 0,t),()=>a(void 0,null)},t),r}(()=>new n.default,[]);return i.useEffect(()=>{if(c){let i=s&&s.current||document.body;c.showPanel(e),null==i||i.appendChild(c.dom);let n=(null!=t?t:"").split(" ").filter(e=>e);n.length&&c.dom.classList.add(...n);let a=(0,r.j)(()=>c.begin()),o=(0,l.k)(()=>c.end());return()=>{n.length&&c.dom.classList.remove(...n),null==i||i.removeChild(c.dom),a(),o()}}},[s,c,t,e]),null}var o=e.i(60099),d=e.i(55141);function f(){let e,r,l,n,a,f,u,p,m,h,v=(0,s.c)(10),b=(0,i.useRef)(null);return v[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{let e=b.current;e&&e.setColors("rgb(153, 255, 0)","rgb(0, 153, 255)","rgb(255, 153, 0)")},v[0]=e):e=v[0],(0,i.useEffect)(e),v[1]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(c,{className:d.default.StatsPanel}),v[1]=r):r=v[1],v[2]===Symbol.for("react.memo_cache_sentinel")?(l=[70],v[2]=l):l=v[2],v[3]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("axesHelper",{ref:b,args:l,renderOrder:999,children:(0,t.jsx)("lineBasicMaterial",{depthTest:!1,depthWrite:!1,fog:!1,vertexColors:!0})}),v[3]=n):n=v[3],v[4]===Symbol.for("react.memo_cache_sentinel")?(a=[80,0,0],v[4]=a):a=v[4],v[5]===Symbol.for("react.memo_cache_sentinel")?(f=(0,t.jsx)(o.Html,{position:a,center:!0,children:(0,t.jsx)("span",{className:d.default.AxisLabel,"data-axis":"y",children:"Y"})}),v[5]=f):f=v[5],v[6]===Symbol.for("react.memo_cache_sentinel")?(u=[0,80,0],v[6]=u):u=v[6],v[7]===Symbol.for("react.memo_cache_sentinel")?(p=(0,t.jsx)(o.Html,{position:u,center:!0,children:(0,t.jsx)("span",{className:d.default.AxisLabel,"data-axis":"z",children:"Z"})}),v[7]=p):p=v[7],v[8]===Symbol.for("react.memo_cache_sentinel")?(m=[0,0,80],v[8]=m):m=v[8],v[9]===Symbol.for("react.memo_cache_sentinel")?(h=(0,t.jsxs)(t.Fragment,{children:[r,n,f,p,(0,t.jsx)(o.Html,{position:m,center:!0,children:(0,t.jsx)("span",{className:d.default.AxisLabel,"data-axis":"x",children:"X"})})]}),v[9]=h):h=v[9],h}e.s(["DebugElements",()=>f],86855)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/1a2c6dc513278881.js b/docs/_next/static/chunks/3b423df62fc674df.js similarity index 92% rename from docs/_next/static/chunks/1a2c6dc513278881.js rename to docs/_next/static/chunks/3b423df62fc674df.js index 8f44e0c5..a7d8caf6 100644 --- a/docs/_next/static/chunks/1a2c6dc513278881.js +++ b/docs/_next/static/chunks/3b423df62fc674df.js @@ -5,4 +5,4 @@ uniform float shapeAmbientFactor; // Apply shape-specific lighting multipliers reflectedLight.directDiffuse *= shapeDirectionalFactor; reflectedLight.indirectDiffuse *= shapeAmbientFactor; -`)}e.s(["injectShapeLighting",()=>R],6655)},85557,e=>{"use strict";e.s(["ANIM_TRANSITION_TIME",()=>A,"DEFAULT_EYE_HEIGHT",()=>o,"STREAM_TICK_SEC",()=>l,"_r90",()=>h,"_r90inv",()=>d,"entityTypeColor",()=>D,"getKeyframeAtTime",()=>F,"getPosedNodeTransform",()=>E,"processShapeScene",()=>g,"replaceWithShapeMaterial",()=>G,"setQuaternionFromDir",()=>M,"setupEffectTexture",()=>m,"torqueHorizontalFovToThreeVerticalFov",()=>f,"torqueVecToThree",()=>p],85557);var t=e.i(90072),r=e.i(91907),s=e.i(25947),n=e.i(71505),i=e.i(75567),a=e.i(12979);let o=2.1,A=.25,l=.032,B=new t.Vector3,c=new t.Vector3,u=new t.Matrix4,C=new t.Vector3(0,1,0),h=new t.Quaternion().setFromAxisAngle(new t.Vector3(0,1,0),Math.PI/2),d=h.clone().invert();function f(e,t){return 180*(2*Math.atan(Math.tan(Math.max(.01,Math.min(179.99,e))*Math.PI/180/2)/(Number.isFinite(t)&&t>1e-6?t:4/3)))/Math.PI}function m(e){e.wrapS=t.ClampToEdgeWrapping,e.wrapT=t.ClampToEdgeWrapping,e.minFilter=t.LinearFilter,e.magFilter=t.LinearFilter,e.colorSpace=t.NoColorSpace,e.flipY=!1,e.needsUpdate=!0}function p(e,t){return t.set(e[1],e[2],e[0])}function M(e,t){B.crossVectors(e,C),1e-8>B.lengthSq()&&B.set(-1,0,0),B.normalize(),c.crossVectors(B,e).normalize(),u.set(B.x,e.x,c.x,0,B.y,e.y,c.y,0,B.z,e.z,c.z,0,0,0,0,1),t.setFromRotationMatrix(u)}function F(e,t){if(0===e.length)return null;if(t<=e[0].time)return e[0];if(t>=e[e.length-1].time)return e[e.length-1];let r=0,s=e.length-1;for(;s-r>1;){let n=r+s>>1;e[n].time<=t?r=n:s=n}return e[r]}function E(e,r,s,n){let i=e.clone(!0),a=r.find(e=>"Root"===e.name);if(a){let e=new t.AnimationMixer(i);if(e.clipAction(a).play(),n)for(let t of n){let s=r.find(e=>e.name.toLowerCase()===t.toLowerCase());if(s){let t=e.clipAction(s);t.time=s.duration/2,t.setEffectiveTimeScale(0),t.play()}}e.setTime(0)}i.updateMatrixWorld(!0);let o=null,A=null;return(i.traverse(e=>{o||e.name!==s||(o=new t.Vector3,A=new t.Quaternion,e.getWorldPosition(o),e.getWorldQuaternion(A))}),o&&A)?{position:o,quaternion:A}:null}function G(e,s,n=!1){let o=e.userData?.resource_path,A=new Set(e.userData?.flag_names??[]);if(!o){let s=new t.MeshLambertMaterial({color:e.color,side:2,reflectivity:0});return(0,r.applyShapeShaderModifications)(s),{material:s}}if(A.has("IflMaterial")){let t=(0,r.createMaterialFromFlags)(e,null,A,n,s);if(Array.isArray(t)){let e=t[1];return{material:e,backMaterial:t[0],initialize:(t,r)=>I(e,o,t,r)}}return{material:t,initialize:(e,r)=>I(t,o,e,r)}}let l=(0,a.textureToUrl)(o),B=(0,i.loadTexture)(l),c=A.has("Translucent");n||c?(0,i.setupTexture)(B,{disableMipmaps:!0}):(0,i.setupTexture)(B);let u=(0,r.createMaterialFromFlags)(e,B,A,n,s);return Array.isArray(u)?{material:u[1],backMaterial:u[0]}:{material:u}}async function I(e,t,r,s){let i=`textures/${t}.ifl`,a=await (0,n.loadIflAtlas)(i);e.map=a.texture,e.needsUpdate=!0;let o=!1,A=r.onBeforeRender;return r.onBeforeRender=function(...e){A?.apply(this,e),o||(0,n.updateAtlasFrame)(a,(0,n.getFrameIndexForTime)(a,s()))},()=>{o=!0,r.onBeforeRender=A??(()=>{})}}function g(e,t){var r;let n,i=[],a=!!t&&(0,s.isOrganicShape)(t),o=null;e.traverse(e=>{!o&&e.skeleton&&(o=e.skeleton)});let A=o?(r=o,n=new Set,r.bones.forEach((e,t)=>{e.name.match(/^Hulk/i)&&n.add(t)}),n):new Set,l=[];for(let{parent:t,mesh:r}of(e.traverse(e=>{if(!e.isMesh)return;if(e.name.match(/^Hulk/i)||e.material?.name==="Unassigned"){e.visible=!1;return}let t=!!e.userData?.vis_sequence;if((e.userData?.vis??1)<.01&&(e.visible=!1),e.geometry){let t=function(e,t){if(0===t.size||!e.attributes.skinIndex)return e;let r=e.attributes.skinIndex,s=e.attributes.skinWeight,n=e.index,i=Array(r.count).fill(!1);for(let e=0;e .01&&t.has(a)){i[e]=!0;break}}if(n){let t=[],r=n.array;for(let e=0;e 1){let t=0,r=0,s=0;for(let i of e)t+=n[3*i],r+=n[3*i+1],s+=n[3*i+2];let i=Math.sqrt(t*t+r*r+s*s);for(let a of(i>0&&(t/=i,r/=i,s/=i),e))n[3*a]=t,n[3*a+1]=r,n[3*a+2]=s}r.needsUpdate=!0}(t=t.clone()),e.geometry=t}let r=t?1:e.userData?.vis??1;if(Array.isArray(e.material))e.material=e.material.map(t=>{let s=G(t,r,a);if(s.initialize&&i.push({mesh:e,initialize:s.initialize}),s.backMaterial&&e.parent){let t=e.clone();t.material=s.backMaterial,l.push({parent:e.parent,mesh:t})}return s.material});else if(e.material){let t=G(e.material,r,a);if(t.initialize&&i.push({mesh:e,initialize:t.initialize}),e.material=t.material,t.backMaterial&&e.parent){let r=e.clone();r.material=t.backMaterial,l.push({parent:e.parent,mesh:r})}}}),l))t.add(r);return i}function D(e){switch(e.toLowerCase()){case"player":return"#00ff88";case"vehicle":return"#ff8800";case"projectile":return"#ff0044";case"deployable":return"#ffcc00";default:return"#8888ff"}}},91907,e=>{"use strict";e.s(["ShapeRenderer",()=>T,"applyShapeShaderModifications",()=>F,"createMaterialFromFlags",()=>E,"useStaticShape",()=>G]);var t=e.i(43476),r=e.i(932),s=e.i(71645),n=e.i(8597),i=e.i(78140),a=(e.i(47071),e.i(71753)),o=e.i(12979),A=e.i(90072),l=e.i(82816),B=(e.i(75567),e.i(79123)),c=e.i(25947);e.i(13876);var u=e.i(58647),C=e.i(89887),h=e.i(71505),d=e.i(47021),f=e.i(48066),m=e.i(6655),p=e.i(85557);function M(){let{recording:e}=u.engineStore.getState().playback;return null!=e?(0,u.effectNow)()/1e3:performance.now()/1e3}function F(e){e.onBeforeCompile=t=>{(0,d.injectCustomFog)(t,f.globalFogUniforms),e instanceof A.MeshLambertMaterial&&(0,m.injectShapeLighting)(t)}}function E(e,t,r,s,n=1,i=!1){let a=r.has("Translucent"),o=r.has("Additive"),l=r.has("SelfIlluminating"),B=n<1||i;if(l||o){let e=o||a||B,r=new A.MeshBasicMaterial({map:t,side:2,transparent:e,depthWrite:!e,alphaTest:0,fog:!0,...B&&{opacity:n},...o&&{blending:A.AdditiveBlending}});return F(r),r}if(s||a){let e={map:t,transparent:B,alphaTest:.5*!B,...B&&{opacity:n,depthWrite:!1},reflectivity:0},r=new A.MeshLambertMaterial({...e,side:1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),s=new A.MeshLambertMaterial({...e,side:0});return F(r),F(s),[r,s]}let c=new A.MeshLambertMaterial({map:t,side:2,reflectivity:0,...B&&{transparent:!0,opacity:n,depthWrite:!1}});return F(c),c}function G(e){let t,s=(0,r.c)(2);s[0]!==e?(t=(0,o.shapeToUrl)(e),s[0]=e,s[1]=t):t=s[1];let n=t;return(0,i.useGLTF)(n)}function I(e){let s,n,i,a,o=(0,r.c)(9),{color:A,label:l}=e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)("boxGeometry",{args:[10,10,10]}),o[0]=s):s=o[0],o[1]!==A?(n=(0,t.jsx)("meshStandardMaterial",{color:A,wireframe:!0}),o[1]=A,o[2]=n):n=o[2],o[3]!==A||o[4]!==l?(i=l?(0,t.jsx)(C.FloatingLabel,{color:A,children:l}):null,o[3]=A,o[4]=l,o[5]=i):i=o[5],o[6]!==n||o[7]!==i?(a=(0,t.jsxs)("mesh",{children:[s,n,i]}),o[6]=n,o[7]=i,o[8]=a):a=o[8],a}function g(e){let s,n=(0,r.c)(4),{color:i,label:a}=e,{debugMode:o}=(0,B.useDebug)();return n[0]!==i||n[1]!==o||n[2]!==a?(s=o?(0,t.jsx)(I,{color:i,label:a}):null,n[0]=i,n[1]=o,n[2]=a,n[3]=s):s=n[3],s}let D=new Set(["octahedron.dts"]);function R(e){let s,n,i,a,o=(0,r.c)(6),{label:A}=e,{debugMode:l}=(0,B.useDebug)();return l?(o[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)("icosahedronGeometry",{args:[1,1]}),n=(0,t.jsx)("meshBasicMaterial",{color:"cyan",wireframe:!0}),o[0]=s,o[1]=n):(s=o[0],n=o[1]),o[2]!==A?(i=A?(0,t.jsx)(C.FloatingLabel,{color:"cyan",children:A}):null,o[2]=A,o[3]=i):i=o[3],o[4]!==i?(a=(0,t.jsxs)("mesh",{children:[s,n,i]}),o[4]=i,o[5]=a):a=o[5],a):null}let T=(0,s.memo)(function(e){let i,a,o,A,l,B=(0,r.c)(17),{loadingColor:u,streamEntity:C,children:h}=e,d=void 0===u?"yellow":u,{object:f,shapeName:m}=(0,c.useShapeInfo)();if(!m){let e,r=`${f?._id}: `;return B[0]!==r?(e=(0,t.jsx)(g,{color:"orange",label:r}),B[0]=r,B[1]=e):e=B[1],e}if(D.has(m.toLowerCase())){let e,r=`${f?._id}: ${m}`;return B[2]!==r?(e=(0,t.jsx)(R,{label:r}),B[2]=r,B[3]=e):e=B[3],e}let p=`${f?._id}: ${m}`;return B[4]!==p?(i=(0,t.jsx)(g,{color:"red",label:p}),B[4]=p,B[5]=i):i=B[5],B[6]!==d?(a=(0,t.jsx)(I,{color:d}),B[6]=d,B[7]=a):a=B[7],B[8]!==C?(o=(0,t.jsx)(J,{streamEntity:C}),B[8]=C,B[9]=o):o=B[9],B[10]!==h||B[11]!==a||B[12]!==o?(A=(0,t.jsxs)(s.Suspense,{fallback:a,children:[o,h]}),B[10]=h,B[11]=a,B[12]=o,B[13]=A):A=B[13],B[14]!==i||B[15]!==A?(l=(0,t.jsx)(n.ErrorBoundary,{fallback:i,children:A}),B[14]=i,B[15]=A,B[16]=l):l=B[16],l}),H=(0,s.memo)(function({gltf:e,streamEntity:r}){let{object:n,shapeName:i}=(0,c.useShapeInfo)(),{debugMode:o}=(0,B.useDebug)(),{animationEnabled:d}=(0,B.useSettings)(),f=(0,u.useEngineSelector)(e=>e.runtime.runtime),{clonedScene:m,mixer:F,clipsByName:E,visNodesBySequence:G,iflMeshes:I}=(0,s.useMemo)(()=>{let t=l.clone(e.scene),r=[];for(let{mesh:e,hasVisSequence:s}of(t.traverse(e=>{if(!e.isMesh||!e.material)return;let t=Array.isArray(e.material)?e.material[0]:e.material;if(!t?.userData)return;let s=new Set(t.userData.flag_names??[]),n=t.userData.resource_path;if(s.has("IflMaterial")&&n){let t=e.userData,s=t?.ifl_sequence?String(t.ifl_sequence).toLowerCase():void 0,i=t?.ifl_duration?Number(t.ifl_duration):void 0,a=t?.ifl_sequence?!!t.ifl_cyclic:void 0,o=t?.ifl_tool_begin!=null?Number(t.ifl_tool_begin):void 0;r.push({mesh:e,iflPath:`textures/${n}.ifl`,hasVisSequence:!!t?.vis_sequence,iflSequence:s,iflDuration:i,iflCyclic:a,iflToolBegin:o})}}),(0,p.processShapeScene)(t,i??void 0),r))s||(e.visible=!0);let s=new Map;t.traverse(e=>{if(!e.isMesh)return;let t=e.userData;if(!t)return;let r=t.vis_keyframes,n=t.vis_duration,i=(t.vis_sequence??"").toLowerCase();if(!i||!Array.isArray(r)||r.length<=1||!n||n<=0)return;let a=s.get(i);a||(a=[],s.set(i,a)),a.push({mesh:e,keyframes:r,duration:n,cyclic:!!t.vis_cyclic})});let n=new Map;for(let t of e.animations)n.set(t.name.toLowerCase(),t);let a=n.size>0?new A.AnimationMixer(t):null;return{clonedScene:t,mixer:a,clipsByName:n,visNodesBySequence:s,iflMeshes:r}},[e]),g=(0,s.useRef)(new Map),D=(0,s.useRef)(new Map),R=(0,s.useRef)([]),T=(0,s.useRef)(0);(0,s.useRef)(d).current=d;let H=(0,s.useRef)(r);H.current=r;let J=(0,s.useRef)(null),b=(0,s.useRef)(null),y=(0,s.useRef)(void 0);(0,s.useEffect)(()=>{for(let e of(R.current=[],D.current.clear(),I))(0,h.loadIflAtlas)(e.iflPath).then(t=>{let r=Array.isArray(e.mesh.material)?e.mesh.material[0]:e.mesh.material;r&&(r.map=t.texture,r.needsUpdate=!0);let s={atlas:t,sequenceName:e.iflSequence,sequenceDuration:e.iflDuration,cyclic:e.iflCyclic,toolBegin:e.iflToolBegin};R.current.push(s),D.current.set(e.mesh,t)}).catch(t=>{console.warn(`[ShapeModel] Failed to load IFL atlas for ${e.iflPath}:`,t)})},[I]);let L=(0,s.useMemo)(()=>{let t=new Map,r=e.scene.userData?.dts_sequence_names,s=e.scene.userData?.dts_sequence_cyclic;if("string"==typeof r&&"string"==typeof s)try{let e=JSON.parse(r),n=JSON.parse(s);for(let r=0;r {let e=g.current,t=null==H.current;function r(t,r){let n=r.toLowerCase();s(t);let i=E.get(n),a=G.get(n),o={sequence:n,startTime:M()};if(i&&F){let e=F.clipAction(i);L.get(n)??!0?e.setLoop(A.LoopRepeat,1/0):(e.setLoop(A.LoopOnce,1),e.clampWhenFinished=!0),e.reset().play(),o.action=e}if(a){for(let e of a)!function(e){if(e.mesh.visible=!0,e.mesh.material?.isMeshStandardMaterial){let t=e.mesh.material,r=(0,p.replaceWithShapeMaterial)(t,e.mesh.userData?.vis??0);e.mesh.material=r.material}e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.transparent=!0,e.mesh.material.depthWrite=!1);let t=D.current.get(e.mesh);t&&e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.map=t.texture,e.mesh.material.needsUpdate=!0)}(e);o.visNodes=a}e.set(t,o)}function s(t){let r=e.get(t);if(r){if(r.action&&r.action.stop(),r.visNodes)for(let e of r.visNodes)e.mesh.visible=!1,e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.opacity=e.keyframes[0]);e.delete(t)}}if(J.current=r,b.current=s,!t)return()=>{for(let t of(J.current=null,b.current=null,y.current=void 0,[...e.keys()]))s(t)};let i=[];for(let[t,a]of(f&&(i.push(f.$.onMethodCalled("ShapeBase","playThread",(e,t,s)=>{e._id===n?._id&&r(Number(t),String(s))})),i.push(f.$.onMethodCalled("ShapeBase","stopThread",(e,t)=>{e._id===n?._id&&s(Number(t))})),i.push(f.$.onMethodCalled("ShapeBase","pauseThread",(t,r)=>{if(t._id!==n?._id)return;let s=e.get(Number(r));s?.action&&(s.action.paused=!0)}))),[[0,"power"],[1,"ambient"]]))(E.has(a)||G.has(a))&&r(t,a);return()=>{for(let t of(i.forEach(e=>e()),J.current=null,b.current=null,y.current=void 0,[...e.keys()]))s(t)}},[F,E,G,L,n,f]);let x=(0,s.useMemo)(()=>{let t=e.scene.userData?.dts_sequence_names;if("string"==typeof t)try{return JSON.parse(t).map(e=>e.toLowerCase())}catch{}return e.animations.map(e=>e.name.toLowerCase())},[e]);return(0,a.useFrame)((e,t)=>{let r=g.current,s=null!=H.current,n=u.engineStore.getState().playback,i=s?"playing"===n.status?t*n.rate:0:t,a=H.current?.threads,o=y.current;if(a!==o){let e=J.current,t=b.current;if(e&&t){y.current=a;let s=[];if(a)for(let e of a)s[e.index]=e;let n=[];if(o)for(let e of o)n[e.index]=e;let i=Math.max(s.length,n.length);for(let a=0;a0)for(let e of(T.current+=i,l)){if(!d){(0,h.updateAtlasFrame)(e.atlas,0);continue}if(e.sequenceName&&e.sequenceDuration){let t=0;for(let[,s]of r)if(s.sequence===e.sequenceName){let r=M()-s.startTime,n=e.sequenceDuration;t=(e.cyclic?r/n%1:Math.min(r/n,1))*n+(e.toolBegin??0);break}(0,h.updateAtlasFrame)(e.atlas,(0,h.getFrameIndexForTime)(e.atlas,t))}else(0,h.updateAtlasFrame)(e.atlas,(0,h.getFrameIndexForTime)(e.atlas,T.current))}}),(0,t.jsxs)("group",{rotation:[0,Math.PI/2,0],children:[(0,t.jsx)("primitive",{object:m}),o?(0,t.jsxs)(C.FloatingLabel,{children:[n?._id,": ",i]}):null]})});function J(e){let s,n=(0,r.c)(3),{streamEntity:i}=e,{shapeName:a}=(0,c.useShapeInfo)(),o=G(a);return n[0]!==o||n[1]!==i?(s=(0,t.jsx)(H,{gltf:o,streamEntity:i}),n[0]=o,n[1]=i,n[2]=s):s=n[2],s}}]); \ No newline at end of file +`)}e.s(["injectShapeLighting",()=>R],6655)},85557,e=>{"use strict";e.s(["ANIM_TRANSITION_TIME",()=>A,"DEFAULT_EYE_HEIGHT",()=>o,"STREAM_TICK_SEC",()=>l,"_r90",()=>h,"_r90inv",()=>d,"entityTypeColor",()=>D,"getKeyframeAtTime",()=>F,"getPosedNodeTransform",()=>E,"processShapeScene",()=>g,"replaceWithShapeMaterial",()=>G,"setQuaternionFromDir",()=>M,"setupEffectTexture",()=>m,"torqueHorizontalFovToThreeVerticalFov",()=>f,"torqueVecToThree",()=>p],85557);var t=e.i(90072),r=e.i(91907),s=e.i(25947),n=e.i(71505),i=e.i(75567),a=e.i(12979);let o=2.1,A=.25,l=.032,B=new t.Vector3,c=new t.Vector3,u=new t.Matrix4,C=new t.Vector3(0,1,0),h=new t.Quaternion().setFromAxisAngle(new t.Vector3(0,1,0),Math.PI/2),d=h.clone().invert();function f(e,t){return 180*(2*Math.atan(Math.tan(Math.max(.01,Math.min(179.99,e))*Math.PI/180/2)/(Number.isFinite(t)&&t>1e-6?t:4/3)))/Math.PI}function m(e){e.wrapS=t.ClampToEdgeWrapping,e.wrapT=t.ClampToEdgeWrapping,e.minFilter=t.LinearFilter,e.magFilter=t.LinearFilter,e.colorSpace=t.NoColorSpace,e.flipY=!1,e.needsUpdate=!0}function p(e,t){return t.set(e[1],e[2],e[0])}function M(e,t){B.crossVectors(e,C),1e-8>B.lengthSq()&&B.set(-1,0,0),B.normalize(),c.crossVectors(B,e).normalize(),u.set(B.x,e.x,c.x,0,B.y,e.y,c.y,0,B.z,e.z,c.z,0,0,0,0,1),t.setFromRotationMatrix(u)}function F(e,t){if(0===e.length)return null;if(t<=e[0].time)return e[0];if(t>=e[e.length-1].time)return e[e.length-1];let r=0,s=e.length-1;for(;s-r>1;){let n=r+s>>1;e[n].time<=t?r=n:s=n}return e[r]}function E(e,r,s,n){let i=e.clone(!0),a=r.find(e=>"Root"===e.name);if(a){let e=new t.AnimationMixer(i);if(e.clipAction(a).play(),n)for(let t of n){let s=r.find(e=>e.name.toLowerCase()===t.toLowerCase());if(s){let t=e.clipAction(s);t.time=s.duration/2,t.setEffectiveTimeScale(0),t.play()}}e.setTime(0)}i.updateMatrixWorld(!0);let o=null,A=null;return(i.traverse(e=>{o||e.name!==s||(o=new t.Vector3,A=new t.Quaternion,e.getWorldPosition(o),e.getWorldQuaternion(A))}),o&&A)?{position:o,quaternion:A}:null}function G(e,s,n=!1){let o=e.userData?.resource_path,A=new Set(e.userData?.flag_names??[]);if(!o){let s=new t.MeshLambertMaterial({color:e.color,side:2,reflectivity:0});return(0,r.applyShapeShaderModifications)(s),{material:s}}if(A.has("IflMaterial")){let t=(0,r.createMaterialFromFlags)(e,null,A,n,s);if(Array.isArray(t)){let e=t[1];return{material:e,backMaterial:t[0],initialize:(t,r)=>I(e,o,t,r)}}return{material:t,initialize:(e,r)=>I(t,o,e,r)}}let l=(0,a.textureToUrl)(o),B=(0,i.loadTexture)(l),c=A.has("Translucent");n||c?(0,i.setupTexture)(B,{disableMipmaps:!0}):(0,i.setupTexture)(B);let u=(0,r.createMaterialFromFlags)(e,B,A,n,s);return Array.isArray(u)?{material:u[1],backMaterial:u[0]}:{material:u}}async function I(e,t,r,s){let i=`textures/${t}.ifl`,a=await (0,n.loadIflAtlas)(i);e.map=a.texture,e.needsUpdate=!0;let o=!1,A=r.onBeforeRender;return r.onBeforeRender=function(...e){A?.apply(this,e),o||(0,n.updateAtlasFrame)(a,(0,n.getFrameIndexForTime)(a,s()))},()=>{o=!0,r.onBeforeRender=A??(()=>{})}}function g(e,t){var r;let n,i=[],a=!!t&&(0,s.isOrganicShape)(t),o=null;e.traverse(e=>{!o&&e.skeleton&&(o=e.skeleton)});let A=o?(r=o,n=new Set,r.bones.forEach((e,t)=>{e.name.match(/^Hulk/i)&&n.add(t)}),n):new Set,l=[];for(let{parent:t,mesh:r}of(e.traverse(e=>{if(!e.isMesh)return;if(e.name.match(/^Hulk/i)||e.material?.name==="Unassigned"){e.visible=!1;return}let t=!!e.userData?.vis_sequence;if((e.userData?.vis??1)<.01&&(e.visible=!1),e.geometry){let t=function(e,t){if(0===t.size||!e.attributes.skinIndex)return e;let r=e.attributes.skinIndex,s=e.attributes.skinWeight,n=e.index,i=Array(r.count).fill(!1);for(let e=0;e .01&&t.has(a)){i[e]=!0;break}}if(n){let t=[],r=n.array;for(let e=0;e 1){let t=0,r=0,s=0;for(let i of e)t+=n[3*i],r+=n[3*i+1],s+=n[3*i+2];let i=Math.sqrt(t*t+r*r+s*s);for(let a of(i>0&&(t/=i,r/=i,s/=i),e))n[3*a]=t,n[3*a+1]=r,n[3*a+2]=s}r.needsUpdate=!0}(t=t.clone()),e.geometry=t}let r=t?1:e.userData?.vis??1;if(Array.isArray(e.material))e.material=e.material.map(t=>{let s=G(t,r,a);if(s.initialize&&i.push({mesh:e,initialize:s.initialize}),s.backMaterial&&e.parent){let t=e.clone();t.material=s.backMaterial,l.push({parent:e.parent,mesh:t})}return s.material});else if(e.material){let t=G(e.material,r,a);if(t.initialize&&i.push({mesh:e,initialize:t.initialize}),e.material=t.material,t.backMaterial&&e.parent){let r=e.clone();r.material=t.backMaterial,l.push({parent:e.parent,mesh:r})}}}),l))t.add(r);return i}function D(e){switch(e.toLowerCase()){case"player":return"#00ff88";case"vehicle":return"#ff8800";case"projectile":return"#ff0044";case"deployable":return"#ffcc00";default:return"#8888ff"}}},91907,e=>{"use strict";e.s(["ShapePlaceholder",()=>D,"ShapeRenderer",()=>J,"applyShapeShaderModifications",()=>G,"createMaterialFromFlags",()=>I,"useStaticShape",()=>g]);var t=e.i(43476),r=e.i(932),s=e.i(71645),n=e.i(8597),i=e.i(78140),a=(e.i(47071),e.i(71753)),o=e.i(25645),A=e.i(12979),l=e.i(90072),B=e.i(82816),c=(e.i(75567),e.i(79123)),u=e.i(25947),C=e.i(58647),h=e.i(89887),d=e.i(71505),f=e.i(47021),m=e.i(48066),p=e.i(6655),M=e.i(85557);let F=(0,o.createLogger)("GenericShape");function E(){let{recording:e}=C.engineStore.getState().playback;return null!=e?(0,C.effectNow)()/1e3:performance.now()/1e3}function G(e){e.onBeforeCompile=t=>{(0,f.injectCustomFog)(t,m.globalFogUniforms),e instanceof l.MeshLambertMaterial&&(0,p.injectShapeLighting)(t)}}function I(e,t,r,s,n=1,i=!1){let a=r.has("Translucent"),o=r.has("Additive"),A=r.has("SelfIlluminating"),B=n<1||i;if(A||o){let e=o||a||B,r=new l.MeshBasicMaterial({map:t,side:2,transparent:e,depthWrite:!e,alphaTest:0,fog:!0,...B&&{opacity:n},...o&&{blending:l.AdditiveBlending}});return G(r),r}if(s||a){let e={map:t,transparent:B,alphaTest:.5*!B,...B&&{opacity:n,depthWrite:!1},reflectivity:0},r=new l.MeshLambertMaterial({...e,side:1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),s=new l.MeshLambertMaterial({...e,side:0});return G(r),G(s),[r,s]}let c=new l.MeshLambertMaterial({map:t,side:2,reflectivity:0,...B&&{transparent:!0,opacity:n,depthWrite:!1}});return G(c),c}function g(e){let t,s=(0,r.c)(2);s[0]!==e?(t=(0,A.shapeToUrl)(e),s[0]=e,s[1]=t):t=s[1];let n=t;return(0,i.useGLTF)(n)}function D(e){let s,n,i,a,o=(0,r.c)(9),{color:A,label:l}=e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)("boxGeometry",{args:[10,10,10]}),o[0]=s):s=o[0],o[1]!==A?(n=(0,t.jsx)("meshStandardMaterial",{color:A,wireframe:!0}),o[1]=A,o[2]=n):n=o[2],o[3]!==A||o[4]!==l?(i=l?(0,t.jsx)(h.FloatingLabel,{color:A,children:l}):null,o[3]=A,o[4]=l,o[5]=i):i=o[5],o[6]!==n||o[7]!==i?(a=(0,t.jsxs)("mesh",{children:[s,n,i]}),o[6]=n,o[7]=i,o[8]=a):a=o[8],a}function R(e){let s,n=(0,r.c)(4),{color:i,label:a}=e,{debugMode:o}=(0,c.useDebug)();return n[0]!==i||n[1]!==o||n[2]!==a?(s=o?(0,t.jsx)(D,{color:i,label:a}):null,n[0]=i,n[1]=o,n[2]=a,n[3]=s):s=n[3],s}let T=new Set(["octahedron.dts"]);function H(e){let s,n,i,a,o=(0,r.c)(6),{label:A}=e,{debugMode:l}=(0,c.useDebug)();return l?(o[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)("icosahedronGeometry",{args:[1,1]}),n=(0,t.jsx)("meshBasicMaterial",{color:"cyan",wireframe:!0}),o[0]=s,o[1]=n):(s=o[0],n=o[1]),o[2]!==A?(i=A?(0,t.jsx)(h.FloatingLabel,{color:"cyan",children:A}):null,o[2]=A,o[3]=i):i=o[3],o[4]!==i?(a=(0,t.jsxs)("mesh",{children:[s,n,i]}),o[4]=i,o[5]=a):a=o[5],a):null}let J=(0,s.memo)(function(e){let i,a,o,A,l,B=(0,r.c)(17),{loadingColor:c,streamEntity:C,children:h}=e,d=void 0===c?"yellow":c,{object:f,shapeName:m}=(0,u.useShapeInfo)();if(!m){let e,r=`${f?._id}: `;return B[0]!==r?(e=(0,t.jsx)(R,{color:"orange",label:r}),B[0]=r,B[1]=e):e=B[1],e}if(T.has(m.toLowerCase())){let e,r=`${f?._id}: ${m}`;return B[2]!==r?(e=(0,t.jsx)(H,{label:r}),B[2]=r,B[3]=e):e=B[3],e}let p=`${f?._id}: ${m}`;return B[4]!==p?(i=(0,t.jsx)(R,{color:"red",label:p}),B[4]=p,B[5]=i):i=B[5],B[6]!==d?(a=(0,t.jsx)(D,{color:d}),B[6]=d,B[7]=a):a=B[7],B[8]!==C?(o=(0,t.jsx)(y,{streamEntity:C}),B[8]=C,B[9]=o):o=B[9],B[10]!==h||B[11]!==a||B[12]!==o?(A=(0,t.jsxs)(s.Suspense,{fallback:a,children:[o,h]}),B[10]=h,B[11]=a,B[12]=o,B[13]=A):A=B[13],B[14]!==i||B[15]!==A?(l=(0,t.jsx)(n.ErrorBoundary,{fallback:i,children:A}),B[14]=i,B[15]=A,B[16]=l):l=B[16],l}),b=(0,s.memo)(function({gltf:e,streamEntity:r}){let{object:n,shapeName:i}=(0,u.useShapeInfo)(),{debugMode:o}=(0,c.useDebug)(),{animationEnabled:A}=(0,c.useSettings)(),f=(0,C.useEngineSelector)(e=>e.runtime.runtime),{clonedScene:m,mixer:p,clipsByName:G,visNodesBySequence:I,iflMeshes:g}=(0,s.useMemo)(()=>{let t=B.clone(e.scene),r=[];for(let{mesh:e,hasVisSequence:s}of(t.traverse(e=>{if(!e.isMesh||!e.material)return;let t=Array.isArray(e.material)?e.material[0]:e.material;if(!t?.userData)return;let s=new Set(t.userData.flag_names??[]),n=t.userData.resource_path;if(s.has("IflMaterial")&&n){let t=e.userData,s=t?.ifl_sequence?String(t.ifl_sequence).toLowerCase():void 0,i=t?.ifl_duration?Number(t.ifl_duration):void 0,a=t?.ifl_sequence?!!t.ifl_cyclic:void 0,o=t?.ifl_tool_begin!=null?Number(t.ifl_tool_begin):void 0;r.push({mesh:e,iflPath:`textures/${n}.ifl`,hasVisSequence:!!t?.vis_sequence,iflSequence:s,iflDuration:i,iflCyclic:a,iflToolBegin:o})}}),(0,M.processShapeScene)(t,i??void 0),r))s||(e.visible=!0);let s=new Map;t.traverse(e=>{if(!e.isMesh)return;let t=e.userData;if(!t)return;let r=t.vis_keyframes,n=t.vis_duration,i=(t.vis_sequence??"").toLowerCase();if(!i||!Array.isArray(r)||r.length<=1||!n||n<=0)return;let a=s.get(i);a||(a=[],s.set(i,a)),a.push({mesh:e,keyframes:r,duration:n,cyclic:!!t.vis_cyclic})});let n=new Map;for(let t of e.animations)n.set(t.name.toLowerCase(),t);let a=n.size>0?new l.AnimationMixer(t):null;return{clonedScene:t,mixer:a,clipsByName:n,visNodesBySequence:s,iflMeshes:r}},[e]),D=(0,s.useRef)(new Map),R=(0,s.useRef)(new Map),T=(0,s.useRef)([]),H=(0,s.useRef)(0);(0,s.useRef)(A).current=A;let J=(0,s.useRef)(r);J.current=r;let b=(0,s.useRef)(null),y=(0,s.useRef)(null),L=(0,s.useRef)(void 0);(0,s.useEffect)(()=>{for(let e of(T.current=[],R.current.clear(),g))(0,d.loadIflAtlas)(e.iflPath).then(t=>{let r=Array.isArray(e.mesh.material)?e.mesh.material[0]:e.mesh.material;r&&(r.map=t.texture,r.needsUpdate=!0);let s={atlas:t,sequenceName:e.iflSequence,sequenceDuration:e.iflDuration,cyclic:e.iflCyclic,toolBegin:e.iflToolBegin};T.current.push(s),R.current.set(e.mesh,t)}).catch(t=>{F.warn("Failed to load IFL atlas for %s: %o",e.iflPath,t)})},[g]);let x=(0,s.useMemo)(()=>{let t=new Map,r=e.scene.userData?.dts_sequence_names,s=e.scene.userData?.dts_sequence_cyclic;if("string"==typeof r&&"string"==typeof s)try{let e=JSON.parse(r),n=JSON.parse(s);for(let r=0;r {let e=D.current,t=null==J.current;function r(t,r){let n=r.toLowerCase();s(t);let i=G.get(n),a=I.get(n),o={sequence:n,startTime:E()};if(i&&p){let e=p.clipAction(i);x.get(n)??!0?e.setLoop(l.LoopRepeat,1/0):(e.setLoop(l.LoopOnce,1),e.clampWhenFinished=!0),e.reset().play(),o.action=e}if(a){for(let e of a)!function(e){if(e.mesh.visible=!0,e.mesh.material?.isMeshStandardMaterial){let t=e.mesh.material,r=(0,M.replaceWithShapeMaterial)(t,e.mesh.userData?.vis??0);e.mesh.material=r.material}e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.transparent=!0,e.mesh.material.depthWrite=!1);let t=R.current.get(e.mesh);t&&e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.map=t.texture,e.mesh.material.needsUpdate=!0)}(e);o.visNodes=a}e.set(t,o)}function s(t){let r=e.get(t);if(r){if(r.action&&r.action.stop(),r.visNodes)for(let e of r.visNodes)e.mesh.visible=!1,e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.opacity=e.keyframes[0]);e.delete(t)}}if(b.current=r,y.current=s,!t)return()=>{for(let t of(b.current=null,y.current=null,L.current=void 0,[...e.keys()]))s(t)};let i=[];for(let[t,a]of(f&&(i.push(f.$.onMethodCalled("ShapeBase","playThread",(e,t,s)=>{e._id===n?._id&&r(Number(t),String(s))})),i.push(f.$.onMethodCalled("ShapeBase","stopThread",(e,t)=>{e._id===n?._id&&s(Number(t))})),i.push(f.$.onMethodCalled("ShapeBase","pauseThread",(t,r)=>{if(t._id!==n?._id)return;let s=e.get(Number(r));s?.action&&(s.action.paused=!0)}))),[[0,"power"],[1,"ambient"]]))(G.has(a)||I.has(a))&&r(t,a);return()=>{for(let t of(i.forEach(e=>e()),b.current=null,y.current=null,L.current=void 0,[...e.keys()]))s(t)}},[p,G,I,x,n,f]);let S=(0,s.useMemo)(()=>{let t=e.scene.userData?.dts_sequence_names;if("string"==typeof t)try{return JSON.parse(t).map(e=>e.toLowerCase())}catch{}return e.animations.map(e=>e.name.toLowerCase())},[e]);return(0,a.useFrame)((e,t)=>{let r=D.current,s=null!=J.current,n=C.engineStore.getState().playback,i=s?"playing"===n.status?t*n.rate:0:t,a=J.current?.threads,o=L.current;if(a!==o){let e=b.current,t=y.current;if(e&&t){L.current=a;let s=[];if(a)for(let e of a)s[e.index]=e;let n=[];if(o)for(let e of o)n[e.index]=e;let i=Math.max(s.length,n.length);for(let a=0;a0)for(let e of(H.current+=i,B)){if(!A){(0,d.updateAtlasFrame)(e.atlas,0);continue}if(e.sequenceName&&e.sequenceDuration){let t=0;for(let[,s]of r)if(s.sequence===e.sequenceName){let r=E()-s.startTime,n=e.sequenceDuration;t=(e.cyclic?r/n%1:Math.min(r/n,1))*n+(e.toolBegin??0);break}(0,d.updateAtlasFrame)(e.atlas,(0,d.getFrameIndexForTime)(e.atlas,t))}else(0,d.updateAtlasFrame)(e.atlas,(0,d.getFrameIndexForTime)(e.atlas,H.current))}}),(0,t.jsxs)("group",{rotation:[0,Math.PI/2,0],children:[(0,t.jsx)("primitive",{object:m}),o?(0,t.jsxs)(h.FloatingLabel,{children:[n?._id,": ",i]}):null]})});function y(e){let s,n=(0,r.c)(3),{streamEntity:i}=e,{shapeName:a}=(0,u.useShapeInfo)(),o=g(a);return n[0]!==o||n[1]!==i?(s=(0,t.jsx)(b,{gltf:o,streamEntity:i}),n[0]=o,n[1]=i,n[2]=s):s=n[2],s}}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/3f45dfa93dd54d72.js b/docs/_next/static/chunks/3f45dfa93dd54d72.js new file mode 100644 index 00000000..d1c637e0 --- /dev/null +++ b/docs/_next/static/chunks/3f45dfa93dd54d72.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,58647,79473,43595,e=>{"use strict";e.i(932);var t=e.i(8155);let r=e=>(t,r,n)=>{let i=n.subscribe;return n.subscribe=(e,t,r)=>{let s=e;if(t){let i=(null==r?void 0:r.equalityFn)||Object.is,l=e(n.getState());s=r=>{let n=e(r);if(!i(l,n)){let e=l;t(l=n,e)}},(null==r?void 0:r.fireImmediately)&&t(l,l)}return i(s)},e(t,r,n)};e.s(["subscribeWithSelector",()=>r],79473);var n=e.i(66748);function i(e){let t=new Map;for(let r of e.state.datablocks.values()){if("tsshapeconstructor"!==r._class)continue;let e=r.baseshape;if("string"!=typeof e)continue;let n=e.toLowerCase(),i=n.replace(/\.dts$/i,"")+"_",s=new Map;for(let e=0;e<=127;e++){let t=r[`sequence${e}`];if("string"!=typeof t)continue;let n=t.indexOf(" ");if(-1===n)continue;let l=t.slice(0,n).toLowerCase(),a=t.slice(n+1).trim().toLowerCase();if(!a||!l.startsWith(i)||!l.endsWith(".dsq"))continue;let o=l.slice(i.length,-4);o&&s.set(a,o)}s.size>0&&t.set(n,s)}return t}function s(e,t,r){let n=new Map;for(let r of e){let e=t.clipAction(r);n.set(r.name.toLowerCase(),e)}if(r)for(let[e,t]of r){let r=n.get(t);r&&!n.has(e)&&n.set(e,r)}return n}function l(e){return e.toLowerCase()}function a(e){let t=l(e.trim());return t.startsWith("$")?t.slice(1):t}e.s(["buildSequenceAliasMap",()=>i,"getAliasedActions",()=>s],43595);let o={runtime:{runtime:null,sequenceAliases:new Map,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0},playback:{recording:null,status:"stopped",timeMs:0,rate:1,durationMs:0,streamSnapshot:null}},u=(0,t.createStore)()(r(e=>({...o,setRuntime(t){let r=function(e){let t={},r={},n={},i={};for(let r of e.state.objectsById.values())t[r._id]=0,r._name&&(n[l(r._name)]=r._id,r._isDatablock&&(i[l(r._name)]=r._id));for(let t of e.state.globals.keys())r[a(t)]=0;return{objectVersionById:t,globalVersionByName:r,objectIdsByName:n,datablockIdsByName:i}}(t),n=i(t);e(e=>({...e,runtime:{runtime:t,sequenceAliases:n,objectVersionById:r.objectVersionById,globalVersionByName:r.globalVersionByName,objectIdsByName:r.objectIdsByName,datablockIdsByName:r.datablockIdsByName,lastRuntimeTick:0}}))},clearRuntime(){e(e=>({...e,runtime:{runtime:null,sequenceAliases:new Map,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0}}))},applyRuntimeBatch(t,r){0!==t.length&&e(e=>{let n={...e.runtime.objectVersionById},i={...e.runtime.globalVersionByName},s={...e.runtime.objectIdsByName},o={...e.runtime.datablockIdsByName},u=e=>{null!=e&&(n[e]=(n[e]??0)+1)};for(let e of t){if("object.created"===e.type){let t=e.object;if(u(e.objectId),t._name){let r=l(t._name);s[r]=e.objectId,t._isDatablock&&(o[r]=e.objectId)}u(t._parent?._id);continue}if("object.deleted"===e.type){let t=e.object;if(delete n[e.objectId],t?._name){let e=l(t._name);delete s[e],t._isDatablock&&delete o[e]}u(t?._parent?._id);continue}if("field.changed"===e.type){u(e.objectId);continue}if("global.changed"===e.type){let t=a(e.name);i[t]=(i[t]??0)+1;continue}}let c=r?.tick??(e.runtime.lastRuntimeTick>0?e.runtime.lastRuntimeTick+1:1);return{...e,runtime:{...e.runtime,objectVersionById:n,globalVersionByName:i,objectIdsByName:s,datablockIdsByName:o,lastRuntimeTick:c}}})},setRecording(t){let r=Math.max(0,(t?.duration??0)*1e3);e(e=>({...e,playback:{recording:t,status:t?"stopped":e.playback.status,timeMs:t?0:e.playback.timeMs,rate:t?1:e.playback.rate,durationMs:r,streamSnapshot:t?null:e.playback.streamSnapshot}}))},setPlaybackTime(t){e(e=>{var r,n,i;let s=(r=t,n=0,i=e.playback.durationMs,r<0?0:r>i?i:r);return{...e,playback:{...e.playback,timeMs:s}}})},setPlaybackStatus(t){e(e=>({...e,playback:{...e.playback,status:t}}))},setPlaybackRate(t){var r,n,i;let s=Number.isFinite(t)?(n=.01,i=16,(r=t)<.01?.01:r>16?16:r):1;e(e=>({...e,playback:{...e.playback,rate:s}}))},setPlaybackStreamSnapshot(t){e(e=>({...e,playback:{...e.playback,streamSnapshot:t}}))}}))),c=0;function f(){return c}function d(e,t){c+=e*t*1e3}function b(){return u}function g(e,t){return(0,n.useStoreWithEqualityFn)(u,e,t)}u.subscribe(e=>e.playback.status,e=>{"stopped"===e&&(c=0)}),e.s(["advanceEffectClock",()=>d,"effectNow",()=>f,"engineStore",0,u,"useEngineSelector",()=>g,"useEngineStoreApi",()=>b],58647)},79474,(e,t,r)=>{"use strict";var n=e.r(71645).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;r.c=function(e){return n.H.useMemoCache(e)}},932,(e,t,r)=>{"use strict";t.exports=e.r(79474)},55838,(e,t,r)=>{"use strict";var n=e.r(71645),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=n.useState,l=n.useEffect,a=n.useLayoutEffect,o=n.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!i(e,r)}catch(e){return!0}}var c="u" {"use strict";t.exports=e.r(55838)},52822,(e,t,r)=>{"use strict";var n=e.r(71645),i=e.r(2239),s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},l=i.useSyncExternalStore,a=n.useRef,o=n.useEffect,u=n.useMemo,c=n.useDebugValue;r.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var f=a(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;var b=l(e,(f=u(function(){function e(e){if(!o){if(o=!0,l=e,e=n(e),void 0!==i&&d.hasValue){var t=d.value;if(i(t,e))return a=t}return a=e}if(t=a,s(l,e))return t;var r=n(e);return void 0!==i&&i(t,r)?(l=e,t):(l=e,a=r)}var l,a,o=!1,u=void 0===r?null:r;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,r,n,i]))[0],f[1]);return o(function(){d.hasValue=!0,d.value=b},[b]),c(b),b}},30224,(e,t,r)=>{"use strict";t.exports=e.r(52822)},66748,8155,e=>{"use strict";var t=e.i(71645),r=e.i(30224);let n=e=>{let t,r=new Set,n=(e,n)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,s={setState:n,getState:i,getInitialState:()=>l,subscribe:e=>(r.add(e),()=>r.delete(e))},l=t=e(n,i,s);return s},i=e=>e?n(e):n;e.s(["createStore",()=>i],8155);let{useSyncExternalStoreWithSelector:s}=r.default,l=e=>e;function a(e,r=l,n){let i=s(e.subscribe,e.getState,e.getInitialState,r,n);return t.default.useDebugValue(i),i}let o=(e,t)=>{let r=i(e),n=(e,n=t)=>a(r,e,n);return Object.assign(n,r),n},u=(e,t)=>e?o(e,t):o;e.s(["createWithEqualityFn",()=>u,"useStoreWithEqualityFn",()=>a],66748)},71187,(e,t,r)=>{"use strict";function n(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}t.exports=function(e,t,r){var i=r&&r.stringify||n;if("object"==typeof e&&null!==e){var s=t.length+1;if(1===s)return e;var l=Array(s);l[0]=i(e);for(var a=1;a -1?f:0,e.charCodeAt(b+1)){case 100:case 102:if(c>=o||null==t[c])break;f=o||null==t[c])break;f=o||void 0===t[c])break;f",f=b+2,b++;break}u+=i(t[c]),f=b+2,b++;break;case 115:if(c>=o)break;f{"use strict";let n=e.r(71187);t.exports=c;let i=function(){function e(e){return void 0!==e&&e}try{if("u">typeof globalThis)return globalThis;return Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{};function s(e,t){return"silent"===e?1/0:t.levels.values[e]}let l=Symbol("pino.logFuncs"),a=Symbol("pino.hierarchy"),o={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function u(e,t){let r={logger:t,parent:e[a]};t[a]=r}function c(e){var t,r,n;let a,g,p;(e=e||{}).browser=e.browser||{};let h=e.browser.transmit;if(h&&"function"!=typeof h.send)throw Error("pino: transmit option must have a send function");let w=e.browser.write||i;e.browser.write&&(e.browser.asObject=!0);let j=e.serializers||{},S=(t=e.browser.serialize,Array.isArray(t)?t.filter(function(e){return"!stdSerializers.err"!==e}):!0===t&&Object.keys(j)),O=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(O=!1);let _=Object.keys(e.customLevels||{}),k=["error","fatal","warn","info","debug","trace"].concat(_);"function"==typeof w&&k.forEach(function(e){w[e]=w}),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");let E=e.level||"info",T=Object.create(w);T.log||(T.log=m),a={},k.forEach(e=>{a[e]=w[e]?w[e]:i[e]||i[o[e]||"log"]||m}),T[l]=a,u({},T),Object.defineProperty(T,"levelVal",{get:function(){return s(this.level,this)}}),Object.defineProperty(T,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,f(this,L,T,"error"),f(this,L,T,"fatal"),f(this,L,T,"warn"),f(this,L,T,"info"),f(this,L,T,"debug"),f(this,L,T,"trace"),_.forEach(e=>{f(this,L,T,e)})}});let L={transmit:h,serialize:S,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,reportCaller:e.browser.reportCaller,levels:k,timestamp:"function"==typeof(r=e).timestamp?r.timestamp:!1===r.timestamp?y:v,messageKey:e.messageKey||"msg",onChild:e.onChild||m};function R(t,r,n){if(!r)throw Error("missing bindings for child Pino");n=n||{},S&&r.serializers&&(n.serializers=r.serializers);let i=n.serializers;if(S&&i){var s=Object.assign({},j,i),l=!0===e.browser.serialize?Object.keys(s):S;delete r.serializers,d([r],l,s,this._stdErrSerialize)}function a(e){this._childLevel=(0|e._childLevel)+1,this.bindings=r,s&&(this.serializers=s,this._serialize=l),h&&(this._logEvent=b([].concat(e._logEvent.bindings,r)))}a.prototype=this;let o=new a(this);return u(this,o),o.child=function(...e){return R.call(this,t,...e)},o.level=n.level||this.level,t.onChild(o),o}return g=e.customLevels||{},T.levels={values:Object.assign({},c.levels.values,g),labels:Object.assign({},c.levels.labels,(p={},Object.keys(n=g).forEach(function(e){p[n[e]]=e}),p))},T.level=E,T.isLevelEnabled=function(e){return!!this.levels.values[e]&&this.levels.values[e]>=this.levels.values[this.level]},T.setMaxListeners=T.getMaxListeners=T.emit=T.addListener=T.on=T.prependListener=T.once=T.prependOnceListener=T.removeListener=T.removeAllListeners=T.listeners=T.listenerCount=T.eventNames=T.write=T.flush=m,T.serializers=j,T._serialize=S,T._stdErrSerialize=O,T.child=function(...e){return R.call(this,L,...e)},h&&(T._logEvent=b()),T}function f(e,t,r,o){var u,c,f,g,p,h,y;if(Object.defineProperty(e,o,{value:s(e.level,r)>s(o,r)?m:r[l][o],writable:!0,enumerable:!0,configurable:!0}),e[o]===m){if(!t.transmit)return;let n=s(t.transmit.level||e.level,r);if(s(o,r)e}=s.formatters||{},o=r.slice(),u=o[0],c={},f=(0|e._childLevel)+1;if(f<1&&(f=1),i&&(c.time=i),l?Object.assign(c,l(t,e.levels.values[t])):c.level=e.levels.values[t],s.asObjectBindingsOnly){if(null!==u&&"object"==typeof u)for(;f--&&"object"==typeof o[0];)Object.assign(c,o.shift());return[a(c),...o]}if(null!==u&&"object"==typeof u){for(;f--&&"object"==typeof o[0];)Object.assign(c,o.shift());u=o.length?n(o.shift(),o):void 0}else"string"==typeof u&&(u=n(o.shift(),o));return void 0!==u&&(c[s.messageKey]=u),[a(c)]}(this,g,t,e,c);if(c.reportCaller&&i&&i.length>0&&i[0]&&"object"==typeof i[0])try{let e=w();e&&(i[0].caller=e)}catch(e){}p.call(r,...i)}else{if(c.reportCaller)try{let e=w();e&&t.push(e)}catch(e){}p.apply(r,t)}if(c.transmit){let r=c.transmit.level||u._level,n=s(r,f),i=s(g,f);if(i -1&&n in r&&(e[i][n]=r[n](e[i][n]))}function b(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function g(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)void 0===t[r]&&(t[r]=e[r]);return t}function p(){return{}}function h(e){return e}function m(){}function y(){return!1}function v(){return Date.now()}function w(){let e=Error().stack;if(!e)return null;let t=e.split("\n");for(let e=1;e {"use strict";var t=e.i(2232);let r=new Set(["trace","debug","info","warn","error","fatal","silent"]),{globalLevel:n,modules:i}=function(){let e="info".trim();if(!e)return{globalLevel:"info",modules:new Map};let t=null,n=new Map;for(let i of e.split(",")){let e=i.trim();if(e)if(e.includes(":")){let[t,r]=e.split(":");t&&r&&n.set(t,r)}else r.has(e)&&(t=e)}return{globalLevel:t??=n.size>0?"silent":"info",modules:n}}(),s={10:"debug",20:"debug",30:"log",40:"warn",50:"error",60:"error"},l=(0,t.default)({name:"t2-mapper",level:"trace",browser:{write:function(e){let t=s[e.level]??"log";console[t](e.module?`[${e.module}]`:"[t2-mapper]",e.msg)}}});function a(e){let t=i.get(e)??n;return l.child({module:e},{level:t})}e.s(["createLogger",()=>a])},98223,e=>{"use strict";function t(e){return e.split(/(?:\r\n|\r|\n)/g).map(e=>e.trim()).filter(Boolean).filter(e=>!e.startsWith(";")).map(e=>{let t=e.match(/^(.+)\s(\d+)$/);if(!t)return{name:e,frameCount:1};{let e=parseInt(t[2],10);return{name:t[1],frameCount:e}}})}e.s(["parseImageFileList",()=>t])},91996,71726,e=>{"use strict";var t=e.i(87447);function r(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}e.s(["normalizePath",()=>r],71726);let n=t.default;function i(e){return r(e).toLowerCase()}function s(){return n.resources}function l(e){let[t,...r]=n.resources[e],[i,s]=r[r.length-1];return[i,s??t]}function a(e){let t=i(e);if(n.resources[t])return t;let r=t.replace(/\d+(\.(png))$/i,"$1");if(n.resources[r])return r;throw Error(`Resource not found in manifest: ${e}`)}function o(){return Object.keys(n.resources)}let u=["",".jpg",".png",".gif",".bmp"];function c(e){let t=i(e);for(let e of u){let r=`${t}${e}`;if(n.resources[r])return r}return t}function f(e){let t=n.missions[e];if(!t)throw Error(`Mission not found: ${e}`);return t}function d(e){return e in n.missions}function b(){return Object.keys(n.missions)}e.s(["getActualResourceKey",()=>a,"getMissionInfo",()=>f,"getMissionList",()=>b,"getResourceKey",()=>i,"getResourceList",()=>o,"getResourceMap",()=>s,"getSourceAndPath",()=>l,"getStandardTextureResourceKey",()=>c,"hasMission",()=>d],91996)},12979,e=>{"use strict";var t=e.i(98223),r=e.i(25645),n=e.i(91996),i=e.i(62395),s=e.i(71726);let l=(0,r.createLogger)("loaders"),a="/t2-mapper",o=`${a}/base/`,u=`${a}/magenta.png`;function c(e,t){let r;try{r=(0,n.getActualResourceKey)(e)}catch(r){if(t)return l.warn('Resource "%s" not found — rendering fallback',e),t;throw r}let[i,s]=(0,n.getSourceAndPath)(r);return i?`${o}@vl2/${i}/${s}`:`${o}${s}`}function f(e){return c(`interiors/${e}`).replace(/\.dif$/i,".glb")}function d(e){return c(`shapes/${e}`).replace(/\.dts$/i,".glb")}function b(e){return e=e.replace(/^terrain\./,""),c((0,n.getStandardTextureResourceKey)(`textures/terrain/${e}`),u)}function g(e,t){let r=(0,s.normalizePath)(t).split("/"),i=r.length>1?r.slice(0,-1).join("/")+"/":"",l=`${i}${e}`;return c((0,n.getStandardTextureResourceKey)(l),u)}function p(e){return c((0,n.getStandardTextureResourceKey)(`textures/${e}`),u)}function h(e){return c(`audio/${e}`).replace(/\.wav$/i,".ogg")}async function m(e){let t=c(`textures/${e}`),r=await fetch(t);return(await r.text()).split(/(?:\r\n|\r|\n)/).map(e=>{if(!(e=e.trim()).startsWith(";"))return e}).filter(Boolean)}async function y(e){let t,r=(0,n.getMissionInfo)(e),s=await fetch(c(r.resourcePath)),l=await s.arrayBuffer();try{t=new TextDecoder("utf-8",{fatal:!0}).decode(l)}catch{t=new TextDecoder("windows-1252").decode(l)}return t=t.replaceAll("�","'"),(0,i.parseMissionScript)(t)}async function v(e){let t=c(`terrains/${e}`);l.debug("Fetching terrain: %s",t);let r=await fetch(t);if(!r.ok)throw Error(`[loadTerrain] Failed to fetch ${t}: ${r.status} ${r.statusText}`);let n=await r.arrayBuffer();return l.debug("Loaded terrain %s: %d bytes",e,n.byteLength),function(e){let t=new DataView(e),r=0,n=t.getUint8(r++),i=new Uint16Array(65536),s=[],l=e=>{let n="";for(let i=0;i 0&&s.push(i)}let a=[];for(let e of s){let e=new Uint8Array(65536);for(let n=0;n<65536;n++){let i=t.getUint8(r++);e[n]=i}a.push(e)}return{version:n,textureNames:s,heightMap:i,alphaMaps:a}}(n)}async function w(e){let r=c(e),n=await fetch(r),i=await n.text();return(0,t.parseImageFileList)(i)}e.s(["FALLBACK_TEXTURE_URL",0,u,"RESOURCE_ROOT_URL",0,o,"audioToUrl",()=>h,"getUrlForPath",()=>c,"iflTextureToUrl",()=>g,"interiorToUrl",()=>f,"loadDetailMapList",()=>m,"loadImageFrameList",()=>w,"loadMission",()=>y,"loadTerrain",()=>v,"shapeToUrl",()=>d,"terrainTextureToUrl",()=>b,"textureToUrl",()=>p],12979)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/3fc0c5e684385765.js b/docs/_next/static/chunks/3fc0c5e684385765.js deleted file mode 100644 index 538faae9..00000000 --- a/docs/_next/static/chunks/3fc0c5e684385765.js +++ /dev/null @@ -1,89 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,53272,e=>{"use strict";var t=e.i(43476),i=e.i(932),r=e.i(32865),a=e.i(71645),n=e.i(71753),o=e.i(78140),l=e.i(90072),s=e.i(85557),c=e.i(12979),u=e.i(15080),d=e.i(75567);let m=Math.PI/180,p=Math.PI/18e4;function f(e,t,i){let r=e[t];return"number"==typeof r&&Number.isFinite(r)?r:i}function h(e,t,i){let r=e[t];return"boolean"==typeof r?r:"number"==typeof r?0!==r:i}function g(e,t){let i,r=e.particles;if(Array.isArray(r)){for(let e of r)if("number"==typeof e&&(i=t(e)))break}return i?{ejectionPeriodMS:f(e,"ejectionPeriodMS",100),periodVarianceMS:f(e,"periodVarianceMS",0),ejectionVelocity:.01*f(e,"ejectionVelocity",200),velocityVariance:.01*f(e,"velocityVariance",100),ejectionOffset:.01*f(e,"ejectionOffset",0),thetaMin:f(e,"thetaMin",0),thetaMax:f(e,"thetaMax",90),phiReferenceVel:f(e,"phiReferenceVel",0),phiVariance:f(e,"phiVariance",360),overrideAdvances:h(e,"overrideAdvances",!1),orientParticles:h(e,"orientParticles",!1),orientOnVelocity:h(e,"orientOnVelocity",!0),lifetimeMS:f(e,"lifetimeMS",0)<<5,lifetimeVarianceMS:f(e,"lifetimeVarianceMS",0)<<5,particles:function(e){let t=e.keys,i=[];if(Array.isArray(t)&&t.length>0)for(let e=0;e 0&&t[0]&&(r=t[0])}return{dragCoefficient:5*f(e,"dragCoefficient",0),windCoefficient:f(e,"windCoefficient",1),gravityCoefficient:10*f(e,"gravityCoefficient",0),inheritedVelFactor:f(e,"inheritedVelFactor",0),constantAcceleration:f(e,"constantAcceleration",0),lifetimeMS:f(e,"lifetimeMS",31)<<5,lifetimeVarianceMS:f(e,"lifetimeVarianceMS",0)<<5,spinSpeed:f(e,"spinSpeed",0),spinRandomMin:f(e,"spinRandomMin",1e3)+-1e3,spinRandomMax:f(e,"spinRandomMax",1e3)+-1e3,useInvAlpha:h(e,"useInvAlpha",!1),keys:i,textureName:r}}(i)}:null}function y(e,t){return e+(2*Math.random()-1)*t}function S(e,t,i,r,a,n,o){let l=Math.cos(o),s=Math.sin(o),c=e*r+t*a+i*n;return[e*l+(a*i-n*t)*s+r*c*(1-l),t*l+(n*e-r*i)*s+a*c*(1-l),i*l+(r*t-a*e)*s+n*c*(1-l)]}class b{data;particles=[];maxParticles;internalClock=0;nextParticleTime=0;emitterAge=0;emitterLifetime;emitterDead=!1;constructor(e,t=256,i){this.data=e,this.maxParticles=t;let r=i??e.lifetimeMS;!i&&e.lifetimeVarianceMS>0&&(r+=Math.round(y(0,e.lifetimeVarianceMS))),this.emitterLifetime=r}emitBurst(e,t,i=[0,0,1]){for(let r=0;r 0;){if(this.nextParticleTime>0){let e=Math.min(r,this.nextParticleTime);this.nextParticleTime-=e,r-=e,this.internalClock+=e;continue}if(this.particles.length 0)){let e=this.particles[this.particles.length-1];e.currentAge+=r,e.currentAge>=e.totalLifetime&&this.particles.pop()}let t=this.data.ejectionPeriodMS;this.data.periodVarianceMS>0&&(t+=Math.round(y(0,this.data.periodVarianceMS))),this.nextParticleTime=Math.max(1,t)}}update(e){this.emitterAge+=e,this.emitterLifetime>0&&this.emitterAge>this.emitterLifetime&&(this.emitterDead=!0);let t=e/1e3,i=this.data.particles;for(let r=this.particles.length-1;r>=0;r--){let a=this.particles[r];if(a.currentAge+=e,a.currentAge>=a.totalLifetime){this.particles[r]=this.particles[this.particles.length-1],this.particles.pop();continue}let n=i.dragCoefficient,o=i.gravityCoefficient,l=a.acc[0]-a.vel[0]*n,s=a.acc[1]-a.vel[1]*n,c=a.acc[2]-a.vel[2]*n+-9.81*o;a.vel[0]+=l*t,a.vel[1]+=s*t,a.vel[2]+=c*t,a.pos[0]+=a.vel[0]*t,a.pos[1]+=a.vel[1]*t,a.pos[2]+=a.vel[2]*t;let u=a.currentAge/a.totalLifetime,d=function(e,t){for(let i=1;i =t){let r=e[i-1],a=e[i],n=a.time-r.time,o=n>0?(t-r.time)/n:0;return{r:r.r+(a.r-r.r)*o,g:r.g+(a.g-r.g)*o,b:r.b+(a.b-r.b)*o,a:r.a+(a.a-r.a)*o,size:r.size+(a.size-r.size)*o}}let i=e[e.length-1];return{r:i.r,g:i.g,b:i.b,a:i.a,size:i.size}}(i.keys,u);a.r=d.r,a.g=d.g,a.b=d.b,a.a=d.a,a.size=d.size,a.currentSpin=a.spinSpeed*a.currentAge*p}}isDead(){return this.emitterDead&&0===this.particles.length}kill(){this.emitterDead=!0}addParticle(e,t){var i,r,a,n;let o,l,s,c,u=this.data,d=u.particles,p=t[0],f=t[1],h=t[2],g=(i=p,r=f,.9>Math.abs(a=h)?(o=r,l=-i,s=0):(o=-a,l=0,s=i),(c=Math.sqrt(o*o+l*l+s*s))<1e-8?[1,0,0]:[o/c,l/c,s/c]),b=(u.thetaMin+Math.random()*(u.thetaMax-u.thetaMin))*m,v=(this.internalClock/1e3*u.phiReferenceVel+Math.random()*u.phiVariance)*m;[p,f,h]=S(p,f,h,g[0],g[1],g[2],b),[p,f,h]=S(p,f,h,t[0],t[1],t[2],v);let M=Math.sqrt(p*p+f*f+h*h);M>1e-8&&(p/=M,f/=M,h/=M);let x=y(u.ejectionVelocity,u.velocityVariance),w=[e[0]+p*u.ejectionOffset,e[1]+f*u.ejectionOffset,e[2]+h*u.ejectionOffset],A=[p*x,f*x,h*x],T=d.constantAcceleration,P=[A[0]*T,A[1]*T,A[2]*T],k=d.lifetimeMS;d.lifetimeVarianceMS>0&&(k+=Math.round(y(0,d.lifetimeVarianceMS))),k=Math.max(1,k);let C=d.spinSpeed+((n=d.spinRandomMin)+Math.random()*(d.spinRandomMax-n)),I=d.keys[0];this.particles.push({pos:w,vel:A,acc:P,orientDir:[p,f,h],currentAge:0,totalLifetime:k,dataIndex:0,spinSpeed:C,currentSpin:0,r:I.r,g:I.g,b:I.b,a:I.a,size:I.size})}}let v=` -// 'position' is auto-declared by Three.js for ShaderMaterial. -attribute vec4 particleColor; -attribute float particleSize; -attribute float particleSpin; -attribute vec2 quadCorner; // (-0.5,-0.5) to (0.5,0.5) -attribute vec3 orientDir; - -uniform bool uOrientParticles; -// cameraPosition is a built-in Three.js uniform. - -varying vec2 vUv; -varying vec4 vColor; - -void main() { - vUv = quadCorner + 0.5; // [0,1] range - vColor = particleColor; - - if (uOrientParticles) { - if (length(orientDir) < 0.0001) { - // V12: don't render oriented particles with zero velocity. - gl_Position = vec4(0.0, 0.0, 0.0, 0.0); - return; - } - // V12 oriented particle: quad aligned along direction, facing camera. - vec3 worldPos = (modelMatrix * vec4(position, 1.0)).xyz; - vec3 dir = normalize(orientDir); - vec3 dirFromCam = worldPos - cameraPosition; - vec3 crossDir = normalize(cross(dirFromCam, dir)); - - // V12 maps U along dir (velocity) — match by using quadCorner.x for dir. - vec3 offset = dir * quadCorner.x + crossDir * quadCorner.y; - worldPos += offset * particleSize; - - gl_Position = projectionMatrix * viewMatrix * vec4(worldPos, 1.0); - } else { - // Standard camera-facing billboard. - vec3 viewPos = (modelViewMatrix * vec4(position, 1.0)).xyz; - - // Apply spin rotation to quad corner. - float c = cos(particleSpin); - float s = sin(particleSpin); - vec2 rotated = vec2( - c * quadCorner.x - s * quadCorner.y, - s * quadCorner.x + c * quadCorner.y - ); - - // Offset in view space (camera-facing billboard). - viewPos.xy += rotated * particleSize; - - gl_Position = projectionMatrix * vec4(viewPos, 1.0); - } -} -`,M=` -uniform sampler2D particleTexture; -uniform bool hasTexture; -uniform float debugOpacity; - -varying vec2 vUv; -varying vec4 vColor; - -void main() { - if (hasTexture) { - vec4 texColor = texture2D(particleTexture, vUv); - gl_FragColor = texColor * vColor; - } else { - gl_FragColor = vColor; - } - gl_FragColor.a *= debugOpacity; -} -`;var x=e.i(79123),w=e.i(51434),A=e.i(29055);e.i(13876);var T=e.i(58647);let P=new Float32Array([-.5,-.5,.5,-.5,.5,.5,-.5,.5]),k=new Map,C=new Set,I=new l.DataTexture(new Uint8Array([255,255,255,255]),1,1,l.RGBAFormat,l.UnsignedByteType);function B(e){if(!e)return I;let t=k.get(e);if(t)return t;try{let t=(0,c.textureToUrl)(e),i=(0,d.loadTexture)(t,e=>{(0,s.setupEffectTexture)(e),C.add(e)});return(0,s.setupEffectTexture)(i),k.set(e,i),i}catch{return I}}I.needsUpdate=!0;let D=new l.SphereGeometry(1,6,6),E=new l.MeshBasicMaterial({color:0xff0000,wireframe:!0}),R=new l.BoxGeometry(.3,.3,.3),V=new l.MeshBasicMaterial({color:65280,wireframe:!0}),F=new l.SphereGeometry(1,12,8),N=` - attribute vec4 vertexColor; - attribute vec2 texCoord; - varying vec4 vColor; - varying vec2 vUV; - void main() { - vColor = vertexColor; - vUV = texCoord; - gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); - } -`,_=` - uniform sampler2D uTexture; - varying vec4 vColor; - varying vec2 vUV; - void main() { - vec4 tex = texture2D(uTexture, vUV); - gl_FragColor = vec4(vColor.rgb * tex.rgb, vColor.a * tex.a); - } -`;function O(e){let t=(e+1)*2,i=new Float32Array(3*t),r=new Float32Array(2*t),a=new Float32Array(4*t),n=new Uint16Array(6*e);for(let t=0;t {let i=Y.current,r=k.current;if(!i||!r)return;let a=T.engineStore.getState().playback,n="playing"===a.status,o=n?t*a.rate:0,s=1e3*o,u=P.getDataBlockData.bind(P);for(let e of r.entities){if("Explosion"!==e.type||!e.explosionDataBlockId||!e.position||X.current.has(e.id))continue;X.current.add(e.id);let t=function(e,t){let i=t(e);if(!i)return null;let r=[],a=[],n=i.particleEmitter;if("number"==typeof n){let e=t(n);if(e){let a=g(e,t);if(a){let e=i.particleDensity??10;r.push({data:a,density:e})}}}let o=i.emitters;if(Array.isArray(o))for(let e of o){if("number"!=typeof e)continue;let i=t(e);if(!i)continue;let r=g(i,t);r&&a.push(r)}return 0===r.length&&0===a.length?null:{burstEmitters:r,streamingEmitters:a,lifetimeMS:32*(i.lifetimeMS??31)}}(e.explosionDataBlockId,u);if(!t)continue;let r=[...e.position];for(let e of t.burstEmitters){let t=new b(e.data,256);t.emitBurst(r,e.density);let a=B(e.data.particles.textureName),n=U(256),o=j(a,e.data.particles.useInvAlpha,e.data.orientParticles),s=new l.Mesh(n,o);s.frustumCulled=!1,i.add(s),Q.current.push({emitter:t,mesh:s,geometry:n,material:o,targetTexture:a,origin:r,isBurst:!0,hasBurst:!0})}for(let e of t.streamingEmitters){let a=new b(e,256,t.lifetimeMS),n=B(e.particles.textureName),o=U(256),s=j(n,e.particles.useInvAlpha,e.orientParticles),c=new l.Mesh(o,s);c.frustumCulled=!1,i.add(c),Q.current.push({emitter:a,mesh:c,geometry:o,material:s,targetTexture:n,origin:r,isBurst:!1,hasBurst:!1})}let a=u(e.explosionDataBlockId);if(I){let n=a?function(e){let t=e.sizes;if(Array.isArray(t)&&t.length>0){let e=0;for(let i of t)e=Math.max(e,i.x,i.y,i.z);if(e>0)return e/1e3}let i=e.particleRadius;return"number"==typeof i&&i>0?i:5}(a):5,o=function(e){if(!e)return 0xff00ff;let t=e.toLowerCase();return t.includes("disc")?4491519:t.includes("grenade")?0xff8800:t.includes("mortar")?0xff4400:t.includes("plasma")?4521796:t.includes("laser")?0xff2222:t.includes("blaster")?0xffff00:t.includes("missile")?0xff6600:t.includes("bomb")?0xff0000:t.includes("mine")?0xff8844:t.includes("concussion")?0xffaa00:t.includes("shocklance")?8930559:t.includes("chaingun")||t.includes("bullet")?0xcccccc:0xff00ff}(e.dataBlock),s=new l.MeshBasicMaterial({color:o,wireframe:!0,transparent:!0,opacity:1,depthWrite:!1}),c=new l.Mesh(F,s);c.frustumCulled=!1,c.scale.setScalar(n),c.position.set(r[1],r[2],r[0]),i.add(c);let{sprite:u,material:d}=function(e,t){let i=document.createElement("canvas"),r=i.getContext("2d");r.font="bold 32px monospace",i.width=Math.ceil(r.measureText(e).width)+16,i.height=48,r.font="bold 32px monospace",r.fillStyle=`#${t.toString(16).padStart(6,"0")}`,r.textBaseline="middle",r.fillText(e,8,i.height/2);let a=new l.CanvasTexture(i),n=new l.SpriteMaterial({map:a,transparent:!0,depthTest:!1,depthWrite:!1}),o=new l.Sprite(n),s=i.width/i.height;return o.scale.set(2*s,2,1),{sprite:o,material:n}}(`${e.id}: ${e.dataBlock??`expId:${e.explosionDataBlockId}`}`,o);u.position.set(r[1],r[2]+n+2,r[0]),u.frustumCulled=!1,i.add(u),et.current.push({entityId:e.id,mesh:c,material:s,label:u,labelMaterial:d,creationTime:(0,T.effectNow)(),lifetimeMS:Math.max(t.lifetimeMS,3e3),targetRadius:n})}let n=a?.shockwave;if("number"==typeof n){let t=function(e,t){let i=t(e);if(!i)return null;let r=i.colors??[],a=i.times??[0,.5,1,1];return{width:i.width??1,numSegments:Math.max(i.numSegments??16,4),velocity:i.velocity??0,height:i.height??0,verticalCurve:i.verticalCurve??0,acceleration:i.acceleration??0,texWrap:i.texWrap??1,lifetimeMS:i.lifetimeMS??500,is2D:!!i.is2D,renderSquare:!!i.renderSquare,renderBottom:!!i.renderBottom,mapToTerrain:!!i.mapToTerrain,colors:r,times:a,textureName:i.textureName??"",mapToTexture:i.mapToTexture??""}}(n,u);if(t){let a=B(t.textureName),n=O(t.numSegments),o=new l.ShaderMaterial({vertexShader:N,fragmentShader:_,uniforms:{uTexture:{value:a}},transparent:!0,depthWrite:!1,blending:l.AdditiveBlending,side:l.DoubleSide}),s=new l.Mesh(n,o);s.frustumCulled=!1,s.position.set(r[1],r[2],r[0]),i.add(s);let c=null,u=null;t.renderBottom&&(u=O(t.numSegments),(c=new l.Mesh(u,o)).frustumCulled=!1,c.position.set(r[1],r[2],r[0]),c.scale.y=-1,i.add(c));let d=Math.abs(t.velocity)>1e-10?t.velocity:0;ei.current.push({entityId:e.id,mesh:s,bottomMesh:c,geometry:n,bottomGeometry:u,material:o,creationTime:(0,T.effectNow)(),lifetimeMS:t.lifetimeMS,data:t,radius:0,velocity:d})}}}let d=new Set;for(let e of r.entities){if(d.add(e.id),!e.maintainEmitterId||J.current.has(e.id))continue;J.current.add(e.id);let t=u(e.maintainEmitterId);if(!t)continue;let r=g(t,u);if(!r)continue;let a=e.position?[...e.position]:[0,0,0],n=new b(r,256),o=B(r.particles.textureName),s=U(256),c=j(o,r.particles.useInvAlpha,r.orientParticles),m=new l.Mesh(s,c);m.frustumCulled=!1,i.add(m),Q.current.push({emitter:n,mesh:m,geometry:s,material:c,targetTexture:o,origin:a,isBurst:!1,hasBurst:!1,followEntityId:e.id})}for(let e of Q.current)e.followEntityId&&!d.has(e.followEntityId)&&e.emitter.kill();for(let e of J.current)d.has(e)||J.current.delete(e);let m=Q.current;for(let e=m.length-1;e>=0;e--){let t=m[e];if(t.shaderChecked||(!function(e,t,i){let r=e.properties.get(t).currentProgram;if(!r)return;let a=r.program,n=e.getContext();n.getProgramParameter(a,n.LINK_STATUS)||console.error(`[ParticleFX] Shader LINK ERROR (${i}):`,n.getProgramInfoLog(a))}(K,t.material,t.isBurst?"burst":"stream"),t.shaderChecked=!0),t.followEntityId){let e=r.entities.find(e=>e.id===t.followEntityId);e?.position&&(t.origin[0]=e.position[0],t.origin[1]=e.position[1],t.origin[2]=e.position[2]),e?.direction&&(t.emitAxis=e.direction)}if(t.isBurst||t.emitter.emitPeriodic(t.origin,s,t.emitAxis),t.emitter.update(s),C.has(t.targetTexture)&&t.material.uniforms.particleTexture.value!==t.targetTexture&&(t.material.uniforms.particleTexture.value=t.targetTexture),t.material.uniforms.debugOpacity.value=I?.2:1,!function(e){let t=e.emitter.particles,i=e.geometry,r=i.getAttribute("position"),a=i.getAttribute("particleColor"),n=i.getAttribute("particleSize"),o=i.getAttribute("particleSpin"),l=i.getAttribute("orientDir"),s=r.array,c=a.array,u=n.array,d=o.array,m=l.array,p=Math.min(t.length,256),f=e.emitter.data.orientOnVelocity;for(let e=0;e =0;e--){let t=p[e],r=Math.min((f-t.creationTime)/t.lifetimeMS,1),a=Math.min(r/.1,1);t.mesh.scale.setScalar(t.targetRadius*a),t.material.opacity=1-r,t.labelMaterial.opacity=1-r,r>=1&&(i.remove(t.mesh),i.remove(t.label),t.material.dispose(),t.labelMaterial.dispose(),p.splice(e,1))}let h=ei.current;for(let t=h.length-1;t>=0;t--){let r=h[t],a=Math.min((f-r.creationTime)/r.lifetimeMS,1);r.velocity=r.velocity+r.data.acceleration*o,r.radius=r.radius+r.velocity*o;let n=function(e,t){let{colors:i,times:r}=e;if(0===i.length)return[1,1,1,1];let a=0;for(let e=0;e
=r[e]&&(a=e);let n=Math.min(a+1,i.length-1),o=r[a]??0,l=(r[n]??1)-o,s=l>0?Math.min((t-o)/l,1):0,c=i[a]??i[0],u=i[n]??i[0];return[c.r+(u.r-c.r)*s,c.g+(u.g-c.g)*s,c.b+(u.b-c.b)*s,c.a+(u.a-c.a)*s]}(r.data,a);z(r.geometry,r.data,r.radius,n,r.data.is2D),r.bottomGeometry&&z(r.bottomGeometry,r.data,r.radius,n,r.data.is2D),r.data.is2D&&r.mesh.lookAt(e.camera.position),a>=1&&(i.remove(r.mesh),r.bottomMesh&&i.remove(r.bottomMesh),r.geometry.dispose(),r.bottomGeometry?.dispose(),r.material.dispose(),h.splice(t,1))}if(n&&q&&H&&$&&Y.current){for(let e of r.entities){if("Explosion"!==e.type||!e.explosionDataBlockId||!e.position)continue;let t=`snd:${e.id}`;if(ee.current.has(t))continue;ee.current.add(t);let i=u(e.explosionDataBlockId);if(!i)continue;let r=i.soundProfile;if("number"!=typeof r)continue;let a=(0,A.resolveAudioProfile)(r,u);if(!a)continue;let n=new l.Vector3(e.position[1],e.position[2],e.position[0]);(0,A.playOneShotSound)(a,$,H,n,Y.current)}let e=Z.current;for(let t of r.entities){if("Projectile"!==t.type||!t.dataBlockId||!t.position)continue;if(e.has(t.id)){e.get(t.id).position.set(t.position[1],t.position[2],t.position[0]);continue}if(e.size>=20)continue;let i=u(t.dataBlockId);if(!i)continue;let r=i.sound;if("number"!=typeof r)continue;let n=(0,A.resolveAudioProfile)(r,u);if(n&&n.isLooping&&n.is3D)try{let i=(0,c.audioToUrl)(n.filename),r=(0,A.getSoundGeneration)();(0,A.getCachedAudioBuffer)(i,H,i=>{if(r!==(0,A.getSoundGeneration)()||!d.has(t.id)||e.has(t.id))return;let o=Y.current;if(!o)return;let s=new l.PositionalAudio($);s.setBuffer(i),s.setDistanceModel("inverse"),s.setRefDistance(n.refDist),s.setMaxDistance(n.maxDist),s.setRolloffFactor(1),s.setVolume(n.volume),s.setPlaybackRate(a.rate),s.setLoop(!0),s.position.set(t.position[1],t.position[2],t.position[0]),o.add(s),(0,A.trackSound)(s),s.play(),e.set(t.id,s)})}catch{}}for(let[t,i]of e)if(!d.has(t)){(0,A.untrackSound)(i);try{i.stop()}catch{}try{i.disconnect()}catch{}Y.current?.remove(i),e.delete(t)}for(let e of r.audioEvents){let t=`${e.timeSec}:${e.profileId}:${e.position?.x??""}`;if(ee.current.has(t))continue;ee.current.add(t);let i=(0,A.resolveAudioProfile)(e.profileId,u);if(!i)continue;let r=e.position?new l.Vector3(e.position.y,e.position.z,e.position.x):void 0;(0,A.playOneShotSound)(i,$,H,r,Y.current)}}if(X.current.size>500){let e=new Set(r.entities.map(G));for(let t of X.current)e.has(t)||X.current.delete(t)}if(ee.current.size>500){let e=new Set(r.entities.map(L));for(let t of ee.current)t.startsWith("snd:")&&e.has(t.slice(4))||ee.current.delete(t)}},M[7]=q,M[8]=$,M[9]=H,M[10]=I,M[11]=K,M[12]=P,M[13]=k,M[14]=h):h=M[14],(0,n.useFrame)(h),M[15]===Symbol.for("react.memo_cache_sentinel")?(S=()=>()=>{let e=Y.current;for(let t of Q.current){if(e&&(e.remove(t.mesh),t.debugOriginMesh&&e.remove(t.debugOriginMesh),t.debugParticleMeshes))for(let i of t.debugParticleMeshes)e.remove(i);t.geometry.dispose(),t.material.dispose()}for(let t of(Q.current=[],et.current))e&&(e.remove(t.mesh),e.remove(t.label)),t.material.dispose(),t.labelMaterial.dispose();for(let t of(et.current=[],ei.current))e&&(e.remove(t.mesh),t.bottomMesh&&e.remove(t.bottomMesh)),t.geometry.dispose(),t.bottomGeometry?.dispose(),t.material.dispose();for(let[,t]of(ei.current=[],X.current.clear(),J.current.clear(),Z.current)){(0,A.untrackSound)(t);try{t.stop()}catch{}try{t.disconnect()}catch{}e&&e.remove(t)}Z.current.clear(),ee.current.clear()},y=[],M[15]=y,M[16]=S):(y=M[15],S=M[16]),(0,a.useEffect)(S,y),M[17]===Symbol.for("react.memo_cache_sentinel")?(v=(0,t.jsx)("group",{ref:Y}),M[17]=v):v=M[17],v}function L(e){return e.id}function G(e){return e.id}function W(e){return e.gl}var H=e.i(9721),$=e.i(92224),K=e.i(93784);function Y(e,t){return{id:e.id,className:e.className??e.type,ghostIndex:e.ghostIndex,dataBlockId:e.dataBlockId,shapeHint:e.shapeHint,spawnTime:t,position:e.position,rotation:e.rotation,velocity:e.velocity,keyframes:[{time:t??0,position:e.position??[0,0,0],rotation:e.rotation??[0,0,0,1]}]}}var Q=e.i(77964);let X=new WeakMap;function J(e){let t=X.get(e);return t||(t=new Map(e.entities.map(e=>[e.id,e])),X.set(e,t)),t}let Z=new l.Vector3,ee=new l.Quaternion,et=new l.Quaternion,ei=new l.Quaternion(0,1,0,0),er=new l.Vector3,ea=new l.Vector3,en=new l.Vector3;function eo(e){let r,u,d,m,p,f,h,g,y,S=(0,i.c)(20),{recording:b}=e,v=(0,T.useEngineStoreApi)(),M=(0,a.useRef)(0),x=(0,a.useRef)(null),w=(0,a.useRef)(null);S[0]===Symbol.for("react.memo_cache_sentinel")?(r=new l.Vector3(0,s.DEFAULT_EYE_HEIGHT,0),S[0]=r):r=S[0];let P=(0,a.useRef)(r),k=(0,a.useRef)(b.streamingPlayback??null),C=(0,a.useRef)(null);S[1]===Symbol.for("react.memo_cache_sentinel")?(u=new Map,S[1]=u):u=S[1];let I=(0,a.useRef)(u),B=(0,a.useRef)(null),[D,E]=(0,a.useState)(null);S[2]===Symbol.for("react.memo_cache_sentinel")?(d=e=>{if(e===B.current)return;B.current=e;let t=I.current,i=new Map,r=!1;for(let n of e.entities){let o=t.get(n.id);if(o&&o.className===(n.className??n.type)&&o.ghostIndex===n.ghostIndex&&o.dataBlockId===n.dataBlockId&&o.shapeHint===n.shapeHint&&o.shapeName===n.dataBlock&&("Player"===o.renderType||o.weaponShape===n.weaponShape)){var a=o;switch(a.renderType){case"Player":a.threads=n.threads,a.weaponShape=n.weaponShape,a.packShape=n.packShape,a.falling=n.falling,a.jetting=n.jetting,a.weaponImageState=n.weaponImageState,a.weaponImageStates=n.weaponImageStates,a.playerName=n.playerName,a.iffColor=n.iffColor,a.headPitch=n.headPitch,a.headYaw=n.headYaw,a.targetRenderFlags=n.targetRenderFlags;break;case"Shape":a.threads=n.threads,a.targetRenderFlags=n.targetRenderFlags,a.iffColor=n.iffColor}}else o=function(e,t){if(e.sceneData){let i={id:e.id,className:e.className??e.type,ghostIndex:e.ghostIndex,dataBlockId:e.dataBlockId,shapeHint:e.shapeHint,spawnTime:t};switch(e.sceneData.className){case"TerrainBlock":return{...i,renderType:"TerrainBlock",terrainData:e.sceneData};case"InteriorInstance":return{...i,renderType:"InteriorInstance",interiorData:e.sceneData};case"Sky":return{...i,renderType:"Sky",skyData:e.sceneData};case"Sun":return{...i,renderType:"Sun",sunData:e.sceneData};case"WaterBlock":return{...i,renderType:"WaterBlock",waterData:e.sceneData};case"MissionArea":return{...i,renderType:"MissionArea",missionAreaData:e.sceneData};case"TSStatic":return{...Y(e,t),renderType:"Shape",shapeName:e.sceneData.shapeName,shapeType:"TSStatic",dataBlock:e.dataBlock}}}return e.visual?.kind==="tracer"?{...Y(e,t),renderType:"Tracer",visual:e.visual,dataBlock:e.dataBlock,direction:e.direction}:e.visual?.kind==="sprite"?{...Y(e,t),renderType:"Sprite",visual:e.visual}:"Player"===e.type?{...Y(e,t),renderType:"Player",shapeName:e.dataBlock,dataBlock:e.dataBlock,weaponShape:e.weaponShape,packShape:e.packShape,falling:e.falling,jetting:e.jetting,playerName:e.playerName,iffColor:e.iffColor,threads:e.threads,weaponImageState:e.weaponImageState,weaponImageStates:e.weaponImageStates,headPitch:e.headPitch,headYaw:e.headYaw,targetRenderFlags:e.targetRenderFlags}:"Explosion"===e.type?{...Y(e,t),renderType:"Explosion",shapeName:e.dataBlock,dataBlock:e.dataBlock,explosionDataBlockId:e.explosionDataBlockId,faceViewer:e.faceViewer}:"ForceFieldBare"===e.className?{...Y(e,t),renderType:"ForceFieldBare"}:"AudioEmitter"===e.className?{...Y(e,t),renderType:"AudioEmitter",audioFileName:e.audioFileName,audioVolume:e.audioVolume,audioIs3D:e.audioIs3D,audioIsLooping:e.audioIsLooping??!0,audioMinDistance:e.audioMinDistance,audioMaxDistance:e.audioMaxDistance,audioMinLoopGap:e.audioMinLoopGap,audioMaxLoopGap:e.audioMaxLoopGap}:"WayPoint"===e.className?{...Y(e,t),renderType:"WayPoint",label:e.label}:"Camera"===e.className?{...Y(e,t),renderType:"Camera"}:{...Y(e,t),renderType:"Shape",shapeName:e.dataBlock,shapeType:"Turret"===e.className?"Turret":"Item"===e.className?"Item":"StaticShape",dataBlock:e.dataBlock,weaponShape:e.weaponShape,threads:e.threads,targetRenderFlags:e.targetRenderFlags,iffColor:e.iffColor}}(n,e.timeSec),r=!0;if(i.set(n.id,o),(0,Q.isSceneEntity)(o)||"None"===o.renderType)continue;let l=o.keyframes;0===l.length&&l.push({time:e.timeSec,position:n.position??[0,0,0],rotation:n.rotation??[0,0,0,1]});let s=l[0];s.time=e.timeSec,n.position&&(s.position=n.position),n.rotation&&(s.rotation=n.rotation),s.velocity=n.velocity,s.health=n.health,s.energy=n.energy,s.actionAnim=n.actionAnim,s.actionAtEnd=n.actionAtEnd,s.damageState=n.damageState}for(let[a,n]of t)if(!i.has(a)){if("Explosion"===n.renderType&&n.shapeName&&null!=n.spawnTime&&e.timeSec-n.spawnTime<5){i.set(a,n);continue}r=!0}i.size!==t.size&&(r=!0),I.current=i,r&&$.gameEntityStore.getState().setAllStreamEntities(Array.from(i.values()));let n=null;if(e.camera?.mode==="first-person"&&e.camera.controlEntityId){let t=i.get(e.camera.controlEntityId),r=t?t.shapeName:void 0;r&&(n=r)}E(e=>e===n?e:n)},S[2]=d):d=S[2];let R=d;return S[3]!==v||S[4]!==b.source||S[5]!==b.streamingPlayback?(m=()=>{(0,A.stopAllTrackedSounds)(),k.current=b.streamingPlayback??null,I.current=new Map,B.current=null,C.current=null,(0,K.resetStreamPlayback)(),M.current=0,x.current=null,w.current=null;let e=k.current;if(K.streamPlaybackStore.setState({playback:e}),$.gameEntityStore.getState().beginStreaming(),!e)return void v.getState().setPlaybackStreamSnapshot(null);for(let t of("live"!==b.source&&e.reset(),e.getEffectShapes()))o.useGLTF.preload((0,c.shapeToUrl)(t));let t=e.getSnapshot();return K.streamPlaybackStore.setState({time:t.timeSec}),M.current=t.timeSec,x.current=t,w.current=t,R(t),v.getState().setPlaybackStreamSnapshot(t),C.current=t,()=>{(0,A.stopAllTrackedSounds)(),$.gameEntityStore.getState().endStreaming(),(0,K.resetStreamPlayback)(),v.getState().setPlaybackStreamSnapshot(null)}},S[3]=v,S[4]=b.source,S[5]=b.streamingPlayback,S[6]=m):m=S[6],S[7]!==v||S[8]!==b?(p=[b,v,R],S[7]=v,S[8]=b,S[9]=p):p=S[9],(0,a.useEffect)(m,p),S[10]!==v||S[11]!==b.source?(f=(e,t)=>{let i=k.current;if(!i)return;let r=v.getState(),a=r.playback,n="playing"===a.status,o=a.timeMs/1e3,l=!n&&Math.abs(o-M.current)>5e-4,c=n&&Math.abs(o-K.streamPlaybackStore.getState().time)>.05,u=l||c;u&&(M.current=o),n&&((0,T.advanceEffectClock)(t,a.rate),M.current=M.current+t*a.rate);let d=Math.max(1,Math.ceil(1e3*t*Math.max(a.rate,.01)/32)+2),m=M.current+s.STREAM_TICK_SEC,p=i.stepToTime(m,n&&!u?d:1/0),f=w.current;!f||p.timeSec 1.5*s.STREAM_TICK_SEC?(x.current=p,w.current=p):p.timeSec!==f.timeSec&&(x.current=f,w.current=p);let h=w.current??p,g=x.current??h,y=h.timeSec-s.STREAM_TICK_SEC,S=Math.max(0,Math.min(1,(M.current-y)/s.STREAM_TICK_SEC));K.streamPlaybackStore.setState({time:M.current}),p.exhausted&&n&&(M.current=Math.min(M.current,p.timeSec)),R(h),K.streamPlaybackStore.getState().entities=I.current,h!==C.current&&(C.current=h,r.setPlaybackStreamSnapshot(h));let A=h.camera,B=A&&g.camera&&g.camera.mode===A.mode&&g.camera.controlEntityId===A.controlEntityId&&g.camera.orbitTargetId===A.orbitTargetId?g.camera:null,D=K.streamPlaybackStore.getState().freeFlyCamera,E="live"===b.source;if(A&&!D){if(B){let t=B.position[0],i=B.position[1],r=B.position[2],a=A.position[0],n=A.position[1],o=A.position[2];e.camera.position.set(i+(n-i)*S,r+(o-r)*S,t+(a-t)*S),E||(ee.set(...B.rotation),et.set(...A.rotation),ee.slerp(et,S),e.camera.quaternion.copy(ee))}else e.camera.position.set(A.position[1],A.position[2],A.position[0]),E||e.camera.quaternion.set(...A.rotation);if(Number.isFinite(A.fov)&&"isPerspectiveCamera"in e.camera&&e.camera.isPerspectiveCamera){let t=e.camera,i=B&&Number.isFinite(B.fov)?B.fov+(A.fov-B.fov)*S:A.fov,r=(0,s.torqueHorizontalFovToThreeVerticalFov)(i,t.aspect);Math.abs(t.fov-r)>.01&&(t.fov=r,t.updateProjectionMatrix())}}let V=J(h),F=J(g),N=I.current,_=K.streamPlaybackStore.getState().root;if(_)for(let t of _.children){let i=N.get(t.name);if(i&&(0,Q.isSceneEntity)(i))continue;let r=V.get(t.name);if(!r){let e=i&&"keyframes"in i?i.keyframes:void 0;if(e?.[0]?.position){let i=e[0];t.visible=!0,t.position.set(i.position[1],i.position[2],i.position[0]);continue}}if(!r?.position){t.visible=!1;continue}t.visible=!0;let a=F.get(t.name);if(a?.position){let e=a.position[0],i=a.position[1],n=a.position[2],o=r.position[0],l=r.position[1],s=r.position[2],c=e+(o-e)*S,u=i+(l-i)*S,d=n+(s-n)*S;t.position.set(u,d,c)}else t.position.set(r.position[1],r.position[2],r.position[0]);r.faceViewer?t.quaternion.copy(e.camera.quaternion).multiply(ei):r.visual?.kind==="tracer"?t.quaternion.identity():r.rotation&&(a?.rotation?(ee.set(...a.rotation),et.set(...r.rotation),ee.slerp(et,S),t.quaternion.copy(ee)):t.quaternion.set(...r.rotation))}let O=A?.mode;if(!D&&!E&&"third-person"===O&&_&&A?.orbitTargetId){let t=_.children.find(e=>e.name===A.orbitTargetId);if(t){let i=V.get(A.orbitTargetId);ea.copy(t.position),i?.type==="Player"&&(ea.y=ea.y+1);let r=!1;if(A.orbitDirection)er.set(A.orbitDirection[0],A.orbitDirection[1],A.orbitDirection[2]),r=er.lengthSq()>1e-8;else if("number"==typeof A.yaw&&"number"==typeof A.pitch){let e=Math.sin(A.pitch),t=Math.cos(A.pitch),i=Math.sin(A.yaw),a=Math.cos(A.yaw);er.set(-a*t,-e,-i*t),r=er.lengthSq()>1e-8}if(r||(er.copy(e.camera.position).sub(ea),r=er.lengthSq()>1e-8),r){er.normalize();let t=Math.max(.1,A.orbitDistance??4);en.copy(ea).addScaledVector(er,t),e.camera.position.copy(en),e.camera.lookAt(ea)}}}if(!D&&"first-person"===O&&_&&A?.controlEntityId){let t=_.children.find(e=>e.name===A.controlEntityId);t?(Z.copy(P.current).applyQuaternion(t.quaternion),e.camera.position.add(Z)):e.camera.position.y=e.camera.position.y+P.current.y}n&&p.exhausted&&r.setPlaybackStatus("paused");let z=1e3*M.current;Math.abs(z-a.timeMs)>.5&&r.setPlaybackTime(z)},S[10]=v,S[11]=b.source,S[12]=f):f=S[12],(0,n.useFrame)(f),S[13]!==b.streamingPlayback?(h=(0,t.jsx)(q,{playback:b.streamingPlayback,snapshotRef:w}),S[13]=b.streamingPlayback,S[14]=h):h=S[14],S[15]!==D?(g=D&&(0,t.jsx)(a.Suspense,{fallback:null,children:(0,t.jsx)(H.PlayerEyeOffset,{shapeName:D,eyeOffsetRef:P})}),S[15]=D,S[16]=g):g=S[16],S[17]!==h||S[18]!==g?(y=(0,t.jsxs)(t.Fragment,{children:[h,g]}),S[17]=h,S[18]=g,S[19]=y):y=S[19],y}function el(){let e,a=(0,i.c)(2),n=(0,r.useRecording)();return n?(a[0]!==n?(e=(0,t.jsx)(eo,{recording:n}),a[0]=n,a[1]=e):e=a[1],e):null}e.s(["StreamPlayback",()=>el],53272)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/450cc5a89761fca0.js b/docs/_next/static/chunks/450cc5a89761fca0.js new file mode 100644 index 00000000..47e5d0a9 --- /dev/null +++ b/docs/_next/static/chunks/450cc5a89761fca0.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,90963,t=>{t.v({Input:"ChatInput-module__mZgxEG__Input",InputForm:"ChatInput-module__mZgxEG__InputForm"})},52728,t=>{"use strict";var e=t.i(43476),n=t.i(932),o=t.i(71645),a=t.i(98755),u=t.i(90963);function r(){let t,r,m,p,s=(0,n.c)(8),[c,g]=(0,o.useState)("");s[0]!==c?(t=t=>{t.preventDefault();let e=c.trim();e&&(a.liveConnectionStore.getState().sendCommand("messageSent",e),g(""))},s[0]=c,s[1]=t):t=s[1];let h=t;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t=>g(t.target.value),s[2]=r):r=s[2],s[3]!==c?(m=(0,e.jsx)("input",{className:u.default.Input,type:"text",placeholder:"Say something…",value:c,onChange:r,onKeyDown:l,onKeyUp:i,maxLength:255}),s[3]=c,s[4]=m):m=s[4],s[5]!==h||s[6]!==m?(p=(0,e.jsx)("form",{className:u.default.InputForm,onSubmit:h,children:m}),s[5]=h,s[6]=m,s[7]=p):p=s[7],p}function i(t){return t.stopPropagation()}function l(t){return t.stopPropagation()}t.s(["ChatInput",()=>r])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/463a5d636c02e0db.js b/docs/_next/static/chunks/463a5d636c02e0db.js deleted file mode 100644 index a3a74480..00000000 --- a/docs/_next/static/chunks/463a5d636c02e0db.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,29055,e=>{"use strict";var t=e.i(43476),n=e.i(71645),a=e.i(15080),i=e.i(71753),r=e.i(90072),o=e.i(12979),l=e.i(51434),s=e.i(79123),c=e.i(89887);e.i(13876);var u=e.i(58647);let m=new Map,f=new Map;function d(e,t=1){f.set(e,t)}function p(e){f.delete(e)}let h=0;function S(){return h}function g(){for(let[e]of(h++,f)){try{e.stop()}catch{}try{e.disconnect()}catch{}}f.clear()}function y(e,t){let n=t(e),a=n?.filename;if(!a)return null;let i=a.endsWith(".wav")?a:`${a}.wav`,r=n.description,o=null!=r?t(r):void 0,l=o?.is3D??!0,s=o?.isLooping??!1,c=o?.referenceDistance??20;return{filename:i,is3D:l,isLooping:s,refDist:c,maxDist:o?.maxDistance??100,volume:o?.volume??1}}function T(e,t,n,a,i){let l;try{l=(0,o.audioToUrl)(e.filename)}catch{return}let s=u.engineStore.getState().playback.rate,c=h;I(l,n,n=>{if(c===h)try{if(e.is3D&&i){let o=new r.PositionalAudio(t);o.setBuffer(n),o.setDistanceModel("inverse"),o.setRefDistance(e.refDist),o.setMaxDistance(e.maxDist),o.setRolloffFactor(1),o.setVolume(e.volume),o.setPlaybackRate(s),a&&o.position.copy(a),i.add(o),f.set(o,1),o.play(),o.source.onended=()=>{f.delete(o);try{o.disconnect()}catch{}i.remove(o)}}else{let a=new r.Audio(t);a.setBuffer(n),a.setVolume(e.volume),a.setPlaybackRate(s),f.set(a,1),a.play(),a.source.onended=()=>{f.delete(a);try{a.disconnect()}catch{}}}}catch{}})}function I(e,t,n){m.has(e)?n(m.get(e)):t.load(e,t=>{m.set(e,t),n(t)},void 0,t=>{console.error("Audio load error",e,t)})}u.engineStore.subscribe(e=>e.playback.rate,e=>{for(let[t,n]of f)try{t.setPlaybackRate(n*e)}catch{}});let w=(0,n.memo)(function({entity:e}){let{debugMode:u}=(0,s.useDebug)(),m=e.audioFileName??"",f=e.audioVolume??1,d=e.audioMinDistance??1,p=e.audioMaxDistance??1,h=e.audioMinLoopGap??0,S=e.audioMaxLoopGap??0,g=e.audioIs3D??!0?1:0,y=e.audioIsLooping??!0,[T,w,k]=e.position??[0,0,0],{scene:A,camera:M}=(0,a.useThree)(),{audioLoader:N,audioListener:v}=(0,l.useAudio)(),{audioEnabled:b}=(0,s.useSettings)(),x=(0,n.useRef)(null),R=(0,n.useRef)(null),_=(0,n.useRef)(null),L=(0,n.useRef)(!1),C=(0,n.useRef)(!1),E=(0,n.useRef)(new r.Vector3(T,w,k)),O=(0,n.useRef)(0),D=()=>{null!=R.current&&(clearTimeout(R.current),R.current=null),null!=_.current&&(clearTimeout(_.current),_.current=null)};(0,n.useEffect)(()=>{let e;if(N&&v){if(O.current++,g){let t=new r.PositionalAudio(v);t.position.copy(E.current),t.setDistanceModel("inverse"),t.setRefDistance(d),t.setMaxDistance(p),t.setRolloffFactor(1),t.setVolume(f),e=t,A.add(e)}else(e=new r.Audio(v)).setVolume(f);return x.current=e,()=>{D();try{e.stop()}catch{}try{e.disconnect()}catch{}g&&A.remove(e),x.current=null,L.current=!1,C.current=!1}}},[N,v,g,d,p,f,A]);let P=(e,t)=>{if(y)if(h>0||S>0){let n=Math.max(0,h),a=Math.max(n,S),i=n===a?n:Math.random()*(a-n)+n;e.loop=!1;let r=()=>{t===O.current&&(!1===e.isPlaying?R.current=setTimeout(()=>{if(t===O.current)try{e.play(),P(e,t)}catch{}},i):_.current=setTimeout(r,100))};_.current=setTimeout(r,100)}else e.setLoop(!0)},F=e=>{if(!N)return;let t=O.current;if(L.current)try{e.isPlaying||(e.play(),P(e,t))}catch{}else{let n;try{n=(0,o.audioToUrl)(m)}catch{return}I(n,N,n=>{if(t===O.current&&!e.buffer){e.setBuffer(n),L.current=!0;try{e.play(),P(e,t)}catch{}}})}};return(0,n.useEffect)(()=>{let e=x.current;e&&!g&&b&&m&&F(e)},[b,g,m,N,v]),(0,i.useFrame)(()=>{let e=x.current;if(!e||!g||!b||!m)return;let t=M.position.distanceTo(E.current),n=C.current,a=t<=p;if(a&&!n)C.current=!0,F(e);else if(!a&&n){C.current=!1,D();try{e.stop()}catch{}}}),(0,n.useEffect)(()=>{let e=x.current;if(e&&!b){D();try{e.stop()}catch{}C.current=!1}},[b]),u?(0,t.jsxs)("mesh",{position:E.current,children:[(0,t.jsx)("sphereGeometry",{args:[d,12,12]}),(0,t.jsx)("meshBasicMaterial",{color:"#00ff00",wireframe:!0,opacity:.05,transparent:!0,toneMapped:!1}),(0,t.jsx)(c.FloatingLabel,{color:"#00ff00",position:[0,d+1,0],children:m})]}):null});e.s(["AudioEmitter",0,w,"audioBufferCache",0,m,"getCachedAudioBuffer",()=>I,"getSoundGeneration",()=>S,"playOneShotSound",()=>T,"resolveAudioProfile",()=>y,"stopAllTrackedSounds",()=>g,"trackSound",()=>d,"untrackSound",()=>p])},9721,e=>{"use strict";var t=e.i(43476),n=e.i(932),a=e.i(71645),i=e.i(71753),r=e.i(90072),o=e.i(82816),l=e.i(85557);class s{states;seqIndexToName;currentStateIndex=0;delayTime=0;lastFireCount=-1;spinTimeScale=0;constructor(e,t){this.states=e,this.seqIndexToName=t,e.length>0&&(this.delayTime=e[0].timeoutValue??0)}get stateIndex(){return this.currentStateIndex}reset(){this.currentStateIndex=0,this.delayTime=this.states.length>0?this.states[0].timeoutValue??0:0,this.lastFireCount=-1}tick(e,t){if(0===this.states.length)return{sequenceName:null,isFiring:!1,spinTimeScale:0,reverse:!1,scaleAnimation:!1,timeoutValue:0,transitioned:!1,soundDataBlockIds:[],stateIndex:-1};let n=this.lastFireCount>=0&&t.fireCount!==this.lastFireCount;this.lastFireCount=t.fireCount;let a=[];if(n){let e=this.states.findIndex(e=>e.fire);if(e>=0&&e!==this.currentStateIndex){this.currentStateIndex=e,this.delayTime=this.states[e].timeoutValue??0;let t=this.states[e].soundDataBlockId;t>=0&&a.push(t)}}this.delayTime-=e;let i=n,r=this.evaluateTickTransitions(t),o=0;for(;r>=0&&o<32;){if(o++,i=!0,r===this.currentStateIndex){this.delayTime=this.states[r].timeoutValue??0;break}let e=this.states[this.currentStateIndex].spin,n=this.delayTime;this.currentStateIndex=r;let l=this.states[r].timeoutValue??0;this.delayTime=l;let s=this.states[r].soundDataBlockId;switch(s>=0&&a.push(s),this.states[r].spin){case 1:this.spinTimeScale=0;break;case 4:this.spinTimeScale=1;break;case 2:3===e&&l>0&&(this.delayTime*=1-n/l);break;case 3:2===e&&l>0&&(this.delayTime*=1-n/l)}r=this.evaluateEntryTransitions(t)}let l=this.states[this.currentStateIndex],s=l.timeoutValue??0;switch(l.spin){case 1:this.spinTimeScale=0;break;case 2:this.spinTimeScale=s>0?Math.max(0,1-this.delayTime/s):1;break;case 4:this.spinTimeScale=1;break;case 3:this.spinTimeScale=s>0?Math.max(0,this.delayTime/s):0}return{sequenceName:this.resolveSequenceName(l),isFiring:l.fire,spinTimeScale:this.spinTimeScale,reverse:!l.direction,scaleAnimation:l.scaleAnimation,timeoutValue:l.timeoutValue??0,transitioned:i,soundDataBlockIds:a,stateIndex:this.currentStateIndex}}evaluateTickTransitions(e){let t=this.states[this.currentStateIndex],n=this.delayTime<=0;if(!(n||!t.waitForTimeout))return -1;let a=this.evaluateConditions(t,e);if(-1!==a)return a;if(n){let e=t.transitionOnTimeout;if(-1!==e)return e}return -1}evaluateEntryTransitions(e){let t=this.states[this.currentStateIndex];return this.evaluateConditions(t,e)}evaluateConditions(e,t){let n=t.loaded?e.transitionOnLoaded:e.transitionOnNotLoaded;if(-1!==n)return n;let a=t.ammo?e.transitionOnAmmo:e.transitionOnNoAmmo;if(-1!==a)return a;let i=t.target?e.transitionOnTarget:e.transitionOnNoTarget;if(-1!==i)return i;let r=t.wet?e.transitionOnWet:e.transitionOnNotWet;if(-1!==r)return r;let o=t.triggerDown?e.transitionOnTriggerDown:e.transitionOnTriggerUp;return -1!==o?o:-1}resolveSequenceName(e){return null==e.sequence||e.sequence<0?null:this.seqIndexToName[e.sequence]??null}}var c=e.i(43595),u=e.i(91907),m=e.i(87297),f=e.i(51434),d=e.i(29055),p=e.i(12979),h=e.i(79123);e.i(13876);var S=e.i(58647),g=e.i(93784);let y=["root","run","back","side","fall","jet","jump","land"];function T(e,t,n){let a=e.current;if(a){(0,d.untrackSound)(a);try{a.stop()}catch{}try{a.disconnect()}catch{}n?.remove(a),e.current=null,t.current=-1}}function I(e){let s,f,d,p,h,T,I,b,x,R,L,C,E,O,D,P,F,B,j,q,V,W,U=(0,n.c)(56),{entity:G}=e,z=(0,S.useEngineStoreApi)(),Y=G.shapeName??G.dataBlock,K=(0,u.useStaticShape)(Y);U[0]!==Y?(s=e=>{let t=Y?.toLowerCase();return t?e.runtime.sequenceAliases.get(t):void 0},U[0]=Y,U[1]=s):s=U[1];let H=(0,S.useEngineSelector)(s);U[2]!==K.scene?(T=o.clone(K.scene),f=(0,l.processShapeScene)(T),T.traverse(N),h=new r.AnimationMixer(T),d=null,p=null,T.traverse(e=>{d||"Mount0"!==e.name||(d=e),p||"Mount1"!==e.name||(p=e)}),U[2]=K.scene,U[3]=f,U[4]=d,U[5]=p,U[6]=h,U[7]=T):(f=U[3],d=U[4],p=U[5],h=U[6],T=U[7]),U[8]!==f||U[9]!==d||U[10]!==p||U[11]!==h||U[12]!==T?(I={clonedScene:T,mixer:h,mount0:d,mount1:p,iflInitializers:f},U[8]=f,U[9]=d,U[10]=p,U[11]=h,U[12]=T,U[13]=I):I=U[13];let{clonedScene:Q,mixer:$,mount0:J,mount1:X,iflInitializers:Z}=I;U[14]===Symbol.for("react.memo_cache_sentinel")?(b=new Map,U[14]=b):b=U[14];let ee=(0,a.useRef)(b);U[15]===Symbol.for("react.memo_cache_sentinel")?(x={head:null,headside:null},U[15]=x):x=U[15];let et=(0,a.useRef)(x);U[16]===Symbol.for("react.memo_cache_sentinel")?(R=new Map,U[16]=R):R=U[16];let en=(0,a.useRef)(R),ea=(0,a.useRef)(null);U[17]===Symbol.for("react.memo_cache_sentinel")?(L={name:"root",timeScale:1},U[17]=L):L=U[17];let ei=(0,a.useRef)(L),er=(0,a.useRef)(!1),eo=(0,a.useRef)(void 0);if(U[18]!==z||U[19]!==Y){e:{let e=z.getState().playback,t=e.recording?.streamingPlayback,n=Y?.toLowerCase();if(!t||!n){let e;U[21]===Symbol.for("react.memo_cache_sentinel")?(e=new Map,U[21]=e):e=U[21],C=e;break e}let a=t.getShapeConstructorSequences(n);if(!a){let e;U[22]===Symbol.for("react.memo_cache_sentinel")?(e=new Map,U[22]=e):e=U[22],C=e;break e}C=function(e,t){let n=new Map,a=[];for(let n of e){let e=n.indexOf(" ");if(-1===e)continue;let i=n.slice(0,e).toLowerCase(),r=n.slice(e+1).trim().toLowerCase();if(!r||!i.startsWith(t)||!i.endsWith(".dsq"))continue;let o=i.slice(t.length,-4);o&&a.push({clipName:o,alias:r})}let i=new Set;for(let e=0;e {let e=(0,c.getAliasedActions)(K.animations,$,H);ee.current=e;let t=e.get("root");t&&t.play(),ei.current={name:"root",timeScale:1};let n={head:null,headside:null};for(let{key:e,names:t}of[{key:"head",names:["head"]},{key:"headside",names:["headside"]}]){let a=K.animations.find(e=>t.includes(e.name.toLowerCase()));if(!a)continue;let i=a.clone(),o=Math.round(30*a.duration/2);r.AnimationUtils.makeClipAdditive(i,o,a,30);let l=$.clipAction(i);l.blendMode=r.AdditiveAnimationBlendMode,l.timeScale=0,l.weight=1,l.play(),n[e]=l}et.current=n;let a=new Map,i=K.animations.find(M),o=i?Math.round(30*i.duration/2):0;for(let e of["lookde","lookms","looksn"]){let t=K.animations.find(t=>t.name.toLowerCase()===e);if(!t)continue;let n=t.clone(),l=i??t;r.AnimationUtils.makeClipAdditive(n,o,l,30);let s=$.clipAction(n);s.blendMode=r.AdditiveAnimationBlendMode,s.timeScale=0,s.weight=0,s.play(),a.set(e,s)}en.current=a;let l=a.get("lookde");return l&&(l.weight=1,ea.current="lookde"),$.update(0),()=>{$.stopAllAction(),ee.current=new Map,et.current={head:null,headside:null},en.current=new Map,ea.current=null}},O=[$,K.animations,H],U[23]=K.animations,U[24]=$,U[25]=H,U[26]=E,U[27]=O):(E=U[26],O=U[27]),(0,a.useEffect)(E,O),U[28]!==Z?(D=()=>{let e=[];for(let{mesh:t,initialize:n}of Z)n(t,A).then(t=>e.push(t)).catch(k);return()=>e.forEach(w)},P=[Z],U[28]=Z,U[29]=D,U[30]=P):(D=U[29],P=U[30]),(0,a.useEffect)(D,P);let es=(0,a.useRef)(G.weaponShape),[ec,eu]=(0,a.useState)(G.weaponShape),em=(0,a.useRef)(G.packShape),[ef,ed]=(0,a.useState)(G.packShape);return U[31]!==el||U[32]!==z||U[33]!==G.falling||U[34]!==G.headPitch||U[35]!==G.headYaw||U[36]!==G.jetting||U[37]!==G.keyframes||U[38]!==G.packShape||U[39]!==G.weaponShape||U[40]!==$?(F=(e,t)=>{G.weaponShape!==es.current&&(es.current=G.weaponShape,eu(G.weaponShape)),G.packShape!==em.current&&(em.current=G.packShape,ed(G.packShape));let n=z.getState().playback,a="playing"===n.status,i=g.streamPlaybackStore.getState().time,o=(0,l.getKeyframeAtTime)(G.keyframes??[],i),s=o?.damageState!=null&&o.damageState>=1,c=ee.current;if(s&&!er.current){er.current=!0;let e=null!=o.actionAnim?el.get(o.actionAnim):void 0;if(e){let t=c.get(e.clipName);if(t){let n=c.get(ei.current.name.toLowerCase());n&&n.fadeOut(l.ANIM_TRANSITION_TIME),t.setLoop(r.LoopOnce,1),t.clampWhenFinished=!0,t.reset().fadeIn(l.ANIM_TRANSITION_TIME).play(),ei.current={name:e.clipName,timeScale:1},eo.current=o.actionAnim}}}if(!s&&er.current){er.current=!1,eo.current=void 0;let e=c.get(ei.current.name.toLowerCase());e&&(e.stop(),e.setLoop(r.LoopRepeat,1/0),e.clampWhenFinished=!1),ei.current={name:"root",timeScale:1};let t=c.get("root");t&&t.reset().play()}let u=o?.actionAnim,m=eo.current;if(!er.current&&u!==m){eo.current=u;let e=null!=m&&m>=8;if(null!=u&&u>=8){let e=el.get(u);if(e){let t=c.get(e.clipName);if(t){let n=c.get(ei.current.name.toLowerCase());n&&n.fadeOut(l.ANIM_TRANSITION_TIME),t.setLoop(r.LoopOnce,1),t.clampWhenFinished=!0,t.reset().fadeIn(l.ANIM_TRANSITION_TIME).play(),ei.current={name:e.clipName,timeScale:1}}}}else if(e){let e=el.get(m);if(e){let t=c.get(e.clipName);t&&(t.fadeOut(l.ANIM_TRANSITION_TIME),t.setLoop(r.LoopRepeat,1/0),t.clampWhenFinished=!1)}ei.current={name:"root",timeScale:1};let t=c.get("root");t&&t.reset().fadeIn(l.ANIM_TRANSITION_TIME).play()}}if(null!=u&&u>=8&&o?.actionAtEnd){let e=el.get(u);if(e){let t=c.get(e.clipName);t&&(t.paused=!0)}}let f=null!=eo.current&&eo.current>=8;if(!er.current&&!f){let e=function(e,t,n,a){if(n)return{animation:"fall",timeScale:1};if(!e)return a?{animation:"jet",timeScale:1}:{animation:"root",timeScale:1};let[i,r,o]=e,l=-2*Math.atan2(t[1],t[3]),s=Math.cos(l),c=Math.sin(l),u=i*s+r*c,m=-i*c+r*s,f=-m,d=-u,p=Math.max(m,f,d,u);return p<.1?a?{animation:"jet",timeScale:1}:{animation:"root",timeScale:1}:p===m?{animation:"run",timeScale:1}:p===f?{animation:"back",timeScale:1}:p===d?{animation:"side",timeScale:1}:{animation:"side",timeScale:-1}}(o?.velocity,o?.rotation??[0,0,0,1],G.falling,G.jetting),t=ei.current;if(e.animation!==t.name||e.timeScale!==t.timeScale){let n=c.get(t.name.toLowerCase()),i=c.get(e.animation.toLowerCase());i&&(a&&n&&n!==i?(n.fadeOut(l.ANIM_TRANSITION_TIME),i.reset().fadeIn(l.ANIM_TRANSITION_TIME).play()):(n&&n!==i&&n.stop(),i.reset().play()),i.timeScale=e.timeScale,ei.current={name:e.animation,timeScale:e.timeScale})}}let d=function(e){if(!e)return"lookde";let t=e.toLowerCase();return t.includes("missile")?"lookms":t.includes("sniper")?"looksn":"lookde"}(G.weaponShape);if(d!==ea.current){let e=en.current,t=ea.current?e.get(ea.current):null,n=e.get(d);n&&(t&&(t.weight=0),n.weight=+!s,ea.current=d)}let{head:p,headside:h}=et.current,S=ea.current?en.current.get(ea.current):null,y=+!s,T=G.headPitch??0,I=G.headYaw??0,w=(T+1)/2;S&&(S.time=w*S.getClip().duration,S.weight=y),p&&(p.time=w*p.getClip().duration,p.weight=y),h&&(h.time=(I+1)/2*h.getClip().duration,h.weight=y),a?$.update(t*n.rate):$.update(0)},U[31]=el,U[32]=z,U[33]=G.falling,U[34]=G.headPitch,U[35]=G.headYaw,U[36]=G.jetting,U[37]=G.keyframes,U[38]=G.packShape,U[39]=G.weaponShape,U[40]=$,U[41]=F):F=U[41],(0,i.useFrame)(F),U[42]===Symbol.for("react.memo_cache_sentinel")?(B=[0,Math.PI/2,0],U[42]=B):B=U[42],U[43]!==Q?(j=(0,t.jsx)("group",{rotation:B,children:(0,t.jsx)("primitive",{object:Q})}),U[43]=Q,U[44]=j):j=U[44],U[45]!==ec||U[46]!==G||U[47]!==J?(q=ec&&J&&(0,t.jsx)(m.ShapeErrorBoundary,{fallback:null,children:(0,t.jsx)(a.Suspense,{fallback:null,children:(0,t.jsx)(v,{entity:G,weaponShape:ec,mount0:J})})},ec),U[45]=ec,U[46]=G,U[47]=J,U[48]=q):q=U[48],U[49]!==ef||U[50]!==X?(V=ef&&X&&(0,t.jsx)(m.ShapeErrorBoundary,{fallback:null,children:(0,t.jsx)(a.Suspense,{fallback:null,children:(0,t.jsx)(_,{packShape:ef,mountBone:X})})},ef),U[49]=ef,U[50]=X,U[51]=V):V=U[51],U[52]!==j||U[53]!==q||U[54]!==V?(W=(0,t.jsxs)(t.Fragment,{children:[j,q,V]}),U[52]=j,U[53]=q,U[54]=V,U[55]=W):W=U[55],W}function w(e){return e()}function k(){}function A(){return g.streamPlaybackStore.getState().time}function M(e){return"lookde"===e.name.toLowerCase()}function N(e){if(e.isMesh&&e.material)for(let t of Array.isArray(e.material)?e.material:[e.material])t.side=r.FrontSide}function v(e){let t,c,m,g,y,I,w,k,A,M,N,v,_,L,C=(0,n.c)(38),{entity:E,weaponShape:O,mount0:D}=e,P=(0,S.useEngineStoreApi)(),F=(0,u.useStaticShape)(O);if(C[0]!==F.animations||C[1]!==F.scene){t=o.clone(F.scene),c=(0,l.processShapeScene)(t);let e=(0,l.getPosedNodeTransform)(F.scene,F.animations,"Mountpoint");if(e){let n=e.quaternion.clone().invert(),a=e.position.clone().negate().applyQuaternion(n);t.position.copy(a),t.quaternion.copy(n)}g=new Map,t.traverse(e=>{if(!e.isMesh)return;let t=e.userData,n=(t?.vis_sequence??"").toLowerCase();if(!n)return;let a=g.get(n);a||(a=[],g.set(n,a)),a.push(e)}),m=new r.AnimationMixer(t),C[0]=F.animations,C[1]=F.scene,C[2]=t,C[3]=c,C[4]=m,C[5]=g}else t=C[2],c=C[3],m=C[4],g=C[5];let B=m,j=F.scene;C[6]!==j||C[7]!==F.animations?(y=function(e,t){let n=e.userData?.dts_sequence_names;if("string"==typeof n)try{return JSON.parse(n).map(e=>e.toLowerCase())}catch{}return t.map(e=>e.name.toLowerCase())}(j,F.animations),C[6]=j,C[7]=F.animations,C[8]=y):y=C[8];let q=y;C[9]!==t||C[10]!==c||C[11]!==B||C[12]!==q||C[13]!==g?(I={weaponClone:t,weaponMixer:B,seqIndexToName:q,visNodesBySequence:g,weaponIflInitializers:c},C[9]=t,C[10]=c,C[11]=B,C[12]=q,C[13]=g,C[14]=I):I=C[14];let{weaponClone:V,weaponMixer:W,seqIndexToName:U,visNodesBySequence:G,weaponIflInitializers:z}=I;C[15]===Symbol.for("react.memo_cache_sentinel")?(w=new Map,C[15]=w):w=C[15];let Y=(0,a.useRef)(w),K=(0,a.useRef)(null);C[16]!==F.animations||C[17]!==W?(k=()=>{let e=new Map;for(let t of F.animations)e.set(t.name.toLowerCase(),W.clipAction(t));Y.current=e;let t=e.get("spin");return t&&(t.setLoop(r.LoopRepeat,1/0),t.timeScale=0,t.play()),K.current=t??null,W.update(0),()=>{W.stopAllAction(),Y.current=new Map,K.current=null,T(et,en)}},A=[W,F.animations],C[16]=F.animations,C[17]=W,C[18]=k,C[19]=A):(k=C[18],A=C[19]),(0,a.useEffect)(k,A),C[20]!==z?(M=()=>{let e=[];for(let{mesh:t,initialize:n}of z)n(t,R).then(t=>e.push(t)).catch(x);return()=>e.forEach(b)},N=[z],C[20]=z,C[21]=M,C[22]=N):(M=C[21],N=C[22]),(0,a.useEffect)(M,N);let{audioLoader:H,audioListener:Q}=(0,f.useAudio)(),$=(0,h.useSettings)(),J=$?.audioEnabled??!1,X=(0,a.useRef)(null),Z=(0,a.useRef)(null),ee=(0,a.useRef)(E.weaponImageStates),et=(0,a.useRef)(null),en=(0,a.useRef)(-1);return C[23]!==D||C[24]!==V?(v=()=>(D.add(V),()=>{D.remove(V)}),_=[V,D],C[23]=D,C[24]=V,C[25]=v,C[26]=_):(v=C[25],_=C[26]),(0,a.useEffect)(v,_),C[27]!==J||C[28]!==Q||C[29]!==H||C[30]!==P||C[31]!==E.weaponImageState||C[32]!==E.weaponImageStates||C[33]!==U||C[34]!==G||C[35]!==V||C[36]!==W?(L=(e,t)=>{let n=P.getState().playback,a="playing"===n.status,i=Y.current,o=E.weaponImageState,c=E.weaponImageStates;c!==ee.current&&(ee.current=c,c&&c.length>0?X.current=new s(c,U):X.current=null,Z.current=null,T(et,en,V)),!X.current&&c&&c.length>0&&(X.current=new s(c,U));let u=X.current;if(u&&o&&a){let e=t*n.rate,a=u.tick(e,o);if(function(e,t,n,a){let i=e.sequenceName,o=n.current;if(i===o&&!e.transitioned)return;if(i!==o){if(o){let e=a.get(o);if(e)for(let t of e)t.visible=!1}if(i){let e=a.get(i);if(e)for(let t of e)t.visible=!0}}if(!i){if(o){let e=t.get(o);e&&e.fadeOut(l.ANIM_TRANSITION_TIME),n.current=null}return}let s=t.get(i);if(s&&(e.transitioned||i!==o)){let a=o?t.get(o):null;if(e.isFiring||e.timeoutValue>0?(s.setLoop(r.LoopOnce,1),s.clampWhenFinished=!0):(s.setLoop(r.LoopRepeat,1/0),s.clampWhenFinished=!1),e.scaleAnimation&&e.timeoutValue>0){let t=s.getClip().duration;s.timeScale=t>0?t/e.timeoutValue:1}else s.timeScale=e.reverse?-1:1;a&&a!==s?(a.fadeOut(l.ANIM_TRANSITION_TIME),s.reset().fadeIn(l.ANIM_TRANSITION_TIME).play()):s.reset().play(),n.current=i}}(a,i,Z,G),et.current&&a.stateIndex!==en.current&&T(et,en,V),J&&H&&Q&&a.soundDataBlockIds.length>0){let e=n.recording?.streamingPlayback.getDataBlockData.bind(n.recording.streamingPlayback);if(e)for(let t of a.soundDataBlockIds){let a=(0,d.resolveAudioProfile)(t,e);if(a)if(a.isLooping){if(!et.current)try{let e=(0,p.audioToUrl)(a.filename),t=(0,d.getSoundGeneration)();(0,d.getCachedAudioBuffer)(e,H,e=>{if(t!==(0,d.getSoundGeneration)()||et.current)return;let i=u.stateIndex,o=new r.PositionalAudio(Q);o.setBuffer(e),o.setDistanceModel("inverse"),o.setRefDistance(a.refDist),o.setMaxDistance(a.maxDist),o.setRolloffFactor(1),o.setVolume(a.volume),o.setPlaybackRate(n.rate),o.setLoop(!0),V.add(o),(0,d.trackSound)(o),o.play(),et.current=o,en.current=i})}catch{}}else(0,d.playOneShotSound)(a,Q,H,void 0,V)}}K.current&&(K.current.timeScale=a.spinTimeScale)}a?W.update(t*n.rate):W.update(0)},C[27]=J,C[28]=Q,C[29]=H,C[30]=P,C[31]=E.weaponImageState,C[32]=E.weaponImageStates,C[33]=U,C[34]=G,C[35]=V,C[36]=W,C[37]=L):L=C[37],(0,i.useFrame)(L),null}function b(e){return e()}function x(){}function R(){return g.streamPlaybackStore.getState().time}function _(e){let t,i,r,s,c,m,f,d=(0,n.c)(14),{packShape:p,mountBone:h}=e,S=(0,u.useStaticShape)(p);if(d[0]!==S.animations||d[1]!==S.scene){t=o.clone(S.scene),i=(0,l.processShapeScene)(t);let e=(0,l.getPosedNodeTransform)(S.scene,S.animations,"Mountpoint");if(e){let n=e.quaternion.clone().invert(),a=e.position.clone().negate().applyQuaternion(n);t.position.copy(a),t.quaternion.copy(n)}d[0]=S.animations,d[1]=S.scene,d[2]=t,d[3]=i}else t=d[2],i=d[3];d[4]!==t||d[5]!==i?(r={packClone:t,packIflInitializers:i},d[4]=t,d[5]=i,d[6]=r):r=d[6];let{packClone:g,packIflInitializers:y}=r;return d[7]!==h||d[8]!==g?(s=()=>(h.add(g),()=>{h.remove(g)}),c=[g,h],d[7]=h,d[8]=g,d[9]=s,d[10]=c):(s=d[9],c=d[10]),(0,a.useEffect)(s,c),d[11]!==y?(m=()=>{let e=[];for(let{mesh:t,initialize:n}of y)n(t,E).then(t=>e.push(t)).catch(C);return()=>e.forEach(L)},f=[y],d[11]=y,d[12]=m,d[13]=f):(m=d[12],f=d[13]),(0,a.useEffect)(m,f),null}function L(e){return e()}function C(){}function E(){return g.streamPlaybackStore.getState().time}function O(e){let t,i,r=(0,n.c)(7),{shapeName:o,eyeOffsetRef:s}=e,c=(0,u.useStaticShape)(o);return r[0]!==s||r[1]!==c.animations||r[2]!==c.scene?(t=()=>{let e=(0,l.getPosedNodeTransform)(c.scene,c.animations,"Eye");e?s.current.set(e.position.z,e.position.y,-e.position.x):s.current.set(0,l.DEFAULT_EYE_HEIGHT,0)},r[0]=s,r[1]=c.animations,r[2]=c.scene,r[3]=t):t=r[3],r[4]!==s||r[5]!==c?(i=[c,s],r[4]=s,r[5]=c,r[6]=i):i=r[6],(0,a.useEffect)(t,i),null}e.s(["PlayerEyeOffset",()=>O,"PlayerModel",()=>I],9721)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/4c292ca57f1d49be.js b/docs/_next/static/chunks/4c292ca57f1d49be.js new file mode 100644 index 00000000..82858470 --- /dev/null +++ b/docs/_next/static/chunks/4c292ca57f1d49be.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,32424,7368,e=>{"use strict";var t=e.i(25645),r=e.i(12979);let a=(0,t.createLogger)("scriptLoader");function i(){return async e=>{let t;try{t=(0,r.getUrlForPath)(e)}catch(t){return a.warn("Script not in manifest: %s (%s)",e,t),null}try{let r=await fetch(t);if(!r.ok)return a.error("Script fetch failed: %s (%d)",e,r.status),null;return await r.text()}catch(t){return a.error("Script fetch error: %s %o",e,t),null}}}e.s(["createScriptLoader",()=>i],32424),e.s(["ignoreScripts",0,["scripts/admin.cs","scripts/ai.cs","scripts/aiBotProfiles.cs","scripts/aiBountyGame.cs","scripts/aiChat.cs","scripts/aiCnH.cs","scripts/aiCTF.cs","scripts/aiDeathMatch.cs","scripts/aiDebug.cs","scripts/aiDefaultTasks.cs","scripts/aiDnD.cs","scripts/aiHumanTasks.cs","scripts/aiHunters.cs","scripts/aiInventory.cs","scripts/aiObjectiveBuilder.cs","scripts/aiObjectives.cs","scripts/aiRabbit.cs","scripts/aiSiege.cs","scripts/aiTDM.cs","scripts/aiTeamHunters.cs","scripts/deathMessages.cs","scripts/graphBuild.cs","scripts/navGraph.cs","scripts/serverTasks.cs","scripts/spdialog.cs"]],7368)},91285,e=>{"use strict";var t=e.i(43476),r=e.i(932),a=e.i(66027),i=e.i(54970),s=e.i(12979),o=e.i(32424),n=e.i(71645);let c=(0,n.createContext)(null);function p(e){let a,i=(0,r.c)(3),{runtime:s,children:o}=e;return i[0]!==o||i[1]!==s?(a=(0,t.jsx)(c.Provider,{value:s,children:o}),i[0]=o,i[1]=s,i[2]=a):a=i[2],a}var l=e.i(86608),u=e.i(38433),m=e.i(33870),d=e.i(91996);let g=(0,n.createContext)(null).Provider;var y=e.i(58647),f=e.i(92224),S=e.i(7368),h=e.i(62395),P=e.i(9672);function T(e,t){if(t)return e.state.datablocks.get(t)}let F=(0,e.i(25645).createLogger)("Mission"),v=(0,o.createScriptLoader)(),M=(0,m.createScriptCache)(),b={findFiles:e=>{let t=(0,i.default)(e,{nocase:!0});return(0,d.getResourceList)().filter(e=>t(e)).map(e=>{let[,t]=(0,d.getSourceAndPath)(e);return t})},isFile:e=>null!=(0,d.getResourceMap)()[(0,d.getResourceKey)(e)]};function k(e){"batch.flushed"===e.type&&y.engineStore.getState().applyRuntimeBatch(e.events,{tick:e.tick})}function B(e){e instanceof Error&&"AbortError"===e.name||F.error("Mission runtime failed to become ready: %o",e)}let D=(0,n.memo)(function(e){let i,o,c,m,d,F,D,L=(0,r.c)(13),{name:C,missionType:I,onLoadingChange:A}=e,{data:E}=((D=(0,r.c)(2))[0]!==C?(F={queryKey:["parsedMission",C],queryFn:()=>(0,s.loadMission)(C)},D[0]=C,D[1]=F):F=D[1],(0,a.useQuery)(F)),{ready:w,runtime:x,progress:R}=function(e,t,a){let i,s,o,c=(0,r.c)(6);c[0]===Symbol.for("react.memo_cache_sentinel")?(i={ready:!1,runtime:void 0,progress:0},c[0]=i):i=c[0];let[p,m]=(0,n.useState)(i);return c[1]!==e||c[2]!==t||c[3]!==a?(s=()=>{if(!a)return;let r=new AbortController,i=!1,s=null,o=(0,u.createProgressTracker)(),n=()=>{m(e=>({...e,progress:o.progress}))};o.on("update",n);let{runtime:c,ready:p}=(0,l.runServer)({missionName:e,missionType:t,runtimeOptions:{loadScript:v,fileSystem:b,cache:M,signal:r.signal,progress:o,ignoreScripts:S.ignoreScripts}});return p.then(()=>{if(i||r.signal.aborted)return;y.engineStore.getState().setRuntime(c);let a=c.getObjectByName("MissionGroup");if(a){let r=function e(t,r,a,i){let s=[],o=i;if("SimGroup"===t._className){if(t._name?.toLowerCase()==="teams")o=void 0;else if(void 0===o&&t._name){let e=t._name.match(/^team(\d+)$/i);e&&(o=parseInt(e[1],10))}}let n=function(e,t,r){let a=e._className,i=`mission_${e._id}`,s=(0,h.getPosition)(e),o=(0,h.getScale)(e),n=function(e){let[t,r,a,i]=e.split(" ").map(parseFloat),s=-(i||0)*Math.PI/360,o=Math.sin(s),n=Math.cos(s),c=Math.sqrt((r||0)*(r||0)+(a||0)*(a||0)+(t||0)*(t||0));return c<1e-8?[0,0,0,1]:[(r||0)/c*o,(a||0)/c*o,(t||0)/c*o,n]}(e.rotation??"1 0 0 0"),c=(0,h.getProperty)(e,"dataBlock")??"",p=T(t,c),l=(0,h.getProperty)(e,"missionTypesList"),u={id:i,className:a,runtimeObject:e,missionTypesList:l},m={...u,position:s,rotation:n,scale:o};switch(a){case"TerrainBlock":return{...u,renderType:"TerrainBlock",terrainData:(0,P.terrainFromMis)(e)};case"InteriorInstance":return{...u,renderType:"InteriorInstance",interiorData:(0,P.interiorFromMis)(e)};case"Sky":return{...u,renderType:"Sky",skyData:(0,P.skyFromMis)(e)};case"Sun":return{...u,renderType:"Sun",sunData:(0,P.sunFromMis)(e)};case"WaterBlock":return{...u,renderType:"WaterBlock",waterData:(0,P.waterBlockFromMis)(e)};case"MissionArea":return{...u,renderType:"MissionArea",missionAreaData:(0,P.missionAreaFromMis)(e)};case"StaticShape":case"Item":case"Turret":case"TSStatic":var d=m,g=e,y=p,f=t,S=a,F=r,v=c;let M="TSStatic"===S?(0,h.getProperty)(g,"shapeName"):(0,h.getProperty)(y,"shapeFile"),b={...d,renderType:"Shape",shapeName:M,shapeType:"Turret"===S?"Turret":"Item"===S?"Item":"TSStatic"===S?"TSStatic":"StaticShape",dataBlock:v||void 0,teamId:F};if("Item"===S&&(b.rotate=function(e){if("string"==typeof e){let t=e.toLowerCase();return"0"!==t&&"false"!==t&&""!==t}return!!e}((0,h.getProperty)(g,"rotate")??(0,h.getProperty)(y,"rotate"))),"Turret"===S){let e=(0,h.getProperty)(g,"initialBarrel");if(e){let t=T(f,e);b.barrelShapeName=(0,h.getProperty)(t,"shapeFile")}}return b;case"ForceFieldBare":return function(e,t,r,a){let i,s=(0,h.getProperty)(r,"color"),o=s?[(i=s.split(" ").map(e=>parseFloat(e)))[0]??0,i[1]??0,i[2]??0]:[1,1,1],n=parseFloat((0,h.getProperty)(r,"baseTranslucency"))||1,c=parseInt((0,h.getProperty)(r,"numFrames"),10)||1,p=parseFloat((0,h.getProperty)(r,"framesPerSec"))||1,l=parseFloat((0,h.getProperty)(r,"scrollSpeed"))||0,u=parseFloat((0,h.getProperty)(r,"umapping"))||1,m=parseFloat((0,h.getProperty)(r,"vmapping"))||1,d=[];for(let e=0;e {i=!0,o.off("update",n),r.abort(),s?.(),y.engineStore.getState().clearRuntime(),f.gameEntityStore.getState().clearEntities(),c.destroy()}},o=[e,t,a],c[1]=e,c[2]=t,c[3]=a,c[4]=s,c[5]=o):(s=c[4],o=c[5]),(0,n.useEffect)(s,o),p}(C,I,E),_=!E||!w||!x;L[0]!==I||L[1]!==E?(i={metadata:E,missionType:I},L[0]=I,L[1]=E,L[2]=i):i=L[2];let j=i;return(L[3]!==_||L[4]!==A||L[5]!==R?(o=()=>{A?.(_,R)},c=[_,R,A],L[3]=_,L[4]=A,L[5]=R,L[6]=o,L[7]=c):(o=L[6],c=L[7]),(0,n.useEffect)(o,c),_)?null:(L[8]!==x?(m=(0,t.jsx)(p,{runtime:x}),L[8]=x,L[9]=m):m=L[9],L[10]!==j||L[11]!==m?(d=(0,t.jsx)(g,{value:j,children:m}),L[10]=j,L[11]=m,L[12]=d):d=L[12],d)});e.s(["Mission",0,D],91285)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/4fb9edf01fb5e4f5.js b/docs/_next/static/chunks/4fb9edf01fb5e4f5.js new file mode 100644 index 00000000..ba9ebe95 --- /dev/null +++ b/docs/_next/static/chunks/4fb9edf01fb5e4f5.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,0,t=>{"use strict";t.i(50593);var e=t.i(17711),s=t.i(58281);t.i(70847);var a=t.i(47566),i=t.i(25311),o=t.i(89119),r=t.i(10244);class n extends r.StreamEngine{parser;initialBlock;moveTicks=0;absoluteYaw=0;absolutePitch=0;lastAbsYaw=0;lastAbsPitch=0;exhausted=!1;_teamScoresGen=0;_rosterGen=0;_weaponsHudGen=0;_inventoryHudGen=0;_cachedSnapshot=null;_cachedSnapshotTick=-1;_snap=null;constructor(t){super(),this.parser=t,this.registry=t.getRegistry(),this.ghostTracker=t.getGhostTracker();const e=t.initialBlock;this.initialBlock={dataBlocks:e.dataBlocks,initialGhosts:e.initialGhosts,controlObjectGhostIndex:e.controlObjectGhostIndex,controlObjectData:e.controlObjectData,targetEntries:e.targetEntries,sensorGroupColors:e.sensorGroupColors,taggedStrings:e.taggedStrings,initialEvents:e.initialEvents,demoValues:e.demoValues,firstPerson:e.firstPerson},this.reset()}getDataBlockData(t){let e=this.initialBlock.dataBlocks.get(t);if(e?.data)return e.data;let s=this.parser.getPacketParser();return s.dataBlockDataMap?.get(t)}_shapeConstructorCache=null;getShapeConstructorSequences(t){if(!this._shapeConstructorCache)for(let[,t]of(this._shapeConstructorCache=new Map,this.initialBlock.dataBlocks)){if("TSShapeConstructor"!==t.className||!t.data)continue;let e=t.data.shape,s=t.data.sequences;e&&s&&this._shapeConstructorCache.set(e.toLowerCase(),s)}return this._shapeConstructorCache.get(t.toLowerCase())}getTimeSec(){return this.moveTicks*(i.TICK_DURATION_MS/1e3)}getCameraYawPitch(t){let e="player"===this.lastControlType,s=e?this.absoluteYaw:this.lastAbsYaw,a=e?this.absolutePitch:this.lastAbsPitch;return e&&(this.lastAbsYaw=s,this.lastAbsPitch=a),{yaw:s,pitch:a}}getControlPlayerHeadPitch(t){return(0,o.clamp)(this.absolutePitch/o.MAX_PITCH,-1,1)}onTeamScoresChanged(){this._teamScoresGen++}onRosterChanged(){this._rosterGen++}onWeaponsHudChanged(){this._weaponsHudGen++}onInventoryHudChanged(){this._inventoryHudGen++}reset(){for(let[t,e]of(this.parser.reset(),this.ghostTracker=this.parser.getGhostTracker(),this._cachedSnapshot=null,this._cachedSnapshotTick=-1,this._snap=null,this.resetSharedState(),this.initialBlock.taggedStrings))this.netStrings.set(t,e);for(let t of this.initialBlock.targetEntries)t.name&&this.targetNames.set(t.targetId,(0,o.stripTaggedStringMarkup)(t.name)),this.targetTeams.set(t.targetId,t.sensorGroup),this.targetRenderFlags.set(t.targetId,t.targetData);for(let t of this.initialBlock.sensorGroupColors){let e=this.sensorGroupColors.get(t.group);e||(e=new Map,this.sensorGroupColors.set(t.group,e)),e.set(t.targetGroup,{r:t.r,g:t.g,b:t.b})}if(this.moveTicks=0,this.absoluteYaw=0,this.absolutePitch=0,this.lastAbsYaw=0,this.lastAbsPitch=0,this.firstPerson=this.initialBlock.firstPerson,this.lastControlType=(0,o.detectControlObjectType)(this.initialBlock.controlObjectData)??"player",this.isPiloting="player"===this.lastControlType&&!!(this.initialBlock.controlObjectData?.pilot||this.initialBlock.controlObjectData?.controlObjectGhost!=null),this.lastPilotGhostIndex=this.isPiloting&&"number"==typeof this.initialBlock.controlObjectData?.controlObjectGhost?this.initialBlock.controlObjectData.controlObjectGhost:void 0,this.isPiloting){let t=this.initialBlock.controlObjectData?.controlObjectData,e=t?.angPosition;if(e&&"number"==typeof e.w){this.lastVehicleHeading=(0,o.torqueQuatHeading)(e),this.lastVehiclePitch=(0,o.torqueQuatPitch)(e);let t=(0,o.torqueQuatToThreeJS)(e);if(t){let[e,s,a,i]=t;this.lastVehicleOrbitDir=[-(1-2*(s*s+a*a)),-(2*(e*s+a*i)),-(2*(e*a-s*i))]}}}if(this.lastCameraMode="camera"===this.lastControlType&&"number"==typeof this.initialBlock.controlObjectData?.cameraMode?this.initialBlock.controlObjectData.cameraMode:void 0,this.lastOrbitGhostIndex="camera"===this.lastControlType&&"number"==typeof this.initialBlock.controlObjectData?.orbitObjectGhostIndex?this.initialBlock.controlObjectData.orbitObjectGhostIndex:void 0,"camera"===this.lastControlType){let t=this.initialBlock.controlObjectData?.minOrbitDist,e=this.initialBlock.controlObjectData?.maxOrbitDist,s=this.initialBlock.controlObjectData?.curOrbitDist;"number"==typeof t&&"number"==typeof e&&Number.isFinite(t)&&Number.isFinite(e)?this.lastOrbitDistance=Math.max(0,e-t):"number"==typeof s&&Number.isFinite(s)?this.lastOrbitDistance=Math.max(0,s):this.lastOrbitDistance=void 0}else this.lastOrbitDistance=void 0;let t=this.getAbsoluteRotation(this.initialBlock.controlObjectData);for(let e of(t&&(this.absoluteYaw=t.yaw,this.absolutePitch=t.pitch,this.lastAbsYaw=t.yaw,this.lastAbsPitch=t.pitch),this.exhausted=!1,this.latestFov=100,this.latestControl={ghostIndex:this.initialBlock.controlObjectGhostIndex,data:this.initialBlock.controlObjectData,position:(0,o.isValidPosition)(this.initialBlock.controlObjectData?.position)?this.initialBlock.controlObjectData?.position:void 0},this.controlPlayerGhostId="player"===this.lastControlType&&this.initialBlock.controlObjectGhostIndex>=0?(0,i.toEntityId)("Player",this.initialBlock.controlObjectGhostIndex):void 0,this.initialBlock.initialGhosts)){if("create"!==e.type||null==e.classId)continue;let t=this.registry.getGhostParser(e.classId)?.name;if(!t)throw Error(`No ghost parser for classId ${e.classId} (ghost index ${e.index})`);let s=(0,i.toEntityId)(t,e.index),o={id:s,ghostIndex:e.index,className:t,spawnTick:0,type:(0,i.toEntityType)(t),rotation:[0,0,0,1]};if(this.applyGhostData(o,e.parsedData),e.parsedData){let s=(0,a.ghostToSceneObject)(t,e.index,e.parsedData);s&&(o.sceneData=s)}this.entities.set(s,o),this.entityIdByGhostIndex.set(e.index,s)}if(0===this.playerSensorGroup&&"player"===this.lastControlType&&this.latestControl.ghostIndex>=0){let t=this.entityIdByGhostIndex.get(this.latestControl.ghostIndex),e=t?this.entities.get(t):void 0;e?.sensorGroup!=null&&e.sensorGroup>0&&(this.playerSensorGroup=e.sensorGroup)}for(let t of this.initialBlock.initialEvents){let e=this.registry.getEventParser(t.classId)?.name;if("SetSensorGroupEvent"===e&&t.parsedData){let e=t.parsedData.sensorGroup;null!=e&&(this.playerSensorGroup=e)}else if("RemoteCommandEvent"===e&&t.parsedData){let e=this.resolveNetString(t.parsedData.funcName),s=t.parsedData.args;"ServerMessage"===e&&this.handleServerMessage(s),this.handleHudRemoteCommand(e,s)}}let e=function(t){let e={weaponsHud:null,backpackHud:null,inventoryHud:null,teamScores:[],playerRoster:new Map,chatMessages:[],gravity:-20};if(!t.length)return e;let s=0,a=()=>{let e=t[s++];return" "===e?"":e??""};if(a(),s>=t.length)return e;let i=parseInt(a(),10)||0,r=new Map;for(let t=0;t0&&r.set(o,(r.get(o)??0)+1)}if(s>=t.length||(a(),s>=t.length))return e;{let t=a().split(" "),s=t[0]??"",i="1"===t[1]||"true"===t[1],r=t[2]??"",n="1"===t[4]||"true"===t[4];i&&s&&(e.backpackHud={packIndex:(0,o.backpackBitmapToIndex)(s),active:n,text:r})}if(s>=t.length)return e;let n=a().split(" "),l=parseInt(n[4],10)||0,c=parseInt(n[5],10)||0,h=parseInt(n[6],10);for(let t=0;t =t.length)return e;let d=a().split(" "),u=parseInt(d[4],10)||0,m=parseInt(d[5],10)||0,k=parseInt(d[6],10);for(let t=0;t0)||t.set(s,i)}t.size>0&&(e.inventoryHud={slots:t,activeSlot:isNaN(k)?-1:k})}if(s>=t.length)return e;let b=a().split(" "),g=b[1]??"",y=parseInt(b[2],10)||0,f=[];for(let t=0;t =8)for(let t=0;t<2;t++){let s=4*t,a=t+1;e.teamScores.push({teamId:a,name:f[s]??"",score:parseInt(f[s+1],10)||0,playerCount:r.get(a)??0})}else if("TR2Game"===g&&y>=4)for(let t=0;t<2;t++){let s=2*t,a=t+1;e.teamScores.push({teamId:a,name:f[s+1]??"",score:parseInt(f[s],10)||0,playerCount:r.get(a)??0})}if(s>=t.length)return e;a();for(let i=0;i<10&&!(s>=t.length);i++){let t=a();t&&e.chatMessages.push(t)}if(s t.text).join("");if(!s.trim())continue;let a=e[0].colorCode;if(e.some(t=>3===t.colorCode||4===t.colorCode)&&s.includes(": ")){let t=s.indexOf(": ");this.pushChatMessage({timeSec:0,sender:s.slice(0,t),text:s.slice(t+2),kind:"chat",colorCode:a,segments:e})}else this.pushChatMessage({timeSec:0,sender:"",text:s,kind:"server",colorCode:a,segments:e})}this.updateCameraAndHud()}getSnapshot(){if(this._cachedSnapshot&&this._cachedSnapshotTick===this.moveTicks)return this._cachedSnapshot;let t=this.buildSnapshot();return this._cachedSnapshot=t,this._cachedSnapshotTick=this.moveTicks,t}getEffectShapes(){let t=new Set,e=e=>{let s=e.dtsFileName;s&&t.add(s);let a=e.subExplosions;if(Array.isArray(a))for(let e of a){if(null==e)continue;let s=this.getDataBlockData(e);s?.dtsFileName&&t.add(s.dtsFileName)}};for(let[,t]of this.initialBlock.dataBlocks){let s=t.data?.explosion;if(null==s)continue;let a=this.getDataBlockData(s);a&&e(a)}return[...t]}stepToTime(t,e=1/0){let s=Math.floor(1e3*(Number.isFinite(t)?Math.max(0,t):0)/i.TICK_DURATION_MS),a=!1;s ({index:t,ammo:e})),activeIndex:this.weaponsHud.activeIndex},n=a&&a.inventoryHudGen===this._inventoryHudGen?a.inventoryHud:{slots:Array.from(this.inventoryHud.slots.entries()).map(([t,e])=>({slot:t,count:e})),activeSlot:this.inventoryHud.activeSlot},l=a&&a.backpackPackIndex===this.backpackHud.packIndex&&a.backpackActive===this.backpackHud.active&&a.backpackText===this.backpackHud.text?a.backpackHud:this.backpackHud.packIndex>=0?{...this.backpackHud}:null;if(a&&a.teamScoresGen===this._teamScoresGen&&a.rosterGen===this._rosterGen)t=a.teamScores;else{t=this.teamScores.map(t=>({...t}));let e=new Map;for(let{teamId:t}of this.playerRoster.values())t>0&&e.set(t,(e.get(t)??0)+1);for(let s of t)s.playerCount=e.get(s.teamId)??0}return this._snap={teamScoresGen:this._teamScoresGen,rosterGen:this._rosterGen,teamScores:t,weaponsHudGen:this._weaponsHudGen,weaponsHud:r,inventoryHudGen:this._inventoryHudGen,inventoryHud:n,backpackPackIndex:this.backpackHud.packIndex,backpackActive:this.backpackHud.active,backpackText:this.backpackHud.text,backpackHud:l},{timeSec:s,exhausted:this.exhausted,camera:this.camera,entities:e,controlPlayerGhostId:this.controlPlayerGhostId,playerSensorGroup:this.playerSensorGroup,status:this.lastStatus,chatMessages:i,audioEvents:o,weaponsHud:r,backpackHud:l,inventoryHud:n,teamScores:t}}isPacketData(t){return!!t&&"object"==typeof t&&"gameState"in t&&"events"in t&&"ghosts"in t}isMoveData(t){return!!t&&"object"==typeof t&&"yaw"in t}isInfoData(t){return!!t&&"object"==typeof t&&"value1"in t&&"number"==typeof t.value1&&"value2"in t&&"number"==typeof t.value2}}async function l(t){let e=new s.DemoParser(new Uint8Array(t)),{header:a,initialBlock:i}=await e.load(),r=function(t){let e=null,s=null,a=null,i=null,r=null,n=null,l=null;for(let c=0;c =3&&h[1]?.endsWith("Game")&&(a=h[1]),"readplayerinfo"!==t[c])continue;let p=t[c+1];if(p){if(p.startsWith("1 ")){let t=p.split(" ");t[2]&&(n=(0,o.stripTaggedStringMarkup)(t[2]).trim());continue}if(p.startsWith("2 ")){let t=p.split(" ");t[1]&&(i=t[1]),t[3]&&(l=t[3]),t[4]&&(e=t[4]);continue}if(p.startsWith("3 ")){let t=p.split(" ");t[1]&&(r=t[1]),t[2]&&(s=t[2])}}}return{missionDisplayName:e,missionType:s,gameClassName:a,serverDisplayName:i,mod:r,recorderName:n,recordingDate:l}}(i.demoValues),l=new n(e);return l.missionDisplayName=r.missionDisplayName,l.missionTypeDisplayName=r.missionType,l.gameClassName=r.gameClassName,l.serverDisplayName=r.serverDisplayName,l.connectedPlayerName=r.recorderName,{source:"demo",duration:a.demoLengthMs/1e3,missionName:i.missionName??null,gameType:r.missionType,serverDisplayName:r.serverDisplayName,recorderName:r.recorderName,recordingDate:r.recordingDate,streamingPlayback:l}}t.s(["createDemoStreamingRecording",()=>l])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/534ef931e88eb989.js b/docs/_next/static/chunks/534ef931e88eb989.js deleted file mode 100644 index 8297a3c6..00000000 --- a/docs/_next/static/chunks/534ef931e88eb989.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,13070,e=>{e.v({Arrow:"KeyboardOverlay-module__HsRBsa__Arrow",Column:"KeyboardOverlay-module__HsRBsa__Column",Key:"KeyboardOverlay-module__HsRBsa__Key",Root:"KeyboardOverlay-module__HsRBsa__Root",Row:"KeyboardOverlay-module__HsRBsa__Row",Spacer:"KeyboardOverlay-module__HsRBsa__Spacer"})},78295,e=>{e.v({Joystick:"TouchControls-module__AkxfgW__Joystick",Left:"TouchControls-module__AkxfgW__Left TouchControls-module__AkxfgW__Joystick",Right:"TouchControls-module__AkxfgW__Right TouchControls-module__AkxfgW__Joystick"})},65883,e=>{e.v({ButtonLabel:"InspectorControls-module__gNRB6W__ButtonLabel",CheckboxField:"InspectorControls-module__gNRB6W__CheckboxField",Controls:"InspectorControls-module__gNRB6W__Controls",Dropdown:"InspectorControls-module__gNRB6W__Dropdown",Field:"InspectorControls-module__gNRB6W__Field",Group:"InspectorControls-module__gNRB6W__Group",IconButton:"InspectorControls-module__gNRB6W__IconButton",LabelledButton:"InspectorControls-module__gNRB6W__LabelledButton",MapInfoButton:"InspectorControls-module__gNRB6W__MapInfoButton InspectorControls-module__gNRB6W__IconButton InspectorControls-module__gNRB6W__LabelledButton",MissionSelectWrapper:"InspectorControls-module__gNRB6W__MissionSelectWrapper",Toggle:"InspectorControls-module__gNRB6W__Toggle InspectorControls-module__gNRB6W__IconButton"})},36679,e=>{e.v({ButtonLabel:"CopyCoordinatesButton-module__BxovtG__ButtonLabel "+e.i(65883).ButtonLabel,ClipboardCheck:"CopyCoordinatesButton-module__BxovtG__ClipboardCheck",MapPin:"CopyCoordinatesButton-module__BxovtG__MapPin",Root:"CopyCoordinatesButton-module__BxovtG__Root "+e.i(65883).IconButton+" "+e.i(65883).LabelledButton,showClipboardCheck:"CopyCoordinatesButton-module__BxovtG__showClipboardCheck"})},28903,e=>{e.v({ButtonLabel:"LoadDemoButton-module__kGZaoW__ButtonLabel "+e.i(65883).ButtonLabel,DemoIcon:"LoadDemoButton-module__kGZaoW__DemoIcon",Root:"LoadDemoButton-module__kGZaoW__Root "+e.i(65883).IconButton+" "+e.i(65883).LabelledButton})},9607,e=>{e.v({LiveIcon:"JoinServerButton-module__DIR70a__LiveIcon",PingLabel:"JoinServerButton-module__DIR70a__PingLabel "+e.i(65883).ButtonLabel,Pulsing:"JoinServerButton-module__DIR70a__Pulsing",Root:"JoinServerButton-module__DIR70a__Root "+e.i(65883).IconButton+" "+e.i(65883).LabelledButton,TextLabel:"JoinServerButton-module__DIR70a__TextLabel "+e.i(65883).ButtonLabel,blink:"JoinServerButton-module__DIR70a__blink"})},75840,e=>{e.v({BarFillEnergy:"PlayerHUD-module__-E1Scq__BarFillEnergy",BarFillHealth:"PlayerHUD-module__-E1Scq__BarFillHealth",BarTrack:"PlayerHUD-module__-E1Scq__BarTrack",Bars:"PlayerHUD-module__-E1Scq__Bars",ChatColor0:"PlayerHUD-module__-E1Scq__ChatColor0",ChatColor1:"PlayerHUD-module__-E1Scq__ChatColor1",ChatColor2:"PlayerHUD-module__-E1Scq__ChatColor2",ChatColor3:"PlayerHUD-module__-E1Scq__ChatColor3",ChatColor4:"PlayerHUD-module__-E1Scq__ChatColor4",ChatColor5:"PlayerHUD-module__-E1Scq__ChatColor5",ChatColor6:"PlayerHUD-module__-E1Scq__ChatColor6",ChatColor7:"PlayerHUD-module__-E1Scq__ChatColor7",ChatColor8:"PlayerHUD-module__-E1Scq__ChatColor8",ChatColor9:"PlayerHUD-module__-E1Scq__ChatColor9",ChatContainer:"PlayerHUD-module__-E1Scq__ChatContainer",ChatInput:"PlayerHUD-module__-E1Scq__ChatInput",ChatInputForm:"PlayerHUD-module__-E1Scq__ChatInputForm",ChatMessage:"PlayerHUD-module__-E1Scq__ChatMessage",ChatWindow:"PlayerHUD-module__-E1Scq__ChatWindow",Compass:"PlayerHUD-module__-E1Scq__Compass",CompassNSEW:"PlayerHUD-module__-E1Scq__CompassNSEW",CompassRing:"PlayerHUD-module__-E1Scq__CompassRing",PackInvCount:"PlayerHUD-module__-E1Scq__PackInvCount",PackInvIcon:"PlayerHUD-module__-E1Scq__PackInvIcon",PackInvInfinity:"PlayerHUD-module__-E1Scq__PackInvInfinity",PackInvItem:"PlayerHUD-module__-E1Scq__PackInvItem",PackInvItemActive:"PlayerHUD-module__-E1Scq__PackInvItemActive",PackInvItemDim:"PlayerHUD-module__-E1Scq__PackInvItemDim",PackInventoryHUD:"PlayerHUD-module__-E1Scq__PackInventoryHUD",PlayerHUD:"PlayerHUD-module__-E1Scq__PlayerHUD",Reticle:"PlayerHUD-module__-E1Scq__Reticle",ReticleDot:"PlayerHUD-module__-E1Scq__ReticleDot",ReticleImage:"PlayerHUD-module__-E1Scq__ReticleImage",TeamCount:"PlayerHUD-module__-E1Scq__TeamCount",TeamNameEnemy:"PlayerHUD-module__-E1Scq__TeamNameEnemy",TeamNameFriendly:"PlayerHUD-module__-E1Scq__TeamNameFriendly",TeamRow:"PlayerHUD-module__-E1Scq__TeamRow",TeamScore:"PlayerHUD-module__-E1Scq__TeamScore",TeamScores:"PlayerHUD-module__-E1Scq__TeamScores",TopRight:"PlayerHUD-module__-E1Scq__TopRight",WeaponHUD:"PlayerHUD-module__-E1Scq__WeaponHUD",WeaponSeparator:"PlayerHUD-module__-E1Scq__WeaponSeparator"})},56614,e=>{e.v({CloseButton:"ServerBrowser-module__kqm3eq__CloseButton "+e.i(6090).Secondary,Dialog:"ServerBrowser-module__kqm3eq__Dialog",Empty:"ServerBrowser-module__kqm3eq__Empty",Footer:"ServerBrowser-module__kqm3eq__Footer",Header:"ServerBrowser-module__kqm3eq__Header",Hint:"ServerBrowser-module__kqm3eq__Hint",JoinButton:"ServerBrowser-module__kqm3eq__JoinButton "+e.i(6090).DialogButton,Overlay:"ServerBrowser-module__kqm3eq__Overlay",PasswordIcon:"ServerBrowser-module__kqm3eq__PasswordIcon",RefreshButton:"ServerBrowser-module__kqm3eq__RefreshButton "+e.i(6090).DialogButton,Selected:"ServerBrowser-module__kqm3eq__Selected",ServerCount:"ServerBrowser-module__kqm3eq__ServerCount",Table:"ServerBrowser-module__kqm3eq__Table",TableWrapper:"ServerBrowser-module__kqm3eq__TableWrapper",Title:"ServerBrowser-module__kqm3eq__Title",WarriorField:"ServerBrowser-module__kqm3eq__WarriorField",WarriorInput:"ServerBrowser-module__kqm3eq__WarriorInput",WarriorLabel:"ServerBrowser-module__kqm3eq__WarriorLabel"})},3011,e=>{e.v({CanvasContainer:"page-module__E0kJGG__CanvasContainer",LoadingIndicator:"page-module__E0kJGG__LoadingIndicator",Progress:"page-module__E0kJGG__Progress",ProgressBar:"page-module__E0kJGG__ProgressBar",ProgressText:"page-module__E0kJGG__ProgressText",Spinner:"page-module__E0kJGG__Spinner",loadingComplete:"page-module__E0kJGG__loadingComplete",spin:"page-module__E0kJGG__spin"})},31713,e=>{"use strict";var t=e.i(43476),a=e.i(932),r=e.i(71645),n=e.i(75056),o=e.i(90072),s=e.i(66027),l=e.i(54970),i=e.i(12979),c=e.i(32424);let u=(0,r.createContext)(null);function d(e){let r,n=(0,a.c)(3),{runtime:o,children:s}=e;return n[0]!==s||n[1]!==o?(r=(0,t.jsx)(u.Provider,{value:o,children:s}),n[0]=s,n[1]=o,n[2]=r):r=n[2],r}var m=e.i(86608),h=e.i(38433),p=e.i(33870),f=e.i(91996);let _=(0,r.createContext)(null).Provider;e.i(13876);var g=e.i(58647),y=e.i(92224),v=e.i(7368),x=e.i(62395),b=e.i(9672);function k(e,t){if(t)return e.state.datablocks.get(t)}let S=(0,c.createScriptLoader)(),C=(0,p.createScriptCache)(),j={findFiles:e=>{let t=(0,l.default)(e,{nocase:!0});return(0,f.getResourceList)().filter(e=>t(e)).map(e=>{let[,t]=(0,f.getSourceAndPath)(e);return t})},isFile:e=>null!=(0,f.getResourceMap)()[(0,f.getResourceKey)(e)]};function w(e){"batch.flushed"===e.type&&g.engineStore.getState().applyRuntimeBatch(e.events,{tick:e.tick})}function N(e){e instanceof Error&&"AbortError"===e.name||console.error("Mission runtime failed to become ready:",e)}let I=(0,r.memo)(function(e){let n,o,l,c,u,p,f,I=(0,a.c)(13),{name:T,missionType:P,onLoadingChange:B}=e,{data:D}=((f=(0,a.c)(2))[0]!==T?(p={queryKey:["parsedMission",T],queryFn:()=>(0,i.loadMission)(T)},f[0]=T,f[1]=p):p=f[1],(0,s.useQuery)(p)),{ready:E,runtime:L,progress:R}=function(e,t,n){let o,s,l,i=(0,a.c)(6);i[0]===Symbol.for("react.memo_cache_sentinel")?(o={ready:!1,runtime:void 0,progress:0},i[0]=o):o=i[0];let[c,u]=(0,r.useState)(o);return i[1]!==e||i[2]!==t||i[3]!==n?(s=()=>{if(!n)return;let a=new AbortController,r=!1,o=null,s=(0,h.createProgressTracker)(),l=()=>{u(e=>({...e,progress:s.progress}))};s.on("update",l);let{runtime:i,ready:c}=(0,m.runServer)({missionName:e,missionType:t,runtimeOptions:{loadScript:S,fileSystem:j,cache:C,signal:a.signal,progress:s,ignoreScripts:v.ignoreScripts}});return c.then(()=>{if(r||a.signal.aborted)return;g.engineStore.getState().setRuntime(i);let e=i.getObjectByName("MissionGroup");if(e){let t=function e(t,a,r){let n=[],o=r;if("SimGroup"===t._className){if(t._name?.toLowerCase()==="teams")o=void 0;else if(void 0===o&&t._name){let e=t._name.match(/^team(\d+)$/i);e&&(o=parseInt(e[1],10))}}let s=function(e,t,a){let r=e._className,n=`mission_${e._id}`,o=(0,x.getPosition)(e),s=(0,x.getScale)(e),l=function(e){let[t,a,r,n]=e.split(" ").map(parseFloat),o=-(n||0)*Math.PI/360,s=Math.sin(o),l=Math.cos(o),i=Math.sqrt((a||0)*(a||0)+(r||0)*(r||0)+(t||0)*(t||0));return i<1e-8?[0,0,0,1]:[(a||0)/i*s,(r||0)/i*s,(t||0)/i*s,l]}(e.rotation??"1 0 0 0"),i=(0,x.getProperty)(e,"dataBlock")??"",c=k(t,i),u=(0,x.getProperty)(e,"missionTypesList"),d={id:n,className:r,runtimeObject:e,missionTypesList:u},m={...d,position:o,rotation:l,scale:s};switch(r){case"TerrainBlock":return{...d,renderType:"TerrainBlock",terrainData:(0,b.terrainFromMis)(e)};case"InteriorInstance":return{...d,renderType:"InteriorInstance",interiorData:(0,b.interiorFromMis)(e)};case"Sky":return{...d,renderType:"Sky",skyData:(0,b.skyFromMis)(e)};case"Sun":return{...d,renderType:"Sun",sunData:(0,b.sunFromMis)(e)};case"WaterBlock":return{...d,renderType:"WaterBlock",waterData:(0,b.waterBlockFromMis)(e)};case"MissionArea":return{...d,renderType:"MissionArea",missionAreaData:(0,b.missionAreaFromMis)(e)};case"StaticShape":case"Item":case"Turret":case"TSStatic":var h=m,p=e,f=c,_=t,g=r,y=a,v=i;let S="TSStatic"===g?(0,x.getProperty)(p,"shapeName"):(0,x.getProperty)(f,"shapeFile"),C={...h,renderType:"Shape",shapeName:S,shapeType:"Turret"===g?"Turret":"Item"===g?"Item":"TSStatic"===g?"TSStatic":"StaticShape",dataBlock:v||void 0,teamId:y};if("Item"===g&&(C.rotate=function(e){if("string"==typeof e){let t=e.toLowerCase();return"0"!==t&&"false"!==t&&""!==t}return!!e}((0,x.getProperty)(p,"rotate")??(0,x.getProperty)(f,"rotate"))),"Turret"===g){let e=(0,x.getProperty)(p,"initialBarrel");if(e){let t=k(_,e);C.barrelShapeName=(0,x.getProperty)(t,"shapeFile")}}return C;case"ForceFieldBare":return function(e,t,a,r){let n,o=(0,x.getProperty)(a,"color"),s=o?[(n=o.split(" ").map(e=>parseFloat(e)))[0]??0,n[1]??0,n[2]??0]:[1,1,1],l=parseFloat((0,x.getProperty)(a,"baseTranslucency"))||1,i=parseInt((0,x.getProperty)(a,"numFrames"),10)||1,c=parseFloat((0,x.getProperty)(a,"framesPerSec"))||1,u=parseFloat((0,x.getProperty)(a,"scrollSpeed"))||0,d=parseFloat((0,x.getProperty)(a,"umapping"))||1,m=parseFloat((0,x.getProperty)(a,"vmapping"))||1,h=[];for(let e=0;e{r=!0,s.off("update",l),a.abort(),o?.(),g.engineStore.getState().clearRuntime(),y.gameEntityStore.getState().clearEntities(),i.destroy()}},l=[e,t,n],i[1]=e,i[2]=t,i[3]=n,i[4]=s,i[5]=l):(s=i[4],l=i[5]),(0,r.useEffect)(s,l),c}(T,P,D),M=!D||!E||!L;I[0]!==P||I[1]!==D?(n={metadata:D,missionType:P},I[0]=P,I[1]=D,I[2]=n):n=I[2];let H=n;return(I[3]!==M||I[4]!==B||I[5]!==R?(o=()=>{B?.(M,R)},l=[M,R,B],I[3]=M,I[4]=B,I[5]=R,I[6]=o,I[7]=l):(o=I[6],l=I[7]),(0,r.useEffect)(o,l),M)?null:(I[8]!==L?(c=(0,t.jsx)(d,{runtime:L}),I[8]=L,I[9]=c):c=I[9],I[10]!==H||I[11]!==c?(u=(0,t.jsx)(_,{value:H,children:c}),I[10]=H,I[11]=c,I[12]=u):u=I[12],u)});var T=e.i(17751),P=e.i(12598),B=e.i(5729),D=e.i(12631),E=e.i(32865),L=e.i(13070);function R(){let e,r,n,o,s,l,i,c,u,d,m,h,p,f,_,g,y,v,x,b,k,S,C,j,w=(0,a.c)(51),N=(0,E.useRecording)(),I=(0,D.useKeyboardControls)(K),T=(0,D.useKeyboardControls)(W),P=(0,D.useKeyboardControls)(U),B=(0,D.useKeyboardControls)(A),R=(0,D.useKeyboardControls)(O),z=(0,D.useKeyboardControls)(q),$=(0,D.useKeyboardControls)(G),J=(0,D.useKeyboardControls)(F),V=(0,D.useKeyboardControls)(H),Y=(0,D.useKeyboardControls)(M);return N&&"live"!==N.source?null:(w[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("div",{className:L.default.Spacer}),w[0]=e):e=w[0],w[1]!==I?(r=(0,t.jsx)("div",{className:L.default.Key,"data-pressed":I,children:"W"}),w[1]=I,w[2]=r):r=w[2],w[3]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("div",{className:L.default.Spacer}),w[3]=n):n=w[3],w[4]!==r?(o=(0,t.jsxs)("div",{className:L.default.Row,children:[e,r,n]}),w[4]=r,w[5]=o):o=w[5],w[6]!==P?(s=(0,t.jsx)("div",{className:L.default.Key,"data-pressed":P,children:"A"}),w[6]=P,w[7]=s):s=w[7],w[8]!==T?(l=(0,t.jsx)("div",{className:L.default.Key,"data-pressed":T,children:"S"}),w[8]=T,w[9]=l):l=w[9],w[10]!==B?(i=(0,t.jsx)("div",{className:L.default.Key,"data-pressed":B,children:"D"}),w[10]=B,w[11]=i):i=w[11],w[12]!==s||w[13]!==l||w[14]!==i?(c=(0,t.jsxs)("div",{className:L.default.Row,children:[s,l,i]}),w[12]=s,w[13]=l,w[14]=i,w[15]=c):c=w[15],w[16]!==o||w[17]!==c?(u=(0,t.jsxs)("div",{className:L.default.Column,children:[o,c]}),w[16]=o,w[17]=c,w[18]=u):u=w[18],w[19]===Symbol.for("react.memo_cache_sentinel")?(d=(0,t.jsx)("span",{className:L.default.Arrow,children:"↑"}),w[19]=d):d=w[19],w[20]!==R?(m=(0,t.jsx)("div",{className:L.default.Row,children:(0,t.jsxs)("div",{className:L.default.Key,"data-pressed":R,children:[d," Space"]})}),w[20]=R,w[21]=m):m=w[21],w[22]===Symbol.for("react.memo_cache_sentinel")?(h=(0,t.jsx)("span",{className:L.default.Arrow,children:"↓"}),w[22]=h):h=w[22],w[23]!==z?(p=(0,t.jsx)("div",{className:L.default.Row,children:(0,t.jsxs)("div",{className:L.default.Key,"data-pressed":z,children:[h," Shift"]})}),w[23]=z,w[24]=p):p=w[24],w[25]!==m||w[26]!==p?(f=(0,t.jsxs)("div",{className:L.default.Column,children:[m,p]}),w[25]=m,w[26]=p,w[27]=f):f=w[27],w[28]===Symbol.for("react.memo_cache_sentinel")?(_=(0,t.jsx)("div",{className:L.default.Spacer}),w[28]=_):_=w[28],w[29]!==$?(g=(0,t.jsx)("div",{className:L.default.Key,"data-pressed":$,children:"↑"}),w[29]=$,w[30]=g):g=w[30],w[31]===Symbol.for("react.memo_cache_sentinel")?(y=(0,t.jsx)("div",{className:L.default.Spacer}),w[31]=y):y=w[31],w[32]!==g?(v=(0,t.jsxs)("div",{className:L.default.Row,children:[_,g,y]}),w[32]=g,w[33]=v):v=w[33],w[34]!==V?(x=(0,t.jsx)("div",{className:L.default.Key,"data-pressed":V,children:"←"}),w[34]=V,w[35]=x):x=w[35],w[36]!==J?(b=(0,t.jsx)("div",{className:L.default.Key,"data-pressed":J,children:"↓"}),w[36]=J,w[37]=b):b=w[37],w[38]!==Y?(k=(0,t.jsx)("div",{className:L.default.Key,"data-pressed":Y,children:"→"}),w[38]=Y,w[39]=k):k=w[39],w[40]!==x||w[41]!==b||w[42]!==k?(S=(0,t.jsxs)("div",{className:L.default.Row,children:[x,b,k]}),w[40]=x,w[41]=b,w[42]=k,w[43]=S):S=w[43],w[44]!==v||w[45]!==S?(C=(0,t.jsxs)("div",{className:L.default.Column,children:[v,S]}),w[44]=v,w[45]=S,w[46]=C):C=w[46],w[47]!==f||w[48]!==C||w[49]!==u?(j=(0,t.jsxs)("div",{className:L.default.Root,children:[u,f,C]}),w[47]=f,w[48]=C,w[49]=u,w[50]=j):j=w[50],j)}function M(e){return e.lookRight}function H(e){return e.lookLeft}function F(e){return e.lookDown}function G(e){return e.lookUp}function q(e){return e.down}function O(e){return e.up}function A(e){return e.right}function U(e){return e.left}function W(e){return e.backward}function K(e){return e.forward}var z=e.i(71753),$=e.i(15080),J=e.i(79123),V=e.i(78295);function Y(e){let t=e.querySelector(".back");t&&(t.style.background="rgba(3, 79, 76, 0.6)",t.style.border="1px solid rgba(0, 219, 223, 0.5)",t.style.boxShadow="inset 0 0 10px rgba(0, 0, 0, 0.7)");let a=e.querySelector(".front");a&&(a.style.background="radial-gradient(circle at 50% 50%, rgba(23, 247, 198, 0.9) 0%, rgba(9, 184, 170, 0.95) 100%)",a.style.border="2px solid rgba(255, 255, 255, 0.4)",a.style.boxShadow="0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 1px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15), inset 0 -1px 2px rgba(0, 0, 0, 0.3)")}let X=Math.PI/2-.01;function Q({joystickState:a,joystickZone:n,lookJoystickState:o,lookJoystickZone:s}){let{touchMode:l}=(0,J.useControls)();(0,r.useEffect)(()=>{let t=n.current;if(!t)return;let r=null,o=!1;return e.A(84968).then(e=>{o||(r=e.default.create({zone:t,mode:"static",position:{left:"70px",bottom:"70px"},size:120,restOpacity:.9}),Y(t),r.on("move",(e,t)=>{a.current.angle=t.angle.radian,a.current.force=Math.min(1,t.force)}),r.on("end",()=>{a.current.force=0}))}),()=>{o=!0,r?.destroy()}},[a,n,l]),(0,r.useEffect)(()=>{if("dualStick"!==l)return;let t=s.current;if(!t)return;let a=null,r=!1;return e.A(84968).then(e=>{r||(a=e.default.create({zone:t,mode:"static",position:{right:"70px",bottom:"70px"},size:120,restOpacity:.9}),Y(t),a.on("move",(e,t)=>{o.current.angle=t.angle.radian,o.current.force=Math.min(1,t.force)}),a.on("end",()=>{o.current.force=0}))}),()=>{r=!0,a?.destroy()}},[l,o,s]);let i=()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur()};return"dualStick"===l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{ref:n,className:V.default.Left,onContextMenu:e=>e.preventDefault(),onTouchStart:i}),(0,t.jsx)("div",{ref:s,className:V.default.Right,onContextMenu:e=>e.preventDefault(),onTouchStart:i})]}):(0,t.jsx)("div",{ref:n,className:V.default.Joystick,onContextMenu:e=>e.preventDefault(),onTouchStart:i})}function Z(e){let t,n,s,l,i,c,u,d,m,h,p=(0,a.c)(25),{joystickState:f,joystickZone:_,lookJoystickState:g}=e,{speedMultiplier:y,touchMode:v}=(0,J.useControls)(),{camera:x,gl:b}=(0,$.useThree)();p[0]===Symbol.for("react.memo_cache_sentinel")?(t=new o.Euler(0,0,0,"YXZ"),p[0]=t):t=p[0];let k=(0,r.useRef)(t),S=(0,r.useRef)(null);p[1]===Symbol.for("react.memo_cache_sentinel")?(n={x:0,y:0},p[1]=n):n=p[1];let C=(0,r.useRef)(n);p[2]===Symbol.for("react.memo_cache_sentinel")?(s=new o.Vector3,p[2]=s):s=p[2];let j=(0,r.useRef)(s);p[3]===Symbol.for("react.memo_cache_sentinel")?(l=new o.Vector3,p[3]=l):l=p[3];let w=(0,r.useRef)(l);p[4]===Symbol.for("react.memo_cache_sentinel")?(i=new o.Vector3,p[4]=i):i=p[4];let N=(0,r.useRef)(i);return p[5]!==x.quaternion?(c=()=>{k.current.setFromQuaternion(x.quaternion,"YXZ")},p[5]=x.quaternion,p[6]=c):c=p[6],p[7]!==x?(u=[x],p[7]=x,p[8]=u):u=p[8],(0,r.useEffect)(c,u),p[9]!==x.quaternion||p[10]!==b.domElement||p[11]!==_||p[12]!==v?(d=()=>{if("moveLookStick"!==v)return;let e=b.domElement,t=e=>{let t=_.current;if(!t)return!1;let a=t.getBoundingClientRect();return e.clientX>=a.left&&e.clientX<=a.right&&e.clientY>=a.top&&e.clientY<=a.bottom},a=e=>{if(null===S.current)for(let a=0;a {if(null!==S.current)for(let t=0;t {for(let t=0;t {e.removeEventListener("touchstart",a),e.removeEventListener("touchmove",r),e.removeEventListener("touchend",n),e.removeEventListener("touchcancel",n),S.current=null}},p[9]=x.quaternion,p[10]=b.domElement,p[11]=_,p[12]=v,p[13]=d):d=p[13],p[14]!==x||p[15]!==b.domElement||p[16]!==_||p[17]!==v?(m=[x,b.domElement,_,v],p[14]=x,p[15]=b.domElement,p[16]=_,p[17]=v,p[18]=m):m=p[18],(0,r.useEffect)(d,m),p[19]!==x||p[20]!==f.current||p[21]!==g||p[22]!==y||p[23]!==v?(h=(e,t)=>{let{force:a,angle:r}=f.current;if("dualStick"===v){let e=g.current;if(e.force>.15){let a=(e.force-.15)/.85,r=Math.cos(e.angle),n=Math.sin(e.angle);k.current.setFromQuaternion(x.quaternion,"YXZ"),k.current.y=k.current.y-r*a*2.5*t,k.current.x=k.current.x+n*a*2.5*t,k.current.x=Math.max(-X,Math.min(X,k.current.x)),x.quaternion.setFromEuler(k.current)}if(a>.08){let e=80*y*((a-.08)/.92),n=Math.cos(r),o=Math.sin(r);x.getWorldDirection(j.current),j.current.normalize(),w.current.crossVectors(x.up,j.current).normalize(),N.current.set(0,0,0).addScaledVector(j.current,o).addScaledVector(w.current,-n),N.current.lengthSq()>0&&(N.current.normalize().multiplyScalar(e*t),x.position.add(N.current))}}else if("moveLookStick"===v&&a>0){let e=80*y*.5;if(x.getWorldDirection(j.current),j.current.normalize(),N.current.copy(j.current).multiplyScalar(e*t),x.position.add(N.current),a>=.15){let e=Math.cos(r),n=Math.sin(r),o=(a-.15)/.85;k.current.setFromQuaternion(x.quaternion,"YXZ"),k.current.y=k.current.y-e*o*1.25*t,k.current.x=k.current.x+n*o*1.25*t,k.current.x=Math.max(-X,Math.min(X,k.current.x)),x.quaternion.setFromEuler(k.current)}}},p[19]=x,p[20]=f.current,p[21]=g,p[22]=y,p[23]=v,p[24]=h):h=p[24],(0,z.useFrame)(h),null}var ee=e.i(11889),et=e.i(56373),ea=e.i(86447),er=e.i(1559),en=e.i(78440),eo=e.i(59129),es=e.i(25998),el=e.i(18364),ei=e.i(70238),ec=e.i(29402),eu=e.i(97442);let ed=new Set(["SkiFree","SkiFree_Daily","SkiFree_Randomizer"]),em={"missions.vl2":"Official","TR2final105-client.vl2":"Team Rabbit 2","z_mappacks/CTF/Classic_maps_v1.vl2":"Classic","z_mappacks/CTF/DynamixFinalPack.vl2":"Official","z_mappacks/CTF/KryMapPack_b3EDIT.vl2":"KryMapPack","z_mappacks/CTF/S5maps.vl2":"S5","z_mappacks/CTF/S8maps.vl2":"S8","z_mappacks/CTF/TWL-MapPack.vl2":"TWL","z_mappacks/CTF/TWL-MapPackEDIT.vl2":"TWL","z_mappacks/CTF/TWL2-MapPack.vl2":"TWL2","z_mappacks/CTF/TWL2-MapPackEDIT.vl2":"TWL2","z_mappacks/TWL_T2arenaOfficialMaps.vl2":"Arena","z_mappacks/xPack2.vl2":"xPack2","z_mappacks/z_DMP2-V0.6.vl2":"DMP2 (Discord Map Pack)","z_mappacks/zDMP-4.7.3DX.vl2":"DMP (Discord Map Pack)","z_mappacks/zDMP-4.7.3DX-ServerOnly.vl2":"DMP (Discord Map Pack)"},eh={"z_mappacks/DM":"DM","z_mappacks/LCTF":"LCTF","z_mappacks/Lak":"LakRabbit"},ep=(0,f.getMissionList)().filter(e=>!ed.has(e)).map(e=>{let t,a=(0,f.getMissionInfo)(e),[r]=(0,f.getSourceAndPath)(a.resourcePath),n=(t=r.match(/^(.*)(\/[^/]+)$/))?t[1]:"",o=em[r]??eh[n]??null;return{resourcePath:a.resourcePath,missionName:e,displayName:a.displayName,sourcePath:r,groupName:o,missionTypes:a.missionTypes}}),ef=new Map(ep.map(e=>[e.missionName,e])),e_=function(e){let t=new Map;for(let a of e){let e=t.get(a.groupName)??[];e.push(a),t.set(a.groupName,e)}return t.forEach((e,a)=>{t.set(a,(0,ec.default)(e,[e=>(e.displayName||e.missionName).toLowerCase()],["asc"]))}),(0,ec.default)(Array.from(t.entries()),[([e])=>"Official"===e?0:null==e?2:1,([e])=>e?e.toLowerCase():""],["asc","asc"])}(ep),eg="u">typeof navigator&&/Mac|iPhone|iPad|iPod/.test(navigator.platform);function ey(e){let r,n,o,s,l,i=(0,a.c)(12),{mission:c}=e,u=c.displayName||c.missionName;return i[0]!==u?(r=(0,t.jsx)("span",{className:eu.default.ItemName,children:u}),i[0]=u,i[1]=r):r=i[1],i[2]!==c.missionTypes?(n=c.missionTypes.length>0&&(0,t.jsx)("span",{className:eu.default.ItemTypes,children:c.missionTypes.map(ev)}),i[2]=c.missionTypes,i[3]=n):n=i[3],i[4]!==r||i[5]!==n?(o=(0,t.jsxs)("span",{className:eu.default.ItemHeader,children:[r,n]}),i[4]=r,i[5]=n,i[6]=o):o=i[6],i[7]!==c.missionName?(s=(0,t.jsx)("span",{className:eu.default.ItemMissionName,children:c.missionName}),i[7]=c.missionName,i[8]=s):s=i[8],i[9]!==o||i[10]!==s?(l=(0,t.jsxs)(t.Fragment,{children:[o,s]}),i[9]=o,i[10]=s,i[11]=l):l=i[11],l}function ev(e){return(0,t.jsx)("span",{className:eu.default.ItemType,"data-mission-type":e,children:e},e)}function ex(e){let n,o,s,l,i,c,u,d,m,h,p,_,g,y,v,x,b,k=(0,a.c)(46),{value:S,missionType:C,onChange:j,disabled:w}=e,[N,I]=(0,r.useState)(""),T=(0,r.useRef)(null),P=(0,r.useRef)(C);k[0]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{(0,r.startTransition)(()=>I(e))},k[0]=n):n=k[0];let B=(0,el.useComboboxStore)({resetValueOnHide:!0,selectedValue:S,setSelectedValue:e=>{if(e){let t=P.current,a=(0,f.getMissionInfo)(e).missionTypes;t&&a.includes(t)||(t=a[0]),j({missionName:e,missionType:t}),T.current?.blur()}},setValue:n});k[1]!==B?(o=()=>{let e=e=>{"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),T.current?.focus(),B.show())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},s=[B],k[1]=B,k[2]=o,k[3]=s):(o=k[2],s=k[3]),(0,r.useEffect)(o,s),k[4]!==S?(l=ef.get(S),k[4]=S,k[5]=l):l=k[5];let D=l;e:{let e,t;if(!N){let e;k[6]===Symbol.for("react.memo_cache_sentinel")?(e={type:"grouped",groups:e_},k[6]=e):e=k[6],i=e;break e}k[7]!==N?(e=(0,ei.matchSorter)(ep,N,{keys:["displayName","missionName","missionTypes","groupName"]}),k[7]=N,k[8]=e):e=k[8];let a=e;k[9]!==a?(t={type:"flat",missions:a},k[9]=a,k[10]=t):t=k[10],i=t}let E=i,L=D?D.displayName||D.missionName:S,R="flat"===E.type?0===E.missions.length:0===E.groups.length,M=e=>(0,t.jsx)(et.ComboboxItem,{value:e.missionName,className:eu.default.Item,focusOnHover:!0,onClick:t=>{if(t.target&&t.target instanceof HTMLElement){let a=t.target.dataset.missionType;a?(P.current=a,e.missionName===S&&j({missionName:e.missionName,missionType:a})):P.current=null}else P.current=null},children:(0,t.jsx)(ey,{mission:e})},e.missionName),H=en.ComboboxProvider;k[11]!==B?(c=()=>{try{document.exitPointerLock()}catch{}B.show()},u=e=>{"Escape"!==e.key||B.getState().open||T.current?.blur()},k[11]=B,k[12]=c,k[13]=u):(c=k[12],u=k[13]),k[14]!==w||k[15]!==L||k[16]!==c||k[17]!==u?(d=(0,t.jsx)(ee.Combobox,{ref:T,autoSelect:!0,disabled:w,placeholder:L,className:eu.default.Input,onFocus:c,onKeyDown:u}),k[14]=w,k[15]=L,k[16]=c,k[17]=u,k[18]=d):d=k[18],k[19]!==L?(m=(0,t.jsx)("span",{className:eu.default.SelectedName,children:L}),k[19]=L,k[20]=m):m=k[20],k[21]!==C?(h=C&&(0,t.jsx)("span",{className:eu.default.ItemType,"data-mission-type":C,children:C}),k[21]=C,k[22]=h):h=k[22],k[23]!==h||k[24]!==m?(p=(0,t.jsxs)("div",{className:eu.default.SelectedValue,children:[m,h]}),k[23]=h,k[24]=m,k[25]=p):p=k[25],k[26]===Symbol.for("react.memo_cache_sentinel")?(_=(0,t.jsx)("kbd",{className:eu.default.Shortcut,children:eg?"⌘K":"^K"}),k[26]=_):_=k[26],k[27]!==p||k[28]!==d?(g=(0,t.jsxs)("div",{className:eu.default.InputWrapper,children:[d,p,_]}),k[27]=p,k[28]=d,k[29]=g):g=k[29];let F=er.ComboboxPopover,G=eu.default,q=ea.ComboboxList,O=eu.default,A="flat"===E.type?E.missions.map(M):E.groups.map(e=>{let[a,n]=e;return a?(0,t.jsxs)(eo.ComboboxGroup,{className:eu.default.Group,children:[(0,t.jsx)(es.ComboboxGroupLabel,{className:eu.default.GroupLabel,children:a}),n.map(M)]},a):(0,t.jsx)(r.Fragment,{children:n.map(M)},"ungrouped")});return k[30]!==R?(y=R&&(0,t.jsx)("div",{className:eu.default.NoResults,children:"No missions found"}),k[30]=R,k[31]=y):y=k[31],k[32]!==q||k[33]!==O.List||k[34]!==A||k[35]!==y?(v=(0,t.jsxs)(q,{className:O.List,children:[A,y]}),k[32]=q,k[33]=O.List,k[34]=A,k[35]=y,k[36]=v):v=k[36],k[37]!==F||k[38]!==G.Popover||k[39]!==v?(x=(0,t.jsx)(F,{gutter:4,fitViewport:!0,autoFocusOnHide:!1,className:G.Popover,children:v}),k[37]=F,k[38]=G.Popover,k[39]=v,k[40]=x):x=k[40],k[41]!==H||k[42]!==B||k[43]!==g||k[44]!==x?(b=(0,t.jsxs)(H,{store:B,children:[g,x]}),k[41]=H,k[42]=B,k[43]=g,k[44]=x,k[45]=b):b=k[45],b}var eb=e.i(11152),ek=e.i(40141);function eS(e){return(0,ek.GenIcon)({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M192 0c-41.8 0-77.4 26.7-90.5 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-37.5 0C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM305 273L177 401c-9.4 9.4-24.6 9.4-33.9 0L79 337c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L271 239c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"},child:[]}]})(e)}var eC=e.i(36679);function ej(e){let n,o,s,l,i,c=(0,a.c)(11),{cameraRef:u,missionName:d,missionType:m}=e,{fogEnabled:h}=(0,J.useSettings)(),[p,f]=(0,r.useState)(!1),_=(0,r.useRef)(null);c[0]!==u||c[1]!==h||c[2]!==d||c[3]!==m?(n=async()=>{clearTimeout(_.current);let e=u.current;if(!e)return;let t=function({position:e,quaternion:t}){let a=e=>parseFloat(e.toFixed(3)),r=`${a(e.x)},${a(e.y)},${a(e.z)}`,n=`${a(t.x)},${a(t.y)},${a(t.z)},${a(t.w)}`;return`#c${r}~${n}`}(e),a=new URLSearchParams;a.set("mission",`${d}~${m}`),a.set("fog",h.toString());let r=`${window.location.pathname}?${a}${t}`,n=`${window.location.origin}${r}`;window.history.replaceState(null,"",r);try{await navigator.clipboard.writeText(n),f(!0),_.current=setTimeout(()=>{f(!1)},1100)}catch(e){console.error(e)}},c[0]=u,c[1]=h,c[2]=d,c[3]=m,c[4]=n):n=c[4];let g=n,y=p?"true":"false";return c[5]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)(eb.FaMapPin,{className:eC.default.MapPin}),s=(0,t.jsx)(eS,{className:eC.default.ClipboardCheck}),l=(0,t.jsx)("span",{className:eC.default.ButtonLabel,children:" Copy coordinates URL"}),c[5]=o,c[6]=s,c[7]=l):(o=c[5],s=c[6],l=c[7]),c[8]!==g||c[9]!==y?(i=(0,t.jsxs)("button",{type:"button",className:eC.default.Root,"aria-label":"Copy coordinates URL",title:"Copy coordinates URL",onClick:g,"data-copied":y,id:"copyCoordinatesButton",children:[o,s,l]}),c[8]=g,c[9]=y,c[10]=i):i=c[10],i}function ew(e){return(0,ek.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M21 3H3c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h5v2h8v-2h5c1.1 0 1.99-.9 1.99-2L23 5a2 2 0 0 0-2-2zm0 14H3V5h18v12zm-5-6-7 4V7z"},child:[]}]})(e)}e.i(91891);var eN=e.i(11251),eI=e.i(88787);e.i(70847);var eT=e.i(47566),eP=e.i(25311),eB=e.i(89119),eD=e.i(10244);class eE extends eD.StreamEngine{parser;initialBlock;moveTicks=0;absoluteYaw=0;absolutePitch=0;lastAbsYaw=0;lastAbsPitch=0;exhausted=!1;_teamScoresGen=0;_rosterGen=0;_weaponsHudGen=0;_inventoryHudGen=0;_cachedSnapshot=null;_cachedSnapshotTick=-1;_snap=null;constructor(e){super(),this.parser=e,this.registry=e.getRegistry(),this.ghostTracker=e.getGhostTracker();const t=e.initialBlock;this.initialBlock={dataBlocks:t.dataBlocks,initialGhosts:t.initialGhosts,controlObjectGhostIndex:t.controlObjectGhostIndex,controlObjectData:t.controlObjectData,targetEntries:t.targetEntries,sensorGroupColors:t.sensorGroupColors,taggedStrings:t.taggedStrings,initialEvents:t.initialEvents,demoValues:t.demoValues,firstPerson:t.firstPerson},this.reset()}getDataBlockData(e){let t=this.initialBlock.dataBlocks.get(e);if(t?.data)return t.data;let a=this.parser.getPacketParser();return a.dataBlockDataMap?.get(e)}_shapeConstructorCache=null;getShapeConstructorSequences(e){if(!this._shapeConstructorCache)for(let[,e]of(this._shapeConstructorCache=new Map,this.initialBlock.dataBlocks)){if("TSShapeConstructor"!==e.className||!e.data)continue;let t=e.data.shape,a=e.data.sequences;t&&a&&this._shapeConstructorCache.set(t.toLowerCase(),a)}return this._shapeConstructorCache.get(e.toLowerCase())}getTimeSec(){return this.moveTicks*(eP.TICK_DURATION_MS/1e3)}getCameraYawPitch(e){let t="player"===this.lastControlType,a=t?this.absoluteYaw:this.lastAbsYaw,r=t?this.absolutePitch:this.lastAbsPitch;return t&&(this.lastAbsYaw=a,this.lastAbsPitch=r),{yaw:a,pitch:r}}getControlPlayerHeadPitch(e){return(0,eB.clamp)(this.absolutePitch/eB.MAX_PITCH,-1,1)}onTeamScoresChanged(){this._teamScoresGen++}onRosterChanged(){this._rosterGen++}onWeaponsHudChanged(){this._weaponsHudGen++}onInventoryHudChanged(){this._inventoryHudGen++}reset(){for(let[e,t]of(this.parser.reset(),this.ghostTracker=this.parser.getGhostTracker(),this._cachedSnapshot=null,this._cachedSnapshotTick=-1,this._snap=null,this.resetSharedState(),this.initialBlock.taggedStrings))this.netStrings.set(e,t);for(let e of this.initialBlock.targetEntries)e.name&&this.targetNames.set(e.targetId,(0,eB.stripTaggedStringMarkup)(e.name)),this.targetTeams.set(e.targetId,e.sensorGroup),this.targetRenderFlags.set(e.targetId,e.targetData);for(let e of this.initialBlock.sensorGroupColors){let t=this.sensorGroupColors.get(e.group);t||(t=new Map,this.sensorGroupColors.set(e.group,t)),t.set(e.targetGroup,{r:e.r,g:e.g,b:e.b})}if(this.moveTicks=0,this.absoluteYaw=0,this.absolutePitch=0,this.lastAbsYaw=0,this.lastAbsPitch=0,this.firstPerson=this.initialBlock.firstPerson,this.lastControlType=(0,eB.detectControlObjectType)(this.initialBlock.controlObjectData)??"player",this.isPiloting="player"===this.lastControlType&&!!(this.initialBlock.controlObjectData?.pilot||this.initialBlock.controlObjectData?.controlObjectGhost!=null),this.lastPilotGhostIndex=this.isPiloting&&"number"==typeof this.initialBlock.controlObjectData?.controlObjectGhost?this.initialBlock.controlObjectData.controlObjectGhost:void 0,this.isPiloting){let e=this.initialBlock.controlObjectData?.controlObjectData,t=e?.angPosition;if(t&&"number"==typeof t.w){this.lastVehicleHeading=(0,eB.torqueQuatHeading)(t),this.lastVehiclePitch=(0,eB.torqueQuatPitch)(t);let e=(0,eB.torqueQuatToThreeJS)(t);if(e){let[t,a,r,n]=e;this.lastVehicleOrbitDir=[-(1-2*(a*a+r*r)),-(2*(t*a+r*n)),-(2*(t*r-a*n))]}}}if(this.lastCameraMode="camera"===this.lastControlType&&"number"==typeof this.initialBlock.controlObjectData?.cameraMode?this.initialBlock.controlObjectData.cameraMode:void 0,this.lastOrbitGhostIndex="camera"===this.lastControlType&&"number"==typeof this.initialBlock.controlObjectData?.orbitObjectGhostIndex?this.initialBlock.controlObjectData.orbitObjectGhostIndex:void 0,"camera"===this.lastControlType){let e=this.initialBlock.controlObjectData?.minOrbitDist,t=this.initialBlock.controlObjectData?.maxOrbitDist,a=this.initialBlock.controlObjectData?.curOrbitDist;"number"==typeof e&&"number"==typeof t&&Number.isFinite(e)&&Number.isFinite(t)?this.lastOrbitDistance=Math.max(0,t-e):"number"==typeof a&&Number.isFinite(a)?this.lastOrbitDistance=Math.max(0,a):this.lastOrbitDistance=void 0}else this.lastOrbitDistance=void 0;let e=this.getAbsoluteRotation(this.initialBlock.controlObjectData);for(let t of(e&&(this.absoluteYaw=e.yaw,this.absolutePitch=e.pitch,this.lastAbsYaw=e.yaw,this.lastAbsPitch=e.pitch),this.exhausted=!1,this.latestFov=100,this.latestControl={ghostIndex:this.initialBlock.controlObjectGhostIndex,data:this.initialBlock.controlObjectData,position:(0,eB.isValidPosition)(this.initialBlock.controlObjectData?.position)?this.initialBlock.controlObjectData?.position:void 0},this.controlPlayerGhostId="player"===this.lastControlType&&this.initialBlock.controlObjectGhostIndex>=0?(0,eP.toEntityId)("Player",this.initialBlock.controlObjectGhostIndex):void 0,this.initialBlock.initialGhosts)){if("create"!==t.type||null==t.classId)continue;let e=this.registry.getGhostParser(t.classId)?.name;if(!e)throw Error(`No ghost parser for classId ${t.classId} (ghost index ${t.index})`);let a=(0,eP.toEntityId)(e,t.index),r={id:a,ghostIndex:t.index,className:e,spawnTick:0,type:(0,eP.toEntityType)(e),rotation:[0,0,0,1]};if(this.applyGhostData(r,t.parsedData),t.parsedData){let a=(0,eT.ghostToSceneObject)(e,t.index,t.parsedData);a&&(r.sceneData=a)}this.entities.set(a,r),this.entityIdByGhostIndex.set(t.index,a)}if(0===this.playerSensorGroup&&"player"===this.lastControlType&&this.latestControl.ghostIndex>=0){let e=this.entityIdByGhostIndex.get(this.latestControl.ghostIndex),t=e?this.entities.get(e):void 0;t?.sensorGroup!=null&&t.sensorGroup>0&&(this.playerSensorGroup=t.sensorGroup)}for(let e of this.initialBlock.initialEvents){let t=this.registry.getEventParser(e.classId)?.name;if("SetSensorGroupEvent"===t&&e.parsedData){let t=e.parsedData.sensorGroup;null!=t&&(this.playerSensorGroup=t)}else if("RemoteCommandEvent"===t&&e.parsedData){let t=this.resolveNetString(e.parsedData.funcName),a=e.parsedData.args;"ServerMessage"===t&&this.handleServerMessage(a),this.handleHudRemoteCommand(t,a)}}let t=function(e){let t={weaponsHud:null,backpackHud:null,inventoryHud:null,teamScores:[],playerRoster:new Map,chatMessages:[],gravity:-20};if(!e.length)return t;let a=0,r=()=>{let t=e[a++];return" "===t?"":t??""};if(r(),a>=e.length)return t;let n=parseInt(r(),10)||0,o=new Map;for(let e=0;e 0&&o.set(s,(o.get(s)??0)+1)}if(a>=e.length||(r(),a>=e.length))return t;{let e=r().split(" "),a=e[0]??"",n="1"===e[1]||"true"===e[1],o=e[2]??"",s="1"===e[4]||"true"===e[4];n&&a&&(t.backpackHud={packIndex:(0,eB.backpackBitmapToIndex)(a),active:s,text:o})}if(a>=e.length)return t;let s=r().split(" "),l=parseInt(s[4],10)||0,i=parseInt(s[5],10)||0,c=parseInt(s[6],10);for(let e=0;e =e.length)return t;let d=r().split(" "),m=parseInt(d[4],10)||0,h=parseInt(d[5],10)||0,p=parseInt(d[6],10);for(let e=0;e 0)||e.set(a,n)}e.size>0&&(t.inventoryHud={slots:e,activeSlot:isNaN(p)?-1:p})}if(a>=e.length)return t;let f=r().split(" "),_=f[1]??"",g=parseInt(f[2],10)||0,y=[];for(let e=0;e =8)for(let e=0;e<2;e++){let a=4*e,r=e+1;t.teamScores.push({teamId:r,name:y[a]??"",score:parseInt(y[a+1],10)||0,playerCount:o.get(r)??0})}else if("TR2Game"===_&&g>=4)for(let e=0;e<2;e++){let a=2*e,r=e+1;t.teamScores.push({teamId:r,name:y[a+1]??"",score:parseInt(y[a],10)||0,playerCount:o.get(r)??0})}if(a>=e.length)return t;r();for(let n=0;n<10&&!(a>=e.length);n++){let e=r();e&&t.chatMessages.push(e)}if(a e.text).join("");if(!a.trim())continue;let r=t[0].colorCode;if(t.some(e=>3===e.colorCode||4===e.colorCode)&&a.includes(": ")){let e=a.indexOf(": ");this.pushChatMessage({timeSec:0,sender:a.slice(0,e),text:a.slice(e+2),kind:"chat",colorCode:r,segments:t})}else this.pushChatMessage({timeSec:0,sender:"",text:a,kind:"server",colorCode:r,segments:t})}this.updateCameraAndHud()}getSnapshot(){if(this._cachedSnapshot&&this._cachedSnapshotTick===this.moveTicks)return this._cachedSnapshot;let e=this.buildSnapshot();return this._cachedSnapshot=e,this._cachedSnapshotTick=this.moveTicks,e}getEffectShapes(){let e=new Set,t=t=>{let a=t.dtsFileName;a&&e.add(a);let r=t.subExplosions;if(Array.isArray(r))for(let t of r){if(null==t)continue;let a=this.getDataBlockData(t);a?.dtsFileName&&e.add(a.dtsFileName)}};for(let[,e]of this.initialBlock.dataBlocks){let a=e.data?.explosion;if(null==a)continue;let r=this.getDataBlockData(a);r&&t(r)}return[...e]}stepToTime(e,t=1/0){let a=Math.floor(1e3*(Number.isFinite(e)?Math.max(0,e):0)/eP.TICK_DURATION_MS),r=!1;a ({index:e,ammo:t})),activeIndex:this.weaponsHud.activeIndex},l=r&&r.inventoryHudGen===this._inventoryHudGen?r.inventoryHud:{slots:Array.from(this.inventoryHud.slots.entries()).map(([e,t])=>({slot:e,count:t})),activeSlot:this.inventoryHud.activeSlot},i=r&&r.backpackPackIndex===this.backpackHud.packIndex&&r.backpackActive===this.backpackHud.active&&r.backpackText===this.backpackHud.text?r.backpackHud:this.backpackHud.packIndex>=0?{...this.backpackHud}:null;if(r&&r.teamScoresGen===this._teamScoresGen&&r.rosterGen===this._rosterGen)e=r.teamScores;else{e=this.teamScores.map(e=>({...e}));let t=new Map;for(let{teamId:e}of this.playerRoster.values())e>0&&t.set(e,(t.get(e)??0)+1);for(let a of e)a.playerCount=t.get(a.teamId)??0}return this._snap={teamScoresGen:this._teamScoresGen,rosterGen:this._rosterGen,teamScores:e,weaponsHudGen:this._weaponsHudGen,weaponsHud:s,inventoryHudGen:this._inventoryHudGen,inventoryHud:l,backpackPackIndex:this.backpackHud.packIndex,backpackActive:this.backpackHud.active,backpackText:this.backpackHud.text,backpackHud:i},{timeSec:a,exhausted:this.exhausted,camera:this.camera,entities:t,controlPlayerGhostId:this.controlPlayerGhostId,playerSensorGroup:this.playerSensorGroup,status:this.lastStatus,chatMessages:n,audioEvents:o,weaponsHud:s,backpackHud:i,inventoryHud:l,teamScores:e}}isPacketData(e){return!!e&&"object"==typeof e&&"gameState"in e&&"events"in e&&"ghosts"in e}isMoveData(e){return!!e&&"object"==typeof e&&"yaw"in e}isInfoData(e){return!!e&&"object"==typeof e&&"value1"in e&&"number"==typeof e.value1&&"value2"in e&&"number"==typeof e.value2}}async function eL(e){let t=new eI.DemoParser(new Uint8Array(e)),{header:a,initialBlock:r}=await t.load(),{missionName:n,gameType:o}=function(e){let t=null,a=null;for(let r=0;r {if(h){_.current=_.current+1,p(null);return}f.current?.click()},d[0]=h,d[1]=p,d[2]=e):e=d[2];let g=e;d[3]!==p?(n=async e=>{let t=e.target.files?.[0];if(t){e.target.value="";try{let e=await t.arrayBuffer(),a=_.current+1;_.current=a;let r=await eL(e);if(_.current!==a)return;p(r)}catch(e){console.error("Failed to load demo:",e)}}},d[3]=p,d[4]=n):n=d[4];let y=n;d[5]===Symbol.for("react.memo_cache_sentinel")?(o={display:"none"},d[5]=o):o=d[5],d[6]!==y?(s=(0,t.jsx)("input",{ref:f,type:"file",accept:".rec",style:o,onChange:y}),d[6]=y,d[7]=s):s=d[7];let v=h?"Unload demo":"Load demo (.rec)",x=h?"Unload demo":"Load demo (.rec)",b=h?"true":void 0,k=null!=m&&!h;d[8]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsx)(ew,{className:eR.default.DemoIcon}),d[8]=l):l=d[8];let S=h?"Unload demo":"Demo";return d[9]!==S?(i=(0,t.jsx)("span",{className:eR.default.ButtonLabel,children:S}),d[9]=S,d[10]=i):i=d[10],d[11]!==g||d[12]!==i||d[13]!==v||d[14]!==x||d[15]!==b||d[16]!==k?(c=(0,t.jsxs)("button",{type:"button",className:eR.default.Root,"aria-label":v,title:x,onClick:g,"data-active":b,disabled:k,children:[l,i]}),d[11]=g,d[12]=i,d[13]=v,d[14]=x,d[15]=b,d[16]=k,d[17]=c):c=d[17],d[18]!==c||d[19]!==s?(u=(0,t.jsxs)(t.Fragment,{children:[s,c]}),d[18]=c,d[19]=s,d[20]=u):u=d[20],u}function eH(e){return(0,ek.GenIcon)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11.251.068a.5.5 0 0 1 .227.58L9.677 6.5H13a.5.5 0 0 1 .364.843l-8 8.5a.5.5 0 0 1-.842-.49L6.323 9.5H3a.5.5 0 0 1-.364-.843l8-8.5a.5.5 0 0 1 .615-.09z"},child:[]}]})(e)}var eF=e.i(98755),eG=e.i(9607);function eq(e){let r,n,o,s,l,i=(0,a.c)(20),{onOpenServerBrowser:c}=e,u=(0,eF.useLiveSelector)(eU),d=(0,eF.useLiveSelector)(eA),m=(0,eF.useLiveSelector)(eF.selectPing),h=(0,eF.useLiveSelector)(eO),p="connected"===u,f="connecting"===u||"challenging"===u||"authenticating"===u,_=p?`Disconnect from ${d??"server"}`:"Join server",g=p?`Disconnect from ${d??"server"}`:"Join server";i[0]!==h||i[1]!==p||i[2]!==c?(r=()=>{p?h():c()},i[0]=h,i[1]=p,i[2]=c,i[3]=r):r=i[3];let y=p?"true":void 0,v=`${eG.default.LiveIcon} ${p?eG.default.Pulsing:""}`;if(i[4]!==v?(n=(0,t.jsx)(eH,{className:v}),i[4]=v,i[5]=n):n=i[5],i[6]!==f||i[7]!==p?(o=!p&&(0,t.jsx)("span",{className:eG.default.TextLabel,children:f?"Connecting...":"Connect"}),i[6]=f,i[7]=p,i[8]=o):o=i[8],i[9]!==p||i[10]!==m)s=p&&null!=m&&(0,t.jsx)("span",{className:eG.default.PingLabel,children:m>=1e3?m.toLocaleString()+"ms":m+"ms"}),i[9]=p,i[10]=m,i[11]=s;else s=i[11];return i[12]!==_||i[13]!==g||i[14]!==r||i[15]!==y||i[16]!==n||i[17]!==o||i[18]!==s?(l=(0,t.jsxs)("button",{type:"button",className:eG.default.Root,"aria-label":_,title:g,onClick:r,"data-active":y,children:[n,o,s]}),i[12]=_,i[13]=g,i[14]=r,i[15]=y,i[16]=n,i[17]=o,i[18]=s,i[19]=l):l=i[19],l}function eO(e){return e.disconnectServer}function eA(e){return e.serverName}function eU(e){return e.gameStatus}function eW(e){return(0,ek.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"line",attr:{x1:"12",y1:"16",x2:"12",y2:"12"},child:[]},{tag:"line",attr:{x1:"12",y1:"8",x2:"12.01",y2:"8"},child:[]}]})(e)}function eK(e){return(0,ek.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"},child:[]}]})(e)}var ez=e.i(65883);function e$(e){let n,o,s,l,i,c,u,d,m,h,p,f,_,g,y,v,x,b,k,S,C,j,w,N,I,T,P,B,D,L,R,M,H,F,G,q,O,A,U,W,K=(0,a.c)(95),{missionName:z,missionType:$,onChangeMission:V,onOpenMapInfo:Y,onOpenServerBrowser:X,isTouch:Q,cameraRef:Z}=e,{fogEnabled:ee,setFogEnabled:et,fov:ea,setFov:er,audioEnabled:en,setAudioEnabled:eo,animationEnabled:es,setAnimationEnabled:el}=(0,J.useSettings)(),{speedMultiplier:ei,setSpeedMultiplier:ec,touchMode:eu,setTouchMode:ed}=(0,J.useControls)(),{debugMode:em,setDebugMode:eh}=(0,J.useDebug)(),ep=(0,E.useRecording)(),ef=(0,eF.useLiveSelector)(eQ),e_=null!=ep||ef,eg=e_&&!ef,[ey,ev]=(0,r.useState)(!1),eb=(0,r.useRef)(null),ek=(0,r.useRef)(null),eS=(0,r.useRef)(null);K[0]!==ey?(n=()=>{ey&&eb.current?.focus()},o=[ey],K[0]=ey,K[1]=n,K[2]=o):(n=K[1],o=K[2]),(0,r.useEffect)(n,o),K[3]===Symbol.for("react.memo_cache_sentinel")?(s=e=>{let t=e.relatedTarget;t&&eS.current?.contains(t)||ev(!1)},K[3]=s):s=K[3];let eC=s;K[4]===Symbol.for("react.memo_cache_sentinel")?(l=e=>{"Escape"===e.key&&(ev(!1),ek.current?.focus())},K[4]=l):l=K[4];let ew=l;return K[5]!==e_||K[6]!==z||K[7]!==$||K[8]!==V?(i=(0,t.jsx)("div",{className:ez.default.MissionSelectWrapper,children:(0,t.jsx)(ex,{value:z,missionType:$,onChange:V,disabled:e_})}),K[5]=e_,K[6]=z,K[7]=$,K[8]=V,K[9]=i):i=K[9],K[10]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{ev(eJ)},K[10]=c):c=K[10],K[11]===Symbol.for("react.memo_cache_sentinel")?(u=(0,t.jsx)(eK,{}),K[11]=u):u=K[11],K[12]!==ey?(d=(0,t.jsx)("button",{ref:ek,className:ez.default.Toggle,onClick:c,"aria-expanded":ey,"aria-controls":"settingsPanel","aria-label":"Settings",children:u}),K[12]=ey,K[13]=d):d=K[13],K[14]!==Z||K[15]!==z||K[16]!==$?(m=(0,t.jsx)(ej,{missionName:z,missionType:$,cameraRef:Z}),K[14]=Z,K[15]=z,K[16]=$,K[17]=m):m=K[17],K[18]===Symbol.for("react.memo_cache_sentinel")?(h=(0,t.jsx)(eM,{}),K[18]=h):h=K[18],K[19]!==X?(p=X&&(0,t.jsx)(eq,{onOpenServerBrowser:X}),K[19]=X,K[20]=p):p=K[20],K[21]===Symbol.for("react.memo_cache_sentinel")?(f=(0,t.jsx)(eW,{}),_=(0,t.jsx)("span",{className:ez.default.ButtonLabel,children:"Show map info"}),K[21]=f,K[22]=_):(f=K[21],_=K[22]),K[23]!==Y?(g=(0,t.jsxs)("button",{type:"button",className:ez.default.MapInfoButton,"aria-label":"Show map info",onClick:Y,children:[f,_]}),K[23]=Y,K[24]=g):g=K[24],K[25]!==p||K[26]!==g||K[27]!==m?(y=(0,t.jsxs)("div",{className:ez.default.Group,children:[m,h,p,g]}),K[25]=p,K[26]=g,K[27]=m,K[28]=y):y=K[28],K[29]!==et?(v=e=>{et(e.target.checked)},K[29]=et,K[30]=v):v=K[30],K[31]!==ee||K[32]!==v?(x=(0,t.jsx)("input",{id:"fogInput",type:"checkbox",checked:ee,onChange:v}),K[31]=ee,K[32]=v,K[33]=x):x=K[33],K[34]===Symbol.for("react.memo_cache_sentinel")?(b=(0,t.jsx)("label",{htmlFor:"fogInput",children:"Fog?"}),K[34]=b):b=K[34],K[35]!==x?(k=(0,t.jsxs)("div",{className:ez.default.CheckboxField,children:[x,b]}),K[35]=x,K[36]=k):k=K[36],K[37]!==eo?(S=e=>{eo(e.target.checked)},K[37]=eo,K[38]=S):S=K[38],K[39]!==en||K[40]!==S?(C=(0,t.jsx)("input",{id:"audioInput",type:"checkbox",checked:en,onChange:S}),K[39]=en,K[40]=S,K[41]=C):C=K[41],K[42]===Symbol.for("react.memo_cache_sentinel")?(j=(0,t.jsx)("label",{htmlFor:"audioInput",children:"Audio?"}),K[42]=j):j=K[42],K[43]!==C?(w=(0,t.jsxs)("div",{className:ez.default.CheckboxField,children:[C,j]}),K[43]=C,K[44]=w):w=K[44],K[45]!==k||K[46]!==w?(N=(0,t.jsxs)("div",{className:ez.default.Group,children:[k,w]}),K[45]=k,K[46]=w,K[47]=N):N=K[47],K[48]!==el?(I=e=>{el(e.target.checked)},K[48]=el,K[49]=I):I=K[49],K[50]!==es||K[51]!==I?(T=(0,t.jsx)("input",{id:"animationInput",type:"checkbox",checked:es,onChange:I}),K[50]=es,K[51]=I,K[52]=T):T=K[52],K[53]===Symbol.for("react.memo_cache_sentinel")?(P=(0,t.jsx)("label",{htmlFor:"animationInput",children:"Animation?"}),K[53]=P):P=K[53],K[54]!==T?(B=(0,t.jsxs)("div",{className:ez.default.CheckboxField,children:[T,P]}),K[54]=T,K[55]=B):B=K[55],K[56]!==eh?(D=e=>{eh(e.target.checked)},K[56]=eh,K[57]=D):D=K[57],K[58]!==em||K[59]!==D?(L=(0,t.jsx)("input",{id:"debugInput",type:"checkbox",checked:em,onChange:D}),K[58]=em,K[59]=D,K[60]=L):L=K[60],K[61]===Symbol.for("react.memo_cache_sentinel")?(R=(0,t.jsx)("label",{htmlFor:"debugInput",children:"Debug?"}),K[61]=R):R=K[61],K[62]!==L?(M=(0,t.jsxs)("div",{className:ez.default.CheckboxField,children:[L,R]}),K[62]=L,K[63]=M):M=K[63],K[64]!==B||K[65]!==M?(H=(0,t.jsxs)("div",{className:ez.default.Group,children:[B,M]}),K[64]=B,K[65]=M,K[66]=H):H=K[66],K[67]!==ea||K[68]!==eg||K[69]!==er?(F=eg?null:(0,t.jsxs)("div",{className:ez.default.Field,children:[(0,t.jsx)("label",{htmlFor:"fovInput",children:"FOV"}),(0,t.jsx)("input",{id:"fovInput",type:"range",min:75,max:120,step:5,value:ea,onChange:e=>er(parseInt(e.target.value))}),(0,t.jsx)("output",{htmlFor:"fovInput",children:ea})]}),K[67]=ea,K[68]=eg,K[69]=er,K[70]=F):F=K[70],K[71]!==eg||K[72]!==ec||K[73]!==ei?(G=eg?null:(0,t.jsxs)("div",{className:ez.default.Field,children:[(0,t.jsx)("label",{htmlFor:"speedInput",children:"Speed"}),(0,t.jsx)("input",{id:"speedInput",type:"range",min:.1,max:5,step:.05,value:ei,onChange:e=>ec(parseFloat(e.target.value))})]}),K[71]=eg,K[72]=ec,K[73]=ei,K[74]=G):G=K[74],K[75]!==F||K[76]!==G?(q=(0,t.jsxs)("div",{className:ez.default.Group,children:[F,G]}),K[75]=F,K[76]=G,K[77]=q):q=K[77],K[78]!==Q||K[79]!==ed||K[80]!==eu?(O=Q&&(0,t.jsx)("div",{className:ez.default.Group,children:(0,t.jsxs)("div",{className:ez.default.Field,children:[(0,t.jsx)("label",{htmlFor:"touchModeInput",children:"Joystick:"})," ",(0,t.jsxs)("select",{id:"touchModeInput",value:eu,onChange:e=>ed(e.target.value),children:[(0,t.jsx)("option",{value:"dualStick",children:"Dual Stick"}),(0,t.jsx)("option",{value:"moveLookStick",children:"Single Stick"})]})]})}),K[78]=Q,K[79]=ed,K[80]=eu,K[81]=O):O=K[81],K[82]!==ey||K[83]!==y||K[84]!==N||K[85]!==H||K[86]!==q||K[87]!==O?(A=(0,t.jsxs)("div",{className:ez.default.Dropdown,ref:eb,id:"settingsPanel",tabIndex:-1,onKeyDown:ew,onBlur:eC,"data-open":ey,children:[y,N,H,q,O]}),K[82]=ey,K[83]=y,K[84]=N,K[85]=H,K[86]=q,K[87]=O,K[88]=A):A=K[88],K[89]!==A||K[90]!==d?(U=(0,t.jsxs)("div",{ref:eS,children:[d,A]}),K[89]=A,K[90]=d,K[91]=U):U=K[91],K[92]!==U||K[93]!==i?(W=(0,t.jsxs)("div",{id:"controls",className:ez.default.Controls,onKeyDown:eX,onPointerDown:eY,onClick:eV,children:[i,U]}),K[92]=U,K[93]=i,K[94]=W):W=K[94],W}function eJ(e){return!e}function eV(e){return e.stopPropagation()}function eY(e){return e.stopPropagation()}function eX(e){return e.stopPropagation()}function eQ(e){return null!=e.adapter}let eZ=()=>null;var e0=e.i(31067);let e1=r.forwardRef(({envMap:e,resolution:t=256,frames:a=1/0,makeDefault:n,children:s,...l},i)=>{let c=(0,$.useThree)(({set:e})=>e),u=(0,$.useThree)(({camera:e})=>e),d=(0,$.useThree)(({size:e})=>e),m=r.useRef(null);r.useImperativeHandle(i,()=>m.current,[]);let h=r.useRef(null),p=function(e,t,a){let n=(0,$.useThree)(e=>e.size),s=(0,$.useThree)(e=>e.viewport),l="number"==typeof e?e:n.width*s.dpr,i=n.height*s.dpr,c=("number"==typeof e?void 0:e)||{},{samples:u=0,depth:d,...m}=c,h=null!=d?d:c.depthBuffer,p=r.useMemo(()=>{let e=new o.WebGLRenderTarget(l,i,{minFilter:o.LinearFilter,magFilter:o.LinearFilter,type:o.HalfFloatType,...m});return h&&(e.depthTexture=new o.DepthTexture(l,i,o.FloatType)),e.samples=u,e},[]);return r.useLayoutEffect(()=>{p.setSize(l,i),u&&(p.samples=u)},[u,p,l,i]),r.useEffect(()=>()=>p.dispose(),[]),p}(t);r.useLayoutEffect(()=>{l.manual||(m.current.aspect=d.width/d.height)},[d,l]),r.useLayoutEffect(()=>{m.current.updateProjectionMatrix()});let f=0,_=null,g="function"==typeof s;return(0,z.useFrame)(t=>{g&&(a===1/0||f{if(n)return c(()=>({camera:m.current})),()=>c(()=>({camera:u}))},[m,n,c]),r.createElement(r.Fragment,null,r.createElement("perspectiveCamera",(0,e0.default)({ref:m},l),!g&&s),r.createElement("group",{ref:h},g&&s(p.texture)))});function e2(){let e,r,n=(0,a.c)(3),{fov:o}=(0,J.useSettings)();return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=[0,256,0],n[0]=e):e=n[0],n[1]!==o?(r=(0,t.jsx)(e1,{makeDefault:!0,position:e,fov:o}),n[1]=o,n[2]=r):r=n[2],r}var e3=e.i(51434),e4=e.i(86855),e5=e.i(68294),e6=e.i(87297),e8=e.i(51475),e7=e.i(63318),e9=e.i(38437);function te(){let e,r=(0,a.c)(3),n=(0,y.useSceneSun)();if(!n){let e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("ambientLight",{color:"#888888",intensity:1}),r[0]=e):e=r[0],e}return r[1]!==n?(e=(0,t.jsx)(tt,{sunData:n}),r[1]=n,r[2]=e):e=r[2],e}function tt(e){let n,s,l,i,c,u,d,m,h,p,f=(0,a.c)(29),{sunData:_}=e;f[0]!==_.direction?(n=(0,e7.torqueToThree)(_.direction),f[0]=_.direction,f[1]=n):n=f[1];let[g,y,v]=n,x=Math.sqrt(g*g+y*y+v*v),b=g/x,k=y/x,S=v/x;f[2]!==b||f[3]!==k||f[4]!==S?(s=new o.Vector3(b,k,S),f[2]=b,f[3]=k,f[4]=S,f[5]=s):s=f[5];let C=s,j=-(5e3*C.x),w=-(5e3*C.y),N=-(5e3*C.z);f[6]!==j||f[7]!==w||f[8]!==N?(l=new o.Vector3(j,w,N),f[6]=j,f[7]=w,f[8]=N,f[9]=l):l=f[9];let I=l;f[10]!==_.color.b||f[11]!==_.color.g||f[12]!==_.color.r?(i=new o.Color(_.color.r,_.color.g,_.color.b),f[10]=_.color.b,f[11]=_.color.g,f[12]=_.color.r,f[13]=i):i=f[13];let T=i;f[14]!==_.ambient.b||f[15]!==_.ambient.g||f[16]!==_.ambient.r?(c=new o.Color(_.ambient.r,_.ambient.g,_.ambient.b),f[14]=_.ambient.b,f[15]=_.ambient.g,f[16]=_.ambient.r,f[17]=c):c=f[17];let P=c,B=C.y<0;return f[18]!==B?(u=()=>{(0,e9.updateGlobalSunUniforms)(B)},d=[B],f[18]=B,f[19]=u,f[20]=d):(u=f[19],d=f[20]),(0,r.useEffect)(u,d),f[21]!==T||f[22]!==I?(m=(0,t.jsx)("directionalLight",{position:I,color:T,intensity:1,castShadow:!0,"shadow-mapSize-width":8192,"shadow-mapSize-height":8192,"shadow-camera-left":-4096,"shadow-camera-right":4096,"shadow-camera-top":4096,"shadow-camera-bottom":-4096,"shadow-camera-near":100,"shadow-camera-far":12e3,"shadow-bias":-1e-5,"shadow-normalBias":.4,"shadow-radius":2}),f[21]=T,f[22]=I,f[23]=m):m=f[23],f[24]!==P?(h=(0,t.jsx)("ambientLight",{color:P,intensity:1}),f[24]=P,f[25]=h):h=f[25],f[26]!==m||f[27]!==h?(p=(0,t.jsxs)(t.Fragment,{children:[m,h]}),f[26]=m,f[27]=h,f[28]=p):p=f[28],p}var ta=e.i(75840);let tr=(0,i.textureToUrl)("gui/hud_new_compass"),tn=(0,i.textureToUrl)("gui/hud_new_NSEW");function to(e){let r,n,o=(0,a.c)(3),{yaw:s}=e;if(null==s)return null;let l=180*s/Math.PI;o[0]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("img",{src:tr,alt:"",className:ta.default.CompassRing}),o[0]=r):r=o[0];let i=`rotate(${-l}deg)`;return o[1]!==i?(n=(0,t.jsxs)("div",{className:ta.default.Compass,children:[r,(0,t.jsx)("img",{src:tn,alt:"",className:ta.default.CompassNSEW,style:{transform:i}})]}),o[1]=i,o[2]=n):n=o[2],n}function ts(e){let r,n=(0,a.c)(2),{value:o}=e,s=Math.max(0,Math.min(100,100*o)),l=`${s}%`;return n[0]!==l?(r=(0,t.jsx)("div",{className:ta.default.BarTrack,children:(0,t.jsx)("div",{className:ta.default.BarFillHealth,style:{width:l}})}),n[0]=l,n[1]=r):r=n[1],r}function tl(e){let r,n=(0,a.c)(2),{value:o}=e,s=Math.max(0,Math.min(100,100*o)),l=`${s}%`;return n[0]!==l?(r=(0,t.jsx)("div",{className:ta.default.BarTrack,children:(0,t.jsx)("div",{className:ta.default.BarFillEnergy,style:{width:l}})}),n[0]=l,n[1]=r):r=n[1],r}let ti={weapon_sniper:"gui/hud_ret_sniper",weapon_shocklance:"gui/hud_ret_shocklance",weapon_targeting:"gui/hud_ret_targlaser"};function tc(){let e,r=(0,a.c)(5),n=(0,g.useEngineSelector)(tu);if(void 0===n)return null;let o=ti[!n?"":n.replace(/\.dts$/i,"").toLowerCase()];if(o){let e,a;return r[0]!==o?(e=(0,i.textureToUrl)(o),r[0]=o,r[1]=e):e=r[1],r[2]!==e?(a=(0,t.jsx)("div",{className:ta.default.Reticle,children:(0,t.jsx)("img",{src:e,alt:"",className:ta.default.ReticleImage})}),r[2]=e,r[3]=a):a=r[3],a}return r[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("div",{className:ta.default.Reticle,children:(0,t.jsx)("div",{className:ta.default.ReticleDot})}),r[4]=e):e=r[4],e}function tu(e){let t=e.playback.streamSnapshot;if(!t||t.camera?.mode!=="first-person")return;let a=t.controlPlayerGhostId;if(a)return t.entities.find(e=>e.id===a)?.weaponShape}let td={0:{icon:"gui/hud_blaster",label:"Blaster"},1:{icon:"gui/hud_plasma",label:"Plasma"},2:{icon:"gui/hud_chaingun",label:"Chaingun"},3:{icon:"gui/hud_disc",label:"Spinfusor"},4:{icon:"gui/hud_grenlaunch",label:"GL"},5:{icon:"gui/hud_sniper",label:"Laser Rifle"},6:{icon:"gui/hud_elfgun",label:"ELF Gun"},7:{icon:"gui/hud_new_mortar",label:"Mortar"},8:{icon:"gui/hud_missiles",label:"Missile"},9:{icon:"gui/hud_targetlaser",label:"Targeting"},10:{icon:"gui/hud_shocklance",label:"Shocklance"},11:{icon:"gui/hud_disc",label:"Spinfusor"},12:{icon:"gui/hud_grenlaunch",label:"GL"},13:{icon:"gui/hud_chaingun",label:"Chaingun"},14:{icon:"gui/hud_targetlaser",label:"Targeting"},15:{icon:"gui/hud_targetlaser",label:"Targeting"},16:{icon:"gui/hud_shocklance",label:"Shocklance"},17:{icon:"gui/hud_new_mortar",label:"Mortar"}},tm=new Map(Object.entries(td).map(([e,t])=>[Number(e),(0,i.textureToUrl)(t.icon)])),th=new Set([9,14,15]),tp=(0,i.textureToUrl)("gui/hud_infinity");function tf(e){let r,n,o,s,l=(0,a.c)(12),{slot:i,isSelected:c}=e,u=td[i.index];if(!u)return null;let d=i.ammo<0,m=`${ta.default.PackInvItem} ${c?ta.default.PackInvItemActive:ta.default.PackInvItemDim}`;return l[0]!==i.index?(r=tm.get(i.index),l[0]=i.index,l[1]=r):r=l[1],l[2]!==u.label||l[3]!==r?(n=(0,t.jsx)("img",{src:r,alt:u.label,className:ta.default.PackInvIcon}),l[2]=u.label,l[3]=r,l[4]=n):n=l[4],l[5]!==d||l[6]!==i.ammo?(o=d?(0,t.jsx)("img",{src:tp,alt:"\\u221E",className:ta.default.PackInvInfinity}):(0,t.jsx)("span",{className:ta.default.PackInvCount,children:i.ammo}),l[5]=d,l[6]=i.ammo,l[7]=o):o=l[7],l[8]!==m||l[9]!==n||l[10]!==o?(s=(0,t.jsxs)("div",{className:m,children:[n,o]}),l[8]=m,l[9]=n,l[10]=o,l[11]=s):s=l[11],s}function t_(){let e,r,n,o,s,l,i=(0,a.c)(15),c=(0,g.useEngineSelector)(tg);if(!c||!c.slots.length)return null;if(i[0]!==c.slots){for(let t of(r=[],e=[],c.slots))th.has(t.index)?e.push(t):r.push(t);i[0]=c.slots,i[1]=e,i[2]=r}else e=i[1],r=i[2];return i[3]!==r||i[4]!==c?(n=r.map(e=>(0,t.jsx)(tf,{slot:e,isSelected:e.index===c.activeIndex},e.index)),i[3]=r,i[4]=c,i[5]=n):n=i[5],i[6]!==e.length?(o=e.length>0&&(0,t.jsx)("div",{className:ta.default.WeaponSeparator}),i[6]=e.length,i[7]=o):o=i[7],i[8]!==e||i[9]!==c?(s=e.map(e=>(0,t.jsx)(tf,{slot:e,isSelected:e.index===c.activeIndex},e.index)),i[8]=e,i[9]=c,i[10]=s):s=i[10],i[11]!==n||i[12]!==o||i[13]!==s?(l=(0,t.jsxs)("div",{className:ta.default.WeaponHUD,children:[n,o,s]}),i[11]=n,i[12]=o,i[13]=s,i[14]=l):l=i[14],l}function tg(e){return e.playback.streamSnapshot?.weaponsHud}let ty={1:"Storm",2:"Inferno",3:"Starwolf",4:"Diamond Sword",5:"Blood Eagle",6:"Phoenix"};function tv(){let e,r,n,o=(0,a.c)(11),s=(0,g.useEngineSelector)(tb),l=(0,g.useEngineSelector)(tx);if(!s?.length)return null;if(o[0]!==l||o[1]!==s){let a,n;o[4]!==l?(a=(e,t)=>{if(l){if(e.teamId===l)return -1;if(t.teamId===l)return 1}return e.teamId-t.teamId},o[4]=l,o[5]=a):a=o[5];let i=[...s].sort(a);e=ta.default.TeamScores,o[6]!==l?(n=e=>{let a=l>0&&e.teamId===l,r=e.name||(ty[e.teamId]??`Team ${e.teamId}`);return(0,t.jsxs)("div",{className:ta.default.TeamRow,children:[(0,t.jsx)("span",{className:a?ta.default.TeamNameFriendly:ta.default.TeamNameEnemy,children:r}),(0,t.jsx)("span",{className:ta.default.TeamScore,children:e.score}),(0,t.jsxs)("span",{className:ta.default.TeamCount,children:["(",e.playerCount,")"]})]},e.teamId)},o[6]=l,o[7]=n):n=o[7],r=i.map(n),o[0]=l,o[1]=s,o[2]=e,o[3]=r}else e=o[2],r=o[3];return o[8]!==e||o[9]!==r?(n=(0,t.jsx)("div",{className:e,children:r}),o[8]=e,o[9]=r,o[10]=n):n=o[10],n}function tx(e){return e.playback.streamSnapshot?.playerSensorGroup}function tb(e){return e.playback.streamSnapshot?.teamScores}let tk={0:ta.default.ChatColor0,1:ta.default.ChatColor1,2:ta.default.ChatColor2,3:ta.default.ChatColor3,4:ta.default.ChatColor4,5:ta.default.ChatColor5,6:ta.default.ChatColor6,7:ta.default.ChatColor7,8:ta.default.ChatColor8,9:ta.default.ChatColor9};function tS(e){let n,o,s,l,i,c,u=(0,a.c)(15),{isLive:d}=e,m=(0,g.useEngineSelector)(tI),h=(0,r.useRef)(null),p=(0,r.useRef)(0),[f,_]=(0,r.useState)(""),y=m?.length??0;u[0]!==y?(n=()=>{y>p.current&&h.current&&(h.current.scrollTop=h.current.scrollHeight),p.current=y},o=[y],u[0]=y,u[1]=n,u[2]=o):(n=u[1],o=u[2]),(0,r.useEffect)(n,o),u[3]!==f?(s=e=>{e.preventDefault();let t=f.trim();t&&(eF.liveConnectionStore.getState().sendCommand("messageSent",t),_(""))},u[3]=f,u[4]=s):s=u[4];let v=s,x=!!m?.length;return u[5]!==x||u[6]!==m?(l=x&&(0,t.jsx)("div",{ref:h,className:ta.default.ChatWindow,children:m.map(tw)}),u[5]=x,u[6]=m,u[7]=l):l=u[7],u[8]!==f||u[9]!==v||u[10]!==d?(i=d&&(0,t.jsx)("form",{className:ta.default.ChatInputForm,onSubmit:v,children:(0,t.jsx)("input",{className:ta.default.ChatInput,type:"text",placeholder:"Say something…",value:f,onChange:e=>_(e.target.value),onKeyDown:tj,onKeyUp:tC,maxLength:255})}),u[8]=f,u[9]=v,u[10]=d,u[11]=i):i=u[11],u[12]!==l||u[13]!==i?(c=(0,t.jsxs)("div",{className:ta.default.ChatContainer,children:[l,i]}),u[12]=l,u[13]=i,u[14]=c):c=u[14],c}function tC(e){return e.stopPropagation()}function tj(e){return e.stopPropagation()}function tw(e,a){return(0,t.jsx)("div",{className:ta.default.ChatMessage,children:e.segments?e.segments.map(tN):(0,t.jsxs)("span",{className:null!=e.colorCode&&tk[e.colorCode]?tk[e.colorCode]:tk[0],children:[e.sender?`${e.sender}: `:"",e.text]})},e.id)}function tN(e,a){return(0,t.jsx)("span",{className:tk[e.colorCode]??tk[0],children:e.text},a)}function tI(e){return e.playback.streamSnapshot?.chatMessages}let tT=new Map(Object.entries({0:"gui/hud_new_packammo",1:"gui/hud_new_packcloak",2:"gui/hud_new_packenergy",3:"gui/hud_new_packrepair",4:"gui/hud_new_packsatchel",5:"gui/hud_new_packshield",6:"gui/hud_new_packinventory",7:"gui/hud_new_packmotionsens",8:"gui/hud_new_packradar",9:"gui/hud_new_packturretout",10:"gui/hud_new_packturretin",11:"gui/hud_new_packsensjam",12:"gui/hud_new_packturret",13:"gui/hud_new_packturret",14:"gui/hud_new_packturret",15:"gui/hud_new_packturret",16:"gui/hud_new_packturret",17:"gui/hud_new_packturret",18:"gui/hud_satchel_unarmed",19:"gui/hud_new_packenergy"}).map(([e,t])=>[Number(e),(0,i.textureToUrl)(t)])),tP=new Map(Object.entries({1:"gui/hud_new_packcloak_armed",3:"gui/hud_new_packrepair_armed",4:"gui/hud_satchel_armed",5:"gui/hud_new_packshield_armed",11:"gui/hud_new_packsensjam_armed"}).map(([e,t])=>[Number(e),(0,i.textureToUrl)(t)])),tB={0:{icon:"gui/hud_handgren",label:"Grenade"},1:{icon:"gui/hud_mine",label:"Mine"},2:{icon:"gui/hud_beacon",label:"Beacon"},3:{icon:"gui/hud_medpack",label:"Repair Kit"}},tD=new Map(Object.entries(tB).map(([e,t])=>[Number(e),(0,i.textureToUrl)(t.icon)]));function tE(){let e,r,n,o,s,l,i,c=(0,a.c)(25),u=(0,g.useEngineSelector)(tM),d=(0,g.useEngineSelector)(tR),m=u&&u.packIndex>=0;if(m){let t,a;c[0]!==u.active||c[1]!==u.packIndex?(t=u.active?tP.get(u.packIndex):void 0,c[0]=u.active,c[1]=u.packIndex,c[2]=t):t=c[2];let r=t;c[3]!==r||c[4]!==u.packIndex?(a=r??tT.get(u.packIndex),c[3]=r,c[4]=u.packIndex,c[5]=a):a=c[5],e=a}if(c[6]!==d){if(r=new Map,d)for(let e of d.slots)r.set(e.slot,e.count);c[6]=d,c[7]=r}else r=c[7];if(c[8]!==u||c[9]!==r||c[10]!==m||c[11]!==e){l=Symbol.for("react.early_return_sentinel");e:{let a,i=Object.keys(tB).map(Number).sort(tL);if(!m&&!r.size){l=null;break e}n=ta.default.PackInventoryHUD,c[16]!==u||c[17]!==e?(o=e&&(0,t.jsxs)("div",{className:`${ta.default.PackInvItem} ${u.active?ta.default.PackInvItemActive:""}`,children:[(0,t.jsx)("img",{src:e,alt:"",className:ta.default.PackInvIcon}),(0,t.jsx)("span",{className:ta.default.PackInvCount,children:u.text||" "})]}),c[16]=u,c[17]=e,c[18]=o):o=c[18],c[19]!==r?(a=e=>{let a=tB[e],n=tD.get(e);return a&&n?(0,t.jsxs)("div",{className:ta.default.PackInvItem,children:[(0,t.jsx)("img",{src:n,alt:a.label,className:ta.default.PackInvIcon}),(0,t.jsx)("span",{className:ta.default.PackInvCount,children:r.get(e)??0})]},e):null},c[19]=r,c[20]=a):a=c[20],s=i.map(a)}c[8]=u,c[9]=r,c[10]=m,c[11]=e,c[12]=n,c[13]=o,c[14]=s,c[15]=l}else n=c[12],o=c[13],s=c[14],l=c[15];return l!==Symbol.for("react.early_return_sentinel")?l:(c[21]!==n||c[22]!==o||c[23]!==s?(i=(0,t.jsxs)("div",{className:n,children:[o,s]}),c[21]=n,c[22]=o,c[23]=s,c[24]=i):i=c[24],i)}function tL(e,t){return e-t}function tR(e){return e.playback.streamSnapshot?.inventoryHud}function tM(e){return e.playback.streamSnapshot?.backpackHud}function tH(e){let r,n,o,s,l=(0,a.c)(10);l[0]!==e?(r=void 0===e?{}:e,l[0]=e,l[1]=r):r=l[1];let{isLive:i}=r,c=void 0!==i&&i,u=(0,E.useRecording)(),d=(0,g.useEngineSelector)(tF);if(!u&&!c)return null;let m=d?.status;return l[2]!==c?(n=(0,t.jsx)(tS,{isLive:c}),l[2]=c,l[3]=n):n=l[3],l[4]!==m||l[5]!==d?.camera?.yaw?(o=m&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:ta.default.TopRight,children:[(0,t.jsxs)("div",{className:ta.default.Bars,children:[(0,t.jsx)(ts,{value:m.health}),(0,t.jsx)(tl,{value:m.energy})]}),(0,t.jsx)(to,{yaw:d?.camera?.yaw})]}),(0,t.jsx)(t_,{}),(0,t.jsx)(tE,{}),(0,t.jsx)(tv,{}),(0,t.jsx)(tc,{})]}),l[4]=m,l[5]=d?.camera?.yaw,l[6]=o):o=l[6],l[7]!==n||l[8]!==o?(s=(0,t.jsxs)("div",{className:ta.default.PlayerHUD,children:[n,o]}),l[7]=n,l[8]=o,l[9]=s):s=l[9],s}function tF(e){return e.playback.streamSnapshot}function tG(e){let t,n=(0,a.c)(1),{children:o}=e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],n[0]=t):t=n[0],(0,r.useEffect)(tq,t),o}function tq(){return tO}function tO(){return(0,eF.disposeLiveConnection)()}var tA=e.i(56614);function tU({open:e,onClose:a,servers:n,loading:o,onRefresh:s,onJoin:l,wsPing:i,warriorName:c,onWarriorNameChange:u}){let[d,m]=(0,r.useState)(null),[h,p]=(0,r.useState)("ping"),[f,_]=(0,r.useState)("asc"),g=(0,r.useRef)(null),y=(0,r.useRef)(s);y.current=s;let v=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(e){g.current?.focus();try{document.exitPointerLock()}catch{}}else v.current=!1},[e]),(0,r.useEffect)(()=>{e&&0===n.length&&!v.current&&(v.current=!0,y.current())},[e]),(0,r.useEffect)(()=>{if(!e)return;let t=e=>{e.stopPropagation(),"Escape"===e.key&&a()};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e,a]);let x=(0,r.useCallback)(e=>{h===e?_(e=>"asc"===e?"desc":"asc"):(p(e),_("desc"))},[h]),b=(0,r.useMemo)(()=>[...n].sort((e,t)=>{let a=e[h],r=t[h],n="number"==typeof a&&"number"==typeof r?a-r:String(a).localeCompare(String(r));return"asc"===f?n:-n}),[n,f,h]),k=(0,r.useCallback)(()=>{d&&(l(d),a())},[d,l,a]);return e?(0,t.jsx)("div",{className:tA.default.Overlay,onClick:a,children:(0,t.jsxs)("div",{className:tA.default.Dialog,ref:g,tabIndex:-1,onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:tA.default.Header,children:[(0,t.jsx)("h2",{className:tA.default.Title,children:"Server Browser"}),(0,t.jsxs)("span",{className:tA.default.ServerCount,children:[n.length," server",1!==n.length?"s":""]}),(0,t.jsx)("button",{className:tA.default.RefreshButton,onClick:s,disabled:o,children:o?"Refreshing...":"Refresh"})]}),(0,t.jsx)("div",{className:tA.default.TableWrapper,children:(0,t.jsxs)("table",{className:tA.default.Table,children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{onClick:()=>x("name"),children:"Server Name"}),(0,t.jsx)("th",{onClick:()=>x("playerCount"),children:"Players"}),(0,t.jsx)("th",{onClick:()=>x("ping"),children:"Ping"}),(0,t.jsx)("th",{onClick:()=>x("mapName"),children:"Map"}),(0,t.jsx)("th",{onClick:()=>x("gameType"),children:"Type"}),(0,t.jsx)("th",{onClick:()=>x("mod"),children:"Mod"})]})}),(0,t.jsxs)("tbody",{children:[b.map(e=>(0,t.jsxs)("tr",{className:d===e.address?tA.default.Selected:void 0,onClick:()=>m(e.address),onDoubleClick:()=>{m(e.address),l(e.address),a()},children:[(0,t.jsxs)("td",{children:[e.passwordRequired&&(0,t.jsx)("span",{className:tA.default.PasswordIcon,children:"🔒"}),e.name]}),(0,t.jsxs)("td",{children:[e.playerCount,"/",e.maxPlayers]}),(0,t.jsx)("td",{children:null!=i?(e.ping+i).toLocaleString():"—"}),(0,t.jsx)("td",{children:e.mapName}),(0,t.jsx)("td",{children:e.gameType}),(0,t.jsx)("td",{children:e.mod})]},e.address)),0===b.length&&!o&&(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:6,className:tA.default.Empty,children:"No servers found"})}),o&&0===b.length&&(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:6,className:tA.default.Empty,children:"Querying master server..."})})]})]})}),(0,t.jsxs)("div",{className:tA.default.Footer,children:[(0,t.jsxs)("div",{className:tA.default.WarriorField,children:[(0,t.jsx)("label",{className:tA.default.WarriorLabel,htmlFor:"warriorName",children:"Warrior"}),(0,t.jsx)("input",{id:"warriorName",className:tA.default.WarriorInput,type:"text",value:c,onChange:e=>u(e.target.value),placeholder:"Name thyself…",maxLength:24})]}),(0,t.jsx)("span",{className:tA.default.Hint,children:"Double-click a server to join"}),(0,t.jsx)("button",{onClick:a,className:tA.default.CloseButton,children:"Cancel"}),(0,t.jsx)("button",{onClick:k,disabled:!d,className:tA.default.JoinButton,children:"Join"})]})]})}):null}var tW=e.i(38847);let tK=(0,r.createContext)({live:!1});function tz(e){let n,o,s=(0,a.c)(5),{children:l}=e,[i]=(0,tW.useQueryState)("features",tW.parseAsString);s[0]!==i?(n=()=>({live:new Set((i??"").split(",").map(t$).filter(Boolean)).has("live")}),s[0]=i,s[1]=n):n=s[1];let[c]=(0,r.useState)(n);return s[2]!==l||s[3]!==c?(o=(0,t.jsx)(tK.Provider,{value:c,children:l}),s[2]=l,s[3]=c,s[4]=o):o=s[4],o}function t$(e){return e.trim().toLowerCase()}var tJ=e.i(3011);let tV=(0,r.lazy)(()=>e.A(67521).then(e=>({default:e.StreamPlayback}))),tY=(0,r.lazy)(()=>e.A(93884).then(e=>({default:e.DemoPlaybackControls}))),tX=(0,r.lazy)(()=>e.A(96145).then(e=>({default:e.LiveObserver}))),tQ=(0,r.lazy)(()=>e.A(38496).then(e=>({default:e.ChatSoundPlayer}))),tZ=(0,r.lazy)(()=>e.A(59197).then(e=>({default:e.MapInfoDialog}))),t0=new T.QueryClient,t1={toneMapping:o.NoToneMapping,outputColorSpace:o.SRGBColorSpace},t2=(0,tW.createParser)({parse(e){let[t,a]=e.split("~"),r=a,n=(0,f.getMissionInfo)(t).missionTypes;return a&&n.includes(a)||(r=n[0]),{missionName:t,missionType:r}},serialize:({missionName:e,missionType:t})=>1===(0,f.getMissionInfo)(e).missionTypes.length?e:`${e}~${t}`,eq:(e,t)=>e.missionName===t.missionName&&e.missionType===t.missionType}).withDefault({missionName:"RiverDance",missionType:"CTF"});function t3(){let e,s,l,i,c,u,d,m,h,p,_,g,y,v,x,b,k,S,C,j,w,N,I,T,L,M,H,F,G,q,O,A,U,W,K,z,$,V,Y,X,Z,ee,et,ea=(0,a.c)(77),[er,en]=(0,tW.useQueryState)("mission",t2),[eo,es]=(0,tW.useQueryState)("fog",tW.parseAsBoolean);ea[0]!==es?(e=()=>{es(null)},ea[0]=es,ea[1]=e):e=ea[1];let el=e;ea[2]!==el||ea[3]!==en?(s=e=>{window.location.hash="",el(),en(e)},ea[2]=el,ea[3]=en,ea[4]=s):s=ea[4];let ei=s,ec=(X=(0,a.c)(2),Z=(0,r.useRef)(null),X[0]===Symbol.for("react.memo_cache_sentinel")?(V=e=>{let t=window.matchMedia("(pointer: coarse)");return t.addEventListener("change",e),Z.current=t,()=>{t.removeEventListener("change",e)}},X[0]=V):V=X[0],ee=V,X[1]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>Z.current?.matches??null,X[1]=Y):Y=X[1],et=Y,(0,r.useSyncExternalStore)(ee,et,eZ)),eu=(0,r.useContext)(tK),ed=(0,eF.useLiveSelector)(t8),em=(0,eF.useLiveSelector)(t6),eh=(0,eF.useLiveSelector)(t5),{missionName:ep,missionType:ef}=er,[e_,eg]=(0,r.useState)(!1),[ey,ev]=(0,r.useState)(!1),[ex,eb]=(0,r.useState)(0),[ek,eS]=(0,r.useState)(!0),eC=ed?em?1:"connected"===eh?.8:"authenticating"===eh?.6:"challenging"===eh?.3:"connecting"===eh?.2:.1:null;ea[5]!==eC?(l=()=>{null!=eC&&eb(0)},ea[5]=eC,ea[6]=l):l=ea[6];let ej=null!=eC;ea[7]!==ej?(i=[ej],ea[7]=ej,ea[8]=i):i=ea[8],(0,r.useEffect)(l,i);let ew=eC??ex,eN=ew<1;ea[9]!==eN?(c=()=>{if(eN)eS(!0);else{let e=setTimeout(()=>eS(!1),500);return()=>clearTimeout(e)}},u=[eN],ea[9]=eN,ea[10]=c,ea[11]=u):(c=ea[10],u=ea[11]),(0,r.useEffect)(c,u),ea[12]!==ei?(d=()=>(window.setMissionName=e=>{let t=(0,f.getMissionInfo)(e).missionTypes;ei({missionName:e,missionType:t[0]})},window.getMissionList=f.getMissionList,window.getMissionInfo=f.getMissionInfo,t4),m=[ei],ea[12]=ei,ea[13]=d,ea[14]=m):(d=ea[13],m=ea[14]),(0,r.useEffect)(d,m),ea[15]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{let e=e=>{if("KeyI"!==e.code||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target;"INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||eg(!0)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},h=[],ea[15]=h,ea[16]=p):(h=ea[15],p=ea[16]),(0,r.useEffect)(p,h),ea[17]===Symbol.for("react.memo_cache_sentinel")?(_=(e,t)=>{eb(void 0===t?0:t)},ea[17]=_):_=ea[17];let eI=_,eT=(0,r.useRef)(null);ea[18]===Symbol.for("react.memo_cache_sentinel")?(g={angle:0,force:0},ea[18]=g):g=ea[18];let eP=(0,r.useRef)(g),eB=(0,r.useRef)(null);ea[19]===Symbol.for("react.memo_cache_sentinel")?(y={angle:0,force:0},ea[19]=y):y=ea[19];let eD=(0,r.useRef)(y),eE=(0,r.useRef)(null);return ea[20]!==eN||ea[21]!==ew||ea[22]!==ek?(v=ek&&(0,t.jsxs)("div",{id:"loadingIndicator",className:tJ.default.LoadingIndicator,"data-complete":!eN,children:[(0,t.jsx)("div",{className:tJ.default.Spinner}),(0,t.jsx)("div",{className:tJ.default.Progress,children:(0,t.jsx)("div",{className:tJ.default.ProgressBar,style:{width:`${100*ew}%`}})}),(0,t.jsxs)("div",{className:tJ.default.ProgressText,children:[Math.round(100*ew),"%"]})]}),ea[20]=eN,ea[21]=ew,ea[22]=ek,ea[23]=v):v=ea[23],ea[24]===Symbol.for("react.memo_cache_sentinel")?(x={type:o.PCFShadowMap},b=e=>{eT.current=e.camera},ea[24]=x,ea[25]=b):(x=ea[24],b=ea[25]),ea[26]!==ep||ea[27]!==ef?(k=(0,t.jsx)(t7,{missionName:ep,missionType:ef,onLoadingChange:eI}),ea[26]=ep,ea[27]=ef,ea[28]=k):k=ea[28],ea[29]===Symbol.for("react.memo_cache_sentinel")?(S=(0,t.jsx)(te,{}),ea[29]=S):S=ea[29],ea[30]!==ef?(C=(0,t.jsx)(e6.EntityScene,{missionType:ef}),ea[30]=ef,ea[31]=C):C=ea[31],ea[32]===Symbol.for("react.memo_cache_sentinel")?(j=(0,t.jsx)(e2,{}),w=(0,t.jsx)(e4.DebugElements,{}),ea[32]=j,ea[33]=w):(j=ea[32],w=ea[33]),ea[34]!==ec?(N=(0,t.jsx)(ae,{isTouch:ec,joystickStateRef:eP,joystickZoneRef:eB,lookJoystickStateRef:eD,lookJoystickZoneRef:eE}),ea[34]=ec,ea[35]=N):N=ea[35],ea[36]!==k||ea[37]!==C||ea[38]!==N?(I=(0,t.jsx)(n.Canvas,{frameloop:"always",gl:t1,shadows:x,onCreated:b,children:(0,t.jsx)(e8.TickProvider,{children:(0,t.jsx)(e5.CamerasProvider,{children:(0,t.jsxs)(e3.AudioProvider,{children:[k,S,C,j,w,N]})})})}),ea[36]=k,ea[37]=C,ea[38]=N,ea[39]=I):I=ea[39],ea[40]!==v||ea[41]!==I?(T=(0,t.jsxs)("div",{id:"canvasContainer",className:tJ.default.CanvasContainer,children:[v,I]}),ea[40]=v,ea[41]=I,ea[42]=T):T=ea[42],ea[43]===Symbol.for("react.memo_cache_sentinel")?(L=(0,t.jsx)(aa,{}),ea[43]=L):L=ea[43],ea[44]!==ec?(M=ec&&(0,t.jsx)(Q,{joystickState:eP,joystickZone:eB,lookJoystickState:eD,lookJoystickZone:eE}),ea[44]=ec,ea[45]=M):M=ea[45],ea[46]!==ec?(H=!1===ec&&(0,t.jsx)(R,{}),ea[46]=ec,ea[47]=H):H=ea[47],ea[48]===Symbol.for("react.memo_cache_sentinel")?(F=()=>eg(!0),ea[48]=F):F=ea[48],ea[49]!==eu.live?(G=eu.live?()=>ev(!0):void 0,ea[49]=eu.live,ea[50]=G):G=ea[50],ea[51]!==ei||ea[52]!==ec||ea[53]!==ep||ea[54]!==ef||ea[55]!==G?(q=(0,t.jsx)(e$,{missionName:ep,missionType:ef,onChangeMission:ei,onOpenMapInfo:F,onOpenServerBrowser:G,cameraRef:eT,isTouch:ec}),ea[51]=ei,ea[52]=ec,ea[53]=ep,ea[54]=ef,ea[55]=G,ea[56]=q):q=ea[56],ea[57]!==e_||ea[58]!==ep||ea[59]!==ef?(O=e_&&(0,t.jsx)(r.Suspense,{fallback:null,children:(0,t.jsx)(tZ,{open:e_,onClose:()=>eg(!1),missionName:ep,missionType:ef??""})}),ea[57]=e_,ea[58]=ep,ea[59]=ef,ea[60]=O):O=ea[60],ea[61]===Symbol.for("react.memo_cache_sentinel")?(A=()=>ev(!1),ea[61]=A):A=ea[61],ea[62]!==ey?(U=(0,t.jsx)(as,{open:ey,onClose:A}),ea[62]=ey,ea[63]=U):U=ea[63],ea[64]===Symbol.for("react.memo_cache_sentinel")?(W=(0,t.jsx)(an,{}),K=(0,t.jsx)(am,{}),ea[64]=W,ea[65]=K):(W=ea[64],K=ea[65]),ea[66]!==T||ea[67]!==M||ea[68]!==H||ea[69]!==q||ea[70]!==O||ea[71]!==U?(z=(0,t.jsxs)(D.KeyboardControls,{map:B.KEYBOARD_CONTROLS,children:[T,L,M,H,q,O,U,W,K]}),ea[66]=T,ea[67]=M,ea[68]=H,ea[69]=q,ea[70]=O,ea[71]=U,ea[72]=z):z=ea[72],ea[73]!==el||ea[74]!==eo||ea[75]!==z?($=(0,t.jsx)(P.QueryClientProvider,{client:t0,children:(0,t.jsx)("main",{children:(0,t.jsx)(E.RecordingProvider,{children:(0,t.jsx)(J.SettingsProvider,{fogEnabledOverride:eo,onClearFogEnabledOverride:el,children:z})})})}),ea[73]=el,ea[74]=eo,ea[75]=z,ea[76]=$):$=ea[76],$}function t4(){delete window.setMissionName,delete window.getMissionList,delete window.getMissionInfo}function t5(e){return e.gameStatus}function t6(e){return e.liveReady}function t8(e){return null!=e.adapter}function t7(e){let r,n=(0,a.c)(5),{missionName:o,missionType:s,onLoadingChange:l}=e,i=(0,E.useRecording)(),c=(0,eF.useLiveSelector)(t9);if(null!=i||c)return null;let u=`${o}~${s}`;return n[0]!==o||n[1]!==s||n[2]!==l||n[3]!==u?(r=(0,t.jsx)(I,{name:o,missionType:s,onLoadingChange:l},u),n[0]=o,n[1]=s,n[2]=l,n[3]=u,n[4]=r):r=n[4],r}function t9(e){return null!=e.adapter}function ae(e){let n,o,s,l,i,c=(0,a.c)(18),{isTouch:u,joystickStateRef:d,joystickZoneRef:m,lookJoystickStateRef:h,lookJoystickZoneRef:p}=e,f=(0,E.useRecording)(),_=(0,eF.useLiveSelector)(at),g=null!=f||_,y=!g||_;return c[0]!==f?(n=f&&(0,t.jsx)(r.Suspense,{fallback:null,children:(0,t.jsx)(tV,{})}),c[0]=f,c[1]=n):n=c[1],c[2]!==_?(o=_&&(0,t.jsx)(r.Suspense,{fallback:null,children:(0,t.jsx)(tX,{})}),c[2]=_,c[3]=o):o=c[3],c[4]!==g?(s=g&&(0,t.jsx)(r.Suspense,{fallback:null,children:(0,t.jsx)(tQ,{})}),c[4]=g,c[5]=s):s=c[5],c[6]!==u||c[7]!==d||c[8]!==m||c[9]!==h||c[10]!==p||c[11]!==y?(l=y&&null!==u&&(u?(0,t.jsx)(Z,{joystickState:d,joystickZone:m,lookJoystickState:h,lookJoystickZone:p}):(0,t.jsx)(B.ObserverControls,{})),c[6]=u,c[7]=d,c[8]=m,c[9]=h,c[10]=p,c[11]=y,c[12]=l):l=c[12],c[13]!==n||c[14]!==o||c[15]!==s||c[16]!==l?(i=(0,t.jsxs)(t.Fragment,{children:[n,o,s,l]}),c[13]=n,c[14]=o,c[15]=s,c[16]=l,c[17]=i):i=c[17],i}function at(e){return null!=e.adapter}function aa(){let e,r=(0,a.c)(2),n=(0,E.useRecording)(),o=(0,eF.useLiveSelector)(ar);return n||o?(r[0]!==o?(e=(0,t.jsx)(tH,{isLive:o}),r[0]=o,r[1]=e):e=r[1],e):null}function ar(e){return null!=e.adapter}function an(){let e,n=(0,a.c)(1),o=(0,E.useRecording)(),s=(0,eF.useLiveSelector)(ao);return!o||s?null:(n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(r.Suspense,{fallback:null,children:(0,t.jsx)(tY,{})}),n[0]=e):e=n[0],e)}function ao(e){return null!=e.adapter}function as(e){let r,n,o,s=(0,a.c)(15),{open:l,onClose:i}=e,c=(0,eF.useLiveSelector)(ad),u=(0,eF.useLiveSelector)(au),d=(0,eF.useLiveSelector)(ac),m=(0,eF.useLiveSelector)(ai),h=(0,eF.useLiveSelector)(al),p=(0,J.useSettings)();s[0]!==h||s[1]!==p?.warriorName?(r=e=>{h(e,p?.warriorName)},s[0]=h,s[1]=p?.warriorName,s[2]=r):r=s[2],p?.warriorName;let f=r,_=p?.warriorName??"";return s[3]!==p?(n=e=>p?.setWarriorName(e),s[3]=p,s[4]=n):n=s[4],s[5]!==d||s[6]!==f||s[7]!==m||s[8]!==i||s[9]!==l||s[10]!==c||s[11]!==u||s[12]!==_||s[13]!==n?(o=(0,t.jsx)(tU,{open:l,onClose:i,servers:c,loading:u,onRefresh:m,onJoin:f,wsPing:d,warriorName:_,onWarriorNameChange:n}),s[5]=d,s[6]=f,s[7]=m,s[8]=i,s[9]=l,s[10]=c,s[11]=u,s[12]=_,s[13]=n,s[14]=o):o=s[14],o}function al(e){return e.joinServer}function ai(e){return e.listServers}function ac(e){return e.browserToRelayPing}function au(e){return e.serversLoading}function ad(e){return e.servers}function am(){let e,t,n=(0,a.c)(3),{setRecording:o}=(0,E.usePlaybackActions)();return n[0]!==o?(e=()=>(window.loadDemoRecording=o,ah),t=[o],n[0]=o,n[1]=e,n[2]=t):(e=n[1],t=n[2]),(0,r.useEffect)(e,t),null}function ah(){delete window.loadDemoRecording}function ap(){let e,n=(0,a.c)(1);return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(r.Suspense,{children:(0,t.jsx)(tz,{children:(0,t.jsx)(tG,{children:(0,t.jsx)(t3,{})})})}),n[0]=e):e=n[0],e}e.s(["default",()=>ap],31713)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/543f866d9a9c134b.css b/docs/_next/static/chunks/543f866d9a9c134b.css new file mode 100644 index 00000000..14199904 --- /dev/null +++ b/docs/_next/static/chunks/543f866d9a9c134b.css @@ -0,0 +1 @@ +.ChatInput-module__mZgxEG__InputForm{display:flex}.ChatInput-module__mZgxEG__Input{color:#28e7f0;background:#00323ccc;border:0;border-top:1px solid #4eb3a733;border-radius:0;outline:none;width:100%;margin:0;padding:6px;font-family:inherit;font-size:12px;line-height:1.25}.ChatInput-module__mZgxEG__Input::placeholder{color:#2cacb580}.ChatInput-module__mZgxEG__Input:focus{background:#00323ce6} diff --git a/docs/_next/static/chunks/576b06837c0cb7a0.js b/docs/_next/static/chunks/576b06837c0cb7a0.js deleted file mode 100644 index 45ff4eb4..00000000 --- a/docs/_next/static/chunks/576b06837c0cb7a0.js +++ /dev/null @@ -1,17 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,53487,(e,t,r)=>{"use strict";let n="[^\\\\/]",s="[^/]",i="(?:\\/|$)",o="(?:^|\\/)",a=`\\.{1,2}${i}`,l=`(?!${o}${a})`,u=`(?!\\.{0,1}${i})`,c=`(?!${a})`,p=`${s}*?`,f={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:s,END_ANCHOR:i,DOTS_SLASH:a,NO_DOT:"(?!\\.)",NO_DOTS:l,NO_DOT_SLASH:u,NO_DOTS_SLASH:c,QMARK_NO_DOT:"[^.\\/]",STAR:p,START_ANCHOR:o,SEP:"/"},h={...f,SLASH_LITERAL:"[\\\\/]",QMARK:n,STAR:`${n}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"};t.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?h:f}},19241,(e,t,r)=>{"use strict";var n=e.i(47167);let{REGEX_BACKSLASH:s,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_GLOBAL:a}=e.r(53487);r.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r.hasRegexChars=e=>o.test(e),r.isRegexChar=e=>1===e.length&&r.hasRegexChars(e),r.escapeRegex=e=>e.replace(a,"\\$1"),r.toPosixSlashes=e=>e.replace(s,"/"),r.isWindows=()=>{if("u">typeof navigator&&navigator.platform){let e=navigator.platform.toLowerCase();return"win32"===e||"windows"===e}return void 0!==n.default&&!!n.default.platform&&"win32"===n.default.platform},r.removeBackslashes=e=>e.replace(i,e=>"\\"===e?"":e),r.escapeLast=(e,t,n)=>{let s=e.lastIndexOf(t,n);return -1===s?e:"\\"===e[s-1]?r.escapeLast(e,t,s-1):`${e.slice(0,s)}\\${e.slice(s)}`},r.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r},r.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",i=`${n}(?:${e})${s}`;return!0===t.negated&&(i=`(?:^(?!${i}).*$)`),i},r.basename=(e,{windows:t}={})=>{let r=e.split(t?/[\\/]/:"/"),n=r[r.length-1];return""===n?r[r.length-2]:n}},26094,(e,t,r)=>{"use strict";let n=e.r(19241),{CHAR_ASTERISK:s,CHAR_AT:i,CHAR_BACKWARD_SLASH:o,CHAR_COMMA:a,CHAR_DOT:l,CHAR_EXCLAMATION_MARK:u,CHAR_FORWARD_SLASH:c,CHAR_LEFT_CURLY_BRACE:p,CHAR_LEFT_PARENTHESES:f,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_PLUS:d,CHAR_QUESTION_MARK:g,CHAR_RIGHT_CURLY_BRACE:m,CHAR_RIGHT_PARENTHESES:b,CHAR_RIGHT_SQUARE_BRACKET:$}=e.r(53487),y=e=>e===c||e===o,x=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let r,A,C=t||{},S=e.length-1,v=!0===C.parts||!0===C.scanToEnd,w=[],E=[],_=[],k=e,R=-1,L=0,N=0,O=!1,I=!1,j=!1,T=!1,M=!1,B=!1,P=!1,H=!1,D=!1,F=!1,G=0,U={value:"",depth:0,isGlob:!1},q=()=>R>=S,J=()=>k.charCodeAt(R+1),K=()=>(r=A,k.charCodeAt(++R));for(;R 0&&(z=k.slice(0,L),k=k.slice(L),N-=L),W&&!0===j&&N>0?(W=k.slice(0,N),V=k.slice(N)):!0===j?(W="",V=k):W=k,W&&""!==W&&"/"!==W&&W!==k&&y(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),!0===C.unescape&&(V&&(V=n.removeBackslashes(V)),W&&!0===P&&(W=n.removeBackslashes(W)));let Z={prefix:z,input:e,start:L,base:W,glob:V,isBrace:O,isBracket:I,isGlob:j,isExtglob:T,isGlobstar:M,negated:H,negatedExtglob:D};if(!0===C.tokens&&(Z.maxDepth=0,y(A)||E.push(U),Z.tokens=E),!0===C.parts||!0===C.tokens){let t;for(let r=0;r{"use strict";let n=e.r(53487),s=e.r(19241),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_BACKREF:l,REPLACEMENTS:u}=n,c=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;try{new RegExp(r)}catch(t){return e.map(e=>s.escapeRegex(e)).join("..")}return r},p=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,f=(e,t)=>{let r;if("string"!=typeof e)throw TypeError("Expected a string");e=u[e]||e;let h={...t},d="number"==typeof h.maxLength?Math.min(i,h.maxLength):i,g=e.length;if(g>d)throw SyntaxError(`Input length: ${g}, exceeds maximum allowed length: ${d}`);let m={type:"bos",value:"",output:h.prepend||""},b=[m],$=h.capture?"":"?:",y=n.globChars(h.windows),x=n.extglobChars(y),{DOT_LITERAL:A,PLUS_LITERAL:C,SLASH_LITERAL:S,ONE_CHAR:v,DOTS_SLASH:w,NO_DOT:E,NO_DOT_SLASH:_,NO_DOTS_SLASH:k,QMARK:R,QMARK_NO_DOT:L,STAR:N,START_ANCHOR:O}=y,I=e=>`(${$}(?:(?!${O}${e.dot?w:A}).)*?)`,j=h.dot?"":E,T=h.dot?R:L,M=!0===h.bash?I(h):N;h.capture&&(M=`(${M})`),"boolean"==typeof h.noext&&(h.noextglob=h.noext);let B={input:e,index:-1,start:0,dot:!0===h.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:b};g=(e=s.removePrefix(e,B)).length;let P=[],H=[],D=[],F=m,G=()=>B.index===g-1,U=B.peek=(t=1)=>e[B.index+t],q=B.advance=()=>e[++B.index]||"",J=()=>e.slice(B.index+1),K=(e="",t=0)=>{B.consumed+=e,B.index+=t},W=e=>{B.output+=null!=e.output?e.output:e.value,K(e.value)},z=()=>{let e=1;for(;"!"===U()&&("("!==U(2)||"?"===U(3));)q(),B.start++,e++;return e%2!=0&&(B.negated=!0,B.start++,!0)},V=e=>{B[e]++,D.push(e)},Z=e=>{B[e]--,D.pop()},Q=e=>{if("globstar"===F.type){let t=B.braces>0&&("comma"===e.type||"brace"===e.type),r=!0===e.extglob||P.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||r||(B.output=B.output.slice(0,-F.output.length),F.type="star",F.value="*",F.output=M,B.output+=F.output)}if(P.length&&"paren"!==e.type&&(P[P.length-1].inner+=e.value),(e.value||e.output)&&W(e),F&&"text"===F.type&&"text"===e.type){F.output=(F.output||F.value)+e.value,F.value+=e.value;return}e.prev=F,b.push(e),F=e},X=(e,t)=>{let r={...x[t],conditions:1,inner:""};r.prev=F,r.parens=B.parens,r.output=B.output;let n=(h.capture?"(":"")+r.open;V("parens"),Q({type:e,value:t,output:B.output?"":v}),Q({type:"paren",extglob:!0,value:q(),output:n}),P.push(r)},Y=e=>{let n,s=e.close+(h.capture?")":"");if("negate"===e.type){let r=M;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=I(h)),(r!==M||G()||/^\)+$/.test(J()))&&(s=e.close=`)$))${r}`),e.inner.includes("*")&&(n=J())&&/^\.[^\\/.]+$/.test(n)){let i=f(n,{...t,fastpaths:!1}).output;s=e.close=`)${i})${r})`}"bos"===e.prev.type&&(B.negatedExtglob=!0)}Q({type:"paren",extglob:!0,value:r,output:s}),Z("parens")};if(!1!==h.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let r=!1,n=e.replace(l,(e,t,n,s,i,o)=>"\\"===s?(r=!0,e):"?"===s?t?t+s+(i?R.repeat(i.length):""):0===o?T+(i?R.repeat(i.length):""):R.repeat(n.length):"."===s?A.repeat(n.length):"*"===s?t?t+s+(i?M:""):M:t?e:`\\${e}`);return(!0===r&&(n=!0===h.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),n===e&&!0===h.contains)?B.output=e:B.output=s.wrapOutput(n,B,t),B}for(;!G();){if("\0"===(r=q()))continue;if("\\"===r){let e=U();if("/"===e&&!0!==h.bash||"."===e||";"===e)continue;if(!e){Q({type:"text",value:r+="\\"});continue}let t=/^\\+/.exec(J()),n=0;if(t&&t[0].length>2&&(n=t[0].length,B.index+=n,n%2!=0&&(r+="\\")),!0===h.unescape?r=q():r+=q(),0===B.brackets){Q({type:"text",value:r});continue}}if(B.brackets>0&&("]"!==r||"["===F.value||"[^"===F.value)){if(!1!==h.posix&&":"===r){let e=F.value.slice(1);if(e.includes("[")&&(F.posix=!0,e.includes(":"))){let e=F.value.lastIndexOf("["),t=F.value.slice(0,e),r=o[F.value.slice(e+2)];if(r){F.value=t+r,B.backtrack=!0,q(),m.output||1!==b.indexOf(F)||(m.output=v);continue}}}("["===r&&":"!==U()||"-"===r&&"]"===U())&&(r=`\\${r}`),"]"===r&&("["===F.value||"[^"===F.value)&&(r=`\\${r}`),!0===h.posix&&"!"===r&&"["===F.value&&(r="^"),F.value+=r,W({value:r});continue}if(1===B.quotes&&'"'!==r){r=s.escapeRegex(r),F.value+=r,W({value:r});continue}if('"'===r){B.quotes=+(1!==B.quotes),!0===h.keepQuotes&&Q({type:"text",value:r});continue}if("("===r){V("parens"),Q({type:"paren",value:r});continue}if(")"===r){if(0===B.parens&&!0===h.strictBrackets)throw SyntaxError(p("opening","("));let e=P[P.length-1];if(e&&B.parens===e.parens+1){Y(P.pop());continue}Q({type:"paren",value:r,output:B.parens?")":"\\)"}),Z("parens");continue}if("["===r){if(!0!==h.nobracket&&J().includes("]"))V("brackets");else{if(!0!==h.nobracket&&!0===h.strictBrackets)throw SyntaxError(p("closing","]"));r=`\\${r}`}Q({type:"bracket",value:r});continue}if("]"===r){if(!0===h.nobracket||F&&"bracket"===F.type&&1===F.value.length){Q({type:"text",value:r,output:`\\${r}`});continue}if(0===B.brackets){if(!0===h.strictBrackets)throw SyntaxError(p("opening","["));Q({type:"text",value:r,output:`\\${r}`});continue}Z("brackets");let e=F.value.slice(1);if(!0===F.posix||"^"!==e[0]||e.includes("/")||(r=`/${r}`),F.value+=r,W({value:r}),!1===h.literalBrackets||s.hasRegexChars(e))continue;let t=s.escapeRegex(F.value);if(B.output=B.output.slice(0,-F.value.length),!0===h.literalBrackets){B.output+=t,F.value=t;continue}F.value=`(${$}${t}|${F.value})`,B.output+=F.value;continue}if("{"===r&&!0!==h.nobrace){V("braces");let e={type:"brace",value:r,output:"(",outputIndex:B.output.length,tokensIndex:B.tokens.length};H.push(e),Q(e);continue}if("}"===r){let e=H[H.length-1];if(!0===h.nobrace||!e){Q({type:"text",value:r,output:r});continue}let t=")";if(!0===e.dots){let e=b.slice(),r=[];for(let t=e.length-1;t>=0&&(b.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&r.unshift(e[t].value);t=c(r,h),B.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){let n=B.output.slice(0,e.outputIndex),s=B.tokens.slice(e.tokensIndex);for(let i of(e.value=e.output="\\{",r=t="\\}",B.output=n,s))B.output+=i.output||i.value}Q({type:"brace",value:r,output:t}),Z("braces"),H.pop();continue}if("|"===r){P.length>0&&P[P.length-1].conditions++,Q({type:"text",value:r});continue}if(","===r){let e=r,t=H[H.length-1];t&&"braces"===D[D.length-1]&&(t.comma=!0,e="|"),Q({type:"comma",value:r,output:e});continue}if("/"===r){if("dot"===F.type&&B.index===B.start+1){B.start=B.index+1,B.consumed="",B.output="",b.pop(),F=m;continue}Q({type:"slash",value:r,output:S});continue}if("."===r){if(B.braces>0&&"dot"===F.type){"."===F.value&&(F.output=A);let e=H[H.length-1];F.type="dots",F.output+=r,F.value+=r,e.dots=!0;continue}if(B.braces+B.parens===0&&"bos"!==F.type&&"slash"!==F.type){Q({type:"text",value:r,output:A});continue}Q({type:"dot",value:r,output:A});continue}if("?"===r){if(!(F&&"("===F.value)&&!0!==h.noextglob&&"("===U()&&"?"!==U(2)){X("qmark",r);continue}if(F&&"paren"===F.type){let e=U(),t=r;("("!==F.value||/[!=<:]/.test(e))&&("<"!==e||/<([!=]|\w+>)/.test(J()))||(t=`\\${r}`),Q({type:"text",value:r,output:t});continue}if(!0!==h.dot&&("slash"===F.type||"bos"===F.type)){Q({type:"qmark",value:r,output:L});continue}Q({type:"qmark",value:r,output:R});continue}if("!"===r){if(!0!==h.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){X("negate",r);continue}if(!0!==h.nonegate&&0===B.index){z();continue}}if("+"===r){if(!0!==h.noextglob&&"("===U()&&"?"!==U(2)){X("plus",r);continue}if(F&&"("===F.value||!1===h.regex){Q({type:"plus",value:r,output:C});continue}if(F&&("bracket"===F.type||"paren"===F.type||"brace"===F.type)||B.parens>0){Q({type:"plus",value:r});continue}Q({type:"plus",value:C});continue}if("@"===r){if(!0!==h.noextglob&&"("===U()&&"?"!==U(2)){Q({type:"at",extglob:!0,value:r,output:""});continue}Q({type:"text",value:r});continue}if("*"!==r){("$"===r||"^"===r)&&(r=`\\${r}`);let e=a.exec(J());e&&(r+=e[0],B.index+=e[0].length),Q({type:"text",value:r});continue}if(F&&("globstar"===F.type||!0===F.star)){F.type="star",F.star=!0,F.value+=r,F.output=M,B.backtrack=!0,B.globstar=!0,K(r);continue}let t=J();if(!0!==h.noextglob&&/^\([^?]/.test(t)){X("star",r);continue}if("star"===F.type){if(!0===h.noglobstar){K(r);continue}let n=F.prev,s=n.prev,i="slash"===n.type||"bos"===n.type,o=s&&("star"===s.type||"globstar"===s.type);if(!0===h.bash&&(!i||t[0]&&"/"!==t[0])){Q({type:"star",value:r,output:""});continue}let a=B.braces>0&&("comma"===n.type||"brace"===n.type),l=P.length&&("pipe"===n.type||"paren"===n.type);if(!i&&"paren"!==n.type&&!a&&!l){Q({type:"star",value:r,output:""});continue}for(;"/**"===t.slice(0,3);){let r=e[B.index+4];if(r&&"/"!==r)break;t=t.slice(3),K("/**",3)}if("bos"===n.type&&G()){F.type="globstar",F.value+=r,F.output=I(h),B.output=F.output,B.globstar=!0,K(r);continue}if("slash"===n.type&&"bos"!==n.prev.type&&!o&&G()){B.output=B.output.slice(0,-(n.output+F.output).length),n.output=`(?:${n.output}`,F.type="globstar",F.output=I(h)+(h.strictSlashes?")":"|$)"),F.value+=r,B.globstar=!0,B.output+=n.output+F.output,K(r);continue}if("slash"===n.type&&"bos"!==n.prev.type&&"/"===t[0]){let e=void 0!==t[1]?"|$":"";B.output=B.output.slice(0,-(n.output+F.output).length),n.output=`(?:${n.output}`,F.type="globstar",F.output=`${I(h)}${S}|${S}${e})`,F.value+=r,B.output+=n.output+F.output,B.globstar=!0,K(r+q()),Q({type:"slash",value:"/",output:""});continue}if("bos"===n.type&&"/"===t[0]){F.type="globstar",F.value+=r,F.output=`(?:^|${S}|${I(h)}${S})`,B.output=F.output,B.globstar=!0,K(r+q()),Q({type:"slash",value:"/",output:""});continue}B.output=B.output.slice(0,-F.output.length),F.type="globstar",F.output=I(h),F.value+=r,B.output+=F.output,B.globstar=!0,K(r);continue}let n={type:"star",value:r,output:M};if(!0===h.bash){n.output=".*?",("bos"===F.type||"slash"===F.type)&&(n.output=j+n.output),Q(n);continue}if(F&&("bracket"===F.type||"paren"===F.type)&&!0===h.regex){n.output=r,Q(n);continue}(B.index===B.start||"slash"===F.type||"dot"===F.type)&&("dot"===F.type?(B.output+=_,F.output+=_):!0===h.dot?(B.output+=k,F.output+=k):(B.output+=j,F.output+=j),"*"!==U()&&(B.output+=v,F.output+=v)),Q(n)}for(;B.brackets>0;){if(!0===h.strictBrackets)throw SyntaxError(p("closing","]"));B.output=s.escapeLast(B.output,"["),Z("brackets")}for(;B.parens>0;){if(!0===h.strictBrackets)throw SyntaxError(p("closing",")"));B.output=s.escapeLast(B.output,"("),Z("parens")}for(;B.braces>0;){if(!0===h.strictBrackets)throw SyntaxError(p("closing","}"));B.output=s.escapeLast(B.output,"{"),Z("braces")}if(!0!==h.strictSlashes&&("star"===F.type||"bracket"===F.type)&&Q({type:"maybe_slash",value:"",output:`${S}?`}),!0===B.backtrack)for(let e of(B.output="",B.tokens))B.output+=null!=e.output?e.output:e.value,e.suffix&&(B.output+=e.suffix);return B};f.fastpaths=(e,t)=>{let r={...t},o="number"==typeof r.maxLength?Math.min(i,r.maxLength):i,a=e.length;if(a>o)throw SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${o}`);e=u[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:c,ONE_CHAR:p,DOTS_SLASH:f,NO_DOT:h,NO_DOTS:d,NO_DOTS_SLASH:g,STAR:m,START_ANCHOR:b}=n.globChars(r.windows),$=r.dot?d:h,y=r.dot?g:h,x=r.capture?"":"?:",A=!0===r.bash?".*?":m;r.capture&&(A=`(${A})`);let C=e=>!0===e.noglobstar?A:`(${x}(?:(?!${b}${e.dot?f:l}).)*?)`,S=e=>{switch(e){case"*":return`${$}${p}${A}`;case".*":return`${l}${p}${A}`;case"*.*":return`${$}${A}${l}${p}${A}`;case"*/*":return`${$}${A}${c}${p}${y}${A}`;case"**":return $+C(r);case"**/*":return`(?:${$}${C(r)}${c})?${y}${p}${A}`;case"**/*.*":return`(?:${$}${C(r)}${c})?${y}${A}${l}${p}${A}`;case"**/.*":return`(?:${$}${C(r)}${c})?${l}${p}${A}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let r=S(t[1]);if(!r)return;return r+l+t[2]}}},v=S(s.removePrefix(e,{negated:!1,prefix:""}));return v&&!0!==r.strictSlashes&&(v+=`${c}?`),v},t.exports=f},53174,(e,t,r)=>{"use strict";let n=e.r(26094),s=e.r(17932),i=e.r(19241),o=e.r(53487),a=(e,t,r=!1)=>{if(Array.isArray(e)){let n=e.map(e=>a(e,t,r));return e=>{for(let t of n){let r=t(e);if(r)return r}return!1}}let n=e&&"object"==typeof e&&!Array.isArray(e)&&e.tokens&&e.input;if(""===e||"string"!=typeof e&&!n)throw TypeError("Expected pattern to be a non-empty string");let s=t||{},i=s.windows,o=n?a.compileRe(e,t):a.makeRe(e,t,!1,!0),l=o.state;delete o.state;let u=()=>!1;if(s.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=a(s.ignore,e,r)}let c=(r,n=!1)=>{let{isMatch:c,match:p,output:f}=a.test(r,o,t,{glob:e,posix:i}),h={glob:e,state:l,regex:o,posix:i,input:r,output:f,match:p,isMatch:c};return("function"==typeof s.onResult&&s.onResult(h),!1===c)?(h.isMatch=!1,!!n&&h):u(r)?("function"==typeof s.onIgnore&&s.onIgnore(h),h.isMatch=!1,!!n&&h):("function"==typeof s.onMatch&&s.onMatch(h),!n||h)};return r&&(c.state=l),c};a.test=(e,t,r,{glob:n,posix:s}={})=>{if("string"!=typeof e)throw TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};let o=r||{},l=o.format||(s?i.toPosixSlashes:null),u=e===n,c=u&&l?l(e):e;return!1===u&&(u=(c=l?l(e):e)===n),(!1===u||!0===o.capture)&&(u=!0===o.matchBase||!0===o.basename?a.matchBase(e,t,r,s):t.exec(c)),{isMatch:!!u,match:u,output:c}},a.matchBase=(e,t,r)=>(t instanceof RegExp?t:a.makeRe(t,r)).test(i.basename(e)),a.isMatch=(e,t,r)=>a(t,r)(e),a.parse=(e,t)=>Array.isArray(e)?e.map(e=>a.parse(e,t)):s(e,{...t,fastpaths:!1}),a.scan=(e,t)=>n(e,t),a.compileRe=(e,t,r=!1,n=!1)=>{if(!0===r)return e.output;let s=t||{},i=s.contains?"":"^",o=s.contains?"":"$",l=`${i}(?:${e.output})${o}`;e&&!0===e.negated&&(l=`^(?!${l}).*$`);let u=a.toRegex(l,t);return!0===n&&(u.state=e),u},a.makeRe=(e,t={},r=!1,n=!1)=>{if(!e||"string"!=typeof e)throw TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return!1!==t.fastpaths&&("."===e[0]||"*"===e[0])&&(i.output=s.fastpaths(e,t)),i.output||(i=s(e,t)),a.compileRe(i,t,r,n)},a.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},a.constants=o,t.exports=a},54970,(e,t,r)=>{"use strict";let n=e.r(53174),s=e.r(19241);function i(e,t,r=!1){return t&&(null===t.windows||void 0===t.windows)&&(t={...t,windows:s.isWindows()}),n(e,t,r)}Object.assign(i,n),t.exports=i},92552,(e,t,r)=>{"use strict";let n,s;function i(e,t){return t.reduce((e,[t,r])=>({type:"BinaryExpression",operator:t,left:e,right:r}),e)}function o(e,t){return{type:"UnaryExpression",operator:e,argument:t}}class a extends SyntaxError{constructor(e,t,r,n){super(e),this.expected=t,this.found=r,this.location=n,this.name="SyntaxError"}format(e){let t="Error: "+this.message;if(this.location){let r=null,n=e.find(e=>e.source===this.location.source);n&&(r=n.text.split(/\r\n|\n|\r/g));let s=this.location.start,i=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(s):s,o=this.location.source+":"+i.line+":"+i.column;if(r){let e=this.location.end,n="".padEnd(i.line.toString().length," "),a=r[s.line-1],l=(s.line===e.line?e.column:a.length+1)-s.column||1;t+="\n --> "+o+"\n"+n+" |\n"+i.line+" | "+a+"\n"+n+" | "+"".padEnd(s.column-1," ")+"".padEnd(l,"^")}else t+="\n at "+o}return t}static buildMessage(e,t){function r(e){return e.codePointAt(0).toString(16).toUpperCase()}let n=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function s(e){return n?e.replace(n,e=>"\\u{"+r(e)+"}"):e}function i(e){return s(e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+r(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+r(e)))}function o(e){return s(e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+r(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+r(e)))}let a={literal:e=>'"'+i(e.text)+'"',class(e){let t=e.parts.map(e=>Array.isArray(e)?o(e[0])+"-"+o(e[1]):o(e));return"["+(e.inverted?"^":"")+t.join("")+"]"+(e.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:e=>e.description};function l(e){return a[e.type](e)}return"Expected "+function(e){let t=e.map(l);if(t.sort(),t.length>0){let e=1;for(let r=1;r ]/,k=/^[+\-]/,R=/^[%*\/]/,L=/^[!\-~]/,N=/^[a-zA-Z_]/,O=/^[a-zA-Z0-9_]/,I=/^[ \t]/,j=/^[^"\\\n\r]/,T=/^[^'\\\n\r]/,M=/^[0-9a-fA-F]/,B=/^[0-9]/,P=/^[xX]/,H=/^[^\n\r]/,D=/^[\n\r]/,F=/^[ \t\n\r]/,G=tE(";",!1),U=tE("package",!1),q=tE("{",!1),J=tE("}",!1),K=tE("function",!1),W=tE("(",!1),z=tE(")",!1),V=tE("::",!1),Z=tE(",",!1),Q=tE("datablock",!1),X=tE(":",!1),Y=tE("new",!1),ee=tE("[",!1),et=tE("]",!1),er=tE("=",!1),en=tE(".",!1),es=tE("if",!1),ei=tE("else",!1),eo=tE("for",!1),ea=tE("while",!1),el=tE("do",!1),eu=tE("switch$",!1),ec=tE("switch",!1),ep=tE("case",!1),ef=tE("default",!1),eh=tE("or",!1),ed=tE("return",!1),eg=tE("break",!1),em=tE("continue",!1),eb=tE("+=",!1),e$=tE("-=",!1),ey=tE("*=",!1),ex=tE("/=",!1),eA=tE("%=",!1),eC=tE("<<=",!1),eS=tE(">>=",!1),ev=tE("&=",!1),ew=tE("|=",!1),eE=tE("^=",!1),e_=tE("?",!1),ek=tE("||",!1),eR=tE("&&",!1),eL=tE("|",!1),eN=tE("^",!1),eO=tE("&",!1),eI=tE("==",!1),ej=tE("!=",!1),eT=tE("<=",!1),eM=tE(">=",!1),eB=t_(["<",">"],!1,!1,!1),eP=tE("$=",!1),eH=tE("!$=",!1),eD=tE("@",!1),eF=tE("NL",!1),eG=tE("TAB",!1),eU=tE("SPC",!1),eq=tE("<<",!1),eJ=tE(">>",!1),eK=t_(["+","-"],!1,!1,!1),eW=t_(["%","*","/"],!1,!1,!1),ez=t_(["!","-","~"],!1,!1,!1),eV=tE("++",!1),eZ=tE("--",!1),eQ=tE("*",!1),eX=tE("%",!1),eY=t_([["a","z"],["A","Z"],"_"],!1,!1,!1),e0=t_([["a","z"],["A","Z"],["0","9"],"_"],!1,!1,!1),e1=tE("$",!1),e2=tE("parent",!1),e4=t_([" "," "],!1,!1,!1),e3=tE('"',!1),e9=tE("'",!1),e5=tE("\\",!1),e6=t_(['"',"\\","\n","\r"],!0,!1,!1),e8=t_(["'","\\","\n","\r"],!0,!1,!1),e7=tE("n",!1),te=tE("r",!1),tt=tE("t",!1),tr=tE("x",!1),tn=t_([["0","9"],["a","f"],["A","F"]],!1,!1,!1),ts=tE("cr",!1),ti=tE("cp",!1),to=tE("co",!1),ta=tE("c",!1),tl=t_([["0","9"]],!1,!1,!1),tu={type:"any"},tc=tE("0",!1),tp=t_(["x","X"],!1,!1,!1),tf=tE("-",!1),th=tE("true",!1),td=tE("false",!1),tg=tE("//",!1),tm=t_(["\n","\r"],!0,!1,!1),tb=t_(["\n","\r"],!1,!1,!1),t$=tE("/*",!1),ty=tE("*/",!1),tx=t_([" "," ","\n","\r"],!1,!1,!1),tA=0|t.peg$currPos,tC=[{line:1,column:1}],tS=tA,tv=t.peg$maxFailExpected||[],tw=0|t.peg$silentFails;if(t.startRule){if(!(t.startRule in c))throw Error("Can't start parsing from rule \""+t.startRule+'".');p=c[t.startRule]}function tE(e,t){return{type:"literal",text:e,ignoreCase:t}}function t_(e,t,r,n){return{type:"class",parts:e,inverted:t,ignoreCase:r,unicode:n}}function tk(t){let r,n=tC[t];if(n)return n;if(t>=tC.length)r=tC.length-1;else for(r=t;!tC[--r];);for(n={line:(n=tC[r]).line,column:n.column};r tS&&(tS=tA,tv=[]),tv.push(e))}function tN(){let e,t,r;for(rp(),e=[],t=tA,(r=rl())===l&&(r=tO()),r!==l?t=r=[r,rp()]:(tA=t,t=l);t!==l;)e.push(t),t=tA,(r=rl())===l&&(r=tO()),r!==l?t=r=[r,rp()]:(tA=t,t=l);return{type:"Program",body:e.map(([e])=>e).filter(Boolean),execScriptPaths:Array.from(n),hasDynamicExec:s}}function tO(){let t,r,n,s,i,o,a,u,c,p,d,y,x,v,w,E,_;return(t=function(){let t,r,n,s,i,o,a,u;if(t=tA,e.substr(tA,7)===f?(r=f,tA+=7):(r=l,0===tw&&tL(U)),r!==l)if(rc()!==l)if((n=rn())!==l)if(ru(),123===e.charCodeAt(tA)?(s="{",tA++):(s=l,0===tw&&tL(q)),s!==l){for(rp(),i=[],o=tA,(a=rl())===l&&(a=tO()),a!==l?o=a=[a,u=rp()]:(tA=o,o=l);o!==l;)i.push(o),o=tA,(a=rl())===l&&(a=tO()),a!==l?o=a=[a,u=rp()]:(tA=o,o=l);(125===e.charCodeAt(tA)?(o="}",tA++):(o=l,0===tw&&tL(J)),o!==l)?(a=ru(),59===e.charCodeAt(tA)?(u=";",tA++):(u=l,0===tw&&tL(G)),u===l&&(u=null),t={type:"PackageDeclaration",name:n,body:i.map(([e])=>e).filter(Boolean)}):(tA=t,t=l)}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a;if(t=tA,e.substr(tA,8)===h?(r=h,tA+=8):(r=l,0===tw&&tL(K)),r!==l)if(rc()!==l)if((n=function(){let t,r,n,s;if(t=tA,(r=rn())!==l)if("::"===e.substr(tA,2)?(n="::",tA+=2):(n=l,0===tw&&tL(V)),n!==l)if((s=rn())!==l)t={type:"MethodName",namespace:r,method:s};else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t===l&&(t=rn()),t}())!==l)if(ru(),40===e.charCodeAt(tA)?(s="(",tA++):(s=l,0===tw&&tL(W)),s!==l)if(ru(),(i=function(){let t,r,n,s,i,o,a,u;if(t=tA,(r=rn())!==l){for(n=[],s=tA,i=ru(),44===e.charCodeAt(tA)?(o=",",tA++):(o=l,0===tw&&tL(Z)),o!==l?(a=ru(),(u=rn())!==l?s=i=[i,o,a,u]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,i=ru(),44===e.charCodeAt(tA)?(o=",",tA++):(o=l,0===tw&&tL(Z)),o!==l?(a=ru(),(u=rn())!==l?s=i=[i,o,a,u]:(tA=s,s=l)):(tA=s,s=l);t=[r,...n.map(([,,,e])=>e)]}else tA=t,t=l;return t}())===l&&(i=null),ru(),41===e.charCodeAt(tA)?(o=")",tA++):(o=l,0===tw&&tL(z)),o!==l)if(ru(),(a=tF())!==l)t={type:"FunctionDeclaration",name:n,params:i||[],body:a};else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&((n=tA,(s=tI())!==l)?(ru(),59===e.charCodeAt(tA)?(i=";",tA++):(i=l,0===tw&&tL(G)),i===l&&(i=null),ru(),n=s):(tA=n,n=l),(t=n)===l&&((o=tA,(a=tj())!==l)?(ru(),59===e.charCodeAt(tA)?(u=";",tA++):(u=l,0===tw&&tL(G)),u===l&&(u=null),ru(),o=a):(tA=o,o=l),(t=o)===l&&(t=function(){let t,r,n,s,i,o,a,u,c,p,f;if(t=tA,"if"===e.substr(tA,2)?(r="if",tA+=2):(r=l,0===tw&&tL(es)),r!==l)if(ru(),40===e.charCodeAt(tA)?(n="(",tA++):(n=l,0===tw&&tL(W)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tA)?(i=")",tA++):(i=l,0===tw&&tL(z)),i!==l)if(ru(),(o=tO())!==l){var h;a=tA,u=ru(),e.substr(tA,4)===g?(c=g,tA+=4):(c=l,0===tw&&tL(ei)),c!==l?(p=ru(),(f=tO())!==l?a=u=[u,c,p,f]:(tA=a,a=l)):(tA=a,a=l),a===l&&(a=null),t={type:"IfStatement",test:s,consequent:o,alternate:(h=a)?h[3]:null}}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a,u,c,p;if(t=tA,"for"===e.substr(tA,3)?(r="for",tA+=3):(r=l,0===tw&&tL(eo)),r!==l)if(ru(),40===e.charCodeAt(tA)?(n="(",tA++):(n=l,0===tw&&tL(W)),n!==l)if(ru(),(s=tG())===l&&(s=null),ru(),59===e.charCodeAt(tA)?(i=";",tA++):(i=l,0===tw&&tL(G)),i!==l)if(ru(),(o=tG())===l&&(o=null),ru(),59===e.charCodeAt(tA)?(a=";",tA++):(a=l,0===tw&&tL(G)),a!==l)if(ru(),(u=tG())===l&&(u=null),ru(),41===e.charCodeAt(tA)?(c=")",tA++):(c=l,0===tw&&tL(z)),c!==l)if(ru(),(p=tO())!==l){var f,h;f=s,h=o,t={type:"ForStatement",init:f,test:h,update:u,body:p}}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a,u;if(t=tA,"do"===e.substr(tA,2)?(r="do",tA+=2):(r=l,0===tw&&tL(el)),r!==l)if(ru(),(n=tO())!==l)if(ru(),e.substr(tA,5)===m?(s=m,tA+=5):(s=l,0===tw&&tL(ea)),s!==l)if(ru(),40===e.charCodeAt(tA)?(i="(",tA++):(i=l,0===tw&&tL(W)),i!==l)if(ru(),(o=tG())!==l)if(ru(),41===e.charCodeAt(tA)?(a=")",tA++):(a=l,0===tw&&tL(z)),a!==l)ru(),59===e.charCodeAt(tA)?(u=";",tA++):(u=l,0===tw&&tL(G)),u===l&&(u=null),t={type:"DoWhileStatement",test:o,body:n};else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o;if(t=tA,e.substr(tA,5)===m?(r=m,tA+=5):(r=l,0===tw&&tL(ea)),r!==l)if(ru(),40===e.charCodeAt(tA)?(n="(",tA++):(n=l,0===tw&&tL(W)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tA)?(i=")",tA++):(i=l,0===tw&&tL(z)),i!==l)if(ru(),(o=tO())!==l)t={type:"WhileStatement",test:s,body:o};else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a,u,c,p;if(t=tA,e.substr(tA,7)===b?(r=b,tA+=7):(r=l,0===tw&&tL(eu)),r!==l)if(ru(),40===e.charCodeAt(tA)?(n="(",tA++):(n=l,0===tw&&tL(W)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tA)?(i=")",tA++):(i=l,0===tw&&tL(z)),i!==l)if(ru(),123===e.charCodeAt(tA)?(o="{",tA++):(o=l,0===tw&&tL(q)),o!==l){for(rp(),a=[],u=tA,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tA=u,u=l);u!==l;)a.push(u),u=tA,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tA=u,u=l);(125===e.charCodeAt(tA)?(u="}",tA++):(u=l,0===tw&&tL(J)),u!==l)?t={type:"SwitchStatement",stringMode:!0,discriminant:s,cases:a.map(([e])=>e).filter(e=>e&&"SwitchCase"===e.type)}:(tA=t,t=l)}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;if(t===l)if(t=tA,e.substr(tA,6)===$?(r=$,tA+=6):(r=l,0===tw&&tL(ec)),r!==l)if(ru(),40===e.charCodeAt(tA)?(n="(",tA++):(n=l,0===tw&&tL(W)),n!==l)if(ru(),(s=tG())!==l)if(ru(),41===e.charCodeAt(tA)?(i=")",tA++):(i=l,0===tw&&tL(z)),i!==l)if(ru(),123===e.charCodeAt(tA)?(o="{",tA++):(o=l,0===tw&&tL(q)),o!==l){for(rp(),a=[],u=tA,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tA=u,u=l);u!==l;)a.push(u),u=tA,(c=rl())===l&&(c=tD()),c!==l?u=c=[c,p=rp()]:(tA=u,u=l);(125===e.charCodeAt(tA)?(u="}",tA++):(u=l,0===tw&&tL(J)),u!==l)?t={type:"SwitchStatement",stringMode:!1,discriminant:s,cases:a.map(([e])=>e).filter(e=>e&&"SwitchCase"===e.type)}:(tA=t,t=l)}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i;if(t=tA,e.substr(tA,6)===A?(r=A,tA+=6):(r=l,0===tw&&tL(ed)),r!==l)if(n=tA,(s=rc())!==l&&(i=tG())!==l?n=s=[s,i]:(tA=n,n=l),n===l&&(n=null),s=ru(),59===e.charCodeAt(tA)?(i=";",tA++):(i=l,0===tw&&tL(G)),i!==l){var o;t={type:"ReturnStatement",value:(o=n)?o[1]:null}}else tA=t,t=l;else tA=t,t=l;return t}())===l&&(c=tA,e.substr(tA,5)===C?(p=C,tA+=5):(p=l,0===tw&&tL(eg)),p!==l?(ru(),59===e.charCodeAt(tA)?(d=";",tA++):(d=l,0===tw&&tL(G)),d!==l?c={type:"BreakStatement"}:(tA=c,c=l)):(tA=c,c=l),(t=c)===l&&(y=tA,e.substr(tA,8)===S?(x=S,tA+=8):(x=l,0===tw&&tL(em)),x!==l?(ru(),59===e.charCodeAt(tA)?(v=";",tA++):(v=l,0===tw&&tL(G)),v!==l?y={type:"ContinueStatement"}:(tA=y,y=l)):(tA=y,y=l),(t=y)===l&&((w=tA,(E=tG())!==l&&(ru(),59===e.charCodeAt(tA)?(_=";",tA++):(_=l,0===tw&&tL(G)),_!==l))?w={type:"ExpressionStatement",expression:E}:(tA=w,w=l),(t=w)===l&&(t=tF())===l&&(t=rl())===l)))))&&(t=tA,ru(),59===e.charCodeAt(tA)?(r=";",tA++):(r=l,0===tw&&tL(G)),r!==l?(ru(),t=null):(tA=t,t=l)),t}function tI(){let t,r,n,s,i,o,a,u,c,p,f,h,g,m;if(t=tA,e.substr(tA,9)===d?(r=d,tA+=9):(r=l,0===tw&&tL(Q)),r!==l)if(rc()!==l)if((n=rn())!==l)if(ru(),40===e.charCodeAt(tA)?(s="(",tA++):(s=l,0===tw&&tL(W)),s!==l)if(ru(),(i=tM())===l&&(i=null),ru(),41===e.charCodeAt(tA)?(o=")",tA++):(o=l,0===tw&&tL(z)),o!==l){var b,$,y;if(ru(),a=tA,58===e.charCodeAt(tA)?(u=":",tA++):(u=l,0===tw&&tL(X)),u!==l?(c=ru(),(p=rn())!==l?a=u=[u,c,p]:(tA=a,a=l)):(tA=a,a=l),a===l&&(a=null),u=ru(),c=tA,123===e.charCodeAt(tA)?(p="{",tA++):(p=l,0===tw&&tL(q)),p!==l){for(f=ru(),h=[],g=tT();g!==l;)h.push(g),g=tT();g=ru(),125===e.charCodeAt(tA)?(m="}",tA++):(m=l,0===tw&&tL(J)),m!==l?c=p=[p,f,h,g,m,ru()]:(tA=c,c=l)}else tA=c,c=l;c===l&&(c=null),b=i,$=a,y=c,t={type:"DatablockDeclaration",className:n,instanceName:b,parent:$?$[2]:null,body:y?y[2].filter(Boolean):[]}}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}function tj(){let t,r,n,s,i,o,a,u,c,p,f,h;if(t=tA,"new"===e.substr(tA,3)?(r="new",tA+=3):(r=l,0===tw&&tL(Y)),r!==l)if(rc()!==l)if((n=function(){let t,r,n,s,i,o,a,u,c,p;if((t=tA,40===e.charCodeAt(tA)?(r="(",tA++):(r=l,0===tw&&tL(W)),r!==l&&(n=ru(),(s=tG())!==l&&(i=ru(),41===e.charCodeAt(tA)?(o=")",tA++):(o=l,0===tw&&tL(z)),o!==l)))?t=s:(tA=t,t=l),t===l)if(t=tA,(r=rn())!==l){var f;for(n=[],s=tA,i=ru(),91===e.charCodeAt(tA)?(o="[",tA++):(o=l,0===tw&&tL(ee)),o!==l?(a=ru(),(u=tH())!==l?(c=ru(),93===e.charCodeAt(tA)?(p="]",tA++):(p=l,0===tw&&tL(et)),p!==l?s=i=[i,o,a,u,c,p]:(tA=s,s=l)):(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,i=ru(),91===e.charCodeAt(tA)?(o="[",tA++):(o=l,0===tw&&tL(ee)),o!==l?(a=ru(),(u=tH())!==l?(c=ru(),93===e.charCodeAt(tA)?(p="]",tA++):(p=l,0===tw&&tL(et)),p!==l?s=i=[i,o,a,u,c,p]:(tA=s,s=l)):(tA=s,s=l)):(tA=s,s=l);f=r,t=n.reduce((e,[,,,t])=>({type:"IndexExpression",object:e,index:t}),f)}else tA=t,t=l;return t}())!==l)if(ru(),40===e.charCodeAt(tA)?(s="(",tA++):(s=l,0===tw&&tL(W)),s!==l)if(ru(),(i=tM())===l&&(i=null),ru(),41===e.charCodeAt(tA)?(o=")",tA++):(o=l,0===tw&&tL(z)),o!==l){var d;if(ru(),a=tA,123===e.charCodeAt(tA)?(u="{",tA++):(u=l,0===tw&&tL(q)),u!==l){for(c=ru(),p=[],f=tT();f!==l;)p.push(f),f=tT();f=ru(),125===e.charCodeAt(tA)?(h="}",tA++):(h=l,0===tw&&tL(J)),h!==l?a=u=[u,c,p,f,h,ru()]:(tA=a,a=l)}else tA=a,a=l;a===l&&(a=null),t={type:"ObjectDeclaration",className:n,instanceName:i,body:(d=a)?d[2].filter(Boolean):[]}}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}function tT(){let t,r,n;return(t=tA,(r=tj())!==l)?(ru(),59===e.charCodeAt(tA)?(n=";",tA++):(n=l,0===tw&&tL(G)),n===l&&(n=null),ru(),t=r):(tA=t,t=l),t===l&&((t=tA,(r=tI())!==l)?(ru(),59===e.charCodeAt(tA)?(n=";",tA++):(n=l,0===tw&&tL(G)),n===l&&(n=null),ru(),t=r):(tA=t,t=l),t===l&&(t=function(){let t,r,n,s,i;if(t=tA,ru(),(r=tB())!==l)if(ru(),61===e.charCodeAt(tA)?(n="=",tA++):(n=l,0===tw&&tL(er)),n!==l)if(ru(),(s=tG())!==l)ru(),59===e.charCodeAt(tA)?(i=";",tA++):(i=l,0===tw&&tL(G)),i===l&&(i=null),ru(),t={type:"Assignment",target:r,value:s};else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t}())===l&&(t=rl())===l&&(t=function(){let t,r;if(t=[],r=e.charAt(tA),F.test(r)?tA++:(r=l,0===tw&&tL(tx)),r!==l)for(;r!==l;)t.push(r),r=e.charAt(tA),F.test(r)?tA++:(r=l,0===tw&&tL(tx));else t=l;return t!==l&&(t=null),t}())),t}function tM(){let e;return(e=tY())===l&&(e=rn())===l&&(e=ra()),e}function tB(){let e,t,r,n;if(e=tA,(t=t8())!==l){for(r=[],n=tP();n!==l;)r.push(n),n=tP();e=r.reduce((e,t)=>"property"===t.type?{type:"MemberExpression",object:e,property:t.value}:{type:"IndexExpression",object:e,index:t.value},t)}else tA=e,e=l;return e}function tP(){let t,r,n,s;return(t=tA,46===e.charCodeAt(tA)?(r=".",tA++):(r=l,0===tw&&tL(en)),r!==l&&(ru(),(n=rn())!==l))?t={type:"property",value:n}:(tA=t,t=l),t===l&&((t=tA,91===e.charCodeAt(tA)?(r="[",tA++):(r=l,0===tw&&tL(ee)),r!==l&&(ru(),(n=tH())!==l&&(ru(),93===e.charCodeAt(tA)?(s="]",tA++):(s=l,0===tw&&tL(et)),s!==l)))?t={type:"index",value:n}:(tA=t,t=l)),t}function tH(){let t,r,n,s,i,o,a,u;if(t=tA,(r=tG())!==l){for(n=[],s=tA,i=ru(),44===e.charCodeAt(tA)?(o=",",tA++):(o=l,0===tw&&tL(Z)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,i=ru(),44===e.charCodeAt(tA)?(o=",",tA++):(o=l,0===tw&&tL(Z)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tA=s,s=l)):(tA=s,s=l);t=n.length>0?[r,...n.map(([,,,e])=>e)]:r}else tA=t,t=l;return t}function tD(){let t,r,n,s,i,o,a,u,c;if(t=tA,e.substr(tA,4)===y?(r=y,tA+=4):(r=l,0===tw&&tL(ep)),r!==l)if(rc()!==l)if((n=function(){let t,r,n,s,i,o,a,u;if(t=tA,(r=t3())!==l){for(n=[],s=tA,i=ru(),"or"===e.substr(tA,2)?(o="or",tA+=2):(o=l,0===tw&&tL(eh)),o!==l&&(a=rc())!==l&&(u=t3())!==l?s=i=[i,o,a,u]:(tA=s,s=l);s!==l;)n.push(s),s=tA,i=ru(),"or"===e.substr(tA,2)?(o="or",tA+=2):(o=l,0===tw&&tL(eh)),o!==l&&(a=rc())!==l&&(u=t3())!==l?s=i=[i,o,a,u]:(tA=s,s=l);t=n.length>0?[r,...n.map(([,,,e])=>e)]:r}else tA=t,t=l;return t}())!==l)if(ru(),58===e.charCodeAt(tA)?(s=":",tA++):(s=l,0===tw&&tL(X)),s!==l){for(i=rp(),o=[],a=tA,(u=rl())===l&&(u=tO()),u!==l?a=u=[u,c=rp()]:(tA=a,a=l);a!==l;)o.push(a),a=tA,(u=rl())===l&&(u=tO()),u!==l?a=u=[u,c=rp()]:(tA=a,a=l);t={type:"SwitchCase",test:n,consequent:o.map(([e])=>e).filter(Boolean)}}else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;if(t===l)if(t=tA,e.substr(tA,7)===x?(r=x,tA+=7):(r=l,0===tw&&tL(ef)),r!==l)if(ru(),58===e.charCodeAt(tA)?(n=":",tA++):(n=l,0===tw&&tL(X)),n!==l){for(rp(),s=[],i=tA,(o=rl())===l&&(o=tO()),o!==l?i=o=[o,a=rp()]:(tA=i,i=l);i!==l;)s.push(i),i=tA,(o=rl())===l&&(o=tO()),o!==l?i=o=[o,a=rp()]:(tA=i,i=l);t={type:"SwitchCase",test:null,consequent:s.map(([e])=>e).filter(Boolean)}}else tA=t,t=l;else tA=t,t=l;return t}function tF(){let t,r,n,s,i,o;if(t=tA,123===e.charCodeAt(tA)?(r="{",tA++):(r=l,0===tw&&tL(q)),r!==l){for(rp(),n=[],s=tA,(i=rl())===l&&(i=tO()),i!==l?s=i=[i,o=rp()]:(tA=s,s=l);s!==l;)n.push(s),s=tA,(i=rl())===l&&(i=tO()),i!==l?s=i=[i,o=rp()]:(tA=s,s=l);(125===e.charCodeAt(tA)?(s="}",tA++):(s=l,0===tw&&tL(J)),s!==l)?t={type:"BlockStatement",body:n.map(([e])=>e).filter(Boolean)}:(tA=t,t=l)}else tA=t,t=l;return t}function tG(){let t,r,n,s;if(t=tA,(r=tB())!==l)if(ru(),(n=tU())!==l)if(ru(),(s=tG())!==l)t={type:"AssignmentExpression",operator:n,target:r,value:s};else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t===l&&(t=function(){let t,r,n,s,i,o;if(t=tA,(r=tq())!==l)if(ru(),63===e.charCodeAt(tA)?(n="?",tA++):(n=l,0===tw&&tL(e_)),n!==l)if(ru(),(s=tG())!==l)if(ru(),58===e.charCodeAt(tA)?(i=":",tA++):(i=l,0===tw&&tL(X)),i!==l)if(ru(),(o=tG())!==l)t={type:"ConditionalExpression",test:r,consequent:s,alternate:o};else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;else tA=t,t=l;return t===l&&(t=tq()),t}()),t}function tU(){let t;return 61===e.charCodeAt(tA)?(t="=",tA++):(t=l,0===tw&&tL(er)),t===l&&("+="===e.substr(tA,2)?(t="+=",tA+=2):(t=l,0===tw&&tL(eb)),t===l&&("-="===e.substr(tA,2)?(t="-=",tA+=2):(t=l,0===tw&&tL(e$)),t===l&&("*="===e.substr(tA,2)?(t="*=",tA+=2):(t=l,0===tw&&tL(ey)),t===l&&("/="===e.substr(tA,2)?(t="/=",tA+=2):(t=l,0===tw&&tL(ex)),t===l&&("%="===e.substr(tA,2)?(t="%=",tA+=2):(t=l,0===tw&&tL(eA)),t===l&&("<<="===e.substr(tA,3)?(t="<<=",tA+=3):(t=l,0===tw&&tL(eC)),t===l&&(">>="===e.substr(tA,3)?(t=">>=",tA+=3):(t=l,0===tw&&tL(eS)),t===l&&("&="===e.substr(tA,2)?(t="&=",tA+=2):(t=l,0===tw&&tL(ev)),t===l&&("|="===e.substr(tA,2)?(t="|=",tA+=2):(t=l,0===tw&&tL(ew)),t===l&&("^="===e.substr(tA,2)?(t="^=",tA+=2):(t=l,0===tw&&tL(eE)))))))))))),t}function tq(){let t,r,n,s,o,a,u,c;if(t=tA,(r=tJ())!==l){for(n=[],s=tA,o=ru(),"||"===e.substr(tA,2)?(a="||",tA+=2):(a=l,0===tw&&tL(ek)),a!==l?(u=ru(),(c=tJ())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,o=ru(),"||"===e.substr(tA,2)?(a="||",tA+=2):(a=l,0===tw&&tL(ek)),a!==l?(u=ru(),(c=tJ())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tA=t,t=l;return t}function tJ(){let t,r,n,s,o,a,u,c;if(t=tA,(r=tK())!==l){for(n=[],s=tA,o=ru(),"&&"===e.substr(tA,2)?(a="&&",tA+=2):(a=l,0===tw&&tL(eR)),a!==l?(u=ru(),(c=tK())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,o=ru(),"&&"===e.substr(tA,2)?(a="&&",tA+=2):(a=l,0===tw&&tL(eR)),a!==l?(u=ru(),(c=tK())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tA=t,t=l;return t}function tK(){let t,r,n,s,o,a,u,c,p;if(t=tA,(r=tW())!==l){for(n=[],s=tA,o=ru(),124===e.charCodeAt(tA)?(a="|",tA++):(a=l,0===tw&&tL(eL)),a!==l?(u=tA,tw++,124===e.charCodeAt(tA)?(c="|",tA++):(c=l,0===tw&&tL(eL)),tw--,c===l?u=void 0:(tA=u,u=l),u!==l?(c=ru(),(p=tW())!==l?s=o=[o,a,u,c,p]:(tA=s,s=l)):(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,o=ru(),124===e.charCodeAt(tA)?(a="|",tA++):(a=l,0===tw&&tL(eL)),a!==l?(u=tA,tw++,124===e.charCodeAt(tA)?(c="|",tA++):(c=l,0===tw&&tL(eL)),tw--,c===l?u=void 0:(tA=u,u=l),u!==l?(c=ru(),(p=tW())!==l?s=o=[o,a,u,c,p]:(tA=s,s=l)):(tA=s,s=l)):(tA=s,s=l);t=i(r,n.map(([,e,,,t])=>[e,t]))}else tA=t,t=l;return t}function tW(){let t,r,n,s,o,a,u,c;if(t=tA,(r=tz())!==l){for(n=[],s=tA,o=ru(),94===e.charCodeAt(tA)?(a="^",tA++):(a=l,0===tw&&tL(eN)),a!==l?(u=ru(),(c=tz())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,o=ru(),94===e.charCodeAt(tA)?(a="^",tA++):(a=l,0===tw&&tL(eN)),a!==l?(u=ru(),(c=tz())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tA=t,t=l;return t}function tz(){let t,r,n,s,o,a,u,c,p;if(t=tA,(r=tV())!==l){for(n=[],s=tA,o=ru(),38===e.charCodeAt(tA)?(a="&",tA++):(a=l,0===tw&&tL(eO)),a!==l?(u=tA,tw++,38===e.charCodeAt(tA)?(c="&",tA++):(c=l,0===tw&&tL(eO)),tw--,c===l?u=void 0:(tA=u,u=l),u!==l?(c=ru(),(p=tV())!==l?s=o=[o,a,u,c,p]:(tA=s,s=l)):(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,o=ru(),38===e.charCodeAt(tA)?(a="&",tA++):(a=l,0===tw&&tL(eO)),a!==l?(u=tA,tw++,38===e.charCodeAt(tA)?(c="&",tA++):(c=l,0===tw&&tL(eO)),tw--,c===l?u=void 0:(tA=u,u=l),u!==l?(c=ru(),(p=tV())!==l?s=o=[o,a,u,c,p]:(tA=s,s=l)):(tA=s,s=l)):(tA=s,s=l);t=i(r,n.map(([,e,,,t])=>[e,t]))}else tA=t,t=l;return t}function tV(){let e,t,r,n,s,o,a,u;if(e=tA,(t=tQ())!==l){for(r=[],n=tA,s=ru(),(o=tZ())!==l?(a=ru(),(u=tQ())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);n!==l;)r.push(n),n=tA,s=ru(),(o=tZ())!==l?(a=ru(),(u=tQ())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tA=e,e=l;return e}function tZ(){let t;return"=="===e.substr(tA,2)?(t="==",tA+=2):(t=l,0===tw&&tL(eI)),t===l&&("!="===e.substr(tA,2)?(t="!=",tA+=2):(t=l,0===tw&&tL(ej))),t}function tQ(){let e,t,r,n,s,o,a,u;if(e=tA,(t=tY())!==l){for(r=[],n=tA,s=ru(),(o=tX())!==l?(a=ru(),(u=tY())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);n!==l;)r.push(n),n=tA,s=ru(),(o=tX())!==l?(a=ru(),(u=tY())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tA=e,e=l;return e}function tX(){let t;return"<="===e.substr(tA,2)?(t="<=",tA+=2):(t=l,0===tw&&tL(eT)),t===l&&(">="===e.substr(tA,2)?(t=">=",tA+=2):(t=l,0===tw&&tL(eM)),t===l&&(t=e.charAt(tA),_.test(t)?tA++:(t=l,0===tw&&tL(eB)))),t}function tY(){let e,t,r,n,s,o,a,u;if(e=tA,(t=t2())!==l){for(r=[],n=tA,s=ru(),(o=t1())!==l?(a=ru(),(u=t0())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);n!==l;)r.push(n),n=tA,s=ru(),(o=t1())!==l?(a=ru(),(u=t0())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tA=e,e=l;return e}function t0(){let e,t,r,n;if(e=tA,(t=tB())!==l)if(ru(),(r=tU())!==l)if(ru(),(n=tG())!==l)e={type:"AssignmentExpression",operator:r,target:t,value:n};else tA=e,e=l;else tA=e,e=l;else tA=e,e=l;return e===l&&(e=t2()),e}function t1(){let t;return"$="===e.substr(tA,2)?(t="$=",tA+=2):(t=l,0===tw&&tL(eP)),t===l&&("!$="===e.substr(tA,3)?(t="!$=",tA+=3):(t=l,0===tw&&tL(eH)),t===l&&(64===e.charCodeAt(tA)?(t="@",tA++):(t=l,0===tw&&tL(eD)),t===l&&("NL"===e.substr(tA,2)?(t="NL",tA+=2):(t=l,0===tw&&tL(eF)),t===l&&("TAB"===e.substr(tA,3)?(t="TAB",tA+=3):(t=l,0===tw&&tL(eG)),t===l&&("SPC"===e.substr(tA,3)?(t="SPC",tA+=3):(t=l,0===tw&&tL(eU))))))),t}function t2(){let e,t,r,n,s,o,a,u;if(e=tA,(t=t3())!==l){for(r=[],n=tA,s=ru(),(o=t4())!==l?(a=ru(),(u=t3())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);n!==l;)r.push(n),n=tA,s=ru(),(o=t4())!==l?(a=ru(),(u=t3())!==l?n=s=[s,o,a,u]:(tA=n,n=l)):(tA=n,n=l);e=i(t,r.map(([,e,,t])=>[e,t]))}else tA=e,e=l;return e}function t4(){let t;return"<<"===e.substr(tA,2)?(t="<<",tA+=2):(t=l,0===tw&&tL(eq)),t===l&&(">>"===e.substr(tA,2)?(t=">>",tA+=2):(t=l,0===tw&&tL(eJ))),t}function t3(){let t,r,n,s,o,a,u,c;if(t=tA,(r=t9())!==l){for(n=[],s=tA,o=ru(),a=e.charAt(tA),k.test(a)?tA++:(a=l,0===tw&&tL(eK)),a!==l?(u=ru(),(c=t9())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,o=ru(),a=e.charAt(tA),k.test(a)?tA++:(a=l,0===tw&&tL(eK)),a!==l?(u=ru(),(c=t9())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tA=t,t=l;return t}function t9(){let t,r,n,s,o,a,u,c;if(t=tA,(r=t5())!==l){for(n=[],s=tA,o=ru(),a=e.charAt(tA),R.test(a)?tA++:(a=l,0===tw&&tL(eW)),a!==l?(u=ru(),(c=t5())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,o=ru(),a=e.charAt(tA),R.test(a)?tA++:(a=l,0===tw&&tL(eW)),a!==l?(u=ru(),(c=t5())!==l?s=o=[o,a,u,c]:(tA=s,s=l)):(tA=s,s=l);t=i(r,n.map(([,e,,t])=>[e,t]))}else tA=t,t=l;return t}function t5(){let t,r,n;return(t=tA,r=e.charAt(tA),L.test(r)?tA++:(r=l,0===tw&&tL(ez)),r!==l&&(ru(),(n=t6())!==l))?t=o(r,n):(tA=t,t=l),t===l&&((t=tA,"++"===e.substr(tA,2)?(r="++",tA+=2):(r=l,0===tw&&tL(eV)),r===l&&("--"===e.substr(tA,2)?(r="--",tA+=2):(r=l,0===tw&&tL(eZ))),r!==l&&(ru(),(n=t6())!==l))?t=o(r,n):(tA=t,t=l),t===l&&((t=tA,42===e.charCodeAt(tA)?(r="*",tA++):(r=l,0===tw&&tL(eQ)),r!==l&&(ru(),(n=t6())!==l))?t={type:"TagDereferenceExpression",argument:n}:(tA=t,t=l),t===l&&(t=function(){let t,r,n;if(t=tA,(r=t8())!==l)if(ru(),"++"===e.substr(tA,2)?(n="++",tA+=2):(n=l,0===tw&&tL(eV)),n===l&&("--"===e.substr(tA,2)?(n="--",tA+=2):(n=l,0===tw&&tL(eZ))),n!==l)t={type:"PostfixExpression",operator:n,argument:r};else tA=t,t=l;else tA=t,t=l;return t===l&&(t=t8()),t}()))),t}function t6(){let e,t,r,n;if(e=tA,(t=tB())!==l)if(ru(),(r=tU())!==l)if(ru(),(n=tG())!==l)e={type:"AssignmentExpression",operator:r,target:t,value:n};else tA=e,e=l;else tA=e,e=l;else tA=e,e=l;return e===l&&(e=t5()),e}function t8(){let t,r,i,o,a,u,c,p,f,h;if(t=tA,(r=function(){let t,r,n,s,i,o,a,u,c,p,f,h,d,g,m,b;if(t=tA,(a=tj())===l&&(a=tI())===l&&(a=function(){let t,r,n,s;if(t=tA,34===e.charCodeAt(tA)?(r='"',tA++):(r=l,0===tw&&tL(e3)),r!==l){for(n=[],s=rs();s!==l;)n.push(s),s=rs();(34===e.charCodeAt(tA)?(s='"',tA++):(s=l,0===tw&&tL(e3)),s!==l)?t={type:"StringLiteral",value:n.join("")}:(tA=t,t=l)}else tA=t,t=l;if(t===l)if(t=tA,39===e.charCodeAt(tA)?(r="'",tA++):(r=l,0===tw&&tL(e9)),r!==l){for(n=[],s=ri();s!==l;)n.push(s),s=ri();(39===e.charCodeAt(tA)?(s="'",tA++):(s=l,0===tw&&tL(e9)),s!==l)?t={type:"StringLiteral",value:n.join(""),tagged:!0}:(tA=t,t=l)}else tA=t,t=l;return t}())===l&&(a=ra())===l&&((u=tA,e.substr(tA,4)===w?(c=w,tA+=4):(c=l,0===tw&&tL(th)),c===l&&(e.substr(tA,5)===E?(c=E,tA+=5):(c=l,0===tw&&tL(td))),c!==l&&(p=tA,tw++,f=rh(),tw--,f===l?p=void 0:(tA=p,p=l),p!==l))?u={type:"BooleanLiteral",value:"true"===c}:(tA=u,u=l),(a=u)===l&&((h=re())===l&&(h=rt())===l&&(h=rr()),(a=h)===l))&&((d=tA,40===e.charCodeAt(tA)?(g="(",tA++):(g=l,0===tw&&tL(W)),g!==l&&(ru(),(m=tG())!==l&&(ru(),41===e.charCodeAt(tA)?(b=")",tA++):(b=l,0===tw&&tL(z)),b!==l)))?d=m:(tA=d,d=l),a=d),(r=a)!==l){for(n=[],s=tA,i=ru(),(o=tP())!==l?s=i=[i,o]:(tA=s,s=l);s!==l;)n.push(s),s=tA,i=ru(),(o=tP())!==l?s=i=[i,o]:(tA=s,s=l);t=n.reduce((e,[,t])=>"property"===t.type?{type:"MemberExpression",object:e,property:t.value}:{type:"IndexExpression",object:e,index:t.value},r)}else tA=t,t=l;return t}())!==l){for(i=[],o=tA,a=ru(),40===e.charCodeAt(tA)?(u="(",tA++):(u=l,0===tw&&tL(W)),u!==l?(c=ru(),(p=t7())===l&&(p=null),f=ru(),41===e.charCodeAt(tA)?(h=")",tA++):(h=l,0===tw&&tL(z)),h!==l?o=a=[a,u,c,p,f,h]:(tA=o,o=l)):(tA=o,o=l),o===l&&(o=tA,a=ru(),(u=tP())!==l?o=a=[a,u]:(tA=o,o=l));o!==l;)i.push(o),o=tA,a=ru(),40===e.charCodeAt(tA)?(u="(",tA++):(u=l,0===tw&&tL(W)),u!==l?(c=ru(),(p=t7())===l&&(p=null),f=ru(),41===e.charCodeAt(tA)?(h=")",tA++):(h=l,0===tw&&tL(z)),h!==l?o=a=[a,u,c,p,f,h]:(tA=o,o=l)):(tA=o,o=l),o===l&&(o=tA,a=ru(),(u=tP())!==l?o=a=[a,u]:(tA=o,o=l));t=i.reduce((e,t)=>{if("("===t[1]){var r;let[,,,i]=t;return r=i||[],"Identifier"===e.type&&"exec"===e.name.toLowerCase()&&(r.length>0&&"StringLiteral"===r[0].type?n.add(r[0].value):s=!0),{type:"CallExpression",callee:e,arguments:r}}let i=t[1];return"property"===i.type?{type:"MemberExpression",object:e,property:i.value}:{type:"IndexExpression",object:e,index:i.value}},r)}else tA=t,t=l;return t}function t7(){let t,r,n,s,i,o,a,u;if(t=tA,(r=tG())!==l){for(n=[],s=tA,i=ru(),44===e.charCodeAt(tA)?(o=",",tA++):(o=l,0===tw&&tL(Z)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,i=ru(),44===e.charCodeAt(tA)?(o=",",tA++):(o=l,0===tw&&tL(Z)),o!==l?(a=ru(),(u=tG())!==l?s=i=[i,o,a,u]:(tA=s,s=l)):(tA=s,s=l);t=[r,...n.map(([,,,e])=>e)]}else tA=t,t=l;return t}function re(){let t,r,n,s,i,o,a;if(t=tA,37===e.charCodeAt(tA)?(r="%",tA++):(r=l,0===tw&&tL(eX)),r!==l){if(n=tA,s=tA,i=e.charAt(tA),N.test(i)?tA++:(i=l,0===tw&&tL(eY)),i!==l){for(o=[],a=e.charAt(tA),O.test(a)?tA++:(a=l,0===tw&&tL(e0));a!==l;)o.push(a),a=e.charAt(tA),O.test(a)?tA++:(a=l,0===tw&&tL(e0));s=i=[i,o]}else tA=s,s=l;(n=s!==l?e.substring(n,tA):s)!==l?t={type:"Variable",scope:"local",name:n}:(tA=t,t=l)}else tA=t,t=l;return t}function rt(){let t,r,n,s,i,o,a,u,c,p,f,h,d;if(t=tA,36===e.charCodeAt(tA)?(r="$",tA++):(r=l,0===tw&&tL(e1)),r!==l){if(n=tA,s=tA,"::"===e.substr(tA,2)?(i="::",tA+=2):(i=l,0===tw&&tL(V)),i===l&&(i=null),o=e.charAt(tA),N.test(o)?tA++:(o=l,0===tw&&tL(eY)),o!==l){for(a=[],u=e.charAt(tA),O.test(u)?tA++:(u=l,0===tw&&tL(e0));u!==l;)a.push(u),u=e.charAt(tA),O.test(u)?tA++:(u=l,0===tw&&tL(e0));if(u=[],c=tA,"::"===e.substr(tA,2)?(p="::",tA+=2):(p=l,0===tw&&tL(V)),p!==l)if(f=e.charAt(tA),N.test(f)?tA++:(f=l,0===tw&&tL(eY)),f!==l){for(h=[],d=e.charAt(tA),O.test(d)?tA++:(d=l,0===tw&&tL(e0));d!==l;)h.push(d),d=e.charAt(tA),O.test(d)?tA++:(d=l,0===tw&&tL(e0));c=p=[p,f,h]}else tA=c,c=l;else tA=c,c=l;for(;c!==l;)if(u.push(c),c=tA,"::"===e.substr(tA,2)?(p="::",tA+=2):(p=l,0===tw&&tL(V)),p!==l)if(f=e.charAt(tA),N.test(f)?tA++:(f=l,0===tw&&tL(eY)),f!==l){for(h=[],d=e.charAt(tA),O.test(d)?tA++:(d=l,0===tw&&tL(e0));d!==l;)h.push(d),d=e.charAt(tA),O.test(d)?tA++:(d=l,0===tw&&tL(e0));c=p=[p,f,h]}else tA=c,c=l;else tA=c,c=l;s=i=[i,o,a,u]}else tA=s,s=l;(n=s!==l?e.substring(n,tA):s)!==l?t={type:"Variable",scope:"global",name:n}:(tA=t,t=l)}else tA=t,t=l;return t}function rr(){let t,r,n,s,i,o,a,u,c,p,f;if(t=tA,r=tA,n=tA,e.substr(tA,6)===v?(s=v,tA+=6):(s=l,0===tw&&tL(e2)),s!==l){for(i=[],o=e.charAt(tA),I.test(o)?tA++:(o=l,0===tw&&tL(e4));o!==l;)i.push(o),o=e.charAt(tA),I.test(o)?tA++:(o=l,0===tw&&tL(e4));if("::"===e.substr(tA,2)?(o="::",tA+=2):(o=l,0===tw&&tL(V)),o!==l){for(a=[],u=e.charAt(tA),I.test(u)?tA++:(u=l,0===tw&&tL(e4));u!==l;)a.push(u),u=e.charAt(tA),I.test(u)?tA++:(u=l,0===tw&&tL(e4));if(u=e.charAt(tA),N.test(u)?tA++:(u=l,0===tw&&tL(eY)),u!==l){for(c=[],p=e.charAt(tA),O.test(p)?tA++:(p=l,0===tw&&tL(e0));p!==l;)c.push(p),p=e.charAt(tA),O.test(p)?tA++:(p=l,0===tw&&tL(e0));n=s=[s,i,o,a,u,c]}else tA=n,n=l}else tA=n,n=l}else tA=n,n=l;if((r=n!==l?e.substring(r,tA):n)!==l&&(r={type:"Identifier",name:r.replace(/\s+/g,"")}),(t=r)===l){if(t=tA,r=tA,n=tA,e.substr(tA,6)===v?(s=v,tA+=6):(s=l,0===tw&&tL(e2)),s!==l){if(i=[],o=tA,"::"===e.substr(tA,2)?(a="::",tA+=2):(a=l,0===tw&&tL(V)),a!==l)if(u=e.charAt(tA),N.test(u)?tA++:(u=l,0===tw&&tL(eY)),u!==l){for(c=[],p=e.charAt(tA),O.test(p)?tA++:(p=l,0===tw&&tL(e0));p!==l;)c.push(p),p=e.charAt(tA),O.test(p)?tA++:(p=l,0===tw&&tL(e0));o=a=[a,u,c]}else tA=o,o=l;else tA=o,o=l;if(o!==l)for(;o!==l;)if(i.push(o),o=tA,"::"===e.substr(tA,2)?(a="::",tA+=2):(a=l,0===tw&&tL(V)),a!==l)if(u=e.charAt(tA),N.test(u)?tA++:(u=l,0===tw&&tL(eY)),u!==l){for(c=[],p=e.charAt(tA),O.test(p)?tA++:(p=l,0===tw&&tL(e0));p!==l;)c.push(p),p=e.charAt(tA),O.test(p)?tA++:(p=l,0===tw&&tL(e0));o=a=[a,u,c]}else tA=o,o=l;else tA=o,o=l;else i=l;i!==l?n=s=[s,i]:(tA=n,n=l)}else tA=n,n=l;if((r=n!==l?e.substring(r,tA):n)!==l&&(r={type:"Identifier",name:r}),(t=r)===l){if(t=tA,r=tA,n=tA,s=e.charAt(tA),N.test(s)?tA++:(s=l,0===tw&&tL(eY)),s!==l){for(i=[],o=e.charAt(tA),O.test(o)?tA++:(o=l,0===tw&&tL(e0));o!==l;)i.push(o),o=e.charAt(tA),O.test(o)?tA++:(o=l,0===tw&&tL(e0));if(o=[],a=tA,"::"===e.substr(tA,2)?(u="::",tA+=2):(u=l,0===tw&&tL(V)),u!==l)if(c=e.charAt(tA),N.test(c)?tA++:(c=l,0===tw&&tL(eY)),c!==l){for(p=[],f=e.charAt(tA),O.test(f)?tA++:(f=l,0===tw&&tL(e0));f!==l;)p.push(f),f=e.charAt(tA),O.test(f)?tA++:(f=l,0===tw&&tL(e0));a=u=[u,c,p]}else tA=a,a=l;else tA=a,a=l;for(;a!==l;)if(o.push(a),a=tA,"::"===e.substr(tA,2)?(u="::",tA+=2):(u=l,0===tw&&tL(V)),u!==l)if(c=e.charAt(tA),N.test(c)?tA++:(c=l,0===tw&&tL(eY)),c!==l){for(p=[],f=e.charAt(tA),O.test(f)?tA++:(f=l,0===tw&&tL(e0));f!==l;)p.push(f),f=e.charAt(tA),O.test(f)?tA++:(f=l,0===tw&&tL(e0));a=u=[u,c,p]}else tA=a,a=l;else tA=a,a=l;n=s=[s,i,o]}else tA=n,n=l;(r=n!==l?e.substring(r,tA):n)!==l&&(r={type:"Identifier",name:r}),t=r}}return t}function rn(){let e;return(e=re())===l&&(e=rt())===l&&(e=rr()),e}function rs(){let t,r,n;return(t=tA,92===e.charCodeAt(tA)?(r="\\",tA++):(r=l,0===tw&&tL(e5)),r!==l&&(n=ro())!==l)?t=n:(tA=t,t=l),t===l&&(t=e.charAt(tA),j.test(t)?tA++:(t=l,0===tw&&tL(e6))),t}function ri(){let t,r,n;return(t=tA,92===e.charCodeAt(tA)?(r="\\",tA++):(r=l,0===tw&&tL(e5)),r!==l&&(n=ro())!==l)?t=n:(tA=t,t=l),t===l&&(t=e.charAt(tA),T.test(t)?tA++:(t=l,0===tw&&tL(e8))),t}function ro(){let t,r,n,s,i,o;return t=tA,110===e.charCodeAt(tA)?(r="n",tA++):(r=l,0===tw&&tL(e7)),r!==l&&(r="\n"),(t=r)===l&&(t=tA,114===e.charCodeAt(tA)?(r="r",tA++):(r=l,0===tw&&tL(te)),r!==l&&(r="\r"),(t=r)===l)&&(t=tA,116===e.charCodeAt(tA)?(r="t",tA++):(r=l,0===tw&&tL(tt)),r!==l&&(r=" "),(t=r)===l)&&((t=tA,120===e.charCodeAt(tA)?(r="x",tA++):(r=l,0===tw&&tL(tr)),r!==l&&(n=tA,s=tA,i=e.charAt(tA),M.test(i)?tA++:(i=l,0===tw&&tL(tn)),i!==l?(o=e.charAt(tA),M.test(o)?tA++:(o=l,0===tw&&tL(tn)),o!==l?s=i=[i,o]:(tA=s,s=l)):(tA=s,s=l),(n=s!==l?e.substring(n,tA):s)!==l))?t=String.fromCharCode(parseInt(n,16)):(tA=t,t=l),t===l&&(t=tA,"cr"===e.substr(tA,2)?(r="cr",tA+=2):(r=l,0===tw&&tL(ts)),r!==l&&(r="\x0f"),(t=r)===l&&(t=tA,"cp"===e.substr(tA,2)?(r="cp",tA+=2):(r=l,0===tw&&tL(ti)),r!==l&&(r="\x10"),(t=r)===l))&&(t=tA,"co"===e.substr(tA,2)?(r="co",tA+=2):(r=l,0===tw&&tL(to)),r!==l&&(r="\x11"),(t=r)===l)&&((t=tA,99===e.charCodeAt(tA)?(r="c",tA++):(r=l,0===tw&&tL(ta)),r!==l&&(n=e.charAt(tA),B.test(n)?tA++:(n=l,0===tw&&tL(tl)),n!==l))?t=String.fromCharCode([2,3,4,5,6,7,8,11,12,14][parseInt(n,10)]):(tA=t,t=l),t===l&&(t=tA,e.length>tA?(r=e.charAt(tA),tA++):(r=l,0===tw&&tL(tu)),t=r))),t}function ra(){let t,r,n,s,i,o,a,u,c;if(t=tA,r=tA,n=tA,48===e.charCodeAt(tA)?(s="0",tA++):(s=l,0===tw&&tL(tc)),s!==l)if(i=e.charAt(tA),P.test(i)?tA++:(i=l,0===tw&&tL(tp)),i!==l){if(o=[],a=e.charAt(tA),M.test(a)?tA++:(a=l,0===tw&&tL(tn)),a!==l)for(;a!==l;)o.push(a),a=e.charAt(tA),M.test(a)?tA++:(a=l,0===tw&&tL(tn));else o=l;o!==l?n=s=[s,i,o]:(tA=n,n=l)}else tA=n,n=l;else tA=n,n=l;if((r=n!==l?e.substring(r,tA):n)!==l&&(n=tA,tw++,s=rh(),tw--,s===l?n=void 0:(tA=n,n=l),n!==l)?t={type:"NumberLiteral",value:parseInt(r,16)}:(tA=t,t=l),t===l){if(t=tA,r=tA,n=tA,45===e.charCodeAt(tA)?(s="-",tA++):(s=l,0===tw&&tL(tf)),s===l&&(s=null),i=[],o=e.charAt(tA),B.test(o)?tA++:(o=l,0===tw&&tL(tl)),o!==l)for(;o!==l;)i.push(o),o=e.charAt(tA),B.test(o)?tA++:(o=l,0===tw&&tL(tl));else i=l;if(i!==l){if(o=tA,46===e.charCodeAt(tA)?(a=".",tA++):(a=l,0===tw&&tL(en)),a!==l){if(u=[],c=e.charAt(tA),B.test(c)?tA++:(c=l,0===tw&&tL(tl)),c!==l)for(;c!==l;)u.push(c),c=e.charAt(tA),B.test(c)?tA++:(c=l,0===tw&&tL(tl));else u=l;u!==l?o=a=[a,u]:(tA=o,o=l)}else tA=o,o=l;o===l&&(o=null),n=s=[s,i,o]}else tA=n,n=l;if(n===l)if(n=tA,45===e.charCodeAt(tA)?(s="-",tA++):(s=l,0===tw&&tL(tf)),s===l&&(s=null),46===e.charCodeAt(tA)?(i=".",tA++):(i=l,0===tw&&tL(en)),i!==l){if(o=[],a=e.charAt(tA),B.test(a)?tA++:(a=l,0===tw&&tL(tl)),a!==l)for(;a!==l;)o.push(a),a=e.charAt(tA),B.test(a)?tA++:(a=l,0===tw&&tL(tl));else o=l;o!==l?n=s=[s,i,o]:(tA=n,n=l)}else tA=n,n=l;(r=n!==l?e.substring(r,tA):n)!==l&&(n=tA,tw++,s=rh(),tw--,s===l?n=void 0:(tA=n,n=l),n!==l)?t={type:"NumberLiteral",value:parseFloat(r)}:(tA=t,t=l)}return t}function rl(){let t;return(t=function(){let t,r,n,s,i;if(t=tA,"//"===e.substr(tA,2)?(r="//",tA+=2):(r=l,0===tw&&tL(tg)),r!==l){for(n=tA,s=[],i=e.charAt(tA),H.test(i)?tA++:(i=l,0===tw&&tL(tm));i!==l;)s.push(i),i=e.charAt(tA),H.test(i)?tA++:(i=l,0===tw&&tL(tm));n=e.substring(n,tA),s=e.charAt(tA),D.test(s)?tA++:(s=l,0===tw&&tL(tb)),s===l&&(s=null),t={type:"Comment",value:n}}else tA=t,t=l;return t}())===l&&(t=function(){let t,r,n,s,i,o,a;if(t=tA,"/*"===e.substr(tA,2)?(r="/*",tA+=2):(r=l,0===tw&&tL(t$)),r!==l){for(n=tA,s=[],i=tA,o=tA,tw++,"*/"===e.substr(tA,2)?(a="*/",tA+=2):(a=l,0===tw&&tL(ty)),tw--,a===l?o=void 0:(tA=o,o=l),o!==l?(e.length>tA?(a=e.charAt(tA),tA++):(a=l,0===tw&&tL(tu)),a!==l?i=o=[o,a]:(tA=i,i=l)):(tA=i,i=l);i!==l;)s.push(i),i=tA,o=tA,tw++,"*/"===e.substr(tA,2)?(a="*/",tA+=2):(a=l,0===tw&&tL(ty)),tw--,a===l?o=void 0:(tA=o,o=l),o!==l?(e.length>tA?(a=e.charAt(tA),tA++):(a=l,0===tw&&tL(tu)),a!==l?i=o=[o,a]:(tA=i,i=l)):(tA=i,i=l);(n=e.substring(n,tA),"*/"===e.substr(tA,2)?(s="*/",tA+=2):(s=l,0===tw&&tL(ty)),s!==l)?t={type:"Comment",value:n}:(tA=t,t=l)}else tA=t,t=l;return t}()),t}function ru(){let t,r;for(t=[],r=e.charAt(tA),F.test(r)?tA++:(r=l,0===tw&&tL(tx)),r===l&&(r=rf());r!==l;)t.push(r),r=e.charAt(tA),F.test(r)?tA++:(r=l,0===tw&&tL(tx)),r===l&&(r=rf());return t}function rc(){let t,r,n,s;if(t=tA,r=[],n=e.charAt(tA),F.test(n)?tA++:(n=l,0===tw&&tL(tx)),n!==l)for(;n!==l;)r.push(n),n=e.charAt(tA),F.test(n)?tA++:(n=l,0===tw&&tL(tx));else r=l;if(r!==l){for(n=[],s=e.charAt(tA),F.test(s)?tA++:(s=l,0===tw&&tL(tx)),s===l&&(s=rf());s!==l;)n.push(s),s=e.charAt(tA),F.test(s)?tA++:(s=l,0===tw&&tL(tx)),s===l&&(s=rf());t=r=[r,n]}else tA=t,t=l;return t}function rp(){let t,r;for(t=[],r=e.charAt(tA),F.test(r)?tA++:(r=l,0===tw&&tL(tx));r!==l;)t.push(r),r=e.charAt(tA),F.test(r)?tA++:(r=l,0===tw&&tL(tx));return t}function rf(){let t,r,n,s,i,o;if(t=tA,"//"===e.substr(tA,2)?(r="//",tA+=2):(r=l,0===tw&&tL(tg)),r!==l){for(n=[],s=e.charAt(tA),H.test(s)?tA++:(s=l,0===tw&&tL(tm));s!==l;)n.push(s),s=e.charAt(tA),H.test(s)?tA++:(s=l,0===tw&&tL(tm));s=e.charAt(tA),D.test(s)?tA++:(s=l,0===tw&&tL(tb)),s===l&&(s=null),t=r=[r,n,s]}else tA=t,t=l;if(t===l)if(t=tA,"/*"===e.substr(tA,2)?(r="/*",tA+=2):(r=l,0===tw&&tL(t$)),r!==l){for(n=[],s=tA,i=tA,tw++,"*/"===e.substr(tA,2)?(o="*/",tA+=2):(o=l,0===tw&&tL(ty)),tw--,o===l?i=void 0:(tA=i,i=l),i!==l?(e.length>tA?(o=e.charAt(tA),tA++):(o=l,0===tw&&tL(tu)),o!==l?s=i=[i,o]:(tA=s,s=l)):(tA=s,s=l);s!==l;)n.push(s),s=tA,i=tA,tw++,"*/"===e.substr(tA,2)?(o="*/",tA+=2):(o=l,0===tw&&tL(ty)),tw--,o===l?i=void 0:(tA=i,i=l),i!==l?(e.length>tA?(o=e.charAt(tA),tA++):(o=l,0===tw&&tL(tu)),o!==l?s=i=[i,o]:(tA=s,s=l)):(tA=s,s=l);"*/"===e.substr(tA,2)?(s="*/",tA+=2):(s=l,0===tw&&tL(ty)),s!==l?t=r=[r,n,s]:(tA=t,t=l)}else tA=t,t=l;return t}function rh(){let t;return t=e.charAt(tA),O.test(t)?tA++:(t=l,0===tw&&tL(e0)),t}n=new Set,s=!1;let rd=(r=p())!==l&&tA===e.length;function rg(){var t,n,s;throw r!==l&&tA {"use strict";function t(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}let r=e.i(87447).default;function n(e){return t(e).toLowerCase()}function s(){return r.resources}function i(e){let[t,...n]=r.resources[e],[s,i]=n[n.length-1];return[s,i??t]}function o(e){let t=n(e);if(r.resources[t])return t;let s=t.replace(/\d+(\.(png))$/i,"$1");if(r.resources[s])return s;throw Error(`Resource not found in manifest: ${e}`)}function a(){return Object.keys(r.resources)}let l=["",".jpg",".png",".gif",".bmp"];function u(e){let t=n(e);for(let e of l){let n=`${t}${e}`;if(r.resources[n])return n}return t}function c(e){let t=r.missions[e];if(!t)throw Error(`Mission not found: ${e}`);return t}function p(){return Object.keys(r.missions)}e.s(["getActualResourceKey",()=>o,"getMissionInfo",()=>c,"getMissionList",()=>p,"getResourceKey",()=>n,"getResourceList",()=>a,"getResourceMap",()=>s,"getSourceAndPath",()=>i,"getStandardTextureResourceKey",()=>u],91996),e.s(["parse",()=>q,"runServer",()=>W],86608);var f=e.i(92552);function h(e){let t=e.indexOf("::");return -1===t?null:{namespace:e.slice(0,t),method:e.slice(t+2)}}let d={"+":"$.add","-":"$.sub","*":"$.mul","/":"$.div","<":"$.lt","<=":"$.le",">":"$.gt",">=":"$.ge","==":"$.eq","!=":"$.ne","%":"$.mod","&":"$.bitand","|":"$.bitor","^":"$.bitxor","<<":"$.shl",">>":"$.shr"};class g{indent;runtime;functions;globals;locals;indentLevel=0;currentClass=null;currentFunction=null;constructor(e={}){this.indent=e.indent??" ",this.runtime=e.runtime??"$",this.functions=e.functions??"$f",this.globals=e.globals??"$g",this.locals=e.locals??"$l"}getAccessInfo(e){if("Variable"===e.type){let t=JSON.stringify(e.name),r="global"===e.scope?this.globals:this.locals;return{getter:`${r}.get(${t})`,setter:e=>`${r}.set(${t}, ${e})`,postIncHelper:`${r}.postInc(${t})`,postDecHelper:`${r}.postDec(${t})`}}if("MemberExpression"===e.type){let t=this.expression(e.object),r="Identifier"===e.property.type?JSON.stringify(e.property.name):this.expression(e.property);return{getter:`${this.runtime}.prop(${t}, ${r})`,setter:e=>`${this.runtime}.setProp(${t}, ${r}, ${e})`,postIncHelper:`${this.runtime}.propPostInc(${t}, ${r})`,postDecHelper:`${this.runtime}.propPostDec(${t}, ${r})`}}if("IndexExpression"===e.type){let t=Array.isArray(e.index)?e.index.map(e=>this.expression(e)):[this.expression(e.index)];if("Variable"===e.object.type){let r=JSON.stringify(e.object.name),n="global"===e.object.scope?this.globals:this.locals,s=t.join(", ");return{getter:`${n}.get(${r}, ${s})`,setter:e=>`${n}.set(${r}, ${s}, ${e})`,postIncHelper:`${n}.postInc(${r}, ${s})`,postDecHelper:`${n}.postDec(${r}, ${s})`}}if("MemberExpression"===e.object.type){let r=e.object,n=this.expression(r.object),s="Identifier"===r.property.type?JSON.stringify(r.property.name):this.expression(r.property),i=`${this.runtime}.key(${s}, ${t.join(", ")})`;return{getter:`${this.runtime}.prop(${n}, ${i})`,setter:e=>`${this.runtime}.setProp(${n}, ${i}, ${e})`,postIncHelper:`${this.runtime}.propPostInc(${n}, ${i})`,postDecHelper:`${this.runtime}.propPostDec(${n}, ${i})`}}let r=this.expression(e.object),n=1===t.length?t[0]:`${this.runtime}.key(${t.join(", ")})`;return{getter:`${this.runtime}.getIndex(${r}, ${n})`,setter:e=>`${this.runtime}.setIndex(${r}, ${n}, ${e})`,postIncHelper:`${this.runtime}.indexPostInc(${r}, ${n})`,postDecHelper:`${this.runtime}.indexPostDec(${r}, ${n})`}}return null}generate(e){let t=[];for(let r of e.body){let e=this.statement(r);e&&t.push(e)}return t.join("\n\n")}statement(e){switch(e.type){case"Comment":return"";case"ExpressionStatement":return this.line(`${this.expression(e.expression)};`);case"FunctionDeclaration":return this.functionDeclaration(e);case"PackageDeclaration":return this.packageDeclaration(e);case"DatablockDeclaration":return this.datablockDeclaration(e);case"ObjectDeclaration":return this.line(`${this.objectDeclaration(e)};`);case"IfStatement":return this.ifStatement(e);case"ForStatement":return this.forStatement(e);case"WhileStatement":return this.whileStatement(e);case"DoWhileStatement":return this.doWhileStatement(e);case"SwitchStatement":return this.switchStatement(e);case"ReturnStatement":return this.returnStatement(e);case"BreakStatement":return this.line("break;");case"ContinueStatement":return this.line("continue;");case"BlockStatement":return this.blockStatement(e);default:throw Error(`Unknown statement type: ${e.type}`)}}functionDeclaration(e){let t=h(e.name.name);if(t){let r=t.namespace,n=t.method;this.currentClass=r.toLowerCase(),this.currentFunction=n.toLowerCase();let s=this.functionBody(e.body,e.params);return this.currentClass=null,this.currentFunction=null,`${this.line(`${this.runtime}.registerMethod(${JSON.stringify(r)}, ${JSON.stringify(n)}, function() {`)} -${s} -${this.line("});")}`}{let t=e.name.name;this.currentFunction=t.toLowerCase();let r=this.functionBody(e.body,e.params);return this.currentFunction=null,`${this.line(`${this.runtime}.registerFunction(${JSON.stringify(t)}, function() {`)} -${r} -${this.line("});")}`}}functionBody(e,t){this.indentLevel++;let r=[];r.push(this.line(`const ${this.locals} = ${this.runtime}.locals();`));for(let e=0;e this.statement(e)).join("\n\n");return this.indentLevel--,`${this.line(`${this.runtime}.package(${t}, function() {`)} -${r} -${this.line("});")}`}datablockDeclaration(e){let t=JSON.stringify(e.className.name),r=e.instanceName?JSON.stringify(e.instanceName.name):"null",n=e.parent?JSON.stringify(e.parent.name):"null",s=this.objectBody(e.body);return this.line(`${this.runtime}.datablock(${t}, ${r}, ${n}, ${s});`)}objectDeclaration(e){let t="Identifier"===e.className.type?JSON.stringify(e.className.name):this.expression(e.className),r=null===e.instanceName?"null":"Identifier"===e.instanceName.type?JSON.stringify(e.instanceName.name):this.expression(e.instanceName),n=[],s=[];for(let t of e.body)"Assignment"===t.type?n.push(t):s.push(t);let i=this.objectBody(n);if(s.length>0){let e=s.map(e=>this.objectDeclaration(e)).join(",\n");return`${this.runtime}.create(${t}, ${r}, ${i}, [ -${e} -])`}return`${this.runtime}.create(${t}, ${r}, ${i})`}objectBody(e){if(0===e.length)return"{}";let t=[];for(let r of e)if("Assignment"===r.type){let e=this.expression(r.value);if("Identifier"===r.target.type){let n=r.target.name;/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)?t.push(`${n}: ${e}`):t.push(`[${JSON.stringify(n)}]: ${e}`)}else if("IndexExpression"===r.target.type){let n=this.objectPropertyKey(r.target);t.push(`[${n}]: ${e}`)}else{let n=this.expression(r.target);t.push(`[${n}]: ${e}`)}}if(t.length<=1)return`{ ${t.join(", ")} }`;let r=this.indent.repeat(this.indentLevel+1),n=this.indent.repeat(this.indentLevel);return`{ -${r}${t.join(",\n"+r)} -${n}}`}objectPropertyKey(e){let t="Identifier"===e.object.type?JSON.stringify(e.object.name):this.expression(e.object),r=Array.isArray(e.index)?e.index.map(e=>this.expression(e)).join(", "):this.expression(e.index);return`${this.runtime}.key(${t}, ${r})`}ifStatement(e){let t=this.expression(e.test),r=this.statementAsBlock(e.consequent);if(e.alternate)if("IfStatement"===e.alternate.type){let n=this.ifStatement(e.alternate).replace(/^\s*/,"");return this.line(`if (${t}) ${r} else ${n}`)}else{let n=this.statementAsBlock(e.alternate);return this.line(`if (${t}) ${r} else ${n}`)}return this.line(`if (${t}) ${r}`)}forStatement(e){let t=e.init?this.expression(e.init):"",r=e.test?this.expression(e.test):"",n=e.update?this.expression(e.update):"",s=this.statementAsBlock(e.body);return this.line(`for (${t}; ${r}; ${n}) ${s}`)}whileStatement(e){let t=this.expression(e.test),r=this.statementAsBlock(e.body);return this.line(`while (${t}) ${r}`)}doWhileStatement(e){let t=this.statementAsBlock(e.body),r=this.expression(e.test);return this.line(`do ${t} while (${r});`)}switchStatement(e){if(e.stringMode)return this.switchStringStatement(e);let t=this.expression(e.discriminant);this.indentLevel++;let r=[];for(let t of e.cases)r.push(this.switchCase(t));return this.indentLevel--,`${this.line(`switch (${t}) {`)} -${r.join("\n")} -${this.line("}")}`}switchCase(e){let t=[];if(null===e.test)t.push(this.line("default:"));else if(Array.isArray(e.test))for(let r of e.test)t.push(this.line(`case ${this.expression(r)}:`));else t.push(this.line(`case ${this.expression(e.test)}:`));for(let r of(this.indentLevel++,e.consequent))t.push(this.statement(r));return t.push(this.line("break;")),this.indentLevel--,t.join("\n")}switchStringStatement(e){let t=this.expression(e.discriminant),r=[];for(let t of e.cases)if(null===t.test)r.push(`default: () => { ${this.blockContent(t.consequent)} }`);else if(Array.isArray(t.test))for(let e of t.test)r.push(`${this.expression(e)}: () => { ${this.blockContent(t.consequent)} }`);else r.push(`${this.expression(t.test)}: () => { ${this.blockContent(t.consequent)} }`);return this.line(`${this.runtime}.switchStr(${t}, { ${r.join(", ")} });`)}returnStatement(e){return e.value?this.line(`return ${this.expression(e.value)};`):this.line("return;")}blockStatement(e){this.indentLevel++;let t=e.body.map(e=>this.statement(e)).join("\n");return this.indentLevel--,`{ -${t} -${this.line("}")}`}statementAsBlock(e){if("BlockStatement"===e.type)return this.blockStatement(e);this.indentLevel++;let t=this.statement(e);return this.indentLevel--,`{ -${t} -${this.line("}")}`}blockContent(e){return e.map(e=>this.statement(e).trim()).join(" ")}expression(e){switch(e.type){case"Identifier":return this.identifier(e);case"Variable":return this.variable(e);case"NumberLiteral":case"BooleanLiteral":return String(e.value);case"StringLiteral":return JSON.stringify(e.value);case"BinaryExpression":return this.binaryExpression(e);case"UnaryExpression":return this.unaryExpression(e);case"PostfixExpression":return this.postfixExpression(e);case"AssignmentExpression":return this.assignmentExpression(e);case"ConditionalExpression":return`(${this.expression(e.test)} ? ${this.expression(e.consequent)} : ${this.expression(e.alternate)})`;case"CallExpression":return this.callExpression(e);case"MemberExpression":return this.memberExpression(e);case"IndexExpression":return this.indexExpression(e);case"TagDereferenceExpression":return`${this.runtime}.deref(${this.expression(e.argument)})`;case"ObjectDeclaration":return this.objectDeclaration(e);case"DatablockDeclaration":return`${this.runtime}.datablock(${JSON.stringify(e.className.name)}, ${e.instanceName?JSON.stringify(e.instanceName.name):"null"}, ${e.parent?JSON.stringify(e.parent.name):"null"}, ${this.objectBody(e.body)})`;default:throw Error(`Unknown expression type: ${e.type}`)}}identifier(e){let t=h(e.name);return t&&"parent"===t.namespace.toLowerCase()?e.name:t?`${this.runtime}.nsRef(${JSON.stringify(t.namespace)}, ${JSON.stringify(t.method)})`:JSON.stringify(e.name)}variable(e){return"global"===e.scope?`${this.globals}.get(${JSON.stringify(e.name)})`:`${this.locals}.get(${JSON.stringify(e.name)})`}binaryExpression(e){let t=this.expression(e.left),r=this.expression(e.right),n=e.operator,s=this.concatExpression(t,n,r);if(s)return s;if("$="===n)return`${this.runtime}.streq(${t}, ${r})`;if("!$="===n)return`!${this.runtime}.streq(${t}, ${r})`;if("&&"===n||"||"===n)return`(${t} ${n} ${r})`;let i=d[n];return i?`${i}(${t}, ${r})`:`(${t} ${n} ${r})`}unaryExpression(e){if("++"===e.operator||"--"===e.operator){let t=this.getAccessInfo(e.argument);if(t){let r="++"===e.operator?1:-1;return t.setter(`${this.runtime}.add(${t.getter}, ${r})`)}}let t=this.expression(e.argument);return"~"===e.operator?`${this.runtime}.bitnot(${t})`:"-"===e.operator?`${this.runtime}.neg(${t})`:`${e.operator}${t}`}postfixExpression(e){let t=this.getAccessInfo(e.argument);if(t){let r="++"===e.operator?t.postIncHelper:t.postDecHelper;if(r)return r}return`${this.expression(e.argument)}${e.operator}`}assignmentExpression(e){let t=this.expression(e.value),r=e.operator,n=this.getAccessInfo(e.target);if(!n)throw Error(`Unhandled assignment target type: ${e.target.type}`);if("="===r)return n.setter(t);{let e=r.slice(0,-1),s=this.compoundAssignmentValue(n.getter,e,t);return n.setter(s)}}callExpression(e){let t=e.arguments.map(e=>this.expression(e)).join(", ");if("Identifier"===e.callee.type){let r=e.callee.name,n=h(r);if(n&&"parent"===n.namespace.toLowerCase())if(this.currentClass)return`${this.runtime}.parent(${JSON.stringify(this.currentClass)}, ${JSON.stringify(n.method)}, arguments[0]${t?", "+t:""})`;else if(this.currentFunction)return`${this.runtime}.parentFunc(${JSON.stringify(this.currentFunction)}${t?", "+t:""})`;else throw Error("Parent:: call outside of function context");return n?`${this.runtime}.nsCall(${JSON.stringify(n.namespace)}, ${JSON.stringify(n.method)}${t?", "+t:""})`:`${this.functions}.call(${JSON.stringify(r)}${t?", "+t:""})`}if("MemberExpression"===e.callee.type){let r=this.expression(e.callee.object),n="Identifier"===e.callee.property.type?JSON.stringify(e.callee.property.name):this.expression(e.callee.property);return`${this.runtime}.call(${r}, ${n}${t?", "+t:""})`}let r=this.expression(e.callee);return`${r}(${t})`}memberExpression(e){let t=this.expression(e.object);return e.computed||"Identifier"!==e.property.type?`${this.runtime}.prop(${t}, ${this.expression(e.property)})`:`${this.runtime}.prop(${t}, ${JSON.stringify(e.property.name)})`}indexExpression(e){let t=Array.isArray(e.index)?e.index.map(e=>this.expression(e)):[this.expression(e.index)];if("Variable"===e.object.type){let r=JSON.stringify(e.object.name),n="global"===e.object.scope?this.globals:this.locals;return`${n}.get(${r}, ${t.join(", ")})`}if("MemberExpression"===e.object.type){let r=e.object,n=this.expression(r.object),s="Identifier"===r.property.type?JSON.stringify(r.property.name):this.expression(r.property),i=`${this.runtime}.key(${s}, ${t.join(", ")})`;return`${this.runtime}.prop(${n}, ${i})`}let r=this.expression(e.object);return 1===t.length?`${this.runtime}.getIndex(${r}, ${t[0]})`:`${this.runtime}.getIndex(${r}, ${this.runtime}.key(${t.join(", ")}))`}line(e){return this.indent.repeat(this.indentLevel)+e}concatExpression(e,t,r){switch(t){case"@":return`${this.runtime}.concat(${e}, ${r})`;case"SPC":return`${this.runtime}.concat(${e}, " ", ${r})`;case"TAB":return`${this.runtime}.concat(${e}, "\\t", ${r})`;case"NL":return`${this.runtime}.concat(${e}, "\\n", ${r})`;default:return null}}compoundAssignmentValue(e,t,r){let n=this.concatExpression(e,t,r);if(n)return n;let s=d[t];return s?`${s}(${e}, ${r})`:`(${e} ${t} ${r})`}}e.s(["createRuntime",()=>G,"createScriptCache",()=>P],33870);var m=e.i(54970);class b{map=new Map;keyLookup=new Map;constructor(e){if(e)for(const[t,r]of e)this.set(t,r)}get size(){return this.map.size}get(e){let t=this.keyLookup.get(e.toLowerCase());return void 0!==t?this.map.get(t):void 0}set(e,t){let r=e.toLowerCase(),n=this.keyLookup.get(r);return void 0!==n?this.map.set(n,t):(this.keyLookup.set(r,e),this.map.set(e,t)),this}has(e){return this.keyLookup.has(e.toLowerCase())}delete(e){let t=e.toLowerCase(),r=this.keyLookup.get(t);return void 0!==r&&(this.keyLookup.delete(t),this.map.delete(r))}clear(){this.map.clear(),this.keyLookup.clear()}keys(){return this.map.keys()}values(){return this.map.values()}entries(){return this.map.entries()}[Symbol.iterator](){return this.map[Symbol.iterator]()}forEach(e){for(let[t,r]of this.map)e(r,t,this)}get[Symbol.toStringTag](){return"CaseInsensitiveMap"}getOriginalKey(e){return this.keyLookup.get(e.toLowerCase())}}class ${set=new Set;constructor(e){if(e)for(const t of e)this.add(t)}get size(){return this.set.size}add(e){return this.set.add(e.toLowerCase()),this}has(e){return this.set.has(e.toLowerCase())}delete(e){return this.set.delete(e.toLowerCase())}clear(){this.set.clear()}[Symbol.iterator](){return this.set[Symbol.iterator]()}get[Symbol.toStringTag](){return"CaseInsensitiveSet"}}function y(e){return e.replace(/\\/g,"/").toLowerCase()}function x(e){return String(e??"")}function A(e){return Number(e)||0}function C(e){let t=x(e||"0 0 0").split(" ").map(Number);return[t[0]||0,t[1]||0,t[2]||0]}function S(e,t,r){let n=0;for(;t+n 0;){if(n>=e.length)return"";let s=S(e,n,r);if(n+s>=e.length)return"";n+=s+1,t--}let s=S(e,n,r);return 0===s?"":e.substring(n,n+s)}function w(e,t,r,n){let s=0,i=t;for(;i>0;){if(s>=e.length)return"";let t=S(e,s,n);if(s+t>=e.length)return"";s+=t+1,i--}let o=s,a=r-t+1;for(;a>0;){let t=S(e,s,n);if((s+=t)>=e.length)break;s++,a--}let l=s;return l>o&&n.includes(e[l-1])&&l--,e.substring(o,l)}function E(e,t){if(""===e)return 0;let r=0;for(let n=0;n t&&o>=e.length)break}return i.join(s)}function k(e,t,r,n){let s=[],i=0,o=0;for(;i t().$f.call(x(e),...r),eval(e){throw Error("eval() not implemented: requires runtime parsing and execution")},collapseescape:e=>x(e).replace(/\\([ntr\\])/g,(e,t)=>"n"===t?"\n":"t"===t?" ":"r"===t?"\r":"\\"),expandescape:e=>x(e).replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r"),export(e,t,r){console.warn(`export(${e}): not implemented`)},quit(){console.warn("quit(): not implemented in browser")},trace(e){},isobject:e=>t().$.isObject(e),nametoid:e=>t().$.nameToId(e),strlen:e=>x(e).length,strchr(e,t){let r=x(e),n=x(t)[0]??"",s=r.indexOf(n);return s>=0?r.substring(s):""},strpos:(e,t,r)=>x(e).indexOf(x(t),A(r)),strcmp(e,t){let r=x(e),n=x(t);return r n)},stricmp(e,t){let r=x(e).toLowerCase(),n=x(t).toLowerCase();return r n)},strstr:(e,t)=>x(e).indexOf(x(t)),getsubstr(e,t,r){let n=x(e),s=A(t);return void 0===r?n.substring(s):n.substring(s,s+A(r))},getword:(e,t)=>v(x(e),A(t)," \n"),getwordcount:e=>E(x(e)," \n"),getfield:(e,t)=>v(x(e),A(t)," \n"),getfieldcount:e=>E(x(e)," \n"),setword:(e,t,r)=>_(x(e),A(t),x(r)," \n"," "),setfield:(e,t,r)=>_(x(e),A(t),x(r)," \n"," "),firstword:e=>v(x(e),0," \n"),restwords:e=>w(x(e),1,1e6," \n"),trim:e=>x(e).trim(),ltrim:e=>x(e).replace(/^\s+/,""),rtrim:e=>x(e).replace(/\s+$/,""),strupr:e=>x(e).toUpperCase(),strlwr:e=>x(e).toLowerCase(),strreplace:(e,t,r)=>x(e).split(x(t)).join(x(r)),filterstring:(e,t)=>x(e),stripchars(e,t){let r=x(e),n=new Set(x(t).split(""));return r.split("").filter(e=>!n.has(e)).join("")},getfields(e,t,r){let n=void 0!==r?Number(r):1e6;return w(x(e),A(t),n," \n")},getwords(e,t,r){let n=void 0!==r?Number(r):1e6;return w(x(e),A(t),n," \n")},removeword:(e,t)=>k(x(e),A(t)," \n"," "),removefield:(e,t)=>k(x(e),A(t)," \n"," "),getrecord:(e,t)=>v(x(e),A(t),"\n"),getrecordcount:e=>E(x(e),"\n"),setrecord:(e,t,r)=>_(x(e),A(t),x(r),"\n","\n"),removerecord:(e,t)=>k(x(e),A(t),"\n","\n"),nexttoken(e,t,r){throw Error("nextToken() is not implemented: it requires variable mutation")},strtoplayername:e=>x(e).replace(/[^\w\s-]/g,"").trim(),mabs:e=>Math.abs(A(e)),mfloor:e=>Math.floor(A(e)),mceil:e=>Math.ceil(A(e)),msqrt:e=>Math.sqrt(A(e)),mpow:(e,t)=>Math.pow(A(e),A(t)),msin:e=>Math.sin(A(e)),mcos:e=>Math.cos(A(e)),mtan:e=>Math.tan(A(e)),masin:e=>Math.asin(A(e)),macos:e=>Math.acos(A(e)),matan:(e,t)=>Math.atan2(A(e),A(t)),mlog:e=>Math.log(A(e)),getrandom(e,t){if(void 0===e)return Math.random();if(void 0===t)return Math.floor(Math.random()*(A(e)+1));let r=A(e);return Math.floor(Math.random()*(A(t)-r+1))+r},mdegtorad:e=>A(e)*(Math.PI/180),mradtodeg:e=>A(e)*(180/Math.PI),mfloatlength:(e,t)=>A(e).toFixed(A(t)),getboxcenter(e){let t=x(e).split(" ").map(Number),r=t[0]||0,n=t[1]||0,s=t[2]||0,i=t[3]||0,o=t[4]||0,a=t[5]||0;return`${(r+i)/2} ${(n+o)/2} ${(s+a)/2}`},vectoradd(e,t){let[r,n,s]=C(e),[i,o,a]=C(t);return`${r+i} ${n+o} ${s+a}`},vectorsub(e,t){let[r,n,s]=C(e),[i,o,a]=C(t);return`${r-i} ${n-o} ${s-a}`},vectorscale(e,t){let[r,n,s]=C(e),i=A(t);return`${r*i} ${n*i} ${s*i}`},vectordot(e,t){let[r,n,s]=C(e),[i,o,a]=C(t);return r*i+n*o+s*a},vectorcross(e,t){let[r,n,s]=C(e),[i,o,a]=C(t);return`${n*a-s*o} ${s*i-r*a} ${r*o-n*i}`},vectorlen(e){let[t,r,n]=C(e);return Math.sqrt(t*t+r*r+n*n)},vectornormalize(e){let[t,r,n]=C(e),s=Math.sqrt(t*t+r*r+n*n);return 0===s?"0 0 0":`${t/s} ${r/s} ${n/s}`},vectordist(e,t){let[r,n,s]=C(e),[i,o,a]=C(t),l=r-i,u=n-o,c=s-a;return Math.sqrt(l*l+u*u+c*c)},matrixcreate(e,t){throw Error("MatrixCreate() not implemented: requires axis-angle rotation math")},matrixcreatefromeuler(e){throw Error("MatrixCreateFromEuler() not implemented: requires Euler→Quaternion→AxisAngle conversion")},matrixmultiply(e,t){throw Error("MatrixMultiply() not implemented: requires full 4x4 matrix multiplication")},matrixmulpoint(e,t){throw Error("MatrixMulPoint() not implemented: requires full transform application")},matrixmulvector(e,t){throw Error("MatrixMulVector() not implemented: requires rotation matrix application")},getsimtime:()=>Date.now()-t().state.startTime,getrealtime:()=>Date.now(),schedule(e,r,n,...s){let i=Number(e)||0,o=t(),a=setTimeout(()=>{o.state.pendingTimeouts.delete(a);try{o.$f.call(String(n),...s)}catch(e){throw console.error(`schedule: error calling ${n}:`,e),e}},i);return o.state.pendingTimeouts.add(a),a},cancel(e){clearTimeout(e),t().state.pendingTimeouts.delete(e)},iseventpending:e=>t().state.pendingTimeouts.has(e),exec(e){let r=String(e??"");if(console.debug(`exec(${JSON.stringify(r)}): preparing to execute…`),!r.includes("."))return console.error(`exec: invalid script file name ${JSON.stringify(r)}.`),!1;let n=y(r),s=t(),{executedScripts:i,scripts:o}=s.state;if(i.has(n))return console.debug(`exec(${JSON.stringify(r)}): skipping (already executed)`),!0;let a=o.get(n);return null==a?(console.warn(`exec(${JSON.stringify(r)}): script not found`),!1):(i.add(n),console.debug(`exec(${JSON.stringify(r)}): executing!`),s.executeAST(a),!0)},compile(e){throw Error("compile() not implemented: requires DSO bytecode compiler")},isdemo:()=>!1,isfile:e=>r?r.isFile(x(e)):(console.warn("isFile(): no fileSystem handler configured"),!1),fileext(e){let t=x(e),r=t.lastIndexOf(".");return r>=0?t.substring(r):""},filebase(e){let t=x(e),r=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\")),n=t.lastIndexOf("."),s=r>=0?r+1:0,i=n>s?n:t.length;return t.substring(s,i)},filepath(e){let t=x(e),r=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return r>=0?t.substring(0,r):""},expandfilename(e){throw Error("expandFilename() not implemented: requires filesystem path expansion")},findfirstfile:e=>r?(i=x(e),n=r.findFiles(i),s=0,n[s++]??""):(console.warn("findFirstFile(): no fileSystem handler configured"),""),findnextfile(e){let t=x(e);if(t!==i){if(!r)return"";i=t,n=r.findFiles(t)}return n[s++]??""},getfilecrc:e=>x(e),iswriteablefilename:e=>!1,activatepackage(e){t().$.activatePackage(x(e))},deactivatepackage(e){t().$.deactivatePackage(x(e))},ispackage:e=>t().$.isPackage(x(e)),isactivepackage:e=>t().$.isActivePackage(x(e)),getpackagelist:()=>t().$.getPackageList(),addmessagecallback(e,t){},alxcreatesource:(...e)=>0,alxgetwavelen:e=>0,alxlistenerf(e,t){},alxplay:(...e)=>0,alxsetchannelvolume(e,t){},alxsourcef(e,t,r){},alxstop(e){},alxstopall(){},activatedirectinput(){},activatekeyboard(){},deactivatedirectinput(){},deactivatekeyboard(){},disablejoystick(){},enablejoystick(){},enablewinconsole(e){},isjoystickdetected:()=>!1,lockmouse(e){},addmaterialmapping(e,t){},flushtexturecache(){},getdesktopresolution:()=>"1920 1080 32",getdisplaydevicelist:()=>"OpenGL",getresolutionlist:e=>"640 480 800 600 1024 768 1280 720 1920 1080",getvideodriverinfo:()=>"WebGL",isdevicefullscreenonly:e=>!1,isfullscreen:()=>!1,screenshot(e){},setdisplaydevice:e=>!0,setfov(e){},setinteriorrendermode(e){},setopenglanisotropy(e){},setopenglmipreduction(e){},setopenglskymipreduction(e){},setopengltexturecompressionhint(e){},setscreenmode(e,t,r,n){},setverticalsync(e){},setzoomspeed(e){},togglefullscreen(){},videosetgammacorrection(e){},snaptoggle(){},addtaggedstring:e=>0,buildtaggedstring:(e,...t)=>"",detag:e=>x(e),gettag:e=>0,gettaggedstring:e=>"",removetaggedstring(e){},commandtoclient(e,t){},commandtoserver(e){},cancelserverquery(){},querymasterserver(){},querysingleserver(){},setnetport:e=>!0,allowconnections(e){},startheartbeat(){},stopheartbeat(){},gotowebpage(e){},deletedatablocks(){},preloaddatablock:e=>!0,containerboxempty:(...e)=>!0,containerraycast:(...e)=>"",containersearchcurrdist:()=>0,containersearchnext:()=>0,initcontainerradiussearch(){},calcexplosioncoverage:(...e)=>1,getcontrolobjectaltitude:()=>0,getcontrolobjectspeed:()=>0,getterrainheight:e=>0,lightscene(){},pathonmissionloaddone(){}}}function L(e){return e.toLowerCase()}function N(e){let t=e.trim();return L(t.startsWith("$")?t.slice(1):t)}function O(e,t){let r=e.get(t);return r||(r=new Set,e.set(t,r)),r}function I(e,t){for(let r of t)e.add(L(r))}function j(e,t,r){if(e.anyClassValues.has("*")||e.anyClassValues.has(r))return!0;for(let n of t){let t=e.valuesByClass.get(L(n));if(t&&(t.has("*")||t.has(r)))return!0}return!1}let T=[{classNames:["SceneObject","GameBase","ShapeBase","Item","Player"],fields:["position","rotation","scale","transform","hidden","renderingdistance","datablock","shapename","shapefile","initialbarrel","skin","team","health","energy","energylevel","damagelevel","damageflash","damagepercent","damagestate","mountobject","mountedimage","targetposition","targetrotation","targetscale","missiontypeslist","renderenabled","vis","velocity","name"]},{classNames:["*"],fields:["position","rotation","scale","hidden","shapefile","datablock"]}],M=[{classNames:["SceneObject","GameBase","ShapeBase","SimObject"],methods:["settransform","setposition","setrotation","setscale","sethidden","setdatablock","setshapename","mountimage","unmountimage","mountobject","unmountobject","setdamagelevel","setenergylevel","schedule","delete","deleteallobjects","add","remove","playthread","stopthread","setthreaddir","pausethread"]},{classNames:["*"],methods:["settransform","setscale","delete","add","remove"]}],B=["missionrunning","loadingmission"];function P(){return{scripts:new Map,generatedCode:new WeakMap}}function H(e){return e.toLowerCase()}function D(e){return Number(e)>>>0}function F(e){if(null==e)return null;if("string"==typeof e)return e||null;if("number"==typeof e)return String(e);throw Error(`Invalid instance name type: ${typeof e}`)}function G(e={}){let t,r,n,s=e.reactiveFieldRules??T,i=e.reactiveMethodRules??M,o=e.reactiveGlobalNames??B,a=(t=function(e){let t=new Set,r=new Map;for(let n of e)for(let e of n.classNames){let s=L(e);if("*"===s){I(t,n.fields);continue}I(O(r,s),n.fields)}return{anyClassValues:t,valuesByClass:r}}(s),(e,r)=>j(t,e,L(r))),l=(r=function(e){let t=new Set,r=new Map;for(let n of e)for(let e of n.classNames){let s=L(e);if("*"===s){I(t,n.methods);continue}I(O(r,s),n.methods)}return{anyClassValues:t,valuesByClass:r}}(i),(e,t)=>j(r,e,L(t))),u=(n=function(e){let t=new Set;for(let r of e)t.add(N(r));return t}(o),e=>{let t=N(e);return n.has("*")||n.has(t)}),c=new b,p=new b,f=new b,h=[],d=new $,x=3,A=1027,C=new Map,S=new b,v=new b,w=new b,E=new b,_=new b,k=new Set,U=[],J=!1,K=0;if(e.globals)for(let[t,r]of Object.entries(e.globals)){if(!t.startsWith("$"))throw Error(`Global variable "${t}" must start with $, e.g. "$${t}"`);w.set(t.slice(1),r)}let W=new Set,z=new Set,V=e.ignoreScripts&&e.ignoreScripts.length>0?(0,m.default)(e.ignoreScripts,{nocase:!0}):null,Z=e.cache??P(),Q=Z.scripts,X=Z.generatedCode,Y=new Map;function ee(e){let t=Y.get(e);return t&&t.length>0?t[t.length-1]:void 0}function et(e,t,r){let n;(n=Y.get(e))||(n=[],Y.set(e,n)),n.push(t);try{return r()}finally{let t;(t=Y.get(e))&&t.pop()}}function er(e,t){return`${e.toLowerCase()}::${t.toLowerCase()}`}function en(e,t){return c.get(e)?.get(t)??null}function es(e){if(!e)return[];let t=[],r=new Set,n=e.class||e._className||e._class,s=n?H(String(n)):"";for(;s&&!r.has(s);)t.push(s),r.add(s),s=_.get(s)??"";return e._superClass&&!r.has(e._superClass)&&t.push(e._superClass),t}function ei(){if(J=!1,0===U.length)return;let e=U.splice(0,U.length);for(let t of(K+=1,k))t({type:"batch.flushed",tick:K,events:e})}function eo(e){for(let t of(U.push(e),k))t(e);J||(J=!0,queueMicrotask(ei))}function ea(e){eo({type:"object.created",objectId:e._id,object:e})}function el(e,t,r,n){let s=H(t);Object.is(r,n)||a(es(e),s)&&eo({type:"field.changed",objectId:e._id,field:s,value:r,previousValue:n,object:e})}let eu=new Set,ec=null,ep=null,ef=(e.builtins??R)({runtime:()=>ep,fileSystem:e.fileSystem??null});function eh(e){let t=f.get(e);if(!t)return void d.add(e);if(!t.active){for(let[e,r]of(t.active=!0,h.push(t.name),t.methods)){c.has(e)||c.set(e,new b);let t=c.get(e);for(let[e,n]of r)t.has(e)||t.set(e,[]),t.get(e).push(n)}for(let[e,r]of t.functions)p.has(e)||p.set(e,[]),p.get(e).push(r)}}function ed(e){return null==e||""===e?null:"object"==typeof e&&null!=e._id?e:"string"==typeof e?S.get(e)??null:"number"==typeof e?C.get(e)??null:null}function eg(e,t,r){let n=ed(e);if(null==n)return 0;let s=ey(n[t]);return n[t]=s+r,el(n,t,n[t],s),s}function em(e,t){let r=en(e,t);return r&&r.length>0?r[r.length-1]:null}function eb(e,t,r,n){let s=en(e,t);return s&&0!==s.length?{found:!0,result:et(er(e,t),s.length-1,()=>s[s.length-1](r,...n))}:{found:!1}}function e$(e,t,r,n){let s;l((s=es(r)).length?s:[e],t)&&eo({type:"method.called",className:H(e),methodName:H(t),objectId:r._id,args:[...n]});let i=E.get(e);if(i){let e=i.get(t);if(e)for(let t of e)t(r,...n)}}function ey(e){if(null==e||""===e)return 0;let t=Number(e);return isNaN(t)?0:t}function ex(e){if(!e||""===e)return null;e.startsWith("/")&&(e=e.slice(1));let t=e.split("/"),r=null;for(let e=0;e t._name?.toLowerCase()===e)??null}if(!r)return null}}return r}function eA(e){return null==e||""===e?null:ex(String(e))}function eC(e,t){function r(e,t){return e+t.join("_")}return{get:(t,...n)=>e.get(r(t,n))??"",set(n,...s){if(0===s.length)throw Error("set() requires at least a value argument");if(1===s.length){let r=e.get(n);return e.set(n,s[0]),t?.onSet?.(n,s[0],r),s[0]}let i=s[s.length-1],o=r(n,s.slice(0,-1)),a=e.get(o);return e.set(o,i),t?.onSet?.(o,i,a),i},postInc(n,...s){let i=r(n,s),o=ey(e.get(i)),a=o+1;return e.set(i,a),t?.onSet?.(i,a,o),o},postDec(n,...s){let i=r(n,s),o=ey(e.get(i)),a=o-1;return e.set(i,a),t?.onSet?.(i,a,o),o}}}function eS(){return eC(new b)}let ev={registerMethod:function(e,t,r){if(ec)ec.methods.has(e)||ec.methods.set(e,new b),ec.methods.get(e).set(t,r);else{c.has(e)||c.set(e,new b);let n=c.get(e);n.has(t)||n.set(t,[]),n.get(t).push(r)}},registerFunction:function(e,t){ec?ec.functions.set(e,t):(p.has(e)||p.set(e,[]),p.get(e).push(t))},package:function(e,t){let r=f.get(e);r||(r={name:e,active:!1,methods:new b,functions:new b},f.set(e,r));let n=ec;ec=r,t(),ec=n,d.has(e)&&(d.delete(e),eh(e))},activatePackage:eh,deactivatePackage:function(e){let t=f.get(e);if(!t||!t.active)return;t.active=!1;let r=h.findIndex(t=>t.toLowerCase()===e.toLowerCase());for(let[e,n]of(-1!==r&&h.splice(r,1),t.methods)){let t=c.get(e);if(t)for(let[e,r]of n){let n=t.get(e);if(n){let e=n.indexOf(r);-1!==e&&n.splice(e,1)}}}for(let[e,r]of t.functions){let t=p.get(e);if(t){let e=t.indexOf(r);-1!==e&&t.splice(e,1)}}},create:function(e,t,r,n){let s=H(e),i=function(){for(;C.has(A);)A+=1;let e=A;return A+=1,e}(),o={_class:s,_className:e,_id:i};for(let[e,t]of Object.entries(r))o[H(e)]=t;o.superclass&&(o._superClass=H(String(o.superclass)),o.class&&_.set(H(String(o.class)),o._superClass)),C.set(i,o);let a=F(t);if(a&&(o._name=a,S.set(a,o)),n){for(let e of n)e._parent=o;o._children=n}let l=em(e,"onAdd");return l&&l(o),ea(o),o},datablock:function(e,t,r,n){let s=H(e),i=function(){for(;C.has(x);)x+=1;let e=x;return x+=1,e}(),o={_class:s,_className:e,_id:i,_isDatablock:!0},a=F(r);if(a){let e=v.get(a);if(e){for(let[t,r]of Object.entries(e))t.startsWith("_")||(o[t]=r);o._parent=e}}for(let[e,t]of Object.entries(n))o[H(e)]=t;C.set(i,o);let l=F(t);return l&&(o._name=l,S.set(l,o),v.set(l,o)),ea(o),o},deleteObject:function e(t){var r;let n;if(null==t||("number"==typeof t?n=C.get(t):"string"==typeof t?n=S.get(t):"object"==typeof t&&t._id&&(n=t),!n))return!1;let s=em(n._className,"onRemove");if(s&&s(n),C.delete(n._id),n._name&&S.delete(n._name),n._isDatablock&&n._name&&v.delete(n._name),n._parent&&n._parent._children){let e=n._parent._children.indexOf(n);-1!==e&&n._parent._children.splice(e,1)}if(n._children)for(let t of[...n._children])e(t);return eo({type:"object.deleted",objectId:(r=n)._id,object:r}),!0},prop:function(e,t){let r=ed(e);return null==r?"":r[H(t)]??""},setProp:function(e,t,r){let n=ed(e);if(null==n)return r;let s=H(t),i=n[s];return n[s]=r,el(n,s,r,i),r},getIndex:function(e,t){let r=ed(e);return null==r?"":r[String(t)]??""},setIndex:function(e,t,r){let n=ed(e);if(null==n)return r;let s=String(t),i=n[s];return n[s]=r,el(n,s,r,i),r},propPostInc:function(e,t){return eg(e,H(t),1)},propPostDec:function(e,t){return eg(e,H(t),-1)},indexPostInc:function(e,t){return eg(e,String(t),1)},indexPostDec:function(e,t){return eg(e,String(t),-1)},key:function(e,...t){return e+t.join("_")},call:function(e,t,...r){if(null==e||("string"==typeof e||"number"==typeof e)&&null==(e=eA(e)))return"";let n=e.class||e._className||e._class;if(n){let s=eb(n,t,e,r);if(s.found)return e$(n,t,e,r),s.result}let s=e._superClass||_.get(n);for(;s;){let n=eb(s,t,e,r);if(n.found)return e$(s,t,e,r),n.result;s=_.get(s)}return""},nsCall:function(e,t,...r){let n=en(e,t);if(!n||0===n.length)return"";let s=er(e,t),i=n[n.length-1],o=et(s,n.length-1,()=>i(...r)),a=r[0];return a&&"object"==typeof a&&e$(e,t,a,r.slice(1)),o},nsRef:function(e,t){let r=en(e,t);if(!r||0===r.length)return null;let n=er(e,t),s=r[r.length-1];return(...e)=>et(n,r.length-1,()=>s(...e))},parent:function(e,t,r,...n){let s=en(e,t),i=er(e,t),o=ee(i);if(s&&void 0!==o&&o>=1){let a=o-1,l=et(i,a,()=>s[a](r,...n));return r&&"object"==typeof r&&e$(e,t,r,n),l}let a=_.get(e);for(;a;){let e=en(a,t);if(e&&e.length>0){let s=et(er(a,t),e.length-1,()=>e[e.length-1](r,...n));return r&&"object"==typeof r&&e$(a,t,r,n),s}a=_.get(a)}return""},parentFunc:function(e,...t){let r=p.get(e);if(!r)return"";let n=e.toLowerCase(),s=ee(n);if(void 0===s||s<1)return"";let i=s-1;return et(n,i,()=>r[i](...t))},add:function(e,t){return ey(e)+ey(t)},sub:function(e,t){return ey(e)-ey(t)},mul:function(e,t){return ey(e)*ey(t)},div:function(e,t){return ey(e)/ey(t)},neg:function(e){return-ey(e)},lt:function(e,t){return ey(e) ey(t)},ge:function(e,t){return ey(e)>=ey(t)},eq:function(e,t){return ey(e)===ey(t)},ne:function(e,t){return ey(e)!==ey(t)},mod:function(e,t){let r=0|Number(t);return 0===r?0:(0|Number(e))%r},bitand:function(e,t){return D(e)&D(t)},bitor:function(e,t){return D(e)|D(t)},bitxor:function(e,t){return D(e)^D(t)},shl:function(e,t){return D(D(e)<<(31&D(t)))},shr:function(e,t){return D(e)>>>(31&D(t))},bitnot:function(e){return~D(e)>>>0},concat:function(...e){return e.map(e=>String(e??"")).join("")},streq:function(e,t){return String(e??"").toLowerCase()===String(t??"").toLowerCase()},switchStr:function(e,t){let r=String(e??"").toLowerCase();for(let[e,n]of Object.entries(t))if("default"!==e&&H(e)===r)return void n();t.default&&t.default()},deref:eA,nameToId:function(e){let t=ex(e);return t?t._id:-1},isObject:function(e){return null!=e&&("object"==typeof e&&!!e._id||("number"==typeof e?C.has(e):"string"==typeof e&&S.has(e)))},isFunction:function(e){return p.has(e)||e.toLowerCase()in ef},isPackage:function(e){return f.has(e)},isActivePackage:function(e){let t=f.get(e);return t?.active??!1},getPackageList:function(){return h.join(" ")},locals:eS,onMethodCalled(e,t,r){let n=E.get(e);n||(n=new b,E.set(e,n));let s=n.get(t);return s||(s=[],n.set(t,s)),s.push(r),()=>{let e=s.indexOf(r);-1!==e&&s.splice(e,1)}}},ew={call(e,...t){let r=p.get(e);if(r&&r.length>0)return et(e.toLowerCase(),r.length-1,()=>r[r.length-1](...t));let n=ef[e.toLowerCase()];return n?n(...t):(console.warn(`Unknown function: ${e}(${t.map(e=>JSON.stringify(e)).join(", ")})`),"")}},eE=eC(w,{onSet:function(e,t,r){let n=H(e.startsWith("$")?e.slice(1):e);Object.is(t,r)||u(n)&&eo({type:"global.changed",name:n,value:t,previousValue:r})}}),e_={methods:c,functions:p,packages:f,activePackages:h,objectsById:C,objectsByName:S,datablocks:v,globals:w,executedScripts:W,failedScripts:z,scripts:Q,generatedCode:X,pendingTimeouts:eu,startTime:Date.now()};function ek(e){let t=function(e){let t=X.get(e);null==t&&(t=new g(void 0).generate(e),X.set(e,t));return t}(e),r=eS();Function("$","$f","$g","$l",t)(ev,ew,eE,r)}function eR(e,t){return{execute(){if(t){let e=y(t);e_.executedScripts.add(e)}ek(e)}}}async function eL(t,r,n){let s=e.loadScript;if(!s){t.length>0&&console.warn("Script has exec() calls but no loadScript provided:",t);return}async function i(t){e.signal?.throwIfAborted();let i=y(t);if(e_.scripts.has(i)||e_.failedScripts.has(i))return;if(V&&V(i)){console.warn(`Ignoring script: ${t}`),e_.failedScripts.add(i);return}if(n.has(i))return;let o=r.get(i);if(o)return void await o;e.progress?.addItem(t);let a=(async()=>{let o,a=await s(t);if(null==a){console.warn(`Script not found: ${t}`),e_.failedScripts.add(i),e.progress?.completeItem();return}try{o=q(a,{filename:t})}catch(r){console.warn(`Failed to parse script: ${t}`,r),e_.failedScripts.add(i),e.progress?.completeItem();return}let l=new Set(n);l.add(i),await eL(o.execScriptPaths,r,l),e_.scripts.set(i,o),e.progress?.completeItem()})();r.set(i,a),await a}await Promise.all(t.map(i))}async function eN(t){let r=e.loadScript;if(!r)throw Error("loadFromPath requires loadScript option to be set");let n=y(t);if(e_.scripts.has(n))return eR(e_.scripts.get(n),t);e.progress?.addItem(t);let s=await r(t);if(null==s)throw e.progress?.completeItem(),Error(`Script not found: ${t}`);let i=await eO(s,{path:t});return e.progress?.completeItem(),i}async function eO(e,t){if(t?.path){let e=y(t.path);if(e_.scripts.has(e))return eR(e_.scripts.get(e),t.path)}return eI(q(e,{filename:t?.path}),t)}async function eI(t,r){let n=new Map,s=new Set;if(r?.path){let e=y(r.path);e_.scripts.set(e,t),s.add(e)}let i=[...t.execScriptPaths,...e.preloadScripts??[]];return await eL(i,n,s),eR(t,r?.path)}return ep={$:ev,$f:ew,$g:eE,state:e_,destroy:function(){for(let e of(U.length>0&&ei(),e_.pendingTimeouts))clearTimeout(e);e_.pendingTimeouts.clear(),k.clear()},executeAST:ek,loadFromPath:eN,loadFromSource:eO,loadFromAST:eI,call:(e,...t)=>ew.call(e,...t),getObjectByName:e=>S.get(e),subscribeRuntimeEvents:e=>(k.add(e),()=>{k.delete(e)})}}function U(){let e=new Set,t=0,r=0,n=null;function s(){for(let t of e)t()}return{get total(){return t},get loaded(){return r},get current(){return n},get progress(){return 0===t?0:r/t},on(t,r){e.add(r)},off(t,r){e.delete(r)},addItem(e){t++,n=e,s()},completeItem(){r++,n=null,s()},setCurrent(e){n=e,s()}}}function q(e,t){try{return f.default.parse(e)}catch(e){if(t?.filename&&e.location)throw Error(`${t.filename}:${e.location.start.line}:${e.location.start.column}: ${e.message}`,{cause:e});throw e}}function J(e){if("boolean"==typeof e)return e;if("number"==typeof e)return 0!==e;if("string"==typeof e){let t=e.trim().toLowerCase();return""!==t&&"0"!==t&&"false"!==t}return!!e}function K(){let e=Error("Operation aborted");return e.name="AbortError",e}function W(e){let t,{missionName:r,missionType:n,runtimeOptions:s,onMissionLoadDone:i}=e,{signal:o,fileSystem:a,globals:l={},preloadScripts:u=[],reactiveGlobalNames:c}=s??{},p=a?.findFiles("scripts/*Game.cs")??[],f=c?Array.from(new Set([...c,"missionRunning"])):void 0,h=G({...s,reactiveGlobalNames:f,globals:{...l,"$Host::Map":r,"$Host::MissionType":n},preloadScripts:[...u,...p]});(t=h.$.registerMethod.bind(h.$))("ShapeBase","playThread",(e,t,r)=>{e._threads||(e._threads={}),e._threads[Number(t)]={sequence:String(r),playing:!0,direction:!0}}),t("ShapeBase","stopThread",(e,t)=>{e._threads&&delete e._threads[Number(t)]}),t("ShapeBase","setThreadDir",(e,t,r)=>{e._threads||(e._threads={});let n=Number(t);e._threads[n]?e._threads[n].direction=!!Number(r):e._threads[n]={sequence:"",playing:!1,direction:!!Number(r)}}),t("ShapeBase","pauseThread",(e,t)=>{e._threads?.[Number(t)]&&(e._threads[Number(t)].playing=!1)}),t("ShapeBase","playAudio",()=>{}),t("ShapeBase","stopAudio",()=>{}),t("SimObject","getDatablock",e=>{let t=e.datablock;return t?h.getObjectByName(String(t))??"":""}),t("SimObject","getGroup",e=>e._parent??""),t("SimObject","getName",e=>e._name??""),t("SimObject","getType",()=>16384),t("SimGroup","getCount",e=>e._children?e._children.length:0),t("SimGroup","getObject",(e,t)=>{let r=e._children;return r?r[Number(t)]??"":""}),t("GameBase","isEnabled",()=>!0),t("GameBase","isDisabled",()=>!1),t("GameBase","setPoweredState",()=>{}),t("GameBase","setRechargeRate",()=>{}),t("GameBase","getRechargeRate",()=>0),t("GameBase","setEnergyLevel",()=>{}),t("GameBase","getEnergyLevel",()=>0),t("ShapeBase","getDamageLevel",()=>0),t("ShapeBase","setDamageLevel",()=>{}),t("ShapeBase","getRepairRate",()=>0),t("ShapeBase","setRepairRate",()=>{}),t("ShapeBase","getDamagePercent",()=>0),t("GameBase","getControllingClient",()=>0),t("SimObject","schedule",(e,t,r,...n)=>{let s=setTimeout(()=>{h.state.pendingTimeouts.delete(s);try{h.$.call(e,String(r),...n)}catch(t){console.error(`schedule: error calling ${r} on ${e._id}:`,t)}},Number(t)||0);return h.state.pendingTimeouts.add(s),s});let d=async function(){try{let e=await h.loadFromPath("scripts/server.cs");o?.throwIfAborted(),await h.loadFromPath(`missions/${r}.mis`),o?.throwIfAborted(),e.execute();let t=function(e,t){let{signal:r,onMissionLoadDone:n}=t;return new Promise((t,s)=>{let i=!1,o=!1,a=()=>J(e.$g.get("missionRunning")),l=()=>{i||(i=!0,h(),t())},u=e=>{i||(i=!0,h(),s(e))},c=t=>{if(!n||o)return;let r=t??e.getObjectByName("Game");r&&(o=!0,n(r))},p=()=>u(K()),f=e.subscribeRuntimeEvents(e=>{if("global.changed"===e.type&&"missionrunning"===e.name){J(e.value)&&(c(),l());return}"batch.flushed"===e.type&&a()&&(c(),l())});function h(){f(),r?.removeEventListener("abort",p)}if(r){if(r.aborted)return void u(K());r.addEventListener("abort",p,{once:!0})}a()&&(c(),l())})}(h,{signal:o,onMissionLoadDone:i}),n=await h.loadFromSource("CreateServer($Host::Map, $Host::MissionType);");o?.throwIfAborted(),n.execute(),await t}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}}();return{runtime:h,ready:d}}e.s(["createProgressTracker",()=>U],38433);let z=/^[ \t]*(DisplayName|MissionTypes|BriefingWAV|Bitmap|PlanetName)[ \t]*=[ \t]*(.+)$/i,V=/^[ \t]*-+[ \t]*([A-Z ]+)[ \t]+BEGIN[ \t]*-+$/i,Z=/^[ \t]*-+[ \t]*([A-Z ]+)[ \t]+END[ \t]*-+$/i,Q={arena:"Arena",bounty:"Bounty",cnh:"CnH",ctf:"CTF",dm:"DM",dnd:"DnD",hunters:"Hunters",lakrabbit:"LakRabbit",lakzm:"LakZM",lctf:"LCTF",none:"None",rabbit:"Rabbit",sctf:"SCtF",siege:"Siege",singleplayer:"SinglePlayer",tdm:"TDM",teamhunters:"TeamHunters",teamlak:"TeamLak",tr2:"TR2"};function X(e){let t=q(e),{pragma:r,sections:n}=function(e){let t={},r=[],n={name:null,comments:[]};for(let s of e.body)if("Comment"===s.type){let e=function(e){let t;return(t=e.match(V))?{type:"sectionBegin",name:t[1]}:(t=e.match(Z))?{type:"sectionEnd",name:t[1]}:(t=e.match(z))?{type:"definition",identifier:t[1],value:t[2]}:null}(s.value);if(e)switch(e.type){case"definition":null===n.name?t[e.identifier.toLowerCase()]=e.value:n.comments.push(s.value);break;case"sectionBegin":(null!==n.name||n.comments.length>0)&&r.push(n),n={name:e.name.toUpperCase(),comments:[]};break;case"sectionEnd":null!==n.name&&r.push(n),n={name:null,comments:[]}}else n.comments.push(s.value)}return(null!==n.name||n.comments.length>0)&&r.push(n),{pragma:t,sections:r}}(t);function s(e){return n.find(t=>t.name===e)?.comments.map(e=>e.trimStart()).join("\n")??null}return{displayName:r.displayname??null,missionTypes:r.missiontypes?.split(/\s+/).filter(Boolean).map(e=>Q[e.toLowerCase()]??e)??[],missionBriefing:s("MISSION BRIEFING"),briefingWav:r.briefingwav??null,bitmap:r.bitmap??null,planetName:r.planetname??null,missionBlurb:s("MISSION BLURB"),missionQuote:s("MISSION QUOTE"),missionString:s("MISSION STRING"),execScriptPaths:t.execScriptPaths,hasDynamicExec:t.hasDynamicExec,ast:t}}function Y(e,t){if(e)return e[t.toLowerCase()]}function ee(e){let[t,r,n]=(e.position??"0 0 0").split(" ").map(e=>parseFloat(e));return[r||0,n||0,t||0]}function et(e){let[t,r,n]=(e.scale??"1 1 1").split(" ").map(e=>parseFloat(e));return[r||0,n||0,t||0]}e.s(["getPosition",()=>ee,"getProperty",()=>Y,"getScale",()=>et,"parseMissionScript",()=>X],62395);let er="/t2-mapper",en=`${er}/base/`,es=`${er}/magenta.png`;function ei(e,t){let r;try{r=o(e)}catch(r){if(t)return console.warn(`Resource "${e}" not found - rendering fallback.`),t;throw r}let[n,s]=i(r);return n?`${en}@vl2/${n}/${s}`:`${en}${s}`}function eo(e){return ei(`interiors/${e}`).replace(/\.dif$/i,".glb")}function ea(e){return ei(`shapes/${e}`).replace(/\.dts$/i,".glb")}function el(e){return e=e.replace(/^terrain\./,""),ei(u(`textures/terrain/${e}`),es)}function eu(e,r){let n=t(r).split("/"),s=n.length>1?n.slice(0,-1).join("/")+"/":"";return ei(u(`${s}${e}`),es)}function ec(e){return ei(u(`textures/${e}`),es)}function ep(e){return ei(`audio/${e}`).replace(/\.wav$/i,".ogg")}async function ef(e){let t=ei(`textures/${e}`),r=await fetch(t);return(await r.text()).split(/(?:\r\n|\r|\n)/).map(e=>{if(!(e=e.trim()).startsWith(";"))return e}).filter(Boolean)}async function eh(e){let t,r=c(e),n=await fetch(ei(r.resourcePath)),s=await n.arrayBuffer();try{t=new TextDecoder("utf-8",{fatal:!0}).decode(s)}catch{t=new TextDecoder("windows-1252").decode(s)}return X(t=t.replaceAll("�","'"))}async function ed(e){let t=await fetch(ei(`terrains/${e}`));return function(e){let t=new DataView(e),r=0,n=t.getUint8(r++),s=new Uint16Array(65536),i=[],o=e=>{let n="";for(let s=0;s 0&&i.push(s)}let a=[];for(let e of i){let e=new Uint8Array(65536);for(let n=0;n<65536;n++){let s=t.getUint8(r++);e[n]=s}a.push(e)}return{version:n,textureNames:i,heightMap:s,alphaMaps:a}}(await t.arrayBuffer())}async function eg(e){let t=ei(e),r=await fetch(t);return(await r.text()).split(/(?:\r\n|\r|\n)/g).map(e=>e.trim()).filter(Boolean).filter(e=>!e.startsWith(";")).map(e=>{let t=e.match(/^(.+)\s(\d+)$/);if(!t)return{name:e,frameCount:1};{let e=parseInt(t[2],10);return{name:t[1],frameCount:e}}})}e.s(["FALLBACK_TEXTURE_URL",0,es,"RESOURCE_ROOT_URL",0,en,"audioToUrl",()=>ep,"getUrlForPath",()=>ei,"iflTextureToUrl",()=>eu,"interiorToUrl",()=>eo,"loadDetailMapList",()=>ef,"loadImageFrameList",()=>eg,"loadMission",()=>eh,"loadTerrain",()=>ed,"shapeToUrl",()=>ea,"terrainTextureToUrl",()=>el,"textureToUrl",()=>ec],12979)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/5b60a5e8e48bc409.js b/docs/_next/static/chunks/5b60a5e8e48bc409.js deleted file mode 100644 index 36a0c378..00000000 --- a/docs/_next/static/chunks/5b60a5e8e48bc409.js +++ /dev/null @@ -1,397 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66936,(e,t,n)=>{"use strict";function i(e,t){var n=e.length;for(e.push(t);0 >>1,r=e[i];if(0 >>1;is(l,n))us(c,l)?(e[i]=c,e[u]=n,i=u):(e[i]=l,e[o]=n,i=o);else if(u s(c,n))e[i]=c,e[u]=n,i=u;else break}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(n.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o,l=performance;n.unstable_now=function(){return l.now()}}else{var u=Date,c=u.now();n.unstable_now=function(){return u.now()-c}}var h=[],d=[],p=1,f=null,m=3,g=!1,v=!1,_=!1,y=!1,x="function"==typeof setTimeout?setTimeout:null,b="function"==typeof clearTimeout?clearTimeout:null,S="u">typeof setImmediate?setImmediate:null;function M(e){for(var t=r(d);null!==t;){if(null===t.callback)a(d);else if(t.startTime<=e)a(d),t.sortIndex=t.expirationTime,i(h,t);else break;t=r(d)}}function T(e){if(_=!1,M(e),!v)if(null!==r(h))v=!0,w||(w=!0,o());else{var t=r(d);null!==t&&N(T,t.startTime-e)}}var w=!1,E=-1,A=5,C=-1;function R(){return!!y||!(n.unstable_now()-Ce&&R());){var s=f.callback;if("function"==typeof s){f.callback=null,m=f.priorityLevel;var l=s(f.expirationTime<=e);if(e=n.unstable_now(),"function"==typeof l){f.callback=l,M(e),t=!0;break t}f===r(h)&&a(h),M(e)}else a(h);f=r(h)}if(null!==f)t=!0;else{var u=r(d);null!==u&&N(T,u.startTime-e),t=!1}}break e}finally{f=null,m=i,g=!1}}}finally{t?o():w=!1}}}if("function"==typeof S)o=function(){S(P)};else if("u">typeof MessageChannel){var I=new MessageChannel,L=I.port2;I.port1.onmessage=P,o=function(){L.postMessage(null)}}else o=function(){x(P,0)};function N(e,t){E=x(function(){e(n.unstable_now())},t)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(e){e.callback=null},n.unstable_forceFrameRate=function(e){0>e||125 s?(e.sortIndex=a,i(d,e),null===r(h)&&e===r(d)&&(_?(b(E),E=-1):_=!0,N(T,a-s))):(e.sortIndex=l,i(h,e),v||g||(v=!0,w||(w=!0,o()))),e},n.unstable_shouldYield=R,n.unstable_wrapCallback=function(e){var t=m;return function(){var n=m;m=t;try{return e.apply(this,arguments)}finally{m=n}}}},89499,(e,t,n)=>{"use strict";t.exports=e.r(66936)},40859,90072,8560,46791,e=>{"use strict";let t,n,i,r,a,s,o,l,u,c,h,d,p,f,m,g,v,_;var y,x,b,S,M,T,w=e.i(47167),E=e.i(71645);let A={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},C={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},R="attached",P="detached",I="srgb",L="srgb-linear",N="linear",U="srgb",D="300 es",O={COMPUTE:"compute",RENDER:"render"},F={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},z={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"};function B(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}let k={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function V(e,t){return new k[e](t)}function H(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function G(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function W(){let e=G("canvas");return e.style.display="block",e}let j={},X=null;function q(e){X=e}function Y(){return X}function Z(...e){let t="THREE."+e.shift();X?X("log",t,...e):console.log(t,...e)}function J(...e){let t="THREE."+e.shift();X?X("warn",t,...e):console.warn(t,...e)}function K(...e){let t="THREE."+e.shift();X?X("error",t,...e):console.error(t,...e)}function $(...e){let t=e.join(" ");t in j||(j[t]=!0,J(...e))}function Q(e,t,n){return new Promise(function(i,r){setTimeout(function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:r();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:i()}},n)})}class ee{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return void 0!==n&&void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){let n=this._listeners;if(void 0===n)return;let i=n[e];if(void 0!==i){let e=i.indexOf(t);-1!==e&&i.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(void 0===t)return;let n=t[e.type];if(void 0!==n){e.target=this;let t=n.slice(0);for(let n=0,i=t.length;n>8&255]+et[e>>16&255]+et[e>>24&255]+"-"+et[255&t]+et[t>>8&255]+"-"+et[t>>16&15|64]+et[t>>24&255]+"-"+et[63&n|128]+et[n>>8&255]+"-"+et[n>>16&255]+et[n>>24&255]+et[255&i]+et[i>>8&255]+et[i>>16&255]+et[i>>24&255]).toLowerCase()}function es(e,t,n){return Math.max(t,Math.min(n,e))}function eo(e,t){return(e%t+t)%t}function el(e,t,n){return(1-n)*e+n*t}function eu(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/0xffffffff;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/0x7fffffff,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error("Invalid component type.")}}function ec(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(0xffffffff*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(0x7fffffff*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw Error("Invalid component type.")}}let eh={DEG2RAD:ei,RAD2DEG:er,generateUUID:ea,clamp:es,euclideanModulo:eo,mapLinear:function(e,t,n,i,r){return i+(e-t)*(r-i)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:el,damp:function(e,t,n,i){return el(e,t,1-Math.exp(-n*i))},pingpong:function(e,t=1){return t-Math.abs(eo(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(en=e);let t=en+=0x6d2b79f5;return t=Math.imul(t^t>>>15,1|t),(((t^=t+Math.imul(t^t>>>7,61|t))^t>>>14)>>>0)/0x100000000},degToRad:function(e){return e*ei},radToDeg:function(e){return e*er},isPowerOfTwo:function(e){return(e&e-1)==0&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,i,r){let a=Math.cos,s=Math.sin,o=a(n/2),l=s(n/2),u=a((t+i)/2),c=s((t+i)/2),h=a((t-i)/2),d=s((t-i)/2),p=a((i-t)/2),f=s((i-t)/2);switch(r){case"XYX":e.set(o*c,l*h,l*d,o*u);break;case"YZY":e.set(l*d,o*c,l*h,o*u);break;case"ZXZ":e.set(l*h,l*d,o*c,o*u);break;case"XZX":e.set(o*c,l*f,l*p,o*u);break;case"YXY":e.set(l*p,o*c,l*f,o*u);break;case"ZYZ":e.set(l*f,l*p,o*c,o*u);break;default:J("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:ec,denormalize:eu};class ed{constructor(e=0,t=0){ed.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=es(this.x,e.x,t.x),this.y=es(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=es(this.x,e,t),this.y=es(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(es(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:Math.acos(es(this.dot(e)/t,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*n-a*i+e.x,this.y=r*i+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ep{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,r,a,s){let o=n[i+0],l=n[i+1],u=n[i+2],c=n[i+3],h=r[a+0],d=r[a+1],p=r[a+2],f=r[a+3];if(s<=0){e[t+0]=o,e[t+1]=l,e[t+2]=u,e[t+3]=c;return}if(s>=1){e[t+0]=h,e[t+1]=d,e[t+2]=p,e[t+3]=f;return}if(c!==f||o!==h||l!==d||u!==p){let e=o*h+l*d+u*p+c*f;e<0&&(h=-h,d=-d,p=-p,f=-f,e=-e);let t=1-s;if(e<.9995){let n=Math.acos(e),i=Math.sin(n);o=o*(t=Math.sin(t*n)/i)+h*(s=Math.sin(s*n)/i),l=l*t+d*s,u=u*t+p*s,c=c*t+f*s}else{let e=1/Math.sqrt((o=o*t+h*s)*o+(l=l*t+d*s)*l+(u=u*t+p*s)*u+(c=c*t+f*s)*c);o*=e,l*=e,u*=e,c*=e}}e[t]=o,e[t+1]=l,e[t+2]=u,e[t+3]=c}static multiplyQuaternionsFlat(e,t,n,i,r,a){let s=n[i],o=n[i+1],l=n[i+2],u=n[i+3],c=r[a],h=r[a+1],d=r[a+2],p=r[a+3];return e[t]=s*p+u*c+o*d-l*h,e[t+1]=o*p+u*h+l*c-s*d,e[t+2]=l*p+u*d+s*h-o*c,e[t+3]=u*p-s*c-o*h-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,i=e._y,r=e._z,a=e._order,s=Math.cos,o=Math.sin,l=s(n/2),u=s(i/2),c=s(r/2),h=o(n/2),d=o(i/2),p=o(r/2);switch(a){case"XYZ":this._x=h*u*c+l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c-h*d*p;break;case"YXZ":this._x=h*u*c+l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c+h*d*p;break;case"ZXY":this._x=h*u*c-l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c-h*d*p;break;case"ZYX":this._x=h*u*c-l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c+h*d*p;break;case"YZX":this._x=h*u*c+l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c-h*d*p;break;case"XZY":this._x=h*u*c-l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c+h*d*p;break;default:J("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],r=t[8],a=t[1],s=t[5],o=t[9],l=t[2],u=t[6],c=t[10],h=n+s+c;if(h>0){let e=.5/Math.sqrt(h+1);this._w=.25/e,this._x=(u-o)*e,this._y=(r-l)*e,this._z=(a-i)*e}else if(n>s&&n>c){let e=2*Math.sqrt(1+n-s-c);this._w=(u-o)/e,this._x=.25*e,this._y=(i+a)/e,this._z=(r+l)/e}else if(s>c){let e=2*Math.sqrt(1+s-n-c);this._w=(r-l)/e,this._x=(i+a)/e,this._y=.25*e,this._z=(o+u)/e}else{let e=2*Math.sqrt(1+c-n-s);this._w=(a-i)/e,this._x=(r+l)/e,this._y=(o+u)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0):(this._x=0,this._y=-e.z,this._z=e.y)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x),this._w=n,this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(es(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(0===n)return this;let i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,i=e._y,r=e._z,a=e._w,s=t._x,o=t._y,l=t._z,u=t._w;return this._x=n*u+a*s+i*l-r*o,this._y=i*u+a*o+r*s-n*l,this._z=r*u+a*l+n*o-i*s,this._w=a*u-n*s-i*o-r*l,this._onChangeCallback(),this}slerp(e,t){if(t<=0)return this;if(t>=1)return this.copy(e);let n=e._x,i=e._y,r=e._z,a=e._w,s=this.dot(e);s<0&&(n=-n,i=-i,r=-r,a=-a,s=-s);let o=1-t;if(s<.9995){let e=Math.acos(s),l=Math.sin(e);o=Math.sin(o*e)/l,t=Math.sin(t*e)/l,this._x=this._x*o+n*t,this._y=this._y*o+i*t,this._z=this._z*o+r*t,this._w=this._w*o+a*t,this._onChangeCallback()}else this._x=this._x*o+n*t,this._y=this._y*o+i*t,this._z=this._z*o+r*t,this._w=this._w*o+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ef{constructor(e=0,t=0,n=0){ef.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(eg.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(eg.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,r=e.x,a=e.y,s=e.z,o=e.w,l=2*(a*i-s*n),u=2*(s*t-r*i),c=2*(r*n-a*t);return this.x=t+o*l+a*c-s*u,this.y=n+o*u+s*l-r*c,this.z=i+o*c+r*u-a*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=es(this.x,e.x,t.x),this.y=es(this.y,e.y,t.y),this.z=es(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=es(this.x,e,t),this.y=es(this.y,e,t),this.z=es(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(es(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,r=e.z,a=t.x,s=t.y,o=t.z;return this.x=i*o-r*s,this.y=r*a-n*o,this.z=n*s-i*a,this}projectOnVector(e){let t=e.lengthSq();if(0===t)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return em.copy(this).projectOnVector(e),this.sub(em)}reflect(e){return this.sub(em.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:Math.acos(es(this.dot(e)/t,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=2*Math.random()-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}let em=new ef,eg=new ep;class ev{constructor(e,t,n,i,r,a,s,o,l){ev.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,n,i,r,a,s,o,l)}set(e,t,n,i,r,a,s,o,l){let u=this.elements;return u[0]=e,u[1]=i,u[2]=s,u[3]=t,u[4]=r,u[5]=o,u[6]=n,u[7]=a,u[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,r=this.elements,a=n[0],s=n[3],o=n[6],l=n[1],u=n[4],c=n[7],h=n[2],d=n[5],p=n[8],f=i[0],m=i[3],g=i[6],v=i[1],_=i[4],y=i[7],x=i[2],b=i[5],S=i[8];return r[0]=a*f+s*v+o*x,r[3]=a*m+s*_+o*b,r[6]=a*g+s*y+o*S,r[1]=l*f+u*v+c*x,r[4]=l*m+u*_+c*b,r[7]=l*g+u*y+c*S,r[2]=h*f+d*v+p*x,r[5]=h*m+d*_+p*b,r[8]=h*g+d*y+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],u=e[8];return t*a*u-t*s*l-n*r*u+n*s*o+i*r*l-i*a*o}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],u=e[8],c=u*a-s*l,h=s*o-u*r,d=l*r-a*o,p=t*c+n*h+i*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);let f=1/p;return e[0]=c*f,e[1]=(i*l-u*n)*f,e[2]=(s*n-i*a)*f,e[3]=h*f,e[4]=(u*t-i*o)*f,e[5]=(i*r-s*t)*f,e[6]=d*f,e[7]=(n*o-l*t)*f,e[8]=(a*t-n*r)*f,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,r,a,s){let o=Math.cos(r),l=Math.sin(r);return this.set(n*o,n*l,-n*(o*a+l*s)+a+e,-i*l,i*o,-i*(-l*a+o*s)+s+t,0,0,1),this}scale(e,t){return this.premultiply(e_.makeScale(e,t)),this}rotate(e){return this.premultiply(e_.makeRotation(-e)),this}translate(e,t){return this.premultiply(e_.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}let e_=new ev,ey=new ev().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),ex=new ev().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),eb=(d=[.64,.33,.3,.6,.15,.06],p=[.2126,.7152,.0722],f=[.3127,.329],(h={enabled:!0,workingColorSpace:L,spaces:{},convert:function(e,t,n){return!1!==this.enabled&&t!==n&&t&&n&&(this.spaces[t].transfer===U&&(e.r=eS(e.r),e.g=eS(e.g),e.b=eS(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===U&&(e.r=eM(e.r),e.g=eM(e.g),e.b=eM(e.b))),e},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return""===e?N:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(e,t){return $("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),h.workingToColorSpace(e,t)},toWorkingColorSpace:function(e,t){return $("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),h.colorSpaceToWorking(e,t)}}).define({[L]:{primaries:d,whitePoint:f,transfer:N,toXYZ:ey,fromXYZ:ex,luminanceCoefficients:p,workingColorSpaceConfig:{unpackColorSpace:I},outputColorSpaceConfig:{drawingBufferColorSpace:I}},[I]:{primaries:d,whitePoint:f,transfer:U,toXYZ:ey,fromXYZ:ex,luminanceCoefficients:p,outputColorSpaceConfig:{drawingBufferColorSpace:I}}}),h);function eS(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function eM(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class eT{static getDataURL(e,n="image/png"){let i;if(/^data:/i.test(e.src)||"u" typeof HTMLImageElement&&e instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&e instanceof ImageBitmap){let t=G("canvas");t.width=e.width,t.height=e.height;let n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);let i=n.getImageData(0,0,e.width,e.height),r=i.data;for(let e=0;e typeof HTMLVideoElement&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):"u">typeof VideoFrame&&t instanceof VideoFrame?e.set(t.displayHeight,t.displayWidth,0):null!==t?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){!0===e&&this.version++}toJSON(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];let n={uuid:this.uuid,url:""},i=this.data;if(null!==i){let e;if(Array.isArray(i)){e=[];for(let t=0,n=i.length;t typeof HTMLImageElement&&e instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&e instanceof ImageBitmap?eT.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(J("Texture: Unable to serialize Texture."),{})}let eC=0,eR=new ef;class eP extends ee{constructor(e=eP.DEFAULT_IMAGE,t=eP.DEFAULT_MAPPING,n=1001,i=1001,r=1006,a=1008,s=1023,o=1009,l=eP.DEFAULT_ANISOTROPY,u=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:eC++}),this.uuid=ea(),this.name="",this.source=new eE(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=a,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=o,this.offset=new ed(0,0),this.repeat=new ed(1,1),this.center=new ed(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ev,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!e&&!!e.depth&&e.depth>1,this.pmremVersion=0}get width(){return this.source.getSize(eR).x}get height(){return this.source.getSize(eR).y}get depth(){return this.source.getSize(eR).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let n=e[t];if(void 0===n){J(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let i=this[t];if(void 0===i){J(`Texture.setValues(): property '${t}' does not exist.`);continue}i&&n&&i.isVector2&&n.isVector2||i&&n&&i.isVector3&&n.isVector3||i&&n&&i.isMatrix3&&n.isMatrix3?i.copy(n):this[t]=n}}toJSON(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];let n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}}eP.DEFAULT_IMAGE=null,eP.DEFAULT_MAPPING=300,eP.DEFAULT_ANISOTROPY=1;class eI{constructor(e=0,t=0,n=0,i=1){eI.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*r,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,r,a=e.elements,s=a[0],o=a[4],l=a[8],u=a[1],c=a[5],h=a[9],d=a[2],p=a[6],f=a[10];if(.01>Math.abs(o-u)&&.01>Math.abs(l-d)&&.01>Math.abs(h-p)){if(.1>Math.abs(o+u)&&.1>Math.abs(l+d)&&.1>Math.abs(h+p)&&.1>Math.abs(s+c+f-3))return this.set(1,0,0,0),this;t=Math.PI;let e=(s+1)/2,a=(c+1)/2,m=(f+1)/2,g=(o+u)/4,v=(l+d)/4,_=(h+p)/4;return e>a&&e>m?e<.01?(n=0,i=.707106781,r=.707106781):(i=g/(n=Math.sqrt(e)),r=v/n):a>m?a<.01?(n=.707106781,i=0,r=.707106781):(n=g/(i=Math.sqrt(a)),r=_/i):m<.01?(n=.707106781,i=.707106781,r=0):(n=v/(r=Math.sqrt(m)),i=_/r),this.set(n,i,r,t),this}let m=Math.sqrt((p-h)*(p-h)+(l-d)*(l-d)+(u-o)*(u-o));return .001>Math.abs(m)&&(m=1),this.x=(p-h)/m,this.y=(l-d)/m,this.z=(u-o)/m,this.w=Math.acos((s+c+f-1)/2),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=es(this.x,e.x,t.x),this.y=es(this.y,e.y,t.y),this.z=es(this.z,e.z,t.z),this.w=es(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=es(this.x,e,t),this.y=es(this.y,e,t),this.z=es(this.z,e,t),this.w=es(this.w,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(es(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class eL extends ee{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:1006,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new eI(0,0,e,t),this.scissorTest=!1,this.viewport=new eI(0,0,e,t);const i=new eP({width:e,height:t,depth:n.depth});this.textures=[];const r=n.count;for(let e=0;e 1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t =this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,ek),ek.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(eY),eZ.subVectors(this.max,eY),eH.subVectors(e.a,eY),eG.subVectors(e.b,eY),eW.subVectors(e.c,eY),ej.subVectors(eG,eH),eX.subVectors(eW,eG),eq.subVectors(eH,eW);let t=[0,-ej.z,ej.y,0,-eX.z,eX.y,0,-eq.z,eq.y,ej.z,0,-ej.x,eX.z,0,-eX.x,eq.z,0,-eq.x,-ej.y,ej.x,0,-eX.y,eX.x,0,-eq.y,eq.x,0];return!!e$(t,eH,eG,eW,eZ)&&!!e$(t=[1,0,0,0,1,0,0,0,1],eH,eG,eW,eZ)&&(eJ.crossVectors(ej,eX),e$(t=[eJ.x,eJ.y,eJ.z],eH,eG,eW,eZ))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ek).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(ek).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(eB[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),eB[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),eB[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),eB[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),eB[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),eB[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),eB[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),eB[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(eB)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}let eB=[new ef,new ef,new ef,new ef,new ef,new ef,new ef,new ef],ek=new ef,eV=new ez,eH=new ef,eG=new ef,eW=new ef,ej=new ef,eX=new ef,eq=new ef,eY=new ef,eZ=new ef,eJ=new ef,eK=new ef;function e$(e,t,n,i,r){for(let a=0,s=e.length-3;a<=s;a+=3){eK.fromArray(e,a);let s=r.x*Math.abs(eK.x)+r.y*Math.abs(eK.y)+r.z*Math.abs(eK.z),o=t.dot(eK),l=n.dot(eK),u=i.dot(eK);if(Math.max(-Math.max(o,l,u),Math.min(o,l,u))>s)return!1}return!0}let eQ=new ez,e0=new ef,e1=new ef;class e2{constructor(e=new ef,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;void 0!==t?n.copy(t):eQ.setFromPoints(e).getCenter(n);let i=0;for(let t=0,r=e.length;t this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?e.makeEmpty():(e.set(this.center,this.center),e.expandByScalar(this.radius)),e}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;e0.subVectors(e,this.center);let t=e0.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(e0,n/e),this.radius+=n}return this}union(e){return e.isEmpty()||(this.isEmpty()?this.copy(e):!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(e1.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(e0.copy(e.center).add(e1)),this.expandByPoint(e0.copy(e.center).sub(e1)))),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let e3=new ef,e4=new ef,e5=new ef,e6=new ef,e8=new ef,e9=new ef,e7=new ef;class te{constructor(e=new ef,t=new ef(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,e3)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=e3.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(e3.copy(this.origin).addScaledVector(this.direction,t),e3.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){let r,a,s,o;e4.copy(e).add(t).multiplyScalar(.5),e5.copy(t).sub(e).normalize(),e6.copy(this.origin).sub(e4);let l=.5*e.distanceTo(t),u=-this.direction.dot(e5),c=e6.dot(this.direction),h=-e6.dot(e5),d=e6.lengthSq(),p=Math.abs(1-u*u);if(p>0)if(r=u*h-c,a=u*c-h,o=l*p,r>=0)if(a>=-o)if(a<=o){let e=1/p;r*=e,a*=e,s=r*(r+u*a+2*c)+a*(u*r+a+2*h)+d}else s=-(r=Math.max(0,-(u*(a=l)+c)))*r+a*(a+2*h)+d;else s=-(r=Math.max(0,-(u*(a=-l)+c)))*r+a*(a+2*h)+d;else a<=-o?(a=(r=Math.max(0,-(-u*l+c)))>0?-l:Math.min(Math.max(-l,-h),l),s=-r*r+a*(a+2*h)+d):a<=o?(r=0,s=(a=Math.min(Math.max(-l,-h),l))*(a+2*h)+d):(a=(r=Math.max(0,-(u*l+c)))>0?l:Math.min(Math.max(-l,-h),l),s=-r*r+a*(a+2*h)+d);else a=u>0?-l:l,s=-(r=Math.max(0,-(u*a+c)))*r+a*(a+2*h)+d;return n&&n.copy(this.origin).addScaledVector(this.direction,r),i&&i.copy(e4).addScaledVector(e5,a),s}intersectSphere(e,t){e3.subVectors(e.center,this.origin);let n=e3.dot(this.direction),i=e3.dot(e3)-n*n,r=e.radius*e.radius;if(i>r)return null;let a=Math.sqrt(r-i),s=n-a,o=n+a;return o<0?null:s<0?this.at(o,t):this.at(s,t)}intersectsSphere(e){return!(e.radius<0)&&this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return!!(0===t||e.normal.dot(this.direction)*t<0)}intersectBox(e,t){let n,i,r,a,s,o,l=1/this.direction.x,u=1/this.direction.y,c=1/this.direction.z,h=this.origin;return(l>=0?(n=(e.min.x-h.x)*l,i=(e.max.x-h.x)*l):(n=(e.max.x-h.x)*l,i=(e.min.x-h.x)*l),u>=0?(r=(e.min.y-h.y)*u,a=(e.max.y-h.y)*u):(r=(e.max.y-h.y)*u,a=(e.min.y-h.y)*u),n>a||r>i||((r>n||isNaN(n))&&(n=r),(a=0?(s=(e.min.z-h.z)*c,o=(e.max.z-h.z)*c):(s=(e.max.z-h.z)*c,o=(e.min.z-h.z)*c),n>o||s>i||((s>n||n!=n)&&(n=s),(o=0?n:i,t)}intersectsBox(e){return null!==this.intersectBox(e,e3)}intersectTriangle(e,t,n,i,r){let a;e8.subVectors(t,e),e9.subVectors(n,e),e7.crossVectors(e8,e9);let s=this.direction.dot(e7);if(s>0){if(i)return null;a=1}else{if(!(s<0))return null;a=-1,s=-s}e6.subVectors(this.origin,e);let o=a*this.direction.dot(e9.crossVectors(e6,e9));if(o<0)return null;let l=a*this.direction.dot(e8.cross(e6));if(l<0||o+l>s)return null;let u=-a*e6.dot(e7);return u<0?null:this.at(u/s,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class tt{constructor(e,t,n,i,r,a,s,o,l,u,c,h,d,p,f,m){tt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,n,i,r,a,s,o,l,u,c,h,d,p,f,m)}set(e,t,n,i,r,a,s,o,l,u,c,h,d,p,f,m){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=r,g[5]=a,g[9]=s,g[13]=o,g[2]=l,g[6]=u,g[10]=c,g[14]=h,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new tt().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return 0===this.determinant()?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1)):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2)),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(0===e.determinant())return this.identity();let t=this.elements,n=e.elements,i=1/tn.setFromMatrixColumn(e,0).length(),r=1/tn.setFromMatrixColumn(e,1).length(),a=1/tn.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,i=e.y,r=e.z,a=Math.cos(n),s=Math.sin(n),o=Math.cos(i),l=Math.sin(i),u=Math.cos(r),c=Math.sin(r);if("XYZ"===e.order){let e=a*u,n=a*c,i=s*u,r=s*c;t[0]=o*u,t[4]=-o*c,t[8]=l,t[1]=n+i*l,t[5]=e-r*l,t[9]=-s*o,t[2]=r-e*l,t[6]=i+n*l,t[10]=a*o}else if("YXZ"===e.order){let e=o*u,n=o*c,i=l*u,r=l*c;t[0]=e+r*s,t[4]=i*s-n,t[8]=a*l,t[1]=a*c,t[5]=a*u,t[9]=-s,t[2]=n*s-i,t[6]=r+e*s,t[10]=a*o}else if("ZXY"===e.order){let e=o*u,n=o*c,i=l*u,r=l*c;t[0]=e-r*s,t[4]=-a*c,t[8]=i+n*s,t[1]=n+i*s,t[5]=a*u,t[9]=r-e*s,t[2]=-a*l,t[6]=s,t[10]=a*o}else if("ZYX"===e.order){let e=a*u,n=a*c,i=s*u,r=s*c;t[0]=o*u,t[4]=i*l-n,t[8]=e*l+r,t[1]=o*c,t[5]=r*l+e,t[9]=n*l-i,t[2]=-l,t[6]=s*o,t[10]=a*o}else if("YZX"===e.order){let e=a*o,n=a*l,i=s*o,r=s*l;t[0]=o*u,t[4]=r-e*c,t[8]=i*c+n,t[1]=c,t[5]=a*u,t[9]=-s*u,t[2]=-l*u,t[6]=n*c+i,t[10]=e-r*c}else if("XZY"===e.order){let e=a*o,n=a*l,i=s*o,r=s*l;t[0]=o*u,t[4]=-c,t[8]=l*u,t[1]=e*c+r,t[5]=a*u,t[9]=n*c-i,t[2]=i*c-n,t[6]=s*u,t[10]=r*c+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(tr,e,ta)}lookAt(e,t,n){let i=this.elements;return tl.subVectors(e,t),0===tl.lengthSq()&&(tl.z=1),tl.normalize(),ts.crossVectors(n,tl),0===ts.lengthSq()&&(1===Math.abs(n.z)?tl.x+=1e-4:tl.z+=1e-4,tl.normalize(),ts.crossVectors(n,tl)),ts.normalize(),to.crossVectors(tl,ts),i[0]=ts.x,i[4]=to.x,i[8]=tl.x,i[1]=ts.y,i[5]=to.y,i[9]=tl.y,i[2]=ts.z,i[6]=to.z,i[10]=tl.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,r=this.elements,a=n[0],s=n[4],o=n[8],l=n[12],u=n[1],c=n[5],h=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],_=n[7],y=n[11],x=n[15],b=i[0],S=i[4],M=i[8],T=i[12],w=i[1],E=i[5],A=i[9],C=i[13],R=i[2],P=i[6],I=i[10],L=i[14],N=i[3],U=i[7],D=i[11],O=i[15];return r[0]=a*b+s*w+o*R+l*N,r[4]=a*S+s*E+o*P+l*U,r[8]=a*M+s*A+o*I+l*D,r[12]=a*T+s*C+o*L+l*O,r[1]=u*b+c*w+h*R+d*N,r[5]=u*S+c*E+h*P+d*U,r[9]=u*M+c*A+h*I+d*D,r[13]=u*T+c*C+h*L+d*O,r[2]=p*b+f*w+m*R+g*N,r[6]=p*S+f*E+m*P+g*U,r[10]=p*M+f*A+m*I+g*D,r[14]=p*T+f*C+m*L+g*O,r[3]=v*b+_*w+y*R+x*N,r[7]=v*S+_*E+y*P+x*U,r[11]=v*M+_*A+y*I+x*D,r[15]=v*T+_*C+y*L+x*O,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],a=e[1],s=e[5],o=e[9],l=e[13],u=e[2],c=e[6],h=e[10],d=e[14],p=e[3],f=e[7],m=e[11],g=e[15],v=o*d-l*h,_=s*d-l*c,y=s*h-o*c,x=a*d-l*u,b=a*h-o*u,S=a*c-s*u;return t*(f*v-m*_+g*y)-n*(p*v-m*x+g*b)+i*(p*_-f*x+g*S)-r*(p*y-f*b+m*S)}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(e,t,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],u=e[8],c=e[9],h=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15],v=c*m*l-f*h*l+f*o*d-s*m*d-c*o*g+s*h*g,_=p*h*l-u*m*l-p*o*d+a*m*d+u*o*g-a*h*g,y=u*f*l-p*c*l+p*s*d-a*f*d-u*s*g+a*c*g,x=p*c*o-u*f*o-p*s*h+a*f*h+u*s*m-a*c*m,b=t*v+n*_+i*y+r*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/b;return e[0]=v*S,e[1]=(f*h*r-c*m*r-f*i*d+n*m*d+c*i*g-n*h*g)*S,e[2]=(s*m*r-f*o*r+f*i*l-n*m*l-s*i*g+n*o*g)*S,e[3]=(c*o*r-s*h*r-c*i*l+n*h*l+s*i*d-n*o*d)*S,e[4]=_*S,e[5]=(u*m*r-p*h*r+p*i*d-t*m*d-u*i*g+t*h*g)*S,e[6]=(p*o*r-a*m*r-p*i*l+t*m*l+a*i*g-t*o*g)*S,e[7]=(a*h*r-u*o*r+u*i*l-t*h*l-a*i*d+t*o*d)*S,e[8]=y*S,e[9]=(p*c*r-u*f*r-p*n*d+t*f*d+u*n*g-t*c*g)*S,e[10]=(a*f*r-p*s*r+p*n*l-t*f*l-a*n*g+t*s*g)*S,e[11]=(u*s*r-a*c*r-u*n*l+t*c*l+a*n*d-t*s*d)*S,e[12]=x*S,e[13]=(u*f*i-p*c*i+p*n*h-t*f*h-u*n*m+t*c*m)*S,e[14]=(p*s*i-a*f*i-p*n*o+t*f*o+a*n*m-t*s*m)*S,e[15]=(a*c*i-u*s*i+u*n*o-t*c*o-a*n*h+t*s*h)*S,this}scale(e){let t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,this}getMaxScaleOnAxis(){let e=this.elements;return Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1]+e[2]*e[2],e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e[8]*e[8]+e[9]*e[9]+e[10]*e[10]))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),r=1-n,a=e.x,s=e.y,o=e.z,l=r*a,u=r*s;return this.set(l*a+n,l*s-i*o,l*o+i*s,0,l*s+i*o,u*s+n,u*o-i*a,0,l*o-i*s,u*o+i*a,r*o*o+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,r,a){return this.set(1,n,r,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,r=t._x,a=t._y,s=t._z,o=t._w,l=r+r,u=a+a,c=s+s,h=r*l,d=r*u,p=r*c,f=a*u,m=a*c,g=s*c,v=o*l,_=o*u,y=o*c,x=n.x,b=n.y,S=n.z;return i[0]=(1-(f+g))*x,i[1]=(d+y)*x,i[2]=(p-_)*x,i[3]=0,i[4]=(d-y)*b,i[5]=(1-(h+g))*b,i[6]=(m+v)*b,i[7]=0,i[8]=(p+_)*S,i[9]=(m-v)*S,i[10]=(1-(h+f))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements;if(e.x=i[12],e.y=i[13],e.z=i[14],0===this.determinant())return n.set(1,1,1),t.identity(),this;let r=tn.set(i[0],i[1],i[2]).length(),a=tn.set(i[4],i[5],i[6]).length(),s=tn.set(i[8],i[9],i[10]).length();0>this.determinant()&&(r=-r),ti.copy(this);let o=1/r,l=1/a,u=1/s;return ti.elements[0]*=o,ti.elements[1]*=o,ti.elements[2]*=o,ti.elements[4]*=l,ti.elements[5]*=l,ti.elements[6]*=l,ti.elements[8]*=u,ti.elements[9]*=u,ti.elements[10]*=u,t.setFromRotationMatrix(ti),n.x=r,n.y=a,n.z=s,this}makePerspective(e,t,n,i,r,a,s=2e3,o=!1){let l,u,c=this.elements;if(o)l=r/(a-r),u=a*r/(a-r);else if(2e3===s)l=-(a+r)/(a-r),u=-2*a*r/(a-r);else if(2001===s)l=-a/(a-r),u=-a*r/(a-r);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return c[0]=2*r/(t-e),c[4]=0,c[8]=(t+e)/(t-e),c[12]=0,c[1]=0,c[5]=2*r/(n-i),c[9]=(n+i)/(n-i),c[13]=0,c[2]=0,c[6]=0,c[10]=l,c[14]=u,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,i,r,a,s=2e3,o=!1){let l,u,c=this.elements;if(o)l=1/(a-r),u=a/(a-r);else if(2e3===s)l=-2/(a-r),u=-(a+r)/(a-r);else if(2001===s)l=-1/(a-r),u=-r/(a-r);else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return c[0]=2/(t-e),c[4]=0,c[8]=0,c[12]=-(t+e)/(t-e),c[1]=0,c[5]=2/(n-i),c[9]=0,c[13]=-(n+i)/(n-i),c[2]=0,c[6]=0,c[10]=l,c[14]=u,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}let tn=new ef,ti=new tt,tr=new ef(0,0,0),ta=new ef(1,1,1),ts=new ef,to=new ef,tl=new ef,tu=new tt,tc=new ep;class th{constructor(e=0,t=0,n=0,i=th.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,r=i[0],a=i[4],s=i[8],o=i[1],l=i[5],u=i[9],c=i[2],h=i[6],d=i[10];switch(t){case"XYZ":this._y=Math.asin(es(s,-1,1)),.9999999>Math.abs(s)?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-es(u,-1,1)),.9999999>Math.abs(u)?(this._y=Math.atan2(s,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-c,r),this._z=0);break;case"ZXY":this._x=Math.asin(es(h,-1,1)),.9999999>Math.abs(h)?(this._y=Math.atan2(-c,d),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-es(c,-1,1)),.9999999>Math.abs(c)?(this._x=Math.atan2(h,d),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(es(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-c,r)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-es(a,-1,1)),.9999999>Math.abs(a)?(this._x=Math.atan2(h,l),this._y=Math.atan2(s,r)):(this._x=Math.atan2(-u,d),this._y=0);break;default:J("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return tu.makeRotationFromQuaternion(e),this.setFromRotationMatrix(tu,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return tc.setFromEuler(this),this.setFromQuaternion(tc,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}th.DEFAULT_ORDER="XYZ";class td{constructor(){this.mask=1}set(e){this.mask=1< >>0}enable(e){this.mask|=1< 1){for(let e=0;e 1){for(let e=0;e 0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(e=>({...e})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),null!==this._colorsTexture&&(i.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(i.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(i.boundingBox=this.boundingBox.toJSON())),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(e.geometries,this.geometry);let t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){let n=t.shapes;if(Array.isArray(n))for(let t=0,i=n.length;t0){i.children=[];for(let t=0;t 0){i.animations=[];for(let t=0;t 0&&(n.geometries=t),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),s.length>0&&(n.images=s),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),u.length>0&&(n.animations=u),c.length>0&&(n.nodes=c)}return n.object=i,n;function a(e){let t=[];for(let n in e){let i=e[n];delete i.metadata,t.push(i)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t 0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(e,t,n,i,r){tR.subVectors(i,t),tP.subVectors(n,t),tI.subVectors(e,t);let a=tR.dot(tR),s=tR.dot(tP),o=tR.dot(tI),l=tP.dot(tP),u=tP.dot(tI),c=a*l-s*s;if(0===c)return r.set(0,0,0),null;let h=1/c,d=(l*o-s*u)*h,p=(a*u-s*o)*h;return r.set(1-d-p,p,d)}static containsPoint(e,t,n,i){return null!==this.getBarycoord(e,t,n,i,tL)&&tL.x>=0&&tL.y>=0&&tL.x+tL.y<=1}static getInterpolation(e,t,n,i,r,a,s,o){return null===this.getBarycoord(e,t,n,i,tL)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(r,tL.x),o.addScaledVector(a,tL.y),o.addScaledVector(s,tL.z),o)}static getInterpolatedAttribute(e,t,n,i,r,a){return tB.setScalar(0),tk.setScalar(0),tV.setScalar(0),tB.fromBufferAttribute(e,t),tk.fromBufferAttribute(e,n),tV.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(tB,r.x),a.addScaledVector(tk,r.y),a.addScaledVector(tV,r.z),a}static isFrontFacing(e,t,n,i){return tR.subVectors(n,t),tP.subVectors(e,t),0>tR.cross(tP).dot(i)}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return tR.subVectors(this.c,this.b),tP.subVectors(this.a,this.b),.5*tR.cross(tP).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return tH.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return tH.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,r){return tH.getInterpolation(e,this.a,this.b,this.c,t,n,i,r)}containsPoint(e){return tH.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return tH.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n,i,r=this.a,a=this.b,s=this.c;tN.subVectors(a,r),tU.subVectors(s,r),tO.subVectors(e,r);let o=tN.dot(tO),l=tU.dot(tO);if(o<=0&&l<=0)return t.copy(r);tF.subVectors(e,a);let u=tN.dot(tF),c=tU.dot(tF);if(u>=0&&c<=u)return t.copy(a);let h=o*c-u*l;if(h<=0&&o>=0&&u<=0)return n=o/(o-u),t.copy(r).addScaledVector(tN,n);tz.subVectors(e,s);let d=tN.dot(tz),p=tU.dot(tz);if(p>=0&&d<=p)return t.copy(s);let f=d*l-o*p;if(f<=0&&l>=0&&p<=0)return i=l/(l-p),t.copy(r).addScaledVector(tU,i);let m=u*p-d*c;if(m<=0&&c-u>=0&&d-p>=0)return tD.subVectors(s,a),i=(c-u)/(c-u+(d-p)),t.copy(a).addScaledVector(tD,i);let g=1/(m+f+h);return n=f*g,i=h*g,t.copy(r).addScaledVector(tN,n).addScaledVector(tU,i)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let tG={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32},tW={h:0,s:0,l:0},tj={h:0,s:0,l:0};function tX(e,t,n){return(n<0&&(n+=1),n>1&&(n-=1),n<1/6)?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*6*(2/3-n):e}class tq{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){return void 0===t&&void 0===n?e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e):this.setRGB(e,t,n),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=I){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,eb.colorSpaceToWorking(this,t),this}setRGB(e,t,n,i=eb.workingColorSpace){return this.r=e,this.g=t,this.b=n,eb.colorSpaceToWorking(this,i),this}setHSL(e,t,n,i=eb.workingColorSpace){if(e=eo(e,1),t=es(t,0,1),n=es(n,0,1),0===t)this.r=this.g=this.b=n;else{let i=n<=.5?n*(1+t):n+t-n*t,r=2*n-i;this.r=tX(r,i,e+1/3),this.g=tX(r,i,e),this.b=tX(r,i,e-1/3)}return eb.colorSpaceToWorking(this,i),this}setStyle(e,t=I){let n;function i(t){void 0!==t&&1>parseFloat(t)&&J("Color: Alpha component of "+e+" will be ignored.")}if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let r,a=n[1],s=n[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:J("Color: Unknown color model "+e)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let i=n[1],r=i.length;if(3===r)return this.setRGB(parseInt(i.charAt(0),16)/15,parseInt(i.charAt(1),16)/15,parseInt(i.charAt(2),16)/15,t);if(6===r)return this.setHex(parseInt(i,16),t);J("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=I){let n=tG[e.toLowerCase()];return void 0!==n?this.setHex(n,t):J("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=eS(e.r),this.g=eS(e.g),this.b=eS(e.b),this}copyLinearToSRGB(e){return this.r=eM(e.r),this.g=eM(e.g),this.b=eM(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=I){return eb.workingToColorSpace(tY.copy(this),e),65536*Math.round(es(255*tY.r,0,255))+256*Math.round(es(255*tY.g,0,255))+Math.round(es(255*tY.b,0,255))}getHexString(e=I){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=eb.workingColorSpace){let n,i;eb.workingToColorSpace(tY.copy(this),t);let r=tY.r,a=tY.g,s=tY.b,o=Math.max(r,a,s),l=Math.min(r,a,s),u=(l+o)/2;if(l===o)n=0,i=0;else{let e=o-l;switch(i=u<=.5?e/(o+l):e/(2-o-l),o){case r:n=(a-s)/e+6*(a 0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(let t in e){let n=e[t];if(void 0===n){J(`Material: parameter '${t}' has value of undefined.`);continue}let i=this[t];if(void 0===i){J(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){let t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function i(e){let t=[];for(let n in e){let i=e[n];delete i.metadata,t.push(i)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),void 0!==this.dispersion&&(n.dispersion=this.dispersion),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),204!==this.blendSrc&&(n.blendSrc=this.blendSrc),205!==this.blendDst&&(n.blendDst=this.blendDst),100!==this.blendEquation&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),7680!==this.stencilFail&&(n.stencilFail=this.stencilFail),7680!==this.stencilZFail&&(n.stencilZFail=this.stencilZFail),7680!==this.stencilZPass&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!1===this.allowOverride&&(n.allowOverride=!1),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),t){let t=i(e.textures),r=i(e.images);t.length>0&&(n.textures=t),r.length>0&&(n.images=r)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(null!==t){let e=t.length;n=Array(e);for(let i=0;i!==e;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}class tK extends tJ{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new tq(0xffffff),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new th,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}let t$=function(){let e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),i=new Uint32Array(512),r=new Uint32Array(512);for(let e=0;e<256;++e){let t=e-127;t<-27?(i[e]=0,i[256|e]=32768,r[e]=24,r[256|e]=24):t<-14?(i[e]=1024>>-t-14,i[256|e]=1024>>-t-14|32768,r[e]=-t-1,r[256|e]=-t-1):t<=15?(i[e]=t+15<<10,i[256|e]=t+15<<10|32768,r[e]=13,r[256|e]=13):t<128?(i[e]=31744,i[256|e]=64512,r[e]=24,r[256|e]=24):(i[e]=31744,i[256|e]=64512,r[e]=13,r[256|e]=13)}let a=new Uint32Array(2048),s=new Uint32Array(64),o=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;(8388608&t)==0;)t<<=1,n-=8388608;t&=-8388609,n+=0x38800000,a[e]=t|n}for(let e=1024;e<2048;++e)a[e]=0x38000000+(e-1024<<13);for(let e=1;e<31;++e)s[e]=e<<23;s[31]=0x47800000,s[32]=0x80000000;for(let e=33;e<63;++e)s[e]=0x80000000+(e-32<<23);s[63]=0xc7800000;for(let e=1;e<64;++e)32!==e&&(o[e]=1024);return{floatView:t,uint32View:n,baseTable:i,shiftTable:r,mantissaTable:a,exponentTable:s,offsetTable:o}}();function tQ(e){Math.abs(e)>65504&&J("DataUtils.toHalfFloat(): Value out of range."),e=es(e,-65504,65504),t$.floatView[0]=e;let t=t$.uint32View[0],n=t>>23&511;return t$.baseTable[n]+((8388607&t)>>t$.shiftTable[n])}function t0(e){let t=e>>10;return t$.uint32View[0]=t$.mantissaTable[t$.offsetTable[t]+(1023&e)]+t$.exponentTable[t],t$.floatView[0]}class t1{static toHalfFloat(e){return tQ(e)}static fromHalfFloat(e){return t0(e)}}let t2=new ef,t3=new ed,t4=0;class t5{constructor(e,t,n=!1){if(Array.isArray(e))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:t4++}),this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=n,this.usage=35044,this.updateRanges=[],this.gpuType=1015,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,r=this.itemSize;it.count&&J("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new ez);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){K("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new ef(-1/0,-1/0,-1/0),new ef(Infinity,Infinity,Infinity));return}if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e 0&&(e.userData=this.userData),void 0!==this.parameters){let t=this.parameters;for(let n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let i=n[t];e.data.attributes[t]=i.toJSON(e.data)}let i={},r=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,i=n.length;t0&&(i[t]=a,r=!0)}r&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let s=this.boundingSphere;return null!==s&&(e.data.boundingSphere=s.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;null!==n&&this.setIndex(n.clone());let i=e.attributes;for(let e in i){let n=i[e];this.setAttribute(e,n.clone(t))}let r=e.morphAttributes;for(let e in r){let n=[],i=r[e];for(let e=0,r=i.length;e 0){let n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e (e.far-e.near)**2)||(np.copy(r).invert(),nf.copy(e.ray).applyMatrix4(np),(null===n.boundingBox||!1!==nf.intersectsBox(n.boundingBox))&&this._computeIntersections(e,t,nf)))}_computeIntersections(e,t,n){let i,r=this.geometry,a=this.material,s=r.index,o=r.attributes.position,l=r.attributes.uv,u=r.attributes.uv1,c=r.attributes.normal,h=r.groups,d=r.drawRange;if(null!==s)if(Array.isArray(a))for(let r=0,o=h.length;r n.far?null:{distance:l,point:nM.clone(),object:e}}(e,t,n,i,nv,n_,ny,nS);if(c){let e=new ef;tH.getBarycoord(nS,nv,n_,ny,e),r&&(c.uv=tH.getInterpolatedAttribute(r,o,l,u,e,new ed)),a&&(c.uv1=tH.getInterpolatedAttribute(a,o,l,u,e,new ed)),s&&(c.normal=tH.getInterpolatedAttribute(s,o,l,u,e,new ef),c.normal.dot(i.direction)>0&&c.normal.multiplyScalar(-1));let t={a:o,b:l,c:u,normal:new ef,materialIndex:0};tH.getNormal(nv,n_,ny,t.normal),c.face=t,c.barycoord=e}return c}class nE extends nd{constructor(e=1,t=1,n=1,i=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:r,depthSegments:a};const s=this;i=Math.floor(i),r=Math.floor(r);const o=[],l=[],u=[],c=[];let h=0,d=0;function p(e,t,n,i,r,a,p,f,m,g,v){let _=a/m,y=p/g,x=a/2,b=p/2,S=f/2,M=m+1,T=g+1,w=0,E=0,A=new ef;for(let a=0;a 0?1:-1,u.push(A.x,A.y,A.z),c.push(o/m),c.push(1-a/g),w+=1}}for(let e=0;e 0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let n={};for(let e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class nL extends tC{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new tt,this.projectionMatrix=new tt,this.projectionMatrixInverse=new tt,this.coordinateSystem=2e3,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}let nN=new ef,nU=new ed,nD=new ed;class nO extends nL{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=2*er*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(.5*ei*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*er*Math.atan(Math.tan(.5*ei*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){nN.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(nN.x,nN.y).multiplyScalar(-e/nN.z),nN.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(nN.x,nN.y).multiplyScalar(-e/nN.z)}getViewSize(e,t){return this.getViewBounds(e,nU,nD),t.subVectors(nD,nU)}setViewOffset(e,t,n,i,r,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(.5*ei*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i,a=this.view;if(null!==this.view&&this.view.enabled){let e=a.fullWidth,s=a.fullHeight;r+=a.offsetX*i/e,t-=a.offsetY*n/s,i*=a.width/e,n*=a.height/s}let s=this.filmOffset;0!==s&&(r+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-n,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}class nF extends tC{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new nO(-90,1,e,t);i.layers=this.layers,this.add(i);const r=new nO(-90,1,e,t);r.layers=this.layers,this.add(r);const a=new nO(-90,1,e,t);a.layers=this.layers,this.add(a);const s=new nO(-90,1,e,t);s.layers=this.layers,this.add(s);const o=new nO(-90,1,e,t);o.layers=this.layers,this.add(o);const l=new nO(-90,1,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,i,r,a,s,o]=t;for(let e of t)this.remove(e);if(2e3===e)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else if(2001===e)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1);else throw Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(let e of t)this.add(e),e.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[r,a,s,o,l,u]=this.children,c=e.getRenderTarget(),h=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let f=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,i),e.render(t,r),e.setRenderTarget(n,1,i),e.render(t,a),e.setRenderTarget(n,2,i),e.render(t,s),e.setRenderTarget(n,3,i),e.render(t,o),e.setRenderTarget(n,4,i),e.render(t,l),n.texture.generateMipmaps=f,e.setRenderTarget(n,5,i),e.render(t,u),e.setRenderTarget(c,h,d),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}}class nz extends eP{constructor(e=[],t=301,n,i,r,a,s,o,l,u){super(e,t,n,i,r,a,s,o,l,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class nB extends eN{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1};this.texture=new nz([n,n,n,n,n,n]),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},i=new nE(5,5,5),r=new nI({name:"CubemapFromEquirect",uniforms:nA(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=t;let a=new nT(i,r),s=t.minFilter;return 1008===t.minFilter&&(t.minFilter=1006),new nF(1,10,this).update(e,a),t.minFilter=s,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,i=!0){let r=e.getRenderTarget();for(let r=0;r<6;r++)e.setRenderTarget(this,r),e.clear(t,n,i);e.setRenderTarget(r)}}class nk extends tC{constructor(){super(),this.isGroup=!0,this.type="Group"}}let nV={type:"move"};class nH{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new nk,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new nk,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ef,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ef),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new nk,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ef,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ef),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let i=null,r=null,a=null,s=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){for(let i of(a=!0,e.hand.values())){let e=t.getJointPose(i,n),r=this._getHandJoint(l,i);null!==e&&(r.matrix.fromArray(e.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.matrixWorldNeedsUpdate=!0,r.jointRadius=e.radius),r.visible=null!==e}let i=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],s=i.position.distanceTo(r.position);l.inputState.pinching&&s>.025?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&s<=.015&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&null!==(r=t.getPose(e.gripSpace,n))&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1);null!==s&&(null===(i=t.getPose(e.targetRaySpace,n))&&null!==r&&(i=r),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(nV)))}return null!==s&&(s.visible=null!==i),null!==o&&(o.visible=null!==r),null!==l&&(l.visible=null!==a),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){let n=new nk;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class nG{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new tq(e),this.density=t}clone(){return new nG(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class nW{constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new tq(e),this.near=t,this.far=n}clone(){return new nW(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class nj extends tC{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new th,this.environmentIntensity=1,this.environmentRotation=new th,this.overrideMaterial=null,"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class nX{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=35044,this.updateRanges=[],this.version=0,this.uuid=ea()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,r=this.stride;i e.far||t.push({distance:o,point:nJ.clone(),uv:tH.getInterpolation(nJ,n2,n3,n4,n5,n6,n8,new ed),face:null,object:this})}copy(e,t){return super.copy(e,t),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}function n7(e,t,n,i,r,a){nQ.subVectors(e,n).addScalar(.5).multiply(i),void 0!==r?(n0.x=a*nQ.x-r*nQ.y,n0.y=r*nQ.x+a*nQ.y):n0.copy(nQ),e.copy(t),e.x+=n0.x,e.y+=n0.y,e.applyMatrix4(n1)}let ie=new ef,it=new ef;class ii extends tC{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let e=0,n=t.length;e 0){let n,i;for(n=1,i=t.length;n