local v0 = {};
local l_UserInputService_0 = game:GetService("UserInputService");
local l_RunService_0 = game:GetService("RunService");
local l_Players_0 = game:GetService("Players");
local l_TextService_0 = game:GetService("TextService");
local l_LocalPlayer_0 = l_Players_0.LocalPlayer;
while not l_LocalPlayer_0 do
    l_Players_0.PlayerAdded:wait();
    l_LocalPlayer_0 = l_Players_0.LocalPlayer;
end;
local l_Chat_0 = game:GetService("Chat");
local l_ClientChatModules_0 = l_Chat_0:WaitForChild("ClientChatModules");
local l_Parent_0 = script.Parent;
local l_ChatSettings_0 = require(l_ClientChatModules_0:WaitForChild("ChatSettings"));
local l_CurveUtil_0 = require(l_Parent_0:WaitForChild("CurveUtil"));
local l_Whisper_0 = require(l_ClientChatModules_0:WaitForChild("CommandModules"):WaitForChild("Whisper"));
local _ = require(l_Parent_0:WaitForChild("MessageSender"));
local v13 = nil;
pcall(function()
    v13 = require(game:GetService("Chat").ClientChatModules.ChatLocalization);
end);
if v13 == nil then
    v13 = {
        Get = function(_, _, v16)
            return v16;
        end
    };
end;
local v17 = {};
v17.__index = v17;
v17.CreateGuiObjects = function(v18, v19)
    v18.ChatBarParentFrame = v19;
    local l_Frame_0 = Instance.new("Frame");
    l_Frame_0.Selectable = false;
    l_Frame_0.Size = UDim2.new(1, 0, 1, 0);
    l_Frame_0.BackgroundTransparency = 0.6;
    l_Frame_0.BorderSizePixel = 0;
    l_Frame_0.BackgroundColor3 = l_ChatSettings_0.ChatBarBackGroundColor;
    l_Frame_0.Parent = v19;
    local l_Frame_1 = Instance.new("Frame");
    l_Frame_1.Selectable = false;
    l_Frame_1.Name = "BoxFrame";
    l_Frame_1.BackgroundTransparency = 0.6;
    l_Frame_1.BorderSizePixel = 0;
    l_Frame_1.BackgroundColor3 = l_ChatSettings_0.ChatBarBoxColor;
    l_Frame_1.Size = UDim2.new(1, -14, 1, -14);
    l_Frame_1.Position = UDim2.new(0, 7, 0, 7);
    l_Frame_1.Parent = l_Frame_0;
    local l_Frame_2 = Instance.new("Frame");
    l_Frame_2.BackgroundTransparency = 1;
    l_Frame_2.Size = UDim2.new(1, -10, 1, -10);
    l_Frame_2.Position = UDim2.new(0, 5, 0, 5);
    l_Frame_2.Parent = l_Frame_1;
    local l_TextBox_0 = Instance.new("TextBox");
    l_TextBox_0.Selectable = l_ChatSettings_0.GamepadNavigationEnabled;
    l_TextBox_0.Name = "ChatBar";
    l_TextBox_0.BackgroundTransparency = 1;
    l_TextBox_0.Size = UDim2.new(1, 0, 1, 0);
    l_TextBox_0.Position = UDim2.new(0, 0, 0, 0);
    l_TextBox_0.TextSize = l_ChatSettings_0.ChatBarTextSize;
    l_TextBox_0.Font = l_ChatSettings_0.ChatBarFont;
    l_TextBox_0.TextColor3 = l_ChatSettings_0.ChatBarTextColor;
    l_TextBox_0.TextTransparency = 0.4;
    l_TextBox_0.TextStrokeTransparency = 1;
    l_TextBox_0.ClearTextOnFocus = false;
    l_TextBox_0.TextXAlignment = Enum.TextXAlignment.Left;
    l_TextBox_0.TextYAlignment = Enum.TextYAlignment.Top;
    l_TextBox_0.TextWrapped = true;
    l_TextBox_0.Text = "";
    l_TextBox_0.Parent = l_Frame_2;
    local l_TextButton_0 = Instance.new("TextButton");
    l_TextButton_0.Selectable = false;
    l_TextButton_0.Name = "MessageMode";
    l_TextButton_0.BackgroundTransparency = 1;
    l_TextButton_0.Position = UDim2.new(0, 0, 0, 0);
    l_TextButton_0.TextSize = l_ChatSettings_0.ChatBarTextSize;
    l_TextButton_0.Font = l_ChatSettings_0.ChatBarFont;
    l_TextButton_0.TextXAlignment = Enum.TextXAlignment.Left;
    l_TextButton_0.TextWrapped = true;
    l_TextButton_0.Text = "";
    l_TextButton_0.Size = UDim2.new(0, 0, 0, 0);
    l_TextButton_0.TextYAlignment = Enum.TextYAlignment.Center;
    l_TextButton_0.TextColor3 = v18:GetDefaultChannelNameColor();
    l_TextButton_0.Visible = true;
    l_TextButton_0.Parent = l_Frame_2;
    local l_TextLabel_0 = Instance.new("TextLabel");
    l_TextLabel_0.Selectable = false;
    l_TextLabel_0.TextWrapped = true;
    l_TextLabel_0.BackgroundTransparency = 1;
    l_TextLabel_0.Size = l_TextBox_0.Size;
    l_TextLabel_0.Position = l_TextBox_0.Position;
    l_TextLabel_0.TextSize = l_TextBox_0.TextSize;
    l_TextLabel_0.Font = l_TextBox_0.Font;
    l_TextLabel_0.TextColor3 = l_TextBox_0.TextColor3;
    l_TextLabel_0.TextTransparency = l_TextBox_0.TextTransparency;
    l_TextLabel_0.TextStrokeTransparency = l_TextBox_0.TextStrokeTransparency;
    l_TextLabel_0.TextXAlignment = l_TextBox_0.TextXAlignment;
    l_TextLabel_0.TextYAlignment = l_TextBox_0.TextYAlignment;
    l_TextLabel_0.Text = "...";
    l_TextLabel_0.Parent = l_Frame_2;
    v18.GuiObject = l_Frame_0;
    v18.TextBox = l_TextBox_0;
    v18.TextLabel = l_TextLabel_0;
    v18.GuiObjects.BaseFrame = l_Frame_0;
    v18.GuiObjects.TextBoxFrame = l_Frame_1;
    v18.GuiObjects.TextBox = l_TextBox_0;
    v18.GuiObjects.TextLabel = l_TextLabel_0;
    v18.GuiObjects.MessageModeTextButton = l_TextButton_0;
    v18:AnimGuiObjects();
    v18:SetUpTextBoxEvents(l_TextBox_0, l_TextLabel_0, l_TextButton_0);
    if v18.UserHasChatOff then
        v18:DoLockChatBar();
    end;
    v18.eGuiObjectsChanged:Fire();
end;
v17.DoLockChatBar = function(v26)
    if v26.TextLabel then
        if l_LocalPlayer_0.UserId > 0 then
            v26.TextLabel.Text = v13:Get("GameChat_ChatMessageValidator_SettingsError", "To chat in game, turn on chat in your Privacy Settings.");
        else
            v26.TextLabel.Text = v13:Get("GameChat_SwallowGuestChat_Message", "Sign up to chat in game.");
        end;
        v26:CalculateSize();
    end;
    if v26.TextBox then
        v26.TextBox.Active = false;
        v26.TextBox.Focused:connect(function()
            v26.TextBox:ReleaseFocus();
        end);
    end;
end;
v17.SetUpTextBoxEvents = function(v27, v28, v29, v30)
    for v31, v32 in pairs(v27.TextBoxConnections) do
        v32:disconnect();
        v27.TextBoxConnections[v31] = nil;
    end;
    v27.TextBoxConnections.UserInputBegan = l_UserInputService_0.InputBegan:connect(function(v33, _)
        if not (not (v33.KeyCode == Enum.KeyCode.Backspace) or not v27:IsFocused()) and v28.Text == "" then
            v27:SetChannelTarget(l_ChatSettings_0.GeneralChannelName);
        end;
    end);
    v27.TextBoxConnections.TextBoxChanged = v28.Changed:connect(function(v35)
        if v35 == "AbsoluteSize" then
            v27:CalculateSize();
            return ;
        elseif v35 ~= "Text" then
            return ;
        else
            v27:CalculateSize();
            if l_ChatSettings_0.MaximumMessageLength < utf8.len(utf8.nfcnormalize(v28.Text)) then
                v28.Text = v27.PreviousText;
            else
                v27.PreviousText = v28.Text;
            end;
            if v27.InCustomState then
                v27.CustomState:TextUpdated();
            else
                local v36 = v27.CommandProcessor:ProcessInProgressChatMessage(v28.Text, v27.ChatWindow, v27);
                if v36 then
                    v27.InCustomState = true;
                    v27.CustomState = v36;
                    return ;
                end;
            end;
            return ;
        end;
    end);
    local function _(v37)
        if v37 or v28.Text ~= "" then
            v29.Visible = false;
            return ;
        else
            v29.Visible = true;
            return ;
        end;
    end;
    v27.TextBoxConnections.MessageModeClick = v30.MouseButton1Click:connect(function()
        if v30.Text ~= "" then
            v27:SetChannelTarget(l_ChatSettings_0.GeneralChannelName);
        end;
    end);
    v27.TextBoxConnections.TextBoxFocused = v28.Focused:connect(function()
        if not v27.UserHasChatOff then
            v27:CalculateSize();
            v29.Visible = false;
        end;
    end);
    v27.TextBoxConnections.TextBoxFocusLost = v28.FocusLost:connect(function(_, v40)
        v27:CalculateSize();
        if v40 and v40.KeyCode == Enum.KeyCode.Escape then
            v28.Text = "";
        end;
        if v28.Text ~= "" then
            v29.Visible = false;
            return ;
        else
            v29.Visible = true;
            return ;
        end;
    end);
end;
v17.GetTextBox = function(v41)
    return v41.TextBox;
end;
v17.GetMessageModeTextButton = function(v42)
    return v42.GuiObjects.MessageModeTextButton;
end;
v17.GetMessageModeTextLabel = function(v43)
    return v43:GetMessageModeTextButton();
end;
v17.IsFocused = function(v44)
    if not v44.UserHasChatOff then
        return v44:GetTextBox():IsFocused();
    else
        return false;
    end;
end;
v17.GetVisible = function(v45)
    return v45.GuiObject.Visible;
end;
v17.CaptureFocus = function(v46)
    if not v46.UserHasChatOff then
        v46:GetTextBox():CaptureFocus();
    end;
end;
v17.ReleaseFocus = function(v47, v48)
    v47:GetTextBox():ReleaseFocus(v48);
end;
v17.ResetText = function(v49)
    v49:GetTextBox().Text = "";
end;
v17.SetText = function(v50, v51)
    v50:GetTextBox().Text = v51;
end;
v17.GetEnabled = function(v52)
    return v52.GuiObject.Visible;
end;
v17.SetEnabled = function(v53, v54)
    if not v53.UserHasChatOff then
        v53.GuiObject.Visible = v54;
        return ;
    else
        v53.GuiObject.Visible = true;
        return ;
    end;
end;
v17.SetTextLabelText = function(v55, v56)
    if not v55.UserHasChatOff then
        v55.TextLabel.Text = v56;
    end;
end;
v17.SetTextBoxText = function(v57, v58)
    v57.TextBox.Text = v58;
end;
v17.GetTextBoxText = function(v59)
    return v59.TextBox.Text;
end;
v17.ResetSize = function(v60)
    v60.TargetYSize = 0;
    v60:TweenToTargetYSize();
end;
local function _(v61)
    return l_TextService_0:GetTextSize(v61.Text, v61.TextSize, v61.Font, Vector2.new(v61.AbsoluteSize.X, 10000));
end;
v17.CalculateSize = function(v63)
    if not v63.CalculatingSizeLock then
        v63.CalculatingSizeLock = true;
        local v64 = nil;
        local v65 = nil;
        if v63:IsFocused() or v63.TextBox.Text ~= "" then
            v64 = v63.TextBox.TextSize;
            local l_TextBox_1 = v63.TextBox;
            v65 = l_TextService_0:GetTextSize(l_TextBox_1.Text, l_TextBox_1.TextSize, l_TextBox_1.Font, Vector2.new(l_TextBox_1.AbsoluteSize.X, 10000)).Y;
        else
            v64 = v63.TextLabel.TextSize;
            local l_TextLabel_1 = v63.TextLabel;
            v65 = l_TextService_0:GetTextSize(l_TextLabel_1.Text, l_TextLabel_1.TextSize, l_TextLabel_1.Font, Vector2.new(l_TextLabel_1.AbsoluteSize.X, 10000)).Y;
        end;
        local v68 = v65 - v64;
        if v63.TargetYSize ~= v68 then
            v63.TargetYSize = v68;
            v63:TweenToTargetYSize();
        end;
        v63.CalculatingSizeLock = false;
        return ;
    else
        return ;
    end;
end;
v17.TweenToTargetYSize = function(v69)
    local v70 = UDim2.new(1, 0, 1, v69.TargetYSize);
    local l_Size_0 = v69.GuiObject.Size;
    local l_Y_0 = v69.GuiObject.AbsoluteSize.Y;
    v69.GuiObject.Size = v70;
    local l_Y_1 = v69.GuiObject.AbsoluteSize.Y;
    v69.GuiObject.Size = l_Size_0;
    local v74 = math.min(1, math.abs(l_Y_1 - l_Y_0) * (1 / v69.TweenPixelsPerSecond));
    if not pcall(function()
        v69.GuiObject:TweenSize(v70, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, v74, true);
    end) then
        v69.GuiObject.Size = v70;
    end;
end;
v17.SetTextSize = function(v75, v76)
    if not v75:IsInCustomState() then
        if v75.TextBox then
            v75.TextBox.TextSize = v76;
        end;
        if v75.TextLabel then
            v75.TextLabel.TextSize = v76;
        end;
    end;
end;
v17.GetDefaultChannelNameColor = function(_)
    if not l_ChatSettings_0.DefaultChannelNameColor then
        return Color3.fromRGB(35, 76, 142);
    else
        return l_ChatSettings_0.DefaultChannelNameColor;
    end;
