local y=false do local J,K=pcall(function()return(UserSettings()):IsUserFeatureEnabled("\085\115\101\114\070\105\120\067\104\097\116\087\105\110\100\111\119\072\111\118\101\114\079\118\101\114")end)if J then y=K end end local J=false do local y,K=pcall(function()return(UserSettings()):IsUserFeatureEnabled("\085\115\101\114\070\105\120\077\111\117\115\101\067\097\112\116\117\114\101")end)if y then J=K end end local K=false do local y,J=pcall(function()return(UserSettings()):IsUserFeatureEnabled("\085\115\101\114\072\097\110\100\108\101\067\104\097\116\072\111\116\075\101\121\087\105\116\104\067\111\110\116\101\120\116\065\099\116\105\111\110\083\101\114\118\105\099\101")end)if y then K=J end end local l=60 local d=game:GetService("\082\117\110\083\101\114\118\105\099\101")local C=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local E=game:GetService("\067\104\097\116")local c=game:GetService("\083\116\097\114\116\101\114\071\117\105")local D=game:GetService("\067\111\110\116\101\120\116\065\099\116\105\111\110\083\101\114\118\105\099\101")local W=C:WaitForChild("\068\101\102\097\117\108\116\067\104\097\116\083\121\115\116\101\109\067\104\097\116\069\118\101\110\116\115")local T=C:WaitForChild("\068\101\102\097\117\108\116\067\104\097\116\083\121\115\116\101\109\067\104\097\116\069\118\101\110\116\115")local Q=E:WaitForChild("\067\108\105\101\110\116\067\104\097\116\077\111\100\117\108\101\115")local R=require(Q:WaitForChild("\067\104\097\116\067\111\110\115\116\097\110\116\115"))local Z=require(Q:WaitForChild("\067\104\097\116\083\101\116\116\105\110\103\115"))local S=Q:WaitForChild("\077\101\115\115\097\103\101\067\114\101\097\116\111\114\077\111\100\117\108\101\115")local Y=require(S:WaitForChild("\085\116\105\108"))local i=nil pcall(function()i=require((game:GetService("\067\104\097\116")).ClientChatModules.ChatLocalization)end)if i==nil then i={}function i.Get(K,y,J)return J end end local X=10 local a={OnNewMessage="\082\101\109\111\116\101\069\118\101\110\116",OnMessageDoneFiltering="\082\101\109\111\116\101\069\118\101\110\116",OnNewSystemMessage="\082\101\109\111\116\101\069\118\101\110\116",OnChannelJoined="\082\101\109\111\116\101\069\118\101\110\116";OnChannelLeft="\082\101\109\111\116\101\069\118\101\110\116";OnMuted="\082\101\109\111\116\101\069\118\101\110\116",OnUnmuted="\082\101\109\111\116\101\069\118\101\110\116",OnMainChannelSet="\082\101\109\111\116\101\069\118\101\110\116",SayMessageRequest="\082\101\109\111\116\101\069\118\101\110\116";GetInitDataRequest="\082\101\109\111\116\101\070\117\110\099\116\105\111\110"}
--// This section of code waits until all of the necessary RemoteEvents are found in EventFolder.
--// I have to do some weird stuff since people could potentially already have pre-existing
--// things in a folder with the same name, and they may have different class types.
--// I do the useEvents thing and set EventFolder to useEvents so I can have a pseudo folder that
--// the rest of the code can interface with and have the guarantee that the RemoteEvents they want
--// exist with their desired names.

local FFlagFixChatWindowHoverOver = false
do
	local ok, value = pcall(function()
		return UserSettings():IsUserFeatureEnabled("UserFixChatWindowHoverOver")
	end)
	if ok then
		FFlagFixChatWindowHoverOver = value
	end
end

local FFlagFixMouseCapture = false
do
	local ok, value = pcall(function()
		return UserSettings():IsUserFeatureEnabled("UserFixMouseCapture")
	end)
	if ok then
		FFlagFixMouseCapture = value
	end
end

local FFlagUserHandleChatHotKeyWithContextActionService = false
do
	local ok, value = pcall(function()
		return UserSettings():IsUserFeatureEnabled("UserHandleChatHotKeyWithContextActionService")
	end)
	if ok then
		FFlagUserHandleChatHotKeyWithContextActionService = value
	end
end

local FILTER_MESSAGE_TIMEOUT = 60

local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Chat = game:GetService("Chat")
local StarterGui = game:GetService("StarterGui")
local ContextActionService = game:GetService("ContextActionService")

local DefaultChatSystemChatEvents = ReplicatedStorage:WaitForChild("DefaultChatSystemChatEvents")
local EventFolder = ReplicatedStorage:WaitForChild("DefaultChatSystemChatEvents")
local clientChatModules = Chat:WaitForChild("ClientChatModules")
local ChatConstants = require(clientChatModules:WaitForChild("ChatConstants"))
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))
local messageCreatorModules = clientChatModules:WaitForChild("MessageCreatorModules")
local MessageCreatorUtil = require(messageCreatorModules:WaitForChild("Util"))

local ChatLocalization = nil
pcall(function()
	ChatLocalization = require(game:GetService("Chat").ClientChatModules.ChatLocalization)
end)
if ChatLocalization == nil then
	ChatLocalization = {}
	function ChatLocalization:Get(key, default)
		return default
	end
end

local numChildrenRemaining = 10 -- #waitChildren returns 0 because it's a dictionary
local waitChildren = {
	OnNewMessage = "RemoteEvent",
	OnMessageDoneFiltering = "RemoteEvent",
	OnNewSystemMessage = "RemoteEvent",
	OnChannelJoined = "RemoteEvent",
	OnChannelLeft = "RemoteEvent",
	OnMuted = "RemoteEvent",
	OnUnmuted = "RemoteEvent",
	OnMainChannelSet = "RemoteEvent",

	SayMessageRequest = "RemoteEvent",
	GetInitDataRequest = "RemoteFunction",
}
