function FlagSettings.ThrottleUserId(b,P)assert(type(b)=="\110\117\109\098\101\114")assert(type(P)=="\110\117\109\098\101\114")local v=P%100+1 return v<=b end function FlagSettings.IsShareGamePageEnabledByPlatform(b)if not FFlagSettingsHubBarsRefactor then return false end local P if b==Enum.Platform.Windows then P=FFlagSettingsHubInviteToGameWindows elseif b==Enum.Platform.OSX then P=FFlagSettingsHubInviteToGameOSX elseif b==Enum.Platform.IOS then P=FFlagSettingsHubInviteToGameIOS elseif b==Enum.Platform.Android then P=FFlagSettingsHubInviteToGameAndroid elseif b==Enum.Platform.UWP then P=FFlagSettingsHubInviteToGameUWP end local v=tonumber(P)if not v then return false end local r=Players.LocalPlayer.UserId return FlagSettings.ThrottleUserId(v,r)end return FlagSettings

function FlagSettings.ThrottleUserId(throttle, userId)
	assert(type(throttle) == "number")
	assert(type(userId) == "number")

	-- Determine userRollout using last two digits of user ID:
	-- (+1 to change range from 0-99 to 1-100 as 0 is off, 100 is full on):
	local userRollout = (userId % 100) + 1
	return userRollout <= throttle
end

function FlagSettings.IsShareGamePageEnabledByPlatform(platform)
	if not FFlagSettingsHubBarsRefactor then
		return false
	end

	local throttle
	if platform == Enum.Platform.Windows then
		throttle = FFlagSettingsHubInviteToGameWindows
	elseif platform == Enum.Platform.OSX then
		throttle = FFlagSettingsHubInviteToGameOSX
	elseif platform == Enum.Platform.IOS then
		throttle = FFlagSettingsHubInviteToGameIOS
	elseif platform == Enum.Platform.Android then
		throttle = FFlagSettingsHubInviteToGameAndroid
	elseif platform == Enum.Platform.UWP then
		throttle = FFlagSettingsHubInviteToGameUWP
	end

	local throttleNumber = tonumber(throttle)
	if not throttleNumber then
		return false
	end

	local userId = Players.LocalPlayer.UserId
	return FlagSettings.ThrottleUserId(throttleNumber, userId)
end

return FlagSettings