end;
v17.SetChannelTarget = function(v78, v79)
    local l_MessageModeTextButton_0 = v78.GuiObjects.MessageModeTextButton;
    local l_TextBox_2 = v78.TextBox;
    local l_TextLabel_2 = v78.TextLabel;
    v78.TargetChannel = v79;
    if not v78:IsInCustomState() then
        if v79 ~= l_ChatSettings_0.GeneralChannelName then
            l_MessageModeTextButton_0.Size = UDim2.new(0, 1000, 1, 0);
            local l_v79_0 = v79;
            if v13.tryLocalize then
                l_v79_0 = v13:tryLocalize(v79);
            end;
            l_MessageModeTextButton_0.Text = string.format("[%s] ", l_v79_0);
            local l_v78_ChannelNameColor_0 = v78:GetChannelNameColor(v79);
            if not l_v78_ChannelNameColor_0 then
                l_MessageModeTextButton_0.TextColor3 = v78:GetDefaultChannelNameColor();
            else
                l_MessageModeTextButton_0.TextColor3 = l_v78_ChannelNameColor_0;
            end;
            local l_X_0 = l_MessageModeTextButton_0.TextBounds.X;
            l_MessageModeTextButton_0.Size = UDim2.new(0, l_X_0, 1, 0);
            l_TextBox_2.Size = UDim2.new(1, -l_X_0, 1, 0);
            l_TextBox_2.Position = UDim2.new(0, l_X_0, 0, 0);
            l_TextLabel_2.Size = UDim2.new(1, -l_X_0, 1, 0);
            l_TextLabel_2.Position = UDim2.new(0, l_X_0, 0, 0);
            return ;
        else
            l_MessageModeTextButton_0.Text = "";
            l_MessageModeTextButton_0.Size = UDim2.new(0, 0, 0, 0);
            l_TextBox_2.Size = UDim2.new(1, 0, 1, 0);
            l_TextBox_2.Position = UDim2.new(0, 0, 0, 0);
            l_TextLabel_2.Size = UDim2.new(1, 0, 1, 0);
            l_TextLabel_2.Position = UDim2.new(0, 0, 0, 0);
        end;
    end;
end;
v17.IsInCustomState = function(v86)
    return v86.InCustomState;
end;
v17.ResetCustomState = function(v87)
    if v87.InCustomState then
        v87.CustomState:Destroy();
        v87.CustomState = nil;
        v87.InCustomState = false;
        v87.ChatBarParentFrame:ClearAllChildren();
        v87:CreateGuiObjects(v87.ChatBarParentFrame);
        v87:SetTextLabelText(v13:Get("GameChat_ChatMain_ChatBarText", "To chat click here or press \"/\" key"));
    end;
end;
v17.EnterWhisperState = function(v88, v89)
    v88:ResetCustomState();
    if not l_Whisper_0.CustomStateCreator then
        local _ = nil;
        v88:SetText("/w " .. if not l_ChatSettings_0.PlayerDisplayNamesEnabled then v89.Name else v89.DisplayName);
    else
        v88.CustomState = l_Whisper_0.CustomStateCreator(v89, v88.ChatWindow, v88, l_ChatSettings_0);
        v88.InCustomState = true;
    end;
    v88:CaptureFocus();
end;
v17.GetCustomMessage = function(v91)
    if not v91.InCustomState then
        return nil;
    else
        return v91.CustomState:GetMessage();
    end;
end;
v17.CustomStateProcessCompletedMessage = function(v92, _)
    if not v92.InCustomState then
        return false;
    else
        return v92.CustomState:ProcessCompletedMessage();
    end;
end;
v17.FadeOutBackground = function(v94, v95)
    v94.AnimParams.Background_TargetTransparency = 1;
    v94.AnimParams.Background_NormalizedExptValue = l_CurveUtil_0:NormalizedDefaultExptValueInSeconds(v95);
    v94:FadeOutText(v95);
end;
v17.FadeInBackground = function(v96, v97)
    v96.AnimParams.Background_TargetTransparency = 0.6;
    v96.AnimParams.Background_NormalizedExptValue = l_CurveUtil_0:NormalizedDefaultExptValueInSeconds(v97);
    v96:FadeInText(v97);
end;
v17.FadeOutText = function(v98, v99)
    v98.AnimParams.Text_TargetTransparency = 1;
    v98.AnimParams.Text_NormalizedExptValue = l_CurveUtil_0:NormalizedDefaultExptValueInSeconds(v99);
end;
v17.FadeInText = function(v100, v101)
    v100.AnimParams.Text_TargetTransparency = 0.4;
    v100.AnimParams.Text_NormalizedExptValue = l_CurveUtil_0:NormalizedDefaultExptValueInSeconds(v101);
end;
v17.AnimGuiObjects = function(v102)
    v102.GuiObject.BackgroundTransparency = v102.AnimParams.Background_CurrentTransparency;
    v102.GuiObjects.TextBoxFrame.BackgroundTransparency = v102.AnimParams.Background_CurrentTransparency;
    v102.GuiObjects.TextLabel.TextTransparency = v102.AnimParams.Text_CurrentTransparency;
    v102.GuiObjects.TextBox.TextTransparency = v102.AnimParams.Text_CurrentTransparency;
    v102.GuiObjects.MessageModeTextButton.TextTransparency = v102.AnimParams.Text_CurrentTransparency;
end;
v17.InitializeAnimParams = function(v103)
    v103.AnimParams.Text_TargetTransparency = 0.4;
    v103.AnimParams.Text_CurrentTransparency = 0.4;
    v103.AnimParams.Text_NormalizedExptValue = 1;
    v103.AnimParams.Background_TargetTransparency = 0.6;
    v103.AnimParams.Background_CurrentTransparency = 0.6;
    v103.AnimParams.Background_NormalizedExptValue = 1;
end;
v17.Update = function(v104, v105)
    v104.AnimParams.Text_CurrentTransparency = l_CurveUtil_0:Expt(v104.AnimParams.Text_CurrentTransparency, v104.AnimParams.Text_TargetTransparency, v104.AnimParams.Text_NormalizedExptValue, v105);
    v104.AnimParams.Background_CurrentTransparency = l_CurveUtil_0:Expt(v104.AnimParams.Background_CurrentTransparency, v104.AnimParams.Background_TargetTransparency, v104.AnimParams.Background_NormalizedExptValue, v105);
    v104:AnimGuiObjects();
end;
v17.SetChannelNameColor = function(v106, v107, v108)
    v106.ChannelNameColors[v107] = v108;
    if v106.GuiObjects.MessageModeTextButton.Text == v107 then
        v106.GuiObjects.MessageModeTextButton.TextColor3 = v108;
    end;
end;
v17.GetChannelNameColor = function(v109, v110)
    return v109.ChannelNameColors[v110];
end;
v0.new = function(v111, v112)
    local v113 = setmetatable({}, v17);
    v113.GuiObject = nil;
    v113.ChatBarParentFrame = nil;
    v113.TextBox = nil;
    v113.TextLabel = nil;
    v113.GuiObjects = {};
    v113.eGuiObjectsChanged = Instance.new("BindableEvent");
    v113.GuiObjectsChanged = v113.eGuiObjectsChanged.Event;
    v113.TextBoxConnections = {};
    v113.PreviousText = "";
    v113.InCustomState = false;
    v113.CustomState = nil;
    v113.TargetChannel = nil;
    v113.CommandProcessor = v111;
    v113.ChatWindow = v112;
    v113.TweenPixelsPerSecond = 500;
    v113.TargetYSize = 0;
    v113.AnimParams = {};
    v113.CalculatingSizeLock = false;
    v113.ChannelNameColors = {};
    v113.UserHasChatOff = false;
    v113:InitializeAnimParams();
    l_ChatSettings_0.SettingsChanged:connect(function(v114, v115)
        if v114 == "ChatBarTextSize" then
            v113:SetTextSize(v115);
        end;
    end);
    coroutine.wrap(function()
        local l_status_0, l_result_0 = pcall(function()
            return l_Chat_0:CanUserChatAsync(l_LocalPlayer_0.UserId);
        end);
        if (l_status_0 and (l_RunService_0:IsStudio() or l_result_0)) == false then
            v113.UserHasChatOff = true;
            v113:DoLockChatBar();
        end;
    end)();
    return v113;
end;
return v0;


local v0 = nil;
local l_status_0, l_result_0 = pcall(function()
    return UserSettings():IsUserFeatureEnabled("UserFlagRemoveMessageFromMessageLog");
end);
v0 = l_status_0 and l_result_0;
l_status_0 = false;
local v3;
l_result_0, v3 = pcall(function()
    return UserSettings():IsUserFeatureEnabled("UserIsChatTranslationEnabled2");
end);
l_status_0 = l_result_0 and v3;
l_result_0 = {};
local l_ClientChatModules_0 = game:GetService("Chat"):WaitForChild("ClientChatModules");
local l_Parent_0 = script.Parent;
local l_ChatSettings_0 = require(l_ClientChatModules_0:WaitForChild("ChatSettings"));
local v7 = nil;
if l_status_0 then
    v7 = l_Parent_0:FindFirstChild("ChatTranslationEnabled");
    if v7 == nil then
        local v8 = nil;
        do
            local l_v8_0 = v8;
            l_v8_0 = l_Parent_0.ChildAdded:Connect(function(v10)
                if v10.Name == "ChatTranslationEnabled" then
                    v7 = v10;
                    l_v8_0:Disconnect();
                end;
            end);
        end;
    end;
end;
local v11 = {};
v11.__index = v11;
v11.Destroy = function(v12)
    v12.Destroyed = true;
end;
v11.SetActive = function(v13, v14)
    if v14 == v13.Active then
        return ;
    else
        if v14 == false then
            v13.MessageLogDisplay:Clear();
        else
            v13.MessageLogDisplay:SetCurrentChannelName(v13.Name);
            for v15 = 1, #v13.MessageLog do
                v13.MessageLogDisplay:AddMessage(v13.MessageLog[v15]);
            end;
        end;
        v13.Active = v14;
        return ;
    end;
end;
v11.UpdateMessageFiltered = function(v16, v17)
    local v18 = 1;
    local l_MessageLog_0 = v16.MessageLog;
    local v20 = nil;
    while v18 <= #l_MessageLog_0 do
        local v21 = l_MessageLog_0[v18];
        if v21.ID == v17.ID then
            v20 = v21;
            break;
        else
            v18 = v18 + 1;
        end;
    end;
    if not v20 then
        v16:AddMessageToChannelByTimeStamp(v17);
    else
        v20.Message = v17.Message;
        v20.IsFiltered = true;
        if not (not (l_status_0 and v7 ~= nil) or not v7.Value) then
            v20.TranslatedMessage = v17.TranslatedMessage;
            v20.ShowTranslated = true;
        end;
        if v16.Active then
            if v0 and v20.Message == "" then
                table.remove(v16.MessageLog, v18);
            end;
            v16.MessageLogDisplay:UpdateMessageFiltered(v20);
            return ;
        end;
    end;
end;
v11.AddMessageToChannel = function(v22, v23)
    table.insert(v22.MessageLog, v23);
    if v22.Active then
        v22.MessageLogDisplay:AddMessage(v23);
    end;
    if l_ChatSettings_0.MessageHistoryLengthPerChannel < #v22.MessageLog then
        v22:RemoveLastMessageFromChannel();
    end;
end;
v11.InternalAddMessageAtTimeStamp = function(v24, v25)
    for v26 = 1, #v24.MessageLog do
        if v25.Time < v24.MessageLog[v26].Time then
            table.insert(v24.MessageLog, v26, v25);
            return ;
        end;
    end;
    table.insert(v24.MessageLog, v25);
end;
v11.AddMessagesToChannelByTimeStamp = function(v27, v28, v29)
    for v30 = v29, #v28 do
        v27:InternalAddMessageAtTimeStamp(v28[v30]);
    end;
    while l_ChatSettings_0.MessageHistoryLengthPerChannel < #v27.MessageLog do
        table.remove(v27.MessageLog, 1);
    end;
    if v27.Active then
        v27.MessageLogDisplay:Clear();
        for v31 = 1, #v27.MessageLog do
            v27.MessageLogDisplay:AddMessage(v27.MessageLog[v31]);
        end;
    end;
