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


local l__Parent__1 = script.Parent;
local v2 = require(l__Parent__1:WaitForChild("MessageLabelCreator"));
local v3 = require(l__Parent__1:WaitForChild("CurveUtil"));
local v4 = require(game:GetService("Chat"):WaitForChild("ClientChatModules"):WaitForChild("ChatSettings"));
local v5 = false;
local v6, v7 = pcall(function()
	return settings():IsUserFeatureEnabled("UserFixChatMessageLogPerformance");
end);
if v6 then
	v5 = v7;
end;
local v8 = {};
v8.__index = v8;
local u1 = {
	ScrollBarThickness = 4
};
function v8.Destroy(p1)
	p1.GuiObject:Destroy();
	p1.Destroyed = true;
end;
function v8.SetActive(p2, p3)
	p2.GuiObject.Visible = p3;
end;
function v8.UpdateMessageFiltered(p4, p5)
	local v9 = nil;
	local v10 = 1;
	local l__MessageObjectLog__11 = p4.MessageObjectLog;
	while v10 <= #l__MessageObjectLog__11 do
		local v12 = l__MessageObjectLog__11[v10];
		if v12.ID == p5.ID then
			v9 = v12;
			break;
		end;
		v10 = v10 + 1;	
	end;
	if v9 then
		local v13 = p4:IsScrolledDown();
		v9.UpdateTextFunction(p5);
		if not v5 then
			p4:ReorderAllMessages();
			return;
		end;
	else
		return;
	end;
	p4:PositionMessageLabelInWindow(v9, v13);
end;
local u2 = v2.new();
function v8.AddMessage(p6, p7)
	p6:WaitUntilParentedCorrectly();
	local v14 = u2:CreateMessageLabel(p7, p6.CurrentChannelName);
	if v14 == nil then
		return;
	end;
	table.insert(p6.MessageObjectLog, v14);
	p6:PositionMessageLabelInWindow(v14);
end;
function v8.AddMessageAtIndex(p8, p9, p10)
	local v15 = u2:CreateMessageLabel(p9, p8.CurrentChannelName);
	if v15 == nil then
		return;
	end;
	table.insert(p8.MessageObjectLog, p10, v15);
	local v16 = p8:IsScrolledDown();
	p8:ReorderAllMessages();
	if v16 then
		p8.Scroller.CanvasPosition = Vector2.new(0, math.max(0, p8.Scroller.CanvasSize.Y.Offset - p8.Scroller.AbsoluteSize.Y));
	end;
end;
function v8.RemoveLastMessage(p11)
	p11:WaitUntilParentedCorrectly();
	local v17 = p11.MessageObjectLog[1];
	local v18 = UDim2.new(0, 0, 0, v17.BaseFrame.AbsoluteSize.Y);
	v17:Destroy();
	table.remove(p11.MessageObjectLog, 1);
	if not v5 then
		for v19, v20 in pairs(p11.MessageObjectLog) do
			v20.BaseFrame.Position = v20.BaseFrame.Position - v18;
		end;
		p11.Scroller.CanvasSize = p11.Scroller.CanvasSize - v18;
	end;
end;
function v8.IsScrolledDown(p12)
	local v21 = nil;
	local v22 = nil;
	local v23 = nil;
	v21 = p12.Scroller.CanvasSize.Y.Offset;
	v22 = p12.Scroller.AbsoluteWindowSize.Y;
	v23 = p12.Scroller.CanvasPosition.Y;
	if v5 then
		local v24 = true;
		if not (v21 < v22) then
			v24 = v22 - 5 <= v21 + v23;
		end;
		return v24;
	end;
	local v25 = true;
	if not (v21 < v22) then
		v25 = v21 - v23 <= v22 + 5;
	end;
	return v25;
end;
function v8.PositionMessageLabelInWindow(p13, p14, p15)
	p13:WaitUntilParentedCorrectly();
	local l__BaseFrame__26 = p14.BaseFrame;
	if v5 then
		if p15 == nil then
			p15 = p13:IsScrolledDown();
		end;
		l__BaseFrame__26.LayoutOrder = p14.ID;
	else
		l__BaseFrame__26.Parent = p13.Scroller;
		l__BaseFrame__26.Position = UDim2.new(0, 0, 0, p13.Scroller.CanvasSize.Y.Offset);
	end;
	l__BaseFrame__26.Size = UDim2.new(1, 0, 0, p14.GetHeightFunction(p13.Scroller.AbsoluteSize.X));
	if v5 then
		l__BaseFrame__26.Parent = p13.Scroller;
	end;
	if p14.BaseMessage then
		if v5 then
			for v27 = 1, 10 do
				if p14.BaseMessage.TextFits then
					break;
				end;
				l__BaseFrame__26.Size = UDim2.new(1, 0, 0, p14.GetHeightFunction(p13.Scroller.AbsoluteSize.X - v27));
			end;
		else
			local v28 = p13.Scroller.AbsoluteSize.X;
			local v29 = math.min(p13.Scroller.AbsoluteSize.X - 10, 0);
			while not p14.BaseMessage.TextFits do
				v28 = v28 - 1;
				if v28 < v29 then
					break;
				end;
				l__BaseFrame__26.Size = UDim2.new(1, 0, 0, p14.GetHeightFunction(v28));			
			end;
		end;
	end;
	if v5 then
		if not p15 then
			return;
		end;
	else
		p15 = p13:IsScrolledDown();
		p13.Scroller.CanvasSize = p13.Scroller.CanvasSize + UDim2.new(0, 0, 0, l__BaseFrame__26.Size.Y.Offset);
		if p15 then
			p13.Scroller.CanvasPosition = Vector2.new(0, math.max(0, p13.Scroller.CanvasSize.Y.Offset - p13.Scroller.AbsoluteSize.Y));
		end;
		return;
	end;
	p13.Scroller.CanvasPosition = Vector2.new(0, math.max(0, p13.Scroller.CanvasSize.Y.Offset - p13.Scroller.AbsoluteSize.Y));
