-- Decompiled with the Synapse X Luau decompiler.


local u1 = nil;
coroutine.wrap(function()
	u1 = require(game.ReplicatedStorage:WaitForChild("Resources"));
end)();
local v1 = {};
local u2 = {};
function v1.Get(p1)
	local v2 = u2[p1];
	if v2 then
		local v3 = v2[1];
		local v4 = u1.StatService.Get(v3);
		if v4 then
			local v5 = v4.Pets[v2[2]];
			if v5 and v5.uid == p1 then
				return v5, v3;
			end;
		end;
	end;
	for v6, v7 in pairs(game.Players:GetPlayers()) do
		local v8 = u1.StatService.Get(v7);
		if v8 then

				for v9, v10 in ipairs(v8.Pets) do
				if not v9 then
					break;
				end;
				if v10.uid == p1 then
					u2[p1] = { v7, v9 };
					return v10, v7, v8;
				end;			
			end;
		end;
	end;
end;
function v1.AllEquipped(p2)
	local v12 = {};

		for v13, v14 in ipairs(u1.StatService.Get(p2).Pets) do
		if not v13 then
			break;
		end;
		if v14.e then
			table.insert(v12, v14);
		end;	
	end;
	return v12;
end;
function v1.GetNowStrength(p3)
	local v16 = u1.StatService.Get(p3);
	if not v16 then
		return;
	end;
	local v17 = 0;

		for v18, v19 in ipairs(v16.Pets) do
		if not v18 then
			break;
		end;
		if v19.e then
			v17 = v17 + v19.em;
		end;	
	end;
	return v17;
end;
function v1.GetBestStrength(p4)
	local v21 = u1.StatService.Get(p4);
	if not v21 then
		return;
	end;
	table.sort(v21.Pets, function(p5, p6)
		if math.abs(p5.em - p6.em) < 1 then
			return p5.idt < p6.idt;
		end;
		return p6.em < p5.em;
	end);
	local v22 = 0;
	local v23 = 0;

		for v24, v25 in ipairs(v21.Pets) do
		if not v24 then
			break;
		end;
		if v22 < v21.MaxEquipped then
			v22 = v22 + 1;
			v23 = v23 + v25.em;
		end;	
	end;
	return v23;
end;
function v1.AllBestEquipped(p7)
	if not u1.StatService.Get(p7) then
		return;
	end;
	return v1.GetNowStrength(p7) == v1.GetBestStrength(p7);
end;
task.defer(function()
	while task.wait(300) do
		u2 = {};	
	end;
end);
return v1;