end;
v11.AddMessageToChannelByTimeStamp = function(v32, v33)
    if #v32.MessageLog >= 1 then
        if v33.Time < v32.MessageLog[1].Time then
            return ;
        elseif v32.MessageLog[#v32.MessageLog].Time <= v33.Time then
            v32:AddMessageToChannel(v33);
            return ;
        else
            for v34 = 1, #v32.MessageLog do
                if v33.Time < v32.MessageLog[v34].Time then
                    table.insert(v32.MessageLog, v34, v33);
                    if l_ChatSettings_0.MessageHistoryLengthPerChannel < #v32.MessageLog then
                        v32:RemoveLastMessageFromChannel();
                    end;
                    if v32.Active then
                        v32.MessageLogDisplay:AddMessageAtIndex(v33, v34);
                    end;
                    return ;
                end;
            end;
            return ;
        end;
    else
        v32:AddMessageToChannel(v33);
        return ;
    end;
end;
v11.RemoveLastMessageFromChannel = function(v35)
    table.remove(v35.MessageLog, 1);
    if v35.Active then
        v35.MessageLogDisplay:RemoveLastMessage();
    end;
end;
v11.ClearMessageLog = function(v36)
    v36.MessageLog = {};
    if v36.Active then
        v36.MessageLogDisplay:Clear();
    end;
end;
v11.RegisterChannelTab = function(v37, v38)
    v37.ChannelTab = v38;
end;
l_result_0.new = function(v39, v40)
    local v41 = setmetatable({}, v11);
    v41.Destroyed = false;
    v41.Active = false;
    v41.MessageLog = {};
    v41.MessageLogDisplay = v40;
    v41.ChannelTab = nil;
    v41.Name = v39;
    return v41;
end;
return l_result_0;


local l_Players_0 = game:GetService("Players");
local l_StarterPlayer_0 = game:GetService("StarterPlayer");
local function v5(v2, v3)
    local l_v2_FirstChildOfClass_0 = v2:FindFirstChildOfClass(v3);
    while not l_v2_FirstChildOfClass_0 or l_v2_FirstChildOfClass_0.ClassName ~= v3 do
        l_v2_FirstChildOfClass_0 = v2.ChildAdded:Wait();
    end;
    return l_v2_FirstChildOfClass_0;
end;
local v6 = v5(l_Players_0.LocalPlayer, "PlayerScripts");
local v7 = v5(l_StarterPlayer_0, "StarterPlayerScripts");
VerifyScriptExistence = function()
    local l_Value_0 = script:WaitForChild("ScriptToVerify").Value;
    if not v6:FindFirstChild(l_Value_0) then
        local l_v7_FirstChild_0 = v7:FindFirstChild(l_Value_0);
        if l_v7_FirstChild_0 then
            local l_Archivable_0 = l_v7_FirstChild_0.Archivable;
            l_v7_FirstChild_0.Archivable = true;
            l_v7_FirstChild_0:Clone().Parent = v6;
            l_v7_FirstChild_0.Archivable = l_Archivable_0;
        end;
    end;
end;
VerifyScriptExistence();
script:Destroy();


local v0 = false;
local l_status_0, l_result_0 = pcall(function()
    return UserSettings():IsUserFeatureEnabled("UserHandleChatHotKeyWithContextActionService");
end);
if l_status_0 then
    v0 = l_result_0;
end;
l_status_0 = game:GetService("StarterGui");
l_result_0 = game:GetService("GuiService");
local l_Chat_0 = game:GetService("Chat");
local l_ReplicatedStorage_0 = game:GetService("ReplicatedStorage");
local l_ChatSettings_0 = require(l_Chat_0:WaitForChild("ClientChatModules"):WaitForChild("ChatSettings"));
local function v49()
    local l_ChatMain_0 = require(script:WaitForChild("ChatMain"));
    local v7 = {
        ChatWindow = {},
        SetCore = {},
        GetCore = {}
    };
    v7.ChatWindow.ChatTypes = {};
    v7.ChatWindow.ChatTypes.BubbleChatEnabled = l_ChatSettings_0.BubbleChatEnabled;
    v7.ChatWindow.ChatTypes.ClassicChatEnabled = l_ChatSettings_0.ClassicChatEnabled;
    local function _(v8)
        local l_BindableEvent_0 = Instance.new("BindableEvent");
        l_BindableEvent_0.Name = v8;
        v7.ChatWindow[v8] = l_BindableEvent_0;
        l_BindableEvent_0.Event:connect(function(...)
            l_ChatMain_0[v8](l_ChatMain_0, ...);
        end);
    end;
    local function _(v11)
        local l_BindableFunction_0 = Instance.new("BindableFunction");
        l_BindableFunction_0.Name = v11;
        v7.ChatWindow[v11] = l_BindableFunction_0;
        l_BindableFunction_0.OnInvoke = function(...)
            return l_ChatMain_0[v11](l_ChatMain_0, ...);
        end;
    end;
    local function _(v14)
        local l_BindableEvent_1 = Instance.new("BindableEvent");
        l_BindableEvent_1.Name = v14;
        v7.ChatWindow[v14] = l_BindableEvent_1;
        l_ChatMain_0[v14]:connect(function(...)
            l_BindableEvent_1:Fire(...);
        end);
    end;
    local function _(v17)
        local l_BindableEvent_2 = Instance.new("BindableEvent");
        l_BindableEvent_2.Name = v17;
        v7.ChatWindow[v17] = l_BindableEvent_2;
        l_BindableEvent_2.Event:connect(function(...)
            l_ChatMain_0[v17]:fire(...);
        end);
    end;
    local function _(v20)
        local l_BindableEvent_3 = Instance.new("BindableEvent");
        l_BindableEvent_3.Name = v20;
        v7.SetCore[v20] = l_BindableEvent_3;
        l_BindableEvent_3.Event:connect(function(...)
            l_ChatMain_0[v20 .. "Event"]:fire(...);
        end);
    end;
    local function _(v23)
        local l_BindableFunction_1 = Instance.new("BindableFunction");
        l_BindableFunction_1.Name = v23;
        v7.GetCore[v23] = l_BindableFunction_1;
        l_BindableFunction_1.OnInvoke = function(...)
            return l_ChatMain_0["f" .. v23](...);
        end;
    end;
    local l_BindableEvent_4 = Instance.new("BindableEvent");
    l_BindableEvent_4.Name = "ToggleVisibility";
    v7.ChatWindow.ToggleVisibility = l_BindableEvent_4;
    local l_Event_0 = l_BindableEvent_4.Event;
    local v28 = "ToggleVisibility";
    local l_v28_0 = v28 --[[ copy: 12 -> 13 ]];
    l_Event_0:connect(function(...)
        l_ChatMain_0[l_v28_0](l_ChatMain_0, ...);
    end);
    l_BindableEvent_4 = Instance.new("BindableEvent");
    l_BindableEvent_4.Name = "SetVisible";
    v7.ChatWindow.SetVisible = l_BindableEvent_4;
    l_Event_0 = l_BindableEvent_4.Event;
    v28 = "SetVisible";
    local l_v28_1 = v28 --[[ copy: 12 -> 14 ]];
    l_Event_0:connect(function(...)
        l_ChatMain_0[l_v28_1](l_ChatMain_0, ...);
    end);
    l_BindableEvent_4 = Instance.new("BindableEvent");
    l_BindableEvent_4.Name = "FocusChatBar";
    v7.ChatWindow.FocusChatBar = l_BindableEvent_4;
    l_Event_0 = l_BindableEvent_4.Event;
    v28 = "FocusChatBar";
    local l_v28_2 = v28 --[[ copy: 12 -> 15 ]];
    l_Event_0:connect(function(...)
        l_ChatMain_0[l_v28_2](l_ChatMain_0, ...);
    end);
    l_BindableEvent_4 = Instance.new("BindableEvent");
    l_BindableEvent_4.Name = "EnterWhisperState";
    v7.ChatWindow.EnterWhisperState = l_BindableEvent_4;
    l_Event_0 = l_BindableEvent_4.Event;
    v28 = "EnterWhisperState";
    local l_v28_3 = v28 --[[ copy: 12 -> 16 ]];
    l_Event_0:connect(function(...)
        l_ChatMain_0[l_v28_3](l_ChatMain_0, ...);
    end);
    l_BindableEvent_4 = Instance.new("BindableFunction");
    l_BindableEvent_4.Name = "GetVisibility";
    v7.ChatWindow.GetVisibility = l_BindableEvent_4;
    local v33 = "GetVisibility";
    local l_v33_0 = v33 --[[ copy: 10 -> 17 ]];
    l_BindableEvent_4.OnInvoke = function(...)
        return l_ChatMain_0[l_v33_0](l_ChatMain_0, ...);
    end;
    l_BindableEvent_4 = Instance.new("BindableFunction");
    l_BindableEvent_4.Name = "GetMessageCount";
    v7.ChatWindow.GetMessageCount = l_BindableEvent_4;
    v33 = "GetMessageCount";
    local l_v33_1 = v33 --[[ copy: 10 -> 18 ]];
    l_BindableEvent_4.OnInvoke = function(...)
        return l_ChatMain_0[l_v33_1](l_ChatMain_0, ...);
    end;
    l_BindableEvent_4 = Instance.new("BindableEvent");
    l_BindableEvent_4.Name = "TopbarEnabledChanged";
    v7.ChatWindow.TopbarEnabledChanged = l_BindableEvent_4;
    l_Event_0 = l_BindableEvent_4.Event;
    v28 = "TopbarEnabledChanged";
    local l_v28_4 = v28 --[[ copy: 12 -> 19 ]];
    l_Event_0:connect(function(...)
        l_ChatMain_0[l_v28_4](l_ChatMain_0, ...);
    end);
    l_BindableEvent_4 = Instance.new("BindableFunction");
    l_BindableEvent_4.Name = "IsFocused";
    v7.ChatWindow.IsFocused = l_BindableEvent_4;
    v33 = "IsFocused";
    local l_v33_2 = v33 --[[ copy: 10 -> 20 ]];
    l_BindableEvent_4.OnInvoke = function(...)
        return l_ChatMain_0[l_v33_2](l_ChatMain_0, ...);
    end;
    l_BindableEvent_4 = Instance.new("BindableEvent");
    l_BindableEvent_4.Name = "ChatBarFocusChanged";
    v7.ChatWindow.ChatBarFocusChanged = l_BindableEvent_4;
    local l_l_BindableEvent_4_0 = l_BindableEvent_4 --[[ copy: 8 -> 21 ]];
    l_ChatMain_0.ChatBarFocusChanged:connect(function(...)
        l_l_BindableEvent_4_0:Fire(...);
    end);
    l_BindableEvent_4 = Instance.new("BindableEvent");
    l_BindableEvent_4.Name = "VisibilityStateChanged";
    v7.ChatWindow.VisibilityStateChanged = l_BindableEvent_4;
    local l_l_BindableEvent_4_1 = l_BindableEvent_4 --[[ copy: 8 -> 22 ]];
    l_ChatMain_0.VisibilityStateChanged:connect(function(...)
        l_l_BindableEvent_4_1:Fire(...);
    end);
    l_BindableEvent_4 = Instance.new("BindableEvent");
    l_BindableEvent_4.Name = "MessagesChanged";
    v7.ChatWindow.MessagesChanged = l_BindableEvent_4;
    local l_l_BindableEvent_4_2 = l_BindableEvent_4 --[[ copy: 8 -> 23 ]];
    l_ChatMain_0.MessagesChanged:connect(function(...)
        l_l_BindableEvent_4_2:Fire(...);
    end);
    l_BindableEvent_4 = Instance.new("BindableEvent");
    l_BindableEvent_4.Name = "MessagePosted";
    v7.ChatWindow.MessagePosted = l_BindableEvent_4;
    local l_l_BindableEvent_4_3 = l_BindableEvent_4 --[[ copy: 8 -> 24 ]];
    l_ChatMain_0.MessagePosted:connect(function(...)
        l_l_BindableEvent_4_3:Fire(...);
    end);
    l_BindableEvent_4 = Instance.new("BindableEvent");
    l_BindableEvent_4.Name = "CoreGuiEnabled";
    v7.ChatWindow.CoreGuiEnabled = l_BindableEvent_4;
    l_Event_0 = l_BindableEvent_4.Event;
    v28 = "CoreGuiEnabled";
    local l_v28_5 = v28 --[[ copy: 12 -> 25 ]];
    l_Event_0:connect(function(...)
        l_ChatMain_0[l_v28_5]:fire(...);
    end);
    l_BindableEvent_4 = Instance.new("BindableEvent");
    l_BindableEvent_4.Name = "ChatMakeSystemMessage";
    v7.SetCore.ChatMakeSystemMessage = l_BindableEvent_4;
    l_Event_0 = l_BindableEvent_4.Event;
    v28 = "ChatMakeSystemMessage";
    local l_v28_6 = v28 --[[ copy: 12 -> 26 ]];
    l_Event_0:connect(function(...)
        l_ChatMain_0[l_v28_6 .. "Event"]:fire(...);
    end);
    l_BindableEvent_4 = Instance.new("BindableEvent");
    l_BindableEvent_4.Name = "ChatWindowPosition";
    v7.SetCore.ChatWindowPosition = l_BindableEvent_4;
    l_Event_0 = l_BindableEvent_4.Event;
    v28 = "ChatWindowPosition";
    local l_v28_7 = v28 --[[ copy: 12 -> 27 ]];
    l_Event_0:connect(function(...)
        l_ChatMain_0[l_v28_7 .. "Event"]:fire(...);
    end);
    l_BindableEvent_4 = Instance.new("BindableEvent");
    l_BindableEvent_4.Name = "ChatWindowSize";
    v7.SetCore.ChatWindowSize = l_BindableEvent_4;
    l_Event_0 = l_BindableEvent_4.Event;
    v28 = "ChatWindowSize";
    local l_v28_8 = v28 --[[ copy: 12 -> 28 ]];
    l_Event_0:connect(function(...)
        l_ChatMain_0[l_v28_8 .. "Event"]:fire(...);
    end);
    l_BindableEvent_4 = Instance.new("BindableFunction");
    l_BindableEvent_4.Name = "ChatWindowPosition";
    v7.GetCore.ChatWindowPosition = l_BindableEvent_4;
    v33 = "ChatWindowPosition";
    local l_v33_3 = v33 --[[ copy: 10 -> 29 ]];
    l_BindableEvent_4.OnInvoke = function(...)
        return l_ChatMain_0["f" .. l_v33_3](...);
    end;
    l_BindableEvent_4 = Instance.new("BindableFunction");
    l_BindableEvent_4.Name = "ChatWindowSize";
    v7.GetCore.ChatWindowSize = l_BindableEvent_4;
    v33 = "ChatWindowSize";
    local l_v33_4 = v33 --[[ copy: 10 -> 30 ]];
    l_BindableEvent_4.OnInvoke = function(...)
        return l_ChatMain_0["f" .. l_v33_4](...);
    end;
    l_BindableEvent_4 = Instance.new("BindableEvent");
    l_BindableEvent_4.Name = "ChatBarDisabled";
    v7.SetCore.ChatBarDisabled = l_BindableEvent_4;
    l_Event_0 = l_BindableEvent_4.Event;
    v28 = "ChatBarDisabled";
    local l_v28_9 = v28 --[[ copy: 12 -> 31 ]];
    l_Event_0:connect(function(...)
        l_ChatMain_0[l_v28_9 .. "Event"]:fire(...);
    end);
    l_BindableEvent_4 = Instance.new("BindableFunction");
    l_BindableEvent_4.Name = "ChatBarDisabled";
    v7.GetCore.ChatBarDisabled = l_BindableEvent_4;
    v33 = "ChatBarDisabled";
    l_BindableEvent_4.OnInvoke = function(...)
        return l_ChatMain_0["f" .. v33](...);
    end;
    if not v0 then
        l_BindableEvent_4 = Instance.new("BindableEvent");
        l_BindableEvent_4.Name = "SpecialKeyPressed";
        v7.ChatWindow.SpecialKeyPressed = l_BindableEvent_4;
        l_Event_0 = l_BindableEvent_4.Event;
        v28 = "SpecialKeyPressed";
        l_Event_0:connect(function(...)
            l_ChatMain_0[v28](l_ChatMain_0, ...);
        end);
    end;
    SetCoreGuiChatConnections(v7);
end;
SetCoreGuiChatConnections = function(v50)
    local v51 = 0;
    while v51 < 10 do
        v51 = v51 + 1;
        local l_status_1, l_result_1 = pcall(function()
            l_status_0:SetCore("CoreGuiChatConnections", v50);
        end);
        if not l_status_1 then
            if not l_status_1 and v51 == 10 then
                error("Error calling SetCore CoreGuiChatConnections: " .. l_result_1);
            end;
            wait();
        else
            break;
        end;
    end;
end;
checkBothChatTypesDisabled = function()
    if l_ChatSettings_0.BubbleChatEnabled ~= nil and l_ChatSettings_0.ClassicChatEnabled ~= nil then
        return not (l_ChatSettings_0.BubbleChatEnabled or l_ChatSettings_0.ClassicChatEnabled);
    else
        return false;
    end;
end;
if l_result_0:IsTenFootInterface() then
    l_ReplicatedStorage_0:WaitForChild("DefaultChatSystemChatEvents").GetInitDataRequest:InvokeServer();
elseif checkBothChatTypesDisabled() then
    local v54 = {
        ChatWindow = {}
    };
    v54.ChatWindow.ChatTypes = {};
    v54.ChatWindow.ChatTypes.BubbleChatEnabled = false;
    v54.ChatWindow.ChatTypes.ClassicChatEnabled = false;
    SetCoreGuiChatConnections(v54);
else
    v49();
end;


local v0 = {};
local l_Players_0 = game:GetService("Players");
local _ = game:GetService("Chat");
local l_PlayerGui_0 = l_Players_0.LocalPlayer:WaitForChild("PlayerGui");
local l_Chat_1 = game:GetService("Chat");
local l_ClientChatModules_0 = l_Chat_1:WaitForChild("ClientChatModules");
local l_Parent_0 = script.Parent;
local l_ChatChannel_0 = require(l_Parent_0:WaitForChild("ChatChannel"));
local l_ChatSettings_0 = require(l_ClientChatModules_0:WaitForChild("ChatSettings"));
local l_CurveUtil_0 = require(l_Parent_0:WaitForChild("CurveUtil"));
local v10 = {};
v10.__index = v10;
getClassicChatEnabled = function()
    if l_ChatSettings_0.ClassicChatEnabled ~= nil then
        return l_ChatSettings_0.ClassicChatEnabled;
    else
        return l_Players_0.ClassicChat;
    end;
end;
getBubbleChatEnabled = function()
    if l_ChatSettings_0.BubbleChatEnabled ~= nil then
        return l_ChatSettings_0.BubbleChatEnabled;
    else
        return l_Players_0.BubbleChat;
    end;
end;
bubbleChatOnly = function()
    return not getClassicChatEnabled() and getBubbleChatEnabled();
end;
mergeProps = function(v11, v12)
    if v11 and v12 then
        for v13, v14 in pairs(v11) do
            if v12[v13] ~= nil then
                v12[v13] = v14;
            end;
        end;
        return ;
    else
        return ;
    end;
end;
v10.CreateGuiObjects = function(v15, v16)
    local v17 = nil;
    pcall(function()
        v17 = l_Chat_1:InvokeChatCallback(Enum.ChatCallbackType.OnCreatingChatWindow, nil);
    end);
    mergeProps(v17, l_ChatSettings_0);
    local l_Frame_0 = Instance.new("Frame");
    l_Frame_0.BackgroundTransparency = 1;
    l_Frame_0.Active = l_ChatSettings_0.WindowDraggable;
    l_Frame_0.Parent = v16;
    l_Frame_0.AutoLocalize = false;
    local l_Frame_1 = Instance.new("Frame");
    l_Frame_1.Selectable = false;
    l_Frame_1.Name = "ChatBarParentFrame";
    l_Frame_1.BackgroundTransparency = 1;
    l_Frame_1.Parent = l_Frame_0;
    local l_Frame_2 = Instance.new("Frame");
    l_Frame_2.Selectable = false;
    l_Frame_2.Name = "ChannelsBarParentFrame";
    l_Frame_2.BackgroundTransparency = 1;
    l_Frame_2.Position = UDim2.new(0, 0, 0, 0);
    l_Frame_2.Parent = l_Frame_0;
    local l_Frame_3 = Instance.new("Frame");
    l_Frame_3.Selectable = false;
    l_Frame_3.Name = "ChatChannelParentFrame";
    l_Frame_3.BackgroundTransparency = 1;
    l_Frame_3.BackgroundColor3 = l_ChatSettings_0.BackGroundColor;
    l_Frame_3.BackgroundTransparency = 0.6;
    l_Frame_3.BorderSizePixel = 0;
    l_Frame_3.Parent = l_Frame_0;
    local l_ImageButton_0 = Instance.new("ImageButton");
    l_ImageButton_0.Selectable = false;
    l_ImageButton_0.Image = "";
    l_ImageButton_0.BackgroundTransparency = 0.6;
    l_ImageButton_0.BorderSizePixel = 0;
    l_ImageButton_0.Visible = false;
    l_ImageButton_0.BackgroundColor3 = l_ChatSettings_0.BackGroundColor;
    l_ImageButton_0.Active = true;
    if not bubbleChatOnly() then
        l_ImageButton_0.Position = UDim2.new(1, -l_ImageButton_0.AbsoluteSize.X, 1, -l_ImageButton_0.AbsoluteSize.Y);
    else
        l_ImageButton_0.Position = UDim2.new(1, -l_ImageButton_0.AbsoluteSize.X, 0, 0);
    end;
    l_ImageButton_0.Parent = l_Frame_0;
    local l_ImageLabel_0 = Instance.new("ImageLabel");
    l_ImageLabel_0.Selectable = false;
    l_ImageLabel_0.Size = UDim2.new(0.8, 0, 0.8, 0);
    l_ImageLabel_0.Position = UDim2.new(0.2, 0, 0.2, 0);
    l_ImageLabel_0.BackgroundTransparency = 1;
    l_ImageLabel_0.Image = "rbxassetid://261880743";
    l_ImageLabel_0.Parent = l_ImageButton_0;
    local function _()
        local l_l_Frame_0_0 = l_Frame_0;
        while not (not l_l_Frame_0_0 or l_l_Frame_0_0:IsA("ScreenGui")) do
            l_l_Frame_0_0 = l_l_Frame_0_0.Parent;
        end;
        return l_l_Frame_0_0;
    end;
    local v26 = 3;
    local l_l_Frame_0_1 = l_Frame_0;
    while not (not l_l_Frame_0_1 or l_l_Frame_0_1:IsA("ScreenGui")) do
        l_l_Frame_0_1 = l_l_Frame_0_1.Parent;
    end;
    local l_l_l_Frame_0_1_0 = l_l_Frame_0_1;
    if l_l_l_Frame_0_1_0.AbsoluteSize.X <= 640 then
        v26 = 1;
    elseif l_l_l_Frame_0_1_0.AbsoluteSize.X <= 1024 then
        v26 = 2;
    end;
    l_l_Frame_0_1 = false;
    local function v39()
        if not l_l_Frame_0_1 then
            l_l_Frame_0_1 = true;
            if l_Frame_0:IsDescendantOf(l_PlayerGui_0) then
                local l_l_Frame_0_2 = l_Frame_0;
                while not (not l_l_Frame_0_2 or l_l_Frame_0_2:IsA("ScreenGui")) do
                    l_l_Frame_0_2 = l_l_Frame_0_2.Parent;
                end;
                local l_l_l_Frame_0_2_0 = l_l_Frame_0_2;
                l_l_Frame_0_2 = l_ChatSettings_0.MinimumWindowSize;
                local l_MaximumWindowSize_0 = l_ChatSettings_0.MaximumWindowSize;
                local v32 = l_Frame_2.AbsoluteSize.Y + l_Frame_1.AbsoluteSize.Y;
                local v33 = l_l_Frame_0_2.X.Scale * l_l_l_Frame_0_2_0.AbsoluteSize.X + l_l_Frame_0_2.X.Offset;
                local v34 = math.max(l_l_Frame_0_2.Y.Scale * l_l_l_Frame_0_2_0.AbsoluteSize.Y + l_l_Frame_0_2.Y.Offset, v32);
                local v35 = l_MaximumWindowSize_0.X.Scale * l_l_l_Frame_0_2_0.AbsoluteSize.X + l_MaximumWindowSize_0.X.Offset;
                local v36 = l_MaximumWindowSize_0.Y.Scale * l_l_l_Frame_0_2_0.AbsoluteSize.Y + l_MaximumWindowSize_0.Y.Offset;
                local l_X_0 = l_Frame_0.AbsoluteSize.X;
                local l_Y_0 = l_Frame_0.AbsoluteSize.Y;
                if l_X_0 < v33 then
                    l_Frame_0.Size = l_Frame_0.Size + UDim2.new(0, v33 - l_X_0, 0, 0);
                elseif v35 < l_X_0 then
                    l_Frame_0.Size = l_Frame_0.Size + UDim2.new(0, v35 - l_X_0, 0, 0);
                end;
                if l_Y_0 < v34 then
                    l_Frame_0.Size = l_Frame_0.Size + UDim2.new(0, 0, 0, v34 - l_Y_0);
                elseif v36 < l_Y_0 then
                    l_Frame_0.Size = l_Frame_0.Size + UDim2.new(0, 0, 0, v36 - l_Y_0);
                end;
                l_Frame_0.Size = UDim2.new(l_Frame_0.AbsoluteSize.X / l_l_l_Frame_0_2_0.AbsoluteSize.X, 0, l_Frame_0.AbsoluteSize.Y / l_l_l_Frame_0_2_0.AbsoluteSize.Y, 0);
                l_l_Frame_0_1 = false;
                return ;
            else
                return ;
            end;
        else
            return ;
        end;
    end;
    l_Frame_0.Changed:connect(function(v40)
        if v40 == "AbsoluteSize" then
            v39();
        end;
    end);
    l_ImageButton_0.DragBegin:connect(function(_)
        l_Frame_0.Draggable = false;
    end);
    local function v44(v42)
        if l_ChatSettings_0.WindowDraggable == false and l_ChatSettings_0.WindowResizable == false then
            return ;
        else
            local v43 = (v42 - l_Frame_0.AbsolutePosition) + l_ImageButton_0.AbsoluteSize;
            l_Frame_0.Size = UDim2.new(0, v43.X, 0, v43.Y);
            if not bubbleChatOnly() then
                l_ImageButton_0.Position = UDim2.new(1, -l_ImageButton_0.AbsoluteSize.X, 1, -l_ImageButton_0.AbsoluteSize.Y);
                return ;
            else
                l_ImageButton_0.Position = UDim2.new(1, -l_ImageButton_0.AbsoluteSize.X, 0, 0);
                return ;
            end;
        end;
    end;
    l_ImageButton_0.DragStopped:connect(function(_, _)
        l_Frame_0.Draggable = l_ChatSettings_0.WindowDraggable;
    end);
    local v47 = false;
    l_ImageButton_0.Changed:connect(function(v48)
        if not (not (v48 == "AbsolutePosition") or l_Frame_0.Draggable) then
            if not v47 then
                v47 = true;
                v44(l_ImageButton_0.AbsolutePosition);
                v47 = false;
            else
                return ;
            end;
        end;
    end);
    local function _(v49)
        return math.max(32, if v26 == 1 then v49 or l_ChatSettings_0.ChatChannelsTabTextSizePhone else v49 or l_ChatSettings_0.ChatChannelsTabTextSize + 8) + 2;
    end;
    local function _(v51)
        return (if v26 == 1 then v51 or l_ChatSettings_0.ChatBarTextSizePhone else v51 or l_ChatSettings_0.ChatBarTextSize + 14) + 10;
    end;
    if not bubbleChatOnly() then
        local l_l_Frame_0_3 = l_Frame_0;
        while not (not l_l_Frame_0_3 or l_l_Frame_0_3:IsA("ScreenGui")) do
            l_l_Frame_0_3 = l_l_Frame_0_3.Parent;
        end;
        local _ = l_l_Frame_0_3;
        if v26 == 1 then
            l_Frame_0.Size = l_ChatSettings_0.DefaultWindowSizePhone;
        elseif v26 == 2 then
            l_Frame_0.Size = l_ChatSettings_0.DefaultWindowSizeTablet;
        else
            l_Frame_0.Size = l_ChatSettings_0.DefaultWindowSizeDesktop;
        end;
        l_Frame_0.Position = l_ChatSettings_0.DefaultWindowPosition;
    else
        l_Frame_1.Position = UDim2.new(0, 0, 0, 0);
        l_Frame_2.Visible = false;
        l_Frame_2.Active = false;
        l_Frame_3.Visible = false;
        l_Frame_3.Active = false;
        local v55 = 0;
        local v56 = 0;
        local l_l_Frame_0_4 = l_Frame_0;
        while not (not l_l_Frame_0_4 or l_l_Frame_0_4:IsA("ScreenGui")) do
            l_l_Frame_0_4 = l_l_Frame_0_4.Parent;
        end;
        local _ = l_l_Frame_0_4;
        if v26 == 1 then
            v55 = l_ChatSettings_0.DefaultWindowSizePhone.X.Scale;
            v56 = l_ChatSettings_0.DefaultWindowSizePhone.X.Offset;
        elseif v26 == 2 then
            v55 = l_ChatSettings_0.DefaultWindowSizeTablet.X.Scale;
            v56 = l_ChatSettings_0.DefaultWindowSizeTablet.X.Offset;
        else
            v55 = l_ChatSettings_0.DefaultWindowSizeDesktop.X.Scale;
            v56 = l_ChatSettings_0.DefaultWindowSizeDesktop.X.Offset;
        end;
        local v59 = nil;
        l_Frame_0.Size = UDim2.new(v55, v56, 0, (if v26 == 1 then v59 or l_ChatSettings_0.ChatBarTextSizePhone else v59 or l_ChatSettings_0.ChatBarTextSize + 14) + 10);
        l_Frame_0.Position = l_ChatSettings_0.DefaultWindowPosition;
    end;
    if v26 == 1 then
        l_ChatSettings_0.ChatWindowTextSize = l_ChatSettings_0.ChatWindowTextSizePhone;
        l_ChatSettings_0.ChatChannelsTabTextSize = l_ChatSettings_0.ChatChannelsTabTextSizePhone;
        l_ChatSettings_0.ChatBarTextSize = l_ChatSettings_0.ChatBarTextSizePhone;
    end;
    local function _(v60)
        l_Frame_0.Active = v60;
        l_Frame_0.Draggable = v60;
    end;
    local function v64(v62)
        l_ImageButton_0.Visible = v62;
        l_ImageButton_0.Draggable = v62;
        local l_Offset_0 = l_Frame_1.Size.Y.Offset;
        if not v62 then
            l_Frame_1.Size = UDim2.new(1, 0, 0, l_Offset_0);
            if not bubbleChatOnly() then
                l_Frame_1.Position = UDim2.new(0, 0, 1, -l_Offset_0);
            end;
        else
            l_Frame_1.Size = UDim2.new(1, -l_Offset_0 - 2, 0, l_Offset_0);
            if not bubbleChatOnly() then
                l_Frame_1.Position = UDim2.new(0, 0, 1, -l_Offset_0);
                return ;
            end;
        end;
    end;
    local function v68()
        local v65 = nil;
        local v66 = math.max(32, if v26 == 1 then v65 or l_ChatSettings_0.ChatChannelsTabTextSizePhone else v65 or l_ChatSettings_0.ChatChannelsTabTextSize + 8) + 2;
        local v67 = nil;
        v65 = (if v26 == 1 then v67 or l_ChatSettings_0.ChatBarTextSizePhone else v67 or l_ChatSettings_0.ChatBarTextSize + 14) + 10;
        if not l_ChatSettings_0.ShowChannelsBar then
            l_Frame_3.Size = UDim2.new(1, 0, 1, -((v65 + 2) + 2));
            l_Frame_3.Position = UDim2.new(0, 0, 0, 2);
            return ;
        else
            l_Frame_3.Size = UDim2.new(1, 0, 1, -(((v66 + v65) + 2) + 2));
            l_Frame_3.Position = UDim2.new(0, 0, 0, v66 + 2);
            return ;
        end;
    end;
    local function _(v69)
        local l_v69_0 = v69;
        l_Frame_2.Size = UDim2.new(1, 0, 0, math.max(32, if v26 == 1 then l_v69_0 or l_ChatSettings_0.ChatChannelsTabTextSizePhone else l_v69_0 or l_ChatSettings_0.ChatChannelsTabTextSize + 8) + 2);
        v68();
    end;
    local function v75(v72)
        local l_v72_0 = v72;
        local v74 = (if v26 == 1 then l_v72_0 or l_ChatSettings_0.ChatBarTextSizePhone else l_v72_0 or l_ChatSettings_0.ChatBarTextSize + 14) + 10;
        l_Frame_1.Size = UDim2.new(1, 0, 0, v74);
        if not bubbleChatOnly() then
            l_Frame_1.Position = UDim2.new(0, 0, 1, -v74);
        end;
        l_ImageButton_0.Size = UDim2.new(0, v74, 0, v74);
        l_ImageButton_0.Position = UDim2.new(1, -v74, 1, -v74);
        v68();
        v64(l_ChatSettings_0.WindowResizable);
    end;
    local function _(v76)
        l_Frame_2.Visible = v76;
        v68();
    end;
    local l_ChatChannelsTabTextSize_0 = l_ChatSettings_0.ChatChannelsTabTextSize;
    l_Frame_2.Size = UDim2.new(1, 0, 0, math.max(32, if v26 == 1 then l_ChatChannelsTabTextSize_0 or l_ChatSettings_0.ChatChannelsTabTextSizePhone else l_ChatChannelsTabTextSize_0 or l_ChatSettings_0.ChatChannelsTabTextSize + 8) + 2);
    v68();
    v75(l_ChatSettings_0.ChatBarTextSize);
    local l_WindowDraggable_0 = l_ChatSettings_0.WindowDraggable;
    l_Frame_0.Active = l_WindowDraggable_0;
    l_Frame_0.Draggable = l_WindowDraggable_0;
    v64(l_ChatSettings_0.WindowResizable);
    l_Frame_2.Visible = l_ChatSettings_0.ShowChannelsBar;
    v68();
    l_ChatSettings_0.SettingsChanged:connect(function(v80, v81)
        if v80 == "WindowDraggable" then
            l_Frame_0.Active = v81;
            l_Frame_0.Draggable = v81;
            return ;
        elseif v80 == "WindowResizable" then
            v64(v81);
            return ;
        elseif v80 == "ChatChannelsTabTextSize" then
            local l_v81_0 = v81;
            l_Frame_2.Size = UDim2.new(1, 0, 0, math.max(32, if v26 == 1 then l_v81_0 or l_ChatSettings_0.ChatChannelsTabTextSizePhone else l_v81_0 or l_ChatSettings_0.ChatChannelsTabTextSize + 8) + 2);
            v68();
            return ;
        elseif v80 == "ChatBarTextSize" then
            v75(v81);
            return ;
        else
            if v80 == "ShowChannelsBar" then
                l_Frame_2.Visible = v81;
                v68();
            end;
            return ;
        end;
    end);
    v15.GuiObject = l_Frame_0;
    v15.GuiObjects.BaseFrame = l_Frame_0;
    v15.GuiObjects.ChatBarParentFrame = l_Frame_1;
    v15.GuiObjects.ChannelsBarParentFrame = l_Frame_2;
    v15.GuiObjects.ChatChannelParentFrame = l_Frame_3;
    v15.GuiObjects.ChatResizerFrame = l_ImageButton_0;
    v15.GuiObjects.ResizeIcon = l_ImageLabel_0;
    v15:AnimGuiObjects();
end;
v10.GetChatBar = function(v83)
    return v83.ChatBar;
end;
v10.RegisterChatBar = function(v84, v85)
    v84.ChatBar = v85;
    v84.ChatBar:CreateGuiObjects(v84.GuiObjects.ChatBarParentFrame);
end;
v10.RegisterChannelsBar = function(v86, v87)
    v86.ChannelsBar = v87;
    v86.ChannelsBar:CreateGuiObjects(v86.GuiObjects.ChannelsBarParentFrame);
end;
v10.RegisterMessageLogDisplay = function(v88, v89)
    v88.MessageLogDisplay = v89;
    v88.MessageLogDisplay.GuiObject.Parent = v88.GuiObjects.ChatChannelParentFrame;
end;
v10.AddChannel = function(v90, v91)
    if not v90:GetChannel(v91) then
        local v92 = l_ChatChannel_0.new(v91, v90.MessageLogDisplay);
        v90.Channels[v91:lower()] = v92;
        v92:SetActive(false);
        local v93 = v90.ChannelsBar:AddChannelTab(v91);
        v93.NameTag.MouseButton1Click:connect(function()
            v90:SwitchCurrentChannel(v91);
        end);
        v92:RegisterChannelTab(v93);
        return v92;
    else
        error("Channel '" .. v91 .. "' already exists");
        return ;
    end;
end;
v10.GetFirstChannel = function(v94)
    for _, v96 in pairs(v94.Channels) do
        return v96;
    end;
    return nil;
end;
v10.RemoveChannel = function(v97, v98)
    if not v97:GetChannel(v98) then
        error("Channel '" .. v98 .. "' does not exist");
    end;
    local v99 = v98:lower();
    local v100 = false;
    if v97.Channels[v99] == v97:GetCurrentChannel() then
        v100 = true;
        v97:SwitchCurrentChannel(nil);
    end;
    v97.Channels[v99]:Destroy();
    v97.Channels[v99] = nil;
    v97.ChannelsBar:RemoveChannelTab(v98);
    if v100 then
        local v101 = v97:GetChannel(l_ChatSettings_0.GeneralChannelName) ~= nil;
        local v102 = v99 == l_ChatSettings_0.GeneralChannelName:lower();
        local v103 = nil;
        if not v101 or v102 then
            local l_v97_FirstChannel_0 = v97:GetFirstChannel();
            v103 = not not l_v97_FirstChannel_0 and l_v97_FirstChannel_0.Name or nil;
        else
            v103 = l_ChatSettings_0.GeneralChannelName;
        end;
        v97:SwitchCurrentChannel(v103);
    end;
    if not l_ChatSettings_0.ShowChannelsBar and v97.ChatBar.TargetChannel == v98 then
        v97.ChatBar:SetChannelTarget(l_ChatSettings_0.GeneralChannelName);
    end;
end;
v10.GetChannel = function(v105, v106)
    return not not v106 and v105.Channels[v106:lower()] or nil;
end;
v10.GetTargetMessageChannel = function(v107)
    if l_ChatSettings_0.ShowChannelsBar then
        local l_v107_CurrentChannel_0 = v107:GetCurrentChannel();
        return l_v107_CurrentChannel_0 and l_v107_CurrentChannel_0.Name;
    else
        return v107.ChatBar.TargetChannel;
    end;
end;
v10.GetCurrentChannel = function(v109)
    return v109.CurrentChannel;
end;
v10.SwitchCurrentChannel = function(v110, v111)
    if not l_ChatSettings_0.ShowChannelsBar then
        local l_v110_Channel_0 = v110:GetChannel(v111);
        if l_v110_Channel_0 then
            v110.ChatBar:SetChannelTarget(l_v110_Channel_0.Name);
        end;
        v111 = l_ChatSettings_0.GeneralChannelName;
    end;
    local l_v110_CurrentChannel_0 = v110:GetCurrentChannel();
    local l_v110_Channel_1 = v110:GetChannel(v111);
    if l_v110_Channel_1 == nil then
        error(string.format("Channel '%s' does not exist.", v111));
    end;
    if l_v110_Channel_1 ~= l_v110_CurrentChannel_0 then
        if l_v110_CurrentChannel_0 then
            l_v110_CurrentChannel_0:SetActive(false);
            v110.ChannelsBar:GetChannelTab(l_v110_CurrentChannel_0.Name):SetActive(false);
        end;
        if l_v110_Channel_1 then
            l_v110_Channel_1:SetActive(true);
            v110.ChannelsBar:GetChannelTab(l_v110_Channel_1.Name):SetActive(true);
        end;
        v110.CurrentChannel = l_v110_Channel_1;
    end;
end;
v10.UpdateFrameVisibility = function(v115)
    v115.GuiObject.Visible = v115.Visible and v115.CoreGuiEnabled;
end;
v10.GetVisible = function(v116)
    return v116.Visible;
end;
v10.SetVisible = function(v117, v118)
    v117.Visible = v118;
    v117:UpdateFrameVisibility();
end;
v10.GetCoreGuiEnabled = function(v119)
    return v119.CoreGuiEnabled;
end;
v10.SetCoreGuiEnabled = function(v120, v121)
    v120.CoreGuiEnabled = v121;
    v120:UpdateFrameVisibility();
end;
v10.EnableResizable = function(v122)
    v122.GuiObjects.ChatResizerFrame.Active = true;
end;
v10.DisableResizable = function(v123)
    v123.GuiObjects.ChatResizerFrame.Active = false;
end;
v10.FadeOutBackground = function(v124, v125)
    v124.ChannelsBar:FadeOutBackground(v125);
    v124.MessageLogDisplay:FadeOutBackground(v125);
    v124.ChatBar:FadeOutBackground(v125);
    v124.AnimParams.Background_TargetTransparency = 1;
    v124.AnimParams.Background_NormalizedExptValue = l_CurveUtil_0:NormalizedDefaultExptValueInSeconds(v125);
end;
v10.FadeInBackground = function(v126, v127)
    v126.ChannelsBar:FadeInBackground(v127);
    v126.MessageLogDisplay:FadeInBackground(v127);
    v126.ChatBar:FadeInBackground(v127);
    v126.AnimParams.Background_TargetTransparency = 0.6;
    v126.AnimParams.Background_NormalizedExptValue = l_CurveUtil_0:NormalizedDefaultExptValueInSeconds(v127);
end;
v10.FadeOutText = function(v128, v129)
    v128.MessageLogDisplay:FadeOutText(v129);
    v128.ChannelsBar:FadeOutText(v129);
end;
v10.FadeInText = function(v130, v131)
    v130.MessageLogDisplay:FadeInText(v131);
    v130.ChannelsBar:FadeInText(v131);
end;
v10.AnimGuiObjects = function(v132)
    v132.GuiObjects.ChatChannelParentFrame.BackgroundTransparency = v132.AnimParams.Background_CurrentTransparency;
    v132.GuiObjects.ChatResizerFrame.BackgroundTransparency = v132.AnimParams.Background_CurrentTransparency;
    v132.GuiObjects.ResizeIcon.ImageTransparency = v132.AnimParams.Background_CurrentTransparency;
end;
v10.InitializeAnimParams = function(v133)
    v133.AnimParams.Background_TargetTransparency = 0.6;
    v133.AnimParams.Background_CurrentTransparency = 0.6;
    v133.AnimParams.Background_NormalizedExptValue = l_CurveUtil_0:NormalizedDefaultExptValueInSeconds(0);
end;
v10.Update = function(v134, v135)
    v134.ChatBar:Update(v135);
    v134.ChannelsBar:Update(v135);
    v134.MessageLogDisplay:Update(v135);
    v134.AnimParams.Background_CurrentTransparency = l_CurveUtil_0:Expt(v134.AnimParams.Background_CurrentTransparency, v134.AnimParams.Background_TargetTransparency, v134.AnimParams.Background_NormalizedExptValue, v135);
    v134:AnimGuiObjects();
end;
v0.new = function()
    local v136 = setmetatable({}, v10);
    v136.GuiObject = nil;
    v136.GuiObjects = {};
    v136.ChatBar = nil;
    v136.ChannelsBar = nil;
    v136.MessageLogDisplay = nil;
    v136.Channels = {};
    v136.CurrentChannel = nil;
    v136.Visible = true;
    v136.CoreGuiEnabled = true;
    v136.AnimParams = {};
    v136:InitializeAnimParams();
    return v136;
end;
return v0;


local l_Chat_0 = game:GetService("Chat");
local l_Players_0 = game:GetService("Players");
local l_StarterPlayerScripts_0 = game:GetService("StarterPlayer"):WaitForChild("StarterPlayerScripts");
local l_RobloxGui_0 = game:GetService("CoreGui"):WaitForChild("RobloxGui");
local v4 = require(l_RobloxGui_0.Modules.Common.Flags.FFlagEnableForkedChatAnalytics);
local v5 = require(l_RobloxGui_0.Modules.Server.ServerUtil);
local v6 = nil;
if v4 then
    v6 = require(l_RobloxGui_0.Modules.Server.SendChatAnalytics);
end;
local v7 = game:DefineFastFlag("ChatWindowInstallerCheckClassName", false);
local v8 = false;
local l_status_0, l_result_0 = pcall(function()
    return UserSettings():IsUserFeatureEnabled("UserIsChatTranslationEnabled2");
end);
v8 = l_status_0 and l_result_0;
l_status_0 = function(v11, v12, v13)
    local v14 = v11:WaitForChild(v12);
    if v7 and v14.ClassName ~= "ModuleScript" then
        return v14:Clone();
    else
        local l_LocalScript_0 = Instance.new("LocalScript");
        l_LocalScript_0.Name = v12;
        if not v5.getFFlagServerCoreScriptSourceCode() then
            l_LocalScript_0.Source = v14.Source;
        else
            l_LocalScript_0.Source = v5.getSourceForServerScript(v14);
        end;
        l_LocalScript_0.Parent = v13;
        return l_LocalScript_0;
    end;
end;
l_result_0 = function(v16, v17, v18)
    local v19 = v16:WaitForChild(v17);
    if v7 and v19.ClassName ~= "ModuleScript" then
        return v19:Clone();
    else
        local l_ModuleScript_0 = Instance.new("ModuleScript");
        l_ModuleScript_0.Name = v17;
        if not v5.getFFlagServerCoreScriptSourceCode() then
            l_ModuleScript_0.Source = v19.Source;
        else
            l_ModuleScript_0.Source = v5.getSourceForServerScript(v19);
        end;
        l_ModuleScript_0.Parent = v18;
        return l_ModuleScript_0;
    end;
end;
local function _(v21, v22, v23)
    local l_v21_FirstChild_0 = v21:FindFirstChild(v22);
    if not l_v21_FirstChild_0 or not l_v21_FirstChild_0:IsA("BoolValue") then
        return v23;
    else
        return l_v21_FirstChild_0.Value;
    end;
end;
return function()
    local v26 = {};
    local v27 = true;
    local l_ChatScript_0 = l_Chat_0:FindFirstChild("ChatScript");
    if l_ChatScript_0 then
        if v4 then
            v26.ChatScript = "True";
        end;
    else
        v27 = false;
        l_ChatScript_0 = l_status_0(script.Parent, "ChatScript", l_Chat_0);
        local v29 = l_result_0(script.Parent, "ChatMain", l_ChatScript_0);
        l_result_0(script.Parent, "ChannelsBar", v29);
        l_result_0(script.Parent, "ChatBar", v29);
        l_result_0(script.Parent, "ChatChannel", v29);
        l_result_0(script.Parent, "MessageLogDisplay", v29);
        l_result_0(script.Parent, "ChatWindow", v29);
        l_result_0(script.Parent, "MessageLabelCreator", v29);
        l_result_0(script.Parent, "CommandProcessor", v29);
        l_result_0(script.Parent, "ChannelsTab", v29);
        l_result_0(script.Parent.Parent.Parent.Common, "ObjectPool", v29);
        l_result_0(script.Parent, "MessageSender", v29);
        l_result_0(script.Parent, "CurveUtil", v29);
        if v8 then
            local l_BoolValue_0 = Instance.new("BoolValue");
            l_BoolValue_0.Name = "ChatTranslationEnabled";
            l_BoolValue_0.Value = false;
            l_BoolValue_0.Parent = v29;
        end;
    end;
    local v31 = true;
    local l_BubbleChat_0 = l_Chat_0:FindFirstChild("BubbleChat");
    if l_BubbleChat_0 then
        if v4 then
            v26.BubbleChat = "True";
        end;
    else
        v31 = false;
        l_BubbleChat_0 = l_status_0(script.Parent.BubbleChat, "BubbleChat", l_Chat_0);
    end;
    local l_ClientChatModules_0 = l_Chat_0:FindFirstChild("ClientChatModules");
    if l_ClientChatModules_0 then
        if v4 then
            v26.ClientChatModules = "True";
        end;
    else
        l_ClientChatModules_0 = Instance.new("Folder");
        l_ClientChatModules_0.Name = "ClientChatModules";
        l_ClientChatModules_0.Archivable = false;
        l_ClientChatModules_0.Parent = l_Chat_0;
    end;
    if l_ClientChatModules_0:FindFirstChild("ChatSettings") then
        if v4 then
            v26.ChatSettings = "True";
        end;
    else
        l_result_0(script.Parent.DefaultClientChatModules, "ChatSettings", l_ClientChatModules_0);
    end;
    if l_ClientChatModules_0:FindFirstChild("ChatConstants") then
        if v4 then
            v26.ChatConstants = "True";
        end;
    else
        l_result_0(script.Parent.DefaultClientChatModules, "ChatConstants", l_ClientChatModules_0);
    end;
    if l_ClientChatModules_0:FindFirstChild("ChatLocalization") then
        if v4 then
            v26.ChatLocalization = "True";
        end;
    else
        l_result_0(script.Parent.DefaultClientChatModules, "ChatLocalization", l_ClientChatModules_0);
    end;
    local l_MessageCreatorModules_0 = l_ClientChatModules_0:FindFirstChild("MessageCreatorModules");
    if not l_MessageCreatorModules_0 then
        l_MessageCreatorModules_0 = Instance.new("Folder");
        l_MessageCreatorModules_0.Name = "MessageCreatorModules";
        l_MessageCreatorModules_0.Archivable = false;
        local l_BoolValue_1 = Instance.new("BoolValue");
        l_BoolValue_1.Name = "InsertDefaultModules";
        l_BoolValue_1.Value = true;
        l_BoolValue_1.Parent = l_MessageCreatorModules_0;
        l_MessageCreatorModules_0.Parent = l_ClientChatModules_0;
    end;
    local l_InsertDefaultModules_0 = l_MessageCreatorModules_0:FindFirstChild("InsertDefaultModules");
    if not not l_InsertDefaultModules_0 and if l_InsertDefaultModules_0:IsA("BoolValue") then l_InsertDefaultModules_0.Value else false then
        local l_Children_0 = script.Parent.DefaultClientChatModules.MessageCreatorModules:GetChildren();
        for v38 = 1, #l_Children_0 do
            if l_MessageCreatorModules_0:FindFirstChild(l_Children_0[v38].Name) then
                if v4 then
                    v26[l_Children_0[v38].Name] = "True";
                end;
            else
                l_result_0(script.Parent.DefaultClientChatModules.MessageCreatorModules, l_Children_0[v38].Name, l_MessageCreatorModules_0);
            end;
        end;
    end;
    local l_CommandModules_0 = l_ClientChatModules_0:FindFirstChild("CommandModules");
    if not l_CommandModules_0 then
        l_CommandModules_0 = Instance.new("Folder");
        l_CommandModules_0.Name = "CommandModules";
        l_CommandModules_0.Archivable = false;
        l_InsertDefaultModules_0 = Instance.new("BoolValue");
        l_InsertDefaultModules_0.Name = "InsertDefaultModules";
        l_InsertDefaultModules_0.Value = true;
        l_InsertDefaultModules_0.Parent = l_CommandModules_0;
        l_CommandModules_0.Parent = l_ClientChatModules_0;
    end;
    local l_InsertDefaultModules_1 = l_CommandModules_0:FindFirstChild("InsertDefaultModules");
    if not not l_InsertDefaultModules_1 and if l_InsertDefaultModules_1:IsA("BoolValue") then l_InsertDefaultModules_1.Value else false then
        local l_Children_1 = script.Parent.DefaultClientChatModules.CommandModules:GetChildren();
        for v42 = 1, #l_Children_1 do
            if l_CommandModules_0:FindFirstChild(l_Children_1[v42].Name) then
                if v4 then
                    v26[l_Children_1[v42].Name] = "True";
                end;
            else
                l_result_0(script.Parent.DefaultClientChatModules.CommandModules, l_Children_1[v42].Name, l_CommandModules_0);
            end;
        end;
    end;
    if not l_StarterPlayerScripts_0:FindFirstChild("ChatScript") then
        local v43 = l_ChatScript_0:Clone();
        v43.Parent = l_StarterPlayerScripts_0;
        v43.Archivable = false;
        for _, v45 in pairs((l_Players_0:GetPlayers())) do
            if v45:FindFirstChildOfClass("PlayerGui") then
                local v46 = l_status_0(script.Parent, "ChatInstallVerifier", v45.PlayerGui);
                local l_StringValue_0 = Instance.new("StringValue");
                l_StringValue_0.Name = "ScriptToVerify";
                l_StringValue_0.Value = "ChatScript";
                l_StringValue_0.Parent = v46;
            end;
        end;
    end;
    l_ChatScript_0.Archivable = v27;
    if not l_StarterPlayerScripts_0:FindFirstChild("BubbleChat") then
        local v48 = l_BubbleChat_0:Clone();
        v48.Parent = l_StarterPlayerScripts_0;
        v48.Archivable = false;
        for _, v50 in pairs((l_Players_0:GetPlayers())) do
            if v50:FindFirstChildOfClass("PlayerGui") then
                local v51 = l_status_0(script.Parent, "ChatInstallVerifier", v50.PlayerGui);
                local l_StringValue_1 = Instance.new("StringValue");
                l_StringValue_1.Name = "ScriptToVerify";
                l_StringValue_1.Value = "BubbleChat";
                l_StringValue_1.Parent = v51;
            end;
        end;
    end;
    l_BubbleChat_0.Archivable = v31;
    if v4 then
        v6("LoadClientDefaultChatForkedModules", v26);
    end;
end;


local v0 = {};
local v1 = {};
v1.__index = v1;
local l_ClientChatModules_0 = game:GetService("Chat"):WaitForChild("ClientChatModules");
local l_CommandModules_0 = l_ClientChatModules_0:WaitForChild("CommandModules");
local l_Util_0 = require(l_CommandModules_0:WaitForChild("Util"));
local _ = script.Parent;
local l_ChatSettings_0 = require(l_ClientChatModules_0:WaitForChild("ChatSettings"));
v1.SetupCommandProcessors = function(v7)
    local l_l_CommandModules_0_Children_0 = l_CommandModules_0:GetChildren();
    for v9 = 1, #l_l_CommandModules_0_Children_0 do
        if l_l_CommandModules_0_Children_0[v9]:IsA("ModuleScript") and l_l_CommandModules_0_Children_0[v9].Name ~= "Util" then
            local v10 = require(l_l_CommandModules_0_Children_0[v9]);
            local v11 = v10[l_Util_0.KEY_COMMAND_PROCESSOR_TYPE];
            local v12 = v10[l_Util_0.KEY_PROCESSOR_FUNCTION];
            if v11 == l_Util_0.IN_PROGRESS_MESSAGE_PROCESSOR then
                table.insert(v7.InProgressMessageProcessors, v12);
            elseif v11 == l_Util_0.COMPLETED_MESSAGE_PROCESSOR then
                table.insert(v7.CompletedMessageProcessors, v12);
            end;
        end;
    end;
end;
v1.ProcessCompletedChatMessage = function(v13, v14, v15)
    for v16 = 1, #v13.CompletedMessageProcessors do
        if v13.CompletedMessageProcessors[v16](v14, v15, l_ChatSettings_0) then
            return true;
        end;
    end;
    return false;
end;
v1.ProcessInProgressChatMessage = function(v17, v18, v19, v20)
    for v21 = 1, #v17.InProgressMessageProcessors do
        local v22 = v17.InProgressMessageProcessors[v21](v18, v19, v20, l_ChatSettings_0);
        if v22 then
            return v22;
        end;
    end;
    return nil;
end;
v0.new = function()
    local v23 = setmetatable({}, v1);
    v23.CompletedMessageProcessors = {};
    v23.InProgressMessageProcessors = {};
    v23:SetupCommandProcessors();
    return v23;
end;
return v0;


local v0 = {};
v0.Expt = function(_, v2, v3, v4, v5)
    if math.abs(v3 - v2) < 0.01 then
        return v3;
    else
        return v2 + (v3 - v2) * v0:Expty(v2, v3, v4, v5);
    end;
end;
v0.Expty = function(_, _, _, v9, v10)
    return 1 - math.exp(- -math.log(1 - v9) * v10);
end;
v0.Sign = function(_, v12)
    if v12 > 0 then
        return 1;
    elseif v12 < 0 then
        return -1;
    else
        return 0;
    end;
end;
v0.BezierValForT = function(_, v14, v15, v16, v17, v18)
    return (((((1 - v18) * (1 - v18)) * (1 - v18)) * v14 + (((3 * v18) * (1 - v18)) * (1 - v18)) * v15) + (((3 * v18) * v18) * (1 - v18)) * v16) + ((v18 * v18) * v18) * v17;
end;
v0._BezierPt2ForT = {
    x = 0,
    y = 0
};
v0.BezierPt2ForT = function(_, v20, v21, v22, v23, v24, v25, v26, v27, v28)
    v0._BezierPt2ForT.x = v0:BezierValForT(v20, v22, v24, v26, v28);
    v0._BezierPt2ForT.y = v0:BezierValForT(v21, v23, v25, v27, v28);
    return v0._BezierPt2ForT;
end;
v0.YForPointOf2PtLine = function(_, v30, v31, v32)
    local v33 = (v30.y - v31.y) / (v30.x - v31.x);
    return v33 * v32 + (v30.y - v33 * v30.x);
end;
v0.DeltaTimeToTimescale = function(_, v35)
    return v35 / 0.016666666666666666;
end;
v0.SecondsToTick = function(_, v37)
    return 0.016666666666666666 / v37;
end;
v0.ExptValueInSeconds = function(_, v39, v40, v41)
    return 1 - math.pow(v39 / v40, 1 / (60 * v41));
end;
v0.NormalizedDefaultExptValueInSeconds = function(v42, v43)
    return v42:ExptValueInSeconds(0.01, 1, v43);
end;
return v0;


return {
    MessageTypeDefault = "Message",
    MessageTypeSystem = "System",
    MessageTypeMeCommand = "MeCommand",
    MessageTypeWelcome = "Welcome",
    MessageTypeSetCore = "SetCore",
    MessageTypeWhisper = "Whisper",
    MajorVersion = 0,
    MinorVersion = 8,
    BuildVersion = "2018.05.16",
    VeryLowPriority = -5,
    LowPriority = 0,
    StandardPriority = 10,
    HighPriority = 20,
    VeryHighPriority = 25,
    WhisperChannelPrefix = "To "
};


local l_LocalizationService_0 = game:GetService("LocalizationService");
local l_Chat_0 = game:GetService("Chat");
local v2 = {
    System = "InGame.Chat.Label.SystemMessagePrefix",
    Team = "InGame.Chat.Label.TeamMessagePrefix"
};
local v3 = {
    ["From(%s.+)"] = {
        English = "From",
        LocalizationKey = "InGame.Chat.Label.From"
    },
    ["To(%s.+)"] = {
        English = "To",
        LocalizationKey = "InGame.Chat.Label.To"
    }
};
return {
    _hasFetchedLocalization = false,
    _getTranslator = function(v4)
        if not (v4._translator or v4._hasFetchedLocalization) then
            v4._hasFetchedLocalization = true;
            local v5 = l_Chat_0:WaitForChild("ChatLocalization", 4);
            if not v5 then
                warn("Missing ChatLocalization. Chat interface will not be localized.");
            else
                v4._translator = v5:GetTranslator(l_LocalizationService_0.RobloxLocaleId);
                l_LocalizationService_0:GetPropertyChangedSignal("RobloxLocaleId"):Connect(function()
                    v4._hasFetchedLocalization = false;
                    v4._translator = nil;
                end);
            end;
        end;
        return v4._translator;
    end,
    Get = function(v6, v7, v8, v9)
        local l_v8_0 = v8;
        pcall(function()
            local v11 = v6:_getTranslator();
            if not v11 then
                warn("Missing Translator. Used default for", v7);
                return ;
            else
                l_v8_0 = v11:FormatByKey(v7, v9);
                return ;
            end;
        end);
        return l_v8_0;
    end,
    LocalizeFormattedMessage = function(v12, v13)
        local v14, v15 = string.find(v13, "{RBX_LOCALIZATION_KEY}");
        if v14 then
            local v16, v17 = string.find(v13, "{RBX_LOCALIZATION_DEFAULT}");
            if v16 then
                local v18, v19 = string.find(v13, "{RBX_LOCALIZATION_PARAMS}");
                local v20 = string.sub(v13, v15 + 1, v16 - 1);
                local v21 = nil;
                if v18 then
                    v21 = string.sub(v13, v17 + 1, v18 - 1);
                    local v22 = string.sub(v13, v19 + 1);
                    local v23 = {};
                    for v24, v25 in string.gmatch(v22, "([^%s]+)=([^%s]+)") do
                        v23[v24] = v25;
                    end;
                    return v12:Get(v20, v21, v23);
                else
                    return v12:Get(v20, (string.sub(v13, v17 + 1)));
                end;
            else
                return v13;
            end;
        else
            return v13;
        end;
    end,
    FormatMessageToSend = function(_, v27, v28, v29, v30)
        if not v29 or not v30 then
            return "{RBX_LOCALIZATION_KEY}" .. v27 .. "{RBX_LOCALIZATION_DEFAULT}" .. v28;
        else
            return "{RBX_LOCALIZATION_KEY}" .. v27 .. "{RBX_LOCALIZATION_DEFAULT}" .. v28 .. "{RBX_LOCALIZATION_PARAMS}" .. v29 .. "=" .. v30;
        end;
    end,
    tryLocalize = function(v31, v32)
        if not v2[v32] then
            for v33, v34 in pairs(v2) do
                if string.find(v32, v33) then
                    return string.gsub(v32, v33, v31:Get(v34, v33), 1);
                end;
            end;
            for v35, v36 in pairs(v3) do
                local v37 = string.find(v32, v35);
                local v38 = string.match(v32, v35);
                if not (not v37 or not v38) then
                    return if v37 > 1 then v32:sub(1, v37 - 1) else "" .. v31:Get(v36.LocalizationKey, v36.English) .. v38;
                end;
            end;
            return v32;
        else
            return v31:Get(v2[v32], v32);
        end;
    end
};


local l_Util_0 = require(script.Parent:WaitForChild("Util"));
ProcessMessage = function(v1, v2, _)
    if not (string.sub(v1, 1, 4):lower() ~= "/cls") or string.sub(v1, 1, 6):lower() == "/clear" then
        local l_v2_CurrentChannel_0 = v2:GetCurrentChannel();
        if l_v2_CurrentChannel_0 then
            l_v2_CurrentChannel_0:ClearMessageLog();
        end;
        return true;
    else
        return false;
    end;
end;
return {
    [l_Util_0.KEY_COMMAND_PROCESSOR_TYPE] = l_Util_0.COMPLETED_MESSAGE_PROCESSOR,
    [l_Util_0.KEY_PROCESSOR_FUNCTION] = ProcessMessage
};


local l_StarterGui_0 = game:GetService("StarterGui");
local l_Util_0 = require(script.Parent:WaitForChild("Util"));
ProcessMessage = function(v2, _, _)
    if not (string.sub(v2, 1, 8):lower() ~= "/console") or string.sub(v2, 1, 11):lower() == "/newconsole" then
        local l_status_0, l_result_0 = pcall(function()
            return l_StarterGui_0:GetCore("DevConsoleVisible");
        end);
        if l_status_0 then
            local l_status_1, l_result_1 = pcall(function()
                l_StarterGui_0:SetCore("DevConsoleVisible", not l_result_0);
            end);
            if not (l_status_1 or not l_result_1) then
                print("Error making developer console visible: " .. l_result_1);
            end;
        end;
        return true;
    else
        return false;
    end;
end;
return {
    [l_Util_0.KEY_COMMAND_PROCESSOR_TYPE] = l_Util_0.COMPLETED_MESSAGE_PROCESSOR,
    [l_Util_0.KEY_PROCESSOR_FUNCTION] = ProcessMessage
};


local l_Util_0 = require(script.Parent:WaitForChild("Util"));
local l_ChatConstants_0 = require(script.Parent.Parent:WaitForChild("ChatConstants"));
return {
    [l_Util_0.KEY_COMMAND_PROCESSOR_TYPE] = l_Util_0.COMPLETED_MESSAGE_PROCESSOR,
    [l_Util_0.KEY_PROCESSOR_FUNCTION] = function(v2, v3, _)
        if not (string.sub(v2, 1, 8):lower() ~= "/version") or string.sub(v2, 1, 9):lower() == "/version " then
            l_Util_0:SendSystemMessageToSelf(string.format("This experience is running chat version [%d.%d.%s].", l_ChatConstants_0.MajorVersion, l_ChatConstants_0.MinorVersion, l_ChatConstants_0.BuildVersion), v3:GetCurrentChannel(), {});
            return true;
        else
            return false;
        end;
    end
};


local l_Util_0 = require(script.Parent:WaitForChild("Util"));
local l_RunService_0 = game:GetService("RunService");
local v2 = nil;
pcall(function()
    v2 = require(game:GetService("Chat").ClientChatModules.ChatLocalization);
end);
if v2 == nil then
    v2 = {
        Get = function(_, _, v5)
            return v5;
        end
    };
end;
ProcessMessage = function(_, v7, _)
    local l_LocalPlayer_0 = game:GetService("Players").LocalPlayer;
    if not (l_LocalPlayer_0 and l_LocalPlayer_0.UserId < 0) or l_RunService_0:IsStudio() then
        return false;
    else
        local l_v7_CurrentChannel_0 = v7:GetCurrentChannel();
        if l_v7_CurrentChannel_0 then
            l_Util_0:SendSystemMessageToSelf(v2:Get("GameChat_SwallowGuestChat_Message", "Create a free account to get access to chat permissions"), l_v7_CurrentChannel_0, {});
        end;
        return true;
    end;
end;
return {
    [l_Util_0.KEY_COMMAND_PROCESSOR_TYPE] = l_Util_0.COMPLETED_MESSAGE_PROCESSOR,
    [l_Util_0.KEY_PROCESSOR_FUNCTION] = ProcessMessage
};


local l_Util_0 = require(script.Parent:WaitForChild("Util"));
local v1 = nil;
pcall(function()
    v1 = require(game:GetService("Chat").ClientChatModules.ChatLocalization);
end);
if v1 == nil then
    v1 = {
        Get = function(_, _, v4)
            return v4;
        end
    };
end;
ProcessMessage = function(v5, v6, v7)
    if string.sub(v5, 1, 3):lower() ~= "/c " then
        return false;
    else
        local v8 = string.sub(v5, 4);
        local l_v6_Channel_0 = v6:GetChannel(v8);
        if not l_v6_Channel_0 then
            local l_v6_CurrentChannel_0 = v6:GetCurrentChannel();
            if l_v6_CurrentChannel_0 then
                l_Util_0:SendSystemMessageToSelf(string.gsub(v1:Get("GameChat_SwitchChannel_NotInChannel", string.format("You are not in channel: '%s'", v8), {
                    RBX_NAME = v8
                }), "{RBX_NAME}", v8), l_v6_CurrentChannel_0, {
                    ChatColor = Color3.fromRGB(245, 50, 50)
                });
            end;
        else
            v6:SwitchCurrentChannel(v8);
            if not (v7.ShowChannelsBar or not v6:GetCurrentChannel()) then
                l_Util_0:SendSystemMessageToSelf(string.gsub(v1:Get("GameChat_SwitchChannel_NowInChannel", string.format("You are now chatting in channel: '%s'", v8), {
                    RBX_NAME = v8
                }), "{RBX_NAME}", v8), l_v6_Channel_0, {});
            end;
        end;
        return true;
    end;
end;
return {
    [l_Util_0.KEY_COMMAND_PROCESSOR_TYPE] = l_Util_0.COMPLETED_MESSAGE_PROCESSOR,
    [l_Util_0.KEY_PROCESSOR_FUNCTION] = ProcessMessage
};


local l_Players_0 = game:GetService("Players");
local v1 = {
    "/team ",
    "/t ",
    "% "
};
IsTeamCommand = function(v2)
    for v3 = 1, #v1 do
        local v4 = v1[v3];
        if string.sub(v2, 1, v4:len()):lower() == v4 then
            return true;
        end;
    end;
    return false;
end;
local v5 = {};
v5.__index = v5;
local l_Util_0 = require(script.Parent:WaitForChild("Util"));
local v7 = {};
v5.EnterTeamChat = function(v8)
    v8.TeamChatEntered = true;
    v8.MessageModeButton.Size = UDim2.new(0, 1000, 1, 0);
    v8.MessageModeButton.Text = "[Team]";
    v8.MessageModeButton.TextColor3 = v8:GetTeamChatColor();
    local l_X_0 = v8.MessageModeButton.TextBounds.X;
    v8.MessageModeButton.Size = UDim2.new(0, l_X_0, 1, 0);
    v8.TextBox.Size = UDim2.new(1, -l_X_0, 1, 0);
    v8.TextBox.Position = UDim2.new(0, l_X_0, 0, 0);
    v8.OriginalTeamText = v8.TextBox.Text;
    v8.TextBox.Text = " ";
end;
v5.TextUpdated = function(v10)
    local l_Text_0 = v10.TextBox.Text;
    if v10.TeamChatEntered then
        if l_Text_0 == "" then
            v10.MessageModeButton.Text = "";
            v10.MessageModeButton.Size = UDim2.new(0, 0, 0, 0);
            v10.TextBox.Size = UDim2.new(1, 0, 1, 0);
            v10.TextBox.Position = UDim2.new(0, 0, 0, 0);
            v10.TextBox.Text = "";
            v10.TeamChatEntered = false;
            v10.ChatBar:ResetCustomState();
            v10.ChatBar:CaptureFocus();
        end;
    elseif IsTeamCommand(l_Text_0) then
        v10:EnterTeamChat();
        return ;
    end;
end;
v5.GetMessage = function(v12)
    if not v12.TeamChatEntered then
        return v12.TextBox.Text;
    else
        return "/t " .. v12.TextBox.Text;
    end;
end;
v5.ProcessCompletedMessage = function(_)
    return false;
end;
v5.Destroy = function(v14)
    v14.MessageModeConnection:disconnect();
    v14.Destroyed = true;
end;
v5.GetTeamChatColor = function(v15)
    local l_LocalPlayer_0 = l_Players_0.LocalPlayer;
    if not l_LocalPlayer_0.Team then
        if not v15.ChatSettings.DefaultChannelNameColor then
            return Color3.fromRGB(35, 76, 142);
        else
            return v15.ChatSettings.DefaultChannelNameColor;
        end;
    else
        return l_LocalPlayer_0.Team.TeamColor.Color;
    end;
end;
v7.new = function(v17, v18, v19)
    local v20 = setmetatable({}, v5);
    v20.Destroyed = false;
    v20.ChatWindow = v17;
    v20.ChatBar = v18;
    v20.ChatSettings = v19;
    v20.TextBox = v18:GetTextBox();
    v20.MessageModeButton = v18:GetMessageModeTextButton();
    v20.OriginalTeamText = "";
    v20.TeamChatEntered = false;
    v20.MessageModeConnection = v20.MessageModeButton.MouseButton1Click:connect(function()
        local l_Text_1 = v20.TextBox.Text;
        if string.sub(l_Text_1, 1, 1) == " " then
            l_Text_1 = string.sub(l_Text_1, 2);
        end;
        v20.ChatBar:ResetCustomState();
        v20.ChatBar:SetTextBoxText(l_Text_1);
        v20.ChatBar:CaptureFocus();
    end);
    v20:EnterTeamChat();
    return v20;
end;
ProcessMessage = function(v22, v23, v24, v25)
    if v24.TargetChannel == "Team" then
        return ;
    elseif not IsTeamCommand(v22) then
        return nil;
    else
        return v7.new(v23, v24, v25);
    end;
end;
return {
    [l_Util_0.KEY_COMMAND_PROCESSOR_TYPE] = l_Util_0.IN_PROGRESS_MESSAGE_PROCESSOR,
    [l_Util_0.KEY_PROCESSOR_FUNCTION] = ProcessMessage
};


local l_ChatConstants_0 = require(script.Parent.Parent:WaitForChild("ChatConstants"));
local v1 = {};
local v2 = {};
v2.__index = v2;
v2.SendSystemMessageToSelf = function(_, v4, v5, v6)
    v5:AddMessageToChannel({
        ID = -1,
        FromSpeaker = nil,
        SpeakerUserId = 0,
        OriginalChannel = v5.Name,
        IsFiltered = true,
        MessageLength = string.len(v4),
        MessageLengthUtf8 = utf8.len(utf8.nfcnormalize(v4)),
        Message = v4,
        MessageType = l_ChatConstants_0.MessageTypeSystem,
        Time = os.time(),
        ExtraData = v6
    });
end;
v1.new = function()
    local v7 = setmetatable({}, v2);
    v7.COMMAND_MODULES_VERSION = 1;
    v7.KEY_COMMAND_PROCESSOR_TYPE = "ProcessorType";
    v7.KEY_PROCESSOR_FUNCTION = "ProcessorFunction";
    v7.IN_PROGRESS_MESSAGE_PROCESSOR = 0;
    v7.COMPLETED_MESSAGE_PROCESSOR = 1;
    return v7;
end;
return v1.new();


local v0 = false;
local l_status_0, l_result_0 = pcall(function()
    return UserSettings():IsUserFeatureEnabled("UserIsChatTranslationEnabled2");
end);
v0 = l_status_0 and l_result_0;
l_status_0 = game:GetService("Players");
l_result_0 = script.Parent.Parent;
local l_ChatSettings_0 = require(l_result_0:WaitForChild("ChatSettings"));
local l_ChatConstants_0 = require(l_result_0:WaitForChild("ChatConstants"));
local l_Util_0 = require(script.Parent:WaitForChild("Util"));
local v6 = utf8.char(57344);
IsPlayerVerified = function(v7)
    local l_l_status_0_PlayerByUserId_0 = l_status_0:GetPlayerByUserId(v7);
    if l_l_status_0_PlayerByUserId_0 then
        local l_status_1, l_result_1 = pcall(function()
            return l_l_status_0_PlayerByUserId_0.HasVerifiedBadge;
        end);
        if not l_status_1 then
            return false;
        else
            return l_result_1;
        end;
    else
        return false;
    end;
end;
AppendVerifiedBadge = function(v11)
    return v11 .. v6;
end;
CreateMessageLabel = function(v12, v13, v14)
    local l_FromSpeaker_0 = v12.FromSpeaker;
    local v16 = nil;
    v16 = if not not l_ChatSettings_0.PlayerDisplayNamesEnabled and v12.SpeakerDisplayName then v12.SpeakerDisplayName else l_FromSpeaker_0;
    if IsPlayerVerified(v12.SpeakerUserId) then
        v16 = AppendVerifiedBadge(v16);
    end;
    local _ = v12.Message;
    local v18 = v12.ExtraData or {};
    local v19 = v18.Font or l_ChatSettings_0.DefaultFont;
    local v20 = v18.TextSize or l_ChatSettings_0.ChatWindowTextSize;
    local v21 = v18.NameColor or l_ChatSettings_0.DefaultNameColor;
    local v22 = v18.ChatColor or l_ChatSettings_0.DefaultMessageColor;
    local v23 = v18.ChannelColor or v22;
    local v24 = v18.Tags or {};
    local v25 = string.format("[%s]:", v16);
    local _ = l_Util_0:GetStringTextBounds(v25, v19, v20);
    local v27 = l_Util_0:GetNumberOfSpaces(v25, v19, v20) + 1;
    local l_l_Util_0_BaseMessage_0, v29 = l_Util_0:CreateBaseMessage("", v19, v20, v22);
    local v30 = l_Util_0:AddNameButtonToBaseMessage(v29, v21, v25, l_FromSpeaker_0);
    local v31 = nil;
    local v32 = UDim2.new(0, 0, 0, 0);
    if v13 ~= v12.OriginalChannel then
        local v33 = string.format("{%s}", v12.OriginalChannel);
        v31 = l_Util_0:AddChannelButtonToBaseMessage(v29, v23, v33, v12.OriginalChannel);
        v32 = UDim2.new(0, v31.Size.X.Offset + l_Util_0:GetStringTextBounds(" ", v19, v20).X, 0, 0);
        v27 = (v27 + l_Util_0:GetNumberOfSpaces(v33, v19, v20)) + 1;
    end;
    local v34 = {};
    for _, v36 in pairs(v24) do
        local v37 = v36.TagColor or Color3.fromRGB(255, 0, 255);
        local v38 = string.format("[%s] ", v36.TagText or "???");
        local v39 = l_Util_0:AddTagLabelToBaseMessage(v29, v37, v38);
        v39.Position = v32;
        v27 = v27 + l_Util_0:GetNumberOfSpaces(v38, v19, v20);
        v32 = v32 + UDim2.new(0, v39.Size.X.Offset, 0, 0);
        table.insert(v34, v39);
    end;
    v30.Position = v32;
    local v40 = false;
    local v41 = nil;
    if v0 then
        pcall(function()
            v41 = l_Util_0:AddTranslationButtonToBaseMessage(v29);
            v32 = v32 + UDim2.new(0, v30.Size.X.Offset + 2, 0, 0);
            v41.Position = v32;
        end);
    end;
    local function v43(v42)
        v40 = false;
        if not v12.IsFiltered then
            v29.Text = l_Util_0:CreateLeadingSpaces(v27) .. string.rep("_", v42.MessageLengthUtf8 or v42.MessageLength);
            return ;
        else
            v29.Text = l_Util_0:CreateLeadingSpaces(v27) .. l_Util_0:SanitizeForRichText(v42.Message);
            return ;
        end;
    end;
    local function _(v44)
        if v41 == nil then
            return ;
        else
            if v41.Visible == false then
                v27 = v27 + 6;
            end;
            v41.Visible = true;
            v40 = true;
            if v44.TranslatedMessage == "" then
                v43(v44);
                return ;
            else
                v29.Text = l_Util_0:CreateLeadingSpaces(v27) .. l_Util_0:SanitizeForRichText(v44.TranslatedMessage);
                return ;
            end;
        end;
    end;
    local function _(v46)
        v12.TranslatedMessage = v46.TranslatedMessage;
        if not v46.TranslatedMessage then
            v43(v46);
            return ;
        elseif v41 == nil then
            return ;
        else
            if v41.Visible == false then
                v27 = v27 + 6;
            end;
            v41.Visible = true;
            v40 = true;
            if v46.TranslatedMessage == "" then
                v43(v46);
                return ;
            else
                v29.Text = l_Util_0:CreateLeadingSpaces(v27) .. l_Util_0:SanitizeForRichText(v46.TranslatedMessage);
                return ;
            end;
        end;
    end;
    local function v49(v48)
        if not v0 then
            if not v12.IsFiltered then
                v29.Text = l_Util_0:CreateLeadingSpaces(v27) .. string.rep("_", v48.MessageLengthUtf8 or v48.MessageLength);
                return ;
            else
                v29.Text = l_Util_0:CreateLeadingSpaces(v27) .. l_Util_0:SanitizeForRichText(v48.Message);
                return ;
            end;
        else
            v12.TranslatedMessage = v48.TranslatedMessage;
            if not v48.TranslatedMessage then
                v43(v48);
                return ;
            elseif v41 == nil then
                return ;
            else
                if v41.Visible == false then
                    v27 = v27 + 6;
                end;
                v41.Visible = true;
                v40 = true;
                if v48.TranslatedMessage == "" then
                    v43(v48);
                    return ;
                else
                    v29.Text = l_Util_0:CreateLeadingSpaces(v27) .. l_Util_0:SanitizeForRichText(v48.TranslatedMessage);
                    return ;
                end;
            end;
        end;
    end;
    local function _()
        if v40 or not v12.TranslatedMessage then
            v43(v12);
        else
            local l_v12_0 = v12;
            if not (v41 == nil) then
                if v41.Visible == false then
                    v27 = v27 + 6;
                end;
                v41.Visible = true;
                v40 = true;
                if l_v12_0.TranslatedMessage == "" then
                    v43(l_v12_0);
                else
                    v29.Text = l_Util_0:CreateLeadingSpaces(v27) .. l_Util_0:SanitizeForRichText(l_v12_0.TranslatedMessage);
                end;
            end;
        end;
        if v14 then
            v14();
        end;
    end;
    if v0 and v41 ~= nil then
        local v53 = v41.MouseButton1Click:connect(function()
            if v40 or not v12.TranslatedMessage then
                v43(v12);
            else
                local l_v12_1 = v12;
                if not (v41 == nil) then
                    if v41.Visible == false then
                        v27 = v27 + 6;
                    end;
                    v41.Visible = true;
                    v40 = true;
                    if l_v12_1.TranslatedMessage == "" then
                        v43(l_v12_1);
                    else
                        v29.Text = l_Util_0:CreateLeadingSpaces(v27) .. l_Util_0:SanitizeForRichText(l_v12_1.TranslatedMessage);
                    end;
                end;
            end;
            if v14 then
                v14();
            end;
        end);
        local v54 = nil;
        local l_v53_0 = v53 --[[ copy: 30 -> 38 ]];
        do
            local l_v54_0 = v54;
            l_v54_0 = v41.Changed:connect(function(v57)
                if v57 == "Parent" then
                    l_v53_0:Disconnect();
                    l_v54_0:Disconnect();
                end;
            end);
        end;
    end;
    v49(v12);
    local function v59(v58)
        return l_Util_0:GetMessageHeight(v29, l_l_Util_0_BaseMessage_0, v58);
    end;
    local v60 = {
        [v30] = {
            TextTransparency = {
                FadedIn = 0,
                FadedOut = 1
            },
            TextStrokeTransparency = {
                FadedIn = 0.75,
                FadedOut = 1
            }
        }
    };
    if v0 and v41 ~= nil then
        v60[v41] = {
            ImageTransparency = {
                FadedIn = 0,
                FadedOut = 1
            }
        };
    end;
    v60[v29] = {
        TextTransparency = {
            FadedIn = 0,
            FadedOut = 1
        },
        TextStrokeTransparency = {
            FadedIn = 0.75,
            FadedOut = 1
        }
    };
    for v61, v62 in pairs(v34) do
        local _ = string.format("Tag%d", v61);
        v60[v62] = {
            TextTransparency = {
                FadedIn = 0,
                FadedOut = 1
            },
            TextStrokeTransparency = {
                FadedIn = 0.75,
                FadedOut = 1
            }
        };
    end;
    if v31 then
        v60[v31] = {
            TextTransparency = {
                FadedIn = 0,
                FadedOut = 1
            },
            TextStrokeTransparency = {
                FadedIn = 0.75,
                FadedOut = 1
            }
        };
    end;
    local l_l_Util_0_FadeFunctions_0, v65, v66 = l_Util_0:CreateFadeFunctions(v60);
    return {
        [l_Util_0.KEY_BASE_FRAME] = l_l_Util_0_BaseMessage_0,
        [l_Util_0.KEY_BASE_MESSAGE] = v29,
        [l_Util_0.KEY_UPDATE_TEXT_FUNC] = v49,
        [l_Util_0.KEY_GET_HEIGHT] = v59,
        [l_Util_0.KEY_FADE_IN] = l_l_Util_0_FadeFunctions_0,
        [l_Util_0.KEY_FADE_OUT] = v65,
        [l_Util_0.KEY_UPDATE_ANIMATION] = v66
    };
end;
return {
    [l_Util_0.KEY_MESSAGE_TYPE] = l_ChatConstants_0.MessageTypeDefault,
    [l_Util_0.KEY_CREATOR_FUNCTION] = CreateMessageLabel
};


local l_Parent_0 = script.Parent.Parent;
local l_ChatSettings_0 = require(l_Parent_0:WaitForChild("ChatSettings"));
local l_ChatConstants_0 = require(l_Parent_0:WaitForChild("ChatConstants"));
local l_Util_0 = require(script.Parent:WaitForChild("Util"));
CreateMeCommandMessageLabel = function(v4, v5)
    local _ = v4.Message;
    local v7 = v4.ExtraData or {};
    local v8 = v7.Font or Enum.Font.SourceSansItalic;
    local v9 = v7.TextSize or l_ChatSettings_0.ChatWindowTextSize;
    local v10 = Color3.new(1, 1, 1);
    local v11 = v7.ChannelColor or v10;
    local v12 = 0;
    local l_l_Util_0_BaseMessage_0, v14 = l_Util_0:CreateBaseMessage("", v8, v9, v10);
    local v15 = nil;
    if v5 ~= v4.OriginalChannel then
        local v16 = string.format("{%s}", v4.OriginalChannel);
        v15 = l_Util_0:AddChannelButtonToBaseMessage(v14, v11, v16, v4.OriginalChannel);
        v12 = l_Util_0:GetNumberOfSpaces(v16, v8, v9) + 1;
    end;
    local function v18(v17)
        if not v4.IsFiltered then
            v14.Text = l_Util_0:CreateLeadingSpaces(v12) .. string.rep("_", (utf8.len(utf8.nfcnormalize(v17.FromSpeaker)) + (v17.MessageLengthUtf8 or v17.MessageLength)) - 4);
            return ;
        else
            v14.Text = l_Util_0:CreateLeadingSpaces(v12) .. l_Util_0:SanitizeForRichText(v17.FromSpeaker .. " " .. string.sub(v17.Message, 5));
            return ;
        end;
    end;
    v18(v4);
    local function v20(v19)
        return l_Util_0:GetMessageHeight(v14, l_l_Util_0_BaseMessage_0, v19);
    end;
    local v21 = {
        [v14] = {
            TextTransparency = {
                FadedIn = 0,
                FadedOut = 1
            },
            TextStrokeTransparency = {
                FadedIn = 0.75,
                FadedOut = 1
            }
        }
    };
    if v15 then
        v21[v15] = {
            TextTransparency = {
                FadedIn = 0,
                FadedOut = 1
            },
            TextStrokeTransparency = {
                FadedIn = 0.75,
                FadedOut = 1
            }
        };
    end;
    local l_l_Util_0_FadeFunctions_0, v23, v24 = l_Util_0:CreateFadeFunctions(v21);
    return {
        [l_Util_0.KEY_BASE_FRAME] = l_l_Util_0_BaseMessage_0,
        [l_Util_0.KEY_BASE_MESSAGE] = v14,
        [l_Util_0.KEY_UPDATE_TEXT_FUNC] = v18,
        [l_Util_0.KEY_GET_HEIGHT] = v20,
        [l_Util_0.KEY_FADE_IN] = l_l_Util_0_FadeFunctions_0,
        [l_Util_0.KEY_FADE_OUT] = v23,
        [l_Util_0.KEY_UPDATE_ANIMATION] = v24
    };
end;
return {
    [l_Util_0.KEY_MESSAGE_TYPE] = l_ChatConstants_0.MessageTypeMeCommand,
    [l_Util_0.KEY_CREATOR_FUNCTION] = CreateMeCommandMessageLabel
};


local l_Parent_0 = script.Parent.Parent;
local l_ChatSettings_0 = require(l_Parent_0:WaitForChild("ChatSettings"));
local l_ChatConstants_0 = require(l_Parent_0:WaitForChild("ChatConstants"));
local l_Util_0 = require(script.Parent:WaitForChild("Util"));
CreateSetCoreMessageLabel = function(v4, _)
    local l_Message_0 = v4.Message;
    local v7 = v4.ExtraData or {};
    local l_l_Util_0_BaseMessage_0, v9 = l_Util_0:CreateBaseMessage(l_Message_0, v7.Font or l_ChatSettings_0.DefaultFont, v7.TextSize or l_ChatSettings_0.ChatWindowTextSize, v7.Color or l_ChatSettings_0.DefaultMessageColor);
    local function v11(v10)
        return l_Util_0:GetMessageHeight(v9, l_l_Util_0_BaseMessage_0, v10);
    end;
    local l_l_Util_0_FadeFunctions_0, v13, v14 = l_Util_0:CreateFadeFunctions({
        [v9] = {
            TextTransparency = {
                FadedIn = 0,
                FadedOut = 1
            },
            TextStrokeTransparency = {
                FadedIn = 0.75,
                FadedOut = 1
            }
        }
    });
    return {
        [l_Util_0.KEY_BASE_FRAME] = l_l_Util_0_BaseMessage_0,
        [l_Util_0.KEY_BASE_MESSAGE] = v9,
        [l_Util_0.KEY_UPDATE_TEXT_FUNC] = nil,
        [l_Util_0.KEY_GET_HEIGHT] = v11,
        [l_Util_0.KEY_FADE_IN] = l_l_Util_0_FadeFunctions_0,
        [l_Util_0.KEY_FADE_OUT] = v13,
        [l_Util_0.KEY_UPDATE_ANIMATION] = v14
    };
end;
return {
    [l_Util_0.KEY_MESSAGE_TYPE] = l_ChatConstants_0.MessageTypeSetCore,
    [l_Util_0.KEY_CREATOR_FUNCTION] = CreateSetCoreMessageLabel
};