local l_CorePackages_0 = game:GetService("CorePackages");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AppChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local v3 = require(l_script_FirstAncestor_0.EnumScreens);
local v4 = require(l_Parent_0.ArgCheck);
local v5 = require(l_Parent_0.Roact);
local v6 = require(l_Parent_0.RoactNavigation);
local v7 = require(l_Parent_0.UIBlox);
local l_Images_0 = v7.App.ImageSet.Images;
local l_IconButton_0 = v7.App.Button.IconButton;
local v10 = require(script.Parent.Utils.readingMessagesIsEnabled);
local v11 = require(script.Parent.ChatConversationContainer);
local v12 = require(script.Parent.Logger);
local v13 = require(l_script_FirstAncestor_0.LegacyAnalytics.withRoactChatAnalytics);
local v14 = require(l_script_FirstAncestor_0.Analytics.EventNames);
local l_SquadJoinButton_0 = require(l_Parent_0.Squads).SquadJoinButton;
local l_GetFFlagLuaAppEnableSquadPage_0 = require(l_CorePackages_0.Workspace.Packages.SharedFlags).GetFFlagLuaAppEnableSquadPage;
local l_GetFFlagLuaAppEnableSquadNewDesign_0 = require(l_CorePackages_0.Workspace.Packages.SharedFlags).GetFFlagLuaAppEnableSquadNewDesign;
local v18 = v5.PureComponent:extend("ChatConversationScreen");
v18.defaultProps = {
    navigation = nil
};
v18.navigationOptions = function(v19)
    local l_navigation_0 = v19.navigation;
    local v21 = nil;
    if l_GetFFlagLuaAppEnableSquadPage_0() then
        local v22 = l_navigation_0.getParam("conversationId", nil);
        if not v22 then
            v22 = nil;
        else
            v22 = tostring(v22);
        end;
        do
            local l_v22_0 = v22;
            local function v24()
                if l_v22_0 then
                    l_navigation_0.getScreenProps("navigateToLuaAppPages", {})[v3.SquadLobby](l_v22_0);
                end;
            end;
            if not l_GetFFlagLuaAppEnableSquadNewDesign_0() then
                v21 = v5.createElement(l_IconButton_0, {
                    layoutOrder = 1,
                    size = UDim2.fromOffset(0, 0),
                    icon = l_Images_0["icons/actions/friends/friendsplaying"],
                    isDisabled = not l_v22_0,
                    onActivated = v24
                });
            elseif l_v22_0 then
                v21 = v5.createElement(l_SquadJoinButton_0, {
                    conversationId = l_v22_0,
                    onActivated = v24
                });
            end;
        end;
    end;
    return {
        renderRight = function()
            return v13(function(v25)
                return v5.createFragment({
                    groupUp = v21,
                    chatDetails = v5.createElement(l_IconButton_0, {
                        layoutOrder = 2,
                        size = UDim2.fromOffset(0, 0),
                        icon = l_Images_0["icons/actions/info"],
                        onActivated = function()
                            local v26 = l_navigation_0.getParam("conversationId", nil);
                            v26 = not not v26 and tostring(v26) or nil;
                            v12:info("Navigate To ChatDetails: {} from {screen}", v26);
                            l_navigation_0.navigate(v3.ChatDetails, {
                                conversationId = v26
                            });
                            if v25 then
                                v25.fireAnalyticsEvent(v14.ConversationInfoBtnClicked, {
                                    conversationId = v26
                                });
                            end;
                        end
                    })
                });
            end);
        end
    };
end;
v18.init = function(v27)
    v27.toastProps = nil;
    v27.inputBoxRef = v5.createRef();
    v27.queueNavigationToToast = function(v28)
        if not v27.props.navigation.isFocused() then
            v27.toastProps = v28;
            return ;
        else
            v27.navigateToToast(v28);
            v27.toastProps = nil;
            return ;
        end;
    end;
    v27.onDidFocus = function()
        v27.setInputBarCloseCallback(v27.releaseFocus);
        if v27.toastProps then
            v27.navigateToToast(v27.toastProps);
            v27.toastProps = nil;
        end;
    end;
    v27.releaseFocus = function()
        if not (not v27.inputBoxRef or not v27.inputBoxRef:getValue()) then
            v27.inputBoxRef:getValue():ReleaseFocus();
        end;
    end;
    v27.onWillBlur = function()
        v27.releaseFocus();
        v27.setInputBarCloseCallback();
    end;
    v27.navigateToToast = function(v29)
        v12:info("Navigate To Toast from {screen}");
        v27.props.navigation.navigate(v3.RoactChatToast, v29);
    end;
    v27.openViewProfile = function(v30)
        local v31 = v27.props.navigation.getScreenProps("navigateToLuaAppPages", {})[v3.ViewUserProfile];
        if not v31 then
            v12:warning("UserProfile page was not set in navigateToLuaAppPages screenProps");
            return ;
        else
            v12:info("Navigate To UserProfile from {screen}");
            v31(v30, {});
            return ;
        end;
    end;
    v27.openGameDetailsPage = function(v32, v33)
        local v34 = v27.props.navigation.getScreenProps("navigateToLuaAppPages", {})[v3.GameDetail];
        if not v34 then
            v12:warning("GameDetail page was not set in navigateToLuaAppPages screenProps");
            return ;
        else
            v12:info("Navigate To GameDetail from " .. tostring(v33));
            v34(v32, v33);
            return ;
        end;
    end;
    v27.navigateToChatConversation = function(v35)
        v12:info("Navigate To Conversation: {} from {screen}", v35);
        v27.props.navigation.navigate(v3.ChatConversation, {
            conversationId = v35
        });
    end;
    v27.navigateBack = function()
        if v27.props.navigation.isFocused() then
            v27.props.navigation.goBack();
        end;
    end;
    v27.updateConversationTitle = function(v36)
        local v37 = v27.props.navigation.getScreenProps("setScreenTopBar", nil);
        v4.isNotNil(v37, "setScreenTopBar in screenProps");
        v37(v3.ChatConversation, {
            headerText = if not v36 then {
                raw = "CommonUI.Features.Label.Chat",
                shouldLocalize = true
            } else {
                raw = v36,
                shouldLocalize = false
            }
        });
    end;
    v27.setInputBarCloseCallback = function(v38)
        local v39 = v27.props.navigation.getScreenProps("setScreenTopBar", nil);
        v4.isNotNil(v39, "setScreenTopBar in screenProps");
        v39(v3.ChatLanding, {
            closeInputBar = v38
        });
    end;
    v27.getReadingMessagesIsEnabled = function()
        return v10(v27.props.navigation);
    end;
    v27.updatePrivateConversationTopBar = function(v40)
        local v41 = v27.props.navigation.getScreenProps("setScreenTopBar", nil);
        v4.isNotNil(v41, "setScreenTopBar in screenProps");
        v41(v3.ChatConversation, {
            isPrivateConversation = v40
        });
    end;
end;
v18.render = function(v42)
    local v43 = v4.isNotNil(v42.props.navigation, "navigation in ChatConversationScreen");
    local v44 = v5.createElement(v6.NavigationEvents, {
        onDidFocus = v42.onDidFocus,
        onWillBlur = v42.onWillBlur
    });
    local v45 = v43.getParam("conversationId", nil);
    return v5.createElement("Frame", {
        Size = UDim2.new(1, 0, 1, 0),
        BackgroundTransparency = 1
    }, {
        container = v5.createElement(v11, {
            topBarHeight = v43.getScreenProps("topBarHeight", 0),
            wideMode = v43.getScreenProps("wideMode", false),
            openGameDetailsPage = v42.openGameDetailsPage,
            getReadingMessagesIsEnabled = v42.getReadingMessagesIsEnabled,
            conversationId = not not v45 and tostring(v45) or nil,
            inputBoxRef = v42.inputBoxRef,
            updateConversationTitle = v42.updateConversationTitle,
            updatePrivateConversationTopBar = v42.updatePrivateConversationTopBar,
            navigateBack = v42.navigateBack,
            navigateToToast = v42.queueNavigationToToast,
            openViewProfile = v42.openViewProfile,
            navigateToChatConversation = v42.navigateToChatConversation
        }),
        eventsAdapter = v44
    });
end;
v18.didMount = function(_)
    v12:info("{screen} mounted");
end;
return v18;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AppChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local v2 = require(l_script_FirstAncestor_0.SocialLibraries);
local v3 = require(l_Parent_0.Roact);
local l_Text_0 = require(l_Parent_0.AppCommonLib).Text;
local v5 = require(l_Parent_0.UIBlox);
local l_Images_0 = v5.App.ImageSet.Images;
local l_IconSize_0 = v5.App.Constant.IconSize;
local l_withStyle_0 = v5.Style.withStyle;
local v9 = require(script.Parent.isMessageValid);
local v10 = require(l_script_FirstAncestor_0.Components.ChatConversation.Utils.isKeyCodePressed);
local v11 = require(l_script_FirstAncestor_0.Flags.isAppChatFriendsSourceEnabled);
local l_ImageSetLabel_0 = v5.Core.ImageSet.ImageSetLabel;
local l_UserInputService_0 = game:GetService("UserInputService");
local v14 = Color3.fromRGB(184, 184, 184);
local v15 = Color3.fromRGB(0, 162, 255);
local l_CallbackInputBox_0 = v2.Components.CallbackInputBox;
local v17 = require(l_script_FirstAncestor_0.Analytics.Enums.SendButtonClickActionResult);
local v18 = v3.PureComponent:extend("ChatInputBar");
v18.defaultProps = {
    userInputService = l_UserInputService_0,
    initialInputText = "",
    placeholderText = "Say something",
    sendButtonContainerSize = 45,
    LayoutOrder = 0,
    maxCharacterLength = 160,
    messageListRef = nil,
    onHeightChanged = function()
    end,
    onPositionChanged = function()
    end,
    onFocusLost = function()
    end,
    onSendBtnClicked = nil,
    onSendChat = nil,
    onTextChanged = function()
    end,
    inputBoxRef = nil
};
v18.init = function(v19)
    v19.isMounted = false;
    v19.state = {
        inputText = v19.props.initialInputText,
        showSendChat = false,
        chatBarWidth = 0,
        frameHeight = 0
    };
    v19.inputBoxRef = v19.props.inputBoxRef or v3.createRef();
    v19.messageListRef = v19.props.messageListRef;
    v19.heightOfFourLines = function(v20, v21, v22)
        return l_Text_0.GetTextHeight("A\nB\nC\nD", v20, v21, v22);
    end;
    v19.calculateInputBoxHeight = function(v23, v24, v25, v26)
        local v27 = v25 + math.min(l_Text_0.GetTextHeight(v23, v24, v25, v26), (v19.heightOfFourLines(v24, v25, v26)));
        if v19.props.onHeightChanged then
            v19.props.onHeightChanged(v27);
        end;
        return v27;
    end;
    v19.onTextChanged = function(v28, v29, v30, v31)
        if v19.isMounted then
            local v32 = false;
            if not (not v28 or not v9(v28, v19.props.maxCharacterLength)) then
                v32 = true;
            end;
            v19:setState({
                inputText = v28,
                showSendChat = v32,
                frameHeight = v19.calculateInputBoxHeight(v28, v29, v30, v31)
            });
            v19.props.onTextChanged(v28);
            return ;
        else
            return ;
        end;
    end;
    v19.inputConnection = nil;
    v19.onInputEvent = function(v33)
        if not (not v10({
            v33
        }, Enum.KeyCode.Return, Enum.KeyCode.KeypadEnter) or v10(v19.props.userInputService:GetKeysPressed(), Enum.KeyCode.LeftShift, Enum.KeyCode.RightShift)) then
            v19.onSendActivated();
        end;
    end;
    v19.focusChanged = function(v34)
        if not v34 or v19.inputConnection then
            if not (v34 or not v19.inputConnection) then
                v19.inputConnection:Disconnect();
                v19.inputConnection = nil;
                v19.props.onFocusLost();
            end;
            return ;
        else
            v19.inputConnection = v19.props.userInputService.InputBegan:Connect(v19.onInputEvent);
            return ;
        end;
    end;
    v19.onSendActivated = function()
        local v35 = l_Text_0.Trim(v19.state.inputText);
        local l_None_0 = v17.None;
        if not v19.state.showSendChat or not v9(v35, v19.props.maxCharacterLength) then
            l_None_0 = if v19.state.showSendChat then v17.MessageInvalid else v17.ButtonInactive;
        else
            if v11() then
                v19.inputBoxRef:getValue().Text = "";
                v19:setState({
                    inputText = "",
                    showSendChat = false
                });
            end;
            if v19.props.onSendChat then
                if v35 == "/shrug" then
                    v19.props.onSendChat("\194\175\\_(\227\131\132)_/\194\175");
                else
                    v19.props.onSendChat(v35);
                end;
                l_None_0 = v17.WillSend;
            end;
            local v37 = (v19.messageListRef and v19.messageListRef.current) and v19.messageListRef.current._listRef;
            if v37 then
                v37:scrollToOffset({
                    offset = 0
                });
            end;
            if not v11() then
                v19.inputBoxRef:getValue().Text = "";
                v19:setState({
                    inputText = "",
                    showSendChat = false
                });
            end;
        end;
        if v19.props.onSendBtnClicked then
            v19.props.onSendBtnClicked(l_None_0);
        end;
    end;
    v19.chatBoxSizeChanged = function(v38)
        v19:setState({
            chatBarWidth = v38.AbsoluteSize.X
        });
    end;