end;
function v8.ReorderAllMessages(p16)
	p16:WaitUntilParentedCorrectly();
	if p16.GuiObject.AbsoluteSize.Y < 1 then
		return;
	end;
	p16.Scroller.CanvasSize = UDim2.new(0, 0, 0, 0);
	for v30, v31 in pairs(p16.MessageObjectLog) do
		p16:PositionMessageLabelInWindow(v31);
	end;
	if not p16:IsScrolledDown() then
		p16.Scroller.CanvasPosition = p16.Scroller.CanvasPosition;
	end;
end;
function v8.Clear(p17)
	for v32, v33 in pairs(p17.MessageObjectLog) do
		v33:Destroy();
	end;
	p17.MessageObjectLog = {};
	if not v5 then
		p17.Scroller.CanvasSize = UDim2.new(0, 0, 0, 0);
	end;
end;
function v8.SetCurrentChannelName(p18, p19)
	p18.CurrentChannelName = p19;
end;
function v8.FadeOutBackground(p20, p21)

end;
function v8.FadeInBackground(p22, p23)

end;
function v8.FadeOutText(p24, p25)
	for v34 = 1, #p24.MessageObjectLog do
		if p24.MessageObjectLog[v34].FadeOutFunction then
			p24.MessageObjectLog[v34].FadeOutFunction(p25, v3);
		end;
	end;
end;
function v8.FadeInText(p26, p27)
	for v35 = 1, #p26.MessageObjectLog do
		if p26.MessageObjectLog[v35].FadeInFunction then
			p26.MessageObjectLog[v35].FadeInFunction(p27, v3);
		end;
	end;
end;
function v8.Update(p28, p29)
	for v36 = 1, #p28.MessageObjectLog do
		if p28.MessageObjectLog[v36].UpdateAnimFunction then
			p28.MessageObjectLog[v36].UpdateAnimFunction(p29, v3);
		end;
	end;
end;
function v8.WaitUntilParentedCorrectly(p30)
	while not p30.GuiObject:IsDescendantOf(game:GetService("Players").LocalPlayer) do
		p30.GuiObject.AncestryChanged:wait();	
	end;
end;
local function u3()
	local v37 = Instance.new("Frame");
	v37.Selectable = false;
	v37.Size = UDim2.new(1, 0, 1, 0);
	v37.BackgroundTransparency = 1;
	local v38 = Instance.new("ScrollingFrame");
	v38.Selectable = v4.GamepadNavigationEnabled;
	v38.Name = "Scroller";
	v38.BackgroundTransparency = 1;
	v38.BorderSizePixel = 0;
	v38.Position = UDim2.new(0, 0, 0, 3);
	v38.Size = UDim2.new(1, -4, 1, -6);
	v38.CanvasSize = UDim2.new(0, 0, 0, 0);
	v38.ScrollBarThickness = u1.ScrollBarThickness;
	v38.Active = false;
	v38.Parent = v37;
	local v39 = nil;
	if v5 then
		v39 = Instance.new("UIListLayout");
		v39.SortOrder = Enum.SortOrder.LayoutOrder;
		v39.Parent = v38;
	end;
	return v37, v38, v39;
end;
function u1.new()
	local v40 = setmetatable({}, v8);
	v40.Destroyed = false;
	local v41, v42, v43 = u3();
	v40.GuiObject = v41;
	v40.Scroller = v42;
	v40.Layout = v43;
	v40.MessageObjectLog = {};
	v40.Name = "MessageLogDisplay";
	v40.GuiObject.Name = "Frame_" .. v40.Name;
	v40.CurrentChannelName = "";
	v40.GuiObject:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
		spawn(function()
			v40:ReorderAllMessages();
		end);
	end);
	if v5 then
		local u4 = true;
		v40.Layout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
			local l__AbsoluteContentSize__44 = v40.Layout.AbsoluteContentSize;
			v40.Scroller.CanvasSize = UDim2.new(0, 0, 0, l__AbsoluteContentSize__44.Y);
			if u4 then
				v40.Scroller.CanvasPosition = Vector2.new(0, l__AbsoluteContentSize__44.Y - v40.Scroller.AbsoluteWindowSize.Y);
			end;
		end);
		v40.Scroller:GetPropertyChangedSignal("CanvasPosition"):Connect(function()
			u4 = v40:IsScrolledDown();
		end);
	end;
	return v40;
end;
return u1;

