local Z=import("\046\047\116\121\112\101\075\101\121")local D=import("\046\047\102\117\110\099\116\105\111\110\115\047\116\121\112\101\111\102")local function Q(Q)for Z,Q in pairs(Q)do if D(Q)~="\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(Z)),2)end end local j=newproxy(true);(getmetatable(j))[Z]="\069\110\117\109\115";(getmetatable(j)).__tostring=function()return"\069\110\117\109\115"end;(getmetatable(j)).__index=function(Z,D)local j=Q[D]if j==nil then error(("\037\115 \105\115 \110\111\116 \097 \118\097\108\105\100 \069\110\117\109"):format(tostring(D)),2)end return j end return j end return Q
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