local Y,Q=pcall(function()return(UserSettings()):IsUserFeatureEnabled("\085\115\101\114\082\101\109\111\118\101\077\101\115\115\097\103\101\079\110\084\101\120\116\070\105\108\116\101\114\070\097\105\108\117\114\101\115")end)local J={ScrollBarThickness=4}local p=script.Parent local H={}H.__index=H local V=require(((game:GetService("\067\104\097\116")):WaitForChild("\067\108\105\101\110\116\067\104\097\116\077\111\100\117\108\101\115")):WaitForChild("\067\104\097\116\083\101\116\116\105\110\103\115"))function H.Destroy(Y)Y.GuiObject:Destroy()Y.Destroyed=true end function H.SetActive(Y,Q)Y.GuiObject.Visible=Q end local n=Y or Q function H.UpdateMessageFiltered(Y,Q)local J=nil local p=1 local H=Y.MessageObjectLog while p<=#H do local Y=H[p]if Y.ID==Q.ID then J=Y break end p=p+1 end if J then if not n then J.UpdateTextFunction(Q)Y:PositionMessageLabelInWindow(J,p)return end else return end if Q.Message==""then Y:RemoveMessageAtIndex(p)return end J.UpdateTextFunction(Q)Y:PositionMessageLabelInWindow(J,p)end local w=(require(p:WaitForChild("\077\101\115\115\097\103\101\076\097\098\101\108\067\114\101\097\116\111\114"))).new()function H.AddMessage(Y,Q)Y:WaitUntilParentedCorrectly()local J=w:CreateMessageLabel(Q,Y.CurrentChannelName)if J==nil then return end table.insert(Y.MessageObjectLog,J)Y:PositionMessageLabelInWindow(J,#Y.MessageObjectLog)end function H.RemoveMessageAtIndex(Y,Q)Y:WaitUntilParentedCorrectly()local J=Y.MessageObjectLog[Q]if J then J:Destroy()table.remove(Y.MessageObjectLog,Q)end end function H.AddMessageAtIndex(Y,Q,J)local p=w:CreateMessageLabel(Q,Y.CurrentChannelName)if p==nil then return end table.insert(Y.MessageObjectLog,J,p)Y:PositionMessageLabelInWindow(p,J)end function H.RemoveLastMessage(Y)Y:WaitUntilParentedCorrectly()Y.MessageObjectLog[1]:Destroy()table.remove(Y.MessageObjectLog,1)end function H.IsScrolledDown(Y)local Q=Y.Scroller.CanvasSize.Y.Offset local J=Y.Scroller.AbsoluteWindowSize.Y local p=true if not(Q<J)then p=Q-Y.Scroller.CanvasPosition.Y<=J+5 end return p end function H.UpdateMessageTextHeight(Y,Q)local J=Q.BaseFrame for p=1,10,1 do if Q.BaseMessage.TextFits then break end J.Size=UDim2.new(1,0,0,Q.GetHeightFunction(Y.Scroller.AbsoluteSize.X-p))end end function H.PositionMessageLabelInWindow(Y,Q,J)Y:WaitUntilParentedCorrectly()local p=Q.BaseFrame local H=1 if Y.MessageObjectLog[J-1]then if J==#Y.MessageObjectLog then H=Y.MessageObjectLog[J-1].BaseFrame.LayoutOrder+1 else H=Y.MessageObjectLog[J-1].BaseFrame.LayoutOrder end end p.LayoutOrder=H p.Size=UDim2.new(1,0,0,Q.GetHeightFunction(Y.Scroller.AbsoluteSize.X))p.Parent=Y.Scroller if Q.BaseMessage then Y:UpdateMessageTextHeight(Q)end if Y:IsScrolledDown()then Y.Scroller.CanvasPosition=Vector2.new(0,math.max(0,Y.Scroller.CanvasSize.Y.Offset-Y.Scroller.AbsoluteSize.Y))end end function H.ReorderAllMessages(Y)Y:WaitUntilParentedCorrectly()if Y.GuiObject.AbsoluteSize.Y<1 then return end for Q,J in pairs(Y.MessageObjectLog)do Y:UpdateMessageTextHeight(J)end if not Y:IsScrolledDown()then Y.Scroller.CanvasPosition=Y.Scroller.CanvasPosition return end Y.Scroller.CanvasPosition=Vector2.new(0,math.max(0,Y.Scroller.CanvasSize.Y.Offset-Y.Scroller.AbsoluteSize.Y))end function H.Clear(Y)for Y,Q in pairs(Y.MessageObjectLog)do Q:Destroy()end Y.MessageObjectLog={}end function H.SetCurrentChannelName(Y,Q)Y.CurrentChannelName=Q end function H.FadeOutBackground(Y,Q) end function H.FadeInBackground(Y,Q) end local W=require(p:WaitForChild("\067\117\114\118\101\085\116\105\108"))function H.FadeOutText(Y,Q)for J=1,#Y.MessageObjectLog,1 do if Y.MessageObjectLog[J].FadeOutFunction then Y.MessageObjectLog[J].FadeOutFunction(Q,W)end end end function H.FadeInText(Y,Q)for J=1,#Y.MessageObjectLog,1 do if Y.MessageObjectLog[J].FadeInFunction then Y.MessageObjectLog[J].FadeInFunction(Q,W)end end end function H.Update(Y,Q)for J=1,#Y.MessageObjectLog,1 do if Y.MessageObjectLog[J].UpdateAnimFunction then Y.MessageObjectLog[J].UpdateAnimFunction(Q,W)end end end function H.WaitUntilParentedCorrectly(Y)while not Y.GuiObject:IsDescendantOf((game:GetService("\080\108\097\121\101\114\115")).LocalPlayer)do Y.GuiObject.AncestryChanged:wait()end end local function F()local Y=Instance.new("\070\114\097\109\101")Y.Selectable=false Y.Size=UDim2.new(1,0,1,0)Y.BackgroundTransparency=1 local Q=Instance.new("\083\099\114\111\108\108\105\110\103\070\114\097\109\101")Q.Selectable=V.GamepadNavigationEnabled Q.Name="\083\099\114\111\108\108\101\114"Q.BackgroundTransparency=1 Q.BorderSizePixel=0 Q.Position=UDim2.new(0,0,0,3)Q.Size=UDim2.new(1,-4,1,-6)Q.CanvasSize=UDim2.new(0,0,0,0)Q.ScrollBarThickness=J.ScrollBarThickness Q.Active=true Q.Parent=Y local p=Instance.new("\085\073\076\105\115\116\076\097\121\111\117\116")p.SortOrder=Enum.SortOrder.LayoutOrder p.Parent=Q return Y,Q,p end function J.new()local Y=setmetatable({},H)Y.Destroyed=false local Q,J,p=F()Y.GuiObject=Q Y.Scroller=J Y.Layout=p Y.MessageObjectLog={}Y.Name="\077\101\115\115\097\103\101\076\111\103\068\105\115\112\108\097\121"Y.GuiObject.Name="\070\114\097\109\101\095"..Y.Name Y.CurrentChannelName="";(Y.GuiObject:GetPropertyChangedSignal("\065\098\115\111\108\117\116\101\083\105\122\101")):Connect(function()spawn(function()Y:ReorderAllMessages()end)end)local V=true;(Y.Layout:GetPropertyChangedSignal("\065\098\115\111\108\117\116\101\067\111\110\116\101\110\116\083\105\122\101")):Connect(function()local Q=Y.Layout.AbsoluteContentSize Y.Scroller.CanvasSize=UDim2.new(0,0,0,Q.Y)if V then Y.Scroller.CanvasPosition=Vector2.new(0,Q.Y-Y.Scroller.AbsoluteWindowSize.Y)end end);(Y.Scroller:GetPropertyChangedSignal("\067\097\110\118\097\115\080\111\115\105\116\105\111\110")):Connect(function()V=Y:IsScrolledDown()end)return Y end return J


