local C=game:GetService("\084\101\097\109\115")local O=require(script.Parent.Parent.Shared.Util)local V={Transform=function(V)local L=O.MakeFuzzyFinder(C:GetTeams())return L(V)end;Validate=function(C)return#C>0,"\078\111 \116\101\097\109 \119\105\116\104 \116\104\097\116 \110\097\109\101 \099\111\117\108\100 \098\101 \102\111\117\110\100\046"end;Autocomplete=function(C)return O.GetNames(C)end;Parse=function(C)return C[1]end}local L={Listable=true;Transform=V.Transform,Validate=V.Validate,Autocomplete=V.Autocomplete,Parse=function(C)return C[1]:GetPlayers()end}local j={Transform=V.Transform,Validate=V.Validate,Autocomplete=V.Autocomplete;Parse=function(C)return C[1].TeamColor end}return function(C)C:RegisterType("\116\101\097\109",V)C:RegisterType("\116\101\097\109\115",O.MakeListableType(V))C:RegisterType("\116\101\097\109\080\108\097\121\101\114\115",L)C:RegisterType("\116\101\097\109\067\111\108\111\114",j)C:RegisterType("\116\101\097\109\067\111\108\111\114\115",O.MakeListableType(j))end
local Teams = game:GetService("Teams")
local Util = require(script.Parent.Parent.Shared.Util)

local teamType = {
	Transform = function (text)
		local findTeam = Util.MakeFuzzyFinder(Teams:GetTeams())

		return findTeam(text)
	end;

	Validate = function (teams)
		return #teams > 0, "No team with that name could be found."
	end;

	Autocomplete = function (teams)
		return Util.GetNames(teams)
	end;

	Parse = function (teams)
		return teams[1];
	end;
}

local teamPlayersType = {
	Listable = true;
	Transform = teamType.Transform;
	Validate = teamType.Validate;
	Autocomplete = teamType.Autocomplete;

	Parse = function (teams)
		return teams[1]:GetPlayers()
	end;
}

local teamColorType = {
	Transform = teamType.Transform;
	Validate = teamType.Validate;
	Autocomplete = teamType.Autocomplete;

	Parse = function (teams)
		return teams[1].TeamColor
	end;
}

return function (cmdr)
	cmdr:RegisterType("team", teamType)
	cmdr:RegisterType("teams", Util.MakeListableType(teamType))

	cmdr:RegisterType("teamPlayers", teamPlayersType)

	cmdr:RegisterType("teamColor", teamColorType)
	cmdr:RegisterType("teamColors", Util.MakeListableType(teamColorType))
end