-- Decompiled with the Synapse X Luau decompiler.


local u1 = nil;
coroutine.wrap(function()
	u1 = require(game.ReplicatedStorage:WaitForChild("Resources"));
end)();
local v1 = {};
local l__Message__2 = u1.GUI.Message;
local u3 = {};
local u4 = false;
function v1.New(p1, ...)
	local v2 = { ... };
	if u1.Variables.MessageOpen == true or u1.Variables.OpeningEgg == true then
		while true do
			u1.RenderStepped();
			if u1.Variables.MessageOpen == false and u1.Variables.OpeningEgg == false then
				break;
			end;		
		end;
	end;
	local v3 = false;
	if v2[1] == nil then
		v3 = v2[2] == nil;
	end;
	local v4 = false;
	if type(v2[1]) == "boolean" then
		v4 = v2[2] == nil;
	end;
	l__Message__2.No.Visible = false;
	l__Message__2.Ok.Visible = false;
	l__Message__2.Yes.Visible = false;
	l__Message__2.Cancel.Visible = false;
	l__Message__2.Option1.Visible = false;
	l__Message__2.Option2.Visible = false;
	l__Message__2.Desc.Text = p1;
	if not v3 then
		if v4 then
			l__Message__2.No.Visible = true;
			l__Message__2.Yes.Visible = true;
		elseif v2[1] and v2[2] then
			l__Message__2.Option1.Title.Text = v2[1];
			l__Message__2.Option2.Title.Text = v2[2];
			l__Message__2.Cancel.Visible = true;
			l__Message__2.Option1.Visible = true;
			l__Message__2.Option2.Visible = true;
		end;
	else
		l__Message__2.Ok.Visible = true;
	end;
	local v5 = Instance.new("BindableEvent");
	if l__Message__2.No.Visible then
		local function u5()
			Close();
			v5:Fire(false);
		end;
		u3[#u3 + 1] = l__Message__2.No.Activated:Connect(function()
			if u4 == false then
				u4 = true;
				u5();
				u4 = false;
			end;
		end);
	end;
	if l__Message__2.Yes.Visible then
		local function u6()
			Close();
			v5:Fire(true);
		end;
		u3[#u3 + 1] = l__Message__2.Yes.Activated:Connect(function()
			if u4 == false then
				u4 = true;
				u6();
				u4 = false;
			end;
		end);
	end;
	if l__Message__2.Ok.Visible then
		local function u7()
			Close();
			v5:Fire(true);
		end;
		u3[#u3 + 1] = l__Message__2.Ok.Activated:Connect(function()
			if u4 == false then
				u4 = true;
				u7();
				u4 = false;
			end;
		end);
	end;
	if l__Message__2.Option1.Visible then
		local function u8()
			Close();
			v5:Fire(1);
		end;
		u3[#u3 + 1] = l__Message__2.Option1.Activated:Connect(function()
			if u4 == false then
				u4 = true;
				u8();
				u4 = false;
			end;
		end);
	end;
	if l__Message__2.Option2.Visible then
		local function u9()
			Close();
			v5:Fire(2);
		end;
		u3[#u3 + 1] = l__Message__2.Option2.Activated:Connect(function()
			if u4 == false then
				u4 = true;
				u9();
				u4 = false;
			end;
		end);
	end;
	if l__Message__2.Cancel.Visible then
		local function u10()
			Close();
			v5:Fire(false);
		end;
		u3[#u3 + 1] = l__Message__2.Cancel.Activated:Connect(function()
			if u4 == false then
				u4 = true;
				u10();
				u4 = false;
			end;
		end);
	end;
	if u1.Variables.Console then
		if l__Message__2.Ok.Visible then
			u1.GuiService.SelectedObject = l__Message__2.Ok;
		elseif l__Message__2.Yes.Visible then
			u1.GuiService.SelectedObject = l__Message__2.Yes;
		elseif l__Message__2.Option1.Visible then
			u1.GuiService.SelectedObject = l__Message__2.Option1;
		end;
		local u11 = false;
		u3[#u3 + 1] = u1.UserInputService.InputEnded:Connect(function(p2, p3)
			if not u11 then
				u11 = true;
				if p2.KeyCode == Enum.KeyCode.ButtonB then
					Close();
				end;
				u11 = false;
			end;
		end);
	end;
	Open();
	local v6 = v5.Event:Wait();
	v5:Destroy();
	return v6;
end;
function v1.IsOpen()
	return l__Message__2.Gui.Enabled;
end;
function Close()

		for v7, v8 in ipairs(u3) do
		if v7 then

		else
			break;
		end;
		v8:Disconnect();	
	end;
	u3 = {};
	u1.Window.GuaranteeCloseCurrentWindow("Message")

	u1.Variables.MessageOpen = false;
end;
function Open()
	u1.Window.GuaranteeOpenWindow("Message")
	u1.Variables.MessageOpen = true;
end;

	for v13, v14 in pairs(l__Message__2.Frame:GetChildren()) do
	if not v13 then
		break;
	end;
	v12 = v13;
	if v14.ClassName == "ImageButton" then
		u1.GFX.Button(v14);
	end;
end;
return v1;
