local S=import("\046\047\116\121\112\101\075\101\121")local i=import("\046\047\102\117\110\099\116\105\111\110\115\047\116\121\112\101\111\102")local function B(B)for S,B in pairs(B)do if i(B)~="\069\110\117\109"then error(("\073\110\118\097\108\105\100 \101\110\117\109 \105\110 \101\110\117\109 \103\114\111\117\112 \037\115"):format(tostring(S)),2)end end local Q=newproxy(true);(getmetatable(Q))[S]="\069\110\117\109\115";(getmetatable(Q)).__tostring=function()return"\069\110\117\109\115"end;(getmetatable(Q)).__index=function(S,i)local Q=B[i]if Q==nil then error(("\037\115 \105\115 \110\111\116 \097 \118\097\108\105\100 \069\110\117\109"):format(tostring(i)),2)end return Q end return Q end return B
local typeKey = import("./typeKey")
local typeof = import("./functions/typeof")

local function createEnumGroup(enums)
	for enumName, enum in pairs(enums) do
		if typeof(enum) ~= "Enum" then
			error(("Invalid enum in enum group %s"):format(tostring(enumName)), 2)
		end
	end

	local enumGroup = newproxy(true)

	getmetatable(enumGroup)[typeKey] = "Enums"

	getmetatable(enumGroup).__tostring = function()
		return "Enums"
	end

	getmetatable(enumGroup).__index = function(self, key)
		local enum = enums[key]

		if enum == nil then
			-- Roblox mistakenly says that we tried to access an EnumItem; this
			-- message is corrected.
			error(("%s is not a valid Enum"):format(tostring(key)), 2)
		end

		return enum
	end

	return enumGroup
end

return createEnumGroup