end;
v18.render = function(v39)
    return l_withStyle_0(function(v40)
        local l_Font_0 = v40.Font;
        local l_Font_1 = l_Font_0.Body.Font;
        local v43 = l_Font_0.BaseSize * l_Font_0.Body.RelativeSize;
        local l_frameHeight_0 = v39.state.frameHeight;
        if l_frameHeight_0 == 0 then
            l_frameHeight_0 = v39.calculateInputBoxHeight(v39.state.inputText, l_Font_1, v43, v39.state.chatBarWidth);
        end;
        return v3.createElement("Frame", {
            BorderSizePixel = 0,
            BackgroundTransparency = 1,
            LayoutOrder = v39.props.LayoutOrder,
            Size = UDim2.new(1, 0, 0, l_frameHeight_0),
            [v3.Change.AbsolutePosition] = v39.props.onPositionChanged
        }, {
            layout = v3.createElement("UIListLayout", {
                VerticalAlignment = Enum.VerticalAlignment.Center,
                HorizontalAlignment = Enum.HorizontalAlignment.Left,
                FillDirection = Enum.FillDirection.Horizontal,
                SortOrder = Enum.SortOrder.LayoutOrder
            }),
            padding = v3.createElement("UIPadding", {
                PaddingLeft = UDim.new(0, l_IconSize_0.Regular / 4),
                PaddingBottom = UDim.new(0, 5)
            }),
            inputBorder = v3.createElement(l_ImageSetLabel_0, {
                Size = UDim2.new(1, -v39.props.sendButtonContainerSize, 1, 0),
                BackgroundTransparency = 1,
                LayoutOrder = 1,
                Image = l_Images_0["component_assets/circle_21_stroke_1"],
                ImageColor3 = v40.Theme.Divider.Color,
                ScaleType = Enum.ScaleType.Slice,
                SliceCenter = Rect.new(8, 8, 9, 9)
            }, {
                inputImage = v3.createElement(l_ImageSetLabel_0, {
                    Size = UDim2.new(1, 0, 1, 0),
                    BackgroundTransparency = 1,
                    LayoutOrder = 1,
                    Image = l_Images_0["component_assets/circle_21"],
                    ImageColor3 = v40.Theme.UIMuted.Color,
                    ImageTransparency = v40.Theme.UIMuted.Transparency,
                    ScaleType = Enum.ScaleType.Slice,
                    SliceCenter = Rect.new(8, 8, 9, 9)
                }, {
                    padding = v3.createElement("UIPadding", {
                        PaddingTop = UDim.new(0, v43 / 2.5),
                        PaddingLeft = UDim.new(0.02, 0),
                        PaddingRight = UDim.new(0.02, 0)
                    }),
                    inputBox = v3.createElement(l_CallbackInputBox_0, {
                        initialInputText = v39.props.initialInputText,
                        inputTextFont = l_Font_1,
                        inputTextColor3 = v40.Theme.TextMuted.Color,
                        inputTextSize = v43,
                        inputTextXAlignment = Enum.TextXAlignment.Left,
                        inputTextYAlignment = Enum.TextYAlignment.Top,
                        placeholderText = v39.props.placeholderText,
                        placeholderTextColor3 = v40.Theme.TextMuted.Color,
                        placeholderTextTransparency = v40.Theme.TextMuted.Transparency,
                        clipsDescendants = false,
                        multiLine = true,
                        manualFocusRelease = true,
                        textWrapped = true,
                        focusChangedCallback = v39.focusChanged,
                        clearButtonDisabled = true,
                        clearButtonSize = 0,
                        textChangedCallback = function(v45)
                            v39.onTextChanged(v45, l_Font_1, v43, v39.state.chatBarWidth);
                        end,
                        [v3.Change.AbsoluteSize] = v39.chatBoxSizeChanged,
                        inputBoxRef = v39.inputBoxRef
                    })
                })
            }),
            sendButton = v3.createElement("TextButton", {
                Size = UDim2.new(0, v39.props.sendButtonContainerSize, 1, 0),
                LayoutOrder = 2,
                BackgroundTransparency = 1,
                Text = "",
                [v3.Event.Activated] = v39.onSendActivated
            }, {
                layout = v3.createElement("UIListLayout", {
                    VerticalAlignment = Enum.VerticalAlignment.Center,
                    HorizontalAlignment = Enum.HorizontalAlignment.Center
                }),
                sendIcon = v3.createElement(l_ImageSetLabel_0, {
                    Size = UDim2.new(0, l_IconSize_0.Regular, 0, l_IconSize_0.Regular),
                    BackgroundTransparency = 1,
                    ImageColor3 = not not v39.state.showSendChat and v15 or v14,
                    Image = l_Images_0["icons/actions/send"]
                })
            })
        });
    end);
end;
v18.didMount = function(v46)
    v46.isMounted = true;
end;
v18.willUnmount = function(v47)
    v47.isMounted = false;
    if v47.inputConnection then
        v47.inputConnection:Disconnect();
        v47.inputConnection = nil;
    end;
end;
return v18;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AppChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local v2 = require(l_Parent_0.Cryo);
local v3 = require(l_Parent_0.Roact);
local l_Text_0 = require(l_Parent_0.AppCommonLib).Text;
local l_memoize_0 = require(l_Parent_0.AppCommonLib).memoize;
local v6 = if not require(l_script_FirstAncestor_0.Flags.getFFlagEnableUnfilteredThreadsUI)() then require(l_script_FirstAncestor_0.SocialLibraries).Components.PlainTextAutomaticSize else require(script.Parent.PlainTextAutomaticSize);
local l_withStyle_0 = require(l_Parent_0.UIBlox).Style.withStyle;
local v8 = require(script.Parent.AssetCardTempAutomaticSize);
local v9 = require(l_script_FirstAncestor_0.Components.ChatConversation.EnumMessageTypes);
local v10 = require(script.Parent.ChatMessageContainerAutomaticSize);
local v11 = require(script.Parent.Logger);
local l_pruneConsecutiveNewLines_0 = require(l_script_FirstAncestor_0.SocialLibraries).Utils.pruneConsecutiveNewLines;
local v13 = {
    [v9.PlainText] = {
        component = v6,
        name = "PlainText",
        paddingOffset = 0
    },
    [v9.Link] = {
        component = v8,
        name = "AssetCard",
        paddingOffset = 2
    }
};
local v14 = v3.PureComponent:extend("ChatMessage");
v14.defaultProps = {
    additionalProps = {
        placeId = nil,
        universeId = nil,
        senderUserId = nil,
        onDetailsOpened = function()
        end,
        openGameDetailsPage = function()
        end
    },
    BackgroundColor3 = nil,
    content = "",
    debugElement = nil,
    displayName = nil,
    failed = false,
    filteredForReceivers = false,
    isIncoming = false,
    isNewSender = false,
    isSending = false,
    isUnfiltered = false,
    messageType = nil,
    moderated = false,
    parentWidth = 0,
    senderUserId = nil,
    sent = nil,
    showDateTime = false,
    thumbnail = nil,
    Transparency = nil,
    wideMode = false,
    viewProfileOnAvatarPressed = true,
    messageDefaultNoticeText = "PLACEHOLDER Not everyone in this chat can see your message.",
    messageModeratedNoticeText = "PLACEHOLDER Your message was moderated and not sent.",
    unknownUserText = "PLACEHOLDER unknown user"
};
v14.init = function(v15)
    v15.getModeratedText = function(v16)
        return string.gsub(v16, "[^%s]", "#");
    end;
    v15.messageMaxWidth = function(v17, v18)
        local v19 = 128;
        if v17 then
            v19 = v19 + 112;
        end;
        return v18 - v19;
    end;
    v15.getBubbleMaxWidth = l_memoize_0(function(v20, v21, v22, v23)
        return l_Text_0.GetTextBounds(v21, v23, v22, Vector2.new(v20, 10000)).X + 20;
    end);
end;
v14.render = function(v24)
    local v25 = v13[v24.props.messageType];
    local v26 = v24.messageMaxWidth(v24.props.wideMode, v24.props.parentWidth);
    if v25 then
        local v27 = l_pruneConsecutiveNewLines_0(v24.props.content);
        local v28 = not not v24.props.moderated and v24.getModeratedText(v27) or v27;
        return l_withStyle_0(function(v29)
            local l_Body_0 = v29.Font.Body;
            local v31 = v29.Font.BaseSize * l_Body_0.RelativeSize;
            return v3.createElement(v10, v2.Dictionary.join(v24.props, {
                messageMaxWidth = v26,
                messageTypePaddingOffset = v25.paddingOffset,
                renderMessage = function(v32)
                    return v3.createFragment({
                        [v25.name] = v3.createElement(v25.component, v2.Dictionary.join({
                            additionalProps = v24.props.additionalProps,
                            font = l_Body_0.Font,
                            hasTail = v24.props.isNewSender,
                            innerPadding = 10,
                            isIncoming = v24.props.isIncoming,
                            isPending = (v24.props.isSending or v24.props.moderated) or v24.props.failed,
                            isUnfiltered = v24.props.isUnfiltered,
                            maxWidth = v24.getBubbleMaxWidth(v26, v28, v31, l_Body_0.Font),
                            messageDefaultNoticeText = v24.props.messageDefaultNoticeText,
                            messageModeratedNoticeText = v24.props.messageModeratedNoticeText,
                            parentWidth = v24.props.parentWidth,
                            text = v28,
                            textSize = v31,
                            wideMode = v24.props.wideMode,
                            [v3.Change.AbsoluteSize] = v24.messageSizeChanged
                        }, v32 or {}))
                    });
                end
            }));
        end);
    else
        v11:warning("ChatMessage doesn't support messageType: {}", v24.props.messageType);
        return nil;
    end;
