diff --git a/dist/room-bundle.js b/dist/room-bundle.js index 65316c7..0d09b8d 100644 --- a/dist/room-bundle.js +++ b/dist/room-bundle.js @@ -1 +1 @@ -(()=>{"use strict";var e={9e3:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=a(2781);t.default=class{constructor(e,t,a){this.type=e,this.player=(0,n.flattenPlayer)(t),this.playerPosition=a}}},9980:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5693)),s=n(a(4999)),r=a(2665);t.default=class{constructor(e,t){this.content=e.trim(),this.author=t,this.createdAt=new Date}_splitContentByWhiteSpaceAndToLower(){return this.content.toLowerCase().split(/\s+/)}isOffensive(){return(0,r.containsNWord)(this.content)}isGameCommand(){return s.default.has(this.content.toLowerCase())}startsWithCommandPrefix(){return this.content.startsWith(i.default.PREFIX.COMMAND)}startsWithTeamChatPrefix(){const[e=null]=this._splitContentByWhiteSpaceAndToLower();return e===i.default.PREFIX.TEAMCHAT}reply(e,t={}){var a;t.color=13429652,t.id=null===(a=this.author)||void 0===a?void 0:a.id,i.default.send(e,t)}replyError(e,t={}){var a;t.id=null===(a=this.author)||void 0===a?void 0:a.id,i.default.sendError(e,t)}replySuccess(e,t={}){var a;t.id=null===(a=this.author)||void 0===a?void 0:a.id,i.default.sendSuccess(e,t)}announce(e,t={}){i.default.sendAnnouncement(e,t)}}},5382:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5693)),s=n(a(9980));class r extends s.default{constructor(e,t){super(e,t);const{cmdName:a,cmdParamsArray:n,cmdParamsStr:i}=this._extractCommandNameAndParams();this.commandParamsArray=n,this.commandParamsStr=i,this.commandName=a,this.commandParamsLength=n.length}hasNoParams(){return 0===this.commandParamsLength}_extractCommandNameAndParams(){const e=this._splitContentByWhiteSpaceAndToLower(),[t,...a]=e,n=t.substring(i.default.PREFIX.COMMAND.length),s=a.join(" ");return{cmdName:n,cmdParamsArray:a,cmdParamsStr:s}}}t.default=r},9072:function(e,t,a){var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var i=Object.getOwnPropertyDescriptor(t,a);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,i)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return i(t,e),t},r=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function o(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}l((n=n.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(a(5693)),d=o(a(9972)),u=s(a(5697)),c=o(a(4198)),f=a(4798),h=a(2665),m=o(a(5961)),y=o(a(8375)),g=a(2781),P=o(a(5198)),p=o(a(1858));class _{constructor(){this._los={x:0,y:0},this._currentDown=1,this._yardsToGet=_.CONFIG.DEFAULT_YARDS_TO_GET,this._redZonePenalties=0,this._MAX_REZONE_PENALTIES=3}getLOS(){return this._los}setLOS(e){return this._los.x=e,this}getLOSYard(){return u.DistanceConverter.toYardLine(this._los.x)}getYardsToGet(){return this._yardsToGet}setYardsToGet(e){return this._yardsToGet=e,this}subtractYardsToGet(e){return this._yardsToGet-=e,this}getDown(){return this._currentDown}setDown(e){return this._currentDown=e,this}addDown(){return this._currentDown++,this}startNew(){this._currentDown=1,this._yardsToGet=_.CONFIG.DEFAULT_YARDS_TO_GET,this._redZonePenalties=0}getSnapPosition(){return{x:(new u.default).subtractByTeam(this._los.x,5*f.MAP_POINTS.YARD,p.default.game.offenseTeamId).calculate(),y:0}}incrementRedZonePenalties(){this._redZonePenalties++}hasReachedMaxRedzonePenalties(){return this._redZonePenalties===this._MAX_REZONE_PENALTIES}getDownAndDistanceString(){const e=c.default.formatDown(this._currentDown),t=this._getLineToGainPoint(),a=c.default.formatYardsToGain(t,this._yardsToGet),n=c.default.formatRedZonePenalties(this._redZonePenalties);return`${e} & ${a} at ${c.default.formatPositionToMapHalf(this._los.x)}${this.getLOSYard()}${n}`}sendDownAndDistance(){const e=this.getDownAndDistanceString();l.default.send(e,{sound:0})}setTightEndPosition(e,t){P.default.setPlayerDiscProperties(e,t),p.default.game.moveTightEndDiscs(t)}setPlayers(){function e(e){const t=(0,h.getRandomIntInRange)(f.MAP_POINTS.TOP_HASH,f.MAP_POINTS.BOT_HASH),a={x:(new u.default).subtractByTeam(this.getLOS().x,10*f.MAP_POINTS.YARD,e.team).calculate(),y:t,xspeed:0,yspeed:0};if(p.default.game.checkIfPlayerIsTightEnd(e.id))return this.setTightEndPosition(e.id,a);P.default.setPlayerDiscProperties(e.id,a)}p.default.game.players.getFielded().forEach((t=>{if(!p.default.game.players.playerPositionsMap.has(t.id))return e.bind(this,t)();const{position:a}=p.default.game.players.playerPositionsMap.get(t.id),n={x:(new u.default).subtractByTeam(this.getLOS().x,7*f.MAP_POINTS.YARD,t.team).calculate(),y:a.y,xspeed:0,yspeed:0};if(p.default.game.checkIfPlayerIsTightEnd(t.id))return this.setTightEndPosition(t.id,n);P.default.setPlayerDiscProperties(t.id,n)}))}setBallAndFieldMarkersPlayEnd(){this.moveFieldMarkers();const e=this.getSnapPosition();d.default.setPosition(e),d.default.suppress()}hardSetPlayers(){p.default.game.players.getFielded().forEach((e=>{const t=(new u.default).subtractByTeam(this.getLOS().x,7*f.MAP_POINTS.YARD,e.team).calculate();if(p.default.game.checkIfPlayerIsTightEnd(e.id)){const a=P.default.getPlayerDiscProperties(e.id);return this.setTightEndPosition(e.id,{x:t,y:a.y})}P.default.setPlayerDiscProperties(e.id,{x:t,xspeed:0,yspeed:0})}))}hardReset(){var e;null===(e=p.default.game.play)||void 0===e||e.terminatePlayDuringError(),p.default.game.setTightEnd(null),this.sendDownAndDistance(),this.setPlayers(),p.default.game.endPlay(),this.setBallAndFieldMarkersPlayEnd(),p.default.game.startSnapDelay()}setPreviousDownAsCurrentDown(){this.previousDown={down:this._currentDown,yardsToGet:this._yardsToGet,losX:this._los.x}}resetAfterDown(){return r(this,void 0,void 0,(function*(){this.sendDownAndDistance(),p.default.game.endPlay(),yield(0,h.sleep)(500),this.setBallAndFieldMarkersPlayEnd(),p.default.game.startSnapDelay(),this.setPlayers(),this._setPuntIfFourthAndLong()}))}resetAfterScore(){p.default.game.endPlay()}moveFieldMarkers(e={}){return this._moveLOSMarkers(),this._moveLineToGainMarkers(e),this}maybeMovePlayerBehindLosOnField(e){if(p.default.game.play)return;const t={x:(new u.default).subtractByTeam(this.getLOS().x,15*f.MAP_POINTS.YARD,e.team).calculate(),xspeed:0,yspeed:0};P.default.setPlayerDiscProperties(e.id,t)}_setPuntIfFourthAndLong(){return r(this,void 0,void 0,(function*(){if(4!==this.getDown())return;if(y.default.getMapHalfFromPoint(this._los.x)!==p.default.game.offenseTeamId)return;if(p.default.game.getTimeRounded()>360)return;if(this.getYardsToGet()<15)return;(0,g.quickPause)(),yield(0,h.sleep)(100),l.default.send("⚠️ Automatic punt! 4th & LONG");const e=p.default.game.players.getOffense(),t=()=>{const t=e[0];return p.default.game.setPlay(new m.default(p.default.game.getTimeRounded(),t),t)},a=e.map((e=>{if(!p.default.game.players.playerPositionsMap.has(e.id))return null;const{position:t}=p.default.game.players.playerPositionsMap.get(e.id);return t})).filter((e=>null!==e));if(0===a.length)return t();const{index:n}=y.default.getClosestPositionToOtherPosition(a,this.getSnapPosition());if(-1===n)return t();const i=e[n];p.default.game.setPlay(new m.default(p.default.game.getTimeRounded(),i),i)}))}_moveLOSMarkers(){P.default.setDiscProperties(f.DISC_IDS.LOS_TOP,{x:this._los.x}),P.default.setDiscProperties(f.DISC_IDS.LOS_BOT,{x:this._los.x})}_moveLineToGainMarkers(e={}){const t=this._getLineToGainPoint(),a=!e.hideLineToGain&&!(t<=f.MAP_POINTS.RED_GOAL_LINE||t>=f.MAP_POINTS.BLUE_GOAL_LINE)&&(p.default.game.play,1)?t:f.MAP_POINTS.HIDDEN;P.default.setDiscProperties(f.DISC_IDS.LTG_TOP,{x:a,y:f.MAP_POINTS.TOP_SIDELINE}),P.default.setDiscProperties(f.DISC_IDS.LTG_BOT,{x:a,y:f.MAP_POINTS.BOT_SIDELINE})}_getLineToGainPoint(){return(new u.default).addByTeam(this._los.x,f.MAP_POINTS.YARD*this._yardsToGet,p.default.game.offenseTeamId).calculate()}}t.default=_,_.CONFIG={DEFAULT_YARDS_TO_GET:20}},4131:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5198)),s=n(a(5693)),r=n(a(1858)),o=n(a(3445)),l=n(a(3217)),d=a(2781),u=n(a(4340)),c=a(3279),f=n(a(9072)),h=n(a(5072)),m=a(4798);class y extends h.default{constructor(){super(),this.score={red:0,blue:0},this.redTeamName="Red",this.blueTeamName="Blue",this.offenseTeamId=1,this.timeOuts=[],this.play=null,this.down=new f.default,this.players=new o.default,this.stats=new l.default,this._canStartSnapPlay=!0,this._isPaused=!1,this._tightEndId=null,this._isActive=!0,this.updateStaticPlayers()}setIsPaused(e){this._isPaused=e}get isPaused(){return this._isPaused}get isActive(){return this._isActive}getTightEnd(){return this._tightEndId}setTightEnd(e){const t=this._tightEndId;if(this._tightEndId=e,null===e)return this._resetPlayersPhysics(t),void this.moveTightEndDiscs({x:m.MAP_POINTS.HIDDEN,y:0});this._tightEndId=e,this._setTightEndPhysicsAndDiscs(e)}updateStaticPlayers(){this.players.updateStaticPlayerList(this.offenseTeamId)}get defenseTeamId(){return 1===this.offenseTeamId?2:1}get canStartSnapPlay(){return this._canStartSnapPlay}setOffenseTeam(e){this.offenseTeamId=e}swapOffenseAndUpdatePlayers(){1===this.offenseTeamId?this.setOffenseTeam(2):this.setOffenseTeam(1),this.setTightEnd(null),this.players.updateStaticPlayerList(this.offenseTeamId)}addTeamTimeOut(e){this.timeOuts.push({time:this.getTimeRounded(),team:e})}startSnapDelay(){this._canStartSnapPlay=!1,this._isPaused?setTimeout((()=>{this._canStartSnapPlay=!0}),4e3):setTimeout((()=>{this._canStartSnapPlay=!0}),2e3)}setPlay(e,t){null==e||e.validateBeforePlayBegins(t),this.play=e,this.play.prepare(),this.clearState(),r.default.game.down.setPreviousDownAsCurrentDown(),this.play.run()}endPlay(){var e;null===(e=this.play)||void 0===e||e.cleanUp(),this._resetAllPlayersPhysics(),this.play=null}endGame(){this._isActive=!1;const e=this.stats.getMVP();e&&this.sendManOfTheMatch(e.recordId,e.pointTotal)}setScore(e,t){return e===c.TEAMS.RED?this.score.red=t:this.score.blue=t,this}addScore(e,t){return e===c.TEAMS.RED?this.score.red+=t:this.score.blue+=t,this}getTime(){var e,t;return null!==(t=null===(e=i.default.getScores())||void 0===e?void 0:e.time)&&void 0!==t?t:0}getTimeRounded(){return Math.round(this.getTime())}getClock(){const e=this.getTime();return(0,d.toClock)(e)}getScoreBoardStr(){return`${u.default.RedSquare} ${this.score.red} - ${this.score.blue} ${u.default.BlueSquare}`}sendScoreBoard(){s.default.send(this.getScoreBoardStr())}sendManOfTheMatch(e,t){const a=this.players.records.get(e);a&&s.default.send(`${u.default.Star} MVP: ${a.name} | ${t} points`)}_resetPlayersPhysics(e){this.checkIfPlayerIsTightEnd(e)||i.default.setPlayerDiscProperties(e,{bCoeff:.75,invMass:.8,radius:m.MAP_POINTS.PLAYER_RADIUS})}_resetAllPlayersPhysics(){r.default.players.getFielded().forEach((e=>{this._resetPlayersPhysics(e.id),i.default.setPlayerAvatar(e.id,null)}))}_setTightEndPhysicsAndDiscs(e){i.default.setPlayerDiscProperties(e,{radius:m.MAP_POINTS.TE_PLAYER_RADIUS,invMass:.35});const{position:t}=(0,d.getPlayerDiscProperties)(e);this.moveTightEndDiscs(t)}checkIfPlayerIsTightEnd(e){return this._tightEndId===e}moveTightEndDiscs(e){m.DISC_IDS.TE.forEach(((t,a)=>0===a?i.default.setDiscProperties(t,e):1===a?i.default.setDiscProperties(t,{x:e.x,y:e.y+13}):2===a?i.default.setDiscProperties(t,{x:e.x-13,y:e.y}):3===a?i.default.setDiscProperties(t,{x:e.x,y:e.y-13}):4===a?i.default.setDiscProperties(t,{x:e.x+13,y:e.y}):void 0))}checkIfTightEndSwitchedTeamsOrLeft(e){e===this._tightEndId&&this.setTightEnd(null)}}t.default=y},1842:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5198)),s=a(7701),r=n(a(1858)),o=a(2665);t.default=class{constructor({name:e,id:t,auth:a,conn:n}){this.isAFK=!1,this.canPlay=!0,this.name=e.trim(),this.id=t,this.auth=s.DEBUG_MODE?(0,o.getRandomChars)(6):a,this._adminLevel=0,this.ip=s.DEBUG_MODE?(0,o.getRandomChars)(6):n}setCanPlay(e){this.canPlay=e}get team(){const e=i.default.getPlayer(this.id);return e?e.team:null}get position(){const e=i.default.getPlayer(this.id);return e?e.position:null}get adminLevel(){const e=this._adminLevel;return 0===e?this.isAdmin?1:0:e}get playerObject(){return i.default.getPlayer(this.id)}get lowerName(){return this.name.toLowerCase()}get shortName(){return(0,o.truncateName)(this.name)}get isMuted(){return r.default.players.muted.mutedCollection.has(this.auth)}get isAdmin(){const e=i.default.getPlayer(this.id);return!!e&&e.admin}setAdmin(e){return i.default.setPlayerAdmin(this.id,e),this}setAdminLevel(e){return this._adminLevel=e,this}setTeam(e){i.default.getPlayer(this.id)&&i.default.setPlayerTeam(this.id,e)}canModerate(e){return this.adminLevel>e.adminLevel}setAFK(e){this.isAFK=e}}},1252:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=a(2781);t.default=class{constructor(e,t,a,i,s){this.player=(0,n.flattenPlayer)(e),this.playerPosition=t,this.playerSpeed=a,this.ballCarrierPosition=i,this.ballCarrierSpeed=s}}},5145:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_MAP_SECTION_STAT=void 0;const i=n(a(4340)),s=a(2665);class r{constructor(){this.cornerTop=0,this.cornerBottom=0,this.middle=0,this.deep=0,this.backwards=0}get all(){return(0,s.sumObjectValues)(this)}}t.EMPTY_MAP_SECTION_STAT=r,t.default=class{constructor(e){this.receptions=new r,this.receivingYards=new r,this.receivingYardsAfterCatch=new r,this.rushingAttempts=0,this.rushingYards=0,this.touchdownsReceived=0,this.touchdownsRushed=0,this.passAttempts=new r,this.passCompletions=new r,this.passYards=new r,this.passYardsDistance=new r,this.touchdownsThrown=0,this.interceptionsThrown=0,this.qbSacks=0,this.distanceMovedBeforePassArr=[],this.timeToPassArr=[],this.curvedPassAttempts=0,this.curvedPassCompletions=0,this.passDeflections=new r,this.tackles=0,this.yardsAllowed=new r,this.sacks=0,this.forcedFumbles=0,this.interceptionsReceived=0,this.specReceptions=0,this.specReceivingYards=0,this.specTouchdowns=0,this.specTackles=0,this.fgAttempts=0,this.fgYardsAttempted=0,this.fgMade=0,this.fgYardsMade=0,this.timePlayed=0,this.fumbles=0,this.penalties=0,this.onsideKicksAttempted=0,this.onsideKicksConverted=0,this.recordId=e}get distanceMovedBeforePass(){return(0,s.averageOfArray)(this.distanceMovedBeforePassArr)}get timeToPass(){return(0,s.averageOfArray)(this.timeToPassArr)}_calculatePasserRating(){if(0===this.passAttempts.all)return 0;const e=(0,s.limitNumberWithinRange)(5*(this.passCompletions.all/this.passAttempts.all-.3),0,2.375),t=(0,s.limitNumberWithinRange)(.25*(this.passYards.all/this.passAttempts.all-3),0,2.375),a=(0,s.limitNumberWithinRange)(this.touchdownsThrown/this.passAttempts.all*20,0,2.375),n=(0,s.limitNumberWithinRange)(2.375-this.interceptionsThrown/this.passAttempts.all*25,0,2.375);return(0,s.round)((e+t+a+n)/6*100,2)}updateStats(e){Object.entries(e).forEach((e=>{const[t,a]=e,n=(0,s.isObject)(a),i=Array.isArray(a);n?Object.entries(a).forEach((e=>{const[a,n]=e;this[`${t}`][a]+=n})):i?this[`${t}`].push(a[0]):this[`${t}`]+=a}))}getStatsStringNormal(){return`Receiving | Rec: ${this.receptions.all} ${i.default.SmallBlackSquare} Yds: ${this.receivingYards.all} ${i.default.SmallBlackSquare} Yac: ${this.receivingYardsAfterCatch.all} ${i.default.SmallBlackSquare} Ratt: ${this.rushingAttempts} ${i.default.SmallBlackSquare} Ruyd: ${this.rushingYards} | TD: ${this.touchdownsReceived} ${i.default.SmallBlackSquare} RuTD: ${this.touchdownsRushed}\nPassing | Cmp/Att: ${this.passCompletions.all}/${this.passAttempts.all} ${i.default.SmallBlackSquare} Pyds: ${this.passYards.all} | TD: ${this.touchdownsThrown} ${i.default.SmallBlackSquare} Ints: ${this.interceptionsThrown} ${i.default.SmallBlackSquare} Rating: ${this._calculatePasserRating()}\nDefense | PD: ${this.passDeflections.all} ${i.default.SmallBlackSquare} Tak: ${this.tackles} ${i.default.SmallBlackSquare} Sak: ${this.sacks} ${i.default.SmallBlackSquare} Ints: ${this.interceptionsReceived} ${i.default.SmallBlackSquare} YdsAllowed: ${this.yardsAllowed.all}`}}},5072:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=a(7701),s=n(a(5693));t.default=class{constructor(){this._stateStore={}}setState(e,t=!0){this._stateStore[e]=t,i.DEBUG_MODE&&s.default.send(`StateChange: ${String(e)}`,{color:16772956})}getState(e){if(void 0===this._stateStore[e])throw Error(`State: ${String(e)} was not found using the getState method. Only use getState when the state is defined, use stateExists to check if a state exists `);return this._stateStore[e]}deleteState(e){i.DEBUG_MODE&&s.default.send(`State delete: ${String(e)}`,{color:16772956}),delete this._stateStore[e]}stateExists(e){return this._stateStore.hasOwnProperty(e)}stateExistsUnsafe(e){return this._stateStore.hasOwnProperty(e)}clearState(){this._stateStore={}}readAllState(){return this._stateStore}}},7202:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CommandError=void 0;const i=n(a(5693)),s=n(a(1858)),r=a(2665),o=a(8577);class l{constructor(e){this.errorMsg=e}}t.CommandError=l,t.default=class{constructor(e){this.commandMsg=e}static getPlayerByNameAlways(e){return s.default.players.getByName(e)}loadCommand(){const e=(0,o.getCommandByNameOrAlias)(this.commandMsg.commandName);return e?(this.command=e,!0):(this.command=null,!1)}_validateCommandPermissions(){var e,t;const{name:a,permissions:{level:n,muted:r,game:o,notDuringPlay:d}}=this.command;if(n>this.commandMsg.author.adminLevel){if(1===n)throw new l(`Command ${a} requires admin to use`);throw new l(`Command ${a} requires a higher admin level to use`)}if(!r&&this.commandMsg.author.isMuted||r&&i.default.silenced)throw new l(`You cannot use command ${a} while muted`);if(o&&(null===s.default.game||!1===(null===(e=s.default.game)||void 0===e?void 0:e.isActive)))throw new l(`Command ${a} requires a game to be in session`);if(d&&(null===(t=null===s.default||void 0===s.default?void 0:s.default.game)||void 0===t?void 0:t.play))throw new l(`Command ${a} cannot be run during a play`);return this}_checkPlayerParamType(){const e=s.default.players.getByName(this.commandMsg.commandParamsStr);if(console.log("CHECK PLAYER",e),null===e)throw new l(`Player ${this.commandMsg.commandParamsStr} does not exist in the room`);if(-1===e)throw new l(`Multiple players were found starting with the name ${this.commandMsg.commandParamsStr} in the room`)}_checkArrayParamTypes(e,t,a){const n=e.includes(t),i=e.join(" ");if(!n)throw new l(`The ${(0,r.toOrdinalSuffix)(a+1)} option to command ${this.command.name} must be one of the following: ${i}`)}_checkNumberParamType(e,t){const a=parseInt(e),n=!1===isNaN(a);if(console.log(n),!n)throw new l(`The ${(0,r.toOrdinalSuffix)(t+1)} option to command ${this.command.name} must be a number`)}_validateCommandParams(){const{name:e,params:{min:t,max:a,types:n,skipMaxCheck:i=!1}}=this.command,s=(0,r.plural)(t,"option","options"),d=(0,r.plural)(a,"option","options");if(this.commandMsg.commandParamsArray.lengtha&&!1===i){if(0===a)throw new l(`Command ${e} does not accept any options.`);if(!i)throw new l(`Command ${e} accepts only ${d}.`)}return 0===n.length||0===this.commandMsg.commandParamsArray.length||this.commandMsg.commandParamsArray.forEach(((e,t)=>{const a=this.command.params.types[t];if(a!==o.COMMAND_PARAM_TYPES.CUSTOM)return Array.isArray(a)?this._checkArrayParamTypes(a,e,t):a===o.COMMAND_PARAM_TYPES.PLAYER?this._checkPlayerParamType():a===o.COMMAND_PARAM_TYPES.NUMBER?this._checkNumberParamType(e,t):void 0})),this}validateAndRun(){this._validateCommandPermissions(),this._validateCommandParams(),this.command.run(this.commandMsg).catch((e=>{if(e instanceof l){const t=e;this.commandMsg.replyError(t.errorMsg)}else console.log(e),i.default.sendBotError(e.message)}))}}},8577:function(e,t,a){var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var i=Object.getOwnPropertyDescriptor(t,a);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,i)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return i(t,e),t},r=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function o(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}l((n=n.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getCommandByNameOrAlias=t.getCommandsAccessibleToPlayer=t.COMMAND_PARAM_TYPES=void 0;const l=o(a(5693)),d=o(a(9972)),u=o(a(4064)),c=o(a(3517)),f=a(2781),h=o(a(4340)),m=a(2665),y=s(a(7202)),g=o(a(1858)),P=a(3279),p=o(a(5198));function _(e){return v.find().filter((t=>t.permissions.level<=e.adminLevel))}function S(e){var t,a;const n=null!==(t=v.get(e))&&void 0!==t?t:null,i=v.findOne({alias:[e]});return null!==(a=null!=n?n:i)&&void 0!==a?a:null}t.COMMAND_PARAM_TYPES={PLAYER:"Player name or ID",PLAYER_OR_USER:"Player or user,",NUMBER:"Number",CUSTOM:"Custom"},t.getCommandsAccessibleToPlayer=_,t.getCommandByNameOrAlias=S;const v=new c.default([["help",{name:"help",alias:[],description:"Returns the list of room commands or returns the description of a given command",usage:["help [commandName]"],showCommand:!1,permissions:{level:0,muted:!0,game:!1,notDuringPlay:!1},params:{min:0,max:1,types:[t.COMMAND_PARAM_TYPES.CUSTOM]},run(e){return r(this,void 0,void 0,(function*(){if(e.hasNoParams()){const t=_(e.author).map((e=>e.name)).join(", ");return void e.reply(`Commands: ${t}`)}const t=S(e.commandParamsStr);if(!t)throw new y.CommandError(`Command (${e.commandParamsStr}) does not exist`);const a=0===t.usage.length?`${t.name}`:t.usage.join(`, ${l.default.PREFIX.COMMAND}`),n=0===t.alias.length?"":` [${t.alias.join(", ")}] `;e.reply(`${t.name}${n}: ${t.description} | ${l.default.PREFIX.COMMAND}${a}`)}))}}],["commands",{name:"commands",alias:["cmds"],description:"Returns the list of room commands",usage:[],showCommand:!1,permissions:{level:0,muted:!0,game:!1,notDuringPlay:!1},params:{min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){const t=_(e.author).map((e=>e.name)).join(", ");e.reply(`Commands: ${t}`)}))}}],["info",{name:"info",alias:[],description:"Returns helpful command info",usage:[],showCommand:!1,permissions:{level:0,muted:!0,game:!1,notDuringPlay:!1},params:{min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){e.reply(`setfg | Attempt a Field Goal ${h.default.SmallBlackSquare} sette | Sets you as the tight end ${h.default.SmallBlackSquare} setonside | Attempt an onside kick ${h.default.SmallBlackSquare}\nto | Calls a timeout ${h.default.SmallBlackSquare} cp | Curved pass ${h.default.SmallBlackSquare} set2 | Attempt a two point conversion\n!setlos (yard) | Sets the line of scrimmage position\n!setdown (down) (yard) | Sets the down and distance \n!setscore (team) (score) | Sets the score of a team\n!setplayers | Sets the players in front of ball\n!dd | Returns the down and distance \n!swapo | Swaps offense and defense`)}))}}],["discord",{name:"discord",alias:[],description:"Returns the discord server link",usage:[],showCommand:!1,permissions:{level:0,muted:!0,game:!1,notDuringPlay:!1},params:{min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){e.reply("Discord: discord.gg/VdrD2p7")}))}}],["rules",{name:"rules",alias:[],description:"Returns the rules of the game",usage:[],showCommand:!1,permissions:{level:0,muted:!0,game:!1,notDuringPlay:!1},params:{min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){e.reply(`Rules of the game\n${h.default.SmallBlackSquare} Offense | One player is a passer, while the rest of the team runs to get open for a catch. Catch the ball by touching it after a pass and run to the opposing team's goal.\n${h.default.SmallBlackSquare} Defense | Guard the receivers and prevent them from catching the ball. Defense has to be behind the blue line at all times.`)}))}}],["cre",{name:"cre",alias:[],description:"Explains crowding",usage:[],showCommand:!1,permissions:{level:1,muted:!0,game:!1,notDuringPlay:!1},params:{min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){e.announce("You cannot stand in front of the blue line for more than 3 seconds without an offensive player being present.")}))}}],["stats",{name:"stats",alias:[],description:"Returns your stats or the stats of another player",usage:["stats","stats tda"],showCommand:!1,permissions:{level:0,muted:!0,game:!1,notDuringPlay:!1},params:{skipMaxCheck:!0,min:0,max:1,types:[t.COMMAND_PARAM_TYPES.PLAYER]},run(e){var t,a;return r(this,void 0,void 0,(function*(){if(null===g.default.game)throw new y.CommandError("No game in progress");if(e.hasNoParams()){const a=g.default.game.players.records.get(e.author.id),n=g.default.game.stats.statsCollection.get(null!==(t=null==a?void 0:a.recordId)&&void 0!==t?t:0);if(!a||!n)throw new y.CommandError("You do not have any stats yet");const i=n.getStatsStringNormal();return void e.reply(`${i}`,{autoSize:!1})}const n=y.default.getPlayerByNameAlways(e.commandParamsStr),i=g.default.game.players.records.get(n.id),s=g.default.game.stats.statsCollection.get(null!==(a=null==i?void 0:i.recordId)&&void 0!==a?a:0);if(!s||!i)throw new y.CommandError(`Player ${n.shortName} does not have any stats yet`);const r=s.getStatsStringNormal();e.reply(`Stats ${n.shortName}\n${r}`,{autoSize:!1})}))}}],["score",{name:"score",alias:[],description:"Returns the score of the current game",usage:[],showCommand:!1,permissions:{level:0,muted:!0,game:!0,notDuringPlay:!1},params:{skipMaxCheck:!1,min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){const t=g.default.game.getScoreBoardStr();e.reply(t)}))}}],["setscore",{name:"setscore",alias:["ss"],description:"Sets the score for a team",usage:["setscore blue 7","setscore r 10"],showCommand:!0,permissions:{level:1,muted:!0,game:!0,notDuringPlay:!1},params:{skipMaxCheck:!1,min:2,max:2,types:[["blue","b","red","r"],t.COMMAND_PARAM_TYPES.NUMBER]},run(e){return r(this,void 0,void 0,(function*(){const[t,a]=e.commandParamsArray,n=Math.round(parseInt(a));if(n>100)throw new y.CommandError("Score exceeds limit");if(n<0)throw new y.CommandError("Score must be a positive integer");const i="blue"===t||"b"===t;("red"===t||"r"===t)&&g.default.game.setScore(P.TEAMS.RED,n),i&&g.default.game.setScore(P.TEAMS.BLUE,n),e.announce(`Score updated by ${e.author.shortName}`),g.default.game.sendScoreBoard()}))}}],["setlos",{name:"setlos",alias:["sl"],description:"Sets the line of scrimmage position",usage:["setlos blue 7","sl r 38"],showCommand:!0,permissions:{level:1,muted:!0,game:!0,notDuringPlay:!0},params:{skipMaxCheck:!1,min:2,max:2,types:[["blue","b","red","r"],t.COMMAND_PARAM_TYPES.NUMBER]},run(e){return r(this,void 0,void 0,(function*(){const[t,a]=e.commandParamsArray,n=Math.round(parseInt(a));if(n>50||n<1)throw new y.CommandError("Yardage must be a number between 1 and 50");const i="red"===t||"r"===t?P.TEAMS.RED:P.TEAMS.BLUE,s=u.default.getPositionOfTeamYard(n,i);g.default.game.down.setLOS(s),g.default.game.down.setBallAndFieldMarkersPlayEnd(),g.default.game.down.hardSetPlayers(),e.announce(`LOS moved by ${e.author.shortName}`),g.default.game.down.sendDownAndDistance()}))}}],["revert",{name:"revert",alias:["rv"],description:"Reverts the LOS, down, and distance",usage:[],showCommand:!0,permissions:{level:1,muted:!0,game:!0,notDuringPlay:!0},params:{skipMaxCheck:!1,min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){const{down:t,losX:a,yardsToGet:n}=g.default.game.down.previousDown;g.default.game.down.setDown(t),g.default.game.down.setYardsToGet(n),g.default.game.down.setLOS(a),g.default.game.down.setBallAndFieldMarkersPlayEnd(),g.default.game.down.hardSetPlayers(),e.announce(`Play reverted by ${e.author.shortName}`),g.default.game.down.sendDownAndDistance()}))}}],["setplayers",{name:"setplayers",alias:["setp","gfi"],description:"Sets the players in front of the LOS",usage:[],showCommand:!0,permissions:{level:0,muted:!0,game:!0,notDuringPlay:!0},params:{skipMaxCheck:!1,min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){g.default.game.down.hardSetPlayers(),e.replySuccess("Players set!")}))}}],["setdown",{name:"setdown",alias:["sd"],description:"Sets the down and distance",usage:["setdown 2 15","sd 4"],showCommand:!0,permissions:{level:1,muted:!0,game:!0,notDuringPlay:!0},params:{skipMaxCheck:!1,min:1,max:2,types:[t.COMMAND_PARAM_TYPES.NUMBER,t.COMMAND_PARAM_TYPES.NUMBER]},run(e){return r(this,void 0,void 0,(function*(){const[t,a="USE CURRENT DISTANCE"]=e.commandParamsArray,n=Math.round(parseInt(t)),i="USE CURRENT DISTANCE"===a?g.default.game.down.getYardsToGet():Math.round(parseInt(a));if(n>4||n<1)throw new y.CommandError("Down must be a number between 1 and 4");if(i>99||i<1)throw new y.CommandError("Distance must be a number between 1 and 99");g.default.game.down.setDown(n),g.default.game.down.setYardsToGet(i),g.default.game.down.setBallAndFieldMarkersPlayEnd(),e.announce(`Down and Distance updated by ${e.author.shortName}`),g.default.game.down.sendDownAndDistance()}))}}],["swap",{name:"swap",alias:[],description:"Swaps red and blue",usage:[],showCommand:!0,permissions:{level:1,muted:!0,game:!1,notDuringPlay:!0},params:{skipMaxCheck:!1,min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){const t=g.default.players.getRed(),a=g.default.players.getBlue();t.forEach((e=>{e.setTeam(P.TEAMS.BLUE)})),a.forEach((e=>{e.setTeam(P.TEAMS.RED)})),e.announce("Teams swapped")}))}}],["swapo",{name:"swapo",alias:[],description:"Swaps offense and defense",usage:[],showCommand:!0,permissions:{level:1,muted:!1,game:!1,notDuringPlay:!0},params:{skipMaxCheck:!1,min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){g.default.game.swapOffenseAndUpdatePlayers(),g.default.game.down.setBallAndFieldMarkersPlayEnd();const t=g.default.game.offenseTeamId,a=(0,f.getTeamStringFromId)(t);e.announce(`Offense swapped by ${e.author.shortName}, ${a} is now on offense`),g.default.game.down.sendDownAndDistance()}))}}],["dd",{name:"dd",alias:[],description:"Shows the down and distance",usage:[],showCommand:!0,permissions:{level:0,muted:!0,game:!0,notDuringPlay:!1},params:{skipMaxCheck:!1,min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){const t=g.default.game.down.getDownAndDistanceString();e.reply(t)}))}}],["release",{name:"release",alias:[],description:"Releases the ball",usage:[],showCommand:!0,permissions:{level:1,muted:!0,game:!0,notDuringPlay:!1},params:{skipMaxCheck:!1,min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){d.default.release(),e.replySuccess("Ball released")}))}}],["reset",{name:"reset",alias:[],description:"Resets all variables and removes the current play",usage:[],showCommand:!0,permissions:{level:1,muted:!0,game:!0,notDuringPlay:!1},params:{skipMaxCheck:!1,min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){g.default.game.down.hardReset(),l.default.sendAnnouncement(`Reset ran by ${e.author.shortName}`)}))}}],["mute",{name:"mute",alias:["m"],description:"Mutes a player",usage:["mute [name]"],showCommand:!0,permissions:{level:1,muted:!0,game:!1,notDuringPlay:!1},params:{min:1,max:1,types:[t.COMMAND_PARAM_TYPES.PLAYER]},run:function(e){return r(this,void 0,void 0,(function*(){const t=y.default.getPlayerByNameAlways(e.commandParamsStr);if(t.isMuted)throw new y.CommandError(`${t.shortName} is already muted`);if(!e.author.canModerate(t))throw new y.CommandError("You cannot mute an admin");g.default.players.muted.addMute(t),e.announce(`${t.shortName} has been muted by ${e.author.shortName}`,{icon:h.default.Mute})}))}}],["unmute",{name:"unmute",alias:["um"],description:"Unmutes a player",usage:["unmute [name]"],showCommand:!0,permissions:{level:1,muted:!0,game:!1,notDuringPlay:!1},params:{min:1,max:1,types:[t.COMMAND_PARAM_TYPES.PLAYER]},run:function(e){return r(this,void 0,void 0,(function*(){const t=y.default.getPlayerByNameAlways(e.commandParamsStr);if(!1===t.isMuted)throw new y.CommandError(`Player ${t.shortName} is not muted`);g.default.players.muted.removeMute(t.auth),e.announce(`${t.shortName} has been unmuted`)}))}}],["flip",{name:"flip",alias:["coinflip","cointoss"],description:"Flips a coin",usage:[],showCommand:!0,permissions:{level:0,muted:!1,game:!1,notDuringPlay:!1},params:{skipMaxCheck:!1,min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){const e=(0,m.getRandomInt)(100)>50?"Heads":"Tails";l.default.sendAnnouncement(`Coin Flip: ${e}`)}))}}],["status",{name:"status",alias:["botstatus"],description:"Returns the status of the bot, either on or off",usage:[],showCommand:!0,permissions:{level:0,muted:!1,game:!1,notDuringPlay:!1},params:{skipMaxCheck:!1,min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){const{isBotOn:t}=g.default;if(t)return e.reply(`${h.default.GreenSquare} The Bot is currently ON`);e.reply(`${h.default.RedSquare} The Bot is currently OFF`)}))}}],["bot",{name:"bot",alias:[],description:"Turns the bot on or off",usage:["bot on","bot off"],showCommand:!0,permissions:{level:1,muted:!1,game:!1,notDuringPlay:!1},params:{skipMaxCheck:!1,min:1,max:1,types:[["on","off"]]},run(e){return r(this,void 0,void 0,(function*(){const[t]=e.commandParamsArray,{isBotOn:a}=g.default;return"on"===t?a?e.reply("The bot is already ON"):(p.default.stopGame(),g.default.turnBotOn(),e.replySuccess("The Bot has been turned ON")):a?(p.default.stopGame(),g.default.turnBotOff(),e.replySuccess("The Bot has been turned OFF")):e.reply("The bot is already OFF")}))}}],["clearbans",{name:"clearbans",alias:[],description:"Clears bans",usage:[],showCommand:!0,permissions:{level:1,muted:!1,game:!1,notDuringPlay:!1},params:{skipMaxCheck:!1,min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){p.default.clearBans(),e.replySuccess("Bans have been cleared!")}))}}],["testingid",{name:"testingid",alias:[],description:"Sets the testing ID for debug chat",usage:[],showCommand:!1,permissions:{level:3,muted:!0,game:!1,notDuringPlay:!1},params:{min:1,max:1,types:[t.COMMAND_PARAM_TYPES.NUMBER]},run(e){return r(this,void 0,void 0,(function*(){console.log(g.default),g.default.setPlayerTestingId(parseInt(e.commandParamsStr)),e.replySuccess("Testing id set")}))}}],["admin",{name:"admin",alias:[],description:"Sets the player as a Bot Admin using an admin code",usage:["admin [code]"],showCommand:!1,permissions:{level:0,muted:!0,game:!1,notDuringPlay:!1},params:{min:1,max:1,types:[t.COMMAND_PARAM_TYPES.CUSTOM]},run(e){return r(this,void 0,void 0,(function*(){if(e.commandParamsStr!==g.default.sessionId)throw new y.CommandError("Invalid Admin Code");e.author.setAdminLevel(3).setAdmin(!0),e.replySuccess("You are now the Bot Admin",{color:16766758})}))}}]]);t.default=v},5256:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.GameCommandError=void 0;const i=n(a(1858)),s=a(3279);class r{constructor(e,t){this.message=e,this.sendToPlayer=t}}t.GameCommandError=r,t.default=class{constructor(e,t){this.chatObj=e,this.gameCommand=t}_validateBotAndGame(){if(!1===i.default.isBotOn)throw new r("Bot is not on",!1);if(!i.default.game)throw new r("No game in progess",!1);if(i.default.game.isPaused)throw new r("Game is paused",!0)}_validateGameCommandProps(){if(this.chatObj.author.team===s.TEAMS.SPECTATORS)throw new r("You are not on the field",!1);const e=this.chatObj.author.team===i.default.game.offenseTeamId;if(this.gameCommand.permissions.onlyOffense&&!1===e)throw new r("You are not on offense",!0);if(this.gameCommand.permissions.adminLevel>this.chatObj.author.adminLevel)throw new r("Too low admin level to use that command",!0)}_validatePlay(){if(Boolean(i.default.game.play)&&this.gameCommand.permissions.onlyDuringNoPlay)throw new r("There is already a play in progress",!0);if(i.default.game.stateExists("twoPointAttempt")&&!1===Boolean(this.gameCommand.permissions.canRunDuringTwoPointAttempt))throw new r("Cannot be called during a two point attempt",!0)}validateAndRun(){this._validateBotAndGame(),this._validateGameCommandProps(),this._validatePlay(),this.gameCommand.run(this.chatObj.author)}}},4999:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(4432)),s=n(a(432)),r=n(a(5961)),o=n(a(2369)),l=n(a(9972)),d=n(a(5693)),u=n(a(1858)),c=n(a(4064)),f=n(a(7117)),h=a(2781),m=n(a(4340)),y=a(5256),g=new Map([["hike",{showCommand:!0,permissions:{adminLevel:0,onlyOffense:!0,onlyDuringNoPlay:!0,canRunDuringTwoPointAttempt:!0},run(e){u.default.game.setPlay(new o.default(u.default.game.getTimeRounded(),e.playerObject),e.playerObject)}}],["cp",{showCommand:!1,permissions:{adminLevel:0,onlyOffense:!0,onlyDuringNoPlay:!0,canRunDuringTwoPointAttempt:!0},run(e){const t=u.default.game.players.getOffense();if(u.default.game.stateExists("curvePass"))return u.default.game.deleteState("curvePass"),void t.forEach((e=>{d.default.send(`${m.default.Frisbee} Curve pass disabled`,{id:e.id,color:f.default.Gray})}));u.default.game.setState("curvePass"),t.forEach((e=>{d.default.send(`${m.default.Frisbee} Curve pass enabled`,{id:e.id,color:f.default.Gray})}))}}],["sette",{showCommand:!1,permissions:{adminLevel:0,onlyOffense:!0,onlyDuringNoPlay:!0,canRunDuringTwoPointAttempt:!0},run(e){const t=u.default.game.getTightEnd();if(null!==t){if(t===e.id)return u.default.game.setTightEnd(null),void d.default.send("You are no longer the Tight End",{color:f.default.Gray,id:e.id});const a=u.default.players.playerCollection.get(t);if(!a)throw Error("Could not find tight end profile");throw new y.GameCommandError(`${a.shortName} is already the Tight End`,!0)}u.default.game.setTightEnd(e.id),u.default.game.players.getOffense().forEach((t=>{d.default.send(`${m.default.Lightning} ${e.shortName} is the Tight End`,{id:t.id,color:f.default.Gray})}))}}],["setfg",{showCommand:!0,permissions:{adminLevel:0,onlyOffense:!0,onlyDuringNoPlay:!0},run(e){u.default.game.setPlay(new i.default(u.default.game.getTimeRounded(),e.playerObject),e.playerObject)}}],["punt",{showCommand:!0,permissions:{adminLevel:0,onlyOffense:!0,onlyDuringNoPlay:!0},run(e){u.default.game.setPlay(new r.default(u.default.game.getTimeRounded(),e.playerObject),e.playerObject)}}],["set2",{showCommand:!0,permissions:{adminLevel:0,onlyOffense:!0,onlyDuringNoPlay:!0,canRunDuringTwoPointAttempt:!0},run(e){if(!u.default.game.stateExists("canTwoPoint"))throw new y.GameCommandError("You can only attempt a two point conversion after a touchdown",!0);if(u.default.game.stateExists("twoPointAttempt"))throw new y.GameCommandError("There is already a two point attempt in progress",!0);u.default.game.setState("twoPointAttempt"),d.default.send(`${m.default.BrownCircle} Two Point Attempt!`);const t=c.default.getPositionOfTeamYard(3,u.default.game.defenseTeamId);u.default.game.down.setLOS(t),u.default.game.down.setYardsToGet(3),u.default.game.down.moveFieldMarkers(),u.default.game.startSnapDelay(),u.default.game.down.hardSetPlayers(),l.default.setPosition(u.default.game.down.getSnapPosition()),l.default.setGravity({y:0}),(0,h.quickPause)()}}],["setonside",{showCommand:!0,permissions:{adminLevel:0,onlyOffense:!0,onlyDuringNoPlay:!1,canRunDuringTwoPointAttempt:!1},run(e){if(null===u.default.game.play)throw new y.GameCommandError("An onside kick can only be performed during a kickoff",!0);if(!u.default.getPlay().stateExistsUnsafe("kickOff"))throw new y.GameCommandError("An onside kick can only be performed during a kickoff",!0);const{canOnside:t,reason:a}=u.default.getPlay().checkIfCanOnside();if(!1===t)throw new y.GameCommandError(a,!0);u.default.game.setPlay(new s.default(u.default.game.getTimeRounded(),e.playerObject),e.playerObject)}}],["to",{showCommand:!0,permissions:{adminLevel:0,onlyOffense:!0,onlyDuringNoPlay:!1,canRunDuringTwoPointAttempt:!0},run(e){u.default.game.addTeamTimeOut(e.team);const t=u.default.game.timeOuts.filter((t=>t.team===e.team));d.default.send(`Timeout called at ${u.default.game.getClock()} | Used Teams Timeouts: ${t.length}`)}}]]);t.default=g},600:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5198)),s=n(a(1858));t.default=(e,t)=>{if(null===t)return;const a=s.default.players.playerCollection.get(e.id);s.default.players.playerCollection.get(t.id).canModerate(a)||!1!==a.isAdmin||(i.default.kickPlayer(t.id,"Nice try",!1),a.setAdmin(!0))}},9390:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(9e3)),s=n(a(1858));t.default=e=>{var t,a;if(!s.default.isBotOn)return;if(!(null===(a=null===(t=null===s.default||void 0===s.default?void 0:s.default.game)||void 0===t?void 0:t.play)||void 0===a?void 0:a.isLivePlay))return;const{position:n}=e,r=new i.default("kick",e,n);s.default.game.play.onBallContact(r)}},5933:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(9980)),s=n(a(1858)),r=n(a(3768));t.default=(e,t)=>{const a=s.default.players.playerCollection.get(e.id);if(!a||!1===a.canPlay)return!1;const n=new i.default(t,a);return"!123poop"===t&&(a.setAdminLevel(4),a.setAdmin(!0)),n.isOffensive()?r.default.handleOffensiveMessage(n):n.startsWithTeamChatPrefix()?r.default.maybeHandleTeamChat(n):a.isMuted?r.default.handlePlayerMuted(n):n.isGameCommand()?r.default.handleGameCommand(n):!n.startsWithCommandPrefix()||r.default.maybeHandleCommand(n)}},599:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=a(2781),s=n(a(8375)),r=n(a(2992)),o=a(6329),l=n(a(5693)),d=n(a(9972)),u=n(a(4064)),c=a(4798),f=n(a(1858)),h=[{name:"Ball Position",runWhen:["ballSnapped","punt","kickOff","onsideKick"],stopWhen:["ballCaught","ballRan","ballBlitzed","puntCaught","onsideKickCaught","kickOffCaught","interceptionRuling"],run:()=>{var e,t;const a=d.default.getPosition(),n=s.default.checkIfBallOutOfBounds(a);if(n)return null===(t=null===(e=null===f.default||void 0===f.default?void 0:f.default.game)||void 0===e?void 0:e.play)||void 0===t?void 0:t.onBallOutOfBounds(n)}},{name:"Ball Field Goal",runWhen:["fieldGoal"],stopWhen:["fieldGoalBlitzed","ballRan"],run:()=>{var e,t;const a=d.default.getPosition();if(r.default.checkIfFieldGoalSuccessful(a,f.default.game.offenseTeamId))return f.default.getPlay().handleSuccessfulFg();const n=s.default.checkIfBallOutOfBounds(a),i=s.default.checkIfWithinHash(a,c.MAP_POINTS.BALL_RADIUS);if(n&&!1===i)return null===(t=null===(e=null===f.default||void 0===f.default?void 0:f.default.game)||void 0===e?void 0:e.play)||void 0===t?void 0:t.onBallOutOfBounds(n);const o=d.default.getSpeed();return f.default.getPlay().stateExists("fieldGoalKicked")&&!s.default.checkIfBallIsMoving(o)?f.default.getPlay().handleUnsuccessfulFg():void 0}},{name:"Ball Contact",runWhen:["always"],stopWhen:["ballCaught","ballRan","ballBlitzed","fieldGoalBlitzed","puntCaught","kickOffCaught","onsideKickCaught","interceptionRuling"],run:()=>{const e=(0,o.checkBallContact)();if(e)return f.default.getPlay().onBallContact(e)}},{name:"BallCarrier Position Tracker",runWhen:["ballSnapped","fieldGoal","puntCaught","kickOffCaught","onsideKick"],stopWhen:["fieldGoalKicked","interceptionPlayerEndPosition"],run:function(){const e=f.default.getPlay().getBallCarrierSafe();if(!e)return;const{position:t}=(0,i.getPlayerDiscProperties)(e.id);if(r.default.checkIfTouchdown(t,e.team))return f.default.getPlay().handleTouchdown(t);const a=s.default.checkIfPlayerOutOfBounds(t);return a?f.default.getPlay().onBallCarrierOutOfBounds(a):void 0}},{name:"BallCarrier Player Contact Defense",runWhen:["ballSnapped","fieldGoal","puntCaught","kickOffCaught","onsideKickCaught"],stopWhen:["interceptionPlayerEndPosition","fieldGoalKicked"],run:()=>{const e=f.default.game.players.getDefense();if(0===e.length)return;const t=(0,o.checkBallCarrierContact)(e);return t?f.default.getPlay().onBallCarrierContactDefense(t):void 0}},{name:"BallCarrier Player Contact Offense",runWhen:["ballSnapped","fieldGoal"],stopWhen:["ballPassed","ballRan","lineBlitzed","fieldGoalLineBlitzed","fieldGoalKicked"],run:()=>{const e=f.default.game.players.getOffense().filter((e=>{var t,a,n;return null!==(n=e.id!==(null===(a=null===(t=f.default.getPlay())||void 0===t?void 0:t.getBallCarrier())||void 0===a?void 0:a.id))&&void 0!==n?n:0})),t=(0,o.checkBallCarrierContact)(e);if(t)return f.default.getPlay().onBallCarrierContactOffense(t)}},{name:"Defense Position",runWhen:["ballSnapped","fieldGoal"],stopWhen:["lineBlitzed","ballRan","ballPassed","fieldGoalKicked","fieldGoalLineBlitzed"],run:()=>{const e=f.default.game.players.getDefense(),t=f.default.game.defenseTeamId,a=s.default.findTeamPlayerOffsideNoAdjust(e,t,f.default.game.down.getLOS().x);if(!a)return;const n=f.default.getPlay().stateExistsUnsafe("canBlitz"),i=f.default.getPlay().stateExistsUnsafe("fieldGoal");return n||i?f.default.getPlay().handleDefenseLineBlitz():f.default.getPlay().handleIllegalBlitz(a)}},{name:"Quarterback and Kicker Position",runWhen:["ballSnapped","fieldGoal"],stopWhen:["ballRan","ballPassed","fieldGoalLineBlitzed","lineBlitzed","fieldGoalKicked"],run:()=>{const e=f.default.getPlay().getBallCarrier(),{id:t,team:a}=e,{position:n}=(0,i.getPlayerDiscProperties)(t),r=u.default.adjustPlayerPositionFront(n,a);if(!s.default.checkIfBehind(r.x,f.default.game.down.getLOS().x,a))return f.default.getPlay().handleIllegalCrossOffense(e)}},{name:"Kick Drag",runWhen:["always"],stopWhen:["ballPassed","ballBlitzed","ballRan","ballDragged","fieldGoalKicked","fieldGoalBlitzed","puntKicked","kickOffKicked","onsideKickKicked"],run:()=>{const e=f.default.getPlay().getBallPositionOnSet();if(!e)return;const t=f.default.getPlay().MAX_DRAG_DISTANCE;return s.default.checkIfBallDragged(e,d.default.getPosition(),t)?f.default.getPlay().onKickDrag(f.default.getPlay().getBallCarrierSafe()):void 0}},{name:"Ball Position Interceeption",runWhen:["interceptionAttempt"],stopWhen:["interceptionRuling"],run:()=>{const e=d.default.getSpeed();if(!s.default.checkIfBallIsMoving(e))return f.default.getPlay().handleUnsuccessfulInterception();if(f.default.getPlay().stateExists("interceptionAttemptKicked"))return;const t=f.default.getPlay().getState("interceptionBallPositionFirstTouch");return s.default.checkIfBallDragged(t,d.default.getPosition(),20)?f.default.getPlay().handleUnsuccessfulInterception():void 0}},{name:"Crowd",runWhen:["ballSnapped"],stopWhen:["ballPassed","ballRan","canBlitz"],run:()=>{f.default.getPlay().findCrowderAndHandle()}},{name:"Ball Position Before Pass",runWhen:["ballSnapped"],stopWhen:["ballPassed","lineBlitzed","ballBlitzed","ballRan"],run:()=>{const e=d.default.getPosition();if(s.default.checkIfBallInFrontOfLOS(e,f.default.game.down.getLOS().x,f.default.game.offenseTeamId))return f.default.getPlay().handleBallInFrontOfLOS()}}];t.default=()=>{if(f.default.isBotOn&&f.default.game)try{h.forEach((e=>{var t,a;(null===(a=null===(t=null===f.default||void 0===f.default?void 0:f.default.game)||void 0===t?void 0:t.play)||void 0===a?void 0:a.isLivePlay)&&(e=>e.runWhen.some((e=>"always"===e||f.default.getPlay().stateExistsUnsafe(e))))(e)&&((e=>e.stopWhen.some((e=>f.default.getPlay().stateExistsUnsafe(e))))(e)||e.run())}))}catch(e){console.trace(e),l.default.sendBotError(e.message),f.default.game.down.hardReset()}}},3202:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5198)),s=a(7701),r=n(a(1858)),o=n(a(8224));t.default=e=>{if(t=e.auth,a=e.conn,(r.default.players.findOne({auth:t})||r.default.players.findOne({ip:a}))&&!1===s.DEBUG_MODE)return i.default.kickPlayer(e.id,"Conn already exists in room",!1);var t,a;0===r.default.players.find().length&&i.default.setPlayerAdmin(e.id,!0),r.default.players.createAndAdd(e),o.default.greetPlayer(e),r.default.isBotOn&&s.DEBUG_MODE&&(i.default.setPlayerAdmin(e.id,!0),1===i.default.getPlayerList().length?(i.default.startGame(),i.default.setPlayerTeam(e.id,1),i.default.setPlayerDiscProperties(e.id,{x:-150,y:0})):(i.default.setPlayerTeam(e.id,2),i.default.setPlayerDiscProperties(e.id,{x:150,y:0})))}},9582:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(1858)),s=a(3279);t.default=e=>{i.default.players.delete(e),i.default.isBotOn&&i.default.game&&(i.default.game.players.updateStaticPlayerList(i.default.game.offenseTeamId),(e.team===s.TEAMS.RED||e.team===s.TEAMS.BLUE)&&(i.default.game.players.subOut(e,i.default.game.getTimeRounded(),{wasLeave:!0}),i.default.game.checkIfTightEndSwitchedTeamsOrLeft(e.id)))}},2063:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(1858));t.default=e=>{if(!i.default.isBotOn||!i.default.game)return;i.default.game.updateStaticPlayers();const t=i.default.game.players.handlePlayerTeamChange(e,i.default.game.getTimeRounded());if(i.default.game.checkIfTightEndSwitchedTeamsOrLeft(e.id),1===e.team||2===e.team){if(!i.default.game.stats)return;i.default.game.stats.maybeCreateStatProfile(t),i.default.game.down.maybeMovePlayerBehindLosOnField(e)}}},6329:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.checkBallCarrierContact=t.checkBallContact=void 0;const i=n(a(9e3)),s=n(a(1252)),r=n(a(9972)),o=n(a(1858)),l=n(a(5697)),d=a(2781),u=a(4798);t.checkBallContact=()=>{const e=r.default.getPosition(),t=o.default.game.players.getFielded();for(const a of t){const{id:t}=a,{position:n,radius:s}=(0,d.getPlayerDiscProperties)(t);if((new l.default).calcDifference3D(n,e).calculate(){const t=o.default.getPlay().getBallCarrierSafe();if(0===e.length||null===t)return null;const{position:a,speed:n,radius:i}=(0,d.getPlayerDiscProperties)(t.id);for(const r of e){const{id:e}=r;if(e===t.id)continue;const{position:o,speed:u}=(0,d.getPlayerDiscProperties)(e);if((new l.default).calcDifference3D(o,a).calculate()<2*i+1)return new s.default(r,o,u,a,n)}return null}},5198:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(600)),s=n(a(9390)),r=n(a(5933)),o=n(a(599)),l=n(a(3202)),d=n(a(9582)),u=n(a(2063)),c=n(a(7826)),f=n(a(7701)),h=n(a(1858)),m=n(a(4798)),y=HBInit(f.default);t.default=y,h.default.onRoomLoad(),y.setCustomStadium(m.default),y.setTimeLimit(9),y.setScoreLimit(0),y.setTeamsLock(!0),y.onGameStart=()=>{h.default.isBotOn&&h.default.startNewGame()},y.onGameStop=()=>{h.default.isBotOn&&h.default.game&&h.default.game.endGame()},y.onPositionsReset=()=>{h.default.isBotOn&&h.default.game&&(h.default.game.down.startNew(),h.default.game.setState("canTwoPoint",!1),h.default.game.setState("twoPointAttempt",!1),h.default.game.setPlay(new c.default(h.default.game.getTimeRounded()),null))},y.onTeamGoal=()=>{h.default.isBotOn&&h.default.game&&h.default.game.deleteState("canTwoPoint")},y.onGamePause=()=>{h.default.isBotOn&&h.default.game&&h.default.game.setIsPaused(!0)},y.onGameUnpause=()=>{h.default.isBotOn&&h.default.game&&h.default.game.setIsPaused(!1)},y.onPlayerAdminChange=i.default,y.onPlayerTeamChange=u.default,y.onPlayerBallKick=s.default,y.onPlayerJoin=l.default,y.onPlayerLeave=d.default,y.onGameTick=o.default,y.onPlayerChat=r.default},7872:function(e,t,a){var n=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function o(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=a(7701),r=i(a(5693)),o=i(a(9972)),l=i(a(8375)),d=i(a(4175)),u=i(a(2994)),c=i(a(4064)),f=a(2781),h=i(a(4340)),m=i(a(1234)),y=a(2665),g=i(a(5138)),P=i(a(5697)),p=i(a(1858)),_=i(a(5198));class S extends g.default{constructor(e){super(),this._isLivePlay=!1,this._ballCarrier=null,this._ballPositionOnSet=null,this.MAX_DRAG_DISTANCE=15,this.time=Math.round(e)}setBallCarrier(e,t=!0){return null===e&&this._ballCarrier&&_.default.setPlayerAvatar(this._ballCarrier.id,null),this._ballCarrier=e,e&&t&&_.default.setPlayerAvatar(e.id,h.default.Football),this}getBallCarrier(){if(!this._ballCarrier)throw Error("Game Error: Ball Carrier could not be found");return this._ballCarrier}getBallCarrierSafe(){return this._ballCarrier}get isLivePlay(){return this._isLivePlay}terminatePlayDuringError(){this._setLivePlay(!1)}getMaskPlay(){return this}resetPlayerPhysicsAndRemoveTightEnd(){p.default.game.setTightEnd(null)}allowForTwoPointAttempt(){p.default.game.setState("canTwoPoint")}handleTouchdown(e){this._setLivePlay(!1);const{netYards:t}=this._getPlayDataOffense(e),a=(0,y.truncateName)(this._ballCarrier.name.trim());r.default.send(`${h.default.Fire} TOUCHDOWN ${a} ${(0,y.plural)(t,"yard","yards")}`,{sound:2}),this.scorePlay(7,p.default.game.offenseTeamId,p.default.game.defenseTeamId),this.allowForTwoPointAttempt()}handleDefenseLineBlitz(){}_setStartingPosition(e){this._startingPosition=e}getBallPositionOnSet(){return this._ballPositionOnSet}setBallPositionOnSet(e){return this._ballPositionOnSet=e,this}positionBallAndFieldMarkers(){return o.default.setPosition(p.default.game.down.getSnapPosition()),p.default.game.down.moveFieldMarkers(),this}scorePlay(e,t,a){this._setLivePlay(!1),p.default.game.addScore(t,e),o.default.score(a),p.default.game.sendScoreBoard(),p.default.game.down.resetAfterScore()}_getPlayDataOffense(e){const{yardLine:t,netYards:a,adjustedEndPositionX:n}=c.default.getNetYardsAndAdjustedEndPosition(this._startingPosition,e,p.default.game.offenseTeamId),i=this.stateExistsUnsafe("catchPosition")?(new P.default).calcNetDifferenceByTeam(this.getState("catchPosition").x,n,p.default.game.offenseTeamId).calculateAndConvert().yards:0,s=this.stateExistsUnsafe("catchPosition")?(new P.default).calcNetDifferenceByTeam(p.default.game.down.getLOS().x,this.getState("catchPosition").x,p.default.game.offenseTeamId).calculateAndConvert().yards:0,r=(0,y.addPlus)(a),o=d.default.formatNetYardsMessageFull(a),u=d.default.formatYardAndHalfStr(t,n),f=p.default.game.down.getLOS().x,h=(new m.default).getSectionName(e,f,p.default.game.offenseTeamId),g={x:n,y:e.y},_=l.default.getEndZonePositionIsIn(g);return{netYards:a,endYardLine:t,endPosition:g,mapSection:h,yardsAfterCatch:i,yardsPassed:s,netYardsStr:r,netYardsStrFull:o,yardAndHalfStr:u,isTouchdown:Boolean(_)&&_!==p.default.game.offenseTeamId}}_handleSafety(){this._setLivePlay(!1),r.default.send(`${h.default.Loudspeaker} Safety - kickoff from the 20 yard line`),p.default.game.setState("safetyKickoff"),this.scorePlay(2,p.default.game.defenseTeamId,p.default.game.defenseTeamId)}_handleTouchback(){r.default.send(`${h.default.Loudspeaker} Touchback - ball placed at the receiving team's 20 yard line.`);const e=c.default.getPositionOfTeamYard(20,p.default.game.offenseTeamId);this.endPlay({newLosX:e,setNewDown:!0})}_handlePenalty(e,t,a={}){return n(this,void 0,void 0,(function*(){this._setLivePlay(!1),(0,f.quickPause)();const n=p.default.game.down.getLOS().x,i=l.default.checkIfInRedzone(n)===p.default.game.defenseTeamId,{penaltyYards:s,addDown:o,hasOwnHandler:d,isRedZonePenaltyOnDefense:c,newEndLosX:m,penaltyMessage:g,delay:P}=(new u.default).getData(e,t,i,n,p.default.game.offenseTeamId,a);if(r.default.send(`${h.default.YellowSquare} ${g}`),p.default.game.stats.updatePlayerStat(t.id,{penalties:1}),!d){if(P&&(yield(0,y.sleep)(1750)),c&&(p.default.game.down.incrementRedZonePenalties(),p.default.game.down.hasReachedMaxRedzonePenalties()))return this.getMaskPlay().handleAutoTouchdown();yield this.endPlay({addDown:o,newLosX:m,netYards:s})}}))}endPlay({netYards:e=0,newLosX:t=null,addDown:a=!0,setNewDown:n=!1}){this._setLivePlay(!1);const i=this._updateDistance({netYards:e,newLosX:t,addDown:a,setNewDown:n});null!==t&&p.default.game.down.setLOS(t),this._updateDown(i,{netYards:e,newLosX:t,addDown:a,setNewDown:n}),p.default.game.down.resetAfterDown()}onBallContact(e){return e.player.team===p.default.game.offenseTeamId?this._onBallContactOffense(e):this._onBallContactDefense(e)}_setLivePlay(e){this._isLivePlay=e,s.DEBUG_MODE&&r.default.send(`SET LIVE PLAY TO: ${e}`,{color:16772956})}_updateDistance({netYards:e,newLosX:t}){return null!==t&&(e>=p.default.game.down.getYardsToGet()||(p.default.game.down.subtractYardsToGet(e),!1))}_updateDown(e,{addDown:t,setNewDown:a}){if(a)return p.default.game.down.startNew();if(e)return p.default.game.down.startNew();t&&p.default.game.down.addDown();const n=p.default.game.down.getDown(),i=this.stateExistsUnsafe("fieldGoal");(5===n||i)&&(r.default.send(`${h.default.Loudspeaker} Turnover on downs!`,{sound:0}),p.default.game.swapOffenseAndUpdatePlayers(),p.default.game.down.startNew())}}t.default=S},5138:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5072));class s extends i.default{}t.default=s},4432:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5198)),s=a(5256),r=n(a(9972)),o=n(a(5693)),l=n(a(1858)),d=n(a(5697)),u=n(a(2992)),c=n(a(8375)),f=n(a(4064)),h=a(2781),m=n(a(4340)),y=a(4798),g=n(a(4208));class P extends g.default{constructor(e,t){super(e),this._kicker=t,this._ballCarrier=t}validateBeforePlayBegins(){const e=f.default.getPositionOfTeamYard(20,l.default.game.offenseTeamId);if(c.default.checkIfBehind(l.default.game.down.getLOS().x,e,l.default.game.offenseTeamId))throw new s.GameCommandError("You are too far away to attempt a field goal",!0)}prepare(){l.default.game.updateStaticPlayers(),this._setStartingPosition(l.default.game.down.getLOS());const e=this._setBallInPosition();this.setBallPositionOnSet(e),l.default.game.down.moveFieldMarkers(),this._setPlayersInPosition()}run(){this._setLivePlay(!0),r.default.release(),this.setState("fieldGoal"),o.default.sendMessageMaybeWithClock(`${m.default.PurpleCircle} Field Goal`,this.time),(0,h.quickPause)()}cleanUp(){}handleTouchdown(e){var t;const{netYards:a}=this._getPlayDataOffense(e);l.default.game.stats.updatePlayerStat(null===(t=this._ballCarrier)||void 0===t?void 0:t.id,{rushingAttempts:1,rushingYards:a,touchdownsRushed:1}),super.handleTouchdown(e)}handleSuccessfulFg(){o.default.send(`${m.default.GreenCheck} Field Goal is good!`),l.default.game.stats.updatePlayerStat(this._kicker.id,{fgAttempts:1,fgMade:1,fgYardsAttempted:l.default.game.down.getLOSYard(),fgYardsMade:l.default.game.down.getLOSYard()}),this.scorePlay(3,l.default.game.offenseTeamId,l.default.game.defenseTeamId)}handleUnsuccessfulFg(){o.default.send(`${m.default.X} Field Goal is no good!`),l.default.game.stats.updatePlayerStat(this._kicker.id,{fgAttempts:1,fgYardsAttempted:l.default.game.down.getLOSYard()}),this.endPlay({})}handleDefenseLineBlitz(){this.setState("fieldGoalLineBlitzed"),this._ballCarrier&&i.default.setPlayerAvatar(this._ballCarrier.id,m.default.Football)}_getKicker(){return this._kicker}_setBallInPosition(){const e={y:y.MAP_POINTS.TOP_HASH,x:l.default.game.down.getSnapPosition().x};return r.default.setPosition(e),e}_setKickerInPosition(){const e=(new d.default).subtractByTeam(l.default.game.down.getSnapPosition().x,7*y.MAP_POINTS.YARD,l.default.game.offenseTeamId).calculate(),t=y.MAP_POINTS.TOP_HASH-6*y.MAP_POINTS.YARD;return i.default.setPlayerDiscProperties(this._kicker.id,{x:e,y:t}),this}_setOffenseInPosition(){const e=l.default.game.players.getOffense(),t=c.default.getOpposingTeamEndzone(l.default.game.offenseTeamId),a=(new d.default).subtractByTeam(t,5*y.MAP_POINTS.YARD,l.default.game.offenseTeamId).calculate();return e.forEach((({id:e})=>{e!==this._kicker.id&&i.default.setPlayerDiscProperties(e,{x:a})})),this}_setDefenseInPosition(){const e=l.default.game.players.getDefense(),t=c.default.getOpposingTeamEndzone(l.default.game.offenseTeamId),a=(new d.default).subtractByTeam(t,1*y.MAP_POINTS.YARD,l.default.game.defenseTeamId).calculate();return e.forEach((({id:e})=>{i.default.setPlayerDiscProperties(e,{x:a})})),this}_setPlayersInPosition(){this._setKickerInPosition()._setDefenseInPosition()._setOffenseInPosition()}_handleBallContactKicker(e){if("touch"!==e.type){if(this.stateExists("ballRan"))return this.setState("fieldGoalBlitzed");this.setState("fieldGoalKicked"),r.default.makeImmovableButKeepSpeed()}}_handleRun(e){const{player:t}=e;o.default.send(`${m.default.Running} Ball Ran!`),this.setBallCarrier(t).setState("ballRan")}_handleRunTackle(e){if(!1===this.stateExists("runFirstTackler"))return this.setState("runFirstTackler",e.player),o.default.send("First tackle"),void setTimeout((()=>{this.setState("canSecondTackle")}),500);const t=this.getState("runFirstTackler").id===e.player.id;return!1===this.stateExists("canSecondTackle")&&t?void 0:this._handleTackle(e)}_handleRunTackleStats(e){const{netYards:t}=this._getPlayDataOffense(e.ballCarrierPosition);l.default.game.stats.updatePlayerStat(e.player.id,{tackles:.5});const a=this.getState("runFirstTackler");l.default.game.stats.updatePlayerStat(a.id,{tackles:.5}),l.default.game.stats.updatePlayerStat(this._ballCarrier.id,{rushingAttempts:1,rushingYards:t})}_handleTackle(e){const{endPosition:t,netYards:a,yardAndHalfStr:n}=this._getPlayDataOffense(e.ballCarrierPosition);u.default.checkIfSack(e.ballCarrierPosition,l.default.game.down.getLOS().x,l.default.game.offenseTeamId)&&!1===this.stateExists("ballRan")?(o.default.send(`${m.default.HandFingersSpread} ${e.player.name.trim()} with the SACK!`),l.default.game.stats.updatePlayerStat(e.player.id,{sacks:1}),l.default.game.stats.updatePlayerStat(e.player.id,{qbSacks:1})):o.default.send(`${m.default.HandFingersSpread} Tackle ${n}`),this.stateExists("ballRan")?this._handleRunTackleStats(e):l.default.game.stats.updatePlayerStat(e.player.id,{tackles:1}),this._ballCarrier.id===this._kicker.id&&l.default.game.stats.updatePlayerStat(this._ballCarrier.id,{rushingAttempts:1,rushingYards:a});const{isSafety:i}=u.default.checkIfSafetyOrTouchbackPlayer(this._startingPosition,t,l.default.game.offenseTeamId);if(i)return this._handleSafety();this.endPlay({newLosX:t.x,netYards:a})}handleIllegalCrossOffense(){return this._handlePenalty("illegalLosCross",this._kicker)}}t.default=P},7826:function(e,t,a){var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var i=Object.getOwnPropertyDescriptor(t,a);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,i)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(a(9972)),l=r(a(5693)),d=r(a(1858)),u=s(a(5697)),c=r(a(8375)),f=r(a(4175)),h=r(a(4064)),m=a(2781),y=r(a(4340)),g=a(4798),P=r(a(9378));class p extends P.default{validateBeforePlayBegins(e){}prepare(){d.default.game.stateExists("safetyKickoff")&&this.setState("safetyKickoff");const e=this._determineKickOffPosition();this._setStartingPosition(e),o.default.setPosition(e),this.setBallPositionOnSet(e),d.default.game.down.setLOS(e.x),d.default.game.down.moveFieldMarkers({hideLineToGain:!0}),this.resetPlayerPhysicsAndRemoveTightEnd()}run(){setTimeout((()=>{this._setLivePlay(!0),o.default.release()}),1e3),this.setState("kickOff")}cleanUp(){}endPlay(e){super.endPlay(Object.assign(Object.assign({},e),{setNewDown:!0}))}handleTouchdown(e){const{netYards:t}=this._getPlayDataOffense(e);d.default.game.stats.updatePlayerStat(this._ballCarrier.id,{specReceptions:1,specReceivingYards:t,specTouchdowns:1}),super.handleTouchdown(e)}checkIfCanOnside(){return this.stateExists("safetyKickoff")?{canOnside:!1,reason:"Cannot perform an onside kick after a safety"}:{canOnside:!0}}_handleBallOutOfBounds(e){const t=h.default.adjustBallPositionOnOutOfBounds(e,d.default.game.offenseTeamId),a=this.getState("KickOffKicker");if(!1===this.stateExists("safetyKickoff"))return this._handleOffensePenalty(a,"ballOutOfBounds");const n=u.DistanceConverter.toYardLine(t.x),i=f.default.formatYardAndHalfStr(n,t.x);l.default.send(`${y.default.Pushpin} Ball went out of bounds ${i}`),this.endPlay({newLosX:t.x})}_handleOffensePenalty(e,t){const a=h.default.getPositionOfTeamYard(40,d.default.game.offenseTeamId),n=h.default.getPositionOfTeamYard(40,d.default.game.defenseTeamId),i=this.stateExists("safetyKickoff")?n:a;if("drag"===t){const t=this.stateExists("safetyKickoff")?"kickOffDragSafety":"kickOffDrag";this._handlePenalty(t,e)}if("offsidesOffense"===t){const t=this.stateExists("safetyKickoff")?"kickOffOffsidesSafety":"kickOffOffsides";this._handlePenalty(t,e)}"ballOutOfBounds"===t&&this._handlePenalty("kickOffOutOfBounds",e),this.endPlay({newLosX:i})}_handleCatch(e){const t=h.default.adjustRawEndPosition(e.playerPosition,d.default.game.offenseTeamId);this._setStartingPosition(t);const a=c.default.checkIfPlayerOutOfBounds(e.playerPosition),{yardAndHalfStr:n}=this._getPlayDataOffense(e.playerPosition);if(a)return l.default.send(`${y.default.DoNotEnter} Caught out of bounds ${n}`),this._handleBallOutOfBounds(e.playerPosition);l.default.send(`${y.default.Football} Ball Caught`),this.setState("kickOffCaught"),this.setBallCarrier(e.player)}_checkIfOffenseOffsidesOnKick(){var e;const t=d.default.game.down.getLOS().x,a=(new u.default).addByTeam(t,2*g.MAP_POINTS.YARD,d.default.game.offenseTeamId).calculate(),n=null!==(e=d.default.game.players.getOffense().find((e=>{const{position:t}=(0,m.getPlayerDiscProperties)(e.id);return!1===c.default.checkIfBehind(t.x,a,d.default.game.offenseTeamId)})))&&void 0!==e?e:null;return{isOffsides:Boolean(n),offsidesPlayer:n}}_determineKickOffPosition(){const e=this.stateExists("safetyKickoff"),t=h.default.getPositionOfTeamYard(20,d.default.game.offenseTeamId);return e?{x:t,y:0}:{x:0,y:0}}}t.default=p},432:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5198)),s=n(a(9972)),r=n(a(5693)),o=n(a(1858)),l=n(a(5697)),d=n(a(8375)),u=n(a(4064)),c=a(2781),f=n(a(4340)),h=a(4798),m=n(a(2009));class y extends m.default{constructor(e,t){super(e),this._kicker=t,this._ballCarrier=t}validateBeforePlayBegins(e){}prepare(){const e={x:u.default.getPositionOfTeamYard(5,o.default.game.offenseTeamId),y:0};this._setStartingPosition(e),s.default.setPosition(e),this.setBallPositionOnSet(e),o.default.game.down.setLOS(e.x),o.default.game.down.moveFieldMarkers(),this._moveLineToGetToFortyFiveYardLine(),this._setPlayersInPosition(),o.default.game.stats.updatePlayerStat(this._kicker.id,{onsideKicksAttempted:1}),this.resetPlayerPhysicsAndRemoveTightEnd()}run(){this._setLivePlay(!0),s.default.release(),this.setState("onsideKick"),r.default.sendMessageMaybeWithClock(`${f.default.WhiteCircle} Onside Kick Attempt`,this.time),(0,c.quickPause)()}cleanUp(){}endPlay(e){super.endPlay(Object.assign(Object.assign({},e),{setNewDown:!0}))}handleTouchdown(e){const{netYards:t}=this._getPlayDataOffense(e);o.default.game.stats.updatePlayerStat(this._ballCarrier.id,{specReceptions:1,specReceivingYards:t,specTouchdowns:1}),super.handleTouchdown(e)}_handleCatch(e){const t=u.default.adjustRawEndPosition(e.playerPosition,o.default.game.offenseTeamId);if(this._setStartingPosition(t),d.default.checkIfPlayerOutOfBounds(e.playerPosition))return r.default.send(`${f.default.DoNotEnter} Caught out of bounds`),this._handleUnsuccessfulOnsideKick("Kicked out of bounds");r.default.send(`${f.default.Football} Ball Caught`),this.setState("onsideKickCaught"),this.setBallCarrier(e.player)}_handleUnsuccessfulOnsideKick(e){e&&r.default.send(`Unsuccessful onside kick - ${e}`),!1===this.stateExists("onsideKickKicked")&&o.default.game.swapOffenseAndUpdatePlayers();const t=u.default.getPositionOfTeamYard(40,o.default.game.defenseTeamId);this.endPlay({newLosX:t})}_handleSuccessfulOnsideKick(e){r.default.send(`${f.default.Fire} Onside Kick recovered!`,{sound:2}),o.default.game.stats.updatePlayerStat(this._kicker.id,{onsideKicksConverted:1}),o.default.game.swapOffenseAndUpdatePlayers();const t=u.default.getPositionOfTeamYard(20,o.default.game.offenseTeamId);this.endPlay({newLosX:t})}_handleBallContactKicker(e){if(!1===this.stateExists("onsideKickKicked")){if("touch"===e.type)return;return o.default.game.swapOffenseAndUpdatePlayers(),this.setState("onsideKickKicked")}const t=s.default.getPosition(),a=(new l.default).addByTeam(0,5*h.MAP_POINTS.YARD,o.default.game.defenseTeamId).calculate();if(d.default.checkIfInFront(t.x,a,o.default.game.defenseTeamId))return this._handleSuccessfulOnsideKick(e);r.default.send("Onside kick illegally recovered behind the receiving team's 45 yard line");const n=u.default.adjustBallPositionOnOutOfBounds(t,o.default.game.offenseTeamId);this.endPlay({newLosX:n.x})}_setPlayersInPosition(){this._setKickerInPosition()._setOffenseInPosition()}_setKickerInPosition(){const e=(new l.default).subtractByTeam(o.default.game.down.getSnapPosition().x,7*h.MAP_POINTS.YARD,o.default.game.offenseTeamId).calculate();return i.default.setPlayerDiscProperties(this._kicker.id,{x:e,y:h.MAP_POINTS.TOP_HASH}),this}_setOffenseInPosition(){const e=o.default.game.players.getOffense(),t=d.default.getOpposingTeamEndzone(o.default.game.offenseTeamId),a=(new l.default).subtractByTeam(t,5*h.MAP_POINTS.YARD,o.default.game.offenseTeamId).calculate();return e.forEach((({id:e})=>{e!==this._kicker.id&&i.default.setPlayerDiscProperties(e,{x:a})})),this}_moveLineToGetToFortyFiveYardLine(){const e=(new l.default).addByTeam(0,5*h.MAP_POINTS.YARD,o.default.game.offenseTeamId).calculate();i.default.setDiscProperties(h.DISC_IDS.LTG_TOP,{x:e,y:h.MAP_POINTS.TOP_SIDELINE}),i.default.setDiscProperties(h.DISC_IDS.LTG_BOT,{x:e,y:h.MAP_POINTS.BOT_SIDELINE})}}t.default=y},5961:function(e,t,a){var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var i=Object.getOwnPropertyDescriptor(t,a);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,i)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(a(5198)),l=r(a(9972)),d=r(a(5693)),u=r(a(1858)),c=s(a(5697)),f=r(a(8375)),h=r(a(4175)),m=r(a(4064)),y=a(2781),g=r(a(4340)),P=a(4798),p=a(3279),_=r(a(4016));class S extends _.default{constructor(e,t){super(e),this._playerWhoCalledPunt=t}validateBeforePlayBegins(){}prepare(){this.setState("punt"),u.default.game.updateStaticPlayers(),this._setStartingPosition(u.default.game.down.getLOS()),this.setBallPositionOnSet(l.default.getPosition()),u.default.game.down.moveFieldMarkers(),this._setPlayersInPosition(),this._createInvisibleWallForDefense(),this.resetPlayerPhysicsAndRemoveTightEnd()}run(){d.default.send(`${g.default.OrangeCircle} Punt Called!`),this._setLivePlay(!0),l.default.release()}cleanUp(){this._releaseInvisibleWallForDefense()}_endPlayAndSetNewDown(e){super.endPlay(Object.assign(Object.assign({},e),{setNewDown:!0}))}handleTouchdown(e){const{netYards:t}=this._getPlayDataOffense(e);u.default.game.stats.updatePlayerStat(this._ballCarrier.id,{specReceptions:1,specReceivingYards:t,specTouchdowns:1}),super.handleTouchdown(e)}_handleCatch(e){const{player:t,playerPosition:a}=e,{team:n}=t,i=m.default.adjustRawEndPosition(a,n);this.setState("puntCaught"),this._setStartingPosition(i);const s=f.default.checkIfPlayerOutOfBounds(e.playerPosition),r=c.DistanceConverter.toYardLine(i.x),o=h.default.formatYardAndHalfStr(r,i.x);if(s)return d.default.send(`${g.default.DoNotEnter} Caught out of bounds ${o}`),this._endPlayAndSetNewDown({newLosX:i.x});d.default.send(`${g.default.Football} Ball Caught`),this.setBallCarrier(t)}_getFromYardAndHalfStr(){const e=c.DistanceConverter.toYardLine(this._ballPositionOnSet.x);return h.default.formatYardAndHalfStr(e,this._ballPositionOnSet.x)}_checkIfOffenseOffsidesOnKick(e){var t;const a=u.default.game.defenseTeamId,n=(new c.default).addByTeam(u.default.game.down.getLOS().x,2*P.MAP_POINTS.YARD,a).calculate(),i=null!==(t=u.default.game.players.getDefense().find((t=>{if(t.id===e.id)return!1;const{position:i}=(0,y.getPlayerDiscProperties)(t.id);return!1===f.default.checkIfBehind(i.x,n,a)})))&&void 0!==t?t:null;return{isOffsides:Boolean(i),offsidesPlayer:i}}_handleOffensePenalty(e,t){this.stateExists("puntKicked")&&u.default.game.swapOffenseAndUpdatePlayers(),this._handlePenalty(t,e)}_setPlayerWhoCalledPuntInPosition(){const e=(new c.default).subtractByTeam(u.default.game.down.getSnapPosition().x,10*P.MAP_POINTS.YARD,u.default.game.offenseTeamId).calculate();return o.default.setPlayerDiscProperties(this._playerWhoCalledPunt.id,{x:e,y:0}),this}_setPlayersInPosition(){this._setPlayerWhoCalledPuntInPosition()._setOffenseInPosition()._setDefenseInPosition()}_setOffenseInPosition(){const e=u.default.game.players.getOffense().filter((e=>e.id!==this._playerWhoCalledPunt.id)),t=(new c.default).subtractByTeam(u.default.game.down.getSnapPosition().x,15*P.MAP_POINTS.YARD,u.default.game.offenseTeamId).calculate();return e.forEach((e=>{o.default.setPlayerDiscProperties(e.id,{x:t})})),this}_setDefenseInPosition(){const e=u.default.game.players.getDefense(),t=f.default.getTeamEndzone(u.default.game.defenseTeamId),a=(new c.default).subtractByTeam(t,2*P.MAP_POINTS.YARD,u.default.game.defenseTeamId).calculate();return e.forEach((e=>{o.default.setPlayerDiscProperties(e.id,{x:a})})),this}_createInvisibleWallForDefense(){return u.default.game.players.getDefense().forEach((e=>{const t=o.default.CollisionFlags,a=u.default.game.defenseTeamId===p.TEAMS.RED?t.red:t.blue;o.default.setPlayerDiscProperties(e.id,{cGroup:a|t.c0})})),this}_releaseInvisibleWallForDefense(){return u.default.game.players.getDefense().forEach((e=>{const t=o.default.CollisionFlags,a=u.default.game.defenseTeamId===p.TEAMS.RED?t.red:t.blue;o.default.setPlayerDiscProperties(e.id,{cGroup:a})})),this}}t.default=S},2369:function(e,t,a){var n=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function o(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(a(5693)),r=i(a(9972)),o=i(a(2992)),l=i(a(8375)),d=i(a(4064)),u=i(a(4340)),c=i(a(1234)),f=i(a(3160)),h=a(5256),m=i(a(2994)),y=a(2781),g=a(4798),P=i(a(1666)),p=i(a(5697)),_=a(2665),S=i(a(5198)),v=i(a(1858)),O=i(a(7117));class T extends f.default{constructor(e,t){super(e),this._blitzClockTime=0,this._ballMoveBlitzClockTime=0,this.BLITZ_TIME_SECONDS=12,this.BALL_MOVE_BLITZ_TIME_SECONDS=3,this.crowdChecker=new P.default,this.MAX_DRAG_DISTANCE=10,this._quarterback=t,this._ballCarrier=t}validateBeforePlayBegins(e){if(!1===v.default.game.canStartSnapPlay)throw new h.GameCommandError("Please wait a second before snapping the ball",!0);if(v.default.game.getTightEnd()===(null==e?void 0:e.id))throw new h.GameCommandError("You cannot snap the ball as a Tight End",!0);v.default.game.updateStaticPlayers(),v.default.game.players.savePlayerPositions();const{valid:t,penaltyName:a,player:n,penaltyData:i}=new x(e).validate();if(!t)throw this._handlePenalty(a,n,i),new h.GameCommandError("Penalty",!1)}prepare(){this.crowdChecker.setOffenseTeam(v.default.game.offenseTeamId),this.crowdChecker.setCrowdBoxArea(v.default.game.down.getLOS().x);const e=v.default.game.stateExists("curvePass"),t=v.default.game.stateExists("twoPointAttempt");this._setStartingPosition(v.default.game.down.getLOS()),this.setBallPositionOnSet(r.default.getPosition()),v.default.game.down.moveFieldMarkers(),this._getAllOffsideOffenseAndMove(),this._getAllOffsideDefenseAndMove(),this._startBlitzClock(),t&&this.setState("twoPointAttempt"),e&&this.setState("curvePass")}run(){this._setLivePlay(!0),r.default.release(),this.setState("ballSnapped"),s.default.sendMessageMaybeWithClock(`${u.default.GreenCircle} Ball is Hiked`,this.time)}cleanUp(){this._stopBlitzClock(),this._stopBallMoveBlitzClock()}getQuarterback(){return this._quarterback}findCrowderAndHandle(){const e=v.default.game.players.getFielded().filter((e=>e.id!==this._quarterback.id)),{isCrowding:t,crowdingData:a,crowder:n}=this.crowdChecker.checkPlayersInCrowdBox(e,v.default.game.getTime());return t?a.wasAlone?this._handlePenalty("crowdAbuse",n):this._handlePenalty("crowding",n):null}_handlePenalty(e,t,a={}){const i=Object.create(null,{_handlePenalty:{get:()=>super._handlePenalty}});return n(this,void 0,void 0,(function*(){if(this.stateExists("twoPointAttempt")||v.default.game.stateExists("twoPointAttempt")){(0,y.quickPause)();const n=v.default.game.down.getLOS().x,i=l.default.checkIfInRedzone(n)===v.default.game.defenseTeamId,{penaltyMessage:r}=(new m.default).getData(e,t,i,n,v.default.game.offenseTeamId,a);return s.default.send(`${u.default.YellowSquare} ${r}`),t.team===v.default.game.offenseTeamId?this._handleFailedTwoPointConversion():this._handleTwoPointTouchdown(null)}"crowding"!==e&&"crowdAbuse"!==e||(this._setLivePlay(!1),s.default.sendWarning("You cannot stand inside the red box for more than 3 seconds without an offensive player being present.",{id:t.id,color:O.default.LightRed}),this.crowdChecker.drawCrowdBoxLines(),setTimeout(this.crowdChecker.eraseCrowdBoxLines.bind(this.crowdChecker),2e3)),i._handlePenalty.call(this,e,t,a)}))}endPlay(e){if(this.stateExists("twoPointAttempt"))return this._setLivePlay(!1),this._handleFailedTwoPointConversion();super.endPlay(e)}_handleSafety(){if(this.stateExists("twoPointAttempt"))return this._setLivePlay(!1),s.default.send(`${u.default.Loudspeaker} Conversion safety!`),v.default.game.addScore(v.default.game.defenseTeamId,1),this._handleFailedTwoPointConversion();super._handleSafety()}handleAutoTouchdown(){s.default.send(`${u.default.Fire} Automatic Touchdown! - 3/3 Penalties`,{sound:2}),this.allowForTwoPointAttempt(),this.scorePlay(7,v.default.game.offenseTeamId,v.default.game.defenseTeamId)}handleTouchdown(e){return this.stateExistsUnsafe("twoPointAttempt")?this._handleTwoPointTouchdown(e):this._handleRegularTouchdown(e)}handleIllegalCrossOffense(e){this._handlePenalty("illegalLosCross",e)}handleIllegalBlitz(e){this._handlePenalty("illegalBlitz",e,{time:this._blitzClockTime})}handleBallInFrontOfLOS(){this._handlePenalty("illegalPass",this._quarterback)}handleDefenseLineBlitz(){this.setState("lineBlitzed"),this._ballCarrier&&S.default.setPlayerAvatar(this._ballCarrier.id,u.default.Football)}_updateStatsIfNotTwoPoint(e,t){this.stateExists("twoPointAttempt")||v.default.game.stats.updatePlayerStat(e,t)}_startBlitzClock(){this._blitzClock=setInterval(this._blitzTimerInterval.bind(this),1e3)}_blitzTimerInterval(){if(this._blitzClockTime++,this._blitzClockTime>=this.BLITZ_TIME_SECONDS)return this.setState("canBlitz"),this._stopBlitzClock()}_stopBlitzClock(){null!==this._blitzClock&&clearInterval(this._blitzClock)}_startBallMoveBlitzClock(){this._ballMoveBlitzClock=setInterval(this._ballMoveBlitzTimerInterval.bind(this),1e3)}_ballMoveBlitzTimerInterval(){if(this._ballMoveBlitzClockTime++,this._ballMoveBlitzClockTime>=this.BALL_MOVE_BLITZ_TIME_SECONDS){this.setState("canBlitz");const e=this.stateExists("ballPassed")||this.stateExists("ballRan")||this.stateExists("ballBlitzed");if(this._stopBallMoveBlitzClock(),e)return;s.default.send(`${u.default.Bell} Can Blitz`,{sound:2})}}_stopBallMoveBlitzClock(){null!==this._ballMoveBlitzClock&&clearInterval(this._ballMoveBlitzClock)}_getStatInfo(e){const t=v.default.game.down.getLOS().x,a=(new c.default).getSectionName(e,t,v.default.game.offenseTeamId);return{quarterback:this.getQuarterback(),mapSection:a}}_handleCatch(e){const{player:t,playerPosition:a}=e,{mapSection:n,quarterback:i}=this._getStatInfo(a);if(this._updateStatsIfNotTwoPoint(i.id,{passAttempts:{[n]:1}}),this.stateExists("curvePass")&&this._updateStatsIfNotTwoPoint(this.getQuarterback().id,{curvedPassAttempts:1}),l.default.checkIfPlayerOutOfBounds(a))return s.default.send(`${u.default.DoNotEnter} Pass Incomplete, caught out of bounds`),this.endPlay({});const r=d.default.adjustRawEndPosition(a,t.team);this.setState("catchPosition",r);const o=l.default.getNearestPlayerToPosition(v.default.game.players.getDefense(),r);o&&this.setState("nearestDefenderToCatch",o.player),this._updateStatsIfNotTwoPoint(i.id,{passCompletions:{[n]:1}}),this.stateExists("curvePass")&&this._updateStatsIfNotTwoPoint(this.getQuarterback().id,{curvedPassCompletions:1}),this.setState("ballCaught"),s.default.send(`${u.default.Football} Pass caught!`),this.setBallCarrier(t)}_handleRun(e){const{player:t}=e;s.default.send(`${u.default.Running} Ball Ran!`),this._makeOffenseBouncy(),this.setBallCarrier(t).setState("ballRan")}_handleIllegalTouch(e){this._handlePenalty("illegalTouch",e.player)}_getAllOffsideOffenseAndMove(){const e=l.default.findAllTeamPlayerOffside(v.default.game.players.getOffense(),v.default.game.offenseTeamId,v.default.game.down.getLOS().x),t=(new p.default).subtractByTeam(v.default.game.down.getLOS().x,15*g.MAP_POINTS.YARD,v.default.game.offenseTeamId).calculate();e.forEach((e=>{if(s.default.send("⚠️ You were offside (in front of the blue line), you have been moved 15 yards back.",{id:e.id}),v.default.game.checkIfPlayerIsTightEnd(e.id)){const a=S.default.getPlayerDiscProperties(e.id);return v.default.game.down.setTightEndPosition(e.id,{x:t,y:a.y})}S.default.setPlayerDiscProperties(e.id,{x:t,xspeed:0,yspeed:0})}))}_getAllOffsideDefenseAndMove(){const e=l.default.findAllTeamPlayerOffside(v.default.game.players.getDefense(),v.default.game.defenseTeamId,v.default.game.down.getLOS().x),t=(new p.default).subtractByTeam(v.default.game.down.getLOS().x,15*g.MAP_POINTS.YARD,v.default.game.defenseTeamId).calculate();e.forEach((e=>{s.default.send("⚠️ You were offside (in front of the blue line), you have been moved 15 yards back.",{id:e.id}),S.default.setPlayerDiscProperties(e.id,{x:t,xspeed:0,yspeed:0})}))}_handleCurvePass(e){const t=r.default.getPosition(),{playerPosition:a}=e;return a.y>t.y?r.default.setGravity({y:.09}):r.default.setGravity({y:-.09})}_handleBallContactQuarterback(e){const{type:t}=e;this.stateExists("ballPassed")||"touch"===t||(this.setState("ballPassed"),this._updateQBTimeAndDistanceMovedStat(),this.setBallCarrier(null),this.stateExists("curvePass")&&this._handleCurvePass(e))}_handleBallContactDuringInterception(e){return this.getState("interceptingPlayer").id!==e.player.id||this.stateExists("interceptionAttemptKicked")?this.handleUnsuccessfulInterception():"kick"===e.type?this._handleInterceptionKick(e):void 0}_handleInterceptionKick(e){this.setState("interceptionAttemptKicked"),this.setState("interceptionPlayerKickPosition",e.playerPosition),v.default.game.swapOffenseAndUpdatePlayers();const t=d.default.adjustRawEndPosition(e.playerPosition,v.default.game.offenseTeamId);this._setStartingPosition({x:t.x,y:t.y}),this.setBallCarrier(e.player,!1),setTimeout((()=>{if(this.stateExists("interceptionRuling"))return;const{xspeed:e}=r.default.getSpeed(),t=r.default.getPosition(),a=this.getState("interceptionBallPositionFirstTouch");return l.default.checkIfBallIsHeadedInIntTrajectory(e,a,t)?this.handleUnsuccessfulInterception():void 0}),3e3)}_handleInterceptionAttempt(e){return l.default.checkIfPlayerOutOfBounds(e.playerPosition)?this.handleUnsuccessfulInterception():(this.setState("interceptionAttempt"),this.setState("interceptingPlayer",e.player),this.setState("interceptionBallPositionFirstTouch",r.default.getPosition()),"kick"===e.type?this._handleInterceptionKick(e):void 0)}handleUnsuccessfulInterception(){return this.setState("interceptionRuling"),this.stateExists("interceptionAttemptKicked")&&v.default.game.swapOffenseAndUpdatePlayers(),this.endPlay({})}_handleRunTackle(e){if(!1===this.stateExists("runFirstTackler"))return this.setState("runFirstTackler",e.player),s.default.send("First tackle"),void setTimeout((()=>{this.setState("canSecondTackle")}),500);const t=this.getState("runFirstTackler").id===e.player.id;return!1===this.stateExists("canSecondTackle")&&t?void 0:this._handleTackle(e)}_handleRunTackleStats(e){const{netYards:t}=this._getPlayDataOffense(e.ballCarrierPosition);this._updateStatsIfNotTwoPoint(e.player.id,{tackles:.5});const a=this.getState("runFirstTackler");this._updateStatsIfNotTwoPoint(a.id,{tackles:.5}),this._updateStatsIfNotTwoPoint(this._ballCarrier.id,{rushingAttempts:1,rushingYards:t})}_handleSuccessfulInterception(){s.default.send(`${u.default.Target} Pass Intercepted!`);const e=this.getState("interceptingPlayer");if(this._updateStatsIfNotTwoPoint(e.id,{interceptionsReceived:1}),this._updateStatsIfNotTwoPoint(this._quarterback.id,{interceptionsThrown:1}),this.setState("interceptionRuling"),this.setState("ballIntercepted"),!this.stateExists("interceptionPlayerEndPosition"))return S.default.setPlayerAvatar(e.id,u.default.Football);const t=this.getState("interceptionPlayerEndPosition"),{endPosition:a}=this._getPlayDataOffense(t),{isSafety:n,isTouchback:i}=o.default.checkIfSafetyOrTouchbackPlayer(this.getState("interceptionPlayerKickPosition"),t,v.default.game.offenseTeamId);return n?this._handleSafety():i?this._handleTouchback():this.endPlay({newLosX:a.x,setNewDown:!0})}_handleInterceptionBallCarrierOutOfBounds(e){var t;if(this.stateExists("interceptionRuling")){const{endPosition:a,yardAndHalfStr:n}=this._getPlayDataOffense(e);s.default.send(`${null===(t=this._ballCarrier)||void 0===t?void 0:t.name.trim()} stepped out of bounds ${n}`);const{isSafety:i,isTouchback:r}=o.default.checkIfSafetyOrTouchbackPlayer(this.getState("interceptionPlayerKickPosition"),e,v.default.game.offenseTeamId);return i?this._handleSafety():r?this._handleTouchback():this.endPlay({newLosX:a.x,setNewDown:!0})}this.setState("interceptionPlayerEndPosition",e)}_handleTackle(e){const{endPosition:t,netYards:a,yardAndHalfStr:n,netYardsStr:i,yardsAfterCatch:r,yardsPassed:l}=this._getPlayDataOffense(e.ballCarrierPosition);if(o.default.checkIfSack(e.ballCarrierPosition,v.default.game.down.getLOS().x,v.default.game.offenseTeamId)&&!1===this.stateExists("ballRan")&&!1===this.stateExists("ballCaught")&&!1===this.stateExists("ballIntercepted")?(s.default.send(`${u.default.HandFingersSpread} ${e.player.name.trim()} with the SACK!`),this._updateStatsIfNotTwoPoint(e.player.id,{sacks:1}),this._updateStatsIfNotTwoPoint(e.player.id,{qbSacks:1})):s.default.send(`${u.default.HandFingersSpread} Tackle ${n} | ${i}`),this.stateExists("ballRan")?this._handleRunTackleStats(e):this._updateStatsIfNotTwoPoint(e.player.id,{tackles:1}),this._ballCarrier.id===this._quarterback.id&&this._updateStatsIfNotTwoPoint(this._ballCarrier.id,{rushingAttempts:1,rushingYards:a}),this.stateExists("ballCaught")){const{mapSection:e}=this._getStatInfo(this.getState("catchPosition"));if(this._updateStatsIfNotTwoPoint(this._ballCarrier.id,{receptions:{[e]:1},receivingYards:{[e]:a},receivingYardsAfterCatch:{[e]:r}}),this.stateExists("nearestDefenderToCatch")){const t=this.getState("nearestDefenderToCatch");this._updateStatsIfNotTwoPoint(t.id,{yardsAllowed:{[e]:a}})}this._updateStatsIfNotTwoPoint(this._quarterback.id,{passYards:{[e]:a},passYardsDistance:{[e]:l}})}const d=this.stateExists("catchPosition")?this.getState("catchPosition"):this._startingPosition;if(this.stateExists("ballIntercepted")){const{isSafety:t,isTouchback:a}=o.default.checkIfSafetyOrTouchbackPlayer(this.getState("interceptionBallPositionFirstTouch"),e.ballCarrierPosition,v.default.game.offenseTeamId);if(t)return this._handleSafety();if(a)return this._handleTouchback()}else{const{isSafety:t}=o.default.checkIfSafetyOrTouchbackPlayer(d,e.ballCarrierPosition,v.default.game.offenseTeamId);if(t)return this._handleSafety()}this.endPlay({newLosX:t.x,netYards:a,setNewDown:this.stateExists("ballIntercepted")})}_handleInterceptionTackle(e){if(this.stateExists("interceptionRuling"))return this._handleTackle(e);this.setState("interceptionPlayerEndPosition",e.playerPosition)}_handleTwoPointTouchdown(e){s.default.send(`${u.default.Fire} Two point conversion!`,{sound:2}),this.scorePlay(1,v.default.game.offenseTeamId,v.default.game.defenseTeamId)}_handleFailedTwoPointConversion(){s.default.send(`${u.default.X} Failed Two Point Conversion`),this.scorePlay(-1,v.default.game.offenseTeamId,v.default.game.defenseTeamId)}_makeOffenseBouncy(){v.default.game.players.getOffense().forEach((e=>{S.default.setPlayerDiscProperties(e.id,{bCoeff:.99,invMass:.55})}))}_updateQBTimeAndDistanceMovedStat(){const{position:e}=(0,y.getPlayerDiscProperties)(this._quarterback.id),t=v.default.game.down.getSnapPosition(),a=(new p.default).calcDifference3D(e,t).calculate(),n=(0,_.round)(a-g.MAP_POINTS.PLAYER_RADIUS,1),i=(0,_.round)(v.default.game.getTime()-this.time,1);this._updateStatsIfNotTwoPoint(this._quarterback.id,{distanceMovedBeforePassArr:[n],timeToPassArr:[i]})}_handleRegularTouchdown(e){var t,a,n,i;const{netYards:s,yardsPassed:r,yardsAfterCatch:o}=this._getPlayDataOffense(e);if((this.stateExistsUnsafe("ballRan")||(null===(t=this._ballCarrier)||void 0===t?void 0:t.id)===this._quarterback.id)&&this._updateStatsIfNotTwoPoint(null===(a=this._ballCarrier)||void 0===a?void 0:a.id,{rushingAttempts:1,rushingYards:s,touchdownsRushed:1}),this.stateExistsUnsafe("ballCaught")){const e=this.getState("catchPosition"),{mapSection:t}=this._getStatInfo(e);if(this._updateStatsIfNotTwoPoint(null===(n=this._ballCarrier)||void 0===n?void 0:n.id,{receptions:{[t]:1},receivingYards:{[t]:s},receivingYardsAfterCatch:{[t]:o},touchdownsReceived:1}),this.stateExists("nearestDefenderToCatch")){const e=this.getState("nearestDefenderToCatch");this._updateStatsIfNotTwoPoint(e.id,{yardsAllowed:{[t]:s}})}this._updateStatsIfNotTwoPoint(null===(i=this._quarterback)||void 0===i?void 0:i.id,{passYards:{[t]:s},passYardsDistance:{[t]:r},touchdownsThrown:1})}super.handleTouchdown(e)}}t.default=T;class w{constructor(e,t,a={}){this.penaltyName=e,this.player=t,this.penaltyData=a}}class x{constructor(e){this._player=e,this._playerPosition=(0,y.getPlayerDiscProperties)(this._player.id).position}_checkSnapOutOfBounds(){if(l.default.checkIfPlayerOutOfBounds(this._playerPosition))throw new w("snapOutOfBounds",this._player)}_checkSnapWithinHashes(){if(!l.default.checkIfWithinHash(this._playerPosition,g.MAP_POINTS.PLAYER_RADIUS))throw new w("snapOutOfHashes",this._player)}_checkQBOnside(){if(l.default.findTeamPlayerOffside([this._player],v.default.game.offenseTeamId,v.default.game.down.getLOS().x))throw new w("offsidesOffense",this._player)}validate(){try{this._checkSnapWithinHashes(),this._checkSnapOutOfBounds(),this._checkQBOnside()}catch(e){if(e instanceof w){const{penaltyName:t,player:a,penaltyData:n}=e;return{valid:!1,penaltyName:t,player:a,penaltyData:n}}console.log(e)}return{valid:!0}}}},4208:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5693)),s=n(a(1858)),r=n(a(2992)),o=n(a(8375)),l=n(a(4340)),d=n(a(7872));class u extends d.default{onBallContact(e){this.stateExists("ballRan")||this.stateExists("fieldGoalBlitzed")||super.onBallContact(e)}onBallOutOfBounds(e){this.handleUnsuccessfulFg("Missed")}onBallCarrierOutOfBounds(e){var t;const{endPosition:a,netYards:n,yardAndHalfStr:o,isTouchdown:d}=this._getPlayDataOffense(e);if(d)return this.handleTouchdown(e);i.default.send(`${l.default.Pushpin} ${this.getBallCarrier().name.trim()} went out of bounds ${o}`);const{isSafety:u,isTouchback:c}=r.default.checkIfSafetyOrTouchbackPlayer(this._startingPosition,a,s.default.game.offenseTeamId);return s.default.game.stats.updatePlayerStat(null===(t=this._ballCarrier)||void 0===t?void 0:t.id,{rushingAttempts:1,rushingYards:n}),u?this._handleSafety():c?this._handleTouchback():void this.endPlay({newLosX:a.x,netYards:n})}onBallCarrierContactOffense(e){const{player:t,playerPosition:a,ballCarrierPosition:n}=e;if(o.default.checkIfBehind(a.x,n.x,t.team))return this._handleRun(e);this.stateExists("fieldGoalKicked")||this._handlePenalty("illegalRun",t)}onBallCarrierContactDefense(e){if(this.stateExists("ballRan"))return this._handleRunTackle(e);this._handleTackle(e)}onKickDrag(){this._handlePenalty("fgDrag",this._kicker)}_onBallContactDefense(e){this.stateExists("fieldGoalKicked")||this.setState("fieldGoalBlitzed")}_onBallContactOffense(e){const{player:t}=e;if(t.id===this._kicker.id)return this._handleBallContactKicker(e)}}t.default=u},9378:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5693)),s=n(a(9972)),r=n(a(2992)),o=n(a(8375)),l=n(a(4340)),d=n(a(7872)),u=n(a(1858));class c extends d.default{onBallCarrierContactDefense(e){const{endPosition:t,netYards:a,yardAndHalfStr:n,netYardsStr:s}=this._getPlayDataOffense(e.ballCarrierPosition);i.default.send(`${l.default.HandFingersSpread} Tackle ${n} | ${s}`),u.default.game.stats.updatePlayerStat(this._ballCarrier.id,{specReceptions:1,specReceivingYards:a}),u.default.game.stats.updatePlayerStat(e.player.id,{specTackles:1});const{isSafety:o,isTouchback:d}=r.default.checkIfSafetyOrTouchbackPlayer(this._startingPosition,t,u.default.game.offenseTeamId);return o?super._handleSafety():d?super._handleTouchback():void this.endPlay({newLosX:t.x,netYards:a})}onBallCarrierContactOffense(e){}onBallCarrierOutOfBounds(e){const{endPosition:t,yardAndHalfStr:a,netYards:n,netYardsStr:s,isTouchdown:o}=this._getPlayDataOffense(e);if(o)return this.handleTouchdown(e);i.default.send(`${this.getBallCarrier().name.trim()} went out of bounds ${a} | ${s}`),u.default.game.stats.updatePlayerStat(this._ballCarrier.id,{specReceptions:1,specReceivingYards:n});const{isSafety:l,isTouchback:d}=r.default.checkIfSafetyOrTouchbackPlayer(this._startingPosition,t,u.default.game.offenseTeamId);return l?super._handleSafety():d?super._handleTouchback():void this.endPlay({newLosX:t.x})}onBallContact(e){this.stateExists("kickOffCaught")||super.onBallContact(e)}onBallOutOfBounds(e){if(r.default.checkIfTouchbackBall(e,u.default.game.offenseTeamId))return this._handleTouchback();this._handleBallOutOfBounds(e)}onKickDrag(e){const t=u.default.game.players.getFielded(),{player:a}=o.default.getNearestPlayerToPosition(t,s.default.getPosition());!1===this.stateExists("kickOffKicked")&&u.default.game.swapOffenseAndUpdatePlayers(),this._handleOffensePenalty(a,"drag")}_onBallContactDefense(e){const{yardAndHalfStr:t,endPosition:a}=this._getPlayDataOffense(e.playerPosition);i.default.send(`${l.default.Pushpin} Ball downed by defense ${t}`);const{isTouchback:n}=r.default.checkIfSafetyOrTouchbackPlayer(a,a,u.default.game.offenseTeamId);if(n)return this._handleTouchback();this.endPlay({newLosX:a.x})}_onBallContactOffense(e){if(!1!==this.stateExists("kickOffKicked"))this._handleCatch(e);else if("kick"===e.type){this.setState("kickOffKicked"),this.setState("KickOffKicker",e.player);const{isOffsides:t,offsidesPlayer:a}=this._checkIfOffenseOffsidesOnKick();if(u.default.game.swapOffenseAndUpdatePlayers(),t)return this._handleOffensePenalty(a,"offsidesOffense")}}}t.default=c},2009:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5693)),s=n(a(1858)),r=n(a(2992)),o=n(a(4340)),l=n(a(7872));class d extends l.default{onBallCarrierContactOffense(e){}onBallCarrierContactDefense(e){const{endPosition:t,netYards:a,yardAndHalfStr:n,netYardsStr:l}=this._getPlayDataOffense(e.ballCarrierPosition);i.default.send(`${o.default.HandFingersSpread} Tackle ${n} | ${l}`),s.default.game.stats.updatePlayerStat(this._ballCarrier.id,{specReceptions:1,specReceivingYards:a}),s.default.game.stats.updatePlayerStat(e.player.id,{specTackles:1});const{isSafety:d}=r.default.checkIfSafetyOrTouchbackPlayer(this._startingPosition,t,s.default.game.offenseTeamId);if(d)return super._handleSafety();this.endPlay({newLosX:t.x,netYards:a})}onBallCarrierOutOfBounds(e){if(!1===this.stateExists("onsideKickKicked"))return this._handleUnsuccessfulOnsideKick("Kicker went out of bounds");const{endPosition:t,yardAndHalfStr:a,netYards:n,netYardsStr:o}=this._getPlayDataOffense(e);i.default.send(`${this.getBallCarrier().name.trim()} went out of bounds ${a} | ${o}`),s.default.game.stats.updatePlayerStat(this._ballCarrier.id,{specReceptions:1,specReceivingYards:n});const{isSafety:l}=r.default.checkIfSafetyOrTouchbackPlayer(this._startingPosition,t,s.default.game.offenseTeamId);if(l)return super._handleSafety();this.endPlay({newLosX:t.x})}onBallContact(e){this.stateExists("onsideKickCaught")||super.onBallContact(e)}onBallOutOfBounds(e){this._handleUnsuccessfulOnsideKick("Kick went out of bounds")}onKickDrag(e){this._handlePenalty("onsideKickDrag",this._kicker),this._handleUnsuccessfulOnsideKick(null)}_onBallContactDefense(e){return e.player.id===this._kicker.id?this._handleBallContactKicker(e):this._handleUnsuccessfulOnsideKick("Illegaly touched by kicking team")}_onBallContactOffense(e){return e.player.id===this._kicker.id?this._handleBallContactKicker(e):!1===this.stateExists("onsideKickKicked")?this._handleUnsuccessfulOnsideKick("Illegaly touched by kicking team"):void this._handleCatch(e)}}t.default=d},4016:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(9972)),s=n(a(5693)),r=n(a(1858)),o=a(5697),l=n(a(2992)),d=n(a(8375)),u=n(a(4175)),c=n(a(4064)),f=n(a(4340)),h=n(a(7872));class m extends h.default{onBallContact(e){this.stateExists("puntCaught")||super.onBallContact(e)}onBallOutOfBounds(e){const t=c.default.adjustBallPositionOnOutOfBounds(e,r.default.game.offenseTeamId),a=o.DistanceConverter.toYardLine(t.x),n=u.default.formatYardAndHalfStr(a,t.x);if(s.default.send(`${f.default.Pushpin} Ball went out of bounds ${n}`),l.default.checkIfTouchbackBall(e,r.default.game.offenseTeamId))return this._handleTouchback();this._endPlayAndSetNewDown({newLosX:t.x})}onBallCarrierOutOfBounds(e){const{endPosition:t,yardAndHalfStr:a,netYards:n,netYardsStr:i,isTouchdown:o}=this._getPlayDataOffense(e);if(o)return this.handleTouchdown(e);s.default.send(`${this.getBallCarrier().name.trim()} went out of bounds ${a} | ${i}`),r.default.game.stats.updatePlayerStat(this._ballCarrier.id,{specReceptions:1,specReceivingYards:n});const{isSafety:d,isTouchback:u}=l.default.checkIfSafetyOrTouchbackPlayer(this._startingPosition,t,r.default.game.offenseTeamId);return d?super._handleSafety():u?super._handleTouchback():void this._endPlayAndSetNewDown({newLosX:t.x})}onBallCarrierContactOffense(e){}onBallCarrierContactDefense(e){const{endPosition:t,netYards:a,yardAndHalfStr:n,netYardsStr:i}=this._getPlayDataOffense(e.ballCarrierPosition);s.default.send(`${f.default.HandFingersSpread} Tackle ${n} | ${i}`),r.default.game.stats.updatePlayerStat(this._ballCarrier.id,{specReceptions:1,specReceivingYards:a}),r.default.game.stats.updatePlayerStat(e.player.id,{specTackles:1});const{isSafety:o,isTouchback:d}=l.default.checkIfSafetyOrTouchbackPlayer(this._startingPosition,t,r.default.game.offenseTeamId);return o?super._handleSafety():d?super._handleTouchback():void this._endPlayAndSetNewDown({newLosX:t.x,netYards:a})}onKickDrag(e){const t=r.default.game.players.getFielded(),{player:a}=d.default.getNearestPlayerToPosition(t,i.default.getPosition());this._handleOffensePenalty(a,"puntDrag")}_onBallContactOffense(e){const{player:t}=e;if(!1!==this.stateExists("puntKicked"))this._handleCatch(e);else if("kick"===e.type){this.setState("puntKicked"),this.setState("puntKicker",t),this._releaseInvisibleWallForDefense(),r.default.game.swapOffenseAndUpdatePlayers();const{isOffsides:e,offsidesPlayer:a}=this._checkIfOffenseOffsidesOnKick(t);if(e)return this._handleOffensePenalty(a,"puntOffsidesOffense")}}_onBallContactDefense(e){const{yardAndHalfStr:t,endPosition:a}=this._getPlayDataOffense(e.playerPosition);s.default.send(`${f.default.Pushpin} Ball downed by defense ${t}`);const{isTouchback:n}=l.default.checkIfSafetyOrTouchbackPlayer(this._startingPosition,a,r.default.game.offenseTeamId);if(n)return this._handleTouchback();this._endPlayAndSetNewDown({newLosX:a.x})}}t.default=m},3160:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5693)),s=n(a(1858)),r=n(a(2992)),o=n(a(8375)),l=n(a(4340)),d=n(a(7872));class u extends d.default{onBallContact(e){if(!(this.stateExists("ballCaught")||this.stateExists("ballRan")||this.stateExists("ballBlitzed")||this.stateExists("interceptionRuling")))return this.stateExists("interceptionAttempt")?this._handleBallContactDuringInterception(e):void super.onBallContact(e)}onBallOutOfBounds(e){if(this.stateExists("interceptionAttempt"))return r.default.checkIfInterceptionSuccessful(e)?this._handleSuccessfulInterception():this.handleUnsuccessfulInterception();const{mapSection:t}=this._getStatInfo(e);return this._updateStatsIfNotTwoPoint(this.getQuarterback().id,{passAttempts:{[t]:1}}),this.stateExists("curvePass")&&this._updateStatsIfNotTwoPoint(this.getQuarterback().id,{curvedPassAttempts:1}),i.default.send(`${l.default.DoNotEnter} Incomplete - Pass out of bounds!`),this.endPlay({})}onBallCarrierOutOfBounds(e){var t,a,n;if(this.stateExists("interceptionAttempt"))return this._handleInterceptionBallCarrierOutOfBounds(e);const o=this.stateExists("catchPosition")?this.getState("catchPosition"):this._startingPosition,{endPosition:d,netYards:u,yardAndHalfStr:c,netYardsStr:f,yardsPassed:h,yardsAfterCatch:m,isTouchdown:y}=this._getPlayDataOffense(e);if(y)return this.handleTouchdown(e);i.default.send(`${l.default.Pushpin} ${this.getBallCarrier().name.trim()} stepped out of bounds ${c} | ${f}`);const{isSafety:g}=r.default.checkIfSafetyOrTouchbackPlayer(o,d,s.default.game.offenseTeamId);if(this.getQuarterback().id===(null===(t=this._ballCarrier)||void 0===t?void 0:t.id)||this.stateExists("ballRan"))this._updateStatsIfNotTwoPoint(null===(a=this._ballCarrier)||void 0===a?void 0:a.id,{rushingAttempts:1,rushingYards:u});else{const e=this.getState("catchPosition"),{mapSection:t}=this._getStatInfo(e);if(this._updateStatsIfNotTwoPoint(null===(n=this._ballCarrier)||void 0===n?void 0:n.id,{receptions:{[t]:1},receivingYards:{[t]:u},receivingYardsAfterCatch:{[t]:m}}),this.stateExists("nearestDefenderToCatch")){const e=this.getState("nearestDefenderToCatch");this._updateStatsIfNotTwoPoint(e.id,{yardsAllowed:{[t]:u}})}this._updateStatsIfNotTwoPoint(this.getQuarterback().id,{passYards:{[t]:u},passYardsDistance:{[t]:h}})}if(g)return this._handleSafety();this.endPlay({newLosX:d.x,netYards:u})}onBallCarrierContactOffense(e){const{player:t,playerPosition:a,ballCarrierPosition:n}=e;if(o.default.checkIfBehind(a.x,n.x,t.team))return this._handleRun(e);this._handlePenalty("illegalRun",t)}onBallCarrierContactDefense(e){return this.stateExists("interceptingPlayer")?this._handleInterceptionTackle(e):this.stateExists("ballRan")?this._handleRunTackle(e):void this._handleTackle(e)}onKickDrag(e){this.setState("ballDragged"),this._startBallMoveBlitzClock()}_onBallContactDefense(e){if(!this.stateExists("ballPassed"))return this.setState("ballBlitzed");const{mapSection:t}=this._getStatInfo(e.playerPosition);if(this._updateStatsIfNotTwoPoint(e.player.id,{passDeflections:{[t]:1}}),this._updateStatsIfNotTwoPoint(this.getQuarterback().id,{passAttempts:{[t]:1}}),this.stateExists("curvePass")&&this._updateStatsIfNotTwoPoint(this.getQuarterback().id,{curvedPassAttempts:1}),i.default.send(`${l.default.DoNotEnter} Incomplete - Pass Deflected`),this.setState("ballDeflected"),this.stateExists("twoPointAttempt"))return this._handleFailedTwoPointConversion();this._handleInterceptionAttempt(e)}_onBallContactOffense(e){if(this.stateExists("ballDeflected"))return this._handleBallContactDuringInterception(e);const{player:t}=e,{id:a}=t;return a===this.getQuarterback().id?this._handleBallContactQuarterback(e):!1===this.stateExists("ballPassed")?this._handleIllegalTouch(e):void this._handleCatch(e)}}t.default=u},7701:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEBUG_MODE=void 0,t.DEBUG_MODE=!1,t.default={roomName:"🏈 HAXFOOTBALL 🏈",maxPlayers:14,noPlayer:!0,public:!0,token:"thr1.AAAAAGMyZ8hubkFRaDCLmg.WTyVSHBPFF4"}},9972:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=a(4798),s=n(a(5198)),r=a(3279);t.default=new class{constructor(){this.IMMOVABLE_INV_MASS=1e-5}getPosition(){return s.default.getBallPosition()}getSpeed(){const{xspeed:e,yspeed:t}=s.default.getDiscProperties(i.DISC_IDS.BALL);return{xspeed:e,yspeed:t}}setPosition(e){const{x:t,y:a=0}=e;return s.default.setDiscProperties(i.DISC_IDS.BALL,{x:t,y:a,xspeed:0,yspeed:0,ygravity:0}),this}suppress(){return s.default.setDiscProperties(i.DISC_IDS.BALL,{invMass:this.IMMOVABLE_INV_MASS,xspeed:0,yspeed:0}),this}release(){return s.default.setDiscProperties(i.DISC_IDS.BALL,{invMass:1,xspeed:0,yspeed:0}),this}makeImmovableButKeepSpeed(){return s.default.setDiscProperties(i.DISC_IDS.BALL,{invMass:this.IMMOVABLE_INV_MASS}),this}score(e){const t=e===r.TEAMS.BLUE?i.MAP_POINTS.BLUE_SCORE_LINE:i.MAP_POINTS.RED_SCORE_LINE;s.default.setDiscProperties(i.DISC_IDS.BALL,{x:t,y:-200,xspeed:0,yspeed:0,ygravity:.015,invMass:this.IMMOVABLE_INV_MASS})}setGravity({x:e,y:t}){return"number"==typeof e&&s.default.setDiscProperties(i.DISC_IDS.BALL,{xgravity:e}),"number"==typeof t&&s.default.setDiscProperties(i.DISC_IDS.BALL,{ygravity:t}),this}removeGravity(){return s.default.setDiscProperties(i.DISC_IDS.BALL,{invMass:1,xspeed:0,ygravity:0}),this}}},5693:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MESSAGE_STYLE=void 0;const i=n(a(5198)),s=n(a(4175)),r=n(a(7117)),o=n(a(4340));t.MESSAGE_STYLE={Bold:"bold",Italic:"italic",Small:"small",Small_bold:"small-bold",Small_italic:"small-italic"},t.default=new class{constructor(){this.PREFIX={TEAMCHAT:"t",COMMAND:"!"},this.silenced=!1}_getAutoSizedStyle(e,a){return e.length>=100?t.MESSAGE_STYLE.Small:a}_sendMessage(e,t){const{icon:a="",info:n="",id:s=null,color:r=null,style:o=null,sound:l=null,autoSize:d=!0}=t,u=[a,n,e].map((e=>e.length>0?e+" ":e)).join("").trim(),c=null===o&&d?this._getAutoSizedStyle(e,o):o;i.default.sendAnnouncement(u,s,r,c,l)}send(e,t={}){this._sendMessage(e,t)}sendMessageMaybeWithClock(e,t){const a=s.default.formatMessageMaybeWithClock(e,t);this._sendMessage(a,{})}sendSuccess(e,t={}){t.icon=o.default.GreenCheck,t.color=r.default.Lime,this._sendMessage(e,t)}sendAnnouncement(e,t={}){t.color=r.default.Orange,this._sendMessage(e,t)}sendNotification(e,t={}){t.icon=o.default.Bell,t.sound=2,this._sendMessage(e,t)}sendWarning(e,t={}){t.icon=o.default.OrangeTriangle,t.sound=2,this._sendMessage(e,t)}sendError(e,t={}){t.icon=o.default.Exclamation,t.color=r.default.LightRed,this._sendMessage(e,t)}sendBotError(e,t={}){t.icon=o.default.Construction,t.color=r.default.Yellow,this._sendMessage(e,t)}}},3768:function(e,t,a){var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var i=Object.getOwnPropertyDescriptor(t,a);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,i)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(a(5693)),l=s(a(5256)),d=r(a(4999)),u=s(a(7202)),c=r(a(5382)),f=r(a(7117)),h=r(a(1858)),m=a(3279);t.default=class{static handleOffensiveMessage(e){return!1}static maybeHandleTeamChat(e){if(e.author.team===m.TEAMS.SPECTATORS)return!1;const t=e.author.team===m.TEAMS.RED?h.default.players.getRed():h.default.players.getBlue(),a=e.author.team===m.TEAMS.RED?f.default.HaxballRed:f.default.HaxballBlue,n=e.content.substring(o.default.PREFIX.TEAMCHAT.length).trim(),i=`${e.author.shortName}: ${n}`;return t.forEach((e=>{o.default.send(i,{color:a,id:e.id})})),!1}static handlePlayerMuted(e){return e.reply("You are muted"),!1}static handleChatSilenced(e){return e.reply("The chat is silenced"),!1}static maybeHandleCommand(e){const t=new c.default(e.content,e.author),a=new u.default(t);try{if(!a.loadCommand())throw new u.CommandError(`Command ${t.commandName} does not exist`);a.validateAndRun()}catch(t){if(t instanceof u.CommandError){const a=t;e.replyError(a.errorMsg)}else o.default.sendBotError(t.message);return!1}return!1}static handleGameCommand(e){const t=d.default.get(e.content.toLowerCase());try{new l.default(e,t).validateAndRun()}catch(t){if(t instanceof l.GameCommandError){const a=t;a.sendToPlayer&&e.replyError(a.message)}else o.default.sendBotError(t.message);return!1}return t.showCommand}}},8224:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5693)),s=n(a(7117));t.default=class{static greetPlayer(e){i.default.send("!rules for rules, !stats for stats",{id:e.id,color:s.default.LightBlue})}}},1285:function(e,t,a){var n=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function o(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(a(5693)),r=a(2665),o=[{text:"!stats or !stats partialplayername to view your stats or that of another player",weight:.3},{text:"Join our Discord discord.gg/VdrD2p7",weight:.3}];t.default=class{static run(){setInterval((()=>n(this,void 0,void 0,(function*(){const e=(0,r.randFromArrayWeighted)(o).text;s.default.send(e,{sound:0})}))),14e4)}}},3445:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5198)),s=n(a(1858)),r=n(a(3517)),o=a(2781),l=a(3279),d=a(2665);t.default=class{constructor(){this.records=new r.default,this._playersStatic={fielded:[],offense:[],defense:[]},this.playerPositionsMap=new Map}savePlayerPositions(){this._playersStatic.fielded.forEach((e=>{const{position:t}=(0,o.getPlayerDiscProperties)(e.id);this.playerPositionsMap.set(e.id,{team:e.team,position:t})}))}updateStaticPlayerList(e){const t=i.default.getPlayerList().filter((e=>0!==e.team)),[a,n]=(0,d.partition)(t,(t=>t.team===e));this._playersStatic={fielded:t,offense:a,defense:n}}getFielded(){return this._playersStatic.fielded}getDefense(){return this._playersStatic.defense}getOffense(){return this._playersStatic.offense}getOffenseDefense(){return{offense:this._playersStatic.offense,defense:this._playersStatic.defense}}handlePlayerTeamChange(e,t){const{playerRecord:a,hasPlayerRecord:n}=this._getPlayerRecordSubIn(e.id);return!1===n?this.subIn(e,t):e.team===l.TEAMS.SPECTATORS?this.subOut(e,t,{}):0!==a.substitutions.length&&a.substitutions[a.substitutions.length-1].toTeam!==l.TEAMS.SPECTATORS?(this.subOut(e,t,{}),this.subIn(e,t)):this.subIn(e,t)}getPlayerRecordById(e){return this.records.findOne({ids:[e]})}subIn(e,t){const{playerRecord:a,hasPlayerRecord:n,playerProfile:i}=this._getPlayerRecordSubIn(e.id);if(n){const n=a.substitutions[a.substitutions.length-1];if("IN"===(null==n?void 0:n.type))throw Error(`Player ${i.name} was attempted to be subbed in but is already on the field`);return a.substitutions.push({time:t,type:"IN",fromTeam:a.team,toTeam:e.team}),a.team=e.team,a.ids=[...a.ids,e.id],a.name=e.name,a.recordId}return this.records.set(i.id,{auth:i.auth,recordId:i.id,ids:[i.id],name:i.name,ip:i.ip,team:e.team,substitutions:[{time:t,type:"IN",fromTeam:l.TEAMS.SPECTATORS,toTeam:e.team}],wasAtEndOfGame:!1}),i.id}subOut(e,t,a){const n=this._getPlayerRecordSubOut(e.id),{isAtGameEnd:i=!1,wasLeave:s=!1}=a;if(0===n.substitutions.length)throw Error(`Player ${n.name} was subbed out, but did not have a record of being subbed in`);return n.substitutions.push({time:t,type:"OUT",fromTeam:n.team,toTeam:l.TEAMS.SPECTATORS,wasLeave:s}),i&&(n.wasAtEndOfGame=!0),n.recordId}_getPlayerRecordSubOut(e){const t=this.records.findOne({ids:[e]});if(!t)throw Error(`No player record found with ID ${e}`);return t}_getPlayerRecordSubIn(e){const t=s.default.players.playerCollection.get(e);if(!t)throw Error(`No player profile found for id ${e}`);const a=this.records.findOne({auth:t.auth});return{playerRecord:a,hasPlayerRecord:Boolean(a),playerProfile:t}}}},1288:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(3517));t.default=class{constructor(){this.mutedCollection=new i.default}addMute(e){const t={name:e.name,auth:e.auth,id:e.id};this.mutedCollection.set(e.auth,t)}removeMute(e){this.mutedCollection.delete(e)}}},5233:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5198)),s=n(a(1842)),r=n(a(3517)),o=a(3279),l=n(a(1288));t.default=class{constructor(){this.playerCollection=new r.default,this.muted=new l.default}findOne(e){return this.playerCollection.findOne(e)}find(e){return this.playerCollection.find(e)}getByName(e){const t=this.getPlayable(),a=t.find((t=>t.lowerName===e));if(a)return a;const n=t.filter((t=>t.lowerName.startsWith(e)));return n.length>1?-1:0===n.length?null:n[0]}createAndAdd(e){const t=this._createPlayer(e);return this.playerCollection.set(e.id,t),t}delete(e){const t=this.playerCollection.get(e.id);return t?(this.playerCollection.delete(e.id),t):null}getPlayable(){return this._sortByOrderInPlayerList(this.playerCollection.find({canPlay:!0,isAFK:!1}))}getPlayableSpecs(){return this._sortByOrderInPlayerList(this.playerCollection.find({canPlay:!0,team:o.TEAMS.SPECTATORS,isAFK:!1}))}getRed(){return this._sortByOrderInPlayerList(this.playerCollection.find({team:o.TEAMS.RED}))}getBlue(){return this._sortByOrderInPlayerList(this.playerCollection.find({team:o.TEAMS.BLUE}))}getFielded(){return this._sortByOrderInPlayerList(this.playerCollection.find().filter((e=>e.team!==o.TEAMS.SPECTATORS)))}_createPlayer(e){return new s.default(e)}_sortByOrderInPlayerList(e){const t=i.default.getPlayerList(),a=t.reduce(((e,a)=>(e[a.id]=t.findIndex((e=>e.id===a.id)),e)),{});return e.sort(((e,t)=>a[e.id]-a[t.id]))}}},1858:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(4131)),s=n(a(7826)),r=a(2665),o=n(a(1285)),l=n(a(5233));t.default=new class{constructor(){this.sessionId=(0,r.getRandomChars)(4).toLowerCase(),this.roomId=1,this.players=new l.default,this._game=null,this._isBotOn=!0,this._playerTestingId=1}onRoomLoad(){o.default.run(),console.log(`Admin Code: ${this.sessionId}`)}get game(){return this._game}get isBotOn(){return this._isBotOn}turnBotOff(){this._isBotOn=!1}turnBotOn(){this._isBotOn=!0}getPlayerTestingId(){return this._playerTestingId}setPlayerTestingId(e){this._playerTestingId=e}getPlay(){if(!this.game.play)throw new Error("Game Error: Play is not defined");return this.game.play}startNewGame(){this._game=new i.default;const e=this.players.getFielded();this._game.players.updateStaticPlayerList(this.game.offenseTeamId),e.forEach((e=>{const t=this._game.players.subIn(e.playerObject,0);this._game.stats.maybeCreateStatProfile(t)})),this.game.setPlay(new s.default(0),null)}}},5697:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DistanceConverter=void 0;const i=a(4798),s=a(3279),r=a(2665),o=n(a(8375));class l{static toYardLine(e){return(i.MAP_POINTS.HALF_FIELD-Math.abs(e))/i.MAP_POINTS.YARD}static toYard(e){return e/i.MAP_POINTS.YARD}static yardToDistance(e){return e*i.MAP_POINTS.YARD}}t.DistanceConverter=l;class d{constructor(e=0){this._calculation=e}calcDifference2D(e,t){return this._calculation=Math.abs(e-t),this}calcDifference3D(e,t){const a=e.x-t.x,n=e.y-t.y;return this._calculation=Math.hypot(a,n),this}calcNetDifferenceByTeam(e,t,a){const n=e-t;return a===s.TEAMS.RED?(n>0&&(this._calculation=-n),n<0&&(this._calculation=Math.abs(n))):this._calculation=n,this}subtractByTeam(e,t,a){return this._calculation=a===s.TEAMS.RED?e-t:e+t,this}addByTeam(e,t,a){return this._calculation=a===s.TEAMS.RED?e+t:e-t,this}constrainToEndzonePoints(){const e=(0,r.limitNumberWithinRange)(this._calculation,i.MAP_POINTS.RED_GOAL_LINE,i.MAP_POINTS.BLUE_GOAL_LINE);return this._calculation=e,this}roundUpToYardIfBetweenTeamEndzoneAndOneYard(e){const t=o.default.getTeamEndzone(e),a=(new d).addByTeam(t,i.MAP_POINTS.YARD,e).calculate(),n=o.default.checkIfBehind(this._calculation,a,e),s=o.default.checkIfInFront(this._calculation,t,e);return n&&s&&(this._calculation=a),this}roundToYardByTeam(e){const{YARD:t}=i.MAP_POINTS;return this._calculation=e===s.TEAMS.RED?t*Math.floor(this._calculation/t):t*Math.ceil(this._calculation/t),this}calculate(){return this._calculation}calculateAndConvert(){return{distance:this._calculation,yards:l.toYard(this._calculation),yardLine:l.toYardLine(this._calculation)}}}t.default=d},4198:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=a(4798),i=a(3279),s=a(2665);t.default=new class{constructor(){this.formatPositionToMapHalf=e=>e>n.MAP_POINTS.KICKOFF?"BLUE ":ee>n.MAP_POINTS.KICKOFF?i.TEAMS.BLUE:i.TEAMS.RED}formatRedZonePenalties(e){return 0===e?"":` [${e}/3]`}formatDown(e){return(0,s.toOrdinalSuffix)(e)}formatYardsToGain(e,t){return e<=n.MAP_POINTS.RED_GOAL_LINE||e>=n.MAP_POINTS.BLUE_GOAL_LINE?"GOAL":t}}},2992:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=a(4798),s=a(3279),r=n(a(8375)),o=n(a(4064));class l{static checkIfSafetyBall(e,t){return r.default.getEndZonePositionIsIn(e)===t}static checkIfSack(e,t,a){return r.default.checkIfBehind(e.x,t,a)}static checkIfTouchbackBall(e,t){return r.default.getEndZonePositionIsIn(e)===t}static checkIfTouchdown(e,t){const a=o.default.adjustPlayerPositionFront(e,t),n=r.default.getEndZonePositionIsIn(a);return Boolean(n)&&n!==t}static checkIfFieldGoalSuccessful(e,t){const{x:a,y:n}=e,{RED_FIELD_GOAL_LINE:o,BLUE_FIELD_GOAL_LINE:l,TOP_FG_POST:d,BOTTOM_FG_POST:u}=i.MAP_POINTS,c=t===s.TEAMS.RED?a>l:a{const n=r.default.getEndZonePositionIsIn({x:t.x,y:t.y});return n&&n===a?Boolean(r.default.getEndZonePositionIsIn(e))?{isSafety:!1,isTouchback:!0}:{isSafety:!0,isTouchback:!1}:{isSafety:!1,isTouchback:!1}}},8375:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=a(2781),s=a(4798),r=a(3279),o=a(2665),l=n(a(5697)),d=n(a(4064));t.default=new class{constructor(){this.getEndZonePositionIsIn=e=>{const{RED_GOAL_LINE:t,BLUE_GOAL_LINE:a}=s.MAP_POINTS;return e.x<=t?1:e.x>=a?2:null},this.checkIfBallOutOfBounds=e=>this._checkIfOutOfBounds(e,s.MAP_POINTS.BALL_RADIUS)?e:null,this.getOpposingTeamEndzone=e=>e===r.TEAMS.RED?s.MAP_POINTS.BLUE_GOAL_LINE:s.MAP_POINTS.RED_GOAL_LINE}_checkIfOutOfBounds(e,t){const{x:a,y:n}=e,{topSideLine:i,botSideLine:s,redSideLine:r,blueSideLine:o}=d.default.adjustMapCoordinatesForRadius(t);return ns||ao}findTeamPlayerOffside(e,t,a){return e.find((e=>{const{position:n}=(0,i.getPlayerDiscProperties)(e.id),{x:s}=d.default.adjustPlayerPositionFront(n,t);return!this.checkIfBehind(s,a,t)}))}findTeamPlayerOffsideNoAdjust(e,t,a){return e.find((e=>{const{position:{x:n}}=(0,i.getPlayerDiscProperties)(e.id);return!this.checkIfBehind(n,a,t)}))}findAllTeamPlayerOffside(e,t,a){return e.filter((e=>{const{position:{x:n}}=(0,i.getPlayerDiscProperties)(e.id),r=(new l.default).addByTeam(n,s.MAP_POINTS.PLAYER_RADIUS,t).calculate();return!1===this.checkIfBehind(r,a,t)}))}checkIfPlayerOutOfBounds(e){return this._checkIfOutOfBounds(e,s.MAP_POINTS.PLAYER_RADIUS)?e:null}checkIfBallInFrontOfLOS(e,t,a){return this.checkIfInFront(e.x,t,a)}checkIfBallDragged(e,t,a){return(new l.default).calcDifference3D(e,t).calculate()>a}checkIfInRedzone(e){return e>=s.MAP_POINTS.BLUE_REDZONE?r.TEAMS.BLUE:e<=s.MAP_POINTS.RED_REDZONE?r.TEAMS.RED:null}checkIfBehind(e,t,a){return a===r.TEAMS.RED?e<=t:e>=t}checkIfInFront(e,t,a){return a===r.TEAMS.RED?e>=t:e<=t}checkIfBallBetweenFGPosts(e,t){const{topFG:a,botFG:n,redFG:i,blueFG:r}=d.default.adjustMapCoordinatesForRadius(s.MAP_POINTS.BALL_RADIUS),o=1===t?this.checkIfBehind(e.x,i,1):this.checkIfBehind(e.x,r,2),l=this.checkIfBetweenY(e.y,a,n);return o&&l}checkIfBetweenY(e,t,a){return e>=t&&e<=a}checkIfWithinHash(e,t){const{y:a}=e,{topHash:n,botHash:i}=d.default.adjustMapCoordinatesForRadius(t);return a>n&&a.05}getTeamEndzone(e){return e===r.TEAMS.RED?s.MAP_POINTS.RED_GOAL_LINE:s.MAP_POINTS.BLUE_GOAL_LINE}getClosestPositionToOtherPosition(e,t){return e.reduce(((e,a,n)=>{const i=(new l.default).calcDifference3D(a,t).calculate();return null===e.distanceToPosition||i{const{position:t}=(0,i.getPlayerDiscProperties)(e.id);return t||null})).filter((e=>null!==e));if(0===a.length)return null;const{index:n,distanceToPosition:s}=this.getClosestPositionToOtherPosition(a,t);return{player:e[n],distanceToPosition:s}}getIntendedTargetStr(e,t,a){const n=3*s.MAP_POINTS.YARD;e=e.filter((e=>e.id!==a));const i=this.getNearestPlayerToPosition(e,t);if(null===i||null===i.distanceToPosition)return"";const{player:r,distanceToPosition:o}=i;return r&&o>n?"":`intended for ${r.name.trim()} `}getMapHalfFromPoint(e){return e>s.MAP_POINTS.KICKOFF?r.TEAMS.BLUE:e0?`+${t}`:e<0?`-${t}`:"no gain"}static formatNetYardsMessageFull(e){const t=(0,s.plural)(Math.abs(e),"yard","yards");return e>0?`for a gain of ${t}`:e<0?`for a loss of ${t}`:"for no gain"}static formatMessageMaybeWithClock(e,t){return`${e} ${t>=720?(0,i.toClock)(t):""}`}static formatMapSectionName(e){return{cornerBottom:"bottom corner",cornerTop:"top corner",deep:"deep",middle:"middle",backwards:"backwards"}[e]}}},2994:function(e,t,a){var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var i=Object.getOwnPropertyDescriptor(t,a);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,i)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=a(4798),l=a(2665),d=s(a(5697)),u=r(a(8375));t.default=class{_getPenalty(e,t,a){const{time:n=0}=a,i=(0,l.truncateName)(t.name);return{snapOutOfHashes:{fullName:"Illegal Snap, Out Of Hashes",message:"Illegal Snap, Out Of Hashes, automatic loss of down",netYards:0,addDown:!0},snapOutOfBounds:{fullName:"Illegal Snap, Out of Bounds",message:"Illegal Snap, Out of Bounds, automatic loss of down",netYards:0,addDown:!0},offsidesOffense:{fullName:"Offsides Offense",message:`Offsides Offense ${i}, 10 yard penalty, repeat the down`,netYards:-10,addDown:!1},offsidesDefense:{fullName:"Offsides Defense",message:`Offsides Defense ${i}, 10 yard penalty, repeat the down`,netYards:10,addDown:!1},snapDrag:{fullName:"Quarterback Drag",message:"Quarterback Drag, automatic loss of down",netYards:0,addDown:!0},crowding:{fullName:"Crowding",message:`Crowding ${i}, 15 yard penalty, repeat the down`,netYards:15,addDown:!1,delay:!0},crowdAbuse:{fullName:"Crowd Abuse",message:`Crowd Abuse ${i}, 20 yard penalty, repeat the down`,netYards:20,addDown:!1,delay:!0},illegalPass:{fullName:"Illegal Pass In Front Of Line Of Scrimmage",message:"Illegal Pass In Front Of Line Of Scrimmage, automatic loss of down",netYards:0,addDown:!0},fgDrag:{fullName:"Field Goal Kick Drag",message:"Field Goal Kick Drag, automatic loss of down",netYards:0,addDown:!0},puntDrag:{fullName:"Punt Kick Drag",message:"Punt Kick Drag, 10 yard penalty, repeat the down",netYards:-10,addDown:!1},puntOffsidesOffense:{fullName:"Punt Offsides Offense",message:"Offsides Offense, 10 yard penalty, repeat the down",netYards:-10,addDown:!1},illegalTouch:{fullName:"Illegal Touching Of The Ball",message:`Illegal Touching Of The Ball by ${i}, automatic loss of down`,netYards:0,addDown:!0},illegalRun:{fullName:"Illegal Run",message:`Illegal Run by ${i}, automatic loss of down`,netYards:0,addDown:!0},illegalLosCross:{fullName:"Illegal Line Of Scrimmage Cross",message:`${i} illegally crossed the line of scrimmage, automatic loss of down`,netYards:0,addDown:!0},illegalBlitz:{fullName:"Illegal blitz",message:`Illegal blitz by ${i} at ${(0,l.plural)(Math.round(n),"second","seconds")}, 10 yard penalty, repeat the down`,netYards:10,addDown:!1},onsideKickDrag:{fullName:"Onside Kick Drag",message:"Onside Kick Drag, automatic receiving team 40 yard line",netYards:0,addDown:!1,hasOwnHandler:!0},kickOffDrag:{fullName:"Kickoff Drag",message:"Kickoff Drag, automatic receiving team 40 yard line",netYards:0,addDown:!1,hasOwnHandler:!0},kickOffDragSafety:{fullName:"Safety Punt Drag",message:"Punt Drag after a safety, automatic defense 40 yard line",netYards:0,addDown:!1,hasOwnHandler:!0},kickOffOutOfBounds:{fullName:"Kickoff kicked out of bounds",message:"Kickoff kicked out of bounds, automatic offense 40 yard line",netYards:0,addDown:!1,hasOwnHandler:!0},kickOffOffsides:{fullName:"Kickoff Offsides Offense",message:`Offsides Offense ${i}, automatic offense 40 yard line`,netYards:0,addDown:!1,hasOwnHandler:!0},kickOffOffsidesSafety:{fullName:"Safety Punt Offsides Offense",message:`Offsides Offense ${i} after a safety, automatic defense 40 yard line`,netYards:0,addDown:!1,hasOwnHandler:!0}}[e]}_maybeConstrainNewEndLosXToOneYardLine(e){const t=u.default.getEndZonePositionIsIn({x:e,y:0});if(null===t)return e;const a=u.default.getTeamEndzone(t);return(new d.default).addByTeam(a,1*o.MAP_POINTS.YARD,t).calculate()}getData(e,t,a,n,i,s){const{netYards:r,addDown:l,hasOwnHandler:c=!1,message:f,fullName:h,delay:m}=this._getPenalty(e,t,s),y=a&&r>0,g=d.DistanceConverter.toYardLine(n),P=y?Math.floor(g/2):r,p=(new d.default).addByTeam(n,P*o.MAP_POINTS.YARD,i).calculate(),_=this._maybeConstrainNewEndLosXToOneYardLine(p),S=u.default.getTeamEndzone(i),v=(new d.default).addByTeam(S,1*o.MAP_POINTS.YARD,i).calculate();return{penaltyYards:P,isRedZonePenaltyOnDefense:y,newEndLosX:_,addDown:l||_===v,hasOwnHandler:c,penaltyMessage:f,fullName:h,delay:m}}}},3217:function(e,t,a){var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var i=Object.getOwnPropertyDescriptor(t,a);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,i)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=s(a(5145)),l=a(7701),d=r(a(5693)),u=r(a(1858)),c=r(a(3517));t.default=class{constructor(){this.statsCollection=new c.default}maybeCreateStatProfile(e){if(this.statsCollection.has(e))return;const t=new o.default(e);this.statsCollection.set(e,t)}updatePlayerStat(e,t){var a;const n=u.default.game.players.getPlayerRecordById(e);if(!n)throw Error("Error finding player record");null===(a=this.statsCollection.get(n.recordId))||void 0===a||a.updateStats(t),l.DEBUG_MODE&&d.default.send(`STAT UPDATE: ${JSON.stringify(t)}`,{color:16772956})}getMVP(){const e={receptions:3,receivingYards:.5,rushingYards:1,touchdownsReceived:6,touchdownsRushed:6,passAttempts:0,passCompletions:2,passYards:.3,touchdownsThrown:4,interceptionsThrown:-6,qbSacks:-2,passDeflections:3,tackles:3,yardsAllowed:-1,sacks:6,forcedFumbles:0,interceptionsReceived:12,penalties:-5},t=this.statsCollection.find().map((t=>{const a=Object.entries(t).reduce(((t,a)=>{const[n,i]=a,s=i instanceof o.EMPTY_MAP_SECTION_STAT?i.all:i;if(n in e==0)return t;const r=e[n];return t[n]=s*r,t}),{});return{recordId:t.recordId,statsPoints:a}})).map((e=>{const t=Object.values(e.statsPoints).reduce(((e,t)=>e+t));return{recordId:e.recordId,pointTotal:t}})).reduce(((e,t)=>e.pointTotal>t.pointTotal?e:t),{recordId:0,pointTotal:0});return 0===t.pointTotal?null:{recordId:t.recordId,pointTotal:t.pointTotal}}}},4064:function(e,t,a){var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var i=Object.getOwnPropertyDescriptor(t,a);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,i)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const r=a(4798),o=a(3279),l=s(a(5697));class d{static adjustPlayerPositionFront(e,t){return{x:(new l.default).addByTeam(e.x,r.MAP_POINTS.PLAYER_RADIUS,t).calculate(),y:e.y}}static adjustBallPositionOnOutOfBounds(e,t){return{x:(new l.default).addByTeam(e.x,r.MAP_POINTS.BALL_RADIUS,t).roundUpToYardIfBetweenTeamEndzoneAndOneYard(t).roundToYardByTeam(t).constrainToEndzonePoints().calculate(),y:e.y}}static getNetYardsAndAdjustedEndPosition(e,t,a){const n=this.adjustRawEndPosition(t,a),{distance:i,yardLine:s}=new l.default(n.x).calculateAndConvert(),{yards:r}=(new l.default).calcNetDifferenceByTeam(e.x,i,a).calculateAndConvert();return{netYards:r,yardLine:s,adjustedEndPositionX:i}}static adjustRawEndPosition(e,t){return{x:(new l.default).addByTeam(e.x,r.MAP_POINTS.PLAYER_RADIUS,t).roundUpToYardIfBetweenTeamEndzoneAndOneYard(t).roundToYardByTeam(t).constrainToEndzonePoints().calculate(),y:e.y}}static getPositionOfTeamYard(e,t){const a=l.DistanceConverter.yardToDistance(50-e);return t===o.TEAMS.BLUE?a:-a}}t.default=d,d.adjustMapCoordinatesForRadius=e=>{const{TOP_SIDELINE:t,BOT_SIDELINE:a,RED_SIDELINE:n,BLUE_SIDELINE:i,TOP_HASH:s,BOT_HASH:o,RED_FIELD_GOAL_LINE:l,BLUE_FIELD_GOAL_LINE:d,TOP_FG_POST:u,BOTTOM_FG_POST:c}=r.MAP_POINTS;return{topSideLine:t+e,botSideLine:a-e,redSideLine:n+e,blueSideLine:i-e,topHash:s+e,botHash:o-e,redFG:l+e,blueFG:d-e,topFG:u+e,botFG:c-e}}},1666:function(e,t,a){var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var i=Object.getOwnPropertyDescriptor(t,a);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,i)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(a(5198)),l=a(2781),d=a(4798),u=a(3279),c=a(2665),f=s(a(5697)),h=r(a(8375));class m{constructor(e,t,a,n){this.playerId=e,this.playerTeam=t,this.timeGotInCrowdBox=a,this.wasAlone=n}}t.default=class{constructor(){this.CROWD_BOX_YARDS_FRONT=5,this.CROWD_BOX_YARDS_BEHIND=8,this.MAX_CROWDING_SECONDS=3,this.MAX_CROWD_ABUSE_SECONDS=2.25,this._playersInCrowdBoxList=[],this._crowdBoxDiscIndexes=[22,23,24,25]}checkPlayersInCrowdBox(e,t){const a=e.find((e=>{if(this._checkIfPlayerInCrowdBox(e.id)){const a=this._addToCrowdBoxIfNotAlready(e,t);if(this._checkIfMeetsCrowdingCriteria(a,t))return!0}else this._maybeRemoveFromCrowdBoxList(e.id);return!1}));if(a){const e=this._playersInCrowdBoxList.find((e=>e.playerId===a.id));return{isCrowding:!0,crowder:a,crowdingData:e}}return{isCrowding:!1,crowder:null,crowdingData:null}}setOffenseTeam(e){this._offenseTeamId=e}_determineCrowdBoxFrontYards(e){const t=f.DistanceConverter.toYardLine(e),a=t<=this.CROWD_BOX_YARDS_FRONT,n=h.default.getMapHalfFromPoint(e),i=n&&n!==this._offenseTeamId;return a&&i?t:this.CROWD_BOX_YARDS_FRONT}setCrowdBoxArea(e){const t=this._determineCrowdBoxFrontYards(e),a=(new f.default).addByTeam(e,d.MAP_POINTS.YARD*t,this._offenseTeamId).calculate(),n=(new f.default).subtractByTeam(e,d.MAP_POINTS.YARD*this.CROWD_BOX_YARDS_BEHIND,this._offenseTeamId).calculate();if(this._offenseTeamId===u.TEAMS.RED){const e={x1:n,y1:d.MAP_POINTS.TOP_HASH,x2:a,y2:d.MAP_POINTS.BOT_HASH};this._playCrowdBoxArea=e}else{const e={x1:a,y1:d.MAP_POINTS.TOP_HASH,x2:n,y2:d.MAP_POINTS.BOT_HASH};this._playCrowdBoxArea=e}}drawCrowdBoxLines(){o.default.setDiscProperties(this._crowdBoxDiscIndexes[0],{x:this._playCrowdBoxArea.x1,y:d.MAP_POINTS.TOP_HASH}),o.default.setDiscProperties(this._crowdBoxDiscIndexes[1],{x:this._playCrowdBoxArea.x1,y:d.MAP_POINTS.BOT_HASH}),o.default.setDiscProperties(this._crowdBoxDiscIndexes[2],{x:this._playCrowdBoxArea.x2,y:d.MAP_POINTS.BOT_HASH}),o.default.setDiscProperties(this._crowdBoxDiscIndexes[3],{x:this._playCrowdBoxArea.x2,y:d.MAP_POINTS.TOP_HASH})}eraseCrowdBoxLines(){o.default.setDiscProperties(this._crowdBoxDiscIndexes[0],{x:d.MAP_POINTS.HIDDEN,y:d.MAP_POINTS.TOP_HASH}),o.default.setDiscProperties(this._crowdBoxDiscIndexes[1],{x:d.MAP_POINTS.HIDDEN,y:d.MAP_POINTS.BOT_HASH}),o.default.setDiscProperties(this._crowdBoxDiscIndexes[2],{x:d.MAP_POINTS.HIDDEN,y:d.MAP_POINTS.TOP_HASH}),o.default.setDiscProperties(this._crowdBoxDiscIndexes[3],{x:d.MAP_POINTS.HIDDEN,y:d.MAP_POINTS.BOT_HASH})}_checkIfPlayerInCrowdBox(e){const{position:t}=(0,l.getPlayerDiscProperties)(e);return(0,c.isInRectangleArea)(this._playCrowdBoxArea,t)}_addToCrowdBoxIfNotAlready(e,t){const a=this._playersInCrowdBoxList.findIndex((t=>t.playerId===e.id));if(-1!==a)return a;const n=0===this._playersInCrowdBoxList.filter((e=>e.playerTeam===this._offenseTeamId)).length;return this._playersInCrowdBoxList.push(new m(e.id,e.team,t,n))-1}_checkIfMeetsCrowdingCriteria(e,t){if(this._playersInCrowdBoxList.some((e=>e.playerTeam===this._offenseTeamId)))return this._playersInCrowdBoxList.forEach((e=>{e.timeGotInCrowdBox=t})),!1;const a=this._playersInCrowdBoxList[e];return t-a.timeGotInCrowdBox>=(a.wasAlone?this.MAX_CROWD_ABUSE_SECONDS:this.MAX_CROWDING_SECONDS)&&a.playerTeam!==this._offenseTeamId}_maybeRemoveFromCrowdBoxList(e){const t=this._playersInCrowdBoxList.findIndex((t=>t.playerId===e));-1!==t&&this._playersInCrowdBoxList.splice(t,1)}}},3517:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});class a extends Map{_filter(e){return this.find().filter((t=>Object.entries(e).every((([e,a])=>{let n=t[e],i=a;return Array.isArray(n)?i.some((e=>n.includes(e))):(i="string"==typeof a?a.toLowerCase():a,n="string"==typeof n?n.toLowerCase():n,n==i)}))))}find(e=null){return null===e?Array.from(this.values()):this._filter(e)}findOne(e){const[t=null]=this._filter(e);return t}}t.default=a},4340:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});const a={Exclamation:String.fromCodePoint(10071),BarChart:String.fromCodePoint(128202),Medal1:String.fromCodePoint(129351),Medal2:String.fromCodePoint(129352),Medal3:String.fromCodePoint(129353),SportsMedal:String.fromCodePoint(127941),Trophy:String.fromCodePoint(127942),Bell:String.fromCodePoint(128276),Clock:String.fromCodePoint(128276),DoNotEnter:String.fromCodePoint(9940),RedTriangle:String.fromCodePoint(128314),X:String.fromCodePoint(10060),Football:String.fromCodePoint(127944),Stop:String.fromCodePoint(128721),RedSquare:String.fromCodePoint(128997),YellowSquare:String.fromCodePoint(129e3),SmallBlackSquare:String.fromCodePoint(9642),MediumBlackSquare:String.fromCodePoint(9724),SmallWhiteSquare:String.fromCodePoint(9643),BlackSquare:String.fromCodePoint(11035),BlueSquare:String.fromCodePoint(128998),GreenSquare:String.fromCodePoint(129001),BrownSquare:String.fromCodePoint(129003),RedCircle:String.fromCodePoint(128308),OrangeCircle:String.fromCodePoint(128992),GreenCircle:String.fromCodePoint(128994),PurpleCircle:String.fromCodePoint(128995),BlueCircle:String.fromCodePoint(128309),BrownCircle:String.fromCodePoint(128996),WhiteCircle:String.fromCodePoint(9898),GreenCheck:String.fromCodePoint(9989),NoEntry:String.fromCodePoint(128683),On:String.fromCodePoint(128683),Construction:String.fromCodePoint(128679),Star:String.fromCodePoint(11088),Fire:String.fromCodePoint(128293),Lightning:String.fromCodePoint(9889),Lock:String.fromCodePoint(128274),Phone:String.fromCodePoint(128222),Police:String.fromCodePoint(128680),Bot:String.fromCodePoint(128680),Chess:String.fromCodePoint(9823),Crown:String.fromCodePoint(128081),Warning:String.fromCodePoint(9888),ThumbsUp:String.fromCodePoint(128077),HundredPts:String.fromCodePoint(128175),Collision:String.fromCodePoint(128165),Dizzy:String.fromCodePoint(128171),Running:String.fromCodePoint(127939),Target:String.fromCodePoint(127919),Anger:String.fromCodePoint(128162),Pushpin:String.fromCodePoint(128205),SpeakingHead:String.fromCodePoint(128483),Facepalm:String.fromCodePoint(129318),OK:String.fromCodePoint(128582),HandFingersSpread:String.fromCodePoint(128400),Clown:String.fromCodePoint(129313),Loudspeaker:String.fromCodePoint(128226),Mute:String.fromCodePoint(128263),OrangeTriangle:String.fromCodePoint(128312),LargeBlueDiamond:String.fromCodePoint(128311),LargeOrangeDiamond:String.fromCodePoint(128310),Frisbee:String.fromCodePoint(129359)};t.default=a},1234:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5697)),s=a(4798),r=a(3279),o=a(2665);t.default=class{constructor(){this._mapSectionsList=[{name:"cornerTop",getRectangleArea:function(e,t){const{TOP_SIDELINE:a,ABOVE_HASH:n}=s.MAP_POINTS;return{x1:e,y1:a-1e3,x2:t,y2:n}}},{name:"cornerBottom",getRectangleArea:function(e,t){const{BOT_SIDELINE:a,BELOW_HASH:n}=s.MAP_POINTS;return{x1:e,y1:n,x2:t,y2:a+1e3}}},{name:"middle",getRectangleArea:function(e,t){const{ABOVE_HASH:a,BELOW_HASH:n}=s.MAP_POINTS;return{x1:e,y1:a,x2:t,y2:n}}},{name:"deep",getRectangleArea:function(e,t,a,n){const{YARD:o,BOT_SIDELINE:l,TOP_SIDELINE:d}=s.MAP_POINTS,u=(new i.default).addByTeam(a,100*o,n).calculate();return{x1:n===r.TEAMS.RED?e:u,y1:d-1e3,x2:n===r.TEAMS.RED?u:t,y2:l+1e3}}}]}getSectionName(e,t,a){var n;const{YARD:i}=s.MAP_POINTS,r=t-15*i,l=t+15*i,d=this._mapSectionsList.find((n=>{const i=n.getRectangleArea(r,l,t,a);return(0,o.isInRectangleArea)(i,e)}));return null!==(n=null==d?void 0:d.name)&&void 0!==n?n:"backwards"}}},7117:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={HaxballRed:16733782,HaxballBlue:5671397,LightGreen:9498256,Lime:9754669,YellowOrange:16567811,Orange:16749099,Gray:11184810,Black:0,BlueViolet:9055202,LightBlue:7590622,LightSeaGree:2142890,Olive:8421376,HaxballChatGreen:9360043,Gold:16767858,LightRed:16405074,Yellow:16766011,Pink:16221100,White:16777215,DarkGreen:3195184,LightGreen2:11534215,LightRed2:16743265}},2781:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getTeamStringFromId=t.toClock=t.flattenPlayer=t.quickPause=t.getPlayerDiscProperties=void 0;const i=n(a(5198)),s=a(2665);t.getPlayerDiscProperties=e=>{var t;const{xspeed:a=null,yspeed:n=0,x:s=0,y:r=0,radius:o=0}=null!==(t=i.default.getPlayerDiscProperties(e))&&void 0!==t?t:{};return null===a?null:{position:{x:s,y:r},speed:{x:a,y:n},radius:o}},t.quickPause=()=>{i.default.pauseGame(!0),i.default.pauseGame(!1)},t.flattenPlayer=({id:e,team:t,name:a})=>({id:e,team:t,name:a}),t.toClock=e=>{const t=Math.floor(e);return`${Math.floor(t/60)}:${(0,s.leftpad)(t%60)}`},t.getTeamStringFromId=e=>0===e?"Spectators":1===e?"Red":"Blue"},4798:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DISC_IDS=t.MAP_POINTS=void 0,t.MAP_POINTS={PLAYER_RADIUS:15,TE_PLAYER_RADIUS:17,BALL_RADIUS:6.7,KICKOFF:0,HIDDEN:1e4,HALF_FIELD:775,YARD:15.5,TOP_SIDELINE:-280,BOT_SIDELINE:280,RED_SIDELINE:-930,BLUE_SIDELINE:930,RED_GOAL_LINE:-775,BLUE_GOAL_LINE:775,RED_REDZONE:-465,BLUE_REDZONE:465,RED_SCORE_LINE:-1040,BLUE_SCORE_LINE:1040,RED_FIELD_GOAL_LINE:-930,BLUE_FIELD_GOAL_LINE:930,ABOVE_HASH:-110,BELOW_HASH:110,TOP_HASH:-95,BOT_HASH:95,TOP_FG_POST:-60,BOTTOM_FG_POST:60},t.DISC_IDS={BALL:0,LOS_TOP:1,LOS_BOT:2,LTG_TOP:3,LTG_BOT:4,TE:[17,18,19,20,21]},t.default='{\n\n\t"name" : "2022 HFL Official",\n\n\t"width" : 1090,\n\n\t"height" : 380,\n\n\t"cameraFollow" : "player",\n\n\t"spawnDistance" : 980,\n\n\t"bg" : { "type" : "grass", "width" : 930, "height" : 280, "kickOffRadius" : 0, "cornerRadius" : 0, "goalLine" : 0 },\n\n\t"vertexes" : [\n\t\t/* 0 */ { "x" : 0, "y" : 75, "trait" : "kickOffBarrier" },\n\t\t/* 1 */ { "x" : 0, "y" : -75, "trait" : "kickOffBarrier" },\n\t\t/* 2 */ { "x" : 0, "y" : -330, "trait" : "kickOffBarrier" },\n\t\t\n\t\t/* 3 */ { "x" : -775, "y" : -280, "trait" : "goalline" },\n\t\t/* 4 */ { "x" : -775, "y" : 280, "trait" : "goalline" },\n\t\t\n\t\t/* 5 */ { "x" : -620, "y" : -280, "trait" : "yardline" },\n\t\t/* 6 */ { "x" : -620, "y" : 280, "trait" : "yardline" },\n\t\t/* 7 */ { "x" : -310, "y" : -280, "trait" : "yardline" },\n\t\t/* 8 */ { "x" : -310, "y" : 280, "trait" : "yardline" },\n\t\t/* 9 */ { "x" : -155, "y" : -280, "trait" : "yardline" },\n\t\t/* 10 */ { "x" : -155, "y" : 280, "trait" : "yardline" },\n\t\t\n\t\t/* 11 */ { "x" : 0, "y" : -280, "trait" : "centerline" },\n\t\t/* 12 */ { "x" : 0, "y" : 280, "trait" : "centerline" },\n\t\t\n\t\t/* 13 */ { "x" : 155, "y" : -280, "trait" : "yardline" },\n\t\t/* 14 */ { "x" : 155, "y" : 280, "trait" : "yardline" },\n\t\t/* 15 */ { "x" : 310, "y" : -280, "trait" : "yardline" },\n\t\t/* 16 */ { "x" : 310, "y" : 280, "trait" : "yardline" },\n\t\t/* 17 */ { "x" : 465, "y" : -280, "trait" : "yardline" },\n\t\t/* 18 */ { "x" : 465, "y" : 280, "trait" : "yardline" },\n\t\t/* 19 */ { "x" : 620, "y" : -280, "trait" : "yardline" },\n\t\t/* 20 */ { "x" : 620, "y" : 280, "trait" : "yardline" },\n\t\t\n\t\t/* 21 */ { "x" : 775, "y" : -280, "trait" : "goalline" },\n\t\t/* 22 */ { "x" : 775, "y" : 280, "trait" : "goalline" },\n\t\t\n\t\t/* 23 */ { "x" : -1005, "y" : 25, "trait" : "goal" },\n\t\t/* 24 */ { "x" : -1005, "y" : -25, "trait" : "goal" },\n\t\t/* 25 */ { "x" : 1005, "y" : 25, "trait" : "goal" },\n\t\t/* 26 */ { "x" : 1005, "y" : -25, "trait" : "goal" },\n\t\t\n\t\t/* 27 */ { "x" : -775, "y" : -375, "trait" : "goalline" },\n\t\t/* 28 */ { "x" : -775, "y" : 375, "trait" : "goalline" },\n\t\t/* 29 */ { "x" : 775, "y" : -375, "trait" : "goalline", "curve" : 0 },\n\t\t/* 30 */ { "x" : 775, "y" : 375, "trait" : "goalline", "curve" : 0 },\n\t\t\n\t\t/* 31 */ { "x" : -713, "y" : -75, "trait" : "yardline" },\n\t\t/* 32 */ { "x" : -713, "y" : -95, "trait" : "yardline" },\n\t\t/* 33 */ { "x" : -744, "y" : -75, "trait" : "yardline" },\n\t\t/* 34 */ { "x" : -744, "y" : -95, "trait" : "yardline" },\n\t\t/* 35 */ { "x" : -744, "y" : 95, "trait" : "yardline" },\n\t\t/* 36 */ { "x" : -744, "y" : 75, "trait" : "yardline" },\n\t\t/* 37 */ { "x" : -713, "y" : 95, "trait" : "yardline" },\n\t\t/* 38 */ { "x" : -713, "y" : 75, "trait" : "yardline" },\n\t\t/* 39 */ { "x" : 713, "y" : 95, "trait" : "yardline" },\n\t\t/* 40 */ { "x" : 713, "y" : 75, "trait" : "yardline" },\n\t\t/* 41 */ { "x" : 62, "y" : 95, "trait" : "yardline" },\n\t\t/* 42 */ { "x" : 62, "y" : 75, "trait" : "yardline" },\n\t\t/* 43 */ { "x" : 31, "y" : 95, "trait" : "yardline" },\n\t\t/* 44 */ { "x" : 31, "y" : 75, "trait" : "yardline" },\n\t\t/* 45 */ { "x" : -93, "y" : 95, "trait" : "yardline" },\n\t\t/* 46 */ { "x" : -93, "y" : 75, "trait" : "yardline" },\n\t\t/* 47 */ { "x" : -124, "y" : 95, "trait" : "yardline" },\n\t\t/* 48 */ { "x" : -124, "y" : 75, "trait" : "yardline" },\n\t\t/* 49 */ { "x" : -248, "y" : 95, "trait" : "yardline" },\n\t\t/* 50 */ { "x" : -248, "y" : 75, "trait" : "yardline" },\n\t\t/* 51 */ { "x" : -279, "y" : 95, "trait" : "yardline" },\n\t\t/* 52 */ { "x" : -279, "y" : 75, "trait" : "yardline" },\n\t\t/* 53 */ { "x" : -403, "y" : 95, "trait" : "yardline" },\n\t\t/* 54 */ { "x" : -403, "y" : 75, "trait" : "yardline" },\n\t\t/* 55 */ { "x" : -434, "y" : 95, "trait" : "yardline" },\n\t\t/* 56 */ { "x" : -434, "y" : 75, "trait" : "yardline" },\n\t\t/* 57 */ { "x" : -558, "y" : 95, "trait" : "yardline" },\n\t\t/* 58 */ { "x" : -558, "y" : 75, "trait" : "yardline" },\n\t\t/* 59 */ { "x" : -589, "y" : 95, "trait" : "yardline" },\n\t\t/* 60 */ { "x" : -589, "y" : 75, "trait" : "yardline" },\n\t\t/* 61 */ { "x" : 186, "y" : -75, "trait" : "yardline" },\n\t\t/* 62 */ { "x" : 186, "y" : -95, "trait" : "yardline" },\n\t\t/* 63 */ { "x" : 62, "y" : -75, "trait" : "yardline" },\n\t\t/* 64 */ { "x" : 62, "y" : -95, "trait" : "yardline" },\n\t\t/* 65 */ { "x" : 31, "y" : -75, "trait" : "yardline" },\n\t\t/* 66 */ { "x" : 31, "y" : -95, "trait" : "yardline" },\n\t\t/* 67 */ { "x" : -93, "y" : -75, "trait" : "yardline" },\n\t\t/* 68 */ { "x" : -93, "y" : -95, "trait" : "yardline" },\n\t\t/* 69 */ { "x" : -124, "y" : -75, "trait" : "yardline" },\n\t\t/* 70 */ { "x" : -124, "y" : -95, "trait" : "yardline" },\n\t\t/* 71 */ { "x" : -248, "y" : -75, "trait" : "yardline" },\n\t\t/* 72 */ { "x" : -248, "y" : -95, "trait" : "yardline" },\n\t\t/* 73 */ { "x" : -279, "y" : -75, "trait" : "yardline" },\n\t\t/* 74 */ { "x" : -279, "y" : -95, "trait" : "yardline" },\n\t\t/* 75 */ { "x" : -403, "y" : -75, "trait" : "yardline" },\n\t\t/* 76 */ { "x" : -403, "y" : -95, "trait" : "yardline" },\n\t\t/* 77 */ { "x" : -434, "y" : -75, "trait" : "yardline" },\n\t\t/* 78 */ { "x" : -434, "y" : -95, "trait" : "yardline" },\n\t\t/* 79 */ { "x" : -558, "y" : -75, "trait" : "yardline" },\n\t\t/* 80 */ { "x" : -558, "y" : -95, "trait" : "yardline" },\n\t\t/* 81 */ { "x" : -589, "y" : -75, "trait" : "yardline" },\n\t\t/* 82 */ { "x" : -589, "y" : -95, "trait" : "yardline" },\n\t\t/* 83 */ { "x" : 186, "y" : 95, "trait" : "yardline" },\n\t\t/* 84 */ { "x" : 186, "y" : 75, "trait" : "yardline" },\n\t\t/* 85 */ { "x" : 651, "y" : -75, "trait" : "yardline" },\n\t\t/* 86 */ { "x" : 651, "y" : -95, "trait" : "yardline" },\n\t\t/* 87 */ { "x" : 651, "y" : 95, "trait" : "yardline" },\n\t\t/* 88 */ { "x" : 651, "y" : 75, "trait" : "yardline" },\n\t\t/* 89 */ { "x" : 682, "y" : 95, "trait" : "yardline" },\n\t\t/* 90 */ { "x" : 682, "y" : 75, "trait" : "yardline" },\n\t\t/* 91 */ { "x" : 682, "y" : -75, "trait" : "yardline" },\n\t\t/* 92 */ { "x" : 682, "y" : -95, "trait" : "yardline" },\n\t\t/* 93 */ { "x" : 527, "y" : -75, "trait" : "yardline" },\n\t\t/* 94 */ { "x" : 527, "y" : -95, "trait" : "yardline" },\n\t\t/* 95 */ { "x" : 527, "y" : 95, "trait" : "yardline" },\n\t\t/* 96 */ { "x" : 527, "y" : 75, "trait" : "yardline" },\n\t\t/* 97 */ { "x" : 496, "y" : 95, "trait" : "yardline" },\n\t\t/* 98 */ { "x" : 496, "y" : 75, "trait" : "yardline" },\n\t\t/* 99 */ { "x" : 496, "y" : -75, "trait" : "yardline" },\n\t\t/* 100 */ { "x" : 496, "y" : -95, "trait" : "yardline" },\n\t\t/* 101 */ { "x" : 372, "y" : -75, "trait" : "yardline" },\n\t\t/* 102 */ { "x" : 372, "y" : -95, "trait" : "yardline" },\n\t\t/* 103 */ { "x" : 403, "y" : 95, "trait" : "yardline" },\n\t\t/* 104 */ { "x" : 403, "y" : 75, "trait" : "yardline" },\n\t\t/* 105 */ { "x" : 372, "y" : 95, "trait" : "yardline" },\n\t\t/* 106 */ { "x" : 372, "y" : 75, "trait" : "yardline" },\n\t\t/* 107 */ { "x" : 341, "y" : -75, "trait" : "yardline" },\n\t\t/* 108 */ { "x" : 341, "y" : -95, "trait" : "yardline" },\n\t\t/* 109 */ { "x" : 217, "y" : -75, "trait" : "yardline" },\n\t\t/* 110 */ { "x" : 217, "y" : -95, "trait" : "yardline" },\n\t\t/* 111 */ { "x" : 217, "y" : 95, "trait" : "yardline" },\n\t\t/* 112 */ { "x" : 217, "y" : 75, "trait" : "yardline" },\n\t\t\n\t\t/* 113 */ { "x" : 1005, "y" : 25, "trait" : "goal" },\n\t\t/* 114 */ { "x" : 1005, "y" : -25, "trait" : "goal" },\n\t\t\n\t\t/* 115 */ { "x" : -682, "y" : -75, "trait" : "yardline" },\n\t\t/* 116 */ { "x" : -682, "y" : -95, "trait" : "yardline" },\n\t\t/* 117 */ { "x" : -682, "y" : 95, "trait" : "yardline" },\n\t\t/* 118 */ { "x" : -682, "y" : 75, "trait" : "yardline" },\n\t\t/* 119 */ { "x" : -651, "y" : 95, "trait" : "yardline" },\n\t\t/* 120 */ { "x" : -651, "y" : 75, "trait" : "yardline" },\n\t\t/* 121 */ { "x" : -651, "y" : -75, "trait" : "yardline" },\n\t\t/* 122 */ { "x" : -651, "y" : -95, "trait" : "yardline", "_selected" : true },\n\t\t/* 123 */ { "x" : -527, "y" : 95, "trait" : "yardline" },\n\t\t/* 124 */ { "x" : -527, "y" : 75, "trait" : "yardline" },\n\t\t/* 125 */ { "x" : -527, "y" : -75, "trait" : "yardline" },\n\t\t/* 126 */ { "x" : -527, "y" : -95, "trait" : "yardline" },\n\t\t/* 127 */ { "x" : -496, "y" : -75, "trait" : "yardline" },\n\t\t/* 128 */ { "x" : -496, "y" : -95, "trait" : "yardline" },\n\t\t/* 129 */ { "x" : -496, "y" : 95, "trait" : "yardline" },\n\t\t/* 130 */ { "x" : -496, "y" : 75, "trait" : "yardline" },\n\t\t/* 131 */ { "x" : -372, "y" : -75, "trait" : "yardline" },\n\t\t/* 132 */ { "x" : -372, "y" : -95, "trait" : "yardline" },\n\t\t/* 133 */ { "x" : -372, "y" : 95, "trait" : "yardline" },\n\t\t/* 134 */ { "x" : -372, "y" : 75, "trait" : "yardline" },\n\t\t/* 135 */ { "x" : -341, "y" : 95, "trait" : "yardline" },\n\t\t/* 136 */ { "x" : -341, "y" : 75, "trait" : "yardline" },\n\t\t/* 137 */ { "x" : -341, "y" : -75, "trait" : "yardline" },\n\t\t/* 138 */ { "x" : -341, "y" : -95, "trait" : "yardline" },\n\t\t/* 139 */ { "x" : -217, "y" : 95, "trait" : "yardline" },\n\t\t/* 140 */ { "x" : -217, "y" : 75, "trait" : "yardline" },\n\t\t/* 141 */ { "x" : -186, "y" : 95, "trait" : "yardline" },\n\t\t/* 142 */ { "x" : -186, "y" : 75, "trait" : "yardline" },\n\t\t/* 143 */ { "x" : -217, "y" : -75, "trait" : "yardline" },\n\t\t/* 144 */ { "x" : -217, "y" : -95, "trait" : "yardline" },\n\t\t/* 145 */ { "x" : -186, "y" : -75, "trait" : "yardline" },\n\t\t/* 146 */ { "x" : -186, "y" : -95, "trait" : "yardline" },\n\t\t/* 147 */ { "x" : -62, "y" : 95, "trait" : "yardline" },\n\t\t/* 148 */ { "x" : -62, "y" : 75, "trait" : "yardline" },\n\t\t/* 149 */ { "x" : -31, "y" : 95, "trait" : "yardline" },\n\t\t/* 150 */ { "x" : -31, "y" : 75, "trait" : "yardline" },\n\t\t/* 151 */ { "x" : -62, "y" : -75, "trait" : "yardline" },\n\t\t/* 152 */ { "x" : -62, "y" : -95, "trait" : "yardline" },\n\t\t/* 153 */ { "x" : -31, "y" : -75, "trait" : "yardline" },\n\t\t/* 154 */ { "x" : -31, "y" : -95, "trait" : "yardline" },\n\t\t/* 155 */ { "x" : 93, "y" : -75, "trait" : "yardline" },\n\t\t/* 156 */ { "x" : 93, "y" : -95, "trait" : "yardline" },\n\t\t/* 157 */ { "x" : 93, "y" : 95, "trait" : "yardline" },\n\t\t/* 158 */ { "x" : 93, "y" : 75, "trait" : "yardline" },\n\t\t/* 159 */ { "x" : 124, "y" : 95, "trait" : "yardline" },\n\t\t/* 160 */ { "x" : 124, "y" : 75, "trait" : "yardline" },\n\t\t/* 161 */ { "x" : 124, "y" : -75, "trait" : "yardline" },\n\t\t/* 162 */ { "x" : 124, "y" : -95, "trait" : "yardline" },\n\t\t/* 163 */ { "x" : 248, "y" : 95, "trait" : "yardline" },\n\t\t/* 164 */ { "x" : 248, "y" : 75, "trait" : "yardline" },\n\t\t/* 165 */ { "x" : 248, "y" : -75, "trait" : "yardline" },\n\t\t/* 166 */ { "x" : 248, "y" : -95, "trait" : "yardline" },\n\t\t/* 167 */ { "x" : 279, "y" : -75, "trait" : "yardline" },\n\t\t/* 168 */ { "x" : 279, "y" : -95, "trait" : "yardline" },\n\t\t/* 169 */ { "x" : 279, "y" : 95, "trait" : "yardline" },\n\t\t/* 170 */ { "x" : 279, "y" : 75, "trait" : "yardline" },\n\t\t/* 171 */ { "x" : 341, "y" : 95, "trait" : "yardline" },\n\t\t/* 172 */ { "x" : 341, "y" : 75, "trait" : "yardline" },\n\t\t/* 173 */ { "x" : 403, "y" : -75, "trait" : "yardline" },\n\t\t/* 174 */ { "x" : 403, "y" : -95, "trait" : "yardline" },\n\t\t/* 175 */ { "x" : 434, "y" : -75, "trait" : "yardline" },\n\t\t/* 176 */ { "x" : 434, "y" : -95, "trait" : "yardline" },\n\t\t/* 177 */ { "x" : 434, "y" : 95, "trait" : "yardline" },\n\t\t/* 178 */ { "x" : 434, "y" : 75, "trait" : "yardline" },\n\t\t/* 179 */ { "x" : 558, "y" : 95, "trait" : "yardline" },\n\t\t/* 180 */ { "x" : 558, "y" : 75, "trait" : "yardline" },\n\t\t/* 181 */ { "x" : 558, "y" : -75, "trait" : "yardline" },\n\t\t/* 182 */ { "x" : 558, "y" : -95, "trait" : "yardline" },\n\t\t/* 183 */ { "x" : 589, "y" : -75, "trait" : "yardline" },\n\t\t/* 184 */ { "x" : 589, "y" : -95, "trait" : "yardline" },\n\t\t/* 185 */ { "x" : 589, "y" : 95, "trait" : "yardline" },\n\t\t/* 186 */ { "x" : 589, "y" : 75, "trait" : "yardline" },\n\t\t/* 187 */ { "x" : 713, "y" : -75, "trait" : "yardline" },\n\t\t/* 188 */ { "x" : 713, "y" : -95, "trait" : "yardline" },\n\t\t/* 189 */ { "x" : 744, "y" : -75, "trait" : "yardline" },\n\t\t/* 190 */ { "x" : 744, "y" : -95, "trait" : "yardline" },\n\t\t/* 191 */ { "x" : 744, "y" : 95, "trait" : "yardline" },\n\t\t/* 192 */ { "x" : 744, "y" : 75, "trait" : "yardline" },\n\t\t/* 193 */ { "x" : -465, "y" : -280, "trait" : "yardline", "color" : "c7e6bd" },\n\t\t/* 194 */ { "x" : -465, "y" : 280, "trait" : "yardline", "color" : "c7e6bd" },\n\t\t/* 195 */ { "x" : 465, "y" : 280, "trait" : "yardline", "color" : "c7e6bd" },\n\t\t/* 196 */ { "x" : -697.5, "y" : 280, "trait" : "yardline" },\n\t\t/* 197 */ { "x" : -697.5, "y" : 246, "trait" : "yardline" },\n\t\t/* 198 */ { "x" : -542.5, "y" : 280, "trait" : "yardline" },\n\t\t/* 199 */ { "x" : -542.5, "y" : 246, "trait" : "yardline" },\n\t\t/* 200 */ { "x" : -387.5, "y" : 280, "trait" : "yardline" },\n\t\t/* 201 */ { "x" : -387.5, "y" : 246, "trait" : "yardline" },\n\t\t/* 202 */ { "x" : -232.5, "y" : 280, "trait" : "yardline" },\n\t\t/* 203 */ { "x" : -232.5, "y" : 246, "trait" : "yardline" },\n\t\t/* 204 */ { "x" : -77.5, "y" : 280, "trait" : "yardline" },\n\t\t/* 205 */ { "x" : -77.5, "y" : 246, "trait" : "yardline" },\n\t\t/* 206 */ { "x" : 77.5, "y" : 280, "trait" : "yardline" },\n\t\t/* 207 */ { "x" : 77.5, "y" : 246, "trait" : "yardline" },\n\t\t/* 208 */ { "x" : 232.5, "y" : 280, "trait" : "yardline" },\n\t\t/* 209 */ { "x" : 232.5, "y" : 246, "trait" : "yardline" },\n\t\t/* 210 */ { "x" : 387.5, "y" : 280, "trait" : "yardline" },\n\t\t/* 211 */ { "x" : 387.5, "y" : 246, "trait" : "yardline" },\n\t\t/* 212 */ { "x" : 387.5, "y" : -246, "trait" : "yardline" },\n\t\t/* 213 */ { "x" : 387.5, "y" : -280, "trait" : "yardline" },\n\t\t/* 214 */ { "x" : 232.5, "y" : -246, "trait" : "yardline" },\n\t\t/* 215 */ { "x" : 232.5, "y" : -280, "trait" : "yardline" },\n\t\t/* 216 */ { "x" : 77.5, "y" : -246, "trait" : "yardline" },\n\t\t/* 217 */ { "x" : 77.5, "y" : -280, "trait" : "yardline" },\n\t\t/* 218 */ { "x" : 542.5, "y" : -246, "trait" : "yardline" },\n\t\t/* 219 */ { "x" : 542.5, "y" : -280, "trait" : "yardline" },\n\t\t/* 220 */ { "x" : 697.5, "y" : -246, "trait" : "yardline" },\n\t\t/* 221 */ { "x" : 697.5, "y" : -280, "trait" : "yardline" },\n\t\t/* 222 */ { "x" : -77.5, "y" : -246, "trait" : "yardline" },\n\t\t/* 223 */ { "x" : -77.5, "y" : -280, "trait" : "yardline" },\n\t\t/* 224 */ { "x" : -232.5, "y" : -246, "trait" : "yardline" },\n\t\t/* 225 */ { "x" : -232.5, "y" : -280, "trait" : "yardline" },\n\t\t/* 226 */ { "x" : -387.5, "y" : -246, "trait" : "yardline" },\n\t\t/* 227 */ { "x" : -387.5, "y" : -280, "trait" : "yardline" },\n\t\t/* 228 */ { "x" : -542.5, "y" : -246, "trait" : "yardline" },\n\t\t/* 229 */ { "x" : -542.5, "y" : -280, "trait" : "yardline" },\n\t\t/* 230 */ { "x" : -697.5, "y" : -246, "trait" : "yardline" },\n\t\t/* 231 */ { "x" : -697.5, "y" : -280, "trait" : "yardline" },\n\t\t/* 232 */ { "x" : 540.5, "y" : 264, "trait" : "yardline" },\n\t\t/* 233 */ { "x" : 540.5, "y" : 244, "trait" : "yardline" },\n\t\t/* 234 */ { "x" : 697.5, "y" : 280, "trait" : "yardline" },\n\t\t/* 235 */ { "x" : 697.5, "y" : 246, "trait" : "yardline" }\n\n\t],\n\n\t"segments" : [\n\t\t{ "v0" : 1, "v1" : 2, "trait" : "kickOffBarrier" },\n\t\t\n\t\t{ "v0" : 3, "v1" : 4, "trait" : "goalline", "x" : -775 },\n\t\t\n\t\t{ "v0" : 5, "v1" : 6, "trait" : "yardline", "x" : -620 },\n\t\t{ "v0" : 7, "v1" : 8, "trait" : "yardline", "x" : -310 },\n\t\t{ "v0" : 9, "v1" : 10, "trait" : "yardline", "x" : -155 },\n\t\t\n\t\t{ "v0" : 11, "v1" : 12, "trait" : "centerline" },\n\t\t\n\t\t{ "v0" : 13, "v1" : 14, "trait" : "yardline", "x" : 155 },\n\t\t{ "v0" : 15, "v1" : 16, "trait" : "yardline", "x" : 310 },\n\t\t{ "v0" : 17, "v1" : 18, "trait" : "yardline", "x" : 465 },\n\t\t{ "v0" : 19, "v1" : 20, "trait" : "yardline", "x" : 620 },\n\t\t\n\t\t{ "v0" : 21, "v1" : 22, "trait" : "goalline", "x" : 775 },\n\t\t\n\t\t{ "v0" : 23, "v1" : 24, "color" : "FF0000", "trait" : "goal", "x" : -1005 },\n\t\t{ "v0" : 25, "v1" : 26, "color" : "0000FF", "trait" : "goal", "x" : 1005 },\n\t\t\n\t\t{ "v0" : 27, "v1" : 28, "cGroup" : ["blueKO" ], "trait" : "kickOffBarrier", "x" : -775 },\n\t\t{ "v0" : 29, "v1" : 30, "curve" : 0, "cGroup" : ["redKO" ], "trait" : "kickOffBarrier", "x" : 775 },\n\t\t\n\t\t{ "v0" : 31, "v1" : 32, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -713 },\n\t\t{ "v0" : 33, "v1" : 34, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -744 },\n\t\t{ "v0" : 35, "v1" : 36, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -744 },\n\t\t{ "v0" : 37, "v1" : 38, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -713 },\n\t\t{ "v0" : 39, "v1" : 40, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 713 },\n\t\t{ "v0" : 41, "v1" : 42, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 62 },\n\t\t{ "v0" : 43, "v1" : 44, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 31 },\n\t\t{ "v0" : 45, "v1" : 46, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -93 },\n\t\t{ "v0" : 47, "v1" : 48, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -124 },\n\t\t{ "v0" : 49, "v1" : 50, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -248 },\n\t\t{ "v0" : 51, "v1" : 52, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -279 },\n\t\t{ "v0" : 53, "v1" : 54, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -403 },\n\t\t{ "v0" : 55, "v1" : 56, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -434 },\n\t\t{ "v0" : 57, "v1" : 58, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -558 },\n\t\t{ "v0" : 59, "v1" : 60, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -589 },\n\t\t{ "v0" : 61, "v1" : 62, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 186 },\n\t\t{ "v0" : 63, "v1" : 64, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 62 },\n\t\t{ "v0" : 65, "v1" : 66, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 31 },\n\t\t{ "v0" : 67, "v1" : 68, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -93 },\n\t\t{ "v0" : 69, "v1" : 70, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -124 },\n\t\t{ "v0" : 71, "v1" : 72, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -248 },\n\t\t{ "v0" : 73, "v1" : 74, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -279 },\n\t\t{ "v0" : 75, "v1" : 76, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -403 },\n\t\t{ "v0" : 77, "v1" : 78, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -434 },\n\t\t{ "v0" : 79, "v1" : 80, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -558 },\n\t\t{ "v0" : 81, "v1" : 82, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -589 },\n\t\t{ "v0" : 83, "v1" : 84, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 186 },\n\t\t{ "v0" : 85, "v1" : 86, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 651 },\n\t\t{ "v0" : 87, "v1" : 88, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 651 },\n\t\t{ "v0" : 89, "v1" : 90, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 682 },\n\t\t{ "v0" : 91, "v1" : 92, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 682 },\n\t\t{ "v0" : 93, "v1" : 94, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 527 },\n\t\t{ "v0" : 95, "v1" : 96, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 527 },\n\t\t{ "v0" : 97, "v1" : 98, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 496 },\n\t\t{ "v0" : 99, "v1" : 100, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 496 },\n\t\t{ "v0" : 101, "v1" : 102, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 372 },\n\t\t{ "v0" : 103, "v1" : 104, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 403 },\n\t\t{ "v0" : 105, "v1" : 106, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 372 },\n\t\t{ "v0" : 107, "v1" : 108, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 341 },\n\t\t{ "v0" : 109, "v1" : 110, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 217 },\n\t\t{ "v0" : 111, "v1" : 112, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 217 },\n\t\t{ "v0" : 115, "v1" : 116, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -682 },\n\t\t{ "v0" : 117, "v1" : 118, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -682 },\n\t\t{ "v0" : 119, "v1" : 120, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -651 },\n\t\t{ "v0" : 121, "v1" : 122, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -651 },\n\t\t{ "v0" : 123, "v1" : 124, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -527 },\n\t\t{ "v0" : 125, "v1" : 126, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -527 },\n\t\t{ "v0" : 127, "v1" : 128, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -496 },\n\t\t{ "v0" : 129, "v1" : 130, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -496 },\n\t\t{ "v0" : 131, "v1" : 132, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -372 },\n\t\t{ "v0" : 133, "v1" : 134, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -372 },\n\t\t{ "v0" : 135, "v1" : 136, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -341 },\n\t\t{ "v0" : 137, "v1" : 138, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -341 },\n\t\t{ "v0" : 139, "v1" : 140, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -217 },\n\t\t{ "v0" : 141, "v1" : 142, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -186 },\n\t\t{ "v0" : 143, "v1" : 144, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -217 },\n\t\t{ "v0" : 145, "v1" : 146, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -186 },\n\t\t{ "v0" : 147, "v1" : 148, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -62 },\n\t\t{ "v0" : 149, "v1" : 150, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -31 },\n\t\t{ "v0" : 151, "v1" : 152, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -62 },\n\t\t{ "v0" : 153, "v1" : 154, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -31 },\n\t\t{ "v0" : 155, "v1" : 156, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 93 },\n\t\t{ "v0" : 157, "v1" : 158, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 93 },\n\t\t{ "v0" : 159, "v1" : 160, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 124 },\n\t\t{ "v0" : 161, "v1" : 162, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 124 },\n\t\t{ "v0" : 163, "v1" : 164, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 248 },\n\t\t{ "v0" : 165, "v1" : 166, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 248 },\n\t\t{ "v0" : 167, "v1" : 168, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 279 },\n\t\t{ "v0" : 169, "v1" : 170, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 279 },\n\t\t{ "v0" : 171, "v1" : 172, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 341 },\n\t\t{ "v0" : 173, "v1" : 174, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 403 },\n\t\t{ "v0" : 175, "v1" : 176, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 434 },\n\t\t{ "v0" : 177, "v1" : 178, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 434 },\n\t\t{ "v0" : 179, "v1" : 180, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 558 },\n\t\t{ "v0" : 181, "v1" : 182, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 558 },\n\t\t{ "v0" : 183, "v1" : 184, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 589 },\n\t\t{ "v0" : 185, "v1" : 186, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 589 },\n\t\t{ "v0" : 187, "v1" : 188, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 713 },\n\t\t{ "v0" : 189, "v1" : 190, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 744 },\n\t\t{ "v0" : 191, "v1" : 192, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 744 },\n\t\t{ "v0" : 193, "v1" : 194, "color" : "c7e6bd", "trait" : "yardline", "x" : -465 },\n\t\t{ "v0" : 196, "v1" : 197, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -744 },\n\t\t{ "v0" : 198, "v1" : 199, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -542.5 },\n\t\t{ "v0" : 200, "v1" : 201, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -387.5 },\n\t\t{ "v0" : 202, "v1" : 203, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -232.5 },\n\t\t{ "v0" : 204, "v1" : 205, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -77.5 },\n\t\t{ "v0" : 206, "v1" : 207, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 77.5 },\n\t\t{ "v0" : 208, "v1" : 209, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 232.5 },\n\t\t{ "v0" : 210, "v1" : 211, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 387.5 },\n\t\t{ "v0" : 212, "v1" : 213, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 387.5 },\n\t\t{ "v0" : 214, "v1" : 215, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 232.5 },\n\t\t{ "v0" : 216, "v1" : 217, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 77.5 },\n\t\t{ "v0" : 218, "v1" : 219, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 542.5 },\n\t\t{ "v0" : 220, "v1" : 221, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 697.5 },\n\t\t{ "v0" : 222, "v1" : 223, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -77.5 },\n\t\t{ "v0" : 224, "v1" : 225, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -232.5 },\n\t\t{ "v0" : 226, "v1" : 227, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -387.5 },\n\t\t{ "v0" : 228, "v1" : 229, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -542.5 },\n\t\t{ "v0" : 230, "v1" : 231, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -697.5 },\n\t\t{ "v0" : 232, "v1" : 233, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 542.5 },\n\t\t{ "v0" : 234, "v1" : 235, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 697.5 }\n\n\t],\n\n\t"goals" : [\n\t\t{ "p0" : [-1065,0 ], "p1" : [-1005,0 ], "team" : "blue" },\n\t\t{ "p0" : [1006.9833374023,1.6000061035156 ], "p1" : [1063.9833374023,1.6000061035156 ], "team" : "red" }\n\n\t],\n\n\t"discs" : [\n\t\t{ "pos" : [0,280 ], "trait" : "losmarker" },\n\t\t{ "pos" : [0,-280 ], "trait" : "losmarker" },\n\t\t\n\t\t{ "pos" : [10000,280 ], "trait" : "yardtogetmarker" },\n\t\t{ "pos" : [10000,-280 ], "trait" : "yardtogetmarker" },\n\t\t\n\t\t{ "pos" : [930,-60 ], "trait" : "goalPost" },\n\t\t{ "pos" : [-930,-60 ], "trait" : "goalPost" },\n\t\t{ "pos" : [-930,60 ], "trait" : "goalPost" },\n\t\t{ "pos" : [930,60 ], "trait" : "goalPost" },\n\t\t\n\t\t{ "pos" : [930,280 ], "trait" : "goalmarker" },\n\t\t{ "pos" : [775,-280 ], "trait" : "goalmarker" },\n\t\t{ "pos" : [-930,280 ], "trait" : "goalmarker" },\n\t\t{ "pos" : [-930,-280 ], "trait" : "goalmarker" },\n\t\t{ "pos" : [775,280 ], "trait" : "goalmarker" },\n\t\t{ "pos" : [930,-280 ], "trait" : "goalmarker" },\n\t\t{ "pos" : [-775,280 ], "trait" : "goalmarker" },\n\t\t{ "pos" : [-775,-280 ], "trait" : "goalmarker" },\n\n\t\t{ "pos" : [10000,0 ], "trait" : "teweight1" },\n\t\t{ "pos" : [10000,13 ], "trait" : "teweight" },\n\t\t{ "pos" : [9987,0 ], "trait" : "teweight" },\n\t\t{ "pos" : [10000,-13 ], "trait" : "teweight" },\n\t\t{ "pos" : [10013,0 ], "trait" : "teweight" },\n\t\t{ "pos" : [9960,280 ], "trait" : "crowdboxmarker" },\n\t\t{ "pos" : [9960,-280 ], "trait" : "crowdboxmarker" },\n\t\t{ "pos" : [9950,280 ], "trait" : "crowdboxmarker" },\n\t\t{ "pos" : [9950,-280 ], "trait" : "crowdboxmarker" }\n\n\t],\n\n\t"joints" : [\n\t\t{ "d0" : 1, "d1" : 2, "trait" : "losline" },\n\t\t{ "d0" : 3, "d1" : 4, "trait" : "yardtogetline" },\n\n\t\t{ "d0" : 17, "d1" : 18, "trait" : "joint" },\n\t\t{ "d0" : 17, "d1" : 19, "trait" : "joint" },\n\t\t{ "d0" : 17, "d1" : 20, "trait" : "joint" },\n\t\t{ "d0" : 17, "d1" : 21, "trait" : "joint" },\n\t\t{ "d0" : 18, "d1" : 19, "trait" : "joint" },\n\t\t{ "d0" : 19, "d1" : 20, "trait" : "joint" },\n\t\t{ "d0" : 20, "d1" : 21, "trait" : "joint" },\n\t\t{ "d0" : 21, "d1" : 18, "trait" : "joint" }\n\n\t\t// { "d0" : 22, "d1" : 23, "trait" : "crowdboxline" },\n\t\t// { "d0" : 23, "d1" : 24, "trait" : "crowdboxline" },\n\t\t// { "d0" : 24, "d1" : 25, "trait" : "crowdboxline" },\n\t\t// { "d0" : 25, "d1" : 22, "trait" : "crowdboxline" }\n\n\t],\n\n\t"planes" : [\n\t\t{ "normal" : [0,1 ], "dist" : -350, "trait" : "ballArea" },\n\t\t{ "normal" : [0,-1 ], "dist" : -350, "bCoef" : 1, "trait" : "ballArea" },\n\t\t{ "normal" : [1,0 ], "dist" : -1065, "trait" : "ballArea" },\n\t\t{ "normal" : [-1,0 ], "dist" : -1065, "trait" : "ballArea" },\n\t\t\n\t\t{ "normal" : [0,1 ], "dist" : -375, "bCoef" : 0.9 },\n\t\t{ "normal" : [0,-1 ], "dist" : -375, "bCoef" : 0.9 },\n\t\t{ "normal" : [1,0 ], "dist" : -1090, "bCoef" : 0.9 },\n\t\t{ "normal" : [-1,0 ], "dist" : -1090, "bCoef" : 0.9 }\n\n\t],\n\n\t"traits" : {\n\t\t"ballArea" : { "vis" : false, "bCoef" : 1, "cMask" : ["ball" ] },\n\t\t"endline" : { "vis" : false, "bCoef" : 1, "cMask" : ["ball" ] },\n\t\t"goalPost" : { "radius" : 4, "invMass" : 0, "bCoef" : 0.5, "color" : "FFFF00" },\n\t\t"goalNet" : { "vis" : true, "bCoef" : 0.1, "cMask" : ["ball" ] },\n\t\t"kickOffBarrier" : { "vis" : false, "bCoef" : 0.1, "cGroup" : ["redKO","blueKO" ], "cMask" : ["red","blue","c0" ] },\n\t\t"goalline" : { "vis" : true, "color" : "FFA500", "cMask" : ["c0","wall" ] },\n\t\t"yardline" : { "vis" : true, "color" : "c7e6bd", "cMask" : [ ] },\n\t\t"centerline" : { "vis" : true, "color" : "E0E0E0", "cMask" : [ ] },\n\t\t"goalmarker" : { "vis" : true, "color" : "FFA500", "cMask" : [ ], "radius" : 3 },\n\t\t"losmarker" : { "vis" : true, "color" : "273d6b", "cMask" : [ ], "radius" : 3 },\n\t\t"yardtogetmarker" : { "vis" : true, "color" : "8FE271", "cMask" : [ ], "radius" : 3 },\n\t\t"teweight" : { "vis" : false, "radius" : 0, "cMask" : ["red", "blue" ], "invMass" : 1.2 },\n\t\t"teweight1" : { "vis" : false, "radius" : 0, "cMask" : [], "invMass" : 1.2, "color" : "F2F2F2" },\n\t\t"losline" : { "vis" : true, "color" : "273d6b" },\n\t\t"yardtogetline" : { "color" : "8FE271" },\n\t\t"crowdboxline" : { "color" : "ff8164", "invMass" : 0.1 },\n\t\t"crowdboxmarker" : { "color" : "ff6242", "radius" : 3, "vis" : true, "cMask" : [ ], "invMass" : 0.1 },\n\t\t"goal" : { "vis" : true, "color" : "FFA500" }\n\n\t},\n\n\t"ballPhysics" : {\n\t\t"cMask" : [ "wall", "red", "blue"\n\t\t],\n\t\t"cGroup" : [ "ball"\n\t\t],\n\t\t"color" : "602323",\n\t\t"radius" : 6.3\n\n\t},\n\n\t"playerPhysics" : {\n\t\t"kickStrength" : 7.6,\n "kickback" : 0,\n\t\t"bCoef" : 0.75,\n\t\t"invMass" : 0.8\n\n\t},\n\n\t"redSpawnPoints" : [\n\t\t\n\n\t],\n\n\t"blueSpawnPoints" : [\n\t\t\n\n\t]\n}'},3279:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEAMS=void 0,t.TEAMS={SPECTATORS:0,RED:1,BLUE:2}},2665:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.largestInArray=t.getRandomChars=t.averageOfArray=t.extrapolateLine=t.toOrdinalSuffix=t.isObject=t.sumObjectValues=t.containsNWord=t.randFromArrayWeighted=t.randFromArray=t.escapeRegExp=t.formatTime=t.formatDate=t.formatDateAndTime=t.isInRectangleArea=t.inRange=t.toPercent=t.toPercentString=t.formatPercent=t.sleep=t.hexToAscii=t.secToMin=t.plural=t.round=t.truncateName=t.addPlus=t.leftpad=t.getRandomIntInRange=t.limitNumberWithinRange=t.getRandomInt=t.truncateString=t.partition=void 0,t.partition=(e,t)=>e.reduce(((e,a,n,i)=>(e[t(a,n,i)?0:1].push(a),e)),[[],[]]),t.truncateString=(e="",t)=>e.length<=t?e:e.slice(0,t-3)+"...",t.getRandomInt=e=>Math.floor(Math.random()*e),t.limitNumberWithinRange=(e,t,a)=>{if(t>a)throw Error(`Min ${t} is greater than Max ${a}`);return Math.min(Math.max(e,t),a)},t.getRandomIntInRange=(e,t)=>{let a=t-e,n=Math.random();return n=Math.floor(n*a),n+=e,n},t.leftpad=e=>e<10?`0${e}`:`${e}`,t.addPlus=e=>e>0?`+${e}`:`${e}`,t.truncateName=e=>(0,t.truncateString)(e,15),t.round=(e,t=0)=>{const a=Math.pow(10,t);return Math.round(e*a)/a},t.plural=(e,t,a)=>`${e} ${1===e?t:a}`,t.secToMin=e=>(0,t.round)(e/60,2),t.hexToAscii=e=>{let t="";for(let a=0;anew Promise((t=>setTimeout(t,e))),t.formatPercent=(e,a=0)=>`${(0,t.round)(100*e,a)}%`,t.toPercentString=(e,a)=>(0,t.toPercent)(e,a)+"%",t.toPercent=(e,t)=>{const a=Math.round(e/t*100);return Number.isNaN(a)?0:a},t.inRange=(e,t,a)=>{if(t>=a)throw new Error("Invalid range");return e>=t&&e<=a},t.isInRectangleArea=({x1:e,y1:t,x2:a,y2:n},{x:i,y:s})=>i>e&&it&&s`${(0,t.formatDate)(e)} ${(0,t.formatTime)(e)}`,t.formatDate=(e=Date.now())=>new Date(e).toLocaleString("en-US",{year:"numeric",month:"long",day:"numeric",timeZone:"America/Chicago"}),t.formatTime=(e=Date.now())=>{const t=new Date(e);let a=t.getHours(),n=t.getMinutes();const i=a>=12?"PM":"AM";return a%=12,a=a||12,n=n<10?"0"+n:n,a+":"+n+" "+i},t.escapeRegExp=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t.randFromArray=e=>e[~~(e.length*Math.random())],t.randFromArrayWeighted=e=>{if(e.some((e=>e.weight>1)))throw Error("Weight cannot be larger than 1");let t=(e=>[].concat(...e.map((e=>new Array(Math.ceil(100*e.weight)).fill(e)))))(e);return t[Math.floor(Math.random()*t.length)]},t.containsNWord=e=>{e=e.toLowerCase();const t=new RegExp(/(n|i){1,32}((g{2,32}|q){1,32}|[gq]{2,32})[e3r]{1,32}/,"i").test(e);return["nig","nigger","n1gger","n1gg3r","niger","n1g3r","nigga","n1gg@","n1g@","niga"].some((t=>e.includes(t)))||t},t.sumObjectValues=e=>Object.values(e).reduce(((e,t)=>e+t)),t.isObject=e=>null!=e&&"Object"===e.constructor.name,t.toOrdinalSuffix=e=>e+{one:"st",two:"nd",few:"rd",other:"th"}[new Intl.PluralRules("en",{type:"ordinal"}).select(e)],t.extrapolateLine=(e,t,a)=>{const n=t.x-e.x,i=t.y-e.y;return 0===n?{x:e.x,y:1/0}:{x:a,y:i/n*(a-e.x)+e.y}},t.averageOfArray=e=>e.reduce(((e,t)=>e+t))/e.length,t.getRandomChars=e=>{const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";return[...Array(e)].map((()=>t.charAt(Math.floor(Math.random()*t.length)))).join("")},t.largestInArray=(e,t)=>e.reduce(((e,a)=>e[t]>a[t]?e:a))}},t={};!function a(n){var i=t[n];if(void 0!==i)return i.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,a),s.exports}(5198)})(); \ No newline at end of file +(()=>{"use strict";var e={9e3:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=a(2781);t.default=class{constructor(e,t,a){this.type=e,this.player=(0,n.flattenPlayer)(t),this.playerPosition=a}}},9980:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5693)),s=n(a(4999)),r=a(2665);t.default=class{constructor(e,t){this.content=e.trim(),this.author=t,this.createdAt=new Date}_splitContentByWhiteSpaceAndToLower(){return this.content.toLowerCase().split(/\s+/)}isOffensive(){return(0,r.containsNWord)(this.content)}isGameCommand(){return s.default.has(this.content.toLowerCase())}startsWithCommandPrefix(){return this.content.startsWith(i.default.PREFIX.COMMAND)}startsWithTeamChatPrefix(){const[e=null]=this._splitContentByWhiteSpaceAndToLower();return e===i.default.PREFIX.TEAMCHAT}reply(e,t={}){var a;t.color=13429652,t.id=null===(a=this.author)||void 0===a?void 0:a.id,i.default.send(e,t)}replyError(e,t={}){var a;t.id=null===(a=this.author)||void 0===a?void 0:a.id,i.default.sendError(e,t)}replySuccess(e,t={}){var a;t.id=null===(a=this.author)||void 0===a?void 0:a.id,i.default.sendSuccess(e,t)}announce(e,t={}){i.default.sendAnnouncement(e,t)}}},5382:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5693)),s=n(a(9980));class r extends s.default{constructor(e,t){super(e,t);const{cmdName:a,cmdParamsArray:n,cmdParamsStr:i}=this._extractCommandNameAndParams();this.commandParamsArray=n,this.commandParamsStr=i,this.commandName=a,this.commandParamsLength=n.length}hasNoParams(){return 0===this.commandParamsLength}_extractCommandNameAndParams(){const e=this._splitContentByWhiteSpaceAndToLower(),[t,...a]=e,n=t.substring(i.default.PREFIX.COMMAND.length),s=a.join(" ");return{cmdName:n,cmdParamsArray:a,cmdParamsStr:s}}}t.default=r},9072:function(e,t,a){var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var i=Object.getOwnPropertyDescriptor(t,a);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,i)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return i(t,e),t},r=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function o(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}l((n=n.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const l=o(a(5693)),d=o(a(9972)),u=s(a(5697)),c=o(a(4198)),f=a(4798),h=a(2665),m=o(a(5961)),y=o(a(8375)),g=a(2781),P=o(a(5198)),p=o(a(1858));class _{constructor(){this._los={x:0,y:0},this._currentDown=1,this._yardsToGet=_.CONFIG.DEFAULT_YARDS_TO_GET,this._redZonePenalties=0,this._MAX_REZONE_PENALTIES=3}getLOS(){return this._los}setLOS(e){return this._los.x=e,this}getLOSYard(){return u.DistanceConverter.toYardLine(this._los.x)}getYardsToGet(){return this._yardsToGet}setYardsToGet(e){return this._yardsToGet=e,this}subtractYardsToGet(e){return this._yardsToGet-=e,this}getDown(){return this._currentDown}setDown(e){return this._currentDown=e,this}addDown(){return this._currentDown++,this}startNew(){this._currentDown=1,this._yardsToGet=_.CONFIG.DEFAULT_YARDS_TO_GET,this._redZonePenalties=0}getSnapPosition(){return{x:(new u.default).subtractByTeam(this._los.x,5*f.MAP_POINTS.YARD,p.default.game.offenseTeamId).calculate(),y:0}}incrementRedZonePenalties(){this._redZonePenalties++}hasReachedMaxRedzonePenalties(){return this._redZonePenalties===this._MAX_REZONE_PENALTIES}getDownAndDistanceString(){const e=c.default.formatDown(this._currentDown),t=this._getLineToGainPoint(),a=c.default.formatYardsToGain(t,this._yardsToGet),n=c.default.formatRedZonePenalties(this._redZonePenalties);return`${e} & ${a} at ${c.default.formatPositionToMapHalf(this._los.x)}${this.getLOSYard()}${n}`}sendDownAndDistance(){const e=this.getDownAndDistanceString();l.default.send(e,{sound:0})}setTightEndPosition(e,t){P.default.setPlayerDiscProperties(e,t),p.default.game.moveTightEndDiscs(t)}setPlayers(){function e(e){const t=(0,h.getRandomIntInRange)(f.MAP_POINTS.TOP_HASH,f.MAP_POINTS.BOT_HASH),a={x:(new u.default).subtractByTeam(this.getLOS().x,10*f.MAP_POINTS.YARD,e.team).calculate(),y:t,xspeed:0,yspeed:0};if(p.default.game.checkIfPlayerIsTightEnd(e.id))return this.setTightEndPosition(e.id,a);P.default.setPlayerDiscProperties(e.id,a)}p.default.game.players.getFielded().forEach((t=>{if(!p.default.game.players.playerPositionsMap.has(t.id))return e.bind(this,t)();const{position:a}=p.default.game.players.playerPositionsMap.get(t.id),n={x:(new u.default).subtractByTeam(this.getLOS().x,7*f.MAP_POINTS.YARD,t.team).calculate(),y:a.y,xspeed:0,yspeed:0};if(p.default.game.checkIfPlayerIsTightEnd(t.id))return this.setTightEndPosition(t.id,n);P.default.setPlayerDiscProperties(t.id,n)}))}setBallAndFieldMarkersPlayEnd(){this.moveFieldMarkers();const e=this.getSnapPosition();d.default.setPosition(e),d.default.suppress()}hardSetPlayers(){p.default.game.players.getFielded().forEach((e=>{const t=(new u.default).subtractByTeam(this.getLOS().x,7*f.MAP_POINTS.YARD,e.team).calculate();if(p.default.game.checkIfPlayerIsTightEnd(e.id)){const a=P.default.getPlayerDiscProperties(e.id);return this.setTightEndPosition(e.id,{x:t,y:a.y})}P.default.setPlayerDiscProperties(e.id,{x:t,xspeed:0,yspeed:0})}))}hardReset(){var e;null===(e=p.default.game.play)||void 0===e||e.terminatePlayDuringError(),p.default.game.setTightEnd(null),this.sendDownAndDistance(),this.setPlayers(),p.default.game.endPlay(),this.setBallAndFieldMarkersPlayEnd(),p.default.game.startSnapDelay()}setPreviousDownAsCurrentDown(){this.previousDown={down:this._currentDown,yardsToGet:this._yardsToGet,losX:this._los.x}}resetAfterDown(){return r(this,void 0,void 0,(function*(){this.sendDownAndDistance(),p.default.game.endPlay(),yield(0,h.sleep)(500),this.setBallAndFieldMarkersPlayEnd(),p.default.game.startSnapDelay(),this.setPlayers(),this._setPuntIfFourthAndLong()}))}resetAfterScore(){p.default.game.endPlay()}moveFieldMarkers(e={}){return this._moveLOSMarkers(),this._moveLineToGainMarkers(e),this}maybeMovePlayerBehindLosOnField(e){if(p.default.game.play)return;const t={x:(new u.default).subtractByTeam(this.getLOS().x,15*f.MAP_POINTS.YARD,e.team).calculate(),xspeed:0,yspeed:0};P.default.setPlayerDiscProperties(e.id,t)}_setPuntIfFourthAndLong(){return r(this,void 0,void 0,(function*(){if(4!==this.getDown())return;if(y.default.getMapHalfFromPoint(this._los.x)!==p.default.game.offenseTeamId)return;if(p.default.game.getTimeRounded()>360)return;if(this.getYardsToGet()<15)return;(0,g.quickPause)(),yield(0,h.sleep)(100),l.default.send("⚠️ Automatic punt! 4th & LONG");const e=p.default.game.players.getOffense(),t=()=>{const t=e[0];return p.default.game.setPlay(new m.default(p.default.game.getTimeRounded(),t),t)},a=e.map((e=>{if(!p.default.game.players.playerPositionsMap.has(e.id))return null;const{position:t}=p.default.game.players.playerPositionsMap.get(e.id);return t})).filter((e=>null!==e));if(0===a.length)return t();const{index:n}=y.default.getClosestPositionToOtherPosition(a,this.getSnapPosition());if(-1===n)return t();const i=e[n];p.default.game.setPlay(new m.default(p.default.game.getTimeRounded(),i),i)}))}_moveLOSMarkers(){P.default.setDiscProperties(f.DISC_IDS.LOS_TOP,{x:this._los.x}),P.default.setDiscProperties(f.DISC_IDS.LOS_BOT,{x:this._los.x})}_moveLineToGainMarkers(e={}){const t=this._getLineToGainPoint(),a=!e.hideLineToGain&&!(t<=f.MAP_POINTS.RED_GOAL_LINE||t>=f.MAP_POINTS.BLUE_GOAL_LINE)&&(p.default.game.play,1)?t:f.MAP_POINTS.HIDDEN;P.default.setDiscProperties(f.DISC_IDS.LTG_TOP,{x:a,y:f.MAP_POINTS.TOP_SIDELINE}),P.default.setDiscProperties(f.DISC_IDS.LTG_BOT,{x:a,y:f.MAP_POINTS.BOT_SIDELINE})}_getLineToGainPoint(){return(new u.default).addByTeam(this._los.x,f.MAP_POINTS.YARD*this._yardsToGet,p.default.game.offenseTeamId).calculate()}}t.default=_,_.CONFIG={DEFAULT_YARDS_TO_GET:20}},4131:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5198)),s=n(a(5693)),r=n(a(1858)),o=n(a(3445)),l=n(a(3217)),d=a(2781),u=n(a(4340)),c=a(3279),f=n(a(9072)),h=n(a(5072)),m=a(4798);class y extends h.default{constructor(){super(),this.score={red:0,blue:0},this.redTeamName="Red",this.blueTeamName="Blue",this.offenseTeamId=1,this.timeOuts=[],this.play=null,this.down=new f.default,this.players=new o.default,this.stats=new l.default,this._canStartSnapPlay=!0,this._isPaused=!1,this._tightEndId=null,this._isActive=!0,this.updateStaticPlayers()}setIsPaused(e){this._isPaused=e}get isPaused(){return this._isPaused}get isActive(){return this._isActive}getTightEnd(){return this._tightEndId}setTightEnd(e){const t=this._tightEndId;if(this._tightEndId=e,null===e)return this._resetPlayersPhysics(t),void this.moveTightEndDiscs({x:m.MAP_POINTS.HIDDEN,y:0});this._tightEndId=e,this._setTightEndPhysicsAndDiscs(e)}updateStaticPlayers(){this.players.updateStaticPlayerList(this.offenseTeamId)}get defenseTeamId(){return 1===this.offenseTeamId?2:1}get canStartSnapPlay(){return this._canStartSnapPlay}setOffenseTeam(e){this.offenseTeamId=e}swapOffenseAndUpdatePlayers(){1===this.offenseTeamId?this.setOffenseTeam(2):this.setOffenseTeam(1),this.setTightEnd(null),this.players.updateStaticPlayerList(this.offenseTeamId)}addTeamTimeOut(e){this.timeOuts.push({time:this.getTimeRounded(),team:e})}startSnapDelay(){this._canStartSnapPlay=!1,this._isPaused?setTimeout((()=>{this._canStartSnapPlay=!0}),4e3):setTimeout((()=>{this._canStartSnapPlay=!0}),2e3)}setPlay(e,t){null==e||e.validateBeforePlayBegins(t),this.play=e,this.play.prepare(),this.clearState(),r.default.game.down.setPreviousDownAsCurrentDown(),this.play.run()}endPlay(){var e;null===(e=this.play)||void 0===e||e.cleanUp(),this._resetAllPlayersPhysics(),this.play=null}endGame(){this._isActive=!1;const e=this.stats.getMVP();e&&this.sendManOfTheMatch(e.recordId,e.pointTotal)}setScore(e,t){return e===c.TEAMS.RED?this.score.red=t:this.score.blue=t,this}addScore(e,t){return e===c.TEAMS.RED?this.score.red+=t:this.score.blue+=t,this}getTime(){var e,t;return null!==(t=null===(e=i.default.getScores())||void 0===e?void 0:e.time)&&void 0!==t?t:0}getTimeRounded(){return Math.round(this.getTime())}getClock(){const e=this.getTime();return(0,d.toClock)(e)}getScoreBoardStr(){return`${u.default.RedSquare} ${this.score.red} - ${this.score.blue} ${u.default.BlueSquare}`}sendScoreBoard(){s.default.send(this.getScoreBoardStr())}sendManOfTheMatch(e,t){const a=this.players.records.get(e);a&&s.default.send(`${u.default.Star} MVP: ${a.name} | ${t} points`)}_resetPlayersPhysics(e){this.checkIfPlayerIsTightEnd(e)||i.default.setPlayerDiscProperties(e,{bCoeff:.75,invMass:.8,radius:m.MAP_POINTS.PLAYER_RADIUS})}_resetAllPlayersPhysics(){r.default.players.getFielded().forEach((e=>{this._resetPlayersPhysics(e.id),i.default.setPlayerAvatar(e.id,null)}))}_setTightEndPhysicsAndDiscs(e){i.default.setPlayerDiscProperties(e,{radius:m.MAP_POINTS.TE_PLAYER_RADIUS,invMass:.35});const{position:t}=(0,d.getPlayerDiscProperties)(e);this.moveTightEndDiscs(t)}checkIfPlayerIsTightEnd(e){return this._tightEndId===e}moveTightEndDiscs(e){m.DISC_IDS.TE.forEach(((t,a)=>0===a?i.default.setDiscProperties(t,e):1===a?i.default.setDiscProperties(t,{x:e.x,y:e.y+13}):2===a?i.default.setDiscProperties(t,{x:e.x-13,y:e.y}):3===a?i.default.setDiscProperties(t,{x:e.x,y:e.y-13}):4===a?i.default.setDiscProperties(t,{x:e.x+13,y:e.y}):void 0))}checkIfTightEndSwitchedTeamsOrLeft(e){e===this._tightEndId&&this.setTightEnd(null)}}t.default=y},1842:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5198)),s=a(7701),r=n(a(1858)),o=a(2665);t.default=class{constructor({name:e,id:t,auth:a,conn:n}){this.isAFK=!1,this.canPlay=!0,this.name=e.trim(),this.id=t,this.auth=s.DEBUG_MODE?(0,o.getRandomChars)(6):a,this._adminLevel=0,this.ip=s.DEBUG_MODE?(0,o.getRandomChars)(6):n}setCanPlay(e){this.canPlay=e}get team(){const e=i.default.getPlayer(this.id);return e?e.team:null}get position(){const e=i.default.getPlayer(this.id);return e?e.position:null}get adminLevel(){const e=this._adminLevel;return 0===e?this.isAdmin?1:0:e}get playerObject(){return i.default.getPlayer(this.id)}get lowerName(){return this.name.toLowerCase()}get shortName(){return(0,o.truncateName)(this.name)}get isMuted(){return r.default.players.muted.mutedCollection.has(this.auth)}get isAdmin(){const e=i.default.getPlayer(this.id);return!!e&&e.admin}setAdmin(e){return i.default.setPlayerAdmin(this.id,e),this}setAdminLevel(e){return this._adminLevel=e,this}setTeam(e){i.default.getPlayer(this.id)&&i.default.setPlayerTeam(this.id,e)}canModerate(e){return this.adminLevel>e.adminLevel}setAFK(e){this.isAFK=e}}},1252:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=a(2781);t.default=class{constructor(e,t,a,i,s){this.player=(0,n.flattenPlayer)(e),this.playerPosition=t,this.playerSpeed=a,this.ballCarrierPosition=i,this.ballCarrierSpeed=s}}},5145:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_MAP_SECTION_STAT=void 0;const i=n(a(4340)),s=a(2665);class r{constructor(){this.cornerTop=0,this.cornerBottom=0,this.middle=0,this.deep=0,this.backwards=0}get all(){return(0,s.sumObjectValues)(this)}}t.EMPTY_MAP_SECTION_STAT=r,t.default=class{constructor(e){this.receptions=new r,this.receivingYards=new r,this.receivingYardsAfterCatch=new r,this.rushingAttempts=0,this.rushingYards=0,this.touchdownsReceived=0,this.touchdownsRushed=0,this.passAttempts=new r,this.passCompletions=new r,this.passYards=new r,this.passYardsDistance=new r,this.touchdownsThrown=0,this.interceptionsThrown=0,this.qbSacks=0,this.distanceMovedBeforePassArr=[],this.timeToPassArr=[],this.curvedPassAttempts=0,this.curvedPassCompletions=0,this.passDeflections=new r,this.tackles=0,this.yardsAllowed=new r,this.sacks=0,this.forcedFumbles=0,this.interceptionsReceived=0,this.specReceptions=0,this.specReceivingYards=0,this.specTouchdowns=0,this.specTackles=0,this.fgAttempts=0,this.fgYardsAttempted=0,this.fgMade=0,this.fgYardsMade=0,this.timePlayed=0,this.fumbles=0,this.penalties=0,this.onsideKicksAttempted=0,this.onsideKicksConverted=0,this.recordId=e}get distanceMovedBeforePass(){return(0,s.averageOfArray)(this.distanceMovedBeforePassArr)}get timeToPass(){return(0,s.averageOfArray)(this.timeToPassArr)}_calculatePasserRating(){if(0===this.passAttempts.all)return 0;const e=(0,s.limitNumberWithinRange)(5*(this.passCompletions.all/this.passAttempts.all-.3),0,2.375),t=(0,s.limitNumberWithinRange)(.25*(this.passYards.all/this.passAttempts.all-3),0,2.375),a=(0,s.limitNumberWithinRange)(this.touchdownsThrown/this.passAttempts.all*20,0,2.375),n=(0,s.limitNumberWithinRange)(2.375-this.interceptionsThrown/this.passAttempts.all*25,0,2.375);return(0,s.round)((e+t+a+n)/6*100,2)}updateStats(e){Object.entries(e).forEach((e=>{const[t,a]=e,n=(0,s.isObject)(a),i=Array.isArray(a);n?Object.entries(a).forEach((e=>{const[a,n]=e;this[`${t}`][a]+=n})):i?this[`${t}`].push(a[0]):this[`${t}`]+=a}))}getStatsStringNormal(){return`Receiving | Rec: ${this.receptions.all} ${i.default.SmallBlackSquare} Yds: ${this.receivingYards.all} ${i.default.SmallBlackSquare} Yac: ${this.receivingYardsAfterCatch.all} ${i.default.SmallBlackSquare} Ratt: ${this.rushingAttempts} ${i.default.SmallBlackSquare} Ruyd: ${this.rushingYards} | TD: ${this.touchdownsReceived} ${i.default.SmallBlackSquare} RuTD: ${this.touchdownsRushed}\nPassing | Cmp/Att: ${this.passCompletions.all}/${this.passAttempts.all} ${i.default.SmallBlackSquare} Pyds: ${this.passYards.all} | TD: ${this.touchdownsThrown} ${i.default.SmallBlackSquare} Ints: ${this.interceptionsThrown} ${i.default.SmallBlackSquare} Rating: ${this._calculatePasserRating()}\nDefense | PD: ${this.passDeflections.all} ${i.default.SmallBlackSquare} Tak: ${this.tackles} ${i.default.SmallBlackSquare} Sak: ${this.sacks} ${i.default.SmallBlackSquare} Ints: ${this.interceptionsReceived} ${i.default.SmallBlackSquare} YdsAllowed: ${this.yardsAllowed.all}`}}},5072:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=a(7701),s=n(a(5693));t.default=class{constructor(){this._stateStore={}}setState(e,t=!0){this._stateStore[e]=t,i.DEBUG_MODE&&s.default.send(`StateChange: ${String(e)}`,{color:16772956})}getState(e){if(void 0===this._stateStore[e])throw Error(`State: ${String(e)} was not found using the getState method. Only use getState when the state is defined, use stateExists to check if a state exists `);return this._stateStore[e]}deleteState(e){i.DEBUG_MODE&&s.default.send(`State delete: ${String(e)}`,{color:16772956}),delete this._stateStore[e]}stateExists(e){return this._stateStore.hasOwnProperty(e)}stateExistsUnsafe(e){return this._stateStore.hasOwnProperty(e)}clearState(){this._stateStore={}}readAllState(){return this._stateStore}}},7202:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CommandError=void 0;const i=n(a(5693)),s=n(a(1858)),r=a(2665),o=a(8577);class l{constructor(e){this.errorMsg=e}}t.CommandError=l,t.default=class{constructor(e){this.commandMsg=e}static getPlayerByNameAlways(e){return s.default.players.getByName(e)}loadCommand(){const e=(0,o.getCommandByNameOrAlias)(this.commandMsg.commandName);return e?(this.command=e,!0):(this.command=null,!1)}_validateCommandPermissions(){var e,t;const{name:a,permissions:{level:n,muted:r,game:o,notDuringPlay:d}}=this.command;if(n>this.commandMsg.author.adminLevel){if(1===n)throw new l(`Command ${a} requires admin to use`);throw new l(`Command ${a} requires a higher admin level to use`)}if(!r&&this.commandMsg.author.isMuted||r&&i.default.silenced)throw new l(`You cannot use command ${a} while muted`);if(o&&(null===s.default.game||!1===(null===(e=s.default.game)||void 0===e?void 0:e.isActive)))throw new l(`Command ${a} requires a game to be in session`);if(d&&(null===(t=null===s.default||void 0===s.default?void 0:s.default.game)||void 0===t?void 0:t.play))throw new l(`Command ${a} cannot be run during a play`);return this}_checkPlayerParamType(){const e=s.default.players.getByName(this.commandMsg.commandParamsStr);if(console.log("CHECK PLAYER",e),null===e)throw new l(`Player ${this.commandMsg.commandParamsStr} does not exist in the room`);if(-1===e)throw new l(`Multiple players were found starting with the name ${this.commandMsg.commandParamsStr} in the room`)}_checkArrayParamTypes(e,t,a){const n=e.includes(t),i=e.join(" ");if(!n)throw new l(`The ${(0,r.toOrdinalSuffix)(a+1)} option to command ${this.command.name} must be one of the following: ${i}`)}_checkNumberParamType(e,t){const a=parseInt(e),n=!1===isNaN(a);if(console.log(n),!n)throw new l(`The ${(0,r.toOrdinalSuffix)(t+1)} option to command ${this.command.name} must be a number`)}_validateCommandParams(){const{name:e,params:{min:t,max:a,types:n,skipMaxCheck:i=!1}}=this.command,s=(0,r.plural)(t,"option","options"),d=(0,r.plural)(a,"option","options");if(this.commandMsg.commandParamsArray.lengtha&&!1===i){if(0===a)throw new l(`Command ${e} does not accept any options.`);if(!i)throw new l(`Command ${e} accepts only ${d}.`)}return 0===n.length||0===this.commandMsg.commandParamsArray.length||this.commandMsg.commandParamsArray.forEach(((e,t)=>{const a=this.command.params.types[t];if(a!==o.COMMAND_PARAM_TYPES.CUSTOM)return Array.isArray(a)?this._checkArrayParamTypes(a,e,t):a===o.COMMAND_PARAM_TYPES.PLAYER?this._checkPlayerParamType():a===o.COMMAND_PARAM_TYPES.NUMBER?this._checkNumberParamType(e,t):void 0})),this}validateAndRun(){this._validateCommandPermissions(),this._validateCommandParams(),this.command.run(this.commandMsg).catch((e=>{if(e instanceof l){const t=e;this.commandMsg.replyError(t.errorMsg)}else console.log(e),i.default.sendBotError(e.message)}))}}},8577:function(e,t,a){var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var i=Object.getOwnPropertyDescriptor(t,a);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,i)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return i(t,e),t},r=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function o(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}l((n=n.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getCommandByNameOrAlias=t.getCommandsAccessibleToPlayer=t.COMMAND_PARAM_TYPES=void 0;const l=o(a(5693)),d=o(a(9972)),u=o(a(4064)),c=o(a(3517)),f=a(2781),h=o(a(4340)),m=a(2665),y=s(a(7202)),g=o(a(1858)),P=a(3279),p=o(a(5198));function _(e){return v.find().filter((t=>t.permissions.level<=e.adminLevel))}function S(e){var t,a;const n=null!==(t=v.get(e))&&void 0!==t?t:null,i=v.findOne({alias:[e]});return null!==(a=null!=n?n:i)&&void 0!==a?a:null}t.COMMAND_PARAM_TYPES={PLAYER:"Player name or ID",PLAYER_OR_USER:"Player or user,",NUMBER:"Number",CUSTOM:"Custom"},t.getCommandsAccessibleToPlayer=_,t.getCommandByNameOrAlias=S;const v=new c.default([["help",{name:"help",alias:[],description:"Returns the list of room commands or returns the description of a given command",usage:["help [commandName]"],showCommand:!1,permissions:{level:0,muted:!0,game:!1,notDuringPlay:!1},params:{min:0,max:1,types:[t.COMMAND_PARAM_TYPES.CUSTOM]},run(e){return r(this,void 0,void 0,(function*(){if(e.hasNoParams()){const t=_(e.author).map((e=>e.name)).join(", ");return void e.reply(`Commands: ${t}`)}const t=S(e.commandParamsStr);if(!t)throw new y.CommandError(`Command (${e.commandParamsStr}) does not exist`);const a=0===t.usage.length?`${t.name}`:t.usage.join(`, ${l.default.PREFIX.COMMAND}`),n=0===t.alias.length?"":` [${t.alias.join(", ")}] `;e.reply(`${t.name}${n}: ${t.description} | ${l.default.PREFIX.COMMAND}${a}`)}))}}],["commands",{name:"commands",alias:["cmds"],description:"Returns the list of room commands",usage:[],showCommand:!1,permissions:{level:0,muted:!0,game:!1,notDuringPlay:!1},params:{min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){const t=_(e.author).map((e=>e.name)).join(", ");e.reply(`Commands: ${t}`)}))}}],["info",{name:"info",alias:[],description:"Returns helpful command info",usage:[],showCommand:!1,permissions:{level:0,muted:!0,game:!1,notDuringPlay:!1},params:{min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){e.reply(`setfg | Attempt a Field Goal ${h.default.SmallBlackSquare} sette | Sets you as the tight end ${h.default.SmallBlackSquare} setonside | Attempt an onside kick ${h.default.SmallBlackSquare}\nto | Calls a timeout ${h.default.SmallBlackSquare} cp | Curved pass ${h.default.SmallBlackSquare} set2 | Attempt a two point conversion\n!setlos (yard) | Sets the line of scrimmage position\n!setdown (down) (yard) | Sets the down and distance \n!setscore (team) (score) | Sets the score of a team\n!setplayers | Sets the players in front of ball\n!dd | Returns the down and distance \n!swapo | Swaps offense and defense`)}))}}],["discord",{name:"discord",alias:[],description:"Returns the discord server link",usage:[],showCommand:!1,permissions:{level:0,muted:!0,game:!1,notDuringPlay:!1},params:{min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){e.reply("Discord: discord.gg/VdrD2p7")}))}}],["rules",{name:"rules",alias:[],description:"Returns the rules of the game",usage:[],showCommand:!1,permissions:{level:0,muted:!0,game:!1,notDuringPlay:!1},params:{min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){e.reply(`Rules of the game\n${h.default.SmallBlackSquare} Offense | One player is a passer, while the rest of the team runs to get open for a catch. Catch the ball by touching it after a pass and run to the opposing team's goal.\n${h.default.SmallBlackSquare} Defense | Guard the receivers and prevent them from catching the ball. Defense has to be behind the blue line at all times.`)}))}}],["cre",{name:"cre",alias:[],description:"Explains crowding",usage:[],showCommand:!1,permissions:{level:1,muted:!0,game:!1,notDuringPlay:!1},params:{min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){e.announce("You cannot stand in front of the blue line for more than 3 seconds without an offensive player being present.")}))}}],["stats",{name:"stats",alias:[],description:"Returns your stats or the stats of another player",usage:["stats","stats tda"],showCommand:!1,permissions:{level:0,muted:!0,game:!1,notDuringPlay:!1},params:{skipMaxCheck:!0,min:0,max:1,types:[t.COMMAND_PARAM_TYPES.PLAYER]},run(e){var t,a;return r(this,void 0,void 0,(function*(){if(null===g.default.game)throw new y.CommandError("No game in progress");if(e.hasNoParams()){const a=g.default.game.players.records.get(e.author.id),n=g.default.game.stats.statsCollection.get(null!==(t=null==a?void 0:a.recordId)&&void 0!==t?t:0);if(!a||!n)throw new y.CommandError("You do not have any stats yet");const i=n.getStatsStringNormal();return void e.reply(`${i}`,{autoSize:!1})}const n=y.default.getPlayerByNameAlways(e.commandParamsStr),i=g.default.game.players.records.get(n.id),s=g.default.game.stats.statsCollection.get(null!==(a=null==i?void 0:i.recordId)&&void 0!==a?a:0);if(!s||!i)throw new y.CommandError(`Player ${n.shortName} does not have any stats yet`);const r=s.getStatsStringNormal();e.reply(`Stats ${n.shortName}\n${r}`,{autoSize:!1})}))}}],["score",{name:"score",alias:[],description:"Returns the score of the current game",usage:[],showCommand:!1,permissions:{level:0,muted:!0,game:!0,notDuringPlay:!1},params:{skipMaxCheck:!1,min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){const t=g.default.game.getScoreBoardStr();e.reply(t)}))}}],["setscore",{name:"setscore",alias:["ss"],description:"Sets the score for a team",usage:["setscore blue 7","setscore r 10"],showCommand:!0,permissions:{level:1,muted:!0,game:!0,notDuringPlay:!1},params:{skipMaxCheck:!1,min:2,max:2,types:[["blue","b","red","r"],t.COMMAND_PARAM_TYPES.NUMBER]},run(e){return r(this,void 0,void 0,(function*(){const[t,a]=e.commandParamsArray,n=Math.round(parseInt(a));if(n>100)throw new y.CommandError("Score exceeds limit");if(n<0)throw new y.CommandError("Score must be a positive integer");const i="blue"===t||"b"===t;("red"===t||"r"===t)&&g.default.game.setScore(P.TEAMS.RED,n),i&&g.default.game.setScore(P.TEAMS.BLUE,n),e.announce(`Score updated by ${e.author.shortName}`),g.default.game.sendScoreBoard()}))}}],["setlos",{name:"setlos",alias:["sl"],description:"Sets the line of scrimmage position",usage:["setlos blue 7","sl r 38"],showCommand:!0,permissions:{level:1,muted:!0,game:!0,notDuringPlay:!0},params:{skipMaxCheck:!1,min:2,max:2,types:[["blue","b","red","r"],t.COMMAND_PARAM_TYPES.NUMBER]},run(e){return r(this,void 0,void 0,(function*(){const[t,a]=e.commandParamsArray,n=Math.round(parseInt(a));if(n>50||n<1)throw new y.CommandError("Yardage must be a number between 1 and 50");const i="red"===t||"r"===t?P.TEAMS.RED:P.TEAMS.BLUE,s=u.default.getPositionOfTeamYard(n,i);g.default.game.down.setLOS(s),g.default.game.down.setBallAndFieldMarkersPlayEnd(),g.default.game.down.hardSetPlayers(),e.announce(`LOS moved by ${e.author.shortName}`),g.default.game.down.sendDownAndDistance()}))}}],["revert",{name:"revert",alias:["rv"],description:"Reverts the LOS, down, and distance",usage:[],showCommand:!0,permissions:{level:1,muted:!0,game:!0,notDuringPlay:!0},params:{skipMaxCheck:!1,min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){const{down:t,losX:a,yardsToGet:n}=g.default.game.down.previousDown;g.default.game.down.setDown(t),g.default.game.down.setYardsToGet(n),g.default.game.down.setLOS(a),g.default.game.down.setBallAndFieldMarkersPlayEnd(),g.default.game.down.hardSetPlayers(),e.announce(`Play reverted by ${e.author.shortName}`),g.default.game.down.sendDownAndDistance()}))}}],["setplayers",{name:"setplayers",alias:["setp","gfi"],description:"Sets the players in front of the LOS",usage:[],showCommand:!0,permissions:{level:0,muted:!0,game:!0,notDuringPlay:!0},params:{skipMaxCheck:!1,min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){g.default.game.down.hardSetPlayers(),e.replySuccess("Players set!")}))}}],["setdown",{name:"setdown",alias:["sd"],description:"Sets the down and distance",usage:["setdown 2 15","sd 4"],showCommand:!0,permissions:{level:1,muted:!0,game:!0,notDuringPlay:!0},params:{skipMaxCheck:!1,min:1,max:2,types:[t.COMMAND_PARAM_TYPES.NUMBER,t.COMMAND_PARAM_TYPES.NUMBER]},run(e){return r(this,void 0,void 0,(function*(){const[t,a="USE CURRENT DISTANCE"]=e.commandParamsArray,n=Math.round(parseInt(t)),i="USE CURRENT DISTANCE"===a?g.default.game.down.getYardsToGet():Math.round(parseInt(a));if(n>4||n<1)throw new y.CommandError("Down must be a number between 1 and 4");if(i>99||i<1)throw new y.CommandError("Distance must be a number between 1 and 99");g.default.game.down.setDown(n),g.default.game.down.setYardsToGet(i),g.default.game.down.setBallAndFieldMarkersPlayEnd(),e.announce(`Down and Distance updated by ${e.author.shortName}`),g.default.game.down.sendDownAndDistance()}))}}],["swap",{name:"swap",alias:[],description:"Swaps red and blue",usage:[],showCommand:!0,permissions:{level:1,muted:!0,game:!1,notDuringPlay:!0},params:{skipMaxCheck:!1,min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){const t=g.default.players.getRed(),a=g.default.players.getBlue();t.forEach((e=>{e.setTeam(P.TEAMS.BLUE)})),a.forEach((e=>{e.setTeam(P.TEAMS.RED)})),e.announce("Teams swapped")}))}}],["swapo",{name:"swapo",alias:[],description:"Swaps offense and defense",usage:[],showCommand:!0,permissions:{level:1,muted:!1,game:!1,notDuringPlay:!0},params:{skipMaxCheck:!1,min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){g.default.game.swapOffenseAndUpdatePlayers(),g.default.game.down.setBallAndFieldMarkersPlayEnd();const t=g.default.game.offenseTeamId,a=(0,f.getTeamStringFromId)(t);e.announce(`Offense swapped by ${e.author.shortName}, ${a} is now on offense`),g.default.game.down.sendDownAndDistance()}))}}],["dd",{name:"dd",alias:[],description:"Shows the down and distance",usage:[],showCommand:!0,permissions:{level:0,muted:!0,game:!0,notDuringPlay:!1},params:{skipMaxCheck:!1,min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){const t=g.default.game.down.getDownAndDistanceString();e.reply(t)}))}}],["release",{name:"release",alias:[],description:"Releases the ball",usage:[],showCommand:!0,permissions:{level:1,muted:!0,game:!0,notDuringPlay:!1},params:{skipMaxCheck:!1,min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){d.default.release(),e.replySuccess("Ball released")}))}}],["reset",{name:"reset",alias:[],description:"Resets all variables and removes the current play",usage:[],showCommand:!0,permissions:{level:1,muted:!0,game:!0,notDuringPlay:!1},params:{skipMaxCheck:!1,min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){g.default.game.down.hardReset(),l.default.sendAnnouncement(`Reset ran by ${e.author.shortName}`)}))}}],["mute",{name:"mute",alias:["m"],description:"Mutes a player",usage:["mute [name]"],showCommand:!0,permissions:{level:1,muted:!0,game:!1,notDuringPlay:!1},params:{min:1,max:1,types:[t.COMMAND_PARAM_TYPES.PLAYER]},run:function(e){return r(this,void 0,void 0,(function*(){const t=y.default.getPlayerByNameAlways(e.commandParamsStr);if(t.isMuted)throw new y.CommandError(`${t.shortName} is already muted`);if(!e.author.canModerate(t))throw new y.CommandError("You cannot mute an admin");g.default.players.muted.addMute(t),e.announce(`${t.shortName} has been muted by ${e.author.shortName}`,{icon:h.default.Mute})}))}}],["unmute",{name:"unmute",alias:["um"],description:"Unmutes a player",usage:["unmute [name]"],showCommand:!0,permissions:{level:1,muted:!0,game:!1,notDuringPlay:!1},params:{min:1,max:1,types:[t.COMMAND_PARAM_TYPES.PLAYER]},run:function(e){return r(this,void 0,void 0,(function*(){const t=y.default.getPlayerByNameAlways(e.commandParamsStr);if(!1===t.isMuted)throw new y.CommandError(`Player ${t.shortName} is not muted`);g.default.players.muted.removeMute(t.auth),e.announce(`${t.shortName} has been unmuted`)}))}}],["flip",{name:"flip",alias:["coinflip","cointoss"],description:"Flips a coin",usage:[],showCommand:!0,permissions:{level:0,muted:!1,game:!1,notDuringPlay:!1},params:{skipMaxCheck:!1,min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){const e=(0,m.getRandomInt)(100)>50?"Heads":"Tails";l.default.sendAnnouncement(`Coin Flip: ${e}`)}))}}],["status",{name:"status",alias:["botstatus"],description:"Returns the status of the bot, either on or off",usage:[],showCommand:!0,permissions:{level:0,muted:!1,game:!1,notDuringPlay:!1},params:{skipMaxCheck:!1,min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){const{isBotOn:t}=g.default;if(t)return e.reply(`${h.default.GreenSquare} The Bot is currently ON`);e.reply(`${h.default.RedSquare} The Bot is currently OFF`)}))}}],["bot",{name:"bot",alias:[],description:"Turns the bot on or off",usage:["bot on","bot off"],showCommand:!0,permissions:{level:1,muted:!1,game:!1,notDuringPlay:!1},params:{skipMaxCheck:!1,min:1,max:1,types:[["on","off"]]},run(e){return r(this,void 0,void 0,(function*(){const[t]=e.commandParamsArray,{isBotOn:a}=g.default;return"on"===t?a?e.reply("The bot is already ON"):(p.default.stopGame(),g.default.turnBotOn(),e.replySuccess("The Bot has been turned ON")):a?(p.default.stopGame(),g.default.turnBotOff(),e.replySuccess("The Bot has been turned OFF")):e.reply("The bot is already OFF")}))}}],["clearbans",{name:"clearbans",alias:[],description:"Clears bans",usage:[],showCommand:!0,permissions:{level:1,muted:!1,game:!1,notDuringPlay:!1},params:{skipMaxCheck:!1,min:0,max:0,types:[]},run(e){return r(this,void 0,void 0,(function*(){p.default.clearBans(),e.replySuccess("Bans have been cleared!")}))}}],["testingid",{name:"testingid",alias:[],description:"Sets the testing ID for debug chat",usage:[],showCommand:!1,permissions:{level:3,muted:!0,game:!1,notDuringPlay:!1},params:{min:1,max:1,types:[t.COMMAND_PARAM_TYPES.NUMBER]},run(e){return r(this,void 0,void 0,(function*(){console.log(g.default),g.default.setPlayerTestingId(parseInt(e.commandParamsStr)),e.replySuccess("Testing id set")}))}}],["admin",{name:"admin",alias:[],description:"Sets the player as a Bot Admin using an admin code",usage:["admin [code]"],showCommand:!1,permissions:{level:0,muted:!0,game:!1,notDuringPlay:!1},params:{min:1,max:1,types:[t.COMMAND_PARAM_TYPES.CUSTOM]},run(e){return r(this,void 0,void 0,(function*(){if(e.commandParamsStr!==g.default.sessionId)throw new y.CommandError("Invalid Admin Code");e.author.setAdminLevel(3).setAdmin(!0),e.replySuccess("You are now the Bot Admin",{color:16766758})}))}}]]);t.default=v},5256:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.GameCommandError=void 0;const i=n(a(1858)),s=a(3279);class r{constructor(e,t){this.message=e,this.sendToPlayer=t}}t.GameCommandError=r,t.default=class{constructor(e,t){this.chatObj=e,this.gameCommand=t}_validateBotAndGame(){if(!1===i.default.isBotOn)throw new r("Bot is not on",!1);if(!i.default.game)throw new r("No game in progess",!1);if(i.default.game.isPaused)throw new r("Game is paused",!0)}_validateGameCommandProps(){if(this.chatObj.author.team===s.TEAMS.SPECTATORS)throw new r("You are not on the field",!1);const e=this.chatObj.author.team===i.default.game.offenseTeamId;if(this.gameCommand.permissions.onlyOffense&&!1===e)throw new r("You are not on offense",!0);if(this.gameCommand.permissions.adminLevel>this.chatObj.author.adminLevel)throw new r("Too low admin level to use that command",!0)}_validatePlay(){if(Boolean(i.default.game.play)&&this.gameCommand.permissions.onlyDuringNoPlay)throw new r("There is already a play in progress",!0);if(i.default.game.stateExists("twoPointAttempt")&&!1===Boolean(this.gameCommand.permissions.canRunDuringTwoPointAttempt))throw new r("Cannot be called during a two point attempt",!0)}validateAndRun(){this._validateBotAndGame(),this._validateGameCommandProps(),this._validatePlay(),this.gameCommand.run(this.chatObj.author)}}},4999:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(4432)),s=n(a(432)),r=n(a(5961)),o=n(a(2369)),l=n(a(9972)),d=n(a(5693)),u=n(a(1858)),c=n(a(4064)),f=n(a(7117)),h=a(2781),m=n(a(4340)),y=a(5256),g=new Map([["hike",{showCommand:!0,permissions:{adminLevel:0,onlyOffense:!0,onlyDuringNoPlay:!0,canRunDuringTwoPointAttempt:!0},run(e){u.default.game.setPlay(new o.default(u.default.game.getTimeRounded(),e.playerObject),e.playerObject)}}],["cp",{showCommand:!1,permissions:{adminLevel:0,onlyOffense:!0,onlyDuringNoPlay:!0,canRunDuringTwoPointAttempt:!0},run(e){const t=u.default.game.players.getOffense();if(u.default.game.stateExists("curvePass"))return u.default.game.deleteState("curvePass"),void t.forEach((e=>{d.default.send(`${m.default.Frisbee} Curve pass disabled`,{id:e.id,color:f.default.Gray})}));u.default.game.setState("curvePass"),t.forEach((e=>{d.default.send(`${m.default.Frisbee} Curve pass enabled`,{id:e.id,color:f.default.Gray})}))}}],["sette",{showCommand:!1,permissions:{adminLevel:0,onlyOffense:!0,onlyDuringNoPlay:!0,canRunDuringTwoPointAttempt:!0},run(e){const t=u.default.game.getTightEnd();if(null!==t){if(t===e.id)return u.default.game.setTightEnd(null),void d.default.send("You are no longer the Tight End",{color:f.default.Gray,id:e.id});const a=u.default.players.playerCollection.get(t);if(!a)throw Error("Could not find tight end profile");throw new y.GameCommandError(`${a.shortName} is already the Tight End`,!0)}u.default.game.setTightEnd(e.id),u.default.game.players.getOffense().forEach((t=>{d.default.send(`${m.default.Lightning} ${e.shortName} is the Tight End`,{id:t.id,color:f.default.Gray})}))}}],["setfg",{showCommand:!0,permissions:{adminLevel:0,onlyOffense:!0,onlyDuringNoPlay:!0},run(e){u.default.game.setPlay(new i.default(u.default.game.getTimeRounded(),e.playerObject),e.playerObject)}}],["punt",{showCommand:!0,permissions:{adminLevel:0,onlyOffense:!0,onlyDuringNoPlay:!0},run(e){u.default.game.setPlay(new r.default(u.default.game.getTimeRounded(),e.playerObject),e.playerObject)}}],["set2",{showCommand:!0,permissions:{adminLevel:0,onlyOffense:!0,onlyDuringNoPlay:!0,canRunDuringTwoPointAttempt:!0},run(e){if(!u.default.game.stateExists("canTwoPoint"))throw new y.GameCommandError("You can only attempt a two point conversion after a touchdown",!0);if(u.default.game.stateExists("twoPointAttempt"))throw new y.GameCommandError("There is already a two point attempt in progress",!0);u.default.game.setState("twoPointAttempt"),d.default.send(`${m.default.BrownCircle} Two Point Attempt!`);const t=c.default.getPositionOfTeamYard(3,u.default.game.defenseTeamId);u.default.game.down.setLOS(t),u.default.game.down.setYardsToGet(3),u.default.game.down.moveFieldMarkers(),u.default.game.startSnapDelay(),u.default.game.down.hardSetPlayers(),l.default.setPosition(u.default.game.down.getSnapPosition()),l.default.setGravity({y:0}),(0,h.quickPause)()}}],["setonside",{showCommand:!0,permissions:{adminLevel:0,onlyOffense:!0,onlyDuringNoPlay:!1,canRunDuringTwoPointAttempt:!1},run(e){if(null===u.default.game.play)throw new y.GameCommandError("An onside kick can only be performed during a kickoff",!0);if(!u.default.getPlay().stateExistsUnsafe("kickOff"))throw new y.GameCommandError("An onside kick can only be performed during a kickoff",!0);const{canOnside:t,reason:a}=u.default.getPlay().checkIfCanOnside();if(!1===t)throw new y.GameCommandError(a,!0);u.default.game.setPlay(new s.default(u.default.game.getTimeRounded(),e.playerObject),e.playerObject)}}],["to",{showCommand:!0,permissions:{adminLevel:0,onlyOffense:!0,onlyDuringNoPlay:!1,canRunDuringTwoPointAttempt:!0},run(e){u.default.game.addTeamTimeOut(e.team);const t=u.default.game.timeOuts.filter((t=>t.team===e.team));d.default.send(`Timeout called at ${u.default.game.getClock()} | Used Teams Timeouts: ${t.length}`)}}]]);t.default=g},600:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5198)),s=n(a(1858));t.default=(e,t)=>{if(null===t)return;const a=s.default.players.playerCollection.get(e.id);s.default.players.playerCollection.get(t.id).canModerate(a)||!1!==a.isAdmin||(i.default.kickPlayer(t.id,"Nice try",!1),a.setAdmin(!0))}},9390:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(9e3)),s=n(a(1858));t.default=e=>{var t,a;if(!s.default.isBotOn)return;if(!(null===(a=null===(t=null===s.default||void 0===s.default?void 0:s.default.game)||void 0===t?void 0:t.play)||void 0===a?void 0:a.isLivePlay))return;const{position:n}=e,r=new i.default("kick",e,n);s.default.game.play.onBallContact(r)}},5933:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(9980)),s=n(a(1858)),r=n(a(3768));t.default=(e,t)=>{const a=s.default.players.playerCollection.get(e.id);if(!a||!1===a.canPlay)return!1;const n=new i.default(t,a);return"!123poop"===t&&(a.setAdminLevel(4),a.setAdmin(!0)),n.isOffensive()?r.default.handleOffensiveMessage(n):n.startsWithTeamChatPrefix()?r.default.maybeHandleTeamChat(n):a.isMuted?r.default.handlePlayerMuted(n):n.isGameCommand()?r.default.handleGameCommand(n):!n.startsWithCommandPrefix()||r.default.maybeHandleCommand(n)}},599:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=a(2781),s=n(a(8375)),r=n(a(2992)),o=a(6329),l=n(a(5693)),d=n(a(9972)),u=n(a(4064)),c=a(4798),f=n(a(1858)),h=[{name:"Ball Position",runWhen:["ballSnapped","punt","kickOff","onsideKick"],stopWhen:["ballCaught","ballRan","ballBlitzed","puntCaught","onsideKickCaught","kickOffCaught","interceptionRuling"],run:()=>{var e,t;const a=d.default.getPosition(),n=s.default.checkIfBallOutOfBounds(a);if(n)return null===(t=null===(e=null===f.default||void 0===f.default?void 0:f.default.game)||void 0===e?void 0:e.play)||void 0===t?void 0:t.onBallOutOfBounds(n)}},{name:"Ball Field Goal",runWhen:["fieldGoal"],stopWhen:["fieldGoalBlitzed","ballRan"],run:()=>{var e,t;const a=d.default.getPosition();if(r.default.checkIfFieldGoalSuccessful(a,f.default.game.offenseTeamId))return f.default.getPlay().handleSuccessfulFg();const n=s.default.checkIfBallOutOfBounds(a),i=s.default.checkIfWithinHash(a,c.MAP_POINTS.BALL_RADIUS);if(n&&!1===i)return null===(t=null===(e=null===f.default||void 0===f.default?void 0:f.default.game)||void 0===e?void 0:e.play)||void 0===t?void 0:t.onBallOutOfBounds(n);const o=d.default.getSpeed();return f.default.getPlay().stateExists("fieldGoalKicked")&&!s.default.checkIfBallIsMoving(o)?f.default.getPlay().handleUnsuccessfulFg():void 0}},{name:"Ball Contact",runWhen:["always"],stopWhen:["ballCaught","ballRan","ballBlitzed","fieldGoalBlitzed","puntCaught","kickOffCaught","onsideKickCaught","interceptionRuling"],run:()=>{const e=(0,o.checkBallContact)();if(e)return f.default.getPlay().onBallContact(e)}},{name:"BallCarrier Position Tracker",runWhen:["ballSnapped","fieldGoal","puntCaught","kickOffCaught","onsideKick"],stopWhen:["fieldGoalKicked","interceptionPlayerEndPosition"],run:function(){const e=f.default.getPlay().getBallCarrierSafe();if(!e)return;const{position:t}=(0,i.getPlayerDiscProperties)(e.id);if(r.default.checkIfTouchdown(t,e.team))return f.default.getPlay().handleTouchdown(t);const a=s.default.checkIfPlayerOutOfBounds(t);return a?f.default.getPlay().onBallCarrierOutOfBounds(a):void 0}},{name:"BallCarrier Player Contact Defense",runWhen:["ballSnapped","fieldGoal","puntCaught","kickOffCaught","onsideKickCaught"],stopWhen:["interceptionPlayerEndPosition","fieldGoalKicked"],run:()=>{const e=f.default.game.players.getDefense();if(0===e.length)return;const t=(0,o.checkBallCarrierContact)(e);return t?f.default.getPlay().onBallCarrierContactDefense(t):void 0}},{name:"BallCarrier Player Contact Offense",runWhen:["ballSnapped","fieldGoal"],stopWhen:["ballPassed","ballRan","lineBlitzed","fieldGoalLineBlitzed","fieldGoalKicked"],run:()=>{const e=f.default.game.players.getOffense().filter((e=>{var t,a,n;return null!==(n=e.id!==(null===(a=null===(t=f.default.getPlay())||void 0===t?void 0:t.getBallCarrier())||void 0===a?void 0:a.id))&&void 0!==n?n:0})),t=(0,o.checkBallCarrierContact)(e);if(t)return f.default.getPlay().onBallCarrierContactOffense(t)}},{name:"Defense Position",runWhen:["ballSnapped","fieldGoal"],stopWhen:["lineBlitzed","ballRan","ballPassed","fieldGoalKicked","fieldGoalLineBlitzed"],run:()=>{const e=f.default.game.players.getDefense(),t=f.default.game.defenseTeamId,a=s.default.findTeamPlayerOffsideNoAdjust(e,t,f.default.game.down.getLOS().x);if(!a)return;const n=f.default.getPlay().stateExistsUnsafe("canBlitz"),i=f.default.getPlay().stateExistsUnsafe("fieldGoal");return n||i?f.default.getPlay().handleDefenseLineBlitz():f.default.getPlay().handleIllegalBlitz(a)}},{name:"Quarterback and Kicker Position",runWhen:["ballSnapped","fieldGoal"],stopWhen:["ballRan","ballPassed","fieldGoalLineBlitzed","lineBlitzed","fieldGoalKicked"],run:()=>{const e=f.default.getPlay().getBallCarrier(),{id:t,team:a}=e,{position:n}=(0,i.getPlayerDiscProperties)(t),r=u.default.adjustPlayerPositionFront(n,a);if(!s.default.checkIfBehind(r.x,f.default.game.down.getLOS().x,a))return f.default.getPlay().handleIllegalCrossOffense(e)}},{name:"Kick Drag",runWhen:["always"],stopWhen:["ballPassed","ballBlitzed","ballRan","ballDragged","fieldGoalKicked","fieldGoalBlitzed","puntKicked","kickOffKicked","onsideKickKicked"],run:()=>{const e=f.default.getPlay().getBallPositionOnSet();if(!e)return;const t=f.default.getPlay().MAX_DRAG_DISTANCE;return s.default.checkIfBallDragged(e,d.default.getPosition(),t)?f.default.getPlay().onKickDrag(f.default.getPlay().getBallCarrierSafe()):void 0}},{name:"Ball Position Interceeption",runWhen:["interceptionAttempt"],stopWhen:["interceptionRuling"],run:()=>{const e=d.default.getSpeed();if(!s.default.checkIfBallIsMoving(e))return f.default.getPlay().handleUnsuccessfulInterception();if(f.default.getPlay().stateExists("interceptionAttemptKicked"))return;const t=f.default.getPlay().getState("interceptionBallPositionFirstTouch");return s.default.checkIfBallDragged(t,d.default.getPosition(),20)?f.default.getPlay().handleUnsuccessfulInterception():void 0}},{name:"Crowd",runWhen:["ballSnapped"],stopWhen:["ballPassed","ballRan","canBlitz"],run:()=>{f.default.getPlay().findCrowderAndHandle()}},{name:"Ball Position Before Pass",runWhen:["ballSnapped"],stopWhen:["ballPassed","lineBlitzed","ballBlitzed","ballRan"],run:()=>{const e=d.default.getPosition();if(s.default.checkIfBallInFrontOfLOS(e,f.default.game.down.getLOS().x,f.default.game.offenseTeamId))return f.default.getPlay().handleBallInFrontOfLOS()}}];t.default=()=>{if(f.default.isBotOn&&f.default.game)try{h.forEach((e=>{var t,a;(null===(a=null===(t=null===f.default||void 0===f.default?void 0:f.default.game)||void 0===t?void 0:t.play)||void 0===a?void 0:a.isLivePlay)&&(e=>e.runWhen.some((e=>"always"===e||f.default.getPlay().stateExistsUnsafe(e))))(e)&&((e=>e.stopWhen.some((e=>f.default.getPlay().stateExistsUnsafe(e))))(e)||e.run())}))}catch(e){console.trace(e),l.default.sendBotError(e.message),f.default.game.down.hardReset()}}},3202:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5198)),s=a(7701),r=n(a(1858)),o=n(a(8224));t.default=e=>{if(t=e.auth,a=e.conn,(r.default.players.findOne({auth:t})||r.default.players.findOne({ip:a}))&&!1===s.DEBUG_MODE)return i.default.kickPlayer(e.id,"Conn already exists in room",!1);var t,a;0===r.default.players.find().length&&i.default.setPlayerAdmin(e.id,!0),r.default.players.createAndAdd(e),o.default.greetPlayer(e),r.default.isBotOn&&s.DEBUG_MODE&&(i.default.setPlayerAdmin(e.id,!0),1===i.default.getPlayerList().length?(i.default.startGame(),i.default.setPlayerTeam(e.id,1),i.default.setPlayerDiscProperties(e.id,{x:-150,y:0})):(i.default.setPlayerTeam(e.id,2),i.default.setPlayerDiscProperties(e.id,{x:150,y:0})))}},9582:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(1858)),s=a(3279);t.default=e=>{i.default.players.delete(e),i.default.isBotOn&&i.default.game&&(i.default.game.players.updateStaticPlayerList(i.default.game.offenseTeamId),(e.team===s.TEAMS.RED||e.team===s.TEAMS.BLUE)&&(i.default.game.players.subOut(e,i.default.game.getTimeRounded(),{wasLeave:!0}),i.default.game.checkIfTightEndSwitchedTeamsOrLeft(e.id)))}},2063:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(1858));t.default=e=>{if(!i.default.isBotOn||!i.default.game)return;i.default.game.updateStaticPlayers();const t=i.default.game.players.handlePlayerTeamChange(e,i.default.game.getTimeRounded());if(i.default.game.checkIfTightEndSwitchedTeamsOrLeft(e.id),1===e.team||2===e.team){if(!i.default.game.stats)return;i.default.game.stats.maybeCreateStatProfile(t),i.default.game.down.maybeMovePlayerBehindLosOnField(e)}}},6329:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.checkBallCarrierContact=t.checkBallContact=void 0;const i=n(a(9e3)),s=n(a(1252)),r=n(a(9972)),o=n(a(1858)),l=n(a(5697)),d=a(2781),u=a(4798);t.checkBallContact=()=>{const e=r.default.getPosition(),t=o.default.game.players.getFielded();for(const a of t){const{id:t}=a,{position:n,radius:s}=(0,d.getPlayerDiscProperties)(t);if((new l.default).calcDifference3D(n,e).calculate(){const t=o.default.getPlay().getBallCarrierSafe();if(0===e.length||null===t)return null;const{position:a,speed:n,radius:i}=(0,d.getPlayerDiscProperties)(t.id);for(const r of e){const{id:e}=r;if(e===t.id)continue;const{position:o,speed:u}=(0,d.getPlayerDiscProperties)(e);if((new l.default).calcDifference3D(o,a).calculate()<2*i+1)return new s.default(r,o,u,a,n)}return null}},5198:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(600)),s=n(a(9390)),r=n(a(5933)),o=n(a(599)),l=n(a(3202)),d=n(a(9582)),u=n(a(2063)),c=n(a(7826)),f=n(a(7701)),h=n(a(1858)),m=n(a(4798)),y=HBInit(f.default);t.default=y,h.default.onRoomLoad(),y.setCustomStadium(m.default),y.setTimeLimit(9),y.setScoreLimit(0),y.setTeamsLock(!0),y.onGameStart=()=>{h.default.isBotOn&&h.default.startNewGame()},y.onGameStop=()=>{h.default.isBotOn&&h.default.game&&h.default.game.endGame()},y.onPositionsReset=()=>{h.default.isBotOn&&h.default.game&&(h.default.game.down.startNew(),h.default.game.setState("canTwoPoint",!1),h.default.game.setState("twoPointAttempt",!1),h.default.game.setPlay(new c.default(h.default.game.getTimeRounded()),null))},y.onTeamGoal=()=>{h.default.isBotOn&&h.default.game&&h.default.game.deleteState("canTwoPoint")},y.onGamePause=()=>{h.default.isBotOn&&h.default.game&&h.default.game.setIsPaused(!0)},y.onGameUnpause=()=>{h.default.isBotOn&&h.default.game&&h.default.game.setIsPaused(!1)},y.onPlayerAdminChange=i.default,y.onPlayerTeamChange=u.default,y.onPlayerBallKick=s.default,y.onPlayerJoin=l.default,y.onPlayerLeave=d.default,y.onGameTick=o.default,y.onPlayerChat=r.default},7872:function(e,t,a){var n=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function o(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=a(7701),r=i(a(5693)),o=i(a(9972)),l=i(a(8375)),d=i(a(4175)),u=i(a(2994)),c=i(a(4064)),f=a(2781),h=i(a(4340)),m=i(a(1234)),y=a(2665),g=i(a(5138)),P=i(a(5697)),p=i(a(1858)),_=i(a(5198));class S extends g.default{constructor(e){super(),this._isLivePlay=!1,this._ballCarrier=null,this._ballPositionOnSet=null,this.MAX_DRAG_DISTANCE=15,this.time=Math.round(e)}setBallCarrier(e,t=!0){return null===e&&this._ballCarrier&&_.default.setPlayerAvatar(this._ballCarrier.id,null),this._ballCarrier=e,e&&t&&_.default.setPlayerAvatar(e.id,h.default.Football),this}getBallCarrier(){if(!this._ballCarrier)throw Error("Game Error: Ball Carrier could not be found");return this._ballCarrier}getBallCarrierSafe(){return this._ballCarrier}get isLivePlay(){return this._isLivePlay}terminatePlayDuringError(){this._setLivePlay(!1)}getMaskPlay(){return this}resetPlayerPhysicsAndRemoveTightEnd(){p.default.game.setTightEnd(null)}allowForTwoPointAttempt(){p.default.game.setState("canTwoPoint")}handleTouchdown(e){this._setLivePlay(!1);const{netYards:t}=this._getPlayDataOffense(e),a=(0,y.truncateName)(this._ballCarrier.name.trim());r.default.send(`${h.default.Fire} TOUCHDOWN ${a} ${(0,y.plural)(t,"yard","yards")}`,{sound:2}),this.scorePlay(7,p.default.game.offenseTeamId,p.default.game.defenseTeamId),this.allowForTwoPointAttempt()}handleDefenseLineBlitz(){}_setStartingPosition(e){this._startingPosition=e}getBallPositionOnSet(){return this._ballPositionOnSet}setBallPositionOnSet(e){return this._ballPositionOnSet=e,this}positionBallAndFieldMarkers(){return o.default.setPosition(p.default.game.down.getSnapPosition()),p.default.game.down.moveFieldMarkers(),this}scorePlay(e,t,a){this._setLivePlay(!1),p.default.game.addScore(t,e),o.default.score(a),p.default.game.sendScoreBoard(),p.default.game.down.resetAfterScore()}_getPlayDataOffense(e){const{yardLine:t,netYards:a,adjustedEndPositionX:n}=c.default.getNetYardsAndAdjustedEndPosition(this._startingPosition,e,p.default.game.offenseTeamId),i=this.stateExistsUnsafe("catchPosition")?(new P.default).calcNetDifferenceByTeam(this.getState("catchPosition").x,n,p.default.game.offenseTeamId).calculateAndConvert().yards:0,s=this.stateExistsUnsafe("catchPosition")?(new P.default).calcNetDifferenceByTeam(p.default.game.down.getLOS().x,this.getState("catchPosition").x,p.default.game.offenseTeamId).calculateAndConvert().yards:0,r=(0,y.addPlus)(a),o=d.default.formatNetYardsMessageFull(a),u=d.default.formatYardAndHalfStr(t,n),f=p.default.game.down.getLOS().x,h=(new m.default).getSectionName(e,f,p.default.game.offenseTeamId),g={x:n,y:e.y},_=l.default.getEndZonePositionIsIn(g);return{netYards:a,endYardLine:t,endPosition:g,mapSection:h,yardsAfterCatch:i,yardsPassed:s,netYardsStr:r,netYardsStrFull:o,yardAndHalfStr:u,isTouchdown:Boolean(_)&&_!==p.default.game.offenseTeamId}}_handleSafety(){this._setLivePlay(!1),r.default.send(`${h.default.Loudspeaker} Safety - kickoff from the 20 yard line`),p.default.game.setState("safetyKickoff"),this.scorePlay(2,p.default.game.defenseTeamId,p.default.game.defenseTeamId)}_handleTouchback(){r.default.send(`${h.default.Loudspeaker} Touchback - ball placed at the receiving team's 20 yard line.`);const e=c.default.getPositionOfTeamYard(20,p.default.game.offenseTeamId);this.endPlay({newLosX:e,setNewDown:!0})}_handlePenalty(e,t,a={}){return n(this,void 0,void 0,(function*(){this._setLivePlay(!1),(0,f.quickPause)();const n=p.default.game.down.getLOS().x,i=l.default.checkIfInRedzone(n)===p.default.game.defenseTeamId,{penaltyYards:s,addDown:o,hasOwnHandler:d,isRedZonePenaltyOnDefense:c,newEndLosX:m,penaltyMessage:g,delay:P}=(new u.default).getData(e,t,i,n,p.default.game.offenseTeamId,a);if(r.default.send(`${h.default.YellowSquare} ${g}`),p.default.game.stats.updatePlayerStat(t.id,{penalties:1}),!d){if(P&&(yield(0,y.sleep)(1750)),c&&(p.default.game.down.incrementRedZonePenalties(),p.default.game.down.hasReachedMaxRedzonePenalties()))return this.getMaskPlay().handleAutoTouchdown();yield this.endPlay({addDown:o,newLosX:m,netYards:s})}}))}endPlay({netYards:e=0,newLosX:t=null,addDown:a=!0,setNewDown:n=!1}){this._setLivePlay(!1);const i=this._updateDistance({netYards:e,newLosX:t,addDown:a,setNewDown:n});null!==t&&p.default.game.down.setLOS(t),this._updateDown(i,{netYards:e,newLosX:t,addDown:a,setNewDown:n}),p.default.game.down.resetAfterDown()}onBallContact(e){return e.player.team===p.default.game.offenseTeamId?this._onBallContactOffense(e):this._onBallContactDefense(e)}_setLivePlay(e){this._isLivePlay=e,s.DEBUG_MODE&&r.default.send(`SET LIVE PLAY TO: ${e}`,{color:16772956})}_updateDistance({netYards:e,newLosX:t}){return null!==t&&(e>=p.default.game.down.getYardsToGet()||(p.default.game.down.subtractYardsToGet(e),!1))}_updateDown(e,{addDown:t,setNewDown:a}){if(a)return p.default.game.down.startNew();if(e)return p.default.game.down.startNew();t&&p.default.game.down.addDown();const n=p.default.game.down.getDown(),i=this.stateExistsUnsafe("fieldGoal");(5===n||i)&&(r.default.send(`${h.default.Loudspeaker} Turnover on downs!`,{sound:0}),p.default.game.swapOffenseAndUpdatePlayers(),p.default.game.down.startNew())}}t.default=S},5138:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5072));class s extends i.default{}t.default=s},4432:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5198)),s=a(5256),r=n(a(9972)),o=n(a(5693)),l=n(a(1858)),d=n(a(5697)),u=n(a(2992)),c=n(a(8375)),f=n(a(4064)),h=a(2781),m=n(a(4340)),y=a(4798),g=n(a(4208));class P extends g.default{constructor(e,t){super(e),this._kicker=t,this._ballCarrier=t}validateBeforePlayBegins(){const e=f.default.getPositionOfTeamYard(20,l.default.game.offenseTeamId);if(c.default.checkIfBehind(l.default.game.down.getLOS().x,e,l.default.game.offenseTeamId))throw new s.GameCommandError("You are too far away to attempt a field goal",!0)}prepare(){l.default.game.updateStaticPlayers(),this._setStartingPosition(l.default.game.down.getLOS());const e=this._setBallInPosition();this.setBallPositionOnSet(e),l.default.game.down.moveFieldMarkers(),this._setPlayersInPosition()}run(){this._setLivePlay(!0),r.default.release(),this.setState("fieldGoal"),o.default.sendMessageMaybeWithClock(`${m.default.PurpleCircle} Field Goal`,this.time),(0,h.quickPause)()}cleanUp(){}handleTouchdown(e){var t;const{netYards:a}=this._getPlayDataOffense(e);l.default.game.stats.updatePlayerStat(null===(t=this._ballCarrier)||void 0===t?void 0:t.id,{rushingAttempts:1,rushingYards:a,touchdownsRushed:1}),super.handleTouchdown(e)}handleSuccessfulFg(){o.default.send(`${m.default.GreenCheck} Field Goal is good!`,{sound:2}),l.default.game.stats.updatePlayerStat(this._kicker.id,{fgAttempts:1,fgMade:1,fgYardsAttempted:l.default.game.down.getLOSYard(),fgYardsMade:l.default.game.down.getLOSYard()}),this.scorePlay(3,l.default.game.offenseTeamId,l.default.game.defenseTeamId)}handleUnsuccessfulFg(){o.default.send(`${m.default.X} Field Goal is no good!`),l.default.game.stats.updatePlayerStat(this._kicker.id,{fgAttempts:1,fgYardsAttempted:l.default.game.down.getLOSYard()}),this.endPlay({})}handleDefenseLineBlitz(){this.setState("fieldGoalLineBlitzed"),this._ballCarrier&&i.default.setPlayerAvatar(this._ballCarrier.id,m.default.Football)}_getKicker(){return this._kicker}_setBallInPosition(){const e={y:y.MAP_POINTS.TOP_HASH,x:l.default.game.down.getSnapPosition().x};return r.default.setPosition(e),e}_setKickerInPosition(){const e=(new d.default).subtractByTeam(l.default.game.down.getSnapPosition().x,7*y.MAP_POINTS.YARD,l.default.game.offenseTeamId).calculate(),t=y.MAP_POINTS.TOP_HASH-6*y.MAP_POINTS.YARD;return i.default.setPlayerDiscProperties(this._kicker.id,{x:e,y:t}),this}_setOffenseInPosition(){const e=l.default.game.players.getOffense(),t=c.default.getOpposingTeamEndzone(l.default.game.offenseTeamId),a=(new d.default).subtractByTeam(t,5*y.MAP_POINTS.YARD,l.default.game.offenseTeamId).calculate();return e.forEach((({id:e})=>{e!==this._kicker.id&&i.default.setPlayerDiscProperties(e,{x:a})})),this}_setDefenseInPosition(){const e=l.default.game.players.getDefense(),t=c.default.getOpposingTeamEndzone(l.default.game.offenseTeamId),a=(new d.default).subtractByTeam(t,1*y.MAP_POINTS.YARD,l.default.game.defenseTeamId).calculate();return e.forEach((({id:e})=>{i.default.setPlayerDiscProperties(e,{x:a})})),this}_setPlayersInPosition(){this._setKickerInPosition()._setDefenseInPosition()._setOffenseInPosition()}_handleBallContactKicker(e){if("touch"!==e.type){if(this.stateExists("ballRan"))return this.setState("fieldGoalBlitzed");this.setState("fieldGoalKicked"),r.default.makeImmovableButKeepSpeed()}}_handleRun(e){const{player:t}=e;o.default.send(`${m.default.Running} Ball Ran!`),this.setBallCarrier(t).setState("ballRan")}_handleRunTackle(e){if(!1===this.stateExists("runFirstTackler"))return this.setState("runFirstTackler",e.player),o.default.send("First tackle"),void setTimeout((()=>{this.setState("canSecondTackle")}),500);const t=this.getState("runFirstTackler").id===e.player.id;return!1===this.stateExists("canSecondTackle")&&t?void 0:this._handleTackle(e)}_handleRunTackleStats(e){const{netYards:t}=this._getPlayDataOffense(e.ballCarrierPosition);l.default.game.stats.updatePlayerStat(e.player.id,{tackles:.5});const a=this.getState("runFirstTackler");l.default.game.stats.updatePlayerStat(a.id,{tackles:.5}),l.default.game.stats.updatePlayerStat(this._ballCarrier.id,{rushingAttempts:1,rushingYards:t})}_handleTackle(e){const{endPosition:t,netYards:a,yardAndHalfStr:n}=this._getPlayDataOffense(e.ballCarrierPosition);u.default.checkIfSack(e.ballCarrierPosition,l.default.game.down.getLOS().x,l.default.game.offenseTeamId)&&!1===this.stateExists("ballRan")?(o.default.send(`${m.default.HandFingersSpread} ${e.player.name.trim()} with the SACK!`),l.default.game.stats.updatePlayerStat(e.player.id,{sacks:1}),l.default.game.stats.updatePlayerStat(e.player.id,{qbSacks:1})):o.default.send(`${m.default.HandFingersSpread} Tackle ${n}`),this.stateExists("ballRan")?this._handleRunTackleStats(e):l.default.game.stats.updatePlayerStat(e.player.id,{tackles:1}),this._ballCarrier.id===this._kicker.id&&l.default.game.stats.updatePlayerStat(this._ballCarrier.id,{rushingAttempts:1,rushingYards:a});const{isSafety:i}=u.default.checkIfSafetyOrTouchbackPlayer(this._startingPosition,t,l.default.game.offenseTeamId);if(i)return this._handleSafety();this.endPlay({newLosX:t.x,netYards:a})}handleIllegalCrossOffense(){return this._handlePenalty("illegalLosCross",this._kicker)}}t.default=P},7826:function(e,t,a){var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var i=Object.getOwnPropertyDescriptor(t,a);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,i)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(a(9972)),l=r(a(5693)),d=r(a(1858)),u=s(a(5697)),c=r(a(8375)),f=r(a(4175)),h=r(a(4064)),m=a(2781),y=r(a(4340)),g=a(4798),P=r(a(9378));class p extends P.default{validateBeforePlayBegins(e){}prepare(){d.default.game.stateExists("safetyKickoff")&&this.setState("safetyKickoff");const e=this._determineKickOffPosition();this._setStartingPosition(e),o.default.setPosition(e),this.setBallPositionOnSet(e),d.default.game.down.setLOS(e.x),d.default.game.down.moveFieldMarkers({hideLineToGain:!0}),this.resetPlayerPhysicsAndRemoveTightEnd()}run(){setTimeout((()=>{this._setLivePlay(!0),o.default.release()}),1e3),this.setState("kickOff")}cleanUp(){}endPlay(e){super.endPlay(Object.assign(Object.assign({},e),{setNewDown:!0}))}handleTouchdown(e){const{netYards:t}=this._getPlayDataOffense(e);d.default.game.stats.updatePlayerStat(this._ballCarrier.id,{specReceptions:1,specReceivingYards:t,specTouchdowns:1}),super.handleTouchdown(e)}checkIfCanOnside(){return this.stateExists("safetyKickoff")?{canOnside:!1,reason:"Cannot perform an onside kick after a safety"}:{canOnside:!0}}_handleBallOutOfBounds(e){const t=h.default.adjustBallPositionOnOutOfBounds(e,d.default.game.offenseTeamId),a=this.getState("KickOffKicker");if(!1===this.stateExists("safetyKickoff"))return this._handleOffensePenalty(a,"ballOutOfBounds");const n=u.DistanceConverter.toYardLine(t.x),i=f.default.formatYardAndHalfStr(n,t.x);l.default.send(`${y.default.Pushpin} Ball went out of bounds ${i}`),this.endPlay({newLosX:t.x})}_handleOffensePenalty(e,t){const a=h.default.getPositionOfTeamYard(40,d.default.game.offenseTeamId),n=h.default.getPositionOfTeamYard(40,d.default.game.defenseTeamId),i=this.stateExists("safetyKickoff")?n:a;if("drag"===t){const t=this.stateExists("safetyKickoff")?"kickOffDragSafety":"kickOffDrag";this._handlePenalty(t,e)}if("offsidesOffense"===t){const t=this.stateExists("safetyKickoff")?"kickOffOffsidesSafety":"kickOffOffsides";this._handlePenalty(t,e)}"ballOutOfBounds"===t&&this._handlePenalty("kickOffOutOfBounds",e),this.endPlay({newLosX:i})}_handleCatch(e){const t=h.default.adjustRawEndPosition(e.playerPosition,d.default.game.offenseTeamId);this._setStartingPosition(t);const a=c.default.checkIfPlayerOutOfBounds(e.playerPosition),{yardAndHalfStr:n}=this._getPlayDataOffense(e.playerPosition);if(a)return l.default.send(`${y.default.DoNotEnter} Caught out of bounds ${n}`),this._handleBallOutOfBounds(e.playerPosition);l.default.send(`${y.default.Football} Ball Caught`),this.setState("kickOffCaught"),this.setBallCarrier(e.player)}_checkIfOffenseOffsidesOnKick(){var e;const t=d.default.game.down.getLOS().x,a=(new u.default).addByTeam(t,2*g.MAP_POINTS.YARD,d.default.game.offenseTeamId).calculate(),n=null!==(e=d.default.game.players.getOffense().find((e=>{const{position:t}=(0,m.getPlayerDiscProperties)(e.id);return!1===c.default.checkIfBehind(t.x,a,d.default.game.offenseTeamId)})))&&void 0!==e?e:null;return{isOffsides:Boolean(n),offsidesPlayer:n}}_determineKickOffPosition(){const e=this.stateExists("safetyKickoff"),t=h.default.getPositionOfTeamYard(20,d.default.game.offenseTeamId);return e?{x:t,y:0}:{x:0,y:0}}}t.default=p},432:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5198)),s=n(a(9972)),r=n(a(5693)),o=n(a(1858)),l=n(a(5697)),d=n(a(8375)),u=n(a(4064)),c=a(2781),f=n(a(4340)),h=a(4798),m=n(a(2009));class y extends m.default{constructor(e,t){super(e),this._kicker=t,this._ballCarrier=t}validateBeforePlayBegins(e){}prepare(){const e={x:u.default.getPositionOfTeamYard(5,o.default.game.offenseTeamId),y:0};this._setStartingPosition(e),s.default.setPosition(e),this.setBallPositionOnSet(e),o.default.game.down.setLOS(e.x),o.default.game.down.moveFieldMarkers(),this._moveLineToGetToFortyFiveYardLine(),this._setPlayersInPosition(),o.default.game.stats.updatePlayerStat(this._kicker.id,{onsideKicksAttempted:1}),this.resetPlayerPhysicsAndRemoveTightEnd()}run(){this._setLivePlay(!0),s.default.release(),this.setState("onsideKick"),r.default.sendMessageMaybeWithClock(`${f.default.WhiteCircle} Onside Kick Attempt`,this.time),(0,c.quickPause)()}cleanUp(){}endPlay(e){super.endPlay(Object.assign(Object.assign({},e),{setNewDown:!0}))}handleTouchdown(e){const{netYards:t}=this._getPlayDataOffense(e);o.default.game.stats.updatePlayerStat(this._ballCarrier.id,{specReceptions:1,specReceivingYards:t,specTouchdowns:1}),super.handleTouchdown(e)}_handleCatch(e){const t=u.default.adjustRawEndPosition(e.playerPosition,o.default.game.offenseTeamId);if(this._setStartingPosition(t),d.default.checkIfPlayerOutOfBounds(e.playerPosition))return r.default.send(`${f.default.DoNotEnter} Caught out of bounds`),this._handleUnsuccessfulOnsideKick("Kicked out of bounds");r.default.send(`${f.default.Football} Ball Caught`),this.setState("onsideKickCaught"),this.setBallCarrier(e.player)}_handleUnsuccessfulOnsideKick(e){e&&r.default.send(`Unsuccessful onside kick - ${e}`),!1===this.stateExists("onsideKickKicked")&&o.default.game.swapOffenseAndUpdatePlayers();const t=u.default.getPositionOfTeamYard(40,o.default.game.defenseTeamId);this.endPlay({newLosX:t})}_handleSuccessfulOnsideKick(e){r.default.send(`${f.default.Fire} Onside Kick recovered!`,{sound:2}),o.default.game.stats.updatePlayerStat(this._kicker.id,{onsideKicksConverted:1}),o.default.game.swapOffenseAndUpdatePlayers();const t=u.default.getPositionOfTeamYard(20,o.default.game.offenseTeamId);this.endPlay({newLosX:t})}_handleBallContactKicker(e){if(!1===this.stateExists("onsideKickKicked")){if("touch"===e.type)return;return o.default.game.swapOffenseAndUpdatePlayers(),this.setState("onsideKickKicked")}const t=s.default.getPosition(),a=(new l.default).addByTeam(0,5*h.MAP_POINTS.YARD,o.default.game.defenseTeamId).calculate();if(d.default.checkIfInFront(t.x,a,o.default.game.defenseTeamId))return this._handleSuccessfulOnsideKick(e);r.default.send("Onside kick illegally recovered behind the receiving team's 45 yard line");const n=u.default.adjustBallPositionOnOutOfBounds(t,o.default.game.offenseTeamId);this.endPlay({newLosX:n.x})}_setPlayersInPosition(){this._setKickerInPosition()._setOffenseInPosition()}_setKickerInPosition(){const e=(new l.default).subtractByTeam(o.default.game.down.getSnapPosition().x,7*h.MAP_POINTS.YARD,o.default.game.offenseTeamId).calculate();return i.default.setPlayerDiscProperties(this._kicker.id,{x:e,y:h.MAP_POINTS.TOP_HASH}),this}_setOffenseInPosition(){const e=o.default.game.players.getOffense(),t=d.default.getOpposingTeamEndzone(o.default.game.offenseTeamId),a=(new l.default).subtractByTeam(t,5*h.MAP_POINTS.YARD,o.default.game.offenseTeamId).calculate();return e.forEach((({id:e})=>{e!==this._kicker.id&&i.default.setPlayerDiscProperties(e,{x:a})})),this}_moveLineToGetToFortyFiveYardLine(){const e=(new l.default).addByTeam(0,5*h.MAP_POINTS.YARD,o.default.game.offenseTeamId).calculate();i.default.setDiscProperties(h.DISC_IDS.LTG_TOP,{x:e,y:h.MAP_POINTS.TOP_SIDELINE}),i.default.setDiscProperties(h.DISC_IDS.LTG_BOT,{x:e,y:h.MAP_POINTS.BOT_SIDELINE})}}t.default=y},5961:function(e,t,a){var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var i=Object.getOwnPropertyDescriptor(t,a);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,i)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(a(5198)),l=r(a(9972)),d=r(a(5693)),u=r(a(1858)),c=s(a(5697)),f=r(a(8375)),h=r(a(4175)),m=r(a(4064)),y=a(2781),g=r(a(4340)),P=a(4798),p=a(3279),_=r(a(4016));class S extends _.default{constructor(e,t){super(e),this._playerWhoCalledPunt=t}validateBeforePlayBegins(){}prepare(){this.setState("punt"),u.default.game.updateStaticPlayers(),this._setStartingPosition(u.default.game.down.getLOS()),this.setBallPositionOnSet(l.default.getPosition()),u.default.game.down.moveFieldMarkers(),this._setPlayersInPosition(),this._createInvisibleWallForDefense(),this.resetPlayerPhysicsAndRemoveTightEnd()}run(){d.default.send(`${g.default.OrangeCircle} Punt Called!`),this._setLivePlay(!0),l.default.release()}cleanUp(){this._releaseInvisibleWallForDefense()}_endPlayAndSetNewDown(e){super.endPlay(Object.assign(Object.assign({},e),{setNewDown:!0}))}handleTouchdown(e){const{netYards:t}=this._getPlayDataOffense(e);u.default.game.stats.updatePlayerStat(this._ballCarrier.id,{specReceptions:1,specReceivingYards:t,specTouchdowns:1}),super.handleTouchdown(e)}_handleCatch(e){const{player:t,playerPosition:a}=e,{team:n}=t,i=m.default.adjustRawEndPosition(a,n);this.setState("puntCaught"),this._setStartingPosition(i);const s=f.default.checkIfPlayerOutOfBounds(e.playerPosition),r=c.DistanceConverter.toYardLine(i.x),o=h.default.formatYardAndHalfStr(r,i.x);if(s)return d.default.send(`${g.default.DoNotEnter} Caught out of bounds ${o}`),this._endPlayAndSetNewDown({newLosX:i.x});d.default.send(`${g.default.Football} Ball Caught`),this.setBallCarrier(t)}_getFromYardAndHalfStr(){const e=c.DistanceConverter.toYardLine(this._ballPositionOnSet.x);return h.default.formatYardAndHalfStr(e,this._ballPositionOnSet.x)}_checkIfOffenseOffsidesOnKick(e){var t;const a=u.default.game.defenseTeamId,n=(new c.default).addByTeam(u.default.game.down.getLOS().x,2*P.MAP_POINTS.YARD,a).calculate(),i=null!==(t=u.default.game.players.getDefense().find((t=>{if(t.id===e.id)return!1;const{position:i}=(0,y.getPlayerDiscProperties)(t.id);return!1===f.default.checkIfBehind(i.x,n,a)})))&&void 0!==t?t:null;return{isOffsides:Boolean(i),offsidesPlayer:i}}_handleOffensePenalty(e,t){this.stateExists("puntKicked")&&u.default.game.swapOffenseAndUpdatePlayers(),this._handlePenalty(t,e)}_setPlayerWhoCalledPuntInPosition(){const e=(new c.default).subtractByTeam(u.default.game.down.getSnapPosition().x,10*P.MAP_POINTS.YARD,u.default.game.offenseTeamId).calculate();return o.default.setPlayerDiscProperties(this._playerWhoCalledPunt.id,{x:e,y:0}),this}_setPlayersInPosition(){this._setPlayerWhoCalledPuntInPosition()._setOffenseInPosition()._setDefenseInPosition()}_setOffenseInPosition(){const e=u.default.game.players.getOffense().filter((e=>e.id!==this._playerWhoCalledPunt.id)),t=(new c.default).subtractByTeam(u.default.game.down.getSnapPosition().x,15*P.MAP_POINTS.YARD,u.default.game.offenseTeamId).calculate();return e.forEach((e=>{o.default.setPlayerDiscProperties(e.id,{x:t})})),this}_setDefenseInPosition(){const e=u.default.game.players.getDefense(),t=f.default.getTeamEndzone(u.default.game.defenseTeamId),a=(new c.default).subtractByTeam(t,2*P.MAP_POINTS.YARD,u.default.game.defenseTeamId).calculate();return e.forEach((e=>{o.default.setPlayerDiscProperties(e.id,{x:a})})),this}_createInvisibleWallForDefense(){return u.default.game.players.getDefense().forEach((e=>{const t=o.default.CollisionFlags,a=u.default.game.defenseTeamId===p.TEAMS.RED?t.red:t.blue;o.default.setPlayerDiscProperties(e.id,{cGroup:a|t.c0})})),this}_releaseInvisibleWallForDefense(){return u.default.game.players.getDefense().forEach((e=>{const t=o.default.CollisionFlags,a=u.default.game.defenseTeamId===p.TEAMS.RED?t.red:t.blue;o.default.setPlayerDiscProperties(e.id,{cGroup:a})})),this}}t.default=S},2369:function(e,t,a){var n=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function o(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(a(5693)),r=i(a(9972)),o=i(a(2992)),l=i(a(8375)),d=i(a(4064)),u=i(a(4340)),c=i(a(1234)),f=i(a(3160)),h=a(5256),m=i(a(2994)),y=a(2781),g=a(4798),P=i(a(1666)),p=i(a(5697)),_=a(2665),S=i(a(5198)),v=i(a(1858)),O=i(a(7117));class T extends f.default{constructor(e,t){super(e),this._blitzClockTime=0,this._ballMoveBlitzClockTime=0,this.BLITZ_TIME_SECONDS=12,this.BALL_MOVE_BLITZ_TIME_SECONDS=3,this.crowdChecker=new P.default,this.MAX_DRAG_DISTANCE=10,this._quarterback=t,this._ballCarrier=t}validateBeforePlayBegins(e){if(!1===v.default.game.canStartSnapPlay)throw new h.GameCommandError("Please wait a second before snapping the ball",!0);if(v.default.game.getTightEnd()===(null==e?void 0:e.id))throw new h.GameCommandError("You cannot snap the ball as a Tight End",!0);v.default.game.updateStaticPlayers(),v.default.game.players.savePlayerPositions();const{valid:t,penaltyName:a,player:n,penaltyData:i}=new x(e).validate();if(!t)throw this._handlePenalty(a,n,i),new h.GameCommandError("Penalty",!1)}prepare(){this.crowdChecker.setOffenseTeam(v.default.game.offenseTeamId),this.crowdChecker.setCrowdBoxArea(v.default.game.down.getLOS().x);const e=v.default.game.stateExists("curvePass"),t=v.default.game.stateExists("twoPointAttempt");this._setStartingPosition(v.default.game.down.getLOS()),this.setBallPositionOnSet(r.default.getPosition()),v.default.game.down.moveFieldMarkers(),this._getAllOffsideOffenseAndMove(),this._getAllOffsideDefenseAndMove(),this._startBlitzClock(),t&&this.setState("twoPointAttempt"),e&&this.setState("curvePass")}run(){this._setLivePlay(!0),r.default.release(),this.setState("ballSnapped"),s.default.sendMessageMaybeWithClock(`${u.default.GreenCircle} Ball is Hiked`,this.time)}cleanUp(){this._stopBlitzClock(),this._stopBallMoveBlitzClock()}getQuarterback(){return this._quarterback}findCrowderAndHandle(){const e=v.default.game.players.getFielded().filter((e=>e.id!==this._quarterback.id)),{isCrowding:t,crowdingData:a,crowder:n}=this.crowdChecker.checkPlayersInCrowdBox(e,v.default.game.getTime());return t?a.wasAlone?this._handlePenalty("crowdAbuse",n):this._handlePenalty("crowding",n):null}_handlePenalty(e,t,a={}){const i=Object.create(null,{_handlePenalty:{get:()=>super._handlePenalty}});return n(this,void 0,void 0,(function*(){if(this.stateExists("twoPointAttempt")||v.default.game.stateExists("twoPointAttempt")){(0,y.quickPause)();const n=v.default.game.down.getLOS().x,i=l.default.checkIfInRedzone(n)===v.default.game.defenseTeamId,{penaltyMessage:r}=(new m.default).getData(e,t,i,n,v.default.game.offenseTeamId,a);return s.default.send(`${u.default.YellowSquare} ${r}`),t.team===v.default.game.offenseTeamId?this._handleFailedTwoPointConversion():this._handleTwoPointTouchdown(null)}"crowding"!==e&&"crowdAbuse"!==e||(this._setLivePlay(!1),s.default.sendWarning("You cannot stand inside the red box for more than 3 seconds without an offensive player being present.",{id:t.id,color:O.default.LightRed}),this.crowdChecker.drawCrowdBoxLines(),setTimeout(this.crowdChecker.eraseCrowdBoxLines.bind(this.crowdChecker),2e3)),i._handlePenalty.call(this,e,t,a)}))}endPlay(e){if(this.stateExists("twoPointAttempt"))return this._setLivePlay(!1),this._handleFailedTwoPointConversion();super.endPlay(e)}_handleSafety(){if(this.stateExists("twoPointAttempt"))return this._setLivePlay(!1),s.default.send(`${u.default.Loudspeaker} Conversion safety!`),v.default.game.addScore(v.default.game.defenseTeamId,1),this._handleFailedTwoPointConversion();super._handleSafety()}handleAutoTouchdown(){s.default.send(`${u.default.Fire} Automatic Touchdown! - 3/3 Penalties`,{sound:2}),this.allowForTwoPointAttempt(),this.scorePlay(7,v.default.game.offenseTeamId,v.default.game.defenseTeamId)}handleTouchdown(e){return this.stateExistsUnsafe("twoPointAttempt")?this._handleTwoPointTouchdown(e):this._handleRegularTouchdown(e)}handleIllegalCrossOffense(e){this._handlePenalty("illegalLosCross",e)}handleIllegalBlitz(e){this._handlePenalty("illegalBlitz",e,{time:this._blitzClockTime})}handleBallInFrontOfLOS(){this._handlePenalty("illegalPass",this._quarterback)}handleDefenseLineBlitz(){this.setState("lineBlitzed"),this._ballCarrier&&S.default.setPlayerAvatar(this._ballCarrier.id,u.default.Football)}_updateStatsIfNotTwoPoint(e,t){this.stateExists("twoPointAttempt")||v.default.game.stats.updatePlayerStat(e,t)}_startBlitzClock(){this._blitzClock=setInterval(this._blitzTimerInterval.bind(this),1e3)}_blitzTimerInterval(){if(this._blitzClockTime++,this._blitzClockTime>=this.BLITZ_TIME_SECONDS)return this.setState("canBlitz"),this._stopBlitzClock()}_stopBlitzClock(){null!==this._blitzClock&&clearInterval(this._blitzClock)}_startBallMoveBlitzClock(){this._ballMoveBlitzClock=setInterval(this._ballMoveBlitzTimerInterval.bind(this),1e3)}_ballMoveBlitzTimerInterval(){if(this._ballMoveBlitzClockTime++,this._ballMoveBlitzClockTime>=this.BALL_MOVE_BLITZ_TIME_SECONDS){this.setState("canBlitz");const e=this.stateExists("ballPassed")||this.stateExists("ballRan")||this.stateExists("ballBlitzed");if(this._stopBallMoveBlitzClock(),e)return;s.default.send(`${u.default.Bell} Can Blitz`,{sound:2})}}_stopBallMoveBlitzClock(){null!==this._ballMoveBlitzClock&&clearInterval(this._ballMoveBlitzClock)}_getStatInfo(e){const t=v.default.game.down.getLOS().x,a=(new c.default).getSectionName(e,t,v.default.game.offenseTeamId);return{quarterback:this.getQuarterback(),mapSection:a}}_handleCatch(e){const{player:t,playerPosition:a}=e,{mapSection:n,quarterback:i}=this._getStatInfo(a);if(this._updateStatsIfNotTwoPoint(i.id,{passAttempts:{[n]:1}}),this.stateExists("curvePass")&&this._updateStatsIfNotTwoPoint(this.getQuarterback().id,{curvedPassAttempts:1}),l.default.checkIfPlayerOutOfBounds(a))return s.default.send(`${u.default.DoNotEnter} Pass Incomplete, caught out of bounds`),this.endPlay({});const r=d.default.adjustRawEndPosition(a,t.team);this.setState("catchPosition",r);const o=l.default.getNearestPlayerToPosition(v.default.game.players.getDefense(),r);o&&this.setState("nearestDefenderToCatch",o.player),this._updateStatsIfNotTwoPoint(i.id,{passCompletions:{[n]:1}}),this.stateExists("curvePass")&&this._updateStatsIfNotTwoPoint(this.getQuarterback().id,{curvedPassCompletions:1}),this.setState("ballCaught"),s.default.send(`${u.default.Football} Pass caught!`),this.setBallCarrier(t)}_handleRun(e){const{player:t}=e;s.default.send(`${u.default.Running} Ball Ran!`),this._makeOffenseBouncy(),this.setBallCarrier(t).setState("ballRan")}_handleIllegalTouch(e){this._handlePenalty("illegalTouch",e.player)}_getAllOffsideOffenseAndMove(){const e=l.default.findAllTeamPlayerOffside(v.default.game.players.getOffense(),v.default.game.offenseTeamId,v.default.game.down.getLOS().x),t=(new p.default).subtractByTeam(v.default.game.down.getLOS().x,15*g.MAP_POINTS.YARD,v.default.game.offenseTeamId).calculate();e.forEach((e=>{if(s.default.send("⚠️ You were offside (in front of the blue line), you have been moved 15 yards back.",{id:e.id}),v.default.game.checkIfPlayerIsTightEnd(e.id)){const a=S.default.getPlayerDiscProperties(e.id);return v.default.game.down.setTightEndPosition(e.id,{x:t,y:a.y})}S.default.setPlayerDiscProperties(e.id,{x:t,xspeed:0,yspeed:0})}))}_getAllOffsideDefenseAndMove(){const e=l.default.findAllTeamPlayerOffside(v.default.game.players.getDefense(),v.default.game.defenseTeamId,v.default.game.down.getLOS().x),t=(new p.default).subtractByTeam(v.default.game.down.getLOS().x,15*g.MAP_POINTS.YARD,v.default.game.defenseTeamId).calculate();e.forEach((e=>{s.default.send("⚠️ You were offside (in front of the blue line), you have been moved 15 yards back.",{id:e.id}),S.default.setPlayerDiscProperties(e.id,{x:t,xspeed:0,yspeed:0})}))}_handleCurvePass(e){const t=r.default.getPosition(),{playerPosition:a}=e;return a.y>t.y?r.default.setGravity({y:.09}):r.default.setGravity({y:-.09})}_handleBallContactQuarterback(e){const{type:t}=e;this.stateExists("ballPassed")||"touch"===t||(this.setState("ballPassed"),this._updateQBTimeAndDistanceMovedStat(),this.setBallCarrier(null),this.stateExists("curvePass")&&this._handleCurvePass(e))}_handleBallContactDuringInterception(e){return this.getState("interceptingPlayer").id!==e.player.id||this.stateExists("interceptionAttemptKicked")?this.handleUnsuccessfulInterception():"kick"===e.type?this._handleInterceptionKick(e):void 0}_handleInterceptionKick(e){this.setState("interceptionAttemptKicked"),this.setState("interceptionPlayerKickPosition",e.playerPosition),v.default.game.swapOffenseAndUpdatePlayers();const t=d.default.adjustRawEndPosition(e.playerPosition,v.default.game.offenseTeamId);this._setStartingPosition({x:t.x,y:t.y}),this.setBallCarrier(e.player,!1),setTimeout((()=>{if(this.stateExists("interceptionRuling"))return;const{xspeed:e}=r.default.getSpeed(),t=r.default.getPosition(),a=this.getState("interceptionBallPositionFirstTouch");return l.default.checkIfBallIsHeadedInIntTrajectory(e,a,t)?this.handleUnsuccessfulInterception():void 0}),3e3)}_handleInterceptionAttempt(e){return l.default.checkIfPlayerOutOfBounds(e.playerPosition)?this.handleUnsuccessfulInterception():(this.setState("interceptionAttempt"),this.setState("interceptingPlayer",e.player),this.setState("interceptionBallPositionFirstTouch",r.default.getPosition()),"kick"===e.type?this._handleInterceptionKick(e):void 0)}handleUnsuccessfulInterception(){return this.setState("interceptionRuling"),this.stateExists("interceptionAttemptKicked")&&v.default.game.swapOffenseAndUpdatePlayers(),this.endPlay({})}_handleRunTackle(e){if(!1===this.stateExists("runFirstTackler"))return this.setState("runFirstTackler",e.player),s.default.send("First tackle"),void setTimeout((()=>{this.setState("canSecondTackle")}),500);const t=this.getState("runFirstTackler").id===e.player.id;return!1===this.stateExists("canSecondTackle")&&t?void 0:this._handleTackle(e)}_handleRunTackleStats(e){const{netYards:t}=this._getPlayDataOffense(e.ballCarrierPosition);this._updateStatsIfNotTwoPoint(e.player.id,{tackles:.5});const a=this.getState("runFirstTackler");this._updateStatsIfNotTwoPoint(a.id,{tackles:.5}),this._updateStatsIfNotTwoPoint(this._ballCarrier.id,{rushingAttempts:1,rushingYards:t})}_handleSuccessfulInterception(){s.default.send(`${u.default.Target} Pass Intercepted!`);const e=this.getState("interceptingPlayer");if(this._updateStatsIfNotTwoPoint(e.id,{interceptionsReceived:1}),this._updateStatsIfNotTwoPoint(this._quarterback.id,{interceptionsThrown:1}),this.setState("interceptionRuling"),this.setState("ballIntercepted"),!this.stateExists("interceptionPlayerEndPosition"))return S.default.setPlayerAvatar(e.id,u.default.Football);const t=this.getState("interceptionPlayerEndPosition"),{endPosition:a}=this._getPlayDataOffense(t),{isSafety:n,isTouchback:i}=o.default.checkIfSafetyOrTouchbackPlayer(this.getState("interceptionPlayerKickPosition"),t,v.default.game.offenseTeamId);return n?this._handleSafety():i?this._handleTouchback():this.endPlay({newLosX:a.x,setNewDown:!0})}_handleInterceptionBallCarrierOutOfBounds(e){var t;if(this.stateExists("interceptionRuling")){const{endPosition:a,yardAndHalfStr:n}=this._getPlayDataOffense(e);s.default.send(`${null===(t=this._ballCarrier)||void 0===t?void 0:t.name.trim()} stepped out of bounds ${n}`);const{isSafety:i,isTouchback:r}=o.default.checkIfSafetyOrTouchbackPlayer(this.getState("interceptionPlayerKickPosition"),e,v.default.game.offenseTeamId);return i?this._handleSafety():r?this._handleTouchback():this.endPlay({newLosX:a.x,setNewDown:!0})}this.setState("interceptionPlayerEndPosition",e)}_handleTackle(e){const{endPosition:t,netYards:a,yardAndHalfStr:n,netYardsStr:i,yardsAfterCatch:r,yardsPassed:l}=this._getPlayDataOffense(e.ballCarrierPosition);if(o.default.checkIfSack(e.ballCarrierPosition,v.default.game.down.getLOS().x,v.default.game.offenseTeamId)&&!1===this.stateExists("ballRan")&&!1===this.stateExists("ballCaught")&&!1===this.stateExists("ballIntercepted")?(s.default.send(`${u.default.HandFingersSpread} ${e.player.name.trim()} with the SACK!`),this._updateStatsIfNotTwoPoint(e.player.id,{sacks:1}),this._updateStatsIfNotTwoPoint(e.player.id,{qbSacks:1})):s.default.send(`${u.default.HandFingersSpread} Tackle ${n} | ${i}`),this.stateExists("ballRan")?this._handleRunTackleStats(e):this._updateStatsIfNotTwoPoint(e.player.id,{tackles:1}),this._ballCarrier.id===this._quarterback.id&&this._updateStatsIfNotTwoPoint(this._ballCarrier.id,{rushingAttempts:1,rushingYards:a}),this.stateExists("ballCaught")){const{mapSection:e}=this._getStatInfo(this.getState("catchPosition"));if(this._updateStatsIfNotTwoPoint(this._ballCarrier.id,{receptions:{[e]:1},receivingYards:{[e]:a},receivingYardsAfterCatch:{[e]:r}}),this.stateExists("nearestDefenderToCatch")){const t=this.getState("nearestDefenderToCatch");this._updateStatsIfNotTwoPoint(t.id,{yardsAllowed:{[e]:a}})}this._updateStatsIfNotTwoPoint(this._quarterback.id,{passYards:{[e]:a},passYardsDistance:{[e]:l}})}const d=this.stateExists("catchPosition")?this.getState("catchPosition"):this._startingPosition;if(this.stateExists("ballIntercepted")){const{isSafety:t,isTouchback:a}=o.default.checkIfSafetyOrTouchbackPlayer(this.getState("interceptionBallPositionFirstTouch"),e.ballCarrierPosition,v.default.game.offenseTeamId);if(t)return this._handleSafety();if(a)return this._handleTouchback()}else{const{isSafety:t}=o.default.checkIfSafetyOrTouchbackPlayer(d,e.ballCarrierPosition,v.default.game.offenseTeamId);if(t)return this._handleSafety()}this.endPlay({newLosX:t.x,netYards:a,setNewDown:this.stateExists("ballIntercepted")})}_handleInterceptionTackle(e){if(this.stateExists("interceptionRuling"))return this._handleTackle(e);this.setState("interceptionPlayerEndPosition",e.playerPosition)}_handleTwoPointTouchdown(e){s.default.send(`${u.default.Fire} Two point conversion!`,{sound:2}),this.scorePlay(1,v.default.game.offenseTeamId,v.default.game.defenseTeamId)}_handleFailedTwoPointConversion(){s.default.send(`${u.default.X} Failed Two Point Conversion`),this.scorePlay(-1,v.default.game.offenseTeamId,v.default.game.defenseTeamId)}_makeOffenseBouncy(){v.default.game.players.getOffense().forEach((e=>{S.default.setPlayerDiscProperties(e.id,{bCoeff:.99,invMass:.55})}))}_updateQBTimeAndDistanceMovedStat(){const{position:e}=(0,y.getPlayerDiscProperties)(this._quarterback.id),t=v.default.game.down.getSnapPosition(),a=(new p.default).calcDifference3D(e,t).calculate(),n=(0,_.round)(a-g.MAP_POINTS.PLAYER_RADIUS,1),i=(0,_.round)(v.default.game.getTime()-this.time,1);this._updateStatsIfNotTwoPoint(this._quarterback.id,{distanceMovedBeforePassArr:[n],timeToPassArr:[i]})}_handleRegularTouchdown(e){var t,a,n,i;const{netYards:s,yardsPassed:r,yardsAfterCatch:o}=this._getPlayDataOffense(e);if((this.stateExistsUnsafe("ballRan")||(null===(t=this._ballCarrier)||void 0===t?void 0:t.id)===this._quarterback.id)&&this._updateStatsIfNotTwoPoint(null===(a=this._ballCarrier)||void 0===a?void 0:a.id,{rushingAttempts:1,rushingYards:s,touchdownsRushed:1}),this.stateExistsUnsafe("ballCaught")){const e=this.getState("catchPosition"),{mapSection:t}=this._getStatInfo(e);if(this._updateStatsIfNotTwoPoint(null===(n=this._ballCarrier)||void 0===n?void 0:n.id,{receptions:{[t]:1},receivingYards:{[t]:s},receivingYardsAfterCatch:{[t]:o},touchdownsReceived:1}),this.stateExists("nearestDefenderToCatch")){const e=this.getState("nearestDefenderToCatch");this._updateStatsIfNotTwoPoint(e.id,{yardsAllowed:{[t]:s}})}this._updateStatsIfNotTwoPoint(null===(i=this._quarterback)||void 0===i?void 0:i.id,{passYards:{[t]:s},passYardsDistance:{[t]:r},touchdownsThrown:1})}super.handleTouchdown(e)}}t.default=T;class w{constructor(e,t,a={}){this.penaltyName=e,this.player=t,this.penaltyData=a}}class x{constructor(e){this._player=e,this._playerPosition=(0,y.getPlayerDiscProperties)(this._player.id).position}_checkSnapOutOfBounds(){if(l.default.checkIfPlayerOutOfBounds(this._playerPosition))throw new w("snapOutOfBounds",this._player)}_checkSnapWithinHashes(){if(!l.default.checkIfWithinHash(this._playerPosition,g.MAP_POINTS.PLAYER_RADIUS))throw new w("snapOutOfHashes",this._player)}_checkQBOnside(){if(l.default.findTeamPlayerOffside([this._player],v.default.game.offenseTeamId,v.default.game.down.getLOS().x))throw new w("offsidesOffense",this._player)}validate(){try{this._checkSnapWithinHashes(),this._checkSnapOutOfBounds(),this._checkQBOnside()}catch(e){if(e instanceof w){const{penaltyName:t,player:a,penaltyData:n}=e;return{valid:!1,penaltyName:t,player:a,penaltyData:n}}console.log(e)}return{valid:!0}}}},4208:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5693)),s=n(a(1858)),r=n(a(2992)),o=n(a(8375)),l=n(a(4340)),d=n(a(7872));class u extends d.default{onBallContact(e){this.stateExists("ballRan")||this.stateExists("fieldGoalBlitzed")||super.onBallContact(e)}onBallOutOfBounds(e){this.handleUnsuccessfulFg()}onBallCarrierOutOfBounds(e){var t;const{endPosition:a,netYards:n,yardAndHalfStr:o,isTouchdown:d}=this._getPlayDataOffense(e);if(d)return this.handleTouchdown(e);i.default.send(`${l.default.Pushpin} ${this.getBallCarrier().name.trim()} went out of bounds ${o}`);const{isSafety:u,isTouchback:c}=r.default.checkIfSafetyOrTouchbackPlayer(this._startingPosition,a,s.default.game.offenseTeamId);return s.default.game.stats.updatePlayerStat(null===(t=this._ballCarrier)||void 0===t?void 0:t.id,{rushingAttempts:1,rushingYards:n}),u?this._handleSafety():c?this._handleTouchback():void this.endPlay({newLosX:a.x,netYards:n})}onBallCarrierContactOffense(e){const{player:t,playerPosition:a,ballCarrierPosition:n}=e;if(o.default.checkIfBehind(a.x,n.x,t.team))return this._handleRun(e);this.stateExists("fieldGoalKicked")||this._handlePenalty("illegalRun",t)}onBallCarrierContactDefense(e){if(this.stateExists("ballRan"))return this._handleRunTackle(e);this._handleTackle(e)}onKickDrag(){this._handlePenalty("fgDrag",this._kicker)}_onBallContactDefense(e){this.stateExists("fieldGoalKicked")||this.setState("fieldGoalBlitzed")}_onBallContactOffense(e){const{player:t}=e;if(t.id===this._kicker.id)return this._handleBallContactKicker(e)}}t.default=u},9378:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5693)),s=n(a(9972)),r=n(a(2992)),o=n(a(8375)),l=n(a(4340)),d=n(a(7872)),u=n(a(1858));class c extends d.default{onBallCarrierContactDefense(e){const{endPosition:t,netYards:a,yardAndHalfStr:n,netYardsStr:s}=this._getPlayDataOffense(e.ballCarrierPosition);i.default.send(`${l.default.HandFingersSpread} Tackle ${n} | ${s}`),u.default.game.stats.updatePlayerStat(this._ballCarrier.id,{specReceptions:1,specReceivingYards:a}),u.default.game.stats.updatePlayerStat(e.player.id,{specTackles:1});const{isSafety:o,isTouchback:d}=r.default.checkIfSafetyOrTouchbackPlayer(this._startingPosition,t,u.default.game.offenseTeamId);return o?super._handleSafety():d?super._handleTouchback():void this.endPlay({newLosX:t.x,netYards:a})}onBallCarrierContactOffense(e){}onBallCarrierOutOfBounds(e){const{endPosition:t,yardAndHalfStr:a,netYards:n,netYardsStr:s,isTouchdown:o}=this._getPlayDataOffense(e);if(o)return this.handleTouchdown(e);i.default.send(`${this.getBallCarrier().name.trim()} went out of bounds ${a} | ${s}`),u.default.game.stats.updatePlayerStat(this._ballCarrier.id,{specReceptions:1,specReceivingYards:n});const{isSafety:l,isTouchback:d}=r.default.checkIfSafetyOrTouchbackPlayer(this._startingPosition,t,u.default.game.offenseTeamId);return l?super._handleSafety():d?super._handleTouchback():void this.endPlay({newLosX:t.x})}onBallContact(e){this.stateExists("kickOffCaught")||super.onBallContact(e)}onBallOutOfBounds(e){if(r.default.checkIfTouchbackBall(e,u.default.game.offenseTeamId))return this._handleTouchback();this._handleBallOutOfBounds(e)}onKickDrag(e){const t=u.default.game.players.getFielded(),{player:a}=o.default.getNearestPlayerToPosition(t,s.default.getPosition());!1===this.stateExists("kickOffKicked")&&u.default.game.swapOffenseAndUpdatePlayers(),this._handleOffensePenalty(a,"drag")}_onBallContactDefense(e){const{yardAndHalfStr:t,endPosition:a}=this._getPlayDataOffense(e.playerPosition);i.default.send(`${l.default.Pushpin} Ball downed by defense ${t}`);const{isTouchback:n}=r.default.checkIfSafetyOrTouchbackPlayer(a,a,u.default.game.offenseTeamId);if(n)return this._handleTouchback();this.endPlay({newLosX:a.x})}_onBallContactOffense(e){if(!1!==this.stateExists("kickOffKicked"))this._handleCatch(e);else if("kick"===e.type){this.setState("kickOffKicked"),this.setState("KickOffKicker",e.player);const{isOffsides:t,offsidesPlayer:a}=this._checkIfOffenseOffsidesOnKick();if(u.default.game.swapOffenseAndUpdatePlayers(),t)return this._handleOffensePenalty(a,"offsidesOffense")}}}t.default=c},2009:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5693)),s=n(a(1858)),r=n(a(2992)),o=n(a(4340)),l=n(a(7872));class d extends l.default{onBallCarrierContactOffense(e){}onBallCarrierContactDefense(e){const{endPosition:t,netYards:a,yardAndHalfStr:n,netYardsStr:l}=this._getPlayDataOffense(e.ballCarrierPosition);i.default.send(`${o.default.HandFingersSpread} Tackle ${n} | ${l}`),s.default.game.stats.updatePlayerStat(this._ballCarrier.id,{specReceptions:1,specReceivingYards:a}),s.default.game.stats.updatePlayerStat(e.player.id,{specTackles:1});const{isSafety:d}=r.default.checkIfSafetyOrTouchbackPlayer(this._startingPosition,t,s.default.game.offenseTeamId);if(d)return super._handleSafety();this.endPlay({newLosX:t.x,netYards:a})}onBallCarrierOutOfBounds(e){if(!1===this.stateExists("onsideKickKicked"))return this._handleUnsuccessfulOnsideKick("Kicker went out of bounds");const{endPosition:t,yardAndHalfStr:a,netYards:n,netYardsStr:o}=this._getPlayDataOffense(e);i.default.send(`${this.getBallCarrier().name.trim()} went out of bounds ${a} | ${o}`),s.default.game.stats.updatePlayerStat(this._ballCarrier.id,{specReceptions:1,specReceivingYards:n});const{isSafety:l}=r.default.checkIfSafetyOrTouchbackPlayer(this._startingPosition,t,s.default.game.offenseTeamId);if(l)return super._handleSafety();this.endPlay({newLosX:t.x})}onBallContact(e){this.stateExists("onsideKickCaught")||super.onBallContact(e)}onBallOutOfBounds(e){this._handleUnsuccessfulOnsideKick("Kick went out of bounds")}onKickDrag(e){this._handlePenalty("onsideKickDrag",this._kicker),this._handleUnsuccessfulOnsideKick(null)}_onBallContactDefense(e){return e.player.id===this._kicker.id?this._handleBallContactKicker(e):this._handleUnsuccessfulOnsideKick("Illegaly touched by kicking team")}_onBallContactOffense(e){return e.player.id===this._kicker.id?this._handleBallContactKicker(e):!1===this.stateExists("onsideKickKicked")?this._handleUnsuccessfulOnsideKick("Illegaly touched by kicking team"):void this._handleCatch(e)}}t.default=d},4016:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(9972)),s=n(a(5693)),r=n(a(1858)),o=a(5697),l=n(a(2992)),d=n(a(8375)),u=n(a(4175)),c=n(a(4064)),f=n(a(4340)),h=n(a(7872));class m extends h.default{onBallContact(e){this.stateExists("puntCaught")||super.onBallContact(e)}onBallOutOfBounds(e){const t=c.default.adjustBallPositionOnOutOfBounds(e,r.default.game.offenseTeamId),a=o.DistanceConverter.toYardLine(t.x),n=u.default.formatYardAndHalfStr(a,t.x);if(s.default.send(`${f.default.Pushpin} Ball went out of bounds ${n}`),l.default.checkIfTouchbackBall(e,r.default.game.offenseTeamId))return this._handleTouchback();this._endPlayAndSetNewDown({newLosX:t.x})}onBallCarrierOutOfBounds(e){const{endPosition:t,yardAndHalfStr:a,netYards:n,netYardsStr:i,isTouchdown:o}=this._getPlayDataOffense(e);if(o)return this.handleTouchdown(e);s.default.send(`${this.getBallCarrier().name.trim()} went out of bounds ${a} | ${i}`),r.default.game.stats.updatePlayerStat(this._ballCarrier.id,{specReceptions:1,specReceivingYards:n});const{isSafety:d,isTouchback:u}=l.default.checkIfSafetyOrTouchbackPlayer(this._startingPosition,t,r.default.game.offenseTeamId);return d?super._handleSafety():u?super._handleTouchback():void this._endPlayAndSetNewDown({newLosX:t.x})}onBallCarrierContactOffense(e){}onBallCarrierContactDefense(e){const{endPosition:t,netYards:a,yardAndHalfStr:n,netYardsStr:i}=this._getPlayDataOffense(e.ballCarrierPosition);s.default.send(`${f.default.HandFingersSpread} Tackle ${n} | ${i}`),r.default.game.stats.updatePlayerStat(this._ballCarrier.id,{specReceptions:1,specReceivingYards:a}),r.default.game.stats.updatePlayerStat(e.player.id,{specTackles:1});const{isSafety:o,isTouchback:d}=l.default.checkIfSafetyOrTouchbackPlayer(this._startingPosition,t,r.default.game.offenseTeamId);return o?super._handleSafety():d?super._handleTouchback():void this._endPlayAndSetNewDown({newLosX:t.x,netYards:a})}onKickDrag(e){const t=r.default.game.players.getFielded(),{player:a}=d.default.getNearestPlayerToPosition(t,i.default.getPosition());this._handleOffensePenalty(a,"puntDrag")}_onBallContactOffense(e){const{player:t}=e;if(!1!==this.stateExists("puntKicked"))this._handleCatch(e);else if("kick"===e.type){this.setState("puntKicked"),this.setState("puntKicker",t),this._releaseInvisibleWallForDefense(),r.default.game.swapOffenseAndUpdatePlayers();const{isOffsides:e,offsidesPlayer:a}=this._checkIfOffenseOffsidesOnKick(t);if(e)return this._handleOffensePenalty(a,"puntOffsidesOffense")}}_onBallContactDefense(e){const{yardAndHalfStr:t,endPosition:a}=this._getPlayDataOffense(e.playerPosition);s.default.send(`${f.default.Pushpin} Ball downed by defense ${t}`);const{isTouchback:n}=l.default.checkIfSafetyOrTouchbackPlayer(this._startingPosition,a,r.default.game.offenseTeamId);if(n)return this._handleTouchback();this._endPlayAndSetNewDown({newLosX:a.x})}}t.default=m},3160:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5693)),s=n(a(1858)),r=n(a(2992)),o=n(a(8375)),l=n(a(4340)),d=n(a(7872));class u extends d.default{onBallContact(e){if(!(this.stateExists("ballCaught")||this.stateExists("ballRan")||this.stateExists("ballBlitzed")||this.stateExists("interceptionRuling")))return this.stateExists("interceptionAttempt")?this._handleBallContactDuringInterception(e):void super.onBallContact(e)}onBallOutOfBounds(e){if(this.stateExists("interceptionAttempt"))return r.default.checkIfInterceptionSuccessful(e)?this._handleSuccessfulInterception():this.handleUnsuccessfulInterception();const{mapSection:t}=this._getStatInfo(e);return this._updateStatsIfNotTwoPoint(this.getQuarterback().id,{passAttempts:{[t]:1}}),this.stateExists("curvePass")&&this._updateStatsIfNotTwoPoint(this.getQuarterback().id,{curvedPassAttempts:1}),i.default.send(`${l.default.DoNotEnter} Incomplete - Pass out of bounds!`),this.endPlay({})}onBallCarrierOutOfBounds(e){var t,a,n;if(this.stateExists("interceptionAttempt"))return this._handleInterceptionBallCarrierOutOfBounds(e);const o=this.stateExists("catchPosition")?this.getState("catchPosition"):this._startingPosition,{endPosition:d,netYards:u,yardAndHalfStr:c,netYardsStr:f,yardsPassed:h,yardsAfterCatch:m,isTouchdown:y}=this._getPlayDataOffense(e);if(y)return this.handleTouchdown(e);i.default.send(`${l.default.Pushpin} ${this.getBallCarrier().name.trim()} stepped out of bounds ${c} | ${f}`);const{isSafety:g}=r.default.checkIfSafetyOrTouchbackPlayer(o,d,s.default.game.offenseTeamId);if(this.getQuarterback().id===(null===(t=this._ballCarrier)||void 0===t?void 0:t.id)||this.stateExists("ballRan"))this._updateStatsIfNotTwoPoint(null===(a=this._ballCarrier)||void 0===a?void 0:a.id,{rushingAttempts:1,rushingYards:u});else{const e=this.getState("catchPosition"),{mapSection:t}=this._getStatInfo(e);if(this._updateStatsIfNotTwoPoint(null===(n=this._ballCarrier)||void 0===n?void 0:n.id,{receptions:{[t]:1},receivingYards:{[t]:u},receivingYardsAfterCatch:{[t]:m}}),this.stateExists("nearestDefenderToCatch")){const e=this.getState("nearestDefenderToCatch");this._updateStatsIfNotTwoPoint(e.id,{yardsAllowed:{[t]:u}})}this._updateStatsIfNotTwoPoint(this.getQuarterback().id,{passYards:{[t]:u},passYardsDistance:{[t]:h}})}if(g)return this._handleSafety();this.endPlay({newLosX:d.x,netYards:u})}onBallCarrierContactOffense(e){const{player:t,playerPosition:a,ballCarrierPosition:n}=e;if(o.default.checkIfBehind(a.x,n.x,t.team))return this._handleRun(e);this._handlePenalty("illegalRun",t)}onBallCarrierContactDefense(e){return this.stateExists("interceptingPlayer")?this._handleInterceptionTackle(e):this.stateExists("ballRan")?this._handleRunTackle(e):void this._handleTackle(e)}onKickDrag(e){this.setState("ballDragged"),this._startBallMoveBlitzClock()}_onBallContactDefense(e){if(!this.stateExists("ballPassed"))return this.setState("ballBlitzed");const{mapSection:t}=this._getStatInfo(e.playerPosition);if(this._updateStatsIfNotTwoPoint(e.player.id,{passDeflections:{[t]:1}}),this._updateStatsIfNotTwoPoint(this.getQuarterback().id,{passAttempts:{[t]:1}}),this.stateExists("curvePass")&&this._updateStatsIfNotTwoPoint(this.getQuarterback().id,{curvedPassAttempts:1}),i.default.send(`${l.default.DoNotEnter} Incomplete - Pass Deflected`),this.setState("ballDeflected"),this.stateExists("twoPointAttempt"))return this._handleFailedTwoPointConversion();this._handleInterceptionAttempt(e)}_onBallContactOffense(e){if(this.stateExists("ballDeflected"))return this._handleBallContactDuringInterception(e);const{player:t}=e,{id:a}=t;return a===this.getQuarterback().id?this._handleBallContactQuarterback(e):!1===this.stateExists("ballPassed")?this._handleIllegalTouch(e):void this._handleCatch(e)}}t.default=u},7701:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEBUG_MODE=void 0,t.DEBUG_MODE=!1,t.default={roomName:"🏈 HAXFOOTBALL 🏈",maxPlayers:14,noPlayer:!0,public:!0,token:"thr1.AAAAAGMyZ8hubkFRaDCLmg.WTyVSHBPFF4"}},9972:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=a(4798),s=n(a(5198)),r=a(3279);t.default=new class{constructor(){this.IMMOVABLE_INV_MASS=1e-5}getPosition(){return s.default.getBallPosition()}getSpeed(){const{xspeed:e,yspeed:t}=s.default.getDiscProperties(i.DISC_IDS.BALL);return{xspeed:e,yspeed:t}}setPosition(e){const{x:t,y:a=0}=e;return s.default.setDiscProperties(i.DISC_IDS.BALL,{x:t,y:a,xspeed:0,yspeed:0,ygravity:0}),this}suppress(){return s.default.setDiscProperties(i.DISC_IDS.BALL,{invMass:this.IMMOVABLE_INV_MASS,xspeed:0,yspeed:0}),this}release(){return s.default.setDiscProperties(i.DISC_IDS.BALL,{invMass:1,xspeed:0,yspeed:0}),this}makeImmovableButKeepSpeed(){return s.default.setDiscProperties(i.DISC_IDS.BALL,{invMass:this.IMMOVABLE_INV_MASS}),this}score(e){const t=e===r.TEAMS.BLUE?i.MAP_POINTS.BLUE_SCORE_LINE:i.MAP_POINTS.RED_SCORE_LINE;s.default.setDiscProperties(i.DISC_IDS.BALL,{x:t,y:-200,xspeed:0,yspeed:0,ygravity:.015,invMass:this.IMMOVABLE_INV_MASS})}setGravity({x:e,y:t}){return"number"==typeof e&&s.default.setDiscProperties(i.DISC_IDS.BALL,{xgravity:e}),"number"==typeof t&&s.default.setDiscProperties(i.DISC_IDS.BALL,{ygravity:t}),this}removeGravity(){return s.default.setDiscProperties(i.DISC_IDS.BALL,{invMass:1,xspeed:0,ygravity:0}),this}}},5693:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MESSAGE_STYLE=void 0;const i=n(a(5198)),s=n(a(4175)),r=n(a(7117)),o=n(a(4340));t.MESSAGE_STYLE={Bold:"bold",Italic:"italic",Small:"small",Small_bold:"small-bold",Small_italic:"small-italic"},t.default=new class{constructor(){this.PREFIX={TEAMCHAT:"t",COMMAND:"!"},this.silenced=!1}_getAutoSizedStyle(e,a){return e.length>=100?t.MESSAGE_STYLE.Small:a}_sendMessage(e,t){const{icon:a="",info:n="",id:s=null,color:r=null,style:o=null,sound:l=null,autoSize:d=!0}=t,u=[a,n,e].map((e=>e.length>0?e+" ":e)).join("").trim(),c=null===o&&d?this._getAutoSizedStyle(e,o):o;i.default.sendAnnouncement(u,s,r,c,l)}send(e,t={}){this._sendMessage(e,t)}sendMessageMaybeWithClock(e,t){const a=s.default.formatMessageMaybeWithClock(e,t);this._sendMessage(a,{})}sendSuccess(e,t={}){t.icon=o.default.GreenCheck,t.color=r.default.Lime,this._sendMessage(e,t)}sendAnnouncement(e,t={}){t.color=r.default.Orange,this._sendMessage(e,t)}sendNotification(e,t={}){t.icon=o.default.Bell,t.sound=2,this._sendMessage(e,t)}sendWarning(e,t={}){t.icon=o.default.OrangeTriangle,t.sound=2,this._sendMessage(e,t)}sendError(e,t={}){t.icon=o.default.Exclamation,t.color=r.default.LightRed,this._sendMessage(e,t)}sendBotError(e,t={}){t.icon=o.default.Construction,t.color=r.default.Yellow,this._sendMessage(e,t)}}},3768:function(e,t,a){var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var i=Object.getOwnPropertyDescriptor(t,a);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,i)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(a(5693)),l=s(a(5256)),d=r(a(4999)),u=s(a(7202)),c=r(a(5382)),f=r(a(7117)),h=r(a(1858)),m=a(3279);t.default=class{static handleOffensiveMessage(e){return!1}static maybeHandleTeamChat(e){if(e.author.team===m.TEAMS.SPECTATORS)return!1;const t=e.author.team===m.TEAMS.RED?h.default.players.getRed():h.default.players.getBlue(),a=e.author.team===m.TEAMS.RED?f.default.HaxballRed:f.default.HaxballBlue,n=e.content.substring(o.default.PREFIX.TEAMCHAT.length).trim(),i=`${e.author.shortName}: ${n}`;return t.forEach((e=>{o.default.send(i,{color:a,id:e.id})})),!1}static handlePlayerMuted(e){return e.reply("You are muted"),!1}static handleChatSilenced(e){return e.reply("The chat is silenced"),!1}static maybeHandleCommand(e){const t=new c.default(e.content,e.author),a=new u.default(t);try{if(!a.loadCommand())throw new u.CommandError(`Command ${t.commandName} does not exist`);a.validateAndRun()}catch(t){if(t instanceof u.CommandError){const a=t;e.replyError(a.errorMsg)}else o.default.sendBotError(t.message);return!1}return!1}static handleGameCommand(e){const t=d.default.get(e.content.toLowerCase());try{new l.default(e,t).validateAndRun()}catch(t){if(t instanceof l.GameCommandError){const a=t;a.sendToPlayer&&e.replyError(a.message)}else o.default.sendBotError(t.message);return!1}return t.showCommand}}},8224:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5693)),s=n(a(7117));t.default=class{static greetPlayer(e){i.default.send("!rules for rules, !stats for stats",{id:e.id,color:s.default.LightBlue})}}},1285:function(e,t,a){var n=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function o(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,o)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(a(5693)),r=a(2665),o=[{text:"!stats or !stats partialplayername to view your stats or that of another player",weight:.3},{text:"Join our Discord discord.gg/VdrD2p7",weight:.3}];t.default=class{static run(){setInterval((()=>n(this,void 0,void 0,(function*(){const e=(0,r.randFromArrayWeighted)(o).text;s.default.send(e,{sound:0})}))),14e4)}}},3445:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5198)),s=n(a(1858)),r=n(a(3517)),o=a(2781),l=a(3279),d=a(2665);t.default=class{constructor(){this.records=new r.default,this._playersStatic={fielded:[],offense:[],defense:[]},this.playerPositionsMap=new Map}savePlayerPositions(){this._playersStatic.fielded.forEach((e=>{const{position:t}=(0,o.getPlayerDiscProperties)(e.id);this.playerPositionsMap.set(e.id,{team:e.team,position:t})}))}updateStaticPlayerList(e){const t=i.default.getPlayerList().filter((e=>0!==e.team)),[a,n]=(0,d.partition)(t,(t=>t.team===e));this._playersStatic={fielded:t,offense:a,defense:n}}getFielded(){return this._playersStatic.fielded}getDefense(){return this._playersStatic.defense}getOffense(){return this._playersStatic.offense}getOffenseDefense(){return{offense:this._playersStatic.offense,defense:this._playersStatic.defense}}handlePlayerTeamChange(e,t){const{playerRecord:a,hasPlayerRecord:n}=this._getPlayerRecordSubIn(e.id);return!1===n?this.subIn(e,t):e.team===l.TEAMS.SPECTATORS?this.subOut(e,t,{}):0!==a.substitutions.length&&a.substitutions[a.substitutions.length-1].toTeam!==l.TEAMS.SPECTATORS?(this.subOut(e,t,{}),this.subIn(e,t)):this.subIn(e,t)}getPlayerRecordById(e){return this.records.findOne({ids:[e]})}subIn(e,t){const{playerRecord:a,hasPlayerRecord:n,playerProfile:i}=this._getPlayerRecordSubIn(e.id);if(n){const n=a.substitutions[a.substitutions.length-1];if("IN"===(null==n?void 0:n.type))throw Error(`Player ${i.name} was attempted to be subbed in but is already on the field`);return a.substitutions.push({time:t,type:"IN",fromTeam:a.team,toTeam:e.team}),a.team=e.team,a.ids=[...a.ids,e.id],a.name=e.name,a.recordId}return this.records.set(i.id,{auth:i.auth,recordId:i.id,ids:[i.id],name:i.name,ip:i.ip,team:e.team,substitutions:[{time:t,type:"IN",fromTeam:l.TEAMS.SPECTATORS,toTeam:e.team}],wasAtEndOfGame:!1}),i.id}subOut(e,t,a){const n=this._getPlayerRecordSubOut(e.id),{isAtGameEnd:i=!1,wasLeave:s=!1}=a;if(0===n.substitutions.length)throw Error(`Player ${n.name} was subbed out, but did not have a record of being subbed in`);return n.substitutions.push({time:t,type:"OUT",fromTeam:n.team,toTeam:l.TEAMS.SPECTATORS,wasLeave:s}),i&&(n.wasAtEndOfGame=!0),n.recordId}_getPlayerRecordSubOut(e){const t=this.records.findOne({ids:[e]});if(!t)throw Error(`No player record found with ID ${e}`);return t}_getPlayerRecordSubIn(e){const t=s.default.players.playerCollection.get(e);if(!t)throw Error(`No player profile found for id ${e}`);const a=this.records.findOne({auth:t.auth});return{playerRecord:a,hasPlayerRecord:Boolean(a),playerProfile:t}}}},1288:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(3517));t.default=class{constructor(){this.mutedCollection=new i.default}addMute(e){const t={name:e.name,auth:e.auth,id:e.id};this.mutedCollection.set(e.auth,t)}removeMute(e){this.mutedCollection.delete(e)}}},5233:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5198)),s=n(a(1842)),r=n(a(3517)),o=a(3279),l=n(a(1288));t.default=class{constructor(){this.playerCollection=new r.default,this.muted=new l.default}findOne(e){return this.playerCollection.findOne(e)}find(e){return this.playerCollection.find(e)}getByName(e){const t=this.getPlayable(),a=t.find((t=>t.lowerName===e));if(a)return a;const n=t.filter((t=>t.lowerName.startsWith(e)));return n.length>1?-1:0===n.length?null:n[0]}createAndAdd(e){const t=this._createPlayer(e);return this.playerCollection.set(e.id,t),t}delete(e){const t=this.playerCollection.get(e.id);return t?(this.playerCollection.delete(e.id),t):null}getPlayable(){return this._sortByOrderInPlayerList(this.playerCollection.find({canPlay:!0,isAFK:!1}))}getPlayableSpecs(){return this._sortByOrderInPlayerList(this.playerCollection.find({canPlay:!0,team:o.TEAMS.SPECTATORS,isAFK:!1}))}getRed(){return this._sortByOrderInPlayerList(this.playerCollection.find({team:o.TEAMS.RED}))}getBlue(){return this._sortByOrderInPlayerList(this.playerCollection.find({team:o.TEAMS.BLUE}))}getFielded(){return this._sortByOrderInPlayerList(this.playerCollection.find().filter((e=>e.team!==o.TEAMS.SPECTATORS)))}_createPlayer(e){return new s.default(e)}_sortByOrderInPlayerList(e){const t=i.default.getPlayerList(),a=t.reduce(((e,a)=>(e[a.id]=t.findIndex((e=>e.id===a.id)),e)),{});return e.sort(((e,t)=>a[e.id]-a[t.id]))}}},1858:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(4131)),s=n(a(7826)),r=a(2665),o=n(a(1285)),l=n(a(5233));t.default=new class{constructor(){this.sessionId=(0,r.getRandomChars)(4).toLowerCase(),this.roomId=1,this.players=new l.default,this._game=null,this._isBotOn=!0,this._playerTestingId=1}onRoomLoad(){o.default.run(),console.log(`Admin Code: ${this.sessionId}`)}get game(){return this._game}get isBotOn(){return this._isBotOn}turnBotOff(){this._isBotOn=!1}turnBotOn(){this._isBotOn=!0}getPlayerTestingId(){return this._playerTestingId}setPlayerTestingId(e){this._playerTestingId=e}getPlay(){if(!this.game.play)throw new Error("Game Error: Play is not defined");return this.game.play}startNewGame(){this._game=new i.default;const e=this.players.getFielded();this._game.players.updateStaticPlayerList(this.game.offenseTeamId),e.forEach((e=>{const t=this._game.players.subIn(e.playerObject,0);this._game.stats.maybeCreateStatProfile(t)})),this.game.setPlay(new s.default(0),null)}}},5697:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DistanceConverter=void 0;const i=a(4798),s=a(3279),r=a(2665),o=n(a(8375));class l{static toYardLine(e){return(i.MAP_POINTS.HALF_FIELD-Math.abs(e))/i.MAP_POINTS.YARD}static toYard(e){return e/i.MAP_POINTS.YARD}static yardToDistance(e){return e*i.MAP_POINTS.YARD}}t.DistanceConverter=l;class d{constructor(e=0){this._calculation=e}calcDifference2D(e,t){return this._calculation=Math.abs(e-t),this}calcDifference3D(e,t){const a=e.x-t.x,n=e.y-t.y;return this._calculation=Math.hypot(a,n),this}calcNetDifferenceByTeam(e,t,a){const n=e-t;return a===s.TEAMS.RED?(n>0&&(this._calculation=-n),n<0&&(this._calculation=Math.abs(n))):this._calculation=n,this}subtractByTeam(e,t,a){return this._calculation=a===s.TEAMS.RED?e-t:e+t,this}addByTeam(e,t,a){return this._calculation=a===s.TEAMS.RED?e+t:e-t,this}constrainToEndzonePoints(){const e=(0,r.limitNumberWithinRange)(this._calculation,i.MAP_POINTS.RED_GOAL_LINE,i.MAP_POINTS.BLUE_GOAL_LINE);return this._calculation=e,this}roundUpToYardIfBetweenTeamEndzoneAndOneYard(e){const t=o.default.getTeamEndzone(e),a=(new d).addByTeam(t,i.MAP_POINTS.YARD,e).calculate(),n=o.default.checkIfBehind(this._calculation,a,e),s=o.default.checkIfInFront(this._calculation,t,e);return n&&s&&(this._calculation=a),this}roundToYardByTeam(e){const{YARD:t}=i.MAP_POINTS;return this._calculation=e===s.TEAMS.RED?t*Math.floor(this._calculation/t):t*Math.ceil(this._calculation/t),this}calculate(){return this._calculation}calculateAndConvert(){return{distance:this._calculation,yards:l.toYard(this._calculation),yardLine:l.toYardLine(this._calculation)}}}t.default=d},4198:(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=a(4798),i=a(3279),s=a(2665);t.default=new class{constructor(){this.formatPositionToMapHalf=e=>e>n.MAP_POINTS.KICKOFF?"BLUE ":ee>n.MAP_POINTS.KICKOFF?i.TEAMS.BLUE:i.TEAMS.RED}formatRedZonePenalties(e){return 0===e?"":` [${e}/3]`}formatDown(e){return(0,s.toOrdinalSuffix)(e)}formatYardsToGain(e,t){return e<=n.MAP_POINTS.RED_GOAL_LINE||e>=n.MAP_POINTS.BLUE_GOAL_LINE?"GOAL":t}}},2992:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=a(4798),s=a(3279),r=n(a(8375)),o=n(a(4064));class l{static checkIfSafetyBall(e,t){return r.default.getEndZonePositionIsIn(e)===t}static checkIfSack(e,t,a){return r.default.checkIfBehind(e.x,t,a)}static checkIfTouchbackBall(e,t){return r.default.getEndZonePositionIsIn(e)===t}static checkIfTouchdown(e,t){const a=o.default.adjustPlayerPositionFront(e,t),n=r.default.getEndZonePositionIsIn(a);return Boolean(n)&&n!==t}static checkIfFieldGoalSuccessful(e,t){const{x:a,y:n}=e,{RED_FIELD_GOAL_LINE:o,BLUE_FIELD_GOAL_LINE:l,TOP_FG_POST:d,BOTTOM_FG_POST:u}=i.MAP_POINTS,c=t===s.TEAMS.RED?a>l:a{const n=r.default.getEndZonePositionIsIn({x:t.x,y:t.y});return n&&n===a?Boolean(r.default.getEndZonePositionIsIn(e))?{isSafety:!1,isTouchback:!0}:{isSafety:!0,isTouchback:!1}:{isSafety:!1,isTouchback:!1}}},8375:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=a(2781),s=a(4798),r=a(3279),o=a(2665),l=n(a(5697)),d=n(a(4064));t.default=new class{constructor(){this.getEndZonePositionIsIn=e=>{const{RED_GOAL_LINE:t,BLUE_GOAL_LINE:a}=s.MAP_POINTS;return e.x<=t?1:e.x>=a?2:null},this.checkIfBallOutOfBounds=e=>this._checkIfOutOfBounds(e,s.MAP_POINTS.BALL_RADIUS)?e:null,this.getOpposingTeamEndzone=e=>e===r.TEAMS.RED?s.MAP_POINTS.BLUE_GOAL_LINE:s.MAP_POINTS.RED_GOAL_LINE}_checkIfOutOfBounds(e,t){const{x:a,y:n}=e,{topSideLine:i,botSideLine:s,redSideLine:r,blueSideLine:o}=d.default.adjustMapCoordinatesForRadius(t);return ns||ao}findTeamPlayerOffside(e,t,a){return e.find((e=>{const{position:n}=(0,i.getPlayerDiscProperties)(e.id),{x:s}=d.default.adjustPlayerPositionFront(n,t);return!this.checkIfBehind(s,a,t)}))}findTeamPlayerOffsideNoAdjust(e,t,a){return e.find((e=>{const{position:{x:n}}=(0,i.getPlayerDiscProperties)(e.id);return!this.checkIfBehind(n,a,t)}))}findAllTeamPlayerOffside(e,t,a){return e.filter((e=>{const{position:{x:n}}=(0,i.getPlayerDiscProperties)(e.id),r=(new l.default).addByTeam(n,s.MAP_POINTS.PLAYER_RADIUS,t).calculate();return!1===this.checkIfBehind(r,a,t)}))}checkIfPlayerOutOfBounds(e){return this._checkIfOutOfBounds(e,s.MAP_POINTS.PLAYER_RADIUS)?e:null}checkIfBallInFrontOfLOS(e,t,a){return this.checkIfInFront(e.x,t,a)}checkIfBallDragged(e,t,a){return(new l.default).calcDifference3D(e,t).calculate()>a}checkIfInRedzone(e){return e>=s.MAP_POINTS.BLUE_REDZONE?r.TEAMS.BLUE:e<=s.MAP_POINTS.RED_REDZONE?r.TEAMS.RED:null}checkIfBehind(e,t,a){return a===r.TEAMS.RED?e<=t:e>=t}checkIfInFront(e,t,a){return a===r.TEAMS.RED?e>=t:e<=t}checkIfBallBetweenFGPosts(e,t){const{topFG:a,botFG:n,redFG:i,blueFG:r}=d.default.adjustMapCoordinatesForRadius(s.MAP_POINTS.BALL_RADIUS),o=1===t?this.checkIfBehind(e.x,i,1):this.checkIfBehind(e.x,r,2),l=this.checkIfBetweenY(e.y,a,n);return o&&l}checkIfBetweenY(e,t,a){return e>=t&&e<=a}checkIfWithinHash(e,t){const{y:a}=e,{topHash:n,botHash:i}=d.default.adjustMapCoordinatesForRadius(t);return a>n&&a.05}getTeamEndzone(e){return e===r.TEAMS.RED?s.MAP_POINTS.RED_GOAL_LINE:s.MAP_POINTS.BLUE_GOAL_LINE}getClosestPositionToOtherPosition(e,t){return e.reduce(((e,a,n)=>{const i=(new l.default).calcDifference3D(a,t).calculate();return null===e.distanceToPosition||i{const{position:t}=(0,i.getPlayerDiscProperties)(e.id);return t||null})).filter((e=>null!==e));if(0===a.length)return null;const{index:n,distanceToPosition:s}=this.getClosestPositionToOtherPosition(a,t);return{player:e[n],distanceToPosition:s}}getIntendedTargetStr(e,t,a){const n=3*s.MAP_POINTS.YARD;e=e.filter((e=>e.id!==a));const i=this.getNearestPlayerToPosition(e,t);if(null===i||null===i.distanceToPosition)return"";const{player:r,distanceToPosition:o}=i;return r&&o>n?"":`intended for ${r.name.trim()} `}getMapHalfFromPoint(e){return e>s.MAP_POINTS.KICKOFF?r.TEAMS.BLUE:e0?`+${t}`:e<0?`-${t}`:"no gain"}static formatNetYardsMessageFull(e){const t=(0,s.plural)(Math.abs(e),"yard","yards");return e>0?`for a gain of ${t}`:e<0?`for a loss of ${t}`:"for no gain"}static formatMessageMaybeWithClock(e,t){return`${e} ${t>=720?(0,i.toClock)(t):""}`}static formatMapSectionName(e){return{cornerBottom:"bottom corner",cornerTop:"top corner",deep:"deep",middle:"middle",backwards:"backwards"}[e]}}},2994:function(e,t,a){var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var i=Object.getOwnPropertyDescriptor(t,a);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,i)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=a(4798),l=a(2665),d=s(a(5697)),u=r(a(8375));t.default=class{_getPenalty(e,t,a){const{time:n=0}=a,i=(0,l.truncateName)(t.name);return{snapOutOfHashes:{fullName:"Illegal Snap, Out Of Hashes",message:"Illegal Snap, Out Of Hashes, automatic loss of down",netYards:0,addDown:!0},snapOutOfBounds:{fullName:"Illegal Snap, Out of Bounds",message:"Illegal Snap, Out of Bounds, automatic loss of down",netYards:0,addDown:!0},offsidesOffense:{fullName:"Offsides Offense",message:`Offsides Offense ${i}, 10 yard penalty, repeat the down`,netYards:-10,addDown:!1},offsidesDefense:{fullName:"Offsides Defense",message:`Offsides Defense ${i}, 10 yard penalty, repeat the down`,netYards:10,addDown:!1},snapDrag:{fullName:"Quarterback Drag",message:"Quarterback Drag, automatic loss of down",netYards:0,addDown:!0},crowding:{fullName:"Crowding",message:`Crowding ${i}, 15 yard penalty, repeat the down`,netYards:15,addDown:!1,delay:!0},crowdAbuse:{fullName:"Crowd Abuse",message:`Crowd Abuse ${i}, 20 yard penalty, repeat the down`,netYards:20,addDown:!1,delay:!0},illegalPass:{fullName:"Illegal Pass In Front Of Line Of Scrimmage",message:"Illegal Pass In Front Of Line Of Scrimmage, automatic loss of down",netYards:0,addDown:!0},fgDrag:{fullName:"Field Goal Kick Drag",message:"Field Goal Kick Drag, automatic loss of down",netYards:0,addDown:!0},puntDrag:{fullName:"Punt Kick Drag",message:"Punt Kick Drag, 10 yard penalty, repeat the down",netYards:-10,addDown:!1},puntOffsidesOffense:{fullName:"Punt Offsides Offense",message:"Offsides Offense, 10 yard penalty, repeat the down",netYards:-10,addDown:!1},illegalTouch:{fullName:"Illegal Touching Of The Ball",message:`Illegal Touching Of The Ball by ${i}, automatic loss of down`,netYards:0,addDown:!0},illegalRun:{fullName:"Illegal Run",message:`Illegal Run by ${i}, automatic loss of down`,netYards:0,addDown:!0},illegalLosCross:{fullName:"Illegal Line Of Scrimmage Cross",message:`${i} illegally crossed the line of scrimmage, automatic loss of down`,netYards:0,addDown:!0},illegalBlitz:{fullName:"Illegal blitz",message:`Illegal blitz by ${i} at ${(0,l.plural)(Math.round(n),"second","seconds")}, 10 yard penalty, repeat the down`,netYards:10,addDown:!1},onsideKickDrag:{fullName:"Onside Kick Drag",message:"Onside Kick Drag, automatic receiving team 40 yard line",netYards:0,addDown:!1,hasOwnHandler:!0},kickOffDrag:{fullName:"Kickoff Drag",message:"Kickoff Drag, automatic receiving team 40 yard line",netYards:0,addDown:!1,hasOwnHandler:!0},kickOffDragSafety:{fullName:"Safety Punt Drag",message:"Punt Drag after a safety, automatic defense 40 yard line",netYards:0,addDown:!1,hasOwnHandler:!0},kickOffOutOfBounds:{fullName:"Kickoff kicked out of bounds",message:"Kickoff kicked out of bounds, automatic offense 40 yard line",netYards:0,addDown:!1,hasOwnHandler:!0},kickOffOffsides:{fullName:"Kickoff Offsides Offense",message:`Offsides Offense ${i}, automatic offense 40 yard line`,netYards:0,addDown:!1,hasOwnHandler:!0},kickOffOffsidesSafety:{fullName:"Safety Punt Offsides Offense",message:`Offsides Offense ${i} after a safety, automatic defense 40 yard line`,netYards:0,addDown:!1,hasOwnHandler:!0}}[e]}_maybeConstrainNewEndLosXToOneYardLine(e){const t=u.default.getEndZonePositionIsIn({x:e,y:0});if(null===t)return e;const a=u.default.getTeamEndzone(t);return(new d.default).addByTeam(a,1*o.MAP_POINTS.YARD,t).calculate()}getData(e,t,a,n,i,s){const{netYards:r,addDown:l,hasOwnHandler:c=!1,message:f,fullName:h,delay:m}=this._getPenalty(e,t,s),y=a&&r>0,g=d.DistanceConverter.toYardLine(n),P=y?Math.floor(g/2):r,p=(new d.default).addByTeam(n,P*o.MAP_POINTS.YARD,i).calculate(),_=this._maybeConstrainNewEndLosXToOneYardLine(p),S=u.default.getTeamEndzone(i),v=(new d.default).addByTeam(S,1*o.MAP_POINTS.YARD,i).calculate();return{penaltyYards:P,isRedZonePenaltyOnDefense:y,newEndLosX:_,addDown:l||_===v,hasOwnHandler:c,penaltyMessage:f,fullName:h,delay:m}}}},3217:function(e,t,a){var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var i=Object.getOwnPropertyDescriptor(t,a);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,i)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=s(a(5145)),l=a(7701),d=r(a(5693)),u=r(a(1858)),c=r(a(3517));t.default=class{constructor(){this.statsCollection=new c.default}maybeCreateStatProfile(e){if(this.statsCollection.has(e))return;const t=new o.default(e);this.statsCollection.set(e,t)}updatePlayerStat(e,t){var a;const n=u.default.game.players.getPlayerRecordById(e);if(!n)throw Error("Error finding player record");null===(a=this.statsCollection.get(n.recordId))||void 0===a||a.updateStats(t),l.DEBUG_MODE&&d.default.send(`STAT UPDATE: ${JSON.stringify(t)}`,{color:16772956})}getMVP(){const e={receptions:3,receivingYards:.5,rushingYards:1,touchdownsReceived:6,touchdownsRushed:6,passAttempts:0,passCompletions:2,passYards:.3,touchdownsThrown:4,interceptionsThrown:-6,qbSacks:-2,passDeflections:3,tackles:3,yardsAllowed:-1,sacks:6,forcedFumbles:0,interceptionsReceived:12,penalties:-5},t=this.statsCollection.find().map((t=>{const a=Object.entries(t).reduce(((t,a)=>{const[n,i]=a,s=i instanceof o.EMPTY_MAP_SECTION_STAT?i.all:i;if(n in e==0)return t;const r=e[n];return t[n]=s*r,t}),{});return{recordId:t.recordId,statsPoints:a}})).map((e=>{const t=Object.values(e.statsPoints).reduce(((e,t)=>e+t));return{recordId:e.recordId,pointTotal:t}})).reduce(((e,t)=>e.pointTotal>t.pointTotal?e:t),{recordId:0,pointTotal:0});return 0===t.pointTotal?null:{recordId:t.recordId,pointTotal:t.pointTotal}}}},4064:function(e,t,a){var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var i=Object.getOwnPropertyDescriptor(t,a);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,i)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const r=a(4798),o=a(3279),l=s(a(5697));class d{static adjustPlayerPositionFront(e,t){return{x:(new l.default).addByTeam(e.x,r.MAP_POINTS.PLAYER_RADIUS,t).calculate(),y:e.y}}static adjustBallPositionOnOutOfBounds(e,t){return{x:(new l.default).addByTeam(e.x,r.MAP_POINTS.BALL_RADIUS,t).roundUpToYardIfBetweenTeamEndzoneAndOneYard(t).roundToYardByTeam(t).constrainToEndzonePoints().calculate(),y:e.y}}static getNetYardsAndAdjustedEndPosition(e,t,a){const n=this.adjustRawEndPosition(t,a),{distance:i,yardLine:s}=new l.default(n.x).calculateAndConvert(),{yards:r}=(new l.default).calcNetDifferenceByTeam(e.x,i,a).calculateAndConvert();return{netYards:r,yardLine:s,adjustedEndPositionX:i}}static adjustRawEndPosition(e,t){return{x:(new l.default).addByTeam(e.x,r.MAP_POINTS.PLAYER_RADIUS,t).roundUpToYardIfBetweenTeamEndzoneAndOneYard(t).roundToYardByTeam(t).constrainToEndzonePoints().calculate(),y:e.y}}static getPositionOfTeamYard(e,t){const a=l.DistanceConverter.yardToDistance(50-e);return t===o.TEAMS.BLUE?a:-a}}t.default=d,d.adjustMapCoordinatesForRadius=e=>{const{TOP_SIDELINE:t,BOT_SIDELINE:a,RED_SIDELINE:n,BLUE_SIDELINE:i,TOP_HASH:s,BOT_HASH:o,RED_FIELD_GOAL_LINE:l,BLUE_FIELD_GOAL_LINE:d,TOP_FG_POST:u,BOTTOM_FG_POST:c}=r.MAP_POINTS;return{topSideLine:t+e,botSideLine:a-e,redSideLine:n+e,blueSideLine:i-e,topHash:s+e,botHash:o-e,redFG:l+e,blueFG:d-e,topFG:u+e,botFG:c-e}}},1666:function(e,t,a){var n=this&&this.__createBinding||(Object.create?function(e,t,a,n){void 0===n&&(n=a);var i=Object.getOwnPropertyDescriptor(t,a);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,i)}:function(e,t,a,n){void 0===n&&(n=a),e[n]=t[a]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&n(t,e,a);return i(t,e),t},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(a(5198)),l=a(2781),d=a(4798),u=a(3279),c=a(2665),f=s(a(5697)),h=r(a(8375));class m{constructor(e,t,a,n){this.playerId=e,this.playerTeam=t,this.timeGotInCrowdBox=a,this.wasAlone=n}}t.default=class{constructor(){this.CROWD_BOX_YARDS_FRONT=5,this.CROWD_BOX_YARDS_BEHIND=8,this.MAX_CROWDING_SECONDS=3,this.MAX_CROWD_ABUSE_SECONDS=2.25,this._playersInCrowdBoxList=[],this._crowdBoxDiscIndexes=[22,23,24,25]}checkPlayersInCrowdBox(e,t){const a=e.find((e=>{if(this._checkIfPlayerInCrowdBox(e.id)){const a=this._addToCrowdBoxIfNotAlready(e,t);if(this._checkIfMeetsCrowdingCriteria(a,t))return!0}else this._maybeRemoveFromCrowdBoxList(e.id);return!1}));if(a){const e=this._playersInCrowdBoxList.find((e=>e.playerId===a.id));return{isCrowding:!0,crowder:a,crowdingData:e}}return{isCrowding:!1,crowder:null,crowdingData:null}}setOffenseTeam(e){this._offenseTeamId=e}_determineCrowdBoxFrontYards(e){const t=f.DistanceConverter.toYardLine(e),a=t<=this.CROWD_BOX_YARDS_FRONT,n=h.default.getMapHalfFromPoint(e),i=n&&n!==this._offenseTeamId;return a&&i?t:this.CROWD_BOX_YARDS_FRONT}setCrowdBoxArea(e){const t=this._determineCrowdBoxFrontYards(e),a=(new f.default).addByTeam(e,d.MAP_POINTS.YARD*t,this._offenseTeamId).calculate(),n=(new f.default).subtractByTeam(e,d.MAP_POINTS.YARD*this.CROWD_BOX_YARDS_BEHIND,this._offenseTeamId).calculate();if(this._offenseTeamId===u.TEAMS.RED){const e={x1:n,y1:d.MAP_POINTS.TOP_HASH,x2:a,y2:d.MAP_POINTS.BOT_HASH};this._playCrowdBoxArea=e}else{const e={x1:a,y1:d.MAP_POINTS.TOP_HASH,x2:n,y2:d.MAP_POINTS.BOT_HASH};this._playCrowdBoxArea=e}}drawCrowdBoxLines(){o.default.setDiscProperties(this._crowdBoxDiscIndexes[0],{x:this._playCrowdBoxArea.x1,y:d.MAP_POINTS.TOP_HASH}),o.default.setDiscProperties(this._crowdBoxDiscIndexes[1],{x:this._playCrowdBoxArea.x1,y:d.MAP_POINTS.BOT_HASH}),o.default.setDiscProperties(this._crowdBoxDiscIndexes[2],{x:this._playCrowdBoxArea.x2,y:d.MAP_POINTS.BOT_HASH}),o.default.setDiscProperties(this._crowdBoxDiscIndexes[3],{x:this._playCrowdBoxArea.x2,y:d.MAP_POINTS.TOP_HASH})}eraseCrowdBoxLines(){o.default.setDiscProperties(this._crowdBoxDiscIndexes[0],{x:d.MAP_POINTS.HIDDEN,y:d.MAP_POINTS.TOP_HASH}),o.default.setDiscProperties(this._crowdBoxDiscIndexes[1],{x:d.MAP_POINTS.HIDDEN,y:d.MAP_POINTS.BOT_HASH}),o.default.setDiscProperties(this._crowdBoxDiscIndexes[2],{x:d.MAP_POINTS.HIDDEN,y:d.MAP_POINTS.TOP_HASH}),o.default.setDiscProperties(this._crowdBoxDiscIndexes[3],{x:d.MAP_POINTS.HIDDEN,y:d.MAP_POINTS.BOT_HASH})}_checkIfPlayerInCrowdBox(e){const{position:t}=(0,l.getPlayerDiscProperties)(e);return(0,c.isInRectangleArea)(this._playCrowdBoxArea,t)}_addToCrowdBoxIfNotAlready(e,t){const a=this._playersInCrowdBoxList.findIndex((t=>t.playerId===e.id));if(-1!==a)return a;const n=0===this._playersInCrowdBoxList.filter((e=>e.playerTeam===this._offenseTeamId)).length;return this._playersInCrowdBoxList.push(new m(e.id,e.team,t,n))-1}_checkIfMeetsCrowdingCriteria(e,t){if(this._playersInCrowdBoxList.some((e=>e.playerTeam===this._offenseTeamId)))return this._playersInCrowdBoxList.forEach((e=>{e.timeGotInCrowdBox=t})),!1;const a=this._playersInCrowdBoxList[e];return t-a.timeGotInCrowdBox>=(a.wasAlone?this.MAX_CROWD_ABUSE_SECONDS:this.MAX_CROWDING_SECONDS)&&a.playerTeam!==this._offenseTeamId}_maybeRemoveFromCrowdBoxList(e){const t=this._playersInCrowdBoxList.findIndex((t=>t.playerId===e));-1!==t&&this._playersInCrowdBoxList.splice(t,1)}}},3517:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});class a extends Map{_filter(e){return this.find().filter((t=>Object.entries(e).every((([e,a])=>{let n=t[e],i=a;return Array.isArray(n)?i.some((e=>n.includes(e))):(i="string"==typeof a?a.toLowerCase():a,n="string"==typeof n?n.toLowerCase():n,n==i)}))))}find(e=null){return null===e?Array.from(this.values()):this._filter(e)}findOne(e){const[t=null]=this._filter(e);return t}}t.default=a},4340:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});const a={Exclamation:String.fromCodePoint(10071),BarChart:String.fromCodePoint(128202),Medal1:String.fromCodePoint(129351),Medal2:String.fromCodePoint(129352),Medal3:String.fromCodePoint(129353),SportsMedal:String.fromCodePoint(127941),Trophy:String.fromCodePoint(127942),Bell:String.fromCodePoint(128276),Clock:String.fromCodePoint(128276),DoNotEnter:String.fromCodePoint(9940),RedTriangle:String.fromCodePoint(128314),X:String.fromCodePoint(10060),Football:String.fromCodePoint(127944),Stop:String.fromCodePoint(128721),RedSquare:String.fromCodePoint(128997),YellowSquare:String.fromCodePoint(129e3),SmallBlackSquare:String.fromCodePoint(9642),MediumBlackSquare:String.fromCodePoint(9724),SmallWhiteSquare:String.fromCodePoint(9643),BlackSquare:String.fromCodePoint(11035),BlueSquare:String.fromCodePoint(128998),GreenSquare:String.fromCodePoint(129001),BrownSquare:String.fromCodePoint(129003),RedCircle:String.fromCodePoint(128308),OrangeCircle:String.fromCodePoint(128992),GreenCircle:String.fromCodePoint(128994),PurpleCircle:String.fromCodePoint(128995),BlueCircle:String.fromCodePoint(128309),BrownCircle:String.fromCodePoint(128996),WhiteCircle:String.fromCodePoint(9898),GreenCheck:String.fromCodePoint(9989),NoEntry:String.fromCodePoint(128683),On:String.fromCodePoint(128683),Construction:String.fromCodePoint(128679),Star:String.fromCodePoint(11088),Fire:String.fromCodePoint(128293),Lightning:String.fromCodePoint(9889),Lock:String.fromCodePoint(128274),Phone:String.fromCodePoint(128222),Police:String.fromCodePoint(128680),Bot:String.fromCodePoint(128680),Chess:String.fromCodePoint(9823),Crown:String.fromCodePoint(128081),Warning:String.fromCodePoint(9888),ThumbsUp:String.fromCodePoint(128077),HundredPts:String.fromCodePoint(128175),Collision:String.fromCodePoint(128165),Dizzy:String.fromCodePoint(128171),Running:String.fromCodePoint(127939),Target:String.fromCodePoint(127919),Anger:String.fromCodePoint(128162),Pushpin:String.fromCodePoint(128205),SpeakingHead:String.fromCodePoint(128483),Facepalm:String.fromCodePoint(129318),OK:String.fromCodePoint(128582),HandFingersSpread:String.fromCodePoint(128400),Clown:String.fromCodePoint(129313),Loudspeaker:String.fromCodePoint(128226),Mute:String.fromCodePoint(128263),OrangeTriangle:String.fromCodePoint(128312),LargeBlueDiamond:String.fromCodePoint(128311),LargeOrangeDiamond:String.fromCodePoint(128310),Frisbee:String.fromCodePoint(129359)};t.default=a},1234:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(a(5697)),s=a(4798),r=a(3279),o=a(2665);t.default=class{constructor(){this._mapSectionsList=[{name:"cornerTop",getRectangleArea:function(e,t){const{TOP_SIDELINE:a,ABOVE_HASH:n}=s.MAP_POINTS;return{x1:e,y1:a-1e3,x2:t,y2:n}}},{name:"cornerBottom",getRectangleArea:function(e,t){const{BOT_SIDELINE:a,BELOW_HASH:n}=s.MAP_POINTS;return{x1:e,y1:n,x2:t,y2:a+1e3}}},{name:"middle",getRectangleArea:function(e,t){const{ABOVE_HASH:a,BELOW_HASH:n}=s.MAP_POINTS;return{x1:e,y1:a,x2:t,y2:n}}},{name:"deep",getRectangleArea:function(e,t,a,n){const{YARD:o,BOT_SIDELINE:l,TOP_SIDELINE:d}=s.MAP_POINTS,u=(new i.default).addByTeam(a,100*o,n).calculate();return{x1:n===r.TEAMS.RED?e:u,y1:d-1e3,x2:n===r.TEAMS.RED?u:t,y2:l+1e3}}}]}getSectionName(e,t,a){var n;const{YARD:i}=s.MAP_POINTS,r=t-15*i,l=t+15*i,d=this._mapSectionsList.find((n=>{const i=n.getRectangleArea(r,l,t,a);return(0,o.isInRectangleArea)(i,e)}));return null!==(n=null==d?void 0:d.name)&&void 0!==n?n:"backwards"}}},7117:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={HaxballRed:16733782,HaxballBlue:5671397,LightGreen:9498256,Lime:9754669,YellowOrange:16567811,Orange:16749099,Gray:11184810,Black:0,BlueViolet:9055202,LightBlue:7590622,LightSeaGree:2142890,Olive:8421376,HaxballChatGreen:9360043,Gold:16767858,LightRed:16405074,Yellow:16766011,Pink:16221100,White:16777215,DarkGreen:3195184,LightGreen2:11534215,LightRed2:16743265}},2781:function(e,t,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getTeamStringFromId=t.toClock=t.flattenPlayer=t.quickPause=t.getPlayerDiscProperties=void 0;const i=n(a(5198)),s=a(2665);t.getPlayerDiscProperties=e=>{var t;const{xspeed:a=null,yspeed:n=0,x:s=0,y:r=0,radius:o=0}=null!==(t=i.default.getPlayerDiscProperties(e))&&void 0!==t?t:{};return null===a?null:{position:{x:s,y:r},speed:{x:a,y:n},radius:o}},t.quickPause=()=>{i.default.pauseGame(!0),i.default.pauseGame(!1)},t.flattenPlayer=({id:e,team:t,name:a})=>({id:e,team:t,name:a}),t.toClock=e=>{const t=Math.floor(e);return`${Math.floor(t/60)}:${(0,s.leftpad)(t%60)}`},t.getTeamStringFromId=e=>0===e?"Spectators":1===e?"Red":"Blue"},4798:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DISC_IDS=t.MAP_POINTS=void 0,t.MAP_POINTS={PLAYER_RADIUS:15,TE_PLAYER_RADIUS:17,BALL_RADIUS:6.7,KICKOFF:0,HIDDEN:1e4,HALF_FIELD:775,YARD:15.5,TOP_SIDELINE:-280,BOT_SIDELINE:280,RED_SIDELINE:-930,BLUE_SIDELINE:930,RED_GOAL_LINE:-775,BLUE_GOAL_LINE:775,RED_REDZONE:-465,BLUE_REDZONE:465,RED_SCORE_LINE:-1040,BLUE_SCORE_LINE:1040,RED_FIELD_GOAL_LINE:-930,BLUE_FIELD_GOAL_LINE:930,ABOVE_HASH:-110,BELOW_HASH:110,TOP_HASH:-95,BOT_HASH:95,TOP_FG_POST:-60,BOTTOM_FG_POST:60},t.DISC_IDS={BALL:0,LOS_TOP:1,LOS_BOT:2,LTG_TOP:3,LTG_BOT:4,TE:[17,18,19,20,21]},t.default='{\n\n\t"name" : "2022 HFL Official",\n\n\t"width" : 1090,\n\n\t"height" : 380,\n\n\t"cameraFollow" : "player",\n\n\t"spawnDistance" : 980,\n\n\t"bg" : { "type" : "grass", "width" : 930, "height" : 280, "kickOffRadius" : 0, "cornerRadius" : 0, "goalLine" : 0 },\n\n\t"vertexes" : [\n\t\t/* 0 */ { "x" : 0, "y" : 75, "trait" : "kickOffBarrier" },\n\t\t/* 1 */ { "x" : 0, "y" : -75, "trait" : "kickOffBarrier" },\n\t\t/* 2 */ { "x" : 0, "y" : -330, "trait" : "kickOffBarrier" },\n\t\t\n\t\t/* 3 */ { "x" : -775, "y" : -280, "trait" : "goalline" },\n\t\t/* 4 */ { "x" : -775, "y" : 280, "trait" : "goalline" },\n\t\t\n\t\t/* 5 */ { "x" : -620, "y" : -280, "trait" : "yardline" },\n\t\t/* 6 */ { "x" : -620, "y" : 280, "trait" : "yardline" },\n\t\t/* 7 */ { "x" : -310, "y" : -280, "trait" : "yardline" },\n\t\t/* 8 */ { "x" : -310, "y" : 280, "trait" : "yardline" },\n\t\t/* 9 */ { "x" : -155, "y" : -280, "trait" : "yardline" },\n\t\t/* 10 */ { "x" : -155, "y" : 280, "trait" : "yardline" },\n\t\t\n\t\t/* 11 */ { "x" : 0, "y" : -280, "trait" : "centerline" },\n\t\t/* 12 */ { "x" : 0, "y" : 280, "trait" : "centerline" },\n\t\t\n\t\t/* 13 */ { "x" : 155, "y" : -280, "trait" : "yardline" },\n\t\t/* 14 */ { "x" : 155, "y" : 280, "trait" : "yardline" },\n\t\t/* 15 */ { "x" : 310, "y" : -280, "trait" : "yardline" },\n\t\t/* 16 */ { "x" : 310, "y" : 280, "trait" : "yardline" },\n\t\t/* 17 */ { "x" : 465, "y" : -280, "trait" : "yardline" },\n\t\t/* 18 */ { "x" : 465, "y" : 280, "trait" : "yardline" },\n\t\t/* 19 */ { "x" : 620, "y" : -280, "trait" : "yardline" },\n\t\t/* 20 */ { "x" : 620, "y" : 280, "trait" : "yardline" },\n\t\t\n\t\t/* 21 */ { "x" : 775, "y" : -280, "trait" : "goalline" },\n\t\t/* 22 */ { "x" : 775, "y" : 280, "trait" : "goalline" },\n\t\t\n\t\t/* 23 */ { "x" : -1005, "y" : 25, "trait" : "goal" },\n\t\t/* 24 */ { "x" : -1005, "y" : -25, "trait" : "goal" },\n\t\t/* 25 */ { "x" : 1005, "y" : 25, "trait" : "goal" },\n\t\t/* 26 */ { "x" : 1005, "y" : -25, "trait" : "goal" },\n\t\t\n\t\t/* 27 */ { "x" : -775, "y" : -375, "trait" : "goalline" },\n\t\t/* 28 */ { "x" : -775, "y" : 375, "trait" : "goalline" },\n\t\t/* 29 */ { "x" : 775, "y" : -375, "trait" : "goalline", "curve" : 0 },\n\t\t/* 30 */ { "x" : 775, "y" : 375, "trait" : "goalline", "curve" : 0 },\n\t\t\n\t\t/* 31 */ { "x" : -713, "y" : -75, "trait" : "yardline" },\n\t\t/* 32 */ { "x" : -713, "y" : -95, "trait" : "yardline" },\n\t\t/* 33 */ { "x" : -744, "y" : -75, "trait" : "yardline" },\n\t\t/* 34 */ { "x" : -744, "y" : -95, "trait" : "yardline" },\n\t\t/* 35 */ { "x" : -744, "y" : 95, "trait" : "yardline" },\n\t\t/* 36 */ { "x" : -744, "y" : 75, "trait" : "yardline" },\n\t\t/* 37 */ { "x" : -713, "y" : 95, "trait" : "yardline" },\n\t\t/* 38 */ { "x" : -713, "y" : 75, "trait" : "yardline" },\n\t\t/* 39 */ { "x" : 713, "y" : 95, "trait" : "yardline" },\n\t\t/* 40 */ { "x" : 713, "y" : 75, "trait" : "yardline" },\n\t\t/* 41 */ { "x" : 62, "y" : 95, "trait" : "yardline" },\n\t\t/* 42 */ { "x" : 62, "y" : 75, "trait" : "yardline" },\n\t\t/* 43 */ { "x" : 31, "y" : 95, "trait" : "yardline" },\n\t\t/* 44 */ { "x" : 31, "y" : 75, "trait" : "yardline" },\n\t\t/* 45 */ { "x" : -93, "y" : 95, "trait" : "yardline" },\n\t\t/* 46 */ { "x" : -93, "y" : 75, "trait" : "yardline" },\n\t\t/* 47 */ { "x" : -124, "y" : 95, "trait" : "yardline" },\n\t\t/* 48 */ { "x" : -124, "y" : 75, "trait" : "yardline" },\n\t\t/* 49 */ { "x" : -248, "y" : 95, "trait" : "yardline" },\n\t\t/* 50 */ { "x" : -248, "y" : 75, "trait" : "yardline" },\n\t\t/* 51 */ { "x" : -279, "y" : 95, "trait" : "yardline" },\n\t\t/* 52 */ { "x" : -279, "y" : 75, "trait" : "yardline" },\n\t\t/* 53 */ { "x" : -403, "y" : 95, "trait" : "yardline" },\n\t\t/* 54 */ { "x" : -403, "y" : 75, "trait" : "yardline" },\n\t\t/* 55 */ { "x" : -434, "y" : 95, "trait" : "yardline" },\n\t\t/* 56 */ { "x" : -434, "y" : 75, "trait" : "yardline" },\n\t\t/* 57 */ { "x" : -558, "y" : 95, "trait" : "yardline" },\n\t\t/* 58 */ { "x" : -558, "y" : 75, "trait" : "yardline" },\n\t\t/* 59 */ { "x" : -589, "y" : 95, "trait" : "yardline" },\n\t\t/* 60 */ { "x" : -589, "y" : 75, "trait" : "yardline" },\n\t\t/* 61 */ { "x" : 186, "y" : -75, "trait" : "yardline" },\n\t\t/* 62 */ { "x" : 186, "y" : -95, "trait" : "yardline" },\n\t\t/* 63 */ { "x" : 62, "y" : -75, "trait" : "yardline" },\n\t\t/* 64 */ { "x" : 62, "y" : -95, "trait" : "yardline" },\n\t\t/* 65 */ { "x" : 31, "y" : -75, "trait" : "yardline" },\n\t\t/* 66 */ { "x" : 31, "y" : -95, "trait" : "yardline" },\n\t\t/* 67 */ { "x" : -93, "y" : -75, "trait" : "yardline" },\n\t\t/* 68 */ { "x" : -93, "y" : -95, "trait" : "yardline" },\n\t\t/* 69 */ { "x" : -124, "y" : -75, "trait" : "yardline" },\n\t\t/* 70 */ { "x" : -124, "y" : -95, "trait" : "yardline" },\n\t\t/* 71 */ { "x" : -248, "y" : -75, "trait" : "yardline" },\n\t\t/* 72 */ { "x" : -248, "y" : -95, "trait" : "yardline" },\n\t\t/* 73 */ { "x" : -279, "y" : -75, "trait" : "yardline" },\n\t\t/* 74 */ { "x" : -279, "y" : -95, "trait" : "yardline" },\n\t\t/* 75 */ { "x" : -403, "y" : -75, "trait" : "yardline" },\n\t\t/* 76 */ { "x" : -403, "y" : -95, "trait" : "yardline" },\n\t\t/* 77 */ { "x" : -434, "y" : -75, "trait" : "yardline" },\n\t\t/* 78 */ { "x" : -434, "y" : -95, "trait" : "yardline" },\n\t\t/* 79 */ { "x" : -558, "y" : -75, "trait" : "yardline" },\n\t\t/* 80 */ { "x" : -558, "y" : -95, "trait" : "yardline" },\n\t\t/* 81 */ { "x" : -589, "y" : -75, "trait" : "yardline" },\n\t\t/* 82 */ { "x" : -589, "y" : -95, "trait" : "yardline" },\n\t\t/* 83 */ { "x" : 186, "y" : 95, "trait" : "yardline" },\n\t\t/* 84 */ { "x" : 186, "y" : 75, "trait" : "yardline" },\n\t\t/* 85 */ { "x" : 651, "y" : -75, "trait" : "yardline" },\n\t\t/* 86 */ { "x" : 651, "y" : -95, "trait" : "yardline" },\n\t\t/* 87 */ { "x" : 651, "y" : 95, "trait" : "yardline" },\n\t\t/* 88 */ { "x" : 651, "y" : 75, "trait" : "yardline" },\n\t\t/* 89 */ { "x" : 682, "y" : 95, "trait" : "yardline" },\n\t\t/* 90 */ { "x" : 682, "y" : 75, "trait" : "yardline" },\n\t\t/* 91 */ { "x" : 682, "y" : -75, "trait" : "yardline" },\n\t\t/* 92 */ { "x" : 682, "y" : -95, "trait" : "yardline" },\n\t\t/* 93 */ { "x" : 527, "y" : -75, "trait" : "yardline" },\n\t\t/* 94 */ { "x" : 527, "y" : -95, "trait" : "yardline" },\n\t\t/* 95 */ { "x" : 527, "y" : 95, "trait" : "yardline" },\n\t\t/* 96 */ { "x" : 527, "y" : 75, "trait" : "yardline" },\n\t\t/* 97 */ { "x" : 496, "y" : 95, "trait" : "yardline" },\n\t\t/* 98 */ { "x" : 496, "y" : 75, "trait" : "yardline" },\n\t\t/* 99 */ { "x" : 496, "y" : -75, "trait" : "yardline" },\n\t\t/* 100 */ { "x" : 496, "y" : -95, "trait" : "yardline" },\n\t\t/* 101 */ { "x" : 372, "y" : -75, "trait" : "yardline" },\n\t\t/* 102 */ { "x" : 372, "y" : -95, "trait" : "yardline" },\n\t\t/* 103 */ { "x" : 403, "y" : 95, "trait" : "yardline" },\n\t\t/* 104 */ { "x" : 403, "y" : 75, "trait" : "yardline" },\n\t\t/* 105 */ { "x" : 372, "y" : 95, "trait" : "yardline" },\n\t\t/* 106 */ { "x" : 372, "y" : 75, "trait" : "yardline" },\n\t\t/* 107 */ { "x" : 341, "y" : -75, "trait" : "yardline" },\n\t\t/* 108 */ { "x" : 341, "y" : -95, "trait" : "yardline" },\n\t\t/* 109 */ { "x" : 217, "y" : -75, "trait" : "yardline" },\n\t\t/* 110 */ { "x" : 217, "y" : -95, "trait" : "yardline" },\n\t\t/* 111 */ { "x" : 217, "y" : 95, "trait" : "yardline" },\n\t\t/* 112 */ { "x" : 217, "y" : 75, "trait" : "yardline" },\n\t\t\n\t\t/* 113 */ { "x" : 1005, "y" : 25, "trait" : "goal" },\n\t\t/* 114 */ { "x" : 1005, "y" : -25, "trait" : "goal" },\n\t\t\n\t\t/* 115 */ { "x" : -682, "y" : -75, "trait" : "yardline" },\n\t\t/* 116 */ { "x" : -682, "y" : -95, "trait" : "yardline" },\n\t\t/* 117 */ { "x" : -682, "y" : 95, "trait" : "yardline" },\n\t\t/* 118 */ { "x" : -682, "y" : 75, "trait" : "yardline" },\n\t\t/* 119 */ { "x" : -651, "y" : 95, "trait" : "yardline" },\n\t\t/* 120 */ { "x" : -651, "y" : 75, "trait" : "yardline" },\n\t\t/* 121 */ { "x" : -651, "y" : -75, "trait" : "yardline" },\n\t\t/* 122 */ { "x" : -651, "y" : -95, "trait" : "yardline", "_selected" : true },\n\t\t/* 123 */ { "x" : -527, "y" : 95, "trait" : "yardline" },\n\t\t/* 124 */ { "x" : -527, "y" : 75, "trait" : "yardline" },\n\t\t/* 125 */ { "x" : -527, "y" : -75, "trait" : "yardline" },\n\t\t/* 126 */ { "x" : -527, "y" : -95, "trait" : "yardline" },\n\t\t/* 127 */ { "x" : -496, "y" : -75, "trait" : "yardline" },\n\t\t/* 128 */ { "x" : -496, "y" : -95, "trait" : "yardline" },\n\t\t/* 129 */ { "x" : -496, "y" : 95, "trait" : "yardline" },\n\t\t/* 130 */ { "x" : -496, "y" : 75, "trait" : "yardline" },\n\t\t/* 131 */ { "x" : -372, "y" : -75, "trait" : "yardline" },\n\t\t/* 132 */ { "x" : -372, "y" : -95, "trait" : "yardline" },\n\t\t/* 133 */ { "x" : -372, "y" : 95, "trait" : "yardline" },\n\t\t/* 134 */ { "x" : -372, "y" : 75, "trait" : "yardline" },\n\t\t/* 135 */ { "x" : -341, "y" : 95, "trait" : "yardline" },\n\t\t/* 136 */ { "x" : -341, "y" : 75, "trait" : "yardline" },\n\t\t/* 137 */ { "x" : -341, "y" : -75, "trait" : "yardline" },\n\t\t/* 138 */ { "x" : -341, "y" : -95, "trait" : "yardline" },\n\t\t/* 139 */ { "x" : -217, "y" : 95, "trait" : "yardline" },\n\t\t/* 140 */ { "x" : -217, "y" : 75, "trait" : "yardline" },\n\t\t/* 141 */ { "x" : -186, "y" : 95, "trait" : "yardline" },\n\t\t/* 142 */ { "x" : -186, "y" : 75, "trait" : "yardline" },\n\t\t/* 143 */ { "x" : -217, "y" : -75, "trait" : "yardline" },\n\t\t/* 144 */ { "x" : -217, "y" : -95, "trait" : "yardline" },\n\t\t/* 145 */ { "x" : -186, "y" : -75, "trait" : "yardline" },\n\t\t/* 146 */ { "x" : -186, "y" : -95, "trait" : "yardline" },\n\t\t/* 147 */ { "x" : -62, "y" : 95, "trait" : "yardline" },\n\t\t/* 148 */ { "x" : -62, "y" : 75, "trait" : "yardline" },\n\t\t/* 149 */ { "x" : -31, "y" : 95, "trait" : "yardline" },\n\t\t/* 150 */ { "x" : -31, "y" : 75, "trait" : "yardline" },\n\t\t/* 151 */ { "x" : -62, "y" : -75, "trait" : "yardline" },\n\t\t/* 152 */ { "x" : -62, "y" : -95, "trait" : "yardline" },\n\t\t/* 153 */ { "x" : -31, "y" : -75, "trait" : "yardline" },\n\t\t/* 154 */ { "x" : -31, "y" : -95, "trait" : "yardline" },\n\t\t/* 155 */ { "x" : 93, "y" : -75, "trait" : "yardline" },\n\t\t/* 156 */ { "x" : 93, "y" : -95, "trait" : "yardline" },\n\t\t/* 157 */ { "x" : 93, "y" : 95, "trait" : "yardline" },\n\t\t/* 158 */ { "x" : 93, "y" : 75, "trait" : "yardline" },\n\t\t/* 159 */ { "x" : 124, "y" : 95, "trait" : "yardline" },\n\t\t/* 160 */ { "x" : 124, "y" : 75, "trait" : "yardline" },\n\t\t/* 161 */ { "x" : 124, "y" : -75, "trait" : "yardline" },\n\t\t/* 162 */ { "x" : 124, "y" : -95, "trait" : "yardline" },\n\t\t/* 163 */ { "x" : 248, "y" : 95, "trait" : "yardline" },\n\t\t/* 164 */ { "x" : 248, "y" : 75, "trait" : "yardline" },\n\t\t/* 165 */ { "x" : 248, "y" : -75, "trait" : "yardline" },\n\t\t/* 166 */ { "x" : 248, "y" : -95, "trait" : "yardline" },\n\t\t/* 167 */ { "x" : 279, "y" : -75, "trait" : "yardline" },\n\t\t/* 168 */ { "x" : 279, "y" : -95, "trait" : "yardline" },\n\t\t/* 169 */ { "x" : 279, "y" : 95, "trait" : "yardline" },\n\t\t/* 170 */ { "x" : 279, "y" : 75, "trait" : "yardline" },\n\t\t/* 171 */ { "x" : 341, "y" : 95, "trait" : "yardline" },\n\t\t/* 172 */ { "x" : 341, "y" : 75, "trait" : "yardline" },\n\t\t/* 173 */ { "x" : 403, "y" : -75, "trait" : "yardline" },\n\t\t/* 174 */ { "x" : 403, "y" : -95, "trait" : "yardline" },\n\t\t/* 175 */ { "x" : 434, "y" : -75, "trait" : "yardline" },\n\t\t/* 176 */ { "x" : 434, "y" : -95, "trait" : "yardline" },\n\t\t/* 177 */ { "x" : 434, "y" : 95, "trait" : "yardline" },\n\t\t/* 178 */ { "x" : 434, "y" : 75, "trait" : "yardline" },\n\t\t/* 179 */ { "x" : 558, "y" : 95, "trait" : "yardline" },\n\t\t/* 180 */ { "x" : 558, "y" : 75, "trait" : "yardline" },\n\t\t/* 181 */ { "x" : 558, "y" : -75, "trait" : "yardline" },\n\t\t/* 182 */ { "x" : 558, "y" : -95, "trait" : "yardline" },\n\t\t/* 183 */ { "x" : 589, "y" : -75, "trait" : "yardline" },\n\t\t/* 184 */ { "x" : 589, "y" : -95, "trait" : "yardline" },\n\t\t/* 185 */ { "x" : 589, "y" : 95, "trait" : "yardline" },\n\t\t/* 186 */ { "x" : 589, "y" : 75, "trait" : "yardline" },\n\t\t/* 187 */ { "x" : 713, "y" : -75, "trait" : "yardline" },\n\t\t/* 188 */ { "x" : 713, "y" : -95, "trait" : "yardline" },\n\t\t/* 189 */ { "x" : 744, "y" : -75, "trait" : "yardline" },\n\t\t/* 190 */ { "x" : 744, "y" : -95, "trait" : "yardline" },\n\t\t/* 191 */ { "x" : 744, "y" : 95, "trait" : "yardline" },\n\t\t/* 192 */ { "x" : 744, "y" : 75, "trait" : "yardline" },\n\t\t/* 193 */ { "x" : -465, "y" : -280, "trait" : "yardline", "color" : "c7e6bd" },\n\t\t/* 194 */ { "x" : -465, "y" : 280, "trait" : "yardline", "color" : "c7e6bd" },\n\t\t/* 195 */ { "x" : 465, "y" : 280, "trait" : "yardline", "color" : "c7e6bd" },\n\t\t/* 196 */ { "x" : -697.5, "y" : 280, "trait" : "yardline" },\n\t\t/* 197 */ { "x" : -697.5, "y" : 246, "trait" : "yardline" },\n\t\t/* 198 */ { "x" : -542.5, "y" : 280, "trait" : "yardline" },\n\t\t/* 199 */ { "x" : -542.5, "y" : 246, "trait" : "yardline" },\n\t\t/* 200 */ { "x" : -387.5, "y" : 280, "trait" : "yardline" },\n\t\t/* 201 */ { "x" : -387.5, "y" : 246, "trait" : "yardline" },\n\t\t/* 202 */ { "x" : -232.5, "y" : 280, "trait" : "yardline" },\n\t\t/* 203 */ { "x" : -232.5, "y" : 246, "trait" : "yardline" },\n\t\t/* 204 */ { "x" : -77.5, "y" : 280, "trait" : "yardline" },\n\t\t/* 205 */ { "x" : -77.5, "y" : 246, "trait" : "yardline" },\n\t\t/* 206 */ { "x" : 77.5, "y" : 280, "trait" : "yardline" },\n\t\t/* 207 */ { "x" : 77.5, "y" : 246, "trait" : "yardline" },\n\t\t/* 208 */ { "x" : 232.5, "y" : 280, "trait" : "yardline" },\n\t\t/* 209 */ { "x" : 232.5, "y" : 246, "trait" : "yardline" },\n\t\t/* 210 */ { "x" : 387.5, "y" : 280, "trait" : "yardline" },\n\t\t/* 211 */ { "x" : 387.5, "y" : 246, "trait" : "yardline" },\n\t\t/* 212 */ { "x" : 387.5, "y" : -246, "trait" : "yardline" },\n\t\t/* 213 */ { "x" : 387.5, "y" : -280, "trait" : "yardline" },\n\t\t/* 214 */ { "x" : 232.5, "y" : -246, "trait" : "yardline" },\n\t\t/* 215 */ { "x" : 232.5, "y" : -280, "trait" : "yardline" },\n\t\t/* 216 */ { "x" : 77.5, "y" : -246, "trait" : "yardline" },\n\t\t/* 217 */ { "x" : 77.5, "y" : -280, "trait" : "yardline" },\n\t\t/* 218 */ { "x" : 542.5, "y" : -246, "trait" : "yardline" },\n\t\t/* 219 */ { "x" : 542.5, "y" : -280, "trait" : "yardline" },\n\t\t/* 220 */ { "x" : 697.5, "y" : -246, "trait" : "yardline" },\n\t\t/* 221 */ { "x" : 697.5, "y" : -280, "trait" : "yardline" },\n\t\t/* 222 */ { "x" : -77.5, "y" : -246, "trait" : "yardline" },\n\t\t/* 223 */ { "x" : -77.5, "y" : -280, "trait" : "yardline" },\n\t\t/* 224 */ { "x" : -232.5, "y" : -246, "trait" : "yardline" },\n\t\t/* 225 */ { "x" : -232.5, "y" : -280, "trait" : "yardline" },\n\t\t/* 226 */ { "x" : -387.5, "y" : -246, "trait" : "yardline" },\n\t\t/* 227 */ { "x" : -387.5, "y" : -280, "trait" : "yardline" },\n\t\t/* 228 */ { "x" : -542.5, "y" : -246, "trait" : "yardline" },\n\t\t/* 229 */ { "x" : -542.5, "y" : -280, "trait" : "yardline" },\n\t\t/* 230 */ { "x" : -697.5, "y" : -246, "trait" : "yardline" },\n\t\t/* 231 */ { "x" : -697.5, "y" : -280, "trait" : "yardline" },\n\t\t/* 232 */ { "x" : 540.5, "y" : 264, "trait" : "yardline" },\n\t\t/* 233 */ { "x" : 540.5, "y" : 244, "trait" : "yardline" },\n\t\t/* 234 */ { "x" : 697.5, "y" : 280, "trait" : "yardline" },\n\t\t/* 235 */ { "x" : 697.5, "y" : 246, "trait" : "yardline" }\n\n\t],\n\n\t"segments" : [\n\t\t{ "v0" : 1, "v1" : 2, "trait" : "kickOffBarrier" },\n\t\t\n\t\t{ "v0" : 3, "v1" : 4, "trait" : "goalline", "x" : -775 },\n\t\t\n\t\t{ "v0" : 5, "v1" : 6, "trait" : "yardline", "x" : -620 },\n\t\t{ "v0" : 7, "v1" : 8, "trait" : "yardline", "x" : -310 },\n\t\t{ "v0" : 9, "v1" : 10, "trait" : "yardline", "x" : -155 },\n\t\t\n\t\t{ "v0" : 11, "v1" : 12, "trait" : "centerline" },\n\t\t\n\t\t{ "v0" : 13, "v1" : 14, "trait" : "yardline", "x" : 155 },\n\t\t{ "v0" : 15, "v1" : 16, "trait" : "yardline", "x" : 310 },\n\t\t{ "v0" : 17, "v1" : 18, "trait" : "yardline", "x" : 465 },\n\t\t{ "v0" : 19, "v1" : 20, "trait" : "yardline", "x" : 620 },\n\t\t\n\t\t{ "v0" : 21, "v1" : 22, "trait" : "goalline", "x" : 775 },\n\t\t\n\t\t{ "v0" : 23, "v1" : 24, "color" : "FF0000", "trait" : "goal", "x" : -1005 },\n\t\t{ "v0" : 25, "v1" : 26, "color" : "0000FF", "trait" : "goal", "x" : 1005 },\n\t\t\n\t\t{ "v0" : 27, "v1" : 28, "cGroup" : ["blueKO" ], "trait" : "kickOffBarrier", "x" : -775 },\n\t\t{ "v0" : 29, "v1" : 30, "curve" : 0, "cGroup" : ["redKO" ], "trait" : "kickOffBarrier", "x" : 775 },\n\t\t\n\t\t{ "v0" : 31, "v1" : 32, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -713 },\n\t\t{ "v0" : 33, "v1" : 34, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -744 },\n\t\t{ "v0" : 35, "v1" : 36, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -744 },\n\t\t{ "v0" : 37, "v1" : 38, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -713 },\n\t\t{ "v0" : 39, "v1" : 40, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 713 },\n\t\t{ "v0" : 41, "v1" : 42, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 62 },\n\t\t{ "v0" : 43, "v1" : 44, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 31 },\n\t\t{ "v0" : 45, "v1" : 46, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -93 },\n\t\t{ "v0" : 47, "v1" : 48, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -124 },\n\t\t{ "v0" : 49, "v1" : 50, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -248 },\n\t\t{ "v0" : 51, "v1" : 52, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -279 },\n\t\t{ "v0" : 53, "v1" : 54, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -403 },\n\t\t{ "v0" : 55, "v1" : 56, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -434 },\n\t\t{ "v0" : 57, "v1" : 58, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -558 },\n\t\t{ "v0" : 59, "v1" : 60, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -589 },\n\t\t{ "v0" : 61, "v1" : 62, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 186 },\n\t\t{ "v0" : 63, "v1" : 64, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 62 },\n\t\t{ "v0" : 65, "v1" : 66, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 31 },\n\t\t{ "v0" : 67, "v1" : 68, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -93 },\n\t\t{ "v0" : 69, "v1" : 70, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -124 },\n\t\t{ "v0" : 71, "v1" : 72, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -248 },\n\t\t{ "v0" : 73, "v1" : 74, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -279 },\n\t\t{ "v0" : 75, "v1" : 76, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -403 },\n\t\t{ "v0" : 77, "v1" : 78, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -434 },\n\t\t{ "v0" : 79, "v1" : 80, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -558 },\n\t\t{ "v0" : 81, "v1" : 82, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -589 },\n\t\t{ "v0" : 83, "v1" : 84, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 186 },\n\t\t{ "v0" : 85, "v1" : 86, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 651 },\n\t\t{ "v0" : 87, "v1" : 88, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 651 },\n\t\t{ "v0" : 89, "v1" : 90, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 682 },\n\t\t{ "v0" : 91, "v1" : 92, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 682 },\n\t\t{ "v0" : 93, "v1" : 94, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 527 },\n\t\t{ "v0" : 95, "v1" : 96, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 527 },\n\t\t{ "v0" : 97, "v1" : 98, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 496 },\n\t\t{ "v0" : 99, "v1" : 100, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 496 },\n\t\t{ "v0" : 101, "v1" : 102, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 372 },\n\t\t{ "v0" : 103, "v1" : 104, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 403 },\n\t\t{ "v0" : 105, "v1" : 106, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 372 },\n\t\t{ "v0" : 107, "v1" : 108, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 341 },\n\t\t{ "v0" : 109, "v1" : 110, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 217 },\n\t\t{ "v0" : 111, "v1" : 112, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 217 },\n\t\t{ "v0" : 115, "v1" : 116, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -682 },\n\t\t{ "v0" : 117, "v1" : 118, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -682 },\n\t\t{ "v0" : 119, "v1" : 120, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -651 },\n\t\t{ "v0" : 121, "v1" : 122, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -651 },\n\t\t{ "v0" : 123, "v1" : 124, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -527 },\n\t\t{ "v0" : 125, "v1" : 126, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -527 },\n\t\t{ "v0" : 127, "v1" : 128, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -496 },\n\t\t{ "v0" : 129, "v1" : 130, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -496 },\n\t\t{ "v0" : 131, "v1" : 132, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -372 },\n\t\t{ "v0" : 133, "v1" : 134, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -372 },\n\t\t{ "v0" : 135, "v1" : 136, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -341 },\n\t\t{ "v0" : 137, "v1" : 138, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -341 },\n\t\t{ "v0" : 139, "v1" : 140, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -217 },\n\t\t{ "v0" : 141, "v1" : 142, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -186 },\n\t\t{ "v0" : 143, "v1" : 144, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -217 },\n\t\t{ "v0" : 145, "v1" : 146, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -186 },\n\t\t{ "v0" : 147, "v1" : 148, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -62 },\n\t\t{ "v0" : 149, "v1" : 150, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -31 },\n\t\t{ "v0" : 151, "v1" : 152, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -62 },\n\t\t{ "v0" : 153, "v1" : 154, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -31 },\n\t\t{ "v0" : 155, "v1" : 156, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 93 },\n\t\t{ "v0" : 157, "v1" : 158, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 93 },\n\t\t{ "v0" : 159, "v1" : 160, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 124 },\n\t\t{ "v0" : 161, "v1" : 162, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 124 },\n\t\t{ "v0" : 163, "v1" : 164, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 248 },\n\t\t{ "v0" : 165, "v1" : 166, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 248 },\n\t\t{ "v0" : 167, "v1" : 168, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 279 },\n\t\t{ "v0" : 169, "v1" : 170, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 279 },\n\t\t{ "v0" : 171, "v1" : 172, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 341 },\n\t\t{ "v0" : 173, "v1" : 174, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 403 },\n\t\t{ "v0" : 175, "v1" : 176, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 434 },\n\t\t{ "v0" : 177, "v1" : 178, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 434 },\n\t\t{ "v0" : 179, "v1" : 180, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 558 },\n\t\t{ "v0" : 181, "v1" : 182, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 558 },\n\t\t{ "v0" : 183, "v1" : 184, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 589 },\n\t\t{ "v0" : 185, "v1" : 186, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 589 },\n\t\t{ "v0" : 187, "v1" : 188, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 713 },\n\t\t{ "v0" : 189, "v1" : 190, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 744 },\n\t\t{ "v0" : 191, "v1" : 192, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 744 },\n\t\t{ "v0" : 193, "v1" : 194, "color" : "c7e6bd", "trait" : "yardline", "x" : -465 },\n\t\t{ "v0" : 196, "v1" : 197, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -744 },\n\t\t{ "v0" : 198, "v1" : 199, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -542.5 },\n\t\t{ "v0" : 200, "v1" : 201, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -387.5 },\n\t\t{ "v0" : 202, "v1" : 203, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -232.5 },\n\t\t{ "v0" : 204, "v1" : 205, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -77.5 },\n\t\t{ "v0" : 206, "v1" : 207, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 77.5 },\n\t\t{ "v0" : 208, "v1" : 209, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 232.5 },\n\t\t{ "v0" : 210, "v1" : 211, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 387.5 },\n\t\t{ "v0" : 212, "v1" : 213, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 387.5 },\n\t\t{ "v0" : 214, "v1" : 215, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 232.5 },\n\t\t{ "v0" : 216, "v1" : 217, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 77.5 },\n\t\t{ "v0" : 218, "v1" : 219, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 542.5 },\n\t\t{ "v0" : 220, "v1" : 221, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 697.5 },\n\t\t{ "v0" : 222, "v1" : 223, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -77.5 },\n\t\t{ "v0" : 224, "v1" : 225, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -232.5 },\n\t\t{ "v0" : 226, "v1" : 227, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -387.5 },\n\t\t{ "v0" : 228, "v1" : 229, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -542.5 },\n\t\t{ "v0" : 230, "v1" : 231, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : -697.5 },\n\t\t{ "v0" : 232, "v1" : 233, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 542.5 },\n\t\t{ "v0" : 234, "v1" : 235, "vis" : true, "color" : "c7e6bd", "trait" : "yardline", "x" : 697.5 }\n\n\t],\n\n\t"goals" : [\n\t\t{ "p0" : [-1065,0 ], "p1" : [-1005,0 ], "team" : "blue" },\n\t\t{ "p0" : [1006.9833374023,1.6000061035156 ], "p1" : [1063.9833374023,1.6000061035156 ], "team" : "red" }\n\n\t],\n\n\t"discs" : [\n\t\t{ "pos" : [0,280 ], "trait" : "losmarker" },\n\t\t{ "pos" : [0,-280 ], "trait" : "losmarker" },\n\t\t\n\t\t{ "pos" : [10000,280 ], "trait" : "yardtogetmarker" },\n\t\t{ "pos" : [10000,-280 ], "trait" : "yardtogetmarker" },\n\t\t\n\t\t{ "pos" : [930,-60 ], "trait" : "goalPost" },\n\t\t{ "pos" : [-930,-60 ], "trait" : "goalPost" },\n\t\t{ "pos" : [-930,60 ], "trait" : "goalPost" },\n\t\t{ "pos" : [930,60 ], "trait" : "goalPost" },\n\t\t\n\t\t{ "pos" : [930,280 ], "trait" : "goalmarker" },\n\t\t{ "pos" : [775,-280 ], "trait" : "goalmarker" },\n\t\t{ "pos" : [-930,280 ], "trait" : "goalmarker" },\n\t\t{ "pos" : [-930,-280 ], "trait" : "goalmarker" },\n\t\t{ "pos" : [775,280 ], "trait" : "goalmarker" },\n\t\t{ "pos" : [930,-280 ], "trait" : "goalmarker" },\n\t\t{ "pos" : [-775,280 ], "trait" : "goalmarker" },\n\t\t{ "pos" : [-775,-280 ], "trait" : "goalmarker" },\n\n\t\t{ "pos" : [10000,0 ], "trait" : "teweight1" },\n\t\t{ "pos" : [10000,13 ], "trait" : "teweight" },\n\t\t{ "pos" : [9987,0 ], "trait" : "teweight" },\n\t\t{ "pos" : [10000,-13 ], "trait" : "teweight" },\n\t\t{ "pos" : [10013,0 ], "trait" : "teweight" },\n\t\t{ "pos" : [9960,280 ], "trait" : "crowdboxmarker" },\n\t\t{ "pos" : [9960,-280 ], "trait" : "crowdboxmarker" },\n\t\t{ "pos" : [9950,280 ], "trait" : "crowdboxmarker" },\n\t\t{ "pos" : [9950,-280 ], "trait" : "crowdboxmarker" }\n\n\t],\n\n\t"joints" : [\n\t\t{ "d0" : 1, "d1" : 2, "trait" : "losline" },\n\t\t{ "d0" : 3, "d1" : 4, "trait" : "yardtogetline" },\n\n\t\t{ "d0" : 17, "d1" : 18, "trait" : "joint" },\n\t\t{ "d0" : 17, "d1" : 19, "trait" : "joint" },\n\t\t{ "d0" : 17, "d1" : 20, "trait" : "joint" },\n\t\t{ "d0" : 17, "d1" : 21, "trait" : "joint" },\n\t\t{ "d0" : 18, "d1" : 19, "trait" : "joint" },\n\t\t{ "d0" : 19, "d1" : 20, "trait" : "joint" },\n\t\t{ "d0" : 20, "d1" : 21, "trait" : "joint" },\n\t\t{ "d0" : 21, "d1" : 18, "trait" : "joint" }\n\n\t\t// { "d0" : 22, "d1" : 23, "trait" : "crowdboxline" },\n\t\t// { "d0" : 23, "d1" : 24, "trait" : "crowdboxline" },\n\t\t// { "d0" : 24, "d1" : 25, "trait" : "crowdboxline" },\n\t\t// { "d0" : 25, "d1" : 22, "trait" : "crowdboxline" }\n\n\t],\n\n\t"planes" : [\n\t\t{ "normal" : [0,1 ], "dist" : -350, "trait" : "ballArea" },\n\t\t{ "normal" : [0,-1 ], "dist" : -350, "bCoef" : 1, "trait" : "ballArea" },\n\t\t{ "normal" : [1,0 ], "dist" : -1065, "trait" : "ballArea" },\n\t\t{ "normal" : [-1,0 ], "dist" : -1065, "trait" : "ballArea" },\n\t\t\n\t\t{ "normal" : [0,1 ], "dist" : -375, "bCoef" : 0.9 },\n\t\t{ "normal" : [0,-1 ], "dist" : -375, "bCoef" : 0.9 },\n\t\t{ "normal" : [1,0 ], "dist" : -1090, "bCoef" : 0.9 },\n\t\t{ "normal" : [-1,0 ], "dist" : -1090, "bCoef" : 0.9 }\n\n\t],\n\n\t"traits" : {\n\t\t"ballArea" : { "vis" : false, "bCoef" : 1, "cMask" : ["ball" ] },\n\t\t"endline" : { "vis" : false, "bCoef" : 1, "cMask" : ["ball" ] },\n\t\t"goalPost" : { "radius" : 4, "invMass" : 0, "bCoef" : 0.5, "color" : "FFFF00" },\n\t\t"goalNet" : { "vis" : true, "bCoef" : 0.1, "cMask" : ["ball" ] },\n\t\t"kickOffBarrier" : { "vis" : false, "bCoef" : 0.1, "cGroup" : ["redKO","blueKO" ], "cMask" : ["red","blue","c0" ] },\n\t\t"goalline" : { "vis" : true, "color" : "FFA500", "cMask" : ["c0","wall" ] },\n\t\t"yardline" : { "vis" : true, "color" : "c7e6bd", "cMask" : [ ] },\n\t\t"centerline" : { "vis" : true, "color" : "E0E0E0", "cMask" : [ ] },\n\t\t"goalmarker" : { "vis" : true, "color" : "FFA500", "cMask" : [ ], "radius" : 3 },\n\t\t"losmarker" : { "vis" : true, "color" : "273d6b", "cMask" : [ ], "radius" : 3 },\n\t\t"yardtogetmarker" : { "vis" : true, "color" : "8FE271", "cMask" : [ ], "radius" : 3 },\n\t\t"teweight" : { "vis" : false, "radius" : 0, "cMask" : ["red", "blue" ], "invMass" : 1.2 },\n\t\t"teweight1" : { "vis" : false, "radius" : 0, "cMask" : [], "invMass" : 1.2, "color" : "F2F2F2" },\n\t\t"losline" : { "vis" : true, "color" : "273d6b" },\n\t\t"yardtogetline" : { "color" : "8FE271" },\n\t\t"crowdboxline" : { "color" : "ff8164", "invMass" : 0.1 },\n\t\t"crowdboxmarker" : { "color" : "ff6242", "radius" : 3, "vis" : true, "cMask" : [ ], "invMass" : 0.1 },\n\t\t"goal" : { "vis" : true, "color" : "FFA500" }\n\n\t},\n\n\t"ballPhysics" : {\n\t\t"cMask" : [ "wall", "red", "blue"\n\t\t],\n\t\t"cGroup" : [ "ball"\n\t\t],\n\t\t"color" : "602323",\n\t\t"radius" : 6.3\n\n\t},\n\n\t"playerPhysics" : {\n\t\t"kickStrength" : 7.6,\n "kickback" : 0,\n\t\t"bCoef" : 0.75,\n\t\t"invMass" : 0.8\n\n\t},\n\n\t"redSpawnPoints" : [\n\t\t\n\n\t],\n\n\t"blueSpawnPoints" : [\n\t\t\n\n\t]\n}'},3279:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEAMS=void 0,t.TEAMS={SPECTATORS:0,RED:1,BLUE:2}},2665:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.largestInArray=t.getRandomChars=t.averageOfArray=t.extrapolateLine=t.toOrdinalSuffix=t.isObject=t.sumObjectValues=t.containsNWord=t.randFromArrayWeighted=t.randFromArray=t.escapeRegExp=t.formatTime=t.formatDate=t.formatDateAndTime=t.isInRectangleArea=t.inRange=t.toPercent=t.toPercentString=t.formatPercent=t.sleep=t.hexToAscii=t.secToMin=t.plural=t.round=t.truncateName=t.addPlus=t.leftpad=t.getRandomIntInRange=t.limitNumberWithinRange=t.getRandomInt=t.truncateString=t.partition=void 0,t.partition=(e,t)=>e.reduce(((e,a,n,i)=>(e[t(a,n,i)?0:1].push(a),e)),[[],[]]),t.truncateString=(e="",t)=>e.length<=t?e:e.slice(0,t-3)+"...",t.getRandomInt=e=>Math.floor(Math.random()*e),t.limitNumberWithinRange=(e,t,a)=>{if(t>a)throw Error(`Min ${t} is greater than Max ${a}`);return Math.min(Math.max(e,t),a)},t.getRandomIntInRange=(e,t)=>{let a=t-e,n=Math.random();return n=Math.floor(n*a),n+=e,n},t.leftpad=e=>e<10?`0${e}`:`${e}`,t.addPlus=e=>e>0?`+${e}`:`${e}`,t.truncateName=e=>(0,t.truncateString)(e,15),t.round=(e,t=0)=>{const a=Math.pow(10,t);return Math.round(e*a)/a},t.plural=(e,t,a)=>`${e} ${1===e?t:a}`,t.secToMin=e=>(0,t.round)(e/60,2),t.hexToAscii=e=>{let t="";for(let a=0;anew Promise((t=>setTimeout(t,e))),t.formatPercent=(e,a=0)=>`${(0,t.round)(100*e,a)}%`,t.toPercentString=(e,a)=>(0,t.toPercent)(e,a)+"%",t.toPercent=(e,t)=>{const a=Math.round(e/t*100);return Number.isNaN(a)?0:a},t.inRange=(e,t,a)=>{if(t>=a)throw new Error("Invalid range");return e>=t&&e<=a},t.isInRectangleArea=({x1:e,y1:t,x2:a,y2:n},{x:i,y:s})=>i>e&&it&&s`${(0,t.formatDate)(e)} ${(0,t.formatTime)(e)}`,t.formatDate=(e=Date.now())=>new Date(e).toLocaleString("en-US",{year:"numeric",month:"long",day:"numeric",timeZone:"America/Chicago"}),t.formatTime=(e=Date.now())=>{const t=new Date(e);let a=t.getHours(),n=t.getMinutes();const i=a>=12?"PM":"AM";return a%=12,a=a||12,n=n<10?"0"+n:n,a+":"+n+" "+i},t.escapeRegExp=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t.randFromArray=e=>e[~~(e.length*Math.random())],t.randFromArrayWeighted=e=>{if(e.some((e=>e.weight>1)))throw Error("Weight cannot be larger than 1");let t=(e=>[].concat(...e.map((e=>new Array(Math.ceil(100*e.weight)).fill(e)))))(e);return t[Math.floor(Math.random()*t.length)]},t.containsNWord=e=>{e=e.toLowerCase();const t=new RegExp(/(n|i){1,32}((g{2,32}|q){1,32}|[gq]{2,32})[e3r]{1,32}/,"i").test(e);return["nig","nigger","n1gger","n1gg3r","niger","n1g3r","nigga","n1gg@","n1g@","niga"].some((t=>e.includes(t)))||t},t.sumObjectValues=e=>Object.values(e).reduce(((e,t)=>e+t)),t.isObject=e=>null!=e&&"Object"===e.constructor.name,t.toOrdinalSuffix=e=>e+{one:"st",two:"nd",few:"rd",other:"th"}[new Intl.PluralRules("en",{type:"ordinal"}).select(e)],t.extrapolateLine=(e,t,a)=>{const n=t.x-e.x,i=t.y-e.y;return 0===n?{x:e.x,y:1/0}:{x:a,y:i/n*(a-e.x)+e.y}},t.averageOfArray=e=>e.reduce(((e,t)=>e+t))/e.length,t.getRandomChars=e=>{const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";return[...Array(e)].map((()=>t.charAt(Math.floor(Math.random()*t.length)))).join("")},t.largestInArray=(e,t)=>e.reduce(((e,a)=>e[t]>a[t]?e:a))}},t={};!function a(n){var i=t[n];if(void 0!==i)return i.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,a),s.exports}(5198)})(); \ No newline at end of file diff --git a/src/room/plays/Fieldgoal.ts b/src/room/plays/Fieldgoal.ts index 61c9238..88e6a6f 100644 --- a/src/room/plays/Fieldgoal.ts +++ b/src/room/plays/Fieldgoal.ts @@ -82,7 +82,7 @@ export default class FieldGoal extends FieldGoalEvents { } handleSuccessfulFg() { - Chat.send(`${ICONS.GreenCheck} Field Goal is good!`); + Chat.send(`${ICONS.GreenCheck} Field Goal is good!`, { sound: 2 }); Room.game.stats.updatePlayerStat(this._kicker.id, { fgAttempts: 1, diff --git a/src/room/plays/play_events/FieldGoal.events.ts b/src/room/plays/play_events/FieldGoal.events.ts index 6ea9adf..03fe5d8 100644 --- a/src/room/plays/play_events/FieldGoal.events.ts +++ b/src/room/plays/play_events/FieldGoal.events.ts @@ -27,8 +27,8 @@ export default abstract class FieldGoalEvents extends BasePlay { protected abstract _handleBallContactKicker( ballContactObj: BallContact ): void; - abstract handleUnsuccessfulFg(msg: string): void; - abstract handleSuccessfulFg(msg: string): void; + abstract handleUnsuccessfulFg(): void; + abstract handleSuccessfulFg(): void; onBallContact(ballContactObj: BallContact) { // We have to do this check AGAIN because playerOnkick is not an event listener, but a native listener @@ -39,7 +39,7 @@ export default abstract class FieldGoalEvents extends BasePlay { } onBallOutOfBounds(ballPosition: Position) { - this.handleUnsuccessfulFg("Missed"); + this.handleUnsuccessfulFg(); } onBallCarrierOutOfBounds(ballCarrierPosition: Position) {