-- Decompiled with the Synapse X Luau decompiler.


local v1 = require(game.ReplicatedStorage:WaitForChild("Resources"));
while not v1.Loaded do
	game:GetService("RunService").Heartbeat:Wait();
end;
local u1 = {
	Eggs = {}, 
	Areas = {}
};
function SendNotification(p1, p2)
	table.insert(u1[p2], p1);
	local v2 = nil;
	if p2 == "Eggs" then
		v2 = "You can afford to buy the " .. v1.Directory.Eggs[p1].display_name .. "!";
	elseif p2 == "Areas" then
		v2 = "You can afford to unlock the " .. v1.Directory.Worlds[p1].display_name .. " area!";
	end;
	v1.Signal.Fire("Notification", v2, {
		color = Color3.fromRGB(0, 187, 255), 
		time = 4
	});
	v1.Network.Fire("Sent Progress Notification", p1, p2);
end;
function AttemptNotification(p3, p4)
	local v3 = v1.StatService.Get();
	if not v3 then
		return;
	end;
	if not v1.Functions.SearchArray(u1[p4], p3) then
		if not v1.Functions.SearchArray(v3.ProgressNotifications[p4], p3) then
			SendNotification(p3, p4);
		end;
	end;
end;
function CheckForNotifications()
	local v4 = v1.StatService.Get();
	if not v4 then
		return;
	end;

	for v5, v6 in ipairs((v1.WorldCmds.GetAllEggs())) do
		if v5 then

		else
			break;
		end;
		local v8 = v6:GetAttribute("ID");
		local v9 = v1.Directory.Eggs[v8];
		if v6:GetAttribute("Unlocked") then
			if v9.cost <= v4[v9.currency] then
				AttemptNotification(v8, "Eggs");
			end;
		end;	
	end;
	for v13, v14 in pairs(v1.Directory.Worlds) do
		if v13 then

		else
			break;
		end;
		local v15 = v1.Directory.Worlds[v13];
		if v13 ~= "Spawn" then
			if v15.cost <= v4[v15.currency] then
				AttemptNotification(v13, "Areas");
			end;
		end;	
	end;
end;
v1.Signal.Fired("Stat Changed"):Connect(function(p5)
	if not (not string.find(p5, "Coins")) or p5 == "Gems" or p5 == "AreasUnlocked" then
		CheckForNotifications();
	end;
end);