end;
return v14;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AppChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local v2 = require(l_Parent_0.Roact);
local l_AvatarCircle_0 = require(l_script_FirstAncestor_0.SocialLibraries).Components.AvatarCircle;
local l_RoactFitComponents_0 = require(l_Parent_0.LuaSocialLibrariesDeps).RoactFitComponents;
local l_withStyle_0 = require(l_Parent_0.UIBlox).Style.withStyle;
local v6 = require(script.Parent.Logger);
local v7 = require(script.Parent.NoticeText);
local v8 = require(script.Parent.SystemMessage);
local v9 = v2.PureComponent:extend("ChatMessageContainer");
v9.defaultProps = {
    BackgroundColor3 = nil,
    BackgroundTransparency = nil,
    debugElement = nil,
    displayName = nil,
    failed = false,
    filteredForReceivers = false,
    Font = Enum.Font.Gotham,
    isIncoming = false,
    isNewSender = false,
    parentWidth = 0,
    messageTypePaddingOffset = 0,
    moderated = false,
    messageMaxWidth = 0,
    openViewProfile = function()
        v6:warning("openViewProfile was not passed to ChatMessage");
    end,
    renderMessage = function()
        v6:warning("renderMessage was not passed to ChatMessage");
    end,
    senderUserId = nil,
    thumbnail = nil,
    viewProfileOnAvatarPressed = true,
    messageDefaultNoticeText = "PLACEHOLDER Not everyone in this chat can see your message.",
    messageModeratedNoticeText = "PLACEHOLDER Your message was moderated and not sent.",
    unknownUserText = "PLACEHOLDER unknown user"
};
v9.init = function(v10)
    v10.onAvatarActivated = function()
        if v10.props.viewProfileOnAvatarPressed then
            v10.props.openViewProfile(v10.props.senderUserId);
        end;
    end;
end;
v9.render = function(v11)
    return l_withStyle_0(function(v12)
        local v13 = 0;
        if not v11.props.showDateTime then
            v13 = (not v11.props.isNewSender and 2 or 10) + v11.props.messageTypePaddingOffset;
        end;
        local v14 = v11.props.displayName == "" and v11.props.unknownUserText or v11.props.displayName;
        local v15 = not not v11.props.isIncoming and Enum.HorizontalAlignment.Left or Enum.HorizontalAlignment.Right;
        return v2.createElement(l_RoactFitComponents_0.FitFrameVertical, {
            BackgroundTransparency = 1,
            BorderSizePixel = 0,
            FillDirection = Enum.FillDirection.Vertical,
            HorizontalAlignment = v15,
            width = UDim.new(1, 0)
        }, {
            DateTime = v11.props.showDateTime and v2.createElement(v8, {
                LayoutOrder = 1,
                Text = v11.props.sent:GetLongRelativeTime(),
                maxWidth = 1000
            }),
            MessageWithAvatar = v2.createElement(l_RoactFitComponents_0.FitFrameVertical, {
                BackgroundTransparency = 1,
                BorderSizePixel = 0,
                FillDirection = Enum.FillDirection.Horizontal,
                HorizontalAlignment = v15,
                LayoutOrder = 2,
                margin = {
                    top = v13,
                    left = not v11.props.thumbnail and 44 or 8,
                    right = 0,
                    bottom = 0
                },
                width = UDim.new(1, 0)
            }, {
                Avatar = not not v11.props.thumbnail and v2.createElement("Frame", {
                    BorderSizePixel = 0,
                    LayoutOrder = 1,
                    Size = UDim2.new(0, 36, 0, 36)
                }, {
                    AvatarCircle = v2.createElement(l_AvatarCircle_0, {
                        circleColor3 = v11.props.BackgroundColor3 or v12.Theme.BackgroundDefault.Color,
                        circleInteriorBackgroundColor3 = v11.props.BackgroundColor3 or v12.Theme.BackgroundDefault.Color,
                        onActivated = v11.onAvatarActivated,
                        thumbnails = {
                            v11.props.thumbnail
                        }
                    })
                }) or nil,
                MessageWithDisplayName = v2.createElement(l_RoactFitComponents_0.FitFrameVertical, {
                    BackgroundTransparency = 1,
                    BorderSizePixel = 0,
                    FillDirection = Enum.FillDirection.Vertical,
                    HorizontalAlignment = v15,
                    LayoutOrder = 2,
                    margin = {
                        top = 0,
                        left = not v11.props.isIncoming and 0 or 5,
                        right = 0,
                        bottom = 0
                    },
                    width = UDim.new(1, not v11.props.isIncoming and 0 or -44)
                }, {
                    DisplayNameContainer = v11.props.displayName and v2.createElement(l_RoactFitComponents_0.FitFrameVertical, {
                        BackgroundTransparency = 1,
                        BorderSizePixel = 0,
                        margin = {
                            top = 0,
                            left = 6,
                            right = 0,
                            bottom = 0
                        },
                        width = UDim.new(0, v11.props.messageMaxWidth - 6)
                    }, {
                        DisplayName = v2.createElement(l_RoactFitComponents_0.FitTextLabel, {
                            BackgroundTransparency = 1,
                            BorderSizePixel = 0,
                            Font = v12.Font.Footer.Font,
                            maximumWidth = v11.props.messageMaxWidth - 6,
                            Size = UDim2.new(1, 0, 1, 0),
                            Text = v14,
                            TextColor3 = v12.Theme.TextDefault.Color,
                            TextSize = v12.Font.BaseSize * v12.Font.Footer.RelativeSize,
                            TextTransparency = v12.Theme.TextDefault.Transparency,
                            TextXAlignment = Enum.TextXAlignment.Left,
                            TextYAlignment = Enum.TextYAlignment.Top,
                            width = l_RoactFitComponents_0.FitTextLabel.Width.FitToText
                        })
                    }),
                    MessageWithAlertIcon = v2.createElement(l_RoactFitComponents_0.FitFrameVertical, {
                        BackgroundTransparency = 1,
                        BorderSizePixel = 0,
                        FillDirection = Enum.FillDirection.Horizontal,
                        HorizontalAlignment = v15,
                        LayoutOrder = 2,
                        VerticalAlignment = Enum.VerticalAlignment.Center,
                        contentPadding = UDim.new(0, 10),
                        width = UDim.new(1, not v11.props.isIncoming and 0 or -44)
                    }, {
                        AlertIcon = (v11.props.failed or v11.props.moderated) and v2.createElement("ImageLabel", {
                            BackgroundTransparency = 1,
                            Image = "rbxasset://textures/ui/LuaChat/icons/ic-alert.png",
                            ImageColor3 = v12.Theme.Alert.Color,
                            ImageTransparency = v12.Theme.Alert.Transparency,
                            LayoutOrder = not v11.props.isIncoming and 1 or 2,
                            Size = UDim2.new(0, 18, 0, 18)
                        }),
                        Message = v11.props.renderMessage({
                            LayoutOrder = not v11.props.isIncoming and 2 or 1
                        })
                    })
                })
            }),
            Notice = (v11.props.moderated or v11.props.filteredForReceivers) and v2.createElement(v7, {
                Font = v11.props.Font,
                HorizontalAlignment = v15,
                LayoutOrder = 3,
                Text = not not v11.props.moderated and v11.props.messageModeratedNoticeText or v11.props.messageDefaultNoticeText,
                TextColor3 = not not v11.props.moderated and v12.Theme.Alert.Color or v12.Theme.UIDefault.Color,
                TextTransparency = not not v11.props.moderated and v12.Theme.Alert.Transparency or v12.Theme.UIDefault.Transparency,
                TextXAlignment = not not v11.props.isIncoming and Enum.TextXAlignment.Left or Enum.TextXAlignment.Right,
                margin = {
                    top = 0,
                    left = not v11.props.isIncoming and 0 or 54,
                    right = v11.props.isIncoming and 0 or 10,
                    bottom = 0
                },
                maxWidth = v11.props.parentWidth,
                width = UDim.new(1, not v11.props.isIncoming and 0 or -44)
            }),
            debug = v11.props.debugElement or nil
        });
    end);
end;
return v9;


