quake2ts 0.0.301 → 0.0.303
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/client/dist/browser/index.global.js +13 -13
- package/packages/client/dist/browser/index.global.js.map +1 -1
- package/packages/client/dist/cjs/index.cjs +221 -38
- package/packages/client/dist/cjs/index.cjs.map +1 -1
- package/packages/client/dist/esm/index.js +221 -38
- package/packages/client/dist/esm/index.js.map +1 -1
- package/packages/client/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/client/dist/types/entities.d.ts +1 -0
- package/packages/client/dist/types/entities.d.ts.map +1 -1
- package/packages/engine/dist/browser/index.global.js +9 -9
- package/packages/engine/dist/browser/index.global.js.map +1 -1
- package/packages/engine/dist/cjs/index.cjs +90 -18
- package/packages/engine/dist/cjs/index.cjs.map +1 -1
- package/packages/engine/dist/esm/index.js +90 -18
- package/packages/engine/dist/esm/index.js.map +1 -1
- package/packages/engine/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/engine/dist/types/render/renderer.d.ts.map +1 -1
- package/packages/engine/dist/types/render/scene.d.ts +2 -0
- package/packages/engine/dist/types/render/scene.d.ts.map +1 -1
- package/packages/game/dist/browser/index.global.js +4 -4
- package/packages/game/dist/browser/index.global.js.map +1 -1
- package/packages/game/dist/cjs/index.cjs +104 -19
- package/packages/game/dist/cjs/index.cjs.map +1 -1
- package/packages/game/dist/esm/index.js +104 -19
- package/packages/game/dist/esm/index.js.map +1 -1
- package/packages/game/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/game/dist/types/ai/monster.d.ts.map +1 -1
- package/packages/shared/dist/browser/index.global.js +1 -1
- package/packages/shared/dist/browser/index.global.js.map +1 -1
- package/packages/shared/dist/cjs/index.cjs +97 -19
- package/packages/shared/dist/cjs/index.cjs.map +1 -1
- package/packages/shared/dist/esm/index.js +97 -19
- package/packages/shared/dist/esm/index.js.map +1 -1
- package/packages/shared/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/shared/dist/types/net/netchan.d.ts +5 -0
- package/packages/shared/dist/types/net/netchan.d.ts.map +1 -1
- package/packages/tools/dist/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monster.d.ts","sourceRoot":"","sources":["../../../src/ai/monster.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAe,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"monster.d.ts","sourceRoot":"","sources":["../../../src/ai/monster.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAe,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAM1D,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,IAAI,CAyCrE;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,IAAI,CAyBvE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var Quake2Shared=(()=>{var Ze=Object.defineProperty;var wn=Object.getOwnPropertyDescriptor;var Ln=Object.getOwnPropertyNames;var Fn=Object.prototype.hasOwnProperty;var qe=(t,e)=>{for(var n in e)Ze(t,n,{get:e[n],enumerable:!0})},zn=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ln(e))!Fn.call(t,r)&&r!==n&&Ze(t,r,{get:()=>e[r],enumerable:!(o=wn(e,r))||o.enumerable});return t};var Dn=t=>zn(Ze({},"__esModule",{value:!0}),t);var Ni={};qe(Ni,{AMMO_MAX:()=>Ke,AMMO_TYPE_COUNT:()=>Ai,ANORMS:()=>j,ATTN_IDLE:()=>yl,ATTN_LOOP_NONE:()=>pl,ATTN_NONE:()=>xl,ATTN_NORM:()=>hl,ATTN_STATIC:()=>bl,AmmoItemId:()=>On,AmmoType:()=>Lt,BinaryStream:()=>Mt,BinaryWriter:()=>Ee,CGAME_EXPORT_KEYS:()=>lr,CGAME_IMPORT_KEYS:()=>cr,CMD_BACKUP:()=>Ns,CONTENTS_AREAPORTAL:()=>ki,CONTENTS_AUX:()=>Di,CONTENTS_CURRENT_0:()=>po,CONTENTS_CURRENT_180:()=>ho,CONTENTS_CURRENT_270:()=>yo,CONTENTS_CURRENT_90:()=>xo,CONTENTS_CURRENT_DOWN:()=>To,CONTENTS_CURRENT_UP:()=>bo,CONTENTS_DEADMONSTER:()=>Yi,CONTENTS_DETAIL:()=>ji,CONTENTS_LADDER:()=>It,CONTENTS_LAVA:()=>Ui,CONTENTS_MIST:()=>Gi,CONTENTS_MONSTER:()=>Ji,CONTENTS_MONSTERCLIP:()=>Ki,CONTENTS_NONE:()=>Me,CONTENTS_NO_WATERJUMP:()=>mo,CONTENTS_ORIGIN:()=>Xi,CONTENTS_PLAYER:()=>qi,CONTENTS_PLAYERCLIP:()=>Hi,CONTENTS_PROJECTILE:()=>$i,CONTENTS_PROJECTILECLIP:()=>Wi,CONTENTS_SLIME:()=>Bi,CONTENTS_SOLID:()=>Fi,CONTENTS_TRANSLUCENT:()=>Zi,CONTENTS_TRIGGER:()=>fo,CONTENTS_WATER:()=>Ii,CONTENTS_WINDOW:()=>zi,CS_MAX_STRING_LENGTH:()=>Ua,CS_MAX_STRING_LENGTH_OLD:()=>Ba,ClientCommand:()=>Sn,CollisionEntityIndex:()=>ot,ConfigStringIndex:()=>ue,CvarFlags:()=>jt,DEFAULT_FORWARD_SPEED:()=>xs,DEFAULT_MOUSE_SENSITIVITY:()=>Ss,DEFAULT_PITCH_SPEED:()=>Ts,DEFAULT_SIDE_SPEED:()=>hs,DEFAULT_UP_SPEED:()=>ys,DEFAULT_YAW_SPEED:()=>bs,DEG2RAD:()=>to,DIST_EPSILON:()=>Z,EntityFlags:()=>Ot,GAME_EXPORT_KEYS:()=>ar,GAME_IMPORT_KEYS:()=>ir,G_GetAmmoStat:()=>Ys,G_GetPowerupStat:()=>Zs,G_SetAmmoStat:()=>Js,G_SetPowerupStat:()=>js,LAST_VISIBLE_CONTENTS:()=>Qi,LayoutFlags:()=>_n,MASK_ALL:()=>pa,MASK_BLOCK_SIGHT:()=>Sa,MASK_CURRENT:()=>So,MASK_DEADSOLID:()=>ha,MASK_LADDER_NAV_SOLID:()=>_a,MASK_MONSTERSOLID:()=>ya,MASK_NAV_SOLID:()=>ga,MASK_OPAQUE:()=>ba,MASK_PLAYERSOLID:()=>xa,MASK_PROJECTILE:()=>Ea,MASK_SHOT:()=>Ta,MASK_SOLID:()=>et,MASK_WALK_NAV_SOLID:()=>Aa,MASK_WATER:()=>Pe,MAX_CHALLENGES:()=>Es,MAX_CLIENTS:()=>Ho,MAX_CONFIGSTRINGS:()=>$o,MAX_EDICTS:()=>Da,MAX_GENERAL:()=>Zo,MAX_IMAGES:()=>Yo,MAX_INFO_STRING:()=>Cs,MAX_ITEMS:()=>jo,MAX_LIGHTSTYLES:()=>Ko,MAX_MODELS:()=>Xo,MAX_MSGLEN:()=>Os,MAX_OSPATH:()=>za,MAX_PACKET_ENTITIES:()=>vs,MAX_QPATH:()=>Fa,MAX_SHADOW_LIGHTS:()=>qo,MAX_SOUNDS:()=>Jo,MAX_SOUND_CHANNELS:()=>ml,MAX_STRING_CHARS:()=>Pa,MAX_STRING_TOKENS:()=>wa,MAX_TOKEN_CHARS:()=>La,MAX_WHEEL_ITEMS:()=>ct,MZ_BFG:()=>Ws,MZ_BLASTER:()=>Rs,MZ_CHAINGUN1:()=>ws,MZ_CHAINGUN2:()=>Ls,MZ_CHAINGUN3:()=>Fs,MZ_GRENADE:()=>Us,MZ_HYPERBLASTER:()=>ks,MZ_LOGIN:()=>Bs,MZ_LOGOUT:()=>Is,MZ_MACHINEGUN:()=>Ms,MZ_RAILGUN:()=>zs,MZ_ROCKET:()=>Ds,MZ_SHOTGUN:()=>Ps,MZ_SSHOTGUN:()=>Gs,MersenneTwister19937:()=>Oe,NUM_AMMO_STATS:()=>Ks,NUM_BITS_FOR_AMMO:()=>Xe,NUM_BITS_FOR_POWERUP:()=>Ye,NUM_POWERUP_STATS:()=>Xs,NetChan:()=>wt,NetworkMessageBuilder:()=>Pt,PITCH:()=>Ne,POWERUP_MAX:()=>Je,PlaneSide:()=>Wt,PlayerButton:()=>ie,PlayerStat:()=>vn,PmFlag:()=>q,PmType:()=>se,PowerupId:()=>En,RAD2DEG:()=>no,ROLL:()=>Qe,RandomGenerator:()=>Re,RenderFx:()=>Nn,Replay:()=>lt,SLIDEMOVE_BLOCKED_FLOOR:()=>on,SLIDEMOVE_BLOCKED_WALL:()=>rn,SOUND_FULLVOLUME:()=>Tl,SOUND_LOOP_ATTENUATE:()=>Sl,STOP_EPSILON:()=>Q,SURF_ALPHATEST:()=>la,SURF_FLOWING:()=>aa,SURF_LIGHT:()=>ta,SURF_N64_SCROLL_FLIP:()=>ma,SURF_N64_SCROLL_X:()=>da,SURF_N64_SCROLL_Y:()=>fa,SURF_N64_UV:()=>ua,SURF_NODRAW:()=>ca,SURF_NONE:()=>ea,SURF_SKY:()=>oa,SURF_SLICK:()=>na,SURF_TRANS33:()=>sa,SURF_TRANS66:()=>ia,SURF_WARP:()=>ra,ServerCommand:()=>Tn,SoundChannel:()=>Rn,TempEntity:()=>gn,UPDATE_BACKUP:()=>Vs,WEAPON_AMMO_MAP:()=>vi,WEAPON_WHEEL_ORDER:()=>Ei,WaterLevel:()=>de,WeaponId:()=>Cn,YAW:()=>Ce,ZERO_VEC3:()=>P,addBlendColor:()=>io,addContents:()=>Ao,addPmFlag:()=>G,addPointToBounds:()=>Jn,addVec3:()=>O,addViewAngles:()=>_s,angleMod:()=>xe,angleVectors:()=>oe,applyPmove:()=>_i,applyPmoveAccelerate:()=>Y,applyPmoveAddCurrents:()=>be,applyPmoveAirAccelerate:()=>bt,applyPmoveAirMove:()=>xt,applyPmoveFlyMove:()=>qr,applyPmoveFriction:()=>We,applyPmoveWalkMove:()=>yt,applyPmoveWaterMove:()=>ht,assertContract:()=>sr,attenuationToDistanceMultiplier:()=>Mn,boxContents:()=>Do,boxOnPlaneSide:()=>Po,boxesIntersect:()=>Yn,buildAirGroundWish:()=>St,buildCollisionModel:()=>Ro,buildWaterWish:()=>gt,calculateMaxAudibleDistance:()=>Vi,categorizePosition:()=>Be,checkDuckState:()=>Tt,checkJump:()=>dt,checkSpecialMovement:()=>cs,clampViewAngles:()=>ps,clipBoxToBrush:()=>st,clipVelocityAgainstPlanes:()=>jn,clipVelocityVec3:()=>ne,closestPointToBox:()=>Hn,combineSurfaceFlags:()=>Vo,computePlaneSignBits:()=>rt,computePlayerDimensions:()=>Ge,concatRotationMatrices:()=>$e,configStringSize:()=>Qo,copyVec3:()=>Bn,crc8:()=>Qs,createDefaultTrace:()=>Fe,createEmptyBounds3:()=>Xn,createMat4Identity:()=>Bt,createRandomGenerator:()=>ao,crossVec3:()=>te,currentVectorFromContents:()=>mt,degToRad:()=>ve,disableTraceDebug:()=>Co,distance:()=>Wn,distanceBetweenBoxesSquared:()=>Kn,dotVec3:()=>U,enableTraceDebug:()=>No,fixStuckObjectGeneric:()=>At,getWaterLevel:()=>Se,goodPosition:()=>vt,groundCurrentVelocity:()=>tn,hasAllContents:()=>go,hasAnyContents:()=>_o,hasPmFlag:()=>z,hasSurfaceFlags:()=>vo,inPHS:()=>Bo,inPVS:()=>Uo,initialSnapPosition:()=>ds,isAtLeastWaistDeep:()=>ut,isUnderwater:()=>ur,lengthSquaredVec3:()=>ce,lengthVec3:()=>I,lerpAngle:()=>oo,mat4FromBasis:()=>uo,mouseDeltaToViewDelta:()=>As,multiplyMat4:()=>co,multiplyVec3:()=>In,negateVec3:()=>Gn,normalizeVec3:()=>w,perpendicularVec3:()=>zt,planeDistanceToPoint:()=>re,pmoveCmdScale:()=>kr,pointContents:()=>Fo,pointContentsMany:()=>zo,pointInsideBrush:()=>kt,pointOnPlaneSide:()=>Mo,projectPointOnPlane:()=>Ft,projectSourceVec3:()=>qn,projectSourceVec3WithUp:()=>$n,radToDeg:()=>Ve,removeContents:()=>Eo,removePmFlag:()=>X,resolveSlideMove:()=>sn,rotatePointAroundVector:()=>eo,runPmove:()=>Hr,scaleVec3:()=>R,slerpVec3:()=>Qn,slideClipVelocityVec3:()=>Zn,slideMove:()=>pt,snapPosition:()=>us,stepSlideMove:()=>ae,subtractVec3:()=>ee,testBoxInBrush:()=>Ht,traceBox:()=>Yt,traceDebugInfo:()=>J,transformPointMat4:()=>lo,validateContract:()=>Zt,vec3Equals:()=>kn,vectorToAngles:()=>so,vectorToYaw:()=>ro,waterCurrentVelocity:()=>en,writeUserCommand:()=>qs});var P={x:0,y:0,z:0},Q=.1,Un=Math.PI/180;function Bn(t){return{x:t.x,y:t.y,z:t.z}}function O(t,e){return{x:t.x+e.x,y:t.y+e.y,z:t.z+e.z}}function ee(t,e){return{x:t.x-e.x,y:t.y-e.y,z:t.z-e.z}}function In(t,e){return{x:t.x*e.x,y:t.y*e.y,z:t.z*e.z}}function R(t,e){return{x:t.x*e,y:t.y*e,z:t.z*e}}function Gn(t){return R(t,-1)}function U(t,e){return t.x*e.x+t.y*e.y+t.z*e.z}function te(t,e){return{x:t.y*e.z-t.z*e.y,y:t.z*e.x-t.x*e.z,z:t.x*e.y-t.y*e.x}}function ce(t){return U(t,t)}function I(t){return Math.sqrt(ce(t))}function Wn(t,e){return I(ee(t,e))}function kn(t,e){return t.x===e.x&&t.y===e.y&&t.z===e.z}function w(t){let e=I(t);return e===0?t:R(t,1/e)}function Ft(t,e){let n=1/U(e,e),o=U(e,t)*n;return ee(t,R(e,n*o))}function zt(t){let e=0,n=Math.abs(t.x);return Math.abs(t.y)<n&&(e=1,n=Math.abs(t.y)),Math.abs(t.z)<n&&(e=2),w(Ft(e===0?{x:1,y:0,z:0}:e===1?{x:0,y:1,z:0}:{x:0,y:0,z:1},t))}function Hn(t,e,n){return{x:t.x<e.x?e.x:t.x>n.x?n.x:t.x,y:t.y<e.y?e.y:t.y>n.y?n.y:t.y,z:t.z<e.z?e.z:t.z>n.z?n.z:t.z}}function Kn(t,e,n,o){let r=0;if(e.x<n.x){let s=e.x-n.x;r+=s*s}else if(t.x>o.x){let s=t.x-o.x;r+=s*s}if(e.y<n.y){let s=e.y-n.y;r+=s*s}else if(t.y>o.y){let s=t.y-o.y;r+=s*s}if(e.z<n.z){let s=e.z-n.z;r+=s*s}else if(t.z>o.z){let s=t.z-o.z;r+=s*s}return r}function Xn(){return{mins:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,z:Number.POSITIVE_INFINITY},maxs:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY,z:Number.NEGATIVE_INFINITY}}}function Jn(t,e){return{mins:{x:Math.min(e.mins.x,t.x),y:Math.min(e.mins.y,t.y),z:Math.min(e.mins.z,t.z)},maxs:{x:Math.max(e.maxs.x,t.x),y:Math.max(e.maxs.y,t.y),z:Math.max(e.maxs.z,t.z)}}}function Yn(t,e){return t.mins.x<=e.maxs.x&&t.maxs.x>=e.mins.x&&t.mins.y<=e.maxs.y&&t.maxs.y>=e.mins.y&&t.mins.z<=e.maxs.z&&t.maxs.z>=e.mins.z}function ne(t,e,n){let o=U(t,e)*n,r=t.x-e.x*o,s=t.y-e.y*o,i=t.z-e.z*o;return r>-Q&&r<Q&&(r=0),s>-Q&&s<Q&&(s=0),i>-Q&&i<Q&&(i=0),{x:r,y:s,z:i}}function jn(t,e,n,o){if(e.length===0)return t;let r=t;for(let s=0;s<e.length;s++){r=ne(r,e[s],n);let i=0;for(;i<e.length&&!(i!==s&&U(r,e[i])<0);i++);if(i===e.length)return o&&U(r,o)<=0?P:r}if(e.length===2){let s=te(e[0],e[1]),i=U(s,t),a=R(s,i);return o&&U(a,o)<=0?P:a}return o&&U(r,o)<=0,P}function Zn(t,e,n){return ne(t,e,n)}function qn(t,e,n,o){return{x:t.x+n.x*e.x+o.x*e.y,y:t.y+n.y*e.x+o.y*e.y,z:t.z+n.z*e.x+o.z*e.y+e.z}}function $n(t,e,n,o,r){return{x:t.x+n.x*e.x+o.x*e.y+r.x*e.z,y:t.y+n.y*e.x+o.y*e.y+r.y*e.z,z:t.z+n.z*e.x+o.z*e.y+r.z*e.z}}function Qn(t,e,n){let o=U(t,e),r,s;if(Math.abs(o)>.9995)r=1-n,s=n;else{let i=Math.acos(o),a=Math.sin(i),l=Math.sin((1-n)*i),d=Math.sin(n*i);r=l/a,s=d/a}return{x:t.x*r+e.x*s,y:t.y*r+e.y*s,z:t.z*r+e.z*s}}function $e(t,e){let n=r=>[t[r][0]*e[0][0]+t[r][1]*e[1][0]+t[r][2]*e[2][0],t[r][0]*e[0][1]+t[r][1]*e[1][1]+t[r][2]*e[2][1],t[r][0]*e[0][2]+t[r][1]*e[1][2]+t[r][2]*e[2][2]];return[n(0),n(1),n(2)]}function eo(t,e,n){if(I(t)===0)return e;let r=w(t),s=zt(r),i=te(s,r),a=[[s.x,i.x,r.x],[s.y,i.y,r.y],[s.z,i.z,r.z]],l=[[a[0][0],a[1][0],a[2][0]],[a[0][1],a[1][1],a[2][1]],[a[0][2],a[1][2],a[2][2]]],d=n*Un,f=Math.cos(d),c=Math.sin(d),m=[[f,c,0],[-c,f,0],[0,0,1]],h=$e($e(a,m),l);return{x:h[0][0]*e.x+h[0][1]*e.y+h[0][2]*e.z,y:h[1][0]*e.x+h[1][1]*e.y+h[1][2]*e.z,z:h[2][0]*e.x+h[2][1]*e.y+h[2][2]*e.z}}var Ne=0,Ce=1,Qe=2,Dt=Math.PI/180,Ut=180/Math.PI,to=Dt,no=Ut;function pe(t,e){switch(e){case Ne:return t.x;case Ce:return t.y;case Qe:default:return t.z}}function ve(t){return t*Dt}function Ve(t){return t*Ut}function oo(t,e,n){let o=e;return o-t>180?o-=360:o-t<-180&&(o+=360),t+n*(o-t)}function xe(t){let e=t%360;return e<0?360+e:e}function oe(t){let e=ve(pe(t,Ce)),n=ve(pe(t,Ne)),o=ve(pe(t,Qe)),r=Math.sin(e),s=Math.cos(e),i=Math.sin(n),a=Math.cos(n),l=Math.sin(o),d=Math.cos(o),f={x:a*s,y:a*r,z:-i},c={x:-l*i*s-d*-r,y:-l*i*r-d*s,z:-l*a},m={x:d*i*s-l*-r,y:d*i*r-l*s,z:d*a};return{forward:f,right:c,up:m}}function ro(t){let e=pe(t,Ne),n=pe(t,Ce);if(e===0)return n===0?0:n>0?90:270;let o=Ve(Math.atan2(n,e));return o<0?o+360:o}function so(t){let e=t.x,n=t.y,o=t.z;if(n===0&&e===0)return{x:o>0?-90:-270,y:0,z:0};let r;e?r=Ve(Math.atan2(n,e)):n>0?r=90:r=270,r<0&&(r+=360);let s=Math.sqrt(e*e+n*n),i=Ve(Math.atan2(o,s));return i<0&&(i+=360),{x:-i,y:r,z:0}}var j=[[-.525731,0,.850651],[-.442863,.238856,.864188],[-.295242,0,.955423],[-.309017,.5,.809017],[-.16246,.262866,.951056],[0,0,1],[0,.850651,.525731],[-.147621,.716567,.681718],[.147621,.716567,.681718],[0,.525731,.850651],[.309017,.5,.809017],[.525731,0,.850651],[.295242,0,.955423],[.442863,.238856,.864188],[.16246,.262866,.951056],[-.681718,.147621,.716567],[-.809017,.309017,.5],[-.587785,.425325,.688191],[-.850651,.525731,0],[-.864188,.442863,.238856],[-.716567,.681718,.147621],[-.688191,.587785,.425325],[-.5,.809017,.309017],[-.238856,.864188,.442863],[-.425325,.688191,.587785],[-.716567,.681718,-.147621],[-.5,.809017,-.309017],[-.525731,.850651,0],[0,.850651,-.525731],[-.238856,.864188,-.442863],[0,.955423,-.295242],[-.262866,.951056,-.16246],[0,1,0],[0,.955423,.295242],[-.262866,.951056,.16246],[.238856,.864188,.442863],[.262866,.951056,.16246],[.5,.809017,.309017],[.238856,.864188,-.442863],[.262866,.951056,-.16246],[.5,.809017,-.309017],[.850651,.525731,0],[.716567,.681718,.147621],[.716567,.681718,-.147621],[.525731,.850651,0],[.425325,.688191,.587785],[.864188,.442863,.238856],[.688191,.587785,.425325],[.809017,.309017,.5],[.681718,.147621,.716567],[.587785,.425325,.688191],[.955423,.295242,0],[1,0,0],[.951056,.16246,.262866],[.850651,-.525731,0],[.955423,-.295242,0],[.864188,-.442863,.238856],[.951056,-.16246,.262866],[.809017,-.309017,.5],[.681718,-.147621,.716567],[.850651,0,.525731],[.864188,.442863,-.238856],[.809017,.309017,-.5],[.951056,.16246,-.262866],[.525731,0,-.850651],[.681718,.147621,-.716567],[.681718,-.147621,-.716567],[.850651,0,-.525731],[.809017,-.309017,-.5],[.864188,-.442863,-.238856],[.951056,-.16246,-.262866],[.147621,.716567,-.681718],[.309017,.5,-.809017],[.425325,.688191,-.587785],[.442863,.238856,-.864188],[.587785,.425325,-.688191],[.688191,.587785,-.425325],[-.147621,.716567,-.681718],[-.309017,.5,-.809017],[0,.525731,-.850651],[-.525731,0,-.850651],[-.442863,.238856,-.864188],[-.295242,0,-.955423],[-.16246,.262866,-.951056],[0,0,-1],[.295242,0,-.955423],[.16246,.262866,-.951056],[-.442863,-.238856,-.864188],[-.309017,-.5,-.809017],[-.16246,-.262866,-.951056],[0,-.850651,-.525731],[-.147621,-.716567,-.681718],[.147621,-.716567,-.681718],[0,-.525731,-.850651],[.309017,-.5,-.809017],[.442863,-.238856,-.864188],[.16246,-.262866,-.951056],[.238856,-.864188,-.442863],[.5,-.809017,-.309017],[.425325,-.688191,-.587785],[.716567,-.681718,-.147621],[.688191,-.587785,-.425325],[.587785,-.425325,-.688191],[0,-.955423,-.295242],[0,-1,0],[.262866,-.951056,-.16246],[0,-.850651,.525731],[0,-.955423,.295242],[.238856,-.864188,.442863],[.262866,-.951056,.16246],[.5,-.809017,.309017],[.716567,-.681718,.147621],[.525731,-.850651,0],[-.238856,-.864188,-.442863],[-.5,-.809017,-.309017],[-.262866,-.951056,-.16246],[-.850651,-.525731,0],[-.716567,-.681718,-.147621],[-.716567,-.681718,.147621],[-.525731,-.850651,0],[-.5,-.809017,.309017],[-.238856,-.864188,.442863],[-.262866,-.951056,.16246],[-.864188,-.442863,.238856],[-.809017,-.309017,.5],[-.688191,-.587785,.425325],[-.681718,-.147621,.716567],[-.442863,-.238856,.864188],[-.587785,-.425325,.688191],[-.309017,-.5,.809017],[-.147621,-.716567,.681718],[-.425325,-.688191,.587785],[-.16246,-.262866,.951056],[.442863,-.238856,.864188],[.16246,-.262866,.951056],[.309017,-.5,.809017],[.147621,-.716567,.681718],[0,-.525731,.850651],[.425325,-.688191,.587785],[.587785,-.425325,.688191],[.688191,-.587785,.425325],[-.955423,.295242,0],[-.951056,.16246,.262866],[-1,0,0],[-.850651,0,.525731],[-.955423,-.295242,0],[-.951056,-.16246,.262866],[-.864188,.442863,-.238856],[-.951056,.16246,-.262866],[-.809017,.309017,-.5],[-.864188,-.442863,-.238856],[-.951056,-.16246,-.262866],[-.809017,-.309017,-.5],[-.681718,.147621,-.716567],[-.681718,-.147621,-.716567],[-.850651,0,-.525731],[-.688191,.587785,-.425325],[-.587785,.425325,-.688191],[-.425325,.688191,-.587785],[-.425325,-.688191,-.587785],[-.587785,-.425325,-.688191],[-.688191,-.587785,-.425325]];function io(t,e,n,o,r){if(o<=0)return r;let s=r[0],i=r[1],a=r[2],l=r[3],d=l+(1-l)*o;if(d<=0)return[0,0,0,0];let f=l/d,c=s*f+t*(1-f),m=i*f+e*(1-f),h=a*f+n*(1-f);return[c,m,h,d]}var Oe=class{constructor(e=5489){this.state=new Uint32Array(624);this.index=624;this.seed(e)}seed(e){this.state[0]=e>>>0;for(let n=1;n<624;n++){let o=this.state[n-1]^this.state[n-1]>>>30,r=Math.imul(o>>>0,1812433253)+n;this.state[n]=r>>>0}this.index=624}nextUint32(){this.index>=624&&this.twist();let e=this.state[this.index++];return e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0}twist(){for(let e=0;e<624;e++){let n=this.state[e]&2147483648|this.state[(e+1)%624]&2147483647,o=this.state[(e+397)%624]^n>>>1;(n&1)!==0&&(o^=2567483615),this.state[e]=o>>>0}this.index=0}getState(){return{index:this.index,state:Array.from(this.state)}}setState(e){if(e.state.length!==624)throw new Error(`Expected 624 MT state values, received ${e.state.length}`);this.index=e.index,this.state=Uint32Array.from(e.state,n=>n>>>0)}},Re=class{constructor(e={}){this.mt=new Oe(e.seed)}seed(e){this.mt.seed(e)}frandom(){return this.mt.nextUint32()/4294967296}frandomRange(e,n){return e+(n-e)*this.frandom()}frandomMax(e){return this.frandomRange(0,e)}crandom(){return this.frandomRange(-1,1)}crandomOpen(){let e=Number.EPSILON;return this.frandomRange(-1+e,1)}irandomUint32(){return this.mt.nextUint32()}irandomRange(e,n){if(n-e<=1)return e;let o=n-e,r=4294967296-4294967296%o,s;do s=this.mt.nextUint32();while(s>=r);return e+s%o}irandom(e){return e<=0?0:this.irandomRange(0,e)}randomTimeRange(e,n){return n<=e?e:this.irandomRange(e,n)}randomTime(e){return this.irandom(e)}randomIndex(e){return this.irandom(e.length)}getState(){return{mt:this.mt.getState()}}setState(e){this.mt.setState(e.mt)}};function ao(t){return new Re(t)}function Bt(){return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function co(t,e){let n=new Float32Array(16);for(let o=0;o<4;o+=1)for(let r=0;r<4;r+=1)n[r*4+o]=t[0+o]*e[r*4+0]+t[4+o]*e[r*4+1]+t[8+o]*e[r*4+2]+t[12+o]*e[r*4+3];return n}function lo(t,e){let n=e.x,o=e.y,r=e.z;return{x:t[0]*n+t[4]*o+t[8]*r+t[12],y:t[1]*n+t[5]*o+t[9]*r+t[13],z:t[2]*n+t[6]*o+t[10]*r+t[14]}}function uo(t,e){let n=Bt();return n[0]=e[0].x,n[1]=e[0].y,n[2]=e[0].z,n[4]=e[1].x,n[5]=e[1].y,n[6]=e[1].z,n[8]=e[2].x,n[9]=e[2].y,n[10]=e[2].z,n[12]=t.x,n[13]=t.y,n[14]=t.z,n}var Me=0,Fi=1,zi=2,Di=4,Ui=8,Bi=16,Ii=32,Gi=64,fo=1073741824,mo=8192,Wi=16384,ki=32768,Hi=65536,Ki=131072,po=262144,xo=524288,ho=1048576,yo=2097152,bo=4194304,To=8388608,Xi=16777216,Ji=33554432,Yi=67108864,ji=134217728,Zi=268435456,It=536870912,qi=1073741824,$i=-2147483648,Qi=64,ea=0,ta=1,na=2,oa=4,ra=8,sa=16,ia=32,aa=64,ca=128,la=33554432,ua=268435456,da=536870912,fa=1073741824,ma=-2147483648,pa=4294967295,et=3,xa=1107361795,ha=65539,ya=1107427331,Pe=56,ba=25,Ta=1174405123,So=16515072,Sa=1107296281,ga=65539,_a=3,Aa=196611,Ea=1174421507;function go(t,e){return(t&e)===e}function _o(t,e){return(t&e)!==0}function Ao(t,e){return t|e}function Eo(t,e){return t&~e}function vo(t,e){return(t&e)===e}function Vo(...t){let e=0;for(let n of t)e|=n;return e}function we(t=0,e={x:-8192,y:-8192,z:-8192},n={x:8192,y:8192,z:8192}){if(t>=4)return{axis:-1,dist:0,children:null,items:new Set};let o=t%2,r=.5*(o===0?e.x+n.x:e.y+n.y),s={...e},i={...n},a={...e},l={...n};o===0?(i.x=r,a.x=r):(i.y=r,a.y=r);let d=we(t+1,s,i),f=we(t+1,a,l);return{axis:o,dist:r,children:[d,f],items:new Set}}function Gt(t,e,n,o){let r=t;for(;r.axis!==-1&&r.children;){let s=r.axis,i=r.dist,a=s===0?n.x:n.y,l=s===0?o.x:o.y;if(a>i)r=r.children[1];else if(l<i)r=r.children[0];else break}return r.items.add(e),r}function he(t,e,n,o){for(let l of t.items)o.add(l);if(t.axis===-1||!t.children)return;let r=t.axis,s=t.dist,i=r===0?e.x:e.y;(r===0?n.x:n.y)>s&&he(t.children[1],e,n,o),i<s&&he(t.children[0],e,n,o)}var Wt=(o=>(o[o.FRONT=1]="FRONT",o[o.BACK=2]="BACK",o[o.CROSS=3]="CROSS",o))(Wt||{}),J=null;function No(){J={nodesTraversed:0,leafsReached:0,brushesTested:0}}function Co(){J=null}var Z=.03125,Oo=Number.MAX_SAFE_INTEGER-1,Le=1;function Ro(t){let e=t.planes.map(i=>({...i,signbits:rt(i.normal)})),n=t.nodes.map(i=>({plane:e[i.planenum],children:i.children})),o=t.brushes.map(i=>{let a=t.brushSides.slice(i.firstSide,i.firstSide+i.numSides).map(l=>({plane:e[l.planenum],surfaceFlags:l.surfaceFlags}));return{contents:i.contents,sides:a,checkcount:0}}),r=t.leaves.map(i=>({contents:i.contents,cluster:i.cluster,area:i.area,firstLeafBrush:i.firstLeafBrush,numLeafBrushes:i.numLeafBrushes})),s=t.bmodels.map(i=>({mins:i.mins,maxs:i.maxs,origin:i.origin,headnode:i.headnode}));return{planes:e,nodes:n,leaves:r,brushes:o,leafBrushes:t.leafBrushes,bmodels:s,visibility:t.visibility}}function rt(t){let e=0;return t.x<0&&(e|=1),t.y<0&&(e|=2),t.z<0&&(e|=4),e}function re(t,e){return t.normal.x*e.x+t.normal.y*e.y+t.normal.z*e.z-t.dist}function Mo(t,e,n=0){let o=re(t,e);return o>n?1:o<-n?2:3}function Po(t,e,n,o=0){let r,s;switch(n.signbits){case 0:r=n.normal.x*e.x+n.normal.y*e.y+n.normal.z*e.z,s=n.normal.x*t.x+n.normal.y*t.y+n.normal.z*t.z;break;case 1:r=n.normal.x*t.x+n.normal.y*e.y+n.normal.z*e.z,s=n.normal.x*e.x+n.normal.y*t.y+n.normal.z*t.z;break;case 2:r=n.normal.x*e.x+n.normal.y*t.y+n.normal.z*e.z,s=n.normal.x*t.x+n.normal.y*e.y+n.normal.z*t.z;break;case 3:r=n.normal.x*t.x+n.normal.y*t.y+n.normal.z*e.z,s=n.normal.x*e.x+n.normal.y*e.y+n.normal.z*t.z;break;case 4:r=n.normal.x*e.x+n.normal.y*e.y+n.normal.z*t.z,s=n.normal.x*t.x+n.normal.y*t.y+n.normal.z*e.z;break;case 5:r=n.normal.x*t.x+n.normal.y*e.y+n.normal.z*t.z,s=n.normal.x*e.x+n.normal.y*t.y+n.normal.z*e.z;break;case 6:r=n.normal.x*e.x+n.normal.y*t.y+n.normal.z*t.z,s=n.normal.x*t.x+n.normal.y*e.y+n.normal.z*e.z;break;default:r=n.normal.x*t.x+n.normal.y*t.y+n.normal.z*t.z,s=n.normal.x*e.x+n.normal.y*e.y+n.normal.z*e.z;break}let i=0;return r-n.dist>=-o&&(i=1),s-n.dist<=o&&(i|=2),i}function kt(t,e,n=Z){for(let o of e.sides)if(re(o.plane,t)>n)return!1;return!0}function Ht(t,e,n,o){for(let r of o.sides){let s=r.plane.normal.x*(r.plane.normal.x<0?n.x:e.x)+r.plane.normal.y*(r.plane.normal.y<0?n.y:e.y)+r.plane.normal.z*(r.plane.normal.z<0?n.z:e.z),i=r.plane.dist-s;if(t.x*r.plane.normal.x+t.y*r.plane.normal.y+t.z*r.plane.normal.z-i>0)return{startsolid:!1,allsolid:!1,contents:0}}return{startsolid:!0,allsolid:!0,contents:o.contents}}function st({start:t,end:e,mins:n,maxs:o,brush:r,trace:s}){if(r.sides.length===0)return;let i=n.x===0&&n.y===0&&n.z===0&&o.x===0&&o.y===0&&o.z===0,a=-1,l=1,d=null,f=null,c=!1,m=!1;for(let h of r.sides){let{plane:u}=h,_=u.dist;if(!i){let V=u.normal.x<0?o.x:n.x,b=u.normal.y<0?o.y:n.y,S=u.normal.z<0?o.z:n.z;_-=u.normal.x*V+u.normal.y*b+u.normal.z*S}let g=t.x*u.normal.x+t.y*u.normal.y+t.z*u.normal.z-_,A=e.x*u.normal.x+e.y*u.normal.y+e.z*u.normal.z-_;if(A>0&&(c=!0),g>0&&(m=!0),g>0&&A>=g)return;if(!(g<=0&&A<=0))if(g>A){let V=(g-Z)/(g-A);V>a&&(a=V,d=u,f=h)}else{let V=(g+Z)/(g-A);V<l&&(l=V)}}if(!m){s.startsolid=!0,c||(s.allsolid=!0),s.fraction=0;return}a<l&&a>-1&&a<s.fraction&&(s.fraction=a<0?0:a,s.plane=d,s.contents=r.contents,s.surfaceFlags=f?.surfaceFlags??0)}function Fe(){return{fraction:1,plane:null,contents:0,surfaceFlags:0,startsolid:!1,allsolid:!1}}function it(t,e,n){let o=n;for(;o>=0;){let r=e.nodes[o];o=re(r.plane,t)>=0?r.children[0]:r.children[1]}return-1-o}function Kt(t,e,n){let o=t.leaves[e],r=o.contents,s=at(),i=o.firstLeafBrush,a=i+o.numLeafBrushes;for(let l=i;l<a;l+=1){let d=t.leafBrushes[l],f=t.brushes[d];f.checkcount!==s&&(f.checkcount=s,f.sides.length!==0&&kt(n,f)&&(r|=f.contents))}return r}function at(){let t=Le;return Le+=1,Le>=Oo&&(Le=1),t}function wo(t,e){return t.x===0&&t.y===0&&t.z===0&&e.x===0&&e.y===0&&e.z===0}function Lo(t,e,n){return wo(e,n)?0:t.normal.x*(t.normal.x<0?n.x:e.x)+t.normal.y*(t.normal.y<0?n.y:e.y)+t.normal.z*(t.normal.z<0?n.z:e.z)}function Xt(t,e,n){return Math.abs(Lo(t,e,n))}function tt(t,e,n){return O(t,R(ee(e,t),n))}function nt(t,e,n){let o=t.allsolid?0:t.fraction,r=tt(e,n,o);return{fraction:o,endpos:r,plane:t.plane,planeNormal:t.startsolid?void 0:t.plane?.normal,contents:t.contents,surfaceFlags:t.surfaceFlags,startsolid:t.startsolid,allsolid:t.allsolid}}function ze(t,e,n){let o=it(t,e,n);return e.leaves[o]?.cluster??-1}function Jt(t,e,n,o){if(!t||t.numClusters===0)return!0;if(e<0||n<0||e>=t.clusters.length||n>=t.numClusters)return!1;let r=t.clusters[e],i=(o?r.phs:r.pvs)[n>>3];return i===void 0?!1:(i&1<<(n&7))!==0}function ye(t){let{model:e,nodeIndex:n,startFraction:o,endFraction:r,start:s,end:i,traceStart:a,traceEnd:l,mins:d,maxs:f,contentMask:c,trace:m,brushCheckCount:h}=t;if(m.fraction<=o)return;if(n<0){J&&J.leafsReached++;let L=-1-n,N=e.leaves[L],B=N.firstLeafBrush,k=B+N.numLeafBrushes;for(let F=B;F<k;F+=1){let K=e.leafBrushes[F],T=e.brushes[K];if((T.contents&c)!==0&&T.sides.length&&T.checkcount!==h&&(T.checkcount=h,J&&J.brushesTested++,st({start:a,end:l,mins:d,maxs:f,brush:T,trace:m}),m.allsolid))return}return}J&&J.nodesTraversed++;let u=e.nodes[n],_=u.plane,g=Xt(_,d,f),A=re(_,s),V=re(_,i);if(A>=g&&V>=g){ye({model:e,nodeIndex:u.children[0],startFraction:o,endFraction:r,start:s,end:i,traceStart:a,traceEnd:l,mins:d,maxs:f,contentMask:c,trace:m,brushCheckCount:h});return}if(A<-g&&V<-g){ye({model:e,nodeIndex:u.children[1],startFraction:o,endFraction:r,start:s,end:i,traceStart:a,traceEnd:l,mins:d,maxs:f,contentMask:c,trace:m,brushCheckCount:h});return}let b=0,S=1/(A-V),C,E;A<V?(b=1,E=(A+g+Z)*S,C=(A-g+Z)*S):(b=0,E=(A-g-Z)*S,C=(A+g+Z)*S),C<0?C=0:C>1&&(C=1),E<0?E=0:E>1&&(E=1);let M=o+(r-o)*C,v=tt(s,i,C);if(ye({model:e,nodeIndex:u.children[b],startFraction:o,endFraction:M,start:s,end:v,traceStart:a,traceEnd:l,mins:d,maxs:f,contentMask:c,trace:m,brushCheckCount:h}),m.fraction<=M)return;let H=o+(r-o)*E,x=tt(s,i,E);ye({model:e,nodeIndex:u.children[1-b],startFraction:H,endFraction:r,start:x,end:i,traceStart:a,traceEnd:l,mins:d,maxs:f,contentMask:c,trace:m,brushCheckCount:h})}function Yt(t){let{model:e,start:n,end:o}=t,r=t.mins??P,s=t.maxs??P,i=t.contentMask??4294967295,a=t.headnode??0,l=Fe(),d=at();return ye({model:e,nodeIndex:a,startFraction:0,endFraction:1,start:n,end:o,traceStart:n,traceEnd:o,mins:r,maxs:s,contentMask:i,trace:l,brushCheckCount:d}),nt(l,n,o)}function Fo(t,e,n=0){let o=it(t,e,n);return Kt(e,o,t)}function zo(t,e,n=0){let o=new Map;return t.map(r=>{let s=it(r,e,n),i=e.leaves[s];if(i.numLeafBrushes===0){let a=o.get(s);return a!==void 0?a:(o.set(s,i.contents),i.contents)}return Kt(e,s,r)})}function Do(t,e,n,o,r=0){let s=at(),i=0;function a(l){if(l<0){J&&J.leafsReached++;let h=-1-l,u=o.leaves[h];i|=u.contents;let _=u.firstLeafBrush,g=_+u.numLeafBrushes;for(let A=_;A<g;A+=1){let V=o.leafBrushes[A],b=o.brushes[V];if(b.checkcount===s||(b.checkcount=s,b.sides.length===0))continue;let S=Ht(t,e,n,b);S.startsolid&&(i|=S.contents)}return}let d=o.nodes[l],f=d.plane,c=Xt(f,e,n),m=re(f,t);if(c===0){a(m>=0?d.children[0]:d.children[1]);return}if(m>c){a(d.children[0]);return}if(m<-c){a(d.children[1]);return}a(d.children[0]),a(d.children[1])}return a(r),i}function Uo(t,e,n,o=0){let{visibility:r}=n;if(!r)return!0;let s=ze(t,n,o),i=ze(e,n,o);return Jt(r,s,i,!1)}function Bo(t,e,n,o=0){let{visibility:r}=n;if(!r)return!0;let s=ze(t,n,o),i=ze(e,n,o);return Jt(r,s,i,!0)}function le(t,e,n){return{normal:t,dist:e,type:n,signbits:rt(t)}}function Io(t){let e=t.surfaceFlags??0,n=t.origin.x+t.maxs.x,o=t.origin.x+t.mins.x,r=t.origin.y+t.maxs.y,s=t.origin.y+t.mins.y,i=t.origin.z+t.maxs.z,a=t.origin.z+t.mins.z,d=[le({x:1,y:0,z:0},n,0),le({x:-1,y:0,z:0},-o,0),le({x:0,y:1,z:0},r,1),le({x:0,y:-1,z:0},-s,1),le({x:0,y:0,z:1},i,2),le({x:0,y:0,z:-1},-a,2)].map(f=>({plane:f,surfaceFlags:e}));return{contents:t.contents,sides:d,checkcount:0}}function Go(t){let e=Io(t);return{...t,brush:e,bounds:{mins:{x:t.origin.x+t.mins.x,y:t.origin.y+t.mins.y,z:t.origin.z+t.mins.z},maxs:{x:t.origin.x+t.maxs.x,y:t.origin.y+t.maxs.y,z:t.origin.z+t.maxs.z}}}}function Wo(t,e){return!(t.mins.x>e.maxs.x||t.maxs.x<e.mins.x||t.mins.y>e.maxs.y||t.maxs.y<e.mins.y||t.mins.z>e.maxs.z||t.maxs.z<e.mins.z)}function ko(t,e){return e.allsolid&&!t.allsolid||e.startsolid&&!t.startsolid?!0:e.fraction<t.fraction}var ot=class{constructor(){this.entities=new Map;this.entityNodes=new Map;this.rootNode=we()}link(e){let n=Go(e);this.entities.set(e.id,n);let o=this.entityNodes.get(e.id);o&&o.items.delete(e.id);let r=Gt(this.rootNode,e.id,n.bounds.mins,n.bounds.maxs);this.entityNodes.set(e.id,r)}unlink(e){this.entities.delete(e);let n=this.entityNodes.get(e);n&&(n.items.delete(e),this.entityNodes.delete(e))}trace(e){let{passId:n}=e,o=e.mins??P,r=e.maxs??P,s=e.contentMask??4294967295,i,a=null;e.model?i=Yt(e):i=nt(Fe(),e.start,e.end);let l={x:Math.min(e.start.x,e.end.x)+o.x,y:Math.min(e.start.y,e.end.y)+o.y,z:Math.min(e.start.z,e.end.z)+o.z},d={x:Math.max(e.start.x,e.end.x)+r.x,y:Math.max(e.start.y,e.end.y)+r.y,z:Math.max(e.start.z,e.end.z)+r.z},f=new Set;he(this.rootNode,l,d,f);for(let c of f){if(c===n)continue;let m=this.entities.get(c);if(!m||(m.contents&s)===0)continue;let h=Fe();if(st({start:e.start,end:e.end,mins:o,maxs:r,brush:m.brush,trace:h}),h.contents===0&&(h.contents=m.contents),h.startsolid||h.allsolid||h.fraction<i.fraction){let u=nt(h,e.start,e.end);ko(i,u)&&(i=u,a=m.id)}}return{...i,entityId:a}}gatherTriggerTouches(e,n,o,r=1073741824){let s=[],i={mins:O(e,n),maxs:O(e,o)},a=new Set;he(this.rootNode,i.mins,i.maxs,a);for(let l of a){let d=this.entities.get(l);d&&(d.contents&r)!==0&&Wo(i,d.bounds)&&s.push(d.id)}return s}};var jt=(i=>(i[i.None=0]="None",i[i.Archive=1]="Archive",i[i.UserInfo=2]="UserInfo",i[i.ServerInfo=4]="ServerInfo",i[i.Latch=8]="Latch",i[i.Cheat=16]="Cheat",i))(jt||{});var Pa=1024,wa=80,La=512,Fa=64,za=128,Ho=256,Da=8192,Ko=256,Xo=8192,Jo=2048,Yo=512,jo=256,Zo=512,qo=256,ct=32,Ua=96,Ba=64,ue=(x=>(x[x.Name=0]="Name",x[x.CdTrack=1]="CdTrack",x[x.Sky=2]="Sky",x[x.SkyAxis=3]="SkyAxis",x[x.SkyRotate=4]="SkyRotate",x[x.StatusBar=5]="StatusBar",x[x.HealthBarName=55]="HealthBarName",x[x.CONFIG_N64_PHYSICS=56]="CONFIG_N64_PHYSICS",x[x.CONFIG_CTF_TEAMS=57]="CONFIG_CTF_TEAMS",x[x.CONFIG_COOP_RESPAWN_STRING=58]="CONFIG_COOP_RESPAWN_STRING",x[x.AirAccel=59]="AirAccel",x[x.MaxClients=60]="MaxClients",x[x.MapChecksum=61]="MapChecksum",x[x.Models=62]="Models",x[x.Sounds=62+Xo]="Sounds",x[x.Images=x.Sounds+Jo]="Images",x[x.Lights=x.Images+Yo]="Lights",x[x.ShadowLights=x.Lights+Ko]="ShadowLights",x[x.Items=x.ShadowLights+qo]="Items",x[x.PlayerSkins=x.Items+jo]="PlayerSkins",x[x.General=x.PlayerSkins+Ho]="General",x[x.WheelWeapons=x.General+Zo]="WheelWeapons",x[x.WheelAmmo=x.WheelWeapons+ct]="WheelAmmo",x[x.WheelPowerups=x.WheelAmmo+ct]="WheelPowerups",x[x.CdLoopCount=x.WheelPowerups+ct]="CdLoopCount",x[x.GameStyle=x.CdLoopCount+1]="GameStyle",x[x.MaxConfigStrings=x.GameStyle+1]="MaxConfigStrings",x))(ue||{}),$o=ue.MaxConfigStrings;function Qo(t){return t>=5&&t<59?96*(59-t):t>=ue.General&&t<ue.WheelWeapons?96*(ue.MaxConfigStrings-t):96}var lt={};qe(lt,{addReplayFrame:()=>or,createReplaySession:()=>nr,deserializeReplay:()=>tr,serializeReplay:()=>er});function er(t){return JSON.stringify(t,null,2)}function tr(t){let e=JSON.parse(t);if(!e.metadata||!Array.isArray(e.frames))throw new Error("Invalid replay format: missing metadata or frames");return e}function nr(t,e){return{metadata:{map:t,date:new Date().toISOString(),version:"1.0",seed:e},frames:[]}}function or(t,e,n,o){t.frames.push({serverFrame:n,cmd:e,timestamp:Date.now()-o})}function rr(t){return t??{}}function Zt(t,e,n={}){let o=rr(t),r=[],s=[];for(let a of e){if(!(a in o)){r.push(a);continue}typeof o[a]!="function"&&s.push(a)}let i=n.allowExtra===!1?Object.keys(o).filter(a=>!e.includes(a)):[];return{missing:r,nonFunctions:s,extras:i}}function sr(t,e,n={}){let{missing:o,nonFunctions:r,extras:s}=Zt(t,e,n);if(o.length===0&&r.length===0&&s.length===0)return;let i=[];o.length>0&&i.push(`missing: ${o.join(", ")}`),r.length>0&&i.push(`non-functions: ${r.join(", ")}`),s.length>0&&i.push(`extras: ${s.join(", ")}`);let a=n.name??"contract";throw new Error(`${a} validation failed (${i.join("; ")})`)}var ir=["Broadcast_Print","Com_Print","Client_Print","Center_Print","sound","positioned_sound","local_sound","configstring","get_configstring","Com_Error","modelindex","soundindex","imageindex","setmodel","trace","clip","pointcontents","inPVS","inPHS","SetAreaPortalState","AreasConnected","linkentity","unlinkentity","BoxEdicts","multicast","unicast"],ar=["PreInit","Init","Shutdown","SpawnEntities","WriteGameJson","ReadGameJson","WriteLevelJson","ReadLevelJson","CanSave","ClientConnect","ClientThink","RunFrame","Pmove"],cr=["Com_Print","get_configstring","Com_Error","TagMalloc","TagFree","AddCommandString","CL_FrameValid","CL_FrameTime","CL_ClientTime","CL_ServerFrame","Draw_RegisterPic","Draw_GetPicSize","SCR_DrawChar","SCR_DrawPic","SCR_DrawColorPic"],lr=["Init","Shutdown","DrawHUD","TouchPics","LayoutFlags","GetActiveWeaponWheelWeapon","GetOwnedWeaponWheelWeapons","GetWeaponWheelAmmoCount","GetPowerupWheelCount","GetHitMarkerDamage","Pmove","ParseConfigString","ParseCenterPrint","ClearNotify","ClearCenterprint","NotifyMessage","GetMonsterFlashOffset"];var de=(r=>(r[r.None=0]="None",r[r.Feet=1]="Feet",r[r.Waist=2]="Waist",r[r.Under=3]="Under",r))(de||{});function ut(t){return t>=2}function ur(t){return t===3}var q=(c=>(c[c.Ducked=1]="Ducked",c[c.JumpHeld=2]="JumpHeld",c[c.OnGround=4]="OnGround",c[c.TimeWaterJump=8]="TimeWaterJump",c[c.TimeLand=16]="TimeLand",c[c.TimeTeleport=32]="TimeTeleport",c[c.NoPositionalPrediction=64]="NoPositionalPrediction",c[c.OnLadder=128]="OnLadder",c[c.NoAngularPrediction=256]="NoAngularPrediction",c[c.IgnorePlayerCollision=512]="IgnorePlayerCollision",c[c.TimeTrick=1024]="TimeTrick",c))(q||{});function z(t,e){return(t&e)!==0}function G(t,e){return t|e}function X(t,e){return t&~e}var se=(a=>(a[a.Normal=0]="Normal",a[a.Grapple=1]="Grapple",a[a.NoClip=2]="NoClip",a[a.Spectator=3]="Spectator",a[a.Dead=4]="Dead",a[a.Gib=5]="Gib",a[a.Freeze=6]="Freeze",a))(se||{}),ie=(a=>(a[a.None=0]="None",a[a.Attack=1]="Attack",a[a.Use=2]="Use",a[a.Holster=4]="Holster",a[a.Jump=8]="Jump",a[a.Crouch=16]="Crouch",a[a.Any=128]="Any",a))(ie||{});var dr=270;function fr(t,e){return(t&e)!==0}function dt(t){let{pmFlags:e,pmType:n,buttons:o,waterlevel:r,onGround:s,velocity:i,origin:a,jumpHeight:l=dr}=t;if(e&16)return{pmFlags:e,onGround:s,velocity:i,origin:a,jumpSound:!1,jumped:!1};let d=fr(o,8),f=e,c=s,m=!1,h=!1,u=i,_=a;if(!d)return f=X(f,2),{pmFlags:f,onGround:c,velocity:u,origin:_,jumpSound:m,jumped:h};if(mr(f))return{pmFlags:f,onGround:c,velocity:u,origin:_,jumpSound:m,jumped:h};if(n===4)return{pmFlags:f,onGround:c,velocity:u,origin:_,jumpSound:m,jumped:h};if(r>=2)return c=!1,{pmFlags:f,onGround:c,velocity:u,origin:_,jumpSound:m,jumped:h};if(!c)return{pmFlags:f,onGround:c,velocity:u,origin:_,jumpSound:m,jumped:h};f=G(f,2),f=X(f,4),c=!1,m=!0,h=!0;let g=i.z+l,A=g<l?l:g;return u={...i,z:A},_={...a,z:a.z+1},{pmFlags:f,onGround:c,velocity:u,origin:_,jumpSound:m,jumped:h}}function mr(t){return(t&2)!==0}var pr=100,ft=200,qt=150,De=25,xr=15,hr=1,yr={x:0,y:0,z:1},br=(t,e)=>({fraction:1,endpos:e,allsolid:!1,startsolid:!1});function mt(t){let e=0,n=0,o=0;return t&262144&&(e+=1),t&524288&&(n+=1),t&1048576&&(e-=1),t&2097152&&(n-=1),t&4194304&&(o+=1),t&8388608&&(o-=1),e===0&&n===0&&o===0?P:{x:e,y:n,z:o}}function en(t){let{watertype:e,waterlevel:n,onGround:o,waterSpeed:r}=t;if((e&16515072)===0)return P;let s=mt(e);if(s===P)return P;let i=r;return n===1&&o&&(i*=.5),R(s,i)}function tn(t){let{groundContents:e,scale:n=pr}=t,o=mt(e);return o===P?P:R(o,n)}function be(t){let{wishVelocity:e,onLadder:n,onGround:o,waterlevel:r,watertype:s,groundContents:i,cmd:a,viewPitch:l,maxSpeed:d,ladderMod:f,waterSpeed:c,forward:m,origin:h,mins:u,maxs:_,trace:g=br}=t,A=e;n&&(A=Tr({wishVelocity:A,cmd:a,waterlevel:r,viewPitch:l,maxSpeed:d,ladderMod:f,onGround:o,forward:m,origin:h,mins:u,maxs:_,trace:g}));let V=en({watertype:s,waterlevel:r,onGround:o,waterSpeed:c});if(V!==P&&(A=O(A,V)),o){let b=tn({groundContents:i});b!==P&&(A=O(A,b))}return A}function Tr(t){let{wishVelocity:e,cmd:n,waterlevel:o,viewPitch:r,maxSpeed:s,ladderMod:i,onGround:a,forward:l,origin:d,mins:f,maxs:c,trace:m}=t,h=n.buttons??0,u={...e};if((h&24)!==0){let _=ut(o)?s:ft;u={...u,z:h&8?_:-_}}else if(n.forwardmove){let _=$t(n.forwardmove,-ft,ft);if(n.forwardmove>0){let g=r<xr?_:-_;u={...u,z:g}}else a||(u={...u,x:0,y:0}),u={...u,z:_}}else u={...u,z:0};if(!a)if(n.sidemove){let _=$t(n.sidemove,-qt,qt);o<2&&(_*=i);let g=w({x:l.x,y:l.y,z:0});if(g.x!==0||g.y!==0){let A=O(d,R(g,hr)),V=m(d,A,f,c);if(V.fraction!==1&&!V.allsolid&&V.contents!==void 0&&(V.contents&536870912)!==0&&V.planeNormal){let b=te(V.planeNormal,yr);u={...u,x:0,y:0},u=O(u,R(b,-_))}}}else u={...u,x:Qt(u.x),y:Qt(u.y)};return u}function $t(t,e,n){return Math.max(e,Math.min(n,t))}function Qt(t){return t<-De?-De:t>De?De:t}var nn=5,Sr=4,gr=18,_r=.7,on=1,rn=2;function sn(t,e,n,o=nn,r=t){if(e.length===0)return{velocity:t,planes:[],stopped:!1};let s=[],i=t;for(let l of e){if(s.length>=o)return{velocity:P,planes:s,stopped:!0};if(s.find(m=>U(m,l)>.99))continue;s.push(l);let f,c=0;for(;c<s.length;c++){let m=ne(i,s[c],n),h=0;for(;h<s.length&&!(h!==c&&U(m,s[h])<0);h++);if(h===s.length){f=m;break}}if(f)i=f;else{if(s.length!==2)return{velocity:P,planes:s,stopped:!0};let m=te(s[0],s[1]),h=U(m,i);i=R(m,h)}if(U(i,r)<=0)return{velocity:P,planes:s,stopped:!0}}let a=i.x===0&&i.y===0&&i.z===0;return{velocity:i,planes:s,stopped:a}}function pt(t){let{origin:e,velocity:n,frametime:o,overbounce:r,trace:s,maxBumps:i=Sr,maxClipPlanes:a=nn,mins:l,maxs:d,hasTime:f=!1}=t,c=e,m=n,h=[],u=n,_=o,g=0;for(let V=0;V<i&&!(m.x===0&&m.y===0&&m.z===0);V++){let b=O(c,R(m,_)),S=s(c,b,l,d);if(S.allsolid){let E=f?u:P;return{origin:S.endpos,velocity:E,planes:h,stopped:!0,blocked:g}}if(S.startsolid){let E=f?u:P;return{origin:S.endpos,velocity:E,planes:h,stopped:!0,blocked:g}}if(S.fraction>0&&(c=S.endpos),S.fraction===1)break;if(!S.planeNormal)return{origin:c,velocity:f?u:P,planes:h,stopped:!0,blocked:g};S.planeNormal.z>.7&&(g|=on),S.planeNormal.z===0&&(g|=rn),h.push(S.planeNormal),_-=_*S.fraction;let C=sn(m,h,r,a,u);if(m=C.velocity,h.splice(0,h.length,...C.planes),u.z>0&&m.z<0&&(m={...m,z:0}),C.stopped)return{origin:c,velocity:f?u:m,planes:h,stopped:!0,blocked:g}}let A=f?u:m;return{origin:c,velocity:A,planes:h,stopped:A.x===0&&A.y===0&&A.z===0,blocked:g}}function ae(t){let{mins:e,maxs:n,stepSize:o=gr,...r}=t,s=t.origin,i=t.velocity,a=pt({...r,mins:e,maxs:n}),l=O(s,{x:0,y:0,z:o}),d=r.trace(s,l,e,n);if(d.allsolid)return{...a,stepped:!1,stepHeight:0};let f=d.endpos.z-s.z,c=pt({...r,origin:d.endpos,velocity:i,mins:e,maxs:n}),m=O(c.origin,{x:0,y:0,z:-f}),h=r.trace(c.origin,m,e,n),u=c.origin,_=h.planeNormal;h.allsolid||(u=h.endpos);let g=(E,M)=>(E.x-M.x)**2+(E.y-M.y)**2,A=g(a.origin,s),V=g(u,s);if(A>V||_&&_.z<_r)return{...a,stepped:!1,stepHeight:0};let b={...c.velocity,z:a.velocity.z},S=c.blocked,C=b.x===0&&b.y===0&&b.z===0;return{origin:u,velocity:b,planes:c.planes,blocked:S,stopped:C,stepped:!0,stepHeight:f,stepNormal:_}}var an=1,Ar=60,Ue=1.01;function xt(t){let{origin:e,frametime:n,mins:o,maxs:r,trace:s,overbounce:i=Ue,stepSize:a,maxBumps:l,maxClipPlanes:d,hasTime:f,forward:c,right:m,cmd:h,pmFlags:u,onGround:_,gravity:g,pmType:A,pmAccelerate:V,pmAirAccelerate:b=an,pmMaxSpeed:S,pmDuckSpeed:C,onLadder:E,waterlevel:M,watertype:v,groundContents:W,viewPitch:H,ladderMod:x,pmWaterSpeed:L}=t,N={...t.velocity},B=ln(c,m,h);B=be({wishVelocity:B,onLadder:E,onGround:_,waterlevel:M,watertype:v,groundContents:W,cmd:h,viewPitch:H,maxSpeed:z(u,1)?C:S,ladderMod:x,waterSpeed:L,forward:c,origin:e,mins:o,maxs:r,trace:s});let F=z(u,1)?C:S,K=B,T=I(K);if(T!==0&&(K=w(K)),T>F){let $=F/T;B=R(B,$),T=F,T!==0&&(K=w(B))}return E?(N=Y({velocity:N,wishdir:K,wishspeed:T,accel:V,frametime:n}),Math.abs(B.z)<Number.EPSILON&&(N=Vr(N,g,n)),Te({origin:e,velocity:N,frametime:n,mins:o,maxs:r,trace:s,overbounce:i,stepSize:a,maxBumps:l,maxClipPlanes:d,hasTime:f})):_?(N={...N,z:0},N=Y({velocity:N,wishdir:K,wishspeed:T,accel:V,frametime:n}),g>0?N={...N,z:0}:N={...N,z:N.z-g*n},N.x===0&&N.y===0?{origin:e,velocity:N,planes:[],blocked:0,stopped:!0,stepped:!1,stepHeight:0}:Te({origin:e,velocity:N,frametime:n,mins:o,maxs:r,trace:s,overbounce:i,stepSize:a,maxBumps:l,maxClipPlanes:d,hasTime:f})):(b>0?N=bt({velocity:N,wishdir:K,wishspeed:T,accel:b,frametime:n}):N=Y({velocity:N,wishdir:K,wishspeed:T,accel:an,frametime:n}),A!==1&&(N={...N,z:N.z-g*n}),Te({origin:e,velocity:N,frametime:n,mins:o,maxs:r,trace:s,overbounce:i,stepSize:a,maxBumps:l,maxClipPlanes:d,hasTime:f}))}function ht(t){let{origin:e,frametime:n,mins:o,maxs:r,trace:s,overbounce:i=Ue,stepSize:a,maxBumps:l,maxClipPlanes:d,hasTime:f,forward:c,right:m,cmd:h,pmFlags:u,onGround:_,pmMaxSpeed:g,pmDuckSpeed:A,pmWaterAccelerate:V,pmWaterSpeed:b,onLadder:S,watertype:C,groundContents:E,waterlevel:M,viewPitch:v,ladderMod:W}=t,H={...t.velocity},x=Er(c,m,h);vr(h,_)?x={...x,z:x.z-Ar}:cn(h,16)?x=O(x,{x:0,y:0,z:-b*.5}):cn(h,8)&&(x=O(x,{x:0,y:0,z:b*.5})),x=be({wishVelocity:x,onLadder:S,onGround:_,waterlevel:M,watertype:C,groundContents:E,cmd:h,viewPitch:v,maxSpeed:z(u,1)?A:g,ladderMod:W,waterSpeed:b,forward:c,origin:e,mins:o,maxs:r,trace:s});let L=x,N=I(L);if(N!==0&&(L=w(L)),N>g){let k=g/N;x=R(x,k),N=g,N!==0&&(L=w(x))}if(N*=.5,z(u,1)&&N>A){let k=A/N;x=R(x,k),N=A,N!==0&&(L=w(x))}return H=Y({velocity:H,wishdir:L,wishspeed:N,accel:V,frametime:n}),Te({origin:e,velocity:H,frametime:n,mins:o,maxs:r,trace:s,overbounce:i,stepSize:a,maxBumps:l,maxClipPlanes:d,hasTime:f})}function yt(t){let{origin:e,frametime:n,mins:o,maxs:r,trace:s,overbounce:i=Ue,stepSize:a,maxBumps:l,maxClipPlanes:d,hasTime:f,forward:c,right:m,cmd:h,pmFlags:u,onGround:_,gravity:g,pmAccelerate:A,pmMaxSpeed:V,pmDuckSpeed:b,onLadder:S,waterlevel:C,watertype:E,groundContents:M,viewPitch:v,ladderMod:W,pmWaterSpeed:H}=t,x={...t.velocity},L=ln(c,m,h);L=be({wishVelocity:L,onLadder:S,onGround:_,waterlevel:C,watertype:E,groundContents:M,cmd:h,viewPitch:v,maxSpeed:z(u,1)?b:V,ladderMod:W,waterSpeed:H,forward:c,origin:e,mins:o,maxs:r,trace:s});let B=z(u,1)?b:V,k=L,F=I(k);if(F!==0&&(k=w(k)),F>B){let K=B/F;L=R(L,K),F=B,F!==0&&(k=w(L))}return x={...x,z:0},x=Y({velocity:x,wishdir:k,wishspeed:F,accel:A,frametime:n}),g>0?x={...x,z:0}:x={...x,z:x.z-g*n},x.x===0&&x.y===0?{origin:e,velocity:x,planes:[],blocked:0,stopped:!0,stepped:!1,stepHeight:0}:Te({origin:e,velocity:x,frametime:n,mins:o,maxs:r,trace:s,overbounce:i,stepSize:a,maxBumps:l,maxClipPlanes:d,hasTime:f})}function ln(t,e,n){return{x:t.x*n.forwardmove+e.x*n.sidemove,y:t.y*n.forwardmove+e.y*n.sidemove,z:0}}function Er(t,e,n){return{x:t.x*n.forwardmove+e.x*n.sidemove,y:t.y*n.forwardmove+e.y*n.sidemove,z:t.z*n.forwardmove+e.z*n.sidemove}}function cn(t,e){return!!((t.buttons??0)&e)}function vr(t,e){let n=t.forwardmove===0&&t.sidemove===0,o=!((t.buttons??0)&24);return n&&o&&!e}function Vr(t,e,n){let o=t.z,r=e*n;return o>0?(o-=r,o<0&&(o=0)):(o+=r,o>0&&(o=0)),{...t,z:o}}function Te(t){let{origin:e,velocity:n,frametime:o,mins:r,maxs:s,trace:i,overbounce:a=Ue,stepSize:l,maxBumps:d,maxClipPlanes:f,hasTime:c}=t;return ae({origin:e,velocity:n,frametime:o,trace:i,mins:r,maxs:s,overbounce:a,stepSize:l,maxBumps:d,maxClipPlanes:f,hasTime:c})}function Se(t){let{origin:e,mins:n,viewheight:o,pointContents:r}=t,s=o-n.z,i=s/2,a={x:e.x,y:e.y,z:e.z+n.z+1},l=r(a);if((l&56)===0)return{waterlevel:0,watertype:0};let d=l,f=1,c={x:a.x,y:a.y,z:e.z+n.z+i};if(l=r(c),(l&56)!==0){f=2;let m={x:a.x,y:a.y,z:e.z+n.z+s};l=r(m),(l&56)!==0&&(f=3)}return{waterlevel:f,watertype:d}}var Nr=.25,Cr=180,Or=100,Rr=.7,Mr=.9,Pr=64,wr=128,Lr=1.01,Fr=1080;function Be(t){let{pmType:e,n64Physics:n,velocity:o,startVelocity:r,origin:s,mins:i,maxs:a,viewheight:l,trace:d,pointContents:f}=t,c=t.pmFlags,m=t.pmTime,h,u=z(c,4),_,g=0;if(o.z>Cr||e===1)c=X(c,4),u=!1;else{let S={x:s.x,y:s.y,z:s.z-Nr},C=d(s,S,i,a);_=C,g=C.contents??0;let E=C.planeNormal,M=C.fraction<1&&!!E&&E.z<Rr;if(M&&E){let v=O(s,E),W=d(s,v,i,a);W.fraction<1&&!W.startsolid&&(M=!1)}if(C.fraction===1||!E||M&&!C.startsolid)c=X(c,4),u=!1;else{u=!0,z(c,8)&&(c&=~Fr,m=0);let v=z(c,4);if(!v){!n&&o.z>=Or&&E.z>=Mr&&!z(c,1)&&(c=G(c,1024),m=Pr);let W=ne(o,E,Lr);h=r.z-W.z}c=G(c,4),!v&&(n||z(c,1))&&(c=G(c,16),m=wr)}}let{waterlevel:V,watertype:b}=Se({origin:s,mins:i,viewheight:l,pointContents:f});return{pmFlags:c,pmTime:m,onGround:z(c,4),groundTrace:_,groundContents:g,waterlevel:V,watertype:b,impactDelta:h}}function Ie(t,e,n){return{x:t,y:e,z:n}}function Ge(t,e){let n=Ie(-16,-16,0),o=Ie(16,16,16);if(t===5)return{mins:n,maxs:o,viewheight:8};let r=t===4||(e&1)!==0,s=Ie(n.x,n.y,-24),i=Ie(o.x,o.y,r?4:32);return{mins:s,maxs:i,viewheight:r?-2:22}}var zr=4,Dr=32,Ur=8;function Tt(t){let{pmType:e}=t;if(e===5){let i=Ge(e,t.pmFlags);return{pmFlags:t.pmFlags,ducked:z(t.pmFlags,1),changed:!1,...i}}let n=t.pmFlags,o=!1;e===4?z(n,1)||(n=G(n,1),o=!0):Br(t)?!z(n,1)&&!Ir(t)&&(n=G(n,1),o=!0):z(n,1)&&!Gr(t)&&(n=X(n,1),o=!0);let r=Ge(e,n),s=e===4||z(n,1);return{pmFlags:n,ducked:s,changed:o,...r}}function Br(t){return(t.buttons&16)===0||t.onLadder||t.n64Physics?!1:!!(t.hasGroundEntity||t.waterlevel<=1&&!Wr(t))}function Ir(t){return t.trace({start:t.origin,end:t.origin,mins:t.mins,maxs:un(t.maxs,zr),mask:3}).allsolid}function Gr(t){return t.trace({start:t.origin,end:t.origin,mins:t.mins,maxs:un(t.maxs,Dr),mask:3}).allsolid}function Wr(t){let e={x:t.origin.x,y:t.origin.y,z:t.origin.z-Ur};return t.trace({start:t.origin,end:e,mins:t.mins,maxs:t.maxs,mask:3}).fraction<1?!1:t.trace({start:t.origin,end:e,mins:t.mins,maxs:t.maxs,mask:56}).fraction<1}function un(t,e){return{x:t.x,y:t.y,z:e}}var ge=.025;function We(t){let{velocity:e,frametime:n,onGround:o,groundIsSlick:r,onLadder:s,waterlevel:i,pmFriction:a,pmStopSpeed:l,pmWaterFriction:d}=t,f=I(e);if(f<1)return{x:0,y:0,z:e.z};let c=0;if(o&&!r||s){let u=f<l?l:f;c+=u*a*n}i>0&&!s&&(c+=f*d*i*n);let m=f-c;if(m<0&&(m=0),m===f)return e;let h=m/f;return R(e,h)}function Y(t){let{velocity:e,wishdir:n,wishspeed:o,accel:r,frametime:s}=t,i=U(e,n),a=o-i;if(a<=0)return e;let l=r*s*o;return l>a&&(l=a),{x:e.x+n.x*l,y:e.y+n.y*l,z:e.z+n.z*l}}function bt(t){let{velocity:e,wishdir:n,wishspeed:o,accel:r,frametime:s}=t,i=Math.min(o,30),a=U(e,n),l=i-a;if(l<=0)return e;let d=r*o*s;return d>l&&(d=l),{x:e.x+n.x*d,y:e.y+n.y*d,z:e.z+n.z*d}}function kr(t,e){let n=Math.abs(t.forwardmove),o=Math.abs(t.sidemove),r=Math.abs(t.upmove),s=Math.max(n,o,r);if(s===0)return 0;let i=Math.sqrt(t.forwardmove*t.forwardmove+t.sidemove*t.sidemove+t.upmove*t.upmove);return e*s/(127*i)}function St(t){let{forward:e,right:n,cmd:o,maxSpeed:r}=t,s={x:e.x*o.forwardmove+n.x*o.sidemove,y:e.y*o.forwardmove+n.y*o.sidemove,z:0},i=I(s);if(i>r){let a=r/i;s=R(s,a),i=r}return{wishdir:i===0?s:w(s),wishspeed:i}}function gt(t){let{forward:e,right:n,cmd:o,maxSpeed:r}=t,s={x:e.x*o.forwardmove+n.x*o.sidemove,y:e.y*o.forwardmove+n.y*o.sidemove,z:e.z*o.forwardmove+n.z*o.sidemove};o.upmove>10?s=O(s,{x:0,y:0,z:o.upmove}):o.upmove<-10?s=O(s,{x:0,y:0,z:o.upmove}):Math.abs(o.forwardmove)<10&&Math.abs(o.sidemove)<10?s=O(s,{x:0,y:0,z:-60}):s=O(s,{x:0,y:0,z:10});let i=I(s);if(i>r){let a=r/i;s=R(s,a),i=r}return i*=.5,{wishdir:i===0?s:w(s),wishspeed:i}}function Hr(t,e){if(t.pmType===4)return t;let n={...t},o=Be({pmType:n.pmType,pmFlags:n.pmFlags,pmTime:0,n64Physics:!1,velocity:n.velocity,startVelocity:n.velocity,origin:n.origin,mins:n.mins,maxs:n.maxs,viewheight:n.viewHeight,trace:e.trace,pointContents:e.pointcontents});n.pmFlags=o.pmFlags,n.waterlevel=o.waterlevel,n.watertype=o.watertype;let r=Tt({pmType:n.pmType,pmFlags:n.pmFlags,buttons:n.cmd.buttons,waterlevel:n.waterlevel,hasGroundEntity:(n.pmFlags&4)!==0,onLadder:!1,n64Physics:!1,origin:n.origin,mins:n.mins,maxs:n.maxs,trace:c=>e.trace(c.start,c.end,c.mins,c.maxs)});n.pmFlags=r.pmFlags,n.mins=r.mins,n.maxs=r.maxs,n.viewHeight=r.viewheight;let s=dt({pmFlags:n.pmFlags,pmType:n.pmType,buttons:n.cmd.buttons,waterlevel:n.waterlevel,onGround:(n.pmFlags&4)!==0,velocity:n.velocity,origin:n.origin});n.pmFlags=s.pmFlags,n.velocity=s.velocity,n.origin=s.origin,s.onGround!==((n.pmFlags&4)!==0)&&(s.onGround?n.pmFlags=G(n.pmFlags,4):n.pmFlags=X(n.pmFlags,4));let i=(n.pmFlags&4)!==0,a=n.velocity;n.velocity=We({velocity:n.velocity,frametime:ge,onGround:i,groundIsSlick:!1,onLadder:!1,waterlevel:n.waterlevel,pmFriction:6,pmStopSpeed:100,pmWaterFriction:1});let{forward:l,right:d}=oe(n.viewAngles);if(n.pmType===2){let c={x:l.x*n.cmd.forwardmove+d.x*n.cmd.sidemove,y:l.y*n.cmd.forwardmove+d.y*n.cmd.sidemove,z:n.cmd.upmove},m=ge;n.velocity=c,n.origin={x:n.origin.x+c.x*m,y:n.origin.y+c.y*m,z:n.origin.z+c.z*m}}else if(n.waterlevel>=2){let c=ht({origin:n.origin,velocity:n.velocity,frametime:ge,mins:n.mins,maxs:n.maxs,trace:e.trace,cmd:n.cmd,forward:l,right:d,pmFlags:n.pmFlags,onGround:i,pmMaxSpeed:300,pmDuckSpeed:100,pmWaterAccelerate:4,pmWaterSpeed:400,onLadder:!1,watertype:n.watertype,groundContents:0,waterlevel:n.waterlevel,viewPitch:n.viewAngles.x,ladderMod:1,stepSize:18});n.origin=c.origin,n.velocity=c.velocity}else if((n.pmFlags&4)===0){let c=xt({origin:n.origin,velocity:n.velocity,frametime:ge,mins:n.mins,maxs:n.maxs,trace:e.trace,cmd:n.cmd,forward:l,right:d,pmFlags:n.pmFlags,onGround:i,gravity:n.gravity,pmType:n.pmType,pmAccelerate:10,pmAirAccelerate:1,pmMaxSpeed:300,pmDuckSpeed:100,onLadder:!1,waterlevel:n.waterlevel,watertype:n.watertype,groundContents:0,viewPitch:n.viewAngles.x,ladderMod:1,pmWaterSpeed:400,stepSize:18});n.origin=c.origin,n.velocity=c.velocity}else{let c=yt({origin:n.origin,velocity:n.velocity,frametime:ge,mins:n.mins,maxs:n.maxs,trace:e.trace,cmd:n.cmd,forward:l,right:d,pmFlags:n.pmFlags,onGround:i,gravity:n.gravity,pmType:n.pmType,pmAccelerate:10,pmMaxSpeed:300,pmDuckSpeed:100,onLadder:!1,waterlevel:n.waterlevel,watertype:n.watertype,groundContents:0,viewPitch:n.viewAngles.x,ladderMod:1,pmWaterSpeed:400,stepSize:18});n.origin=c.origin,n.velocity=c.velocity}let f=Be({pmType:n.pmType,pmFlags:n.pmFlags,pmTime:0,n64Physics:!1,velocity:n.velocity,startVelocity:n.velocity,origin:n.origin,mins:n.mins,maxs:n.maxs,viewheight:n.viewHeight,trace:e.trace,pointContents:e.pointcontents});return n.pmFlags=f.pmFlags,n.waterlevel=f.waterlevel,n.watertype=f.watertype,n}var fe=["x","y","z"],_t=[{normal:[0,0,1],mins:[-1,-1,0],maxs:[1,1,0]},{normal:[0,0,-1],mins:[-1,-1,0],maxs:[1,1,0]},{normal:[1,0,0],mins:[0,-1,-1],maxs:[0,1,1]},{normal:[-1,0,0],mins:[0,-1,-1],maxs:[0,1,1]},{normal:[0,1,0],mins:[-1,0,-1],maxs:[1,0,1]},{normal:[0,-1,0],mins:[-1,0,-1],maxs:[1,0,1]}],dn={x:0,y:0,z:0};function me(t){return{x:t.x,y:t.y,z:t.z}}function Kr(t){return{x:t[0],y:t[1],z:t[2]}}function _e(t,e,n){if(n!==0)switch(e){case"x":t.x+=n;break;case"y":t.y+=n;break;case"z":t.z+=n;break}}function fn(t,e,n){switch(e){case"x":t.x=n;break;case"y":t.y=n;break;case"z":t.z=n;break}}function ke(t,e){switch(e){case"x":return t.x;case"y":return t.y;case"z":default:return t.z}}function mn(t,e,n,o){return t===-1?ke(n,e):t===1?ke(o,e):0}function pn(t,e,n,o){let r=me(t);for(let s=0;s<fe.length;s++){let i=fe[s],a=e.normal[s];a<0?_e(r,i,ke(n,i)):a>0&&_e(r,i,ke(o,i))}return r}function Xr(t,e,n){let o=me(dn),r=me(dn);for(let s=0;s<fe.length;s++){let i=fe[s];fn(o,i,mn(t.mins[s],i,e,n)),fn(r,i,mn(t.maxs[s],i,e,n))}return{mins:o,maxs:r}}function Jr(t,e,n){if(!e||n===0)return t;let o=me(t);return _e(o,e,n),o}function Yr(t,e,n){if(!e||n===0)return t;switch(e){case"x":return{...t,x:t.x+n};case"y":return{...t,y:t.y+n};case"z":default:return{...t,z:t.z+n}}}function At(t){let{origin:e,mins:n,maxs:o,trace:r}=t;if(!r(e,n,o,e).startsolid)return{result:"good-position",origin:{...e}};let i=[];for(let a=0;a<_t.length;a++){let l=_t[a],{mins:d,maxs:f}=Xr(l,n,o),c=pn(e,l,n,o),m=r(c,d,f,c),h,u=0;if(m.startsolid)for(let E=0;E<fe.length;E++){if(l.normal[E]!==0)continue;let M=fe[E],v=me(c);if(_e(v,M,1),m=r(v,d,f,v),!m.startsolid){c=v,h=M,u=1;break}if(v=me(c),_e(v,M,-1),m=r(v,d,f,v),!m.startsolid){c=v,h=M,u=-1;break}}if(m.startsolid)continue;let _=_t[a^1],g=pn(e,_,n,o);if(g=Jr(g,h,u),m=r(c,d,f,g),m.startsolid)continue;let A=Kr(l.normal),V=O(m.endpos??g,R(A,.125)),b=ee(V,g),S=O(e,b);S=Yr(S,h,u),!r(S,n,o,S).startsolid&&i.push({origin:S,distance:ce(b)})}return i.length===0?{result:"no-good-position",origin:{...e}}:(i.sort((a,l)=>a.distance-l.distance),{result:"fixed",origin:{...i[0].origin}})}var jr=1.5,xn=.5,Zr=1.01;function qr(t){let{origin:e,cmd:n,frametime:o,pmFriction:r,pmStopSpeed:s,pmMaxSpeed:i,pmAccelerate:a,pmWaterSpeed:l,doclip:d,forward:f,right:c,mins:m,maxs:h,trace:u,overbounce:_=Zr,stepSize:g,maxBumps:A,maxClipPlanes:V}=t,b=$r({velocity:t.velocity,pmFriction:r,pmStopSpeed:s,frametime:o}),S=Qr({cmd:n,forward:f,right:c,pmMaxSpeed:i,pmWaterSpeed:l});if(S.wishspeed>0&&(b=Y({velocity:b,wishdir:S.wishdir,wishspeed:S.accelSpeed,accel:a,frametime:o})),!d){let C=R(b,o);return{origin:O(e,C),velocity:b,planes:[],blocked:0,stopped:b.x===0&&b.y===0&&b.z===0,stepped:!1,stepHeight:0}}if(!u||!m||!h)throw new Error("applyPmoveFlyMove: doclip=true requires trace/mins/maxs");return ae({origin:e,velocity:b,frametime:o,overbounce:_,trace:u,mins:m,maxs:h,stepSize:g,maxBumps:A,maxClipPlanes:V})}function $r(t){let{velocity:e,pmFriction:n,pmStopSpeed:o,frametime:r}=t,s=I(e);if(s<1)return{x:0,y:0,z:0};let i=n*jr,l=(s<o?o:s)*i*r,d=s-l;return d<0&&(d=0),d===s?e:R(e,d/s)}function Qr(t){let{cmd:e,forward:n,right:o,pmMaxSpeed:r,pmWaterSpeed:s}=t,i=w(n),a=w(o),d={x:i.x*e.forwardmove+a.x*e.sidemove,y:i.y*e.forwardmove+a.y*e.sidemove,z:i.z*e.forwardmove+a.z*e.sidemove},f=e.buttons??0;f&8&&(d=O(d,{x:0,y:0,z:s*xn})),f&16&&(d=O(d,{x:0,y:0,z:-s*xn}));let c=I(d),m=c===0?{x:0,y:0,z:0}:w(d);if(c>r){let u=r/c;d=R(d,u),c=r,m=c===0?{x:0,y:0,z:0}:w(d)}let h=c*2;return{wishdir:m,wishspeed:c,accelSpeed:h}}var es=1,ts=40,He=50,hn=350,ns=2048,yn=.1,os=800,rs=50,bn=.7,ss=18,is=1.01,as=2;function cs(t){let{pmFlags:e,pmTime:n,waterlevel:o,watertype:r,gravity:s,cmd:i,forward:a,origin:l,velocity:d,mins:f,maxs:c,viewheight:m,trace:h,pointContents:u,onGround:_,overbounce:g=is,stepSize:A=ss,maxBumps:V,maxClipPlanes:b}=t;if(n>0)return{pmFlags:e,pmTime:n,velocity:d,performedWaterJump:!1};let S=X(e,128),C=n,E=d,M=w({x:a.x,y:a.y,z:0}),v=ce(M)>0;if(o<2&&v){let T=O(l,R(M,es)),$=h(l,T,f,c),Pn=$.contents??0;$.fraction<1&&(Pn&536870912)!==0&&(S=G(S,128))}if(s===0)return{pmFlags:S,pmTime:C,velocity:E,performedWaterJump:!1};if(((i.buttons??0)&8)===0&&i.forwardmove<=0)return{pmFlags:S,pmTime:C,velocity:E,performedWaterJump:!1};if(o!==2)return{pmFlags:S,pmTime:C,velocity:E,performedWaterJump:!1};if((r&8192)!==0)return{pmFlags:S,pmTime:C,velocity:E,performedWaterJump:!1};if(!v)return{pmFlags:S,pmTime:C,velocity:E,performedWaterJump:!1};let W=O(l,R(M,ts)),H=h(l,W,f,c);if(H.fraction===1||!H.planeNormal||H.planeNormal.z>=bn)return{pmFlags:S,pmTime:C,velocity:E,performedWaterJump:!1};let x={x:M.x*He,y:M.y*He,z:hn},L=l,N=!0,B=ls(s);for(let T=0;T<B;T++){x={x:x.x,y:x.y,z:x.z-s*yn},x.z<0&&(N=!1);let $=ae({origin:L,velocity:x,frametime:yn,trace:h,mins:f,maxs:c,overbounce:g,stepSize:A,maxBumps:V,maxClipPlanes:b,hasTime:N});L=$.origin,x=$.velocity}let k=O(L,{x:0,y:0,z:-as}),F=h(L,k,f,c);return F.fraction===1||!F.planeNormal||F.planeNormal.z<bn||F.endpos.z<l.z?{pmFlags:S,pmTime:C,velocity:E,performedWaterJump:!1}:_&&Math.abs(l.z-F.endpos.z)<=A?{pmFlags:S,pmTime:C,velocity:E,performedWaterJump:!1}:Se({origin:F.endpos,mins:f,viewheight:m,pointContents:u}).waterlevel>=2?{pmFlags:S,pmTime:C,velocity:E,performedWaterJump:!1}:(S=G(S,8),C=ns,E={x:M.x*He,y:M.y*He,z:hn},{pmFlags:S,pmTime:C,velocity:E,performedWaterJump:!0})}function ls(t){if(t===0)return 0;let e=Math.floor(10*(os/t));return e<=0?0:Math.min(rs,e)}var Et=[0,-1,1];function vt(t){let{origin:e,mins:n,maxs:o,trace:r}=t;return!r(e,e,n,o).allsolid}function us(t){let{origin:e,velocity:n,mins:o,maxs:r,previousOrigin:s,trace:i}=t;if(vt({origin:e,mins:o,maxs:r,trace:i}))return{origin:{...e},velocity:{...n},resolution:"unchanged"};let a=At({origin:e,mins:o,maxs:r,trace:(l,d,f,c)=>i(l,c,d,f)});return a.result==="fixed"||a.result==="good-position"?{origin:a.origin,velocity:{...n},resolution:"fixed"}:{origin:{...s},velocity:{...n},resolution:"reverted"}}function ds(t){let{origin:e,mins:n,maxs:o,trace:r}=t;for(let s of Et)for(let i of Et)for(let a of Et){let l={x:e.x+a,y:e.y+i,z:e.z+s};if(vt({origin:l,mins:n,maxs:o,trace:r}))return{origin:l,snapped:a!==0||i!==0||s!==0}}return{origin:{...e},snapped:!1}}function fs(t,e){return{x:t.x+e.x,y:t.y+e.y,z:t.z+e.z}}function ms(t){return t>89&&t<180?89:t<271&&t>=180?271:t}function ps(t){let{pmFlags:e,cmdAngles:n,deltaAngles:o}=t,r;(e&32)!==0?r={x:0,y:n.y+o.y,z:0}:(r=fs(n,o),r={...r,x:ms(r.x)});let s=oe(r);return{viewangles:r,...s}}var xs=200,hs=200,ys=200,bs=140,Ts=150,Ss=3;function gs(t){let e=xe(t);return e>89&&e<180?89:e<271&&e>=180?271:e}function _s(t,e){return{x:gs(t.x+e.x),y:xe(t.y+e.y),z:xe(t.z+e.z)}}function As(t,e){let n=e.sensitivityX??e.sensitivity,o=(e.sensitivityY??e.sensitivity)*(e.invertY?-1:1);return{x:t.deltaY*o,y:t.deltaX*n,z:0}}var Tn=(T=>(T[T.bad=0]="bad",T[T.muzzleflash=1]="muzzleflash",T[T.muzzleflash2=2]="muzzleflash2",T[T.temp_entity=3]="temp_entity",T[T.layout=4]="layout",T[T.inventory=5]="inventory",T[T.nop=6]="nop",T[T.disconnect=7]="disconnect",T[T.reconnect=8]="reconnect",T[T.sound=9]="sound",T[T.print=10]="print",T[T.stufftext=11]="stufftext",T[T.serverdata=12]="serverdata",T[T.configstring=13]="configstring",T[T.spawnbaseline=14]="spawnbaseline",T[T.centerprint=15]="centerprint",T[T.download=16]="download",T[T.playerinfo=17]="playerinfo",T[T.packetentities=18]="packetentities",T[T.deltapacketentities=19]="deltapacketentities",T[T.frame=20]="frame",T[T.splitclient=21]="splitclient",T[T.configblast=22]="configblast",T[T.spawnbaselineblast=23]="spawnbaselineblast",T[T.level_restart=24]="level_restart",T[T.damage=25]="damage",T[T.locprint=26]="locprint",T[T.fog=27]="fog",T[T.waitingforplayers=28]="waitingforplayers",T[T.bot_chat=29]="bot_chat",T[T.poi=30]="poi",T[T.help_path=31]="help_path",T[T.muzzleflash3=32]="muzzleflash3",T[T.achievement=33]="achievement",T))(Tn||{}),Sn=(s=>(s[s.bad=0]="bad",s[s.nop=1]="nop",s[s.move=2]="move",s[s.userinfo=3]="userinfo",s[s.stringcmd=4]="stringcmd",s))(Sn||{});var gn=(p=>(p[p.GUNSHOT=0]="GUNSHOT",p[p.BLOOD=1]="BLOOD",p[p.BLASTER=2]="BLASTER",p[p.RAILTRAIL=3]="RAILTRAIL",p[p.SHOTGUN=4]="SHOTGUN",p[p.EXPLOSION1=5]="EXPLOSION1",p[p.EXPLOSION2=6]="EXPLOSION2",p[p.ROCKET_EXPLOSION=7]="ROCKET_EXPLOSION",p[p.GRENADE_EXPLOSION=8]="GRENADE_EXPLOSION",p[p.SPARKS=9]="SPARKS",p[p.SPLASH=10]="SPLASH",p[p.BUBBLETRAIL=11]="BUBBLETRAIL",p[p.SCREEN_SPARKS=12]="SCREEN_SPARKS",p[p.SHIELD_SPARKS=13]="SHIELD_SPARKS",p[p.BULLET_SPARKS=14]="BULLET_SPARKS",p[p.LASER_SPARKS=15]="LASER_SPARKS",p[p.PARASITE_ATTACK=16]="PARASITE_ATTACK",p[p.ROCKET_EXPLOSION_WATER=17]="ROCKET_EXPLOSION_WATER",p[p.GRENADE_EXPLOSION_WATER=18]="GRENADE_EXPLOSION_WATER",p[p.MEDIC_CABLE_ATTACK=19]="MEDIC_CABLE_ATTACK",p[p.BFG_EXPLOSION=20]="BFG_EXPLOSION",p[p.BFG_BIGEXPLOSION=21]="BFG_BIGEXPLOSION",p[p.BOSSTPORT=22]="BOSSTPORT",p[p.BFG_LASER=23]="BFG_LASER",p[p.GRAPPLE_CABLE=24]="GRAPPLE_CABLE",p[p.WELDING_SPARKS=25]="WELDING_SPARKS",p[p.GREENBLOOD=26]="GREENBLOOD",p[p.BLUEHYPERBLASTER=27]="BLUEHYPERBLASTER",p[p.PLASMA_EXPLOSION=28]="PLASMA_EXPLOSION",p[p.TUNNEL_SPARKS=29]="TUNNEL_SPARKS",p[p.BLASTER2=30]="BLASTER2",p[p.RAILTRAIL2=31]="RAILTRAIL2",p[p.FLAME=32]="FLAME",p[p.LIGHTNING=33]="LIGHTNING",p[p.DEBUGTRAIL=34]="DEBUGTRAIL",p[p.PLAIN_EXPLOSION=35]="PLAIN_EXPLOSION",p[p.FLASHLIGHT=36]="FLASHLIGHT",p[p.FORCEWALL=37]="FORCEWALL",p[p.HEATBEAM=38]="HEATBEAM",p[p.MONSTER_HEATBEAM=39]="MONSTER_HEATBEAM",p[p.STEAM=40]="STEAM",p[p.BUBBLETRAIL2=41]="BUBBLETRAIL2",p[p.MOREBLOOD=42]="MOREBLOOD",p[p.HEATBEAM_SPARKS=43]="HEATBEAM_SPARKS",p[p.HEATBEAM_STEAM=44]="HEATBEAM_STEAM",p[p.CHAINFIST_SMOKE=45]="CHAINFIST_SMOKE",p[p.ELECTRIC_SPARKS=46]="ELECTRIC_SPARKS",p[p.TRACKER_EXPLOSION=47]="TRACKER_EXPLOSION",p[p.TELEPORT_EFFECT=48]="TELEPORT_EFFECT",p[p.DBALL_GOAL=49]="DBALL_GOAL",p[p.WIDOWBEAMOUT=50]="WIDOWBEAMOUT",p[p.NUKEBLAST=51]="NUKEBLAST",p[p.WIDOWSPLASH=52]="WIDOWSPLASH",p[p.EXPLOSION1_BIG=53]="EXPLOSION1_BIG",p[p.EXPLOSION1_NP=54]="EXPLOSION1_NP",p[p.FLECHETTE=55]="FLECHETTE",p[p.BLUEHYPERBLASTER_KEX=56]="BLUEHYPERBLASTER_KEX",p[p.BFG_ZAP=57]="BFG_ZAP",p[p.BERSERK_SLAM=58]="BERSERK_SLAM",p[p.GRAPPLE_CABLE_2=59]="GRAPPLE_CABLE_2",p[p.POWER_SPLASH=60]="POWER_SPLASH",p[p.LIGHTNING_BEAM=61]="LIGHTNING_BEAM",p[p.EXPLOSION1_NL=62]="EXPLOSION1_NL",p[p.EXPLOSION2_NL=63]="EXPLOSION2_NL",p))(gn||{});var Es=1024,vs=256,Vs=16,Ns=64,Cs=512,Os=1400,Rs=0,Ms=1,Ps=2,ws=3,Ls=4,Fs=5,zs=6,Ds=7,Us=8,Bs=9,Is=10,Gs=11,Ws=12,ks=13;var _n=(i=>(i[i.LAYOUTS_LAYOUT=1]="LAYOUTS_LAYOUT",i[i.LAYOUTS_INVENTORY=2]="LAYOUTS_INVENTORY",i[i.LAYOUTS_HIDE_HUD=4]="LAYOUTS_HIDE_HUD",i[i.LAYOUTS_INTERMISSION=8]="LAYOUTS_INTERMISSION",i[i.LAYOUTS_HELP=16]="LAYOUTS_HELP",i[i.LAYOUTS_HIDE_CROSSHAIR=32]="LAYOUTS_HIDE_CROSSHAIR",i))(_n||{});function Vt(t){return t<<16>>16}function An(t,e,n){let o=Math.floor(n/2),r=n%2!==0,s=e+o,i=t[s]||0;if(r){let a=t[s+1]||0,l=i>>>8&255;return(a&255)<<8|l}else return i&65535}function Hs(t,e,n,o){let r=Math.floor(n/2),s=n%2!==0,i=e+r;if(t[i]===void 0&&(t[i]=0),!s)t[i]=Vt(o);else{t[i+1]===void 0&&(t[i+1]=0);let a=t[i],l=t[i+1],d=o&255,f=a&255|d<<8;t[i]=Vt(f);let m=o>>>8&255|l&65280;t[i+1]=Vt(m)}}function Nt(t,e,n,o,r){let s=r*n,i=Math.floor(s/8),a=s%8,l=(1<<r)-1<<a,f=An(t,e,i)&~l|o<<a&l;Hs(t,e,i,f&65535)}function Ct(t,e,n,o){let r=o*n,s=Math.floor(r/8),i=r%8,a=(1<<o)-1<<i;return(An(t,e,s)&a)>>>i}var En=(v=>(v.QuadDamage="quad",v.Invulnerability="invulnerability",v.EnviroSuit="enviro_suit",v.Rebreather="rebreather",v.Silencer="silencer",v.PowerScreen="power_screen",v.PowerShield="power_shield",v.QuadFire="quad_fire",v.Invisibility="invisibility",v.Bandolier="bandolier",v.AmmoPack="ammo_pack",v.IRGoggles="ir_goggles",v.DoubleDamage="double_damage",v.SphereVengeance="sphere_vengeance",v.SphereHunter="sphere_hunter",v.SphereDefender="sphere_defender",v.Doppelganger="doppelganger",v.TagToken="tag_token",v.TechResistance="tech_resistance",v.TechStrength="tech_strength",v.TechHaste="tech_haste",v.TechRegeneration="tech_regeneration",v.Flashlight="flashlight",v.Compass="compass",v))(En||{});var vn=(y=>(y[y.STAT_HEALTH_ICON=0]="STAT_HEALTH_ICON",y[y.STAT_HEALTH=1]="STAT_HEALTH",y[y.STAT_AMMO_ICON=2]="STAT_AMMO_ICON",y[y.STAT_AMMO=3]="STAT_AMMO",y[y.STAT_ARMOR_ICON=4]="STAT_ARMOR_ICON",y[y.STAT_ARMOR=5]="STAT_ARMOR",y[y.STAT_SELECTED_ICON=6]="STAT_SELECTED_ICON",y[y.STAT_PICKUP_ICON=7]="STAT_PICKUP_ICON",y[y.STAT_PICKUP_STRING=8]="STAT_PICKUP_STRING",y[y.STAT_TIMER_ICON=9]="STAT_TIMER_ICON",y[y.STAT_TIMER=10]="STAT_TIMER",y[y.STAT_HELPICON=11]="STAT_HELPICON",y[y.STAT_SELECTED_ITEM=12]="STAT_SELECTED_ITEM",y[y.STAT_LAYOUTS=13]="STAT_LAYOUTS",y[y.STAT_FRAGS=14]="STAT_FRAGS",y[y.STAT_FLASHES=15]="STAT_FLASHES",y[y.STAT_CHASE=16]="STAT_CHASE",y[y.STAT_SPECTATOR=17]="STAT_SPECTATOR",y[y.STAT_CTF_TEAM1_PIC=18]="STAT_CTF_TEAM1_PIC",y[y.STAT_CTF_TEAM1_CAPS=19]="STAT_CTF_TEAM1_CAPS",y[y.STAT_CTF_TEAM2_PIC=20]="STAT_CTF_TEAM2_PIC",y[y.STAT_CTF_TEAM2_CAPS=21]="STAT_CTF_TEAM2_CAPS",y[y.STAT_CTF_FLAG_PIC=22]="STAT_CTF_FLAG_PIC",y[y.STAT_CTF_JOINED_TEAM1_PIC=23]="STAT_CTF_JOINED_TEAM1_PIC",y[y.STAT_CTF_JOINED_TEAM2_PIC=24]="STAT_CTF_JOINED_TEAM2_PIC",y[y.STAT_CTF_TEAM1_HEADER=25]="STAT_CTF_TEAM1_HEADER",y[y.STAT_CTF_TEAM2_HEADER=26]="STAT_CTF_TEAM2_HEADER",y[y.STAT_CTF_TECH=27]="STAT_CTF_TECH",y[y.STAT_CTF_ID_VIEW=28]="STAT_CTF_ID_VIEW",y[y.STAT_CTF_MATCH=29]="STAT_CTF_MATCH",y[y.STAT_CTF_ID_VIEW_COLOR=30]="STAT_CTF_ID_VIEW_COLOR",y[y.STAT_CTF_TEAMINFO=31]="STAT_CTF_TEAMINFO",y[y.STAT_WEAPONS_OWNED_1=32]="STAT_WEAPONS_OWNED_1",y[y.STAT_WEAPONS_OWNED_2=33]="STAT_WEAPONS_OWNED_2",y[y.STAT_AMMO_INFO_START=34]="STAT_AMMO_INFO_START",y[y.STAT_POWERUP_INFO_START=41]="STAT_POWERUP_INFO_START",y[y.STAT_KEY_A=44]="STAT_KEY_A",y[y.STAT_KEY_B=45]="STAT_KEY_B",y[y.STAT_KEY_C=46]="STAT_KEY_C",y[y.STAT_ACTIVE_WHEEL_WEAPON=47]="STAT_ACTIVE_WHEEL_WEAPON",y[y.STAT_COOP_RESPAWN=48]="STAT_COOP_RESPAWN",y[y.STAT_LIVES=49]="STAT_LIVES",y[y.STAT_HIT_MARKER=50]="STAT_HIT_MARKER",y[y.STAT_SELECTED_ITEM_NAME=51]="STAT_SELECTED_ITEM_NAME",y[y.STAT_HEALTH_BARS=52]="STAT_HEALTH_BARS",y[y.STAT_ACTIVE_WEAPON=53]="STAT_ACTIVE_WEAPON",y[y.STAT_LAST=54]="STAT_LAST",y))(vn||{}),Ke=12,Xe=9,Ks=Math.ceil(Ke*Xe/16),Je=23,Ye=2,Xs=Math.ceil(Je*Ye/16),Vn={power_screen:0,power_shield:1,quad:3,quad_fire:4,invulnerability:5,invisibility:6,silencer:7,rebreather:8,enviro_suit:9,bandolier:10,ammo_pack:10,ir_goggles:11,double_damage:12,sphere_vengeance:13,sphere_hunter:14,sphere_defender:15,doppelganger:16,flashlight:17,compass:18,tech_resistance:19,tech_strength:20,tech_haste:21,tech_regeneration:22,tag_token:-1};function Js(t,e,n){if(e<0||e>=Ke)return;let o=n;o>511&&(o=511),o<0&&(o=0),Nt(t,34,e,o,Xe)}function Ys(t,e){return e<0||e>=Ke?0:Ct(t,34,e,Xe)}function js(t,e,n){let o;if(typeof e=="number"?o=e:o=Vn[e],o===void 0||o<0||o>=Je)return;let r=n;r>3&&(r=3),r<0&&(r=0),Nt(t,41,o,r,Ye)}function Zs(t,e){let n;return typeof e=="number"?n=e:n=Vn[e],n===void 0||n<0||n>=Je?0:Ct(t,41,n,Ye)}function qs(t,e){t.writeByte(e.msec),t.writeByte(e.buttons),t.writeAngle16(e.angles.x),t.writeAngle16(e.angles.y),t.writeAngle16(e.angles.z),t.writeShort(e.forwardmove),t.writeShort(e.sidemove),t.writeShort(e.upmove),t.writeByte(0),t.writeByte(0)}var Nn=(b=>(b[b.MinLight=1]="MinLight",b[b.ViewerModel=2]="ViewerModel",b[b.WeaponModel=4]="WeaponModel",b[b.FullBright=8]="FullBright",b[b.DepthHack=16]="DepthHack",b[b.Translucent=32]="Translucent",b[b.FrameLerp=64]="FrameLerp",b[b.Beam=128]="Beam",b[b.CustomLight=256]="CustomLight",b[b.Glow=512]="Glow",b[b.ShellRed=1024]="ShellRed",b[b.ShellGreen=2048]="ShellGreen",b[b.ShellBlue=4096]="ShellBlue",b[b.IrVisible=32768]="IrVisible",b[b.ShellDouble=65536]="ShellDouble",b[b.ShellHalfDam=131072]="ShellHalfDam",b[b.MinLightPlus=262144]="MinLightPlus",b[b.ExtraLight=524288]="ExtraLight",b[b.BeamLightning=1048576]="BeamLightning",b))(Nn||{});var $s=[0,145,227,114,7,150,228,117,14,159,237,124,9,152,234,123,28,141,255,110,27,138,248,105,18,131,241,96,21,132,246,103,56,169,219,74,63,174,220,77,54,167,213,68,49,160,210,67,36,181,199,86,35,178,192,81,42,187,201,88,45,188,206,95,112,225,147,2,119,230,148,5,126,239,157,12,121,232,154,11,108,253,143,30,107,250,136,25,98,243,129,16,101,244,134,23,72,217,171,58,79,222,172,61,70,215,165,52,65,208,162,51,84,197,183,38,83,194,176,33,90,203,185,40,93,204,190,47,224,113,3,146,231,118,4,149,238,127,13,156,233,120,10,155,252,109,31,142,251,106,24,137,242,99,17,128,245,100,22,135,216,73,59,170,223,78,60,173,214,71,53,164,209,64,50,163,196,85,39,182,195,82,32,177,202,91,41,184,205,92,46,191,144,1,115,226,151,6,116,229,158,15,125,236,153,8,122,235,140,29,111,254,139,26,104,249,130,19,97,240,133,20,102,247,168,57,75,218,175,62,76,221,166,55,69,212,161,48,66,211,180,37,86,199,179,34,80,193,186,43,89,200,189,44,94,207];function Qs(t){let e=0;for(let n=0;n<t.length;n++)e=$s[(e^t[n])&255];return e}var Ot={};qe(Ot,{U_ANGLE1:()=>ii,U_ANGLE2:()=>ai,U_ANGLE3:()=>ci,U_EFFECTS:()=>di,U_EVENT:()=>pi,U_FRAME:()=>li,U_MODEL:()=>ti,U_MODEL2:()=>hi,U_MODEL3:()=>yi,U_MODEL4:()=>bi,U_MOREBITS:()=>xi,U_NUMBER:()=>ei,U_ORIGIN1:()=>oi,U_ORIGIN2:()=>ri,U_ORIGIN3:()=>si,U_REMOVE:()=>Ti,U_RENDERFX:()=>fi,U_SKIN:()=>ui,U_SOLID:()=>mi,U_SOUND:()=>ni});var ei=1,ti=2,ni=4,oi=8,ri=16,si=32,ii=64,ai=128,ci=256,li=512,ui=1024,di=2048,fi=4096,mi=8192,pi=16384,xi=32768,hi=1,yi=2,bi=4,Ti=32768;var Ae=.025,Rt=33554432,je={None:0,Feet:1,Waist:2,Under:3},Si=(t,e)=>{let n={...t.origin};n.z-=.25;let o=e(t.origin,n);return{...t,onGround:o.fraction<1}},gi=(t,e)=>{let n={...t.origin},{mins:o,maxs:r}=t;if(n.z=t.origin.z+o.z+1,!(e(n)&Rt))return{...t,waterLevel:je.None};let i=je.Feet,a=t.origin.z+(o.z+r.z)*.5;if(n.z=a,e(n)&Rt){i=je.Waist;let d=t.origin.z+22;n.z=d,e(n)&Rt&&(i=je.Under)}return{...t,waterLevel:i}},_i=(t,e,n,o)=>{let r={...t};r=Si(r,n),r=gi(r,o);let{origin:s,velocity:i,onGround:a,waterLevel:l,viewAngles:d}=r,f=l>=2?d:{x:d.x>180?(d.x-360)/3:d.x/3,y:d.y,z:d.z},{forward:c,right:m}=oe(f),h=We({velocity:i,frametime:Ae,onGround:a,groundIsSlick:!1,onLadder:!1,waterlevel:l,pmFriction:6,pmStopSpeed:100,pmWaterFriction:1}),u=l>=2?gt({forward:c,right:m,cmd:e,maxSpeed:320}):St({forward:c,right:m,cmd:e,maxSpeed:320}),_=Y({velocity:h,wishdir:u.wishdir,wishspeed:u.wishspeed,accel:a||l>=2?10:1,frametime:Ae}),g=n(s,{x:s.x+_.x*Ae,y:s.y+_.y*Ae,z:s.z+_.z*Ae});return{...r,origin:g.endpos,velocity:_}};var Mt=class{constructor(e){e instanceof Uint8Array?this.view=new DataView(e.buffer,e.byteOffset,e.byteLength):this.view=new DataView(e),this.offset=0,this.length=this.view.byteLength}getPosition(){return this.offset}seek(e){if(e<0||e>this.length)throw new Error(`Seek out of bounds: ${e} (length: ${this.length})`);this.offset=e}hasMore(){return this.offset<this.length}readChar(){let e=this.view.getInt8(this.offset);return this.offset+=1,e}readByte(){let e=this.view.getUint8(this.offset);return this.offset+=1,e}readShort(){let e=this.view.getInt16(this.offset,!0);return this.offset+=2,e}readUShort(){let e=this.view.getUint16(this.offset,!0);return this.offset+=2,e}readLong(){let e=this.view.getInt32(this.offset,!0);return this.offset+=4,e}readULong(){let e=this.view.getUint32(this.offset,!0);return this.offset+=4,e}readFloat(){let e=this.view.getFloat32(this.offset,!0);return this.offset+=4,e}readString(){let e="";for(;this.offset<this.length;){let n=this.readChar();if(n===-1||n===0)break;e+=String.fromCharCode(n)}return e}readStringLine(){let e="";for(;this.offset<this.length;){let n=this.readChar();if(n===-1||n===0||n===10)break;e+=String.fromCharCode(n)}return e}readCoord(){return this.readShort()*(1/8)}readAngle(){return this.readChar()*(360/256)}readAngle16(){return this.readShort()*360/65536}readData(e){if(this.offset+e>this.length)throw new Error(`Read out of bounds: ${this.offset+e} (length: ${this.length})`);let n=new Uint8Array(this.view.buffer,this.view.byteOffset+this.offset,e);return this.offset+=e,new Uint8Array(n)}readPos(e){e.x=this.readCoord(),e.y=this.readCoord(),e.z=this.readCoord()}readDir(e){let n=this.readByte();if(n>=162){e.x=0,e.y=0,e.z=0;return}let o=j[n];e.x=o[0],e.y=o[1],e.z=o[2]}};var Ee=class{constructor(e=1400){typeof e=="number"?(this.buffer=new Uint8Array(e),this.fixed=!1):(this.buffer=e,this.fixed=!0),this.view=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),this.offset=0}ensureSpace(e){if(this.offset+e>this.buffer.byteLength){if(this.fixed)throw new Error(`Buffer overflow: capacity ${this.buffer.byteLength}, needed ${this.offset+e}`);let n=Math.max(this.buffer.byteLength*2,this.offset+e),o=new Uint8Array(n);o.set(this.buffer),this.buffer=o,this.view=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength)}}writeByte(e){this.ensureSpace(1),this.view.setUint8(this.offset,e),this.offset+=1}writeChar(e){this.ensureSpace(1),this.view.setInt8(this.offset,e),this.offset+=1}writeShort(e){this.ensureSpace(2),this.view.setInt16(this.offset,e,!0),this.offset+=2}writeLong(e){this.ensureSpace(4),this.view.setInt32(this.offset,e,!0),this.offset+=4}writeFloat(e){this.ensureSpace(4),this.view.setFloat32(this.offset,e,!0),this.offset+=4}writeString(e){let n=e.length;this.ensureSpace(n+1);for(let o=0;o<n;o++)this.view.setUint8(this.offset+o,e.charCodeAt(o));this.view.setUint8(this.offset+n,0),this.offset+=n+1}writeCoord(e){this.writeShort(Math.trunc(e*8))}writeAngle(e){this.writeByte(Math.trunc(e*256/360)&255)}writeAngle16(e){this.writeShort(Math.trunc(e*65536/360)&65535)}writePos(e){this.writeCoord(e.x),this.writeCoord(e.y),this.writeCoord(e.z)}writeDir(e){let n=-1,o=0;if(e.x===0&&e.y===0&&e.z===0){this.writeByte(0);return}for(let r=0;r<j.length;r++){let s=j[r],i=e.x*s[0]+e.y*s[1]+e.z*s[2];i>n&&(n=i,o=r)}this.writeByte(o)}getData(){return this.buffer.slice(0,this.offset)}getBuffer(){return this.buffer}getOffset(){return this.offset}reset(){this.offset=0}};var Pt=class{constructor(e=1024){this.buffer=new Uint8Array(e),this.view=new DataView(this.buffer.buffer),this.offset=0}ensureCapacity(e){if(this.offset+e>this.buffer.length){let n=Math.max(this.buffer.length*2,this.offset+e),o=new Uint8Array(n);o.set(this.buffer),this.buffer=o,this.view=new DataView(this.buffer.buffer)}}getData(){return this.buffer.slice(0,this.offset)}writeByte(e){this.ensureCapacity(1),this.view.setUint8(this.offset,e),this.offset+=1}writeChar(e){this.ensureCapacity(1),this.view.setInt8(this.offset,e),this.offset+=1}writeShort(e){this.ensureCapacity(2),this.view.setInt16(this.offset,e,!0),this.offset+=2}writeUShort(e){this.ensureCapacity(2),this.view.setUint16(this.offset,e,!0),this.offset+=2}writeLong(e){this.ensureCapacity(4),this.view.setInt32(this.offset,e,!0),this.offset+=4}writeFloat(e){this.ensureCapacity(4),this.view.setFloat32(this.offset,e,!0),this.offset+=4}writeString(e){let n=e.length+1;this.ensureCapacity(n);for(let o=0;o<e.length;o++)this.view.setUint8(this.offset+o,e.charCodeAt(o));this.view.setUint8(this.offset+e.length,0),this.offset+=n}writeData(e){this.ensureCapacity(e.length),this.buffer.set(e,this.offset),this.offset+=e.length}writeCoord(e){this.writeShort(Math.round(e*8))}writeAngle(e){this.writeByte(Math.round(e*256/360)&255)}writeAngle16(e){this.writeShort(Math.round(e*65536/360))}writeDir(e,n,o){let r=0,s=-999999,i=Math.sqrt(e*e+n*n+o*o);if(i>0){e/=i,n/=i,o/=i;for(let a=0;a<162;a++){let l=e*j[a][0]+n*j[a][1]+o*j[a][2];l>s&&(s=l,r=a)}}this.writeByte(r)}};var D=class D{constructor(){this.qport=0;this.incomingSequence=0;this.outgoingSequence=0;this.incomingAcknowledged=0;this.incomingReliableAcknowledged=!1;this.incomingReliableSequence=0;this.outgoingReliableSequence=0;this.reliableLength=0;this.lastReceived=0;this.lastSent=0;this.remoteAddress=null;this.reliableMessage=new Ee(D.MAX_MSGLEN);let e=Date.now();this.lastReceived=e,this.lastSent=e,this.qport=Math.floor(Math.random()*65536)}setup(e,n=null){this.qport=e,this.remoteAddress=n,this.reset()}reset(){this.incomingSequence=0,this.outgoingSequence=0,this.incomingAcknowledged=0,this.incomingReliableAcknowledged=!1,this.incomingReliableSequence=0,this.outgoingReliableSequence=0,this.reliableLength=0,this.reliableMessage.reset(),this.lastReceived=Date.now(),this.lastSent=Date.now()}transmit(e){this.outgoingSequence++,this.lastSent=Date.now();let n=D.PACKET_HEADER,o=this.reliableLength>0?this.reliableLength+2:0,r=e?e.length:0;n+o+r>D.MAX_MSGLEN&&(r=D.MAX_MSGLEN-n-o,r<0&&(r=0));let s=new ArrayBuffer(n+o+r),i=new DataView(s),a=new Uint8Array(s),l=this.outgoingSequence;this.reliableLength>0&&(l|=2147483648,(this.outgoingReliableSequence&1)!==0&&(l|=1073741824)),i.setUint32(0,l,!0);let d=this.incomingSequence;(this.incomingReliableSequence&1)!==0&&(d|=2147483648),i.setUint32(4,d,!0),i.setUint16(8,this.qport,!0);let f=n;if(this.reliableLength>0){i.setUint16(f,this.reliableLength,!0),f+=2;let m=this.reliableMessage.getBuffer().subarray(0,this.reliableLength);a.set(m,f),f+=this.reliableLength}if(e&&r>0){let c=e.slice(0,r);a.set(c,f)}return a}process(e){if(e.length<D.PACKET_HEADER)return null;this.lastReceived=Date.now();let n=new DataView(e.buffer,e.byteOffset,e.byteLength),o=n.getUint32(0,!0),r=n.getUint32(4,!0),s=n.getUint16(8,!0);if(this.qport!==s)return null;let i=o&1073741823;if((i-this.incomingSequence|0)<=0)return null;this.incomingSequence=i;let a=r&2147483647,l=(r&2147483648)!==0;if(a>this.incomingAcknowledged&&(this.incomingAcknowledged=a),this.reliableLength>0){let u=l?1:0,_=this.outgoingReliableSequence&1;u!==_&&(this.reliableLength=0,this.reliableMessage.reset(),this.outgoingReliableSequence^=1)}let d=(o&2147483648)!==0,f=(o&1073741824)!==0?1:0,c=D.PACKET_HEADER,m=null;if(d){if(c+2>e.byteLength)return null;let u=n.getUint16(c,!0);c+=2;let _=this.incomingReliableSequence&1;if(f===_){if(this.incomingReliableSequence++,c+u>e.byteLength)return null;m=e.slice(c,c+u)}c+=u}let h=e.slice(c);if(m&&m.length>0){let u=m.length+h.length,_=new Uint8Array(u);return _.set(m,0),_.set(h,m.length),_}return h||new Uint8Array(0)}canSendReliable(){return this.reliableLength===0}writeReliableByte(e){if(this.reliableLength+1>D.MAX_MSGLEN-D.HEADER_OVERHEAD)throw new Error("NetChan reliable buffer overflow");this.reliableMessage.writeByte(e),this.reliableLength++}writeReliableShort(e){if(this.reliableLength+2>D.MAX_MSGLEN-D.HEADER_OVERHEAD)throw new Error("NetChan reliable buffer overflow");this.reliableMessage.writeShort(e),this.reliableLength+=2}writeReliableLong(e){if(this.reliableLength+4>D.MAX_MSGLEN-D.HEADER_OVERHEAD)throw new Error("NetChan reliable buffer overflow");this.reliableMessage.writeLong(e),this.reliableLength+=4}writeReliableString(e){let n=e.length+1;if(this.reliableLength+n>D.MAX_MSGLEN-D.HEADER_OVERHEAD)throw new Error("NetChan reliable buffer overflow");this.reliableMessage.writeString(e),this.reliableLength+=n}getReliableData(){return this.reliableLength===0?new Uint8Array(0):this.reliableMessage.getBuffer().subarray(0,this.reliableLength)}needsKeepalive(e){return e-this.lastSent>1e3}isTimedOut(e,n=3e4){return e-this.lastReceived>n}};D.MAX_MSGLEN=1400,D.FRAGMENT_SIZE=1024,D.PACKET_HEADER=10,D.HEADER_OVERHEAD=D.PACKET_HEADER+2;var wt=D;var Cn=(S=>(S.Blaster="blaster",S.Shotgun="shotgun",S.SuperShotgun="supershotgun",S.Machinegun="machinegun",S.Chaingun="chaingun",S.HandGrenade="grenades",S.GrenadeLauncher="grenadelauncher",S.RocketLauncher="rocketlauncher",S.HyperBlaster="hyperblaster",S.Railgun="railgun",S.BFG10K="bfg10k",S.Grapple="grapple",S.ChainFist="chainfist",S.EtfRifle="etf_rifle",S.ProxLauncher="prox_launcher",S.IonRipper="ionripper",S.PlasmaBeam="plasmabeam",S.Phalanx="phalanx",S.Disruptor="disruptor",S.Trap="trap",S))(Cn||{});var Lt=(u=>(u[u.Bullets=0]="Bullets",u[u.Shells=1]="Shells",u[u.Rockets=2]="Rockets",u[u.Grenades=3]="Grenades",u[u.Cells=4]="Cells",u[u.Slugs=5]="Slugs",u[u.MagSlugs=6]="MagSlugs",u[u.Trap=7]="Trap",u[u.Flechettes=8]="Flechettes",u[u.Tesla=9]="Tesla",u[u.Disruptor=10]="Disruptor",u[u.Prox=11]="Prox",u[u.Nuke=12]="Nuke",u[u.Rounds=13]="Rounds",u))(Lt||{}),Ai=Object.keys(Lt).length/2,On=(m=>(m.Shells="ammo_shells",m.Bullets="ammo_bullets",m.Rockets="ammo_rockets",m.Grenades="ammo_grenades",m.Cells="ammo_cells",m.Slugs="ammo_slugs",m.MagSlugs="ammo_magslug",m.Flechettes="ammo_flechettes",m.Disruptor="ammo_disruptor",m.Tesla="ammo_tesla",m.Trap="ammo_trap",m.Prox="ammo_prox",m))(On||{});var Ei=["blaster","shotgun","supershotgun","machinegun","chaingun","grenadelauncher","rocketlauncher","grenades","hyperblaster","railgun","bfg10k"],vi={blaster:null,shotgun:1,supershotgun:1,machinegun:0,chaingun:0,grenades:3,grenadelauncher:3,rocketlauncher:2,hyperblaster:4,railgun:5,bfg10k:4,grapple:null,chainfist:null,etf_rifle:8,prox_launcher:11,ionripper:4,plasmabeam:4,phalanx:6,disruptor:10,trap:7};var ml=32,Rn=(c=>(c[c.Auto=0]="Auto",c[c.Weapon=1]="Weapon",c[c.Voice=2]="Voice",c[c.Item=3]="Item",c[c.Body=4]="Body",c[c.Aux=5]="Aux",c[c.Footstep=6]="Footstep",c[c.Aux3=7]="Aux3",c[c.NoPhsAdd=8]="NoPhsAdd",c[c.Reliable=16]="Reliable",c[c.ForcePos=32]="ForcePos",c))(Rn||{}),pl=-1,xl=0,hl=1,yl=2,bl=3,Tl=80,Sl=.003;function Mn(t){return t===3?t*.001:t*5e-4}function Vi(t){let e=Mn(t);return e<=0?Number.POSITIVE_INFINITY:80+1/e}return Dn(Ni);})();
|
|
1
|
+
"use strict";var Quake2Shared=(()=>{var Ze=Object.defineProperty;var wn=Object.getOwnPropertyDescriptor;var Ln=Object.getOwnPropertyNames;var Fn=Object.prototype.hasOwnProperty;var qe=(t,e)=>{for(var n in e)Ze(t,n,{get:e[n],enumerable:!0})},zn=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ln(e))!Fn.call(t,o)&&o!==n&&Ze(t,o,{get:()=>e[o],enumerable:!(r=wn(e,o))||r.enumerable});return t};var Dn=t=>zn(Ze({},"__esModule",{value:!0}),t);var Ni={};qe(Ni,{AMMO_MAX:()=>Ke,AMMO_TYPE_COUNT:()=>Ai,ANORMS:()=>j,ATTN_IDLE:()=>yl,ATTN_LOOP_NONE:()=>pl,ATTN_NONE:()=>xl,ATTN_NORM:()=>hl,ATTN_STATIC:()=>bl,AmmoItemId:()=>Rn,AmmoType:()=>Lt,BinaryStream:()=>Mt,BinaryWriter:()=>Ee,CGAME_EXPORT_KEYS:()=>co,CGAME_IMPORT_KEYS:()=>ao,CMD_BACKUP:()=>Ns,CONTENTS_AREAPORTAL:()=>ki,CONTENTS_AUX:()=>Di,CONTENTS_CURRENT_0:()=>mr,CONTENTS_CURRENT_180:()=>xr,CONTENTS_CURRENT_270:()=>hr,CONTENTS_CURRENT_90:()=>pr,CONTENTS_CURRENT_DOWN:()=>br,CONTENTS_CURRENT_UP:()=>yr,CONTENTS_DEADMONSTER:()=>Yi,CONTENTS_DETAIL:()=>ji,CONTENTS_LADDER:()=>It,CONTENTS_LAVA:()=>Ui,CONTENTS_MIST:()=>Gi,CONTENTS_MONSTER:()=>Ji,CONTENTS_MONSTERCLIP:()=>Ki,CONTENTS_NONE:()=>Me,CONTENTS_NO_WATERJUMP:()=>fr,CONTENTS_ORIGIN:()=>Xi,CONTENTS_PLAYER:()=>qi,CONTENTS_PLAYERCLIP:()=>Hi,CONTENTS_PROJECTILE:()=>$i,CONTENTS_PROJECTILECLIP:()=>Wi,CONTENTS_SLIME:()=>Bi,CONTENTS_SOLID:()=>Fi,CONTENTS_TRANSLUCENT:()=>Zi,CONTENTS_TRIGGER:()=>dr,CONTENTS_WATER:()=>Ii,CONTENTS_WINDOW:()=>zi,CS_MAX_STRING_LENGTH:()=>Ua,CS_MAX_STRING_LENGTH_OLD:()=>Ba,ClientCommand:()=>Tn,CollisionEntityIndex:()=>rt,ConfigStringIndex:()=>ue,CvarFlags:()=>jt,DEFAULT_FORWARD_SPEED:()=>xs,DEFAULT_MOUSE_SENSITIVITY:()=>Ts,DEFAULT_PITCH_SPEED:()=>gs,DEFAULT_SIDE_SPEED:()=>hs,DEFAULT_UP_SPEED:()=>ys,DEFAULT_YAW_SPEED:()=>bs,DEG2RAD:()=>tr,DIST_EPSILON:()=>Z,EntityFlags:()=>Rt,GAME_EXPORT_KEYS:()=>io,GAME_IMPORT_KEYS:()=>so,G_GetAmmoStat:()=>Ys,G_GetPowerupStat:()=>Zs,G_SetAmmoStat:()=>Js,G_SetPowerupStat:()=>js,LAST_VISIBLE_CONTENTS:()=>Qi,LayoutFlags:()=>_n,MASK_ALL:()=>pa,MASK_BLOCK_SIGHT:()=>Ta,MASK_CURRENT:()=>gr,MASK_DEADSOLID:()=>ha,MASK_LADDER_NAV_SOLID:()=>_a,MASK_MONSTERSOLID:()=>ya,MASK_NAV_SOLID:()=>Sa,MASK_OPAQUE:()=>ba,MASK_PLAYERSOLID:()=>xa,MASK_PROJECTILE:()=>Ea,MASK_SHOT:()=>ga,MASK_SOLID:()=>et,MASK_WALK_NAV_SOLID:()=>Aa,MASK_WATER:()=>Pe,MAX_CHALLENGES:()=>Es,MAX_CLIENTS:()=>kr,MAX_CONFIGSTRINGS:()=>qr,MAX_EDICTS:()=>Da,MAX_GENERAL:()=>jr,MAX_IMAGES:()=>Jr,MAX_INFO_STRING:()=>Cs,MAX_ITEMS:()=>Yr,MAX_LIGHTSTYLES:()=>Hr,MAX_MODELS:()=>Kr,MAX_MSGLEN:()=>Rs,MAX_OSPATH:()=>za,MAX_PACKET_ENTITIES:()=>vs,MAX_QPATH:()=>Fa,MAX_SHADOW_LIGHTS:()=>Zr,MAX_SOUNDS:()=>Xr,MAX_SOUND_CHANNELS:()=>ml,MAX_STRING_CHARS:()=>Pa,MAX_STRING_TOKENS:()=>wa,MAX_TOKEN_CHARS:()=>La,MAX_WHEEL_ITEMS:()=>ct,MZ_BFG:()=>Ws,MZ_BLASTER:()=>Os,MZ_CHAINGUN1:()=>ws,MZ_CHAINGUN2:()=>Ls,MZ_CHAINGUN3:()=>Fs,MZ_GRENADE:()=>Us,MZ_HYPERBLASTER:()=>ks,MZ_LOGIN:()=>Bs,MZ_LOGOUT:()=>Is,MZ_MACHINEGUN:()=>Ms,MZ_RAILGUN:()=>zs,MZ_ROCKET:()=>Ds,MZ_SHOTGUN:()=>Ps,MZ_SSHOTGUN:()=>Gs,MersenneTwister19937:()=>Re,NUM_AMMO_STATS:()=>Ks,NUM_BITS_FOR_AMMO:()=>Xe,NUM_BITS_FOR_POWERUP:()=>Ye,NUM_POWERUP_STATS:()=>Xs,NetChan:()=>wt,NetworkMessageBuilder:()=>Pt,PITCH:()=>Ne,POWERUP_MAX:()=>Je,PlaneSide:()=>Wt,PlayerButton:()=>ie,PlayerStat:()=>vn,PmFlag:()=>q,PmType:()=>se,PowerupId:()=>En,RAD2DEG:()=>nr,ROLL:()=>Qe,RandomGenerator:()=>Oe,RenderFx:()=>Nn,Replay:()=>lt,SLIDEMOVE_BLOCKED_FLOOR:()=>rn,SLIDEMOVE_BLOCKED_WALL:()=>on,SOUND_FULLVOLUME:()=>gl,SOUND_LOOP_ATTENUATE:()=>Tl,STOP_EPSILON:()=>Q,SURF_ALPHATEST:()=>la,SURF_FLOWING:()=>aa,SURF_LIGHT:()=>ta,SURF_N64_SCROLL_FLIP:()=>ma,SURF_N64_SCROLL_X:()=>da,SURF_N64_SCROLL_Y:()=>fa,SURF_N64_UV:()=>ua,SURF_NODRAW:()=>ca,SURF_NONE:()=>ea,SURF_SKY:()=>ra,SURF_SLICK:()=>na,SURF_TRANS33:()=>sa,SURF_TRANS66:()=>ia,SURF_WARP:()=>oa,ServerCommand:()=>gn,SoundChannel:()=>On,TempEntity:()=>Sn,UPDATE_BACKUP:()=>Vs,WEAPON_AMMO_MAP:()=>vi,WEAPON_WHEEL_ORDER:()=>Ei,WaterLevel:()=>de,WeaponId:()=>Cn,YAW:()=>Ce,ZERO_VEC3:()=>P,addBlendColor:()=>ir,addContents:()=>_r,addPmFlag:()=>G,addPointToBounds:()=>Jn,addVec3:()=>R,addViewAngles:()=>_s,angleMod:()=>xe,angleVectors:()=>re,applyPmove:()=>_i,applyPmoveAccelerate:()=>Y,applyPmoveAddCurrents:()=>be,applyPmoveAirAccelerate:()=>bt,applyPmoveAirMove:()=>xt,applyPmoveFlyMove:()=>qo,applyPmoveFriction:()=>We,applyPmoveWalkMove:()=>yt,applyPmoveWaterMove:()=>ht,assertContract:()=>oo,attenuationToDistanceMultiplier:()=>Mn,boxContents:()=>zr,boxOnPlaneSide:()=>Mr,boxesIntersect:()=>Yn,buildAirGroundWish:()=>Tt,buildCollisionModel:()=>Rr,buildWaterWish:()=>St,calculateMaxAudibleDistance:()=>Vi,categorizePosition:()=>Be,checkDuckState:()=>gt,checkJump:()=>dt,checkSpecialMovement:()=>cs,clampViewAngles:()=>ps,clipBoxToBrush:()=>st,clipVelocityAgainstPlanes:()=>jn,clipVelocityVec3:()=>ne,closestPointToBox:()=>Hn,combineSurfaceFlags:()=>vr,computePlaneSignBits:()=>ot,computePlayerDimensions:()=>Ge,concatRotationMatrices:()=>$e,configStringSize:()=>$r,copyVec3:()=>Bn,crc8:()=>Qs,createDefaultTrace:()=>Fe,createEmptyBounds3:()=>Xn,createMat4Identity:()=>Bt,createRandomGenerator:()=>ar,crossVec3:()=>te,currentVectorFromContents:()=>mt,degToRad:()=>ve,disableTraceDebug:()=>Nr,distance:()=>Wn,distanceBetweenBoxesSquared:()=>Kn,dotVec3:()=>U,enableTraceDebug:()=>Vr,fixStuckObjectGeneric:()=>At,getWaterLevel:()=>Te,goodPosition:()=>vt,groundCurrentVelocity:()=>tn,hasAllContents:()=>Tr,hasAnyContents:()=>Sr,hasPmFlag:()=>D,hasSurfaceFlags:()=>Er,inPHS:()=>Ur,inPVS:()=>Dr,initialSnapPosition:()=>ds,isAtLeastWaistDeep:()=>ut,isUnderwater:()=>lo,lengthSquaredVec3:()=>ce,lengthVec3:()=>I,lerpAngle:()=>rr,mat4FromBasis:()=>ur,mouseDeltaToViewDelta:()=>As,multiplyMat4:()=>cr,multiplyVec3:()=>In,negateVec3:()=>Gn,normalizeVec3:()=>w,perpendicularVec3:()=>zt,planeDistanceToPoint:()=>oe,pmoveCmdScale:()=>ko,pointContents:()=>Lr,pointContentsMany:()=>Fr,pointInsideBrush:()=>kt,pointOnPlaneSide:()=>Or,projectPointOnPlane:()=>Ft,projectSourceVec3:()=>qn,projectSourceVec3WithUp:()=>$n,radToDeg:()=>Ve,removeContents:()=>Ar,removePmFlag:()=>X,resolveSlideMove:()=>sn,rotatePointAroundVector:()=>er,runPmove:()=>Ho,scaleVec3:()=>O,slerpVec3:()=>Qn,slideClipVelocityVec3:()=>Zn,slideMove:()=>pt,snapPosition:()=>us,stepSlideMove:()=>ae,subtractVec3:()=>ee,testBoxInBrush:()=>Ht,traceBox:()=>Yt,traceDebugInfo:()=>J,transformPointMat4:()=>lr,validateContract:()=>Zt,vec3Equals:()=>kn,vectorToAngles:()=>sr,vectorToYaw:()=>or,waterCurrentVelocity:()=>en,writeUserCommand:()=>qs});var P={x:0,y:0,z:0},Q=.1,Un=Math.PI/180;function Bn(t){return{x:t.x,y:t.y,z:t.z}}function R(t,e){return{x:t.x+e.x,y:t.y+e.y,z:t.z+e.z}}function ee(t,e){return{x:t.x-e.x,y:t.y-e.y,z:t.z-e.z}}function In(t,e){return{x:t.x*e.x,y:t.y*e.y,z:t.z*e.z}}function O(t,e){return{x:t.x*e,y:t.y*e,z:t.z*e}}function Gn(t){return O(t,-1)}function U(t,e){return t.x*e.x+t.y*e.y+t.z*e.z}function te(t,e){return{x:t.y*e.z-t.z*e.y,y:t.z*e.x-t.x*e.z,z:t.x*e.y-t.y*e.x}}function ce(t){return U(t,t)}function I(t){return Math.sqrt(ce(t))}function Wn(t,e){return I(ee(t,e))}function kn(t,e){return t.x===e.x&&t.y===e.y&&t.z===e.z}function w(t){let e=I(t);return e===0?t:O(t,1/e)}function Ft(t,e){let n=1/U(e,e),r=U(e,t)*n;return ee(t,O(e,n*r))}function zt(t){let e=0,n=Math.abs(t.x);return Math.abs(t.y)<n&&(e=1,n=Math.abs(t.y)),Math.abs(t.z)<n&&(e=2),w(Ft(e===0?{x:1,y:0,z:0}:e===1?{x:0,y:1,z:0}:{x:0,y:0,z:1},t))}function Hn(t,e,n){return{x:t.x<e.x?e.x:t.x>n.x?n.x:t.x,y:t.y<e.y?e.y:t.y>n.y?n.y:t.y,z:t.z<e.z?e.z:t.z>n.z?n.z:t.z}}function Kn(t,e,n,r){let o=0;if(e.x<n.x){let s=e.x-n.x;o+=s*s}else if(t.x>r.x){let s=t.x-r.x;o+=s*s}if(e.y<n.y){let s=e.y-n.y;o+=s*s}else if(t.y>r.y){let s=t.y-r.y;o+=s*s}if(e.z<n.z){let s=e.z-n.z;o+=s*s}else if(t.z>r.z){let s=t.z-r.z;o+=s*s}return o}function Xn(){return{mins:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,z:Number.POSITIVE_INFINITY},maxs:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY,z:Number.NEGATIVE_INFINITY}}}function Jn(t,e){return{mins:{x:Math.min(e.mins.x,t.x),y:Math.min(e.mins.y,t.y),z:Math.min(e.mins.z,t.z)},maxs:{x:Math.max(e.maxs.x,t.x),y:Math.max(e.maxs.y,t.y),z:Math.max(e.maxs.z,t.z)}}}function Yn(t,e){return t.mins.x<=e.maxs.x&&t.maxs.x>=e.mins.x&&t.mins.y<=e.maxs.y&&t.maxs.y>=e.mins.y&&t.mins.z<=e.maxs.z&&t.maxs.z>=e.mins.z}function ne(t,e,n){let r=U(t,e)*n,o=t.x-e.x*r,s=t.y-e.y*r,i=t.z-e.z*r;return o>-Q&&o<Q&&(o=0),s>-Q&&s<Q&&(s=0),i>-Q&&i<Q&&(i=0),{x:o,y:s,z:i}}function jn(t,e,n,r){if(e.length===0)return t;let o=t;for(let s=0;s<e.length;s++){o=ne(o,e[s],n);let i=0;for(;i<e.length&&!(i!==s&&U(o,e[i])<0);i++);if(i===e.length)return r&&U(o,r)<=0?P:o}if(e.length===2){let s=te(e[0],e[1]),i=U(s,t),a=O(s,i);return r&&U(a,r)<=0?P:a}return r&&U(o,r)<=0,P}function Zn(t,e,n){return ne(t,e,n)}function qn(t,e,n,r){return{x:t.x+n.x*e.x+r.x*e.y,y:t.y+n.y*e.x+r.y*e.y,z:t.z+n.z*e.x+r.z*e.y+e.z}}function $n(t,e,n,r,o){return{x:t.x+n.x*e.x+r.x*e.y+o.x*e.z,y:t.y+n.y*e.x+r.y*e.y+o.y*e.z,z:t.z+n.z*e.x+r.z*e.y+o.z*e.z}}function Qn(t,e,n){let r=U(t,e),o,s;if(Math.abs(r)>.9995)o=1-n,s=n;else{let i=Math.acos(r),a=Math.sin(i),l=Math.sin((1-n)*i),d=Math.sin(n*i);o=l/a,s=d/a}return{x:t.x*o+e.x*s,y:t.y*o+e.y*s,z:t.z*o+e.z*s}}function $e(t,e){let n=o=>[t[o][0]*e[0][0]+t[o][1]*e[1][0]+t[o][2]*e[2][0],t[o][0]*e[0][1]+t[o][1]*e[1][1]+t[o][2]*e[2][1],t[o][0]*e[0][2]+t[o][1]*e[1][2]+t[o][2]*e[2][2]];return[n(0),n(1),n(2)]}function er(t,e,n){if(I(t)===0)return e;let o=w(t),s=zt(o),i=te(s,o),a=[[s.x,i.x,o.x],[s.y,i.y,o.y],[s.z,i.z,o.z]],l=[[a[0][0],a[1][0],a[2][0]],[a[0][1],a[1][1],a[2][1]],[a[0][2],a[1][2],a[2][2]]],d=n*Un,p=Math.cos(d),c=Math.sin(d),f=[[p,c,0],[-c,p,0],[0,0,1]],x=$e($e(a,f),l);return{x:x[0][0]*e.x+x[0][1]*e.y+x[0][2]*e.z,y:x[1][0]*e.x+x[1][1]*e.y+x[1][2]*e.z,z:x[2][0]*e.x+x[2][1]*e.y+x[2][2]*e.z}}var Ne=0,Ce=1,Qe=2,Dt=Math.PI/180,Ut=180/Math.PI,tr=Dt,nr=Ut;function pe(t,e){switch(e){case Ne:return t.x;case Ce:return t.y;case Qe:default:return t.z}}function ve(t){return t*Dt}function Ve(t){return t*Ut}function rr(t,e,n){let r=e;return r-t>180?r-=360:r-t<-180&&(r+=360),t+n*(r-t)}function xe(t){let e=t%360;return e<0?360+e:e}function re(t){let e=ve(pe(t,Ce)),n=ve(pe(t,Ne)),r=ve(pe(t,Qe)),o=Math.sin(e),s=Math.cos(e),i=Math.sin(n),a=Math.cos(n),l=Math.sin(r),d=Math.cos(r),p={x:a*s,y:a*o,z:-i},c={x:-l*i*s-d*-o,y:-l*i*o-d*s,z:-l*a},f={x:d*i*s-l*-o,y:d*i*o-l*s,z:d*a};return{forward:p,right:c,up:f}}function or(t){let e=pe(t,Ne),n=pe(t,Ce);if(e===0)return n===0?0:n>0?90:270;let r=Ve(Math.atan2(n,e));return r<0?r+360:r}function sr(t){let e=t.x,n=t.y,r=t.z;if(n===0&&e===0)return{x:r>0?-90:-270,y:0,z:0};let o;e?o=Ve(Math.atan2(n,e)):n>0?o=90:o=270,o<0&&(o+=360);let s=Math.sqrt(e*e+n*n),i=Ve(Math.atan2(r,s));return i<0&&(i+=360),{x:-i,y:o,z:0}}var j=[[-.525731,0,.850651],[-.442863,.238856,.864188],[-.295242,0,.955423],[-.309017,.5,.809017],[-.16246,.262866,.951056],[0,0,1],[0,.850651,.525731],[-.147621,.716567,.681718],[.147621,.716567,.681718],[0,.525731,.850651],[.309017,.5,.809017],[.525731,0,.850651],[.295242,0,.955423],[.442863,.238856,.864188],[.16246,.262866,.951056],[-.681718,.147621,.716567],[-.809017,.309017,.5],[-.587785,.425325,.688191],[-.850651,.525731,0],[-.864188,.442863,.238856],[-.716567,.681718,.147621],[-.688191,.587785,.425325],[-.5,.809017,.309017],[-.238856,.864188,.442863],[-.425325,.688191,.587785],[-.716567,.681718,-.147621],[-.5,.809017,-.309017],[-.525731,.850651,0],[0,.850651,-.525731],[-.238856,.864188,-.442863],[0,.955423,-.295242],[-.262866,.951056,-.16246],[0,1,0],[0,.955423,.295242],[-.262866,.951056,.16246],[.238856,.864188,.442863],[.262866,.951056,.16246],[.5,.809017,.309017],[.238856,.864188,-.442863],[.262866,.951056,-.16246],[.5,.809017,-.309017],[.850651,.525731,0],[.716567,.681718,.147621],[.716567,.681718,-.147621],[.525731,.850651,0],[.425325,.688191,.587785],[.864188,.442863,.238856],[.688191,.587785,.425325],[.809017,.309017,.5],[.681718,.147621,.716567],[.587785,.425325,.688191],[.955423,.295242,0],[1,0,0],[.951056,.16246,.262866],[.850651,-.525731,0],[.955423,-.295242,0],[.864188,-.442863,.238856],[.951056,-.16246,.262866],[.809017,-.309017,.5],[.681718,-.147621,.716567],[.850651,0,.525731],[.864188,.442863,-.238856],[.809017,.309017,-.5],[.951056,.16246,-.262866],[.525731,0,-.850651],[.681718,.147621,-.716567],[.681718,-.147621,-.716567],[.850651,0,-.525731],[.809017,-.309017,-.5],[.864188,-.442863,-.238856],[.951056,-.16246,-.262866],[.147621,.716567,-.681718],[.309017,.5,-.809017],[.425325,.688191,-.587785],[.442863,.238856,-.864188],[.587785,.425325,-.688191],[.688191,.587785,-.425325],[-.147621,.716567,-.681718],[-.309017,.5,-.809017],[0,.525731,-.850651],[-.525731,0,-.850651],[-.442863,.238856,-.864188],[-.295242,0,-.955423],[-.16246,.262866,-.951056],[0,0,-1],[.295242,0,-.955423],[.16246,.262866,-.951056],[-.442863,-.238856,-.864188],[-.309017,-.5,-.809017],[-.16246,-.262866,-.951056],[0,-.850651,-.525731],[-.147621,-.716567,-.681718],[.147621,-.716567,-.681718],[0,-.525731,-.850651],[.309017,-.5,-.809017],[.442863,-.238856,-.864188],[.16246,-.262866,-.951056],[.238856,-.864188,-.442863],[.5,-.809017,-.309017],[.425325,-.688191,-.587785],[.716567,-.681718,-.147621],[.688191,-.587785,-.425325],[.587785,-.425325,-.688191],[0,-.955423,-.295242],[0,-1,0],[.262866,-.951056,-.16246],[0,-.850651,.525731],[0,-.955423,.295242],[.238856,-.864188,.442863],[.262866,-.951056,.16246],[.5,-.809017,.309017],[.716567,-.681718,.147621],[.525731,-.850651,0],[-.238856,-.864188,-.442863],[-.5,-.809017,-.309017],[-.262866,-.951056,-.16246],[-.850651,-.525731,0],[-.716567,-.681718,-.147621],[-.716567,-.681718,.147621],[-.525731,-.850651,0],[-.5,-.809017,.309017],[-.238856,-.864188,.442863],[-.262866,-.951056,.16246],[-.864188,-.442863,.238856],[-.809017,-.309017,.5],[-.688191,-.587785,.425325],[-.681718,-.147621,.716567],[-.442863,-.238856,.864188],[-.587785,-.425325,.688191],[-.309017,-.5,.809017],[-.147621,-.716567,.681718],[-.425325,-.688191,.587785],[-.16246,-.262866,.951056],[.442863,-.238856,.864188],[.16246,-.262866,.951056],[.309017,-.5,.809017],[.147621,-.716567,.681718],[0,-.525731,.850651],[.425325,-.688191,.587785],[.587785,-.425325,.688191],[.688191,-.587785,.425325],[-.955423,.295242,0],[-.951056,.16246,.262866],[-1,0,0],[-.850651,0,.525731],[-.955423,-.295242,0],[-.951056,-.16246,.262866],[-.864188,.442863,-.238856],[-.951056,.16246,-.262866],[-.809017,.309017,-.5],[-.864188,-.442863,-.238856],[-.951056,-.16246,-.262866],[-.809017,-.309017,-.5],[-.681718,.147621,-.716567],[-.681718,-.147621,-.716567],[-.850651,0,-.525731],[-.688191,.587785,-.425325],[-.587785,.425325,-.688191],[-.425325,.688191,-.587785],[-.425325,-.688191,-.587785],[-.587785,-.425325,-.688191],[-.688191,-.587785,-.425325]];function ir(t,e,n,r,o){if(r<=0)return o;let s=o[0],i=o[1],a=o[2],l=o[3],d=l+(1-l)*r;if(d<=0)return[0,0,0,0];let p=l/d,c=s*p+t*(1-p),f=i*p+e*(1-p),x=a*p+n*(1-p);return[c,f,x,d]}var Re=class{constructor(e=5489){this.state=new Uint32Array(624);this.index=624;this.seed(e)}seed(e){this.state[0]=e>>>0;for(let n=1;n<624;n++){let r=this.state[n-1]^this.state[n-1]>>>30,o=Math.imul(r>>>0,1812433253)+n;this.state[n]=o>>>0}this.index=624}nextUint32(){this.index>=624&&this.twist();let e=this.state[this.index++];return e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0}twist(){for(let e=0;e<624;e++){let n=this.state[e]&2147483648|this.state[(e+1)%624]&2147483647,r=this.state[(e+397)%624]^n>>>1;(n&1)!==0&&(r^=2567483615),this.state[e]=r>>>0}this.index=0}getState(){return{index:this.index,state:Array.from(this.state)}}setState(e){if(e.state.length!==624)throw new Error(`Expected 624 MT state values, received ${e.state.length}`);this.index=e.index,this.state=Uint32Array.from(e.state,n=>n>>>0)}},Oe=class{constructor(e={}){this.mt=new Re(e.seed)}seed(e){this.mt.seed(e)}frandom(){return this.mt.nextUint32()/4294967296}frandomRange(e,n){return e+(n-e)*this.frandom()}frandomMax(e){return this.frandomRange(0,e)}crandom(){return this.frandomRange(-1,1)}crandomOpen(){let e=Number.EPSILON;return this.frandomRange(-1+e,1)}irandomUint32(){return this.mt.nextUint32()}irandomRange(e,n){if(n-e<=1)return e;let r=n-e,o=4294967296-4294967296%r,s;do s=this.mt.nextUint32();while(s>=o);return e+s%r}irandom(e){return e<=0?0:this.irandomRange(0,e)}randomTimeRange(e,n){return n<=e?e:this.irandomRange(e,n)}randomTime(e){return this.irandom(e)}randomIndex(e){return this.irandom(e.length)}getState(){return{mt:this.mt.getState()}}setState(e){this.mt.setState(e.mt)}};function ar(t){return new Oe(t)}function Bt(){return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function cr(t,e){let n=new Float32Array(16);for(let r=0;r<4;r+=1)for(let o=0;o<4;o+=1)n[o*4+r]=t[0+r]*e[o*4+0]+t[4+r]*e[o*4+1]+t[8+r]*e[o*4+2]+t[12+r]*e[o*4+3];return n}function lr(t,e){let n=e.x,r=e.y,o=e.z;return{x:t[0]*n+t[4]*r+t[8]*o+t[12],y:t[1]*n+t[5]*r+t[9]*o+t[13],z:t[2]*n+t[6]*r+t[10]*o+t[14]}}function ur(t,e){let n=Bt();return n[0]=e[0].x,n[1]=e[0].y,n[2]=e[0].z,n[4]=e[1].x,n[5]=e[1].y,n[6]=e[1].z,n[8]=e[2].x,n[9]=e[2].y,n[10]=e[2].z,n[12]=t.x,n[13]=t.y,n[14]=t.z,n}var Me=0,Fi=1,zi=2,Di=4,Ui=8,Bi=16,Ii=32,Gi=64,dr=1073741824,fr=8192,Wi=16384,ki=32768,Hi=65536,Ki=131072,mr=262144,pr=524288,xr=1048576,hr=2097152,yr=4194304,br=8388608,Xi=16777216,Ji=33554432,Yi=67108864,ji=134217728,Zi=268435456,It=536870912,qi=1073741824,$i=-2147483648,Qi=64,ea=0,ta=1,na=2,ra=4,oa=8,sa=16,ia=32,aa=64,ca=128,la=33554432,ua=268435456,da=536870912,fa=1073741824,ma=-2147483648,pa=4294967295,et=3,xa=1107361795,ha=65539,ya=1107427331,Pe=56,ba=25,ga=1174405123,gr=16515072,Ta=1107296281,Sa=65539,_a=3,Aa=196611,Ea=1174421507;function Tr(t,e){return(t&e)===e}function Sr(t,e){return(t&e)!==0}function _r(t,e){return t|e}function Ar(t,e){return t&~e}function Er(t,e){return(t&e)===e}function vr(...t){let e=0;for(let n of t)e|=n;return e}function we(t=0,e={x:-8192,y:-8192,z:-8192},n={x:8192,y:8192,z:8192}){if(t>=4)return{axis:-1,dist:0,children:null,items:new Set};let r=t%2,o=.5*(r===0?e.x+n.x:e.y+n.y),s={...e},i={...n},a={...e},l={...n};r===0?(i.x=o,a.x=o):(i.y=o,a.y=o);let d=we(t+1,s,i),p=we(t+1,a,l);return{axis:r,dist:o,children:[d,p],items:new Set}}function Gt(t,e,n,r){let o=t;for(;o.axis!==-1&&o.children;){let s=o.axis,i=o.dist,a=s===0?n.x:n.y,l=s===0?r.x:r.y;if(a>i)o=o.children[1];else if(l<i)o=o.children[0];else break}return o.items.add(e),o}function he(t,e,n,r){for(let l of t.items)r.add(l);if(t.axis===-1||!t.children)return;let o=t.axis,s=t.dist,i=o===0?e.x:e.y;(o===0?n.x:n.y)>s&&he(t.children[1],e,n,r),i<s&&he(t.children[0],e,n,r)}var Wt=(r=>(r[r.FRONT=1]="FRONT",r[r.BACK=2]="BACK",r[r.CROSS=3]="CROSS",r))(Wt||{}),J=null;function Vr(){J={nodesTraversed:0,leafsReached:0,brushesTested:0}}function Nr(){J=null}var Z=.03125,Cr=Number.MAX_SAFE_INTEGER-1,Le=1;function Rr(t){let e=t.planes.map(i=>({...i,signbits:ot(i.normal)})),n=t.nodes.map(i=>({plane:e[i.planenum],children:i.children})),r=t.brushes.map(i=>{let a=t.brushSides.slice(i.firstSide,i.firstSide+i.numSides).map(l=>({plane:e[l.planenum],surfaceFlags:l.surfaceFlags}));return{contents:i.contents,sides:a,checkcount:0}}),o=t.leaves.map(i=>({contents:i.contents,cluster:i.cluster,area:i.area,firstLeafBrush:i.firstLeafBrush,numLeafBrushes:i.numLeafBrushes})),s=t.bmodels.map(i=>({mins:i.mins,maxs:i.maxs,origin:i.origin,headnode:i.headnode}));return{planes:e,nodes:n,leaves:o,brushes:r,leafBrushes:t.leafBrushes,bmodels:s,visibility:t.visibility}}function ot(t){let e=0;return t.x<0&&(e|=1),t.y<0&&(e|=2),t.z<0&&(e|=4),e}function oe(t,e){return t.normal.x*e.x+t.normal.y*e.y+t.normal.z*e.z-t.dist}function Or(t,e,n=0){let r=oe(t,e);return r>n?1:r<-n?2:3}function Mr(t,e,n,r=0){let o,s;switch(n.signbits){case 0:o=n.normal.x*e.x+n.normal.y*e.y+n.normal.z*e.z,s=n.normal.x*t.x+n.normal.y*t.y+n.normal.z*t.z;break;case 1:o=n.normal.x*t.x+n.normal.y*e.y+n.normal.z*e.z,s=n.normal.x*e.x+n.normal.y*t.y+n.normal.z*t.z;break;case 2:o=n.normal.x*e.x+n.normal.y*t.y+n.normal.z*e.z,s=n.normal.x*t.x+n.normal.y*e.y+n.normal.z*t.z;break;case 3:o=n.normal.x*t.x+n.normal.y*t.y+n.normal.z*e.z,s=n.normal.x*e.x+n.normal.y*e.y+n.normal.z*t.z;break;case 4:o=n.normal.x*e.x+n.normal.y*e.y+n.normal.z*t.z,s=n.normal.x*t.x+n.normal.y*t.y+n.normal.z*e.z;break;case 5:o=n.normal.x*t.x+n.normal.y*e.y+n.normal.z*t.z,s=n.normal.x*e.x+n.normal.y*t.y+n.normal.z*e.z;break;case 6:o=n.normal.x*e.x+n.normal.y*t.y+n.normal.z*t.z,s=n.normal.x*t.x+n.normal.y*e.y+n.normal.z*e.z;break;default:o=n.normal.x*t.x+n.normal.y*t.y+n.normal.z*t.z,s=n.normal.x*e.x+n.normal.y*e.y+n.normal.z*e.z;break}let i=0;return o-n.dist>=-r&&(i=1),s-n.dist<=r&&(i|=2),i}function kt(t,e,n=Z){for(let r of e.sides)if(oe(r.plane,t)>n)return!1;return!0}function Ht(t,e,n,r){for(let o of r.sides){let s=o.plane.normal.x*(o.plane.normal.x<0?n.x:e.x)+o.plane.normal.y*(o.plane.normal.y<0?n.y:e.y)+o.plane.normal.z*(o.plane.normal.z<0?n.z:e.z),i=o.plane.dist-s;if(t.x*o.plane.normal.x+t.y*o.plane.normal.y+t.z*o.plane.normal.z-i>0)return{startsolid:!1,allsolid:!1,contents:0}}return{startsolid:!0,allsolid:!0,contents:r.contents}}function st({start:t,end:e,mins:n,maxs:r,brush:o,trace:s}){if(o.sides.length===0)return;let i=n.x===0&&n.y===0&&n.z===0&&r.x===0&&r.y===0&&r.z===0,a=-1,l=1,d=null,p=null,c=!1,f=!1;for(let x of o.sides){let{plane:u}=x,_=u.dist;if(!i){let E=u.normal.x<0?r.x:n.x,b=u.normal.y<0?r.y:n.y,T=u.normal.z<0?r.z:n.z;_-=u.normal.x*E+u.normal.y*b+u.normal.z*T}let S=t.x*u.normal.x+t.y*u.normal.y+t.z*u.normal.z-_,A=e.x*u.normal.x+e.y*u.normal.y+e.z*u.normal.z-_;if(A>0&&(c=!0),S>0&&(f=!0),S>0&&A>=S)return;if(!(S<=0&&A<=0))if(S>A){let E=(S-Z)/(S-A);E>a&&(a=E,d=u,p=x)}else{let E=(S+Z)/(S-A);E<l&&(l=E)}}if(!f){s.startsolid=!0,c||(s.allsolid=!0),s.fraction=0;return}a<l&&a>-1&&a<s.fraction&&(s.fraction=a<0?0:a,s.plane=d,s.contents=o.contents,s.surfaceFlags=p?.surfaceFlags??0)}function Fe(){return{fraction:1,plane:null,contents:0,surfaceFlags:0,startsolid:!1,allsolid:!1}}function it(t,e,n){let r=n;for(;r>=0;){let o=e.nodes[r];r=oe(o.plane,t)>=0?o.children[0]:o.children[1]}return-1-r}function Kt(t,e,n){let r=t.leaves[e],o=r.contents,s=at(),i=r.firstLeafBrush,a=i+r.numLeafBrushes;for(let l=i;l<a;l+=1){let d=t.leafBrushes[l],p=t.brushes[d];p.checkcount!==s&&(p.checkcount=s,p.sides.length!==0&&kt(n,p)&&(o|=p.contents))}return o}function at(){let t=Le;return Le+=1,Le>=Cr&&(Le=1),t}function Pr(t,e){return t.x===0&&t.y===0&&t.z===0&&e.x===0&&e.y===0&&e.z===0}function wr(t,e,n){return Pr(e,n)?0:t.normal.x*(t.normal.x<0?n.x:e.x)+t.normal.y*(t.normal.y<0?n.y:e.y)+t.normal.z*(t.normal.z<0?n.z:e.z)}function Xt(t,e,n){return Math.abs(wr(t,e,n))}function tt(t,e,n){return R(t,O(ee(e,t),n))}function nt(t,e,n){let r=t.allsolid?0:t.fraction,o=tt(e,n,r);return{fraction:r,endpos:o,plane:t.plane,planeNormal:t.startsolid?void 0:t.plane?.normal,contents:t.contents,surfaceFlags:t.surfaceFlags,startsolid:t.startsolid,allsolid:t.allsolid}}function ze(t,e,n){let r=it(t,e,n);return e.leaves[r]?.cluster??-1}function Jt(t,e,n,r){if(!t||t.numClusters===0)return!0;if(e<0||n<0||e>=t.clusters.length||n>=t.numClusters)return!1;let o=t.clusters[e],i=(r?o.phs:o.pvs)[n>>3];return i===void 0?!1:(i&1<<(n&7))!==0}function ye(t){let{model:e,nodeIndex:n,startFraction:r,endFraction:o,start:s,end:i,traceStart:a,traceEnd:l,mins:d,maxs:p,contentMask:c,trace:f,brushCheckCount:x}=t;if(f.fraction<=r)return;if(n<0){J&&J.leafsReached++;let F=-1-n,N=e.leaves[F],B=N.firstLeafBrush,k=B+N.numLeafBrushes;for(let z=B;z<k;z+=1){let K=e.leafBrushes[z],g=e.brushes[K];if((g.contents&c)!==0&&g.sides.length&&g.checkcount!==x&&(g.checkcount=x,J&&J.brushesTested++,st({start:a,end:l,mins:d,maxs:p,brush:g,trace:f}),f.allsolid))return}return}J&&J.nodesTraversed++;let u=e.nodes[n],_=u.plane,S=Xt(_,d,p),A=oe(_,s),E=oe(_,i);if(A>=S&&E>=S){ye({model:e,nodeIndex:u.children[0],startFraction:r,endFraction:o,start:s,end:i,traceStart:a,traceEnd:l,mins:d,maxs:p,contentMask:c,trace:f,brushCheckCount:x});return}if(A<-S&&E<-S){ye({model:e,nodeIndex:u.children[1],startFraction:r,endFraction:o,start:s,end:i,traceStart:a,traceEnd:l,mins:d,maxs:p,contentMask:c,trace:f,brushCheckCount:x});return}let b=0,T=1/(A-E),C,v;A<E?(b=1,v=(A+S+Z)*T,C=(A-S+Z)*T):(b=0,v=(A-S-Z)*T,C=(A+S+Z)*T),C<0?C=0:C>1&&(C=1),v<0?v=0:v>1&&(v=1);let M=r+(o-r)*C,V=tt(s,i,C);if(ye({model:e,nodeIndex:u.children[b],startFraction:r,endFraction:M,start:s,end:V,traceStart:a,traceEnd:l,mins:d,maxs:p,contentMask:c,trace:f,brushCheckCount:x}),f.fraction<=M)return;let H=r+(o-r)*v,h=tt(s,i,v);ye({model:e,nodeIndex:u.children[1-b],startFraction:H,endFraction:o,start:h,end:i,traceStart:a,traceEnd:l,mins:d,maxs:p,contentMask:c,trace:f,brushCheckCount:x})}function Yt(t){let{model:e,start:n,end:r}=t,o=t.mins??P,s=t.maxs??P,i=t.contentMask??4294967295,a=t.headnode??0,l=Fe(),d=at();return ye({model:e,nodeIndex:a,startFraction:0,endFraction:1,start:n,end:r,traceStart:n,traceEnd:r,mins:o,maxs:s,contentMask:i,trace:l,brushCheckCount:d}),nt(l,n,r)}function Lr(t,e,n=0){let r=it(t,e,n);return Kt(e,r,t)}function Fr(t,e,n=0){let r=new Map;return t.map(o=>{let s=it(o,e,n),i=e.leaves[s];if(i.numLeafBrushes===0){let a=r.get(s);return a!==void 0?a:(r.set(s,i.contents),i.contents)}return Kt(e,s,o)})}function zr(t,e,n,r,o=0){let s=at(),i=0;function a(l){if(l<0){J&&J.leafsReached++;let x=-1-l,u=r.leaves[x];i|=u.contents;let _=u.firstLeafBrush,S=_+u.numLeafBrushes;for(let A=_;A<S;A+=1){let E=r.leafBrushes[A],b=r.brushes[E];if(b.checkcount===s||(b.checkcount=s,b.sides.length===0))continue;let T=Ht(t,e,n,b);T.startsolid&&(i|=T.contents)}return}let d=r.nodes[l],p=d.plane,c=Xt(p,e,n),f=oe(p,t);if(c===0){a(f>=0?d.children[0]:d.children[1]);return}if(f>c){a(d.children[0]);return}if(f<-c){a(d.children[1]);return}a(d.children[0]),a(d.children[1])}return a(o),i}function Dr(t,e,n,r=0){let{visibility:o}=n;if(!o)return!0;let s=ze(t,n,r),i=ze(e,n,r);return Jt(o,s,i,!1)}function Ur(t,e,n,r=0){let{visibility:o}=n;if(!o)return!0;let s=ze(t,n,r),i=ze(e,n,r);return Jt(o,s,i,!0)}function le(t,e,n){return{normal:t,dist:e,type:n,signbits:ot(t)}}function Br(t){let e=t.surfaceFlags??0,n=t.origin.x+t.maxs.x,r=t.origin.x+t.mins.x,o=t.origin.y+t.maxs.y,s=t.origin.y+t.mins.y,i=t.origin.z+t.maxs.z,a=t.origin.z+t.mins.z,d=[le({x:1,y:0,z:0},n,0),le({x:-1,y:0,z:0},-r,0),le({x:0,y:1,z:0},o,1),le({x:0,y:-1,z:0},-s,1),le({x:0,y:0,z:1},i,2),le({x:0,y:0,z:-1},-a,2)].map(p=>({plane:p,surfaceFlags:e}));return{contents:t.contents,sides:d,checkcount:0}}function Ir(t){let e=Br(t);return{...t,brush:e,bounds:{mins:{x:t.origin.x+t.mins.x,y:t.origin.y+t.mins.y,z:t.origin.z+t.mins.z},maxs:{x:t.origin.x+t.maxs.x,y:t.origin.y+t.maxs.y,z:t.origin.z+t.maxs.z}}}}function Gr(t,e){return!(t.mins.x>e.maxs.x||t.maxs.x<e.mins.x||t.mins.y>e.maxs.y||t.maxs.y<e.mins.y||t.mins.z>e.maxs.z||t.maxs.z<e.mins.z)}function Wr(t,e){return e.allsolid&&!t.allsolid||e.startsolid&&!t.startsolid?!0:e.fraction<t.fraction}var rt=class{constructor(){this.entities=new Map;this.entityNodes=new Map;this.rootNode=we()}link(e){let n=Ir(e);this.entities.set(e.id,n);let r=this.entityNodes.get(e.id);r&&r.items.delete(e.id);let o=Gt(this.rootNode,e.id,n.bounds.mins,n.bounds.maxs);this.entityNodes.set(e.id,o)}unlink(e){this.entities.delete(e);let n=this.entityNodes.get(e);n&&(n.items.delete(e),this.entityNodes.delete(e))}trace(e){let{passId:n}=e,r=e.mins??P,o=e.maxs??P,s=e.contentMask??4294967295,i,a=null;e.model?i=Yt(e):i=nt(Fe(),e.start,e.end);let l={x:Math.min(e.start.x,e.end.x)+r.x,y:Math.min(e.start.y,e.end.y)+r.y,z:Math.min(e.start.z,e.end.z)+r.z},d={x:Math.max(e.start.x,e.end.x)+o.x,y:Math.max(e.start.y,e.end.y)+o.y,z:Math.max(e.start.z,e.end.z)+o.z},p=new Set;he(this.rootNode,l,d,p);for(let c of p){if(c===n)continue;let f=this.entities.get(c);if(!f||(f.contents&s)===0)continue;let x=Fe();if(st({start:e.start,end:e.end,mins:r,maxs:o,brush:f.brush,trace:x}),x.contents===0&&(x.contents=f.contents),x.startsolid||x.allsolid||x.fraction<i.fraction){let u=nt(x,e.start,e.end);Wr(i,u)&&(i=u,a=f.id)}}return{...i,entityId:a}}gatherTriggerTouches(e,n,r,o=1073741824){let s=[],i={mins:R(e,n),maxs:R(e,r)},a=new Set;he(this.rootNode,i.mins,i.maxs,a);for(let l of a){let d=this.entities.get(l);d&&(d.contents&o)!==0&&Gr(i,d.bounds)&&s.push(d.id)}return s}};var jt=(i=>(i[i.None=0]="None",i[i.Archive=1]="Archive",i[i.UserInfo=2]="UserInfo",i[i.ServerInfo=4]="ServerInfo",i[i.Latch=8]="Latch",i[i.Cheat=16]="Cheat",i))(jt||{});var Pa=1024,wa=80,La=512,Fa=64,za=128,kr=256,Da=8192,Hr=256,Kr=8192,Xr=2048,Jr=512,Yr=256,jr=512,Zr=256,ct=32,Ua=96,Ba=64,ue=(h=>(h[h.Name=0]="Name",h[h.CdTrack=1]="CdTrack",h[h.Sky=2]="Sky",h[h.SkyAxis=3]="SkyAxis",h[h.SkyRotate=4]="SkyRotate",h[h.StatusBar=5]="StatusBar",h[h.HealthBarName=55]="HealthBarName",h[h.CONFIG_N64_PHYSICS=56]="CONFIG_N64_PHYSICS",h[h.CONFIG_CTF_TEAMS=57]="CONFIG_CTF_TEAMS",h[h.CONFIG_COOP_RESPAWN_STRING=58]="CONFIG_COOP_RESPAWN_STRING",h[h.AirAccel=59]="AirAccel",h[h.MaxClients=60]="MaxClients",h[h.MapChecksum=61]="MapChecksum",h[h.Models=62]="Models",h[h.Sounds=62+Kr]="Sounds",h[h.Images=h.Sounds+Xr]="Images",h[h.Lights=h.Images+Jr]="Lights",h[h.ShadowLights=h.Lights+Hr]="ShadowLights",h[h.Items=h.ShadowLights+Zr]="Items",h[h.PlayerSkins=h.Items+Yr]="PlayerSkins",h[h.General=h.PlayerSkins+kr]="General",h[h.WheelWeapons=h.General+jr]="WheelWeapons",h[h.WheelAmmo=h.WheelWeapons+ct]="WheelAmmo",h[h.WheelPowerups=h.WheelAmmo+ct]="WheelPowerups",h[h.CdLoopCount=h.WheelPowerups+ct]="CdLoopCount",h[h.GameStyle=h.CdLoopCount+1]="GameStyle",h[h.MaxConfigStrings=h.GameStyle+1]="MaxConfigStrings",h))(ue||{}),qr=ue.MaxConfigStrings;function $r(t){return t>=5&&t<59?96*(59-t):t>=ue.General&&t<ue.WheelWeapons?96*(ue.MaxConfigStrings-t):96}var lt={};qe(lt,{addReplayFrame:()=>no,createReplaySession:()=>to,deserializeReplay:()=>eo,serializeReplay:()=>Qr});function Qr(t){return JSON.stringify(t,null,2)}function eo(t){let e=JSON.parse(t);if(!e.metadata||!Array.isArray(e.frames))throw new Error("Invalid replay format: missing metadata or frames");return e}function to(t,e){return{metadata:{map:t,date:new Date().toISOString(),version:"1.0",seed:e},frames:[]}}function no(t,e,n,r){t.frames.push({serverFrame:n,cmd:e,timestamp:Date.now()-r})}function ro(t){return t??{}}function Zt(t,e,n={}){let r=ro(t),o=[],s=[];for(let a of e){if(!(a in r)){o.push(a);continue}typeof r[a]!="function"&&s.push(a)}let i=n.allowExtra===!1?Object.keys(r).filter(a=>!e.includes(a)):[];return{missing:o,nonFunctions:s,extras:i}}function oo(t,e,n={}){let{missing:r,nonFunctions:o,extras:s}=Zt(t,e,n);if(r.length===0&&o.length===0&&s.length===0)return;let i=[];r.length>0&&i.push(`missing: ${r.join(", ")}`),o.length>0&&i.push(`non-functions: ${o.join(", ")}`),s.length>0&&i.push(`extras: ${s.join(", ")}`);let a=n.name??"contract";throw new Error(`${a} validation failed (${i.join("; ")})`)}var so=["Broadcast_Print","Com_Print","Client_Print","Center_Print","sound","positioned_sound","local_sound","configstring","get_configstring","Com_Error","modelindex","soundindex","imageindex","setmodel","trace","clip","pointcontents","inPVS","inPHS","SetAreaPortalState","AreasConnected","linkentity","unlinkentity","BoxEdicts","multicast","unicast"],io=["PreInit","Init","Shutdown","SpawnEntities","WriteGameJson","ReadGameJson","WriteLevelJson","ReadLevelJson","CanSave","ClientConnect","ClientThink","RunFrame","Pmove"],ao=["Com_Print","get_configstring","Com_Error","TagMalloc","TagFree","AddCommandString","CL_FrameValid","CL_FrameTime","CL_ClientTime","CL_ServerFrame","Draw_RegisterPic","Draw_GetPicSize","SCR_DrawChar","SCR_DrawPic","SCR_DrawColorPic"],co=["Init","Shutdown","DrawHUD","TouchPics","LayoutFlags","GetActiveWeaponWheelWeapon","GetOwnedWeaponWheelWeapons","GetWeaponWheelAmmoCount","GetPowerupWheelCount","GetHitMarkerDamage","Pmove","ParseConfigString","ParseCenterPrint","ClearNotify","ClearCenterprint","NotifyMessage","GetMonsterFlashOffset"];var de=(o=>(o[o.None=0]="None",o[o.Feet=1]="Feet",o[o.Waist=2]="Waist",o[o.Under=3]="Under",o))(de||{});function ut(t){return t>=2}function lo(t){return t===3}var q=(c=>(c[c.Ducked=1]="Ducked",c[c.JumpHeld=2]="JumpHeld",c[c.OnGround=4]="OnGround",c[c.TimeWaterJump=8]="TimeWaterJump",c[c.TimeLand=16]="TimeLand",c[c.TimeTeleport=32]="TimeTeleport",c[c.NoPositionalPrediction=64]="NoPositionalPrediction",c[c.OnLadder=128]="OnLadder",c[c.NoAngularPrediction=256]="NoAngularPrediction",c[c.IgnorePlayerCollision=512]="IgnorePlayerCollision",c[c.TimeTrick=1024]="TimeTrick",c))(q||{});function D(t,e){return(t&e)!==0}function G(t,e){return t|e}function X(t,e){return t&~e}var se=(a=>(a[a.Normal=0]="Normal",a[a.Grapple=1]="Grapple",a[a.NoClip=2]="NoClip",a[a.Spectator=3]="Spectator",a[a.Dead=4]="Dead",a[a.Gib=5]="Gib",a[a.Freeze=6]="Freeze",a))(se||{}),ie=(a=>(a[a.None=0]="None",a[a.Attack=1]="Attack",a[a.Use=2]="Use",a[a.Holster=4]="Holster",a[a.Jump=8]="Jump",a[a.Crouch=16]="Crouch",a[a.Any=128]="Any",a))(ie||{});var uo=270;function fo(t,e){return(t&e)!==0}function dt(t){let{pmFlags:e,pmType:n,buttons:r,waterlevel:o,onGround:s,velocity:i,origin:a,jumpHeight:l=uo}=t;if(e&16)return{pmFlags:e,onGround:s,velocity:i,origin:a,jumpSound:!1,jumped:!1};let d=fo(r,8),p=e,c=s,f=!1,x=!1,u=i,_=a;if(!d)return p=X(p,2),{pmFlags:p,onGround:c,velocity:u,origin:_,jumpSound:f,jumped:x};if(mo(p))return{pmFlags:p,onGround:c,velocity:u,origin:_,jumpSound:f,jumped:x};if(n===4)return{pmFlags:p,onGround:c,velocity:u,origin:_,jumpSound:f,jumped:x};if(o>=2)return c=!1,{pmFlags:p,onGround:c,velocity:u,origin:_,jumpSound:f,jumped:x};if(!c)return{pmFlags:p,onGround:c,velocity:u,origin:_,jumpSound:f,jumped:x};p=G(p,2),p=X(p,4),c=!1,f=!0,x=!0;let S=i.z+l,A=S<l?l:S;return u={...i,z:A},_={...a,z:a.z+1},{pmFlags:p,onGround:c,velocity:u,origin:_,jumpSound:f,jumped:x}}function mo(t){return(t&2)!==0}var po=100,ft=200,qt=150,De=25,xo=15,ho=1,yo={x:0,y:0,z:1},bo=(t,e)=>({fraction:1,endpos:e,allsolid:!1,startsolid:!1});function mt(t){let e=0,n=0,r=0;return t&262144&&(e+=1),t&524288&&(n+=1),t&1048576&&(e-=1),t&2097152&&(n-=1),t&4194304&&(r+=1),t&8388608&&(r-=1),e===0&&n===0&&r===0?P:{x:e,y:n,z:r}}function en(t){let{watertype:e,waterlevel:n,onGround:r,waterSpeed:o}=t;if((e&16515072)===0)return P;let s=mt(e);if(s===P)return P;let i=o;return n===1&&r&&(i*=.5),O(s,i)}function tn(t){let{groundContents:e,scale:n=po}=t,r=mt(e);return r===P?P:O(r,n)}function be(t){let{wishVelocity:e,onLadder:n,onGround:r,waterlevel:o,watertype:s,groundContents:i,cmd:a,viewPitch:l,maxSpeed:d,ladderMod:p,waterSpeed:c,forward:f,origin:x,mins:u,maxs:_,trace:S=bo}=t,A=e;n&&(A=go({wishVelocity:A,cmd:a,waterlevel:o,viewPitch:l,maxSpeed:d,ladderMod:p,onGround:r,forward:f,origin:x,mins:u,maxs:_,trace:S}));let E=en({watertype:s,waterlevel:o,onGround:r,waterSpeed:c});if(E!==P&&(A=R(A,E)),r){let b=tn({groundContents:i});b!==P&&(A=R(A,b))}return A}function go(t){let{wishVelocity:e,cmd:n,waterlevel:r,viewPitch:o,maxSpeed:s,ladderMod:i,onGround:a,forward:l,origin:d,mins:p,maxs:c,trace:f}=t,x=n.buttons??0,u={...e};if((x&24)!==0){let _=ut(r)?s:ft;u={...u,z:x&8?_:-_}}else if(n.forwardmove){let _=$t(n.forwardmove,-ft,ft);if(n.forwardmove>0){let S=o<xo?_:-_;u={...u,z:S}}else a||(u={...u,x:0,y:0}),u={...u,z:_}}else u={...u,z:0};if(!a)if(n.sidemove){let _=$t(n.sidemove,-qt,qt);r<2&&(_*=i);let S=w({x:l.x,y:l.y,z:0});if(S.x!==0||S.y!==0){let A=R(d,O(S,ho)),E=f(d,A,p,c);if(E.fraction!==1&&!E.allsolid&&E.contents!==void 0&&(E.contents&536870912)!==0&&E.planeNormal){let b=te(E.planeNormal,yo);u={...u,x:0,y:0},u=R(u,O(b,-_))}}}else u={...u,x:Qt(u.x),y:Qt(u.y)};return u}function $t(t,e,n){return Math.max(e,Math.min(n,t))}function Qt(t){return t<-De?-De:t>De?De:t}var nn=5,To=4,So=18,_o=.7,rn=1,on=2;function sn(t,e,n,r=nn,o=t){if(e.length===0)return{velocity:t,planes:[],stopped:!1};let s=[],i=t;for(let l of e){if(s.length>=r)return{velocity:P,planes:s,stopped:!0};if(s.find(f=>U(f,l)>.99))continue;s.push(l);let p,c=0;for(;c<s.length;c++){let f=ne(i,s[c],n),x=0;for(;x<s.length&&!(x!==c&&U(f,s[x])<0);x++);if(x===s.length){p=f;break}}if(p)i=p;else{if(s.length!==2)return{velocity:P,planes:s,stopped:!0};let f=te(s[0],s[1]),x=U(f,i);i=O(f,x)}if(U(i,o)<=0)return{velocity:P,planes:s,stopped:!0}}let a=i.x===0&&i.y===0&&i.z===0;return{velocity:i,planes:s,stopped:a}}function pt(t){let{origin:e,velocity:n,frametime:r,overbounce:o,trace:s,maxBumps:i=To,maxClipPlanes:a=nn,mins:l,maxs:d,hasTime:p=!1}=t,c=e,f=n,x=[],u=n,_=r,S=0;for(let E=0;E<i&&!(f.x===0&&f.y===0&&f.z===0);E++){let b=R(c,O(f,_)),T=s(c,b,l,d);if(T.allsolid){let v=p?u:P;return{origin:T.endpos,velocity:v,planes:x,stopped:!0,blocked:S}}if(T.startsolid){let v=p?u:P;return{origin:T.endpos,velocity:v,planes:x,stopped:!0,blocked:S}}if(T.fraction>0&&(c=T.endpos),T.fraction===1)break;if(!T.planeNormal)return{origin:c,velocity:p?u:P,planes:x,stopped:!0,blocked:S};T.planeNormal.z>.7&&(S|=rn),T.planeNormal.z===0&&(S|=on),x.push(T.planeNormal),_-=_*T.fraction;let C=sn(f,x,o,a,u);if(f=C.velocity,x.splice(0,x.length,...C.planes),u.z>0&&f.z<0&&(f={...f,z:0}),C.stopped)return{origin:c,velocity:p?u:f,planes:x,stopped:!0,blocked:S}}let A=p?u:f;return{origin:c,velocity:A,planes:x,stopped:A.x===0&&A.y===0&&A.z===0,blocked:S}}function ae(t){let{mins:e,maxs:n,stepSize:r=So,...o}=t,s=t.origin,i=t.velocity,a=pt({...o,mins:e,maxs:n}),l=R(s,{x:0,y:0,z:r}),d=o.trace(s,l,e,n);if(d.allsolid)return{...a,stepped:!1,stepHeight:0};let p=d.endpos.z-s.z,c=pt({...o,origin:d.endpos,velocity:i,mins:e,maxs:n}),f=R(c.origin,{x:0,y:0,z:-p}),x=o.trace(c.origin,f,e,n),u=c.origin,_=x.planeNormal;x.allsolid||(u=x.endpos);let S=(v,M)=>(v.x-M.x)**2+(v.y-M.y)**2,A=S(a.origin,s),E=S(u,s);if(A>E||_&&_.z<_o)return{...a,stepped:!1,stepHeight:0};let b={...c.velocity,z:a.velocity.z},T=c.blocked,C=b.x===0&&b.y===0&&b.z===0;return{origin:u,velocity:b,planes:c.planes,blocked:T,stopped:C,stepped:!0,stepHeight:p,stepNormal:_}}var an=1,Ao=60,Ue=1.01;function xt(t){let{origin:e,frametime:n,mins:r,maxs:o,trace:s,overbounce:i=Ue,stepSize:a,maxBumps:l,maxClipPlanes:d,hasTime:p,forward:c,right:f,cmd:x,pmFlags:u,onGround:_,gravity:S,pmType:A,pmAccelerate:E,pmAirAccelerate:b=an,pmMaxSpeed:T,pmDuckSpeed:C,onLadder:v,waterlevel:M,watertype:V,groundContents:W,viewPitch:H,ladderMod:h,pmWaterSpeed:F}=t,N={...t.velocity},B=ln(c,f,x);B=be({wishVelocity:B,onLadder:v,onGround:_,waterlevel:M,watertype:V,groundContents:W,cmd:x,viewPitch:H,maxSpeed:D(u,1)?C:T,ladderMod:h,waterSpeed:F,forward:c,origin:e,mins:r,maxs:o,trace:s});let z=D(u,1)?C:T,K=B,g=I(K);if(g!==0&&(K=w(K)),g>z){let $=z/g;B=O(B,$),g=z,g!==0&&(K=w(B))}return v?(N=Y({velocity:N,wishdir:K,wishspeed:g,accel:E,frametime:n}),Math.abs(B.z)<Number.EPSILON&&(N=Vo(N,S,n)),ge({origin:e,velocity:N,frametime:n,mins:r,maxs:o,trace:s,overbounce:i,stepSize:a,maxBumps:l,maxClipPlanes:d,hasTime:p})):_?(N={...N,z:0},N=Y({velocity:N,wishdir:K,wishspeed:g,accel:E,frametime:n}),S>0?N={...N,z:0}:N={...N,z:N.z-S*n},N.x===0&&N.y===0?{origin:e,velocity:N,planes:[],blocked:0,stopped:!0,stepped:!1,stepHeight:0}:ge({origin:e,velocity:N,frametime:n,mins:r,maxs:o,trace:s,overbounce:i,stepSize:a,maxBumps:l,maxClipPlanes:d,hasTime:p})):(b>0?N=bt({velocity:N,wishdir:K,wishspeed:g,accel:b,frametime:n}):N=Y({velocity:N,wishdir:K,wishspeed:g,accel:an,frametime:n}),A!==1&&(N={...N,z:N.z-S*n}),ge({origin:e,velocity:N,frametime:n,mins:r,maxs:o,trace:s,overbounce:i,stepSize:a,maxBumps:l,maxClipPlanes:d,hasTime:p}))}function ht(t){let{origin:e,frametime:n,mins:r,maxs:o,trace:s,overbounce:i=Ue,stepSize:a,maxBumps:l,maxClipPlanes:d,hasTime:p,forward:c,right:f,cmd:x,pmFlags:u,onGround:_,pmMaxSpeed:S,pmDuckSpeed:A,pmWaterAccelerate:E,pmWaterSpeed:b,onLadder:T,watertype:C,groundContents:v,waterlevel:M,viewPitch:V,ladderMod:W}=t,H={...t.velocity},h=Eo(c,f,x);vo(x,_)?h={...h,z:h.z-Ao}:cn(x,16)?h=R(h,{x:0,y:0,z:-b*.5}):cn(x,8)&&(h=R(h,{x:0,y:0,z:b*.5})),h=be({wishVelocity:h,onLadder:T,onGround:_,waterlevel:M,watertype:C,groundContents:v,cmd:x,viewPitch:V,maxSpeed:D(u,1)?A:S,ladderMod:W,waterSpeed:b,forward:c,origin:e,mins:r,maxs:o,trace:s});let F=h,N=I(F);if(N!==0&&(F=w(F)),N>S){let k=S/N;h=O(h,k),N=S,N!==0&&(F=w(h))}if(N*=.5,D(u,1)&&N>A){let k=A/N;h=O(h,k),N=A,N!==0&&(F=w(h))}return H=Y({velocity:H,wishdir:F,wishspeed:N,accel:E,frametime:n}),ge({origin:e,velocity:H,frametime:n,mins:r,maxs:o,trace:s,overbounce:i,stepSize:a,maxBumps:l,maxClipPlanes:d,hasTime:p})}function yt(t){let{origin:e,frametime:n,mins:r,maxs:o,trace:s,overbounce:i=Ue,stepSize:a,maxBumps:l,maxClipPlanes:d,hasTime:p,forward:c,right:f,cmd:x,pmFlags:u,onGround:_,gravity:S,pmAccelerate:A,pmMaxSpeed:E,pmDuckSpeed:b,onLadder:T,waterlevel:C,watertype:v,groundContents:M,viewPitch:V,ladderMod:W,pmWaterSpeed:H}=t,h={...t.velocity},F=ln(c,f,x);F=be({wishVelocity:F,onLadder:T,onGround:_,waterlevel:C,watertype:v,groundContents:M,cmd:x,viewPitch:V,maxSpeed:D(u,1)?b:E,ladderMod:W,waterSpeed:H,forward:c,origin:e,mins:r,maxs:o,trace:s});let B=D(u,1)?b:E,k=F,z=I(k);if(z!==0&&(k=w(k)),z>B){let K=B/z;F=O(F,K),z=B,z!==0&&(k=w(F))}return h={...h,z:0},h=Y({velocity:h,wishdir:k,wishspeed:z,accel:A,frametime:n}),S>0?h={...h,z:0}:h={...h,z:h.z-S*n},h.x===0&&h.y===0?{origin:e,velocity:h,planes:[],blocked:0,stopped:!0,stepped:!1,stepHeight:0}:ge({origin:e,velocity:h,frametime:n,mins:r,maxs:o,trace:s,overbounce:i,stepSize:a,maxBumps:l,maxClipPlanes:d,hasTime:p})}function ln(t,e,n){return{x:t.x*n.forwardmove+e.x*n.sidemove,y:t.y*n.forwardmove+e.y*n.sidemove,z:0}}function Eo(t,e,n){return{x:t.x*n.forwardmove+e.x*n.sidemove,y:t.y*n.forwardmove+e.y*n.sidemove,z:t.z*n.forwardmove+e.z*n.sidemove}}function cn(t,e){return!!((t.buttons??0)&e)}function vo(t,e){let n=t.forwardmove===0&&t.sidemove===0,r=!((t.buttons??0)&24);return n&&r&&!e}function Vo(t,e,n){let r=t.z,o=e*n;return r>0?(r-=o,r<0&&(r=0)):(r+=o,r>0&&(r=0)),{...t,z:r}}function ge(t){let{origin:e,velocity:n,frametime:r,mins:o,maxs:s,trace:i,overbounce:a=Ue,stepSize:l,maxBumps:d,maxClipPlanes:p,hasTime:c}=t;return ae({origin:e,velocity:n,frametime:r,trace:i,mins:o,maxs:s,overbounce:a,stepSize:l,maxBumps:d,maxClipPlanes:p,hasTime:c})}function Te(t){let{origin:e,mins:n,viewheight:r,pointContents:o}=t,s=r-n.z,i=s/2,a={x:e.x,y:e.y,z:e.z+n.z+1},l=o(a);if((l&56)===0)return{waterlevel:0,watertype:0};let d=l,p=1,c={x:a.x,y:a.y,z:e.z+n.z+i};if(l=o(c),(l&56)!==0){p=2;let f={x:a.x,y:a.y,z:e.z+n.z+s};l=o(f),(l&56)!==0&&(p=3)}return{waterlevel:p,watertype:d}}var No=.25,Co=180,Ro=100,Oo=.7,Mo=.9,Po=64,wo=128,Lo=1.01,Fo=1080;function Be(t){let{pmType:e,n64Physics:n,velocity:r,startVelocity:o,origin:s,mins:i,maxs:a,viewheight:l,trace:d,pointContents:p}=t,c=t.pmFlags,f=t.pmTime,x,u=D(c,4),_,S=0;if(r.z>Co||e===1)c=X(c,4),u=!1;else{let T={x:s.x,y:s.y,z:s.z-No},C=d(s,T,i,a);_=C,S=C.contents??0;let v=C.planeNormal,M=C.fraction<1&&!!v&&v.z<Oo;if(M&&v){let V=R(s,v),W=d(s,V,i,a);W.fraction<1&&!W.startsolid&&(M=!1)}if(C.fraction===1||!v||M&&!C.startsolid)c=X(c,4),u=!1;else{u=!0,D(c,8)&&(c&=~Fo,f=0);let V=D(c,4);if(!V){!n&&r.z>=Ro&&v.z>=Mo&&!D(c,1)&&(c=G(c,1024),f=Po);let W=ne(r,v,Lo);x=o.z-W.z}c=G(c,4),!V&&(n||D(c,1))&&(c=G(c,16),f=wo)}}let{waterlevel:E,watertype:b}=Te({origin:s,mins:i,viewheight:l,pointContents:p});return{pmFlags:c,pmTime:f,onGround:D(c,4),groundTrace:_,groundContents:S,waterlevel:E,watertype:b,impactDelta:x}}function Ie(t,e,n){return{x:t,y:e,z:n}}function Ge(t,e){let n=Ie(-16,-16,0),r=Ie(16,16,16);if(t===5)return{mins:n,maxs:r,viewheight:8};let o=t===4||(e&1)!==0,s=Ie(n.x,n.y,-24),i=Ie(r.x,r.y,o?4:32);return{mins:s,maxs:i,viewheight:o?-2:22}}var zo=4,Do=32,Uo=8;function gt(t){let{pmType:e}=t;if(e===5){let i=Ge(e,t.pmFlags);return{pmFlags:t.pmFlags,ducked:D(t.pmFlags,1),changed:!1,...i}}let n=t.pmFlags,r=!1;e===4?D(n,1)||(n=G(n,1),r=!0):Bo(t)?!D(n,1)&&!Io(t)&&(n=G(n,1),r=!0):D(n,1)&&!Go(t)&&(n=X(n,1),r=!0);let o=Ge(e,n),s=e===4||D(n,1);return{pmFlags:n,ducked:s,changed:r,...o}}function Bo(t){return(t.buttons&16)===0||t.onLadder||t.n64Physics?!1:!!(t.hasGroundEntity||t.waterlevel<=1&&!Wo(t))}function Io(t){return t.trace({start:t.origin,end:t.origin,mins:t.mins,maxs:un(t.maxs,zo),mask:3}).allsolid}function Go(t){return t.trace({start:t.origin,end:t.origin,mins:t.mins,maxs:un(t.maxs,Do),mask:3}).allsolid}function Wo(t){let e={x:t.origin.x,y:t.origin.y,z:t.origin.z-Uo};return t.trace({start:t.origin,end:e,mins:t.mins,maxs:t.maxs,mask:3}).fraction<1?!1:t.trace({start:t.origin,end:e,mins:t.mins,maxs:t.maxs,mask:56}).fraction<1}function un(t,e){return{x:t.x,y:t.y,z:e}}var Se=.025;function We(t){let{velocity:e,frametime:n,onGround:r,groundIsSlick:o,onLadder:s,waterlevel:i,pmFriction:a,pmStopSpeed:l,pmWaterFriction:d}=t,p=I(e);if(p<1)return{x:0,y:0,z:e.z};let c=0;if(r&&!o||s){let u=p<l?l:p;c+=u*a*n}i>0&&!s&&(c+=p*d*i*n);let f=p-c;if(f<0&&(f=0),f===p)return e;let x=f/p;return O(e,x)}function Y(t){let{velocity:e,wishdir:n,wishspeed:r,accel:o,frametime:s}=t,i=U(e,n),a=r-i;if(a<=0)return e;let l=o*s*r;return l>a&&(l=a),{x:e.x+n.x*l,y:e.y+n.y*l,z:e.z+n.z*l}}function bt(t){let{velocity:e,wishdir:n,wishspeed:r,accel:o,frametime:s}=t,i=Math.min(r,30),a=U(e,n),l=i-a;if(l<=0)return e;let d=o*r*s;return d>l&&(d=l),{x:e.x+n.x*d,y:e.y+n.y*d,z:e.z+n.z*d}}function ko(t,e){let n=Math.abs(t.forwardmove),r=Math.abs(t.sidemove),o=Math.abs(t.upmove),s=Math.max(n,r,o);if(s===0)return 0;let i=Math.sqrt(t.forwardmove*t.forwardmove+t.sidemove*t.sidemove+t.upmove*t.upmove);return e*s/(127*i)}function Tt(t){let{forward:e,right:n,cmd:r,maxSpeed:o}=t,s={x:e.x*r.forwardmove+n.x*r.sidemove,y:e.y*r.forwardmove+n.y*r.sidemove,z:0},i=I(s);if(i>o){let a=o/i;s=O(s,a),i=o}return{wishdir:i===0?s:w(s),wishspeed:i}}function St(t){let{forward:e,right:n,cmd:r,maxSpeed:o}=t,s={x:e.x*r.forwardmove+n.x*r.sidemove,y:e.y*r.forwardmove+n.y*r.sidemove,z:e.z*r.forwardmove+n.z*r.sidemove};r.upmove>10?s=R(s,{x:0,y:0,z:r.upmove}):r.upmove<-10?s=R(s,{x:0,y:0,z:r.upmove}):Math.abs(r.forwardmove)<10&&Math.abs(r.sidemove)<10?s=R(s,{x:0,y:0,z:-60}):s=R(s,{x:0,y:0,z:10});let i=I(s);if(i>o){let a=o/i;s=O(s,a),i=o}return i*=.5,{wishdir:i===0?s:w(s),wishspeed:i}}function Ho(t,e){if(t.pmType===4)return t;let n={...t},r=Be({pmType:n.pmType,pmFlags:n.pmFlags,pmTime:0,n64Physics:!1,velocity:n.velocity,startVelocity:n.velocity,origin:n.origin,mins:n.mins,maxs:n.maxs,viewheight:n.viewHeight,trace:e.trace,pointContents:e.pointcontents});n.pmFlags=r.pmFlags,n.waterlevel=r.waterlevel,n.watertype=r.watertype;let o=gt({pmType:n.pmType,pmFlags:n.pmFlags,buttons:n.cmd.buttons,waterlevel:n.waterlevel,hasGroundEntity:(n.pmFlags&4)!==0,onLadder:!1,n64Physics:!1,origin:n.origin,mins:n.mins,maxs:n.maxs,trace:c=>e.trace(c.start,c.end,c.mins,c.maxs)});n.pmFlags=o.pmFlags,n.mins=o.mins,n.maxs=o.maxs,n.viewHeight=o.viewheight;let s=dt({pmFlags:n.pmFlags,pmType:n.pmType,buttons:n.cmd.buttons,waterlevel:n.waterlevel,onGround:(n.pmFlags&4)!==0,velocity:n.velocity,origin:n.origin});n.pmFlags=s.pmFlags,n.velocity=s.velocity,n.origin=s.origin,s.onGround!==((n.pmFlags&4)!==0)&&(s.onGround?n.pmFlags=G(n.pmFlags,4):n.pmFlags=X(n.pmFlags,4));let i=(n.pmFlags&4)!==0,a=n.velocity;n.velocity=We({velocity:n.velocity,frametime:Se,onGround:i,groundIsSlick:!1,onLadder:!1,waterlevel:n.waterlevel,pmFriction:6,pmStopSpeed:100,pmWaterFriction:1});let{forward:l,right:d}=re(n.viewAngles);if(n.pmType===2){let c={x:l.x*n.cmd.forwardmove+d.x*n.cmd.sidemove,y:l.y*n.cmd.forwardmove+d.y*n.cmd.sidemove,z:n.cmd.upmove},f=Se;n.velocity=c,n.origin={x:n.origin.x+c.x*f,y:n.origin.y+c.y*f,z:n.origin.z+c.z*f}}else if(n.waterlevel>=2){let c=ht({origin:n.origin,velocity:n.velocity,frametime:Se,mins:n.mins,maxs:n.maxs,trace:e.trace,cmd:n.cmd,forward:l,right:d,pmFlags:n.pmFlags,onGround:i,pmMaxSpeed:300,pmDuckSpeed:100,pmWaterAccelerate:4,pmWaterSpeed:400,onLadder:!1,watertype:n.watertype,groundContents:0,waterlevel:n.waterlevel,viewPitch:n.viewAngles.x,ladderMod:1,stepSize:18});n.origin=c.origin,n.velocity=c.velocity}else if((n.pmFlags&4)===0){let c=xt({origin:n.origin,velocity:n.velocity,frametime:Se,mins:n.mins,maxs:n.maxs,trace:e.trace,cmd:n.cmd,forward:l,right:d,pmFlags:n.pmFlags,onGround:i,gravity:n.gravity,pmType:n.pmType,pmAccelerate:10,pmAirAccelerate:1,pmMaxSpeed:300,pmDuckSpeed:100,onLadder:!1,waterlevel:n.waterlevel,watertype:n.watertype,groundContents:0,viewPitch:n.viewAngles.x,ladderMod:1,pmWaterSpeed:400,stepSize:18});n.origin=c.origin,n.velocity=c.velocity}else{let c=yt({origin:n.origin,velocity:n.velocity,frametime:Se,mins:n.mins,maxs:n.maxs,trace:e.trace,cmd:n.cmd,forward:l,right:d,pmFlags:n.pmFlags,onGround:i,gravity:n.gravity,pmType:n.pmType,pmAccelerate:10,pmMaxSpeed:300,pmDuckSpeed:100,onLadder:!1,waterlevel:n.waterlevel,watertype:n.watertype,groundContents:0,viewPitch:n.viewAngles.x,ladderMod:1,pmWaterSpeed:400,stepSize:18});n.origin=c.origin,n.velocity=c.velocity}let p=Be({pmType:n.pmType,pmFlags:n.pmFlags,pmTime:0,n64Physics:!1,velocity:n.velocity,startVelocity:n.velocity,origin:n.origin,mins:n.mins,maxs:n.maxs,viewheight:n.viewHeight,trace:e.trace,pointContents:e.pointcontents});return n.pmFlags=p.pmFlags,n.waterlevel=p.waterlevel,n.watertype=p.watertype,n}var fe=["x","y","z"],_t=[{normal:[0,0,1],mins:[-1,-1,0],maxs:[1,1,0]},{normal:[0,0,-1],mins:[-1,-1,0],maxs:[1,1,0]},{normal:[1,0,0],mins:[0,-1,-1],maxs:[0,1,1]},{normal:[-1,0,0],mins:[0,-1,-1],maxs:[0,1,1]},{normal:[0,1,0],mins:[-1,0,-1],maxs:[1,0,1]},{normal:[0,-1,0],mins:[-1,0,-1],maxs:[1,0,1]}],dn={x:0,y:0,z:0};function me(t){return{x:t.x,y:t.y,z:t.z}}function Ko(t){return{x:t[0],y:t[1],z:t[2]}}function _e(t,e,n){if(n!==0)switch(e){case"x":t.x+=n;break;case"y":t.y+=n;break;case"z":t.z+=n;break}}function fn(t,e,n){switch(e){case"x":t.x=n;break;case"y":t.y=n;break;case"z":t.z=n;break}}function ke(t,e){switch(e){case"x":return t.x;case"y":return t.y;case"z":default:return t.z}}function mn(t,e,n,r){return t===-1?ke(n,e):t===1?ke(r,e):0}function pn(t,e,n,r){let o=me(t);for(let s=0;s<fe.length;s++){let i=fe[s],a=e.normal[s];a<0?_e(o,i,ke(n,i)):a>0&&_e(o,i,ke(r,i))}return o}function Xo(t,e,n){let r=me(dn),o=me(dn);for(let s=0;s<fe.length;s++){let i=fe[s];fn(r,i,mn(t.mins[s],i,e,n)),fn(o,i,mn(t.maxs[s],i,e,n))}return{mins:r,maxs:o}}function Jo(t,e,n){if(!e||n===0)return t;let r=me(t);return _e(r,e,n),r}function Yo(t,e,n){if(!e||n===0)return t;switch(e){case"x":return{...t,x:t.x+n};case"y":return{...t,y:t.y+n};case"z":default:return{...t,z:t.z+n}}}function At(t){let{origin:e,mins:n,maxs:r,trace:o}=t;if(!o(e,n,r,e).startsolid)return{result:"good-position",origin:{...e}};let i=[];for(let a=0;a<_t.length;a++){let l=_t[a],{mins:d,maxs:p}=Xo(l,n,r),c=pn(e,l,n,r),f=o(c,d,p,c),x,u=0;if(f.startsolid)for(let v=0;v<fe.length;v++){if(l.normal[v]!==0)continue;let M=fe[v],V=me(c);if(_e(V,M,1),f=o(V,d,p,V),!f.startsolid){c=V,x=M,u=1;break}if(V=me(c),_e(V,M,-1),f=o(V,d,p,V),!f.startsolid){c=V,x=M,u=-1;break}}if(f.startsolid)continue;let _=_t[a^1],S=pn(e,_,n,r);if(S=Jo(S,x,u),f=o(c,d,p,S),f.startsolid)continue;let A=Ko(l.normal),E=R(f.endpos??S,O(A,.125)),b=ee(E,S),T=R(e,b);T=Yo(T,x,u),!o(T,n,r,T).startsolid&&i.push({origin:T,distance:ce(b)})}return i.length===0?{result:"no-good-position",origin:{...e}}:(i.sort((a,l)=>a.distance-l.distance),{result:"fixed",origin:{...i[0].origin}})}var jo=1.5,xn=.5,Zo=1.01;function qo(t){let{origin:e,cmd:n,frametime:r,pmFriction:o,pmStopSpeed:s,pmMaxSpeed:i,pmAccelerate:a,pmWaterSpeed:l,doclip:d,forward:p,right:c,mins:f,maxs:x,trace:u,overbounce:_=Zo,stepSize:S,maxBumps:A,maxClipPlanes:E}=t,b=$o({velocity:t.velocity,pmFriction:o,pmStopSpeed:s,frametime:r}),T=Qo({cmd:n,forward:p,right:c,pmMaxSpeed:i,pmWaterSpeed:l});if(T.wishspeed>0&&(b=Y({velocity:b,wishdir:T.wishdir,wishspeed:T.accelSpeed,accel:a,frametime:r})),!d){let C=O(b,r);return{origin:R(e,C),velocity:b,planes:[],blocked:0,stopped:b.x===0&&b.y===0&&b.z===0,stepped:!1,stepHeight:0}}if(!u||!f||!x)throw new Error("applyPmoveFlyMove: doclip=true requires trace/mins/maxs");return ae({origin:e,velocity:b,frametime:r,overbounce:_,trace:u,mins:f,maxs:x,stepSize:S,maxBumps:A,maxClipPlanes:E})}function $o(t){let{velocity:e,pmFriction:n,pmStopSpeed:r,frametime:o}=t,s=I(e);if(s<1)return{x:0,y:0,z:0};let i=n*jo,l=(s<r?r:s)*i*o,d=s-l;return d<0&&(d=0),d===s?e:O(e,d/s)}function Qo(t){let{cmd:e,forward:n,right:r,pmMaxSpeed:o,pmWaterSpeed:s}=t,i=w(n),a=w(r),d={x:i.x*e.forwardmove+a.x*e.sidemove,y:i.y*e.forwardmove+a.y*e.sidemove,z:i.z*e.forwardmove+a.z*e.sidemove},p=e.buttons??0;p&8&&(d=R(d,{x:0,y:0,z:s*xn})),p&16&&(d=R(d,{x:0,y:0,z:-s*xn}));let c=I(d),f=c===0?{x:0,y:0,z:0}:w(d);if(c>o){let u=o/c;d=O(d,u),c=o,f=c===0?{x:0,y:0,z:0}:w(d)}let x=c*2;return{wishdir:f,wishspeed:c,accelSpeed:x}}var es=1,ts=40,He=50,hn=350,ns=2048,yn=.1,rs=800,os=50,bn=.7,ss=18,is=1.01,as=2;function cs(t){let{pmFlags:e,pmTime:n,waterlevel:r,watertype:o,gravity:s,cmd:i,forward:a,origin:l,velocity:d,mins:p,maxs:c,viewheight:f,trace:x,pointContents:u,onGround:_,overbounce:S=is,stepSize:A=ss,maxBumps:E,maxClipPlanes:b}=t;if(n>0)return{pmFlags:e,pmTime:n,velocity:d,performedWaterJump:!1};let T=X(e,128),C=n,v=d,M=w({x:a.x,y:a.y,z:0}),V=ce(M)>0;if(r<2&&V){let g=R(l,O(M,es)),$=x(l,g,p,c),Pn=$.contents??0;$.fraction<1&&(Pn&536870912)!==0&&(T=G(T,128))}if(s===0)return{pmFlags:T,pmTime:C,velocity:v,performedWaterJump:!1};if(((i.buttons??0)&8)===0&&i.forwardmove<=0)return{pmFlags:T,pmTime:C,velocity:v,performedWaterJump:!1};if(r!==2)return{pmFlags:T,pmTime:C,velocity:v,performedWaterJump:!1};if((o&8192)!==0)return{pmFlags:T,pmTime:C,velocity:v,performedWaterJump:!1};if(!V)return{pmFlags:T,pmTime:C,velocity:v,performedWaterJump:!1};let W=R(l,O(M,ts)),H=x(l,W,p,c);if(H.fraction===1||!H.planeNormal||H.planeNormal.z>=bn)return{pmFlags:T,pmTime:C,velocity:v,performedWaterJump:!1};let h={x:M.x*He,y:M.y*He,z:hn},F=l,N=!0,B=ls(s);for(let g=0;g<B;g++){h={x:h.x,y:h.y,z:h.z-s*yn},h.z<0&&(N=!1);let $=ae({origin:F,velocity:h,frametime:yn,trace:x,mins:p,maxs:c,overbounce:S,stepSize:A,maxBumps:E,maxClipPlanes:b,hasTime:N});F=$.origin,h=$.velocity}let k=R(F,{x:0,y:0,z:-as}),z=x(F,k,p,c);return z.fraction===1||!z.planeNormal||z.planeNormal.z<bn||z.endpos.z<l.z?{pmFlags:T,pmTime:C,velocity:v,performedWaterJump:!1}:_&&Math.abs(l.z-z.endpos.z)<=A?{pmFlags:T,pmTime:C,velocity:v,performedWaterJump:!1}:Te({origin:z.endpos,mins:p,viewheight:f,pointContents:u}).waterlevel>=2?{pmFlags:T,pmTime:C,velocity:v,performedWaterJump:!1}:(T=G(T,8),C=ns,v={x:M.x*He,y:M.y*He,z:hn},{pmFlags:T,pmTime:C,velocity:v,performedWaterJump:!0})}function ls(t){if(t===0)return 0;let e=Math.floor(10*(rs/t));return e<=0?0:Math.min(os,e)}var Et=[0,-1,1];function vt(t){let{origin:e,mins:n,maxs:r,trace:o}=t;return!o(e,e,n,r).allsolid}function us(t){let{origin:e,velocity:n,mins:r,maxs:o,previousOrigin:s,trace:i}=t;if(vt({origin:e,mins:r,maxs:o,trace:i}))return{origin:{...e},velocity:{...n},resolution:"unchanged"};let a=At({origin:e,mins:r,maxs:o,trace:(l,d,p,c)=>i(l,c,d,p)});return a.result==="fixed"||a.result==="good-position"?{origin:a.origin,velocity:{...n},resolution:"fixed"}:{origin:{...s},velocity:{...n},resolution:"reverted"}}function ds(t){let{origin:e,mins:n,maxs:r,trace:o}=t;for(let s of Et)for(let i of Et)for(let a of Et){let l={x:e.x+a,y:e.y+i,z:e.z+s};if(vt({origin:l,mins:n,maxs:r,trace:o}))return{origin:l,snapped:a!==0||i!==0||s!==0}}return{origin:{...e},snapped:!1}}function fs(t,e){return{x:t.x+e.x,y:t.y+e.y,z:t.z+e.z}}function ms(t){return t>89&&t<180?89:t<271&&t>=180?271:t}function ps(t){let{pmFlags:e,cmdAngles:n,deltaAngles:r}=t,o;(e&32)!==0?o={x:0,y:n.y+r.y,z:0}:(o=fs(n,r),o={...o,x:ms(o.x)});let s=re(o);return{viewangles:o,...s}}var xs=200,hs=200,ys=200,bs=140,gs=150,Ts=3;function Ss(t){let e=xe(t);return e>89&&e<180?89:e<271&&e>=180?271:e}function _s(t,e){return{x:Ss(t.x+e.x),y:xe(t.y+e.y),z:xe(t.z+e.z)}}function As(t,e){let n=e.sensitivityX??e.sensitivity,r=(e.sensitivityY??e.sensitivity)*(e.invertY?-1:1);return{x:t.deltaY*r,y:t.deltaX*n,z:0}}var gn=(g=>(g[g.bad=0]="bad",g[g.muzzleflash=1]="muzzleflash",g[g.muzzleflash2=2]="muzzleflash2",g[g.temp_entity=3]="temp_entity",g[g.layout=4]="layout",g[g.inventory=5]="inventory",g[g.nop=6]="nop",g[g.disconnect=7]="disconnect",g[g.reconnect=8]="reconnect",g[g.sound=9]="sound",g[g.print=10]="print",g[g.stufftext=11]="stufftext",g[g.serverdata=12]="serverdata",g[g.configstring=13]="configstring",g[g.spawnbaseline=14]="spawnbaseline",g[g.centerprint=15]="centerprint",g[g.download=16]="download",g[g.playerinfo=17]="playerinfo",g[g.packetentities=18]="packetentities",g[g.deltapacketentities=19]="deltapacketentities",g[g.frame=20]="frame",g[g.splitclient=21]="splitclient",g[g.configblast=22]="configblast",g[g.spawnbaselineblast=23]="spawnbaselineblast",g[g.level_restart=24]="level_restart",g[g.damage=25]="damage",g[g.locprint=26]="locprint",g[g.fog=27]="fog",g[g.waitingforplayers=28]="waitingforplayers",g[g.bot_chat=29]="bot_chat",g[g.poi=30]="poi",g[g.help_path=31]="help_path",g[g.muzzleflash3=32]="muzzleflash3",g[g.achievement=33]="achievement",g))(gn||{}),Tn=(s=>(s[s.bad=0]="bad",s[s.nop=1]="nop",s[s.move=2]="move",s[s.userinfo=3]="userinfo",s[s.stringcmd=4]="stringcmd",s))(Tn||{});var Sn=(m=>(m[m.GUNSHOT=0]="GUNSHOT",m[m.BLOOD=1]="BLOOD",m[m.BLASTER=2]="BLASTER",m[m.RAILTRAIL=3]="RAILTRAIL",m[m.SHOTGUN=4]="SHOTGUN",m[m.EXPLOSION1=5]="EXPLOSION1",m[m.EXPLOSION2=6]="EXPLOSION2",m[m.ROCKET_EXPLOSION=7]="ROCKET_EXPLOSION",m[m.GRENADE_EXPLOSION=8]="GRENADE_EXPLOSION",m[m.SPARKS=9]="SPARKS",m[m.SPLASH=10]="SPLASH",m[m.BUBBLETRAIL=11]="BUBBLETRAIL",m[m.SCREEN_SPARKS=12]="SCREEN_SPARKS",m[m.SHIELD_SPARKS=13]="SHIELD_SPARKS",m[m.BULLET_SPARKS=14]="BULLET_SPARKS",m[m.LASER_SPARKS=15]="LASER_SPARKS",m[m.PARASITE_ATTACK=16]="PARASITE_ATTACK",m[m.ROCKET_EXPLOSION_WATER=17]="ROCKET_EXPLOSION_WATER",m[m.GRENADE_EXPLOSION_WATER=18]="GRENADE_EXPLOSION_WATER",m[m.MEDIC_CABLE_ATTACK=19]="MEDIC_CABLE_ATTACK",m[m.BFG_EXPLOSION=20]="BFG_EXPLOSION",m[m.BFG_BIGEXPLOSION=21]="BFG_BIGEXPLOSION",m[m.BOSSTPORT=22]="BOSSTPORT",m[m.BFG_LASER=23]="BFG_LASER",m[m.GRAPPLE_CABLE=24]="GRAPPLE_CABLE",m[m.WELDING_SPARKS=25]="WELDING_SPARKS",m[m.GREENBLOOD=26]="GREENBLOOD",m[m.BLUEHYPERBLASTER=27]="BLUEHYPERBLASTER",m[m.PLASMA_EXPLOSION=28]="PLASMA_EXPLOSION",m[m.TUNNEL_SPARKS=29]="TUNNEL_SPARKS",m[m.BLASTER2=30]="BLASTER2",m[m.RAILTRAIL2=31]="RAILTRAIL2",m[m.FLAME=32]="FLAME",m[m.LIGHTNING=33]="LIGHTNING",m[m.DEBUGTRAIL=34]="DEBUGTRAIL",m[m.PLAIN_EXPLOSION=35]="PLAIN_EXPLOSION",m[m.FLASHLIGHT=36]="FLASHLIGHT",m[m.FORCEWALL=37]="FORCEWALL",m[m.HEATBEAM=38]="HEATBEAM",m[m.MONSTER_HEATBEAM=39]="MONSTER_HEATBEAM",m[m.STEAM=40]="STEAM",m[m.BUBBLETRAIL2=41]="BUBBLETRAIL2",m[m.MOREBLOOD=42]="MOREBLOOD",m[m.HEATBEAM_SPARKS=43]="HEATBEAM_SPARKS",m[m.HEATBEAM_STEAM=44]="HEATBEAM_STEAM",m[m.CHAINFIST_SMOKE=45]="CHAINFIST_SMOKE",m[m.ELECTRIC_SPARKS=46]="ELECTRIC_SPARKS",m[m.TRACKER_EXPLOSION=47]="TRACKER_EXPLOSION",m[m.TELEPORT_EFFECT=48]="TELEPORT_EFFECT",m[m.DBALL_GOAL=49]="DBALL_GOAL",m[m.WIDOWBEAMOUT=50]="WIDOWBEAMOUT",m[m.NUKEBLAST=51]="NUKEBLAST",m[m.WIDOWSPLASH=52]="WIDOWSPLASH",m[m.EXPLOSION1_BIG=53]="EXPLOSION1_BIG",m[m.EXPLOSION1_NP=54]="EXPLOSION1_NP",m[m.FLECHETTE=55]="FLECHETTE",m[m.BLUEHYPERBLASTER_KEX=56]="BLUEHYPERBLASTER_KEX",m[m.BFG_ZAP=57]="BFG_ZAP",m[m.BERSERK_SLAM=58]="BERSERK_SLAM",m[m.GRAPPLE_CABLE_2=59]="GRAPPLE_CABLE_2",m[m.POWER_SPLASH=60]="POWER_SPLASH",m[m.LIGHTNING_BEAM=61]="LIGHTNING_BEAM",m[m.EXPLOSION1_NL=62]="EXPLOSION1_NL",m[m.EXPLOSION2_NL=63]="EXPLOSION2_NL",m))(Sn||{});var Es=1024,vs=256,Vs=16,Ns=64,Cs=512,Rs=1400,Os=0,Ms=1,Ps=2,ws=3,Ls=4,Fs=5,zs=6,Ds=7,Us=8,Bs=9,Is=10,Gs=11,Ws=12,ks=13;var _n=(i=>(i[i.LAYOUTS_LAYOUT=1]="LAYOUTS_LAYOUT",i[i.LAYOUTS_INVENTORY=2]="LAYOUTS_INVENTORY",i[i.LAYOUTS_HIDE_HUD=4]="LAYOUTS_HIDE_HUD",i[i.LAYOUTS_INTERMISSION=8]="LAYOUTS_INTERMISSION",i[i.LAYOUTS_HELP=16]="LAYOUTS_HELP",i[i.LAYOUTS_HIDE_CROSSHAIR=32]="LAYOUTS_HIDE_CROSSHAIR",i))(_n||{});function Vt(t){return t<<16>>16}function An(t,e,n){let r=Math.floor(n/2),o=n%2!==0,s=e+r,i=t[s]||0;if(o){let a=t[s+1]||0,l=i>>>8&255;return(a&255)<<8|l}else return i&65535}function Hs(t,e,n,r){let o=Math.floor(n/2),s=n%2!==0,i=e+o;if(t[i]===void 0&&(t[i]=0),!s)t[i]=Vt(r);else{t[i+1]===void 0&&(t[i+1]=0);let a=t[i],l=t[i+1],d=r&255,p=a&255|d<<8;t[i]=Vt(p);let f=r>>>8&255|l&65280;t[i+1]=Vt(f)}}function Nt(t,e,n,r,o){let s=o*n,i=Math.floor(s/8),a=s%8,l=(1<<o)-1<<a,p=An(t,e,i)&~l|r<<a&l;Hs(t,e,i,p&65535)}function Ct(t,e,n,r){let o=r*n,s=Math.floor(o/8),i=o%8,a=(1<<r)-1<<i;return(An(t,e,s)&a)>>>i}var En=(V=>(V.QuadDamage="quad",V.Invulnerability="invulnerability",V.EnviroSuit="enviro_suit",V.Rebreather="rebreather",V.Silencer="silencer",V.PowerScreen="power_screen",V.PowerShield="power_shield",V.QuadFire="quad_fire",V.Invisibility="invisibility",V.Bandolier="bandolier",V.AmmoPack="ammo_pack",V.IRGoggles="ir_goggles",V.DoubleDamage="double_damage",V.SphereVengeance="sphere_vengeance",V.SphereHunter="sphere_hunter",V.SphereDefender="sphere_defender",V.Doppelganger="doppelganger",V.TagToken="tag_token",V.TechResistance="tech_resistance",V.TechStrength="tech_strength",V.TechHaste="tech_haste",V.TechRegeneration="tech_regeneration",V.Flashlight="flashlight",V.Compass="compass",V))(En||{});var vn=(y=>(y[y.STAT_HEALTH_ICON=0]="STAT_HEALTH_ICON",y[y.STAT_HEALTH=1]="STAT_HEALTH",y[y.STAT_AMMO_ICON=2]="STAT_AMMO_ICON",y[y.STAT_AMMO=3]="STAT_AMMO",y[y.STAT_ARMOR_ICON=4]="STAT_ARMOR_ICON",y[y.STAT_ARMOR=5]="STAT_ARMOR",y[y.STAT_SELECTED_ICON=6]="STAT_SELECTED_ICON",y[y.STAT_PICKUP_ICON=7]="STAT_PICKUP_ICON",y[y.STAT_PICKUP_STRING=8]="STAT_PICKUP_STRING",y[y.STAT_TIMER_ICON=9]="STAT_TIMER_ICON",y[y.STAT_TIMER=10]="STAT_TIMER",y[y.STAT_HELPICON=11]="STAT_HELPICON",y[y.STAT_SELECTED_ITEM=12]="STAT_SELECTED_ITEM",y[y.STAT_LAYOUTS=13]="STAT_LAYOUTS",y[y.STAT_FRAGS=14]="STAT_FRAGS",y[y.STAT_FLASHES=15]="STAT_FLASHES",y[y.STAT_CHASE=16]="STAT_CHASE",y[y.STAT_SPECTATOR=17]="STAT_SPECTATOR",y[y.STAT_CTF_TEAM1_PIC=18]="STAT_CTF_TEAM1_PIC",y[y.STAT_CTF_TEAM1_CAPS=19]="STAT_CTF_TEAM1_CAPS",y[y.STAT_CTF_TEAM2_PIC=20]="STAT_CTF_TEAM2_PIC",y[y.STAT_CTF_TEAM2_CAPS=21]="STAT_CTF_TEAM2_CAPS",y[y.STAT_CTF_FLAG_PIC=22]="STAT_CTF_FLAG_PIC",y[y.STAT_CTF_JOINED_TEAM1_PIC=23]="STAT_CTF_JOINED_TEAM1_PIC",y[y.STAT_CTF_JOINED_TEAM2_PIC=24]="STAT_CTF_JOINED_TEAM2_PIC",y[y.STAT_CTF_TEAM1_HEADER=25]="STAT_CTF_TEAM1_HEADER",y[y.STAT_CTF_TEAM2_HEADER=26]="STAT_CTF_TEAM2_HEADER",y[y.STAT_CTF_TECH=27]="STAT_CTF_TECH",y[y.STAT_CTF_ID_VIEW=28]="STAT_CTF_ID_VIEW",y[y.STAT_CTF_MATCH=29]="STAT_CTF_MATCH",y[y.STAT_CTF_ID_VIEW_COLOR=30]="STAT_CTF_ID_VIEW_COLOR",y[y.STAT_CTF_TEAMINFO=31]="STAT_CTF_TEAMINFO",y[y.STAT_WEAPONS_OWNED_1=32]="STAT_WEAPONS_OWNED_1",y[y.STAT_WEAPONS_OWNED_2=33]="STAT_WEAPONS_OWNED_2",y[y.STAT_AMMO_INFO_START=34]="STAT_AMMO_INFO_START",y[y.STAT_POWERUP_INFO_START=41]="STAT_POWERUP_INFO_START",y[y.STAT_KEY_A=44]="STAT_KEY_A",y[y.STAT_KEY_B=45]="STAT_KEY_B",y[y.STAT_KEY_C=46]="STAT_KEY_C",y[y.STAT_ACTIVE_WHEEL_WEAPON=47]="STAT_ACTIVE_WHEEL_WEAPON",y[y.STAT_COOP_RESPAWN=48]="STAT_COOP_RESPAWN",y[y.STAT_LIVES=49]="STAT_LIVES",y[y.STAT_HIT_MARKER=50]="STAT_HIT_MARKER",y[y.STAT_SELECTED_ITEM_NAME=51]="STAT_SELECTED_ITEM_NAME",y[y.STAT_HEALTH_BARS=52]="STAT_HEALTH_BARS",y[y.STAT_ACTIVE_WEAPON=53]="STAT_ACTIVE_WEAPON",y[y.STAT_LAST=54]="STAT_LAST",y))(vn||{}),Ke=12,Xe=9,Ks=Math.ceil(Ke*Xe/16),Je=23,Ye=2,Xs=Math.ceil(Je*Ye/16),Vn={power_screen:0,power_shield:1,quad:3,quad_fire:4,invulnerability:5,invisibility:6,silencer:7,rebreather:8,enviro_suit:9,bandolier:10,ammo_pack:10,ir_goggles:11,double_damage:12,sphere_vengeance:13,sphere_hunter:14,sphere_defender:15,doppelganger:16,flashlight:17,compass:18,tech_resistance:19,tech_strength:20,tech_haste:21,tech_regeneration:22,tag_token:-1};function Js(t,e,n){if(e<0||e>=Ke)return;let r=n;r>511&&(r=511),r<0&&(r=0),Nt(t,34,e,r,Xe)}function Ys(t,e){return e<0||e>=Ke?0:Ct(t,34,e,Xe)}function js(t,e,n){let r;if(typeof e=="number"?r=e:r=Vn[e],r===void 0||r<0||r>=Je)return;let o=n;o>3&&(o=3),o<0&&(o=0),Nt(t,41,r,o,Ye)}function Zs(t,e){let n;return typeof e=="number"?n=e:n=Vn[e],n===void 0||n<0||n>=Je?0:Ct(t,41,n,Ye)}function qs(t,e){t.writeByte(e.msec),t.writeByte(e.buttons),t.writeAngle16(e.angles.x),t.writeAngle16(e.angles.y),t.writeAngle16(e.angles.z),t.writeShort(e.forwardmove),t.writeShort(e.sidemove),t.writeShort(e.upmove),t.writeByte(0),t.writeByte(0)}var Nn=(b=>(b[b.MinLight=1]="MinLight",b[b.ViewerModel=2]="ViewerModel",b[b.WeaponModel=4]="WeaponModel",b[b.FullBright=8]="FullBright",b[b.DepthHack=16]="DepthHack",b[b.Translucent=32]="Translucent",b[b.FrameLerp=64]="FrameLerp",b[b.Beam=128]="Beam",b[b.CustomLight=256]="CustomLight",b[b.Glow=512]="Glow",b[b.ShellRed=1024]="ShellRed",b[b.ShellGreen=2048]="ShellGreen",b[b.ShellBlue=4096]="ShellBlue",b[b.IrVisible=32768]="IrVisible",b[b.ShellDouble=65536]="ShellDouble",b[b.ShellHalfDam=131072]="ShellHalfDam",b[b.MinLightPlus=262144]="MinLightPlus",b[b.ExtraLight=524288]="ExtraLight",b[b.BeamLightning=1048576]="BeamLightning",b))(Nn||{});var $s=[0,145,227,114,7,150,228,117,14,159,237,124,9,152,234,123,28,141,255,110,27,138,248,105,18,131,241,96,21,132,246,103,56,169,219,74,63,174,220,77,54,167,213,68,49,160,210,67,36,181,199,86,35,178,192,81,42,187,201,88,45,188,206,95,112,225,147,2,119,230,148,5,126,239,157,12,121,232,154,11,108,253,143,30,107,250,136,25,98,243,129,16,101,244,134,23,72,217,171,58,79,222,172,61,70,215,165,52,65,208,162,51,84,197,183,38,83,194,176,33,90,203,185,40,93,204,190,47,224,113,3,146,231,118,4,149,238,127,13,156,233,120,10,155,252,109,31,142,251,106,24,137,242,99,17,128,245,100,22,135,216,73,59,170,223,78,60,173,214,71,53,164,209,64,50,163,196,85,39,182,195,82,32,177,202,91,41,184,205,92,46,191,144,1,115,226,151,6,116,229,158,15,125,236,153,8,122,235,140,29,111,254,139,26,104,249,130,19,97,240,133,20,102,247,168,57,75,218,175,62,76,221,166,55,69,212,161,48,66,211,180,37,86,199,179,34,80,193,186,43,89,200,189,44,94,207];function Qs(t){let e=0;for(let n=0;n<t.length;n++)e=$s[(e^t[n])&255];return e}var Rt={};qe(Rt,{U_ANGLE1:()=>ii,U_ANGLE2:()=>ai,U_ANGLE3:()=>ci,U_EFFECTS:()=>di,U_EVENT:()=>pi,U_FRAME:()=>li,U_MODEL:()=>ti,U_MODEL2:()=>hi,U_MODEL3:()=>yi,U_MODEL4:()=>bi,U_MOREBITS:()=>xi,U_NUMBER:()=>ei,U_ORIGIN1:()=>ri,U_ORIGIN2:()=>oi,U_ORIGIN3:()=>si,U_REMOVE:()=>gi,U_RENDERFX:()=>fi,U_SKIN:()=>ui,U_SOLID:()=>mi,U_SOUND:()=>ni});var ei=1,ti=2,ni=4,ri=8,oi=16,si=32,ii=64,ai=128,ci=256,li=512,ui=1024,di=2048,fi=4096,mi=8192,pi=16384,xi=32768,hi=1,yi=2,bi=4,gi=32768;var Ae=.025,Ot=33554432,je={None:0,Feet:1,Waist:2,Under:3},Ti=(t,e)=>{let n={...t.origin};n.z-=.25;let r=e(t.origin,n);return{...t,onGround:r.fraction<1}},Si=(t,e)=>{let n={...t.origin},{mins:r,maxs:o}=t;if(n.z=t.origin.z+r.z+1,!(e(n)&Ot))return{...t,waterLevel:je.None};let i=je.Feet,a=t.origin.z+(r.z+o.z)*.5;if(n.z=a,e(n)&Ot){i=je.Waist;let d=t.origin.z+22;n.z=d,e(n)&Ot&&(i=je.Under)}return{...t,waterLevel:i}},_i=(t,e,n,r)=>{let o={...t};o=Ti(o,n),o=Si(o,r);let{origin:s,velocity:i,onGround:a,waterLevel:l,viewAngles:d}=o,p=l>=2?d:{x:d.x>180?(d.x-360)/3:d.x/3,y:d.y,z:d.z},{forward:c,right:f}=re(p),x=We({velocity:i,frametime:Ae,onGround:a,groundIsSlick:!1,onLadder:!1,waterlevel:l,pmFriction:6,pmStopSpeed:100,pmWaterFriction:1}),u=l>=2?St({forward:c,right:f,cmd:e,maxSpeed:320}):Tt({forward:c,right:f,cmd:e,maxSpeed:320}),_=Y({velocity:x,wishdir:u.wishdir,wishspeed:u.wishspeed,accel:a||l>=2?10:1,frametime:Ae}),S=n(s,{x:s.x+_.x*Ae,y:s.y+_.y*Ae,z:s.z+_.z*Ae});return{...o,origin:S.endpos,velocity:_}};var Mt=class{constructor(e){e instanceof Uint8Array?this.view=new DataView(e.buffer,e.byteOffset,e.byteLength):this.view=new DataView(e),this.offset=0,this.length=this.view.byteLength}getPosition(){return this.offset}seek(e){if(e<0||e>this.length)throw new Error(`Seek out of bounds: ${e} (length: ${this.length})`);this.offset=e}hasMore(){return this.offset<this.length}readChar(){let e=this.view.getInt8(this.offset);return this.offset+=1,e}readByte(){let e=this.view.getUint8(this.offset);return this.offset+=1,e}readShort(){let e=this.view.getInt16(this.offset,!0);return this.offset+=2,e}readUShort(){let e=this.view.getUint16(this.offset,!0);return this.offset+=2,e}readLong(){let e=this.view.getInt32(this.offset,!0);return this.offset+=4,e}readULong(){let e=this.view.getUint32(this.offset,!0);return this.offset+=4,e}readFloat(){let e=this.view.getFloat32(this.offset,!0);return this.offset+=4,e}readString(){let e="";for(;this.offset<this.length;){let n=this.readChar();if(n===-1||n===0)break;e+=String.fromCharCode(n)}return e}readStringLine(){let e="";for(;this.offset<this.length;){let n=this.readChar();if(n===-1||n===0||n===10)break;e+=String.fromCharCode(n)}return e}readCoord(){return this.readShort()*(1/8)}readAngle(){return this.readChar()*(360/256)}readAngle16(){return this.readShort()*360/65536}readData(e){if(this.offset+e>this.length)throw new Error(`Read out of bounds: ${this.offset+e} (length: ${this.length})`);let n=new Uint8Array(this.view.buffer,this.view.byteOffset+this.offset,e);return this.offset+=e,new Uint8Array(n)}readPos(e){e.x=this.readCoord(),e.y=this.readCoord(),e.z=this.readCoord()}readDir(e){let n=this.readByte();if(n>=162){e.x=0,e.y=0,e.z=0;return}let r=j[n];e.x=r[0],e.y=r[1],e.z=r[2]}};var Ee=class{constructor(e=1400){typeof e=="number"?(this.buffer=new Uint8Array(e),this.fixed=!1):(this.buffer=e,this.fixed=!0),this.view=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),this.offset=0}ensureSpace(e){if(this.offset+e>this.buffer.byteLength){if(this.fixed)throw new Error(`Buffer overflow: capacity ${this.buffer.byteLength}, needed ${this.offset+e}`);let n=Math.max(this.buffer.byteLength*2,this.offset+e),r=new Uint8Array(n);r.set(this.buffer),this.buffer=r,this.view=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength)}}writeByte(e){this.ensureSpace(1),this.view.setUint8(this.offset,e),this.offset+=1}writeChar(e){this.ensureSpace(1),this.view.setInt8(this.offset,e),this.offset+=1}writeShort(e){this.ensureSpace(2),this.view.setInt16(this.offset,e,!0),this.offset+=2}writeLong(e){this.ensureSpace(4),this.view.setInt32(this.offset,e,!0),this.offset+=4}writeFloat(e){this.ensureSpace(4),this.view.setFloat32(this.offset,e,!0),this.offset+=4}writeString(e){let n=e.length;this.ensureSpace(n+1);for(let r=0;r<n;r++)this.view.setUint8(this.offset+r,e.charCodeAt(r));this.view.setUint8(this.offset+n,0),this.offset+=n+1}writeCoord(e){this.writeShort(Math.trunc(e*8))}writeAngle(e){this.writeByte(Math.trunc(e*256/360)&255)}writeAngle16(e){this.writeShort(Math.trunc(e*65536/360)&65535)}writePos(e){this.writeCoord(e.x),this.writeCoord(e.y),this.writeCoord(e.z)}writeDir(e){let n=-1,r=0;if(e.x===0&&e.y===0&&e.z===0){this.writeByte(0);return}for(let o=0;o<j.length;o++){let s=j[o],i=e.x*s[0]+e.y*s[1]+e.z*s[2];i>n&&(n=i,r=o)}this.writeByte(r)}getData(){return this.buffer.slice(0,this.offset)}getBuffer(){return this.buffer}getOffset(){return this.offset}reset(){this.offset=0}};var Pt=class{constructor(e=1024){this.buffer=new Uint8Array(e),this.view=new DataView(this.buffer.buffer),this.offset=0}ensureCapacity(e){if(this.offset+e>this.buffer.length){let n=Math.max(this.buffer.length*2,this.offset+e),r=new Uint8Array(n);r.set(this.buffer),this.buffer=r,this.view=new DataView(this.buffer.buffer)}}getData(){return this.buffer.slice(0,this.offset)}writeByte(e){this.ensureCapacity(1),this.view.setUint8(this.offset,e),this.offset+=1}writeChar(e){this.ensureCapacity(1),this.view.setInt8(this.offset,e),this.offset+=1}writeShort(e){this.ensureCapacity(2),this.view.setInt16(this.offset,e,!0),this.offset+=2}writeUShort(e){this.ensureCapacity(2),this.view.setUint16(this.offset,e,!0),this.offset+=2}writeLong(e){this.ensureCapacity(4),this.view.setInt32(this.offset,e,!0),this.offset+=4}writeFloat(e){this.ensureCapacity(4),this.view.setFloat32(this.offset,e,!0),this.offset+=4}writeString(e){let n=e.length+1;this.ensureCapacity(n);for(let r=0;r<e.length;r++)this.view.setUint8(this.offset+r,e.charCodeAt(r));this.view.setUint8(this.offset+e.length,0),this.offset+=n}writeData(e){this.ensureCapacity(e.length),this.buffer.set(e,this.offset),this.offset+=e.length}writeCoord(e){this.writeShort(Math.round(e*8))}writeAngle(e){this.writeByte(Math.round(e*256/360)&255)}writeAngle16(e){this.writeShort(Math.round(e*65536/360))}writeDir(e,n,r){let o=0,s=-999999,i=Math.sqrt(e*e+n*n+r*r);if(i>0){e/=i,n/=i,r/=i;for(let a=0;a<162;a++){let l=e*j[a][0]+n*j[a][1]+r*j[a][2];l>s&&(s=l,o=a)}}this.writeByte(o)}};var L=class L{constructor(){this.qport=0;this.incomingSequence=0;this.outgoingSequence=0;this.incomingAcknowledged=0;this.incomingReliableAcknowledged=!1;this.incomingReliableSequence=0;this.outgoingReliableSequence=0;this.reliableLength=0;this.fragmentSendOffset=0;this.fragmentBuffer=null;this.fragmentLength=0;this.fragmentReceived=0;this.lastReceived=0;this.lastSent=0;this.remoteAddress=null;this.reliableMessage=new Ee(L.MAX_RELIABLE_BUFFER);let e=Date.now();this.lastReceived=e,this.lastSent=e,this.qport=Math.floor(Math.random()*65536)}setup(e,n=null){this.qport=e,this.remoteAddress=n,this.reset()}reset(){this.incomingSequence=0,this.outgoingSequence=0,this.incomingAcknowledged=0,this.incomingReliableAcknowledged=!1,this.incomingReliableSequence=0,this.outgoingReliableSequence=0,this.reliableLength=0,this.reliableMessage.reset(),this.fragmentSendOffset=0,this.fragmentBuffer=null,this.fragmentLength=0,this.fragmentReceived=0,this.lastReceived=Date.now(),this.lastSent=Date.now()}transmit(e){this.outgoingSequence++,this.lastSent=Date.now();let n=0,r=!1,o=0;this.reliableLength>0&&(this.reliableLength>L.FRAGMENT_SIZE?(r=!0,this.fragmentSendOffset>=this.reliableLength&&(this.fragmentSendOffset=0),n=this.reliableLength-this.fragmentSendOffset,n>L.FRAGMENT_SIZE&&(n=L.FRAGMENT_SIZE),o=this.fragmentSendOffset,this.fragmentSendOffset+=n):n=this.reliableLength);let s=L.PACKET_HEADER,i=n>0?2+(r?8:0):0,a=e?e.length:0;s+i+n+a>L.MAX_MSGLEN&&(a=L.MAX_MSGLEN-s-i-n,a<0&&(a=0));let l=new ArrayBuffer(s+i+n+a),d=new DataView(l),p=new Uint8Array(l),c=this.outgoingSequence;n>0&&(c|=2147483648,(this.outgoingReliableSequence&1)!==0&&(c|=1073741824)),d.setUint32(0,c,!0);let f=this.incomingSequence;(this.incomingReliableSequence&1)!==0&&(f|=2147483648),d.setUint32(4,f,!0),d.setUint16(8,this.qport,!0);let x=s;if(n>0){let u=n;r&&(u|=32768),d.setUint16(x,u,!0),x+=2,r&&(d.setUint32(x,o,!0),x+=4,d.setUint32(x,this.reliableLength,!0),x+=4);let S=this.reliableMessage.getBuffer().subarray(o,o+n);p.set(S,x),x+=n}if(e&&a>0){let u=e.slice(0,a);p.set(u,x)}return p}process(e){if(e.length<L.PACKET_HEADER)return null;this.lastReceived=Date.now();let n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=n.getUint32(0,!0),o=n.getUint32(4,!0),s=n.getUint16(8,!0);if(this.qport!==s)return null;let i=r&1073741823;if((i-this.incomingSequence|0)<=0)return null;this.incomingSequence=i;let a=o&2147483647,l=(o&2147483648)!==0;if(a>this.incomingAcknowledged&&(this.incomingAcknowledged=a),this.reliableLength>0){let u=l?1:0,_=this.outgoingReliableSequence&1;u!==_&&(this.reliableLength=0,this.reliableMessage.reset(),this.outgoingReliableSequence^=1,this.fragmentSendOffset=0)}let d=(r&2147483648)!==0,p=(r&1073741824)!==0?1:0,c=L.PACKET_HEADER,f=null;if(d){if(c+2>e.byteLength)return null;let u=n.getUint16(c,!0);c+=2;let _=(u&32768)!==0;u&=32767;let S=this.incomingReliableSequence&1;if(p===S)if(_){if(c+8>e.byteLength)return null;let A=n.getUint32(c,!0);c+=4;let E=n.getUint32(c,!0);if(c+=4,E>L.MAX_RELIABLE_BUFFER)return console.warn(`NetChan: received invalid fragment total ${E} > ${L.MAX_RELIABLE_BUFFER}`),null;if((!this.fragmentBuffer||this.fragmentBuffer.length!==E)&&(this.fragmentBuffer=new Uint8Array(E),this.fragmentLength=E,this.fragmentReceived=0),c+u>e.byteLength)return null;let b=e.subarray(c,c+u);A===this.fragmentReceived&&A+u<=E&&(this.fragmentBuffer.set(b,A),this.fragmentReceived+=u,this.fragmentReceived>=E&&(f=this.fragmentBuffer,this.incomingReliableSequence++,this.fragmentBuffer=null,this.fragmentLength=0,this.fragmentReceived=0))}else{if(this.incomingReliableSequence++,c+u>e.byteLength)return null;f=e.slice(c,c+u)}c+=u}let x=e.slice(c);if(f&&f.length>0){let u=f.length+x.length,_=new Uint8Array(u);return _.set(f,0),_.set(x,f.length),_}return x||new Uint8Array(0)}canSendReliable(){return this.reliableLength===0}writeReliableByte(e){if(this.reliableLength+1>L.MAX_RELIABLE_BUFFER)throw new Error("NetChan reliable buffer overflow");this.reliableMessage.writeByte(e),this.reliableLength++}writeReliableShort(e){if(this.reliableLength+2>L.MAX_RELIABLE_BUFFER)throw new Error("NetChan reliable buffer overflow");this.reliableMessage.writeShort(e),this.reliableLength+=2}writeReliableLong(e){if(this.reliableLength+4>L.MAX_RELIABLE_BUFFER)throw new Error("NetChan reliable buffer overflow");this.reliableMessage.writeLong(e),this.reliableLength+=4}writeReliableString(e){let n=e.length+1;if(this.reliableLength+n>L.MAX_RELIABLE_BUFFER)throw new Error("NetChan reliable buffer overflow");this.reliableMessage.writeString(e),this.reliableLength+=n}getReliableData(){return this.reliableLength===0?new Uint8Array(0):this.reliableMessage.getBuffer().subarray(0,this.reliableLength)}needsKeepalive(e){return e-this.lastSent>1e3}isTimedOut(e,n=3e4){return e-this.lastReceived>n}};L.MAX_MSGLEN=1400,L.FRAGMENT_SIZE=1024,L.PACKET_HEADER=10,L.HEADER_OVERHEAD=L.PACKET_HEADER+2,L.MAX_RELIABLE_BUFFER=262144;var wt=L;var Cn=(T=>(T.Blaster="blaster",T.Shotgun="shotgun",T.SuperShotgun="supershotgun",T.Machinegun="machinegun",T.Chaingun="chaingun",T.HandGrenade="grenades",T.GrenadeLauncher="grenadelauncher",T.RocketLauncher="rocketlauncher",T.HyperBlaster="hyperblaster",T.Railgun="railgun",T.BFG10K="bfg10k",T.Grapple="grapple",T.ChainFist="chainfist",T.EtfRifle="etf_rifle",T.ProxLauncher="prox_launcher",T.IonRipper="ionripper",T.PlasmaBeam="plasmabeam",T.Phalanx="phalanx",T.Disruptor="disruptor",T.Trap="trap",T))(Cn||{});var Lt=(u=>(u[u.Bullets=0]="Bullets",u[u.Shells=1]="Shells",u[u.Rockets=2]="Rockets",u[u.Grenades=3]="Grenades",u[u.Cells=4]="Cells",u[u.Slugs=5]="Slugs",u[u.MagSlugs=6]="MagSlugs",u[u.Trap=7]="Trap",u[u.Flechettes=8]="Flechettes",u[u.Tesla=9]="Tesla",u[u.Disruptor=10]="Disruptor",u[u.Prox=11]="Prox",u[u.Nuke=12]="Nuke",u[u.Rounds=13]="Rounds",u))(Lt||{}),Ai=Object.keys(Lt).length/2,Rn=(f=>(f.Shells="ammo_shells",f.Bullets="ammo_bullets",f.Rockets="ammo_rockets",f.Grenades="ammo_grenades",f.Cells="ammo_cells",f.Slugs="ammo_slugs",f.MagSlugs="ammo_magslug",f.Flechettes="ammo_flechettes",f.Disruptor="ammo_disruptor",f.Tesla="ammo_tesla",f.Trap="ammo_trap",f.Prox="ammo_prox",f))(Rn||{});var Ei=["blaster","shotgun","supershotgun","machinegun","chaingun","grenadelauncher","rocketlauncher","grenades","hyperblaster","railgun","bfg10k"],vi={blaster:null,shotgun:1,supershotgun:1,machinegun:0,chaingun:0,grenades:3,grenadelauncher:3,rocketlauncher:2,hyperblaster:4,railgun:5,bfg10k:4,grapple:null,chainfist:null,etf_rifle:8,prox_launcher:11,ionripper:4,plasmabeam:4,phalanx:6,disruptor:10,trap:7};var ml=32,On=(c=>(c[c.Auto=0]="Auto",c[c.Weapon=1]="Weapon",c[c.Voice=2]="Voice",c[c.Item=3]="Item",c[c.Body=4]="Body",c[c.Aux=5]="Aux",c[c.Footstep=6]="Footstep",c[c.Aux3=7]="Aux3",c[c.NoPhsAdd=8]="NoPhsAdd",c[c.Reliable=16]="Reliable",c[c.ForcePos=32]="ForcePos",c))(On||{}),pl=-1,xl=0,hl=1,yl=2,bl=3,gl=80,Tl=.003;function Mn(t){return t===3?t*.001:t*5e-4}function Vi(t){let e=Mn(t);return e<=0?Number.POSITIVE_INFINITY:80+1/e}return Dn(Ni);})();
|
|
2
2
|
//# sourceMappingURL=index.global.js.map
|