local v1, v2 = pcall(function()
	return UserSettings():IsUserFeatureEnabled("UserRemoveMessageOnTextFilterFailures");
end);
local v3 = {
	ScrollBarThickness = 4
};
local l__Parent__4 = script.Parent;
local v5 = {};
v5.__index = v5;
local u1 = require(game:GetService("Chat"):WaitForChild("ClientChatModules"):WaitForChild("ChatSettings"));
function v5.Destroy(p1)
	p1.GuiObject:Destroy();
	p1.Destroyed = true;
end;
function v5.SetActive(p2, p3)
	p2.GuiObject.Visible = p3;
end;
local u2 = v1 or v2;
function v5.UpdateMessageFiltered(p4, p5)
	local v6 = nil;
	local v7 = 1;
	local l__MessageObjectLog__8 = p4.MessageObjectLog;
	while v7 <= #l__MessageObjectLog__8 do
		local v9 = l__MessageObjectLog__8[v7];
		if v9.ID == p5.ID then
			v6 = v9;
			break;
		end;
		v7 = v7 + 1;	
	end;
	if v6 then
		if not u2 then
			v6.UpdateTextFunction(p5);
			p4:PositionMessageLabelInWindow(v6, v7);
			return;
		end;
	else
		return;
	end;
	if p5.Message == "" then
		p4:RemoveMessageAtIndex(v7);
		return;
	end;
	v6.UpdateTextFunction(p5);
	p4:PositionMessageLabelInWindow(v6, v7);