local l_TextService_0 = game:GetService("TextService");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AppChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local v3 = require(l_Parent_0.React);
local v4 = require(l_Parent_0.UIBlox);
local l_AvatarCircle_0 = require(l_script_FirstAncestor_0.SocialLibraries).Components.AvatarCircle;
local l_useStyle_0 = require(l_Parent_0.UIBlox).Core.Style.useStyle;
local v7 = require(l_Parent_0.Cryo);
local l_ShimmerPanel_0 = v4.App.Loading.ShimmerPanel;
local v9 = require(script.Parent.Logger);
local v10 = require(script.Parent.NoticeText);
local v11 = require(script.Parent.SystemMessage);
local v12 = require(l_Parent_0.UserProfiles);
local v13 = {
    failed = false,
    filteredForReceivers = false,
    Font = Enum.Font.Gotham,
    isIncoming = false,
    isNewSender = false,
    parentWidth = 0,
    messageTypePaddingOffset = 0,
    moderated = false,
    messageMaxWidth = 0,
    openViewProfile = function()
        v9:warning("openViewProfile was not passed to ChatMessage");
    end,
    renderMessage = function()
        v9:warning("renderMessage was not passed to ChatMessage");
    end,
    viewProfileOnAvatarPressed = true,
    messageDefaultNoticeText = "PLACEHOLDER Not everyone in this chat can see your message.",
    messageModeratedNoticeText = "PLACEHOLDER Your message was moderated and not sent.",
    unknownUserText = "PLACEHOLDER unknown user"
};
ChatMessageContainer = function(v14)
    local v15 = v7.Dictionary.join(v13, v14);
    local v16 = v3.useCallback(function()
        if v15.viewProfileOnAvatarPressed then
            v15.openViewProfile(v15.senderUserId);
        end;
    end, {
        v15.senderUserId
    });
    local v17 = l_useStyle_0();
    local v18 = nil;
    local v19 = nil;
    local l_shouldShowName_0 = v15.shouldShowName;
    local v21 = v12.Hooks.useUserProfilesFetch({
        userIds = {
            v15.senderUserId
        },
        query = v12.Queries.userProfilesCombinedNameAndUsernameByUserIds
    });
    if not v21.data then
        v19 = true;
        v18 = "";
    else
        v19 = false;
        v18 = v12.Selectors.getCombinedNameFromId(v21.data, v15.senderUserId) or v15.unknownUserText;
    end;
    local v23 = v3.useCallback(function()
        local l_l_TextService_0_TextSize_0 = l_TextService_0:GetTextSize(v18, v17.Font.BaseSize * v17.Font.Footer.RelativeSize, v17.Font.Footer.Font, (Vector2.new(math.max(1, v15.messageMaxWidth - 6), math.huge)));
        return UDim2.new(0, l_l_TextService_0_TextSize_0.X, 0, l_l_TextService_0_TextSize_0.Y);
    end, {
        v17.Font.BaseSize * v17.Font.Footer.RelativeSize,
        v17.Font.Footer.Font,
        v15.messageMaxWidth - 6,
        v18
    });
    local v24 = 0;
    if not v15.showDateTime then
        v24 = (not v15.isNewSender and 2 or 10) + v15.messageTypePaddingOffset;
    end;
    local v25 = not not v15.isIncoming and Enum.HorizontalAlignment.Left or Enum.HorizontalAlignment.Right;
    return v3.createElement("Frame", {
        BackgroundTransparency = 1,
        BorderSizePixel = 0,
        AutomaticSize = Enum.AutomaticSize.Y,
        Size = UDim2.new(1, 0, 0, 0)
    }, {
        Layout = v3.createElement("UIListLayout", {
            FillDirection = Enum.FillDirection.Vertical,
            HorizontalAlignment = v25,
            SortOrder = Enum.SortOrder.LayoutOrder
        }),
        DateTime = v15.showDateTime and v3.createElement(v11, {
            LayoutOrder = 1,
            Text = v15.sent:GetLongRelativeTime(),
            maxWidth = 1000
        }),
        MessageWithAvatar = (function()
            return v3.createElement("Frame", {
                BackgroundTransparency = 1,
                BorderSizePixel = 0,
                AutomaticSize = Enum.AutomaticSize.Y,
                LayoutOrder = 2,
                Size = UDim2.new(1, 0, 0, 0)
            }, {
                Padding = v3.createElement("UIPadding", {
                    PaddingTop = UDim.new(0, v24),
                    PaddingLeft = UDim.new(0, not v15.thumbnail and 44 or 8)
                }),
                Layout = v3.createElement("UIListLayout", {
                    FillDirection = Enum.FillDirection.Horizontal,
                    HorizontalAlignment = v25
                }),
                Avatar = not not v15.thumbnail and v3.createElement("Frame", {
                    BorderSizePixel = 0,
                    LayoutOrder = 1,
                    Size = UDim2.new(0, 36, 0, 36)
                }, {
                    AvatarCircle = v3.createElement(l_AvatarCircle_0, {
                        circleColor3 = v15.BackgroundColor3 or v17.Theme.BackgroundDefault.Color,
                        circleInteriorBackgroundColor3 = v15.BackgroundColor3 or v17.Theme.BackgroundDefault.Color,
                        onActivated = v16,
                        thumbnails = {
                            v15.thumbnail
                        }
                    })
                }) or nil,
                MessageWithDisplayName = v3.createElement("Frame", {
                    BackgroundTransparency = 1,
                    BorderSizePixel = 0,
                    LayoutOrder = 2,
                    AutomaticSize = if not game:GetEngineFeature("UseActualSizeToCalculateListMinSize") then nil else Enum.AutomaticSize.Y,
                    Size = UDim2.new(1, not v15.isIncoming and 0 or -44, 0, 0)
                }, {
                    Layout = v3.createElement("UIListLayout", {
                        FillDirection = Enum.FillDirection.Vertical,
                        HorizontalAlignment = v25
                    }),
                    Padding = v3.createElement("UIPadding", {
                        PaddingLeft = UDim.new(0, not v15.isIncoming and 0 or 5)
                    }),
                    DisplayNameContainer = l_shouldShowName_0 and v3.createElement("Frame", {
                        BackgroundTransparency = 1,
                        BorderSizePixel = 0,
                        Size = UDim2.new(0, v15.messageMaxWidth - 6, 0, 0),
                        AutomaticSize = Enum.AutomaticSize.Y,
                        LayoutOrder = 1
                    }, {
                        Padding = v3.createElement("UIPadding", {
                            PaddingLeft = UDim.new(0, 6)
                        }),
                        DisplayName = if v19 then nil else v3.createElement("TextLabel", {
                            BackgroundTransparency = 1,
                            BorderSizePixel = 0,
                            Font = v17.Font.Footer.Font,
                            Size = v23(),
                            Text = v18,
                            TextColor3 = v17.Theme.TextDefault.Color,
                            TextSize = v17.Font.BaseSize * v17.Font.Footer.RelativeSize,
                            TextTransparency = v17.Theme.TextDefault.Transparency,
                            TextXAlignment = Enum.TextXAlignment.Left,
                            TextYAlignment = Enum.TextYAlignment.Top,
                            AutomaticSize = Enum.AutomaticSize.XY
                        }, {
                            SizeConstraint = v3.createElement("UISizeConstraint", {
                                MaxSize = Vector2.new(v15.messageMaxWidth - 6, math.huge)
                            })
                        }),
                        ShimmerName = if not v19 then nil else v3.createElement(l_ShimmerPanel_0, {
                            Size = UDim2.new(0, 150, 0, 20),
                            LayoutOrder = 2
                        })
                    }),
                    MessageWithAlertIcon = v3.createElement("Frame", {
                        BackgroundTransparency = 1,
                        BorderSizePixel = 0,
                        LayoutOrder = 2,
                        AutomaticSize = Enum.AutomaticSize.Y,
                        Size = UDim2.new(1, not v15.isIncoming and 0 or -44, 0, 0)
                    }, {
                        Layout = v3.createElement("UIListLayout", {
                            SortOrder = Enum.SortOrder.LayoutOrder,
                            FillDirection = Enum.FillDirection.Horizontal,
                            HorizontalAlignment = v25,
                            VerticalAlignment = Enum.VerticalAlignment.Center,
                            Padding = UDim.new(0, 10)
                        }),
                        AlertIcon = (v15.failed or v15.moderated) and v3.createElement("ImageLabel", {
                            BackgroundTransparency = 1,
                            Image = "rbxasset://textures/ui/LuaChat/icons/ic-alert.png",
                            ImageColor3 = v17.Theme.Alert.Color,
                            ImageTransparency = v17.Theme.Alert.Transparency,
                            LayoutOrder = not v15.isIncoming and 1 or 2,
                            Size = UDim2.new(0, 18, 0, 18)
                        }),
                        Message = v15.renderMessage({
                            LayoutOrder = not v15.isIncoming and 2 or 1
                        })
                    })
                })
            });
        end)(),
        Notice = (v15.moderated or v15.filteredForReceivers) and v3.createElement(v10, {
            Font = v15.Font,
            HorizontalAlignment = v25,
            LayoutOrder = 3,
            Text = not not v15.moderated and v15.messageModeratedNoticeText or v15.messageDefaultNoticeText,
            TextColor3 = not not v15.moderated and v17.Theme.Alert.Color or v17.Theme.UIDefault.Color,
            TextTransparency = not not v15.moderated and v17.Theme.Alert.Transparency or v17.Theme.UIDefault.Transparency,
            TextXAlignment = not not v15.isIncoming and Enum.TextXAlignment.Left or Enum.TextXAlignment.Right,
            margin = {
                top = 0,
                left = not v15.isIncoming and 0 or 54,
                right = v15.isIncoming and 0 or 10,
                bottom = 0
            },
            maxWidth = v15.parentWidth,
            width = UDim.new(1, not v15.isIncoming and 0 or -44)
        }),
        debug = v15.debugElement or nil
    });
end;
return ChatMessageContainer;


local v0 = require(script:FindFirstAncestor("AppChat").Utils.getDeepValue);
return function(v1, v2)
    local v3 = v0(v1, string.format("ChatAppReducer.Conversations.%s", v2 or ""));
    if not (not v3 or not v3.usersTyping) and v1.Users then
        local l_usersTyping_0 = v3.usersTyping;
        local l_Users_0 = v1.Users;
        local v6 = {};
        for v7, v8 in pairs(l_usersTyping_0) do
            if not (not (v7 ~= v1.LocalUserId) or not v8) then
                table.insert(v6, l_Users_0[v7]);
            end;
        end;
        return v6;
    else
        return {};
    end;
end;


local l_Parent_0 = script:FindFirstAncestor("AppChat").Parent;
local v1 = require(l_Parent_0.Roact);
local l_withStyle_0 = require(l_Parent_0.UIBlox).Style.withStyle;
local v3 = v1.PureComponent:extend("EmptyConversationPage");
v3.defaultProps = {
    topBarHeight = 0
};
v3.render = function(v4)
    return l_withStyle_0(function(v5)
        return v1.createElement("Frame", {
            BackgroundColor3 = v5.Theme.BackgroundDefault.Color,
            Size = UDim2.new(1, 0, 1, 0),
            Transparency = v5.Theme.BackgroundDefault.Transparency
        }, {
            EmptyChatFrame = v1.createElement("Frame", {
                BackgroundTransparency = 1,
                LayoutOrder = 2,
                Size = UDim2.new(1, 0, 1, -v4.props.topBarHeight)
            }, {
                ChatIcon = v1.createElement("ImageLabel", {
                    AnchorPoint = Vector2.new(0.5, 0.5),
                    BackgroundTransparency = 1,
                    Position = UDim2.new(0.5, 0, 0.5, 0),
                    Image = "rbxasset://textures/ui/LuaChat/icons/ic-chat-large.png",
                    Size = UDim2.new(0, 150, 0, 150)
                })
            })
        });
    end);
end;
return v3;


local v0 = require(script:FindFirstAncestor("AppChat").Parent.Roact);
local v1 = require(script.Parent.EmptyConversationPage);
local v2 = v0.PureComponent:extend("EmptyConversationScreen");
v2.defaultProps = {
    navigation = nil
};
v2.render = function(v3)
    local l_navigation_0 = v3.props.navigation;
    assert(type(l_navigation_0) ~= "nil", "ChatConversationScreen should be wrapped with Roact Navigation");
    return v0.createElement(v1, {
        topBarHeight = l_navigation_0.getScreenProps("topBarHeight", 0)
    });
end;
return v2;


return {
    Link = "Link",
    PlainText = "PlainText",
    System = "System"
};


local v0 = require(script:FindFirstAncestor("AppChat").Parent.Roact);
local v1 = v0.PureComponent:extend("Button");
v1.defaultProps = {
    color = Color3.new(0.9, 0.9, 0.9),
    transparency = 0,
    textSize = 12,
    textColor = Color3.new(0.1, 0.1, 0.1),
    font = Enum.Font.Gotham,
    text = "",
    LayoutOrder = 0,
    onActivated = function()
        print("Game card button activated");
    end
};
v1.render = function(v2)
    return v0.createElement("Frame", {
        BackgroundTransparency = 1,
        Size = UDim2.new(1, 0, 0, 32),
        LayoutOrder = v2.props.LayoutOrder or 0
    }, {
        layout = v0.createElement("UIListLayout", {
            FillDirection = Enum.FillDirection.Vertical,
            SortOrder = Enum.SortOrder.LayoutOrder
        }),
        actionButton = v0.createElement("ImageButton", {
            BackgroundTransparency = 1,
            Size = UDim2.new(1, 0, 1, 0),
            Image = "rbxasset://textures/ui/LuaChat/9-slice/input-default.png",
            ImageColor3 = v2.props.color,
            ImageTransparency = v2.props.transparency,
            ScaleType = Enum.ScaleType.Slice,
            SliceCenter = Rect.new(3, 3, 4, 4),
            [v0.Event.Activated] = v2.props.onActivated
        }, {
            layout = v0.createElement("UIListLayout", {
                VerticalAlignment = Enum.VerticalAlignment.Center,
                HorizontalAlignment = Enum.HorizontalAlignment.Center
            }),
            actionLabel = v0.createElement("TextLabel", {
                BackgroundTransparency = 1,
                Size = UDim2.new(0.8, 0, 0.8, 0),
                TextSize = v2.props.textSize,
                TextColor3 = v2.props.textColor,
                Font = v2.props.font,
                Text = v2.props.text or ""
            })
        })
    });
end;
return v1;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AppChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local v2 = require(l_Parent_0.Roact);
local v3 = require(l_Parent_0.UIBlox);
local v4 = require(l_script_FirstAncestor_0.Constants);
local v5 = require(script.Parent.PlayButton);
local v6 = require(l_script_FirstAncestor_0.Components.ChatConversation.AssetCardComponents.FitFrameVertical);
local v7 = v2.PureComponent:extend("BuyToPlay");
v7.defaultProps = {
    text = "Buy to play",
    gamePrice = 100
};
v7.render = function(v8)
    return v3.Style.withStyle(function(v9)
        return v2.createElement(v6, {
            BackgroundTransparency = 1,
            width = UDim.new(1, 0),
            contentPadding = UDim.new(0, 6)
        }, {
            gamePriceFrame = v2.createElement("Frame", {
                BackgroundTransparency = 1,
                Size = UDim2.new(1, 0, 0, 16),
                LayoutOrder = 1
            }, {
                layout = v2.createElement("UIListLayout", {
                    SortOrder = Enum.SortOrder.LayoutOrder,
                    FillDirection = Enum.FillDirection.Horizontal,
                    Padding = UDim.new(0, 4)
                }),
                robuxIcon = v2.createElement("ImageLabel", {
                    Size = UDim2.new(0, 16, 1, 0),
                    Image = v4.SmallRobuxIcon,
                    ImageColor3 = v9.Theme.ContextualPrimaryDefault.Color,
                    BackgroundTransparency = 1,
                    LayoutOrder = 1
                }),
                priceLabel = v2.createElement("TextLabel", {
                    Size = UDim2.new(1, -16, 1, 0),
                    Text = v8.props.gamePrice,
                    TextColor3 = v9.Theme.ContextualPrimaryDefault.Color,
                    TextSize = 16,
                    TextXAlignment = Enum.TextXAlignment.Left,
                    Font = Enum.Font.Gotham,
                    BackgroundTransparency = 1,
                    LayoutOrder = 2
                })
            }),
            playButton = v2.createElement(v5, {
                placeId = v8.placeId,
                text = v8.props.text,
                LayoutOrder = 2
            })
        });
    end);
end;
return v7;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AppChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local v2 = require(l_Parent_0.Roact);
local v3 = require(l_Parent_0.UIBlox);
local v4 = require(l_script_FirstAncestor_0.Components.ChatConversation.AssetCardComponents.AssetCard);
local v5 = require(script.Parent.PlayButton);
local v6 = require(script.Parent.ViewDetailsButton);
local v7 = v2.PureComponent:extend("GameCard");
v7.defaultProps = {
    playText = "Play",
    viewDetailsText = "View Details",
    noDescriptionText = "Placeholder: No Description",
    gameName = nil,
    gameIcon = nil,
    gameDescription = nil,
    contentLoadedCallback = nil,
    bodyActivated = nil,
    playabilityStatus = nil,
    conversationId = nil,
    universeId = nil,
    placeId = nil,
    price = nil,
    eventStream = nil,
    playButtonActivated = nil,
    viewDetailsActivated = nil
};
v7.makeButtons = function(v8, _)
    if v8.props.playabilityStatus then
        local l_isPlayable_0 = v8.props.playabilityStatus.isPlayable;
        if not v8.props.isLoading then
            if l_isPlayable_0 == true then
                return {
                    playButton = v2.createElement(v5, {
                        placeId = v8.props.placeId,
                        universeId = v8.props.universeId,
                        text = v8.props.playText,
                        conversationId = v8.props.conversationId,
                        onActivated = function()
                            v8.props.onPlayButtonActivated(v8.props);
                        end,
                        eventStream = v8.props.eventStream
                    })
                };
            else
                return {
                    viewDetails = v2.createElement(v6, {
                        text = v8.props.viewDetailsText,
                        onActivated = function()
                            v8.props.openDetails(v8.props);
                        end,
                        eventStream = v8.props.eventStream
                    })
                };
            end;
        else
            return {
                loading = v2.createElement(v3.App.Loading.ShimmerPanel, {
                    Size = UDim2.new(1, 0, 0, 32),
                    cornerRadius = UDim.new(0, 4)
                })
            };
        end;
    else
        return ;
    end;
end;
v7.render = function(v11)
    return v3.Style.withStyle(function(v12)
        if not v11.props.universeId then
            return v2.createElement(v4, {
                cardTitle = v11.props.gameName or "",
                cardBodyText = v11.props.gameDescription or "",
                cardIcon = v11.props.gameIcon or "",
                isLoading = true
            }, {
                fill = v2.createElement("Frame", {
                    BackgroundTransparency = 1,
                    Size = UDim2.new(1, 0, 0, 32)
                })
            });
        else
            local v13 = nil;
            if v11.props.gameDescription then
                v13 = v11.props.gameDescription:gsub("%s", " ");
                if v13:gsub("^%s+$", "") == "" then
                    v13 = v11.props.noDescriptionText;
                end;
            end;
            return v2.createElement(v4, {
                isLoading = v11.props.isLoading,
                cardTitle = v11.props.gameName,
                cardBodyText = v13,
                cardIcon = v11.props.gameIcon,
                contentLoadedCallback = v11.props.contentLoadedCallback,
                shouldUseUnfilteredUI = v11.props.shouldUseUnfilteredUI,
                bodyActivated = function()
                    v11.props.openDetails(v11.props);
                end
            }, v11:makeButtons(v12));
        end;
    end);
end;
return v7;


local l_RbxAnalyticsService_0 = game:GetService("RbxAnalyticsService");
local l_EventIngestService_0 = game:GetService("EventIngestService");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AppChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local _ = require(l_script_FirstAncestor_0.types);
local v5 = require(l_Parent_0.React);
local v6 = require(l_Parent_0.Cryo);
local l_EventStream_0 = require(l_Parent_0.Analytics).AnalyticsReporters.EventStream;
local l_dependencyArray_0 = require(l_Parent_0.RoactUtils).Hooks.dependencyArray;
local l_memo_0 = v5.memo;
local l_useCallback_0 = v5.useCallback;
local l_useDispatch_0 = require(l_Parent_0.RoactUtils).Hooks.RoactRodux.useDispatch;
local l_useEffect_0 = v5.useEffect;
local l_useSelector_0 = require(l_Parent_0.RoactUtils).Hooks.RoactRodux.useSelector;
local v14 = require(l_Parent_0.Loggers).Logger:new("GameCardContainer");
local l_withLocalization_0 = require(l_Parent_0.Localization).withLocalization;
local l_GameParams_0 = require(l_Parent_0.ExperienceService).GameParams;
local l_EventIngest_0 = require(l_Parent_0.Analytics).AnalyticsReporters.EventIngest;
local l_ApiFetchGameDetails_0 = require(l_Parent_0.GameDetailRodux).GameDetails.ApiFetchGameDetails;
local l_ApiFetchPlayabilityStatus_0 = require(l_Parent_0.PlayabilityRodux).PlayabilityStatus.ApiFetchPlayabilityStatus;
local l_ApiFetchGameIcons_0 = require(l_Parent_0.GameIconRodux).GameIcons.ApiFetchGameIcons;
local v21 = require(script.Parent.ReportAnEvent);
local l_AppSessionService_0 = require(l_Parent_0.RoactServiceTags).AppSessionService;
local l_SessionType_0 = require(l_Parent_0.RobloxAppSessionization).SessionType;
local l_RoactServices_0 = require(l_Parent_0.RoactServices).RoactServices;
local l_RoactAnalyticsCommonGameEvents_0 = require(l_Parent_0.RoactServiceTags).RoactAnalyticsCommonGameEvents;
local v26 = require(script.Parent.GameCard);
local l_AppGame_0 = l_RoactServices_0.AppGame;
local l_ExperienceService_0 = require(l_Parent_0.ExperienceService).ExperienceService;
local l_UseExperienceService_0 = require(l_Parent_0.ExperienceService).Flags.UseExperienceService;
local l_SetGamePlaySession_0 = require(l_Parent_0.RobloxAppSessionization).SetGamePlaySession;
local l_GameIconReducer_0 = require(l_Parent_0.GameIconRodux).GameIcons.GameIconReducer;
local v32 = require(l_Parent_0.HttpRequest);
local v46 = {
    networkImpl = v32.config({
        requestFunction = function(v33, v34, v35)
            v14:info("Fetching: {}", string.format("[ requestMethod = %q, url = %q ]", v34, v33));
            return v32.requestFunctions.HttpRbxApi(v33, v34, v35);
        end
    }),
    eventStream = l_EventStream_0.new(l_RbxAnalyticsService_0),
    eventIngest = l_EventIngest_0.new(l_EventIngestService_0),
    placeId = nil,
    universeId = nil,
    conversationId = nil,
    luaChatPlayTogetherEnabled = nil,
    onDetailsOpened = function()
    end,
    onPlayButtonActivated = function(v36)
        local l_placeId_0 = v36.placeId;
        local l_senderUserId_0 = v36.senderUserId;
        l_SetGamePlaySession_0(v36.sessionService, l_SessionType_0.StructuralIdentifier.GamePlayFromChat, true);
        v21(v36, "clickBtnFromLinkCardInChat", "touch");
        if l_placeId_0 then
            local function v40(v39)
                v36 = v6.Dictionary.join(v36, {
                    joinAttemptId = v39
                });
                v21(v36, "gamePlayIntent", "PlayGameFromLinkCard");
            end;
            local v41 = l_GameParams_0.fromParams({
                userId = l_senderUserId_0,
                placeId = l_placeId_0
            });
            if not l_UseExperienceService_0() then
                v36.game:launchGame(v41, "PlayGameFromLinkCard", v40);
            else
                l_ExperienceService_0:LaunchExperience(v41, "PlayGameFromLinkCard", v40);
            end;
        end;
    end,
    openDetails = function(v42)
        local l_universeId_0 = v42.universeId;
        local l_placeId_1 = v42.placeId;
        v21(v42, "clickLinkCardInChat", "touch");
        v42.onDetailsOpened();
        v42.openGameDetailsPage(l_universeId_0, "LuaChatAssetCard");
        local v45 = v42.analytics and v42.analytics.reportOpenGameDetailFromChat;
        if v45 then
            v45(l_placeId_1, v42.conversationId, l_universeId_0, "GameDetailFromLinkCard");
        end;
    end
};
local function _(v47, v48)
    local v49 = v47[l_GameIconReducer_0.key][v48];
    if not v49 then
        return "";
    else
        return v49.url;
    end;
end;
local function _(v51, v52)
    return v51.GameDetails[v52] or {};
end;
local function _(v54, v55)
    return v54.PlayabilityStatus[v55] or {};
end;
GameCardContainer = function(v57)
    local v58 = v6.Dictionary.join(v46, v57);
    if not v58.universeId then
        assert("universeId does not exist", "universeId does not exist");
    end;
    local v60 = l_useSelector_0(l_useCallback_0(function(v59)
        return v59.GameDetails[v58.universeId] or {};
    end, l_dependencyArray_0(v58.universeId)));
    local v62 = l_useSelector_0(l_useCallback_0(function(v61)
        return v61.PlayabilityStatus[v58.universeId] or {};
    end, l_dependencyArray_0(v58.universeId)));
    local v65 = l_useSelector_0(l_useCallback_0(function(v63)
        local v64 = v63[l_GameIconReducer_0.key][v58.universeId];
        if not v64 then
            return "";
        else
            return v64.url;
        end;
    end, l_dependencyArray_0(v58.universeId)));
    local v66 = v58.placeId or v60.rootPlaceId;
    local l_name_0 = v60.name;
    local v68 = v60.description or "";
    local v69 = v60.price or 0;
    local v70 = l_useDispatch_0();
    local function v73(v71, v72)
        v70(l_ApiFetchGameIcons_0(v71, {
            v72
        }));
        v70(l_ApiFetchGameDetails_0.Fetch(v71, {
            v72
        }));
        v70(l_ApiFetchPlayabilityStatus_0.Fetch(v71, {
            v72
        }));
    end;
    local function _()
        if not (not (((not v66 or not l_name_0) or not v68) or not v62) and v62.isPlayable ~= nil) or not v69 then
            return false;
        else
            return true;
        end;
    end;
    l_useEffect_0(function()
        local l_universeId_1 = v58.universeId;
        if l_universeId_1 then
            v73(v58.networkImpl, l_universeId_1);
            return ;
        else
            return ;
        end;
    end, {});
    local function v78(v76, v77)
        if v76.universeId then
            return v5.createElement(v26, v6.Dictionary.join(v76, v77, {
                isLoading = not (not not v66 and if (l_name_0 and v68) and v62 then v62.isPlayable ~= nil and (v69 and true or false) else false)
            }));
        else
            return v5.createElement(v26, v77);
        end;
    end;
    return l_withLocalization_0({
        purchaseGameText = "Feature.GameDetails.Heading.PurchaseGame",
        viewDetailsText = "Feature.Chat.Action.ViewAssetDetails",
        playText = "Common.VisitGame.Label.Play",
        noDescriptionText = "Feature.Chat.Label.NoDescriptionYet"
    })(function(v79)
        return v78(v6.Dictionary.join(v58, {
            details = v60,
            playabilityStatus = v62,
            gameIcon = v65,
            placeId = v66,
            gameName = l_name_0,
            gameDescription = v68,
            gamePrice = v69,
            fetchGameData = v73
        }), v79);
    end);
end;
return l_RoactServices_0.connect({
    game = l_AppGame_0,
    sessionService = l_AppSessionService_0,
    analytics = l_RoactAnalyticsCommonGameEvents_0
})(l_memo_0(GameCardContainer));