end;
local u3 = require(l__Parent__4:WaitForChild("MessageLabelCreator")).new();
function v5.AddMessage(p6, p7)
	p6:WaitUntilParentedCorrectly();
	local v10 = u3:CreateMessageLabel(p7, p6.CurrentChannelName);
	if v10 == nil then
		return;
	end;
	table.insert(p6.MessageObjectLog, v10);
	p6:PositionMessageLabelInWindow(v10, #p6.MessageObjectLog);
end;
function v5.RemoveMessageAtIndex(p8, p9)
	p8:WaitUntilParentedCorrectly();
	local v11 = p8.MessageObjectLog[p9];
	if v11 then
		v11:Destroy();
		table.remove(p8.MessageObjectLog, p9);
	end;
end;
function v5.AddMessageAtIndex(p10, p11, p12)
	local v12 = u3:CreateMessageLabel(p11, p10.CurrentChannelName);
	if v12 == nil then
		return;
	end;
	table.insert(p10.MessageObjectLog, p12, v12);
	p10:PositionMessageLabelInWindow(v12, p12);
end;
function v5.RemoveLastMessage(p13)
	p13:WaitUntilParentedCorrectly();
	p13.MessageObjectLog[1]:Destroy();
	table.remove(p13.MessageObjectLog, 1);
end;
function v5.IsScrolledDown(p14)
	local l__Offset__13 = p14.Scroller.CanvasSize.Y.Offset;
	local l__Y__14 = p14.Scroller.AbsoluteWindowSize.Y;
	local v15 = true;
	if not (l__Offset__13 < l__Y__14) then
		v15 = l__Offset__13 - p14.Scroller.CanvasPosition.Y <= l__Y__14 + 5;
	end;
	return v15;
end;
function v5.UpdateMessageTextHeight(p15, p16)
	local l__BaseFrame__16 = p16.BaseFrame;
	for v17 = 1, 10 do
		if p16.BaseMessage.TextFits then
			break;
		end;
		l__BaseFrame__16.Size = UDim2.new(1, 0, 0, p16.GetHeightFunction(p15.Scroller.AbsoluteSize.X - v17));
	end;
end;
function v5.PositionMessageLabelInWindow(p17, p18, p19)
	p17:WaitUntilParentedCorrectly();
	local l__BaseFrame__18 = p18.BaseFrame;
	local v19 = 1;
	if p17.MessageObjectLog[p19 - 1] then
		if p19 == #p17.MessageObjectLog then
			v19 = p17.MessageObjectLog[p19 - 1].BaseFrame.LayoutOrder + 1;
		else
			v19 = p17.MessageObjectLog[p19 - 1].BaseFrame.LayoutOrder;
		end;
	end;
	l__BaseFrame__18.LayoutOrder = v19;
	l__BaseFrame__18.Size = UDim2.new(1, 0, 0, p18.GetHeightFunction(p17.Scroller.AbsoluteSize.X));
	l__BaseFrame__18.Parent = p17.Scroller;
	if p18.BaseMessage then
		p17:UpdateMessageTextHeight(p18);
	end;
	if p17:IsScrolledDown() then
		p17.Scroller.CanvasPosition = Vector2.new(0, math.max(0, p17.Scroller.CanvasSize.Y.Offset - p17.Scroller.AbsoluteSize.Y));
	end;
end;
function v5.ReorderAllMessages(p20)
	p20:WaitUntilParentedCorrectly();
	if p20.GuiObject.AbsoluteSize.Y < 1 then
		return;
	end;
	for v20, v21 in pairs(p20.MessageObjectLog) do
		p20:UpdateMessageTextHeight(v21);
	end;
	if not p20:IsScrolledDown() then
		p20.Scroller.CanvasPosition = p20.Scroller.CanvasPosition;
		return;
	end;
	p20.Scroller.CanvasPosition = Vector2.new(0, math.max(0, p20.Scroller.CanvasSize.Y.Offset - p20.Scroller.AbsoluteSize.Y));
end;
function v5.Clear(p21)
	for v22, v23 in pairs(p21.MessageObjectLog) do
		v23:Destroy();
	end;
	p21.MessageObjectLog = {};
end;
function v5.SetCurrentChannelName(p22, p23)
	p22.CurrentChannelName = p23;
end;
function v5.FadeOutBackground(p24, p25)

end;
function v5.FadeInBackground(p26, p27)

end;
local u4 = require(l__Parent__4:WaitForChild("CurveUtil"));
function v5.FadeOutText(p28, p29)
	for v24 = 1, #p28.MessageObjectLog do
		if p28.MessageObjectLog[v24].FadeOutFunction then
			p28.MessageObjectLog[v24].FadeOutFunction(p29, u4);
		end;
	end;
end;
function v5.FadeInText(p30, p31)
	for v25 = 1, #p30.MessageObjectLog do
		if p30.MessageObjectLog[v25].FadeInFunction then
			p30.MessageObjectLog[v25].FadeInFunction(p31, u4);
		end;
	end;
end;
function v5.Update(p32, p33)
	for v26 = 1, #p32.MessageObjectLog do
		if p32.MessageObjectLog[v26].UpdateAnimFunction then
			p32.MessageObjectLog[v26].UpdateAnimFunction(p33, u4);
		end;
	end;
end;
function v5.WaitUntilParentedCorrectly(p34)
	while not p34.GuiObject:IsDescendantOf(game:GetService("Players").LocalPlayer) do
		p34.GuiObject.AncestryChanged:wait();	
	end;
end;
local function u5()
	local v27 = Instance.new("Frame");
	v27.Selectable = false;
	v27.Size = UDim2.new(1, 0, 1, 0);
	v27.BackgroundTransparency = 1;
	local v28 = Instance.new("ScrollingFrame");
	v28.Selectable = u1.GamepadNavigationEnabled;
	v28.Name = "Scroller";
	v28.BackgroundTransparency = 1;
	v28.BorderSizePixel = 0;
	v28.Position = UDim2.new(0, 0, 0, 3);
	v28.Size = UDim2.new(1, -4, 1, -6);
	v28.CanvasSize = UDim2.new(0, 0, 0, 0);
	v28.ScrollBarThickness = v3.ScrollBarThickness;
	v28.Active = true;
	v28.Parent = v27;
	local v29 = Instance.new("UIListLayout");
	v29.SortOrder = Enum.SortOrder.LayoutOrder;
	v29.Parent = v28;
	return v27, v28, v29;
end;
function v3.new()
	local v30 = setmetatable({}, v5);
	v30.Destroyed = false;
	local v31, v32, v33 = u5();
	v30.GuiObject = v31;
	v30.Scroller = v32;
	v30.Layout = v33;
	v30.MessageObjectLog = {};
	v30.Name = "MessageLogDisplay";
	v30.GuiObject.Name = "Frame_" .. v30.Name;
	v30.CurrentChannelName = "";
	v30.GuiObject:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
		spawn(function()
			v30:ReorderAllMessages();
		end);
	end);
	local u6 = true;
	v30.Layout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
		local l__AbsoluteContentSize__34 = v30.Layout.AbsoluteContentSize;
		v30.Scroller.CanvasSize = UDim2.new(0, 0, 0, l__AbsoluteContentSize__34.Y);
		if u6 then
			v30.Scroller.CanvasPosition = Vector2.new(0, l__AbsoluteContentSize__34.Y - v30.Scroller.AbsoluteWindowSize.Y);
		end;
	end);
	v30.Scroller:GetPropertyChangedSignal("CanvasPosition"):Connect(function()
		u6 = v30:IsScrolledDown();
	end);
	return v30;
end;
return v3;