local l_Parent_0 = script:FindFirstAncestor("AppChat").Parent;
local v1 = require(l_Parent_0.Cryo);
local v2 = require(l_Parent_0.React);
local l_dependencyArray_0 = require(l_Parent_0.RoactUtils).Hooks.dependencyArray;
local l_memo_0 = v2.memo;
local l_useCallback_0 = v2.useCallback;
local l_useDispatch_0 = require(l_Parent_0.RoactUtils).Hooks.RoactRodux.useDispatch;
local l_useEffect_0 = v2.useEffect;
local l_useSelector_0 = require(l_Parent_0.RoactUtils).Hooks.RoactRodux.useSelector;
local v9 = require(l_Parent_0.Loggers).Logger:new("PlaceIdContainer");
local l_ApiFetchPlaceInfos_0 = require(l_Parent_0.PlaceInfoRodux).Thunks.ApiFetchPlaceInfos;
local v11 = require(script.Parent.GameCard);
local v12 = require(script.Parent.GameCardContainer);
local v13 = require(l_Parent_0.HttpRequest);
local v17 = {
    networkImpl = v13.config({
        requestFunction = function(v14, v15, v16)
            v9:info("Fetching: {}", string.format("[ requestMethod = %q, url = %q ]", v15, v14));
            return v13.requestFunctions.HttpRbxApi(v14, v15, v16);
        end
    })
};
local function _(v18, v19)
    return v18.ChatAppReducer.PlaceInfos[v19] or {};
end;
PlaceIdContainer = function(v21)
    local v22 = v1.Dictionary.join(v17, v21);
    local v23 = l_useDispatch_0();
    local v26 = l_useCallback_0(function(v24, v25)
        return v23(l_ApiFetchPlaceInfos_0(v24, {
            v25
        }));
    end, l_dependencyArray_0(v23));
    l_useEffect_0(function()
        v26(v22.networkImpl, v22.placeId);
    end, {});
    local v29 = l_useSelector_0(function(v27)
        local l_universeId_0 = (v27.ChatAppReducer.PlaceInfos[v22.placeId] or {}).universeId;
        return not not l_universeId_0 and tostring(l_universeId_0) or nil;
    end);
    if v29 then
        return v2.createElement(v12, v1.Dictionary.join(v22, {
            universeId = v29
        }));
    else
        return v2.createElement(v11, {});
    end;
end;
return l_memo_0(PlaceIdContainer);


local l_Parent_0 = script:FindFirstAncestor("AppChat").Parent;
local v1 = require(l_Parent_0.UIBlox);
local v2 = require(l_Parent_0.Roact);
local v3 = require(script.Parent.Button);
local v4 = v2.PureComponent:extend("PlayButton");
v4.defaultProps = {
    text = "Play",
    LayoutOrder = 0,
    onActivated = function()
        print("Play button activated");
    end
};
v4.render = function(v5)
    return v1.Style.withStyle(function(v6)
        return v2.createElement(v3, {
            text = v5.props.text,
            textColor = Color3.fromRGB(255, 255, 255),
            textSize = 23,
            font = v6.Font.Body.Font,
            transparency = v6.Theme.ContextualPrimaryDefault.Transparency,
            color = v6.Theme.ContextualPrimaryDefault.Color,
            LayoutOrder = v5.props.LayoutOrder or 0,
            onActivated = v5.props.onActivated
        });
    end);
end;
return v4;


local l_gamePlayIntent_0 = require(script:FindFirstAncestor("AppChat").Parent.ExperienceAnalytics).Events.gamePlayIntent;
return function(v1, v2, v3)
    local v4 = nil;
    local v5 = nil;
    if v2 == "gamePlayIntent" then
        v5 = {
            conversationId = v1.conversationId,
            rootPlaceId = v1.placeId,
            joinAttemptId = v1.joinAttemptId
        };
        v4 = v1.eventIngest;
    else
        v5 = {
            conversationId = v1.conversationId,
            placeId = v1.placeId
        };
        v4 = v1.eventStream;
    end;
    if v2 == "gamePlayIntent" then
        l_gamePlayIntent_0(v4, v3, {
            placeId = v5.rootPlaceId,
            rootPlaceId = tonumber(v5.rootPlaceId),
            conversationId = v5.conversationId,
            joinAttemptId = v5.joinAttemptId
        });
        return ;
    else
        v4:setRBXEventStream(v3, v2, v5);
        return ;
    end;
end;


local l_Parent_0 = script:FindFirstAncestor("AppChat").Parent;
local v1 = require(l_Parent_0.Roact);
local v2 = require(l_Parent_0.UIBlox);
local v3 = require(script.Parent.Button);
local v4 = v1.PureComponent:extend("ViewDetailsButton");
v4.defaultProps = {
    text = nil,
    LayoutOrder = nil,
    onActivated = function()
        print("View details button pressed");
    end
};
v4.render = function(v5)
    return v2.Style.withStyle(function(v6)
        return v1.createElement(v3, {
            text = v5.props.text,
            textColor = v6.Theme.SystemPrimaryContent.Color,
            textSize = v6.Font.Body.RelativeSize * v6.Font.BaseSize,
            font = v6.Font.Body.Font,
            transparency = v6.Theme.SystemPrimaryDefault.Transparency,
            color = v6.Theme.SystemPrimaryDefault.Color,
            LayoutOrder = v5.props.LayoutOrder or 0,
            onActivated = v5.props.onActivated
        });
    end);
end;
return v4;


local v0 = require(script:FindFirstAncestor("AppChat").Logger):new("RoactChat.ChatConversation");
v0:setContext({
    screen = "ChatConversation"
});
return v0;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AppChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local v2 = require(l_Parent_0.Roact);
local l_BidirectionalFlatList_0 = require(l_Parent_0.VirtualizedList).BidirectionalFlatList;
local v4 = require(l_Parent_0.Promise);
local v5 = require(l_script_FirstAncestor_0.Models.MessageModel);
local v6 = require(l_script_FirstAncestor_0.Components.ChatConversation.EnumMessageTypes);
local v7 = require(l_script_FirstAncestor_0.Models.MessageModel);
local v8 = require(script.Parent.ChatMessage);
local v9 = require(script.Parent.SystemMessage);
local v10 = require(script.Parent.SystemMessageContainer);
local v11 = require(l_script_FirstAncestor_0.Flags.isAppChatChannelsAPIEnabled);
local v12 = require(l_script_FirstAncestor_0.Flags.getFFlagEnableUnfilteredThreadsUI);
local v13 = require(l_script_FirstAncestor_0.Flags.getFFlagEnableChatSystemMessages);
local v14 = v2.PureComponent:extend("MessageList");
v14.defaultProps = {
    Size = UDim2.new(1, 0, 1, 0),
    autoScrollMaxIndex = 3,
    bottomMargin = 10,
    conversationId = nil,
    initialFocusIndex = 1,
    isDebugEnabled = false,
    itemList = {},
    loadNext = function()
    end,
    markAsRead = function()
    end,
    messageListRef = nil,
    onDetailsOpened = function()
    end,
    openGameDetailsPage = function(_, _)
    end,
    openViewProfile = nil,
    wideMode = false,
    viewProfileOnAvatarPressed = true,
    invalidMessageTypeText = "PLACEHOLDER This message could not be displayed",
    messageDefaultNoticeText = "PLACEHOLDER Not everyone in this chat can see your message.",
    messageModeratedNoticeText = "PLACEHOLDER Your message was moderated and not sent.",
    unknownUserText = "PLACEHOLDER unknown user"
};
local function v20(v17, v18)
    if not (v17 ~= nil) or v18 == nil then
        return false;
    else
        local v19;
        if v17.stable_key ~= nil then
            v19 = true;
            if not (v17.stable_key ~= v18.stable_key) then
                goto label0;
            end;
        end;
        v19 = false;
        if v17.messageId ~= nil then
            v19 = v17.messageId == v18.messageId;
        end;
        ::label0::;
        return v19;
    end;
end;
v14.init = function(v21)
    v21.state = {
        width = 0,
        startIndex = 1,
        firstItem = v21.props.itemList[1]
    };
    v21.focusIndex = v21.props.initialFocusIndex;
    v21.isValidMessageAndSenderType = function(v22, v23)
        if v23 == v5.SenderTypes.System then
            return v22 == v6.System;
        elseif v23 == v5.SenderTypes.User then
            local v24 = true;
            if v22 ~= v6.PlainText then
                v24 = v22 == v6.Link;
            end;
            return v24;
        else
            return false;
        end;
    end;
    v21.isValidMessageType = function(v25)
        local v26 = true;
        if v25 ~= v6.PlainText then
            v26 = v25 == v6.Link;
        end;
        return v26;
    end;
    v21.ref = v21.props.messageListRef or v2.createRef();
    v21.renderItem = function(v27)
        if not if not v13() then v21.isValidMessageType(v27.messageType) else v21.isValidMessageAndSenderType(v27.messageType, v27.senderType) then
            return v2.createElement(v9, {
                Text = v21.props.invalidMessageTypeText
            });
        else
            local v28 = v21.props.isDebugEnabled and v2.createElement("StringValue", {
                Value = tostring(v27.messageId)
            });
            if v13() and v27.messageType == v6.System then
                return v2.createElement(v10, {
                    text = v27.content,
                    parentWidth = v21.state.width,
                    sent = v27.sent,
                    showDateTime = v27.showDateTime,
                    debugElement = v28
                });
            else
                local l_additionalProps_0 = v27.additionalProps;
                if l_additionalProps_0 then
                    l_additionalProps_0.onDetailsOpened = v21.props.onDetailsOpened;
                end;
                if not l_additionalProps_0 then
                    l_additionalProps_0 = {};
                end;
                l_additionalProps_0.openGameDetailsPage = v21.props.openGameDetailsPage;
                return v2.createElement(v8, {
                    additionalProps = l_additionalProps_0,
                    content = v27.content,
                    debugElement = v28,
                    failed = v27.failed,
                    filteredForReceivers = v27.filteredForReceivers,
                    isIncoming = v27.isIncoming,
                    isNewSender = v27.isNewSender,
                    isSending = v27.isSending,
                    isUnfiltered = if not v12() then nil else v27.moderationType == v7.ModerationTypes.TrustedComms,
                    messageDefaultNoticeText = v21.props.messageDefaultNoticeText,
                    messageModeratedNoticeText = v21.props.messageModeratedNoticeText,
                    messageType = v27.messageType,
                    moderated = v27.moderated,
                    openViewProfile = v21.props.openViewProfile,
                    parentWidth = v21.state.width,
                    readingMessagesIsEnabled = true,
                    senderUserId = v27.sender.id,
                    sent = v27.sent,
                    showDateTime = v27.showDateTime,
                    showDisplayName = v27.showDisplayName,
                    shouldShowName = v27.sender.shouldShowName,
                    thumbnail = v27.sender.thumbnail,
                    wideMode = v21.props.wideMode,
                    unknownUserText = v21.props.unknownUserText,
                    viewProfileOnAvatarPressed = v21.props.viewProfileOnAvatarPressed
                });
            end;
        end;
    end;
    v21.updateWidth = function(v30)
        if v30.AbsoluteSize.X ~= v21.state.width then
            v21:setState({
                width = v30.AbsoluteSize.X
            });
        end;
    end;
    v21.changeFocus = function(v31)
        v21.isNearBottom = v31.anchorIndex <= v21.props.autoScrollMaxIndex + 1;
        v21.focusIndex = if not v21.isNearBottom then v31.anchorIndex + 1 else 1;
        if not (not (v31.anchorIndex == 1) or v21.props.itemList[1].read) then
            v21.props.markAsRead();
        end;
    end;
    v21.identifier = function(v32)
        return v32.messageId .. "|" .. (v32.position or "");
    end;
    v21.getScrollRef = function()
        if v21.ref.current == nil then
            return nil;
        else
            local v33 = v21.ref.current._listRef._scrollRef.getNativeScrollRef();
            if v33 == nil then
                return nil;
            else
                return v33._nativeRef.current;
            end;
        end;
    end;
    v21.calculateScrollOffset = function(v34)
        return (v34.AbsoluteCanvasSize.Y - v34.CanvasPosition.Y) - v34.AbsoluteWindowSize.Y;
    end;
    v21.onScroll = function(v35)
        local v36 = v21.calculateScrollOffset(v35);
        if v36 < 512 then
            v21:setState(function(_, v38)
                return {
                    firstItem = v38.itemList[1]
                };
            end);
        end;
        if v11() then
            if v36 < 64 then
                v21.props.markAsRead();
            end;
            v21.isNearBottom = v36 < 64;
        elseif not (v36 < 64) or v21.props.itemList[1].read then
            if v36 >= 64 then
                v21.isNearBottom = false;
                return ;
            end;
        else
            v21.props.markAsRead();
            v21.isNearBottom = true;
            return ;
        end;
    end;
end;
v14.getDerivedStateFromProps = function(v39, v40)
    if v40.firstItem == nil then
        return {
            startIndex = 1
        };
    else
        local v41 = 1;
        while v41 <= #v39.itemList do
            local v42 = v39.itemList[v41];
            local l_firstItem_0 = v40.firstItem;
            local v44;
            if not (v42 ~= nil) or l_firstItem_0 == nil then
                v44 = false;
            else
                if v42.stable_key ~= nil then
                    v44 = true;
                    if not (v42.stable_key ~= l_firstItem_0.stable_key) then
                        goto label1;
                    end;
                end;
                v44 = false;
                if v42.messageId ~= nil then
                    v44 = v42.messageId == l_firstItem_0.messageId;
                end;
            end;
            ::label1::;
            if not v44 then
                v41 = v41 + 1;
            else
                break;
            end;
        end;
        if #v39.itemList < v41 then
            return {
                startIndex = 1
            };
        else
            return {
                startIndex = v41
            };
        end;
    end;
end;
v14.didUpdate = function(v45, v46, _)
    if not (not (#v45.props.itemList < 30) or not v45.props.loadNext) and #v45.props.itemList ~= #v46.itemList then
        v45.props.loadNext();
    end;
    if v46.conversationId ~= v45.props.conversationId then
        v45.isNearBottom = true;
    end;
    local v48 = v45.getScrollRef();
    if if v48 ~= nil then v45.calculateScrollOffset(v48) else 0 < 64 then
        v45.isNearBottom = true;
        if v11() then
            if #v45.props.itemList > 0 then
                v45.props.markAsRead();
            end;
        elseif not (not (#v45.props.itemList > 0) or v45.props.itemList[1].read) then
            v45.props.markAsRead();
        end;
    end;
    if not ((not (v46.readingMessagesIsEnabled ~= v45.props.readingMessagesIsEnabled) or not v45.props.readingMessagesIsEnabled) or not v45.isNearBottom) then
        v45.props.markAsRead();
    end;
end;
v14.didMount = function(v49)
    if not (not (#v49.props.itemList < 30) or not v49.props.loadNext) then
        v49.props.loadNext();
    end;
    v49.isNearBottom = true;
end;
v14.renderScrollingFrame = function(v50)
    local v51 = {};
    local l_startIndex_0 = v50.state.startIndex;
    if l_startIndex_0 ~= 1 then
        local v53 = v50.getScrollRef();
        if if v53 ~= nil then v50.calculateScrollOffset(v53) else 0 < 128 then
            l_startIndex_0 = 1;
        end;
    end;
    if l_startIndex_0 ~= 1 then
        local v54 = v50.props.itemList[1];
        local l_firstItem_1 = v50.state.firstItem;
        local v56;
        if not (v54 ~= nil) or l_firstItem_1 == nil then
            v56 = false;
        else
            if v54.stable_key ~= nil then
                v56 = true;
                if not (v54.stable_key ~= l_firstItem_1.stable_key) then
                    goto label3;
                end;
            end;
            v56 = false;
            if v54.messageId ~= nil then
                v56 = v54.messageId == l_firstItem_1.messageId;
            end;
        end;
        ::label3::;
        if not v56 then
            table.move(v50.props.itemList, l_startIndex_0, #v50.props.itemList, 1, v51);
            goto label2 --[[  true, true  ]];
        end;
    end;
    v51 = v50.props.itemList;
    ::label2::;
    return v2.createElement(l_BidirectionalFlatList_0, {
        data = v51,
        renderItem = function(v57)
            return v50.renderItem(v57.item);
        end,
        inverted = true,
        Size = v50.props.Size,
        style = {
            BackgroundTransparency = 1,
            ScrollBarThickness = 0,
            Name = "MessageList"
        },
        contentContainerStyle = {
            BackgroundTransparency = 1
        },
        keyExtractor = function(v58, v59)
            return (v58.stable_key or v58.messageId) or v59;
        end,
        windowSize = 5,
        initialNumToRender = 30,
        onScroll = v50.onScroll,
        onEndReached = function()
            v50.props.loadNext();
            return v4.resolve();
        end,
        onEndReachedThreshold = 300,
        onStartReachedThreshold = 64,
        compareItemData = v20,
        scrollEventThrottle = v50.props.scrollEventThrottle or 75,
        [v2.Ref] = v50.ref,
        autoscrollToTopThreshold = 33,
        enableAutoscrollToTop = true,
        ListHeaderComponent = function()
            return v2.createElement("Frame", {
                BackgroundTransparency = 1,
                Size = UDim2.new(1, 0, 0, 10)
            });
        end,
        showDefaultLoadingIndicators = false,
        onContentSizeChange = function(v60, _)
            v50:setState({
                width = v60
            });
        end,
        optimizeInvertedCanvasResize = true,
        UNSTABLE_forceSiblingLayoutUpdate = true
    });
end;
v14.renderEmptyMessageList = function(v62)
    return v2.createElement("Frame", {
        Size = v62.props.Size,
        BackgroundTransparency = 1
    });
end;
v14.render = function(v63)
    if #v63.props.itemList ~= 0 then
        return (v63:renderScrollingFrame());
    else
        return (v63:renderEmptyMessageList());
    end;
end;
return v14;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AppChat");
local v1 = require(l_script_FirstAncestor_0.Parent.AppChatNetworking);
local l_GET_MESSAGES_0 = require(l_script_FirstAncestor_0.Constants).PageSize.GET_MESSAGES;
local v3 = require(l_script_FirstAncestor_0.Flags.isAppChatChannelsAPIEnabled);
local v4 = require(l_script_FirstAncestor_0.Http.NetworkingChat);
local function _(v5, v6, v7)
    if not v3() then
        return function(v8)
            return v8:dispatch(v4.GetMessages.API(v5, l_GET_MESSAGES_0, v6)):catch(function(v9)
                warn("NetworkingChat failure in getOlderMessages, Status: " .. tostring(v9));
            end);
        end;
    else
        return function(v10)
            return v10:dispatch(v1.rodux.GetOlderMessages.API(v5, v7)):catch(function(v11)
                warn("AppChatNetworking failure in getOlderMessages, Status: " .. tostring(v11));
            end);
        end;
    end;
end;
return function(...)
    local v13, v14, v15 = ...;
    if not v3() then
        return function(v16)
            return v16:dispatch(v4.GetMessages.API(v13, l_GET_MESSAGES_0, v14)):catch(function(v17)
                warn("NetworkingChat failure in getOlderMessages, Status: " .. tostring(v17));
            end);
        end;
    else
        return function(v18)
            return v18:dispatch(v1.rodux.GetOlderMessages.API(v13, v15)):catch(function(v19)
                warn("AppChatNetworking failure in getOlderMessages, Status: " .. tostring(v19));
            end);
        end;
    end;
end;


return {
    multiGetOlderMessages = require(script.multiGetOlderMessages)
};


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AppChat");
local v1 = require(l_script_FirstAncestor_0.Parent.AppChatNetworking);
local v2 = require(l_script_FirstAncestor_0.Http.NetworkingChat);
local v3 = require(l_script_FirstAncestor_0.Utils.getDeepValue);
local v4 = require(l_script_FirstAncestor_0.Logger);
local v5 = require(l_script_FirstAncestor_0.Flags.isAppChatChannelsAPIEnabled);
local v6 = game:DefineFastFlag("AppChatAlwaysFetchUnreadCount", false);
local function _(v7, v8)
    return function(v9)
        local v10 = v3(v9:getState(), string.format("ChatAppReducer.Conversations.%s", v7 or ""));
        if not (not v10 or not v10.hasUnreadMessages) then
            if not v5() then
                v9:dispatch(v2.MarkAsRead.API(v7)):andThen(function()
                    if not (not v6 and not v8) then
                        v9:dispatch(v2.GetUnreadConversationCount.API()):catch(function(v11)
                            v4:error("NetworkingChat.GetUnreadConversationCount failure in markConversationAsRead, ", (("Status: %*"):format((tostring(v11)))));
                        end);
                    end;
                end):catch(function(v12)
                    v4:error((("NetworkingChat failure in markConversationAsRead, Status: %*"):format((tostring(v12)))));
                end);
            else
                v4:info("Marking conversation {} as read", v7);
                v9:dispatch(v1.rodux.MarkConversation.API(v7)):andThen(function()
                    v9:dispatch(v1.rodux.GetConversationMetadata.API()):catch(function(v13)
                        v4:error((("AppChatNetworking failure in markConversationAsRead, Status: %*"):format((tostring(v13)))));
                    end);
                end):catch(function(v14)
                    v4:error((("AppChatNetworking failure in markConversationAsRead, Status: %*"):format((tostring(v14)))));
                end);
                return ;
            end;
        end;
    end;
end;
return function(...)
    local v16, v17 = ...;
    return function(v18)
        local v19 = v3(v18:getState(), string.format("ChatAppReducer.Conversations.%s", v16 or ""));
        if not (not v19 or not v19.hasUnreadMessages) then
            if not v5() then
                v18:dispatch(v2.MarkAsRead.API(v16)):andThen(function()
                    if not (not v6 and not v17) then
                        v18:dispatch(v2.GetUnreadConversationCount.API()):catch(function(v20)
                            v4:error("NetworkingChat.GetUnreadConversationCount failure in markConversationAsRead, ", (("Status: %*"):format((tostring(v20)))));
                        end);
                    end;
                end):catch(function(v21)
                    v4:error((("NetworkingChat failure in markConversationAsRead, Status: %*"):format((tostring(v21)))));
                end);
            else
                v4:info("Marking conversation {} as read", v16);
                v18:dispatch(v1.rodux.MarkConversation.API(v16)):andThen(function()
                    v18:dispatch(v1.rodux.GetConversationMetadata.API()):catch(function(v22)
                        v4:error((("AppChatNetworking failure in markConversationAsRead, Status: %*"):format((tostring(v22)))));
                    end);
                end):catch(function(v23)
                    v4:error((("AppChatNetworking failure in markConversationAsRead, Status: %*"):format((tostring(v23)))));
                end);
                return ;
            end;
        end;
    end;
end;


local v0 = require(script.Parent.getOlderMessages);
local _ = function(v1)
    for v2, v3, _ in v1:CreateReverseIterator() do
        if v3.previousMessageId == nil then
            return v2;
        end;
    end;
    return v1.keys[1];
end;
return function(v6, v7)
    return function(v8)
        v7 = v7 or v8:getState().ChatAppReducer.conversations;
        for v9, v10 in pairs(v7) do
            if v10.fetchingOlderMessages then
                local l_messages_0 = v10.messages;
                local v12;
                for v13, v14, _ in l_messages_0:CreateReverseIterator() do
                    if v14.previousMessageId == nil then
                        v12 = v13;
                        goto label0 --[[  true, false  ]];
                    end;
                end;
                v12 = l_messages_0.keys[1];
                ::label0::;
                v8:dispatch(v0(v9, v12, v10.nextCursor, v6));
            end;
        end;
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AppChat");
local v1 = require(l_script_FirstAncestor_0.Parent.AppChatNetworking);
local v2 = require(l_script_FirstAncestor_0.Logger);
return function(v3)
    return function(v4)
        v4:dispatch(v1.rodux.UpdateTypingStatus.API(v3)):catch(function(v5)
            v2:error((("AppChatNetworking failure in updateTypingStatus, Status: %*"):format((tostring(v5)))));
        end);
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AppChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local v2 = require(l_script_FirstAncestor_0.Utils.getDeepValue);
local v3 = require(l_Parent_0.Cryo);
local v4 = require(l_script_FirstAncestor_0.Components.ChatConversation.Utils.filterForLinksWithPolicy);
local v5 = require(l_script_FirstAncestor_0.Components.ChatConversation.Utils.messageSortPredicate);
local v6 = require(l_script_FirstAncestor_0.Conversations.populateMessageWithState);
local v7 = {};
local v8 = {};
local v9 = {};
return function(v10, v11)
    local v12 = v2(v10, string.format("ChatAppReducer.Conversations.%s", v11 or ""));
    if v12 and v12.messages then
        if not (v12.messages == v7[v11]) or v12.sendingMessages ~= v9[v11] then
            local v13 = v2(v12.messages, "values");
            local v14 = {};
            if v12.sendingMessages then
                v14 = v2(v12.sendingMessages, "values");
                v13 = v3.Dictionary.join(v13, v14);
            end;
            local v15 = v3.List.sort(v3.Dictionary.values(v13), v5);
            local v16 = {};
            local v17 = nil;
            local v18 = nil;
            v17 = table.clone(v8[v11] or {});
            v18 = if #v17 > 0 and v17[#v17].sent then v17[#v17].sent:GetUnixTimestamp() else math.huge;
            for _, v20 in ipairs(v15) do
                local v21 = not not v14[v20.id] or false;
                for _, v23 in pairs(v4(v20)) do
                    local v24 = v6(v10, v23, v20.id, v12, v16[#v16], v21);
                    local l_messageId_0 = v24.messageId;
                    if not (not v24.sent or v24.sent:GetUnixTimestamp() >= v18) or #v17 == 0 then
                        v24.stable_key = l_messageId_0;
                    else
                        v24.stable_key = table.remove(v17, #v17).stable_key;
                    end;
                    table.insert(v16, v24);
                end;
            end;
            v7[v11] = v12.messages;
            v9[v11] = v12.sendingMessages;
            v8[v11] = v3.List.reverse(v16);
        end;
        return v8[v11];
    else
        return {};
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AppChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local v2 = require(l_script_FirstAncestor_0.Utils.getDeepValue);
local v3 = require(l_Parent_0.Cryo);
local v4 = require(l_script_FirstAncestor_0.Components.ChatConversation.Utils.messageSortPredicate);
local v5 = require(l_script_FirstAncestor_0.Components.ChatConversation.Utils.filterForLinksWithPolicy);
local v6 = require(l_script_FirstAncestor_0.Conversations.populateMessageWithState);
local l_HttpService_0 = game:GetService("HttpService");
return function(v8, v9)
    local l_conversation_0 = v8.conversation;
    if l_conversation_0 then
        local l_messages_0 = l_conversation_0.messages;
        local l_sendingMessages_0 = l_conversation_0.sendingMessages;
        local l_conversationId_0 = v8.conversationId;
        local v14 = v9.previousMessagesState[l_conversationId_0];
        local v15 = v9.previousSendingMessagesState[l_conversationId_0];
        local v16 = v9.previousMessagesResult[l_conversationId_0];
        if l_messages_0 then
            if l_messages_0 == v14 and l_sendingMessages_0 == v15 then
                return {
                    itemList = v16 or {},
                    previousMessagesState = v9.previousMessagesState,
                    previousSendingMessagesState = v9.previousSendingMessagesState,
                    previousMessagesResult = v9.previousMessagesResult
                };
            else
                local v17 = v2(l_messages_0, "values");
                local v18 = if not l_sendingMessages_0 then {} else v2(l_sendingMessages_0, "values");
                local v19 = v3.List.sort(v3.Dictionary.values((v3.Dictionary.join(v17, v18))), v4);
                local v20 = {};
                local v21 = table.clone(v16 or {});
                local v22 = if #v21 > 0 and v21[#v21].sent then v21[#v21].sent:GetUnixTimestamp() else math.huge;
                for _, v24 in v19, nil, nil do
                    local v25 = not not v18[v24.id];
                    for v26, v27 in v5(v24) do
                        local v28 = v6({
                            Users = v8.Users,
                            LocalUserId = v8.localUserId
                        }, v27, v24.id, l_conversation_0, v20[#v20], v25);
                        if not (not v28.sent or v28.sent:GetUnixTimestamp() >= v22) or #v21 == 0 then
                            v28.stable_key = if v26 > 1 then l_HttpService_0:GenerateGUID(true) else v28.messageId;
                        else
                            v28.stable_key = table.remove(v21, #v21).stable_key;
                        end;
                        table.insert(v20, v28);
                    end;
                end;
                if #v21 > 0 then
                    return {
                        itemList = v16 or {},
                        previousMessagesState = v9.previousMessagesState,
                        previousSendingMessagesState = v9.previousSendingMessagesState,
                        previousMessagesResult = v9.previousMessagesResult
                    };
                else
                    local v29 = table.clone(v9.previousMessagesState);
                    local v30 = table.clone(v9.previousSendingMessagesState);
                    local v31 = table.clone(v9.previousMessagesResult);
                    v29[l_conversationId_0] = l_messages_0;
                    v30[l_conversationId_0] = l_sendingMessages_0;
                    v31[l_conversationId_0] = v3.List.reverse(v20);
                    return {
                        itemList = v31[l_conversationId_0],
                        previousMessagesState = v29,
                        previousSendingMessagesState = v30,
                        previousMessagesResult = v31
                    };
                end;
            end;
        else
            return {
                itemList = v16 or {},
                previousMessagesState = v9.previousMessagesState,
                previousSendingMessagesState = v9.previousSendingMessagesState,
                previousMessagesResult = v9.previousMessagesResult
            };
        end;
    else
        return {
            itemList = {},
            previousMessagesState = v9.previousMessagesState,
            previousSendingMessagesState = v9.previousSendingMessagesState,
            previousMessagesResult = v9.previousMessagesResult
        };
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AppChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
game:DefineFastFlag("AppChatChannelsGetNewerMessagesWithPrevCursor", false);
local v2 = require(l_Parent_0.AppChatNetworking);
local v3 = require(l_Parent_0.Promise);
local v4 = require(l_script_FirstAncestor_0.Http.NetworkingChat);
local v5 = require(l_script_FirstAncestor_0.Conversations.Thunks.DEPRECATED_getConversations);
local v6 = require(l_script_FirstAncestor_0.Constants);
local v7 = require(l_script_FirstAncestor_0.Utils.reportToDiagByCountryCode);
local v8 = require(l_script_FirstAncestor_0.Logger):new(script.Name);
local v9 = require(l_script_FirstAncestor_0.Flags.isAppChatChannelsAPIEnabled);
local function _(v10)
    v7(v6.PerformanceMeasurement.LUA_CHAT_RECEIVE_MESSAGE, "MessageReceivedTime", tick() - v10);
end;
return function(v12, _, v14)
    v8:info("Getting new messages for {}", v12);
    return function(v15)
        local v16 = if not v9() then nil else {};
        local v17 = v15:getState().ChatAppReducer.Conversations[v12];
        if not v17 then
            if not v9() then
                v15:dispatch(v5({
                    v12
                })):catch(function(v18)
                    warn("NetworkingChat failure in GetConversations", v18);
                end);
            elseif v16 then
                table.insert(v16, v15:dispatch(v2.rodux.GetConversationDetails.API(v12)):catch(function(v19)
                    v8:error((("AppChatNetworking failure in GetConversationDetails: %*"):format((tostring(v19)))));
                end));
            end;
        end;
        if not v9() then
            v15:dispatch(v4.GetMessages.API(v12, v6.PageSize.GET_NEW_MESSAGES)):andThen(function()
                v7(v6.PerformanceMeasurement.LUA_CHAT_RECEIVE_MESSAGE, "MessageReceivedTime", tick() - v14);
            end):catch(function(v20)
                warn("NetworkingChat failure in GetNewMessages", v20);
            end);
        else
            local v21 = if not game:GetFastFlag("AppChatChannelsGetNewerMessagesWithPrevCursor") then nil else v17 and v17.previousCursor or nil;
            if v16 then
                table.insert(v16, v15:dispatch(v2.rodux.GetNewerMessages.API(v12, v21)):andThen(function()
                    v7(v6.PerformanceMeasurement.LUA_CHAT_RECEIVE_MESSAGE, "MessageReceivedTime", tick() - v14);
                end):catch(function(v22)
                    v8:error((("AppChatNetworking failure in GetNewerMessages: %*"):format((tostring(v22)))));
                end));
            end;
        end;
        if not v9() then
            return nil;
        else
            return v3.allSettled(v16);
        end;
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AppChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local v2 = require(l_Parent_0.AppChatNetworking);
local v3 = require(l_script_FirstAncestor_0.Http.RoduxNetworking);
local v4 = require(l_script_FirstAncestor_0.Http.NetworkingChat);
local v5 = require(l_Parent_0.Promise);
local v6 = require(l_script_FirstAncestor_0.Logger):new(script.Name);
local v7 = require(l_script_FirstAncestor_0.Utils.getDeepValue);
local v8 = game:DefineFastFlag("AppChatRemainingOlderMessagesLogResolve", false);
local v9 = require(l_script_FirstAncestor_0.Flags.isAppChatChannelsAPIEnabled);
local function v16(v10)
    local v11 = v7(v10, "keys");
    local v12 = v7(v10, "values");
    local v13 = nil;
    for _, v15 in pairs(v11) do
        if v12[v15] and v12[v15].previousMessageId == nil then
            return v15;
        end;
    end;
    return v13;
end;
return function(v17, v18)
    v6:info("Maybe getting older messages for {}", v18);
    return function(v19)
        local l_ChatAppReducer_0 = v19:getState().ChatAppReducer;
        if l_ChatAppReducer_0 and l_ChatAppReducer_0.Conversations then
            local v21 = l_ChatAppReducer_0.Conversations[v18];
            local _ = nil;
            local v23 = if not v9() then v4.GetMessages.getStatus(v19:getState(), v18) else v2.rodux.GetOlderMessages.getStatus(v19:getState(), v18) == v3.Enum.NetworkStatus.Fetching;
            if not v8 then
                if not (not (not v21 or v23) and not v21.fetchedOldestMessage) then
                    return v5.resolve();
                end;
            elseif v21 then
                if not v23 then
                    if v21.fetchedOldestMessage then
                        v6:debug("Canceling since we have already fetched the oldest message for conversation id {}", v18);
                        return v5.resolve();
                    end;
                else
                    v6:debug("Canceling since we are already fetching older messages for conversation id {}", v18);
                    return v5.resolve();
                end;
            else
                v6:debug("Canceling since conversation id {} is not in local state", v18);
                return v5.resolve();
            end;
            return v17(v18, v16(v21.messages), v21.nextCursor);
        else
            return v5.resolve();
        end;
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AppChat");
local v1 = require(l_script_FirstAncestor_0.Conversations.Thunks.SendTextMessage);
local v2 = require(l_script_FirstAncestor_0.Logger):new(script.Name);
return function(...)
    v2:info("Sending text message");
    return v1(...);
end;


return {
    NetworkRequests = require(script.NetworkRequests),
    Thunks = require(script.Thunks)
};